chapybara 0.3.0 → 0.4.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/README.md CHANGED
@@ -28,6 +28,21 @@ const chapybara = new ChapybaraClient({
28
28
  });
29
29
  ```
30
30
 
31
+ ### Get Your IP Address
32
+
33
+ ```javascript
34
+ async function getUserIP() {
35
+ try {
36
+ const data = await chapybara.getUserIP();
37
+ console.log(data.ip);
38
+ } catch (error) {
39
+ console.error(`Error fetching user IP: ${error.message}`);
40
+ }
41
+ }
42
+
43
+ getUserIP();
44
+ ```
45
+
31
46
  ### Get Domain Intelligence
32
47
 
33
48
  ```javascript
package/index.d.ts CHANGED
@@ -289,5 +289,7 @@ declare module "chapybara" {
289
289
  account: {
290
290
  getInfo: () => Promise<AccountInfoResponse>;
291
291
  };
292
+
293
+ getUserIP: () => Promise<{ ip: string }>;
292
294
  }
293
295
  }
package/index.js CHANGED
@@ -5,7 +5,7 @@ const DEFAULT_BASE_URL = "https://api.chapyapi.com/api/v1";
5
5
  const DEFAULT_RETRIES = 2;
6
6
  const DEFAULT_TIMEOUT = 30000;
7
7
 
8
- const SDK_VERSION = "0.3.0";
8
+ const SDK_VERSION = "0.4.0";
9
9
 
10
10
  export class ChapybaraClient {
11
11
  constructor(options) {
@@ -41,6 +41,8 @@ export class ChapybaraClient {
41
41
  this.account = {
42
42
  getInfo: () => this._request("/account"),
43
43
  };
44
+
45
+ this.getUserIP = () => this._request("/ip");
44
46
  }
45
47
 
46
48
  async _request(endpoint, attempt = 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chapybara",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Official NodeJS SDK for the Chapybara Domain & IP Intelligence API.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "author": "Alpha System",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "lru-cache": "^11.2.1"
24
+ "lru-cache": "^11.2.2"
25
25
  },
26
26
  "engines": {
27
27
  "node": ">=18.0.0"