maplestory-openapi
Version:
This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.
1,313 lines (1,310 loc) • 61 kB
JavaScript
import axios from 'axios';
import '../../../node_modules/buffer/index.js';
import xml2js from 'xml2js';
import { CharacterDto } from './dto/character/character.js';
import { CharacterAbilityDto } from './dto/character/characterAbility.js';
import { CharacterAndroidEquipmentDto } from './dto/character/characterAndroidEquipment.js';
import { CharacterBasicDto } from './dto/character/characterBasic.js';
import { CharacterBeautyEquipmentDto } from './dto/character/characterBeautyEquipment.js';
import { CharacterCashItemEquipmentDto } from './dto/character/characterCashItemEquipment.js';
import { CharacterDojangDto } from './dto/character/characterDojang.js';
import { CharacterHexaMatrixDto } from './dto/character/characterHexaMatrix.js';
import { CharacterHexaMatrixStatDto } from './dto/character/characterHexaMatrixStat.js';
import { CharacterHyperStatDto } from './dto/character/characterHyperStat.js';
import { CharacterImageDto } from './dto/character/characterImage.js';
import { CharacterItemEquipmentDto } from './dto/character/characterItemEquipment.js';
import { CharacterLinkSkillDto } from './dto/character/characterLinkSkill.js';
import { CharacterListDto } from './dto/character/characterList.js';
import { CharacterPetEquipmentDto } from './dto/character/characterPetEquipment.js';
import { CharacterPopularityDto } from './dto/character/characterPopularity.js';
import { CharacterPropensityDto } from './dto/character/characterPropensity.js';
import { CharacterSetEffectDto } from './dto/character/characterSetEffect.js';
import { CharacterSkillDto } from './dto/character/characterSkill.js';
import { CharacterStatDto } from './dto/character/characterStat.js';
import { CharacterSymbolEquipmentDto } from './dto/character/characterSymbolEquipment.js';
import { CharacterVMatrixDto } from './dto/character/characterVMatrix.js';
import { GuildDto } from './dto/guild/guild.js';
import { GuildBasicDto } from './dto/guild/guildBasic.js';
import { CubeHistoryResponseDto } from './dto/history/cubeHistory.js';
import { PotentialHistoryResponseDto } from './dto/history/potentialHistory.js';
import { StarforceHistoryResponseDto } from './dto/history/starforceHistory.js';
import { InspectionInfoDto } from './dto/inspectionInfo.js';
import { CashshopNoticeDetailDto } from './dto/notice/cashshopNoticeDetail.js';
import { CashshopNoticeListDto } from './dto/notice/cashshopNoticeList.js';
import { EventNoticeDetailDto } from './dto/notice/eventNoticeDetail.js';
import { EventNoticeListDto } from './dto/notice/eventNoticeList.js';
import { NoticeDetailDto } from './dto/notice/noticeDetail.js';
import { NoticeListDto } from './dto/notice/noticeList.js';
import { UpdateNoticeDetailDto } from './dto/notice/updateNoticeDetail.js';
import { UpdateNoticeListDto } from './dto/notice/updateNoticeList.js';
import { AchievementRankingResponseDto } from './dto/ranking/achievementRanking.js';
import { DojangRankingResponseDto } from './dto/ranking/dojangRanking.js';
import { GuildRankingResponseDto } from './dto/ranking/guildRanking.js';
import { OverallRankingResponseDto } from './dto/ranking/overallRanking.js';
import { TheSeedRankingResponseDto } from './dto/ranking/theSeedRanking.js';
import { UnionRankingResponseDto } from './dto/ranking/unionRanking.js';
import { UnionDto } from './dto/union/union.js';
import { UnionArtifactDto } from './dto/union/unionArtifact.js';
import { UnionChampionDto } from './dto/union/unionChampion.js';
import { UnionRaiderDto } from './dto/union/unionRaider.js';
import { CharacterImageAction, CharacterImageEmotion, CharacterImageWeaponMotion } from '../common/enum/characterImage.js';
import { MapleStoryApi as MapleStoryApi$1 } from '../common/mapleStoryApi.js';
import { __exports as buffer } from '../../../_virtual/index.js_commonjs-exports.js';
/**
* MapleStory OpenAPI client for KMS.<br>
* This is an implementation of <a href="https://openapi.nexon.com/game/maplestory">MapleStory API</a>
*/
class MapleStoryApi extends MapleStoryApi$1 {
subUrl = 'maplestory';
timezoneOffset = 540;
constructor(apiKey) {
super(apiKey);
}
//#region 캐릭터 정보 조회
/**
* 캐릭터 식별자(ocid)를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param characterName 캐릭터 명
*/
async getCharacter(characterName) {
const path = `${this.subUrl}/v1/id`;
const { data } = await this.client.get(path, {
params: {
character_name: characterName,
},
});
return new CharacterDto(data);
}
/**
* 계정의 보유 캐릭터 목록을 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*/
async getCharacterList() {
const path = `${this.subUrl}/v1/character/list`;
const { data } = await this.client.get(path);
return new CharacterListDto(data);
}
/**
* 기본 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterBasic(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/basic`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterBasicDto(data);
}
/**
* 캐릭터 외형 이미지 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param imageOptions 캐릭터 외형 파라미터
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterImage(ocid, imageOptions, dateOptions) {
const { date, characterImage: path } = await this.getCharacterBasic(ocid, dateOptions);
const action = imageOptions?.action ?? CharacterImageAction.Stand1;
const emotion = imageOptions?.emotion ?? CharacterImageEmotion.Default;
const wmotion = imageOptions?.wmotion ?? CharacterImageWeaponMotion.Default;
const actionFrame = imageOptions?.actionFrame ?? 0;
const emotionFrame = imageOptions?.emotionFrame ?? 0;
const width = 96;
const height = 96;
const x = imageOptions?.x ?? null;
const y = imageOptions?.y ?? null;
const query = {
action: `${action}.${actionFrame}`,
emotion: `${emotion}.${emotionFrame}`,
wmotion,
width,
height,
x,
y,
};
const urlImageToBase64 = async (path, query) => {
const { data, headers } = await axios.get(path, {
params: query,
responseType: 'arraybuffer',
});
const base64 = buffer.Buffer.from(data, 'binary').toString('base64');
const mimeType = headers['content-type'];
return `data:${mimeType};base64,${base64}`;
};
const [originImage, image] = await Promise.all([
urlImageToBase64(path),
urlImageToBase64(path, query),
]);
return new CharacterImageDto({
date,
originUrl: path,
originImage,
image,
action,
emotion,
wmotion,
actionFrame,
emotionFrame,
width,
height,
x,
y,
});
}
/**
* 인기도 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterPopularity(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/popularity`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterPopularityDto(data);
}
/**
* 종합 능력치 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterStat(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/stat`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterStatDto(data);
}
/**
* 하이퍼스탯 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterHyperStat(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/hyper-stat`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterHyperStatDto(data);
}
/**
* 성향 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterPropensity(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/propensity`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterPropensityDto(data);
}
/**
* 어빌리티 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterAbility(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/ability`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterAbilityDto(data);
}
/**
* 장착한 장비 중 캐시 장비를 제외한 나머지 장비 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterItemEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/item-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterItemEquipmentDto(data);
}
/**
* 장착한 캐시 장비 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterCashItemEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/cashitem-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterCashItemEquipmentDto(data);
}
/**
* 장착한 심볼 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterSymbolEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/symbol-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterSymbolEquipmentDto(data);
}
/**
* 적용받고 있는 세트 효과 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterSetEffect(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/set-effect`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterSetEffectDto(data);
}
/**
* 장착 중인 헤어, 성형, 피부 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterBeautyEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/beauty-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterBeautyEquipmentDto(data);
}
/**
* 장착한 안드로이드 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterAndroidEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/android-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterAndroidEquipmentDto(data);
}
/**
* 장착한 펫 및 펫 스킬, 장비 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterPetEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/pet-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterPetEquipmentDto(data);
}
/**
* 캐릭터 스킬과 하이퍼 스킬 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param characterSkillGrade 조회하고자 하는 전직 차수 <a href="https://openapi.nexon.com/ko/game/maplestory/?id=14">Available values</a>
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterSkill(ocid, characterSkillGrade, dateOptions) {
const path = `${this.subUrl}/v1/character/skill`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
character_skill_grade: characterSkillGrade,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterSkillDto(data);
}
/**
* 장착 링크 스킬 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterLinkSkill(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/link-skill`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterLinkSkillDto(data);
}
/**
* V매트릭스 슬롯 정보와 장착한 V코어 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterVMatrix(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/vmatrix`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterVMatrixDto(data);
}
/**
* HEXA 매트릭스에 장착한 HEXA 코어 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterHexaMatrix(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/hexamatrix`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterHexaMatrixDto(data);
}
/**
* HEXA 매트릭스에 설정한 HEXA 스탯 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterHexaMatrixStat(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/hexamatrix-stat`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterHexaMatrixStatDto(data);
}
/**
* 캐릭터 무릉도장 최고 기록 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getCharacterDojang(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/dojang`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterDojangDto(data);
}
//#endregion
//#region 유니온 정보 조회
/**
* 유니온 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getUnion(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new UnionDto(data);
}
/**
* 유니온 공격대 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getUnionRaider(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union-raider`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new UnionRaiderDto(data);
}
/**
* 유니온 아티팩트 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getUnionArtifact(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union-artifact`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new UnionArtifactDto(data);
}
/**
* 유니온 챔피언 정보를 조회합니다.<br>
* 유니온 챔피언 정보는 2025년 2월 20일 메이플스토리 점검 이후 데이터부터 조회 가능합니다.<br>
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param ocid 캐릭터 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getUnionChampion(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union-champion`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new UnionChampionDto(data);
}
//#endregion
//#region 길드 정보 조회
/**
* 길드 식별자(oguild_id) 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param guildName 길드 명
* @param worldName 월드 명
*/
async getGuild(guildName, worldName) {
const path = `${this.subUrl}/v1/guild/id`;
const { data } = await this.client.get(path, {
params: {
guild_name: guildName,
world_name: worldName,
},
});
return new GuildDto(data);
}
/**
* 길드 기본 정보를 조회합니다.
* - 메이플스토리 게임 데이터는 평균 15분 후 확인 가능합니다.
* - 2023년 12월 21일 데이터부터 조회할 수 있습니다.
* - 과거 데이터는 원하는 일자를 입력해 조회할 수 있으며, 전일 데이터는 다음날 오전 2시부터 확인할 수 있습니다. (12월 22일 데이터 조회 시, 22일 00시부터 23일 00시 사이 데이터가 조회 됩니다.)
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
* - 해당 API는 메이플스토리 한국의 데이터가 제공됩니다.
*
* @param guildId 길드 식별자
* @param dateOptions 조회 기준일 (KST)
*/
async getGuildBasic(guildId, dateOptions) {
const path = `${this.subUrl}/v1/guild/basic`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 21,
})
: undefined;
const query = {
oguild_id: guildId,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new GuildBasicDto(data);
}
async getStarforceHistory(count, parameter) {
const path = `${this.subUrl}/v1/history/starforce`;
const query = {
count,
};
if (typeof parameter === 'string') {
query.cursor = parameter;
}
else if (typeof parameter === 'object' || parameter === undefined) {
query.date = this.toDateString(parameter ??
this.getProperDefaultDateOptions({
hour: 0,
minute: 0,
dateOffset: 0,
}), {
year: 2023,
month: 12,
day: 27,
});
}
const { data } = await this.client.get(path, {
params: query,
});
return new StarforceHistoryResponseDto(data);
}
async getCubeHistory(count, parameter) {
const path = `${this.subUrl}/v1/history/cube`;
const query = {
count,
};
if (typeof parameter === 'string') {
query.cursor = parameter;
}
else if (typeof parameter === 'object' || parameter === undefined) {
query.date = this.toDateString(parameter ??
this.getProperDefaultDateOptions({
hour: 0,
minute: 0,
dateOffset: 0,
}));
}
const { data } = await this.client.get(path, {
params: query,
});
return new CubeHistoryResponseDto(data);
}
async getPotentialHistory(count, parameter) {
const path = `${this.subUrl}/v1/history/potential`;
const query = {
count,
};
if (typeof parameter === 'string') {
query.cursor = parameter;
}
else if (typeof parameter === 'object' || parameter === undefined) {
query.date = this.toDateString(parameter ??
this.getProperDefaultDateOptions({
hour: 0,
minute: 0,
dateOffset: 0,
}), {
year: 2024,
month: 1,
day: 25,
});
}
const { data } = await this.client.get(path, {
params: query,
});
return new PotentialHistoryResponseDto(data);
}
//#endregion
//#region 랭킹 정보 조회
/**
* 종합 랭킹 정보를 조회합니다.
* - 2023년 12월 22일 데이터부터 조회할 수 있습니다.
* - 오전 8시 30분부터 오늘의 랭킹 정보를 조회할 수 있습니다.
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
*
* @param filterOptions 검색 기준
* @param dateOptions 조회 기준일 (KST).
*
*/
async getOverallRanking(filterOptions, dateOptions = this.getProperDefaultDateOptions({
hour: 8,
minute: 30,
dateOffset: 0,
})) {
const path = `${this.subUrl}/v1/ranking/overall`;
const query = {
date: this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 22,
}),
};
if (filterOptions) {
const { worldName, worldType, characterClass, ocid, page } = filterOptions;
query.world_name = worldName;
query.world_type = worldType;
query.class = characterClass;
query.ocid = ocid;
query.page = page;
}
const { data } = await this.client.get(path, {
params: query,
});
return new OverallRankingResponseDto(data);
}
/**
* 유니온 랭킹 정보를 조회합니다.
* - 2023년 12월 22일 데이터부터 조회할 수 있습니다.
* - 오전 8시 30분부터 오늘의 랭킹 정보를 조회할 수 있습니다.
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
*
* @param filterOptions 검색 기준
* @param dateOptions 조회 기준일 (KST)
*/
async getUnionRanking(filterOptions, dateOptions = this.getProperDefaultDateOptions({
hour: 8,
minute: 30,
dateOffset: 0,
})) {
const path = `${this.subUrl}/v1/ranking/union`;
const query = {
date: this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 22,
}),
};
if (filterOptions) {
const { worldName, ocid, page } = filterOptions;
query.world_name = worldName;
query.ocid = ocid;
query.page = page;
}
const { data } = await this.client.get(path, {
params: query,
});
return new UnionRankingResponseDto(data);
}
/**
* 길드 랭킹 정보를 조회합니다.
* - 2023년 12월 22일 데이터부터 조회할 수 있습니다.
* - 오전 8시 30분부터 오늘의 랭킹 정보를 조회할 수 있습니다.
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
*
* @param filterOptions 검색 기준
* @param dateOptions 조회 기준일 (KST)
*/
async getGuildRanking(filterOptions, dateOptions = this.getProperDefaultDateOptions({
hour: 8,
minute: 30,
dateOffset: 0,
})) {
const path = `${this.subUrl}/v1/ranking/guild`;
const query = {
date: this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 22,
}),
ranking_type: 0,
};
if (filterOptions) {
const { worldName, rankingType, ocid, page } = filterOptions;
query.world_name = worldName;
query.ranking_type = rankingType;
query.ocid = ocid;
query.page = page;
}
const { data } = await this.client.get(path, {
params: query,
});
return new GuildRankingResponseDto(data);
}
/**
* 무릉도장 랭킹 정보를 조회합니다.
* - 2023년 12월 22일 데이터부터 조회할 수 있습니다.
* - 오전 8시 30분부터 오늘의 랭킹 정보를 조회할 수 있습니다.
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
*
* @param filterOptions 검색 기준
* @param dateOptions 조회 기준일 (KST)
*/
async getDojangRanking(filterOptions, dateOptions = this.getProperDefaultDateOptions({
hour: 8,
minute: 30,
dateOffset: 0,
})) {
const path = `${this.subUrl}/v1/ranking/dojang`;
const query = {
date: this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 22,
}),
difficulty: 0,
};
if (filterOptions) {
const { worldName, difficulty, characterClass, ocid, page } = filterOptions;
query.world_name = worldName;
query.difficulty = difficulty;
query.class = characterClass;
query.ocid = ocid;
query.page = page;
}
const { data } = await this.client.get(path, {
params: query,
});
return new DojangRankingResponseDto(data);
}
/**
* 더 시드 랭킹 정보를 조회합니다.
* - 2023년 12월 22일 데이터부터 조회할 수 있습니다.
* - 오전 8시 30분부터 오늘의 랭킹 정보를 조회할 수 있습니다.
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
*
* @param filterOptions 검색 기준
* @param dateOptions 조회 기준일 (KST)
*/
async getSeedRanking(filterOptions, dateOptions = this.getProperDefaultDateOptions({
hour: 8,
minute: 30,
dateOffset: 0,
})) {
const path = `${this.subUrl}/v1/ranking/theseed`;
const query = {
date: this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 22,
}),
};
if (filterOptions) {
const { worldName, ocid, page } = filterOptions;
query.world_name = worldName;
query.ocid = ocid;
query.page = page;
}
const { data } = await this.client.get(path, {
params: query,
});
return new TheSeedRankingResponseDto(data);
}
/**
* 업적 랭킹 정보를 조회합니다.
* - 2023년 12월 22일 데이터부터 조회할 수 있습니다.
* - 오전 8시 30분부터 오늘의 랭킹 정보를 조회할 수 있습니다.
* - 게임 콘텐츠 변경으로 ocid가 변경될 수 있습니다. ocid 기반 서비스 갱신 시 유의해 주시길 바랍니다.
*
* @param filterOptions 검색 기준
* @param dateOptions 조회 기준일 (KST)
*/
async getAchievementRanking(filterOptions, dateOptions = this.getProperDefaultDateOptions({
hour: 8,
minute: 30,
dateOffset: 0,
})) {
const path = `${this.subUrl}/v1/ranking/achievement`;
const query = {
date: this.toDateString(dateOptions, {
year: 2023,
month: 12,
day: 22,
}),
};
if (filterOptions) {
const { ocid, page } = filterOptions;
query.ocid = ocid;
query.page = page;
}
const { data } = await this.client.get(path, {
params: query,
});
return new AchievementRankingResponseDto(data);
}
//#endregion
//#region 공지 정보 조회
/**
* 메이플스토리 공지사항에 최근 등록된 게시글 20개를 조회합니다.
*
* - 공지 정보 API는 데이터 최신화(공지 내용 수정/ 업데이트 고려)를 위해 실시간 조회 또는 최소 일배치 작업을 권장합니다.
* - 실시간으로 정보를 제공하지 않는 경우, 신규/수정 공지 내용이 반영되지 않을 수 있으니 서비스 이용 유저에게 홈페이지 공지 사항을 확인하라는 가이드를 제공해주세요.
*/
async getNoticeList() {
const path = `${this.subUrl}/v1/notice`;
const { data } = await this.client.get(path);
return new NoticeListDto(data);
}
/**
* 메이플스토리 공지사항 게시글 세부 사항을 조회합니다.
*
* - 공지 정보 API는 데이터 최신화(공지 내용 수정/ 업데이트 고려)를 위해 실시간 조회 또는 최소 일배치 작업을 권장합니다.
* - 실시간으로 정보를 제공하지 않는 경우, 신규/수정 공지 내용이 반영되지 않을 수 있으니 서비스 이용 유저에게 홈페이지 공지 사항을 확인하라는 가이드를 제공해주세요.
* @param noticeId 공지 식별자
*/
async getNoticeDetail(noticeId) {
const path = `${this.subUrl}/v1/notice/detail`;
const query = {
notice_id: noticeId,
};
const { data } = await this.client.get(path, {
params: query,
});
return new NoticeDetailDto(data);
}
/**
* 메이플스토리 업데이트에 최근 등록된 게시글 20개를 조회합니다.
*
* - 공지 정보 API는 데이터 최신화(공지 내용 수정/ 업데이트 고려)를 위해 실시간 조회 또는 최소 일배치 작업을 권장합니다.
* - 실시간으로 정보를 제공하지 않는 경우, 신규/수정 공지 내용이 반영되지 않을 수 있으니 서비스 이용 유저에게 홈페이지 공지 사항을 확인하라는 가이드를 제공해주세요.
*/
async getUpdateNoticeList() {
const path = `${this.subUrl}/v1/notice-update`;
const { data } = await this.client.get(path);
return new UpdateNoticeListDto(data);
}
/**
* 메이플스토리 업데이트 게시글 세부 사항을 조회합니다.
*
* - 공지 정보 API는 데이터 최신화(공지 내용 수정/ 업데이트 고려)를 위해 실시간 조회 또는 최소 일배치 작업을 권장합니다.
* - 실시간으로 정보를 제공하지 않는 경우, 신규/수정 공지 내용이 반영되지 않을 수 있으니 서비스 이용 유저에게 홈페이지 공지 사항을 확인하라는 가이드를 제공해주세요.
* @param noticeId 공지 식별자
*/
async getUpdateNoticeDetail(noticeId) {
const path = `${this.subUrl}/v1/notice-update/detail`;
const query = {
notice_id: noticeId,
};
const { data } = await this.client.get(path, {
params: query,
});
return new UpdateNoticeDetailDto(data);
}
/**
* 메이플스토리 진행 중 이벤트에 최근 등록된 공지사항 20개를 조회합니다.
*
* - 공지 정보 API는 데이터 최신화(공지 내용 수정/ 업데이트 고려)를 위해 실시간 조회 또는 최소 일배치 작업을 권장합니다.
* - 실시간으로 정보를 제공하지 않는 경우, 신규/수정 공지 내용이 반영되지 않을 수 있으니 서비스 이용 유저에게 홈페이지 공지 사항을 확인하라는 가이드를 제공해주세요.
*/
async getEventNoticeList() {
const path = `${this.subUrl}/v1/notice-event`;
const { data } = await this.client.get(path);
return new EventNoticeListDto(data);
}
/**
* 메이플스토리 진행 중 이벤트 게시글 세부 사항을 조회합니다.
*
* - 공지 정보 API는 데이터 최신화(공지 내용 수정/ 업데이트 고려)를 위해 실시간 조회 또는 최소 일배치 작업을 권장합니다.
* - 실시간으로 정보를 제공하지 않는 경우, 신규/수정 공지 내용이 반영되지 않을 수 있으니 서비스 이용 유저에게 홈페이지 공지 사항을 확인하라는 가이드를 제공해주세요.
* @param noticeId 공지 식별자
*/
async getEventNoticeDetail(noticeId) {
const path = `${this.subUrl}/v1/notice-event/detail`;
const query = {
notice_id: noticeId,
};
const { data } = await this.client.get(path, {
params: query,
});
return new EventNoticeDetailDto(data);
}
/**
* 메이플스토리 캐시샵 공지에 최근 등록된 공지사항 20개를 조회합니다.
*
* - 공지 정보 API는 데이터 최신화(공지 내용 수정/ 업데이트 고려)를 위해 실시간 조회 또는 최소 일배치 작업을 권장합니다.
* - 실시간으로 정보를 제공하지 않는 경우, 신규/수정 공지 내용이 반영되지 않을 수 있으니 서비스 이용 유저에게 홈페이지 공지 사항을 확인하라는 가이드를 제공해주세요.
*/
async getCashshopNoticeList() {
const path = `${this.subUrl}/v1/notice-cashshop`;
const { data } = await this.client.get(path);
return new CashshopNoticeListDto(data);
}
/**
* 메이플스토리 캐시샵 공지 게시글 세부 사항을 조회합니다.
*
* - 공지 정보 API는 데이터 최신화(공지 내용 수정/ 업데이트 고려)를 위해 실시간 조회 또는 최소 일배치 작업을 권장합니다.
* - 실시간으로 정보를 제공하지 않는 경우, 신규/수정 공지 내용이 반영되지 않을 수 있으니 서비스 이용 유저에게 홈페이지 공지 사항을 확인하라는 가이드를 제공해주세요.
* @param noticeId 공지 식별자
*/
async getCashshopNoticeDetail(noticeId) {
const path = `${this.subUrl}/v1/notice-cashshop/detail`;
const query = {
notice_id: noticeId,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CashshopNoticeDetailDto(data);
}
//#endregion
/**
* 서버 점검 정보를 조회합니다.
*/
async getInspectionInfo() {
const xmlBuilder = new xml2js.Builder();
const soapEnvelop = {
'soap:Envelope': {
$: {
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
'xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/',
},
'soap:Body': {
GetInspectionInfo: {
$: {
xmlns: 'https://api.maplestory.nexon.com/soap/',
},
},
},
},
};
const baseUrl = 'https://api.maplestory.nexon.com/';
const path = 'soap/maplestory.asmx';
const headers = {
SOAPAction: 'https://api.maplestory.nexon.com/soap/GetInspectionInfo',
'Content-Type': 'text/xml; charset=utf-8',
};
const body = xmlBuilder.buildObject(soapEnvelop);
const response = await axios.post(path, body, {
baseURL: baseUrl,
timeout: this.timeout,
headers,
});
const xml = (await xml2js.parseStringPromise(response.data));
return new InspectionInfoDto(xml);
}
}
export { MapleStoryApi };