Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: quick addition of 'cur' and 'short' options #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions dist/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
type Type = "Residential" | "Wireless" | "Business" | "Hosting" | "TOR" | "SOCKS" | "SOCKS4" | "SOCKS4A" | "SOCKS5" | "SOCKS5H" | "Shadowsocks" | "HTTP" | "HTTPS" | "Compromised Server" | "Inference Engine" | "OpenVPN" | "VPN" | "whitelisted by x" | "blacklisted by x";
type Status = "ok" | "warning" | "denied" | "error";
type IPAddressInfo = {
ip?: string;
asn: string;
provider: string;
organisation: string;
Expand All @@ -14,7 +15,7 @@ type IPAddressInfo = {
city: string;
latitude: number;
longitude: number;
currency: {
currency?: {
code: string;
name: string;
symbol: string;
Expand All @@ -28,9 +29,9 @@ type ProxyCheckResponse = {
status: Status;
node?: string;
query_time?: string;
} & {
} & ({
[ipAddress: string]: IPAddressInfo;
};
} | IPAddressInfo);
interface ProxyCheckConstructor {
api_key: string;
}
Expand All @@ -45,6 +46,8 @@ interface ProxyCheckOptions {
seen?: 0 | 1;
days?: number;
tag?: string;
cur?: 0 | 1;
short?: 0 | 1;
}
interface ProxyCheckGetUsageReturn {
error?: string;
Expand Down
9 changes: 6 additions & 3 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
type Type = "Residential" | "Wireless" | "Business" | "Hosting" | "TOR" | "SOCKS" | "SOCKS4" | "SOCKS4A" | "SOCKS5" | "SOCKS5H" | "Shadowsocks" | "HTTP" | "HTTPS" | "Compromised Server" | "Inference Engine" | "OpenVPN" | "VPN" | "whitelisted by x" | "blacklisted by x";
type Status = "ok" | "warning" | "denied" | "error";
type IPAddressInfo = {
ip?: string;
asn: string;
provider: string;
organisation: string;
Expand All @@ -14,7 +15,7 @@ type IPAddressInfo = {
city: string;
latitude: number;
longitude: number;
currency: {
currency?: {
code: string;
name: string;
symbol: string;
Expand All @@ -28,9 +29,9 @@ type ProxyCheckResponse = {
status: Status;
node?: string;
query_time?: string;
} & {
} & ({
[ipAddress: string]: IPAddressInfo;
};
} | IPAddressInfo);
interface ProxyCheckConstructor {
api_key: string;
}
Expand All @@ -45,6 +46,8 @@ interface ProxyCheckOptions {
seen?: 0 | 1;
days?: number;
tag?: string;
cur?: 0 | 1;
short?: 0 | 1;
}
interface ProxyCheckGetUsageReturn {
error?: string;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "proxycheck-ts",
"version": "0.0.11",
"version": "0.0.12",
"description": "ProxyCheck.io API Client",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
14 changes: 10 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Type =
type Status = "ok" | "warning" | "denied" | "error"

export type IPAddressInfo = {
ip?: string
asn: string
provider: string
organisation: string
Expand All @@ -37,7 +38,7 @@ export type IPAddressInfo = {
city: string
latitude: number
longitude: number
currency: {
currency?: {
code: string
name: string
symbol: string
Expand All @@ -52,9 +53,12 @@ export type ProxyCheckResponse = {
status: Status
node?: string
query_time?: string
} & {
[ipAddress: string]: IPAddressInfo
}
} & (
| {
[ipAddress: string]: IPAddressInfo
}
| IPAddressInfo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm if the addition of type IPAddressInfo breaks existing versions?

)

interface ProxyCheckConstructor {
api_key: string
Expand All @@ -71,6 +75,8 @@ interface ProxyCheckOptions {
seen?: 0 | 1
days?: number
tag?: string
cur?: 0 | 1
short?: 0 | 1
}

interface ProxyCheckGetUsageReturn {
Expand Down