@ip2geo/sdk 0.0.1 → 0.0.2
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/README.md +9 -3
- package/cjs/data/Constants.js +77 -1
- package/cjs/helpers/Http.js +3 -5
- package/cjs/index.js +16 -1
- package/cjs/langs/en_US.js +3 -1
- package/cjs/methods/ConvertIP.js +2 -2
- package/cjs/methods/ConvertIPs.js +6 -2
- package/cjs/methods/GetConversion.js +40 -0
- package/cjs/methods/GetConversions.js +44 -0
- package/cjs/methods/ListConversions.js +37 -0
- package/cjs/prebuild/package.json.js +1 -1
- package/esm/data/Constants.js +77 -2
- package/esm/helpers/Http.js +3 -5
- package/esm/index.js +12 -2
- package/esm/langs/en_US.js +3 -1
- package/esm/methods/ConvertIP.js +2 -2
- package/esm/methods/ConvertIPs.js +6 -2
- package/esm/methods/GetConversion.js +36 -0
- package/esm/methods/GetConversions.js +40 -0
- package/esm/methods/ListConversions.js +33 -0
- package/esm/prebuild/package.json.js +1 -1
- package/index.d.ts +772 -25
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,11 +2,93 @@ declare const IP_TYPES: {
|
|
|
2
2
|
IPV4: string;
|
|
3
3
|
IPV6: string;
|
|
4
4
|
};
|
|
5
|
+
declare const SELECT: {
|
|
6
|
+
CONVERSION: {
|
|
7
|
+
ID: string;
|
|
8
|
+
UNIQUE_ID: string;
|
|
9
|
+
DATA: string;
|
|
10
|
+
STATUS: string;
|
|
11
|
+
STARTED_AT: string;
|
|
12
|
+
COMPLETED_AT: string;
|
|
13
|
+
CREATED_AT: string;
|
|
14
|
+
CREDITED: string;
|
|
15
|
+
CONVERT_ONLY: string;
|
|
16
|
+
};
|
|
17
|
+
DATA: {
|
|
18
|
+
IP: string;
|
|
19
|
+
TYPE: string;
|
|
20
|
+
IS_EU: string;
|
|
21
|
+
CONTINENT: {
|
|
22
|
+
NAME: string;
|
|
23
|
+
CODE: string;
|
|
24
|
+
GEONAME_ID: string;
|
|
25
|
+
COUNTRY: {
|
|
26
|
+
NAME: string;
|
|
27
|
+
CODE: string;
|
|
28
|
+
GEONAME_ID: string;
|
|
29
|
+
PHONE_CODE: string;
|
|
30
|
+
CAPITAL: string;
|
|
31
|
+
TLD: string;
|
|
32
|
+
SUBDIVISION: {
|
|
33
|
+
NAME: string;
|
|
34
|
+
CODE: string;
|
|
35
|
+
};
|
|
36
|
+
CITY: {
|
|
37
|
+
NAME: string;
|
|
38
|
+
GEONAME_ID: string;
|
|
39
|
+
LATITUDE: string;
|
|
40
|
+
LONGITUDE: string;
|
|
41
|
+
ACCURACY_RADIUS: string;
|
|
42
|
+
METRO_CODE: string;
|
|
43
|
+
POSTAL_CODE: string;
|
|
44
|
+
TIMEZONE: {
|
|
45
|
+
NAME: string;
|
|
46
|
+
TIME_NOW: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
FLAG: {
|
|
50
|
+
IMG: string;
|
|
51
|
+
EMOJI: string;
|
|
52
|
+
EMOJI_UNICODE: string;
|
|
53
|
+
};
|
|
54
|
+
CURRENCY: {
|
|
55
|
+
NAME: string;
|
|
56
|
+
CODE: string;
|
|
57
|
+
SYMBOL: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
REGISTERED_COUNTRY: {
|
|
62
|
+
NAME: string;
|
|
63
|
+
CODE: string;
|
|
64
|
+
GEONAME_ID: string;
|
|
65
|
+
};
|
|
66
|
+
ASN: {
|
|
67
|
+
NUMBER: string;
|
|
68
|
+
NAME: string;
|
|
69
|
+
};
|
|
70
|
+
COMPLETION_TIME: {
|
|
71
|
+
MILISECONDS: string;
|
|
72
|
+
SECONDS: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
5
76
|
|
|
6
77
|
type IpTypes = (typeof IP_TYPES)[keyof typeof IP_TYPES];
|
|
7
78
|
type Expand<T> = T extends infer O ? O extends object ? O extends Array<infer U> ? Array<Expand<U>> : O extends Function ? O : {
|
|
8
79
|
[K in keyof O]: Expand<O[K]>;
|
|
9
80
|
} : O : never;
|
|
81
|
+
interface RequestMeta {
|
|
82
|
+
reqId: string | null;
|
|
83
|
+
resTime: number;
|
|
84
|
+
}
|
|
85
|
+
interface ApiResponse<T = null> {
|
|
86
|
+
success: boolean;
|
|
87
|
+
message: string;
|
|
88
|
+
code: number;
|
|
89
|
+
data: T;
|
|
90
|
+
_req: RequestMeta;
|
|
91
|
+
}
|
|
10
92
|
interface Ip {
|
|
11
93
|
ip: string | null;
|
|
12
94
|
type: IpTypes | null;
|
|
@@ -14,16 +96,25 @@ interface Ip {
|
|
|
14
96
|
continent: {
|
|
15
97
|
name: string | null;
|
|
16
98
|
code: string | null;
|
|
99
|
+
geoname_id: number | null;
|
|
17
100
|
country: {
|
|
18
101
|
name: string | null;
|
|
19
102
|
code: string | null;
|
|
103
|
+
geoname_id: number | null;
|
|
20
104
|
phone_code: string | null;
|
|
21
105
|
capital: string | null;
|
|
22
106
|
tld: string | null;
|
|
107
|
+
subdivision: {
|
|
108
|
+
name: string | null;
|
|
109
|
+
code: string | null;
|
|
110
|
+
};
|
|
23
111
|
city: {
|
|
24
112
|
name: string | null;
|
|
113
|
+
geoname_id: number | null;
|
|
25
114
|
latitude: number | null;
|
|
26
115
|
longitude: number | null;
|
|
116
|
+
accuracy_radius: number | null;
|
|
117
|
+
metro_code: number | null;
|
|
27
118
|
postal_code: string | null;
|
|
28
119
|
timezone: {
|
|
29
120
|
name: string | null;
|
|
@@ -42,6 +133,11 @@ interface Ip {
|
|
|
42
133
|
};
|
|
43
134
|
};
|
|
44
135
|
};
|
|
136
|
+
registered_country: {
|
|
137
|
+
name: string | null;
|
|
138
|
+
code: string | null;
|
|
139
|
+
geoname_id: number | null;
|
|
140
|
+
};
|
|
45
141
|
asn: {
|
|
46
142
|
number: number | null;
|
|
47
143
|
name: string | null;
|
|
@@ -51,38 +147,63 @@ interface Ip {
|
|
|
51
147
|
seconds: number | null;
|
|
52
148
|
};
|
|
53
149
|
}
|
|
54
|
-
|
|
55
|
-
success: boolean;
|
|
56
|
-
message: string;
|
|
57
|
-
code: number;
|
|
58
|
-
data: Ip | null;
|
|
59
|
-
_req: {
|
|
60
|
-
reqId: string | null;
|
|
61
|
-
resTime: number;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
150
|
+
type SingleConvertResponseInterface$2 = ApiResponse<Ip | null>;
|
|
64
151
|
interface InitOptions$1 {
|
|
65
152
|
clientRuntimeMessage?: boolean;
|
|
66
153
|
versionUpdateMessage?: boolean;
|
|
67
154
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
data: Array<{
|
|
73
|
-
ip: string;
|
|
74
|
-
conversion: Ip | null;
|
|
75
|
-
}>;
|
|
76
|
-
_req: {
|
|
77
|
-
reqId: string | null;
|
|
78
|
-
resTime: number;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
155
|
+
type MultipleConvertResponseInterface$1 = ApiResponse<Array<{
|
|
156
|
+
ip: string;
|
|
157
|
+
conversion: Ip | null;
|
|
158
|
+
}>>;
|
|
81
159
|
type ConvertIPProps$1 = {
|
|
82
160
|
ip: string;
|
|
161
|
+
convertOnly?: boolean;
|
|
83
162
|
};
|
|
84
163
|
type ConvertIPsProps$1 = {
|
|
85
164
|
ips: Array<string>;
|
|
165
|
+
convertOnly?: boolean;
|
|
166
|
+
};
|
|
167
|
+
type ConversionSelectField = 'id' | 'uniqueId' | 'data' | 'status' | 'startedAt' | 'completedAt' | 'createdAt' | 'credited' | 'convertOnly';
|
|
168
|
+
type DataNestedField = `data.${string}`;
|
|
169
|
+
type SelectField = ConversionSelectField | DataNestedField;
|
|
170
|
+
type GetConversionProps$1 = {
|
|
171
|
+
conversionId: string;
|
|
172
|
+
select?: Array<SelectField>;
|
|
173
|
+
};
|
|
174
|
+
type GetConversionsProps$1 = {
|
|
175
|
+
conversionIds: Array<string>;
|
|
176
|
+
select?: Array<SelectField>;
|
|
177
|
+
};
|
|
178
|
+
type ListConversionsProps$1 = {
|
|
179
|
+
offset?: number;
|
|
180
|
+
limit?: number;
|
|
181
|
+
select?: Array<SelectField>;
|
|
182
|
+
ipSearch?: string;
|
|
183
|
+
};
|
|
184
|
+
interface Conversion {
|
|
185
|
+
id: number;
|
|
186
|
+
uniqueId: string;
|
|
187
|
+
data: Ip;
|
|
188
|
+
status: string;
|
|
189
|
+
startedAt: string;
|
|
190
|
+
createdAt: string;
|
|
191
|
+
credited: boolean;
|
|
192
|
+
convertOnly: boolean;
|
|
193
|
+
completedAt: string | null;
|
|
194
|
+
}
|
|
195
|
+
type GetConversionResponseInterface$1 = ApiResponse<Conversion | Partial<Conversion> | null>;
|
|
196
|
+
type GetConversionsResponseInterface$1 = ApiResponse<{
|
|
197
|
+
conversions: Array<Conversion | Partial<Conversion>>;
|
|
198
|
+
} | null>;
|
|
199
|
+
type ListConversionsResponseInterface$1 = ApiResponse<{
|
|
200
|
+
conversions: Array<Conversion | Partial<Conversion>>;
|
|
201
|
+
hasMore: boolean;
|
|
202
|
+
totalCount: number;
|
|
203
|
+
} | null>;
|
|
204
|
+
type IpValidationResult$1 = {
|
|
205
|
+
ip4: boolean;
|
|
206
|
+
ip6: boolean;
|
|
86
207
|
};
|
|
87
208
|
|
|
88
209
|
/**
|
|
@@ -94,6 +215,7 @@ type ConvertIPsProps$1 = {
|
|
|
94
215
|
*
|
|
95
216
|
* @param props - The properties object containing the IP address.
|
|
96
217
|
* @param props.ip - The IP address to retrieve geo information for.
|
|
218
|
+
* @param props.convertOnly - Optional. If set to true, stores minimal data (only IP and basic info) and charges $0.001 per conversion instead of $0.0005. Defaults to false (full data storage).
|
|
97
219
|
* @returns {Promise<SingleConvertResponseInterface | null>} A Promise resolving to a {@link SingleConvertResponseInterface} containing the response wrapper with geo and connection details, or `null` if the request fails or no response is received.
|
|
98
220
|
*/
|
|
99
221
|
type ConvertIPProps = Expand<ConvertIPProps$1>;
|
|
@@ -109,6 +231,7 @@ declare const ConvertIP: (options: ConvertIPProps) => Promise<SingleConvertRespo
|
|
|
109
231
|
*
|
|
110
232
|
* @param props - The properties object containing the IP addresses.
|
|
111
233
|
* @param props.ips - An array of IP addresses to retrieve geo information for.
|
|
234
|
+
* @param props.convertOnly - Optional. If set to true, stores minimal data (only IP and basic info) for all IPs in the request and charges $0.001 per conversion instead of $0.0005. Defaults to false (full data storage).
|
|
112
235
|
* @returns {Promise<MultipleConvertResponseInterface | null>} A Promise resolving to a {@link MultipleConvertResponseInterface} containing the response wrapper with an array of geo conversions, or `null` if the request fails or no response is received.
|
|
113
236
|
*/
|
|
114
237
|
type ConvertIPsProps = Expand<ConvertIPsProps$1>;
|
|
@@ -116,6 +239,53 @@ type MultipleConvertResponseInterface = Expand<MultipleConvertResponseInterface$
|
|
|
116
239
|
type SingleConvertResponseInterface = Expand<SingleConvertResponseInterface$2>;
|
|
117
240
|
declare const ConvertIPs: (props: ConvertIPsProps) => Promise<MultipleConvertResponseInterface | SingleConvertResponseInterface | null>;
|
|
118
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Retrieve a single conversion by its ID.
|
|
244
|
+
*
|
|
245
|
+
* The function fetches a conversion record from the API using the provided conversion ID.
|
|
246
|
+
* You can optionally specify which properties to return using the select parameter.
|
|
247
|
+
*
|
|
248
|
+
* @param props - The properties object containing the conversion ID and optional select fields.
|
|
249
|
+
* @param props.conversionId - The unique identifier of the conversion to retrieve.
|
|
250
|
+
* @param props.select - Optional. An array of property names to return. If not specified, all properties are returned.
|
|
251
|
+
* @returns {Promise<GetConversionResponseInterface | null>} A Promise resolving to a {@link GetConversionResponseInterface} containing the conversion data, or `null` if the request fails.
|
|
252
|
+
*/
|
|
253
|
+
type GetConversionProps = Expand<GetConversionProps$1>;
|
|
254
|
+
type GetConversionResponseInterface = Expand<GetConversionResponseInterface$1>;
|
|
255
|
+
declare const GetConversion: (options: GetConversionProps) => Promise<GetConversionResponseInterface | null>;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Retrieve multiple conversions by their IDs.
|
|
259
|
+
*
|
|
260
|
+
* The function fetches multiple conversion records from the API using the provided conversion IDs.
|
|
261
|
+
* You can optionally specify which properties to return using the select parameter.
|
|
262
|
+
*
|
|
263
|
+
* @param props - The properties object containing the conversion IDs and optional select fields.
|
|
264
|
+
* @param props.conversionIds - An array of unique identifiers of the conversions to retrieve.
|
|
265
|
+
* @param props.select - Optional. An array of property names to return. If not specified, all properties are returned.
|
|
266
|
+
* @returns {Promise<GetConversionsResponseInterface | null>} A Promise resolving to a {@link GetConversionsResponseInterface} containing the conversions data, or `null` if the request fails.
|
|
267
|
+
*/
|
|
268
|
+
type GetConversionsProps = Expand<GetConversionsProps$1>;
|
|
269
|
+
type GetConversionsResponseInterface = Expand<GetConversionsResponseInterface$1>;
|
|
270
|
+
declare const GetConversions: (options: GetConversionsProps) => Promise<GetConversionsResponseInterface | null>;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* List conversions with pagination and optional filtering.
|
|
274
|
+
*
|
|
275
|
+
* The function fetches a paginated list of conversions from the API.
|
|
276
|
+
* You can filter by IP address and specify which properties to return.
|
|
277
|
+
*
|
|
278
|
+
* @param props - The properties object containing pagination and filter options.
|
|
279
|
+
* @param props.offset - Optional. The number of conversions to skip. Defaults to 0.
|
|
280
|
+
* @param props.limit - Optional. The maximum number of conversions to return. Defaults to 50 (max: 50).
|
|
281
|
+
* @param props.select - Optional. An array of property names to return. If not specified, all properties are returned.
|
|
282
|
+
* @param props.ipSearch - Optional. Filter conversions by IP address.
|
|
283
|
+
* @returns {Promise<ListConversionsResponseInterface | null>} A Promise resolving to a {@link ListConversionsResponseInterface} containing the conversions list with pagination info, or `null` if the request fails.
|
|
284
|
+
*/
|
|
285
|
+
type ListConversionsProps = Expand<ListConversionsProps$1>;
|
|
286
|
+
type ListConversionsResponseInterface = Expand<ListConversionsResponseInterface$1>;
|
|
287
|
+
declare const ListConversions: (options?: ListConversionsProps) => Promise<ListConversionsResponseInterface | null>;
|
|
288
|
+
|
|
119
289
|
/**
|
|
120
290
|
* Initializes the SDK with the given API key.
|
|
121
291
|
*
|
|
@@ -128,9 +298,19 @@ declare const ConvertIPs: (props: ConvertIPsProps) => Promise<MultipleConvertRes
|
|
|
128
298
|
type InitOptions = Expand<InitOptions$1>;
|
|
129
299
|
declare const Init: (key: string, options?: InitOptions) => Promise<boolean>;
|
|
130
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Validate an IP address and return if it is IPv4 or IPv6.
|
|
303
|
+
*
|
|
304
|
+
* @param ipAddress - The IP address to validate.
|
|
305
|
+
* @returns {IpValidationResult} The result of the validation.
|
|
306
|
+
*/
|
|
307
|
+
type IpValidationResult = Expand<IpValidationResult$1>;
|
|
308
|
+
declare const IpValidation: (ipAddress: string | unknown) => IpValidationResult;
|
|
309
|
+
|
|
131
310
|
declare const Ip2Geo: {
|
|
132
311
|
ConvertIPs: (props: {
|
|
133
312
|
ips: string[];
|
|
313
|
+
convertOnly?: boolean | undefined;
|
|
134
314
|
}) => Promise<{
|
|
135
315
|
success: boolean;
|
|
136
316
|
message: string;
|
|
@@ -144,16 +324,25 @@ declare const Ip2Geo: {
|
|
|
144
324
|
continent: {
|
|
145
325
|
name: string | null;
|
|
146
326
|
code: string | null;
|
|
327
|
+
geoname_id: number | null;
|
|
147
328
|
country: {
|
|
148
329
|
name: string | null;
|
|
149
330
|
code: string | null;
|
|
331
|
+
geoname_id: number | null;
|
|
150
332
|
phone_code: string | null;
|
|
151
333
|
capital: string | null;
|
|
152
334
|
tld: string | null;
|
|
335
|
+
subdivision: {
|
|
336
|
+
name: string | null;
|
|
337
|
+
code: string | null;
|
|
338
|
+
};
|
|
153
339
|
city: {
|
|
154
340
|
name: string | null;
|
|
341
|
+
geoname_id: number | null;
|
|
155
342
|
latitude: number | null;
|
|
156
343
|
longitude: number | null;
|
|
344
|
+
accuracy_radius: number | null;
|
|
345
|
+
metro_code: number | null;
|
|
157
346
|
postal_code: string | null;
|
|
158
347
|
timezone: {
|
|
159
348
|
name: string | null;
|
|
@@ -172,6 +361,11 @@ declare const Ip2Geo: {
|
|
|
172
361
|
};
|
|
173
362
|
};
|
|
174
363
|
};
|
|
364
|
+
registered_country: {
|
|
365
|
+
name: string | null;
|
|
366
|
+
code: string | null;
|
|
367
|
+
geoname_id: number | null;
|
|
368
|
+
};
|
|
175
369
|
asn: {
|
|
176
370
|
number: number | null;
|
|
177
371
|
name: string | null;
|
|
@@ -197,16 +391,25 @@ declare const Ip2Geo: {
|
|
|
197
391
|
continent: {
|
|
198
392
|
name: string | null;
|
|
199
393
|
code: string | null;
|
|
394
|
+
geoname_id: number | null;
|
|
200
395
|
country: {
|
|
201
396
|
name: string | null;
|
|
202
397
|
code: string | null;
|
|
398
|
+
geoname_id: number | null;
|
|
203
399
|
phone_code: string | null;
|
|
204
400
|
capital: string | null;
|
|
205
401
|
tld: string | null;
|
|
402
|
+
subdivision: {
|
|
403
|
+
name: string | null;
|
|
404
|
+
code: string | null;
|
|
405
|
+
};
|
|
206
406
|
city: {
|
|
207
407
|
name: string | null;
|
|
408
|
+
geoname_id: number | null;
|
|
208
409
|
latitude: number | null;
|
|
209
410
|
longitude: number | null;
|
|
411
|
+
accuracy_radius: number | null;
|
|
412
|
+
metro_code: number | null;
|
|
210
413
|
postal_code: string | null;
|
|
211
414
|
timezone: {
|
|
212
415
|
name: string | null;
|
|
@@ -225,6 +428,11 @@ declare const Ip2Geo: {
|
|
|
225
428
|
};
|
|
226
429
|
};
|
|
227
430
|
};
|
|
431
|
+
registered_country: {
|
|
432
|
+
name: string | null;
|
|
433
|
+
code: string | null;
|
|
434
|
+
geoname_id: number | null;
|
|
435
|
+
};
|
|
228
436
|
asn: {
|
|
229
437
|
number: number | null;
|
|
230
438
|
name: string | null;
|
|
@@ -241,6 +449,7 @@ declare const Ip2Geo: {
|
|
|
241
449
|
} | null>;
|
|
242
450
|
ConvertIP: (options: {
|
|
243
451
|
ip: string;
|
|
452
|
+
convertOnly?: boolean | undefined;
|
|
244
453
|
}) => Promise<{
|
|
245
454
|
success: boolean;
|
|
246
455
|
message: string;
|
|
@@ -252,16 +461,25 @@ declare const Ip2Geo: {
|
|
|
252
461
|
continent: {
|
|
253
462
|
name: string | null;
|
|
254
463
|
code: string | null;
|
|
464
|
+
geoname_id: number | null;
|
|
255
465
|
country: {
|
|
256
466
|
name: string | null;
|
|
257
467
|
code: string | null;
|
|
468
|
+
geoname_id: number | null;
|
|
258
469
|
phone_code: string | null;
|
|
259
470
|
capital: string | null;
|
|
260
471
|
tld: string | null;
|
|
472
|
+
subdivision: {
|
|
473
|
+
name: string | null;
|
|
474
|
+
code: string | null;
|
|
475
|
+
};
|
|
261
476
|
city: {
|
|
262
477
|
name: string | null;
|
|
478
|
+
geoname_id: number | null;
|
|
263
479
|
latitude: number | null;
|
|
264
480
|
longitude: number | null;
|
|
481
|
+
accuracy_radius: number | null;
|
|
482
|
+
metro_code: number | null;
|
|
265
483
|
postal_code: string | null;
|
|
266
484
|
timezone: {
|
|
267
485
|
name: string | null;
|
|
@@ -280,6 +498,11 @@ declare const Ip2Geo: {
|
|
|
280
498
|
};
|
|
281
499
|
};
|
|
282
500
|
};
|
|
501
|
+
registered_country: {
|
|
502
|
+
name: string | null;
|
|
503
|
+
code: string | null;
|
|
504
|
+
geoname_id: number | null;
|
|
505
|
+
};
|
|
283
506
|
asn: {
|
|
284
507
|
number: number | null;
|
|
285
508
|
name: string | null;
|
|
@@ -294,11 +517,535 @@ declare const Ip2Geo: {
|
|
|
294
517
|
resTime: number;
|
|
295
518
|
};
|
|
296
519
|
} | null>;
|
|
520
|
+
GetConversion: (options: {
|
|
521
|
+
conversionId: string;
|
|
522
|
+
select?: SelectField[] | undefined;
|
|
523
|
+
}) => Promise<{
|
|
524
|
+
success: boolean;
|
|
525
|
+
message: string;
|
|
526
|
+
code: number;
|
|
527
|
+
data: {
|
|
528
|
+
id: number;
|
|
529
|
+
uniqueId: string;
|
|
530
|
+
data: {
|
|
531
|
+
ip: string | null;
|
|
532
|
+
type: IpTypes | null;
|
|
533
|
+
is_eu: boolean | null;
|
|
534
|
+
continent: {
|
|
535
|
+
name: string | null;
|
|
536
|
+
code: string | null;
|
|
537
|
+
geoname_id: number | null;
|
|
538
|
+
country: {
|
|
539
|
+
name: string | null;
|
|
540
|
+
code: string | null;
|
|
541
|
+
geoname_id: number | null;
|
|
542
|
+
phone_code: string | null;
|
|
543
|
+
capital: string | null;
|
|
544
|
+
tld: string | null;
|
|
545
|
+
subdivision: {
|
|
546
|
+
name: string | null;
|
|
547
|
+
code: string | null;
|
|
548
|
+
};
|
|
549
|
+
city: {
|
|
550
|
+
name: string | null;
|
|
551
|
+
geoname_id: number | null;
|
|
552
|
+
latitude: number | null;
|
|
553
|
+
longitude: number | null;
|
|
554
|
+
accuracy_radius: number | null;
|
|
555
|
+
metro_code: number | null;
|
|
556
|
+
postal_code: string | null;
|
|
557
|
+
timezone: {
|
|
558
|
+
name: string | null;
|
|
559
|
+
time_now: string | null;
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
flag: {
|
|
563
|
+
img: string | null;
|
|
564
|
+
emoji: string | null;
|
|
565
|
+
emoji_unicode: string | null;
|
|
566
|
+
};
|
|
567
|
+
currency: {
|
|
568
|
+
name: string | null;
|
|
569
|
+
code: string | null;
|
|
570
|
+
symbol: string | null;
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
};
|
|
574
|
+
registered_country: {
|
|
575
|
+
name: string | null;
|
|
576
|
+
code: string | null;
|
|
577
|
+
geoname_id: number | null;
|
|
578
|
+
};
|
|
579
|
+
asn: {
|
|
580
|
+
number: number | null;
|
|
581
|
+
name: string | null;
|
|
582
|
+
};
|
|
583
|
+
completion_time: {
|
|
584
|
+
miliseconds: number | null;
|
|
585
|
+
seconds: number | null;
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
status: string;
|
|
589
|
+
startedAt: string;
|
|
590
|
+
createdAt: string;
|
|
591
|
+
credited: boolean;
|
|
592
|
+
convertOnly: boolean;
|
|
593
|
+
completedAt: string | null;
|
|
594
|
+
} | {
|
|
595
|
+
id?: number | undefined;
|
|
596
|
+
uniqueId?: string | undefined;
|
|
597
|
+
data?: {
|
|
598
|
+
ip: string | null;
|
|
599
|
+
type: IpTypes | null;
|
|
600
|
+
is_eu: boolean | null;
|
|
601
|
+
continent: {
|
|
602
|
+
name: string | null;
|
|
603
|
+
code: string | null;
|
|
604
|
+
geoname_id: number | null;
|
|
605
|
+
country: {
|
|
606
|
+
name: string | null;
|
|
607
|
+
code: string | null;
|
|
608
|
+
geoname_id: number | null;
|
|
609
|
+
phone_code: string | null;
|
|
610
|
+
capital: string | null;
|
|
611
|
+
tld: string | null;
|
|
612
|
+
subdivision: {
|
|
613
|
+
name: string | null;
|
|
614
|
+
code: string | null;
|
|
615
|
+
};
|
|
616
|
+
city: {
|
|
617
|
+
name: string | null;
|
|
618
|
+
geoname_id: number | null;
|
|
619
|
+
latitude: number | null;
|
|
620
|
+
longitude: number | null;
|
|
621
|
+
accuracy_radius: number | null;
|
|
622
|
+
metro_code: number | null;
|
|
623
|
+
postal_code: string | null;
|
|
624
|
+
timezone: {
|
|
625
|
+
name: string | null;
|
|
626
|
+
time_now: string | null;
|
|
627
|
+
};
|
|
628
|
+
};
|
|
629
|
+
flag: {
|
|
630
|
+
img: string | null;
|
|
631
|
+
emoji: string | null;
|
|
632
|
+
emoji_unicode: string | null;
|
|
633
|
+
};
|
|
634
|
+
currency: {
|
|
635
|
+
name: string | null;
|
|
636
|
+
code: string | null;
|
|
637
|
+
symbol: string | null;
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
};
|
|
641
|
+
registered_country: {
|
|
642
|
+
name: string | null;
|
|
643
|
+
code: string | null;
|
|
644
|
+
geoname_id: number | null;
|
|
645
|
+
};
|
|
646
|
+
asn: {
|
|
647
|
+
number: number | null;
|
|
648
|
+
name: string | null;
|
|
649
|
+
};
|
|
650
|
+
completion_time: {
|
|
651
|
+
miliseconds: number | null;
|
|
652
|
+
seconds: number | null;
|
|
653
|
+
};
|
|
654
|
+
} | undefined;
|
|
655
|
+
status?: string | undefined;
|
|
656
|
+
startedAt?: string | undefined;
|
|
657
|
+
createdAt?: string | undefined;
|
|
658
|
+
credited?: boolean | undefined;
|
|
659
|
+
convertOnly?: boolean | undefined;
|
|
660
|
+
completedAt?: string | null | undefined;
|
|
661
|
+
} | null;
|
|
662
|
+
_req: {
|
|
663
|
+
reqId: string | null;
|
|
664
|
+
resTime: number;
|
|
665
|
+
};
|
|
666
|
+
} | null>;
|
|
667
|
+
GetConversions: (options: {
|
|
668
|
+
conversionIds: string[];
|
|
669
|
+
select?: SelectField[] | undefined;
|
|
670
|
+
}) => Promise<{
|
|
671
|
+
success: boolean;
|
|
672
|
+
message: string;
|
|
673
|
+
code: number;
|
|
674
|
+
data: {
|
|
675
|
+
conversions: ({
|
|
676
|
+
id: number;
|
|
677
|
+
uniqueId: string;
|
|
678
|
+
data: {
|
|
679
|
+
ip: string | null;
|
|
680
|
+
type: IpTypes | null;
|
|
681
|
+
is_eu: boolean | null;
|
|
682
|
+
continent: {
|
|
683
|
+
name: string | null;
|
|
684
|
+
code: string | null;
|
|
685
|
+
geoname_id: number | null;
|
|
686
|
+
country: {
|
|
687
|
+
name: string | null;
|
|
688
|
+
code: string | null;
|
|
689
|
+
geoname_id: number | null;
|
|
690
|
+
phone_code: string | null;
|
|
691
|
+
capital: string | null;
|
|
692
|
+
tld: string | null;
|
|
693
|
+
subdivision: {
|
|
694
|
+
name: string | null;
|
|
695
|
+
code: string | null;
|
|
696
|
+
};
|
|
697
|
+
city: {
|
|
698
|
+
name: string | null;
|
|
699
|
+
geoname_id: number | null;
|
|
700
|
+
latitude: number | null;
|
|
701
|
+
longitude: number | null;
|
|
702
|
+
accuracy_radius: number | null;
|
|
703
|
+
metro_code: number | null;
|
|
704
|
+
postal_code: string | null;
|
|
705
|
+
timezone: {
|
|
706
|
+
name: string | null;
|
|
707
|
+
time_now: string | null;
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
flag: {
|
|
711
|
+
img: string | null;
|
|
712
|
+
emoji: string | null;
|
|
713
|
+
emoji_unicode: string | null;
|
|
714
|
+
};
|
|
715
|
+
currency: {
|
|
716
|
+
name: string | null;
|
|
717
|
+
code: string | null;
|
|
718
|
+
symbol: string | null;
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
registered_country: {
|
|
723
|
+
name: string | null;
|
|
724
|
+
code: string | null;
|
|
725
|
+
geoname_id: number | null;
|
|
726
|
+
};
|
|
727
|
+
asn: {
|
|
728
|
+
number: number | null;
|
|
729
|
+
name: string | null;
|
|
730
|
+
};
|
|
731
|
+
completion_time: {
|
|
732
|
+
miliseconds: number | null;
|
|
733
|
+
seconds: number | null;
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
status: string;
|
|
737
|
+
startedAt: string;
|
|
738
|
+
createdAt: string;
|
|
739
|
+
credited: boolean;
|
|
740
|
+
convertOnly: boolean;
|
|
741
|
+
completedAt: string | null;
|
|
742
|
+
} | {
|
|
743
|
+
id?: number | undefined;
|
|
744
|
+
uniqueId?: string | undefined;
|
|
745
|
+
data?: {
|
|
746
|
+
ip: string | null;
|
|
747
|
+
type: IpTypes | null;
|
|
748
|
+
is_eu: boolean | null;
|
|
749
|
+
continent: {
|
|
750
|
+
name: string | null;
|
|
751
|
+
code: string | null;
|
|
752
|
+
geoname_id: number | null;
|
|
753
|
+
country: {
|
|
754
|
+
name: string | null;
|
|
755
|
+
code: string | null;
|
|
756
|
+
geoname_id: number | null;
|
|
757
|
+
phone_code: string | null;
|
|
758
|
+
capital: string | null;
|
|
759
|
+
tld: string | null;
|
|
760
|
+
subdivision: {
|
|
761
|
+
name: string | null;
|
|
762
|
+
code: string | null;
|
|
763
|
+
};
|
|
764
|
+
city: {
|
|
765
|
+
name: string | null;
|
|
766
|
+
geoname_id: number | null;
|
|
767
|
+
latitude: number | null;
|
|
768
|
+
longitude: number | null;
|
|
769
|
+
accuracy_radius: number | null;
|
|
770
|
+
metro_code: number | null;
|
|
771
|
+
postal_code: string | null;
|
|
772
|
+
timezone: {
|
|
773
|
+
name: string | null;
|
|
774
|
+
time_now: string | null;
|
|
775
|
+
};
|
|
776
|
+
};
|
|
777
|
+
flag: {
|
|
778
|
+
img: string | null;
|
|
779
|
+
emoji: string | null;
|
|
780
|
+
emoji_unicode: string | null;
|
|
781
|
+
};
|
|
782
|
+
currency: {
|
|
783
|
+
name: string | null;
|
|
784
|
+
code: string | null;
|
|
785
|
+
symbol: string | null;
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
registered_country: {
|
|
790
|
+
name: string | null;
|
|
791
|
+
code: string | null;
|
|
792
|
+
geoname_id: number | null;
|
|
793
|
+
};
|
|
794
|
+
asn: {
|
|
795
|
+
number: number | null;
|
|
796
|
+
name: string | null;
|
|
797
|
+
};
|
|
798
|
+
completion_time: {
|
|
799
|
+
miliseconds: number | null;
|
|
800
|
+
seconds: number | null;
|
|
801
|
+
};
|
|
802
|
+
} | undefined;
|
|
803
|
+
status?: string | undefined;
|
|
804
|
+
startedAt?: string | undefined;
|
|
805
|
+
createdAt?: string | undefined;
|
|
806
|
+
credited?: boolean | undefined;
|
|
807
|
+
convertOnly?: boolean | undefined;
|
|
808
|
+
completedAt?: string | null | undefined;
|
|
809
|
+
})[];
|
|
810
|
+
} | null;
|
|
811
|
+
_req: {
|
|
812
|
+
reqId: string | null;
|
|
813
|
+
resTime: number;
|
|
814
|
+
};
|
|
815
|
+
} | null>;
|
|
816
|
+
ListConversions: (options?: {
|
|
817
|
+
offset?: number | undefined;
|
|
818
|
+
limit?: number | undefined;
|
|
819
|
+
select?: SelectField[] | undefined;
|
|
820
|
+
ipSearch?: string | undefined;
|
|
821
|
+
}) => Promise<{
|
|
822
|
+
success: boolean;
|
|
823
|
+
message: string;
|
|
824
|
+
code: number;
|
|
825
|
+
data: {
|
|
826
|
+
conversions: ({
|
|
827
|
+
id: number;
|
|
828
|
+
uniqueId: string;
|
|
829
|
+
data: {
|
|
830
|
+
ip: string | null;
|
|
831
|
+
type: IpTypes | null;
|
|
832
|
+
is_eu: boolean | null;
|
|
833
|
+
continent: {
|
|
834
|
+
name: string | null;
|
|
835
|
+
code: string | null;
|
|
836
|
+
geoname_id: number | null;
|
|
837
|
+
country: {
|
|
838
|
+
name: string | null;
|
|
839
|
+
code: string | null;
|
|
840
|
+
geoname_id: number | null;
|
|
841
|
+
phone_code: string | null;
|
|
842
|
+
capital: string | null;
|
|
843
|
+
tld: string | null;
|
|
844
|
+
subdivision: {
|
|
845
|
+
name: string | null;
|
|
846
|
+
code: string | null;
|
|
847
|
+
};
|
|
848
|
+
city: {
|
|
849
|
+
name: string | null;
|
|
850
|
+
geoname_id: number | null;
|
|
851
|
+
latitude: number | null;
|
|
852
|
+
longitude: number | null;
|
|
853
|
+
accuracy_radius: number | null;
|
|
854
|
+
metro_code: number | null;
|
|
855
|
+
postal_code: string | null;
|
|
856
|
+
timezone: {
|
|
857
|
+
name: string | null;
|
|
858
|
+
time_now: string | null;
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
flag: {
|
|
862
|
+
img: string | null;
|
|
863
|
+
emoji: string | null;
|
|
864
|
+
emoji_unicode: string | null;
|
|
865
|
+
};
|
|
866
|
+
currency: {
|
|
867
|
+
name: string | null;
|
|
868
|
+
code: string | null;
|
|
869
|
+
symbol: string | null;
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
};
|
|
873
|
+
registered_country: {
|
|
874
|
+
name: string | null;
|
|
875
|
+
code: string | null;
|
|
876
|
+
geoname_id: number | null;
|
|
877
|
+
};
|
|
878
|
+
asn: {
|
|
879
|
+
number: number | null;
|
|
880
|
+
name: string | null;
|
|
881
|
+
};
|
|
882
|
+
completion_time: {
|
|
883
|
+
miliseconds: number | null;
|
|
884
|
+
seconds: number | null;
|
|
885
|
+
};
|
|
886
|
+
};
|
|
887
|
+
status: string;
|
|
888
|
+
startedAt: string;
|
|
889
|
+
createdAt: string;
|
|
890
|
+
credited: boolean;
|
|
891
|
+
convertOnly: boolean;
|
|
892
|
+
completedAt: string | null;
|
|
893
|
+
} | {
|
|
894
|
+
id?: number | undefined;
|
|
895
|
+
uniqueId?: string | undefined;
|
|
896
|
+
data?: {
|
|
897
|
+
ip: string | null;
|
|
898
|
+
type: IpTypes | null;
|
|
899
|
+
is_eu: boolean | null;
|
|
900
|
+
continent: {
|
|
901
|
+
name: string | null;
|
|
902
|
+
code: string | null;
|
|
903
|
+
geoname_id: number | null;
|
|
904
|
+
country: {
|
|
905
|
+
name: string | null;
|
|
906
|
+
code: string | null;
|
|
907
|
+
geoname_id: number | null;
|
|
908
|
+
phone_code: string | null;
|
|
909
|
+
capital: string | null;
|
|
910
|
+
tld: string | null;
|
|
911
|
+
subdivision: {
|
|
912
|
+
name: string | null;
|
|
913
|
+
code: string | null;
|
|
914
|
+
};
|
|
915
|
+
city: {
|
|
916
|
+
name: string | null;
|
|
917
|
+
geoname_id: number | null;
|
|
918
|
+
latitude: number | null;
|
|
919
|
+
longitude: number | null;
|
|
920
|
+
accuracy_radius: number | null;
|
|
921
|
+
metro_code: number | null;
|
|
922
|
+
postal_code: string | null;
|
|
923
|
+
timezone: {
|
|
924
|
+
name: string | null;
|
|
925
|
+
time_now: string | null;
|
|
926
|
+
};
|
|
927
|
+
};
|
|
928
|
+
flag: {
|
|
929
|
+
img: string | null;
|
|
930
|
+
emoji: string | null;
|
|
931
|
+
emoji_unicode: string | null;
|
|
932
|
+
};
|
|
933
|
+
currency: {
|
|
934
|
+
name: string | null;
|
|
935
|
+
code: string | null;
|
|
936
|
+
symbol: string | null;
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
registered_country: {
|
|
941
|
+
name: string | null;
|
|
942
|
+
code: string | null;
|
|
943
|
+
geoname_id: number | null;
|
|
944
|
+
};
|
|
945
|
+
asn: {
|
|
946
|
+
number: number | null;
|
|
947
|
+
name: string | null;
|
|
948
|
+
};
|
|
949
|
+
completion_time: {
|
|
950
|
+
miliseconds: number | null;
|
|
951
|
+
seconds: number | null;
|
|
952
|
+
};
|
|
953
|
+
} | undefined;
|
|
954
|
+
status?: string | undefined;
|
|
955
|
+
startedAt?: string | undefined;
|
|
956
|
+
createdAt?: string | undefined;
|
|
957
|
+
credited?: boolean | undefined;
|
|
958
|
+
convertOnly?: boolean | undefined;
|
|
959
|
+
completedAt?: string | null | undefined;
|
|
960
|
+
})[];
|
|
961
|
+
hasMore: boolean;
|
|
962
|
+
totalCount: number;
|
|
963
|
+
} | null;
|
|
964
|
+
_req: {
|
|
965
|
+
reqId: string | null;
|
|
966
|
+
resTime: number;
|
|
967
|
+
};
|
|
968
|
+
} | null>;
|
|
297
969
|
Init: (key: string, options?: {
|
|
298
970
|
clientRuntimeMessage?: boolean | undefined;
|
|
299
971
|
versionUpdateMessage?: boolean | undefined;
|
|
300
972
|
}) => Promise<boolean>;
|
|
973
|
+
IpValidation: (ipAddress: string | unknown) => {
|
|
974
|
+
ip4: boolean;
|
|
975
|
+
ip6: boolean;
|
|
976
|
+
};
|
|
977
|
+
SELECT: {
|
|
978
|
+
CONVERSION: {
|
|
979
|
+
ID: string;
|
|
980
|
+
UNIQUE_ID: string;
|
|
981
|
+
DATA: string;
|
|
982
|
+
STATUS: string;
|
|
983
|
+
STARTED_AT: string;
|
|
984
|
+
COMPLETED_AT: string;
|
|
985
|
+
CREATED_AT: string;
|
|
986
|
+
CREDITED: string;
|
|
987
|
+
CONVERT_ONLY: string;
|
|
988
|
+
};
|
|
989
|
+
DATA: {
|
|
990
|
+
IP: string;
|
|
991
|
+
TYPE: string;
|
|
992
|
+
IS_EU: string;
|
|
993
|
+
CONTINENT: {
|
|
994
|
+
NAME: string;
|
|
995
|
+
CODE: string;
|
|
996
|
+
GEONAME_ID: string;
|
|
997
|
+
COUNTRY: {
|
|
998
|
+
NAME: string;
|
|
999
|
+
CODE: string;
|
|
1000
|
+
GEONAME_ID: string;
|
|
1001
|
+
PHONE_CODE: string;
|
|
1002
|
+
CAPITAL: string;
|
|
1003
|
+
TLD: string;
|
|
1004
|
+
SUBDIVISION: {
|
|
1005
|
+
NAME: string;
|
|
1006
|
+
CODE: string;
|
|
1007
|
+
};
|
|
1008
|
+
CITY: {
|
|
1009
|
+
NAME: string;
|
|
1010
|
+
GEONAME_ID: string;
|
|
1011
|
+
LATITUDE: string;
|
|
1012
|
+
LONGITUDE: string;
|
|
1013
|
+
ACCURACY_RADIUS: string;
|
|
1014
|
+
METRO_CODE: string;
|
|
1015
|
+
POSTAL_CODE: string;
|
|
1016
|
+
TIMEZONE: {
|
|
1017
|
+
NAME: string;
|
|
1018
|
+
TIME_NOW: string;
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
FLAG: {
|
|
1022
|
+
IMG: string;
|
|
1023
|
+
EMOJI: string;
|
|
1024
|
+
EMOJI_UNICODE: string;
|
|
1025
|
+
};
|
|
1026
|
+
CURRENCY: {
|
|
1027
|
+
NAME: string;
|
|
1028
|
+
CODE: string;
|
|
1029
|
+
SYMBOL: string;
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
REGISTERED_COUNTRY: {
|
|
1034
|
+
NAME: string;
|
|
1035
|
+
CODE: string;
|
|
1036
|
+
GEONAME_ID: string;
|
|
1037
|
+
};
|
|
1038
|
+
ASN: {
|
|
1039
|
+
NUMBER: string;
|
|
1040
|
+
NAME: string;
|
|
1041
|
+
};
|
|
1042
|
+
COMPLETION_TIME: {
|
|
1043
|
+
MILISECONDS: string;
|
|
1044
|
+
SECONDS: string;
|
|
1045
|
+
};
|
|
1046
|
+
};
|
|
1047
|
+
};
|
|
301
1048
|
};
|
|
302
1049
|
|
|
303
|
-
export { ConvertIP, ConvertIPs, Init, Ip2Geo as default };
|
|
304
|
-
export type { ConvertIPProps$1 as ConvertIPProps, ConvertIPsProps$1 as ConvertIPsProps, InitOptions$1 as InitOptions, Ip, MultipleConvertResponseInterface$1 as MultipleConvertResponseInterface, SingleConvertResponseInterface$2 as SingleConvertResponseInterface };
|
|
1050
|
+
export { ConvertIP, ConvertIPs, GetConversion, GetConversions, Init, IpValidation, ListConversions, SELECT, Ip2Geo as default };
|
|
1051
|
+
export type { ApiResponse, Conversion, ConversionSelectField, ConvertIPProps$1 as ConvertIPProps, ConvertIPsProps$1 as ConvertIPsProps, GetConversionProps$1 as GetConversionProps, GetConversionResponseInterface$1 as GetConversionResponseInterface, GetConversionsProps$1 as GetConversionsProps, GetConversionsResponseInterface$1 as GetConversionsResponseInterface, InitOptions$1 as InitOptions, Ip, ListConversionsProps$1 as ListConversionsProps, ListConversionsResponseInterface$1 as ListConversionsResponseInterface, MultipleConvertResponseInterface$1 as MultipleConvertResponseInterface, RequestMeta, SelectField, SingleConvertResponseInterface$2 as SingleConvertResponseInterface };
|