Skip to content

Commit

Permalink
Merge pull request #72 from GW2Treasures/feature/homestead
Browse files Browse the repository at this point in the history
Add types for `/v2/homestead/decorations` and `/v2/account/homestead/decorations`
  • Loading branch information
darthmaim authored Aug 10, 2024
2 parents b19d5d5 + 8152046 commit eee9e23
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/selfish-timers-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@gw2api/types": patch
---

Add types for `/v2/homestead/decorations` and `/v2/account/homestead/decorations`
13 changes: 13 additions & 0 deletions packages/types/data/account-homestead.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Accounts homestead decorations (/v2/account/homestead/decorations).
* Required scopes: account, wallet
*
* @see https://wiki.guildwars2.com/wiki/API:2/account/homestead/decorations
*/
export interface AccountHomesteadDecoration {
/** The homestead decoration id */
id: number,

/** The amount of this decoration owned */
count: number,
}
21 changes: 21 additions & 0 deletions packages/types/data/homestead.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Homestead decorations (/v2/homestead/decorations).
*
* @see https://wiki.guildwars2.com/wiki/API:2/homestead/decorations
*/
export interface HomesteadDecoration {
/** The decoration id */
id: number,

/** The name of the decoration */
name: string,

/** The description of the decoration */
description: string,

/** The icon of the decoration */
icon: string

/** The maximum amount that can be stored */
max_count: number,
}
1 change: 0 additions & 1 deletion packages/types/data/legendaryarmory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* Accounts legendary armory.
* Required scopes: account, unlocks, inventories
*
* @see https://wiki.guildwars2.com/wiki/API:2/legendaryarmory
*/
Expand Down
8 changes: 8 additions & 0 deletions packages/types/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Account } from './data/account';
import type { AccountAchievement } from './data/account-achievements';
import type { AccountBank } from './data/account-bank';
import type { AccountHomesteadDecoration } from './data/account-homestead';
import type { AccountInventory } from './data/account-inventory';
import type { AccountLegendaryarmory } from './data/account-legendaryarmory';
import type { AccountMaterials } from './data/account-material';
Expand All @@ -15,6 +16,7 @@ import type { Listing, Price, TransactionCurrent, TransactionHistoric } from './
import type { Createsubtoken } from './data/createsubtoken';
import type { Currency } from './data/currency';
import type { GuildUpgrade } from './data/guild';
import type { HomesteadDecoration } from './data/homestead';
import type { Item } from './data/item';
import type { Legendaryarmory } from './data/legendaryarmory';
import type { MaterialCategory } from './data/material';
Expand All @@ -40,6 +42,7 @@ export type KnownAuthenticatedEndpoint =
| '/v2/account/gliders'
| '/v2/account/home/cats'
| '/v2/account/home/nodes'
| '/v2/account/homestead/decorations'
| '/v2/account/inventory'
| '/v2/account/jadebots'
| '/v2/account/legendaryarmory'
Expand Down Expand Up @@ -142,6 +145,7 @@ export type KnownUnauthorizedEndpoint =
| '/v2/home'
| '/v2/home/cats'
| '/v2/home/nodes'
| '/v2/homestead/decorations'
| '/v2/items'
| '/v2/itemstats'
| '/v2/jadebots'
Expand Down Expand Up @@ -221,6 +225,7 @@ export type KnownBulkExpandedEndpoint =
| '/v2/guild/upgrades'
| '/v2/home/cats'
| '/v2/home/nodes'
| '/v2/homestead/decorations'
| '/v2/items'
| '/v2/itemstats'
| '/v2/legendaryarmory'
Expand Down Expand Up @@ -271,6 +276,7 @@ export type KnownLocalizedEndpoint =
| '/v2/gliders'
| '/v2/guild/permissions'
| '/v2/guild/upgrades'
| '/v2/homestead/decorations'
| '/v2/items'
| '/v2/itemstats'
| '/v2/jadebots'
Expand Down Expand Up @@ -387,6 +393,7 @@ export type EndpointType<Url extends KnownEndpoint | (string & {}), Schema exten
Url extends '/v2/account/emotes' ? string[] :
Url extends '/v2/account/gliders' ? number[] :
Url extends '/v2/account/home/nodes' ? string[] :
Url extends '/v2/account/homestead/decorations' ? AccountHomesteadDecoration[] :
Url extends '/v2/account/inventory' ? AccountInventory :
Url extends '/v2/account/jadebots' ? number[] :
Url extends '/v2/account/legendaryarmory' ? AccountLegendaryarmory[] :
Expand Down Expand Up @@ -429,6 +436,7 @@ export type EndpointType<Url extends KnownEndpoint | (string & {}), Schema exten
Url extends BulkExpandedEndpointUrl<'/v2/colors', number> ? BulkExpandedResponseType<'/v2/colors', Url, number, Color> :
Url extends BulkExpandedEndpointUrl<'/v2/currencies', number> ? BulkExpandedResponseType<'/v2/currencies', Url, number, Currency> :
Url extends BulkExpandedEndpointUrl<'/v2/guild/upgrades', number> ? BulkExpandedResponseType<'/v2/guild/upgrades', Url, number, GuildUpgrade> :
Url extends BulkExpandedEndpointUrl<'/v2/homestead/decorations', number> ? BulkExpandedResponseType<'/v2/homestead/decorations', Url, number, HomesteadDecoration> :
Url extends BulkExpandedEndpointUrl<'/v2/items', number> ? BulkExpandedResponseType<'/v2/items', Url, number, Item<Schema>> :
Url extends BulkExpandedEndpointUrl<'/v2/legendaryarmory', number> ? BulkExpandedResponseType<'/v2/legendaryarmory', Url, number, Legendaryarmory> :
Url extends BulkExpandedEndpointUrl<'/v2/materials', number> ? BulkExpandedResponseType<'/v2/materials', Url, number, MaterialCategory> :
Expand Down

0 comments on commit eee9e23

Please # to comment.