greip.js 2.2.0 → 2.2.1
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 +173 -8
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
<h1>Greip Javascript Library</h1>
|
|
3
3
|
<p>The official JS library of Greip API</p>
|
|
4
4
|
<br />
|
|
5
|
-
<a href="https://github.com/
|
|
6
|
-
<a href="https://github.com/
|
|
5
|
+
<a href="https://github.com/Greipio/Greip-JS/issues/new">Report Issue</a> ·
|
|
6
|
+
<a href="https://github.com/Greipio/Greip-JS/discussions/new">Request Feature</a> ·
|
|
7
7
|
<a href="https://greip.io" target="_BLANK">Home Page</a> ·
|
|
8
8
|
<a href="https://docs.greip.io/tools-and-libraries/js" target="_BLANK">API Docs</a>
|
|
9
9
|
<br />
|
|
10
10
|
<br />
|
|
11
11
|
<a href="https://www.npmjs.com/package/greip.js" title="NPM Package" href="_BLANK"><img src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white"></a>
|
|
12
|
-
<a href="https://github.com/
|
|
12
|
+
<a href="https://github.com/Greipio/Greip-JS" title="Github Repo" href="_BLANK"><img src="https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white"></a>
|
|
13
13
|
<a href="https://www.patreon.com/gredev" title="Patreon Profile - GRE Development Ltd." href="_BLANK"><img src="https://img.shields.io/badge/Patreon-ff424e?style=for-the-badge&logo=patreon&logoColor=white"></a>
|
|
14
14
|
<img src="https://img.shields.io/badge/JavaScript-323330?style=for-the-badge&logo=javascript&logoColor=F7DF1E" title="Javascript">
|
|
15
15
|
</div>
|
|
@@ -43,10 +43,10 @@ yarn add greip.js
|
|
|
43
43
|
<br /><br />
|
|
44
44
|
|
|
45
45
|
# Usage
|
|
46
|
-
|
|
46
|
+
Here's how you use the API Methods:
|
|
47
47
|
<br /><br />
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
## 1. IP Geolocation Method
|
|
50
50
|
```javascript
|
|
51
51
|
import { GeoIP } from 'greip.js';
|
|
52
52
|
|
|
@@ -56,16 +56,181 @@ await GeoIP({
|
|
|
56
56
|
console.log(res.data); // Log Response
|
|
57
57
|
});
|
|
58
58
|
```
|
|
59
|
+
<br />
|
|
59
60
|
|
|
61
|
+
## 2. IP Lookup Method
|
|
62
|
+
```javascript
|
|
63
|
+
import { Lookup } from 'greip.js';
|
|
64
|
+
|
|
65
|
+
await Lookup({
|
|
66
|
+
key: 'your-api-key',
|
|
67
|
+
ip: '1.1.1.1',
|
|
68
|
+
}).then((res: any) => {
|
|
69
|
+
console.log(res.data); // Log Response
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
<br />
|
|
73
|
+
|
|
74
|
+
## 3. Bulk IP Lookup Method
|
|
75
|
+
```javascript
|
|
76
|
+
import { BulkLookup } from 'greip.js';
|
|
77
|
+
|
|
78
|
+
await BulkLookup({
|
|
79
|
+
key: 'your-api-key',
|
|
80
|
+
ips: ['1.1.1.1', '2.2.2.2'],
|
|
81
|
+
}).then((res: any) => {
|
|
82
|
+
console.log(res.data); // Log Response
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
<br />
|
|
86
|
+
|
|
87
|
+
## 4. ASN Lookup Method
|
|
88
|
+
```javascript
|
|
89
|
+
import { ASN } from 'greip.js';
|
|
90
|
+
|
|
91
|
+
await ASN({
|
|
92
|
+
key: 'your-api-key',
|
|
93
|
+
asn: 'AS01',
|
|
94
|
+
}).then((res: any) => {
|
|
95
|
+
console.log(res.data); // Log Response
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
<br />
|
|
99
|
+
|
|
100
|
+
## 5. Profanity Detection Method
|
|
101
|
+
```javascript
|
|
102
|
+
import { BadWord } from 'greip.js';
|
|
103
|
+
|
|
104
|
+
await BadWord({
|
|
105
|
+
key: 'your-api-key',
|
|
106
|
+
text: 'This is just normal sample text.',
|
|
107
|
+
}).then((res: any) => {
|
|
108
|
+
console.log(res.data); // Log Response
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
<br />
|
|
112
|
+
|
|
113
|
+
## 6. Country Lookup Method
|
|
114
|
+
```javascript
|
|
115
|
+
import { Country } from 'greip.js';
|
|
116
|
+
|
|
117
|
+
await Country({
|
|
118
|
+
key: 'your-api-key',
|
|
119
|
+
countryCode: 'SA',
|
|
120
|
+
}).then((res: any) => {
|
|
121
|
+
console.log(res.data); // Log Response
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
<br />
|
|
125
|
+
|
|
126
|
+
## 7. Email Validation Method
|
|
127
|
+
```javascript
|
|
128
|
+
import { EmailValidation } from 'greip.js';
|
|
129
|
+
|
|
130
|
+
await EmailValidation({
|
|
131
|
+
key: 'your-api-key',
|
|
132
|
+
email: 'name@domain.com',
|
|
133
|
+
}).then((res: any) => {
|
|
134
|
+
console.log(res.data); // Log Response
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
<br />
|
|
138
|
+
|
|
139
|
+
## 8. Phone Validation Method
|
|
140
|
+
```javascript
|
|
141
|
+
import { PhoneValidation } from 'greip.js';
|
|
142
|
+
|
|
143
|
+
await PhoneValidation({
|
|
144
|
+
key: 'your-api-key',
|
|
145
|
+
phone: '123123123',
|
|
146
|
+
countryCode: 'US',
|
|
147
|
+
}).then((res: any) => {
|
|
148
|
+
console.log(res.data); // Log Response
|
|
149
|
+
});
|
|
150
|
+
```
|
|
151
|
+
<br />
|
|
152
|
+
|
|
153
|
+
## 9. Payment Fraud Prevention Method
|
|
154
|
+
```javascript
|
|
155
|
+
import { PaymentFraud } from 'greip.js';
|
|
156
|
+
|
|
157
|
+
await PaymentFraud({
|
|
158
|
+
key: 'your-api-key',
|
|
159
|
+
data: {
|
|
160
|
+
action: 'purchase',
|
|
161
|
+
website_domain: '',
|
|
162
|
+
website_name: '',
|
|
163
|
+
merchant_id: 21,
|
|
164
|
+
shipment_id: 1,
|
|
165
|
+
transaction_id: 100,
|
|
166
|
+
transaction_amount: 1000000,
|
|
167
|
+
transaction_currency: 'GBP',
|
|
168
|
+
cart_items: {
|
|
169
|
+
item_id: 1,
|
|
170
|
+
item_name: 'Product name',
|
|
171
|
+
item_quantity: 1,
|
|
172
|
+
item_price: '1100.55',
|
|
173
|
+
item_category_id: 1,
|
|
174
|
+
},
|
|
175
|
+
isDigitalProducts: true,
|
|
176
|
+
coupon: 'ASDF',
|
|
177
|
+
customer_id: 1,
|
|
178
|
+
customer_firstname: 'First',
|
|
179
|
+
customer_lastname: 'Last',
|
|
180
|
+
customer_pob: 'London',
|
|
181
|
+
customer_ip: '1.1.1.1',
|
|
182
|
+
customer_country: 'GB',
|
|
183
|
+
customer_region: 'London',
|
|
184
|
+
customer_city: 'London',
|
|
185
|
+
customer_zip: 'NW10 7PQ',
|
|
186
|
+
customer_street: '7 Coronation Road',
|
|
187
|
+
customer_street2: '',
|
|
188
|
+
customer_latitude: 0.123,
|
|
189
|
+
customer_longitude: 0.123,
|
|
190
|
+
customer_device_id: 'UNIQUE_DEVICE_ID',
|
|
191
|
+
customer_phone: '000000000',
|
|
192
|
+
customer_registration_date: 1677554670,
|
|
193
|
+
customer_balance: '1000.00',
|
|
194
|
+
customer_dob: '1997-19-05',
|
|
195
|
+
customer_email: 'name@domain.com',
|
|
196
|
+
customer_2fa: true,
|
|
197
|
+
customer_useragent: 'Mozill almaden sdfwer',
|
|
198
|
+
shipping_country: 'GB',
|
|
199
|
+
shipping_region: 'London',
|
|
200
|
+
shipping_city: 'London',
|
|
201
|
+
shipping_zip: 'NW10 7PQ',
|
|
202
|
+
shipping_street: '7 Coronation Road',
|
|
203
|
+
shipping_street2: '',
|
|
204
|
+
shipping_latitude: 0.123,
|
|
205
|
+
shipping_longitude: 0.123,
|
|
206
|
+
billing_country: 'GB',
|
|
207
|
+
billing_region: 'London',
|
|
208
|
+
billing_city: 'London',
|
|
209
|
+
billing_zip: 'NW10 7PQ',
|
|
210
|
+
billing_street: '7 Coronation Road',
|
|
211
|
+
billing_street2: '',
|
|
212
|
+
billing_latitude: 0.123,
|
|
213
|
+
billing_longitude: 0.123,
|
|
214
|
+
payment_type: 'applepay',
|
|
215
|
+
card_name: 'First Last',
|
|
216
|
+
card_number: '1234XXXXXXXX1234',
|
|
217
|
+
card_expiry: '29/05',
|
|
218
|
+
cvv_result: true,
|
|
219
|
+
},
|
|
220
|
+
}).then((res: any) => {
|
|
221
|
+
console.log(res.data); // Log Response
|
|
222
|
+
});
|
|
223
|
+
```
|
|
60
224
|
<br /><br />
|
|
225
|
+
|
|
61
226
|
# Options, Methods and More
|
|
62
|
-
You can find the full guide of this package by visiting our [Documentation Page](https://docs.greip.io/
|
|
227
|
+
You can find the full guide of this package by visiting our [Documentation Page](https://docs.greip.io/).
|
|
63
228
|
|
|
64
229
|
<br /><br />
|
|
65
230
|
# Credits
|
|
66
231
|
* [Greip Developers](https://greip.io)
|
|
67
|
-
* [All Contributors](https://github.com/
|
|
232
|
+
* [All Contributors](https://github.com/Greipio/Greip-JS/graphs/contributors)
|
|
68
233
|
|
|
69
234
|
<br /><br />
|
|
70
235
|
# License
|
|
71
|
-
The MIT License (MIT). Please see [License](https://github.com/
|
|
236
|
+
The MIT License (MIT). Please see [License](https://github.com/Greipio/Greip-JS/blob/main/LICENSE) File for more information.
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "greip.js",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "The official JS library of Greip.",
|
|
5
5
|
"author": {
|
|
6
|
-
"name": "
|
|
6
|
+
"name": "Greip",
|
|
7
7
|
"email": "info@greip.io",
|
|
8
8
|
"url": "https://greip.io"
|
|
9
9
|
},
|
|
@@ -14,14 +14,18 @@
|
|
|
14
14
|
"ip",
|
|
15
15
|
"api",
|
|
16
16
|
"geolocation",
|
|
17
|
-
"geoip"
|
|
17
|
+
"geoip",
|
|
18
|
+
"fraud",
|
|
19
|
+
"abuse",
|
|
20
|
+
"ai",
|
|
21
|
+
"asn"
|
|
18
22
|
],
|
|
19
23
|
"files": [
|
|
20
24
|
"lib/**/*"
|
|
21
25
|
],
|
|
22
|
-
"homepage": "https://github.com/
|
|
26
|
+
"homepage": "https://github.com/Greipio/Greip-PHP#readme",
|
|
23
27
|
"bugs": {
|
|
24
|
-
"url": "https://github.com/
|
|
28
|
+
"url": "https://github.com/Greipio/Greip-PHP/issues",
|
|
25
29
|
"email": "info@greip.io"
|
|
26
30
|
},
|
|
27
31
|
"funding": {
|
|
@@ -41,7 +45,7 @@
|
|
|
41
45
|
},
|
|
42
46
|
"repository": {
|
|
43
47
|
"type": "git",
|
|
44
|
-
"url": "https://github.com/
|
|
48
|
+
"url": "https://github.com/Greipio/Greip-PHP.git"
|
|
45
49
|
},
|
|
46
50
|
"dependencies": {
|
|
47
51
|
"axios": "^0.25.0"
|