maplestory-openapi 2.12.0 → 2.13.0

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.js CHANGED
@@ -7345,6 +7345,78 @@ class UnionArtifactDto {
7345
7345
  }
7346
7346
  }
7347
7347
 
7348
+ /**
7349
+ * 유니온 챔피언 휘장 정보
7350
+ */
7351
+ class UnionChampionBadgeInfoDto {
7352
+ /**
7353
+ * 유니온 챔피언 휘장 효과
7354
+ */
7355
+ stat;
7356
+ constructor(obj) {
7357
+ const { stat } = obj;
7358
+ this.stat = stat;
7359
+ }
7360
+ }
7361
+
7362
+ /**
7363
+ * 유니온 챔피언 상세 정보
7364
+ */
7365
+ class UnionChampionInfoDto {
7366
+ /**
7367
+ * 유니온 챔피언 캐릭터 명
7368
+ */
7369
+ championName;
7370
+ /**
7371
+ * 유니온 챔피언 슬롯
7372
+ */
7373
+ championSlot;
7374
+ /**
7375
+ * 유니온 챔피언 등급
7376
+ */
7377
+ championGrade;
7378
+ /**
7379
+ * 유니온 챔피언 캐릭터의 직업
7380
+ */
7381
+ championClass;
7382
+ /**
7383
+ * 챔피언 휘장 효과
7384
+ */
7385
+ championBadgeInfo;
7386
+ constructor(obj) {
7387
+ const { champion_name, champion_slot, champion_grade, champion_class, champion_badge_info } = obj;
7388
+ this.championName = champion_name;
7389
+ this.championSlot = champion_slot;
7390
+ this.championGrade = champion_grade;
7391
+ this.championClass = champion_class;
7392
+ this.championBadgeInfo = champion_badge_info.map((info) => new UnionChampionBadgeInfoDto(info));
7393
+ }
7394
+ }
7395
+
7396
+ /**
7397
+ * 유니온 챔피언 정보
7398
+ */
7399
+ class UnionChampionDto {
7400
+ /**
7401
+ * 조회 기준일
7402
+ */
7403
+ date;
7404
+ /**
7405
+ * 유니온 챔피언 정보
7406
+ */
7407
+ unionChampion;
7408
+ /**
7409
+ * 유니온 챔피언 휘장 정보
7410
+ */
7411
+ championBadgeTotalInfo;
7412
+ constructor(obj) {
7413
+ const { date, union_champion, champion_badge_total_info } = obj;
7414
+ this.date = date ? new Date(date) : null;
7415
+ this.unionChampion = union_champion.map((info) => new UnionChampionInfoDto(info));
7416
+ this.championBadgeTotalInfo = champion_badge_total_info.map((info) => new UnionChampionBadgeInfoDto(info));
7417
+ }
7418
+ }
7419
+
7348
7420
  /**
7349
7421
  * 유니온 정보
7350
7422
  */
@@ -7622,73 +7694,6 @@ const errorMap = {
7622
7694
  ['OPENAPI00011']: exports.MapleStoryApiErrorCode.OPENAPI00011,
7623
7695
  };
7624
7696
 
7625
- /**
7626
- * 유니온 챔피언 휘장 정보
7627
- */
7628
- class UnionChampionBadgeInfoDto {
7629
- /**
7630
- * 유니온 챔피언 휘장 효과
7631
- */
7632
- stat;
7633
- constructor(obj) {
7634
- const { stat } = obj;
7635
- this.stat = stat;
7636
- }
7637
- }
7638
-
7639
- /**
7640
- * 유니온 챔피언 상세 정보
7641
- */
7642
- class UnionChampionInfoDto {
7643
- /**
7644
- * 유니온 챔피언 슬롯
7645
- */
7646
- championSlot;
7647
- /**
7648
- * 유니온 챔피언 등급
7649
- */
7650
- championGrade;
7651
- /**
7652
- * 유니온 챔피언 캐릭터의 직업
7653
- */
7654
- championClass;
7655
- /**
7656
- * 챔피언 휘장 효과
7657
- */
7658
- championBadgeInfo;
7659
- constructor(obj) {
7660
- const { champion_slot, champion_grade, champion_class, champion_badge_info } = obj;
7661
- this.championSlot = champion_slot;
7662
- this.championGrade = champion_grade;
7663
- this.championClass = champion_class;
7664
- this.championBadgeInfo = champion_badge_info.map((info) => new UnionChampionBadgeInfoDto(info));
7665
- }
7666
- }
7667
-
7668
- /**
7669
- * 유니온 챔피언 정보
7670
- */
7671
- class UnionChampionDto {
7672
- /**
7673
- * 조회 기준일
7674
- */
7675
- date;
7676
- /**
7677
- * 유니온 챔피언 정보
7678
- */
7679
- unionChampion;
7680
- /**
7681
- * 유니온 챔피언 휘장 정보
7682
- */
7683
- championBadgeTotalInfo;
7684
- constructor(obj) {
7685
- const { date, union_champion, champion_badge_total_info } = obj;
7686
- this.date = date ? new Date(date) : null;
7687
- this.unionChampion = union_champion.map((info) => new UnionChampionInfoDto(info));
7688
- this.championBadgeTotalInfo = champion_badge_total_info.map((info) => new UnionChampionBadgeInfoDto(info));
7689
- }
7690
- }
7691
-
7692
7697
  dayjs__default["default"].extend(timezone);
7693
7698
  dayjs__default["default"].extend(utc);
7694
7699
  /**
@@ -7700,7 +7705,6 @@ class MapleStoryApi {
7700
7705
  client;
7701
7706
  static BASE_URL = 'https://open.api.nexon.com/';
7702
7707
  static DEFAULT_TIMEOUT = 5000;
7703
- static kstOffset = 540;
7704
7708
  get timeout() {
7705
7709
  return this.client.defaults.timeout;
7706
7710
  }
@@ -7767,11 +7771,11 @@ class MapleStoryApi {
7767
7771
  async getCharacterBasic(ocid, dateOptions) {
7768
7772
  const path = 'maplestory/v1/character/basic';
7769
7773
  const date = dateOptions
7770
- ? MapleStoryApi.toDateString({
7774
+ ? toDateString(dateOptions, {
7771
7775
  year: 2023,
7772
7776
  month: 12,
7773
7777
  day: 21,
7774
- }, dateOptions)
7778
+ })
7775
7779
  : undefined;
7776
7780
  const query = {
7777
7781
  ocid: ocid,
@@ -7855,11 +7859,11 @@ class MapleStoryApi {
7855
7859
  async getCharacterPopularity(ocid, dateOptions) {
7856
7860
  const path = 'maplestory/v1/character/popularity';
7857
7861
  const date = dateOptions
7858
- ? MapleStoryApi.toDateString({
7862
+ ? toDateString(dateOptions, {
7859
7863
  year: 2023,
7860
7864
  month: 12,
7861
7865
  day: 21,
7862
- }, dateOptions)
7866
+ })
7863
7867
  : undefined;
7864
7868
  const query = {
7865
7869
  ocid: ocid,
@@ -7883,11 +7887,11 @@ class MapleStoryApi {
7883
7887
  async getCharacterStat(ocid, dateOptions) {
7884
7888
  const path = 'maplestory/v1/character/stat';
7885
7889
  const date = dateOptions
7886
- ? MapleStoryApi.toDateString({
7890
+ ? toDateString(dateOptions, {
7887
7891
  year: 2023,
7888
7892
  month: 12,
7889
7893
  day: 21,
7890
- }, dateOptions)
7894
+ })
7891
7895
  : undefined;
7892
7896
  const query = {
7893
7897
  ocid: ocid,
@@ -7911,11 +7915,11 @@ class MapleStoryApi {
7911
7915
  async getCharacterHyperStat(ocid, dateOptions) {
7912
7916
  const path = 'maplestory/v1/character/hyper-stat';
7913
7917
  const date = dateOptions
7914
- ? MapleStoryApi.toDateString({
7918
+ ? toDateString(dateOptions, {
7915
7919
  year: 2023,
7916
7920
  month: 12,
7917
7921
  day: 21,
7918
- }, dateOptions)
7922
+ })
7919
7923
  : undefined;
7920
7924
  const query = {
7921
7925
  ocid: ocid,
@@ -7939,11 +7943,11 @@ class MapleStoryApi {
7939
7943
  async getCharacterPropensity(ocid, dateOptions) {
7940
7944
  const path = 'maplestory/v1/character/propensity';
7941
7945
  const date = dateOptions
7942
- ? MapleStoryApi.toDateString({
7946
+ ? toDateString(dateOptions, {
7943
7947
  year: 2023,
7944
7948
  month: 12,
7945
7949
  day: 21,
7946
- }, dateOptions)
7950
+ })
7947
7951
  : undefined;
7948
7952
  const query = {
7949
7953
  ocid: ocid,
@@ -7967,11 +7971,11 @@ class MapleStoryApi {
7967
7971
  async getCharacterAbility(ocid, dateOptions) {
7968
7972
  const path = 'maplestory/v1/character/ability';
7969
7973
  const date = dateOptions
7970
- ? MapleStoryApi.toDateString({
7974
+ ? toDateString(dateOptions, {
7971
7975
  year: 2023,
7972
7976
  month: 12,
7973
7977
  day: 21,
7974
- }, dateOptions)
7978
+ })
7975
7979
  : undefined;
7976
7980
  const query = {
7977
7981
  ocid: ocid,
@@ -7995,11 +7999,11 @@ class MapleStoryApi {
7995
7999
  async getCharacterItemEquipment(ocid, dateOptions) {
7996
8000
  const path = 'maplestory/v1/character/item-equipment';
7997
8001
  const date = dateOptions
7998
- ? MapleStoryApi.toDateString({
8002
+ ? toDateString(dateOptions, {
7999
8003
  year: 2023,
8000
8004
  month: 12,
8001
8005
  day: 21,
8002
- }, dateOptions)
8006
+ })
8003
8007
  : undefined;
8004
8008
  const query = {
8005
8009
  ocid: ocid,
@@ -8023,11 +8027,11 @@ class MapleStoryApi {
8023
8027
  async getCharacterCashItemEquipment(ocid, dateOptions) {
8024
8028
  const path = 'maplestory/v1/character/cashitem-equipment';
8025
8029
  const date = dateOptions
8026
- ? MapleStoryApi.toDateString({
8030
+ ? toDateString(dateOptions, {
8027
8031
  year: 2023,
8028
8032
  month: 12,
8029
8033
  day: 21,
8030
- }, dateOptions)
8034
+ })
8031
8035
  : undefined;
8032
8036
  const query = {
8033
8037
  ocid: ocid,
@@ -8051,11 +8055,11 @@ class MapleStoryApi {
8051
8055
  async getCharacterSymbolEquipment(ocid, dateOptions) {
8052
8056
  const path = 'maplestory/v1/character/symbol-equipment';
8053
8057
  const date = dateOptions
8054
- ? MapleStoryApi.toDateString({
8058
+ ? toDateString(dateOptions, {
8055
8059
  year: 2023,
8056
8060
  month: 12,
8057
8061
  day: 21,
8058
- }, dateOptions)
8062
+ })
8059
8063
  : undefined;
8060
8064
  const query = {
8061
8065
  ocid: ocid,
@@ -8079,11 +8083,11 @@ class MapleStoryApi {
8079
8083
  async getCharacterSetEffect(ocid, dateOptions) {
8080
8084
  const path = 'maplestory/v1/character/set-effect';
8081
8085
  const date = dateOptions
8082
- ? MapleStoryApi.toDateString({
8086
+ ? toDateString(dateOptions, {
8083
8087
  year: 2023,
8084
8088
  month: 12,
8085
8089
  day: 21,
8086
- }, dateOptions)
8090
+ })
8087
8091
  : undefined;
8088
8092
  const query = {
8089
8093
  ocid: ocid,
@@ -8106,13 +8110,16 @@ class MapleStoryApi {
8106
8110
  */
8107
8111
  async getCharacterBeautyEquipment(ocid, dateOptions) {
8108
8112
  const path = 'maplestory/v1/character/beauty-equipment';
8109
- const query = {
8110
- ocid: ocid,
8111
- date: dateOptions ? MapleStoryApi.toDateString({
8113
+ const date = dateOptions
8114
+ ? toDateString(dateOptions, {
8112
8115
  year: 2023,
8113
8116
  month: 12,
8114
8117
  day: 21,
8115
- }, dateOptions) : undefined,
8118
+ })
8119
+ : undefined;
8120
+ const query = {
8121
+ ocid: ocid,
8122
+ date: date,
8116
8123
  };
8117
8124
  const { data } = await this.client.get(path, {
8118
8125
  params: query,
@@ -8132,11 +8139,11 @@ class MapleStoryApi {
8132
8139
  async getCharacterAndroidEquipment(ocid, dateOptions) {
8133
8140
  const path = 'maplestory/v1/character/android-equipment';
8134
8141
  const date = dateOptions
8135
- ? MapleStoryApi.toDateString({
8142
+ ? toDateString(dateOptions, {
8136
8143
  year: 2023,
8137
8144
  month: 12,
8138
8145
  day: 21,
8139
- }, dateOptions)
8146
+ })
8140
8147
  : undefined;
8141
8148
  const query = {
8142
8149
  ocid: ocid,
@@ -8160,11 +8167,11 @@ class MapleStoryApi {
8160
8167
  async getCharacterPetEquipment(ocid, dateOptions) {
8161
8168
  const path = 'maplestory/v1/character/pet-equipment';
8162
8169
  const date = dateOptions
8163
- ? MapleStoryApi.toDateString({
8170
+ ? toDateString(dateOptions, {
8164
8171
  year: 2023,
8165
8172
  month: 12,
8166
8173
  day: 21,
8167
- }, dateOptions)
8174
+ })
8168
8175
  : undefined;
8169
8176
  const query = {
8170
8177
  ocid: ocid,
@@ -8200,11 +8207,11 @@ class MapleStoryApi {
8200
8207
  async getCharacterSkill(ocid, characterSkillGrade, dateOptions) {
8201
8208
  const path = 'maplestory/v1/character/skill';
8202
8209
  const date = dateOptions
8203
- ? MapleStoryApi.toDateString({
8210
+ ? toDateString(dateOptions, {
8204
8211
  year: 2023,
8205
8212
  month: 12,
8206
8213
  day: 21,
8207
- }, dateOptions)
8214
+ })
8208
8215
  : undefined;
8209
8216
  const query = {
8210
8217
  ocid: ocid,
@@ -8229,11 +8236,11 @@ class MapleStoryApi {
8229
8236
  async getCharacterLinkSkill(ocid, dateOptions) {
8230
8237
  const path = 'maplestory/v1/character/link-skill';
8231
8238
  const date = dateOptions
8232
- ? MapleStoryApi.toDateString({
8239
+ ? toDateString(dateOptions, {
8233
8240
  year: 2023,
8234
8241
  month: 12,
8235
8242
  day: 21,
8236
- }, dateOptions)
8243
+ })
8237
8244
  : undefined;
8238
8245
  const query = {
8239
8246
  ocid: ocid,
@@ -8257,11 +8264,11 @@ class MapleStoryApi {
8257
8264
  async getCharacterVMatrix(ocid, dateOptions) {
8258
8265
  const path = 'maplestory/v1/character/vmatrix';
8259
8266
  const date = dateOptions
8260
- ? MapleStoryApi.toDateString({
8267
+ ? toDateString(dateOptions, {
8261
8268
  year: 2023,
8262
8269
  month: 12,
8263
8270
  day: 21,
8264
- }, dateOptions)
8271
+ })
8265
8272
  : undefined;
8266
8273
  const query = {
8267
8274
  ocid: ocid,
@@ -8285,11 +8292,11 @@ class MapleStoryApi {
8285
8292
  async getCharacterHexaMatrix(ocid, dateOptions) {
8286
8293
  const path = 'maplestory/v1/character/hexamatrix';
8287
8294
  const date = dateOptions
8288
- ? MapleStoryApi.toDateString({
8295
+ ? toDateString(dateOptions, {
8289
8296
  year: 2023,
8290
8297
  month: 12,
8291
8298
  day: 21,
8292
- }, dateOptions)
8299
+ })
8293
8300
  : undefined;
8294
8301
  const query = {
8295
8302
  ocid: ocid,
@@ -8313,11 +8320,11 @@ class MapleStoryApi {
8313
8320
  async getCharacterHexaMatrixStat(ocid, dateOptions) {
8314
8321
  const path = 'maplestory/v1/character/hexamatrix-stat';
8315
8322
  const date = dateOptions
8316
- ? MapleStoryApi.toDateString({
8323
+ ? toDateString(dateOptions, {
8317
8324
  year: 2023,
8318
8325
  month: 12,
8319
8326
  day: 21,
8320
- }, dateOptions)
8327
+ })
8321
8328
  : undefined;
8322
8329
  const query = {
8323
8330
  ocid: ocid,
@@ -8341,11 +8348,11 @@ class MapleStoryApi {
8341
8348
  async getCharacterDojang(ocid, dateOptions) {
8342
8349
  const path = 'maplestory/v1/character/dojang';
8343
8350
  const date = dateOptions
8344
- ? MapleStoryApi.toDateString({
8351
+ ? toDateString(dateOptions, {
8345
8352
  year: 2023,
8346
8353
  month: 12,
8347
8354
  day: 21,
8348
- }, dateOptions)
8355
+ })
8349
8356
  : undefined;
8350
8357
  const query = {
8351
8358
  ocid: ocid,
@@ -8371,11 +8378,11 @@ class MapleStoryApi {
8371
8378
  async getUnion(ocid, dateOptions) {
8372
8379
  const path = 'maplestory/v1/user/union';
8373
8380
  const date = dateOptions
8374
- ? MapleStoryApi.toDateString({
8381
+ ? toDateString(dateOptions, {
8375
8382
  year: 2023,
8376
8383
  month: 12,
8377
8384
  day: 21,
8378
- }, dateOptions)
8385
+ })
8379
8386
  : undefined;
8380
8387
  const query = {
8381
8388
  ocid: ocid,
@@ -8399,11 +8406,11 @@ class MapleStoryApi {
8399
8406
  async getUnionRaider(ocid, dateOptions) {
8400
8407
  const path = 'maplestory/v1/user/union-raider';
8401
8408
  const date = dateOptions
8402
- ? MapleStoryApi.toDateString({
8409
+ ? toDateString(dateOptions, {
8403
8410
  year: 2023,
8404
8411
  month: 12,
8405
8412
  day: 21,
8406
- }, dateOptions)
8413
+ })
8407
8414
  : undefined;
8408
8415
  const query = {
8409
8416
  ocid: ocid,
@@ -8427,11 +8434,11 @@ class MapleStoryApi {
8427
8434
  async getUnionArtifact(ocid, dateOptions) {
8428
8435
  const path = 'maplestory/v1/user/union-artifact';
8429
8436
  const date = dateOptions
8430
- ? MapleStoryApi.toDateString({
8437
+ ? toDateString(dateOptions, {
8431
8438
  year: 2023,
8432
8439
  month: 12,
8433
8440
  day: 21,
8434
- }, dateOptions)
8441
+ })
8435
8442
  : undefined;
8436
8443
  const query = {
8437
8444
  ocid: ocid,
@@ -8456,11 +8463,11 @@ class MapleStoryApi {
8456
8463
  async getUnionChampion(ocid, dateOptions) {
8457
8464
  const path = 'maplestory/v1/user/union-champion';
8458
8465
  const date = dateOptions
8459
- ? MapleStoryApi.toDateString({
8466
+ ? toDateString(dateOptions, {
8460
8467
  year: 2023,
8461
8468
  month: 12,
8462
8469
  day: 21,
8463
- }, dateOptions)
8470
+ })
8464
8471
  : undefined;
8465
8472
  const query = {
8466
8473
  ocid: ocid,
@@ -8506,11 +8513,11 @@ class MapleStoryApi {
8506
8513
  async getGuildBasic(guildId, dateOptions) {
8507
8514
  const path = 'maplestory/v1/guild/basic';
8508
8515
  const date = dateOptions
8509
- ? MapleStoryApi.toDateString({
8516
+ ? toDateString(dateOptions, {
8510
8517
  year: 2023,
8511
8518
  month: 12,
8512
8519
  day: 21,
8513
- }, dateOptions)
8520
+ })
8514
8521
  : undefined;
8515
8522
  const query = {
8516
8523
  oguild_id: guildId,
@@ -8530,16 +8537,16 @@ class MapleStoryApi {
8530
8537
  query.cursor = parameter;
8531
8538
  }
8532
8539
  else if (typeof parameter === 'object' || parameter === undefined) {
8533
- query.date = MapleStoryApi.toDateString({
8534
- year: 2023,
8535
- month: 12,
8536
- day: 27,
8537
- }, parameter ??
8538
- MapleStoryApi.getProperDefaultDateOptions({
8540
+ query.date = toDateString(parameter ??
8541
+ getProperDefaultDateOptions({
8539
8542
  hour: 0,
8540
8543
  minute: 0,
8541
8544
  dateOffset: 0,
8542
- }));
8545
+ }), {
8546
+ year: 2023,
8547
+ month: 12,
8548
+ day: 27,
8549
+ });
8543
8550
  }
8544
8551
  const { data } = await this.client.get(path, {
8545
8552
  params: query,
@@ -8555,15 +8562,11 @@ class MapleStoryApi {
8555
8562
  query.cursor = parameter;
8556
8563
  }
8557
8564
  else if (typeof parameter === 'object' || parameter === undefined) {
8558
- query.date = MapleStoryApi.toDateString({
8559
- year: 2022,
8560
- month: 11,
8561
- day: 25,
8562
- }, parameter ??
8563
- MapleStoryApi.getProperDefaultDateOptions({
8564
- hour: 4,
8565
+ query.date = toDateString(parameter ??
8566
+ getProperDefaultDateOptions({
8567
+ hour: 0,
8565
8568
  minute: 0,
8566
- dateOffset: 1,
8569
+ dateOffset: 0,
8567
8570
  }));
8568
8571
  }
8569
8572
  const { data } = await this.client.get(path, {
@@ -8580,16 +8583,16 @@ class MapleStoryApi {
8580
8583
  query.cursor = parameter;
8581
8584
  }
8582
8585
  else if (typeof parameter === 'object' || parameter === undefined) {
8583
- query.date = MapleStoryApi.toDateString({
8586
+ query.date = toDateString(parameter ??
8587
+ getProperDefaultDateOptions({
8588
+ hour: 0,
8589
+ minute: 0,
8590
+ dateOffset: 0,
8591
+ }), {
8584
8592
  year: 2024,
8585
8593
  month: 1,
8586
8594
  day: 25,
8587
- }, parameter ??
8588
- MapleStoryApi.getProperDefaultDateOptions({
8589
- hour: 4,
8590
- minute: 0,
8591
- dateOffset: 1,
8592
- }));
8595
+ });
8593
8596
  }
8594
8597
  const { data } = await this.client.get(path, {
8595
8598
  params: query,
@@ -8608,18 +8611,18 @@ class MapleStoryApi {
8608
8611
  * @param dateOptions 조회 기준일 (KST).
8609
8612
  *
8610
8613
  */
8611
- async getOverallRanking(filterOptions, dateOptions = MapleStoryApi.getProperDefaultDateOptions({
8614
+ async getOverallRanking(filterOptions, dateOptions = getProperDefaultDateOptions({
8612
8615
  hour: 8,
8613
8616
  minute: 30,
8614
8617
  dateOffset: 0,
8615
8618
  })) {
8616
8619
  const path = 'maplestory/v1/ranking/overall';
8617
8620
  const query = {
8618
- date: MapleStoryApi.toDateString({
8621
+ date: toDateString(dateOptions, {
8619
8622
  year: 2023,
8620
8623
  month: 12,
8621
8624
  day: 22,
8622
- }, dateOptions),
8625
+ }),
8623
8626
  };
8624
8627
  if (filterOptions) {
8625
8628
  const { worldName, worldType, characterClass, ocid, page } = filterOptions;
@@ -8643,18 +8646,18 @@ class MapleStoryApi {
8643
8646
  * @param filterOptions 검색 기준
8644
8647
  * @param dateOptions 조회 기준일 (KST)
8645
8648
  */
8646
- async getUnionRanking(filterOptions, dateOptions = MapleStoryApi.getProperDefaultDateOptions({
8649
+ async getUnionRanking(filterOptions, dateOptions = getProperDefaultDateOptions({
8647
8650
  hour: 8,
8648
8651
  minute: 30,
8649
8652
  dateOffset: 0,
8650
8653
  })) {
8651
8654
  const path = 'maplestory/v1/ranking/union';
8652
8655
  const query = {
8653
- date: MapleStoryApi.toDateString({
8656
+ date: toDateString(dateOptions, {
8654
8657
  year: 2023,
8655
8658
  month: 12,
8656
8659
  day: 22,
8657
- }, dateOptions),
8660
+ }),
8658
8661
  };
8659
8662
  if (filterOptions) {
8660
8663
  const { worldName, ocid, page } = filterOptions;
@@ -8676,18 +8679,18 @@ class MapleStoryApi {
8676
8679
  * @param filterOptions 검색 기준
8677
8680
  * @param dateOptions 조회 기준일 (KST)
8678
8681
  */
8679
- async getGuildRanking(filterOptions, dateOptions = MapleStoryApi.getProperDefaultDateOptions({
8682
+ async getGuildRanking(filterOptions, dateOptions = getProperDefaultDateOptions({
8680
8683
  hour: 8,
8681
8684
  minute: 30,
8682
8685
  dateOffset: 0,
8683
8686
  })) {
8684
8687
  const path = 'maplestory/v1/ranking/guild';
8685
8688
  const query = {
8686
- date: MapleStoryApi.toDateString({
8689
+ date: toDateString(dateOptions, {
8687
8690
  year: 2023,
8688
8691
  month: 12,
8689
8692
  day: 22,
8690
- }, dateOptions),
8693
+ }),
8691
8694
  ranking_type: 0,
8692
8695
  };
8693
8696
  if (filterOptions) {
@@ -8711,18 +8714,18 @@ class MapleStoryApi {
8711
8714
  * @param filterOptions 검색 기준
8712
8715
  * @param dateOptions 조회 기준일 (KST)
8713
8716
  */
8714
- async getDojangRanking(filterOptions, dateOptions = MapleStoryApi.getProperDefaultDateOptions({
8717
+ async getDojangRanking(filterOptions, dateOptions = getProperDefaultDateOptions({
8715
8718
  hour: 8,
8716
8719
  minute: 30,
8717
8720
  dateOffset: 0,
8718
8721
  })) {
8719
8722
  const path = 'maplestory/v1/ranking/dojang';
8720
8723
  const query = {
8721
- date: MapleStoryApi.toDateString({
8724
+ date: toDateString(dateOptions, {
8722
8725
  year: 2023,
8723
8726
  month: 12,
8724
8727
  day: 22,
8725
- }, dateOptions),
8728
+ }),
8726
8729
  difficulty: 0,
8727
8730
  };
8728
8731
  if (filterOptions) {
@@ -8747,18 +8750,18 @@ class MapleStoryApi {
8747
8750
  * @param filterOptions 검색 기준
8748
8751
  * @param dateOptions 조회 기준일 (KST)
8749
8752
  */
8750
- async getSeedRanking(filterOptions, dateOptions = MapleStoryApi.getProperDefaultDateOptions({
8753
+ async getSeedRanking(filterOptions, dateOptions = getProperDefaultDateOptions({
8751
8754
  hour: 8,
8752
8755
  minute: 30,
8753
8756
  dateOffset: 0,
8754
8757
  })) {
8755
8758
  const path = 'maplestory/v1/ranking/theseed';
8756
8759
  const query = {
8757
- date: MapleStoryApi.toDateString({
8760
+ date: toDateString(dateOptions, {
8758
8761
  year: 2023,
8759
8762
  month: 12,
8760
8763
  day: 22,
8761
- }, dateOptions),
8764
+ }),
8762
8765
  };
8763
8766
  if (filterOptions) {
8764
8767
  const { worldName, ocid, page } = filterOptions;
@@ -8780,18 +8783,18 @@ class MapleStoryApi {
8780
8783
  * @param filterOptions 검색 기준
8781
8784
  * @param dateOptions 조회 기준일 (KST)
8782
8785
  */
8783
- async getAchievementRanking(filterOptions, dateOptions = MapleStoryApi.getProperDefaultDateOptions({
8786
+ async getAchievementRanking(filterOptions, dateOptions = getProperDefaultDateOptions({
8784
8787
  hour: 8,
8785
8788
  minute: 30,
8786
8789
  dateOffset: 0,
8787
8790
  })) {
8788
8791
  const path = 'maplestory/v1/ranking/achievement';
8789
8792
  const query = {
8790
- date: MapleStoryApi.toDateString({
8793
+ date: toDateString(dateOptions, {
8791
8794
  year: 2023,
8792
8795
  month: 12,
8793
8796
  day: 22,
8794
- }, dateOptions),
8797
+ }),
8795
8798
  };
8796
8799
  if (filterOptions) {
8797
8800
  const { ocid, page } = filterOptions;
@@ -8954,53 +8957,55 @@ class MapleStoryApi {
8954
8957
  const xml = (await xml2js__default["default"].parseStringPromise(response.data));
8955
8958
  return new InspectionInfoDto(xml);
8956
8959
  }
8957
- /**
8958
- * API 서버의 데이터 갱신 시간에 따라 데이터가 조회 가능한 최신 날짜를 반환합니다.
8959
- *
8960
- * @param options
8961
- * @private
8962
- */
8963
- static getProperDefaultDateOptions(options) {
8964
- const { hour, minute, dateOffset } = options;
8965
- const kstNow = dayjs__default["default"]().utcOffset(MapleStoryApi.kstOffset);
8966
- const updateDate = dayjs__default["default"]()
8967
- .utcOffset(MapleStoryApi.kstOffset)
8968
- .hour(hour)
8969
- .minute(minute);
8970
- let adjustedDate;
8971
- if (kstNow.isAfter(updateDate)) {
8972
- adjustedDate = kstNow;
8973
- }
8974
- else {
8975
- adjustedDate = kstNow.subtract(1, 'day');
8976
- }
8977
- adjustedDate = adjustedDate.subtract(dateOffset ?? 0, 'day');
8978
- return {
8979
- year: adjustedDate.year(),
8980
- month: adjustedDate.month() + 1,
8981
- day: adjustedDate.date(),
8982
- };
8983
- }
8984
- /**
8985
- * 날짜 정보를 API 서버에서 요구하는 포맷으로 변환합니다.
8986
- *
8987
- * @param minDateOptions API 호출 가능한 최소 날짜
8988
- * @param dateOptions 조회 하려는 날짜
8989
- * @private
8990
- */
8991
- static toDateString(minDateOptions, dateOptions) {
8960
+ }
8961
+ const KST_OFFSET = 540;
8962
+ /**
8963
+ * API 서버의 데이터 갱신 시간에 따라 데이터가 조회 가능한 최신 날짜를 반환합니다.
8964
+ *
8965
+ * @param options
8966
+ */
8967
+ const getProperDefaultDateOptions = (options) => {
8968
+ const { hour, minute, dateOffset } = options;
8969
+ const kstNow = dayjs__default["default"]().utcOffset(KST_OFFSET);
8970
+ const updateDate = dayjs__default["default"]()
8971
+ .utcOffset(KST_OFFSET)
8972
+ .hour(hour)
8973
+ .minute(minute);
8974
+ let adjustedDate;
8975
+ if (kstNow.isAfter(updateDate)) {
8976
+ adjustedDate = kstNow;
8977
+ }
8978
+ else {
8979
+ adjustedDate = kstNow.subtract(1, 'day');
8980
+ }
8981
+ adjustedDate = adjustedDate.subtract(dateOffset ?? 0, 'day');
8982
+ return {
8983
+ year: adjustedDate.year(),
8984
+ month: adjustedDate.month() + 1,
8985
+ day: adjustedDate.date(),
8986
+ };
8987
+ };
8988
+ /**
8989
+ * 날짜 정보를 API 서버에서 요구하는 포맷으로 변환합니다.
8990
+ *
8991
+ * @param dateOptions 조회 하려는 날짜
8992
+ * @param minDateOptions API 호출 가능한 최소 날짜
8993
+ */
8994
+ const toDateString = (dateOptions, minDateOptions) => {
8995
+ const { year, month, day } = dateOptions;
8996
+ const str = dayjs__default["default"](`${year}-${month}-${day}`)
8997
+ .utcOffset(KST_OFFSET)
8998
+ .format('YYYY-MM-DD');
8999
+ if (minDateOptions) {
8992
9000
  const { year: minYear, month: minMonth, day: minDay } = minDateOptions;
8993
- const { year, month, day } = dateOptions;
8994
9001
  if (year < minYear ||
8995
9002
  (year === minYear && month < minMonth) ||
8996
9003
  (year === minYear && month === minMonth && day < minDay)) {
8997
9004
  throw new Error(`You can only retrieve data after ${dayjs__default["default"](`${minYear}-${minMonth}-${minDay}`).format('YYYY-MM-DD')}.`);
8998
9005
  }
8999
- return dayjs__default["default"](`${year}-${month}-${day}`)
9000
- .utcOffset(MapleStoryApi.kstOffset)
9001
- .format('YYYY-MM-DD');
9002
9006
  }
9003
- }
9007
+ return str;
9008
+ };
9004
9009
 
9005
9010
  exports.AchievementRankingDto = AchievementRankingDto;
9006
9011
  exports.AchievementRankingResponseDto = AchievementRankingResponseDto;