maplestory-openapi
Version:
This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.
795 lines (792 loc) • 37.6 kB
JavaScript
import axios from 'axios';
import '../../../node_modules/buffer/index.js';
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 { 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 { UnionDto } from './dto/union/union.js';
import { UnionArtifactDto } from './dto/union/unionArtifact.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 MSEA.<br>
* This is an implementation of <a href="https://openapi.nexon.com/game/maplestorysea">MapleStory API</a>
*/
class MapleStoryApi extends MapleStoryApi$1 {
subUrl = 'maplestorysea';
timezoneOffset = 480;
constructor(apiKey) {
super(apiKey);
}
//#region Character Information Retrieval
/**
* Retrieves the character identifier (ocid).
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param characterName Character name
*/
async getCharacter(characterName) {
const path = `${this.subUrl}/v1/id`;
const { data } = await this.client.get(path, {
params: {
character_name: characterName,
},
});
return new CharacterDto(data);
}
/**
* Retrieves basic character information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterBasic(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/basic`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterBasicDto(data);
}
/**
* Retrieves character image information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param imageOptions Image options
* @param dateOptions Reference date for query (SGT)
*/
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,
});
}
/**
* Retrieves popularity information of a character.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterPopularity(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/popularity`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterPopularityDto(data);
}
/**
* Retrieves comprehensive character stats information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterStat(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/stat`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterStatDto(data);
}
/**
* Retrieves Hyper Stat information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterHyperStat(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/hyper-stat`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterHyperStatDto(data);
}
/**
* Retrieves traits information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterPropensity(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/propensity`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterPropensityDto(data);
}
/**
* Retrieves Ability information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterAbility(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/ability`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterAbilityDto(data);
}
/**
* Retrieves information about equipped equipment, excluding cash items.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterItemEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/item-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterItemEquipmentDto(data);
}
/**
* Retrieves equipped cash item information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterCashItemEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/cashitem-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterCashItemEquipmentDto(data);
}
/**
* Retrieves information about equipped symbols.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterSymbolEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/symbol-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterSymbolEquipmentDto(data);
}
/**
* Retrieves information about equipped set item effects.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterSetEffect(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/set-effect`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterSetEffectDto(data);
}
/**
* Retrieves information about equipped hair, face, and skin.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterBeautyEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/beauty-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterBeautyEquipmentDto(data);
}
/**
* Retrieves equipped android information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterAndroidEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/android-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterAndroidEquipmentDto(data);
}
/**
* Retrieves information about equipped pets, including pet skills and equipment.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterPetEquipment(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/pet-equipment`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterPetEquipmentDto(data);
}
/**
* Retrieves information about character skills and Hyper Skills.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param characterSkillGrade Job advancement tier to query <a href="https://openapi.nexon.com/game/maplestorysea/?id=45">Available values</a>
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterSkill(ocid, characterSkillGrade, dateOptions) {
const path = `${this.subUrl}/v1/character/skill`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
character_skill_grade: characterSkillGrade,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterSkillDto(data);
}
/**
* Retrieves information about equipped Link Skills.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterLinkSkill(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/link-skill`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterLinkSkillDto(data);
}
/**
* Retrieves V Matrix slot and equipped Node information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterVMatrix(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/vmatrix`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterVMatrixDto(data);
}
/**
* Retrieves information about HEXA Nodes equipped in the HEXA Matrix.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterHexaMatrix(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/hexamatrix`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterHexaMatrixDto(data);
}
/**
* Retrieves information about HEXA stats configured in the HEXA Matrix.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterHexaMatrixStat(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/hexamatrix-stat`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterHexaMatrixStatDto(data);
}
/**
* Retrieves the character's highest record information in Mu Lung Garden.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getCharacterDojang(ocid, dateOptions) {
const path = `${this.subUrl}/v1/character/dojang`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new CharacterDojangDto(data);
}
//#endregion
//#region Union Information Retrieval
/**
* Retrieves Union level and Union rank information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getUnion(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new UnionDto(data);
}
/**
* Retrieves detailed information about raid member effects and capture effects deployed in the Union.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getUnionRaider(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union-raider`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new UnionRaiderDto(data);
}
/**
* Retrieves Union Artifact information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param ocid Character identifier
* @param dateOptions Reference date for query (SGT)
*/
async getUnionArtifact(ocid, dateOptions) {
const path = `${this.subUrl}/v1/user/union-artifact`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
ocid: ocid,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new UnionArtifactDto(data);
}
//#endregion
//#region Guild Information Retrieval
/**
* Retrieves information for the guild identifier (oguild_id).
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param guildName Guild name
* @param worldName World name
*/
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);
}
/**
* Retrieves guild basic information.
* - MapleStory game data can be verified approximately 15 minutes after updates.
* - Data is available starting from April 20, 2025.
* - Historical data can be queried by specifying the desired date, and data from the previous day can be accessed starting at 2 AM the next day. (For example, when querying data for December 22, data from 00:00 to 24:00 on December 22 will be retrieved.)
* - Due to game content changes, the ocid may be updated. Please pay attention to this when updating services based on ocid.
* - This API provides data for MapleStory SEA.
* @param guildId Guild identifier
* @param dateOptions Reference date for query (SGT)
*/
async getGuildBasic(guildId, dateOptions) {
const path = `${this.subUrl}/v1/guild/basic`;
const date = dateOptions
? this.toDateString(dateOptions, {
year: 2025,
month: 4,
day: 20,
})
: undefined;
const query = {
oguild_id: guildId,
date: date,
};
const { data } = await this.client.get(path, {
params: query,
});
return new GuildBasicDto(data);
}
}
export { MapleStoryApi };