@contrast/agentify
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -31,2 +31,5 @@ /* | ||
}, | ||
Function(args) { | ||
return Function(args); | ||
} | ||
}, | ||
@@ -33,0 +36,0 @@ installed: false, |
@@ -23,16 +23,24 @@ /* | ||
sources.install = function install() { | ||
depHooks.resolve({ name: 'http' }, http => patchCreateServer({ serverSource: http, patchName: 'httpServer' })); | ||
depHooks.resolve({ name: 'https' }, https => patchCreateServer({ serverSource: https, patchName: 'httpsServer' })); | ||
depHooks.resolve({ name: 'http' }, http => patchServerEmit(http, 'httpServer')); | ||
depHooks.resolve({ name: 'https' }, https => patchServerEmit(https, 'httpsServer')); | ||
depHooks.resolve({ name: 'http2' }, http2 => { | ||
patchCreateServer({ serverSource: http2, patchName: 'http2Server' }); | ||
patchCreateServer({ serverSource: http2, patchName: 'http2SecureServer', constructorName: 'createSecureServer' }); | ||
patchCreateServer(http2, 'http2Server'); | ||
patchCreateServer(http2, 'http2SecureServer', 'createSecureServer'); | ||
}); | ||
depHooks.resolve({ name: 'spdy' }, spdy => patchCreateServer({ serverSource: spdy, patchName: 'spdyServer' })); | ||
depHooks.resolve({ name: 'spdy' }, spdy => patchServerEmit(spdy, 'spdyServer')); | ||
}; | ||
function patchCreateServer({ serverSource, patchName, constructorName = 'createServer' }) { | ||
function patchServerEmit(serverSource, sourceName) { | ||
serverSource.Server.prototype = patcher.patch(serverSource.Server.prototype, 'emit', { | ||
name: `${sourceName}.Server.prototype.emit`, | ||
patchType: 'http-sources', | ||
around: emitAroundHook(sourceName) | ||
}); | ||
} | ||
function patchCreateServer(serverSource, sourceName, constructorName = 'createServer') { | ||
patcher.patch(serverSource, constructorName, { | ||
name: patchName, | ||
name: sourceName, | ||
patchType: 'http-sources', | ||
post: createServerPostHook(patchName) | ||
post: createServerPostHook(sourceName) | ||
}); | ||
@@ -52,3 +60,3 @@ } | ||
patcher.patch(serverPrototype, 'emit', { | ||
name: 'server.emit', | ||
name: 'Server.prototype.emit', | ||
patchType: 'req-async-storage', | ||
@@ -55,0 +63,0 @@ around: emitAroundHook(serverType) |
{ | ||
"name": "@contrast/agentify", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Configures Contrast agent services and instrumentation within an application", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18692
481