guildwars2-ts 1.1.6 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -125,8 +125,7 @@ var ApiBase = class {
125
125
  const headers = new AxiosHeaders();
126
126
  headers["Accept-Language"] = this._language;
127
127
  if (tokenRequired) {
128
- if (!this._apiToken)
129
- throw new ApiTokenError();
128
+ if (!this._apiToken) throw new ApiTokenError();
130
129
  headers.Authorization = `Bearer ${this._apiToken}`;
131
130
  }
132
131
  const options = {
@@ -221,8 +220,7 @@ var ApiBase = class {
221
220
  let match;
222
221
  while (match = regex.exec(fullUrl)) {
223
222
  const [key, param] = match;
224
- if (!param)
225
- continue;
223
+ if (!param) continue;
226
224
  const value = encodeURI(String(urlParams[param]));
227
225
  fullUrl = fullUrl.replace(key, value);
228
226
  regex.lastIndex = 0;
@@ -433,6 +431,19 @@ var AccountHomeCatsDTO = z.array(
433
431
  /** Ids of cat unlocked in home instance. */
434
432
  z.number()
435
433
  );
434
+ var AccountHomesteadDecorationsDTO = z.array(
435
+ z.object({
436
+ /** Deocration id. */
437
+ id: z.number(),
438
+ /** Decoration count. */
439
+ count: z.number()
440
+ })
441
+ );
442
+ var stringArrayType = z.array(z.string());
443
+ var numberArrayType = z.array(z.number());
444
+
445
+ // src/models/account/account.homestead.glyphs.dto.ts
446
+ var AccountHomesteadGlyphsDTO = stringArrayType;
436
447
  var AccountInventoryDTO = z.array(
437
448
  z.union([
438
449
  z.null(),
@@ -1832,6 +1843,42 @@ var HomeCatsDTO = z.array(
1832
1843
  hint: z.string().optional()
1833
1844
  })
1834
1845
  );
1846
+ var HomesteadDecorationsDTO = z.array(
1847
+ z.object({
1848
+ /** The decoration id. */
1849
+ id: z.number(),
1850
+ /* The name of the decoration. */
1851
+ name: z.string(),
1852
+ /** The homestead decoration description. */
1853
+ description: z.string(),
1854
+ /** The maximum amount of storable instances of this decoration. */
1855
+ max_count: z.number(),
1856
+ /** A URL pointing to an icon for the decoration. */
1857
+ icon: z.string(),
1858
+ /** An array of decoration category ids which this decoration belongs to.
1859
+ * Can be compared to the v2/homestead/decorations/categories endpoint */
1860
+ categories: z.array(z.number())
1861
+ })
1862
+ );
1863
+ var HomesteadDecorationsCategoriesDTO = z.array(
1864
+ z.object({
1865
+ /** The category's ID. */
1866
+ id: z.number(),
1867
+ /** The category name. */
1868
+ name: z.string()
1869
+ })
1870
+ );
1871
+ var HomesteadGlyphsDTO = z.array(
1872
+ z.object({
1873
+ /** The homestead glyph id. */
1874
+ id: z.string(),
1875
+ /** The id of the glyph item.
1876
+ * Can be compared to the /v2/items endpoint. */
1877
+ item_id: z.number(),
1878
+ /** The slot it is attached to. */
1879
+ slot: z.enum(["harvesting", "mining", "logging"])
1880
+ })
1881
+ );
1835
1882
  var BuildDTO = z.object({
1836
1883
  /** The id of the current game build. */
1837
1884
  id: z.number()
@@ -2209,6 +2256,7 @@ var TrinketDetails = z.object({
2209
2256
  /** Selectable stat ids. Can be resolved by /v2/itemstats */
2210
2257
  stat_choices: z.array(z.number()).optional()
2211
2258
  });
2259
+ var TrophyAndCraftingDetails = z.undefined();
2212
2260
  var UpgradeComponentFlags = z.enum([
2213
2261
  "Axe",
2214
2262
  "Dagger",
@@ -2344,6 +2392,7 @@ var ItemsDTO = z.array(
2344
2392
  MiniatureDetails,
2345
2393
  SalvageKitDetails,
2346
2394
  TrinketDetails,
2395
+ TrophyAndCraftingDetails,
2347
2396
  UpgradeComponentDetails,
2348
2397
  WeaponDetails
2349
2398
  ])
@@ -4071,6 +4120,14 @@ var endpoints = {
4071
4120
  path: "v2/account/home/nodes",
4072
4121
  tokenRequired: true
4073
4122
  },
4123
+ homesteadDecorations: {
4124
+ path: "v2/account/homestead/decorations",
4125
+ tokenRequired: true
4126
+ },
4127
+ homesteadGlyphs: {
4128
+ path: "v2/account/homestead/glyphs",
4129
+ tokenRequired: true
4130
+ },
4074
4131
  inventory: {
4075
4132
  path: "v2/account/inventory",
4076
4133
  tokenRequired: true
@@ -4486,6 +4543,32 @@ var endpoints = {
4486
4543
  tokenRequired: false
4487
4544
  }
4488
4545
  },
4546
+ homestead: {
4547
+ decorationsById: {
4548
+ path: "v2/homestead/decorations?ids=$(ids)",
4549
+ tokenRequired: false
4550
+ },
4551
+ decorationsAll: {
4552
+ path: "v2/homestead/decorations",
4553
+ tokenRequired: false
4554
+ },
4555
+ decorationsCategoriesById: {
4556
+ path: "v2/homestead/decorations/categories?ids=$(ids)",
4557
+ tokenRequired: false
4558
+ },
4559
+ decorationsCategoriesAll: {
4560
+ path: "v2/homestead/decorations/categories",
4561
+ tokenRequired: false
4562
+ },
4563
+ glyphsById: {
4564
+ path: "v2/homestead/glyphs?ids=$(ids)",
4565
+ tokenRequired: false
4566
+ },
4567
+ glyphsAll: {
4568
+ path: "v2/homestead/glyphs",
4569
+ tokenRequired: false
4570
+ }
4571
+ },
4489
4572
  items: {
4490
4573
  all: {
4491
4574
  path: "v2/items",
@@ -5022,6 +5105,26 @@ var AccountApi = class extends ApiBase {
5022
5105
  async getHomeCats() {
5023
5106
  return await this.buildRequest(endpoints.account.homeCats, {}, AccountHomeCatsDTO);
5024
5107
  }
5108
+ /**
5109
+ * Returns information about unlocked homestead decorations.
5110
+ */
5111
+ async getHomesteadDecorations() {
5112
+ return await this.buildRequest(
5113
+ endpoints.account.homesteadDecorations,
5114
+ {},
5115
+ AccountHomesteadDecorationsDTO
5116
+ );
5117
+ }
5118
+ /**
5119
+ * Returns information about glyphs stored in homestead collection boxes.
5120
+ */
5121
+ async getHomesteadGlyphs() {
5122
+ return await this.buildRequest(
5123
+ endpoints.account.homesteadGlyphs,
5124
+ {},
5125
+ AccountHomesteadGlyphsDTO
5126
+ );
5127
+ }
5025
5128
  /**
5026
5129
  * Returns the shared inventory slots in an account.
5027
5130
  * If null, the slot is empty
@@ -5256,8 +5359,6 @@ var AccountApi = class extends ApiBase {
5256
5359
  );
5257
5360
  }
5258
5361
  };
5259
- var stringArrayType = z.array(z.string());
5260
- var numberArrayType = z.array(z.number());
5261
5362
 
5262
5363
  // src/apis/achievements/achievements.ts
5263
5364
  var AchievementsApi = class extends ApiBase {
@@ -5310,8 +5411,8 @@ var CharactersApi = class extends ApiBase {
5310
5411
  async getBuildTabs(id, tabs = "all") {
5311
5412
  if (Array.isArray(tabs)) {
5312
5413
  for (const tab of tabs) {
5313
- if (tab < 1 || tab > 8) {
5314
- logger.warn("Build tab ids must be between 1 and 8. Returning all tabs");
5414
+ if (tab < 1 || tab > 9) {
5415
+ logger.warn("Build tab ids must be between 1 and 9. Returning all tabs");
5315
5416
  tabs = "all";
5316
5417
  }
5317
5418
  }
@@ -5366,8 +5467,8 @@ var CharactersApi = class extends ApiBase {
5366
5467
  async getEquipmentTabs(id, tabs = "all") {
5367
5468
  if (Array.isArray(tabs)) {
5368
5469
  for (const tab of tabs) {
5369
- if (tab < 1 || tab > 8) {
5370
- logger.warn("Equipment tab ids must be between 1 and 8. Returning all tabs.");
5470
+ if (tab < 1 || tab > 9) {
5471
+ logger.warn("Equipment tab ids must be between 1 and 9. Returning all tabs.");
5371
5472
  tabs = "all";
5372
5473
  }
5373
5474
  }
@@ -5727,6 +5828,44 @@ var HomeApi = class extends ApiBase {
5727
5828
  }
5728
5829
  };
5729
5830
 
5831
+ // src/apis/homestead/homestead.ts
5832
+ var HomesteadApi = class extends ApiBase {
5833
+ async getDecorations(ids) {
5834
+ if (ids) {
5835
+ return await this.buildRequest(
5836
+ endpoints.homestead.decorationsById,
5837
+ { ids },
5838
+ HomesteadDecorationsDTO
5839
+ );
5840
+ }
5841
+ return await this.buildRequest(endpoints.homestead.decorationsAll, {}, numberArrayType);
5842
+ }
5843
+ async getCategories(ids) {
5844
+ if (ids) {
5845
+ return await this.buildRequest(
5846
+ endpoints.homestead.decorationsCategoriesById,
5847
+ { ids },
5848
+ HomesteadDecorationsCategoriesDTO
5849
+ );
5850
+ }
5851
+ return await this.buildRequest(
5852
+ endpoints.homestead.decorationsCategoriesAll,
5853
+ {},
5854
+ numberArrayType
5855
+ );
5856
+ }
5857
+ async getGlyphs(ids) {
5858
+ if (ids) {
5859
+ return await this.buildRequest(
5860
+ endpoints.homestead.glyphsById,
5861
+ { ids },
5862
+ HomesteadGlyphsDTO
5863
+ );
5864
+ }
5865
+ return await this.buildRequest(endpoints.homestead.glyphsAll, {}, stringArrayType);
5866
+ }
5867
+ };
5868
+
5730
5869
  // src/apis/misc/backstory.ts
5731
5870
  var BackstoryApi = class extends ApiBase {
5732
5871
  async getAnswers(ids) {
@@ -5763,8 +5902,7 @@ var BuildApi = class extends ApiBase {
5763
5902
  // src/apis/misc/colors.ts
5764
5903
  var ColorsApi = class extends ApiBase {
5765
5904
  async get(ids) {
5766
- if (ids)
5767
- return await this.buildRequest(endpoints.colors.byId, { ids }, ColorsDTO);
5905
+ if (ids) return await this.buildRequest(endpoints.colors.byId, { ids }, ColorsDTO);
5768
5906
  return await this.buildRequest(endpoints.colors.all, {}, numberArrayType);
5769
5907
  }
5770
5908
  };
@@ -5843,8 +5981,7 @@ var DailyCraftingApi = class extends ApiBase {
5843
5981
  // src/apis/misc/dungeons.ts
5844
5982
  var DungeonsApi = class extends ApiBase {
5845
5983
  async get(ids) {
5846
- if (ids)
5847
- return await this.buildRequest(endpoints.dungeons.byId, { ids }, DungeonsDTO);
5984
+ if (ids) return await this.buildRequest(endpoints.dungeons.byId, { ids }, DungeonsDTO);
5848
5985
  return await this.buildRequest(endpoints.dungeons.all, {}, stringArrayType);
5849
5986
  }
5850
5987
  };
@@ -5867,8 +6004,7 @@ var EmotesApi = class extends ApiBase {
5867
6004
  // src/apis/misc/files.ts
5868
6005
  var FilesApi = class extends ApiBase {
5869
6006
  async get(ids) {
5870
- if (ids)
5871
- return await this.buildRequest(endpoints.files.byId, { ids }, FilesDTO);
6007
+ if (ids) return await this.buildRequest(endpoints.files.byId, { ids }, FilesDTO);
5872
6008
  return await this.buildRequest(endpoints.files.all, {}, stringArrayType);
5873
6009
  }
5874
6010
  };
@@ -5876,8 +6012,7 @@ var FilesApi = class extends ApiBase {
5876
6012
  // src/apis/misc/finishers.ts
5877
6013
  var FinishersApi = class extends ApiBase {
5878
6014
  async get(ids) {
5879
- if (ids)
5880
- return await this.buildRequest(endpoints.finishers.byId, { ids }, FinishersDTO);
6015
+ if (ids) return await this.buildRequest(endpoints.finishers.byId, { ids }, FinishersDTO);
5881
6016
  return await this.buildRequest(endpoints.finishers.all, {}, numberArrayType);
5882
6017
  }
5883
6018
  };
@@ -5885,8 +6020,7 @@ var FinishersApi = class extends ApiBase {
5885
6020
  // src/apis/misc/gliders.ts
5886
6021
  var GlidersApi = class extends ApiBase {
5887
6022
  async get(ids) {
5888
- if (ids)
5889
- return await this.buildRequest(endpoints.gliders.byId, { ids }, GlidersDTO);
6023
+ if (ids) return await this.buildRequest(endpoints.gliders.byId, { ids }, GlidersDTO);
5890
6024
  return await this.buildRequest(endpoints.gliders.all, {}, numberArrayType);
5891
6025
  }
5892
6026
  };
@@ -5894,8 +6028,7 @@ var GlidersApi = class extends ApiBase {
5894
6028
  // src/apis/misc/items.ts
5895
6029
  var ItemsApi = class extends ApiBase {
5896
6030
  async get(ids) {
5897
- if (ids)
5898
- return await this.buildRequest(endpoints.items.byId, { ids }, ItemsDTO);
6031
+ if (ids) return await this.buildRequest(endpoints.items.byId, { ids }, ItemsDTO);
5899
6032
  return await this.buildRequest(endpoints.items.all, {}, numberArrayType);
5900
6033
  }
5901
6034
  };
@@ -5903,8 +6036,7 @@ var ItemsApi = class extends ApiBase {
5903
6036
  // src/apis/misc/itemstats.ts
5904
6037
  var ItemStatsApi = class extends ApiBase {
5905
6038
  async get(ids) {
5906
- if (ids)
5907
- return await this.buildRequest(endpoints.itemstats.byId, { ids }, ItemStatsDTO);
6039
+ if (ids) return await this.buildRequest(endpoints.itemstats.byId, { ids }, ItemStatsDTO);
5908
6040
  return await this.buildRequest(endpoints.itemstats.all, {}, numberArrayType);
5909
6041
  }
5910
6042
  };
@@ -5912,8 +6044,7 @@ var ItemStatsApi = class extends ApiBase {
5912
6044
  // src/apis/misc/jadebots.ts
5913
6045
  var JadebotsApi = class extends ApiBase {
5914
6046
  async get(ids) {
5915
- if (ids)
5916
- return await this.buildRequest(endpoints.jadebots.byId, { ids }, JadebotsDTO);
6047
+ if (ids) return await this.buildRequest(endpoints.jadebots.byId, { ids }, JadebotsDTO);
5917
6048
  return await this.buildRequest(endpoints.jadebots.all, {}, numberArrayType);
5918
6049
  }
5919
6050
  };
@@ -5934,8 +6065,7 @@ var LegendaryArmoryApi = class extends ApiBase {
5934
6065
  // src/apis/misc/legends.ts
5935
6066
  var LegendsApi = class extends ApiBase {
5936
6067
  async get(ids) {
5937
- if (ids)
5938
- return await this.buildRequest(endpoints.legends.byId, { ids }, LegendsDTO);
6068
+ if (ids) return await this.buildRequest(endpoints.legends.byId, { ids }, LegendsDTO);
5939
6069
  return await this.buildRequest(endpoints.legends.all, {}, stringArrayType);
5940
6070
  }
5941
6071
  };
@@ -5967,8 +6097,7 @@ var MapChestsApi = class extends ApiBase {
5967
6097
  // src/apis/misc/maps.ts
5968
6098
  var MapsApi = class extends ApiBase {
5969
6099
  async get(ids) {
5970
- if (ids)
5971
- return await this.buildRequest(endpoints.maps.byId, { ids }, MapsDTO);
6100
+ if (ids) return await this.buildRequest(endpoints.maps.byId, { ids }, MapsDTO);
5972
6101
  return await this.buildRequest(endpoints.maps.all, {}, numberArrayType);
5973
6102
  }
5974
6103
  };
@@ -5976,8 +6105,7 @@ var MapsApi = class extends ApiBase {
5976
6105
  // src/apis/misc/masteries.ts
5977
6106
  var MasteriesApi = class extends ApiBase {
5978
6107
  async get(ids) {
5979
- if (ids)
5980
- return await this.buildRequest(endpoints.masteries.byId, { ids }, MasteriesDTO);
6108
+ if (ids) return await this.buildRequest(endpoints.masteries.byId, { ids }, MasteriesDTO);
5981
6109
  return await this.buildRequest(endpoints.masteries.all, {}, numberArrayType);
5982
6110
  }
5983
6111
  };
@@ -5985,8 +6113,7 @@ var MasteriesApi = class extends ApiBase {
5985
6113
  // src/apis/misc/materials.ts
5986
6114
  var MaterialsApi = class extends ApiBase {
5987
6115
  async get(ids) {
5988
- if (ids)
5989
- return await this.buildRequest(endpoints.materials.byId, { ids }, MaterialsDTO);
6116
+ if (ids) return await this.buildRequest(endpoints.materials.byId, { ids }, MaterialsDTO);
5990
6117
  return await this.buildRequest(endpoints.materials.all, {}, numberArrayType);
5991
6118
  }
5992
6119
  };
@@ -5994,8 +6121,7 @@ var MaterialsApi = class extends ApiBase {
5994
6121
  // src/apis/misc/minis.ts
5995
6122
  var MinisApi = class extends ApiBase {
5996
6123
  async get(ids) {
5997
- if (ids)
5998
- return await this.buildRequest(endpoints.minis.byId, { ids }, MinisDTO);
6124
+ if (ids) return await this.buildRequest(endpoints.minis.byId, { ids }, MinisDTO);
5999
6125
  return await this.buildRequest(endpoints.minis.all, {}, numberArrayType);
6000
6126
  }
6001
6127
  };
@@ -6017,8 +6143,7 @@ var MountsApi = class extends ApiBase {
6017
6143
  // src/apis/misc/novelties.ts
6018
6144
  var NoveltiesApi = class extends ApiBase {
6019
6145
  async get(ids) {
6020
- if (ids)
6021
- return await this.buildRequest(endpoints.novelties.byId, { ids }, NoveltiesDTO);
6146
+ if (ids) return await this.buildRequest(endpoints.novelties.byId, { ids }, NoveltiesDTO);
6022
6147
  return await this.buildRequest(endpoints.novelties.all, {}, numberArrayType);
6023
6148
  }
6024
6149
  };
@@ -6026,8 +6151,7 @@ var NoveltiesApi = class extends ApiBase {
6026
6151
  // src/apis/misc/outfits.ts
6027
6152
  var OutfitsApi = class extends ApiBase {
6028
6153
  async get(ids) {
6029
- if (ids)
6030
- return await this.buildRequest(endpoints.outfits.byId, { ids }, OutfitsDTO);
6154
+ if (ids) return await this.buildRequest(endpoints.outfits.byId, { ids }, OutfitsDTO);
6031
6155
  return await this.buildRequest(endpoints.outfits.all, {}, numberArrayType);
6032
6156
  }
6033
6157
  };
@@ -6035,8 +6159,7 @@ var OutfitsApi = class extends ApiBase {
6035
6159
  // src/apis/misc/pets.ts
6036
6160
  var PetsApi = class extends ApiBase {
6037
6161
  async get(ids) {
6038
- if (ids)
6039
- return await this.buildRequest(endpoints.pets.byId, { ids }, PetsDTO);
6162
+ if (ids) return await this.buildRequest(endpoints.pets.byId, { ids }, PetsDTO);
6040
6163
  return await this.buildRequest(endpoints.pets.all, {}, numberArrayType);
6041
6164
  }
6042
6165
  };
@@ -6053,8 +6176,7 @@ var ProfessionsApi = class extends ApiBase {
6053
6176
  // src/apis/misc/quaggans.ts
6054
6177
  var QuaggansApi = class extends ApiBase {
6055
6178
  async get(ids) {
6056
- if (ids)
6057
- return await this.buildRequest(endpoints.quaggans.byId, { ids }, QuaggansDTO);
6179
+ if (ids) return await this.buildRequest(endpoints.quaggans.byId, { ids }, QuaggansDTO);
6058
6180
  return await this.buildRequest(endpoints.quaggans.all, {}, stringArrayType);
6059
6181
  }
6060
6182
  };
@@ -6062,8 +6184,7 @@ var QuaggansApi = class extends ApiBase {
6062
6184
  // src/apis/misc/quests.ts
6063
6185
  var QuestsApi = class extends ApiBase {
6064
6186
  async get(ids) {
6065
- if (ids)
6066
- return await this.buildRequest(endpoints.quests.byId, { ids }, QuestsDTO);
6187
+ if (ids) return await this.buildRequest(endpoints.quests.byId, { ids }, QuestsDTO);
6067
6188
  return await this.buildRequest(endpoints.quests.all, {}, numberArrayType);
6068
6189
  }
6069
6190
  };
@@ -6071,8 +6192,7 @@ var QuestsApi = class extends ApiBase {
6071
6192
  // src/apis/misc/races.ts
6072
6193
  var RacesApi = class extends ApiBase {
6073
6194
  async get(ids) {
6074
- if (ids)
6075
- return await this.buildRequest(endpoints.races.byId, { ids }, RacesDTO);
6195
+ if (ids) return await this.buildRequest(endpoints.races.byId, { ids }, RacesDTO);
6076
6196
  return await this.buildRequest(endpoints.races.all, {}, stringArrayType);
6077
6197
  }
6078
6198
  };
@@ -6080,8 +6200,7 @@ var RacesApi = class extends ApiBase {
6080
6200
  // src/apis/misc/raids.ts
6081
6201
  var RaidsApi = class extends ApiBase {
6082
6202
  async get(ids) {
6083
- if (ids)
6084
- return await this.buildRequest(endpoints.raids.byId, { ids }, RaidsDTO);
6203
+ if (ids) return await this.buildRequest(endpoints.raids.byId, { ids }, RaidsDTO);
6085
6204
  return await this.buildRequest(endpoints.raids.all, {}, stringArrayType);
6086
6205
  }
6087
6206
  };
@@ -6089,8 +6208,7 @@ var RaidsApi = class extends ApiBase {
6089
6208
  // src/apis/misc/recipes.ts
6090
6209
  var RecipesApi = class extends ApiBase {
6091
6210
  async get(ids) {
6092
- if (ids)
6093
- return await this.buildRequest(endpoints.recipes.byId, { ids }, RecipesDTO);
6211
+ if (ids) return await this.buildRequest(endpoints.recipes.byId, { ids }, RecipesDTO);
6094
6212
  return await this.buildRequest(endpoints.recipes.all, {}, numberArrayType);
6095
6213
  }
6096
6214
  /**
@@ -6111,8 +6229,7 @@ var RecipesApi = class extends ApiBase {
6111
6229
  // src/apis/misc/skiffs.ts
6112
6230
  var SkiffsApi = class extends ApiBase {
6113
6231
  async get(ids) {
6114
- if (ids)
6115
- return await this.buildRequest(endpoints.skiffs.byId, { ids }, SkiffsDTO);
6232
+ if (ids) return await this.buildRequest(endpoints.skiffs.byId, { ids }, SkiffsDTO);
6116
6233
  return await this.buildRequest(endpoints.skiffs.all, {}, numberArrayType);
6117
6234
  }
6118
6235
  };
@@ -6132,8 +6249,7 @@ var SkillsApi = class extends ApiBase {
6132
6249
  // src/apis/misc/skins.ts
6133
6250
  var SkinsApi = class extends ApiBase {
6134
6251
  async get(ids) {
6135
- if (ids)
6136
- return await this.buildRequest(endpoints.skins.byId, { ids }, SkinsDTO);
6252
+ if (ids) return await this.buildRequest(endpoints.skins.byId, { ids }, SkinsDTO);
6137
6253
  return await this.buildRequest(endpoints.skins.all, {}, numberArrayType);
6138
6254
  }
6139
6255
  };
@@ -6154,8 +6270,7 @@ var storiesCore = z.array(z.number());
6154
6270
  var seasonsCore = z.array(z.string());
6155
6271
  var StoriesApi = class extends ApiBase {
6156
6272
  async getStories(ids) {
6157
- if (ids)
6158
- return await this.buildRequest(endpoints.stories.byId, { ids }, StoriesDTO);
6273
+ if (ids) return await this.buildRequest(endpoints.stories.byId, { ids }, StoriesDTO);
6159
6274
  return await this.buildRequest(endpoints.stories.all, {}, storiesCore);
6160
6275
  }
6161
6276
  async getSeasons(ids) {
@@ -6212,8 +6327,7 @@ var SubtokenApi = class extends ApiBase {
6212
6327
  // src/apis/misc/titles.ts
6213
6328
  var TitlesApi = class extends ApiBase {
6214
6329
  async get(ids) {
6215
- if (ids)
6216
- return await this.buildRequest(endpoints.titles.byId, { ids }, TitlesDTO);
6330
+ if (ids) return await this.buildRequest(endpoints.titles.byId, { ids }, TitlesDTO);
6217
6331
  return await this.buildRequest(endpoints.titles.all, {}, numberArrayType);
6218
6332
  }
6219
6333
  };
@@ -6231,8 +6345,7 @@ var TokenInfoApi = class extends ApiBase {
6231
6345
  // src/apis/misc/traits.ts
6232
6346
  var TraitsApi = class extends ApiBase {
6233
6347
  async get(ids) {
6234
- if (ids)
6235
- return await this.buildRequest(endpoints.traits.byId, { ids }, TraitsDTO);
6348
+ if (ids) return await this.buildRequest(endpoints.traits.byId, { ids }, TraitsDTO);
6236
6349
  return await this.buildRequest(endpoints.traits.all, {}, numberArrayType);
6237
6350
  }
6238
6351
  };
@@ -6250,8 +6363,7 @@ var WorldBossesApi = class extends ApiBase {
6250
6363
  // src/apis/misc/worlds.ts
6251
6364
  var WorldsApi = class extends ApiBase {
6252
6365
  async get(ids) {
6253
- if (ids)
6254
- return await this.buildRequest(endpoints.worlds.byId, { ids }, WorldsDTO);
6366
+ if (ids) return await this.buildRequest(endpoints.worlds.byId, { ids }, WorldsDTO);
6255
6367
  return await this.buildRequest(endpoints.worlds.all, {}, numberArrayType);
6256
6368
  }
6257
6369
  };
@@ -6264,23 +6376,19 @@ var PvPApi = class extends ApiBase {
6264
6376
  return await this.buildRequest(endpoints.pvp.amuletsAll, {}, numberArrayType);
6265
6377
  }
6266
6378
  async getGames(ids) {
6267
- if (ids)
6268
- return await this.buildRequest(endpoints.pvp.gamesById, { ids }, PvPGamesDTO);
6379
+ if (ids) return await this.buildRequest(endpoints.pvp.gamesById, { ids }, PvPGamesDTO);
6269
6380
  return await this.buildRequest(endpoints.pvp.gamesAll, {}, stringArrayType);
6270
6381
  }
6271
6382
  async getHeroes(ids) {
6272
- if (ids)
6273
- return await this.buildRequest(endpoints.pvp.heroesById, { ids }, PvPHeroesDTO);
6383
+ if (ids) return await this.buildRequest(endpoints.pvp.heroesById, { ids }, PvPHeroesDTO);
6274
6384
  return await this.buildRequest(endpoints.pvp.heroesAll, {}, stringArrayType);
6275
6385
  }
6276
6386
  async getRanks(ids) {
6277
- if (ids)
6278
- return await this.buildRequest(endpoints.pvp.ranksById, { ids }, PvPRanksDTO);
6387
+ if (ids) return await this.buildRequest(endpoints.pvp.ranksById, { ids }, PvPRanksDTO);
6279
6388
  return await this.buildRequest(endpoints.pvp.ranksAll, {}, numberArrayType);
6280
6389
  }
6281
6390
  async getSeasons(ids) {
6282
- if (ids)
6283
- return await this.buildRequest(endpoints.pvp.seasonsById, { ids }, PvPSeasonDTO);
6391
+ if (ids) return await this.buildRequest(endpoints.pvp.seasonsById, { ids }, PvPSeasonDTO);
6284
6392
  return await this.buildRequest(endpoints.pvp.seasonsAll, {}, stringArrayType);
6285
6393
  }
6286
6394
  async getLeaderboards(id, region, type) {
@@ -6406,8 +6514,7 @@ var WorldVsWorldApi = class extends ApiBase {
6406
6514
  return await this.buildRequest(endpoints.wvw.objectives, {}, stringArrayType);
6407
6515
  }
6408
6516
  async getRanks(ids) {
6409
- if (ids)
6410
- return await this.buildRequest(endpoints.wvw.ranksById, { ids }, WvWRanksDTO);
6517
+ if (ids) return await this.buildRequest(endpoints.wvw.ranksById, { ids }, WvWRanksDTO);
6411
6518
  return await this.buildRequest(endpoints.wvw.ranks, {}, numberArrayType);
6412
6519
  }
6413
6520
  async getUpgrades(ids) {
@@ -6455,6 +6562,8 @@ var GW2Api = class extends ApiBase {
6455
6562
  guild = new GuildApi(this.getParams());
6456
6563
  /** /v2/home Api */
6457
6564
  home = new HomeApi(this.getParams());
6565
+ /** /v2/homestead Api */
6566
+ homestead = new HomesteadApi(this.getParams());
6458
6567
  /** /v2/items Api */
6459
6568
  items = new ItemsApi(this.getParams());
6460
6569
  /** /v2/itemstats Api */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "guildwars2-ts",
3
- "version": "1.1.6",
3
+ "version": "1.2.2",
4
4
  "description": "GuildWars 2 API Wrapper in Typescript",
5
5
  "homepage": "https://gitlab.com/dinckelman/guildwars2-ts",
6
6
  "main": "dist/index.js",
@@ -22,10 +22,10 @@
22
22
  "gw2"
23
23
  ],
24
24
  "dependencies": {
25
- "axios": "1.6.8",
25
+ "axios": "1.7.8",
26
26
  "promise-queue": "2.2.5",
27
- "tslog": "4.9.2",
28
- "zod": "3.22.4"
27
+ "tslog": "4.9.3",
28
+ "zod": "3.23.8"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@biomejs/biome": "^1.6.3",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "scripts": {
42
42
  "lint:dry": "biome check .",
43
- "lint": "biome check . --apply",
43
+ "lint": "biome check . --write",
44
44
  "build": "tsup --env.NODE_ENV production",
45
45
  "test": "jest",
46
46
  "test:coverage": "jest --coverage"