maplestory-openapi
Version:
This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.
945 lines (938 loc) • 41.1 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var axios = require('axios');
require('../../../node_modules/buffer/index.js');
var lib = require('../common/lib.js');
var character = require('./dto/character/character.js');
var characterAbility = require('./dto/character/characterAbility.js');
var characterAndroidEquipment = require('./dto/character/characterAndroidEquipment.js');
var characterBasic = require('./dto/character/characterBasic.js');
var characterBeautyEquipment = require('./dto/character/characterBeautyEquipment.js');
var characterCashItemEquipment = require('./dto/character/characterCashItemEquipment.js');
var characterDojang = require('./dto/character/characterDojang.js');
var characterFamiliar = require('./dto/character/characterFamiliar.js');
var characterHexaMatrix = require('./dto/character/characterHexaMatrix.js');
var characterHexaMatrixStat = require('./dto/character/characterHexaMatrixStat.js');
var characterHyperStat = require('./dto/character/characterHyperStat.js');
var characterImage$1 = require('./dto/character/characterImage.js');
var characterItemEquipment = require('./dto/character/characterItemEquipment.js');
var characterLinkSkill = require('./dto/character/characterLinkSkill.js');
var characterPetEquipment = require('./dto/character/characterPetEquipment.js');
var characterPopularity = require('./dto/character/characterPopularity.js');
var characterPropensity = require('./dto/character/characterPropensity.js');
var characterSetEffect = require('./dto/character/characterSetEffect.js');
var characterSkill = require('./dto/character/characterSkill.js');
var characterStat = require('./dto/character/characterStat.js');
var characterSymbolEquipment = require('./dto/character/characterSymbolEquipment.js');
var characterVMatrix = require('./dto/character/characterVMatrix.js');
var guild = require('./dto/guild/guild.js');
var guildBasic = require('./dto/guild/guildBasic.js');
var union = require('./dto/union/union.js');
var unionArtifact = require('./dto/union/unionArtifact.js');
var unionChampion = require('./dto/union/unionChampion.js');
var unionRaider = require('./dto/union/unionRaider.js');
var characterImage = require('../common/enum/characterImage.js');
var mapleStoryApi = require('../common/mapleStoryApi.js');
var index = require('../../../_virtual/index.js_commonjs-exports.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
/**
* MapleStory OpenAPI client for TMS.<br>
* This is an implementation of <a href="https://openapi.nexon.com/game/maplestorytw">MapleStory API</a>
*/
class MapleStoryApi extends mapleStoryApi.MapleStoryApi {
subUrl = 'maplestorytw';
timezoneOffset = 480;
constructor(apiKey) {
super(apiKey);
}
//#region 檢視角色資訊
/**
* 檢視角色辨識器 (OCID)。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00: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 character.CharacterDto(data);
}
/**
* 檢視基本資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterBasic(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/basic`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterBasic.CharacterBasicDto(data);
}
/**
* 檢視角色外型圖片資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param imageOptions 圖像選項
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterImage(ocid, imageOptions, dateOptions) {
const basic = await this.getCharacterBasic(ocid, dateOptions);
if (!basic) {
return null;
}
const { date, characterImage: characterImage$2 } = basic;
const action = imageOptions?.action ?? characterImage.CharacterImageAction.Stand1;
const emotion = imageOptions?.emotion ?? characterImage.CharacterImageEmotion.Default;
const wmotion = imageOptions?.wmotion ?? characterImage.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 path = lib.removeQuery(characterImage$2);
const query = {
action: `${action}.${actionFrame}`,
emotion: `${emotion}.${emotionFrame}`,
wmotion,
width,
height,
x,
y,
};
const urlImageToBase64 = async (path, query) => {
const { data, headers } = await axios__default["default"].get(path, {
params: query,
responseType: 'arraybuffer',
});
const base64 = index.__exports.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 characterImage$1.CharacterImageDto({
date,
originUrl: path,
originImage,
image,
action,
emotion,
wmotion,
actionFrame,
emotionFrame,
width,
height,
x,
y,
});
}
/**
* 檢視名聲資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterPopularity(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/popularity`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterPopularity.CharacterPopularityDto(data);
}
/**
* 檢視綜合能力值資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterStat(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/stat`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterStat.CharacterStatDto(data);
}
/**
* 檢視極限屬性資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterHyperStat(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/hyper-stat`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterHyperStat.CharacterHyperStatDto(data);
}
/**
* 檢視性向資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterPropensity(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/propensity`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterPropensity.CharacterPropensityDto(data);
}
/**
* 檢視能力資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterAbility(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/ability`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterAbility.CharacterAbilityDto(data);
}
/**
* 檢視已裝備道具資訊 (不含現金道具)。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterItemEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/item-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterItemEquipment.CharacterItemEquipmentDto(data);
}
/**
* 檢視已裝備現金道具資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterCashItemEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/cashitem-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterCashItemEquipment.CharacterCashItemEquipmentDto(data);
}
/**
* 檢視已裝備符文資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterSymbolEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/symbol-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterSymbolEquipment.CharacterSymbolEquipmentDto(data);
}
/**
* 檢視目前套用的套裝效果資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterSetEffect(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/set-effect`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterSetEffect.CharacterSetEffectDto(data);
}
/**
* 檢視目前已裝備的髮型、臉型與膚色資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterBeautyEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/beauty-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterBeautyEquipment.CharacterBeautyEquipmentDto(data);
}
/**
* 檢視已裝備機器人資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterAndroidEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/android-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterAndroidEquipment.CharacterAndroidEquipmentDto(data);
}
/**
* 檢視已裝備寵物、寵物技能與寵物道具資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterPetEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/pet-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterPetEquipment.CharacterPetEquipmentDto(data);
}
/**
* 檢視角色技能與超技能資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param characterSkillGrade 您要檢視的轉職階段 <a href="https://openapi.nexon.com/game/maplestorytw/?id=49">Available values</a>
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterSkill(ocid, characterSkillGrade, dateOptions) {
const path = `${this.subUrl}/v1/character/skill`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
character_skill_grade: characterSkillGrade,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterSkill.CharacterSkillDto(data);
}
/**
* 檢視已裝備連結技能資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterLinkSkill(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/link-skill`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterLinkSkill.CharacterLinkSkillDto(data);
}
/**
* 檢視 V 矩陣欄位資訊與已裝備 V 核心資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterVMatrix(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/vmatrix`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterVMatrix.CharacterVMatrixDto(data);
}
/**
* 檢視已裝備於 HEXA 矩陣的 HEXA 核心資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterHexaMatrix(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/hexamatrix`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterHexaMatrix.CharacterHexaMatrixDto(data);
}
/**
* 檢視設定於 HEXA 矩陣中的 HEXA 屬性資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterHexaMatrixStat(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/hexamatrix-stat`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterHexaMatrixStat.CharacterHexaMatrixStatDto(data);
}
/**
* 檢視角色在武陵道場的最高紀錄資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterDojang(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/dojang`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterDojang.CharacterDojangDto(data);
}
/**
* 檢視萌獸資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getCharacterFamiliar(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/familiar`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new characterFamiliar.CharacterFamiliarDto(data);
}
//#endregion
//#region 檢視聯盟資訊
/**
* 檢視戰地等級與戰地階級資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getUnion(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new union.UnionDto(data);
}
/**
* 檢視詳細資訊,例如派遣至聯盟的攻擊單位成員效果,以及攻擊單位佔領效果。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getUnionRaider(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union-raider`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new unionRaider.UnionRaiderDto(data);
}
/**
* 檢視戰地神器資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getUnionArtifact(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union-artifact`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new unionArtifact.UnionArtifactDto(data);
}
/**
* 查詢聯盟冠軍資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 12 月 18 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param ocid 角色辨識器
* @param dateOptions 要搜尋的日期 (TST)
*/
async getUnionChampion(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union-champion`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 12,
day: 18,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new unionChampion.UnionChampionDto(data);
}
//#endregion
//#region 檢視公會資訊
/**
* 檢視公會識別碼 (oguild_id) 資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param guildName 公會名稱
* @param worldName 世界名稱 <a href="https://openapi.nexon.com/game/maplestorytw/?id=51">Available values</a>
*/
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,
},
});
if (this.isEmptyResponse(data)) {
return null;
}
return new guild.GuildDto(data);
}
/**
* 檢視公會基本資訊。
* - 楓之谷遊戲資料平均在 15 分鐘後即可使用。
* - 您可以從 2025 年 10 月 15 日起搜尋資料。
* - 您可以輸入所需日期以搜尋過往資料。前一日的資料將於翌日凌晨 2:00 起提供。(當您搜尋 10 月 15 日的資料時,將會擷取從 15 日 00:00 到 16 日 00:00 的資料。)
* - 由於遊戲內容變動,OCID 可能會有所變更。在更新以 OCID 為基礎的服務時,請務必留意。
* - 此 API 提供來自楓之谷台灣的資料。
* @param guildId 公會識別碼
* @param dateOptions 要搜尋的日期 (TST)
*/
async getGuildBasic(guildId, dateOptions) {
const path = `${this.subUrl}/v1/guild/basic`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 10,
day: 15,
})
: undefined;
const query = {
oguild_id: guildId,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
if (this.isEmptyResponse(data)) {
return null;
}
return new guildBasic.GuildBasicDto(data);
}
}
exports.MapleStoryApi = MapleStoryApi;