diff --git a/bc.js b/bc.js index 3878fa9..5474738 100644 --- a/bc.js +++ b/bc.js @@ -1,10 +1,17 @@ -// server.js +// bc.js (или server.js - ваш основной файл сервера) +// КОД ОСТАЕТСЯ БЕЗ ИЗМЕНЕНИЙ ОТНОСИТЕЛЬНО ПРЕДЫДУЩЕЙ ВЕРСИИ, +// ГДЕ УЖЕ БЫЛА ДОБАВЛЕНА ПЕРЕДАЧА characterKey В GameManager + const express = require('express'); const http = require('http'); const socketIo = require('socket.io'); const path = require('path'); -const GameManager = require('./server_modules/gameManager'); -const hostname = '81.177.140.16'; + +// Серверные модули +const GameManager = require('./server_modules/gameManager'); // GameManager будет изменен +const authController = require('./server_modules/auth'); + +const hostname = 'localhost'; const app = express(); const server = http.createServer(app); const io = socketIo(server); @@ -13,10 +20,10 @@ const PORT = process.env.PORT || 3200; app.use(express.static(path.join(__dirname, 'public'))); -const gameManager = new GameManager(io); +const gameManager = new GameManager(io); // GameManager будет содержать новую логику io.on('connection', (socket) => { - console.log('New client connected:', socket.id); + console.log('[Server] New client connected:', socket.id); const availableGames = gameManager.getAvailablePvPGamesListForClient(); socket.emit('availablePvPGamesList', availableGames); @@ -26,44 +33,105 @@ io.on('connection', (socket) => { socket.emit('availablePvPGamesList', currentAvailableGames); }); - socket.on('createGame', (data) => { // data = { mode: 'ai' | 'pvp' } - gameManager.createGame(socket, data.mode); + socket.on('register', async (data) => { + console.log(`[Server BC.JS] Received 'register' event from ${socket.id} with username: ${data?.username}`); + if (!data || typeof data.username !== 'string' || typeof data.password !== 'string') { + socket.emit('registerResponse', { success: false, message: 'Некорректные данные запроса.' }); + return; + } + const result = await authController.registerUser(data.username, data.password); + socket.emit('registerResponse', result); }); - socket.on('joinGame', (data) => { // Ожидаем data = { gameId: 'СТРОКА' } + socket.on('login', async (data) => { + console.log(`[Server BC.JS] Received 'login' event from ${socket.id} with username: ${data?.username}`); + if (!data || typeof data.username !== 'string' || typeof data.password !== 'string') { + socket.emit('loginResponse', { success: false, message: 'Некорректные данные запроса.' }); + return; + } + const result = await authController.loginUser(data.username, data.password); + if (result.success) { + socket.userData = { userId: result.userId, username: result.username }; // Сохраняем userId + console.log(`[Server BC.JS] User ${result.username} (ID: ${result.userId}) associated with socket ${socket.id}. Welcome!`); + } + socket.emit('loginResponse', result); + }); + + socket.on('logout', () => { + const username = socket.userData?.username || socket.id; + console.log(`[Server BC.JS] Received 'logout' event from ${username}.`); + if (socket.userData) { + gameManager.handleDisconnect(socket.id); // Обработает выход из игр + delete socket.userData; + console.log(`[Server BC.JS] User data cleared for ${username}.`); + } + }); + + socket.on('createGame', (data) => { + if (!socket.userData) { + socket.emit('gameError', { message: "Ошибка: Вы не авторизованы для создания игры." }); + return; + } + const mode = data?.mode || 'ai'; + const characterKey = (data?.characterKey === 'almagest') ? 'almagest' : 'elena'; + console.log(`[Server BC.JS] User ${socket.userData.username} (socket: ${socket.id}) requests createGame. Mode: ${mode}, Character: ${characterKey}`); + // Передаем socket.userData.userId в GameManager, если он нужен для идентификации пользователя между сессиями + gameManager.createGame(socket, mode, characterKey, socket.userData.userId); + }); + + socket.on('joinGame', (data) => { + if (!socket.userData) { + socket.emit('gameError', { message: "Ошибка: Вы не авторизованы для присоединения к игре." }); + return; + } + console.log(`[Server BC.JS] User ${socket.userData.username} (socket: ${socket.id}) requests joinGame for ID: ${data?.gameId}`); if (data && typeof data.gameId === 'string') { - gameManager.joinGame(socket, data.gameId); + // Передаем socket.userData.userId + gameManager.joinGame(socket, data.gameId, socket.userData.userId); } else { - console.warn(`[bc.js] Неверный формат данных для joinGame от ${socket.id}:`, data); socket.emit('gameError', { message: 'Ошибка присоединения: неверный формат ID игры.' }); } }); - socket.on('findRandomGame', () => { - gameManager.findAndJoinRandomPvPGame(socket); + socket.on('findRandomGame', (data) => { + if (!socket.userData) { + socket.emit('gameError', { message: "Ошибка: Вы не авторизованы для поиска игры." }); + return; + } + const characterKey = (data?.characterKey === 'almagest') ? 'almagest' : 'elena'; + console.log(`[Server BC.JS] User ${socket.userData.username} (socket: ${socket.id}) requests findRandomGame. Preferred Character: ${characterKey}`); + // Передаем socket.userData.userId + gameManager.findAndJoinRandomPvPGame(socket, characterKey, socket.userData.userId); }); - // ИЗМЕНЕНО: Убрана проверка на data.gameId для playerAction - socket.on('playerAction', (data) => { - // gameManager.handlePlayerAction определит игру по socket.id - // и передаст data в GameInstance. + socket.on('playerAction', (data) => { + if (!socket.userData) return; gameManager.handlePlayerAction(socket.id, data); }); - socket.on('requestRestart', (data) => { // Ожидаем data = { gameId: 'СТРОКА' } + socket.on('requestRestart', (data) => { + if (!socket.userData) { + socket.emit('gameError', { message: "Ошибка: Вы не авторизованы для запроса рестарта." }); + return; + } + console.log(`[Server BC.JS] User ${socket.userData.username} (socket: ${socket.id}) requests restart for game ID: ${data?.gameId}`); if (data && typeof data.gameId === 'string') { gameManager.requestRestart(socket.id, data.gameId); } else { - console.warn(`[bc.js] Неверный формат данных для requestRestart от ${socket.id}:`, data); socket.emit('gameError', { message: 'Ошибка рестарта: неверный формат ID игры.' }); } }); - - socket.on('disconnect', () => { - console.log('Client disconnected:', socket.id); - gameManager.handleDisconnect(socket.id); + socket.on('disconnect', (reason) => { + const username = socket.userData?.username || socket.id; + console.log(`[Server] Client ${username} disconnected. Reason: ${reason}. Socket ID: ${socket.id}`); + // Передаем userId, если он есть, для более точной обработки в GameManager + const userId = socket.userData?.userId; + gameManager.handleDisconnect(socket.id, userId); + // socket.userData автоматически очистится для этого объекта socket }); }); -server.listen(PORT, hostname, () => console.log(`Server listening on ${hostname}:${PORT}`)); \ No newline at end of file +server.listen(PORT, hostname, () => { + console.log(`Server listening on http://${hostname}:${PORT}`); +}); \ No newline at end of file diff --git a/node_modules/.bin/bcrypt b/node_modules/.bin/bcrypt new file mode 120000 index 0000000..c4fe298 --- /dev/null +++ b/node_modules/.bin/bcrypt @@ -0,0 +1 @@ +../bcryptjs/bin/bcrypt \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index cc4a543..4565139 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -40,6 +40,15 @@ "node": ">= 0.6" } }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", @@ -49,6 +58,15 @@ "node": "^4.5.0 || >= 5.9" } }, + "node_modules/bcryptjs": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-3.0.2.tgz", + "integrity": "sha512-k38b3XOZKv60C4E2hVsXTolJWfkGRMbILBIe2IBITXciy5bOsTKot5kDrf3ZfufQtQOUN5mXceUEpU1rTl9Uog==", + "license": "BSD-3-Clause", + "bin": { + "bcrypt": "bin/bcrypt" + } + }, "node_modules/body-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", @@ -176,6 +194,15 @@ } } }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -434,6 +461,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -556,6 +592,42 @@ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", "license": "MIT" }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/lru.min": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.2.tgz", + "integrity": "sha512-Nv9KddBcQSlQopmBHXSsZVY5xsdlZkdH/Iey0BlcBYggMd4two7cZnKOK9vmy3nY0O5RGH99z1PCeTpPqszUYg==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -613,6 +685,38 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, + "node_modules/mysql2": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.14.1.tgz", + "integrity": "sha512-7ytuPQJjQB8TNAYX/H2yhL+iQOnIBjAMam361R7UAL0lOVXWjtdrmoL9HYKqKoLp/8UUTRcvo1QPvK9KL7wA8w==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "license": "MIT", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/negotiator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", @@ -798,6 +902,11 @@ "node": ">= 18" } }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, "node_modules/serve-static": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", @@ -1026,6 +1135,15 @@ "node": ">= 0.6" } }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", diff --git a/node_modules/aws-ssl-profiles/LICENSE b/node_modules/aws-ssl-profiles/LICENSE new file mode 100644 index 0000000..95dc096 --- /dev/null +++ b/node_modules/aws-ssl-profiles/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024 Andrey Sidorov, Douglas Wilson, Weslley Araújo and contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/aws-ssl-profiles/README.md b/node_modules/aws-ssl-profiles/README.md new file mode 100644 index 0000000..99acaad --- /dev/null +++ b/node_modules/aws-ssl-profiles/README.md @@ -0,0 +1,146 @@ +# AWS SSL Profiles + +[**AWS RDS**](https://aws.amazon.com/rds/) **SSL** Certificates Bundles. + +**Table of Contents** + +- [Installation](#installation) +- [Usage](#usage) + - [**mysqljs/mysql**](#mysqljsmysql) + - [**MySQL2**](#mysql2) + - [**node-postgres**](#node-postgres) + - [Custom `ssl` options](#custom-ssl-options) +- [License](#license) +- [Security](#security) +- [Contributing](#contributing) +- [Acknowledgements](#acknowledgements) + +--- + +## Installation + +```bash +npm install --save aws-ssl-profiles +``` + +--- + +## Usage + +### [mysqljs/mysql](https://github.com/mysqljs/mysql) + +```js +const mysql = require('mysql'); +const awsCaBundle = require('aws-ssl-profiles'); + +// mysql connection +const connection = mysql.createConnection({ + //... + ssl: awsCaBundle, +}); + +// mysql connection pool +const pool = mysql.createPool({ + //... + ssl: awsCaBundle, +}); +``` + +### [MySQL2](https://github.com/sidorares/node-mysql2) + +```js +const mysql = require('mysql2'); +const awsCaBundle = require('aws-ssl-profiles'); + +// mysql2 connection +const connection = mysql.createConnection({ + //... + ssl: awsCaBundle, +}); + +// mysql2 connection pool +const pool = mysql.createPool({ + //... + ssl: awsCaBundle, +}); +``` + +### [node-postgres](https://github.com/brianc/node-postgres) + +```js +const pg = require('pg'); +const awsCaBundle = require('aws-ssl-profiles'); + +// pg connection +const client = new pg.Client({ + // ... + ssl: awsCaBundle, +}); + +// pg connection pool +const pool = new pg.Pool({ + // ... + ssl: awsCaBundle, +}); +``` + +### Custom `ssl` options + +Using **AWS SSL Profiles** with custom `ssl` options: + +```js +{ + // ... + ssl: { + ...awsCaBundle, + rejectUnauthorized: true, + // ... + } +} +``` + +```js +{ + // ... + ssl: { + ca: awsCaBundle.ca, + rejectUnauthorized: true, + // ... + } +} +``` + +### Custom bundles + +```js +const { proxyBundle } = require('aws-ssl-profiles'); + +{ + // ... + ssl: proxyBundle, +} +``` + +--- + +## License + +**AWS SSL Profiles** is under the [**MIT License**](./LICENSE). + +--- + +## Security + +Please check the [**SECURITY.md**](./SECURITY.md). + +--- + +## Contributing + +Please check the [**CONTRIBUTING.md**](./CONTRIBUTING.md) for instructions. + +--- + +## Acknowledgements + +[**Contributors**](https://github.com/mysqljs/aws-ssl-profiles/graphs/contributors). diff --git a/node_modules/aws-ssl-profiles/lib/@types/profiles.d.ts b/node_modules/aws-ssl-profiles/lib/@types/profiles.d.ts new file mode 100644 index 0000000..a02c121 --- /dev/null +++ b/node_modules/aws-ssl-profiles/lib/@types/profiles.d.ts @@ -0,0 +1,4 @@ +export type CA = string[]; +export type Profiles = { + ca: CA; +}; diff --git a/node_modules/aws-ssl-profiles/lib/@types/profiles.js b/node_modules/aws-ssl-profiles/lib/@types/profiles.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/node_modules/aws-ssl-profiles/lib/@types/profiles.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/aws-ssl-profiles/lib/index.d.ts b/node_modules/aws-ssl-profiles/lib/index.d.ts new file mode 100644 index 0000000..18d181b --- /dev/null +++ b/node_modules/aws-ssl-profiles/lib/index.d.ts @@ -0,0 +1,8 @@ +import type { Profiles } from "./@types/profiles.js"; +export declare const proxyBundle: Profiles; +declare const profiles: Profiles; +declare module "aws-ssl-profiles" { + const profiles: Profiles & { proxyBundle: Profiles }; + export = profiles; +} +export default profiles; diff --git a/node_modules/aws-ssl-profiles/lib/index.js b/node_modules/aws-ssl-profiles/lib/index.js new file mode 100644 index 0000000..d702ca7 --- /dev/null +++ b/node_modules/aws-ssl-profiles/lib/index.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const defaults_js_1 = require("./profiles/ca/defaults.js"); +const proxies_js_1 = require("./profiles/ca/proxies.js"); +const proxyBundle = { + ca: proxies_js_1.proxies, +}; +const profiles = { + ca: [...defaults_js_1.defaults, ...proxies_js_1.proxies], +}; +module.exports = profiles; +module.exports.proxyBundle = proxyBundle; +module.exports.default = profiles; diff --git a/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.d.ts b/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.d.ts new file mode 100644 index 0000000..347c7b5 --- /dev/null +++ b/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.d.ts @@ -0,0 +1,9 @@ +import type { CA } from '../../@types/profiles.js'; +/** + * CA Certificates for **Amazon RDS** (2024) + * + * - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + * - https://docs.amazonaws.cn/en_us/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + * - https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.tls + */ +export declare const defaults: CA; diff --git a/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js b/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js new file mode 100644 index 0000000..343c8a0 --- /dev/null +++ b/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js @@ -0,0 +1,2888 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaults = void 0; +/** + * CA Certificates for **Amazon RDS** (2024) + * + * - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html + * - https://docs.amazonaws.cn/en_us/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html + * - https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.tls + */ +exports.defaults = [ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEEjCCAvqgAwIBAgIJAM2ZN/+nPi27MA0GCSqGSIb3DQEBCwUAMIGVMQswCQYD\n' + + 'VQQGEwJ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+ 'iqYwDQYJKoZIhvcNAQELBQADggEBAIIMTSPx/dR7jlcxggr+O6OyY49Rlap2laKA\n' + + 'eC/XI4ySP3vQkIFlP822U9Kh8a9s46eR0uiwV4AGLabcu0iKYfXjPkIprVCqeXV7\n' + + 'ny9oDtrbflyj7NcGdZLvuzSwgl9SYTJp7PVCZtZutsPYlbJrBPHwFABvAkMvRtDB\n' + + 'hitIg4AESDGPoCl94sYHpfDfjpUDMSrAMDUyO6DyBdZH5ryRMAs3lGtsmkkNUrso\n' + + 'aTW6R05681Z0mvkRdb+cdXtKOSuDZPoe2wJJIaz3IlNQNSrB5TImMYgmt6iAsFhv\n' + + '3vfTSTKrZDNTJn4ybG6pq1zWExoXsktZPylJly6R3RBwV6nwqBM=\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBjCCAu6gAwIBAgIJAMc0ZzaSUK51MA0GCSqGSIb3DQEBCwUAMIGPMQswCQYD\n' + + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n' + + 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h\n' + + 'em9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkw\n' + + 'ODIyMTcwODUwWhcNMjQwODIyMTcwODUwWjCBjzELMAkGA1UEBhMCVVMxEDAOBgNV\n' + + 'BAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xIjAgBgNVBAoMGUFtYXpv\n' + + 'biBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxIDAeBgNV\n' + + 'BAMMF0FtYXpvbiBSRFMgUm9vdCAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEFAAOC\n' + + 'AQ8AMIIBCgKCAQEArXnF/E6/Qh+ku3hQTSKPMhQQlCpoWvnIthzX6MK3p5a0eXKZ\n' + + 'oWIjYcNNG6UwJjp4fUXl6glp53Jobn+tWNX88dNH2n8DVbppSwScVE2LpuL+94vY\n' + + '0EYE/XxN7svKea8YvlrqkUBKyxLxTjh+U/KrGOaHxz9v0l6ZNlDbuaZw3qIWdD/I\n' + + '6aNbGeRUVtpM6P+bWIoxVl/caQylQS6CEYUk+CpVyJSkopwJlzXT07tMoDL5WgX9\n' + + 'O08KVgDNz9qP/IGtAcRduRcNioH3E9v981QO1zt/Gpb2f8NqAjUUCUZzOnij6mx9\n' + + 'McZ+9cWX88CRzR0vQODWuZscgI08NvM69Fn2SQIDAQABo2MwYTAOBgNVHQ8BAf8E\n' + + 'BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUc19g2LzLA5j0Kxc0LjZa\n' + + 'pmD/vB8wHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJKoZIhvcN\n' + + 'AQELBQADggEBAHAG7WTmyjzPRIM85rVj+fWHsLIvqpw6DObIjMWokpliCeMINZFV\n' + + 'ynfgBKsf1ExwbvJNzYFXW6dihnguDG9VMPpi2up/ctQTN8tm9nDKOy08uNZoofMc\n' + + 'NUZxKCEkVKZv+IL4oHoeayt8egtv3ujJM6V14AstMQ6SwvwvA93EP/Ug2e4WAXHu\n' + + 'cbI1NAbUgVDqp+DRdfvZkgYKryjTWd/0+1fS8X1bBZVWzl7eirNVnHbSH2ZDpNuY\n' + + '0SBd8dj5F6ld3t58ydZbrTHze7JJOd8ijySAp4/kiu9UfZWuTPABzDa/DSdz9Dk/\n' + + 'zPW4CXXvhLmE02TA9/HeCw3KEHIwicNuEfw=\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEEDCCAvigAwIBAgIJAKFMXyltvuRdMA0GCSqGSIb3DQEBCwUAMIGUMQswCQYD\n' + + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA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zUFjC6m7/VmTQC8nidVY559D6l0UhhU0Co/txgq3HVsMOH\n' + + 'PbxmQUwJEKAzQXoIi+4uZzHFZrvov/nDTNJUhC6DqwIDAQABo2YwZDAOBgNVHQ8B\n' + + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUwaZpaCme+EiV\n' + + 'M5gcjeHZSTgOn4owHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n' + + 'KoZIhvcNAQELBQADggEBAAR6a2meCZuXO2TF9bGqKGtZmaah4pH2ETcEVUjkvXVz\n' + + 'sl+ZKbYjrun+VkcMGGKLUjS812e7eDF726ptoku9/PZZIxlJB0isC/0OyixI8N4M\n' + + 'NsEyvp52XN9QundTjkl362bomPnHAApeU0mRbMDRR2JdT70u6yAzGLGsUwMkoNnw\n' + + '1VR4XKhXHYGWo7KMvFrZ1KcjWhubxLHxZWXRulPVtGmyWg/MvE6KF+2XMLhojhUL\n' + + '+9jB3Fpn53s6KMx5tVq1x8PukHmowcZuAF8k+W4gk8Y68wIwynrdZrKRyRv6CVtR\n' + + 'FZ8DeJgoNZT3y/GT254VqMxxfuy2Ccb/RInd16tEvVk=\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEDDCCAvSgAwIBAgICOYIwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n' + + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n' + + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n' + + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTcyMDA1\n' + + 'MjlaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n' + + 'a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h3VO+1HpCjT7uNBFtmF3AgMBAAGj\n' + + 'ZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQW\n' + + 'BBQtinkdrj+0B2+qdXngV2tgHnPIujAfBgNVHSMEGDAWgBRp0xqULkNh/w2ZVzEI\n' + + 'o2RIY7O03TANBgkqhkiG9w0BAQsFAAOCAQEAtJdqbCxDeMc8VN1/RzCabw9BIL/z\n' + + '73Auh8eFTww/sup26yn8NWUkfbckeDYr1BrXa+rPyLfHpg06kwR8rBKyrs5mHwJx\n' + + 'bvOzXD/5WTdgreB+2Fb7mXNvWhenYuji1MF+q1R2DXV3I05zWHteKX6Dajmx+Uuq\n' + + 'Yq78oaCBSV48hMxWlp8fm40ANCL1+gzQ122xweMFN09FmNYFhwuW+Ao+Vv90ZfQG\n' + + 'PYwTvN4n/gegw2TYcifGZC2PNX74q3DH03DXe5fvNgRW5plgz/7f+9mS+YHd5qa9\n' + + 'tYTPUvoRbi169ou6jicsMKUKPORHWhiTpSCWR1FMMIbsAcsyrvtIsuaGCQ==\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/jCCAuagAwIBAgIQdOCSuA9psBpQd8EI368/0DANBgkqhkiG9w0BAQsFADCB\n' + + 'lzELMAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIElu\n' + + 'Yy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxCzAJBgNVBAgMAldBMTAwLgYDVQQDDCdB\n' + + 'bWF6b24gUkRTIHNhLWVhc3QtMSBSb290IENBIFJTQTIwNDggRzExEDAOBgNVBAcM\n' + + 'B1NlYXR0bGUwIBcNMjEwNTE5MTgwNjI2WhgPMjA2MTA1MTkxOTA2MjZaMIGXMQsw\n' + + 'CQYDVQQGEwJVUzEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjET\n' + + 'MBEGA1U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o6ldLIpoMbbrb5\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBDCCAuygAwIBAgIQUfVbqapkLYpUqcLajpTJWzANBgkqhkiG9w0BAQsFADCB\n' + + 'mjELMAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIElu\n' + + 'Yy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxCzAJBgNVBAgMAldBMTMwMQYDVQQDDCpB\n' + + 'bWF6b24gUkRTIG1lLWNlbnRyYWwtMSBSb290IENBIFJTQTIwNDggRzExEDAOBgNV\n' + + 'BAcMB1NlYXR0bGUwIBcNMjIwNTA2MjMyMDA5WhgPMjA2MjA1MDcwMDIwMDlaMIGa\n' + + 'MQswCQYDVQQGEwJVUzEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5j\n' + + 'LjETMBEGA1UECwwKQW1hem9uIFJEUzELMAkGA1UECAwCV0ExMzAxBgNVBAMMKkFt\n' + + 'YXpvbiBSRFMgbWUtY2VudHJhbC0xIFJvb3QgQ0EgUlNBMjA0OCBHMTEQMA4GA1UE\n' + + 'BwwHU2VhdHRsZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJIeovu3\n' + + 'ewI9FVitXMQzvkh34aQ6WyI4NO3YepfJaePiv3cnyFGYHN2S1cR3UQcLWgypP5va\n' + + 'j6bfroqwGbCbZZcb+6cyOB4ceKO9Ws1UkcaGHnNDcy5gXR7aCW2OGTUfinUuhd2d\n' + + '5bOGgV7JsPbpw0bwJ156+MwfOK40OLCWVbzy8B1kITs4RUPNa/ZJnvIbiMu9rdj4\n' + + '8y7GSFJLnKCjlOFUkNI5LcaYvI1+ybuNgphT3nuu5ZirvTswGakGUT/Q0J3dxP0J\n' + + 'pDfg5Sj/2G4gXiaM0LppVOoU5yEwVewhQ250l0eQAqSrwPqAkdTg9ng360zqCFPE\n' + + 'JPPcgI1tdGUgneEC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AoIBAQDtdHut0ZhJ9Nn2\n' + + 'MpVafFcwHdoEzx06okmmhjJsNy4l9QYVeh0UUoek0SufRNMRF4d5ibzpgZol0Y92\n' + + '/qKWNe0jNxhEj6sXyHsHPeYtNBPuDMzThfbvsLK8z7pBP7vVyGPGuppqW/6m4ZBB\n' + + 'lcc9fsf7xpZ689iSgoyjiT6J5wlVgmCx8hFYc/uvcRtfd8jAHvheug7QJ3zZmIye\n' + + 'V4htOW+fRVWnBjf40Q+7uTv790UAqs0Zboj4Yil+hER0ibG62y1g71XcCyvcVpto\n' + + '2/XW7Y9NCgMNqQ7fGN3wR1gjtSYPd7DO32LTzYhutyvfbpAZjsAHnoObmoljcgXI\n' + + 'QjfBcCFpAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJI3aWLg\n' + + 'CS5xqU5WYVaeT5s8lpO0MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOC\n' + + 'AQEAUwATpJOcGVOs3hZAgJwznWOoTzOVJKfrqBum7lvkVH1vBwxBl9CahaKj3ZOt\n' + + 'YYp2qJzhDUWludL164DL4ZjS6eRedLRviyy5cRy0581l1MxPWTThs27z+lCC14RL\n' + + 'PJZNVYYdl7Jy9Q5NsQ0RBINUKYlRY6OqGDySWyuMPgno2GPbE8aynMdKP+f6G/uE\n' + + 'YHOf08gFDqTsbyfa70ztgVEJaRooVf5JJq4UQtpDvVswW2reT96qi6tXPKHN5qp3\n' + + '3wI0I1Mp4ePmiBKku2dwYzPfrJK/pQlvu0Gu5lKOQ65QdotwLAAoaFqrf9za1yYs\n' + + 'INUkHLWIxDds+4OHNYcerGp5Dw==\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIGCTCCA/GgAwIBAgIRAIO6ldra1KZvNWJ0TA1ihXEwDQYJKoZIhvcNAQEMBQAw\n' + + 'gZwxCzAJBgNVBAYTAlVTMSIwIAYDVQQKDBlBbWF6b24g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9/1C6J2vhY+V0LGaJmnnIuOANrslx2+bgMlyhf9j0Bv8AwSi\n' + + 'dSWsobOhNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBQb7vJT\n' + + 'VciLN72yJGhaRKLn6Krn2TAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQAD\n' + + 'ggEBAAxEj8N9GslReAQnNOBpGl8SLgCMTejQ6AW/bapQvzxrZrfVOZOYwp/5oV0f\n' + + '9S1jcGysDM+DrmfUJNzWxq2Y586R94WtpH4UpJDGqZp+FuOVJL313te4609kopzO\n' + + 'lDdmd+8z61+0Au93wB1rMiEfnIMkOEyt7D2eTFJfJRKNmnPrd8RjimRDlFgcLWJA\n' + + '3E8wca67Lz/G0eAeLhRHIXv429y8RRXDtKNNz0wA2RwURWIxyPjn1fHjA9SPDkeW\n' + + 'E1Bq7gZj+tBnrqz+ra3yjZ2blss6Ds3/uRY6NYqseFTZWmQWT7FolZEnT9vMUitW\n' + + 'I0VynUbShVpGf6946e0vgaaKw20=\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIID/jCCAuagAwIBAgIQGyUVTaVjYJvWhroVEiHPpDANBgkqhkiG9w0BAQsFADCB\n' + + 'lzELMAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIElu\n' + + 'Yy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxCzAJBgNVBAgMAldBMTAwLgYDVQQDDCdB\n' + + 'bWF6b24gUkRTIHVzLXdlc3QtMSBSb290IENBIFJTQTIwNDggRzExEDAOBgNVBAcM\n' + + 'B1NlYXR0bGUwIBcNMjEwNTE5MTkwNDA2WhgPMjA2MTA1MTkyMDA0MDZaMIGXMQsw\n' + + 'CQYDVQQGEwJVUzEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjET\n' + + 'MBEGA1UECwwKQW1hem9uIFJEU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D6t/TL1nzxhRPzbcSDIHUd/b5R+a0bAA+7\n' + + 'YTU6JqzEVCWKEIEynYmqikgLMGB/OzWsgyEL6822QW6hJAQ78XpbNeCzrICF4+GC\n' + + '7KShLnwuWoWpAb26268lvOEvCTFM47VC6jNQl97md+2SA9Ma81C9wflid2M83Wle\n' + + 'cuLMVcQZceE=\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEADCCAuigAwIBAgIQAhAteLRCvizAElaWORFU2zANBgkqhkiG9w0BAQsFADCB\n' + + 'mDELMAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIElu\n' + + 'Yy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxCzAJBgNVBAgMAldBMTEwLwYDVQQDDChB\n' + + 'bWF6b24gUkRTIG1lLXNvdXRoLTEgUm9vdCBDQSBSU0EyMDQ4IEcxMRAwDgYDVQQH\n' + + 'DAdTZWF0dGxlMCAXDTIxMDUyMDE3MDkxNloYDzIwNjEwNTIwMTgwOTE2WjCBmDEL\n' + + 'MAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4x\n' + + 'EzARBgNVBAsMCkFtYXpvbiBSRFMxCzAJBgNVBAgMAldBMTEwLwYDVQQDDChBbWF6\n' + + 'b24gUkRTIG1lLXNvdXRoLTEgUm9vdCBDQSBSU0EyMDQ4IEcxMRAwDgYDVQQHDAdT\n' + + 'ZWF0dGxlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+qg7JAcOVKjh\n' + + 'N83SACnBFZPyB63EusfDr/0V9ZdL8lKcmZX9sv/CqoBo3N0EvBqHQqUUX6JvFb7F\n' + + 'XrMUZ740kr28gSRALfXTFgNODjXeDsCtEkKRTkac/UM8xXHn+hR7UFRPHS3e0GzI\n' + + 'iLiwQWDkr0Op74W8aM0CfaVKvh2bp4BI1jJbdDnQ9OKXp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BKacJLYtBYETw8mfsNt8gb72aIQX6cZOsphqp6hUtKaiMTVgGazl7\n' + + 'tBXqbB+sIv3S9X6bM4cZJKkMJOXbnyCCLZFYv8TurwIDAQABo0IwQDAPBgNVHRMB\n' + + 'Af8EBTADAQH/MB0GA1UdDgQWBBTOVtaS1b/lz6yJDvNk65vEastbQTAOBgNVHQ8B\n' + + 'Af8EBAMCAYYwDQYJKoZIhvcNAQEMBQADggIBABEONg+TmMZM/PrYGNAfB4S41zp1\n' + + '3CVjslZswh/pC4kgXSf8cPJiUOzMwUevuFQj7tCqxQtJEygJM2IFg4ViInIah2kh\n' + + 'xlRakEGGw2dEVlxZAmmLWxlL1s1lN1565t5kgVwM0GVfwYM2xEvUaby6KDVJIkD3\n' + + 'aM6sFDBshvVA70qOggM6kU6mwTbivOROzfoIQDnVaT+LQjHqY/T+ok6IN0YXXCWl\n' + + 'Favai8RDjzLDFwXSRvgIK+1c49vlFFY4W9Efp7Z9tPSZU1TvWUcKdAtV8P2fPHAS\n' + + 'vAZ+g9JuNfeawhEibjXkwg6Z/yFUueQCQOs9TRXYogzp5CMMkfdNJF8byKYqHscs\n' + + 'UosIcETnHwqwban99u35sWcoDZPr6aBIrz7LGKTJrL8Nis8qHqnqQBXu/fsQEN8u\n' + + 'zJ2LBi8sievnzd0qI0kaWmg8GzZmYH1JCt1GXSqOFkI8FMy2bahP7TUQR1LBUKQ3\n' + + 'hrOSqldkhN+cSAOnvbQcFzLr+iEYEk34+NhcMIFVE+51KJ1n6+zISOinr6mI3ckX\n' + + '6p2tmiCD4Shk2Xx/VTY/KGvQWKFcQApWezBSvDNlGe0yV71LtLf3dr1pr4ofo7cE\n' + + 'rYucCJ40bfxEU/fmzYdBF32xP7AOD9U0FbOR3Mcthc6Z6w20WFC+zru8FGY08gPf\n' + + 'WT1QcNdw7ntUJP/w\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIICrzCCAjWgAwIBAgIQARky6+5PNFRkFVO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GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOC\n' + + 'AQEAAtmx6d9+9CWlMoU0JCirtp4dSS41bBfb9Oor6GQ8WIr2LdfZLL6uES/ubJPE\n' + + '1Sh5Vu/Zon5/MbqLMVrfniv3UpQIof37jKXsjZJFE1JVD/qQfRzG8AlBkYgHNEiS\n' + + 'VtD4lFxERmaCkY1tjKB4Dbd5hfhdrDy29618ZjbSP7NwAfnwb96jobCmMKgxVGiH\n' + + 'UqsLSiEBZ33b2hI7PJ6iTJnYBWGuiDnsWzKRmheA4nxwbmcQSfjbrNwa93w3caL2\n' + + 'v/4u54Kcasvcu3yFsUwJygt8z43jsGAemNZsS7GWESxVVlW93MJRn6M+MMakkl9L\n' + + 'tWaXdHZ+KUV7LhfYLb0ajvb40w==\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEBDCCAuygAwIBAgIQJ5oxPEjefCsaESSwrxk68DANBgkqhkiG9w0BAQsFADCB\n' + + 'mjELMAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIElu\n' + + 'Yy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxCzAJBgNVBAgMAldBMTMwMQYDVQQDDCpB\n' + + 'bWF6b24gUkRTIGV1LWNlbnRyYWwtMiBSb290IENBIFJTQTIwNDggRzExEDAOBgNV\n' + + 'BAcMB1NlYXR0bGUwIBcNMjIwNjA2MjExNzA1WhgPMjA2MjA2MDYyMjE3MDVaMIGa\n' + + 'MQswCQYDVQQGEwJVUzEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5j\n' + + 'LjETMBEGA1UECwwKQW1hem9uIFJEUzELMAkGA1UECAwCV0ExMzAxBgNVBAMMKkFt\n' + + 'YXpvbiBSRFMgZXUtY2VudHJhbC0yIFJvb3QgQ0EgUlNBMjA0OCBHMTEQMA4GA1UE\n' + + 'BwwHU2VhdHRsZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTQt5eX\n' + + 'g+VP3BjO9VBkWJhE0GfLrU/QIk32I6WvrnejayTrlup9H1z4QWlXF7GNJrqScRMY\n' + + 'KhJHlcP05aPsx1lYco6pdFOf42ybXyWHHJdShj4A5glU81GTT+VrXGzHSarLmtua\n' + + 'eozkQgPpDsSlPt0RefyTyel7r3Cq+5K/4vyjCTcIqbfgaGwTU36ffjM1LaPCuE4O\n' + + 'nINMeD6YuImt2hU/mFl20FZ+IZQUIFZZU7pxGLqTRz/PWcH8tDDxnkYg7tNuXOeN\n' + + 'JbTpXrw7St50/E9ZQ0llGS+MxJD8jGRAa/oL4G/cwnV8P2OEPVVkgN9xDDQeieo0\n' + + '3xkzolkDkmeKOnUCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU\n' + + 'bwu8635iQGQMRanekesORM8Hkm4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB\n' + + 'CwUAA4IBAQAgN6LE9mUgjsj6xGCX1afYE69fnmCjjb0rC6eEe1mb/QZNcyw4XBIW\n' + + '6+zTXo4mjZ4ffoxb//R0/+vdTE7IvaLgfAZgFsLKJCtYDDstXZj8ujQnGR9Pig3R\n' + + 'W+LpNacvOOSJSawNQq0Xrlcu55AU4buyD5VjcICnfF1dqBMnGTnh27m/scd/ZMx/\n' + + 'kapHZ/fMoK2mAgSX/NvUKF3UkhT85vSSM2BTtET33DzCPDQTZQYxFBa4rFRmFi4c\n' + + 'BLlmIReiCGyh3eJhuUUuYAbK6wLaRyPsyEcIOLMQmZe1+gAFm1+1/q5Ke9ugBmjf\n' + + 'PbTWjsi/lfZ5CdVAhc5lmZj/l5aKqwaS\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIICrjCCAjSgAwIBAgIRAKKPTYKln9L4NTx9dpZGUjowCgYIKoZIzj0EAwMwgZYx\n' + + 'CzAJBgNVBAYTAlVTM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CvqpNmTAOBgNVHQ8BAf8EBAMCAYYw\n' + + 'DQYJKoZIhvcNAQEMBQADggIBAFlj3IFmgiFz5lvTzFTRizhVofhTJsGr14Yfkuc7\n' + + 'UrXPuXOwJomd4uot2d/VIeGJpfnuS84qGdmQyGewGTJ9inatHsGZgHl9NHNWRwKZ\n' + + 'lTKTbBiq7aqgtUSFa06v202wpzU+1kadxJJePrbABxiXVfOmIW/a1a4hPNcT3syH\n' + + 'FIEg1+CGsp71UNjBuwg3JTKWna0sLSKcxLOSOvX1fzxK5djzVpEsvQMB4PSAzXca\n' + + 'vENgg2ErTwgTA+4s6rRtiBF9pAusN1QVuBahYP3ftrY6f3ycS4K65GnqscyfvKt5\n' + + 'YgjtEKO3ZeeX8NpubMbzC+0Z6tVKfPFk/9TXuJtwvVeqow0YMrLLyRiYvK7EzJ97\n' + + 'rrkxoKnHYQSZ+rH2tZ5SE392/rfk1PJL0cdHnkpDkUDO+8cKsFjjYKAQSNC52sKX\n' + + '74AVh6wMwxYwVZZJf2/2XxkjMWWhKNejsZhUkTISSmiLs+qPe3L67IM7GyKm9/m6\n' + + 'R3r8x6NGjhTsKH64iYJg7AeKeax4b2e4hBb6GXFftyOs7unpEOIVkJJgM6gh3mwn\n' + + 'R7v4gwFbLKADKt1vHuerSZMiTuNTGhSfCeDM53XI/mjZl2HeuCKP1mCDLlaO+gZR\n' + + 'Q/G+E0sBKgEX4xTkAc3kgkuQGfExdGtnN2U2ehF80lBHB8+2y2E+xWWXih/ZyIcW\n' + + 'wOx+\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIGBDCCA+ygAwIBAgIQM4C8g5iFRucSWdC8EdqHeDANBgkqhkiG9w0BAQwFADCB\n' + + 'mjELMAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIElu\n' + + 'Yy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxCzAJBgNVBAgMAldBMTMwMQYDVQ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'AKm2j+JBg5wJ19R8oxRy8cfrNTftZePpISaLTyV2B16w/GsSjqixjTQe9LRN2DHk\n' + + 'cC+HPqYyzW2a3pUVyTGHhW6a7YsPBs9yzt6hAgMBAAGjQjBAMA8GA1UdEwEB/wQF\n' + + 'MAMBAf8wHQYDVR0OBBYEFIqA8QkOs2cSirOpCuKuOh9VDfJfMA4GA1UdDwEB/wQE\n' + + 'AwIBhjANBgkqhkiG9w0BAQwFAAOCAgEAOUI90mEIsa+vNJku0iUwdBMnHiO4gm7E\n' + + '5JloP7JG0xUr7d0hypDorMM3zVDAL+aZRHsq8n934Cywj7qEp1304UF6538ByGdz\n' + + 'tkfacJsUSYfdlNJE9KbA4T+U+7SNhj9jvePpVjdQbhgzxITE9f8CxY/eM40yluJJ\n' + + 'PhbaWvOiRagzo74wttlcDerzLT6Y/JrVpWhnB7IY8HvzK+BwAdaCsBUPC3HF+kth\n' + + 'CIqLq7J3YArTToejWZAp5OOI6DLPM1MEudyoejL02w0jq0CChmZ5i55ElEMnapRX\n' + + '7GQTARHmjgAOqa95FjbHEZzRPqZ72AtZAWKFcYFNk+grXSeWiDgPFOsq6mDg8DDB\n' + + '0kfbYwKLFFCC9YFmYzR2YrWw2NxAScccUc2chOWAoSNHiqBbHR8ofrlJSWrtmKqd\n' + + 'YRCXzn8wqXnTS3NNHNccqJ6dN+iMr9NGnytw8zwwSchiev53Fpc1mGrJ7BKTWH0t\n' + + 'ZrA6m32wzpMymtKozlOPYoE5mtZEzrzHEXfa44Rns7XIHxVQSXVWyBHLtIsZOrvW\n' + + 'U5F41rQaFEpEeUQ7sQvqUoISfTUVRNDn6GK6YaccEhCji14APLFIvhRQUDyYMIiM\n' + + '4vll0F/xgVRHTgDVQ8b8sxdhSYlqB4Wc2Ym41YRz+X2yPqk3typEZBpc4P5Tt1/N\n' + + '89cEIGdbjsA=\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEADCCAuigAwIBAgIQYjbPSg4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lINhpRcajTMfZrsiGCkQtoJT+AqVJPS2sHjqsEH8yiySW9Jbq4zyMbM1yqQ2vnnx\n' + + 'MJgoYMcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUaQG88UnV\n' + + 'JPTI+Pcti1P+q3H7pGYwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4IB\n' + + 'AQBAkgr75V0sEJimC6QRiTVWEuj2Khy7unjSfudbM6zumhXEU2/sUaVLiYy6cA/x\n' + + '3v0laDle6T07x9g64j5YastE/4jbzrGgIINFlY0JnaYmR3KZEjgi1s1fkRRf3llL\n' + + 'PJm9u4Q1mbwAMQK/ZjLuuRcL3uRIHJek18nRqT5h43GB26qXyvJqeYYpYfIjL9+/\n' + + 'YiZAbSRRZG+Li23cmPWrbA1CJY121SB+WybCbysbOXzhD3Sl2KSZRwSw4p2HrFtV\n' + + '1Prk0dOBtZxCG9luf87ultuDZpfS0w6oNBAMXocgswk24ylcADkkFxBWW+7BETn1\n' + + 'EpK+t1Lm37mU4sxtuha00XAi\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIEADCCAuigAwIBAgIQcY44/8NUvBwr6LlHfRy7KjANBgkqhkiG9w0BAQsFADCB\n' + + 'mDELMAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIElu\n' + + 'Yy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxCzAJBgNVBAgMAldBMTEwLwYDVQQDDChB\n' + + 'bWF6b24gUkRTIGV1LXNvdXRoLTEgUm9vdCBDQSBSU0EyMDQ4IEcxMRAwDgYDVQQH\n' + + 'DAdTZWF0dGxlMCAXDTIxMDUxOTE4MjcxOFoYDzIwNjEwNTE5MTkyNzE4WjCBmDEL\n' + + 'MAkGA1UEBhMCVVMxIjAgBgNVBAoMGUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4x\n' + + 'EzARB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NYfH/8v9nHNRlYJOqFhmoh1i85IUl5IHhg6OT5ZTTwsGTSxvgQQXrmmHVrgZ\n' + + 'rZIqyBKllCgVeB9sMEsntn4bGLig7CS/N1y2mYdW/745yCLZv2gj0NXhPqgEIdVV\n' + + 'f9DhFD4ohE1C63XP0kOQee+LYg/MY5vH8swpCSWxQgX5icv5jVDz8YTdCKgUc5u8\n' + + 'rM2p0kk=\n' + + '-----END CERTIFICATE-----\n', +]; diff --git a/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.d.ts b/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.d.ts new file mode 100644 index 0000000..da2b76b --- /dev/null +++ b/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.d.ts @@ -0,0 +1,8 @@ +import type { CA } from '../../@types/profiles.js'; +/** + * CA Certificates for **Amazon RDS Proxy** (2024) + * + * - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.howitworks.html#rds-proxy-security.tls + * - https://www.amazontrust.com/repository/ + */ +export declare const proxies: CA; diff --git a/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js b/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js new file mode 100644 index 0000000..367a4c3 --- /dev/null +++ b/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js @@ -0,0 +1,111 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.proxies = void 0; +/** + * CA Certificates for **Amazon RDS Proxy** (2024) + * + * - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.howitworks.html#rds-proxy-security.tls + * - https://www.amazontrust.com/repository/ + */ +exports.proxies = [ + '-----BEGIN CERTIFICATE-----\n' + + 'MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n' + + 'ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n' + + 'b24gUm9vdCBDQSA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5\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwF\n' + + 'ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n' + + 'b24gUm9vdCBDQSAyMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTEL\n' + + 'MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n' + + 'b3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK2Wny2cSkxK\n' + + 'gXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4kHbZ\n' + + 'W0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg\n' + + '1dKmSYXpN+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K\n' + + '8nu+NQWpEjTj82R0Yiw9AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r\n' + + '2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvdfLC6HM783k81ds8P+HgfajZRRidhW+me\n' + + 'z/CiVX18JYpvL7TFz4QuK/0NURBs+18bvBt+xa47mAExkv8LV/SasrlX6avvDXbR\n' + + '8O70zoan4G7ptGmh32n2M8ZpLpcTnqWHsFcQgTfJU7O7f/aS0ZzQGPSSbtqDT6Zj\n' + + 'mUyl+17vIWR6IF9sZIUVyzfpYgwLKhbcAS4y2j5L9Z469hdAlO+ekQiG+r5jqFoz\n' + + '7Mt0Q5X5bGlSNscpb/xVA1wf+5+9R+vnSUeVC06JIglJ4PVhHvG/LopyboBZ/1c6\n' + + '+XUyo05f7O0oYtlNc/LMgRdg7c3r3NunysV+Ar3yVAhU/bQtCSwXVEqY0VThUWcI\n' + + '0u1ufm8/0i2BWSlmy5A5lREedCf+3euvAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMB\n' + + 'Af8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSwDPBMMPQFWAJI/TPlUq9LhONm\n' + + 'UjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oAA7CXDpO8Wqj2\n' + + 'LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY\n' + + '+gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kS\n' + + 'k5Nrp+gvU5LEYFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl\n' + + '7uxMMne0nxrpS10gxdr9HIcWxkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygm\n' + + 'btmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQgj9sAq+uEjonljYE1x2igGOpm/Hl\n' + + 'urR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbWaQbLU8uz/mtBzUF+\n' + + 'fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoVYh63\n' + + 'n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE\n' + + '76KlXIx3KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H\n' + + '9jVlpNMKVv/1F2Rs76giJUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT\n' + + '4PsJYGw=\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggq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O9X4Ri83Bk\n' + + 'M6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB\n' + + '/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WB\n' + + 'MAoGCCqGSM49BAMDA2gAMGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlw\n' + + 'CkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1AE47xDqUEpHJWEadIRNyp4iciuRMStuW\n' + + '1KyLa2tJElMzrdfkviT8tQp21KW8EA==\n' + + '-----END CERTIFICATE-----\n', + '-----BEGIN CERTIFICATE-----\n' + + 'MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx\n' + + 'EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT\n' + + 'HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs\n' + + 'ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5\n' + + 'MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD\n' + + 'VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy\n' + + 'ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy\n' + + 'dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI\n' + + 'hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p\n' + + 'OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2\n' + + '8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K\n' + + 'Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe\n' + + 'hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk\n' + + '6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw\n' + + 'DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q\n' + + 'AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI\n' + + 'bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB\n' + + 've6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z\n' + + 'qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd\n' + + 'iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn\n' + + '0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN\n' + + 'sSi6\n' + + '-----END CERTIFICATE-----\n', +]; diff --git a/node_modules/aws-ssl-profiles/package.json b/node_modules/aws-ssl-profiles/package.json new file mode 100755 index 0000000..0856ad9 --- /dev/null +++ b/node_modules/aws-ssl-profiles/package.json @@ -0,0 +1,52 @@ +{ + "name": "aws-ssl-profiles", + "version": "1.1.2", + "main": "lib/index.js", + "author": "https://github.com/wellwelwel", + "description": "AWS RDS SSL certificates bundles.", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/mysqljs/aws-ssl-profiles" + }, + "bugs": { + "url": "https://github.com/mysqljs/aws-ssl-profiles/issues" + }, + "devDependencies": { + "@biomejs/biome": "^1.8.3", + "@types/node": "^22.5.1", + "@types/x509.js": "^1.0.3", + "poku": "^2.5.0", + "prettier": "^3.3.3", + "tsx": "^4.19.0", + "typescript": "^5.5.4", + "x509.js": "^1.0.0" + }, + "files": [ + "lib" + ], + "engines": { + "node": ">= 6.0.0" + }, + "keywords": [ + "mysql", + "mysql2", + "pg", + "postgres", + "aws", + "rds", + "ssl", + "certificates", + "ca", + "bundle" + ], + "scripts": { + "build": "npx tsc", + "postbuild": "cp src/index.d.ts lib/index.d.ts", + "lint": "npx @biomejs/biome lint && prettier --check .", + "lint:fix": "npx @biomejs/biome lint --write . && prettier --write .", + "pretest": "npm run build", + "test": "poku --parallel ./test", + "test:ci": "npm run lint && npm run test" + } +} diff --git a/node_modules/bcryptjs/LICENSE b/node_modules/bcryptjs/LICENSE new file mode 100644 index 0000000..6ffc6d9 --- /dev/null +++ b/node_modules/bcryptjs/LICENSE @@ -0,0 +1,27 @@ +bcrypt.js +--------- +Copyright (c) 2012 Nevins Bartolomeo +Copyright (c) 2012 Shane Girish +Copyright (c) 2025 Daniel Wirtz + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/bcryptjs/README.md b/node_modules/bcryptjs/README.md new file mode 100644 index 0000000..15546c4 --- /dev/null +++ b/node_modules/bcryptjs/README.md @@ -0,0 +1,201 @@ +# bcrypt.js + +Optimized bcrypt in JavaScript with zero dependencies, with TypeScript support. Compatible to the C++ +[bcrypt](https://npmjs.org/package/bcrypt) binding on Node.js and also working in the browser. + +[![Build Status](https://img.shields.io/github/actions/workflow/status/dcodeIO/bcrypt.js/test.yml?branch=main&label=test&logo=github)](https://github.com/dcodeIO/bcrypt.js/actions/workflows/test.yml) [![Publish Status](https://img.shields.io/github/actions/workflow/status/dcodeIO/bcrypt.js/publish.yml?branch=main&label=publish&logo=github)](https://github.com/dcodeIO/bcrypt.js/actions/workflows/publish.yml) [![npm](https://img.shields.io/npm/v/bcryptjs.svg?label=npm&color=007acc&logo=npm)](https://www.npmjs.com/package/bcryptjs) + +## Security considerations + +Besides incorporating a salt to protect against rainbow table attacks, bcrypt is an adaptive function: over time, the +iteration count can be increased to make it slower, so it remains resistant to brute-force search attacks even with +increasing computation power. ([see](http://en.wikipedia.org/wiki/Bcrypt)) + +While bcrypt.js is compatible to the C++ bcrypt binding, it is written in pure JavaScript and thus slower ([about 30%](https://github.com/dcodeIO/bcrypt.js/wiki/Benchmark)), effectively reducing the number of iterations that can be +processed in an equal time span. + +The maximum input length is 72 bytes (note that UTF-8 encoded characters use up to 4 bytes) and the length of generated +hashes is 60 characters. Note that maximum input length is not implicitly checked by the library for compatibility with +the C++ binding on Node.js, but should be checked with `bcrypt.truncates(password)` where necessary. + +## Usage + +The package exports an ECMAScript module with an UMD fallback. + +``` +$> npm install bcryptjs +``` + +```ts +import bcrypt from "bcryptjs"; +``` + +### Usage with a CDN + +- From GitHub via [jsDelivr](https://www.jsdelivr.com):
+ `https://cdn.jsdelivr.net/gh/dcodeIO/bcrypt.js@TAG/index.js` (ESM) +- From npm via [jsDelivr](https://www.jsdelivr.com):
+ `https://cdn.jsdelivr.net/npm/bcryptjs@VERSION/index.js` (ESM)
+ `https://cdn.jsdelivr.net/npm/bcryptjs@VERSION/umd/index.js` (UMD) +- From npm via [unpkg](https://unpkg.com):
+ `https://unpkg.com/bcryptjs@VERSION/index.js` (ESM)
+ `https://unpkg.com/bcryptjs@VERSION/umd/index.js` (UMD) + +Replace `TAG` respectively `VERSION` with a [specific version](https://github.com/dcodeIO/bcrypt.js/releases) or omit it (not recommended in production) to use latest. + +When using the ESM variant in a browser, the `crypto` import needs to be stubbed out, for example using an [import map](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap). Bundlers should omit it automatically. + +### Usage - Sync + +To hash a password: + +```ts +const salt = bcrypt.genSaltSync(10); +const hash = bcrypt.hashSync("B4c0/\/", salt); +// Store hash in your password DB +``` + +To check a password: + +```ts +// Load hash from your password DB +bcrypt.compareSync("B4c0/\/", hash); // true +bcrypt.compareSync("not_bacon", hash); // false +``` + +Auto-gen a salt and hash: + +```ts +const hash = bcrypt.hashSync("bacon", 10); +``` + +### Usage - Async + +To hash a password: + +```ts +const salt = await bcrypt.genSalt(10); +const hash = await bcrypt.hash("B4c0/\/", salt); +// Store hash in your password DB +``` + +```ts +bcrypt.genSalt(10, (err, salt) => { + bcrypt.hash("B4c0/\/", salt, function (err, hash) { + // Store hash in your password DB + }); +}); +``` + +To check a password: + +```ts +// Load hash from your password DB +await bcrypt.compare("B4c0/\/", hash); // true +await bcrypt.compare("not_bacon", hash); // false +``` + +```ts +// Load hash from your password DB +bcrypt.compare("B4c0/\/", hash, (err, res) => { + // res === true +}); +bcrypt.compare("not_bacon", hash, (err, res) => { + // res === false +}); +``` + +Auto-gen a salt and hash: + +```ts +await bcrypt.hash("B4c0/\/", 10); +// Store hash in your password DB +``` + +```ts +bcrypt.hash("B4c0/\/", 10, (err, hash) => { + // Store hash in your password DB +}); +``` + +**Note:** Under the hood, asynchronous APIs split an operation into small chunks. After the completion of a chunk, the execution of the next chunk is placed on the back of the [JS event queue](https://developer.mozilla.org/en/docs/Web/JavaScript/EventLoop), efficiently yielding for other computation to execute. + +### Usage - Command Line + +``` +Usage: bcrypt [rounds|salt] +``` + +## API + +### Callback types + +- **Callback<`T`>**: `(err: Error | null, result?: T) => void`
+ Called with an error on failure or a value of type `T` upon success. + +- **ProgressCallback**: `(percentage: number) => void`
+ Called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. + +- **RandomFallback**: `(length: number) => number[]`
+ Called to obtain random bytes when both [Web Crypto API](http://www.w3.org/TR/WebCryptoAPI/) and Node.js + [crypto](http://nodejs.org/api/crypto.html) are not available. + +### Functions + +- bcrypt.**genSaltSync**(rounds?: `number`): `string`
+ Synchronously generates a salt. Number of rounds defaults to 10 when omitted. + +- bcrypt.**genSalt**(rounds?: `number`): `Promise`
+ Asynchronously generates a salt. Number of rounds defaults to 10 when omitted. + +- bcrypt.**genSalt**([rounds: `number`, ]callback: `Callback`): `void`
+ Asynchronously generates a salt. Number of rounds defaults to 10 when omitted. + +- bcrypt.**truncates**(password: `string`): `boolean`
+ Tests if a password will be truncated when hashed, that is its length is greater than 72 bytes when converted to UTF-8. + +- bcrypt.**hashSync**(password: `string`, salt?: `number | string`): `string` + Synchronously generates a hash for the given password. Number of rounds defaults to 10 when omitted. + +- bcrypt.**hash**(password: `string`, salt: `number | string`): `Promise`
+ Asynchronously generates a hash for the given password. + +- bcrypt.**hash**(password: `string`, salt: `number | string`, callback: `Callback`, progressCallback?: `ProgressCallback`): `void`
+ Asynchronously generates a hash for the given password. + +- bcrypt.**compareSync**(password: `string`, hash: `string`): `boolean`
+ Synchronously tests a password against a hash. + +- bcrypt.**compare**(password: `string`, hash: `string`): `Promise`
+ Asynchronously compares a password against a hash. + +- bcrypt.**compare**(password: `string`, hash: `string`, callback: `Callback`, progressCallback?: `ProgressCallback`)
+ Asynchronously compares a password against a hash. + +- bcrypt.**getRounds**(hash: `string`): `number`
+ Gets the number of rounds used to encrypt the specified hash. + +- bcrypt.**getSalt**(hash: `string`): `string`
+ Gets the salt portion from a hash. Does not validate the hash. + +- bcrypt.**setRandomFallback**(random: `RandomFallback`): `void`
+ Sets the pseudo random number generator to use as a fallback if neither [Web Crypto API](http://www.w3.org/TR/WebCryptoAPI/) nor Node.js [crypto](http://nodejs.org/api/crypto.html) are available. Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly! + +## Building + +Building the UMD fallback: + +``` +$> npm run build +``` + +Running the [tests](./tests): + +``` +$> npm test +``` + +## Credits + +Based on work started by Shane Girish at [bcrypt-nodejs](https://github.com/shaneGirish/bcrypt-nodejs), which is itself +based on [javascript-bcrypt](http://code.google.com/p/javascript-bcrypt/) (New BSD-licensed). diff --git a/node_modules/bcryptjs/bin/bcrypt b/node_modules/bcryptjs/bin/bcrypt new file mode 100755 index 0000000..5c72e0f --- /dev/null +++ b/node_modules/bcryptjs/bin/bcrypt @@ -0,0 +1,23 @@ +#!/usr/bin/env node + +import path from "node:path"; +import bcrypt from "../index.js"; + +if (process.argv.length < 3) { + console.log( + "Usage: " + path.basename(process.argv[1]) + " [rounds|salt]", + ); + process.exit(1); +} else { + var salt; + if (process.argv.length > 3) { + salt = process.argv[3]; + var rounds = parseInt(salt, 10); + if (rounds == salt) { + salt = bcrypt.genSaltSync(rounds); + } + } else { + salt = bcrypt.genSaltSync(); + } + console.log(bcrypt.hashSync(process.argv[2], salt)); +} diff --git a/node_modules/bcryptjs/index.d.ts b/node_modules/bcryptjs/index.d.ts new file mode 100644 index 0000000..3ae838f --- /dev/null +++ b/node_modules/bcryptjs/index.d.ts @@ -0,0 +1,3 @@ +import * as bcrypt from "./types.js"; +export * from "./types.js"; +export default bcrypt; diff --git a/node_modules/bcryptjs/index.js b/node_modules/bcryptjs/index.js new file mode 100644 index 0000000..f91fff4 --- /dev/null +++ b/node_modules/bcryptjs/index.js @@ -0,0 +1,1161 @@ +/* + Copyright (c) 2012 Nevins Bartolomeo + Copyright (c) 2012 Shane Girish + Copyright (c) 2025 Daniel Wirtz + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// The Node.js crypto module is used as a fallback for the Web Crypto API. When +// building for the browser, inclusion of the crypto module should be disabled, +// which the package hints at in its package.json for bundlers that support it. +import nodeCrypto from "crypto"; + +/** + * The random implementation to use as a fallback. + * @type {?function(number):!Array.} + * @inner + */ +var randomFallback = null; + +/** + * Generates cryptographically secure random bytes. + * @function + * @param {number} len Bytes length + * @returns {!Array.} Random bytes + * @throws {Error} If no random implementation is available + * @inner + */ +function randomBytes(len) { + // Web Crypto API. Globally available in the browser and in Node.js >=23. + try { + return crypto.getRandomValues(new Uint8Array(len)); + } catch {} + // Node.js crypto module for non-browser environments. + try { + return nodeCrypto.randomBytes(len); + } catch {} + // Custom fallback specified with `setRandomFallback`. + if (!randomFallback) { + throw Error( + "Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative", + ); + } + return randomFallback(len); +} + +/** + * Sets the pseudo random number generator to use as a fallback if neither node's `crypto` module nor the Web Crypto + * API is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it + * is seeded properly! + * @param {?function(number):!Array.} random Function taking the number of bytes to generate as its + * sole argument, returning the corresponding array of cryptographically secure random byte values. + * @see http://nodejs.org/api/crypto.html + * @see http://www.w3.org/TR/WebCryptoAPI/ + */ +export function setRandomFallback(random) { + randomFallback = random; +} + +/** + * Synchronously generates a salt. + * @param {number=} rounds Number of rounds to use, defaults to 10 if omitted + * @param {number=} seed_length Not supported. + * @returns {string} Resulting salt + * @throws {Error} If a random fallback is required but not set + */ +export function genSaltSync(rounds, seed_length) { + rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof rounds !== "number") + throw Error( + "Illegal arguments: " + typeof rounds + ", " + typeof seed_length, + ); + if (rounds < 4) rounds = 4; + else if (rounds > 31) rounds = 31; + var salt = []; + salt.push("$2b$"); + if (rounds < 10) salt.push("0"); + salt.push(rounds.toString()); + salt.push("$"); + salt.push(base64_encode(randomBytes(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); // May throw + return salt.join(""); +} + +/** + * Asynchronously generates a salt. + * @param {(number|function(Error, string=))=} rounds Number of rounds to use, defaults to 10 if omitted + * @param {(number|function(Error, string=))=} seed_length Not supported. + * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting salt + * @returns {!Promise} If `callback` has been omitted + * @throws {Error} If `callback` is present but not a function + */ +export function genSalt(rounds, seed_length, callback) { + if (typeof seed_length === "function") + (callback = seed_length), (seed_length = undefined); // Not supported. + if (typeof rounds === "function") (callback = rounds), (rounds = undefined); + if (typeof rounds === "undefined") rounds = GENSALT_DEFAULT_LOG2_ROUNDS; + else if (typeof rounds !== "number") + throw Error("illegal arguments: " + typeof rounds); + + function _async(callback) { + nextTick(function () { + // Pretty thin, but salting is fast enough + try { + callback(null, genSaltSync(rounds)); + } catch (err) { + callback(err); + } + }); + } + + if (callback) { + if (typeof callback !== "function") + throw Error("Illegal callback: " + typeof callback); + _async(callback); + } else + return new Promise(function (resolve, reject) { + _async(function (err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); +} + +/** + * Synchronously generates a hash for the given password. + * @param {string} password Password to hash + * @param {(number|string)=} salt Salt length to generate or salt to use, default to 10 + * @returns {string} Resulting hash + */ +export function hashSync(password, salt) { + if (typeof salt === "undefined") salt = GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof salt === "number") salt = genSaltSync(salt); + if (typeof password !== "string" || typeof salt !== "string") + throw Error("Illegal arguments: " + typeof password + ", " + typeof salt); + return _hash(password, salt); +} + +/** + * Asynchronously generates a hash for the given password. + * @param {string} password Password to hash + * @param {number|string} salt Salt length to generate or salt to use + * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash + * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed + * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. + * @returns {!Promise} If `callback` has been omitted + * @throws {Error} If `callback` is present but not a function + */ +export function hash(password, salt, callback, progressCallback) { + function _async(callback) { + if (typeof password === "string" && typeof salt === "number") + genSalt(salt, function (err, salt) { + _hash(password, salt, callback, progressCallback); + }); + else if (typeof password === "string" && typeof salt === "string") + _hash(password, salt, callback, progressCallback); + else + nextTick( + callback.bind( + this, + Error("Illegal arguments: " + typeof password + ", " + typeof salt), + ), + ); + } + + if (callback) { + if (typeof callback !== "function") + throw Error("Illegal callback: " + typeof callback); + _async(callback); + } else + return new Promise(function (resolve, reject) { + _async(function (err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); +} + +/** + * Compares two strings of the same length in constant time. + * @param {string} known Must be of the correct length + * @param {string} unknown Must be the same length as `known` + * @returns {boolean} + * @inner + */ +function safeStringCompare(known, unknown) { + var diff = known.length ^ unknown.length; + for (var i = 0; i < known.length; ++i) { + diff |= known.charCodeAt(i) ^ unknown.charCodeAt(i); + } + return diff === 0; +} + +/** + * Synchronously tests a password against a hash. + * @param {string} password Password to compare + * @param {string} hash Hash to test against + * @returns {boolean} true if matching, otherwise false + * @throws {Error} If an argument is illegal + */ +export function compareSync(password, hash) { + if (typeof password !== "string" || typeof hash !== "string") + throw Error("Illegal arguments: " + typeof password + ", " + typeof hash); + if (hash.length !== 60) return false; + return safeStringCompare( + hashSync(password, hash.substring(0, hash.length - 31)), + hash, + ); +} + +/** + * Asynchronously tests a password against a hash. + * @param {string} password Password to compare + * @param {string} hashValue Hash to test against + * @param {function(Error, boolean)=} callback Callback receiving the error, if any, otherwise the result + * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed + * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. + * @returns {!Promise} If `callback` has been omitted + * @throws {Error} If `callback` is present but not a function + */ +export function compare(password, hashValue, callback, progressCallback) { + function _async(callback) { + if (typeof password !== "string" || typeof hashValue !== "string") { + nextTick( + callback.bind( + this, + Error( + "Illegal arguments: " + typeof password + ", " + typeof hashValue, + ), + ), + ); + return; + } + if (hashValue.length !== 60) { + nextTick(callback.bind(this, null, false)); + return; + } + hash( + password, + hashValue.substring(0, 29), + function (err, comp) { + if (err) callback(err); + else callback(null, safeStringCompare(comp, hashValue)); + }, + progressCallback, + ); + } + + if (callback) { + if (typeof callback !== "function") + throw Error("Illegal callback: " + typeof callback); + _async(callback); + } else + return new Promise(function (resolve, reject) { + _async(function (err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); +} + +/** + * Gets the number of rounds used to encrypt the specified hash. + * @param {string} hash Hash to extract the used number of rounds from + * @returns {number} Number of rounds used + * @throws {Error} If `hash` is not a string + */ +export function getRounds(hash) { + if (typeof hash !== "string") + throw Error("Illegal arguments: " + typeof hash); + return parseInt(hash.split("$")[2], 10); +} + +/** + * Gets the salt portion from a hash. Does not validate the hash. + * @param {string} hash Hash to extract the salt from + * @returns {string} Extracted salt part + * @throws {Error} If `hash` is not a string or otherwise invalid + */ +export function getSalt(hash) { + if (typeof hash !== "string") + throw Error("Illegal arguments: " + typeof hash); + if (hash.length !== 60) + throw Error("Illegal hash length: " + hash.length + " != 60"); + return hash.substring(0, 29); +} + +/** + * Tests if a password will be truncated when hashed, that is its length is + * greater than 72 bytes when converted to UTF-8. + * @param {string} password The password to test + * @returns {boolean} `true` if truncated, otherwise `false` + */ +export function truncates(password) { + if (typeof password !== "string") + throw Error("Illegal arguments: " + typeof password); + return utf8Length(password) > 72; +} + +/** + * Continues with the callback on the next tick. + * @function + * @param {function(...[*])} callback Callback to execute + * @inner + */ +var nextTick = + typeof process !== "undefined" && + process && + typeof process.nextTick === "function" + ? typeof setImmediate === "function" + ? setImmediate + : process.nextTick + : setTimeout; + +/** Calculates the byte length of a string encoded as UTF8. */ +function utf8Length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ( + (c & 0xfc00) === 0xd800 && + (string.charCodeAt(i + 1) & 0xfc00) === 0xdc00 + ) { + ++i; + len += 4; + } else len += 3; + } + return len; +} + +/** Converts a string to an array of UTF8 bytes. */ +function utf8Array(string) { + var offset = 0, + c1, + c2; + var buffer = new Array(utf8Length(string)); + for (var i = 0, k = string.length; i < k; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = (c1 >> 6) | 192; + buffer[offset++] = (c1 & 63) | 128; + } else if ( + (c1 & 0xfc00) === 0xd800 && + ((c2 = string.charCodeAt(i + 1)) & 0xfc00) === 0xdc00 + ) { + c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff); + ++i; + buffer[offset++] = (c1 >> 18) | 240; + buffer[offset++] = ((c1 >> 12) & 63) | 128; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } else { + buffer[offset++] = (c1 >> 12) | 224; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } + } + return buffer; +} + +// A base64 implementation for the bcrypt algorithm. This is partly non-standard. + +/** + * bcrypt's own non-standard base64 dictionary. + * @type {!Array.} + * @const + * @inner + **/ +var BASE64_CODE = + "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""); + +/** + * @type {!Array.} + * @const + * @inner + **/ +var BASE64_INDEX = [ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1, +]; + +/** + * Encodes a byte array to base64 with up to len bytes of input. + * @param {!Array.} b Byte array + * @param {number} len Maximum input length + * @returns {string} + * @inner + */ +function base64_encode(b, len) { + var off = 0, + rs = [], + c1, + c2; + if (len <= 0 || len > b.length) throw Error("Illegal len: " + len); + while (off < len) { + c1 = b[off++] & 0xff; + rs.push(BASE64_CODE[(c1 >> 2) & 0x3f]); + c1 = (c1 & 0x03) << 4; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 0x3f]); + break; + } + c2 = b[off++] & 0xff; + c1 |= (c2 >> 4) & 0x0f; + rs.push(BASE64_CODE[c1 & 0x3f]); + c1 = (c2 & 0x0f) << 2; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 0x3f]); + break; + } + c2 = b[off++] & 0xff; + c1 |= (c2 >> 6) & 0x03; + rs.push(BASE64_CODE[c1 & 0x3f]); + rs.push(BASE64_CODE[c2 & 0x3f]); + } + return rs.join(""); +} + +/** + * Decodes a base64 encoded string to up to len bytes of output. + * @param {string} s String to decode + * @param {number} len Maximum output length + * @returns {!Array.} + * @inner + */ +function base64_decode(s, len) { + var off = 0, + slen = s.length, + olen = 0, + rs = [], + c1, + c2, + c3, + c4, + o, + code; + if (len <= 0) throw Error("Illegal len: " + len); + while (off < slen - 1 && olen < len) { + code = s.charCodeAt(off++); + c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + code = s.charCodeAt(off++); + c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c1 == -1 || c2 == -1) break; + o = (c1 << 2) >>> 0; + o |= (c2 & 0x30) >> 4; + rs.push(String.fromCharCode(o)); + if (++olen >= len || off >= slen) break; + code = s.charCodeAt(off++); + c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c3 == -1) break; + o = ((c2 & 0x0f) << 4) >>> 0; + o |= (c3 & 0x3c) >> 2; + rs.push(String.fromCharCode(o)); + if (++olen >= len || off >= slen) break; + code = s.charCodeAt(off++); + c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + o = ((c3 & 0x03) << 6) >>> 0; + o |= c4; + rs.push(String.fromCharCode(o)); + ++olen; + } + var res = []; + for (off = 0; off < olen; off++) res.push(rs[off].charCodeAt(0)); + return res; +} + +/** + * @type {number} + * @const + * @inner + */ +var BCRYPT_SALT_LEN = 16; + +/** + * @type {number} + * @const + * @inner + */ +var GENSALT_DEFAULT_LOG2_ROUNDS = 10; + +/** + * @type {number} + * @const + * @inner + */ +var BLOWFISH_NUM_ROUNDS = 16; + +/** + * @type {number} + * @const + * @inner + */ +var MAX_EXECUTION_TIME = 100; + +/** + * @type {Array.} + * @const + * @inner + */ +var P_ORIG = [ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, + 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b, +]; + +/** + * @type {Array.} + * @const + * @inner + */ +var S_ORIG = [ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, + 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, + 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, + 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, + 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, + 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, + 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, + 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, + 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, + 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, + 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, + 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, + 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, + 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, + 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, + 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, + 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, + 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, + 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, + 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, + 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, + 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, 0x4b7a70e9, 0xb5b32944, + 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, + 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, + 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, + 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, + 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, + 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, + 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, + 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, + 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, + 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78, + 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, + 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170, + 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, + 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, + 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, + 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, + 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, + 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, + 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, + 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, + 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, + 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, + 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, + 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, + 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, + 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, + 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, + 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, + 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, + 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, + 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, + 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, + 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, + 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, + 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, + 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, + 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, + 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, + 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, + 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, + 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, + 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, + 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, + 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, + 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, + 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, + 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, + 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, + 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, + 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, + 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, + 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, + 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, + 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, + 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, + 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, + 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, + 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, + 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, + 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, + 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, + 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, + 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, + 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, +]; + +/** + * @type {Array.} + * @const + * @inner + */ +var C_ORIG = [ + 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, 0x6f756274, +]; + +/** + * @param {Array.} lr + * @param {number} off + * @param {Array.} P + * @param {Array.} S + * @returns {Array.} + * @inner + */ +function _encipher(lr, off, P, S) { + // This is our bottleneck: 1714/1905 ticks / 90% - see profile.txt + var n, + l = lr[off], + r = lr[off + 1]; + + l ^= P[0]; + + /* + for (var i=0, k=BLOWFISH_NUM_ROUNDS-2; i<=k;) + // Feistel substitution on left word + n = S[l >>> 24], + n += S[0x100 | ((l >> 16) & 0xff)], + n ^= S[0x200 | ((l >> 8) & 0xff)], + n += S[0x300 | (l & 0xff)], + r ^= n ^ P[++i], + // Feistel substitution on right word + n = S[r >>> 24], + n += S[0x100 | ((r >> 16) & 0xff)], + n ^= S[0x200 | ((r >> 8) & 0xff)], + n += S[0x300 | (r & 0xff)], + l ^= n ^ P[++i]; + */ + + //The following is an unrolled version of the above loop. + //Iteration 0 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[1]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[2]; + //Iteration 1 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[3]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[4]; + //Iteration 2 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[5]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[6]; + //Iteration 3 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[7]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[8]; + //Iteration 4 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[9]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[10]; + //Iteration 5 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[11]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[12]; + //Iteration 6 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[13]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[14]; + //Iteration 7 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[15]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[16]; + + lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; + lr[off + 1] = l; + return lr; +} + +/** + * @param {Array.} data + * @param {number} offp + * @returns {{key: number, offp: number}} + * @inner + */ +function _streamtoword(data, offp) { + for (var i = 0, word = 0; i < 4; ++i) + (word = (word << 8) | (data[offp] & 0xff)), + (offp = (offp + 1) % data.length); + return { key: word, offp: offp }; +} + +/** + * @param {Array.} key + * @param {Array.} P + * @param {Array.} S + * @inner + */ +function _key(key, P, S) { + var offset = 0, + lr = [0, 0], + plen = P.length, + slen = S.length, + sw; + for (var i = 0; i < plen; i++) + (sw = _streamtoword(key, offset)), + (offset = sw.offp), + (P[i] = P[i] ^ sw.key); + for (i = 0; i < plen; i += 2) + (lr = _encipher(lr, 0, P, S)), (P[i] = lr[0]), (P[i + 1] = lr[1]); + for (i = 0; i < slen; i += 2) + (lr = _encipher(lr, 0, P, S)), (S[i] = lr[0]), (S[i + 1] = lr[1]); +} + +/** + * Expensive key schedule Blowfish. + * @param {Array.} data + * @param {Array.} key + * @param {Array.} P + * @param {Array.} S + * @inner + */ +function _ekskey(data, key, P, S) { + var offp = 0, + lr = [0, 0], + plen = P.length, + slen = S.length, + sw; + for (var i = 0; i < plen; i++) + (sw = _streamtoword(key, offp)), (offp = sw.offp), (P[i] = P[i] ^ sw.key); + offp = 0; + for (i = 0; i < plen; i += 2) + (sw = _streamtoword(data, offp)), + (offp = sw.offp), + (lr[0] ^= sw.key), + (sw = _streamtoword(data, offp)), + (offp = sw.offp), + (lr[1] ^= sw.key), + (lr = _encipher(lr, 0, P, S)), + (P[i] = lr[0]), + (P[i + 1] = lr[1]); + for (i = 0; i < slen; i += 2) + (sw = _streamtoword(data, offp)), + (offp = sw.offp), + (lr[0] ^= sw.key), + (sw = _streamtoword(data, offp)), + (offp = sw.offp), + (lr[1] ^= sw.key), + (lr = _encipher(lr, 0, P, S)), + (S[i] = lr[0]), + (S[i + 1] = lr[1]); +} + +/** + * Internaly crypts a string. + * @param {Array.} b Bytes to crypt + * @param {Array.} salt Salt bytes to use + * @param {number} rounds Number of rounds + * @param {function(Error, Array.=)=} callback Callback receiving the error, if any, and the resulting bytes. If + * omitted, the operation will be performed synchronously. + * @param {function(number)=} progressCallback Callback called with the current progress + * @returns {!Array.|undefined} Resulting bytes if callback has been omitted, otherwise `undefined` + * @inner + */ +function _crypt(b, salt, rounds, callback, progressCallback) { + var cdata = C_ORIG.slice(), + clen = cdata.length, + err; + + // Validate + if (rounds < 4 || rounds > 31) { + err = Error("Illegal number of rounds (4-31): " + rounds); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + if (salt.length !== BCRYPT_SALT_LEN) { + err = Error( + "Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN, + ); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + rounds = (1 << rounds) >>> 0; + + var P, + S, + i = 0, + j; + + //Use typed arrays when available - huge speedup! + if (typeof Int32Array === "function") { + P = new Int32Array(P_ORIG); + S = new Int32Array(S_ORIG); + } else { + P = P_ORIG.slice(); + S = S_ORIG.slice(); + } + + _ekskey(salt, b, P, S); + + /** + * Calcualtes the next round. + * @returns {Array.|undefined} Resulting array if callback has been omitted, otherwise `undefined` + * @inner + */ + function next() { + if (progressCallback) progressCallback(i / rounds); + if (i < rounds) { + var start = Date.now(); + for (; i < rounds; ) { + i = i + 1; + _key(b, P, S); + _key(salt, P, S); + if (Date.now() - start > MAX_EXECUTION_TIME) break; + } + } else { + for (i = 0; i < 64; i++) + for (j = 0; j < clen >> 1; j++) _encipher(cdata, j << 1, P, S); + var ret = []; + for (i = 0; i < clen; i++) + ret.push(((cdata[i] >> 24) & 0xff) >>> 0), + ret.push(((cdata[i] >> 16) & 0xff) >>> 0), + ret.push(((cdata[i] >> 8) & 0xff) >>> 0), + ret.push((cdata[i] & 0xff) >>> 0); + if (callback) { + callback(null, ret); + return; + } else return ret; + } + if (callback) nextTick(next); + } + + // Async + if (typeof callback !== "undefined") { + next(); + + // Sync + } else { + var res; + while (true) if (typeof (res = next()) !== "undefined") return res || []; + } +} + +/** + * Internally hashes a password. + * @param {string} password Password to hash + * @param {?string} salt Salt to use, actually never null + * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash. If omitted, + * hashing is performed synchronously. + * @param {function(number)=} progressCallback Callback called with the current progress + * @returns {string|undefined} Resulting hash if callback has been omitted, otherwise `undefined` + * @inner + */ +function _hash(password, salt, callback, progressCallback) { + var err; + if (typeof password !== "string" || typeof salt !== "string") { + err = Error("Invalid string / salt: Not a string"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + + // Validate the salt + var minor, offset; + if (salt.charAt(0) !== "$" || salt.charAt(1) !== "2") { + err = Error("Invalid salt version: " + salt.substring(0, 2)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + if (salt.charAt(2) === "$") (minor = String.fromCharCode(0)), (offset = 3); + else { + minor = salt.charAt(2); + if ( + (minor !== "a" && minor !== "b" && minor !== "y") || + salt.charAt(3) !== "$" + ) { + err = Error("Invalid salt revision: " + salt.substring(2, 4)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + offset = 4; + } + + // Extract number of rounds + if (salt.charAt(offset + 2) > "$") { + err = Error("Missing salt rounds"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, + r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), + rounds = r1 + r2, + real_salt = salt.substring(offset + 3, offset + 25); + password += minor >= "a" ? "\x00" : ""; + + var passwordb = utf8Array(password), + saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); + + /** + * Finishes hashing. + * @param {Array.} bytes Byte array + * @returns {string} + * @inner + */ + function finish(bytes) { + var res = []; + res.push("$2"); + if (minor >= "a") res.push(minor); + res.push("$"); + if (rounds < 10) res.push("0"); + res.push(rounds.toString()); + res.push("$"); + res.push(base64_encode(saltb, saltb.length)); + res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); + return res.join(""); + } + + // Sync + if (typeof callback == "undefined") + return finish(_crypt(passwordb, saltb, rounds)); + // Async + else { + _crypt( + passwordb, + saltb, + rounds, + function (err, bytes) { + if (err) callback(err, null); + else callback(null, finish(bytes)); + }, + progressCallback, + ); + } +} + +/** + * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet. + * @function + * @param {!Array.} bytes Byte array + * @param {number} length Maximum input length + * @returns {string} + */ +export function encodeBase64(bytes, length) { + return base64_encode(bytes, length); +} + +/** + * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. + * @function + * @param {string} string String to decode + * @param {number} length Maximum output length + * @returns {!Array.} + */ +export function decodeBase64(string, length) { + return base64_decode(string, length); +} + +export default { + setRandomFallback, + genSaltSync, + genSalt, + hashSync, + hash, + compareSync, + compare, + getRounds, + getSalt, + truncates, + encodeBase64, + decodeBase64, +}; diff --git a/node_modules/bcryptjs/package.json b/node_modules/bcryptjs/package.json new file mode 100644 index 0000000..86e9543 --- /dev/null +++ b/node_modules/bcryptjs/package.json @@ -0,0 +1,76 @@ +{ + "name": "bcryptjs", + "description": "Optimized bcrypt in plain JavaScript with zero dependencies, with TypeScript support. Compatible to 'bcrypt'.", + "version": "3.0.2", + "author": "Daniel Wirtz ", + "contributors": [ + "Shane Girish (https://github.com/shaneGirish)", + "Alex Murray <> (https://github.com/alexmurray)", + "Nicolas Pelletier <> (https://github.com/NicolasPelletier)", + "Josh Rogers <> (https://github.com/geekymole)", + "Noah Isaacson (https://github.com/nisaacson)" + ], + "repository": { + "type": "url", + "url": "https://github.com/dcodeIO/bcrypt.js.git" + }, + "bugs": { + "url": "https://github.com/dcodeIO/bcrypt.js/issues" + }, + "keywords": [ + "bcrypt", + "password", + "auth", + "authentication", + "encryption", + "crypt", + "crypto" + ], + "type": "module", + "main": "umd/index.js", + "types": "umd/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "require": { + "types": "./umd/index.d.ts", + "default": "./umd/index.js" + } + } + }, + "bin": { + "bcrypt": "bin/bcrypt" + }, + "license": "BSD-3-Clause", + "scripts": { + "build": "node scripts/build.js", + "lint": "prettier --check .", + "format": "prettier --write .", + "test": "npm run test:unit && npm run test:typescript", + "test:unit": "node tests", + "test:typescript": "tsc --project tests/typescript/tsconfig.esnext.json && tsc --project tests/typescript/tsconfig.nodenext.json && tsc --project tests/typescript/tsconfig.commonjs.json && tsc --project tests/typescript/tsconfig.global.json" + }, + "files": [ + "index.js", + "index.d.ts", + "types.d.ts", + "umd/index.js", + "umd/index.d.ts", + "umd/types.d.ts", + "umd/package.json", + "LICENSE", + "README.md" + ], + "browser": { + "crypto": false + }, + "devDependencies": { + "bcrypt": "^5.1.1", + "esm2umd": "^0.3.1", + "prettier": "^3.5.0", + "typescript": "^5.7.3" + } +} diff --git a/node_modules/bcryptjs/types.d.ts b/node_modules/bcryptjs/types.d.ts new file mode 100644 index 0000000..3cbe5b1 --- /dev/null +++ b/node_modules/bcryptjs/types.d.ts @@ -0,0 +1,157 @@ +// Originally imported from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/8b36dbdf95b624b8a7cd7f8416f06c15d274f9e6/types/bcryptjs/index.d.ts +// MIT license. + +/** Called with an error on failure or a value of type `T` upon success. */ +type Callback = (err: Error | null, result?: T) => void; +/** Called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. */ +type ProgressCallback = (percentage: number) => void; +/** Called to obtain random bytes when both Web Crypto API and Node.js crypto are not available. */ +type RandomFallback = (length: number) => number[]; + +/** + * Sets the pseudo random number generator to use as a fallback if neither node's crypto module nor the Web Crypto API is available. + * Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly! + * @param random Function taking the number of bytes to generate as its sole argument, returning the corresponding array of cryptographically secure random byte values. + */ +export declare function setRandomFallback(random: RandomFallback): void; + +/** + * Synchronously generates a salt. + * @param rounds Number of rounds to use, defaults to 10 if omitted + * @return Resulting salt + * @throws If a random fallback is required but not set + */ +export declare function genSaltSync(rounds?: number): string; + +/** + * Asynchronously generates a salt. + * @param rounds Number of rounds to use, defaults to 10 if omitted + * @return Promise with resulting salt, if callback has been omitted + */ +export declare function genSalt(rounds?: number): Promise; + +/** + * Asynchronously generates a salt. + * @param callback Callback receiving the error, if any, and the resulting salt + */ +export declare function genSalt(callback: Callback): void; + +/** + * Asynchronously generates a salt. + * @param rounds Number of rounds to use, defaults to 10 if omitted + * @param callback Callback receiving the error, if any, and the resulting salt + */ +export declare function genSalt( + rounds: number, + callback: Callback, +): void; + +/** + * Synchronously generates a hash for the given password. + * @param password Password to hash + * @param salt Salt length to generate or salt to use, default to 10 + * @return Resulting hash + */ +export declare function hashSync( + password: string, + salt?: number | string, +): string; + +/** + * Asynchronously generates a hash for the given password. + * @param password Password to hash + * @param salt Salt length to generate or salt to use + * @return Promise with resulting hash, if callback has been omitted + */ +export declare function hash( + password: string, + salt: number | string, +): Promise; + +/** + * Asynchronously generates a hash for the given password. + * @param password Password to hash + * @param salt Salt length to generate or salt to use + * @param callback Callback receiving the error, if any, and the resulting hash + * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. + */ +export declare function hash( + password: string, + salt: number | string, + callback?: Callback, + progressCallback?: ProgressCallback, +): void; + +/** + * Synchronously tests a password against a hash. + * @param password Password to test + * @param hash Hash to test against + * @return true if matching, otherwise false + */ +export declare function compareSync(password: string, hash: string): boolean; + +/** + * Asynchronously tests a password against a hash. + * @param password Password to test + * @param hash Hash to test against + * @return Promise, if callback has been omitted + */ +export declare function compare( + password: string, + hash: string, +): Promise; + +/** + * Asynchronously tests a password against a hash. + * @param password Password to test + * @param hash Hash to test against + * @param callback Callback receiving the error, if any, otherwise the result + * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. + */ +export declare function compare( + password: string, + hash: string, + callback?: Callback, + progressCallback?: ProgressCallback, +): void; + +/** + * Gets the number of rounds used to encrypt the specified hash. + * @param hash Hash to extract the used number of rounds from + * @return Number of rounds used + */ +export declare function getRounds(hash: string): number; + +/** + * Gets the salt portion from a hash. Does not validate the hash. + * @param hash Hash to extract the salt from + * @return Extracted salt part + */ +export declare function getSalt(hash: string): string; + +/** + * Tests if a password will be truncated when hashed, that is its length is + * greater than 72 bytes when converted to UTF-8. + * @param password The password to test + * @returns `true` if truncated, otherwise `false` + */ +export declare function truncates(password: string): boolean; + +/** + * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet. + * @function + * @param b Byte array + * @param len Maximum input length + */ +export declare function encodeBase64( + b: Readonly>, + len: number, +): string; + +/** + * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. + * @function + * @param s String to decode + * @param len Maximum output length + */ +export declare function decodeBase64(s: string, len: number): number[]; diff --git a/node_modules/bcryptjs/umd/index.d.ts b/node_modules/bcryptjs/umd/index.d.ts new file mode 100644 index 0000000..8c2eb07 --- /dev/null +++ b/node_modules/bcryptjs/umd/index.d.ts @@ -0,0 +1,3 @@ +import * as bcrypt from "./types.js"; +export = bcrypt; +export as namespace bcrypt; diff --git a/node_modules/bcryptjs/umd/index.js b/node_modules/bcryptjs/umd/index.js new file mode 100644 index 0000000..50f716a --- /dev/null +++ b/node_modules/bcryptjs/umd/index.js @@ -0,0 +1,1221 @@ +// GENERATED FILE. DO NOT EDIT. +(function (global, factory) { + function preferDefault(exports) { + return exports.default || exports; + } + if (typeof define === "function" && define.amd) { + define(["crypto"], function (_crypto) { + var exports = {}; + factory(exports, _crypto); + return preferDefault(exports); + }); + } else if (typeof exports === "object") { + factory(exports, require("crypto")); + if (typeof module === "object") module.exports = preferDefault(exports); + } else { + (function () { + var exports = {}; + factory(exports, global.crypto); + global.bcrypt = preferDefault(exports); + })(); + } +})( + typeof globalThis !== "undefined" + ? globalThis + : typeof self !== "undefined" + ? self + : this, + function (_exports, _crypto) { + "use strict"; + + Object.defineProperty(_exports, "__esModule", { + value: true, + }); + _exports.compare = compare; + _exports.compareSync = compareSync; + _exports.decodeBase64 = decodeBase64; + _exports.default = void 0; + _exports.encodeBase64 = encodeBase64; + _exports.genSalt = genSalt; + _exports.genSaltSync = genSaltSync; + _exports.getRounds = getRounds; + _exports.getSalt = getSalt; + _exports.hash = hash; + _exports.hashSync = hashSync; + _exports.setRandomFallback = setRandomFallback; + _exports.truncates = truncates; + _crypto = _interopRequireDefault(_crypto); + function _interopRequireDefault(e) { + return e && e.__esModule ? e : { default: e }; + } + /* + Copyright (c) 2012 Nevins Bartolomeo + Copyright (c) 2012 Shane Girish + Copyright (c) 2025 Daniel Wirtz + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + // The Node.js crypto module is used as a fallback for the Web Crypto API. When + // building for the browser, inclusion of the crypto module should be disabled, + // which the package hints at in its package.json for bundlers that support it. + + /** + * The random implementation to use as a fallback. + * @type {?function(number):!Array.} + * @inner + */ + var randomFallback = null; + + /** + * Generates cryptographically secure random bytes. + * @function + * @param {number} len Bytes length + * @returns {!Array.} Random bytes + * @throws {Error} If no random implementation is available + * @inner + */ + function randomBytes(len) { + // Web Crypto API. Globally available in the browser and in Node.js >=23. + try { + return crypto.getRandomValues(new Uint8Array(len)); + } catch {} + // Node.js crypto module for non-browser environments. + try { + return _crypto.default.randomBytes(len); + } catch {} + // Custom fallback specified with `setRandomFallback`. + if (!randomFallback) { + throw Error( + "Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative", + ); + } + return randomFallback(len); + } + + /** + * Sets the pseudo random number generator to use as a fallback if neither node's `crypto` module nor the Web Crypto + * API is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it + * is seeded properly! + * @param {?function(number):!Array.} random Function taking the number of bytes to generate as its + * sole argument, returning the corresponding array of cryptographically secure random byte values. + * @see http://nodejs.org/api/crypto.html + * @see http://www.w3.org/TR/WebCryptoAPI/ + */ + function setRandomFallback(random) { + randomFallback = random; + } + + /** + * Synchronously generates a salt. + * @param {number=} rounds Number of rounds to use, defaults to 10 if omitted + * @param {number=} seed_length Not supported. + * @returns {string} Resulting salt + * @throws {Error} If a random fallback is required but not set + */ + function genSaltSync(rounds, seed_length) { + rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof rounds !== "number") + throw Error( + "Illegal arguments: " + typeof rounds + ", " + typeof seed_length, + ); + if (rounds < 4) rounds = 4; + else if (rounds > 31) rounds = 31; + var salt = []; + salt.push("$2b$"); + if (rounds < 10) salt.push("0"); + salt.push(rounds.toString()); + salt.push("$"); + salt.push(base64_encode(randomBytes(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); // May throw + return salt.join(""); + } + + /** + * Asynchronously generates a salt. + * @param {(number|function(Error, string=))=} rounds Number of rounds to use, defaults to 10 if omitted + * @param {(number|function(Error, string=))=} seed_length Not supported. + * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting salt + * @returns {!Promise} If `callback` has been omitted + * @throws {Error} If `callback` is present but not a function + */ + function genSalt(rounds, seed_length, callback) { + if (typeof seed_length === "function") + (callback = seed_length), (seed_length = undefined); // Not supported. + if (typeof rounds === "function") + (callback = rounds), (rounds = undefined); + if (typeof rounds === "undefined") rounds = GENSALT_DEFAULT_LOG2_ROUNDS; + else if (typeof rounds !== "number") + throw Error("illegal arguments: " + typeof rounds); + function _async(callback) { + nextTick(function () { + // Pretty thin, but salting is fast enough + try { + callback(null, genSaltSync(rounds)); + } catch (err) { + callback(err); + } + }); + } + if (callback) { + if (typeof callback !== "function") + throw Error("Illegal callback: " + typeof callback); + _async(callback); + } else + return new Promise(function (resolve, reject) { + _async(function (err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); + } + + /** + * Synchronously generates a hash for the given password. + * @param {string} password Password to hash + * @param {(number|string)=} salt Salt length to generate or salt to use, default to 10 + * @returns {string} Resulting hash + */ + function hashSync(password, salt) { + if (typeof salt === "undefined") salt = GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof salt === "number") salt = genSaltSync(salt); + if (typeof password !== "string" || typeof salt !== "string") + throw Error( + "Illegal arguments: " + typeof password + ", " + typeof salt, + ); + return _hash(password, salt); + } + + /** + * Asynchronously generates a hash for the given password. + * @param {string} password Password to hash + * @param {number|string} salt Salt length to generate or salt to use + * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash + * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed + * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. + * @returns {!Promise} If `callback` has been omitted + * @throws {Error} If `callback` is present but not a function + */ + function hash(password, salt, callback, progressCallback) { + function _async(callback) { + if (typeof password === "string" && typeof salt === "number") + genSalt(salt, function (err, salt) { + _hash(password, salt, callback, progressCallback); + }); + else if (typeof password === "string" && typeof salt === "string") + _hash(password, salt, callback, progressCallback); + else + nextTick( + callback.bind( + this, + Error( + "Illegal arguments: " + typeof password + ", " + typeof salt, + ), + ), + ); + } + if (callback) { + if (typeof callback !== "function") + throw Error("Illegal callback: " + typeof callback); + _async(callback); + } else + return new Promise(function (resolve, reject) { + _async(function (err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); + } + + /** + * Compares two strings of the same length in constant time. + * @param {string} known Must be of the correct length + * @param {string} unknown Must be the same length as `known` + * @returns {boolean} + * @inner + */ + function safeStringCompare(known, unknown) { + var diff = known.length ^ unknown.length; + for (var i = 0; i < known.length; ++i) { + diff |= known.charCodeAt(i) ^ unknown.charCodeAt(i); + } + return diff === 0; + } + + /** + * Synchronously tests a password against a hash. + * @param {string} password Password to compare + * @param {string} hash Hash to test against + * @returns {boolean} true if matching, otherwise false + * @throws {Error} If an argument is illegal + */ + function compareSync(password, hash) { + if (typeof password !== "string" || typeof hash !== "string") + throw Error( + "Illegal arguments: " + typeof password + ", " + typeof hash, + ); + if (hash.length !== 60) return false; + return safeStringCompare( + hashSync(password, hash.substring(0, hash.length - 31)), + hash, + ); + } + + /** + * Asynchronously tests a password against a hash. + * @param {string} password Password to compare + * @param {string} hashValue Hash to test against + * @param {function(Error, boolean)=} callback Callback receiving the error, if any, otherwise the result + * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed + * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. + * @returns {!Promise} If `callback` has been omitted + * @throws {Error} If `callback` is present but not a function + */ + function compare(password, hashValue, callback, progressCallback) { + function _async(callback) { + if (typeof password !== "string" || typeof hashValue !== "string") { + nextTick( + callback.bind( + this, + Error( + "Illegal arguments: " + + typeof password + + ", " + + typeof hashValue, + ), + ), + ); + return; + } + if (hashValue.length !== 60) { + nextTick(callback.bind(this, null, false)); + return; + } + hash( + password, + hashValue.substring(0, 29), + function (err, comp) { + if (err) callback(err); + else callback(null, safeStringCompare(comp, hashValue)); + }, + progressCallback, + ); + } + if (callback) { + if (typeof callback !== "function") + throw Error("Illegal callback: " + typeof callback); + _async(callback); + } else + return new Promise(function (resolve, reject) { + _async(function (err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); + } + + /** + * Gets the number of rounds used to encrypt the specified hash. + * @param {string} hash Hash to extract the used number of rounds from + * @returns {number} Number of rounds used + * @throws {Error} If `hash` is not a string + */ + function getRounds(hash) { + if (typeof hash !== "string") + throw Error("Illegal arguments: " + typeof hash); + return parseInt(hash.split("$")[2], 10); + } + + /** + * Gets the salt portion from a hash. Does not validate the hash. + * @param {string} hash Hash to extract the salt from + * @returns {string} Extracted salt part + * @throws {Error} If `hash` is not a string or otherwise invalid + */ + function getSalt(hash) { + if (typeof hash !== "string") + throw Error("Illegal arguments: " + typeof hash); + if (hash.length !== 60) + throw Error("Illegal hash length: " + hash.length + " != 60"); + return hash.substring(0, 29); + } + + /** + * Tests if a password will be truncated when hashed, that is its length is + * greater than 72 bytes when converted to UTF-8. + * @param {string} password The password to test + * @returns {boolean} `true` if truncated, otherwise `false` + */ + function truncates(password) { + if (typeof password !== "string") + throw Error("Illegal arguments: " + typeof password); + return utf8Length(password) > 72; + } + + /** + * Continues with the callback on the next tick. + * @function + * @param {function(...[*])} callback Callback to execute + * @inner + */ + var nextTick = + typeof process !== "undefined" && + process && + typeof process.nextTick === "function" + ? typeof setImmediate === "function" + ? setImmediate + : process.nextTick + : setTimeout; + + /** Calculates the byte length of a string encoded as UTF8. */ + function utf8Length(string) { + var len = 0, + c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ( + (c & 0xfc00) === 0xd800 && + (string.charCodeAt(i + 1) & 0xfc00) === 0xdc00 + ) { + ++i; + len += 4; + } else len += 3; + } + return len; + } + + /** Converts a string to an array of UTF8 bytes. */ + function utf8Array(string) { + var offset = 0, + c1, + c2; + var buffer = new Array(utf8Length(string)); + for (var i = 0, k = string.length; i < k; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = (c1 >> 6) | 192; + buffer[offset++] = (c1 & 63) | 128; + } else if ( + (c1 & 0xfc00) === 0xd800 && + ((c2 = string.charCodeAt(i + 1)) & 0xfc00) === 0xdc00 + ) { + c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff); + ++i; + buffer[offset++] = (c1 >> 18) | 240; + buffer[offset++] = ((c1 >> 12) & 63) | 128; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } else { + buffer[offset++] = (c1 >> 12) | 224; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } + } + return buffer; + } + + // A base64 implementation for the bcrypt algorithm. This is partly non-standard. + + /** + * bcrypt's own non-standard base64 dictionary. + * @type {!Array.} + * @const + * @inner + **/ + var BASE64_CODE = + "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split( + "", + ); + + /** + * @type {!Array.} + * @const + * @inner + **/ + var BASE64_INDEX = [ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, + -1, -1, -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1, + ]; + + /** + * Encodes a byte array to base64 with up to len bytes of input. + * @param {!Array.} b Byte array + * @param {number} len Maximum input length + * @returns {string} + * @inner + */ + function base64_encode(b, len) { + var off = 0, + rs = [], + c1, + c2; + if (len <= 0 || len > b.length) throw Error("Illegal len: " + len); + while (off < len) { + c1 = b[off++] & 0xff; + rs.push(BASE64_CODE[(c1 >> 2) & 0x3f]); + c1 = (c1 & 0x03) << 4; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 0x3f]); + break; + } + c2 = b[off++] & 0xff; + c1 |= (c2 >> 4) & 0x0f; + rs.push(BASE64_CODE[c1 & 0x3f]); + c1 = (c2 & 0x0f) << 2; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 0x3f]); + break; + } + c2 = b[off++] & 0xff; + c1 |= (c2 >> 6) & 0x03; + rs.push(BASE64_CODE[c1 & 0x3f]); + rs.push(BASE64_CODE[c2 & 0x3f]); + } + return rs.join(""); + } + + /** + * Decodes a base64 encoded string to up to len bytes of output. + * @param {string} s String to decode + * @param {number} len Maximum output length + * @returns {!Array.} + * @inner + */ + function base64_decode(s, len) { + var off = 0, + slen = s.length, + olen = 0, + rs = [], + c1, + c2, + c3, + c4, + o, + code; + if (len <= 0) throw Error("Illegal len: " + len); + while (off < slen - 1 && olen < len) { + code = s.charCodeAt(off++); + c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + code = s.charCodeAt(off++); + c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c1 == -1 || c2 == -1) break; + o = (c1 << 2) >>> 0; + o |= (c2 & 0x30) >> 4; + rs.push(String.fromCharCode(o)); + if (++olen >= len || off >= slen) break; + code = s.charCodeAt(off++); + c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c3 == -1) break; + o = ((c2 & 0x0f) << 4) >>> 0; + o |= (c3 & 0x3c) >> 2; + rs.push(String.fromCharCode(o)); + if (++olen >= len || off >= slen) break; + code = s.charCodeAt(off++); + c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + o = ((c3 & 0x03) << 6) >>> 0; + o |= c4; + rs.push(String.fromCharCode(o)); + ++olen; + } + var res = []; + for (off = 0; off < olen; off++) res.push(rs[off].charCodeAt(0)); + return res; + } + + /** + * @type {number} + * @const + * @inner + */ + var BCRYPT_SALT_LEN = 16; + + /** + * @type {number} + * @const + * @inner + */ + var GENSALT_DEFAULT_LOG2_ROUNDS = 10; + + /** + * @type {number} + * @const + * @inner + */ + var BLOWFISH_NUM_ROUNDS = 16; + + /** + * @type {number} + * @const + * @inner + */ + var MAX_EXECUTION_TIME = 100; + + /** + * @type {Array.} + * @const + * @inner + */ + var P_ORIG = [ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, + 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b, + ]; + + /** + * @type {Array.} + * @const + * @inner + */ + var S_ORIG = [ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, + 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, + 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, + 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, + 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, + 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, + 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, + 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, + 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, + 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, + 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, + 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, + 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, + 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, + 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, + 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, + 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, + 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, + 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, + 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, + 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, + 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, 0x4b7a70e9, 0xb5b32944, + 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, + 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, + 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, + 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, + 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, + 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, + 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, + 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, + 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, + 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, 0x94e2ea78, + 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, + 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, 0x1521b628, 0x29076170, + 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, + 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, + 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, + 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, + 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, + 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, + 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, + 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, + 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, + 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, + 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, + 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, + 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, + 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, + 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, + 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, + 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, + 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, + 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, + 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, + 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, + 0x12754ccc, 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, + 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, + 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, + 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, + 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, + 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, + 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, + 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, + 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, + 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, + 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, + 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, + 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, + 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, + 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, + 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, + 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5, + 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, + 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, + 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, + 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, + 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, + 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, + 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, + 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, + 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, + 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623, + 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, + 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3, + 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, + 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, + ]; + + /** + * @type {Array.} + * @const + * @inner + */ + var C_ORIG = [ + 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, 0x6f756274, + ]; + + /** + * @param {Array.} lr + * @param {number} off + * @param {Array.} P + * @param {Array.} S + * @returns {Array.} + * @inner + */ + function _encipher(lr, off, P, S) { + // This is our bottleneck: 1714/1905 ticks / 90% - see profile.txt + var n, + l = lr[off], + r = lr[off + 1]; + l ^= P[0]; + + /* + for (var i=0, k=BLOWFISH_NUM_ROUNDS-2; i<=k;) + // Feistel substitution on left word + n = S[l >>> 24], + n += S[0x100 | ((l >> 16) & 0xff)], + n ^= S[0x200 | ((l >> 8) & 0xff)], + n += S[0x300 | (l & 0xff)], + r ^= n ^ P[++i], + // Feistel substitution on right word + n = S[r >>> 24], + n += S[0x100 | ((r >> 16) & 0xff)], + n ^= S[0x200 | ((r >> 8) & 0xff)], + n += S[0x300 | (r & 0xff)], + l ^= n ^ P[++i]; + */ + + //The following is an unrolled version of the above loop. + //Iteration 0 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[1]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[2]; + //Iteration 1 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[3]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[4]; + //Iteration 2 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[5]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[6]; + //Iteration 3 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[7]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[8]; + //Iteration 4 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[9]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[10]; + //Iteration 5 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[11]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[12]; + //Iteration 6 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[13]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[14]; + //Iteration 7 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[15]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[16]; + lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; + lr[off + 1] = l; + return lr; + } + + /** + * @param {Array.} data + * @param {number} offp + * @returns {{key: number, offp: number}} + * @inner + */ + function _streamtoword(data, offp) { + for (var i = 0, word = 0; i < 4; ++i) + (word = (word << 8) | (data[offp] & 0xff)), + (offp = (offp + 1) % data.length); + return { + key: word, + offp: offp, + }; + } + + /** + * @param {Array.} key + * @param {Array.} P + * @param {Array.} S + * @inner + */ + function _key(key, P, S) { + var offset = 0, + lr = [0, 0], + plen = P.length, + slen = S.length, + sw; + for (var i = 0; i < plen; i++) + (sw = _streamtoword(key, offset)), + (offset = sw.offp), + (P[i] = P[i] ^ sw.key); + for (i = 0; i < plen; i += 2) + (lr = _encipher(lr, 0, P, S)), (P[i] = lr[0]), (P[i + 1] = lr[1]); + for (i = 0; i < slen; i += 2) + (lr = _encipher(lr, 0, P, S)), (S[i] = lr[0]), (S[i + 1] = lr[1]); + } + + /** + * Expensive key schedule Blowfish. + * @param {Array.} data + * @param {Array.} key + * @param {Array.} P + * @param {Array.} S + * @inner + */ + function _ekskey(data, key, P, S) { + var offp = 0, + lr = [0, 0], + plen = P.length, + slen = S.length, + sw; + for (var i = 0; i < plen; i++) + (sw = _streamtoword(key, offp)), + (offp = sw.offp), + (P[i] = P[i] ^ sw.key); + offp = 0; + for (i = 0; i < plen; i += 2) + (sw = _streamtoword(data, offp)), + (offp = sw.offp), + (lr[0] ^= sw.key), + (sw = _streamtoword(data, offp)), + (offp = sw.offp), + (lr[1] ^= sw.key), + (lr = _encipher(lr, 0, P, S)), + (P[i] = lr[0]), + (P[i + 1] = lr[1]); + for (i = 0; i < slen; i += 2) + (sw = _streamtoword(data, offp)), + (offp = sw.offp), + (lr[0] ^= sw.key), + (sw = _streamtoword(data, offp)), + (offp = sw.offp), + (lr[1] ^= sw.key), + (lr = _encipher(lr, 0, P, S)), + (S[i] = lr[0]), + (S[i + 1] = lr[1]); + } + + /** + * Internaly crypts a string. + * @param {Array.} b Bytes to crypt + * @param {Array.} salt Salt bytes to use + * @param {number} rounds Number of rounds + * @param {function(Error, Array.=)=} callback Callback receiving the error, if any, and the resulting bytes. If + * omitted, the operation will be performed synchronously. + * @param {function(number)=} progressCallback Callback called with the current progress + * @returns {!Array.|undefined} Resulting bytes if callback has been omitted, otherwise `undefined` + * @inner + */ + function _crypt(b, salt, rounds, callback, progressCallback) { + var cdata = C_ORIG.slice(), + clen = cdata.length, + err; + + // Validate + if (rounds < 4 || rounds > 31) { + err = Error("Illegal number of rounds (4-31): " + rounds); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + if (salt.length !== BCRYPT_SALT_LEN) { + err = Error( + "Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN, + ); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + rounds = (1 << rounds) >>> 0; + var P, + S, + i = 0, + j; + + //Use typed arrays when available - huge speedup! + if (typeof Int32Array === "function") { + P = new Int32Array(P_ORIG); + S = new Int32Array(S_ORIG); + } else { + P = P_ORIG.slice(); + S = S_ORIG.slice(); + } + _ekskey(salt, b, P, S); + + /** + * Calcualtes the next round. + * @returns {Array.|undefined} Resulting array if callback has been omitted, otherwise `undefined` + * @inner + */ + function next() { + if (progressCallback) progressCallback(i / rounds); + if (i < rounds) { + var start = Date.now(); + for (; i < rounds; ) { + i = i + 1; + _key(b, P, S); + _key(salt, P, S); + if (Date.now() - start > MAX_EXECUTION_TIME) break; + } + } else { + for (i = 0; i < 64; i++) + for (j = 0; j < clen >> 1; j++) _encipher(cdata, j << 1, P, S); + var ret = []; + for (i = 0; i < clen; i++) + ret.push(((cdata[i] >> 24) & 0xff) >>> 0), + ret.push(((cdata[i] >> 16) & 0xff) >>> 0), + ret.push(((cdata[i] >> 8) & 0xff) >>> 0), + ret.push((cdata[i] & 0xff) >>> 0); + if (callback) { + callback(null, ret); + return; + } else return ret; + } + if (callback) nextTick(next); + } + + // Async + if (typeof callback !== "undefined") { + next(); + + // Sync + } else { + var res; + while (true) + if (typeof (res = next()) !== "undefined") return res || []; + } + } + + /** + * Internally hashes a password. + * @param {string} password Password to hash + * @param {?string} salt Salt to use, actually never null + * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash. If omitted, + * hashing is performed synchronously. + * @param {function(number)=} progressCallback Callback called with the current progress + * @returns {string|undefined} Resulting hash if callback has been omitted, otherwise `undefined` + * @inner + */ + function _hash(password, salt, callback, progressCallback) { + var err; + if (typeof password !== "string" || typeof salt !== "string") { + err = Error("Invalid string / salt: Not a string"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + + // Validate the salt + var minor, offset; + if (salt.charAt(0) !== "$" || salt.charAt(1) !== "2") { + err = Error("Invalid salt version: " + salt.substring(0, 2)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + if (salt.charAt(2) === "$") + (minor = String.fromCharCode(0)), (offset = 3); + else { + minor = salt.charAt(2); + if ( + (minor !== "a" && minor !== "b" && minor !== "y") || + salt.charAt(3) !== "$" + ) { + err = Error("Invalid salt revision: " + salt.substring(2, 4)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + offset = 4; + } + + // Extract number of rounds + if (salt.charAt(offset + 2) > "$") { + err = Error("Missing salt rounds"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, + r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), + rounds = r1 + r2, + real_salt = salt.substring(offset + 3, offset + 25); + password += minor >= "a" ? "\x00" : ""; + var passwordb = utf8Array(password), + saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); + + /** + * Finishes hashing. + * @param {Array.} bytes Byte array + * @returns {string} + * @inner + */ + function finish(bytes) { + var res = []; + res.push("$2"); + if (minor >= "a") res.push(minor); + res.push("$"); + if (rounds < 10) res.push("0"); + res.push(rounds.toString()); + res.push("$"); + res.push(base64_encode(saltb, saltb.length)); + res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); + return res.join(""); + } + + // Sync + if (typeof callback == "undefined") + return finish(_crypt(passwordb, saltb, rounds)); + // Async + else { + _crypt( + passwordb, + saltb, + rounds, + function (err, bytes) { + if (err) callback(err, null); + else callback(null, finish(bytes)); + }, + progressCallback, + ); + } + } + + /** + * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet. + * @function + * @param {!Array.} bytes Byte array + * @param {number} length Maximum input length + * @returns {string} + */ + function encodeBase64(bytes, length) { + return base64_encode(bytes, length); + } + + /** + * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. + * @function + * @param {string} string String to decode + * @param {number} length Maximum output length + * @returns {!Array.} + */ + function decodeBase64(string, length) { + return base64_decode(string, length); + } + var _default = (_exports.default = { + setRandomFallback, + genSaltSync, + genSalt, + hashSync, + hash, + compareSync, + compare, + getRounds, + getSalt, + truncates, + encodeBase64, + decodeBase64, + }); + }, +); diff --git a/node_modules/bcryptjs/umd/package.json b/node_modules/bcryptjs/umd/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/bcryptjs/umd/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/bcryptjs/umd/types.d.ts b/node_modules/bcryptjs/umd/types.d.ts new file mode 100644 index 0000000..3cbe5b1 --- /dev/null +++ b/node_modules/bcryptjs/umd/types.d.ts @@ -0,0 +1,157 @@ +// Originally imported from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/8b36dbdf95b624b8a7cd7f8416f06c15d274f9e6/types/bcryptjs/index.d.ts +// MIT license. + +/** Called with an error on failure or a value of type `T` upon success. */ +type Callback = (err: Error | null, result?: T) => void; +/** Called with the percentage of rounds completed (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. */ +type ProgressCallback = (percentage: number) => void; +/** Called to obtain random bytes when both Web Crypto API and Node.js crypto are not available. */ +type RandomFallback = (length: number) => number[]; + +/** + * Sets the pseudo random number generator to use as a fallback if neither node's crypto module nor the Web Crypto API is available. + * Please note: It is highly important that the PRNG used is cryptographically secure and that it is seeded properly! + * @param random Function taking the number of bytes to generate as its sole argument, returning the corresponding array of cryptographically secure random byte values. + */ +export declare function setRandomFallback(random: RandomFallback): void; + +/** + * Synchronously generates a salt. + * @param rounds Number of rounds to use, defaults to 10 if omitted + * @return Resulting salt + * @throws If a random fallback is required but not set + */ +export declare function genSaltSync(rounds?: number): string; + +/** + * Asynchronously generates a salt. + * @param rounds Number of rounds to use, defaults to 10 if omitted + * @return Promise with resulting salt, if callback has been omitted + */ +export declare function genSalt(rounds?: number): Promise; + +/** + * Asynchronously generates a salt. + * @param callback Callback receiving the error, if any, and the resulting salt + */ +export declare function genSalt(callback: Callback): void; + +/** + * Asynchronously generates a salt. + * @param rounds Number of rounds to use, defaults to 10 if omitted + * @param callback Callback receiving the error, if any, and the resulting salt + */ +export declare function genSalt( + rounds: number, + callback: Callback, +): void; + +/** + * Synchronously generates a hash for the given password. + * @param password Password to hash + * @param salt Salt length to generate or salt to use, default to 10 + * @return Resulting hash + */ +export declare function hashSync( + password: string, + salt?: number | string, +): string; + +/** + * Asynchronously generates a hash for the given password. + * @param password Password to hash + * @param salt Salt length to generate or salt to use + * @return Promise with resulting hash, if callback has been omitted + */ +export declare function hash( + password: string, + salt: number | string, +): Promise; + +/** + * Asynchronously generates a hash for the given password. + * @param password Password to hash + * @param salt Salt length to generate or salt to use + * @param callback Callback receiving the error, if any, and the resulting hash + * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. + */ +export declare function hash( + password: string, + salt: number | string, + callback?: Callback, + progressCallback?: ProgressCallback, +): void; + +/** + * Synchronously tests a password against a hash. + * @param password Password to test + * @param hash Hash to test against + * @return true if matching, otherwise false + */ +export declare function compareSync(password: string, hash: string): boolean; + +/** + * Asynchronously tests a password against a hash. + * @param password Password to test + * @param hash Hash to test against + * @return Promise, if callback has been omitted + */ +export declare function compare( + password: string, + hash: string, +): Promise; + +/** + * Asynchronously tests a password against a hash. + * @param password Password to test + * @param hash Hash to test against + * @param callback Callback receiving the error, if any, otherwise the result + * @param progressCallback Callback successively called with the percentage of rounds completed (0.0 - 1.0), maximally once per MAX_EXECUTION_TIME = 100 ms. + */ +export declare function compare( + password: string, + hash: string, + callback?: Callback, + progressCallback?: ProgressCallback, +): void; + +/** + * Gets the number of rounds used to encrypt the specified hash. + * @param hash Hash to extract the used number of rounds from + * @return Number of rounds used + */ +export declare function getRounds(hash: string): number; + +/** + * Gets the salt portion from a hash. Does not validate the hash. + * @param hash Hash to extract the salt from + * @return Extracted salt part + */ +export declare function getSalt(hash: string): string; + +/** + * Tests if a password will be truncated when hashed, that is its length is + * greater than 72 bytes when converted to UTF-8. + * @param password The password to test + * @returns `true` if truncated, otherwise `false` + */ +export declare function truncates(password: string): boolean; + +/** + * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet. + * @function + * @param b Byte array + * @param len Maximum input length + */ +export declare function encodeBase64( + b: Readonly>, + len: number, +): string; + +/** + * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. + * @function + * @param s String to decode + * @param len Maximum output length + */ +export declare function decodeBase64(s: string, len: number): number[]; diff --git a/node_modules/denque/CHANGELOG.md b/node_modules/denque/CHANGELOG.md new file mode 100644 index 0000000..391a1f5 --- /dev/null +++ b/node_modules/denque/CHANGELOG.md @@ -0,0 +1,29 @@ +## 2.1.0 + + - fix: issue where `clear()` is still keeping references to the elements (#47) + - refactor: performance optimizations for growth and array copy (#43) + - refactor: performance optimizations for toArray and fromArray (#46) + - test: add additional benchmarks for queue growth and `toArray` (#45) + +## 2.0.1 + + - fix(types): incorrect return type on `size()` + +## 2.0.0 + + - fix!: `push` & `unshift` now accept `undefined` values to match behaviour of `Array` (fixes #25) (#35) + - This is only a **BREAKING** change if you are currently expecting `push(undefined)` and `unshift(undefined)` to do + nothing - the new behaviour now correctly adds undefined values to the queue. + - **Note**: behaviour of `push()` & `unshift()` (no arguments) remains unchanged (nothing gets added to the queue). + - **Note**: If you need to differentiate between `undefined` values in the queue and the return value of `pop()` then + check the queue `.length` before popping. + - fix: incorrect methods in types definition file + +## 1.5.1 + + - perf: minor performance tweak when growing queue size (#29) + +## 1.5.0 + + - feat: adds capacity option for circular buffers (#27) + diff --git a/node_modules/denque/LICENSE b/node_modules/denque/LICENSE new file mode 100644 index 0000000..c9cde92 --- /dev/null +++ b/node_modules/denque/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-present Invertase Limited + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/denque/README.md b/node_modules/denque/README.md new file mode 100644 index 0000000..3c645d3 --- /dev/null +++ b/node_modules/denque/README.md @@ -0,0 +1,77 @@ +

+

Denque

+

+ +

+ NPM downloads + NPM version + Tests status + Coverage + License + Follow on Twitter +

+ +Denque is a well tested, extremely fast and lightweight [double-ended queue](http://en.wikipedia.org/wiki/Double-ended_queue) +implementation with zero dependencies and includes TypeScript types. + +Double-ended queues can also be used as a: + +- [Stack](http://en.wikipedia.org/wiki/Stack_\(abstract_data_type\)) +- [Queue](http://en.wikipedia.org/wiki/Queue_\(data_structure\)) + +This implementation is currently the fastest available, even faster than `double-ended-queue`, see the [benchmarks](https://docs.page/invertase/denque/benchmarks). + +Every queue operation is done at a constant `O(1)` - including random access from `.peekAt(index)`. + +**Works on all node versions >= v0.10** + +## Quick Start + +Install the package: + +```bash +npm install denque +``` + +Create and consume a queue: + +```js +const Denque = require("denque"); + +const denque = new Denque([1,2,3,4]); +denque.shift(); // 1 +denque.pop(); // 4 +``` + + +See the [API reference documentation](https://docs.page/invertase/denque/api) for more examples. + +--- + +## Who's using it? + +- [Kafka Node.js client](https://www.npmjs.com/package/kafka-node) +- [MariaDB Node.js client](https://www.npmjs.com/package/mariadb) +- [MongoDB Node.js client](https://www.npmjs.com/package/mongodb) +- [MySQL Node.js client](https://www.npmjs.com/package/mysql2) +- [Redis Node.js clients](https://www.npmjs.com/package/redis) + +... and [many more](https://www.npmjs.com/browse/depended/denque). + + +--- + +## License + +- See [LICENSE](/LICENSE) + +--- + +

+ + + +

+ Built and maintained by Invertase. +

+

diff --git a/node_modules/denque/index.d.ts b/node_modules/denque/index.d.ts new file mode 100644 index 0000000..e125dd4 --- /dev/null +++ b/node_modules/denque/index.d.ts @@ -0,0 +1,47 @@ +declare class Denque { + length: number; + + constructor(); + + constructor(array: T[]); + + constructor(array: T[], options: IDenqueOptions); + + push(item: T): number; + + unshift(item: T): number; + + pop(): T | undefined; + + shift(): T | undefined; + + peekBack(): T | undefined; + + peekFront(): T | undefined; + + peekAt(index: number): T | undefined; + + get(index: number): T | undefined; + + remove(index: number, count: number): T[]; + + removeOne(index: number): T | undefined; + + splice(index: number, count: number, ...item: T[]): T[] | undefined; + + isEmpty(): boolean; + + clear(): void; + + size(): number; + + toString(): string; + + toArray(): T[]; +} + +interface IDenqueOptions { + capacity?: number +} + +export = Denque; diff --git a/node_modules/denque/index.js b/node_modules/denque/index.js new file mode 100644 index 0000000..6b2e9d8 --- /dev/null +++ b/node_modules/denque/index.js @@ -0,0 +1,481 @@ +'use strict'; + +/** + * Custom implementation of a double ended queue. + */ +function Denque(array, options) { + var options = options || {}; + this._capacity = options.capacity; + + this._head = 0; + this._tail = 0; + + if (Array.isArray(array)) { + this._fromArray(array); + } else { + this._capacityMask = 0x3; + this._list = new Array(4); + } +} + +/** + * -------------- + * PUBLIC API + * ------------- + */ + +/** + * Returns the item at the specified index from the list. + * 0 is the first element, 1 is the second, and so on... + * Elements at negative values are that many from the end: -1 is one before the end + * (the last element), -2 is two before the end (one before last), etc. + * @param index + * @returns {*} + */ +Denque.prototype.peekAt = function peekAt(index) { + var i = index; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + var len = this.size(); + if (i >= len || i < -len) return undefined; + if (i < 0) i += len; + i = (this._head + i) & this._capacityMask; + return this._list[i]; +}; + +/** + * Alias for peekAt() + * @param i + * @returns {*} + */ +Denque.prototype.get = function get(i) { + return this.peekAt(i); +}; + +/** + * Returns the first item in the list without removing it. + * @returns {*} + */ +Denque.prototype.peek = function peek() { + if (this._head === this._tail) return undefined; + return this._list[this._head]; +}; + +/** + * Alias for peek() + * @returns {*} + */ +Denque.prototype.peekFront = function peekFront() { + return this.peek(); +}; + +/** + * Returns the item that is at the back of the queue without removing it. + * Uses peekAt(-1) + */ +Denque.prototype.peekBack = function peekBack() { + return this.peekAt(-1); +}; + +/** + * Returns the current length of the queue + * @return {Number} + */ +Object.defineProperty(Denque.prototype, 'length', { + get: function length() { + return this.size(); + } +}); + +/** + * Return the number of items on the list, or 0 if empty. + * @returns {number} + */ +Denque.prototype.size = function size() { + if (this._head === this._tail) return 0; + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); +}; + +/** + * Add an item at the beginning of the list. + * @param item + */ +Denque.prototype.unshift = function unshift(item) { + if (arguments.length === 0) return this.size(); + var len = this._list.length; + this._head = (this._head - 1 + len) & this._capacityMask; + this._list[this._head] = item; + if (this._tail === this._head) this._growArray(); + if (this._capacity && this.size() > this._capacity) this.pop(); + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); +}; + +/** + * Remove and return the first item on the list, + * Returns undefined if the list is empty. + * @returns {*} + */ +Denque.prototype.shift = function shift() { + var head = this._head; + if (head === this._tail) return undefined; + var item = this._list[head]; + this._list[head] = undefined; + this._head = (head + 1) & this._capacityMask; + if (head < 2 && this._tail > 10000 && this._tail <= this._list.length >>> 2) this._shrinkArray(); + return item; +}; + +/** + * Add an item to the bottom of the list. + * @param item + */ +Denque.prototype.push = function push(item) { + if (arguments.length === 0) return this.size(); + var tail = this._tail; + this._list[tail] = item; + this._tail = (tail + 1) & this._capacityMask; + if (this._tail === this._head) { + this._growArray(); + } + if (this._capacity && this.size() > this._capacity) { + this.shift(); + } + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); +}; + +/** + * Remove and return the last item on the list. + * Returns undefined if the list is empty. + * @returns {*} + */ +Denque.prototype.pop = function pop() { + var tail = this._tail; + if (tail === this._head) return undefined; + var len = this._list.length; + this._tail = (tail - 1 + len) & this._capacityMask; + var item = this._list[this._tail]; + this._list[this._tail] = undefined; + if (this._head < 2 && tail > 10000 && tail <= len >>> 2) this._shrinkArray(); + return item; +}; + +/** + * Remove and return the item at the specified index from the list. + * Returns undefined if the list is empty. + * @param index + * @returns {*} + */ +Denque.prototype.removeOne = function removeOne(index) { + var i = index; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + if (this._head === this._tail) return void 0; + var size = this.size(); + var len = this._list.length; + if (i >= size || i < -size) return void 0; + if (i < 0) i += size; + i = (this._head + i) & this._capacityMask; + var item = this._list[i]; + var k; + if (index < size / 2) { + for (k = index; k > 0; k--) { + this._list[i] = this._list[i = (i - 1 + len) & this._capacityMask]; + } + this._list[i] = void 0; + this._head = (this._head + 1 + len) & this._capacityMask; + } else { + for (k = size - 1 - index; k > 0; k--) { + this._list[i] = this._list[i = (i + 1 + len) & this._capacityMask]; + } + this._list[i] = void 0; + this._tail = (this._tail - 1 + len) & this._capacityMask; + } + return item; +}; + +/** + * Remove number of items from the specified index from the list. + * Returns array of removed items. + * Returns undefined if the list is empty. + * @param index + * @param count + * @returns {array} + */ +Denque.prototype.remove = function remove(index, count) { + var i = index; + var removed; + var del_count = count; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + if (this._head === this._tail) return void 0; + var size = this.size(); + var len = this._list.length; + if (i >= size || i < -size || count < 1) return void 0; + if (i < 0) i += size; + if (count === 1 || !count) { + removed = new Array(1); + removed[0] = this.removeOne(i); + return removed; + } + if (i === 0 && i + count >= size) { + removed = this.toArray(); + this.clear(); + return removed; + } + if (i + count > size) count = size - i; + var k; + removed = new Array(count); + for (k = 0; k < count; k++) { + removed[k] = this._list[(this._head + i + k) & this._capacityMask]; + } + i = (this._head + i) & this._capacityMask; + if (index + count === size) { + this._tail = (this._tail - count + len) & this._capacityMask; + for (k = count; k > 0; k--) { + this._list[i = (i + 1 + len) & this._capacityMask] = void 0; + } + return removed; + } + if (index === 0) { + this._head = (this._head + count + len) & this._capacityMask; + for (k = count - 1; k > 0; k--) { + this._list[i = (i + 1 + len) & this._capacityMask] = void 0; + } + return removed; + } + if (i < size / 2) { + this._head = (this._head + index + count + len) & this._capacityMask; + for (k = index; k > 0; k--) { + this.unshift(this._list[i = (i - 1 + len) & this._capacityMask]); + } + i = (this._head - 1 + len) & this._capacityMask; + while (del_count > 0) { + this._list[i = (i - 1 + len) & this._capacityMask] = void 0; + del_count--; + } + if (index < 0) this._tail = i; + } else { + this._tail = i; + i = (i + count + len) & this._capacityMask; + for (k = size - (count + index); k > 0; k--) { + this.push(this._list[i++]); + } + i = this._tail; + while (del_count > 0) { + this._list[i = (i + 1 + len) & this._capacityMask] = void 0; + del_count--; + } + } + if (this._head < 2 && this._tail > 10000 && this._tail <= len >>> 2) this._shrinkArray(); + return removed; +}; + +/** + * Native splice implementation. + * Remove number of items from the specified index from the list and/or add new elements. + * Returns array of removed items or empty array if count == 0. + * Returns undefined if the list is empty. + * + * @param index + * @param count + * @param {...*} [elements] + * @returns {array} + */ +Denque.prototype.splice = function splice(index, count) { + var i = index; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + var size = this.size(); + if (i < 0) i += size; + if (i > size) return void 0; + if (arguments.length > 2) { + var k; + var temp; + var removed; + var arg_len = arguments.length; + var len = this._list.length; + var arguments_index = 2; + if (!size || i < size / 2) { + temp = new Array(i); + for (k = 0; k < i; k++) { + temp[k] = this._list[(this._head + k) & this._capacityMask]; + } + if (count === 0) { + removed = []; + if (i > 0) { + this._head = (this._head + i + len) & this._capacityMask; + } + } else { + removed = this.remove(i, count); + this._head = (this._head + i + len) & this._capacityMask; + } + while (arg_len > arguments_index) { + this.unshift(arguments[--arg_len]); + } + for (k = i; k > 0; k--) { + this.unshift(temp[k - 1]); + } + } else { + temp = new Array(size - (i + count)); + var leng = temp.length; + for (k = 0; k < leng; k++) { + temp[k] = this._list[(this._head + i + count + k) & this._capacityMask]; + } + if (count === 0) { + removed = []; + if (i != size) { + this._tail = (this._head + i + len) & this._capacityMask; + } + } else { + removed = this.remove(i, count); + this._tail = (this._tail - leng + len) & this._capacityMask; + } + while (arguments_index < arg_len) { + this.push(arguments[arguments_index++]); + } + for (k = 0; k < leng; k++) { + this.push(temp[k]); + } + } + return removed; + } else { + return this.remove(i, count); + } +}; + +/** + * Soft clear - does not reset capacity. + */ +Denque.prototype.clear = function clear() { + this._list = new Array(this._list.length); + this._head = 0; + this._tail = 0; +}; + +/** + * Returns true or false whether the list is empty. + * @returns {boolean} + */ +Denque.prototype.isEmpty = function isEmpty() { + return this._head === this._tail; +}; + +/** + * Returns an array of all queue items. + * @returns {Array} + */ +Denque.prototype.toArray = function toArray() { + return this._copyArray(false); +}; + +/** + * ------------- + * INTERNALS + * ------------- + */ + +/** + * Fills the queue with items from an array + * For use in the constructor + * @param array + * @private + */ +Denque.prototype._fromArray = function _fromArray(array) { + var length = array.length; + var capacity = this._nextPowerOf2(length); + + this._list = new Array(capacity); + this._capacityMask = capacity - 1; + this._tail = length; + + for (var i = 0; i < length; i++) this._list[i] = array[i]; +}; + +/** + * + * @param fullCopy + * @param size Initialize the array with a specific size. Will default to the current list size + * @returns {Array} + * @private + */ +Denque.prototype._copyArray = function _copyArray(fullCopy, size) { + var src = this._list; + var capacity = src.length; + var length = this.length; + size = size | length; + + // No prealloc requested and the buffer is contiguous + if (size == length && this._head < this._tail) { + // Simply do a fast slice copy + return this._list.slice(this._head, this._tail); + } + + var dest = new Array(size); + + var k = 0; + var i; + if (fullCopy || this._head > this._tail) { + for (i = this._head; i < capacity; i++) dest[k++] = src[i]; + for (i = 0; i < this._tail; i++) dest[k++] = src[i]; + } else { + for (i = this._head; i < this._tail; i++) dest[k++] = src[i]; + } + + return dest; +} + +/** + * Grows the internal list array. + * @private + */ +Denque.prototype._growArray = function _growArray() { + if (this._head != 0) { + // double array size and copy existing data, head to end, then beginning to tail. + var newList = this._copyArray(true, this._list.length << 1); + + this._tail = this._list.length; + this._head = 0; + + this._list = newList; + } else { + this._tail = this._list.length; + this._list.length <<= 1; + } + + this._capacityMask = (this._capacityMask << 1) | 1; +}; + +/** + * Shrinks the internal list array. + * @private + */ +Denque.prototype._shrinkArray = function _shrinkArray() { + this._list.length >>>= 1; + this._capacityMask >>>= 1; +}; + +/** + * Find the next power of 2, at least 4 + * @private + * @param {number} num + * @returns {number} + */ +Denque.prototype._nextPowerOf2 = function _nextPowerOf2(num) { + var log2 = Math.log(num) / Math.log(2); + var nextPow2 = 1 << (log2 + 1); + + return Math.max(nextPow2, 4); +} + +module.exports = Denque; diff --git a/node_modules/denque/package.json b/node_modules/denque/package.json new file mode 100644 index 0000000..a635910 --- /dev/null +++ b/node_modules/denque/package.json @@ -0,0 +1,58 @@ +{ + "name": "denque", + "version": "2.1.0", + "description": "The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries. Maintains compatability with deque.", + "main": "index.js", + "engines": { + "node": ">=0.10" + }, + "keywords": [ + "data-structure", + "data-structures", + "queue", + "double", + "end", + "ended", + "deque", + "denque", + "double-ended-queue" + ], + "scripts": { + "test": "istanbul cover --report lcov _mocha && npm run typescript", + "coveralls": "cat ./coverage/lcov.info | coveralls", + "typescript": "tsc --project ./test/type/tsconfig.json", + "benchmark_thousand": "node benchmark/thousand", + "benchmark_2mil": "node benchmark/two_million", + "benchmark_splice": "node benchmark/splice", + "benchmark_remove": "node benchmark/remove", + "benchmark_removeOne": "node benchmark/removeOne", + "benchmark_growth": "node benchmark/growth", + "benchmark_toArray": "node benchmark/toArray", + "benchmark_fromArray": "node benchmark/fromArray" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/invertase/denque.git" + }, + "license": "Apache-2.0", + "author": { + "name": "Invertase", + "email": "oss@invertase.io", + "url": "http://github.com/invertase/" + }, + "contributors": [ + "Mike Diarmid (Salakar) " + ], + "bugs": { + "url": "https://github.com/invertase/denque/issues" + }, + "homepage": "https://docs.page/invertase/denque", + "devDependencies": { + "benchmark": "^2.1.4", + "codecov": "^3.8.3", + "double-ended-queue": "^2.1.0-0", + "istanbul": "^0.4.5", + "mocha": "^3.5.3", + "typescript": "^3.4.1" + } +} diff --git a/node_modules/generate-function/.travis.yml b/node_modules/generate-function/.travis.yml new file mode 100644 index 0000000..6e5919d --- /dev/null +++ b/node_modules/generate-function/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "0.10" diff --git a/node_modules/generate-function/LICENSE b/node_modules/generate-function/LICENSE new file mode 100644 index 0000000..757562e --- /dev/null +++ b/node_modules/generate-function/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/generate-function/README.md b/node_modules/generate-function/README.md new file mode 100644 index 0000000..97419e9 --- /dev/null +++ b/node_modules/generate-function/README.md @@ -0,0 +1,89 @@ +# generate-function + +Module that helps you write generated functions in Node + +``` +npm install generate-function +``` + +[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function) + +## Disclamer + +Writing code that generates code is hard. +You should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc). + +## Usage + +``` js +const genfun = require('generate-function') +const { d } = genfun.formats + +function addNumber (val) { + const gen = genfun() + + gen(` + function add (n) {') + return n + ${d(val)}) // supports format strings to insert values + } + `) + + return gen.toFunction() // will compile the function +} + +const add2 = addNumber(2) + +console.log('1 + 2 =', add2(1)) +console.log(add2.toString()) // prints the generated function +``` + +If you need to close over variables in your generated function pass them to `toFunction(scope)` + +``` js +function multiply (a, b) { + return a * b +} + +function addAndMultiplyNumber (val) { + const gen = genfun() + + gen(` + function (n) { + if (typeof n !== 'number') { + throw new Error('argument should be a number') + } + const result = multiply(${d(val)}, n + ${d(val)}) + return result + } + `) + + // use gen.toString() if you want to see the generated source + + return gen.toFunction({multiply}) +} + +const addAndMultiply2 = addAndMultiplyNumber(2) + +console.log(addAndMultiply2.toString()) +console.log('(3 + 2) * 2 =', addAndMultiply2(3)) +``` + +You can call `gen(src)` as many times as you want to append more source code to the function. + +## Variables + +If you need a unique safe identifier for the scope of the generated function call `str = gen.sym('friendlyName')`. +These are safe to use for variable names etc. + +## Object properties + +If you need to access an object property use the `str = gen.property('objectName', 'propertyName')`. + +This returns `'objectName.propertyName'` if `propertyName` is safe to use as a variable. Otherwise +it returns `objectName[propertyNameAsString]`. + +If you only pass `gen.property('propertyName')` it will only return the `propertyName` part safely + +## License + +MIT diff --git a/node_modules/generate-function/example.js b/node_modules/generate-function/example.js new file mode 100644 index 0000000..7c36c76 --- /dev/null +++ b/node_modules/generate-function/example.js @@ -0,0 +1,27 @@ +const genfun = require('./') +const { d } = genfun.formats + +function multiply (a, b) { + return a * b +} + +function addAndMultiplyNumber (val) { + const fn = genfun(` + function (n) { + if (typeof n !== 'number') { + throw new Error('argument should be a number') + } + const result = multiply(${d(val)}, n + ${d(val)}) + return result + } + `) + + // use fn.toString() if you want to see the generated source + + return fn.toFunction({multiply}) +} + +const addAndMultiply2 = addAndMultiplyNumber(2) + +console.log(addAndMultiply2.toString()) +console.log('(3 + 2) * 2 =', addAndMultiply2(3)) diff --git a/node_modules/generate-function/index.js b/node_modules/generate-function/index.js new file mode 100644 index 0000000..8105dc0 --- /dev/null +++ b/node_modules/generate-function/index.js @@ -0,0 +1,181 @@ +var util = require('util') +var isProperty = require('is-property') + +var INDENT_START = /[\{\[]/ +var INDENT_END = /[\}\]]/ + +// from https://mathiasbynens.be/notes/reserved-keywords +var RESERVED = [ + 'do', + 'if', + 'in', + 'for', + 'let', + 'new', + 'try', + 'var', + 'case', + 'else', + 'enum', + 'eval', + 'null', + 'this', + 'true', + 'void', + 'with', + 'await', + 'break', + 'catch', + 'class', + 'const', + 'false', + 'super', + 'throw', + 'while', + 'yield', + 'delete', + 'export', + 'import', + 'public', + 'return', + 'static', + 'switch', + 'typeof', + 'default', + 'extends', + 'finally', + 'package', + 'private', + 'continue', + 'debugger', + 'function', + 'arguments', + 'interface', + 'protected', + 'implements', + 'instanceof', + 'NaN', + 'undefined' +] + +var RESERVED_MAP = {} + +for (var i = 0; i < RESERVED.length; i++) { + RESERVED_MAP[RESERVED[i]] = true +} + +var isVariable = function (name) { + return isProperty(name) && !RESERVED_MAP.hasOwnProperty(name) +} + +var formats = { + s: function(s) { + return '' + s + }, + d: function(d) { + return '' + Number(d) + }, + o: function(o) { + return JSON.stringify(o) + } +} + +var genfun = function() { + var lines = [] + var indent = 0 + var vars = {} + + var push = function(str) { + var spaces = '' + while (spaces.length < indent*2) spaces += ' ' + lines.push(spaces+str) + } + + var pushLine = function(line) { + if (INDENT_END.test(line.trim()[0]) && INDENT_START.test(line[line.length-1])) { + indent-- + push(line) + indent++ + return + } + if (INDENT_START.test(line[line.length-1])) { + push(line) + indent++ + return + } + if (INDENT_END.test(line.trim()[0])) { + indent-- + push(line) + return + } + + push(line) + } + + var line = function(fmt) { + if (!fmt) return line + + if (arguments.length === 1 && fmt.indexOf('\n') > -1) { + var lines = fmt.trim().split('\n') + for (var i = 0; i < lines.length; i++) { + pushLine(lines[i].trim()) + } + } else { + pushLine(util.format.apply(util, arguments)) + } + + return line + } + + line.scope = {} + line.formats = formats + + line.sym = function(name) { + if (!name || !isVariable(name)) name = 'tmp' + if (!vars[name]) vars[name] = 0 + return name + (vars[name]++ || '') + } + + line.property = function(obj, name) { + if (arguments.length === 1) { + name = obj + obj = '' + } + + name = name + '' + + if (isProperty(name)) return (obj ? obj + '.' + name : name) + return obj ? obj + '[' + JSON.stringify(name) + ']' : JSON.stringify(name) + } + + line.toString = function() { + return lines.join('\n') + } + + line.toFunction = function(scope) { + if (!scope) scope = {} + + var src = 'return ('+line.toString()+')' + + Object.keys(line.scope).forEach(function (key) { + if (!scope[key]) scope[key] = line.scope[key] + }) + + var keys = Object.keys(scope).map(function(key) { + return key + }) + + var vals = keys.map(function(key) { + return scope[key] + }) + + return Function.apply(null, keys.concat(src)).apply(null, vals) + } + + if (arguments.length) line.apply(null, arguments) + + return line +} + +genfun.formats = formats +module.exports = genfun diff --git a/node_modules/generate-function/package.json b/node_modules/generate-function/package.json new file mode 100644 index 0000000..be2ac04 --- /dev/null +++ b/node_modules/generate-function/package.json @@ -0,0 +1,32 @@ +{ + "name": "generate-function", + "version": "2.3.1", + "description": "Module that helps you write generated functions in Node", + "main": "index.js", + "scripts": { + "test": "tape test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/mafintosh/generate-function" + }, + "keywords": [ + "generate", + "code", + "generation", + "function", + "performance" + ], + "author": "Mathias Buus", + "license": "MIT", + "bugs": { + "url": "https://github.com/mafintosh/generate-function/issues" + }, + "homepage": "https://github.com/mafintosh/generate-function", + "devDependencies": { + "tape": "^4.9.1" + }, + "dependencies": { + "is-property": "^1.0.2" + } +} diff --git a/node_modules/generate-function/test.js b/node_modules/generate-function/test.js new file mode 100644 index 0000000..9337b71 --- /dev/null +++ b/node_modules/generate-function/test.js @@ -0,0 +1,49 @@ +var tape = require('tape') +var genfun = require('./') + +tape('generate add function', function(t) { + var fn = genfun() + ('function add(n) {') + ('return n + %d', 42) + ('}') + + t.same(fn.toString(), 'function add(n) {\n return n + 42\n}', 'code is indented') + t.same(fn.toFunction()(10), 52, 'function works') + t.end() +}) + +tape('generate function + closed variables', function(t) { + var fn = genfun() + ('function add(n) {') + ('return n + %d + number', 42) + ('}') + + var notGood = fn.toFunction() + var good = fn.toFunction({number:10}) + + try { + notGood(10) + t.ok(false, 'function should not work') + } catch (err) { + t.same(err.message, 'number is not defined', 'throws reference error') + } + + t.same(good(11), 63, 'function with closed var works') + t.end() +}) + +tape('generate property', function(t) { + var gen = genfun() + + t.same(gen.property('a'), 'a') + t.same(gen.property('42'), '"42"') + t.same(gen.property('b', 'a'), 'b.a') + t.same(gen.property('b', '42'), 'b["42"]') + t.same(gen.sym(42), 'tmp') + t.same(gen.sym('a'), 'a') + t.same(gen.sym('a'), 'a1') + t.same(gen.sym(42), 'tmp1') + t.same(gen.sym('const'), 'tmp2') + + t.end() +}) diff --git a/node_modules/is-property/.npmignore b/node_modules/is-property/.npmignore new file mode 100644 index 0000000..8ecfa25 --- /dev/null +++ b/node_modules/is-property/.npmignore @@ -0,0 +1,17 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +node_modules/* +*.DS_Store +test/* \ No newline at end of file diff --git a/node_modules/is-property/LICENSE b/node_modules/is-property/LICENSE new file mode 100644 index 0000000..8ce206a --- /dev/null +++ b/node_modules/is-property/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2013 Mikola Lysenko + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-property/README.md b/node_modules/is-property/README.md new file mode 100644 index 0000000..ef1d00b --- /dev/null +++ b/node_modules/is-property/README.md @@ -0,0 +1,28 @@ +is-property +=========== +Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "]) + +Example +------- + +```javascript +var isProperty = require("is-property") + +console.log(isProperty("foo")) //Prints true +console.log(isProperty("0")) //Prints false +``` + +Install +------- + + npm install is-property + +### `require("is-property")(str)` +Checks if str is a property + +* `str` is a string which we will test if it is a property or not + +**Returns** true or false depending if str is a property + +## Credits +(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file diff --git a/node_modules/is-property/is-property.js b/node_modules/is-property/is-property.js new file mode 100644 index 0000000..db58b47 --- /dev/null +++ b/node_modules/is-property/is-property.js @@ -0,0 +1,5 @@ +"use strict" +function isProperty(str) { + return /^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str) +} +module.exports = isProperty \ No newline at end of file diff --git a/node_modules/is-property/package.json b/node_modules/is-property/package.json new file mode 100644 index 0000000..2105f7b --- /dev/null +++ b/node_modules/is-property/package.json @@ -0,0 +1,36 @@ +{ + "name": "is-property", + "version": "1.0.2", + "description": "Tests if a JSON property can be accessed using . syntax", + "main": "is-property.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tape": "~1.0.4" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/mikolalysenko/is-property.git" + }, + "keywords": [ + "is", + "property", + "json", + "dot", + "bracket", + ".", + "[]" + ], + "author": "Mikola Lysenko", + "license": "MIT", + "readmeFilename": "README.md", + "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50", + "bugs": { + "url": "https://github.com/mikolalysenko/is-property/issues" + } +} diff --git a/node_modules/long/LICENSE b/node_modules/long/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/node_modules/long/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/long/README.md b/node_modules/long/README.md new file mode 100644 index 0000000..ca4b2f8 --- /dev/null +++ b/node_modules/long/README.md @@ -0,0 +1,286 @@ +# long.js + +A Long class for representing a 64 bit two's-complement integer value derived from the [Closure Library](https://github.com/google/closure-library) +for stand-alone use and extended with unsigned support. + +[![Build Status](https://img.shields.io/github/actions/workflow/status/dcodeIO/long.js/test.yml?branch=main&label=test&logo=github)](https://github.com/dcodeIO/long.js/actions/workflows/test.yml) [![Publish Status](https://img.shields.io/github/actions/workflow/status/dcodeIO/long.js/publish.yml?branch=main&label=publish&logo=github)](https://github.com/dcodeIO/long.js/actions/workflows/publish.yml) [![npm](https://img.shields.io/npm/v/long.svg?label=npm&color=007acc&logo=npm)](https://www.npmjs.com/package/long) + +## Background + +As of [ECMA-262 5th Edition](http://ecma262-5.com/ELS5_HTML.htm#Section_8.5), "all the positive and negative integers +whose magnitude is no greater than 253 are representable in the Number type", which is "representing the +doubleprecision 64-bit format IEEE 754 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic". +The [maximum safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) +in JavaScript is 253-1. + +Example: 264-1 is 1844674407370955**1615** but in JavaScript it evaluates to 1844674407370955**2000**. + +Furthermore, bitwise operators in JavaScript "deal only with integers in the range −231 through +231−1, inclusive, or in the range 0 through 232−1, inclusive. These operators accept any value of +the Number type but first convert each such value to one of 232 integer values." + +In some use cases, however, it is required to be able to reliably work with and perform bitwise operations on the full +64 bits. This is where long.js comes into play. + +## Usage + +The package exports an ECMAScript module with an UMD fallback. + +``` +$> npm install long +``` + +```js +import Long from "long"; + +var value = new Long(0xFFFFFFFF, 0x7FFFFFFF); +console.log(value.toString()); +... +``` + +Note that mixing ESM and CommonJS is not recommended as it yields different classes, albeit with the same functionality. + +### Usage with a CDN + +- From GitHub via [jsDelivr](https://www.jsdelivr.com):
+ `https://cdn.jsdelivr.net/gh/dcodeIO/long.js@TAG/index.js` (ESM) +- From npm via [jsDelivr](https://www.jsdelivr.com):
+ `https://cdn.jsdelivr.net/npm/long@VERSION/index.js` (ESM)
+ `https://cdn.jsdelivr.net/npm/long@VERSION/umd/index.js` (UMD) +- From npm via [unpkg](https://unpkg.com):
+ `https://unpkg.com/long@VERSION/index.js` (ESM)
+ `https://unpkg.com/long@VERSION/umd/index.js` (UMD) + +Replace `TAG` respectively `VERSION` with a [specific version](https://github.com/dcodeIO/long.js/releases) or omit it (not recommended in production) to use main/latest. + +## API + +### Constructor + +- new **Long**(low: `number`, high?: `number`, unsigned?: `boolean`)
+ Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as _signed_ integers. See the from\* functions below for more convenient ways of constructing Longs. + +### Fields + +- Long#**low**: `number`
+ The low 32 bits as a signed value. + +- Long#**high**: `number`
+ The high 32 bits as a signed value. + +- Long#**unsigned**: `boolean`
+ Whether unsigned or not. + +### Constants + +- Long.**ZERO**: `Long`
+ Signed zero. + +- Long.**ONE**: `Long`
+ Signed one. + +- Long.**NEG_ONE**: `Long`
+ Signed negative one. + +- Long.**UZERO**: `Long`
+ Unsigned zero. + +- Long.**UONE**: `Long`
+ Unsigned one. + +- Long.**MAX_VALUE**: `Long`
+ Maximum signed value. + +- Long.**MIN_VALUE**: `Long`
+ Minimum signed value. + +- Long.**MAX_UNSIGNED_VALUE**: `Long`
+ Maximum unsigned value. + +### Utility + +- type **LongLike**: `Long | number | bigint | string`
+ Any value or object that either is or can be converted to a Long. + +- Long.**isLong**(obj: `any`): `boolean`
+ Tests if the specified object is a Long. + +- Long.**fromBits**(lowBits: `number`, highBits: `number`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + +- Long.**fromBytes**(bytes: `number[]`, unsigned?: `boolean`, le?: `boolean`): `Long`
+ Creates a Long from its byte representation. + +- Long.**fromBytesLE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
+ Creates a Long from its little endian byte representation. + +- Long.**fromBytesBE**(bytes: `number[]`, unsigned?: `boolean`): `Long`
+ Creates a Long from its big endian byte representation. + +- Long.**fromInt**(value: `number`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the given 32 bit integer value. + +- Long.**fromNumber**(value: `number`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + +- Long.**fromBigInt**(value: `bigint`, unsigned?: `boolean`): `Long`
+ Returns a Long representing the given big integer. + +- Long.**fromString**(str: `string`, unsigned?: `boolean`, radix?: `number`)
+ Long.**fromString**(str: `string`, radix: `number`)
+ Returns a Long representation of the given string, written using the specified radix. + +- Long.**fromValue**(val: `LongLike`, unsigned?: `boolean`): `Long`
+ Converts the specified value to a Long using the appropriate from\* function for its type. + +### Methods + +- Long#**add**(addend: `LongLike`): `Long`
+ Returns the sum of this and the specified Long. + +- Long#**and**(other: `LongLike`): `Long`
+ Returns the bitwise AND of this Long and the specified. + +- Long#**compare**/**comp**(other: `LongLike`): `number`
+ Compares this Long's value with the specified's. Returns `0` if they are the same, `1` if the this is greater and `-1` if the given one is greater. + +- Long#**divide**/**div**(divisor: `LongLike`): `Long`
+ Returns this Long divided by the specified. + +- Long#**equals**/**eq**(other: `LongLike`): `boolean`
+ Tests if this Long's value equals the specified's. + +- Long#**getHighBits**(): `number`
+ Gets the high 32 bits as a signed integer. + +- Long#**getHighBitsUnsigned**(): `number`
+ Gets the high 32 bits as an unsigned integer. + +- Long#**getLowBits**(): `number`
+ Gets the low 32 bits as a signed integer. + +- Long#**getLowBitsUnsigned**(): `number`
+ Gets the low 32 bits as an unsigned integer. + +- Long#**getNumBitsAbs**(): `number`
+ Gets the number of bits needed to represent the absolute value of this Long. + +- Long#**greaterThan**/**gt**(other: `LongLike`): `boolean`
+ Tests if this Long's value is greater than the specified's. + +- Long#**greaterThanOrEqual**/**gte**/**ge**(other: `LongLike`): `boolean`
+ Tests if this Long's value is greater than or equal the specified's. + +- Long#**isEven**(): `boolean`
+ Tests if this Long's value is even. + +- Long#**isNegative**(): `boolean`
+ Tests if this Long's value is negative. + +- Long#**isOdd**(): `boolean`
+ Tests if this Long's value is odd. + +- Long#**isPositive**(): `boolean`
+ Tests if this Long's value is positive or zero. + +- Long#**isSafeInteger**(): `boolean`
+ Tests if this Long can be safely represented as a JavaScript number. + +- Long#**isZero**/**eqz**(): `boolean`
+ Tests if this Long's value equals zero. + +- Long#**lessThan**/**lt**(other: `LongLike`): `boolean`
+ Tests if this Long's value is less than the specified's. + +- Long#**lessThanOrEqual**/**lte**/**le**(other: `LongLike`): `boolean`
+ Tests if this Long's value is less than or equal the specified's. + +- Long#**modulo**/**mod**/**rem**(divisor: `LongLike`): `Long`
+ Returns this Long modulo the specified. + +- Long#**multiply**/**mul**(multiplier: `LongLike`): `Long`
+ Returns the product of this and the specified Long. + +- Long#**negate**/**neg**(): `Long`
+ Negates this Long's value. + +- Long#**not**(): `Long`
+ Returns the bitwise NOT of this Long. + +- Long#**countLeadingZeros**/**clz**(): `number`
+ Returns count leading zeros of this Long. + +- Long#**countTrailingZeros**/**ctz**(): `number`
+ Returns count trailing zeros of this Long. + +- Long#**notEquals**/**neq**/**ne**(other: `LongLike`): `boolean`
+ Tests if this Long's value differs from the specified's. + +- Long#**or**(other: `LongLike`): `Long`
+ Returns the bitwise OR of this Long and the specified. + +- Long#**shiftLeft**/**shl**(numBits: `Long | number`): `Long`
+ Returns this Long with bits shifted to the left by the given amount. + +- Long#**shiftRight**/**shr**(numBits: `Long | number`): `Long`
+ Returns this Long with bits arithmetically shifted to the right by the given amount. + +- Long#**shiftRightUnsigned**/**shru**/**shr_u**(numBits: `Long | number`): `Long`
+ Returns this Long with bits logically shifted to the right by the given amount. + +- Long#**rotateLeft**/**rotl**(numBits: `Long | number`): `Long`
+ Returns this Long with bits rotated to the left by the given amount. + +- Long#**rotateRight**/**rotr**(numBits: `Long | number`): `Long`
+ Returns this Long with bits rotated to the right by the given amount. + +- Long#**subtract**/**sub**(subtrahend: `LongLike`): `Long`
+ Returns the difference of this and the specified Long. + +- Long#**toBytes**(le?: `boolean`): `number[]`
+ Converts this Long to its byte representation. + +- Long#**toBytesLE**(): `number[]`
+ Converts this Long to its little endian byte representation. + +- Long#**toBytesBE**(): `number[]`
+ Converts this Long to its big endian byte representation. + +- Long#**toInt**(): `number`
+ Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + +- Long#**toNumber**(): `number`
+ Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + +- Long#**toBigInt**(): `bigint`
+ Converts the Long to its big integer representation. + +- Long#**toSigned**(): `Long`
+ Converts this Long to signed. + +- Long#**toString**(radix?: `number`): `string`
+ Converts the Long to a string written in the specified radix. + +- Long#**toUnsigned**(): `Long`
+ Converts this Long to unsigned. + +- Long#**xor**(other: `Long | number | string`): `Long`
+ Returns the bitwise XOR of this Long and the given one. + +## WebAssembly support + +[WebAssembly](http://webassembly.org) supports 64-bit integer arithmetic out of the box, hence a [tiny WebAssembly module](./wasm.wat) is used to compute operations like multiplication, division and remainder more efficiently (slow operations like division are around twice as fast), falling back to floating point based computations in JavaScript where WebAssembly is not yet supported, e.g., in older versions of node. + +## Building + +Building the UMD fallback: + +``` +$> npm run build +``` + +Running the [tests](./tests): + +``` +$> npm test +``` diff --git a/node_modules/long/index.d.ts b/node_modules/long/index.d.ts new file mode 100644 index 0000000..7d4b017 --- /dev/null +++ b/node_modules/long/index.d.ts @@ -0,0 +1,2 @@ +import { Long } from "./types.js"; +export default Long; diff --git a/node_modules/long/index.js b/node_modules/long/index.js new file mode 100644 index 0000000..4983233 --- /dev/null +++ b/node_modules/long/index.js @@ -0,0 +1,1581 @@ +/** + * @license + * Copyright 2009 The Closure Library Authors + * Copyright 2020 Daniel Wirtz / The long.js Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +// WebAssembly optimizations to do native i64 multiplication and divide +var wasm = null; +try { + wasm = new WebAssembly.Instance( + new WebAssembly.Module( + new Uint8Array([ + // \0asm + 0, 97, 115, 109, + // version 1 + 1, 0, 0, 0, + + // section "type" + 1, 13, 2, + // 0, () => i32 + 96, 0, 1, 127, + // 1, (i32, i32, i32, i32) => i32 + 96, 4, 127, 127, 127, 127, 1, 127, + + // section "function" + 3, 7, 6, + // 0, type 0 + 0, + // 1, type 1 + 1, + // 2, type 1 + 1, + // 3, type 1 + 1, + // 4, type 1 + 1, + // 5, type 1 + 1, + + // section "global" + 6, 6, 1, + // 0, "high", mutable i32 + 127, 1, 65, 0, 11, + + // section "export" + 7, 50, 6, + // 0, "mul" + 3, 109, 117, 108, 0, 1, + // 1, "div_s" + 5, 100, 105, 118, 95, 115, 0, 2, + // 2, "div_u" + 5, 100, 105, 118, 95, 117, 0, 3, + // 3, "rem_s" + 5, 114, 101, 109, 95, 115, 0, 4, + // 4, "rem_u" + 5, 114, 101, 109, 95, 117, 0, 5, + // 5, "get_high" + 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, + + // section "code" + 10, 191, 1, 6, + // 0, "get_high" + 4, 0, 35, 0, 11, + // 1, "mul" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, + 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, + 167, 11, + // 2, "div_s" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, + 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, + 167, 11, + // 3, "div_u" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, + 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, + 167, 11, + // 4, "rem_s" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, + 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, + 167, 11, + // 5, "rem_u" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, + 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, + 167, 11, + ]), + ), + {}, + ).exports; +} catch { + // no wasm support :( +} + +/** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * @exports Long + * @class A Long class for representing a 64 bit two's-complement integer value. + * @param {number} low The low (signed) 32 bits of the long + * @param {number} high The high (signed) 32 bits of the long + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @constructor + */ +function Long(low, high, unsigned) { + /** + * The low 32 bits as a signed value. + * @type {number} + */ + this.low = low | 0; + + /** + * The high 32 bits as a signed value. + * @type {number} + */ + this.high = high | 0; + + /** + * Whether unsigned or not. + * @type {boolean} + */ + this.unsigned = !!unsigned; +} + +// The internal representation of a long is the two given signed, 32-bit values. +// We use 32-bit pieces because these are the size of integers on which +// Javascript performs bit-operations. For operations like addition and +// multiplication, we split each number into 16 bit pieces, which can easily be +// multiplied within Javascript's floating-point representation without overflow +// or change in sign. +// +// In the algorithms below, we frequently reduce the negative case to the +// positive case by negating the input(s) and then post-processing the result. +// Note that we must ALWAYS check specially whether those values are MIN_VALUE +// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as +// a positive number, it overflows back into a negative). Not handling this +// case would often result in infinite recursion. +// +// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* +// methods on which they depend. + +/** + * An indicator used to reliably determine if an object is a Long or not. + * @type {boolean} + * @const + * @private + */ +Long.prototype.__isLong__; + +Object.defineProperty(Long.prototype, "__isLong__", { value: true }); + +/** + * @function + * @param {*} obj Object + * @returns {boolean} + * @inner + */ +function isLong(obj) { + return (obj && obj["__isLong__"]) === true; +} + +/** + * @function + * @param {*} value number + * @returns {number} + * @inner + */ +function ctz32(value) { + var c = Math.clz32(value & -value); + return value ? 31 - c : c; +} + +/** + * Tests if the specified object is a Long. + * @function + * @param {*} obj Object + * @returns {boolean} + */ +Long.isLong = isLong; + +/** + * A cache of the Long representations of small integer values. + * @type {!Object} + * @inner + */ +var INT_CACHE = {}; + +/** + * A cache of the Long representations of small unsigned integer values. + * @type {!Object} + * @inner + */ +var UINT_CACHE = {}; + +/** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = fromBits(value, 0, true); + if (cache) UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) INT_CACHE[value] = obj; + return obj; + } +} + +/** + * Returns a Long representing the given 32 bit integer value. + * @function + * @param {number} value The 32 bit integer in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ +Long.fromInt = fromInt; + +/** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromNumber(value, unsigned) { + if (isNaN(value)) return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) return UZERO; + if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; + } + if (value < 0) return fromNumber(-value, unsigned).neg(); + return fromBits( + value % TWO_PWR_32_DBL | 0, + (value / TWO_PWR_32_DBL) | 0, + unsigned, + ); +} + +/** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @function + * @param {number} value The number in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ +Long.fromNumber = fromNumber; + +/** + * @param {number} lowBits + * @param {number} highBits + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); +} + +/** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is + * assumed to use 32 bits. + * @function + * @param {number} lowBits The low 32 bits + * @param {number} highBits The high 32 bits + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ +Long.fromBits = fromBits; + +/** + * @function + * @param {number} base + * @param {number} exponent + * @returns {number} + * @inner + */ +var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) + +/** + * @param {string} str + * @param {(boolean|number)=} unsigned + * @param {number=} radix + * @returns {!Long} + * @inner + */ +function fromString(str, unsigned, radix) { + if (str.length === 0) throw Error("empty string"); + if (typeof unsigned === "number") { + // For goog.math.long compatibility + radix = unsigned; + unsigned = false; + } else { + unsigned = !!unsigned; + } + if ( + str === "NaN" || + str === "Infinity" || + str === "+Infinity" || + str === "-Infinity" + ) + return unsigned ? UZERO : ZERO; + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + + var p; + if ((p = str.indexOf("-")) > 0) throw Error("interior hyphen"); + else if (p === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 8)); + + var result = ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; +} + +/** + * Returns a Long representation of the given string, written using the specified radix. + * @function + * @param {string} str The textual representation of the Long + * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed + * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 + * @returns {!Long} The corresponding Long value + */ +Long.fromString = fromString; + +/** + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ +function fromValue(val, unsigned) { + if (typeof val === "number") return fromNumber(val, unsigned); + if (typeof val === "string") return fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return fromBits( + val.low, + val.high, + typeof unsigned === "boolean" ? unsigned : val.unsigned, + ); +} + +/** + * Converts the specified value to a Long using the appropriate from* function for its type. + * @function + * @param {!Long|number|bigint|string|!{low: number, high: number, unsigned: boolean}} val Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} + */ +Long.fromValue = fromValue; + +// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be +// no runtime penalty for these. + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_16_DBL = 1 << 16; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_24_DBL = 1 << 24; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + +/** + * @type {number} + * @const + * @inner + */ +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + +/** + * @type {!Long} + * @const + * @inner + */ +var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + +/** + * @type {!Long} + * @inner + */ +var ZERO = fromInt(0); + +/** + * Signed zero. + * @type {!Long} + */ +Long.ZERO = ZERO; + +/** + * @type {!Long} + * @inner + */ +var UZERO = fromInt(0, true); + +/** + * Unsigned zero. + * @type {!Long} + */ +Long.UZERO = UZERO; + +/** + * @type {!Long} + * @inner + */ +var ONE = fromInt(1); + +/** + * Signed one. + * @type {!Long} + */ +Long.ONE = ONE; + +/** + * @type {!Long} + * @inner + */ +var UONE = fromInt(1, true); + +/** + * Unsigned one. + * @type {!Long} + */ +Long.UONE = UONE; + +/** + * @type {!Long} + * @inner + */ +var NEG_ONE = fromInt(-1); + +/** + * Signed negative one. + * @type {!Long} + */ +Long.NEG_ONE = NEG_ONE; + +/** + * @type {!Long} + * @inner + */ +var MAX_VALUE = fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + +/** + * Maximum signed value. + * @type {!Long} + */ +Long.MAX_VALUE = MAX_VALUE; + +/** + * @type {!Long} + * @inner + */ +var MAX_UNSIGNED_VALUE = fromBits(0xffffffff | 0, 0xffffffff | 0, true); + +/** + * Maximum unsigned value. + * @type {!Long} + */ +Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + +/** + * @type {!Long} + * @inner + */ +var MIN_VALUE = fromBits(0, 0x80000000 | 0, false); + +/** + * Minimum signed value. + * @type {!Long} + */ +Long.MIN_VALUE = MIN_VALUE; + +/** + * @alias Long.prototype + * @inner + */ +var LongPrototype = Long.prototype; + +/** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + * @this {!Long} + * @returns {number} + */ +LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; +}; + +/** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + * @this {!Long} + * @returns {number} + */ +LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); +}; + +/** + * Converts the Long to a string written in the specified radix. + * @this {!Long} + * @param {number=} radix Radix (2-36), defaults to 10 + * @returns {string} + * @override + * @throws {RangeError} If `radix` is out of range + */ +LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + if (this.isZero()) return "0"; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else return "-" + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), + rem = this; + var result = ""; + while (true) { + var remDiv = rem.div(radixToPower), + intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, + digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) return digits + result; + else { + while (digits.length < 6) digits = "0" + digits; + result = "" + digits + result; + } + } +}; + +/** + * Gets the high 32 bits as a signed integer. + * @this {!Long} + * @returns {number} Signed high bits + */ +LongPrototype.getHighBits = function getHighBits() { + return this.high; +}; + +/** + * Gets the high 32 bits as an unsigned integer. + * @this {!Long} + * @returns {number} Unsigned high bits + */ +LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; +}; + +/** + * Gets the low 32 bits as a signed integer. + * @this {!Long} + * @returns {number} Signed low bits + */ +LongPrototype.getLowBits = function getLowBits() { + return this.low; +}; + +/** + * Gets the low 32 bits as an unsigned integer. + * @this {!Long} + * @returns {number} Unsigned low bits + */ +LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; +}; + +/** + * Gets the number of bits needed to represent the absolute value of this Long. + * @this {!Long} + * @returns {number} + */ +LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) + // Unsigned Longs are never negative + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) if ((val & (1 << bit)) != 0) break; + return this.high != 0 ? bit + 33 : bit + 1; +}; + +/** + * Tests if this Long can be safely represented as a JavaScript number. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isSafeInteger = function isSafeInteger() { + // 2^53-1 is the maximum safe value + var top11Bits = this.high >> 21; + // [0, 2^53-1] + if (!top11Bits) return true; + // > 2^53-1 + if (this.unsigned) return false; + // [-2^53, -1] except -2^53 + return top11Bits === -1 && !(this.low === 0 && this.high === -0x200000); +}; + +/** + * Tests if this Long's value equals zero. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; +}; + +/** + * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. + * @returns {boolean} + */ +LongPrototype.eqz = LongPrototype.isZero; + +/** + * Tests if this Long's value is negative. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; +}; + +/** + * Tests if this Long's value is positive or zero. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; +}; + +/** + * Tests if this Long's value is odd. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; +}; + +/** + * Tests if this Long's value is even. + * @this {!Long} + * @returns {boolean} + */ +LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; +}; + +/** + * Tests if this Long's value equals the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.equals = function equals(other) { + if (!isLong(other)) other = fromValue(other); + if ( + this.unsigned !== other.unsigned && + this.high >>> 31 === 1 && + other.high >>> 31 === 1 + ) + return false; + return this.high === other.high && this.low === other.low; +}; + +/** + * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.eq = LongPrototype.equals; + +/** + * Tests if this Long's value differs from the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.notEquals = function notEquals(other) { + return !this.eq(/* validates */ other); +}; + +/** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.neq = LongPrototype.notEquals; + +/** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.ne = LongPrototype.notEquals; + +/** + * Tests if this Long's value is less than the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.lessThan = function lessThan(other) { + return this.comp(/* validates */ other) < 0; +}; + +/** + * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.lt = LongPrototype.lessThan; + +/** + * Tests if this Long's value is less than or equal the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(/* validates */ other) <= 0; +}; + +/** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.lte = LongPrototype.lessThanOrEqual; + +/** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.le = LongPrototype.lessThanOrEqual; + +/** + * Tests if this Long's value is greater than the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(/* validates */ other) > 0; +}; + +/** + * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.gt = LongPrototype.greaterThan; + +/** + * Tests if this Long's value is greater than or equal the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(/* validates */ other) >= 0; +}; + +/** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.gte = LongPrototype.greaterThanOrEqual; + +/** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ +LongPrototype.ge = LongPrototype.greaterThanOrEqual; + +/** + * Compares this Long's value with the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ +LongPrototype.compare = function compare(other) { + if (!isLong(other)) other = fromValue(other); + if (this.eq(other)) return 0; + var thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) return -1; + if (!thisNeg && otherNeg) return 1; + // At this point the sign bits are the same + if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; +}; + +/** + * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ +LongPrototype.comp = LongPrototype.compare; + +/** + * Negates this Long's value. + * @this {!Long} + * @returns {!Long} Negated Long + */ +LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; + return this.not().add(ONE); +}; + +/** + * Negates this Long's value. This is an alias of {@link Long#negate}. + * @function + * @returns {!Long} Negated Long + */ +LongPrototype.neg = LongPrototype.negate; + +/** + * Returns the sum of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} addend Addend + * @returns {!Long} Sum + */ +LongPrototype.add = function add(addend) { + if (!isLong(addend)) addend = fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + + var c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); +}; + +/** + * Returns the difference of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ +LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); +}; + +/** + * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. + * @function + * @param {!Long|number|bigint|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ +LongPrototype.sub = LongPrototype.subtract; + +/** + * Returns the product of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} multiplier Multiplier + * @returns {!Long} Product + */ +LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) return this; + if (!isLong(multiplier)) multiplier = fromValue(multiplier); + + // use wasm support if present + if (wasm) { + var low = wasm["mul"](this.low, this.high, multiplier.low, multiplier.high); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + + if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO; + if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; + + if (this.isNegative()) { + if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); + else return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + + var c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); +}; + +/** + * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. + * @function + * @param {!Long|number|bigint|string} multiplier Multiplier + * @returns {!Long} Product + */ +LongPrototype.mul = LongPrototype.multiply; + +/** + * Returns this Long divided by the specified. The result is signed if this Long is signed or + * unsigned if this Long is unsigned. + * @this {!Long} + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Quotient + */ +LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + if (divisor.isZero()) throw Error("division by zero"); + + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if ( + !this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1 + ) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])( + this.low, + this.high, + divisor.low, + divisor.high, + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + + if (this.isZero()) return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(MIN_VALUE)) return ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) divisor = divisor.toUnsigned(); + if (divisor.gt(this)) return UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return UONE; + res = UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2), + delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + approxRes = fromNumber(approx), + approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) approxRes = ONE; + + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; +}; + +/** + * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. + * @function + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Quotient + */ +LongPrototype.div = LongPrototype.divide; + +/** + * Returns this Long modulo the specified. + * @this {!Long} + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Remainder + */ +LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])( + this.low, + this.high, + divisor.low, + divisor.high, + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + + return this.sub(this.div(divisor).mul(divisor)); +}; + +/** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Remainder + */ +LongPrototype.mod = LongPrototype.modulo; + +/** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Remainder + */ +LongPrototype.rem = LongPrototype.modulo; + +/** + * Returns the bitwise NOT of this Long. + * @this {!Long} + * @returns {!Long} + */ +LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); +}; + +/** + * Returns count leading zeros of this Long. + * @this {!Long} + * @returns {!number} + */ +LongPrototype.countLeadingZeros = function countLeadingZeros() { + return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; +}; + +/** + * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}. + * @function + * @param {!Long} + * @returns {!number} + */ +LongPrototype.clz = LongPrototype.countLeadingZeros; + +/** + * Returns count trailing zeros of this Long. + * @this {!Long} + * @returns {!number} + */ +LongPrototype.countTrailingZeros = function countTrailingZeros() { + return this.low ? ctz32(this.low) : ctz32(this.high) + 32; +}; + +/** + * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}. + * @function + * @param {!Long} + * @returns {!number} + */ +LongPrototype.ctz = LongPrototype.countTrailingZeros; + +/** + * Returns the bitwise AND of this Long and the specified. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other Long + * @returns {!Long} + */ +LongPrototype.and = function and(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits(this.low & other.low, this.high & other.high, this.unsigned); +}; + +/** + * Returns the bitwise OR of this Long and the specified. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other Long + * @returns {!Long} + */ +LongPrototype.or = function or(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits(this.low | other.low, this.high | other.high, this.unsigned); +}; + +/** + * Returns the bitwise XOR of this Long and the given one. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other Long + * @returns {!Long} + */ +LongPrototype.xor = function xor(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); +}; + +/** + * Returns this Long with bits shifted to the left by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return fromBits( + this.low << numBits, + (this.high << numBits) | (this.low >>> (32 - numBits)), + this.unsigned, + ); + else return fromBits(0, this.low << (numBits - 32), this.unsigned); +}; + +/** + * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shl = LongPrototype.shiftLeft; + +/** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return fromBits( + (this.low >>> numBits) | (this.high << (32 - numBits)), + this.high >> numBits, + this.unsigned, + ); + else + return fromBits( + this.high >> (numBits - 32), + this.high >= 0 ? 0 : -1, + this.unsigned, + ); +}; + +/** + * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shr = LongPrototype.shiftRight; + +/** + * Returns this Long with bits logically shifted to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits < 32) + return fromBits( + (this.low >>> numBits) | (this.high << (32 - numBits)), + this.high >>> numBits, + this.unsigned, + ); + if (numBits === 32) return fromBits(this.high, 0, this.unsigned); + return fromBits(this.high >>> (numBits - 32), 0, this.unsigned); +}; + +/** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shru = LongPrototype.shiftRightUnsigned; + +/** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ +LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; + +/** + * Returns this Long with bits rotated to the left by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ +LongPrototype.rotateLeft = function rotateLeft(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits( + (this.low << numBits) | (this.high >>> b), + (this.high << numBits) | (this.low >>> b), + this.unsigned, + ); + } + numBits -= 32; + b = 32 - numBits; + return fromBits( + (this.high << numBits) | (this.low >>> b), + (this.low << numBits) | (this.high >>> b), + this.unsigned, + ); +}; +/** + * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ +LongPrototype.rotl = LongPrototype.rotateLeft; + +/** + * Returns this Long with bits rotated to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ +LongPrototype.rotateRight = function rotateRight(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits( + (this.high << b) | (this.low >>> numBits), + (this.low << b) | (this.high >>> numBits), + this.unsigned, + ); + } + numBits -= 32; + b = 32 - numBits; + return fromBits( + (this.low << b) | (this.high >>> numBits), + (this.high << b) | (this.low >>> numBits), + this.unsigned, + ); +}; +/** + * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ +LongPrototype.rotr = LongPrototype.rotateRight; + +/** + * Converts this Long to signed. + * @this {!Long} + * @returns {!Long} Signed long + */ +LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) return this; + return fromBits(this.low, this.high, false); +}; + +/** + * Converts this Long to unsigned. + * @this {!Long} + * @returns {!Long} Unsigned long + */ +LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) return this; + return fromBits(this.low, this.high, true); +}; + +/** + * Converts this Long to its byte representation. + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @this {!Long} + * @returns {!Array.} Byte representation + */ +LongPrototype.toBytes = function toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); +}; + +/** + * Converts this Long to its little endian byte representation. + * @this {!Long} + * @returns {!Array.} Little endian byte representation + */ +LongPrototype.toBytesLE = function toBytesLE() { + var hi = this.high, + lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24, + ]; +}; + +/** + * Converts this Long to its big endian byte representation. + * @this {!Long} + * @returns {!Array.} Big endian byte representation + */ +LongPrototype.toBytesBE = function toBytesBE() { + var hi = this.high, + lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff, + ]; +}; + +/** + * Creates a Long from its byte representation. + * @param {!Array.} bytes Byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @returns {Long} The corresponding Long value + */ +Long.fromBytes = function fromBytes(bytes, unsigned, le) { + return le + ? Long.fromBytesLE(bytes, unsigned) + : Long.fromBytesBE(bytes, unsigned); +}; + +/** + * Creates a Long from its little endian byte representation. + * @param {!Array.} bytes Little endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ +Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { + return new Long( + bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), + bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), + unsigned, + ); +}; + +/** + * Creates a Long from its big endian byte representation. + * @param {!Array.} bytes Big endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ +Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { + return new Long( + (bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], + (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], + unsigned, + ); +}; + +// Support conversion to/from BigInt where available +if (typeof BigInt === "function") { + /** + * Returns a Long representing the given big integer. + * @function + * @param {number} value The big integer value + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ + Long.fromBigInt = function fromBigInt(value, unsigned) { + var lowBits = Number(BigInt.asIntN(32, value)); + var highBits = Number(BigInt.asIntN(32, value >> BigInt(32))); + return fromBits(lowBits, highBits, unsigned); + }; + + // Override + Long.fromValue = function fromValueWithBigInt(value, unsigned) { + if (typeof value === "bigint") return Long.fromBigInt(value, unsigned); + return fromValue(value, unsigned); + }; + + /** + * Converts the Long to its big integer representation. + * @this {!Long} + * @returns {bigint} + */ + LongPrototype.toBigInt = function toBigInt() { + var lowBigInt = BigInt(this.low >>> 0); + var highBigInt = BigInt(this.unsigned ? this.high >>> 0 : this.high); + return (highBigInt << BigInt(32)) | lowBigInt; + }; +} + +export default Long; diff --git a/node_modules/long/package.json b/node_modules/long/package.json new file mode 100644 index 0000000..c617736 --- /dev/null +++ b/node_modules/long/package.json @@ -0,0 +1,58 @@ +{ + "name": "long", + "version": "5.3.2", + "author": "Daniel Wirtz ", + "description": "A Long class for representing a 64-bit two's-complement integer value.", + "repository": { + "type": "git", + "url": "https://github.com/dcodeIO/long.js.git" + }, + "bugs": { + "url": "https://github.com/dcodeIO/long.js/issues" + }, + "keywords": [ + "math", + "long", + "int64" + ], + "license": "Apache-2.0", + "type": "module", + "main": "umd/index.js", + "types": "umd/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "require": { + "types": "./umd/index.d.ts", + "default": "./umd/index.js" + } + } + }, + "scripts": { + "build": "node scripts/build.js", + "lint": "prettier --check .", + "format": "prettier --write .", + "test": "npm run test:unit && npm run test:typescript", + "test:unit": "node tests", + "test:typescript": "tsc --project tests/typescript/tsconfig.esnext.json && tsc --project tests/typescript/tsconfig.nodenext.json && tsc --project tests/typescript/tsconfig.commonjs.json && tsc --project tests/typescript/tsconfig.global.json" + }, + "files": [ + "index.js", + "index.d.ts", + "types.d.ts", + "umd/index.js", + "umd/index.d.ts", + "umd/types.d.ts", + "umd/package.json", + "LICENSE", + "README.md" + ], + "devDependencies": { + "esm2umd": "^0.3.1", + "prettier": "^3.5.0", + "typescript": "^5.7.3" + } +} diff --git a/node_modules/long/types.d.ts b/node_modules/long/types.d.ts new file mode 100644 index 0000000..7693ca4 --- /dev/null +++ b/node_modules/long/types.d.ts @@ -0,0 +1,474 @@ +// Common type definitions for both the ESM and UMD variants. The ESM variant +// reexports the Long class as its default export, whereas the UMD variant makes +// the Long class a whole-module export with a global variable fallback. + +type LongLike = + | Long + | number + | bigint + | string + | { low: number; high: number; unsigned: boolean }; + +export declare class Long { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. + */ + constructor(low: number, high?: number, unsigned?: boolean); + + /** + * Maximum unsigned value. + */ + static MAX_UNSIGNED_VALUE: Long; + + /** + * Maximum signed value. + */ + static MAX_VALUE: Long; + + /** + * Minimum signed value. + */ + static MIN_VALUE: Long; + + /** + * Signed negative one. + */ + static NEG_ONE: Long; + + /** + * Signed one. + */ + static ONE: Long; + + /** + * Unsigned one. + */ + static UONE: Long; + + /** + * Unsigned zero. + */ + static UZERO: Long; + + /** + * Signed zero + */ + static ZERO: Long; + + /** + * The high 32 bits as a signed value. + */ + high: number; + + /** + * The low 32 bits as a signed value. + */ + low: number; + + /** + * Whether unsigned or not. + */ + unsigned: boolean; + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the given 32 bit integer value. + */ + static fromInt(value: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + */ + static fromNumber(value: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the given big integer value. + */ + static fromBigInt(value: bigint, unsigned?: boolean): Long; + + /** + * Returns a Long representation of the given string, written using the specified radix. + */ + static fromString( + str: string, + unsigned?: boolean | number, + radix?: number, + ): Long; + + /** + * Creates a Long from its byte representation. + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long; + + /** + * Creates a Long from its big endian byte representation. + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long; + + /** + * Tests if the specified object is a Long. + */ + static isLong(obj: any): obj is Long; + + /** + * Converts the specified value to a Long. + */ + static fromValue(val: LongLike, unsigned?: boolean): Long; + + /** + * Returns the sum of this and the specified Long. + */ + add(addend: LongLike): Long; + + /** + * Returns the bitwise AND of this Long and the specified. + */ + and(other: LongLike): Long; + + /** + * Compares this Long's value with the specified's. + */ + compare(other: LongLike): number; + + /** + * Compares this Long's value with the specified's. + */ + comp(other: LongLike): number; + + /** + * Returns this Long divided by the specified. + */ + divide(divisor: LongLike): Long; + + /** + * Returns this Long divided by the specified. + */ + div(divisor: LongLike): Long; + + /** + * Tests if this Long's value equals the specified's. + */ + equals(other: LongLike): boolean; + + /** + * Tests if this Long's value equals the specified's. + */ + eq(other: LongLike): boolean; + + /** + * Gets the high 32 bits as a signed integer. + */ + getHighBits(): number; + + /** + * Gets the high 32 bits as an unsigned integer. + */ + getHighBitsUnsigned(): number; + + /** + * Gets the low 32 bits as a signed integer. + */ + getLowBits(): number; + + /** + * Gets the low 32 bits as an unsigned integer. + */ + getLowBitsUnsigned(): number; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + */ + getNumBitsAbs(): number; + + /** + * Tests if this Long's value is greater than the specified's. + */ + greaterThan(other: LongLike): boolean; + + /** + * Tests if this Long's value is greater than the specified's. + */ + gt(other: LongLike): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + greaterThanOrEqual(other: LongLike): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + gte(other: LongLike): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + ge(other: LongLike): boolean; + + /** + * Tests if this Long's value is even. + */ + isEven(): boolean; + + /** + * Tests if this Long's value is negative. + */ + isNegative(): boolean; + + /** + * Tests if this Long's value is odd. + */ + isOdd(): boolean; + + /** + * Tests if this Long's value is positive or zero. + */ + isPositive(): boolean; + + /** + * Tests if this Long can be safely represented as a JavaScript number. + */ + isSafeInteger(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + isZero(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + eqz(): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lessThan(other: LongLike): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lt(other: LongLike): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lessThanOrEqual(other: LongLike): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lte(other: LongLike): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + le(other: LongLike): boolean; + + /** + * Returns this Long modulo the specified. + */ + modulo(other: LongLike): Long; + + /** + * Returns this Long modulo the specified. + */ + mod(other: LongLike): Long; + + /** + * Returns this Long modulo the specified. + */ + rem(other: LongLike): Long; + + /** + * Returns the product of this and the specified Long. + */ + multiply(multiplier: LongLike): Long; + + /** + * Returns the product of this and the specified Long. + */ + mul(multiplier: LongLike): Long; + + /** + * Negates this Long's value. + */ + negate(): Long; + + /** + * Negates this Long's value. + */ + neg(): Long; + + /** + * Returns the bitwise NOT of this Long. + */ + not(): Long; + + /** + * Returns count leading zeros of this Long. + */ + countLeadingZeros(): number; + + /** + * Returns count leading zeros of this Long. + */ + clz(): number; + + /** + * Returns count trailing zeros of this Long. + */ + countTrailingZeros(): number; + + /** + * Returns count trailing zeros of this Long. + */ + ctz(): number; + + /** + * Tests if this Long's value differs from the specified's. + */ + notEquals(other: LongLike): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + neq(other: LongLike): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + ne(other: LongLike): boolean; + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: LongLike): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shiftLeft(numBits: number | Long): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shl(numBits: number | Long): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shiftRight(numBits: number | Long): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shr(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shiftRightUnsigned(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shru(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shr_u(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the left by the given amount. + */ + rotateLeft(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the left by the given amount. + */ + rotl(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the right by the given amount. + */ + rotateRight(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the right by the given amount. + */ + rotr(numBits: number | Long): Long; + + /** + * Returns the difference of this and the specified Long. + */ + subtract(subtrahend: LongLike): Long; + + /** + * Returns the difference of this and the specified Long. + */ + sub(subtrahend: LongLike): Long; + + /** + * Converts the Long to a big integer. + */ + toBigInt(): bigint; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + */ + toInt(): number; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + */ + toNumber(): number; + + /** + * Converts this Long to its byte representation. + */ + + toBytes(le?: boolean): number[]; + + /** + * Converts this Long to its little endian byte representation. + */ + + toBytesLE(): number[]; + + /** + * Converts this Long to its big endian byte representation. + */ + + toBytesBE(): number[]; + + /** + * Converts this Long to signed. + */ + toSigned(): Long; + + /** + * Converts the Long to a string written in the specified radix. + */ + toString(radix?: number): string; + + /** + * Converts this Long to unsigned. + */ + toUnsigned(): Long; + + /** + * Returns the bitwise XOR of this Long and the given one. + */ + xor(other: LongLike): Long; +} diff --git a/node_modules/long/umd/index.d.ts b/node_modules/long/umd/index.d.ts new file mode 100644 index 0000000..5036689 --- /dev/null +++ b/node_modules/long/umd/index.d.ts @@ -0,0 +1,3 @@ +import { Long } from "./types.js"; +export = Long; +export as namespace Long; diff --git a/node_modules/long/umd/index.js b/node_modules/long/umd/index.js new file mode 100644 index 0000000..7136988 --- /dev/null +++ b/node_modules/long/umd/index.js @@ -0,0 +1,1622 @@ +// GENERATED FILE. DO NOT EDIT. +(function (global, factory) { + function preferDefault(exports) { + return exports.default || exports; + } + if (typeof define === "function" && define.amd) { + define([], function () { + var exports = {}; + factory(exports); + return preferDefault(exports); + }); + } else if (typeof exports === "object") { + factory(exports); + if (typeof module === "object") module.exports = preferDefault(exports); + } else { + (function () { + var exports = {}; + factory(exports); + global.Long = preferDefault(exports); + })(); + } +})( + typeof globalThis !== "undefined" + ? globalThis + : typeof self !== "undefined" + ? self + : this, + function (_exports) { + "use strict"; + + Object.defineProperty(_exports, "__esModule", { + value: true, + }); + _exports.default = void 0; + /** + * @license + * Copyright 2009 The Closure Library Authors + * Copyright 2020 Daniel Wirtz / The long.js Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + + // WebAssembly optimizations to do native i64 multiplication and divide + var wasm = null; + try { + wasm = new WebAssembly.Instance( + new WebAssembly.Module( + new Uint8Array([ + // \0asm + 0, 97, 115, 109, + // version 1 + 1, 0, 0, 0, + // section "type" + 1, 13, 2, + // 0, () => i32 + 96, 0, 1, 127, + // 1, (i32, i32, i32, i32) => i32 + 96, 4, 127, 127, 127, 127, 1, 127, + // section "function" + 3, 7, 6, + // 0, type 0 + 0, + // 1, type 1 + 1, + // 2, type 1 + 1, + // 3, type 1 + 1, + // 4, type 1 + 1, + // 5, type 1 + 1, + // section "global" + 6, 6, 1, + // 0, "high", mutable i32 + 127, 1, 65, 0, 11, + // section "export" + 7, 50, 6, + // 0, "mul" + 3, 109, 117, 108, 0, 1, + // 1, "div_s" + 5, 100, 105, 118, 95, 115, 0, 2, + // 2, "div_u" + 5, 100, 105, 118, 95, 117, 0, 3, + // 3, "rem_s" + 5, 114, 101, 109, 95, 115, 0, 4, + // 4, "rem_u" + 5, 114, 101, 109, 95, 117, 0, 5, + // 5, "get_high" + 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, + // section "code" + 10, 191, 1, 6, + // 0, "get_high" + 4, 0, 35, 0, 11, + // 1, "mul" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, + 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, + 32, 4, 167, 11, + // 2, "div_s" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, + 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, + 32, 4, 167, 11, + // 3, "div_u" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, + 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, + 32, 4, 167, 11, + // 4, "rem_s" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, + 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, + 32, 4, 167, 11, + // 5, "rem_u" + 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, + 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, + 32, 4, 167, 11, + ]), + ), + {}, + ).exports; + } catch { + // no wasm support :( + } + + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * @exports Long + * @class A Long class for representing a 64 bit two's-complement integer value. + * @param {number} low The low (signed) 32 bits of the long + * @param {number} high The high (signed) 32 bits of the long + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @constructor + */ + function Long(low, high, unsigned) { + /** + * The low 32 bits as a signed value. + * @type {number} + */ + this.low = low | 0; + + /** + * The high 32 bits as a signed value. + * @type {number} + */ + this.high = high | 0; + + /** + * Whether unsigned or not. + * @type {boolean} + */ + this.unsigned = !!unsigned; + } + + // The internal representation of a long is the two given signed, 32-bit values. + // We use 32-bit pieces because these are the size of integers on which + // Javascript performs bit-operations. For operations like addition and + // multiplication, we split each number into 16 bit pieces, which can easily be + // multiplied within Javascript's floating-point representation without overflow + // or change in sign. + // + // In the algorithms below, we frequently reduce the negative case to the + // positive case by negating the input(s) and then post-processing the result. + // Note that we must ALWAYS check specially whether those values are MIN_VALUE + // (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + // a positive number, it overflows back into a negative). Not handling this + // case would often result in infinite recursion. + // + // Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from* + // methods on which they depend. + + /** + * An indicator used to reliably determine if an object is a Long or not. + * @type {boolean} + * @const + * @private + */ + Long.prototype.__isLong__; + Object.defineProperty(Long.prototype, "__isLong__", { + value: true, + }); + + /** + * @function + * @param {*} obj Object + * @returns {boolean} + * @inner + */ + function isLong(obj) { + return (obj && obj["__isLong__"]) === true; + } + + /** + * @function + * @param {*} value number + * @returns {number} + * @inner + */ + function ctz32(value) { + var c = Math.clz32(value & -value); + return value ? 31 - c : c; + } + + /** + * Tests if the specified object is a Long. + * @function + * @param {*} obj Object + * @returns {boolean} + */ + Long.isLong = isLong; + + /** + * A cache of the Long representations of small integer values. + * @type {!Object} + * @inner + */ + var INT_CACHE = {}; + + /** + * A cache of the Long representations of small unsigned integer values. + * @type {!Object} + * @inner + */ + var UINT_CACHE = {}; + + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromInt(value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = fromBits(value, 0, true); + if (cache) UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = fromBits(value, value < 0 ? -1 : 0, false); + if (cache) INT_CACHE[value] = obj; + return obj; + } + } + + /** + * Returns a Long representing the given 32 bit integer value. + * @function + * @param {number} value The 32 bit integer in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ + Long.fromInt = fromInt; + + /** + * @param {number} value + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromNumber(value, unsigned) { + if (isNaN(value)) return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) return UZERO; + if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; + } + if (value < 0) return fromNumber(-value, unsigned).neg(); + return fromBits( + value % TWO_PWR_32_DBL | 0, + (value / TWO_PWR_32_DBL) | 0, + unsigned, + ); + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @function + * @param {number} value The number in question + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ + Long.fromNumber = fromNumber; + + /** + * @param {number} lowBits + * @param {number} highBits + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is + * assumed to use 32 bits. + * @function + * @param {number} lowBits The low 32 bits + * @param {number} highBits The high 32 bits + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ + Long.fromBits = fromBits; + + /** + * @function + * @param {number} base + * @param {number} exponent + * @returns {number} + * @inner + */ + var pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4) + + /** + * @param {string} str + * @param {(boolean|number)=} unsigned + * @param {number=} radix + * @returns {!Long} + * @inner + */ + function fromString(str, unsigned, radix) { + if (str.length === 0) throw Error("empty string"); + if (typeof unsigned === "number") { + // For goog.math.long compatibility + radix = unsigned; + unsigned = false; + } else { + unsigned = !!unsigned; + } + if ( + str === "NaN" || + str === "Infinity" || + str === "+Infinity" || + str === "-Infinity" + ) + return unsigned ? UZERO : ZERO; + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + var p; + if ((p = str.indexOf("-")) > 0) throw Error("interior hyphen"); + else if (p === 0) { + return fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 8)); + var result = ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = fromNumber(pow_dbl(radix, size)); + result = result.mul(power).add(fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + + /** + * Returns a Long representation of the given string, written using the specified radix. + * @function + * @param {string} str The textual representation of the Long + * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed + * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 + * @returns {!Long} The corresponding Long value + */ + Long.fromString = fromString; + + /** + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + function fromValue(val, unsigned) { + if (typeof val === "number") return fromNumber(val, unsigned); + if (typeof val === "string") return fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return fromBits( + val.low, + val.high, + typeof unsigned === "boolean" ? unsigned : val.unsigned, + ); + } + + /** + * Converts the specified value to a Long using the appropriate from* function for its type. + * @function + * @param {!Long|number|bigint|string|!{low: number, high: number, unsigned: boolean}} val Value + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} + */ + Long.fromValue = fromValue; + + // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be + // no runtime penalty for these. + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_16_DBL = 1 << 16; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_24_DBL = 1 << 24; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + + /** + * @type {!Long} + * @const + * @inner + */ + var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + + /** + * @type {!Long} + * @inner + */ + var ZERO = fromInt(0); + + /** + * Signed zero. + * @type {!Long} + */ + Long.ZERO = ZERO; + + /** + * @type {!Long} + * @inner + */ + var UZERO = fromInt(0, true); + + /** + * Unsigned zero. + * @type {!Long} + */ + Long.UZERO = UZERO; + + /** + * @type {!Long} + * @inner + */ + var ONE = fromInt(1); + + /** + * Signed one. + * @type {!Long} + */ + Long.ONE = ONE; + + /** + * @type {!Long} + * @inner + */ + var UONE = fromInt(1, true); + + /** + * Unsigned one. + * @type {!Long} + */ + Long.UONE = UONE; + + /** + * @type {!Long} + * @inner + */ + var NEG_ONE = fromInt(-1); + + /** + * Signed negative one. + * @type {!Long} + */ + Long.NEG_ONE = NEG_ONE; + + /** + * @type {!Long} + * @inner + */ + var MAX_VALUE = fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + + /** + * Maximum signed value. + * @type {!Long} + */ + Long.MAX_VALUE = MAX_VALUE; + + /** + * @type {!Long} + * @inner + */ + var MAX_UNSIGNED_VALUE = fromBits(0xffffffff | 0, 0xffffffff | 0, true); + + /** + * Maximum unsigned value. + * @type {!Long} + */ + Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; + + /** + * @type {!Long} + * @inner + */ + var MIN_VALUE = fromBits(0, 0x80000000 | 0, false); + + /** + * Minimum signed value. + * @type {!Long} + */ + Long.MIN_VALUE = MIN_VALUE; + + /** + * @alias Long.prototype + * @inner + */ + var LongPrototype = Long.prototype; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + * @this {!Long} + * @returns {number} + */ + LongPrototype.toInt = function toInt() { + return this.unsigned ? this.low >>> 0 : this.low; + }; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + * @this {!Long} + * @returns {number} + */ + LongPrototype.toNumber = function toNumber() { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + + /** + * Converts the Long to a string written in the specified radix. + * @this {!Long} + * @param {number=} radix Radix (2-36), defaults to 10 + * @returns {string} + * @override + * @throws {RangeError} If `radix` is out of range + */ + LongPrototype.toString = function toString(radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + if (this.isZero()) return "0"; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else return "-" + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), + rem = this; + var result = ""; + while (true) { + var remDiv = rem.div(radixToPower), + intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0, + digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) return digits + result; + else { + while (digits.length < 6) digits = "0" + digits; + result = "" + digits + result; + } + } + }; + + /** + * Gets the high 32 bits as a signed integer. + * @this {!Long} + * @returns {number} Signed high bits + */ + LongPrototype.getHighBits = function getHighBits() { + return this.high; + }; + + /** + * Gets the high 32 bits as an unsigned integer. + * @this {!Long} + * @returns {number} Unsigned high bits + */ + LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { + return this.high >>> 0; + }; + + /** + * Gets the low 32 bits as a signed integer. + * @this {!Long} + * @returns {number} Signed low bits + */ + LongPrototype.getLowBits = function getLowBits() { + return this.low; + }; + + /** + * Gets the low 32 bits as an unsigned integer. + * @this {!Long} + * @returns {number} Unsigned low bits + */ + LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { + return this.low >>> 0; + }; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + * @this {!Long} + * @returns {number} + */ + LongPrototype.getNumBitsAbs = function getNumBitsAbs() { + if (this.isNegative()) + // Unsigned Longs are never negative + return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + var val = this.high != 0 ? this.high : this.low; + for (var bit = 31; bit > 0; bit--) if ((val & (1 << bit)) != 0) break; + return this.high != 0 ? bit + 33 : bit + 1; + }; + + /** + * Tests if this Long can be safely represented as a JavaScript number. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isSafeInteger = function isSafeInteger() { + // 2^53-1 is the maximum safe value + var top11Bits = this.high >> 21; + // [0, 2^53-1] + if (!top11Bits) return true; + // > 2^53-1 + if (this.unsigned) return false; + // [-2^53, -1] except -2^53 + return top11Bits === -1 && !(this.low === 0 && this.high === -0x200000); + }; + + /** + * Tests if this Long's value equals zero. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isZero = function isZero() { + return this.high === 0 && this.low === 0; + }; + + /** + * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. + * @returns {boolean} + */ + LongPrototype.eqz = LongPrototype.isZero; + + /** + * Tests if this Long's value is negative. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isNegative = function isNegative() { + return !this.unsigned && this.high < 0; + }; + + /** + * Tests if this Long's value is positive or zero. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isPositive = function isPositive() { + return this.unsigned || this.high >= 0; + }; + + /** + * Tests if this Long's value is odd. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isOdd = function isOdd() { + return (this.low & 1) === 1; + }; + + /** + * Tests if this Long's value is even. + * @this {!Long} + * @returns {boolean} + */ + LongPrototype.isEven = function isEven() { + return (this.low & 1) === 0; + }; + + /** + * Tests if this Long's value equals the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.equals = function equals(other) { + if (!isLong(other)) other = fromValue(other); + if ( + this.unsigned !== other.unsigned && + this.high >>> 31 === 1 && + other.high >>> 31 === 1 + ) + return false; + return this.high === other.high && this.low === other.low; + }; + + /** + * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.eq = LongPrototype.equals; + + /** + * Tests if this Long's value differs from the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.notEquals = function notEquals(other) { + return !this.eq(/* validates */ other); + }; + + /** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.neq = LongPrototype.notEquals; + + /** + * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.ne = LongPrototype.notEquals; + + /** + * Tests if this Long's value is less than the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThan = function lessThan(other) { + return this.comp(/* validates */ other) < 0; + }; + + /** + * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.lt = LongPrototype.lessThan; + + /** + * Tests if this Long's value is less than or equal the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { + return this.comp(/* validates */ other) <= 0; + }; + + /** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.lte = LongPrototype.lessThanOrEqual; + + /** + * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.le = LongPrototype.lessThanOrEqual; + + /** + * Tests if this Long's value is greater than the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThan = function greaterThan(other) { + return this.comp(/* validates */ other) > 0; + }; + + /** + * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.gt = LongPrototype.greaterThan; + + /** + * Tests if this Long's value is greater than or equal the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { + return this.comp(/* validates */ other) >= 0; + }; + + /** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.gte = LongPrototype.greaterThanOrEqual; + + /** + * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {boolean} + */ + LongPrototype.ge = LongPrototype.greaterThanOrEqual; + + /** + * Compares this Long's value with the specified's. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.compare = function compare(other) { + if (!isLong(other)) other = fromValue(other); + if (this.eq(other)) return 0; + var thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) return -1; + if (!thisNeg && otherNeg) return 1; + // At this point the sign bits are the same + if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + + /** + * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. + * @function + * @param {!Long|number|bigint|string} other Other value + * @returns {number} 0 if they are the same, 1 if the this is greater and -1 + * if the given one is greater + */ + LongPrototype.comp = LongPrototype.compare; + + /** + * Negates this Long's value. + * @this {!Long} + * @returns {!Long} Negated Long + */ + LongPrototype.negate = function negate() { + if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; + return this.not().add(ONE); + }; + + /** + * Negates this Long's value. This is an alias of {@link Long#negate}. + * @function + * @returns {!Long} Negated Long + */ + LongPrototype.neg = LongPrototype.negate; + + /** + * Returns the sum of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} addend Addend + * @returns {!Long} Sum + */ + LongPrototype.add = function add(addend) { + if (!isLong(addend)) addend = fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + + /** + * Returns the difference of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + + /** + * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. + * @function + * @param {!Long|number|bigint|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.sub = LongPrototype.subtract; + + /** + * Returns the product of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.multiply = function multiply(multiplier) { + if (this.isZero()) return this; + if (!isLong(multiplier)) multiplier = fromValue(multiplier); + + // use wasm support if present + if (wasm) { + var low = wasm["mul"]( + this.low, + this.high, + multiplier.low, + multiplier.high, + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO; + if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; + if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); + else return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) + return fromNumber( + this.toNumber() * multiplier.toNumber(), + this.unsigned, + ); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + + /** + * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. + * @function + * @param {!Long|number|bigint|string} multiplier Multiplier + * @returns {!Long} Product + */ + LongPrototype.mul = LongPrototype.multiply; + + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or + * unsigned if this Long is unsigned. + * @this {!Long} + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.divide = function divide(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + if (divisor.isZero()) throw Error("division by zero"); + + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if ( + !this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1 + ) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm["div_u"] : wasm["div_s"])( + this.low, + this.high, + divisor.low, + divisor.high, + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + if (this.isZero()) return this.unsigned ? UZERO : ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(MIN_VALUE)) { + if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) + return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(MIN_VALUE)) return ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(ZERO)) { + return divisor.isNegative() ? ONE : NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); + res = ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) divisor = divisor.toUnsigned(); + if (divisor.gt(this)) return UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return UONE; + res = UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2), + delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + approxRes = fromNumber(approx), + approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) approxRes = ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + + /** + * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. + * @function + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Quotient + */ + LongPrototype.div = LongPrototype.divide; + + /** + * Returns this Long modulo the specified. + * @this {!Long} + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.modulo = function modulo(divisor) { + if (!isLong(divisor)) divisor = fromValue(divisor); + + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm["rem_u"] : wasm["rem_s"])( + this.low, + this.high, + divisor.low, + divisor.high, + ); + return fromBits(low, wasm["get_high"](), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + + /** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.mod = LongPrototype.modulo; + + /** + * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. + * @function + * @param {!Long|number|bigint|string} divisor Divisor + * @returns {!Long} Remainder + */ + LongPrototype.rem = LongPrototype.modulo; + + /** + * Returns the bitwise NOT of this Long. + * @this {!Long} + * @returns {!Long} + */ + LongPrototype.not = function not() { + return fromBits(~this.low, ~this.high, this.unsigned); + }; + + /** + * Returns count leading zeros of this Long. + * @this {!Long} + * @returns {!number} + */ + LongPrototype.countLeadingZeros = function countLeadingZeros() { + return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; + }; + + /** + * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}. + * @function + * @param {!Long} + * @returns {!number} + */ + LongPrototype.clz = LongPrototype.countLeadingZeros; + + /** + * Returns count trailing zeros of this Long. + * @this {!Long} + * @returns {!number} + */ + LongPrototype.countTrailingZeros = function countTrailingZeros() { + return this.low ? ctz32(this.low) : ctz32(this.high) + 32; + }; + + /** + * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}. + * @function + * @param {!Long} + * @returns {!number} + */ + LongPrototype.ctz = LongPrototype.countTrailingZeros; + + /** + * Returns the bitwise AND of this Long and the specified. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other Long + * @returns {!Long} + */ + LongPrototype.and = function and(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits( + this.low & other.low, + this.high & other.high, + this.unsigned, + ); + }; + + /** + * Returns the bitwise OR of this Long and the specified. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other Long + * @returns {!Long} + */ + LongPrototype.or = function or(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits( + this.low | other.low, + this.high | other.high, + this.unsigned, + ); + }; + + /** + * Returns the bitwise XOR of this Long and the given one. + * @this {!Long} + * @param {!Long|number|bigint|string} other Other Long + * @returns {!Long} + */ + LongPrototype.xor = function xor(other) { + if (!isLong(other)) other = fromValue(other); + return fromBits( + this.low ^ other.low, + this.high ^ other.high, + this.unsigned, + ); + }; + + /** + * Returns this Long with bits shifted to the left by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftLeft = function shiftLeft(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return fromBits( + this.low << numBits, + (this.high << numBits) | (this.low >>> (32 - numBits)), + this.unsigned, + ); + else return fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + + /** + * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shl = LongPrototype.shiftLeft; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRight = function shiftRight(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return fromBits( + (this.low >>> numBits) | (this.high << (32 - numBits)), + this.high >> numBits, + this.unsigned, + ); + else + return fromBits( + this.high >> (numBits - 32), + this.high >= 0 ? 0 : -1, + this.unsigned, + ); + }; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shr = LongPrototype.shiftRight; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits < 32) + return fromBits( + (this.low >>> numBits) | (this.high << (32 - numBits)), + this.high >>> numBits, + this.unsigned, + ); + if (numBits === 32) return fromBits(this.high, 0, this.unsigned); + return fromBits(this.high >>> (numBits - 32), 0, this.unsigned); + }; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shru = LongPrototype.shiftRightUnsigned; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Shifted Long + */ + LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; + + /** + * Returns this Long with bits rotated to the left by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ + LongPrototype.rotateLeft = function rotateLeft(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits( + (this.low << numBits) | (this.high >>> b), + (this.high << numBits) | (this.low >>> b), + this.unsigned, + ); + } + numBits -= 32; + b = 32 - numBits; + return fromBits( + (this.high << numBits) | (this.low >>> b), + (this.low << numBits) | (this.high >>> b), + this.unsigned, + ); + }; + /** + * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ + LongPrototype.rotl = LongPrototype.rotateLeft; + + /** + * Returns this Long with bits rotated to the right by the given amount. + * @this {!Long} + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ + LongPrototype.rotateRight = function rotateRight(numBits) { + var b; + if (isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); + if (numBits < 32) { + b = 32 - numBits; + return fromBits( + (this.high << b) | (this.low >>> numBits), + (this.low << b) | (this.high >>> numBits), + this.unsigned, + ); + } + numBits -= 32; + b = 32 - numBits; + return fromBits( + (this.low << b) | (this.high >>> numBits), + (this.high << b) | (this.low >>> numBits), + this.unsigned, + ); + }; + /** + * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. + * @function + * @param {number|!Long} numBits Number of bits + * @returns {!Long} Rotated Long + */ + LongPrototype.rotr = LongPrototype.rotateRight; + + /** + * Converts this Long to signed. + * @this {!Long} + * @returns {!Long} Signed long + */ + LongPrototype.toSigned = function toSigned() { + if (!this.unsigned) return this; + return fromBits(this.low, this.high, false); + }; + + /** + * Converts this Long to unsigned. + * @this {!Long} + * @returns {!Long} Unsigned long + */ + LongPrototype.toUnsigned = function toUnsigned() { + if (this.unsigned) return this; + return fromBits(this.low, this.high, true); + }; + + /** + * Converts this Long to its byte representation. + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @this {!Long} + * @returns {!Array.} Byte representation + */ + LongPrototype.toBytes = function toBytes(le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + + /** + * Converts this Long to its little endian byte representation. + * @this {!Long} + * @returns {!Array.} Little endian byte representation + */ + LongPrototype.toBytesLE = function toBytesLE() { + var hi = this.high, + lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24, + ]; + }; + + /** + * Converts this Long to its big endian byte representation. + * @this {!Long} + * @returns {!Array.} Big endian byte representation + */ + LongPrototype.toBytesBE = function toBytesBE() { + var hi = this.high, + lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff, + ]; + }; + + /** + * Creates a Long from its byte representation. + * @param {!Array.} bytes Byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @param {boolean=} le Whether little or big endian, defaults to big endian + * @returns {Long} The corresponding Long value + */ + Long.fromBytes = function fromBytes(bytes, unsigned, le) { + return le + ? Long.fromBytesLE(bytes, unsigned) + : Long.fromBytesBE(bytes, unsigned); + }; + + /** + * Creates a Long from its little endian byte representation. + * @param {!Array.} bytes Little endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ + Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { + return new Long( + bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), + bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), + unsigned, + ); + }; + + /** + * Creates a Long from its big endian byte representation. + * @param {!Array.} bytes Big endian byte representation + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {Long} The corresponding Long value + */ + Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { + return new Long( + (bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], + (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], + unsigned, + ); + }; + + // Support conversion to/from BigInt where available + if (typeof BigInt === "function") { + /** + * Returns a Long representing the given big integer. + * @function + * @param {number} value The big integer value + * @param {boolean=} unsigned Whether unsigned or not, defaults to signed + * @returns {!Long} The corresponding Long value + */ + Long.fromBigInt = function fromBigInt(value, unsigned) { + var lowBits = Number(BigInt.asIntN(32, value)); + var highBits = Number(BigInt.asIntN(32, value >> BigInt(32))); + return fromBits(lowBits, highBits, unsigned); + }; + + // Override + Long.fromValue = function fromValueWithBigInt(value, unsigned) { + if (typeof value === "bigint") return Long.fromBigInt(value, unsigned); + return fromValue(value, unsigned); + }; + + /** + * Converts the Long to its big integer representation. + * @this {!Long} + * @returns {bigint} + */ + LongPrototype.toBigInt = function toBigInt() { + var lowBigInt = BigInt(this.low >>> 0); + var highBigInt = BigInt(this.unsigned ? this.high >>> 0 : this.high); + return (highBigInt << BigInt(32)) | lowBigInt; + }; + } + var _default = (_exports.default = Long); + }, +); diff --git a/node_modules/long/umd/package.json b/node_modules/long/umd/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/long/umd/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/long/umd/types.d.ts b/node_modules/long/umd/types.d.ts new file mode 100644 index 0000000..7693ca4 --- /dev/null +++ b/node_modules/long/umd/types.d.ts @@ -0,0 +1,474 @@ +// Common type definitions for both the ESM and UMD variants. The ESM variant +// reexports the Long class as its default export, whereas the UMD variant makes +// the Long class a whole-module export with a global variable fallback. + +type LongLike = + | Long + | number + | bigint + | string + | { low: number; high: number; unsigned: boolean }; + +export declare class Long { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs. + */ + constructor(low: number, high?: number, unsigned?: boolean); + + /** + * Maximum unsigned value. + */ + static MAX_UNSIGNED_VALUE: Long; + + /** + * Maximum signed value. + */ + static MAX_VALUE: Long; + + /** + * Minimum signed value. + */ + static MIN_VALUE: Long; + + /** + * Signed negative one. + */ + static NEG_ONE: Long; + + /** + * Signed one. + */ + static ONE: Long; + + /** + * Unsigned one. + */ + static UONE: Long; + + /** + * Unsigned zero. + */ + static UZERO: Long; + + /** + * Signed zero + */ + static ZERO: Long; + + /** + * The high 32 bits as a signed value. + */ + high: number; + + /** + * The low 32 bits as a signed value. + */ + low: number; + + /** + * Whether unsigned or not. + */ + unsigned: boolean; + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits. + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the given 32 bit integer value. + */ + static fromInt(value: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + */ + static fromNumber(value: number, unsigned?: boolean): Long; + + /** + * Returns a Long representing the given big integer value. + */ + static fromBigInt(value: bigint, unsigned?: boolean): Long; + + /** + * Returns a Long representation of the given string, written using the specified radix. + */ + static fromString( + str: string, + unsigned?: boolean | number, + radix?: number, + ): Long; + + /** + * Creates a Long from its byte representation. + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long; + + /** + * Creates a Long from its big endian byte representation. + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long; + + /** + * Tests if the specified object is a Long. + */ + static isLong(obj: any): obj is Long; + + /** + * Converts the specified value to a Long. + */ + static fromValue(val: LongLike, unsigned?: boolean): Long; + + /** + * Returns the sum of this and the specified Long. + */ + add(addend: LongLike): Long; + + /** + * Returns the bitwise AND of this Long and the specified. + */ + and(other: LongLike): Long; + + /** + * Compares this Long's value with the specified's. + */ + compare(other: LongLike): number; + + /** + * Compares this Long's value with the specified's. + */ + comp(other: LongLike): number; + + /** + * Returns this Long divided by the specified. + */ + divide(divisor: LongLike): Long; + + /** + * Returns this Long divided by the specified. + */ + div(divisor: LongLike): Long; + + /** + * Tests if this Long's value equals the specified's. + */ + equals(other: LongLike): boolean; + + /** + * Tests if this Long's value equals the specified's. + */ + eq(other: LongLike): boolean; + + /** + * Gets the high 32 bits as a signed integer. + */ + getHighBits(): number; + + /** + * Gets the high 32 bits as an unsigned integer. + */ + getHighBitsUnsigned(): number; + + /** + * Gets the low 32 bits as a signed integer. + */ + getLowBits(): number; + + /** + * Gets the low 32 bits as an unsigned integer. + */ + getLowBitsUnsigned(): number; + + /** + * Gets the number of bits needed to represent the absolute value of this Long. + */ + getNumBitsAbs(): number; + + /** + * Tests if this Long's value is greater than the specified's. + */ + greaterThan(other: LongLike): boolean; + + /** + * Tests if this Long's value is greater than the specified's. + */ + gt(other: LongLike): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + greaterThanOrEqual(other: LongLike): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + gte(other: LongLike): boolean; + + /** + * Tests if this Long's value is greater than or equal the specified's. + */ + ge(other: LongLike): boolean; + + /** + * Tests if this Long's value is even. + */ + isEven(): boolean; + + /** + * Tests if this Long's value is negative. + */ + isNegative(): boolean; + + /** + * Tests if this Long's value is odd. + */ + isOdd(): boolean; + + /** + * Tests if this Long's value is positive or zero. + */ + isPositive(): boolean; + + /** + * Tests if this Long can be safely represented as a JavaScript number. + */ + isSafeInteger(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + isZero(): boolean; + + /** + * Tests if this Long's value equals zero. + */ + eqz(): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lessThan(other: LongLike): boolean; + + /** + * Tests if this Long's value is less than the specified's. + */ + lt(other: LongLike): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lessThanOrEqual(other: LongLike): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + lte(other: LongLike): boolean; + + /** + * Tests if this Long's value is less than or equal the specified's. + */ + le(other: LongLike): boolean; + + /** + * Returns this Long modulo the specified. + */ + modulo(other: LongLike): Long; + + /** + * Returns this Long modulo the specified. + */ + mod(other: LongLike): Long; + + /** + * Returns this Long modulo the specified. + */ + rem(other: LongLike): Long; + + /** + * Returns the product of this and the specified Long. + */ + multiply(multiplier: LongLike): Long; + + /** + * Returns the product of this and the specified Long. + */ + mul(multiplier: LongLike): Long; + + /** + * Negates this Long's value. + */ + negate(): Long; + + /** + * Negates this Long's value. + */ + neg(): Long; + + /** + * Returns the bitwise NOT of this Long. + */ + not(): Long; + + /** + * Returns count leading zeros of this Long. + */ + countLeadingZeros(): number; + + /** + * Returns count leading zeros of this Long. + */ + clz(): number; + + /** + * Returns count trailing zeros of this Long. + */ + countTrailingZeros(): number; + + /** + * Returns count trailing zeros of this Long. + */ + ctz(): number; + + /** + * Tests if this Long's value differs from the specified's. + */ + notEquals(other: LongLike): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + neq(other: LongLike): boolean; + + /** + * Tests if this Long's value differs from the specified's. + */ + ne(other: LongLike): boolean; + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: LongLike): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shiftLeft(numBits: number | Long): Long; + + /** + * Returns this Long with bits shifted to the left by the given amount. + */ + shl(numBits: number | Long): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shiftRight(numBits: number | Long): Long; + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + */ + shr(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shiftRightUnsigned(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shru(numBits: number | Long): Long; + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + */ + shr_u(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the left by the given amount. + */ + rotateLeft(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the left by the given amount. + */ + rotl(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the right by the given amount. + */ + rotateRight(numBits: number | Long): Long; + + /** + * Returns this Long with bits rotated to the right by the given amount. + */ + rotr(numBits: number | Long): Long; + + /** + * Returns the difference of this and the specified Long. + */ + subtract(subtrahend: LongLike): Long; + + /** + * Returns the difference of this and the specified Long. + */ + sub(subtrahend: LongLike): Long; + + /** + * Converts the Long to a big integer. + */ + toBigInt(): bigint; + + /** + * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. + */ + toInt(): number; + + /** + * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). + */ + toNumber(): number; + + /** + * Converts this Long to its byte representation. + */ + + toBytes(le?: boolean): number[]; + + /** + * Converts this Long to its little endian byte representation. + */ + + toBytesLE(): number[]; + + /** + * Converts this Long to its big endian byte representation. + */ + + toBytesBE(): number[]; + + /** + * Converts this Long to signed. + */ + toSigned(): Long; + + /** + * Converts the Long to a string written in the specified radix. + */ + toString(radix?: number): string; + + /** + * Converts this Long to unsigned. + */ + toUnsigned(): Long; + + /** + * Returns the bitwise XOR of this Long and the given one. + */ + xor(other: LongLike): Long; +} diff --git a/node_modules/lru-cache/LICENSE b/node_modules/lru-cache/LICENSE new file mode 100644 index 0000000..f785757 --- /dev/null +++ b/node_modules/lru-cache/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/lru-cache/README.md b/node_modules/lru-cache/README.md new file mode 100644 index 0000000..f128330 --- /dev/null +++ b/node_modules/lru-cache/README.md @@ -0,0 +1,1117 @@ +# lru-cache + +A cache object that deletes the least-recently-used items. + +Specify a max number of the most recently used items that you +want to keep, and this cache will keep that many of the most +recently accessed items. + +This is not primarily a TTL cache, and does not make strong TTL +guarantees. There is no preemptive pruning of expired items by +default, but you _may_ set a TTL on the cache or on a single +`set`. If you do so, it will treat expired items as missing, and +delete them when fetched. If you are more interested in TTL +caching than LRU caching, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +As of version 7, this is one of the most performant LRU +implementations available in JavaScript, and supports a wide +diversity of use cases. However, note that using some of the +features will necessarily impact performance, by causing the +cache to have to do more work. See the "Performance" section +below. + +## Installation + +```bash +npm install lru-cache --save +``` + +## Usage + +```js +// hybrid module, either works +import LRUCache from 'lru-cache' +// or: +const LRUCache = require('lru-cache') + +// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent +// unsafe unbounded storage. +// +// In most cases, it's best to specify a max for performance, so all +// the required memory allocation is done up-front. +// +// All the other options are optional, see the sections below for +// documentation on what each one does. Most of them can be +// overridden for specific items in get()/set() +const options = { + max: 500, + + // for use with tracking overall storage size + maxSize: 5000, + sizeCalculation: (value, key) => { + return 1 + }, + + // for use when you need to clean up something when objects + // are evicted from the cache + dispose: (value, key) => { + freeFromMemoryOrWhatever(value) + }, + + // how long to live in ms + ttl: 1000 * 60 * 5, + + // return stale items before removing from cache? + allowStale: false, + + updateAgeOnGet: false, + updateAgeOnHas: false, + + // async method to use for cache.fetch(), for + // stale-while-revalidate type of behavior + fetchMethod: async (key, staleValue, { options, signal }) => {}, +} + +const cache = new LRUCache(options) + +cache.set('key', 'value') +cache.get('key') // "value" + +// non-string keys ARE fully supported +// but note that it must be THE SAME object, not +// just a JSON-equivalent object. +var someObject = { a: 1 } +cache.set(someObject, 'a value') +// Object keys are not toString()-ed +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') +// A similar object with same keys/values won't work, +// because it's a different object identity +assert.equal(cache.get({ a: 1 }), undefined) + +cache.clear() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +## Options + +### `max` + +The maximum number of items that remain in the cache (assuming no +TTL pruning or explicit deletions). Note that fewer items may be +stored if size calculation is used, and `maxSize` is exceeded. +This must be a positive finite intger. + +At least one of `max`, `maxSize`, or `TTL` is required. This +must be a positive integer if set. + +**It is strongly recommended to set a `max` to prevent unbounded +growth of the cache.** See "Storage Bounds Safety" below. + +### `maxSize` + +Set to a positive integer to track the sizes of items added to +the cache, and automatically evict items in order to stay below +this size. Note that this may result in fewer than `max` items +being stored. + +Attempting to add an item to the cache whose calculated size is +greater that this amount will be a no-op. The item will not be +cached, and no other items will be evicted. + +Optional, must be a positive integer if provided. + +Sets `maxEntrySize` to the same value, unless a different value +is provided for `maxEntrySize`. + +At least one of `max`, `maxSize`, or `TTL` is required. This +must be a positive integer if set. + +Even if size tracking is enabled, **it is strongly recommended to +set a `max` to prevent unbounded growth of the cache.** See +"Storage Bounds Safety" below. + +### `maxEntrySize` + +Set to a positive integer to track the sizes of items added to +the cache, and prevent caching any item over a given size. +Attempting to add an item whose calculated size is greater than +this amount will be a no-op. The item will not be cached, and no +other items will be evicted. + +Optional, must be a positive integer if provided. Defaults to +the value of `maxSize` if provided. + +### `sizeCalculation` + +Function used to calculate the size of stored items. If you're +storing strings or buffers, then you probably want to do +something like `n => n.length`. The item is passed as the first +argument, and the key is passed as the second argument. + +This may be overridden by passing an options object to +`cache.set()`. + +Requires `maxSize` to be set. + +If the `size` (or return value of `sizeCalculation`) for a given +entry is greater than `maxEntrySize`, then the item will not be +added to the cache. + +Deprecated alias: `length` + +### `fetchMethod` + +Function that is used to make background asynchronous fetches. +Called with `fetchMethod(key, staleValue, { signal, options, +context })`. May return a Promise. + +If `fetchMethod` is not provided, then `cache.fetch(key)` is +equivalent to `Promise.resolve(cache.get(key))`. + +The `signal` object is an `AbortSignal` if that's available in +the global object, otherwise it's a pretty close polyfill. + +If at any time, `signal.aborted` is set to `true`, or if the +`signal.onabort` method is called, or if it emits an `'abort'` +event which you can listen to with `addEventListener`, then that +means that the fetch should be abandoned. This may be passed +along to async functions aware of AbortController/AbortSignal +behavior. + +The `fetchMethod` should **only** return `undefined` or a Promise +resolving to `undefined` if the AbortController signaled an +`abort` event. In all other cases, it should return or resolve +to a value suitable for adding to the cache. + +The `options` object is a union of the options that may be +provided to `set()` and `get()`. If they are modified, then that +will result in modifying the settings to `cache.set()` when the +value is resolved, and in the case of `noDeleteOnFetchRejection` +and `allowStaleOnFetchRejection`, the handling of `fetchMethod` +failures. + +For example, a DNS cache may update the TTL based on the value +returned from a remote DNS server by changing `options.ttl` in +the `fetchMethod`. + +### `fetchContext` + +Arbitrary data that can be passed to the `fetchMethod` as the +`context` option. + +Note that this will only be relevant when the `cache.fetch()` +call needs to call `fetchMethod()`. Thus, any data which will +meaningfully vary the fetch response needs to be present in the +key. This is primarily intended for including `x-request-id` +headers and the like for debugging purposes, which do not affect +the `fetchMethod()` response. + +### `noDeleteOnFetchRejection` + +If a `fetchMethod` throws an error or returns a rejected promise, +then by default, any existing stale value will be removed from +the cache. + +If `noDeleteOnFetchRejection` is set to `true`, then this +behavior is suppressed, and the stale value remains in the cache +in the case of a rejected `fetchMethod`. + +This is important in cases where a `fetchMethod` is _only_ called +as a background update while the stale value is returned, when +`allowStale` is used. + +This is implicitly in effect when `allowStaleOnFetchRejection` is +set. + +This may be set in calls to `fetch()`, or defaulted on the +constructor, or overridden by modifying the options object in the +`fetchMethod`. + +### `allowStaleOnFetchRejection` + +Set to true to return a stale value from the cache when a +`fetchMethod` throws an error or returns a rejected Promise. + +If a `fetchMethod` fails, and there is no stale value available, +the `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` +errors are suppressed. + +Implies `noDeleteOnFetchRejection`. + +This may be set in calls to `fetch()`, or defaulted on the +constructor, or overridden by modifying the options object in the +`fetchMethod`. + +### `allowStaleOnFetchAbort` + +Set to true to return a stale value from the cache when the +`AbortSignal` passed to the `fetchMethod` dispatches an `'abort'` +event, whether user-triggered, or due to internal cache behavior. + +Unless `ignoreFetchAbort` is also set, the underlying +`fetchMethod` will still be considered canceled, and its return +value will be ignored and not cached. + +### `ignoreFetchAbort` + +Set to true to ignore the `abort` event emitted by the +`AbortSignal` object passed to `fetchMethod`, and still cache the +resulting resolution value, as long as it is not `undefined`. + +When used on its own, this means aborted `fetch()` calls are not +immediately resolved or rejected when they are aborted, and +instead take the full time to await. + +When used with `allowStaleOnFetchAbort`, aborted `fetch()` calls +will resolve immediately to their stale cached value or +`undefined`, and will continue to process and eventually update +the cache when they resolve, as long as the resulting value is +not `undefined`, thus supporting a "return stale on timeout while +refreshing" mechanism by passing `AbortSignal.timeout(n)` as the +signal. + +For example: + +```js +const c = new LRUCache({ + ttl: 100, + ignoreFetchAbort: true, + allowStaleOnFetchAbort: true, + fetchMethod: async (key, oldValue, { signal }) => { + // note: do NOT pass the signal to fetch()! + // let's say this fetch can take a long time. + const res = await fetch(`https://slow-backend-server/${key}`) + return await res.json() + }, +}) + +// this will return the stale value after 100ms, while still +// updating in the background for next time. +const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) +``` + +**Note**: regardless of this setting, an `abort` event _is still +emitted on the `AbortSignal` object_, so may result in invalid +results when passed to other underlying APIs that use +AbortSignals. + +This may be overridden on the `fetch()` call or in the +`fetchMethod` itself. + +### `dispose` + +Function that is called on items when they are dropped from the +cache, as `this.dispose(value, key, reason)`. + +This can be handy if you want to close file descriptors or do +other cleanup tasks when items are no longer stored in the cache. + +**NOTE**: It is called _before_ the item has been fully removed +from the cache, so if you want to put it right back in, you need +to wait until the next tick. If you try to add it back in during +the `dispose()` function call, it will break things in subtle and +weird ways. + +Unlike several other options, this may _not_ be overridden by +passing an option to `set()`, for performance reasons. If +disposal functions may vary between cache entries, then the +entire list must be scanned on every cache swap, even if no +disposal function is in use. + +The `reason` will be one of the following strings, corresponding +to the reason for the item's deletion: + +- `evict` Item was evicted to make space for a new addition +- `set` Item was overwritten by a new value +- `delete` Item was removed by explicit `cache.delete(key)` or by + calling `cache.clear()`, which deletes everything. + +The `dispose()` method is _not_ called for canceled calls to +`fetchMethod()`. If you wish to handle evictions, overwrites, +and deletes of in-flight asynchronous fetches, you must use the +`AbortSignal` provided. + +Optional, must be a function. + +### `disposeAfter` + +The same as `dispose`, but called _after_ the entry is completely +removed and the cache is once again in a clean state. + +It is safe to add an item right back into the cache at this +point. However, note that it is _very_ easy to inadvertently +create infinite recursion in this way. + +The `disposeAfter()` method is _not_ called for canceled calls to +`fetchMethod()`. If you wish to handle evictions, overwrites, +and deletes of in-flight asynchronous fetches, you must use the +`AbortSignal` provided. + +### `noDisposeOnSet` + +Set to `true` to suppress calling the `dispose()` function if the +entry key is still accessible within the cache. + +This may be overridden by passing an options object to +`cache.set()`. + +Boolean, default `false`. Only relevant if `dispose` or +`disposeAfter` options are set. + +### `ttl` + +Max time to live for items before they are considered stale. +Note that stale items are NOT preemptively removed by default, +and MAY live in the cache, contributing to its LRU max, long +after they have expired. + +Also, as this cache is optimized for LRU/MRU operations, some of +the staleness/TTL checks will reduce performance. + +This is not primarily a TTL cache, and does not make strong TTL +guarantees. There is no pre-emptive pruning of expired items, +but you _may_ set a TTL on the cache, and it will treat expired +items as missing when they are fetched, and delete them. + +Optional, but must be a positive integer in ms if specified. + +This may be overridden by passing an options object to +`cache.set()`. + +At least one of `max`, `maxSize`, or `TTL` is required. This +must be a positive integer if set. + +Even if ttl tracking is enabled, **it is strongly recommended to +set a `max` to prevent unbounded growth of the cache.** See +"Storage Bounds Safety" below. + +If ttl tracking is enabled, and `max` and `maxSize` are not set, +and `ttlAutopurge` is not set, then a warning will be emitted +cautioning about the potential for unbounded memory consumption. + +Deprecated alias: `maxAge` + +### `noUpdateTTL` + +Boolean flag to tell the cache to not update the TTL when setting +a new value for an existing key (ie, when updating a value rather +than inserting a new value). Note that the TTL value is _always_ +set (if provided) when adding a new entry into the cache. + +This may be passed as an option to `cache.set()`. + +Boolean, default false. + +### `ttlResolution` + +Minimum amount of time in ms in which to check for staleness. +Defaults to `1`, which means that the current time is checked at +most once per millisecond. + +Set to `0` to check the current time every time staleness is +tested. + +Note that setting this to a higher value _will_ improve +performance somewhat while using ttl tracking, albeit at the +expense of keeping stale items around a bit longer than intended. + +### `ttlAutopurge` + +Preemptively remove stale items from the cache. + +Note that this may _significantly_ degrade performance, +especially if the cache is storing a large number of items. It +is almost always best to just leave the stale items in the cache, +and let them fall out as new items are added. + +Note that this means that `allowStale` is a bit pointless, as +stale items will be deleted almost as soon as they expire. + +Use with caution! + +Boolean, default `false` + +### `allowStale` + +By default, if you set `ttl`, it'll only delete stale items from +the cache when you `get(key)`. That is, it's not preemptively +pruning items. + +If you set `allowStale:true`, it'll return the stale value as +well as deleting it. If you don't set this, then it'll return +`undefined` when you try to get a stale entry. + +Note that when a stale entry is fetched, _even if it is returned +due to `allowStale` being set_, it is removed from the cache +immediately. You can immediately put it back in the cache if you +wish, thus resetting the TTL. + +This may be overridden by passing an options object to +`cache.get()`. The `cache.has()` method will always return +`false` for stale items. + +Boolean, default false, only relevant if `ttl` is set. + +Deprecated alias: `stale` + +### `noDeleteOnStaleGet` + +When using time-expiring entries with `ttl`, by default stale +items will be removed from the cache when the key is accessed +with `cache.get()`. + +Setting `noDeleteOnStaleGet` to `true` will cause stale items to +remain in the cache, until they are explicitly deleted with +`cache.delete(key)`, or retrieved with `noDeleteOnStaleGet` set +to `false`. + +This may be overridden by passing an options object to +`cache.get()`. + +Boolean, default false, only relevant if `ttl` is set. + +### `updateAgeOnGet` + +When using time-expiring entries with `ttl`, setting this to +`true` will make each item's age reset to 0 whenever it is +retrieved from cache with `get()`, causing it to not expire. (It +can still fall out of cache based on recency of use, of course.) + +This may be overridden by passing an options object to +`cache.get()`. + +Boolean, default false, only relevant if `ttl` is set. + +### `updateAgeOnHas` + +When using time-expiring entries with `ttl`, setting this to +`true` will make each item's age reset to 0 whenever its presence +in the cache is checked with `has()`, causing it to not expire. +(It can still fall out of cache based on recency of use, of +course.) + +This may be overridden by passing an options object to +`cache.has()`. + +Boolean, default false, only relevant if `ttl` is set. + +## API + +### `new LRUCache(options)` + +Create a new LRUCache. All options are documented above, and are +on the cache as public members. + +### `cache.max`, `cache.maxSize`, `cache.allowStale`, + +`cache.noDisposeOnSet`, `cache.sizeCalculation`, `cache.dispose`, +`cache.maxSize`, `cache.ttl`, `cache.updateAgeOnGet`, +`cache.updateAgeOnHas` + +All option names are exposed as public members on the cache +object. + +These are intended for read access only. Changing them during +program operation can cause undefined behavior. + +### `cache.size` + +The total number of items held in the cache at the current +moment. + +### `cache.calculatedSize` + +The total size of items in cache when using size tracking. + +### `set(key, value, [{ size, sizeCalculation, ttl, noDisposeOnSet, start, status }])` + +Add a value to the cache. + +Optional options object may contain `ttl` and `sizeCalculation` +as described above, which default to the settings on the cache +object. + +If `start` is provided, then that will set the effective start +time for the TTL calculation. Note that this must be a previous +value of `performance.now()` if supported, or a previous value of +`Date.now()` if not. + +Options object may also include `size`, which will prevent +calling the `sizeCalculation` function and just use the specified +number if it is a positive integer, and `noDisposeOnSet` which +will prevent calling a `dispose` function in the case of +overwrites. + +If the `size` (or return value of `sizeCalculation`) for a given +entry is greater than `maxEntrySize`, then the item will not be +added to the cache. + +Will update the recency of the entry. + +Returns the cache object. + +For the usage of the `status` option, see **Status Tracking** +below. + +### `get(key, { updateAgeOnGet, allowStale, status } = {}) => value` + +Return a value from the cache. + +Will update the recency of the cache entry found. + +If the key is not found, `get()` will return `undefined`. This +can be confusing when setting values specifically to `undefined`, +as in `cache.set(key, undefined)`. Use `cache.has()` to +determine whether a key is present in the cache at all. + +For the usage of the `status` option, see **Status Tracking** +below. + +### `async fetch(key, options = {}) => Promise` + +The following options are supported: + +- `updateAgeOnGet` +- `allowStale` +- `size` +- `sizeCalculation` +- `ttl` +- `noDisposeOnSet` +- `forceRefresh` +- `status` - See **Status Tracking** below. +- `signal` - AbortSignal can be used to cancel the `fetch()`. + Note that the `signal` option provided to the `fetchMethod` is + a different object, because it must also respond to internal + cache state changes, but aborting this signal will abort the + one passed to `fetchMethod` as well. +- `fetchContext` - sets the `context` option passed to the + underlying `fetchMethod`. + +If the value is in the cache and not stale, then the returned +Promise resolves to the value. + +If not in the cache, or beyond its TTL staleness, then +`fetchMethod(key, staleValue, { options, signal, context })` is +called, and the value returned will be added to the cache once +resolved. + +If called with `allowStale`, and an asynchronous fetch is +currently in progress to reload a stale value, then the former +stale value will be returned. + +If called with `forceRefresh`, then the cached item will be +re-fetched, even if it is not stale. However, if `allowStale` is +set, then the old value will still be returned. This is useful +in cases where you want to force a reload of a cached value. If +a background fetch is already in progress, then `forceRefresh` +has no effect. + +Multiple fetches for the same `key` will only call `fetchMethod` +a single time, and all will be resolved when the value is +resolved, even if different options are used. + +If `fetchMethod` is not specified, then this is effectively an +alias for `Promise.resolve(cache.get(key))`. + +When the fetch method resolves to a value, if the fetch has not +been aborted due to deletion, eviction, or being overwritten, +then it is added to the cache using the options provided. + +If the key is evicted or deleted before the `fetchMethod` +resolves, then the AbortSignal passed to the `fetchMethod` will +receive an `abort` event, and the promise returned by `fetch()` +will reject with the reason for the abort. + +If a `signal` is passed to the `fetch()` call, then aborting the +signal will abort the fetch and cause the `fetch()` promise to +reject with the reason provided. + +### `peek(key, { allowStale } = {}) => value` + +Like `get()` but doesn't update recency or delete stale items. + +Returns `undefined` if the item is stale, unless `allowStale` is +set either on the cache or in the options object. + +### `has(key, { updateAgeOnHas, status } = {}) => Boolean` + +Check if a key is in the cache, without updating the recency of +use. Age is updated if `updateAgeOnHas` is set to `true` in +either the options or the constructor. + +Will return `false` if the item is stale, even though it is +technically in the cache. The difference can be determined (if +it matters) by using a `status` argument, and inspecting the +`has` field. + +For the usage of the `status` option, see **Status Tracking** +below. + +### `delete(key)` + +Deletes a key out of the cache. + +Returns `true` if the key was deleted, `false` otherwise. + +### `clear()` + +Clear the cache entirely, throwing away all values. + +Deprecated alias: `reset()` + +### `keys()` + +Return a generator yielding the keys in the cache, in order from +most recently used to least recently used. + +### `rkeys()` + +Return a generator yielding the keys in the cache, in order from +least recently used to most recently used. + +### `values()` + +Return a generator yielding the values in the cache, in order +from most recently used to least recently used. + +### `rvalues()` + +Return a generator yielding the values in the cache, in order +from least recently used to most recently used. + +### `entries()` + +Return a generator yielding `[key, value]` pairs, in order from +most recently used to least recently used. + +### `rentries()` + +Return a generator yielding `[key, value]` pairs, in order from +least recently used to most recently used. + +### `find(fn, [getOptions])` + +Find a value for which the supplied `fn` method returns a truthy +value, similar to `Array.find()`. + +`fn` is called as `fn(value, key, cache)`. + +The optional `getOptions` are applied to the resulting `get()` of +the item found. + +### `dump()` + +Return an array of `[key, entry]` objects which can be passed to +`cache.load()` + +The `start` fields are calculated relative to a portable +`Date.now()` timestamp, even if `performance.now()` is available. + +Stale entries are always included in the `dump`, even if +`allowStale` is false. + +Note: this returns an actual array, not a generator, so it can be +more easily passed around. + +### `load(entries)` + +Reset the cache and load in the items in `entries` in the order +listed. Note that the shape of the resulting cache may be +different if the same options are not used in both caches. + +The `start` fields are assumed to be calculated relative to a +portable `Date.now()` timestamp, even if `performance.now()` is +available. + +### `purgeStale()` + +Delete any stale entries. Returns `true` if anything was +removed, `false` otherwise. + +Deprecated alias: `prune` + +### `getRemainingTTL(key)` + +Return the number of ms left in the item's TTL. If item is not +in cache, returns `0`. Returns `Infinity` if item is in cache +without a defined TTL. + +### `forEach(fn, [thisp])` + +Call the `fn` function with each set of `fn(value, key, cache)` +in the LRU cache, from most recent to least recently used. + +Does not affect recency of use. + +If `thisp` is provided, function will be called in the +`this`-context of the provided object. + +### `rforEach(fn, [thisp])` + +Same as `cache.forEach(fn, thisp)`, but in order from least +recently used to most recently used. + +### `pop()` + +Evict the least recently used item, returning its value. + +Returns `undefined` if cache is empty. + +### Internal Methods and Properties + +In order to optimize performance as much as possible, "private" +members and methods are exposed on the object as normal +properties, rather than being accessed via Symbols, private +members, or closure variables. + +**Do not use or rely on these.** They will change or be removed +without notice. They will cause undefined behavior if used +inappropriately. There is no need or reason to ever call them +directly. + +This documentation is here so that it is especially clear that +this not "undocumented" because someone forgot; it _is_ +documented, and the documentation is telling you not to do it. + +**Do not report bugs that stem from using these properties.** +They will be ignored. + +- `initializeTTLTracking()` Set up the cache for tracking TTLs +- `updateItemAge(index)` Called when an item age is updated, by + internal ID +- `setItemTTL(index)` Called when an item ttl is updated, by + internal ID +- `isStale(index)` Called to check an item's staleness, by + internal ID +- `initializeSizeTracking()` Set up the cache for tracking item + size. Called automatically when a size is specified. +- `removeItemSize(index)` Updates the internal size calculation + when an item is removed or modified, by internal ID +- `addItemSize(index)` Updates the internal size calculation when + an item is added or modified, by internal ID +- `indexes()` An iterator over the non-stale internal IDs, from + most recently to least recently used. +- `rindexes()` An iterator over the non-stale internal IDs, from + least recently to most recently used. +- `newIndex()` Create a new internal ID, either reusing a deleted + ID, evicting the least recently used ID, or walking to the end + of the allotted space. +- `evict()` Evict the least recently used internal ID, returning + its ID. Does not do any bounds checking. +- `connect(p, n)` Connect the `p` and `n` internal IDs in the + linked list. +- `moveToTail(index)` Move the specified internal ID to the most + recently used position. +- `keyMap` Map of keys to internal IDs +- `keyList` List of keys by internal ID +- `valList` List of values by internal ID +- `sizes` List of calculated sizes by internal ID +- `ttls` List of TTL values by internal ID +- `starts` List of start time values by internal ID +- `next` Array of "next" pointers by internal ID +- `prev` Array of "previous" pointers by internal ID +- `head` Internal ID of least recently used item +- `tail` Internal ID of most recently used item +- `free` Stack of deleted internal IDs + +## Status Tracking + +Occasionally, it may be useful to track the internal behavior of +the cache, particularly for logging, debugging, or for behavior +within the `fetchMethod`. To do this, you can pass a `status` +object to the `get()`, `set()`, `has()`, and `fetch()` methods. + +The `status` option should be a plain JavaScript object. + +The following fields will be set appropriately: + +```ts +interface Status { + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' + + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: LRUMilliseconds + + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: LRUMilliseconds + + /** + * The timestamp used for TTL calculation + */ + now?: LRUMilliseconds + + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: LRUMilliseconds + + /** + * The calculated size for the item, if sizes are used. + */ + size?: LRUSize + + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link maxEntrySize} + */ + maxEntrySizeExceeded?: true + + /** + * The old value, specified in the case of `set:'update'` or + * `set:'replace'` + */ + oldValue?: V + + /** + * The results of a {@link has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss' + + /** + * The status of a {@link fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no fetchMethod, so {@link get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh' + + /** + * The {@link fetchMethod} was called + */ + fetchDispatched?: true + + /** + * The cached value was updated after a successful call to fetchMethod + */ + fetchUpdated?: true + + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link fetchMethod}, or the reason for an AbortSignal. + */ + fetchError?: Error + + /** + * The fetch received an abort signal + */ + fetchAborted?: true + + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue. + */ + fetchAbortIgnored?: true + + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true + + /** + * The results of the fetchMethod promise were stored in the cache + */ + fetchUpdated?: true + + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true + + /** + * The status of a {@link get} operation. + * + * - fetching: The item is currently being fetched. If a previous value is + * present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' + + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true +} +``` + +## Storage Bounds Safety + +This implementation aims to be as flexible as possible, within +the limits of safe memory consumption and optimal performance. + +At initial object creation, storage is allocated for `max` items. +If `max` is set to zero, then some performance is lost, and item +count is unbounded. Either `maxSize` or `ttl` _must_ be set if +`max` is not specified. + +If `maxSize` is set, then this creates a safe limit on the +maximum storage consumed, but without the performance benefits of +pre-allocation. When `maxSize` is set, every item _must_ provide +a size, either via the `sizeCalculation` method provided to the +constructor, or via a `size` or `sizeCalculation` option provided +to `cache.set()`. The size of every item _must_ be a positive +integer. + +If neither `max` nor `maxSize` are set, then `ttl` tracking must +be enabled. Note that, even when tracking item `ttl`, items are +_not_ preemptively deleted when they become stale, unless +`ttlAutopurge` is enabled. Instead, they are only purged the +next time the key is requested. Thus, if `ttlAutopurge`, `max`, +and `maxSize` are all not set, then the cache will potentially +grow unbounded. + +In this case, a warning is printed to standard error. Future +versions may require the use of `ttlAutopurge` if `max` and +`maxSize` are not specified. + +If you truly wish to use a cache that is bound _only_ by TTL +expiration, consider using a `Map` object, and calling +`setTimeout` to delete entries when they expire. It will perform +much better than an LRU cache. + +Here is an implementation you may use, under the same +[license](./LICENSE) as this package: + +```js +// a storage-unbounded ttl cache that is not an lru-cache +const cache = { + data: new Map(), + timers: new Map(), + set: (k, v, ttl) => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.set( + k, + setTimeout(() => cache.delete(k), ttl) + ) + cache.data.set(k, v) + }, + get: k => cache.data.get(k), + has: k => cache.data.has(k), + delete: k => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.delete(k) + return cache.data.delete(k) + }, + clear: () => { + cache.data.clear() + for (const v of cache.timers.values()) { + clearTimeout(v) + } + cache.timers.clear() + }, +} +``` + +If that isn't to your liking, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +## Performance + +As of January 2022, version 7 of this library is one of the most +performant LRU cache implementations in JavaScript. + +Benchmarks can be extremely difficult to get right. In +particular, the performance of set/get/delete operations on +objects will vary _wildly_ depending on the type of key used. V8 +is highly optimized for objects with keys that are short strings, +especially integer numeric strings. Thus any benchmark which +tests _solely_ using numbers as keys will tend to find that an +object-based approach performs the best. + +Note that coercing _anything_ to strings to use as object keys is +unsafe, unless you can be 100% certain that no other type of +value will be used. For example: + +```js +const myCache = {} +const set = (k, v) => (myCache[k] = v) +const get = k => myCache[k] + +set({}, 'please hang onto this for me') +set('[object Object]', 'oopsie') +``` + +Also beware of "Just So" stories regarding performance. Garbage +collection of large (especially: deep) object graphs can be +incredibly costly, with several "tipping points" where it +increases exponentially. As a result, putting that off until +later can make it much worse, and less predictable. If a library +performs well, but only in a scenario where the object graph is +kept shallow, then that won't help you if you are using large +objects as keys. + +In general, when attempting to use a library to improve +performance (such as a cache like this one), it's best to choose +an option that will perform well in the sorts of scenarios where +you'll actually use it. + +This library is optimized for repeated gets and minimizing +eviction time, since that is the expected need of a LRU. Set +operations are somewhat slower on average than a few other +options, in part because of that optimization. It is assumed +that you'll be caching some costly operation, ideally as rarely +as possible, so optimizing set over get would be unwise. + +If performance matters to you: + +1. If it's at all possible to use small integer values as keys, + and you can guarantee that no other types of values will be + used as keys, then do that, and use a cache such as + [lru-fast](https://npmjs.com/package/lru-fast), or + [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache) + which uses an Object as its data store. +2. Failing that, if at all possible, use short non-numeric + strings (ie, less than 256 characters) as your keys, and use + [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache). +3. If the types of your keys will be long strings, strings that + look like floats, `null`, objects, or some mix of types, or if + you aren't sure, then this library will work well for you. +4. Do not use a `dispose` function, size tracking, or especially + ttl behavior, unless absolutely needed. These features are + convenient, and necessary in some use cases, and every attempt + has been made to make the performance impact minimal, but it + isn't nothing. + +## Breaking Changes in Version 7 + +This library changed to a different algorithm and internal data +structure in version 7, yielding significantly better +performance, albeit with some subtle changes as a result. + +If you were relying on the internals of LRUCache in version 6 or +before, it probably will not work in version 7 and above. + +For more info, see the [change log](CHANGELOG.md). diff --git a/node_modules/lru-cache/index.d.ts b/node_modules/lru-cache/index.d.ts new file mode 100644 index 0000000..b58395e --- /dev/null +++ b/node_modules/lru-cache/index.d.ts @@ -0,0 +1,869 @@ +// Project: https://github.com/isaacs/node-lru-cache +// Based initially on @types/lru-cache +// https://github.com/DefinitelyTyped/DefinitelyTyped +// used under the terms of the MIT License, shown below. +// +// DefinitelyTyped license: +// ------ +// MIT License +// +// Copyright (c) Microsoft Corporation. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE +// ------ +// +// Changes by Isaac Z. Schlueter released under the terms found in the +// LICENSE file within this project. + +/** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ +declare type LRUMilliseconds = number + +/** + * An integer greater than 0, reflecting the calculated size of items + */ +declare type LRUSize = number + +/** + * An integer greater than 0, reflecting a number of items + */ +declare type LRUCount = number + +declare class LRUCache implements Iterable<[K, V]> { + constructor(options: LRUCache.Options) + + /** + * Number of items in the cache. + * Alias for {@link size} + * + * @deprecated since 7.0 use {@link size} instead + */ + public readonly length: LRUCount + + public readonly max: LRUCount + public readonly maxSize: LRUSize + public readonly maxEntrySize: LRUSize + public readonly sizeCalculation: + | LRUCache.SizeCalculator + | undefined + public readonly dispose: LRUCache.Disposer + /** + * @since 7.4.0 + */ + public readonly disposeAfter: LRUCache.Disposer | null + public readonly noDisposeOnSet: boolean + public readonly ttl: LRUMilliseconds + public readonly ttlResolution: LRUMilliseconds + public readonly ttlAutopurge: boolean + public readonly allowStale: boolean + public readonly updateAgeOnGet: boolean + /** + * @since 7.11.0 + */ + public readonly noDeleteOnStaleGet: boolean + /** + * @since 7.6.0 + */ + public readonly fetchMethod: LRUCache.Fetcher | null + + /** + * The total number of items held in the cache at the current moment. + */ + public readonly size: LRUCount + + /** + * The total size of items in cache when using size tracking. + */ + public readonly calculatedSize: LRUSize + + /** + * Add a value to the cache. + */ + public set( + key: K, + value: V, + options?: LRUCache.SetOptions + ): this + + /** + * Return a value from the cache. Will update the recency of the cache entry + * found. + * + * If the key is not found, {@link get} will return `undefined`. This can be + * confusing when setting values specifically to `undefined`, as in + * `cache.set(key, undefined)`. Use {@link has} to determine whether a key is + * present in the cache at all. + */ + public get(key: K, options?: LRUCache.GetOptions): V | undefined + + /** + * Like {@link get} but doesn't update recency or delete stale items. + * Returns `undefined` if the item is stale, unless {@link allowStale} is set + * either on the cache or in the options object. + */ + public peek(key: K, options?: LRUCache.PeekOptions): V | undefined + + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Will not update item age unless {@link updateAgeOnHas} is set in the + * options or constructor. + */ + public has(key: K, options?: LRUCache.HasOptions): boolean + + /** + * Deletes a key out of the cache. + * Returns true if the key was deleted, false otherwise. + */ + public delete(key: K): boolean + + /** + * Clear the cache entirely, throwing away all values. + */ + public clear(): void + + /** + * Delete any stale entries. Returns true if anything was removed, false + * otherwise. + */ + public purgeStale(): boolean + + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to Array.find(). fn is called as fn(value, key, cache). + */ + public find( + callbackFn: ( + value: V, + key: K, + cache: this + ) => boolean | undefined | void, + options?: LRUCache.GetOptions + ): V | undefined + + /** + * Call the supplied function on each item in the cache, in order from + * most recently used to least recently used. fn is called as + * fn(value, key, cache). Does not update age or recenty of use. + */ + public forEach( + callbackFn: (this: T, value: V, key: K, cache: this) => void, + thisArg?: T + ): void + + /** + * The same as {@link forEach} but items are iterated over in reverse + * order. (ie, less recently used items are iterated over first.) + */ + public rforEach( + callbackFn: (this: T, value: V, key: K, cache: this) => void, + thisArg?: T + ): void + + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + public keys(): Generator + + /** + * Inverse order version of {@link keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + public rkeys(): Generator + + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + public values(): Generator + + /** + * Inverse order version of {@link values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + public rvalues(): Generator + + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + public entries(): Generator<[K, V], void, void> + + /** + * Inverse order version of {@link entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + public rentries(): Generator<[K, V], void, void> + + /** + * Iterating over the cache itself yields the same results as + * {@link entries} + */ + public [Symbol.iterator](): Generator<[K, V], void, void> + + /** + * Return an array of [key, entry] objects which can be passed to + * cache.load() + */ + public dump(): Array<[K, LRUCache.Entry]> + + /** + * Reset the cache and load in the items in entries in the order listed. + * Note that the shape of the resulting cache may be different if the + * same options are not used in both caches. + */ + public load( + cacheEntries: ReadonlyArray<[K, LRUCache.Entry]> + ): void + + /** + * Evict the least recently used item, returning its value or `undefined` + * if cache is empty. + */ + public pop(): V | undefined + + /** + * Deletes a key out of the cache. + * + * @deprecated since 7.0 use delete() instead + */ + public del(key: K): boolean + + /** + * Clear the cache entirely, throwing away all values. + * + * @deprecated since 7.0 use clear() instead + */ + public reset(): void + + /** + * Manually iterates over the entire cache proactively pruning old entries. + * + * @deprecated since 7.0 use purgeStale() instead + */ + public prune(): boolean + + /** + * Make an asynchronous cached fetch using the {@link fetchMethod} function. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link allowStaleOnFetchAbort}, {@link signal}, and + * {@link allowStaleOnFetchRejection} will be determined by the FIRST fetch() + * call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * since: 7.6.0 + */ + public fetch( + key: K, + options?: LRUCache.FetchOptions + ): Promise + + /** + * since: 7.6.0 + */ + public getRemainingTTL(key: K): LRUMilliseconds +} + +declare namespace LRUCache { + type DisposeReason = 'evict' | 'set' | 'delete' + + type SizeCalculator = (value: V, key: K) => LRUSize + type Disposer = ( + value: V, + key: K, + reason: DisposeReason + ) => void + type Fetcher = ( + key: K, + staleValue: V | undefined, + options: FetcherOptions + ) => Promise | V | void | undefined + + interface DeprecatedOptions { + /** + * alias for ttl + * + * @deprecated since 7.0 use options.ttl instead + */ + maxAge?: LRUMilliseconds + + /** + * alias for {@link sizeCalculation} + * + * @deprecated since 7.0 use {@link sizeCalculation} instead + */ + length?: SizeCalculator + + /** + * alias for allowStale + * + * @deprecated since 7.0 use options.allowStale instead + */ + stale?: boolean + } + + interface LimitedByCount { + /** + * The number of most recently used items to keep. + * Note that we may store fewer items than this if maxSize is hit. + */ + max: LRUCount + } + + type MaybeMaxEntrySizeLimit = + | { + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link set} or returned by a + * {@link fetchMethod}, then it will not be stored in the cache. + */ + maxEntrySize: LRUSize + sizeCalculation?: SizeCalculator + } + | {} + + interface LimitedBySize { + /** + * If you wish to track item size, you must provide a maxSize + * note that we still will only keep up to max *actual items*, + * if max is set, so size tracking may cause fewer than max items + * to be stored. At the extreme, a single item of maxSize size + * will cause everything else in the cache to be dropped when it + * is added. Use with caution! + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize: LRUSize + + /** + * Function to calculate size of items. Useful if storing strings or + * buffers or other items where memory size depends on the object itself. + * + * Items larger than {@link maxEntrySize} will not be stored in the cache. + * + * Note that when {@link maxSize} or {@link maxEntrySize} are set, every + * item added MUST have a size specified, either via a `sizeCalculation` in + * the constructor, or `sizeCalculation` or {@link size} options to + * {@link set}. + */ + sizeCalculation?: SizeCalculator + } + + interface LimitedByTTL { + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed + * by default, and MAY live in the cache, contributing to its LRU max, + * long after they have expired. + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * Must be an integer number of ms, defaults to 0, which means "no TTL" + */ + ttl: LRUMilliseconds + + /** + * Boolean flag to tell the cache to not update the TTL when + * setting a new value for an existing key (ie, when updating a value + * rather than inserting a new value). Note that the TTL value is + * _always_ set (if provided) when adding a new entry into the cache. + * + * @default false + * @since 7.4.0 + */ + noUpdateTTL?: boolean + + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + * @since 7.1.0 + */ + ttlResolution?: LRUMilliseconds + + /** + * Preemptively remove stale items from the cache. + * Note that this may significantly degrade performance, + * especially if the cache is storing a large number of items. + * It is almost always best to just leave the stale items in + * the cache, and let them fall out as new items are added. + * + * Note that this means that {@link allowStale} is a bit pointless, + * as stale items will be deleted almost as soon as they expire. + * + * Use with caution! + * + * @default false + * @since 7.1.0 + */ + ttlAutopurge?: boolean + + /** + * Return stale items from {@link get} before disposing of them. + * Return stale values from {@link fetch} while performing a call + * to the {@link fetchMethod} in the background. + * + * @default false + */ + allowStale?: boolean + + /** + * Update the age of items on {@link get}, renewing their TTL + * + * @default false + */ + updateAgeOnGet?: boolean + + /** + * Do not delete stale items when they are retrieved with {@link get}. + * Note that the {@link get} return value will still be `undefined` unless + * allowStale is true. + * + * @default false + * @since 7.11.0 + */ + noDeleteOnStaleGet?: boolean + + /** + * Update the age of items on {@link has}, renewing their TTL + * + * @default false + */ + updateAgeOnHas?: boolean + } + + type SafetyBounds = + | LimitedByCount + | LimitedBySize + | LimitedByTTL + + // options shared by all three of the limiting scenarios + interface SharedOptions { + /** + * Function that is called on items when they are dropped from the cache. + * This can be handy if you want to close file descriptors or do other + * cleanup tasks when items are no longer accessible. Called with `key, + * value`. It's called before actually removing the item from the + * internal cache, so it is *NOT* safe to re-add them. + * Use {@link disposeAfter} if you wish to dispose items after they have + * been full removed, when it is safe to add them back to the cache. + */ + dispose?: Disposer + + /** + * The same as dispose, but called *after* the entry is completely + * removed and the cache is once again in a clean state. It is safe to + * add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + * + * @since 7.3.0 + */ + disposeAfter?: Disposer + + /** + * Set to true to suppress calling the dispose() function if the entry + * key is still accessible within the cache. + * This may be overridden by passing an options object to {@link set}. + * + * @default false + */ + noDisposeOnSet?: boolean + + /** + * Function that is used to make background asynchronous fetches. Called + * with `fetchMethod(key, staleValue, { signal, options, context })`. + * + * If `fetchMethod` is not provided, then {@link fetch} is + * equivalent to `Promise.resolve(cache.get(key))`. + * + * The `fetchMethod` should ONLY return `undefined` in cases where the + * abort controller has sent an abort signal. + * + * @since 7.6.0 + */ + fetchMethod?: LRUCache.Fetcher + + /** + * Set to true to suppress the deletion of stale data when a + * {@link fetchMethod} throws an error or returns a rejected promise + * + * This may be overridden in the {@link fetchMethod}. + * + * @default false + * @since 7.10.0 + */ + noDeleteOnFetchRejection?: boolean + + /** + * Set to true to allow returning stale data when a {@link fetchMethod} + * throws an error or returns a rejected promise. Note that this + * differs from using {@link allowStale} in that stale data will + * ONLY be returned in the case that the fetch fails, not any other + * times. + * + * This may be overridden in the {@link fetchMethod}. + * + * @default false + * @since 7.16.0 + */ + allowStaleOnFetchRejection?: boolean + + /** + * + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link fetch} calls are not + * immediately resolved or rejected when they are aborted, and instead take + * the full time to await. + * + * When used with {@link allowStaleOnFetchAbort}, aborted {@link fetch} + * calls will resolve immediately to their stale cached value or + * `undefined`, and will continue to process and eventually update the + * cache when they resolve, as long as the resulting value is not + * `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * **Note**: regardless of this setting, an `abort` event _is still emitted + * on the `AbortSignal` object_, so may result in invalid results when + * passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link fetchMethod} or the call to + * {@link fetch}. + * + * @default false + * @since 7.17.0 + */ + ignoreFetchAbort?: boolean + + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link fetchMethod} dispatches an `'abort'` + * event, whether user-triggered, or due to internal cache behavior. + * + * Unless {@link ignoreFetchAbort} is also set, the underlying + * {@link fetchMethod} will still be considered canceled, and its return + * value will be ignored and not cached. + * + * This may be overridden in the {@link fetchMethod} or the call to + * {@link fetch}. + * + * @default false + * @since 7.17.0 + */ + allowStaleOnFetchAbort?: boolean + + /** + * Set to any value in the constructor or {@link fetch} options to + * pass arbitrary data to the {@link fetchMethod} in the {@link context} + * options field. + * + * @since 7.12.0 + */ + fetchContext?: any + } + + type Options = SharedOptions & + DeprecatedOptions & + SafetyBounds & + MaybeMaxEntrySizeLimit + + /** + * options which override the options set in the LRUCache constructor + * when making calling {@link set}. + */ + interface SetOptions { + /** + * A value for the size of the entry, prevents calls to + * {@link sizeCalculation}. + * + * Items larger than {@link maxEntrySize} will not be stored in the cache. + * + * Note that when {@link maxSize} or {@link maxEntrySize} are set, every + * item added MUST have a size specified, either via a `sizeCalculation` in + * the constructor, or {@link sizeCalculation} or `size` options to + * {@link set}. + */ + size?: LRUSize + /** + * Overrides the {@link sizeCalculation} method set in the constructor. + * + * Items larger than {@link maxEntrySize} will not be stored in the cache. + * + * Note that when {@link maxSize} or {@link maxEntrySize} are set, every + * item added MUST have a size specified, either via a `sizeCalculation` in + * the constructor, or `sizeCalculation` or {@link size} options to + * {@link set}. + */ + sizeCalculation?: SizeCalculator + ttl?: LRUMilliseconds + start?: LRUMilliseconds + noDisposeOnSet?: boolean + noUpdateTTL?: boolean + status?: Status + } + + /** + * options which override the options set in the LRUCAche constructor + * when calling {@link has}. + */ + interface HasOptions { + updateAgeOnHas?: boolean + status: Status + } + + /** + * options which override the options set in the LRUCache constructor + * when calling {@link get}. + */ + interface GetOptions { + allowStale?: boolean + updateAgeOnGet?: boolean + noDeleteOnStaleGet?: boolean + status?: Status + } + + /** + * options which override the options set in the LRUCache constructor + * when calling {@link peek}. + */ + interface PeekOptions { + allowStale?: boolean + } + + /** + * Options object passed to the {@link fetchMethod} + * + * May be mutated by the {@link fetchMethod} to affect the behavior of the + * resulting {@link set} operation on resolution, or in the case of + * {@link noDeleteOnFetchRejection}, {@link ignoreFetchAbort}, and + * {@link allowStaleOnFetchRejection}, the handling of failure. + */ + interface FetcherFetchOptions { + allowStale?: boolean + updateAgeOnGet?: boolean + noDeleteOnStaleGet?: boolean + size?: LRUSize + sizeCalculation?: SizeCalculator + ttl?: LRUMilliseconds + noDisposeOnSet?: boolean + noUpdateTTL?: boolean + noDeleteOnFetchRejection?: boolean + allowStaleOnFetchRejection?: boolean + ignoreFetchAbort?: boolean + allowStaleOnFetchAbort?: boolean + status?: Status + } + + /** + * Status object that may be passed to {@link fetch}, {@link get}, + * {@link set}, and {@link has}. + */ + interface Status { + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' + + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: LRUMilliseconds + + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: LRUMilliseconds + + /** + * The timestamp used for TTL calculation + */ + now?: LRUMilliseconds + + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: LRUMilliseconds + + /** + * The calculated size for the item, if sizes are used. + */ + size?: LRUSize + + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link maxEntrySize} + */ + maxEntrySizeExceeded?: true + + /** + * The old value, specified in the case of `set:'update'` or + * `set:'replace'` + */ + oldValue?: V + + /** + * The results of a {@link has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss' + + /** + * The status of a {@link fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no fetchMethod, so {@link get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh' + + /** + * The {@link fetchMethod} was called + */ + fetchDispatched?: true + + /** + * The cached value was updated after a successful call to fetchMethod + */ + fetchUpdated?: true + + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link fetchMethod}, or the reason for an AbortSignal. + */ + fetchError?: Error + + /** + * The fetch received an abort signal + */ + fetchAborted?: true + + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue. + */ + fetchAbortIgnored?: true + + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true + + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true + + /** + * The status of a {@link get} operation. + * + * - fetching: The item is currently being fetched. If a previous value is + * present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' + + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true + } + + /** + * options which override the options set in the LRUCache constructor + * when calling {@link fetch}. + * + * This is the union of GetOptions and SetOptions, plus + * {@link noDeleteOnFetchRejection}, {@link allowStaleOnFetchRejection}, + * {@link forceRefresh}, and {@link fetchContext} + */ + interface FetchOptions extends FetcherFetchOptions { + forceRefresh?: boolean + fetchContext?: any + signal?: AbortSignal + status?: Status + } + + interface FetcherOptions { + signal: AbortSignal + options: FetcherFetchOptions + /** + * Object provided in the {@link fetchContext} option + */ + context: any + } + + interface Entry { + value: V + ttl?: LRUMilliseconds + size?: LRUSize + start?: LRUMilliseconds + } +} + +export = LRUCache diff --git a/node_modules/lru-cache/index.js b/node_modules/lru-cache/index.js new file mode 100644 index 0000000..48e99fe --- /dev/null +++ b/node_modules/lru-cache/index.js @@ -0,0 +1,1227 @@ +const perf = + typeof performance === 'object' && + performance && + typeof performance.now === 'function' + ? performance + : Date + +const hasAbortController = typeof AbortController === 'function' + +// minimal backwards-compatibility polyfill +// this doesn't have nearly all the checks and whatnot that +// actual AbortController/Signal has, but it's enough for +// our purposes, and if used properly, behaves the same. +const AC = hasAbortController + ? AbortController + : class AbortController { + constructor() { + this.signal = new AS() + } + abort(reason = new Error('This operation was aborted')) { + this.signal.reason = this.signal.reason || reason + this.signal.aborted = true + this.signal.dispatchEvent({ + type: 'abort', + target: this.signal, + }) + } + } + +const hasAbortSignal = typeof AbortSignal === 'function' +// Some polyfills put this on the AC class, not global +const hasACAbortSignal = typeof AC.AbortSignal === 'function' +const AS = hasAbortSignal + ? AbortSignal + : hasACAbortSignal + ? AC.AbortController + : class AbortSignal { + constructor() { + this.reason = undefined + this.aborted = false + this._listeners = [] + } + dispatchEvent(e) { + if (e.type === 'abort') { + this.aborted = true + this.onabort(e) + this._listeners.forEach(f => f(e), this) + } + } + onabort() {} + addEventListener(ev, fn) { + if (ev === 'abort') { + this._listeners.push(fn) + } + } + removeEventListener(ev, fn) { + if (ev === 'abort') { + this._listeners = this._listeners.filter(f => f !== fn) + } + } + } + +const warned = new Set() +const deprecatedOption = (opt, instead) => { + const code = `LRU_CACHE_OPTION_${opt}` + if (shouldWarn(code)) { + warn(code, `${opt} option`, `options.${instead}`, LRUCache) + } +} +const deprecatedMethod = (method, instead) => { + const code = `LRU_CACHE_METHOD_${method}` + if (shouldWarn(code)) { + const { prototype } = LRUCache + const { get } = Object.getOwnPropertyDescriptor(prototype, method) + warn(code, `${method} method`, `cache.${instead}()`, get) + } +} +const deprecatedProperty = (field, instead) => { + const code = `LRU_CACHE_PROPERTY_${field}` + if (shouldWarn(code)) { + const { prototype } = LRUCache + const { get } = Object.getOwnPropertyDescriptor(prototype, field) + warn(code, `${field} property`, `cache.${instead}`, get) + } +} + +const emitWarning = (...a) => { + typeof process === 'object' && + process && + typeof process.emitWarning === 'function' + ? process.emitWarning(...a) + : console.error(...a) +} + +const shouldWarn = code => !warned.has(code) + +const warn = (code, what, instead, fn) => { + warned.add(code) + const msg = `The ${what} is deprecated. Please use ${instead} instead.` + emitWarning(msg, 'DeprecationWarning', code, fn) +} + +const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) + +/* istanbul ignore next - This is a little bit ridiculous, tbh. + * The maximum array length is 2^32-1 or thereabouts on most JS impls. + * And well before that point, you're caching the entire world, I mean, + * that's ~32GB of just integers for the next/prev links, plus whatever + * else to hold that many keys and values. Just filling the memory with + * zeroes at init time is brutal when you get that big. + * But why not be complete? + * Maybe in the future, these limits will have expanded. */ +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 + +class ZeroArray extends Array { + constructor(size) { + super(size) + this.fill(0) + } +} + +class Stack { + constructor(max) { + if (max === 0) { + return [] + } + const UintArray = getUintArray(max) + this.heap = new UintArray(max) + this.length = 0 + } + push(n) { + this.heap[this.length++] = n + } + pop() { + return this.heap[--this.length] + } +} + +class LRUCache { + constructor(options = {}) { + 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 + + // deprecated options, don't trigger a warning for getting them if + // the thing being passed in is another LRUCache we're copying. + const { length, maxAge, stale } = + options instanceof LRUCache ? {} : options + + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer') + } + + const UintArray = max ? getUintArray(max) : Array + if (!UintArray) { + throw new Error('invalid max value: ' + max) + } + + this.max = max + this.maxSize = maxSize + this.maxEntrySize = maxEntrySize || this.maxSize + this.sizeCalculation = sizeCalculation || length + if (this.sizeCalculation) { + if (!this.maxSize && !this.maxEntrySize) { + throw new TypeError( + 'cannot set sizeCalculation without setting maxSize or maxEntrySize' + ) + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function') + } + } + + this.fetchMethod = fetchMethod || null + if (this.fetchMethod && typeof this.fetchMethod !== 'function') { + throw new TypeError( + 'fetchMethod must be a function if specified' + ) + } + + this.fetchContext = fetchContext + if (!this.fetchMethod && fetchContext !== undefined) { + throw new TypeError( + 'cannot set fetchContext without fetchMethod' + ) + } + + this.keyMap = new Map() + this.keyList = new Array(max).fill(null) + this.valList = new Array(max).fill(null) + this.next = new UintArray(max) + this.prev = new UintArray(max) + this.head = 0 + this.tail = 0 + this.free = new Stack(max) + this.initialFill = 1 + this.size = 0 + + if (typeof dispose === 'function') { + this.dispose = dispose + } + if (typeof disposeAfter === 'function') { + this.disposeAfter = disposeAfter + this.disposed = [] + } else { + this.disposeAfter = null + this.disposed = null + } + this.noDisposeOnSet = !!noDisposeOnSet + this.noUpdateTTL = !!noUpdateTTL + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort + this.ignoreFetchAbort = !!ignoreFetchAbort + + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.maxSize !== 0) { + if (!isPosInt(this.maxSize)) { + throw new TypeError( + 'maxSize must be a positive integer if specified' + ) + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError( + 'maxEntrySize must be a positive integer if specified' + ) + } + this.initializeSizeTracking() + } + + this.allowStale = !!allowStale || !!stale + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet + this.updateAgeOnGet = !!updateAgeOnGet + this.updateAgeOnHas = !!updateAgeOnHas + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 + ? ttlResolution + : 1 + this.ttlAutopurge = !!ttlAutopurge + this.ttl = ttl || maxAge || 0 + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError( + 'ttl must be a positive integer if specified' + ) + } + this.initializeTTLTracking() + } + + // do not allow completely unbounded caches + if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { + throw new TypeError( + 'At least one of max, maxSize, or ttl is required' + ) + } + if (!this.ttlAutopurge && !this.max && !this.maxSize) { + const code = 'LRU_CACHE_UNBOUNDED' + if (shouldWarn(code)) { + warned.add(code) + const msg = + 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.' + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) + } + } + + if (stale) { + deprecatedOption('stale', 'allowStale') + } + if (maxAge) { + deprecatedOption('maxAge', 'ttl') + } + if (length) { + deprecatedOption('length', 'sizeCalculation') + } + } + + getRemainingTTL(key) { + return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0 + } + + initializeTTLTracking() { + this.ttls = new ZeroArray(this.max) + this.starts = new ZeroArray(this.max) + + this.setItemTTL = (index, ttl, start = perf.now()) => { + this.starts[index] = ttl !== 0 ? start : 0 + this.ttls[index] = ttl + if (ttl !== 0 && this.ttlAutopurge) { + const t = setTimeout(() => { + if (this.isStale(index)) { + this.delete(this.keyList[index]) + } + }, ttl + 1) + /* istanbul ignore else - unref() not supported on all platforms */ + if (t.unref) { + t.unref() + } + } + } + + this.updateItemAge = index => { + this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 + } + + this.statusTTL = (status, index) => { + if (status) { + status.ttl = this.ttls[index] + status.start = this.starts[index] + status.now = cachedNow || getNow() + status.remainingTTL = status.now + status.ttl - status.start + } + } + + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0 + const getNow = () => { + const n = perf.now() + if (this.ttlResolution > 0) { + cachedNow = n + const t = setTimeout( + () => (cachedNow = 0), + this.ttlResolution + ) + /* istanbul ignore else - not available on all platforms */ + if (t.unref) { + t.unref() + } + } + return n + } + + this.getRemainingTTL = key => { + const index = this.keyMap.get(key) + if (index === undefined) { + return 0 + } + return this.ttls[index] === 0 || this.starts[index] === 0 + ? Infinity + : this.starts[index] + + this.ttls[index] - + (cachedNow || getNow()) + } + + this.isStale = index => { + return ( + this.ttls[index] !== 0 && + this.starts[index] !== 0 && + (cachedNow || getNow()) - this.starts[index] > + this.ttls[index] + ) + } + } + updateItemAge(_index) {} + statusTTL(_status, _index) {} + setItemTTL(_index, _ttl, _start) {} + isStale(_index) { + return false + } + + initializeSizeTracking() { + this.calculatedSize = 0 + this.sizes = new ZeroArray(this.max) + this.removeItemSize = index => { + this.calculatedSize -= this.sizes[index] + this.sizes[index] = 0 + } + this.requireSize = (k, v, size, sizeCalculation) => { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.isBackgroundFetch(v)) { + return 0 + } + if (!isPosInt(size)) { + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function') + } + size = sizeCalculation(v, k) + if (!isPosInt(size)) { + throw new TypeError( + 'sizeCalculation return invalid (expect positive integer)' + ) + } + } else { + throw new TypeError( + 'invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation or size ' + + 'must be set.' + ) + } + } + return size + } + this.addItemSize = (index, size, status) => { + this.sizes[index] = size + if (this.maxSize) { + const maxSize = this.maxSize - this.sizes[index] + while (this.calculatedSize > maxSize) { + this.evict(true) + } + } + this.calculatedSize += this.sizes[index] + if (status) { + status.entrySize = size + status.totalCalculatedSize = this.calculatedSize + } + } + } + removeItemSize(_index) {} + addItemSize(_index, _size) {} + requireSize(_k, _v, size, sizeCalculation) { + if (size || sizeCalculation) { + throw new TypeError( + 'cannot set size without setting maxSize or maxEntrySize on cache' + ) + } + } + + *indexes({ allowStale = this.allowStale } = {}) { + if (this.size) { + for (let i = this.tail; true; ) { + if (!this.isValidIndex(i)) { + break + } + if (allowStale || !this.isStale(i)) { + yield i + } + if (i === this.head) { + break + } else { + i = this.prev[i] + } + } + } + } + + *rindexes({ allowStale = this.allowStale } = {}) { + if (this.size) { + for (let i = this.head; true; ) { + if (!this.isValidIndex(i)) { + break + } + if (allowStale || !this.isStale(i)) { + yield i + } + if (i === this.tail) { + break + } else { + i = this.next[i] + } + } + } + } + + isValidIndex(index) { + return ( + index !== undefined && + this.keyMap.get(this.keyList[index]) === index + ) + } + + *entries() { + for (const i of this.indexes()) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield [this.keyList[i], this.valList[i]] + } + } + } + *rentries() { + for (const i of this.rindexes()) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield [this.keyList[i], this.valList[i]] + } + } + } + + *keys() { + for (const i of this.indexes()) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.keyList[i] + } + } + } + *rkeys() { + for (const i of this.rindexes()) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.keyList[i] + } + } + } + + *values() { + for (const i of this.indexes()) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.valList[i] + } + } + } + *rvalues() { + for (const i of this.rindexes()) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.valList[i] + } + } + } + + [Symbol.iterator]() { + return this.entries() + } + + find(fn, getOptions) { + for (const i of this.indexes()) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + if (fn(value, this.keyList[i], this)) { + return this.get(this.keyList[i], getOptions) + } + } + } + + forEach(fn, thisp = this) { + for (const i of this.indexes()) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) + } + } + + rforEach(fn, thisp = this) { + for (const i of this.rindexes()) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) + } + } + + get prune() { + deprecatedMethod('prune', 'purgeStale') + return this.purgeStale + } + + purgeStale() { + let deleted = false + for (const i of this.rindexes({ allowStale: true })) { + if (this.isStale(i)) { + this.delete(this.keyList[i]) + deleted = true + } + } + return deleted + } + + dump() { + const arr = [] + for (const i of this.indexes({ allowStale: true })) { + const key = this.keyList[i] + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + const entry = { value } + if (this.ttls) { + entry.ttl = this.ttls[i] + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = perf.now() - this.starts[i] + entry.start = Math.floor(Date.now() - age) + } + if (this.sizes) { + entry.size = this.sizes[i] + } + arr.unshift([key, entry]) + } + return arr + } + + load(arr) { + this.clear() + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset. + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start + entry.start = perf.now() - age + } + this.set(key, entry.value, entry) + } + } + + dispose(_v, _k, _reason) {} + + set( + k, + v, + { + ttl = this.ttl, + start, + noDisposeOnSet = this.noDisposeOnSet, + size = 0, + sizeCalculation = this.sizeCalculation, + noUpdateTTL = this.noUpdateTTL, + status, + } = {} + ) { + size = this.requireSize(k, v, size, sizeCalculation) + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + if (status) { + status.set = 'miss' + status.maxEntrySizeExceeded = true + } + // have to delete, in case a background fetch is there already. + // in non-async cases, this is a no-op + this.delete(k) + return this + } + let index = this.size === 0 ? undefined : this.keyMap.get(k) + if (index === undefined) { + // addition + index = this.newIndex() + this.keyList[index] = k + this.valList[index] = v + this.keyMap.set(k, index) + this.next[this.tail] = index + this.prev[index] = this.tail + this.tail = index + this.size++ + this.addItemSize(index, size, status) + if (status) { + status.set = 'add' + } + noUpdateTTL = false + } else { + // update + this.moveToTail(index) + const oldVal = this.valList[index] + if (v !== oldVal) { + if (this.isBackgroundFetch(oldVal)) { + oldVal.__abortController.abort(new Error('replaced')) + } else { + if (!noDisposeOnSet) { + this.dispose(oldVal, k, 'set') + if (this.disposeAfter) { + this.disposed.push([oldVal, k, 'set']) + } + } + } + this.removeItemSize(index) + this.valList[index] = v + this.addItemSize(index, size, status) + if (status) { + status.set = 'replace' + const oldValue = + oldVal && this.isBackgroundFetch(oldVal) + ? oldVal.__staleWhileFetching + : oldVal + if (oldValue !== undefined) status.oldValue = oldValue + } + } else if (status) { + status.set = 'update' + } + } + if (ttl !== 0 && this.ttl === 0 && !this.ttls) { + this.initializeTTLTracking() + } + if (!noUpdateTTL) { + this.setItemTTL(index, ttl, start) + } + this.statusTTL(status, index) + if (this.disposeAfter) { + while (this.disposed.length) { + this.disposeAfter(...this.disposed.shift()) + } + } + return this + } + + newIndex() { + if (this.size === 0) { + return this.tail + } + if (this.size === this.max && this.max !== 0) { + return this.evict(false) + } + if (this.free.length !== 0) { + return this.free.pop() + } + // initial fill, just keep writing down the list + return this.initialFill++ + } + + pop() { + if (this.size) { + const val = this.valList[this.head] + this.evict(true) + return val + } + } + + evict(free) { + const head = this.head + const k = this.keyList[head] + const v = this.valList[head] + if (this.isBackgroundFetch(v)) { + v.__abortController.abort(new Error('evicted')) + } else { + this.dispose(v, k, 'evict') + if (this.disposeAfter) { + this.disposed.push([v, k, 'evict']) + } + } + this.removeItemSize(head) + // if we aren't about to use the index, then null these out + if (free) { + this.keyList[head] = null + this.valList[head] = null + this.free.push(head) + } + this.head = this.next[head] + this.keyMap.delete(k) + this.size-- + return head + } + + has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { + const index = this.keyMap.get(k) + if (index !== undefined) { + if (!this.isStale(index)) { + if (updateAgeOnHas) { + this.updateItemAge(index) + } + if (status) status.has = 'hit' + this.statusTTL(status, index) + return true + } else if (status) { + status.has = 'stale' + this.statusTTL(status, index) + } + } else if (status) { + status.has = 'miss' + } + return false + } + + // like get(), but without any LRU updating or TTL expiration + peek(k, { allowStale = this.allowStale } = {}) { + const index = this.keyMap.get(k) + if (index !== undefined && (allowStale || !this.isStale(index))) { + const v = this.valList[index] + // either stale and allowed, or forcing a refresh of non-stale value + return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v + } + } + + backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.valList[index] + if (this.isBackgroundFetch(v)) { + return v + } + const ac = new AC() + if (options.signal) { + options.signal.addEventListener('abort', () => + ac.abort(options.signal.reason) + ) + } + const fetchOpts = { + signal: ac.signal, + options, + context, + } + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal + const ignoreAbort = options.ignoreFetchAbort && v !== undefined + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true + options.status.fetchError = ac.signal.reason + if (ignoreAbort) options.status.fetchAbortIgnored = true + } else { + options.status.fetchResolved = true + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason) + } + // either we didn't abort, and are still here, or we did, and ignored + if (this.valList[index] === p) { + if (v === undefined) { + if (p.__staleWhileFetching) { + this.valList[index] = p.__staleWhileFetching + } else { + this.delete(k) + } + } else { + if (options.status) options.status.fetchUpdated = true + this.set(k, v, fetchOpts.options) + } + } + return v + } + const eb = er => { + if (options.status) { + options.status.fetchRejected = true + options.status.fetchError = er + } + return fetchFail(er) + } + const fetchFail = er => { + const { aborted } = ac.signal + const allowStaleAborted = + aborted && options.allowStaleOnFetchAbort + const allowStale = + allowStaleAborted || options.allowStaleOnFetchRejection + const noDelete = allowStale || options.noDeleteOnFetchRejection + if (this.valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || p.__staleWhileFetching === undefined + if (del) { + this.delete(k) + } else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.valList[index] = p.__staleWhileFetching + } + } + if (allowStale) { + if (options.status && p.__staleWhileFetching !== undefined) { + options.status.returnedStale = true + } + return p.__staleWhileFetching + } else if (p.__returned === p) { + throw er + } + } + const pcall = (res, rej) => { + this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if ( + !options.ignoreFetchAbort || + options.allowStaleOnFetchAbort + ) { + res() + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true) + } + } + }) + } + if (options.status) options.status.fetchDispatched = true + const p = new Promise(pcall).then(cb, eb) + p.__abortController = ac + p.__staleWhileFetching = v + p.__returned = null + if (index === undefined) { + // internal, don't expose status. + this.set(k, p, { ...fetchOpts.options, status: undefined }) + index = this.keyMap.get(k) + } else { + this.valList[index] = p + } + return p + } + + isBackgroundFetch(p) { + 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) + ) + } + + // this takes the union of get() and set() opts, because it does both + async fetch( + k, + { + // get options + allowStale = this.allowStale, + updateAgeOnGet = this.updateAgeOnGet, + noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, + noDisposeOnSet = this.noDisposeOnSet, + size = 0, + sizeCalculation = this.sizeCalculation, + noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, + allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, + ignoreFetchAbort = this.ignoreFetchAbort, + allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, + fetchContext = this.fetchContext, + forceRefresh = false, + status, + signal, + } = {} + ) { + if (!this.fetchMethod) { + if (status) status.fetch = 'get' + return this.get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }) + } + + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + } + + let index = this.keyMap.get(k) + if (index === undefined) { + if (status) status.fetch = 'miss' + const p = this.backgroundFetch(k, index, options, fetchContext) + return (p.__returned = p) + } else { + // in cache, maybe already fetching + const v = this.valList[index] + if (this.isBackgroundFetch(v)) { + const stale = + allowStale && v.__staleWhileFetching !== undefined + if (status) { + status.fetch = 'inflight' + if (stale) status.returnedStale = true + } + return stale ? v.__staleWhileFetching : (v.__returned = v) + } + + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.isStale(index) + if (!forceRefresh && !isStale) { + if (status) status.fetch = 'hit' + this.moveToTail(index) + if (updateAgeOnGet) { + this.updateItemAge(index) + } + this.statusTTL(status, index) + return v + } + + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.backgroundFetch(k, index, options, fetchContext) + const hasStale = p.__staleWhileFetching !== undefined + const staleVal = hasStale && allowStale + if (status) { + status.fetch = hasStale && isStale ? 'stale' : 'refresh' + if (staleVal && isStale) status.returnedStale = true + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p) + } + } + + get( + k, + { + allowStale = this.allowStale, + updateAgeOnGet = this.updateAgeOnGet, + noDeleteOnStaleGet = this.noDeleteOnStaleGet, + status, + } = {} + ) { + const index = this.keyMap.get(k) + if (index !== undefined) { + const value = this.valList[index] + const fetching = this.isBackgroundFetch(value) + this.statusTTL(status, index) + if (this.isStale(index)) { + if (status) status.get = 'stale' + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.delete(k) + } + if (status) status.returnedStale = allowStale + return allowStale ? value : undefined + } else { + if (status) { + status.returnedStale = + allowStale && value.__staleWhileFetching !== undefined + } + return allowStale ? value.__staleWhileFetching : undefined + } + } else { + if (status) status.get = 'hit' + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + if (fetching) { + return value.__staleWhileFetching + } + this.moveToTail(index) + if (updateAgeOnGet) { + this.updateItemAge(index) + } + return value + } + } else if (status) { + status.get = 'miss' + } + } + + connect(p, n) { + this.prev[n] = p + this.next[p] = n + } + + moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.tail) { + if (index === this.head) { + this.head = this.next[index] + } else { + this.connect(this.prev[index], this.next[index]) + } + this.connect(this.tail, index) + this.tail = index + } + } + + get del() { + deprecatedMethod('del', 'delete') + return this.delete + } + + delete(k) { + let deleted = false + if (this.size !== 0) { + const index = this.keyMap.get(k) + if (index !== undefined) { + deleted = true + if (this.size === 1) { + this.clear() + } else { + this.removeItemSize(index) + const v = this.valList[index] + if (this.isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')) + } else { + this.dispose(v, k, 'delete') + if (this.disposeAfter) { + this.disposed.push([v, k, 'delete']) + } + } + this.keyMap.delete(k) + this.keyList[index] = null + this.valList[index] = null + if (index === this.tail) { + this.tail = this.prev[index] + } else if (index === this.head) { + this.head = this.next[index] + } else { + this.next[this.prev[index]] = this.next[index] + this.prev[this.next[index]] = this.prev[index] + } + this.size-- + this.free.push(index) + } + } + } + if (this.disposed) { + while (this.disposed.length) { + this.disposeAfter(...this.disposed.shift()) + } + } + return deleted + } + + clear() { + for (const index of this.rindexes({ allowStale: true })) { + const v = this.valList[index] + if (this.isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')) + } else { + const k = this.keyList[index] + this.dispose(v, k, 'delete') + if (this.disposeAfter) { + this.disposed.push([v, k, 'delete']) + } + } + } + + this.keyMap.clear() + this.valList.fill(null) + this.keyList.fill(null) + if (this.ttls) { + this.ttls.fill(0) + this.starts.fill(0) + } + if (this.sizes) { + this.sizes.fill(0) + } + this.head = 0 + this.tail = 0 + this.initialFill = 1 + this.free.length = 0 + this.calculatedSize = 0 + this.size = 0 + if (this.disposed) { + while (this.disposed.length) { + this.disposeAfter(...this.disposed.shift()) + } + } + } + + get reset() { + deprecatedMethod('reset', 'clear') + return this.clear + } + + get length() { + deprecatedProperty('length', 'size') + return this.size + } + + static get AbortController() { + return AC + } + static get AbortSignal() { + return AS + } +} + +module.exports = LRUCache diff --git a/node_modules/lru-cache/index.mjs b/node_modules/lru-cache/index.mjs new file mode 100644 index 0000000..4a0b481 --- /dev/null +++ b/node_modules/lru-cache/index.mjs @@ -0,0 +1,1227 @@ +const perf = + typeof performance === 'object' && + performance && + typeof performance.now === 'function' + ? performance + : Date + +const hasAbortController = typeof AbortController === 'function' + +// minimal backwards-compatibility polyfill +// this doesn't have nearly all the checks and whatnot that +// actual AbortController/Signal has, but it's enough for +// our purposes, and if used properly, behaves the same. +const AC = hasAbortController + ? AbortController + : class AbortController { + constructor() { + this.signal = new AS() + } + abort(reason = new Error('This operation was aborted')) { + this.signal.reason = this.signal.reason || reason + this.signal.aborted = true + this.signal.dispatchEvent({ + type: 'abort', + target: this.signal, + }) + } + } + +const hasAbortSignal = typeof AbortSignal === 'function' +// Some polyfills put this on the AC class, not global +const hasACAbortSignal = typeof AC.AbortSignal === 'function' +const AS = hasAbortSignal + ? AbortSignal + : hasACAbortSignal + ? AC.AbortController + : class AbortSignal { + constructor() { + this.reason = undefined + this.aborted = false + this._listeners = [] + } + dispatchEvent(e) { + if (e.type === 'abort') { + this.aborted = true + this.onabort(e) + this._listeners.forEach(f => f(e), this) + } + } + onabort() {} + addEventListener(ev, fn) { + if (ev === 'abort') { + this._listeners.push(fn) + } + } + removeEventListener(ev, fn) { + if (ev === 'abort') { + this._listeners = this._listeners.filter(f => f !== fn) + } + } + } + +const warned = new Set() +const deprecatedOption = (opt, instead) => { + const code = `LRU_CACHE_OPTION_${opt}` + if (shouldWarn(code)) { + warn(code, `${opt} option`, `options.${instead}`, LRUCache) + } +} +const deprecatedMethod = (method, instead) => { + const code = `LRU_CACHE_METHOD_${method}` + if (shouldWarn(code)) { + const { prototype } = LRUCache + const { get } = Object.getOwnPropertyDescriptor(prototype, method) + warn(code, `${method} method`, `cache.${instead}()`, get) + } +} +const deprecatedProperty = (field, instead) => { + const code = `LRU_CACHE_PROPERTY_${field}` + if (shouldWarn(code)) { + const { prototype } = LRUCache + const { get } = Object.getOwnPropertyDescriptor(prototype, field) + warn(code, `${field} property`, `cache.${instead}`, get) + } +} + +const emitWarning = (...a) => { + typeof process === 'object' && + process && + typeof process.emitWarning === 'function' + ? process.emitWarning(...a) + : console.error(...a) +} + +const shouldWarn = code => !warned.has(code) + +const warn = (code, what, instead, fn) => { + warned.add(code) + const msg = `The ${what} is deprecated. Please use ${instead} instead.` + emitWarning(msg, 'DeprecationWarning', code, fn) +} + +const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) + +/* istanbul ignore next - This is a little bit ridiculous, tbh. + * The maximum array length is 2^32-1 or thereabouts on most JS impls. + * And well before that point, you're caching the entire world, I mean, + * that's ~32GB of just integers for the next/prev links, plus whatever + * else to hold that many keys and values. Just filling the memory with + * zeroes at init time is brutal when you get that big. + * But why not be complete? + * Maybe in the future, these limits will have expanded. */ +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 + +class ZeroArray extends Array { + constructor(size) { + super(size) + this.fill(0) + } +} + +class Stack { + constructor(max) { + if (max === 0) { + return [] + } + const UintArray = getUintArray(max) + this.heap = new UintArray(max) + this.length = 0 + } + push(n) { + this.heap[this.length++] = n + } + pop() { + return this.heap[--this.length] + } +} + +class LRUCache { + constructor(options = {}) { + 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 + + // deprecated options, don't trigger a warning for getting them if + // the thing being passed in is another LRUCache we're copying. + const { length, maxAge, stale } = + options instanceof LRUCache ? {} : options + + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer') + } + + const UintArray = max ? getUintArray(max) : Array + if (!UintArray) { + throw new Error('invalid max value: ' + max) + } + + this.max = max + this.maxSize = maxSize + this.maxEntrySize = maxEntrySize || this.maxSize + this.sizeCalculation = sizeCalculation || length + if (this.sizeCalculation) { + if (!this.maxSize && !this.maxEntrySize) { + throw new TypeError( + 'cannot set sizeCalculation without setting maxSize or maxEntrySize' + ) + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function') + } + } + + this.fetchMethod = fetchMethod || null + if (this.fetchMethod && typeof this.fetchMethod !== 'function') { + throw new TypeError( + 'fetchMethod must be a function if specified' + ) + } + + this.fetchContext = fetchContext + if (!this.fetchMethod && fetchContext !== undefined) { + throw new TypeError( + 'cannot set fetchContext without fetchMethod' + ) + } + + this.keyMap = new Map() + this.keyList = new Array(max).fill(null) + this.valList = new Array(max).fill(null) + this.next = new UintArray(max) + this.prev = new UintArray(max) + this.head = 0 + this.tail = 0 + this.free = new Stack(max) + this.initialFill = 1 + this.size = 0 + + if (typeof dispose === 'function') { + this.dispose = dispose + } + if (typeof disposeAfter === 'function') { + this.disposeAfter = disposeAfter + this.disposed = [] + } else { + this.disposeAfter = null + this.disposed = null + } + this.noDisposeOnSet = !!noDisposeOnSet + this.noUpdateTTL = !!noUpdateTTL + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort + this.ignoreFetchAbort = !!ignoreFetchAbort + + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.maxSize !== 0) { + if (!isPosInt(this.maxSize)) { + throw new TypeError( + 'maxSize must be a positive integer if specified' + ) + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError( + 'maxEntrySize must be a positive integer if specified' + ) + } + this.initializeSizeTracking() + } + + this.allowStale = !!allowStale || !!stale + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet + this.updateAgeOnGet = !!updateAgeOnGet + this.updateAgeOnHas = !!updateAgeOnHas + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 + ? ttlResolution + : 1 + this.ttlAutopurge = !!ttlAutopurge + this.ttl = ttl || maxAge || 0 + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError( + 'ttl must be a positive integer if specified' + ) + } + this.initializeTTLTracking() + } + + // do not allow completely unbounded caches + if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { + throw new TypeError( + 'At least one of max, maxSize, or ttl is required' + ) + } + if (!this.ttlAutopurge && !this.max && !this.maxSize) { + const code = 'LRU_CACHE_UNBOUNDED' + if (shouldWarn(code)) { + warned.add(code) + const msg = + 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.' + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) + } + } + + if (stale) { + deprecatedOption('stale', 'allowStale') + } + if (maxAge) { + deprecatedOption('maxAge', 'ttl') + } + if (length) { + deprecatedOption('length', 'sizeCalculation') + } + } + + getRemainingTTL(key) { + return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0 + } + + initializeTTLTracking() { + this.ttls = new ZeroArray(this.max) + this.starts = new ZeroArray(this.max) + + this.setItemTTL = (index, ttl, start = perf.now()) => { + this.starts[index] = ttl !== 0 ? start : 0 + this.ttls[index] = ttl + if (ttl !== 0 && this.ttlAutopurge) { + const t = setTimeout(() => { + if (this.isStale(index)) { + this.delete(this.keyList[index]) + } + }, ttl + 1) + /* istanbul ignore else - unref() not supported on all platforms */ + if (t.unref) { + t.unref() + } + } + } + + this.updateItemAge = index => { + this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 + } + + this.statusTTL = (status, index) => { + if (status) { + status.ttl = this.ttls[index] + status.start = this.starts[index] + status.now = cachedNow || getNow() + status.remainingTTL = status.now + status.ttl - status.start + } + } + + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0 + const getNow = () => { + const n = perf.now() + if (this.ttlResolution > 0) { + cachedNow = n + const t = setTimeout( + () => (cachedNow = 0), + this.ttlResolution + ) + /* istanbul ignore else - not available on all platforms */ + if (t.unref) { + t.unref() + } + } + return n + } + + this.getRemainingTTL = key => { + const index = this.keyMap.get(key) + if (index === undefined) { + return 0 + } + return this.ttls[index] === 0 || this.starts[index] === 0 + ? Infinity + : this.starts[index] + + this.ttls[index] - + (cachedNow || getNow()) + } + + this.isStale = index => { + return ( + this.ttls[index] !== 0 && + this.starts[index] !== 0 && + (cachedNow || getNow()) - this.starts[index] > + this.ttls[index] + ) + } + } + updateItemAge(_index) {} + statusTTL(_status, _index) {} + setItemTTL(_index, _ttl, _start) {} + isStale(_index) { + return false + } + + initializeSizeTracking() { + this.calculatedSize = 0 + this.sizes = new ZeroArray(this.max) + this.removeItemSize = index => { + this.calculatedSize -= this.sizes[index] + this.sizes[index] = 0 + } + this.requireSize = (k, v, size, sizeCalculation) => { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.isBackgroundFetch(v)) { + return 0 + } + if (!isPosInt(size)) { + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function') + } + size = sizeCalculation(v, k) + if (!isPosInt(size)) { + throw new TypeError( + 'sizeCalculation return invalid (expect positive integer)' + ) + } + } else { + throw new TypeError( + 'invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation or size ' + + 'must be set.' + ) + } + } + return size + } + this.addItemSize = (index, size, status) => { + this.sizes[index] = size + if (this.maxSize) { + const maxSize = this.maxSize - this.sizes[index] + while (this.calculatedSize > maxSize) { + this.evict(true) + } + } + this.calculatedSize += this.sizes[index] + if (status) { + status.entrySize = size + status.totalCalculatedSize = this.calculatedSize + } + } + } + removeItemSize(_index) {} + addItemSize(_index, _size) {} + requireSize(_k, _v, size, sizeCalculation) { + if (size || sizeCalculation) { + throw new TypeError( + 'cannot set size without setting maxSize or maxEntrySize on cache' + ) + } + } + + *indexes({ allowStale = this.allowStale } = {}) { + if (this.size) { + for (let i = this.tail; true; ) { + if (!this.isValidIndex(i)) { + break + } + if (allowStale || !this.isStale(i)) { + yield i + } + if (i === this.head) { + break + } else { + i = this.prev[i] + } + } + } + } + + *rindexes({ allowStale = this.allowStale } = {}) { + if (this.size) { + for (let i = this.head; true; ) { + if (!this.isValidIndex(i)) { + break + } + if (allowStale || !this.isStale(i)) { + yield i + } + if (i === this.tail) { + break + } else { + i = this.next[i] + } + } + } + } + + isValidIndex(index) { + return ( + index !== undefined && + this.keyMap.get(this.keyList[index]) === index + ) + } + + *entries() { + for (const i of this.indexes()) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield [this.keyList[i], this.valList[i]] + } + } + } + *rentries() { + for (const i of this.rindexes()) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield [this.keyList[i], this.valList[i]] + } + } + } + + *keys() { + for (const i of this.indexes()) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.keyList[i] + } + } + } + *rkeys() { + for (const i of this.rindexes()) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.keyList[i] + } + } + } + + *values() { + for (const i of this.indexes()) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.valList[i] + } + } + } + *rvalues() { + for (const i of this.rindexes()) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { + yield this.valList[i] + } + } + } + + [Symbol.iterator]() { + return this.entries() + } + + find(fn, getOptions) { + for (const i of this.indexes()) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + if (fn(value, this.keyList[i], this)) { + return this.get(this.keyList[i], getOptions) + } + } + } + + forEach(fn, thisp = this) { + for (const i of this.indexes()) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) + } + } + + rforEach(fn, thisp = this) { + for (const i of this.rindexes()) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) + } + } + + get prune() { + deprecatedMethod('prune', 'purgeStale') + return this.purgeStale + } + + purgeStale() { + let deleted = false + for (const i of this.rindexes({ allowStale: true })) { + if (this.isStale(i)) { + this.delete(this.keyList[i]) + deleted = true + } + } + return deleted + } + + dump() { + const arr = [] + for (const i of this.indexes({ allowStale: true })) { + const key = this.keyList[i] + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + const entry = { value } + if (this.ttls) { + entry.ttl = this.ttls[i] + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = perf.now() - this.starts[i] + entry.start = Math.floor(Date.now() - age) + } + if (this.sizes) { + entry.size = this.sizes[i] + } + arr.unshift([key, entry]) + } + return arr + } + + load(arr) { + this.clear() + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset. + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start + entry.start = perf.now() - age + } + this.set(key, entry.value, entry) + } + } + + dispose(_v, _k, _reason) {} + + set( + k, + v, + { + ttl = this.ttl, + start, + noDisposeOnSet = this.noDisposeOnSet, + size = 0, + sizeCalculation = this.sizeCalculation, + noUpdateTTL = this.noUpdateTTL, + status, + } = {} + ) { + size = this.requireSize(k, v, size, sizeCalculation) + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + if (status) { + status.set = 'miss' + status.maxEntrySizeExceeded = true + } + // have to delete, in case a background fetch is there already. + // in non-async cases, this is a no-op + this.delete(k) + return this + } + let index = this.size === 0 ? undefined : this.keyMap.get(k) + if (index === undefined) { + // addition + index = this.newIndex() + this.keyList[index] = k + this.valList[index] = v + this.keyMap.set(k, index) + this.next[this.tail] = index + this.prev[index] = this.tail + this.tail = index + this.size++ + this.addItemSize(index, size, status) + if (status) { + status.set = 'add' + } + noUpdateTTL = false + } else { + // update + this.moveToTail(index) + const oldVal = this.valList[index] + if (v !== oldVal) { + if (this.isBackgroundFetch(oldVal)) { + oldVal.__abortController.abort(new Error('replaced')) + } else { + if (!noDisposeOnSet) { + this.dispose(oldVal, k, 'set') + if (this.disposeAfter) { + this.disposed.push([oldVal, k, 'set']) + } + } + } + this.removeItemSize(index) + this.valList[index] = v + this.addItemSize(index, size, status) + if (status) { + status.set = 'replace' + const oldValue = + oldVal && this.isBackgroundFetch(oldVal) + ? oldVal.__staleWhileFetching + : oldVal + if (oldValue !== undefined) status.oldValue = oldValue + } + } else if (status) { + status.set = 'update' + } + } + if (ttl !== 0 && this.ttl === 0 && !this.ttls) { + this.initializeTTLTracking() + } + if (!noUpdateTTL) { + this.setItemTTL(index, ttl, start) + } + this.statusTTL(status, index) + if (this.disposeAfter) { + while (this.disposed.length) { + this.disposeAfter(...this.disposed.shift()) + } + } + return this + } + + newIndex() { + if (this.size === 0) { + return this.tail + } + if (this.size === this.max && this.max !== 0) { + return this.evict(false) + } + if (this.free.length !== 0) { + return this.free.pop() + } + // initial fill, just keep writing down the list + return this.initialFill++ + } + + pop() { + if (this.size) { + const val = this.valList[this.head] + this.evict(true) + return val + } + } + + evict(free) { + const head = this.head + const k = this.keyList[head] + const v = this.valList[head] + if (this.isBackgroundFetch(v)) { + v.__abortController.abort(new Error('evicted')) + } else { + this.dispose(v, k, 'evict') + if (this.disposeAfter) { + this.disposed.push([v, k, 'evict']) + } + } + this.removeItemSize(head) + // if we aren't about to use the index, then null these out + if (free) { + this.keyList[head] = null + this.valList[head] = null + this.free.push(head) + } + this.head = this.next[head] + this.keyMap.delete(k) + this.size-- + return head + } + + has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { + const index = this.keyMap.get(k) + if (index !== undefined) { + if (!this.isStale(index)) { + if (updateAgeOnHas) { + this.updateItemAge(index) + } + if (status) status.has = 'hit' + this.statusTTL(status, index) + return true + } else if (status) { + status.has = 'stale' + this.statusTTL(status, index) + } + } else if (status) { + status.has = 'miss' + } + return false + } + + // like get(), but without any LRU updating or TTL expiration + peek(k, { allowStale = this.allowStale } = {}) { + const index = this.keyMap.get(k) + if (index !== undefined && (allowStale || !this.isStale(index))) { + const v = this.valList[index] + // either stale and allowed, or forcing a refresh of non-stale value + return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v + } + } + + backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.valList[index] + if (this.isBackgroundFetch(v)) { + return v + } + const ac = new AC() + if (options.signal) { + options.signal.addEventListener('abort', () => + ac.abort(options.signal.reason) + ) + } + const fetchOpts = { + signal: ac.signal, + options, + context, + } + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal + const ignoreAbort = options.ignoreFetchAbort && v !== undefined + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true + options.status.fetchError = ac.signal.reason + if (ignoreAbort) options.status.fetchAbortIgnored = true + } else { + options.status.fetchResolved = true + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason) + } + // either we didn't abort, and are still here, or we did, and ignored + if (this.valList[index] === p) { + if (v === undefined) { + if (p.__staleWhileFetching) { + this.valList[index] = p.__staleWhileFetching + } else { + this.delete(k) + } + } else { + if (options.status) options.status.fetchUpdated = true + this.set(k, v, fetchOpts.options) + } + } + return v + } + const eb = er => { + if (options.status) { + options.status.fetchRejected = true + options.status.fetchError = er + } + return fetchFail(er) + } + const fetchFail = er => { + const { aborted } = ac.signal + const allowStaleAborted = + aborted && options.allowStaleOnFetchAbort + const allowStale = + allowStaleAborted || options.allowStaleOnFetchRejection + const noDelete = allowStale || options.noDeleteOnFetchRejection + if (this.valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || p.__staleWhileFetching === undefined + if (del) { + this.delete(k) + } else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.valList[index] = p.__staleWhileFetching + } + } + if (allowStale) { + if (options.status && p.__staleWhileFetching !== undefined) { + options.status.returnedStale = true + } + return p.__staleWhileFetching + } else if (p.__returned === p) { + throw er + } + } + const pcall = (res, rej) => { + this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if ( + !options.ignoreFetchAbort || + options.allowStaleOnFetchAbort + ) { + res() + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true) + } + } + }) + } + if (options.status) options.status.fetchDispatched = true + const p = new Promise(pcall).then(cb, eb) + p.__abortController = ac + p.__staleWhileFetching = v + p.__returned = null + if (index === undefined) { + // internal, don't expose status. + this.set(k, p, { ...fetchOpts.options, status: undefined }) + index = this.keyMap.get(k) + } else { + this.valList[index] = p + } + return p + } + + isBackgroundFetch(p) { + 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) + ) + } + + // this takes the union of get() and set() opts, because it does both + async fetch( + k, + { + // get options + allowStale = this.allowStale, + updateAgeOnGet = this.updateAgeOnGet, + noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, + noDisposeOnSet = this.noDisposeOnSet, + size = 0, + sizeCalculation = this.sizeCalculation, + noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, + allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, + ignoreFetchAbort = this.ignoreFetchAbort, + allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, + fetchContext = this.fetchContext, + forceRefresh = false, + status, + signal, + } = {} + ) { + if (!this.fetchMethod) { + if (status) status.fetch = 'get' + return this.get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }) + } + + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + } + + let index = this.keyMap.get(k) + if (index === undefined) { + if (status) status.fetch = 'miss' + const p = this.backgroundFetch(k, index, options, fetchContext) + return (p.__returned = p) + } else { + // in cache, maybe already fetching + const v = this.valList[index] + if (this.isBackgroundFetch(v)) { + const stale = + allowStale && v.__staleWhileFetching !== undefined + if (status) { + status.fetch = 'inflight' + if (stale) status.returnedStale = true + } + return stale ? v.__staleWhileFetching : (v.__returned = v) + } + + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.isStale(index) + if (!forceRefresh && !isStale) { + if (status) status.fetch = 'hit' + this.moveToTail(index) + if (updateAgeOnGet) { + this.updateItemAge(index) + } + this.statusTTL(status, index) + return v + } + + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.backgroundFetch(k, index, options, fetchContext) + const hasStale = p.__staleWhileFetching !== undefined + const staleVal = hasStale && allowStale + if (status) { + status.fetch = hasStale && isStale ? 'stale' : 'refresh' + if (staleVal && isStale) status.returnedStale = true + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p) + } + } + + get( + k, + { + allowStale = this.allowStale, + updateAgeOnGet = this.updateAgeOnGet, + noDeleteOnStaleGet = this.noDeleteOnStaleGet, + status, + } = {} + ) { + const index = this.keyMap.get(k) + if (index !== undefined) { + const value = this.valList[index] + const fetching = this.isBackgroundFetch(value) + this.statusTTL(status, index) + if (this.isStale(index)) { + if (status) status.get = 'stale' + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.delete(k) + } + if (status) status.returnedStale = allowStale + return allowStale ? value : undefined + } else { + if (status) { + status.returnedStale = + allowStale && value.__staleWhileFetching !== undefined + } + return allowStale ? value.__staleWhileFetching : undefined + } + } else { + if (status) status.get = 'hit' + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + if (fetching) { + return value.__staleWhileFetching + } + this.moveToTail(index) + if (updateAgeOnGet) { + this.updateItemAge(index) + } + return value + } + } else if (status) { + status.get = 'miss' + } + } + + connect(p, n) { + this.prev[n] = p + this.next[p] = n + } + + moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.tail) { + if (index === this.head) { + this.head = this.next[index] + } else { + this.connect(this.prev[index], this.next[index]) + } + this.connect(this.tail, index) + this.tail = index + } + } + + get del() { + deprecatedMethod('del', 'delete') + return this.delete + } + + delete(k) { + let deleted = false + if (this.size !== 0) { + const index = this.keyMap.get(k) + if (index !== undefined) { + deleted = true + if (this.size === 1) { + this.clear() + } else { + this.removeItemSize(index) + const v = this.valList[index] + if (this.isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')) + } else { + this.dispose(v, k, 'delete') + if (this.disposeAfter) { + this.disposed.push([v, k, 'delete']) + } + } + this.keyMap.delete(k) + this.keyList[index] = null + this.valList[index] = null + if (index === this.tail) { + this.tail = this.prev[index] + } else if (index === this.head) { + this.head = this.next[index] + } else { + this.next[this.prev[index]] = this.next[index] + this.prev[this.next[index]] = this.prev[index] + } + this.size-- + this.free.push(index) + } + } + } + if (this.disposed) { + while (this.disposed.length) { + this.disposeAfter(...this.disposed.shift()) + } + } + return deleted + } + + clear() { + for (const index of this.rindexes({ allowStale: true })) { + const v = this.valList[index] + if (this.isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')) + } else { + const k = this.keyList[index] + this.dispose(v, k, 'delete') + if (this.disposeAfter) { + this.disposed.push([v, k, 'delete']) + } + } + } + + this.keyMap.clear() + this.valList.fill(null) + this.keyList.fill(null) + if (this.ttls) { + this.ttls.fill(0) + this.starts.fill(0) + } + if (this.sizes) { + this.sizes.fill(0) + } + this.head = 0 + this.tail = 0 + this.initialFill = 1 + this.free.length = 0 + this.calculatedSize = 0 + this.size = 0 + if (this.disposed) { + while (this.disposed.length) { + this.disposeAfter(...this.disposed.shift()) + } + } + } + + get reset() { + deprecatedMethod('reset', 'clear') + return this.clear + } + + get length() { + deprecatedProperty('length', 'size') + return this.size + } + + static get AbortController() { + return AC + } + static get AbortSignal() { + return AS + } +} + +export default LRUCache diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json new file mode 100644 index 0000000..9684991 --- /dev/null +++ b/node_modules/lru-cache/package.json @@ -0,0 +1,96 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "7.18.3", + "author": "Isaac Z. Schlueter ", + "keywords": [ + "mru", + "lru", + "cache" + ], + "sideEffects": false, + "scripts": { + "build": "npm run prepare", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "prepare": "node ./scripts/transpile-to-esm.js", + "size": "size-limit", + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write .", + "typedoc": "typedoc ./index.d.ts" + }, + "type": "commonjs", + "main": "./index.js", + "module": "./index.mjs", + "types": "./index.d.ts", + "exports": { + ".": { + "import": { + "types": "./index.d.ts", + "default": "./index.mjs" + }, + "require": { + "types": "./index.d.ts", + "default": "./index.js" + } + }, + "./package.json": "./package.json" + }, + "repository": "git://github.com/isaacs/node-lru-cache.git", + "devDependencies": { + "@size-limit/preset-small-lib": "^7.0.8", + "@types/node": "^17.0.31", + "@types/tap": "^15.0.6", + "benchmark": "^2.1.4", + "c8": "^7.11.2", + "clock-mock": "^1.0.6", + "eslint-config-prettier": "^8.5.0", + "prettier": "^2.6.2", + "size-limit": "^7.0.8", + "tap": "^16.3.4", + "ts-node": "^10.7.0", + "tslib": "^2.4.0", + "typedoc": "^0.23.24", + "typescript": "^4.6.4" + }, + "license": "ISC", + "files": [ + "index.js", + "index.mjs", + "index.d.ts" + ], + "engines": { + "node": ">=12" + }, + "prettier": { + "semi": false, + "printWidth": 70, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "tap": { + "nyc-arg": [ + "--include=index.js" + ], + "node-arg": [ + "--expose-gc", + "--require", + "ts-node/register" + ], + "ts": false + }, + "size-limit": [ + { + "path": "./index.js" + } + ] +} diff --git a/node_modules/lru.min/LICENSE b/node_modules/lru.min/LICENSE new file mode 100644 index 0000000..e8c4fff --- /dev/null +++ b/node_modules/lru.min/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024-current Weslley Araújo (@wellwelwel) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/lru.min/README.md b/node_modules/lru.min/README.md new file mode 100644 index 0000000..d7c5bc0 --- /dev/null +++ b/node_modules/lru.min/README.md @@ -0,0 +1,426 @@ +

lru.min

+
+ +[![NPM Version](https://img.shields.io/npm/v/lru.min.svg?label=&color=70a1ff&logo=npm&logoColor=white)](https://www.npmjs.com/package/lru.min) +[![NPM Downloads](https://img.shields.io/npm/dm/lru.min.svg?label=&logo=npm&logoColor=white&color=45aaf2)](https://www.npmjs.com/package/lru.min) +[![Coverage](https://img.shields.io/codecov/c/github/wellwelwel/lru.min?label=&logo=codecov&logoColor=white&color=98cc00)](https://app.codecov.io/gh/wellwelwel/lru.min)
+[![GitHub Workflow Status (Node.js)](https://img.shields.io/github/actions/workflow/status/wellwelwel/lru.min/ci_node.yml?event=push&label=&branch=main&logo=nodedotjs&logoColor=535c68&color=badc58)](https://github.com/wellwelwel/lru.min/actions/workflows/ci_node.yml?query=branch%3Amain) +[![GitHub Workflow Status (Bun)](https://img.shields.io/github/actions/workflow/status/wellwelwel/lru.min/ci_bun.yml?event=push&label=&branch=main&logo=bun&logoColor=ffffff&color=f368e0)](https://github.com/wellwelwel/lru.min/actions/workflows/ci_bun.yml?query=branch%3Amain) +[![GitHub Workflow Status (Deno)](https://img.shields.io/github/actions/workflow/status/wellwelwel/lru.min/ci_deno.yml?event=push&label=&branch=main&logo=deno&logoColor=ffffff&color=079992)](https://github.com/wellwelwel/lru.min/actions/workflows/ci_deno.yml?query=branch%3Amain) + +🔥 An extremely fast, efficient, and lightweight LRU Cache for JavaScript (Browser compatible). + +
+ +## Why another LRU? + +- 🎖️ **lru.min** is fully compatible with both **Node.js** _(8+)_, **Bun**, **Deno** and, browser environments. All of this, while maintaining the same high performance [_(and a little more)_](https://github.com/wellwelwel/lru.min?tab=readme-ov-file#performance) as the most popular **LRU** packages. + +--- + +## Install + +```bash +# Node.js +npm i lru.min +``` + +```bash +# Bun +bun add lru.min +``` + +```bash +# Deno +deno add npm:lru.min +``` + +--- + +## Usage + +### Quickstart + +```js +import { createLRU } from 'lru.min'; + +const max = 2; +const onEviction = (key, value) => { + console.log(`Key "${key}" with value "${value}" has been evicted.`); +}; + +const LRU = createLRU({ + max, + onEviction, +}); + +LRU.set('A', 'My Value'); +LRU.set('B', 'Other Value'); +LRU.set('C', 'Another Value'); + +// => Key "A" with value "My Value" has been evicted. + +LRU.has('B'); +LRU.get('B'); +LRU.delete('B'); + +// => Key "B" with value "Other Value" has been evicted. + +LRU.peek('C'); + +LRU.clear(); // ← recommended | LRU.evict(max) → (slower alternative) + +// => Key "C" with value "Another Value" has been evicted. + +LRU.set('D', "You're amazing 💛"); + +LRU.size; // 1 +LRU.max; // 2 +LRU.available; // 1 + +LRU.resize(10); + +LRU.size; // 1 +LRU.max; // 10 +LRU.available; // 9 +``` + +> For _up-to-date_ documentation, always follow the [**README.md**](https://github.com/wellwelwel/lru.min?tab=readme-ov-file#readme) in the **GitHub** repository. + +### Import + +#### ES Modules + +```js +import { createLRU } from 'lru.min'; +``` + +#### CommonJS + +```js +const { createLRU } = require('lru.min'); +``` + +#### Browser + +> Requires **ES6**. + +```html + +``` + +- You can use tools such as [**Babel**](https://github.com/babel/babel) to increase the compatibility rate. + +### Create a new LRU Cache + +> Set maximum size when creating **LRU**. + +```ts +const LRU = createLRU({ max: 150_000 }); +``` + +Also, you can set a callback for every deletion/eviction: + +```ts +const LRU = createLRU({ + max: 150_000, + onEviction: (key, value) => { + // do something + }, +}); +``` + +### Set a cache + +Adds a key-value pair to the cache. Updates the value if the key already exists + +```ts +LRU.set('key', 'value'); +``` + +> `undefined` keys will simply be ignored. + +- Complexity: **O(1)**. + +### Get a cache + +Retrieves the value for a given key and moves the key to the most recent position. + +```ts +LRU.get('key'); +``` + +- Complexity: **O(1)**. + +### Peek a cache + +Retrieves the value for a given key without changing its position. + +```ts +LRU.peek('key'); +``` + +- Complexity: **O(1)**. + +### Check if a key exists + +```ts +LRU.has('key'); +``` + +- Complexity: **O(1)**. + +### Delete a cache + +```ts +LRU.delete('key'); +``` + +- Complexity: **O(1)**. + +### Evict from the oldest cache + +Evicts the specified number of the oldest items from the cache. + +```ts +LRU.evict(1000); +``` + +- Complexity: **O(key)** — even if passed a number greater than the number of items, only existing items will be evicted. + +> [!TIP] +> +> - Methods that perform eviction(s) when maximum size is reached: `set` and `resize`. +> - Methods that always perform eviction(s): `delete`, `clear`, and `evict` itself. + +### Resize the cache + +Resizes the cache to a new maximum size, evicting items if necessary. + +```ts +LRU.resize(50_000); +``` + +- Complexity: + - Increasing: **O(newMax - max)**. + - Downsizing: **O(n)**. + +### Clear the cache + +Clears and disposes (if used) all key-value pairs from the cache. + +```ts +LRU.clear(); +``` + +- Complexity: + - Without `onEviction`: **O(1)**. + - Using `onEviction`: **O(entries)**. + +### Debugging + +#### Get the max size of the cache + +```ts +LRU.max; +``` + +- Complexity: **O(1)**. + +#### Get the current size of the cache + +```ts +LRU.size; +``` + +- Complexity: **O(1)**. + +#### Get the available slots in the cache + +```ts +LRU.available; +``` + +- Complexity: **O(1)**. + +### Iterating the cache + +#### Get all keys + +Iterates over all keys in the cache, from most recent to least recent. + +```ts +const keys = [...LRU.keys()]; +``` + +- Complexity: **O(keys)**. + +#### Get all values + +Iterates over all values in the cache, from most recent to least recent. + +```ts +const values = [...LRU.values()]; +``` + +- Complexity: **O(values)**. + +#### Get all entries + +Iterates over `[key, value]` pairs in the cache, from most recent to least recent. + +```ts +const entries = [...LRU.entries()]; +``` + +- Complexity: **O(entries)**. + +#### Run a callback for each entry + +Iterates over each value-key pair in the cache, from most recent to least recent. + +```ts +LRU.forEach((value, key) => { + // do something +}); +``` + +- Complexity: **O(entries)**. + +--- + +> [!NOTE] +> +> - We use `O(keys)`, `O(values)`, `O(entries)`, and `O(newMax - max)` to explicitly indicate what is being iterated over. In traditional complexity notation, this would be represented as `O(n)`. + +--- + +### TypeScript + +You can set types for both keys and values. For example: + +```ts +import { createLRU } from 'lru.min'; + +type Key = number; + +type Value = { + name: string; +}; + +const LRU = createLRU({ max: 1000 }); + +LRU.set(1, { name: 'Peter' }); +LRU.set(2, { name: 'Mary' }); +``` + +Also: + +```ts +import { createLRU, type CacheOptions } from 'lru.min'; + +type Key = number; + +type Value = { + name: string; +}; + +const options: CacheOptions = { + max: 10, + onEviction(key, value) { + console.log(key, value); + }, +}; + +// No need to repeat the type params +const LRU = createLRU(options); + +LRU.set(1, { name: 'Peter' }); +LRU.set(2, { name: 'Mary' }); +``` + +--- + +### Performance + +The benchmark is performed by comparing `1,000,000` runs through a maximum cache limit of `100,000`, getting `333,333` caches and deleting `200,000` keys 10 consecutive times, clearing the cache every run. + +> - [**lru-cache**](https://github.com/isaacs/node-lru-cache) `v11.0.0` +> - [**quick-lru**](https://github.com/sindresorhus/quick-lru) `v7.0.0` + +```sh +# Time: + lru.min: 240.45ms + lru-cache: 258.32ms + quick-lru: 279.89ms + +# CPU: + lru.min: 275558.30µs + lru-cache: 306858.30µs + quick-lru: 401318.80µs +``` + +- See detailed results and how the tests are run and compared in the [**benchmark**](https://github.com/wellwelwel/lru.min/tree/main/benchmark) directory. + +--- + +## Security Policy + +[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/wellwelwel/lru.min/ci_codeql.yml?event=push&label=&branch=main&logo=github&logoColor=white&color=f368e0)](https://github.com/wellwelwel/lru.min/actions/workflows/ci_codeql.yml?query=branch%3Amain) + +Please check the [**SECURITY.md**](https://github.com/wellwelwel/lru.min/blob/main/SECURITY.md). + +--- + +## Contributing + +See the [**Contributing Guide**](https://github.com/wellwelwel/lru.min/blob/main/CONTRIBUTING.md) and please follow our [**Code of Conduct**](https://github.com/wellwelwel/lru.min/blob/main/CODE_OF_CONDUCT.md) 🚀 + +--- + +## Acknowledgements + +**lru.min** is based and inspired on the architecture and code of both [**lru-cache**](https://github.com/isaacs/node-lru-cache) and [**quick-lru**](https://github.com/sindresorhus/quick-lru), simplifying their core concepts for enhanced performance and compatibility. + +For more comprehensive features such as **TTL** support, consider using and supporting them 🤝 + +- The architecture is mostly based on [@isaacs](https://github.com/isaacs) — [**lru-cache**](https://github.com/isaacs/node-lru-cache/blob/8f51d75351cbb4ac819952eb8e9f95eda00ef800/src/index.ts). +- Most of the methods names and its functionalities were inspired by [@sindresorhus](https://github.com/sindresorhus) — [**quick-lru**](https://github.com/sindresorhus/quick-lru/blob/a2262c65e1952539cb4d985a67c46363a780d234/index.js). +- [![Contributors](https://img.shields.io/github/contributors/wellwelwel/lru.min?label=Contributors)](https://github.com/wellwelwel/lru.min/graphs/contributors) + +--- + +#### What comes from [**lru-cache**](https://github.com/isaacs/node-lru-cache)? + +Architecture's essence: + +> _It's not the same code, but majority based on [this](https://github.com/isaacs/node-lru-cache/blob/8f51d75351cbb4ac819952eb8e9f95eda00ef800/src/index.ts#L1385-L1394)._ + +```ts +let free: number[] = []; + +const keyMap: Map = new Map(); +const keyList: (Key | undefined)[] = new Array(max).fill(undefined); +const valList: (Value | undefined)[] = new Array(max).fill(undefined); +const next: number[] = new Array(max).fill(0); +const prev: number[] = new Array(max).fill(0); +``` + +--- + +#### What comes from [**quick-lru**](https://github.com/sindresorhus/quick-lru)? + +Name of methods and options _(including their final functionality ideas)_: + +- `resize` +- `peek` +- `onEviction` +- `forEach` +- `entriesDescending` as `entries` + +--- + +## License + +**lru.min** is under the [**MIT License**](https://github.com/wellwelwel/lru.min/blob/main/LICENSE).
+Copyright © 2024-present [Weslley Araújo](https://github.com/wellwelwel) and **lru.min** [contributors](https://github.com/wellwelwel/lru.min/graphs/contributors). diff --git a/node_modules/lru.min/browser/lru.min.js b/node_modules/lru.min/browser/lru.min.js new file mode 100644 index 0000000..82d8e99 --- /dev/null +++ b/node_modules/lru.min/browser/lru.min.js @@ -0,0 +1 @@ +"use strict";window.createLRU=function(e){var r=e.max;if(!(Number.isInteger(r)&&r>0))throw new TypeError("`max` must be a positive integer");var n=0,i=0,t=0,a=[],o=e.onEviction,l=new Map,f=new Array(r).fill(void 0),u=new Array(r).fill(void 0),v=new Array(r).fill(0),s=new Array(r).fill(0),d=function(e,r){if(e!==t){var n=v[e],a=s[e];e===i?i=n:("get"===r||0!==a)&&(v[a]=n),0!==n&&(s[n]=a),v[t]=e,s[e]=t,v[e]=0,t=e}},p=function(){var e=i,r=f[e];return null==o||o(r,u[e]),l.delete(r),f[e]=void 0,u[e]=void 0,0!==(i=v[e])&&(s[i]=0),0===--n&&(i=t=0),a.push(e),e};return{set:function(e,v){if(void 0!==e){var s=l.get(e);void 0===s?(s=n===r?p():a.length>0?a.pop():n,l.set(e,s),f[s]=e,n++):null==o||o(e,u[s]),u[s]=v,1===n?i=t=s:d(s,"set")}},get:function(e){var r=l.get(e);if(void 0!==r)return r!==t&&d(r,"get"),u[r]},peek:function(e){var r=l.get(e);return void 0!==r?u[r]:void 0},has:function(e){return l.has(e)},keys:function*(){for(var e=t,r=0;r0;)p(),r--},clear:function(){if("function"==typeof o)for(var e=l.values(),r=e.next();!r.done;r=e.next())o(f[r.value],u[r.value]);l.clear(),f.fill(void 0),u.fill(void 0),a=[],n=0,i=t=0},resize:function(e){if(!(Number.isInteger(e)&&e>0))throw new TypeError("`max` must be a positive integer");if(e!==r){if(e=0;m--)y[m]=f[d],g[m]=u[d],h[m]=m+1,w[m]=m-1,l.set(y[m],m),d=s[d];i=0,t=p-1,n=p,f.length=e,u.length=e,v.length=e,s.length=e;for(var x=0;x = { + /** Maximum number of items the cache can hold. */ + max: number; + /** Function called when an item is evicted from the cache. */ + onEviction?: (key: Key, value: Value) => unknown; +}; +export declare const createLRU: (options: CacheOptions) => { + /** Adds a key-value pair to the cache. Updates the value if the key already exists. */ + set(key: Key, value: Value): undefined; + /** Retrieves the value for a given key and moves the key to the most recent position. */ + get(key: Key): Value | undefined; + /** Retrieves the value for a given key without changing its position. */ + peek: (key: Key) => Value | undefined; + /** Checks if a key exists in the cache. */ + has: (key: Key) => boolean; + /** Iterates over all keys in the cache, from most recent to least recent. */ + keys(): IterableIterator; + /** Iterates over all values in the cache, from most recent to least recent. */ + values(): IterableIterator; + /** Iterates over `[key, value]` pairs in the cache, from most recent to least recent. */ + entries(): IterableIterator<[Key, Value]>; + /** Iterates over each value-key pair in the cache, from most recent to least recent. */ + forEach: (callback: (value: Value, key: Key) => unknown) => undefined; + /** Deletes a key-value pair from the cache. */ + delete(key: Key): boolean; + /** Evicts the oldest item or the specified number of the oldest items from the cache. */ + evict: (number: number) => undefined; + /** Clears all key-value pairs from the cache. */ + clear(): undefined; + /** Resizes the cache to a new maximum size, evicting items if necessary. */ + resize: (newMax: number) => undefined; + /** Returns the maximum number of items that can be stored in the cache. */ + readonly max: number; + /** Returns the number of items currently stored in the cache. */ + readonly size: number; + /** Returns the number of currently available slots in the cache before reaching the maximum size. */ + readonly available: number; +}; diff --git a/node_modules/lru.min/lib/index.js b/node_modules/lru.min/lib/index.js new file mode 100644 index 0000000..3b86256 --- /dev/null +++ b/node_modules/lru.min/lib/index.js @@ -0,0 +1,229 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createLRU = void 0; +const createLRU = (options) => { + let { max } = options; + if (!(Number.isInteger(max) && max > 0)) + throw new TypeError('`max` must be a positive integer'); + let size = 0; + let head = 0; + let tail = 0; + let free = []; + const { onEviction } = options; + const keyMap = new Map(); + const keyList = new Array(max).fill(undefined); + const valList = new Array(max).fill(undefined); + const next = new Array(max).fill(0); + const prev = new Array(max).fill(0); + const setTail = (index, type) => { + if (index === tail) + return; + const nextIndex = next[index]; + const prevIndex = prev[index]; + if (index === head) + head = nextIndex; + else if (type === 'get' || prevIndex !== 0) + next[prevIndex] = nextIndex; + if (nextIndex !== 0) + prev[nextIndex] = prevIndex; + next[tail] = index; + prev[index] = tail; + next[index] = 0; + tail = index; + }; + const _evict = () => { + const evictHead = head; + const key = keyList[evictHead]; + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[evictHead]); + keyMap.delete(key); + keyList[evictHead] = undefined; + valList[evictHead] = undefined; + head = next[evictHead]; + if (head !== 0) + prev[head] = 0; + size--; + if (size === 0) + head = tail = 0; + free.push(evictHead); + return evictHead; + }; + return { + /** Adds a key-value pair to the cache. Updates the value if the key already exists. */ + set(key, value) { + if (key === undefined) + return; + let index = keyMap.get(key); + if (index === undefined) { + index = size === max ? _evict() : free.length > 0 ? free.pop() : size; + keyMap.set(key, index); + keyList[index] = key; + size++; + } + else + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[index]); + valList[index] = value; + if (size === 1) + head = tail = index; + else + setTail(index, 'set'); + }, + /** Retrieves the value for a given key and moves the key to the most recent position. */ + get(key) { + const index = keyMap.get(key); + if (index === undefined) + return; + if (index !== tail) + setTail(index, 'get'); + return valList[index]; + }, + /** Retrieves the value for a given key without changing its position. */ + peek: (key) => { + const index = keyMap.get(key); + return index !== undefined ? valList[index] : undefined; + }, + /** Checks if a key exists in the cache. */ + has: (key) => keyMap.has(key), + /** Iterates over all keys in the cache, from most recent to least recent. */ + *keys() { + let current = tail; + for (let i = 0; i < size; i++) { + yield keyList[current]; + current = prev[current]; + } + }, + /** Iterates over all values in the cache, from most recent to least recent. */ + *values() { + let current = tail; + for (let i = 0; i < size; i++) { + yield valList[current]; + current = prev[current]; + } + }, + /** Iterates over `[key, value]` pairs in the cache, from most recent to least recent. */ + *entries() { + let current = tail; + for (let i = 0; i < size; i++) { + yield [keyList[current], valList[current]]; + current = prev[current]; + } + }, + /** Iterates over each value-key pair in the cache, from most recent to least recent. */ + forEach: (callback) => { + let current = tail; + for (let i = 0; i < size; i++) { + const key = keyList[current]; + const value = valList[current]; + callback(value, key); + current = prev[current]; + } + }, + /** Deletes a key-value pair from the cache. */ + delete(key) { + const index = keyMap.get(key); + if (index === undefined) + return false; + onEviction === null || onEviction === void 0 ? void 0 : onEviction(key, valList[index]); + keyMap.delete(key); + free.push(index); + keyList[index] = undefined; + valList[index] = undefined; + const prevIndex = prev[index]; + const nextIndex = next[index]; + if (prevIndex !== 0) + next[prevIndex] = nextIndex; + if (nextIndex !== 0) + prev[nextIndex] = prevIndex; + if (index === head) + head = nextIndex; + if (index === tail) + tail = prevIndex; + size--; + return true; + }, + /** Evicts the oldest item or the specified number of the oldest items from the cache. */ + evict: (number) => { + let toPrune = Math.min(number, size); + while (toPrune > 0) { + _evict(); + toPrune--; + } + }, + /** Clears all key-value pairs from the cache. */ + clear() { + if (typeof onEviction === 'function') { + const iterator = keyMap.values(); + for (let result = iterator.next(); !result.done; result = iterator.next()) + onEviction(keyList[result.value], valList[result.value]); + } + keyMap.clear(); + keyList.fill(undefined); + valList.fill(undefined); + free = []; + size = 0; + head = tail = 0; + }, + /** Resizes the cache to a new maximum size, evicting items if necessary. */ + resize: (newMax) => { + if (!(Number.isInteger(newMax) && newMax > 0)) + throw new TypeError('`max` must be a positive integer'); + if (newMax === max) + return; + if (newMax < max) { + let current = tail; + const preserve = Math.min(size, newMax); + const remove = size - preserve; + const newKeyList = new Array(newMax); + const newValList = new Array(newMax); + const newNext = new Array(newMax); + const newPrev = new Array(newMax); + for (let i = 1; i <= remove; i++) + onEviction === null || onEviction === void 0 ? void 0 : onEviction(keyList[i], valList[i]); + for (let i = preserve - 1; i >= 0; i--) { + newKeyList[i] = keyList[current]; + newValList[i] = valList[current]; + newNext[i] = i + 1; + newPrev[i] = i - 1; + keyMap.set(newKeyList[i], i); + current = prev[current]; + } + head = 0; + tail = preserve - 1; + size = preserve; + keyList.length = newMax; + valList.length = newMax; + next.length = newMax; + prev.length = newMax; + for (let i = 0; i < preserve; i++) { + keyList[i] = newKeyList[i]; + valList[i] = newValList[i]; + next[i] = newNext[i]; + prev[i] = newPrev[i]; + } + free = []; + for (let i = preserve; i < newMax; i++) + free.push(i); + } + else { + const fill = newMax - max; + keyList.push(...new Array(fill).fill(undefined)); + valList.push(...new Array(fill).fill(undefined)); + next.push(...new Array(fill).fill(0)); + prev.push(...new Array(fill).fill(0)); + } + max = newMax; + }, + /** Returns the maximum number of items that can be stored in the cache. */ + get max() { + return max; + }, + /** Returns the number of items currently stored in the cache. */ + get size() { + return size; + }, + /** Returns the number of currently available slots in the cache before reaching the maximum size. */ + get available() { + return max - size; + }, + }; +}; +exports.createLRU = createLRU; diff --git a/node_modules/lru.min/lib/index.mjs b/node_modules/lru.min/lib/index.mjs new file mode 100644 index 0000000..a585360 --- /dev/null +++ b/node_modules/lru.min/lib/index.mjs @@ -0,0 +1,207 @@ +const createLRU = (options) => { + let { max } = options; + if (!(Number.isInteger(max) && max > 0)) + throw new TypeError("`max` must be a positive integer"); + let size = 0; + let head = 0; + let tail = 0; + let free = []; + const { onEviction } = options; + const keyMap = /* @__PURE__ */ new Map(); + const keyList = new Array(max).fill(void 0); + const valList = new Array(max).fill(void 0); + const next = new Array(max).fill(0); + const prev = new Array(max).fill(0); + const setTail = (index, type) => { + if (index === tail) return; + const nextIndex = next[index]; + const prevIndex = prev[index]; + if (index === head) head = nextIndex; + else if (type === "get" || prevIndex !== 0) next[prevIndex] = nextIndex; + if (nextIndex !== 0) prev[nextIndex] = prevIndex; + next[tail] = index; + prev[index] = tail; + next[index] = 0; + tail = index; + }; + const _evict = () => { + const evictHead = head; + const key = keyList[evictHead]; + onEviction == null ? void 0 : onEviction(key, valList[evictHead]); + keyMap.delete(key); + keyList[evictHead] = void 0; + valList[evictHead] = void 0; + head = next[evictHead]; + if (head !== 0) prev[head] = 0; + size--; + if (size === 0) head = tail = 0; + free.push(evictHead); + return evictHead; + }; + return { + /** Adds a key-value pair to the cache. Updates the value if the key already exists. */ + set(key, value) { + if (key === void 0) return; + let index = keyMap.get(key); + if (index === void 0) { + index = size === max ? _evict() : free.length > 0 ? free.pop() : size; + keyMap.set(key, index); + keyList[index] = key; + size++; + } else onEviction == null ? void 0 : onEviction(key, valList[index]); + valList[index] = value; + if (size === 1) head = tail = index; + else setTail(index, "set"); + }, + /** Retrieves the value for a given key and moves the key to the most recent position. */ + get(key) { + const index = keyMap.get(key); + if (index === void 0) return; + if (index !== tail) setTail(index, "get"); + return valList[index]; + }, + /** Retrieves the value for a given key without changing its position. */ + peek: (key) => { + const index = keyMap.get(key); + return index !== void 0 ? valList[index] : void 0; + }, + /** Checks if a key exists in the cache. */ + has: (key) => keyMap.has(key), + /** Iterates over all keys in the cache, from most recent to least recent. */ + *keys() { + let current = tail; + for (let i = 0; i < size; i++) { + yield keyList[current]; + current = prev[current]; + } + }, + /** Iterates over all values in the cache, from most recent to least recent. */ + *values() { + let current = tail; + for (let i = 0; i < size; i++) { + yield valList[current]; + current = prev[current]; + } + }, + /** Iterates over `[key, value]` pairs in the cache, from most recent to least recent. */ + *entries() { + let current = tail; + for (let i = 0; i < size; i++) { + yield [keyList[current], valList[current]]; + current = prev[current]; + } + }, + /** Iterates over each value-key pair in the cache, from most recent to least recent. */ + forEach: (callback) => { + let current = tail; + for (let i = 0; i < size; i++) { + const key = keyList[current]; + const value = valList[current]; + callback(value, key); + current = prev[current]; + } + }, + /** Deletes a key-value pair from the cache. */ + delete(key) { + const index = keyMap.get(key); + if (index === void 0) return false; + onEviction == null ? void 0 : onEviction(key, valList[index]); + keyMap.delete(key); + free.push(index); + keyList[index] = void 0; + valList[index] = void 0; + const prevIndex = prev[index]; + const nextIndex = next[index]; + if (prevIndex !== 0) next[prevIndex] = nextIndex; + if (nextIndex !== 0) prev[nextIndex] = prevIndex; + if (index === head) head = nextIndex; + if (index === tail) tail = prevIndex; + size--; + return true; + }, + /** Evicts the oldest item or the specified number of the oldest items from the cache. */ + evict: (number) => { + let toPrune = Math.min(number, size); + while (toPrune > 0) { + _evict(); + toPrune--; + } + }, + /** Clears all key-value pairs from the cache. */ + clear() { + if (typeof onEviction === "function") { + const iterator = keyMap.values(); + for (let result = iterator.next(); !result.done; result = iterator.next()) + onEviction(keyList[result.value], valList[result.value]); + } + keyMap.clear(); + keyList.fill(void 0); + valList.fill(void 0); + free = []; + size = 0; + head = tail = 0; + }, + /** Resizes the cache to a new maximum size, evicting items if necessary. */ + resize: (newMax) => { + if (!(Number.isInteger(newMax) && newMax > 0)) + throw new TypeError("`max` must be a positive integer"); + if (newMax === max) return; + if (newMax < max) { + let current = tail; + const preserve = Math.min(size, newMax); + const remove = size - preserve; + const newKeyList = new Array(newMax); + const newValList = new Array(newMax); + const newNext = new Array(newMax); + const newPrev = new Array(newMax); + for (let i = 1; i <= remove; i++) + onEviction == null ? void 0 : onEviction(keyList[i], valList[i]); + for (let i = preserve - 1; i >= 0; i--) { + newKeyList[i] = keyList[current]; + newValList[i] = valList[current]; + newNext[i] = i + 1; + newPrev[i] = i - 1; + keyMap.set(newKeyList[i], i); + current = prev[current]; + } + head = 0; + tail = preserve - 1; + size = preserve; + keyList.length = newMax; + valList.length = newMax; + next.length = newMax; + prev.length = newMax; + for (let i = 0; i < preserve; i++) { + keyList[i] = newKeyList[i]; + valList[i] = newValList[i]; + next[i] = newNext[i]; + prev[i] = newPrev[i]; + } + free = []; + for (let i = preserve; i < newMax; i++) free.push(i); + } else { + const fill = newMax - max; + keyList.push(...new Array(fill).fill(void 0)); + valList.push(...new Array(fill).fill(void 0)); + next.push(...new Array(fill).fill(0)); + prev.push(...new Array(fill).fill(0)); + } + max = newMax; + }, + /** Returns the maximum number of items that can be stored in the cache. */ + get max() { + return max; + }, + /** Returns the number of items currently stored in the cache. */ + get size() { + return size; + }, + /** Returns the number of currently available slots in the cache before reaching the maximum size. */ + get available() { + return max - size; + } + }; +}; +export { + createLRU +}; diff --git a/node_modules/lru.min/package.json b/node_modules/lru.min/package.json new file mode 100644 index 0000000..5047453 --- /dev/null +++ b/node_modules/lru.min/package.json @@ -0,0 +1,89 @@ +{ + "name": "lru.min", + "version": "1.1.2", + "description": "🔥 An extremely fast and efficient LRU cache for JavaScript with high compatibility (including Browsers) — 6.8KB.", + "main": "./lib/index.js", + "module": "./lib/index.mjs", + "types": "./lib/index.d.ts", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/wellwelwel/lru.min.git" + }, + "bugs": { + "url": "https://github.com/wellwelwel/lru.min/issues" + }, + "author": "https://github.com/wellwelwel", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + }, + "files": [ + "browser", + "lib" + ], + "engines": { + "node": ">=8.0.0", + "bun": ">=1.0.0", + "deno": ">=1.30.0" + }, + "scripts": { + "benchmark:esm": "cd benchmark && npm ci && node index.mjs", + "benchmark:cjs": "cd benchmark && npm ci && node index.cjs", + "prebuild": "rm -rf ./browser ./lib", + "build:browser": "tsx tools/browserfy.ts", + "build:esm": "esbuild src/index.ts --outfile=lib/index.mjs --platform=node --target=node12 --format=esm", + "build": "tsc && npm run build:esm && npm run build:browser", + "test:node": "poku", + "test:bun": "bun poku", + "test:deno": "deno run -A npm:poku", + "test:coverage": "mcr --import tsx --config mcr.config.ts npm run test:node", + "lint": "npx @biomejs/biome lint && prettier --check .", + "lint:fix": "npx @biomejs/biome lint --write && prettier --write .github/workflows/*.yml .", + "update": "pu minor && npm i && npm audit fix", + "postupdate": "npm run lint:fix", + "size": "ls -lh lib/index.mjs | awk '{print $5}'" + }, + "devDependencies": { + "@babel/core": "^7.26.9", + "@babel/preset-env": "^7.26.9", + "@biomejs/biome": "^1.9.4", + "@types/babel__core": "^7.20.5", + "@types/node": "^22.13.10", + "esbuild": "^0.25.0", + "monocart-coverage-reports": "2.12.1", + "packages-update": "^2.0.0", + "poku": "^3.0.1", + "prettier": "^3.5.3", + "terser": "^5.39.0", + "tsx": "^4.19.3", + "typescript": "^5.8.2" + }, + "exports": { + ".": { + "import": { + "types": "./lib/index.d.ts", + "default": "./lib/index.mjs" + }, + "require": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + } + } + }, + "keywords": [ + "lru", + "cache", + "caching", + "hash", + "node", + "nodejs", + "bun", + "deno", + "typescript", + "browser", + "fast", + "lru-cache", + "quick-lru" + ] +} diff --git a/node_modules/mysql2/License b/node_modules/mysql2/License new file mode 100644 index 0000000..c9348b9 --- /dev/null +++ b/node_modules/mysql2/License @@ -0,0 +1,19 @@ +Copyright (c) 2016 Andrey Sidorov (sidorares@yandex.ru) and contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/node_modules/mysql2/README.md b/node_modules/mysql2/README.md new file mode 100644 index 0000000..7b5560f --- /dev/null +++ b/node_modules/mysql2/README.md @@ -0,0 +1,114 @@ +[npm-image]: https://img.shields.io/npm/v/mysql2.svg +[npm-url]: https://npmjs.com/package/mysql2 +[node-version-image]: https://img.shields.io/node/v/mysql2.svg +[node-version-url]: https://nodejs.org/en/download +[downloads-image]: https://img.shields.io/npm/dm/mysql2.svg +[downloads-url]: https://npmjs.com/package/mysql2 +[license-url]: https://github.com/sidorares/node-mysql2/blob/master/License +[license-image]: https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000 +[node-mysql]: https://github.com/mysqljs/mysql +[mysqljs]: https://github.com/mysqljs +[mysql-native]: https://github.com/sidorares/nodejs-mysql-native +[sidorares]: https://github.com/sidorares +[TooTallNate]: https://gist.github.com/TooTallNate +[starttls.js]: https://gist.github.com/TooTallNate/848444 +[node-mariasql]: https://github.com/mscdex/node-mariasql +[contributors]: https://github.com/sidorares/node-mysql2/graphs/contributors +[contributing]: https://github.com/sidorares/node-mysql2/blob/master/Contributing.md +[docs-base]: https://sidorares.github.io/node-mysql2/docs +[docs-base-zh-CN]: https://sidorares.github.io/node-mysql2/zh-CN/docs +[docs-base-pt-BR]: https://sidorares.github.io/node-mysql2/pt-BR/docs +[docs-prepared-statements]: https://sidorares.github.io/node-mysql2/docs/documentation/prepared-statements +[docs-mysql-server]: https://sidorares.github.io/node-mysql2/docs/documentation/mysql-server +[docs-promise-wrapper]: https://sidorares.github.io/node-mysql2/docs/documentation/promise-wrapper +[docs-authentication-switch]: https://sidorares.github.io/node-mysql2/docs/documentation/authentication-switch +[docs-streams]: https://sidorares.github.io/node-mysql2/docs/documentation/extras +[docs-typescript-docs]: https://sidorares.github.io/node-mysql2/docs/documentation/typescript-examples +[docs-qs-pooling]: https://sidorares.github.io/node-mysql2/docs#using-connection-pools +[docs-qs-first-query]: https://sidorares.github.io/node-mysql2/docs#first-query +[docs-qs-using-prepared-statements]: https://sidorares.github.io/node-mysql2/docs#using-prepared-statements +[docs-examples]: https://sidorares.github.io/node-mysql2/docs/examples +[docs-faq]: https://sidorares.github.io/node-mysql2/docs/faq +[docs-documentation]: https://sidorares.github.io/node-mysql2/docs/documentation +[docs-contributing]: https://sidorares.github.io/node-mysql2/docs/contributing/website +[coverage]: https://img.shields.io/codecov/c/github/sidorares/node-mysql2 +[coverage-url]: https://app.codecov.io/github/sidorares/node-mysql2 +[ci-url]: https://github.com/sidorares/node-mysql2/actions/workflows/ci-coverage.yml?query=branch%3Amaster +[ci-image]: https://img.shields.io/github/actions/workflow/status/sidorares/node-mysql2/ci-coverage.yml?event=push&style=flat&label=CI&branch=master + +# MySQL2 + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![GitHub Workflow Status (with event)][ci-image]][ci-url] +[![Codecov][coverage]][coverage-url] +[![License][license-image]][license-url] + +[English][docs-base] | [简体中文][docs-base-zh-CN] | [Português (BR)][docs-base-pt-BR] + +> MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl [much more][docs-documentation]. + +**Table of Contents** + +- [History and Why MySQL2](#history-and-why-mysql2) +- [Installation](#installation) +- [Documentation](#documentation) +- [Acknowledgements](#acknowledgements) +- [Contributing](#contributing) + +## History and Why MySQL2 + +MySQL2 project is a continuation of [MySQL-Native][mysql-native]. Protocol parser code was rewritten from scratch and api changed to match popular [Node MySQL][node-mysql]. MySQL2 team is working together with [Node MySQL][node-mysql] team to factor out shared code and move it under [mysqljs][mysqljs] organization. + +MySQL2 is mostly API compatible with [Node MySQL][node-mysql] and supports majority of features. MySQL2 also offers these additional features: + +- Faster / Better Performance +- [Prepared Statements][docs-prepared-statements] +- MySQL Binary Log Protocol +- [MySQL Server][docs-mysql-server] +- Extended support for Encoding and Collation +- [Promise Wrapper][docs-promise-wrapper] +- Compression +- SSL and [Authentication Switch][docs-authentication-switch] +- [Custom Streams][docs-streams] +- [Pooling][docs-qs-pooling] + +## Installation + +MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues. + +```bash +npm install --save mysql2 +``` + +If you are using TypeScript, you will need to install `@types/node`. + +```bash +npm install --save-dev @types/node +``` + +> For TypeScript documentation and examples, see [here][docs-typescript-docs]. + +## Documentation + +- [Quickstart][docs-base] + - [First Query][docs-qs-first-query], [Using Prepared Statements][docs-qs-using-prepared-statements], [Using Connection Pools][docs-qs-pooling] and more. +- [Documentation][docs-documentation] +- [Examples][docs-examples] +- [FAQ][docs-faq] + +## Acknowledgements + +- Internal protocol is written by [@sidorares][sidorares] [MySQL-Native][mysql-native]. +- Constants, SQL parameters interpolation, Pooling, `ConnectionConfig` class taken from [Node MySQL][node-mysql]. +- SSL upgrade code based on [@TooTallNate][TooTallNate] [code][starttls.js]. +- Secure connection / compressed connection api flags compatible to [MariaSQL][node-mariasql] client. +- [Contributors][contributors]. + +## Contributing + +Want to improve something in **MySQL2**? +Please check [Contributing.md][contributing] for detailed instruction on how to get started. + +To contribute in **MySQL2 Documentation**, please visit the [Website Contributing Guidelines][docs-contributing] for detailed instruction on how to get started. diff --git a/node_modules/mysql2/index.d.ts b/node_modules/mysql2/index.d.ts new file mode 100644 index 0000000..35e7952 --- /dev/null +++ b/node_modules/mysql2/index.d.ts @@ -0,0 +1 @@ +export * from './typings/mysql/index.js'; diff --git a/node_modules/mysql2/index.js b/node_modules/mysql2/index.js new file mode 100644 index 0000000..e303620 --- /dev/null +++ b/node_modules/mysql2/index.js @@ -0,0 +1,77 @@ +'use strict'; + +const SqlString = require('sqlstring'); + +const ConnectionConfig = require('./lib/connection_config.js'); +const parserCache = require('./lib/parsers/parser_cache.js'); + +const Connection = require('./lib/connection.js'); + +exports.createConnection = require('./lib/create_connection.js'); +exports.connect = exports.createConnection; +exports.Connection = Connection; +exports.ConnectionConfig = ConnectionConfig; + +const Pool = require('./lib/pool.js'); +const PoolCluster = require('./lib/pool_cluster.js'); +const createPool = require('./lib/create_pool.js'); +const createPoolCluster = require('./lib/create_pool_cluster.js'); + +exports.createPool = createPool; + +exports.createPoolCluster = createPoolCluster; + +exports.createQuery = Connection.createQuery; + +exports.Pool = Pool; + +exports.PoolCluster = PoolCluster; + +exports.createServer = function (handler) { + const Server = require('./lib/server.js'); + const s = new Server(); + if (handler) { + s.on('connection', handler); + } + return s; +}; + +exports.PoolConnection = require('./lib/pool_connection.js'); +exports.authPlugins = require('./lib/auth_plugins'); +exports.escape = SqlString.escape; +exports.escapeId = SqlString.escapeId; +exports.format = SqlString.format; +exports.raw = SqlString.raw; + +exports.__defineGetter__( + 'createConnectionPromise', + () => require('./promise.js').createConnection +); + +exports.__defineGetter__( + 'createPoolPromise', + () => require('./promise.js').createPool +); + +exports.__defineGetter__( + 'createPoolClusterPromise', + () => require('./promise.js').createPoolCluster +); + +exports.__defineGetter__('Types', () => require('./lib/constants/types.js')); + +exports.__defineGetter__('Charsets', () => + require('./lib/constants/charsets.js') +); + +exports.__defineGetter__('CharsetToEncoding', () => + require('./lib/constants/charset_encodings.js') +); + +exports.setMaxParserCache = function (max) { + parserCache.setMaxCache(max); +}; + +exports.clearParserCache = function () { + parserCache.clearCache(); +}; diff --git a/node_modules/mysql2/lib/auth_41.js b/node_modules/mysql2/lib/auth_41.js new file mode 100644 index 0000000..9245380 --- /dev/null +++ b/node_modules/mysql2/lib/auth_41.js @@ -0,0 +1,95 @@ +'use strict'; + +/* +4.1 authentication: (http://bazaar.launchpad.net/~mysql/mysql-server/5.5/view/head:/sql/password.c) + + SERVER: public_seed=create_random_string() + send(public_seed) + + CLIENT: recv(public_seed) + hash_stage1=sha1("password") + hash_stage2=sha1(hash_stage1) + reply=xor(hash_stage1, sha1(public_seed,hash_stage2) + + // this three steps are done in scramble() + + send(reply) + + + SERVER: recv(reply) + hash_stage1=xor(reply, sha1(public_seed,hash_stage2)) + candidate_hash2=sha1(hash_stage1) + check(candidate_hash2==hash_stage2) + +server stores sha1(sha1(password)) ( hash_stag2) +*/ + +const crypto = require('crypto'); + +function sha1(msg, msg1, msg2) { + const hash = crypto.createHash('sha1'); + hash.update(msg); + if (msg1) { + hash.update(msg1); + } + + if (msg2) { + hash.update(msg2); + } + + return hash.digest(); +} + +function xor(a, b) { + const result = Buffer.allocUnsafe(a.length); + for (let i = 0; i < a.length; i++) { + result[i] = a[i] ^ b[i]; + } + return result; +} + +exports.xor = xor; + +function token(password, scramble1, scramble2) { + if (!password) { + return Buffer.alloc(0); + } + const stage1 = sha1(password); + return exports.calculateTokenFromPasswordSha(stage1, scramble1, scramble2); +} + +exports.calculateTokenFromPasswordSha = function ( + passwordSha, + scramble1, + scramble2 +) { + // we use AUTH 41 here, and we need only the bytes we just need. + const authPluginData1 = scramble1.slice(0, 8); + const authPluginData2 = scramble2.slice(0, 12); + const stage2 = sha1(passwordSha); + const stage3 = sha1(authPluginData1, authPluginData2, stage2); + return xor(stage3, passwordSha); +}; + +exports.calculateToken = token; + +exports.verifyToken = function (publicSeed1, publicSeed2, token, doubleSha) { + const hashStage1 = xor(token, sha1(publicSeed1, publicSeed2, doubleSha)); + const candidateHash2 = sha1(hashStage1); + return candidateHash2.compare(doubleSha) === 0; +}; + +exports.doubleSha1 = function (password) { + return sha1(sha1(password)); +}; + +function xorRotating(a, seed) { + const result = Buffer.allocUnsafe(a.length); + const seedLen = seed.length; + + for (let i = 0; i < a.length; i++) { + result[i] = a[i] ^ seed[i % seedLen]; + } + return result; +} +exports.xorRotating = xorRotating; diff --git a/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js b/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js new file mode 100644 index 0000000..7bbeac8 --- /dev/null +++ b/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js @@ -0,0 +1,108 @@ +'use strict'; + +// https://mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_password/ + +const PLUGIN_NAME = 'caching_sha2_password'; +const crypto = require('crypto'); +const { xor, xorRotating } = require('../auth_41'); + +const REQUEST_SERVER_KEY_PACKET = Buffer.from([2]); +const FAST_AUTH_SUCCESS_PACKET = Buffer.from([3]); +const PERFORM_FULL_AUTHENTICATION_PACKET = Buffer.from([4]); + +const STATE_INITIAL = 0; +const STATE_TOKEN_SENT = 1; +const STATE_WAIT_SERVER_KEY = 2; +const STATE_FINAL = -1; + +function sha256(msg) { + const hash = crypto.createHash('sha256'); + hash.update(msg); + return hash.digest(); +} + +function calculateToken(password, scramble) { + if (!password) { + return Buffer.alloc(0); + } + const stage1 = sha256(Buffer.from(password)); + const stage2 = sha256(stage1); + const stage3 = sha256(Buffer.concat([stage2, scramble])); + return xor(stage1, stage3); +} + +function encrypt(password, scramble, key) { + const stage1 = xorRotating(Buffer.from(`${password}\0`, 'utf8'), scramble); + return crypto.publicEncrypt( + { + key, + padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, + }, + stage1 + ); +} + +module.exports = + (pluginOptions = {}) => + ({ connection }) => { + let state = 0; + let scramble = null; + + const password = connection.config.password; + + const authWithKey = (serverKey) => { + const _password = encrypt(password, scramble, serverKey); + state = STATE_FINAL; + return _password; + }; + + return (data) => { + switch (state) { + case STATE_INITIAL: + scramble = data.slice(0, 20); + state = STATE_TOKEN_SENT; + return calculateToken(password, scramble); + + case STATE_TOKEN_SENT: + if (FAST_AUTH_SUCCESS_PACKET.equals(data)) { + state = STATE_FINAL; + return null; + } + + if (PERFORM_FULL_AUTHENTICATION_PACKET.equals(data)) { + const isSecureConnection = + typeof pluginOptions.overrideIsSecure === 'undefined' + ? connection.config.ssl || connection.config.socketPath + : pluginOptions.overrideIsSecure; + if (isSecureConnection) { + state = STATE_FINAL; + return Buffer.from(`${password}\0`, 'utf8'); + } + + // if client provides key we can save one extra roundrip on first connection + if (pluginOptions.serverPublicKey) { + return authWithKey(pluginOptions.serverPublicKey); + } + + state = STATE_WAIT_SERVER_KEY; + return REQUEST_SERVER_KEY_PACKET; + } + throw new Error( + `Invalid AuthMoreData packet received by ${PLUGIN_NAME} plugin in STATE_TOKEN_SENT state.` + ); + case STATE_WAIT_SERVER_KEY: + if (pluginOptions.onServerPublicKey) { + pluginOptions.onServerPublicKey(data); + } + return authWithKey(data); + case STATE_FINAL: + throw new Error( + `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in STATE_FINAL state.` + ); + } + + throw new Error( + `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in state ${state}` + ); + }; + }; diff --git a/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md b/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md new file mode 100644 index 0000000..5d67239 --- /dev/null +++ b/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.md @@ -0,0 +1,18 @@ +## + +https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html + +```js +const mysql = require('mysql'); +mysql.createConnection({ + authPlugins: { + caching_sha2_password: mysql.authPlugins.caching_sha2_password({ + onServerPublikKey: function (key) { + console.log(key); + }, + serverPublicKey: 'xxxyyy', + overrideIsSecure: true, // + }), + }, +}); +``` diff --git a/node_modules/mysql2/lib/auth_plugins/index.js b/node_modules/mysql2/lib/auth_plugins/index.js new file mode 100644 index 0000000..dd4dc98 --- /dev/null +++ b/node_modules/mysql2/lib/auth_plugins/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = { + caching_sha2_password: require('./caching_sha2_password'), + mysql_clear_password: require('./mysql_clear_password'), + mysql_native_password: require('./mysql_native_password'), + sha256_password: require('./sha256_password'), +}; diff --git a/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js b/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js new file mode 100644 index 0000000..1e0e321 --- /dev/null +++ b/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js @@ -0,0 +1,17 @@ +'use strict'; + +function bufferFromStr(str) { + return Buffer.from(`${str}\0`); +} + +const create_mysql_clear_password_plugin = (pluginOptions) => + function mysql_clear_password_plugin({ connection, command }) { + const password = + command.password || pluginOptions.password || connection.config.password; + + return function (/* pluginData */) { + return bufferFromStr(password); + }; + }; + +module.exports = create_mysql_clear_password_plugin; diff --git a/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js b/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js new file mode 100644 index 0000000..b4f4b87 --- /dev/null +++ b/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js @@ -0,0 +1,34 @@ +'use strict'; + +//const PLUGIN_NAME = 'mysql_native_password'; +const auth41 = require('../auth_41.js'); + +module.exports = + (pluginOptions) => + ({ connection, command }) => { + const password = + command.password || pluginOptions.password || connection.config.password; + const passwordSha1 = + command.passwordSha1 || + pluginOptions.passwordSha1 || + connection.config.passwordSha1; + return (data) => { + const authPluginData1 = data.slice(0, 8); + const authPluginData2 = data.slice(8, 20); + let authToken; + if (passwordSha1) { + authToken = auth41.calculateTokenFromPasswordSha( + passwordSha1, + authPluginData1, + authPluginData2 + ); + } else { + authToken = auth41.calculateToken( + password, + authPluginData1, + authPluginData2 + ); + } + return authToken; + }; + }; diff --git a/node_modules/mysql2/lib/auth_plugins/sha256_password.js b/node_modules/mysql2/lib/auth_plugins/sha256_password.js new file mode 100644 index 0000000..4565330 --- /dev/null +++ b/node_modules/mysql2/lib/auth_plugins/sha256_password.js @@ -0,0 +1,59 @@ +'use strict'; + +const PLUGIN_NAME = 'sha256_password'; +const crypto = require('crypto'); +const { xorRotating } = require('../auth_41'); + +const REQUEST_SERVER_KEY_PACKET = Buffer.from([1]); + +const STATE_INITIAL = 0; +const STATE_WAIT_SERVER_KEY = 1; +const STATE_FINAL = -1; + +function encrypt(password, scramble, key) { + const stage1 = xorRotating(Buffer.from(`${password}\0`, 'utf8'), scramble); + return crypto.publicEncrypt(key, stage1); +} + +module.exports = + (pluginOptions = {}) => + ({ connection }) => { + let state = 0; + let scramble = null; + + const password = connection.config.password; + + const authWithKey = (serverKey) => { + const _password = encrypt(password, scramble, serverKey); + state = STATE_FINAL; + return _password; + }; + + return (data) => { + switch (state) { + case STATE_INITIAL: + scramble = data.slice(0, 20); + // if client provides key we can save one extra roundrip on first connection + if (pluginOptions.serverPublicKey) { + return authWithKey(pluginOptions.serverPublicKey); + } + + state = STATE_WAIT_SERVER_KEY; + return REQUEST_SERVER_KEY_PACKET; + + case STATE_WAIT_SERVER_KEY: + if (pluginOptions.onServerPublicKey) { + pluginOptions.onServerPublicKey(data); + } + return authWithKey(data); + case STATE_FINAL: + throw new Error( + `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in STATE_FINAL state.` + ); + } + + throw new Error( + `Unexpected data in AuthMoreData packet received by ${PLUGIN_NAME} plugin in state ${state}` + ); + }; + }; diff --git a/node_modules/mysql2/lib/base/connection.js b/node_modules/mysql2/lib/base/connection.js new file mode 100644 index 0000000..ea91f18 --- /dev/null +++ b/node_modules/mysql2/lib/base/connection.js @@ -0,0 +1,945 @@ +// This file was modified by Oracle on June 1, 2021. +// The changes involve new logic to handle an additional ERR Packet sent by +// the MySQL server when the connection is closed unexpectedly. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +// This file was modified by Oracle on June 17, 2021. +// The changes involve logic to ensure the socket connection is closed when +// there is a fatal error. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +// This file was modified by Oracle on September 21, 2021. +// The changes involve passing additional authentication factor passwords +// to the ChangeUser Command instance. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +const Net = require('net'); +const Tls = require('tls'); +const Timers = require('timers'); +const EventEmitter = require('events').EventEmitter; +const Readable = require('stream').Readable; +const Queue = require('denque'); +const SqlString = require('sqlstring'); +const { createLRU } = require('lru.min'); +const PacketParser = require('../packet_parser.js'); +const Packets = require('../packets/index.js'); +const Commands = require('../commands/index.js'); +const ConnectionConfig = require('../connection_config.js'); +const CharsetToEncoding = require('../constants/charset_encodings.js'); + +let _connectionId = 0; + +let convertNamedPlaceholders = null; + +class BaseConnection extends EventEmitter { + constructor(opts) { + super(); + this.config = opts.config; + // TODO: fill defaults + // if no params, connect to /var/lib/mysql/mysql.sock ( /tmp/mysql.sock on OSX ) + // if host is given, connect to host:3306 + // TODO: use `/usr/local/mysql/bin/mysql_config --socket` output? as default socketPath + // if there is no host/port and no socketPath parameters? + if (!opts.config.stream) { + if (opts.config.socketPath) { + this.stream = Net.connect(opts.config.socketPath); + } else { + this.stream = Net.connect(opts.config.port, opts.config.host); + + // Optionally enable keep-alive on the socket. + if (this.config.enableKeepAlive) { + this.stream.on('connect', () => { + this.stream.setKeepAlive(true, this.config.keepAliveInitialDelay); + }); + } + + // Enable TCP_NODELAY flag. This is needed so that the network packets + // are sent immediately to the server + this.stream.setNoDelay(true); + } + // if stream is a function, treat it as "stream agent / factory" + } else if (typeof opts.config.stream === 'function') { + this.stream = opts.config.stream(opts); + } else { + this.stream = opts.config.stream; + } + + this._internalId = _connectionId++; + this._commands = new Queue(); + this._command = null; + this._paused = false; + this._paused_packets = new Queue(); + this._statements = createLRU({ + max: this.config.maxPreparedStatements, + onEviction: function (_, statement) { + statement.close(); + }, + }); + this.serverCapabilityFlags = 0; + this.authorized = false; + this.sequenceId = 0; + this.compressedSequenceId = 0; + this.threadId = null; + this._handshakePacket = null; + this._fatalError = null; + this._protocolError = null; + this._outOfOrderPackets = []; + this.clientEncoding = CharsetToEncoding[this.config.charsetNumber]; + this.stream.on('error', this._handleNetworkError.bind(this)); + // see https://gist.github.com/khoomeister/4985691#use-that-instead-of-bind + this.packetParser = new PacketParser((p) => { + this.handlePacket(p); + }); + this.stream.on('data', (data) => { + if (this.connectTimeout) { + Timers.clearTimeout(this.connectTimeout); + this.connectTimeout = null; + } + this.packetParser.execute(data); + }); + this.stream.on('end', () => { + // emit the end event so that the pooled connection can close the connection + this.emit('end'); + }); + this.stream.on('close', () => { + // we need to set this flag everywhere where we want connection to close + if (this._closing) { + return; + } + if (!this._protocolError) { + // no particular error message before disconnect + this._protocolError = new Error( + 'Connection lost: The server closed the connection.' + ); + this._protocolError.fatal = true; + this._protocolError.code = 'PROTOCOL_CONNECTION_LOST'; + } + this._notifyError(this._protocolError); + }); + let handshakeCommand; + if (!this.config.isServer) { + handshakeCommand = new Commands.ClientHandshake(this.config.clientFlags); + handshakeCommand.on('end', () => { + // this happens when handshake finishes early either because there was + // some fatal error or the server sent an error packet instead of + // an hello packet (for example, 'Too many connections' error) + if ( + !handshakeCommand.handshake || + this._fatalError || + this._protocolError + ) { + return; + } + this._handshakePacket = handshakeCommand.handshake; + this.threadId = handshakeCommand.handshake.connectionId; + this.emit('connect', handshakeCommand.handshake); + }); + handshakeCommand.on('error', (err) => { + this._closing = true; + this._notifyError(err); + }); + this.addCommand(handshakeCommand); + } + // in case there was no initial handshake but we need to read sting, assume it utf-8 + // most common example: "Too many connections" error ( packet is sent immediately on connection attempt, we don't know server encoding yet) + // will be overwritten with actual encoding value as soon as server handshake packet is received + this.serverEncoding = 'utf8'; + if (this.config.connectTimeout) { + const timeoutHandler = this._handleTimeoutError.bind(this); + this.connectTimeout = Timers.setTimeout( + timeoutHandler, + this.config.connectTimeout + ); + } + } + + _addCommandClosedState(cmd) { + const err = new Error( + "Can't add new command when connection is in closed state" + ); + err.fatal = true; + if (cmd.onResult) { + cmd.onResult(err); + } else { + this.emit('error', err); + } + } + + _handleFatalError(err) { + err.fatal = true; + // stop receiving packets + this.stream.removeAllListeners('data'); + this.addCommand = this._addCommandClosedState; + this.write = () => { + this.emit('error', new Error("Can't write in closed state")); + }; + this._notifyError(err); + this._fatalError = err; + } + + _handleNetworkError(err) { + if (this.connectTimeout) { + Timers.clearTimeout(this.connectTimeout); + this.connectTimeout = null; + } + // Do not throw an error when a connection ends with a RST,ACK packet + if (err.code === 'ECONNRESET' && this._closing) { + return; + } + this._handleFatalError(err); + } + + _handleTimeoutError() { + if (this.connectTimeout) { + Timers.clearTimeout(this.connectTimeout); + this.connectTimeout = null; + } + this.stream.destroy && this.stream.destroy(); + const err = new Error('connect ETIMEDOUT'); + err.errorno = 'ETIMEDOUT'; + err.code = 'ETIMEDOUT'; + err.syscall = 'connect'; + this._handleNetworkError(err); + } + + // notify all commands in the queue and bubble error as connection "error" + // called on stream error or unexpected termination + _notifyError(err) { + if (this.connectTimeout) { + Timers.clearTimeout(this.connectTimeout); + this.connectTimeout = null; + } + // prevent from emitting 'PROTOCOL_CONNECTION_LOST' after EPIPE or ECONNRESET + if (this._fatalError) { + return; + } + let command; + // if there is no active command, notify connection + // if there are commands and all of them have callbacks, pass error via callback + let bubbleErrorToConnection = !this._command; + if (this._command && this._command.onResult) { + this._command.onResult(err); + this._command = null; + // connection handshake is special because we allow it to be implicit + // if error happened during handshake, but there are others commands in queue + // then bubble error to other commands and not to connection + } else if ( + !( + this._command && + this._command.constructor === Commands.ClientHandshake && + this._commands.length > 0 + ) + ) { + bubbleErrorToConnection = true; + } + while ((command = this._commands.shift())) { + if (command.onResult) { + command.onResult(err); + } else { + bubbleErrorToConnection = true; + } + } + // notify connection if some comands in the queue did not have callbacks + // or if this is pool connection ( so it can be removed from pool ) + if (bubbleErrorToConnection || this._pool) { + this.emit('error', err); + } + // close connection after emitting the event in case of a fatal error + if (err.fatal) { + this.close(); + } + } + + write(buffer) { + const result = this.stream.write(buffer, (err) => { + if (err) { + this._handleNetworkError(err); + } + }); + + if (!result) { + this.stream.emit('pause'); + } + } + + // http://dev.mysql.com/doc/internals/en/sequence-id.html + // + // The sequence-id is incremented with each packet and may wrap around. + // It starts at 0 and is reset to 0 when a new command + // begins in the Command Phase. + // http://dev.mysql.com/doc/internals/en/example-several-mysql-packets.html + _resetSequenceId() { + this.sequenceId = 0; + this.compressedSequenceId = 0; + } + + _bumpCompressedSequenceId(numPackets) { + this.compressedSequenceId += numPackets; + this.compressedSequenceId %= 256; + } + + _bumpSequenceId(numPackets) { + this.sequenceId += numPackets; + this.sequenceId %= 256; + } + + writePacket(packet) { + const MAX_PACKET_LENGTH = 16777215; + const length = packet.length(); + let chunk, offset, header; + if (length < MAX_PACKET_LENGTH) { + packet.writeHeader(this.sequenceId); + if (this.config.debug) { + console.log( + `${this._internalId} ${this.connectionId} <== ${this._command._commandName}#${this._command.stateName()}(${[this.sequenceId, packet._name, packet.length()].join(',')})` + ); + console.log( + `${this._internalId} ${this.connectionId} <== ${packet.buffer.toString('hex')}` + ); + } + this._bumpSequenceId(1); + this.write(packet.buffer); + } else { + if (this.config.debug) { + console.log( + `${this._internalId} ${this.connectionId} <== Writing large packet, raw content not written:` + ); + console.log( + `${this._internalId} ${this.connectionId} <== ${this._command._commandName}#${this._command.stateName()}(${[this.sequenceId, packet._name, packet.length()].join(',')})` + ); + } + for (offset = 4; offset < 4 + length; offset += MAX_PACKET_LENGTH) { + chunk = packet.buffer.slice(offset, offset + MAX_PACKET_LENGTH); + if (chunk.length === MAX_PACKET_LENGTH) { + header = Buffer.from([0xff, 0xff, 0xff, this.sequenceId]); + } else { + header = Buffer.from([ + chunk.length & 0xff, + (chunk.length >> 8) & 0xff, + (chunk.length >> 16) & 0xff, + this.sequenceId, + ]); + } + this._bumpSequenceId(1); + this.write(header); + this.write(chunk); + } + } + } + + // 0.11+ environment + startTLS(onSecure) { + if (this.config.debug) { + console.log('Upgrading connection to TLS'); + } + const secureContext = Tls.createSecureContext({ + ca: this.config.ssl.ca, + cert: this.config.ssl.cert, + ciphers: this.config.ssl.ciphers, + key: this.config.ssl.key, + passphrase: this.config.ssl.passphrase, + minVersion: this.config.ssl.minVersion, + maxVersion: this.config.ssl.maxVersion, + }); + const rejectUnauthorized = this.config.ssl.rejectUnauthorized; + const verifyIdentity = this.config.ssl.verifyIdentity; + const servername = this.config.host; + + let secureEstablished = false; + this.stream.removeAllListeners('data'); + const secureSocket = Tls.connect( + { + rejectUnauthorized, + requestCert: rejectUnauthorized, + checkServerIdentity: verifyIdentity + ? Tls.checkServerIdentity + : function () { + return undefined; + }, + secureContext, + isServer: false, + socket: this.stream, + servername, + }, + () => { + secureEstablished = true; + if (rejectUnauthorized) { + if (typeof servername === 'string' && verifyIdentity) { + const cert = secureSocket.getPeerCertificate(true); + const serverIdentityCheckError = Tls.checkServerIdentity( + servername, + cert + ); + if (serverIdentityCheckError) { + onSecure(serverIdentityCheckError); + return; + } + } + } + onSecure(); + } + ); + // error handler for secure socket + secureSocket.on('error', (err) => { + if (secureEstablished) { + this._handleNetworkError(err); + } else { + onSecure(err); + } + }); + secureSocket.on('data', (data) => { + this.packetParser.execute(data); + }); + this.write = (buffer) => secureSocket.write(buffer); + } + + protocolError(message, code) { + // Starting with MySQL 8.0.24, if the client closes the connection + // unexpectedly, the server will send a last ERR Packet, which we can + // safely ignore. + // https://dev.mysql.com/worklog/task/?id=12999 + if (this._closing) { + return; + } + + const err = new Error(message); + err.fatal = true; + err.code = code || 'PROTOCOL_ERROR'; + this.emit('error', err); + } + + get fatalError() { + return this._fatalError; + } + + handlePacket(packet) { + if (this._paused) { + this._paused_packets.push(packet); + return; + } + if (this.config.debug) { + if (packet) { + console.log( + ` raw: ${packet.buffer + .slice(packet.offset, packet.offset + packet.length()) + .toString('hex')}` + ); + console.trace(); + const commandName = this._command + ? this._command._commandName + : '(no command)'; + const stateName = this._command + ? this._command.stateName() + : '(no command)'; + console.log( + `${this._internalId} ${this.connectionId} ==> ${commandName}#${stateName}(${[packet.sequenceId, packet.type(), packet.length()].join(',')})` + ); + } + } + if (!this._command) { + const marker = packet.peekByte(); + // If it's an Err Packet, we should use it. + if (marker === 0xff) { + const error = Packets.Error.fromPacket(packet); + this.protocolError(error.message, error.code); + } else { + // Otherwise, it means it's some other unexpected packet. + this.protocolError( + 'Unexpected packet while no commands in the queue', + 'PROTOCOL_UNEXPECTED_PACKET' + ); + } + this.close(); + return; + } + if (packet) { + // Note: when server closes connection due to inactivity, Err packet ER_CLIENT_INTERACTION_TIMEOUT from MySQL 8.0.24, sequenceId will be 0 + if (this.sequenceId !== packet.sequenceId) { + const err = new Error( + `Warning: got packets out of order. Expected ${this.sequenceId} but received ${packet.sequenceId}` + ); + err.expected = this.sequenceId; + err.received = packet.sequenceId; + this.emit('warn', err); // REVIEW + console.error(err.message); + } + this._bumpSequenceId(packet.numPackets); + } + try { + if (this._fatalError) { + // skip remaining packets after client is in the error state + return; + } + const done = this._command.execute(packet, this); + if (done) { + this._command = this._commands.shift(); + if (this._command) { + this.sequenceId = 0; + this.compressedSequenceId = 0; + this.handlePacket(); + } + } + } catch (err) { + this._handleFatalError(err); + this.stream.destroy(); + } + } + + addCommand(cmd) { + // this.compressedSequenceId = 0; + // this.sequenceId = 0; + if (this.config.debug) { + const commandName = cmd.constructor.name; + console.log(`Add command: ${commandName}`); + cmd._commandName = commandName; + } + if (!this._command) { + this._command = cmd; + this.handlePacket(); + } else { + this._commands.push(cmd); + } + return cmd; + } + + format(sql, values) { + if (typeof this.config.queryFormat === 'function') { + return this.config.queryFormat.call( + this, + sql, + values, + this.config.timezone + ); + } + const opts = { + sql: sql, + values: values, + }; + this._resolveNamedPlaceholders(opts); + return SqlString.format( + opts.sql, + opts.values, + this.config.stringifyObjects, + this.config.timezone + ); + } + + escape(value) { + return SqlString.escape(value, false, this.config.timezone); + } + + escapeId(value) { + return SqlString.escapeId(value, false); + } + + raw(sql) { + return SqlString.raw(sql); + } + + _resolveNamedPlaceholders(options) { + let unnamed; + if (this.config.namedPlaceholders || options.namedPlaceholders) { + if (Array.isArray(options.values)) { + // if an array is provided as the values, assume the conversion is not necessary. + // this allows the usage of unnamed placeholders even if the namedPlaceholders flag is enabled. + return; + } + if (convertNamedPlaceholders === null) { + convertNamedPlaceholders = require('named-placeholders')(); + } + unnamed = convertNamedPlaceholders(options.sql, options.values); + options.sql = unnamed[0]; + options.values = unnamed[1]; + } + } + + query(sql, values, cb) { + let cmdQuery; + if (sql.constructor === Commands.Query) { + cmdQuery = sql; + } else { + cmdQuery = BaseConnection.createQuery(sql, values, cb, this.config); + } + this._resolveNamedPlaceholders(cmdQuery); + const rawSql = this.format( + cmdQuery.sql, + cmdQuery.values !== undefined ? cmdQuery.values : [] + ); + cmdQuery.sql = rawSql; + return this.addCommand(cmdQuery); + } + + pause() { + this._paused = true; + this.stream.pause(); + } + + resume() { + let packet; + this._paused = false; + while ((packet = this._paused_packets.shift())) { + this.handlePacket(packet); + // don't resume if packet handler paused connection + if (this._paused) { + return; + } + } + this.stream.resume(); + } + + // TODO: named placeholders support + prepare(options, cb) { + if (typeof options === 'string') { + options = { sql: options }; + } + return this.addCommand(new Commands.Prepare(options, cb)); + } + + unprepare(sql) { + let options = {}; + if (typeof sql === 'object') { + options = sql; + } else { + options.sql = sql; + } + const key = BaseConnection.statementKey(options); + const stmt = this._statements.get(key); + if (stmt) { + this._statements.delete(key); + stmt.close(); + } + return stmt; + } + + execute(sql, values, cb) { + let options = { + infileStreamFactory: this.config.infileStreamFactory, + }; + if (typeof sql === 'object') { + // execute(options, cb) + options = { + ...options, + ...sql, + sql: sql.sql, + values: sql.values, + }; + if (typeof values === 'function') { + cb = values; + } else { + options.values = options.values || values; + } + } else if (typeof values === 'function') { + // execute(sql, cb) + cb = values; + options.sql = sql; + options.values = undefined; + } else { + // execute(sql, values, cb) + options.sql = sql; + options.values = values; + } + this._resolveNamedPlaceholders(options); + // check for values containing undefined + if (options.values) { + //If namedPlaceholder is not enabled and object is passed as bind parameters + if (!Array.isArray(options.values)) { + throw new TypeError( + 'Bind parameters must be array if namedPlaceholders parameter is not enabled' + ); + } + options.values.forEach((val) => { + //If namedPlaceholder is not enabled and object is passed as bind parameters + if (!Array.isArray(options.values)) { + throw new TypeError( + 'Bind parameters must be array if namedPlaceholders parameter is not enabled' + ); + } + if (val === undefined) { + throw new TypeError( + 'Bind parameters must not contain undefined. To pass SQL NULL specify JS null' + ); + } + if (typeof val === 'function') { + throw new TypeError( + 'Bind parameters must not contain function(s). To pass the body of a function as a string call .toString() first' + ); + } + }); + } + const executeCommand = new Commands.Execute(options, cb); + const prepareCommand = new Commands.Prepare(options, (err, stmt) => { + if (err) { + // skip execute command if prepare failed, we have main + // combined callback here + executeCommand.start = function () { + return null; + }; + if (cb) { + cb(err); + } else { + executeCommand.emit('error', err); + } + executeCommand.emit('end'); + return; + } + executeCommand.statement = stmt; + }); + this.addCommand(prepareCommand); + this.addCommand(executeCommand); + return executeCommand; + } + + changeUser(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + const charsetNumber = options.charset + ? ConnectionConfig.getCharsetNumber(options.charset) + : this.config.charsetNumber; + return this.addCommand( + new Commands.ChangeUser( + { + user: options.user || this.config.user, + // for the purpose of multi-factor authentication, or not, the main + // password (used for the 1st authentication factor) can also be + // provided via the "password1" option + password: + options.password || + options.password1 || + this.config.password || + this.config.password1, + password2: options.password2 || this.config.password2, + password3: options.password3 || this.config.password3, + passwordSha1: options.passwordSha1 || this.config.passwordSha1, + database: options.database || this.config.database, + timeout: options.timeout, + charsetNumber: charsetNumber, + currentConfig: this.config, + }, + (err) => { + if (err) { + err.fatal = true; + } + if (callback) { + callback(err); + } + } + ) + ); + } + + // transaction helpers + beginTransaction(cb) { + return this.query('START TRANSACTION', cb); + } + + commit(cb) { + return this.query('COMMIT', cb); + } + + rollback(cb) { + return this.query('ROLLBACK', cb); + } + + ping(cb) { + return this.addCommand(new Commands.Ping(cb)); + } + + _registerSlave(opts, cb) { + return this.addCommand(new Commands.RegisterSlave(opts, cb)); + } + + _binlogDump(opts, cb) { + return this.addCommand(new Commands.BinlogDump(opts, cb)); + } + + // currently just alias to close + destroy() { + this.close(); + } + + close() { + if (this.connectTimeout) { + Timers.clearTimeout(this.connectTimeout); + this.connectTimeout = null; + } + this._closing = true; + this.stream.end(); + this.addCommand = this._addCommandClosedState; + } + + createBinlogStream(opts) { + // TODO: create proper stream class + // TODO: use through2 + let test = 1; + const stream = new Readable({ objectMode: true }); + stream._read = function () { + return { + data: test++, + }; + }; + this._registerSlave(opts, () => { + const dumpCmd = this._binlogDump(opts); + dumpCmd.on('event', (ev) => { + stream.push(ev); + }); + dumpCmd.on('eof', () => { + stream.push(null); + // if non-blocking, then close stream to prevent errors + if (opts.flags && opts.flags & 0x01) { + this.close(); + } + }); + // TODO: pipe errors as well + }); + return stream; + } + + connect(cb) { + if (!cb) { + return; + } + if (this._fatalError || this._protocolError) { + return cb(this._fatalError || this._protocolError); + } + if (this._handshakePacket) { + return cb(null, this); + } + let connectCalled = 0; + function callbackOnce(isErrorHandler) { + return function (param) { + if (!connectCalled) { + if (isErrorHandler) { + cb(param); + } else { + cb(null, param); + } + } + connectCalled = 1; + }; + } + this.once('error', callbackOnce(true)); + this.once('connect', callbackOnce(false)); + } + + // =================================== + // outgoing server connection methods + // =================================== + writeColumns(columns) { + this.writePacket(Packets.ResultSetHeader.toPacket(columns.length)); + columns.forEach((column) => { + this.writePacket( + Packets.ColumnDefinition.toPacket(column, this.serverConfig.encoding) + ); + }); + this.writeEof(); + } + + // row is array of columns, not hash + writeTextRow(column) { + this.writePacket( + Packets.TextRow.toPacket(column, this.serverConfig.encoding) + ); + } + + writeBinaryRow(column) { + this.writePacket( + Packets.BinaryRow.toPacket(column, this.serverConfig.encoding) + ); + } + + writeTextResult(rows, columns, binary = false) { + this.writeColumns(columns); + rows.forEach((row) => { + const arrayRow = new Array(columns.length); + columns.forEach((column) => { + arrayRow.push(row[column.name]); + }); + if (binary) { + this.writeBinaryRow(arrayRow); + } else this.writeTextRow(arrayRow); + }); + this.writeEof(); + } + + writeEof(warnings, statusFlags) { + this.writePacket(Packets.EOF.toPacket(warnings, statusFlags)); + } + + writeOk(args) { + if (!args) { + args = { affectedRows: 0 }; + } + this.writePacket(Packets.OK.toPacket(args, this.serverConfig.encoding)); + } + + writeError(args) { + // if we want to send error before initial hello was sent, use default encoding + const encoding = this.serverConfig ? this.serverConfig.encoding : 'cesu8'; + this.writePacket(Packets.Error.toPacket(args, encoding)); + } + + serverHandshake(args) { + this.serverConfig = args; + this.serverConfig.encoding = + CharsetToEncoding[this.serverConfig.characterSet]; + return this.addCommand(new Commands.ServerHandshake(args)); + } + + // =============================================================== + end(callback) { + if (this.config.isServer) { + this._closing = true; + const quitCmd = new EventEmitter(); + setImmediate(() => { + this.stream.end(); + quitCmd.emit('end'); + }); + return quitCmd; + } + // trigger error if more commands enqueued after end command + const quitCmd = this.addCommand(new Commands.Quit(callback)); + this.addCommand = this._addCommandClosedState; + return quitCmd; + } + + static createQuery(sql, values, cb, config) { + let options = { + rowsAsArray: config.rowsAsArray, + infileStreamFactory: config.infileStreamFactory, + }; + if (typeof sql === 'object') { + // query(options, cb) + options = { + ...options, + ...sql, + sql: sql.sql, + values: sql.values, + }; + if (typeof values === 'function') { + cb = values; + } else if (values !== undefined) { + options.values = values; + } + } else if (typeof values === 'function') { + // query(sql, cb) + cb = values; + options.sql = sql; + options.values = undefined; + } else { + // query(sql, values, cb) + options.sql = sql; + options.values = values; + } + return new Commands.Query(options, cb); + } + + static statementKey(options) { + return `${typeof options.nestTables}/${options.nestTables}/${options.rowsAsArray}${options.sql}`; + } +} + +module.exports = BaseConnection; diff --git a/node_modules/mysql2/lib/base/pool.js b/node_modules/mysql2/lib/base/pool.js new file mode 100644 index 0000000..fbcfd68 --- /dev/null +++ b/node_modules/mysql2/lib/base/pool.js @@ -0,0 +1,233 @@ +'use strict'; + +const process = require('process'); +const SqlString = require('sqlstring'); +const EventEmitter = require('events').EventEmitter; +const PoolConnection = require('../pool_connection.js'); +const Queue = require('denque'); +const BaseConnection = require('./connection.js'); + +function spliceConnection(queue, connection) { + const len = queue.length; + for (let i = 0; i < len; i++) { + if (queue.get(i) === connection) { + queue.removeOne(i); + break; + } + } +} + +class BasePool extends EventEmitter { + constructor(options) { + super(); + this.config = options.config; + this.config.connectionConfig.pool = this; + this._allConnections = new Queue(); + this._freeConnections = new Queue(); + this._connectionQueue = new Queue(); + this._closed = false; + if (this.config.maxIdle < this.config.connectionLimit) { + // create idle connection timeout automatically release job + this._removeIdleTimeoutConnections(); + } + } + + getConnection(cb) { + if (this._closed) { + return process.nextTick(() => cb(new Error('Pool is closed.'))); + } + let connection; + if (this._freeConnections.length > 0) { + connection = this._freeConnections.pop(); + this.emit('acquire', connection); + return process.nextTick(() => cb(null, connection)); + } + if ( + this.config.connectionLimit === 0 || + this._allConnections.length < this.config.connectionLimit + ) { + connection = new PoolConnection(this, { + config: this.config.connectionConfig, + }); + this._allConnections.push(connection); + return connection.connect((err) => { + if (this._closed) { + return cb(new Error('Pool is closed.')); + } + if (err) { + return cb(err); + } + this.emit('connection', connection); + this.emit('acquire', connection); + return cb(null, connection); + }); + } + if (!this.config.waitForConnections) { + return process.nextTick(() => cb(new Error('No connections available.'))); + } + if ( + this.config.queueLimit && + this._connectionQueue.length >= this.config.queueLimit + ) { + return cb(new Error('Queue limit reached.')); + } + this.emit('enqueue'); + return this._connectionQueue.push(cb); + } + + releaseConnection(connection) { + let cb; + if (!connection._pool) { + // The connection has been removed from the pool and is no longer good. + if (this._connectionQueue.length) { + cb = this._connectionQueue.shift(); + process.nextTick(this.getConnection.bind(this, cb)); + } + } else if (this._connectionQueue.length) { + cb = this._connectionQueue.shift(); + process.nextTick(cb.bind(null, null, connection)); + } else { + this._freeConnections.push(connection); + this.emit('release', connection); + } + } + + end(cb) { + this._closed = true; + clearTimeout(this._removeIdleTimeoutConnectionsTimer); + if (typeof cb !== 'function') { + cb = function (err) { + if (err) { + throw err; + } + }; + } + let calledBack = false; + let closedConnections = 0; + let connection; + const endCB = function (err) { + if (calledBack) { + return; + } + if (err || ++closedConnections >= this._allConnections.length) { + calledBack = true; + cb(err); + return; + } + }.bind(this); + if (this._allConnections.length === 0) { + endCB(); + return; + } + for (let i = 0; i < this._allConnections.length; i++) { + connection = this._allConnections.get(i); + connection._realEnd(endCB); + } + } + + query(sql, values, cb) { + const cmdQuery = BaseConnection.createQuery( + sql, + values, + cb, + this.config.connectionConfig + ); + if (typeof cmdQuery.namedPlaceholders === 'undefined') { + cmdQuery.namedPlaceholders = + this.config.connectionConfig.namedPlaceholders; + } + this.getConnection((err, conn) => { + if (err) { + if (typeof cmdQuery.onResult === 'function') { + cmdQuery.onResult(err); + } else { + cmdQuery.emit('error', err); + } + return; + } + try { + conn.query(cmdQuery).once('end', () => { + conn.release(); + }); + } catch (e) { + conn.release(); + throw e; + } + }); + return cmdQuery; + } + + execute(sql, values, cb) { + // TODO construct execute command first here and pass it to connection.execute + // so that polymorphic arguments logic is there in one place + if (typeof values === 'function') { + cb = values; + values = []; + } + this.getConnection((err, conn) => { + if (err) { + return cb(err); + } + try { + conn.execute(sql, values, cb).once('end', () => { + conn.release(); + }); + } catch (e) { + conn.release(); + return cb(e); + } + }); + } + + _removeConnection(connection) { + // Remove connection from all connections + spliceConnection(this._allConnections, connection); + // Remove connection from free connections + spliceConnection(this._freeConnections, connection); + this.releaseConnection(connection); + } + + _removeIdleTimeoutConnections() { + if (this._removeIdleTimeoutConnectionsTimer) { + clearTimeout(this._removeIdleTimeoutConnectionsTimer); + } + + this._removeIdleTimeoutConnectionsTimer = setTimeout(() => { + try { + 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).destroy(); + } + } finally { + this._removeIdleTimeoutConnections(); + } + }, 1000); + } + + format(sql, values) { + return SqlString.format( + sql, + values, + this.config.connectionConfig.stringifyObjects, + this.config.connectionConfig.timezone + ); + } + + escape(value) { + return SqlString.escape( + value, + this.config.connectionConfig.stringifyObjects, + this.config.connectionConfig.timezone + ); + } + + escapeId(value) { + return SqlString.escapeId(value, false); + } +} + +module.exports = BasePool; diff --git a/node_modules/mysql2/lib/base/pool_connection.js b/node_modules/mysql2/lib/base/pool_connection.js new file mode 100644 index 0000000..9413b70 --- /dev/null +++ b/node_modules/mysql2/lib/base/pool_connection.js @@ -0,0 +1,63 @@ +'use strict'; + +const BaseConnection = require('./connection.js'); + +class BasePoolConnection extends BaseConnection { + constructor(pool, options) { + super(options); + this._pool = pool; + // The last active time of this connection + this.lastActiveTime = Date.now(); + // When a fatal error occurs the connection's protocol ends, which will cause + // the connection to end as well, thus we only need to watch for the end event + // and we will be notified of disconnects. + // REVIEW: Moved to `once` + this.once('end', () => { + this._removeFromPool(); + }); + this.once('error', () => { + this._removeFromPool(); + }); + } + + release() { + if (!this._pool || this._pool._closed) { + return; + } + // update last active time + this.lastActiveTime = Date.now(); + this._pool.releaseConnection(this); + } + + end() { + const err = 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.' + ); + this.emit('warn', err); + console.warn(err.message); + this.release(); + } + + destroy() { + this._removeFromPool(); + super.destroy(); + } + + _removeFromPool() { + if (!this._pool || this._pool._closed) { + return; + } + const pool = this._pool; + this._pool = null; + pool._removeConnection(this); + } +} + +BasePoolConnection.statementKey = BaseConnection.statementKey; +module.exports = BasePoolConnection; + +// TODO: Remove this when we are removing PoolConnection#end +BasePoolConnection.prototype._realEnd = BaseConnection.prototype.end; diff --git a/node_modules/mysql2/lib/commands/auth_switch.js b/node_modules/mysql2/lib/commands/auth_switch.js new file mode 100644 index 0000000..ff45d03 --- /dev/null +++ b/node_modules/mysql2/lib/commands/auth_switch.js @@ -0,0 +1,111 @@ +// This file was modified by Oracle on July 5, 2021. +// Errors generated by asynchronous authentication plugins are now being +// handled and subsequently emitted at the command level. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +const Packets = require('../packets/index.js'); +const sha256_password = require('../auth_plugins/sha256_password'); +const caching_sha2_password = require('../auth_plugins/caching_sha2_password.js'); +const mysql_native_password = require('../auth_plugins/mysql_native_password.js'); +const mysql_clear_password = require('../auth_plugins/mysql_clear_password.js'); + +const standardAuthPlugins = { + sha256_password: sha256_password({}), + caching_sha2_password: caching_sha2_password({}), + mysql_native_password: mysql_native_password({}), + mysql_clear_password: mysql_clear_password({}), +}; + +function warnLegacyAuthSwitch() { + console.warn( + 'WARNING! authSwitchHandler api is deprecated, please use new authPlugins api' + ); +} + +function authSwitchPluginError(error, command) { + // Authentication errors are fatal + error.code = 'AUTH_SWITCH_PLUGIN_ERROR'; + error.fatal = true; + + command.emit('error', error); +} + +function authSwitchRequest(packet, connection, command) { + const { pluginName, pluginData } = + Packets.AuthSwitchRequest.fromPacket(packet); + let authPlugin = + connection.config.authPlugins && connection.config.authPlugins[pluginName]; + + // legacy plugin api don't allow to override mysql_native_password + // if pluginName is mysql_native_password it's using standard auth4.1 auth + if ( + connection.config.authSwitchHandler && + pluginName !== 'mysql_native_password' + ) { + const legacySwitchHandler = connection.config.authSwitchHandler; + warnLegacyAuthSwitch(); + legacySwitchHandler({ pluginName, pluginData }, (err, data) => { + if (err) { + return authSwitchPluginError(err, command); + } + connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket()); + }); + return; + } + if (!authPlugin) { + authPlugin = standardAuthPlugins[pluginName]; + } + 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.` + ); + } + connection._authPlugin = authPlugin({ connection, command }); + Promise.resolve(connection._authPlugin(pluginData)) + .then((data) => { + if (data) { + connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket()); + } + }) + .catch((err) => { + authSwitchPluginError(err, command); + }); +} + +function authSwitchRequestMoreData(packet, connection, command) { + const { data } = Packets.AuthSwitchRequestMoreData.fromPacket(packet); + + if (connection.config.authSwitchHandler) { + const legacySwitchHandler = connection.config.authSwitchHandler; + warnLegacyAuthSwitch(); + legacySwitchHandler({ pluginData: data }, (err, data) => { + if (err) { + return authSwitchPluginError(err, command); + } + connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket()); + }); + return; + } + + if (!connection._authPlugin) { + throw new Error( + 'AuthPluginMoreData received but no auth plugin instance found' + ); + } + Promise.resolve(connection._authPlugin(data)) + .then((data) => { + if (data) { + connection.writePacket(new Packets.AuthSwitchResponse(data).toPacket()); + } + }) + .catch((err) => { + authSwitchPluginError(err, command); + }); +} + +module.exports = { + authSwitchRequest, + authSwitchRequestMoreData, +}; diff --git a/node_modules/mysql2/lib/commands/binlog_dump.js b/node_modules/mysql2/lib/commands/binlog_dump.js new file mode 100644 index 0000000..63e4960 --- /dev/null +++ b/node_modules/mysql2/lib/commands/binlog_dump.js @@ -0,0 +1,109 @@ +'use strict'; + +const Command = require('./command'); +const Packets = require('../packets'); + +const eventParsers = []; + +class BinlogEventHeader { + constructor(packet) { + this.timestamp = packet.readInt32(); + this.eventType = packet.readInt8(); + this.serverId = packet.readInt32(); + this.eventSize = packet.readInt32(); + this.logPos = packet.readInt32(); + this.flags = packet.readInt16(); + } +} + +class BinlogDump extends Command { + constructor(opts) { + super(); + // this.onResult = callback; + this.opts = opts; + } + + start(packet, connection) { + const newPacket = new Packets.BinlogDump(this.opts); + connection.writePacket(newPacket.toPacket(1)); + return BinlogDump.prototype.binlogData; + } + + binlogData(packet) { + // ok - continue consuming events + // error - error + // eof - end of binlog + if (packet.isEOF()) { + this.emit('eof'); + return null; + } + // binlog event header + packet.readInt8(); + const header = new BinlogEventHeader(packet); + const EventParser = eventParsers[header.eventType]; + let event; + if (EventParser) { + event = new EventParser(packet); + } else { + event = { + name: 'UNKNOWN', + }; + } + event.header = header; + this.emit('event', event); + return BinlogDump.prototype.binlogData; + } +} + +class RotateEvent { + constructor(packet) { + this.pposition = packet.readInt32(); + // TODO: read uint64 here + packet.readInt32(); // positionDword2 + this.nextBinlog = packet.readString(); + this.name = 'RotateEvent'; + } +} + +class FormatDescriptionEvent { + constructor(packet) { + this.binlogVersion = packet.readInt16(); + this.serverVersion = packet.readString(50).replace(/\u0000.*/, ''); // eslint-disable-line no-control-regex + this.createTimestamp = packet.readInt32(); + this.eventHeaderLength = packet.readInt8(); // should be 19 + this.eventsLength = packet.readBuffer(); + this.name = 'FormatDescriptionEvent'; + } +} + +class QueryEvent { + constructor(packet) { + const parseStatusVars = require('../packets/binlog_query_statusvars.js'); + this.slaveProxyId = packet.readInt32(); + this.executionTime = packet.readInt32(); + const schemaLength = packet.readInt8(); + this.errorCode = packet.readInt16(); + const statusVarsLength = packet.readInt16(); + const statusVars = packet.readBuffer(statusVarsLength); + this.schema = packet.readString(schemaLength); + packet.readInt8(); // should be zero + this.statusVars = parseStatusVars(statusVars); + this.query = packet.readString(); + this.name = 'QueryEvent'; + } +} + +class XidEvent { + constructor(packet) { + this.binlogVersion = packet.readInt16(); + this.xid = packet.readInt64(); + this.name = 'XidEvent'; + } +} + +eventParsers[2] = QueryEvent; +eventParsers[4] = RotateEvent; +eventParsers[15] = FormatDescriptionEvent; +eventParsers[16] = XidEvent; + +module.exports = BinlogDump; diff --git a/node_modules/mysql2/lib/commands/change_user.js b/node_modules/mysql2/lib/commands/change_user.js new file mode 100644 index 0000000..d9a7de4 --- /dev/null +++ b/node_modules/mysql2/lib/commands/change_user.js @@ -0,0 +1,68 @@ +// This file was modified by Oracle on September 21, 2021. +// The changes involve saving additional authentication factor passwords +// in the command scope and enabling multi-factor authentication in the +// client-side when the server supports it. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +const Command = require('./command.js'); +const Packets = require('../packets/index.js'); +const ClientConstants = require('../constants/client'); +const ClientHandshake = require('./client_handshake.js'); +const CharsetToEncoding = require('../constants/charset_encodings.js'); + +class ChangeUser extends Command { + constructor(options, callback) { + super(); + this.onResult = callback; + this.user = options.user; + this.password = options.password; + // "password1" is an alias of "password" + this.password1 = options.password; + this.password2 = options.password2; + this.password3 = options.password3; + this.database = options.database; + this.passwordSha1 = options.passwordSha1; + this.charsetNumber = options.charsetNumber; + this.currentConfig = options.currentConfig; + this.authenticationFactor = 0; + } + start(packet, connection) { + const newPacket = new Packets.ChangeUser({ + flags: connection.config.clientFlags, + user: this.user, + database: this.database, + charsetNumber: this.charsetNumber, + password: this.password, + passwordSha1: this.passwordSha1, + authPluginData1: connection._handshakePacket.authPluginData1, + authPluginData2: connection._handshakePacket.authPluginData2, + }); + this.currentConfig.user = this.user; + this.currentConfig.password = this.password; + this.currentConfig.database = this.database; + this.currentConfig.charsetNumber = this.charsetNumber; + connection.clientEncoding = CharsetToEncoding[this.charsetNumber]; + // clear prepared statements cache as all statements become invalid after changeUser + connection._statements.clear(); + connection.writePacket(newPacket.toPacket()); + // check if the server supports multi-factor authentication + const multiFactorAuthentication = + connection.serverCapabilityFlags & + ClientConstants.MULTI_FACTOR_AUTHENTICATION; + if (multiFactorAuthentication) { + // if the server supports multi-factor authentication, we enable it in + // the client + this.authenticationFactor = 1; + } + return ChangeUser.prototype.handshakeResult; + } +} + +ChangeUser.prototype.handshakeResult = + ClientHandshake.prototype.handshakeResult; +ChangeUser.prototype.calculateNativePasswordAuthToken = + ClientHandshake.prototype.calculateNativePasswordAuthToken; + +module.exports = ChangeUser; diff --git a/node_modules/mysql2/lib/commands/client_handshake.js b/node_modules/mysql2/lib/commands/client_handshake.js new file mode 100644 index 0000000..ac0d863 --- /dev/null +++ b/node_modules/mysql2/lib/commands/client_handshake.js @@ -0,0 +1,241 @@ +// This file was modified by Oracle on June 17, 2021. +// Handshake errors are now maked as fatal and the corresponding events are +// emitted in the command instance itself. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +// This file was modified by Oracle on September 21, 2021. +// Handshake workflow now supports additional authentication factors requested +// by the server. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +const Command = require('./command.js'); +const Packets = require('../packets/index.js'); +const ClientConstants = require('../constants/client.js'); +const CharsetToEncoding = require('../constants/charset_encodings.js'); +const auth41 = require('../auth_41.js'); + +function flagNames(flags) { + const res = []; + for (const c in ClientConstants) { + if (flags & ClientConstants[c]) { + res.push(c.replace(/_/g, ' ').toLowerCase()); + } + } + return res; +} + +class ClientHandshake extends Command { + constructor(clientFlags) { + super(); + this.handshake = null; + this.clientFlags = clientFlags; + this.authenticationFactor = 0; + } + + start() { + return ClientHandshake.prototype.handshakeInit; + } + + sendSSLRequest(connection) { + const sslRequest = new Packets.SSLRequest( + this.clientFlags, + connection.config.charsetNumber + ); + connection.writePacket(sslRequest.toPacket()); + } + + sendCredentials(connection) { + if (connection.config.debug) { + // eslint-disable-next-line + console.log( + 'Sending handshake packet: flags:%d=(%s)', + this.clientFlags, + flagNames(this.clientFlags).join(', ') + ); + } + this.user = connection.config.user; + this.password = connection.config.password; + // "password1" is an alias to the original "password" value + // to make it easier to integrate multi-factor authentication + this.password1 = connection.config.password; + // "password2" and "password3" are the 2nd and 3rd factor authentication + // passwords, which can be undefined depending on the authentication + // plugin being used + this.password2 = connection.config.password2; + this.password3 = connection.config.password3; + this.passwordSha1 = connection.config.passwordSha1; + this.database = connection.config.database; + this.authPluginName = this.handshake.authPluginName; + const handshakeResponse = new Packets.HandshakeResponse({ + flags: this.clientFlags, + user: this.user, + database: this.database, + password: this.password, + passwordSha1: this.passwordSha1, + charsetNumber: connection.config.charsetNumber, + authPluginData1: this.handshake.authPluginData1, + authPluginData2: this.handshake.authPluginData2, + compress: connection.config.compress, + connectAttributes: connection.config.connectAttributes, + }); + connection.writePacket(handshakeResponse.toPacket()); + } + + calculateNativePasswordAuthToken(authPluginData) { + // TODO: dont split into authPluginData1 and authPluginData2, instead join when 1 & 2 received + const authPluginData1 = authPluginData.slice(0, 8); + const authPluginData2 = authPluginData.slice(8, 20); + let authToken; + if (this.passwordSha1) { + authToken = auth41.calculateTokenFromPasswordSha( + this.passwordSha1, + authPluginData1, + authPluginData2 + ); + } else { + authToken = auth41.calculateToken( + this.password, + authPluginData1, + authPluginData2 + ); + } + return authToken; + } + + handshakeInit(helloPacket, connection) { + this.on('error', (e) => { + connection._fatalError = e; + connection._protocolError = e; + }); + this.handshake = Packets.Handshake.fromPacket(helloPacket); + if (connection.config.debug) { + // eslint-disable-next-line + console.log( + 'Server hello packet: capability flags:%d=(%s)', + this.handshake.capabilityFlags, + flagNames(this.handshake.capabilityFlags).join(', ') + ); + } + connection.serverCapabilityFlags = this.handshake.capabilityFlags; + connection.serverEncoding = CharsetToEncoding[this.handshake.characterSet]; + connection.connectionId = this.handshake.connectionId; + const serverSSLSupport = + this.handshake.capabilityFlags & ClientConstants.SSL; + // multi factor authentication is enabled with the + // "MULTI_FACTOR_AUTHENTICATION" capability and should only be used if it + // is supported by the server + const multiFactorAuthentication = + this.handshake.capabilityFlags & + ClientConstants.MULTI_FACTOR_AUTHENTICATION; + this.clientFlags = this.clientFlags | multiFactorAuthentication; + // use compression only if requested by client and supported by server + connection.config.compress = + connection.config.compress && + this.handshake.capabilityFlags & ClientConstants.COMPRESS; + this.clientFlags = this.clientFlags | connection.config.compress; + if (connection.config.ssl) { + // client requires SSL but server does not support it + if (!serverSSLSupport) { + const err = new Error('Server does not support secure connection'); + err.code = 'HANDSHAKE_NO_SSL_SUPPORT'; + err.fatal = true; + this.emit('error', err); + return false; + } + // send ssl upgrade request and immediately upgrade connection to secure + this.clientFlags |= ClientConstants.SSL; + this.sendSSLRequest(connection); + connection.startTLS((err) => { + // after connection is secure + if (err) { + // SSL negotiation error are fatal + err.code = 'HANDSHAKE_SSL_ERROR'; + err.fatal = true; + this.emit('error', err); + return; + } + // rest of communication is encrypted + this.sendCredentials(connection); + }); + } else { + this.sendCredentials(connection); + } + if (multiFactorAuthentication) { + // if the server supports multi-factor authentication, we enable it in + // the client + this.authenticationFactor = 1; + } + return ClientHandshake.prototype.handshakeResult; + } + + handshakeResult(packet, connection) { + const marker = packet.peekByte(); + // packet can be OK_Packet, ERR_Packet, AuthSwitchRequest, AuthNextFactor + // or AuthMoreData + if (marker === 0xfe || marker === 1 || marker === 0x02) { + const authSwitch = require('./auth_switch'); + try { + if (marker === 1) { + authSwitch.authSwitchRequestMoreData(packet, connection, this); + } else { + // if authenticationFactor === 0, it means the server does not support + // the multi-factor authentication capability + if (this.authenticationFactor !== 0) { + // if we are past the first authentication factor, we should use the + // corresponding password (if there is one) + connection.config.password = + this[`password${this.authenticationFactor}`]; + // update the current authentication factor + this.authenticationFactor += 1; + } + // if marker === 0x02, it means it is an AuthNextFactor packet, + // which is similar in structure to an AuthSwitchRequest packet, + // so, we can use it directly + authSwitch.authSwitchRequest(packet, connection, this); + } + return ClientHandshake.prototype.handshakeResult; + } catch (err) { + // Authentication errors are fatal + err.code = 'AUTH_SWITCH_PLUGIN_ERROR'; + err.fatal = true; + + if (this.onResult) { + this.onResult(err); + } else { + this.emit('error', err); + } + return null; + } + } + if (marker !== 0) { + const err = new Error('Unexpected packet during handshake phase'); + // Unknown handshake errors are fatal + err.code = 'HANDSHAKE_UNKNOWN_ERROR'; + err.fatal = true; + + if (this.onResult) { + this.onResult(err); + } else { + this.emit('error', err); + } + return null; + } + // this should be called from ClientHandshake command only + // and skipped when called from ChangeUser command + if (!connection.authorized) { + connection.authorized = true; + if (connection.config.compress) { + const enableCompression = + require('../compressed_protocol.js').enableCompression; + enableCompression(connection); + } + } + if (this.onResult) { + this.onResult(null); + } + return null; + } +} +module.exports = ClientHandshake; diff --git a/node_modules/mysql2/lib/commands/close_statement.js b/node_modules/mysql2/lib/commands/close_statement.js new file mode 100644 index 0000000..15919c1 --- /dev/null +++ b/node_modules/mysql2/lib/commands/close_statement.js @@ -0,0 +1,18 @@ +'use strict'; + +const Command = require('./command'); +const Packets = require('../packets/index.js'); + +class CloseStatement extends Command { + constructor(id) { + super(); + this.id = id; + } + + start(packet, connection) { + connection.writePacket(new Packets.CloseStatement(this.id).toPacket(1)); + return null; + } +} + +module.exports = CloseStatement; diff --git a/node_modules/mysql2/lib/commands/command.js b/node_modules/mysql2/lib/commands/command.js new file mode 100644 index 0000000..3d31886 --- /dev/null +++ b/node_modules/mysql2/lib/commands/command.js @@ -0,0 +1,54 @@ +'use strict'; + +const EventEmitter = require('events').EventEmitter; +const Timers = require('timers'); + +class Command extends EventEmitter { + constructor() { + super(); + this.next = null; + } + + // slow. debug only + stateName() { + const state = this.next; + for (const i in this) { + if (this[i] === state && i !== 'next') { + return i; + } + } + return 'unknown name'; + } + + execute(packet, connection) { + if (!this.next) { + this.next = this.start; + connection._resetSequenceId(); + } + if (packet && packet.isError()) { + const err = packet.asError(connection.clientEncoding); + err.sql = this.sql || this.query; + if (this.queryTimeout) { + Timers.clearTimeout(this.queryTimeout); + this.queryTimeout = null; + } + if (this.onResult) { + this.onResult(err); + this.emit('end'); + } else { + this.emit('error', err); + this.emit('end'); + } + return true; + } + // TODO: don't return anything from execute, it's ugly and error-prone. Listen for 'end' event in connection + this.next = this.next(packet, connection); + if (this.next) { + return false; + } + this.emit('end'); + return true; + } +} + +module.exports = Command; diff --git a/node_modules/mysql2/lib/commands/execute.js b/node_modules/mysql2/lib/commands/execute.js new file mode 100644 index 0000000..a540337 --- /dev/null +++ b/node_modules/mysql2/lib/commands/execute.js @@ -0,0 +1,112 @@ +'use strict'; + +const Command = require('./command.js'); +const Query = require('./query.js'); +const Packets = require('../packets/index.js'); + +const getBinaryParser = require('../parsers/binary_parser.js'); +const getStaticBinaryParser = require('../parsers/static_binary_parser.js'); + +class Execute extends Command { + constructor(options, callback) { + super(); + this.statement = options.statement; + this.sql = options.sql; + this.values = options.values; + this.onResult = callback; + this.parameters = options.values; + this.insertId = 0; + this.timeout = options.timeout; + this.queryTimeout = null; + this._rows = []; + this._fields = []; + this._result = []; + this._fieldCount = 0; + this._rowParser = null; + this._executeOptions = options; + this._resultIndex = 0; + this._localStream = null; + this._unpipeStream = function () {}; + this._streamFactory = options.infileStreamFactory; + this._connection = null; + } + + buildParserFromFields(fields, connection) { + if (this.options.disableEval) { + return getStaticBinaryParser(fields, this.options, connection.config); + } + + return getBinaryParser(fields, this.options, connection.config); + } + + start(packet, connection) { + this._connection = connection; + this.options = Object.assign({}, connection.config, this._executeOptions); + this._setTimeout(); + const executePacket = new Packets.Execute( + this.statement.id, + this.parameters, + connection.config.charsetNumber, + connection.config.timezone + ); + //For reasons why this try-catch is here, please see + // https://github.com/sidorares/node-mysql2/pull/689 + //For additional discussion, see + // 1. https://github.com/sidorares/node-mysql2/issues/493 + // 2. https://github.com/sidorares/node-mysql2/issues/187 + // 3. https://github.com/sidorares/node-mysql2/issues/480 + try { + connection.writePacket(executePacket.toPacket(1)); + } catch (error) { + this.onResult(error); + } + return Execute.prototype.resultsetHeader; + } + + readField(packet, connection) { + let fields; + // disabling for now, but would be great to find reliable way to parse fields only once + // fields reported by prepare can be empty at all or just incorrect - see #169 + // + // perfomance optimisation: if we already have this field parsed in statement header, use one from header + // const field = this.statement.columns.length == this._fieldCount ? + // this.statement.columns[this._receivedFieldsCount] : new Packets.ColumnDefinition(packet); + const field = new Packets.ColumnDefinition( + packet, + connection.clientEncoding + ); + this._receivedFieldsCount++; + this._fields[this._resultIndex].push(field); + if (this._receivedFieldsCount === this._fieldCount) { + fields = this._fields[this._resultIndex]; + this.emit('fields', fields, this._resultIndex); + return Execute.prototype.fieldsEOF; + } + return Execute.prototype.readField; + } + + fieldsEOF(packet, connection) { + // check EOF + if (!packet.isEOF()) { + return connection.protocolError('Expected EOF packet'); + } + this._rowParser = new (this.buildParserFromFields( + this._fields[this._resultIndex], + connection + ))(); + return Execute.prototype.row; + } +} + +Execute.prototype.done = Query.prototype.done; +Execute.prototype.doneInsert = Query.prototype.doneInsert; +Execute.prototype.resultsetHeader = Query.prototype.resultsetHeader; +Execute.prototype._findOrCreateReadStream = + Query.prototype._findOrCreateReadStream; +Execute.prototype._streamLocalInfile = Query.prototype._streamLocalInfile; +Execute.prototype._setTimeout = Query.prototype._setTimeout; +Execute.prototype._handleTimeoutError = Query.prototype._handleTimeoutError; +Execute.prototype.row = Query.prototype.row; +Execute.prototype.stream = Query.prototype.stream; + +module.exports = Execute; diff --git a/node_modules/mysql2/lib/commands/index.js b/node_modules/mysql2/lib/commands/index.js new file mode 100644 index 0000000..b79818d --- /dev/null +++ b/node_modules/mysql2/lib/commands/index.js @@ -0,0 +1,27 @@ +'use strict'; + +const ClientHandshake = require('./client_handshake.js'); +const ServerHandshake = require('./server_handshake.js'); +const Query = require('./query.js'); +const Prepare = require('./prepare.js'); +const CloseStatement = require('./close_statement.js'); +const Execute = require('./execute.js'); +const Ping = require('./ping.js'); +const RegisterSlave = require('./register_slave.js'); +const BinlogDump = require('./binlog_dump.js'); +const ChangeUser = require('./change_user.js'); +const Quit = require('./quit.js'); + +module.exports = { + ClientHandshake, + ServerHandshake, + Query, + Prepare, + CloseStatement, + Execute, + Ping, + RegisterSlave, + BinlogDump, + ChangeUser, + Quit, +}; diff --git a/node_modules/mysql2/lib/commands/ping.js b/node_modules/mysql2/lib/commands/ping.js new file mode 100644 index 0000000..dc820ef --- /dev/null +++ b/node_modules/mysql2/lib/commands/ping.js @@ -0,0 +1,36 @@ +'use strict'; + +const Command = require('./command'); +const CommandCode = require('../constants/commands'); +const Packet = require('../packets/packet'); + +// TODO: time statistics? +// usefull for queue size and network latency monitoring +// store created,sent,reply timestamps +class Ping extends Command { + constructor(callback) { + super(); + this.onResult = callback; + } + + start(packet, connection) { + const ping = new Packet( + 0, + Buffer.from([1, 0, 0, 0, CommandCode.PING]), + 0, + 5 + ); + connection.writePacket(ping); + return Ping.prototype.pingResponse; + } + + pingResponse() { + // TODO: check it's OK packet. error check already done in caller + if (this.onResult) { + process.nextTick(this.onResult.bind(this)); + } + return null; + } +} + +module.exports = Ping; diff --git a/node_modules/mysql2/lib/commands/prepare.js b/node_modules/mysql2/lib/commands/prepare.js new file mode 100644 index 0000000..ab217a8 --- /dev/null +++ b/node_modules/mysql2/lib/commands/prepare.js @@ -0,0 +1,143 @@ +'use strict'; + +const Packets = require('../packets/index.js'); +const Command = require('./command.js'); +const CloseStatement = require('./close_statement.js'); +const Execute = require('./execute.js'); + +class PreparedStatementInfo { + constructor(query, id, columns, parameters, connection) { + this.query = query; + this.id = id; + this.columns = columns; + this.parameters = parameters; + this.rowParser = null; + this._connection = connection; + } + + close() { + return this._connection.addCommand(new CloseStatement(this.id)); + } + + execute(parameters, callback) { + if (typeof parameters === 'function') { + callback = parameters; + parameters = []; + } + return this._connection.addCommand( + new Execute({ statement: this, values: parameters }, callback) + ); + } +} + +class Prepare extends Command { + constructor(options, callback) { + super(); + this.query = options.sql; + this.onResult = callback; + this.id = 0; + this.fieldCount = 0; + this.parameterCount = 0; + this.fields = []; + this.parameterDefinitions = []; + this.options = options; + } + + start(packet, connection) { + const Connection = connection.constructor; + this.key = Connection.statementKey(this.options); + const statement = connection._statements.get(this.key); + if (statement) { + if (this.onResult) { + this.onResult(null, statement); + } + return null; + } + const cmdPacket = new Packets.PrepareStatement( + this.query, + connection.config.charsetNumber, + this.options.values + ); + connection.writePacket(cmdPacket.toPacket(1)); + return Prepare.prototype.prepareHeader; + } + + prepareHeader(packet, connection) { + const header = new Packets.PreparedStatementHeader(packet); + this.id = header.id; + this.fieldCount = header.fieldCount; + this.parameterCount = header.parameterCount; + if (this.parameterCount > 0) { + return Prepare.prototype.readParameter; + } + if (this.fieldCount > 0) { + return Prepare.prototype.readField; + } + return this.prepareDone(connection); + } + + readParameter(packet, connection) { + // there might be scenarios when mysql server reports more parameters than + // are actually present in the array of parameter definitions. + // if EOF packet is received we switch to "read fields" state if there are + // any fields reported by the server, otherwise we finish the command. + if (packet.isEOF()) { + if (this.fieldCount > 0) { + return Prepare.prototype.readField; + } + return this.prepareDone(connection); + } + const def = new Packets.ColumnDefinition(packet, connection.clientEncoding); + this.parameterDefinitions.push(def); + if (this.parameterDefinitions.length === this.parameterCount) { + return Prepare.prototype.parametersEOF; + } + return this.readParameter; + } + + readField(packet, connection) { + if (packet.isEOF()) { + return this.prepareDone(connection); + } + const def = new Packets.ColumnDefinition(packet, connection.clientEncoding); + this.fields.push(def); + if (this.fields.length === this.fieldCount) { + return Prepare.prototype.fieldsEOF; + } + return Prepare.prototype.readField; + } + + parametersEOF(packet, connection) { + if (!packet.isEOF()) { + return connection.protocolError('Expected EOF packet after parameters'); + } + if (this.fieldCount > 0) { + return Prepare.prototype.readField; + } + return this.prepareDone(connection); + } + + fieldsEOF(packet, connection) { + if (!packet.isEOF()) { + return connection.protocolError('Expected EOF packet after fields'); + } + return this.prepareDone(connection); + } + + prepareDone(connection) { + const statement = new PreparedStatementInfo( + this.query, + this.id, + this.fields, + this.parameterDefinitions, + connection + ); + connection._statements.set(this.key, statement); + if (this.onResult) { + this.onResult(null, statement); + } + return null; + } +} + +module.exports = Prepare; diff --git a/node_modules/mysql2/lib/commands/query.js b/node_modules/mysql2/lib/commands/query.js new file mode 100644 index 0000000..117e4ba --- /dev/null +++ b/node_modules/mysql2/lib/commands/query.js @@ -0,0 +1,329 @@ +'use strict'; + +const process = require('process'); +const Timers = require('timers'); + +const Readable = require('stream').Readable; + +const Command = require('./command.js'); +const Packets = require('../packets/index.js'); +const getTextParser = require('../parsers/text_parser.js'); +const staticParser = require('../parsers/static_text_parser.js'); +const ServerStatus = require('../constants/server_status.js'); + +const EmptyPacket = new Packets.Packet(0, Buffer.allocUnsafe(4), 0, 4); + +// http://dev.mysql.com/doc/internals/en/com-query.html +class Query extends Command { + constructor(options, callback) { + super(); + this.sql = options.sql; + this.values = options.values; + this._queryOptions = options; + this.namedPlaceholders = options.namedPlaceholders || false; + this.onResult = callback; + this.timeout = options.timeout; + this.queryTimeout = null; + this._fieldCount = 0; + this._rowParser = null; + this._fields = []; + this._rows = []; + this._receivedFieldsCount = 0; + this._resultIndex = 0; + this._localStream = null; + this._unpipeStream = function () {}; + this._streamFactory = options.infileStreamFactory; + this._connection = null; + } + + then() { + const err = + "You have tried to call .then(), .catch(), or invoked await on the result of query that is not a promise, which is a programming error. Try calling con.promise().query(), or require('mysql2/promise') instead of 'mysql2' for a promise-compatible version of the query interface. To learn how to use async/await or Promises check out documentation at https://sidorares.github.io/node-mysql2/docs#using-promise-wrapper, or the mysql2 documentation at https://sidorares.github.io/node-mysql2/docs/documentation/promise-wrapper"; + // eslint-disable-next-line + console.log(err); + throw new Error(err); + } + + /* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */ + start(_packet, connection) { + if (connection.config.debug) { + // eslint-disable-next-line + console.log(' Sending query command: %s', this.sql); + } + this._connection = connection; + this.options = Object.assign({}, connection.config, this._queryOptions); + this._setTimeout(); + + const cmdPacket = new Packets.Query( + this.sql, + connection.config.charsetNumber + ); + connection.writePacket(cmdPacket.toPacket(1)); + return Query.prototype.resultsetHeader; + } + + done() { + this._unpipeStream(); + // if all ready timeout, return null directly + if (this.timeout && !this.queryTimeout) { + return null; + } + // else clear timer + if (this.queryTimeout) { + Timers.clearTimeout(this.queryTimeout); + this.queryTimeout = null; + } + if (this.onResult) { + let rows, fields; + if (this._resultIndex === 0) { + rows = this._rows[0]; + fields = this._fields[0]; + } else { + rows = this._rows; + fields = this._fields; + } + if (fields) { + process.nextTick(() => { + this.onResult(null, rows, fields); + }); + } else { + process.nextTick(() => { + this.onResult(null, rows); + }); + } + } + return null; + } + + doneInsert(rs) { + if (this._localStreamError) { + if (this.onResult) { + this.onResult(this._localStreamError, rs); + } else { + this.emit('error', this._localStreamError); + } + return null; + } + this._rows.push(rs); + this._fields.push(void 0); + this.emit('fields', void 0); + this.emit('result', rs); + if (rs.serverStatus & ServerStatus.SERVER_MORE_RESULTS_EXISTS) { + this._resultIndex++; + return this.resultsetHeader; + } + return this.done(); + } + + resultsetHeader(packet, connection) { + const rs = new Packets.ResultSetHeader(packet, connection); + this._fieldCount = rs.fieldCount; + if (connection.config.debug) { + // eslint-disable-next-line + console.log( + ` Resultset header received, expecting ${rs.fieldCount} column definition packets` + ); + } + if (this._fieldCount === 0) { + return this.doneInsert(rs); + } + if (this._fieldCount === null) { + return this._streamLocalInfile(connection, rs.infileName); + } + this._receivedFieldsCount = 0; + this._rows.push([]); + this._fields.push([]); + return this.readField; + } + + _streamLocalInfile(connection, path) { + if (this._streamFactory) { + this._localStream = this._streamFactory(path); + } else { + this._localStreamError = new Error( + `As a result of LOCAL INFILE command server wants to read ${path} file, but as of v2.0 you must provide streamFactory option returning ReadStream.` + ); + connection.writePacket(EmptyPacket); + return this.infileOk; + } + + const onConnectionError = () => { + this._unpipeStream(); + }; + const onDrain = () => { + this._localStream.resume(); + }; + const onPause = () => { + this._localStream.pause(); + }; + const onData = function (data) { + const dataWithHeader = Buffer.allocUnsafe(data.length + 4); + data.copy(dataWithHeader, 4); + connection.writePacket( + new Packets.Packet(0, dataWithHeader, 0, dataWithHeader.length) + ); + }; + const onEnd = () => { + connection.removeListener('error', onConnectionError); + connection.writePacket(EmptyPacket); + }; + const onError = (err) => { + this._localStreamError = err; + connection.removeListener('error', onConnectionError); + connection.writePacket(EmptyPacket); + }; + this._unpipeStream = () => { + connection.stream.removeListener('pause', onPause); + connection.stream.removeListener('drain', onDrain); + this._localStream.removeListener('data', onData); + this._localStream.removeListener('end', onEnd); + this._localStream.removeListener('error', onError); + }; + connection.stream.on('pause', onPause); + connection.stream.on('drain', onDrain); + this._localStream.on('data', onData); + this._localStream.on('end', onEnd); + this._localStream.on('error', onError); + connection.once('error', onConnectionError); + return this.infileOk; + } + + readField(packet, connection) { + this._receivedFieldsCount++; + // Often there is much more data in the column definition than in the row itself + // If you set manually _fields[0] to array of ColumnDefinition's (from previous call) + // you can 'cache' result of parsing. Field packets still received, but ignored in that case + // this is the reason _receivedFieldsCount exist (otherwise we could just use current length of fields array) + if (this._fields[this._resultIndex].length !== this._fieldCount) { + const field = new Packets.ColumnDefinition( + packet, + connection.clientEncoding + ); + this._fields[this._resultIndex].push(field); + if (connection.config.debug) { + /* eslint-disable no-console */ + console.log(' Column definition:'); + console.log(` name: ${field.name}`); + console.log(` type: ${field.columnType}`); + console.log(` flags: ${field.flags}`); + /* eslint-enable no-console */ + } + } + // last field received + if (this._receivedFieldsCount === this._fieldCount) { + const fields = this._fields[this._resultIndex]; + this.emit('fields', fields); + if (this.options.disableEval) { + this._rowParser = staticParser(fields, this.options, connection.config); + } else { + this._rowParser = new (getTextParser( + fields, + this.options, + connection.config + ))(fields); + } + return Query.prototype.fieldsEOF; + } + return Query.prototype.readField; + } + + fieldsEOF(packet, connection) { + // check EOF + if (!packet.isEOF()) { + return connection.protocolError('Expected EOF packet'); + } + return this.row; + } + + /* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */ + row(packet, _connection) { + if (packet.isEOF()) { + const status = packet.eofStatusFlags(); + const moreResults = status & ServerStatus.SERVER_MORE_RESULTS_EXISTS; + if (moreResults) { + this._resultIndex++; + return Query.prototype.resultsetHeader; + } + return this.done(); + } + let row; + try { + row = this._rowParser.next( + packet, + this._fields[this._resultIndex], + this.options + ); + } catch (err) { + this._localStreamError = err; + return this.doneInsert(null); + } + if (this.onResult) { + this._rows[this._resultIndex].push(row); + } else { + this.emit('result', row, this._resultIndex); + } + return Query.prototype.row; + } + + infileOk(packet, connection) { + const rs = new Packets.ResultSetHeader(packet, connection); + return this.doneInsert(rs); + } + + stream(options) { + options = options || {}; + options.objectMode = true; + const stream = new Readable(options); + stream._read = () => { + this._connection && this._connection.resume(); + }; + this.on('result', (row, resultSetIndex) => { + if (!stream.push(row)) { + this._connection.pause(); + } + stream.emit('result', row, resultSetIndex); // replicate old emitter + }); + this.on('error', (err) => { + stream.emit('error', err); // Pass on any errors + }); + this.on('end', () => { + stream.push(null); // pushing null, indicating EOF + }); + this.on('fields', (fields) => { + stream.emit('fields', fields); // replicate old emitter + }); + stream.on('end', () => { + stream.emit('close'); + }); + return stream; + } + + _setTimeout() { + if (this.timeout) { + const timeoutHandler = this._handleTimeoutError.bind(this); + this.queryTimeout = Timers.setTimeout(timeoutHandler, this.timeout); + } + } + + _handleTimeoutError() { + if (this.queryTimeout) { + Timers.clearTimeout(this.queryTimeout); + this.queryTimeout = null; + } + + const err = new Error('Query inactivity timeout'); + err.errorno = 'PROTOCOL_SEQUENCE_TIMEOUT'; + err.code = 'PROTOCOL_SEQUENCE_TIMEOUT'; + err.syscall = 'query'; + + if (this.onResult) { + this.onResult(err); + } else { + this.emit('error', err); + } + } +} + +Query.prototype.catch = Query.prototype.then; + +module.exports = Query; diff --git a/node_modules/mysql2/lib/commands/quit.js b/node_modules/mysql2/lib/commands/quit.js new file mode 100644 index 0000000..02ed763 --- /dev/null +++ b/node_modules/mysql2/lib/commands/quit.js @@ -0,0 +1,29 @@ +'use strict'; + +const Command = require('./command.js'); +const CommandCode = require('../constants/commands.js'); +const Packet = require('../packets/packet.js'); + +class Quit extends Command { + constructor(callback) { + super(); + this.onResult = callback; + } + + start(packet, connection) { + connection._closing = true; + const quit = new Packet( + 0, + Buffer.from([1, 0, 0, 0, CommandCode.QUIT]), + 0, + 5 + ); + if (this.onResult) { + this.onResult(); + } + connection.writePacket(quit); + return null; + } +} + +module.exports = Quit; diff --git a/node_modules/mysql2/lib/commands/register_slave.js b/node_modules/mysql2/lib/commands/register_slave.js new file mode 100644 index 0000000..4ebfe61 --- /dev/null +++ b/node_modules/mysql2/lib/commands/register_slave.js @@ -0,0 +1,27 @@ +'use strict'; + +const Command = require('./command'); +const Packets = require('../packets'); + +class RegisterSlave extends Command { + constructor(opts, callback) { + super(); + this.onResult = callback; + this.opts = opts; + } + + start(packet, connection) { + const newPacket = new Packets.RegisterSlave(this.opts); + connection.writePacket(newPacket.toPacket(1)); + return RegisterSlave.prototype.registerResponse; + } + + registerResponse() { + if (this.onResult) { + process.nextTick(this.onResult.bind(this)); + } + return null; + } +} + +module.exports = RegisterSlave; diff --git a/node_modules/mysql2/lib/commands/server_handshake.js b/node_modules/mysql2/lib/commands/server_handshake.js new file mode 100644 index 0000000..dfa2b1b --- /dev/null +++ b/node_modules/mysql2/lib/commands/server_handshake.js @@ -0,0 +1,203 @@ +'use strict'; + +const CommandCode = require('../constants/commands.js'); +const Errors = require('../constants/errors.js'); + +const Command = require('./command.js'); +const Packets = require('../packets/index.js'); + +class ServerHandshake extends Command { + constructor(args) { + super(); + this.args = args; + /* + this.protocolVersion = args.protocolVersion || 10; + this.serverVersion = args.serverVersion; + this.connectionId = args.connectionId, + this.statusFlags = args.statusFlags, + this.characterSet = args.characterSet, + this.capabilityFlags = args.capabilityFlags || 512; + */ + } + + start(packet, connection) { + const serverHelloPacket = new Packets.Handshake(this.args); + this.serverHello = serverHelloPacket; + serverHelloPacket.setScrambleData((err) => { + if (err) { + connection.emit('error', new Error('Error generating random bytes')); + return; + } + connection.writePacket(serverHelloPacket.toPacket(0)); + }); + return ServerHandshake.prototype.readClientReply; + } + + readClientReply(packet, connection) { + // check auth here + const clientHelloReply = Packets.HandshakeResponse.fromPacket(packet); + // TODO check we don't have something similar already + connection.clientHelloReply = clientHelloReply; + if (this.args.authCallback) { + this.args.authCallback( + { + user: clientHelloReply.user, + database: clientHelloReply.database, + address: connection.stream.remoteAddress, + authPluginData1: this.serverHello.authPluginData1, + authPluginData2: this.serverHello.authPluginData2, + authToken: clientHelloReply.authToken, + }, + (err, mysqlError) => { + // if (err) + if (!mysqlError) { + connection.writeOk(); + } else { + // TODO create constants / errorToCode + // 1045 = ER_ACCESS_DENIED_ERROR + connection.writeError({ + message: mysqlError.message || '', + code: mysqlError.code || 1045, + }); + connection.close(); + } + } + ); + } else { + connection.writeOk(); + } + return ServerHandshake.prototype.dispatchCommands; + } + + _isStatement(query, name) { + const firstWord = query.split(' ')[0].toUpperCase(); + return firstWord === name; + } + + dispatchCommands(packet, connection) { + // command from client to server + let knownCommand = true; + const encoding = connection.clientHelloReply.encoding; + const commandCode = packet.readInt8(); + switch (commandCode) { + case CommandCode.STMT_PREPARE: + if (connection.listeners('stmt_prepare').length) { + const query = packet.readString(undefined, encoding); + connection.emit('stmt_prepare', query); + } else { + connection.writeError({ + code: Errors.HA_ERR_INTERNAL_ERROR, + message: 'No query handler for prepared statements.', + }); + } + break; + case CommandCode.STMT_EXECUTE: + if (connection.listeners('stmt_execute').length) { + const { stmtId, flags, iterationCount, values } = + Packets.Execute.fromPacket(packet, encoding); + connection.emit( + 'stmt_execute', + stmtId, + flags, + iterationCount, + values + ); + } else { + connection.writeError({ + code: Errors.HA_ERR_INTERNAL_ERROR, + message: 'No query handler for execute statements.', + }); + } + break; + case CommandCode.QUIT: + if (connection.listeners('quit').length) { + connection.emit('quit'); + } else { + connection.stream.end(); + } + break; + case CommandCode.INIT_DB: + if (connection.listeners('init_db').length) { + const schemaName = packet.readString(undefined, encoding); + connection.emit('init_db', schemaName); + } else { + connection.writeOk(); + } + break; + case CommandCode.QUERY: + if (connection.listeners('query').length) { + const query = packet.readString(undefined, encoding); + if ( + this._isStatement(query, 'PREPARE') || + this._isStatement(query, 'SET') + ) { + connection.emit('stmt_prepare', query); + } else if (this._isStatement(query, 'EXECUTE')) { + connection.emit('stmt_execute', null, null, null, null, query); + } else connection.emit('query', query); + } else { + connection.writeError({ + code: Errors.HA_ERR_INTERNAL_ERROR, + message: 'No query handler', + }); + } + break; + case CommandCode.FIELD_LIST: + if (connection.listeners('field_list').length) { + const table = packet.readNullTerminatedString(encoding); + const fields = packet.readString(undefined, encoding); + connection.emit('field_list', table, fields); + } else { + connection.writeError({ + code: Errors.ER_WARN_DEPRECATED_SYNTAX, + message: + 'As of MySQL 5.7.11, COM_FIELD_LIST is deprecated and will be removed in a future version of MySQL.', + }); + } + break; + case CommandCode.PING: + if (connection.listeners('ping').length) { + connection.emit('ping'); + } else { + connection.writeOk(); + } + break; + default: + knownCommand = false; + } + if (connection.listeners('packet').length) { + connection.emit('packet', packet.clone(), knownCommand, commandCode); + } else if (!knownCommand) { + // eslint-disable-next-line no-console + console.log('Unknown command:', commandCode); + } + return ServerHandshake.prototype.dispatchCommands; + } +} + +module.exports = ServerHandshake; + +// TODO: implement server-side 4.1 authentication +/* +4.1 authentication: (http://bazaar.launchpad.net/~mysql/mysql-server/5.5/view/head:/sql/password.c) + + SERVER: public_seed=create_random_string() + send(public_seed) + + CLIENT: recv(public_seed) + hash_stage1=sha1("password") + hash_stage2=sha1(hash_stage1) + reply=xor(hash_stage1, sha1(public_seed,hash_stage2) + + // this three steps are done in scramble() + + send(reply) + + + SERVER: recv(reply) + hash_stage1=xor(reply, sha1(public_seed,hash_stage2)) + candidate_hash2=sha1(hash_stage1) + check(candidate_hash2==hash_stage2) + +server stores sha1(sha1(password)) ( hash_stag2) +*/ diff --git a/node_modules/mysql2/lib/compressed_protocol.js b/node_modules/mysql2/lib/compressed_protocol.js new file mode 100644 index 0000000..3166846 --- /dev/null +++ b/node_modules/mysql2/lib/compressed_protocol.js @@ -0,0 +1,127 @@ +'use strict'; + +// connection mixins +// implementation of http://dev.mysql.com/doc/internals/en/compression.html + +const zlib = require('zlib'); +const PacketParser = require('./packet_parser.js'); + +function handleCompressedPacket(packet) { + // eslint-disable-next-line consistent-this, no-invalid-this + const connection = this; + const deflatedLength = packet.readInt24(); + const body = packet.readBuffer(); + + if (deflatedLength !== 0) { + connection.inflateQueue.push((task) => { + zlib.inflate(body, (err, data) => { + if (err) { + connection._handleNetworkError(err); + return; + } + connection._bumpCompressedSequenceId(packet.numPackets); + connection._inflatedPacketsParser.execute(data); + task.done(); + }); + }); + } else { + connection.inflateQueue.push((task) => { + connection._bumpCompressedSequenceId(packet.numPackets); + connection._inflatedPacketsParser.execute(body); + task.done(); + }); + } +} + +function writeCompressed(buffer) { + // http://dev.mysql.com/doc/internals/en/example-several-mysql-packets.html + // note: sending a MySQL Packet of the size 2^24−5 to 2^24−1 via compression + // leads to at least one extra compressed packet. + // (this is because "length of the packet before compression" need to fit + // into 3 byte unsigned int. "length of the packet before compression" includes + // 4 byte packet header, hence 2^24−5) + const MAX_COMPRESSED_LENGTH = 16777210; + let start; + if (buffer.length > MAX_COMPRESSED_LENGTH) { + for (start = 0; start < buffer.length; start += MAX_COMPRESSED_LENGTH) { + writeCompressed.call( + // eslint-disable-next-line no-invalid-this + this, + buffer.slice(start, start + MAX_COMPRESSED_LENGTH) + ); + } + return; + } + + // eslint-disable-next-line no-invalid-this, consistent-this + const connection = this; + + let packetLen = buffer.length; + const compressHeader = Buffer.allocUnsafe(7); + + // seqqueue is used here because zlib async execution is routed via thread pool + // internally and when we have multiple compressed packets arriving we need + // to assemble uncompressed result sequentially + (function (seqId) { + connection.deflateQueue.push((task) => { + zlib.deflate(buffer, (err, compressed) => { + if (err) { + connection._handleFatalError(err); + return; + } + let compressedLength = compressed.length; + + if (compressedLength < packetLen) { + compressHeader.writeUInt8(compressedLength & 0xff, 0); + compressHeader.writeUInt16LE(compressedLength >> 8, 1); + compressHeader.writeUInt8(seqId, 3); + compressHeader.writeUInt8(packetLen & 0xff, 4); + compressHeader.writeUInt16LE(packetLen >> 8, 5); + connection.writeUncompressed(compressHeader); + connection.writeUncompressed(compressed); + } else { + // http://dev.mysql.com/doc/internals/en/uncompressed-payload.html + // To send an uncompressed payload: + // - set length of payload before compression to 0 + // - the compressed payload contains the uncompressed payload instead. + compressedLength = packetLen; + packetLen = 0; + compressHeader.writeUInt8(compressedLength & 0xff, 0); + compressHeader.writeUInt16LE(compressedLength >> 8, 1); + compressHeader.writeUInt8(seqId, 3); + compressHeader.writeUInt8(packetLen & 0xff, 4); + compressHeader.writeUInt16LE(packetLen >> 8, 5); + connection.writeUncompressed(compressHeader); + connection.writeUncompressed(buffer); + } + task.done(); + }); + }); + })(connection.compressedSequenceId); + connection._bumpCompressedSequenceId(1); +} + +function enableCompression(connection) { + connection._lastWrittenPacketId = 0; + connection._lastReceivedPacketId = 0; + + connection._handleCompressedPacket = handleCompressedPacket; + connection._inflatedPacketsParser = new PacketParser((p) => { + connection.handlePacket(p); + }, 4); + connection._inflatedPacketsParser._lastPacket = 0; + connection.packetParser = new PacketParser((packet) => { + connection._handleCompressedPacket(packet); + }, 7); + + connection.writeUncompressed = connection.write; + connection.write = writeCompressed; + + const seqqueue = require('seq-queue'); + connection.inflateQueue = seqqueue.createQueue(); + connection.deflateQueue = seqqueue.createQueue(); +} + +module.exports = { + enableCompression: enableCompression, +}; diff --git a/node_modules/mysql2/lib/connection.js b/node_modules/mysql2/lib/connection.js new file mode 100644 index 0000000..b21cff8 --- /dev/null +++ b/node_modules/mysql2/lib/connection.js @@ -0,0 +1,12 @@ +'use strict'; + +const BaseConnection = require('./base/connection.js'); + +class Connection extends BaseConnection { + promise(promiseImpl) { + const PromiseConnection = require('./promise/connection.js'); + return new PromiseConnection(this, promiseImpl); + } +} + +module.exports = Connection; diff --git a/node_modules/mysql2/lib/connection_config.js b/node_modules/mysql2/lib/connection_config.js new file mode 100644 index 0000000..3707928 --- /dev/null +++ b/node_modules/mysql2/lib/connection_config.js @@ -0,0 +1,292 @@ +// This file was modified by Oracle on September 21, 2021. +// New connection options for additional authentication factors were +// introduced. +// Multi-factor authentication capability is now enabled if one of these +// options is used. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +const { URL } = require('url'); +const ClientConstants = require('./constants/client'); +const Charsets = require('./constants/charsets'); +const { version } = require('../package.json'); +let SSLProfiles = null; + +const validOptions = { + authPlugins: 1, + authSwitchHandler: 1, + bigNumberStrings: 1, + charset: 1, + charsetNumber: 1, + compress: 1, + connectAttributes: 1, + connectTimeout: 1, + database: 1, + dateStrings: 1, + debug: 1, + decimalNumbers: 1, + enableKeepAlive: 1, + flags: 1, + host: 1, + insecureAuth: 1, + infileStreamFactory: 1, + isServer: 1, + keepAliveInitialDelay: 1, + localAddress: 1, + maxPreparedStatements: 1, + multipleStatements: 1, + namedPlaceholders: 1, + nestTables: 1, + password: 1, + // with multi-factor authentication, the main password (used for the first + // authentication factor) can be provided via password1 + password1: 1, + password2: 1, + password3: 1, + passwordSha1: 1, + pool: 1, + port: 1, + queryFormat: 1, + rowsAsArray: 1, + socketPath: 1, + ssl: 1, + stream: 1, + stringifyObjects: 1, + supportBigNumbers: 1, + timezone: 1, + trace: 1, + typeCast: 1, + uri: 1, + user: 1, + disableEval: 1, + // These options are used for Pool + connectionLimit: 1, + maxIdle: 1, + idleTimeout: 1, + Promise: 1, + queueLimit: 1, + waitForConnections: 1, + jsonStrings: 1, +}; + +class ConnectionConfig { + constructor(options) { + if (typeof options === 'string') { + options = ConnectionConfig.parseUrl(options); + } else if (options && options.uri) { + const uriOptions = ConnectionConfig.parseUrl(options.uri); + for (const key in uriOptions) { + if (!Object.prototype.hasOwnProperty.call(uriOptions, key)) continue; + if (options[key]) continue; + options[key] = uriOptions[key]; + } + } + for (const key in options) { + if (!Object.prototype.hasOwnProperty.call(options, key)) continue; + if (validOptions[key] !== 1) { + // REVIEW: Should this be emitted somehow? + // eslint-disable-next-line no-console + console.error( + `Ignoring invalid configuration option passed to Connection: ${key}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection` + ); + } + } + this.isServer = options.isServer; + this.stream = options.stream; + this.host = options.host || 'localhost'; + this.port = + (typeof options.port === 'string' + ? parseInt(options.port, 10) + : options.port) || 3306; + this.localAddress = options.localAddress; + this.socketPath = options.socketPath; + this.user = options.user || undefined; + // for the purpose of multi-factor authentication, or not, the main + // password (used for the 1st authentication factor) can also be + // provided via the "password1" option + this.password = options.password || options.password1 || undefined; + this.password2 = options.password2 || undefined; + this.password3 = options.password3 || undefined; + this.passwordSha1 = options.passwordSha1 || undefined; + this.database = options.database; + this.connectTimeout = isNaN(options.connectTimeout) + ? 10 * 1000 + : options.connectTimeout; + this.insecureAuth = options.insecureAuth || false; + this.infileStreamFactory = options.infileStreamFactory || undefined; + this.supportBigNumbers = options.supportBigNumbers || false; + this.bigNumberStrings = options.bigNumberStrings || false; + this.decimalNumbers = options.decimalNumbers || false; + this.dateStrings = options.dateStrings || false; + this.debug = options.debug; + this.trace = options.trace !== false; + this.stringifyObjects = options.stringifyObjects || false; + this.enableKeepAlive = options.enableKeepAlive !== false; + this.keepAliveInitialDelay = options.keepAliveInitialDelay; + if ( + options.timezone && + !/^(?:local|Z|[ +-]\d\d:\d\d)$/.test(options.timezone) + ) { + // strictly supports timezones specified by mysqljs/mysql: + // https://github.com/mysqljs/mysql#user-content-connection-options + // eslint-disable-next-line no-console + console.error( + `Ignoring invalid timezone passed to Connection: ${options.timezone}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection` + ); + // SqlStrings falls back to UTC on invalid timezone + this.timezone = 'Z'; + } else { + this.timezone = options.timezone || 'local'; + } + this.queryFormat = options.queryFormat; + this.pool = options.pool || undefined; + this.ssl = + typeof options.ssl === 'string' + ? ConnectionConfig.getSSLProfile(options.ssl) + : options.ssl || false; + this.multipleStatements = options.multipleStatements || false; + this.rowsAsArray = options.rowsAsArray || false; + this.namedPlaceholders = options.namedPlaceholders || false; + this.nestTables = + options.nestTables === undefined ? undefined : options.nestTables; + this.typeCast = options.typeCast === undefined ? true : options.typeCast; + this.disableEval = Boolean(options.disableEval); + if (this.timezone[0] === ' ') { + // "+" is a url encoded char for space so it + // gets translated to space when giving a + // connection string.. + this.timezone = `+${this.timezone.slice(1)}`; + } + if (this.ssl) { + if (typeof this.ssl !== 'object') { + throw new TypeError( + `SSL profile must be an object, instead it's a ${typeof this.ssl}` + ); + } + // Default rejectUnauthorized to true + this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== false; + } + this.maxPacketSize = 0; + this.charsetNumber = options.charset + ? ConnectionConfig.getCharsetNumber(options.charset) + : options.charsetNumber || Charsets.UTF8MB4_UNICODE_CI; + this.compress = options.compress || false; + this.authPlugins = options.authPlugins; + this.authSwitchHandler = options.authSwitchHandler; + this.clientFlags = ConnectionConfig.mergeFlags( + ConnectionConfig.getDefaultFlags(options), + options.flags || '' + ); + // Default connection attributes + // https://dev.mysql.com/doc/refman/8.0/en/performance-schema-connection-attribute-tables.html + const defaultConnectAttributes = { + _client_name: 'Node-MySQL-2', + _client_version: version, + }; + this.connectAttributes = { + ...defaultConnectAttributes, + ...(options.connectAttributes || {}), + }; + this.maxPreparedStatements = options.maxPreparedStatements || 16000; + this.jsonStrings = options.jsonStrings || false; + } + + static mergeFlags(default_flags, user_flags) { + let flags = 0x0, + i; + if (!Array.isArray(user_flags)) { + user_flags = String(user_flags || '') + .toUpperCase() + .split(/\s*,+\s*/); + } + // add default flags unless "blacklisted" + for (i in default_flags) { + if (user_flags.indexOf(`-${default_flags[i]}`) >= 0) { + continue; + } + flags |= ClientConstants[default_flags[i]] || 0x0; + } + // add user flags unless already already added + for (i in user_flags) { + if (user_flags[i][0] === '-') { + continue; + } + if (default_flags.indexOf(user_flags[i]) >= 0) { + continue; + } + flags |= ClientConstants[user_flags[i]] || 0x0; + } + return flags; + } + + static getDefaultFlags(options) { + const defaultFlags = [ + 'LONG_PASSWORD', + 'FOUND_ROWS', + 'LONG_FLAG', + 'CONNECT_WITH_DB', + 'ODBC', + 'LOCAL_FILES', + 'IGNORE_SPACE', + 'PROTOCOL_41', + 'IGNORE_SIGPIPE', + 'TRANSACTIONS', + 'RESERVED', + 'SECURE_CONNECTION', + 'MULTI_RESULTS', + 'TRANSACTIONS', + 'SESSION_TRACK', + 'CONNECT_ATTRS', + ]; + if (options && options.multipleStatements) { + defaultFlags.push('MULTI_STATEMENTS'); + } + defaultFlags.push('PLUGIN_AUTH'); + defaultFlags.push('PLUGIN_AUTH_LENENC_CLIENT_DATA'); + + return defaultFlags; + } + + static getCharsetNumber(charset) { + const num = Charsets[charset.toUpperCase()]; + if (num === undefined) { + throw new TypeError(`Unknown charset '${charset}'`); + } + return num; + } + + static getSSLProfile(name) { + if (!SSLProfiles) { + SSLProfiles = require('./constants/ssl_profiles.js'); + } + const ssl = SSLProfiles[name]; + if (ssl === undefined) { + throw new TypeError(`Unknown SSL profile '${name}'`); + } + return ssl; + } + + static parseUrl(url) { + const parsedUrl = new URL(url); + const options = { + host: decodeURIComponent(parsedUrl.hostname), + port: parseInt(parsedUrl.port, 10), + database: decodeURIComponent(parsedUrl.pathname.slice(1)), + user: decodeURIComponent(parsedUrl.username), + password: decodeURIComponent(parsedUrl.password), + }; + parsedUrl.searchParams.forEach((value, key) => { + try { + // Try to parse this as a JSON expression first + options[key] = JSON.parse(value); + } catch (err) { + // Otherwise assume it is a plain string + options[key] = value; + } + }); + return options; + } +} + +module.exports = ConnectionConfig; diff --git a/node_modules/mysql2/lib/constants/charset_encodings.js b/node_modules/mysql2/lib/constants/charset_encodings.js new file mode 100644 index 0000000..7e9860f --- /dev/null +++ b/node_modules/mysql2/lib/constants/charset_encodings.js @@ -0,0 +1,316 @@ +'use strict'; + +// see tools/generate-charset-mapping.js +// basicalliy result of "SHOW COLLATION" query + +module.exports = [ + 'utf8', + 'big5', + 'latin2', + 'dec8', + 'cp850', + 'latin1', + 'hp8', + 'koi8r', + 'latin1', + 'latin2', + 'swe7', + 'ascii', + 'eucjp', + 'sjis', + 'cp1251', + 'latin1', + 'hebrew', + 'utf8', + 'tis620', + 'euckr', + 'latin7', + 'latin2', + 'koi8u', + 'cp1251', + 'gb2312', + 'greek', + 'cp1250', + 'latin2', + 'gbk', + 'cp1257', + 'latin5', + 'latin1', + 'armscii8', + 'cesu8', + 'cp1250', + 'ucs2', + 'cp866', + 'keybcs2', + 'macintosh', + 'macroman', + 'cp852', + 'latin7', + 'latin7', + 'macintosh', + 'cp1250', + 'utf8', + 'utf8', + 'latin1', + 'latin1', + 'latin1', + 'cp1251', + 'cp1251', + 'cp1251', + 'macroman', + 'utf16', + 'utf16', + 'utf16-le', + 'cp1256', + 'cp1257', + 'cp1257', + 'utf32', + 'utf32', + 'utf16-le', + 'binary', + 'armscii8', + 'ascii', + 'cp1250', + 'cp1256', + 'cp866', + 'dec8', + 'greek', + 'hebrew', + 'hp8', + 'keybcs2', + 'koi8r', + 'koi8u', + 'cesu8', + 'latin2', + 'latin5', + 'latin7', + 'cp850', + 'cp852', + 'swe7', + 'cesu8', + 'big5', + 'euckr', + 'gb2312', + 'gbk', + 'sjis', + 'tis620', + 'ucs2', + 'eucjp', + 'geostd8', + 'geostd8', + 'latin1', + 'cp932', + 'cp932', + 'eucjpms', + 'eucjpms', + 'cp1250', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf16', + 'utf8', + 'utf8', + 'utf8', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'ucs2', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'ucs2', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf32', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'cesu8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'cesu8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'gb18030', + 'gb18030', + 'gb18030', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', + 'utf8', +]; diff --git a/node_modules/mysql2/lib/constants/charsets.js b/node_modules/mysql2/lib/constants/charsets.js new file mode 100644 index 0000000..2cb0a97 --- /dev/null +++ b/node_modules/mysql2/lib/constants/charsets.js @@ -0,0 +1,317 @@ +'use strict'; + +exports.BIG5_CHINESE_CI = 1; +exports.LATIN2_CZECH_CS = 2; +exports.DEC8_SWEDISH_CI = 3; +exports.CP850_GENERAL_CI = 4; +exports.LATIN1_GERMAN1_CI = 5; +exports.HP8_ENGLISH_CI = 6; +exports.KOI8R_GENERAL_CI = 7; +exports.LATIN1_SWEDISH_CI = 8; +exports.LATIN2_GENERAL_CI = 9; +exports.SWE7_SWEDISH_CI = 10; +exports.ASCII_GENERAL_CI = 11; +exports.UJIS_JAPANESE_CI = 12; +exports.SJIS_JAPANESE_CI = 13; +exports.CP1251_BULGARIAN_CI = 14; +exports.LATIN1_DANISH_CI = 15; +exports.HEBREW_GENERAL_CI = 16; +exports.TIS620_THAI_CI = 18; +exports.EUCKR_KOREAN_CI = 19; +exports.LATIN7_ESTONIAN_CS = 20; +exports.LATIN2_HUNGARIAN_CI = 21; +exports.KOI8U_GENERAL_CI = 22; +exports.CP1251_UKRAINIAN_CI = 23; +exports.GB2312_CHINESE_CI = 24; +exports.GREEK_GENERAL_CI = 25; +exports.CP1250_GENERAL_CI = 26; +exports.LATIN2_CROATIAN_CI = 27; +exports.GBK_CHINESE_CI = 28; +exports.CP1257_LITHUANIAN_CI = 29; +exports.LATIN5_TURKISH_CI = 30; +exports.LATIN1_GERMAN2_CI = 31; +exports.ARMSCII8_GENERAL_CI = 32; +exports.UTF8_GENERAL_CI = 33; +exports.CP1250_CZECH_CS = 34; +exports.UCS2_GENERAL_CI = 35; +exports.CP866_GENERAL_CI = 36; +exports.KEYBCS2_GENERAL_CI = 37; +exports.MACCE_GENERAL_CI = 38; +exports.MACROMAN_GENERAL_CI = 39; +exports.CP852_GENERAL_CI = 40; +exports.LATIN7_GENERAL_CI = 41; +exports.LATIN7_GENERAL_CS = 42; +exports.MACCE_BIN = 43; +exports.CP1250_CROATIAN_CI = 44; +exports.UTF8MB4_GENERAL_CI = 45; +exports.UTF8MB4_BIN = 46; +exports.LATIN1_BIN = 47; +exports.LATIN1_GENERAL_CI = 48; +exports.LATIN1_GENERAL_CS = 49; +exports.CP1251_BIN = 50; +exports.CP1251_GENERAL_CI = 51; +exports.CP1251_GENERAL_CS = 52; +exports.MACROMAN_BIN = 53; +exports.UTF16_GENERAL_CI = 54; +exports.UTF16_BIN = 55; +exports.UTF16LE_GENERAL_CI = 56; +exports.CP1256_GENERAL_CI = 57; +exports.CP1257_BIN = 58; +exports.CP1257_GENERAL_CI = 59; +exports.UTF32_GENERAL_CI = 60; +exports.UTF32_BIN = 61; +exports.UTF16LE_BIN = 62; +exports.BINARY = 63; +exports.ARMSCII8_BIN = 64; +exports.ASCII_BIN = 65; +exports.CP1250_BIN = 66; +exports.CP1256_BIN = 67; +exports.CP866_BIN = 68; +exports.DEC8_BIN = 69; +exports.GREEK_BIN = 70; +exports.HEBREW_BIN = 71; +exports.HP8_BIN = 72; +exports.KEYBCS2_BIN = 73; +exports.KOI8R_BIN = 74; +exports.KOI8U_BIN = 75; +exports.UTF8_TOLOWER_CI = 76; +exports.LATIN2_BIN = 77; +exports.LATIN5_BIN = 78; +exports.LATIN7_BIN = 79; +exports.CP850_BIN = 80; +exports.CP852_BIN = 81; +exports.SWE7_BIN = 82; +exports.UTF8_BIN = 83; +exports.BIG5_BIN = 84; +exports.EUCKR_BIN = 85; +exports.GB2312_BIN = 86; +exports.GBK_BIN = 87; +exports.SJIS_BIN = 88; +exports.TIS620_BIN = 89; +exports.UCS2_BIN = 90; +exports.UJIS_BIN = 91; +exports.GEOSTD8_GENERAL_CI = 92; +exports.GEOSTD8_BIN = 93; +exports.LATIN1_SPANISH_CI = 94; +exports.CP932_JAPANESE_CI = 95; +exports.CP932_BIN = 96; +exports.EUCJPMS_JAPANESE_CI = 97; +exports.EUCJPMS_BIN = 98; +exports.CP1250_POLISH_CI = 99; +exports.UTF16_UNICODE_CI = 101; +exports.UTF16_ICELANDIC_CI = 102; +exports.UTF16_LATVIAN_CI = 103; +exports.UTF16_ROMANIAN_CI = 104; +exports.UTF16_SLOVENIAN_CI = 105; +exports.UTF16_POLISH_CI = 106; +exports.UTF16_ESTONIAN_CI = 107; +exports.UTF16_SPANISH_CI = 108; +exports.UTF16_SWEDISH_CI = 109; +exports.UTF16_TURKISH_CI = 110; +exports.UTF16_CZECH_CI = 111; +exports.UTF16_DANISH_CI = 112; +exports.UTF16_LITHUANIAN_CI = 113; +exports.UTF16_SLOVAK_CI = 114; +exports.UTF16_SPANISH2_CI = 115; +exports.UTF16_ROMAN_CI = 116; +exports.UTF16_PERSIAN_CI = 117; +exports.UTF16_ESPERANTO_CI = 118; +exports.UTF16_HUNGARIAN_CI = 119; +exports.UTF16_SINHALA_CI = 120; +exports.UTF16_GERMAN2_CI = 121; +exports.UTF16_CROATIAN_CI = 122; +exports.UTF16_UNICODE_520_CI = 123; +exports.UTF16_VIETNAMESE_CI = 124; +exports.UCS2_UNICODE_CI = 128; +exports.UCS2_ICELANDIC_CI = 129; +exports.UCS2_LATVIAN_CI = 130; +exports.UCS2_ROMANIAN_CI = 131; +exports.UCS2_SLOVENIAN_CI = 132; +exports.UCS2_POLISH_CI = 133; +exports.UCS2_ESTONIAN_CI = 134; +exports.UCS2_SPANISH_CI = 135; +exports.UCS2_SWEDISH_CI = 136; +exports.UCS2_TURKISH_CI = 137; +exports.UCS2_CZECH_CI = 138; +exports.UCS2_DANISH_CI = 139; +exports.UCS2_LITHUANIAN_CI = 140; +exports.UCS2_SLOVAK_CI = 141; +exports.UCS2_SPANISH2_CI = 142; +exports.UCS2_ROMAN_CI = 143; +exports.UCS2_PERSIAN_CI = 144; +exports.UCS2_ESPERANTO_CI = 145; +exports.UCS2_HUNGARIAN_CI = 146; +exports.UCS2_SINHALA_CI = 147; +exports.UCS2_GERMAN2_CI = 148; +exports.UCS2_CROATIAN_CI = 149; +exports.UCS2_UNICODE_520_CI = 150; +exports.UCS2_VIETNAMESE_CI = 151; +exports.UCS2_GENERAL_MYSQL500_CI = 159; +exports.UTF32_UNICODE_CI = 160; +exports.UTF32_ICELANDIC_CI = 161; +exports.UTF32_LATVIAN_CI = 162; +exports.UTF32_ROMANIAN_CI = 163; +exports.UTF32_SLOVENIAN_CI = 164; +exports.UTF32_POLISH_CI = 165; +exports.UTF32_ESTONIAN_CI = 166; +exports.UTF32_SPANISH_CI = 167; +exports.UTF32_SWEDISH_CI = 168; +exports.UTF32_TURKISH_CI = 169; +exports.UTF32_CZECH_CI = 170; +exports.UTF32_DANISH_CI = 171; +exports.UTF32_LITHUANIAN_CI = 172; +exports.UTF32_SLOVAK_CI = 173; +exports.UTF32_SPANISH2_CI = 174; +exports.UTF32_ROMAN_CI = 175; +exports.UTF32_PERSIAN_CI = 176; +exports.UTF32_ESPERANTO_CI = 177; +exports.UTF32_HUNGARIAN_CI = 178; +exports.UTF32_SINHALA_CI = 179; +exports.UTF32_GERMAN2_CI = 180; +exports.UTF32_CROATIAN_CI = 181; +exports.UTF32_UNICODE_520_CI = 182; +exports.UTF32_VIETNAMESE_CI = 183; +exports.UTF8_UNICODE_CI = 192; +exports.UTF8_ICELANDIC_CI = 193; +exports.UTF8_LATVIAN_CI = 194; +exports.UTF8_ROMANIAN_CI = 195; +exports.UTF8_SLOVENIAN_CI = 196; +exports.UTF8_POLISH_CI = 197; +exports.UTF8_ESTONIAN_CI = 198; +exports.UTF8_SPANISH_CI = 199; +exports.UTF8_SWEDISH_CI = 200; +exports.UTF8_TURKISH_CI = 201; +exports.UTF8_CZECH_CI = 202; +exports.UTF8_DANISH_CI = 203; +exports.UTF8_LITHUANIAN_CI = 204; +exports.UTF8_SLOVAK_CI = 205; +exports.UTF8_SPANISH2_CI = 206; +exports.UTF8_ROMAN_CI = 207; +exports.UTF8_PERSIAN_CI = 208; +exports.UTF8_ESPERANTO_CI = 209; +exports.UTF8_HUNGARIAN_CI = 210; +exports.UTF8_SINHALA_CI = 211; +exports.UTF8_GERMAN2_CI = 212; +exports.UTF8_CROATIAN_CI = 213; +exports.UTF8_UNICODE_520_CI = 214; +exports.UTF8_VIETNAMESE_CI = 215; +exports.UTF8_GENERAL_MYSQL500_CI = 223; +exports.UTF8MB4_UNICODE_CI = 224; +exports.UTF8MB4_ICELANDIC_CI = 225; +exports.UTF8MB4_LATVIAN_CI = 226; +exports.UTF8MB4_ROMANIAN_CI = 227; +exports.UTF8MB4_SLOVENIAN_CI = 228; +exports.UTF8MB4_POLISH_CI = 229; +exports.UTF8MB4_ESTONIAN_CI = 230; +exports.UTF8MB4_SPANISH_CI = 231; +exports.UTF8MB4_SWEDISH_CI = 232; +exports.UTF8MB4_TURKISH_CI = 233; +exports.UTF8MB4_CZECH_CI = 234; +exports.UTF8MB4_DANISH_CI = 235; +exports.UTF8MB4_LITHUANIAN_CI = 236; +exports.UTF8MB4_SLOVAK_CI = 237; +exports.UTF8MB4_SPANISH2_CI = 238; +exports.UTF8MB4_ROMAN_CI = 239; +exports.UTF8MB4_PERSIAN_CI = 240; +exports.UTF8MB4_ESPERANTO_CI = 241; +exports.UTF8MB4_HUNGARIAN_CI = 242; +exports.UTF8MB4_SINHALA_CI = 243; +exports.UTF8MB4_GERMAN2_CI = 244; +exports.UTF8MB4_CROATIAN_CI = 245; +exports.UTF8MB4_UNICODE_520_CI = 246; +exports.UTF8MB4_VIETNAMESE_CI = 247; +exports.GB18030_CHINESE_CI = 248; +exports.GB18030_BIN = 249; +exports.GB18030_UNICODE_520_CI = 250; +exports.UTF8_GENERAL50_CI = 253; // deprecated +exports.UTF8MB4_0900_AI_CI = 255; +exports.UTF8MB4_DE_PB_0900_AI_CI = 256; +exports.UTF8MB4_IS_0900_AI_CI = 257; +exports.UTF8MB4_LV_0900_AI_CI = 258; +exports.UTF8MB4_RO_0900_AI_CI = 259; +exports.UTF8MB4_SL_0900_AI_CI = 260; +exports.UTF8MB4_PL_0900_AI_CI = 261; +exports.UTF8MB4_ET_0900_AI_CI = 262; +exports.UTF8MB4_ES_0900_AI_CI = 263; +exports.UTF8MB4_SV_0900_AI_CI = 264; +exports.UTF8MB4_TR_0900_AI_CI = 265; +exports.UTF8MB4_CS_0900_AI_CI = 266; +exports.UTF8MB4_DA_0900_AI_CI = 267; +exports.UTF8MB4_LT_0900_AI_CI = 268; +exports.UTF8MB4_SK_0900_AI_CI = 269; +exports.UTF8MB4_ES_TRAD_0900_AI_CI = 270; +exports.UTF8MB4_LA_0900_AI_CI = 271; +exports.UTF8MB4_EO_0900_AI_CI = 273; +exports.UTF8MB4_HU_0900_AI_CI = 274; +exports.UTF8MB4_HR_0900_AI_CI = 275; +exports.UTF8MB4_VI_0900_AI_CI = 277; +exports.UTF8MB4_0900_AS_CS = 278; +exports.UTF8MB4_DE_PB_0900_AS_CS = 279; +exports.UTF8MB4_IS_0900_AS_CS = 280; +exports.UTF8MB4_LV_0900_AS_CS = 281; +exports.UTF8MB4_RO_0900_AS_CS = 282; +exports.UTF8MB4_SL_0900_AS_CS = 283; +exports.UTF8MB4_PL_0900_AS_CS = 284; +exports.UTF8MB4_ET_0900_AS_CS = 285; +exports.UTF8MB4_ES_0900_AS_CS = 286; +exports.UTF8MB4_SV_0900_AS_CS = 287; +exports.UTF8MB4_TR_0900_AS_CS = 288; +exports.UTF8MB4_CS_0900_AS_CS = 289; +exports.UTF8MB4_DA_0900_AS_CS = 290; +exports.UTF8MB4_LT_0900_AS_CS = 291; +exports.UTF8MB4_SK_0900_AS_CS = 292; +exports.UTF8MB4_ES_TRAD_0900_AS_CS = 293; +exports.UTF8MB4_LA_0900_AS_CS = 294; +exports.UTF8MB4_EO_0900_AS_CS = 296; +exports.UTF8MB4_HU_0900_AS_CS = 297; +exports.UTF8MB4_HR_0900_AS_CS = 298; +exports.UTF8MB4_VI_0900_AS_CS = 300; +exports.UTF8MB4_JA_0900_AS_CS = 303; +exports.UTF8MB4_JA_0900_AS_CS_KS = 304; +exports.UTF8MB4_0900_AS_CI = 305; +exports.UTF8MB4_RU_0900_AI_CI = 306; +exports.UTF8MB4_RU_0900_AS_CS = 307; +exports.UTF8MB4_ZH_0900_AS_CS = 308; +exports.UTF8MB4_0900_BIN = 309; + +// short aliases +exports.BIG5 = exports.BIG5_CHINESE_CI; +exports.DEC8 = exports.DEC8_SWEDISH_CI; +exports.CP850 = exports.CP850_GENERAL_CI; +exports.HP8 = exports.HP8_ENGLISH_CI; +exports.KOI8R = exports.KOI8R_GENERAL_CI; +exports.LATIN1 = exports.LATIN1_SWEDISH_CI; +exports.LATIN2 = exports.LATIN2_GENERAL_CI; +exports.SWE7 = exports.SWE7_SWEDISH_CI; +exports.ASCII = exports.ASCII_GENERAL_CI; +exports.UJIS = exports.UJIS_JAPANESE_CI; +exports.SJIS = exports.SJIS_JAPANESE_CI; +exports.HEBREW = exports.HEBREW_GENERAL_CI; +exports.TIS620 = exports.TIS620_THAI_CI; +exports.EUCKR = exports.EUCKR_KOREAN_CI; +exports.KOI8U = exports.KOI8U_GENERAL_CI; +exports.GB2312 = exports.GB2312_CHINESE_CI; +exports.GREEK = exports.GREEK_GENERAL_CI; +exports.CP1250 = exports.CP1250_GENERAL_CI; +exports.GBK = exports.GBK_CHINESE_CI; +exports.LATIN5 = exports.LATIN5_TURKISH_CI; +exports.ARMSCII8 = exports.ARMSCII8_GENERAL_CI; +exports.UTF8 = exports.UTF8_GENERAL_CI; +exports.UCS2 = exports.UCS2_GENERAL_CI; +exports.CP866 = exports.CP866_GENERAL_CI; +exports.KEYBCS2 = exports.KEYBCS2_GENERAL_CI; +exports.MACCE = exports.MACCE_GENERAL_CI; +exports.MACROMAN = exports.MACROMAN_GENERAL_CI; +exports.CP852 = exports.CP852_GENERAL_CI; +exports.LATIN7 = exports.LATIN7_GENERAL_CI; +exports.UTF8MB4 = exports.UTF8MB4_GENERAL_CI; +exports.CP1251 = exports.CP1251_GENERAL_CI; +exports.UTF16 = exports.UTF16_GENERAL_CI; +exports.UTF16LE = exports.UTF16LE_GENERAL_CI; +exports.CP1256 = exports.CP1256_GENERAL_CI; +exports.CP1257 = exports.CP1257_GENERAL_CI; +exports.UTF32 = exports.UTF32_GENERAL_CI; +exports.CP932 = exports.CP932_JAPANESE_CI; +exports.EUCJPMS = exports.EUCJPMS_JAPANESE_CI; +exports.GB18030 = exports.GB18030_CHINESE_CI; +exports.GEOSTD8 = exports.GEOSTD8_GENERAL_CI; diff --git a/node_modules/mysql2/lib/constants/client.js b/node_modules/mysql2/lib/constants/client.js new file mode 100644 index 0000000..6a6964d --- /dev/null +++ b/node_modules/mysql2/lib/constants/client.js @@ -0,0 +1,39 @@ +// This file was modified by Oracle on September 21, 2021. +// New capability for multi-factor authentication based on mandatory session +// trackers, that are signaled with an extra single-byte prefix on new +// versions of the MySQL server. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +// Manually extracted from mysql-5.5.23/include/mysql_com.h +exports.LONG_PASSWORD = 0x00000001; /* new more secure passwords */ +exports.FOUND_ROWS = 0x00000002; /* found instead of affected rows */ +exports.LONG_FLAG = 0x00000004; /* get all column flags */ +exports.CONNECT_WITH_DB = 0x00000008; /* one can specify db on connect */ +exports.NO_SCHEMA = 0x00000010; /* don't allow database.table.column */ +exports.COMPRESS = 0x00000020; /* can use compression protocol */ +exports.ODBC = 0x00000040; /* odbc client */ +exports.LOCAL_FILES = 0x00000080; /* can use LOAD DATA LOCAL */ +exports.IGNORE_SPACE = 0x00000100; /* ignore spaces before '' */ +exports.PROTOCOL_41 = 0x00000200; /* new 4.1 protocol */ +exports.INTERACTIVE = 0x00000400; /* this is an interactive client */ +exports.SSL = 0x00000800; /* switch to ssl after handshake */ +exports.IGNORE_SIGPIPE = 0x00001000; /* IGNORE sigpipes */ +exports.TRANSACTIONS = 0x00002000; /* client knows about transactions */ +exports.RESERVED = 0x00004000; /* old flag for 4.1 protocol */ +exports.SECURE_CONNECTION = 0x00008000; /* new 4.1 authentication */ +exports.MULTI_STATEMENTS = 0x00010000; /* enable/disable multi-stmt support */ +exports.MULTI_RESULTS = 0x00020000; /* enable/disable multi-results */ +exports.PS_MULTI_RESULTS = 0x00040000; /* multi-results in ps-protocol */ +exports.PLUGIN_AUTH = 0x00080000; /* client supports plugin authentication */ +exports.CONNECT_ATTRS = 0x00100000; /* permits connection attributes */ +exports.PLUGIN_AUTH_LENENC_CLIENT_DATA = 0x00200000; /* Understands length-encoded integer for auth response data in Protocol::HandshakeResponse41. */ +exports.CAN_HANDLE_EXPIRED_PASSWORDS = 0x00400000; /* Announces support for expired password extension. */ +exports.SESSION_TRACK = 0x00800000; /* Can set SERVER_SESSION_STATE_CHANGED in the Status Flags and send session-state change data after a OK packet. */ +exports.DEPRECATE_EOF = 0x01000000; /* Can send OK after a Text Resultset. */ + +exports.SSL_VERIFY_SERVER_CERT = 0x40000000; +exports.REMEMBER_OPTIONS = 0x80000000; + +exports.MULTI_FACTOR_AUTHENTICATION = 0x10000000; /* multi-factor authentication */ diff --git a/node_modules/mysql2/lib/constants/commands.js b/node_modules/mysql2/lib/constants/commands.js new file mode 100644 index 0000000..1e6f827 --- /dev/null +++ b/node_modules/mysql2/lib/constants/commands.js @@ -0,0 +1,36 @@ +'use strict'; + +module.exports = { + SLEEP: 0x00, // deprecated + QUIT: 0x01, + INIT_DB: 0x02, + QUERY: 0x03, + FIELD_LIST: 0x04, + CREATE_DB: 0x05, + DROP_DB: 0x06, + REFRESH: 0x07, + SHUTDOWN: 0x08, + STATISTICS: 0x09, + PROCESS_INFO: 0x0a, // deprecated + CONNECT: 0x0b, // deprecated + PROCESS_KILL: 0x0c, + DEBUG: 0x0d, + PING: 0x0e, + TIME: 0x0f, // deprecated + DELAYED_INSERT: 0x10, // deprecated + CHANGE_USER: 0x11, + BINLOG_DUMP: 0x12, + TABLE_DUMP: 0x13, + CONNECT_OUT: 0x14, + REGISTER_SLAVE: 0x15, + STMT_PREPARE: 0x16, + STMT_EXECUTE: 0x17, + STMT_SEND_LONG_DATA: 0x18, + STMT_CLOSE: 0x19, + STMT_RESET: 0x1a, + SET_OPTION: 0x1b, + STMT_FETCH: 0x1c, + DAEMON: 0x1d, // deprecated + BINLOG_DUMP_GTID: 0x1e, + UNKNOWN: 0xff, // bad! +}; diff --git a/node_modules/mysql2/lib/constants/cursor.js b/node_modules/mysql2/lib/constants/cursor.js new file mode 100644 index 0000000..86157d2 --- /dev/null +++ b/node_modules/mysql2/lib/constants/cursor.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = { + NO_CURSOR: 0, + READ_ONLY: 1, + FOR_UPDATE: 2, + SCROLLABLE: 3, +}; diff --git a/node_modules/mysql2/lib/constants/encoding_charset.js b/node_modules/mysql2/lib/constants/encoding_charset.js new file mode 100644 index 0000000..64045e6 --- /dev/null +++ b/node_modules/mysql2/lib/constants/encoding_charset.js @@ -0,0 +1,50 @@ +'use strict'; + +// inverse of charset_encodings +// given encoding, get matching mysql charset number + +module.exports = { + big5: 1, + latin2: 2, + dec8: 3, + cp850: 4, + latin1: 5, + hp8: 6, + koi8r: 7, + swe7: 10, + ascii: 11, + eucjp: 12, + sjis: 13, + cp1251: 14, + hebrew: 16, + tis620: 18, + euckr: 19, + latin7: 20, + koi8u: 22, + gb2312: 24, + greek: 25, + cp1250: 26, + gbk: 28, + cp1257: 29, + latin5: 30, + armscii8: 32, + cesu8: 33, + ucs2: 35, + cp866: 36, + keybcs2: 37, + macintosh: 38, + macroman: 39, + cp852: 40, + utf8: 45, + utf8mb4: 45, + utf16: 54, + utf16le: 56, + cp1256: 57, + utf32: 60, + binary: 63, + geostd8: 92, + cp932: 95, + eucjpms: 97, + gb18030: 248, + utf8mb3: 192, +}; diff --git a/node_modules/mysql2/lib/constants/errors.js b/node_modules/mysql2/lib/constants/errors.js new file mode 100644 index 0000000..b1d5927 --- /dev/null +++ b/node_modules/mysql2/lib/constants/errors.js @@ -0,0 +1,3973 @@ +// This file was modified by Oracle on June 1, 2021. +// An entry was created for a new error reported by the MySQL server due to +// client inactivity. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +// originally copied from https://raw.githubusercontent.com/mysqljs/mysql/7770ee5bb13260c56a160b91fe480d9165dbeeba/lib/protocol/constants/errors.js +// (c) node-mysql authors + +// updated to contain error codes as is contained in MySQL 8.0 +// by adapting node-mysql: /.../generate-error-constants.js + +/** + * MySQL error constants + * + * Extracted from version 8.0.33 + * + * !! Generated by generate-error-constants.js, do not modify by hand !! + */ + +exports.EE_CANTCREATEFILE = 1; +exports.EE_READ = 2; +exports.EE_WRITE = 3; +exports.EE_BADCLOSE = 4; +exports.EE_OUTOFMEMORY = 5; +exports.EE_DELETE = 6; +exports.EE_LINK = 7; +exports.EE_EOFERR = 9; +exports.EE_CANTLOCK = 10; +exports.EE_CANTUNLOCK = 11; +exports.EE_DIR = 12; +exports.EE_STAT = 13; +exports.EE_CANT_CHSIZE = 14; +exports.EE_CANT_OPEN_STREAM = 15; +exports.EE_GETWD = 16; +exports.EE_SETWD = 17; +exports.EE_LINK_WARNING = 18; +exports.EE_OPEN_WARNING = 19; +exports.EE_DISK_FULL = 20; +exports.EE_CANT_MKDIR = 21; +exports.EE_UNKNOWN_CHARSET = 22; +exports.EE_OUT_OF_FILERESOURCES = 23; +exports.EE_CANT_READLINK = 24; +exports.EE_CANT_SYMLINK = 25; +exports.EE_REALPATH = 26; +exports.EE_SYNC = 27; +exports.EE_UNKNOWN_COLLATION = 28; +exports.EE_FILENOTFOUND = 29; +exports.EE_FILE_NOT_CLOSED = 30; +exports.EE_CHANGE_OWNERSHIP = 31; +exports.EE_CHANGE_PERMISSIONS = 32; +exports.EE_CANT_SEEK = 33; +exports.EE_CAPACITY_EXCEEDED = 34; +exports.EE_DISK_FULL_WITH_RETRY_MSG = 35; +exports.EE_FAILED_TO_CREATE_TIMER = 36; +exports.EE_FAILED_TO_DELETE_TIMER = 37; +exports.EE_FAILED_TO_CREATE_TIMER_QUEUE = 38; +exports.EE_FAILED_TO_START_TIMER_NOTIFY_THREAD = 39; +exports.EE_FAILED_TO_CREATE_TIMER_NOTIFY_THREAD_INTERRUPT_EVENT = 40; +exports.EE_EXITING_TIMER_NOTIFY_THREAD = 41; +exports.EE_WIN_LIBRARY_LOAD_FAILED = 42; +exports.EE_WIN_RUN_TIME_ERROR_CHECK = 43; +exports.EE_FAILED_TO_DETERMINE_LARGE_PAGE_SIZE = 44; +exports.EE_FAILED_TO_KILL_ALL_THREADS = 45; +exports.EE_FAILED_TO_CREATE_IO_COMPLETION_PORT = 46; +exports.EE_FAILED_TO_OPEN_DEFAULTS_FILE = 47; +exports.EE_FAILED_TO_HANDLE_DEFAULTS_FILE = 48; +exports.EE_WRONG_DIRECTIVE_IN_CONFIG_FILE = 49; +exports.EE_SKIPPING_DIRECTIVE_DUE_TO_MAX_INCLUDE_RECURSION = 50; +exports.EE_INCORRECT_GRP_DEFINITION_IN_CONFIG_FILE = 51; +exports.EE_OPTION_WITHOUT_GRP_IN_CONFIG_FILE = 52; +exports.EE_CONFIG_FILE_PERMISSION_ERROR = 53; +exports.EE_IGNORE_WORLD_WRITABLE_CONFIG_FILE = 54; +exports.EE_USING_DISABLED_OPTION = 55; +exports.EE_USING_DISABLED_SHORT_OPTION = 56; +exports.EE_USING_PASSWORD_ON_CLI_IS_INSECURE = 57; +exports.EE_UNKNOWN_SUFFIX_FOR_VARIABLE = 58; +exports.EE_SSL_ERROR_FROM_FILE = 59; +exports.EE_SSL_ERROR = 60; +exports.EE_NET_SEND_ERROR_IN_BOOTSTRAP = 61; +exports.EE_PACKETS_OUT_OF_ORDER = 62; +exports.EE_UNKNOWN_PROTOCOL_OPTION = 63; +exports.EE_FAILED_TO_LOCATE_SERVER_PUBLIC_KEY = 64; +exports.EE_PUBLIC_KEY_NOT_IN_PEM_FORMAT = 65; +exports.EE_DEBUG_INFO = 66; +exports.EE_UNKNOWN_VARIABLE = 67; +exports.EE_UNKNOWN_OPTION = 68; +exports.EE_UNKNOWN_SHORT_OPTION = 69; +exports.EE_OPTION_WITHOUT_ARGUMENT = 70; +exports.EE_OPTION_REQUIRES_ARGUMENT = 71; +exports.EE_SHORT_OPTION_REQUIRES_ARGUMENT = 72; +exports.EE_OPTION_IGNORED_DUE_TO_INVALID_VALUE = 73; +exports.EE_OPTION_WITH_EMPTY_VALUE = 74; +exports.EE_FAILED_TO_ASSIGN_MAX_VALUE_TO_OPTION = 75; +exports.EE_INCORRECT_BOOLEAN_VALUE_FOR_OPTION = 76; +exports.EE_FAILED_TO_SET_OPTION_VALUE = 77; +exports.EE_INCORRECT_INT_VALUE_FOR_OPTION = 78; +exports.EE_INCORRECT_UINT_VALUE_FOR_OPTION = 79; +exports.EE_ADJUSTED_SIGNED_VALUE_FOR_OPTION = 80; +exports.EE_ADJUSTED_UNSIGNED_VALUE_FOR_OPTION = 81; +exports.EE_ADJUSTED_ULONGLONG_VALUE_FOR_OPTION = 82; +exports.EE_ADJUSTED_DOUBLE_VALUE_FOR_OPTION = 83; +exports.EE_INVALID_DECIMAL_VALUE_FOR_OPTION = 84; +exports.EE_COLLATION_PARSER_ERROR = 85; +exports.EE_FAILED_TO_RESET_BEFORE_PRIMARY_IGNORABLE_CHAR = 86; +exports.EE_FAILED_TO_RESET_BEFORE_TERTIARY_IGNORABLE_CHAR = 87; +exports.EE_SHIFT_CHAR_OUT_OF_RANGE = 88; +exports.EE_RESET_CHAR_OUT_OF_RANGE = 89; +exports.EE_UNKNOWN_LDML_TAG = 90; +exports.EE_FAILED_TO_RESET_BEFORE_SECONDARY_IGNORABLE_CHAR = 91; +exports.EE_FAILED_PROCESSING_DIRECTIVE = 92; +exports.EE_PTHREAD_KILL_FAILED = 93; +exports.HA_ERR_KEY_NOT_FOUND = 120; +exports.HA_ERR_FOUND_DUPP_KEY = 121; +exports.HA_ERR_INTERNAL_ERROR = 122; +exports.HA_ERR_RECORD_CHANGED = 123; +exports.HA_ERR_WRONG_INDEX = 124; +exports.HA_ERR_ROLLED_BACK = 125; +exports.HA_ERR_CRASHED = 126; +exports.HA_ERR_WRONG_IN_RECORD = 127; +exports.HA_ERR_OUT_OF_MEM = 128; +exports.HA_ERR_NOT_A_TABLE = 130; +exports.HA_ERR_WRONG_COMMAND = 131; +exports.HA_ERR_OLD_FILE = 132; +exports.HA_ERR_NO_ACTIVE_RECORD = 133; +exports.HA_ERR_RECORD_DELETED = 134; +exports.HA_ERR_RECORD_FILE_FULL = 135; +exports.HA_ERR_INDEX_FILE_FULL = 136; +exports.HA_ERR_END_OF_FILE = 137; +exports.HA_ERR_UNSUPPORTED = 138; +exports.HA_ERR_TOO_BIG_ROW = 139; +exports.HA_WRONG_CREATE_OPTION = 140; +exports.HA_ERR_FOUND_DUPP_UNIQUE = 141; +exports.HA_ERR_UNKNOWN_CHARSET = 142; +exports.HA_ERR_WRONG_MRG_TABLE_DEF = 143; +exports.HA_ERR_CRASHED_ON_REPAIR = 144; +exports.HA_ERR_CRASHED_ON_USAGE = 145; +exports.HA_ERR_LOCK_WAIT_TIMEOUT = 146; +exports.HA_ERR_LOCK_TABLE_FULL = 147; +exports.HA_ERR_READ_ONLY_TRANSACTION = 148; +exports.HA_ERR_LOCK_DEADLOCK = 149; +exports.HA_ERR_CANNOT_ADD_FOREIGN = 150; +exports.HA_ERR_NO_REFERENCED_ROW = 151; +exports.HA_ERR_ROW_IS_REFERENCED = 152; +exports.HA_ERR_NO_SAVEPOINT = 153; +exports.HA_ERR_NON_UNIQUE_BLOCK_SIZE = 154; +exports.HA_ERR_NO_SUCH_TABLE = 155; +exports.HA_ERR_TABLE_EXIST = 156; +exports.HA_ERR_NO_CONNECTION = 157; +exports.HA_ERR_NULL_IN_SPATIAL = 158; +exports.HA_ERR_TABLE_DEF_CHANGED = 159; +exports.HA_ERR_NO_PARTITION_FOUND = 160; +exports.HA_ERR_RBR_LOGGING_FAILED = 161; +exports.HA_ERR_DROP_INDEX_FK = 162; +exports.HA_ERR_FOREIGN_DUPLICATE_KEY = 163; +exports.HA_ERR_TABLE_NEEDS_UPGRADE = 164; +exports.HA_ERR_TABLE_READONLY = 165; +exports.HA_ERR_AUTOINC_READ_FAILED = 166; +exports.HA_ERR_AUTOINC_ERANGE = 167; +exports.HA_ERR_GENERIC = 168; +exports.HA_ERR_RECORD_IS_THE_SAME = 169; +exports.HA_ERR_LOGGING_IMPOSSIBLE = 170; +exports.HA_ERR_CORRUPT_EVENT = 171; +exports.HA_ERR_NEW_FILE = 172; +exports.HA_ERR_ROWS_EVENT_APPLY = 173; +exports.HA_ERR_INITIALIZATION = 174; +exports.HA_ERR_FILE_TOO_SHORT = 175; +exports.HA_ERR_WRONG_CRC = 176; +exports.HA_ERR_TOO_MANY_CONCURRENT_TRXS = 177; +exports.HA_ERR_NOT_IN_LOCK_PARTITIONS = 178; +exports.HA_ERR_INDEX_COL_TOO_LONG = 179; +exports.HA_ERR_INDEX_CORRUPT = 180; +exports.HA_ERR_UNDO_REC_TOO_BIG = 181; +exports.HA_FTS_INVALID_DOCID = 182; +exports.HA_ERR_TABLE_IN_FK_CHECK = 183; +exports.HA_ERR_TABLESPACE_EXISTS = 184; +exports.HA_ERR_TOO_MANY_FIELDS = 185; +exports.HA_ERR_ROW_IN_WRONG_PARTITION = 186; +exports.HA_ERR_INNODB_READ_ONLY = 187; +exports.HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT = 188; +exports.HA_ERR_TEMP_FILE_WRITE_FAILURE = 189; +exports.HA_ERR_INNODB_FORCED_RECOVERY = 190; +exports.HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE = 191; +exports.HA_ERR_FK_DEPTH_EXCEEDED = 192; +exports.HA_MISSING_CREATE_OPTION = 193; +exports.HA_ERR_SE_OUT_OF_MEMORY = 194; +exports.HA_ERR_TABLE_CORRUPT = 195; +exports.HA_ERR_QUERY_INTERRUPTED = 196; +exports.HA_ERR_TABLESPACE_MISSING = 197; +exports.HA_ERR_TABLESPACE_IS_NOT_EMPTY = 198; +exports.HA_ERR_WRONG_FILE_NAME = 199; +exports.HA_ERR_NOT_ALLOWED_COMMAND = 200; +exports.HA_ERR_COMPUTE_FAILED = 201; +exports.HA_ERR_ROW_FORMAT_CHANGED = 202; +exports.HA_ERR_NO_WAIT_LOCK = 203; +exports.HA_ERR_DISK_FULL_NOWAIT = 204; +exports.HA_ERR_NO_SESSION_TEMP = 205; +exports.HA_ERR_WRONG_TABLE_NAME = 206; +exports.HA_ERR_TOO_LONG_PATH = 207; +exports.HA_ERR_SAMPLING_INIT_FAILED = 208; +exports.HA_ERR_FTS_TOO_MANY_NESTED_EXP = 209; +exports.ER_HASHCHK = 1000; +exports.ER_NISAMCHK = 1001; +exports.ER_NO = 1002; +exports.ER_YES = 1003; +exports.ER_CANT_CREATE_FILE = 1004; +exports.ER_CANT_CREATE_TABLE = 1005; +exports.ER_CANT_CREATE_DB = 1006; +exports.ER_DB_CREATE_EXISTS = 1007; +exports.ER_DB_DROP_EXISTS = 1008; +exports.ER_DB_DROP_DELETE = 1009; +exports.ER_DB_DROP_RMDIR = 1010; +exports.ER_CANT_DELETE_FILE = 1011; +exports.ER_CANT_FIND_SYSTEM_REC = 1012; +exports.ER_CANT_GET_STAT = 1013; +exports.ER_CANT_GET_WD = 1014; +exports.ER_CANT_LOCK = 1015; +exports.ER_CANT_OPEN_FILE = 1016; +exports.ER_FILE_NOT_FOUND = 1017; +exports.ER_CANT_READ_DIR = 1018; +exports.ER_CANT_SET_WD = 1019; +exports.ER_CHECKREAD = 1020; +exports.ER_DISK_FULL = 1021; +exports.ER_DUP_KEY = 1022; +exports.ER_ERROR_ON_CLOSE = 1023; +exports.ER_ERROR_ON_READ = 1024; +exports.ER_ERROR_ON_RENAME = 1025; +exports.ER_ERROR_ON_WRITE = 1026; +exports.ER_FILE_USED = 1027; +exports.ER_FILSORT_ABORT = 1028; +exports.ER_FORM_NOT_FOUND = 1029; +exports.ER_GET_ERRNO = 1030; +exports.ER_ILLEGAL_HA = 1031; +exports.ER_KEY_NOT_FOUND = 1032; +exports.ER_NOT_FORM_FILE = 1033; +exports.ER_NOT_KEYFILE = 1034; +exports.ER_OLD_KEYFILE = 1035; +exports.ER_OPEN_AS_READONLY = 1036; +exports.ER_OUTOFMEMORY = 1037; +exports.ER_OUT_OF_SORTMEMORY = 1038; +exports.ER_UNEXPECTED_EOF = 1039; +exports.ER_CON_COUNT_ERROR = 1040; +exports.ER_OUT_OF_RESOURCES = 1041; +exports.ER_BAD_HOST_ERROR = 1042; +exports.ER_HANDSHAKE_ERROR = 1043; +exports.ER_DBACCESS_DENIED_ERROR = 1044; +exports.ER_ACCESS_DENIED_ERROR = 1045; +exports.ER_NO_DB_ERROR = 1046; +exports.ER_UNKNOWN_COM_ERROR = 1047; +exports.ER_BAD_NULL_ERROR = 1048; +exports.ER_BAD_DB_ERROR = 1049; +exports.ER_TABLE_EXISTS_ERROR = 1050; +exports.ER_BAD_TABLE_ERROR = 1051; +exports.ER_NON_UNIQ_ERROR = 1052; +exports.ER_SERVER_SHUTDOWN = 1053; +exports.ER_BAD_FIELD_ERROR = 1054; +exports.ER_WRONG_FIELD_WITH_GROUP = 1055; +exports.ER_WRONG_GROUP_FIELD = 1056; +exports.ER_WRONG_SUM_SELECT = 1057; +exports.ER_WRONG_VALUE_COUNT = 1058; +exports.ER_TOO_LONG_IDENT = 1059; +exports.ER_DUP_FIELDNAME = 1060; +exports.ER_DUP_KEYNAME = 1061; +exports.ER_DUP_ENTRY = 1062; +exports.ER_WRONG_FIELD_SPEC = 1063; +exports.ER_PARSE_ERROR = 1064; +exports.ER_EMPTY_QUERY = 1065; +exports.ER_NONUNIQ_TABLE = 1066; +exports.ER_INVALID_DEFAULT = 1067; +exports.ER_MULTIPLE_PRI_KEY = 1068; +exports.ER_TOO_MANY_KEYS = 1069; +exports.ER_TOO_MANY_KEY_PARTS = 1070; +exports.ER_TOO_LONG_KEY = 1071; +exports.ER_KEY_COLUMN_DOES_NOT_EXITS = 1072; +exports.ER_BLOB_USED_AS_KEY = 1073; +exports.ER_TOO_BIG_FIELDLENGTH = 1074; +exports.ER_WRONG_AUTO_KEY = 1075; +exports.ER_READY = 1076; +exports.ER_NORMAL_SHUTDOWN = 1077; +exports.ER_GOT_SIGNAL = 1078; +exports.ER_SHUTDOWN_COMPLETE = 1079; +exports.ER_FORCING_CLOSE = 1080; +exports.ER_IPSOCK_ERROR = 1081; +exports.ER_NO_SUCH_INDEX = 1082; +exports.ER_WRONG_FIELD_TERMINATORS = 1083; +exports.ER_BLOBS_AND_NO_TERMINATED = 1084; +exports.ER_TEXTFILE_NOT_READABLE = 1085; +exports.ER_FILE_EXISTS_ERROR = 1086; +exports.ER_LOAD_INFO = 1087; +exports.ER_ALTER_INFO = 1088; +exports.ER_WRONG_SUB_KEY = 1089; +exports.ER_CANT_REMOVE_ALL_FIELDS = 1090; +exports.ER_CANT_DROP_FIELD_OR_KEY = 1091; +exports.ER_INSERT_INFO = 1092; +exports.ER_UPDATE_TABLE_USED = 1093; +exports.ER_NO_SUCH_THREAD = 1094; +exports.ER_KILL_DENIED_ERROR = 1095; +exports.ER_NO_TABLES_USED = 1096; +exports.ER_TOO_BIG_SET = 1097; +exports.ER_NO_UNIQUE_LOGFILE = 1098; +exports.ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099; +exports.ER_TABLE_NOT_LOCKED = 1100; +exports.ER_BLOB_CANT_HAVE_DEFAULT = 1101; +exports.ER_WRONG_DB_NAME = 1102; +exports.ER_WRONG_TABLE_NAME = 1103; +exports.ER_TOO_BIG_SELECT = 1104; +exports.ER_UNKNOWN_ERROR = 1105; +exports.ER_UNKNOWN_PROCEDURE = 1106; +exports.ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107; +exports.ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108; +exports.ER_UNKNOWN_TABLE = 1109; +exports.ER_FIELD_SPECIFIED_TWICE = 1110; +exports.ER_INVALID_GROUP_FUNC_USE = 1111; +exports.ER_UNSUPPORTED_EXTENSION = 1112; +exports.ER_TABLE_MUST_HAVE_COLUMNS = 1113; +exports.ER_RECORD_FILE_FULL = 1114; +exports.ER_UNKNOWN_CHARACTER_SET = 1115; +exports.ER_TOO_MANY_TABLES = 1116; +exports.ER_TOO_MANY_FIELDS = 1117; +exports.ER_TOO_BIG_ROWSIZE = 1118; +exports.ER_STACK_OVERRUN = 1119; +exports.ER_WRONG_OUTER_JOIN = 1120; +exports.ER_NULL_COLUMN_IN_INDEX = 1121; +exports.ER_CANT_FIND_UDF = 1122; +exports.ER_CANT_INITIALIZE_UDF = 1123; +exports.ER_UDF_NO_PATHS = 1124; +exports.ER_UDF_EXISTS = 1125; +exports.ER_CANT_OPEN_LIBRARY = 1126; +exports.ER_CANT_FIND_DL_ENTRY = 1127; +exports.ER_FUNCTION_NOT_DEFINED = 1128; +exports.ER_HOST_IS_BLOCKED = 1129; +exports.ER_HOST_NOT_PRIVILEGED = 1130; +exports.ER_PASSWORD_ANONYMOUS_USER = 1131; +exports.ER_PASSWORD_NOT_ALLOWED = 1132; +exports.ER_PASSWORD_NO_MATCH = 1133; +exports.ER_UPDATE_INFO = 1134; +exports.ER_CANT_CREATE_THREAD = 1135; +exports.ER_WRONG_VALUE_COUNT_ON_ROW = 1136; +exports.ER_CANT_REOPEN_TABLE = 1137; +exports.ER_INVALID_USE_OF_NULL = 1138; +exports.ER_REGEXP_ERROR = 1139; +exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140; +exports.ER_NONEXISTING_GRANT = 1141; +exports.ER_TABLEACCESS_DENIED_ERROR = 1142; +exports.ER_COLUMNACCESS_DENIED_ERROR = 1143; +exports.ER_ILLEGAL_GRANT_FOR_TABLE = 1144; +exports.ER_GRANT_WRONG_HOST_OR_USER = 1145; +exports.ER_NO_SUCH_TABLE = 1146; +exports.ER_NONEXISTING_TABLE_GRANT = 1147; +exports.ER_NOT_ALLOWED_COMMAND = 1148; +exports.ER_SYNTAX_ERROR = 1149; +exports.ER_UNUSED1 = 1150; +exports.ER_UNUSED2 = 1151; +exports.ER_ABORTING_CONNECTION = 1152; +exports.ER_NET_PACKET_TOO_LARGE = 1153; +exports.ER_NET_READ_ERROR_FROM_PIPE = 1154; +exports.ER_NET_FCNTL_ERROR = 1155; +exports.ER_NET_PACKETS_OUT_OF_ORDER = 1156; +exports.ER_NET_UNCOMPRESS_ERROR = 1157; +exports.ER_NET_READ_ERROR = 1158; +exports.ER_NET_READ_INTERRUPTED = 1159; +exports.ER_NET_ERROR_ON_WRITE = 1160; +exports.ER_NET_WRITE_INTERRUPTED = 1161; +exports.ER_TOO_LONG_STRING = 1162; +exports.ER_TABLE_CANT_HANDLE_BLOB = 1163; +exports.ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164; +exports.ER_UNUSED3 = 1165; +exports.ER_WRONG_COLUMN_NAME = 1166; +exports.ER_WRONG_KEY_COLUMN = 1167; +exports.ER_WRONG_MRG_TABLE = 1168; +exports.ER_DUP_UNIQUE = 1169; +exports.ER_BLOB_KEY_WITHOUT_LENGTH = 1170; +exports.ER_PRIMARY_CANT_HAVE_NULL = 1171; +exports.ER_TOO_MANY_ROWS = 1172; +exports.ER_REQUIRES_PRIMARY_KEY = 1173; +exports.ER_NO_RAID_COMPILED = 1174; +exports.ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175; +exports.ER_KEY_DOES_NOT_EXITS = 1176; +exports.ER_CHECK_NO_SUCH_TABLE = 1177; +exports.ER_CHECK_NOT_IMPLEMENTED = 1178; +exports.ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179; +exports.ER_ERROR_DURING_COMMIT = 1180; +exports.ER_ERROR_DURING_ROLLBACK = 1181; +exports.ER_ERROR_DURING_FLUSH_LOGS = 1182; +exports.ER_ERROR_DURING_CHECKPOINT = 1183; +exports.ER_NEW_ABORTING_CONNECTION = 1184; +exports.ER_DUMP_NOT_IMPLEMENTED = 1185; +exports.ER_FLUSH_MASTER_BINLOG_CLOSED = 1186; +exports.ER_INDEX_REBUILD = 1187; +exports.ER_SOURCE = 1188; +exports.ER_SOURCE_NET_READ = 1189; +exports.ER_SOURCE_NET_WRITE = 1190; +exports.ER_FT_MATCHING_KEY_NOT_FOUND = 1191; +exports.ER_LOCK_OR_ACTIVE_TRANSACTION = 1192; +exports.ER_UNKNOWN_SYSTEM_VARIABLE = 1193; +exports.ER_CRASHED_ON_USAGE = 1194; +exports.ER_CRASHED_ON_REPAIR = 1195; +exports.ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196; +exports.ER_TRANS_CACHE_FULL = 1197; +exports.ER_SLAVE_MUST_STOP = 1198; +exports.ER_REPLICA_NOT_RUNNING = 1199; +exports.ER_BAD_REPLICA = 1200; +exports.ER_CONNECTION_METADATA = 1201; +exports.ER_REPLICA_THREAD = 1202; +exports.ER_TOO_MANY_USER_CONNECTIONS = 1203; +exports.ER_SET_CONSTANTS_ONLY = 1204; +exports.ER_LOCK_WAIT_TIMEOUT = 1205; +exports.ER_LOCK_TABLE_FULL = 1206; +exports.ER_READ_ONLY_TRANSACTION = 1207; +exports.ER_DROP_DB_WITH_READ_LOCK = 1208; +exports.ER_CREATE_DB_WITH_READ_LOCK = 1209; +exports.ER_WRONG_ARGUMENTS = 1210; +exports.ER_NO_PERMISSION_TO_CREATE_USER = 1211; +exports.ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212; +exports.ER_LOCK_DEADLOCK = 1213; +exports.ER_TABLE_CANT_HANDLE_FT = 1214; +exports.ER_CANNOT_ADD_FOREIGN = 1215; +exports.ER_NO_REFERENCED_ROW = 1216; +exports.ER_ROW_IS_REFERENCED = 1217; +exports.ER_CONNECT_TO_SOURCE = 1218; +exports.ER_QUERY_ON_MASTER = 1219; +exports.ER_ERROR_WHEN_EXECUTING_COMMAND = 1220; +exports.ER_WRONG_USAGE = 1221; +exports.ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222; +exports.ER_CANT_UPDATE_WITH_READLOCK = 1223; +exports.ER_MIXING_NOT_ALLOWED = 1224; +exports.ER_DUP_ARGUMENT = 1225; +exports.ER_USER_LIMIT_REACHED = 1226; +exports.ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227; +exports.ER_LOCAL_VARIABLE = 1228; +exports.ER_GLOBAL_VARIABLE = 1229; +exports.ER_NO_DEFAULT = 1230; +exports.ER_WRONG_VALUE_FOR_VAR = 1231; +exports.ER_WRONG_TYPE_FOR_VAR = 1232; +exports.ER_VAR_CANT_BE_READ = 1233; +exports.ER_CANT_USE_OPTION_HERE = 1234; +exports.ER_NOT_SUPPORTED_YET = 1235; +exports.ER_SOURCE_FATAL_ERROR_READING_BINLOG = 1236; +exports.ER_REPLICA_IGNORED_TABLE = 1237; +exports.ER_INCORRECT_GLOBAL_LOCAL_VAR = 1238; +exports.ER_WRONG_FK_DEF = 1239; +exports.ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240; +exports.ER_OPERAND_COLUMNS = 1241; +exports.ER_SUBQUERY_NO_1_ROW = 1242; +exports.ER_UNKNOWN_STMT_HANDLER = 1243; +exports.ER_CORRUPT_HELP_DB = 1244; +exports.ER_CYCLIC_REFERENCE = 1245; +exports.ER_AUTO_CONVERT = 1246; +exports.ER_ILLEGAL_REFERENCE = 1247; +exports.ER_DERIVED_MUST_HAVE_ALIAS = 1248; +exports.ER_SELECT_REDUCED = 1249; +exports.ER_TABLENAME_NOT_ALLOWED_HERE = 1250; +exports.ER_NOT_SUPPORTED_AUTH_MODE = 1251; +exports.ER_SPATIAL_CANT_HAVE_NULL = 1252; +exports.ER_COLLATION_CHARSET_MISMATCH = 1253; +exports.ER_SLAVE_WAS_RUNNING = 1254; +exports.ER_SLAVE_WAS_NOT_RUNNING = 1255; +exports.ER_TOO_BIG_FOR_UNCOMPRESS = 1256; +exports.ER_ZLIB_Z_MEM_ERROR = 1257; +exports.ER_ZLIB_Z_BUF_ERROR = 1258; +exports.ER_ZLIB_Z_DATA_ERROR = 1259; +exports.ER_CUT_VALUE_GROUP_CONCAT = 1260; +exports.ER_WARN_TOO_FEW_RECORDS = 1261; +exports.ER_WARN_TOO_MANY_RECORDS = 1262; +exports.ER_WARN_NULL_TO_NOTNULL = 1263; +exports.ER_WARN_DATA_OUT_OF_RANGE = 1264; +exports.WARN_DATA_TRUNCATED = 1265; +exports.ER_WARN_USING_OTHER_HANDLER = 1266; +exports.ER_CANT_AGGREGATE_2COLLATIONS = 1267; +exports.ER_DROP_USER = 1268; +exports.ER_REVOKE_GRANTS = 1269; +exports.ER_CANT_AGGREGATE_3COLLATIONS = 1270; +exports.ER_CANT_AGGREGATE_NCOLLATIONS = 1271; +exports.ER_VARIABLE_IS_NOT_STRUCT = 1272; +exports.ER_UNKNOWN_COLLATION = 1273; +exports.ER_REPLICA_IGNORED_SSL_PARAMS = 1274; +exports.ER_SERVER_IS_IN_SECURE_AUTH_MODE = 1275; +exports.ER_WARN_FIELD_RESOLVED = 1276; +exports.ER_BAD_REPLICA_UNTIL_COND = 1277; +exports.ER_MISSING_SKIP_REPLICA = 1278; +exports.ER_UNTIL_COND_IGNORED = 1279; +exports.ER_WRONG_NAME_FOR_INDEX = 1280; +exports.ER_WRONG_NAME_FOR_CATALOG = 1281; +exports.ER_WARN_QC_RESIZE = 1282; +exports.ER_BAD_FT_COLUMN = 1283; +exports.ER_UNKNOWN_KEY_CACHE = 1284; +exports.ER_WARN_HOSTNAME_WONT_WORK = 1285; +exports.ER_UNKNOWN_STORAGE_ENGINE = 1286; +exports.ER_WARN_DEPRECATED_SYNTAX = 1287; +exports.ER_NON_UPDATABLE_TABLE = 1288; +exports.ER_FEATURE_DISABLED = 1289; +exports.ER_OPTION_PREVENTS_STATEMENT = 1290; +exports.ER_DUPLICATED_VALUE_IN_TYPE = 1291; +exports.ER_TRUNCATED_WRONG_VALUE = 1292; +exports.ER_TOO_MUCH_AUTO_TIMESTAMP_COLS = 1293; +exports.ER_INVALID_ON_UPDATE = 1294; +exports.ER_UNSUPPORTED_PS = 1295; +exports.ER_GET_ERRMSG = 1296; +exports.ER_GET_TEMPORARY_ERRMSG = 1297; +exports.ER_UNKNOWN_TIME_ZONE = 1298; +exports.ER_WARN_INVALID_TIMESTAMP = 1299; +exports.ER_INVALID_CHARACTER_STRING = 1300; +exports.ER_WARN_ALLOWED_PACKET_OVERFLOWED = 1301; +exports.ER_CONFLICTING_DECLARATIONS = 1302; +exports.ER_SP_NO_RECURSIVE_CREATE = 1303; +exports.ER_SP_ALREADY_EXISTS = 1304; +exports.ER_SP_DOES_NOT_EXIST = 1305; +exports.ER_SP_DROP_FAILED = 1306; +exports.ER_SP_STORE_FAILED = 1307; +exports.ER_SP_LILABEL_MISMATCH = 1308; +exports.ER_SP_LABEL_REDEFINE = 1309; +exports.ER_SP_LABEL_MISMATCH = 1310; +exports.ER_SP_UNINIT_VAR = 1311; +exports.ER_SP_BADSELECT = 1312; +exports.ER_SP_BADRETURN = 1313; +exports.ER_SP_BADSTATEMENT = 1314; +exports.ER_UPDATE_LOG_DEPRECATED_IGNORED = 1315; +exports.ER_UPDATE_LOG_DEPRECATED_TRANSLATED = 1316; +exports.ER_QUERY_INTERRUPTED = 1317; +exports.ER_SP_WRONG_NO_OF_ARGS = 1318; +exports.ER_SP_COND_MISMATCH = 1319; +exports.ER_SP_NORETURN = 1320; +exports.ER_SP_NORETURNEND = 1321; +exports.ER_SP_BAD_CURSOR_QUERY = 1322; +exports.ER_SP_BAD_CURSOR_SELECT = 1323; +exports.ER_SP_CURSOR_MISMATCH = 1324; +exports.ER_SP_CURSOR_ALREADY_OPEN = 1325; +exports.ER_SP_CURSOR_NOT_OPEN = 1326; +exports.ER_SP_UNDECLARED_VAR = 1327; +exports.ER_SP_WRONG_NO_OF_FETCH_ARGS = 1328; +exports.ER_SP_FETCH_NO_DATA = 1329; +exports.ER_SP_DUP_PARAM = 1330; +exports.ER_SP_DUP_VAR = 1331; +exports.ER_SP_DUP_COND = 1332; +exports.ER_SP_DUP_CURS = 1333; +exports.ER_SP_CANT_ALTER = 1334; +exports.ER_SP_SUBSELECT_NYI = 1335; +exports.ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG = 1336; +exports.ER_SP_VARCOND_AFTER_CURSHNDLR = 1337; +exports.ER_SP_CURSOR_AFTER_HANDLER = 1338; +exports.ER_SP_CASE_NOT_FOUND = 1339; +exports.ER_FPARSER_TOO_BIG_FILE = 1340; +exports.ER_FPARSER_BAD_HEADER = 1341; +exports.ER_FPARSER_EOF_IN_COMMENT = 1342; +exports.ER_FPARSER_ERROR_IN_PARAMETER = 1343; +exports.ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER = 1344; +exports.ER_VIEW_NO_EXPLAIN = 1345; +exports.ER_FRM_UNKNOWN_TYPE = 1346; +exports.ER_WRONG_OBJECT = 1347; +exports.ER_NONUPDATEABLE_COLUMN = 1348; +exports.ER_VIEW_SELECT_DERIVED = 1349; +exports.ER_VIEW_SELECT_CLAUSE = 1350; +exports.ER_VIEW_SELECT_VARIABLE = 1351; +exports.ER_VIEW_SELECT_TMPTABLE = 1352; +exports.ER_VIEW_WRONG_LIST = 1353; +exports.ER_WARN_VIEW_MERGE = 1354; +exports.ER_WARN_VIEW_WITHOUT_KEY = 1355; +exports.ER_VIEW_INVALID = 1356; +exports.ER_SP_NO_DROP_SP = 1357; +exports.ER_SP_GOTO_IN_HNDLR = 1358; +exports.ER_TRG_ALREADY_EXISTS = 1359; +exports.ER_TRG_DOES_NOT_EXIST = 1360; +exports.ER_TRG_ON_VIEW_OR_TEMP_TABLE = 1361; +exports.ER_TRG_CANT_CHANGE_ROW = 1362; +exports.ER_TRG_NO_SUCH_ROW_IN_TRG = 1363; +exports.ER_NO_DEFAULT_FOR_FIELD = 1364; +exports.ER_DIVISION_BY_ZERO = 1365; +exports.ER_TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366; +exports.ER_ILLEGAL_VALUE_FOR_TYPE = 1367; +exports.ER_VIEW_NONUPD_CHECK = 1368; +exports.ER_VIEW_CHECK_FAILED = 1369; +exports.ER_PROCACCESS_DENIED_ERROR = 1370; +exports.ER_RELAY_LOG_FAIL = 1371; +exports.ER_PASSWD_LENGTH = 1372; +exports.ER_UNKNOWN_TARGET_BINLOG = 1373; +exports.ER_IO_ERR_LOG_INDEX_READ = 1374; +exports.ER_BINLOG_PURGE_PROHIBITED = 1375; +exports.ER_FSEEK_FAIL = 1376; +exports.ER_BINLOG_PURGE_FATAL_ERR = 1377; +exports.ER_LOG_IN_USE = 1378; +exports.ER_LOG_PURGE_UNKNOWN_ERR = 1379; +exports.ER_RELAY_LOG_INIT = 1380; +exports.ER_NO_BINARY_LOGGING = 1381; +exports.ER_RESERVED_SYNTAX = 1382; +exports.ER_WSAS_FAILED = 1383; +exports.ER_DIFF_GROUPS_PROC = 1384; +exports.ER_NO_GROUP_FOR_PROC = 1385; +exports.ER_ORDER_WITH_PROC = 1386; +exports.ER_LOGGING_PROHIBIT_CHANGING_OF = 1387; +exports.ER_NO_FILE_MAPPING = 1388; +exports.ER_WRONG_MAGIC = 1389; +exports.ER_PS_MANY_PARAM = 1390; +exports.ER_KEY_PART_0 = 1391; +exports.ER_VIEW_CHECKSUM = 1392; +exports.ER_VIEW_MULTIUPDATE = 1393; +exports.ER_VIEW_NO_INSERT_FIELD_LIST = 1394; +exports.ER_VIEW_DELETE_MERGE_VIEW = 1395; +exports.ER_CANNOT_USER = 1396; +exports.ER_XAER_NOTA = 1397; +exports.ER_XAER_INVAL = 1398; +exports.ER_XAER_RMFAIL = 1399; +exports.ER_XAER_OUTSIDE = 1400; +exports.ER_XAER_RMERR = 1401; +exports.ER_XA_RBROLLBACK = 1402; +exports.ER_NONEXISTING_PROC_GRANT = 1403; +exports.ER_PROC_AUTO_GRANT_FAIL = 1404; +exports.ER_PROC_AUTO_REVOKE_FAIL = 1405; +exports.ER_DATA_TOO_LONG = 1406; +exports.ER_SP_BAD_SQLSTATE = 1407; +exports.ER_STARTUP = 1408; +exports.ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = 1409; +exports.ER_CANT_CREATE_USER_WITH_GRANT = 1410; +exports.ER_WRONG_VALUE_FOR_TYPE = 1411; +exports.ER_TABLE_DEF_CHANGED = 1412; +exports.ER_SP_DUP_HANDLER = 1413; +exports.ER_SP_NOT_VAR_ARG = 1414; +exports.ER_SP_NO_RETSET = 1415; +exports.ER_CANT_CREATE_GEOMETRY_OBJECT = 1416; +exports.ER_FAILED_ROUTINE_BREAK_BINLOG = 1417; +exports.ER_BINLOG_UNSAFE_ROUTINE = 1418; +exports.ER_BINLOG_CREATE_ROUTINE_NEED_SUPER = 1419; +exports.ER_EXEC_STMT_WITH_OPEN_CURSOR = 1420; +exports.ER_STMT_HAS_NO_OPEN_CURSOR = 1421; +exports.ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = 1422; +exports.ER_NO_DEFAULT_FOR_VIEW_FIELD = 1423; +exports.ER_SP_NO_RECURSION = 1424; +exports.ER_TOO_BIG_SCALE = 1425; +exports.ER_TOO_BIG_PRECISION = 1426; +exports.ER_M_BIGGER_THAN_D = 1427; +exports.ER_WRONG_LOCK_OF_SYSTEM_TABLE = 1428; +exports.ER_CONNECT_TO_FOREIGN_DATA_SOURCE = 1429; +exports.ER_QUERY_ON_FOREIGN_DATA_SOURCE = 1430; +exports.ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST = 1431; +exports.ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE = 1432; +exports.ER_FOREIGN_DATA_STRING_INVALID = 1433; +exports.ER_CANT_CREATE_FEDERATED_TABLE = 1434; +exports.ER_TRG_IN_WRONG_SCHEMA = 1435; +exports.ER_STACK_OVERRUN_NEED_MORE = 1436; +exports.ER_TOO_LONG_BODY = 1437; +exports.ER_WARN_CANT_DROP_DEFAULT_KEYCACHE = 1438; +exports.ER_TOO_BIG_DISPLAYWIDTH = 1439; +exports.ER_XAER_DUPID = 1440; +exports.ER_DATETIME_FUNCTION_OVERFLOW = 1441; +exports.ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = 1442; +exports.ER_VIEW_PREVENT_UPDATE = 1443; +exports.ER_PS_NO_RECURSION = 1444; +exports.ER_SP_CANT_SET_AUTOCOMMIT = 1445; +exports.ER_MALFORMED_DEFINER = 1446; +exports.ER_VIEW_FRM_NO_USER = 1447; +exports.ER_VIEW_OTHER_USER = 1448; +exports.ER_NO_SUCH_USER = 1449; +exports.ER_FORBID_SCHEMA_CHANGE = 1450; +exports.ER_ROW_IS_REFERENCED_2 = 1451; +exports.ER_NO_REFERENCED_ROW_2 = 1452; +exports.ER_SP_BAD_VAR_SHADOW = 1453; +exports.ER_TRG_NO_DEFINER = 1454; +exports.ER_OLD_FILE_FORMAT = 1455; +exports.ER_SP_RECURSION_LIMIT = 1456; +exports.ER_SP_PROC_TABLE_CORRUPT = 1457; +exports.ER_SP_WRONG_NAME = 1458; +exports.ER_TABLE_NEEDS_UPGRADE = 1459; +exports.ER_SP_NO_AGGREGATE = 1460; +exports.ER_MAX_PREPARED_STMT_COUNT_REACHED = 1461; +exports.ER_VIEW_RECURSIVE = 1462; +exports.ER_NON_GROUPING_FIELD_USED = 1463; +exports.ER_TABLE_CANT_HANDLE_SPKEYS = 1464; +exports.ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA = 1465; +exports.ER_REMOVED_SPACES = 1466; +exports.ER_AUTOINC_READ_FAILED = 1467; +exports.ER_USERNAME = 1468; +exports.ER_HOSTNAME = 1469; +exports.ER_WRONG_STRING_LENGTH = 1470; +exports.ER_NON_INSERTABLE_TABLE = 1471; +exports.ER_ADMIN_WRONG_MRG_TABLE = 1472; +exports.ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT = 1473; +exports.ER_NAME_BECOMES_EMPTY = 1474; +exports.ER_AMBIGUOUS_FIELD_TERM = 1475; +exports.ER_FOREIGN_SERVER_EXISTS = 1476; +exports.ER_FOREIGN_SERVER_DOESNT_EXIST = 1477; +exports.ER_ILLEGAL_HA_CREATE_OPTION = 1478; +exports.ER_PARTITION_REQUIRES_VALUES_ERROR = 1479; +exports.ER_PARTITION_WRONG_VALUES_ERROR = 1480; +exports.ER_PARTITION_MAXVALUE_ERROR = 1481; +exports.ER_PARTITION_SUBPARTITION_ERROR = 1482; +exports.ER_PARTITION_SUBPART_MIX_ERROR = 1483; +exports.ER_PARTITION_WRONG_NO_PART_ERROR = 1484; +exports.ER_PARTITION_WRONG_NO_SUBPART_ERROR = 1485; +exports.ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR = 1486; +exports.ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR = 1487; +exports.ER_FIELD_NOT_FOUND_PART_ERROR = 1488; +exports.ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR = 1489; +exports.ER_INCONSISTENT_PARTITION_INFO_ERROR = 1490; +exports.ER_PARTITION_FUNC_NOT_ALLOWED_ERROR = 1491; +exports.ER_PARTITIONS_MUST_BE_DEFINED_ERROR = 1492; +exports.ER_RANGE_NOT_INCREASING_ERROR = 1493; +exports.ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR = 1494; +exports.ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR = 1495; +exports.ER_PARTITION_ENTRY_ERROR = 1496; +exports.ER_MIX_HANDLER_ERROR = 1497; +exports.ER_PARTITION_NOT_DEFINED_ERROR = 1498; +exports.ER_TOO_MANY_PARTITIONS_ERROR = 1499; +exports.ER_SUBPARTITION_ERROR = 1500; +exports.ER_CANT_CREATE_HANDLER_FILE = 1501; +exports.ER_BLOB_FIELD_IN_PART_FUNC_ERROR = 1502; +exports.ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF = 1503; +exports.ER_NO_PARTS_ERROR = 1504; +exports.ER_PARTITION_MGMT_ON_NONPARTITIONED = 1505; +exports.ER_FOREIGN_KEY_ON_PARTITIONED = 1506; +exports.ER_DROP_PARTITION_NON_EXISTENT = 1507; +exports.ER_DROP_LAST_PARTITION = 1508; +exports.ER_COALESCE_ONLY_ON_HASH_PARTITION = 1509; +exports.ER_REORG_HASH_ONLY_ON_SAME_NO = 1510; +exports.ER_REORG_NO_PARAM_ERROR = 1511; +exports.ER_ONLY_ON_RANGE_LIST_PARTITION = 1512; +exports.ER_ADD_PARTITION_SUBPART_ERROR = 1513; +exports.ER_ADD_PARTITION_NO_NEW_PARTITION = 1514; +exports.ER_COALESCE_PARTITION_NO_PARTITION = 1515; +exports.ER_REORG_PARTITION_NOT_EXIST = 1516; +exports.ER_SAME_NAME_PARTITION = 1517; +exports.ER_NO_BINLOG_ERROR = 1518; +exports.ER_CONSECUTIVE_REORG_PARTITIONS = 1519; +exports.ER_REORG_OUTSIDE_RANGE = 1520; +exports.ER_PARTITION_FUNCTION_FAILURE = 1521; +exports.ER_PART_STATE_ERROR = 1522; +exports.ER_LIMITED_PART_RANGE = 1523; +exports.ER_PLUGIN_IS_NOT_LOADED = 1524; +exports.ER_WRONG_VALUE = 1525; +exports.ER_NO_PARTITION_FOR_GIVEN_VALUE = 1526; +exports.ER_FILEGROUP_OPTION_ONLY_ONCE = 1527; +exports.ER_CREATE_FILEGROUP_FAILED = 1528; +exports.ER_DROP_FILEGROUP_FAILED = 1529; +exports.ER_TABLESPACE_AUTO_EXTEND_ERROR = 1530; +exports.ER_WRONG_SIZE_NUMBER = 1531; +exports.ER_SIZE_OVERFLOW_ERROR = 1532; +exports.ER_ALTER_FILEGROUP_FAILED = 1533; +exports.ER_BINLOG_ROW_LOGGING_FAILED = 1534; +exports.ER_BINLOG_ROW_WRONG_TABLE_DEF = 1535; +exports.ER_BINLOG_ROW_RBR_TO_SBR = 1536; +exports.ER_EVENT_ALREADY_EXISTS = 1537; +exports.ER_EVENT_STORE_FAILED = 1538; +exports.ER_EVENT_DOES_NOT_EXIST = 1539; +exports.ER_EVENT_CANT_ALTER = 1540; +exports.ER_EVENT_DROP_FAILED = 1541; +exports.ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG = 1542; +exports.ER_EVENT_ENDS_BEFORE_STARTS = 1543; +exports.ER_EVENT_EXEC_TIME_IN_THE_PAST = 1544; +exports.ER_EVENT_OPEN_TABLE_FAILED = 1545; +exports.ER_EVENT_NEITHER_M_EXPR_NOR_M_AT = 1546; +exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED = 1547; +exports.ER_CANNOT_LOAD_FROM_TABLE = 1548; +exports.ER_EVENT_CANNOT_DELETE = 1549; +exports.ER_EVENT_COMPILE_ERROR = 1550; +exports.ER_EVENT_SAME_NAME = 1551; +exports.ER_EVENT_DATA_TOO_LONG = 1552; +exports.ER_DROP_INDEX_FK = 1553; +exports.ER_WARN_DEPRECATED_SYNTAX_WITH_VER = 1554; +exports.ER_CANT_WRITE_LOCK_LOG_TABLE = 1555; +exports.ER_CANT_LOCK_LOG_TABLE = 1556; +exports.ER_FOREIGN_DUPLICATE_KEY = 1557; +exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE = 1558; +exports.ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR = 1559; +exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1560; +exports.ER_NDB_CANT_SWITCH_BINLOG_FORMAT = 1561; +exports.ER_PARTITION_NO_TEMPORARY = 1562; +exports.ER_PARTITION_CONST_DOMAIN_ERROR = 1563; +exports.ER_PARTITION_FUNCTION_IS_NOT_ALLOWED = 1564; +exports.ER_DDL_LOG_ERROR = 1565; +exports.ER_NULL_IN_VALUES_LESS_THAN = 1566; +exports.ER_WRONG_PARTITION_NAME = 1567; +exports.ER_CANT_CHANGE_TX_CHARACTERISTICS = 1568; +exports.ER_DUP_ENTRY_AUTOINCREMENT_CASE = 1569; +exports.ER_EVENT_MODIFY_QUEUE_ERROR = 1570; +exports.ER_EVENT_SET_VAR_ERROR = 1571; +exports.ER_PARTITION_MERGE_ERROR = 1572; +exports.ER_CANT_ACTIVATE_LOG = 1573; +exports.ER_RBR_NOT_AVAILABLE = 1574; +exports.ER_BASE64_DECODE_ERROR = 1575; +exports.ER_EVENT_RECURSION_FORBIDDEN = 1576; +exports.ER_EVENTS_DB_ERROR = 1577; +exports.ER_ONLY_INTEGERS_ALLOWED = 1578; +exports.ER_UNSUPORTED_LOG_ENGINE = 1579; +exports.ER_BAD_LOG_STATEMENT = 1580; +exports.ER_CANT_RENAME_LOG_TABLE = 1581; +exports.ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT = 1582; +exports.ER_WRONG_PARAMETERS_TO_NATIVE_FCT = 1583; +exports.ER_WRONG_PARAMETERS_TO_STORED_FCT = 1584; +exports.ER_NATIVE_FCT_NAME_COLLISION = 1585; +exports.ER_DUP_ENTRY_WITH_KEY_NAME = 1586; +exports.ER_BINLOG_PURGE_EMFILE = 1587; +exports.ER_EVENT_CANNOT_CREATE_IN_THE_PAST = 1588; +exports.ER_EVENT_CANNOT_ALTER_IN_THE_PAST = 1589; +exports.ER_SLAVE_INCIDENT = 1590; +exports.ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT = 1591; +exports.ER_BINLOG_UNSAFE_STATEMENT = 1592; +exports.ER_BINLOG_FATAL_ERROR = 1593; +exports.ER_SLAVE_RELAY_LOG_READ_FAILURE = 1594; +exports.ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 1595; +exports.ER_SLAVE_CREATE_EVENT_FAILURE = 1596; +exports.ER_SLAVE_MASTER_COM_FAILURE = 1597; +exports.ER_BINLOG_LOGGING_IMPOSSIBLE = 1598; +exports.ER_VIEW_NO_CREATION_CTX = 1599; +exports.ER_VIEW_INVALID_CREATION_CTX = 1600; +exports.ER_SR_INVALID_CREATION_CTX = 1601; +exports.ER_TRG_CORRUPTED_FILE = 1602; +exports.ER_TRG_NO_CREATION_CTX = 1603; +exports.ER_TRG_INVALID_CREATION_CTX = 1604; +exports.ER_EVENT_INVALID_CREATION_CTX = 1605; +exports.ER_TRG_CANT_OPEN_TABLE = 1606; +exports.ER_CANT_CREATE_SROUTINE = 1607; +exports.ER_NEVER_USED = 1608; +exports.ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT = 1609; +exports.ER_REPLICA_CORRUPT_EVENT = 1610; +exports.ER_LOAD_DATA_INVALID_COLUMN = 1611; +exports.ER_LOG_PURGE_NO_FILE = 1612; +exports.ER_XA_RBTIMEOUT = 1613; +exports.ER_XA_RBDEADLOCK = 1614; +exports.ER_NEED_REPREPARE = 1615; +exports.ER_DELAYED_NOT_SUPPORTED = 1616; +exports.WARN_NO_CONNECTION_METADATA = 1617; +exports.WARN_OPTION_IGNORED = 1618; +exports.ER_PLUGIN_DELETE_BUILTIN = 1619; +exports.WARN_PLUGIN_BUSY = 1620; +exports.ER_VARIABLE_IS_READONLY = 1621; +exports.ER_WARN_ENGINE_TRANSACTION_ROLLBACK = 1622; +exports.ER_SLAVE_HEARTBEAT_FAILURE = 1623; +exports.ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE = 1624; +exports.ER_NDB_REPLICATION_SCHEMA_ERROR = 1625; +exports.ER_CONFLICT_FN_PARSE_ERROR = 1626; +exports.ER_EXCEPTIONS_WRITE_ERROR = 1627; +exports.ER_TOO_LONG_TABLE_COMMENT = 1628; +exports.ER_TOO_LONG_FIELD_COMMENT = 1629; +exports.ER_FUNC_INEXISTENT_NAME_COLLISION = 1630; +exports.ER_DATABASE_NAME = 1631; +exports.ER_TABLE_NAME = 1632; +exports.ER_PARTITION_NAME = 1633; +exports.ER_SUBPARTITION_NAME = 1634; +exports.ER_TEMPORARY_NAME = 1635; +exports.ER_RENAMED_NAME = 1636; +exports.ER_TOO_MANY_CONCURRENT_TRXS = 1637; +exports.WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED = 1638; +exports.ER_DEBUG_SYNC_TIMEOUT = 1639; +exports.ER_DEBUG_SYNC_HIT_LIMIT = 1640; +exports.ER_DUP_SIGNAL_SET = 1641; +exports.ER_SIGNAL_WARN = 1642; +exports.ER_SIGNAL_NOT_FOUND = 1643; +exports.ER_SIGNAL_EXCEPTION = 1644; +exports.ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER = 1645; +exports.ER_SIGNAL_BAD_CONDITION_TYPE = 1646; +exports.WARN_COND_ITEM_TRUNCATED = 1647; +exports.ER_COND_ITEM_TOO_LONG = 1648; +exports.ER_UNKNOWN_LOCALE = 1649; +exports.ER_REPLICA_IGNORE_SERVER_IDS = 1650; +exports.ER_QUERY_CACHE_DISABLED = 1651; +exports.ER_SAME_NAME_PARTITION_FIELD = 1652; +exports.ER_PARTITION_COLUMN_LIST_ERROR = 1653; +exports.ER_WRONG_TYPE_COLUMN_VALUE_ERROR = 1654; +exports.ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR = 1655; +exports.ER_MAXVALUE_IN_VALUES_IN = 1656; +exports.ER_TOO_MANY_VALUES_ERROR = 1657; +exports.ER_ROW_SINGLE_PARTITION_FIELD_ERROR = 1658; +exports.ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD = 1659; +exports.ER_PARTITION_FIELDS_TOO_LONG = 1660; +exports.ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE = 1661; +exports.ER_BINLOG_ROW_MODE_AND_STMT_ENGINE = 1662; +exports.ER_BINLOG_UNSAFE_AND_STMT_ENGINE = 1663; +exports.ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE = 1664; +exports.ER_BINLOG_STMT_MODE_AND_ROW_ENGINE = 1665; +exports.ER_BINLOG_ROW_INJECTION_AND_STMT_MODE = 1666; +exports.ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1667; +exports.ER_BINLOG_UNSAFE_LIMIT = 1668; +exports.ER_UNUSED4 = 1669; +exports.ER_BINLOG_UNSAFE_SYSTEM_TABLE = 1670; +exports.ER_BINLOG_UNSAFE_AUTOINC_COLUMNS = 1671; +exports.ER_BINLOG_UNSAFE_UDF = 1672; +exports.ER_BINLOG_UNSAFE_SYSTEM_VARIABLE = 1673; +exports.ER_BINLOG_UNSAFE_SYSTEM_FUNCTION = 1674; +exports.ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS = 1675; +exports.ER_MESSAGE_AND_STATEMENT = 1676; +exports.ER_SLAVE_CONVERSION_FAILED = 1677; +exports.ER_REPLICA_CANT_CREATE_CONVERSION = 1678; +exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1679; +exports.ER_PATH_LENGTH = 1680; +exports.ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT = 1681; +exports.ER_WRONG_NATIVE_TABLE_STRUCTURE = 1682; +exports.ER_WRONG_PERFSCHEMA_USAGE = 1683; +exports.ER_WARN_I_S_SKIPPED_TABLE = 1684; +exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1685; +exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1686; +exports.ER_SPATIAL_MUST_HAVE_GEOM_COL = 1687; +exports.ER_TOO_LONG_INDEX_COMMENT = 1688; +exports.ER_LOCK_ABORTED = 1689; +exports.ER_DATA_OUT_OF_RANGE = 1690; +exports.ER_WRONG_SPVAR_TYPE_IN_LIMIT = 1691; +exports.ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1692; +exports.ER_BINLOG_UNSAFE_MIXED_STATEMENT = 1693; +exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1694; +exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1695; +exports.ER_FAILED_READ_FROM_PAR_FILE = 1696; +exports.ER_VALUES_IS_NOT_INT_TYPE_ERROR = 1697; +exports.ER_ACCESS_DENIED_NO_PASSWORD_ERROR = 1698; +exports.ER_SET_PASSWORD_AUTH_PLUGIN = 1699; +exports.ER_GRANT_PLUGIN_USER_EXISTS = 1700; +exports.ER_TRUNCATE_ILLEGAL_FK = 1701; +exports.ER_PLUGIN_IS_PERMANENT = 1702; +exports.ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN = 1703; +exports.ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX = 1704; +exports.ER_STMT_CACHE_FULL = 1705; +exports.ER_MULTI_UPDATE_KEY_CONFLICT = 1706; +exports.ER_TABLE_NEEDS_REBUILD = 1707; +exports.WARN_OPTION_BELOW_LIMIT = 1708; +exports.ER_INDEX_COLUMN_TOO_LONG = 1709; +exports.ER_ERROR_IN_TRIGGER_BODY = 1710; +exports.ER_ERROR_IN_UNKNOWN_TRIGGER_BODY = 1711; +exports.ER_INDEX_CORRUPT = 1712; +exports.ER_UNDO_RECORD_TOO_BIG = 1713; +exports.ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT = 1714; +exports.ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE = 1715; +exports.ER_BINLOG_UNSAFE_REPLACE_SELECT = 1716; +exports.ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT = 1717; +exports.ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT = 1718; +exports.ER_BINLOG_UNSAFE_UPDATE_IGNORE = 1719; +exports.ER_PLUGIN_NO_UNINSTALL = 1720; +exports.ER_PLUGIN_NO_INSTALL = 1721; +exports.ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT = 1722; +exports.ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC = 1723; +exports.ER_BINLOG_UNSAFE_INSERT_TWO_KEYS = 1724; +exports.ER_TABLE_IN_FK_CHECK = 1725; +exports.ER_UNSUPPORTED_ENGINE = 1726; +exports.ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST = 1727; +exports.ER_CANNOT_LOAD_FROM_TABLE_V2 = 1728; +exports.ER_SOURCE_DELAY_VALUE_OUT_OF_RANGE = 1729; +exports.ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT = 1730; +exports.ER_PARTITION_EXCHANGE_DIFFERENT_OPTION = 1731; +exports.ER_PARTITION_EXCHANGE_PART_TABLE = 1732; +exports.ER_PARTITION_EXCHANGE_TEMP_TABLE = 1733; +exports.ER_PARTITION_INSTEAD_OF_SUBPARTITION = 1734; +exports.ER_UNKNOWN_PARTITION = 1735; +exports.ER_TABLES_DIFFERENT_METADATA = 1736; +exports.ER_ROW_DOES_NOT_MATCH_PARTITION = 1737; +exports.ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX = 1738; +exports.ER_WARN_INDEX_NOT_APPLICABLE = 1739; +exports.ER_PARTITION_EXCHANGE_FOREIGN_KEY = 1740; +exports.ER_NO_SUCH_KEY_VALUE = 1741; +exports.ER_RPL_INFO_DATA_TOO_LONG = 1742; +exports.ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 1743; +exports.ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE = 1744; +exports.ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX = 1745; +exports.ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT = 1746; +exports.ER_PARTITION_CLAUSE_ON_NONPARTITIONED = 1747; +exports.ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET = 1748; +exports.ER_NO_SUCH_PARTITION = 1749; +exports.ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE = 1750; +exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE = 1751; +exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE = 1752; +exports.ER_MTA_FEATURE_IS_NOT_SUPPORTED = 1753; +exports.ER_MTA_UPDATED_DBS_GREATER_MAX = 1754; +exports.ER_MTA_CANT_PARALLEL = 1755; +exports.ER_MTA_INCONSISTENT_DATA = 1756; +exports.ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING = 1757; +exports.ER_DA_INVALID_CONDITION_NUMBER = 1758; +exports.ER_INSECURE_PLAIN_TEXT = 1759; +exports.ER_INSECURE_CHANGE_SOURCE = 1760; +exports.ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO = 1761; +exports.ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO = 1762; +exports.ER_SQLTHREAD_WITH_SECURE_REPLICA = 1763; +exports.ER_TABLE_HAS_NO_FT = 1764; +exports.ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER = 1765; +exports.ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION = 1766; +exports.ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST = 1767; +exports.ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION = 1768; +exports.ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION = 1769; +exports.ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL = 1770; +exports.ER_SKIPPING_LOGGED_TRANSACTION = 1771; +exports.ER_MALFORMED_GTID_SET_SPECIFICATION = 1772; +exports.ER_MALFORMED_GTID_SET_ENCODING = 1773; +exports.ER_MALFORMED_GTID_SPECIFICATION = 1774; +exports.ER_GNO_EXHAUSTED = 1775; +exports.ER_BAD_REPLICA_AUTO_POSITION = 1776; +exports.ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF = 1777; +exports.ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET = 1778; +exports.ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 1779; +exports.ER_GTID_MODE_REQUIRES_BINLOG = 1780; +exports.ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF = 1781; +exports.ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON = 1782; +exports.ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF = 1783; +exports.ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF = 1784; +exports.ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE = 1785; +exports.ER_GTID_UNSAFE_CREATE_SELECT = 1786; +exports.ER_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRANSACTION = 1787; +exports.ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME = 1788; +exports.ER_SOURCE_HAS_PURGED_REQUIRED_GTIDS = 1789; +exports.ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID = 1790; +exports.ER_UNKNOWN_EXPLAIN_FORMAT = 1791; +exports.ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION = 1792; +exports.ER_TOO_LONG_TABLE_PARTITION_COMMENT = 1793; +exports.ER_REPLICA_CONFIGURATION = 1794; +exports.ER_INNODB_FT_LIMIT = 1795; +exports.ER_INNODB_NO_FT_TEMP_TABLE = 1796; +exports.ER_INNODB_FT_WRONG_DOCID_COLUMN = 1797; +exports.ER_INNODB_FT_WRONG_DOCID_INDEX = 1798; +exports.ER_INNODB_ONLINE_LOG_TOO_BIG = 1799; +exports.ER_UNKNOWN_ALTER_ALGORITHM = 1800; +exports.ER_UNKNOWN_ALTER_LOCK = 1801; +exports.ER_MTA_CHANGE_SOURCE_CANT_RUN_WITH_GAPS = 1802; +exports.ER_MTA_RECOVERY_FAILURE = 1803; +exports.ER_MTA_RESET_WORKERS = 1804; +exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 1805; +exports.ER_REPLICA_SILENT_RETRY_TRANSACTION = 1806; +exports.ER_DISCARD_FK_CHECKS_RUNNING = 1807; +exports.ER_TABLE_SCHEMA_MISMATCH = 1808; +exports.ER_TABLE_IN_SYSTEM_TABLESPACE = 1809; +exports.ER_IO_READ_ERROR = 1810; +exports.ER_IO_WRITE_ERROR = 1811; +exports.ER_TABLESPACE_MISSING = 1812; +exports.ER_TABLESPACE_EXISTS = 1813; +exports.ER_TABLESPACE_DISCARDED = 1814; +exports.ER_INTERNAL_ERROR = 1815; +exports.ER_INNODB_IMPORT_ERROR = 1816; +exports.ER_INNODB_INDEX_CORRUPT = 1817; +exports.ER_INVALID_YEAR_COLUMN_LENGTH = 1818; +exports.ER_NOT_VALID_PASSWORD = 1819; +exports.ER_MUST_CHANGE_PASSWORD = 1820; +exports.ER_FK_NO_INDEX_CHILD = 1821; +exports.ER_FK_NO_INDEX_PARENT = 1822; +exports.ER_FK_FAIL_ADD_SYSTEM = 1823; +exports.ER_FK_CANNOT_OPEN_PARENT = 1824; +exports.ER_FK_INCORRECT_OPTION = 1825; +exports.ER_FK_DUP_NAME = 1826; +exports.ER_PASSWORD_FORMAT = 1827; +exports.ER_FK_COLUMN_CANNOT_DROP = 1828; +exports.ER_FK_COLUMN_CANNOT_DROP_CHILD = 1829; +exports.ER_FK_COLUMN_NOT_NULL = 1830; +exports.ER_DUP_INDEX = 1831; +exports.ER_FK_COLUMN_CANNOT_CHANGE = 1832; +exports.ER_FK_COLUMN_CANNOT_CHANGE_CHILD = 1833; +exports.ER_UNUSED5 = 1834; +exports.ER_MALFORMED_PACKET = 1835; +exports.ER_READ_ONLY_MODE = 1836; +exports.ER_GTID_NEXT_TYPE_UNDEFINED_GTID = 1837; +exports.ER_VARIABLE_NOT_SETTABLE_IN_SP = 1838; +exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF = 1839; +exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY = 1840; +exports.ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY = 1841; +exports.ER_GTID_PURGED_WAS_CHANGED = 1842; +exports.ER_GTID_EXECUTED_WAS_CHANGED = 1843; +exports.ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES = 1844; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED = 1845; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON = 1846; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY = 1847; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION = 1848; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME = 1849; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE = 1850; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK = 1851; +exports.ER_UNUSED6 = 1852; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK = 1853; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC = 1854; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS = 1855; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS = 1856; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS = 1857; +exports.ER_SQL_REPLICA_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE = 1858; +exports.ER_DUP_UNKNOWN_IN_INDEX = 1859; +exports.ER_IDENT_CAUSES_TOO_LONG_PATH = 1860; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL = 1861; +exports.ER_MUST_CHANGE_PASSWORD_LOGIN = 1862; +exports.ER_ROW_IN_WRONG_PARTITION = 1863; +exports.ER_MTA_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX = 1864; +exports.ER_INNODB_NO_FT_USES_PARSER = 1865; +exports.ER_BINLOG_LOGICAL_CORRUPTION = 1866; +exports.ER_WARN_PURGE_LOG_IN_USE = 1867; +exports.ER_WARN_PURGE_LOG_IS_ACTIVE = 1868; +exports.ER_AUTO_INCREMENT_CONFLICT = 1869; +exports.WARN_ON_BLOCKHOLE_IN_RBR = 1870; +exports.ER_REPLICA_CM_INIT_REPOSITORY = 1871; +exports.ER_REPLICA_AM_INIT_REPOSITORY = 1872; +exports.ER_ACCESS_DENIED_CHANGE_USER_ERROR = 1873; +exports.ER_INNODB_READ_ONLY = 1874; +exports.ER_STOP_REPLICA_SQL_THREAD_TIMEOUT = 1875; +exports.ER_STOP_REPLICA_IO_THREAD_TIMEOUT = 1876; +exports.ER_TABLE_CORRUPT = 1877; +exports.ER_TEMP_FILE_WRITE_FAILURE = 1878; +exports.ER_INNODB_FT_AUX_NOT_HEX_ID = 1879; +exports.ER_OLD_TEMPORALS_UPGRADED = 1880; +exports.ER_INNODB_FORCED_RECOVERY = 1881; +exports.ER_AES_INVALID_IV = 1882; +exports.ER_PLUGIN_CANNOT_BE_UNINSTALLED = 1883; +exports.ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_ASSIGNED_GTID = 1884; +exports.ER_REPLICA_HAS_MORE_GTIDS_THAN_SOURCE = 1885; +exports.ER_MISSING_KEY = 1886; +exports.WARN_NAMED_PIPE_ACCESS_EVERYONE = 1887; +exports.ER_FILE_CORRUPT = 3000; +exports.ER_ERROR_ON_SOURCE = 3001; +exports.ER_INCONSISTENT_ERROR = 3002; +exports.ER_STORAGE_ENGINE_NOT_LOADED = 3003; +exports.ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER = 3004; +exports.ER_WARN_LEGACY_SYNTAX_CONVERTED = 3005; +exports.ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN = 3006; +exports.ER_CANNOT_DISCARD_TEMPORARY_TABLE = 3007; +exports.ER_FK_DEPTH_EXCEEDED = 3008; +exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 3009; +exports.ER_WARN_TRIGGER_DOESNT_HAVE_CREATED = 3010; +exports.ER_REFERENCED_TRG_DOES_NOT_EXIST = 3011; +exports.ER_EXPLAIN_NOT_SUPPORTED = 3012; +exports.ER_INVALID_FIELD_SIZE = 3013; +exports.ER_MISSING_HA_CREATE_OPTION = 3014; +exports.ER_ENGINE_OUT_OF_MEMORY = 3015; +exports.ER_PASSWORD_EXPIRE_ANONYMOUS_USER = 3016; +exports.ER_REPLICA_SQL_THREAD_MUST_STOP = 3017; +exports.ER_NO_FT_MATERIALIZED_SUBQUERY = 3018; +exports.ER_INNODB_UNDO_LOG_FULL = 3019; +exports.ER_INVALID_ARGUMENT_FOR_LOGARITHM = 3020; +exports.ER_REPLICA_CHANNEL_IO_THREAD_MUST_STOP = 3021; +exports.ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO = 3022; +exports.ER_WARN_ONLY_SOURCE_LOG_FILE_NO_POS = 3023; +exports.ER_QUERY_TIMEOUT = 3024; +exports.ER_NON_RO_SELECT_DISABLE_TIMER = 3025; +exports.ER_DUP_LIST_ENTRY = 3026; +exports.ER_SQL_MODE_NO_EFFECT = 3027; +exports.ER_AGGREGATE_ORDER_FOR_UNION = 3028; +exports.ER_AGGREGATE_ORDER_NON_AGG_QUERY = 3029; +exports.ER_REPLICA_WORKER_STOPPED_PREVIOUS_THD_ERROR = 3030; +exports.ER_DONT_SUPPORT_REPLICA_PRESERVE_COMMIT_ORDER = 3031; +exports.ER_SERVER_OFFLINE_MODE = 3032; +exports.ER_GIS_DIFFERENT_SRIDS = 3033; +exports.ER_GIS_UNSUPPORTED_ARGUMENT = 3034; +exports.ER_GIS_UNKNOWN_ERROR = 3035; +exports.ER_GIS_UNKNOWN_EXCEPTION = 3036; +exports.ER_GIS_INVALID_DATA = 3037; +exports.ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION = 3038; +exports.ER_BOOST_GEOMETRY_CENTROID_EXCEPTION = 3039; +exports.ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION = 3040; +exports.ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION = 3041; +exports.ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION = 3042; +exports.ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION = 3043; +exports.ER_STD_BAD_ALLOC_ERROR = 3044; +exports.ER_STD_DOMAIN_ERROR = 3045; +exports.ER_STD_LENGTH_ERROR = 3046; +exports.ER_STD_INVALID_ARGUMENT = 3047; +exports.ER_STD_OUT_OF_RANGE_ERROR = 3048; +exports.ER_STD_OVERFLOW_ERROR = 3049; +exports.ER_STD_RANGE_ERROR = 3050; +exports.ER_STD_UNDERFLOW_ERROR = 3051; +exports.ER_STD_LOGIC_ERROR = 3052; +exports.ER_STD_RUNTIME_ERROR = 3053; +exports.ER_STD_UNKNOWN_EXCEPTION = 3054; +exports.ER_GIS_DATA_WRONG_ENDIANESS = 3055; +exports.ER_CHANGE_SOURCE_PASSWORD_LENGTH = 3056; +exports.ER_USER_LOCK_WRONG_NAME = 3057; +exports.ER_USER_LOCK_DEADLOCK = 3058; +exports.ER_REPLACE_INACCESSIBLE_ROWS = 3059; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS = 3060; +exports.ER_ILLEGAL_USER_VAR = 3061; +exports.ER_GTID_MODE_OFF = 3062; +exports.ER_UNSUPPORTED_BY_REPLICATION_THREAD = 3063; +exports.ER_INCORRECT_TYPE = 3064; +exports.ER_FIELD_IN_ORDER_NOT_SELECT = 3065; +exports.ER_AGGREGATE_IN_ORDER_NOT_SELECT = 3066; +exports.ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN = 3067; +exports.ER_NET_OK_PACKET_TOO_LARGE = 3068; +exports.ER_INVALID_JSON_DATA = 3069; +exports.ER_INVALID_GEOJSON_MISSING_MEMBER = 3070; +exports.ER_INVALID_GEOJSON_WRONG_TYPE = 3071; +exports.ER_INVALID_GEOJSON_UNSPECIFIED = 3072; +exports.ER_DIMENSION_UNSUPPORTED = 3073; +exports.ER_REPLICA_CHANNEL_DOES_NOT_EXIST = 3074; +exports.ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT = 3075; +exports.ER_REPLICA_CHANNEL_NAME_INVALID_OR_TOO_LONG = 3076; +exports.ER_REPLICA_NEW_CHANNEL_WRONG_REPOSITORY = 3077; +exports.ER_SLAVE_CHANNEL_DELETE = 3078; +exports.ER_REPLICA_MULTIPLE_CHANNELS_CMD = 3079; +exports.ER_REPLICA_MAX_CHANNELS_EXCEEDED = 3080; +exports.ER_REPLICA_CHANNEL_MUST_STOP = 3081; +exports.ER_REPLICA_CHANNEL_NOT_RUNNING = 3082; +exports.ER_REPLICA_CHANNEL_WAS_RUNNING = 3083; +exports.ER_REPLICA_CHANNEL_WAS_NOT_RUNNING = 3084; +exports.ER_REPLICA_CHANNEL_SQL_THREAD_MUST_STOP = 3085; +exports.ER_REPLICA_CHANNEL_SQL_SKIP_COUNTER = 3086; +exports.ER_WRONG_FIELD_WITH_GROUP_V2 = 3087; +exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2 = 3088; +exports.ER_WARN_DEPRECATED_SYSVAR_UPDATE = 3089; +exports.ER_WARN_DEPRECATED_SQLMODE = 3090; +exports.ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID = 3091; +exports.ER_GROUP_REPLICATION_CONFIGURATION = 3092; +exports.ER_GROUP_REPLICATION_RUNNING = 3093; +exports.ER_GROUP_REPLICATION_APPLIER_INIT_ERROR = 3094; +exports.ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT = 3095; +exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR = 3096; +exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR = 3097; +exports.ER_BEFORE_DML_VALIDATION_ERROR = 3098; +exports.ER_PREVENTS_VARIABLE_WITHOUT_RBR = 3099; +exports.ER_RUN_HOOK_ERROR = 3100; +exports.ER_TRANSACTION_ROLLBACK_DURING_COMMIT = 3101; +exports.ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED = 3102; +exports.ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN = 3103; +exports.ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN = 3104; +exports.ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN = 3105; +exports.ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN = 3106; +exports.ER_GENERATED_COLUMN_NON_PRIOR = 3107; +exports.ER_DEPENDENT_BY_GENERATED_COLUMN = 3108; +exports.ER_GENERATED_COLUMN_REF_AUTO_INC = 3109; +exports.ER_FEATURE_NOT_AVAILABLE = 3110; +exports.ER_CANT_SET_GTID_MODE = 3111; +exports.ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF = 3112; +exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 3113; +exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 3114; +exports.ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 3115; +exports.ER_CANT_ENFORCE_GTID_CONSISTENCY_WITH_ONGOING_GTID_VIOLATING_TX = 3116; +exports.ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX = 3117; +exports.ER_ACCOUNT_HAS_BEEN_LOCKED = 3118; +exports.ER_WRONG_TABLESPACE_NAME = 3119; +exports.ER_TABLESPACE_IS_NOT_EMPTY = 3120; +exports.ER_WRONG_FILE_NAME = 3121; +exports.ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION = 3122; +exports.ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR = 3123; +exports.ER_WARN_BAD_MAX_EXECUTION_TIME = 3124; +exports.ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME = 3125; +exports.ER_WARN_CONFLICTING_HINT = 3126; +exports.ER_WARN_UNKNOWN_QB_NAME = 3127; +exports.ER_UNRESOLVED_HINT_NAME = 3128; +exports.ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE = 3129; +exports.ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED = 3130; +exports.ER_LOCKING_SERVICE_WRONG_NAME = 3131; +exports.ER_LOCKING_SERVICE_DEADLOCK = 3132; +exports.ER_LOCKING_SERVICE_TIMEOUT = 3133; +exports.ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED = 3134; +exports.ER_SQL_MODE_MERGED = 3135; +exports.ER_VTOKEN_PLUGIN_TOKEN_MISMATCH = 3136; +exports.ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND = 3137; +exports.ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID = 3138; +exports.ER_REPLICA_CHANNEL_OPERATION_NOT_ALLOWED = 3139; +exports.ER_INVALID_JSON_TEXT = 3140; +exports.ER_INVALID_JSON_TEXT_IN_PARAM = 3141; +exports.ER_INVALID_JSON_BINARY_DATA = 3142; +exports.ER_INVALID_JSON_PATH = 3143; +exports.ER_INVALID_JSON_CHARSET = 3144; +exports.ER_INVALID_JSON_CHARSET_IN_FUNCTION = 3145; +exports.ER_INVALID_TYPE_FOR_JSON = 3146; +exports.ER_INVALID_CAST_TO_JSON = 3147; +exports.ER_INVALID_JSON_PATH_CHARSET = 3148; +exports.ER_INVALID_JSON_PATH_WILDCARD = 3149; +exports.ER_JSON_VALUE_TOO_BIG = 3150; +exports.ER_JSON_KEY_TOO_BIG = 3151; +exports.ER_JSON_USED_AS_KEY = 3152; +exports.ER_JSON_VACUOUS_PATH = 3153; +exports.ER_JSON_BAD_ONE_OR_ALL_ARG = 3154; +exports.ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE = 3155; +exports.ER_INVALID_JSON_VALUE_FOR_CAST = 3156; +exports.ER_JSON_DOCUMENT_TOO_DEEP = 3157; +exports.ER_JSON_DOCUMENT_NULL_KEY = 3158; +exports.ER_SECURE_TRANSPORT_REQUIRED = 3159; +exports.ER_NO_SECURE_TRANSPORTS_CONFIGURED = 3160; +exports.ER_DISABLED_STORAGE_ENGINE = 3161; +exports.ER_USER_DOES_NOT_EXIST = 3162; +exports.ER_USER_ALREADY_EXISTS = 3163; +exports.ER_AUDIT_API_ABORT = 3164; +exports.ER_INVALID_JSON_PATH_ARRAY_CELL = 3165; +exports.ER_BUFPOOL_RESIZE_INPROGRESS = 3166; +exports.ER_FEATURE_DISABLED_SEE_DOC = 3167; +exports.ER_SERVER_ISNT_AVAILABLE = 3168; +exports.ER_SESSION_WAS_KILLED = 3169; +exports.ER_CAPACITY_EXCEEDED = 3170; +exports.ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER = 3171; +exports.ER_TABLE_NEEDS_UPG_PART = 3172; +exports.ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID = 3173; +exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL = 3174; +exports.ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT = 3175; +exports.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE = 3176; +exports.ER_LOCK_REFUSED_BY_ENGINE = 3177; +exports.ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN = 3178; +exports.ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE = 3179; +exports.ER_MASTER_KEY_ROTATION_ERROR_BY_SE = 3180; +exports.ER_MASTER_KEY_ROTATION_BINLOG_FAILED = 3181; +exports.ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE = 3182; +exports.ER_TABLESPACE_CANNOT_ENCRYPT = 3183; +exports.ER_INVALID_ENCRYPTION_OPTION = 3184; +exports.ER_CANNOT_FIND_KEY_IN_KEYRING = 3185; +exports.ER_CAPACITY_EXCEEDED_IN_PARSER = 3186; +exports.ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE = 3187; +exports.ER_KEYRING_UDF_KEYRING_SERVICE_ERROR = 3188; +exports.ER_USER_COLUMN_OLD_LENGTH = 3189; +exports.ER_CANT_RESET_SOURCE = 3190; +exports.ER_GROUP_REPLICATION_MAX_GROUP_SIZE = 3191; +exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED = 3192; +exports.ER_TABLE_REFERENCED = 3193; +exports.ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE = 3194; +exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO = 3195; +exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID = 3196; +exports.ER_XA_RETRY = 3197; +exports.ER_KEYRING_AWS_UDF_AWS_KMS_ERROR = 3198; +exports.ER_BINLOG_UNSAFE_XA = 3199; +exports.ER_UDF_ERROR = 3200; +exports.ER_KEYRING_MIGRATION_FAILURE = 3201; +exports.ER_KEYRING_ACCESS_DENIED_ERROR = 3202; +exports.ER_KEYRING_MIGRATION_STATUS = 3203; +exports.ER_PLUGIN_FAILED_TO_OPEN_TABLES = 3204; +exports.ER_PLUGIN_FAILED_TO_OPEN_TABLE = 3205; +exports.ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 3206; +exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 3207; +exports.ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 3208; +exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 3209; +exports.ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 3210; +exports.ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 3211; +exports.ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED = 3212; +exports.ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 3213; +exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE = 3214; +exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT = 3215; +exports.ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED = 3216; +exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE = 3217; +exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE = 3218; +exports.ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 3219; +exports.ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 3220; +exports.ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 3221; +exports.ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS = 3222; +exports.ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 3223; +exports.ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 3224; +exports.ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 3225; +exports.WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP = 3226; +exports.ER_XA_REPLICATION_FILTERS = 3227; +exports.ER_CANT_OPEN_ERROR_LOG = 3228; +exports.ER_GROUPING_ON_TIMESTAMP_IN_DST = 3229; +exports.ER_CANT_START_SERVER_NAMED_PIPE = 3230; +exports.ER_WRITE_SET_EXCEEDS_LIMIT = 3231; +exports.ER_DEPRECATED_TLS_VERSION_SESSION_57 = 3232; +exports.ER_WARN_DEPRECATED_TLS_VERSION_57 = 3233; +exports.ER_WARN_WRONG_NATIVE_TABLE_STRUCTURE = 3234; +exports.ER_AES_INVALID_KDF_NAME = 3235; +exports.ER_AES_INVALID_KDF_ITERATIONS = 3236; +exports.WARN_AES_KEY_SIZE = 3237; +exports.ER_AES_INVALID_KDF_OPTION_SIZE = 3238; +exports.ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE = 3500; +exports.ER_ACL_OPERATION_FAILED = 3501; +exports.ER_UNSUPPORTED_INDEX_ALGORITHM = 3502; +exports.ER_NO_SUCH_DB = 3503; +exports.ER_TOO_BIG_ENUM = 3504; +exports.ER_TOO_LONG_SET_ENUM_VALUE = 3505; +exports.ER_INVALID_DD_OBJECT = 3506; +exports.ER_UPDATING_DD_TABLE = 3507; +exports.ER_INVALID_DD_OBJECT_ID = 3508; +exports.ER_INVALID_DD_OBJECT_NAME = 3509; +exports.ER_TABLESPACE_MISSING_WITH_NAME = 3510; +exports.ER_TOO_LONG_ROUTINE_COMMENT = 3511; +exports.ER_SP_LOAD_FAILED = 3512; +exports.ER_INVALID_BITWISE_OPERANDS_SIZE = 3513; +exports.ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE = 3514; +exports.ER_WARN_UNSUPPORTED_HINT = 3515; +exports.ER_UNEXPECTED_GEOMETRY_TYPE = 3516; +exports.ER_SRS_PARSE_ERROR = 3517; +exports.ER_SRS_PROJ_PARAMETER_MISSING = 3518; +exports.ER_WARN_SRS_NOT_FOUND = 3519; +exports.ER_SRS_NOT_CARTESIAN = 3520; +exports.ER_SRS_NOT_CARTESIAN_UNDEFINED = 3521; +exports.ER_PK_INDEX_CANT_BE_INVISIBLE = 3522; +exports.ER_UNKNOWN_AUTHID = 3523; +exports.ER_FAILED_ROLE_GRANT = 3524; +exports.ER_OPEN_ROLE_TABLES = 3525; +exports.ER_FAILED_DEFAULT_ROLES = 3526; +exports.ER_COMPONENTS_NO_SCHEME = 3527; +exports.ER_COMPONENTS_NO_SCHEME_SERVICE = 3528; +exports.ER_COMPONENTS_CANT_LOAD = 3529; +exports.ER_ROLE_NOT_GRANTED = 3530; +exports.ER_FAILED_REVOKE_ROLE = 3531; +exports.ER_RENAME_ROLE = 3532; +exports.ER_COMPONENTS_CANT_ACQUIRE_SERVICE_IMPLEMENTATION = 3533; +exports.ER_COMPONENTS_CANT_SATISFY_DEPENDENCY = 3534; +exports.ER_COMPONENTS_LOAD_CANT_REGISTER_SERVICE_IMPLEMENTATION = 3535; +exports.ER_COMPONENTS_LOAD_CANT_INITIALIZE = 3536; +exports.ER_COMPONENTS_UNLOAD_NOT_LOADED = 3537; +exports.ER_COMPONENTS_UNLOAD_CANT_DEINITIALIZE = 3538; +exports.ER_COMPONENTS_CANT_RELEASE_SERVICE = 3539; +exports.ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE = 3540; +exports.ER_COMPONENTS_CANT_UNLOAD = 3541; +exports.ER_WARN_UNLOAD_THE_NOT_PERSISTED = 3542; +exports.ER_COMPONENT_TABLE_INCORRECT = 3543; +exports.ER_COMPONENT_MANIPULATE_ROW_FAILED = 3544; +exports.ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP = 3545; +exports.ER_CANT_SET_GTID_PURGED_DUE_SETS_CONSTRAINTS = 3546; +exports.ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES = 3547; +exports.ER_SRS_NOT_FOUND = 3548; +exports.ER_VARIABLE_NOT_PERSISTED = 3549; +exports.ER_IS_QUERY_INVALID_CLAUSE = 3550; +exports.ER_UNABLE_TO_STORE_STATISTICS = 3551; +exports.ER_NO_SYSTEM_SCHEMA_ACCESS = 3552; +exports.ER_NO_SYSTEM_TABLESPACE_ACCESS = 3553; +exports.ER_NO_SYSTEM_TABLE_ACCESS = 3554; +exports.ER_NO_SYSTEM_TABLE_ACCESS_FOR_DICTIONARY_TABLE = 3555; +exports.ER_NO_SYSTEM_TABLE_ACCESS_FOR_SYSTEM_TABLE = 3556; +exports.ER_NO_SYSTEM_TABLE_ACCESS_FOR_TABLE = 3557; +exports.ER_INVALID_OPTION_KEY = 3558; +exports.ER_INVALID_OPTION_VALUE = 3559; +exports.ER_INVALID_OPTION_KEY_VALUE_PAIR = 3560; +exports.ER_INVALID_OPTION_START_CHARACTER = 3561; +exports.ER_INVALID_OPTION_END_CHARACTER = 3562; +exports.ER_INVALID_OPTION_CHARACTERS = 3563; +exports.ER_DUPLICATE_OPTION_KEY = 3564; +exports.ER_WARN_SRS_NOT_FOUND_AXIS_ORDER = 3565; +exports.ER_NO_ACCESS_TO_NATIVE_FCT = 3566; +exports.ER_RESET_SOURCE_TO_VALUE_OUT_OF_RANGE = 3567; +exports.ER_UNRESOLVED_TABLE_LOCK = 3568; +exports.ER_DUPLICATE_TABLE_LOCK = 3569; +exports.ER_BINLOG_UNSAFE_SKIP_LOCKED = 3570; +exports.ER_BINLOG_UNSAFE_NOWAIT = 3571; +exports.ER_LOCK_NOWAIT = 3572; +exports.ER_CTE_RECURSIVE_REQUIRES_UNION = 3573; +exports.ER_CTE_RECURSIVE_REQUIRES_NONRECURSIVE_FIRST = 3574; +exports.ER_CTE_RECURSIVE_FORBIDS_AGGREGATION = 3575; +exports.ER_CTE_RECURSIVE_FORBIDDEN_JOIN_ORDER = 3576; +exports.ER_CTE_RECURSIVE_REQUIRES_SINGLE_REFERENCE = 3577; +exports.ER_SWITCH_TMP_ENGINE = 3578; +exports.ER_WINDOW_NO_SUCH_WINDOW = 3579; +exports.ER_WINDOW_CIRCULARITY_IN_WINDOW_GRAPH = 3580; +exports.ER_WINDOW_NO_CHILD_PARTITIONING = 3581; +exports.ER_WINDOW_NO_INHERIT_FRAME = 3582; +exports.ER_WINDOW_NO_REDEFINE_ORDER_BY = 3583; +exports.ER_WINDOW_FRAME_START_ILLEGAL = 3584; +exports.ER_WINDOW_FRAME_END_ILLEGAL = 3585; +exports.ER_WINDOW_FRAME_ILLEGAL = 3586; +exports.ER_WINDOW_RANGE_FRAME_ORDER_TYPE = 3587; +exports.ER_WINDOW_RANGE_FRAME_TEMPORAL_TYPE = 3588; +exports.ER_WINDOW_RANGE_FRAME_NUMERIC_TYPE = 3589; +exports.ER_WINDOW_RANGE_BOUND_NOT_CONSTANT = 3590; +exports.ER_WINDOW_DUPLICATE_NAME = 3591; +exports.ER_WINDOW_ILLEGAL_ORDER_BY = 3592; +exports.ER_WINDOW_INVALID_WINDOW_FUNC_USE = 3593; +exports.ER_WINDOW_INVALID_WINDOW_FUNC_ALIAS_USE = 3594; +exports.ER_WINDOW_NESTED_WINDOW_FUNC_USE_IN_WINDOW_SPEC = 3595; +exports.ER_WINDOW_ROWS_INTERVAL_USE = 3596; +exports.ER_WINDOW_NO_GROUP_ORDER = 3597; +exports.ER_WINDOW_EXPLAIN_JSON = 3598; +exports.ER_WINDOW_FUNCTION_IGNORES_FRAME = 3599; +exports.ER_WL9236_NOW = 3600; +exports.ER_INVALID_NO_OF_ARGS = 3601; +exports.ER_FIELD_IN_GROUPING_NOT_GROUP_BY = 3602; +exports.ER_TOO_LONG_TABLESPACE_COMMENT = 3603; +exports.ER_ENGINE_CANT_DROP_TABLE = 3604; +exports.ER_ENGINE_CANT_DROP_MISSING_TABLE = 3605; +exports.ER_TABLESPACE_DUP_FILENAME = 3606; +exports.ER_DB_DROP_RMDIR2 = 3607; +exports.ER_IMP_NO_FILES_MATCHED = 3608; +exports.ER_IMP_SCHEMA_DOES_NOT_EXIST = 3609; +exports.ER_IMP_TABLE_ALREADY_EXISTS = 3610; +exports.ER_IMP_INCOMPATIBLE_MYSQLD_VERSION = 3611; +exports.ER_IMP_INCOMPATIBLE_DD_VERSION = 3612; +exports.ER_IMP_INCOMPATIBLE_SDI_VERSION = 3613; +exports.ER_WARN_INVALID_HINT = 3614; +exports.ER_VAR_DOES_NOT_EXIST = 3615; +exports.ER_LONGITUDE_OUT_OF_RANGE = 3616; +exports.ER_LATITUDE_OUT_OF_RANGE = 3617; +exports.ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS = 3618; +exports.ER_ILLEGAL_PRIVILEGE_LEVEL = 3619; +exports.ER_NO_SYSTEM_VIEW_ACCESS = 3620; +exports.ER_COMPONENT_FILTER_FLABBERGASTED = 3621; +exports.ER_PART_EXPR_TOO_LONG = 3622; +exports.ER_UDF_DROP_DYNAMICALLY_REGISTERED = 3623; +exports.ER_UNABLE_TO_STORE_COLUMN_STATISTICS = 3624; +exports.ER_UNABLE_TO_UPDATE_COLUMN_STATISTICS = 3625; +exports.ER_UNABLE_TO_DROP_COLUMN_STATISTICS = 3626; +exports.ER_UNABLE_TO_BUILD_HISTOGRAM = 3627; +exports.ER_MANDATORY_ROLE = 3628; +exports.ER_MISSING_TABLESPACE_FILE = 3629; +exports.ER_PERSIST_ONLY_ACCESS_DENIED_ERROR = 3630; +exports.ER_CMD_NEED_SUPER = 3631; +exports.ER_PATH_IN_DATADIR = 3632; +exports.ER_CLONE_DDL_IN_PROGRESS = 3633; +exports.ER_CLONE_TOO_MANY_CONCURRENT_CLONES = 3634; +exports.ER_APPLIER_LOG_EVENT_VALIDATION_ERROR = 3635; +exports.ER_CTE_MAX_RECURSION_DEPTH = 3636; +exports.ER_NOT_HINT_UPDATABLE_VARIABLE = 3637; +exports.ER_CREDENTIALS_CONTRADICT_TO_HISTORY = 3638; +exports.ER_WARNING_PASSWORD_HISTORY_CLAUSES_VOID = 3639; +exports.ER_CLIENT_DOES_NOT_SUPPORT = 3640; +exports.ER_I_S_SKIPPED_TABLESPACE = 3641; +exports.ER_TABLESPACE_ENGINE_MISMATCH = 3642; +exports.ER_WRONG_SRID_FOR_COLUMN = 3643; +exports.ER_CANNOT_ALTER_SRID_DUE_TO_INDEX = 3644; +exports.ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED = 3645; +exports.ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED = 3646; +exports.ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES = 3647; +exports.ER_COULD_NOT_APPLY_JSON_DIFF = 3648; +exports.ER_CORRUPTED_JSON_DIFF = 3649; +exports.ER_RESOURCE_GROUP_EXISTS = 3650; +exports.ER_RESOURCE_GROUP_NOT_EXISTS = 3651; +exports.ER_INVALID_VCPU_ID = 3652; +exports.ER_INVALID_VCPU_RANGE = 3653; +exports.ER_INVALID_THREAD_PRIORITY = 3654; +exports.ER_DISALLOWED_OPERATION = 3655; +exports.ER_RESOURCE_GROUP_BUSY = 3656; +exports.ER_RESOURCE_GROUP_DISABLED = 3657; +exports.ER_FEATURE_UNSUPPORTED = 3658; +exports.ER_ATTRIBUTE_IGNORED = 3659; +exports.ER_INVALID_THREAD_ID = 3660; +exports.ER_RESOURCE_GROUP_BIND_FAILED = 3661; +exports.ER_INVALID_USE_OF_FORCE_OPTION = 3662; +exports.ER_GROUP_REPLICATION_COMMAND_FAILURE = 3663; +exports.ER_SDI_OPERATION_FAILED = 3664; +exports.ER_MISSING_JSON_TABLE_VALUE = 3665; +exports.ER_WRONG_JSON_TABLE_VALUE = 3666; +exports.ER_TF_MUST_HAVE_ALIAS = 3667; +exports.ER_TF_FORBIDDEN_JOIN_TYPE = 3668; +exports.ER_JT_VALUE_OUT_OF_RANGE = 3669; +exports.ER_JT_MAX_NESTED_PATH = 3670; +exports.ER_PASSWORD_EXPIRATION_NOT_SUPPORTED_BY_AUTH_METHOD = 3671; +exports.ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL = 3672; +exports.ER_BAD_NULL_ERROR_NOT_IGNORED = 3673; +exports.WARN_USELESS_SPATIAL_INDEX = 3674; +exports.ER_DISK_FULL_NOWAIT = 3675; +exports.ER_PARSE_ERROR_IN_DIGEST_FN = 3676; +exports.ER_UNDISCLOSED_PARSE_ERROR_IN_DIGEST_FN = 3677; +exports.ER_SCHEMA_DIR_EXISTS = 3678; +exports.ER_SCHEMA_DIR_MISSING = 3679; +exports.ER_SCHEMA_DIR_CREATE_FAILED = 3680; +exports.ER_SCHEMA_DIR_UNKNOWN = 3681; +exports.ER_ONLY_IMPLEMENTED_FOR_SRID_0_AND_4326 = 3682; +exports.ER_BINLOG_EXPIRE_LOG_DAYS_AND_SECS_USED_TOGETHER = 3683; +exports.ER_REGEXP_BUFFER_OVERFLOW = 3684; +exports.ER_REGEXP_ILLEGAL_ARGUMENT = 3685; +exports.ER_REGEXP_INDEX_OUTOFBOUNDS_ERROR = 3686; +exports.ER_REGEXP_INTERNAL_ERROR = 3687; +exports.ER_REGEXP_RULE_SYNTAX = 3688; +exports.ER_REGEXP_BAD_ESCAPE_SEQUENCE = 3689; +exports.ER_REGEXP_UNIMPLEMENTED = 3690; +exports.ER_REGEXP_MISMATCHED_PAREN = 3691; +exports.ER_REGEXP_BAD_INTERVAL = 3692; +exports.ER_REGEXP_MAX_LT_MIN = 3693; +exports.ER_REGEXP_INVALID_BACK_REF = 3694; +exports.ER_REGEXP_LOOK_BEHIND_LIMIT = 3695; +exports.ER_REGEXP_MISSING_CLOSE_BRACKET = 3696; +exports.ER_REGEXP_INVALID_RANGE = 3697; +exports.ER_REGEXP_STACK_OVERFLOW = 3698; +exports.ER_REGEXP_TIME_OUT = 3699; +exports.ER_REGEXP_PATTERN_TOO_BIG = 3700; +exports.ER_CANT_SET_ERROR_LOG_SERVICE = 3701; +exports.ER_EMPTY_PIPELINE_FOR_ERROR_LOG_SERVICE = 3702; +exports.ER_COMPONENT_FILTER_DIAGNOSTICS = 3703; +exports.ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS = 3704; +exports.ER_NOT_IMPLEMENTED_FOR_PROJECTED_SRS = 3705; +exports.ER_NONPOSITIVE_RADIUS = 3706; +exports.ER_RESTART_SERVER_FAILED = 3707; +exports.ER_SRS_MISSING_MANDATORY_ATTRIBUTE = 3708; +exports.ER_SRS_MULTIPLE_ATTRIBUTE_DEFINITIONS = 3709; +exports.ER_SRS_NAME_CANT_BE_EMPTY_OR_WHITESPACE = 3710; +exports.ER_SRS_ORGANIZATION_CANT_BE_EMPTY_OR_WHITESPACE = 3711; +exports.ER_SRS_ID_ALREADY_EXISTS = 3712; +exports.ER_WARN_SRS_ID_ALREADY_EXISTS = 3713; +exports.ER_CANT_MODIFY_SRID_0 = 3714; +exports.ER_WARN_RESERVED_SRID_RANGE = 3715; +exports.ER_CANT_MODIFY_SRS_USED_BY_COLUMN = 3716; +exports.ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE = 3717; +exports.ER_SRS_ATTRIBUTE_STRING_TOO_LONG = 3718; +exports.ER_DEPRECATED_UTF8_ALIAS = 3719; +exports.ER_DEPRECATED_NATIONAL = 3720; +exports.ER_INVALID_DEFAULT_UTF8MB4_COLLATION = 3721; +exports.ER_UNABLE_TO_COLLECT_LOG_STATUS = 3722; +exports.ER_RESERVED_TABLESPACE_NAME = 3723; +exports.ER_UNABLE_TO_SET_OPTION = 3724; +exports.ER_REPLICA_POSSIBLY_DIVERGED_AFTER_DDL = 3725; +exports.ER_SRS_NOT_GEOGRAPHIC = 3726; +exports.ER_POLYGON_TOO_LARGE = 3727; +exports.ER_SPATIAL_UNIQUE_INDEX = 3728; +exports.ER_INDEX_TYPE_NOT_SUPPORTED_FOR_SPATIAL_INDEX = 3729; +exports.ER_FK_CANNOT_DROP_PARENT = 3730; +exports.ER_GEOMETRY_PARAM_LONGITUDE_OUT_OF_RANGE = 3731; +exports.ER_GEOMETRY_PARAM_LATITUDE_OUT_OF_RANGE = 3732; +exports.ER_FK_CANNOT_USE_VIRTUAL_COLUMN = 3733; +exports.ER_FK_NO_COLUMN_PARENT = 3734; +exports.ER_CANT_SET_ERROR_SUPPRESSION_LIST = 3735; +exports.ER_SRS_GEOGCS_INVALID_AXES = 3736; +exports.ER_SRS_INVALID_SEMI_MAJOR_AXIS = 3737; +exports.ER_SRS_INVALID_INVERSE_FLATTENING = 3738; +exports.ER_SRS_INVALID_ANGULAR_UNIT = 3739; +exports.ER_SRS_INVALID_PRIME_MERIDIAN = 3740; +exports.ER_TRANSFORM_SOURCE_SRS_NOT_SUPPORTED = 3741; +exports.ER_TRANSFORM_TARGET_SRS_NOT_SUPPORTED = 3742; +exports.ER_TRANSFORM_SOURCE_SRS_MISSING_TOWGS84 = 3743; +exports.ER_TRANSFORM_TARGET_SRS_MISSING_TOWGS84 = 3744; +exports.ER_TEMP_TABLE_PREVENTS_SWITCH_SESSION_BINLOG_FORMAT = 3745; +exports.ER_TEMP_TABLE_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT = 3746; +exports.ER_RUNNING_APPLIER_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT = 3747; +exports.ER_CLIENT_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRX_IN_SBR = 3748; +exports.ER_XA_CANT_CREATE_MDL_BACKUP = 3749; +exports.ER_TABLE_WITHOUT_PK = 3750; +exports.ER_WARN_DATA_TRUNCATED_FUNCTIONAL_INDEX = 3751; +exports.ER_WARN_DATA_OUT_OF_RANGE_FUNCTIONAL_INDEX = 3752; +exports.ER_FUNCTIONAL_INDEX_ON_JSON_OR_GEOMETRY_FUNCTION = 3753; +exports.ER_FUNCTIONAL_INDEX_REF_AUTO_INCREMENT = 3754; +exports.ER_CANNOT_DROP_COLUMN_FUNCTIONAL_INDEX = 3755; +exports.ER_FUNCTIONAL_INDEX_PRIMARY_KEY = 3756; +exports.ER_FUNCTIONAL_INDEX_ON_LOB = 3757; +exports.ER_FUNCTIONAL_INDEX_FUNCTION_IS_NOT_ALLOWED = 3758; +exports.ER_FULLTEXT_FUNCTIONAL_INDEX = 3759; +exports.ER_SPATIAL_FUNCTIONAL_INDEX = 3760; +exports.ER_WRONG_KEY_COLUMN_FUNCTIONAL_INDEX = 3761; +exports.ER_FUNCTIONAL_INDEX_ON_FIELD = 3762; +exports.ER_GENERATED_COLUMN_NAMED_FUNCTION_IS_NOT_ALLOWED = 3763; +exports.ER_GENERATED_COLUMN_ROW_VALUE = 3764; +exports.ER_GENERATED_COLUMN_VARIABLES = 3765; +exports.ER_DEPENDENT_BY_DEFAULT_GENERATED_VALUE = 3766; +exports.ER_DEFAULT_VAL_GENERATED_NON_PRIOR = 3767; +exports.ER_DEFAULT_VAL_GENERATED_REF_AUTO_INC = 3768; +exports.ER_DEFAULT_VAL_GENERATED_FUNCTION_IS_NOT_ALLOWED = 3769; +exports.ER_DEFAULT_VAL_GENERATED_NAMED_FUNCTION_IS_NOT_ALLOWED = 3770; +exports.ER_DEFAULT_VAL_GENERATED_ROW_VALUE = 3771; +exports.ER_DEFAULT_VAL_GENERATED_VARIABLES = 3772; +exports.ER_DEFAULT_AS_VAL_GENERATED = 3773; +exports.ER_UNSUPPORTED_ACTION_ON_DEFAULT_VAL_GENERATED = 3774; +exports.ER_GTID_UNSAFE_ALTER_ADD_COL_WITH_DEFAULT_EXPRESSION = 3775; +exports.ER_FK_CANNOT_CHANGE_ENGINE = 3776; +exports.ER_WARN_DEPRECATED_USER_SET_EXPR = 3777; +exports.ER_WARN_DEPRECATED_UTF8MB3_COLLATION = 3778; +exports.ER_WARN_DEPRECATED_NESTED_COMMENT_SYNTAX = 3779; +exports.ER_FK_INCOMPATIBLE_COLUMNS = 3780; +exports.ER_GR_HOLD_WAIT_TIMEOUT = 3781; +exports.ER_GR_HOLD_KILLED = 3782; +exports.ER_GR_HOLD_MEMBER_STATUS_ERROR = 3783; +exports.ER_RPL_ENCRYPTION_FAILED_TO_FETCH_KEY = 3784; +exports.ER_RPL_ENCRYPTION_KEY_NOT_FOUND = 3785; +exports.ER_RPL_ENCRYPTION_KEYRING_INVALID_KEY = 3786; +exports.ER_RPL_ENCRYPTION_HEADER_ERROR = 3787; +exports.ER_RPL_ENCRYPTION_FAILED_TO_ROTATE_LOGS = 3788; +exports.ER_RPL_ENCRYPTION_KEY_EXISTS_UNEXPECTED = 3789; +exports.ER_RPL_ENCRYPTION_FAILED_TO_GENERATE_KEY = 3790; +exports.ER_RPL_ENCRYPTION_FAILED_TO_STORE_KEY = 3791; +exports.ER_RPL_ENCRYPTION_FAILED_TO_REMOVE_KEY = 3792; +exports.ER_RPL_ENCRYPTION_UNABLE_TO_CHANGE_OPTION = 3793; +exports.ER_RPL_ENCRYPTION_MASTER_KEY_RECOVERY_FAILED = 3794; +exports.ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE = 3795; +exports.ER_GRP_TRX_CONSISTENCY_NOT_ALLOWED = 3796; +exports.ER_GRP_TRX_CONSISTENCY_BEFORE = 3797; +exports.ER_GRP_TRX_CONSISTENCY_AFTER_ON_TRX_BEGIN = 3798; +exports.ER_GRP_TRX_CONSISTENCY_BEGIN_NOT_ALLOWED = 3799; +exports.ER_FUNCTIONAL_INDEX_ROW_VALUE_IS_NOT_ALLOWED = 3800; +exports.ER_RPL_ENCRYPTION_FAILED_TO_ENCRYPT = 3801; +exports.ER_PAGE_TRACKING_NOT_STARTED = 3802; +exports.ER_PAGE_TRACKING_RANGE_NOT_TRACKED = 3803; +exports.ER_PAGE_TRACKING_CANNOT_PURGE = 3804; +exports.ER_RPL_ENCRYPTION_CANNOT_ROTATE_BINLOG_MASTER_KEY = 3805; +exports.ER_BINLOG_MASTER_KEY_RECOVERY_OUT_OF_COMBINATION = 3806; +exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_OPERATE_KEY = 3807; +exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_ROTATE_LOGS = 3808; +exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_REENCRYPT_LOG = 3809; +exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_UNUSED_KEYS = 3810; +exports.ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_AUX_KEY = 3811; +exports.ER_NON_BOOLEAN_EXPR_FOR_CHECK_CONSTRAINT = 3812; +exports.ER_COLUMN_CHECK_CONSTRAINT_REFERENCES_OTHER_COLUMN = 3813; +exports.ER_CHECK_CONSTRAINT_NAMED_FUNCTION_IS_NOT_ALLOWED = 3814; +exports.ER_CHECK_CONSTRAINT_FUNCTION_IS_NOT_ALLOWED = 3815; +exports.ER_CHECK_CONSTRAINT_VARIABLES = 3816; +exports.ER_CHECK_CONSTRAINT_ROW_VALUE = 3817; +exports.ER_CHECK_CONSTRAINT_REFERS_AUTO_INCREMENT_COLUMN = 3818; +exports.ER_CHECK_CONSTRAINT_VIOLATED = 3819; +exports.ER_CHECK_CONSTRAINT_REFERS_UNKNOWN_COLUMN = 3820; +exports.ER_CHECK_CONSTRAINT_NOT_FOUND = 3821; +exports.ER_CHECK_CONSTRAINT_DUP_NAME = 3822; +exports.ER_CHECK_CONSTRAINT_CLAUSE_USING_FK_REFER_ACTION_COLUMN = 3823; +exports.WARN_UNENCRYPTED_TABLE_IN_ENCRYPTED_DB = 3824; +exports.ER_INVALID_ENCRYPTION_REQUEST = 3825; +exports.ER_CANNOT_SET_TABLE_ENCRYPTION = 3826; +exports.ER_CANNOT_SET_DATABASE_ENCRYPTION = 3827; +exports.ER_CANNOT_SET_TABLESPACE_ENCRYPTION = 3828; +exports.ER_TABLESPACE_CANNOT_BE_ENCRYPTED = 3829; +exports.ER_TABLESPACE_CANNOT_BE_DECRYPTED = 3830; +exports.ER_TABLESPACE_TYPE_UNKNOWN = 3831; +exports.ER_TARGET_TABLESPACE_UNENCRYPTED = 3832; +exports.ER_CANNOT_USE_ENCRYPTION_CLAUSE = 3833; +exports.ER_INVALID_MULTIPLE_CLAUSES = 3834; +exports.ER_UNSUPPORTED_USE_OF_GRANT_AS = 3835; +exports.ER_UKNOWN_AUTH_ID_OR_ACCESS_DENIED_FOR_GRANT_AS = 3836; +exports.ER_DEPENDENT_BY_FUNCTIONAL_INDEX = 3837; +exports.ER_PLUGIN_NOT_EARLY = 3838; +exports.ER_INNODB_REDO_LOG_ARCHIVE_START_SUBDIR_PATH = 3839; +exports.ER_INNODB_REDO_LOG_ARCHIVE_START_TIMEOUT = 3840; +exports.ER_INNODB_REDO_LOG_ARCHIVE_DIRS_INVALID = 3841; +exports.ER_INNODB_REDO_LOG_ARCHIVE_LABEL_NOT_FOUND = 3842; +exports.ER_INNODB_REDO_LOG_ARCHIVE_DIR_EMPTY = 3843; +exports.ER_INNODB_REDO_LOG_ARCHIVE_NO_SUCH_DIR = 3844; +exports.ER_INNODB_REDO_LOG_ARCHIVE_DIR_CLASH = 3845; +exports.ER_INNODB_REDO_LOG_ARCHIVE_DIR_PERMISSIONS = 3846; +exports.ER_INNODB_REDO_LOG_ARCHIVE_FILE_CREATE = 3847; +exports.ER_INNODB_REDO_LOG_ARCHIVE_ACTIVE = 3848; +exports.ER_INNODB_REDO_LOG_ARCHIVE_INACTIVE = 3849; +exports.ER_INNODB_REDO_LOG_ARCHIVE_FAILED = 3850; +exports.ER_INNODB_REDO_LOG_ARCHIVE_SESSION = 3851; +exports.ER_STD_REGEX_ERROR = 3852; +exports.ER_INVALID_JSON_TYPE = 3853; +exports.ER_CANNOT_CONVERT_STRING = 3854; +exports.ER_DEPENDENT_BY_PARTITION_FUNC = 3855; +exports.ER_WARN_DEPRECATED_FLOAT_AUTO_INCREMENT = 3856; +exports.ER_RPL_CANT_STOP_REPLICA_WHILE_LOCKED_BACKUP = 3857; +exports.ER_WARN_DEPRECATED_FLOAT_DIGITS = 3858; +exports.ER_WARN_DEPRECATED_FLOAT_UNSIGNED = 3859; +exports.ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH = 3860; +exports.ER_WARN_DEPRECATED_ZEROFILL = 3861; +exports.ER_CLONE_DONOR = 3862; +exports.ER_CLONE_PROTOCOL = 3863; +exports.ER_CLONE_DONOR_VERSION = 3864; +exports.ER_CLONE_OS = 3865; +exports.ER_CLONE_PLATFORM = 3866; +exports.ER_CLONE_CHARSET = 3867; +exports.ER_CLONE_CONFIG = 3868; +exports.ER_CLONE_SYS_CONFIG = 3869; +exports.ER_CLONE_PLUGIN_MATCH = 3870; +exports.ER_CLONE_LOOPBACK = 3871; +exports.ER_CLONE_ENCRYPTION = 3872; +exports.ER_CLONE_DISK_SPACE = 3873; +exports.ER_CLONE_IN_PROGRESS = 3874; +exports.ER_CLONE_DISALLOWED = 3875; +exports.ER_CANNOT_GRANT_ROLES_TO_ANONYMOUS_USER = 3876; +exports.ER_SECONDARY_ENGINE_PLUGIN = 3877; +exports.ER_SECOND_PASSWORD_CANNOT_BE_EMPTY = 3878; +exports.ER_DB_ACCESS_DENIED = 3879; +exports.ER_DA_AUTH_ID_WITH_SYSTEM_USER_PRIV_IN_MANDATORY_ROLES = 3880; +exports.ER_DA_RPL_GTID_TABLE_CANNOT_OPEN = 3881; +exports.ER_GEOMETRY_IN_UNKNOWN_LENGTH_UNIT = 3882; +exports.ER_DA_PLUGIN_INSTALL_ERROR = 3883; +exports.ER_NO_SESSION_TEMP = 3884; +exports.ER_DA_UNKNOWN_ERROR_NUMBER = 3885; +exports.ER_COLUMN_CHANGE_SIZE = 3886; +exports.ER_REGEXP_INVALID_CAPTURE_GROUP_NAME = 3887; +exports.ER_DA_SSL_LIBRARY_ERROR = 3888; +exports.ER_SECONDARY_ENGINE = 3889; +exports.ER_SECONDARY_ENGINE_DDL = 3890; +exports.ER_INCORRECT_CURRENT_PASSWORD = 3891; +exports.ER_MISSING_CURRENT_PASSWORD = 3892; +exports.ER_CURRENT_PASSWORD_NOT_REQUIRED = 3893; +exports.ER_PASSWORD_CANNOT_BE_RETAINED_ON_PLUGIN_CHANGE = 3894; +exports.ER_CURRENT_PASSWORD_CANNOT_BE_RETAINED = 3895; +exports.ER_PARTIAL_REVOKES_EXIST = 3896; +exports.ER_CANNOT_GRANT_SYSTEM_PRIV_TO_MANDATORY_ROLE = 3897; +exports.ER_XA_REPLICATION_FILTERS = 3898; +exports.ER_UNSUPPORTED_SQL_MODE = 3899; +exports.ER_REGEXP_INVALID_FLAG = 3900; +exports.ER_PARTIAL_REVOKE_AND_DB_GRANT_BOTH_EXISTS = 3901; +exports.ER_UNIT_NOT_FOUND = 3902; +exports.ER_INVALID_JSON_VALUE_FOR_FUNC_INDEX = 3903; +exports.ER_JSON_VALUE_OUT_OF_RANGE_FOR_FUNC_INDEX = 3904; +exports.ER_EXCEEDED_MV_KEYS_NUM = 3905; +exports.ER_EXCEEDED_MV_KEYS_SPACE = 3906; +exports.ER_FUNCTIONAL_INDEX_DATA_IS_TOO_LONG = 3907; +exports.ER_WRONG_MVI_VALUE = 3908; +exports.ER_WARN_FUNC_INDEX_NOT_APPLICABLE = 3909; +exports.ER_GRP_RPL_UDF_ERROR = 3910; +exports.ER_UPDATE_GTID_PURGED_WITH_GR = 3911; +exports.ER_GROUPING_ON_TIMESTAMP_IN_DST = 3912; +exports.ER_TABLE_NAME_CAUSES_TOO_LONG_PATH = 3913; +exports.ER_AUDIT_LOG_INSUFFICIENT_PRIVILEGE = 3914; +exports.ER_AUDIT_LOG_PASSWORD_HAS_BEEN_COPIED = 3915; +exports.ER_DA_GRP_RPL_STARTED_AUTO_REJOIN = 3916; +exports.ER_SYSVAR_CHANGE_DURING_QUERY = 3917; +exports.ER_GLOBSTAT_CHANGE_DURING_QUERY = 3918; +exports.ER_GRP_RPL_MESSAGE_SERVICE_INIT_FAILURE = 3919; +exports.ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_CLIENT = 3920; +exports.ER_CHANGE_SOURCE_WRONG_COMPRESSION_LEVEL_CLIENT = 3921; +exports.ER_WRONG_COMPRESSION_ALGORITHM_CLIENT = 3922; +exports.ER_WRONG_COMPRESSION_LEVEL_CLIENT = 3923; +exports.ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_LIST_CLIENT = 3924; +exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_CANNOT_BE_ANONYMOUS = 3925; +exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_DOES_NOT_EXIST = 3926; +exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_CORRUPT = 3927; +exports.ER_CLIENT_PRIVILEGE_CHECKS_USER_NEEDS_RPL_APPLIER_PRIV = 3928; +exports.ER_WARN_DA_PRIVILEGE_NOT_REGISTERED = 3929; +exports.ER_CLIENT_KEYRING_UDF_KEY_INVALID = 3930; +exports.ER_CLIENT_KEYRING_UDF_KEY_TYPE_INVALID = 3931; +exports.ER_CLIENT_KEYRING_UDF_KEY_TOO_LONG = 3932; +exports.ER_CLIENT_KEYRING_UDF_KEY_TYPE_TOO_LONG = 3933; +exports.ER_JSON_SCHEMA_VALIDATION_ERROR_WITH_DETAILED_REPORT = 3934; +exports.ER_DA_UDF_INVALID_CHARSET_SPECIFIED = 3935; +exports.ER_DA_UDF_INVALID_CHARSET = 3936; +exports.ER_DA_UDF_INVALID_COLLATION = 3937; +exports.ER_DA_UDF_INVALID_EXTENSION_ARGUMENT_TYPE = 3938; +exports.ER_MULTIPLE_CONSTRAINTS_WITH_SAME_NAME = 3939; +exports.ER_CONSTRAINT_NOT_FOUND = 3940; +exports.ER_ALTER_CONSTRAINT_ENFORCEMENT_NOT_SUPPORTED = 3941; +exports.ER_TABLE_VALUE_CONSTRUCTOR_MUST_HAVE_COLUMNS = 3942; +exports.ER_TABLE_VALUE_CONSTRUCTOR_CANNOT_HAVE_DEFAULT = 3943; +exports.ER_CLIENT_QUERY_FAILURE_INVALID_NON_ROW_FORMAT = 3944; +exports.ER_REQUIRE_ROW_FORMAT_INVALID_VALUE = 3945; +exports.ER_FAILED_TO_DETERMINE_IF_ROLE_IS_MANDATORY = 3946; +exports.ER_FAILED_TO_FETCH_MANDATORY_ROLE_LIST = 3947; +exports.ER_CLIENT_LOCAL_FILES_DISABLED = 3948; +exports.ER_IMP_INCOMPATIBLE_CFG_VERSION = 3949; +exports.ER_DA_OOM = 3950; +exports.ER_DA_UDF_INVALID_ARGUMENT_TO_SET_CHARSET = 3951; +exports.ER_DA_UDF_INVALID_RETURN_TYPE_TO_SET_CHARSET = 3952; +exports.ER_MULTIPLE_INTO_CLAUSES = 3953; +exports.ER_MISPLACED_INTO = 3954; +exports.ER_USER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK = 3955; +exports.ER_WARN_DEPRECATED_YEAR_UNSIGNED = 3956; +exports.ER_CLONE_NETWORK_PACKET = 3957; +exports.ER_SDI_OPERATION_FAILED_MISSING_RECORD = 3958; +exports.ER_DEPENDENT_BY_CHECK_CONSTRAINT = 3959; +exports.ER_GRP_OPERATION_NOT_ALLOWED_GR_MUST_STOP = 3960; +exports.ER_WARN_DEPRECATED_JSON_TABLE_ON_ERROR_ON_EMPTY = 3961; +exports.ER_WARN_DEPRECATED_INNER_INTO = 3962; +exports.ER_WARN_DEPRECATED_VALUES_FUNCTION_ALWAYS_NULL = 3963; +exports.ER_WARN_DEPRECATED_SQL_CALC_FOUND_ROWS = 3964; +exports.ER_WARN_DEPRECATED_FOUND_ROWS = 3965; +exports.ER_MISSING_JSON_VALUE = 3966; +exports.ER_MULTIPLE_JSON_VALUES = 3967; +exports.ER_HOSTNAME_TOO_LONG = 3968; +exports.ER_WARN_CLIENT_DEPRECATED_PARTITION_PREFIX_KEY = 3969; +exports.ER_GROUP_REPLICATION_USER_EMPTY_MSG = 3970; +exports.ER_GROUP_REPLICATION_USER_MANDATORY_MSG = 3971; +exports.ER_GROUP_REPLICATION_PASSWORD_LENGTH = 3972; +exports.ER_SUBQUERY_TRANSFORM_REJECTED = 3973; +exports.ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT = 3974; +exports.ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID = 3975; +exports.ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART = 3976; +exports.ER_STATEMENT_NOT_ALLOWED_AFTER_START_TRANSACTION = 3977; +exports.ER_FOREIGN_KEY_WITH_ATOMIC_CREATE_SELECT = 3978; +exports.ER_NOT_ALLOWED_WITH_START_TRANSACTION = 3979; +exports.ER_INVALID_JSON_ATTRIBUTE = 3980; +exports.ER_ENGINE_ATTRIBUTE_NOT_SUPPORTED = 3981; +exports.ER_INVALID_USER_ATTRIBUTE_JSON = 3982; +exports.ER_INNODB_REDO_DISABLED = 3983; +exports.ER_INNODB_REDO_ARCHIVING_ENABLED = 3984; +exports.ER_MDL_OUT_OF_RESOURCES = 3985; +exports.ER_IMPLICIT_COMPARISON_FOR_JSON = 3986; +exports.ER_FUNCTION_DOES_NOT_SUPPORT_CHARACTER_SET = 3987; +exports.ER_IMPOSSIBLE_STRING_CONVERSION = 3988; +exports.ER_SCHEMA_READ_ONLY = 3989; +exports.ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF = 3990; +exports.ER_RPL_ASYNC_RECONNECT_AUTO_POSITION_OFF = 3991; +exports.ER_DISABLE_GTID_MODE_REQUIRES_ASYNC_RECONNECT_OFF = 3992; +exports.ER_DISABLE_AUTO_POSITION_REQUIRES_ASYNC_RECONNECT_OFF = 3993; +exports.ER_INVALID_PARAMETER_USE = 3994; +exports.ER_CHARACTER_SET_MISMATCH = 3995; +exports.ER_WARN_VAR_VALUE_CHANGE_NOT_SUPPORTED = 3996; +exports.ER_INVALID_TIME_ZONE_INTERVAL = 3997; +exports.ER_INVALID_CAST = 3998; +exports.ER_HYPERGRAPH_NOT_SUPPORTED_YET = 3999; +exports.ER_WARN_HYPERGRAPH_EXPERIMENTAL = 4000; +exports.ER_DA_NO_ERROR_LOG_PARSER_CONFIGURED = 4001; +exports.ER_DA_ERROR_LOG_TABLE_DISABLED = 4002; +exports.ER_DA_ERROR_LOG_MULTIPLE_FILTERS = 4003; +exports.ER_DA_CANT_OPEN_ERROR_LOG = 4004; +exports.ER_USER_REFERENCED_AS_DEFINER = 4005; +exports.ER_CANNOT_USER_REFERENCED_AS_DEFINER = 4006; +exports.ER_REGEX_NUMBER_TOO_BIG = 4007; +exports.ER_SPVAR_NONINTEGER_TYPE = 4008; +exports.WARN_UNSUPPORTED_ACL_TABLES_READ = 4009; +exports.ER_BINLOG_UNSAFE_ACL_TABLE_READ_IN_DML_DDL = 4010; +exports.ER_STOP_REPLICA_MONITOR_IO_THREAD_TIMEOUT = 4011; +exports.ER_STARTING_REPLICA_MONITOR_IO_THREAD = 4012; +exports.ER_CANT_USE_ANONYMOUS_TO_GTID_WITH_GTID_MODE_NOT_ON = 4013; +exports.ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION = 4014; +exports.ER_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_REQUIRES_GTID_MODE_ON = 4015; +exports.ER_SQL_REPLICA_SKIP_COUNTER_USED_WITH_GTID_MODE_ON = 4016; +exports.ER_USING_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_AS_LOCAL_OR_UUID = 4017; +exports.ER_CANT_SET_ANONYMOUS_TO_GTID_AND_WAIT_UNTIL_SQL_THD_AFTER_GTIDS = 4018; +exports.ER_CANT_SET_SQL_AFTER_OR_BEFORE_GTIDS_WITH_ANONYMOUS_TO_GTID = 4019; +exports.ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_GROUP_NAME = 4020; +exports.ER_CANT_USE_SAME_UUID_AS_GROUP_NAME = 4021; +exports.ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING = 4022; +exports.ER_INNODB_INVALID_AUTOEXTEND_SIZE_VALUE = 4023; +exports.ER_INNODB_INCOMPATIBLE_WITH_TABLESPACE = 4024; +exports.ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE = 4025; +exports.ER_CANNOT_USE_AUTOEXTEND_SIZE_CLAUSE = 4026; +exports.ER_ROLE_GRANTED_TO_ITSELF = 4027; +exports.ER_TABLE_MUST_HAVE_A_VISIBLE_COLUMN = 4028; +exports.ER_INNODB_COMPRESSION_FAILURE = 4029; +exports.ER_WARN_ASYNC_CONN_FAILOVER_NETWORK_NAMESPACE = 4030; +exports.ER_CLIENT_INTERACTION_TIMEOUT = 4031; +exports.ER_INVALID_CAST_TO_GEOMETRY = 4032; +exports.ER_INVALID_CAST_POLYGON_RING_DIRECTION = 4033; +exports.ER_GIS_DIFFERENT_SRIDS_AGGREGATION = 4034; +exports.ER_RELOAD_KEYRING_FAILURE = 4035; +exports.ER_SDI_GET_KEYS_INVALID_TABLESPACE = 4036; +exports.ER_CHANGE_RPL_SRC_WRONG_COMPRESSION_ALGORITHM_SIZE = 4037; +exports.ER_WARN_DEPRECATED_TLS_VERSION_FOR_CHANNEL_CLI = 4038; +exports.ER_CANT_USE_SAME_UUID_AS_VIEW_CHANGE_UUID = 4039; +exports.ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_VIEW_CHANGE_UUID = 4040; +exports.ER_GRP_RPL_VIEW_CHANGE_UUID_FAIL_GET_VARIABLE = 4041; +exports.ER_WARN_ADUIT_LOG_MAX_SIZE_AND_PRUNE_SECONDS = 4042; +exports.ER_WARN_ADUIT_LOG_MAX_SIZE_CLOSE_TO_ROTATE_ON_SIZE = 4043; +exports.ER_KERBEROS_CREATE_USER = 4044; +exports.ER_INSTALL_PLUGIN_CONFLICT_CLIENT = 4045; +exports.ER_DA_ERROR_LOG_COMPONENT_FLUSH_FAILED = 4046; +exports.ER_WARN_SQL_AFTER_MTS_GAPS_GAP_NOT_CALCULATED = 4047; +exports.ER_INVALID_ASSIGNMENT_TARGET = 4048; +exports.ER_OPERATION_NOT_ALLOWED_ON_GR_SECONDARY = 4049; +exports.ER_GRP_RPL_FAILOVER_CHANNEL_STATUS_PROPAGATION = 4050; +exports.ER_WARN_AUDIT_LOG_FORMAT_UNIX_TIMESTAMP_ONLY_WHEN_JSON = 4051; +exports.ER_INVALID_MFA_PLUGIN_SPECIFIED = 4052; +exports.ER_IDENTIFIED_BY_UNSUPPORTED = 4053; +exports.ER_INVALID_PLUGIN_FOR_REGISTRATION = 4054; +exports.ER_PLUGIN_REQUIRES_REGISTRATION = 4055; +exports.ER_MFA_METHOD_EXISTS = 4056; +exports.ER_MFA_METHOD_NOT_EXISTS = 4057; +exports.ER_AUTHENTICATION_POLICY_MISMATCH = 4058; +exports.ER_PLUGIN_REGISTRATION_DONE = 4059; +exports.ER_INVALID_USER_FOR_REGISTRATION = 4060; +exports.ER_USER_REGISTRATION_FAILED = 4061; +exports.ER_MFA_METHODS_INVALID_ORDER = 4062; +exports.ER_MFA_METHODS_IDENTICAL = 4063; +exports.ER_INVALID_MFA_OPERATIONS_FOR_PASSWORDLESS_USER = 4064; +exports.ER_CHANGE_REPLICATION_SOURCE_NO_OPTIONS_FOR_GTID_ONLY = 4065; +exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_REQ_ROW_FORMAT_WITH_GTID_ONLY = 4066; +exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POSITION_WITH_GTID_ONLY = 4067; +exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_GTID_ONLY_WITHOUT_POSITIONS = 4068; +exports.ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POS_WITHOUT_POSITIONS = 4069; +exports.ER_CHANGE_REP_SOURCE_GR_CHANNEL_WITH_GTID_MODE_NOT_ON = 4070; +exports.ER_CANT_USE_GTID_ONLY_WITH_GTID_MODE_NOT_ON = 4071; +exports.ER_WARN_C_DISABLE_GTID_ONLY_WITH_SOURCE_AUTO_POS_INVALID_POS = 4072; +exports.ER_DA_SSL_FIPS_MODE_ERROR = 4073; +exports.ER_VALUE_OUT_OF_RANGE = 4074; +exports.ER_FULLTEXT_WITH_ROLLUP = 4075; +exports.ER_REGEXP_MISSING_RESOURCE = 4076; +exports.ER_WARN_REGEXP_USING_DEFAULT = 4077; +exports.ER_REGEXP_MISSING_FILE = 4078; +exports.ER_WARN_DEPRECATED_COLLATION = 4079; +exports.ER_CONCURRENT_PROCEDURE_USAGE = 4080; +exports.ER_DA_GLOBAL_CONN_LIMIT = 4081; +exports.ER_DA_CONN_LIMIT = 4082; +exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE_INSTANT = 4083; +exports.ER_WARN_SF_UDF_NAME_COLLISION = 4084; +exports.ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK = 4085; +exports.ER_TOO_MANY_WINDOWS = 4086; +exports.ER_MYSQLBACKUP_CLIENT_MSG = 4087; +exports.ER_COMMENT_CONTAINS_INVALID_STRING = 4088; +exports.ER_DEFINITION_CONTAINS_INVALID_STRING = 4089; +exports.ER_CANT_EXECUTE_COMMAND_WITH_ASSIGNED_GTID_NEXT = 4090; +exports.ER_XA_TEMP_TABLE = 4091; +exports.ER_INNODB_MAX_ROW_VERSION = 4092; +exports.ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_SIZE = 4093; +exports.ER_OPERATION_NOT_ALLOWED_WHILE_PRIMARY_CHANGE_IS_RUNNING = 4094; +exports.ER_WARN_DEPRECATED_DATETIME_DELIMITER = 4095; +exports.ER_WARN_DEPRECATED_SUPERFLUOUS_DELIMITER = 4096; +exports.ER_CANNOT_PERSIST_SENSITIVE_VARIABLES = 4097; +exports.ER_WARN_CANNOT_SECURELY_PERSIST_SENSITIVE_VARIABLES = 4098; +exports.ER_WARN_TRG_ALREADY_EXISTS = 4099; +exports.ER_IF_NOT_EXISTS_UNSUPPORTED_TRG_EXISTS_ON_DIFFERENT_TABLE = 4100; +exports.ER_IF_NOT_EXISTS_UNSUPPORTED_UDF_NATIVE_FCT_NAME_COLLISION = 4101; +exports.ER_SET_PASSWORD_AUTH_PLUGIN_ERROR = 4102; +exports.ER_REDUCED_DBLWR_FILE_CORRUPTED = 4103; +exports.ER_REDUCED_DBLWR_PAGE_FOUND = 4104; +exports.ER_SRS_INVALID_LATITUDE_OF_ORIGIN = 4105; +exports.ER_SRS_INVALID_LONGITUDE_OF_ORIGIN = 4106; +exports.ER_SRS_UNUSED_PROJ_PARAMETER_PRESENT = 4107; +exports.ER_GIPK_COLUMN_EXISTS = 4108; +exports.ER_GIPK_FAILED_AUTOINC_COLUMN_EXISTS = 4109; +exports.ER_GIPK_COLUMN_ALTER_NOT_ALLOWED = 4110; +exports.ER_DROP_PK_COLUMN_TO_DROP_GIPK = 4111; +exports.ER_CREATE_SELECT_WITH_GIPK_DISALLOWED_IN_SBR = 4112; +exports.ER_DA_EXPIRE_LOGS_DAYS_IGNORED = 4113; +exports.ER_CTE_RECURSIVE_NOT_UNION = 4114; +exports.ER_COMMAND_BACKEND_FAILED_TO_FETCH_SECURITY_CTX = 4115; +exports.ER_COMMAND_SERVICE_BACKEND_FAILED = 4116; +exports.ER_CLIENT_FILE_PRIVILEGE_FOR_REPLICATION_CHECKS = 4117; +exports.ER_GROUP_REPLICATION_FORCE_MEMBERS_COMMAND_FAILURE = 4118; +exports.ER_WARN_DEPRECATED_IDENT = 4119; +exports.ER_INTERSECT_ALL_MAX_DUPLICATES_EXCEEDED = 4120; +exports.ER_TP_QUERY_THRS_PER_GRP_EXCEEDS_TXN_THR_LIMIT = 4121; +exports.ER_BAD_TIMESTAMP_FORMAT = 4122; +exports.ER_SHAPE_PRIDICTION_UDF = 4123; +exports.ER_SRS_INVALID_HEIGHT = 4124; +exports.ER_SRS_INVALID_SCALING = 4125; +exports.ER_SRS_INVALID_ZONE_WIDTH = 4126; +exports.ER_SRS_INVALID_LATITUDE_POLAR_STERE_VAR_A = 4127; +exports.ER_WARN_DEPRECATED_CLIENT_NO_SCHEMA_OPTION = 4128; +exports.ER_TABLE_NOT_EMPTY = 4129; +exports.ER_TABLE_NO_PRIMARY_KEY = 4130; +exports.ER_TABLE_IN_SHARED_TABLESPACE = 4131; +exports.ER_INDEX_OTHER_THAN_PK = 4132; +exports.ER_LOAD_BULK_DATA_UNSORTED = 4133; +exports.ER_BULK_EXECUTOR_ERROR = 4134; +exports.ER_BULK_READER_LIBCURL_INIT_FAILED = 4135; +exports.ER_BULK_READER_LIBCURL_ERROR = 4136; +exports.ER_BULK_READER_SERVER_ERROR = 4137; +exports.ER_BULK_READER_COMMUNICATION_ERROR = 4138; +exports.ER_BULK_LOAD_DATA_FAILED = 4139; +exports.ER_BULK_LOADER_COLUMN_TOO_BIG_FOR_LEFTOVER_BUFFER = 4140; +exports.ER_BULK_LOADER_COMPONENT_ERROR = 4141; +exports.ER_BULK_LOADER_FILE_CONTAINS_LESS_LINES_THAN_IGNORE_CLAUSE = 4142; +exports.ER_BULK_PARSER_MISSING_ENCLOSED_BY = 4143; +exports.ER_BULK_PARSER_ROW_BUFFER_MAX_TOTAL_COLS_EXCEEDED = 4144; +exports.ER_BULK_PARSER_COPY_BUFFER_SIZE_EXCEEDED = 4145; +exports.ER_BULK_PARSER_UNEXPECTED_END_OF_INPUT = 4146; +exports.ER_BULK_PARSER_UNEXPECTED_ROW_TERMINATOR = 4147; +exports.ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_ENDING_ENCLOSED_BY = 4148; +exports.ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_NULL_ESCAPE = 4149; +exports.ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_COLUMN_TERMINATOR = 4150; +exports.ER_BULK_PARSER_INCOMPLETE_ESCAPE_SEQUENCE = 4151; +exports.ER_LOAD_BULK_DATA_FAILED = 4152; +exports.ER_LOAD_BULK_DATA_WRONG_VALUE_FOR_FIELD = 4153; +exports.ER_LOAD_BULK_DATA_WARN_NULL_TO_NOTNULL = 4154; +exports.ER_REQUIRE_TABLE_PRIMARY_KEY_CHECK_GENERATE_WITH_GR = 4155; +exports.ER_CANT_CHANGE_SYS_VAR_IN_READ_ONLY_MODE = 4156; +exports.ER_INNODB_INSTANT_ADD_DROP_NOT_SUPPORTED_MAX_SIZE = 4157; +exports.ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_FIELDS = 4158; +exports.ER_CANT_SET_PERSISTED = 4159; +exports.ER_INSTALL_COMPONENT_SET_NULL_VALUE = 4160; +exports.ER_INSTALL_COMPONENT_SET_UNUSED_VALUE = 4161; +exports.ER_WARN_DEPRECATED_USER_DEFINED_COLLATIONS = 4162; + +// Lookup-by-number table +exports[1] = 'EE_CANTCREATEFILE'; +exports[2] = 'EE_READ'; +exports[3] = 'EE_WRITE'; +exports[4] = 'EE_BADCLOSE'; +exports[5] = 'EE_OUTOFMEMORY'; +exports[6] = 'EE_DELETE'; +exports[7] = 'EE_LINK'; +exports[9] = 'EE_EOFERR'; +exports[10] = 'EE_CANTLOCK'; +exports[11] = 'EE_CANTUNLOCK'; +exports[12] = 'EE_DIR'; +exports[13] = 'EE_STAT'; +exports[14] = 'EE_CANT_CHSIZE'; +exports[15] = 'EE_CANT_OPEN_STREAM'; +exports[16] = 'EE_GETWD'; +exports[17] = 'EE_SETWD'; +exports[18] = 'EE_LINK_WARNING'; +exports[19] = 'EE_OPEN_WARNING'; +exports[20] = 'EE_DISK_FULL'; +exports[21] = 'EE_CANT_MKDIR'; +exports[22] = 'EE_UNKNOWN_CHARSET'; +exports[23] = 'EE_OUT_OF_FILERESOURCES'; +exports[24] = 'EE_CANT_READLINK'; +exports[25] = 'EE_CANT_SYMLINK'; +exports[26] = 'EE_REALPATH'; +exports[27] = 'EE_SYNC'; +exports[28] = 'EE_UNKNOWN_COLLATION'; +exports[29] = 'EE_FILENOTFOUND'; +exports[30] = 'EE_FILE_NOT_CLOSED'; +exports[31] = 'EE_CHANGE_OWNERSHIP'; +exports[32] = 'EE_CHANGE_PERMISSIONS'; +exports[33] = 'EE_CANT_SEEK'; +exports[34] = 'EE_CAPACITY_EXCEEDED'; +exports[35] = 'EE_DISK_FULL_WITH_RETRY_MSG'; +exports[36] = 'EE_FAILED_TO_CREATE_TIMER'; +exports[37] = 'EE_FAILED_TO_DELETE_TIMER'; +exports[38] = 'EE_FAILED_TO_CREATE_TIMER_QUEUE'; +exports[39] = 'EE_FAILED_TO_START_TIMER_NOTIFY_THREAD'; +exports[40] = 'EE_FAILED_TO_CREATE_TIMER_NOTIFY_THREAD_INTERRUPT_EVENT'; +exports[41] = 'EE_EXITING_TIMER_NOTIFY_THREAD'; +exports[42] = 'EE_WIN_LIBRARY_LOAD_FAILED'; +exports[43] = 'EE_WIN_RUN_TIME_ERROR_CHECK'; +exports[44] = 'EE_FAILED_TO_DETERMINE_LARGE_PAGE_SIZE'; +exports[45] = 'EE_FAILED_TO_KILL_ALL_THREADS'; +exports[46] = 'EE_FAILED_TO_CREATE_IO_COMPLETION_PORT'; +exports[47] = 'EE_FAILED_TO_OPEN_DEFAULTS_FILE'; +exports[48] = 'EE_FAILED_TO_HANDLE_DEFAULTS_FILE'; +exports[49] = 'EE_WRONG_DIRECTIVE_IN_CONFIG_FILE'; +exports[50] = 'EE_SKIPPING_DIRECTIVE_DUE_TO_MAX_INCLUDE_RECURSION'; +exports[51] = 'EE_INCORRECT_GRP_DEFINITION_IN_CONFIG_FILE'; +exports[52] = 'EE_OPTION_WITHOUT_GRP_IN_CONFIG_FILE'; +exports[53] = 'EE_CONFIG_FILE_PERMISSION_ERROR'; +exports[54] = 'EE_IGNORE_WORLD_WRITABLE_CONFIG_FILE'; +exports[55] = 'EE_USING_DISABLED_OPTION'; +exports[56] = 'EE_USING_DISABLED_SHORT_OPTION'; +exports[57] = 'EE_USING_PASSWORD_ON_CLI_IS_INSECURE'; +exports[58] = 'EE_UNKNOWN_SUFFIX_FOR_VARIABLE'; +exports[59] = 'EE_SSL_ERROR_FROM_FILE'; +exports[60] = 'EE_SSL_ERROR'; +exports[61] = 'EE_NET_SEND_ERROR_IN_BOOTSTRAP'; +exports[62] = 'EE_PACKETS_OUT_OF_ORDER'; +exports[63] = 'EE_UNKNOWN_PROTOCOL_OPTION'; +exports[64] = 'EE_FAILED_TO_LOCATE_SERVER_PUBLIC_KEY'; +exports[65] = 'EE_PUBLIC_KEY_NOT_IN_PEM_FORMAT'; +exports[66] = 'EE_DEBUG_INFO'; +exports[67] = 'EE_UNKNOWN_VARIABLE'; +exports[68] = 'EE_UNKNOWN_OPTION'; +exports[69] = 'EE_UNKNOWN_SHORT_OPTION'; +exports[70] = 'EE_OPTION_WITHOUT_ARGUMENT'; +exports[71] = 'EE_OPTION_REQUIRES_ARGUMENT'; +exports[72] = 'EE_SHORT_OPTION_REQUIRES_ARGUMENT'; +exports[73] = 'EE_OPTION_IGNORED_DUE_TO_INVALID_VALUE'; +exports[74] = 'EE_OPTION_WITH_EMPTY_VALUE'; +exports[75] = 'EE_FAILED_TO_ASSIGN_MAX_VALUE_TO_OPTION'; +exports[76] = 'EE_INCORRECT_BOOLEAN_VALUE_FOR_OPTION'; +exports[77] = 'EE_FAILED_TO_SET_OPTION_VALUE'; +exports[78] = 'EE_INCORRECT_INT_VALUE_FOR_OPTION'; +exports[79] = 'EE_INCORRECT_UINT_VALUE_FOR_OPTION'; +exports[80] = 'EE_ADJUSTED_SIGNED_VALUE_FOR_OPTION'; +exports[81] = 'EE_ADJUSTED_UNSIGNED_VALUE_FOR_OPTION'; +exports[82] = 'EE_ADJUSTED_ULONGLONG_VALUE_FOR_OPTION'; +exports[83] = 'EE_ADJUSTED_DOUBLE_VALUE_FOR_OPTION'; +exports[84] = 'EE_INVALID_DECIMAL_VALUE_FOR_OPTION'; +exports[85] = 'EE_COLLATION_PARSER_ERROR'; +exports[86] = 'EE_FAILED_TO_RESET_BEFORE_PRIMARY_IGNORABLE_CHAR'; +exports[87] = 'EE_FAILED_TO_RESET_BEFORE_TERTIARY_IGNORABLE_CHAR'; +exports[88] = 'EE_SHIFT_CHAR_OUT_OF_RANGE'; +exports[89] = 'EE_RESET_CHAR_OUT_OF_RANGE'; +exports[90] = 'EE_UNKNOWN_LDML_TAG'; +exports[91] = 'EE_FAILED_TO_RESET_BEFORE_SECONDARY_IGNORABLE_CHAR'; +exports[92] = 'EE_FAILED_PROCESSING_DIRECTIVE'; +exports[93] = 'EE_PTHREAD_KILL_FAILED'; +exports[120] = 'HA_ERR_KEY_NOT_FOUND'; +exports[121] = 'HA_ERR_FOUND_DUPP_KEY'; +exports[122] = 'HA_ERR_INTERNAL_ERROR'; +exports[123] = 'HA_ERR_RECORD_CHANGED'; +exports[124] = 'HA_ERR_WRONG_INDEX'; +exports[125] = 'HA_ERR_ROLLED_BACK'; +exports[126] = 'HA_ERR_CRASHED'; +exports[127] = 'HA_ERR_WRONG_IN_RECORD'; +exports[128] = 'HA_ERR_OUT_OF_MEM'; +exports[130] = 'HA_ERR_NOT_A_TABLE'; +exports[131] = 'HA_ERR_WRONG_COMMAND'; +exports[132] = 'HA_ERR_OLD_FILE'; +exports[133] = 'HA_ERR_NO_ACTIVE_RECORD'; +exports[134] = 'HA_ERR_RECORD_DELETED'; +exports[135] = 'HA_ERR_RECORD_FILE_FULL'; +exports[136] = 'HA_ERR_INDEX_FILE_FULL'; +exports[137] = 'HA_ERR_END_OF_FILE'; +exports[138] = 'HA_ERR_UNSUPPORTED'; +exports[139] = 'HA_ERR_TOO_BIG_ROW'; +exports[140] = 'HA_WRONG_CREATE_OPTION'; +exports[141] = 'HA_ERR_FOUND_DUPP_UNIQUE'; +exports[142] = 'HA_ERR_UNKNOWN_CHARSET'; +exports[143] = 'HA_ERR_WRONG_MRG_TABLE_DEF'; +exports[144] = 'HA_ERR_CRASHED_ON_REPAIR'; +exports[145] = 'HA_ERR_CRASHED_ON_USAGE'; +exports[146] = 'HA_ERR_LOCK_WAIT_TIMEOUT'; +exports[147] = 'HA_ERR_LOCK_TABLE_FULL'; +exports[148] = 'HA_ERR_READ_ONLY_TRANSACTION'; +exports[149] = 'HA_ERR_LOCK_DEADLOCK'; +exports[150] = 'HA_ERR_CANNOT_ADD_FOREIGN'; +exports[151] = 'HA_ERR_NO_REFERENCED_ROW'; +exports[152] = 'HA_ERR_ROW_IS_REFERENCED'; +exports[153] = 'HA_ERR_NO_SAVEPOINT'; +exports[154] = 'HA_ERR_NON_UNIQUE_BLOCK_SIZE'; +exports[155] = 'HA_ERR_NO_SUCH_TABLE'; +exports[156] = 'HA_ERR_TABLE_EXIST'; +exports[157] = 'HA_ERR_NO_CONNECTION'; +exports[158] = 'HA_ERR_NULL_IN_SPATIAL'; +exports[159] = 'HA_ERR_TABLE_DEF_CHANGED'; +exports[160] = 'HA_ERR_NO_PARTITION_FOUND'; +exports[161] = 'HA_ERR_RBR_LOGGING_FAILED'; +exports[162] = 'HA_ERR_DROP_INDEX_FK'; +exports[163] = 'HA_ERR_FOREIGN_DUPLICATE_KEY'; +exports[164] = 'HA_ERR_TABLE_NEEDS_UPGRADE'; +exports[165] = 'HA_ERR_TABLE_READONLY'; +exports[166] = 'HA_ERR_AUTOINC_READ_FAILED'; +exports[167] = 'HA_ERR_AUTOINC_ERANGE'; +exports[168] = 'HA_ERR_GENERIC'; +exports[169] = 'HA_ERR_RECORD_IS_THE_SAME'; +exports[170] = 'HA_ERR_LOGGING_IMPOSSIBLE'; +exports[171] = 'HA_ERR_CORRUPT_EVENT'; +exports[172] = 'HA_ERR_NEW_FILE'; +exports[173] = 'HA_ERR_ROWS_EVENT_APPLY'; +exports[174] = 'HA_ERR_INITIALIZATION'; +exports[175] = 'HA_ERR_FILE_TOO_SHORT'; +exports[176] = 'HA_ERR_WRONG_CRC'; +exports[177] = 'HA_ERR_TOO_MANY_CONCURRENT_TRXS'; +exports[178] = 'HA_ERR_NOT_IN_LOCK_PARTITIONS'; +exports[179] = 'HA_ERR_INDEX_COL_TOO_LONG'; +exports[180] = 'HA_ERR_INDEX_CORRUPT'; +exports[181] = 'HA_ERR_UNDO_REC_TOO_BIG'; +exports[182] = 'HA_FTS_INVALID_DOCID'; +exports[183] = 'HA_ERR_TABLE_IN_FK_CHECK'; +exports[184] = 'HA_ERR_TABLESPACE_EXISTS'; +exports[185] = 'HA_ERR_TOO_MANY_FIELDS'; +exports[186] = 'HA_ERR_ROW_IN_WRONG_PARTITION'; +exports[187] = 'HA_ERR_INNODB_READ_ONLY'; +exports[188] = 'HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT'; +exports[189] = 'HA_ERR_TEMP_FILE_WRITE_FAILURE'; +exports[190] = 'HA_ERR_INNODB_FORCED_RECOVERY'; +exports[191] = 'HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE'; +exports[192] = 'HA_ERR_FK_DEPTH_EXCEEDED'; +exports[193] = 'HA_MISSING_CREATE_OPTION'; +exports[194] = 'HA_ERR_SE_OUT_OF_MEMORY'; +exports[195] = 'HA_ERR_TABLE_CORRUPT'; +exports[196] = 'HA_ERR_QUERY_INTERRUPTED'; +exports[197] = 'HA_ERR_TABLESPACE_MISSING'; +exports[198] = 'HA_ERR_TABLESPACE_IS_NOT_EMPTY'; +exports[199] = 'HA_ERR_WRONG_FILE_NAME'; +exports[200] = 'HA_ERR_NOT_ALLOWED_COMMAND'; +exports[201] = 'HA_ERR_COMPUTE_FAILED'; +exports[202] = 'HA_ERR_ROW_FORMAT_CHANGED'; +exports[203] = 'HA_ERR_NO_WAIT_LOCK'; +exports[204] = 'HA_ERR_DISK_FULL_NOWAIT'; +exports[205] = 'HA_ERR_NO_SESSION_TEMP'; +exports[206] = 'HA_ERR_WRONG_TABLE_NAME'; +exports[207] = 'HA_ERR_TOO_LONG_PATH'; +exports[208] = 'HA_ERR_SAMPLING_INIT_FAILED'; +exports[209] = 'HA_ERR_FTS_TOO_MANY_NESTED_EXP'; +exports[1000] = 'ER_HASHCHK'; +exports[1001] = 'ER_NISAMCHK'; +exports[1002] = 'ER_NO'; +exports[1003] = 'ER_YES'; +exports[1004] = 'ER_CANT_CREATE_FILE'; +exports[1005] = 'ER_CANT_CREATE_TABLE'; +exports[1006] = 'ER_CANT_CREATE_DB'; +exports[1007] = 'ER_DB_CREATE_EXISTS'; +exports[1008] = 'ER_DB_DROP_EXISTS'; +exports[1009] = 'ER_DB_DROP_DELETE'; +exports[1010] = 'ER_DB_DROP_RMDIR'; +exports[1011] = 'ER_CANT_DELETE_FILE'; +exports[1012] = 'ER_CANT_FIND_SYSTEM_REC'; +exports[1013] = 'ER_CANT_GET_STAT'; +exports[1014] = 'ER_CANT_GET_WD'; +exports[1015] = 'ER_CANT_LOCK'; +exports[1016] = 'ER_CANT_OPEN_FILE'; +exports[1017] = 'ER_FILE_NOT_FOUND'; +exports[1018] = 'ER_CANT_READ_DIR'; +exports[1019] = 'ER_CANT_SET_WD'; +exports[1020] = 'ER_CHECKREAD'; +exports[1021] = 'ER_DISK_FULL'; +exports[1022] = 'ER_DUP_KEY'; +exports[1023] = 'ER_ERROR_ON_CLOSE'; +exports[1024] = 'ER_ERROR_ON_READ'; +exports[1025] = 'ER_ERROR_ON_RENAME'; +exports[1026] = 'ER_ERROR_ON_WRITE'; +exports[1027] = 'ER_FILE_USED'; +exports[1028] = 'ER_FILSORT_ABORT'; +exports[1029] = 'ER_FORM_NOT_FOUND'; +exports[1030] = 'ER_GET_ERRNO'; +exports[1031] = 'ER_ILLEGAL_HA'; +exports[1032] = 'ER_KEY_NOT_FOUND'; +exports[1033] = 'ER_NOT_FORM_FILE'; +exports[1034] = 'ER_NOT_KEYFILE'; +exports[1035] = 'ER_OLD_KEYFILE'; +exports[1036] = 'ER_OPEN_AS_READONLY'; +exports[1037] = 'ER_OUTOFMEMORY'; +exports[1038] = 'ER_OUT_OF_SORTMEMORY'; +exports[1039] = 'ER_UNEXPECTED_EOF'; +exports[1040] = 'ER_CON_COUNT_ERROR'; +exports[1041] = 'ER_OUT_OF_RESOURCES'; +exports[1042] = 'ER_BAD_HOST_ERROR'; +exports[1043] = 'ER_HANDSHAKE_ERROR'; +exports[1044] = 'ER_DBACCESS_DENIED_ERROR'; +exports[1045] = 'ER_ACCESS_DENIED_ERROR'; +exports[1046] = 'ER_NO_DB_ERROR'; +exports[1047] = 'ER_UNKNOWN_COM_ERROR'; +exports[1048] = 'ER_BAD_NULL_ERROR'; +exports[1049] = 'ER_BAD_DB_ERROR'; +exports[1050] = 'ER_TABLE_EXISTS_ERROR'; +exports[1051] = 'ER_BAD_TABLE_ERROR'; +exports[1052] = 'ER_NON_UNIQ_ERROR'; +exports[1053] = 'ER_SERVER_SHUTDOWN'; +exports[1054] = 'ER_BAD_FIELD_ERROR'; +exports[1055] = 'ER_WRONG_FIELD_WITH_GROUP'; +exports[1056] = 'ER_WRONG_GROUP_FIELD'; +exports[1057] = 'ER_WRONG_SUM_SELECT'; +exports[1058] = 'ER_WRONG_VALUE_COUNT'; +exports[1059] = 'ER_TOO_LONG_IDENT'; +exports[1060] = 'ER_DUP_FIELDNAME'; +exports[1061] = 'ER_DUP_KEYNAME'; +exports[1062] = 'ER_DUP_ENTRY'; +exports[1063] = 'ER_WRONG_FIELD_SPEC'; +exports[1064] = 'ER_PARSE_ERROR'; +exports[1065] = 'ER_EMPTY_QUERY'; +exports[1066] = 'ER_NONUNIQ_TABLE'; +exports[1067] = 'ER_INVALID_DEFAULT'; +exports[1068] = 'ER_MULTIPLE_PRI_KEY'; +exports[1069] = 'ER_TOO_MANY_KEYS'; +exports[1070] = 'ER_TOO_MANY_KEY_PARTS'; +exports[1071] = 'ER_TOO_LONG_KEY'; +exports[1072] = 'ER_KEY_COLUMN_DOES_NOT_EXITS'; +exports[1073] = 'ER_BLOB_USED_AS_KEY'; +exports[1074] = 'ER_TOO_BIG_FIELDLENGTH'; +exports[1075] = 'ER_WRONG_AUTO_KEY'; +exports[1076] = 'ER_READY'; +exports[1077] = 'ER_NORMAL_SHUTDOWN'; +exports[1078] = 'ER_GOT_SIGNAL'; +exports[1079] = 'ER_SHUTDOWN_COMPLETE'; +exports[1080] = 'ER_FORCING_CLOSE'; +exports[1081] = 'ER_IPSOCK_ERROR'; +exports[1082] = 'ER_NO_SUCH_INDEX'; +exports[1083] = 'ER_WRONG_FIELD_TERMINATORS'; +exports[1084] = 'ER_BLOBS_AND_NO_TERMINATED'; +exports[1085] = 'ER_TEXTFILE_NOT_READABLE'; +exports[1086] = 'ER_FILE_EXISTS_ERROR'; +exports[1087] = 'ER_LOAD_INFO'; +exports[1088] = 'ER_ALTER_INFO'; +exports[1089] = 'ER_WRONG_SUB_KEY'; +exports[1090] = 'ER_CANT_REMOVE_ALL_FIELDS'; +exports[1091] = 'ER_CANT_DROP_FIELD_OR_KEY'; +exports[1092] = 'ER_INSERT_INFO'; +exports[1093] = 'ER_UPDATE_TABLE_USED'; +exports[1094] = 'ER_NO_SUCH_THREAD'; +exports[1095] = 'ER_KILL_DENIED_ERROR'; +exports[1096] = 'ER_NO_TABLES_USED'; +exports[1097] = 'ER_TOO_BIG_SET'; +exports[1098] = 'ER_NO_UNIQUE_LOGFILE'; +exports[1099] = 'ER_TABLE_NOT_LOCKED_FOR_WRITE'; +exports[1100] = 'ER_TABLE_NOT_LOCKED'; +exports[1101] = 'ER_BLOB_CANT_HAVE_DEFAULT'; +exports[1102] = 'ER_WRONG_DB_NAME'; +exports[1103] = 'ER_WRONG_TABLE_NAME'; +exports[1104] = 'ER_TOO_BIG_SELECT'; +exports[1105] = 'ER_UNKNOWN_ERROR'; +exports[1106] = 'ER_UNKNOWN_PROCEDURE'; +exports[1107] = 'ER_WRONG_PARAMCOUNT_TO_PROCEDURE'; +exports[1108] = 'ER_WRONG_PARAMETERS_TO_PROCEDURE'; +exports[1109] = 'ER_UNKNOWN_TABLE'; +exports[1110] = 'ER_FIELD_SPECIFIED_TWICE'; +exports[1111] = 'ER_INVALID_GROUP_FUNC_USE'; +exports[1112] = 'ER_UNSUPPORTED_EXTENSION'; +exports[1113] = 'ER_TABLE_MUST_HAVE_COLUMNS'; +exports[1114] = 'ER_RECORD_FILE_FULL'; +exports[1115] = 'ER_UNKNOWN_CHARACTER_SET'; +exports[1116] = 'ER_TOO_MANY_TABLES'; +exports[1117] = 'ER_TOO_MANY_FIELDS'; +exports[1118] = 'ER_TOO_BIG_ROWSIZE'; +exports[1119] = 'ER_STACK_OVERRUN'; +exports[1120] = 'ER_WRONG_OUTER_JOIN'; +exports[1121] = 'ER_NULL_COLUMN_IN_INDEX'; +exports[1122] = 'ER_CANT_FIND_UDF'; +exports[1123] = 'ER_CANT_INITIALIZE_UDF'; +exports[1124] = 'ER_UDF_NO_PATHS'; +exports[1125] = 'ER_UDF_EXISTS'; +exports[1126] = 'ER_CANT_OPEN_LIBRARY'; +exports[1127] = 'ER_CANT_FIND_DL_ENTRY'; +exports[1128] = 'ER_FUNCTION_NOT_DEFINED'; +exports[1129] = 'ER_HOST_IS_BLOCKED'; +exports[1130] = 'ER_HOST_NOT_PRIVILEGED'; +exports[1131] = 'ER_PASSWORD_ANONYMOUS_USER'; +exports[1132] = 'ER_PASSWORD_NOT_ALLOWED'; +exports[1133] = 'ER_PASSWORD_NO_MATCH'; +exports[1134] = 'ER_UPDATE_INFO'; +exports[1135] = 'ER_CANT_CREATE_THREAD'; +exports[1136] = 'ER_WRONG_VALUE_COUNT_ON_ROW'; +exports[1137] = 'ER_CANT_REOPEN_TABLE'; +exports[1138] = 'ER_INVALID_USE_OF_NULL'; +exports[1139] = 'ER_REGEXP_ERROR'; +exports[1140] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS'; +exports[1141] = 'ER_NONEXISTING_GRANT'; +exports[1142] = 'ER_TABLEACCESS_DENIED_ERROR'; +exports[1143] = 'ER_COLUMNACCESS_DENIED_ERROR'; +exports[1144] = 'ER_ILLEGAL_GRANT_FOR_TABLE'; +exports[1145] = 'ER_GRANT_WRONG_HOST_OR_USER'; +exports[1146] = 'ER_NO_SUCH_TABLE'; +exports[1147] = 'ER_NONEXISTING_TABLE_GRANT'; +exports[1148] = 'ER_NOT_ALLOWED_COMMAND'; +exports[1149] = 'ER_SYNTAX_ERROR'; +exports[1150] = 'ER_UNUSED1'; +exports[1151] = 'ER_UNUSED2'; +exports[1152] = 'ER_ABORTING_CONNECTION'; +exports[1153] = 'ER_NET_PACKET_TOO_LARGE'; +exports[1154] = 'ER_NET_READ_ERROR_FROM_PIPE'; +exports[1155] = 'ER_NET_FCNTL_ERROR'; +exports[1156] = 'ER_NET_PACKETS_OUT_OF_ORDER'; +exports[1157] = 'ER_NET_UNCOMPRESS_ERROR'; +exports[1158] = 'ER_NET_READ_ERROR'; +exports[1159] = 'ER_NET_READ_INTERRUPTED'; +exports[1160] = 'ER_NET_ERROR_ON_WRITE'; +exports[1161] = 'ER_NET_WRITE_INTERRUPTED'; +exports[1162] = 'ER_TOO_LONG_STRING'; +exports[1163] = 'ER_TABLE_CANT_HANDLE_BLOB'; +exports[1164] = 'ER_TABLE_CANT_HANDLE_AUTO_INCREMENT'; +exports[1165] = 'ER_UNUSED3'; +exports[1166] = 'ER_WRONG_COLUMN_NAME'; +exports[1167] = 'ER_WRONG_KEY_COLUMN'; +exports[1168] = 'ER_WRONG_MRG_TABLE'; +exports[1169] = 'ER_DUP_UNIQUE'; +exports[1170] = 'ER_BLOB_KEY_WITHOUT_LENGTH'; +exports[1171] = 'ER_PRIMARY_CANT_HAVE_NULL'; +exports[1172] = 'ER_TOO_MANY_ROWS'; +exports[1173] = 'ER_REQUIRES_PRIMARY_KEY'; +exports[1174] = 'ER_NO_RAID_COMPILED'; +exports[1175] = 'ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE'; +exports[1176] = 'ER_KEY_DOES_NOT_EXITS'; +exports[1177] = 'ER_CHECK_NO_SUCH_TABLE'; +exports[1178] = 'ER_CHECK_NOT_IMPLEMENTED'; +exports[1179] = 'ER_CANT_DO_THIS_DURING_AN_TRANSACTION'; +exports[1180] = 'ER_ERROR_DURING_COMMIT'; +exports[1181] = 'ER_ERROR_DURING_ROLLBACK'; +exports[1182] = 'ER_ERROR_DURING_FLUSH_LOGS'; +exports[1183] = 'ER_ERROR_DURING_CHECKPOINT'; +exports[1184] = 'ER_NEW_ABORTING_CONNECTION'; +exports[1185] = 'ER_DUMP_NOT_IMPLEMENTED'; +exports[1186] = 'ER_FLUSH_MASTER_BINLOG_CLOSED'; +exports[1187] = 'ER_INDEX_REBUILD'; +exports[1188] = 'ER_SOURCE'; +exports[1189] = 'ER_SOURCE_NET_READ'; +exports[1190] = 'ER_SOURCE_NET_WRITE'; +exports[1191] = 'ER_FT_MATCHING_KEY_NOT_FOUND'; +exports[1192] = 'ER_LOCK_OR_ACTIVE_TRANSACTION'; +exports[1193] = 'ER_UNKNOWN_SYSTEM_VARIABLE'; +exports[1194] = 'ER_CRASHED_ON_USAGE'; +exports[1195] = 'ER_CRASHED_ON_REPAIR'; +exports[1196] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK'; +exports[1197] = 'ER_TRANS_CACHE_FULL'; +exports[1198] = 'ER_SLAVE_MUST_STOP'; +exports[1199] = 'ER_REPLICA_NOT_RUNNING'; +exports[1200] = 'ER_BAD_REPLICA'; +exports[1201] = 'ER_CONNECTION_METADATA'; +exports[1202] = 'ER_REPLICA_THREAD'; +exports[1203] = 'ER_TOO_MANY_USER_CONNECTIONS'; +exports[1204] = 'ER_SET_CONSTANTS_ONLY'; +exports[1205] = 'ER_LOCK_WAIT_TIMEOUT'; +exports[1206] = 'ER_LOCK_TABLE_FULL'; +exports[1207] = 'ER_READ_ONLY_TRANSACTION'; +exports[1208] = 'ER_DROP_DB_WITH_READ_LOCK'; +exports[1209] = 'ER_CREATE_DB_WITH_READ_LOCK'; +exports[1210] = 'ER_WRONG_ARGUMENTS'; +exports[1211] = 'ER_NO_PERMISSION_TO_CREATE_USER'; +exports[1212] = 'ER_UNION_TABLES_IN_DIFFERENT_DIR'; +exports[1213] = 'ER_LOCK_DEADLOCK'; +exports[1214] = 'ER_TABLE_CANT_HANDLE_FT'; +exports[1215] = 'ER_CANNOT_ADD_FOREIGN'; +exports[1216] = 'ER_NO_REFERENCED_ROW'; +exports[1217] = 'ER_ROW_IS_REFERENCED'; +exports[1218] = 'ER_CONNECT_TO_SOURCE'; +exports[1219] = 'ER_QUERY_ON_MASTER'; +exports[1220] = 'ER_ERROR_WHEN_EXECUTING_COMMAND'; +exports[1221] = 'ER_WRONG_USAGE'; +exports[1222] = 'ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT'; +exports[1223] = 'ER_CANT_UPDATE_WITH_READLOCK'; +exports[1224] = 'ER_MIXING_NOT_ALLOWED'; +exports[1225] = 'ER_DUP_ARGUMENT'; +exports[1226] = 'ER_USER_LIMIT_REACHED'; +exports[1227] = 'ER_SPECIFIC_ACCESS_DENIED_ERROR'; +exports[1228] = 'ER_LOCAL_VARIABLE'; +exports[1229] = 'ER_GLOBAL_VARIABLE'; +exports[1230] = 'ER_NO_DEFAULT'; +exports[1231] = 'ER_WRONG_VALUE_FOR_VAR'; +exports[1232] = 'ER_WRONG_TYPE_FOR_VAR'; +exports[1233] = 'ER_VAR_CANT_BE_READ'; +exports[1234] = 'ER_CANT_USE_OPTION_HERE'; +exports[1235] = 'ER_NOT_SUPPORTED_YET'; +exports[1236] = 'ER_SOURCE_FATAL_ERROR_READING_BINLOG'; +exports[1237] = 'ER_REPLICA_IGNORED_TABLE'; +exports[1238] = 'ER_INCORRECT_GLOBAL_LOCAL_VAR'; +exports[1239] = 'ER_WRONG_FK_DEF'; +exports[1240] = 'ER_KEY_REF_DO_NOT_MATCH_TABLE_REF'; +exports[1241] = 'ER_OPERAND_COLUMNS'; +exports[1242] = 'ER_SUBQUERY_NO_1_ROW'; +exports[1243] = 'ER_UNKNOWN_STMT_HANDLER'; +exports[1244] = 'ER_CORRUPT_HELP_DB'; +exports[1245] = 'ER_CYCLIC_REFERENCE'; +exports[1246] = 'ER_AUTO_CONVERT'; +exports[1247] = 'ER_ILLEGAL_REFERENCE'; +exports[1248] = 'ER_DERIVED_MUST_HAVE_ALIAS'; +exports[1249] = 'ER_SELECT_REDUCED'; +exports[1250] = 'ER_TABLENAME_NOT_ALLOWED_HERE'; +exports[1251] = 'ER_NOT_SUPPORTED_AUTH_MODE'; +exports[1252] = 'ER_SPATIAL_CANT_HAVE_NULL'; +exports[1253] = 'ER_COLLATION_CHARSET_MISMATCH'; +exports[1254] = 'ER_SLAVE_WAS_RUNNING'; +exports[1255] = 'ER_SLAVE_WAS_NOT_RUNNING'; +exports[1256] = 'ER_TOO_BIG_FOR_UNCOMPRESS'; +exports[1257] = 'ER_ZLIB_Z_MEM_ERROR'; +exports[1258] = 'ER_ZLIB_Z_BUF_ERROR'; +exports[1259] = 'ER_ZLIB_Z_DATA_ERROR'; +exports[1260] = 'ER_CUT_VALUE_GROUP_CONCAT'; +exports[1261] = 'ER_WARN_TOO_FEW_RECORDS'; +exports[1262] = 'ER_WARN_TOO_MANY_RECORDS'; +exports[1263] = 'ER_WARN_NULL_TO_NOTNULL'; +exports[1264] = 'ER_WARN_DATA_OUT_OF_RANGE'; +exports[1265] = 'WARN_DATA_TRUNCATED'; +exports[1266] = 'ER_WARN_USING_OTHER_HANDLER'; +exports[1267] = 'ER_CANT_AGGREGATE_2COLLATIONS'; +exports[1268] = 'ER_DROP_USER'; +exports[1269] = 'ER_REVOKE_GRANTS'; +exports[1270] = 'ER_CANT_AGGREGATE_3COLLATIONS'; +exports[1271] = 'ER_CANT_AGGREGATE_NCOLLATIONS'; +exports[1272] = 'ER_VARIABLE_IS_NOT_STRUCT'; +exports[1273] = 'ER_UNKNOWN_COLLATION'; +exports[1274] = 'ER_REPLICA_IGNORED_SSL_PARAMS'; +exports[1275] = 'ER_SERVER_IS_IN_SECURE_AUTH_MODE'; +exports[1276] = 'ER_WARN_FIELD_RESOLVED'; +exports[1277] = 'ER_BAD_REPLICA_UNTIL_COND'; +exports[1278] = 'ER_MISSING_SKIP_REPLICA'; +exports[1279] = 'ER_UNTIL_COND_IGNORED'; +exports[1280] = 'ER_WRONG_NAME_FOR_INDEX'; +exports[1281] = 'ER_WRONG_NAME_FOR_CATALOG'; +exports[1282] = 'ER_WARN_QC_RESIZE'; +exports[1283] = 'ER_BAD_FT_COLUMN'; +exports[1284] = 'ER_UNKNOWN_KEY_CACHE'; +exports[1285] = 'ER_WARN_HOSTNAME_WONT_WORK'; +exports[1286] = 'ER_UNKNOWN_STORAGE_ENGINE'; +exports[1287] = 'ER_WARN_DEPRECATED_SYNTAX'; +exports[1288] = 'ER_NON_UPDATABLE_TABLE'; +exports[1289] = 'ER_FEATURE_DISABLED'; +exports[1290] = 'ER_OPTION_PREVENTS_STATEMENT'; +exports[1291] = 'ER_DUPLICATED_VALUE_IN_TYPE'; +exports[1292] = 'ER_TRUNCATED_WRONG_VALUE'; +exports[1293] = 'ER_TOO_MUCH_AUTO_TIMESTAMP_COLS'; +exports[1294] = 'ER_INVALID_ON_UPDATE'; +exports[1295] = 'ER_UNSUPPORTED_PS'; +exports[1296] = 'ER_GET_ERRMSG'; +exports[1297] = 'ER_GET_TEMPORARY_ERRMSG'; +exports[1298] = 'ER_UNKNOWN_TIME_ZONE'; +exports[1299] = 'ER_WARN_INVALID_TIMESTAMP'; +exports[1300] = 'ER_INVALID_CHARACTER_STRING'; +exports[1301] = 'ER_WARN_ALLOWED_PACKET_OVERFLOWED'; +exports[1302] = 'ER_CONFLICTING_DECLARATIONS'; +exports[1303] = 'ER_SP_NO_RECURSIVE_CREATE'; +exports[1304] = 'ER_SP_ALREADY_EXISTS'; +exports[1305] = 'ER_SP_DOES_NOT_EXIST'; +exports[1306] = 'ER_SP_DROP_FAILED'; +exports[1307] = 'ER_SP_STORE_FAILED'; +exports[1308] = 'ER_SP_LILABEL_MISMATCH'; +exports[1309] = 'ER_SP_LABEL_REDEFINE'; +exports[1310] = 'ER_SP_LABEL_MISMATCH'; +exports[1311] = 'ER_SP_UNINIT_VAR'; +exports[1312] = 'ER_SP_BADSELECT'; +exports[1313] = 'ER_SP_BADRETURN'; +exports[1314] = 'ER_SP_BADSTATEMENT'; +exports[1315] = 'ER_UPDATE_LOG_DEPRECATED_IGNORED'; +exports[1316] = 'ER_UPDATE_LOG_DEPRECATED_TRANSLATED'; +exports[1317] = 'ER_QUERY_INTERRUPTED'; +exports[1318] = 'ER_SP_WRONG_NO_OF_ARGS'; +exports[1319] = 'ER_SP_COND_MISMATCH'; +exports[1320] = 'ER_SP_NORETURN'; +exports[1321] = 'ER_SP_NORETURNEND'; +exports[1322] = 'ER_SP_BAD_CURSOR_QUERY'; +exports[1323] = 'ER_SP_BAD_CURSOR_SELECT'; +exports[1324] = 'ER_SP_CURSOR_MISMATCH'; +exports[1325] = 'ER_SP_CURSOR_ALREADY_OPEN'; +exports[1326] = 'ER_SP_CURSOR_NOT_OPEN'; +exports[1327] = 'ER_SP_UNDECLARED_VAR'; +exports[1328] = 'ER_SP_WRONG_NO_OF_FETCH_ARGS'; +exports[1329] = 'ER_SP_FETCH_NO_DATA'; +exports[1330] = 'ER_SP_DUP_PARAM'; +exports[1331] = 'ER_SP_DUP_VAR'; +exports[1332] = 'ER_SP_DUP_COND'; +exports[1333] = 'ER_SP_DUP_CURS'; +exports[1334] = 'ER_SP_CANT_ALTER'; +exports[1335] = 'ER_SP_SUBSELECT_NYI'; +exports[1336] = 'ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG'; +exports[1337] = 'ER_SP_VARCOND_AFTER_CURSHNDLR'; +exports[1338] = 'ER_SP_CURSOR_AFTER_HANDLER'; +exports[1339] = 'ER_SP_CASE_NOT_FOUND'; +exports[1340] = 'ER_FPARSER_TOO_BIG_FILE'; +exports[1341] = 'ER_FPARSER_BAD_HEADER'; +exports[1342] = 'ER_FPARSER_EOF_IN_COMMENT'; +exports[1343] = 'ER_FPARSER_ERROR_IN_PARAMETER'; +exports[1344] = 'ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER'; +exports[1345] = 'ER_VIEW_NO_EXPLAIN'; +exports[1346] = 'ER_FRM_UNKNOWN_TYPE'; +exports[1347] = 'ER_WRONG_OBJECT'; +exports[1348] = 'ER_NONUPDATEABLE_COLUMN'; +exports[1349] = 'ER_VIEW_SELECT_DERIVED'; +exports[1350] = 'ER_VIEW_SELECT_CLAUSE'; +exports[1351] = 'ER_VIEW_SELECT_VARIABLE'; +exports[1352] = 'ER_VIEW_SELECT_TMPTABLE'; +exports[1353] = 'ER_VIEW_WRONG_LIST'; +exports[1354] = 'ER_WARN_VIEW_MERGE'; +exports[1355] = 'ER_WARN_VIEW_WITHOUT_KEY'; +exports[1356] = 'ER_VIEW_INVALID'; +exports[1357] = 'ER_SP_NO_DROP_SP'; +exports[1358] = 'ER_SP_GOTO_IN_HNDLR'; +exports[1359] = 'ER_TRG_ALREADY_EXISTS'; +exports[1360] = 'ER_TRG_DOES_NOT_EXIST'; +exports[1361] = 'ER_TRG_ON_VIEW_OR_TEMP_TABLE'; +exports[1362] = 'ER_TRG_CANT_CHANGE_ROW'; +exports[1363] = 'ER_TRG_NO_SUCH_ROW_IN_TRG'; +exports[1364] = 'ER_NO_DEFAULT_FOR_FIELD'; +exports[1365] = 'ER_DIVISION_BY_ZERO'; +exports[1366] = 'ER_TRUNCATED_WRONG_VALUE_FOR_FIELD'; +exports[1367] = 'ER_ILLEGAL_VALUE_FOR_TYPE'; +exports[1368] = 'ER_VIEW_NONUPD_CHECK'; +exports[1369] = 'ER_VIEW_CHECK_FAILED'; +exports[1370] = 'ER_PROCACCESS_DENIED_ERROR'; +exports[1371] = 'ER_RELAY_LOG_FAIL'; +exports[1372] = 'ER_PASSWD_LENGTH'; +exports[1373] = 'ER_UNKNOWN_TARGET_BINLOG'; +exports[1374] = 'ER_IO_ERR_LOG_INDEX_READ'; +exports[1375] = 'ER_BINLOG_PURGE_PROHIBITED'; +exports[1376] = 'ER_FSEEK_FAIL'; +exports[1377] = 'ER_BINLOG_PURGE_FATAL_ERR'; +exports[1378] = 'ER_LOG_IN_USE'; +exports[1379] = 'ER_LOG_PURGE_UNKNOWN_ERR'; +exports[1380] = 'ER_RELAY_LOG_INIT'; +exports[1381] = 'ER_NO_BINARY_LOGGING'; +exports[1382] = 'ER_RESERVED_SYNTAX'; +exports[1383] = 'ER_WSAS_FAILED'; +exports[1384] = 'ER_DIFF_GROUPS_PROC'; +exports[1385] = 'ER_NO_GROUP_FOR_PROC'; +exports[1386] = 'ER_ORDER_WITH_PROC'; +exports[1387] = 'ER_LOGGING_PROHIBIT_CHANGING_OF'; +exports[1388] = 'ER_NO_FILE_MAPPING'; +exports[1389] = 'ER_WRONG_MAGIC'; +exports[1390] = 'ER_PS_MANY_PARAM'; +exports[1391] = 'ER_KEY_PART_0'; +exports[1392] = 'ER_VIEW_CHECKSUM'; +exports[1393] = 'ER_VIEW_MULTIUPDATE'; +exports[1394] = 'ER_VIEW_NO_INSERT_FIELD_LIST'; +exports[1395] = 'ER_VIEW_DELETE_MERGE_VIEW'; +exports[1396] = 'ER_CANNOT_USER'; +exports[1397] = 'ER_XAER_NOTA'; +exports[1398] = 'ER_XAER_INVAL'; +exports[1399] = 'ER_XAER_RMFAIL'; +exports[1400] = 'ER_XAER_OUTSIDE'; +exports[1401] = 'ER_XAER_RMERR'; +exports[1402] = 'ER_XA_RBROLLBACK'; +exports[1403] = 'ER_NONEXISTING_PROC_GRANT'; +exports[1404] = 'ER_PROC_AUTO_GRANT_FAIL'; +exports[1405] = 'ER_PROC_AUTO_REVOKE_FAIL'; +exports[1406] = 'ER_DATA_TOO_LONG'; +exports[1407] = 'ER_SP_BAD_SQLSTATE'; +exports[1408] = 'ER_STARTUP'; +exports[1409] = 'ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR'; +exports[1410] = 'ER_CANT_CREATE_USER_WITH_GRANT'; +exports[1411] = 'ER_WRONG_VALUE_FOR_TYPE'; +exports[1412] = 'ER_TABLE_DEF_CHANGED'; +exports[1413] = 'ER_SP_DUP_HANDLER'; +exports[1414] = 'ER_SP_NOT_VAR_ARG'; +exports[1415] = 'ER_SP_NO_RETSET'; +exports[1416] = 'ER_CANT_CREATE_GEOMETRY_OBJECT'; +exports[1417] = 'ER_FAILED_ROUTINE_BREAK_BINLOG'; +exports[1418] = 'ER_BINLOG_UNSAFE_ROUTINE'; +exports[1419] = 'ER_BINLOG_CREATE_ROUTINE_NEED_SUPER'; +exports[1420] = 'ER_EXEC_STMT_WITH_OPEN_CURSOR'; +exports[1421] = 'ER_STMT_HAS_NO_OPEN_CURSOR'; +exports[1422] = 'ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG'; +exports[1423] = 'ER_NO_DEFAULT_FOR_VIEW_FIELD'; +exports[1424] = 'ER_SP_NO_RECURSION'; +exports[1425] = 'ER_TOO_BIG_SCALE'; +exports[1426] = 'ER_TOO_BIG_PRECISION'; +exports[1427] = 'ER_M_BIGGER_THAN_D'; +exports[1428] = 'ER_WRONG_LOCK_OF_SYSTEM_TABLE'; +exports[1429] = 'ER_CONNECT_TO_FOREIGN_DATA_SOURCE'; +exports[1430] = 'ER_QUERY_ON_FOREIGN_DATA_SOURCE'; +exports[1431] = 'ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST'; +exports[1432] = 'ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE'; +exports[1433] = 'ER_FOREIGN_DATA_STRING_INVALID'; +exports[1434] = 'ER_CANT_CREATE_FEDERATED_TABLE'; +exports[1435] = 'ER_TRG_IN_WRONG_SCHEMA'; +exports[1436] = 'ER_STACK_OVERRUN_NEED_MORE'; +exports[1437] = 'ER_TOO_LONG_BODY'; +exports[1438] = 'ER_WARN_CANT_DROP_DEFAULT_KEYCACHE'; +exports[1439] = 'ER_TOO_BIG_DISPLAYWIDTH'; +exports[1440] = 'ER_XAER_DUPID'; +exports[1441] = 'ER_DATETIME_FUNCTION_OVERFLOW'; +exports[1442] = 'ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG'; +exports[1443] = 'ER_VIEW_PREVENT_UPDATE'; +exports[1444] = 'ER_PS_NO_RECURSION'; +exports[1445] = 'ER_SP_CANT_SET_AUTOCOMMIT'; +exports[1446] = 'ER_MALFORMED_DEFINER'; +exports[1447] = 'ER_VIEW_FRM_NO_USER'; +exports[1448] = 'ER_VIEW_OTHER_USER'; +exports[1449] = 'ER_NO_SUCH_USER'; +exports[1450] = 'ER_FORBID_SCHEMA_CHANGE'; +exports[1451] = 'ER_ROW_IS_REFERENCED_2'; +exports[1452] = 'ER_NO_REFERENCED_ROW_2'; +exports[1453] = 'ER_SP_BAD_VAR_SHADOW'; +exports[1454] = 'ER_TRG_NO_DEFINER'; +exports[1455] = 'ER_OLD_FILE_FORMAT'; +exports[1456] = 'ER_SP_RECURSION_LIMIT'; +exports[1457] = 'ER_SP_PROC_TABLE_CORRUPT'; +exports[1458] = 'ER_SP_WRONG_NAME'; +exports[1459] = 'ER_TABLE_NEEDS_UPGRADE'; +exports[1460] = 'ER_SP_NO_AGGREGATE'; +exports[1461] = 'ER_MAX_PREPARED_STMT_COUNT_REACHED'; +exports[1462] = 'ER_VIEW_RECURSIVE'; +exports[1463] = 'ER_NON_GROUPING_FIELD_USED'; +exports[1464] = 'ER_TABLE_CANT_HANDLE_SPKEYS'; +exports[1465] = 'ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA'; +exports[1466] = 'ER_REMOVED_SPACES'; +exports[1467] = 'ER_AUTOINC_READ_FAILED'; +exports[1468] = 'ER_USERNAME'; +exports[1469] = 'ER_HOSTNAME'; +exports[1470] = 'ER_WRONG_STRING_LENGTH'; +exports[1471] = 'ER_NON_INSERTABLE_TABLE'; +exports[1472] = 'ER_ADMIN_WRONG_MRG_TABLE'; +exports[1473] = 'ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT'; +exports[1474] = 'ER_NAME_BECOMES_EMPTY'; +exports[1475] = 'ER_AMBIGUOUS_FIELD_TERM'; +exports[1476] = 'ER_FOREIGN_SERVER_EXISTS'; +exports[1477] = 'ER_FOREIGN_SERVER_DOESNT_EXIST'; +exports[1478] = 'ER_ILLEGAL_HA_CREATE_OPTION'; +exports[1479] = 'ER_PARTITION_REQUIRES_VALUES_ERROR'; +exports[1480] = 'ER_PARTITION_WRONG_VALUES_ERROR'; +exports[1481] = 'ER_PARTITION_MAXVALUE_ERROR'; +exports[1482] = 'ER_PARTITION_SUBPARTITION_ERROR'; +exports[1483] = 'ER_PARTITION_SUBPART_MIX_ERROR'; +exports[1484] = 'ER_PARTITION_WRONG_NO_PART_ERROR'; +exports[1485] = 'ER_PARTITION_WRONG_NO_SUBPART_ERROR'; +exports[1486] = 'ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR'; +exports[1487] = 'ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR'; +exports[1488] = 'ER_FIELD_NOT_FOUND_PART_ERROR'; +exports[1489] = 'ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR'; +exports[1490] = 'ER_INCONSISTENT_PARTITION_INFO_ERROR'; +exports[1491] = 'ER_PARTITION_FUNC_NOT_ALLOWED_ERROR'; +exports[1492] = 'ER_PARTITIONS_MUST_BE_DEFINED_ERROR'; +exports[1493] = 'ER_RANGE_NOT_INCREASING_ERROR'; +exports[1494] = 'ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR'; +exports[1495] = 'ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR'; +exports[1496] = 'ER_PARTITION_ENTRY_ERROR'; +exports[1497] = 'ER_MIX_HANDLER_ERROR'; +exports[1498] = 'ER_PARTITION_NOT_DEFINED_ERROR'; +exports[1499] = 'ER_TOO_MANY_PARTITIONS_ERROR'; +exports[1500] = 'ER_SUBPARTITION_ERROR'; +exports[1501] = 'ER_CANT_CREATE_HANDLER_FILE'; +exports[1502] = 'ER_BLOB_FIELD_IN_PART_FUNC_ERROR'; +exports[1503] = 'ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF'; +exports[1504] = 'ER_NO_PARTS_ERROR'; +exports[1505] = 'ER_PARTITION_MGMT_ON_NONPARTITIONED'; +exports[1506] = 'ER_FOREIGN_KEY_ON_PARTITIONED'; +exports[1507] = 'ER_DROP_PARTITION_NON_EXISTENT'; +exports[1508] = 'ER_DROP_LAST_PARTITION'; +exports[1509] = 'ER_COALESCE_ONLY_ON_HASH_PARTITION'; +exports[1510] = 'ER_REORG_HASH_ONLY_ON_SAME_NO'; +exports[1511] = 'ER_REORG_NO_PARAM_ERROR'; +exports[1512] = 'ER_ONLY_ON_RANGE_LIST_PARTITION'; +exports[1513] = 'ER_ADD_PARTITION_SUBPART_ERROR'; +exports[1514] = 'ER_ADD_PARTITION_NO_NEW_PARTITION'; +exports[1515] = 'ER_COALESCE_PARTITION_NO_PARTITION'; +exports[1516] = 'ER_REORG_PARTITION_NOT_EXIST'; +exports[1517] = 'ER_SAME_NAME_PARTITION'; +exports[1518] = 'ER_NO_BINLOG_ERROR'; +exports[1519] = 'ER_CONSECUTIVE_REORG_PARTITIONS'; +exports[1520] = 'ER_REORG_OUTSIDE_RANGE'; +exports[1521] = 'ER_PARTITION_FUNCTION_FAILURE'; +exports[1522] = 'ER_PART_STATE_ERROR'; +exports[1523] = 'ER_LIMITED_PART_RANGE'; +exports[1524] = 'ER_PLUGIN_IS_NOT_LOADED'; +exports[1525] = 'ER_WRONG_VALUE'; +exports[1526] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE'; +exports[1527] = 'ER_FILEGROUP_OPTION_ONLY_ONCE'; +exports[1528] = 'ER_CREATE_FILEGROUP_FAILED'; +exports[1529] = 'ER_DROP_FILEGROUP_FAILED'; +exports[1530] = 'ER_TABLESPACE_AUTO_EXTEND_ERROR'; +exports[1531] = 'ER_WRONG_SIZE_NUMBER'; +exports[1532] = 'ER_SIZE_OVERFLOW_ERROR'; +exports[1533] = 'ER_ALTER_FILEGROUP_FAILED'; +exports[1534] = 'ER_BINLOG_ROW_LOGGING_FAILED'; +exports[1535] = 'ER_BINLOG_ROW_WRONG_TABLE_DEF'; +exports[1536] = 'ER_BINLOG_ROW_RBR_TO_SBR'; +exports[1537] = 'ER_EVENT_ALREADY_EXISTS'; +exports[1538] = 'ER_EVENT_STORE_FAILED'; +exports[1539] = 'ER_EVENT_DOES_NOT_EXIST'; +exports[1540] = 'ER_EVENT_CANT_ALTER'; +exports[1541] = 'ER_EVENT_DROP_FAILED'; +exports[1542] = 'ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG'; +exports[1543] = 'ER_EVENT_ENDS_BEFORE_STARTS'; +exports[1544] = 'ER_EVENT_EXEC_TIME_IN_THE_PAST'; +exports[1545] = 'ER_EVENT_OPEN_TABLE_FAILED'; +exports[1546] = 'ER_EVENT_NEITHER_M_EXPR_NOR_M_AT'; +exports[1547] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED'; +exports[1548] = 'ER_CANNOT_LOAD_FROM_TABLE'; +exports[1549] = 'ER_EVENT_CANNOT_DELETE'; +exports[1550] = 'ER_EVENT_COMPILE_ERROR'; +exports[1551] = 'ER_EVENT_SAME_NAME'; +exports[1552] = 'ER_EVENT_DATA_TOO_LONG'; +exports[1553] = 'ER_DROP_INDEX_FK'; +exports[1554] = 'ER_WARN_DEPRECATED_SYNTAX_WITH_VER'; +exports[1555] = 'ER_CANT_WRITE_LOCK_LOG_TABLE'; +exports[1556] = 'ER_CANT_LOCK_LOG_TABLE'; +exports[1557] = 'ER_FOREIGN_DUPLICATE_KEY'; +exports[1558] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE'; +exports[1559] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR'; +exports[1560] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT'; +exports[1561] = 'ER_NDB_CANT_SWITCH_BINLOG_FORMAT'; +exports[1562] = 'ER_PARTITION_NO_TEMPORARY'; +exports[1563] = 'ER_PARTITION_CONST_DOMAIN_ERROR'; +exports[1564] = 'ER_PARTITION_FUNCTION_IS_NOT_ALLOWED'; +exports[1565] = 'ER_DDL_LOG_ERROR'; +exports[1566] = 'ER_NULL_IN_VALUES_LESS_THAN'; +exports[1567] = 'ER_WRONG_PARTITION_NAME'; +exports[1568] = 'ER_CANT_CHANGE_TX_CHARACTERISTICS'; +exports[1569] = 'ER_DUP_ENTRY_AUTOINCREMENT_CASE'; +exports[1570] = 'ER_EVENT_MODIFY_QUEUE_ERROR'; +exports[1571] = 'ER_EVENT_SET_VAR_ERROR'; +exports[1572] = 'ER_PARTITION_MERGE_ERROR'; +exports[1573] = 'ER_CANT_ACTIVATE_LOG'; +exports[1574] = 'ER_RBR_NOT_AVAILABLE'; +exports[1575] = 'ER_BASE64_DECODE_ERROR'; +exports[1576] = 'ER_EVENT_RECURSION_FORBIDDEN'; +exports[1577] = 'ER_EVENTS_DB_ERROR'; +exports[1578] = 'ER_ONLY_INTEGERS_ALLOWED'; +exports[1579] = 'ER_UNSUPORTED_LOG_ENGINE'; +exports[1580] = 'ER_BAD_LOG_STATEMENT'; +exports[1581] = 'ER_CANT_RENAME_LOG_TABLE'; +exports[1582] = 'ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT'; +exports[1583] = 'ER_WRONG_PARAMETERS_TO_NATIVE_FCT'; +exports[1584] = 'ER_WRONG_PARAMETERS_TO_STORED_FCT'; +exports[1585] = 'ER_NATIVE_FCT_NAME_COLLISION'; +exports[1586] = 'ER_DUP_ENTRY_WITH_KEY_NAME'; +exports[1587] = 'ER_BINLOG_PURGE_EMFILE'; +exports[1588] = 'ER_EVENT_CANNOT_CREATE_IN_THE_PAST'; +exports[1589] = 'ER_EVENT_CANNOT_ALTER_IN_THE_PAST'; +exports[1590] = 'ER_SLAVE_INCIDENT'; +exports[1591] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT'; +exports[1592] = 'ER_BINLOG_UNSAFE_STATEMENT'; +exports[1593] = 'ER_BINLOG_FATAL_ERROR'; +exports[1594] = 'ER_SLAVE_RELAY_LOG_READ_FAILURE'; +exports[1595] = 'ER_SLAVE_RELAY_LOG_WRITE_FAILURE'; +exports[1596] = 'ER_SLAVE_CREATE_EVENT_FAILURE'; +exports[1597] = 'ER_SLAVE_MASTER_COM_FAILURE'; +exports[1598] = 'ER_BINLOG_LOGGING_IMPOSSIBLE'; +exports[1599] = 'ER_VIEW_NO_CREATION_CTX'; +exports[1600] = 'ER_VIEW_INVALID_CREATION_CTX'; +exports[1601] = 'ER_SR_INVALID_CREATION_CTX'; +exports[1602] = 'ER_TRG_CORRUPTED_FILE'; +exports[1603] = 'ER_TRG_NO_CREATION_CTX'; +exports[1604] = 'ER_TRG_INVALID_CREATION_CTX'; +exports[1605] = 'ER_EVENT_INVALID_CREATION_CTX'; +exports[1606] = 'ER_TRG_CANT_OPEN_TABLE'; +exports[1607] = 'ER_CANT_CREATE_SROUTINE'; +exports[1608] = 'ER_NEVER_USED'; +exports[1609] = 'ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT'; +exports[1610] = 'ER_REPLICA_CORRUPT_EVENT'; +exports[1611] = 'ER_LOAD_DATA_INVALID_COLUMN'; +exports[1612] = 'ER_LOG_PURGE_NO_FILE'; +exports[1613] = 'ER_XA_RBTIMEOUT'; +exports[1614] = 'ER_XA_RBDEADLOCK'; +exports[1615] = 'ER_NEED_REPREPARE'; +exports[1616] = 'ER_DELAYED_NOT_SUPPORTED'; +exports[1617] = 'WARN_NO_CONNECTION_METADATA'; +exports[1618] = 'WARN_OPTION_IGNORED'; +exports[1619] = 'ER_PLUGIN_DELETE_BUILTIN'; +exports[1620] = 'WARN_PLUGIN_BUSY'; +exports[1621] = 'ER_VARIABLE_IS_READONLY'; +exports[1622] = 'ER_WARN_ENGINE_TRANSACTION_ROLLBACK'; +exports[1623] = 'ER_SLAVE_HEARTBEAT_FAILURE'; +exports[1624] = 'ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE'; +exports[1625] = 'ER_NDB_REPLICATION_SCHEMA_ERROR'; +exports[1626] = 'ER_CONFLICT_FN_PARSE_ERROR'; +exports[1627] = 'ER_EXCEPTIONS_WRITE_ERROR'; +exports[1628] = 'ER_TOO_LONG_TABLE_COMMENT'; +exports[1629] = 'ER_TOO_LONG_FIELD_COMMENT'; +exports[1630] = 'ER_FUNC_INEXISTENT_NAME_COLLISION'; +exports[1631] = 'ER_DATABASE_NAME'; +exports[1632] = 'ER_TABLE_NAME'; +exports[1633] = 'ER_PARTITION_NAME'; +exports[1634] = 'ER_SUBPARTITION_NAME'; +exports[1635] = 'ER_TEMPORARY_NAME'; +exports[1636] = 'ER_RENAMED_NAME'; +exports[1637] = 'ER_TOO_MANY_CONCURRENT_TRXS'; +exports[1638] = 'WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED'; +exports[1639] = 'ER_DEBUG_SYNC_TIMEOUT'; +exports[1640] = 'ER_DEBUG_SYNC_HIT_LIMIT'; +exports[1641] = 'ER_DUP_SIGNAL_SET'; +exports[1642] = 'ER_SIGNAL_WARN'; +exports[1643] = 'ER_SIGNAL_NOT_FOUND'; +exports[1644] = 'ER_SIGNAL_EXCEPTION'; +exports[1645] = 'ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER'; +exports[1646] = 'ER_SIGNAL_BAD_CONDITION_TYPE'; +exports[1647] = 'WARN_COND_ITEM_TRUNCATED'; +exports[1648] = 'ER_COND_ITEM_TOO_LONG'; +exports[1649] = 'ER_UNKNOWN_LOCALE'; +exports[1650] = 'ER_REPLICA_IGNORE_SERVER_IDS'; +exports[1651] = 'ER_QUERY_CACHE_DISABLED'; +exports[1652] = 'ER_SAME_NAME_PARTITION_FIELD'; +exports[1653] = 'ER_PARTITION_COLUMN_LIST_ERROR'; +exports[1654] = 'ER_WRONG_TYPE_COLUMN_VALUE_ERROR'; +exports[1655] = 'ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR'; +exports[1656] = 'ER_MAXVALUE_IN_VALUES_IN'; +exports[1657] = 'ER_TOO_MANY_VALUES_ERROR'; +exports[1658] = 'ER_ROW_SINGLE_PARTITION_FIELD_ERROR'; +exports[1659] = 'ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD'; +exports[1660] = 'ER_PARTITION_FIELDS_TOO_LONG'; +exports[1661] = 'ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE'; +exports[1662] = 'ER_BINLOG_ROW_MODE_AND_STMT_ENGINE'; +exports[1663] = 'ER_BINLOG_UNSAFE_AND_STMT_ENGINE'; +exports[1664] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE'; +exports[1665] = 'ER_BINLOG_STMT_MODE_AND_ROW_ENGINE'; +exports[1666] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_MODE'; +exports[1667] = 'ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE'; +exports[1668] = 'ER_BINLOG_UNSAFE_LIMIT'; +exports[1669] = 'ER_UNUSED4'; +exports[1670] = 'ER_BINLOG_UNSAFE_SYSTEM_TABLE'; +exports[1671] = 'ER_BINLOG_UNSAFE_AUTOINC_COLUMNS'; +exports[1672] = 'ER_BINLOG_UNSAFE_UDF'; +exports[1673] = 'ER_BINLOG_UNSAFE_SYSTEM_VARIABLE'; +exports[1674] = 'ER_BINLOG_UNSAFE_SYSTEM_FUNCTION'; +exports[1675] = 'ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS'; +exports[1676] = 'ER_MESSAGE_AND_STATEMENT'; +exports[1677] = 'ER_SLAVE_CONVERSION_FAILED'; +exports[1678] = 'ER_REPLICA_CANT_CREATE_CONVERSION'; +exports[1679] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT'; +exports[1680] = 'ER_PATH_LENGTH'; +exports[1681] = 'ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT'; +exports[1682] = 'ER_WRONG_NATIVE_TABLE_STRUCTURE'; +exports[1683] = 'ER_WRONG_PERFSCHEMA_USAGE'; +exports[1684] = 'ER_WARN_I_S_SKIPPED_TABLE'; +exports[1685] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT'; +exports[1686] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT'; +exports[1687] = 'ER_SPATIAL_MUST_HAVE_GEOM_COL'; +exports[1688] = 'ER_TOO_LONG_INDEX_COMMENT'; +exports[1689] = 'ER_LOCK_ABORTED'; +exports[1690] = 'ER_DATA_OUT_OF_RANGE'; +exports[1691] = 'ER_WRONG_SPVAR_TYPE_IN_LIMIT'; +exports[1692] = 'ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE'; +exports[1693] = 'ER_BINLOG_UNSAFE_MIXED_STATEMENT'; +exports[1694] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN'; +exports[1695] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN'; +exports[1696] = 'ER_FAILED_READ_FROM_PAR_FILE'; +exports[1697] = 'ER_VALUES_IS_NOT_INT_TYPE_ERROR'; +exports[1698] = 'ER_ACCESS_DENIED_NO_PASSWORD_ERROR'; +exports[1699] = 'ER_SET_PASSWORD_AUTH_PLUGIN'; +exports[1700] = 'ER_GRANT_PLUGIN_USER_EXISTS'; +exports[1701] = 'ER_TRUNCATE_ILLEGAL_FK'; +exports[1702] = 'ER_PLUGIN_IS_PERMANENT'; +exports[1703] = 'ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN'; +exports[1704] = 'ER_REPLICA_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX'; +exports[1705] = 'ER_STMT_CACHE_FULL'; +exports[1706] = 'ER_MULTI_UPDATE_KEY_CONFLICT'; +exports[1707] = 'ER_TABLE_NEEDS_REBUILD'; +exports[1708] = 'WARN_OPTION_BELOW_LIMIT'; +exports[1709] = 'ER_INDEX_COLUMN_TOO_LONG'; +exports[1710] = 'ER_ERROR_IN_TRIGGER_BODY'; +exports[1711] = 'ER_ERROR_IN_UNKNOWN_TRIGGER_BODY'; +exports[1712] = 'ER_INDEX_CORRUPT'; +exports[1713] = 'ER_UNDO_RECORD_TOO_BIG'; +exports[1714] = 'ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT'; +exports[1715] = 'ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE'; +exports[1716] = 'ER_BINLOG_UNSAFE_REPLACE_SELECT'; +exports[1717] = 'ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT'; +exports[1718] = 'ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT'; +exports[1719] = 'ER_BINLOG_UNSAFE_UPDATE_IGNORE'; +exports[1720] = 'ER_PLUGIN_NO_UNINSTALL'; +exports[1721] = 'ER_PLUGIN_NO_INSTALL'; +exports[1722] = 'ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT'; +exports[1723] = 'ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC'; +exports[1724] = 'ER_BINLOG_UNSAFE_INSERT_TWO_KEYS'; +exports[1725] = 'ER_TABLE_IN_FK_CHECK'; +exports[1726] = 'ER_UNSUPPORTED_ENGINE'; +exports[1727] = 'ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST'; +exports[1728] = 'ER_CANNOT_LOAD_FROM_TABLE_V2'; +exports[1729] = 'ER_SOURCE_DELAY_VALUE_OUT_OF_RANGE'; +exports[1730] = 'ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT'; +exports[1731] = 'ER_PARTITION_EXCHANGE_DIFFERENT_OPTION'; +exports[1732] = 'ER_PARTITION_EXCHANGE_PART_TABLE'; +exports[1733] = 'ER_PARTITION_EXCHANGE_TEMP_TABLE'; +exports[1734] = 'ER_PARTITION_INSTEAD_OF_SUBPARTITION'; +exports[1735] = 'ER_UNKNOWN_PARTITION'; +exports[1736] = 'ER_TABLES_DIFFERENT_METADATA'; +exports[1737] = 'ER_ROW_DOES_NOT_MATCH_PARTITION'; +exports[1738] = 'ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX'; +exports[1739] = 'ER_WARN_INDEX_NOT_APPLICABLE'; +exports[1740] = 'ER_PARTITION_EXCHANGE_FOREIGN_KEY'; +exports[1741] = 'ER_NO_SUCH_KEY_VALUE'; +exports[1742] = 'ER_RPL_INFO_DATA_TOO_LONG'; +exports[1743] = 'ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE'; +exports[1744] = 'ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE'; +exports[1745] = 'ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX'; +exports[1746] = 'ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT'; +exports[1747] = 'ER_PARTITION_CLAUSE_ON_NONPARTITIONED'; +exports[1748] = 'ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET'; +exports[1749] = 'ER_NO_SUCH_PARTITION'; +exports[1750] = 'ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE'; +exports[1751] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE'; +exports[1752] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE'; +exports[1753] = 'ER_MTA_FEATURE_IS_NOT_SUPPORTED'; +exports[1754] = 'ER_MTA_UPDATED_DBS_GREATER_MAX'; +exports[1755] = 'ER_MTA_CANT_PARALLEL'; +exports[1756] = 'ER_MTA_INCONSISTENT_DATA'; +exports[1757] = 'ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING'; +exports[1758] = 'ER_DA_INVALID_CONDITION_NUMBER'; +exports[1759] = 'ER_INSECURE_PLAIN_TEXT'; +exports[1760] = 'ER_INSECURE_CHANGE_SOURCE'; +exports[1761] = 'ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO'; +exports[1762] = 'ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO'; +exports[1763] = 'ER_SQLTHREAD_WITH_SECURE_REPLICA'; +exports[1764] = 'ER_TABLE_HAS_NO_FT'; +exports[1765] = 'ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER'; +exports[1766] = 'ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION'; +exports[1767] = 'ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST'; +exports[1768] = 'ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION'; +exports[1769] = 'ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION'; +exports[1770] = 'ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL'; +exports[1771] = 'ER_SKIPPING_LOGGED_TRANSACTION'; +exports[1772] = 'ER_MALFORMED_GTID_SET_SPECIFICATION'; +exports[1773] = 'ER_MALFORMED_GTID_SET_ENCODING'; +exports[1774] = 'ER_MALFORMED_GTID_SPECIFICATION'; +exports[1775] = 'ER_GNO_EXHAUSTED'; +exports[1776] = 'ER_BAD_REPLICA_AUTO_POSITION'; +exports[1777] = 'ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF'; +exports[1778] = 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET'; +exports[1779] = 'ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON'; +exports[1780] = 'ER_GTID_MODE_REQUIRES_BINLOG'; +exports[1781] = 'ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF'; +exports[1782] = 'ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON'; +exports[1783] = 'ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF'; +exports[1784] = 'ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF'; +exports[1785] = 'ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE'; +exports[1786] = 'ER_GTID_UNSAFE_CREATE_SELECT'; +exports[1787] = 'ER_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRANSACTION'; +exports[1788] = 'ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME'; +exports[1789] = 'ER_SOURCE_HAS_PURGED_REQUIRED_GTIDS'; +exports[1790] = 'ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID'; +exports[1791] = 'ER_UNKNOWN_EXPLAIN_FORMAT'; +exports[1792] = 'ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION'; +exports[1793] = 'ER_TOO_LONG_TABLE_PARTITION_COMMENT'; +exports[1794] = 'ER_REPLICA_CONFIGURATION'; +exports[1795] = 'ER_INNODB_FT_LIMIT'; +exports[1796] = 'ER_INNODB_NO_FT_TEMP_TABLE'; +exports[1797] = 'ER_INNODB_FT_WRONG_DOCID_COLUMN'; +exports[1798] = 'ER_INNODB_FT_WRONG_DOCID_INDEX'; +exports[1799] = 'ER_INNODB_ONLINE_LOG_TOO_BIG'; +exports[1800] = 'ER_UNKNOWN_ALTER_ALGORITHM'; +exports[1801] = 'ER_UNKNOWN_ALTER_LOCK'; +exports[1802] = 'ER_MTA_CHANGE_SOURCE_CANT_RUN_WITH_GAPS'; +exports[1803] = 'ER_MTA_RECOVERY_FAILURE'; +exports[1804] = 'ER_MTA_RESET_WORKERS'; +exports[1805] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2'; +exports[1806] = 'ER_REPLICA_SILENT_RETRY_TRANSACTION'; +exports[1807] = 'ER_DISCARD_FK_CHECKS_RUNNING'; +exports[1808] = 'ER_TABLE_SCHEMA_MISMATCH'; +exports[1809] = 'ER_TABLE_IN_SYSTEM_TABLESPACE'; +exports[1810] = 'ER_IO_READ_ERROR'; +exports[1811] = 'ER_IO_WRITE_ERROR'; +exports[1812] = 'ER_TABLESPACE_MISSING'; +exports[1813] = 'ER_TABLESPACE_EXISTS'; +exports[1814] = 'ER_TABLESPACE_DISCARDED'; +exports[1815] = 'ER_INTERNAL_ERROR'; +exports[1816] = 'ER_INNODB_IMPORT_ERROR'; +exports[1817] = 'ER_INNODB_INDEX_CORRUPT'; +exports[1818] = 'ER_INVALID_YEAR_COLUMN_LENGTH'; +exports[1819] = 'ER_NOT_VALID_PASSWORD'; +exports[1820] = 'ER_MUST_CHANGE_PASSWORD'; +exports[1821] = 'ER_FK_NO_INDEX_CHILD'; +exports[1822] = 'ER_FK_NO_INDEX_PARENT'; +exports[1823] = 'ER_FK_FAIL_ADD_SYSTEM'; +exports[1824] = 'ER_FK_CANNOT_OPEN_PARENT'; +exports[1825] = 'ER_FK_INCORRECT_OPTION'; +exports[1826] = 'ER_FK_DUP_NAME'; +exports[1827] = 'ER_PASSWORD_FORMAT'; +exports[1828] = 'ER_FK_COLUMN_CANNOT_DROP'; +exports[1829] = 'ER_FK_COLUMN_CANNOT_DROP_CHILD'; +exports[1830] = 'ER_FK_COLUMN_NOT_NULL'; +exports[1831] = 'ER_DUP_INDEX'; +exports[1832] = 'ER_FK_COLUMN_CANNOT_CHANGE'; +exports[1833] = 'ER_FK_COLUMN_CANNOT_CHANGE_CHILD'; +exports[1834] = 'ER_UNUSED5'; +exports[1835] = 'ER_MALFORMED_PACKET'; +exports[1836] = 'ER_READ_ONLY_MODE'; +exports[1837] = 'ER_GTID_NEXT_TYPE_UNDEFINED_GTID'; +exports[1838] = 'ER_VARIABLE_NOT_SETTABLE_IN_SP'; +exports[1839] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF'; +exports[1840] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY'; +exports[1841] = 'ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY'; +exports[1842] = 'ER_GTID_PURGED_WAS_CHANGED'; +exports[1843] = 'ER_GTID_EXECUTED_WAS_CHANGED'; +exports[1844] = 'ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES'; +exports[1845] = 'ER_ALTER_OPERATION_NOT_SUPPORTED'; +exports[1846] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON'; +exports[1847] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY'; +exports[1848] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION'; +exports[1849] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME'; +exports[1850] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE'; +exports[1851] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK'; +exports[1852] = 'ER_UNUSED6'; +exports[1853] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK'; +exports[1854] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC'; +exports[1855] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS'; +exports[1856] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS'; +exports[1857] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS'; +exports[1858] = 'ER_SQL_REPLICA_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE'; +exports[1859] = 'ER_DUP_UNKNOWN_IN_INDEX'; +exports[1860] = 'ER_IDENT_CAUSES_TOO_LONG_PATH'; +exports[1861] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL'; +exports[1862] = 'ER_MUST_CHANGE_PASSWORD_LOGIN'; +exports[1863] = 'ER_ROW_IN_WRONG_PARTITION'; +exports[1864] = 'ER_MTA_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX'; +exports[1865] = 'ER_INNODB_NO_FT_USES_PARSER'; +exports[1866] = 'ER_BINLOG_LOGICAL_CORRUPTION'; +exports[1867] = 'ER_WARN_PURGE_LOG_IN_USE'; +exports[1868] = 'ER_WARN_PURGE_LOG_IS_ACTIVE'; +exports[1869] = 'ER_AUTO_INCREMENT_CONFLICT'; +exports[1870] = 'WARN_ON_BLOCKHOLE_IN_RBR'; +exports[1871] = 'ER_REPLICA_CM_INIT_REPOSITORY'; +exports[1872] = 'ER_REPLICA_AM_INIT_REPOSITORY'; +exports[1873] = 'ER_ACCESS_DENIED_CHANGE_USER_ERROR'; +exports[1874] = 'ER_INNODB_READ_ONLY'; +exports[1875] = 'ER_STOP_REPLICA_SQL_THREAD_TIMEOUT'; +exports[1876] = 'ER_STOP_REPLICA_IO_THREAD_TIMEOUT'; +exports[1877] = 'ER_TABLE_CORRUPT'; +exports[1878] = 'ER_TEMP_FILE_WRITE_FAILURE'; +exports[1879] = 'ER_INNODB_FT_AUX_NOT_HEX_ID'; +exports[1880] = 'ER_OLD_TEMPORALS_UPGRADED'; +exports[1881] = 'ER_INNODB_FORCED_RECOVERY'; +exports[1882] = 'ER_AES_INVALID_IV'; +exports[1883] = 'ER_PLUGIN_CANNOT_BE_UNINSTALLED'; +exports[1884] = 'ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_ASSIGNED_GTID'; +exports[1885] = 'ER_REPLICA_HAS_MORE_GTIDS_THAN_SOURCE'; +exports[1886] = 'ER_MISSING_KEY'; +exports[1887] = 'WARN_NAMED_PIPE_ACCESS_EVERYONE'; +exports[3000] = 'ER_FILE_CORRUPT'; +exports[3001] = 'ER_ERROR_ON_SOURCE'; +exports[3002] = 'ER_INCONSISTENT_ERROR'; +exports[3003] = 'ER_STORAGE_ENGINE_NOT_LOADED'; +exports[3004] = 'ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER'; +exports[3005] = 'ER_WARN_LEGACY_SYNTAX_CONVERTED'; +exports[3006] = 'ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN'; +exports[3007] = 'ER_CANNOT_DISCARD_TEMPORARY_TABLE'; +exports[3008] = 'ER_FK_DEPTH_EXCEEDED'; +exports[3009] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2'; +exports[3010] = 'ER_WARN_TRIGGER_DOESNT_HAVE_CREATED'; +exports[3011] = 'ER_REFERENCED_TRG_DOES_NOT_EXIST'; +exports[3012] = 'ER_EXPLAIN_NOT_SUPPORTED'; +exports[3013] = 'ER_INVALID_FIELD_SIZE'; +exports[3014] = 'ER_MISSING_HA_CREATE_OPTION'; +exports[3015] = 'ER_ENGINE_OUT_OF_MEMORY'; +exports[3016] = 'ER_PASSWORD_EXPIRE_ANONYMOUS_USER'; +exports[3017] = 'ER_REPLICA_SQL_THREAD_MUST_STOP'; +exports[3018] = 'ER_NO_FT_MATERIALIZED_SUBQUERY'; +exports[3019] = 'ER_INNODB_UNDO_LOG_FULL'; +exports[3020] = 'ER_INVALID_ARGUMENT_FOR_LOGARITHM'; +exports[3021] = 'ER_REPLICA_CHANNEL_IO_THREAD_MUST_STOP'; +exports[3022] = 'ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO'; +exports[3023] = 'ER_WARN_ONLY_SOURCE_LOG_FILE_NO_POS'; +exports[3024] = 'ER_QUERY_TIMEOUT'; +exports[3025] = 'ER_NON_RO_SELECT_DISABLE_TIMER'; +exports[3026] = 'ER_DUP_LIST_ENTRY'; +exports[3027] = 'ER_SQL_MODE_NO_EFFECT'; +exports[3028] = 'ER_AGGREGATE_ORDER_FOR_UNION'; +exports[3029] = 'ER_AGGREGATE_ORDER_NON_AGG_QUERY'; +exports[3030] = 'ER_REPLICA_WORKER_STOPPED_PREVIOUS_THD_ERROR'; +exports[3031] = 'ER_DONT_SUPPORT_REPLICA_PRESERVE_COMMIT_ORDER'; +exports[3032] = 'ER_SERVER_OFFLINE_MODE'; +exports[3033] = 'ER_GIS_DIFFERENT_SRIDS'; +exports[3034] = 'ER_GIS_UNSUPPORTED_ARGUMENT'; +exports[3035] = 'ER_GIS_UNKNOWN_ERROR'; +exports[3036] = 'ER_GIS_UNKNOWN_EXCEPTION'; +exports[3037] = 'ER_GIS_INVALID_DATA'; +exports[3038] = 'ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION'; +exports[3039] = 'ER_BOOST_GEOMETRY_CENTROID_EXCEPTION'; +exports[3040] = 'ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION'; +exports[3041] = 'ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION'; +exports[3042] = 'ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION'; +exports[3043] = 'ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION'; +exports[3044] = 'ER_STD_BAD_ALLOC_ERROR'; +exports[3045] = 'ER_STD_DOMAIN_ERROR'; +exports[3046] = 'ER_STD_LENGTH_ERROR'; +exports[3047] = 'ER_STD_INVALID_ARGUMENT'; +exports[3048] = 'ER_STD_OUT_OF_RANGE_ERROR'; +exports[3049] = 'ER_STD_OVERFLOW_ERROR'; +exports[3050] = 'ER_STD_RANGE_ERROR'; +exports[3051] = 'ER_STD_UNDERFLOW_ERROR'; +exports[3052] = 'ER_STD_LOGIC_ERROR'; +exports[3053] = 'ER_STD_RUNTIME_ERROR'; +exports[3054] = 'ER_STD_UNKNOWN_EXCEPTION'; +exports[3055] = 'ER_GIS_DATA_WRONG_ENDIANESS'; +exports[3056] = 'ER_CHANGE_SOURCE_PASSWORD_LENGTH'; +exports[3057] = 'ER_USER_LOCK_WRONG_NAME'; +exports[3058] = 'ER_USER_LOCK_DEADLOCK'; +exports[3059] = 'ER_REPLACE_INACCESSIBLE_ROWS'; +exports[3060] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS'; +exports[3061] = 'ER_ILLEGAL_USER_VAR'; +exports[3062] = 'ER_GTID_MODE_OFF'; +exports[3063] = 'ER_UNSUPPORTED_BY_REPLICATION_THREAD'; +exports[3064] = 'ER_INCORRECT_TYPE'; +exports[3065] = 'ER_FIELD_IN_ORDER_NOT_SELECT'; +exports[3066] = 'ER_AGGREGATE_IN_ORDER_NOT_SELECT'; +exports[3067] = 'ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN'; +exports[3068] = 'ER_NET_OK_PACKET_TOO_LARGE'; +exports[3069] = 'ER_INVALID_JSON_DATA'; +exports[3070] = 'ER_INVALID_GEOJSON_MISSING_MEMBER'; +exports[3071] = 'ER_INVALID_GEOJSON_WRONG_TYPE'; +exports[3072] = 'ER_INVALID_GEOJSON_UNSPECIFIED'; +exports[3073] = 'ER_DIMENSION_UNSUPPORTED'; +exports[3074] = 'ER_REPLICA_CHANNEL_DOES_NOT_EXIST'; +exports[3075] = 'ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT'; +exports[3076] = 'ER_REPLICA_CHANNEL_NAME_INVALID_OR_TOO_LONG'; +exports[3077] = 'ER_REPLICA_NEW_CHANNEL_WRONG_REPOSITORY'; +exports[3078] = 'ER_SLAVE_CHANNEL_DELETE'; +exports[3079] = 'ER_REPLICA_MULTIPLE_CHANNELS_CMD'; +exports[3080] = 'ER_REPLICA_MAX_CHANNELS_EXCEEDED'; +exports[3081] = 'ER_REPLICA_CHANNEL_MUST_STOP'; +exports[3082] = 'ER_REPLICA_CHANNEL_NOT_RUNNING'; +exports[3083] = 'ER_REPLICA_CHANNEL_WAS_RUNNING'; +exports[3084] = 'ER_REPLICA_CHANNEL_WAS_NOT_RUNNING'; +exports[3085] = 'ER_REPLICA_CHANNEL_SQL_THREAD_MUST_STOP'; +exports[3086] = 'ER_REPLICA_CHANNEL_SQL_SKIP_COUNTER'; +exports[3087] = 'ER_WRONG_FIELD_WITH_GROUP_V2'; +exports[3088] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2'; +exports[3089] = 'ER_WARN_DEPRECATED_SYSVAR_UPDATE'; +exports[3090] = 'ER_WARN_DEPRECATED_SQLMODE'; +exports[3091] = 'ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID'; +exports[3092] = 'ER_GROUP_REPLICATION_CONFIGURATION'; +exports[3093] = 'ER_GROUP_REPLICATION_RUNNING'; +exports[3094] = 'ER_GROUP_REPLICATION_APPLIER_INIT_ERROR'; +exports[3095] = 'ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT'; +exports[3096] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR'; +exports[3097] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR'; +exports[3098] = 'ER_BEFORE_DML_VALIDATION_ERROR'; +exports[3099] = 'ER_PREVENTS_VARIABLE_WITHOUT_RBR'; +exports[3100] = 'ER_RUN_HOOK_ERROR'; +exports[3101] = 'ER_TRANSACTION_ROLLBACK_DURING_COMMIT'; +exports[3102] = 'ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED'; +exports[3103] = 'ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN'; +exports[3104] = 'ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN'; +exports[3105] = 'ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN'; +exports[3106] = 'ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN'; +exports[3107] = 'ER_GENERATED_COLUMN_NON_PRIOR'; +exports[3108] = 'ER_DEPENDENT_BY_GENERATED_COLUMN'; +exports[3109] = 'ER_GENERATED_COLUMN_REF_AUTO_INC'; +exports[3110] = 'ER_FEATURE_NOT_AVAILABLE'; +exports[3111] = 'ER_CANT_SET_GTID_MODE'; +exports[3112] = 'ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF'; +exports[3113] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION'; +exports[3114] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON'; +exports[3115] = 'ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF'; +exports[3116] = + 'ER_CANT_ENFORCE_GTID_CONSISTENCY_WITH_ONGOING_GTID_VIOLATING_TX'; +exports[3117] = + 'ER_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TX'; +exports[3118] = 'ER_ACCOUNT_HAS_BEEN_LOCKED'; +exports[3119] = 'ER_WRONG_TABLESPACE_NAME'; +exports[3120] = 'ER_TABLESPACE_IS_NOT_EMPTY'; +exports[3121] = 'ER_WRONG_FILE_NAME'; +exports[3122] = 'ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION'; +exports[3123] = 'ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR'; +exports[3124] = 'ER_WARN_BAD_MAX_EXECUTION_TIME'; +exports[3125] = 'ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME'; +exports[3126] = 'ER_WARN_CONFLICTING_HINT'; +exports[3127] = 'ER_WARN_UNKNOWN_QB_NAME'; +exports[3128] = 'ER_UNRESOLVED_HINT_NAME'; +exports[3129] = 'ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE'; +exports[3130] = 'ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED'; +exports[3131] = 'ER_LOCKING_SERVICE_WRONG_NAME'; +exports[3132] = 'ER_LOCKING_SERVICE_DEADLOCK'; +exports[3133] = 'ER_LOCKING_SERVICE_TIMEOUT'; +exports[3134] = 'ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED'; +exports[3135] = 'ER_SQL_MODE_MERGED'; +exports[3136] = 'ER_VTOKEN_PLUGIN_TOKEN_MISMATCH'; +exports[3137] = 'ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND'; +exports[3138] = 'ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID'; +exports[3139] = 'ER_REPLICA_CHANNEL_OPERATION_NOT_ALLOWED'; +exports[3140] = 'ER_INVALID_JSON_TEXT'; +exports[3141] = 'ER_INVALID_JSON_TEXT_IN_PARAM'; +exports[3142] = 'ER_INVALID_JSON_BINARY_DATA'; +exports[3143] = 'ER_INVALID_JSON_PATH'; +exports[3144] = 'ER_INVALID_JSON_CHARSET'; +exports[3145] = 'ER_INVALID_JSON_CHARSET_IN_FUNCTION'; +exports[3146] = 'ER_INVALID_TYPE_FOR_JSON'; +exports[3147] = 'ER_INVALID_CAST_TO_JSON'; +exports[3148] = 'ER_INVALID_JSON_PATH_CHARSET'; +exports[3149] = 'ER_INVALID_JSON_PATH_WILDCARD'; +exports[3150] = 'ER_JSON_VALUE_TOO_BIG'; +exports[3151] = 'ER_JSON_KEY_TOO_BIG'; +exports[3152] = 'ER_JSON_USED_AS_KEY'; +exports[3153] = 'ER_JSON_VACUOUS_PATH'; +exports[3154] = 'ER_JSON_BAD_ONE_OR_ALL_ARG'; +exports[3155] = 'ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE'; +exports[3156] = 'ER_INVALID_JSON_VALUE_FOR_CAST'; +exports[3157] = 'ER_JSON_DOCUMENT_TOO_DEEP'; +exports[3158] = 'ER_JSON_DOCUMENT_NULL_KEY'; +exports[3159] = 'ER_SECURE_TRANSPORT_REQUIRED'; +exports[3160] = 'ER_NO_SECURE_TRANSPORTS_CONFIGURED'; +exports[3161] = 'ER_DISABLED_STORAGE_ENGINE'; +exports[3162] = 'ER_USER_DOES_NOT_EXIST'; +exports[3163] = 'ER_USER_ALREADY_EXISTS'; +exports[3164] = 'ER_AUDIT_API_ABORT'; +exports[3165] = 'ER_INVALID_JSON_PATH_ARRAY_CELL'; +exports[3166] = 'ER_BUFPOOL_RESIZE_INPROGRESS'; +exports[3167] = 'ER_FEATURE_DISABLED_SEE_DOC'; +exports[3168] = 'ER_SERVER_ISNT_AVAILABLE'; +exports[3169] = 'ER_SESSION_WAS_KILLED'; +exports[3170] = 'ER_CAPACITY_EXCEEDED'; +exports[3171] = 'ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER'; +exports[3172] = 'ER_TABLE_NEEDS_UPG_PART'; +exports[3173] = 'ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID'; +exports[3174] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL'; +exports[3175] = 'ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT'; +exports[3176] = 'ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE'; +exports[3177] = 'ER_LOCK_REFUSED_BY_ENGINE'; +exports[3178] = 'ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN'; +exports[3179] = 'ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE'; +exports[3180] = 'ER_MASTER_KEY_ROTATION_ERROR_BY_SE'; +exports[3181] = 'ER_MASTER_KEY_ROTATION_BINLOG_FAILED'; +exports[3182] = 'ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE'; +exports[3183] = 'ER_TABLESPACE_CANNOT_ENCRYPT'; +exports[3184] = 'ER_INVALID_ENCRYPTION_OPTION'; +exports[3185] = 'ER_CANNOT_FIND_KEY_IN_KEYRING'; +exports[3186] = 'ER_CAPACITY_EXCEEDED_IN_PARSER'; +exports[3187] = 'ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE'; +exports[3188] = 'ER_KEYRING_UDF_KEYRING_SERVICE_ERROR'; +exports[3189] = 'ER_USER_COLUMN_OLD_LENGTH'; +exports[3190] = 'ER_CANT_RESET_SOURCE'; +exports[3191] = 'ER_GROUP_REPLICATION_MAX_GROUP_SIZE'; +exports[3192] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED'; +exports[3193] = 'ER_TABLE_REFERENCED'; +exports[3194] = 'ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE'; +exports[3195] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO'; +exports[3196] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID'; +exports[3197] = 'ER_XA_RETRY'; +exports[3198] = 'ER_KEYRING_AWS_UDF_AWS_KMS_ERROR'; +exports[3199] = 'ER_BINLOG_UNSAFE_XA'; +exports[3200] = 'ER_UDF_ERROR'; +exports[3201] = 'ER_KEYRING_MIGRATION_FAILURE'; +exports[3202] = 'ER_KEYRING_ACCESS_DENIED_ERROR'; +exports[3203] = 'ER_KEYRING_MIGRATION_STATUS'; +exports[3204] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLES'; +exports[3205] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLE'; +exports[3206] = 'ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED'; +exports[3207] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET'; +exports[3208] = 'ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY'; +exports[3209] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED'; +exports[3210] = 'ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED'; +exports[3211] = 'ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE'; +exports[3212] = 'ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED'; +exports[3213] = 'ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS'; +exports[3214] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE'; +exports[3215] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT'; +exports[3216] = 'ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED'; +exports[3217] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE'; +exports[3218] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE'; +exports[3219] = 'ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR'; +exports[3220] = 'ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY'; +exports[3221] = 'ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY'; +exports[3222] = 'ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS'; +exports[3223] = 'ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC'; +exports[3224] = 'ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER'; +exports[3225] = 'ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER'; +exports[3226] = 'WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP'; +exports[3227] = 'ER_XA_REPLICATION_FILTERS'; +exports[3228] = 'ER_CANT_OPEN_ERROR_LOG'; +exports[3229] = 'ER_GROUPING_ON_TIMESTAMP_IN_DST'; +exports[3230] = 'ER_CANT_START_SERVER_NAMED_PIPE'; +exports[3231] = 'ER_WRITE_SET_EXCEEDS_LIMIT'; +exports[3232] = 'ER_DEPRECATED_TLS_VERSION_SESSION_57'; +exports[3233] = 'ER_WARN_DEPRECATED_TLS_VERSION_57'; +exports[3234] = 'ER_WARN_WRONG_NATIVE_TABLE_STRUCTURE'; +exports[3235] = 'ER_AES_INVALID_KDF_NAME'; +exports[3236] = 'ER_AES_INVALID_KDF_ITERATIONS'; +exports[3237] = 'WARN_AES_KEY_SIZE'; +exports[3238] = 'ER_AES_INVALID_KDF_OPTION_SIZE'; +exports[3500] = 'ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE'; +exports[3501] = 'ER_ACL_OPERATION_FAILED'; +exports[3502] = 'ER_UNSUPPORTED_INDEX_ALGORITHM'; +exports[3503] = 'ER_NO_SUCH_DB'; +exports[3504] = 'ER_TOO_BIG_ENUM'; +exports[3505] = 'ER_TOO_LONG_SET_ENUM_VALUE'; +exports[3506] = 'ER_INVALID_DD_OBJECT'; +exports[3507] = 'ER_UPDATING_DD_TABLE'; +exports[3508] = 'ER_INVALID_DD_OBJECT_ID'; +exports[3509] = 'ER_INVALID_DD_OBJECT_NAME'; +exports[3510] = 'ER_TABLESPACE_MISSING_WITH_NAME'; +exports[3511] = 'ER_TOO_LONG_ROUTINE_COMMENT'; +exports[3512] = 'ER_SP_LOAD_FAILED'; +exports[3513] = 'ER_INVALID_BITWISE_OPERANDS_SIZE'; +exports[3514] = 'ER_INVALID_BITWISE_AGGREGATE_OPERANDS_SIZE'; +exports[3515] = 'ER_WARN_UNSUPPORTED_HINT'; +exports[3516] = 'ER_UNEXPECTED_GEOMETRY_TYPE'; +exports[3517] = 'ER_SRS_PARSE_ERROR'; +exports[3518] = 'ER_SRS_PROJ_PARAMETER_MISSING'; +exports[3519] = 'ER_WARN_SRS_NOT_FOUND'; +exports[3520] = 'ER_SRS_NOT_CARTESIAN'; +exports[3521] = 'ER_SRS_NOT_CARTESIAN_UNDEFINED'; +exports[3522] = 'ER_PK_INDEX_CANT_BE_INVISIBLE'; +exports[3523] = 'ER_UNKNOWN_AUTHID'; +exports[3524] = 'ER_FAILED_ROLE_GRANT'; +exports[3525] = 'ER_OPEN_ROLE_TABLES'; +exports[3526] = 'ER_FAILED_DEFAULT_ROLES'; +exports[3527] = 'ER_COMPONENTS_NO_SCHEME'; +exports[3528] = 'ER_COMPONENTS_NO_SCHEME_SERVICE'; +exports[3529] = 'ER_COMPONENTS_CANT_LOAD'; +exports[3530] = 'ER_ROLE_NOT_GRANTED'; +exports[3531] = 'ER_FAILED_REVOKE_ROLE'; +exports[3532] = 'ER_RENAME_ROLE'; +exports[3533] = 'ER_COMPONENTS_CANT_ACQUIRE_SERVICE_IMPLEMENTATION'; +exports[3534] = 'ER_COMPONENTS_CANT_SATISFY_DEPENDENCY'; +exports[3535] = 'ER_COMPONENTS_LOAD_CANT_REGISTER_SERVICE_IMPLEMENTATION'; +exports[3536] = 'ER_COMPONENTS_LOAD_CANT_INITIALIZE'; +exports[3537] = 'ER_COMPONENTS_UNLOAD_NOT_LOADED'; +exports[3538] = 'ER_COMPONENTS_UNLOAD_CANT_DEINITIALIZE'; +exports[3539] = 'ER_COMPONENTS_CANT_RELEASE_SERVICE'; +exports[3540] = 'ER_COMPONENTS_UNLOAD_CANT_UNREGISTER_SERVICE'; +exports[3541] = 'ER_COMPONENTS_CANT_UNLOAD'; +exports[3542] = 'ER_WARN_UNLOAD_THE_NOT_PERSISTED'; +exports[3543] = 'ER_COMPONENT_TABLE_INCORRECT'; +exports[3544] = 'ER_COMPONENT_MANIPULATE_ROW_FAILED'; +exports[3545] = 'ER_COMPONENTS_UNLOAD_DUPLICATE_IN_GROUP'; +exports[3546] = 'ER_CANT_SET_GTID_PURGED_DUE_SETS_CONSTRAINTS'; +exports[3547] = 'ER_CANNOT_LOCK_USER_MANAGEMENT_CACHES'; +exports[3548] = 'ER_SRS_NOT_FOUND'; +exports[3549] = 'ER_VARIABLE_NOT_PERSISTED'; +exports[3550] = 'ER_IS_QUERY_INVALID_CLAUSE'; +exports[3551] = 'ER_UNABLE_TO_STORE_STATISTICS'; +exports[3552] = 'ER_NO_SYSTEM_SCHEMA_ACCESS'; +exports[3553] = 'ER_NO_SYSTEM_TABLESPACE_ACCESS'; +exports[3554] = 'ER_NO_SYSTEM_TABLE_ACCESS'; +exports[3555] = 'ER_NO_SYSTEM_TABLE_ACCESS_FOR_DICTIONARY_TABLE'; +exports[3556] = 'ER_NO_SYSTEM_TABLE_ACCESS_FOR_SYSTEM_TABLE'; +exports[3557] = 'ER_NO_SYSTEM_TABLE_ACCESS_FOR_TABLE'; +exports[3558] = 'ER_INVALID_OPTION_KEY'; +exports[3559] = 'ER_INVALID_OPTION_VALUE'; +exports[3560] = 'ER_INVALID_OPTION_KEY_VALUE_PAIR'; +exports[3561] = 'ER_INVALID_OPTION_START_CHARACTER'; +exports[3562] = 'ER_INVALID_OPTION_END_CHARACTER'; +exports[3563] = 'ER_INVALID_OPTION_CHARACTERS'; +exports[3564] = 'ER_DUPLICATE_OPTION_KEY'; +exports[3565] = 'ER_WARN_SRS_NOT_FOUND_AXIS_ORDER'; +exports[3566] = 'ER_NO_ACCESS_TO_NATIVE_FCT'; +exports[3567] = 'ER_RESET_SOURCE_TO_VALUE_OUT_OF_RANGE'; +exports[3568] = 'ER_UNRESOLVED_TABLE_LOCK'; +exports[3569] = 'ER_DUPLICATE_TABLE_LOCK'; +exports[3570] = 'ER_BINLOG_UNSAFE_SKIP_LOCKED'; +exports[3571] = 'ER_BINLOG_UNSAFE_NOWAIT'; +exports[3572] = 'ER_LOCK_NOWAIT'; +exports[3573] = 'ER_CTE_RECURSIVE_REQUIRES_UNION'; +exports[3574] = 'ER_CTE_RECURSIVE_REQUIRES_NONRECURSIVE_FIRST'; +exports[3575] = 'ER_CTE_RECURSIVE_FORBIDS_AGGREGATION'; +exports[3576] = 'ER_CTE_RECURSIVE_FORBIDDEN_JOIN_ORDER'; +exports[3577] = 'ER_CTE_RECURSIVE_REQUIRES_SINGLE_REFERENCE'; +exports[3578] = 'ER_SWITCH_TMP_ENGINE'; +exports[3579] = 'ER_WINDOW_NO_SUCH_WINDOW'; +exports[3580] = 'ER_WINDOW_CIRCULARITY_IN_WINDOW_GRAPH'; +exports[3581] = 'ER_WINDOW_NO_CHILD_PARTITIONING'; +exports[3582] = 'ER_WINDOW_NO_INHERIT_FRAME'; +exports[3583] = 'ER_WINDOW_NO_REDEFINE_ORDER_BY'; +exports[3584] = 'ER_WINDOW_FRAME_START_ILLEGAL'; +exports[3585] = 'ER_WINDOW_FRAME_END_ILLEGAL'; +exports[3586] = 'ER_WINDOW_FRAME_ILLEGAL'; +exports[3587] = 'ER_WINDOW_RANGE_FRAME_ORDER_TYPE'; +exports[3588] = 'ER_WINDOW_RANGE_FRAME_TEMPORAL_TYPE'; +exports[3589] = 'ER_WINDOW_RANGE_FRAME_NUMERIC_TYPE'; +exports[3590] = 'ER_WINDOW_RANGE_BOUND_NOT_CONSTANT'; +exports[3591] = 'ER_WINDOW_DUPLICATE_NAME'; +exports[3592] = 'ER_WINDOW_ILLEGAL_ORDER_BY'; +exports[3593] = 'ER_WINDOW_INVALID_WINDOW_FUNC_USE'; +exports[3594] = 'ER_WINDOW_INVALID_WINDOW_FUNC_ALIAS_USE'; +exports[3595] = 'ER_WINDOW_NESTED_WINDOW_FUNC_USE_IN_WINDOW_SPEC'; +exports[3596] = 'ER_WINDOW_ROWS_INTERVAL_USE'; +exports[3597] = 'ER_WINDOW_NO_GROUP_ORDER'; +exports[3598] = 'ER_WINDOW_EXPLAIN_JSON'; +exports[3599] = 'ER_WINDOW_FUNCTION_IGNORES_FRAME'; +exports[3600] = 'ER_WL9236_NOW'; +exports[3601] = 'ER_INVALID_NO_OF_ARGS'; +exports[3602] = 'ER_FIELD_IN_GROUPING_NOT_GROUP_BY'; +exports[3603] = 'ER_TOO_LONG_TABLESPACE_COMMENT'; +exports[3604] = 'ER_ENGINE_CANT_DROP_TABLE'; +exports[3605] = 'ER_ENGINE_CANT_DROP_MISSING_TABLE'; +exports[3606] = 'ER_TABLESPACE_DUP_FILENAME'; +exports[3607] = 'ER_DB_DROP_RMDIR2'; +exports[3608] = 'ER_IMP_NO_FILES_MATCHED'; +exports[3609] = 'ER_IMP_SCHEMA_DOES_NOT_EXIST'; +exports[3610] = 'ER_IMP_TABLE_ALREADY_EXISTS'; +exports[3611] = 'ER_IMP_INCOMPATIBLE_MYSQLD_VERSION'; +exports[3612] = 'ER_IMP_INCOMPATIBLE_DD_VERSION'; +exports[3613] = 'ER_IMP_INCOMPATIBLE_SDI_VERSION'; +exports[3614] = 'ER_WARN_INVALID_HINT'; +exports[3615] = 'ER_VAR_DOES_NOT_EXIST'; +exports[3616] = 'ER_LONGITUDE_OUT_OF_RANGE'; +exports[3617] = 'ER_LATITUDE_OUT_OF_RANGE'; +exports[3618] = 'ER_NOT_IMPLEMENTED_FOR_GEOGRAPHIC_SRS'; +exports[3619] = 'ER_ILLEGAL_PRIVILEGE_LEVEL'; +exports[3620] = 'ER_NO_SYSTEM_VIEW_ACCESS'; +exports[3621] = 'ER_COMPONENT_FILTER_FLABBERGASTED'; +exports[3622] = 'ER_PART_EXPR_TOO_LONG'; +exports[3623] = 'ER_UDF_DROP_DYNAMICALLY_REGISTERED'; +exports[3624] = 'ER_UNABLE_TO_STORE_COLUMN_STATISTICS'; +exports[3625] = 'ER_UNABLE_TO_UPDATE_COLUMN_STATISTICS'; +exports[3626] = 'ER_UNABLE_TO_DROP_COLUMN_STATISTICS'; +exports[3627] = 'ER_UNABLE_TO_BUILD_HISTOGRAM'; +exports[3628] = 'ER_MANDATORY_ROLE'; +exports[3629] = 'ER_MISSING_TABLESPACE_FILE'; +exports[3630] = 'ER_PERSIST_ONLY_ACCESS_DENIED_ERROR'; +exports[3631] = 'ER_CMD_NEED_SUPER'; +exports[3632] = 'ER_PATH_IN_DATADIR'; +exports[3633] = 'ER_CLONE_DDL_IN_PROGRESS'; +exports[3634] = 'ER_CLONE_TOO_MANY_CONCURRENT_CLONES'; +exports[3635] = 'ER_APPLIER_LOG_EVENT_VALIDATION_ERROR'; +exports[3636] = 'ER_CTE_MAX_RECURSION_DEPTH'; +exports[3637] = 'ER_NOT_HINT_UPDATABLE_VARIABLE'; +exports[3638] = 'ER_CREDENTIALS_CONTRADICT_TO_HISTORY'; +exports[3639] = 'ER_WARNING_PASSWORD_HISTORY_CLAUSES_VOID'; +exports[3640] = 'ER_CLIENT_DOES_NOT_SUPPORT'; +exports[3641] = 'ER_I_S_SKIPPED_TABLESPACE'; +exports[3642] = 'ER_TABLESPACE_ENGINE_MISMATCH'; +exports[3643] = 'ER_WRONG_SRID_FOR_COLUMN'; +exports[3644] = 'ER_CANNOT_ALTER_SRID_DUE_TO_INDEX'; +exports[3645] = 'ER_WARN_BINLOG_PARTIAL_UPDATES_DISABLED'; +exports[3646] = 'ER_WARN_BINLOG_V1_ROW_EVENTS_DISABLED'; +exports[3647] = 'ER_WARN_BINLOG_PARTIAL_UPDATES_SUGGESTS_PARTIAL_IMAGES'; +exports[3648] = 'ER_COULD_NOT_APPLY_JSON_DIFF'; +exports[3649] = 'ER_CORRUPTED_JSON_DIFF'; +exports[3650] = 'ER_RESOURCE_GROUP_EXISTS'; +exports[3651] = 'ER_RESOURCE_GROUP_NOT_EXISTS'; +exports[3652] = 'ER_INVALID_VCPU_ID'; +exports[3653] = 'ER_INVALID_VCPU_RANGE'; +exports[3654] = 'ER_INVALID_THREAD_PRIORITY'; +exports[3655] = 'ER_DISALLOWED_OPERATION'; +exports[3656] = 'ER_RESOURCE_GROUP_BUSY'; +exports[3657] = 'ER_RESOURCE_GROUP_DISABLED'; +exports[3658] = 'ER_FEATURE_UNSUPPORTED'; +exports[3659] = 'ER_ATTRIBUTE_IGNORED'; +exports[3660] = 'ER_INVALID_THREAD_ID'; +exports[3661] = 'ER_RESOURCE_GROUP_BIND_FAILED'; +exports[3662] = 'ER_INVALID_USE_OF_FORCE_OPTION'; +exports[3663] = 'ER_GROUP_REPLICATION_COMMAND_FAILURE'; +exports[3664] = 'ER_SDI_OPERATION_FAILED'; +exports[3665] = 'ER_MISSING_JSON_TABLE_VALUE'; +exports[3666] = 'ER_WRONG_JSON_TABLE_VALUE'; +exports[3667] = 'ER_TF_MUST_HAVE_ALIAS'; +exports[3668] = 'ER_TF_FORBIDDEN_JOIN_TYPE'; +exports[3669] = 'ER_JT_VALUE_OUT_OF_RANGE'; +exports[3670] = 'ER_JT_MAX_NESTED_PATH'; +exports[3671] = 'ER_PASSWORD_EXPIRATION_NOT_SUPPORTED_BY_AUTH_METHOD'; +exports[3672] = 'ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL'; +exports[3673] = 'ER_BAD_NULL_ERROR_NOT_IGNORED'; +exports[3674] = 'WARN_USELESS_SPATIAL_INDEX'; +exports[3675] = 'ER_DISK_FULL_NOWAIT'; +exports[3676] = 'ER_PARSE_ERROR_IN_DIGEST_FN'; +exports[3677] = 'ER_UNDISCLOSED_PARSE_ERROR_IN_DIGEST_FN'; +exports[3678] = 'ER_SCHEMA_DIR_EXISTS'; +exports[3679] = 'ER_SCHEMA_DIR_MISSING'; +exports[3680] = 'ER_SCHEMA_DIR_CREATE_FAILED'; +exports[3681] = 'ER_SCHEMA_DIR_UNKNOWN'; +exports[3682] = 'ER_ONLY_IMPLEMENTED_FOR_SRID_0_AND_4326'; +exports[3683] = 'ER_BINLOG_EXPIRE_LOG_DAYS_AND_SECS_USED_TOGETHER'; +exports[3684] = 'ER_REGEXP_BUFFER_OVERFLOW'; +exports[3685] = 'ER_REGEXP_ILLEGAL_ARGUMENT'; +exports[3686] = 'ER_REGEXP_INDEX_OUTOFBOUNDS_ERROR'; +exports[3687] = 'ER_REGEXP_INTERNAL_ERROR'; +exports[3688] = 'ER_REGEXP_RULE_SYNTAX'; +exports[3689] = 'ER_REGEXP_BAD_ESCAPE_SEQUENCE'; +exports[3690] = 'ER_REGEXP_UNIMPLEMENTED'; +exports[3691] = 'ER_REGEXP_MISMATCHED_PAREN'; +exports[3692] = 'ER_REGEXP_BAD_INTERVAL'; +exports[3693] = 'ER_REGEXP_MAX_LT_MIN'; +exports[3694] = 'ER_REGEXP_INVALID_BACK_REF'; +exports[3695] = 'ER_REGEXP_LOOK_BEHIND_LIMIT'; +exports[3696] = 'ER_REGEXP_MISSING_CLOSE_BRACKET'; +exports[3697] = 'ER_REGEXP_INVALID_RANGE'; +exports[3698] = 'ER_REGEXP_STACK_OVERFLOW'; +exports[3699] = 'ER_REGEXP_TIME_OUT'; +exports[3700] = 'ER_REGEXP_PATTERN_TOO_BIG'; +exports[3701] = 'ER_CANT_SET_ERROR_LOG_SERVICE'; +exports[3702] = 'ER_EMPTY_PIPELINE_FOR_ERROR_LOG_SERVICE'; +exports[3703] = 'ER_COMPONENT_FILTER_DIAGNOSTICS'; +exports[3704] = 'ER_NOT_IMPLEMENTED_FOR_CARTESIAN_SRS'; +exports[3705] = 'ER_NOT_IMPLEMENTED_FOR_PROJECTED_SRS'; +exports[3706] = 'ER_NONPOSITIVE_RADIUS'; +exports[3707] = 'ER_RESTART_SERVER_FAILED'; +exports[3708] = 'ER_SRS_MISSING_MANDATORY_ATTRIBUTE'; +exports[3709] = 'ER_SRS_MULTIPLE_ATTRIBUTE_DEFINITIONS'; +exports[3710] = 'ER_SRS_NAME_CANT_BE_EMPTY_OR_WHITESPACE'; +exports[3711] = 'ER_SRS_ORGANIZATION_CANT_BE_EMPTY_OR_WHITESPACE'; +exports[3712] = 'ER_SRS_ID_ALREADY_EXISTS'; +exports[3713] = 'ER_WARN_SRS_ID_ALREADY_EXISTS'; +exports[3714] = 'ER_CANT_MODIFY_SRID_0'; +exports[3715] = 'ER_WARN_RESERVED_SRID_RANGE'; +exports[3716] = 'ER_CANT_MODIFY_SRS_USED_BY_COLUMN'; +exports[3717] = 'ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE'; +exports[3718] = 'ER_SRS_ATTRIBUTE_STRING_TOO_LONG'; +exports[3719] = 'ER_DEPRECATED_UTF8_ALIAS'; +exports[3720] = 'ER_DEPRECATED_NATIONAL'; +exports[3721] = 'ER_INVALID_DEFAULT_UTF8MB4_COLLATION'; +exports[3722] = 'ER_UNABLE_TO_COLLECT_LOG_STATUS'; +exports[3723] = 'ER_RESERVED_TABLESPACE_NAME'; +exports[3724] = 'ER_UNABLE_TO_SET_OPTION'; +exports[3725] = 'ER_REPLICA_POSSIBLY_DIVERGED_AFTER_DDL'; +exports[3726] = 'ER_SRS_NOT_GEOGRAPHIC'; +exports[3727] = 'ER_POLYGON_TOO_LARGE'; +exports[3728] = 'ER_SPATIAL_UNIQUE_INDEX'; +exports[3729] = 'ER_INDEX_TYPE_NOT_SUPPORTED_FOR_SPATIAL_INDEX'; +exports[3730] = 'ER_FK_CANNOT_DROP_PARENT'; +exports[3731] = 'ER_GEOMETRY_PARAM_LONGITUDE_OUT_OF_RANGE'; +exports[3732] = 'ER_GEOMETRY_PARAM_LATITUDE_OUT_OF_RANGE'; +exports[3733] = 'ER_FK_CANNOT_USE_VIRTUAL_COLUMN'; +exports[3734] = 'ER_FK_NO_COLUMN_PARENT'; +exports[3735] = 'ER_CANT_SET_ERROR_SUPPRESSION_LIST'; +exports[3736] = 'ER_SRS_GEOGCS_INVALID_AXES'; +exports[3737] = 'ER_SRS_INVALID_SEMI_MAJOR_AXIS'; +exports[3738] = 'ER_SRS_INVALID_INVERSE_FLATTENING'; +exports[3739] = 'ER_SRS_INVALID_ANGULAR_UNIT'; +exports[3740] = 'ER_SRS_INVALID_PRIME_MERIDIAN'; +exports[3741] = 'ER_TRANSFORM_SOURCE_SRS_NOT_SUPPORTED'; +exports[3742] = 'ER_TRANSFORM_TARGET_SRS_NOT_SUPPORTED'; +exports[3743] = 'ER_TRANSFORM_SOURCE_SRS_MISSING_TOWGS84'; +exports[3744] = 'ER_TRANSFORM_TARGET_SRS_MISSING_TOWGS84'; +exports[3745] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_SESSION_BINLOG_FORMAT'; +exports[3746] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT'; +exports[3747] = 'ER_RUNNING_APPLIER_PREVENTS_SWITCH_GLOBAL_BINLOG_FORMAT'; +exports[3748] = 'ER_CLIENT_GTID_UNSAFE_CREATE_DROP_TEMP_TABLE_IN_TRX_IN_SBR'; +exports[3749] = 'ER_XA_CANT_CREATE_MDL_BACKUP'; +exports[3750] = 'ER_TABLE_WITHOUT_PK'; +exports[3751] = 'ER_WARN_DATA_TRUNCATED_FUNCTIONAL_INDEX'; +exports[3752] = 'ER_WARN_DATA_OUT_OF_RANGE_FUNCTIONAL_INDEX'; +exports[3753] = 'ER_FUNCTIONAL_INDEX_ON_JSON_OR_GEOMETRY_FUNCTION'; +exports[3754] = 'ER_FUNCTIONAL_INDEX_REF_AUTO_INCREMENT'; +exports[3755] = 'ER_CANNOT_DROP_COLUMN_FUNCTIONAL_INDEX'; +exports[3756] = 'ER_FUNCTIONAL_INDEX_PRIMARY_KEY'; +exports[3757] = 'ER_FUNCTIONAL_INDEX_ON_LOB'; +exports[3758] = 'ER_FUNCTIONAL_INDEX_FUNCTION_IS_NOT_ALLOWED'; +exports[3759] = 'ER_FULLTEXT_FUNCTIONAL_INDEX'; +exports[3760] = 'ER_SPATIAL_FUNCTIONAL_INDEX'; +exports[3761] = 'ER_WRONG_KEY_COLUMN_FUNCTIONAL_INDEX'; +exports[3762] = 'ER_FUNCTIONAL_INDEX_ON_FIELD'; +exports[3763] = 'ER_GENERATED_COLUMN_NAMED_FUNCTION_IS_NOT_ALLOWED'; +exports[3764] = 'ER_GENERATED_COLUMN_ROW_VALUE'; +exports[3765] = 'ER_GENERATED_COLUMN_VARIABLES'; +exports[3766] = 'ER_DEPENDENT_BY_DEFAULT_GENERATED_VALUE'; +exports[3767] = 'ER_DEFAULT_VAL_GENERATED_NON_PRIOR'; +exports[3768] = 'ER_DEFAULT_VAL_GENERATED_REF_AUTO_INC'; +exports[3769] = 'ER_DEFAULT_VAL_GENERATED_FUNCTION_IS_NOT_ALLOWED'; +exports[3770] = 'ER_DEFAULT_VAL_GENERATED_NAMED_FUNCTION_IS_NOT_ALLOWED'; +exports[3771] = 'ER_DEFAULT_VAL_GENERATED_ROW_VALUE'; +exports[3772] = 'ER_DEFAULT_VAL_GENERATED_VARIABLES'; +exports[3773] = 'ER_DEFAULT_AS_VAL_GENERATED'; +exports[3774] = 'ER_UNSUPPORTED_ACTION_ON_DEFAULT_VAL_GENERATED'; +exports[3775] = 'ER_GTID_UNSAFE_ALTER_ADD_COL_WITH_DEFAULT_EXPRESSION'; +exports[3776] = 'ER_FK_CANNOT_CHANGE_ENGINE'; +exports[3777] = 'ER_WARN_DEPRECATED_USER_SET_EXPR'; +exports[3778] = 'ER_WARN_DEPRECATED_UTF8MB3_COLLATION'; +exports[3779] = 'ER_WARN_DEPRECATED_NESTED_COMMENT_SYNTAX'; +exports[3780] = 'ER_FK_INCOMPATIBLE_COLUMNS'; +exports[3781] = 'ER_GR_HOLD_WAIT_TIMEOUT'; +exports[3782] = 'ER_GR_HOLD_KILLED'; +exports[3783] = 'ER_GR_HOLD_MEMBER_STATUS_ERROR'; +exports[3784] = 'ER_RPL_ENCRYPTION_FAILED_TO_FETCH_KEY'; +exports[3785] = 'ER_RPL_ENCRYPTION_KEY_NOT_FOUND'; +exports[3786] = 'ER_RPL_ENCRYPTION_KEYRING_INVALID_KEY'; +exports[3787] = 'ER_RPL_ENCRYPTION_HEADER_ERROR'; +exports[3788] = 'ER_RPL_ENCRYPTION_FAILED_TO_ROTATE_LOGS'; +exports[3789] = 'ER_RPL_ENCRYPTION_KEY_EXISTS_UNEXPECTED'; +exports[3790] = 'ER_RPL_ENCRYPTION_FAILED_TO_GENERATE_KEY'; +exports[3791] = 'ER_RPL_ENCRYPTION_FAILED_TO_STORE_KEY'; +exports[3792] = 'ER_RPL_ENCRYPTION_FAILED_TO_REMOVE_KEY'; +exports[3793] = 'ER_RPL_ENCRYPTION_UNABLE_TO_CHANGE_OPTION'; +exports[3794] = 'ER_RPL_ENCRYPTION_MASTER_KEY_RECOVERY_FAILED'; +exports[3795] = 'ER_SLOW_LOG_MODE_IGNORED_WHEN_NOT_LOGGING_TO_FILE'; +exports[3796] = 'ER_GRP_TRX_CONSISTENCY_NOT_ALLOWED'; +exports[3797] = 'ER_GRP_TRX_CONSISTENCY_BEFORE'; +exports[3798] = 'ER_GRP_TRX_CONSISTENCY_AFTER_ON_TRX_BEGIN'; +exports[3799] = 'ER_GRP_TRX_CONSISTENCY_BEGIN_NOT_ALLOWED'; +exports[3800] = 'ER_FUNCTIONAL_INDEX_ROW_VALUE_IS_NOT_ALLOWED'; +exports[3801] = 'ER_RPL_ENCRYPTION_FAILED_TO_ENCRYPT'; +exports[3802] = 'ER_PAGE_TRACKING_NOT_STARTED'; +exports[3803] = 'ER_PAGE_TRACKING_RANGE_NOT_TRACKED'; +exports[3804] = 'ER_PAGE_TRACKING_CANNOT_PURGE'; +exports[3805] = 'ER_RPL_ENCRYPTION_CANNOT_ROTATE_BINLOG_MASTER_KEY'; +exports[3806] = 'ER_BINLOG_MASTER_KEY_RECOVERY_OUT_OF_COMBINATION'; +exports[3807] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_OPERATE_KEY'; +exports[3808] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_ROTATE_LOGS'; +exports[3809] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_REENCRYPT_LOG'; +exports[3810] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_UNUSED_KEYS'; +exports[3811] = 'ER_BINLOG_MASTER_KEY_ROTATION_FAIL_TO_CLEANUP_AUX_KEY'; +exports[3812] = 'ER_NON_BOOLEAN_EXPR_FOR_CHECK_CONSTRAINT'; +exports[3813] = 'ER_COLUMN_CHECK_CONSTRAINT_REFERENCES_OTHER_COLUMN'; +exports[3814] = 'ER_CHECK_CONSTRAINT_NAMED_FUNCTION_IS_NOT_ALLOWED'; +exports[3815] = 'ER_CHECK_CONSTRAINT_FUNCTION_IS_NOT_ALLOWED'; +exports[3816] = 'ER_CHECK_CONSTRAINT_VARIABLES'; +exports[3817] = 'ER_CHECK_CONSTRAINT_ROW_VALUE'; +exports[3818] = 'ER_CHECK_CONSTRAINT_REFERS_AUTO_INCREMENT_COLUMN'; +exports[3819] = 'ER_CHECK_CONSTRAINT_VIOLATED'; +exports[3820] = 'ER_CHECK_CONSTRAINT_REFERS_UNKNOWN_COLUMN'; +exports[3821] = 'ER_CHECK_CONSTRAINT_NOT_FOUND'; +exports[3822] = 'ER_CHECK_CONSTRAINT_DUP_NAME'; +exports[3823] = 'ER_CHECK_CONSTRAINT_CLAUSE_USING_FK_REFER_ACTION_COLUMN'; +exports[3824] = 'WARN_UNENCRYPTED_TABLE_IN_ENCRYPTED_DB'; +exports[3825] = 'ER_INVALID_ENCRYPTION_REQUEST'; +exports[3826] = 'ER_CANNOT_SET_TABLE_ENCRYPTION'; +exports[3827] = 'ER_CANNOT_SET_DATABASE_ENCRYPTION'; +exports[3828] = 'ER_CANNOT_SET_TABLESPACE_ENCRYPTION'; +exports[3829] = 'ER_TABLESPACE_CANNOT_BE_ENCRYPTED'; +exports[3830] = 'ER_TABLESPACE_CANNOT_BE_DECRYPTED'; +exports[3831] = 'ER_TABLESPACE_TYPE_UNKNOWN'; +exports[3832] = 'ER_TARGET_TABLESPACE_UNENCRYPTED'; +exports[3833] = 'ER_CANNOT_USE_ENCRYPTION_CLAUSE'; +exports[3834] = 'ER_INVALID_MULTIPLE_CLAUSES'; +exports[3835] = 'ER_UNSUPPORTED_USE_OF_GRANT_AS'; +exports[3836] = 'ER_UKNOWN_AUTH_ID_OR_ACCESS_DENIED_FOR_GRANT_AS'; +exports[3837] = 'ER_DEPENDENT_BY_FUNCTIONAL_INDEX'; +exports[3838] = 'ER_PLUGIN_NOT_EARLY'; +exports[3839] = 'ER_INNODB_REDO_LOG_ARCHIVE_START_SUBDIR_PATH'; +exports[3840] = 'ER_INNODB_REDO_LOG_ARCHIVE_START_TIMEOUT'; +exports[3841] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIRS_INVALID'; +exports[3842] = 'ER_INNODB_REDO_LOG_ARCHIVE_LABEL_NOT_FOUND'; +exports[3843] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIR_EMPTY'; +exports[3844] = 'ER_INNODB_REDO_LOG_ARCHIVE_NO_SUCH_DIR'; +exports[3845] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIR_CLASH'; +exports[3846] = 'ER_INNODB_REDO_LOG_ARCHIVE_DIR_PERMISSIONS'; +exports[3847] = 'ER_INNODB_REDO_LOG_ARCHIVE_FILE_CREATE'; +exports[3848] = 'ER_INNODB_REDO_LOG_ARCHIVE_ACTIVE'; +exports[3849] = 'ER_INNODB_REDO_LOG_ARCHIVE_INACTIVE'; +exports[3850] = 'ER_INNODB_REDO_LOG_ARCHIVE_FAILED'; +exports[3851] = 'ER_INNODB_REDO_LOG_ARCHIVE_SESSION'; +exports[3852] = 'ER_STD_REGEX_ERROR'; +exports[3853] = 'ER_INVALID_JSON_TYPE'; +exports[3854] = 'ER_CANNOT_CONVERT_STRING'; +exports[3855] = 'ER_DEPENDENT_BY_PARTITION_FUNC'; +exports[3856] = 'ER_WARN_DEPRECATED_FLOAT_AUTO_INCREMENT'; +exports[3857] = 'ER_RPL_CANT_STOP_REPLICA_WHILE_LOCKED_BACKUP'; +exports[3858] = 'ER_WARN_DEPRECATED_FLOAT_DIGITS'; +exports[3859] = 'ER_WARN_DEPRECATED_FLOAT_UNSIGNED'; +exports[3860] = 'ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH'; +exports[3861] = 'ER_WARN_DEPRECATED_ZEROFILL'; +exports[3862] = 'ER_CLONE_DONOR'; +exports[3863] = 'ER_CLONE_PROTOCOL'; +exports[3864] = 'ER_CLONE_DONOR_VERSION'; +exports[3865] = 'ER_CLONE_OS'; +exports[3866] = 'ER_CLONE_PLATFORM'; +exports[3867] = 'ER_CLONE_CHARSET'; +exports[3868] = 'ER_CLONE_CONFIG'; +exports[3869] = 'ER_CLONE_SYS_CONFIG'; +exports[3870] = 'ER_CLONE_PLUGIN_MATCH'; +exports[3871] = 'ER_CLONE_LOOPBACK'; +exports[3872] = 'ER_CLONE_ENCRYPTION'; +exports[3873] = 'ER_CLONE_DISK_SPACE'; +exports[3874] = 'ER_CLONE_IN_PROGRESS'; +exports[3875] = 'ER_CLONE_DISALLOWED'; +exports[3876] = 'ER_CANNOT_GRANT_ROLES_TO_ANONYMOUS_USER'; +exports[3877] = 'ER_SECONDARY_ENGINE_PLUGIN'; +exports[3878] = 'ER_SECOND_PASSWORD_CANNOT_BE_EMPTY'; +exports[3879] = 'ER_DB_ACCESS_DENIED'; +exports[3880] = 'ER_DA_AUTH_ID_WITH_SYSTEM_USER_PRIV_IN_MANDATORY_ROLES'; +exports[3881] = 'ER_DA_RPL_GTID_TABLE_CANNOT_OPEN'; +exports[3882] = 'ER_GEOMETRY_IN_UNKNOWN_LENGTH_UNIT'; +exports[3883] = 'ER_DA_PLUGIN_INSTALL_ERROR'; +exports[3884] = 'ER_NO_SESSION_TEMP'; +exports[3885] = 'ER_DA_UNKNOWN_ERROR_NUMBER'; +exports[3886] = 'ER_COLUMN_CHANGE_SIZE'; +exports[3887] = 'ER_REGEXP_INVALID_CAPTURE_GROUP_NAME'; +exports[3888] = 'ER_DA_SSL_LIBRARY_ERROR'; +exports[3889] = 'ER_SECONDARY_ENGINE'; +exports[3890] = 'ER_SECONDARY_ENGINE_DDL'; +exports[3891] = 'ER_INCORRECT_CURRENT_PASSWORD'; +exports[3892] = 'ER_MISSING_CURRENT_PASSWORD'; +exports[3893] = 'ER_CURRENT_PASSWORD_NOT_REQUIRED'; +exports[3894] = 'ER_PASSWORD_CANNOT_BE_RETAINED_ON_PLUGIN_CHANGE'; +exports[3895] = 'ER_CURRENT_PASSWORD_CANNOT_BE_RETAINED'; +exports[3896] = 'ER_PARTIAL_REVOKES_EXIST'; +exports[3897] = 'ER_CANNOT_GRANT_SYSTEM_PRIV_TO_MANDATORY_ROLE'; +exports[3898] = 'ER_XA_REPLICATION_FILTERS'; +exports[3899] = 'ER_UNSUPPORTED_SQL_MODE'; +exports[3900] = 'ER_REGEXP_INVALID_FLAG'; +exports[3901] = 'ER_PARTIAL_REVOKE_AND_DB_GRANT_BOTH_EXISTS'; +exports[3902] = 'ER_UNIT_NOT_FOUND'; +exports[3903] = 'ER_INVALID_JSON_VALUE_FOR_FUNC_INDEX'; +exports[3904] = 'ER_JSON_VALUE_OUT_OF_RANGE_FOR_FUNC_INDEX'; +exports[3905] = 'ER_EXCEEDED_MV_KEYS_NUM'; +exports[3906] = 'ER_EXCEEDED_MV_KEYS_SPACE'; +exports[3907] = 'ER_FUNCTIONAL_INDEX_DATA_IS_TOO_LONG'; +exports[3908] = 'ER_WRONG_MVI_VALUE'; +exports[3909] = 'ER_WARN_FUNC_INDEX_NOT_APPLICABLE'; +exports[3910] = 'ER_GRP_RPL_UDF_ERROR'; +exports[3911] = 'ER_UPDATE_GTID_PURGED_WITH_GR'; +exports[3912] = 'ER_GROUPING_ON_TIMESTAMP_IN_DST'; +exports[3913] = 'ER_TABLE_NAME_CAUSES_TOO_LONG_PATH'; +exports[3914] = 'ER_AUDIT_LOG_INSUFFICIENT_PRIVILEGE'; +exports[3915] = 'ER_AUDIT_LOG_PASSWORD_HAS_BEEN_COPIED'; +exports[3916] = 'ER_DA_GRP_RPL_STARTED_AUTO_REJOIN'; +exports[3917] = 'ER_SYSVAR_CHANGE_DURING_QUERY'; +exports[3918] = 'ER_GLOBSTAT_CHANGE_DURING_QUERY'; +exports[3919] = 'ER_GRP_RPL_MESSAGE_SERVICE_INIT_FAILURE'; +exports[3920] = 'ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_CLIENT'; +exports[3921] = 'ER_CHANGE_SOURCE_WRONG_COMPRESSION_LEVEL_CLIENT'; +exports[3922] = 'ER_WRONG_COMPRESSION_ALGORITHM_CLIENT'; +exports[3923] = 'ER_WRONG_COMPRESSION_LEVEL_CLIENT'; +exports[3924] = 'ER_CHANGE_SOURCE_WRONG_COMPRESSION_ALGORITHM_LIST_CLIENT'; +exports[3925] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_CANNOT_BE_ANONYMOUS'; +exports[3926] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_DOES_NOT_EXIST'; +exports[3927] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_CORRUPT'; +exports[3928] = 'ER_CLIENT_PRIVILEGE_CHECKS_USER_NEEDS_RPL_APPLIER_PRIV'; +exports[3929] = 'ER_WARN_DA_PRIVILEGE_NOT_REGISTERED'; +exports[3930] = 'ER_CLIENT_KEYRING_UDF_KEY_INVALID'; +exports[3931] = 'ER_CLIENT_KEYRING_UDF_KEY_TYPE_INVALID'; +exports[3932] = 'ER_CLIENT_KEYRING_UDF_KEY_TOO_LONG'; +exports[3933] = 'ER_CLIENT_KEYRING_UDF_KEY_TYPE_TOO_LONG'; +exports[3934] = 'ER_JSON_SCHEMA_VALIDATION_ERROR_WITH_DETAILED_REPORT'; +exports[3935] = 'ER_DA_UDF_INVALID_CHARSET_SPECIFIED'; +exports[3936] = 'ER_DA_UDF_INVALID_CHARSET'; +exports[3937] = 'ER_DA_UDF_INVALID_COLLATION'; +exports[3938] = 'ER_DA_UDF_INVALID_EXTENSION_ARGUMENT_TYPE'; +exports[3939] = 'ER_MULTIPLE_CONSTRAINTS_WITH_SAME_NAME'; +exports[3940] = 'ER_CONSTRAINT_NOT_FOUND'; +exports[3941] = 'ER_ALTER_CONSTRAINT_ENFORCEMENT_NOT_SUPPORTED'; +exports[3942] = 'ER_TABLE_VALUE_CONSTRUCTOR_MUST_HAVE_COLUMNS'; +exports[3943] = 'ER_TABLE_VALUE_CONSTRUCTOR_CANNOT_HAVE_DEFAULT'; +exports[3944] = 'ER_CLIENT_QUERY_FAILURE_INVALID_NON_ROW_FORMAT'; +exports[3945] = 'ER_REQUIRE_ROW_FORMAT_INVALID_VALUE'; +exports[3946] = 'ER_FAILED_TO_DETERMINE_IF_ROLE_IS_MANDATORY'; +exports[3947] = 'ER_FAILED_TO_FETCH_MANDATORY_ROLE_LIST'; +exports[3948] = 'ER_CLIENT_LOCAL_FILES_DISABLED'; +exports[3949] = 'ER_IMP_INCOMPATIBLE_CFG_VERSION'; +exports[3950] = 'ER_DA_OOM'; +exports[3951] = 'ER_DA_UDF_INVALID_ARGUMENT_TO_SET_CHARSET'; +exports[3952] = 'ER_DA_UDF_INVALID_RETURN_TYPE_TO_SET_CHARSET'; +exports[3953] = 'ER_MULTIPLE_INTO_CLAUSES'; +exports[3954] = 'ER_MISPLACED_INTO'; +exports[3955] = + 'ER_USER_ACCESS_DENIED_FOR_USER_ACCOUNT_BLOCKED_BY_PASSWORD_LOCK'; +exports[3956] = 'ER_WARN_DEPRECATED_YEAR_UNSIGNED'; +exports[3957] = 'ER_CLONE_NETWORK_PACKET'; +exports[3958] = 'ER_SDI_OPERATION_FAILED_MISSING_RECORD'; +exports[3959] = 'ER_DEPENDENT_BY_CHECK_CONSTRAINT'; +exports[3960] = 'ER_GRP_OPERATION_NOT_ALLOWED_GR_MUST_STOP'; +exports[3961] = 'ER_WARN_DEPRECATED_JSON_TABLE_ON_ERROR_ON_EMPTY'; +exports[3962] = 'ER_WARN_DEPRECATED_INNER_INTO'; +exports[3963] = 'ER_WARN_DEPRECATED_VALUES_FUNCTION_ALWAYS_NULL'; +exports[3964] = 'ER_WARN_DEPRECATED_SQL_CALC_FOUND_ROWS'; +exports[3965] = 'ER_WARN_DEPRECATED_FOUND_ROWS'; +exports[3966] = 'ER_MISSING_JSON_VALUE'; +exports[3967] = 'ER_MULTIPLE_JSON_VALUES'; +exports[3968] = 'ER_HOSTNAME_TOO_LONG'; +exports[3969] = 'ER_WARN_CLIENT_DEPRECATED_PARTITION_PREFIX_KEY'; +exports[3970] = 'ER_GROUP_REPLICATION_USER_EMPTY_MSG'; +exports[3971] = 'ER_GROUP_REPLICATION_USER_MANDATORY_MSG'; +exports[3972] = 'ER_GROUP_REPLICATION_PASSWORD_LENGTH'; +exports[3973] = 'ER_SUBQUERY_TRANSFORM_REJECTED'; +exports[3974] = 'ER_DA_GRP_RPL_RECOVERY_ENDPOINT_FORMAT'; +exports[3975] = 'ER_DA_GRP_RPL_RECOVERY_ENDPOINT_INVALID'; +exports[3976] = 'ER_WRONG_VALUE_FOR_VAR_PLUS_ACTIONABLE_PART'; +exports[3977] = 'ER_STATEMENT_NOT_ALLOWED_AFTER_START_TRANSACTION'; +exports[3978] = 'ER_FOREIGN_KEY_WITH_ATOMIC_CREATE_SELECT'; +exports[3979] = 'ER_NOT_ALLOWED_WITH_START_TRANSACTION'; +exports[3980] = 'ER_INVALID_JSON_ATTRIBUTE'; +exports[3981] = 'ER_ENGINE_ATTRIBUTE_NOT_SUPPORTED'; +exports[3982] = 'ER_INVALID_USER_ATTRIBUTE_JSON'; +exports[3983] = 'ER_INNODB_REDO_DISABLED'; +exports[3984] = 'ER_INNODB_REDO_ARCHIVING_ENABLED'; +exports[3985] = 'ER_MDL_OUT_OF_RESOURCES'; +exports[3986] = 'ER_IMPLICIT_COMPARISON_FOR_JSON'; +exports[3987] = 'ER_FUNCTION_DOES_NOT_SUPPORT_CHARACTER_SET'; +exports[3988] = 'ER_IMPOSSIBLE_STRING_CONVERSION'; +exports[3989] = 'ER_SCHEMA_READ_ONLY'; +exports[3990] = 'ER_RPL_ASYNC_RECONNECT_GTID_MODE_OFF'; +exports[3991] = 'ER_RPL_ASYNC_RECONNECT_AUTO_POSITION_OFF'; +exports[3992] = 'ER_DISABLE_GTID_MODE_REQUIRES_ASYNC_RECONNECT_OFF'; +exports[3993] = 'ER_DISABLE_AUTO_POSITION_REQUIRES_ASYNC_RECONNECT_OFF'; +exports[3994] = 'ER_INVALID_PARAMETER_USE'; +exports[3995] = 'ER_CHARACTER_SET_MISMATCH'; +exports[3996] = 'ER_WARN_VAR_VALUE_CHANGE_NOT_SUPPORTED'; +exports[3997] = 'ER_INVALID_TIME_ZONE_INTERVAL'; +exports[3998] = 'ER_INVALID_CAST'; +exports[3999] = 'ER_HYPERGRAPH_NOT_SUPPORTED_YET'; +exports[4000] = 'ER_WARN_HYPERGRAPH_EXPERIMENTAL'; +exports[4001] = 'ER_DA_NO_ERROR_LOG_PARSER_CONFIGURED'; +exports[4002] = 'ER_DA_ERROR_LOG_TABLE_DISABLED'; +exports[4003] = 'ER_DA_ERROR_LOG_MULTIPLE_FILTERS'; +exports[4004] = 'ER_DA_CANT_OPEN_ERROR_LOG'; +exports[4005] = 'ER_USER_REFERENCED_AS_DEFINER'; +exports[4006] = 'ER_CANNOT_USER_REFERENCED_AS_DEFINER'; +exports[4007] = 'ER_REGEX_NUMBER_TOO_BIG'; +exports[4008] = 'ER_SPVAR_NONINTEGER_TYPE'; +exports[4009] = 'WARN_UNSUPPORTED_ACL_TABLES_READ'; +exports[4010] = 'ER_BINLOG_UNSAFE_ACL_TABLE_READ_IN_DML_DDL'; +exports[4011] = 'ER_STOP_REPLICA_MONITOR_IO_THREAD_TIMEOUT'; +exports[4012] = 'ER_STARTING_REPLICA_MONITOR_IO_THREAD'; +exports[4013] = 'ER_CANT_USE_ANONYMOUS_TO_GTID_WITH_GTID_MODE_NOT_ON'; +exports[4014] = 'ER_CANT_COMBINE_ANONYMOUS_TO_GTID_AND_AUTOPOSITION'; +exports[4015] = + 'ER_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_REQUIRES_GTID_MODE_ON'; +exports[4016] = 'ER_SQL_REPLICA_SKIP_COUNTER_USED_WITH_GTID_MODE_ON'; +exports[4017] = + 'ER_USING_ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS_AS_LOCAL_OR_UUID'; +exports[4018] = + 'ER_CANT_SET_ANONYMOUS_TO_GTID_AND_WAIT_UNTIL_SQL_THD_AFTER_GTIDS'; +exports[4019] = 'ER_CANT_SET_SQL_AFTER_OR_BEFORE_GTIDS_WITH_ANONYMOUS_TO_GTID'; +exports[4020] = 'ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_GROUP_NAME'; +exports[4021] = 'ER_CANT_USE_SAME_UUID_AS_GROUP_NAME'; +exports[4022] = 'ER_GRP_RPL_RECOVERY_CHANNEL_STILL_RUNNING'; +exports[4023] = 'ER_INNODB_INVALID_AUTOEXTEND_SIZE_VALUE'; +exports[4024] = 'ER_INNODB_INCOMPATIBLE_WITH_TABLESPACE'; +exports[4025] = 'ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE'; +exports[4026] = 'ER_CANNOT_USE_AUTOEXTEND_SIZE_CLAUSE'; +exports[4027] = 'ER_ROLE_GRANTED_TO_ITSELF'; +exports[4028] = 'ER_TABLE_MUST_HAVE_A_VISIBLE_COLUMN'; +exports[4029] = 'ER_INNODB_COMPRESSION_FAILURE'; +exports[4030] = 'ER_WARN_ASYNC_CONN_FAILOVER_NETWORK_NAMESPACE'; +exports[4031] = 'ER_CLIENT_INTERACTION_TIMEOUT'; +exports[4032] = 'ER_INVALID_CAST_TO_GEOMETRY'; +exports[4033] = 'ER_INVALID_CAST_POLYGON_RING_DIRECTION'; +exports[4034] = 'ER_GIS_DIFFERENT_SRIDS_AGGREGATION'; +exports[4035] = 'ER_RELOAD_KEYRING_FAILURE'; +exports[4036] = 'ER_SDI_GET_KEYS_INVALID_TABLESPACE'; +exports[4037] = 'ER_CHANGE_RPL_SRC_WRONG_COMPRESSION_ALGORITHM_SIZE'; +exports[4038] = 'ER_WARN_DEPRECATED_TLS_VERSION_FOR_CHANNEL_CLI'; +exports[4039] = 'ER_CANT_USE_SAME_UUID_AS_VIEW_CHANGE_UUID'; +exports[4040] = 'ER_ANONYMOUS_TO_GTID_UUID_SAME_AS_VIEW_CHANGE_UUID'; +exports[4041] = 'ER_GRP_RPL_VIEW_CHANGE_UUID_FAIL_GET_VARIABLE'; +exports[4042] = 'ER_WARN_ADUIT_LOG_MAX_SIZE_AND_PRUNE_SECONDS'; +exports[4043] = 'ER_WARN_ADUIT_LOG_MAX_SIZE_CLOSE_TO_ROTATE_ON_SIZE'; +exports[4044] = 'ER_KERBEROS_CREATE_USER'; +exports[4045] = 'ER_INSTALL_PLUGIN_CONFLICT_CLIENT'; +exports[4046] = 'ER_DA_ERROR_LOG_COMPONENT_FLUSH_FAILED'; +exports[4047] = 'ER_WARN_SQL_AFTER_MTS_GAPS_GAP_NOT_CALCULATED'; +exports[4048] = 'ER_INVALID_ASSIGNMENT_TARGET'; +exports[4049] = 'ER_OPERATION_NOT_ALLOWED_ON_GR_SECONDARY'; +exports[4050] = 'ER_GRP_RPL_FAILOVER_CHANNEL_STATUS_PROPAGATION'; +exports[4051] = 'ER_WARN_AUDIT_LOG_FORMAT_UNIX_TIMESTAMP_ONLY_WHEN_JSON'; +exports[4052] = 'ER_INVALID_MFA_PLUGIN_SPECIFIED'; +exports[4053] = 'ER_IDENTIFIED_BY_UNSUPPORTED'; +exports[4054] = 'ER_INVALID_PLUGIN_FOR_REGISTRATION'; +exports[4055] = 'ER_PLUGIN_REQUIRES_REGISTRATION'; +exports[4056] = 'ER_MFA_METHOD_EXISTS'; +exports[4057] = 'ER_MFA_METHOD_NOT_EXISTS'; +exports[4058] = 'ER_AUTHENTICATION_POLICY_MISMATCH'; +exports[4059] = 'ER_PLUGIN_REGISTRATION_DONE'; +exports[4060] = 'ER_INVALID_USER_FOR_REGISTRATION'; +exports[4061] = 'ER_USER_REGISTRATION_FAILED'; +exports[4062] = 'ER_MFA_METHODS_INVALID_ORDER'; +exports[4063] = 'ER_MFA_METHODS_IDENTICAL'; +exports[4064] = 'ER_INVALID_MFA_OPERATIONS_FOR_PASSWORDLESS_USER'; +exports[4065] = 'ER_CHANGE_REPLICATION_SOURCE_NO_OPTIONS_FOR_GTID_ONLY'; +exports[4066] = + 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_REQ_ROW_FORMAT_WITH_GTID_ONLY'; +exports[4067] = + 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POSITION_WITH_GTID_ONLY'; +exports[4068] = 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_GTID_ONLY_WITHOUT_POSITIONS'; +exports[4069] = 'ER_CHANGE_REP_SOURCE_CANT_DISABLE_AUTO_POS_WITHOUT_POSITIONS'; +exports[4070] = 'ER_CHANGE_REP_SOURCE_GR_CHANNEL_WITH_GTID_MODE_NOT_ON'; +exports[4071] = 'ER_CANT_USE_GTID_ONLY_WITH_GTID_MODE_NOT_ON'; +exports[4072] = 'ER_WARN_C_DISABLE_GTID_ONLY_WITH_SOURCE_AUTO_POS_INVALID_POS'; +exports[4073] = 'ER_DA_SSL_FIPS_MODE_ERROR'; +exports[4074] = 'ER_VALUE_OUT_OF_RANGE'; +exports[4075] = 'ER_FULLTEXT_WITH_ROLLUP'; +exports[4076] = 'ER_REGEXP_MISSING_RESOURCE'; +exports[4077] = 'ER_WARN_REGEXP_USING_DEFAULT'; +exports[4078] = 'ER_REGEXP_MISSING_FILE'; +exports[4079] = 'ER_WARN_DEPRECATED_COLLATION'; +exports[4080] = 'ER_CONCURRENT_PROCEDURE_USAGE'; +exports[4081] = 'ER_DA_GLOBAL_CONN_LIMIT'; +exports[4082] = 'ER_DA_CONN_LIMIT'; +exports[4083] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE_INSTANT'; +exports[4084] = 'ER_WARN_SF_UDF_NAME_COLLISION'; +exports[4085] = 'ER_CANNOT_PURGE_BINLOG_WITH_BACKUP_LOCK'; +exports[4086] = 'ER_TOO_MANY_WINDOWS'; +exports[4087] = 'ER_MYSQLBACKUP_CLIENT_MSG'; +exports[4088] = 'ER_COMMENT_CONTAINS_INVALID_STRING'; +exports[4089] = 'ER_DEFINITION_CONTAINS_INVALID_STRING'; +exports[4090] = 'ER_CANT_EXECUTE_COMMAND_WITH_ASSIGNED_GTID_NEXT'; +exports[4091] = 'ER_XA_TEMP_TABLE'; +exports[4092] = 'ER_INNODB_MAX_ROW_VERSION'; +exports[4093] = 'ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_SIZE'; +exports[4094] = 'ER_OPERATION_NOT_ALLOWED_WHILE_PRIMARY_CHANGE_IS_RUNNING'; +exports[4095] = 'ER_WARN_DEPRECATED_DATETIME_DELIMITER'; +exports[4096] = 'ER_WARN_DEPRECATED_SUPERFLUOUS_DELIMITER'; +exports[4097] = 'ER_CANNOT_PERSIST_SENSITIVE_VARIABLES'; +exports[4098] = 'ER_WARN_CANNOT_SECURELY_PERSIST_SENSITIVE_VARIABLES'; +exports[4099] = 'ER_WARN_TRG_ALREADY_EXISTS'; +exports[4100] = 'ER_IF_NOT_EXISTS_UNSUPPORTED_TRG_EXISTS_ON_DIFFERENT_TABLE'; +exports[4101] = 'ER_IF_NOT_EXISTS_UNSUPPORTED_UDF_NATIVE_FCT_NAME_COLLISION'; +exports[4102] = 'ER_SET_PASSWORD_AUTH_PLUGIN_ERROR'; +exports[4103] = 'ER_REDUCED_DBLWR_FILE_CORRUPTED'; +exports[4104] = 'ER_REDUCED_DBLWR_PAGE_FOUND'; +exports[4105] = 'ER_SRS_INVALID_LATITUDE_OF_ORIGIN'; +exports[4106] = 'ER_SRS_INVALID_LONGITUDE_OF_ORIGIN'; +exports[4107] = 'ER_SRS_UNUSED_PROJ_PARAMETER_PRESENT'; +exports[4108] = 'ER_GIPK_COLUMN_EXISTS'; +exports[4109] = 'ER_GIPK_FAILED_AUTOINC_COLUMN_EXISTS'; +exports[4110] = 'ER_GIPK_COLUMN_ALTER_NOT_ALLOWED'; +exports[4111] = 'ER_DROP_PK_COLUMN_TO_DROP_GIPK'; +exports[4112] = 'ER_CREATE_SELECT_WITH_GIPK_DISALLOWED_IN_SBR'; +exports[4113] = 'ER_DA_EXPIRE_LOGS_DAYS_IGNORED'; +exports[4114] = 'ER_CTE_RECURSIVE_NOT_UNION'; +exports[4115] = 'ER_COMMAND_BACKEND_FAILED_TO_FETCH_SECURITY_CTX'; +exports[4116] = 'ER_COMMAND_SERVICE_BACKEND_FAILED'; +exports[4117] = 'ER_CLIENT_FILE_PRIVILEGE_FOR_REPLICATION_CHECKS'; +exports[4118] = 'ER_GROUP_REPLICATION_FORCE_MEMBERS_COMMAND_FAILURE'; +exports[4119] = 'ER_WARN_DEPRECATED_IDENT'; +exports[4120] = 'ER_INTERSECT_ALL_MAX_DUPLICATES_EXCEEDED'; +exports[4121] = 'ER_TP_QUERY_THRS_PER_GRP_EXCEEDS_TXN_THR_LIMIT'; +exports[4122] = 'ER_BAD_TIMESTAMP_FORMAT'; +exports[4123] = 'ER_SHAPE_PRIDICTION_UDF'; +exports[4124] = 'ER_SRS_INVALID_HEIGHT'; +exports[4125] = 'ER_SRS_INVALID_SCALING'; +exports[4126] = 'ER_SRS_INVALID_ZONE_WIDTH'; +exports[4127] = 'ER_SRS_INVALID_LATITUDE_POLAR_STERE_VAR_A'; +exports[4128] = 'ER_WARN_DEPRECATED_CLIENT_NO_SCHEMA_OPTION'; +exports[4129] = 'ER_TABLE_NOT_EMPTY'; +exports[4130] = 'ER_TABLE_NO_PRIMARY_KEY'; +exports[4131] = 'ER_TABLE_IN_SHARED_TABLESPACE'; +exports[4132] = 'ER_INDEX_OTHER_THAN_PK'; +exports[4133] = 'ER_LOAD_BULK_DATA_UNSORTED'; +exports[4134] = 'ER_BULK_EXECUTOR_ERROR'; +exports[4135] = 'ER_BULK_READER_LIBCURL_INIT_FAILED'; +exports[4136] = 'ER_BULK_READER_LIBCURL_ERROR'; +exports[4137] = 'ER_BULK_READER_SERVER_ERROR'; +exports[4138] = 'ER_BULK_READER_COMMUNICATION_ERROR'; +exports[4139] = 'ER_BULK_LOAD_DATA_FAILED'; +exports[4140] = 'ER_BULK_LOADER_COLUMN_TOO_BIG_FOR_LEFTOVER_BUFFER'; +exports[4141] = 'ER_BULK_LOADER_COMPONENT_ERROR'; +exports[4142] = 'ER_BULK_LOADER_FILE_CONTAINS_LESS_LINES_THAN_IGNORE_CLAUSE'; +exports[4143] = 'ER_BULK_PARSER_MISSING_ENCLOSED_BY'; +exports[4144] = 'ER_BULK_PARSER_ROW_BUFFER_MAX_TOTAL_COLS_EXCEEDED'; +exports[4145] = 'ER_BULK_PARSER_COPY_BUFFER_SIZE_EXCEEDED'; +exports[4146] = 'ER_BULK_PARSER_UNEXPECTED_END_OF_INPUT'; +exports[4147] = 'ER_BULK_PARSER_UNEXPECTED_ROW_TERMINATOR'; +exports[4148] = 'ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_ENDING_ENCLOSED_BY'; +exports[4149] = 'ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_NULL_ESCAPE'; +exports[4150] = 'ER_BULK_PARSER_UNEXPECTED_CHAR_AFTER_COLUMN_TERMINATOR'; +exports[4151] = 'ER_BULK_PARSER_INCOMPLETE_ESCAPE_SEQUENCE'; +exports[4152] = 'ER_LOAD_BULK_DATA_FAILED'; +exports[4153] = 'ER_LOAD_BULK_DATA_WRONG_VALUE_FOR_FIELD'; +exports[4154] = 'ER_LOAD_BULK_DATA_WARN_NULL_TO_NOTNULL'; +exports[4155] = 'ER_REQUIRE_TABLE_PRIMARY_KEY_CHECK_GENERATE_WITH_GR'; +exports[4156] = 'ER_CANT_CHANGE_SYS_VAR_IN_READ_ONLY_MODE'; +exports[4157] = 'ER_INNODB_INSTANT_ADD_DROP_NOT_SUPPORTED_MAX_SIZE'; +exports[4158] = 'ER_INNODB_INSTANT_ADD_NOT_SUPPORTED_MAX_FIELDS'; +exports[4159] = 'ER_CANT_SET_PERSISTED'; +exports[4160] = 'ER_INSTALL_COMPONENT_SET_NULL_VALUE'; +exports[4161] = 'ER_INSTALL_COMPONENT_SET_UNUSED_VALUE'; +exports[4162] = 'ER_WARN_DEPRECATED_USER_DEFINED_COLLATIONS'; diff --git a/node_modules/mysql2/lib/constants/field_flags.js b/node_modules/mysql2/lib/constants/field_flags.js new file mode 100644 index 0000000..184905c --- /dev/null +++ b/node_modules/mysql2/lib/constants/field_flags.js @@ -0,0 +1,20 @@ +'use strict'; + +// Manually extracted from mysql-5.5.23/include/mysql_com.h +exports.NOT_NULL = 1; /* Field can't be NULL */ +exports.PRI_KEY = 2; /* Field is part of a primary key */ +exports.UNIQUE_KEY = 4; /* Field is part of a unique key */ +exports.MULTIPLE_KEY = 8; /* Field is part of a key */ +exports.BLOB = 16; /* Field is a blob */ +exports.UNSIGNED = 32; /* Field is unsigned */ +exports.ZEROFILL = 64; /* Field is zerofill */ +exports.BINARY = 128; /* Field is binary */ + +/* The following are only sent to new clients */ +exports.ENUM = 256; /* field is an enum */ +exports.AUTO_INCREMENT = 512; /* field is a autoincrement field */ +exports.TIMESTAMP = 1024; /* Field is a timestamp */ +exports.SET = 2048; /* field is a set */ +exports.NO_DEFAULT_VALUE = 4096; /* Field doesn't have default value */ +exports.ON_UPDATE_NOW = 8192; /* Field is set to NOW on UPDATE */ +exports.NUM = 32768; /* Field is num (for clients) */ diff --git a/node_modules/mysql2/lib/constants/server_status.js b/node_modules/mysql2/lib/constants/server_status.js new file mode 100644 index 0000000..828c851 --- /dev/null +++ b/node_modules/mysql2/lib/constants/server_status.js @@ -0,0 +1,44 @@ +'use strict'; + +// Manually extracted from mysql-5.5.23/include/mysql_com.h + +/** + Is raised when a multi-statement transaction + has been started, either explicitly, by means + of BEGIN or COMMIT AND CHAIN, or + implicitly, by the first transactional + statement, when autocommit=off. +*/ +exports.SERVER_STATUS_IN_TRANS = 1; +exports.SERVER_STATUS_AUTOCOMMIT = 2; /* Server in auto_commit mode */ +exports.SERVER_MORE_RESULTS_EXISTS = 8; /* Multi query - next query exists */ +exports.SERVER_QUERY_NO_GOOD_INDEX_USED = 16; +exports.SERVER_QUERY_NO_INDEX_USED = 32; +/** + The server was able to fulfill the clients request and opened a + read-only non-scrollable cursor for a query. This flag comes + in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. +*/ +exports.SERVER_STATUS_CURSOR_EXISTS = 64; +/** + This flag is sent when a read-only cursor is exhausted, in reply to + COM_STMT_FETCH command. +*/ +exports.SERVER_STATUS_LAST_ROW_SENT = 128; +exports.SERVER_STATUS_DB_DROPPED = 256; /* A database was dropped */ +exports.SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512; +/** + Sent to the client if after a prepared statement reprepare + we discovered that the new statement returns a different + number of result set columns. +*/ +exports.SERVER_STATUS_METADATA_CHANGED = 1024; +exports.SERVER_QUERY_WAS_SLOW = 2048; + +/** + To mark ResultSet containing output parameter values. +*/ +exports.SERVER_PS_OUT_PARAMS = 4096; + +exports.SERVER_STATUS_IN_TRANS_READONLY = 0x2000; // in a read-only transaction +exports.SERVER_SESSION_STATE_CHANGED = 0x4000; diff --git a/node_modules/mysql2/lib/constants/session_track.js b/node_modules/mysql2/lib/constants/session_track.js new file mode 100644 index 0000000..85d8fbf --- /dev/null +++ b/node_modules/mysql2/lib/constants/session_track.js @@ -0,0 +1,11 @@ +'use strict'; + +exports.SYSTEM_VARIABLES = 0; +exports.SCHEMA = 1; +exports.STATE_CHANGE = 2; +exports.STATE_GTIDS = 3; +exports.TRANSACTION_CHARACTERISTICS = 4; +exports.TRANSACTION_STATE = 5; + +exports.FIRST_KEY = exports.SYSTEM_VARIABLES; +exports.LAST_KEY = exports.TRANSACTION_STATE; diff --git a/node_modules/mysql2/lib/constants/ssl_profiles.js b/node_modules/mysql2/lib/constants/ssl_profiles.js new file mode 100644 index 0000000..11adc6f --- /dev/null +++ b/node_modules/mysql2/lib/constants/ssl_profiles.js @@ -0,0 +1,11 @@ +'use strict'; + +const awsCaBundle = require('aws-ssl-profiles'); + +/** + * @deprecated + * Please, use [**aws-ssl-profiles**](https://github.com/mysqljs/aws-ssl-profiles). + */ +exports['Amazon RDS'] = { + ca: awsCaBundle.ca, +}; diff --git a/node_modules/mysql2/lib/constants/types.js b/node_modules/mysql2/lib/constants/types.js new file mode 100644 index 0000000..82a6655 --- /dev/null +++ b/node_modules/mysql2/lib/constants/types.js @@ -0,0 +1,64 @@ +'use strict'; + +module.exports = { + 0x00: 'DECIMAL', // aka DECIMAL + 0x01: 'TINY', // aka TINYINT, 1 byte + 0x02: 'SHORT', // aka SMALLINT, 2 bytes + 0x03: 'LONG', // aka INT, 4 bytes + 0x04: 'FLOAT', // aka FLOAT, 4-8 bytes + 0x05: 'DOUBLE', // aka DOUBLE, 8 bytes + 0x06: 'NULL', // NULL (used for prepared statements, I think) + 0x07: 'TIMESTAMP', // aka TIMESTAMP + 0x08: 'LONGLONG', // aka BIGINT, 8 bytes + 0x09: 'INT24', // aka MEDIUMINT, 3 bytes + 0x0a: 'DATE', // aka DATE + 0x0b: 'TIME', // aka TIME + 0x0c: 'DATETIME', // aka DATETIME + 0x0d: 'YEAR', // aka YEAR, 1 byte (don't ask) + 0x0e: 'NEWDATE', // aka ? + 0x0f: 'VARCHAR', // aka VARCHAR (?) + 0x10: 'BIT', // aka BIT, 1-8 byte + 0xf5: 'JSON', + 0xf6: 'NEWDECIMAL', // aka DECIMAL + 0xf7: 'ENUM', // aka ENUM + 0xf8: 'SET', // aka SET + 0xf9: 'TINY_BLOB', // aka TINYBLOB, TINYTEXT + 0xfa: 'MEDIUM_BLOB', // aka MEDIUMBLOB, MEDIUMTEXT + 0xfb: 'LONG_BLOB', // aka LONGBLOG, LONGTEXT + 0xfc: 'BLOB', // aka BLOB, TEXT + 0xfd: 'VAR_STRING', // aka VARCHAR, VARBINARY + 0xfe: 'STRING', // aka CHAR, BINARY + 0xff: 'GEOMETRY', // aka GEOMETRY +}; + +// Manually extracted from mysql-5.5.23/include/mysql_com.h +// some more info here: http://dev.mysql.com/doc/refman/5.5/en/c-api-prepared-statement-type-codes.html +module.exports.DECIMAL = 0x00; // aka DECIMAL (http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html) +module.exports.TINY = 0x01; // aka TINYINT, 1 byte +module.exports.SHORT = 0x02; // aka SMALLINT, 2 bytes +module.exports.LONG = 0x03; // aka INT, 4 bytes +module.exports.FLOAT = 0x04; // aka FLOAT, 4-8 bytes +module.exports.DOUBLE = 0x05; // aka DOUBLE, 8 bytes +module.exports.NULL = 0x06; // NULL (used for prepared statements, I think) +module.exports.TIMESTAMP = 0x07; // aka TIMESTAMP +module.exports.LONGLONG = 0x08; // aka BIGINT, 8 bytes +module.exports.INT24 = 0x09; // aka MEDIUMINT, 3 bytes +module.exports.DATE = 0x0a; // aka DATE +module.exports.TIME = 0x0b; // aka TIME +module.exports.DATETIME = 0x0c; // aka DATETIME +module.exports.YEAR = 0x0d; // aka YEAR, 1 byte (don't ask) +module.exports.NEWDATE = 0x0e; // aka ? +module.exports.VARCHAR = 0x0f; // aka VARCHAR (?) +module.exports.BIT = 0x10; // aka BIT, 1-8 byte +module.exports.VECTOR = 0xf2; +module.exports.JSON = 0xf5; +module.exports.NEWDECIMAL = 0xf6; // aka DECIMAL +module.exports.ENUM = 0xf7; // aka ENUM +module.exports.SET = 0xf8; // aka SET +module.exports.TINY_BLOB = 0xf9; // aka TINYBLOB, TINYTEXT +module.exports.MEDIUM_BLOB = 0xfa; // aka MEDIUMBLOB, MEDIUMTEXT +module.exports.LONG_BLOB = 0xfb; // aka LONGBLOG, LONGTEXT +module.exports.BLOB = 0xfc; // aka BLOB, TEXT +module.exports.VAR_STRING = 0xfd; // aka VARCHAR, VARBINARY +module.exports.STRING = 0xfe; // aka CHAR, BINARY +module.exports.GEOMETRY = 0xff; // aka GEOMETRY diff --git a/node_modules/mysql2/lib/create_connection.js b/node_modules/mysql2/lib/create_connection.js new file mode 100644 index 0000000..d39618f --- /dev/null +++ b/node_modules/mysql2/lib/create_connection.js @@ -0,0 +1,10 @@ +'use strict'; + +const Connection = require('./connection.js'); +const ConnectionConfig = require('./connection_config.js'); + +function createConnection(opts) { + return new Connection({ config: new ConnectionConfig(opts) }); +} + +module.exports = createConnection; diff --git a/node_modules/mysql2/lib/create_pool.js b/node_modules/mysql2/lib/create_pool.js new file mode 100644 index 0000000..ad19d77 --- /dev/null +++ b/node_modules/mysql2/lib/create_pool.js @@ -0,0 +1,10 @@ +'use strict'; + +const Pool = require('./pool.js'); +const PoolConfig = require('./pool_config.js'); + +function createPool(config) { + return new Pool({ config: new PoolConfig(config) }); +} + +module.exports = createPool; diff --git a/node_modules/mysql2/lib/create_pool_cluster.js b/node_modules/mysql2/lib/create_pool_cluster.js new file mode 100644 index 0000000..4ded78b --- /dev/null +++ b/node_modules/mysql2/lib/create_pool_cluster.js @@ -0,0 +1,9 @@ +'use strict'; + +const PoolCluster = require('./pool_cluster.js'); + +function createPoolCluster(config) { + return new PoolCluster(config); +} + +module.exports = createPoolCluster; diff --git a/node_modules/mysql2/lib/helpers.js b/node_modules/mysql2/lib/helpers.js new file mode 100644 index 0000000..672bb5e --- /dev/null +++ b/node_modules/mysql2/lib/helpers.js @@ -0,0 +1,86 @@ +'use strict'; + +/* + + this seems to be not only shorter, but faster than + string.replace(/\\/g, '\\\\'). + replace(/\u0008/g, '\\b'). + replace(/\t/g, '\\t'). + replace(/\n/g, '\\n'). + replace(/\f/g, '\\f'). + replace(/\r/g, '\\r'). + replace(/'/g, '\\\''). + replace(/"/g, '\\"'); + or string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + see http://jsperf.com/string-escape-regexp-vs-json-stringify + */ +function srcEscape(str) { + return JSON.stringify({ + [str]: 1, + }).slice(1, -3); +} + +exports.srcEscape = srcEscape; + +let highlightFn; +let cardinalRecommended = false; +try { + // the purpose of this is to prevent projects using Webpack from displaying a warning during runtime if cardinal is not a dependency + const REQUIRE_TERMINATOR = ''; + highlightFn = require(`cardinal${REQUIRE_TERMINATOR}`).highlight; +} catch (err) { + highlightFn = (text) => { + if (!cardinalRecommended) { + // eslint-disable-next-line no-console + console.log('For nicer debug output consider install cardinal@^2.0.0'); + cardinalRecommended = true; + } + return text; + }; +} + +/** + * Prints debug message with code frame, will try to use `cardinal` if available. + */ +function printDebugWithCode(msg, code) { + // eslint-disable-next-line no-console + console.log(`\n\n${msg}:\n`); + // eslint-disable-next-line no-console + console.log(`${highlightFn(code)}\n`); +} + +exports.printDebugWithCode = printDebugWithCode; + +/** + * checks whether the `type` is in the `list` + */ +function typeMatch(type, list, Types) { + if (Array.isArray(list)) { + return list.some((t) => type === Types[t]); + } + + return !!list; +} + +exports.typeMatch = typeMatch; + +const privateObjectProps = new Set([ + '__defineGetter__', + '__defineSetter__', + '__lookupGetter__', + '__lookupSetter__', + '__proto__', +]); + +exports.privateObjectProps = privateObjectProps; + +const fieldEscape = (field, isEval = true) => { + if (privateObjectProps.has(field)) { + throw new Error( + `The field name (${field}) can't be the same as an object's private property.` + ); + } + + return isEval ? srcEscape(field) : field; +}; +exports.fieldEscape = fieldEscape; diff --git a/node_modules/mysql2/lib/packet_parser.js b/node_modules/mysql2/lib/packet_parser.js new file mode 100644 index 0000000..989510c --- /dev/null +++ b/node_modules/mysql2/lib/packet_parser.js @@ -0,0 +1,195 @@ +'use strict'; + +const Packet = require('./packets/packet.js'); + +const MAX_PACKET_LENGTH = 16777215; + +function readPacketLength(b, off) { + const b0 = b[off]; + const b1 = b[off + 1]; + const b2 = b[off + 2]; + if (b1 + b2 === 0) { + return b0; + } + return b0 + (b1 << 8) + (b2 << 16); +} + +class PacketParser { + constructor(onPacket, packetHeaderLength) { + // 4 for normal packets, 7 for comprssed protocol packets + if (typeof packetHeaderLength === 'undefined') { + packetHeaderLength = 4; + } + // array of last payload chunks + // only used when current payload is not complete + this.buffer = []; + // total length of chunks on buffer + this.bufferLength = 0; + this.packetHeaderLength = packetHeaderLength; + // incomplete header state: number of header bytes received + this.headerLen = 0; + // expected payload length + this.length = 0; + this.largePacketParts = []; + this.firstPacketSequenceId = 0; + this.onPacket = onPacket; + this.execute = PacketParser.prototype.executeStart; + this._flushLargePacket = + packetHeaderLength === 7 + ? this._flushLargePacket7 + : this._flushLargePacket4; + } + + _flushLargePacket4() { + const numPackets = this.largePacketParts.length; + this.largePacketParts.unshift(Buffer.from([0, 0, 0, 0])); // insert header + const body = Buffer.concat(this.largePacketParts); + const packet = new Packet(this.firstPacketSequenceId, body, 0, body.length); + this.largePacketParts.length = 0; + packet.numPackets = numPackets; + this.onPacket(packet); + } + + _flushLargePacket7() { + const numPackets = this.largePacketParts.length; + this.largePacketParts.unshift(Buffer.from([0, 0, 0, 0, 0, 0, 0])); // insert header + const body = Buffer.concat(this.largePacketParts); + this.largePacketParts.length = 0; + const packet = new Packet(this.firstPacketSequenceId, body, 0, body.length); + packet.numPackets = numPackets; + this.onPacket(packet); + } + + executeStart(chunk) { + let start = 0; + const end = chunk.length; + while (end - start >= 3) { + this.length = readPacketLength(chunk, start); + if (end - start >= this.length + this.packetHeaderLength) { + // at least one full packet + const sequenceId = chunk[start + 3]; + if ( + this.length < MAX_PACKET_LENGTH && + this.largePacketParts.length === 0 + ) { + this.onPacket( + new Packet( + sequenceId, + chunk, + start, + start + this.packetHeaderLength + this.length + ) + ); + } else { + // first large packet - remember it's id + if (this.largePacketParts.length === 0) { + this.firstPacketSequenceId = sequenceId; + } + this.largePacketParts.push( + chunk.slice( + start + this.packetHeaderLength, + start + this.packetHeaderLength + this.length + ) + ); + if (this.length < MAX_PACKET_LENGTH) { + this._flushLargePacket(); + } + } + start += this.packetHeaderLength + this.length; + } else { + // payload is incomplete + this.buffer = [chunk.slice(start + 3, end)]; + this.bufferLength = end - start - 3; + this.execute = PacketParser.prototype.executePayload; + return; + } + } + if (end - start > 0) { + // there is start of length header, but it's not full 3 bytes + this.headerLen = end - start; // 1 or 2 bytes + this.length = chunk[start]; + if (this.headerLen === 2) { + this.length = chunk[start] + (chunk[start + 1] << 8); + this.execute = PacketParser.prototype.executeHeader3; + } else { + this.execute = PacketParser.prototype.executeHeader2; + } + } + } + + executePayload(chunk) { + let start = 0; + const end = chunk.length; + const remainingPayload = + this.length - this.bufferLength + this.packetHeaderLength - 3; + if (end - start >= remainingPayload) { + // last chunk for payload + const payload = Buffer.allocUnsafe(this.length + this.packetHeaderLength); + let offset = 3; + for (let i = 0; i < this.buffer.length; ++i) { + this.buffer[i].copy(payload, offset); + offset += this.buffer[i].length; + } + chunk.copy(payload, offset, start, start + remainingPayload); + const sequenceId = payload[3]; + if ( + this.length < MAX_PACKET_LENGTH && + this.largePacketParts.length === 0 + ) { + this.onPacket( + new Packet( + sequenceId, + payload, + 0, + this.length + this.packetHeaderLength + ) + ); + } else { + // first large packet - remember it's id + if (this.largePacketParts.length === 0) { + this.firstPacketSequenceId = sequenceId; + } + this.largePacketParts.push( + payload.slice( + this.packetHeaderLength, + this.packetHeaderLength + this.length + ) + ); + if (this.length < MAX_PACKET_LENGTH) { + this._flushLargePacket(); + } + } + this.buffer = []; + this.bufferLength = 0; + this.execute = PacketParser.prototype.executeStart; + start += remainingPayload; + if (end - start > 0) { + return this.execute(chunk.slice(start, end)); + } + } else { + this.buffer.push(chunk); + this.bufferLength += chunk.length; + } + return null; + } + + executeHeader2(chunk) { + this.length += chunk[0] << 8; + if (chunk.length > 1) { + this.length += chunk[1] << 16; + this.execute = PacketParser.prototype.executePayload; + return this.executePayload(chunk.slice(2)); + } + this.execute = PacketParser.prototype.executeHeader3; + + return null; + } + + executeHeader3(chunk) { + this.length += chunk[0] << 16; + this.execute = PacketParser.prototype.executePayload; + return this.executePayload(chunk.slice(1)); + } +} + +module.exports = PacketParser; diff --git a/node_modules/mysql2/lib/packets/auth_next_factor.js b/node_modules/mysql2/lib/packets/auth_next_factor.js new file mode 100644 index 0000000..ba9fbd8 --- /dev/null +++ b/node_modules/mysql2/lib/packets/auth_next_factor.js @@ -0,0 +1,35 @@ +// Copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +const Packet = require('../packets/packet'); + +class AuthNextFactor { + constructor(opts) { + this.pluginName = opts.pluginName; + this.pluginData = opts.pluginData; + } + + toPacket(encoding) { + const length = 6 + this.pluginName.length + this.pluginData.length; + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeInt8(0x02); + packet.writeNullTerminatedString(this.pluginName, encoding); + packet.writeBuffer(this.pluginData); + return packet; + } + + static fromPacket(packet, encoding) { + packet.readInt8(); // marker + const name = packet.readNullTerminatedString(encoding); + const data = packet.readBuffer(); + return new AuthNextFactor({ + pluginName: name, + pluginData: data, + }); + } +} + +module.exports = AuthNextFactor; diff --git a/node_modules/mysql2/lib/packets/auth_switch_request.js b/node_modules/mysql2/lib/packets/auth_switch_request.js new file mode 100644 index 0000000..7c3ed4d --- /dev/null +++ b/node_modules/mysql2/lib/packets/auth_switch_request.js @@ -0,0 +1,38 @@ +'use strict'; + +// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest + +const Packet = require('../packets/packet'); + +class AuthSwitchRequest { + constructor(opts) { + this.pluginName = opts.pluginName; + this.pluginData = opts.pluginData; + } + + toPacket() { + const length = 6 + this.pluginName.length + this.pluginData.length; + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeInt8(0xfe); + // TODO: use server encoding + packet.writeNullTerminatedString(this.pluginName, 'cesu8'); + packet.writeBuffer(this.pluginData); + return packet; + } + + static fromPacket(packet) { + packet.readInt8(); // marker + // assert marker == 0xfe? + // TODO: use server encoding + const name = packet.readNullTerminatedString('cesu8'); + const data = packet.readBuffer(); + return new AuthSwitchRequest({ + pluginName: name, + pluginData: data, + }); + } +} + +module.exports = AuthSwitchRequest; diff --git a/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js b/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js new file mode 100644 index 0000000..7294d08 --- /dev/null +++ b/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js @@ -0,0 +1,33 @@ +'use strict'; + +// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest + +const Packet = require('../packets/packet'); + +class AuthSwitchRequestMoreData { + constructor(data) { + this.data = data; + } + + toPacket() { + const length = 5 + this.data.length; + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeInt8(0x01); + packet.writeBuffer(this.data); + return packet; + } + + static fromPacket(packet) { + packet.readInt8(); // marker + const data = packet.readBuffer(); + return new AuthSwitchRequestMoreData(data); + } + + static verifyMarker(packet) { + return packet.peekByte() === 0x01; + } +} + +module.exports = AuthSwitchRequestMoreData; diff --git a/node_modules/mysql2/lib/packets/auth_switch_response.js b/node_modules/mysql2/lib/packets/auth_switch_response.js new file mode 100644 index 0000000..2a821a0 --- /dev/null +++ b/node_modules/mysql2/lib/packets/auth_switch_response.js @@ -0,0 +1,30 @@ +'use strict'; + +// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchRequest + +const Packet = require('../packets/packet'); + +class AuthSwitchResponse { + constructor(data) { + if (!Buffer.isBuffer(data)) { + data = Buffer.from(data); + } + this.data = data; + } + + toPacket() { + const length = 4 + this.data.length; + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeBuffer(this.data); + return packet; + } + + static fromPacket(packet) { + const data = packet.readBuffer(); + return new AuthSwitchResponse(data); + } +} + +module.exports = AuthSwitchResponse; diff --git a/node_modules/mysql2/lib/packets/binary_row.js b/node_modules/mysql2/lib/packets/binary_row.js new file mode 100644 index 0000000..d374b8d --- /dev/null +++ b/node_modules/mysql2/lib/packets/binary_row.js @@ -0,0 +1,95 @@ +'use strict'; + +const Types = require('../constants/types'); +const Packet = require('../packets/packet'); + +const binaryReader = new Array(256); + +class BinaryRow { + constructor(columns) { + this.columns = columns || []; + } + + static toPacket(columns, encoding) { + // throw new Error('Not implemented'); + const sequenceId = 0; // TODO remove, this is calculated now in connecton + let length = 0; + columns.forEach((val) => { + if (val === null || typeof val === 'undefined') { + ++length; + return; + } + length += Packet.lengthCodedStringLength(val.toString(10), encoding); + }); + + length = length + 2; + + const buffer = Buffer.allocUnsafe(length + 4); + const packet = new Packet(sequenceId, buffer, 0, length + 4); + packet.offset = 4; + + packet.writeInt8(0); + + let bitmap = 0; + let bitValue = 1; + columns.forEach((parameter) => { + if (parameter.type === Types.NULL) { + bitmap += bitValue; + } + bitValue *= 2; + if (bitValue === 256) { + packet.writeInt8(bitmap); + bitmap = 0; + bitValue = 1; + } + }); + if (bitValue !== 1) { + packet.writeInt8(bitmap); + } + + columns.forEach((val) => { + if (val === null) { + packet.writeNull(); + return; + } + if (typeof val === 'undefined') { + packet.writeInt8(0); + return; + } + packet.writeLengthCodedString(val.toString(10), encoding); + }); + return packet; + } + + // TODO: complete list of types... + static fromPacket(fields, packet) { + const columns = new Array(fields.length); + packet.readInt8(); // TODO check it's 0 + const nullBitmapLength = Math.floor((fields.length + 7 + 2) / 8); + // TODO: read and interpret null bitmap + packet.skip(nullBitmapLength); + for (let i = 0; i < columns.length; ++i) { + columns[i] = binaryReader[fields[i].columnType].apply(packet); + } + return new BinaryRow(columns); + } +} + +// TODO: replace with constants.MYSQL_TYPE_* +binaryReader[Types.DECIMAL] = Packet.prototype.readLengthCodedString; +binaryReader[1] = Packet.prototype.readInt8; // tiny +binaryReader[2] = Packet.prototype.readInt16; // short +binaryReader[3] = Packet.prototype.readInt32; // long +binaryReader[4] = Packet.prototype.readFloat; // float +binaryReader[5] = Packet.prototype.readDouble; // double +binaryReader[6] = Packet.prototype.assertInvalid; // null, should be skipped vie null bitmap +binaryReader[7] = Packet.prototype.readTimestamp; // timestamp, http://dev.mysql.com/doc/internals/en/prepared-statements.html#packet-ProtocolBinary::MYSQL_TYPE_TIMESTAMP +binaryReader[8] = Packet.prototype.readInt64; // long long +binaryReader[9] = Packet.prototype.readInt32; // int24 +binaryReader[10] = Packet.prototype.readTimestamp; // date +binaryReader[11] = Packet.prototype.readTime; // time, http://dev.mysql.com/doc/internals/en/prepared-statements.html#packet-ProtocolBinary::MYSQL_TYPE_TIME +binaryReader[12] = Packet.prototype.readDateTime; // datetime, http://dev.mysql.com/doc/internals/en/prepared-statements.html#packet-ProtocolBinary::MYSQL_TYPE_DATETIME +binaryReader[13] = Packet.prototype.readInt16; // year +binaryReader[Types.VAR_STRING] = Packet.prototype.readLengthCodedString; // var string + +module.exports = BinaryRow; diff --git a/node_modules/mysql2/lib/packets/binlog_dump.js b/node_modules/mysql2/lib/packets/binlog_dump.js new file mode 100644 index 0000000..e014837 --- /dev/null +++ b/node_modules/mysql2/lib/packets/binlog_dump.js @@ -0,0 +1,33 @@ +'use strict'; + +// http://dev.mysql.com/doc/internals/en/com-binlog-dump.html#packet-COM_BINLOG_DUMP + +const Packet = require('../packets/packet'); +const CommandCodes = require('../constants/commands'); + +// TODO: add flag to constants +// 0x01 - BINLOG_DUMP_NON_BLOCK +// send EOF instead of blocking +class BinlogDump { + constructor(opts) { + this.binlogPos = opts.binlogPos || 0; + this.serverId = opts.serverId || 0; + this.flags = opts.flags || 0; + this.filename = opts.filename || ''; + } + + toPacket() { + const length = 15 + Buffer.byteLength(this.filename, 'utf8'); // TODO: should be ascii? + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeInt8(CommandCodes.BINLOG_DUMP); + packet.writeInt32(this.binlogPos); + packet.writeInt16(this.flags); + packet.writeInt32(this.serverId); + packet.writeString(this.filename); + return packet; + } +} + +module.exports = BinlogDump; diff --git a/node_modules/mysql2/lib/packets/binlog_query_statusvars.js b/node_modules/mysql2/lib/packets/binlog_query_statusvars.js new file mode 100644 index 0000000..7338d60 --- /dev/null +++ b/node_modules/mysql2/lib/packets/binlog_query_statusvars.js @@ -0,0 +1,115 @@ +'use strict'; + +// http://dev.mysql.com/doc/internals/en/query-event.html + +const keys = { + FLAGS2: 0, + SQL_MODE: 1, + CATALOG: 2, + AUTO_INCREMENT: 3, + CHARSET: 4, + TIME_ZONE: 5, + CATALOG_NZ: 6, + LC_TIME_NAMES: 7, + CHARSET_DATABASE: 8, + TABLE_MAP_FOR_UPDATE: 9, + MASTER_DATA_WRITTEN: 10, + INVOKERS: 11, + UPDATED_DB_NAMES: 12, + MICROSECONDS: 3, +}; + +module.exports = function parseStatusVars(buffer) { + const result = {}; + let offset = 0; + let key, length, prevOffset; + while (offset < buffer.length) { + key = buffer[offset++]; + switch (key) { + case keys.FLAGS2: + result.flags = buffer.readUInt32LE(offset); + offset += 4; + break; + case keys.SQL_MODE: + // value is 8 bytes, but all dcumented flags are in first 4 bytes + result.sqlMode = buffer.readUInt32LE(offset); + offset += 8; + break; + case keys.CATALOG: + length = buffer[offset++]; + result.catalog = buffer.toString('utf8', offset, offset + length); + offset += length + 1; // null byte after string + break; + case keys.CHARSET: + result.clientCharset = buffer.readUInt16LE(offset); + result.connectionCollation = buffer.readUInt16LE(offset + 2); + result.serverCharset = buffer.readUInt16LE(offset + 4); + offset += 6; + break; + case keys.TIME_ZONE: + length = buffer[offset++]; + result.timeZone = buffer.toString('utf8', offset, offset + length); + offset += length; // no null byte + break; + case keys.CATALOG_NZ: + length = buffer[offset++]; + result.catalogNz = buffer.toString('utf8', offset, offset + length); + offset += length; // no null byte + break; + case keys.LC_TIME_NAMES: + result.lcTimeNames = buffer.readUInt16LE(offset); + offset += 2; + break; + case keys.CHARSET_DATABASE: + result.schemaCharset = buffer.readUInt16LE(offset); + offset += 2; + break; + case keys.TABLE_MAP_FOR_UPDATE: + result.mapForUpdate1 = buffer.readUInt32LE(offset); + result.mapForUpdate2 = buffer.readUInt32LE(offset + 4); + offset += 8; + break; + case keys.MASTER_DATA_WRITTEN: + result.masterDataWritten = buffer.readUInt32LE(offset); + offset += 4; + break; + case keys.INVOKERS: + length = buffer[offset++]; + result.invokerUsername = buffer.toString( + 'utf8', + offset, + offset + length + ); + offset += length; + length = buffer[offset++]; + result.invokerHostname = buffer.toString( + 'utf8', + offset, + offset + length + ); + offset += length; + break; + case keys.UPDATED_DB_NAMES: + length = buffer[offset++]; + // length - number of null-terminated strings + result.updatedDBs = []; // we'll store them as array here + for (; length; --length) { + prevOffset = offset; + // fast forward to null terminating byte + while (buffer[offset++] && offset < buffer.length) { + // empty body, everything inside while condition + } + result.updatedDBs.push( + buffer.toString('utf8', prevOffset, offset - 1) + ); + } + break; + case keys.MICROSECONDS: + result.microseconds = + // REVIEW: INVALID UNKNOWN VARIABLE! + buffer.readInt16LE(offset) + (buffer[offset + 2] << 16); + offset += 3; + } + } + return result; +}; diff --git a/node_modules/mysql2/lib/packets/change_user.js b/node_modules/mysql2/lib/packets/change_user.js new file mode 100644 index 0000000..242145e --- /dev/null +++ b/node_modules/mysql2/lib/packets/change_user.js @@ -0,0 +1,97 @@ +'use strict'; + +const CommandCode = require('../constants/commands.js'); +const ClientConstants = require('../constants/client.js'); +const Packet = require('../packets/packet.js'); +const auth41 = require('../auth_41.js'); +const CharsetToEncoding = require('../constants/charset_encodings.js'); + +// https://dev.mysql.com/doc/internals/en/com-change-user.html#packet-COM_CHANGE_USER +class ChangeUser { + constructor(opts) { + this.flags = opts.flags; + this.user = opts.user || ''; + this.database = opts.database || ''; + this.password = opts.password || ''; + this.passwordSha1 = opts.passwordSha1; + this.authPluginData1 = opts.authPluginData1; + this.authPluginData2 = opts.authPluginData2; + this.connectAttributes = opts.connectAttrinutes || {}; + let authToken; + if (this.passwordSha1) { + authToken = auth41.calculateTokenFromPasswordSha( + this.passwordSha1, + this.authPluginData1, + this.authPluginData2 + ); + } else { + authToken = auth41.calculateToken( + this.password, + this.authPluginData1, + this.authPluginData2 + ); + } + this.authToken = authToken; + this.charsetNumber = opts.charsetNumber; + } + + // TODO + // ChangeUser.fromPacket = function(packet) + // }; + serializeToBuffer(buffer) { + const isSet = (flag) => this.flags & ClientConstants[flag]; + const packet = new Packet(0, buffer, 0, buffer.length); + packet.offset = 4; + const encoding = CharsetToEncoding[this.charsetNumber]; + packet.writeInt8(CommandCode.CHANGE_USER); + packet.writeNullTerminatedString(this.user, encoding); + if (isSet('SECURE_CONNECTION')) { + packet.writeInt8(this.authToken.length); + packet.writeBuffer(this.authToken); + } else { + packet.writeBuffer(this.authToken); + packet.writeInt8(0); + } + packet.writeNullTerminatedString(this.database, encoding); + packet.writeInt16(this.charsetNumber); + if (isSet('PLUGIN_AUTH')) { + // TODO: read this from parameters + packet.writeNullTerminatedString('mysql_native_password', 'latin1'); + } + if (isSet('CONNECT_ATTRS')) { + const connectAttributes = this.connectAttributes; + const attrNames = Object.keys(connectAttributes); + let keysLength = 0; + for (let k = 0; k < attrNames.length; ++k) { + keysLength += Packet.lengthCodedStringLength(attrNames[k], encoding); + keysLength += Packet.lengthCodedStringLength( + connectAttributes[attrNames[k]], + encoding + ); + } + packet.writeLengthCodedNumber(keysLength); + for (let k = 0; k < attrNames.length; ++k) { + packet.writeLengthCodedString(attrNames[k], encoding); + packet.writeLengthCodedString( + connectAttributes[attrNames[k]], + encoding + ); + } + } + return packet; + } + + toPacket() { + if (typeof this.user !== 'string') { + throw new Error('"user" connection config property must be a string'); + } + if (typeof this.database !== 'string') { + throw new Error('"database" connection config property must be a string'); + } + // dry run: calculate resulting packet length + const p = this.serializeToBuffer(Packet.MockBuffer()); + return this.serializeToBuffer(Buffer.allocUnsafe(p.offset)); + } +} + +module.exports = ChangeUser; diff --git a/node_modules/mysql2/lib/packets/close_statement.js b/node_modules/mysql2/lib/packets/close_statement.js new file mode 100644 index 0000000..d8be98d --- /dev/null +++ b/node_modules/mysql2/lib/packets/close_statement.js @@ -0,0 +1,21 @@ +'use strict'; + +const Packet = require('../packets/packet'); +const CommandCodes = require('../constants/commands'); + +class CloseStatement { + constructor(id) { + this.id = id; + } + + // note: no response sent back + toPacket() { + const packet = new Packet(0, Buffer.allocUnsafe(9), 0, 9); + packet.offset = 4; + packet.writeInt8(CommandCodes.STMT_CLOSE); + packet.writeInt32(this.id); + return packet; + } +} + +module.exports = CloseStatement; diff --git a/node_modules/mysql2/lib/packets/column_definition.js b/node_modules/mysql2/lib/packets/column_definition.js new file mode 100644 index 0000000..7cd3c27 --- /dev/null +++ b/node_modules/mysql2/lib/packets/column_definition.js @@ -0,0 +1,291 @@ +'use strict'; + +const Packet = require('../packets/packet'); +const StringParser = require('../parsers/string'); +const CharsetToEncoding = require('../constants/charset_encodings.js'); + +const fields = ['catalog', 'schema', 'table', 'orgTable', 'name', 'orgName']; + +// creating JS string is relatively expensive (compared to +// reading few bytes from buffer) because all string properties +// except for name are unlikely to be used we postpone +// string conversion until property access +// +// TODO: watch for integration benchmarks (one with real network buffer) +// there could be bad side effect as keeping reference to a buffer makes it +// sit in the memory longer (usually until final .query() callback) +// Latest v8 perform much better in regard to bufferer -> string conversion, +// at some point of time this optimisation might become unnecessary +// see https://github.com/sidorares/node-mysql2/pull/137 +// +class ColumnDefinition { + constructor(packet, clientEncoding) { + this._buf = packet.buffer; + this._clientEncoding = clientEncoding; + this._catalogLength = packet.readLengthCodedNumber(); + this._catalogStart = packet.offset; + packet.offset += this._catalogLength; + this._schemaLength = packet.readLengthCodedNumber(); + this._schemaStart = packet.offset; + packet.offset += this._schemaLength; + this._tableLength = packet.readLengthCodedNumber(); + this._tableStart = packet.offset; + packet.offset += this._tableLength; + this._orgTableLength = packet.readLengthCodedNumber(); + this._orgTableStart = packet.offset; + packet.offset += this._orgTableLength; + // name is always used, don't make it lazy + const _nameLength = packet.readLengthCodedNumber(); + const _nameStart = packet.offset; + packet.offset += _nameLength; + this._orgNameLength = packet.readLengthCodedNumber(); + this._orgNameStart = packet.offset; + packet.offset += this._orgNameLength; + packet.skip(1); // length of the following fields (always 0x0c) + this.characterSet = packet.readInt16(); + this.encoding = CharsetToEncoding[this.characterSet]; + this.name = StringParser.decode( + this._buf, + this.encoding === 'binary' ? this._clientEncoding : this.encoding, + _nameStart, + _nameStart + _nameLength + ); + this.columnLength = packet.readInt32(); + this.columnType = packet.readInt8(); + this.type = this.columnType; + this.flags = packet.readInt16(); + this.decimals = packet.readInt8(); + } + + inspect() { + return { + catalog: this.catalog, + schema: this.schema, + name: this.name, + orgName: this.orgName, + table: this.table, + orgTable: this.orgTable, + characterSet: this.characterSet, + encoding: this.encoding, + columnLength: this.columnLength, + type: this.columnType, + flags: this.flags, + decimals: this.decimals, + }; + } + + [Symbol.for('nodejs.util.inspect.custom')](depth, inspectOptions, inspect) { + const Types = require('../constants/types.js'); + const typeNames = []; + for (const t in Types) { + typeNames[Types[t]] = t; + } + const fiedFlags = require('../constants/field_flags.js'); + const flagNames = []; + // TODO: respect inspectOptions.showHidden + //const inspectFlags = inspectOptions.showHidden ? this.flags : this.flags & ~fiedFlags.PRI_KEY; + const inspectFlags = this.flags; + for (const f in fiedFlags) { + if (inspectFlags & fiedFlags[f]) { + if (f === 'PRI_KEY') { + flagNames.push('PRIMARY KEY'); + } else if (f === 'NOT_NULL') { + flagNames.push('NOT NULL'); + } else if (f === 'BINARY') { + // ignore flag for now + } else if (f === 'MULTIPLE_KEY') { + // not sure if that should be part of inspection. + // in the schema usually this is part of index definition + // example: UNIQUE KEY `my_uniq_id` (`id_box_elements`,`id_router`) + // note that only first column has MULTIPLE_KEY flag set in this case + // so there is no good way of knowing that this is part of index just + // by looking at indifidual field flags + } else if (f === 'NO_DEFAULT_VALUE') { + // almost the same as NOT_NULL? + } else if (f === 'BLOB') { + // included in the type + } else if (f === 'UNSIGNED') { + // this should be first after type + } else if (f === 'TIMESTAMP') { + // timestamp flag is redundant for inspection - already included in type + } else if (f === 'ON_UPDATE_NOW') { + flagNames.push('ON UPDATE CURRENT_TIMESTAMP'); + } else { + flagNames.push(f); + } + } + } + + if (depth > 1) { + return inspect({ + ...this.inspect(), + typeName: typeNames[this.columnType], + flags: flagNames, + }); + } + + const isUnsigned = this.flags & fiedFlags.UNSIGNED; + + let typeName = typeNames[this.columnType]; + if (typeName === 'BLOB') { + // TODO: check for non-utf8mb4 encoding + if (this.columnLength === 4294967295) { + typeName = 'LONGTEXT'; + } else if (this.columnLength === 67108860) { + typeName = 'MEDIUMTEXT'; + } else if (this.columnLength === 262140) { + typeName = 'TEXT'; + } else if (this.columnLength === 1020) { + // 255*4 + typeName = 'TINYTEXT'; + } else { + typeName = `BLOB(${this.columnLength})`; + } + } else if (typeName === 'VAR_STRING') { + // TODO: check for non-utf8mb4 encoding + typeName = `VARCHAR(${Math.ceil(this.columnLength / 4)})`; + } else if (typeName === 'TINY') { + if ( + (this.columnLength === 3 && isUnsigned) || + (this.columnLength === 4 && !isUnsigned) + ) { + typeName = 'TINYINT'; + } else { + typeName = `TINYINT(${this.columnLength})`; + } + } else if (typeName === 'LONGLONG') { + if (this.columnLength === 20) { + typeName = 'BIGINT'; + } else { + typeName = `BIGINT(${this.columnLength})`; + } + } else if (typeName === 'SHORT') { + if (isUnsigned && this.columnLength === 5) { + typeName = 'SMALLINT'; + } else if (!isUnsigned && this.columnLength === 6) { + typeName = 'SMALLINT'; + } else { + typeName = `SMALLINT(${this.columnLength})`; + } + } else if (typeName === 'LONG') { + if (isUnsigned && this.columnLength === 10) { + typeName = 'INT'; + } else if (!isUnsigned && this.columnLength === 11) { + typeName = 'INT'; + } else { + typeName = `INT(${this.columnLength})`; + } + } else if (typeName === 'INT24') { + if (isUnsigned && this.columnLength === 8) { + typeName = 'MEDIUMINT'; + } else if (!isUnsigned && this.columnLength === 9) { + typeName = 'MEDIUMINT'; + } else { + typeName = `MEDIUMINT(${this.columnLength})`; + } + } else if (typeName === 'DOUBLE') { + // DOUBLE without modifiers is reported as DOUBLE(22, 31) + if (this.columnLength === 22 && this.decimals === 31) { + typeName = 'DOUBLE'; + } else { + typeName = `DOUBLE(${this.columnLength},${this.decimals})`; + } + } else if (typeName === 'FLOAT') { + // FLOAT without modifiers is reported as FLOAT(12, 31) + if (this.columnLength === 12 && this.decimals === 31) { + typeName = 'FLOAT'; + } else { + typeName = `FLOAT(${this.columnLength},${this.decimals})`; + } + } else if (typeName === 'NEWDECIMAL') { + if (this.columnLength === 11 && this.decimals === 0) { + typeName = 'DECIMAL'; + } else if (this.decimals === 0) { + // not sure why, but DECIMAL(13) is reported as DECIMAL(14, 0) + // and DECIMAL(13, 9) is reported as NEWDECIMAL(15, 9) + if (isUnsigned) { + typeName = `DECIMAL(${this.columnLength})`; + } else { + typeName = `DECIMAL(${this.columnLength - 1})`; + } + } else { + typeName = `DECIMAL(${this.columnLength - 2},${this.decimals})`; + } + } else { + typeName = `${typeNames[this.columnType]}(${this.columnLength})`; + } + + if (isUnsigned) { + typeName += ' UNSIGNED'; + } + + // TODO respect colors option + return `\`${this.name}\` ${[typeName, ...flagNames].join(' ')}`; + } + + static toPacket(column, sequenceId) { + let length = 17; // = 4 padding + 1 + 12 for the rest + fields.forEach((field) => { + length += Packet.lengthCodedStringLength( + column[field], + CharsetToEncoding[column.characterSet] + ); + }); + const buffer = Buffer.allocUnsafe(length); + + const packet = new Packet(sequenceId, buffer, 0, length); + function writeField(name) { + packet.writeLengthCodedString( + column[name], + CharsetToEncoding[column.characterSet] + ); + } + packet.offset = 4; + fields.forEach(writeField); + packet.writeInt8(0x0c); + packet.writeInt16(column.characterSet); + packet.writeInt32(column.columnLength); + packet.writeInt8(column.columnType); + packet.writeInt16(column.flags); + packet.writeInt8(column.decimals); + packet.writeInt16(0); // filler + return packet; + } + + // node-mysql compatibility: alias "db" to "schema" + get db() { + return this.schema; + } +} + +const addString = function (name) { + Object.defineProperty(ColumnDefinition.prototype, name, { + get: function () { + const start = this[`_${name}Start`]; + const end = start + this[`_${name}Length`]; + const val = StringParser.decode( + this._buf, + this.encoding === 'binary' ? this._clientEncoding : this.encoding, + start, + end + ); + + Object.defineProperty(this, name, { + value: val, + writable: false, + configurable: false, + enumerable: false, + }); + + return val; + }, + }); +}; + +addString('catalog'); +addString('schema'); +addString('table'); +addString('orgTable'); +addString('orgName'); + +module.exports = ColumnDefinition; diff --git a/node_modules/mysql2/lib/packets/execute.js b/node_modules/mysql2/lib/packets/execute.js new file mode 100644 index 0000000..ffbbc91 --- /dev/null +++ b/node_modules/mysql2/lib/packets/execute.js @@ -0,0 +1,214 @@ +'use strict'; + +const CursorType = require('../constants/cursor'); +const CommandCodes = require('../constants/commands'); +const Types = require('../constants/types'); +const Packet = require('../packets/packet'); +const CharsetToEncoding = require('../constants/charset_encodings.js'); + +function isJSON(value) { + return ( + Array.isArray(value) || + value.constructor === Object || + (typeof value.toJSON === 'function' && !Buffer.isBuffer(value)) + ); +} + +/** + * Converts a value to an object describing type, String/Buffer representation and length + * @param {*} value + */ +function toParameter(value, encoding, timezone) { + let type = Types.VAR_STRING; + let length; + let writer = function (value) { + // eslint-disable-next-line no-invalid-this + return Packet.prototype.writeLengthCodedString.call(this, value, encoding); + }; + if (value !== null) { + switch (typeof value) { + case 'undefined': + throw new TypeError('Bind parameters must not contain undefined'); + + case 'number': + type = Types.DOUBLE; + length = 8; + writer = Packet.prototype.writeDouble; + break; + + case 'boolean': + value = value | 0; + type = Types.TINY; + length = 1; + writer = Packet.prototype.writeInt8; + break; + + case 'object': + if (Object.prototype.toString.call(value) === '[object Date]') { + type = Types.DATETIME; + length = 12; + writer = function (value) { + // eslint-disable-next-line no-invalid-this + return Packet.prototype.writeDate.call(this, value, timezone); + }; + } else if (isJSON(value)) { + value = JSON.stringify(value); + type = Types.JSON; + } else if (Buffer.isBuffer(value)) { + length = Packet.lengthCodedNumberLength(value.length) + value.length; + writer = Packet.prototype.writeLengthCodedBuffer; + } + break; + + default: + value = value.toString(); + } + } else { + value = ''; + type = Types.NULL; + } + if (!length) { + length = Packet.lengthCodedStringLength(value, encoding); + } + return { value, type, length, writer }; +} + +class Execute { + constructor(id, parameters, charsetNumber, timezone) { + this.id = id; + this.parameters = parameters; + this.encoding = CharsetToEncoding[charsetNumber]; + this.timezone = timezone; + } + + static fromPacket(packet, encoding) { + const stmtId = packet.readInt32(); + const flags = packet.readInt8(); + const iterationCount = packet.readInt32(); + + let i = packet.offset; + while (i < packet.end - 1) { + if ( + (packet.buffer[i + 1] === Types.VAR_STRING || + packet.buffer[i + 1] === Types.NULL || + packet.buffer[i + 1] === Types.DOUBLE || + packet.buffer[i + 1] === Types.TINY || + packet.buffer[i + 1] === Types.DATETIME || + packet.buffer[i + 1] === Types.JSON) && + packet.buffer[i] === 1 && + packet.buffer[i + 2] === 0 + ) { + break; + } else { + packet.readInt8(); + } + i++; + } + + const types = []; + + for (let i = packet.offset + 1; i < packet.end - 1; i++) { + if ( + (packet.buffer[i] === Types.VAR_STRING || + packet.buffer[i] === Types.NULL || + packet.buffer[i] === Types.DOUBLE || + packet.buffer[i] === Types.TINY || + packet.buffer[i] === Types.DATETIME || + packet.buffer[i] === Types.JSON) && + packet.buffer[i + 1] === 0 + ) { + types.push(packet.buffer[i]); + packet.skip(2); + } + } + + packet.skip(1); + + const values = []; + for (let i = 0; i < types.length; i++) { + if (types[i] === Types.VAR_STRING) { + values.push(packet.readLengthCodedString(encoding)); + } else if (types[i] === Types.DOUBLE) { + values.push(packet.readDouble()); + } else if (types[i] === Types.TINY) { + values.push(packet.readInt8()); + } else if (types[i] === Types.DATETIME) { + values.push(packet.readDateTime()); + } else if (types[i] === Types.JSON) { + values.push(JSON.parse(packet.readLengthCodedString(encoding))); + } + if (types[i] === Types.NULL) { + values.push(null); + } + } + + return { stmtId, flags, iterationCount, values }; + } + + toPacket() { + // TODO: don't try to calculate packet length in advance, allocate some big buffer in advance (header + 256 bytes?) + // and copy + reallocate if not enough + // 0 + 4 - length, seqId + // 4 + 1 - COM_EXECUTE + // 5 + 4 - stmtId + // 9 + 1 - flags + // 10 + 4 - iteration-count (always 1) + let length = 14; + let parameters; + if (this.parameters && this.parameters.length > 0) { + length += Math.floor((this.parameters.length + 7) / 8); + length += 1; // new-params-bound-flag + length += 2 * this.parameters.length; // type byte for each parameter if new-params-bound-flag is set + parameters = this.parameters.map((value) => + toParameter(value, this.encoding, this.timezone) + ); + length += parameters.reduce( + (accumulator, parameter) => accumulator + parameter.length, + 0 + ); + } + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeInt8(CommandCodes.STMT_EXECUTE); + packet.writeInt32(this.id); + packet.writeInt8(CursorType.NO_CURSOR); // flags + packet.writeInt32(1); // iteration-count, always 1 + if (parameters) { + let bitmap = 0; + let bitValue = 1; + parameters.forEach((parameter) => { + if (parameter.type === Types.NULL) { + bitmap += bitValue; + } + bitValue *= 2; + if (bitValue === 256) { + packet.writeInt8(bitmap); + bitmap = 0; + bitValue = 1; + } + }); + if (bitValue !== 1) { + packet.writeInt8(bitmap); + } + // TODO: explain meaning of the flag + // afaik, if set n*2 bytes with type of parameter are sent before parameters + // if not, previous execution types are used (TODO prooflink) + packet.writeInt8(1); // new-params-bound-flag + // Write parameter types + parameters.forEach((parameter) => { + packet.writeInt8(parameter.type); // field type + packet.writeInt8(0); // parameter flag + }); + // Write parameter values + parameters.forEach((parameter) => { + if (parameter.type !== Types.NULL) { + parameter.writer.call(packet, parameter.value); + } + }); + } + return packet; + } +} + +module.exports = Execute; diff --git a/node_modules/mysql2/lib/packets/handshake.js b/node_modules/mysql2/lib/packets/handshake.js new file mode 100644 index 0000000..ee894a0 --- /dev/null +++ b/node_modules/mysql2/lib/packets/handshake.js @@ -0,0 +1,112 @@ +'use strict'; + +const Packet = require('../packets/packet'); +const ClientConstants = require('../constants/client.js'); + +// https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::Handshake + +class Handshake { + constructor(args) { + this.protocolVersion = args.protocolVersion; + this.serverVersion = args.serverVersion; + this.capabilityFlags = args.capabilityFlags; + this.connectionId = args.connectionId; + this.authPluginData1 = args.authPluginData1; + this.authPluginData2 = args.authPluginData2; + this.characterSet = args.characterSet; + this.statusFlags = args.statusFlags; + this.authPluginName = args.authPluginName; + } + + setScrambleData(cb) { + require('crypto').randomBytes(20, (err, data) => { + if (err) { + cb(err); + return; + } + this.authPluginData1 = data.slice(0, 8); + this.authPluginData2 = data.slice(8, 20); + cb(); + }); + } + + toPacket(sequenceId) { + const length = 68 + Buffer.byteLength(this.serverVersion, 'utf8'); + const buffer = Buffer.alloc(length + 4, 0); // zero fill, 10 bytes filler later needs to contain zeros + const packet = new Packet(sequenceId, buffer, 0, length + 4); + packet.offset = 4; + packet.writeInt8(this.protocolVersion); + packet.writeString(this.serverVersion, 'cesu8'); + packet.writeInt8(0); + packet.writeInt32(this.connectionId); + packet.writeBuffer(this.authPluginData1); + packet.writeInt8(0); + const capabilityFlagsBuffer = Buffer.allocUnsafe(4); + capabilityFlagsBuffer.writeUInt32LE(this.capabilityFlags, 0); + packet.writeBuffer(capabilityFlagsBuffer.slice(0, 2)); + packet.writeInt8(this.characterSet); + packet.writeInt16(this.statusFlags); + packet.writeBuffer(capabilityFlagsBuffer.slice(2, 4)); + packet.writeInt8(21); // authPluginDataLength + packet.skip(10); + packet.writeBuffer(this.authPluginData2); + packet.writeInt8(0); + packet.writeString('mysql_native_password', 'latin1'); + packet.writeInt8(0); + return packet; + } + + static fromPacket(packet) { + const args = {}; + args.protocolVersion = packet.readInt8(); + args.serverVersion = packet.readNullTerminatedString('cesu8'); + args.connectionId = packet.readInt32(); + args.authPluginData1 = packet.readBuffer(8); + packet.skip(1); + const capabilityFlagsBuffer = Buffer.allocUnsafe(4); + capabilityFlagsBuffer[0] = packet.readInt8(); + capabilityFlagsBuffer[1] = packet.readInt8(); + if (packet.haveMoreData()) { + args.characterSet = packet.readInt8(); + args.statusFlags = packet.readInt16(); + // upper 2 bytes + capabilityFlagsBuffer[2] = packet.readInt8(); + capabilityFlagsBuffer[3] = packet.readInt8(); + args.capabilityFlags = capabilityFlagsBuffer.readUInt32LE(0); + if (args.capabilityFlags & ClientConstants.PLUGIN_AUTH) { + args.authPluginDataLength = packet.readInt8(); + } else { + args.authPluginDataLength = 0; + packet.skip(1); + } + packet.skip(10); + } else { + args.capabilityFlags = capabilityFlagsBuffer.readUInt16LE(0); + } + + const isSecureConnection = + args.capabilityFlags & ClientConstants.SECURE_CONNECTION; + if (isSecureConnection) { + const authPluginDataLength = args.authPluginDataLength; + if (authPluginDataLength === 0) { + // for Secure Password Authentication + args.authPluginDataLength = 20; + args.authPluginData2 = packet.readBuffer(12); + packet.skip(1); + } else { + // length > 0 + // for Custom Auth Plugin (PLUGIN_AUTH) + const len = Math.max(13, authPluginDataLength - 8); + args.authPluginData2 = packet.readBuffer(len); + } + } + + if (args.capabilityFlags & ClientConstants.PLUGIN_AUTH) { + args.authPluginName = packet.readNullTerminatedString('ascii'); + } + + return new Handshake(args); + } +} + +module.exports = Handshake; diff --git a/node_modules/mysql2/lib/packets/handshake_response.js b/node_modules/mysql2/lib/packets/handshake_response.js new file mode 100644 index 0000000..b90f2b2 --- /dev/null +++ b/node_modules/mysql2/lib/packets/handshake_response.js @@ -0,0 +1,144 @@ +'use strict'; + +const ClientConstants = require('../constants/client.js'); +const CharsetToEncoding = require('../constants/charset_encodings.js'); +const Packet = require('../packets/packet.js'); + +const auth41 = require('../auth_41.js'); + +class HandshakeResponse { + constructor(handshake) { + this.user = handshake.user || ''; + this.database = handshake.database || ''; + this.password = handshake.password || ''; + this.passwordSha1 = handshake.passwordSha1; + this.authPluginData1 = handshake.authPluginData1; + this.authPluginData2 = handshake.authPluginData2; + this.compress = handshake.compress; + this.clientFlags = handshake.flags; + // TODO: pre-4.1 auth support + let authToken; + if (this.passwordSha1) { + authToken = auth41.calculateTokenFromPasswordSha( + this.passwordSha1, + this.authPluginData1, + this.authPluginData2 + ); + } else { + authToken = auth41.calculateToken( + this.password, + this.authPluginData1, + this.authPluginData2 + ); + } + this.authToken = authToken; + this.charsetNumber = handshake.charsetNumber; + this.encoding = CharsetToEncoding[handshake.charsetNumber]; + this.connectAttributes = handshake.connectAttributes; + } + + serializeResponse(buffer) { + const isSet = (flag) => this.clientFlags & ClientConstants[flag]; + const packet = new Packet(0, buffer, 0, buffer.length); + packet.offset = 4; + packet.writeInt32(this.clientFlags); + packet.writeInt32(0); // max packet size. todo: move to config + packet.writeInt8(this.charsetNumber); + packet.skip(23); + const encoding = this.encoding; + packet.writeNullTerminatedString(this.user, encoding); + let k; + if (isSet('PLUGIN_AUTH_LENENC_CLIENT_DATA')) { + packet.writeLengthCodedNumber(this.authToken.length); + packet.writeBuffer(this.authToken); + } else if (isSet('SECURE_CONNECTION')) { + packet.writeInt8(this.authToken.length); + packet.writeBuffer(this.authToken); + } else { + packet.writeBuffer(this.authToken); + packet.writeInt8(0); + } + if (isSet('CONNECT_WITH_DB')) { + packet.writeNullTerminatedString(this.database, encoding); + } + if (isSet('PLUGIN_AUTH')) { + // TODO: pass from config + packet.writeNullTerminatedString('mysql_native_password', 'latin1'); + } + if (isSet('CONNECT_ATTRS')) { + const connectAttributes = this.connectAttributes || {}; + const attrNames = Object.keys(connectAttributes); + let keysLength = 0; + for (k = 0; k < attrNames.length; ++k) { + keysLength += Packet.lengthCodedStringLength(attrNames[k], encoding); + keysLength += Packet.lengthCodedStringLength( + connectAttributes[attrNames[k]], + encoding + ); + } + packet.writeLengthCodedNumber(keysLength); + for (k = 0; k < attrNames.length; ++k) { + packet.writeLengthCodedString(attrNames[k], encoding); + packet.writeLengthCodedString( + connectAttributes[attrNames[k]], + encoding + ); + } + } + return packet; + } + + toPacket() { + if (typeof this.user !== 'string') { + throw new Error('"user" connection config property must be a string'); + } + if (typeof this.database !== 'string') { + throw new Error('"database" connection config property must be a string'); + } + // dry run: calculate resulting packet length + const p = this.serializeResponse(Packet.MockBuffer()); + return this.serializeResponse(Buffer.alloc(p.offset)); + } + static fromPacket(packet) { + const args = {}; + args.clientFlags = packet.readInt32(); + function isSet(flag) { + return args.clientFlags & ClientConstants[flag]; + } + args.maxPacketSize = packet.readInt32(); + args.charsetNumber = packet.readInt8(); + const encoding = CharsetToEncoding[args.charsetNumber]; + args.encoding = encoding; + packet.skip(23); + args.user = packet.readNullTerminatedString(encoding); + let authTokenLength; + if (isSet('PLUGIN_AUTH_LENENC_CLIENT_DATA')) { + authTokenLength = packet.readLengthCodedNumber(encoding); + args.authToken = packet.readBuffer(authTokenLength); + } else if (isSet('SECURE_CONNECTION')) { + authTokenLength = packet.readInt8(); + args.authToken = packet.readBuffer(authTokenLength); + } else { + args.authToken = packet.readNullTerminatedString(encoding); + } + if (isSet('CONNECT_WITH_DB')) { + args.database = packet.readNullTerminatedString(encoding); + } + if (isSet('PLUGIN_AUTH')) { + args.authPluginName = packet.readNullTerminatedString(encoding); + } + if (isSet('CONNECT_ATTRS')) { + const keysLength = packet.readLengthCodedNumber(encoding); + const keysEnd = packet.offset + keysLength; + const attrs = {}; + while (packet.offset < keysEnd) { + attrs[packet.readLengthCodedString(encoding)] = + packet.readLengthCodedString(encoding); + } + args.connectAttributes = attrs; + } + return args; + } +} + +module.exports = HandshakeResponse; diff --git a/node_modules/mysql2/lib/packets/index.js b/node_modules/mysql2/lib/packets/index.js new file mode 100644 index 0000000..0d5a0b5 --- /dev/null +++ b/node_modules/mysql2/lib/packets/index.js @@ -0,0 +1,152 @@ +// This file was modified by Oracle on June 1, 2021. +// A utility method was introduced to generate an Error instance from a +// binary server packet. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +// This file was modified by Oracle on September 21, 2021. +// The new AuthNextFactor packet is now available. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +const process = require('process'); + +const AuthNextFactor = require('./auth_next_factor'); +const AuthSwitchRequest = require('./auth_switch_request'); +const AuthSwitchRequestMoreData = require('./auth_switch_request_more_data'); +const AuthSwitchResponse = require('./auth_switch_response'); +const BinaryRow = require('./binary_row'); +const BinlogDump = require('./binlog_dump'); +const ChangeUser = require('./change_user'); +const CloseStatement = require('./close_statement'); +const ColumnDefinition = require('./column_definition'); +const Execute = require('./execute'); +const Handshake = require('./handshake'); +const HandshakeResponse = require('./handshake_response'); +const PrepareStatement = require('./prepare_statement'); +const PreparedStatementHeader = require('./prepared_statement_header'); +const Query = require('./query'); +const RegisterSlave = require('./register_slave'); +const ResultSetHeader = require('./resultset_header'); +const SSLRequest = require('./ssl_request'); +const TextRow = require('./text_row'); + +const ctorMap = { + AuthNextFactor, + AuthSwitchRequest, + AuthSwitchRequestMoreData, + AuthSwitchResponse, + BinaryRow, + BinlogDump, + ChangeUser, + CloseStatement, + ColumnDefinition, + Execute, + Handshake, + HandshakeResponse, + PrepareStatement, + PreparedStatementHeader, + Query, + RegisterSlave, + ResultSetHeader, + SSLRequest, + TextRow, +}; +Object.entries(ctorMap).forEach(([name, ctor]) => { + module.exports[name] = ctor; + // monkey-patch it to include name if debug is on + if (process.env.NODE_DEBUG) { + if (ctor.prototype.toPacket) { + const old = ctor.prototype.toPacket; + ctor.prototype.toPacket = function () { + const p = old.call(this); + p._name = name; + return p; + }; + } + } +}); + +// simple packets: +const Packet = require('./packet'); +exports.Packet = Packet; + +class OK { + static toPacket(args, encoding) { + args = args || {}; + const affectedRows = args.affectedRows || 0; + const insertId = args.insertId || 0; + const serverStatus = args.serverStatus || 0; + const warningCount = args.warningCount || 0; + const message = args.message || ''; + + let length = 9 + Packet.lengthCodedNumberLength(affectedRows); + length += Packet.lengthCodedNumberLength(insertId); + + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeInt8(0); + packet.writeLengthCodedNumber(affectedRows); + packet.writeLengthCodedNumber(insertId); + packet.writeInt16(serverStatus); + packet.writeInt16(warningCount); + packet.writeString(message, encoding); + packet._name = 'OK'; + return packet; + } +} + +exports.OK = OK; + +// warnings, statusFlags +class EOF { + static toPacket(warnings, statusFlags) { + if (typeof warnings === 'undefined') { + warnings = 0; + } + if (typeof statusFlags === 'undefined') { + statusFlags = 0; + } + const packet = new Packet(0, Buffer.allocUnsafe(9), 0, 9); + packet.offset = 4; + packet.writeInt8(0xfe); + packet.writeInt16(warnings); + packet.writeInt16(statusFlags); + packet._name = 'EOF'; + return packet; + } +} + +exports.EOF = EOF; + +class Error { + static toPacket(args, encoding) { + const length = 13 + Buffer.byteLength(args.message, 'utf8'); + const packet = new Packet(0, Buffer.allocUnsafe(length), 0, length); + packet.offset = 4; + packet.writeInt8(0xff); + packet.writeInt16(args.code); + // TODO: sql state parameter + packet.writeString('#_____', encoding); + packet.writeString(args.message, encoding); + packet._name = 'Error'; + return packet; + } + + static fromPacket(packet) { + packet.readInt8(); // marker + const code = packet.readInt16(); + packet.readString(1, 'ascii'); // sql state marker + // The SQL state of the ERR_Packet which is always 5 bytes long. + // https://dev.mysql.com/doc/dev/mysql-server/8.0.11/page_protocol_basic_dt_strings.html#sect_protocol_basic_dt_string_fix + packet.readString(5, 'ascii'); // sql state (ignore for now) + const message = packet.readNullTerminatedString('utf8'); + const error = new Error(); + error.message = message; + error.code = code; + return error; + } +} + +exports.Error = Error; diff --git a/node_modules/mysql2/lib/packets/packet.js b/node_modules/mysql2/lib/packets/packet.js new file mode 100644 index 0000000..b9e7755 --- /dev/null +++ b/node_modules/mysql2/lib/packets/packet.js @@ -0,0 +1,931 @@ +// This file was modified by Oracle on June 1, 2021. +// A comment describing some changes in the strict default SQL mode regarding +// non-standard dates was introduced. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +'use strict'; + +const ErrorCodeToName = require('../constants/errors.js'); +const NativeBuffer = require('buffer').Buffer; +const Long = require('long'); +const StringParser = require('../parsers/string.js'); +const Types = require('../constants/types.js'); +const INVALID_DATE = new Date(NaN); + +// this is nearly duplicate of previous function so generated code is not slower +// due to "if (dateStrings)" branching +const pad = '000000000000'; +function leftPad(num, value) { + const s = value.toString(); + // if we don't need to pad + if (s.length >= num) { + return s; + } + return (pad + s).slice(-num); +} + +// The whole reason parse* function below exist +// is because String creation is relatively expensive (at least with V8), and if we have +// a buffer with "12345" content ideally we would like to bypass intermediate +// "12345" string creation and directly build 12345 number out of +// data. +// In my benchmarks the difference is ~25M 8-digit numbers per second vs +// 4.5 M using Number(packet.readLengthCodedString()) +// not used when size is close to max precision as series of *10 accumulate error +// and approximate result mihgt be diffreent from (approximate as well) Number(bigNumStringValue)) +// In the futire node version if speed difference is smaller parse* functions might be removed +// don't consider them as Packet public API + +const minus = '-'.charCodeAt(0); +const plus = '+'.charCodeAt(0); + +// TODO: handle E notation +const dot = '.'.charCodeAt(0); +const exponent = 'e'.charCodeAt(0); +const exponentCapital = 'E'.charCodeAt(0); + +class Packet { + constructor(id, buffer, start, end) { + // hot path, enable checks when testing only + // if (!Buffer.isBuffer(buffer) || typeof start == 'undefined' || typeof end == 'undefined') + // throw new Error('invalid packet'); + this.sequenceId = id; + this.numPackets = 1; + this.buffer = buffer; + this.start = start; + this.offset = start + 4; + this.end = end; + } + + // ============================== + // readers + // ============================== + reset() { + this.offset = this.start + 4; + } + + length() { + return this.end - this.start; + } + + slice() { + return this.buffer.slice(this.start, this.end); + } + + dump() { + // eslint-disable-next-line no-console + console.log( + [this.buffer.asciiSlice(this.start, this.end)], + this.buffer.slice(this.start, this.end), + this.length(), + this.sequenceId + ); + } + + haveMoreData() { + return this.end > this.offset; + } + + skip(num) { + this.offset += num; + } + + readInt8() { + return this.buffer[this.offset++]; + } + + readInt16() { + this.offset += 2; + return this.buffer.readUInt16LE(this.offset - 2); + } + + readInt24() { + return this.readInt16() + (this.readInt8() << 16); + } + + readInt32() { + this.offset += 4; + return this.buffer.readUInt32LE(this.offset - 4); + } + + readSInt8() { + return this.buffer.readInt8(this.offset++); + } + + readSInt16() { + this.offset += 2; + return this.buffer.readInt16LE(this.offset - 2); + } + + readSInt32() { + this.offset += 4; + return this.buffer.readInt32LE(this.offset - 4); + } + + readInt64JSNumber() { + const word0 = this.readInt32(); + const word1 = this.readInt32(); + const l = new Long(word0, word1, true); + return l.toNumber(); + } + + readSInt64JSNumber() { + const word0 = this.readInt32(); + const word1 = this.readInt32(); + if (!(word1 & 0x80000000)) { + return word0 + 0x100000000 * word1; + } + const l = new Long(word0, word1, false); + return l.toNumber(); + } + + readInt64String() { + const word0 = this.readInt32(); + const word1 = this.readInt32(); + const res = new Long(word0, word1, true); + return res.toString(); + } + + readSInt64String() { + const word0 = this.readInt32(); + const word1 = this.readInt32(); + const res = new Long(word0, word1, false); + return res.toString(); + } + + readInt64() { + const word0 = this.readInt32(); + const word1 = this.readInt32(); + let res = new Long(word0, word1, true); + const resNumber = res.toNumber(); + const resString = res.toString(); + res = resNumber.toString() === resString ? resNumber : resString; + return res; + } + + readSInt64() { + const word0 = this.readInt32(); + const word1 = this.readInt32(); + let res = new Long(word0, word1, false); + const resNumber = res.toNumber(); + const resString = res.toString(); + res = resNumber.toString() === resString ? resNumber : resString; + return res; + } + + isEOF() { + return this.buffer[this.offset] === 0xfe && this.length() < 13; + } + + eofStatusFlags() { + return this.buffer.readInt16LE(this.offset + 3); + } + + eofWarningCount() { + return this.buffer.readInt16LE(this.offset + 1); + } + + readLengthCodedNumber(bigNumberStrings, signed) { + const byte1 = this.buffer[this.offset++]; + if (byte1 < 251) { + return byte1; + } + return this.readLengthCodedNumberExt(byte1, bigNumberStrings, signed); + } + + readLengthCodedNumberSigned(bigNumberStrings) { + return this.readLengthCodedNumber(bigNumberStrings, true); + } + + readLengthCodedNumberExt(tag, bigNumberStrings, signed) { + let word0, word1; + let res; + if (tag === 0xfb) { + return null; + } + if (tag === 0xfc) { + return this.readInt8() + (this.readInt8() << 8); + } + if (tag === 0xfd) { + return this.readInt8() + (this.readInt8() << 8) + (this.readInt8() << 16); + } + if (tag === 0xfe) { + // TODO: check version + // Up to MySQL 3.22, 0xfe was followed by a 4-byte integer. + word0 = this.readInt32(); + word1 = this.readInt32(); + if (word1 === 0) { + return word0; // don't convert to float if possible + } + if (word1 < 2097152) { + // max exact float point int, 2^52 / 2^32 + return word1 * 0x100000000 + word0; + } + res = new Long(word0, word1, !signed); // Long need unsigned + const resNumber = res.toNumber(); + const resString = res.toString(); + res = resNumber.toString() === resString ? resNumber : resString; + return bigNumberStrings ? resString : res; + } + // eslint-disable-next-line no-console + console.trace(); + throw new Error(`Should not reach here: ${tag}`); + } + + readFloat() { + const res = this.buffer.readFloatLE(this.offset); + this.offset += 4; + return res; + } + + readDouble() { + const res = this.buffer.readDoubleLE(this.offset); + this.offset += 8; + return res; + } + + readBuffer(len) { + if (typeof len === 'undefined') { + len = this.end - this.offset; + } + this.offset += len; + return this.buffer.slice(this.offset - len, this.offset); + } + + // DATE, DATETIME and TIMESTAMP + readDateTime(timezone) { + if (!timezone || timezone === 'Z' || timezone === 'local') { + const length = this.readInt8(); + if (length === 0xfb) { + return null; + } + let y = 0; + let m = 0; + let d = 0; + let H = 0; + let M = 0; + let S = 0; + let ms = 0; + if (length > 3) { + y = this.readInt16(); + m = this.readInt8(); + d = this.readInt8(); + } + if (length > 6) { + H = this.readInt8(); + M = this.readInt8(); + S = this.readInt8(); + } + if (length > 10) { + ms = this.readInt32() / 1000; + } + // NO_ZERO_DATE mode and NO_ZERO_IN_DATE mode are part of the strict + // default SQL mode used by MySQL 8.0. This means that non-standard + // dates like '0000-00-00' become NULL. For older versions and other + // possible MySQL flavours we still need to account for the + // non-standard behaviour. + if (y + m + d + H + M + S + ms === 0) { + return INVALID_DATE; + } + if (timezone === 'Z') { + return new Date(Date.UTC(y, m - 1, d, H, M, S, ms)); + } + return new Date(y, m - 1, d, H, M, S, ms); + } + let str = this.readDateTimeString(6, 'T', null); + if (str.length === 10) { + str += 'T00:00:00'; + } + return new Date(str + timezone); + } + + readDateTimeString(decimals, timeSep, columnType) { + const length = this.readInt8(); + let y = 0; + let m = 0; + let d = 0; + let H = 0; + let M = 0; + let S = 0; + let ms = 0; + let str; + if (length > 3) { + y = this.readInt16(); + m = this.readInt8(); + d = this.readInt8(); + str = [leftPad(4, y), leftPad(2, m), leftPad(2, d)].join('-'); + } + if (length > 6) { + H = this.readInt8(); + M = this.readInt8(); + S = this.readInt8(); + str += `${timeSep || ' '}${[ + leftPad(2, H), + leftPad(2, M), + leftPad(2, S), + ].join(':')}`; + } else if (columnType === Types.DATETIME) { + str += ' 00:00:00'; + } + if (length > 10) { + ms = this.readInt32(); + str += '.'; + if (decimals) { + ms = leftPad(6, ms); + if (ms.length > decimals) { + ms = ms.substring(0, decimals); // rounding is done at the MySQL side, only 0 are here + } + } + str += ms; + } + return str; + } + + // TIME - value as a string, Can be negative + readTimeString(convertTtoMs) { + const length = this.readInt8(); + if (length === 0) { + return '00:00:00'; + } + const sign = this.readInt8() ? -1 : 1; // 'isNegative' flag byte + let d = 0; + let H = 0; + let M = 0; + let S = 0; + let ms = 0; + if (length > 6) { + d = this.readInt32(); + H = this.readInt8(); + M = this.readInt8(); + S = this.readInt8(); + } + if (length > 10) { + ms = this.readInt32(); + } + if (convertTtoMs) { + H += d * 24; + M += H * 60; + S += M * 60; + ms += S * 1000; + ms *= sign; + return ms; + } + // Format follows mySQL TIME format ([-][h]hh:mm:ss[.u[u[u[u[u[u]]]]]]) + // For positive times below 24 hours, this makes it equal to ISO 8601 times + return ( + (sign === -1 ? '-' : '') + + [leftPad(2, d * 24 + H), leftPad(2, M), leftPad(2, S)].join(':') + + (ms ? `.${ms}`.replace(/0+$/, '') : '') + ); + } + + readLengthCodedString(encoding) { + const len = this.readLengthCodedNumber(); + // TODO: check manually first byte here to avoid polymorphic return type? + if (len === null) { + return null; + } + this.offset += len; + // TODO: Use characterSetCode to get proper encoding + // https://github.com/sidorares/node-mysql2/pull/374 + return StringParser.decode( + this.buffer, + encoding, + this.offset - len, + this.offset + ); + } + + readLengthCodedBuffer() { + const len = this.readLengthCodedNumber(); + if (len === null) { + return null; + } + return this.readBuffer(len); + } + + readNullTerminatedString(encoding) { + const start = this.offset; + let end = this.offset; + while (this.buffer[end]) { + end = end + 1; // TODO: handle OOB check + } + this.offset = end + 1; + return StringParser.decode(this.buffer, encoding, start, end); + } + + // TODO reuse? + readString(len, encoding) { + if (typeof len === 'string' && typeof encoding === 'undefined') { + encoding = len; + len = undefined; + } + if (typeof len === 'undefined') { + len = this.end - this.offset; + } + this.offset += len; + return StringParser.decode( + this.buffer, + encoding, + this.offset - len, + this.offset + ); + } + + parseInt(len, supportBigNumbers) { + if (len === null) { + return null; + } + if (len >= 14 && !supportBigNumbers) { + const s = this.buffer.toString('ascii', this.offset, this.offset + len); + this.offset += len; + return Number(s); + } + let result = 0; + const start = this.offset; + const end = this.offset + len; + let sign = 1; + if (len === 0) { + return 0; // TODO: assert? exception? + } + if (this.buffer[this.offset] === minus) { + this.offset++; + sign = -1; + } + // max precise int is 9007199254740992 + let str; + const numDigits = end - this.offset; + if (supportBigNumbers) { + if (numDigits >= 15) { + str = this.readString(end - this.offset, 'binary'); + result = parseInt(str, 10); + if (result.toString() === str) { + return sign * result; + } + return sign === -1 ? `-${str}` : str; + } + if (numDigits > 16) { + str = this.readString(end - this.offset); + return sign === -1 ? `-${str}` : str; + } + } + if (this.buffer[this.offset] === plus) { + this.offset++; // just ignore + } + while (this.offset < end) { + result *= 10; + result += this.buffer[this.offset] - 48; + this.offset++; + } + const num = result * sign; + if (!supportBigNumbers) { + return num; + } + str = this.buffer.toString('ascii', start, end); + if (num.toString() === str) { + return num; + } + return str; + } + + // note that if value of inputNumberAsString is bigger than MAX_SAFE_INTEGER + // ( or smaller than MIN_SAFE_INTEGER ) the parseIntNoBigCheck result might be + // different from what you would get from Number(inputNumberAsString) + // String(parseIntNoBigCheck) <> String(Number(inputNumberAsString)) <> inputNumberAsString + parseIntNoBigCheck(len) { + if (len === null) { + return null; + } + let result = 0; + const end = this.offset + len; + let sign = 1; + if (len === 0) { + return 0; // TODO: assert? exception? + } + if (this.buffer[this.offset] === minus) { + this.offset++; + sign = -1; + } + if (this.buffer[this.offset] === plus) { + this.offset++; // just ignore + } + while (this.offset < end) { + result *= 10; + result += this.buffer[this.offset] - 48; + this.offset++; + } + return result * sign; + } + + // copy-paste from https://github.com/mysqljs/mysql/blob/master/lib/protocol/Parser.js + parseGeometryValue() { + const buffer = this.readLengthCodedBuffer(); + let offset = 4; + if (buffer === null || !buffer.length) { + return null; + } + function parseGeometry() { + let x, y, i, j, numPoints, line; + let result = null; + const byteOrder = buffer.readUInt8(offset); + offset += 1; + const wkbType = byteOrder + ? buffer.readUInt32LE(offset) + : buffer.readUInt32BE(offset); + offset += 4; + switch (wkbType) { + case 1: // WKBPoint + x = byteOrder + ? buffer.readDoubleLE(offset) + : buffer.readDoubleBE(offset); + offset += 8; + y = byteOrder + ? buffer.readDoubleLE(offset) + : buffer.readDoubleBE(offset); + offset += 8; + result = { x: x, y: y }; + break; + case 2: // WKBLineString + numPoints = byteOrder + ? buffer.readUInt32LE(offset) + : buffer.readUInt32BE(offset); + offset += 4; + result = []; + for (i = numPoints; i > 0; i--) { + x = byteOrder + ? buffer.readDoubleLE(offset) + : buffer.readDoubleBE(offset); + offset += 8; + y = byteOrder + ? buffer.readDoubleLE(offset) + : buffer.readDoubleBE(offset); + offset += 8; + result.push({ x: x, y: y }); + } + break; + case 3: // WKBPolygon + // eslint-disable-next-line no-case-declarations + const numRings = byteOrder + ? buffer.readUInt32LE(offset) + : buffer.readUInt32BE(offset); + offset += 4; + result = []; + for (i = numRings; i > 0; i--) { + numPoints = byteOrder + ? buffer.readUInt32LE(offset) + : buffer.readUInt32BE(offset); + offset += 4; + line = []; + for (j = numPoints; j > 0; j--) { + x = byteOrder + ? buffer.readDoubleLE(offset) + : buffer.readDoubleBE(offset); + offset += 8; + y = byteOrder + ? buffer.readDoubleLE(offset) + : buffer.readDoubleBE(offset); + offset += 8; + line.push({ x: x, y: y }); + } + result.push(line); + } + break; + case 4: // WKBMultiPoint + case 5: // WKBMultiLineString + case 6: // WKBMultiPolygon + case 7: // WKBGeometryCollection + // eslint-disable-next-line no-case-declarations + const num = byteOrder + ? buffer.readUInt32LE(offset) + : buffer.readUInt32BE(offset); + offset += 4; + result = []; + for (i = num; i > 0; i--) { + result.push(parseGeometry()); + } + break; + } + return result; + } + return parseGeometry(); + } + + parseVector() { + const bufLen = this.readLengthCodedNumber(); + const vectorEnd = this.offset + bufLen; + const result = []; + while (this.offset < vectorEnd && this.offset < this.end) { + result.push(this.readFloat()); + } + return result; + } + + parseDate(timezone) { + const strLen = this.readLengthCodedNumber(); + if (strLen === null) { + return null; + } + if (strLen !== 10) { + // we expect only YYYY-MM-DD here. + // if for some reason it's not the case return invalid date + return new Date(NaN); + } + const y = this.parseInt(4); + this.offset++; // - + const m = this.parseInt(2); + this.offset++; // - + const d = this.parseInt(2); + if (!timezone || timezone === 'local') { + return new Date(y, m - 1, d); + } + if (timezone === 'Z') { + return new Date(Date.UTC(y, m - 1, d)); + } + return new Date( + `${leftPad(4, y)}-${leftPad(2, m)}-${leftPad(2, d)}T00:00:00${timezone}` + ); + } + + parseDateTime(timezone) { + const str = this.readLengthCodedString('binary'); + if (str === null) { + return null; + } + if (!timezone || timezone === 'local') { + return new Date(str); + } + return new Date(`${str}${timezone}`); + } + + parseFloat(len) { + if (len === null) { + return null; + } + let result = 0; + const end = this.offset + len; + let factor = 1; + let pastDot = false; + let charCode = 0; + if (len === 0) { + return 0; // TODO: assert? exception? + } + if (this.buffer[this.offset] === minus) { + this.offset++; + factor = -1; + } + if (this.buffer[this.offset] === plus) { + this.offset++; // just ignore + } + while (this.offset < end) { + charCode = this.buffer[this.offset]; + if (charCode === dot) { + pastDot = true; + this.offset++; + } else if (charCode === exponent || charCode === exponentCapital) { + this.offset++; + const exponentValue = this.parseInt(end - this.offset); + return (result / factor) * Math.pow(10, exponentValue); + } else { + result *= 10; + result += this.buffer[this.offset] - 48; + this.offset++; + if (pastDot) { + factor = factor * 10; + } + } + } + return result / factor; + } + + parseLengthCodedIntNoBigCheck() { + return this.parseIntNoBigCheck(this.readLengthCodedNumber()); + } + + parseLengthCodedInt(supportBigNumbers) { + return this.parseInt(this.readLengthCodedNumber(), supportBigNumbers); + } + + parseLengthCodedIntString() { + return this.readLengthCodedString('binary'); + } + + parseLengthCodedFloat() { + return this.parseFloat(this.readLengthCodedNumber()); + } + + peekByte() { + return this.buffer[this.offset]; + } + + // OxFE is often used as "Alt" flag - not ok, not error. + // For example, it's first byte of AuthSwitchRequest + isAlt() { + return this.peekByte() === 0xfe; + } + + isError() { + return this.peekByte() === 0xff; + } + + asError(encoding) { + this.reset(); + this.readInt8(); // fieldCount + const errorCode = this.readInt16(); + let sqlState = ''; + if (this.buffer[this.offset] === 0x23) { + this.skip(1); + sqlState = this.readBuffer(5).toString(); + } + const message = this.readString(undefined, encoding); + const err = new Error(message); + err.code = ErrorCodeToName[errorCode]; + err.errno = errorCode; + err.sqlState = sqlState; + err.sqlMessage = message; + return err; + } + + writeInt32(n) { + this.buffer.writeUInt32LE(n, this.offset); + this.offset += 4; + } + + writeInt24(n) { + this.writeInt8(n & 0xff); + this.writeInt16(n >> 8); + } + + writeInt16(n) { + this.buffer.writeUInt16LE(n, this.offset); + this.offset += 2; + } + + writeInt8(n) { + this.buffer.writeUInt8(n, this.offset); + this.offset++; + } + + writeDouble(n) { + this.buffer.writeDoubleLE(n, this.offset); + this.offset += 8; + } + + writeBuffer(b) { + b.copy(this.buffer, this.offset); + this.offset += b.length; + } + + writeNull() { + this.buffer[this.offset] = 0xfb; + this.offset++; + } + + // TODO: refactor following three? + writeNullTerminatedString(s, encoding) { + const buf = StringParser.encode(s, encoding); + this.buffer.length && buf.copy(this.buffer, this.offset); + this.offset += buf.length; + this.writeInt8(0); + } + + writeString(s, encoding) { + if (s === null) { + this.writeInt8(0xfb); + return; + } + if (s.length === 0) { + return; + } + // const bytes = Buffer.byteLength(s, 'utf8'); + // this.buffer.write(s, this.offset, bytes, 'utf8'); + // this.offset += bytes; + const buf = StringParser.encode(s, encoding); + this.buffer.length && buf.copy(this.buffer, this.offset); + this.offset += buf.length; + } + + writeLengthCodedString(s, encoding) { + const buf = StringParser.encode(s, encoding); + this.writeLengthCodedNumber(buf.length); + this.buffer.length && buf.copy(this.buffer, this.offset); + this.offset += buf.length; + } + + writeLengthCodedBuffer(b) { + this.writeLengthCodedNumber(b.length); + b.copy(this.buffer, this.offset); + this.offset += b.length; + } + + writeLengthCodedNumber(n) { + if (n < 0xfb) { + return this.writeInt8(n); + } + if (n < 0xffff) { + this.writeInt8(0xfc); + return this.writeInt16(n); + } + if (n < 0xffffff) { + this.writeInt8(0xfd); + return this.writeInt24(n); + } + if (n === null) { + return this.writeInt8(0xfb); + } + // TODO: check that n is out of int precision + this.writeInt8(0xfe); + this.buffer.writeUInt32LE(n, this.offset); + this.offset += 4; + this.buffer.writeUInt32LE(n >> 32, this.offset); + this.offset += 4; + return this.offset; + } + + writeDate(d, timezone) { + this.buffer.writeUInt8(11, this.offset); + if (!timezone || timezone === 'local') { + this.buffer.writeUInt16LE(d.getFullYear(), this.offset + 1); + this.buffer.writeUInt8(d.getMonth() + 1, this.offset + 3); + this.buffer.writeUInt8(d.getDate(), this.offset + 4); + this.buffer.writeUInt8(d.getHours(), this.offset + 5); + this.buffer.writeUInt8(d.getMinutes(), this.offset + 6); + this.buffer.writeUInt8(d.getSeconds(), this.offset + 7); + this.buffer.writeUInt32LE(d.getMilliseconds() * 1000, this.offset + 8); + } else { + if (timezone !== 'Z') { + const offset = + (timezone[0] === '-' ? -1 : 1) * + (parseInt(timezone.substring(1, 3), 10) * 60 + + parseInt(timezone.substring(4), 10)); + if (offset !== 0) { + d = new Date(d.getTime() + 60000 * offset); + } + } + this.buffer.writeUInt16LE(d.getUTCFullYear(), this.offset + 1); + this.buffer.writeUInt8(d.getUTCMonth() + 1, this.offset + 3); + this.buffer.writeUInt8(d.getUTCDate(), this.offset + 4); + this.buffer.writeUInt8(d.getUTCHours(), this.offset + 5); + this.buffer.writeUInt8(d.getUTCMinutes(), this.offset + 6); + this.buffer.writeUInt8(d.getUTCSeconds(), this.offset + 7); + this.buffer.writeUInt32LE(d.getUTCMilliseconds() * 1000, this.offset + 8); + } + this.offset += 12; + } + + writeHeader(sequenceId) { + const offset = this.offset; + this.offset = 0; + this.writeInt24(this.buffer.length - 4); + this.writeInt8(sequenceId); + this.offset = offset; + } + + clone() { + return new Packet(this.sequenceId, this.buffer, this.start, this.end); + } + + type() { + if (this.isEOF()) { + return 'EOF'; + } + if (this.isError()) { + return 'Error'; + } + if (this.buffer[this.offset] === 0) { + return 'maybeOK'; // could be other packet types as well + } + return ''; + } + + static lengthCodedNumberLength(n) { + if (n < 0xfb) { + return 1; + } + if (n < 0xffff) { + return 3; + } + if (n < 0xffffff) { + return 5; + } + return 9; + } + + static lengthCodedStringLength(str, encoding) { + const buf = StringParser.encode(str, encoding); + const slen = buf.length; + return Packet.lengthCodedNumberLength(slen) + slen; + } + + static MockBuffer() { + const noop = function () {}; + const res = Buffer.alloc(0); + for (const op in NativeBuffer.prototype) { + if (typeof res[op] === 'function') { + res[op] = noop; + } + } + return res; + } +} + +module.exports = Packet; diff --git a/node_modules/mysql2/lib/packets/prepare_statement.js b/node_modules/mysql2/lib/packets/prepare_statement.js new file mode 100644 index 0000000..d53c222 --- /dev/null +++ b/node_modules/mysql2/lib/packets/prepare_statement.js @@ -0,0 +1,27 @@ +'use strict'; + +const Packet = require('../packets/packet'); +const CommandCodes = require('../constants/commands'); +const StringParser = require('../parsers/string.js'); +const CharsetToEncoding = require('../constants/charset_encodings.js'); + +class PrepareStatement { + constructor(sql, charsetNumber) { + this.query = sql; + this.charsetNumber = charsetNumber; + this.encoding = CharsetToEncoding[charsetNumber]; + } + + toPacket() { + const buf = StringParser.encode(this.query, this.encoding); + const length = 5 + buf.length; + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeInt8(CommandCodes.STMT_PREPARE); + packet.writeBuffer(buf); + return packet; + } +} + +module.exports = PrepareStatement; diff --git a/node_modules/mysql2/lib/packets/prepared_statement_header.js b/node_modules/mysql2/lib/packets/prepared_statement_header.js new file mode 100644 index 0000000..70b263a --- /dev/null +++ b/node_modules/mysql2/lib/packets/prepared_statement_header.js @@ -0,0 +1,16 @@ +'use strict'; + +class PreparedStatementHeader { + constructor(packet) { + packet.skip(1); // should be 0 + this.id = packet.readInt32(); + this.fieldCount = packet.readInt16(); + this.parameterCount = packet.readInt16(); + packet.skip(1); // should be 0 + this.warningCount = packet.readInt16(); + } +} + +// TODO: toPacket + +module.exports = PreparedStatementHeader; diff --git a/node_modules/mysql2/lib/packets/query.js b/node_modules/mysql2/lib/packets/query.js new file mode 100644 index 0000000..b650b35 --- /dev/null +++ b/node_modules/mysql2/lib/packets/query.js @@ -0,0 +1,27 @@ +'use strict'; + +const Packet = require('../packets/packet.js'); +const CommandCode = require('../constants/commands.js'); +const StringParser = require('../parsers/string.js'); +const CharsetToEncoding = require('../constants/charset_encodings.js'); + +class Query { + constructor(sql, charsetNumber) { + this.query = sql; + this.charsetNumber = charsetNumber; + this.encoding = CharsetToEncoding[charsetNumber]; + } + + toPacket() { + const buf = StringParser.encode(this.query, this.encoding); + const length = 5 + buf.length; + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeInt8(CommandCode.QUERY); + packet.writeBuffer(buf); + return packet; + } +} + +module.exports = Query; diff --git a/node_modules/mysql2/lib/packets/register_slave.js b/node_modules/mysql2/lib/packets/register_slave.js new file mode 100644 index 0000000..26e802f --- /dev/null +++ b/node_modules/mysql2/lib/packets/register_slave.js @@ -0,0 +1,46 @@ +'use strict'; + +// http://dev.mysql.com/doc/internals/en/com-register-slave.html +// note that documentation is incorrect, for example command code is actually 0x15 but documented as 0x14 + +const Packet = require('../packets/packet'); +const CommandCodes = require('../constants/commands'); + +class RegisterSlave { + constructor(opts) { + this.serverId = opts.serverId || 0; + this.slaveHostname = opts.slaveHostname || ''; + this.slaveUser = opts.slaveUser || ''; + this.slavePassword = opts.slavePassword || ''; + this.slavePort = opts.slavePort || 0; + this.replicationRank = opts.replicationRank || 0; + this.masterId = opts.masterId || 0; + } + + toPacket() { + const length = + 15 + // TODO: should be ascii? + Buffer.byteLength(this.slaveHostname, 'utf8') + + Buffer.byteLength(this.slaveUser, 'utf8') + + Buffer.byteLength(this.slavePassword, 'utf8') + + 3 + + 4; + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeInt8(CommandCodes.REGISTER_SLAVE); + packet.writeInt32(this.serverId); + packet.writeInt8(Buffer.byteLength(this.slaveHostname, 'utf8')); + packet.writeString(this.slaveHostname); + packet.writeInt8(Buffer.byteLength(this.slaveUser, 'utf8')); + packet.writeString(this.slaveUser); + packet.writeInt8(Buffer.byteLength(this.slavePassword, 'utf8')); + packet.writeString(this.slavePassword); + packet.writeInt16(this.slavePort); + packet.writeInt32(this.replicationRank); + packet.writeInt32(this.masterId); + return packet; + } +} + +module.exports = RegisterSlave; diff --git a/node_modules/mysql2/lib/packets/resultset_header.js b/node_modules/mysql2/lib/packets/resultset_header.js new file mode 100644 index 0000000..ed0ffd4 --- /dev/null +++ b/node_modules/mysql2/lib/packets/resultset_header.js @@ -0,0 +1,124 @@ +'use strict'; + +// TODO: rename to OK packet +// https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html + +const Packet = require('./packet.js'); +const ClientConstants = require('../constants/client.js'); +const ServerSatusFlags = require('../constants/server_status.js'); + +const EncodingToCharset = require('../constants/encoding_charset.js'); +const sessionInfoTypes = require('../constants/session_track.js'); + +class ResultSetHeader { + constructor(packet, connection) { + const bigNumberStrings = connection.config.bigNumberStrings; + const encoding = connection.serverEncoding; + const flags = connection._handshakePacket.capabilityFlags; + const isSet = function (flag) { + return flags & ClientConstants[flag]; + }; + if (packet.buffer[packet.offset] !== 0) { + this.fieldCount = packet.readLengthCodedNumber(); + if (this.fieldCount === null) { + this.infileName = packet.readString(undefined, encoding); + } + return; + } + this.fieldCount = packet.readInt8(); // skip OK byte + this.affectedRows = packet.readLengthCodedNumber(bigNumberStrings); + this.insertId = packet.readLengthCodedNumberSigned(bigNumberStrings); + this.info = ''; + if (isSet('PROTOCOL_41')) { + this.serverStatus = packet.readInt16(); + this.warningStatus = packet.readInt16(); + } else if (isSet('TRANSACTIONS')) { + this.serverStatus = packet.readInt16(); + } + let stateChanges = null; + if (isSet('SESSION_TRACK') && packet.offset < packet.end) { + this.info = packet.readLengthCodedString(encoding); + + if (this.serverStatus && ServerSatusFlags.SERVER_SESSION_STATE_CHANGED) { + // session change info record - see + // https://dev.mysql.com/doc/internals/en/packet-OK_Packet.html#cs-sect-packet-ok-sessioninfo + let len = + packet.offset < packet.end ? packet.readLengthCodedNumber() : 0; + const end = packet.offset + len; + let type, key, stateEnd; + if (len > 0) { + stateChanges = { + systemVariables: {}, + schema: null, + gtids: [], + trackStateChange: null, + }; + } + while (packet.offset < end) { + type = packet.readInt8(); + len = packet.readLengthCodedNumber(); + stateEnd = packet.offset + len; + if (type === sessionInfoTypes.SYSTEM_VARIABLES) { + key = packet.readLengthCodedString(encoding); + const val = packet.readLengthCodedString(encoding); + stateChanges.systemVariables[key] = val; + if (key === 'character_set_client') { + const charsetNumber = EncodingToCharset[val]; + // TODO - better api for driver users to handle unknown encodings? + // maybe custom coverter in the config? + // For now just ignore character_set_client command if there is + // no known mapping from reported encoding to a charset code + if (typeof charsetNumber !== 'undefined') { + connection.config.charsetNumber = charsetNumber; + } + } + } else if (type === sessionInfoTypes.SCHEMA) { + key = packet.readLengthCodedString(encoding); + stateChanges.schema = key; + } else if (type === sessionInfoTypes.STATE_CHANGE) { + stateChanges.trackStateChange = + packet.readLengthCodedString(encoding); + } else if (type === sessionInfoTypes.STATE_GTIDS) { + // TODO: find if the first length coded string means anything. Usually comes as empty + // eslint-disable-next-line no-unused-vars + const _unknownString = packet.readLengthCodedString(encoding); + const gtid = packet.readLengthCodedString(encoding); + stateChanges.gtids = gtid.split(','); + } else { + // unsupported session track type. For now just ignore + } + packet.offset = stateEnd; + } + } + } else { + this.info = packet.readString(undefined, encoding); + } + if (stateChanges) { + this.stateChanges = stateChanges; + } + const m = this.info.match(/\schanged:\s*(\d+)/i); + if (m !== null) { + this.changedRows = parseInt(m[1], 10); + } else { + this.changedRows = 0; + } + } + + // TODO: should be consistent instance member, but it's just easier here to have just function + static toPacket(fieldCount, insertId) { + let length = 4 + Packet.lengthCodedNumberLength(fieldCount); + if (typeof insertId !== 'undefined') { + length += Packet.lengthCodedNumberLength(insertId); + } + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + packet.writeLengthCodedNumber(fieldCount); + if (typeof insertId !== 'undefined') { + packet.writeLengthCodedNumber(insertId); + } + return packet; + } +} + +module.exports = ResultSetHeader; diff --git a/node_modules/mysql2/lib/packets/ssl_request.js b/node_modules/mysql2/lib/packets/ssl_request.js new file mode 100644 index 0000000..69eec24 --- /dev/null +++ b/node_modules/mysql2/lib/packets/ssl_request.js @@ -0,0 +1,25 @@ +'use strict'; + +const ClientConstants = require('../constants/client'); +const Packet = require('../packets/packet'); + +class SSLRequest { + constructor(flags, charset) { + this.clientFlags = flags | ClientConstants.SSL; + this.charset = charset; + } + + toPacket() { + const length = 36; + const buffer = Buffer.allocUnsafe(length); + const packet = new Packet(0, buffer, 0, length); + buffer.fill(0); + packet.offset = 4; + packet.writeInt32(this.clientFlags); + packet.writeInt32(0); // max packet size. todo: move to config + packet.writeInt8(this.charset); + return packet; + } +} + +module.exports = SSLRequest; diff --git a/node_modules/mysql2/lib/packets/text_row.js b/node_modules/mysql2/lib/packets/text_row.js new file mode 100644 index 0000000..ecb8d10 --- /dev/null +++ b/node_modules/mysql2/lib/packets/text_row.js @@ -0,0 +1,47 @@ +'use strict'; + +const Packet = require('../packets/packet'); + +class TextRow { + constructor(columns) { + this.columns = columns || []; + } + + static fromPacket(packet) { + // packet.reset(); // set offset to starting point? + const columns = []; + while (packet.haveMoreData()) { + columns.push(packet.readLengthCodedString()); + } + return new TextRow(columns); + } + + static toPacket(columns, encoding) { + const sequenceId = 0; // TODO remove, this is calculated now in connecton + let length = 0; + columns.forEach((val) => { + if (val === null || typeof val === 'undefined') { + ++length; + return; + } + length += Packet.lengthCodedStringLength(val.toString(10), encoding); + }); + const buffer = Buffer.allocUnsafe(length + 4); + const packet = new Packet(sequenceId, buffer, 0, length + 4); + packet.offset = 4; + columns.forEach((val) => { + if (val === null) { + packet.writeNull(); + return; + } + if (typeof val === 'undefined') { + packet.writeInt8(0); + return; + } + packet.writeLengthCodedString(val.toString(10), encoding); + }); + return packet; + } +} + +module.exports = TextRow; diff --git a/node_modules/mysql2/lib/parsers/binary_parser.js b/node_modules/mysql2/lib/parsers/binary_parser.js new file mode 100644 index 0000000..ce3c908 --- /dev/null +++ b/node_modules/mysql2/lib/parsers/binary_parser.js @@ -0,0 +1,231 @@ +'use strict'; + +const FieldFlags = require('../constants/field_flags.js'); +const Charsets = require('../constants/charsets.js'); +const Types = require('../constants/types.js'); +const helpers = require('../helpers'); +const genFunc = require('generate-function'); +const parserCache = require('./parser_cache.js'); +const typeNames = []; +for (const t in Types) { + typeNames[Types[t]] = t; +} + +function readCodeFor(field, config, options, fieldNum) { + const supportBigNumbers = Boolean( + options.supportBigNumbers || config.supportBigNumbers + ); + const bigNumberStrings = Boolean( + options.bigNumberStrings || config.bigNumberStrings + ); + const timezone = options.timezone || config.timezone; + const dateStrings = options.dateStrings || config.dateStrings; + const unsigned = field.flags & FieldFlags.UNSIGNED; + switch (field.columnType) { + case Types.TINY: + return unsigned ? 'packet.readInt8();' : 'packet.readSInt8();'; + case Types.SHORT: + return unsigned ? 'packet.readInt16();' : 'packet.readSInt16();'; + case Types.LONG: + case Types.INT24: // in binary protocol int24 is encoded in 4 bytes int32 + return unsigned ? 'packet.readInt32();' : 'packet.readSInt32();'; + case Types.YEAR: + return 'packet.readInt16()'; + case Types.FLOAT: + return 'packet.readFloat();'; + case Types.DOUBLE: + return 'packet.readDouble();'; + case Types.NULL: + return 'null;'; + case Types.DATE: + case Types.DATETIME: + case Types.TIMESTAMP: + case Types.NEWDATE: + if (helpers.typeMatch(field.columnType, dateStrings, Types)) { + return `packet.readDateTimeString(${parseInt(field.decimals, 10)}, ${null}, ${field.columnType});`; + } + return `packet.readDateTime(${helpers.srcEscape(timezone)});`; + case Types.TIME: + return 'packet.readTimeString()'; + case Types.DECIMAL: + case Types.NEWDECIMAL: + if (config.decimalNumbers) { + return 'packet.parseLengthCodedFloat();'; + } + return 'packet.readLengthCodedString("ascii");'; + case Types.GEOMETRY: + return 'packet.parseGeometryValue();'; + case Types.VECTOR: + return 'packet.parseVector()'; + case Types.JSON: + // Since for JSON columns mysql always returns charset 63 (BINARY), + // we have to handle it according to JSON specs and use "utf8", + // see https://github.com/sidorares/node-mysql2/issues/409 + return config.jsonStrings + ? 'packet.readLengthCodedString("utf8")' + : 'JSON.parse(packet.readLengthCodedString("utf8"));'; + case Types.LONGLONG: + if (!supportBigNumbers) { + return unsigned + ? 'packet.readInt64JSNumber();' + : 'packet.readSInt64JSNumber();'; + } + if (bigNumberStrings) { + return unsigned + ? 'packet.readInt64String();' + : 'packet.readSInt64String();'; + } + return unsigned ? 'packet.readInt64();' : 'packet.readSInt64();'; + + default: + if (field.characterSet === Charsets.BINARY) { + return 'packet.readLengthCodedBuffer();'; + } + return `packet.readLengthCodedString(fields[${fieldNum}].encoding)`; + } +} + +function compile(fields, options, config) { + const parserFn = genFunc(); + const nullBitmapLength = Math.floor((fields.length + 7 + 2) / 8); + + function wrap(field, packet) { + return { + type: typeNames[field.columnType], + length: field.columnLength, + db: field.schema, + table: field.table, + name: field.name, + string: function (encoding = field.encoding) { + if (field.columnType === Types.JSON && encoding === field.encoding) { + // Since for JSON columns mysql always returns charset 63 (BINARY), + // we have to handle it according to JSON specs and use "utf8", + // see https://github.com/sidorares/node-mysql2/issues/1661 + console.warn( + `typeCast: JSON column "${field.name}" is interpreted as BINARY by default, recommended to manually set utf8 encoding: \`field.string("utf8")\`` + ); + } + + if ( + [Types.DATETIME, Types.NEWDATE, Types.TIMESTAMP, Types.DATE].includes( + field.columnType + ) + ) { + return packet.readDateTimeString(parseInt(field.decimals, 10)); + } + + if (field.columnType === Types.TINY) { + const unsigned = field.flags & FieldFlags.UNSIGNED; + + return String(unsigned ? packet.readInt8() : packet.readSInt8()); + } + + if (field.columnType === Types.TIME) { + return packet.readTimeString(); + } + + return packet.readLengthCodedString(encoding); + }, + buffer: function () { + return packet.readLengthCodedBuffer(); + }, + geometry: function () { + return packet.parseGeometryValue(); + }, + }; + } + + parserFn('(function(){'); + parserFn('return class BinaryRow {'); + parserFn('constructor() {'); + parserFn('}'); + + parserFn('next(packet, fields, options) {'); + if (options.rowsAsArray) { + parserFn(`const result = new Array(${fields.length});`); + } else { + parserFn('const result = {};'); + } + + // Global typeCast + if ( + typeof config.typeCast === 'function' && + typeof options.typeCast !== 'function' + ) { + options.typeCast = config.typeCast; + } + + parserFn('packet.readInt8();'); // status byte + for (let i = 0; i < nullBitmapLength; ++i) { + parserFn(`const nullBitmaskByte${i} = packet.readInt8();`); + } + + let lvalue = ''; + let currentFieldNullBit = 4; + let nullByteIndex = 0; + let fieldName = ''; + let tableName = ''; + + for (let i = 0; i < fields.length; i++) { + fieldName = helpers.fieldEscape(fields[i].name); + // parserFn(`// ${fieldName}: ${typeNames[fields[i].columnType]}`); + + if (typeof options.nestTables === 'string') { + lvalue = `result[${helpers.fieldEscape(fields[i].table + options.nestTables + fields[i].name)}]`; + } else if (options.nestTables === true) { + tableName = helpers.fieldEscape(fields[i].table); + + parserFn(`if (!result[${tableName}]) result[${tableName}] = {};`); + lvalue = `result[${tableName}][${fieldName}]`; + } else if (options.rowsAsArray) { + lvalue = `result[${i.toString(10)}]`; + } else { + lvalue = `result[${fieldName}]`; + } + + parserFn(`if (nullBitmaskByte${nullByteIndex} & ${currentFieldNullBit}) `); + parserFn(`${lvalue} = null;`); + parserFn('else {'); + + if (options.typeCast === false) { + parserFn(`${lvalue} = packet.readLengthCodedBuffer();`); + } else { + const fieldWrapperVar = `fieldWrapper${i}`; + parserFn(`const ${fieldWrapperVar} = wrap(fields[${i}], packet);`); + const readCode = readCodeFor(fields[i], config, options, i); + + if (typeof options.typeCast === 'function') { + parserFn( + `${lvalue} = options.typeCast(${fieldWrapperVar}, function() { return ${readCode} });` + ); + } else { + parserFn(`${lvalue} = ${readCode};`); + } + } + parserFn('}'); + + currentFieldNullBit *= 2; + if (currentFieldNullBit === 0x100) { + currentFieldNullBit = 1; + nullByteIndex++; + } + } + + parserFn('return result;'); + parserFn('}'); + parserFn('};')('})()'); + + if (config.debug) { + helpers.printDebugWithCode( + 'Compiled binary protocol row parser', + parserFn.toString() + ); + } + return parserFn.toFunction({ wrap }); +} + +function getBinaryParser(fields, options, config) { + return parserCache.getParser('binary', fields, options, config, compile); +} + +module.exports = getBinaryParser; diff --git a/node_modules/mysql2/lib/parsers/parser_cache.js b/node_modules/mysql2/lib/parsers/parser_cache.js new file mode 100644 index 0000000..2dd6891 --- /dev/null +++ b/node_modules/mysql2/lib/parsers/parser_cache.js @@ -0,0 +1,66 @@ +'use strict'; + +const { createLRU } = require('lru.min'); + +const parserCache = createLRU({ + max: 15000, +}); + +function keyFromFields(type, fields, options, config) { + const res = [ + type, + typeof options.nestTables, + options.nestTables, + Boolean(options.rowsAsArray), + Boolean(options.supportBigNumbers || config.supportBigNumbers), + Boolean(options.bigNumberStrings || config.bigNumberStrings), + typeof options.typeCast, + options.timezone || config.timezone, + Boolean(options.decimalNumbers), + options.dateStrings, + ]; + + for (let i = 0; i < fields.length; ++i) { + const field = fields[i]; + + res.push([ + field.name, + field.columnType, + field.length, + field.schema, + field.table, + field.flags, + field.characterSet, + ]); + } + + return JSON.stringify(res, null, 0); +} + +function getParser(type, fields, options, config, compiler) { + const key = keyFromFields(type, fields, options, config); + let parser = parserCache.get(key); + + if (parser) { + return parser; + } + + parser = compiler(fields, options, config); + parserCache.set(key, parser); + return parser; +} + +function setMaxCache(max) { + parserCache.resize(max); +} + +function clearCache() { + parserCache.clear(); +} + +module.exports = { + getParser: getParser, + setMaxCache: setMaxCache, + clearCache: clearCache, + _keyFromFields: keyFromFields, +}; diff --git a/node_modules/mysql2/lib/parsers/static_binary_parser.js b/node_modules/mysql2/lib/parsers/static_binary_parser.js new file mode 100644 index 0000000..b83cb86 --- /dev/null +++ b/node_modules/mysql2/lib/parsers/static_binary_parser.js @@ -0,0 +1,211 @@ +'use strict'; + +const FieldFlags = require('../constants/field_flags.js'); +const Charsets = require('../constants/charsets.js'); +const Types = require('../constants/types.js'); +const helpers = require('../helpers'); + +const typeNames = []; +for (const t in Types) { + typeNames[Types[t]] = t; +} + +function getBinaryParser(fields, _options, config) { + function readCode(field, config, options, fieldNum, packet) { + const supportBigNumbers = Boolean( + options.supportBigNumbers || config.supportBigNumbers + ); + const bigNumberStrings = Boolean( + options.bigNumberStrings || config.bigNumberStrings + ); + const timezone = options.timezone || config.timezone; + const dateStrings = options.dateStrings || config.dateStrings; + const unsigned = field.flags & FieldFlags.UNSIGNED; + + switch (field.columnType) { + case Types.TINY: + return unsigned ? packet.readInt8() : packet.readSInt8(); + case Types.SHORT: + return unsigned ? packet.readInt16() : packet.readSInt16(); + case Types.LONG: + case Types.INT24: // in binary protocol int24 is encoded in 4 bytes int32 + return unsigned ? packet.readInt32() : packet.readSInt32(); + case Types.YEAR: + return packet.readInt16(); + case Types.FLOAT: + return packet.readFloat(); + case Types.DOUBLE: + return packet.readDouble(); + case Types.NULL: + return null; + case Types.DATE: + case Types.DATETIME: + case Types.TIMESTAMP: + case Types.NEWDATE: + return helpers.typeMatch(field.columnType, dateStrings, Types) + ? packet.readDateTimeString( + parseInt(field.decimals, 10), + null, + field.columnType + ) + : packet.readDateTime(timezone); + case Types.TIME: + return packet.readTimeString(); + case Types.DECIMAL: + case Types.NEWDECIMAL: + return config.decimalNumbers + ? packet.parseLengthCodedFloat() + : packet.readLengthCodedString('ascii'); + case Types.GEOMETRY: + return packet.parseGeometryValue(); + case Types.VECTOR: + return packet.parseVector(); + case Types.JSON: + // Since for JSON columns mysql always returns charset 63 (BINARY), + // we have to handle it according to JSON specs and use "utf8", + // see https://github.com/sidorares/node-mysql2/issues/409 + return config.jsonStrings + ? packet.readLengthCodedString('utf8') + : JSON.parse(packet.readLengthCodedString('utf8')); + case Types.LONGLONG: + if (!supportBigNumbers) + return unsigned + ? packet.readInt64JSNumber() + : packet.readSInt64JSNumber(); + return bigNumberStrings + ? unsigned + ? packet.readInt64String() + : packet.readSInt64String() + : unsigned + ? packet.readInt64() + : packet.readSInt64(); + default: + return field.characterSet === Charsets.BINARY + ? packet.readLengthCodedBuffer() + : packet.readLengthCodedString(fields[fieldNum].encoding); + } + } + + return class BinaryRow { + constructor() {} + + next(packet, fields, options) { + packet.readInt8(); // status byte + + const nullBitmapLength = Math.floor((fields.length + 7 + 2) / 8); + const nullBitmaskBytes = new Array(nullBitmapLength); + + for (let i = 0; i < nullBitmapLength; i++) { + nullBitmaskBytes[i] = packet.readInt8(); + } + + const result = options.rowsAsArray ? new Array(fields.length) : {}; + let currentFieldNullBit = 4; + let nullByteIndex = 0; + + for (let i = 0; i < fields.length; i++) { + const field = fields[i]; + const typeCast = + options.typeCast !== undefined ? options.typeCast : config.typeCast; + + let value; + if (nullBitmaskBytes[nullByteIndex] & currentFieldNullBit) { + value = null; + } else if (options.typeCast === false) { + value = packet.readLengthCodedBuffer(); + } else { + const next = () => readCode(field, config, options, i, packet); + value = + typeof typeCast === 'function' + ? typeCast( + { + type: typeNames[field.columnType], + length: field.columnLength, + db: field.schema, + table: field.table, + name: field.name, + string: function (encoding = field.encoding) { + if ( + field.columnType === Types.JSON && + encoding === field.encoding + ) { + // Since for JSON columns mysql always returns charset 63 (BINARY), + // we have to handle it according to JSON specs and use "utf8", + // see https://github.com/sidorares/node-mysql2/issues/1661 + console.warn( + `typeCast: JSON column "${field.name}" is interpreted as BINARY by default, recommended to manually set utf8 encoding: \`field.string("utf8")\`` + ); + } + + if ( + [ + Types.DATETIME, + Types.NEWDATE, + Types.TIMESTAMP, + Types.DATE, + ].includes(field.columnType) + ) { + return packet.readDateTimeString( + parseInt(field.decimals, 10) + ); + } + + if (field.columnType === Types.TINY) { + const unsigned = field.flags & FieldFlags.UNSIGNED; + + return String( + unsigned ? packet.readInt8() : packet.readSInt8() + ); + } + + if (field.columnType === Types.TIME) { + return packet.readTimeString(); + } + + return packet.readLengthCodedString(encoding); + }, + buffer: function () { + return packet.readLengthCodedBuffer(); + }, + geometry: function () { + return packet.parseGeometryValue(); + }, + }, + next + ) + : next(); + } + + if (options.rowsAsArray) { + result[i] = value; + } else if (typeof options.nestTables === 'string') { + const key = helpers.fieldEscape( + field.table + options.nestTables + field.name, + false + ); + result[key] = value; + } else if (options.nestTables === true) { + const tableName = helpers.fieldEscape(field.table, false); + if (!result[tableName]) { + result[tableName] = {}; + } + const fieldName = helpers.fieldEscape(field.name, false); + result[tableName][fieldName] = value; + } else { + const key = helpers.fieldEscape(field.name, false); + result[key] = value; + } + + currentFieldNullBit *= 2; + if (currentFieldNullBit === 0x100) { + currentFieldNullBit = 1; + nullByteIndex++; + } + } + + return result; + } + }; +} + +module.exports = getBinaryParser; diff --git a/node_modules/mysql2/lib/parsers/static_text_parser.js b/node_modules/mysql2/lib/parsers/static_text_parser.js new file mode 100644 index 0000000..69cc2a4 --- /dev/null +++ b/node_modules/mysql2/lib/parsers/static_text_parser.js @@ -0,0 +1,152 @@ +'use strict'; + +const Types = require('../constants/types.js'); +const Charsets = require('../constants/charsets.js'); +const helpers = require('../helpers'); + +const typeNames = []; +for (const t in Types) { + typeNames[Types[t]] = t; +} + +function readField({ packet, type, charset, encoding, config, options }) { + const supportBigNumbers = Boolean( + options.supportBigNumbers || config.supportBigNumbers + ); + const bigNumberStrings = Boolean( + options.bigNumberStrings || config.bigNumberStrings + ); + const timezone = options.timezone || config.timezone; + const dateStrings = options.dateStrings || config.dateStrings; + + switch (type) { + case Types.TINY: + case Types.SHORT: + case Types.LONG: + case Types.INT24: + case Types.YEAR: + return packet.parseLengthCodedIntNoBigCheck(); + case Types.LONGLONG: + if (supportBigNumbers && bigNumberStrings) { + return packet.parseLengthCodedIntString(); + } + return packet.parseLengthCodedInt(supportBigNumbers); + case Types.FLOAT: + case Types.DOUBLE: + return packet.parseLengthCodedFloat(); + case Types.NULL: + case Types.DECIMAL: + case Types.NEWDECIMAL: + if (config.decimalNumbers) { + return packet.parseLengthCodedFloat(); + } + return packet.readLengthCodedString('ascii'); + case Types.DATE: + if (helpers.typeMatch(type, dateStrings, Types)) { + return packet.readLengthCodedString('ascii'); + } + return packet.parseDate(timezone); + case Types.DATETIME: + case Types.TIMESTAMP: + if (helpers.typeMatch(type, dateStrings, Types)) { + return packet.readLengthCodedString('ascii'); + } + return packet.parseDateTime(timezone); + case Types.TIME: + return packet.readLengthCodedString('ascii'); + case Types.GEOMETRY: + return packet.parseGeometryValue(); + case Types.VECTOR: + return packet.parseVector(); + case Types.JSON: + // Since for JSON columns mysql always returns charset 63 (BINARY), + // we have to handle it according to JSON specs and use "utf8", + // see https://github.com/sidorares/node-mysql2/issues/409 + return config.jsonStrings + ? packet.readLengthCodedString('utf8') + : JSON.parse(packet.readLengthCodedString('utf8')); + default: + if (charset === Charsets.BINARY) { + return packet.readLengthCodedBuffer(); + } + return packet.readLengthCodedString(encoding); + } +} + +function createTypecastField(field, packet) { + return { + type: typeNames[field.columnType], + length: field.columnLength, + db: field.schema, + table: field.table, + name: field.name, + string: function (encoding = field.encoding) { + if (field.columnType === Types.JSON && encoding === field.encoding) { + // Since for JSON columns mysql always returns charset 63 (BINARY), + // we have to handle it according to JSON specs and use "utf8", + // see https://github.com/sidorares/node-mysql2/issues/1661 + console.warn( + `typeCast: JSON column "${field.name}" is interpreted as BINARY by default, recommended to manually set utf8 encoding: \`field.string("utf8")\`` + ); + } + return packet.readLengthCodedString(encoding); + }, + buffer: function () { + return packet.readLengthCodedBuffer(); + }, + geometry: function () { + return packet.parseGeometryValue(); + }, + }; +} + +function getTextParser(_fields, _options, config) { + return { + next(packet, fields, options) { + const result = options.rowsAsArray ? [] : {}; + for (let i = 0; i < fields.length; i++) { + const field = fields[i]; + const typeCast = options.typeCast ? options.typeCast : config.typeCast; + const next = () => + readField({ + packet, + type: field.columnType, + encoding: field.encoding, + charset: field.characterSet, + config, + options, + }); + + let value; + + if (options.typeCast === false) { + value = packet.readLengthCodedBuffer(); + } else if (typeof typeCast === 'function') { + value = typeCast(createTypecastField(field, packet), next); + } else { + value = next(); + } + + if (options.rowsAsArray) { + result.push(value); + } else if (typeof options.nestTables === 'string') { + result[ + `${helpers.fieldEscape(field.table, false)}${options.nestTables}${helpers.fieldEscape(field.name, false)}` + ] = value; + } else if (options.nestTables) { + const tableName = helpers.fieldEscape(field.table, false); + if (!result[tableName]) { + result[tableName] = {}; + } + result[tableName][helpers.fieldEscape(field.name, false)] = value; + } else { + result[helpers.fieldEscape(field.name, false)] = value; + } + } + + return result; + }, + }; +} + +module.exports = getTextParser; diff --git a/node_modules/mysql2/lib/parsers/string.js b/node_modules/mysql2/lib/parsers/string.js new file mode 100644 index 0000000..2368e50 --- /dev/null +++ b/node_modules/mysql2/lib/parsers/string.js @@ -0,0 +1,50 @@ +'use strict'; + +const Iconv = require('iconv-lite'); +const { createLRU } = require('lru.min'); + +const decoderCache = createLRU({ + max: 500, +}); + +exports.decode = function (buffer, encoding, start, end, options) { + if (Buffer.isEncoding(encoding)) { + return buffer.toString(encoding, start, end); + } + + // Optimize for common case: encoding="short_string", options=undefined. + let decoder; + if (!options) { + decoder = decoderCache.get(encoding); + if (!decoder) { + decoder = Iconv.getDecoder(encoding); + decoderCache.set(encoding, decoder); + } + } else { + const decoderArgs = { encoding, options }; + const decoderKey = JSON.stringify(decoderArgs); + decoder = decoderCache.get(decoderKey); + if (!decoder) { + decoder = Iconv.getDecoder(decoderArgs.encoding, decoderArgs.options); + decoderCache.set(decoderKey, decoder); + } + } + + const res = decoder.write(buffer.slice(start, end)); + const trail = decoder.end(); + + return trail ? res + trail : res; +}; + +exports.encode = function (string, encoding, options) { + if (Buffer.isEncoding(encoding)) { + return Buffer.from(string, encoding); + } + + const encoder = Iconv.getEncoder(encoding, options || {}); + + const res = encoder.write(string); + const trail = encoder.end(); + + return trail && trail.length > 0 ? Buffer.concat([res, trail]) : res; +}; diff --git a/node_modules/mysql2/lib/parsers/text_parser.js b/node_modules/mysql2/lib/parsers/text_parser.js new file mode 100644 index 0000000..69b7e21 --- /dev/null +++ b/node_modules/mysql2/lib/parsers/text_parser.js @@ -0,0 +1,214 @@ +'use strict'; + +const Types = require('../constants/types.js'); +const Charsets = require('../constants/charsets.js'); +const helpers = require('../helpers'); +const genFunc = require('generate-function'); +const parserCache = require('./parser_cache.js'); + +const typeNames = []; +for (const t in Types) { + typeNames[Types[t]] = t; +} + +function readCodeFor(type, charset, encodingExpr, config, options) { + const supportBigNumbers = Boolean( + options.supportBigNumbers || config.supportBigNumbers + ); + const bigNumberStrings = Boolean( + options.bigNumberStrings || config.bigNumberStrings + ); + const timezone = options.timezone || config.timezone; + const dateStrings = options.dateStrings || config.dateStrings; + + switch (type) { + case Types.TINY: + case Types.SHORT: + case Types.LONG: + case Types.INT24: + case Types.YEAR: + return 'packet.parseLengthCodedIntNoBigCheck()'; + case Types.LONGLONG: + if (supportBigNumbers && bigNumberStrings) { + return 'packet.parseLengthCodedIntString()'; + } + return `packet.parseLengthCodedInt(${supportBigNumbers})`; + case Types.FLOAT: + case Types.DOUBLE: + return 'packet.parseLengthCodedFloat()'; + case Types.NULL: + return 'packet.readLengthCodedNumber()'; + case Types.DECIMAL: + case Types.NEWDECIMAL: + if (config.decimalNumbers) { + return 'packet.parseLengthCodedFloat()'; + } + return 'packet.readLengthCodedString("ascii")'; + case Types.DATE: + if (helpers.typeMatch(type, dateStrings, Types)) { + return 'packet.readLengthCodedString("ascii")'; + } + return `packet.parseDate(${helpers.srcEscape(timezone)})`; + case Types.DATETIME: + case Types.TIMESTAMP: + if (helpers.typeMatch(type, dateStrings, Types)) { + return 'packet.readLengthCodedString("ascii")'; + } + return `packet.parseDateTime(${helpers.srcEscape(timezone)})`; + case Types.TIME: + return 'packet.readLengthCodedString("ascii")'; + case Types.GEOMETRY: + return 'packet.parseGeometryValue()'; + case Types.VECTOR: + return 'packet.parseVector()'; + case Types.JSON: + // Since for JSON columns mysql always returns charset 63 (BINARY), + // we have to handle it according to JSON specs and use "utf8", + // see https://github.com/sidorares/node-mysql2/issues/409 + return config.jsonStrings + ? 'packet.readLengthCodedString("utf8")' + : 'JSON.parse(packet.readLengthCodedString("utf8"))'; + default: + if (charset === Charsets.BINARY) { + return 'packet.readLengthCodedBuffer()'; + } + return `packet.readLengthCodedString(${encodingExpr})`; + } +} + +function compile(fields, options, config) { + // use global typeCast if current query doesn't specify one + if ( + typeof config.typeCast === 'function' && + typeof options.typeCast !== 'function' + ) { + options.typeCast = config.typeCast; + } + + function wrap(field, _this) { + return { + type: typeNames[field.columnType], + length: field.columnLength, + db: field.schema, + table: field.table, + name: field.name, + string: function (encoding = field.encoding) { + if (field.columnType === Types.JSON && encoding === field.encoding) { + // Since for JSON columns mysql always returns charset 63 (BINARY), + // we have to handle it according to JSON specs and use "utf8", + // see https://github.com/sidorares/node-mysql2/issues/1661 + console.warn( + `typeCast: JSON column "${field.name}" is interpreted as BINARY by default, recommended to manually set utf8 encoding: \`field.string("utf8")\`` + ); + } + + return _this.packet.readLengthCodedString(encoding); + }, + buffer: function () { + return _this.packet.readLengthCodedBuffer(); + }, + geometry: function () { + return _this.packet.parseGeometryValue(); + }, + }; + } + + const parserFn = genFunc(); + + parserFn('(function () {')('return class TextRow {'); + + // constructor method + parserFn('constructor(fields) {'); + // node-mysql typeCast compatibility wrapper + // see https://github.com/mysqljs/mysql/blob/96fdd0566b654436624e2375c7b6604b1f50f825/lib/protocol/packets/Field.js + if (typeof options.typeCast === 'function') { + parserFn('const _this = this;'); + parserFn('for(let i=0; i clusterIds[index++ % clusterIds.length]; + }, + RANDOM() { + return (clusterIds) => + clusterIds[Math.floor(Math.random() * clusterIds.length)]; + }, + ORDER() { + return (clusterIds) => clusterIds[0]; + }, +}; + +const getMonotonicMilliseconds = function () { + let ms; + + if (typeof process.hrtime === 'function') { + ms = process.hrtime(); + ms = ms[0] * 1e3 + ms[1] * 1e-6; + } else { + ms = process.uptime() * 1000; + } + + return Math.floor(ms); +}; + +const patternRegExp = function (pattern) { + if (pattern instanceof RegExp) { + return pattern; + } + + const source = pattern + .replace(/([.+?^=!:${}()|[\]/\\])/g, '\\$1') + .replace(/\*/g, '.*'); + + return new RegExp(`^${source}$`); +}; + +class PoolNamespace { + constructor(cluster, pattern, selector) { + this._cluster = cluster; + this._pattern = pattern; + this._selector = makeSelector[selector](); + } + + getConnection(cb) { + const clusterNode = this._getClusterNode(); + if (clusterNode === null) { + let err = new Error('Pool does Not exist.'); + err.code = 'POOL_NOEXIST'; + + if (this._cluster._findNodeIds(this._pattern, true).length !== 0) { + err = new Error('Pool does Not have online node.'); + err.code = 'POOL_NONEONLINE'; + } + + return cb(err); + } + return this._cluster._getConnection(clusterNode, (err, connection) => { + if (err) { + if ( + this._cluster._canRetry && + this._cluster._findNodeIds(this._pattern).length !== 0 + ) { + this._cluster.emit('warn', err); + return this.getConnection(cb); + } + + return cb(err); + } + return cb(null, connection); + }); + } + + /** + * pool cluster query + * @param {*} sql + * @param {*} values + * @param {*} cb + * @returns query + */ + query(sql, values, cb) { + const query = Connection.createQuery(sql, values, cb, {}); + this.getConnection((err, conn) => { + if (err) { + if (typeof query.onResult === 'function') { + query.onResult(err); + } else { + query.emit('error', err); + } + return; + } + try { + conn.query(query).once('end', () => { + conn.release(); + }); + } catch (e) { + conn.release(); + throw e; + } + }); + return query; + } + + /** + * pool cluster execute + * @param {*} sql + * @param {*} values + * @param {*} cb + */ + execute(sql, values, cb) { + if (typeof values === 'function') { + cb = values; + values = []; + } + this.getConnection((err, conn) => { + if (err) { + return cb(err); + } + try { + conn.execute(sql, values, cb).once('end', () => { + conn.release(); + }); + } catch (e) { + conn.release(); + throw e; + } + }); + } + + _getClusterNode() { + const foundNodeIds = this._cluster._findNodeIds(this._pattern); + if (foundNodeIds.length === 0) { + return null; + } + const nodeId = + foundNodeIds.length === 1 + ? foundNodeIds[0] + : this._selector(foundNodeIds); + return this._cluster._getNode(nodeId); + } +} + +class PoolCluster extends EventEmitter { + constructor(config) { + super(); + config = config || {}; + this._canRetry = + typeof config.canRetry === 'undefined' ? true : config.canRetry; + this._removeNodeErrorCount = config.removeNodeErrorCount || 5; + this._restoreNodeTimeout = config.restoreNodeTimeout || 0; + this._defaultSelector = config.defaultSelector || 'RR'; + this._closed = false; + this._lastId = 0; + this._nodes = {}; + this._serviceableNodeIds = []; + this._namespaces = {}; + this._findCaches = {}; + } + + of(pattern, selector) { + pattern = pattern || '*'; + selector = selector || this._defaultSelector; + selector = selector.toUpperCase(); + if (!makeSelector[selector] === 'undefined') { + selector = this._defaultSelector; + } + const key = pattern + selector; + if (typeof this._namespaces[key] === 'undefined') { + this._namespaces[key] = new PoolNamespace(this, pattern, selector); + } + return this._namespaces[key]; + } + + add(id, config) { + if (typeof id === 'object') { + config = id; + id = `CLUSTER::${++this._lastId}`; + } + if (typeof this._nodes[id] === 'undefined') { + this._nodes[id] = { + id: id, + errorCount: 0, + pool: new Pool({ config: new PoolConfig(config) }), + _offlineUntil: 0, + }; + this._serviceableNodeIds.push(id); + this._clearFindCaches(); + } + } + + remove(pattern) { + const foundNodeIds = this._findNodeIds(pattern, true); + + for (let i = 0; i < foundNodeIds.length; i++) { + const node = this._getNode(foundNodeIds[i]); + + if (node) { + this._removeNode(node); + } + } + } + + getConnection(pattern, selector, cb) { + let namespace; + if (typeof pattern === 'function') { + cb = pattern; + namespace = this.of(); + } else { + if (typeof selector === 'function') { + cb = selector; + selector = this._defaultSelector; + } + namespace = this.of(pattern, selector); + } + namespace.getConnection(cb); + } + + end(callback) { + const cb = + callback !== undefined + ? callback + : (err) => { + if (err) { + throw err; + } + }; + if (this._closed) { + process.nextTick(cb); + return; + } + + this._closed = true; + + let calledBack = false; + let waitingClose = 0; + const onEnd = (err) => { + if (!calledBack && (err || --waitingClose <= 0)) { + calledBack = true; + return cb(err); + } + }; + + for (const id in this._nodes) { + waitingClose++; + this._nodes[id].pool.end(onEnd); + } + + if (waitingClose === 0) { + process.nextTick(onEnd); + } + } + + _findNodeIds(pattern, includeOffline) { + let currentTime = 0; + let foundNodeIds = this._findCaches[pattern]; + + if (foundNodeIds === undefined) { + const expression = patternRegExp(pattern); + + foundNodeIds = this._serviceableNodeIds.filter((id) => + id.match(expression) + ); + } + + this._findCaches[pattern] = foundNodeIds; + + if (includeOffline) { + return foundNodeIds; + } + + return foundNodeIds.filter((nodeId) => { + const node = this._getNode(nodeId); + + if (!node._offlineUntil) { + return true; + } + + if (!currentTime) { + currentTime = getMonotonicMilliseconds(); + } + + return node._offlineUntil <= currentTime; + }); + } + + _getNode(id) { + return this._nodes[id] || null; + } + + _increaseErrorCount(node) { + const errorCount = ++node.errorCount; + + if (this._removeNodeErrorCount > errorCount) { + return; + } + + if (this._restoreNodeTimeout > 0) { + node._offlineUntil = + getMonotonicMilliseconds() + this._restoreNodeTimeout; + this.emit('offline', node.id); + return; + } + + this._removeNode(node); + this.emit('remove', node.id); + } + + _decreaseErrorCount(node) { + let errorCount = node.errorCount; + + if (errorCount > this._removeNodeErrorCount) { + errorCount = this._removeNodeErrorCount; + } + + if (errorCount < 1) { + errorCount = 1; + } + + node.errorCount = errorCount - 1; + + if (node._offlineUntil) { + node._offlineUntil = 0; + this.emit('online', node.id); + } + } + + _getConnection(node, cb) { + node.pool.getConnection((err, connection) => { + if (err) { + this._increaseErrorCount(node); + return cb(err); + } + this._decreaseErrorCount(node); + + connection._clusterId = node.id; + return cb(null, connection); + }); + } + + _removeNode(node) { + const index = this._serviceableNodeIds.indexOf(node.id); + if (index !== -1) { + this._serviceableNodeIds.splice(index, 1); + delete this._nodes[node.id]; + this._clearFindCaches(); + node.pool.end(); + } + } + + _clearFindCaches() { + this._findCaches = {}; + } +} + +module.exports = PoolCluster; diff --git a/node_modules/mysql2/lib/pool_config.js b/node_modules/mysql2/lib/pool_config.js new file mode 100644 index 0000000..0a4a260 --- /dev/null +++ b/node_modules/mysql2/lib/pool_config.js @@ -0,0 +1,30 @@ +'use strict'; + +const ConnectionConfig = require('./connection_config.js'); + +class PoolConfig { + constructor(options) { + if (typeof options === 'string') { + options = ConnectionConfig.parseUrl(options); + } + this.connectionConfig = new ConnectionConfig(options); + this.waitForConnections = + options.waitForConnections === undefined + ? true + : Boolean(options.waitForConnections); + this.connectionLimit = isNaN(options.connectionLimit) + ? 10 + : Number(options.connectionLimit); + this.maxIdle = isNaN(options.maxIdle) + ? this.connectionLimit + : Number(options.maxIdle); + this.idleTimeout = isNaN(options.idleTimeout) + ? 60000 + : Number(options.idleTimeout); + this.queueLimit = isNaN(options.queueLimit) + ? 0 + : Number(options.queueLimit); + } +} + +module.exports = PoolConfig; diff --git a/node_modules/mysql2/lib/pool_connection.js b/node_modules/mysql2/lib/pool_connection.js new file mode 100644 index 0000000..5cc94dc --- /dev/null +++ b/node_modules/mysql2/lib/pool_connection.js @@ -0,0 +1,12 @@ +'use strict'; + +const BasePoolConnection = require('./base/pool_connection.js'); + +class PoolConnection extends BasePoolConnection { + promise(promiseImpl) { + const PromisePoolConnection = require('./promise/pool_connection.js'); + return new PromisePoolConnection(this, promiseImpl); + } +} + +module.exports = PoolConnection; diff --git a/node_modules/mysql2/lib/promise/connection.js b/node_modules/mysql2/lib/promise/connection.js new file mode 100644 index 0000000..5a40545 --- /dev/null +++ b/node_modules/mysql2/lib/promise/connection.js @@ -0,0 +1,222 @@ +'use strict'; + +const EventEmitter = require('events').EventEmitter; +const PromisePreparedStatementInfo = require('./prepared_statement_info.js'); +const makeDoneCb = require('./make_done_cb.js'); +const inheritEvents = require('./inherit_events.js'); +const BaseConnection = require('../base/connection.js'); + +class PromiseConnection extends EventEmitter { + constructor(connection, promiseImpl) { + super(); + this.connection = connection; + this.Promise = promiseImpl || Promise; + inheritEvents(connection, this, [ + 'error', + 'drain', + 'connect', + 'end', + 'enqueue', + ]); + } + + release() { + this.connection.release(); + } + + query(query, params) { + const c = this.connection; + const localErr = new Error(); + if (typeof params === 'function') { + throw new Error( + 'Callback function is not available with promise clients.' + ); + } + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + if (params !== undefined) { + c.query(query, params, done); + } else { + c.query(query, done); + } + }); + } + + execute(query, params) { + const c = this.connection; + const localErr = new Error(); + if (typeof params === 'function') { + throw new Error( + 'Callback function is not available with promise clients.' + ); + } + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + if (params !== undefined) { + c.execute(query, params, done); + } else { + c.execute(query, done); + } + }); + } + + end() { + return new this.Promise((resolve) => { + this.connection.end(resolve); + }); + } + + beginTransaction() { + const c = this.connection; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + c.beginTransaction(done); + }); + } + + commit() { + const c = this.connection; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + c.commit(done); + }); + } + + rollback() { + const c = this.connection; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + c.rollback(done); + }); + } + + ping() { + const c = this.connection; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + c.ping((err) => { + if (err) { + localErr.message = err.message; + localErr.code = err.code; + localErr.errno = err.errno; + localErr.sqlState = err.sqlState; + localErr.sqlMessage = err.sqlMessage; + reject(localErr); + } else { + resolve(true); + } + }); + }); + } + + connect() { + const c = this.connection; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + c.connect((err, param) => { + if (err) { + localErr.message = err.message; + localErr.code = err.code; + localErr.errno = err.errno; + localErr.sqlState = err.sqlState; + localErr.sqlMessage = err.sqlMessage; + reject(localErr); + } else { + resolve(param); + } + }); + }); + } + + prepare(options) { + const c = this.connection; + const promiseImpl = this.Promise; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + c.prepare(options, (err, statement) => { + if (err) { + localErr.message = err.message; + localErr.code = err.code; + localErr.errno = err.errno; + localErr.sqlState = err.sqlState; + localErr.sqlMessage = err.sqlMessage; + reject(localErr); + } else { + const wrappedStatement = new PromisePreparedStatementInfo( + statement, + promiseImpl + ); + resolve(wrappedStatement); + } + }); + }); + } + + changeUser(options) { + const c = this.connection; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + c.changeUser(options, (err) => { + if (err) { + localErr.message = err.message; + localErr.code = err.code; + localErr.errno = err.errno; + localErr.sqlState = err.sqlState; + localErr.sqlMessage = err.sqlMessage; + reject(localErr); + } else { + resolve(); + } + }); + }); + } + + get config() { + return this.connection.config; + } + + get threadId() { + return this.connection.threadId; + } +} +// patching PromiseConnection +// create facade functions for prototype functions on "Connection" that are not yet +// implemented with PromiseConnection + +// proxy synchronous functions only +(function (functionsToWrap) { + for (let i = 0; functionsToWrap && i < functionsToWrap.length; i++) { + const func = functionsToWrap[i]; + + if ( + typeof BaseConnection.prototype[func] === 'function' && + PromiseConnection.prototype[func] === undefined + ) { + PromiseConnection.prototype[func] = (function factory(funcName) { + return function () { + return BaseConnection.prototype[funcName].apply( + this.connection, + arguments + ); + }; + })(func); + } + } +})([ + // synchronous functions + 'close', + 'createBinlogStream', + 'destroy', + 'escape', + 'escapeId', + 'format', + 'pause', + 'pipe', + 'resume', + 'unprepare', +]); + +module.exports = PromiseConnection; diff --git a/node_modules/mysql2/lib/promise/inherit_events.js b/node_modules/mysql2/lib/promise/inherit_events.js new file mode 100644 index 0000000..4127acd --- /dev/null +++ b/node_modules/mysql2/lib/promise/inherit_events.js @@ -0,0 +1,27 @@ +'use strict'; + +function inheritEvents(source, target, events) { + const listeners = {}; + target + .on('newListener', (eventName) => { + if (events.indexOf(eventName) >= 0 && !target.listenerCount(eventName)) { + source.on( + eventName, + (listeners[eventName] = function () { + const args = [].slice.call(arguments); + args.unshift(eventName); + + target.emit.apply(target, args); + }) + ); + } + }) + .on('removeListener', (eventName) => { + if (events.indexOf(eventName) >= 0 && !target.listenerCount(eventName)) { + source.removeListener(eventName, listeners[eventName]); + delete listeners[eventName]; + } + }); +} + +module.exports = inheritEvents; diff --git a/node_modules/mysql2/lib/promise/make_done_cb.js b/node_modules/mysql2/lib/promise/make_done_cb.js new file mode 100644 index 0000000..124303f --- /dev/null +++ b/node_modules/mysql2/lib/promise/make_done_cb.js @@ -0,0 +1,19 @@ +'use strict'; + +function makeDoneCb(resolve, reject, localErr) { + return function (err, rows, fields) { + if (err) { + localErr.message = err.message; + localErr.code = err.code; + localErr.errno = err.errno; + localErr.sql = err.sql; + localErr.sqlState = err.sqlState; + localErr.sqlMessage = err.sqlMessage; + reject(localErr); + } else { + resolve([rows, fields]); + } + }; +} + +module.exports = makeDoneCb; diff --git a/node_modules/mysql2/lib/promise/pool.js b/node_modules/mysql2/lib/promise/pool.js new file mode 100644 index 0000000..0912c95 --- /dev/null +++ b/node_modules/mysql2/lib/promise/pool.js @@ -0,0 +1,112 @@ +'use strict'; + +const EventEmitter = require('events').EventEmitter; +const makeDoneCb = require('./make_done_cb.js'); +const PromisePoolConnection = require('./pool_connection.js'); +const inheritEvents = require('./inherit_events.js'); +const BasePool = require('../base/pool.js'); + +class PromisePool extends EventEmitter { + constructor(pool, thePromise) { + super(); + this.pool = pool; + this.Promise = thePromise || Promise; + inheritEvents(pool, this, ['acquire', 'connection', 'enqueue', 'release']); + } + + getConnection() { + const corePool = this.pool; + return new this.Promise((resolve, reject) => { + corePool.getConnection((err, coreConnection) => { + if (err) { + reject(err); + } else { + resolve(new PromisePoolConnection(coreConnection, this.Promise)); + } + }); + }); + } + + releaseConnection(connection) { + if (connection instanceof PromisePoolConnection) connection.release(); + } + + query(sql, args) { + const corePool = this.pool; + const localErr = new Error(); + if (typeof args === 'function') { + throw new Error( + 'Callback function is not available with promise clients.' + ); + } + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + if (args !== undefined) { + corePool.query(sql, args, done); + } else { + corePool.query(sql, done); + } + }); + } + + execute(sql, args) { + const corePool = this.pool; + const localErr = new Error(); + if (typeof args === 'function') { + throw new Error( + 'Callback function is not available with promise clients.' + ); + } + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + if (args) { + corePool.execute(sql, args, done); + } else { + corePool.execute(sql, done); + } + }); + } + + end() { + const corePool = this.pool; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + corePool.end((err) => { + if (err) { + localErr.message = err.message; + localErr.code = err.code; + localErr.errno = err.errno; + localErr.sqlState = err.sqlState; + localErr.sqlMessage = err.sqlMessage; + reject(localErr); + } else { + resolve(); + } + }); + }); + } +} + +(function (functionsToWrap) { + for (let i = 0; functionsToWrap && i < functionsToWrap.length; i++) { + const func = functionsToWrap[i]; + + if ( + typeof BasePool.prototype[func] === 'function' && + PromisePool.prototype[func] === undefined + ) { + PromisePool.prototype[func] = (function factory(funcName) { + return function () { + return BasePool.prototype[funcName].apply(this.pool, arguments); + }; + })(func); + } + } +})([ + // synchronous functions + 'escape', + 'escapeId', + 'format', +]); + +module.exports = PromisePool; diff --git a/node_modules/mysql2/lib/promise/pool_cluster.js b/node_modules/mysql2/lib/promise/pool_cluster.js new file mode 100644 index 0000000..0422ce7 --- /dev/null +++ b/node_modules/mysql2/lib/promise/pool_cluster.js @@ -0,0 +1,54 @@ +'use strict'; + +const PromisePoolConnection = require('./pool_connection'); +const makeDoneCb = require('./make_done_cb'); + +class PromisePoolNamespace { + constructor(poolNamespace, thePromise) { + this.poolNamespace = poolNamespace; + this.Promise = thePromise || Promise; + } + + getConnection() { + const corePoolNamespace = this.poolNamespace; + return new this.Promise((resolve, reject) => { + corePoolNamespace.getConnection((err, coreConnection) => { + if (err) { + reject(err); + } else { + resolve(new PromisePoolConnection(coreConnection, this.Promise)); + } + }); + }); + } + + query(sql, values) { + const corePoolNamespace = this.poolNamespace; + const localErr = new Error(); + if (typeof values === 'function') { + throw new Error( + 'Callback function is not available with promise clients.' + ); + } + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + corePoolNamespace.query(sql, values, done); + }); + } + + execute(sql, values) { + const corePoolNamespace = this.poolNamespace; + const localErr = new Error(); + if (typeof values === 'function') { + throw new Error( + 'Callback function is not available with promise clients.' + ); + } + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + corePoolNamespace.execute(sql, values, done); + }); + } +} + +module.exports = PromisePoolNamespace; diff --git a/node_modules/mysql2/lib/promise/pool_connection.js b/node_modules/mysql2/lib/promise/pool_connection.js new file mode 100644 index 0000000..05f85ed --- /dev/null +++ b/node_modules/mysql2/lib/promise/pool_connection.js @@ -0,0 +1,19 @@ +'use strict'; + +const PromiseConnection = require('./connection.js'); +const BasePoolConnection = require('../base/pool_connection.js'); + +class PromisePoolConnection extends PromiseConnection { + constructor(connection, promiseImpl) { + super(connection, promiseImpl); + } + + destroy() { + return BasePoolConnection.prototype.destroy.apply( + this.connection, + arguments + ); + } +} + +module.exports = PromisePoolConnection; diff --git a/node_modules/mysql2/lib/promise/prepared_statement_info.js b/node_modules/mysql2/lib/promise/prepared_statement_info.js new file mode 100644 index 0000000..47b9bed --- /dev/null +++ b/node_modules/mysql2/lib/promise/prepared_statement_info.js @@ -0,0 +1,32 @@ +'use strict'; + +const makeDoneCb = require('./make_done_cb.js'); + +class PromisePreparedStatementInfo { + constructor(statement, promiseImpl) { + this.statement = statement; + this.Promise = promiseImpl; + } + + execute(parameters) { + const s = this.statement; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + if (parameters) { + s.execute(parameters, done); + } else { + s.execute(done); + } + }); + } + + close() { + return new this.Promise((resolve) => { + this.statement.close(); + resolve(); + }); + } +} + +module.exports = PromisePreparedStatementInfo; diff --git a/node_modules/mysql2/lib/results_stream.js b/node_modules/mysql2/lib/results_stream.js new file mode 100644 index 0000000..7f451fe --- /dev/null +++ b/node_modules/mysql2/lib/results_stream.js @@ -0,0 +1,38 @@ +'use strict'; + +const Readable = require('stream').Readable; + +// copy-paste from https://github.com/mysqljs/mysql/blob/master/lib/protocol/sequences/Query.js +module.exports = function (command, connectionStream) { + command.stream = function (options) { + let stream; + + options = options || {}; + options.objectMode = true; + (stream = new Readable(options)), + (stream._read = function () { + connectionStream.resume(); + }); + + this.on('result', (row, i) => { + if (!stream.push(row)) { + connectionStream.pause(); + } + stream.emit('result', row, i); // replicate old emitter + }); + + this.on('error', (err) => { + stream.emit('error', err); // Pass on any errors + }); + + this.on('end', () => { + stream.push(null); // pushing null, indicating EOF + }); + + this.on('fields', (fields, i) => { + stream.emit('fields', fields, i); // replicate old emitter + }); + + return stream; + }; +}; diff --git a/node_modules/mysql2/lib/server.js b/node_modules/mysql2/lib/server.js new file mode 100644 index 0000000..e0633e8 --- /dev/null +++ b/node_modules/mysql2/lib/server.js @@ -0,0 +1,37 @@ +'use strict'; + +const net = require('net'); +const EventEmitter = require('events').EventEmitter; + +const Connection = require('./connection'); +const ConnectionConfig = require('./connection_config'); + +// TODO: inherit Server from net.Server +class Server extends EventEmitter { + constructor() { + super(); + this.connections = []; + this._server = net.createServer(this._handleConnection.bind(this)); + } + + _handleConnection(socket) { + const connectionConfig = new ConnectionConfig({ + stream: socket, + isServer: true, + }); + const connection = new Connection({ config: connectionConfig }); + this.emit('connection', connection); + } + + listen(port) { + this._port = port; + this._server.listen.apply(this._server, arguments); + return this; + } + + close(cb) { + this._server.close(cb); + } +} + +module.exports = Server; diff --git a/node_modules/mysql2/package.json b/node_modules/mysql2/package.json new file mode 100644 index 0000000..f4755ed --- /dev/null +++ b/node_modules/mysql2/package.json @@ -0,0 +1,80 @@ +{ + "name": "mysql2", + "version": "3.14.1", + "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS", + "main": "index.js", + "typings": "typings/mysql/index", + "type": "commonjs", + "scripts": { + "lint": "eslint . && prettier --check .", + "lint:fix": "eslint . --fix && prettier --write .", + "test": "poku -d -r=verbose --sequential test/esm test/unit test/integration", + "test:bun": "bun poku -d --sequential test/esm test/unit test/integration", + "test:deno": "deno run --allow-read --allow-env --allow-run npm:poku -d --sequential --denoAllow=\"read,env,net,sys\" test/esm test/unit test/integration", + "test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"", + "coverage-test": "c8 npm run test", + "benchmark": "node ./benchmarks/benchmark.js", + "wait-port": "wait-on" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sidorares/node-mysql2.git" + }, + "homepage": "https://sidorares.github.io/node-mysql2/docs", + "keywords": [ + "mysql", + "client", + "server" + ], + "files": [ + "lib", + "typings/mysql", + "index.js", + "index.d.ts", + "promise.js", + "promise.d.ts" + ], + "exports": { + ".": "./index.js", + "./package.json": "./package.json", + "./promise": "./promise.js", + "./promise.js": "./promise.js" + }, + "engines": { + "node": ">= 8.0" + }, + "author": "Andrey Sidorov ", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "devDependencies": { + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "^9.21.0", + "@eslint/markdown": "^6.2.2", + "@types/node": "^22.0.0", + "@typescript-eslint/eslint-plugin": "^8.26.0", + "@typescript-eslint/parser": "^8.26.0", + "assert-diff": "^3.0.2", + "benchmark": "^2.1.4", + "c8": "^10.1.1", + "error-stack-parser": "^2.0.3", + "eslint-config-prettier": "^10.0.2", + "eslint-plugin-async-await": "^0.0.0", + "eslint-plugin-markdown": "^5.1.0", + "eslint-plugin-prettier": "^5.2.3", + "globals": "^16.0.0", + "poku": "^3.0.0", + "portfinder": "^1.0.28", + "prettier": "^3.0.0", + "typescript": "^5.0.2" + } +} diff --git a/node_modules/mysql2/promise.d.ts b/node_modules/mysql2/promise.d.ts new file mode 100644 index 0000000..4afb6a7 --- /dev/null +++ b/node_modules/mysql2/promise.d.ts @@ -0,0 +1,131 @@ +import { EventEmitter } from 'events'; + +import { + RowDataPacket, + OkPacket, + ResultSetHeader, + FieldPacket, + QueryOptions, + ConnectionOptions, + PoolOptions, + PoolClusterOptions, + Pool as CorePool, +} from './index.js'; +import { ExecutableBase as ExecutableBaseClass } from './typings/mysql/lib/protocol/sequences/promise/ExecutableBase.js'; +import { QueryableBase as QueryableBaseClass } from './typings/mysql/lib/protocol/sequences/promise/QueryableBase.js'; + +export * from './index.js'; + +// Expose class interfaces +declare class QueryableAndExecutableBase extends QueryableBaseClass( + ExecutableBaseClass(EventEmitter) +) {} + +export interface PreparedStatementInfo { + close(): Promise; + execute( + parameters: any | any[] | { [param: string]: any } + ): Promise< + [ + ( + | RowDataPacket[][] + | RowDataPacket[] + | OkPacket + | OkPacket[] + | ResultSetHeader + ), + FieldPacket[], + ] + >; +} + +export interface Connection extends QueryableAndExecutableBase { + config: ConnectionOptions; + + threadId: number; + + connect(): Promise; + + ping(): Promise; + + beginTransaction(): Promise; + + commit(): Promise; + + rollback(): Promise; + + changeUser(options: ConnectionOptions): Promise; + + prepare(options: string | QueryOptions): Promise; + + unprepare(sql: string | QueryOptions): void; + + end(options?: any): Promise; + + destroy(): void; + + pause(): void; + + resume(): void; + + escape(value: any): string; + + escapeId(value: string): string; + escapeId(values: string[]): string; + + format(sql: string, values?: any | any[] | { [param: string]: any }): string; +} + +export interface PoolConnection extends Connection { + release(): void; + connection: Connection; +} + +export interface Pool extends Connection { + getConnection(): Promise; + + releaseConnection(connection: PoolConnection): void; + + on(event: 'connection', listener: (connection: PoolConnection) => any): this; + on(event: 'acquire', listener: (connection: PoolConnection) => any): this; + on(event: 'release', listener: (connection: PoolConnection) => any): this; + on(event: 'enqueue', listener: () => any): this; + + end(): Promise; + + pool: CorePool; +} + +export interface PoolNamespace extends QueryableAndExecutableBase { + getConnection(): Promise; +} + +export interface PoolCluster extends EventEmitter { + config: PoolClusterOptions; + + add(config: PoolOptions): void; + add(group: string, connectionUri: string): void; + add(group: string, config: PoolOptions): void; + + end(): Promise; + + getConnection(): Promise; + getConnection(group: string): Promise; + getConnection(group: string, selector: string): Promise; + + of(pattern: string, selector?: string): PoolNamespace; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'remove', listener: (nodeId: number) => void): this; + on(event: 'warn', listener: (err: Error) => void): this; +} + +export function createConnection(connectionUri: string): Promise; +export function createConnection( + config: ConnectionOptions +): Promise; + +export function createPool(connectionUri: string): Pool; +export function createPool(config: PoolOptions): Pool; + +export function createPoolCluster(config?: PoolClusterOptions): PoolCluster; diff --git a/node_modules/mysql2/promise.js b/node_modules/mysql2/promise.js new file mode 100644 index 0000000..5095738 --- /dev/null +++ b/node_modules/mysql2/promise.js @@ -0,0 +1,202 @@ +'use strict'; + +const SqlString = require('sqlstring'); +const EventEmitter = require('events').EventEmitter; +const parserCache = require('./lib/parsers/parser_cache.js'); +const PoolCluster = require('./lib/pool_cluster.js'); +const createConnection = require('./lib/create_connection.js'); +const createPool = require('./lib/create_pool.js'); +const createPoolCluster = require('./lib/create_pool_cluster.js'); +const PromiseConnection = require('./lib/promise/connection.js'); +const PromisePool = require('./lib/promise/pool.js'); +const makeDoneCb = require('./lib/promise/make_done_cb.js'); +const PromisePoolConnection = require('./lib/promise/pool_connection.js'); +const inheritEvents = require('./lib/promise/inherit_events.js'); +const PromisePoolNamespace = require('./lib/promise/pool_cluster'); + +function createConnectionPromise(opts) { + const coreConnection = createConnection(opts); + const createConnectionErr = new Error(); + const thePromise = opts.Promise || Promise; + if (!thePromise) { + throw new Error( + 'no Promise implementation available.' + + 'Use promise-enabled node version or pass userland Promise' + + " implementation as parameter, for example: { Promise: require('bluebird') }" + ); + } + return new thePromise((resolve, reject) => { + coreConnection.once('connect', () => { + resolve(new PromiseConnection(coreConnection, thePromise)); + }); + coreConnection.once('error', (err) => { + createConnectionErr.message = err.message; + createConnectionErr.code = err.code; + createConnectionErr.errno = err.errno; + createConnectionErr.sqlState = err.sqlState; + reject(createConnectionErr); + }); + }); +} + +// note: the callback of "changeUser" is not called on success +// hence there is no possibility to call "resolve" + +function createPromisePool(opts) { + const corePool = createPool(opts); + const thePromise = opts.Promise || Promise; + if (!thePromise) { + throw new Error( + 'no Promise implementation available.' + + 'Use promise-enabled node version or pass userland Promise' + + " implementation as parameter, for example: { Promise: require('bluebird') }" + ); + } + + return new PromisePool(corePool, thePromise); +} + +class PromisePoolCluster extends EventEmitter { + constructor(poolCluster, thePromise) { + super(); + this.poolCluster = poolCluster; + this.Promise = thePromise || Promise; + inheritEvents(poolCluster, this, ['warn', 'remove', 'online', 'offline']); + } + + getConnection(pattern, selector) { + const corePoolCluster = this.poolCluster; + return new this.Promise((resolve, reject) => { + corePoolCluster.getConnection( + pattern, + selector, + (err, coreConnection) => { + if (err) { + reject(err); + } else { + resolve(new PromisePoolConnection(coreConnection, this.Promise)); + } + } + ); + }); + } + + query(sql, args) { + const corePoolCluster = this.poolCluster; + const localErr = new Error(); + if (typeof args === 'function') { + throw new Error( + 'Callback function is not available with promise clients.' + ); + } + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + corePoolCluster.query(sql, args, done); + }); + } + + execute(sql, args) { + const corePoolCluster = this.poolCluster; + const localErr = new Error(); + if (typeof args === 'function') { + throw new Error( + 'Callback function is not available with promise clients.' + ); + } + return new this.Promise((resolve, reject) => { + const done = makeDoneCb(resolve, reject, localErr); + corePoolCluster.execute(sql, args, done); + }); + } + + of(pattern, selector) { + return new PromisePoolNamespace( + this.poolCluster.of(pattern, selector), + this.Promise + ); + } + + end() { + const corePoolCluster = this.poolCluster; + const localErr = new Error(); + return new this.Promise((resolve, reject) => { + corePoolCluster.end((err) => { + if (err) { + localErr.message = err.message; + localErr.code = err.code; + localErr.errno = err.errno; + localErr.sqlState = err.sqlState; + localErr.sqlMessage = err.sqlMessage; + reject(localErr); + } else { + resolve(); + } + }); + }); + } +} + +/** + * proxy poolCluster synchronous functions + */ +(function (functionsToWrap) { + for (let i = 0; functionsToWrap && i < functionsToWrap.length; i++) { + const func = functionsToWrap[i]; + + if ( + typeof PoolCluster.prototype[func] === 'function' && + PromisePoolCluster.prototype[func] === undefined + ) { + PromisePoolCluster.prototype[func] = (function factory(funcName) { + return function () { + return PoolCluster.prototype[funcName].apply( + this.poolCluster, + arguments + ); + }; + })(func); + } + } +})(['add', 'remove']); + +function createPromisePoolCluster(opts) { + const corePoolCluster = createPoolCluster(opts); + const thePromise = (opts && opts.Promise) || Promise; + if (!thePromise) { + throw new Error( + 'no Promise implementation available.' + + 'Use promise-enabled node version or pass userland Promise' + + " implementation as parameter, for example: { Promise: require('bluebird') }" + ); + } + return new PromisePoolCluster(corePoolCluster, thePromise); +} + +exports.createConnection = createConnectionPromise; +exports.createPool = createPromisePool; +exports.createPoolCluster = createPromisePoolCluster; +exports.escape = SqlString.escape; +exports.escapeId = SqlString.escapeId; +exports.format = SqlString.format; +exports.raw = SqlString.raw; +exports.PromisePool = PromisePool; +exports.PromiseConnection = PromiseConnection; +exports.PromisePoolConnection = PromisePoolConnection; + +exports.__defineGetter__('Types', () => require('./lib/constants/types.js')); + +exports.__defineGetter__('Charsets', () => + require('./lib/constants/charsets.js') +); + +exports.__defineGetter__('CharsetToEncoding', () => + require('./lib/constants/charset_encodings.js') +); + +exports.setMaxParserCache = function (max) { + parserCache.setMaxCache(max); +}; + +exports.clearParserCache = function () { + parserCache.clearCache(); +}; diff --git a/node_modules/mysql2/typings/mysql/LICENSE.txt b/node_modules/mysql2/typings/mysql/LICENSE.txt new file mode 100644 index 0000000..fc35417 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/LICENSE.txt @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2016, Felix Frederick Becker + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/mysql2/typings/mysql/index.d.ts b/node_modules/mysql2/typings/mysql/index.d.ts new file mode 100644 index 0000000..a402c36 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/index.d.ts @@ -0,0 +1,95 @@ +/** + * sqlstring types are based on https://www.npmjs.com/package/@types/sqlstring, version 2.3.2 + */ +import { Pool as BasePool, PoolOptions } from './lib/Pool.js'; +import { + Connection as BaseConnection, + ConnectionOptions, + SslOptions, +} from './lib/Connection.js'; +import { + Query as BaseQuery, + QueryOptions, + QueryError, +} from './lib/protocol/sequences/Query.js'; +import { + PoolCluster as BasePoolCluster, + PoolClusterOptions, + PoolNamespace, +} from './lib/PoolCluster.js'; +import { PoolConnection as BasePoolConnection } from './lib/PoolConnection.js'; +import { + Prepare as BasePrepare, + PrepareStatementInfo, +} from './lib/protocol/sequences/Prepare.js'; +import { Server } from './lib/Server.js'; + +export { + ConnectionOptions, + SslOptions, + PoolOptions, + PoolClusterOptions, + PoolNamespace, + QueryOptions, + QueryError, + PrepareStatementInfo, +}; + +export * from './lib/protocol/packets/index.js'; +export * from './lib/Auth.js'; +export * from './lib/constants/index.js'; +export * from './lib/parsers/index.js'; + +// Expose class interfaces +export interface Connection extends BaseConnection {} +export interface Pool extends BasePool {} +export interface PoolConnection extends BasePoolConnection {} +export interface PoolCluster extends BasePoolCluster {} +export interface Query extends BaseQuery {} +export interface Prepare extends BasePrepare {} + +export function createConnection(connectionUri: string): BaseConnection; +export function createConnection(config: ConnectionOptions): BaseConnection; + +export function createPool(connectionUri: string): BasePool; +export function createPool(config: PoolOptions): BasePool; + +export function createPoolCluster(config?: PoolClusterOptions): PoolCluster; + +type TimeZone = 'local' | 'Z' | (string & NonNullable); +export function escape( + value: any, + stringifyObjects?: boolean, + timeZone?: TimeZone +): string; + +export function escapeId(value: any, forbidQualified?: boolean): string; + +export function format(sql: string): string; +export function format( + sql: string, + values: any | any[], + stringifyObjects?: boolean, + timeZone?: TimeZone +): string; + +export function raw(sql: string): { + toSqlString: () => string; +}; + +export interface ConnectionConfig extends ConnectionOptions { + mergeFlags(defaultFlags: string[], userFlags: string[] | string): number; + getDefaultFlags(options?: ConnectionOptions): string[]; + getCharsetNumber(charset: string): number; + getSSLProfile(name: string): { ca: string[] }; + parseUrl(url: string): { + host: string; + port: number; + database: string; + user: string; + password: string; + [key: string]: any; + }; +} + +export function createServer(handler: (conn: BaseConnection) => any): Server; diff --git a/node_modules/mysql2/typings/mysql/info.txt b/node_modules/mysql2/typings/mysql/info.txt new file mode 100644 index 0000000..8ee9419 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/info.txt @@ -0,0 +1 @@ +temporary workaround, see https://github.com/sidorares/node-mysql2/issues/1210 diff --git a/node_modules/mysql2/typings/mysql/lib/Auth.d.ts b/node_modules/mysql2/typings/mysql/lib/Auth.d.ts new file mode 100644 index 0000000..c2adc98 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/Auth.d.ts @@ -0,0 +1,30 @@ +import { RsaPublicKey, RsaPrivateKey, KeyLike } from 'crypto'; +import { Connection } from './Connection.js'; + +export type AuthPlugin = (pluginMetadata: { + connection: Connection; + command: string; +}) => ( + pluginData: Buffer +) => Promise | string | Buffer | Promise | null; + +type AuthPluginDefinition = (pluginOptions?: T) => AuthPlugin; + +export const authPlugins: { + caching_sha2_password: AuthPluginDefinition<{ + overrideIsSecure?: boolean; + serverPublicKey?: RsaPublicKey | RsaPrivateKey | KeyLike; + onServerPublicKey?: (data: Buffer) => void; + }>; + mysql_clear_password: AuthPluginDefinition<{ + password?: string; + }>; + mysql_native_password: AuthPluginDefinition<{ + password?: string; + passwordSha1?: string; + }>; + sha256_password: AuthPluginDefinition<{ + serverPublicKey?: RsaPublicKey | RsaPrivateKey | KeyLike; + onServerPublicKey?: (data: Buffer) => void; + }>; +}; diff --git a/node_modules/mysql2/typings/mysql/lib/Connection.d.ts b/node_modules/mysql2/typings/mysql/lib/Connection.d.ts new file mode 100644 index 0000000..dffc2a8 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/Connection.d.ts @@ -0,0 +1,428 @@ +// This file was modified by Oracle on November 04, 2021. +// Type definitions and corresponding descriptions were introduced for the +// connection options relevant for multifactor authentication. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. + +import { EventEmitter } from 'events'; +import { Readable } from 'stream'; +import { Query, QueryError } from './protocol/sequences/Query.js'; +import { Prepare, PrepareStatementInfo } from './protocol/sequences/Prepare.js'; +import { + OkPacket, + FieldPacket, + RowDataPacket, + ResultSetHeader, + OkPacketParams, + ErrorPacketParams, +} from './protocol/packets/index.js'; +import { Connection as PromiseConnection } from '../../../promise.js'; +import { AuthPlugin } from './Auth.js'; +import { QueryableBase } from './protocol/sequences/QueryableBase.js'; +import { ExecutableBase } from './protocol/sequences/ExecutableBase.js'; +import { TypeCast } from './parsers/typeCast.js'; + +export interface SslOptions { + /** + * A string or buffer holding the PFX or PKCS12 encoded private key, certificate and CA certificates + */ + pfx?: string; + + /** + * Either a string/buffer or list of strings/Buffers holding the PEM encoded private key(s) to use + */ + key?: string | string[] | Buffer | Buffer[]; + + /** + * A string of passphrase for the private key or pfx + */ + passphrase?: string; + + /** + * A string/buffer or list of strings/Buffers holding the PEM encoded certificate(s) + */ + cert?: string | string[] | Buffer | Buffer[]; + + /** + * Either a string/Buffer or list of strings/Buffers of PEM encoded CA certificates to trust. + */ + ca?: string | string[] | Buffer | Buffer[]; + + /** + * Either a string or list of strings of PEM encoded CRLs (Certificate Revocation List) + */ + crl?: string | string[]; + + /** + * A string describing the ciphers to use or exclude + */ + ciphers?: string; + + /** + * You can also connect to a MySQL server without properly providing the appropriate CA to trust. You should not do this. + */ + rejectUnauthorized?: boolean; + + /** + * Configure the minimum supported version of SSL, the default is TLSv1.2. + */ + minVersion?: string; + + /** + * Configure the maximum supported version of SSL, the default is TLSv1.3. + */ + maxVersion?: string; + + /** + * You can verify the server name identity presented on the server certificate when connecting to a MySQL server. + * You should enable this but it is disabled by default right now for backwards compatibility. + */ + verifyIdentity?: boolean; +} + +export interface ConnectionOptions { + /** + * DECIMAL and NEWDECIMAL types will be returned as numbers if this option is set to `true` ( default: `false`). + */ + decimalNumbers?: boolean; + + /** + * The MySQL user to authenticate as + */ + user?: string; + + /** + * The password of that MySQL user + */ + password?: string; + + /** + * Alias for the MySQL user password. Makes a bit more sense in a multifactor authentication setup (see + * "password2" and "password3") + */ + password1?: string; + + /** + * 2nd factor authentication password. Mandatory when the authentication policy for the MySQL user account + * requires an additional authentication method that needs a password. + * https://dev.mysql.com/doc/refman/8.0/en/multifactor-authentication.html + */ + password2?: string; + + /** + * 3rd factor authentication password. Mandatory when the authentication policy for the MySQL user account + * requires two additional authentication methods and the last one needs a password. + * https://dev.mysql.com/doc/refman/8.0/en/multifactor-authentication.html + */ + password3?: string; + + /** + * Name of the database to use for this connection + */ + database?: string; + + /** + * The charset for the connection. This is called 'collation' in the SQL-level of MySQL (like utf8_general_ci). + * If a SQL-level charset is specified (like utf8mb4) then the default collation for that charset is used. + * (Default: 'UTF8_GENERAL_CI') + */ + charset?: string; + + /** + * The hostname of the database you are connecting to. (Default: localhost) + */ + host?: string; + + /** + * The port number to connect to. (Default: 3306) + */ + port?: number; + + /** + * The source IP address to use for TCP connection + */ + localAddress?: string; + + /** + * The path to a unix domain socket to connect to. When used host and port are ignored + */ + socketPath?: string; + + /** + * The timezone used to store local dates. (Default: 'local') + */ + timezone?: string | 'local'; + + /** + * The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10 seconds) + */ + connectTimeout?: number; + + /** + * Stringify objects instead of converting to values. (Default: 'false') + */ + stringifyObjects?: boolean; + + /** + * Allow connecting to MySQL instances that ask for the old (insecure) authentication method. (Default: false) + */ + insecureAuth?: boolean; + + /** + * By specifying a function that returns a readable stream, an arbitrary stream can be sent when sending a local fs file. + */ + infileStreamFactory?: (path: string) => Readable; + + /** + * Determines if column values should be converted to native JavaScript types. + * + * @default true + * + * It is not recommended (and may go away / change in the future) to disable type casting, but you can currently do so on either the connection or query level. + * + * --- + * + * You can also specify a function to do the type casting yourself: + * ```ts + * (field: Field, next: () => unknown) => { + * return next(); + * } + * ``` + * + * --- + * + * **WARNING:** + * + * YOU MUST INVOKE the parser using one of these three field functions in your custom typeCast callback. They can only be called once: + * + * ```js + * field.string(); + * field.buffer(); + * field.geometry(); + * ``` + + * Which are aliases for: + * + * ```js + * parser.parseLengthCodedString(); + * parser.parseLengthCodedBuffer(); + * parser.parseGeometryValue(); + * ``` + * + * You can find which field function you need to use by looking at `RowDataPacket.prototype._typeCast`. + */ + typeCast?: TypeCast; + + /** + * A custom query format function + */ + queryFormat?: (query: string, values: any) => void; + + /** + * When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option + * (Default: false) + */ + supportBigNumbers?: boolean; + + /** + * Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be + * always returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving + * bigNumberStrings disabled will return big numbers as String objects only when they cannot be accurately + * represented with [JavaScript Number objects](https://262.ecma-international.org/5.1/#sec-8.5) + * (which happens when they exceed the [-2^53, +2^53] range), otherwise they will be returned as Number objects. + * This option is ignored if supportBigNumbers is disabled. + */ + bigNumberStrings?: boolean; + + /** + * Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript Date + * objects. Can be true/false or an array of type names to keep as strings. + * + * (Default: false) + */ + dateStrings?: boolean | Array<'TIMESTAMP' | 'DATETIME' | 'DATE'>; + + /** + * This will print all incoming and outgoing packets on stdout. + * You can also restrict debugging to packet types by passing an array of types (strings) to debug; + * + * (Default: false) + */ + debug?: any; + + /** + * Generates stack traces on Error to include call site of library entrance ('long stack traces'). Slight + * performance penalty for most calls. (Default: true) + */ + trace?: boolean; + + /** + * Allow multiple mysql statements per query. Be careful with this, it exposes you to SQL injection attacks. (Default: false) + */ + multipleStatements?: boolean; + + /** + * List of connection flags to use other than the default ones. It is also possible to blacklist default ones + */ + flags?: Array; + + /** + * object with ssl parameters or a string containing name of ssl profile + */ + ssl?: string | SslOptions; + + /** + * Return each row as an array, not as an object. + * This is useful when you have duplicate column names. + * This can also be set in the `QueryOption` object to be applied per-query. + */ + rowsAsArray?: boolean; + + /** + * Enable keep-alive on the socket. (Default: true) + */ + enableKeepAlive?: boolean; + + /** + * If keep-alive is enabled users can supply an initial delay. (Default: 0) + */ + keepAliveInitialDelay?: number; + + charsetNumber?: number; + + compress?: boolean; + + authSwitchHandler?: (data: any, callback: () => void) => any; + + connectAttributes?: { [param: string]: any }; + + isServer?: boolean; + + maxPreparedStatements?: number; + + namedPlaceholders?: boolean; + + nestTables?: boolean | string; + + passwordSha1?: string; + + pool?: any; + + stream?: any; + + uri?: string; + + connectionLimit?: number; + + maxIdle?: number; + + idleTimeout?: number; + + Promise?: any; + + queueLimit?: number; + + waitForConnections?: boolean; + + disableEval?: boolean; + + authPlugins?: { + [key: string]: AuthPlugin; + }; + + /** + * Force JSON to be returned as string + * + * (Default: false) + */ + jsonStrings?: boolean; +} + +declare class Connection extends QueryableBase(ExecutableBase(EventEmitter)) { + config: ConnectionOptions; + + threadId: number; + + authorized: boolean; + + static createQuery< + T extends + | RowDataPacket[][] + | RowDataPacket[] + | OkPacket + | OkPacket[] + | ResultSetHeader, + >( + sql: string, + callback?: (err: QueryError | null, result: T, fields: FieldPacket[]) => any + ): Query; + static createQuery< + T extends + | RowDataPacket[][] + | RowDataPacket[] + | OkPacket + | OkPacket[] + | ResultSetHeader, + >( + sql: string, + values: any | any[] | { [param: string]: any }, + callback?: (err: QueryError | null, result: T, fields: FieldPacket[]) => any + ): Query; + + beginTransaction(callback: (err: QueryError | null) => void): void; + + connect(callback?: (err: QueryError | null) => void): void; + + commit(callback?: (err: QueryError | null) => void): void; + + changeUser( + options: ConnectionOptions, + callback?: (err: QueryError | null) => void + ): void; + + end(callback?: (err: QueryError | null) => void): void; + end(options: any, callback?: (err: QueryError | null) => void): void; + + destroy(): void; + + pause(): void; + + resume(): void; + + escape(value: any): string; + + escapeId(value: string): string; + escapeId(values: string[]): string; + + format(sql: string, values?: any | any[] | { [param: string]: any }): string; + + on(event: string, listener: (...args: any[]) => void): this; + + rollback(callback: (err: QueryError | null) => void): void; + + prepare( + sql: string, + callback?: (err: QueryError | null, statement: PrepareStatementInfo) => any + ): Prepare; + + unprepare(sql: string): PrepareStatementInfo; + + serverHandshake(args: any): any; + + promise(promiseImpl?: PromiseConstructor): PromiseConnection; + + ping(callback?: (err: QueryError | null) => any): void; + + writeOk(args?: OkPacketParams): void; + + writeError(args?: ErrorPacketParams): void; + + writeEof(warnings?: number, statusFlags?: number): void; + + writeTextResult(rows?: Array, columns?: Array): void; + + writePacket(packet: any): void; + + sequenceId: number; +} + +export { Connection }; diff --git a/node_modules/mysql2/typings/mysql/lib/Pool.d.ts b/node_modules/mysql2/typings/mysql/lib/Pool.d.ts new file mode 100644 index 0000000..90ed5e9 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/Pool.d.ts @@ -0,0 +1,69 @@ +import { EventEmitter } from 'events'; +import { PrepareStatementInfo } from './protocol/sequences/Prepare.js'; +import { ConnectionOptions } from './Connection.js'; +import { PoolConnection } from './PoolConnection.js'; +import { + Pool as PromisePool, + PoolConnection as PromisePoolConnection, +} from '../../../promise.js'; +import { QueryableBase } from './protocol/sequences/QueryableBase.js'; +import { ExecutableBase } from './protocol/sequences/ExecutableBase.js'; + +export interface PoolOptions extends ConnectionOptions { + /** + * Determines the pool's action when no connections are available and the limit has been reached. If true, the pool will queue + * the connection request and call it when one becomes available. If false, the pool will immediately call back with an error. + * (Default: true) + */ + waitForConnections?: boolean; + + /** + * The maximum number of connections to create at once. (Default: 10) + */ + connectionLimit?: number; + + /** + * The maximum number of idle connections. (Default: same as `connectionLimit`) + */ + maxIdle?: number; + + /** + * The idle connections timeout, in milliseconds. (Default: 60000) + */ + idleTimeout?: number; + + /** + * The maximum number of connection requests the pool will queue before returning an error from getConnection. If set to 0, there + * is no limit to the number of queued connection requests. (Default: 0) + */ + queueLimit?: number; +} + +declare class Pool extends QueryableBase(ExecutableBase(EventEmitter)) { + getConnection( + callback: ( + err: NodeJS.ErrnoException | null, + connection: PoolConnection + ) => any + ): void; + + releaseConnection(connection: PoolConnection | PromisePoolConnection): void; + + end( + callback?: (err: NodeJS.ErrnoException | null, ...args: any[]) => any + ): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'connection', listener: (connection: PoolConnection) => any): this; + on(event: 'acquire', listener: (connection: PoolConnection) => any): this; + on(event: 'release', listener: (connection: PoolConnection) => any): this; + on(event: 'enqueue', listener: () => any): this; + + unprepare(sql: string): PrepareStatementInfo; + + promise(promiseImpl?: PromiseConstructor): PromisePool; + + config: PoolOptions; +} + +export { Pool }; diff --git a/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts b/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts new file mode 100644 index 0000000..d4c538e --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts @@ -0,0 +1,90 @@ +import { EventEmitter } from 'events'; +import { PoolConnection } from './PoolConnection.js'; +import { PoolOptions } from './Pool.js'; +import { ExecutableBase as ExecutableBaseClass } from './protocol/sequences/ExecutableBase.js'; +import { QueryableBase as QueryableBaseClass } from './protocol/sequences/QueryableBase.js'; + +// Expose class interfaces +declare class QueryableAndExecutableBase extends QueryableBaseClass( + ExecutableBaseClass(EventEmitter) +) {} + +export interface PoolClusterOptions { + /** + * If true, PoolCluster will attempt to reconnect when connection fails. (Default: true) + */ + canRetry?: boolean; + + /** + * If connection fails, node's errorCount increases. When errorCount is greater than removeNodeErrorCount, + * remove a node in the PoolCluster. (Default: 5) + */ + removeNodeErrorCount?: number; + + /** + * If connection fails, specifies the number of milliseconds before another connection attempt will be made. + * If set to 0, then node will be removed instead and never re-used. (Default: 0) + */ + restoreNodeTimeout?: number; + + /** + * The default selector. (Default: RR) + * RR: Select one alternately. (Round-Robin) + * RANDOM: Select the node by random function. + * ORDER: Select the first node available unconditionally. + */ + defaultSelector?: string; +} + +export interface PoolNamespace extends QueryableAndExecutableBase { + getConnection( + callback: ( + err: NodeJS.ErrnoException | null, + connection: PoolConnection + ) => any + ): void; +} + +declare class PoolCluster extends EventEmitter { + config: PoolClusterOptions; + + add(config: PoolOptions): void; + add(group: string, connectionUri: string): void; + add(group: string, config: PoolOptions): void; + + remove(pattern: string): void; + + end(): void; + + getConnection( + callback: ( + err: NodeJS.ErrnoException | null, + connection: PoolConnection + ) => void + ): void; + getConnection( + group: string, + callback: ( + err: NodeJS.ErrnoException | null, + connection: PoolConnection + ) => void + ): void; + getConnection( + group: string, + selector: string, + callback: ( + err: NodeJS.ErrnoException | null, + connection: PoolConnection + ) => void + ): void; + + of(pattern: string, selector?: string): PoolNamespace; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'online', listener: (nodeId: number) => void): this; + on(event: 'offline', listener: (nodeId: number) => void): this; + on(event: 'remove', listener: (nodeId: number) => void): this; + on(event: 'warn', listener: (err: Error) => void): this; +} + +export { PoolCluster }; diff --git a/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts b/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts new file mode 100644 index 0000000..cce4ef7 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/PoolConnection.d.ts @@ -0,0 +1,10 @@ +import { Connection } from './Connection.js'; +import { Pool as PromisePool } from '../../../promise.js'; + +declare class PoolConnection extends Connection { + connection: Connection; + release(): void; + promise(promiseImpl?: PromiseConstructor): PromisePool; +} + +export { PoolConnection }; diff --git a/node_modules/mysql2/typings/mysql/lib/Server.d.ts b/node_modules/mysql2/typings/mysql/lib/Server.d.ts new file mode 100644 index 0000000..195adee --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/Server.d.ts @@ -0,0 +1,11 @@ +import { EventEmitter } from 'events'; +import { Connection } from './Connection.js'; + +declare class Server extends EventEmitter { + connections: Array; + + listen(port: number): Server; + close(callback: (error: Error, count: number) => any): void; +} + +export { Server }; diff --git a/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts b/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts new file mode 100644 index 0000000..aa28389 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/constants/CharsetToEncoding.d.ts @@ -0,0 +1,8 @@ +/** + * Constant `CharsetToEncoding`. + * + * Please note that `CharsetToEncoding` can only be accessed from the `mysql` object and not imported directly. + */ +declare const CharsetToEncoding: string[]; + +export { CharsetToEncoding }; diff --git a/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts b/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts new file mode 100644 index 0000000..0b35769 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/constants/Charsets.d.ts @@ -0,0 +1,326 @@ +interface Charsets { + BIG5_CHINESE_CI: number; + LATIN2_CZECH_CS: number; + DEC8_SWEDISH_CI: number; + CP850_GENERAL_CI: number; + LATIN1_GERMAN1_CI: number; + HP8_ENGLISH_CI: number; + KOI8R_GENERAL_CI: number; + LATIN1_SWEDISH_CI: number; + LATIN2_GENERAL_CI: number; + SWE7_SWEDISH_CI: number; + ASCII_GENERAL_CI: number; + UJIS_JAPANESE_CI: number; + SJIS_JAPANESE_CI: number; + CP1251_BULGARIAN_CI: number; + LATIN1_DANISH_CI: number; + HEBREW_GENERAL_CI: number; + TIS620_THAI_CI: number; + EUCKR_KOREAN_CI: number; + LATIN7_ESTONIAN_CS: number; + LATIN2_HUNGARIAN_CI: number; + KOI8U_GENERAL_CI: number; + CP1251_UKRAINIAN_CI: number; + GB2312_CHINESE_CI: number; + GREEK_GENERAL_CI: number; + CP1250_GENERAL_CI: number; + LATIN2_CROATIAN_CI: number; + GBK_CHINESE_CI: number; + CP1257_LITHUANIAN_CI: number; + LATIN5_TURKISH_CI: number; + LATIN1_GERMAN2_CI: number; + ARMSCII8_GENERAL_CI: number; + UTF8_GENERAL_CI: number; + CP1250_CZECH_CS: number; + UCS2_GENERAL_CI: number; + CP866_GENERAL_CI: number; + KEYBCS2_GENERAL_CI: number; + MACCE_GENERAL_CI: number; + MACROMAN_GENERAL_CI: number; + CP852_GENERAL_CI: number; + LATIN7_GENERAL_CI: number; + LATIN7_GENERAL_CS: number; + MACCE_BIN: number; + CP1250_CROATIAN_CI: number; + UTF8MB4_GENERAL_CI: number; + UTF8MB4_BIN: number; + LATIN1_BIN: number; + LATIN1_GENERAL_CI: number; + LATIN1_GENERAL_CS: number; + CP1251_BIN: number; + CP1251_GENERAL_CI: number; + CP1251_GENERAL_CS: number; + MACROMAN_BIN: number; + UTF16_GENERAL_CI: number; + UTF16_BIN: number; + UTF16LE_GENERAL_CI: number; + CP1256_GENERAL_CI: number; + CP1257_BIN: number; + CP1257_GENERAL_CI: number; + UTF32_GENERAL_CI: number; + UTF32_BIN: number; + UTF16LE_BIN: number; + BINARY: number; + ARMSCII8_BIN: number; + ASCII_BIN: number; + CP1250_BIN: number; + CP1256_BIN: number; + CP866_BIN: number; + DEC8_BIN: number; + GREEK_BIN: number; + HEBREW_BIN: number; + HP8_BIN: number; + KEYBCS2_BIN: number; + KOI8R_BIN: number; + KOI8U_BIN: number; + UTF8_TOLOWER_CI: number; + LATIN2_BIN: number; + LATIN5_BIN: number; + LATIN7_BIN: number; + CP850_BIN: number; + CP852_BIN: number; + SWE7_BIN: number; + UTF8_BIN: number; + BIG5_BIN: number; + EUCKR_BIN: number; + GB2312_BIN: number; + GBK_BIN: number; + SJIS_BIN: number; + TIS620_BIN: number; + UCS2_BIN: number; + UJIS_BIN: number; + GEOSTD8_GENERAL_CI: number; + GEOSTD8_BIN: number; + LATIN1_SPANISH_CI: number; + CP932_JAPANESE_CI: number; + CP932_BIN: number; + EUCJPMS_JAPANESE_CI: number; + EUCJPMS_BIN: number; + CP1250_POLISH_CI: number; + UTF16_UNICODE_CI: number; + UTF16_ICELANDIC_CI: number; + UTF16_LATVIAN_CI: number; + UTF16_ROMANIAN_CI: number; + UTF16_SLOVENIAN_CI: number; + UTF16_POLISH_CI: number; + UTF16_ESTONIAN_CI: number; + UTF16_SPANISH_CI: number; + UTF16_SWEDISH_CI: number; + UTF16_TURKISH_CI: number; + UTF16_CZECH_CI: number; + UTF16_DANISH_CI: number; + UTF16_LITHUANIAN_CI: number; + UTF16_SLOVAK_CI: number; + UTF16_SPANISH2_CI: number; + UTF16_ROMAN_CI: number; + UTF16_PERSIAN_CI: number; + UTF16_ESPERANTO_CI: number; + UTF16_HUNGARIAN_CI: number; + UTF16_SINHALA_CI: number; + UTF16_GERMAN2_CI: number; + UTF16_CROATIAN_CI: number; + UTF16_UNICODE_520_CI: number; + UTF16_VIETNAMESE_CI: number; + UCS2_UNICODE_CI: number; + UCS2_ICELANDIC_CI: number; + UCS2_LATVIAN_CI: number; + UCS2_ROMANIAN_CI: number; + UCS2_SLOVENIAN_CI: number; + UCS2_POLISH_CI: number; + UCS2_ESTONIAN_CI: number; + UCS2_SPANISH_CI: number; + UCS2_SWEDISH_CI: number; + UCS2_TURKISH_CI: number; + UCS2_CZECH_CI: number; + UCS2_DANISH_CI: number; + UCS2_LITHUANIAN_CI: number; + UCS2_SLOVAK_CI: number; + UCS2_SPANISH2_CI: number; + UCS2_ROMAN_CI: number; + UCS2_PERSIAN_CI: number; + UCS2_ESPERANTO_CI: number; + UCS2_HUNGARIAN_CI: number; + UCS2_SINHALA_CI: number; + UCS2_GERMAN2_CI: number; + UCS2_CROATIAN_CI: number; + UCS2_UNICODE_520_CI: number; + UCS2_VIETNAMESE_CI: number; + UCS2_GENERAL_MYSQL500_CI: number; + UTF32_UNICODE_CI: number; + UTF32_ICELANDIC_CI: number; + UTF32_LATVIAN_CI: number; + UTF32_ROMANIAN_CI: number; + UTF32_SLOVENIAN_CI: number; + UTF32_POLISH_CI: number; + UTF32_ESTONIAN_CI: number; + UTF32_SPANISH_CI: number; + UTF32_SWEDISH_CI: number; + UTF32_TURKISH_CI: number; + UTF32_CZECH_CI: number; + UTF32_DANISH_CI: number; + UTF32_LITHUANIAN_CI: number; + UTF32_SLOVAK_CI: number; + UTF32_SPANISH2_CI: number; + UTF32_ROMAN_CI: number; + UTF32_PERSIAN_CI: number; + UTF32_ESPERANTO_CI: number; + UTF32_HUNGARIAN_CI: number; + UTF32_SINHALA_CI: number; + UTF32_GERMAN2_CI: number; + UTF32_CROATIAN_CI: number; + UTF32_UNICODE_520_CI: number; + UTF32_VIETNAMESE_CI: number; + UTF8_UNICODE_CI: number; + UTF8_ICELANDIC_CI: number; + UTF8_LATVIAN_CI: number; + UTF8_ROMANIAN_CI: number; + UTF8_SLOVENIAN_CI: number; + UTF8_POLISH_CI: number; + UTF8_ESTONIAN_CI: number; + UTF8_SPANISH_CI: number; + UTF8_SWEDISH_CI: number; + UTF8_TURKISH_CI: number; + UTF8_CZECH_CI: number; + UTF8_DANISH_CI: number; + UTF8_LITHUANIAN_CI: number; + UTF8_SLOVAK_CI: number; + UTF8_SPANISH2_CI: number; + UTF8_ROMAN_CI: number; + UTF8_PERSIAN_CI: number; + UTF8_ESPERANTO_CI: number; + UTF8_HUNGARIAN_CI: number; + UTF8_SINHALA_CI: number; + UTF8_GERMAN2_CI: number; + UTF8_CROATIAN_CI: number; + UTF8_UNICODE_520_CI: number; + UTF8_VIETNAMESE_CI: number; + UTF8_GENERAL_MYSQL500_CI: number; + UTF8MB4_UNICODE_CI: number; + UTF8MB4_ICELANDIC_CI: number; + UTF8MB4_LATVIAN_CI: number; + UTF8MB4_ROMANIAN_CI: number; + UTF8MB4_SLOVENIAN_CI: number; + UTF8MB4_POLISH_CI: number; + UTF8MB4_ESTONIAN_CI: number; + UTF8MB4_SPANISH_CI: number; + UTF8MB4_SWEDISH_CI: number; + UTF8MB4_TURKISH_CI: number; + UTF8MB4_CZECH_CI: number; + UTF8MB4_DANISH_CI: number; + UTF8MB4_LITHUANIAN_CI: number; + UTF8MB4_SLOVAK_CI: number; + UTF8MB4_SPANISH2_CI: number; + UTF8MB4_ROMAN_CI: number; + UTF8MB4_PERSIAN_CI: number; + UTF8MB4_ESPERANTO_CI: number; + UTF8MB4_HUNGARIAN_CI: number; + UTF8MB4_SINHALA_CI: number; + UTF8MB4_GERMAN2_CI: number; + UTF8MB4_CROATIAN_CI: number; + UTF8MB4_UNICODE_520_CI: number; + UTF8MB4_VIETNAMESE_CI: number; + GB18030_CHINESE_CI: number; + GB18030_BIN: number; + GB18030_UNICODE_520_CI: number; + /** @deprecated */ + UTF8_GENERAL50_CI: number; + UTF8MB4_0900_AI_CI: number; + UTF8MB4_DE_PB_0900_AI_CI: number; + UTF8MB4_IS_0900_AI_CI: number; + UTF8MB4_LV_0900_AI_CI: number; + UTF8MB4_RO_0900_AI_CI: number; + UTF8MB4_SL_0900_AI_CI: number; + UTF8MB4_PL_0900_AI_CI: number; + UTF8MB4_ET_0900_AI_CI: number; + UTF8MB4_ES_0900_AI_CI: number; + UTF8MB4_SV_0900_AI_CI: number; + UTF8MB4_TR_0900_AI_CI: number; + UTF8MB4_CS_0900_AI_CI: number; + UTF8MB4_DA_0900_AI_CI: number; + UTF8MB4_LT_0900_AI_CI: number; + UTF8MB4_SK_0900_AI_CI: number; + UTF8MB4_ES_TRAD_0900_AI_CI: number; + UTF8MB4_LA_0900_AI_CI: number; + UTF8MB4_EO_0900_AI_CI: number; + UTF8MB4_HU_0900_AI_CI: number; + UTF8MB4_HR_0900_AI_CI: number; + UTF8MB4_VI_0900_AI_CI: number; + UTF8MB4_0900_AS_CS: number; + UTF8MB4_DE_PB_0900_AS_CS: number; + UTF8MB4_IS_0900_AS_CS: number; + UTF8MB4_LV_0900_AS_CS: number; + UTF8MB4_RO_0900_AS_CS: number; + UTF8MB4_SL_0900_AS_CS: number; + UTF8MB4_PL_0900_AS_CS: number; + UTF8MB4_ET_0900_AS_CS: number; + UTF8MB4_ES_0900_AS_CS: number; + UTF8MB4_SV_0900_AS_CS: number; + UTF8MB4_TR_0900_AS_CS: number; + UTF8MB4_CS_0900_AS_CS: number; + UTF8MB4_DA_0900_AS_CS: number; + UTF8MB4_LT_0900_AS_CS: number; + UTF8MB4_SK_0900_AS_CS: number; + UTF8MB4_ES_TRAD_0900_AS_CS: number; + UTF8MB4_LA_0900_AS_CS: number; + UTF8MB4_EO_0900_AS_CS: number; + UTF8MB4_HU_0900_AS_CS: number; + UTF8MB4_HR_0900_AS_CS: number; + UTF8MB4_VI_0900_AS_CS: number; + UTF8MB4_JA_0900_AS_CS: number; + UTF8MB4_JA_0900_AS_CS_KS: number; + UTF8MB4_0900_AS_CI: number; + UTF8MB4_RU_0900_AI_CI: number; + UTF8MB4_RU_0900_AS_CS: number; + UTF8MB4_ZH_0900_AS_CS: number; + UTF8MB4_0900_BIN: number; + + BIG5: number; + DEC8: number; + CP850: number; + HP8: number; + KOI8R: number; + LATIN1: number; + LATIN2: number; + SWE7: number; + ASCII: number; + UJIS: number; + SJIS: number; + HEBREW: number; + TIS620: number; + EUCKR: number; + KOI8U: number; + GB2312: number; + GREEK: number; + CP1250: number; + GBK: number; + LATIN5: number; + ARMSCII8: number; + UTF8: number; + UCS2: number; + CP866: number; + KEYBCS2: number; + MACCE: number; + MACROMAN: number; + CP852: number; + LATIN7: number; + UTF8MB4: number; + CP1251: number; + UTF16: number; + UTF16LE: number; + CP1256: number; + CP1257: number; + UTF32: number; + CP932: number; + EUCJPMS: number; + GB18030: number; + GEOSTD8: number; +} + +/** + * Constant `Charsets`. + * + * Please note that `Charsets` can only be accessed from the `mysql` object and not imported directly. + */ +declare const Charsets: Charsets; + +export { Charsets }; diff --git a/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts b/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts new file mode 100644 index 0000000..2719509 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/constants/Types.d.ts @@ -0,0 +1,70 @@ +interface Types { + 0x00: string; + 0x01: string; + 0x02: string; + 0x03: string; + 0x04: string; + 0x05: string; + 0x06: string; + 0x07: string; + 0x08: string; + 0x09: string; + 0x0a: string; + 0x0b: string; + 0x0c: string; + 0x0d: string; + 0x0e: string; + 0x0f: string; + 0x10: string; + 0xf2: string; + 0xf5: string; + 0xf6: string; + 0xf7: string; + 0xf8: string; + 0xf9: string; + 0xfa: string; + 0xfb: string; + 0xfc: string; + 0xfd: string; + 0xfe: string; + 0xff: string; + + DECIMAL: number; + TINY: number; + SHORT: number; + LONG: number; + FLOAT: number; + DOUBLE: number; + NULL: number; + TIMESTAMP: number; + LONGLONG: number; + INT24: number; + DATE: number; + TIME: number; + DATETIME: number; + YEAR: number; + NEWDATE: number; + VARCHAR: number; + BIT: number; + VECTOR: number; + JSON: number; + NEWDECIMAL: number; + ENUM: number; + SET: number; + TINY_BLOB: number; + MEDIUM_BLOB: number; + LONG_BLOB: number; + BLOB: number; + VAR_STRING: number; + STRING: number; + GEOMETRY: number; +} + +/** + * Constant `Types`. + * + * Please note that `Types` can only be accessed from the `mysql` object and not imported directly. + */ +declare const Types: Types; + +export { Types }; diff --git a/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts b/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts new file mode 100644 index 0000000..d08ba2c --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/constants/index.d.ts @@ -0,0 +1,5 @@ +import { Types } from './Types.js'; +import { Charsets } from './Charsets.js'; +import { CharsetToEncoding } from './CharsetToEncoding.js'; + +export { Types, Charsets, CharsetToEncoding }; diff --git a/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts b/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts new file mode 100644 index 0000000..0f1e7fa --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/parsers/ParserCache.d.ts @@ -0,0 +1,4 @@ +declare function setMaxParserCache(max: number): void; +declare function clearParserCache(): void; + +export { setMaxParserCache, clearParserCache }; diff --git a/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts b/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts new file mode 100644 index 0000000..734c4d9 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/parsers/index.d.ts @@ -0,0 +1,18 @@ +import { setMaxParserCache, clearParserCache } from './ParserCache.js'; +import { + TypeCast, + Field as TypeCastField, + Geometry as TypeCastGeometry, + Next as TypeCastNext, + Type as TypeCastType, +} from './typeCast.js'; + +export { + setMaxParserCache, + clearParserCache, + TypeCast, + TypeCastField, + TypeCastGeometry, + TypeCastNext, + TypeCastType, +}; diff --git a/node_modules/mysql2/typings/mysql/lib/parsers/typeCast.d.ts b/node_modules/mysql2/typings/mysql/lib/parsers/typeCast.d.ts new file mode 100644 index 0000000..7d62b98 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/parsers/typeCast.d.ts @@ -0,0 +1,54 @@ +export type Geometry = { + x: number; + y: number; +}; + +export type Type = { + type: + | 'DECIMAL' + | 'TINY' + | 'SHORT' + | 'LONG' + | 'FLOAT' + | 'DOUBLE' + | 'NULL' + | 'TIMESTAMP' + | 'TIMESTAMP2' + | 'LONGLONG' + | 'INT24' + | 'DATE' + | 'TIME' + | 'TIME2' + | 'DATETIME' + | 'DATETIME2' + | 'YEAR' + | 'NEWDATE' + | 'VARCHAR' + | 'BIT' + | 'VECTOR' + | 'JSON' + | 'NEWDECIMAL' + | 'ENUM' + | 'SET' + | 'TINY_BLOB' + | 'MEDIUM_BLOB' + | 'LONG_BLOB' + | 'BLOB' + | 'VAR_STRING' + | 'STRING' + | 'GEOMETRY'; +}; + +export type Field = Type & { + length: number; + db: string; + table: string; + name: string; + string: (encoding?: BufferEncoding | string | undefined) => string | null; + buffer: () => Buffer | null; + geometry: () => Geometry | Geometry[] | null; +}; + +export type Next = () => unknown; + +export type TypeCast = ((field: Field, next: Next) => any) | boolean; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts new file mode 100644 index 0000000..a8c1690 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/packets/Field.d.ts @@ -0,0 +1,10 @@ +// TODO (major version): remove workaround for `Field` compatibility. +import { TypeCastField } from '../../../lib/parsers/index.js'; + +/** + * @deprecated + * `Field` is deprecated and might be removed in the future major release. Please use `TypeCastField` type instead. + */ +declare interface Field extends TypeCastField {} + +export { Field }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts new file mode 100644 index 0000000..7e88669 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/packets/FieldPacket.d.ts @@ -0,0 +1,27 @@ +declare interface FieldPacket { + constructor: { + name: 'FieldPacket'; + }; + catalog: string; + charsetNr?: number; + db?: string; + schema?: string; + characterSet?: number; + decimals: number; + default?: any; + flags: number | string[]; + length?: number; + name: string; + orgName: string; + orgTable: string; + protocol41?: boolean; + table: string; + type?: number; + columnType?: number; + zerofill?: boolean; + typeName?: string; + encoding?: string; + columnLength?: number; +} + +export { FieldPacket }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts new file mode 100644 index 0000000..056e960 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/packets/OkPacket.d.ts @@ -0,0 +1,23 @@ +/** + * @deprecated + * `OkPacket` is deprecated and might be removed in the future major release. Please use `ResultSetHeader` instead. + */ +declare interface OkPacket { + constructor: { + name: 'OkPacket'; + }; + fieldCount: number; + affectedRows: number; + /** + * @deprecated + * `changedRows` is deprecated and might be removed in the future major release. Please use `affectedRows` property instead. + */ + changedRows: number; + insertId: number; + serverStatus: number; + warningCount: number; + message: string; + protocol41: boolean; +} + +export { OkPacket }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts new file mode 100644 index 0000000..ff5efb6 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/packets/ProcedurePacket.d.ts @@ -0,0 +1,13 @@ +import { OkPacket } from './OkPacket.js'; +import { ResultSetHeader } from './ResultSetHeader.js'; +import { RowDataPacket } from './RowDataPacket.js'; + +declare type ProcedureCallPacket< + T = [RowDataPacket[], ResultSetHeader] | ResultSetHeader, +> = T extends RowDataPacket[] + ? [T, ResultSetHeader] + : T extends ResultSetHeader | OkPacket + ? ResultSetHeader + : [RowDataPacket[], ResultSetHeader] | ResultSetHeader; + +export { ProcedureCallPacket }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts new file mode 100644 index 0000000..00b596f --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/packets/ResultSetHeader.d.ts @@ -0,0 +1,18 @@ +declare interface ResultSetHeader { + constructor: { + name: 'ResultSetHeader'; + }; + affectedRows: number; + fieldCount: number; + info: string; + insertId: number; + serverStatus: number; + warningStatus: number; + /** + * @deprecated + * `changedRows` is deprecated and might be removed in the future major release. Please use `affectedRows` property instead. + */ + changedRows: number; +} + +export { ResultSetHeader }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts new file mode 100644 index 0000000..d9cac1b --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/packets/RowDataPacket.d.ts @@ -0,0 +1,9 @@ +declare interface RowDataPacket { + constructor: { + name: 'RowDataPacket'; + }; + [column: string]: any; + [column: number]: any; +} + +export { RowDataPacket }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts new file mode 100644 index 0000000..352abd2 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/packets/index.d.ts @@ -0,0 +1,28 @@ +import { OkPacket } from './OkPacket.js'; +import { RowDataPacket } from './RowDataPacket.js'; +import { FieldPacket } from './FieldPacket.js'; +import { Field } from './Field.js'; +import { ProcedureCallPacket } from './ProcedurePacket.js'; +import { ResultSetHeader } from './ResultSetHeader.js'; +import { OkPacketParams } from './params/OkPacketParams.js'; +import { ErrorPacketParams } from './params/ErrorPacketParams.js'; + +export type QueryResult = + | OkPacket + | ResultSetHeader + | ResultSetHeader[] + | RowDataPacket[] + | RowDataPacket[][] + | OkPacket[] + | ProcedureCallPacket; + +export { + OkPacket, + RowDataPacket, + FieldPacket, + Field, + ProcedureCallPacket, + ResultSetHeader, + OkPacketParams, + ErrorPacketParams, +}; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts new file mode 100644 index 0000000..dece3db --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts @@ -0,0 +1,6 @@ +declare interface ErrorPacketParams { + message?: string; + code?: number | string; +} + +export { ErrorPacketParams }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts new file mode 100644 index 0000000..a5d2d00 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts @@ -0,0 +1,9 @@ +declare interface OkPacketParams { + affectedRows?: number; + insertId?: number; + serverStatus?: number; + warningCount?: number; + message?: string; +} + +export { OkPacketParams }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts new file mode 100644 index 0000000..81e2802 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/ExecutableBase.d.ts @@ -0,0 +1,40 @@ +import { FieldPacket, QueryResult } from '../packets/index.js'; +import { + Query, + QueryError, + QueryOptions, + QueryableConstructor, +} from './Query.js'; + +export declare function ExecutableBase( + Base?: T +): { + new (...args: any[]): { + execute( + sql: string, + callback?: + | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) + | undefined + ): Query; + execute( + sql: string, + values: any, + callback?: + | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) + | undefined + ): Query; + execute( + options: QueryOptions, + callback?: + | ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any) + | undefined + ): Query; + execute( + options: QueryOptions, + values: any, + callback?: + | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) + | undefined + ): Query; + }; +} & T; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts new file mode 100644 index 0000000..e8c69dc --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Prepare.d.ts @@ -0,0 +1,65 @@ +import { Sequence } from './Sequence.js'; +import { Query, QueryError, StreamOptions } from '../sequences/Query.js'; +import { + OkPacket, + FieldPacket, + RowDataPacket, + ResultSetHeader, +} from '../packets/index.js'; +import { Readable } from 'stream'; + +export class PrepareStatementInfo { + close(): void; + execute< + T extends + | RowDataPacket[][] + | RowDataPacket[] + | OkPacket + | OkPacket[] + | ResultSetHeader, + >( + parameters: any | any[] | { [param: string]: any }, + callback?: (err: QueryError | null, result: T, fields: FieldPacket[]) => any + ): Query; +} + +declare class Prepare extends Sequence { + /** + * The SQL for a constructed query + */ + sql: string; + + /** + * Emits a query packet to start the query + */ + start(): void; + + /** + * Determines the packet class to use given the first byte of the packet. + * + * @param firstByte The first byte of the packet + * @param parser The packet parser + */ + determinePacket(firstByte: number, parser: any): any; + + /** + * Creates a Readable stream with the given options + * + * @param options The options for the stream. + */ + stream(options?: StreamOptions): Readable; + + on(event: string, listener: (args: []) => void): this; + on(event: 'error', listener: (err: QueryError) => any): this; + on( + event: 'fields', + listener: (fields: FieldPacket, index: number) => any + ): this; + on( + event: 'result', + listener: (result: RowDataPacket | OkPacket, index: number) => any + ): this; + on(event: 'end', listener: () => any): this; +} + +export { Prepare }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts new file mode 100644 index 0000000..eee40b7 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts @@ -0,0 +1,170 @@ +import { Sequence } from './Sequence.js'; +import { OkPacket, RowDataPacket, FieldPacket } from '../packets/index.js'; +import { Readable } from 'stream'; +import { TypeCast } from '../../parsers/typeCast.js'; + +export interface QueryOptions { + /** + * The SQL for the query + */ + sql: string; + + /** + * The values for the query + */ + values?: any | any[] | { [param: string]: any }; + + /** + * This overrides the namedPlaceholders option set at the connection level. + */ + namedPlaceholders?: boolean; + + /** + * Every operation takes an optional inactivity timeout option. This allows you to specify appropriate timeouts for + * operations. It is important to note that these timeouts are not part of the MySQL protocol, and rather timeout + * operations through the client. This means that when a timeout is reached, the connection it occurred on will be + * destroyed and no further operations can be performed. + */ + timeout?: number; + + /** + * Either a boolean or string. If true, tables will be nested objects. If string (e.g. '_'), tables will be + * nested as tableName_fieldName + */ + nestTables?: any; + + /** + * Determines if column values should be converted to native JavaScript types. + * + * @default true + * + * It is not recommended (and may go away / change in the future) to disable type casting, but you can currently do so on either the connection or query level. + * + * --- + * + * You can also specify a function to do the type casting yourself: + * ```ts + * (field: Field, next: () => unknown) => { + * return next(); + * } + * ``` + * + * --- + * + * **WARNING:** + * + * YOU MUST INVOKE the parser using one of these three field functions in your custom typeCast callback. They can only be called once: + * + * ```js + * field.string(); + * field.buffer(); + * field.geometry(); + * ``` + + * Which are aliases for: + * + * ```js + * parser.parseLengthCodedString(); + * parser.parseLengthCodedBuffer(); + * parser.parseGeometryValue(); + * ``` + * + * You can find which field function you need to use by looking at `RowDataPacket.prototype._typeCast`. + */ + typeCast?: TypeCast; + + /** + * This overrides the same option set at the connection level. + * + */ + rowsAsArray?: boolean; + + /** + * By specifying a function that returns a readable stream, an arbitrary stream can be sent when sending a local fs file. + */ + infileStreamFactory?: (path: string) => Readable; +} + +export interface StreamOptions { + /** + * Sets the max buffer size in objects of a stream + */ + highWaterMark?: number; + + /** + * The object mode of the stream (Default: true) + */ + objectMode?: any; +} + +export interface QueryError extends NodeJS.ErrnoException { + /** + * Either a MySQL server error (e.g. 'ER_ACCESS_DENIED_ERROR'), + * a node.js error (e.g. 'ECONNREFUSED') or an internal error + * (e.g. 'PROTOCOL_CONNECTION_LOST'). + */ + code: string; + + /** + * The sql state marker + */ + sqlStateMarker?: string; + + /** + * The sql state + */ + sqlState?: string; + + /** + * The field count + */ + fieldCount?: number; + + /** + * Boolean, indicating if this error is terminal to the connection object. + */ + fatal: boolean; +} + +declare class Query extends Sequence { + /** + * The SQL for a constructed query + */ + sql: string; + + /** + * Emits a query packet to start the query + */ + start(): void; + + /** + * Determines the packet class to use given the first byte of the packet. + * + * @param firstByte The first byte of the packet + * @param parser The packet parser + */ + determinePacket(firstByte: number, parser: any): any; + + /** + * Creates a Readable stream with the given options + * + * @param options The options for the stream. + */ + stream(options?: StreamOptions): Readable; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'error', listener: (err: QueryError) => any): this; + on( + event: 'fields', + listener: (fields: FieldPacket, index: number) => any + ): this; + on( + event: 'result', + listener: (result: RowDataPacket | OkPacket, index: number) => any + ): this; + on(event: 'end', listener: () => any): this; +} + +export type QueryableConstructor = new (...args: any[]) => T; + +export { Query }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts new file mode 100644 index 0000000..7d448ff --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/QueryableBase.d.ts @@ -0,0 +1,40 @@ +import { FieldPacket, QueryResult } from '../packets/index.js'; +import { + Query, + QueryError, + QueryOptions, + QueryableConstructor, +} from './Query.js'; + +export declare function QueryableBase( + Base?: T +): { + new (...args: any[]): { + query( + sql: string, + callback?: + | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) + | undefined + ): Query; + query( + sql: string, + values: any, + callback?: + | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) + | undefined + ): Query; + query( + options: QueryOptions, + callback?: + | ((err: QueryError | null, result: T, fields?: FieldPacket[]) => any) + | undefined + ): Query; + query( + options: QueryOptions, + values: any, + callback?: + | ((err: QueryError | null, result: T, fields: FieldPacket[]) => any) + | undefined + ): Query; + }; +} & T; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts new file mode 100644 index 0000000..05c91c3 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/Sequence.d.ts @@ -0,0 +1,5 @@ +import { EventEmitter } from 'events'; + +declare class Sequence extends EventEmitter {} + +export { Sequence }; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts new file mode 100644 index 0000000..d96602c --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/ExecutableBase.d.ts @@ -0,0 +1,21 @@ +import { FieldPacket, QueryResult } from '../../packets/index.js'; +import { QueryOptions, QueryableConstructor } from '../Query.js'; + +export declare function ExecutableBase( + Base?: T +): { + new (...args: any[]): { + execute(sql: string): Promise<[T, FieldPacket[]]>; + execute( + sql: string, + values: any + ): Promise<[T, FieldPacket[]]>; + execute( + options: QueryOptions + ): Promise<[T, FieldPacket[]]>; + execute( + options: QueryOptions, + values: any + ): Promise<[T, FieldPacket[]]>; + }; +} & T; diff --git a/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts new file mode 100644 index 0000000..d3ca021 --- /dev/null +++ b/node_modules/mysql2/typings/mysql/lib/protocol/sequences/promise/QueryableBase.d.ts @@ -0,0 +1,21 @@ +import { FieldPacket, QueryResult } from '../../packets/index.js'; +import { QueryOptions, QueryableConstructor } from '../Query.js'; + +export declare function QueryableBase( + Base?: T +): { + new (...args: any[]): { + query(sql: string): Promise<[T, FieldPacket[]]>; + query( + sql: string, + values: any + ): Promise<[T, FieldPacket[]]>; + query( + options: QueryOptions + ): Promise<[T, FieldPacket[]]>; + query( + options: QueryOptions, + values: any + ): Promise<[T, FieldPacket[]]>; + }; +} & T; diff --git a/node_modules/named-placeholders/LICENSE b/node_modules/named-placeholders/LICENSE new file mode 100644 index 0000000..bc0223f --- /dev/null +++ b/node_modules/named-placeholders/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Andrey Sidorov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/named-placeholders/README.md b/node_modules/named-placeholders/README.md new file mode 100644 index 0000000..5b88730 --- /dev/null +++ b/node_modules/named-placeholders/README.md @@ -0,0 +1,29 @@ +[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=sidorares&url=https://github.com/sidorares/named-placeholders&title=named-placeholders&language=&tags=github&category=software) + +[![NPM](https://nodei.co/npm/named-placeholders.png?downloads=true&stars=true)](https://nodei.co/npm/named-placeholders/) + +[![CI](https://github.com/mysqljs/named-placeholders/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/mysqljs/named-placeholders/actions/workflows/ci.yml) + +# named-placeholders + +compiles "select foo where foo.id = :bar and foo.baz < :baz" into "select foo where foo.id = ? and foo.baz < ?" + ["bar", "baz"] + +## usage + +```sh +npm install named-placeholders +``` + +see [this mysql2 discussion](https://github.com/sidorares/node-mysql2/issues/117) + +```js +var mysql = require('mysql'); +var toUnnamed = require('named-placeholders')(); + +var q = toUnnamed('select 1+:test', { test: 123}); +mysql.createConnection().query(q[0], q[1]); +``` + +## credits + +parser is based on @mscdex code of his excellent [node-mariasql](https://github.com/mscdex/node-mariasql) library diff --git a/node_modules/named-placeholders/index.js b/node_modules/named-placeholders/index.js new file mode 100644 index 0000000..3524ef5 --- /dev/null +++ b/node_modules/named-placeholders/index.js @@ -0,0 +1,179 @@ +'use strict'; + +// based on code from Brian White @mscdex mariasql library - https://github.com/mscdex/node-mariasql/blob/master/lib/Client.js#L272-L332 +// License: https://github.com/mscdex/node-mariasql/blob/master/LICENSE + +const RE_PARAM = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g, +DQUOTE = 34, +SQUOTE = 39, +BSLASH = 92; + +function parse(query) { + let ppos = RE_PARAM.exec(query); + let curpos = 0; + let start = 0; + let end; + const parts = []; + let inQuote = false; + let escape = false; + let qchr; + const tokens = []; + let qcnt = 0; + let lastTokenEndPos = 0; + let i; + + if (ppos) { + do { + for (i=curpos,end=ppos.index; i params[n])]; +} + +module.exports = createCompiler; +module.exports.toNumbered = toNumbered; diff --git a/node_modules/named-placeholders/package.json b/node_modules/named-placeholders/package.json new file mode 100644 index 0000000..3b7c987 --- /dev/null +++ b/node_modules/named-placeholders/package.json @@ -0,0 +1,32 @@ +{ + "name": "named-placeholders", + "version": "1.1.3", + "description": "sql named placeholders to unnamed compiler", + "main": "index.js", + "scripts": { + "test": "mocha" + }, + "repository": { + "type": "git", + "url": "https://github.com/sidorares/named-placeholders" + }, + "keywords": [ + "sql", + "pdo", + "named", + "placeholders" + ], + "engines": { + "node": ">=12.0.0" + }, + "author": "Andrey Sidorov ", + "files": [], + "license": "MIT", + "devDependencies": { + "mocha": "^5.2.0", + "should": "^13.2.3" + }, + "dependencies": { + "lru-cache": "^7.14.1" + } +} diff --git a/node_modules/seq-queue/.jshintrc b/node_modules/seq-queue/.jshintrc new file mode 100644 index 0000000..bb3389c --- /dev/null +++ b/node_modules/seq-queue/.jshintrc @@ -0,0 +1,19 @@ +{ + "predef": [ + "describe", + "it", + "before", + "after", + "window", + "__resources__" + ], + "es5": true, + "node": true, + "eqeqeq": true, + "undef": true, + "curly": true, + "bitwise": true, + "immed": false, + "newcap": true, + "nonew": true +} diff --git a/node_modules/seq-queue/.npmignore b/node_modules/seq-queue/.npmignore new file mode 100644 index 0000000..3995665 --- /dev/null +++ b/node_modules/seq-queue/.npmignore @@ -0,0 +1,3 @@ +.project +node_modules/ +lib/doc/ diff --git a/node_modules/seq-queue/AUTHORS b/node_modules/seq-queue/AUTHORS new file mode 100644 index 0000000..5174d23 --- /dev/null +++ b/node_modules/seq-queue/AUTHORS @@ -0,0 +1 @@ +* Yongchang Zhou \ No newline at end of file diff --git a/node_modules/seq-queue/LICENSE b/node_modules/seq-queue/LICENSE new file mode 100644 index 0000000..d4e3221 --- /dev/null +++ b/node_modules/seq-queue/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 Netease, Inc. and other pomelo contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/seq-queue/Makefile b/node_modules/seq-queue/Makefile new file mode 100644 index 0000000..76354ea --- /dev/null +++ b/node_modules/seq-queue/Makefile @@ -0,0 +1,9 @@ +TESTS = test/*.js +REPORTER = spec +TIMEOUT = 5000 + +test: + @./node_modules/.bin/mocha \ + --reporter $(REPORTER) --timeout $(TIMEOUT) $(TESTS) + +.PHONY: test \ No newline at end of file diff --git a/node_modules/seq-queue/README.md b/node_modules/seq-queue/README.md new file mode 100644 index 0000000..4f21a71 --- /dev/null +++ b/node_modules/seq-queue/README.md @@ -0,0 +1,75 @@ +seq-queue - queue to keep request process in sequence +===================================================== + +Seq-queue is simple tool to keep requests to be executed in order. + +As we known, Node.js codes run in asynchronous mode and the callbacks are unordered. But sometimes we may need the requests to be processed in order. For example, in a game, a player would do some operations such as turn right and go ahead. And in the server side, we would like to process these requests one by one, not do them all at the same time. + +Seq-queue takes the responsibility to make the asynchronous, unordered processing flow into serial and ordered. It's simple but not a repeated wheel. + +Seq-queue is a FIFO task queue and we can push tasks as we wish, anytime(before the queue closed), anywhere(if we hold the queue instance). A task is known as a function and we can do anything in the function and just need to call `task.done()` to tell the queue current task has finished. It promises that a task in queue would not be executed util all tasks before it finished. + +Seq-queue add timeout for each task execution. If a task throws an uncaught exception in its call back or a developer forgets to call `task.done()` callback, queue would be blocked and would not execute the left tasks. To avoid these situations, seq-queue set a timeout for each task. If a task timeout, queue would drop the task and notify develop by a 'timeout' event and then invoke the next task. Any `task.done()` invoked in a timeout task would be ignored. + + * Tags: node.js + +##Installation +``` +npm install seq-queue +``` + +##Usage +``` javascript +var seqqueue = require('seq-queue'); + +var queue = seqqueue.createQueue(1000); + +queue.push( + function(task) { + setTimeout(function() { + console.log('hello '); + task.done(); + }, 500); + }, + function() { + console.log('task timeout'); + }, + 1000 +); + +queue.push( + function(task) { + setTimeout(function() { + console.log('world~'); + task.done(); + }, 500); + } +); +``` + +##API +###seqqueue.createQueue(timeout) +Create a new queue instance. A global timeout value in ms for the new instance can be set by `timeout` parameter or use the default timeout (3s) by no parameter. + +###queue.push(fn, ontimeout, timeout) +Add a task into the queue instance. +####Arguments ++ fn(task) - The function that describes the content of task and would be invoke by queue. `fn` takes a arguemnt task and we *must* call task.done() to tell queue current task has finished. ++ ontimeout() - Callback for task timeout. ++ timeout - Timeout in ms for `fn`. If specified, it would overwrite the global timeout that set by `createQueue` for `fn`. + +###queue.close(force) +Close the queue. A closed queue would stop receiving new task immediately. And the left tasks would be treated in different ways decided by `force`. +####Arguments ++ force - If true, queue would stop working immediately and ignore any tasks left in queue. Otherwise queue would execute the tasks in queue and then stop. + +##Event +Seq-queue instances extend the EventEmitter and would emit events in their life cycles. +###'timeout'(totask) +If current task not invoke task.done() within the timeout ms, a timeout event would be emit. totask.fn and totask.timeout is the `fn` and `timeout` arguments that passed by `queue.push(2)`. +###'error'(err, task) +If the task function (not callbacks) throws an uncaught error, queue would emit an error event and passes the err and task informations by event callback arguments. +###'closed' +Emit when the close(false) is invoked. +###'drained' +Emit when close(true) is invoked or all tasks left have finished in closed status. diff --git a/node_modules/seq-queue/index.js b/node_modules/seq-queue/index.js new file mode 100644 index 0000000..51029d8 --- /dev/null +++ b/node_modules/seq-queue/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/seq-queue'); \ No newline at end of file diff --git a/node_modules/seq-queue/lib/.npmignore b/node_modules/seq-queue/lib/.npmignore new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/seq-queue/lib/seq-queue.js b/node_modules/seq-queue/lib/seq-queue.js new file mode 100644 index 0000000..f13f285 --- /dev/null +++ b/node_modules/seq-queue/lib/seq-queue.js @@ -0,0 +1,199 @@ +var EventEmitter = require('events').EventEmitter; +var util = require('util'); + +var DEFAULT_TIMEOUT = 3000; +var INIT_ID = 0; +var EVENT_CLOSED = 'closed'; +var EVENT_DRAINED = 'drained'; + +/** + * Instance a new queue + * + * @param {Number} timeout a global timeout for new queue + * @class + * @constructor + */ +var SeqQueue = function(timeout) { + EventEmitter.call(this); + + if(timeout && timeout > 0) { + this.timeout = timeout; + } else { + this.timeout = DEFAULT_TIMEOUT; + } + + this.status = SeqQueueManager.STATUS_IDLE; + this.curId = INIT_ID; + this.queue = []; +}; +util.inherits(SeqQueue, EventEmitter); + +/** + * Add a task into queue. + * + * @param fn new request + * @param ontimeout callback when task timeout + * @param timeout timeout for current request. take the global timeout if this is invalid + * @returns true or false + */ +SeqQueue.prototype.push = function(fn, ontimeout, timeout) { + if(this.status !== SeqQueueManager.STATUS_IDLE && this.status !== SeqQueueManager.STATUS_BUSY) { + //ignore invalid status + return false; + } + + if(typeof fn !== 'function') { + throw new Error('fn should be a function.'); + } + this.queue.push({fn: fn, ontimeout: ontimeout, timeout: timeout}); + + if(this.status === SeqQueueManager.STATUS_IDLE) { + this.status = SeqQueueManager.STATUS_BUSY; + var self = this; + process.nextTick(function() { + self._next(self.curId); + }); + } + return true; +}; + +/** + * Close queue + * + * @param {Boolean} force if true will close the queue immediately else will execute the rest task in queue + */ +SeqQueue.prototype.close = function(force) { + if(this.status !== SeqQueueManager.STATUS_IDLE && this.status !== SeqQueueManager.STATUS_BUSY) { + //ignore invalid status + return; + } + + if(force) { + this.status = SeqQueueManager.STATUS_DRAINED; + if(this.timerId) { + clearTimeout(this.timerId); + this.timerId = undefined; + } + this.emit(EVENT_DRAINED); + } else { + this.status = SeqQueueManager.STATUS_CLOSED; + this.emit(EVENT_CLOSED); + } +}; + +/** + * Invoke next task + * + * @param {String|Number} tid last executed task id + * @api private + */ +SeqQueue.prototype._next = function(tid) { + if(tid !== this.curId || this.status !== SeqQueueManager.STATUS_BUSY && this.status !== SeqQueueManager.STATUS_CLOSED) { + //ignore invalid next call + return; + } + + if(this.timerId) { + clearTimeout(this.timerId); + this.timerId = undefined; + } + + var task = this.queue.shift(); + if(!task) { + if(this.status === SeqQueueManager.STATUS_BUSY) { + this.status = SeqQueueManager.STATUS_IDLE; + this.curId++; //modify curId to invalidate timeout task + } else { + this.status = SeqQueueManager.STATUS_DRAINED; + this.emit(EVENT_DRAINED); + } + return; + } + + var self = this; + task.id = ++this.curId; + + var timeout = task.timeout > 0 ? task.timeout : this.timeout; + timeout = timeout > 0 ? timeout : DEFAULT_TIMEOUT; + this.timerId = setTimeout(function() { + process.nextTick(function() { + self._next(task.id); + }); + self.emit('timeout', task); + if(task.ontimeout) { + task.ontimeout(); + } + }, timeout); + + try { + task.fn({ + done: function() { + var res = task.id === self.curId; + process.nextTick(function() { + self._next(task.id); + }); + return res; + } + }); + } catch(err) { + self.emit('error', err, task); + process.nextTick(function() { + self._next(task.id); + }); + } +}; + +/** + * Queue manager. + * + * @module + */ +var SeqQueueManager = module.exports; + +/** + * Queue status: idle, welcome new tasks + * + * @const + * @type {Number} + * @memberOf SeqQueueManager + */ +SeqQueueManager.STATUS_IDLE = 0; + +/** + * Queue status: busy, queue is working for some tasks now + * + * @const + * @type {Number} + * @memberOf SeqQueueManager + */ +SeqQueueManager.STATUS_BUSY = 1; + +/** + * Queue status: closed, queue has closed and would not receive task any more + * and is processing the remaining tasks now. + * + * @const + * @type {Number} + * @memberOf SeqQueueManager + */ +SeqQueueManager.STATUS_CLOSED = 2; + +/** + * Queue status: drained, queue is ready to be destroy + * + * @const + * @type {Number} + * @memberOf SeqQueueManager + */ +SeqQueueManager.STATUS_DRAINED = 3; + +/** + * Create Sequence queue + * + * @param {Number} timeout a global timeout for the new queue instance + * @return {Object} new queue instance + * @memberOf SeqQueueManager + */ +SeqQueueManager.createQueue = function(timeout) { + return new SeqQueue(timeout); +}; \ No newline at end of file diff --git a/node_modules/seq-queue/package.json b/node_modules/seq-queue/package.json new file mode 100644 index 0000000..ec02f3a --- /dev/null +++ b/node_modules/seq-queue/package.json @@ -0,0 +1,17 @@ +{ + "name": "seq-queue", + "author": "changchang ", + "version": "0.0.5", + "description": "A simple tool to keep requests to be executed in order.", + "homepage": "https://github.com/changchang/seq-queue", + "repository": { + "type": "git", + "url": "git@github.com:changchang/seq-queue.git" + }, + "dependencies": { + }, + "devDependencies": { + "mocha": ">=0.0.1", + "should": ">=0.0.1" + } +} \ No newline at end of file diff --git a/node_modules/seq-queue/test/seq-queue-test.js b/node_modules/seq-queue/test/seq-queue-test.js new file mode 100644 index 0000000..d91724a --- /dev/null +++ b/node_modules/seq-queue/test/seq-queue-test.js @@ -0,0 +1,307 @@ +var should = require('should'); +var SeqQueue = require('../lib/seq-queue'); + +var timeout = 1000; + +describe('seq-queue', function() { + + describe('#createQueue', function() { + it('should return a seq-queue instance with init properties', function() { + var queue = SeqQueue.createQueue(timeout); + should.exist(queue); + queue.should.have.property('timeout', timeout); + queue.should.have.property('status', SeqQueue.IDLE); + }); + }); + + describe('#push' , function() { + it('should change the queue status from idle to busy and invoke the task at once when task finish when queue idle', function(done) { + var queue = SeqQueue.createQueue(timeout); + queue.should.have.property('status', SeqQueue.IDLE); + queue.push(function(task) { + should.exist(task); + task.done(); + queue.should.have.property('status', SeqQueue.IDLE); + done(); + }); + queue.should.have.property('status', SeqQueue.BUSY); + }); + + it('should keep the status busy and keep the new task wait until the former tasks finish when queue busy', function(done) { + var queue = SeqQueue.createQueue(timeout); + var formerTaskFinished = false; + //add first task + queue.push(function(task) { + formerTaskFinished = true; + task.done(); + }); + queue.should.have.property('status', SeqQueue.BUSY); + //add second task + queue.push(function(task) { + formerTaskFinished.should.be.true; + queue.should.have.property('status', SeqQueue.BUSY); + task.done(); + queue.should.have.property('status', SeqQueue.IDLE); + done(); + }); + queue.should.have.property('status', SeqQueue.BUSY); + }); + + it('should ok if the task call done() directly', function(done) { + var queue = SeqQueue.createQueue(); + var taskCount = 0; + queue.push(function(task) { + taskCount++; + task.done(); + }); + queue.push(function(task) { + taskCount++; + task.done(); + }); + setTimeout(function() { + taskCount.should.equal(2); + done(); + }, 500); + }); + }); + + describe('#close', function() { + it('should not accept new request but should execute the rest task in queue when close gracefully', function(done) { + var queue = SeqQueue.createQueue(timeout); + var closedEventCount = 0; + var drainedEventCount = 0; + queue.on('closed', function() { + closedEventCount++; + }); + queue.on('drained', function() { + drainedEventCount++; + }); + var executedTaskCount = 0; + queue.push(function(task) { + executedTaskCount++; + task.done(); + }).should.be.true; + queue.close(false); + queue.should.have.property('status', SeqQueue.CLOSED); + + queue.push(function(task) { + // never should be executed + executedTaskCount++; + task.done(); + }).should.be.false; + + // wait all task finished + setTimeout(function() { + executedTaskCount.should.equal(1); + closedEventCount.should.equal(1); + drainedEventCount.should.equal(1); + done(); + }, 1000); + }); + + it('should not execute any task and emit a drained event when close forcefully', function(done) { + var queue = SeqQueue.createQueue(timeout); + var drainedEventCount = 0; + queue.on('drained', function() { + drainedEventCount++; + }); + var executedTaskCount = 0; + queue.push(function(task) { + //never should be executed + executedTaskCount++; + task.done(); + }).should.be.true; + queue.close(true); + queue.should.have.property('status', SeqQueue.DRAINED); + + // wait all task finished + setTimeout(function() { + executedTaskCount.should.equal(0); + drainedEventCount.should.equal(1); + done(); + }, 1000); + }); + }); + + describe('#timeout', function() { + it('should emit timeout event and execute the next task when a task timeout by default', function(done) { + var queue = SeqQueue.createQueue(); + var executedTaskCount = 0; + var timeoutCount = 0; + var onTimeoutCount = 0; + //add timeout listener + queue.on('timeout', function(task) { + task.should.be.a('object'); + task.fn.should.be.a('function'); + timeoutCount++; + }); + + queue.push(function(task) { + executedTaskCount++; + //no task.done() invoke to cause a timeout + }, function() { + onTimeoutCount++; + }).should.be.true; + + queue.push(function(task) { + executedTaskCount++; + task.done(); + }).should.be.true; + + setTimeout(function() { + //wait all task finish + executedTaskCount.should.be.equal(2); + timeoutCount.should.be.equal(1); + onTimeoutCount.should.be.equal(1); + done(); + }, 4000); //default timeout is 3s + }); + + it('should return false when invoke task.done() if task has already timeout', function(done) { + var queue = SeqQueue.createQueue(); + var executedTaskCount = 0; + var timeoutCount = 0; + var timeout = 1000; + + //add timeout listener + queue.on('timeout', function(task) { + task.should.be.a('object'); + task.fn.should.be.a('function'); + timeoutCount++; + }); + + queue.push(function(task) { + executedTaskCount++; + task.done().should.be.true; + }).should.be.true; + + queue.push(function(task) { + //sleep to make a timeout + setTimeout(function() { + executedTaskCount++; + task.done().should.be.false; + }, timeout + 1000); + }, null, timeout).should.be.true; + + setTimeout(function() { + //wait all task finish + executedTaskCount.should.be.equal(2); + timeoutCount.should.be.equal(1); + done(); + }, 4000); + }); + + it('should never timeout after close forcefully', function(done) { + var queue = SeqQueue.createQueue(timeout); + var timeoutCount = 0; + //add timeout listener + queue.on('timeout', function(task) { + //should never enter here + timeoutCount++; + }); + + queue.push(function(task) { + //no task.done() invoke to cause a timeout + }).should.be.true; + + queue.close(true); + + setTimeout(function() { + //wait all task finish + timeoutCount.should.be.equal(0); + done(); + }, timeout * 2); + }); + + it('should use the global timeout value by default', function(done) { + var globalTimeout = timeout + 100; + var queue = SeqQueue.createQueue(globalTimeout); + //add timeout listener + queue.on('timeout', function(task) { + (Date.now() - start).should.not.be.below(globalTimeout); + done(); + }); + + queue.push(function(task) { + //no task.done() invoke to cause a timeout + }).should.be.true; + var start = Date.now(); + }); + + it('should use the timeout value in #push if it was assigned', function(done) { + var localTimeout = timeout / 2; + var queue = SeqQueue.createQueue(timeout); + //add timeout listener + queue.on('timeout', function(task) { + var diff = Date.now() - start; + diff.should.not.be.below(localTimeout); + diff.should.not.be.above(timeout); + done(); + }); + + queue.push(function(task) { + //no task.done() invoke to cause a timeout + }, null, localTimeout).should.be.true; + var start = Date.now(); + }); + }); + + describe('#error', function() { + it('should emit an error event and invoke next task when a task throws an event', function(done) { + var queue = SeqQueue.createQueue(); + var errorCount = 0; + var taskCount = 0; + //add timeout listener + queue.on('error', function(err, task) { + errorCount++; + should.exist(err); + should.exist(task); + }); + + queue.push(function(task) { + taskCount++; + throw new Error('some error'); + }).should.be.true; + + queue.push(function(task) { + taskCount++; + task.done(); + }); + + setTimeout(function() { + taskCount.should.equal(2); + errorCount.should.equal(1); + done(); + }, 500); + }); + + it('should be ok when task throw a error after done was invoked', function(done) { + var queue = SeqQueue.createQueue(); + var errorCount = 0; + var taskCount = 0; + //add timeout listener + queue.on('error', function(err, task) { + errorCount++; + should.exist(err); + should.exist(task); + }); + + queue.push(function(task) { + taskCount++; + task.done(); + throw new Error('some error'); + }).should.be.true; + + queue.push(function(task) { + taskCount++; + task.done(); + }); + + setTimeout(function() { + taskCount.should.equal(2); + errorCount.should.equal(1); + done(); + }, 500); + }); + }); +}); \ No newline at end of file diff --git a/node_modules/sqlstring/HISTORY.md b/node_modules/sqlstring/HISTORY.md new file mode 100644 index 0000000..aea1dfc --- /dev/null +++ b/node_modules/sqlstring/HISTORY.md @@ -0,0 +1,53 @@ +2.3.3 / 2022-03-06 +================== + + * Fix escaping `Date` objects from foreign isolates + +2.3.2 / 2020-04-15 +================== + + * perf: remove outdated array pattern + +2.3.1 / 2018-02-24 +================== + + * Fix incorrectly replacing non-placeholders in SQL + +2.3.0 / 2017-10-01 +================== + + * Add `.toSqlString()` escape overriding + * Add `raw` method to wrap raw strings for escape overriding + * Small performance improvement on `escapeId` + +2.2.0 / 2016-11-01 +================== + + * Escape invalid `Date` objects as `NULL` + +2.1.0 / 2016-09-26 +================== + + * Accept numbers and other value types in `escapeId` + * Run `buffer.toString()` through escaping + +2.0.1 / 2016-06-06 +================== + + * Fix npm package to include missing `lib/` directory + +2.0.0 / 2016-06-06 +================== + + * Bring repository up-to-date with `mysql` module changes + * Support Node.js 0.6.x + +1.0.0 / 2014-11-09 +================== + + * Support Node.js 0.8.x + +0.0.1 / 2014-02-25 +================== + + * Initial release diff --git a/node_modules/sqlstring/LICENSE b/node_modules/sqlstring/LICENSE new file mode 100644 index 0000000..c7ff12a --- /dev/null +++ b/node_modules/sqlstring/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/node_modules/sqlstring/README.md b/node_modules/sqlstring/README.md new file mode 100644 index 0000000..a00c560 --- /dev/null +++ b/node_modules/sqlstring/README.md @@ -0,0 +1,205 @@ +# sqlstring + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Simple SQL escape and format for MySQL + +## Install + +```sh +$ npm install sqlstring +``` + +## Usage + + +```js +var SqlString = require('sqlstring'); +``` + +### Escaping query values + +**Caution** These methods of escaping values only works when the +[NO_BACKSLASH_ESCAPES](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_backslash_escapes) +SQL mode is disabled (which is the default state for MySQL servers). + +In order to avoid SQL Injection attacks, you should always escape any user +provided data before using it inside a SQL query. You can do so using the +`SqlString.escape()` method: + +```js +var userId = 'some user provided value'; +var sql = 'SELECT * FROM users WHERE id = ' + SqlString.escape(userId); +console.log(sql); // SELECT * FROM users WHERE id = 'some user provided value' +``` + +Alternatively, you can use `?` characters as placeholders for values you would +like to have escaped like this: + +```js +var userId = 1; +var sql = SqlString.format('SELECT * FROM users WHERE id = ?', [userId]); +console.log(sql); // SELECT * FROM users WHERE id = 1 +``` + +Multiple placeholders are mapped to values in the same order as passed. For example, +in the following query `foo` equals `a`, `bar` equals `b`, `baz` equals `c`, and +`id` will be `userId`: + +```js +var userId = 1; +var sql = SqlString.format('UPDATE users SET foo = ?, bar = ?, baz = ? WHERE id = ?', + ['a', 'b', 'c', userId]); +console.log(sql); // UPDATE users SET foo = 'a', bar = 'b', baz = 'c' WHERE id = 1 +``` + +This looks similar to prepared statements in MySQL, however it really just uses +the same `SqlString.escape()` method internally. + +**Caution** This also differs from prepared statements in that all `?` are +replaced, even those contained in comments and strings. + +Different value types are escaped differently, here is how: + +* Numbers are left untouched +* Booleans are converted to `true` / `false` +* Date objects are converted to `'YYYY-mm-dd HH:ii:ss'` strings +* Buffers are converted to hex strings, e.g. `X'0fa5'` +* Strings are safely escaped +* Arrays are turned into list, e.g. `['a', 'b']` turns into `'a', 'b'` +* Nested arrays are turned into grouped lists (for bulk inserts), e.g. `[['a', + 'b'], ['c', 'd']]` turns into `('a', 'b'), ('c', 'd')` +* Objects that have a `toSqlString` method will have `.toSqlString()` called + and the returned value is used as the raw SQL. +* Objects are turned into `key = 'val'` pairs for each enumerable property on + the object. If the property's value is a function, it is skipped; if the + property's value is an object, toString() is called on it and the returned + value is used. +* `undefined` / `null` are converted to `NULL` +* `NaN` / `Infinity` are left as-is. MySQL does not support these, and trying + to insert them as values will trigger MySQL errors until they implement + support. + +You may have noticed that this escaping allows you to do neat things like this: + +```js +var post = {id: 1, title: 'Hello MySQL'}; +var sql = SqlString.format('INSERT INTO posts SET ?', post); +console.log(sql); // INSERT INTO posts SET `id` = 1, `title` = 'Hello MySQL' +``` + +And the `toSqlString` method allows you to form complex queries with functions: + +```js +var CURRENT_TIMESTAMP = { toSqlString: function() { return 'CURRENT_TIMESTAMP()'; } }; +var sql = SqlString.format('UPDATE posts SET modified = ? WHERE id = ?', [CURRENT_TIMESTAMP, 42]); +console.log(sql); // UPDATE posts SET modified = CURRENT_TIMESTAMP() WHERE id = 42 +``` + +To generate objects with a `toSqlString` method, the `SqlString.raw()` method can +be used. This creates an object that will be left un-touched when using in a `?` +placeholder, useful for using functions as dynamic values: + +**Caution** The string provided to `SqlString.raw()` will skip all escaping +functions when used, so be careful when passing in unvalidated input. + +```js +var CURRENT_TIMESTAMP = SqlString.raw('CURRENT_TIMESTAMP()'); +var sql = SqlString.format('UPDATE posts SET modified = ? WHERE id = ?', [CURRENT_TIMESTAMP, 42]); +console.log(sql); // UPDATE posts SET modified = CURRENT_TIMESTAMP() WHERE id = 42 +``` + +If you feel the need to escape queries by yourself, you can also use the escaping +function directly: + +```js +var sql = 'SELECT * FROM posts WHERE title=' + SqlString.escape('Hello MySQL'); +console.log(sql); // SELECT * FROM posts WHERE title='Hello MySQL' +``` + +### Escaping query identifiers + +If you can't trust an SQL identifier (database / table / column name) because it is +provided by a user, you should escape it with `SqlString.escapeId(identifier)` like this: + +```js +var sorter = 'date'; +var sql = 'SELECT * FROM posts ORDER BY ' + SqlString.escapeId(sorter); +console.log(sql); // SELECT * FROM posts ORDER BY `date` +``` + +It also supports adding qualified identifiers. It will escape both parts. + +```js +var sorter = 'date'; +var sql = 'SELECT * FROM posts ORDER BY ' + SqlString.escapeId('posts.' + sorter); +console.log(sql); // SELECT * FROM posts ORDER BY `posts`.`date` +``` + +If you do not want to treat `.` as qualified identifiers, you can set the second +argument to `true` in order to keep the string as a literal identifier: + +```js +var sorter = 'date.2'; +var sql = 'SELECT * FROM posts ORDER BY ' + SqlString.escapeId(sorter, true); +console.log(sql); // SELECT * FROM posts ORDER BY `date.2` +``` + +Alternatively, you can use `??` characters as placeholders for identifiers you would +like to have escaped like this: + +```js +var userId = 1; +var columns = ['username', 'email']; +var sql = SqlString.format('SELECT ?? FROM ?? WHERE id = ?', [columns, 'users', userId]); +console.log(sql); // SELECT `username`, `email` FROM `users` WHERE id = 1 +``` +**Please note that this last character sequence is experimental and syntax might change** + +When you pass an Object to `.escape()` or `.format()`, `.escapeId()` is used to avoid SQL injection in object keys. + +### Formatting queries + +You can use `SqlString.format` to prepare a query with multiple insertion points, +utilizing the proper escaping for ids and values. A simple example of this follows: + +```js +var userId = 1; +var inserts = ['users', 'id', userId]; +var sql = SqlString.format('SELECT * FROM ?? WHERE ?? = ?', inserts); +console.log(sql); // SELECT * FROM `users` WHERE `id` = 1 +``` + +Following this you then have a valid, escaped query that you can then send to the database safely. +This is useful if you are looking to prepare the query before actually sending it to the database. +You also have the option (but are not required) to pass in `stringifyObject` and `timeZone`, +allowing you provide a custom means of turning objects into strings, as well as a +location-specific/timezone-aware `Date`. + +This can be further combined with the `SqlString.raw()` helper to generate SQL +that includes MySQL functions as dynamic vales: + +```js +var userId = 1; +var data = { email: 'foobar@example.com', modified: SqlString.raw('NOW()') }; +var sql = SqlString.format('UPDATE ?? SET ? WHERE `id` = ?', ['users', data, userId]); +console.log(sql); // UPDATE `users` SET `email` = 'foobar@example.com', `modified` = NOW() WHERE `id` = 1 +``` + +## License + +[MIT](LICENSE) + +[npm-version-image]: https://img.shields.io/npm/v/sqlstring.svg +[npm-downloads-image]: https://img.shields.io/npm/dm/sqlstring.svg +[npm-url]: https://npmjs.org/package/sqlstring +[coveralls-image]: https://img.shields.io/coveralls/mysqljs/sqlstring/master.svg +[coveralls-url]: https://coveralls.io/r/mysqljs/sqlstring?branch=master +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/mysqljs/sqlstring/ci/master?label=build +[github-actions-ci-url]: https://github.com/mysqljs/sqlstring/actions/workflows/ci.yml +[node-image]: https://img.shields.io/node/v/sqlstring.svg +[node-url]: https://nodejs.org/en/download diff --git a/node_modules/sqlstring/index.js b/node_modules/sqlstring/index.js new file mode 100644 index 0000000..4ef5944 --- /dev/null +++ b/node_modules/sqlstring/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/SqlString'); diff --git a/node_modules/sqlstring/lib/SqlString.js b/node_modules/sqlstring/lib/SqlString.js new file mode 100644 index 0000000..8206dad --- /dev/null +++ b/node_modules/sqlstring/lib/SqlString.js @@ -0,0 +1,237 @@ +var SqlString = exports; + +var ID_GLOBAL_REGEXP = /`/g; +var QUAL_GLOBAL_REGEXP = /\./g; +var CHARS_GLOBAL_REGEXP = /[\0\b\t\n\r\x1a\"\'\\]/g; // eslint-disable-line no-control-regex +var CHARS_ESCAPE_MAP = { + '\0' : '\\0', + '\b' : '\\b', + '\t' : '\\t', + '\n' : '\\n', + '\r' : '\\r', + '\x1a' : '\\Z', + '"' : '\\"', + '\'' : '\\\'', + '\\' : '\\\\' +}; + +SqlString.escapeId = function escapeId(val, forbidQualified) { + if (Array.isArray(val)) { + var sql = ''; + + for (var i = 0; i < val.length; i++) { + sql += (i === 0 ? '' : ', ') + SqlString.escapeId(val[i], forbidQualified); + } + + return sql; + } else if (forbidQualified) { + return '`' + String(val).replace(ID_GLOBAL_REGEXP, '``') + '`'; + } else { + return '`' + String(val).replace(ID_GLOBAL_REGEXP, '``').replace(QUAL_GLOBAL_REGEXP, '`.`') + '`'; + } +}; + +SqlString.escape = function escape(val, stringifyObjects, timeZone) { + if (val === undefined || val === null) { + return 'NULL'; + } + + switch (typeof val) { + case 'boolean': return (val) ? 'true' : 'false'; + case 'number': return val + ''; + case 'object': + if (Object.prototype.toString.call(val) === '[object Date]') { + return SqlString.dateToString(val, timeZone || 'local'); + } else if (Array.isArray(val)) { + return SqlString.arrayToList(val, timeZone); + } else if (Buffer.isBuffer(val)) { + return SqlString.bufferToString(val); + } else if (typeof val.toSqlString === 'function') { + return String(val.toSqlString()); + } else if (stringifyObjects) { + return escapeString(val.toString()); + } else { + return SqlString.objectToValues(val, timeZone); + } + default: return escapeString(val); + } +}; + +SqlString.arrayToList = function arrayToList(array, timeZone) { + var sql = ''; + + for (var i = 0; i < array.length; i++) { + var val = array[i]; + + if (Array.isArray(val)) { + sql += (i === 0 ? '' : ', ') + '(' + SqlString.arrayToList(val, timeZone) + ')'; + } else { + sql += (i === 0 ? '' : ', ') + SqlString.escape(val, true, timeZone); + } + } + + return sql; +}; + +SqlString.format = function format(sql, values, stringifyObjects, timeZone) { + if (values == null) { + return sql; + } + + if (!Array.isArray(values)) { + values = [values]; + } + + var chunkIndex = 0; + var placeholdersRegex = /\?+/g; + var result = ''; + var valuesIndex = 0; + var match; + + while (valuesIndex < values.length && (match = placeholdersRegex.exec(sql))) { + var len = match[0].length; + + if (len > 2) { + continue; + } + + var value = len === 2 + ? SqlString.escapeId(values[valuesIndex]) + : SqlString.escape(values[valuesIndex], stringifyObjects, timeZone); + + result += sql.slice(chunkIndex, match.index) + value; + chunkIndex = placeholdersRegex.lastIndex; + valuesIndex++; + } + + if (chunkIndex === 0) { + // Nothing was replaced + return sql; + } + + if (chunkIndex < sql.length) { + return result + sql.slice(chunkIndex); + } + + return result; +}; + +SqlString.dateToString = function dateToString(date, timeZone) { + var dt = new Date(date); + + if (isNaN(dt.getTime())) { + return 'NULL'; + } + + var year; + var month; + var day; + var hour; + var minute; + var second; + var millisecond; + + if (timeZone === 'local') { + year = dt.getFullYear(); + month = dt.getMonth() + 1; + day = dt.getDate(); + hour = dt.getHours(); + minute = dt.getMinutes(); + second = dt.getSeconds(); + millisecond = dt.getMilliseconds(); + } else { + var tz = convertTimezone(timeZone); + + if (tz !== false && tz !== 0) { + dt.setTime(dt.getTime() + (tz * 60000)); + } + + year = dt.getUTCFullYear(); + month = dt.getUTCMonth() + 1; + day = dt.getUTCDate(); + hour = dt.getUTCHours(); + minute = dt.getUTCMinutes(); + second = dt.getUTCSeconds(); + millisecond = dt.getUTCMilliseconds(); + } + + // YYYY-MM-DD HH:mm:ss.mmm + var str = zeroPad(year, 4) + '-' + zeroPad(month, 2) + '-' + zeroPad(day, 2) + ' ' + + zeroPad(hour, 2) + ':' + zeroPad(minute, 2) + ':' + zeroPad(second, 2) + '.' + + zeroPad(millisecond, 3); + + return escapeString(str); +}; + +SqlString.bufferToString = function bufferToString(buffer) { + return 'X' + escapeString(buffer.toString('hex')); +}; + +SqlString.objectToValues = function objectToValues(object, timeZone) { + var sql = ''; + + for (var key in object) { + var val = object[key]; + + if (typeof val === 'function') { + continue; + } + + sql += (sql.length === 0 ? '' : ', ') + SqlString.escapeId(key) + ' = ' + SqlString.escape(val, true, timeZone); + } + + return sql; +}; + +SqlString.raw = function raw(sql) { + if (typeof sql !== 'string') { + throw new TypeError('argument sql must be a string'); + } + + return { + toSqlString: function toSqlString() { return sql; } + }; +}; + +function escapeString(val) { + var chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex = 0; + var escapedVal = ''; + var match; + + while ((match = CHARS_GLOBAL_REGEXP.exec(val))) { + escapedVal += val.slice(chunkIndex, match.index) + CHARS_ESCAPE_MAP[match[0]]; + chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex; + } + + if (chunkIndex === 0) { + // Nothing was escaped + return "'" + val + "'"; + } + + if (chunkIndex < val.length) { + return "'" + escapedVal + val.slice(chunkIndex) + "'"; + } + + return "'" + escapedVal + "'"; +} + +function zeroPad(number, length) { + number = number.toString(); + while (number.length < length) { + number = '0' + number; + } + + return number; +} + +function convertTimezone(tz) { + if (tz === 'Z') { + return 0; + } + + var m = tz.match(/([\+\-\s])(\d\d):?(\d\d)?/); + if (m) { + return (m[1] === '-' ? -1 : 1) * (parseInt(m[2], 10) + ((m[3] ? parseInt(m[3], 10) : 0) / 60)) * 60; + } + return false; +} diff --git a/node_modules/sqlstring/package.json b/node_modules/sqlstring/package.json new file mode 100644 index 0000000..5aa57f1 --- /dev/null +++ b/node_modules/sqlstring/package.json @@ -0,0 +1,47 @@ +{ + "name": "sqlstring", + "description": "Simple SQL escape and format for MySQL", + "version": "2.3.3", + "contributors": [ + "Adri Van Houdt ", + "Douglas Christopher Wilson ", + "fengmk2 (http://fengmk2.github.com)", + "Kevin Jose Martin ", + "Nathan Woltman ", + "Sergej Sintschilin " + ], + "license": "MIT", + "keywords": [ + "sqlstring", + "sql", + "escape", + "sql escape" + ], + "repository": "mysqljs/sqlstring", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "nyc": "15.1.0", + "urun": "0.0.8", + "utest": "0.0.8" + }, + "files": [ + "lib/", + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "node test/run.js", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/package-lock.json b/package-lock.json index 5fa4b61..5ddf018 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,9 @@ "packages": { "": { "dependencies": { + "bcryptjs": "^3.0.2", "express": "^5.1.0", + "mysql2": "^3.14.1", "socket.io": "^4.8.1", "uuid": "^11.1.0" } @@ -47,6 +49,15 @@ "node": ">= 0.6" } }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", @@ -56,6 +67,15 @@ "node": "^4.5.0 || >= 5.9" } }, + "node_modules/bcryptjs": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-3.0.2.tgz", + "integrity": "sha512-k38b3XOZKv60C4E2hVsXTolJWfkGRMbILBIe2IBITXciy5bOsTKot5kDrf3ZfufQtQOUN5mXceUEpU1rTl9Uog==", + "license": "BSD-3-Clause", + "bin": { + "bcrypt": "bin/bcrypt" + } + }, "node_modules/body-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", @@ -183,6 +203,15 @@ } } }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -441,6 +470,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -563,6 +601,42 @@ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", "license": "MIT" }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/lru.min": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.2.tgz", + "integrity": "sha512-Nv9KddBcQSlQopmBHXSsZVY5xsdlZkdH/Iey0BlcBYggMd4two7cZnKOK9vmy3nY0O5RGH99z1PCeTpPqszUYg==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -620,6 +694,38 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, + "node_modules/mysql2": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.14.1.tgz", + "integrity": "sha512-7ytuPQJjQB8TNAYX/H2yhL+iQOnIBjAMam361R7UAL0lOVXWjtdrmoL9HYKqKoLp/8UUTRcvo1QPvK9KL7wA8w==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "license": "MIT", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/negotiator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", @@ -805,6 +911,11 @@ "node": ">= 18" } }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, "node_modules/serve-static": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", @@ -1033,6 +1144,15 @@ "node": ">= 0.6" } }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", diff --git a/package.json b/package.json index da5d78b..492a907 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,8 @@ { "dependencies": { + "bcryptjs": "^3.0.2", "express": "^5.1.0", + "mysql2": "^3.14.1", "socket.io": "^4.8.1", "uuid": "^11.1.0" } diff --git a/public/index.html b/public/index.html index ccf09e5..d39f2f9 100644 --- a/public/index.html +++ b/public/index.html @@ -5,128 +5,281 @@ Битва: Елена vs Балард (Сетевая Версия) - -
-

Настройка Игры

-
Ожидание подключения к серверу...
- -
- +
+
+
+
Ожидание подключения к серверу...
-
-
-

PvP (Игрок против Игрока)

- - -

- - + +
+

Вход / Регистрация

+
+

Регистрация

+ + + +
+
+
+

Вход

+ + + +
-
-

Доступные PvP игры:

-

Загрузка списка...

- + + -
+ + +
-