Skip to content

Commit d17e02c

Browse files
author
ARKTD
committed
add readme & add services section
1 parent 42f6922 commit d17e02c

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SCF API Client
2+
A library that unifies interaction with SCF API.
3+
## Versions
4+
### 📦 Stable Versions
5+
The `Stable` versions are released under the `latest` tag on npm.<br>
6+
These versions are encouraged to be used in production with production API.
7+
8+
The version number reflects how inter-changeable the version is with other versions.<br>
9+
They are named in a `x.y.z` style, where:
10+
> `z` reflects the updates in the developer experience and the library itself.<br>
11+
> **It is guaranteed that the versions that only differ in `z` are fully compatible feature-wise and interface-wise.**<br>
12+
> They should only differ in the internal implementations and developer experience.
13+
14+
> `y` reflects the breaking changes in the API methods or the exposed interfaces.<br>
15+
> **By default the versions that differ in `y` are unlikely to be compatible and you have to ensure that your code uses the updated interfaces correctly.**
16+
17+
> `x` is reserved for major breaking changes with the library or API implementations.<br>
18+
> **Versions that differ in `x` are incompatible.**
19+
### 🔧 Dev Versions
20+
The `Dev` versions are released under the `dev` tag on npm.<br>
21+
You are discouraged to use these versions as they are used for implementations of experimental features that could be breaking your code.<br>
22+
Do NOT use dev versions in production setting.

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Longpoll from "./src/sections/longpoll.js";
1313
import Minigames from "./src/sections/minigames.js";
1414
import Score from "./src/sections/score.js";
1515
import Server from "./src/sections/server.js";
16+
import Services from "./src/sections/services.js";
1617
import Staff from "./src/sections/staff.js";
1718
import Stats from "./src/sections/stats.js";
1819
import Token from "./src/sections/token.js";
@@ -35,6 +36,7 @@ export default class SCFAPIClient {
3536
minigames: new Minigames(this),
3637
score: new Score(this),
3738
server: new Server(this),
39+
services: new Services(this),
3840
staff: new Staff(this),
3941
stats: new Stats(this),
4042
token: new Token(this),

src/sections/services.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Args } from "../utils/utils.js";
2+
3+
export default class Services {
4+
/**
5+
* @type {import('../../index').default}
6+
*/
7+
8+
#client;
9+
#section = "services";
10+
constructor(client) {
11+
this.#client = client;
12+
}
13+
14+
/**
15+
* Obtains configuration variables for the service of the API Key.
16+
*/
17+
async getConfig() {
18+
let response = await this.#client.sendAPIRequest(this.#section, "getConfig", "GET", []);
19+
20+
return response?.config ?? {};
21+
}
22+
}

0 commit comments

Comments
 (0)