guildwars2-ts 1.0.4 → 1.1.1

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
@@ -107,8 +107,6 @@ var ApiBase = class {
107
107
  }
108
108
  /**
109
109
  * Parameters for the api response, at top level
110
- *
111
- * @returns Api parameters
112
110
  */
113
111
  getParams() {
114
112
  return {
@@ -156,49 +154,62 @@ var ApiBase = class {
156
154
  }
157
155
  return data;
158
156
  } catch (error) {
159
- return await this.retryRequest(endpoint, options, responseType, apiParams, error);
157
+ return await this.retryRequest(endpoint, options, responseType, apiParams, 0, error);
160
158
  }
161
159
  }
162
160
  /**
163
161
  * Retries failed requests
164
- * TODO: Fix logic. Rate-limits are almost impossible hit, but other generic requests will fail and loop forever
165
162
  *
166
163
  * @param endpoint - Endpoint to which a request was originally made
167
164
  * @param prevOptions - Axios request options
168
165
  * @param responseType - Originally requested schema
169
166
  * @param apiParams - Query string
167
+ * @param rateLimitAttempt - Current rate-limit retry counter
170
168
  * @param prevError - Error that caused a retry
171
- * @returns Successful request, or error
172
169
  */
173
- async retryRequest(endpoint, prevOptions, responseType, apiParams, prevError) {
174
- if (prevError instanceof AxiosError) {
175
- if (prevError.response) {
176
- const { status } = prevError.response;
177
- if (status === 401) {
170
+ async retryRequest(endpoint, prevOptions, responseType, apiParams, rateLimitAttempt = 0, prevError) {
171
+ if (prevError instanceof AxiosError && prevError.response) {
172
+ const { status } = prevError.response;
173
+ switch (true) {
174
+ case status === 401: {
178
175
  logger.warn(`Request to ${prevOptions.url} failed.`);
179
176
  throw new ApiTokenError();
180
177
  }
181
- if (status === 403) {
182
- const requiredScope = (
183
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/restrict-plus-operands
184
- prevError.response.data.text.slice(0, 1).toUpperCase() + prevError.response.data.text.slice(1)
185
- );
178
+ case status === 403: {
179
+ const requiredScope = prevError.response.data.text.slice(0, 1).toUpperCase() + prevError.response.data.text.slice(1);
186
180
  logger.warn(`Request to ${prevOptions.url} failed. ${requiredScope}.`);
187
181
  throw new ApiPermissionsError(requiredScope);
188
182
  }
189
- if (status === 404) {
183
+ case status === 404: {
190
184
  logger.warn(`Request to ${prevOptions.url} returned no data.`);
191
185
  throw new ApiNotFoundError();
192
186
  }
193
- if (status === 504) {
187
+ case (status === 429 && this._rateLimitRetry): {
188
+ logger.warn("Rate-limit has been reached. Request will be repeated soon.");
189
+ if (rateLimitAttempt < 3) {
190
+ setTimeout(async () => {
191
+ return await this.retryRequest(
192
+ endpoint,
193
+ prevOptions,
194
+ responseType,
195
+ apiParams,
196
+ rateLimitAttempt++,
197
+ prevError
198
+ );
199
+ }, 1e3);
200
+ break;
201
+ } else {
202
+ logger.error(`Rate-limit retries failed. Aborting request to ${prevOptions.url}`);
203
+ throw new ApiRetryFailedError();
204
+ }
205
+ }
206
+ case status === 504: {
194
207
  logger.warn(`Request to ${prevOptions.url} timed out.`);
195
208
  throw new ApiTimeoutError();
196
209
  }
210
+ default:
211
+ logger.warn(`Request to ${prevOptions.url} failed. ${prevError.message}`);
197
212
  }
198
- logger.warn(`Request to ${prevOptions.url} failed. ${prevError.message}`);
199
- } else if (this._rateLimitRetry) {
200
- logger.info(`Rate-limit retries failed. Aborting request to ${prevOptions.url}`);
201
- throw new ApiRetryFailedError();
202
213
  }
203
214
  throw new ApiGenericError();
204
215
  }
@@ -207,7 +218,6 @@ var ApiBase = class {
207
218
  *
208
219
  * @param endpoint - Api endpoint
209
220
  * @param urlParams - Parameters
210
- * @returns Finalized endpoint Url
211
221
  */
212
222
  _getApiUrl(endpoint, urlParams) {
213
223
  const { path } = endpoint;
@@ -225,875 +235,6 @@ var ApiBase = class {
225
235
  return fullUrl;
226
236
  }
227
237
  };
228
-
229
- // src/apis/endpoints.ts
230
- var endpoints = {
231
- account: {
232
- base: {
233
- path: "v2/account",
234
- tokenRequired: true
235
- },
236
- achievements: {
237
- path: "v2/account/achievements",
238
- tokenRequired: true
239
- },
240
- bank: {
241
- path: "v2/account/bank",
242
- tokenRequired: true
243
- },
244
- buildStorage: {
245
- path: "v2/account/buildstorage?ids=all",
246
- tokenRequired: true
247
- },
248
- dailyCrafting: {
249
- path: "v2/account/dailycrafting",
250
- tokenRequired: true
251
- },
252
- dungeons: {
253
- path: "v2/account/dungeons",
254
- tokenRequired: true
255
- },
256
- dyes: {
257
- path: "v2/account/dyes",
258
- tokenRequired: true
259
- },
260
- emotes: {
261
- path: "v2/account/emotes",
262
- tokenRequired: true
263
- },
264
- finishers: {
265
- path: "v2/account/finishers",
266
- tokenRequired: true
267
- },
268
- gliders: {
269
- path: "v2/account/gliders",
270
- tokenRequired: true
271
- },
272
- homeCats: {
273
- path: "v2/account/home/cats",
274
- tokenRequired: true
275
- },
276
- homeNodes: {
277
- path: "v2/account/home/nodes",
278
- tokenRequired: true
279
- },
280
- inventory: {
281
- path: "v2/account/inventory",
282
- tokenRequired: true
283
- },
284
- jadebots: {
285
- path: "v2/account/jadebots",
286
- tokenRequired: true
287
- },
288
- legendaryArmory: {
289
- path: "v2/account/legendaryarmory",
290
- tokenRequired: true
291
- },
292
- luck: {
293
- path: "v2/account/luck",
294
- tokenRequired: true
295
- },
296
- mailCarriers: {
297
- path: "v2/account/mailcarriers",
298
- tokenRequired: true
299
- },
300
- mapChests: {
301
- path: "v2/account/mapchests",
302
- tokenRequired: true
303
- },
304
- masteries: {
305
- path: "v2/account/masteries",
306
- tokenRequired: true
307
- },
308
- masteryPoints: {
309
- path: "v2/account/mastery/points",
310
- tokenRequired: true
311
- },
312
- materials: {
313
- path: "v2/account/materials",
314
- tokenRequired: true
315
- },
316
- minis: {
317
- path: "v2/account/minis",
318
- tokenRequired: true
319
- },
320
- mountsSkins: {
321
- path: "v2/account/mounts/skins",
322
- tokenRequired: true
323
- },
324
- mountsTypes: {
325
- path: "v2/account/mounts/types",
326
- tokenRequired: true
327
- },
328
- novelties: {
329
- path: "v2/account/novelties",
330
- tokenRequired: true
331
- },
332
- outfits: {
333
- path: "v2/account/outfits",
334
- tokenRequired: true
335
- },
336
- progression: {
337
- path: "v2/account/progression",
338
- tokenRequired: true
339
- },
340
- pvpHeroes: {
341
- path: "v2/account/pvp/heroes",
342
- tokenRequired: true
343
- },
344
- raids: {
345
- path: "v2/account/raids",
346
- tokenRequired: true
347
- },
348
- recipes: {
349
- path: "v2/account/recipes",
350
- tokenRequired: true
351
- },
352
- skiffs: {
353
- path: "v2/account/skiffs",
354
- tokenRequired: true
355
- },
356
- skins: {
357
- path: "v2/account/skins",
358
- tokenRequired: true
359
- },
360
- titles: {
361
- path: "v2/account/titles",
362
- tokenRequired: true
363
- },
364
- wallet: {
365
- path: "v2/account/wallet",
366
- tokenRequired: true
367
- },
368
- worldBosses: {
369
- path: "v2/account/worldbosses",
370
- tokenRequired: true
371
- }
372
- },
373
- achievements: {
374
- categoryIds: {
375
- path: "v2/achievements/categories",
376
- tokenRequired: false
377
- },
378
- categories: {
379
- path: "v2/achievements/categories?ids=$(ids)",
380
- tokenRequired: false
381
- },
382
- groupsAll: {
383
- path: "v2/achievements/groups",
384
- tokenRequired: false
385
- },
386
- groupsById: {
387
- path: "v2/achievements/groups/$(id)",
388
- tokenRequired: false
389
- }
390
- },
391
- backstory: {
392
- answersAll: {
393
- path: "v2/backstory/answers",
394
- tokenRequired: false
395
- },
396
- answersById: {
397
- path: "v2/backstory/answers?ids=$(ids)",
398
- tokenRequired: false
399
- },
400
- questionsAll: {
401
- path: "v2/backstory/questions",
402
- tokenRequired: false
403
- },
404
- questionsById: {
405
- path: "v2/backstory/questions?ids=$(ids)",
406
- tokenRequired: false
407
- }
408
- },
409
- build: {
410
- path: "v2/build",
411
- tokenRequired: false
412
- },
413
- characters: {
414
- base: {
415
- path: "v2/characters",
416
- tokenRequired: true
417
- },
418
- backstory: {
419
- path: "v2/characters/$(id)/backstory",
420
- tokenRequired: true
421
- },
422
- buildTabs: {
423
- path: "v2/characters/$(id)/buildtabs?tabs=$(tabs)",
424
- tokenRequired: true
425
- },
426
- core: {
427
- path: "v2/characters/$(id)/core",
428
- tokenRequired: true
429
- },
430
- crafting: {
431
- path: "v2/characters/$(id)/crafting",
432
- tokenRequired: true
433
- },
434
- equipment: {
435
- path: "v2/characters/$(id)/equipment",
436
- tokenRequired: true
437
- },
438
- equipmentTabsById: {
439
- path: "v2/characters/$(id)/equipmenttabs?tabs=$(tabs)",
440
- tokenRequired: true
441
- },
442
- equipmentTabActive: {
443
- path: "v2/characters/$(id)/equipmenttabs/active",
444
- tokenRequired: true
445
- },
446
- heroPoints: {
447
- path: "v2/characters/$(id)/heropoints",
448
- tokenRequired: true
449
- },
450
- inventory: {
451
- path: "v2/characters/$(id)/inventory",
452
- tokenRequired: true
453
- },
454
- quests: {
455
- path: "v2/characters/$(id)/quests",
456
- tokenRequired: true
457
- },
458
- recipes: {
459
- path: "v2/characters/$(id)/recipes",
460
- tokenRequired: true
461
- },
462
- sab: {
463
- path: "v2/characters/$(id)/sab",
464
- tokenRequired: true
465
- },
466
- skills: {
467
- path: "v2/characters/$(id)/skills",
468
- tokenRequired: true
469
- },
470
- specializations: {
471
- path: "v2/characters/$(id)/specializations",
472
- tokenRequired: true
473
- },
474
- training: {
475
- path: "v2/characters/$(id)/training",
476
- tokenRequired: true
477
- }
478
- },
479
- colors: {
480
- all: {
481
- path: "v2/colors",
482
- tokenRequired: false
483
- },
484
- byId: {
485
- path: "v2/colors?ids=$(ids)",
486
- tokenRequired: false
487
- }
488
- },
489
- commerce: {
490
- delivery: {
491
- path: "v2/commerce/delivery",
492
- tokenRequired: true
493
- },
494
- exchange: {
495
- path: "v2/commerce/exchange/$(type)?quantity=$(quantity)",
496
- tokenRequired: false
497
- },
498
- listings: {
499
- path: "v2/commerce/listings?ids=$(ids)",
500
- tokenRequired: false
501
- },
502
- prices: {
503
- path: "v2/commerce/prices?ids=$(ids)",
504
- tokenRequired: false
505
- },
506
- transactions: {
507
- path: "v2/commerce/transactions/$(status)/$(type)",
508
- tokenRequired: true
509
- }
510
- },
511
- continents: {
512
- core: {
513
- path: "v2/continents",
514
- tokenRequired: false
515
- },
516
- continents: {
517
- path: "v2/continents?ids=$(continents)",
518
- tokenRequired: false
519
- },
520
- floors: {
521
- path: "v2/continents/$(continents)/floors?ids=$(floors)",
522
- tokenRequired: false
523
- },
524
- regions: {
525
- path: "v2/continents/$(continents)/floors/$(floors)/regions?ids=$(regions)",
526
- tokenRequired: false
527
- },
528
- maps: {
529
- path: "v2/continents/$(continents)/floors/$(floors)/regions/$(regions)/maps?ids=$(maps)",
530
- tokenRequired: false
531
- }
532
- },
533
- createSubtoken: {
534
- noUrl: {
535
- path: "v2/createsubtoken?expire=$(expire)&permissions=$(permissions)",
536
- tokenRequired: true
537
- },
538
- url: {
539
- path: "v2/createsubtoken?expire=$(expire)&permissions=$(permissions)&urls=$(urls)",
540
- tokenRequired: true
541
- }
542
- },
543
- currencies: {
544
- all: {
545
- path: "v2/currencies",
546
- tokenRequired: false
547
- },
548
- byId: {
549
- path: "v2/currencies?ids=$(ids)",
550
- tokenRequired: false
551
- }
552
- },
553
- dailyCrafting: {
554
- path: "v2/dailycrafting",
555
- tokenRequired: false
556
- },
557
- dungeons: {
558
- all: {
559
- path: "v2/dungeons",
560
- tokenRequired: false
561
- },
562
- byId: {
563
- path: "v2/dungeons?ids=$(ids)",
564
- tokenRequired: false
565
- }
566
- },
567
- emblem: {
568
- path: "v2/emblem/$(type)?ids=$(ids)",
569
- tokenRequired: false
570
- },
571
- emotes: {
572
- all: {
573
- path: "v2/emotes",
574
- tokenRequired: false
575
- },
576
- byId: {
577
- path: "v2/emotes?ids=$(ids)",
578
- tokenRequired: false
579
- }
580
- },
581
- files: {
582
- all: {
583
- path: "v2/files",
584
- tokenRequired: false
585
- },
586
- byId: {
587
- path: "v2/files?ids=$(ids)",
588
- tokenRequired: false
589
- }
590
- },
591
- finishers: {
592
- all: {
593
- path: "v2/finishers",
594
- tokenRequired: false
595
- },
596
- byId: {
597
- path: "v2/finishers?ids=$(ids)",
598
- tokenRequired: false
599
- }
600
- },
601
- gliders: {
602
- all: {
603
- path: "v2/gliders",
604
- tokenRequired: false
605
- },
606
- byId: {
607
- path: "v2/gliders?ids=$(ids)",
608
- tokenRequired: false
609
- },
610
- paginated: {
611
- path: "v2/gliders?ids=$(ids)&page=$(page)&page_size=$(page_size)",
612
- tokenRequired: false
613
- }
614
- },
615
- guild: {
616
- core: {
617
- path: "v2/guild/$(id)",
618
- tokenRequired: false
619
- },
620
- log: {
621
- path: "v2/guild/$(id)/log?since=$(since)",
622
- tokenRequired: true
623
- },
624
- members: {
625
- path: "v2/guild/$(id)/members",
626
- tokenRequired: true
627
- },
628
- ranks: {
629
- path: "v2/guild/$(id)/ranks",
630
- tokenRequired: true
631
- },
632
- stash: {
633
- path: "v2/guild/$(id)/stash",
634
- tokenRequired: true
635
- },
636
- storage: {
637
- path: "v2/guild/$(id)/storage",
638
- tokenRequired: true
639
- },
640
- teams: {
641
- path: "v2/guild/$(id)/teams",
642
- tokenRequired: true
643
- },
644
- treasury: {
645
- path: "v2/guild/$(id)/treasury",
646
- tokenRequired: true
647
- },
648
- upgrades: {
649
- path: "v2/guild/$(id)/upgrades",
650
- tokenRequired: true
651
- },
652
- upgradesInfo: {
653
- path: "v2/guild/upgrades?ids=$(ids)",
654
- tokenRequired: false
655
- },
656
- permissionsAll: {
657
- path: "v2/guild/permissions",
658
- tokenRequired: false
659
- },
660
- permissionsById: {
661
- path: "v2/guild/permissions?ids=$(ids)",
662
- tokenRequired: false
663
- },
664
- search: {
665
- path: "v2/guild/search?name=$(name)",
666
- tokenRequired: false
667
- }
668
- },
669
- home: {
670
- cats: {
671
- path: "v2/home/cats?ids=$(ids)",
672
- tokenRequired: false
673
- },
674
- nodes: {
675
- path: "v2/home/nodes?ids=$(ids)",
676
- tokenRequired: false
677
- }
678
- },
679
- items: {
680
- all: {
681
- path: "v2/items",
682
- tokenRequired: false
683
- },
684
- byId: {
685
- path: "v2/items?ids=$(ids)",
686
- tokenRequired: false
687
- }
688
- },
689
- itemstats: {
690
- all: {
691
- path: "v2/itemstats",
692
- tokenRequired: false
693
- },
694
- byId: {
695
- path: "v2/itemstats?ids=$(ids)",
696
- tokenRequired: false
697
- }
698
- },
699
- jadebots: {
700
- all: {
701
- path: "v2/jadebots",
702
- tokenRequired: false
703
- },
704
- byId: {
705
- path: "v2/jadebots?ids=$(ids)",
706
- tokenRequired: false
707
- }
708
- },
709
- legendaryArmory: {
710
- all: {
711
- path: "v2/legendaryarmory",
712
- tokenRequired: false
713
- },
714
- byId: {
715
- path: "v2/legendaryarmory?ids=$(ids)",
716
- tokenRequired: false
717
- }
718
- },
719
- legends: {
720
- all: {
721
- path: "v2/legends",
722
- tokenRequired: false
723
- },
724
- byId: {
725
- path: "v2/legends?ids=$(ids)",
726
- tokenRequired: false
727
- }
728
- },
729
- mailCarriers: {
730
- all: {
731
- path: "v2/mailcarriers",
732
- tokenRequired: false
733
- },
734
- byId: {
735
- path: "v2/mailcarriers?ids=$(ids)",
736
- tokenRequired: false
737
- }
738
- },
739
- mapChests: {
740
- path: "v2/mapchests",
741
- tokenRequired: false
742
- },
743
- maps: {
744
- all: {
745
- path: "v2/maps",
746
- tokenRequired: false
747
- },
748
- byId: {
749
- path: "v2/maps?ids=$(ids)",
750
- tokenRequired: false
751
- }
752
- },
753
- masteries: {
754
- all: {
755
- path: "v2/masteries",
756
- tokenRequired: false
757
- },
758
- byId: {
759
- path: "v2/masteries?ids=$(ids)",
760
- tokenRequired: false
761
- }
762
- },
763
- materials: {
764
- all: {
765
- path: "v2/materials",
766
- tokenRequired: false
767
- },
768
- byId: {
769
- path: "v2/materials?ids=$(ids)",
770
- tokenRequired: false
771
- }
772
- },
773
- minis: {
774
- all: {
775
- path: "v2/minis",
776
- tokenRequired: false
777
- },
778
- byId: {
779
- path: "v2/minis?ids=$(ids)",
780
- tokenRequired: false
781
- }
782
- },
783
- mountsSkins: {
784
- all: {
785
- path: "v2/mounts/skins",
786
- tokenRequired: false
787
- },
788
- byId: {
789
- path: "v2/mounts/skins?ids=$(ids)",
790
- tokenRequired: false
791
- }
792
- },
793
- mountsTypes: {
794
- all: {
795
- path: "v2/mounts/types",
796
- tokenRequired: false
797
- },
798
- byId: {
799
- path: "v2/mounts/types?ids=$(ids)",
800
- tokenRequired: false
801
- }
802
- },
803
- novelties: {
804
- all: {
805
- path: "v2/novelties",
806
- tokenRequired: false
807
- },
808
- byId: {
809
- path: "v2/novelties?ids=$(ids)",
810
- tokenRequired: false
811
- }
812
- },
813
- outfits: {
814
- all: {
815
- path: "v2/outfits",
816
- tokenRequired: false
817
- },
818
- byId: {
819
- path: "v2/outfits?ids=$(ids)",
820
- tokenRequired: false
821
- }
822
- },
823
- pets: {
824
- all: {
825
- path: "v2/pets",
826
- tokenRequired: false
827
- },
828
- byId: {
829
- path: "v2/pets?ids=$(ids)",
830
- tokenRequired: false
831
- }
832
- },
833
- professions: {
834
- all: {
835
- path: "v2/professions",
836
- tokenRequired: false
837
- },
838
- byId: {
839
- path: "v2/professions?ids=$(ids)",
840
- tokenRequired: false
841
- }
842
- },
843
- pvp: {
844
- amuletsAll: {
845
- path: "v2/pvp/amulets",
846
- tokenRequired: false
847
- },
848
- amuletsById: {
849
- path: `v2/pvp/amulets?ids=$(ids)`,
850
- tokenRequired: false
851
- },
852
- gamesAll: {
853
- path: `v2/pvp/games`,
854
- tokenRequired: true
855
- },
856
- gamesById: {
857
- path: `v2/pvp/games?ids=$(ids)`,
858
- tokenRequired: true
859
- },
860
- heroesAll: {
861
- path: `v2/pvp/heroes`,
862
- tokenRequired: false
863
- },
864
- heroesById: {
865
- path: `v2/pvp/heroes?ids=$(ids)`,
866
- tokenRequired: false
867
- },
868
- ranksAll: {
869
- path: `v2/pvp/ranks`,
870
- tokenRequired: false
871
- },
872
- ranksById: {
873
- path: `v2/pvp/ranks?ids=$(ids)`,
874
- tokenRequired: false
875
- },
876
- seasonsAll: {
877
- path: `v2/pvp/seasons`,
878
- tokenRequired: false
879
- },
880
- seasonsById: {
881
- path: `v2/pvp/seasons?ids=$(ids)`,
882
- tokenRequired: false
883
- },
884
- leaderboards: {
885
- path: `v2/pvp/seasons/$(id)/leaderboards/$(type)/$(region)`,
886
- tokenRequired: false
887
- },
888
- leaderboardsNoType: {
889
- path: `v2/pvp/seasons/$(id)/leaderboards`,
890
- tokenRequired: false
891
- },
892
- standings: {
893
- path: `v2/pvp/standings`,
894
- tokenRequired: true
895
- },
896
- stats: {
897
- path: `v2/pvp/stats`,
898
- tokenRequired: true
899
- }
900
- },
901
- quaggans: {
902
- all: {
903
- path: "v2/quaggans",
904
- tokenRequired: false
905
- },
906
- byId: {
907
- path: "v2/quaggans?ids=$(ids)",
908
- tokenRequired: false
909
- }
910
- },
911
- quests: {
912
- all: {
913
- path: "v2/quests",
914
- tokenRequired: false
915
- },
916
- byId: {
917
- path: "v2/quests?ids=$(ids)",
918
- tokenRequired: false
919
- }
920
- },
921
- races: {
922
- all: {
923
- path: "v2/races",
924
- tokenRequired: false
925
- },
926
- byId: {
927
- path: "v2/races?ids=$(ids)",
928
- tokenRequired: false
929
- }
930
- },
931
- raids: {
932
- all: {
933
- path: "v2/raids",
934
- tokenRequired: false
935
- },
936
- byId: {
937
- path: "v2/raids?ids=$(ids)",
938
- tokenRequired: false
939
- }
940
- },
941
- recipes: {
942
- byId: {
943
- /**
944
- * TODO: The hardcoded schema could use some work
945
- */
946
- path: "v2/recipes?ids=$(ids)&v=2022-03-09T02:00:00.000Z",
947
- tokenRequired: false
948
- },
949
- all: {
950
- path: "v2/recipes",
951
- tokenRequired: false
952
- },
953
- search: {
954
- path: "v2/recipes/search?$(type)=$(ids)",
955
- tokenRequired: false
956
- }
957
- },
958
- skiffs: {
959
- all: {
960
- path: "v2/skiffs",
961
- tokenRequired: false
962
- },
963
- byId: {
964
- path: "v2/skiffs?ids=$(ids)",
965
- tokenRequired: false
966
- }
967
- },
968
- skills: {
969
- path: "v2/skills?ids=$(ids)",
970
- tokenRequired: false
971
- },
972
- skins: {
973
- all: {
974
- path: "v2/skins",
975
- tokenRequired: false
976
- },
977
- byId: {
978
- path: "v2/skins?ids=$(ids)",
979
- tokenRequired: false
980
- }
981
- },
982
- specializations: {
983
- all: {
984
- path: "v2/specializations",
985
- tokenRequired: false
986
- },
987
- byId: {
988
- path: "v2/specializations?ids=$(ids)",
989
- tokenRequired: false
990
- }
991
- },
992
- stories: {
993
- all: {
994
- path: "v2/stories",
995
- tokenRequired: false
996
- },
997
- byId: {
998
- path: "v2/stories?ids=$(ids)",
999
- tokenRequired: false
1000
- }
1001
- },
1002
- seasons: {
1003
- all: {
1004
- path: "v2/stories/seasons",
1005
- tokenRequired: false
1006
- },
1007
- byId: {
1008
- path: "v2/stories/seasons?ids=$(ids)",
1009
- tokenRequired: false
1010
- }
1011
- },
1012
- titles: {
1013
- all: {
1014
- path: "v2/titles",
1015
- tokenRequired: false
1016
- },
1017
- byId: {
1018
- path: "v2/titles?ids=$(ids)",
1019
- tokenRequired: false
1020
- }
1021
- },
1022
- tokenInfo: {
1023
- path: "v2/tokeninfo",
1024
- tokenRequired: true
1025
- },
1026
- traits: {
1027
- all: {
1028
- path: "v2/traits",
1029
- tokenRequired: false
1030
- },
1031
- byId: {
1032
- path: "v2/traits?ids=$(ids)",
1033
- tokenRequired: false
1034
- }
1035
- },
1036
- worldBosses: {
1037
- path: "v2/worldbosses",
1038
- tokenRequired: false
1039
- },
1040
- worlds: {
1041
- all: {
1042
- path: "v2/worlds",
1043
- tokenRequired: false
1044
- },
1045
- byId: {
1046
- path: "v2/worlds?ids=$(ids)",
1047
- tokenRequired: false
1048
- }
1049
- },
1050
- wvw: {
1051
- abilities: {
1052
- path: "v2/wvw/abilities",
1053
- tokenRequired: false
1054
- },
1055
- abilitiesById: {
1056
- path: "v2/wvw/abilities?ids=$(ids)",
1057
- tokenRequired: false
1058
- },
1059
- matches: {
1060
- path: "v2/wvw/matches",
1061
- tokenRequired: false
1062
- },
1063
- matchesById: {
1064
- path: "v2/wvw/matches?ids=$(ids)",
1065
- tokenRequired: false
1066
- },
1067
- matchesByWorld: {
1068
- path: "v2/wvw/matches/$(type)?world=$(world)",
1069
- tokenRequired: false
1070
- },
1071
- objectives: {
1072
- path: "v2/wvw/objectives",
1073
- tokenRequired: false
1074
- },
1075
- objectivesById: {
1076
- path: "v2/wvw/objectives?ids=$(ids)",
1077
- tokenRequired: false
1078
- },
1079
- ranks: {
1080
- path: "v2/wvw/ranks",
1081
- tokenRequired: false
1082
- },
1083
- ranksById: {
1084
- path: "v2/wvw/ranks?ids=$(ids)",
1085
- tokenRequired: false
1086
- },
1087
- upgradesById: {
1088
- path: "v2/wvw/upgrades?ids=$(ids)",
1089
- tokenRequired: false
1090
- },
1091
- upgradesAll: {
1092
- path: "v2/wvw/upgrades",
1093
- tokenRequired: false
1094
- }
1095
- }
1096
- };
1097
238
  var AccountDTO = z.object({
1098
239
  /** Account id. */
1099
240
  id: z.string(),
@@ -2415,9 +1556,9 @@ var GuildTeamsDTO = z.array(
2415
1556
  /** Team ladder statistics aggregates. */
2416
1557
  ladders: z.object({
2417
1558
  /** Ranked arena stats. */
2418
- ranked: PvPAggregate,
1559
+ ranked: PvPAggregate.optional(),
2419
1560
  /** Unranked arena stats. */
2420
- unranked: PvPAggregate
1561
+ unranked: PvPAggregate.optional()
2421
1562
  }),
2422
1563
  /** Team games. */
2423
1564
  games: z.array(PvPGame),
@@ -2433,7 +1574,7 @@ var GuildTeamsDTO = z.array(
2433
1574
  /** Seasonal rating. */
2434
1575
  rating: z.number()
2435
1576
  })
2436
- )
1577
+ ).optional()
2437
1578
  })
2438
1579
  );
2439
1580
  var GuildTreasuryDTO = z.array(
@@ -3430,16 +2571,11 @@ var ProfessionsDTO = z.array(
3430
2571
  /** The skill id. Can be resolved against /v2/skills. */
3431
2572
  id: z.number(),
3432
2573
  /** The skill bar slot that this weapon skill can be used in. */
3433
- slot: z.enum([
3434
- "Profession_1",
3435
- "Weapon_1",
3436
- "Weapon_2",
3437
- "Weapon_3",
3438
- "Weapon_4",
3439
- "Weapon_5",
3440
- "Utility",
3441
- "Heal",
3442
- "Elite"
2574
+ slot: z.union([
2575
+ z.enum(["Profession_1", "Utility", "Heal", "Elite"]),
2576
+ z.custom(
2577
+ (val) => typeof val === "string" ? /^Weapon_[1-5]$/.test(val) : false
2578
+ )
3443
2579
  ]),
3444
2580
  /** The name of the offhand weapon this skill requires to be equipped. This field is usually only present for Thief skills. */
3445
2581
  offhand: z.string().optional(),
@@ -4750,6 +3886,875 @@ var WvWUpgradesDTO = z.array(
4750
3886
  })
4751
3887
  );
4752
3888
 
3889
+ // src/apis/endpoints.ts
3890
+ var endpoints = {
3891
+ account: {
3892
+ base: {
3893
+ path: "v2/account",
3894
+ tokenRequired: true
3895
+ },
3896
+ achievements: {
3897
+ path: "v2/account/achievements",
3898
+ tokenRequired: true
3899
+ },
3900
+ bank: {
3901
+ path: "v2/account/bank",
3902
+ tokenRequired: true
3903
+ },
3904
+ buildStorage: {
3905
+ path: "v2/account/buildstorage?ids=all",
3906
+ tokenRequired: true
3907
+ },
3908
+ dailyCrafting: {
3909
+ path: "v2/account/dailycrafting",
3910
+ tokenRequired: true
3911
+ },
3912
+ dungeons: {
3913
+ path: "v2/account/dungeons",
3914
+ tokenRequired: true
3915
+ },
3916
+ dyes: {
3917
+ path: "v2/account/dyes",
3918
+ tokenRequired: true
3919
+ },
3920
+ emotes: {
3921
+ path: "v2/account/emotes",
3922
+ tokenRequired: true
3923
+ },
3924
+ finishers: {
3925
+ path: "v2/account/finishers",
3926
+ tokenRequired: true
3927
+ },
3928
+ gliders: {
3929
+ path: "v2/account/gliders",
3930
+ tokenRequired: true
3931
+ },
3932
+ homeCats: {
3933
+ path: "v2/account/home/cats",
3934
+ tokenRequired: true
3935
+ },
3936
+ homeNodes: {
3937
+ path: "v2/account/home/nodes",
3938
+ tokenRequired: true
3939
+ },
3940
+ inventory: {
3941
+ path: "v2/account/inventory",
3942
+ tokenRequired: true
3943
+ },
3944
+ jadebots: {
3945
+ path: "v2/account/jadebots",
3946
+ tokenRequired: true
3947
+ },
3948
+ legendaryArmory: {
3949
+ path: "v2/account/legendaryarmory",
3950
+ tokenRequired: true
3951
+ },
3952
+ luck: {
3953
+ path: "v2/account/luck",
3954
+ tokenRequired: true
3955
+ },
3956
+ mailCarriers: {
3957
+ path: "v2/account/mailcarriers",
3958
+ tokenRequired: true
3959
+ },
3960
+ mapChests: {
3961
+ path: "v2/account/mapchests",
3962
+ tokenRequired: true
3963
+ },
3964
+ masteries: {
3965
+ path: "v2/account/masteries",
3966
+ tokenRequired: true
3967
+ },
3968
+ masteryPoints: {
3969
+ path: "v2/account/mastery/points",
3970
+ tokenRequired: true
3971
+ },
3972
+ materials: {
3973
+ path: "v2/account/materials",
3974
+ tokenRequired: true
3975
+ },
3976
+ minis: {
3977
+ path: "v2/account/minis",
3978
+ tokenRequired: true
3979
+ },
3980
+ mountsSkins: {
3981
+ path: "v2/account/mounts/skins",
3982
+ tokenRequired: true
3983
+ },
3984
+ mountsTypes: {
3985
+ path: "v2/account/mounts/types",
3986
+ tokenRequired: true
3987
+ },
3988
+ novelties: {
3989
+ path: "v2/account/novelties",
3990
+ tokenRequired: true
3991
+ },
3992
+ outfits: {
3993
+ path: "v2/account/outfits",
3994
+ tokenRequired: true
3995
+ },
3996
+ progression: {
3997
+ path: "v2/account/progression",
3998
+ tokenRequired: true
3999
+ },
4000
+ pvpHeroes: {
4001
+ path: "v2/account/pvp/heroes",
4002
+ tokenRequired: true
4003
+ },
4004
+ raids: {
4005
+ path: "v2/account/raids",
4006
+ tokenRequired: true
4007
+ },
4008
+ recipes: {
4009
+ path: "v2/account/recipes",
4010
+ tokenRequired: true
4011
+ },
4012
+ skiffs: {
4013
+ path: "v2/account/skiffs",
4014
+ tokenRequired: true
4015
+ },
4016
+ skins: {
4017
+ path: "v2/account/skins",
4018
+ tokenRequired: true
4019
+ },
4020
+ titles: {
4021
+ path: "v2/account/titles",
4022
+ tokenRequired: true
4023
+ },
4024
+ wallet: {
4025
+ path: "v2/account/wallet",
4026
+ tokenRequired: true
4027
+ },
4028
+ worldBosses: {
4029
+ path: "v2/account/worldbosses",
4030
+ tokenRequired: true
4031
+ }
4032
+ },
4033
+ achievements: {
4034
+ categoryIds: {
4035
+ path: "v2/achievements/categories",
4036
+ tokenRequired: false
4037
+ },
4038
+ categories: {
4039
+ path: "v2/achievements/categories?ids=$(ids)",
4040
+ tokenRequired: false
4041
+ },
4042
+ groupsAll: {
4043
+ path: "v2/achievements/groups",
4044
+ tokenRequired: false
4045
+ },
4046
+ groupsById: {
4047
+ path: "v2/achievements/groups/$(id)",
4048
+ tokenRequired: false
4049
+ }
4050
+ },
4051
+ backstory: {
4052
+ answersAll: {
4053
+ path: "v2/backstory/answers",
4054
+ tokenRequired: false
4055
+ },
4056
+ answersById: {
4057
+ path: "v2/backstory/answers?ids=$(ids)",
4058
+ tokenRequired: false
4059
+ },
4060
+ questionsAll: {
4061
+ path: "v2/backstory/questions",
4062
+ tokenRequired: false
4063
+ },
4064
+ questionsById: {
4065
+ path: "v2/backstory/questions?ids=$(ids)",
4066
+ tokenRequired: false
4067
+ }
4068
+ },
4069
+ build: {
4070
+ path: "v2/build",
4071
+ tokenRequired: false
4072
+ },
4073
+ characters: {
4074
+ base: {
4075
+ path: "v2/characters",
4076
+ tokenRequired: true
4077
+ },
4078
+ backstory: {
4079
+ path: "v2/characters/$(id)/backstory",
4080
+ tokenRequired: true
4081
+ },
4082
+ buildTabs: {
4083
+ path: "v2/characters/$(id)/buildtabs?tabs=$(tabs)",
4084
+ tokenRequired: true
4085
+ },
4086
+ core: {
4087
+ path: "v2/characters/$(id)/core",
4088
+ tokenRequired: true
4089
+ },
4090
+ crafting: {
4091
+ path: "v2/characters/$(id)/crafting",
4092
+ tokenRequired: true
4093
+ },
4094
+ equipment: {
4095
+ path: "v2/characters/$(id)/equipment",
4096
+ tokenRequired: true
4097
+ },
4098
+ equipmentTabsById: {
4099
+ path: "v2/characters/$(id)/equipmenttabs?tabs=$(tabs)",
4100
+ tokenRequired: true
4101
+ },
4102
+ equipmentTabActive: {
4103
+ path: "v2/characters/$(id)/equipmenttabs/active",
4104
+ tokenRequired: true
4105
+ },
4106
+ heroPoints: {
4107
+ path: "v2/characters/$(id)/heropoints",
4108
+ tokenRequired: true
4109
+ },
4110
+ inventory: {
4111
+ path: "v2/characters/$(id)/inventory",
4112
+ tokenRequired: true
4113
+ },
4114
+ quests: {
4115
+ path: "v2/characters/$(id)/quests",
4116
+ tokenRequired: true
4117
+ },
4118
+ recipes: {
4119
+ path: "v2/characters/$(id)/recipes",
4120
+ tokenRequired: true
4121
+ },
4122
+ sab: {
4123
+ path: "v2/characters/$(id)/sab",
4124
+ tokenRequired: true
4125
+ },
4126
+ skills: {
4127
+ path: "v2/characters/$(id)/skills",
4128
+ tokenRequired: true
4129
+ },
4130
+ specializations: {
4131
+ path: "v2/characters/$(id)/specializations",
4132
+ tokenRequired: true
4133
+ },
4134
+ training: {
4135
+ path: "v2/characters/$(id)/training",
4136
+ tokenRequired: true
4137
+ }
4138
+ },
4139
+ colors: {
4140
+ all: {
4141
+ path: "v2/colors",
4142
+ tokenRequired: false
4143
+ },
4144
+ byId: {
4145
+ path: "v2/colors?ids=$(ids)",
4146
+ tokenRequired: false
4147
+ }
4148
+ },
4149
+ commerce: {
4150
+ delivery: {
4151
+ path: "v2/commerce/delivery",
4152
+ tokenRequired: true
4153
+ },
4154
+ exchange: {
4155
+ path: "v2/commerce/exchange/$(type)?quantity=$(quantity)",
4156
+ tokenRequired: false
4157
+ },
4158
+ listings: {
4159
+ path: "v2/commerce/listings?ids=$(ids)",
4160
+ tokenRequired: false
4161
+ },
4162
+ prices: {
4163
+ path: "v2/commerce/prices?ids=$(ids)",
4164
+ tokenRequired: false
4165
+ },
4166
+ transactions: {
4167
+ path: "v2/commerce/transactions/$(status)/$(type)",
4168
+ tokenRequired: true
4169
+ }
4170
+ },
4171
+ continents: {
4172
+ core: {
4173
+ path: "v2/continents",
4174
+ tokenRequired: false
4175
+ },
4176
+ continents: {
4177
+ path: "v2/continents?ids=$(continents)",
4178
+ tokenRequired: false
4179
+ },
4180
+ floors: {
4181
+ path: "v2/continents/$(continents)/floors?ids=$(floors)",
4182
+ tokenRequired: false
4183
+ },
4184
+ regions: {
4185
+ path: "v2/continents/$(continents)/floors/$(floors)/regions?ids=$(regions)",
4186
+ tokenRequired: false
4187
+ },
4188
+ maps: {
4189
+ path: "v2/continents/$(continents)/floors/$(floors)/regions/$(regions)/maps?ids=$(maps)",
4190
+ tokenRequired: false
4191
+ }
4192
+ },
4193
+ createSubtoken: {
4194
+ noUrl: {
4195
+ path: "v2/createsubtoken?expire=$(expire)&permissions=$(permissions)",
4196
+ tokenRequired: true
4197
+ },
4198
+ url: {
4199
+ path: "v2/createsubtoken?expire=$(expire)&permissions=$(permissions)&urls=$(urls)",
4200
+ tokenRequired: true
4201
+ }
4202
+ },
4203
+ currencies: {
4204
+ all: {
4205
+ path: "v2/currencies",
4206
+ tokenRequired: false
4207
+ },
4208
+ byId: {
4209
+ path: "v2/currencies?ids=$(ids)",
4210
+ tokenRequired: false
4211
+ }
4212
+ },
4213
+ dailyCrafting: {
4214
+ path: "v2/dailycrafting",
4215
+ tokenRequired: false
4216
+ },
4217
+ dungeons: {
4218
+ all: {
4219
+ path: "v2/dungeons",
4220
+ tokenRequired: false
4221
+ },
4222
+ byId: {
4223
+ path: "v2/dungeons?ids=$(ids)",
4224
+ tokenRequired: false
4225
+ }
4226
+ },
4227
+ emblem: {
4228
+ path: "v2/emblem/$(type)?ids=$(ids)",
4229
+ tokenRequired: false
4230
+ },
4231
+ emotes: {
4232
+ all: {
4233
+ path: "v2/emotes",
4234
+ tokenRequired: false
4235
+ },
4236
+ byId: {
4237
+ path: "v2/emotes?ids=$(ids)",
4238
+ tokenRequired: false
4239
+ }
4240
+ },
4241
+ files: {
4242
+ all: {
4243
+ path: "v2/files",
4244
+ tokenRequired: false
4245
+ },
4246
+ byId: {
4247
+ path: "v2/files?ids=$(ids)",
4248
+ tokenRequired: false
4249
+ }
4250
+ },
4251
+ finishers: {
4252
+ all: {
4253
+ path: "v2/finishers",
4254
+ tokenRequired: false
4255
+ },
4256
+ byId: {
4257
+ path: "v2/finishers?ids=$(ids)",
4258
+ tokenRequired: false
4259
+ }
4260
+ },
4261
+ gliders: {
4262
+ all: {
4263
+ path: "v2/gliders",
4264
+ tokenRequired: false
4265
+ },
4266
+ byId: {
4267
+ path: "v2/gliders?ids=$(ids)",
4268
+ tokenRequired: false
4269
+ },
4270
+ paginated: {
4271
+ path: "v2/gliders?ids=$(ids)&page=$(page)&page_size=$(page_size)",
4272
+ tokenRequired: false
4273
+ }
4274
+ },
4275
+ guild: {
4276
+ core: {
4277
+ path: "v2/guild/$(id)",
4278
+ tokenRequired: false
4279
+ },
4280
+ log: {
4281
+ path: "v2/guild/$(id)/log?since=$(since)",
4282
+ tokenRequired: true
4283
+ },
4284
+ members: {
4285
+ path: "v2/guild/$(id)/members",
4286
+ tokenRequired: true
4287
+ },
4288
+ ranks: {
4289
+ path: "v2/guild/$(id)/ranks",
4290
+ tokenRequired: true
4291
+ },
4292
+ stash: {
4293
+ path: "v2/guild/$(id)/stash",
4294
+ tokenRequired: true
4295
+ },
4296
+ storage: {
4297
+ path: "v2/guild/$(id)/storage",
4298
+ tokenRequired: true
4299
+ },
4300
+ teams: {
4301
+ path: "v2/guild/$(id)/teams",
4302
+ tokenRequired: true
4303
+ },
4304
+ treasury: {
4305
+ path: "v2/guild/$(id)/treasury",
4306
+ tokenRequired: true
4307
+ },
4308
+ upgrades: {
4309
+ path: "v2/guild/$(id)/upgrades",
4310
+ tokenRequired: true
4311
+ },
4312
+ upgradesInfo: {
4313
+ path: "v2/guild/upgrades?ids=$(ids)",
4314
+ tokenRequired: false
4315
+ },
4316
+ permissionsAll: {
4317
+ path: "v2/guild/permissions",
4318
+ tokenRequired: false
4319
+ },
4320
+ permissionsById: {
4321
+ path: "v2/guild/permissions?ids=$(ids)",
4322
+ tokenRequired: false
4323
+ },
4324
+ search: {
4325
+ path: "v2/guild/search?name=$(name)",
4326
+ tokenRequired: false
4327
+ }
4328
+ },
4329
+ home: {
4330
+ cats: {
4331
+ path: "v2/home/cats?ids=$(ids)",
4332
+ tokenRequired: false
4333
+ },
4334
+ nodes: {
4335
+ path: "v2/home/nodes?ids=$(ids)",
4336
+ tokenRequired: false
4337
+ }
4338
+ },
4339
+ items: {
4340
+ all: {
4341
+ path: "v2/items",
4342
+ tokenRequired: false
4343
+ },
4344
+ byId: {
4345
+ path: "v2/items?ids=$(ids)",
4346
+ tokenRequired: false
4347
+ }
4348
+ },
4349
+ itemstats: {
4350
+ all: {
4351
+ path: "v2/itemstats",
4352
+ tokenRequired: false
4353
+ },
4354
+ byId: {
4355
+ path: "v2/itemstats?ids=$(ids)",
4356
+ tokenRequired: false
4357
+ }
4358
+ },
4359
+ jadebots: {
4360
+ all: {
4361
+ path: "v2/jadebots",
4362
+ tokenRequired: false
4363
+ },
4364
+ byId: {
4365
+ path: "v2/jadebots?ids=$(ids)",
4366
+ tokenRequired: false
4367
+ }
4368
+ },
4369
+ legendaryArmory: {
4370
+ all: {
4371
+ path: "v2/legendaryarmory",
4372
+ tokenRequired: false
4373
+ },
4374
+ byId: {
4375
+ path: "v2/legendaryarmory?ids=$(ids)",
4376
+ tokenRequired: false
4377
+ }
4378
+ },
4379
+ legends: {
4380
+ all: {
4381
+ path: "v2/legends",
4382
+ tokenRequired: false
4383
+ },
4384
+ byId: {
4385
+ path: "v2/legends?ids=$(ids)",
4386
+ tokenRequired: false
4387
+ }
4388
+ },
4389
+ mailCarriers: {
4390
+ all: {
4391
+ path: "v2/mailcarriers",
4392
+ tokenRequired: false
4393
+ },
4394
+ byId: {
4395
+ path: "v2/mailcarriers?ids=$(ids)",
4396
+ tokenRequired: false
4397
+ }
4398
+ },
4399
+ mapChests: {
4400
+ path: "v2/mapchests",
4401
+ tokenRequired: false
4402
+ },
4403
+ maps: {
4404
+ all: {
4405
+ path: "v2/maps",
4406
+ tokenRequired: false
4407
+ },
4408
+ byId: {
4409
+ path: "v2/maps?ids=$(ids)",
4410
+ tokenRequired: false
4411
+ }
4412
+ },
4413
+ masteries: {
4414
+ all: {
4415
+ path: "v2/masteries",
4416
+ tokenRequired: false
4417
+ },
4418
+ byId: {
4419
+ path: "v2/masteries?ids=$(ids)",
4420
+ tokenRequired: false
4421
+ }
4422
+ },
4423
+ materials: {
4424
+ all: {
4425
+ path: "v2/materials",
4426
+ tokenRequired: false
4427
+ },
4428
+ byId: {
4429
+ path: "v2/materials?ids=$(ids)",
4430
+ tokenRequired: false
4431
+ }
4432
+ },
4433
+ minis: {
4434
+ all: {
4435
+ path: "v2/minis",
4436
+ tokenRequired: false
4437
+ },
4438
+ byId: {
4439
+ path: "v2/minis?ids=$(ids)",
4440
+ tokenRequired: false
4441
+ }
4442
+ },
4443
+ mountsSkins: {
4444
+ all: {
4445
+ path: "v2/mounts/skins",
4446
+ tokenRequired: false
4447
+ },
4448
+ byId: {
4449
+ path: "v2/mounts/skins?ids=$(ids)",
4450
+ tokenRequired: false
4451
+ }
4452
+ },
4453
+ mountsTypes: {
4454
+ all: {
4455
+ path: "v2/mounts/types",
4456
+ tokenRequired: false
4457
+ },
4458
+ byId: {
4459
+ path: "v2/mounts/types?ids=$(ids)",
4460
+ tokenRequired: false
4461
+ }
4462
+ },
4463
+ novelties: {
4464
+ all: {
4465
+ path: "v2/novelties",
4466
+ tokenRequired: false
4467
+ },
4468
+ byId: {
4469
+ path: "v2/novelties?ids=$(ids)",
4470
+ tokenRequired: false
4471
+ }
4472
+ },
4473
+ outfits: {
4474
+ all: {
4475
+ path: "v2/outfits",
4476
+ tokenRequired: false
4477
+ },
4478
+ byId: {
4479
+ path: "v2/outfits?ids=$(ids)",
4480
+ tokenRequired: false
4481
+ }
4482
+ },
4483
+ pets: {
4484
+ all: {
4485
+ path: "v2/pets",
4486
+ tokenRequired: false
4487
+ },
4488
+ byId: {
4489
+ path: "v2/pets?ids=$(ids)",
4490
+ tokenRequired: false
4491
+ }
4492
+ },
4493
+ professions: {
4494
+ all: {
4495
+ path: "v2/professions",
4496
+ tokenRequired: false
4497
+ },
4498
+ byId: {
4499
+ path: "v2/professions?ids=$(ids)",
4500
+ tokenRequired: false
4501
+ }
4502
+ },
4503
+ pvp: {
4504
+ amuletsAll: {
4505
+ path: "v2/pvp/amulets",
4506
+ tokenRequired: false
4507
+ },
4508
+ amuletsById: {
4509
+ path: "v2/pvp/amulets?ids=$(ids)",
4510
+ tokenRequired: false
4511
+ },
4512
+ gamesAll: {
4513
+ path: "v2/pvp/games",
4514
+ tokenRequired: true
4515
+ },
4516
+ gamesById: {
4517
+ path: "v2/pvp/games?ids=$(ids)",
4518
+ tokenRequired: true
4519
+ },
4520
+ heroesAll: {
4521
+ path: "v2/pvp/heroes",
4522
+ tokenRequired: false
4523
+ },
4524
+ heroesById: {
4525
+ path: "v2/pvp/heroes?ids=$(ids)",
4526
+ tokenRequired: false
4527
+ },
4528
+ ranksAll: {
4529
+ path: "v2/pvp/ranks",
4530
+ tokenRequired: false
4531
+ },
4532
+ ranksById: {
4533
+ path: "v2/pvp/ranks?ids=$(ids)",
4534
+ tokenRequired: false
4535
+ },
4536
+ seasonsAll: {
4537
+ path: "v2/pvp/seasons",
4538
+ tokenRequired: false
4539
+ },
4540
+ seasonsById: {
4541
+ path: "v2/pvp/seasons?ids=$(ids)",
4542
+ tokenRequired: false
4543
+ },
4544
+ leaderboards: {
4545
+ path: "v2/pvp/seasons/$(id)/leaderboards/$(type)/$(region)",
4546
+ tokenRequired: false
4547
+ },
4548
+ leaderboardsNoType: {
4549
+ path: "v2/pvp/seasons/$(id)/leaderboards",
4550
+ tokenRequired: false
4551
+ },
4552
+ standings: {
4553
+ path: "v2/pvp/standings",
4554
+ tokenRequired: true
4555
+ },
4556
+ stats: {
4557
+ path: "v2/pvp/stats",
4558
+ tokenRequired: true
4559
+ }
4560
+ },
4561
+ quaggans: {
4562
+ all: {
4563
+ path: "v2/quaggans",
4564
+ tokenRequired: false
4565
+ },
4566
+ byId: {
4567
+ path: "v2/quaggans?ids=$(ids)",
4568
+ tokenRequired: false
4569
+ }
4570
+ },
4571
+ quests: {
4572
+ all: {
4573
+ path: "v2/quests",
4574
+ tokenRequired: false
4575
+ },
4576
+ byId: {
4577
+ path: "v2/quests?ids=$(ids)",
4578
+ tokenRequired: false
4579
+ }
4580
+ },
4581
+ races: {
4582
+ all: {
4583
+ path: "v2/races",
4584
+ tokenRequired: false
4585
+ },
4586
+ byId: {
4587
+ path: "v2/races?ids=$(ids)",
4588
+ tokenRequired: false
4589
+ }
4590
+ },
4591
+ raids: {
4592
+ all: {
4593
+ path: "v2/raids",
4594
+ tokenRequired: false
4595
+ },
4596
+ byId: {
4597
+ path: "v2/raids?ids=$(ids)",
4598
+ tokenRequired: false
4599
+ }
4600
+ },
4601
+ recipes: {
4602
+ byId: {
4603
+ /**
4604
+ * TODO: The hardcoded schema could use some work
4605
+ */
4606
+ path: "v2/recipes?ids=$(ids)&v=2022-03-09T02:00:00.000Z",
4607
+ tokenRequired: false
4608
+ },
4609
+ all: {
4610
+ path: "v2/recipes",
4611
+ tokenRequired: false
4612
+ },
4613
+ search: {
4614
+ path: "v2/recipes/search?$(type)=$(ids)",
4615
+ tokenRequired: false
4616
+ }
4617
+ },
4618
+ skiffs: {
4619
+ all: {
4620
+ path: "v2/skiffs",
4621
+ tokenRequired: false
4622
+ },
4623
+ byId: {
4624
+ path: "v2/skiffs?ids=$(ids)",
4625
+ tokenRequired: false
4626
+ }
4627
+ },
4628
+ skills: {
4629
+ path: "v2/skills?ids=$(ids)",
4630
+ tokenRequired: false
4631
+ },
4632
+ skins: {
4633
+ all: {
4634
+ path: "v2/skins",
4635
+ tokenRequired: false
4636
+ },
4637
+ byId: {
4638
+ path: "v2/skins?ids=$(ids)",
4639
+ tokenRequired: false
4640
+ }
4641
+ },
4642
+ specializations: {
4643
+ all: {
4644
+ path: "v2/specializations",
4645
+ tokenRequired: false
4646
+ },
4647
+ byId: {
4648
+ path: "v2/specializations?ids=$(ids)",
4649
+ tokenRequired: false
4650
+ }
4651
+ },
4652
+ stories: {
4653
+ all: {
4654
+ path: "v2/stories",
4655
+ tokenRequired: false
4656
+ },
4657
+ byId: {
4658
+ path: "v2/stories?ids=$(ids)",
4659
+ tokenRequired: false
4660
+ }
4661
+ },
4662
+ seasons: {
4663
+ all: {
4664
+ path: "v2/stories/seasons",
4665
+ tokenRequired: false
4666
+ },
4667
+ byId: {
4668
+ path: "v2/stories/seasons?ids=$(ids)",
4669
+ tokenRequired: false
4670
+ }
4671
+ },
4672
+ titles: {
4673
+ all: {
4674
+ path: "v2/titles",
4675
+ tokenRequired: false
4676
+ },
4677
+ byId: {
4678
+ path: "v2/titles?ids=$(ids)",
4679
+ tokenRequired: false
4680
+ }
4681
+ },
4682
+ tokenInfo: {
4683
+ path: "v2/tokeninfo",
4684
+ tokenRequired: true
4685
+ },
4686
+ traits: {
4687
+ all: {
4688
+ path: "v2/traits",
4689
+ tokenRequired: false
4690
+ },
4691
+ byId: {
4692
+ path: "v2/traits?ids=$(ids)",
4693
+ tokenRequired: false
4694
+ }
4695
+ },
4696
+ worldBosses: {
4697
+ path: "v2/worldbosses",
4698
+ tokenRequired: false
4699
+ },
4700
+ worlds: {
4701
+ all: {
4702
+ path: "v2/worlds",
4703
+ tokenRequired: false
4704
+ },
4705
+ byId: {
4706
+ path: "v2/worlds?ids=$(ids)",
4707
+ tokenRequired: false
4708
+ }
4709
+ },
4710
+ wvw: {
4711
+ abilities: {
4712
+ path: "v2/wvw/abilities",
4713
+ tokenRequired: false
4714
+ },
4715
+ abilitiesById: {
4716
+ path: "v2/wvw/abilities?ids=$(ids)",
4717
+ tokenRequired: false
4718
+ },
4719
+ matches: {
4720
+ path: "v2/wvw/matches",
4721
+ tokenRequired: false
4722
+ },
4723
+ matchesById: {
4724
+ path: "v2/wvw/matches?ids=$(ids)",
4725
+ tokenRequired: false
4726
+ },
4727
+ matchesByWorld: {
4728
+ path: "v2/wvw/matches/$(type)?world=$(world)",
4729
+ tokenRequired: false
4730
+ },
4731
+ objectives: {
4732
+ path: "v2/wvw/objectives",
4733
+ tokenRequired: false
4734
+ },
4735
+ objectivesById: {
4736
+ path: "v2/wvw/objectives?ids=$(ids)",
4737
+ tokenRequired: false
4738
+ },
4739
+ ranks: {
4740
+ path: "v2/wvw/ranks",
4741
+ tokenRequired: false
4742
+ },
4743
+ ranksById: {
4744
+ path: "v2/wvw/ranks?ids=$(ids)",
4745
+ tokenRequired: false
4746
+ },
4747
+ upgradesById: {
4748
+ path: "v2/wvw/upgrades?ids=$(ids)",
4749
+ tokenRequired: false
4750
+ },
4751
+ upgradesAll: {
4752
+ path: "v2/wvw/upgrades",
4753
+ tokenRequired: false
4754
+ }
4755
+ }
4756
+ };
4757
+
4753
4758
  // src/apis/account/account.ts
4754
4759
  var AccountApi = class extends ApiBase {
4755
4760
  /**
@@ -5092,12 +5097,12 @@ var CharactersApi = class extends ApiBase {
5092
5097
  */
5093
5098
  async getBuildTabs(id, tabs = "all") {
5094
5099
  if (Array.isArray(tabs)) {
5095
- tabs.forEach((tab) => {
5100
+ for (const tab of tabs) {
5096
5101
  if (tab < 1 || tab > 8) {
5097
5102
  logger.warn("Build tab ids must be between 1 and 8. Returning all tabs");
5098
5103
  tabs = "all";
5099
5104
  }
5100
- });
5105
+ }
5101
5106
  }
5102
5107
  return await this.buildRequest(
5103
5108
  endpoints.characters.buildTabs,
@@ -5148,12 +5153,12 @@ var CharactersApi = class extends ApiBase {
5148
5153
  */
5149
5154
  async getEquipmentTabs(id, tabs = "all") {
5150
5155
  if (Array.isArray(tabs)) {
5151
- tabs.forEach((tab) => {
5156
+ for (const tab of tabs) {
5152
5157
  if (tab < 1 || tab > 8) {
5153
5158
  logger.warn("Equipment tab ids must be between 1 and 8. Returning all tabs.");
5154
5159
  tabs = "all";
5155
5160
  }
5156
- });
5161
+ }
5157
5162
  }
5158
5163
  return await this.buildRequest(
5159
5164
  endpoints.characters.equipmentTabsById,
@@ -5570,7 +5575,7 @@ var ContinentsApi = class extends ApiBase {
5570
5575
  ContinentsMapsDTO
5571
5576
  );
5572
5577
  }
5573
- } else if (regions instanceof Array || regions === "all") {
5578
+ } else if (Array.isArray(regions) || regions === "all") {
5574
5579
  return await this.buildRequest(
5575
5580
  endpoints.continents.regions,
5576
5581
  {
@@ -5581,7 +5586,7 @@ var ContinentsApi = class extends ApiBase {
5581
5586
  ContinentsRegionsDTO
5582
5587
  );
5583
5588
  }
5584
- } else if (floors instanceof Array || floors === "all") {
5589
+ } else if (Array.isArray(floors) || floors === "all") {
5585
5590
  return await this.buildRequest(
5586
5591
  endpoints.continents.floors,
5587
5592
  {
@@ -5591,7 +5596,7 @@ var ContinentsApi = class extends ApiBase {
5591
5596
  ContinentsFloorsDTO
5592
5597
  );
5593
5598
  }
5594
- } else if (continents instanceof Array || continents === "all") {
5599
+ } else if (Array.isArray(continents) || continents === "all") {
5595
5600
  return await this.buildRequest(
5596
5601
  endpoints.continents.continents,
5597
5602
  {
@@ -5638,7 +5643,7 @@ var EmotesApi = class extends ApiBase {
5638
5643
  if (ids && Array.isArray(ids)) {
5639
5644
  ids = ids.map((id) => {
5640
5645
  if (["shiverplus", "stretch"].includes(id.toLocaleLowerCase()))
5641
- return id[0].toLocaleUpperCase() + id.substring(1);
5646
+ return id[0]?.toLocaleUpperCase() + id.substring(1);
5642
5647
  return id.toLocaleLowerCase();
5643
5648
  });
5644
5649
  return await this.buildRequest(endpoints.emotes.byId, { ids }, EmotesDTO);
@@ -6170,213 +6175,109 @@ var WorldVsWorldApi = class extends ApiBase {
6170
6175
 
6171
6176
  // src/api.ts
6172
6177
  var GW2Api = class extends ApiBase {
6173
- /**
6174
- * /v2/account Api
6175
- */
6178
+ /** /v2/account Api */
6176
6179
  account = new AccountApi(this.getParams());
6177
- /**
6178
- * /v2/achievements Api
6179
- */
6180
+ /** /v2/achievements Api */
6180
6181
  achievements = new AchievementsApi(this.getParams());
6181
- /**
6182
- * /v2/backstory Api
6183
- */
6182
+ /** /v2/backstory Api */
6184
6183
  backstory = new BackstoryApi(this.getParams());
6185
- /**
6186
- * /v2/build Api
6187
- */
6184
+ /** /v2/build Api */
6188
6185
  build = new BuildApi(this.getParams());
6189
- /**
6190
- * /v2/characters Api
6191
- */
6186
+ /** /v2/characters Api */
6192
6187
  characters = new CharactersApi(this.getParams());
6193
- /**
6194
- * /v2/colors Api
6195
- */
6188
+ /** /v2/colors Api */
6196
6189
  colors = new ColorsApi(this.getParams());
6197
- /**
6198
- * /v2/commerce Api
6199
- */
6190
+ /** /v2/commerce Api */
6200
6191
  commerce = new CommerceApi(this.getParams());
6201
- /**
6202
- * /v2/continents Api
6203
- */
6192
+ /** /v2/continents Api */
6204
6193
  continents = new ContinentsApi(this.getParams());
6205
- /**
6206
- * /v2/currencies Api
6207
- */
6194
+ /** /v2/currencies Api */
6208
6195
  currencies = new CurrenciesApi(this.getParams());
6209
- /**
6210
- * /v2/dailycrafting Api
6211
- */
6196
+ /** /v2/dailycrafting Api */
6212
6197
  dailyCrafting = new DailyCraftingApi(this.getParams());
6213
- /**
6214
- * /v2/dungeons Api
6215
- */
6198
+ /** /v2/dungeons Api */
6216
6199
  dungeons = new DungeonsApi(this.getParams());
6217
- /**
6218
- * /v2/emblem Api
6219
- */
6200
+ /** /v2/emblem Api */
6220
6201
  emblem = new EmblemApi(this.getParams());
6221
- /**
6222
- * /v2/emotes Api
6223
- */
6202
+ /** /v2/emotes Api */
6224
6203
  emotes = new EmotesApi(this.getParams());
6225
- /**
6226
- * /v2/files Api
6227
- */
6204
+ /** /v2/files Api */
6228
6205
  files = new FilesApi(this.getParams());
6229
- /**
6230
- * /v2/finishers Api
6231
- */
6206
+ /** /v2/finishers Api */
6232
6207
  finishers = new FinishersApi(this.getParams());
6233
- /**
6234
- * /v2/gliders Api
6235
- */
6208
+ /** /v2/gliders Api */
6236
6209
  gliders = new GlidersApi(this.getParams());
6237
- /**
6238
- * /v2/guild Api
6239
- */
6210
+ /** /v2/guild Api */
6240
6211
  guild = new GuildApi(this.getParams());
6241
- /**
6242
- * /v2/home Api
6243
- */
6212
+ /** /v2/home Api */
6244
6213
  home = new HomeApi(this.getParams());
6245
- /**
6246
- * /v2/items Api
6247
- */
6214
+ /** /v2/items Api */
6248
6215
  items = new ItemsApi(this.getParams());
6249
- /**
6250
- * /v2/itemstats Api
6251
- */
6216
+ /** /v2/itemstats Api */
6252
6217
  itemstats = new ItemStatsApi(this.getParams());
6253
- /**
6254
- * /v2/jadebots Api
6255
- */
6218
+ /** /v2/jadebots Api */
6256
6219
  jadebots = new JadebotsApi(this.getParams());
6257
- /**
6258
- * /v2/legendaryarmory Api
6259
- */
6220
+ /** /v2/legendaryarmory Api */
6260
6221
  legendaryArmory = new LegendaryArmoryApi(this.getParams());
6261
- /**
6262
- * /v2/legends Api
6263
- */
6222
+ /** /v2/legends Api */
6264
6223
  legends = new LegendsApi(this.getParams());
6265
- /**
6266
- * /v2/mailcarriers Api
6267
- */
6224
+ /** /v2/mailcarriers Api */
6268
6225
  mailCarriers = new MailCarriersApi(this.getParams());
6269
- /**
6270
- * /v2/mapchests Api
6271
- */
6226
+ /** /v2/mapchests Api */
6272
6227
  mapChests = new MapChestsApi(this.getParams());
6273
- /**
6274
- * /v2/maps Api
6275
- */
6228
+ /** /v2/maps Api */
6276
6229
  maps = new MapsApi(this.getParams());
6277
- /**
6278
- * /v2/masteries Api
6279
- */
6230
+ /** /v2/masteries Api */
6280
6231
  masteries = new MasteriesApi(this.getParams());
6281
- /**
6282
- * /v2/materials Api
6283
- */
6232
+ /** /v2/materials Api */
6284
6233
  materials = new MaterialsApi(this.getParams());
6285
- /**
6286
- * /v2/minis Api
6287
- */
6234
+ /** /v2/minis Api */
6288
6235
  minis = new MinisApi(this.getParams());
6289
- /**
6290
- * /v2/mounts Api
6291
- */
6236
+ /** /v2/mounts Api */
6292
6237
  mounts = new MountsApi(this.getParams());
6293
- /**
6294
- * /v2/novelties Api
6295
- */
6238
+ /** /v2/novelties Api */
6296
6239
  novelties = new NoveltiesApi(this.getParams());
6297
- /**
6298
- * /v2/outfits Api
6299
- */
6240
+ /** /v2/outfits Api */
6300
6241
  outfits = new OutfitsApi(this.getParams());
6301
- /**
6302
- * /v2/pets Api
6303
- */
6242
+ /** /v2/pets Api */
6304
6243
  pets = new PetsApi(this.getParams());
6305
- /**
6306
- * /v2/professions Api
6307
- */
6244
+ /** /v2/professions Api */
6308
6245
  professions = new ProfessionsApi(this.getParams());
6309
- /**
6310
- * /v2/pvp Api
6311
- */
6246
+ /** /v2/pvp Api */
6312
6247
  pvp = new PvPApi(this.getParams());
6313
- /**
6314
- * /v2/quaggans Api
6315
- */
6248
+ /** /v2/quaggans Api */
6316
6249
  quaggans = new QuaggansApi(this.getParams());
6317
- /**
6318
- * /v2/quests Api
6319
- */
6250
+ /** /v2/quests Api */
6320
6251
  quests = new QuestsApi(this.getParams());
6321
- /**
6322
- * /v2/races Api
6323
- */
6252
+ /** /v2/races Api */
6324
6253
  races = new RacesApi(this.getParams());
6325
- /**
6326
- * /v2/raids Api
6327
- */
6254
+ /** /v2/raids Api */
6328
6255
  raids = new RaidsApi(this.getParams());
6329
- /**
6330
- * /v2/recipes Api
6331
- */
6256
+ /** /v2/recipes Api */
6332
6257
  recipes = new RecipesApi(this.getParams());
6333
- /**
6334
- * /v2/skiffs Api
6335
- */
6258
+ /** /v2/skiffs Api */
6336
6259
  skiffs = new SkiffsApi(this.getParams());
6337
- /**
6338
- * /v2/skills Api
6339
- */
6260
+ /** /v2/skills Api */
6340
6261
  skills = new SkillsApi(this.getParams());
6341
- /**
6342
- * /v2/skins Api
6343
- */
6262
+ /** /v2/skins Api */
6344
6263
  skins = new SkinsApi(this.getParams());
6345
- /**
6346
- * /v2/specializations Api
6347
- */
6264
+ /** /v2/specializations Api */
6348
6265
  specializations = new SpecializationsApi(this.getParams());
6349
- /**
6350
- * /v2/stories Api
6351
- */
6266
+ /** /v2/stories Api */
6352
6267
  stories = new StoriesApi(this.getParams());
6353
- /**
6354
- * /v2/subtoken Api
6355
- */
6268
+ /** /v2/subtoken Api */
6356
6269
  subtoken = new SubtokenApi(this.getParams());
6357
- /**
6358
- * /v2/titles Api
6359
- */
6270
+ /** /v2/titles Api */
6360
6271
  titles = new TitlesApi(this.getParams());
6361
- /**
6362
- * /v2/tokeninfo Api
6363
- */
6272
+ /** /v2/tokeninfo Api */
6364
6273
  tokenInfo = new TokenInfoApi(this.getParams());
6365
- /**
6366
- * /v2/traits Api
6367
- */
6274
+ /** /v2/traits Api */
6368
6275
  traits = new TraitsApi(this.getParams());
6369
- /**
6370
- * /v2/worldbosses Api
6371
- */
6276
+ /** /v2/worldbosses Api */
6372
6277
  worldBosses = new WorldBossesApi(this.getParams());
6373
- /**
6374
- * /v2/worlds Api
6375
- */
6278
+ /** /v2/worlds Api */
6376
6279
  worlds = new WorldsApi(this.getParams());
6377
- /**
6378
- * /v2/wvw Api
6379
- */
6280
+ /** /v2/wvw Api */
6380
6281
  wvw = new WorldVsWorldApi(this.getParams());
6381
6282
  };
6382
6283