Skip to content

Commit bb9513f

Browse files
authored
feat: add planet biomes and environmental effects (#16)
* chore(types): add type definitions for new models * feat: add dynamic request functions for new models * chore(release): bump package version to 1.2.0
1 parent 860f23e commit bb9513f

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,25 @@ class SDK {
148148
* Endpoint: `/api/assignments(/:id)`
149149
*/
150150
assignments = generateDynamicRequestFn<Assignment>("assignments");
151+
152+
/**
153+
* ### Biomes
154+
*
155+
* Describe the planets fauna and flora, each planet must have a distinct biome.
156+
*
157+
* Endpoint: `/api/biomes(/:id)`
158+
*/
159+
biomes = generateDynamicRequestFn<Assignment>("biomes");
160+
161+
/**
162+
* ### Environmental Effects
163+
*
164+
* Effects that influence the player, can also be physical events like meteor showers,
165+
* fire tornadoes etc.
166+
*
167+
* Endpoint: `/api/effects(/:id)`
168+
*/
169+
effects = generateDynamicRequestFn<Assignment>("effects");
151170
}
152171

153172
const HellHub = SDK.getInstance();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "MIT",
44
"private": false,
55
"description": "The official SDK for HellHub API. Filter and collect data with full type safety out of the box.",
6-
"version": "1.1.0",
6+
"version": "1.2.0",
77
"main": "dist/index.mjs",
88
"types": "dist/index.d.ts",
99
"keywords": [

types/api-entities.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export interface Planet extends RemoteEntity {
4444
ownerId: number;
4545
sector: Sector;
4646
sectorId: number;
47+
effects: Effect[];
48+
biome: Biome;
49+
biomeId: number;
4750
health: number;
4851
orders?: Order[];
4952
maxHealth: number;
@@ -169,6 +172,20 @@ export interface Assignment extends RemoteEntity {
169172
description: string;
170173
}
171174

175+
export interface Biome extends Entity {
176+
index: string;
177+
name: string;
178+
description: string;
179+
planets: Planet[];
180+
}
181+
182+
export interface Effect extends Entity {
183+
index: string;
184+
name: string;
185+
description: string;
186+
planets: Planet[];
187+
}
188+
172189
/**
173190
* Network request types
174191
*/

0 commit comments

Comments
 (0)