UNPKG

maplestory-openapi

Version:

This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.

161 lines (156 loc) 4.44 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var lib = require('../../../common/lib.js'); /** * 큐브 히스토리 */ class CubeHistoryDto { /** * 큐브 히스토리 식별자 */ id; /** * 캐릭터 명 */ characterName; /** * 사용 일시 */ dateCreate; /** * 사용 큐브 */ cubeType; /** * 사용 결과 */ itemUpgradeResult; /** * 미라클 타임 적용 여부 */ miracleTimeFlag; /** * 장비 분류 */ itemEquipmentPart; /** * 장비 레벨 */ itemLevel; /** * 큐브 사용한 장비 */ targetItem; /** * 잠재능력 등급 */ potentialOptionGrade; /** * 에디셔널 잠재능력 등급 */ additionalPotentialOptionGrade; /** * 천장에 도달하여 확정 등급 상승한 여부 */ upgradeGuarantee; /** * 현재까지 쌓은 스택 */ upgradeGuaranteeCount; /** * 사용 전 잠재능력 옵션 */ beforePotentialOption; /** * 사용 전 에디셔널 잠재능력 옵션 */ beforeAdditionalPotentialOption; /** * 사용 후 잠재능력 옵션 */ afterPotentialOption; /** * 사용 후 에디셔널 잠재능력 옵션 */ afterAdditionalPotentialOption; constructor(obj) { const { id, character_name, date_create, cube_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.cubeType = cube_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 CubeResultOptionDto(origin)); this.beforeAdditionalPotentialOption = before_additional_potential_option.map((origin) => new CubeResultOptionDto(origin)); this.afterPotentialOption = after_potential_option.map((origin) => new CubeResultOptionDto(origin)); this.afterAdditionalPotentialOption = after_additional_potential_option.map((origin) => new CubeResultOptionDto(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 CubeResultOptionDto { /** * 옵션 명 */ value; /** * 옵션 등급 */ grade; constructor(obj) { const { value, grade } = obj; this.value = value; this.grade = grade; } get gradeEnum() { return lib.potentialOptionGradeFromString(this.grade); } } /** * 큐브 히스토리 응답 정보 */ class CubeHistoryResponseDto { /** * 결과 건 수 */ count; /** * 큐브 히스토리 */ cubeHistory; /** * 페이징 처리를 위한 cursor */ nextCursor; constructor(obj) { const { count, cube_history, next_cursor } = obj; this.count = count; this.cubeHistory = cube_history.map((origin) => new CubeHistoryDto(origin)); this.nextCursor = next_cursor; } } exports.CubeHistoryDto = CubeHistoryDto; exports.CubeHistoryResponseDto = CubeHistoryResponseDto; exports.CubeResultOptionDto = CubeResultOptionDto;