@globalping/n8n-nodes-globalping
Version:
The Globalping n8n node allows you to perform network measurements such as ping, traceroute, mtr, http and DNS lookups from thousands of locations around the world.
242 lines (241 loc) • 11.9 kB
TypeScript
export type MeasurementContinent = 'AF' | 'AN' | 'AS' | 'EU' | 'NA' | 'OC' | 'SA';
export type MeasurementRegion = 'Northern Africa' | 'Eastern Africa' | 'Middle Africa' | 'Southern Africa' | 'Western Africa|Caribbean' | 'Central America' | 'South America' | 'Northern America' | 'Central Asia' | 'Eastern Asia' | 'South-eastern Asia' | 'Southern Asia' | 'Western Asia' | 'Eastern Europe' | 'Northern Europe' | 'Southern Europe' | 'Western Europe' | 'Australia and New Zealand' | 'Melanesia' | 'Micronesia' | 'Polynesia';
export type MeasurementCountry = 'AA' | 'AB' | 'AC' | 'AD' | 'AE' | 'AF' | 'AG' | 'AH' | 'AI' | 'AJ' | 'AK' | 'AL' | 'AM' | 'AN' | 'AO' | 'AP' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AV' | 'AW' | 'AX' | 'AY' | 'AZ' | 'BA' | 'BB' | 'BC' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BK' | 'BL' | 'BM' | 'BN' | 'BO' | 'BP' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BU' | 'BV' | 'BW' | 'BX' | 'BY' | 'BZ' | 'CA' | 'CB' | 'CC' | 'CD' | 'CE' | 'CF' | 'CG' | 'CH' | 'CI' | 'CJ' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CP' | 'CQ' | 'CR' | 'CS' | 'CT' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DA' | 'DB' | 'DC' | 'DD' | 'DE' | 'DF' | 'DG' | 'DH' | 'DI' | 'DJ' | 'DK' | 'DL' | 'DM' | 'DN' | 'DO' | 'DP' | 'DQ' | 'DR' | 'DS' | 'DT' | 'DU' | 'DV' | 'DW' | 'DX' | 'DY' | 'DZ' | 'EA' | 'EB' | 'EC' | 'ED' | 'EE' | 'EF' | 'EG' | 'EH' | 'EI' | 'EJ' | 'EK' | 'EL' | 'EM' | 'EN' | 'EO' | 'EP' | 'EQ' | 'ER' | 'ES' | 'ET' | 'EU' | 'EV' | 'EW' | 'EX' | 'EY' | 'EZ' | 'FA' | 'FB' | 'FC' | 'FD' | 'FE' | 'FF' | 'FG' | 'FH' | 'FI' | 'FJ' | 'FK' | 'FL' | 'FM' | 'FN' | 'FO' | 'FP' | 'FQ' | 'FR' | 'FS' | 'FT' | 'FU' | 'FV' | 'FW' | 'FX' | 'FY' | 'FZ' | 'GA' | 'GB' | 'GC' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GJ' | 'GK' | 'GL' | 'GM' | 'GN' | 'GO' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GV' | 'GW' | 'GX' | 'GY' | 'GZ' | 'HA' | 'HB' | 'HC' | 'HD' | 'HE' | 'HF' | 'HG' | 'HH' | 'HI' | 'HJ' | 'HK' | 'HL' | 'HM' | 'HN' | 'HO' | 'HP' | 'HQ' | 'HR' | 'HS' | 'HT' | 'HU' | 'HV' | 'HW' | 'HX' | 'HY' | 'HZ' | 'IA' | 'IB' | 'IC' | 'ID' | 'IE' | 'IF' | 'IG' | 'IH' | 'II' | 'IJ' | 'IK' | 'IL' | 'IM' | 'IN' | 'IO' | 'IP' | 'IQ' | 'IR' | 'IS' | 'IT' | 'IU' | 'IV' | 'IW' | 'IX' | 'IY' | 'IZ' | 'JA' | 'JB' | 'JC' | 'JD' | 'JE' | 'JF' | 'JG' | 'JH' | 'JI' | 'JJ' | 'JK' | 'JL' | 'JM' | 'JN' | 'JO' | 'JP' | 'JQ' | 'JR' | 'JS' | 'JT' | 'JU' | 'JV' | 'JW' | 'JX' | 'JY' | 'JZ' | 'KA' | 'KB' | 'KC' | 'KD' | 'KE' | 'KF' | 'KG' | 'KH' | 'KI' | 'KJ' | 'KK' | 'KL' | 'KM' | 'KN' | 'KO' | 'KP' | 'KQ' | 'KR' | 'KS' | 'KT' | 'KU' | 'KV' | 'KW' | 'KX' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LD' | 'LE' | 'LF' | 'LG' | 'LH' | 'LI' | 'LJ' | 'LK' | 'LL' | 'LM' | 'LN' | 'LO' | 'LP' | 'LQ' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LW' | 'LX' | 'LY' | 'LZ' | 'MA' | 'MB' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MI' | 'MJ' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NB' | 'NC' | 'ND' | 'NE' | 'NF' | 'NG' | 'NH' | 'NI' | 'NJ' | 'NK' | 'NL' | 'NM' | 'NN' | 'NO' | 'NP' | 'NQ' | 'NR' | 'NS' | 'NT' | 'NU' | 'NV' | 'NW' | 'NX' | 'NY' | 'NZ' | 'OA' | 'OB' | 'OC' | 'OD' | 'OE' | 'OF' | 'OG' | 'OH' | 'OI' | 'OJ' | 'OK' | 'OL' | 'OM' | 'ON' | 'OO' | 'OP' | 'OQ' | 'OR' | 'OS' | 'OT' | 'OU' | 'OV' | 'OW' | 'OX' | 'OY' | 'OZ' | 'PA' | 'PB' | 'PC' | 'PD' | 'PE' | 'PF' | 'PG' | 'PH' | 'PI' | 'PJ' | 'PK' | 'PL' | 'PM' | 'PN' | 'PO' | 'PP' | 'PQ' | 'PR' | 'PS' | 'PT' | 'PU' | 'PV' | 'PW' | 'PX' | 'PY' | 'PZ' | 'QA' | 'QB' | 'QC' | 'QD' | 'QE' | 'QF' | 'QG' | 'QH' | 'QI' | 'QJ' | 'QK' | 'QL' | 'QM' | 'QN' | 'QO' | 'QP' | 'QQ' | 'QR' | 'QS' | 'QT' | 'QU' | 'QV' | 'QW' | 'QX' | 'QY' | 'QZ' | 'RA' | 'RB' | 'RC' | 'RD' | 'RE' | 'RF' | 'RG' | 'RH' | 'RI' | 'RJ' | 'RK' | 'RL' | 'RM' | 'RN' | 'RO' | 'RP' | 'RQ' | 'RR' | 'RS' | 'RT' | 'RU' | 'RV' | 'RW' | 'RX' | 'RY' | 'RZ' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SF' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SP' | 'SQ' | 'SR' | 'SS' | 'ST' | 'SU' | 'SV' | 'SW' | 'SX' | 'SY' | 'SZ' | 'TA' | 'TB' | 'TC' | 'TD' | 'TE' | 'TF' | 'TG' | 'TH' | 'TI' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TP' | 'TQ' | 'TR' | 'TS' | 'TT' | 'TU' | 'TV' | 'TW' | 'TX' | 'TY' | 'TZ' | 'UA' | 'UB' | 'UC' | 'UD' | 'UE' | 'UF' | 'UG' | 'UH' | 'UI' | 'UJ' | 'UK' | 'UL' | 'UM' | 'UN' | 'UO' | 'UP' | 'UQ' | 'UR' | 'US' | 'UT' | 'UU' | 'UV' | 'UW' | 'UX' | 'UY' | 'UZ' | 'VA' | 'VB' | 'VC' | 'VD' | 'VE' | 'VF' | 'VG' | 'VH' | 'VI' | 'VJ' | 'VK' | 'VL' | 'VM' | 'VN' | 'VO' | 'VP' | 'VQ' | 'VR' | 'VS' | 'VT' | 'VU' | 'VV' | 'VW' | 'VX' | 'VY' | 'VZ' | 'WA' | 'WB' | 'WC' | 'WD' | 'WE' | 'WF' | 'WG' | 'WH' | 'WI' | 'WJ' | 'WK' | 'WL' | 'WM' | 'WN' | 'WO' | 'WP' | 'WQ' | 'WR' | 'WS' | 'WT' | 'WU' | 'WV' | 'WW' | 'WX' | 'WY' | 'WZ' | 'XA' | 'XB' | 'XC' | 'XD' | 'XE' | 'XF' | 'XG' | 'XH' | 'XI' | 'XJ' | 'XK' | 'XL' | 'XM' | 'XN' | 'XO' | 'XP' | 'XQ' | 'XR' | 'XS' | 'XT' | 'XU' | 'XV' | 'XW' | 'XX' | 'XY' | 'XZ' | 'YA' | 'YB' | 'YC' | 'YD' | 'YE' | 'YF' | 'YG' | 'YH' | 'YI' | 'YJ' | 'YK' | 'YL' | 'YM' | 'YN' | 'YO' | 'YP' | 'YQ' | 'YR' | 'YS' | 'YT' | 'YU' | 'YV' | 'YW' | 'YX' | 'YY' | 'YZ' | 'ZA' | 'ZB' | 'ZC' | 'ZD' | 'ZE' | 'ZF' | 'ZG' | 'ZH' | 'ZI' | 'ZJ' | 'ZK' | 'ZL' | 'ZM' | 'ZN' | 'ZO' | 'ZP' | 'ZQ' | 'ZR' | 'ZS' | 'ZT' | 'ZU' | 'ZV' | 'ZW' | 'ZX' | 'ZY' | 'ZZ';
export type MeasurementType = 'ping' | 'traceroute' | 'dns' | 'mtr' | 'http';
export type USStatesCode = 'AL' | 'KY' | 'OH' | 'AK' | 'LA' | 'OK' | 'AZ' | 'ME' | 'OR' | 'AR' | 'MD' | 'PA' | 'AS' | 'MA' | 'PR' | 'CA' | 'MI' | 'RI' | 'CO' | 'MN' | 'SC' | 'CT' | 'MS' | 'SD' | 'DE' | 'MO' | 'TN' | 'DC' | 'MT' | 'TX' | 'FL' | 'NE' | 'TT' | 'GA' | 'NV' | 'UT' | 'GU' | 'NH' | 'VT' | 'HI' | 'NJ' | 'VA' | 'ID' | 'NM' | 'VI' | 'IL' | 'NY' | 'WA' | 'IN' | 'NC' | 'WV' | 'IA' | 'ND' | 'WI' | 'KS' | 'MP' | 'WY';
export type MeasurementLocation = {
continent?: MeasurementContinent | string;
region?: MeasurementRegion | string;
country?: MeasurementCountry | string;
state?: USStatesCode | null;
city?: string;
asn?: number;
network?: string;
tags?: string[];
magic?: string;
limit?: number;
};
export type MeasurementRequestBody = {
type: MeasurementType | string;
target: string;
inProgressUpdates?: boolean;
locations?: MeasurementLocation[] | string;
limit?: number;
measurementOptions?: PingOptions | TracerouteOptions | DnsOptions | MtrOptions | HttpOptions;
};
export type PingOptions = {
packets: number;
ipVersion: 4 | 6;
};
export type TracerouteOptions = {
port: number;
protocol: 'ICMP' | 'TCP' | 'UDP' | string;
ipVersion: 4 | 6;
};
export type DnsOptions = {
query: {
type: 'A' | 'AAAA' | 'ANY' | 'CNAME' | 'DNSKEY' | 'DS' | 'HTTPS' | 'MX' | 'NS' | 'NSEC' | 'PTR' | 'RRSIG' | 'SOA' | 'TXT' | 'SRV';
};
resolver: string;
port: number;
protocol: 'TCP' | 'UDP';
ipVersion: 4 | 6;
trace: boolean;
};
export type MtrOptions = {
port: number;
protocol: 'ICMP' | 'TCP' | 'UDP';
ipVersion: 4 | 6;
packets: number;
};
export type HttpOptions = {
request: {
host: string;
path: string;
query: string;
method: 'HEAD' | 'GET';
headers: {
[K: string]: string;
};
};
resolver: string;
port: number;
protocol: 'HTTP' | 'HTTPS' | 'HTTP2';
ipVersion: 4 | 6;
};
export type MeasurementPostResponseBody = {
id: string;
probesCount: number;
};
export type MeasurementGetResponseBody = {
id: string;
type: MeasurementType;
target: string;
status: 'in-progress' | 'finished';
createdAt: string;
updatedAt: string;
probesCount: number;
locations?: MeasurementLocation[];
limit?: number;
measurementOptions?: PingOptions | TracerouteOptions | DnsOptions | MtrOptions | HttpOptions;
results: MeasurementResult[];
};
export type MeasurementResult = {
probe: {
continent: MeasurementContinent;
region: MeasurementRegion;
country: MeasurementCountry;
state: USStatesCode | null;
city: string;
asn: number;
network: string;
latitude: number;
longitude: number;
tags?: string[];
resolvers: string[];
};
result: InProgressTestResult | FailedTestResult | OfflineTestResult | FinishedPingTestResult | FinishedTracerouteTestResult | FinishedDnsTestResult | FinishedMtrTestResult | FinishedHttpTestResult;
};
export interface TestResult {
status: 'in-progress' | 'failed' | 'offline' | 'finished';
rawOutput: string;
}
export interface InProgressTestResult extends TestResult {
}
export interface FailedTestResult extends TestResult {
}
export interface OfflineTestResult extends TestResult {
}
export interface FinishedPingTestResult extends TestResult {
resolvedAddress: string | null;
resolvedHostname: string | null;
stats: {
min: number | null;
avg: number | null;
max: number | null;
total: number;
rcv: number;
drop: number;
loss: number;
};
timings: {
rtt: number;
ttl: number;
}[];
}
export interface FinishedTracerouteTestResult extends TestResult {
resolvedAddress: string | null;
resolvedHostname: string | null;
hops: {
resolvedAddress: string | null;
resolvedHostname: string | null;
timings: {
rtt: number;
}[];
}[];
}
export interface FinishedDnsTestResult extends TestResult {
}
export interface FinishedSimpleDnsTestResult extends FinishedDnsTestResult {
statusCode: number;
statusCodeName: string;
resolver: string;
answers: {
name: string;
type: string;
ttl: number;
class: string;
value: string;
}[];
timings: {
total: number;
};
}
export interface FinishedTraceDnsTestResult extends FinishedDnsTestResult {
hops: {
resolver: string;
answers: {
name: string;
type: string;
ttl: number;
class: string;
value: string;
}[];
timings: {
total: number;
};
}[];
}
export interface FinishedMtrTestResult extends TestResult {
resolvedAddress: string | null;
resolvedHostname: string | null;
hops: {
resolvedAddress: string | null;
resolvedHostname: string | null;
asn: number[];
stats: {
min: number;
avg: number;
max: number;
stDev: number;
jMin: number;
jAvg: number;
jMax: number;
total: number;
rcv: number;
drop: number;
loss: number;
};
timings: {
rtt: number;
}[];
}[];
}
export interface FinishedHttpTestResult extends TestResult {
rawHeaders: string;
rawBody: string | null;
truncated: boolean;
headers: {
[K: string]: string;
};
statusCode: number;
statusCodeName: string;
resolvedAddress: string | null;
timings: {
total: number | null;
dns: number | null;
tcp: number | null;
tls: number | null;
firstByte: number | null;
download: number | null;
};
tls: TlsCertificate | null;
}
export type TlsCertificate = {
authorized: boolean;
error: string;
createdAt: string;
expiresAt: string;
subject: {
CN: string;
alt: string;
};
issuer: {
C: string;
O: string;
CN: string;
};
keyType: 'RSA' | 'EC' | null;
keyBits: number | null;
serialNumber: string;
fingerprint256: string;
publicKey: string | null;
};
export type ParsedTarget = {
type: 'url' | 'ipv4' | 'ipv6';
protocol: string;
host: string;
port: number;
path: string;
query: string;
};