Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-xray-sdk-fetch

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-xray-sdk-fetch - npm Package Compare versions

Comparing version 3.10.1 to 3.10.2

6

lib/fetch_p.d.ts

@@ -20,1 +20,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */

export function enableCapture<Fetch, Request>(
fetch: Fetch,
request: Request,
downstreamXRayEnabled?: boolean,
subsegmentCallback?: (subsegment: AWSXRay.Subsegment, req: Request, res: Response | null, error?: Error | undefined) => void
): Fetch;

19

lib/fetch_p.js

@@ -57,3 +57,14 @@ /**

const enableCapture = function enableCapture(baseFetchFunction, requestClass, downstreamXRayEnabled, subsegmentCallback) {
/**
* Return a fetch function that will pass segment information to the target host.
* This does not change any globals
* @param {function} baseFetchFunction fetch function to use as basis
* @param {function} requestClass Request class to use. This should correspond to the supplied fetch function.
* @param {boolean} downstreamXRayEnabled - when true, adds a "traced:true" property to the subsegment
* so the AWS X-Ray service expects a corresponding segment from the downstream service.
* @param {function} subsegmentCallback - a callback that is called with the subsegment, the fetch request,
* the fetch response and any error issued, allowing custom annotations and metadata to be added.
* @returns Response
*/
function enableCapture(baseFetchFunction, requestClass, downstreamXRayEnabled, subsegmentCallback) {

@@ -120,3 +131,3 @@ const overridenFetchAsync = async (...args) => {

try {
response = await baseFetchFunction(...args);
response = await baseFetchFunction(requestClone);

@@ -164,6 +175,6 @@ if (thisSubsegmentCallback) {

return overridenFetchAsync;
};
}
module.exports.captureFetchGlobal = captureFetchGlobal;
module.exports.captureFetchModule = captureFetchModule;
module.exports._fetchEnableCapture = enableCapture;
module.exports.enableCapture = enableCapture;
{
"name": "aws-xray-sdk-fetch",
"version": "3.10.1",
"version": "3.10.2",
"description": "AWS X-Ray plugin for node-fetch",

@@ -24,3 +24,3 @@ "author": "Amazon Web Services",

"peerDependencies": {
"aws-xray-sdk-core": "^3.10.1"
"aws-xray-sdk-core": "^3.10.2"
},

@@ -44,3 +44,3 @@ "keywords": [

"@types/node-fetch": "^2.6.4",
"chai-as-promised": "^7.1.1",
"chai-as-promised": "=7.1.1",
"node-fetch": "^2.6.11",

@@ -52,3 +52,3 @@ "ts-expect": "^1.3.0"

},
"gitHead": "5539f1ab3a33f8df7b8add9e450b536886250a3a"
"gitHead": "3b89008bb32caef55609c7e3e9f936c75545620a"
}

@@ -46,1 +46,2 @@ # fetch-xray

- [Jason Terando](https://github.com/jasonterando)
- [Bernd Fuhrmann](https://github.com/berndfuhrmann)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc