logixia 1.0.3 → 1.1.2
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 +523 -2852
- package/dist/{build-C67p8wVr.js → build-DIEB3doa.js} +7 -2
- package/dist/build-DIEB3doa.js.map +1 -0
- package/dist/{build-MpmEusc_.mjs → build-MmD3T4bV.mjs} +8 -3
- package/dist/build-MmD3T4bV.mjs.map +1 -0
- package/dist/{chunk-C41Io3cc.mjs → chunk-uEZWKkIX.mjs} +1 -1
- package/dist/{esm-BYmTa3gi.mjs → esm-BRY8ugtK.mjs} +438 -276
- package/dist/esm-BRY8ugtK.mjs.map +1 -0
- package/dist/{esm-BTpcNBX_.js → esm-CzjF801-.js} +437 -275
- package/dist/esm-CzjF801-.js.map +1 -0
- package/dist/index.d.mts +1012 -95
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +1012 -95
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3558 -1435
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3517 -1408
- package/dist/index.mjs.map +1 -1
- package/dist/{lib-DvMm_tAr.mjs → lib-BNWFXK2z.mjs} +2211 -786
- package/dist/lib-BNWFXK2z.mjs.map +1 -0
- package/dist/{lib-xHiD5O-N.js → lib-Bb_wxP5g.js} +2210 -785
- package/dist/lib-Bb_wxP5g.js.map +1 -0
- package/dist/{promise-CnIyndHL.mjs → promise-BAWXE7C8.mjs} +820 -1449
- package/dist/promise-BAWXE7C8.mjs.map +1 -0
- package/dist/{promise-C7YeyZbJ.js → promise-Tbon3Kaq.js} +819 -1448
- package/dist/promise-Tbon3Kaq.js.map +1 -0
- package/dist/{sqlite3--ZdiJYT3.mjs → sqlite3-BUpkBlte.mjs} +2 -2
- package/dist/{sqlite3--ZdiJYT3.mjs.map → sqlite3-BUpkBlte.mjs.map} +1 -1
- package/package.json +124 -53
- package/dist/build-C67p8wVr.js.map +0 -1
- package/dist/build-MpmEusc_.mjs.map +0 -1
- package/dist/esm-BTpcNBX_.js.map +0 -1
- package/dist/esm-BYmTa3gi.mjs.map +0 -1
- package/dist/lib-DvMm_tAr.mjs.map +0 -1
- package/dist/lib-xHiD5O-N.js.map +0 -1
- package/dist/promise-C7YeyZbJ.js.map +0 -1
- package/dist/promise-CnIyndHL.mjs.map +0 -1
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as __require, t as __commonJS } from "./chunk-uEZWKkIX.mjs";
|
|
2
2
|
|
|
3
|
-
//#region node_modules/
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
//#region node_modules/sql-escaper/lib/index.js
|
|
4
|
+
var require_lib$3 = /* @__PURE__ */ __commonJS({ "node_modules/sql-escaper/lib/index.js": ((exports) => {
|
|
5
|
+
/**
|
|
6
|
+
* Adapted from https://github.com/mysqljs/sqlstring/blob/cd528556b4b6bcf300c3db515026935dedf7cfa1/lib/SqlString.js
|
|
7
|
+
* MIT LICENSE: https://github.com/mysqljs/sqlstring/blob/cd528556b4b6bcf300c3db515026935dedf7cfa1/LICENSE
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.raw = exports.format = exports.escape = exports.arrayToList = exports.bufferToString = exports.objectToValues = exports.escapeId = exports.dateToString = void 0;
|
|
11
|
+
const node_buffer_1 = __require("node:buffer");
|
|
12
|
+
const regex = {
|
|
13
|
+
backtick: /`/g,
|
|
14
|
+
dot: /\./g,
|
|
15
|
+
timezone: /([+\-\s])(\d\d):?(\d\d)?/,
|
|
16
|
+
escapeChars: /[\0\b\t\n\r\x1a"'\\]/g
|
|
17
|
+
};
|
|
18
|
+
const CHARS_ESCAPE_MAP = {
|
|
10
19
|
"\0": "\\0",
|
|
11
20
|
"\b": "\\b",
|
|
12
21
|
" ": "\\t",
|
|
@@ -17,142 +26,274 @@ var require_SqlString = /* @__PURE__ */ __commonJS({ "node_modules/sqlstring/lib
|
|
|
17
26
|
"'": "\\'",
|
|
18
27
|
"\\": "\\\\"
|
|
19
28
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
const charCode = {
|
|
30
|
+
singleQuote: 39,
|
|
31
|
+
backtick: 96,
|
|
32
|
+
backslash: 92,
|
|
33
|
+
dash: 45,
|
|
34
|
+
slash: 47,
|
|
35
|
+
asterisk: 42,
|
|
36
|
+
questionMark: 63,
|
|
37
|
+
newline: 10,
|
|
38
|
+
space: 32,
|
|
39
|
+
tab: 9,
|
|
40
|
+
carriageReturn: 13
|
|
27
41
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
else if (typeof val.toSqlString === "function") return String(val.toSqlString());
|
|
37
|
-
else if (stringifyObjects) return escapeString(val.toString());
|
|
38
|
-
else return SqlString$3.objectToValues(val, timeZone);
|
|
39
|
-
default: return escapeString(val);
|
|
42
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43
|
+
const isWordChar = (code) => code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 95;
|
|
44
|
+
const isWhitespace = (code) => code === charCode.space || code === charCode.tab || code === charCode.newline || code === charCode.carriageReturn;
|
|
45
|
+
const hasOnlyWhitespaceBetween = (sql, start, end) => {
|
|
46
|
+
if (start >= end) return true;
|
|
47
|
+
for (let i$4 = start; i$4 < end; i$4++) {
|
|
48
|
+
const code = sql.charCodeAt(i$4);
|
|
49
|
+
if (code !== charCode.space && code !== charCode.tab && code !== charCode.newline && code !== charCode.carriageReturn) return false;
|
|
40
50
|
}
|
|
51
|
+
return true;
|
|
52
|
+
};
|
|
53
|
+
const toLower = (code) => code | 32;
|
|
54
|
+
const matchesWord = (sql, position, word, length) => {
|
|
55
|
+
for (let offset = 0; offset < word.length; offset++) if (toLower(sql.charCodeAt(position + offset)) !== word.charCodeAt(offset)) return false;
|
|
56
|
+
return (position === 0 || !isWordChar(sql.charCodeAt(position - 1))) && (position + word.length >= length || !isWordChar(sql.charCodeAt(position + word.length)));
|
|
41
57
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
else
|
|
58
|
+
const skipSqlContext = (sql, position) => {
|
|
59
|
+
const currentChar = sql.charCodeAt(position);
|
|
60
|
+
const nextChar = sql.charCodeAt(position + 1);
|
|
61
|
+
if (currentChar === charCode.singleQuote) {
|
|
62
|
+
for (let cursor = position + 1; cursor < sql.length; cursor++) if (sql.charCodeAt(cursor) === charCode.backslash) cursor++;
|
|
63
|
+
else if (sql.charCodeAt(cursor) === charCode.singleQuote) return cursor + 1;
|
|
64
|
+
return sql.length;
|
|
65
|
+
}
|
|
66
|
+
if (currentChar === charCode.backtick) {
|
|
67
|
+
const length = sql.length;
|
|
68
|
+
for (let cursor = position + 1; cursor < length; cursor++) {
|
|
69
|
+
if (sql.charCodeAt(cursor) !== charCode.backtick) continue;
|
|
70
|
+
if (sql.charCodeAt(cursor + 1) === charCode.backtick) {
|
|
71
|
+
cursor++;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
return cursor + 1;
|
|
75
|
+
}
|
|
76
|
+
return length;
|
|
48
77
|
}
|
|
49
|
-
|
|
78
|
+
if (currentChar === charCode.dash && nextChar === charCode.dash) {
|
|
79
|
+
const lineBreak = sql.indexOf("\n", position + 2);
|
|
80
|
+
return lineBreak === -1 ? sql.length : lineBreak + 1;
|
|
81
|
+
}
|
|
82
|
+
if (currentChar === charCode.slash && nextChar === charCode.asterisk) {
|
|
83
|
+
const commentEnd = sql.indexOf("*/", position + 2);
|
|
84
|
+
return commentEnd === -1 ? sql.length : commentEnd + 2;
|
|
85
|
+
}
|
|
86
|
+
return -1;
|
|
50
87
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var len = match[0].length;
|
|
61
|
-
if (len > 2) continue;
|
|
62
|
-
var value = len === 2 ? SqlString$3.escapeId(values[valuesIndex]) : SqlString$3.escape(values[valuesIndex], stringifyObjects, timeZone);
|
|
63
|
-
result += sql.slice(chunkIndex, match.index) + value;
|
|
64
|
-
chunkIndex = placeholdersRegex.lastIndex;
|
|
65
|
-
valuesIndex++;
|
|
88
|
+
const findNextPlaceholder = (sql, start) => {
|
|
89
|
+
const sqlLength = sql.length;
|
|
90
|
+
for (let position = start; position < sqlLength; position++) {
|
|
91
|
+
const code = sql.charCodeAt(position);
|
|
92
|
+
if (code === charCode.questionMark) return position;
|
|
93
|
+
if (code === charCode.singleQuote || code === charCode.backtick || code === charCode.dash || code === charCode.slash) {
|
|
94
|
+
const contextEnd = skipSqlContext(sql, position);
|
|
95
|
+
if (contextEnd !== -1) position = contextEnd - 1;
|
|
96
|
+
}
|
|
66
97
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
98
|
+
return -1;
|
|
99
|
+
};
|
|
100
|
+
const findSetKeyword = (sql, startFrom = 0) => {
|
|
101
|
+
const length = sql.length;
|
|
102
|
+
for (let position = startFrom; position < length; position++) {
|
|
103
|
+
const code = sql.charCodeAt(position);
|
|
104
|
+
const lower = code | 32;
|
|
105
|
+
if (code === charCode.singleQuote || code === charCode.backtick || code === charCode.dash || code === charCode.slash) {
|
|
106
|
+
const contextEnd = skipSqlContext(sql, position);
|
|
107
|
+
if (contextEnd !== -1) {
|
|
108
|
+
position = contextEnd - 1;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (lower === 115 && matchesWord(sql, position, "set", length)) return position + 3;
|
|
113
|
+
if (lower === 107 && matchesWord(sql, position, "key", length)) {
|
|
114
|
+
let cursor = position + 3;
|
|
115
|
+
while (cursor < length && isWhitespace(sql.charCodeAt(cursor))) cursor++;
|
|
116
|
+
if (matchesWord(sql, cursor, "update", length)) return cursor + 6;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return -1;
|
|
70
120
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
121
|
+
const isDate = (value) => Object.prototype.toString.call(value) === "[object Date]";
|
|
122
|
+
const hasSqlString = (value) => typeof value === "object" && value !== null && "toSqlString" in value && typeof value.toSqlString === "function";
|
|
123
|
+
const escapeString = (value) => {
|
|
124
|
+
regex.escapeChars.lastIndex = 0;
|
|
125
|
+
let chunkIndex = 0;
|
|
126
|
+
let escapedValue = "";
|
|
127
|
+
let match;
|
|
128
|
+
for (match = regex.escapeChars.exec(value); match !== null; match = regex.escapeChars.exec(value)) {
|
|
129
|
+
escapedValue += value.slice(chunkIndex, match.index);
|
|
130
|
+
escapedValue += CHARS_ESCAPE_MAP[match[0]];
|
|
131
|
+
chunkIndex = regex.escapeChars.lastIndex;
|
|
132
|
+
}
|
|
133
|
+
if (chunkIndex === 0) return `'${value}'`;
|
|
134
|
+
if (chunkIndex < value.length) return `'${escapedValue}${value.slice(chunkIndex)}'`;
|
|
135
|
+
return `'${escapedValue}'`;
|
|
136
|
+
};
|
|
137
|
+
const pad2 = (value) => value < 10 ? "0" + value : "" + value;
|
|
138
|
+
const pad3 = (value) => value < 10 ? "00" + value : value < 100 ? "0" + value : "" + value;
|
|
139
|
+
const pad4 = (value) => value < 10 ? "000" + value : value < 100 ? "00" + value : value < 1e3 ? "0" + value : "" + value;
|
|
140
|
+
const convertTimezone = (tz) => {
|
|
141
|
+
if (tz === "Z") return 0;
|
|
142
|
+
const timezoneMatch = tz.match(regex.timezone);
|
|
143
|
+
if (timezoneMatch) return (timezoneMatch[1] === "-" ? -1 : 1) * (Number.parseInt(timezoneMatch[2], 10) + (timezoneMatch[3] ? Number.parseInt(timezoneMatch[3], 10) : 0) / 60) * 60;
|
|
144
|
+
return false;
|
|
145
|
+
};
|
|
146
|
+
const dateToString = (date, timezone) => {
|
|
147
|
+
if (Number.isNaN(date.getTime())) return "NULL";
|
|
148
|
+
let year;
|
|
149
|
+
let month;
|
|
150
|
+
let day;
|
|
151
|
+
let hour;
|
|
152
|
+
let minute;
|
|
153
|
+
let second;
|
|
154
|
+
let millisecond;
|
|
155
|
+
if (timezone === "local") {
|
|
156
|
+
year = date.getFullYear();
|
|
157
|
+
month = date.getMonth() + 1;
|
|
158
|
+
day = date.getDate();
|
|
159
|
+
hour = date.getHours();
|
|
160
|
+
minute = date.getMinutes();
|
|
161
|
+
second = date.getSeconds();
|
|
162
|
+
millisecond = date.getMilliseconds();
|
|
89
163
|
} else {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
164
|
+
const timezoneOffsetMinutes = convertTimezone(timezone);
|
|
165
|
+
let time = date.getTime();
|
|
166
|
+
if (timezoneOffsetMinutes !== false && timezoneOffsetMinutes !== 0) time += timezoneOffsetMinutes * 6e4;
|
|
167
|
+
const adjustedDate = new Date(time);
|
|
168
|
+
year = adjustedDate.getUTCFullYear();
|
|
169
|
+
month = adjustedDate.getUTCMonth() + 1;
|
|
170
|
+
day = adjustedDate.getUTCDate();
|
|
171
|
+
hour = adjustedDate.getUTCHours();
|
|
172
|
+
minute = adjustedDate.getUTCMinutes();
|
|
173
|
+
second = adjustedDate.getUTCSeconds();
|
|
174
|
+
millisecond = adjustedDate.getUTCMilliseconds();
|
|
175
|
+
}
|
|
176
|
+
return escapeString(pad4(year) + "-" + pad2(month) + "-" + pad2(day) + " " + pad2(hour) + ":" + pad2(minute) + ":" + pad2(second) + "." + pad3(millisecond));
|
|
102
177
|
};
|
|
103
|
-
|
|
104
|
-
|
|
178
|
+
exports.dateToString = dateToString;
|
|
179
|
+
const escapeId = (value, forbidQualified) => {
|
|
180
|
+
if (Array.isArray(value)) {
|
|
181
|
+
const length = value.length;
|
|
182
|
+
const parts = new Array(length);
|
|
183
|
+
for (let i$4 = 0; i$4 < length; i$4++) parts[i$4] = (0, exports.escapeId)(value[i$4], forbidQualified);
|
|
184
|
+
return parts.join(", ");
|
|
185
|
+
}
|
|
186
|
+
const identifier = String(value);
|
|
187
|
+
const hasJsonOperator = identifier.indexOf("->") !== -1;
|
|
188
|
+
if (forbidQualified || hasJsonOperator) {
|
|
189
|
+
if (identifier.indexOf("`") === -1) return `\`${identifier}\``;
|
|
190
|
+
return `\`${identifier.replace(regex.backtick, "``")}\``;
|
|
191
|
+
}
|
|
192
|
+
if (identifier.indexOf("`") === -1 && identifier.indexOf(".") === -1) return `\`${identifier}\``;
|
|
193
|
+
return `\`${identifier.replace(regex.backtick, "``").replace(regex.dot, "`.`")}\``;
|
|
105
194
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
195
|
+
exports.escapeId = escapeId;
|
|
196
|
+
const objectToValues = (object, timezone) => {
|
|
197
|
+
const keys$1 = Object.keys(object);
|
|
198
|
+
const keysLength = keys$1.length;
|
|
199
|
+
if (keysLength === 0) return "";
|
|
200
|
+
let sql = "";
|
|
201
|
+
for (let i$4 = 0; i$4 < keysLength; i$4++) {
|
|
202
|
+
const key$1 = keys$1[i$4];
|
|
203
|
+
const value = object[key$1];
|
|
204
|
+
if (typeof value === "function") continue;
|
|
205
|
+
if (sql.length > 0) sql += ", ";
|
|
206
|
+
sql += (0, exports.escapeId)(key$1);
|
|
207
|
+
sql += " = ";
|
|
208
|
+
sql += (0, exports.escape)(value, true, timezone);
|
|
112
209
|
}
|
|
113
210
|
return sql;
|
|
114
211
|
};
|
|
115
|
-
|
|
212
|
+
exports.objectToValues = objectToValues;
|
|
213
|
+
const bufferToString = (buffer$1) => `X${escapeString(buffer$1.toString("hex"))}`;
|
|
214
|
+
exports.bufferToString = bufferToString;
|
|
215
|
+
const arrayToList = (array, timezone) => {
|
|
216
|
+
const length = array.length;
|
|
217
|
+
const parts = new Array(length);
|
|
218
|
+
for (let i$4 = 0; i$4 < length; i$4++) {
|
|
219
|
+
const value = array[i$4];
|
|
220
|
+
if (Array.isArray(value)) parts[i$4] = `(${(0, exports.arrayToList)(value, timezone)})`;
|
|
221
|
+
else parts[i$4] = (0, exports.escape)(value, true, timezone);
|
|
222
|
+
}
|
|
223
|
+
return parts.join(", ");
|
|
224
|
+
};
|
|
225
|
+
exports.arrayToList = arrayToList;
|
|
226
|
+
const escape = (value, stringifyObjects, timezone) => {
|
|
227
|
+
if (value === void 0 || value === null) return "NULL";
|
|
228
|
+
switch (typeof value) {
|
|
229
|
+
case "boolean": return value ? "true" : "false";
|
|
230
|
+
case "number":
|
|
231
|
+
case "bigint": return value + "";
|
|
232
|
+
case "object":
|
|
233
|
+
if (isDate(value)) return (0, exports.dateToString)(value, timezone || "local");
|
|
234
|
+
if (Array.isArray(value)) return (0, exports.arrayToList)(value, timezone);
|
|
235
|
+
if (node_buffer_1.Buffer.isBuffer(value)) return (0, exports.bufferToString)(value);
|
|
236
|
+
if (value instanceof Uint8Array) return (0, exports.bufferToString)(node_buffer_1.Buffer.from(value));
|
|
237
|
+
if (hasSqlString(value)) return String(value.toSqlString());
|
|
238
|
+
if (!(stringifyObjects === void 0 || stringifyObjects === null)) return escapeString(String(value));
|
|
239
|
+
if (isRecord(value)) return (0, exports.objectToValues)(value, timezone);
|
|
240
|
+
return escapeString(String(value));
|
|
241
|
+
case "string": return escapeString(value);
|
|
242
|
+
default: return escapeString(String(value));
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
exports.escape = escape;
|
|
246
|
+
const format = (sql, values, stringifyObjects, timezone) => {
|
|
247
|
+
if (values === void 0 || values === null) return sql;
|
|
248
|
+
const valuesArray = Array.isArray(values) ? values : [values];
|
|
249
|
+
const length = valuesArray.length;
|
|
250
|
+
let setIndex = -2;
|
|
251
|
+
let result = "";
|
|
252
|
+
let chunkIndex = 0;
|
|
253
|
+
let valuesIndex = 0;
|
|
254
|
+
let placeholderPosition = findNextPlaceholder(sql, 0);
|
|
255
|
+
while (valuesIndex < length && placeholderPosition !== -1) {
|
|
256
|
+
let placeholderEnd = placeholderPosition + 1;
|
|
257
|
+
let escapedValue;
|
|
258
|
+
while (sql.charCodeAt(placeholderEnd) === 63) placeholderEnd++;
|
|
259
|
+
const placeholderLength = placeholderEnd - placeholderPosition;
|
|
260
|
+
const currentValue = valuesArray[valuesIndex];
|
|
261
|
+
if (placeholderLength > 2) {
|
|
262
|
+
placeholderPosition = findNextPlaceholder(sql, placeholderEnd);
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
if (placeholderLength === 2) escapedValue = (0, exports.escapeId)(currentValue);
|
|
266
|
+
else if (typeof currentValue === "number") escapedValue = `${currentValue}`;
|
|
267
|
+
else if (typeof currentValue === "object" && currentValue !== null && !stringifyObjects) {
|
|
268
|
+
if (setIndex === -2) setIndex = findSetKeyword(sql);
|
|
269
|
+
if (setIndex !== -1 && setIndex <= placeholderPosition && hasOnlyWhitespaceBetween(sql, setIndex, placeholderPosition) && !hasSqlString(currentValue) && !Array.isArray(currentValue) && !node_buffer_1.Buffer.isBuffer(currentValue) && !(currentValue instanceof Uint8Array) && !isDate(currentValue) && isRecord(currentValue)) {
|
|
270
|
+
escapedValue = (0, exports.objectToValues)(currentValue, timezone);
|
|
271
|
+
setIndex = findSetKeyword(sql, placeholderEnd);
|
|
272
|
+
} else escapedValue = (0, exports.escape)(currentValue, true, timezone);
|
|
273
|
+
} else escapedValue = (0, exports.escape)(currentValue, stringifyObjects, timezone);
|
|
274
|
+
result += sql.slice(chunkIndex, placeholderPosition);
|
|
275
|
+
result += escapedValue;
|
|
276
|
+
chunkIndex = placeholderEnd;
|
|
277
|
+
valuesIndex++;
|
|
278
|
+
placeholderPosition = findNextPlaceholder(sql, placeholderEnd);
|
|
279
|
+
}
|
|
280
|
+
if (chunkIndex === 0) return sql;
|
|
281
|
+
if (chunkIndex < sql.length) return result + sql.slice(chunkIndex);
|
|
282
|
+
return result;
|
|
283
|
+
};
|
|
284
|
+
exports.format = format;
|
|
285
|
+
const raw = (sql) => {
|
|
116
286
|
if (typeof sql !== "string") throw new TypeError("argument sql must be a string");
|
|
117
|
-
return { toSqlString:
|
|
118
|
-
return sql;
|
|
119
|
-
} };
|
|
287
|
+
return { toSqlString: () => sql };
|
|
120
288
|
};
|
|
121
|
-
|
|
122
|
-
var chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex = 0;
|
|
123
|
-
var escapedVal = "";
|
|
124
|
-
var match;
|
|
125
|
-
while (match = CHARS_GLOBAL_REGEXP.exec(val)) {
|
|
126
|
-
escapedVal += val.slice(chunkIndex, match.index) + CHARS_ESCAPE_MAP[match[0]];
|
|
127
|
-
chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex;
|
|
128
|
-
}
|
|
129
|
-
if (chunkIndex === 0) return "'" + val + "'";
|
|
130
|
-
if (chunkIndex < val.length) return "'" + escapedVal + val.slice(chunkIndex) + "'";
|
|
131
|
-
return "'" + escapedVal + "'";
|
|
132
|
-
}
|
|
133
|
-
function zeroPad(number, length) {
|
|
134
|
-
number = number.toString();
|
|
135
|
-
while (number.length < length) number = "0" + number;
|
|
136
|
-
return number;
|
|
137
|
-
}
|
|
138
|
-
function convertTimezone(tz) {
|
|
139
|
-
if (tz === "Z") return 0;
|
|
140
|
-
var m = tz.match(/([\+\-\s])(\d\d):?(\d\d)?/);
|
|
141
|
-
if (m) return (m[1] === "-" ? -1 : 1) * (parseInt(m[2], 10) + (m[3] ? parseInt(m[3], 10) : 0) / 60) * 60;
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
}) });
|
|
145
|
-
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region node_modules/sqlstring/index.js
|
|
148
|
-
var require_sqlstring = /* @__PURE__ */ __commonJS({ "node_modules/sqlstring/index.js": ((exports, module) => {
|
|
149
|
-
module.exports = require_SqlString();
|
|
289
|
+
exports.raw = raw;
|
|
150
290
|
}) });
|
|
151
291
|
|
|
152
292
|
//#endregion
|
|
153
293
|
//#region node_modules/lru.min/lib/index.js
|
|
154
294
|
var require_lib$2 = /* @__PURE__ */ __commonJS({ "node_modules/lru.min/lib/index.js": ((exports) => {
|
|
155
295
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
296
|
+
exports.createLRU = void 0;
|
|
156
297
|
const createLRU$3 = (options) => {
|
|
157
298
|
let { max } = options;
|
|
158
299
|
if (!(Number.isInteger(max) && max > 0)) throw new TypeError("`max` must be a positive integer");
|
|
@@ -166,50 +307,96 @@ var require_lib$2 = /* @__PURE__ */ __commonJS({ "node_modules/lru.min/lib/index
|
|
|
166
307
|
const valList = new Array(max).fill(void 0);
|
|
167
308
|
const next = new Array(max).fill(0);
|
|
168
309
|
const prev = new Array(max).fill(0);
|
|
169
|
-
const
|
|
170
|
-
if (index === tail) return;
|
|
171
|
-
const nextIndex = next[index];
|
|
172
|
-
const prevIndex = prev[index];
|
|
173
|
-
if (index === head) head = nextIndex;
|
|
174
|
-
else if (type === "get" || prevIndex !== 0) next[prevIndex] = nextIndex;
|
|
175
|
-
if (nextIndex !== 0) prev[nextIndex] = prevIndex;
|
|
310
|
+
const linkTail = (index) => {
|
|
176
311
|
next[tail] = index;
|
|
177
312
|
prev[index] = tail;
|
|
178
313
|
next[index] = 0;
|
|
179
314
|
tail = index;
|
|
180
315
|
};
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
316
|
+
const moveToTail = (index) => {
|
|
317
|
+
if (index === tail) return;
|
|
318
|
+
const nextIndex = next[index];
|
|
319
|
+
const prevIndex = prev[index];
|
|
320
|
+
if (index === head) head = nextIndex;
|
|
321
|
+
else next[prevIndex] = nextIndex;
|
|
322
|
+
prev[nextIndex] = prevIndex;
|
|
323
|
+
linkTail(index);
|
|
324
|
+
};
|
|
325
|
+
const _shrink = (newMax) => {
|
|
326
|
+
let current = tail;
|
|
327
|
+
const preserve = Math.min(size, newMax);
|
|
328
|
+
const remove = size - preserve;
|
|
329
|
+
const newKeyList = new Array(preserve);
|
|
330
|
+
const newValList = new Array(preserve);
|
|
331
|
+
for (let i$4 = 0; i$4 < remove; i$4++) {
|
|
332
|
+
const key$1 = keyList[head];
|
|
333
|
+
onEviction === null || onEviction === void 0 || onEviction(key$1, valList[head]);
|
|
334
|
+
keyMap.delete(key$1);
|
|
335
|
+
head = next[head];
|
|
336
|
+
}
|
|
337
|
+
for (let i$4 = preserve - 1; i$4 >= 0; i$4--) {
|
|
338
|
+
newKeyList[i$4] = keyList[current];
|
|
339
|
+
newValList[i$4] = valList[current];
|
|
340
|
+
keyMap.set(keyList[current], i$4);
|
|
341
|
+
current = prev[current];
|
|
342
|
+
}
|
|
343
|
+
head = 0;
|
|
344
|
+
tail = preserve - 1;
|
|
345
|
+
size = preserve;
|
|
346
|
+
keyList.length = newMax;
|
|
347
|
+
valList.length = newMax;
|
|
348
|
+
next.length = newMax;
|
|
349
|
+
prev.length = newMax;
|
|
350
|
+
for (let i$4 = 0; i$4 < preserve; i$4++) {
|
|
351
|
+
keyList[i$4] = newKeyList[i$4];
|
|
352
|
+
valList[i$4] = newValList[i$4];
|
|
353
|
+
next[i$4] = i$4 + 1;
|
|
354
|
+
prev[i$4] = i$4 - 1;
|
|
355
|
+
}
|
|
356
|
+
free = [];
|
|
357
|
+
for (let i$4 = preserve; i$4 < newMax; i$4++) free.push(i$4);
|
|
358
|
+
};
|
|
359
|
+
const _grow = (newMax) => {
|
|
360
|
+
keyList.length = newMax;
|
|
361
|
+
valList.length = newMax;
|
|
362
|
+
next.length = newMax;
|
|
363
|
+
prev.length = newMax;
|
|
364
|
+
keyList.fill(void 0, max);
|
|
365
|
+
valList.fill(void 0, max);
|
|
366
|
+
next.fill(0, max);
|
|
367
|
+
prev.fill(0, max);
|
|
194
368
|
};
|
|
195
369
|
return {
|
|
196
370
|
set(key$1, value) {
|
|
197
371
|
if (key$1 === void 0) return;
|
|
198
372
|
let index = keyMap.get(key$1);
|
|
199
373
|
if (index === void 0) {
|
|
200
|
-
|
|
374
|
+
if (size === max) {
|
|
375
|
+
index = head;
|
|
376
|
+
const evictKey = keyList[index];
|
|
377
|
+
onEviction === null || onEviction === void 0 || onEviction(evictKey, valList[index]);
|
|
378
|
+
keyMap.delete(evictKey);
|
|
379
|
+
head = next[index];
|
|
380
|
+
prev[head] = 0;
|
|
381
|
+
} else {
|
|
382
|
+
index = free.length > 0 ? free.pop() : size;
|
|
383
|
+
size++;
|
|
384
|
+
}
|
|
201
385
|
keyMap.set(key$1, index);
|
|
202
386
|
keyList[index] = key$1;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
387
|
+
valList[index] = value;
|
|
388
|
+
if (size === 1) head = tail = index;
|
|
389
|
+
else linkTail(index);
|
|
390
|
+
} else {
|
|
391
|
+
onEviction === null || onEviction === void 0 || onEviction(key$1, valList[index]);
|
|
392
|
+
valList[index] = value;
|
|
393
|
+
moveToTail(index);
|
|
394
|
+
}
|
|
208
395
|
},
|
|
209
396
|
get(key$1) {
|
|
210
397
|
const index = keyMap.get(key$1);
|
|
211
398
|
if (index === void 0) return;
|
|
212
|
-
if (index !== tail)
|
|
399
|
+
if (index !== tail) moveToTail(index);
|
|
213
400
|
return valList[index];
|
|
214
401
|
},
|
|
215
402
|
peek: (key$1) => {
|
|
@@ -257,24 +444,37 @@ var require_lib$2 = /* @__PURE__ */ __commonJS({ "node_modules/lru.min/lib/index
|
|
|
257
444
|
valList[index] = void 0;
|
|
258
445
|
const prevIndex = prev[index];
|
|
259
446
|
const nextIndex = next[index];
|
|
260
|
-
if (prevIndex !== 0) next[prevIndex] = nextIndex;
|
|
261
|
-
if (nextIndex !== 0) prev[nextIndex] = prevIndex;
|
|
262
447
|
if (index === head) head = nextIndex;
|
|
448
|
+
else next[prevIndex] = nextIndex;
|
|
263
449
|
if (index === tail) tail = prevIndex;
|
|
450
|
+
else prev[nextIndex] = prevIndex;
|
|
264
451
|
size--;
|
|
265
452
|
return true;
|
|
266
453
|
},
|
|
267
454
|
evict: (number) => {
|
|
268
455
|
let toPrune = Math.min(number, size);
|
|
269
456
|
while (toPrune > 0) {
|
|
270
|
-
|
|
457
|
+
const evictHead = head;
|
|
458
|
+
const key$1 = keyList[evictHead];
|
|
459
|
+
onEviction === null || onEviction === void 0 || onEviction(key$1, valList[evictHead]);
|
|
460
|
+
keyMap.delete(key$1);
|
|
461
|
+
keyList[evictHead] = void 0;
|
|
462
|
+
valList[evictHead] = void 0;
|
|
463
|
+
head = next[evictHead];
|
|
464
|
+
prev[head] = 0;
|
|
465
|
+
size--;
|
|
466
|
+
free.push(evictHead);
|
|
271
467
|
toPrune--;
|
|
272
468
|
}
|
|
469
|
+
if (size === 0) head = tail = 0;
|
|
273
470
|
},
|
|
274
471
|
clear() {
|
|
275
|
-
if (
|
|
276
|
-
|
|
277
|
-
for (let
|
|
472
|
+
if (onEviction) {
|
|
473
|
+
let current = head;
|
|
474
|
+
for (let i$4 = 0; i$4 < size; i$4++) {
|
|
475
|
+
onEviction(keyList[current], valList[current]);
|
|
476
|
+
current = next[current];
|
|
477
|
+
}
|
|
278
478
|
}
|
|
279
479
|
keyMap.clear();
|
|
280
480
|
keyList.fill(void 0);
|
|
@@ -286,45 +486,8 @@ var require_lib$2 = /* @__PURE__ */ __commonJS({ "node_modules/lru.min/lib/index
|
|
|
286
486
|
resize: (newMax) => {
|
|
287
487
|
if (!(Number.isInteger(newMax) && newMax > 0)) throw new TypeError("`max` must be a positive integer");
|
|
288
488
|
if (newMax === max) return;
|
|
289
|
-
if (newMax < max)
|
|
290
|
-
|
|
291
|
-
const preserve = Math.min(size, newMax);
|
|
292
|
-
const remove = size - preserve;
|
|
293
|
-
const newKeyList = new Array(newMax);
|
|
294
|
-
const newValList = new Array(newMax);
|
|
295
|
-
const newNext = new Array(newMax);
|
|
296
|
-
const newPrev = new Array(newMax);
|
|
297
|
-
for (let i$4 = 1; i$4 <= remove; i$4++) onEviction === null || onEviction === void 0 || onEviction(keyList[i$4], valList[i$4]);
|
|
298
|
-
for (let i$4 = preserve - 1; i$4 >= 0; i$4--) {
|
|
299
|
-
newKeyList[i$4] = keyList[current];
|
|
300
|
-
newValList[i$4] = valList[current];
|
|
301
|
-
newNext[i$4] = i$4 + 1;
|
|
302
|
-
newPrev[i$4] = i$4 - 1;
|
|
303
|
-
keyMap.set(newKeyList[i$4], i$4);
|
|
304
|
-
current = prev[current];
|
|
305
|
-
}
|
|
306
|
-
head = 0;
|
|
307
|
-
tail = preserve - 1;
|
|
308
|
-
size = preserve;
|
|
309
|
-
keyList.length = newMax;
|
|
310
|
-
valList.length = newMax;
|
|
311
|
-
next.length = newMax;
|
|
312
|
-
prev.length = newMax;
|
|
313
|
-
for (let i$4 = 0; i$4 < preserve; i$4++) {
|
|
314
|
-
keyList[i$4] = newKeyList[i$4];
|
|
315
|
-
valList[i$4] = newValList[i$4];
|
|
316
|
-
next[i$4] = newNext[i$4];
|
|
317
|
-
prev[i$4] = newPrev[i$4];
|
|
318
|
-
}
|
|
319
|
-
free = [];
|
|
320
|
-
for (let i$4 = preserve; i$4 < newMax; i$4++) free.push(i$4);
|
|
321
|
-
} else {
|
|
322
|
-
const fill = newMax - max;
|
|
323
|
-
keyList.push(...new Array(fill).fill(void 0));
|
|
324
|
-
valList.push(...new Array(fill).fill(void 0));
|
|
325
|
-
next.push(...new Array(fill).fill(0));
|
|
326
|
-
prev.push(...new Array(fill).fill(0));
|
|
327
|
-
}
|
|
489
|
+
if (newMax < max) _shrink(newMax);
|
|
490
|
+
else _grow(newMax);
|
|
328
491
|
max = newMax;
|
|
329
492
|
},
|
|
330
493
|
get max() {
|
|
@@ -5453,7 +5616,7 @@ var require_umd = /* @__PURE__ */ __commonJS({ "node_modules/long/umd/index.js":
|
|
|
5453
5616
|
var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this;
|
|
5454
5617
|
var result = "";
|
|
5455
5618
|
while (true) {
|
|
5456
|
-
var remDiv = rem.div(radixToPower),
|
|
5619
|
+
var remDiv = rem.div(radixToPower), digits = (rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0).toString(radix);
|
|
5457
5620
|
rem = remDiv;
|
|
5458
5621
|
if (rem.isZero()) return digits + result;
|
|
5459
5622
|
else {
|
|
@@ -5775,10 +5938,7 @@ var require_umd = /* @__PURE__ */ __commonJS({ "node_modules/long/umd/index.js":
|
|
|
5775
5938
|
LongPrototype.multiply = function multiply(multiplier) {
|
|
5776
5939
|
if (this.isZero()) return this;
|
|
5777
5940
|
if (!isLong(multiplier)) multiplier = fromValue(multiplier);
|
|
5778
|
-
if (wasm)
|
|
5779
|
-
var low = wasm["mul"](this.low, this.high, multiplier.low, multiplier.high);
|
|
5780
|
-
return fromBits(low, wasm["get_high"](), this.unsigned);
|
|
5781
|
-
}
|
|
5941
|
+
if (wasm) return fromBits(wasm["mul"](this.low, this.high, multiplier.low, multiplier.high), wasm["get_high"](), this.unsigned);
|
|
5782
5942
|
if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO;
|
|
5783
5943
|
if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO;
|
|
5784
5944
|
if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO;
|
|
@@ -5836,8 +5996,7 @@ var require_umd = /* @__PURE__ */ __commonJS({ "node_modules/long/umd/index.js":
|
|
|
5836
5996
|
if (divisor.isZero()) throw Error("division by zero");
|
|
5837
5997
|
if (wasm) {
|
|
5838
5998
|
if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) return this;
|
|
5839
|
-
|
|
5840
|
-
return fromBits(low, wasm["get_high"](), this.unsigned);
|
|
5999
|
+
return fromBits((this.unsigned ? wasm["div_u"] : wasm["div_s"])(this.low, this.high, divisor.low, divisor.high), wasm["get_high"](), this.unsigned);
|
|
5841
6000
|
}
|
|
5842
6001
|
if (this.isZero()) return this.unsigned ? UZERO : ZERO;
|
|
5843
6002
|
var approx, rem, res;
|
|
@@ -5895,10 +6054,7 @@ var require_umd = /* @__PURE__ */ __commonJS({ "node_modules/long/umd/index.js":
|
|
|
5895
6054
|
*/
|
|
5896
6055
|
LongPrototype.modulo = function modulo(divisor) {
|
|
5897
6056
|
if (!isLong(divisor)) divisor = fromValue(divisor);
|
|
5898
|
-
if (wasm)
|
|
5899
|
-
var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(this.low, this.high, divisor.low, divisor.high);
|
|
5900
|
-
return fromBits(low, wasm["get_high"](), this.unsigned);
|
|
5901
|
-
}
|
|
6057
|
+
if (wasm) return fromBits((this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(this.low, this.high, divisor.low, divisor.high), wasm["get_high"](), this.unsigned);
|
|
5902
6058
|
return this.sub(this.div(divisor).mul(divisor));
|
|
5903
6059
|
};
|
|
5904
6060
|
/**
|
|
@@ -6200,9 +6356,7 @@ var require_umd = /* @__PURE__ */ __commonJS({ "node_modules/long/umd/index.js":
|
|
|
6200
6356
|
* @returns {!Long} The corresponding Long value
|
|
6201
6357
|
*/
|
|
6202
6358
|
Long$1.fromBigInt = function fromBigInt(value, unsigned) {
|
|
6203
|
-
|
|
6204
|
-
var highBits = Number(BigInt.asIntN(32, value >> BigInt(32)));
|
|
6205
|
-
return fromBits(lowBits, highBits, unsigned);
|
|
6359
|
+
return fromBits(Number(BigInt.asIntN(32, value)), Number(BigInt.asIntN(32, value >> BigInt(32))), unsigned);
|
|
6206
6360
|
};
|
|
6207
6361
|
Long$1.fromValue = function fromValueWithBigInt(value, unsigned) {
|
|
6208
6362
|
if (typeof value === "bigint") return Long$1.fromBigInt(value, unsigned);
|
|
@@ -6339,7 +6493,7 @@ var require_internal = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_mo
|
|
|
6339
6493
|
hex: { type: "_internal" },
|
|
6340
6494
|
_internal: InternalCodec
|
|
6341
6495
|
};
|
|
6342
|
-
function InternalCodec(codecOptions, iconv
|
|
6496
|
+
function InternalCodec(codecOptions, iconv) {
|
|
6343
6497
|
this.enc = codecOptions.encodingName;
|
|
6344
6498
|
this.bomAware = codecOptions.bomAware;
|
|
6345
6499
|
if (this.enc === "base64") this.encoder = InternalEncoderBase64;
|
|
@@ -6349,7 +6503,7 @@ var require_internal = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_mo
|
|
|
6349
6503
|
this.encoder = InternalEncoderCesu8;
|
|
6350
6504
|
if (Buffer$8.from("eda0bdedb2a9", "hex").toString() !== "💩") {
|
|
6351
6505
|
this.decoder = InternalDecoderCesu8;
|
|
6352
|
-
this.defaultCharUnicode = iconv
|
|
6506
|
+
this.defaultCharUnicode = iconv.defaultCharUnicode;
|
|
6353
6507
|
}
|
|
6354
6508
|
}
|
|
6355
6509
|
}
|
|
@@ -6391,15 +6545,15 @@ var require_internal = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_mo
|
|
|
6391
6545
|
var buf = Buffer$8.alloc(str.length * 3);
|
|
6392
6546
|
var bufIdx = 0;
|
|
6393
6547
|
for (var i$4 = 0; i$4 < str.length; i$4++) {
|
|
6394
|
-
var charCode = str.charCodeAt(i$4);
|
|
6395
|
-
if (charCode < 128) buf[bufIdx++] = charCode;
|
|
6396
|
-
else if (charCode < 2048) {
|
|
6397
|
-
buf[bufIdx++] = 192 + (charCode >>> 6);
|
|
6398
|
-
buf[bufIdx++] = 128 + (charCode & 63);
|
|
6548
|
+
var charCode$1 = str.charCodeAt(i$4);
|
|
6549
|
+
if (charCode$1 < 128) buf[bufIdx++] = charCode$1;
|
|
6550
|
+
else if (charCode$1 < 2048) {
|
|
6551
|
+
buf[bufIdx++] = 192 + (charCode$1 >>> 6);
|
|
6552
|
+
buf[bufIdx++] = 128 + (charCode$1 & 63);
|
|
6399
6553
|
} else {
|
|
6400
|
-
buf[bufIdx++] = 224 + (charCode >>> 12);
|
|
6401
|
-
buf[bufIdx++] = 128 + (charCode >>> 6 & 63);
|
|
6402
|
-
buf[bufIdx++] = 128 + (charCode & 63);
|
|
6554
|
+
buf[bufIdx++] = 224 + (charCode$1 >>> 12);
|
|
6555
|
+
buf[bufIdx++] = 128 + (charCode$1 >>> 6 & 63);
|
|
6556
|
+
buf[bufIdx++] = 128 + (charCode$1 & 63);
|
|
6403
6557
|
}
|
|
6404
6558
|
}
|
|
6405
6559
|
return buf.slice(0, bufIdx);
|
|
@@ -6461,8 +6615,8 @@ var require_internal = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_mo
|
|
|
6461
6615
|
this.highSurrogate = "";
|
|
6462
6616
|
}
|
|
6463
6617
|
if (str.length > 0) {
|
|
6464
|
-
var charCode = str.charCodeAt(str.length - 1);
|
|
6465
|
-
if (charCode >= 55296 && charCode < 56320) {
|
|
6618
|
+
var charCode$1 = str.charCodeAt(str.length - 1);
|
|
6619
|
+
if (charCode$1 >= 55296 && charCode$1 < 56320) {
|
|
6466
6620
|
this.highSurrogate = str[str.length - 1];
|
|
6467
6621
|
str = str.slice(0, str.length - 1);
|
|
6468
6622
|
}
|
|
@@ -6483,8 +6637,8 @@ var require_internal = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_mo
|
|
|
6483
6637
|
var require_utf32 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_modules/iconv-lite/encodings/utf32.js": ((exports) => {
|
|
6484
6638
|
var Buffer$7 = require_safer().Buffer;
|
|
6485
6639
|
exports._utf32 = Utf32Codec;
|
|
6486
|
-
function Utf32Codec(codecOptions, iconv
|
|
6487
|
-
this.iconv = iconv
|
|
6640
|
+
function Utf32Codec(codecOptions, iconv) {
|
|
6641
|
+
this.iconv = iconv;
|
|
6488
6642
|
this.bomAware = true;
|
|
6489
6643
|
this.isLE = codecOptions.isLE;
|
|
6490
6644
|
}
|
|
@@ -6590,8 +6744,8 @@ var require_utf32 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_modul
|
|
|
6590
6744
|
};
|
|
6591
6745
|
exports.utf32 = Utf32AutoCodec;
|
|
6592
6746
|
exports.ucs4 = "utf32";
|
|
6593
|
-
function Utf32AutoCodec(options, iconv
|
|
6594
|
-
this.iconv = iconv
|
|
6747
|
+
function Utf32AutoCodec(options, iconv) {
|
|
6748
|
+
this.iconv = iconv;
|
|
6595
6749
|
}
|
|
6596
6750
|
Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder;
|
|
6597
6751
|
Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder;
|
|
@@ -6717,8 +6871,8 @@ var require_utf16 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_modul
|
|
|
6717
6871
|
this.overflowByte = -1;
|
|
6718
6872
|
};
|
|
6719
6873
|
exports.utf16 = Utf16Codec;
|
|
6720
|
-
function Utf16Codec(codecOptions, iconv
|
|
6721
|
-
this.iconv = iconv
|
|
6874
|
+
function Utf16Codec(codecOptions, iconv) {
|
|
6875
|
+
this.iconv = iconv;
|
|
6722
6876
|
}
|
|
6723
6877
|
Utf16Codec.prototype.encoder = Utf16Encoder;
|
|
6724
6878
|
Utf16Codec.prototype.decoder = Utf16Decoder;
|
|
@@ -6801,8 +6955,8 @@ var require_utf7 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_module
|
|
|
6801
6955
|
var Buffer$5 = require_safer().Buffer;
|
|
6802
6956
|
exports.utf7 = Utf7Codec;
|
|
6803
6957
|
exports.unicode11utf7 = "utf7";
|
|
6804
|
-
function Utf7Codec(codecOptions, iconv
|
|
6805
|
-
this.iconv = iconv
|
|
6958
|
+
function Utf7Codec(codecOptions, iconv) {
|
|
6959
|
+
this.iconv = iconv;
|
|
6806
6960
|
}
|
|
6807
6961
|
Utf7Codec.prototype.encoder = Utf7Encoder;
|
|
6808
6962
|
Utf7Codec.prototype.decoder = Utf7Decoder;
|
|
@@ -6870,8 +7024,8 @@ var require_utf7 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_module
|
|
|
6870
7024
|
return res;
|
|
6871
7025
|
};
|
|
6872
7026
|
exports.utf7imap = Utf7IMAPCodec;
|
|
6873
|
-
function Utf7IMAPCodec(codecOptions, iconv
|
|
6874
|
-
this.iconv = iconv
|
|
7027
|
+
function Utf7IMAPCodec(codecOptions, iconv) {
|
|
7028
|
+
this.iconv = iconv;
|
|
6875
7029
|
}
|
|
6876
7030
|
Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;
|
|
6877
7031
|
Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;
|
|
@@ -6990,7 +7144,7 @@ var require_utf7 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_module
|
|
|
6990
7144
|
var require_sbcs_codec = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_modules/iconv-lite/encodings/sbcs-codec.js": ((exports) => {
|
|
6991
7145
|
var Buffer$4 = require_safer().Buffer;
|
|
6992
7146
|
exports._sbcs = SBCSCodec;
|
|
6993
|
-
function SBCSCodec(codecOptions, iconv
|
|
7147
|
+
function SBCSCodec(codecOptions, iconv) {
|
|
6994
7148
|
if (!codecOptions) throw new Error("SBCS codec is called without the data.");
|
|
6995
7149
|
if (!codecOptions.chars || codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256) throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)");
|
|
6996
7150
|
if (codecOptions.chars.length === 128) {
|
|
@@ -6999,7 +7153,7 @@ var require_sbcs_codec = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_
|
|
|
6999
7153
|
codecOptions.chars = asciiString + codecOptions.chars;
|
|
7000
7154
|
}
|
|
7001
7155
|
this.decodeBuf = Buffer$4.from(codecOptions.chars, "ucs2");
|
|
7002
|
-
var encodeBuf = Buffer$4.alloc(65536, iconv
|
|
7156
|
+
var encodeBuf = Buffer$4.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
|
|
7003
7157
|
for (var i$4 = 0; i$4 < codecOptions.chars.length; i$4++) encodeBuf[codecOptions.chars.charCodeAt(i$4)] = i$4;
|
|
7004
7158
|
this.encodeBuf = encodeBuf;
|
|
7005
7159
|
}
|
|
@@ -7647,7 +7801,7 @@ var require_dbcs_codec = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_
|
|
|
7647
7801
|
var UNASSIGNED_NODE = new Array(256);
|
|
7648
7802
|
var DEF_CHAR = -1;
|
|
7649
7803
|
for (var i$2 = 0; i$2 < 256; i$2++) UNASSIGNED_NODE[i$2] = UNASSIGNED;
|
|
7650
|
-
function DBCSCodec(codecOptions, iconv
|
|
7804
|
+
function DBCSCodec(codecOptions, iconv) {
|
|
7651
7805
|
this.encodingName = codecOptions.encodingName;
|
|
7652
7806
|
if (!codecOptions) throw new Error("DBCS codec is called without the data.");
|
|
7653
7807
|
if (!codecOptions.table) throw new Error("Encoding '" + this.encodingName + "' has no data.");
|
|
@@ -7679,7 +7833,7 @@ var require_dbcs_codec = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_
|
|
|
7679
7833
|
}
|
|
7680
7834
|
}
|
|
7681
7835
|
}
|
|
7682
|
-
this.defaultCharUnicode = iconv
|
|
7836
|
+
this.defaultCharUnicode = iconv.defaultCharUnicode;
|
|
7683
7837
|
this.encodeTable = [];
|
|
7684
7838
|
this.encodeTableSeq = [];
|
|
7685
7839
|
var skipEncodeChars = {};
|
|
@@ -7692,7 +7846,7 @@ var require_dbcs_codec = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_
|
|
|
7692
7846
|
if (codecOptions.encodeAdd) {
|
|
7693
7847
|
for (var uChar in codecOptions.encodeAdd) if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);
|
|
7694
7848
|
}
|
|
7695
|
-
this.defCharSB = this.encodeTable[0][iconv
|
|
7849
|
+
this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];
|
|
7696
7850
|
if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"];
|
|
7697
7851
|
if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0);
|
|
7698
7852
|
}
|
|
@@ -7734,8 +7888,8 @@ var require_dbcs_codec = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_
|
|
|
7734
7888
|
} else writeTable[curAddr++] = code;
|
|
7735
7889
|
}
|
|
7736
7890
|
else if (typeof part === "number") {
|
|
7737
|
-
var charCode = writeTable[curAddr - 1] + 1;
|
|
7738
|
-
for (var l = 0; l < part; l++) writeTable[curAddr++] = charCode++;
|
|
7891
|
+
var charCode$1 = writeTable[curAddr - 1] + 1;
|
|
7892
|
+
for (var l = 0; l < part; l++) writeTable[curAddr++] = charCode$1++;
|
|
7739
7893
|
} else throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]);
|
|
7740
7894
|
}
|
|
7741
7895
|
if (curAddr > 255) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr);
|
|
@@ -14848,53 +15002,52 @@ var require_lib$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_modul
|
|
|
14848
15002
|
var Buffer$1 = require_safer().Buffer;
|
|
14849
15003
|
var bomHandling = require_bom_handling();
|
|
14850
15004
|
var mergeModules = require_merge_exports();
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
|
|
14854
|
-
|
|
14855
|
-
iconv.encode = function encode(str, encoding, options) {
|
|
15005
|
+
module.exports.encodings = null;
|
|
15006
|
+
module.exports.defaultCharUnicode = "�";
|
|
15007
|
+
module.exports.defaultCharSingleByte = "?";
|
|
15008
|
+
module.exports.encode = function encode(str, encoding, options) {
|
|
14856
15009
|
str = "" + (str || "");
|
|
14857
|
-
var encoder =
|
|
15010
|
+
var encoder = module.exports.getEncoder(encoding, options);
|
|
14858
15011
|
var res = encoder.write(str);
|
|
14859
15012
|
var trail = encoder.end();
|
|
14860
15013
|
return trail && trail.length > 0 ? Buffer$1.concat([res, trail]) : res;
|
|
14861
15014
|
};
|
|
14862
|
-
|
|
15015
|
+
module.exports.decode = function decode(buf, encoding, options) {
|
|
14863
15016
|
if (typeof buf === "string") {
|
|
14864
|
-
if (!
|
|
15017
|
+
if (!module.exports.skipDecodeWarning) {
|
|
14865
15018
|
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
|
|
14866
|
-
|
|
15019
|
+
module.exports.skipDecodeWarning = true;
|
|
14867
15020
|
}
|
|
14868
15021
|
buf = Buffer$1.from("" + (buf || ""), "binary");
|
|
14869
15022
|
}
|
|
14870
|
-
var decoder =
|
|
15023
|
+
var decoder = module.exports.getDecoder(encoding, options);
|
|
14871
15024
|
var res = decoder.write(buf);
|
|
14872
15025
|
var trail = decoder.end();
|
|
14873
15026
|
return trail ? res + trail : res;
|
|
14874
15027
|
};
|
|
14875
|
-
|
|
15028
|
+
module.exports.encodingExists = function encodingExists(enc) {
|
|
14876
15029
|
try {
|
|
14877
|
-
|
|
15030
|
+
module.exports.getCodec(enc);
|
|
14878
15031
|
return true;
|
|
14879
15032
|
} catch (e) {
|
|
14880
15033
|
return false;
|
|
14881
15034
|
}
|
|
14882
15035
|
};
|
|
14883
|
-
|
|
14884
|
-
|
|
14885
|
-
|
|
14886
|
-
|
|
14887
|
-
if (!
|
|
14888
|
-
var raw = require_encodings();
|
|
14889
|
-
|
|
14890
|
-
mergeModules(
|
|
14891
|
-
}
|
|
14892
|
-
var enc =
|
|
15036
|
+
module.exports.toEncoding = module.exports.encode;
|
|
15037
|
+
module.exports.fromEncoding = module.exports.decode;
|
|
15038
|
+
module.exports._codecDataCache = { __proto__: null };
|
|
15039
|
+
module.exports.getCodec = function getCodec(encoding) {
|
|
15040
|
+
if (!module.exports.encodings) {
|
|
15041
|
+
var raw$1 = require_encodings();
|
|
15042
|
+
module.exports.encodings = { __proto__: null };
|
|
15043
|
+
mergeModules(module.exports.encodings, raw$1);
|
|
15044
|
+
}
|
|
15045
|
+
var enc = module.exports._canonicalizeEncoding(encoding);
|
|
14893
15046
|
var codecOptions = {};
|
|
14894
15047
|
while (true) {
|
|
14895
|
-
var codec =
|
|
15048
|
+
var codec = module.exports._codecDataCache[enc];
|
|
14896
15049
|
if (codec) return codec;
|
|
14897
|
-
var codecDef =
|
|
15050
|
+
var codecDef = module.exports.encodings[enc];
|
|
14898
15051
|
switch (typeof codecDef) {
|
|
14899
15052
|
case "string":
|
|
14900
15053
|
enc = codecDef;
|
|
@@ -14906,47 +15059,47 @@ var require_lib$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/node_modul
|
|
|
14906
15059
|
break;
|
|
14907
15060
|
case "function":
|
|
14908
15061
|
if (!codecOptions.encodingName) codecOptions.encodingName = enc;
|
|
14909
|
-
codec = new codecDef(codecOptions,
|
|
14910
|
-
|
|
15062
|
+
codec = new codecDef(codecOptions, module.exports);
|
|
15063
|
+
module.exports._codecDataCache[codecOptions.encodingName] = codec;
|
|
14911
15064
|
return codec;
|
|
14912
15065
|
default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')");
|
|
14913
15066
|
}
|
|
14914
15067
|
}
|
|
14915
15068
|
};
|
|
14916
|
-
|
|
15069
|
+
module.exports._canonicalizeEncoding = function(encoding) {
|
|
14917
15070
|
return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
|
|
14918
15071
|
};
|
|
14919
|
-
|
|
14920
|
-
var codec =
|
|
15072
|
+
module.exports.getEncoder = function getEncoder(encoding, options) {
|
|
15073
|
+
var codec = module.exports.getCodec(encoding);
|
|
14921
15074
|
var encoder = new codec.encoder(options, codec);
|
|
14922
15075
|
if (codec.bomAware && options && options.addBOM) encoder = new bomHandling.PrependBOM(encoder, options);
|
|
14923
15076
|
return encoder;
|
|
14924
15077
|
};
|
|
14925
|
-
|
|
14926
|
-
var codec =
|
|
15078
|
+
module.exports.getDecoder = function getDecoder(encoding, options) {
|
|
15079
|
+
var codec = module.exports.getCodec(encoding);
|
|
14927
15080
|
var decoder = new codec.decoder(options, codec);
|
|
14928
15081
|
if (codec.bomAware && !(options && options.stripBOM === false)) decoder = new bomHandling.StripBOM(decoder, options);
|
|
14929
15082
|
return decoder;
|
|
14930
15083
|
};
|
|
14931
|
-
|
|
14932
|
-
if (
|
|
15084
|
+
module.exports.enableStreamingAPI = function enableStreamingAPI(streamModule$1) {
|
|
15085
|
+
if (module.exports.supportsStreams) return;
|
|
14933
15086
|
var streams = require_streams()(streamModule$1);
|
|
14934
|
-
|
|
14935
|
-
|
|
14936
|
-
|
|
14937
|
-
return new
|
|
15087
|
+
module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream;
|
|
15088
|
+
module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream;
|
|
15089
|
+
module.exports.encodeStream = function encodeStream(encoding, options) {
|
|
15090
|
+
return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options);
|
|
14938
15091
|
};
|
|
14939
|
-
|
|
14940
|
-
return new
|
|
15092
|
+
module.exports.decodeStream = function decodeStream(encoding, options) {
|
|
15093
|
+
return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options);
|
|
14941
15094
|
};
|
|
14942
|
-
|
|
15095
|
+
module.exports.supportsStreams = true;
|
|
14943
15096
|
};
|
|
14944
15097
|
var streamModule;
|
|
14945
15098
|
try {
|
|
14946
15099
|
streamModule = __require("stream");
|
|
14947
15100
|
} catch (e) {}
|
|
14948
|
-
if (streamModule && streamModule.Transform)
|
|
14949
|
-
else
|
|
15101
|
+
if (streamModule && streamModule.Transform) module.exports.enableStreamingAPI(streamModule);
|
|
15102
|
+
else module.exports.encodeStream = module.exports.decodeStream = function() {
|
|
14950
15103
|
throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
|
|
14951
15104
|
};
|
|
14952
15105
|
}) });
|
|
@@ -15128,9 +15281,7 @@ var require_packet = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packe
|
|
|
15128
15281
|
return this.buffer.readInt32LE(this.offset - 4);
|
|
15129
15282
|
}
|
|
15130
15283
|
readInt64JSNumber() {
|
|
15131
|
-
|
|
15132
|
-
const word1 = this.readInt32();
|
|
15133
|
-
return new Long(word0, word1, true).toNumber();
|
|
15284
|
+
return new Long(this.readInt32(), this.readInt32(), true).toNumber();
|
|
15134
15285
|
}
|
|
15135
15286
|
readSInt64JSNumber() {
|
|
15136
15287
|
const word0 = this.readInt32();
|
|
@@ -15139,28 +15290,20 @@ var require_packet = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packe
|
|
|
15139
15290
|
return new Long(word0, word1, false).toNumber();
|
|
15140
15291
|
}
|
|
15141
15292
|
readInt64String() {
|
|
15142
|
-
|
|
15143
|
-
const word1 = this.readInt32();
|
|
15144
|
-
return new Long(word0, word1, true).toString();
|
|
15293
|
+
return new Long(this.readInt32(), this.readInt32(), true).toString();
|
|
15145
15294
|
}
|
|
15146
15295
|
readSInt64String() {
|
|
15147
|
-
|
|
15148
|
-
const word1 = this.readInt32();
|
|
15149
|
-
return new Long(word0, word1, false).toString();
|
|
15296
|
+
return new Long(this.readInt32(), this.readInt32(), false).toString();
|
|
15150
15297
|
}
|
|
15151
15298
|
readInt64() {
|
|
15152
|
-
|
|
15153
|
-
const word1 = this.readInt32();
|
|
15154
|
-
let res = new Long(word0, word1, true);
|
|
15299
|
+
let res = new Long(this.readInt32(), this.readInt32(), true);
|
|
15155
15300
|
const resNumber = res.toNumber();
|
|
15156
15301
|
const resString = res.toString();
|
|
15157
15302
|
res = resNumber.toString() === resString ? resNumber : resString;
|
|
15158
15303
|
return res;
|
|
15159
15304
|
}
|
|
15160
15305
|
readSInt64() {
|
|
15161
|
-
|
|
15162
|
-
const word1 = this.readInt32();
|
|
15163
|
-
let res = new Long(word0, word1, false);
|
|
15306
|
+
let res = new Long(this.readInt32(), this.readInt32(), false);
|
|
15164
15307
|
const resNumber = res.toNumber();
|
|
15165
15308
|
const resString = res.toString();
|
|
15166
15309
|
res = resNumber.toString() === resString ? resNumber : resString;
|
|
@@ -15333,7 +15476,7 @@ var require_packet = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packe
|
|
|
15333
15476
|
readNullTerminatedString(encoding) {
|
|
15334
15477
|
const start = this.offset;
|
|
15335
15478
|
let end = this.offset;
|
|
15336
|
-
while (this.buffer[end]) end = end + 1;
|
|
15479
|
+
while (end < this.end && this.buffer[end] !== 0) end = end + 1;
|
|
15337
15480
|
this.offset = end + 1;
|
|
15338
15481
|
return StringParser$3.decode(this.buffer, encoding, start, end);
|
|
15339
15482
|
}
|
|
@@ -15410,15 +15553,18 @@ var require_packet = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packe
|
|
|
15410
15553
|
const buffer$1 = this.readLengthCodedBuffer();
|
|
15411
15554
|
let offset = 4;
|
|
15412
15555
|
if (buffer$1 === null || !buffer$1.length) return null;
|
|
15556
|
+
const bufferLength = buffer$1.length;
|
|
15413
15557
|
function parseGeometry() {
|
|
15414
|
-
let x, y, i$4, j, numPoints, line;
|
|
15558
|
+
let x, y, i$4, j, numPoints, numRings, num, line;
|
|
15415
15559
|
let result = null;
|
|
15560
|
+
if (offset + 5 > bufferLength) return null;
|
|
15416
15561
|
const byteOrder = buffer$1.readUInt8(offset);
|
|
15417
15562
|
offset += 1;
|
|
15418
15563
|
const wkbType = byteOrder ? buffer$1.readUInt32LE(offset) : buffer$1.readUInt32BE(offset);
|
|
15419
15564
|
offset += 4;
|
|
15420
15565
|
switch (wkbType) {
|
|
15421
15566
|
case 1:
|
|
15567
|
+
if (offset + 16 > bufferLength) return null;
|
|
15422
15568
|
x = byteOrder ? buffer$1.readDoubleLE(offset) : buffer$1.readDoubleBE(offset);
|
|
15423
15569
|
offset += 8;
|
|
15424
15570
|
y = byteOrder ? buffer$1.readDoubleLE(offset) : buffer$1.readDoubleBE(offset);
|
|
@@ -15429,10 +15575,13 @@ var require_packet = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packe
|
|
|
15429
15575
|
};
|
|
15430
15576
|
break;
|
|
15431
15577
|
case 2:
|
|
15578
|
+
if (offset + 4 > bufferLength) return null;
|
|
15432
15579
|
numPoints = byteOrder ? buffer$1.readUInt32LE(offset) : buffer$1.readUInt32BE(offset);
|
|
15433
15580
|
offset += 4;
|
|
15581
|
+
if (numPoints > (bufferLength - offset) / 16) return null;
|
|
15434
15582
|
result = [];
|
|
15435
15583
|
for (i$4 = numPoints; i$4 > 0; i$4--) {
|
|
15584
|
+
if (offset + 16 > bufferLength) break;
|
|
15436
15585
|
x = byteOrder ? buffer$1.readDoubleLE(offset) : buffer$1.readDoubleBE(offset);
|
|
15437
15586
|
offset += 8;
|
|
15438
15587
|
y = byteOrder ? buffer$1.readDoubleLE(offset) : buffer$1.readDoubleBE(offset);
|
|
@@ -15444,14 +15593,18 @@ var require_packet = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packe
|
|
|
15444
15593
|
}
|
|
15445
15594
|
break;
|
|
15446
15595
|
case 3:
|
|
15447
|
-
|
|
15596
|
+
if (offset + 4 > bufferLength) return null;
|
|
15597
|
+
numRings = byteOrder ? buffer$1.readUInt32LE(offset) : buffer$1.readUInt32BE(offset);
|
|
15448
15598
|
offset += 4;
|
|
15599
|
+
if (numRings > (bufferLength - offset) / 4) return null;
|
|
15449
15600
|
result = [];
|
|
15450
15601
|
for (i$4 = numRings; i$4 > 0; i$4--) {
|
|
15602
|
+
if (offset + 4 > bufferLength) break;
|
|
15451
15603
|
numPoints = byteOrder ? buffer$1.readUInt32LE(offset) : buffer$1.readUInt32BE(offset);
|
|
15452
15604
|
offset += 4;
|
|
15453
15605
|
line = [];
|
|
15454
15606
|
for (j = numPoints; j > 0; j--) {
|
|
15607
|
+
if (offset + 16 > bufferLength) break;
|
|
15455
15608
|
x = byteOrder ? buffer$1.readDoubleLE(offset) : buffer$1.readDoubleBE(offset);
|
|
15456
15609
|
offset += 8;
|
|
15457
15610
|
y = byteOrder ? buffer$1.readDoubleLE(offset) : buffer$1.readDoubleBE(offset);
|
|
@@ -15468,8 +15621,10 @@ var require_packet = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packe
|
|
|
15468
15621
|
case 5:
|
|
15469
15622
|
case 6:
|
|
15470
15623
|
case 7:
|
|
15471
|
-
|
|
15624
|
+
if (offset + 4 > bufferLength) return null;
|
|
15625
|
+
num = byteOrder ? buffer$1.readUInt32LE(offset) : buffer$1.readUInt32BE(offset);
|
|
15472
15626
|
offset += 4;
|
|
15627
|
+
if (num > (bufferLength - offset) / 9) return null;
|
|
15473
15628
|
result = [];
|
|
15474
15629
|
for (i$4 = num; i$4 > 0; i$4--) result.push(parseGeometry());
|
|
15475
15630
|
break;
|
|
@@ -15506,26 +15661,32 @@ var require_packet = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packe
|
|
|
15506
15661
|
}
|
|
15507
15662
|
parseFloat(len) {
|
|
15508
15663
|
if (len === null) return null;
|
|
15664
|
+
if (len === 0) return 0;
|
|
15665
|
+
if (len > 17) {
|
|
15666
|
+
const str = this.buffer.toString("utf8", this.offset, this.offset + len);
|
|
15667
|
+
this.offset += len;
|
|
15668
|
+
return Number.parseFloat(str);
|
|
15669
|
+
}
|
|
15509
15670
|
let result = 0;
|
|
15510
15671
|
const end = this.offset + len;
|
|
15511
15672
|
let factor = 1;
|
|
15512
15673
|
let pastDot = false;
|
|
15513
|
-
let charCode = 0;
|
|
15514
|
-
if (len === 0) return 0;
|
|
15674
|
+
let charCode$1 = 0;
|
|
15515
15675
|
if (this.buffer[this.offset] === minus) {
|
|
15516
15676
|
this.offset++;
|
|
15517
15677
|
factor = -1;
|
|
15518
15678
|
}
|
|
15519
15679
|
if (this.buffer[this.offset] === plus) this.offset++;
|
|
15520
15680
|
while (this.offset < end) {
|
|
15521
|
-
charCode = this.buffer[this.offset];
|
|
15522
|
-
if (charCode === dot) {
|
|
15681
|
+
charCode$1 = this.buffer[this.offset];
|
|
15682
|
+
if (charCode$1 === dot) {
|
|
15523
15683
|
pastDot = true;
|
|
15524
15684
|
this.offset++;
|
|
15525
|
-
} else if (charCode === exponent || charCode === exponentCapital) {
|
|
15526
|
-
|
|
15527
|
-
const
|
|
15528
|
-
|
|
15685
|
+
} else if (charCode$1 === exponent || charCode$1 === exponentCapital) {
|
|
15686
|
+
const start = end - len;
|
|
15687
|
+
const str = this.buffer.toString("utf8", start, end);
|
|
15688
|
+
this.offset = end;
|
|
15689
|
+
return Number.parseFloat(str);
|
|
15529
15690
|
} else {
|
|
15530
15691
|
result *= 10;
|
|
15531
15692
|
result += this.buffer[this.offset] - 48;
|
|
@@ -15640,9 +15801,9 @@ var require_packet = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packe
|
|
|
15640
15801
|
}
|
|
15641
15802
|
if (n === null) return this.writeInt8(251);
|
|
15642
15803
|
this.writeInt8(254);
|
|
15643
|
-
this.buffer.writeUInt32LE(n, this.offset);
|
|
15804
|
+
this.buffer.writeUInt32LE(n >>> 0, this.offset);
|
|
15644
15805
|
this.offset += 4;
|
|
15645
|
-
this.buffer.writeUInt32LE(n
|
|
15806
|
+
this.buffer.writeUInt32LE(Math.floor(n / 4294967296), this.offset);
|
|
15646
15807
|
this.offset += 4;
|
|
15647
15808
|
return this.offset;
|
|
15648
15809
|
}
|
|
@@ -15847,15 +16008,14 @@ var require_packet_parser = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/li
|
|
|
15847
16008
|
//#region node_modules/mysql2/lib/packets/auth_next_factor.js
|
|
15848
16009
|
var require_auth_next_factor = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/auth_next_factor.js": ((exports, module) => {
|
|
15849
16010
|
const Packet$20 = require_packet();
|
|
15850
|
-
var AuthNextFactor
|
|
16011
|
+
var AuthNextFactor = class AuthNextFactor {
|
|
15851
16012
|
constructor(opts) {
|
|
15852
16013
|
this.pluginName = opts.pluginName;
|
|
15853
16014
|
this.pluginData = opts.pluginData;
|
|
15854
16015
|
}
|
|
15855
16016
|
toPacket(encoding) {
|
|
15856
16017
|
const length = 6 + this.pluginName.length + this.pluginData.length;
|
|
15857
|
-
const
|
|
15858
|
-
const packet = new Packet$20(0, buffer$1, 0, length);
|
|
16018
|
+
const packet = new Packet$20(0, Buffer.allocUnsafe(length), 0, length);
|
|
15859
16019
|
packet.offset = 4;
|
|
15860
16020
|
packet.writeInt8(2);
|
|
15861
16021
|
packet.writeNullTerminatedString(this.pluginName, encoding);
|
|
@@ -15864,30 +16024,27 @@ var require_auth_next_factor = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
15864
16024
|
}
|
|
15865
16025
|
static fromPacket(packet, encoding) {
|
|
15866
16026
|
packet.readInt8();
|
|
15867
|
-
|
|
15868
|
-
|
|
15869
|
-
|
|
15870
|
-
pluginName: name,
|
|
15871
|
-
pluginData: data
|
|
16027
|
+
return new AuthNextFactor({
|
|
16028
|
+
pluginName: packet.readNullTerminatedString(encoding),
|
|
16029
|
+
pluginData: packet.readBuffer()
|
|
15872
16030
|
});
|
|
15873
16031
|
}
|
|
15874
16032
|
};
|
|
15875
|
-
module.exports = AuthNextFactor
|
|
16033
|
+
module.exports = AuthNextFactor;
|
|
15876
16034
|
}) });
|
|
15877
16035
|
|
|
15878
16036
|
//#endregion
|
|
15879
16037
|
//#region node_modules/mysql2/lib/packets/auth_switch_request.js
|
|
15880
16038
|
var require_auth_switch_request = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/auth_switch_request.js": ((exports, module) => {
|
|
15881
16039
|
const Packet$19 = require_packet();
|
|
15882
|
-
var AuthSwitchRequest
|
|
16040
|
+
var AuthSwitchRequest = class AuthSwitchRequest {
|
|
15883
16041
|
constructor(opts) {
|
|
15884
16042
|
this.pluginName = opts.pluginName;
|
|
15885
16043
|
this.pluginData = opts.pluginData;
|
|
15886
16044
|
}
|
|
15887
16045
|
toPacket() {
|
|
15888
16046
|
const length = 6 + this.pluginName.length + this.pluginData.length;
|
|
15889
|
-
const
|
|
15890
|
-
const packet = new Packet$19(0, buffer$1, 0, length);
|
|
16047
|
+
const packet = new Packet$19(0, Buffer.allocUnsafe(length), 0, length);
|
|
15891
16048
|
packet.offset = 4;
|
|
15892
16049
|
packet.writeInt8(254);
|
|
15893
16050
|
packet.writeNullTerminatedString(this.pluginName, "cesu8");
|
|
@@ -15896,29 +16053,26 @@ var require_auth_switch_request = /* @__PURE__ */ __commonJS({ "node_modules/mys
|
|
|
15896
16053
|
}
|
|
15897
16054
|
static fromPacket(packet) {
|
|
15898
16055
|
packet.readInt8();
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
pluginName: name,
|
|
15903
|
-
pluginData: data
|
|
16056
|
+
return new AuthSwitchRequest({
|
|
16057
|
+
pluginName: packet.readNullTerminatedString("cesu8"),
|
|
16058
|
+
pluginData: packet.readBuffer()
|
|
15904
16059
|
});
|
|
15905
16060
|
}
|
|
15906
16061
|
};
|
|
15907
|
-
module.exports = AuthSwitchRequest
|
|
16062
|
+
module.exports = AuthSwitchRequest;
|
|
15908
16063
|
}) });
|
|
15909
16064
|
|
|
15910
16065
|
//#endregion
|
|
15911
16066
|
//#region node_modules/mysql2/lib/packets/auth_switch_request_more_data.js
|
|
15912
16067
|
var require_auth_switch_request_more_data = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/auth_switch_request_more_data.js": ((exports, module) => {
|
|
15913
16068
|
const Packet$18 = require_packet();
|
|
15914
|
-
var AuthSwitchRequestMoreData
|
|
16069
|
+
var AuthSwitchRequestMoreData = class AuthSwitchRequestMoreData {
|
|
15915
16070
|
constructor(data) {
|
|
15916
16071
|
this.data = data;
|
|
15917
16072
|
}
|
|
15918
16073
|
toPacket() {
|
|
15919
16074
|
const length = 5 + this.data.length;
|
|
15920
|
-
const
|
|
15921
|
-
const packet = new Packet$18(0, buffer$1, 0, length);
|
|
16075
|
+
const packet = new Packet$18(0, Buffer.allocUnsafe(length), 0, length);
|
|
15922
16076
|
packet.offset = 4;
|
|
15923
16077
|
packet.writeInt8(1);
|
|
15924
16078
|
packet.writeBuffer(this.data);
|
|
@@ -15926,39 +16080,36 @@ var require_auth_switch_request_more_data = /* @__PURE__ */ __commonJS({ "node_m
|
|
|
15926
16080
|
}
|
|
15927
16081
|
static fromPacket(packet) {
|
|
15928
16082
|
packet.readInt8();
|
|
15929
|
-
|
|
15930
|
-
return new AuthSwitchRequestMoreData$1(data);
|
|
16083
|
+
return new AuthSwitchRequestMoreData(packet.readBuffer());
|
|
15931
16084
|
}
|
|
15932
16085
|
static verifyMarker(packet) {
|
|
15933
16086
|
return packet.peekByte() === 1;
|
|
15934
16087
|
}
|
|
15935
16088
|
};
|
|
15936
|
-
module.exports = AuthSwitchRequestMoreData
|
|
16089
|
+
module.exports = AuthSwitchRequestMoreData;
|
|
15937
16090
|
}) });
|
|
15938
16091
|
|
|
15939
16092
|
//#endregion
|
|
15940
16093
|
//#region node_modules/mysql2/lib/packets/auth_switch_response.js
|
|
15941
16094
|
var require_auth_switch_response = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/auth_switch_response.js": ((exports, module) => {
|
|
15942
16095
|
const Packet$17 = require_packet();
|
|
15943
|
-
var AuthSwitchResponse
|
|
16096
|
+
var AuthSwitchResponse = class AuthSwitchResponse {
|
|
15944
16097
|
constructor(data) {
|
|
15945
16098
|
if (!Buffer.isBuffer(data)) data = Buffer.from(data);
|
|
15946
16099
|
this.data = data;
|
|
15947
16100
|
}
|
|
15948
16101
|
toPacket() {
|
|
15949
16102
|
const length = 4 + this.data.length;
|
|
15950
|
-
const
|
|
15951
|
-
const packet = new Packet$17(0, buffer$1, 0, length);
|
|
16103
|
+
const packet = new Packet$17(0, Buffer.allocUnsafe(length), 0, length);
|
|
15952
16104
|
packet.offset = 4;
|
|
15953
16105
|
packet.writeBuffer(this.data);
|
|
15954
16106
|
return packet;
|
|
15955
16107
|
}
|
|
15956
16108
|
static fromPacket(packet) {
|
|
15957
|
-
|
|
15958
|
-
return new AuthSwitchResponse$1(data);
|
|
16109
|
+
return new AuthSwitchResponse(packet.readBuffer());
|
|
15959
16110
|
}
|
|
15960
16111
|
};
|
|
15961
|
-
module.exports = AuthSwitchResponse
|
|
16112
|
+
module.exports = AuthSwitchResponse;
|
|
15962
16113
|
}) });
|
|
15963
16114
|
|
|
15964
16115
|
//#endregion
|
|
@@ -15967,7 +16118,7 @@ var require_binary_row = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/p
|
|
|
15967
16118
|
const Types$5 = require_types();
|
|
15968
16119
|
const Packet$16 = require_packet();
|
|
15969
16120
|
const binaryReader = new Array(256);
|
|
15970
|
-
var BinaryRow
|
|
16121
|
+
var BinaryRow = class BinaryRow {
|
|
15971
16122
|
constructor(columns) {
|
|
15972
16123
|
this.columns = columns || [];
|
|
15973
16124
|
}
|
|
@@ -15982,8 +16133,7 @@ var require_binary_row = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/p
|
|
|
15982
16133
|
length += Packet$16.lengthCodedStringLength(val.toString(10), encoding);
|
|
15983
16134
|
});
|
|
15984
16135
|
length = length + 2;
|
|
15985
|
-
const
|
|
15986
|
-
const packet = new Packet$16(sequenceId, buffer$1, 0, length + 4);
|
|
16136
|
+
const packet = new Packet$16(sequenceId, Buffer.allocUnsafe(length + 4), 0, length + 4);
|
|
15987
16137
|
packet.offset = 4;
|
|
15988
16138
|
packet.writeInt8(0);
|
|
15989
16139
|
let bitmap = 0;
|
|
@@ -16017,7 +16167,7 @@ var require_binary_row = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/p
|
|
|
16017
16167
|
const nullBitmapLength = Math.floor((fields$1.length + 7 + 2) / 8);
|
|
16018
16168
|
packet.skip(nullBitmapLength);
|
|
16019
16169
|
for (let i$4 = 0; i$4 < columns.length; ++i$4) columns[i$4] = binaryReader[fields$1[i$4].columnType].apply(packet);
|
|
16020
|
-
return new BinaryRow
|
|
16170
|
+
return new BinaryRow(columns);
|
|
16021
16171
|
}
|
|
16022
16172
|
};
|
|
16023
16173
|
binaryReader[Types$5.DECIMAL] = Packet$16.prototype.readLengthCodedString;
|
|
@@ -16035,7 +16185,7 @@ var require_binary_row = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/p
|
|
|
16035
16185
|
binaryReader[12] = Packet$16.prototype.readDateTime;
|
|
16036
16186
|
binaryReader[13] = Packet$16.prototype.readInt16;
|
|
16037
16187
|
binaryReader[Types$5.VAR_STRING] = Packet$16.prototype.readLengthCodedString;
|
|
16038
|
-
module.exports = BinaryRow
|
|
16188
|
+
module.exports = BinaryRow;
|
|
16039
16189
|
}) });
|
|
16040
16190
|
|
|
16041
16191
|
//#endregion
|
|
@@ -16082,7 +16232,7 @@ var require_commands$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/c
|
|
|
16082
16232
|
var require_binlog_dump$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/binlog_dump.js": ((exports, module) => {
|
|
16083
16233
|
const Packet$15 = require_packet();
|
|
16084
16234
|
const CommandCodes$4 = require_commands$1();
|
|
16085
|
-
var BinlogDump$
|
|
16235
|
+
var BinlogDump$2 = class {
|
|
16086
16236
|
constructor(opts) {
|
|
16087
16237
|
this.binlogPos = opts.binlogPos || 0;
|
|
16088
16238
|
this.serverId = opts.serverId || 0;
|
|
@@ -16091,8 +16241,7 @@ var require_binlog_dump$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/li
|
|
|
16091
16241
|
}
|
|
16092
16242
|
toPacket() {
|
|
16093
16243
|
const length = 15 + Buffer.byteLength(this.filename, "utf8");
|
|
16094
|
-
const
|
|
16095
|
-
const packet = new Packet$15(0, buffer$1, 0, length);
|
|
16244
|
+
const packet = new Packet$15(0, Buffer.allocUnsafe(length), 0, length);
|
|
16096
16245
|
packet.offset = 4;
|
|
16097
16246
|
packet.writeInt8(CommandCodes$4.BINLOG_DUMP);
|
|
16098
16247
|
packet.writeInt32(this.binlogPos);
|
|
@@ -16102,7 +16251,7 @@ var require_binlog_dump$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/li
|
|
|
16102
16251
|
return packet;
|
|
16103
16252
|
}
|
|
16104
16253
|
};
|
|
16105
|
-
module.exports = BinlogDump$
|
|
16254
|
+
module.exports = BinlogDump$2;
|
|
16106
16255
|
}) });
|
|
16107
16256
|
|
|
16108
16257
|
//#endregion
|
|
@@ -16132,7 +16281,6 @@ var require_client = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/const
|
|
|
16132
16281
|
exports.PLUGIN_AUTH_LENENC_CLIENT_DATA = 2097152;
|
|
16133
16282
|
exports.CAN_HANDLE_EXPIRED_PASSWORDS = 4194304;
|
|
16134
16283
|
exports.SESSION_TRACK = 8388608;
|
|
16135
|
-
exports.DEPRECATE_EOF = 16777216;
|
|
16136
16284
|
exports.SSL_VERIFY_SERVER_CERT = 1073741824;
|
|
16137
16285
|
exports.REMEMBER_OPTIONS = 2147483648;
|
|
16138
16286
|
exports.MULTI_FACTOR_AUTHENTICATION = 268435456;
|
|
@@ -16161,16 +16309,11 @@ var require_auth_41 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/auth
|
|
|
16161
16309
|
return exports.calculateTokenFromPasswordSha(stage1, scramble1, scramble2);
|
|
16162
16310
|
}
|
|
16163
16311
|
exports.calculateTokenFromPasswordSha = function(passwordSha, scramble1, scramble2) {
|
|
16164
|
-
|
|
16165
|
-
const authPluginData2 = scramble2.slice(0, 12);
|
|
16166
|
-
const stage2 = sha1(passwordSha);
|
|
16167
|
-
const stage3 = sha1(authPluginData1, authPluginData2, stage2);
|
|
16168
|
-
return xor$1(stage3, passwordSha);
|
|
16312
|
+
return xor$1(sha1(scramble1.slice(0, 8), scramble2.slice(0, 12), sha1(passwordSha)), passwordSha);
|
|
16169
16313
|
};
|
|
16170
16314
|
exports.calculateToken = token;
|
|
16171
16315
|
exports.verifyToken = function(publicSeed1, publicSeed2, token$1, doubleSha) {
|
|
16172
|
-
|
|
16173
|
-
return sha1(hashStage1).compare(doubleSha) === 0;
|
|
16316
|
+
return sha1(xor$1(token$1, sha1(publicSeed1, publicSeed2, doubleSha))).compare(doubleSha) === 0;
|
|
16174
16317
|
};
|
|
16175
16318
|
exports.doubleSha1 = function(password) {
|
|
16176
16319
|
return sha1(sha1(password));
|
|
@@ -16496,6 +16639,7 @@ var require_charset_encodings = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
16496
16639
|
"utf8",
|
|
16497
16640
|
"utf8",
|
|
16498
16641
|
"utf8",
|
|
16642
|
+
"utf8",
|
|
16499
16643
|
"utf8"
|
|
16500
16644
|
];
|
|
16501
16645
|
}) });
|
|
@@ -16508,7 +16652,7 @@ var require_change_user$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/li
|
|
|
16508
16652
|
const Packet$14 = require_packet();
|
|
16509
16653
|
const auth41$3 = require_auth_41();
|
|
16510
16654
|
const CharsetToEncoding$8 = require_charset_encodings();
|
|
16511
|
-
var ChangeUser$
|
|
16655
|
+
var ChangeUser$2 = class {
|
|
16512
16656
|
constructor(opts) {
|
|
16513
16657
|
this.flags = opts.flags;
|
|
16514
16658
|
this.user = opts.user || "";
|
|
@@ -16564,7 +16708,7 @@ var require_change_user$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/li
|
|
|
16564
16708
|
return this.serializeToBuffer(Buffer.allocUnsafe(p.offset));
|
|
16565
16709
|
}
|
|
16566
16710
|
};
|
|
16567
|
-
module.exports = ChangeUser$
|
|
16711
|
+
module.exports = ChangeUser$2;
|
|
16568
16712
|
}) });
|
|
16569
16713
|
|
|
16570
16714
|
//#endregion
|
|
@@ -16572,7 +16716,7 @@ var require_change_user$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/li
|
|
|
16572
16716
|
var require_close_statement$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/close_statement.js": ((exports, module) => {
|
|
16573
16717
|
const Packet$13 = require_packet();
|
|
16574
16718
|
const CommandCodes$3 = require_commands$1();
|
|
16575
|
-
var CloseStatement$
|
|
16719
|
+
var CloseStatement$3 = class {
|
|
16576
16720
|
constructor(id) {
|
|
16577
16721
|
this.id = id;
|
|
16578
16722
|
}
|
|
@@ -16584,7 +16728,7 @@ var require_close_statement$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
16584
16728
|
return packet;
|
|
16585
16729
|
}
|
|
16586
16730
|
};
|
|
16587
|
-
module.exports = CloseStatement$
|
|
16731
|
+
module.exports = CloseStatement$3;
|
|
16588
16732
|
}) });
|
|
16589
16733
|
|
|
16590
16734
|
//#endregion
|
|
@@ -16621,7 +16765,7 @@ var require_column_definition = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
16621
16765
|
"name",
|
|
16622
16766
|
"orgName"
|
|
16623
16767
|
];
|
|
16624
|
-
var ColumnDefinition
|
|
16768
|
+
var ColumnDefinition = class {
|
|
16625
16769
|
constructor(packet, clientEncoding) {
|
|
16626
16770
|
this._buf = packet.buffer;
|
|
16627
16771
|
this._clientEncoding = clientEncoding;
|
|
@@ -16723,8 +16867,7 @@ var require_column_definition = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
16723
16867
|
fields.forEach((field) => {
|
|
16724
16868
|
length += Packet$12.lengthCodedStringLength(column[field], CharsetToEncoding$7[column.characterSet]);
|
|
16725
16869
|
});
|
|
16726
|
-
const
|
|
16727
|
-
const packet = new Packet$12(sequenceId, buffer$1, 0, length);
|
|
16870
|
+
const packet = new Packet$12(sequenceId, Buffer.allocUnsafe(length), 0, length);
|
|
16728
16871
|
function writeField(name) {
|
|
16729
16872
|
packet.writeLengthCodedString(column[name], CharsetToEncoding$7[column.characterSet]);
|
|
16730
16873
|
}
|
|
@@ -16744,7 +16887,7 @@ var require_column_definition = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
16744
16887
|
}
|
|
16745
16888
|
};
|
|
16746
16889
|
const addString = function(name) {
|
|
16747
|
-
Object.defineProperty(ColumnDefinition
|
|
16890
|
+
Object.defineProperty(ColumnDefinition.prototype, name, { get: function() {
|
|
16748
16891
|
const start = this[`_${name}Start`];
|
|
16749
16892
|
const end = start + this[`_${name}Length`];
|
|
16750
16893
|
const val = StringParser$2.decode(this._buf, this.encoding === "binary" ? this._clientEncoding : this.encoding, start, end);
|
|
@@ -16762,7 +16905,7 @@ var require_column_definition = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
16762
16905
|
addString("table");
|
|
16763
16906
|
addString("orgTable");
|
|
16764
16907
|
addString("orgName");
|
|
16765
|
-
module.exports = ColumnDefinition
|
|
16908
|
+
module.exports = ColumnDefinition;
|
|
16766
16909
|
}) });
|
|
16767
16910
|
|
|
16768
16911
|
//#endregion
|
|
@@ -16839,7 +16982,7 @@ var require_execute$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pa
|
|
|
16839
16982
|
writer
|
|
16840
16983
|
};
|
|
16841
16984
|
}
|
|
16842
|
-
var Execute$
|
|
16985
|
+
var Execute$3 = class {
|
|
16843
16986
|
constructor(id, parameters, charsetNumber, timezone) {
|
|
16844
16987
|
this.id = id;
|
|
16845
16988
|
this.parameters = parameters;
|
|
@@ -16888,8 +17031,7 @@ var require_execute$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pa
|
|
|
16888
17031
|
parameters = this.parameters.map((value) => toParameter(value, this.encoding, this.timezone));
|
|
16889
17032
|
length += parameters.reduce((accumulator, parameter) => accumulator + parameter.length, 0);
|
|
16890
17033
|
}
|
|
16891
|
-
const
|
|
16892
|
-
const packet = new Packet$11(0, buffer$1, 0, length);
|
|
17034
|
+
const packet = new Packet$11(0, Buffer.allocUnsafe(length), 0, length);
|
|
16893
17035
|
packet.offset = 4;
|
|
16894
17036
|
packet.writeInt8(CommandCodes$2.STMT_EXECUTE);
|
|
16895
17037
|
packet.writeInt32(this.id);
|
|
@@ -16920,7 +17062,7 @@ var require_execute$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pa
|
|
|
16920
17062
|
return packet;
|
|
16921
17063
|
}
|
|
16922
17064
|
};
|
|
16923
|
-
module.exports = Execute$
|
|
17065
|
+
module.exports = Execute$3;
|
|
16924
17066
|
}) });
|
|
16925
17067
|
|
|
16926
17068
|
//#endregion
|
|
@@ -16928,7 +17070,7 @@ var require_execute$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pa
|
|
|
16928
17070
|
var require_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/handshake.js": ((exports, module) => {
|
|
16929
17071
|
const Packet$10 = require_packet();
|
|
16930
17072
|
const ClientConstants$6 = require_client();
|
|
16931
|
-
var Handshake
|
|
17073
|
+
var Handshake = class Handshake {
|
|
16932
17074
|
constructor(args) {
|
|
16933
17075
|
this.protocolVersion = args.protocolVersion;
|
|
16934
17076
|
this.serverVersion = args.serverVersion;
|
|
@@ -16953,8 +17095,7 @@ var require_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pa
|
|
|
16953
17095
|
}
|
|
16954
17096
|
toPacket(sequenceId) {
|
|
16955
17097
|
const length = 68 + Buffer.byteLength(this.serverVersion, "utf8");
|
|
16956
|
-
const
|
|
16957
|
-
const packet = new Packet$10(sequenceId, buffer$1, 0, length + 4);
|
|
17098
|
+
const packet = new Packet$10(sequenceId, Buffer.alloc(length + 4, 0), 0, length + 4);
|
|
16958
17099
|
packet.offset = 4;
|
|
16959
17100
|
packet.writeInt8(this.protocolVersion);
|
|
16960
17101
|
packet.writeString(this.serverVersion, "cesu8");
|
|
@@ -17011,10 +17152,10 @@ var require_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pa
|
|
|
17011
17152
|
}
|
|
17012
17153
|
}
|
|
17013
17154
|
if (args.capabilityFlags & ClientConstants$6.PLUGIN_AUTH) args.authPluginName = packet.readNullTerminatedString("ascii");
|
|
17014
|
-
return new Handshake
|
|
17155
|
+
return new Handshake(args);
|
|
17015
17156
|
}
|
|
17016
17157
|
};
|
|
17017
|
-
module.exports = Handshake
|
|
17158
|
+
module.exports = Handshake;
|
|
17018
17159
|
}) });
|
|
17019
17160
|
|
|
17020
17161
|
//#endregion
|
|
@@ -17024,7 +17165,7 @@ var require_handshake_response = /* @__PURE__ */ __commonJS({ "node_modules/mysq
|
|
|
17024
17165
|
const CharsetToEncoding$5 = require_charset_encodings();
|
|
17025
17166
|
const Packet$9 = require_packet();
|
|
17026
17167
|
const auth41$2 = require_auth_41();
|
|
17027
|
-
var HandshakeResponse
|
|
17168
|
+
var HandshakeResponse = class {
|
|
17028
17169
|
constructor(handshake) {
|
|
17029
17170
|
this.user = handshake.user || "";
|
|
17030
17171
|
this.database = handshake.database || "";
|
|
@@ -17034,10 +17175,18 @@ var require_handshake_response = /* @__PURE__ */ __commonJS({ "node_modules/mysq
|
|
|
17034
17175
|
this.authPluginData2 = handshake.authPluginData2;
|
|
17035
17176
|
this.compress = handshake.compress;
|
|
17036
17177
|
this.clientFlags = handshake.flags;
|
|
17037
|
-
|
|
17038
|
-
|
|
17039
|
-
|
|
17040
|
-
|
|
17178
|
+
if (handshake.authToken !== void 0 && handshake.authPluginName !== void 0) {
|
|
17179
|
+
if (!Buffer.isBuffer(handshake.authToken)) throw new TypeError("HandshakeResponse authToken must be a Buffer when provided");
|
|
17180
|
+
if (typeof handshake.authPluginName !== "string") throw new TypeError("HandshakeResponse authPluginName must be a string when provided");
|
|
17181
|
+
this.authToken = handshake.authToken;
|
|
17182
|
+
this.authPluginName = handshake.authPluginName;
|
|
17183
|
+
} else {
|
|
17184
|
+
let authToken;
|
|
17185
|
+
if (this.passwordSha1) authToken = auth41$2.calculateTokenFromPasswordSha(this.passwordSha1, this.authPluginData1, this.authPluginData2);
|
|
17186
|
+
else authToken = auth41$2.calculateToken(this.password, this.authPluginData1, this.authPluginData2);
|
|
17187
|
+
this.authToken = authToken;
|
|
17188
|
+
this.authPluginName = "mysql_native_password";
|
|
17189
|
+
}
|
|
17041
17190
|
this.charsetNumber = handshake.charsetNumber;
|
|
17042
17191
|
this.encoding = CharsetToEncoding$5[handshake.charsetNumber];
|
|
17043
17192
|
this.connectAttributes = handshake.connectAttributes;
|
|
@@ -17064,7 +17213,7 @@ var require_handshake_response = /* @__PURE__ */ __commonJS({ "node_modules/mysq
|
|
|
17064
17213
|
packet.writeInt8(0);
|
|
17065
17214
|
}
|
|
17066
17215
|
if (isSet("CONNECT_WITH_DB")) packet.writeNullTerminatedString(this.database, encoding);
|
|
17067
|
-
if (isSet("PLUGIN_AUTH")) packet.writeNullTerminatedString("mysql_native_password", "latin1");
|
|
17216
|
+
if (isSet("PLUGIN_AUTH")) packet.writeNullTerminatedString(this.authPluginName || "mysql_native_password", "latin1");
|
|
17068
17217
|
if (isSet("CONNECT_ATTRS")) {
|
|
17069
17218
|
const connectAttributes = this.connectAttributes || {};
|
|
17070
17219
|
const attrNames = Object.keys(connectAttributes);
|
|
@@ -17119,7 +17268,7 @@ var require_handshake_response = /* @__PURE__ */ __commonJS({ "node_modules/mysq
|
|
|
17119
17268
|
return args;
|
|
17120
17269
|
}
|
|
17121
17270
|
};
|
|
17122
|
-
module.exports = HandshakeResponse
|
|
17271
|
+
module.exports = HandshakeResponse;
|
|
17123
17272
|
}) });
|
|
17124
17273
|
|
|
17125
17274
|
//#endregion
|
|
@@ -17129,7 +17278,7 @@ var require_prepare_statement = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
17129
17278
|
const CommandCodes$1 = require_commands$1();
|
|
17130
17279
|
const StringParser$1 = require_string();
|
|
17131
17280
|
const CharsetToEncoding$4 = require_charset_encodings();
|
|
17132
|
-
var PrepareStatement
|
|
17281
|
+
var PrepareStatement = class {
|
|
17133
17282
|
constructor(sql, charsetNumber) {
|
|
17134
17283
|
this.query = sql;
|
|
17135
17284
|
this.charsetNumber = charsetNumber;
|
|
@@ -17138,21 +17287,20 @@ var require_prepare_statement = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
17138
17287
|
toPacket() {
|
|
17139
17288
|
const buf = StringParser$1.encode(this.query, this.encoding);
|
|
17140
17289
|
const length = 5 + buf.length;
|
|
17141
|
-
const
|
|
17142
|
-
const packet = new Packet$8(0, buffer$1, 0, length);
|
|
17290
|
+
const packet = new Packet$8(0, Buffer.allocUnsafe(length), 0, length);
|
|
17143
17291
|
packet.offset = 4;
|
|
17144
17292
|
packet.writeInt8(CommandCodes$1.STMT_PREPARE);
|
|
17145
17293
|
packet.writeBuffer(buf);
|
|
17146
17294
|
return packet;
|
|
17147
17295
|
}
|
|
17148
17296
|
};
|
|
17149
|
-
module.exports = PrepareStatement
|
|
17297
|
+
module.exports = PrepareStatement;
|
|
17150
17298
|
}) });
|
|
17151
17299
|
|
|
17152
17300
|
//#endregion
|
|
17153
17301
|
//#region node_modules/mysql2/lib/packets/prepared_statement_header.js
|
|
17154
17302
|
var require_prepared_statement_header = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/prepared_statement_header.js": ((exports, module) => {
|
|
17155
|
-
var PreparedStatementHeader
|
|
17303
|
+
var PreparedStatementHeader = class {
|
|
17156
17304
|
constructor(packet) {
|
|
17157
17305
|
packet.skip(1);
|
|
17158
17306
|
this.id = packet.readInt32();
|
|
@@ -17162,7 +17310,7 @@ var require_prepared_statement_header = /* @__PURE__ */ __commonJS({ "node_modul
|
|
|
17162
17310
|
this.warningCount = packet.readInt16();
|
|
17163
17311
|
}
|
|
17164
17312
|
};
|
|
17165
|
-
module.exports = PreparedStatementHeader
|
|
17313
|
+
module.exports = PreparedStatementHeader;
|
|
17166
17314
|
}) });
|
|
17167
17315
|
|
|
17168
17316
|
//#endregion
|
|
@@ -17172,7 +17320,7 @@ var require_query$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pack
|
|
|
17172
17320
|
const CommandCode$3 = require_commands$1();
|
|
17173
17321
|
const StringParser = require_string();
|
|
17174
17322
|
const CharsetToEncoding$3 = require_charset_encodings();
|
|
17175
|
-
var Query$
|
|
17323
|
+
var Query$3 = class {
|
|
17176
17324
|
constructor(sql, charsetNumber) {
|
|
17177
17325
|
this.query = sql;
|
|
17178
17326
|
this.charsetNumber = charsetNumber;
|
|
@@ -17181,15 +17329,14 @@ var require_query$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pack
|
|
|
17181
17329
|
toPacket() {
|
|
17182
17330
|
const buf = StringParser.encode(this.query, this.encoding);
|
|
17183
17331
|
const length = 5 + buf.length;
|
|
17184
|
-
const
|
|
17185
|
-
const packet = new Packet$7(0, buffer$1, 0, length);
|
|
17332
|
+
const packet = new Packet$7(0, Buffer.allocUnsafe(length), 0, length);
|
|
17186
17333
|
packet.offset = 4;
|
|
17187
17334
|
packet.writeInt8(CommandCode$3.QUERY);
|
|
17188
17335
|
packet.writeBuffer(buf);
|
|
17189
17336
|
return packet;
|
|
17190
17337
|
}
|
|
17191
17338
|
};
|
|
17192
|
-
module.exports = Query$
|
|
17339
|
+
module.exports = Query$3;
|
|
17193
17340
|
}) });
|
|
17194
17341
|
|
|
17195
17342
|
//#endregion
|
|
@@ -17197,7 +17344,7 @@ var require_query$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pack
|
|
|
17197
17344
|
var require_register_slave$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/register_slave.js": ((exports, module) => {
|
|
17198
17345
|
const Packet$6 = require_packet();
|
|
17199
17346
|
const CommandCodes = require_commands$1();
|
|
17200
|
-
var RegisterSlave$
|
|
17347
|
+
var RegisterSlave$2 = class {
|
|
17201
17348
|
constructor(opts) {
|
|
17202
17349
|
this.serverId = opts.serverId || 0;
|
|
17203
17350
|
this.slaveHostname = opts.slaveHostname || "";
|
|
@@ -17209,8 +17356,7 @@ var require_register_slave$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
17209
17356
|
}
|
|
17210
17357
|
toPacket() {
|
|
17211
17358
|
const length = 15 + Buffer.byteLength(this.slaveHostname, "utf8") + Buffer.byteLength(this.slaveUser, "utf8") + Buffer.byteLength(this.slavePassword, "utf8") + 3 + 4;
|
|
17212
|
-
const
|
|
17213
|
-
const packet = new Packet$6(0, buffer$1, 0, length);
|
|
17359
|
+
const packet = new Packet$6(0, Buffer.allocUnsafe(length), 0, length);
|
|
17214
17360
|
packet.offset = 4;
|
|
17215
17361
|
packet.writeInt8(CommandCodes.REGISTER_SLAVE);
|
|
17216
17362
|
packet.writeInt32(this.serverId);
|
|
@@ -17226,7 +17372,7 @@ var require_register_slave$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
17226
17372
|
return packet;
|
|
17227
17373
|
}
|
|
17228
17374
|
};
|
|
17229
|
-
module.exports = RegisterSlave$
|
|
17375
|
+
module.exports = RegisterSlave$2;
|
|
17230
17376
|
}) });
|
|
17231
17377
|
|
|
17232
17378
|
//#endregion
|
|
@@ -17343,7 +17489,7 @@ var require_resultset_header = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
17343
17489
|
const ServerSatusFlags = require_server_status();
|
|
17344
17490
|
const EncodingToCharset = require_encoding_charset();
|
|
17345
17491
|
const sessionInfoTypes = require_session_track();
|
|
17346
|
-
var ResultSetHeader
|
|
17492
|
+
var ResultSetHeader = class {
|
|
17347
17493
|
constructor(packet, connection) {
|
|
17348
17494
|
const bigNumberStrings = connection.config.bigNumberStrings;
|
|
17349
17495
|
const encoding = connection.serverEncoding;
|
|
@@ -17409,15 +17555,14 @@ var require_resultset_header = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
17409
17555
|
static toPacket(fieldCount, insertId) {
|
|
17410
17556
|
let length = 4 + Packet$5.lengthCodedNumberLength(fieldCount);
|
|
17411
17557
|
if (typeof insertId !== "undefined") length += Packet$5.lengthCodedNumberLength(insertId);
|
|
17412
|
-
const
|
|
17413
|
-
const packet = new Packet$5(0, buffer$1, 0, length);
|
|
17558
|
+
const packet = new Packet$5(0, Buffer.allocUnsafe(length), 0, length);
|
|
17414
17559
|
packet.offset = 4;
|
|
17415
17560
|
packet.writeLengthCodedNumber(fieldCount);
|
|
17416
17561
|
if (typeof insertId !== "undefined") packet.writeLengthCodedNumber(insertId);
|
|
17417
17562
|
return packet;
|
|
17418
17563
|
}
|
|
17419
17564
|
};
|
|
17420
|
-
module.exports = ResultSetHeader
|
|
17565
|
+
module.exports = ResultSetHeader;
|
|
17421
17566
|
}) });
|
|
17422
17567
|
|
|
17423
17568
|
//#endregion
|
|
@@ -17425,7 +17570,7 @@ var require_resultset_header = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
17425
17570
|
var require_ssl_request = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/ssl_request.js": ((exports, module) => {
|
|
17426
17571
|
const ClientConstants$3 = require_client();
|
|
17427
17572
|
const Packet$4 = require_packet();
|
|
17428
|
-
var SSLRequest
|
|
17573
|
+
var SSLRequest = class {
|
|
17429
17574
|
constructor(flags, charset) {
|
|
17430
17575
|
this.clientFlags = flags | ClientConstants$3.SSL;
|
|
17431
17576
|
this.charset = charset;
|
|
@@ -17442,21 +17587,21 @@ var require_ssl_request = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/
|
|
|
17442
17587
|
return packet;
|
|
17443
17588
|
}
|
|
17444
17589
|
};
|
|
17445
|
-
module.exports = SSLRequest
|
|
17590
|
+
module.exports = SSLRequest;
|
|
17446
17591
|
}) });
|
|
17447
17592
|
|
|
17448
17593
|
//#endregion
|
|
17449
17594
|
//#region node_modules/mysql2/lib/packets/text_row.js
|
|
17450
17595
|
var require_text_row = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/text_row.js": ((exports, module) => {
|
|
17451
17596
|
const Packet$3 = require_packet();
|
|
17452
|
-
var TextRow
|
|
17597
|
+
var TextRow = class TextRow {
|
|
17453
17598
|
constructor(columns) {
|
|
17454
17599
|
this.columns = columns || [];
|
|
17455
17600
|
}
|
|
17456
17601
|
static fromPacket(packet) {
|
|
17457
17602
|
const columns = [];
|
|
17458
17603
|
while (packet.haveMoreData()) columns.push(packet.readLengthCodedString());
|
|
17459
|
-
return new TextRow
|
|
17604
|
+
return new TextRow(columns);
|
|
17460
17605
|
}
|
|
17461
17606
|
static toPacket(columns, encoding) {
|
|
17462
17607
|
const sequenceId = 0;
|
|
@@ -17468,8 +17613,7 @@ var require_text_row = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pac
|
|
|
17468
17613
|
}
|
|
17469
17614
|
length += Packet$3.lengthCodedStringLength(val.toString(10), encoding);
|
|
17470
17615
|
});
|
|
17471
|
-
const
|
|
17472
|
-
const packet = new Packet$3(sequenceId, buffer$1, 0, length + 4);
|
|
17616
|
+
const packet = new Packet$3(sequenceId, Buffer.allocUnsafe(length + 4), 0, length + 4);
|
|
17473
17617
|
packet.offset = 4;
|
|
17474
17618
|
columns.forEach((val) => {
|
|
17475
17619
|
if (val === null) {
|
|
@@ -17485,52 +17629,33 @@ var require_text_row = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pac
|
|
|
17485
17629
|
return packet;
|
|
17486
17630
|
}
|
|
17487
17631
|
};
|
|
17488
|
-
module.exports = TextRow
|
|
17632
|
+
module.exports = TextRow;
|
|
17489
17633
|
}) });
|
|
17490
17634
|
|
|
17491
17635
|
//#endregion
|
|
17492
17636
|
//#region node_modules/mysql2/lib/packets/index.js
|
|
17493
17637
|
var require_packets = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/packets/index.js": ((exports, module) => {
|
|
17494
17638
|
const process$4 = __require("process");
|
|
17495
|
-
const AuthNextFactor = require_auth_next_factor();
|
|
17496
|
-
const AuthSwitchRequest = require_auth_switch_request();
|
|
17497
|
-
const AuthSwitchRequestMoreData = require_auth_switch_request_more_data();
|
|
17498
|
-
const AuthSwitchResponse = require_auth_switch_response();
|
|
17499
|
-
const BinaryRow = require_binary_row();
|
|
17500
|
-
const BinlogDump$2 = require_binlog_dump$1();
|
|
17501
|
-
const ChangeUser$2 = require_change_user$1();
|
|
17502
|
-
const CloseStatement$3 = require_close_statement$1();
|
|
17503
|
-
const ColumnDefinition = require_column_definition();
|
|
17504
|
-
const Execute$3 = require_execute$1();
|
|
17505
|
-
const Handshake = require_handshake();
|
|
17506
|
-
const HandshakeResponse = require_handshake_response();
|
|
17507
|
-
const PrepareStatement = require_prepare_statement();
|
|
17508
|
-
const PreparedStatementHeader = require_prepared_statement_header();
|
|
17509
|
-
const Query$3 = require_query$1();
|
|
17510
|
-
const RegisterSlave$2 = require_register_slave$1();
|
|
17511
|
-
const ResultSetHeader = require_resultset_header();
|
|
17512
|
-
const SSLRequest = require_ssl_request();
|
|
17513
|
-
const TextRow = require_text_row();
|
|
17514
17639
|
const ctorMap = {
|
|
17515
|
-
AuthNextFactor,
|
|
17516
|
-
AuthSwitchRequest,
|
|
17517
|
-
AuthSwitchRequestMoreData,
|
|
17518
|
-
AuthSwitchResponse,
|
|
17519
|
-
BinaryRow,
|
|
17520
|
-
BinlogDump:
|
|
17521
|
-
ChangeUser:
|
|
17522
|
-
CloseStatement:
|
|
17523
|
-
ColumnDefinition,
|
|
17524
|
-
Execute:
|
|
17525
|
-
Handshake,
|
|
17526
|
-
HandshakeResponse,
|
|
17527
|
-
PrepareStatement,
|
|
17528
|
-
PreparedStatementHeader,
|
|
17529
|
-
Query:
|
|
17530
|
-
RegisterSlave:
|
|
17531
|
-
ResultSetHeader,
|
|
17532
|
-
SSLRequest,
|
|
17533
|
-
TextRow
|
|
17640
|
+
AuthNextFactor: require_auth_next_factor(),
|
|
17641
|
+
AuthSwitchRequest: require_auth_switch_request(),
|
|
17642
|
+
AuthSwitchRequestMoreData: require_auth_switch_request_more_data(),
|
|
17643
|
+
AuthSwitchResponse: require_auth_switch_response(),
|
|
17644
|
+
BinaryRow: require_binary_row(),
|
|
17645
|
+
BinlogDump: require_binlog_dump$1(),
|
|
17646
|
+
ChangeUser: require_change_user$1(),
|
|
17647
|
+
CloseStatement: require_close_statement$1(),
|
|
17648
|
+
ColumnDefinition: require_column_definition(),
|
|
17649
|
+
Execute: require_execute$1(),
|
|
17650
|
+
Handshake: require_handshake(),
|
|
17651
|
+
HandshakeResponse: require_handshake_response(),
|
|
17652
|
+
PrepareStatement: require_prepare_statement(),
|
|
17653
|
+
PreparedStatementHeader: require_prepared_statement_header(),
|
|
17654
|
+
Query: require_query$1(),
|
|
17655
|
+
RegisterSlave: require_register_slave$1(),
|
|
17656
|
+
ResultSetHeader: require_resultset_header(),
|
|
17657
|
+
SSLRequest: require_ssl_request(),
|
|
17658
|
+
TextRow: require_text_row()
|
|
17534
17659
|
};
|
|
17535
17660
|
Object.entries(ctorMap).forEach(([name, ctor]) => {
|
|
17536
17661
|
module.exports[name] = ctor;
|
|
@@ -17557,8 +17682,7 @@ var require_packets = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pack
|
|
|
17557
17682
|
const message = args.message || "";
|
|
17558
17683
|
let length = 9 + Packet$2.lengthCodedNumberLength(affectedRows);
|
|
17559
17684
|
length += Packet$2.lengthCodedNumberLength(insertId);
|
|
17560
|
-
const
|
|
17561
|
-
const packet = new Packet$2(0, buffer$1, 0, length);
|
|
17685
|
+
const packet = new Packet$2(0, Buffer.allocUnsafe(length), 0, length);
|
|
17562
17686
|
packet.offset = 4;
|
|
17563
17687
|
packet.writeInt8(0);
|
|
17564
17688
|
packet.writeLengthCodedNumber(affectedRows);
|
|
@@ -17615,9 +17739,9 @@ var require_packets = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/pack
|
|
|
17615
17739
|
//#endregion
|
|
17616
17740
|
//#region node_modules/mysql2/lib/commands/command.js
|
|
17617
17741
|
var require_command = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/commands/command.js": ((exports, module) => {
|
|
17618
|
-
const EventEmitter$
|
|
17742
|
+
const EventEmitter$6 = __require("events").EventEmitter;
|
|
17619
17743
|
const Timers$2 = __require("timers");
|
|
17620
|
-
var Command$11 = class extends EventEmitter$
|
|
17744
|
+
var Command$11 = class extends EventEmitter$6 {
|
|
17621
17745
|
constructor() {
|
|
17622
17746
|
super();
|
|
17623
17747
|
this.next = null;
|
|
@@ -17663,6 +17787,7 @@ var require_sha256_password = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/
|
|
|
17663
17787
|
const PLUGIN_NAME$1 = "sha256_password";
|
|
17664
17788
|
const crypto$1 = __require("crypto");
|
|
17665
17789
|
const { xorRotating: xorRotating$1 } = require_auth_41();
|
|
17790
|
+
const Tls$1 = __require("tls");
|
|
17666
17791
|
const REQUEST_SERVER_KEY_PACKET$1 = Buffer.from([1]);
|
|
17667
17792
|
const STATE_INITIAL$1 = 0;
|
|
17668
17793
|
const STATE_WAIT_SERVER_KEY$1 = 1;
|
|
@@ -17683,6 +17808,7 @@ var require_sha256_password = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/
|
|
|
17683
17808
|
return (data) => {
|
|
17684
17809
|
switch (state) {
|
|
17685
17810
|
case STATE_INITIAL$1:
|
|
17811
|
+
if (connection.stream instanceof Tls$1.TLSSocket && connection.stream.encrypted === true) return Buffer.from(`${password}\0`, "utf8");
|
|
17686
17812
|
scramble = data.slice(0, 20);
|
|
17687
17813
|
if (pluginOptions.serverPublicKey) return authWithKey(pluginOptions.serverPublicKey);
|
|
17688
17814
|
state = STATE_WAIT_SERVER_KEY$1;
|
|
@@ -17719,8 +17845,7 @@ var require_caching_sha2_password = /* @__PURE__ */ __commonJS({ "node_modules/m
|
|
|
17719
17845
|
if (!password) return Buffer.alloc(0);
|
|
17720
17846
|
const stage1 = sha256(Buffer.from(password));
|
|
17721
17847
|
const stage2 = sha256(stage1);
|
|
17722
|
-
|
|
17723
|
-
return xor(stage1, stage3);
|
|
17848
|
+
return xor(stage1, sha256(Buffer.concat([stage2, scramble])));
|
|
17724
17849
|
}
|
|
17725
17850
|
function encrypt(password, scramble, key$1) {
|
|
17726
17851
|
const stage1 = xorRotating(Buffer.from(`${password}\0`, "utf8"), scramble);
|
|
@@ -17729,7 +17854,7 @@ var require_caching_sha2_password = /* @__PURE__ */ __commonJS({ "node_modules/m
|
|
|
17729
17854
|
padding: crypto.constants.RSA_PKCS1_OAEP_PADDING
|
|
17730
17855
|
}, stage1);
|
|
17731
17856
|
}
|
|
17732
|
-
|
|
17857
|
+
const pluginFactory = (pluginOptions = {}) => ({ connection }) => {
|
|
17733
17858
|
let state = 0;
|
|
17734
17859
|
let scramble = null;
|
|
17735
17860
|
const password = connection.config.password;
|
|
@@ -17767,6 +17892,8 @@ var require_caching_sha2_password = /* @__PURE__ */ __commonJS({ "node_modules/m
|
|
|
17767
17892
|
throw new Error(`Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in state ${state}`);
|
|
17768
17893
|
};
|
|
17769
17894
|
};
|
|
17895
|
+
module.exports = pluginFactory;
|
|
17896
|
+
module.exports.calculateToken = calculateToken;
|
|
17770
17897
|
}) });
|
|
17771
17898
|
|
|
17772
17899
|
//#endregion
|
|
@@ -17810,12 +17937,17 @@ var require_auth_switch = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/
|
|
|
17810
17937
|
const caching_sha2_password = require_caching_sha2_password();
|
|
17811
17938
|
const mysql_native_password = require_mysql_native_password();
|
|
17812
17939
|
const mysql_clear_password = require_mysql_clear_password();
|
|
17813
|
-
const standardAuthPlugins = {
|
|
17940
|
+
const standardAuthPlugins = Object.assign(Object.create(null), {
|
|
17814
17941
|
sha256_password: sha256_password({}),
|
|
17815
17942
|
caching_sha2_password: caching_sha2_password({}),
|
|
17816
17943
|
mysql_native_password: mysql_native_password({}),
|
|
17817
17944
|
mysql_clear_password: mysql_clear_password({})
|
|
17818
|
-
};
|
|
17945
|
+
});
|
|
17946
|
+
function getAuthPlugin$1(pluginName, connection) {
|
|
17947
|
+
const customPlugins = connection.config.authPlugins;
|
|
17948
|
+
if (customPlugins && Object.prototype.hasOwnProperty.call(customPlugins, pluginName)) return customPlugins[pluginName];
|
|
17949
|
+
return standardAuthPlugins[pluginName];
|
|
17950
|
+
}
|
|
17819
17951
|
function warnLegacyAuthSwitch() {
|
|
17820
17952
|
console.warn("WARNING! authSwitchHandler api is deprecated, please use new authPlugins api");
|
|
17821
17953
|
}
|
|
@@ -17826,7 +17958,6 @@ var require_auth_switch = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/
|
|
|
17826
17958
|
}
|
|
17827
17959
|
function authSwitchRequest(packet, connection, command) {
|
|
17828
17960
|
const { pluginName, pluginData } = Packets$10.AuthSwitchRequest.fromPacket(packet);
|
|
17829
|
-
let authPlugin = connection.config.authPlugins && connection.config.authPlugins[pluginName];
|
|
17830
17961
|
if (connection.config.authSwitchHandler && pluginName !== "mysql_native_password") {
|
|
17831
17962
|
const legacySwitchHandler = connection.config.authSwitchHandler;
|
|
17832
17963
|
warnLegacyAuthSwitch();
|
|
@@ -17839,7 +17970,7 @@ var require_auth_switch = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/
|
|
|
17839
17970
|
});
|
|
17840
17971
|
return;
|
|
17841
17972
|
}
|
|
17842
|
-
|
|
17973
|
+
const authPlugin = getAuthPlugin$1(pluginName, connection);
|
|
17843
17974
|
if (!authPlugin) throw new Error(`Server requests authentication using unknown plugin ${pluginName}. See TODO: add plugins doco here on how to configure or author authentication plugins.`);
|
|
17844
17975
|
connection._authPlugin = authPlugin({
|
|
17845
17976
|
connection,
|
|
@@ -17871,190 +18002,38 @@ var require_auth_switch = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/
|
|
|
17871
18002
|
}
|
|
17872
18003
|
module.exports = {
|
|
17873
18004
|
authSwitchRequest,
|
|
17874
|
-
authSwitchRequestMoreData
|
|
18005
|
+
authSwitchRequestMoreData,
|
|
18006
|
+
getAuthPlugin: getAuthPlugin$1,
|
|
18007
|
+
standardAuthPlugins
|
|
17875
18008
|
};
|
|
17876
18009
|
}) });
|
|
17877
18010
|
|
|
17878
18011
|
//#endregion
|
|
17879
|
-
//#region node_modules/
|
|
17880
|
-
var
|
|
17881
|
-
|
|
17882
|
-
|
|
17883
|
-
var
|
|
17884
|
-
|
|
17885
|
-
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
|
|
17889
|
-
|
|
17890
|
-
|
|
17891
|
-
|
|
17892
|
-
|
|
17893
|
-
*/
|
|
17894
|
-
var SeqQueue = function(timeout) {
|
|
17895
|
-
EventEmitter$6.call(this);
|
|
17896
|
-
if (timeout && timeout > 0) this.timeout = timeout;
|
|
17897
|
-
else this.timeout = DEFAULT_TIMEOUT;
|
|
17898
|
-
this.status = SeqQueueManager.STATUS_IDLE;
|
|
17899
|
-
this.curId = INIT_ID;
|
|
17900
|
-
this.queue = [];
|
|
17901
|
-
};
|
|
17902
|
-
util$1.inherits(SeqQueue, EventEmitter$6);
|
|
17903
|
-
/**
|
|
17904
|
-
* Add a task into queue.
|
|
17905
|
-
*
|
|
17906
|
-
* @param fn new request
|
|
17907
|
-
* @param ontimeout callback when task timeout
|
|
17908
|
-
* @param timeout timeout for current request. take the global timeout if this is invalid
|
|
17909
|
-
* @returns true or false
|
|
17910
|
-
*/
|
|
17911
|
-
SeqQueue.prototype.push = function(fn, ontimeout, timeout) {
|
|
17912
|
-
if (this.status !== SeqQueueManager.STATUS_IDLE && this.status !== SeqQueueManager.STATUS_BUSY) return false;
|
|
17913
|
-
if (typeof fn !== "function") throw new Error("fn should be a function.");
|
|
17914
|
-
this.queue.push({
|
|
17915
|
-
fn,
|
|
17916
|
-
ontimeout,
|
|
17917
|
-
timeout
|
|
17918
|
-
});
|
|
17919
|
-
if (this.status === SeqQueueManager.STATUS_IDLE) {
|
|
17920
|
-
this.status = SeqQueueManager.STATUS_BUSY;
|
|
17921
|
-
var self$1 = this;
|
|
17922
|
-
process.nextTick(function() {
|
|
17923
|
-
self$1._next(self$1.curId);
|
|
17924
|
-
});
|
|
17925
|
-
}
|
|
17926
|
-
return true;
|
|
17927
|
-
};
|
|
17928
|
-
/**
|
|
17929
|
-
* Close queue
|
|
17930
|
-
*
|
|
17931
|
-
* @param {Boolean} force if true will close the queue immediately else will execute the rest task in queue
|
|
17932
|
-
*/
|
|
17933
|
-
SeqQueue.prototype.close = function(force) {
|
|
17934
|
-
if (this.status !== SeqQueueManager.STATUS_IDLE && this.status !== SeqQueueManager.STATUS_BUSY) return;
|
|
17935
|
-
if (force) {
|
|
17936
|
-
this.status = SeqQueueManager.STATUS_DRAINED;
|
|
17937
|
-
if (this.timerId) {
|
|
17938
|
-
clearTimeout(this.timerId);
|
|
17939
|
-
this.timerId = void 0;
|
|
18012
|
+
//#region node_modules/mysql2/lib/compressed_protocol.js
|
|
18013
|
+
var require_compressed_protocol = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/compressed_protocol.js": ((exports, module) => {
|
|
18014
|
+
const zlib = __require("zlib");
|
|
18015
|
+
const PacketParser$1 = require_packet_parser();
|
|
18016
|
+
var Queue$2 = class {
|
|
18017
|
+
constructor() {
|
|
18018
|
+
this._queue = [];
|
|
18019
|
+
this._running = false;
|
|
18020
|
+
}
|
|
18021
|
+
push(fn) {
|
|
18022
|
+
this._queue.push(fn);
|
|
18023
|
+
if (!this._running) {
|
|
18024
|
+
this._running = true;
|
|
18025
|
+
process.nextTick(() => this._next());
|
|
17940
18026
|
}
|
|
17941
|
-
this.emit(EVENT_DRAINED);
|
|
17942
|
-
} else {
|
|
17943
|
-
this.status = SeqQueueManager.STATUS_CLOSED;
|
|
17944
|
-
this.emit(EVENT_CLOSED);
|
|
17945
18027
|
}
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17951
|
-
* @api private
|
|
17952
|
-
*/
|
|
17953
|
-
SeqQueue.prototype._next = function(tid) {
|
|
17954
|
-
if (tid !== this.curId || this.status !== SeqQueueManager.STATUS_BUSY && this.status !== SeqQueueManager.STATUS_CLOSED) return;
|
|
17955
|
-
if (this.timerId) {
|
|
17956
|
-
clearTimeout(this.timerId);
|
|
17957
|
-
this.timerId = void 0;
|
|
17958
|
-
}
|
|
17959
|
-
var task = this.queue.shift();
|
|
17960
|
-
if (!task) {
|
|
17961
|
-
if (this.status === SeqQueueManager.STATUS_BUSY) {
|
|
17962
|
-
this.status = SeqQueueManager.STATUS_IDLE;
|
|
17963
|
-
this.curId++;
|
|
17964
|
-
} else {
|
|
17965
|
-
this.status = SeqQueueManager.STATUS_DRAINED;
|
|
17966
|
-
this.emit(EVENT_DRAINED);
|
|
18028
|
+
_next() {
|
|
18029
|
+
const task = this._queue.shift();
|
|
18030
|
+
if (!task) {
|
|
18031
|
+
this._running = false;
|
|
18032
|
+
return;
|
|
17967
18033
|
}
|
|
17968
|
-
|
|
17969
|
-
}
|
|
17970
|
-
var self$1 = this;
|
|
17971
|
-
task.id = ++this.curId;
|
|
17972
|
-
var timeout = task.timeout > 0 ? task.timeout : this.timeout;
|
|
17973
|
-
timeout = timeout > 0 ? timeout : DEFAULT_TIMEOUT;
|
|
17974
|
-
this.timerId = setTimeout(function() {
|
|
17975
|
-
process.nextTick(function() {
|
|
17976
|
-
self$1._next(task.id);
|
|
17977
|
-
});
|
|
17978
|
-
self$1.emit("timeout", task);
|
|
17979
|
-
if (task.ontimeout) task.ontimeout();
|
|
17980
|
-
}, timeout);
|
|
17981
|
-
try {
|
|
17982
|
-
task.fn({ done: function() {
|
|
17983
|
-
var res = task.id === self$1.curId;
|
|
17984
|
-
process.nextTick(function() {
|
|
17985
|
-
self$1._next(task.id);
|
|
17986
|
-
});
|
|
17987
|
-
return res;
|
|
17988
|
-
} });
|
|
17989
|
-
} catch (err) {
|
|
17990
|
-
self$1.emit("error", err, task);
|
|
17991
|
-
process.nextTick(function() {
|
|
17992
|
-
self$1._next(task.id);
|
|
17993
|
-
});
|
|
18034
|
+
task({ done: () => process.nextTick(() => this._next()) });
|
|
17994
18035
|
}
|
|
17995
18036
|
};
|
|
17996
|
-
/**
|
|
17997
|
-
* Queue manager.
|
|
17998
|
-
*
|
|
17999
|
-
* @module
|
|
18000
|
-
*/
|
|
18001
|
-
var SeqQueueManager = module.exports;
|
|
18002
|
-
/**
|
|
18003
|
-
* Queue status: idle, welcome new tasks
|
|
18004
|
-
*
|
|
18005
|
-
* @const
|
|
18006
|
-
* @type {Number}
|
|
18007
|
-
* @memberOf SeqQueueManager
|
|
18008
|
-
*/
|
|
18009
|
-
SeqQueueManager.STATUS_IDLE = 0;
|
|
18010
|
-
/**
|
|
18011
|
-
* Queue status: busy, queue is working for some tasks now
|
|
18012
|
-
*
|
|
18013
|
-
* @const
|
|
18014
|
-
* @type {Number}
|
|
18015
|
-
* @memberOf SeqQueueManager
|
|
18016
|
-
*/
|
|
18017
|
-
SeqQueueManager.STATUS_BUSY = 1;
|
|
18018
|
-
/**
|
|
18019
|
-
* Queue status: closed, queue has closed and would not receive task any more
|
|
18020
|
-
* and is processing the remaining tasks now.
|
|
18021
|
-
*
|
|
18022
|
-
* @const
|
|
18023
|
-
* @type {Number}
|
|
18024
|
-
* @memberOf SeqQueueManager
|
|
18025
|
-
*/
|
|
18026
|
-
SeqQueueManager.STATUS_CLOSED = 2;
|
|
18027
|
-
/**
|
|
18028
|
-
* Queue status: drained, queue is ready to be destroy
|
|
18029
|
-
*
|
|
18030
|
-
* @const
|
|
18031
|
-
* @type {Number}
|
|
18032
|
-
* @memberOf SeqQueueManager
|
|
18033
|
-
*/
|
|
18034
|
-
SeqQueueManager.STATUS_DRAINED = 3;
|
|
18035
|
-
/**
|
|
18036
|
-
* Create Sequence queue
|
|
18037
|
-
*
|
|
18038
|
-
* @param {Number} timeout a global timeout for the new queue instance
|
|
18039
|
-
* @return {Object} new queue instance
|
|
18040
|
-
* @memberOf SeqQueueManager
|
|
18041
|
-
*/
|
|
18042
|
-
SeqQueueManager.createQueue = function(timeout) {
|
|
18043
|
-
return new SeqQueue(timeout);
|
|
18044
|
-
};
|
|
18045
|
-
}) });
|
|
18046
|
-
|
|
18047
|
-
//#endregion
|
|
18048
|
-
//#region node_modules/seq-queue/index.js
|
|
18049
|
-
var require_seq_queue = /* @__PURE__ */ __commonJS({ "node_modules/seq-queue/index.js": ((exports, module) => {
|
|
18050
|
-
module.exports = require_seq_queue$1();
|
|
18051
|
-
}) });
|
|
18052
|
-
|
|
18053
|
-
//#endregion
|
|
18054
|
-
//#region node_modules/mysql2/lib/compressed_protocol.js
|
|
18055
|
-
var require_compressed_protocol = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/compressed_protocol.js": ((exports, module) => {
|
|
18056
|
-
const zlib = __require("zlib");
|
|
18057
|
-
const PacketParser$1 = require_packet_parser();
|
|
18058
18037
|
function handleCompressedPacket(packet) {
|
|
18059
18038
|
const connection = this;
|
|
18060
18039
|
const deflatedLength = packet.readInt24();
|
|
@@ -18132,11 +18111,13 @@ var require_compressed_protocol = /* @__PURE__ */ __commonJS({ "node_modules/mys
|
|
|
18132
18111
|
}, 7);
|
|
18133
18112
|
connection.writeUncompressed = connection.write;
|
|
18134
18113
|
connection.write = writeCompressed;
|
|
18135
|
-
|
|
18136
|
-
connection.
|
|
18137
|
-
connection.deflateQueue = seqqueue.createQueue();
|
|
18114
|
+
connection.inflateQueue = new Queue$2();
|
|
18115
|
+
connection.deflateQueue = new Queue$2();
|
|
18138
18116
|
}
|
|
18139
|
-
module.exports = {
|
|
18117
|
+
module.exports = {
|
|
18118
|
+
enableCompression,
|
|
18119
|
+
Queue: Queue$2
|
|
18120
|
+
};
|
|
18140
18121
|
}) });
|
|
18141
18122
|
|
|
18142
18123
|
//#endregion
|
|
@@ -18147,6 +18128,8 @@ var require_client_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
18147
18128
|
const ClientConstants$2 = require_client();
|
|
18148
18129
|
const CharsetToEncoding$2 = require_charset_encodings();
|
|
18149
18130
|
const auth41 = require_auth_41();
|
|
18131
|
+
const { getAuthPlugin } = require_auth_switch();
|
|
18132
|
+
const { calculateToken: calculateSha2Token } = require_caching_sha2_password();
|
|
18150
18133
|
function flagNames(flags) {
|
|
18151
18134
|
const res = [];
|
|
18152
18135
|
for (const c in ClientConstants$2) if (flags & ClientConstants$2[c]) res.push(c.replace(/_/g, " ").toLowerCase());
|
|
@@ -18176,6 +18159,14 @@ var require_client_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
18176
18159
|
this.passwordSha1 = connection.config.passwordSha1;
|
|
18177
18160
|
this.database = connection.config.database;
|
|
18178
18161
|
this.authPluginName = this.handshake.authPluginName;
|
|
18162
|
+
const serverAuthMethod = this.handshake.authPluginName;
|
|
18163
|
+
const isSecureConnection = connection.config.ssl || connection.config.socketPath;
|
|
18164
|
+
const authPluginData = this.handshake.authPluginData1 && this.handshake.authPluginData2 ? Buffer.concat([this.handshake.authPluginData1, this.handshake.authPluginData2]).slice(0, 20) : Buffer.alloc(20);
|
|
18165
|
+
const hasCustomAuthPlugin = connection.config.authPlugins && Object.prototype.hasOwnProperty.call(connection.config.authPlugins, serverAuthMethod);
|
|
18166
|
+
const hasLegacyAuthSwitchHandler = typeof connection.config.authSwitchHandler === "function";
|
|
18167
|
+
const clientAuthMethod = !hasCustomAuthPlugin && !hasLegacyAuthSwitchHandler && this.canUseAuthMethodDirectly(serverAuthMethod, isSecureConnection) ? serverAuthMethod : "mysql_native_password";
|
|
18168
|
+
const authToken = this.calculateAuthToken(clientAuthMethod, this.password, authPluginData);
|
|
18169
|
+
if (connection.config.debug) console.log("Server auth method: %s, Using auth method: %s", serverAuthMethod, clientAuthMethod);
|
|
18179
18170
|
const handshakeResponse = new Packets$9.HandshakeResponse({
|
|
18180
18171
|
flags: this.clientFlags,
|
|
18181
18172
|
user: this.user,
|
|
@@ -18186,9 +18177,12 @@ var require_client_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
18186
18177
|
authPluginData1: this.handshake.authPluginData1,
|
|
18187
18178
|
authPluginData2: this.handshake.authPluginData2,
|
|
18188
18179
|
compress: connection.config.compress,
|
|
18189
|
-
connectAttributes: connection.config.connectAttributes
|
|
18180
|
+
connectAttributes: connection.config.connectAttributes,
|
|
18181
|
+
authToken,
|
|
18182
|
+
authPluginName: clientAuthMethod
|
|
18190
18183
|
});
|
|
18191
18184
|
connection.writePacket(handshakeResponse.toPacket());
|
|
18185
|
+
if (clientAuthMethod !== "mysql_native_password") this.initializeAuthPlugin(clientAuthMethod, authPluginData, connection);
|
|
18192
18186
|
}
|
|
18193
18187
|
calculateNativePasswordAuthToken(authPluginData) {
|
|
18194
18188
|
const authPluginData1 = authPluginData.slice(0, 8);
|
|
@@ -18198,6 +18192,43 @@ var require_client_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
18198
18192
|
else authToken = auth41.calculateToken(this.password, authPluginData1, authPluginData2);
|
|
18199
18193
|
return authToken;
|
|
18200
18194
|
}
|
|
18195
|
+
calculateSha256Token(password, scramble) {
|
|
18196
|
+
return calculateSha2Token(password, scramble);
|
|
18197
|
+
}
|
|
18198
|
+
calculateAuthToken(authMethod, password, authPluginData) {
|
|
18199
|
+
switch (authMethod) {
|
|
18200
|
+
case "mysql_native_password": return this.calculateNativePasswordAuthToken(authPluginData);
|
|
18201
|
+
case "caching_sha2_password": return this.calculateSha256Token(password, authPluginData);
|
|
18202
|
+
case "sha256_password":
|
|
18203
|
+
case "mysql_clear_password": return password ? Buffer.from(`${password}\0`, "utf8") : Buffer.alloc(0);
|
|
18204
|
+
default: return this.calculateNativePasswordAuthToken(authPluginData);
|
|
18205
|
+
}
|
|
18206
|
+
}
|
|
18207
|
+
canUseAuthMethodDirectly(authMethod, isSecureConnection) {
|
|
18208
|
+
switch (authMethod) {
|
|
18209
|
+
case "mysql_native_password":
|
|
18210
|
+
case "caching_sha2_password": return true;
|
|
18211
|
+
case "sha256_password":
|
|
18212
|
+
case "mysql_clear_password": return isSecureConnection;
|
|
18213
|
+
default: return false;
|
|
18214
|
+
}
|
|
18215
|
+
}
|
|
18216
|
+
initializeAuthPlugin(authMethod, authPluginData, connection) {
|
|
18217
|
+
const authPlugin = getAuthPlugin(authMethod, connection);
|
|
18218
|
+
if (!authPlugin) return;
|
|
18219
|
+
const pluginHandler = authPlugin({
|
|
18220
|
+
connection,
|
|
18221
|
+
command: this
|
|
18222
|
+
});
|
|
18223
|
+
connection._authPlugin = pluginHandler;
|
|
18224
|
+
try {
|
|
18225
|
+
Promise.resolve(pluginHandler(authPluginData)).catch((err) => {
|
|
18226
|
+
if (connection.config.debug) console.log("Auth plugin initialization:", err.message);
|
|
18227
|
+
});
|
|
18228
|
+
} catch (err) {
|
|
18229
|
+
if (connection.config.debug) console.log("Auth plugin initialization error:", err.message);
|
|
18230
|
+
}
|
|
18231
|
+
}
|
|
18201
18232
|
handshakeInit(helloPacket, connection) {
|
|
18202
18233
|
this.on("error", (e) => {
|
|
18203
18234
|
connection._fatalError = e;
|
|
@@ -18284,7 +18315,7 @@ var require_client_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
18284
18315
|
//#region node_modules/mysql2/lib/commands/server_handshake.js
|
|
18285
18316
|
var require_server_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/commands/server_handshake.js": ((exports, module) => {
|
|
18286
18317
|
const CommandCode$2 = require_commands$1();
|
|
18287
|
-
const Errors = require_errors();
|
|
18318
|
+
const Errors$1 = require_errors();
|
|
18288
18319
|
const Command$9 = require_command();
|
|
18289
18320
|
const Packets$8 = require_packets();
|
|
18290
18321
|
var ServerHandshake$1 = class ServerHandshake$1 extends Command$9 {
|
|
@@ -18340,7 +18371,7 @@ var require_server_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
18340
18371
|
const query = packet.readString(void 0, encoding);
|
|
18341
18372
|
connection.emit("stmt_prepare", query);
|
|
18342
18373
|
} else connection.writeError({
|
|
18343
|
-
code: Errors.HA_ERR_INTERNAL_ERROR,
|
|
18374
|
+
code: Errors$1.HA_ERR_INTERNAL_ERROR,
|
|
18344
18375
|
message: "No query handler for prepared statements."
|
|
18345
18376
|
});
|
|
18346
18377
|
break;
|
|
@@ -18349,7 +18380,7 @@ var require_server_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
18349
18380
|
const { stmtId, flags, iterationCount, values } = Packets$8.Execute.fromPacket(packet, encoding);
|
|
18350
18381
|
connection.emit("stmt_execute", stmtId, flags, iterationCount, values);
|
|
18351
18382
|
} else connection.writeError({
|
|
18352
|
-
code: Errors.HA_ERR_INTERNAL_ERROR,
|
|
18383
|
+
code: Errors$1.HA_ERR_INTERNAL_ERROR,
|
|
18353
18384
|
message: "No query handler for execute statements."
|
|
18354
18385
|
});
|
|
18355
18386
|
break;
|
|
@@ -18370,7 +18401,7 @@ var require_server_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
18370
18401
|
else if (this._isStatement(query, "EXECUTE")) connection.emit("stmt_execute", null, null, null, null, query);
|
|
18371
18402
|
else connection.emit("query", query);
|
|
18372
18403
|
} else connection.writeError({
|
|
18373
|
-
code: Errors.HA_ERR_INTERNAL_ERROR,
|
|
18404
|
+
code: Errors$1.HA_ERR_INTERNAL_ERROR,
|
|
18374
18405
|
message: "No query handler"
|
|
18375
18406
|
});
|
|
18376
18407
|
break;
|
|
@@ -18380,7 +18411,7 @@ var require_server_handshake = /* @__PURE__ */ __commonJS({ "node_modules/mysql2
|
|
|
18380
18411
|
const fields$1 = packet.readString(void 0, encoding);
|
|
18381
18412
|
connection.emit("field_list", table, fields$1);
|
|
18382
18413
|
} else connection.writeError({
|
|
18383
|
-
code: Errors.ER_WARN_DEPRECATED_SYNTAX,
|
|
18414
|
+
code: Errors$1.ER_WARN_DEPRECATED_SYNTAX,
|
|
18384
18415
|
message: "As of MySQL 5.7.11, COM_FIELD_LIST is deprecated and will be removed in a future version of MySQL."
|
|
18385
18416
|
});
|
|
18386
18417
|
break;
|
|
@@ -18727,7 +18758,7 @@ var require_helpers = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/help
|
|
|
18727
18758
|
let cardinalRecommended = false;
|
|
18728
18759
|
try {
|
|
18729
18760
|
highlightFn = __require("cardinal").highlight;
|
|
18730
|
-
} catch
|
|
18761
|
+
} catch {
|
|
18731
18762
|
highlightFn = (text) => {
|
|
18732
18763
|
if (!cardinalRecommended) {
|
|
18733
18764
|
console.log("For nicer debug output consider install cardinal@^2.0.0");
|
|
@@ -19599,7 +19630,7 @@ var require_static_binary_parser = /* @__PURE__ */ __commonJS({ "node_modules/my
|
|
|
19599
19630
|
default: return field.characterSet === Charsets$1.BINARY ? packet.readLengthCodedBuffer() : packet.readLengthCodedString(fields$1[fieldNum].encoding);
|
|
19600
19631
|
}
|
|
19601
19632
|
}
|
|
19602
|
-
return class BinaryRow$
|
|
19633
|
+
return class BinaryRow$1 {
|
|
19603
19634
|
constructor() {}
|
|
19604
19635
|
next(packet, fields$2, options) {
|
|
19605
19636
|
packet.readInt8();
|
|
@@ -20201,7 +20232,7 @@ var require_commands = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/com
|
|
|
20201
20232
|
var require_package = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/package.json": ((exports, module) => {
|
|
20202
20233
|
module.exports = {
|
|
20203
20234
|
"name": "mysql2",
|
|
20204
|
-
"version": "3.
|
|
20235
|
+
"version": "3.19.1",
|
|
20205
20236
|
"description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
|
|
20206
20237
|
"main": "index.js",
|
|
20207
20238
|
"typings": "typings/mysql/index",
|
|
@@ -20209,11 +20240,23 @@ var require_package = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/package.
|
|
|
20209
20240
|
"scripts": {
|
|
20210
20241
|
"lint": "eslint . && prettier --check .",
|
|
20211
20242
|
"lint:fix": "eslint . --fix && prettier --write .",
|
|
20212
|
-
"test": "
|
|
20213
|
-
"test:
|
|
20214
|
-
"test:
|
|
20215
|
-
"test:
|
|
20216
|
-
"
|
|
20243
|
+
"test": "npm run test:parallel && npm run test:global",
|
|
20244
|
+
"test:parallel": "poku -c=\"poku.config.mjs\" test",
|
|
20245
|
+
"test:global": "cross-env SUITE=global poku -c=\"poku.config.mjs\" test/global",
|
|
20246
|
+
"test:bun": "npm run test:bun:parallel && npm run test:bun:global",
|
|
20247
|
+
"test:bun:parallel": "bun poku -c=\"poku.config.mjs\" test",
|
|
20248
|
+
"test:bun:global": "cross-env SUITE=global bun poku -c=\"poku.config.mjs\" test/global",
|
|
20249
|
+
"test:deno": "npm run test:deno:parallel && npm run test:deno:global",
|
|
20250
|
+
"test:deno:parallel": "deno run --allow-read --allow-env --allow-run npm:poku -c=\"poku.config.mjs\" test",
|
|
20251
|
+
"test:deno:global": "cross-env SUITE=global deno run --allow-read --allow-env --allow-run npm:poku -c=\"poku.config.mjs\" test/global",
|
|
20252
|
+
"test:docker:up": "docker compose -f test/docker-compose.yml up --abort-on-container-exit --remove-orphans",
|
|
20253
|
+
"test:docker:down": "docker compose -f test/docker-compose.yml down",
|
|
20254
|
+
"test:docker:node": "npm run test:docker:up -- node && npm run test:docker:down",
|
|
20255
|
+
"test:docker:bun": "npm run test:docker:up -- bun && npm run test:docker:down",
|
|
20256
|
+
"test:docker:deno": "npm run test:docker:up -- deno && npm run test:docker:down",
|
|
20257
|
+
"test:docker:coverage": "npm run test:docker:up -- coverage && npm run test:docker:down",
|
|
20258
|
+
"test:coverage": "c8 npm test",
|
|
20259
|
+
"typecheck": "cd \"test/tsc-build\" && tsc -p \"tsconfig.json\" && cd .. && tsc -p \"tsconfig.json\" --noEmit",
|
|
20217
20260
|
"benchmark": "node ./benchmarks/benchmark.js",
|
|
20218
20261
|
"wait-port": "wait-on"
|
|
20219
20262
|
},
|
|
@@ -20245,36 +20288,38 @@ var require_package = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/package.
|
|
|
20245
20288
|
"author": "Andrey Sidorov <andrey.sidorov@gmail.com>",
|
|
20246
20289
|
"license": "MIT",
|
|
20247
20290
|
"dependencies": {
|
|
20248
|
-
"aws-ssl-profiles": "^1.1.
|
|
20291
|
+
"aws-ssl-profiles": "^1.1.2",
|
|
20249
20292
|
"denque": "^2.1.0",
|
|
20250
20293
|
"generate-function": "^2.3.1",
|
|
20251
|
-
"iconv-lite": "^0.7.
|
|
20252
|
-
"long": "^5.2
|
|
20253
|
-
"lru.min": "^1.
|
|
20254
|
-
"named-placeholders": "^1.1.
|
|
20255
|
-
"
|
|
20256
|
-
"sqlstring": "^2.3.2"
|
|
20294
|
+
"iconv-lite": "^0.7.2",
|
|
20295
|
+
"long": "^5.3.2",
|
|
20296
|
+
"lru.min": "^1.1.4",
|
|
20297
|
+
"named-placeholders": "^1.1.6",
|
|
20298
|
+
"sql-escaper": "^1.3.3"
|
|
20257
20299
|
},
|
|
20300
|
+
"peerDependencies": { "@types/node": ">= 8" },
|
|
20258
20301
|
"devDependencies": {
|
|
20259
|
-
"@eslint/eslintrc": "^3.3.
|
|
20260
|
-
"@eslint/js": "^9.
|
|
20261
|
-
"@eslint/markdown": "^7.
|
|
20262
|
-
"@
|
|
20263
|
-
"@
|
|
20264
|
-
"@typescript-eslint/
|
|
20265
|
-
"
|
|
20302
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
20303
|
+
"@eslint/js": "^9.39.2",
|
|
20304
|
+
"@eslint/markdown": "^7.5.1",
|
|
20305
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
|
20306
|
+
"@types/node": "^25.3.0",
|
|
20307
|
+
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
20308
|
+
"@typescript-eslint/parser": "^8.56.0",
|
|
20309
|
+
"assert-diff": "^3.0.4",
|
|
20266
20310
|
"benchmark": "^2.1.4",
|
|
20267
|
-
"c8": "^
|
|
20268
|
-
"
|
|
20269
|
-
"
|
|
20311
|
+
"c8": "^11.0.0",
|
|
20312
|
+
"cross-env": "^10.1.0",
|
|
20313
|
+
"error-stack-parser": "^2.1.4",
|
|
20314
|
+
"eslint-config-prettier": "^10.1.8",
|
|
20270
20315
|
"eslint-plugin-async-await": "^0.0.0",
|
|
20271
|
-
"eslint-plugin-
|
|
20272
|
-
"
|
|
20273
|
-
"
|
|
20274
|
-
"
|
|
20275
|
-
"
|
|
20276
|
-
"
|
|
20277
|
-
"typescript": "^5.
|
|
20316
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
20317
|
+
"globals": "^17.3.0",
|
|
20318
|
+
"poku": "^4.0.0",
|
|
20319
|
+
"portfinder": "^1.0.38",
|
|
20320
|
+
"prettier": "^3.8.1",
|
|
20321
|
+
"tsx": "^4.21.0",
|
|
20322
|
+
"typescript": "^5.9.3"
|
|
20278
20323
|
}
|
|
20279
20324
|
};
|
|
20280
20325
|
}) });
|
|
@@ -20283,6 +20328,7 @@ var require_package = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/package.
|
|
|
20283
20328
|
//#region node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js
|
|
20284
20329
|
var require_defaults = /* @__PURE__ */ __commonJS({ "node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js": ((exports) => {
|
|
20285
20330
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20331
|
+
exports.defaults = void 0;
|
|
20286
20332
|
/**
|
|
20287
20333
|
* CA Certificates for **Amazon RDS** (2024)
|
|
20288
20334
|
*
|
|
@@ -20413,6 +20459,7 @@ var require_defaults = /* @__PURE__ */ __commonJS({ "node_modules/aws-ssl-profil
|
|
|
20413
20459
|
//#region node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js
|
|
20414
20460
|
var require_proxies = /* @__PURE__ */ __commonJS({ "node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js": ((exports) => {
|
|
20415
20461
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20462
|
+
exports.proxies = void 0;
|
|
20416
20463
|
/**
|
|
20417
20464
|
* CA Certificates for **Amazon RDS Proxy** (2024)
|
|
20418
20465
|
*
|
|
@@ -20511,7 +20558,8 @@ var require_connection_config = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
20511
20558
|
Promise: 1,
|
|
20512
20559
|
queueLimit: 1,
|
|
20513
20560
|
waitForConnections: 1,
|
|
20514
|
-
jsonStrings: 1
|
|
20561
|
+
jsonStrings: 1,
|
|
20562
|
+
gracefulEnd: 1
|
|
20515
20563
|
};
|
|
20516
20564
|
var ConnectionConfig$3 = class ConnectionConfig$3 {
|
|
20517
20565
|
constructor(options) {
|
|
@@ -20583,6 +20631,7 @@ var require_connection_config = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
20583
20631
|
};
|
|
20584
20632
|
this.maxPreparedStatements = options.maxPreparedStatements || 16e3;
|
|
20585
20633
|
this.jsonStrings = options.jsonStrings || false;
|
|
20634
|
+
this.gracefulEnd = options.gracefulEnd || false;
|
|
20586
20635
|
}
|
|
20587
20636
|
static mergeFlags(default_flags, user_flags) {
|
|
20588
20637
|
let flags = 0, i$4;
|
|
@@ -20642,753 +20691,20 @@ var require_connection_config = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
20642
20691
|
user: decodeURIComponent(parsedUrl.username),
|
|
20643
20692
|
password: decodeURIComponent(parsedUrl.password)
|
|
20644
20693
|
};
|
|
20645
|
-
|
|
20694
|
+
for (const [key$1, value] of parsedUrl.searchParams) {
|
|
20695
|
+
if (key$1 in options) continue;
|
|
20646
20696
|
try {
|
|
20647
20697
|
options[key$1] = JSON.parse(value);
|
|
20648
|
-
} catch
|
|
20698
|
+
} catch {
|
|
20649
20699
|
options[key$1] = value;
|
|
20650
20700
|
}
|
|
20651
|
-
}
|
|
20701
|
+
}
|
|
20652
20702
|
return options;
|
|
20653
20703
|
}
|
|
20654
20704
|
};
|
|
20655
20705
|
module.exports = ConnectionConfig$3;
|
|
20656
20706
|
}) });
|
|
20657
20707
|
|
|
20658
|
-
//#endregion
|
|
20659
|
-
//#region node_modules/named-placeholders/node_modules/lru-cache/index.js
|
|
20660
|
-
var require_lru_cache = /* @__PURE__ */ __commonJS({ "node_modules/named-placeholders/node_modules/lru-cache/index.js": ((exports, module) => {
|
|
20661
|
-
const perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
20662
|
-
const AC = typeof AbortController === "function" ? AbortController : class AbortController$1 {
|
|
20663
|
-
constructor() {
|
|
20664
|
-
this.signal = new AS();
|
|
20665
|
-
}
|
|
20666
|
-
abort(reason = /* @__PURE__ */ new Error("This operation was aborted")) {
|
|
20667
|
-
this.signal.reason = this.signal.reason || reason;
|
|
20668
|
-
this.signal.aborted = true;
|
|
20669
|
-
this.signal.dispatchEvent({
|
|
20670
|
-
type: "abort",
|
|
20671
|
-
target: this.signal
|
|
20672
|
-
});
|
|
20673
|
-
}
|
|
20674
|
-
};
|
|
20675
|
-
const hasAbortSignal = typeof AbortSignal === "function";
|
|
20676
|
-
const hasACAbortSignal = typeof AC.AbortSignal === "function";
|
|
20677
|
-
const AS = hasAbortSignal ? AbortSignal : hasACAbortSignal ? AC.AbortController : class AbortSignal$1 {
|
|
20678
|
-
constructor() {
|
|
20679
|
-
this.reason = void 0;
|
|
20680
|
-
this.aborted = false;
|
|
20681
|
-
this._listeners = [];
|
|
20682
|
-
}
|
|
20683
|
-
dispatchEvent(e) {
|
|
20684
|
-
if (e.type === "abort") {
|
|
20685
|
-
this.aborted = true;
|
|
20686
|
-
this.onabort(e);
|
|
20687
|
-
this._listeners.forEach((f) => f(e), this);
|
|
20688
|
-
}
|
|
20689
|
-
}
|
|
20690
|
-
onabort() {}
|
|
20691
|
-
addEventListener(ev, fn) {
|
|
20692
|
-
if (ev === "abort") this._listeners.push(fn);
|
|
20693
|
-
}
|
|
20694
|
-
removeEventListener(ev, fn) {
|
|
20695
|
-
if (ev === "abort") this._listeners = this._listeners.filter((f) => f !== fn);
|
|
20696
|
-
}
|
|
20697
|
-
};
|
|
20698
|
-
const warned = /* @__PURE__ */ new Set();
|
|
20699
|
-
const deprecatedOption = (opt, instead) => {
|
|
20700
|
-
const code = `LRU_CACHE_OPTION_${opt}`;
|
|
20701
|
-
if (shouldWarn(code)) warn(code, `${opt} option`, `options.${instead}`, LRUCache);
|
|
20702
|
-
};
|
|
20703
|
-
const deprecatedMethod = (method, instead) => {
|
|
20704
|
-
const code = `LRU_CACHE_METHOD_${method}`;
|
|
20705
|
-
if (shouldWarn(code)) {
|
|
20706
|
-
const { prototype } = LRUCache;
|
|
20707
|
-
const { get } = Object.getOwnPropertyDescriptor(prototype, method);
|
|
20708
|
-
warn(code, `${method} method`, `cache.${instead}()`, get);
|
|
20709
|
-
}
|
|
20710
|
-
};
|
|
20711
|
-
const deprecatedProperty = (field, instead) => {
|
|
20712
|
-
const code = `LRU_CACHE_PROPERTY_${field}`;
|
|
20713
|
-
if (shouldWarn(code)) {
|
|
20714
|
-
const { prototype } = LRUCache;
|
|
20715
|
-
const { get } = Object.getOwnPropertyDescriptor(prototype, field);
|
|
20716
|
-
warn(code, `${field} property`, `cache.${instead}`, get);
|
|
20717
|
-
}
|
|
20718
|
-
};
|
|
20719
|
-
const emitWarning = (...a) => {
|
|
20720
|
-
typeof process === "object" && process && typeof process.emitWarning === "function" ? process.emitWarning(...a) : console.error(...a);
|
|
20721
|
-
};
|
|
20722
|
-
const shouldWarn = (code) => !warned.has(code);
|
|
20723
|
-
const warn = (code, what, instead, fn) => {
|
|
20724
|
-
warned.add(code);
|
|
20725
|
-
const msg = `The ${what} is deprecated. Please use ${instead} instead.`;
|
|
20726
|
-
emitWarning(msg, "DeprecationWarning", code, fn);
|
|
20727
|
-
};
|
|
20728
|
-
const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
|
|
20729
|
-
/* istanbul ignore next - This is a little bit ridiculous, tbh.
|
|
20730
|
-
* The maximum array length is 2^32-1 or thereabouts on most JS impls.
|
|
20731
|
-
* And well before that point, you're caching the entire world, I mean,
|
|
20732
|
-
* that's ~32GB of just integers for the next/prev links, plus whatever
|
|
20733
|
-
* else to hold that many keys and values. Just filling the memory with
|
|
20734
|
-
* zeroes at init time is brutal when you get that big.
|
|
20735
|
-
* But why not be complete?
|
|
20736
|
-
* Maybe in the future, these limits will have expanded. */
|
|
20737
|
-
const getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
|
|
20738
|
-
var ZeroArray = class extends Array {
|
|
20739
|
-
constructor(size) {
|
|
20740
|
-
super(size);
|
|
20741
|
-
this.fill(0);
|
|
20742
|
-
}
|
|
20743
|
-
};
|
|
20744
|
-
var Stack = class {
|
|
20745
|
-
constructor(max) {
|
|
20746
|
-
if (max === 0) return [];
|
|
20747
|
-
this.heap = new (getUintArray(max))(max);
|
|
20748
|
-
this.length = 0;
|
|
20749
|
-
}
|
|
20750
|
-
push(n) {
|
|
20751
|
-
this.heap[this.length++] = n;
|
|
20752
|
-
}
|
|
20753
|
-
pop() {
|
|
20754
|
-
return this.heap[--this.length];
|
|
20755
|
-
}
|
|
20756
|
-
};
|
|
20757
|
-
var LRUCache = class LRUCache {
|
|
20758
|
-
constructor(options = {}) {
|
|
20759
|
-
const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, fetchContext, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
|
|
20760
|
-
const { length, maxAge, stale } = options instanceof LRUCache ? {} : options;
|
|
20761
|
-
if (max !== 0 && !isPosInt(max)) throw new TypeError("max option must be a nonnegative integer");
|
|
20762
|
-
const UintArray = max ? getUintArray(max) : Array;
|
|
20763
|
-
if (!UintArray) throw new Error("invalid max value: " + max);
|
|
20764
|
-
this.max = max;
|
|
20765
|
-
this.maxSize = maxSize;
|
|
20766
|
-
this.maxEntrySize = maxEntrySize || this.maxSize;
|
|
20767
|
-
this.sizeCalculation = sizeCalculation || length;
|
|
20768
|
-
if (this.sizeCalculation) {
|
|
20769
|
-
if (!this.maxSize && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
20770
|
-
if (typeof this.sizeCalculation !== "function") throw new TypeError("sizeCalculation set to non-function");
|
|
20771
|
-
}
|
|
20772
|
-
this.fetchMethod = fetchMethod || null;
|
|
20773
|
-
if (this.fetchMethod && typeof this.fetchMethod !== "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
20774
|
-
this.fetchContext = fetchContext;
|
|
20775
|
-
if (!this.fetchMethod && fetchContext !== void 0) throw new TypeError("cannot set fetchContext without fetchMethod");
|
|
20776
|
-
this.keyMap = /* @__PURE__ */ new Map();
|
|
20777
|
-
this.keyList = new Array(max).fill(null);
|
|
20778
|
-
this.valList = new Array(max).fill(null);
|
|
20779
|
-
this.next = new UintArray(max);
|
|
20780
|
-
this.prev = new UintArray(max);
|
|
20781
|
-
this.head = 0;
|
|
20782
|
-
this.tail = 0;
|
|
20783
|
-
this.free = new Stack(max);
|
|
20784
|
-
this.initialFill = 1;
|
|
20785
|
-
this.size = 0;
|
|
20786
|
-
if (typeof dispose === "function") this.dispose = dispose;
|
|
20787
|
-
if (typeof disposeAfter === "function") {
|
|
20788
|
-
this.disposeAfter = disposeAfter;
|
|
20789
|
-
this.disposed = [];
|
|
20790
|
-
} else {
|
|
20791
|
-
this.disposeAfter = null;
|
|
20792
|
-
this.disposed = null;
|
|
20793
|
-
}
|
|
20794
|
-
this.noDisposeOnSet = !!noDisposeOnSet;
|
|
20795
|
-
this.noUpdateTTL = !!noUpdateTTL;
|
|
20796
|
-
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
|
|
20797
|
-
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
|
|
20798
|
-
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
|
|
20799
|
-
this.ignoreFetchAbort = !!ignoreFetchAbort;
|
|
20800
|
-
if (this.maxEntrySize !== 0) {
|
|
20801
|
-
if (this.maxSize !== 0) {
|
|
20802
|
-
if (!isPosInt(this.maxSize)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
20803
|
-
}
|
|
20804
|
-
if (!isPosInt(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
20805
|
-
this.initializeSizeTracking();
|
|
20806
|
-
}
|
|
20807
|
-
this.allowStale = !!allowStale || !!stale;
|
|
20808
|
-
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
|
|
20809
|
-
this.updateAgeOnGet = !!updateAgeOnGet;
|
|
20810
|
-
this.updateAgeOnHas = !!updateAgeOnHas;
|
|
20811
|
-
this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
|
|
20812
|
-
this.ttlAutopurge = !!ttlAutopurge;
|
|
20813
|
-
this.ttl = ttl || maxAge || 0;
|
|
20814
|
-
if (this.ttl) {
|
|
20815
|
-
if (!isPosInt(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
20816
|
-
this.initializeTTLTracking();
|
|
20817
|
-
}
|
|
20818
|
-
if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
20819
|
-
if (!this.ttlAutopurge && !this.max && !this.maxSize) {
|
|
20820
|
-
const code = "LRU_CACHE_UNBOUNDED";
|
|
20821
|
-
if (shouldWarn(code)) {
|
|
20822
|
-
warned.add(code);
|
|
20823
|
-
emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", code, LRUCache);
|
|
20824
|
-
}
|
|
20825
|
-
}
|
|
20826
|
-
if (stale) deprecatedOption("stale", "allowStale");
|
|
20827
|
-
if (maxAge) deprecatedOption("maxAge", "ttl");
|
|
20828
|
-
if (length) deprecatedOption("length", "sizeCalculation");
|
|
20829
|
-
}
|
|
20830
|
-
getRemainingTTL(key$1) {
|
|
20831
|
-
return this.has(key$1, { updateAgeOnHas: false }) ? Infinity : 0;
|
|
20832
|
-
}
|
|
20833
|
-
initializeTTLTracking() {
|
|
20834
|
-
this.ttls = new ZeroArray(this.max);
|
|
20835
|
-
this.starts = new ZeroArray(this.max);
|
|
20836
|
-
this.setItemTTL = (index, ttl, start = perf.now()) => {
|
|
20837
|
-
this.starts[index] = ttl !== 0 ? start : 0;
|
|
20838
|
-
this.ttls[index] = ttl;
|
|
20839
|
-
if (ttl !== 0 && this.ttlAutopurge) {
|
|
20840
|
-
const t = setTimeout(() => {
|
|
20841
|
-
if (this.isStale(index)) this.delete(this.keyList[index]);
|
|
20842
|
-
}, ttl + 1);
|
|
20843
|
-
/* istanbul ignore else - unref() not supported on all platforms */
|
|
20844
|
-
if (t.unref) t.unref();
|
|
20845
|
-
}
|
|
20846
|
-
};
|
|
20847
|
-
this.updateItemAge = (index) => {
|
|
20848
|
-
this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0;
|
|
20849
|
-
};
|
|
20850
|
-
this.statusTTL = (status, index) => {
|
|
20851
|
-
if (status) {
|
|
20852
|
-
status.ttl = this.ttls[index];
|
|
20853
|
-
status.start = this.starts[index];
|
|
20854
|
-
status.now = cachedNow || getNow();
|
|
20855
|
-
status.remainingTTL = status.now + status.ttl - status.start;
|
|
20856
|
-
}
|
|
20857
|
-
};
|
|
20858
|
-
let cachedNow = 0;
|
|
20859
|
-
const getNow = () => {
|
|
20860
|
-
const n = perf.now();
|
|
20861
|
-
if (this.ttlResolution > 0) {
|
|
20862
|
-
cachedNow = n;
|
|
20863
|
-
const t = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
|
20864
|
-
/* istanbul ignore else - not available on all platforms */
|
|
20865
|
-
if (t.unref) t.unref();
|
|
20866
|
-
}
|
|
20867
|
-
return n;
|
|
20868
|
-
};
|
|
20869
|
-
this.getRemainingTTL = (key$1) => {
|
|
20870
|
-
const index = this.keyMap.get(key$1);
|
|
20871
|
-
if (index === void 0) return 0;
|
|
20872
|
-
return this.ttls[index] === 0 || this.starts[index] === 0 ? Infinity : this.starts[index] + this.ttls[index] - (cachedNow || getNow());
|
|
20873
|
-
};
|
|
20874
|
-
this.isStale = (index) => {
|
|
20875
|
-
return this.ttls[index] !== 0 && this.starts[index] !== 0 && (cachedNow || getNow()) - this.starts[index] > this.ttls[index];
|
|
20876
|
-
};
|
|
20877
|
-
}
|
|
20878
|
-
updateItemAge(_index) {}
|
|
20879
|
-
statusTTL(_status, _index) {}
|
|
20880
|
-
setItemTTL(_index, _ttl, _start) {}
|
|
20881
|
-
isStale(_index) {
|
|
20882
|
-
return false;
|
|
20883
|
-
}
|
|
20884
|
-
initializeSizeTracking() {
|
|
20885
|
-
this.calculatedSize = 0;
|
|
20886
|
-
this.sizes = new ZeroArray(this.max);
|
|
20887
|
-
this.removeItemSize = (index) => {
|
|
20888
|
-
this.calculatedSize -= this.sizes[index];
|
|
20889
|
-
this.sizes[index] = 0;
|
|
20890
|
-
};
|
|
20891
|
-
this.requireSize = (k, v, size, sizeCalculation) => {
|
|
20892
|
-
if (this.isBackgroundFetch(v)) return 0;
|
|
20893
|
-
if (!isPosInt(size)) if (sizeCalculation) {
|
|
20894
|
-
if (typeof sizeCalculation !== "function") throw new TypeError("sizeCalculation must be a function");
|
|
20895
|
-
size = sizeCalculation(v, k);
|
|
20896
|
-
if (!isPosInt(size)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
20897
|
-
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
20898
|
-
return size;
|
|
20899
|
-
};
|
|
20900
|
-
this.addItemSize = (index, size, status) => {
|
|
20901
|
-
this.sizes[index] = size;
|
|
20902
|
-
if (this.maxSize) {
|
|
20903
|
-
const maxSize = this.maxSize - this.sizes[index];
|
|
20904
|
-
while (this.calculatedSize > maxSize) this.evict(true);
|
|
20905
|
-
}
|
|
20906
|
-
this.calculatedSize += this.sizes[index];
|
|
20907
|
-
if (status) {
|
|
20908
|
-
status.entrySize = size;
|
|
20909
|
-
status.totalCalculatedSize = this.calculatedSize;
|
|
20910
|
-
}
|
|
20911
|
-
};
|
|
20912
|
-
}
|
|
20913
|
-
removeItemSize(_index) {}
|
|
20914
|
-
addItemSize(_index, _size) {}
|
|
20915
|
-
requireSize(_k, _v, size, sizeCalculation) {
|
|
20916
|
-
if (size || sizeCalculation) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
20917
|
-
}
|
|
20918
|
-
*indexes({ allowStale = this.allowStale } = {}) {
|
|
20919
|
-
if (this.size) for (let i$4 = this.tail;;) {
|
|
20920
|
-
if (!this.isValidIndex(i$4)) break;
|
|
20921
|
-
if (allowStale || !this.isStale(i$4)) yield i$4;
|
|
20922
|
-
if (i$4 === this.head) break;
|
|
20923
|
-
else i$4 = this.prev[i$4];
|
|
20924
|
-
}
|
|
20925
|
-
}
|
|
20926
|
-
*rindexes({ allowStale = this.allowStale } = {}) {
|
|
20927
|
-
if (this.size) for (let i$4 = this.head;;) {
|
|
20928
|
-
if (!this.isValidIndex(i$4)) break;
|
|
20929
|
-
if (allowStale || !this.isStale(i$4)) yield i$4;
|
|
20930
|
-
if (i$4 === this.tail) break;
|
|
20931
|
-
else i$4 = this.next[i$4];
|
|
20932
|
-
}
|
|
20933
|
-
}
|
|
20934
|
-
isValidIndex(index) {
|
|
20935
|
-
return index !== void 0 && this.keyMap.get(this.keyList[index]) === index;
|
|
20936
|
-
}
|
|
20937
|
-
*entries() {
|
|
20938
|
-
for (const i$4 of this.indexes()) if (this.valList[i$4] !== void 0 && this.keyList[i$4] !== void 0 && !this.isBackgroundFetch(this.valList[i$4])) yield [this.keyList[i$4], this.valList[i$4]];
|
|
20939
|
-
}
|
|
20940
|
-
*rentries() {
|
|
20941
|
-
for (const i$4 of this.rindexes()) if (this.valList[i$4] !== void 0 && this.keyList[i$4] !== void 0 && !this.isBackgroundFetch(this.valList[i$4])) yield [this.keyList[i$4], this.valList[i$4]];
|
|
20942
|
-
}
|
|
20943
|
-
*keys() {
|
|
20944
|
-
for (const i$4 of this.indexes()) if (this.keyList[i$4] !== void 0 && !this.isBackgroundFetch(this.valList[i$4])) yield this.keyList[i$4];
|
|
20945
|
-
}
|
|
20946
|
-
*rkeys() {
|
|
20947
|
-
for (const i$4 of this.rindexes()) if (this.keyList[i$4] !== void 0 && !this.isBackgroundFetch(this.valList[i$4])) yield this.keyList[i$4];
|
|
20948
|
-
}
|
|
20949
|
-
*values() {
|
|
20950
|
-
for (const i$4 of this.indexes()) if (this.valList[i$4] !== void 0 && !this.isBackgroundFetch(this.valList[i$4])) yield this.valList[i$4];
|
|
20951
|
-
}
|
|
20952
|
-
*rvalues() {
|
|
20953
|
-
for (const i$4 of this.rindexes()) if (this.valList[i$4] !== void 0 && !this.isBackgroundFetch(this.valList[i$4])) yield this.valList[i$4];
|
|
20954
|
-
}
|
|
20955
|
-
[Symbol.iterator]() {
|
|
20956
|
-
return this.entries();
|
|
20957
|
-
}
|
|
20958
|
-
find(fn, getOptions) {
|
|
20959
|
-
for (const i$4 of this.indexes()) {
|
|
20960
|
-
const v = this.valList[i$4];
|
|
20961
|
-
const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
20962
|
-
if (value === void 0) continue;
|
|
20963
|
-
if (fn(value, this.keyList[i$4], this)) return this.get(this.keyList[i$4], getOptions);
|
|
20964
|
-
}
|
|
20965
|
-
}
|
|
20966
|
-
forEach(fn, thisp = this) {
|
|
20967
|
-
for (const i$4 of this.indexes()) {
|
|
20968
|
-
const v = this.valList[i$4];
|
|
20969
|
-
const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
20970
|
-
if (value === void 0) continue;
|
|
20971
|
-
fn.call(thisp, value, this.keyList[i$4], this);
|
|
20972
|
-
}
|
|
20973
|
-
}
|
|
20974
|
-
rforEach(fn, thisp = this) {
|
|
20975
|
-
for (const i$4 of this.rindexes()) {
|
|
20976
|
-
const v = this.valList[i$4];
|
|
20977
|
-
const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
20978
|
-
if (value === void 0) continue;
|
|
20979
|
-
fn.call(thisp, value, this.keyList[i$4], this);
|
|
20980
|
-
}
|
|
20981
|
-
}
|
|
20982
|
-
get prune() {
|
|
20983
|
-
deprecatedMethod("prune", "purgeStale");
|
|
20984
|
-
return this.purgeStale;
|
|
20985
|
-
}
|
|
20986
|
-
purgeStale() {
|
|
20987
|
-
let deleted = false;
|
|
20988
|
-
for (const i$4 of this.rindexes({ allowStale: true })) if (this.isStale(i$4)) {
|
|
20989
|
-
this.delete(this.keyList[i$4]);
|
|
20990
|
-
deleted = true;
|
|
20991
|
-
}
|
|
20992
|
-
return deleted;
|
|
20993
|
-
}
|
|
20994
|
-
dump() {
|
|
20995
|
-
const arr = [];
|
|
20996
|
-
for (const i$4 of this.indexes({ allowStale: true })) {
|
|
20997
|
-
const key$1 = this.keyList[i$4];
|
|
20998
|
-
const v = this.valList[i$4];
|
|
20999
|
-
const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
21000
|
-
if (value === void 0) continue;
|
|
21001
|
-
const entry = { value };
|
|
21002
|
-
if (this.ttls) {
|
|
21003
|
-
entry.ttl = this.ttls[i$4];
|
|
21004
|
-
const age = perf.now() - this.starts[i$4];
|
|
21005
|
-
entry.start = Math.floor(Date.now() - age);
|
|
21006
|
-
}
|
|
21007
|
-
if (this.sizes) entry.size = this.sizes[i$4];
|
|
21008
|
-
arr.unshift([key$1, entry]);
|
|
21009
|
-
}
|
|
21010
|
-
return arr;
|
|
21011
|
-
}
|
|
21012
|
-
load(arr) {
|
|
21013
|
-
this.clear();
|
|
21014
|
-
for (const [key$1, entry] of arr) {
|
|
21015
|
-
if (entry.start) {
|
|
21016
|
-
const age = Date.now() - entry.start;
|
|
21017
|
-
entry.start = perf.now() - age;
|
|
21018
|
-
}
|
|
21019
|
-
this.set(key$1, entry.value, entry);
|
|
21020
|
-
}
|
|
21021
|
-
}
|
|
21022
|
-
dispose(_v, _k, _reason) {}
|
|
21023
|
-
set(k, v, { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, status } = {}) {
|
|
21024
|
-
size = this.requireSize(k, v, size, sizeCalculation);
|
|
21025
|
-
if (this.maxEntrySize && size > this.maxEntrySize) {
|
|
21026
|
-
if (status) {
|
|
21027
|
-
status.set = "miss";
|
|
21028
|
-
status.maxEntrySizeExceeded = true;
|
|
21029
|
-
}
|
|
21030
|
-
this.delete(k);
|
|
21031
|
-
return this;
|
|
21032
|
-
}
|
|
21033
|
-
let index = this.size === 0 ? void 0 : this.keyMap.get(k);
|
|
21034
|
-
if (index === void 0) {
|
|
21035
|
-
index = this.newIndex();
|
|
21036
|
-
this.keyList[index] = k;
|
|
21037
|
-
this.valList[index] = v;
|
|
21038
|
-
this.keyMap.set(k, index);
|
|
21039
|
-
this.next[this.tail] = index;
|
|
21040
|
-
this.prev[index] = this.tail;
|
|
21041
|
-
this.tail = index;
|
|
21042
|
-
this.size++;
|
|
21043
|
-
this.addItemSize(index, size, status);
|
|
21044
|
-
if (status) status.set = "add";
|
|
21045
|
-
noUpdateTTL = false;
|
|
21046
|
-
} else {
|
|
21047
|
-
this.moveToTail(index);
|
|
21048
|
-
const oldVal = this.valList[index];
|
|
21049
|
-
if (v !== oldVal) {
|
|
21050
|
-
if (this.isBackgroundFetch(oldVal)) oldVal.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
|
|
21051
|
-
else if (!noDisposeOnSet) {
|
|
21052
|
-
this.dispose(oldVal, k, "set");
|
|
21053
|
-
if (this.disposeAfter) this.disposed.push([
|
|
21054
|
-
oldVal,
|
|
21055
|
-
k,
|
|
21056
|
-
"set"
|
|
21057
|
-
]);
|
|
21058
|
-
}
|
|
21059
|
-
this.removeItemSize(index);
|
|
21060
|
-
this.valList[index] = v;
|
|
21061
|
-
this.addItemSize(index, size, status);
|
|
21062
|
-
if (status) {
|
|
21063
|
-
status.set = "replace";
|
|
21064
|
-
const oldValue = oldVal && this.isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
|
|
21065
|
-
if (oldValue !== void 0) status.oldValue = oldValue;
|
|
21066
|
-
}
|
|
21067
|
-
} else if (status) status.set = "update";
|
|
21068
|
-
}
|
|
21069
|
-
if (ttl !== 0 && this.ttl === 0 && !this.ttls) this.initializeTTLTracking();
|
|
21070
|
-
if (!noUpdateTTL) this.setItemTTL(index, ttl, start);
|
|
21071
|
-
this.statusTTL(status, index);
|
|
21072
|
-
if (this.disposeAfter) while (this.disposed.length) this.disposeAfter(...this.disposed.shift());
|
|
21073
|
-
return this;
|
|
21074
|
-
}
|
|
21075
|
-
newIndex() {
|
|
21076
|
-
if (this.size === 0) return this.tail;
|
|
21077
|
-
if (this.size === this.max && this.max !== 0) return this.evict(false);
|
|
21078
|
-
if (this.free.length !== 0) return this.free.pop();
|
|
21079
|
-
return this.initialFill++;
|
|
21080
|
-
}
|
|
21081
|
-
pop() {
|
|
21082
|
-
if (this.size) {
|
|
21083
|
-
const val = this.valList[this.head];
|
|
21084
|
-
this.evict(true);
|
|
21085
|
-
return val;
|
|
21086
|
-
}
|
|
21087
|
-
}
|
|
21088
|
-
evict(free) {
|
|
21089
|
-
const head = this.head;
|
|
21090
|
-
const k = this.keyList[head];
|
|
21091
|
-
const v = this.valList[head];
|
|
21092
|
-
if (this.isBackgroundFetch(v)) v.__abortController.abort(/* @__PURE__ */ new Error("evicted"));
|
|
21093
|
-
else {
|
|
21094
|
-
this.dispose(v, k, "evict");
|
|
21095
|
-
if (this.disposeAfter) this.disposed.push([
|
|
21096
|
-
v,
|
|
21097
|
-
k,
|
|
21098
|
-
"evict"
|
|
21099
|
-
]);
|
|
21100
|
-
}
|
|
21101
|
-
this.removeItemSize(head);
|
|
21102
|
-
if (free) {
|
|
21103
|
-
this.keyList[head] = null;
|
|
21104
|
-
this.valList[head] = null;
|
|
21105
|
-
this.free.push(head);
|
|
21106
|
-
}
|
|
21107
|
-
this.head = this.next[head];
|
|
21108
|
-
this.keyMap.delete(k);
|
|
21109
|
-
this.size--;
|
|
21110
|
-
return head;
|
|
21111
|
-
}
|
|
21112
|
-
has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) {
|
|
21113
|
-
const index = this.keyMap.get(k);
|
|
21114
|
-
if (index !== void 0) {
|
|
21115
|
-
if (!this.isStale(index)) {
|
|
21116
|
-
if (updateAgeOnHas) this.updateItemAge(index);
|
|
21117
|
-
if (status) status.has = "hit";
|
|
21118
|
-
this.statusTTL(status, index);
|
|
21119
|
-
return true;
|
|
21120
|
-
} else if (status) {
|
|
21121
|
-
status.has = "stale";
|
|
21122
|
-
this.statusTTL(status, index);
|
|
21123
|
-
}
|
|
21124
|
-
} else if (status) status.has = "miss";
|
|
21125
|
-
return false;
|
|
21126
|
-
}
|
|
21127
|
-
peek(k, { allowStale = this.allowStale } = {}) {
|
|
21128
|
-
const index = this.keyMap.get(k);
|
|
21129
|
-
if (index !== void 0 && (allowStale || !this.isStale(index))) {
|
|
21130
|
-
const v = this.valList[index];
|
|
21131
|
-
return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
21132
|
-
}
|
|
21133
|
-
}
|
|
21134
|
-
backgroundFetch(k, index, options, context) {
|
|
21135
|
-
const v = index === void 0 ? void 0 : this.valList[index];
|
|
21136
|
-
if (this.isBackgroundFetch(v)) return v;
|
|
21137
|
-
const ac = new AC();
|
|
21138
|
-
if (options.signal) options.signal.addEventListener("abort", () => ac.abort(options.signal.reason));
|
|
21139
|
-
const fetchOpts = {
|
|
21140
|
-
signal: ac.signal,
|
|
21141
|
-
options,
|
|
21142
|
-
context
|
|
21143
|
-
};
|
|
21144
|
-
const cb = (v$1, updateCache = false) => {
|
|
21145
|
-
const { aborted } = ac.signal;
|
|
21146
|
-
const ignoreAbort = options.ignoreFetchAbort && v$1 !== void 0;
|
|
21147
|
-
if (options.status) if (aborted && !updateCache) {
|
|
21148
|
-
options.status.fetchAborted = true;
|
|
21149
|
-
options.status.fetchError = ac.signal.reason;
|
|
21150
|
-
if (ignoreAbort) options.status.fetchAbortIgnored = true;
|
|
21151
|
-
} else options.status.fetchResolved = true;
|
|
21152
|
-
if (aborted && !ignoreAbort && !updateCache) return fetchFail(ac.signal.reason);
|
|
21153
|
-
if (this.valList[index] === p) if (v$1 === void 0) if (p.__staleWhileFetching) this.valList[index] = p.__staleWhileFetching;
|
|
21154
|
-
else this.delete(k);
|
|
21155
|
-
else {
|
|
21156
|
-
if (options.status) options.status.fetchUpdated = true;
|
|
21157
|
-
this.set(k, v$1, fetchOpts.options);
|
|
21158
|
-
}
|
|
21159
|
-
return v$1;
|
|
21160
|
-
};
|
|
21161
|
-
const eb = (er) => {
|
|
21162
|
-
if (options.status) {
|
|
21163
|
-
options.status.fetchRejected = true;
|
|
21164
|
-
options.status.fetchError = er;
|
|
21165
|
-
}
|
|
21166
|
-
return fetchFail(er);
|
|
21167
|
-
};
|
|
21168
|
-
const fetchFail = (er) => {
|
|
21169
|
-
const { aborted } = ac.signal;
|
|
21170
|
-
const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
|
|
21171
|
-
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
|
21172
|
-
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
|
21173
|
-
if (this.valList[index] === p) {
|
|
21174
|
-
if (!noDelete || p.__staleWhileFetching === void 0) this.delete(k);
|
|
21175
|
-
else if (!allowStaleAborted) this.valList[index] = p.__staleWhileFetching;
|
|
21176
|
-
}
|
|
21177
|
-
if (allowStale) {
|
|
21178
|
-
if (options.status && p.__staleWhileFetching !== void 0) options.status.returnedStale = true;
|
|
21179
|
-
return p.__staleWhileFetching;
|
|
21180
|
-
} else if (p.__returned === p) throw er;
|
|
21181
|
-
};
|
|
21182
|
-
const pcall = (res, rej) => {
|
|
21183
|
-
this.fetchMethod(k, v, fetchOpts).then((v$1) => res(v$1), rej);
|
|
21184
|
-
ac.signal.addEventListener("abort", () => {
|
|
21185
|
-
if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
|
|
21186
|
-
res();
|
|
21187
|
-
if (options.allowStaleOnFetchAbort) res = (v$1) => cb(v$1, true);
|
|
21188
|
-
}
|
|
21189
|
-
});
|
|
21190
|
-
};
|
|
21191
|
-
if (options.status) options.status.fetchDispatched = true;
|
|
21192
|
-
const p = new Promise(pcall).then(cb, eb);
|
|
21193
|
-
p.__abortController = ac;
|
|
21194
|
-
p.__staleWhileFetching = v;
|
|
21195
|
-
p.__returned = null;
|
|
21196
|
-
if (index === void 0) {
|
|
21197
|
-
this.set(k, p, {
|
|
21198
|
-
...fetchOpts.options,
|
|
21199
|
-
status: void 0
|
|
21200
|
-
});
|
|
21201
|
-
index = this.keyMap.get(k);
|
|
21202
|
-
} else this.valList[index] = p;
|
|
21203
|
-
return p;
|
|
21204
|
-
}
|
|
21205
|
-
isBackgroundFetch(p) {
|
|
21206
|
-
return p && typeof p === "object" && typeof p.then === "function" && Object.prototype.hasOwnProperty.call(p, "__staleWhileFetching") && Object.prototype.hasOwnProperty.call(p, "__returned") && (p.__returned === p || p.__returned === null);
|
|
21207
|
-
}
|
|
21208
|
-
async fetch(k, { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, fetchContext = this.fetchContext, forceRefresh = false, status, signal } = {}) {
|
|
21209
|
-
if (!this.fetchMethod) {
|
|
21210
|
-
if (status) status.fetch = "get";
|
|
21211
|
-
return this.get(k, {
|
|
21212
|
-
allowStale,
|
|
21213
|
-
updateAgeOnGet,
|
|
21214
|
-
noDeleteOnStaleGet,
|
|
21215
|
-
status
|
|
21216
|
-
});
|
|
21217
|
-
}
|
|
21218
|
-
const options = {
|
|
21219
|
-
allowStale,
|
|
21220
|
-
updateAgeOnGet,
|
|
21221
|
-
noDeleteOnStaleGet,
|
|
21222
|
-
ttl,
|
|
21223
|
-
noDisposeOnSet,
|
|
21224
|
-
size,
|
|
21225
|
-
sizeCalculation,
|
|
21226
|
-
noUpdateTTL,
|
|
21227
|
-
noDeleteOnFetchRejection,
|
|
21228
|
-
allowStaleOnFetchRejection,
|
|
21229
|
-
allowStaleOnFetchAbort,
|
|
21230
|
-
ignoreFetchAbort,
|
|
21231
|
-
status,
|
|
21232
|
-
signal
|
|
21233
|
-
};
|
|
21234
|
-
let index = this.keyMap.get(k);
|
|
21235
|
-
if (index === void 0) {
|
|
21236
|
-
if (status) status.fetch = "miss";
|
|
21237
|
-
const p = this.backgroundFetch(k, index, options, fetchContext);
|
|
21238
|
-
return p.__returned = p;
|
|
21239
|
-
} else {
|
|
21240
|
-
const v = this.valList[index];
|
|
21241
|
-
if (this.isBackgroundFetch(v)) {
|
|
21242
|
-
const stale = allowStale && v.__staleWhileFetching !== void 0;
|
|
21243
|
-
if (status) {
|
|
21244
|
-
status.fetch = "inflight";
|
|
21245
|
-
if (stale) status.returnedStale = true;
|
|
21246
|
-
}
|
|
21247
|
-
return stale ? v.__staleWhileFetching : v.__returned = v;
|
|
21248
|
-
}
|
|
21249
|
-
const isStale = this.isStale(index);
|
|
21250
|
-
if (!forceRefresh && !isStale) {
|
|
21251
|
-
if (status) status.fetch = "hit";
|
|
21252
|
-
this.moveToTail(index);
|
|
21253
|
-
if (updateAgeOnGet) this.updateItemAge(index);
|
|
21254
|
-
this.statusTTL(status, index);
|
|
21255
|
-
return v;
|
|
21256
|
-
}
|
|
21257
|
-
const p = this.backgroundFetch(k, index, options, fetchContext);
|
|
21258
|
-
const hasStale = p.__staleWhileFetching !== void 0;
|
|
21259
|
-
const staleVal = hasStale && allowStale;
|
|
21260
|
-
if (status) {
|
|
21261
|
-
status.fetch = hasStale && isStale ? "stale" : "refresh";
|
|
21262
|
-
if (staleVal && isStale) status.returnedStale = true;
|
|
21263
|
-
}
|
|
21264
|
-
return staleVal ? p.__staleWhileFetching : p.__returned = p;
|
|
21265
|
-
}
|
|
21266
|
-
}
|
|
21267
|
-
get(k, { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = {}) {
|
|
21268
|
-
const index = this.keyMap.get(k);
|
|
21269
|
-
if (index !== void 0) {
|
|
21270
|
-
const value = this.valList[index];
|
|
21271
|
-
const fetching = this.isBackgroundFetch(value);
|
|
21272
|
-
this.statusTTL(status, index);
|
|
21273
|
-
if (this.isStale(index)) {
|
|
21274
|
-
if (status) status.get = "stale";
|
|
21275
|
-
if (!fetching) {
|
|
21276
|
-
if (!noDeleteOnStaleGet) this.delete(k);
|
|
21277
|
-
if (status) status.returnedStale = allowStale;
|
|
21278
|
-
return allowStale ? value : void 0;
|
|
21279
|
-
} else {
|
|
21280
|
-
if (status) status.returnedStale = allowStale && value.__staleWhileFetching !== void 0;
|
|
21281
|
-
return allowStale ? value.__staleWhileFetching : void 0;
|
|
21282
|
-
}
|
|
21283
|
-
} else {
|
|
21284
|
-
if (status) status.get = "hit";
|
|
21285
|
-
if (fetching) return value.__staleWhileFetching;
|
|
21286
|
-
this.moveToTail(index);
|
|
21287
|
-
if (updateAgeOnGet) this.updateItemAge(index);
|
|
21288
|
-
return value;
|
|
21289
|
-
}
|
|
21290
|
-
} else if (status) status.get = "miss";
|
|
21291
|
-
}
|
|
21292
|
-
connect(p, n) {
|
|
21293
|
-
this.prev[n] = p;
|
|
21294
|
-
this.next[p] = n;
|
|
21295
|
-
}
|
|
21296
|
-
moveToTail(index) {
|
|
21297
|
-
if (index !== this.tail) {
|
|
21298
|
-
if (index === this.head) this.head = this.next[index];
|
|
21299
|
-
else this.connect(this.prev[index], this.next[index]);
|
|
21300
|
-
this.connect(this.tail, index);
|
|
21301
|
-
this.tail = index;
|
|
21302
|
-
}
|
|
21303
|
-
}
|
|
21304
|
-
get del() {
|
|
21305
|
-
deprecatedMethod("del", "delete");
|
|
21306
|
-
return this.delete;
|
|
21307
|
-
}
|
|
21308
|
-
delete(k) {
|
|
21309
|
-
let deleted = false;
|
|
21310
|
-
if (this.size !== 0) {
|
|
21311
|
-
const index = this.keyMap.get(k);
|
|
21312
|
-
if (index !== void 0) {
|
|
21313
|
-
deleted = true;
|
|
21314
|
-
if (this.size === 1) this.clear();
|
|
21315
|
-
else {
|
|
21316
|
-
this.removeItemSize(index);
|
|
21317
|
-
const v = this.valList[index];
|
|
21318
|
-
if (this.isBackgroundFetch(v)) v.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
|
|
21319
|
-
else {
|
|
21320
|
-
this.dispose(v, k, "delete");
|
|
21321
|
-
if (this.disposeAfter) this.disposed.push([
|
|
21322
|
-
v,
|
|
21323
|
-
k,
|
|
21324
|
-
"delete"
|
|
21325
|
-
]);
|
|
21326
|
-
}
|
|
21327
|
-
this.keyMap.delete(k);
|
|
21328
|
-
this.keyList[index] = null;
|
|
21329
|
-
this.valList[index] = null;
|
|
21330
|
-
if (index === this.tail) this.tail = this.prev[index];
|
|
21331
|
-
else if (index === this.head) this.head = this.next[index];
|
|
21332
|
-
else {
|
|
21333
|
-
this.next[this.prev[index]] = this.next[index];
|
|
21334
|
-
this.prev[this.next[index]] = this.prev[index];
|
|
21335
|
-
}
|
|
21336
|
-
this.size--;
|
|
21337
|
-
this.free.push(index);
|
|
21338
|
-
}
|
|
21339
|
-
}
|
|
21340
|
-
}
|
|
21341
|
-
if (this.disposed) while (this.disposed.length) this.disposeAfter(...this.disposed.shift());
|
|
21342
|
-
return deleted;
|
|
21343
|
-
}
|
|
21344
|
-
clear() {
|
|
21345
|
-
for (const index of this.rindexes({ allowStale: true })) {
|
|
21346
|
-
const v = this.valList[index];
|
|
21347
|
-
if (this.isBackgroundFetch(v)) v.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
|
|
21348
|
-
else {
|
|
21349
|
-
const k = this.keyList[index];
|
|
21350
|
-
this.dispose(v, k, "delete");
|
|
21351
|
-
if (this.disposeAfter) this.disposed.push([
|
|
21352
|
-
v,
|
|
21353
|
-
k,
|
|
21354
|
-
"delete"
|
|
21355
|
-
]);
|
|
21356
|
-
}
|
|
21357
|
-
}
|
|
21358
|
-
this.keyMap.clear();
|
|
21359
|
-
this.valList.fill(null);
|
|
21360
|
-
this.keyList.fill(null);
|
|
21361
|
-
if (this.ttls) {
|
|
21362
|
-
this.ttls.fill(0);
|
|
21363
|
-
this.starts.fill(0);
|
|
21364
|
-
}
|
|
21365
|
-
if (this.sizes) this.sizes.fill(0);
|
|
21366
|
-
this.head = 0;
|
|
21367
|
-
this.tail = 0;
|
|
21368
|
-
this.initialFill = 1;
|
|
21369
|
-
this.free.length = 0;
|
|
21370
|
-
this.calculatedSize = 0;
|
|
21371
|
-
this.size = 0;
|
|
21372
|
-
if (this.disposed) while (this.disposed.length) this.disposeAfter(...this.disposed.shift());
|
|
21373
|
-
}
|
|
21374
|
-
get reset() {
|
|
21375
|
-
deprecatedMethod("reset", "clear");
|
|
21376
|
-
return this.clear;
|
|
21377
|
-
}
|
|
21378
|
-
get length() {
|
|
21379
|
-
deprecatedProperty("length", "size");
|
|
21380
|
-
return this.size;
|
|
21381
|
-
}
|
|
21382
|
-
static get AbortController() {
|
|
21383
|
-
return AC;
|
|
21384
|
-
}
|
|
21385
|
-
static get AbortSignal() {
|
|
21386
|
-
return AS;
|
|
21387
|
-
}
|
|
21388
|
-
};
|
|
21389
|
-
module.exports = LRUCache;
|
|
21390
|
-
}) });
|
|
21391
|
-
|
|
21392
20708
|
//#endregion
|
|
21393
20709
|
//#region node_modules/named-placeholders/index.js
|
|
21394
20710
|
var require_named_placeholders = /* @__PURE__ */ __commonJS({ "node_modules/named-placeholders/index.js": ((exports, module) => {
|
|
@@ -21400,7 +20716,7 @@ var require_named_placeholders = /* @__PURE__ */ __commonJS({ "node_modules/name
|
|
|
21400
20716
|
let end;
|
|
21401
20717
|
const parts = [];
|
|
21402
20718
|
let inQuote = false;
|
|
21403
|
-
let escape = false;
|
|
20719
|
+
let escape$1 = false;
|
|
21404
20720
|
let qchr;
|
|
21405
20721
|
const tokens = [];
|
|
21406
20722
|
let qcnt = 0;
|
|
@@ -21409,11 +20725,11 @@ var require_named_placeholders = /* @__PURE__ */ __commonJS({ "node_modules/name
|
|
|
21409
20725
|
if (ppos) {
|
|
21410
20726
|
do {
|
|
21411
20727
|
for (i$4 = curpos, end = ppos.index; i$4 < end; ++i$4) {
|
|
21412
|
-
|
|
21413
|
-
if (chr === BSLASH) escape = !escape;
|
|
20728
|
+
const chr = query.charCodeAt(i$4);
|
|
20729
|
+
if (chr === BSLASH) escape$1 = !escape$1;
|
|
21414
20730
|
else {
|
|
21415
|
-
if (escape) {
|
|
21416
|
-
escape = false;
|
|
20731
|
+
if (escape$1) {
|
|
20732
|
+
escape$1 = false;
|
|
21417
20733
|
continue;
|
|
21418
20734
|
}
|
|
21419
20735
|
if (inQuote && chr === qchr) {
|
|
@@ -21422,7 +20738,7 @@ var require_named_placeholders = /* @__PURE__ */ __commonJS({ "node_modules/name
|
|
|
21422
20738
|
continue;
|
|
21423
20739
|
}
|
|
21424
20740
|
inQuote = false;
|
|
21425
|
-
} else if (chr === DQUOTE || chr === SQUOTE) {
|
|
20741
|
+
} else if (!inQuote && (chr === DQUOTE || chr === SQUOTE)) {
|
|
21426
20742
|
inQuote = true;
|
|
21427
20743
|
qchr = chr;
|
|
21428
20744
|
}
|
|
@@ -21450,30 +20766,30 @@ var require_named_placeholders = /* @__PURE__ */ __commonJS({ "node_modules/name
|
|
|
21450
20766
|
let cache;
|
|
21451
20767
|
if (typeof config.cache === "number") ncache = config.cache;
|
|
21452
20768
|
if (typeof config.cache === "object") cache = config.cache;
|
|
21453
|
-
if (config.cache !== false && !cache) cache =
|
|
20769
|
+
if (config.cache !== false && !cache) cache = require_lib$2().createLRU({ max: ncache });
|
|
21454
20770
|
function toArrayParams(tree, params) {
|
|
21455
20771
|
const arr = [];
|
|
21456
|
-
if (tree.length
|
|
21457
|
-
if (typeof params
|
|
20772
|
+
if (tree.length === 1) return [tree[0], []];
|
|
20773
|
+
if (typeof params === "undefined") throw new Error("Named query contains placeholders, but parameters object is undefined");
|
|
21458
20774
|
const tokens = tree[1];
|
|
21459
20775
|
for (let i$4 = 0; i$4 < tokens.length; ++i$4) arr.push(params[tokens[i$4]]);
|
|
21460
20776
|
return [tree[0], arr];
|
|
21461
20777
|
}
|
|
21462
20778
|
function noTailingSemicolon(s) {
|
|
21463
|
-
if (s.slice(-1)
|
|
20779
|
+
if (s.slice(-1) === ":") return s.slice(0, -1);
|
|
21464
20780
|
return s;
|
|
21465
20781
|
}
|
|
21466
20782
|
function join(tree) {
|
|
21467
|
-
if (tree.length
|
|
20783
|
+
if (tree.length === 1) return tree;
|
|
21468
20784
|
let unnamed = noTailingSemicolon(tree[0][0]);
|
|
21469
20785
|
for (let i$4 = 1; i$4 < tree[0].length; ++i$4) {
|
|
21470
|
-
if (tree[0][i$4 - 1].slice(-1)
|
|
20786
|
+
if (tree[0][i$4 - 1].slice(-1) === ":") unnamed += config.placeholder;
|
|
21471
20787
|
unnamed += config.placeholder;
|
|
21472
20788
|
unnamed += noTailingSemicolon(tree[0][i$4]);
|
|
21473
20789
|
}
|
|
21474
20790
|
const last = tree[0][tree[0].length - 1];
|
|
21475
|
-
if (tree[0].length
|
|
21476
|
-
if (last.slice(-1)
|
|
20791
|
+
if (tree[0].length === tree[1].length) {
|
|
20792
|
+
if (last.slice(-1) === ":") unnamed += config.placeholder;
|
|
21477
20793
|
unnamed += config.placeholder;
|
|
21478
20794
|
}
|
|
21479
20795
|
return [unnamed, tree[1]];
|
|
@@ -21491,7 +20807,7 @@ var require_named_placeholders = /* @__PURE__ */ __commonJS({ "node_modules/name
|
|
|
21491
20807
|
function toNumbered(q, params) {
|
|
21492
20808
|
const tree = parse(q);
|
|
21493
20809
|
const paramsArr = [];
|
|
21494
|
-
if (tree.length
|
|
20810
|
+
if (tree.length === 1) return [tree[0], paramsArr];
|
|
21495
20811
|
const pIndexes = {};
|
|
21496
20812
|
let pLastIndex = 0;
|
|
21497
20813
|
let qs = "";
|
|
@@ -21505,7 +20821,7 @@ var require_named_placeholders = /* @__PURE__ */ __commonJS({ "node_modules/name
|
|
|
21505
20821
|
}
|
|
21506
20822
|
if (tree[1][i$4]) {
|
|
21507
20823
|
varNames[varIndex - 1] = tree[1][i$4];
|
|
21508
|
-
qs += tree[0][i$4]
|
|
20824
|
+
qs += `${tree[0][i$4]}$${varIndex}`;
|
|
21509
20825
|
} else qs += tree[0][i$4];
|
|
21510
20826
|
}
|
|
21511
20827
|
return [qs, varNames.map((n) => params[n])];
|
|
@@ -21523,7 +20839,7 @@ var require_connection$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib
|
|
|
21523
20839
|
const EventEmitter$5 = __require("events").EventEmitter;
|
|
21524
20840
|
const Readable = __require("stream").Readable;
|
|
21525
20841
|
const Queue$1 = require_denque();
|
|
21526
|
-
const SqlString$2 =
|
|
20842
|
+
const SqlString$2 = require_lib$3();
|
|
21527
20843
|
const { createLRU } = require_lib$2();
|
|
21528
20844
|
const PacketParser = require_packet_parser();
|
|
21529
20845
|
const Packets = require_packets();
|
|
@@ -21739,7 +21055,7 @@ var require_connection$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib
|
|
|
21739
21055
|
});
|
|
21740
21056
|
const rejectUnauthorized = this.config.ssl.rejectUnauthorized;
|
|
21741
21057
|
const verifyIdentity = this.config.ssl.verifyIdentity;
|
|
21742
|
-
const servername = this.config.host;
|
|
21058
|
+
const servername = Net.isIP(this.config.host) ? void 0 : this.config.host;
|
|
21743
21059
|
let secureEstablished = false;
|
|
21744
21060
|
this.stream.removeAllListeners("data");
|
|
21745
21061
|
const secureSocket = Tls.connect({
|
|
@@ -21780,6 +21096,14 @@ var require_connection$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib
|
|
|
21780
21096
|
err.code = code || "PROTOCOL_ERROR";
|
|
21781
21097
|
this.emit("error", err);
|
|
21782
21098
|
}
|
|
21099
|
+
get state() {
|
|
21100
|
+
if (this._fatalError || this._protocolError) return "error";
|
|
21101
|
+
if (this._closing || this.stream && this.stream.destroyed) return "disconnected";
|
|
21102
|
+
if (this.authorized) return "authenticated";
|
|
21103
|
+
if (this._handshakePacket) return "connected";
|
|
21104
|
+
if (this.stream && !this.stream.destroyed) return "protocol_handshake";
|
|
21105
|
+
return "disconnected";
|
|
21106
|
+
}
|
|
21783
21107
|
get fatalError() {
|
|
21784
21108
|
return this._fatalError;
|
|
21785
21109
|
}
|
|
@@ -22029,16 +21353,17 @@ var require_connection$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib
|
|
|
22029
21353
|
if (!cb) return;
|
|
22030
21354
|
if (this._fatalError || this._protocolError) return cb(this._fatalError || this._protocolError);
|
|
22031
21355
|
if (this._handshakePacket) return cb(null, this);
|
|
22032
|
-
let
|
|
22033
|
-
|
|
22034
|
-
|
|
22035
|
-
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
|
|
22041
|
-
this.once("
|
|
21356
|
+
let onError, onConnect;
|
|
21357
|
+
onError = (param) => {
|
|
21358
|
+
this.removeListener("connect", onConnect);
|
|
21359
|
+
cb(param);
|
|
21360
|
+
};
|
|
21361
|
+
onConnect = (param) => {
|
|
21362
|
+
this.removeListener("error", onError);
|
|
21363
|
+
cb(null, param);
|
|
21364
|
+
};
|
|
21365
|
+
this.once("error", onError);
|
|
21366
|
+
this.once("connect", onConnect);
|
|
22042
21367
|
}
|
|
22043
21368
|
writeColumns(columns) {
|
|
22044
21369
|
this.writePacket(Packets.ResultSetHeader.toPacket(columns.length));
|
|
@@ -22081,6 +21406,9 @@ var require_connection$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib
|
|
|
22081
21406
|
this.serverConfig.encoding = CharsetToEncoding[this.serverConfig.characterSet];
|
|
22082
21407
|
return this.addCommand(new Commands.ServerHandshake(args));
|
|
22083
21408
|
}
|
|
21409
|
+
[Symbol.dispose]() {
|
|
21410
|
+
if (!this._closing) this.end();
|
|
21411
|
+
}
|
|
22084
21412
|
end(callback) {
|
|
22085
21413
|
if (this.config.isServer) {
|
|
22086
21414
|
this._closing = true;
|
|
@@ -22147,11 +21475,20 @@ var require_pool_connection$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
22147
21475
|
this.lastActiveTime = Date.now();
|
|
22148
21476
|
this._pool.releaseConnection(this);
|
|
22149
21477
|
}
|
|
22150
|
-
|
|
21478
|
+
[Symbol.dispose]() {
|
|
21479
|
+
this.release();
|
|
21480
|
+
}
|
|
21481
|
+
end(callback) {
|
|
21482
|
+
if (this.config.gracefulEnd) {
|
|
21483
|
+
this._removeFromPool();
|
|
21484
|
+
super.end(callback);
|
|
21485
|
+
return;
|
|
21486
|
+
}
|
|
22151
21487
|
const err = /* @__PURE__ */ new Error("Calling conn.end() to release a pooled connection is deprecated. In next version calling conn.end() will be restored to default conn.end() behavior. Use conn.release() instead.");
|
|
22152
21488
|
this.emit("warn", err);
|
|
22153
21489
|
console.warn(err.message);
|
|
22154
21490
|
this.release();
|
|
21491
|
+
if (typeof callback === "function") callback();
|
|
22155
21492
|
}
|
|
22156
21493
|
destroy() {
|
|
22157
21494
|
this._removeFromPool();
|
|
@@ -22286,6 +21623,9 @@ var require_connection$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib
|
|
|
22286
21623
|
this.connection.end(resolve);
|
|
22287
21624
|
});
|
|
22288
21625
|
}
|
|
21626
|
+
async [Symbol.asyncDispose]() {
|
|
21627
|
+
if (!this.connection._closing) await this.end();
|
|
21628
|
+
}
|
|
22289
21629
|
beginTransaction() {
|
|
22290
21630
|
const c = this.connection;
|
|
22291
21631
|
const localErr = /* @__PURE__ */ new Error();
|
|
@@ -22355,10 +21695,7 @@ var require_connection$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib
|
|
|
22355
21695
|
localErr.sqlState = err.sqlState;
|
|
22356
21696
|
localErr.sqlMessage = err.sqlMessage;
|
|
22357
21697
|
reject(localErr);
|
|
22358
|
-
} else
|
|
22359
|
-
const wrappedStatement = new PromisePreparedStatementInfo(statement, promiseImpl);
|
|
22360
|
-
resolve(wrappedStatement);
|
|
22361
|
-
}
|
|
21698
|
+
} else resolve(new PromisePreparedStatementInfo(statement, promiseImpl));
|
|
22362
21699
|
});
|
|
22363
21700
|
});
|
|
22364
21701
|
}
|
|
@@ -22421,6 +21758,9 @@ var require_pool_connection$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql
|
|
|
22421
21758
|
destroy() {
|
|
22422
21759
|
return BasePoolConnection$1.prototype.destroy.apply(this.connection, arguments);
|
|
22423
21760
|
}
|
|
21761
|
+
async [Symbol.asyncDispose]() {
|
|
21762
|
+
this.release();
|
|
21763
|
+
}
|
|
22424
21764
|
};
|
|
22425
21765
|
module.exports = PromisePoolConnection$3;
|
|
22426
21766
|
}) });
|
|
@@ -22441,11 +21781,16 @@ var require_pool_connection = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/
|
|
|
22441
21781
|
//#region node_modules/mysql2/lib/base/pool.js
|
|
22442
21782
|
var require_pool$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/base/pool.js": ((exports, module) => {
|
|
22443
21783
|
const process$2 = __require("process");
|
|
22444
|
-
const SqlString$1 =
|
|
21784
|
+
const SqlString$1 = require_lib$3();
|
|
22445
21785
|
const EventEmitter$3 = __require("events").EventEmitter;
|
|
22446
21786
|
const PoolConnection = require_pool_connection();
|
|
22447
21787
|
const Queue = require_denque();
|
|
22448
21788
|
const BaseConnection$1 = require_connection$2();
|
|
21789
|
+
const Errors = require_errors();
|
|
21790
|
+
function isReadOnlyError(err) {
|
|
21791
|
+
if (!err || !err.errno) return false;
|
|
21792
|
+
return err.errno === Errors.ER_OPTION_PREVENTS_STATEMENT || err.errno === Errors.ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION || err.errno === Errors.ER_READ_ONLY_MODE;
|
|
21793
|
+
}
|
|
22449
21794
|
function spliceConnection(queue, connection) {
|
|
22450
21795
|
const len = queue.length;
|
|
22451
21796
|
for (let i$4 = 0; i$4 < len; i$4++) if (queue.get(i$4) === connection) {
|
|
@@ -22503,6 +21848,9 @@ var require_pool$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/base/
|
|
|
22503
21848
|
this.emit("release", connection);
|
|
22504
21849
|
}
|
|
22505
21850
|
}
|
|
21851
|
+
[Symbol.dispose]() {
|
|
21852
|
+
if (!this._closed) this.end();
|
|
21853
|
+
}
|
|
22506
21854
|
end(cb) {
|
|
22507
21855
|
this._closed = true;
|
|
22508
21856
|
clearTimeout(this._removeIdleTimeoutConnectionsTimer);
|
|
@@ -22539,8 +21887,18 @@ var require_pool$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/base/
|
|
|
22539
21887
|
return;
|
|
22540
21888
|
}
|
|
22541
21889
|
try {
|
|
21890
|
+
let queryError = null;
|
|
21891
|
+
const origOnResult = cmdQuery.onResult;
|
|
21892
|
+
if (origOnResult) cmdQuery.onResult = function(err$1, rows, fields$1) {
|
|
21893
|
+
queryError = err$1 || null;
|
|
21894
|
+
origOnResult(err$1, rows, fields$1);
|
|
21895
|
+
};
|
|
21896
|
+
else cmdQuery.once("error", (err$1) => {
|
|
21897
|
+
queryError = err$1;
|
|
21898
|
+
});
|
|
22542
21899
|
conn.query(cmdQuery).once("end", () => {
|
|
22543
|
-
conn.
|
|
21900
|
+
if (isReadOnlyError(queryError)) conn.destroy();
|
|
21901
|
+
else conn.release();
|
|
22544
21902
|
});
|
|
22545
21903
|
} catch (e) {
|
|
22546
21904
|
conn.release();
|
|
@@ -22557,7 +21915,10 @@ var require_pool$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/base/
|
|
|
22557
21915
|
this.getConnection((err, conn) => {
|
|
22558
21916
|
if (err) return cb(err);
|
|
22559
21917
|
try {
|
|
22560
|
-
conn.execute(sql, values,
|
|
21918
|
+
conn.execute(sql, values, (err$1, rows, fields$1) => {
|
|
21919
|
+
if (isReadOnlyError(err$1)) conn.destroy();
|
|
21920
|
+
cb(err$1, rows, fields$1);
|
|
21921
|
+
}).once("end", () => {
|
|
22561
21922
|
conn.release();
|
|
22562
21923
|
});
|
|
22563
21924
|
} catch (e) {
|
|
@@ -22575,7 +21936,8 @@ var require_pool$2 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/base/
|
|
|
22575
21936
|
if (this._removeIdleTimeoutConnectionsTimer) clearTimeout(this._removeIdleTimeoutConnectionsTimer);
|
|
22576
21937
|
this._removeIdleTimeoutConnectionsTimer = setTimeout(() => {
|
|
22577
21938
|
try {
|
|
22578
|
-
while (this._freeConnections.length > this.config.maxIdle || this._freeConnections.length > 0 && Date.now() - this._freeConnections.get(0).lastActiveTime > this.config.idleTimeout) this._freeConnections.get(0).
|
|
21939
|
+
while (this._freeConnections.length > this.config.maxIdle || this._freeConnections.length > 0 && Date.now() - this._freeConnections.get(0).lastActiveTime > this.config.idleTimeout) if (this.config.connectionConfig.gracefulEnd) this._freeConnections.get(0).end();
|
|
21940
|
+
else this._freeConnections.get(0).destroy();
|
|
22579
21941
|
} finally {
|
|
22580
21942
|
this._removeIdleTimeoutConnections();
|
|
22581
21943
|
}
|
|
@@ -22662,6 +22024,9 @@ var require_pool$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib/promi
|
|
|
22662
22024
|
});
|
|
22663
22025
|
});
|
|
22664
22026
|
}
|
|
22027
|
+
async [Symbol.asyncDispose]() {
|
|
22028
|
+
if (!this.pool._closed) await this.end();
|
|
22029
|
+
}
|
|
22665
22030
|
};
|
|
22666
22031
|
(function(functionsToWrap) {
|
|
22667
22032
|
for (let i$4 = 0; functionsToWrap && i$4 < functionsToWrap.length; i$4++) {
|
|
@@ -22903,6 +22268,9 @@ var require_pool_cluster$1 = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/l
|
|
|
22903
22268
|
}
|
|
22904
22269
|
namespace.getConnection(cb);
|
|
22905
22270
|
}
|
|
22271
|
+
[Symbol.dispose]() {
|
|
22272
|
+
if (!this._closed) this.end();
|
|
22273
|
+
}
|
|
22906
22274
|
end(callback) {
|
|
22907
22275
|
const cb = callback !== void 0 ? callback : (err) => {
|
|
22908
22276
|
if (err) throw err;
|
|
@@ -23069,7 +22437,7 @@ var require_pool_cluster = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/lib
|
|
|
23069
22437
|
//#endregion
|
|
23070
22438
|
//#region node_modules/mysql2/promise.js
|
|
23071
22439
|
var require_promise = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/promise.js": ((exports) => {
|
|
23072
|
-
const SqlString =
|
|
22440
|
+
const SqlString = require_lib$3();
|
|
23073
22441
|
const EventEmitter = __require("events").EventEmitter;
|
|
23074
22442
|
const parserCache = require_parser_cache();
|
|
23075
22443
|
const PoolCluster = require_pool_cluster$1();
|
|
@@ -23164,6 +22532,9 @@ var require_promise = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/promise.
|
|
|
23164
22532
|
});
|
|
23165
22533
|
});
|
|
23166
22534
|
}
|
|
22535
|
+
async [Symbol.asyncDispose]() {
|
|
22536
|
+
if (!this.poolCluster._closed) await this.end();
|
|
22537
|
+
}
|
|
23167
22538
|
};
|
|
23168
22539
|
/**
|
|
23169
22540
|
* proxy poolCluster synchronous functions
|
|
@@ -23209,4 +22580,4 @@ var require_promise = /* @__PURE__ */ __commonJS({ "node_modules/mysql2/promise.
|
|
|
23209
22580
|
export default require_promise();
|
|
23210
22581
|
|
|
23211
22582
|
export { };
|
|
23212
|
-
//# sourceMappingURL=promise-
|
|
22583
|
+
//# sourceMappingURL=promise-BAWXE7C8.mjs.map
|