Skip to content

Commit

Permalink
chore: update dependencies & patches
Browse files Browse the repository at this point in the history
Something will probably break.
  • Loading branch information
thelindat committed Jan 20, 2023
1 parent f5a9d58 commit e675579
Show file tree
Hide file tree
Showing 5 changed files with 340 additions and 230 deletions.
Empty file removed .yarn.installed
Empty file.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
"postinstall": "patch-package && pnpm bootstrap"
},
"dependencies": {
"@citizenfx/server": "^2.0.5132-1",
"@citizenfx/server": "2.0.5132-1",
"@milahu/patch-package": "^6.4.14",
"@types/node": "^17.0.45",
"mysql2": "^2.3.3",
"named-placeholders": "^1.1.2",
"node-fetch": "^3.2.10",
"prettier": "^2.7.1"
"mysql2": "^3.0.1",
"named-placeholders": "^1.1.3",
"node-fetch": "^3.3.0",
"prettier": "^2.8.3"
},
"devDependencies": {
"esbuild": "^0.14.54",
"lerna": "^4.0.0",
"postinstall-postinstall": "^2.1.0",
"pretty-quick": "^3.1.3",
"typescript": "^4.8.3"
"typescript": "^4.9.4"
}
}
90 changes: 50 additions & 40 deletions patches/mysql2+^2.3.3.patch → patches/mysql2+^3.0.1.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# generated by patch-package 6.4.14
#
# declared package:
# mysql2: ^2.3.3
# mysql2: ^3.0.1
#
diff --git a/node_modules/mysql2/index.d.ts b/node_modules/mysql2/index.d.ts
index a465b43..183dc97 100644
index 31195a1..bc1adaa 100644
--- a/node_modules/mysql2/index.d.ts
+++ b/node_modules/mysql2/index.d.ts
@@ -166,7 +166,6 @@ export interface ConnectionOptions extends mysql.ConnectionOptions {
@@ -172,7 +172,6 @@ export interface ConnectionOptions extends mysql.ConnectionOptions {
decimalNumbers?: boolean;
isServer?: boolean;
maxPreparedStatements?: number;
Expand All @@ -16,33 +16,26 @@ index a465b43..183dc97 100644
passwordSha1?: string;
pool?: any;
diff --git a/node_modules/mysql2/lib/commands/query.js b/node_modules/mysql2/lib/commands/query.js
index e51da3c..a60811a 100644
index e51da3c..d9218d3 100644
--- a/node_modules/mysql2/lib/commands/query.js
+++ b/node_modules/mysql2/lib/commands/query.js
@@ -1,6 +1,5 @@
'use strict';

-const process = require('process');
const Timers = require('timers');

const Readable = require('stream').Readable;
@@ -19,7 +18,6 @@ class Query extends Command {
@@ -19,7 +19,6 @@ class Query extends Command {
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;
@@ -52,6 +50,7 @@ class Query extends Command {
@@ -52,6 +51,7 @@ class Query extends Command {
this._connection = connection;
this.options = Object.assign({}, connection.config, this._queryOptions);
this._setTimeout();
+ this._time = process.hrtime()

const cmdPacket = new Packets.Query(
this.sql,
@@ -73,7 +72,7 @@ class Query extends Command {
@@ -73,7 +73,7 @@ class Query extends Command {
this.queryTimeout = null;
}
if (this.onResult) {
Expand All @@ -51,7 +44,7 @@ index e51da3c..a60811a 100644
if (this._resultIndex === 0) {
rows = this._rows[0];
fields = this._fields[0];
@@ -81,13 +80,14 @@ class Query extends Command {
@@ -81,13 +81,14 @@ class Query extends Command {
rows = this._rows;
fields = this._fields;
}
Expand All @@ -69,10 +62,10 @@ index e51da3c..a60811a 100644
}
}
diff --git a/node_modules/mysql2/lib/connection.js b/node_modules/mysql2/lib/connection.js
index 47970e9..a0fec80 100644
index 7e8a1a0..cc749e0 100644
--- a/node_modules/mysql2/lib/connection.js
+++ b/node_modules/mysql2/lib/connection.js
@@ -27,8 +27,6 @@ const CharsetToEncoding = require('./constants/charset_encodings.js');
@@ -32,8 +32,6 @@ const CharsetToEncoding = require('./constants/charset_encodings.js');

let _connectionId = 0;

Expand All @@ -81,15 +74,16 @@ index 47970e9..a0fec80 100644
class Connection extends EventEmitter {
constructor(opts) {
super();
@@ -495,7 +493,6 @@ class Connection extends EventEmitter {
@@ -526,7 +524,7 @@ class Connection extends EventEmitter {
sql: sql,
values: values
};
- this._resolveNamedPlaceholders(opts);
+
return SqlString.format(
opts.sql,
opts.values,
@@ -516,23 +513,6 @@ class Connection extends EventEmitter {
@@ -547,23 +545,6 @@ class Connection extends EventEmitter {
return SqlString.raw(sql);
}

Expand All @@ -113,19 +107,21 @@ index 47970e9..a0fec80 100644
query(sql, values, cb) {
let cmdQuery;
if (sql.constructor === Commands.Query) {
@@ -540,7 +520,6 @@ class Connection extends EventEmitter {
@@ -571,7 +552,7 @@ class Connection extends EventEmitter {
} else {
cmdQuery = Connection.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);
@@ -608,26 +587,11 @@ class Connection extends EventEmitter {
@@ -639,26 +620,12 @@ class Connection extends EventEmitter {
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
Expand All @@ -150,18 +146,18 @@ index 47970e9..a0fec80 100644
if (typeof val === 'function') {
throw new TypeError(
diff --git a/node_modules/mysql2/lib/connection_config.js b/node_modules/mysql2/lib/connection_config.js
index 11ad01b..6fab74e 100644
index 98fa1d3..2189e33 100644
--- a/node_modules/mysql2/lib/connection_config.js
+++ b/node_modules/mysql2/lib/connection_config.js
@@ -187,7 +187,6 @@ class ConnectionConfig {
@@ -204,7 +204,6 @@ class ConnectionConfig {
'LONG_PASSWORD',
'FOUND_ROWS',
'LONG_FLAG',
- 'CONNECT_WITH_DB',
'ODBC',
'LOCAL_FILES',
'IGNORE_SPACE',
@@ -200,15 +199,14 @@ class ConnectionConfig {
@@ -217,15 +216,14 @@ class ConnectionConfig {
'TRANSACTIONS',
'SESSION_TRACK'
];
Expand All @@ -182,14 +178,15 @@ index 11ad01b..6fab74e 100644
}

diff --git a/node_modules/mysql2/lib/packets/execute.js b/node_modules/mysql2/lib/packets/execute.js
index c612f66..02dbe22 100644
index daf1df9..4ed2744 100644
--- a/node_modules/mysql2/lib/packets/execute.js
+++ b/node_modules/mysql2/lib/packets/execute.js
@@ -28,7 +28,9 @@ function toParameter(value, encoding, timezone) {
@@ -28,7 +28,10 @@ function toParameter(value, encoding, timezone) {
if (value !== null) {
switch (typeof value) {
case 'undefined':
- throw new TypeError('Bind parameters must not contain undefined');
+ // throw new TypeError('Bind parameters must not contain undefined');
+ value = '';
+ type = Types.NULL;
+ break
Expand All @@ -210,35 +207,35 @@ index bbd2959..80ab00d 100644
return `packet.readLengthCodedString(fields[${fieldNum}].encoding)`;
}
diff --git a/node_modules/mysql2/lib/parsers/text_parser.js b/node_modules/mysql2/lib/parsers/text_parser.js
index 0af4a7a..bce66bc 100644
index 49a128c..7eafb2c 100644
--- a/node_modules/mysql2/lib/parsers/text_parser.js
+++ b/node_modules/mysql2/lib/parsers/text_parser.js
@@ -85,6 +85,7 @@ function compile(fields, options, config) {
db: field.schema,
table: field.table,
name: field.name,
+ charset: field.characterSet,
string: function() {
return _this.packet.readLengthCodedString(field.encoding);
},
string: function(encoding = field.encoding) {
if (field.columnType === Types.JSON && encoding === field.encoding) {
// Since for JSON columns mysql always returns charset 63 (BINARY),
diff --git a/node_modules/mysql2/lib/pool.js b/node_modules/mysql2/lib/pool.js
index 2ad4998..6a7ab48 100644
index 6a7ab48..0ebd1d2 100644
--- a/node_modules/mysql2/lib/pool.js
+++ b/node_modules/mysql2/lib/pool.js
@@ -174,7 +174,7 @@ class Pool extends EventEmitter {
@@ -151,7 +151,7 @@ class Pool extends EventEmitter {
});
} catch (e) {
conn.release();
- throw e;
+ return cb(e);
}
});
}
return cmdQuery;
diff --git a/node_modules/mysql2/promise.d.ts b/node_modules/mysql2/promise.d.ts
index 6ab3d6f..4d411ec 100644
index b5441ab..9c1b413 100644
--- a/node_modules/mysql2/promise.d.ts
+++ b/node_modules/mysql2/promise.d.ts
@@ -25,41 +25,15 @@ export interface Connection extends EventEmitter {
@@ -26,41 +26,15 @@ export interface Connection extends EventEmitter {
changeUser(options: ConnectionOptions): Promise<void>;

query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(
Expand Down Expand Up @@ -284,8 +281,8 @@ index 6ab3d6f..4d411ec 100644
+ values?: any | any[] | { [param: string]: any },
): Promise<[T, FieldPacket[]]>;

unprepare(sql: string): void;
@@ -86,41 +60,15 @@ export interface PoolConnection extends Connection {
prepare(options: string | QueryOptions): Promise<PreparedStatementInfo>;
@@ -89,41 +63,15 @@ export interface PoolConnection extends Connection {

export interface Pool extends EventEmitter {
query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(
Expand Down Expand Up @@ -333,7 +330,7 @@ index 6ab3d6f..4d411ec 100644

getConnection(): Promise<PoolConnection>;
diff --git a/node_modules/mysql2/promise.js b/node_modules/mysql2/promise.js
index fc74cc0..fea1ccf 100644
index a264e77..20c1b68 100644
--- a/node_modules/mysql2/promise.js
+++ b/node_modules/mysql2/promise.js
@@ -4,7 +4,7 @@ const core = require('./index.js');
Expand All @@ -355,10 +352,10 @@ index fc74cc0..fea1ccf 100644
};
}
diff --git a/node_modules/mysql2/typings/mysql/lib/Connection.d.ts b/node_modules/mysql2/typings/mysql/lib/Connection.d.ts
index 4fb126e..2eaf562 100644
index 12204cf..b5899ef 100644
--- a/node_modules/mysql2/typings/mysql/lib/Connection.d.ts
+++ b/node_modules/mysql2/typings/mysql/lib/Connection.d.ts
@@ -218,7 +218,7 @@ declare class Connection extends EventEmitter {
@@ -254,7 +254,7 @@ declare class Connection extends EventEmitter {
changeUser(options: Connection.ConnectionOptions, callback?: (err: Query.QueryError | null) => void): void;

query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(sql: string, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query;
Expand All @@ -367,3 +364,16 @@ index 4fb126e..2eaf562 100644
query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(options: Query.QueryOptions, callback?: (err: Query.QueryError | null, result: T, fields?: FieldPacket[]) => any): Query;
query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(options: Query.QueryOptions, values: any | any[] | { [param: string]: any }, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query;

diff --git a/node_modules/mysql2/typings/mysql/lib/Pool.d.ts b/node_modules/mysql2/typings/mysql/lib/Pool.d.ts
index bebe039..d6fed9f 100644
--- a/node_modules/mysql2/typings/mysql/lib/Pool.d.ts
+++ b/node_modules/mysql2/typings/mysql/lib/Pool.d.ts
@@ -52,7 +52,7 @@ declare class Pool extends EventEmitter {
getConnection(callback: (err: NodeJS.ErrnoException | null, connection: PoolConnection) => any): void;

query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(sql: string, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query;
- query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(sql: string, values: any | any[] | { [param: string]: any }, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query;
+ query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(sql: string, values: any | any[] | { [param: string]: any }, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[], executionTime: number) => any): Query;
query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(options: Query.QueryOptions, callback?: (err: Query.QueryError | null, result: T, fields?: FieldPacket[]) => any): Query;
query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(options: Query.QueryOptions, values: any | any[] | { [param: string]: any }, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query;

Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# generated by patch-package 6.4.14
#
# declared package:
# named-placeholders: ^1.1.3
#
diff --git a/node_modules/named-placeholders/index.js b/node_modules/named-placeholders/index.js
index 527d723..53ef4cf 100644
index 3524ef5..e47335e 100644
--- a/node_modules/named-placeholders/index.js
+++ b/node_modules/named-placeholders/index.js
@@ -3,7 +3,7 @@
Expand All @@ -11,7 +16,7 @@ index 527d723..53ef4cf 100644
DQUOTE = 34,
SQUOTE = 39,
BSLASH = 92;
@@ -94,15 +94,24 @@ function createCompiler(config) {
@@ -92,15 +92,24 @@ function createCompiler(config) {
if (typeof params == 'undefined')
throw new Error('Named query contains placeholders, but parameters object is undefined');

Expand All @@ -38,7 +43,7 @@ index 527d723..53ef4cf 100644
return s.slice(0, -1);
}
return s;
@@ -115,7 +124,8 @@ function createCompiler(config) {
@@ -113,7 +122,8 @@ function createCompiler(config) {

let unnamed = noTailingSemicolon(tree[0][0]);
for (let i=1; i < tree[0].length; ++i) {
Expand All @@ -48,7 +53,7 @@ index 527d723..53ef4cf 100644
unnamed += config.placeholder;
}
unnamed += config.placeholder;
@@ -124,7 +134,8 @@ function createCompiler(config) {
@@ -122,7 +132,8 @@ function createCompiler(config) {

const last = tree[0][tree[0].length -1];
if (tree[0].length == tree[1].length) {
Expand Down
Loading

0 comments on commit e675579

Please sign in to comment.