@gibme/ipinfo 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/index.d.ts +33 -10
- package/dist/index.js +117 -17
- package/dist/index.js.map +1 -1
- package/dist/ipinfo.min.js +1 -2
- package/dist/ipinfo.min.js.map +1 -1
- package/dist/web.d.ts +39 -3
- package/dist/web.js +23 -36
- package/dist/web.js.map +1 -1
- package/package.json +7 -7
- package/dist/helpers.d.ts +0 -5
- package/dist/helpers.js +0 -146
- package/dist/helpers.js.map +0 -1
- package/dist/ipinfo.min.js.LICENSE.txt +0 -105
- package/dist/types.d.ts +0 -60
- package/dist/types.js +0 -22
- package/dist/types.js.map +0 -1
package/dist/web.d.ts
CHANGED
|
@@ -1,10 +1,46 @@
|
|
|
1
|
-
import { CheckIPResponse } from './types';
|
|
2
1
|
/**
|
|
3
2
|
* Looks up information regarding the IP address supplied; OR,
|
|
4
3
|
* if no address is supplied, looks up information regarding
|
|
5
4
|
* our client's IP address
|
|
6
5
|
*
|
|
7
6
|
* @param address
|
|
8
|
-
* @constructor
|
|
9
7
|
*/
|
|
10
|
-
export declare
|
|
8
|
+
export declare function ipInfo(address?: string): Promise<ipInfo.Result | undefined>;
|
|
9
|
+
export declare namespace ipInfo {
|
|
10
|
+
type Response = {
|
|
11
|
+
status: 'success' | 'fail';
|
|
12
|
+
message?: string;
|
|
13
|
+
query: string;
|
|
14
|
+
country: string;
|
|
15
|
+
countryCode: string;
|
|
16
|
+
region: string;
|
|
17
|
+
regionName: string;
|
|
18
|
+
city: string;
|
|
19
|
+
zip: string;
|
|
20
|
+
lat: number;
|
|
21
|
+
lon: number;
|
|
22
|
+
timezone: string;
|
|
23
|
+
isp: string;
|
|
24
|
+
org: string;
|
|
25
|
+
as: string;
|
|
26
|
+
};
|
|
27
|
+
type Result = {
|
|
28
|
+
query: string;
|
|
29
|
+
country: string;
|
|
30
|
+
countryCode: string;
|
|
31
|
+
region: string;
|
|
32
|
+
regionName: string;
|
|
33
|
+
city: string;
|
|
34
|
+
zip: string;
|
|
35
|
+
lat: number;
|
|
36
|
+
lon: number;
|
|
37
|
+
timezone: string;
|
|
38
|
+
isp: string;
|
|
39
|
+
org?: string;
|
|
40
|
+
as: {
|
|
41
|
+
asn: number;
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export default ipInfo;
|
package/dist/web.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright (c) 2016-
|
|
2
|
+
// Copyright (c) 2016-2025, Brandon Lehmann <brandonlehmann@gmail.com>
|
|
3
3
|
//
|
|
4
4
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
// of this software and associated documentation files (the "Software"), to deal
|
|
@@ -31,47 +31,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.
|
|
35
|
-
const
|
|
34
|
+
exports.ipInfo = ipInfo;
|
|
35
|
+
const browser_1 = __importDefault(require("@gibme/fetch/browser"));
|
|
36
36
|
/**
|
|
37
37
|
* Looks up information regarding the IP address supplied; OR,
|
|
38
38
|
* if no address is supplied, looks up information regarding
|
|
39
39
|
* our client's IP address
|
|
40
40
|
*
|
|
41
41
|
* @param address
|
|
42
|
-
* @constructor
|
|
43
42
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const json = yield response.json();
|
|
51
|
-
if (json.status === 'fail') {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
const [as, name] = json.as.split(' ', 2)
|
|
55
|
-
.map(elem => elem.trim());
|
|
56
|
-
const asn = parseInt(as.replace('AS', '')) || 0;
|
|
57
|
-
return {
|
|
58
|
-
query: json.query,
|
|
59
|
-
country: json.country,
|
|
60
|
-
countryCode: json.countryCode,
|
|
61
|
-
region: json.region,
|
|
62
|
-
regionName: json.regionName,
|
|
63
|
-
city: json.city,
|
|
64
|
-
zip: json.zip,
|
|
65
|
-
lat: json.lat,
|
|
66
|
-
lon: json.lon,
|
|
67
|
-
timezone: json.timezone,
|
|
68
|
-
isp: json.isp,
|
|
69
|
-
org: json.org.length !== 0 ? json.org : undefined,
|
|
70
|
-
as: {
|
|
71
|
-
asn,
|
|
72
|
-
name
|
|
43
|
+
function ipInfo(address) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const url = `https://ipinfo.hostmanager.workers.dev/${address ? `?ip=${address}` : ''}`;
|
|
46
|
+
const response = yield browser_1.default.get(url);
|
|
47
|
+
if (!response.ok) {
|
|
48
|
+
return undefined;
|
|
73
49
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
50
|
+
const json = yield response.json();
|
|
51
|
+
if (json.status === 'fail') {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
const [as, name] = json.as.split(' ', 2)
|
|
55
|
+
.map(elem => elem.trim());
|
|
56
|
+
const asn = parseInt(as.replace('AS', '')) || 0;
|
|
57
|
+
return Object.assign(Object.assign({}, json), { as: {
|
|
58
|
+
asn,
|
|
59
|
+
name
|
|
60
|
+
} });
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.default = ipInfo;
|
|
77
64
|
//# sourceMappingURL=web.js.map
|
package/dist/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;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CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAEhD,uCACO,IAAI,KACP,EAAE,EAAE;gBACA,GAAG;gBACH,IAAI;aACP,IACH;IACN,CAAC;CAAA;AAyCD,kBAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gibme/ipinfo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A simple IP information lookup helper using Team CYMRU services",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://gibme-npm.github.io/ipinfo/",
|
|
33
33
|
"engines": {
|
|
34
|
-
"node": ">=
|
|
34
|
+
"node": ">=18"
|
|
35
35
|
},
|
|
36
36
|
"engineStrict": true,
|
|
37
37
|
"author": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"email": "brandonlehmann@gmail.com"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@gibme/fetch": "^
|
|
42
|
+
"@gibme/fetch": "^2.0.0"
|
|
43
43
|
},
|
|
44
44
|
"webpack": {
|
|
45
45
|
"entry": {
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"filename": "[name].min.js"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@gibme/auto-pack": "^0.4.
|
|
51
|
+
"@gibme/auto-pack": "^0.4.7",
|
|
52
52
|
"@types/mocha": "^10.0.6",
|
|
53
|
-
"@types/node": "^
|
|
53
|
+
"@types/node": "^22.15.17",
|
|
54
54
|
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
|
55
55
|
"@typescript-eslint/parser": "^6.19.1",
|
|
56
56
|
"eslint": "^8.56.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"eslint-plugin-promise": "^6.1.1",
|
|
62
62
|
"mocha": "^10.2.0",
|
|
63
63
|
"ts-node": "^10.9.2",
|
|
64
|
-
"typedoc": "^0.
|
|
65
|
-
"typescript": "^5.
|
|
64
|
+
"typedoc": "^0.28.4",
|
|
65
|
+
"typescript": "^5.8.3"
|
|
66
66
|
}
|
|
67
67
|
}
|
package/dist/helpers.d.ts
DELETED
package/dist/helpers.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) 2016-2023, Brandon Lehmann <brandonlehmann@gmail.com>
|
|
3
|
-
//
|
|
4
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
// in the Software without restriction, including without limitation the rights
|
|
7
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
// furnished to do so, subject to the following conditions:
|
|
10
|
-
//
|
|
11
|
-
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
// copies or substantial portions of the Software.
|
|
13
|
-
//
|
|
14
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
// SOFTWARE.
|
|
21
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
const promises_1 = require("dns/promises");
|
|
32
|
-
/** @ignore */
|
|
33
|
-
const sleep = (timeout) => __awaiter(void 0, void 0, void 0, function* () { return new Promise(resolve => setTimeout(resolve, timeout)); });
|
|
34
|
-
/** @ignore */
|
|
35
|
-
const countColons = (value) => {
|
|
36
|
-
let count = 0;
|
|
37
|
-
value.replace(/:/g, val => { count++; return val; });
|
|
38
|
-
return count;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* @ignore
|
|
42
|
-
* Expands compressed IPv6 address to uncompressed form
|
|
43
|
-
*
|
|
44
|
-
* @param value
|
|
45
|
-
*/
|
|
46
|
-
const expandIPv6 = (value) => {
|
|
47
|
-
return value.replace(/::/, () => {
|
|
48
|
-
return `:${Array((7 - countColons(value)) + 1).join(':')}:`;
|
|
49
|
-
})
|
|
50
|
-
.split(':')
|
|
51
|
-
.map(val => {
|
|
52
|
-
return Array(4 - val.length).fill('0').join('') + val;
|
|
53
|
-
})
|
|
54
|
-
.join(':');
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* DNS TXT record resolution with automatic retries
|
|
58
|
-
*
|
|
59
|
-
* @param hostname
|
|
60
|
-
* @param max_retries
|
|
61
|
-
* @param retry
|
|
62
|
-
* @ignore
|
|
63
|
-
*/
|
|
64
|
-
const getTxtRecord = (hostname_1, ...args_1) => __awaiter(void 0, [hostname_1, ...args_1], void 0, function* (hostname, max_retries = 3, retry = 0) {
|
|
65
|
-
try {
|
|
66
|
-
return yield (0, promises_1.resolveTxt)(hostname);
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
if (error.toString().toLowerCase().includes('refused') && retry < max_retries) {
|
|
70
|
-
yield sleep(1000);
|
|
71
|
-
return getTxtRecord(hostname, max_retries, retry);
|
|
72
|
-
}
|
|
73
|
-
throw error;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
/**
|
|
77
|
-
* Looks up information on the Autonomous System Number (ASN) via DNS
|
|
78
|
-
*
|
|
79
|
-
* @param as
|
|
80
|
-
* @param max_retries
|
|
81
|
-
* @ignore
|
|
82
|
-
*/
|
|
83
|
-
const getASN = (as_1, ...args_1) => __awaiter(void 0, [as_1, ...args_1], void 0, function* (as, max_retries = 3) {
|
|
84
|
-
if (typeof as === 'string') {
|
|
85
|
-
as = parseInt(as);
|
|
86
|
-
}
|
|
87
|
-
const records = yield getTxtRecord(`AS${as}.asn.cymru.com`, max_retries);
|
|
88
|
-
if (records.length === 0 || records[0].length === 0) {
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
const [, country, registry, allocated, name] = records[0][0].split('|')
|
|
92
|
-
.map(elem => elem.trim());
|
|
93
|
-
return {
|
|
94
|
-
asn: as,
|
|
95
|
-
country: country.toUpperCase(),
|
|
96
|
-
registry: registry.toUpperCase(),
|
|
97
|
-
allocated: new Date(allocated),
|
|
98
|
-
name: name.split(',')[0]
|
|
99
|
-
};
|
|
100
|
-
});
|
|
101
|
-
/**
|
|
102
|
-
* Looks up the prefix information via DNS
|
|
103
|
-
*
|
|
104
|
-
* @param address
|
|
105
|
-
* @param max_retries
|
|
106
|
-
* @ignore
|
|
107
|
-
*/
|
|
108
|
-
const getPrefix = (address_1, ...args_1) => __awaiter(void 0, [address_1, ...args_1], void 0, function* (address, max_retries = 3) {
|
|
109
|
-
const original_address = address;
|
|
110
|
-
address = address.split('/')[0]; // strip off any CIDR notation
|
|
111
|
-
if (address.includes(':')) {
|
|
112
|
-
address = expandIPv6(address);
|
|
113
|
-
address = address.split(':')
|
|
114
|
-
.join('')
|
|
115
|
-
.split('')
|
|
116
|
-
.reverse()
|
|
117
|
-
.join('.');
|
|
118
|
-
address = `${address}.origin6.asn.cymru.com`;
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
address = address.split('.')
|
|
122
|
-
.reverse()
|
|
123
|
-
.join('.');
|
|
124
|
-
address = `${address}.origin.asn.cymru.com`;
|
|
125
|
-
}
|
|
126
|
-
const records = yield getTxtRecord(address, max_retries);
|
|
127
|
-
if (records.length === 0 || records[0].length === 0) {
|
|
128
|
-
return undefined;
|
|
129
|
-
}
|
|
130
|
-
const [asn, prefix, country, registry, allocated] = records[0][0].split('|')
|
|
131
|
-
.map(elem => elem.trim());
|
|
132
|
-
return {
|
|
133
|
-
address: original_address,
|
|
134
|
-
zone: address,
|
|
135
|
-
asn: parseInt(asn),
|
|
136
|
-
prefix,
|
|
137
|
-
country: country.toUpperCase(),
|
|
138
|
-
registry: registry.toUpperCase(),
|
|
139
|
-
allocated: new Date(allocated),
|
|
140
|
-
as: yield getASN(asn)
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
exports.default = {
|
|
144
|
-
getPrefix
|
|
145
|
-
};
|
|
146
|
-
//# sourceMappingURL=helpers.js.map
|
package/dist/helpers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA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AI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAE9B,OAAO;QACH,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC;QAClB,MAAM;QACN,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE;QAC9B,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE;QAChC,SAAS,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC;QAC9B,EAAE,EAAE,MAAM,MAAM,CAAC,GAAG,CAAC;KACV,CAAC;AACpB,CAAC,CAAA,CAAC;AAEF,kBAAe;IACX,SAAS;CACZ,CAAC"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2015, Salesforce.com, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* Redistribution and use in source and binary forms, with or without
|
|
6
|
-
* modification, are permitted provided that the following conditions are met:
|
|
7
|
-
*
|
|
8
|
-
* 1. Redistributions of source code must retain the above copyright notice,
|
|
9
|
-
* this list of conditions and the following disclaimer.
|
|
10
|
-
*
|
|
11
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
-
* this list of conditions and the following disclaimer in the documentation
|
|
13
|
-
* and/or other materials provided with the distribution.
|
|
14
|
-
*
|
|
15
|
-
* 3. Neither the name of Salesforce.com nor the names of its contributors may
|
|
16
|
-
* be used to endorse or promote products derived from this software without
|
|
17
|
-
* specific prior written permission.
|
|
18
|
-
*
|
|
19
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
22
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
23
|
-
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
24
|
-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
25
|
-
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
26
|
-
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
27
|
-
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
28
|
-
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
29
|
-
* POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/*!
|
|
33
|
-
* Copyright (c) 2015-2020, Salesforce.com, Inc.
|
|
34
|
-
* All rights reserved.
|
|
35
|
-
*
|
|
36
|
-
* Redistribution and use in source and binary forms, with or without
|
|
37
|
-
* modification, are permitted provided that the following conditions are met:
|
|
38
|
-
*
|
|
39
|
-
* 1. Redistributions of source code must retain the above copyright notice,
|
|
40
|
-
* this list of conditions and the following disclaimer.
|
|
41
|
-
*
|
|
42
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
43
|
-
* this list of conditions and the following disclaimer in the documentation
|
|
44
|
-
* and/or other materials provided with the distribution.
|
|
45
|
-
*
|
|
46
|
-
* 3. Neither the name of Salesforce.com nor the names of its contributors may
|
|
47
|
-
* be used to endorse or promote products derived from this software without
|
|
48
|
-
* specific prior written permission.
|
|
49
|
-
*
|
|
50
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
51
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
52
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
53
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
54
|
-
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
55
|
-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
56
|
-
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
57
|
-
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
58
|
-
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
59
|
-
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
60
|
-
* POSSIBILITY OF SUCH DAMAGE.
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
/*!
|
|
64
|
-
* Copyright (c) 2018, Salesforce.com, Inc.
|
|
65
|
-
* All rights reserved.
|
|
66
|
-
*
|
|
67
|
-
* Redistribution and use in source and binary forms, with or without
|
|
68
|
-
* modification, are permitted provided that the following conditions are met:
|
|
69
|
-
*
|
|
70
|
-
* 1. Redistributions of source code must retain the above copyright notice,
|
|
71
|
-
* this list of conditions and the following disclaimer.
|
|
72
|
-
*
|
|
73
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
74
|
-
* this list of conditions and the following disclaimer in the documentation
|
|
75
|
-
* and/or other materials provided with the distribution.
|
|
76
|
-
*
|
|
77
|
-
* 3. Neither the name of Salesforce.com nor the names of its contributors may
|
|
78
|
-
* be used to endorse or promote products derived from this software without
|
|
79
|
-
* specific prior written permission.
|
|
80
|
-
*
|
|
81
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
82
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
83
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
84
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
85
|
-
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
86
|
-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
87
|
-
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
88
|
-
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
89
|
-
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
90
|
-
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
91
|
-
* POSSIBILITY OF SUCH DAMAGE.
|
|
92
|
-
*/
|
|
93
|
-
|
|
94
|
-
/*!
|
|
95
|
-
* The buffer module from node.js, for the browser.
|
|
96
|
-
*
|
|
97
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
98
|
-
* @license MIT
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
102
|
-
|
|
103
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
104
|
-
|
|
105
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
package/dist/types.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ASN information
|
|
3
|
-
*/
|
|
4
|
-
export interface ASNEntry {
|
|
5
|
-
asn: number;
|
|
6
|
-
country: string;
|
|
7
|
-
registry: string;
|
|
8
|
-
allocated: Date;
|
|
9
|
-
name: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* IP Prefix information including the ASN name (if available)
|
|
13
|
-
*/
|
|
14
|
-
export interface PrefixInfo {
|
|
15
|
-
address: string;
|
|
16
|
-
zone: string;
|
|
17
|
-
asn: number;
|
|
18
|
-
prefix: string;
|
|
19
|
-
country: string;
|
|
20
|
-
registry: string;
|
|
21
|
-
allocated: Date;
|
|
22
|
-
as?: ASNEntry;
|
|
23
|
-
}
|
|
24
|
-
export declare namespace Workers {
|
|
25
|
-
interface Response {
|
|
26
|
-
status: 'success' | 'fail';
|
|
27
|
-
message?: string;
|
|
28
|
-
query: string;
|
|
29
|
-
country: string;
|
|
30
|
-
countryCode: string;
|
|
31
|
-
region: string;
|
|
32
|
-
regionName: string;
|
|
33
|
-
city: string;
|
|
34
|
-
zip: string;
|
|
35
|
-
lat: number;
|
|
36
|
-
lon: number;
|
|
37
|
-
timezone: string;
|
|
38
|
-
isp: string;
|
|
39
|
-
org: string;
|
|
40
|
-
as: string;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export interface CheckIPResponse {
|
|
44
|
-
query: string;
|
|
45
|
-
country: string;
|
|
46
|
-
countryCode: string;
|
|
47
|
-
region: string;
|
|
48
|
-
regionName: string;
|
|
49
|
-
city: string;
|
|
50
|
-
zip: string;
|
|
51
|
-
lat: number;
|
|
52
|
-
lon: number;
|
|
53
|
-
timezone: string;
|
|
54
|
-
isp: string;
|
|
55
|
-
org?: string;
|
|
56
|
-
as: {
|
|
57
|
-
asn: number;
|
|
58
|
-
name: string;
|
|
59
|
-
};
|
|
60
|
-
}
|
package/dist/types.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) 2016-2023, Brandon Lehmann <brandonlehmann@gmail.com>
|
|
3
|
-
//
|
|
4
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
// in the Software without restriction, including without limitation the rights
|
|
7
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
// furnished to do so, subject to the following conditions:
|
|
10
|
-
//
|
|
11
|
-
// The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
// copies or substantial portions of the Software.
|
|
13
|
-
//
|
|
14
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
// SOFTWARE.
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY"}
|