@contrast/architecture-components
Advanced tools
Comparing version 1.19.2 to 1.19.3
@@ -34,36 +34,46 @@ /* | ||
function install() { | ||
depHooks.resolve({ name: 'pg', file: 'lib/client.js' }, (Client) => { | ||
patcher.patch(Client.prototype, '_handleReadyForQuery', { | ||
name: 'pg.lib/Client', | ||
patchType, | ||
pre({ obj: client }) { | ||
client?.once('connect', () => { | ||
let urlStr = process.env.PGHOST || client.host; | ||
const port = process.env.PGPORT || client.port; | ||
const post = ({ result: client }) => { | ||
client?.once('connect', () => { | ||
let urlStr = process.env.PGHOST ?? client.host; | ||
const remotePort = process.env.PGPORT ?? client.port ?? 0; | ||
if (!urlStr) { | ||
return; | ||
} | ||
if (!urlStr) { | ||
return; | ||
} | ||
if (urlStr.indexOf('://') === -1) { | ||
urlStr = `postgresql://${urlStr}`; | ||
} | ||
if (urlStr.indexOf('://') === -1) { | ||
urlStr = `postgresql://${urlStr}`; | ||
} | ||
const url = getUrl(urlStr); | ||
if (!url) { | ||
logger.warn({ urlStr }, 'unable to report %s architecture component', vendor); | ||
return; | ||
} | ||
const url = getUrl(urlStr); | ||
if (!url) { | ||
logger.warn({ urlStr }, 'unable to report %s architecture component', vendor); | ||
return; | ||
} | ||
messages.emit(Event.ARCHITECTURE_COMPONENT, { | ||
remoteHost: '', | ||
remotePort: port || 0, | ||
type: 'db', | ||
url, | ||
vendor, | ||
}); | ||
}); | ||
} | ||
messages.emit(Event.ARCHITECTURE_COMPONENT, { | ||
remoteHost: '', | ||
remotePort, | ||
type: 'db', | ||
url, | ||
vendor, | ||
}); | ||
}); | ||
}); | ||
}; | ||
depHooks.resolve({ name: 'pg', file: 'lib/client.js' }, (Client) => | ||
patcher.patch(Client, { | ||
name: 'pg.Client', | ||
patchType, | ||
post, | ||
}) | ||
); | ||
depHooks.resolve({ name: 'pg', file: 'lib/native/client.js' }, (NativeClient) => | ||
patcher.patch(NativeClient, { | ||
name: 'pg.native.Client', | ||
patchType, | ||
post, | ||
}) | ||
); | ||
} | ||
@@ -70,0 +80,0 @@ |
{ | ||
"name": "@contrast/architecture-components", | ||
"version": "1.19.2", | ||
"version": "1.19.3", | ||
"description": "Detects external systems being connected to by applications.", | ||
@@ -20,4 +20,4 @@ "license": "SEE LICENSE IN LICENSE", | ||
"dependencies": { | ||
"@contrast/common": "1.21.2" | ||
"@contrast/common": "1.21.3" | ||
} | ||
} |
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
7765
177
+ Added@contrast/common@1.21.3(transitive)
- Removed@contrast/common@1.21.2(transitive)
Updated@contrast/common@1.21.3