mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 06:28:54 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e5d4cce06 | ||
|
|
681b39692a | ||
|
|
39c485644d | ||
|
|
634bbffd46 | ||
|
|
273a4a8a89 | ||
|
|
b8249d5457 | ||
|
|
372a95632c | ||
|
|
faae020dd4 | ||
|
|
5e89d62688 | ||
|
|
51ac8d1e8c | ||
|
|
466f230dc4 | ||
|
|
06b106151f | ||
|
|
a0573c8623 | ||
|
|
076e327c9a | ||
|
|
c5f150e003 | ||
|
|
4b2b564591 | ||
|
|
3f57c566df | ||
|
|
5e6547611b | ||
|
|
be221b70d3 | ||
|
|
f7dea332de | ||
|
|
d2758de972 | ||
|
|
c9acb09d08 | ||
|
|
73ad12ed02 | ||
|
|
4654460e22 | ||
|
|
e23ba224aa | ||
|
|
878a2eb6c0 | ||
|
|
290e23c190 | ||
|
|
546eebe1cf | ||
|
|
fd4fa877ec | ||
|
|
0a2f1ae856 | ||
|
|
72aafb8a16 | ||
|
|
492aa947e6 | ||
|
|
20f35143db | ||
|
|
cc74fac733 | ||
|
|
b01e30d7b1 | ||
|
|
98a85faa1c | ||
|
|
49a5087d70 |
No files matched your search
@@ -0,0 +1,48 @@
|
|||||||
|
name: Pre-Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Version tag'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-release:
|
||||||
|
name: Build and Create Tagged Pre release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install archive tools
|
||||||
|
run: sudo apt install zip
|
||||||
|
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.ref }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn
|
||||||
|
|
||||||
|
- name: Run build
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Bundle files
|
||||||
|
run: |
|
||||||
|
mv dist oxmysql
|
||||||
|
zip -r oxmysql-${{ github.event.inputs.tag }}.zip oxmysql
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: "marvinpinto/[email protected]"
|
||||||
|
id: auto_release
|
||||||
|
with:
|
||||||
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
title: "Experimental - ${{ github.event.inputs.tag }} (FOR TESTING PURPOSE)"
|
||||||
|
prerelease: true
|
||||||
|
automatic_release_tag: "${{ github.event.inputs.tag }}"
|
||||||
|
files: oxmysql-${{ github.event.inputs.tag }}.zip
|
||||||
|
|
||||||
|
env:
|
||||||
|
CI: false
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 120,
|
||||||
|
"singleQuote": true,
|
||||||
|
"useTabs": false,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"semi": true,
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"trailingComma": "es5"
|
||||||
|
}
|
||||||
+9
-3
@@ -1,11 +1,17 @@
|
|||||||
fx_version 'cerulean'
|
fx_version 'cerulean'
|
||||||
game 'gta5'
|
game 'common'
|
||||||
|
|
||||||
name 'oxmysql'
|
name 'oxmysql'
|
||||||
description 'Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.'
|
description 'Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.'
|
||||||
version '1.2.0'
|
version '1.4.1'
|
||||||
url 'https://github.com/overextended/oxmysql'
|
url 'https://github.com/overextended/oxmysql'
|
||||||
author 'overextended'
|
author 'overextended'
|
||||||
|
use_fxv2_oal 'yes'
|
||||||
|
lua54 'yes'
|
||||||
|
|
||||||
server_scripts {'oxmysql.js', 'wrapper.lua'}
|
|
||||||
server_only 'true'
|
server_only 'true'
|
||||||
|
|
||||||
|
server_scripts {
|
||||||
|
'oxmysql.js',
|
||||||
|
'wrapper.lua'
|
||||||
|
}
|
||||||
-111
@@ -1,111 +0,0 @@
|
|||||||
/// <reference path="node_modules\@citizenfx\server\index.d.ts" />
|
|
||||||
const { createPool } = require("mysql2/promise");
|
|
||||||
const { ConnectionStringParser } = require("connection-string-parser");
|
|
||||||
|
|
||||||
const connectionString = GetConvar("mysql_connection_string", "");
|
|
||||||
|
|
||||||
if (connectionString === "") throw new Error(`Set up mysql_connection_string in server.cfg`);
|
|
||||||
|
|
||||||
const config = new ConnectionStringParser({
|
|
||||||
scheme: "mysql",
|
|
||||||
hosts: [],
|
|
||||||
}).parse(connectionString);
|
|
||||||
|
|
||||||
if (Object.keys(config).length === 0)
|
|
||||||
throw new Error(
|
|
||||||
`Set up mysql_connection_string in correct format - 'mysql://user:password@host/database'`
|
|
||||||
);
|
|
||||||
|
|
||||||
const slowQueryWarning = GetConvarInt("mysql_slow_query_warning", 100);
|
|
||||||
const debug = GetConvar("mysql_debug", "false") === "true";
|
|
||||||
const resourceName = GetCurrentResourceName() || "oxmysql";
|
|
||||||
|
|
||||||
const pool = createPool({
|
|
||||||
host: config.hosts[0].host,
|
|
||||||
user: config.username,
|
|
||||||
password: config.password,
|
|
||||||
database: config.endpoint,
|
|
||||||
charset: "utf8mb4_unicode_ci",
|
|
||||||
...config.options,
|
|
||||||
namedPlaceholders: true,
|
|
||||||
typeCast: (field, next) => {
|
|
||||||
if (field.type === "TINY" && field.length === 1) {
|
|
||||||
return field.string() === "1";
|
|
||||||
} else if (field.type === "BIT") {
|
|
||||||
return field.buffer()[0] === 1;
|
|
||||||
} else if (field.type === "TIMESTAMP" || field.type === "DATETIME") {
|
|
||||||
return new Date(field.string()).getTime() / 1000;
|
|
||||||
} else {
|
|
||||||
return next();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
pool
|
|
||||||
.getConnection()
|
|
||||||
.then(() => {
|
|
||||||
console.info("Database server connection established.");
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error(error.message);
|
|
||||||
});
|
|
||||||
|
|
||||||
const execute = async (query, parameters, prepare = true) => {
|
|
||||||
ScheduleResourceTick(resourceName);
|
|
||||||
try {
|
|
||||||
const startTime = process.hrtime.bigint();
|
|
||||||
|
|
||||||
// FIX WHEN SENDING LUA {nil, something, nil} => [null, something, null] based on count of ? in query
|
|
||||||
// Named placeholders handles this in patch {var1 = nil, var2 = something} => { var1: null, var2: something }
|
|
||||||
if (Array.isArray(parameters) && query.includes("?")) {
|
|
||||||
const requiredParameters = query.match(/\?/g);
|
|
||||||
if (requiredParameters.length !== parameters.length)
|
|
||||||
requiredParameters.forEach((_, index) => (parameters[index] = parameters[index] || null));
|
|
||||||
}
|
|
||||||
|
|
||||||
const [result] = prepare
|
|
||||||
? await pool.execute(query, parameters)
|
|
||||||
: await pool.query(query, parameters);
|
|
||||||
|
|
||||||
const executionTime = Number(process.hrtime.bigint() - startTime) / 1e6;
|
|
||||||
|
|
||||||
if (executionTime >= slowQueryWarning || debug)
|
|
||||||
console.warn(`${query} took ${executionTime}ms!`, parameters);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error.message, query, parameters);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
global.exports("execute", (query, parameters, callback = () => {}) => {
|
|
||||||
execute(query, parameters, false).then(
|
|
||||||
(result) => typeof callback === "function" && callback(result || false)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
global.exports("insert", (query, parameters, callback = () => {}) => {
|
|
||||||
execute(query, parameters, false).then(
|
|
||||||
(result) => typeof callback === "function" && callback((result && result.insertId) || false)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
global.exports("fetch", (query, parameters, callback = () => {}) => {
|
|
||||||
execute(query, parameters).then(
|
|
||||||
(result) => typeof callback === "function" && callback(result || false)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
global.exports("single", (query, parameters, callback = () => {}) => {
|
|
||||||
execute(query, parameters).then(
|
|
||||||
(result) => typeof callback === "function" && callback((result && result[0]) || false)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
global.exports("scalar", (query, parameters, callback = () => {}) => {
|
|
||||||
execute(query, parameters).then(
|
|
||||||
(result) =>
|
|
||||||
typeof callback === "function" &&
|
|
||||||
callback((result && result[0] && Object.values(result[0])[0]) || false)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "oxmysql",
|
"name": "oxmysql",
|
||||||
"version": "1.2.0",
|
"version": "1.4.1",
|
||||||
"main": "oxmysql.js",
|
"main": "oxmysql.js",
|
||||||
"description": "FiveM MySQL wrapper using faster mysql2",
|
"description": "FiveM MySQL wrapper using faster mysql2",
|
||||||
"repository": "[email protected]:overextended/oxmysql.git",
|
"repository": "[email protected]:overextended/oxmysql.git",
|
||||||
@@ -14,13 +14,13 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@citizenfx/server": "^2.0.4376-1",
|
"@citizenfx/server": "^2.0.4376-1",
|
||||||
"connection-string-parser": "^1.0.4",
|
"connection-string-parser": "^1.0.4",
|
||||||
|
"github-version-checker": "^2.2.0",
|
||||||
"mysql2": "^2.3.0",
|
"mysql2": "^2.3.0",
|
||||||
"postinstall-postinstall": "^2.1.0"
|
"postinstall-postinstall": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"copy-webpack-plugin": "^9.0.1",
|
"copy-webpack-plugin": "^9.0.1",
|
||||||
"patch-package": "^6.4.7",
|
"patch-package": "^6.4.7",
|
||||||
"ts-loader": "^9.2.5",
|
|
||||||
"typescript": "^4.4.3",
|
"typescript": "^4.4.3",
|
||||||
"webpack": "^5.52.1",
|
"webpack": "^5.52.1",
|
||||||
"webpack-cli": "^4.8.0"
|
"webpack-cli": "^4.8.0"
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/node_modules/github-version-checker/lib/check.js b/node_modules/github-version-checker/lib/check.js
|
||||||
|
index 7f00060..cf0e231 100644
|
||||||
|
--- a/node_modules/github-version-checker/lib/check.js
|
||||||
|
+++ b/node_modules/github-version-checker/lib/check.js
|
||||||
|
@@ -88,7 +88,6 @@ const rest = (options, callback) => {
|
||||||
|
|
||||||
|
if (found) {
|
||||||
|
const mapped = schemeMapper[options.fetchTags ? 'tag' : 'release'](version);
|
||||||
|
- console.log(mapped);
|
||||||
|
callback(null, mapped);
|
||||||
|
} else {
|
||||||
|
callback(null, null);
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/node_modules/named-placeholders/index.js b/node_modules/named-placeholders/index.js
|
diff --git a/node_modules/named-placeholders/index.js b/node_modules/named-placeholders/index.js
|
||||||
index 527d723..1a955b4 100644
|
index 527d723..f47b591 100644
|
||||||
--- a/node_modules/named-placeholders/index.js
|
--- a/node_modules/named-placeholders/index.js
|
||||||
+++ b/node_modules/named-placeholders/index.js
|
+++ b/node_modules/named-placeholders/index.js
|
||||||
@@ -3,7 +3,7 @@
|
@@ -3,7 +3,7 @@
|
||||||
@@ -7,29 +7,25 @@ index 527d723..1a955b4 100644
|
|||||||
// License: https://github.com/mscdex/node-mariasql/blob/master/LICENSE
|
// License: https://github.com/mscdex/node-mariasql/blob/master/LICENSE
|
||||||
|
|
||||||
-const RE_PARAM = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g,
|
-const RE_PARAM = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g,
|
||||||
+const RE_PARAM = /(?:\?)|(?:[:,@](\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g,
|
+const RE_PARAM = /(?:\?)|(?:[:@](\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g,
|
||||||
DQUOTE = 34,
|
DQUOTE = 34,
|
||||||
SQUOTE = 39,
|
SQUOTE = 39,
|
||||||
BSLASH = 92;
|
BSLASH = 92;
|
||||||
@@ -94,15 +94,27 @@ function createCompiler(config) {
|
@@ -94,15 +94,24 @@ function createCompiler(config) {
|
||||||
if (typeof params == 'undefined')
|
if (typeof params == 'undefined')
|
||||||
throw new Error('Named query contains placeholders, but parameters object is undefined');
|
throw new Error('Named query contains placeholders, but parameters object is undefined');
|
||||||
|
|
||||||
+ let parsedParams = {}
|
|
||||||
+
|
|
||||||
+ for(const key in params) {
|
+ for(const key in params) {
|
||||||
+ parsedParams[key.charAt(0) == '@' ? key.substring(1) : key] = params[key]
|
+ if(key.charAt(0) === '@' || key.charAt(0) === ':') {
|
||||||
|
+ params[key.substring(1)] = params[key];
|
||||||
|
+ delete params[key];
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
const tokens = tree[1];
|
const tokens = tree[1];
|
||||||
for (let i=0; i < tokens.length; ++i) {
|
for (let i=0; i < tokens.length; ++i) {
|
||||||
- arr.push(params[tokens[i]]);
|
+ if(params[tokens[i]] === undefined) throw new Error(`Undefined parameter ${tokens[i]}`);
|
||||||
+ if(typeof tokens[i] === 'number') {
|
arr.push(params[tokens[i]]);
|
||||||
+ const param = parsedParams[(tokens[i] + 1).toString()];
|
|
||||||
+ arr.push(param !== undefined ? param : null);
|
|
||||||
+ } else {
|
|
||||||
+ arr.push(parsedParams[tokens[i]] !== undefined ? parsedParams[tokens[i]] : null);
|
|
||||||
+ }
|
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
return [tree[0], arr];
|
return [tree[0], arr];
|
||||||
@@ -41,7 +37,7 @@ index 527d723..1a955b4 100644
|
|||||||
return s.slice(0, -1);
|
return s.slice(0, -1);
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
@@ -115,7 +127,7 @@ function createCompiler(config) {
|
@@ -115,7 +124,7 @@ function createCompiler(config) {
|
||||||
|
|
||||||
let unnamed = noTailingSemicolon(tree[0][0]);
|
let unnamed = noTailingSemicolon(tree[0][0]);
|
||||||
for (let i=1; i < tree[0].length; ++i) {
|
for (let i=1; i < tree[0].length; ++i) {
|
||||||
@@ -50,7 +46,7 @@ index 527d723..1a955b4 100644
|
|||||||
unnamed += config.placeholder;
|
unnamed += config.placeholder;
|
||||||
}
|
}
|
||||||
unnamed += config.placeholder;
|
unnamed += config.placeholder;
|
||||||
@@ -124,7 +136,7 @@ function createCompiler(config) {
|
@@ -124,7 +133,7 @@ function createCompiler(config) {
|
||||||
|
|
||||||
const last = tree[0][tree[0].length -1];
|
const last = tree[0][tree[0].length -1];
|
||||||
if (tree[0].length == tree[1].length) {
|
if (tree[0].length == tree[1].length) {
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
import { ConnectionStringParser } from 'connection-string-parser';
|
||||||
|
import versionCheck from 'github-version-checker';
|
||||||
|
import currentVersion from '../package.json';
|
||||||
|
|
||||||
|
const connectionString = GetConvar('mysql_connection_string', '');
|
||||||
|
|
||||||
|
if (connectionString === '') throw new Error(`Set up mysql_connection_string in server.cfg`);
|
||||||
|
|
||||||
|
const config = new ConnectionStringParser({
|
||||||
|
scheme: 'mysql',
|
||||||
|
hosts: [],
|
||||||
|
}).parse(connectionString);
|
||||||
|
|
||||||
|
if (Object.keys(config).length === 0)
|
||||||
|
throw new Error(`Set up mysql_connection_string in correct format - 'mysql://user:password@host/database'`);
|
||||||
|
|
||||||
|
const slowQueryWarning = GetConvarInt('mysql_slow_query_warning', 100);
|
||||||
|
const debug = GetConvar('mysql_debug', 'false') === 'true';
|
||||||
|
|
||||||
|
const isolationLevel = (() => {
|
||||||
|
switch (GetConvarInt('mysql_transaction_isolation_level', 2)) {
|
||||||
|
case 1:
|
||||||
|
return 'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ';
|
||||||
|
case 2:
|
||||||
|
return 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED';
|
||||||
|
case 3:
|
||||||
|
return 'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED';
|
||||||
|
case 4:
|
||||||
|
return 'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE';
|
||||||
|
default:
|
||||||
|
return 'SET TRANSACTION ISOLATION LEVEL READ COMMITTED';
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
const resourceName = GetCurrentResourceName() || 'oxmysql';
|
||||||
|
|
||||||
|
export { config, slowQueryWarning, debug, isolationLevel, resourceName };
|
||||||
|
|
||||||
|
setImmediate(async () => {
|
||||||
|
const versionCheckConfig = {
|
||||||
|
repo: 'oxmysql',
|
||||||
|
owner: 'overextended',
|
||||||
|
currentVersion: currentVersion.version,
|
||||||
|
latest: true
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const update = await versionCheck(versionCheckConfig);
|
||||||
|
if (update) {
|
||||||
|
console.log(`^3Your version of oxmysql is outdated (v${versionCheckConfig.currentVersion})! Please update to the latest version (${update.name}) here: \nhttps://github.com/overextended/oxmysql/releases/latest`);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(`^3Could not fetch updates for oxmysql!^0\n${e}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
class FormatError extends Error {
|
||||||
|
constructor(message, query, parameters) {
|
||||||
|
super(message);
|
||||||
|
if (parameters) this.sql = `${query} ${JSON.stringify(parameters)}`;
|
||||||
|
else this.sql = query;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { FormatError };
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { pool } from './pool';
|
||||||
|
import { parseParameters } from './parser';
|
||||||
|
import { slowQueryWarning, debug, resourceName } from './config';
|
||||||
|
|
||||||
|
const execute = async (query, parameters, resource) => {
|
||||||
|
ScheduleResourceTick(resourceName);
|
||||||
|
try {
|
||||||
|
const time = debug ? process.hrtime.bigint() : Date.now();
|
||||||
|
|
||||||
|
[query, parameters] = parseParameters(query, parameters);
|
||||||
|
|
||||||
|
const [result] = await pool.query(query, parameters);
|
||||||
|
|
||||||
|
const executionTime = debug ? Number(process.hrtime.bigint() - time) / 1e6 : Date.now() - time;
|
||||||
|
|
||||||
|
if (executionTime >= slowQueryWarning || debug)
|
||||||
|
console.log(
|
||||||
|
`^3[${debug ? 'DEBUG' : 'WARNING'}] ${resource} took ${executionTime}ms to execute a query!
|
||||||
|
${query} ${JSON.stringify(parameters)}^0`
|
||||||
|
);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(
|
||||||
|
`^1[ERROR] ${resource} was unable to execute a query!
|
||||||
|
${error.message}
|
||||||
|
${error.sql || `${query} ${JSON.stringify(parameters)}`}^0`
|
||||||
|
);
|
||||||
|
debug && console.trace(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export { execute };
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
import { pool } from './pool';
|
||||||
|
import { execute } from './execute';
|
||||||
|
import { transaction } from './transaction';
|
||||||
|
import { debug, isolationLevel } from './config';
|
||||||
|
|
||||||
|
setImmediate(async () => {
|
||||||
|
try {
|
||||||
|
await pool.query(isolationLevel);
|
||||||
|
console.log(`^2Database server connection established!^0`);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(`^3Unable to establish a connection to the database! [${error.code}]\n${error.message}^0`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const safeCallback = (callback, result, resource, query) => {
|
||||||
|
if (typeof callback === 'function')
|
||||||
|
return callback(result);
|
||||||
|
else if (debug)
|
||||||
|
return console.log(`^3[WARNING] ${resource} executed a query, but no callback function was defined!\n ^3 ${query}^0`);
|
||||||
|
};
|
||||||
|
|
||||||
|
global.exports('execute', (query, parameters, cb, resource = GetInvokingResource()) => {
|
||||||
|
execute(query, parameters, resource).then((result) =>
|
||||||
|
safeCallback(cb || parameters, result, resource, query));
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('insert', (query, parameters, cb, resource = GetInvokingResource()) => {
|
||||||
|
execute(query, parameters, resource).then((result) =>
|
||||||
|
safeCallback(cb || parameters, result && result.insertId, resource, query));
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('update', (query, parameters, cb, resource = GetInvokingResource()) => {
|
||||||
|
execute(query, parameters, resource).then((result) =>
|
||||||
|
safeCallback(cb || parameters, result && result.affectedRows, resource, query));
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('fetch', (query, parameters, cb, resource = GetInvokingResource()) => {
|
||||||
|
execute(query, parameters, resource).then((result) =>
|
||||||
|
safeCallback(cb || parameters, result, resource, query));
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('single', (query, parameters, cb, resource = GetInvokingResource()) => {
|
||||||
|
execute(query, parameters, resource).then((result) =>
|
||||||
|
safeCallback(cb || parameters, result && result[0], resource, query));
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('scalar', (query, parameters, cb, resource = GetInvokingResource()) => {
|
||||||
|
execute(query, parameters, resource).then((result) =>
|
||||||
|
safeCallback(cb || parameters, result && result[0] && Object.values(result[0])[0], resource, query));
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('transaction', (queries, parameters, cb, resource = GetInvokingResource()) => {
|
||||||
|
transaction(queries, parameters, resource).then((result) => {
|
||||||
|
safeCallback(cb || parameters, result || false, resource, debug && JSON.stringify(queries));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!GetResourceMetadata(GetCurrentResourceName(), 'server_script', 1)) {
|
||||||
|
global.exports('executeSync', async (query, parameters) => {
|
||||||
|
const result = await execute(query, parameters, GetInvokingResource());
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('insertSync', async (query, parameters) => {
|
||||||
|
const result = await execute(query, parameters, GetInvokingResource());
|
||||||
|
return result && result.insertId;
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('updateSync', async (query, parameters) => {
|
||||||
|
const result = await execute(query, parameters, GetInvokingResource());
|
||||||
|
return result && result.affectedRows;
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('fetchSync', async (query, parameters) => {
|
||||||
|
const result = await execute(query, parameters, GetInvokingResource());
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('singleSync', async (query, parameters) => {
|
||||||
|
const result = await execute(query, parameters, GetInvokingResource());
|
||||||
|
return result && result[0];
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('scalarSync', async (query, parameters) => {
|
||||||
|
const result = await execute(query, parameters, GetInvokingResource());
|
||||||
|
return result && result[0] && Object.values(result[0])[0];
|
||||||
|
});
|
||||||
|
|
||||||
|
global.exports('transactionSync', async (queries, parameters) => {
|
||||||
|
const result = await transaction(queries, parameters, GetInvokingResource());
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import { FormatError } from './errors';
|
||||||
|
import * as createCompiler from 'named-placeholders';
|
||||||
|
|
||||||
|
const convertNamedPlaceholders = createCompiler();
|
||||||
|
|
||||||
|
const parseTypes = (field, next) => {
|
||||||
|
//https://github.com/GHMatti/ghmattimysql/blob/37f1d2ae5c53f91782d168fe81fba80512d3c46d/packages/ghmattimysql/src/server/utility/typeCast.ts#L3
|
||||||
|
switch (field.type) {
|
||||||
|
case 'DATETIME':
|
||||||
|
case 'DATETIME2':
|
||||||
|
case 'TIMESTAMP':
|
||||||
|
case 'TIMESTAMP2':
|
||||||
|
case 'NEWDATE':
|
||||||
|
case 'DATE':
|
||||||
|
return field.type === 'DATE'
|
||||||
|
? new Date(field.string() + ' 00:00:00').getTime()
|
||||||
|
: new Date(field.string()).getTime();
|
||||||
|
case 'TINY':
|
||||||
|
if (field.length === 1) return field.string() === '1';
|
||||||
|
else return next();
|
||||||
|
case 'BIT':
|
||||||
|
return field.buffer()[0] === 1;
|
||||||
|
default:
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const parseParameters = (query, parameters) => {
|
||||||
|
if (query === undefined) throw new FormatError(`Undefined query passed`);
|
||||||
|
|
||||||
|
if (typeof parameters === 'function') return [query, []];
|
||||||
|
|
||||||
|
if (query.includes('@') || query.includes(':')) return [query, parameters];
|
||||||
|
|
||||||
|
const queryParams = query.match(/\?(?!\?)/g);
|
||||||
|
|
||||||
|
if (queryParams === null) return [query, []];
|
||||||
|
|
||||||
|
if (parameters === undefined)
|
||||||
|
throw new FormatError(`Placeholders was defined in query but no parameters provided!`, query);
|
||||||
|
|
||||||
|
if (Array.isArray(parameters)) {
|
||||||
|
if (parameters.length !== queryParams.length)
|
||||||
|
throw new Error(`Undefined array parameter #${parameters.length + 1}`, query, parameters);
|
||||||
|
} else {
|
||||||
|
queryParams.forEach((_, i) => {
|
||||||
|
if (parameters[`${i + 1}`] === undefined)
|
||||||
|
throw new FormatError(`Undefined object parameter #${i + 1}`, query, parameters);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return [query, parameters];
|
||||||
|
};
|
||||||
|
|
||||||
|
const parseTransaction = (queries, parameters) => {
|
||||||
|
//https://github.com/GHMatti/ghmattimysql/blob/37f1d2ae5c53f91782d168fe81fba80512d3c46d/packages/ghmattimysql/src/server/utility/sanitizeTransactionInput.ts#L5
|
||||||
|
|
||||||
|
if (!Array.isArray(queries)) throw new Error(`Transaction queries must be array type`);
|
||||||
|
|
||||||
|
const parsedTransaction = queries.map((query) => {
|
||||||
|
const [parsedQuery, parsedParameters] = parseParameters(
|
||||||
|
typeof query === 'object' ? query.query : query,
|
||||||
|
(typeof query === 'object' && (query.parameters || query.values)) || parameters || []
|
||||||
|
);
|
||||||
|
return { query: parsedQuery, params: parsedParameters };
|
||||||
|
});
|
||||||
|
|
||||||
|
return parsedTransaction;
|
||||||
|
};
|
||||||
|
|
||||||
|
export { parseTypes, parseParameters, parseTransaction };
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
import { createPool } from 'mysql2/promise';
|
||||||
|
import { config } from './config';
|
||||||
|
import { parseTypes } from './parser';
|
||||||
|
|
||||||
|
export const pool = createPool({
|
||||||
|
host: config.hosts[0].host || 'localhost',
|
||||||
|
port: config.hosts[0].port || 3306,
|
||||||
|
user: config.username || 'root',
|
||||||
|
password: config.password || '',
|
||||||
|
database: config.endpoint || 'es_extended',
|
||||||
|
charset: 'utf8mb4_unicode_ci',
|
||||||
|
connectTimeout: 30000,
|
||||||
|
...config.options,
|
||||||
|
namedPlaceholders: true,
|
||||||
|
typeCast: parseTypes,
|
||||||
|
});
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import { pool } from './pool';
|
||||||
|
import { parseTransaction } from './parser';
|
||||||
|
import { slowQueryWarning, debug, resourceName } from './config';
|
||||||
|
|
||||||
|
const transactionError = (queries, parameters) =>
|
||||||
|
`${queries
|
||||||
|
.map((query) =>
|
||||||
|
typeof query === 'string' ? query : `${query.query} ${JSON.stringify(query.values || query.parameters || [])}`
|
||||||
|
)
|
||||||
|
.join('\n')}\n${JSON.stringify(parameters)}`;
|
||||||
|
|
||||||
|
const transaction = async (queries, parameters, resource) => {
|
||||||
|
ScheduleResourceTick(resourceName);
|
||||||
|
const connection = await pool.getConnection();
|
||||||
|
try {
|
||||||
|
const time = debug ? process.hrtime.bigint() : Date.now();
|
||||||
|
|
||||||
|
const fullQuery = parseTransaction(queries, parameters);
|
||||||
|
const transactionAmount = fullQuery.length;
|
||||||
|
|
||||||
|
await connection.beginTransaction();
|
||||||
|
|
||||||
|
for (let i = 0; i < transactionAmount; i++) {
|
||||||
|
await connection.query(fullQuery[i].query, fullQuery[i].params);
|
||||||
|
}
|
||||||
|
|
||||||
|
await connection.commit();
|
||||||
|
|
||||||
|
const executionTime = debug ? Number(process.hrtime.bigint() - time) / 1e6 : Date.now() - time;
|
||||||
|
|
||||||
|
if (executionTime >= slowQueryWarning * transactionAmount || debug)
|
||||||
|
console.log(
|
||||||
|
`^3[${
|
||||||
|
debug ? 'DEBUG' : 'WARNING'
|
||||||
|
}] ${resource} took ${executionTime}ms to execute a transaction!\n${transactionError(queries, parameters)}^0`
|
||||||
|
);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
await connection.rollback();
|
||||||
|
console.log(
|
||||||
|
`^1[ERROR] ${resource} was unable to execute a transaction!
|
||||||
|
${error.message}
|
||||||
|
${error.sql || `${transactionError(queries, parameters)}`}^0`
|
||||||
|
);
|
||||||
|
debug && console.trace(error);
|
||||||
|
} finally {
|
||||||
|
connection.release();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export { transaction };
|
||||||
+3
-6
@@ -2,12 +2,9 @@ const path = require("path");
|
|||||||
const { DefinePlugin, IgnorePlugin } = require("webpack");
|
const { DefinePlugin, IgnorePlugin } = require("webpack");
|
||||||
const CopyPlugin = require("copy-webpack-plugin");
|
const CopyPlugin = require("copy-webpack-plugin");
|
||||||
|
|
||||||
const filesToCopy = ["fxmanifest.lua", "wrapper.lua", "README.md", "LICENSE.md"];
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: "development",
|
mode: "production",
|
||||||
devtool: "source-map",
|
entry: "./src/index.js",
|
||||||
entry: "./oxmysql.js",
|
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".js"],
|
extensions: [".js"],
|
||||||
},
|
},
|
||||||
@@ -18,7 +15,7 @@ module.exports = {
|
|||||||
contextRegExp: /./,
|
contextRegExp: /./,
|
||||||
}),
|
}),
|
||||||
new CopyPlugin({
|
new CopyPlugin({
|
||||||
patterns: filesToCopy,
|
patterns: ["fxmanifest.lua", "wrapper.lua", "README.md", "LICENSE.md"],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
|
|||||||
+54
-27
@@ -1,84 +1,111 @@
|
|||||||
---
|
---
|
||||||
-- Execute query and fetch affected rows
|
-- Execute unprepared query and fetch result
|
||||||
--
|
--
|
||||||
-- @param query tring
|
-- @param query string
|
||||||
-- @param parameters table
|
-- @param parameters table
|
||||||
--
|
--
|
||||||
-- @return table with result
|
-- @return table with result | false
|
||||||
--
|
--
|
||||||
local function executeSync(query, parameters)
|
exports('executeSync', function(query, parameters)
|
||||||
local p = promise.new()
|
local p = promise.new()
|
||||||
exports['oxmysql']:execute(query, parameters, function(result)
|
exports['oxmysql']:execute(query, parameters, function(result)
|
||||||
p:resolve(result)
|
p:resolve(result)
|
||||||
end)
|
end, GetInvokingResource())
|
||||||
return Citizen.Await(p)
|
return Citizen.Await(p)
|
||||||
end
|
end)
|
||||||
exports('executeSync', executeSync)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Execute query and fetch all result
|
-- Execute query and fetch all result
|
||||||
--
|
--
|
||||||
-- @param query tring
|
-- @param query string
|
||||||
-- @param parameters table
|
-- @param parameters table
|
||||||
--
|
--
|
||||||
-- @return table with result
|
-- @return table with result
|
||||||
--
|
--
|
||||||
local function fetchSync(query, parameters)
|
exports('fetchSync', function(query, parameters)
|
||||||
local p = promise.new()
|
local p = promise.new()
|
||||||
exports['oxmysql']:fetch(query, parameters, function(result)
|
exports['oxmysql']:fetch(query, parameters, function(result)
|
||||||
p:resolve(result)
|
p:resolve(result)
|
||||||
end)
|
end, GetInvokingResource())
|
||||||
return Citizen.Await(p)
|
return Citizen.Await(p)
|
||||||
end
|
end)
|
||||||
exports('fetchSync', fetchSync)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Execute query and fetch first row
|
-- Execute query and fetch first row
|
||||||
--
|
--
|
||||||
-- @param query tring
|
-- @param query string
|
||||||
-- @param parameters table
|
-- @param parameters table
|
||||||
--
|
--
|
||||||
-- @return table with result row
|
-- @return table with result row
|
||||||
--
|
--
|
||||||
local function singleSync(query, parameters)
|
exports('singleSync', function(query, parameters)
|
||||||
local p = promise.new()
|
local p = promise.new()
|
||||||
exports['oxmysql']:single(query, parameters, function(result)
|
exports['oxmysql']:single(query, parameters, function(result)
|
||||||
p:resolve(result)
|
p:resolve(result)
|
||||||
end)
|
end, GetInvokingResource())
|
||||||
return Citizen.Await(p)
|
return Citizen.Await(p)
|
||||||
end
|
end)
|
||||||
exports('singleSync', singleSync)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Execute query and fetch first column of first row
|
-- Execute query and fetch first column of first row
|
||||||
--
|
--
|
||||||
-- @param query tring
|
-- @param query string
|
||||||
-- @param parameters table
|
-- @param parameters table
|
||||||
--
|
--
|
||||||
-- @return result
|
-- @return result
|
||||||
--
|
--
|
||||||
local function scalarSync(query, parameters)
|
exports('scalarSync', function(query, parameters)
|
||||||
local p = promise.new()
|
local p = promise.new()
|
||||||
exports['oxmysql']:scalar(query, parameters, function(result)
|
exports['oxmysql']:scalar(query, parameters, function(result)
|
||||||
p:resolve(result)
|
p:resolve(result)
|
||||||
end)
|
end, GetInvokingResource())
|
||||||
return Citizen.Await(p)
|
return Citizen.Await(p)
|
||||||
end
|
end)
|
||||||
exports('scalarSync', scalarSync)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Insert data and return inserted id
|
-- Insert data and return inserted id
|
||||||
--
|
--
|
||||||
-- @param query tring
|
-- @param query string
|
||||||
-- @param parameters table
|
-- @param parameters table
|
||||||
--
|
--
|
||||||
-- @return insert data result
|
-- @return insert data result
|
||||||
--
|
--
|
||||||
local function insertSync(query, parameters)
|
exports('insertSync', function(query, parameters)
|
||||||
local p = promise.new()
|
local p = promise.new()
|
||||||
exports['oxmysql']:insert(query, parameters, function(result)
|
exports['oxmysql']:insert(query, parameters, function(result)
|
||||||
p:resolve(result)
|
p:resolve(result)
|
||||||
end)
|
end, GetInvokingResource())
|
||||||
return Citizen.Await(p)
|
return Citizen.Await(p)
|
||||||
end
|
end)
|
||||||
exports('insertSync', insertSync)
|
|
||||||
|
---
|
||||||
|
-- Update data and return affected rows
|
||||||
|
--
|
||||||
|
-- @param query string
|
||||||
|
-- @param parameters table
|
||||||
|
--
|
||||||
|
-- @return number affected rows
|
||||||
|
--
|
||||||
|
exports('updateSync', function(query, parameters)
|
||||||
|
local p = promise.new()
|
||||||
|
exports['oxmysql']:update(query, parameters, function(result)
|
||||||
|
p:resolve(result)
|
||||||
|
end, GetInvokingResource())
|
||||||
|
return Citizen.Await(p)
|
||||||
|
end)
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Execute a transaction and return boolean depending on success
|
||||||
|
--
|
||||||
|
-- @param queries table
|
||||||
|
-- @param parameters table
|
||||||
|
--
|
||||||
|
-- @return boolean
|
||||||
|
--
|
||||||
|
exports('transactionSync', function(queries, parameters)
|
||||||
|
local p = promise.new()
|
||||||
|
exports['oxmysql']:transaction(queries, parameters, function(result)
|
||||||
|
p:resolve(result)
|
||||||
|
end, GetInvokingResource())
|
||||||
|
return Citizen.Await(p)
|
||||||
|
end)
|
||||||
@@ -249,13 +249,6 @@ ansi-styles@^3.2.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
color-convert "^1.9.0"
|
color-convert "^1.9.0"
|
||||||
|
|
||||||
ansi-styles@^4.1.0:
|
|
||||||
version "4.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
|
|
||||||
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
|
|
||||||
dependencies:
|
|
||||||
color-convert "^2.0.1"
|
|
||||||
|
|
||||||
array-union@^2.1.0:
|
array-union@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
|
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
|
||||||
@@ -311,14 +304,6 @@ chalk@^2.4.2:
|
|||||||
escape-string-regexp "^1.0.5"
|
escape-string-regexp "^1.0.5"
|
||||||
supports-color "^5.3.0"
|
supports-color "^5.3.0"
|
||||||
|
|
||||||
chalk@^4.1.0:
|
|
||||||
version "4.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
|
|
||||||
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
|
|
||||||
dependencies:
|
|
||||||
ansi-styles "^4.1.0"
|
|
||||||
supports-color "^7.1.0"
|
|
||||||
|
|
||||||
chrome-trace-event@^1.0.2:
|
chrome-trace-event@^1.0.2:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac"
|
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac"
|
||||||
@@ -345,23 +330,11 @@ color-convert@^1.9.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
color-name "1.1.3"
|
color-name "1.1.3"
|
||||||
|
|
||||||
color-convert@^2.0.1:
|
|
||||||
version "2.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
|
|
||||||
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
|
|
||||||
dependencies:
|
|
||||||
color-name "~1.1.4"
|
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
||||||
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
|
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
|
||||||
|
|
||||||
color-name@~1.1.4:
|
|
||||||
version "1.1.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
|
||||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
|
||||||
|
|
||||||
colorette@^1.2.1, colorette@^1.3.0:
|
colorette@^1.2.1, colorette@^1.3.0:
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40"
|
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40"
|
||||||
@@ -439,7 +412,7 @@ electron-to-chromium@^1.3.830:
|
|||||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.836.tgz#823cb9c98f28c64c673920f1c90ea3826596eaf9"
|
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.836.tgz#823cb9c98f28c64c673920f1c90ea3826596eaf9"
|
||||||
integrity sha512-Ney3pHOJBWkG/AqYjrW0hr2AUCsao+2uvq9HUlRP8OlpSdk/zOHOUJP7eu0icDvePC9DlgffuelP4TnOJmMRUg==
|
integrity sha512-Ney3pHOJBWkG/AqYjrW0hr2AUCsao+2uvq9HUlRP8OlpSdk/zOHOUJP7eu0icDvePC9DlgffuelP4TnOJmMRUg==
|
||||||
|
|
||||||
enhanced-resolve@^5.0.0, enhanced-resolve@^5.8.0:
|
enhanced-resolve@^5.8.0:
|
||||||
version "5.8.2"
|
version "5.8.2"
|
||||||
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b"
|
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b"
|
||||||
integrity sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==
|
integrity sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==
|
||||||
@@ -598,6 +571,19 @@ get-stream@^6.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
|
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
|
||||||
integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==
|
integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==
|
||||||
|
|
||||||
|
github-graphql-client@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/github-graphql-client/-/github-graphql-client-1.0.0.tgz#d5acacc31bb9f6b77e5c502812e90c844f727bca"
|
||||||
|
integrity sha1-1ayswxu59rd+XFAoEukMhE9ye8o=
|
||||||
|
|
||||||
|
github-version-checker@^2.2.0:
|
||||||
|
version "2.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/github-version-checker/-/github-version-checker-2.2.0.tgz#08a2b52f9ef9cd3dd05b898537750a91b73facec"
|
||||||
|
integrity sha512-Ttj/Uzg++TGfycfn5ga8BfMJ8QYB1+DhG24rtasrN8tHYWgqqrEMAQ52y2qGnPNWzSF8AUdjm6dBcoPdUhKhDQ==
|
||||||
|
dependencies:
|
||||||
|
github-graphql-client "^1.0.0"
|
||||||
|
semver "^5.5.1"
|
||||||
|
|
||||||
glob-parent@^5.1.2:
|
glob-parent@^5.1.2:
|
||||||
version "5.1.2"
|
version "5.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
||||||
@@ -856,7 +842,7 @@ merge2@^1.3.0:
|
|||||||
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
|
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
|
||||||
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
||||||
|
|
||||||
micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4:
|
micromatch@^4.0.2, micromatch@^4.0.4:
|
||||||
version "4.0.4"
|
version "4.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9"
|
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9"
|
||||||
integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==
|
integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==
|
||||||
@@ -1147,18 +1133,11 @@ schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1:
|
|||||||
ajv "^6.12.5"
|
ajv "^6.12.5"
|
||||||
ajv-keywords "^3.5.2"
|
ajv-keywords "^3.5.2"
|
||||||
|
|
||||||
semver@^5.5.0, semver@^5.6.0:
|
semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
|
||||||
version "5.7.1"
|
version "5.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
||||||
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
||||||
|
|
||||||
semver@^7.3.4:
|
|
||||||
version "7.3.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
|
|
||||||
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
|
|
||||||
dependencies:
|
|
||||||
lru-cache "^6.0.0"
|
|
||||||
|
|
||||||
seq-queue@^0.0.5:
|
seq-queue@^0.0.5:
|
||||||
version "0.0.5"
|
version "0.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/seq-queue/-/seq-queue-0.0.5.tgz#d56812e1c017a6e4e7c3e3a37a1da6d78dd3c93e"
|
resolved "https://registry.yarnpkg.com/seq-queue/-/seq-queue-0.0.5.tgz#d56812e1c017a6e4e7c3e3a37a1da6d78dd3c93e"
|
||||||
@@ -1252,13 +1231,6 @@ supports-color@^5.3.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
has-flag "^3.0.0"
|
has-flag "^3.0.0"
|
||||||
|
|
||||||
supports-color@^7.1.0:
|
|
||||||
version "7.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
|
|
||||||
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
|
|
||||||
dependencies:
|
|
||||||
has-flag "^4.0.0"
|
|
||||||
|
|
||||||
supports-color@^8.0.0:
|
supports-color@^8.0.0:
|
||||||
version "8.1.1"
|
version "8.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
|
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
|
||||||
@@ -1306,16 +1278,6 @@ to-regex-range@^5.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-number "^7.0.0"
|
is-number "^7.0.0"
|
||||||
|
|
||||||
ts-loader@^9.2.5:
|
|
||||||
version "9.2.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.2.5.tgz#127733a5e9243bf6dafcb8aa3b8a266d8041dca9"
|
|
||||||
integrity sha512-al/ATFEffybdRMUIr5zMEWQdVnCGMUA9d3fXJ8dBVvBlzytPvIszoG9kZoR+94k6/i293RnVOXwMaWbXhNy9pQ==
|
|
||||||
dependencies:
|
|
||||||
chalk "^4.1.0"
|
|
||||||
enhanced-resolve "^5.0.0"
|
|
||||||
micromatch "^4.0.0"
|
|
||||||
semver "^7.3.4"
|
|
||||||
|
|
||||||
tslib@^2.0.0:
|
tslib@^2.0.0:
|
||||||
version "2.3.1"
|
version "2.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
|
||||||
|
|||||||
Reference in new issue
Block a user