chore: update dependencies and patch

This commit is contained in:
Linden committed 2022-09-21 13:57:55 +10:00
1 parent 706c3cf53d
commit 8fe63bc88a
5 files changed
+470 -470

No files matched your search

+6 -6
View File
@@ -21,18 +21,18 @@
},
"dependencies": {
"@citizenfx/server": "^2.0.5132-1",
"@types/node": "^17.0.32",
"@milahu/patch-package": "^6.4.14",
"@types/node": "^17.0.45",
"mysql2": "^2.3.3",
"named-placeholders": "^1.1.2",
"node-fetch": "^3.2.4",
"prettier": "^2.6.2"
"node-fetch": "^3.2.10",
"prettier": "^2.7.1"
},
"devDependencies": {
"@tellus/patch-package-with-pnpm-support": "github:Tellus/patch-package-with-pnpm-support",
"esbuild": "^0.14.39",
"esbuild": "^0.14.54",
"lerna": "^4.0.0",
"postinstall-postinstall": "^2.1.0",
"pretty-quick": "^3.1.3",
"typescript": "^4.6.4"
"typescript": "^4.8.3"
}
}
@@ -1,3 +1,8 @@
# generated by patch-package 6.4.14
#
# declared package:
# mysql2: ^2.3.3
#
diff --git a/node_modules/mysql2/index.d.ts b/node_modules/mysql2/index.d.ts
index a465b43..183dc97 100644
--- a/node_modules/mysql2/index.d.ts
@@ -216,8 +221,21 @@ index 0af4a7a..bce66bc 100644
string: function() {
return _this.packet.readLengthCodedString(field.encoding);
},
diff --git a/node_modules/mysql2/lib/pool.js b/node_modules/mysql2/lib/pool.js
index 2ad4998..6a7ab48 100644
--- a/node_modules/mysql2/lib/pool.js
+++ b/node_modules/mysql2/lib/pool.js
@@ -174,7 +174,7 @@ class Pool extends EventEmitter {
});
} catch (e) {
conn.release();
- throw e;
+ return cb(e);
}
});
}
diff --git a/node_modules/mysql2/promise.d.ts b/node_modules/mysql2/promise.d.ts
index 6ab3d6f..64246e8 100644
index 6ab3d6f..4d411ec 100644
--- a/node_modules/mysql2/promise.d.ts
+++ b/node_modules/mysql2/promise.d.ts
@@ -25,41 +25,15 @@ export interface Connection extends EventEmitter {
@@ -236,9 +254,10 @@ index 6ab3d6f..64246e8 100644
- query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(
- options: QueryOptions,
- values: any | any[] | { [param: string]: any }
- ): Promise<[T, FieldPacket[]]>;
+ sql_or_options: string | QueryOptions,
+ values?: any | any[] | { [param: string]: any },
): Promise<[T, FieldPacket[]]>;
+ ): Promise<[T, FieldPacket[], number]>;
execute<
T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader
@@ -335,3 +354,16 @@ 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
--- 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 {
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;
- 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;
+430 -459
View File
File diff suppressed because it is too large. Load diff
-1
View File
@@ -18,7 +18,6 @@ export const rawQuery = async (
[query, parameters, cb] = parseArguments(invokingResource, query, parameters, cb);
return await new Promise((resolve, reject) => {
//@ts-expect-error todo: patch type with executionTime
pool.query(query, parameters, (err, result, _, executionTime) => {
if (err) return reject(err);
-2
View File
@@ -25,9 +25,7 @@ export const rawTransaction = async (
await connection.beginTransaction();
for (const transaction of transactions) {
//@ts-expect-error
const [result, fields, executionTime] = await connection.query(transaction.query, transaction.params);
//@ts-expect-error
logQuery(invokingResource, transaction.query, executionTime, transaction.params);
}