diff --git a/package-lock.json b/package-lock.json index 5142b3cd..7b528cb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5155,6 +5155,15 @@ "node": ">= 10.0.0" } }, + "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/aws-xray-sdk": { "resolved": "packages/full_sdk", "link": true @@ -6790,6 +6799,15 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" }, + "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": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -8751,6 +8769,15 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "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/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -10362,6 +10389,12 @@ "node": ">=0.10.0" } }, + "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/is-regex": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", @@ -11832,6 +11865,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "license": "Apache-2.0" + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -11843,6 +11882,21 @@ "node": ">=10" } }, + "node_modules/lru.min": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz", + "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==", + "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/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -13038,6 +13092,59 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, + "node_modules/mysql2": { + "version": "3.11.4", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.4.tgz", + "integrity": "sha512-Z2o3tY4Z8EvSRDwknaC40MdZ3+m0sKbpnXrShQLdxPrAvcNli7jLrD2Zd2IzsRMw4eK9Yle500FDmlkIqp+krg==", + "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/mysql2/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.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/named-placeholders/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/nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", @@ -16941,8 +17048,7 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sax": { "version": "1.2.1", @@ -17058,6 +17164,11 @@ "node": ">=0.6" } }, + "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/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -17574,6 +17685,15 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "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/ssri": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", @@ -19457,7 +19577,8 @@ "version": "3.10.2", "license": "Apache-2.0", "dependencies": { - "@types/mysql": "*" + "@types/mysql": "*", + "mysql2": "*" }, "engines": { "node": ">= 14.x" @@ -23892,6 +24013,11 @@ "xml2js": "0.5.0" } }, + "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==" + }, "aws-xray-sdk": { "version": "file:packages/full_sdk", "requires": { @@ -24133,7 +24259,8 @@ "aws-xray-sdk-mysql": { "version": "file:packages/mysql", "requires": { - "@types/mysql": "*" + "@types/mysql": "*", + "mysql2": "*" } }, "aws-xray-sdk-node": { @@ -28283,6 +28410,11 @@ "xml2js": "0.5.0" } }, + "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==" + }, "aws-xray-sdk": { "version": "file:packages/full_sdk", "requires": { @@ -28524,7 +28656,8 @@ "aws-xray-sdk-mysql": { "version": "file:packages/mysql", "requires": { - "@types/mysql": "*" + "@types/mysql": "*", + "mysql2": "*" } }, "aws-xray-sdk-postgres": { @@ -29759,6 +29892,11 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" }, + "denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -31237,6 +31375,14 @@ "wide-align": "^1.1.5" } }, + "generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "requires": { + "is-property": "^1.0.2" + } + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -32419,6 +32565,11 @@ "isobject": "^3.0.1" } }, + "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==" + }, "is-regex": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", @@ -33565,6 +33716,11 @@ "is-unicode-supported": "^0.1.0" } }, + "long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -33573,6 +33729,11 @@ "yallist": "^4.0.0" } }, + "lru.min": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz", + "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==" + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -34470,6 +34631,47 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, + "mysql2": { + "version": "3.11.4", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.4.tgz", + "integrity": "sha512-Z2o3tY4Z8EvSRDwknaC40MdZ3+m0sKbpnXrShQLdxPrAvcNli7jLrD2Zd2IzsRMw4eK9Yle500FDmlkIqp+krg==", + "requires": { + "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" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } + } + }, + "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==", + "requires": { + "lru-cache": "^7.14.1" + }, + "dependencies": { + "lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==" + } + } + }, "nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", @@ -37402,8 +37604,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sax": { "version": "1.2.1", @@ -37505,6 +37706,11 @@ } } }, + "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==" + }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -37919,6 +38125,11 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" + }, "ssri": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", @@ -40576,6 +40787,11 @@ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" }, + "denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -42054,6 +42270,14 @@ "wide-align": "^1.1.5" } }, + "generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "requires": { + "is-property": "^1.0.2" + } + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -43236,6 +43460,11 @@ "isobject": "^3.0.1" } }, + "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==" + }, "is-regex": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", @@ -44382,6 +44611,11 @@ "is-unicode-supported": "^0.1.0" } }, + "long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -44390,6 +44624,11 @@ "yallist": "^4.0.0" } }, + "lru.min": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.1.tgz", + "integrity": "sha512-FbAj6lXil6t8z4z3j0E5mfRlPzxkySotzUHwRXjlpRh10vc6AI6WN62ehZj82VG7M20rqogJ0GLwar2Xa05a8Q==" + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -45287,6 +45526,47 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, + "mysql2": { + "version": "3.11.4", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.4.tgz", + "integrity": "sha512-Z2o3tY4Z8EvSRDwknaC40MdZ3+m0sKbpnXrShQLdxPrAvcNli7jLrD2Zd2IzsRMw4eK9Yle500FDmlkIqp+krg==", + "requires": { + "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" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } + } + }, + "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==", + "requires": { + "lru-cache": "^7.14.1" + }, + "dependencies": { + "lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==" + } + } + }, "nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", @@ -48219,8 +48499,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sax": { "version": "1.2.1", @@ -48322,6 +48601,11 @@ } } }, + "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==" + }, "serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -48736,6 +49020,11 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" + }, "ssri": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", diff --git a/packages/mysql/README.md b/packages/mysql/README.md index 7a2acfc9..5d1d36fe 100644 --- a/packages/mysql/README.md +++ b/packages/mysql/README.md @@ -23,7 +23,7 @@ Manual mode requires that you pass around the segment reference. See the example ```js var AWSXRay = require('aws-xray-sdk'); -var pg = AWSXRay.captureMySQL(require('mysql')); +var mysql = AWSXRay.captureMySQL(require('mysql')); ... @@ -47,7 +47,7 @@ var config = { ... }; var connection = mysql.createConnection(config); connection.query('SELECT * FROM cats', function(err, rows) { - //Automatically captures query information and errors (if any) + // Automatically captures query information and errors (if any) }); ... @@ -55,7 +55,7 @@ connection.query('SELECT * FROM cats', function(err, rows) { var pool = mysql.createPool(config); pool.query('SELECT * FROM cats', function(err, rows, fields) { - //Automatically captures query information and errors (if any) + // Automatically captures query information and errors (if any) } ``` @@ -74,7 +74,7 @@ var config = { ... }; var connection = mysql.createConnection(config); connection.query('SELECT * FROM cats', function(err, rows) { - //Automatically captures query information and errors (if any) + // Automatically captures query information and errors (if any) }, segment); ... @@ -82,6 +82,23 @@ connection.query('SELECT * FROM cats', function(err, rows) { var pool = mysql.createPool(config); pool.query('SELECT * FROM cats', function(err, rows, fields) { - //Automatically captures query information and errors (if any) + // Automatically captures query information and errors (if any) }, segment); ``` + +## AWS X-Ray and MySQL2 + +The AWS X-Ray MySQL package also supports [MySQL2](https://www.npmjs.com/package/mysql2). Similar to above for MySQL, simply patch the MySQL2 package via `captureMySQL` as shown below. + +```js +var AWSXRay = require('aws-xray-sdk'); +var mysql2 = AWSXRay.captureMySQL(require('mysql2')); + +... + +exports.handler = function (event, context, callback) { + // Make MySQL2 queries normally +} +``` + +Note that support for `mysql2/promise` is not currently provided. diff --git a/packages/mysql/lib/mysql_p.d.ts b/packages/mysql/lib/mysql_p.d.ts index 5eef4931..a87592d9 100644 --- a/packages/mysql/lib/mysql_p.d.ts +++ b/packages/mysql/lib/mysql_p.d.ts @@ -1,7 +1,9 @@ import * as AWSXRay from 'aws-xray-sdk-core'; import * as MySQL from 'mysql'; +import type * as MySQL2 from 'mysql2'; export function captureMySQL(mysql: typeof MySQL): captureMySQL.PatchedMySQL; +export function captureMySQL(mysql2: typeof MySQL2): captureMySQL.PatchedMySQL2; declare namespace captureMySQL { interface PatchedQueryFunction { @@ -72,4 +74,100 @@ declare namespace captureMySQL { ? PatchedCreatePoolClusterFunction : T[K]; }; + + interface PatchedMySQL2QueryFunction { + ( + sql: string, + callback?: + | ((err: MySQL2.QueryError | null, result: T, fields: MySQL2.FieldPacket[]) => any) + | undefined, + segment?: AWSXRay.SegmentLike + ): MySQL2.Query; + ( + sql: string, + values: any, + callback?: + | ((err: MySQL2.QueryError | null, result: T, fields: MySQL2.FieldPacket[]) => any) + | undefined, + segment?: AWSXRay.SegmentLike + ): MySQL2.Query; + ( + options: MySQL2.QueryOptions, + callback?: + | ((err: MySQL2.QueryError | null, result: T, fields?: MySQL2.FieldPacket[]) => any) + | undefined, + segment?: AWSXRay.SegmentLike + ): MySQL2.Query; + ( + options: MySQL2.QueryOptions, + values: any, + callback?: + | ((err: MySQL2.QueryError | null, result: T, fields: MySQL2.FieldPacket[]) => any) + | undefined, + segment?: AWSXRay.SegmentLike + ): MySQL2.Query; + } + + type MySQL2QueryCallback = (err: MySQL2.QueryError | null, result: T, fields: MySQL2.FieldPacket[]) => any; + + type PatchedMySQL2Connection = { + [K in keyof T]: K extends 'query' + ? PatchedMySQL2QueryFunction + : T[K]; + }; + + type PatchedMySQL2PoolConnection = PatchedMySQL2Connection; + + type PatchedMySQL2PoolConnectionCallback = (err: MySQL.MysqlError, connection: PatchedMySQL2PoolConnection) => void; + + interface PatchedMySQL2PoolGetConnectionFunction { + (callback: PatchedMySQL2PoolConnectionCallback): void; + } + + type PatchedMySQL2Pool = { + [K in keyof T]: K extends 'query' + ? PatchedMySQL2QueryFunction + : K extends 'getConnection' + ? PatchedMySQL2PoolGetConnectionFunction + : T[K]; + }; + + interface PatchedMySQL2PoolClusterOfFunction { + (pattern?: string, selector?: string): PatchedMySQL2Pool; + } + + interface PatchedMySQL2PoolClusterGetConnectionFunction { + (callback: PatchedMySQL2PoolConnectionCallback): void; + (pattern: string, selector: string, callback: PatchedMySQL2PoolConnectionCallback): void; + } + + type PatchedMySQL2PoolCluster = { + [K in keyof T]: K extends 'of' + ? PatchedMySQL2PoolClusterOfFunction + : K extends 'getConnection' + ? PatchedMySQL2PoolClusterGetConnectionFunction + : T[K] + }; + + interface PatchedMySQL2CreateConnectionFunction { + (config: MySQL2.ConnectionOptions | string): PatchedMySQL2Connection; + } + + interface PatchedMySQL2CreatePoolFunction { + (config: MySQL2.PoolOptions | string): PatchedMySQL2Pool; + } + + interface PatchedMySQL2CreatePoolClusterFunction { + (config?: MySQL2.PoolClusterOptions): PatchedMySQL2PoolCluster; + } + + type PatchedMySQL2 = { + [K in keyof T]: K extends 'createConnection' + ? PatchedMySQL2CreateConnectionFunction + : K extends 'createPool' + ? PatchedMySQL2CreatePoolFunction + : K extends 'createPoolCluster' + ? PatchedMySQL2CreatePoolClusterFunction + : T[K]; + }; } diff --git a/packages/mysql/package.json b/packages/mysql/package.json index e0ea9762..be000971 100644 --- a/packages/mysql/package.json +++ b/packages/mysql/package.json @@ -4,6 +4,7 @@ "description": "AWS X-Ray Patcher for MySQL (Javascript)", "author": "Amazon Web Services", "contributors": [ + "Ross Rhodes", "Sandra McMullen " ], "main": "lib/index.js", @@ -15,7 +16,8 @@ "test": "test" }, "dependencies": { - "@types/mysql": "*" + "@types/mysql": "*", + "mysql2": "*" }, "peerDependencies": { "aws-xray-sdk-core": "^3.10.2" diff --git a/packages/mysql/test-d/index.test-d.ts b/packages/mysql/test-d/index.test-d.ts index cad8170e..03e8a8a7 100644 --- a/packages/mysql/test-d/index.test-d.ts +++ b/packages/mysql/test-d/index.test-d.ts @@ -1,36 +1,61 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import * as AWSXRay from 'aws-xray-sdk-core'; import * as MySQL from 'mysql'; +import * as MySQL2 from 'mysql2'; import { expectType } from 'tsd'; import { captureMySQL } from '../lib'; const segment = AWSXRay.getSegment(); const mysql = captureMySQL(MySQL); +const mysql2 = captureMySQL(MySQL2); const config = {}; -const connection: captureMySQL.PatchedConnection = mysql.createConnection(config); -const pool: captureMySQL.PatchedPool = mysql.createPool(config); -const poolCluster: captureMySQL.PatchedPoolCluster = mysql.createPoolCluster(config); +const connectionMySQL: captureMySQL.PatchedConnection = mysql.createConnection(config); +const poolMySQL: captureMySQL.PatchedPool = mysql.createPool(config); +const poolClusterMySQL: captureMySQL.PatchedPoolCluster = mysql.createPoolCluster(config); -const queryCallback: MySQL.queryCallback = function(err: MySQL.MysqlError | null, rows: any) { +const queryCallbackMySQL: MySQL.queryCallback = function (err: MySQL.MysqlError | null, rows: any) { }; -const getConnectionCallback = function(err: MySQL.MysqlError, conn: captureMySQL.PatchedConnection) { +const getConnectionCallbackMySQL = function (err: MySQL.MysqlError, conn: captureMySQL.PatchedConnection) { }; -expectType(connection.query('SELECT * FROM cats', queryCallback)); -expectType(connection.query('SELECT * FROM cats', queryCallback, segment)); +expectType(connectionMySQL.query('SELECT * FROM cats', queryCallbackMySQL)); +expectType(connectionMySQL.query('SELECT * FROM cats', queryCallbackMySQL, segment)); -expectType(pool.query('SELECT * FROM cats', queryCallback)); -expectType(pool.query('SELECT * FROM cats', queryCallback, segment)); -expectType(pool.getConnection(getConnectionCallback)); +expectType(poolMySQL.query('SELECT * FROM cats', queryCallbackMySQL)); +expectType(poolMySQL.query('SELECT * FROM cats', queryCallbackMySQL, segment)); +expectType(poolMySQL.getConnection(getConnectionCallbackMySQL)); -expectType(poolCluster.getConnection(getConnectionCallback)); -expectType(poolCluster.getConnection('pattern', getConnectionCallback)); -expectType(poolCluster.getConnection('pattern', 'selector', getConnectionCallback)); +expectType(poolClusterMySQL.getConnection(getConnectionCallbackMySQL)); +expectType(poolClusterMySQL.getConnection('pattern', getConnectionCallbackMySQL)); +expectType(poolClusterMySQL.getConnection('pattern', 'selector', getConnectionCallbackMySQL)); -expectType(poolCluster.of('pattern')); -expectType(poolCluster.of('pattern', 'selector')); -expectType(poolCluster.of(null, 'selector')); +expectType(poolClusterMySQL.of('pattern')); +expectType(poolClusterMySQL.of('pattern', 'selector')); +expectType(poolClusterMySQL.of(null, 'selector')); + +const connectionMySQL2: captureMySQL.PatchedMySQL2Connection = mysql2.createConnection(config); +const poolMySQL2: captureMySQL.PatchedMySQL2Pool = mysql2.createPool(config); +const poolClusterMySQL2: captureMySQL.PatchedMySQL2PoolCluster = mysql2.createPoolCluster(config); + +const queryCallbackMySQL2: captureMySQL.MySQL2QueryCallback | undefined = function () { }; + +const getConnectionCallbackMySQL2 = function (err: MySQL.MysqlError, conn: captureMySQL.PatchedMySQL2Connection) { +}; + +expectType(connectionMySQL2.query('SELECT * FROM cats', queryCallbackMySQL2)); +expectType(connectionMySQL2.query('SELECT * FROM cats', queryCallbackMySQL2, segment)); + +expectType(poolMySQL2.query('SELECT * FROM cats', queryCallbackMySQL2)); +expectType(poolMySQL2.query('SELECT * FROM cats', queryCallbackMySQL2, segment)); +expectType(poolMySQL2.getConnection(getConnectionCallbackMySQL2)); + +expectType(poolClusterMySQL2.getConnection(getConnectionCallbackMySQL2)); +expectType(poolClusterMySQL2.getConnection('pattern', 'selector', getConnectionCallbackMySQL2)); + +expectType(poolClusterMySQL2.of('pattern')); +expectType(poolClusterMySQL2.of('pattern', 'selector')); +expectType(poolClusterMySQL2.of(null, 'selector'));