maplestory-openapi
Version:
This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.
161 lines (156 loc) • 4.69 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var lib = require('../../../common/lib.js');
/**
* 잠재능력 재설정 히스토리
*/
class PotentialHistoryDto {
/**
* 잠재능력 재설정 히스토리 식별자
*/
id;
/**
* 캐릭터 명
*/
characterName;
/**
* 사용 일시
*/
dateCreate;
/**
* 대상 잠재능력 타입 (잠재능력, 에디셔널 잠재능력)
*/
potentialType;
/**
* 사용 결과
*/
itemUpgradeResult;
/**
* 미라클 타임 적용 여부
*/
miracleTimeFlag;
/**
* 장비 분류
*/
itemEquipmentPart;
/**
* 장비 레벨
*/
itemLevel;
/**
* 잠재능력 재설정 장비 명
*/
targetItem;
/**
* 잠재능력 등급
*/
potentialOptionGrade;
/**
* 에디셔널 잠재능력 등급
*/
additionalPotentialOptionGrade;
/**
* 천장에 도달하여 확정 등급 상승한 여부
*/
upgradeGuarantee;
/**
* 현재까지 쌓은 스택
*/
upgradeGuaranteeCount;
/**
* 사용 전 잠재능력 옵션
*/
beforePotentialOption;
/**
* 사용 전 에디셔널 잠재능력 옵션
*/
beforeAdditionalPotentialOption;
/**
* 사용 후 잠재능력 옵션
*/
afterPotentialOption;
/**
* 사용 후 에디셔널 잠재능력 옵션
*/
afterAdditionalPotentialOption;
constructor(obj) {
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;
this.id = id;
this.characterName = character_name;
this.dateCreate = new Date(date_create);
this.potentialType = potential_type;
this.itemUpgradeResult = item_upgrade_result;
this.miracleTimeFlag = miracle_time_flag;
this.itemEquipmentPart = item_equipment_part;
this.itemLevel = item_level;
this.targetItem = target_item;
this.potentialOptionGrade = potential_option_grade;
this.additionalPotentialOptionGrade = additional_potential_option_grade;
this.upgradeGuarantee = upgrade_guarantee;
this.upgradeGuaranteeCount = upgrade_guarantee_count;
this.beforePotentialOption = before_potential_option.map((origin) => new PotentialResultOptionDto(origin));
this.beforeAdditionalPotentialOption =
before_additional_potential_option.map((origin) => new PotentialResultOptionDto(origin));
this.afterPotentialOption = after_potential_option.map((origin) => new PotentialResultOptionDto(origin));
this.afterAdditionalPotentialOption = after_additional_potential_option.map((origin) => new PotentialResultOptionDto(origin));
}
get isItemUpgrade() {
return this.itemUpgradeResult === '성공';
}
get isMiracleTimeFlag() {
return this.miracleTimeFlag !== '이벤트 적용되지 않음';
}
get potentialOptionGradeEnum() {
return lib.potentialOptionGradeFromString(this.potentialOptionGrade);
}
get additionalPotentialOptionGradeEnum() {
return lib.potentialOptionGradeFromString(this.additionalPotentialOptionGrade);
}
}
/**
* 잠재능력 재설정 결과 옵션 정보
*/
class PotentialResultOptionDto {
/**
* 옵션 명
*/
value;
/**
* 옵션 등급
*/
grade;
constructor(obj) {
const { value, grade } = obj;
this.value = value;
this.grade = grade;
}
get gradeEnum() {
return lib.potentialOptionGradeFromString(this.grade);
}
}
/**
* 잠재능력 재설정 히스토리 응답 정보
*/
class PotentialHistoryResponseDto {
/**
* 결과 건 수
*/
count;
/**
* 잠재능력 재설정 히스토리
*/
potentialHistory;
/**
* 페이징 처리를 위한 cursor
*/
nextCursor;
constructor(obj) {
const { count, potential_history, next_cursor } = obj;
this.count = count;
this.potentialHistory = potential_history.map((origin) => new PotentialHistoryDto(origin));
this.nextCursor = next_cursor;
}
}
exports.PotentialHistoryDto = PotentialHistoryDto;
exports.PotentialHistoryResponseDto = PotentialHistoryResponseDto;
exports.PotentialResultOptionDto = PotentialResultOptionDto;