From 9e20d2e880d706baa9ef8041ae70989f2f932c04 Mon Sep 17 00:00:00 2001 From: William Armiros <54150514+willarmiros@users.noreply.github.com> Date: Mon, 12 Apr 2021 15:43:47 -0600 Subject: [PATCH] Revert PR #386 (#412) * revert PR #386 * no backwards incompatibility --- package-lock.json | 295 +++++------------- package.json | 6 - packages/core/README.md | 42 --- packages/core/lib/aws-xray.d.ts | 2 +- packages/core/lib/aws-xray.js | 9 +- packages/core/lib/patchers/aws3_p.d.ts | 8 - packages/core/lib/patchers/aws3_p.js | 113 ------- packages/core/lib/patchers/aws3_p.ts | 171 ---------- .../lib/segments/attributes/subsegment.d.ts | 3 - packages/core/lib/segments/segment.d.ts | 1 - packages/core/package.json | 4 +- .../core/test/unit/patchers/aws3_p.test.js | 214 ------------- packages/core/tsconfig.json | 11 - packages/express/test-d/index.test-d.ts | 2 +- packages/express/tsconfig.json | 5 - packages/full_sdk/tsconfig.json | 5 - packages/mysql/tsconfig.json | 5 - packages/postgres/tsconfig.json | 5 - packages/restify/tsconfig.json | 5 - 19 files changed, 75 insertions(+), 831 deletions(-) delete mode 100644 packages/core/lib/patchers/aws3_p.d.ts delete mode 100644 packages/core/lib/patchers/aws3_p.js delete mode 100644 packages/core/lib/patchers/aws3_p.ts delete mode 100644 packages/core/test/unit/patchers/aws3_p.test.js delete mode 100644 packages/core/tsconfig.json delete mode 100644 packages/express/tsconfig.json delete mode 100644 packages/full_sdk/tsconfig.json delete mode 100644 packages/mysql/tsconfig.json delete mode 100644 packages/postgres/tsconfig.json delete mode 100644 packages/restify/tsconfig.json diff --git a/package-lock.json b/package-lock.json index 3dfd5969..0e4efe19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,119 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@aws-sdk/config-resolver": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/config-resolver/-/config-resolver-3.8.0.tgz", - "integrity": "sha512-dtVB+yaT6gEqvzDt/pFS2suESTHb4qMiak3i34emSAcXilLYwOm3avUV/GApc499epQdxv/aRDAupanLVqTA1g==", - "dev": true, - "requires": { - "@aws-sdk/signature-v4": "3.6.1", - "@aws-sdk/types": "3.6.1", - "tslib": "^1.8.0" - } - }, - "@aws-sdk/is-array-buffer": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/is-array-buffer/-/is-array-buffer-3.6.1.tgz", - "integrity": "sha512-qm2iDJmCrxlQE2dsFG+TujPe7jw4DF+4RTrsFMhk/e3lOl3MAzQ6Fc2kXtgeUcVrZVFTL8fQvXE1ByYyI6WbCw==", - "dev": true, - "requires": { - "tslib": "^1.8.0" - } - }, - "@aws-sdk/middleware-stack": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-stack/-/middleware-stack-3.6.1.tgz", - "integrity": "sha512-EPsIxMi8LtCt7YwTFpWGlVGYJc0q4kwFbOssY02qfqdCnyqi2y5wo089dH7OdxUooQ0D7CPsXM1zTTuzvm+9Fw==", - "dev": true, - "requires": { - "tslib": "^1.8.0" - } - }, - "@aws-sdk/node-config-provider": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/node-config-provider/-/node-config-provider-3.8.0.tgz", - "integrity": "sha512-VBpFquxACQO9MbdOIz35JgwOH+oJ5JwXpEq2faIhK+0zyM0JqLfJNFnnmHaEH9kBVcdOYJihzDgFje3AnYn7PQ==", - "dev": true, - "requires": { - "@aws-sdk/property-provider": "3.8.0", - "@aws-sdk/shared-ini-file-loader": "3.8.0", - "@aws-sdk/types": "3.6.1", - "tslib": "^1.8.0" - } - }, - "@aws-sdk/property-provider": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/property-provider/-/property-provider-3.8.0.tgz", - "integrity": "sha512-9tOvTp6ObNdBgkqxXu5bpEdyzVnStO+aUprTbCH0lUfgCeig4q21xOt6Xsqt616WGtDJCAbMcdCay0XiDLLjAw==", - "dev": true, - "requires": { - "@aws-sdk/types": "3.6.1", - "tslib": "^1.8.0" - } - }, - "@aws-sdk/service-error-classification": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/service-error-classification/-/service-error-classification-3.6.1.tgz", - "integrity": "sha512-kZ7ZhbrN1f+vrSRkTJvXsu7BlOyZgym058nPA745+1RZ1Rtv4Ax8oknf2RvJyj/1qRUi8LBaAREjzQ3C8tmLBA==" - }, - "@aws-sdk/shared-ini-file-loader": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/shared-ini-file-loader/-/shared-ini-file-loader-3.8.0.tgz", - "integrity": "sha512-wjywtEcsYPwB+asK5iWGeox9ZI4ycaxIGRKJTahFo+VUK6mByIEEG/IF7HuQclSSeDFTt9Occ7hQpXpJ97zpdA==", - "dev": true, - "requires": { - "tslib": "^1.8.0" - } - }, - "@aws-sdk/signature-v4": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4/-/signature-v4-3.6.1.tgz", - "integrity": "sha512-EAR0qGVL4AgzodZv4t+BSuBfyOXhTNxDxom50IFI1MqidR9vI6avNZKcPHhgXbm7XVcsDGThZKbzQ2q7MZ2NTA==", - "dev": true, - "requires": { - "@aws-sdk/is-array-buffer": "3.6.1", - "@aws-sdk/types": "3.6.1", - "@aws-sdk/util-hex-encoding": "3.6.1", - "@aws-sdk/util-uri-escape": "3.6.1", - "tslib": "^1.8.0" - } - }, - "@aws-sdk/smithy-client": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/smithy-client/-/smithy-client-3.6.1.tgz", - "integrity": "sha512-AVpRK4/iUxNeDdAm8UqP0ZgtgJMQeWcagTylijwelhWXyXzHUReY1sgILsWcdWnoy6gq845W7K2VBhBleni8+w==", - "dev": true, - "requires": { - "@aws-sdk/middleware-stack": "3.6.1", - "@aws-sdk/types": "3.6.1", - "tslib": "^1.8.0" - } - }, - "@aws-sdk/types": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.6.1.tgz", - "integrity": "sha512-4Dx3eRTrUHLxhFdLJL8zdNGzVsJfAxtxPYYGmIddUkO2Gj3WA1TGjdfG4XN/ClI6e1XonCHafQX3UYO/mgnH3g==", - "dev": true - }, - "@aws-sdk/util-hex-encoding": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-hex-encoding/-/util-hex-encoding-3.6.1.tgz", - "integrity": "sha512-pzsGOHtU2eGca4NJgFg94lLaeXDOg8pcS9sVt4f9LmtUGbrqRveeyBv0XlkHeZW2n0IZBssPHipVYQFlk7iaRA==", - "dev": true, - "requires": { - "tslib": "^1.8.0" - } - }, - "@aws-sdk/util-uri-escape": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-uri-escape/-/util-uri-escape-3.6.1.tgz", - "integrity": "sha512-tgABiT71r0ScRJZ1pMX0xO0QPMMiISCtumph50IU5VDyZWYgeIxqkMhIcrL1lX0QbNCMgX0n6rZxGrrbjDNavA==", - "dev": true, - "requires": { - "tslib": "^1.8.0" - } - }, "@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", @@ -127,31 +14,30 @@ } }, "@babel/compat-data": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.8.tgz", - "integrity": "sha512-EaI33z19T4qN3xLXsGf48M2cDqa6ei9tPZlfLdb2HC+e/cFtREiRd8hdSqDbwdLB0/+gLwqJmCYASH0z2bUdog==", + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.15.tgz", + "integrity": "sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA==", "dev": true }, "@babel/core": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.8.tgz", - "integrity": "sha512-oYapIySGw1zGhEFRd6lzWNLWFX2s5dA/jm+Pw/+59ZdXtjyIuwlXbrId22Md0rgZVop+aVoqow2riXhBLNyuQg==", + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.15.tgz", + "integrity": "sha512-6GXmNYeNjS2Uz+uls5jalOemgIhnTMeaXo+yBUA72kC2uX/8VW6XyhVIo2L8/q0goKQA3EVKx0KOQpVKSeWadQ==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.0", - "@babel/helper-compilation-targets": "^7.13.8", - "@babel/helper-module-transforms": "^7.13.0", - "@babel/helpers": "^7.13.0", - "@babel/parser": "^7.13.4", + "@babel/generator": "^7.13.9", + "@babel/helper-compilation-targets": "^7.13.13", + "@babel/helper-module-transforms": "^7.13.14", + "@babel/helpers": "^7.13.10", + "@babel/parser": "^7.13.15", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.0", + "@babel/traverse": "^7.13.15", + "@babel/types": "^7.13.14", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "lodash": "^4.17.19", "semver": "^6.3.0", "source-map": "^0.5.0" }, @@ -166,9 +52,9 @@ } }, "@babel/parser": { - "version": "7.13.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.9.tgz", - "integrity": "sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw==", + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.15.tgz", + "integrity": "sha512-b9COtcAlVEQljy/9fbcMHpG+UIW9ReF+gpaxDHTlZd0c6/UU9ng8zdySAW9sRTzpvcdCHn6bUcbuYUgGzLAWVQ==", "dev": true }, "json5": { @@ -200,12 +86,12 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.8.tgz", - "integrity": "sha512-pBljUGC1y3xKLn1nrx2eAhurLMA8OqBtBP/JwG4U8skN7kf8/aqwwxpV1N6T0e7r6+7uNitIa/fUxPFagSXp3A==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz", + "integrity": "sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.13.8", + "@babel/compat-data": "^7.13.12", "@babel/helper-validator-option": "^7.12.17", "browserslist": "^4.14.5", "semver": "^6.3.0" @@ -240,38 +126,37 @@ } }, "@babel/helper-member-expression-to-functions": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.0.tgz", - "integrity": "sha512-yvRf8Ivk62JwisqV1rFRMxiSMDGnN6KH1/mDMmIrij4jztpQNRoHqqMG3U6apYbGRPJpgPalhva9Yd06HlUxJQ==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", "dev": true, "requires": { - "@babel/types": "^7.13.0" + "@babel/types": "^7.13.12" } }, "@babel/helper-module-imports": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz", - "integrity": "sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", "dev": true, "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.13.12" } }, "@babel/helper-module-transforms": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.0.tgz", - "integrity": "sha512-Ls8/VBwH577+pw7Ku1QkUWIyRRNHpYlts7+qSqBBFCW3I8QteB9DxfcZ5YJpOwH6Ihe/wn8ch7fMGOP1OhEIvw==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz", + "integrity": "sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-simple-access": "^7.12.13", + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", "@babel/helper-split-export-declaration": "^7.12.13", "@babel/helper-validator-identifier": "^7.12.11", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.0", - "lodash": "^4.17.19" + "@babel/traverse": "^7.13.13", + "@babel/types": "^7.13.14" } }, "@babel/helper-optimise-call-expression": { @@ -284,24 +169,24 @@ } }, "@babel/helper-replace-supers": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.0.tgz", - "integrity": "sha512-Segd5me1+Pz+rmN/NFBOplMbZG3SqRJOBlY+mA0SxAv6rjj7zJqr1AVr3SfzUVTLCv7ZLU5FycOM/SBGuLPbZw==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.0", + "@babel/helper-member-expression-to-functions": "^7.13.12", "@babel/helper-optimise-call-expression": "^7.12.13", "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.0" + "@babel/types": "^7.13.12" } }, "@babel/helper-simple-access": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz", - "integrity": "sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", "dev": true, "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.13.12" } }, "@babel/helper-split-export-declaration": { @@ -326,9 +211,9 @@ "dev": true }, "@babel/helpers": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.0.tgz", - "integrity": "sha512-aan1MeFPxFacZeSz6Ld7YZo5aPuqnKlD7+HZY75xQsueczFccP9A7V05+oe0XpLwHK3oLorPe9eaAUljL7WEaQ==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.10.tgz", + "integrity": "sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ==", "dev": true, "requires": { "@babel/template": "^7.12.13", @@ -389,20 +274,19 @@ } }, "@babel/traverse": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.0.tgz", - "integrity": "sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ==", + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.15.tgz", + "integrity": "sha512-/mpZMNvj6bce59Qzl09fHEs8Bt8NnpEDQYleHUPZQ3wXUMvXi+HJPLars68oAbmp839fGoOkv2pSL2z9ajCIaQ==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.0", + "@babel/generator": "^7.13.9", "@babel/helper-function-name": "^7.12.13", "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.13.0", - "@babel/types": "^7.13.0", + "@babel/parser": "^7.13.15", + "@babel/types": "^7.13.14", "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "globals": "^11.1.0" }, "dependencies": { "@babel/code-frame": { @@ -415,9 +299,9 @@ } }, "@babel/parser": { - "version": "7.13.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.9.tgz", - "integrity": "sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw==", + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.15.tgz", + "integrity": "sha512-b9COtcAlVEQljy/9fbcMHpG+UIW9ReF+gpaxDHTlZd0c6/UU9ng8zdySAW9sRTzpvcdCHn6bUcbuYUgGzLAWVQ==", "dev": true }, "globals": { @@ -429,9 +313,9 @@ } }, "@babel/types": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", - "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz", + "integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.12.11", @@ -3244,7 +3128,6 @@ "aws-xray-sdk-core": { "version": "file:packages/core", "requires": { - "@aws-sdk/service-error-classification": "^3.4.1", "@types/cls-hooked": "^4.2.2", "atomic-batcher": "^1.0.2", "cls-hooked": "^4.2.2", @@ -3877,9 +3760,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001197", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001197.tgz", - "integrity": "sha512-8aE+sqBqtXz4G8g35Eg/XEaFr2N7rd/VQ6eABGBmNtcB8cN6qNJhMi6oSFy4UWWZgqgL3filHT8Nha4meu3tsw==", + "version": "1.0.30001208", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz", + "integrity": "sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA==", "dev": true }, "caseless": { @@ -5074,9 +4957,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.683", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.683.tgz", - "integrity": "sha512-8mFfiAesXdEdE0DhkMKO7W9U6VU/9T3VTWwZ+4g84/YMP4kgwgFtQgUxuu7FUMcvSeKSNhFQNU+WZ68BQTLT5A==", + "version": "1.3.712", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.712.tgz", + "integrity": "sha512-3kRVibBeCM4vsgoHHGKHmPocLqtFAGTrebXxxtgKs87hNUzXrX2NuS3jnBys7IozCnw7viQlozxKkmty2KNfrw==", "dev": true }, "emitter-listener": { @@ -7146,14 +7029,6 @@ "requires": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" - }, - "dependencies": { - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - } } }, "he": { @@ -12731,24 +12606,10 @@ }, "dependencies": { "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "requires": { - "debug": "4" - } - }, - "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "dev": true, - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - } + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", + "dev": true }, "https-proxy-agent": { "version": "4.0.0", @@ -12758,14 +12619,6 @@ "requires": { "agent-base": "5", "debug": "4" - }, - "dependencies": { - "agent-base": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", - "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", - "dev": true - } } } } @@ -13328,12 +13181,6 @@ "is-typedarray": "^1.0.0" } }, - "typescript": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", - "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", - "dev": true - }, "uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", diff --git a/package.json b/package.json index 71d359fa..aac5b1b9 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,6 @@ "private": true, "license": "Apache-2.0", "devDependencies": { - "@aws-sdk/config-resolver": "^3.3.0", - "@aws-sdk/middleware-stack": "^3.3.0", - "@aws-sdk/node-config-provider": "^3.3.0", - "@aws-sdk/smithy-client": "^3.3.0", - "@aws-sdk/types": "^3.3.0", "@hapi/hapi": "^20.0.0", "@types/chai": "^4.2.12", "@types/koa": "^2.11.3", @@ -46,7 +41,6 @@ "sinon": "^9.0.2", "sinon-chai": "^3.5.0", "tsd": "^0.13.1", - "typescript": "^4.1.3", "upath": "^1.2.0" }, "engines": { diff --git a/packages/core/README.md b/packages/core/README.md index db07bfc9..e9091b24 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -465,8 +465,6 @@ function sendRequest(host, cb) { ### Capture all outgoing AWS requests -This is only available for AWS SDK v2 due to the service-oriented architecture of AWS SDK v3. - ```js var AWS = captureAWS(require('aws-sdk')); @@ -475,23 +473,6 @@ var AWS = captureAWS(require('aws-sdk')); ### Capture outgoing AWS requests on a single client - -AWS SDK v3 - -```js -import { S3, PutObjectCommand } from '@aws-sdk/client-s3'; - -const s3 = AWSXRay.captureAWSv3Client(new S3({})); - -await s3.send(new PutObjectCommand({ - Bucket: bucketName, - Key: keyName, - Body: 'Hello!', -})); -``` - -AWS SDK v2 - ```js var s3 = AWSXRay.captureAWSClient(new AWS.S3()); @@ -642,27 +623,6 @@ function sendRequest(host, cb, subsegment) { ### Capture outgoing AWS requests on a single client -AWS SDK v3 - -You must re-capture the client every time the subsegment is attached -to a new parent. - -```js -import { S3, PutObjectCommand } from '@aws-sdk/client-s3'; - -// subsegment is an optional parameter that is required for manual mode -// and can be omitted in automatic mode (e.g. inside a Lambda function). -const s3 = AWSXRay.captureAWSv3Client(new S3({}), subsegment); - -await s3.send(new PutObjectCommand({ - Bucket: bucketName, - Key: keyName, - Body: 'Hello!', -})); -``` - -AWS SDK v2 - ```js var s3 = AWSXRay.captureAWSClient(new AWS.S3()); var params = { @@ -679,8 +639,6 @@ s3.putObject(params, function(err, data) { ### Capture all outgoing AWS requests -This is only available for AWS SDK v2 due to the service-oriented architecture of AWS SDK v3. - ```js var AWS = captureAWS(require('aws-sdk')); diff --git a/packages/core/lib/aws-xray.d.ts b/packages/core/lib/aws-xray.d.ts index c517d94d..5347366f 100644 --- a/packages/core/lib/aws-xray.d.ts +++ b/packages/core/lib/aws-xray.d.ts @@ -39,7 +39,7 @@ export { captureAsyncFunc, captureCallbackFunc, captureFunc } from './capture' export { captureAWS, captureAWSClient } from './patchers/aws_p'; -export type { captureAWSClient as captureAWSv3Client } from './patchers/aws3_p'; +export function captureAWSv3Client(client: T, manualSeg?: SegmentLike): T; export { captureHTTPs, captureHTTPsGlobal } from './patchers/http_p'; diff --git a/packages/core/lib/aws-xray.js b/packages/core/lib/aws-xray.js index b81364a5..7f39e38a 100644 --- a/packages/core/lib/aws-xray.js +++ b/packages/core/lib/aws-xray.js @@ -180,15 +180,8 @@ var AWSXRay = { captureAWSClient: require('./patchers/aws_p').captureAWSClient, - /** - * @param {AWSv3.Service} service - An instance of a AWS SDK v3 service to wrap. - * @param {Segment|Subsegment} segment - Optional segment for manual mode. - * @memberof AWSXRay - * @function - * @see module:aws3_p.captureAWSClient - */ - captureAWSv3Client: require('./patchers/aws3_p').captureAWSClient, + captureAWSv3Client: (client) => client, /** * @param {http|https} module - The built in Node.js HTTP or HTTPS module. diff --git a/packages/core/lib/patchers/aws3_p.d.ts b/packages/core/lib/patchers/aws3_p.d.ts deleted file mode 100644 index 68d186af..00000000 --- a/packages/core/lib/patchers/aws3_p.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { MetadataBearer, Client } from '@aws-sdk/types'; -import type { RegionInputConfig } from '@aws-sdk/config-resolver'; -import { SegmentLike } from '../aws-xray'; -declare type DefaultConfiguration = RegionInputConfig & { - serviceId: string; -}; -export declare function captureAWSClient(client: Client, manualSegment?: SegmentLike): Client; -export {}; diff --git a/packages/core/lib/patchers/aws3_p.js b/packages/core/lib/patchers/aws3_p.js deleted file mode 100644 index 69d2fde0..00000000 --- a/packages/core/lib/patchers/aws3_p.js +++ /dev/null @@ -1,113 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.captureAWSClient = void 0; -const service_error_classification_1 = require("@aws-sdk/service-error-classification"); -const aws_1 = __importDefault(require("../segments/attributes/aws")); -const querystring_1 = require("querystring"); -const subsegment_1 = __importDefault(require("../segments/attributes/subsegment")); -var contextUtils = require('../context_utils'); -var logger = require('../logger'); -const utils_1 = require("../utils"); -async function buildAttributesFromMetadata(client, command, metadata) { - const { extendedRequestId, requestId, httpStatusCode: statusCode, attempts } = metadata; - const serviceIdentifier = client.config.serviceId; - let operation = command.constructor.name.slice(0, -7); - const aws = new aws_1.default({ - extendedRequestId, - requestId, - retryCount: attempts, - request: { - operation, - httpRequest: { - region: await client.config.region(), - statusCode, - }, - params: command.input, - }, - }, serviceIdentifier); - const http = { response: { status: statusCode || 0 } }; - return [aws, http]; -} -function addFlags(http, subsegment, err) { - var _a, _b; - if (err && service_error_classification_1.isThrottlingError(err)) { - subsegment.addThrottleFlag(); - } - else if (((_a = http.response) === null || _a === void 0 ? void 0 : _a.status) === 429) { - subsegment.addThrottleFlag(); - } - const cause = utils_1.getCauseTypeFromHttpStatus((_b = http.response) === null || _b === void 0 ? void 0 : _b.status); - if (cause === 'fault') { - subsegment.addFaultFlag(); - } - else if (cause === 'error') { - subsegment.addErrorFlag(); - } -} -function captureAWSClient(client, manualSegment) { - // create local copy so that we can later call it - const send = client.send; - const serviceIdentifier = client.config.serviceId; - client.send = async (...args) => { - const [command] = args; - const segment = manualSegment || contextUtils.resolveSegment(); - let operation = command.constructor.name.slice(0, -7); - if (!segment) { - const output = serviceIdentifier + '.' + operation; - if (!contextUtils.isAutomaticMode()) { - logger.getLogger().info('Call ' + output + ' requires a segment object' + - ' on the request params as "XRaySegment" for tracing in manual mode. Ignoring.'); - } - else { - logger.getLogger().info('Call ' + output + - ' is missing the sub/segment context for automatic mode. Ignoring.'); - } - return send.apply(client, args); - } - const subsegment = segment.addNewSubsegment(serviceIdentifier); - subsegment.addAttribute('namespace', 'aws'); - try { - const res = (await send.apply(client, [command])); - if (!res) - throw new Error('Failed to get response from instrumented AWS Client.'); - const [aws, http] = await buildAttributesFromMetadata(client, command, res.$metadata); - subsegment.addAttribute('aws', aws); - subsegment.addAttribute('http', http); - addFlags(http, subsegment); - subsegment.close(); - return res; - } - catch (err) { - if (err.$metadata) { - const [aws, http] = await buildAttributesFromMetadata(client, command, err.$metadata); - subsegment.addAttribute('aws', aws); - subsegment.addAttribute('http', http); - addFlags(http, subsegment, err); - } - const errObj = { message: err.message, name: err.name, stack: err.stack || new Error().stack }; - subsegment.close(errObj, true); - throw err; - } - }; - client.middlewareStack.add((next) => async (args) => { - const segment = manualSegment || contextUtils.resolveSegment(); - if (!segment) - return next(args); - const parent = (segment instanceof subsegment_1.default - ? segment.segment - : segment); - args.request.headers['X-Amzn-Trace-Id'] = querystring_1.stringify({ - Root: parent.trace_id, - Parent: segment.id, - Sampled: parent.notTraced ? '0' : '1', - }, ';'); - return next(args); - }, { - step: 'build', - }); - return client; -} -exports.captureAWSClient = captureAWSClient; diff --git a/packages/core/lib/patchers/aws3_p.ts b/packages/core/lib/patchers/aws3_p.ts deleted file mode 100644 index 19e377e1..00000000 --- a/packages/core/lib/patchers/aws3_p.ts +++ /dev/null @@ -1,171 +0,0 @@ -import type { - MetadataBearer, - ResponseMetadata, - Client, -} from '@aws-sdk/types'; - -import type { RegionInputConfig } from '@aws-sdk/config-resolver'; - -import { isThrottlingError } from '@aws-sdk/service-error-classification'; - -import ServiceSegment from '../segments/attributes/aws'; - -import { stringify } from 'querystring'; - -import Subsegment from '../segments/attributes/subsegment'; - -var contextUtils = require('../context_utils'); - -var logger = require('../logger'); - -import { getCauseTypeFromHttpStatus } from '../utils'; -import { SdkError } from '@aws-sdk/smithy-client'; -import { SegmentLike } from '../aws-xray'; - -type HttpResponse = { response: { status: number } }; - -async function buildAttributesFromMetadata( - client: any, - command: any, - metadata: ResponseMetadata, -): Promise<[ServiceSegment, HttpResponse]> { - const { extendedRequestId, requestId, httpStatusCode: statusCode, attempts } = metadata; - const serviceIdentifier = client.config.serviceId as string; - - let operation: string = command.constructor.name.slice(0, -7); - - const aws = new ServiceSegment( - { - extendedRequestId, - requestId, - retryCount: attempts, - request: { - operation, - httpRequest: { - region: await client.config.region(), - statusCode, - }, - params: command.input, - }, - }, - serviceIdentifier, - ); - - const http = { response: { status: statusCode || 0 } }; - return [aws, http]; -} - -function addFlags(http: HttpResponse, subsegment: Subsegment, err?: SdkError): void { - if (err && isThrottlingError(err)) { - subsegment.addThrottleFlag(); - } else if (http.response?.status === 429) { - subsegment.addThrottleFlag(); - } - - const cause = getCauseTypeFromHttpStatus(http.response?.status); - if (cause === 'fault') { - subsegment.addFaultFlag(); - } else if (cause === 'error') { - subsegment.addErrorFlag(); - } -} - -type DefaultConfiguration = RegionInputConfig & { - serviceId: string; -}; - -export function captureAWSClient< - Input extends object, - Output extends MetadataBearer, - Configuration extends DefaultConfiguration ->(client: Client, manualSegment?: SegmentLike): Client { - // create local copy so that we can later call it - const send = client.send; - - const serviceIdentifier = client.config.serviceId; - - client.send = async (...args: Parameters): Promise => { - const [command] = args; - const segment = manualSegment || contextUtils.resolveSegment(); - - let operation: string = command.constructor.name.slice(0, -7); - - if (!segment) { - const output = serviceIdentifier + '.' + operation; - - if (!contextUtils.isAutomaticMode()) { - logger.getLogger().info('Call ' + output + ' requires a segment object' + - ' on the request params as "XRaySegment" for tracing in manual mode. Ignoring.'); - } else { - logger.getLogger().info('Call ' + output + - ' is missing the sub/segment context for automatic mode. Ignoring.'); - } - return send.apply(client, args) as Promise; - } - - const subsegment = segment.addNewSubsegment(serviceIdentifier); - subsegment.addAttribute('namespace', 'aws'); - - try { - const res = (await send.apply(client, [command])) as Output; - - if (!res) throw new Error('Failed to get response from instrumented AWS Client.'); - - const [aws, http] = await buildAttributesFromMetadata( - client, - command, - res.$metadata, - ); - - subsegment.addAttribute('aws', aws); - subsegment.addAttribute('http', http); - - addFlags(http, subsegment); - subsegment.close(); - return res; - } catch (err) { - if (err.$metadata) { - const [aws, http] = await buildAttributesFromMetadata( - client, - command, - err.$metadata, - ); - - subsegment.addAttribute('aws', aws); - subsegment.addAttribute('http', http); - addFlags(http, subsegment, err); - } - - const errObj = { message: err.message, name: err.name, stack: err.stack || new Error().stack }; - - subsegment.close(errObj, true); - throw err; - } - }; - - client.middlewareStack.add( - (next) => async (args: any) => { - const segment = manualSegment || contextUtils.resolveSegment(); - if (!segment) return next(args); - - const parent = (segment instanceof Subsegment - ? segment.segment - : segment); - - args.request.headers['X-Amzn-Trace-Id'] = stringify( - { - Root: parent.trace_id, - Parent: segment.id, - Sampled: parent.notTraced ? '0' : '1', - }, - ';', - ); - return next(args); - }, - { - step: 'build', - }, - ); - - return client; -} diff --git a/packages/core/lib/segments/attributes/subsegment.d.ts b/packages/core/lib/segments/attributes/subsegment.d.ts index 022b1063..f37b0c75 100644 --- a/packages/core/lib/segments/attributes/subsegment.d.ts +++ b/packages/core/lib/segments/attributes/subsegment.d.ts @@ -1,5 +1,4 @@ import * as http from 'http'; -import { Segment, SegmentLike } from '../../aws-xray'; declare class Subsegment { id: string; @@ -7,8 +6,6 @@ declare class Subsegment { start_time: number; in_progress?: boolean; subsegments?: Array; - parent: SegmentLike; - segment: Segment; constructor(name: string); diff --git a/packages/core/lib/segments/segment.d.ts b/packages/core/lib/segments/segment.d.ts index f83de01e..c689eb40 100644 --- a/packages/core/lib/segments/segment.d.ts +++ b/packages/core/lib/segments/segment.d.ts @@ -11,7 +11,6 @@ declare class Segment { parent_id?: string; origin?: string; subsegments?: Array; - notTraced?: boolean; constructor(name: string, rootId?: string | null, parentId?: string | null); diff --git a/packages/core/package.json b/packages/core/package.json index e5e9cc0a..40804a40 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -5,8 +5,7 @@ "author": "Amazon Web Services", "contributors": [ "Sandra McMullen ", - "William Armiros ", - "Moritz Onken " + "William Armiros " ], "main": "lib/index.js", "types": "lib/index.d.ts", @@ -18,7 +17,6 @@ }, "//": "@types/cls-hooked is exposed in API so must be in dependencies, not devDependencies", "dependencies": { - "@aws-sdk/service-error-classification": "^3.4.1", "@types/cls-hooked": "^4.2.2", "atomic-batcher": "^1.0.2", "cls-hooked": "^4.2.2", diff --git a/packages/core/test/unit/patchers/aws3_p.test.js b/packages/core/test/unit/patchers/aws3_p.test.js deleted file mode 100644 index d7c6bac5..00000000 --- a/packages/core/test/unit/patchers/aws3_p.test.js +++ /dev/null @@ -1,214 +0,0 @@ -var assert = require('chai').assert; -var chai = require('chai'); -var sinon = require('sinon'); -var sinonChai = require('sinon-chai'); - -var Aws = require('../../../lib/segments/attributes/aws'); -var awsPatcher = require('../../../lib/patchers/aws3_p'); -var contextUtils = require('../../../lib/context_utils'); -var Segment = require('../../../lib/segments/segment'); -var Utils = require('../../../lib/utils'); - -var { constructStack } = require('@aws-sdk/middleware-stack'); - -var logger = require('../../../lib/logger').getLogger(); - -chai.should(); -chai.use(sinonChai); - -var traceId = '1-57fbe041-2c7ad569f5d6ff149137be86'; - -describe('AWS v3 patcher', function() { - describe('#captureAWSClient', function() { - var customStub, sandbox, addMiddleware; - - var awsClient = { - send: function() {}, - config: { - serviceId: 's3', - }, - middlewareStack: constructStack(), - }; - - beforeEach(function() { - sandbox = sinon.createSandbox(); - customStub = sandbox.stub(awsClient, 'send'); - addMiddleware = sandbox.stub(awsClient.middlewareStack, 'add'); - }); - - afterEach(function() { - sandbox.restore(); - }); - - it('should call middlewareStack.add and return the service', function() { - var patched = awsPatcher.captureAWSClient(awsClient); - addMiddleware.should.have.been.calledOnce; - assert.equal(patched, awsClient); - }); - }); - - describe('#captureAWSRequest', function() { - var awsClient, awsRequest, sandbox, segment, stubResolve, stubResolveManual, addNewSubsegmentStub, sub; - - before(function() { - awsClient = { - send: async (req) => { - const handler = awsClient.middlewareStack.resolve((args) => args); - await handler(req); - const error = req.response.error; - if (error) { - const err = new Error(error.message); - err.name = error.code; - err.$metadata = req.response.$metadata; - throw err; - } - return req.response; - }, - config: { - serviceId: 's3', - region: async () => 'us-east-1', - }, - middlewareStack: constructStack(), - }; - awsClient = awsPatcher.captureAWSClient(awsClient); - }); - - beforeEach(function() { - sandbox = sinon.createSandbox(); - - awsRequest = new (class ListBucketsCommand { - constructor() { - this.request = { - method: 'GET', - url: '/', - connection: { - remoteAddress: 'localhost' - }, - headers: {} - }; - this.response = { - $metadata: {} - }; - } - })(); - - segment = new Segment('testSegment', traceId); - sub = segment.addNewSubsegment('subseg'); - - stubResolveManual = sandbox.stub(contextUtils, 'resolveManualSegmentParams'); - stubResolve = sandbox.stub(contextUtils, 'resolveSegment').returns(segment); - addNewSubsegmentStub = sandbox.stub(segment, 'addNewSubsegment').returns(sub); - }); - - afterEach(function() { - sandbox.restore(); - }); - - it.skip('should call to resolve any manual params', function() { - awsClient.send(awsRequest); - - stubResolveManual.should.have.been.calledWith(awsRequest.params); - }); - - it('should log an info statement and exit if parent is not found on the context or on the call params', function(done) { - stubResolve.returns(); - var logStub = sandbox.stub(logger, 'info'); - - awsClient.send(awsRequest); - - setTimeout(function() { - logStub.should.have.been.calledOnce; - done(); - }, 50); - }); - - it('should inject the tracing headers', async function() { - sandbox.stub(contextUtils, 'isAutomaticMode').returns(true); - - awsClient.middlewareStack.add((next) => (args) => { - stubResolve.returns(sub); - next(args); - stubResolve.returns(segment); - }, { step: 'build', priority: 'high' }); - - await awsClient.send(awsRequest); - - assert.isTrue(addNewSubsegmentStub.calledWith('s3')); - - var expected = new RegExp('^Root=' + traceId + ';Parent=' + sub.id + ';Sampled=1$'); - assert.match(awsRequest.request.headers['X-Amzn-Trace-Id'], expected); - }); - - it('should close on complete with no errors when code 200 is seen', async function() { - var closeStub = sandbox.stub(sub, 'close').returns(); - sandbox.stub(contextUtils, 'isAutomaticMode').returns(true); - sandbox.stub(sub, 'addAttribute').returns(); - sandbox.stub(Aws.prototype, 'init').returns(); - - awsRequest.response = { - $metadata: { httpStatusCode: 200 }, - }; - - await awsClient.send(awsRequest); - - closeStub.should.have.been.calledWithExactly(); - }); - - it('should mark the subsegment as throttled and error if code 429 is seen', async function() { - var throttleStub = sandbox.stub(sub, 'addThrottleFlag').returns(); - - sandbox.stub(contextUtils, 'isAutomaticMode').returns(true); - sandbox.stub(sub, 'addAttribute').returns(); - sandbox.stub(Aws.prototype, 'init').returns(); - - awsRequest.response = { - error: { message: 'throttling', code: 'ThrottlingError' }, - $metadata: { httpStatusCode: 429 }, - }; - - await awsClient.send(awsRequest).catch(() => null); - - throttleStub.should.have.been.calledOnce; - assert.isTrue(sub.error); - }); - - it('should mark the subsegment as throttled and error if code service.throttledError returns true, regardless of status code', async function() { - var throttleStub = sandbox.stub(sub, 'addThrottleFlag').returns(); - - sandbox.stub(contextUtils, 'isAutomaticMode').returns(true); - sandbox.stub(sub, 'addAttribute').returns(); - sandbox.stub(Aws.prototype, 'init').returns(); - - awsRequest.response = { - error: { message: 'throttling', code: 'ProvisionedThroughputExceededException' }, - $metadata: { httpStatusCode: 400 }, - }; - - await awsClient.send(awsRequest).catch(() => null); - - throttleStub.should.have.been.calledOnce; - assert.isTrue(sub.error); - }); - - it('should capture an error on the response and mark exception as remote', async function() { - var closeStub = sandbox.stub(sub, 'close').returns(); - var getCauseStub = sandbox.stub(Utils, 'getCauseTypeFromHttpStatus').returns(); - - sandbox.stub(contextUtils, 'isAutomaticMode').returns(true); - sandbox.stub(sub, 'addAttribute').returns(); - sandbox.stub(Aws.prototype, 'init').returns(); - - var error = { message: 'big error', code: 'Error' }; - - awsRequest.response = { - error, - $metadata: { httpStatusCode: 500 }, - }; - - await awsClient.send(awsRequest).catch(() => null); - - getCauseStub.should.have.been.calledWithExactly(500); - closeStub.should.have.been.calledWithExactly(sinon.match({ message: error.message, name: error.code}), true); - }); - }); -}); diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json deleted file mode 100644 index 1a7a2de1..00000000 --- a/packages/core/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es2019", - "strict": true, - "strictNullChecks": true, - "declaration": true, - "esModuleInterop": true - }, - "files": ["lib/patchers/aws3_p.ts"] -} diff --git a/packages/express/test-d/index.test-d.ts b/packages/express/test-d/index.test-d.ts index d965afd4..9720c4c3 100644 --- a/packages/express/test-d/index.test-d.ts +++ b/packages/express/test-d/index.test-d.ts @@ -1,5 +1,5 @@ import * as AWSXRay from 'aws-xray-sdk-core'; -import express from 'express'; +import * as express from 'express'; import { expectType } from 'tsd'; import * as xrayExpress from '../lib'; diff --git a/packages/express/tsconfig.json b/packages/express/tsconfig.json deleted file mode 100644 index 2f980427..00000000 --- a/packages/express/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true - } -} diff --git a/packages/full_sdk/tsconfig.json b/packages/full_sdk/tsconfig.json deleted file mode 100644 index 2f980427..00000000 --- a/packages/full_sdk/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true - } -} diff --git a/packages/mysql/tsconfig.json b/packages/mysql/tsconfig.json deleted file mode 100644 index 2f980427..00000000 --- a/packages/mysql/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true - } -} diff --git a/packages/postgres/tsconfig.json b/packages/postgres/tsconfig.json deleted file mode 100644 index 2f980427..00000000 --- a/packages/postgres/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true - } -} diff --git a/packages/restify/tsconfig.json b/packages/restify/tsconfig.json deleted file mode 100644 index 2f980427..00000000 --- a/packages/restify/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "esModuleInterop": true - } -}