maplestory-openapi 2.4.0 → 2.4.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
@@ -1561,9 +1561,9 @@ class CharacterItemEquipmentTotalOptionDto {
1561
1561
  }
1562
1562
 
1563
1563
  /**
1564
- * 캐릭터 장비 아이템 상세 정보
1564
+ * 에반 드래곤 장비 정보
1565
1565
  */
1566
- class CharacterItemEquipmentInfoDto {
1566
+ class CharacterItemEquipmentDragonInfoDto {
1567
1567
  /**
1568
1568
  * 장비 부위 명
1569
1569
  */
@@ -1604,38 +1604,6 @@ class CharacterItemEquipmentInfoDto {
1604
1604
  * 장비 기본 옵션
1605
1605
  */
1606
1606
  itemBaseOption;
1607
- /**
1608
- * 잠재능력 등급
1609
- */
1610
- potentialOptionGrade;
1611
- /**
1612
- * 에디셔널 잠재능력 등급
1613
- */
1614
- additionalPotentialOptionGrade;
1615
- /**
1616
- * 잠재능력 첫 번째 옵션
1617
- */
1618
- potentialOption1;
1619
- /**
1620
- * 잠재능력 두 번째 옵션
1621
- */
1622
- potentialOption2;
1623
- /**
1624
- * 잠재능력 세 번째 옵션
1625
- */
1626
- potentialOption3;
1627
- /**
1628
- * 에디셔널 잠재능력 첫 번째 옵션
1629
- */
1630
- additionalPotentialOption1;
1631
- /**
1632
- * 에디셔널 잠재능력 두 번째 옵션
1633
- */
1634
- additionalPotentialOption2;
1635
- /**
1636
- * 에디셔널 잠재능력 세 번째 옵션
1637
- */
1638
- additionalPotentialOption3;
1639
1607
  /**
1640
1608
  * 착용 레벨 증가
1641
1609
  */
@@ -1709,7 +1677,7 @@ class CharacterItemEquipmentInfoDto {
1709
1677
  */
1710
1678
  dateExpire;
1711
1679
  constructor(obj) {
1712
- const { item_equipment_part, item_equipment_slot, item_name, item_icon, item_description, item_shape_name, item_shape_icon, item_gender, item_total_option, item_base_option, potential_option_grade, additional_potential_option_grade, potential_option_1, potential_option_2, potential_option_3, additional_potential_option_1, additional_potential_option_2, additional_potential_option_3, equipment_level_increase, item_exceptional_option, item_add_option, growth_exp, growth_level, scroll_upgrade, cuttable_count, golden_hammer_flag, scroll_resilience_count, scroll_upgradeable_count, soul_name, soul_option, item_etc_option, starforce, starforce_scroll_flag, item_starforce_option, special_ring_level, date_expire, } = obj;
1680
+ const { item_equipment_part, item_equipment_slot, item_name, item_icon, item_description, item_shape_name, item_shape_icon, item_gender, item_total_option, item_base_option, equipment_level_increase, item_exceptional_option, item_add_option, growth_exp, growth_level, scroll_upgrade, cuttable_count, golden_hammer_flag, scroll_resilience_count, scroll_upgradeable_count, soul_name, soul_option, item_etc_option, starforce, starforce_scroll_flag, item_starforce_option, special_ring_level, date_expire, } = obj;
1713
1681
  this.itemEquipmentPart = item_equipment_part;
1714
1682
  this.itemEquipmentSlot = item_equipment_slot;
1715
1683
  this.itemName = item_name;
@@ -1720,14 +1688,6 @@ class CharacterItemEquipmentInfoDto {
1720
1688
  this.itemGender = item_gender;
1721
1689
  this.itemTotalOption = new CharacterItemEquipmentTotalOptionDto(item_total_option);
1722
1690
  this.itemBaseOption = new CharacterItemEquipmentBaseOptionDto(item_base_option);
1723
- this.potentialOptionGrade = potential_option_grade;
1724
- this.additionalPotentialOptionGrade = additional_potential_option_grade;
1725
- this.potentialOption1 = potential_option_1;
1726
- this.potentialOption2 = potential_option_2;
1727
- this.potentialOption3 = potential_option_3;
1728
- this.additionalPotentialOption1 = additional_potential_option_1;
1729
- this.additionalPotentialOption2 = additional_potential_option_2;
1730
- this.additionalPotentialOption3 = additional_potential_option_3;
1731
1691
  this.equipmentLevelIncrease = equipment_level_increase;
1732
1692
  this.itemExceptionalOption = new CharacterItemEquipmentExceptionalOptionDto(item_exceptional_option);
1733
1693
  this.itemAddOption = new CharacterItemEquipmentAddOptionDto(item_add_option);
@@ -1750,54 +1710,9 @@ class CharacterItemEquipmentInfoDto {
1750
1710
  }
1751
1711
 
1752
1712
  /**
1753
- * 캐릭터 칭호 아이템 정보
1754
- */
1755
- class CharacterItemEquipmentTitleDto {
1756
- /**
1757
- * 칭호 장비 명
1758
- */
1759
- titleName;
1760
- /**
1761
- * 칭호 아이콘
1762
- */
1763
- titleIcon;
1764
- /**
1765
- * 칭호 설명
1766
- */
1767
- titleDescription;
1768
- /**
1769
- * 칭호 유효 기간
1770
- */
1771
- dateExpire;
1772
- /**
1773
- * 칭호 옵션 유효 기간
1774
- */
1775
- dateOptionExpire = null;
1776
- /**
1777
- * 칭호 옵션 유효 기간 만료 여부
1778
- */
1779
- isOptionExpired = null;
1780
- constructor(obj) {
1781
- const { title_name, title_icon, title_description, date_expire, date_option_expire, } = obj;
1782
- this.titleName = title_name;
1783
- this.titleIcon = title_icon;
1784
- this.titleDescription = title_description;
1785
- this.dateExpire = date_expire ? new Date(date_expire) : null;
1786
- if (date_option_expire === 'expired') {
1787
- this.isOptionExpired = true;
1788
- }
1789
- else if (typeof date_option_expire === 'string') {
1790
- this.dateOptionExpire = date_option_expire
1791
- ? new Date(date_option_expire)
1792
- : null;
1793
- }
1794
- }
1795
- }
1796
-
1797
- /**
1798
- * 에반 드래곤 장비 정보
1713
+ * 캐릭터 장비 아이템 상세 정보
1799
1714
  */
1800
- class CharacterItemEquipmentDragonInfoDto {
1715
+ class CharacterItemEquipmentInfoDto {
1801
1716
  /**
1802
1717
  * 장비 부위 명
1803
1718
  */
@@ -1838,6 +1753,38 @@ class CharacterItemEquipmentDragonInfoDto {
1838
1753
  * 장비 기본 옵션
1839
1754
  */
1840
1755
  itemBaseOption;
1756
+ /**
1757
+ * 잠재능력 등급
1758
+ */
1759
+ potentialOptionGrade;
1760
+ /**
1761
+ * 에디셔널 잠재능력 등급
1762
+ */
1763
+ additionalPotentialOptionGrade;
1764
+ /**
1765
+ * 잠재능력 첫 번째 옵션
1766
+ */
1767
+ potentialOption1;
1768
+ /**
1769
+ * 잠재능력 두 번째 옵션
1770
+ */
1771
+ potentialOption2;
1772
+ /**
1773
+ * 잠재능력 세 번째 옵션
1774
+ */
1775
+ potentialOption3;
1776
+ /**
1777
+ * 에디셔널 잠재능력 첫 번째 옵션
1778
+ */
1779
+ additionalPotentialOption1;
1780
+ /**
1781
+ * 에디셔널 잠재능력 두 번째 옵션
1782
+ */
1783
+ additionalPotentialOption2;
1784
+ /**
1785
+ * 에디셔널 잠재능력 세 번째 옵션
1786
+ */
1787
+ additionalPotentialOption3;
1841
1788
  /**
1842
1789
  * 착용 레벨 증가
1843
1790
  */
@@ -1911,7 +1858,7 @@ class CharacterItemEquipmentDragonInfoDto {
1911
1858
  */
1912
1859
  dateExpire;
1913
1860
  constructor(obj) {
1914
- const { item_equipment_part, item_equipment_slot, item_name, item_icon, item_description, item_shape_name, item_shape_icon, item_gender, item_total_option, item_base_option, equipment_level_increase, item_exceptional_option, item_add_option, growth_exp, growth_level, scroll_upgrade, cuttable_count, golden_hammer_flag, scroll_resilience_count, scroll_upgradeable_count, soul_name, soul_option, item_etc_option, starforce, starforce_scroll_flag, item_starforce_option, special_ring_level, date_expire, } = obj;
1861
+ const { item_equipment_part, item_equipment_slot, item_name, item_icon, item_description, item_shape_name, item_shape_icon, item_gender, item_total_option, item_base_option, potential_option_grade, additional_potential_option_grade, potential_option_1, potential_option_2, potential_option_3, additional_potential_option_1, additional_potential_option_2, additional_potential_option_3, equipment_level_increase, item_exceptional_option, item_add_option, growth_exp, growth_level, scroll_upgrade, cuttable_count, golden_hammer_flag, scroll_resilience_count, scroll_upgradeable_count, soul_name, soul_option, item_etc_option, starforce, starforce_scroll_flag, item_starforce_option, special_ring_level, date_expire, } = obj;
1915
1862
  this.itemEquipmentPart = item_equipment_part;
1916
1863
  this.itemEquipmentSlot = item_equipment_slot;
1917
1864
  this.itemName = item_name;
@@ -1922,6 +1869,14 @@ class CharacterItemEquipmentDragonInfoDto {
1922
1869
  this.itemGender = item_gender;
1923
1870
  this.itemTotalOption = new CharacterItemEquipmentTotalOptionDto(item_total_option);
1924
1871
  this.itemBaseOption = new CharacterItemEquipmentBaseOptionDto(item_base_option);
1872
+ this.potentialOptionGrade = potential_option_grade;
1873
+ this.additionalPotentialOptionGrade = additional_potential_option_grade;
1874
+ this.potentialOption1 = potential_option_1;
1875
+ this.potentialOption2 = potential_option_2;
1876
+ this.potentialOption3 = potential_option_3;
1877
+ this.additionalPotentialOption1 = additional_potential_option_1;
1878
+ this.additionalPotentialOption2 = additional_potential_option_2;
1879
+ this.additionalPotentialOption3 = additional_potential_option_3;
1925
1880
  this.equipmentLevelIncrease = equipment_level_increase;
1926
1881
  this.itemExceptionalOption = new CharacterItemEquipmentExceptionalOptionDto(item_exceptional_option);
1927
1882
  this.itemAddOption = new CharacterItemEquipmentAddOptionDto(item_add_option);
@@ -2092,6 +2047,51 @@ class CharacterItemEquipmentMechanicInfoDto {
2092
2047
  }
2093
2048
  }
2094
2049
 
2050
+ /**
2051
+ * 캐릭터 칭호 아이템 정보
2052
+ */
2053
+ class CharacterItemEquipmentTitleDto {
2054
+ /**
2055
+ * 칭호 장비 명
2056
+ */
2057
+ titleName;
2058
+ /**
2059
+ * 칭호 아이콘
2060
+ */
2061
+ titleIcon;
2062
+ /**
2063
+ * 칭호 설명
2064
+ */
2065
+ titleDescription;
2066
+ /**
2067
+ * 칭호 유효 기간
2068
+ */
2069
+ dateExpire;
2070
+ /**
2071
+ * 칭호 옵션 유효 기간
2072
+ */
2073
+ dateOptionExpire = null;
2074
+ /**
2075
+ * 칭호 옵션 유효 기간 만료 여부
2076
+ */
2077
+ isOptionExpired = null;
2078
+ constructor(obj) {
2079
+ const { title_name, title_icon, title_description, date_expire, date_option_expire, } = obj;
2080
+ this.titleName = title_name;
2081
+ this.titleIcon = title_icon;
2082
+ this.titleDescription = title_description;
2083
+ this.dateExpire = date_expire ? new Date(date_expire) : null;
2084
+ if (date_option_expire === 'expired') {
2085
+ this.isOptionExpired = true;
2086
+ }
2087
+ else if (typeof date_option_expire === 'string') {
2088
+ this.dateOptionExpire = date_option_expire
2089
+ ? new Date(date_option_expire)
2090
+ : null;
2091
+ }
2092
+ }
2093
+ }
2094
+
2095
2095
  /**
2096
2096
  * 캐릭터 장비 아이템 정보
2097
2097
  */
@@ -3223,80 +3223,233 @@ class CubeHistoryResponseDto {
3223
3223
  }
3224
3224
 
3225
3225
  /**
3226
- * 스타포스 강화 이벤트 정보
3226
+ * 잠재능력 재설정 결과 옵션 정보
3227
3227
  */
3228
- class StarforceEventDto {
3229
- /**
3230
- * 이벤트 성공 확률
3231
- */
3232
- successRate;
3233
- /**
3234
- * 이벤트 비용 할인율
3235
- */
3236
- costDiscountRate;
3228
+ class PotentialResultOptionDto {
3237
3229
  /**
3238
- * 이벤트 강화 수치 가중값
3230
+ * 옵션
3239
3231
  */
3240
- plusValue;
3232
+ value;
3241
3233
  /**
3242
- * 이벤트 적용 강화 시도 가능한 n성 범위
3234
+ * 옵션 등급
3243
3235
  */
3244
- starforceEventRange;
3236
+ grade;
3245
3237
  constructor(obj) {
3246
- const { success_rate, cost_discount_rate, plus_value, starforce_event_range, } = obj;
3247
- this.successRate = success_rate;
3248
- this.costDiscountRate = cost_discount_rate;
3249
- this.plusValue = plus_value;
3250
- this.starforceEventRange = starforce_event_range;
3238
+ const { value, grade } = obj;
3239
+ this.value = value;
3240
+ this.grade = grade;
3241
+ }
3242
+ get gradeEnum() {
3243
+ return potentialOptionGradeFromString(this.grade);
3251
3244
  }
3252
3245
  }
3253
3246
 
3254
3247
  /**
3255
- * 스타포스 히스토리
3248
+ * 잠재능력 재설정 히스토리
3256
3249
  */
3257
- class StarforceHistoryDto {
3250
+ class PotentialHistoryDto {
3258
3251
  /**
3259
- *스타포스 히스토리 식별자
3252
+ * 잠재능력 재설정 히스토리 식별자
3260
3253
  */
3261
3254
  id;
3262
3255
  /**
3263
- *강화 시도 결과
3256
+ * 캐릭터
3264
3257
  */
3265
- itemUpgradeResult;
3258
+ characterName;
3266
3259
  /**
3267
- *강화 시도 전 스타포스 수치
3260
+ * 사용 일시
3268
3261
  */
3269
- beforeStarforceCount;
3262
+ dateCreate;
3270
3263
  /**
3271
- *강화 시도 스타포스 수치
3264
+ * 대상 잠재능력 타입 (잠재능력, 에디셔널 잠재능력)
3272
3265
  */
3273
- afterStarforceCount;
3266
+ potentialType;
3274
3267
  /**
3275
- *스타 캐치
3268
+ * 사용 결과
3276
3269
  */
3277
- starCatchResult;
3270
+ itemUpgradeResult;
3278
3271
  /**
3279
- *슈페리얼 장비
3272
+ * 미라클 타임 적용 여부
3280
3273
  */
3281
- superiorItemFlag;
3274
+ miracleTimeFlag;
3282
3275
  /**
3283
- *파괴 방지
3276
+ * 장비 분류
3284
3277
  */
3285
- destroyDefence;
3278
+ itemEquipmentPart;
3286
3279
  /**
3287
- *찬스 타임
3280
+ * 장비 레벨
3288
3281
  */
3289
- chanceTime;
3282
+ itemLevel;
3290
3283
  /**
3291
- *파괴 방지 필드 이벤트
3284
+ * 잠재능력 재설정 장비 명
3292
3285
  */
3293
- eventFieldFlag;
3286
+ targetItem;
3294
3287
  /**
3295
- *사용 주문서
3288
+ * 잠재능력 등급
3296
3289
  */
3297
- upgradeItem;
3290
+ potentialOptionGrade;
3298
3291
  /**
3299
- *프로텍트 실드
3292
+ * 에디셔널 잠재능력 등급
3293
+ */
3294
+ additionalPotentialOptionGrade;
3295
+ /**
3296
+ * 천장에 도달하여 확정 등급 상승한 여부
3297
+ */
3298
+ upgradeGuarantee;
3299
+ /**
3300
+ * 현재까지 쌓은 스택
3301
+ */
3302
+ upgradeGuaranteeCount;
3303
+ /**
3304
+ * 사용 전 잠재능력 옵션
3305
+ */
3306
+ beforePotentialOption;
3307
+ /**
3308
+ * 사용 전 에디셔널 잠재능력 옵션
3309
+ */
3310
+ beforeAdditionalPotentialOption;
3311
+ /**
3312
+ * 사용 후 잠재능력 옵션
3313
+ */
3314
+ afterPotentialOption;
3315
+ /**
3316
+ * 사용 후 에디셔널 잠재능력 옵션
3317
+ */
3318
+ afterAdditionalPotentialOption;
3319
+ constructor(obj) {
3320
+ const { id, character_name, date_create, potential_type, item_upgrade_result, miracle_time_flag, item_equipment_part, item_level, target_item, potential_option_grade, additional_potential_option_grade, upgrade_guarantee, upgrade_guarantee_count, before_potential_option, before_additional_potential_option, after_potential_option, after_additional_potential_option, } = obj;
3321
+ this.id = id;
3322
+ this.characterName = character_name;
3323
+ this.dateCreate = new Date(date_create);
3324
+ this.potentialType = potential_type;
3325
+ this.itemUpgradeResult = item_upgrade_result;
3326
+ this.miracleTimeFlag = miracle_time_flag;
3327
+ this.itemEquipmentPart = item_equipment_part;
3328
+ this.itemLevel = item_level;
3329
+ this.targetItem = target_item;
3330
+ this.potentialOptionGrade = potential_option_grade;
3331
+ this.additionalPotentialOptionGrade = additional_potential_option_grade;
3332
+ this.upgradeGuarantee = upgrade_guarantee;
3333
+ this.upgradeGuaranteeCount = upgrade_guarantee_count;
3334
+ this.beforePotentialOption = before_potential_option.map((origin) => new PotentialResultOptionDto(origin));
3335
+ this.beforeAdditionalPotentialOption =
3336
+ before_additional_potential_option.map((origin) => new PotentialResultOptionDto(origin));
3337
+ this.afterPotentialOption = after_potential_option.map((origin) => new PotentialResultOptionDto(origin));
3338
+ this.afterAdditionalPotentialOption = after_additional_potential_option.map((origin) => new PotentialResultOptionDto(origin));
3339
+ }
3340
+ get isItemUpgrade() {
3341
+ return this.itemUpgradeResult === '성공';
3342
+ }
3343
+ get isMiracleTimeFlag() {
3344
+ return this.miracleTimeFlag !== '이벤트 적용되지 않음';
3345
+ }
3346
+ get potentialOptionGradeEnum() {
3347
+ return potentialOptionGradeFromString(this.potentialOptionGrade);
3348
+ }
3349
+ get additionalPotentialOptionGradeEnum() {
3350
+ return potentialOptionGradeFromString(this.additionalPotentialOptionGrade);
3351
+ }
3352
+ }
3353
+
3354
+ /**
3355
+ * 잠재능력 재설정 히스토리 응답 정보
3356
+ */
3357
+ class PotentialHistoryResponseDto {
3358
+ /**
3359
+ * 결과 건 수
3360
+ */
3361
+ count;
3362
+ /**
3363
+ * 잠재능력 재설정 히스토리
3364
+ */
3365
+ potentialHistory;
3366
+ /**
3367
+ * 페이징 처리를 위한 cursor
3368
+ */
3369
+ nextCursor;
3370
+ constructor(obj) {
3371
+ const { count, potential_history, next_cursor } = obj;
3372
+ this.count = count;
3373
+ this.potentialHistory = potential_history.map((origin) => new PotentialHistoryDto(origin));
3374
+ this.nextCursor = next_cursor;
3375
+ }
3376
+ }
3377
+
3378
+ /**
3379
+ * 스타포스 강화 이벤트 정보
3380
+ */
3381
+ class StarforceEventDto {
3382
+ /**
3383
+ * 이벤트 성공 확률
3384
+ */
3385
+ successRate;
3386
+ /**
3387
+ * 이벤트 비용 할인율
3388
+ */
3389
+ costDiscountRate;
3390
+ /**
3391
+ * 이벤트 강화 수치 가중값
3392
+ */
3393
+ plusValue;
3394
+ /**
3395
+ * 이벤트 적용 강화 시도 가능한 n성 범위
3396
+ */
3397
+ starforceEventRange;
3398
+ constructor(obj) {
3399
+ const { success_rate, cost_discount_rate, plus_value, starforce_event_range, } = obj;
3400
+ this.successRate = success_rate;
3401
+ this.costDiscountRate = cost_discount_rate;
3402
+ this.plusValue = plus_value;
3403
+ this.starforceEventRange = starforce_event_range;
3404
+ }
3405
+ }
3406
+
3407
+ /**
3408
+ * 스타포스 히스토리
3409
+ */
3410
+ class StarforceHistoryDto {
3411
+ /**
3412
+ *스타포스 히스토리 식별자
3413
+ */
3414
+ id;
3415
+ /**
3416
+ *강화 시도 결과
3417
+ */
3418
+ itemUpgradeResult;
3419
+ /**
3420
+ *강화 시도 전 스타포스 수치
3421
+ */
3422
+ beforeStarforceCount;
3423
+ /**
3424
+ *강화 시도 후 스타포스 수치
3425
+ */
3426
+ afterStarforceCount;
3427
+ /**
3428
+ *스타 캐치
3429
+ */
3430
+ starCatchResult;
3431
+ /**
3432
+ *슈페리얼 장비
3433
+ */
3434
+ superiorItemFlag;
3435
+ /**
3436
+ *파괴 방지
3437
+ */
3438
+ destroyDefence;
3439
+ /**
3440
+ *찬스 타임
3441
+ */
3442
+ chanceTime;
3443
+ /**
3444
+ *파괴 방지 필드 이벤트
3445
+ */
3446
+ eventFieldFlag;
3447
+ /**
3448
+ *사용 주문서 명
3449
+ */
3450
+ upgradeItem;
3451
+ /**
3452
+ *프로텍트 실드
3300
3453
  */
3301
3454
  protectShield;
3302
3455
  /**
@@ -3904,11 +4057,26 @@ class UnionDto {
3904
4057
  * 유니온 등급
3905
4058
  */
3906
4059
  unionGrade;
4060
+ /**
4061
+ * 아티팩트 레벨
4062
+ */
4063
+ unionArtifactLevel;
4064
+ /**
4065
+ * 보유 아티팩트 경험치
4066
+ */
4067
+ unionArtifactExp;
4068
+ /**
4069
+ * 보유 아티팩트 포인트
4070
+ */
4071
+ unionArtifactPoint;
3907
4072
  constructor(obj) {
3908
- const { date, union_level, union_grade } = obj;
4073
+ const { date, union_level, union_grade, union_artifact_level, union_artifact_exp, union_artifact_point } = obj;
3909
4074
  this.date = new Date(date);
3910
4075
  this.unionLevel = union_level;
3911
4076
  this.unionGrade = union_grade;
4077
+ this.unionArtifactLevel = union_artifact_level;
4078
+ this.unionArtifactExp = union_artifact_exp;
4079
+ this.unionArtifactPoint = union_artifact_point;
3912
4080
  }
3913
4081
  }
3914
4082
 
@@ -4064,6 +4232,8 @@ var MapleStoryApiErrorCode;
4064
4232
  MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00005"] = 4] = "OPENAPI00005";
4065
4233
  MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00006"] = 5] = "OPENAPI00006";
4066
4234
  MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00007"] = 6] = "OPENAPI00007";
4235
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00009"] = 7] = "OPENAPI00009";
4236
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00010"] = 8] = "OPENAPI00010";
4067
4237
  })(MapleStoryApiErrorCode || (MapleStoryApiErrorCode = {}));
4068
4238
  const errorMap = {
4069
4239
  ['OPENAPI00001']: MapleStoryApiErrorCode.OPENAPI00001,
@@ -4073,161 +4243,10 @@ const errorMap = {
4073
4243
  ['OPENAPI00005']: MapleStoryApiErrorCode.OPENAPI00005,
4074
4244
  ['OPENAPI00006']: MapleStoryApiErrorCode.OPENAPI00006,
4075
4245
  ['OPENAPI00007']: MapleStoryApiErrorCode.OPENAPI00007,
4246
+ ['OPENAPI00009']: MapleStoryApiErrorCode.OPENAPI00009,
4247
+ ['OPENAPI00010']: MapleStoryApiErrorCode.OPENAPI00010,
4076
4248
  };
4077
4249
 
4078
- /**
4079
- * 잠재능력 재설정 결과 옵션 정보
4080
- */
4081
- class PotentialResultOptionDto {
4082
- /**
4083
- * 옵션 명
4084
- */
4085
- value;
4086
- /**
4087
- * 옵션 등급
4088
- */
4089
- grade;
4090
- constructor(obj) {
4091
- const { value, grade } = obj;
4092
- this.value = value;
4093
- this.grade = grade;
4094
- }
4095
- get gradeEnum() {
4096
- return potentialOptionGradeFromString(this.grade);
4097
- }
4098
- }
4099
-
4100
- /**
4101
- * 잠재능력 재설정 히스토리
4102
- */
4103
- class PotentialHistoryDto {
4104
- /**
4105
- * 잠재능력 재설정 히스토리 식별자
4106
- */
4107
- id;
4108
- /**
4109
- * 캐릭터 명
4110
- */
4111
- characterName;
4112
- /**
4113
- * 사용 일시
4114
- */
4115
- dateCreate;
4116
- /**
4117
- * 대상 잠재능력 타입 (잠재능력, 에디셔널 잠재능력)
4118
- */
4119
- potentialType;
4120
- /**
4121
- * 사용 결과
4122
- */
4123
- itemUpgradeResult;
4124
- /**
4125
- * 미라클 타임 적용 여부
4126
- */
4127
- miracleTimeFlag;
4128
- /**
4129
- * 장비 분류
4130
- */
4131
- itemEquipmentPart;
4132
- /**
4133
- * 장비 레벨
4134
- */
4135
- itemLevel;
4136
- /**
4137
- * 잠재능력 재설정 장비 명
4138
- */
4139
- targetItem;
4140
- /**
4141
- * 잠재능력 등급
4142
- */
4143
- potentialOptionGrade;
4144
- /**
4145
- * 에디셔널 잠재능력 등급
4146
- */
4147
- additionalPotentialOptionGrade;
4148
- /**
4149
- * 천장에 도달하여 확정 등급 상승한 여부
4150
- */
4151
- upgradeGuarantee;
4152
- /**
4153
- * 현재까지 쌓은 스택
4154
- */
4155
- upgradeGuaranteeCount;
4156
- /**
4157
- * 사용 전 잠재능력 옵션
4158
- */
4159
- beforePotentialOption;
4160
- /**
4161
- * 사용 전 에디셔널 잠재능력 옵션
4162
- */
4163
- beforeAdditionalPotentialOption;
4164
- /**
4165
- * 사용 후 잠재능력 옵션
4166
- */
4167
- afterPotentialOption;
4168
- /**
4169
- * 사용 후 에디셔널 잠재능력 옵션
4170
- */
4171
- afterAdditionalPotentialOption;
4172
- constructor(obj) {
4173
- const { id, character_name, date_create, potential_type, item_upgrade_result, miracle_time_flag, item_equipment_part, item_level, target_item, potential_option_grade, additional_potential_option_grade, upgrade_guarantee, upgrade_guarantee_count, before_potential_option, before_additional_potential_option, after_potential_option, after_additional_potential_option, } = obj;
4174
- this.id = id;
4175
- this.characterName = character_name;
4176
- this.dateCreate = new Date(date_create);
4177
- this.potentialType = potential_type;
4178
- this.itemUpgradeResult = item_upgrade_result;
4179
- this.miracleTimeFlag = miracle_time_flag;
4180
- this.itemEquipmentPart = item_equipment_part;
4181
- this.itemLevel = item_level;
4182
- this.targetItem = target_item;
4183
- this.potentialOptionGrade = potential_option_grade;
4184
- this.additionalPotentialOptionGrade = additional_potential_option_grade;
4185
- this.upgradeGuarantee = upgrade_guarantee;
4186
- this.upgradeGuaranteeCount = upgrade_guarantee_count;
4187
- this.beforePotentialOption = before_potential_option.map((origin) => new PotentialResultOptionDto(origin));
4188
- this.beforeAdditionalPotentialOption =
4189
- before_additional_potential_option.map((origin) => new PotentialResultOptionDto(origin));
4190
- this.afterPotentialOption = after_potential_option.map((origin) => new PotentialResultOptionDto(origin));
4191
- this.afterAdditionalPotentialOption = after_additional_potential_option.map((origin) => new PotentialResultOptionDto(origin));
4192
- }
4193
- get isItemUpgrade() {
4194
- return this.itemUpgradeResult === '성공';
4195
- }
4196
- get isMiracleTimeFlag() {
4197
- return this.miracleTimeFlag !== '이벤트 적용되지 않음';
4198
- }
4199
- get potentialOptionGradeEnum() {
4200
- return potentialOptionGradeFromString(this.potentialOptionGrade);
4201
- }
4202
- get additionalPotentialOptionGradeEnum() {
4203
- return potentialOptionGradeFromString(this.additionalPotentialOptionGrade);
4204
- }
4205
- }
4206
-
4207
- /**
4208
- * 잠재능력 재설정 히스토리 응답 정보
4209
- */
4210
- class PotentialHistoryResponseDto {
4211
- /**
4212
- * 결과 건 수
4213
- */
4214
- count;
4215
- /**
4216
- * 잠재능력 재설정 히스토리
4217
- */
4218
- potentialHistory;
4219
- /**
4220
- * 페이징 처리를 위한 cursor
4221
- */
4222
- nextCursor;
4223
- constructor(obj) {
4224
- const { count, potential_history, next_cursor } = obj;
4225
- this.count = count;
4226
- this.potentialHistory = potential_history.map((origin) => new PotentialHistoryDto(origin));
4227
- this.nextCursor = next_cursor;
4228
- }
4229
- }
4230
-
4231
4250
  dayjs.extend(timezone);
4232
4251
  dayjs.extend(utc);
4233
4252
  /**
@@ -4236,12 +4255,32 @@ dayjs.extend(utc);
4236
4255
  */
4237
4256
  class MapleStoryApi {
4238
4257
  apiKey;
4258
+ client;
4239
4259
  static BASE_URL = 'https://open.api.nexon.com/';
4260
+ static DEFAULT_TIMEOUT = 5000;
4240
4261
  static kstOffset = 540;
4241
- timeout;
4262
+ get timeout() {
4263
+ return this.client.defaults.timeout;
4264
+ }
4265
+ set timeout(value) {
4266
+ this.client.defaults.timeout = value;
4267
+ }
4242
4268
  constructor(apiKey) {
4243
4269
  this.apiKey = apiKey;
4244
- this.timeout = 5000;
4270
+ this.client = axios.create({
4271
+ baseURL: MapleStoryApi.BASE_URL,
4272
+ timeout: MapleStoryApi.DEFAULT_TIMEOUT,
4273
+ headers: {
4274
+ 'x-nxopen-api-key': this.apiKey,
4275
+ },
4276
+ });
4277
+ this.client.interceptors.response.use((response) => response, (error) => {
4278
+ if (error instanceof AxiosError) {
4279
+ const errorBody = error.response.data;
4280
+ throw new MapleStoryApiError(errorBody);
4281
+ }
4282
+ throw error;
4283
+ });
4245
4284
  }
4246
4285
  //#region 캐릭터 정보 조회
4247
4286
  /**
@@ -4253,25 +4292,13 @@ class MapleStoryApi {
4253
4292
  * @param characterName 캐릭터 명
4254
4293
  */
4255
4294
  async getCharacter(characterName) {
4256
- try {
4257
- const path = 'maplestory/v1/id';
4258
- const response = await axios.get(path, {
4259
- baseURL: MapleStoryApi.BASE_URL,
4260
- timeout: this.timeout,
4261
- headers: this.buildHeaders(),
4262
- params: {
4263
- character_name: characterName,
4264
- },
4265
- });
4266
- return new CharacterDto(response.data);
4267
- }
4268
- catch (e) {
4269
- if (e instanceof AxiosError) {
4270
- const errorBody = e.response.data;
4271
- throw new MapleStoryApiError(errorBody);
4272
- }
4273
- throw e;
4274
- }
4295
+ const path = 'maplestory/v1/id';
4296
+ const { data } = await this.client.get(path, {
4297
+ params: {
4298
+ character_name: characterName,
4299
+ },
4300
+ });
4301
+ return new CharacterDto(data);
4275
4302
  }
4276
4303
  /**
4277
4304
  * 기본 정보를 조회합니다.
@@ -4287,6 +4314,7 @@ class MapleStoryApi {
4287
4314
  minute: 0,
4288
4315
  dateOffset: 1,
4289
4316
  })) {
4317
+ const path = 'maplestory/v1/character/basic';
4290
4318
  const query = {
4291
4319
  ocid: ocid,
4292
4320
  date: MapleStoryApi.toDateString({
@@ -4295,23 +4323,10 @@ class MapleStoryApi {
4295
4323
  day: 21,
4296
4324
  }, dateOptions),
4297
4325
  };
4298
- try {
4299
- const path = 'maplestory/v1/character/basic';
4300
- const response = await axios.get(path, {
4301
- baseURL: MapleStoryApi.BASE_URL,
4302
- timeout: this.timeout,
4303
- headers: this.buildHeaders(),
4304
- params: query,
4305
- });
4306
- return new CharacterBasicDto(response.data);
4307
- }
4308
- catch (e) {
4309
- if (e instanceof AxiosError) {
4310
- const errorBody = e.response.data;
4311
- throw new MapleStoryApiError(errorBody);
4312
- }
4313
- throw e;
4314
- }
4326
+ const { data } = await this.client.get(path, {
4327
+ params: query,
4328
+ });
4329
+ return new CharacterBasicDto(data);
4315
4330
  }
4316
4331
  /**
4317
4332
  * 인기도 정보를 조회합니다.
@@ -4327,6 +4342,7 @@ class MapleStoryApi {
4327
4342
  minute: 0,
4328
4343
  dateOffset: 1,
4329
4344
  })) {
4345
+ const path = 'maplestory/v1/character/popularity';
4330
4346
  const query = {
4331
4347
  ocid: ocid,
4332
4348
  date: MapleStoryApi.toDateString({
@@ -4335,23 +4351,10 @@ class MapleStoryApi {
4335
4351
  day: 21,
4336
4352
  }, dateOptions),
4337
4353
  };
4338
- try {
4339
- const path = 'maplestory/v1/character/popularity';
4340
- const response = await axios.get(path, {
4341
- baseURL: MapleStoryApi.BASE_URL,
4342
- timeout: this.timeout,
4343
- headers: this.buildHeaders(),
4344
- params: query,
4345
- });
4346
- return new CharacterPopularityDto(response.data);
4347
- }
4348
- catch (e) {
4349
- if (e instanceof AxiosError) {
4350
- const errorBody = e.response.data;
4351
- throw new MapleStoryApiError(errorBody);
4352
- }
4353
- throw e;
4354
- }
4354
+ const { data } = await this.client.get(path, {
4355
+ params: query,
4356
+ });
4357
+ return new CharacterPopularityDto(data);
4355
4358
  }
4356
4359
  /**
4357
4360
  * 종합 능력치 정보를 조회합니다.
@@ -4367,6 +4370,7 @@ class MapleStoryApi {
4367
4370
  minute: 0,
4368
4371
  dateOffset: 1,
4369
4372
  })) {
4373
+ const path = 'maplestory/v1/character/stat';
4370
4374
  const query = {
4371
4375
  ocid: ocid,
4372
4376
  date: MapleStoryApi.toDateString({
@@ -4375,23 +4379,10 @@ class MapleStoryApi {
4375
4379
  day: 21,
4376
4380
  }, dateOptions),
4377
4381
  };
4378
- try {
4379
- const path = 'maplestory/v1/character/stat';
4380
- const response = await axios.get(path, {
4381
- baseURL: MapleStoryApi.BASE_URL,
4382
- timeout: this.timeout,
4383
- headers: this.buildHeaders(),
4384
- params: query,
4385
- });
4386
- return new CharacterStatDto(response.data);
4387
- }
4388
- catch (e) {
4389
- if (e instanceof AxiosError) {
4390
- const errorBody = e.response.data;
4391
- throw new MapleStoryApiError(errorBody);
4392
- }
4393
- throw e;
4394
- }
4382
+ const { data } = await this.client.get(path, {
4383
+ params: query,
4384
+ });
4385
+ return new CharacterStatDto(data);
4395
4386
  }
4396
4387
  /**
4397
4388
  * 하이퍼스탯 정보를 조회합니다.
@@ -4407,6 +4398,7 @@ class MapleStoryApi {
4407
4398
  minute: 0,
4408
4399
  dateOffset: 1,
4409
4400
  })) {
4401
+ const path = 'maplestory/v1/character/hyper-stat';
4410
4402
  const query = {
4411
4403
  ocid: ocid,
4412
4404
  date: MapleStoryApi.toDateString({
@@ -4415,23 +4407,10 @@ class MapleStoryApi {
4415
4407
  day: 21,
4416
4408
  }, dateOptions),
4417
4409
  };
4418
- try {
4419
- const path = 'maplestory/v1/character/hyper-stat';
4420
- const response = await axios.get(path, {
4421
- baseURL: MapleStoryApi.BASE_URL,
4422
- timeout: this.timeout,
4423
- headers: this.buildHeaders(),
4424
- params: query,
4425
- });
4426
- return new CharacterHyperStatDto(response.data);
4427
- }
4428
- catch (e) {
4429
- if (e instanceof AxiosError) {
4430
- const errorBody = e.response.data;
4431
- throw new MapleStoryApiError(errorBody);
4432
- }
4433
- throw e;
4434
- }
4410
+ const { data } = await this.client.get(path, {
4411
+ params: query,
4412
+ });
4413
+ return new CharacterHyperStatDto(data);
4435
4414
  }
4436
4415
  /**
4437
4416
  * 성향 정보를 조회합니다.
@@ -4447,6 +4426,7 @@ class MapleStoryApi {
4447
4426
  minute: 0,
4448
4427
  dateOffset: 1,
4449
4428
  })) {
4429
+ const path = 'maplestory/v1/character/propensity';
4450
4430
  const query = {
4451
4431
  ocid: ocid,
4452
4432
  date: MapleStoryApi.toDateString({
@@ -4455,23 +4435,10 @@ class MapleStoryApi {
4455
4435
  day: 21,
4456
4436
  }, dateOptions),
4457
4437
  };
4458
- try {
4459
- const path = 'maplestory/v1/character/propensity';
4460
- const response = await axios.get(path, {
4461
- baseURL: MapleStoryApi.BASE_URL,
4462
- timeout: this.timeout,
4463
- headers: this.buildHeaders(),
4464
- params: query,
4465
- });
4466
- return new CharacterPropensityDto(response.data);
4467
- }
4468
- catch (e) {
4469
- if (e instanceof AxiosError) {
4470
- const errorBody = e.response.data;
4471
- throw new MapleStoryApiError(errorBody);
4472
- }
4473
- throw e;
4474
- }
4438
+ const { data } = await this.client.get(path, {
4439
+ params: query,
4440
+ });
4441
+ return new CharacterPropensityDto(data);
4475
4442
  }
4476
4443
  /**
4477
4444
  * 어빌리티 정보를 조회합니다.
@@ -4487,6 +4454,7 @@ class MapleStoryApi {
4487
4454
  minute: 0,
4488
4455
  dateOffset: 1,
4489
4456
  })) {
4457
+ const path = 'maplestory/v1/character/ability';
4490
4458
  const query = {
4491
4459
  ocid: ocid,
4492
4460
  date: MapleStoryApi.toDateString({
@@ -4495,23 +4463,10 @@ class MapleStoryApi {
4495
4463
  day: 21,
4496
4464
  }, dateOptions),
4497
4465
  };
4498
- try {
4499
- const path = 'maplestory/v1/character/ability';
4500
- const response = await axios.get(path, {
4501
- baseURL: MapleStoryApi.BASE_URL,
4502
- timeout: this.timeout,
4503
- headers: this.buildHeaders(),
4504
- params: query,
4505
- });
4506
- return new CharacterAbilityDto(response.data);
4507
- }
4508
- catch (e) {
4509
- if (e instanceof AxiosError) {
4510
- const errorBody = e.response.data;
4511
- throw new MapleStoryApiError(errorBody);
4512
- }
4513
- throw e;
4514
- }
4466
+ const { data } = await this.client.get(path, {
4467
+ params: query,
4468
+ });
4469
+ return new CharacterAbilityDto(data);
4515
4470
  }
4516
4471
  /**
4517
4472
  * 장착한 장비 중 캐시 장비를 제외한 나머지 장비 정보를 조회합니다.
@@ -4527,6 +4482,7 @@ class MapleStoryApi {
4527
4482
  minute: 0,
4528
4483
  dateOffset: 1,
4529
4484
  })) {
4485
+ const path = 'maplestory/v1/character/item-equipment';
4530
4486
  const query = {
4531
4487
  ocid: ocid,
4532
4488
  date: MapleStoryApi.toDateString({
@@ -4535,23 +4491,10 @@ class MapleStoryApi {
4535
4491
  day: 21,
4536
4492
  }, dateOptions),
4537
4493
  };
4538
- try {
4539
- const path = 'maplestory/v1/character/item-equipment';
4540
- const response = await axios.get(path, {
4541
- baseURL: MapleStoryApi.BASE_URL,
4542
- timeout: this.timeout,
4543
- headers: this.buildHeaders(),
4544
- params: query,
4545
- });
4546
- return new CharacterItemEquipmentDto(response.data);
4547
- }
4548
- catch (e) {
4549
- if (e instanceof AxiosError) {
4550
- const errorBody = e.response.data;
4551
- throw new MapleStoryApiError(errorBody);
4552
- }
4553
- throw e;
4554
- }
4494
+ const { data } = await this.client.get(path, {
4495
+ params: query,
4496
+ });
4497
+ return new CharacterItemEquipmentDto(data);
4555
4498
  }
4556
4499
  /**
4557
4500
  * 장착한 캐시 장비 정보를 조회합니다.
@@ -4567,6 +4510,7 @@ class MapleStoryApi {
4567
4510
  minute: 0,
4568
4511
  dateOffset: 1,
4569
4512
  })) {
4513
+ const path = 'maplestory/v1/character/cashitem-equipment';
4570
4514
  const query = {
4571
4515
  ocid: ocid,
4572
4516
  date: MapleStoryApi.toDateString({
@@ -4575,23 +4519,10 @@ class MapleStoryApi {
4575
4519
  day: 21,
4576
4520
  }, dateOptions),
4577
4521
  };
4578
- try {
4579
- const path = 'maplestory/v1/character/cashitem-equipment';
4580
- const response = await axios.get(path, {
4581
- baseURL: MapleStoryApi.BASE_URL,
4582
- timeout: this.timeout,
4583
- headers: this.buildHeaders(),
4584
- params: query,
4585
- });
4586
- return new CharacterCashItemEquipmentDto(response.data);
4587
- }
4588
- catch (e) {
4589
- if (e instanceof AxiosError) {
4590
- const errorBody = e.response.data;
4591
- throw new MapleStoryApiError(errorBody);
4592
- }
4593
- throw e;
4594
- }
4522
+ const { data } = await this.client.get(path, {
4523
+ params: query,
4524
+ });
4525
+ return new CharacterCashItemEquipmentDto(data);
4595
4526
  }
4596
4527
  /**
4597
4528
  * 장착한 심볼 정보를 조회합니다.
@@ -4607,6 +4538,7 @@ class MapleStoryApi {
4607
4538
  minute: 0,
4608
4539
  dateOffset: 1,
4609
4540
  })) {
4541
+ const path = 'maplestory/v1/character/symbol-equipment';
4610
4542
  const query = {
4611
4543
  ocid: ocid,
4612
4544
  date: MapleStoryApi.toDateString({
@@ -4615,23 +4547,10 @@ class MapleStoryApi {
4615
4547
  day: 21,
4616
4548
  }, dateOptions),
4617
4549
  };
4618
- try {
4619
- const path = 'maplestory/v1/character/symbol-equipment';
4620
- const response = await axios.get(path, {
4621
- baseURL: MapleStoryApi.BASE_URL,
4622
- timeout: this.timeout,
4623
- headers: this.buildHeaders(),
4624
- params: query,
4625
- });
4626
- return new CharacterSymbolEquipmentDto(response.data);
4627
- }
4628
- catch (e) {
4629
- if (e instanceof AxiosError) {
4630
- const errorBody = e.response.data;
4631
- throw new MapleStoryApiError(errorBody);
4632
- }
4633
- throw e;
4634
- }
4550
+ const { data } = await this.client.get(path, {
4551
+ params: query,
4552
+ });
4553
+ return new CharacterSymbolEquipmentDto(data);
4635
4554
  }
4636
4555
  /**
4637
4556
  * 적용받고 있는 세트 효과 정보를 조회합니다.
@@ -4647,6 +4566,7 @@ class MapleStoryApi {
4647
4566
  minute: 0,
4648
4567
  dateOffset: 1,
4649
4568
  })) {
4569
+ const path = 'maplestory/v1/character/set-effect';
4650
4570
  const query = {
4651
4571
  ocid: ocid,
4652
4572
  date: MapleStoryApi.toDateString({
@@ -4655,23 +4575,10 @@ class MapleStoryApi {
4655
4575
  day: 21,
4656
4576
  }, dateOptions),
4657
4577
  };
4658
- try {
4659
- const path = 'maplestory/v1/character/set-effect';
4660
- const response = await axios.get(path, {
4661
- baseURL: MapleStoryApi.BASE_URL,
4662
- timeout: this.timeout,
4663
- headers: this.buildHeaders(),
4664
- params: query,
4665
- });
4666
- return new CharacterSetEffectDto(response.data);
4667
- }
4668
- catch (e) {
4669
- if (e instanceof AxiosError) {
4670
- const errorBody = e.response.data;
4671
- throw new MapleStoryApiError(errorBody);
4672
- }
4673
- throw e;
4674
- }
4578
+ const { data } = await this.client.get(path, {
4579
+ params: query,
4580
+ });
4581
+ return new CharacterSetEffectDto(data);
4675
4582
  }
4676
4583
  /**
4677
4584
  * 장착 중인 헤어, 성형, 피부 정보를 조회합니다.
@@ -4687,6 +4594,7 @@ class MapleStoryApi {
4687
4594
  minute: 0,
4688
4595
  dateOffset: 1,
4689
4596
  })) {
4597
+ const path = 'maplestory/v1/character/beauty-equipment';
4690
4598
  const query = {
4691
4599
  ocid: ocid,
4692
4600
  date: MapleStoryApi.toDateString({
@@ -4695,23 +4603,10 @@ class MapleStoryApi {
4695
4603
  day: 21,
4696
4604
  }, dateOptions),
4697
4605
  };
4698
- try {
4699
- const path = 'maplestory/v1/character/beauty-equipment';
4700
- const response = await axios.get(path, {
4701
- baseURL: MapleStoryApi.BASE_URL,
4702
- timeout: this.timeout,
4703
- headers: this.buildHeaders(),
4704
- params: query,
4705
- });
4706
- return new CharacterBeautyEquipmentDto(response.data);
4707
- }
4708
- catch (e) {
4709
- if (e instanceof AxiosError) {
4710
- const errorBody = e.response.data;
4711
- throw new MapleStoryApiError(errorBody);
4712
- }
4713
- throw e;
4714
- }
4606
+ const { data } = await this.client.get(path, {
4607
+ params: query,
4608
+ });
4609
+ return new CharacterBeautyEquipmentDto(data);
4715
4610
  }
4716
4611
  /**
4717
4612
  * 장착한 안드로이드 정보를 조회합니다.
@@ -4727,6 +4622,7 @@ class MapleStoryApi {
4727
4622
  minute: 0,
4728
4623
  dateOffset: 1,
4729
4624
  })) {
4625
+ const path = 'maplestory/v1/character/android-equipment';
4730
4626
  const query = {
4731
4627
  ocid: ocid,
4732
4628
  date: MapleStoryApi.toDateString({
@@ -4735,23 +4631,10 @@ class MapleStoryApi {
4735
4631
  day: 21,
4736
4632
  }, dateOptions),
4737
4633
  };
4738
- try {
4739
- const path = 'maplestory/v1/character/android-equipment';
4740
- const response = await axios.get(path, {
4741
- baseURL: MapleStoryApi.BASE_URL,
4742
- timeout: this.timeout,
4743
- headers: this.buildHeaders(),
4744
- params: query,
4745
- });
4746
- return new CharacterAndroidEquipmentDto(response.data);
4747
- }
4748
- catch (e) {
4749
- if (e instanceof AxiosError) {
4750
- const errorBody = e.response.data;
4751
- throw new MapleStoryApiError(errorBody);
4752
- }
4753
- throw e;
4754
- }
4634
+ const { data } = await this.client.get(path, {
4635
+ params: query,
4636
+ });
4637
+ return new CharacterAndroidEquipmentDto(data);
4755
4638
  }
4756
4639
  /**
4757
4640
  * 장착한 펫 및 펫 스킬, 장비 정보를 조회합니다.
@@ -4767,6 +4650,7 @@ class MapleStoryApi {
4767
4650
  minute: 0,
4768
4651
  dateOffset: 1,
4769
4652
  })) {
4653
+ const path = 'maplestory/v1/character/pet-equipment';
4770
4654
  const query = {
4771
4655
  ocid: ocid,
4772
4656
  date: MapleStoryApi.toDateString({
@@ -4775,23 +4659,10 @@ class MapleStoryApi {
4775
4659
  day: 21,
4776
4660
  }, dateOptions),
4777
4661
  };
4778
- try {
4779
- const path = 'maplestory/v1/character/pet-equipment';
4780
- const response = await axios.get(path, {
4781
- baseURL: MapleStoryApi.BASE_URL,
4782
- timeout: this.timeout,
4783
- headers: this.buildHeaders(),
4784
- params: query,
4785
- });
4786
- return new CharacterPetEquipmentDto(response.data);
4787
- }
4788
- catch (e) {
4789
- if (e instanceof AxiosError) {
4790
- const errorBody = e.response.data;
4791
- throw new MapleStoryApiError(errorBody);
4792
- }
4793
- throw e;
4794
- }
4662
+ const { data } = await this.client.get(path, {
4663
+ params: query,
4664
+ });
4665
+ return new CharacterPetEquipmentDto(data);
4795
4666
  }
4796
4667
  /**
4797
4668
  * 캐릭터 스킬과 하이퍼 스킬 정보를 조회합니다.
@@ -4819,6 +4690,7 @@ class MapleStoryApi {
4819
4690
  minute: 0,
4820
4691
  dateOffset: 1,
4821
4692
  })) {
4693
+ const path = 'maplestory/v1/character/skill';
4822
4694
  const query = {
4823
4695
  ocid: ocid,
4824
4696
  character_skill_grade: characterSkillGrade,
@@ -4828,23 +4700,10 @@ class MapleStoryApi {
4828
4700
  day: 21,
4829
4701
  }, dateOptions),
4830
4702
  };
4831
- try {
4832
- const path = 'maplestory/v1/character/skill';
4833
- const response = await axios.get(path, {
4834
- baseURL: MapleStoryApi.BASE_URL,
4835
- timeout: this.timeout,
4836
- headers: this.buildHeaders(),
4837
- params: query,
4838
- });
4839
- return new CharacterSkillDto(response.data);
4840
- }
4841
- catch (e) {
4842
- if (e instanceof AxiosError) {
4843
- const errorBody = e.response.data;
4844
- throw new MapleStoryApiError(errorBody);
4845
- }
4846
- throw e;
4847
- }
4703
+ const { data } = await this.client.get(path, {
4704
+ params: query,
4705
+ });
4706
+ return new CharacterSkillDto(data);
4848
4707
  }
4849
4708
  /**
4850
4709
  * 장착 링크 스킬 정보를 조회합니다.
@@ -4860,6 +4719,7 @@ class MapleStoryApi {
4860
4719
  minute: 0,
4861
4720
  dateOffset: 1,
4862
4721
  })) {
4722
+ const path = 'maplestory/v1/character/link-skill';
4863
4723
  const query = {
4864
4724
  ocid: ocid,
4865
4725
  date: MapleStoryApi.toDateString({
@@ -4868,23 +4728,10 @@ class MapleStoryApi {
4868
4728
  day: 21,
4869
4729
  }, dateOptions),
4870
4730
  };
4871
- try {
4872
- const path = 'maplestory/v1/character/link-skill';
4873
- const response = await axios.get(path, {
4874
- baseURL: MapleStoryApi.BASE_URL,
4875
- timeout: this.timeout,
4876
- headers: this.buildHeaders(),
4877
- params: query,
4878
- });
4879
- return new CharacterLinkSkillDto(response.data);
4880
- }
4881
- catch (e) {
4882
- if (e instanceof AxiosError) {
4883
- const errorBody = e.response.data;
4884
- throw new MapleStoryApiError(errorBody);
4885
- }
4886
- throw e;
4887
- }
4731
+ const { data } = await this.client.get(path, {
4732
+ params: query,
4733
+ });
4734
+ return new CharacterLinkSkillDto(data);
4888
4735
  }
4889
4736
  /**
4890
4737
  * V매트릭스 슬롯 정보와 장착한 V코어 정보를 조회합니다.
@@ -4900,6 +4747,7 @@ class MapleStoryApi {
4900
4747
  minute: 0,
4901
4748
  dateOffset: 1,
4902
4749
  })) {
4750
+ const path = 'maplestory/v1/character/vmatrix';
4903
4751
  const query = {
4904
4752
  ocid: ocid,
4905
4753
  date: MapleStoryApi.toDateString({
@@ -4908,23 +4756,10 @@ class MapleStoryApi {
4908
4756
  day: 21,
4909
4757
  }, dateOptions),
4910
4758
  };
4911
- try {
4912
- const path = 'maplestory/v1/character/vmatrix';
4913
- const response = await axios.get(path, {
4914
- baseURL: MapleStoryApi.BASE_URL,
4915
- timeout: this.timeout,
4916
- headers: this.buildHeaders(),
4917
- params: query,
4918
- });
4919
- return new CharacterVMatrixDto(response.data);
4920
- }
4921
- catch (e) {
4922
- if (e instanceof AxiosError) {
4923
- const errorBody = e.response.data;
4924
- throw new MapleStoryApiError(errorBody);
4925
- }
4926
- throw e;
4927
- }
4759
+ const { data } = await this.client.get(path, {
4760
+ params: query,
4761
+ });
4762
+ return new CharacterVMatrixDto(data);
4928
4763
  }
4929
4764
  /**
4930
4765
  * HEXA 매트릭스에 장착한 HEXA 코어 정보를 조회합니다.
@@ -4940,6 +4775,7 @@ class MapleStoryApi {
4940
4775
  minute: 0,
4941
4776
  dateOffset: 1,
4942
4777
  })) {
4778
+ const path = 'maplestory/v1/character/hexamatrix';
4943
4779
  const query = {
4944
4780
  ocid: ocid,
4945
4781
  date: MapleStoryApi.toDateString({
@@ -4948,23 +4784,10 @@ class MapleStoryApi {
4948
4784
  day: 21,
4949
4785
  }, dateOptions),
4950
4786
  };
4951
- try {
4952
- const path = 'maplestory/v1/character/hexamatrix';
4953
- const response = await axios.get(path, {
4954
- baseURL: MapleStoryApi.BASE_URL,
4955
- timeout: this.timeout,
4956
- headers: this.buildHeaders(),
4957
- params: query,
4958
- });
4959
- return new CharacterHexaMatrixDto(response.data);
4960
- }
4961
- catch (e) {
4962
- if (e instanceof AxiosError) {
4963
- const errorBody = e.response.data;
4964
- throw new MapleStoryApiError(errorBody);
4965
- }
4966
- throw e;
4967
- }
4787
+ const { data } = await this.client.get(path, {
4788
+ params: query,
4789
+ });
4790
+ return new CharacterHexaMatrixDto(data);
4968
4791
  }
4969
4792
  /**
4970
4793
  * HEXA 매트릭스에 설정한 HEXA 스탯 정보를 조회합니다.
@@ -4980,6 +4803,7 @@ class MapleStoryApi {
4980
4803
  minute: 0,
4981
4804
  dateOffset: 1,
4982
4805
  })) {
4806
+ const path = 'maplestory/v1/character/hexamatrix-stat';
4983
4807
  const query = {
4984
4808
  ocid: ocid,
4985
4809
  date: MapleStoryApi.toDateString({
@@ -4988,23 +4812,10 @@ class MapleStoryApi {
4988
4812
  day: 21,
4989
4813
  }, dateOptions),
4990
4814
  };
4991
- try {
4992
- const path = 'maplestory/v1/character/hexamatrix-stat';
4993
- const response = await axios.get(path, {
4994
- baseURL: MapleStoryApi.BASE_URL,
4995
- timeout: this.timeout,
4996
- headers: this.buildHeaders(),
4997
- params: query,
4998
- });
4999
- return new CharacterHexaMatrixStatDto(response.data);
5000
- }
5001
- catch (e) {
5002
- if (e instanceof AxiosError) {
5003
- const errorBody = e.response.data;
5004
- throw new MapleStoryApiError(errorBody);
5005
- }
5006
- throw e;
5007
- }
4815
+ const { data } = await this.client.get(path, {
4816
+ params: query,
4817
+ });
4818
+ return new CharacterHexaMatrixStatDto(data);
5008
4819
  }
5009
4820
  /**
5010
4821
  * 캐릭터 무릉도장 최고 기록 정보를 조회합니다.
@@ -5020,6 +4831,7 @@ class MapleStoryApi {
5020
4831
  minute: 0,
5021
4832
  dateOffset: 1,
5022
4833
  })) {
4834
+ const path = 'maplestory/v1/character/dojang';
5023
4835
  const query = {
5024
4836
  ocid: ocid,
5025
4837
  date: MapleStoryApi.toDateString({
@@ -5028,23 +4840,10 @@ class MapleStoryApi {
5028
4840
  day: 21,
5029
4841
  }, dateOptions),
5030
4842
  };
5031
- try {
5032
- const path = 'maplestory/v1/character/dojang';
5033
- const response = await axios.get(path, {
5034
- baseURL: MapleStoryApi.BASE_URL,
5035
- timeout: this.timeout,
5036
- headers: this.buildHeaders(),
5037
- params: query,
5038
- });
5039
- return new CharacterDojangDto(response.data);
5040
- }
5041
- catch (e) {
5042
- if (e instanceof AxiosError) {
5043
- const errorBody = e.response.data;
5044
- throw new MapleStoryApiError(errorBody);
5045
- }
5046
- throw e;
5047
- }
4843
+ const { data } = await this.client.get(path, {
4844
+ params: query,
4845
+ });
4846
+ return new CharacterDojangDto(data);
5048
4847
  }
5049
4848
  //#endregion
5050
4849
  //#region 유니온 정보 조회
@@ -5062,6 +4861,7 @@ class MapleStoryApi {
5062
4861
  minute: 0,
5063
4862
  dateOffset: 1,
5064
4863
  })) {
4864
+ const path = 'maplestory/v1/user/union';
5065
4865
  const query = {
5066
4866
  ocid: ocid,
5067
4867
  date: MapleStoryApi.toDateString({
@@ -5070,23 +4870,10 @@ class MapleStoryApi {
5070
4870
  day: 21,
5071
4871
  }, dateOptions),
5072
4872
  };
5073
- try {
5074
- const path = 'maplestory/v1/user/union';
5075
- const response = await axios.get(path, {
5076
- baseURL: MapleStoryApi.BASE_URL,
5077
- timeout: this.timeout,
5078
- headers: this.buildHeaders(),
5079
- params: query,
5080
- });
5081
- return new UnionDto(response.data);
5082
- }
5083
- catch (e) {
5084
- if (e instanceof AxiosError) {
5085
- const errorBody = e.response.data;
5086
- throw new MapleStoryApiError(errorBody);
5087
- }
5088
- throw e;
5089
- }
4873
+ const { data } = await this.client.get(path, {
4874
+ params: query,
4875
+ });
4876
+ return new UnionDto(data);
5090
4877
  }
5091
4878
  /**
5092
4879
  * 유니온 공격대 정보를 조회합니다.
@@ -5102,6 +4889,7 @@ class MapleStoryApi {
5102
4889
  minute: 0,
5103
4890
  dateOffset: 1,
5104
4891
  })) {
4892
+ const path = 'maplestory/v1/user/union-raider';
5105
4893
  const query = {
5106
4894
  ocid: ocid,
5107
4895
  date: MapleStoryApi.toDateString({
@@ -5110,23 +4898,10 @@ class MapleStoryApi {
5110
4898
  day: 21,
5111
4899
  }, dateOptions),
5112
4900
  };
5113
- try {
5114
- const path = 'maplestory/v1/user/union-raider';
5115
- const response = await axios.get(path, {
5116
- baseURL: MapleStoryApi.BASE_URL,
5117
- timeout: this.timeout,
5118
- headers: this.buildHeaders(),
5119
- params: query,
5120
- });
5121
- return new UnionRaiderDto(response.data);
5122
- }
5123
- catch (e) {
5124
- if (e instanceof AxiosError) {
5125
- const errorBody = e.response.data;
5126
- throw new MapleStoryApiError(errorBody);
5127
- }
5128
- throw e;
5129
- }
4901
+ const { data } = await this.client.get(path, {
4902
+ params: query,
4903
+ });
4904
+ return new UnionRaiderDto(data);
5130
4905
  }
5131
4906
  /**
5132
4907
  * 유니온 아티팩트 정보를 조회합니다.
@@ -5142,6 +4917,7 @@ class MapleStoryApi {
5142
4917
  minute: 0,
5143
4918
  dateOffset: 1,
5144
4919
  })) {
4920
+ const path = 'maplestory/v1/user/union-artifact';
5145
4921
  const query = {
5146
4922
  ocid: ocid,
5147
4923
  date: MapleStoryApi.toDateString({
@@ -5150,23 +4926,10 @@ class MapleStoryApi {
5150
4926
  day: 21,
5151
4927
  }, dateOptions),
5152
4928
  };
5153
- try {
5154
- const path = 'maplestory/v1/user/union-artifact';
5155
- const response = await axios.get(path, {
5156
- baseURL: MapleStoryApi.BASE_URL,
5157
- timeout: this.timeout,
5158
- headers: this.buildHeaders(),
5159
- params: query,
5160
- });
5161
- return new UnionArtifactDto(response.data);
5162
- }
5163
- catch (e) {
5164
- if (e instanceof AxiosError) {
5165
- const errorBody = e.response.data;
5166
- throw new MapleStoryApiError(errorBody);
5167
- }
5168
- throw e;
5169
- }
4929
+ const { data } = await this.client.get(path, {
4930
+ params: query,
4931
+ });
4932
+ return new UnionArtifactDto(data);
5170
4933
  }
5171
4934
  //#endregion
5172
4935
  //#region 길드 정보 조회
@@ -5180,26 +4943,14 @@ class MapleStoryApi {
5180
4943
  * @param worldName 월드 명
5181
4944
  */
5182
4945
  async getGuild(guildName, worldName) {
5183
- try {
5184
- const path = 'maplestory/v1/guild/id';
5185
- const response = await axios.get(path, {
5186
- baseURL: MapleStoryApi.BASE_URL,
5187
- timeout: this.timeout,
5188
- headers: this.buildHeaders(),
5189
- params: {
5190
- guild_name: guildName,
5191
- world_name: worldName,
5192
- },
5193
- });
5194
- return new GuildDto(response.data);
5195
- }
5196
- catch (e) {
5197
- if (e instanceof AxiosError) {
5198
- const errorBody = e.response.data;
5199
- throw new MapleStoryApiError(errorBody);
5200
- }
5201
- throw e;
5202
- }
4946
+ const path = 'maplestory/v1/guild/id';
4947
+ const { data } = await this.client.get(path, {
4948
+ params: {
4949
+ guild_name: guildName,
4950
+ world_name: worldName,
4951
+ },
4952
+ });
4953
+ return new GuildDto(data);
5203
4954
  }
5204
4955
  /**
5205
4956
  * 길드 기본 정보를 조회합니다.
@@ -5215,6 +4966,7 @@ class MapleStoryApi {
5215
4966
  minute: 0,
5216
4967
  dateOffset: 1,
5217
4968
  })) {
4969
+ const path = 'maplestory/v1/guild/basic';
5218
4970
  const query = {
5219
4971
  oguild_id: guildId,
5220
4972
  date: MapleStoryApi.toDateString({
@@ -5223,25 +4975,13 @@ class MapleStoryApi {
5223
4975
  day: 21,
5224
4976
  }, dateOptions),
5225
4977
  };
5226
- try {
5227
- const path = 'maplestory/v1/guild/basic';
5228
- const response = await axios.get(path, {
5229
- baseURL: MapleStoryApi.BASE_URL,
5230
- timeout: this.timeout,
5231
- headers: this.buildHeaders(),
5232
- params: query,
5233
- });
5234
- return new GuildBasicDto(response.data);
5235
- }
5236
- catch (e) {
5237
- if (e instanceof AxiosError) {
5238
- const errorBody = e.response.data;
5239
- throw new MapleStoryApiError(errorBody);
5240
- }
5241
- throw e;
5242
- }
4978
+ const { data } = await this.client.get(path, {
4979
+ params: query,
4980
+ });
4981
+ return new GuildBasicDto(data);
5243
4982
  }
5244
4983
  async getStarforceHistory(count, parameter) {
4984
+ const path = 'maplestory/v1/history/starforce';
5245
4985
  const query = {
5246
4986
  count,
5247
4987
  };
@@ -5260,25 +5000,13 @@ class MapleStoryApi {
5260
5000
  dateOffset: 0,
5261
5001
  }));
5262
5002
  }
5263
- try {
5264
- const path = 'maplestory/v1/history/starforce';
5265
- const response = await axios.get(path, {
5266
- baseURL: MapleStoryApi.BASE_URL,
5267
- timeout: this.timeout,
5268
- headers: this.buildHeaders(),
5269
- params: query,
5270
- });
5271
- return new StarforceHistoryResponseDto(response.data);
5272
- }
5273
- catch (e) {
5274
- if (e instanceof AxiosError) {
5275
- const errorBody = e.response.data;
5276
- throw new MapleStoryApiError(errorBody);
5277
- }
5278
- throw e;
5279
- }
5003
+ const { data } = await this.client.get(path, {
5004
+ params: query,
5005
+ });
5006
+ return new StarforceHistoryResponseDto(data);
5280
5007
  }
5281
5008
  async getCubeHistory(count, parameter) {
5009
+ const path = 'maplestory/v1/history/cube';
5282
5010
  const query = {
5283
5011
  count,
5284
5012
  };
@@ -5297,25 +5025,13 @@ class MapleStoryApi {
5297
5025
  dateOffset: 1,
5298
5026
  }));
5299
5027
  }
5300
- try {
5301
- const path = 'maplestory/v1/history/cube';
5302
- const response = await axios.get(path, {
5303
- baseURL: MapleStoryApi.BASE_URL,
5304
- timeout: this.timeout,
5305
- headers: this.buildHeaders(),
5306
- params: query,
5307
- });
5308
- return new CubeHistoryResponseDto(response.data);
5309
- }
5310
- catch (e) {
5311
- if (e instanceof AxiosError) {
5312
- const errorBody = e.response.data;
5313
- throw new MapleStoryApiError(errorBody);
5314
- }
5315
- throw e;
5316
- }
5028
+ const { data } = await this.client.get(path, {
5029
+ params: query,
5030
+ });
5031
+ return new CubeHistoryResponseDto(data);
5317
5032
  }
5318
5033
  async getPotentialHistory(count, parameter) {
5034
+ const path = 'maplestory/v1/history/potential';
5319
5035
  const query = {
5320
5036
  count,
5321
5037
  };
@@ -5334,23 +5050,10 @@ class MapleStoryApi {
5334
5050
  dateOffset: 1,
5335
5051
  }));
5336
5052
  }
5337
- try {
5338
- const path = 'maplestory/v1/history/potential';
5339
- const response = await axios.get(path, {
5340
- baseURL: MapleStoryApi.BASE_URL,
5341
- timeout: this.timeout,
5342
- headers: this.buildHeaders(),
5343
- params: query,
5344
- });
5345
- return new PotentialHistoryResponseDto(response.data);
5346
- }
5347
- catch (e) {
5348
- if (e instanceof AxiosError) {
5349
- const errorBody = e.response.data;
5350
- throw new MapleStoryApiError(errorBody);
5351
- }
5352
- throw e;
5353
- }
5053
+ const { data } = await this.client.get(path, {
5054
+ params: query,
5055
+ });
5056
+ return new PotentialHistoryResponseDto(data);
5354
5057
  }
5355
5058
  //#endregion
5356
5059
  //#region 랭킹 정보 조회
@@ -5369,6 +5072,7 @@ class MapleStoryApi {
5369
5072
  minute: 30,
5370
5073
  dateOffset: 0,
5371
5074
  })) {
5075
+ const path = 'maplestory/v1/ranking/overall';
5372
5076
  const query = {
5373
5077
  date: MapleStoryApi.toDateString({
5374
5078
  year: 2023,
@@ -5384,23 +5088,10 @@ class MapleStoryApi {
5384
5088
  query.ocid = ocid;
5385
5089
  query.page = page;
5386
5090
  }
5387
- try {
5388
- const path = 'maplestory/v1/ranking/overall';
5389
- const response = await axios.get(path, {
5390
- baseURL: MapleStoryApi.BASE_URL,
5391
- timeout: this.timeout,
5392
- headers: this.buildHeaders(),
5393
- params: query,
5394
- });
5395
- return new OverallRankingResponseDto(response.data);
5396
- }
5397
- catch (e) {
5398
- if (e instanceof AxiosError) {
5399
- const errorBody = e.response.data;
5400
- throw new MapleStoryApiError(errorBody);
5401
- }
5402
- throw e;
5403
- }
5091
+ const { data } = await this.client.get(path, {
5092
+ params: query,
5093
+ });
5094
+ return new OverallRankingResponseDto(data);
5404
5095
  }
5405
5096
  /**
5406
5097
  * 유니온 랭킹 정보를 조회합니다.
@@ -5416,6 +5107,7 @@ class MapleStoryApi {
5416
5107
  minute: 30,
5417
5108
  dateOffset: 0,
5418
5109
  })) {
5110
+ const path = 'maplestory/v1/ranking/union';
5419
5111
  const query = {
5420
5112
  date: MapleStoryApi.toDateString({
5421
5113
  year: 2023,
@@ -5429,23 +5121,10 @@ class MapleStoryApi {
5429
5121
  query.ocid = ocid;
5430
5122
  query.page = page;
5431
5123
  }
5432
- try {
5433
- const path = 'maplestory/v1/ranking/union';
5434
- const response = await axios.get(path, {
5435
- baseURL: MapleStoryApi.BASE_URL,
5436
- timeout: this.timeout,
5437
- headers: this.buildHeaders(),
5438
- params: query,
5439
- });
5440
- return new UnionRankingResponseDto(response.data);
5441
- }
5442
- catch (e) {
5443
- if (e instanceof AxiosError) {
5444
- const errorBody = e.response.data;
5445
- throw new MapleStoryApiError(errorBody);
5446
- }
5447
- throw e;
5448
- }
5124
+ const { data } = await this.client.get(path, {
5125
+ params: query,
5126
+ });
5127
+ return new UnionRankingResponseDto(data);
5449
5128
  }
5450
5129
  /**
5451
5130
  * 길드 랭킹 정보를 조회합니다.
@@ -5461,6 +5140,7 @@ class MapleStoryApi {
5461
5140
  minute: 30,
5462
5141
  dateOffset: 0,
5463
5142
  })) {
5143
+ const path = 'maplestory/v1/ranking/guild';
5464
5144
  const query = {
5465
5145
  date: MapleStoryApi.toDateString({
5466
5146
  year: 2023,
@@ -5476,23 +5156,10 @@ class MapleStoryApi {
5476
5156
  query.ocid = ocid;
5477
5157
  query.page = page;
5478
5158
  }
5479
- try {
5480
- const path = 'maplestory/v1/ranking/guild';
5481
- const response = await axios.get(path, {
5482
- baseURL: MapleStoryApi.BASE_URL,
5483
- timeout: this.timeout,
5484
- headers: this.buildHeaders(),
5485
- params: query,
5486
- });
5487
- return new GuildRankingResponseDto(response.data);
5488
- }
5489
- catch (e) {
5490
- if (e instanceof AxiosError) {
5491
- const errorBody = e.response.data;
5492
- throw new MapleStoryApiError(errorBody);
5493
- }
5494
- throw e;
5495
- }
5159
+ const { data } = await this.client.get(path, {
5160
+ params: query,
5161
+ });
5162
+ return new GuildRankingResponseDto(data);
5496
5163
  }
5497
5164
  /**
5498
5165
  * 무릉도장 랭킹 정보를 조회합니다.
@@ -5508,6 +5175,7 @@ class MapleStoryApi {
5508
5175
  minute: 30,
5509
5176
  dateOffset: 0,
5510
5177
  })) {
5178
+ const path = 'maplestory/v1/ranking/dojang';
5511
5179
  const query = {
5512
5180
  date: MapleStoryApi.toDateString({
5513
5181
  year: 2023,
@@ -5524,23 +5192,10 @@ class MapleStoryApi {
5524
5192
  query.ocid = ocid;
5525
5193
  query.page = page;
5526
5194
  }
5527
- try {
5528
- const path = 'maplestory/v1/ranking/dojang';
5529
- const response = await axios.get(path, {
5530
- baseURL: MapleStoryApi.BASE_URL,
5531
- timeout: this.timeout,
5532
- headers: this.buildHeaders(),
5533
- params: query,
5534
- });
5535
- return new DojangRankingResponseDto(response.data);
5536
- }
5537
- catch (e) {
5538
- if (e instanceof AxiosError) {
5539
- const errorBody = e.response.data;
5540
- throw new MapleStoryApiError(errorBody);
5541
- }
5542
- throw e;
5543
- }
5195
+ const { data } = await this.client.get(path, {
5196
+ params: query,
5197
+ });
5198
+ return new DojangRankingResponseDto(data);
5544
5199
  }
5545
5200
  /**
5546
5201
  * 더 시드 랭킹 정보를 조회합니다.
@@ -5556,6 +5211,7 @@ class MapleStoryApi {
5556
5211
  minute: 30,
5557
5212
  dateOffset: 0,
5558
5213
  })) {
5214
+ const path = 'maplestory/v1/ranking/theseed';
5559
5215
  const query = {
5560
5216
  date: MapleStoryApi.toDateString({
5561
5217
  year: 2023,
@@ -5569,23 +5225,10 @@ class MapleStoryApi {
5569
5225
  query.ocid = ocid;
5570
5226
  query.page = page;
5571
5227
  }
5572
- try {
5573
- const path = 'maplestory/v1/ranking/theseed';
5574
- const response = await axios.get(path, {
5575
- baseURL: MapleStoryApi.BASE_URL,
5576
- timeout: this.timeout,
5577
- headers: this.buildHeaders(),
5578
- params: query,
5579
- });
5580
- return new TheSeedRankingResponseDto(response.data);
5581
- }
5582
- catch (e) {
5583
- if (e instanceof AxiosError) {
5584
- const errorBody = e.response.data;
5585
- throw new MapleStoryApiError(errorBody);
5586
- }
5587
- throw e;
5588
- }
5228
+ const { data } = await this.client.get(path, {
5229
+ params: query,
5230
+ });
5231
+ return new TheSeedRankingResponseDto(data);
5589
5232
  }
5590
5233
  /**
5591
5234
  * 업적 랭킹 정보를 조회합니다.
@@ -5601,6 +5244,7 @@ class MapleStoryApi {
5601
5244
  minute: 30,
5602
5245
  dateOffset: 0,
5603
5246
  })) {
5247
+ const path = 'maplestory/v1/ranking/achievement';
5604
5248
  const query = {
5605
5249
  date: MapleStoryApi.toDateString({
5606
5250
  year: 2023,
@@ -5613,23 +5257,10 @@ class MapleStoryApi {
5613
5257
  query.ocid = ocid;
5614
5258
  query.page = page;
5615
5259
  }
5616
- try {
5617
- const path = 'maplestory/v1/ranking/achievement';
5618
- const response = await axios.get(path, {
5619
- baseURL: MapleStoryApi.BASE_URL,
5620
- timeout: this.timeout,
5621
- headers: this.buildHeaders(),
5622
- params: query,
5623
- });
5624
- return new AchievementRankingResponseDto(response.data);
5625
- }
5626
- catch (e) {
5627
- if (e instanceof AxiosError) {
5628
- const errorBody = e.response.data;
5629
- throw new MapleStoryApiError(errorBody);
5630
- }
5631
- throw e;
5632
- }
5260
+ const { data } = await this.client.get(path, {
5261
+ params: query,
5262
+ });
5263
+ return new AchievementRankingResponseDto(data);
5633
5264
  }
5634
5265
  //#endregion
5635
5266
  /**
@@ -5668,11 +5299,6 @@ class MapleStoryApi {
5668
5299
  const xml = (await xml2js.parseStringPromise(response.data));
5669
5300
  return new InspectionInfoDto(xml);
5670
5301
  }
5671
- buildHeaders() {
5672
- return {
5673
- 'x-nxopen-api-key': this.apiKey,
5674
- };
5675
- }
5676
5302
  /**
5677
5303
  * API 서버의 데이터 갱신 시간에 따라 데이터가 조회 가능한 최신 날짜를 반환합니다.
5678
5304
  *