Skip to content

Commit b175499

Browse files
committed
tidy up content api
1 parent fef1261 commit b175499

File tree

3 files changed

+162
-92
lines changed

3 files changed

+162
-92
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Content API
22

3-
_This is an API wrapper for the_ [_valorant-api.com_](https://valorant-api.com) _API_
3+
This is an API wrapper for [valorant-api.com](https://valorant-api.com). This API is separate from the in-game APIs and is managed by a third party.
44

55
#### Getting Started:
66

7-
First you need to import the Content module and the Language Module. This is how it works:
7+
First you need to import the ContentAPI module and the Language Module.
88

99
```javascript
10-
const { Content, Languages } = require("@liamcottle/valorant.js");
10+
const { ContentAPI, Languages } = require("@liamcottle/valorant.js");
1111
```
1212

13-
Next, you need to create an Content instance. Here you have the possibility to choose the Language in which the data will be delivered. By deafult the language is set to English. Here is a list of all available languages:
13+
Next, you need to create a ContentAPI instance. You can optionally provide the Language the data should be returned in. By default, the language is set to English. Here is a list of all available languages:
1414

1515
| **Languages** |
1616
| :-----------------: |
@@ -33,7 +33,7 @@ Next, you need to create an Content instance. Here you have the possibility to c
3333
| Chinese_Traditional |
3434

3535
```js
36-
const content = new ContentAPI(languages.English);
36+
const content = new ContentAPI(Languages.English);
3737
```
3838

3939
After you have created the ContentAPI instance you can start fetching data. For this you can either use _async/await_ or _.then_ this works as follows:
@@ -55,96 +55,99 @@ content.getAgents().then((data) => {
5555
});
5656
```
5757

58-
Here is a example on how to get the Daily Store of a Player and then get the Asset Data using the ContentAPI and the [ClientAPI](https://github.com/liamcottle/valorant.js#readme) this Package provides.
58+
Here is an example of how to get a players' Daily Store and then fetch the Asset Data using the ContentAPI.
5959

6060
```js
61-
//import modules
62-
const { API, Content, languages, Regions } = require("@liamcottle/valorant.js");
61+
// import modules
62+
const { API, ContentAPI, Languages, Regions } = require("@liamcottle/valorant.js");
6363

64-
//initiate the API and the Content Module
64+
// initiate the API and the ContentAPI Module
6565
const client = new API(Regions.EU);
66-
const content = new Content(languages.English);
66+
const content = new ContentAPI(Languages.English);
6767

68-
//authorize using the ClientAPI
68+
// authorize using the ClientAPI
6969
client.authorize("username", "password").then(() => {
7070
client.getPlayerStoreFront(client.user_id).then(async (response) => {
71-
//get assets for the first Skin in the Store
72-
const item1 = await content.getWeaponSkinLevelbyUuid(
73-
response.data.SkinsPanelLayout.SingleItemOffers[0]
71+
72+
// get assets for the first Skin in the Store
73+
const item1 = await content.getWeaponSkinLevelByUuid(
74+
response.data.SkinsPanelLayout.SingleItemOffers[0]
7475
);
76+
77+
// log item
78+
console.log(item1);
79+
7580
});
76-
//log item
77-
console.log(item1);
7881
});
7982
```
8083

8184
Here is a list of all available Endpoints for the ContentAPI:
8285

8386
- **[Agents](https://dash.valorant-api.com/endpoints/agents)**
8487
- getAgents()
85-
- getAgentsbyUuid(_uuid_)
88+
- getAgentsByUuid(_uuid_)
8689
- **[Buddies](https://dash.valorant-api.com/endpoints/buddies)**
8790
- getBuddies()
8891
- getBuddyLevels()
89-
- getBuddybyUuid(_uuid_)
90-
- getBuddyLevelbyUuid(_uuid_)
92+
- getBuddyByUuid(_uuid_)
93+
- getBuddyLevelByUuid(_uuid_)
9194
- **[Bundles](https://dash.valorant-api.com/endpoints/bundles)**
9295
- getBundles()
93-
- getBundlebyUuid(_uuid_)
96+
- getBundleByUuid(_uuid_)
9497
- **[Ceremonies](https://dash.valorant-api.com/endpoints/ceremonies)**
9598
- getCeremonies()
96-
- getCeremonybyUuid(_uuid_)
99+
- getCeremonyByUuid(_uuid_)
97100
- **[Competitive Tiers](https://dash.valorant-api.com/endpoints/competitivetiers)**
98101
- getCompetitiveTiers()
99-
- getCompetitiveTierbyUuid(_uuid_)
100-
- **[Content Tiers](https://dash.valorant-api.com/endpoints/contenttiers)**
102+
- getCompetitiveTierByUuid(_uuid_)
103+
- **[ContentAPI Tiers](https://dash.valorant-api.com/endpoints/contenttiers)**
101104
- getContentTiers()
102-
- getContentTierbyUuid(_uuid_)
105+
- getContentTierByUuid(_uuid_)
103106
- **[Contracts](https://dash.valorant-api.com/endpoints/contracts)**
104107
- getContracts()
105-
- getContractbyUuid(_uuid_)
108+
- getContractByUuid(_uuid_)
106109
- **[Currencies](https://dash.valorant-api.com/endpoints/currencies)**
107110
- getCurrencies()
108-
- getCurrencybyUuid(_uuid_)
111+
- getCurrencyByUuid(_uuid_)
109112
- **[Events](https://dash.valorant-api.com/endpoints/events)**
110113
- getEvents()
111-
- getEventbyUuid(_uuid_)
114+
- getEventByUuid(_uuid_)
112115
- **[Gamemodes](https://dash.valorant-api.com/endpoints/gamemodes)**
113116
- getGamemodes()
114117
- getGamemodeEquippables()
115-
- getGamemodebyUuid(_uuid_)
116-
- getGamemodeEquippablebyUuid(_uuid_)
118+
- getGamemodeByUuid(_uuid_)
119+
- getGamemodeEquippableByUuid(_uuid_)
117120
- **[Gear](https://dash.valorant-api.com/endpoints/gear)**
118121
- getGear()
119-
- getGearbyUuid(_uuid_)
122+
- getGearByUuid(_uuid_)
120123
- **[Maps](https://dash.valorant-api.com/endpoints/maps)**
121124
- getMaps()
122-
- getMapbyUuid(_uuid_)
125+
- getMapByUuid(_uuid_)
123126
- **[Player Cards](https://dash.valorant-api.com/endpoints/playercards)**
124127
- getPlayerCards()
125-
- getPlayerCardbyUuid(_uuid_)
128+
- getPlayerCardByUuid(_uuid_)
126129
- **[Player Titles](https://dash.valorant-api.com/endpoints/playertitles)**
127130
- getPlayerTitles()
128-
- getPlayerTitlebyUuid(_uuid_)
131+
- getPlayerTitleByUuid(_uuid_)
129132
- **[Seasons](https://dash.valorant-api.com/endpoints/seasons)**
130133
- getSeasons()
131134
- getCompetitiveSeasons()
132-
- getSeasonbyUuid(_uuid_)
133-
- getCompetitiveSeasonbyUuid(_uuid_)
135+
- getSeasonByUuid(_uuid_)
136+
- getCompetitiveSeasonByUuid(_uuid_)
134137
- **[Sprays](https://dash.valorant-api.com/endpoints/sprays)**
135138
- getSprays()
136-
- getSpraybyUuid(_uuid_)
139+
- getSprayByUuid(_uuid_)
137140
- **[Themes](https://dash.valorant-api.com/endpoints/themes)**
138141
- getThemes()
139-
- getThemebyUuid(_uuid_)
142+
- getThemeByUuid(_uuid_)
140143
- **[Weapons](https://dash.valorant-api.com/endpoints/weapons)**
141144
- getWeapons()
142145
- getWeaponSkins()
143146
- getWeaponSkinChromas()
144147
- get WeaponSkinLevels()
145-
- getWeaponbyUuid(_uuid_)
146-
- getWeaponSkinbyUuid(_uuid_)
147-
- getWeaponSkinChromabyUuid(_uuid_)
148-
- getWeaponSkinLevelbyUuid(_uuid_)
148+
- getWeaponByUuid(_uuid_)
149+
- getWeaponSkinByUuid(_uuid_)
150+
- getWeaponSkinChromaByUuid(_uuid_)
151+
- getWeaponSkinLevelByUuid(_uuid_)
149152

150153
_If you have any Issue or Suggestion please open an Issue on the [Github Repository](https://github.com/liamcottle/valorant.js) or join the [Discord Server](https://discord.gg/HUFEkChRpP)_

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ module.exports = {
44
Regions: require("./src/regions"),
55
Tiers: require("./src/tiers"),
66
LocalRiotClientAPI: require("./src/LocalRiotClientAPI"),
7-
Content: require("./src/contentApi"),
7+
ContentAPI: require("./src/ContentAPI"),
88
Languages: require("./src/languages"),
99
};

0 commit comments

Comments
 (0)