maplestory-openapi 3.4.1 → 3.5.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/README.md +11 -10
- package/dist/cjs/maplestory/api/common/lib.js +16 -0
- package/dist/cjs/maplestory/api/common/mapleStoryApi.js +25 -0
- package/dist/cjs/maplestory/api/kms/dto/character/characterAndroidEquipment.js +1 -1
- package/dist/cjs/maplestory/api/kms/dto/character/characterBasic.js +3 -2
- package/dist/cjs/maplestory/api/kms/dto/character/characterRingExchangeSkillEquipment.js +1 -1
- package/dist/cjs/maplestory/api/kms/dto/history/starforceHistory.js +1 -1
- package/dist/cjs/maplestory/api/kms/mapleStoryApi.js +98 -11
- package/dist/cjs/maplestory/api/msea/dto/character/characterBasic.js +3 -2
- package/dist/cjs/maplestory/api/msea/mapleStoryApi.js +79 -1
- package/dist/cjs/maplestory/api/tms/dto/character/characterBasic.js +3 -2
- package/dist/cjs/maplestory/api/tms/mapleStoryApi.js +79 -1
- package/dist/esm/maplestory/api/common/lib.js +16 -1
- package/dist/esm/maplestory/api/common/mapleStoryApi.js +25 -0
- package/dist/esm/maplestory/api/kms/dto/character/characterAndroidEquipment.js +1 -1
- package/dist/esm/maplestory/api/kms/dto/character/characterBasic.js +3 -2
- package/dist/esm/maplestory/api/kms/dto/character/characterRingExchangeSkillEquipment.js +1 -1
- package/dist/esm/maplestory/api/kms/dto/history/starforceHistory.js +1 -1
- package/dist/esm/maplestory/api/kms/mapleStoryApi.js +98 -11
- package/dist/esm/maplestory/api/msea/dto/character/characterBasic.js +3 -2
- package/dist/esm/maplestory/api/msea/mapleStoryApi.js +79 -1
- package/dist/esm/maplestory/api/tms/dto/character/characterBasic.js +3 -2
- package/dist/esm/maplestory/api/tms/mapleStoryApi.js +79 -1
- package/dist/index.min.js +1 -1
- package/package.json +4 -3
- package/types/maplestory/api/common/dto/character/characterAbility.d.ts +2 -2
- package/types/maplestory/api/common/dto/character/characterBasic.d.ts +1 -1
- package/types/maplestory/api/common/dto/character/characterCashItemEquipment.d.ts +3 -3
- package/types/maplestory/api/common/dto/character/characterDojang.d.ts +4 -4
- package/types/maplestory/api/common/dto/character/characterHexaMatrixStat.d.ts +1 -1
- package/types/maplestory/api/common/dto/character/characterHyperStat.d.ts +6 -6
- package/types/maplestory/api/common/dto/character/characterItemEquipment.d.ts +2 -2
- package/types/maplestory/api/common/dto/character/characterLinkSkill.d.ts +1 -1
- package/types/maplestory/api/common/dto/character/characterPropensity.d.ts +6 -6
- package/types/maplestory/api/common/dto/character/characterSkill.d.ts +1 -1
- package/types/maplestory/api/common/dto/character/characterStat.d.ts +2 -2
- package/types/maplestory/api/common/dto/character/characterSymbolEquipment.d.ts +1 -1
- package/types/maplestory/api/common/dto/character/characterVMatrix.d.ts +2 -2
- package/types/maplestory/api/common/dto/union/unionRaider.d.ts +1 -1
- package/types/maplestory/api/common/lib.d.ts +9 -0
- package/types/maplestory/api/common/mapleStoryApi.d.ts +36 -25
- package/types/maplestory/api/kms/dto/character/characterAbility.d.ts +2 -2
- package/types/maplestory/api/kms/dto/character/characterAndroidEquipment.d.ts +1 -1
- package/types/maplestory/api/kms/dto/character/characterBasic.d.ts +1 -1
- package/types/maplestory/api/kms/dto/character/characterCashItemEquipment.d.ts +3 -3
- package/types/maplestory/api/kms/dto/character/characterDojang.d.ts +4 -4
- package/types/maplestory/api/kms/dto/character/characterHexaMatrixStat.d.ts +1 -1
- package/types/maplestory/api/kms/dto/character/characterHyperStat.d.ts +6 -6
- package/types/maplestory/api/kms/dto/character/characterItemEquipment.d.ts +2 -2
- package/types/maplestory/api/kms/dto/character/characterLinkSkill.d.ts +1 -1
- package/types/maplestory/api/kms/dto/character/characterPropensity.d.ts +6 -6
- package/types/maplestory/api/kms/dto/character/characterSkill.d.ts +1 -1
- package/types/maplestory/api/kms/dto/character/characterStat.d.ts +2 -2
- package/types/maplestory/api/kms/dto/character/characterSymbolEquipment.d.ts +1 -1
- package/types/maplestory/api/kms/dto/character/characterVMatrix.d.ts +2 -2
- package/types/maplestory/api/kms/dto/history/starforceHistory.d.ts +4 -4
- package/types/maplestory/api/kms/dto/union/unionRaider.d.ts +1 -1
- package/types/maplestory/api/kms/mapleStoryApi.d.ts +32 -32
- package/types/maplestory/api/kms/response/character/characterAndroidEquipmentBody.d.ts +1 -1
- package/types/maplestory/api/kms/response/character/characterBasicBody.d.ts +1 -1
- package/types/maplestory/api/kms/response/character/characterPopularityBody.d.ts +1 -1
- package/types/maplestory/api/kms/response/union/unionRaiderBody.d.ts +1 -1
- package/types/maplestory/api/msea/dto/character/characterAbility.d.ts +2 -2
- package/types/maplestory/api/msea/dto/character/characterBasic.d.ts +1 -1
- package/types/maplestory/api/msea/dto/character/characterCashItemEquipment.d.ts +3 -3
- package/types/maplestory/api/msea/dto/character/characterDojang.d.ts +4 -4
- package/types/maplestory/api/msea/dto/character/characterHexaMatrixStat.d.ts +1 -1
- package/types/maplestory/api/msea/dto/character/characterHyperStat.d.ts +6 -6
- package/types/maplestory/api/msea/dto/character/characterItemEquipment.d.ts +2 -2
- package/types/maplestory/api/msea/dto/character/characterLinkSkill.d.ts +1 -1
- package/types/maplestory/api/msea/dto/character/characterPropensity.d.ts +6 -6
- package/types/maplestory/api/msea/dto/character/characterSkill.d.ts +1 -1
- package/types/maplestory/api/msea/dto/character/characterStat.d.ts +2 -2
- package/types/maplestory/api/msea/dto/character/characterSymbolEquipment.d.ts +1 -1
- package/types/maplestory/api/msea/dto/character/characterVMatrix.d.ts +2 -2
- package/types/maplestory/api/msea/dto/union/unionRaider.d.ts +1 -1
- package/types/maplestory/api/msea/mapleStoryApi.d.ts +25 -25
- package/types/maplestory/api/msea/response/character/characterBasicBody.d.ts +1 -1
- package/types/maplestory/api/msea/response/character/characterPopularityBody.d.ts +1 -1
- package/types/maplestory/api/msea/response/union/unionRaiderBody.d.ts +1 -1
- package/types/maplestory/api/tms/dto/character/characterAbility.d.ts +2 -2
- package/types/maplestory/api/tms/dto/character/characterBasic.d.ts +1 -1
- package/types/maplestory/api/tms/dto/character/characterCashItemEquipment.d.ts +3 -3
- package/types/maplestory/api/tms/dto/character/characterDojang.d.ts +4 -4
- package/types/maplestory/api/tms/dto/character/characterHexaMatrixStat.d.ts +1 -1
- package/types/maplestory/api/tms/dto/character/characterHyperStat.d.ts +6 -6
- package/types/maplestory/api/tms/dto/character/characterItemEquipment.d.ts +2 -2
- package/types/maplestory/api/tms/dto/character/characterLinkSkill.d.ts +1 -1
- package/types/maplestory/api/tms/dto/character/characterPropensity.d.ts +6 -6
- package/types/maplestory/api/tms/dto/character/characterSkill.d.ts +1 -1
- package/types/maplestory/api/tms/dto/character/characterStat.d.ts +2 -2
- package/types/maplestory/api/tms/dto/character/characterSymbolEquipment.d.ts +1 -1
- package/types/maplestory/api/tms/dto/character/characterVMatrix.d.ts +2 -2
- package/types/maplestory/api/tms/dto/union/unionRaider.d.ts +1 -1
- package/types/maplestory/api/tms/mapleStoryApi.d.ts +25 -25
- package/types/maplestory/api/tms/response/character/characterBasicBody.d.ts +1 -1
- package/types/maplestory/api/tms/response/character/characterPopularityBody.d.ts +1 -1
- package/types/maplestory/api/tms/response/union/unionRaiderBody.d.ts +1 -1
|
@@ -32,6 +32,7 @@ var unionArtifact = require('./dto/union/unionArtifact.js');
|
|
|
32
32
|
var unionRaider = require('./dto/union/unionRaider.js');
|
|
33
33
|
var characterImage = require('../common/enum/characterImage.js');
|
|
34
34
|
var mapleStoryApi = require('../common/mapleStoryApi.js');
|
|
35
|
+
var lib = require('../common/lib.js');
|
|
35
36
|
var index = require('../../../_virtual/index.js_commonjs-exports.js');
|
|
36
37
|
|
|
37
38
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -93,6 +94,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
93
94
|
const { data } = await this.client.get(path, {
|
|
94
95
|
params: query,
|
|
95
96
|
});
|
|
97
|
+
if (this.isEmptyResponse(data)) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
96
100
|
return new characterBasic.CharacterBasicDto(data);
|
|
97
101
|
}
|
|
98
102
|
/**
|
|
@@ -107,7 +111,11 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
107
111
|
* @param dateOptions Reference date for query (SGT)
|
|
108
112
|
*/
|
|
109
113
|
async getCharacterImage(ocid, imageOptions, dateOptions) {
|
|
110
|
-
const
|
|
114
|
+
const basic = await this.getCharacterBasic(ocid, dateOptions);
|
|
115
|
+
if (!basic) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
const { date, characterImage: characterImage$2 } = basic;
|
|
111
119
|
const action = imageOptions?.action ?? characterImage.CharacterImageAction.Stand1;
|
|
112
120
|
const emotion = imageOptions?.emotion ?? characterImage.CharacterImageEmotion.Default;
|
|
113
121
|
const wmotion = imageOptions?.wmotion ?? characterImage.CharacterImageWeaponMotion.Default;
|
|
@@ -117,6 +125,7 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
117
125
|
const height = 96;
|
|
118
126
|
const x = imageOptions?.x ?? null;
|
|
119
127
|
const y = imageOptions?.y ?? null;
|
|
128
|
+
const path = lib.removeQuery(characterImage$2);
|
|
120
129
|
const query = {
|
|
121
130
|
action: `${action}.${actionFrame}`,
|
|
122
131
|
emotion: `${emotion}.${emotionFrame}`,
|
|
@@ -181,6 +190,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
181
190
|
const { data } = await this.client.get(path, {
|
|
182
191
|
params: query,
|
|
183
192
|
});
|
|
193
|
+
if (this.isEmptyResponse(data)) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
184
196
|
return new characterPopularity.CharacterPopularityDto(data);
|
|
185
197
|
}
|
|
186
198
|
/**
|
|
@@ -209,6 +221,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
209
221
|
const { data } = await this.client.get(path, {
|
|
210
222
|
params: query,
|
|
211
223
|
});
|
|
224
|
+
if (this.isEmptyResponse(data)) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
212
227
|
return new characterStat.CharacterStatDto(data);
|
|
213
228
|
}
|
|
214
229
|
/**
|
|
@@ -237,6 +252,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
237
252
|
const { data } = await this.client.get(path, {
|
|
238
253
|
params: query,
|
|
239
254
|
});
|
|
255
|
+
if (this.isEmptyResponse(data)) {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
240
258
|
return new characterHyperStat.CharacterHyperStatDto(data);
|
|
241
259
|
}
|
|
242
260
|
/**
|
|
@@ -265,6 +283,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
265
283
|
const { data } = await this.client.get(path, {
|
|
266
284
|
params: query,
|
|
267
285
|
});
|
|
286
|
+
if (this.isEmptyResponse(data)) {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
268
289
|
return new characterPropensity.CharacterPropensityDto(data);
|
|
269
290
|
}
|
|
270
291
|
/**
|
|
@@ -293,6 +314,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
293
314
|
const { data } = await this.client.get(path, {
|
|
294
315
|
params: query,
|
|
295
316
|
});
|
|
317
|
+
if (this.isEmptyResponse(data)) {
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
296
320
|
return new characterAbility.CharacterAbilityDto(data);
|
|
297
321
|
}
|
|
298
322
|
/**
|
|
@@ -321,6 +345,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
321
345
|
const { data } = await this.client.get(path, {
|
|
322
346
|
params: query,
|
|
323
347
|
});
|
|
348
|
+
if (this.isEmptyResponse(data)) {
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
324
351
|
return new characterItemEquipment.CharacterItemEquipmentDto(data);
|
|
325
352
|
}
|
|
326
353
|
/**
|
|
@@ -349,6 +376,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
349
376
|
const { data } = await this.client.get(path, {
|
|
350
377
|
params: query,
|
|
351
378
|
});
|
|
379
|
+
if (this.isEmptyResponse(data)) {
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
352
382
|
return new characterCashItemEquipment.CharacterCashItemEquipmentDto(data);
|
|
353
383
|
}
|
|
354
384
|
/**
|
|
@@ -377,6 +407,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
377
407
|
const { data } = await this.client.get(path, {
|
|
378
408
|
params: query,
|
|
379
409
|
});
|
|
410
|
+
if (this.isEmptyResponse(data)) {
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
380
413
|
return new characterSymbolEquipment.CharacterSymbolEquipmentDto(data);
|
|
381
414
|
}
|
|
382
415
|
/**
|
|
@@ -405,6 +438,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
405
438
|
const { data } = await this.client.get(path, {
|
|
406
439
|
params: query,
|
|
407
440
|
});
|
|
441
|
+
if (this.isEmptyResponse(data)) {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
408
444
|
return new characterSetEffect.CharacterSetEffectDto(data);
|
|
409
445
|
}
|
|
410
446
|
/**
|
|
@@ -433,6 +469,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
433
469
|
const { data } = await this.client.get(path, {
|
|
434
470
|
params: query,
|
|
435
471
|
});
|
|
472
|
+
if (this.isEmptyResponse(data)) {
|
|
473
|
+
return null;
|
|
474
|
+
}
|
|
436
475
|
return new characterBeautyEquipment.CharacterBeautyEquipmentDto(data);
|
|
437
476
|
}
|
|
438
477
|
/**
|
|
@@ -461,6 +500,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
461
500
|
const { data } = await this.client.get(path, {
|
|
462
501
|
params: query,
|
|
463
502
|
});
|
|
503
|
+
if (this.isEmptyResponse(data)) {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
464
506
|
return new characterAndroidEquipment.CharacterAndroidEquipmentDto(data);
|
|
465
507
|
}
|
|
466
508
|
/**
|
|
@@ -489,6 +531,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
489
531
|
const { data } = await this.client.get(path, {
|
|
490
532
|
params: query,
|
|
491
533
|
});
|
|
534
|
+
if (this.isEmptyResponse(data)) {
|
|
535
|
+
return null;
|
|
536
|
+
}
|
|
492
537
|
return new characterPetEquipment.CharacterPetEquipmentDto(data);
|
|
493
538
|
}
|
|
494
539
|
/**
|
|
@@ -519,6 +564,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
519
564
|
const { data } = await this.client.get(path, {
|
|
520
565
|
params: query,
|
|
521
566
|
});
|
|
567
|
+
if (this.isEmptyResponse(data)) {
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
522
570
|
return new characterSkill.CharacterSkillDto(data);
|
|
523
571
|
}
|
|
524
572
|
/**
|
|
@@ -547,6 +595,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
547
595
|
const { data } = await this.client.get(path, {
|
|
548
596
|
params: query,
|
|
549
597
|
});
|
|
598
|
+
if (this.isEmptyResponse(data)) {
|
|
599
|
+
return null;
|
|
600
|
+
}
|
|
550
601
|
return new characterLinkSkill.CharacterLinkSkillDto(data);
|
|
551
602
|
}
|
|
552
603
|
/**
|
|
@@ -575,6 +626,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
575
626
|
const { data } = await this.client.get(path, {
|
|
576
627
|
params: query,
|
|
577
628
|
});
|
|
629
|
+
if (this.isEmptyResponse(data)) {
|
|
630
|
+
return null;
|
|
631
|
+
}
|
|
578
632
|
return new characterVMatrix.CharacterVMatrixDto(data);
|
|
579
633
|
}
|
|
580
634
|
/**
|
|
@@ -603,6 +657,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
603
657
|
const { data } = await this.client.get(path, {
|
|
604
658
|
params: query,
|
|
605
659
|
});
|
|
660
|
+
if (this.isEmptyResponse(data)) {
|
|
661
|
+
return null;
|
|
662
|
+
}
|
|
606
663
|
return new characterHexaMatrix.CharacterHexaMatrixDto(data);
|
|
607
664
|
}
|
|
608
665
|
/**
|
|
@@ -631,6 +688,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
631
688
|
const { data } = await this.client.get(path, {
|
|
632
689
|
params: query,
|
|
633
690
|
});
|
|
691
|
+
if (this.isEmptyResponse(data)) {
|
|
692
|
+
return null;
|
|
693
|
+
}
|
|
634
694
|
return new characterHexaMatrixStat.CharacterHexaMatrixStatDto(data);
|
|
635
695
|
}
|
|
636
696
|
/**
|
|
@@ -659,6 +719,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
659
719
|
const { data } = await this.client.get(path, {
|
|
660
720
|
params: query,
|
|
661
721
|
});
|
|
722
|
+
if (this.isEmptyResponse(data)) {
|
|
723
|
+
return null;
|
|
724
|
+
}
|
|
662
725
|
return new characterDojang.CharacterDojangDto(data);
|
|
663
726
|
}
|
|
664
727
|
//#endregion
|
|
@@ -689,6 +752,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
689
752
|
const { data } = await this.client.get(path, {
|
|
690
753
|
params: query,
|
|
691
754
|
});
|
|
755
|
+
if (this.isEmptyResponse(data)) {
|
|
756
|
+
return null;
|
|
757
|
+
}
|
|
692
758
|
return new union.UnionDto(data);
|
|
693
759
|
}
|
|
694
760
|
/**
|
|
@@ -717,6 +783,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
717
783
|
const { data } = await this.client.get(path, {
|
|
718
784
|
params: query,
|
|
719
785
|
});
|
|
786
|
+
if (this.isEmptyResponse(data)) {
|
|
787
|
+
return null;
|
|
788
|
+
}
|
|
720
789
|
return new unionRaider.UnionRaiderDto(data);
|
|
721
790
|
}
|
|
722
791
|
/**
|
|
@@ -745,6 +814,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
745
814
|
const { data } = await this.client.get(path, {
|
|
746
815
|
params: query,
|
|
747
816
|
});
|
|
817
|
+
if (this.isEmptyResponse(data)) {
|
|
818
|
+
return null;
|
|
819
|
+
}
|
|
748
820
|
return new unionArtifact.UnionArtifactDto(data);
|
|
749
821
|
}
|
|
750
822
|
//#endregion
|
|
@@ -767,6 +839,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
767
839
|
world_name: worldName,
|
|
768
840
|
},
|
|
769
841
|
});
|
|
842
|
+
if (this.isEmptyResponse(data)) {
|
|
843
|
+
return null;
|
|
844
|
+
}
|
|
770
845
|
return new guild.GuildDto(data);
|
|
771
846
|
}
|
|
772
847
|
/**
|
|
@@ -795,6 +870,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
795
870
|
const { data } = await this.client.get(path, {
|
|
796
871
|
params: query,
|
|
797
872
|
});
|
|
873
|
+
if (this.isEmptyResponse(data)) {
|
|
874
|
+
return null;
|
|
875
|
+
}
|
|
798
876
|
return new guildBasic.GuildBasicDto(data);
|
|
799
877
|
}
|
|
800
878
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var characterBasic = require('../../../common/dto/character/characterBasic.js');
|
|
6
|
+
var lib = require('../../../common/lib.js');
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* 角色基本資訊
|
|
@@ -77,8 +78,8 @@ class CharacterBasicDto extends characterBasic.CharacterBasicDto {
|
|
|
77
78
|
this.characterExp = character_exp;
|
|
78
79
|
this.characterExpRate = character_exp_rate;
|
|
79
80
|
this.characterGuildName = character_guild_name;
|
|
80
|
-
this.characterImage = character_image;
|
|
81
|
-
this.characterDateCreate = new Date(character_date_create);
|
|
81
|
+
this.characterImage = lib.removeQuery(character_image);
|
|
82
|
+
this.characterDateCreate = character_date_create ? new Date(character_date_create) : null;
|
|
82
83
|
this.accessFlag = access_flag;
|
|
83
84
|
this.liberationQuestClear = liberation_quest_clear;
|
|
84
85
|
}
|
|
@@ -32,6 +32,7 @@ var unionArtifact = require('./dto/union/unionArtifact.js');
|
|
|
32
32
|
var unionRaider = require('./dto/union/unionRaider.js');
|
|
33
33
|
var characterImage = require('../common/enum/characterImage.js');
|
|
34
34
|
var mapleStoryApi = require('../common/mapleStoryApi.js');
|
|
35
|
+
var lib = require('../common/lib.js');
|
|
35
36
|
var index = require('../../../_virtual/index.js_commonjs-exports.js');
|
|
36
37
|
|
|
37
38
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -93,6 +94,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
93
94
|
const { data } = await this.client.get(path, {
|
|
94
95
|
params: query,
|
|
95
96
|
});
|
|
97
|
+
if (this.isEmptyResponse(data)) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
96
100
|
return new characterBasic.CharacterBasicDto(data);
|
|
97
101
|
}
|
|
98
102
|
/**
|
|
@@ -107,7 +111,11 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
107
111
|
* @param dateOptions 要搜尋的日期 (TST)
|
|
108
112
|
*/
|
|
109
113
|
async getCharacterImage(ocid, imageOptions, dateOptions) {
|
|
110
|
-
const
|
|
114
|
+
const basic = await this.getCharacterBasic(ocid, dateOptions);
|
|
115
|
+
if (!basic) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
const { date, characterImage: characterImage$2 } = basic;
|
|
111
119
|
const action = imageOptions?.action ?? characterImage.CharacterImageAction.Stand1;
|
|
112
120
|
const emotion = imageOptions?.emotion ?? characterImage.CharacterImageEmotion.Default;
|
|
113
121
|
const wmotion = imageOptions?.wmotion ?? characterImage.CharacterImageWeaponMotion.Default;
|
|
@@ -117,6 +125,7 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
117
125
|
const height = 96;
|
|
118
126
|
const x = imageOptions?.x ?? null;
|
|
119
127
|
const y = imageOptions?.y ?? null;
|
|
128
|
+
const path = lib.removeQuery(characterImage$2);
|
|
120
129
|
const query = {
|
|
121
130
|
action: `${action}.${actionFrame}`,
|
|
122
131
|
emotion: `${emotion}.${emotionFrame}`,
|
|
@@ -181,6 +190,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
181
190
|
const { data } = await this.client.get(path, {
|
|
182
191
|
params: query,
|
|
183
192
|
});
|
|
193
|
+
if (this.isEmptyResponse(data)) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
184
196
|
return new characterPopularity.CharacterPopularityDto(data);
|
|
185
197
|
}
|
|
186
198
|
/**
|
|
@@ -209,6 +221,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
209
221
|
const { data } = await this.client.get(path, {
|
|
210
222
|
params: query,
|
|
211
223
|
});
|
|
224
|
+
if (this.isEmptyResponse(data)) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
212
227
|
return new characterStat.CharacterStatDto(data);
|
|
213
228
|
}
|
|
214
229
|
/**
|
|
@@ -237,6 +252,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
237
252
|
const { data } = await this.client.get(path, {
|
|
238
253
|
params: query,
|
|
239
254
|
});
|
|
255
|
+
if (this.isEmptyResponse(data)) {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
240
258
|
return new characterHyperStat.CharacterHyperStatDto(data);
|
|
241
259
|
}
|
|
242
260
|
/**
|
|
@@ -265,6 +283,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
265
283
|
const { data } = await this.client.get(path, {
|
|
266
284
|
params: query,
|
|
267
285
|
});
|
|
286
|
+
if (this.isEmptyResponse(data)) {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
268
289
|
return new characterPropensity.CharacterPropensityDto(data);
|
|
269
290
|
}
|
|
270
291
|
/**
|
|
@@ -293,6 +314,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
293
314
|
const { data } = await this.client.get(path, {
|
|
294
315
|
params: query,
|
|
295
316
|
});
|
|
317
|
+
if (this.isEmptyResponse(data)) {
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
296
320
|
return new characterAbility.CharacterAbilityDto(data);
|
|
297
321
|
}
|
|
298
322
|
/**
|
|
@@ -321,6 +345,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
321
345
|
const { data } = await this.client.get(path, {
|
|
322
346
|
params: query,
|
|
323
347
|
});
|
|
348
|
+
if (this.isEmptyResponse(data)) {
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
324
351
|
return new characterItemEquipment.CharacterItemEquipmentDto(data);
|
|
325
352
|
}
|
|
326
353
|
/**
|
|
@@ -349,6 +376,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
349
376
|
const { data } = await this.client.get(path, {
|
|
350
377
|
params: query,
|
|
351
378
|
});
|
|
379
|
+
if (this.isEmptyResponse(data)) {
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
352
382
|
return new characterCashItemEquipment.CharacterCashItemEquipmentDto(data);
|
|
353
383
|
}
|
|
354
384
|
/**
|
|
@@ -377,6 +407,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
377
407
|
const { data } = await this.client.get(path, {
|
|
378
408
|
params: query,
|
|
379
409
|
});
|
|
410
|
+
if (this.isEmptyResponse(data)) {
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
380
413
|
return new characterSymbolEquipment.CharacterSymbolEquipmentDto(data);
|
|
381
414
|
}
|
|
382
415
|
/**
|
|
@@ -405,6 +438,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
405
438
|
const { data } = await this.client.get(path, {
|
|
406
439
|
params: query,
|
|
407
440
|
});
|
|
441
|
+
if (this.isEmptyResponse(data)) {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
408
444
|
return new characterSetEffect.CharacterSetEffectDto(data);
|
|
409
445
|
}
|
|
410
446
|
/**
|
|
@@ -433,6 +469,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
433
469
|
const { data } = await this.client.get(path, {
|
|
434
470
|
params: query,
|
|
435
471
|
});
|
|
472
|
+
if (this.isEmptyResponse(data)) {
|
|
473
|
+
return null;
|
|
474
|
+
}
|
|
436
475
|
return new characterBeautyEquipment.CharacterBeautyEquipmentDto(data);
|
|
437
476
|
}
|
|
438
477
|
/**
|
|
@@ -461,6 +500,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
461
500
|
const { data } = await this.client.get(path, {
|
|
462
501
|
params: query,
|
|
463
502
|
});
|
|
503
|
+
if (this.isEmptyResponse(data)) {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
464
506
|
return new characterAndroidEquipment.CharacterAndroidEquipmentDto(data);
|
|
465
507
|
}
|
|
466
508
|
/**
|
|
@@ -489,6 +531,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
489
531
|
const { data } = await this.client.get(path, {
|
|
490
532
|
params: query,
|
|
491
533
|
});
|
|
534
|
+
if (this.isEmptyResponse(data)) {
|
|
535
|
+
return null;
|
|
536
|
+
}
|
|
492
537
|
return new characterPetEquipment.CharacterPetEquipmentDto(data);
|
|
493
538
|
}
|
|
494
539
|
/**
|
|
@@ -519,6 +564,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
519
564
|
const { data } = await this.client.get(path, {
|
|
520
565
|
params: query,
|
|
521
566
|
});
|
|
567
|
+
if (this.isEmptyResponse(data)) {
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
522
570
|
return new characterSkill.CharacterSkillDto(data);
|
|
523
571
|
}
|
|
524
572
|
/**
|
|
@@ -547,6 +595,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
547
595
|
const { data } = await this.client.get(path, {
|
|
548
596
|
params: query,
|
|
549
597
|
});
|
|
598
|
+
if (this.isEmptyResponse(data)) {
|
|
599
|
+
return null;
|
|
600
|
+
}
|
|
550
601
|
return new characterLinkSkill.CharacterLinkSkillDto(data);
|
|
551
602
|
}
|
|
552
603
|
/**
|
|
@@ -575,6 +626,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
575
626
|
const { data } = await this.client.get(path, {
|
|
576
627
|
params: query,
|
|
577
628
|
});
|
|
629
|
+
if (this.isEmptyResponse(data)) {
|
|
630
|
+
return null;
|
|
631
|
+
}
|
|
578
632
|
return new characterVMatrix.CharacterVMatrixDto(data);
|
|
579
633
|
}
|
|
580
634
|
/**
|
|
@@ -603,6 +657,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
603
657
|
const { data } = await this.client.get(path, {
|
|
604
658
|
params: query,
|
|
605
659
|
});
|
|
660
|
+
if (this.isEmptyResponse(data)) {
|
|
661
|
+
return null;
|
|
662
|
+
}
|
|
606
663
|
return new characterHexaMatrix.CharacterHexaMatrixDto(data);
|
|
607
664
|
}
|
|
608
665
|
/**
|
|
@@ -631,6 +688,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
631
688
|
const { data } = await this.client.get(path, {
|
|
632
689
|
params: query,
|
|
633
690
|
});
|
|
691
|
+
if (this.isEmptyResponse(data)) {
|
|
692
|
+
return null;
|
|
693
|
+
}
|
|
634
694
|
return new characterHexaMatrixStat.CharacterHexaMatrixStatDto(data);
|
|
635
695
|
}
|
|
636
696
|
/**
|
|
@@ -659,6 +719,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
659
719
|
const { data } = await this.client.get(path, {
|
|
660
720
|
params: query,
|
|
661
721
|
});
|
|
722
|
+
if (this.isEmptyResponse(data)) {
|
|
723
|
+
return null;
|
|
724
|
+
}
|
|
662
725
|
return new characterDojang.CharacterDojangDto(data);
|
|
663
726
|
}
|
|
664
727
|
//#endregion
|
|
@@ -689,6 +752,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
689
752
|
const { data } = await this.client.get(path, {
|
|
690
753
|
params: query,
|
|
691
754
|
});
|
|
755
|
+
if (this.isEmptyResponse(data)) {
|
|
756
|
+
return null;
|
|
757
|
+
}
|
|
692
758
|
return new union.UnionDto(data);
|
|
693
759
|
}
|
|
694
760
|
/**
|
|
@@ -717,6 +783,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
717
783
|
const { data } = await this.client.get(path, {
|
|
718
784
|
params: query,
|
|
719
785
|
});
|
|
786
|
+
if (this.isEmptyResponse(data)) {
|
|
787
|
+
return null;
|
|
788
|
+
}
|
|
720
789
|
return new unionRaider.UnionRaiderDto(data);
|
|
721
790
|
}
|
|
722
791
|
/**
|
|
@@ -745,6 +814,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
745
814
|
const { data } = await this.client.get(path, {
|
|
746
815
|
params: query,
|
|
747
816
|
});
|
|
817
|
+
if (this.isEmptyResponse(data)) {
|
|
818
|
+
return null;
|
|
819
|
+
}
|
|
748
820
|
return new unionArtifact.UnionArtifactDto(data);
|
|
749
821
|
}
|
|
750
822
|
//#endregion
|
|
@@ -767,6 +839,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
767
839
|
world_name: worldName,
|
|
768
840
|
},
|
|
769
841
|
});
|
|
842
|
+
if (this.isEmptyResponse(data)) {
|
|
843
|
+
return null;
|
|
844
|
+
}
|
|
770
845
|
return new guild.GuildDto(data);
|
|
771
846
|
}
|
|
772
847
|
/**
|
|
@@ -795,6 +870,9 @@ class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
|
|
|
795
870
|
const { data } = await this.client.get(path, {
|
|
796
871
|
params: query,
|
|
797
872
|
});
|
|
873
|
+
if (this.isEmptyResponse(data)) {
|
|
874
|
+
return null;
|
|
875
|
+
}
|
|
798
876
|
return new guildBasic.GuildBasicDto(data);
|
|
799
877
|
}
|
|
800
878
|
}
|
|
@@ -18,5 +18,20 @@ const potentialOptionGradeFromString = (text) => {
|
|
|
18
18
|
}
|
|
19
19
|
return grade;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* URL에서 Query를 제거합니다.
|
|
23
|
+
* @param url URL
|
|
24
|
+
* @example
|
|
25
|
+
* ```
|
|
26
|
+
* removeQuery('https://example.com/path?query=123&test=abc') // returns 'https://example.com/path'
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
const removeQuery = (url) => {
|
|
30
|
+
if (!url) {
|
|
31
|
+
return url;
|
|
32
|
+
}
|
|
33
|
+
const queryIndex = url.indexOf('?');
|
|
34
|
+
return queryIndex >= 0 ? url.substring(0, queryIndex) : url;
|
|
35
|
+
};
|
|
21
36
|
|
|
22
|
-
export { potentialOptionGradeFromString };
|
|
37
|
+
export { potentialOptionGradeFromString, removeQuery };
|
|
@@ -107,6 +107,31 @@ class MapleStoryApi {
|
|
|
107
107
|
return str;
|
|
108
108
|
}
|
|
109
109
|
;
|
|
110
|
+
/**
|
|
111
|
+
* API 응답 데이터가 비어있는지 확인 합니다.<br/>
|
|
112
|
+
* API 요청 시 날짜에 해당하는 데이터가 없을 경우 date 필드만 값이 존재하는 상황을 검증할 때 사용 합니다.<br/>
|
|
113
|
+
* 일반적으로 API 지원 시작일과 캐릭터 생성일 사이의 날짜를 조회할 때 발생 합니다.
|
|
114
|
+
* @example
|
|
115
|
+
* ```
|
|
116
|
+
* isEmptyResponse({ date: '2024-01-01', popularity: null }) // true
|
|
117
|
+
* isEmptyResponse({ date: '2024-01-01', popularity: 10 }) // false
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
isEmptyResponse(body) {
|
|
121
|
+
for (const [key, value] of Object.entries(body)) {
|
|
122
|
+
if (key === 'date') {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (value === null || value === undefined) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
110
135
|
}
|
|
111
136
|
|
|
112
137
|
export { MapleStoryApi };
|
|
@@ -94,7 +94,7 @@ class CharacterAndroidEquipmentDto extends CharacterAndroidEquipmentDto$1 {
|
|
|
94
94
|
? new CharacterAndroidEquipmentSkinDto(android_skin)
|
|
95
95
|
: null;
|
|
96
96
|
this.androidCashItemEquipment = android_cash_item_equipment.map((equipment) => new CharacterAndroidCashItemEquipmentDto(equipment));
|
|
97
|
-
this.androidEarSensorClipFlag = android_ear_sensor_clip_flag
|
|
97
|
+
this.androidEarSensorClipFlag = android_ear_sensor_clip_flag;
|
|
98
98
|
this.androidGender = android_gender;
|
|
99
99
|
this.androidGrade = android_grade;
|
|
100
100
|
this.androidNonHumanoidFlag = android_non_humanoid_flag;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CharacterBasicDto as CharacterBasicDto$1 } from '../../../common/dto/character/characterBasic.js';
|
|
2
|
+
import { removeQuery } from '../../../common/lib.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* 캐릭터 기본 정보
|
|
@@ -73,8 +74,8 @@ class CharacterBasicDto extends CharacterBasicDto$1 {
|
|
|
73
74
|
this.characterExp = character_exp;
|
|
74
75
|
this.characterExpRate = character_exp_rate;
|
|
75
76
|
this.characterGuildName = character_guild_name;
|
|
76
|
-
this.characterImage = character_image;
|
|
77
|
-
this.characterDateCreate = new Date(character_date_create);
|
|
77
|
+
this.characterImage = removeQuery(character_image);
|
|
78
|
+
this.characterDateCreate = character_date_create ? new Date(character_date_create) : null;
|
|
78
79
|
this.accessFlag = access_flag;
|
|
79
80
|
this.liberationQuestClear = liberation_quest_clear;
|
|
80
81
|
}
|
|
@@ -29,7 +29,7 @@ class CharacterRingExchangeSkillEquipmentDto {
|
|
|
29
29
|
constructor(obj) {
|
|
30
30
|
const { date, character_class, special_ring_exchange_name, special_ring_exchange_level, special_ring_exchange_icon, special_ring_exchange_description } = obj;
|
|
31
31
|
this.date = date ? new Date(date) : null;
|
|
32
|
-
this.characterClass = character_class
|
|
32
|
+
this.characterClass = character_class;
|
|
33
33
|
this.specialRingExchangeName = special_ring_exchange_name ?? null;
|
|
34
34
|
this.specialRingExchangeLevel = special_ring_exchange_level ?? null;
|
|
35
35
|
this.specialRingExchangeIcon = special_ring_exchange_icon ?? null;
|