UNPKG

maplestory-openapi

Version:

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

1,113 lines (1,108 loc) 28.5 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var characterItemEquipment = require('../../../common/dto/character/characterItemEquipment.js'); /** * Character equipped equipment information */ class CharacterItemEquipmentDto extends characterItemEquipment.CharacterItemEquipmentDto { /** * Reference date for query (SGT, daily data with hours and minutes set to 0) */ date; /** * Character gender */ characterGender; /** * Character job */ characterClass; /** * Active equipment preset number */ presetNo; /** * Equipment information */ itemEquipment; /** * Equipment information for Preset 1 */ itemEquipmentPreset1; /** * Equipment information for Preset 2 */ itemEquipmentPreset2; /** * Equipment information for Preset 3 */ itemEquipmentPreset3; /** * Title information */ title; /** * Evan Dragon equipment information (response provided if the character is Evan) */ dragonEquipment; /** * Mechanic equipment information (response provided if the character is a Mechanic) */ mechanicEquipment; constructor(obj) { super(); const { date, character_gender, character_class, preset_no, item_equipment, item_equipment_preset_1, item_equipment_preset_2, item_equipment_preset_3, title, dragon_equipment, mechanic_equipment, } = obj; this.date = date ? new Date(date) : null; this.characterGender = character_gender; this.characterClass = character_class; this.presetNo = preset_no; this.itemEquipment = item_equipment.map((equipment) => new CharacterItemEquipmentInfoDto(equipment)); this.itemEquipmentPreset1 = item_equipment_preset_1?.map((equipment) => new CharacterItemEquipmentInfoDto(equipment)) ?? []; this.itemEquipmentPreset2 = item_equipment_preset_2?.map((equipment) => new CharacterItemEquipmentInfoDto(equipment)) ?? []; this.itemEquipmentPreset3 = item_equipment_preset_3?.map((equipment) => new CharacterItemEquipmentInfoDto(equipment)) ?? []; this.title = title ? new CharacterItemEquipmentTitleDto(title) : null; this.dragonEquipment = dragon_equipment.map((equipment) => new CharacterItemEquipmentDragonInfoDto(equipment)); this.mechanicEquipment = mechanic_equipment.map((equipment) => new CharacterItemEquipmentMechanicInfoDto(equipment)); } } /** * Title information */ class CharacterItemEquipmentTitleDto extends characterItemEquipment.CharacterItemEquipmentTitleDto { /** * Title name */ titleName; /** * Title icon */ titleIcon; /** * Title description */ titleDescription; /** * Title validity period (SGT) */ dateExpire = null; /** * Whether the title is expired */ isExpired = null; /** * Title option validity period (expired:expired, null unlimited) (SGT) */ dateOptionExpire = null; /** * Whether the title option is expired */ isOptionExpired = null; constructor(obj) { super(); const { title_name, title_icon, title_description, date_expire, date_option_expire, } = obj; this.titleName = title_name; this.titleIcon = title_icon; this.titleDescription = title_description; if (date_expire === 'expired') { this.isExpired = true; } else if (typeof date_expire === 'string') { this.dateExpire = date_expire ? new Date(date_expire) : null; } if (date_option_expire === 'expired') { this.isOptionExpired = true; } else if (typeof date_option_expire === 'string') { this.dateOptionExpire = date_option_expire ? new Date(date_option_expire) : null; } } } /** * Additional equipment options */ class CharacterItemEquipmentAddOptionDto extends characterItemEquipment.CharacterItemEquipmentAddOptionDto { /** * STR */ str; /** * DEX */ dex; /** * INT */ int; /** * LUK */ luk; /** * Max HP */ maxHp; /** * Max MP */ maxMp; /** * Attack Power */ attackPower; /** * Magic ATT */ magicPower; /** * Defense */ armor; /** * Speed */ speed; /** * Jump */ jump; /** * Boss Damage (%) */ bossDamage; /** * Damage (%) */ damage; /** * All Stats (%) */ allStat; /** * Equipment level decrease */ equipmentLevelDecrease; constructor(obj) { super(); const { str, dex, int, luk, max_hp, max_mp, attack_power, magic_power, armor, speed, jump, boss_damage, damage, all_stat, equipment_level_decrease, } = obj; this.str = str; this.dex = dex; this.int = int; this.luk = luk; this.maxHp = max_hp; this.maxMp = max_mp; this.attackPower = attack_power; this.magicPower = magic_power; this.armor = armor; this.speed = speed; this.jump = jump; this.bossDamage = boss_damage; this.damage = damage; this.allStat = all_stat; this.equipmentLevelDecrease = equipment_level_decrease; } } /** * Basic equipment option information */ class CharacterItemEquipmentBaseOptionDto extends characterItemEquipment.CharacterItemEquipmentBaseOptionDto { /** * STR */ str; /** * DEX */ dex; /** * INT */ int; /** * LUK */ luk; /** * Max HP */ maxHp; /** * Max MP */ maxMp; /** * Attack Power */ attackPower; /** * Magic ATT */ magicPower; /** * Defense */ armor; /** * Speed */ speed; /** * Jump */ jump; /** * Boss Damage (%) */ bossDamage; /** * Ignore Enemy Defense (%) */ ignoreMonsterArmor; /** * All Stats (%) */ allStat; /** * Max HP (%) */ maxHpRate; /** * Max MP (%) */ maxMpRate; /** * Basic equipment level */ baseEquipmentLevel; constructor(obj) { super(); const { str, dex, int, luk, max_hp, max_mp, attack_power, magic_power, armor, speed, jump, boss_damage, ignore_monster_armor, all_stat, max_hp_rate, max_mp_rate, base_equipment_level, } = obj; this.str = str; this.dex = dex; this.int = int; this.luk = luk; this.maxHp = max_hp; this.maxMp = max_mp; this.attackPower = attack_power; this.magicPower = magic_power; this.armor = armor; this.speed = speed; this.jump = jump; this.bossDamage = boss_damage; this.ignoreMonsterArmor = ignore_monster_armor; this.allStat = all_stat; this.maxHpRate = max_hp_rate; this.maxMpRate = max_mp_rate; this.baseEquipmentLevel = base_equipment_level; } } /** * Miscellaneous equipment option information */ class CharacterItemEquipmentEtcOptionDto extends characterItemEquipment.CharacterItemEquipmentEtcOptionDto { /** * STR */ str; /** * DEX */ dex; /** * INT */ int; /** * LUK */ luk; /** * Max HP */ maxHp; /** * Max MP */ maxMp; /** * Attack Power */ attackPower; /** * Magic ATT */ magicPower; /** * Defense */ armor; /** * Speed */ speed; /** * Jump */ jump; constructor(obj) { super(); const { str, dex, int, luk, max_hp, max_mp, attack_power, magic_power, armor, speed, jump, } = obj; this.str = str; this.dex = dex; this.int = int; this.luk = luk; this.maxHp = max_hp; this.maxMp = max_mp; this.attackPower = attack_power; this.magicPower = magic_power; this.armor = armor; this.speed = speed; this.jump = jump; } } /** * Exceptional equipment option information */ class CharacterItemEquipmentExceptionalOptionDto extends characterItemEquipment.CharacterItemEquipmentExceptionalOptionDto { /** * STR */ str; /** * DEX */ dex; /** * INT */ int; /** * LUK */ luk; /** * Max HP */ maxHp; /** * Max MP */ maxMp; /** * Attack Power */ attackPower; /** * Magic ATT */ magicPower; /** * Number of exceptional boost applications */ exceptionalUpgrade; constructor(obj) { super(); const { str, dex, int, luk, max_hp, max_mp, attack_power, magic_power, exceptional_upgrade, } = obj; this.str = str; this.dex = dex; this.int = int; this.luk = luk; this.maxHp = max_hp; this.maxMp = max_mp; this.attackPower = attack_power; this.magicPower = magic_power; this.exceptionalUpgrade = exceptional_upgrade ?? 0; } } /** * Equipment Star Force option information */ class CharacterItemEquipmentStarforceOptionDto extends characterItemEquipment.CharacterItemEquipmentStarforceOptionDto { /** * STR */ str; /** * DEX */ dex; /** * INT */ int; /** * LUK */ luk; /** * Max HP */ maxHp; /** * Max MP */ maxMp; /** * Attack Power */ attackPower; /** * Magic ATT */ magicPower; /** * Defense */ armor; /** * Speed */ speed; /** * Jump */ jump; constructor(obj) { super(); const { str, dex, int, luk, max_hp, max_mp, attack_power, magic_power, armor, speed, jump, } = obj; this.str = str; this.dex = dex; this.int = int; this.luk = luk; this.maxHp = max_hp; this.maxMp = max_mp; this.attackPower = attack_power; this.magicPower = magic_power; this.armor = armor; this.speed = speed; this.jump = jump; } } /** * Final equipment option information */ class CharacterItemEquipmentTotalOptionDto extends characterItemEquipment.CharacterItemEquipmentTotalOptionDto { /** * STR */ str; /** * DEX */ dex; /** * INT */ int; /** * LUK */ luk; /** * Max HP */ maxHp; /** * Max MP */ maxMp; /** * Attack Power */ attackPower; /** * Magic ATT */ magicPower; /** * Defense */ armor; /** * Speed */ speed; /** * Jump */ jump; /** * Boss Damage (%) */ bossDamage; /** * Ignore Enemy Defense (%) */ ignoreMonsterArmor; /** * All Stats (%) */ allStat; /** * Damage (%) */ damage; /** * Equipment level decreases */ equipmentLevelDecrease; /** * Max HP (%) */ maxHpRate; /** * Max MP (%) */ maxMpRate; constructor(obj) { super(); const { str, dex, int, luk, max_hp, max_mp, attack_power, magic_power, armor, speed, jump, boss_damage, ignore_monster_armor, all_stat, damage, equipment_level_decrease, max_hp_rate, max_mp_rate, } = obj; this.str = str; this.dex = dex; this.int = int; this.luk = luk; this.maxHp = max_hp; this.maxMp = max_mp; this.attackPower = attack_power; this.magicPower = magic_power; this.armor = armor; this.speed = speed; this.jump = jump; this.bossDamage = boss_damage; this.ignoreMonsterArmor = ignore_monster_armor; this.allStat = all_stat; this.damage = damage; this.equipmentLevelDecrease = equipment_level_decrease; this.maxHpRate = max_hp_rate; this.maxMpRate = max_mp_rate; } } /** * Evan Dragon equipment information */ class CharacterItemEquipmentDragonInfoDto extends characterItemEquipment.CharacterItemEquipmentDragonInfoDto { /** * Equipment part name */ itemEquipmentPart; /** * Equipment slot position */ itemEquipmentSlot; /** * Equipment name */ itemName; /** * Equipment icon */ itemIcon; /** * Equipment description */ itemDescription; /** * Equipment type */ itemShapeName; /** * Equipment type icon */ itemShapeIcon; /** * Gender-specific equipment */ itemGender; /** * Final equipment option information */ itemTotalOption; /** * Basic equipment option information */ itemBaseOption; /** * Equipment level increases */ equipmentLevelIncrease; /** * Exceptional equipment option information */ itemExceptionalOption; /** * Additional equipment options */ itemAddOption; /** * Growth EXP */ growthExp; /** * Growth level */ growthLevel; /** * Number of upgrades */ scrollUpgrade; /** * Number of scissors usage available (Untradable, 255 for equipment without scissors usage count) */ cuttableCount; /** * Golden Hammer refinement applied (true:applied, false:not applied) */ goldenHammerFlag; /** * Number of restoration attempts available */ scrollResilienceCount; /** * Number of upgrades available */ scrollUpgradeableCount; /** * Soul name */ soulName; /** * Soul option */ soulOption; /** * Miscellaneous equipment option information */ itemEtcOption; /** * Enhancement level */ starforce; /** * Usage status of Miraculous Equip Enhancement Scroll (true:used, false:not used) */ starforceScrollFlag; /** * Equipment Star Force option information */ itemStarforceOption; /** * Special Skill Ring */ specialRingLevel; /** * Equipment expiration date (SGT) */ dateExpire = null; /** * Whether the equipment is expired */ isExpired = null; constructor(obj) { super(); 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; this.itemEquipmentPart = item_equipment_part; this.itemEquipmentSlot = item_equipment_slot; this.itemName = item_name; this.itemIcon = item_icon; this.itemDescription = item_description; this.itemShapeName = item_shape_name; this.itemShapeIcon = item_shape_icon; this.itemGender = item_gender; this.itemTotalOption = new CharacterItemEquipmentTotalOptionDto(item_total_option); this.itemBaseOption = new CharacterItemEquipmentBaseOptionDto(item_base_option); this.equipmentLevelIncrease = equipment_level_increase; this.itemExceptionalOption = new CharacterItemEquipmentExceptionalOptionDto(item_exceptional_option); this.itemAddOption = new CharacterItemEquipmentAddOptionDto(item_add_option); this.growthExp = growth_exp; this.growthLevel = growth_level; this.scrollUpgrade = scroll_upgrade; this.cuttableCount = cuttable_count; this.goldenHammerFlag = golden_hammer_flag; this.scrollResilienceCount = scroll_resilience_count; this.scrollUpgradeableCount = scroll_upgradeable_count; this.soulName = soul_name; this.soulOption = soul_option; this.itemEtcOption = new CharacterItemEquipmentEtcOptionDto(item_etc_option); this.starforce = starforce; this.starforceScrollFlag = starforce_scroll_flag; this.itemStarforceOption = new CharacterItemEquipmentStarforceOptionDto(item_starforce_option); this.specialRingLevel = special_ring_level; if (date_expire === 'expired') { this.isExpired = true; } else if (typeof date_expire === 'string') { this.dateExpire = date_expire ? new Date(date_expire) : null; } } } /** * Mechanic equipment information */ class CharacterItemEquipmentMechanicInfoDto extends characterItemEquipment.CharacterItemEquipmentMechanicInfoDto { /** * Equipment part name */ itemEquipmentPart; /** * Equipment slot position */ itemEquipmentSlot; /** * Equipment name */ itemName; /** * Equipment icon */ itemIcon; /** * Equipment description */ itemDescription; /** * Equipment type */ itemShapeName; /** * Equipment type icon */ itemShapeIcon; /** * Gender-specific equipment */ itemGender; /** * Final equipment option information */ itemTotalOption; /** * Basic equipment option information */ itemBaseOption; /** * Equipment level increases */ equipmentLevelIncrease; /** * Exceptional equipment option information */ itemExceptionalOption; /** * Additional equipment options */ itemAddOption; /** * Growth EXP */ growthExp; /** * Growth level */ growthLevel; /** * Number of upgrades */ scrollUpgrade; /** * Number of scissors usage available (Untradable, 255 for equipment without scissors usage count) */ cuttableCount; /** * Golden Hammer refinement applied (true:applied, false:not applied) */ goldenHammerFlag; /** * Number of restoration attempts available */ scrollResilienceCount; /** * Number of upgrades available */ scrollUpgradeableCount; /** * Soul name */ soulName; /** * Soul option */ soulOption; /** * Miscellaneous equipment option information */ itemEtcOption; /** * Enhancement level */ starforce; /** * Usage status of Miraculous Equip Enhancement Scroll (true:used, false:not used) */ starforceScrollFlag; /** * Equipment Star Force option information */ itemStarforceOption; /** * Special Skill Ring */ specialRingLevel; /** * Equipment expiration date (SGT) */ dateExpire = null; /** * Whether the equipment is expired */ isExpired = null; constructor(obj) { super(); 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; this.itemEquipmentPart = item_equipment_part; this.itemEquipmentSlot = item_equipment_slot; this.itemName = item_name; this.itemIcon = item_icon; this.itemDescription = item_description; this.itemShapeName = item_shape_name; this.itemShapeIcon = item_shape_icon; this.itemGender = item_gender; this.itemTotalOption = new CharacterItemEquipmentTotalOptionDto(item_total_option); this.itemBaseOption = new CharacterItemEquipmentBaseOptionDto(item_base_option); this.equipmentLevelIncrease = equipment_level_increase; this.itemExceptionalOption = new CharacterItemEquipmentExceptionalOptionDto(item_exceptional_option); this.itemAddOption = new CharacterItemEquipmentAddOptionDto(item_add_option); this.growthExp = growth_exp; this.growthLevel = growth_level; this.scrollUpgrade = scroll_upgrade; this.cuttableCount = cuttable_count; this.goldenHammerFlag = golden_hammer_flag; this.scrollResilienceCount = scroll_resilience_count; this.scrollUpgradeableCount = scroll_upgradeable_count; this.soulName = soul_name; this.soulOption = soul_option; this.itemEtcOption = new CharacterItemEquipmentEtcOptionDto(item_etc_option); this.starforce = starforce; this.starforceScrollFlag = starforce_scroll_flag; this.itemStarforceOption = new CharacterItemEquipmentStarforceOptionDto(item_starforce_option); this.specialRingLevel = special_ring_level; if (date_expire === 'expired') { this.isExpired = true; } else if (typeof date_expire === 'string') { this.dateExpire = date_expire ? new Date(date_expire) : null; } } } /** * Equipment information */ class CharacterItemEquipmentInfoDto extends characterItemEquipment.CharacterItemEquipmentInfoDto { /** * Equipment part name */ itemEquipmentPart; /** * Equipment slot position */ itemEquipmentSlot; /** * Equipment name */ itemName; /** * Equipment icon */ itemIcon; /** * Equipment description */ itemDescription; /** * Equipment type */ itemShapeName; /** * Equipment type icon */ itemShapeIcon; /** * Gender-specific equipment */ itemGender; /** * Final equipment option information */ itemTotalOption; /** * Basic equipment option information */ itemBaseOption; /** * Potential grade */ potentialOptionGrade; /** * Additional potential grade */ additionalPotentialOptionGrade; /** * First Potential option */ potentialOption1; /** * Second Potential option */ potentialOption2; /** * Third Potential option */ potentialOption3; /** * First additional Potential option */ additionalPotentialOption1; /** * Second additional Potential option */ additionalPotentialOption2; /** * Third additional Potential option */ additionalPotentialOption3; /** * Equipment level increase */ equipmentLevelIncrease; /** * Exceptional equipment option information */ itemExceptionalOption; /** * Additional equipment options */ itemAddOption; /** * Growth EXP */ growthExp; /** * Growth level */ growthLevel; /** * Number of upgrade attempts */ scrollUpgrade; /** * Number of scissors usage available (Untradable, 255 for equipment without scissors usage count) */ cuttableCount; /** * Golden Hammer refinement applied (true:applied, false:not applied) */ goldenHammerFlag; /** * Number of restoration attempts available */ scrollResilienceCount; /** * Number of upgrades available */ scrollUpgradeableCount; /** * Soul name */ soulName; /** * Soul option */ soulOption; /** * Miscellaneous equipment option information */ itemEtcOption; /** * Enhancement level */ starforce; /** * Usage status of Miraculous Equip Enhancement Scroll (true:used, false:not used) */ starforceScrollFlag; /** * Equipment Star Force option information */ itemStarforceOption; /** * Special Skill Ring */ specialRingLevel; /** * Equipment expiration date (SGT) */ dateExpire = null; /** * Whether the equipment is expired */ isExpired = null; constructor(obj) { super(); 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; this.itemEquipmentPart = item_equipment_part; this.itemEquipmentSlot = item_equipment_slot; this.itemName = item_name; this.itemIcon = item_icon; this.itemDescription = item_description; this.itemShapeName = item_shape_name; this.itemShapeIcon = item_shape_icon; this.itemGender = item_gender; this.itemTotalOption = new CharacterItemEquipmentTotalOptionDto(item_total_option); this.itemBaseOption = new CharacterItemEquipmentBaseOptionDto(item_base_option); this.potentialOptionGrade = potential_option_grade; this.additionalPotentialOptionGrade = additional_potential_option_grade; this.potentialOption1 = potential_option_1; this.potentialOption2 = potential_option_2; this.potentialOption3 = potential_option_3; this.additionalPotentialOption1 = additional_potential_option_1; this.additionalPotentialOption2 = additional_potential_option_2; this.additionalPotentialOption3 = additional_potential_option_3; this.equipmentLevelIncrease = equipment_level_increase; this.itemExceptionalOption = new CharacterItemEquipmentExceptionalOptionDto(item_exceptional_option); this.itemAddOption = new CharacterItemEquipmentAddOptionDto(item_add_option); this.growthExp = growth_exp; this.growthLevel = growth_level; this.scrollUpgrade = scroll_upgrade; this.cuttableCount = cuttable_count; this.goldenHammerFlag = golden_hammer_flag; this.scrollResilienceCount = scroll_resilience_count; this.scrollUpgradeableCount = scroll_upgradeable_count; this.soulName = soul_name; this.soulOption = soul_option; this.itemEtcOption = new CharacterItemEquipmentEtcOptionDto(item_etc_option); this.starforce = starforce; this.starforceScrollFlag = starforce_scroll_flag; this.itemStarforceOption = new CharacterItemEquipmentStarforceOptionDto(item_starforce_option); this.specialRingLevel = special_ring_level; if (date_expire === 'expired') { this.isExpired = true; } else if (typeof date_expire === 'string') { this.dateExpire = date_expire ? new Date(date_expire) : null; } } } exports.CharacterItemEquipmentAddOptionDto = CharacterItemEquipmentAddOptionDto; exports.CharacterItemEquipmentBaseOptionDto = CharacterItemEquipmentBaseOptionDto; exports.CharacterItemEquipmentDragonInfoDto = CharacterItemEquipmentDragonInfoDto; exports.CharacterItemEquipmentDto = CharacterItemEquipmentDto; exports.CharacterItemEquipmentEtcOptionDto = CharacterItemEquipmentEtcOptionDto; exports.CharacterItemEquipmentExceptionalOptionDto = CharacterItemEquipmentExceptionalOptionDto; exports.CharacterItemEquipmentInfoDto = CharacterItemEquipmentInfoDto; exports.CharacterItemEquipmentMechanicInfoDto = CharacterItemEquipmentMechanicInfoDto; exports.CharacterItemEquipmentStarforceOptionDto = CharacterItemEquipmentStarforceOptionDto; exports.CharacterItemEquipmentTitleDto = CharacterItemEquipmentTitleDto; exports.CharacterItemEquipmentTotalOptionDto = CharacterItemEquipmentTotalOptionDto;