fix(dashboard): show enriched network details
This commit is contained in:
@@ -16,6 +16,8 @@ export interface IpLocation {
|
||||
export interface IpNetwork {
|
||||
asn: string | null;
|
||||
provider: string | null;
|
||||
connectionType?: string | null;
|
||||
proxy?: boolean | null;
|
||||
}
|
||||
|
||||
export interface IpIntelligenceResult {
|
||||
@@ -112,6 +114,10 @@ export class ProxyCheckProvider implements IpIntelligenceProvider {
|
||||
network: {
|
||||
asn: stringValue(data.asn),
|
||||
provider: stringValue(data.provider) ?? stringValue(data.organisation),
|
||||
connectionType: stringValue(data.type),
|
||||
proxy: String(data.proxy).toLowerCase() === "yes"
|
||||
? true
|
||||
: String(data.proxy).toLowerCase() === "no" ? false : null,
|
||||
},
|
||||
rawResponse: root,
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ describe("ProxyCheck.io intelligence", () => {
|
||||
longitude: -122.0775,
|
||||
timezone: "America/Los_Angeles",
|
||||
},
|
||||
network: { asn: "AS15169", provider: "Google LLC" },
|
||||
network: { asn: "AS15169", provider: "Google LLC", connectionType: "Business", proxy: false },
|
||||
});
|
||||
expect(request).toHaveBeenCalledWith(
|
||||
expect.stringContaining("https://proxycheck.io/v2/8.8.8.8"),
|
||||
|
||||
Reference in New Issue
Block a user