realmsplus-api 1.0.0 → 1.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 -7
- package/index.js +5 -2
- package/package.json +2 -14
- package/src/api.js +4 -2
package/README.md
CHANGED
|
@@ -32,13 +32,15 @@ import { RealmsPlusAPI } from "realmsplus-api";
|
|
|
32
32
|
|
|
33
33
|
const client = new RealmsPlusAPI("your-api-key");
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
(async () => {
|
|
36
|
+
// Check service health
|
|
37
|
+
const health = await client.getHealth();
|
|
38
|
+
console.log(health);
|
|
39
|
+
|
|
40
|
+
// Query the hacker database
|
|
41
|
+
const result = await client.getHackerDB("all");
|
|
42
|
+
console.log(result);
|
|
43
|
+
})();
|
|
42
44
|
```
|
|
43
45
|
|
|
44
46
|
See more [examples](./examples)
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "realmsplus-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Official SDK for the Realms+ API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./index.d.ts",
|
|
11
|
-
"import": "./index.js"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"index.js",
|
|
16
|
-
"index.d.ts",
|
|
17
|
-
"src/"
|
|
18
|
-
],
|
|
19
7
|
"engines": {
|
|
20
8
|
"node": ">=22.0.0"
|
|
21
9
|
},
|
|
@@ -40,4 +28,4 @@
|
|
|
40
28
|
"url": "https://github.com/All-Realms-Are-Safe/realmsplus-api/issues"
|
|
41
29
|
},
|
|
42
30
|
"homepage": "https://github.com/All-Realms-Are-Safe/realmsplus-api#readme"
|
|
43
|
-
}
|
|
31
|
+
}
|
package/src/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Represents the public routes of the Realms+ API
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
class RealmsPlusAPI {
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
7
|
* @param {string} apiKey - your private api key
|
|
@@ -76,4 +76,6 @@ export class RealmsPlusAPI {
|
|
|
76
76
|
async reportUser(category, data) {
|
|
77
77
|
return await this.#request("POST", `/database/report/${category}`, data);
|
|
78
78
|
};
|
|
79
|
-
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
module.exports = RealmsPlusAPI;
|