maplestory-openapi 3.5.1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cjs/_virtual/index.js_commonjs-exports2.js +2 -2
- package/dist/cjs/_virtual/index.js_commonjs-exports3.js +2 -2
- package/dist/cjs/maplestory/api/common/mapleStoryApiError.js +2 -0
- package/dist/cjs/maplestory/api/common/mapleStoryFriendsApi.js +120 -0
- package/dist/cjs/maplestory/api/kms/kms.js +2 -0
- package/dist/cjs/maplestory/api/kms/mapleStoryFriendsApi.js +116 -0
- package/dist/cjs/node_modules/base64-js/index.js +1 -1
- package/dist/cjs/node_modules/buffer/index.js +2 -2
- package/dist/cjs/node_modules/ieee754/index.js +1 -1
- package/dist/esm/_virtual/index.js_commonjs-exports2.js +2 -2
- package/dist/esm/_virtual/index.js_commonjs-exports3.js +2 -2
- package/dist/esm/maplestory/api/common/mapleStoryApiError.js +2 -0
- package/dist/esm/maplestory/api/common/mapleStoryFriendsApi.js +111 -0
- package/dist/esm/maplestory/api/kms/kms.js +1 -0
- package/dist/esm/maplestory/api/kms/mapleStoryFriendsApi.js +112 -0
- package/dist/esm/node_modules/base64-js/index.js +2 -2
- package/dist/esm/node_modules/buffer/index.js +2 -2
- package/dist/esm/node_modules/ieee754/index.js +2 -2
- package/dist/index.min.js +1 -1
- package/package.json +1 -1
- package/types/maplestory/api/common/mapleStoryApiError.d.ts +2 -1
- package/types/maplestory/api/common/mapleStoryFriendsApi.d.ts +49 -0
- package/types/maplestory/api/kms/index.d.ts +1 -0
- package/types/maplestory/api/kms/mapleStoryFriendsApi.d.ts +115 -0
package/README.md
CHANGED
|
@@ -113,6 +113,7 @@ This library supports all apis published in the MapleStory OpenAPI official docs
|
|
|
113
113
|
Some features are supported only in specific regions. Please refer to the official documentation for each region for details.
|
|
114
114
|
|
|
115
115
|
- KMS: [https://openapi.nexon.com/game/maplestory](https://openapi.nexon.com/game/maplestory)
|
|
116
|
+
- KMS(for Nexon Friends Exclusive APIs): [https://openapi.nexon.com/ko/friends/maplestory](https://openapi.nexon.com/ko/friends/maplestory)
|
|
116
117
|
- TMS: [https://openapi.nexon.com/game/maplestorytw](https://openapi.nexon.com/game/maplestorytw)
|
|
117
118
|
- MSEA: [https://openapi.nexon.com/game/maplestorysea](https://openapi.nexon.com/game/maplestorysea)
|
|
118
119
|
|
|
@@ -33,6 +33,7 @@ exports.MapleStoryApiErrorCode = void 0;
|
|
|
33
33
|
MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00009"] = 7] = "OPENAPI00009";
|
|
34
34
|
MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00010"] = 8] = "OPENAPI00010";
|
|
35
35
|
MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00011"] = 9] = "OPENAPI00011";
|
|
36
|
+
MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00012"] = 10] = "OPENAPI00012";
|
|
36
37
|
})(exports.MapleStoryApiErrorCode || (exports.MapleStoryApiErrorCode = {}));
|
|
37
38
|
const ERROR_MAP = {
|
|
38
39
|
['OPENAPI00001']: exports.MapleStoryApiErrorCode.OPENAPI00001,
|
|
@@ -45,6 +46,7 @@ const ERROR_MAP = {
|
|
|
45
46
|
['OPENAPI00009']: exports.MapleStoryApiErrorCode.OPENAPI00009,
|
|
46
47
|
['OPENAPI00010']: exports.MapleStoryApiErrorCode.OPENAPI00010,
|
|
47
48
|
['OPENAPI00011']: exports.MapleStoryApiErrorCode.OPENAPI00011,
|
|
49
|
+
['OPENAPI00012']: exports.MapleStoryApiErrorCode.OPENAPI00012,
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
exports.MapleStoryApiError = MapleStoryApiError;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var axios = require('axios');
|
|
6
|
+
var dayjs = require('dayjs');
|
|
7
|
+
var timezone = require('../../../node_modules/dayjs/plugin/timezone.js');
|
|
8
|
+
var utc = require('../../../node_modules/dayjs/plugin/utc.js');
|
|
9
|
+
var mapleStoryApiError = require('./mapleStoryApiError.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
14
|
+
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
15
|
+
|
|
16
|
+
dayjs__default["default"].extend(timezone);
|
|
17
|
+
dayjs__default["default"].extend(utc);
|
|
18
|
+
/**
|
|
19
|
+
* MapleStory Friends API client.
|
|
20
|
+
*/
|
|
21
|
+
class MapleStoryFriendsApi {
|
|
22
|
+
accessToken;
|
|
23
|
+
client;
|
|
24
|
+
static BASE_URL = 'https://open.api.nexon.com/';
|
|
25
|
+
static DEFAULT_TIMEOUT = 5000;
|
|
26
|
+
get timeout() {
|
|
27
|
+
return this.client.defaults.timeout;
|
|
28
|
+
}
|
|
29
|
+
set timeout(value) {
|
|
30
|
+
this.client.defaults.timeout = value;
|
|
31
|
+
}
|
|
32
|
+
constructor(accessToken) {
|
|
33
|
+
this.accessToken = accessToken;
|
|
34
|
+
this.client = axios__default["default"].create({
|
|
35
|
+
baseURL: MapleStoryFriendsApi.BASE_URL,
|
|
36
|
+
timeout: MapleStoryFriendsApi.DEFAULT_TIMEOUT,
|
|
37
|
+
headers: {
|
|
38
|
+
'Authorization': `Bearer ${this.accessToken}`,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
this.client.interceptors.response.use((response) => response, (error) => {
|
|
42
|
+
if (error instanceof axios.AxiosError) {
|
|
43
|
+
const errorBody = error.response
|
|
44
|
+
.data;
|
|
45
|
+
throw new mapleStoryApiError.MapleStoryApiError(errorBody);
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* API 서버의 데이터 갱신 시간에 따라 데이터가 조회 가능한 최신 날짜를 반환합니다.
|
|
52
|
+
*
|
|
53
|
+
* @param options
|
|
54
|
+
*/
|
|
55
|
+
getProperDefaultDateOptions(options) {
|
|
56
|
+
const { hour, minute, dateOffset } = options;
|
|
57
|
+
const nowInTimezone = dayjs__default["default"]().utcOffset(this.timezoneOffset);
|
|
58
|
+
const updateDate = dayjs__default["default"]().utcOffset(this.timezoneOffset).hour(hour).minute(minute);
|
|
59
|
+
let adjustedDate;
|
|
60
|
+
if (nowInTimezone.isAfter(updateDate)) {
|
|
61
|
+
adjustedDate = nowInTimezone;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
adjustedDate = nowInTimezone.subtract(1, 'day');
|
|
65
|
+
}
|
|
66
|
+
adjustedDate = adjustedDate.subtract(dateOffset ?? 0, 'day');
|
|
67
|
+
return {
|
|
68
|
+
year: adjustedDate.year(),
|
|
69
|
+
month: adjustedDate.month() + 1,
|
|
70
|
+
day: adjustedDate.date(),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
;
|
|
74
|
+
/**
|
|
75
|
+
* 날짜 정보를 API 서버에서 요구하는 포맷으로 변환합니다.
|
|
76
|
+
*
|
|
77
|
+
* @param dateOptions 조회 하려는 날짜
|
|
78
|
+
* @param minDateOptions API 호출 가능한 최소 날짜
|
|
79
|
+
*/
|
|
80
|
+
toDateString(dateOptions, minDateOptions) {
|
|
81
|
+
const convert = (dateOptions) => {
|
|
82
|
+
let year;
|
|
83
|
+
let month;
|
|
84
|
+
let day;
|
|
85
|
+
let d;
|
|
86
|
+
if (dateOptions instanceof Date) {
|
|
87
|
+
d = dayjs__default["default"](dateOptions).utcOffset(this.timezoneOffset);
|
|
88
|
+
year = d.year();
|
|
89
|
+
month = d.month() + 1;
|
|
90
|
+
day = d.date();
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
year = dateOptions.year;
|
|
94
|
+
month = dateOptions.month;
|
|
95
|
+
day = dateOptions.day;
|
|
96
|
+
d = dayjs__default["default"](`${year}-${month}-${day}`).utcOffset(this.timezoneOffset);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
year,
|
|
100
|
+
month,
|
|
101
|
+
day,
|
|
102
|
+
d,
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
const { year, month, day, d } = convert(dateOptions);
|
|
106
|
+
const str = d.format('YYYY-MM-DD');
|
|
107
|
+
if (minDateOptions) {
|
|
108
|
+
const { year: minYear, month: minMonth, day: minDay, } = convert(minDateOptions);
|
|
109
|
+
if (year < minYear ||
|
|
110
|
+
(year === minYear && month < minMonth) ||
|
|
111
|
+
(year === minYear && month === minMonth && day < minDay)) {
|
|
112
|
+
throw new Error(`You can only retrieve data after ${dayjs__default["default"](`${minYear}-${minMonth}-${minDay}`).format('YYYY-MM-DD')}.`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return str;
|
|
116
|
+
}
|
|
117
|
+
;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
exports.MapleStoryFriendsApi = MapleStoryFriendsApi;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var mapleStoryApi = require('./mapleStoryApi.js');
|
|
6
|
+
var mapleStoryFriendsApi = require('./mapleStoryFriendsApi.js');
|
|
6
7
|
var character = require('./dto/character/character.js');
|
|
7
8
|
var characterAbility = require('./dto/character/characterAbility.js');
|
|
8
9
|
var characterAndroidEquipment = require('./dto/character/characterAndroidEquipment.js');
|
|
@@ -55,6 +56,7 @@ var inspectionInfo = require('./dto/inspectionInfo.js');
|
|
|
55
56
|
|
|
56
57
|
|
|
57
58
|
exports.MapleStoryApi = mapleStoryApi.MapleStoryApi;
|
|
59
|
+
exports.MapleStoryFriendsApi = mapleStoryFriendsApi.MapleStoryFriendsApi;
|
|
58
60
|
exports.CharacterDto = character.CharacterDto;
|
|
59
61
|
exports.CharacterAbilityDto = characterAbility.CharacterAbilityDto;
|
|
60
62
|
exports.CharacterAbilityInfoDto = characterAbility.CharacterAbilityInfoDto;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cubeHistory = require('./dto/history/cubeHistory.js');
|
|
6
|
+
var potentialHistory = require('./dto/history/potentialHistory.js');
|
|
7
|
+
var starforceHistory = require('./dto/history/starforceHistory.js');
|
|
8
|
+
var achievement = require('./dto/user/achievement.js');
|
|
9
|
+
var characterList = require('./dto/user/characterList.js');
|
|
10
|
+
var mapleStoryFriendsApi = require('../common/mapleStoryFriendsApi.js');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* MapleStory Friends API client for KMS<br>
|
|
14
|
+
* This is an implementation of <a href="https://openapi.nexon.com/ko/friends/maplestory/?id=36">MapleStory Friends API</a>
|
|
15
|
+
*/
|
|
16
|
+
class MapleStoryFriendsApi extends mapleStoryFriendsApi.MapleStoryFriendsApi {
|
|
17
|
+
subUrl = 'maplestory';
|
|
18
|
+
timezoneOffset = 540;
|
|
19
|
+
constructor(accessToken) {
|
|
20
|
+
super(accessToken);
|
|
21
|
+
}
|
|
22
|
+
//#region 계정 정보 조회
|
|
23
|
+
/**
|
|
24
|
+
* 계정의 보유 캐릭터 목록을 조회합니다.
|
|
25
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '캐릭터 목록'을 활용 데이터 항목으로 선택해주세요.
|
|
26
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
27
|
+
*/
|
|
28
|
+
async getCharacterList() {
|
|
29
|
+
const path = `${this.subUrl}/v1/character/list`;
|
|
30
|
+
const { data } = await this.client.get(path);
|
|
31
|
+
return new characterList.CharacterListDto(data);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 계정의 업적 정보를 조회합니다.
|
|
35
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '업적 정보'를 활용 데이터 항목으로 선택해주세요.
|
|
36
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
37
|
+
*/
|
|
38
|
+
async getAchievement() {
|
|
39
|
+
const path = `${this.subUrl}/v1/user/achievement`;
|
|
40
|
+
const { data } = await this.client.get(path);
|
|
41
|
+
return new achievement.AchievementDto(data);
|
|
42
|
+
}
|
|
43
|
+
async getStarforceHistory(count, parameter) {
|
|
44
|
+
const path = `${this.subUrl}/v1/history/starforce`;
|
|
45
|
+
const query = {
|
|
46
|
+
count,
|
|
47
|
+
};
|
|
48
|
+
if (typeof parameter === 'string') {
|
|
49
|
+
query.cursor = parameter;
|
|
50
|
+
}
|
|
51
|
+
else if (typeof parameter === 'object' || parameter === undefined) {
|
|
52
|
+
query.date = this.toDateString(parameter ??
|
|
53
|
+
this.getProperDefaultDateOptions({
|
|
54
|
+
hour: 0,
|
|
55
|
+
minute: 0,
|
|
56
|
+
dateOffset: 0,
|
|
57
|
+
}), {
|
|
58
|
+
year: 2023,
|
|
59
|
+
month: 12,
|
|
60
|
+
day: 27,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const { data } = await this.client.get(path, {
|
|
64
|
+
params: query,
|
|
65
|
+
});
|
|
66
|
+
return new starforceHistory.StarforceHistoryResponseDto(data);
|
|
67
|
+
}
|
|
68
|
+
async getCubeHistory(count, parameter) {
|
|
69
|
+
const path = `${this.subUrl}/v1/history/cube`;
|
|
70
|
+
const query = {
|
|
71
|
+
count,
|
|
72
|
+
};
|
|
73
|
+
if (typeof parameter === 'string') {
|
|
74
|
+
query.cursor = parameter;
|
|
75
|
+
}
|
|
76
|
+
else if (typeof parameter === 'object' || parameter === undefined) {
|
|
77
|
+
query.date = this.toDateString(parameter ??
|
|
78
|
+
this.getProperDefaultDateOptions({
|
|
79
|
+
hour: 0,
|
|
80
|
+
minute: 0,
|
|
81
|
+
dateOffset: 0,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
const { data } = await this.client.get(path, {
|
|
85
|
+
params: query,
|
|
86
|
+
});
|
|
87
|
+
return new cubeHistory.CubeHistoryResponseDto(data);
|
|
88
|
+
}
|
|
89
|
+
async getPotentialHistory(count, parameter) {
|
|
90
|
+
const path = `${this.subUrl}/v1/history/potential`;
|
|
91
|
+
const query = {
|
|
92
|
+
count,
|
|
93
|
+
};
|
|
94
|
+
if (typeof parameter === 'string') {
|
|
95
|
+
query.cursor = parameter;
|
|
96
|
+
}
|
|
97
|
+
else if (typeof parameter === 'object' || parameter === undefined) {
|
|
98
|
+
query.date = this.toDateString(parameter ??
|
|
99
|
+
this.getProperDefaultDateOptions({
|
|
100
|
+
hour: 0,
|
|
101
|
+
minute: 0,
|
|
102
|
+
dateOffset: 0,
|
|
103
|
+
}), {
|
|
104
|
+
year: 2024,
|
|
105
|
+
month: 1,
|
|
106
|
+
day: 25,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
const { data } = await this.client.get(path, {
|
|
110
|
+
params: query,
|
|
111
|
+
});
|
|
112
|
+
return new potentialHistory.PotentialHistoryResponseDto(data);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
exports.MapleStoryFriendsApi = MapleStoryFriendsApi;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var index = require('../../_virtual/index.js_commonjs-exports.js');
|
|
4
4
|
require('../base64-js/index.js');
|
|
5
5
|
require('../ieee754/index.js');
|
|
6
|
-
var index$1 = require('../../_virtual/index.js_commonjs-
|
|
7
|
-
var index$2 = require('../../_virtual/index.js_commonjs-
|
|
6
|
+
var index$1 = require('../../_virtual/index.js_commonjs-exports2.js');
|
|
7
|
+
var index$2 = require('../../_virtual/index.js_commonjs-exports3.js');
|
|
8
8
|
|
|
9
9
|
/*!
|
|
10
10
|
* The buffer module from node.js, for the browser.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var base64Js = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { base64Js as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ieee754 = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { ieee754 as __exports };
|
|
@@ -29,6 +29,7 @@ var MapleStoryApiErrorCode;
|
|
|
29
29
|
MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00009"] = 7] = "OPENAPI00009";
|
|
30
30
|
MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00010"] = 8] = "OPENAPI00010";
|
|
31
31
|
MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00011"] = 9] = "OPENAPI00011";
|
|
32
|
+
MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00012"] = 10] = "OPENAPI00012";
|
|
32
33
|
})(MapleStoryApiErrorCode || (MapleStoryApiErrorCode = {}));
|
|
33
34
|
const ERROR_MAP = {
|
|
34
35
|
['OPENAPI00001']: MapleStoryApiErrorCode.OPENAPI00001,
|
|
@@ -41,6 +42,7 @@ const ERROR_MAP = {
|
|
|
41
42
|
['OPENAPI00009']: MapleStoryApiErrorCode.OPENAPI00009,
|
|
42
43
|
['OPENAPI00010']: MapleStoryApiErrorCode.OPENAPI00010,
|
|
43
44
|
['OPENAPI00011']: MapleStoryApiErrorCode.OPENAPI00011,
|
|
45
|
+
['OPENAPI00012']: MapleStoryApiErrorCode.OPENAPI00012,
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
export { MapleStoryApiError, MapleStoryApiErrorCode };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import axios, { AxiosError } from 'axios';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import timezone from '../../../node_modules/dayjs/plugin/timezone.js';
|
|
4
|
+
import utc from '../../../node_modules/dayjs/plugin/utc.js';
|
|
5
|
+
import { MapleStoryApiError } from './mapleStoryApiError.js';
|
|
6
|
+
|
|
7
|
+
dayjs.extend(timezone);
|
|
8
|
+
dayjs.extend(utc);
|
|
9
|
+
/**
|
|
10
|
+
* MapleStory Friends API client.
|
|
11
|
+
*/
|
|
12
|
+
class MapleStoryFriendsApi {
|
|
13
|
+
accessToken;
|
|
14
|
+
client;
|
|
15
|
+
static BASE_URL = 'https://open.api.nexon.com/';
|
|
16
|
+
static DEFAULT_TIMEOUT = 5000;
|
|
17
|
+
get timeout() {
|
|
18
|
+
return this.client.defaults.timeout;
|
|
19
|
+
}
|
|
20
|
+
set timeout(value) {
|
|
21
|
+
this.client.defaults.timeout = value;
|
|
22
|
+
}
|
|
23
|
+
constructor(accessToken) {
|
|
24
|
+
this.accessToken = accessToken;
|
|
25
|
+
this.client = axios.create({
|
|
26
|
+
baseURL: MapleStoryFriendsApi.BASE_URL,
|
|
27
|
+
timeout: MapleStoryFriendsApi.DEFAULT_TIMEOUT,
|
|
28
|
+
headers: {
|
|
29
|
+
'Authorization': `Bearer ${this.accessToken}`,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
this.client.interceptors.response.use((response) => response, (error) => {
|
|
33
|
+
if (error instanceof AxiosError) {
|
|
34
|
+
const errorBody = error.response
|
|
35
|
+
.data;
|
|
36
|
+
throw new MapleStoryApiError(errorBody);
|
|
37
|
+
}
|
|
38
|
+
throw error;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* API 서버의 데이터 갱신 시간에 따라 데이터가 조회 가능한 최신 날짜를 반환합니다.
|
|
43
|
+
*
|
|
44
|
+
* @param options
|
|
45
|
+
*/
|
|
46
|
+
getProperDefaultDateOptions(options) {
|
|
47
|
+
const { hour, minute, dateOffset } = options;
|
|
48
|
+
const nowInTimezone = dayjs().utcOffset(this.timezoneOffset);
|
|
49
|
+
const updateDate = dayjs().utcOffset(this.timezoneOffset).hour(hour).minute(minute);
|
|
50
|
+
let adjustedDate;
|
|
51
|
+
if (nowInTimezone.isAfter(updateDate)) {
|
|
52
|
+
adjustedDate = nowInTimezone;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
adjustedDate = nowInTimezone.subtract(1, 'day');
|
|
56
|
+
}
|
|
57
|
+
adjustedDate = adjustedDate.subtract(dateOffset ?? 0, 'day');
|
|
58
|
+
return {
|
|
59
|
+
year: adjustedDate.year(),
|
|
60
|
+
month: adjustedDate.month() + 1,
|
|
61
|
+
day: adjustedDate.date(),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
;
|
|
65
|
+
/**
|
|
66
|
+
* 날짜 정보를 API 서버에서 요구하는 포맷으로 변환합니다.
|
|
67
|
+
*
|
|
68
|
+
* @param dateOptions 조회 하려는 날짜
|
|
69
|
+
* @param minDateOptions API 호출 가능한 최소 날짜
|
|
70
|
+
*/
|
|
71
|
+
toDateString(dateOptions, minDateOptions) {
|
|
72
|
+
const convert = (dateOptions) => {
|
|
73
|
+
let year;
|
|
74
|
+
let month;
|
|
75
|
+
let day;
|
|
76
|
+
let d;
|
|
77
|
+
if (dateOptions instanceof Date) {
|
|
78
|
+
d = dayjs(dateOptions).utcOffset(this.timezoneOffset);
|
|
79
|
+
year = d.year();
|
|
80
|
+
month = d.month() + 1;
|
|
81
|
+
day = d.date();
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
year = dateOptions.year;
|
|
85
|
+
month = dateOptions.month;
|
|
86
|
+
day = dateOptions.day;
|
|
87
|
+
d = dayjs(`${year}-${month}-${day}`).utcOffset(this.timezoneOffset);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
year,
|
|
91
|
+
month,
|
|
92
|
+
day,
|
|
93
|
+
d,
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
const { year, month, day, d } = convert(dateOptions);
|
|
97
|
+
const str = d.format('YYYY-MM-DD');
|
|
98
|
+
if (minDateOptions) {
|
|
99
|
+
const { year: minYear, month: minMonth, day: minDay, } = convert(minDateOptions);
|
|
100
|
+
if (year < minYear ||
|
|
101
|
+
(year === minYear && month < minMonth) ||
|
|
102
|
+
(year === minYear && month === minMonth && day < minDay)) {
|
|
103
|
+
throw new Error(`You can only retrieve data after ${dayjs(`${minYear}-${minMonth}-${minDay}`).format('YYYY-MM-DD')}.`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return str;
|
|
107
|
+
}
|
|
108
|
+
;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { MapleStoryFriendsApi };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { MapleStoryApi } from './mapleStoryApi.js';
|
|
2
|
+
export { MapleStoryFriendsApi } from './mapleStoryFriendsApi.js';
|
|
2
3
|
export { CharacterDto } from './dto/character/character.js';
|
|
3
4
|
export { CharacterAbilityDto, CharacterAbilityInfoDto, CharacterAbilityPresetDto } from './dto/character/characterAbility.js';
|
|
4
5
|
export { CharacterAndroidCashItemEquipmentColoringPrismDto, CharacterAndroidCashItemEquipmentDto, CharacterAndroidCashItemEquipmentOptionDto, CharacterAndroidEquipmentDto, CharacterAndroidEquipmentFaceDto, CharacterAndroidEquipmentHairDto, CharacterAndroidEquipmentPresetDto, CharacterAndroidEquipmentSkinDto } from './dto/character/characterAndroidEquipment.js';
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { CubeHistoryResponseDto } from './dto/history/cubeHistory.js';
|
|
2
|
+
import { PotentialHistoryResponseDto } from './dto/history/potentialHistory.js';
|
|
3
|
+
import { StarforceHistoryResponseDto } from './dto/history/starforceHistory.js';
|
|
4
|
+
import { AchievementDto } from './dto/user/achievement.js';
|
|
5
|
+
import { CharacterListDto } from './dto/user/characterList.js';
|
|
6
|
+
import { MapleStoryFriendsApi as MapleStoryFriendsApi$1 } from '../common/mapleStoryFriendsApi.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* MapleStory Friends API client for KMS<br>
|
|
10
|
+
* This is an implementation of <a href="https://openapi.nexon.com/ko/friends/maplestory/?id=36">MapleStory Friends API</a>
|
|
11
|
+
*/
|
|
12
|
+
class MapleStoryFriendsApi extends MapleStoryFriendsApi$1 {
|
|
13
|
+
subUrl = 'maplestory';
|
|
14
|
+
timezoneOffset = 540;
|
|
15
|
+
constructor(accessToken) {
|
|
16
|
+
super(accessToken);
|
|
17
|
+
}
|
|
18
|
+
//#region 계정 정보 조회
|
|
19
|
+
/**
|
|
20
|
+
* 계정의 보유 캐릭터 목록을 조회합니다.
|
|
21
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '캐릭터 목록'을 활용 데이터 항목으로 선택해주세요.
|
|
22
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
23
|
+
*/
|
|
24
|
+
async getCharacterList() {
|
|
25
|
+
const path = `${this.subUrl}/v1/character/list`;
|
|
26
|
+
const { data } = await this.client.get(path);
|
|
27
|
+
return new CharacterListDto(data);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 계정의 업적 정보를 조회합니다.
|
|
31
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '업적 정보'를 활용 데이터 항목으로 선택해주세요.
|
|
32
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
33
|
+
*/
|
|
34
|
+
async getAchievement() {
|
|
35
|
+
const path = `${this.subUrl}/v1/user/achievement`;
|
|
36
|
+
const { data } = await this.client.get(path);
|
|
37
|
+
return new AchievementDto(data);
|
|
38
|
+
}
|
|
39
|
+
async getStarforceHistory(count, parameter) {
|
|
40
|
+
const path = `${this.subUrl}/v1/history/starforce`;
|
|
41
|
+
const query = {
|
|
42
|
+
count,
|
|
43
|
+
};
|
|
44
|
+
if (typeof parameter === 'string') {
|
|
45
|
+
query.cursor = parameter;
|
|
46
|
+
}
|
|
47
|
+
else if (typeof parameter === 'object' || parameter === undefined) {
|
|
48
|
+
query.date = this.toDateString(parameter ??
|
|
49
|
+
this.getProperDefaultDateOptions({
|
|
50
|
+
hour: 0,
|
|
51
|
+
minute: 0,
|
|
52
|
+
dateOffset: 0,
|
|
53
|
+
}), {
|
|
54
|
+
year: 2023,
|
|
55
|
+
month: 12,
|
|
56
|
+
day: 27,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const { data } = await this.client.get(path, {
|
|
60
|
+
params: query,
|
|
61
|
+
});
|
|
62
|
+
return new StarforceHistoryResponseDto(data);
|
|
63
|
+
}
|
|
64
|
+
async getCubeHistory(count, parameter) {
|
|
65
|
+
const path = `${this.subUrl}/v1/history/cube`;
|
|
66
|
+
const query = {
|
|
67
|
+
count,
|
|
68
|
+
};
|
|
69
|
+
if (typeof parameter === 'string') {
|
|
70
|
+
query.cursor = parameter;
|
|
71
|
+
}
|
|
72
|
+
else if (typeof parameter === 'object' || parameter === undefined) {
|
|
73
|
+
query.date = this.toDateString(parameter ??
|
|
74
|
+
this.getProperDefaultDateOptions({
|
|
75
|
+
hour: 0,
|
|
76
|
+
minute: 0,
|
|
77
|
+
dateOffset: 0,
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
const { data } = await this.client.get(path, {
|
|
81
|
+
params: query,
|
|
82
|
+
});
|
|
83
|
+
return new CubeHistoryResponseDto(data);
|
|
84
|
+
}
|
|
85
|
+
async getPotentialHistory(count, parameter) {
|
|
86
|
+
const path = `${this.subUrl}/v1/history/potential`;
|
|
87
|
+
const query = {
|
|
88
|
+
count,
|
|
89
|
+
};
|
|
90
|
+
if (typeof parameter === 'string') {
|
|
91
|
+
query.cursor = parameter;
|
|
92
|
+
}
|
|
93
|
+
else if (typeof parameter === 'object' || parameter === undefined) {
|
|
94
|
+
query.date = this.toDateString(parameter ??
|
|
95
|
+
this.getProperDefaultDateOptions({
|
|
96
|
+
hour: 0,
|
|
97
|
+
minute: 0,
|
|
98
|
+
dateOffset: 0,
|
|
99
|
+
}), {
|
|
100
|
+
year: 2024,
|
|
101
|
+
month: 1,
|
|
102
|
+
day: 25,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const { data } = await this.client.get(path, {
|
|
106
|
+
params: query,
|
|
107
|
+
});
|
|
108
|
+
return new PotentialHistoryResponseDto(data);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export { MapleStoryFriendsApi };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __exports as base64Js } from '../../_virtual/index.js_commonjs-
|
|
2
|
-
export { __exports as default } from '../../_virtual/index.js_commonjs-
|
|
1
|
+
import { __exports as base64Js } from '../../_virtual/index.js_commonjs-exports2.js';
|
|
2
|
+
export { __exports as default } from '../../_virtual/index.js_commonjs-exports2.js';
|
|
3
3
|
|
|
4
4
|
base64Js.byteLength = byteLength;
|
|
5
5
|
base64Js.toByteArray = toByteArray;
|
|
@@ -2,8 +2,8 @@ import { __exports as buffer } from '../../_virtual/index.js_commonjs-exports.js
|
|
|
2
2
|
export { __exports as default } from '../../_virtual/index.js_commonjs-exports.js';
|
|
3
3
|
import '../base64-js/index.js';
|
|
4
4
|
import '../ieee754/index.js';
|
|
5
|
-
import { __exports as base64Js } from '../../_virtual/index.js_commonjs-
|
|
6
|
-
import { __exports as ieee754 } from '../../_virtual/index.js_commonjs-
|
|
5
|
+
import { __exports as base64Js } from '../../_virtual/index.js_commonjs-exports2.js';
|
|
6
|
+
import { __exports as ieee754 } from '../../_virtual/index.js_commonjs-exports3.js';
|
|
7
7
|
|
|
8
8
|
/*!
|
|
9
9
|
* The buffer module from node.js, for the browser.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __exports as ieee754 } from '../../_virtual/index.js_commonjs-
|
|
2
|
-
export { __exports as default } from '../../_virtual/index.js_commonjs-
|
|
1
|
+
import { __exports as ieee754 } from '../../_virtual/index.js_commonjs-exports3.js';
|
|
2
|
+
export { __exports as default } from '../../_virtual/index.js_commonjs-exports3.js';
|
|
3
3
|
|
|
4
4
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
5
5
|
|
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios"),require("dayjs")):"function"==typeof define&&define.amd?define(["exports","axios","dayjs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["maplestory-openapi"]={},t.axios,t.dayjs)}(this,function(t,e,a){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=r(e),i=r(a),s=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,{exports:{}});!function(t){var e,a;t.exports=(e={year:0,month:1,day:2,hour:3,minute:4,second:5},a={},function(t,r,o){var i,s=function(t,e,r){void 0===r&&(r={});var o=new Date(t),i=function(t,e){void 0===e&&(e={});var r=e.timeZoneName||"short",o=t+"|"+r,i=a[o];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),a[o]=i),i}(e,r);return i.formatToParts(o)},n=function(t,a){for(var r=s(t,a),i=[],n=0;n<r.length;n+=1){var c=r[n],l=c.type,u=c.value,f=e[l];f>=0&&(i[f]=parseInt(u,10))}var h=i[3],m=24===h?0:h,d=i[0]+"-"+i[1]+"-"+i[2]+" "+m+":"+i[4]+":"+i[5]+":000",E=+t;return(o.utc(d).valueOf()-(E-=E%1e3))/6e4},c=r.prototype;c.tz=function(t,e){void 0===t&&(t=i);var a,r=this.utcOffset(),s=this.toDate(),n=s.toLocaleString("en-US",{timeZone:t}),c=Math.round((s-new Date(n))/1e3/60),l=15*-Math.round(s.getTimezoneOffset()/15)-c;if(Number(l)){if(a=o(n,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(l,!0),e){var u=a.utcOffset();a=a.add(r-u,"minute")}}else a=this.utcOffset(0,e);return a.$x.$timezone=t,a},c.offsetName=function(t){var e=this.$x.$timezone||o.tz.guess(),a=s(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return a&&a.value};var l=c.startOf;c.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return l.call(this,t,e);var a=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(a,t,e).tz(this.$x.$timezone,!0)},o.tz=function(t,e,a){var r=a&&e,s=a||e||i,c=n(+o(),s);if("string"!=typeof t)return o(t).tz(s);var l=function(t,e,a){var r=t-60*e*1e3,o=n(r,a);if(e===o)return[r,e];var i=n(r-=60*(o-e)*1e3,a);return o===i?[r,o]:[t-60*Math.min(o,i)*1e3,Math.max(o,i)]}(o.utc(t,r).valueOf(),c,s),u=l[0],f=l[1],h=o(u).utcOffset(f);return h.$x.$timezone=s,h},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(t){i=t}})}(s);var n=s.exports,c={exports:{}};!function(t){var e,a,r;t.exports=(e="minute",a=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(t,o,i){var s=o.prototype;i.utc=function(t){return new o({date:t,utc:!0,args:arguments})},s.utc=function(t){var a=i(this.toDate(),{locale:this.$L,utc:!0});return t?a.add(this.utcOffset(),e):a},s.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var n=s.parse;s.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),n.call(this,t)};var c=s.init;s.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else c.call(this)};var l=s.utcOffset;s.utcOffset=function(t,o){var i=this.$utils().u;if(i(t))return this.$u?0:i(this.$offset)?l.call(this):this.$offset;if("string"==typeof t&&(t=function(t){void 0===t&&(t="");var e=t.match(a);if(!e)return null;var o=(""+e[0]).match(r)||["-",0,0],i=o[0],s=60*+o[1]+ +o[2];return 0===s?0:"+"===i?s:-s}(t),null===t))return this;var s=Math.abs(t)<=16?60*t:t;if(0===s)return this.utc(o);var n=this.clone();if(o)return n.$offset=s,n.$u=!1,n;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(n=this.local().add(s+c,e)).$offset=s,n.$x.$localOffset=c,n};var u=s.format;s.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,e)},s.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var f=s.toDate;s.toDate=function(t){return"s"===t&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var h=s.diff;s.diff=function(t,e,a){if(t&&this.$u===t.$u)return h.call(this,t,e,a);var r=this.local(),o=i(t).local();return h.call(r,o,e,a)}})}(c);var l,u=c.exports;class f extends Error{name="MapleStoryApiError";errorCode;message;constructor(t){const{name:e,message:a}=t.error;super(a),this.errorCode=h[e],this.message=a}}t.MapleStoryApiErrorCode=void 0,(l=t.MapleStoryApiErrorCode||(t.MapleStoryApiErrorCode={}))[l.OPENAPI00001=0]="OPENAPI00001",l[l.OPENAPI00002=1]="OPENAPI00002",l[l.OPENAPI00003=2]="OPENAPI00003",l[l.OPENAPI00004=3]="OPENAPI00004",l[l.OPENAPI00005=4]="OPENAPI00005",l[l.OPENAPI00006=5]="OPENAPI00006",l[l.OPENAPI00007=6]="OPENAPI00007",l[l.OPENAPI00009=7]="OPENAPI00009",l[l.OPENAPI00010=8]="OPENAPI00010",l[l.OPENAPI00011=9]="OPENAPI00011";const h={OPENAPI00001:t.MapleStoryApiErrorCode.OPENAPI00001,OPENAPI00002:t.MapleStoryApiErrorCode.OPENAPI00002,OPENAPI00003:t.MapleStoryApiErrorCode.OPENAPI00003,OPENAPI00004:t.MapleStoryApiErrorCode.OPENAPI00004,OPENAPI00005:t.MapleStoryApiErrorCode.OPENAPI00005,OPENAPI00006:t.MapleStoryApiErrorCode.OPENAPI00006,OPENAPI00007:t.MapleStoryApiErrorCode.OPENAPI00007,OPENAPI00009:t.MapleStoryApiErrorCode.OPENAPI00009,OPENAPI00010:t.MapleStoryApiErrorCode.OPENAPI00010,OPENAPI00011:t.MapleStoryApiErrorCode.OPENAPI00011};i.default.extend(n),i.default.extend(u);class m{apiKey;client;static BASE_URL="https://open.api.nexon.com/";static DEFAULT_TIMEOUT=5e3;get timeout(){return this.client.defaults.timeout}set timeout(t){this.client.defaults.timeout=t}constructor(t){this.apiKey=t,this.client=o.default.create({baseURL:m.BASE_URL,timeout:m.DEFAULT_TIMEOUT,headers:{"x-nxopen-api-key":this.apiKey}}),this.client.interceptors.response.use(t=>t,t=>{if(t instanceof e.AxiosError){const e=t.response.data;throw new f(e)}throw t})}getProperDefaultDateOptions(t){const{hour:e,minute:a,dateOffset:r}=t,o=i.default().utcOffset(this.timezoneOffset),s=i.default().utcOffset(this.timezoneOffset).hour(e).minute(a);let n;return n=o.isAfter(s)?o:o.subtract(1,"day"),n=n.subtract(r??0,"day"),{year:n.year(),month:n.month()+1,day:n.date()}}toDateString(t,e){const a=t=>{let e,a,r,o;return t instanceof Date?(o=i.default(t).utcOffset(this.timezoneOffset),e=o.year(),a=o.month()+1,r=o.date()):(e=t.year,a=t.month,r=t.day,o=i.default(`${e}-${a}-${r}`).utcOffset(this.timezoneOffset)),{year:e,month:a,day:r,d:o}},{year:r,month:o,day:s,d:n}=a(t),c=n.format("YYYY-MM-DD");if(e){const{year:t,month:n,day:c}=a(e);if(r<t||r===t&&o<n||r===t&&o===n&&s<c)throw new Error(`You can only retrieve data after ${i.default(`${t}-${n}-${c}`).format("YYYY-MM-DD")}.`)}return c}isEmptyResponse(t){for(const[e,a]of Object.entries(t))if("date"!==e&&null!=a&&(!Array.isArray(a)||0!==a.length))return!1;return!0}}var d,E,p,A;t.CharacterImageAction=void 0,(d=t.CharacterImageAction||(t.CharacterImageAction={})).Stand1="A00",d.Stand2="A01",d.Walk1="A02",d.Walk2="A03",d.Prone="A04",d.Fly="A05",d.Jump="A06",d.Sit="A07",d.Ladder="A08",d.Rope="A09",d.Heal="A10",d.Alert="A11",d.ProneStab="A12",d.SwingO1="A13",d.SwingO2="A14",d.SwingO3="A15",d.SwingOF="A16",d.SwingP1="A17",d.SwingP2="A18",d.SwingPF="A19",d.SwingT1="A20",d.SwingT2="A21",d.SwingT3="A22",d.SwingTF="A23",d.StabO1="A24",d.StabO2="A25",d.StabOF="A26",d.StabT1="A27",d.StabT2="A28",d.StabTF="A29",d.Shoot1="A30",d.Shoot2="A31",d.ShootF="A32",d.Dead="A33",d.GhostWalk="A34",d.GhostStand="A35",d.GhostJump="A36",d.GhostProneStab="A37",d.GhostLadder="A38",d.GhostRope="A39",d.GhostFly="A40",d.GhostSit="A41",t.CharacterImageEmotion=void 0,(E=t.CharacterImageEmotion||(t.CharacterImageEmotion={})).Default="E00",E.Wink="E01",E.Smile="E02",E.Cry="E03",E.Angry="E04",E.Bewildered="E05",E.Blink="E06",E.Blaze="E07",E.Bowing="E08",E.Cheers="E09",E.Chu="E10",E.Dam="E11",E.Despair="E12",E.Glitter="E13",E.Hit="E14",E.Hot="E15",E.Hum="E16",E.Love="E17",E.Oops="E18",E.Pain="E19",E.Troubled="E20",E.QBlue="E21",E.Shine="E22",E.Stunned="E23",E.Vomit="E24",t.CharacterImageWeaponMotion=void 0,(p=t.CharacterImageWeaponMotion||(t.CharacterImageWeaponMotion={})).Default="W00",p.OneHand="W01",p.TwoHands="W02",p.Gun="W03",p.Nothing="W04",t.PotentialOptionGrade=void 0,(A=t.PotentialOptionGrade||(t.PotentialOptionGrade={}))[A.RARE=0]="RARE",A[A.EPIC=1]="EPIC",A[A.UNIQUE=2]="UNIQUE",A[A.LEGENDARY=3]="LEGENDARY";t.CharacterAbilityDto=class{},t.CharacterAbilityInfoDto=class{},t.CharacterAbilityPresetDto=class{},t.CharacterAndroidCashItemEquipmentColoringPrismDto=class{},t.CharacterAndroidCashItemEquipmentDto=class{},t.CharacterAndroidCashItemEquipmentOptionDto=class{},t.CharacterAndroidEquipmentDto=class{},t.CharacterAndroidEquipmentFaceDto=class{},t.CharacterAndroidEquipmentHairDto=class{},t.CharacterAndroidEquipmentPresetDto=class{},t.CharacterAndroidEquipmentSkinDto=class{},t.CharacterBasicDto=class{get isAccessFlag(){return"true"===this.accessFlag}},t.CharacterBeautyEquipmentDto=class{},t.CharacterBeautyEquipmentFaceDto=class{},t.CharacterBeautyEquipmentHairDto=class{},t.CharacterBeautyEquipmentSkinDto=class{},t.CharacterCashItemEquipmentColoringPrismDto=class{},t.CharacterCashItemEquipmentDto=class{},t.CharacterCashItemEquipmentOptionDto=class{},t.CharacterCashItemEquipmentPresetDto=class{},t.CharacterDojangDto=class{},t.CharacterDto=class{},t.CharacterFinalStatDto=class{},t.CharacterHexaMatrixDto=class{},t.CharacterHexaMatrixEquipmentDto=class{},t.CharacterHexaMatrixEquipmentLinkedSkillDto=class{},t.CharacterHexaMatrixStatCoreDto=class{},t.CharacterHexaMatrixStatDto=class{},t.CharacterHyperStatDto=class{},t.CharacterHyperStatPresetDto=class{},t.CharacterImageDto=class{},t.CharacterItemEquipmentAddOptionDto=class{},t.CharacterItemEquipmentBaseOptionDto=class{},t.CharacterItemEquipmentDragonInfoDto=class{},t.CharacterItemEquipmentDto=class{},t.CharacterItemEquipmentEtcOptionDto=class{},t.CharacterItemEquipmentExceptionalOptionDto=class{},t.CharacterItemEquipmentInfoDto=class{},t.CharacterItemEquipmentMechanicInfoDto=class{},t.CharacterItemEquipmentStarforceOptionDto=class{},t.CharacterItemEquipmentTitleDto=class{},t.CharacterItemEquipmentTotalOptionDto=class{},t.CharacterLinkSkillDto=class{},t.CharacterLinkSkillInfoDto=class{},t.CharacterPetEquipmentAutoSkillDto=class{},t.CharacterPetEquipmentDto=class{},t.CharacterPetEquipmentItemDto=class{},t.CharacterPetEquipmentItemOptionDto=class{},t.CharacterPopularityDto=class{},t.CharacterPropensityDto=class{},t.CharacterSetEffectDto=class{},t.CharacterSetEffectInfoDto=class{},t.CharacterSetEffectOptionFullDto=class{},t.CharacterSetEffectSetDto=class{},t.CharacterSkillDto=class{},t.CharacterSkillInfoDto=class{},t.CharacterStatDto=class{},t.CharacterSymbolEquipmentDto=class{},t.CharacterSymbolEquipmentInfoDto=class{},t.CharacterVMatrixCodeEquipmentDto=class{},t.CharacterVMatrixDto=class{},t.GuildBasicDto=class{},t.GuildDto=class{},t.GuildSkillDto=class{},t.MapleStoryApi=m,t.MapleStoryApiError=f,t.UnionArtifactCrystalDto=class{},t.UnionArtifactDto=class{},t.UnionArtifactEffectDto=class{},t.UnionDto=class{},t.UnionRaiderBlockControlPointDto=class{},t.UnionRaiderBlockDto=class{},t.UnionRaiderBlockPositionDto=class{},t.UnionRaiderDto=class{},t.UnionRaiderInnerStatDto=class{},t.UnionRaiderPresetDto=class{}});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios"),require("dayjs")):"function"==typeof define&&define.amd?define(["exports","axios","dayjs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["maplestory-openapi"]={},t.axios,t.dayjs)}(this,function(t,e,a){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=r(e),i=r(a),s=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,{exports:{}});!function(t){var e,a;t.exports=(e={year:0,month:1,day:2,hour:3,minute:4,second:5},a={},function(t,r,o){var i,s=function(t,e,r){void 0===r&&(r={});var o=new Date(t),i=function(t,e){void 0===e&&(e={});var r=e.timeZoneName||"short",o=t+"|"+r,i=a[o];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),a[o]=i),i}(e,r);return i.formatToParts(o)},n=function(t,a){for(var r=s(t,a),i=[],n=0;n<r.length;n+=1){var c=r[n],l=c.type,u=c.value,f=e[l];f>=0&&(i[f]=parseInt(u,10))}var h=i[3],m=24===h?0:h,d=i[0]+"-"+i[1]+"-"+i[2]+" "+m+":"+i[4]+":"+i[5]+":000",E=+t;return(o.utc(d).valueOf()-(E-=E%1e3))/6e4},c=r.prototype;c.tz=function(t,e){void 0===t&&(t=i);var a,r=this.utcOffset(),s=this.toDate(),n=s.toLocaleString("en-US",{timeZone:t}),c=Math.round((s-new Date(n))/1e3/60),l=15*-Math.round(s.getTimezoneOffset()/15)-c;if(Number(l)){if(a=o(n,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(l,!0),e){var u=a.utcOffset();a=a.add(r-u,"minute")}}else a=this.utcOffset(0,e);return a.$x.$timezone=t,a},c.offsetName=function(t){var e=this.$x.$timezone||o.tz.guess(),a=s(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return a&&a.value};var l=c.startOf;c.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return l.call(this,t,e);var a=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(a,t,e).tz(this.$x.$timezone,!0)},o.tz=function(t,e,a){var r=a&&e,s=a||e||i,c=n(+o(),s);if("string"!=typeof t)return o(t).tz(s);var l=function(t,e,a){var r=t-60*e*1e3,o=n(r,a);if(e===o)return[r,e];var i=n(r-=60*(o-e)*1e3,a);return o===i?[r,o]:[t-60*Math.min(o,i)*1e3,Math.max(o,i)]}(o.utc(t,r).valueOf(),c,s),u=l[0],f=l[1],h=o(u).utcOffset(f);return h.$x.$timezone=s,h},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(t){i=t}})}(s);var n=s.exports,c={exports:{}};!function(t){var e,a,r;t.exports=(e="minute",a=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(t,o,i){var s=o.prototype;i.utc=function(t){return new o({date:t,utc:!0,args:arguments})},s.utc=function(t){var a=i(this.toDate(),{locale:this.$L,utc:!0});return t?a.add(this.utcOffset(),e):a},s.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var n=s.parse;s.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),n.call(this,t)};var c=s.init;s.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else c.call(this)};var l=s.utcOffset;s.utcOffset=function(t,o){var i=this.$utils().u;if(i(t))return this.$u?0:i(this.$offset)?l.call(this):this.$offset;if("string"==typeof t&&(t=function(t){void 0===t&&(t="");var e=t.match(a);if(!e)return null;var o=(""+e[0]).match(r)||["-",0,0],i=o[0],s=60*+o[1]+ +o[2];return 0===s?0:"+"===i?s:-s}(t),null===t))return this;var s=Math.abs(t)<=16?60*t:t;if(0===s)return this.utc(o);var n=this.clone();if(o)return n.$offset=s,n.$u=!1,n;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(n=this.local().add(s+c,e)).$offset=s,n.$x.$localOffset=c,n};var u=s.format;s.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,e)},s.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var f=s.toDate;s.toDate=function(t){return"s"===t&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var h=s.diff;s.diff=function(t,e,a){if(t&&this.$u===t.$u)return h.call(this,t,e,a);var r=this.local(),o=i(t).local();return h.call(r,o,e,a)}})}(c);var l,u=c.exports;class f extends Error{name="MapleStoryApiError";errorCode;message;constructor(t){const{name:e,message:a}=t.error;super(a),this.errorCode=h[e],this.message=a}}t.MapleStoryApiErrorCode=void 0,(l=t.MapleStoryApiErrorCode||(t.MapleStoryApiErrorCode={}))[l.OPENAPI00001=0]="OPENAPI00001",l[l.OPENAPI00002=1]="OPENAPI00002",l[l.OPENAPI00003=2]="OPENAPI00003",l[l.OPENAPI00004=3]="OPENAPI00004",l[l.OPENAPI00005=4]="OPENAPI00005",l[l.OPENAPI00006=5]="OPENAPI00006",l[l.OPENAPI00007=6]="OPENAPI00007",l[l.OPENAPI00009=7]="OPENAPI00009",l[l.OPENAPI00010=8]="OPENAPI00010",l[l.OPENAPI00011=9]="OPENAPI00011",l[l.OPENAPI00012=10]="OPENAPI00012";const h={OPENAPI00001:t.MapleStoryApiErrorCode.OPENAPI00001,OPENAPI00002:t.MapleStoryApiErrorCode.OPENAPI00002,OPENAPI00003:t.MapleStoryApiErrorCode.OPENAPI00003,OPENAPI00004:t.MapleStoryApiErrorCode.OPENAPI00004,OPENAPI00005:t.MapleStoryApiErrorCode.OPENAPI00005,OPENAPI00006:t.MapleStoryApiErrorCode.OPENAPI00006,OPENAPI00007:t.MapleStoryApiErrorCode.OPENAPI00007,OPENAPI00009:t.MapleStoryApiErrorCode.OPENAPI00009,OPENAPI00010:t.MapleStoryApiErrorCode.OPENAPI00010,OPENAPI00011:t.MapleStoryApiErrorCode.OPENAPI00011,OPENAPI00012:t.MapleStoryApiErrorCode.OPENAPI00012};i.default.extend(n),i.default.extend(u);class m{apiKey;client;static BASE_URL="https://open.api.nexon.com/";static DEFAULT_TIMEOUT=5e3;get timeout(){return this.client.defaults.timeout}set timeout(t){this.client.defaults.timeout=t}constructor(t){this.apiKey=t,this.client=o.default.create({baseURL:m.BASE_URL,timeout:m.DEFAULT_TIMEOUT,headers:{"x-nxopen-api-key":this.apiKey}}),this.client.interceptors.response.use(t=>t,t=>{if(t instanceof e.AxiosError){const e=t.response.data;throw new f(e)}throw t})}getProperDefaultDateOptions(t){const{hour:e,minute:a,dateOffset:r}=t,o=i.default().utcOffset(this.timezoneOffset),s=i.default().utcOffset(this.timezoneOffset).hour(e).minute(a);let n;return n=o.isAfter(s)?o:o.subtract(1,"day"),n=n.subtract(r??0,"day"),{year:n.year(),month:n.month()+1,day:n.date()}}toDateString(t,e){const a=t=>{let e,a,r,o;return t instanceof Date?(o=i.default(t).utcOffset(this.timezoneOffset),e=o.year(),a=o.month()+1,r=o.date()):(e=t.year,a=t.month,r=t.day,o=i.default(`${e}-${a}-${r}`).utcOffset(this.timezoneOffset)),{year:e,month:a,day:r,d:o}},{year:r,month:o,day:s,d:n}=a(t),c=n.format("YYYY-MM-DD");if(e){const{year:t,month:n,day:c}=a(e);if(r<t||r===t&&o<n||r===t&&o===n&&s<c)throw new Error(`You can only retrieve data after ${i.default(`${t}-${n}-${c}`).format("YYYY-MM-DD")}.`)}return c}isEmptyResponse(t){for(const[e,a]of Object.entries(t))if("date"!==e&&null!=a&&(!Array.isArray(a)||0!==a.length))return!1;return!0}}var d,E,p,A;t.CharacterImageAction=void 0,(d=t.CharacterImageAction||(t.CharacterImageAction={})).Stand1="A00",d.Stand2="A01",d.Walk1="A02",d.Walk2="A03",d.Prone="A04",d.Fly="A05",d.Jump="A06",d.Sit="A07",d.Ladder="A08",d.Rope="A09",d.Heal="A10",d.Alert="A11",d.ProneStab="A12",d.SwingO1="A13",d.SwingO2="A14",d.SwingO3="A15",d.SwingOF="A16",d.SwingP1="A17",d.SwingP2="A18",d.SwingPF="A19",d.SwingT1="A20",d.SwingT2="A21",d.SwingT3="A22",d.SwingTF="A23",d.StabO1="A24",d.StabO2="A25",d.StabOF="A26",d.StabT1="A27",d.StabT2="A28",d.StabTF="A29",d.Shoot1="A30",d.Shoot2="A31",d.ShootF="A32",d.Dead="A33",d.GhostWalk="A34",d.GhostStand="A35",d.GhostJump="A36",d.GhostProneStab="A37",d.GhostLadder="A38",d.GhostRope="A39",d.GhostFly="A40",d.GhostSit="A41",t.CharacterImageEmotion=void 0,(E=t.CharacterImageEmotion||(t.CharacterImageEmotion={})).Default="E00",E.Wink="E01",E.Smile="E02",E.Cry="E03",E.Angry="E04",E.Bewildered="E05",E.Blink="E06",E.Blaze="E07",E.Bowing="E08",E.Cheers="E09",E.Chu="E10",E.Dam="E11",E.Despair="E12",E.Glitter="E13",E.Hit="E14",E.Hot="E15",E.Hum="E16",E.Love="E17",E.Oops="E18",E.Pain="E19",E.Troubled="E20",E.QBlue="E21",E.Shine="E22",E.Stunned="E23",E.Vomit="E24",t.CharacterImageWeaponMotion=void 0,(p=t.CharacterImageWeaponMotion||(t.CharacterImageWeaponMotion={})).Default="W00",p.OneHand="W01",p.TwoHands="W02",p.Gun="W03",p.Nothing="W04",t.PotentialOptionGrade=void 0,(A=t.PotentialOptionGrade||(t.PotentialOptionGrade={}))[A.RARE=0]="RARE",A[A.EPIC=1]="EPIC",A[A.UNIQUE=2]="UNIQUE",A[A.LEGENDARY=3]="LEGENDARY";t.CharacterAbilityDto=class{},t.CharacterAbilityInfoDto=class{},t.CharacterAbilityPresetDto=class{},t.CharacterAndroidCashItemEquipmentColoringPrismDto=class{},t.CharacterAndroidCashItemEquipmentDto=class{},t.CharacterAndroidCashItemEquipmentOptionDto=class{},t.CharacterAndroidEquipmentDto=class{},t.CharacterAndroidEquipmentFaceDto=class{},t.CharacterAndroidEquipmentHairDto=class{},t.CharacterAndroidEquipmentPresetDto=class{},t.CharacterAndroidEquipmentSkinDto=class{},t.CharacterBasicDto=class{get isAccessFlag(){return"true"===this.accessFlag}},t.CharacterBeautyEquipmentDto=class{},t.CharacterBeautyEquipmentFaceDto=class{},t.CharacterBeautyEquipmentHairDto=class{},t.CharacterBeautyEquipmentSkinDto=class{},t.CharacterCashItemEquipmentColoringPrismDto=class{},t.CharacterCashItemEquipmentDto=class{},t.CharacterCashItemEquipmentOptionDto=class{},t.CharacterCashItemEquipmentPresetDto=class{},t.CharacterDojangDto=class{},t.CharacterDto=class{},t.CharacterFinalStatDto=class{},t.CharacterHexaMatrixDto=class{},t.CharacterHexaMatrixEquipmentDto=class{},t.CharacterHexaMatrixEquipmentLinkedSkillDto=class{},t.CharacterHexaMatrixStatCoreDto=class{},t.CharacterHexaMatrixStatDto=class{},t.CharacterHyperStatDto=class{},t.CharacterHyperStatPresetDto=class{},t.CharacterImageDto=class{},t.CharacterItemEquipmentAddOptionDto=class{},t.CharacterItemEquipmentBaseOptionDto=class{},t.CharacterItemEquipmentDragonInfoDto=class{},t.CharacterItemEquipmentDto=class{},t.CharacterItemEquipmentEtcOptionDto=class{},t.CharacterItemEquipmentExceptionalOptionDto=class{},t.CharacterItemEquipmentInfoDto=class{},t.CharacterItemEquipmentMechanicInfoDto=class{},t.CharacterItemEquipmentStarforceOptionDto=class{},t.CharacterItemEquipmentTitleDto=class{},t.CharacterItemEquipmentTotalOptionDto=class{},t.CharacterLinkSkillDto=class{},t.CharacterLinkSkillInfoDto=class{},t.CharacterPetEquipmentAutoSkillDto=class{},t.CharacterPetEquipmentDto=class{},t.CharacterPetEquipmentItemDto=class{},t.CharacterPetEquipmentItemOptionDto=class{},t.CharacterPopularityDto=class{},t.CharacterPropensityDto=class{},t.CharacterSetEffectDto=class{},t.CharacterSetEffectInfoDto=class{},t.CharacterSetEffectOptionFullDto=class{},t.CharacterSetEffectSetDto=class{},t.CharacterSkillDto=class{},t.CharacterSkillInfoDto=class{},t.CharacterStatDto=class{},t.CharacterSymbolEquipmentDto=class{},t.CharacterSymbolEquipmentInfoDto=class{},t.CharacterVMatrixCodeEquipmentDto=class{},t.CharacterVMatrixDto=class{},t.GuildBasicDto=class{},t.GuildDto=class{},t.GuildSkillDto=class{},t.MapleStoryApi=m,t.MapleStoryApiError=f,t.UnionArtifactCrystalDto=class{},t.UnionArtifactDto=class{},t.UnionArtifactEffectDto=class{},t.UnionDto=class{},t.UnionRaiderBlockControlPointDto=class{},t.UnionRaiderBlockDto=class{},t.UnionRaiderBlockPositionDto=class{},t.UnionRaiderDto=class{},t.UnionRaiderInnerStatDto=class{},t.UnionRaiderPresetDto=class{}});
|
package/package.json
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Axios } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* MapleStory Friends API client.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class MapleStoryFriendsApi {
|
|
6
|
+
private readonly accessToken;
|
|
7
|
+
protected readonly client: Axios;
|
|
8
|
+
private static readonly BASE_URL;
|
|
9
|
+
private static readonly DEFAULT_TIMEOUT;
|
|
10
|
+
protected abstract subUrl: string;
|
|
11
|
+
protected abstract timezoneOffset: number;
|
|
12
|
+
get timeout(): number;
|
|
13
|
+
set timeout(value: number);
|
|
14
|
+
constructor(accessToken: string);
|
|
15
|
+
/**
|
|
16
|
+
* API 서버의 데이터 갱신 시간에 따라 데이터가 조회 가능한 최신 날짜를 반환합니다.
|
|
17
|
+
*
|
|
18
|
+
* @param options
|
|
19
|
+
*/
|
|
20
|
+
protected getProperDefaultDateOptions(options: LatestApiUpdateTimeOptions): DateOptions;
|
|
21
|
+
/**
|
|
22
|
+
* 날짜 정보를 API 서버에서 요구하는 포맷으로 변환합니다.
|
|
23
|
+
*
|
|
24
|
+
* @param dateOptions 조회 하려는 날짜
|
|
25
|
+
* @param minDateOptions API 호출 가능한 최소 날짜
|
|
26
|
+
*/
|
|
27
|
+
protected toDateString(dateOptions: DateOptions, minDateOptions?: DateOptions): string | never;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* API 서버의 데이터 갱신 시각과 조회 가능한 최근 날짜와 현재 날짜와의 차이
|
|
31
|
+
*/
|
|
32
|
+
type LatestApiUpdateTimeOptions = {
|
|
33
|
+
hour: number;
|
|
34
|
+
minute: number;
|
|
35
|
+
dateOffset?: number;
|
|
36
|
+
};
|
|
37
|
+
type YMD = {
|
|
38
|
+
year: number;
|
|
39
|
+
month: number;
|
|
40
|
+
day: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* 날짜 옵션
|
|
44
|
+
* - Date 객체 또는 YMD 형식의 객체를 사용할 수 있습니다.
|
|
45
|
+
* - 날짜는 해당 서비스 지역의 표준 시를 사용 합니다.
|
|
46
|
+
* - Date 객체의 offset이 해당 서비스 지역의 offset과 다를 경우 자동으로 변환 됩니다.
|
|
47
|
+
*/
|
|
48
|
+
export type DateOptions = YMD | Date;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { CubeHistoryResponseDto } from './dto/history/cubeHistory';
|
|
2
|
+
import { PotentialHistoryResponseDto } from './dto/history/potentialHistory';
|
|
3
|
+
import { StarforceHistoryResponseDto } from './dto/history/starforceHistory';
|
|
4
|
+
import { AchievementDto } from './dto/user/achievement';
|
|
5
|
+
import { CharacterListDto } from './dto/user/characterList';
|
|
6
|
+
import { DateOptions } from '../common/mapleStoryFriendsApi';
|
|
7
|
+
import * as base from '../common/mapleStoryFriendsApi';
|
|
8
|
+
/**
|
|
9
|
+
* MapleStory Friends API client for KMS<br>
|
|
10
|
+
* This is an implementation of <a href="https://openapi.nexon.com/ko/friends/maplestory/?id=36">MapleStory Friends API</a>
|
|
11
|
+
*/
|
|
12
|
+
export declare class MapleStoryFriendsApi extends base.MapleStoryFriendsApi {
|
|
13
|
+
protected subUrl: string;
|
|
14
|
+
protected timezoneOffset: number;
|
|
15
|
+
constructor(accessToken: string);
|
|
16
|
+
/**
|
|
17
|
+
* 계정의 보유 캐릭터 목록을 조회합니다.
|
|
18
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '캐릭터 목록'을 활용 데이터 항목으로 선택해주세요.
|
|
19
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
20
|
+
*/
|
|
21
|
+
getCharacterList(): Promise<CharacterListDto>;
|
|
22
|
+
/**
|
|
23
|
+
* 계정의 업적 정보를 조회합니다.
|
|
24
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '업적 정보'를 활용 데이터 항목으로 선택해주세요.
|
|
25
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
26
|
+
*/
|
|
27
|
+
getAchievement(): Promise<AchievementDto>;
|
|
28
|
+
/**
|
|
29
|
+
* 스타포스 강화 결과를 조회합니다.
|
|
30
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '스타포스 강화 결과'를 활용 데이터 항목으로 선택해주세요.
|
|
31
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
32
|
+
* - 스타포스 확률 정보는 최대 5분 후 확인 가능합니다.
|
|
33
|
+
* - 스타포스 강화 결과는 2023년 12월 27일 데이터부터 조회 가능하며, 최대 2년동안의 데이터만 제공됩니다.
|
|
34
|
+
* @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000)
|
|
35
|
+
*/
|
|
36
|
+
getStarforceHistory(count: number): Promise<StarforceHistoryResponseDto>;
|
|
37
|
+
/**
|
|
38
|
+
* 지목한 날짜의 스타포스 강화 결과를 조회합니다.
|
|
39
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '스타포스 강화 결과'를 활용 데이터 항목으로 선택해주세요.
|
|
40
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
41
|
+
* - 스타포스 확률 정보는 최대 5분 후 확인 가능합니다.
|
|
42
|
+
* - 스타포스 강화 결과는 2023년 12월 27일 데이터부터 조회 가능하며, 최대 2년동안의 데이터만 제공됩니다.
|
|
43
|
+
* @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000)
|
|
44
|
+
* @param dateOptions 조회 기준일 (KST)
|
|
45
|
+
*/
|
|
46
|
+
getStarforceHistory(count: number, dateOptions: DateOptions): Promise<StarforceHistoryResponseDto>;
|
|
47
|
+
/**
|
|
48
|
+
* 스타포스 강화 결과를 조회합니다.
|
|
49
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '스타포스 강화 결과'를 활용 데이터 항목으로 선택해주세요.
|
|
50
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
51
|
+
* - 스타포스 확률 정보는 최대 5분 후 확인 가능합니다.
|
|
52
|
+
* - 스타포스 강화 결과는 2023년 12월 27일 데이터부터 조회 가능하며, 최대 2년동안의 데이터만 제공됩니다.
|
|
53
|
+
* @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000)
|
|
54
|
+
* @param cursor 페이징 처리를 위한 cursor
|
|
55
|
+
*/
|
|
56
|
+
getStarforceHistory(count: number, cursor: string): Promise<StarforceHistoryResponseDto>;
|
|
57
|
+
/**
|
|
58
|
+
* 큐브 사용 결과를 조회합니다.
|
|
59
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '큐브 사용 결과'를 활용 데이터 항목으로 선택해주세요.
|
|
60
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
61
|
+
* - 큐브 확률 정보는 최대 30분 후 확인 가능합니다.
|
|
62
|
+
* - 큐브 사용 결과는 최근 2년 데이터만 조회 가능합니다.
|
|
63
|
+
* @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000). 옵션 재설정을 3회 진행한 결과가 포함될 경우 입력한 count보다 적은 수로 조회될 수 있습니다.
|
|
64
|
+
*/
|
|
65
|
+
getCubeHistory(count: number): Promise<CubeHistoryResponseDto>;
|
|
66
|
+
/**
|
|
67
|
+
* 지목한 날짜의 큐브 사용 결과를 조회합니다.
|
|
68
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '큐브 사용 결과'를 활용 데이터 항목으로 선택해주세요.
|
|
69
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
70
|
+
* - 큐브 확률 정보는 최대 30분 후 확인 가능합니다.
|
|
71
|
+
* - 큐브 사용 결과는 최근 2년 데이터만 조회 가능합니다.
|
|
72
|
+
* @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000). 옵션 재설정을 3회 진행한 결과가 포함될 경우 입력한 count보다 적은 수로 조회될 수 있습니다.
|
|
73
|
+
* @param dateOptions 조회 기준일 (KST)
|
|
74
|
+
*/
|
|
75
|
+
getCubeHistory(count: number, dateOptions: DateOptions): Promise<CubeHistoryResponseDto>;
|
|
76
|
+
/**
|
|
77
|
+
* 큐브 사용 결과를 조회합니다.
|
|
78
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '큐브 사용 결과'를 활용 데이터 항목으로 선택해주세요.
|
|
79
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
80
|
+
* - 큐브 확률 정보는 최대 30분 후 확인 가능합니다.
|
|
81
|
+
* - 큐브 사용 결과는 최근 2년 데이터만 조회 가능합니다.
|
|
82
|
+
* @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000). 옵션 재설정을 3회 진행한 결과가 포함될 경우 입력한 count보다 적은 수로 조회될 수 있습니다.
|
|
83
|
+
* @param cursor 페이징 처리를 위한 cursor
|
|
84
|
+
*/
|
|
85
|
+
getCubeHistory(count: number, cursor: string): Promise<CubeHistoryResponseDto>;
|
|
86
|
+
/**
|
|
87
|
+
* 잠재능력 재설정 이용 결과를 조회합니다.
|
|
88
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '잠재능력 재설정 이용 결과'를 활용 데이터 항목으로 선택해주세요.
|
|
89
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
90
|
+
* - 잠재능력 재설정 정보는 최대 30분 후 확인 가능합니다.
|
|
91
|
+
* - 잠재능력 재설정 이용 결과는 2024년 01월 25일 데이터부터 조회 가능하며, 최대 2년동안의 데이터만 제공됩니다.
|
|
92
|
+
* @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000). 옵션 재설정을 3회 진행한 결과가 포함될 경우 입력한 count보다 적은 수로 조회될 수 있습니다.
|
|
93
|
+
*/
|
|
94
|
+
getPotentialHistory(count: number): Promise<PotentialHistoryResponseDto>;
|
|
95
|
+
/**
|
|
96
|
+
* 지목한 날짜의 잠재능력 재설정 이용 결과를 조회합니다.
|
|
97
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '잠재능력 재설정 이용 결과'를 활용 데이터 항목으로 선택해주세요.
|
|
98
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
99
|
+
* - 잠재능력 재설정 정보는 최대 30분 후 확인 가능합니다.
|
|
100
|
+
* - 잠재능력 재설정 이용 결과는 2024년 01월 25일 데이터부터 조회 가능하며, 최대 2년동안의 데이터만 제공됩니다.
|
|
101
|
+
* @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000). 옵션 재설정을 3회 진행한 결과가 포함될 경우 입력한 count보다 적은 수로 조회될 수 있습니다.
|
|
102
|
+
* @param dateOptions 조회 기준일 (KST)
|
|
103
|
+
*/
|
|
104
|
+
getPotentialHistory(count: number, dateOptions: DateOptions): Promise<PotentialHistoryResponseDto>;
|
|
105
|
+
/**
|
|
106
|
+
* 잠재능력 재설정 이용 결과를 조회합니다.
|
|
107
|
+
* - 이 항목을 조회하시려면 NEXON Open ID 클라이언트 설정에서 '잠재능력 재설정 이용 결과'를 활용 데이터 항목으로 선택해주세요.
|
|
108
|
+
* - 이후 자세한 데이터 호출 및 활용 방법은 <a href="https://openapi.nexon.com/ko/open-id/development-guide/">NEXON Open ID 개발 가이드 문서</a>를 참조해주세요.
|
|
109
|
+
* - 잠재능력 재설정 정보는 최대 30분 후 확인 가능합니다.
|
|
110
|
+
* - 잠재능력 재설정 이용 결과는 2024년 01월 25일 데이터부터 조회 가능하며, 최대 2년동안의 데이터만 제공됩니다.
|
|
111
|
+
* @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000). 옵션 재설정을 3회 진행한 결과가 포함될 경우 입력한 count보다 적은 수로 조회될 수 있습니다.
|
|
112
|
+
* @param cursor 페이징 처리를 위한 cursor
|
|
113
|
+
*/
|
|
114
|
+
getPotentialHistory(count: number, cursor: string): Promise<PotentialHistoryResponseDto>;
|
|
115
|
+
}
|