Skip to content

Commit 9e20d2e

Browse files
authored
Revert PR #386 (#412)
* revert PR #386 * no backwards incompatibility
1 parent 2c4459a commit 9e20d2e

File tree

19 files changed

+75
-831
lines changed

19 files changed

+75
-831
lines changed

package-lock.json

Lines changed: 71 additions & 224 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
"private": true,
55
"license": "Apache-2.0",
66
"devDependencies": {
7-
"@aws-sdk/config-resolver": "^3.3.0",
8-
"@aws-sdk/middleware-stack": "^3.3.0",
9-
"@aws-sdk/node-config-provider": "^3.3.0",
10-
"@aws-sdk/smithy-client": "^3.3.0",
11-
"@aws-sdk/types": "^3.3.0",
127
"@hapi/hapi": "^20.0.0",
138
"@types/chai": "^4.2.12",
149
"@types/koa": "^2.11.3",
@@ -46,7 +41,6 @@
4641
"sinon": "^9.0.2",
4742
"sinon-chai": "^3.5.0",
4843
"tsd": "^0.13.1",
49-
"typescript": "^4.1.3",
5044
"upath": "^1.2.0"
5145
},
5246
"engines": {

packages/core/README.md

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ function sendRequest(host, cb) {
465465

466466
### Capture all outgoing AWS requests
467467

468-
This is only available for AWS SDK v2 due to the service-oriented architecture of AWS SDK v3.
469-
470468
```js
471469
var AWS = captureAWS(require('aws-sdk'));
472470

@@ -475,23 +473,6 @@ var AWS = captureAWS(require('aws-sdk'));
475473

476474
### Capture outgoing AWS requests on a single client
477475

478-
479-
AWS SDK v3
480-
481-
```js
482-
import { S3, PutObjectCommand } from '@aws-sdk/client-s3';
483-
484-
const s3 = AWSXRay.captureAWSv3Client(new S3({}));
485-
486-
await s3.send(new PutObjectCommand({
487-
Bucket: bucketName,
488-
Key: keyName,
489-
Body: 'Hello!',
490-
}));
491-
```
492-
493-
AWS SDK v2
494-
495476
```js
496477
var s3 = AWSXRay.captureAWSClient(new AWS.S3());
497478

@@ -642,27 +623,6 @@ function sendRequest(host, cb, subsegment) {
642623

643624
### Capture outgoing AWS requests on a single client
644625

645-
AWS SDK v3
646-
647-
You must re-capture the client every time the subsegment is attached
648-
to a new parent.
649-
650-
```js
651-
import { S3, PutObjectCommand } from '@aws-sdk/client-s3';
652-
653-
// subsegment is an optional parameter that is required for manual mode
654-
// and can be omitted in automatic mode (e.g. inside a Lambda function).
655-
const s3 = AWSXRay.captureAWSv3Client(new S3({}), subsegment);
656-
657-
await s3.send(new PutObjectCommand({
658-
Bucket: bucketName,
659-
Key: keyName,
660-
Body: 'Hello!',
661-
}));
662-
```
663-
664-
AWS SDK v2
665-
666626
```js
667627
var s3 = AWSXRay.captureAWSClient(new AWS.S3());
668628
var params = {
@@ -679,8 +639,6 @@ s3.putObject(params, function(err, data) {
679639

680640
### Capture all outgoing AWS requests
681641

682-
This is only available for AWS SDK v2 due to the service-oriented architecture of AWS SDK v3.
683-
684642
```js
685643
var AWS = captureAWS(require('aws-sdk'));
686644

packages/core/lib/aws-xray.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export { captureAsyncFunc, captureCallbackFunc, captureFunc } from './capture'
3939

4040
export { captureAWS, captureAWSClient } from './patchers/aws_p';
4141

42-
export type { captureAWSClient as captureAWSv3Client } from './patchers/aws3_p';
42+
export function captureAWSv3Client<T>(client: T, manualSeg?: SegmentLike): T;
4343

4444
export { captureHTTPs, captureHTTPsGlobal } from './patchers/http_p';
4545

packages/core/lib/aws-xray.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,8 @@ var AWSXRay = {
180180

181181
captureAWSClient: require('./patchers/aws_p').captureAWSClient,
182182

183-
/**
184-
* @param {AWSv3.Service} service - An instance of a AWS SDK v3 service to wrap.
185-
* @param {Segment|Subsegment} segment - Optional segment for manual mode.
186-
* @memberof AWSXRay
187-
* @function
188-
* @see module:aws3_p.captureAWSClient
189-
*/
190183

191-
captureAWSv3Client: require('./patchers/aws3_p').captureAWSClient,
184+
captureAWSv3Client: (client) => client,
192185

193186
/**
194187
* @param {http|https} module - The built in Node.js HTTP or HTTPS module.

packages/core/lib/patchers/aws3_p.d.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/core/lib/patchers/aws3_p.js

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)