erlc-api 1.3.11 → 1.3.12
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/.gitattributes +2 -2
- package/LICENSE +21 -21
- package/README.md +110 -110
- package/package.json +33 -33
- package/src/functions/server/runCommand.js +3 -1
- package/src/types/index.d.ts +1 -0
package/.gitattributes
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# Auto detect text files and perform LF normalization
|
|
2
|
-
* text=auto
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text=auto
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 0Adexus0
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 0Adexus0
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
# ER:LC API Wrapper
|
|
2
|
-
|
|
3
|
-
A lightweight API Wrapper with 100% coverage of the ER:LC API. Fixed Error and Improvements
|
|
4
|
-
7
|
|
5
|
-
|
|
6
|
-
## Getting Started
|
|
7
|
-
|
|
8
|
-
First you need to install the package.
|
|
9
|
-
|
|
10
|
-
`npm i erlc-api`
|
|
11
|
-
|
|
12
|
-
### Setting Up
|
|
13
|
-
|
|
14
|
-
Setting up is super simple:
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
// index.js
|
|
18
|
-
const erlc = require("erlc");
|
|
19
|
-
const client = new erlc.Client({
|
|
20
|
-
globalToken: "", // You get the global key directly from the ERLC developers. To increase your API request limits
|
|
21
|
-
});
|
|
22
|
-
client.config(); // Registers your client
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Now you can start using API Methods - here are a few examples:
|
|
26
|
-
|
|
27
|
-
```js
|
|
28
|
-
// GetServerInfo.js
|
|
29
|
-
const erlc = require("erlc-api"); //JS
|
|
30
|
-
import erlc from "erlc-api"; // Module or typeScript
|
|
31
|
-
|
|
32
|
-
const getServerFunc = async () => {
|
|
33
|
-
const serverId = ""; // The server ApiKey you wish to target. You can get this api key in your (Server Settings)
|
|
34
|
-
const server = await erlc.getServer(serverId).catch(console.log); // Gets the server, logs any errors
|
|
35
|
-
console.log(server); // Logs the server object
|
|
36
|
-
|
|
37
|
-
// Expected Response:
|
|
38
|
-
// {
|
|
39
|
-
// Name: "Your Sever Name",
|
|
40
|
-
// CurrentPlayers: 0,
|
|
41
|
-
// MaxPlayers: 40,
|
|
42
|
-
// JoinKey: "Your Code Join",
|
|
43
|
-
// AccVerifiedReq: "Disabled" | "Email" | "Phone/ID",
|
|
44
|
-
// TeamBalance: true or false ,
|
|
45
|
-
// OwnerUsername: "Your Name",
|
|
46
|
-
// CoOwnerUsernames: [],
|
|
47
|
-
// VanityURL: "https://policeroleplay.community/join?code=YourCode",
|
|
48
|
-
// },
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
getServerFunc();
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
```js
|
|
55
|
-
// GetPlayers.js
|
|
56
|
-
const erlc = require("erlc-api"); //JS
|
|
57
|
-
import erlc from "erlc-api"; // Module or typeScript
|
|
58
|
-
|
|
59
|
-
const getPlayersFunc = async () => {
|
|
60
|
-
const serverId = ""; // The server ApiKey you wish to target. You can get this api key in your (Server Settings)
|
|
61
|
-
const server = await erlc.getPlayers(serverId).catch(console.log); // Gets the server, logs any errors
|
|
62
|
-
console.log(server); // Logs the server object
|
|
63
|
-
// Expected Response:
|
|
64
|
-
// [
|
|
65
|
-
// {
|
|
66
|
-
// "Permission": "Server Owner" Or Member, Moderator,
|
|
67
|
-
// "Player": "Player-Username and ID" ,
|
|
68
|
-
// "Team": "Civilian" Or Fire, Police, Sherift
|
|
69
|
-
// }
|
|
70
|
-
// ]
|
|
71
|
-
};
|
|
72
|
-
getPlayersFunc();
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
```js
|
|
76
|
-
//getmodCalls.js
|
|
77
|
-
const erlc = require("erlc-api"); //JS
|
|
78
|
-
import erlc from "erlc-api"; // Module or typeScript
|
|
79
|
-
|
|
80
|
-
const getModCallsFunc = async () => {
|
|
81
|
-
const serverId = ""; // The server ApiKey you wish to target. You can get this api key in your (Server Settings)
|
|
82
|
-
const server = await erlc.getModcallLogs(serverId).catch(console.log); // Gets the server, logs any errors
|
|
83
|
-
console.log(server); // Logs the server object
|
|
84
|
-
// Expected Response:
|
|
85
|
-
// {
|
|
86
|
-
// Caller: ErlcPlayer;
|
|
87
|
-
// Moderator?: ErlcPlayer; // If call is unanswered property is undefined
|
|
88
|
-
// Timestamp: number;
|
|
89
|
-
// }
|
|
90
|
-
};
|
|
91
|
-
getModCallsFunc()
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### [Discord Bot](https://discord.com/oauth2/authorize?client_id=1014990793280323624)
|
|
95
|
-
|
|
96
|
-
The Discord Bot Back Online 29/05/2024
|
|
97
|
-
|
|
98
|
-
## [Module Examples](https://scarlet-2.gitbook.io/erlc-api/)
|
|
99
|
-
|
|
100
|
-
### [PRC API Docs](https://apidocs.policeroleplay.community/reference/api-reference)
|
|
101
|
-
|
|
102
|
-
## [Liveries]("https://github.com/Exodo0/ERLC-API/tree/main/Custom%20Liveries")
|
|
103
|
-
|
|
104
|
-
### Credits
|
|
105
|
-
|
|
106
|
-
Library Re-Development - [Egologics](https://twitter.com/0Adexus0)
|
|
107
|
-
|
|
108
|
-
API Development - [Police Roleplay Community](https://twitter.com/PRC_Roblox)
|
|
109
|
-
|
|
110
|
-
Apply for more API request limits - [Discord](https://discord.gg/prc)
|
|
1
|
+
# ER:LC API Wrapper
|
|
2
|
+
|
|
3
|
+
A lightweight API Wrapper with 100% coverage of the ER:LC API. Fixed Error and Improvements
|
|
4
|
+
7
|
|
5
|
+
|
|
6
|
+
## Getting Started
|
|
7
|
+
|
|
8
|
+
First you need to install the package.
|
|
9
|
+
|
|
10
|
+
`npm i erlc-api`
|
|
11
|
+
|
|
12
|
+
### Setting Up
|
|
13
|
+
|
|
14
|
+
Setting up is super simple:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
// index.js
|
|
18
|
+
const erlc = require("erlc");
|
|
19
|
+
const client = new erlc.Client({
|
|
20
|
+
globalToken: "", // You get the global key directly from the ERLC developers. To increase your API request limits
|
|
21
|
+
});
|
|
22
|
+
client.config(); // Registers your client
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Now you can start using API Methods - here are a few examples:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
// GetServerInfo.js
|
|
29
|
+
const erlc = require("erlc-api"); //JS
|
|
30
|
+
import erlc from "erlc-api"; // Module or typeScript
|
|
31
|
+
|
|
32
|
+
const getServerFunc = async () => {
|
|
33
|
+
const serverId = ""; // The server ApiKey you wish to target. You can get this api key in your (Server Settings)
|
|
34
|
+
const server = await erlc.getServer(serverId).catch(console.log); // Gets the server, logs any errors
|
|
35
|
+
console.log(server); // Logs the server object
|
|
36
|
+
|
|
37
|
+
// Expected Response:
|
|
38
|
+
// {
|
|
39
|
+
// Name: "Your Sever Name",
|
|
40
|
+
// CurrentPlayers: 0,
|
|
41
|
+
// MaxPlayers: 40,
|
|
42
|
+
// JoinKey: "Your Code Join",
|
|
43
|
+
// AccVerifiedReq: "Disabled" | "Email" | "Phone/ID",
|
|
44
|
+
// TeamBalance: true or false ,
|
|
45
|
+
// OwnerUsername: "Your Name",
|
|
46
|
+
// CoOwnerUsernames: [],
|
|
47
|
+
// VanityURL: "https://policeroleplay.community/join?code=YourCode",
|
|
48
|
+
// },
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
getServerFunc();
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
// GetPlayers.js
|
|
56
|
+
const erlc = require("erlc-api"); //JS
|
|
57
|
+
import erlc from "erlc-api"; // Module or typeScript
|
|
58
|
+
|
|
59
|
+
const getPlayersFunc = async () => {
|
|
60
|
+
const serverId = ""; // The server ApiKey you wish to target. You can get this api key in your (Server Settings)
|
|
61
|
+
const server = await erlc.getPlayers(serverId).catch(console.log); // Gets the server, logs any errors
|
|
62
|
+
console.log(server); // Logs the server object
|
|
63
|
+
// Expected Response:
|
|
64
|
+
// [
|
|
65
|
+
// {
|
|
66
|
+
// "Permission": "Server Owner" Or Member, Moderator,
|
|
67
|
+
// "Player": "Player-Username and ID" ,
|
|
68
|
+
// "Team": "Civilian" Or Fire, Police, Sherift
|
|
69
|
+
// }
|
|
70
|
+
// ]
|
|
71
|
+
};
|
|
72
|
+
getPlayersFunc();
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
//getmodCalls.js
|
|
77
|
+
const erlc = require("erlc-api"); //JS
|
|
78
|
+
import erlc from "erlc-api"; // Module or typeScript
|
|
79
|
+
|
|
80
|
+
const getModCallsFunc = async () => {
|
|
81
|
+
const serverId = ""; // The server ApiKey you wish to target. You can get this api key in your (Server Settings)
|
|
82
|
+
const server = await erlc.getModcallLogs(serverId).catch(console.log); // Gets the server, logs any errors
|
|
83
|
+
console.log(server); // Logs the server object
|
|
84
|
+
// Expected Response:
|
|
85
|
+
// {
|
|
86
|
+
// Caller: ErlcPlayer;
|
|
87
|
+
// Moderator?: ErlcPlayer; // If call is unanswered property is undefined
|
|
88
|
+
// Timestamp: number;
|
|
89
|
+
// }
|
|
90
|
+
};
|
|
91
|
+
getModCallsFunc()
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### [Discord Bot](https://discord.com/oauth2/authorize?client_id=1014990793280323624)
|
|
95
|
+
|
|
96
|
+
The Discord Bot Back Online 29/05/2024
|
|
97
|
+
|
|
98
|
+
## [Module Examples](https://scarlet-2.gitbook.io/erlc-api/)
|
|
99
|
+
|
|
100
|
+
### [PRC API Docs](https://apidocs.policeroleplay.community/reference/api-reference)
|
|
101
|
+
|
|
102
|
+
## [Liveries]("https://github.com/Exodo0/ERLC-API/tree/main/Custom%20Liveries")
|
|
103
|
+
|
|
104
|
+
### Credits
|
|
105
|
+
|
|
106
|
+
Library Re-Development - [Egologics](https://twitter.com/0Adexus0)
|
|
107
|
+
|
|
108
|
+
API Development - [Police Roleplay Community](https://twitter.com/PRC_Roblox)
|
|
109
|
+
|
|
110
|
+
Apply for more API request limits - [Discord](https://discord.gg/prc)
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "erlc-api",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "An ER:LC API wrapper for JS/TS",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "src/types/index.d.ts",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"erlc",
|
|
9
|
-
"roblox",
|
|
10
|
-
"prc",
|
|
11
|
-
"erlc-api",
|
|
12
|
-
"liberty-county"
|
|
13
|
-
],
|
|
14
|
-
"author": "egologics",
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"typescript": "^5.3.2"
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"node-fetch": "^3.3.2"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
24
|
-
},
|
|
25
|
-
"repository": {
|
|
26
|
-
"type": "git",
|
|
27
|
-
"url": "git+https://github.com/Exodo0/ERLC-API.git"
|
|
28
|
-
},
|
|
29
|
-
"bugs": {
|
|
30
|
-
"url": "https://github.com/Exodo0/ERLC-API/issues"
|
|
31
|
-
},
|
|
32
|
-
"homepage": "https://github.com/Exodo0/ERLC-API#readme"
|
|
33
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "erlc-api",
|
|
3
|
+
"version": "1.3.12",
|
|
4
|
+
"description": "An ER:LC API wrapper for JS/TS",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "src/types/index.d.ts",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"erlc",
|
|
9
|
+
"roblox",
|
|
10
|
+
"prc",
|
|
11
|
+
"erlc-api",
|
|
12
|
+
"liberty-county"
|
|
13
|
+
],
|
|
14
|
+
"author": "egologics",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"typescript": "^5.3.2"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"node-fetch": "^3.3.2"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/Exodo0/ERLC-API.git"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/Exodo0/ERLC-API/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/Exodo0/ERLC-API#readme"
|
|
33
|
+
}
|
package/src/types/index.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ declare module "erlc-api" {
|
|
|
69
69
|
command: string; // ":h Hey everyone!"
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
|
|
72
73
|
export function getBans(serverToken: string): Promise<ServerBan>;
|
|
73
74
|
export function getCommandLogs(serverToken: string): Promise<CommandLog[]>;
|
|
74
75
|
export function getJoinLogs(serverToken: string): Promise<JoinLog[]>;
|