Skip to content

Commit bbdc25f

Browse files
committed
Merge branch 'main' of https://github.com/Battlefield6/API
2 parents 85bde6b + 93efd30 commit bbdc25f

12 files changed

Lines changed: 735 additions & 10 deletions

File tree

.claude/settings.local.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
build-docs:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout main repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '24.1.0'
20+
21+
- name: Cache protoc
22+
id: cache-protoc
23+
uses: actions/cache@v4
24+
with:
25+
path: |
26+
/usr/bin/protoc
27+
/usr/include/google
28+
key: ${{ runner.os }}-protoc-3
29+
30+
- name: Install Protocol Buffers Compiler
31+
if: steps.cache-protoc.outputs.cache-hit != 'true'
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y protobuf-compiler
35+
36+
- name: Verify protoc installation
37+
run: protoc --version
38+
39+
- name: Checkout Wiki repository
40+
uses: actions/checkout@v4
41+
with:
42+
repository: ${{ github.repository }}.wiki
43+
path: .wiki
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Install dependencies
47+
run: npm install
48+
49+
- name: Generate documentation
50+
run: npm run docs
51+
52+
- name: Commit and push wiki changes
53+
run: |
54+
cd .wiki
55+
git config user.name "github-actions[bot]"
56+
git config user.email "github-actions[bot]@users.noreply.github.com"
57+
git add .
58+
git diff --quiet && git diff --staged --quiet || (git commit -m "Automatical update Wiki" && git push)

src/enums/CreatorType.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,33 @@
33
* @since 1.0.0
44
*/
55

6+
/**
7+
* Represents the type of an creator.
8+
*/
69
const enum CreatorType {
10+
/**
11+
* Unknown creator type.
12+
*/
713
UNKNOWN,
14+
15+
/**
16+
* Represents a player creator (for example, a normal user)
17+
*/
818
PLAYER,
19+
20+
/**
21+
* Represents an internal creator (for sample DICE, EA,..)
22+
*/
923
INTERNAL,
24+
25+
/**
26+
* Represents an external creator (for example, a third-party company working for DICE, EA...)
27+
*/
1028
EXTERNAL,
29+
30+
/**
31+
* Represents a trusted creator (for example, a verified content creator)
32+
*/
1133
TRUSTED
1234
}
1335

src/models/Creator.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,84 @@ export default class Creator {
99
private type: CreatorType = CreatorType.UNKNOWN;
1010
private data: any = null;
1111

12+
/**
13+
* Gets the type of the creator.
14+
*
15+
* @returns The type of the creator.
16+
*/
1217
public getType(): CreatorType {
1318
return this.type;
1419
}
1520

21+
/**
22+
* Sets the type of the creator.
23+
*
24+
* @param type The type of the creator.
25+
*/
1626
public setType(type: CreatorType): void {
1727
this.type = type;
1828
}
1929

30+
/**
31+
* Gets the data of the creator.
32+
*
33+
* @returns The data of the creator.
34+
*/
2035
public getData(): any {
2136
return this.data;
2237
}
2338

39+
/**
40+
* Sets the data of the creator.
41+
*
42+
* @param data The data of the creator.
43+
*/
2444
public setData(data: any): void {
2545
this.data = data;
2646
}
2747

48+
/**
49+
* Checks if the creator is a player.
50+
*
51+
* @returns True if the creator is a player, false otherwise.
52+
*/
2853
public isPlayer(): boolean {
2954
return this.type === CreatorType.PLAYER;
3055
}
3156

57+
/**
58+
* Checks if the creator is an internal creator.
59+
*
60+
* @returns True if the creator is an internal creator, false otherwise.
61+
*/
3262
public isInternal(): boolean {
3363
return this.type === CreatorType.INTERNAL;
3464
}
3565

66+
/**
67+
* Checks if the creator is an external creator.
68+
*
69+
* @returns True if the creator is an external creator, false otherwise.
70+
*/
3671
public isExternal(): boolean {
3772
return this.type === CreatorType.EXTERNAL;
3873
}
3974

75+
/**
76+
* Checks if the creator is a trusted creator.
77+
*
78+
* @returns True if the creator is a trusted creator, false otherwise.
79+
*/
4080
public isTrusted(): boolean {
4181
return this.type === CreatorType.TRUSTED;
4282
}
4383

84+
/**
85+
* Populates the creator from a JSON object.
86+
*
87+
* @param json The JSON object.
88+
* @returns The populated creator.
89+
*/
4490
public fromJSON(json: any): Creator {
4591
if(json.playerCreator) {
4692
this.type = CreatorType.PLAYER;
@@ -59,6 +105,11 @@ export default class Creator {
59105
return this;
60106
}
61107

108+
/**
109+
* Converts the creator to a JSON object.
110+
*
111+
* @returns The JSON object.
112+
*/
62113
public toJSON(): any {
63114
const result: any = {};
64115

0 commit comments

Comments
 (0)