maplestory-openapi 2.4.1 → 2.7.2
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 +51 -41
- package/dist/index.js +1158 -393
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +1141 -393
- package/package.json +6 -4
- package/types/index.d.ts +18 -3
- package/types/maplestory/api/dto/character/characterAbilityDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterAndroidEquipmentDto.d.ts +4 -3
- package/types/maplestory/api/dto/character/characterAndroidEquipmentPresetDto.d.ts +5 -4
- package/types/maplestory/api/dto/character/characterAndroidEquipmentSkinDto.d.ts +28 -0
- package/types/maplestory/api/dto/character/characterBasicDto.d.ts +21 -1
- package/types/maplestory/api/dto/character/characterBeautyEquipmentDto.d.ts +6 -5
- package/types/maplestory/api/dto/character/characterBeautyEquipmentSkinDto.d.ts +28 -0
- package/types/maplestory/api/dto/character/characterCashItemEquipmentDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterDojangDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterHexaMatrixDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterHexaMatrixStatDto.d.ts +11 -3
- package/types/maplestory/api/dto/character/characterHyperStatDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterItemEquipmentDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterItemEquipmentExceptionalOptionDto.d.ts +4 -0
- package/types/maplestory/api/dto/character/characterLinkSkillDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterLinkSkillInfoDto.d.ts +4 -0
- package/types/maplestory/api/dto/character/characterListAccountCharacterDto.d.ts +28 -0
- package/types/maplestory/api/dto/character/characterListAccountDto.d.ts +17 -0
- package/types/maplestory/api/dto/character/characterListDto.d.ts +13 -0
- package/types/maplestory/api/dto/character/characterPetEquipmentDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterPopularityDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterPropensityDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterSetEffectDto.d.ts +3 -3
- package/types/maplestory/api/dto/character/characterSetEffectInfoDto.d.ts +5 -10
- package/types/maplestory/api/dto/character/characterSetEffectOptionFullDto.d.ts +16 -0
- package/types/maplestory/api/dto/character/characterSetEffectSetDto.d.ts +26 -0
- package/types/maplestory/api/dto/character/characterSkillDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterSkillInfoDto.d.ts +4 -0
- package/types/maplestory/api/dto/character/characterStatDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterSymbolEquipmentDto.d.ts +1 -1
- package/types/maplestory/api/dto/character/characterVMatrixCoreEquipmentDto.d.ts +2 -2
- package/types/maplestory/api/dto/character/characterVMatrixDto.d.ts +1 -1
- package/types/maplestory/api/dto/guild/guildBasicDto.d.ts +1 -9
- package/types/maplestory/api/dto/history/starforceHistoryDto.d.ts +1 -1
- package/types/maplestory/api/dto/notice/cashshopNoticeDetailDto.d.ts +40 -0
- package/types/maplestory/api/dto/notice/cashshopNoticeListDto.d.ts +13 -0
- package/types/maplestory/api/dto/notice/cashshopNoticeListItemDto.d.ts +40 -0
- package/types/maplestory/api/dto/notice/eventNoticeDetailDto.d.ts +32 -0
- package/types/maplestory/api/dto/notice/eventNoticeListDto.d.ts +13 -0
- package/types/maplestory/api/dto/notice/eventNoticeListItemDto.d.ts +32 -0
- package/types/maplestory/api/dto/notice/noticeDetailDto.d.ts +24 -0
- package/types/maplestory/api/dto/notice/noticeListDto.d.ts +13 -0
- package/types/maplestory/api/dto/notice/noticeListItemDto.d.ts +24 -0
- package/types/maplestory/api/dto/notice/updateNoticeDetailDto.d.ts +24 -0
- package/types/maplestory/api/dto/notice/updateNoticeListDto.d.ts +13 -0
- package/types/maplestory/api/dto/notice/updateNoticeListItemDto.d.ts +24 -0
- package/types/maplestory/api/dto/union/unionArtifactDto.d.ts +1 -1
- package/types/maplestory/api/dto/union/unionDto.d.ts +1 -1
- package/types/maplestory/api/dto/union/unionRaiderDto.d.ts +26 -1
- package/types/maplestory/api/dto/union/unionRaiderPresetDto.d.ts +26 -0
- package/types/maplestory/api/mapleStoryApi.d.ts +126 -25
- package/types/maplestory/api/mapleStoryApiError.d.ts +2 -1
- package/types/maplestory/api/response/character/characterAbilityDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterAndroidEquipmentDtoBody.d.ts +11 -4
- package/types/maplestory/api/response/character/characterBasicDtoBody.d.ts +4 -1
- package/types/maplestory/api/response/character/characterBeautyEquipmentDtoBody.d.ts +11 -4
- package/types/maplestory/api/response/character/characterCashItemEquipmentDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterDojangDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterHexaMatrixDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterHexaMatrixStatDtoBody.d.ts +3 -1
- package/types/maplestory/api/response/character/characterHyperStatDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterItemEquipmentDtoBody.d.ts +3 -2
- package/types/maplestory/api/response/character/characterLinkSkillDtoBody.d.ts +2 -1
- package/types/maplestory/api/response/character/characterListDtoBody.d.ts +15 -0
- package/types/maplestory/api/response/character/characterPetEquipmentDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterPopularityDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterPropensityDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterSetEffectDtoBody.d.ts +11 -6
- package/types/maplestory/api/response/character/characterSkillDtoBody.d.ts +2 -1
- package/types/maplestory/api/response/character/characterStatDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterSymbolEquipmentDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/character/characterVMatrixDtoBody.d.ts +3 -3
- package/types/maplestory/api/response/guild/guildBasicDtoBody.d.ts +1 -3
- package/types/maplestory/api/response/history/cubeHistoryDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/history/cubeHistoryResponseDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/history/starforceHistoryDtoBody.d.ts +2 -2
- package/types/maplestory/api/response/history/starforceHistoryResponseDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/notice/cashshopNoticeDetailDtoBody.d.ts +10 -0
- package/types/maplestory/api/response/notice/cashshopNoticeListDtoBody.d.ts +13 -0
- package/types/maplestory/api/response/notice/eventNoticeDetailDtoBody.d.ts +9 -0
- package/types/maplestory/api/response/notice/eventNoticeListDtoBody.d.ts +12 -0
- package/types/maplestory/api/response/notice/noticeDetailDtoBody.d.ts +7 -0
- package/types/maplestory/api/response/notice/noticeListDtoBody.d.ts +10 -0
- package/types/maplestory/api/response/notice/updateNoticeDetailDtoBody.d.ts +7 -0
- package/types/maplestory/api/response/notice/updateNoticeListDtoBody.d.ts +10 -0
- package/types/maplestory/api/response/ranking/theSeedRankingResponseDtoBody.d.ts +2 -3
- package/types/maplestory/api/response/union/unionArtifactDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/union/unionDtoBody.d.ts +1 -1
- package/types/maplestory/api/response/union/unionRaiderDtoBody.d.ts +14 -2
- package/types/maplestory/api/dto/character/characterSetEffectOptionInfoDto.d.ts +0 -16
package/README.md
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
# MapleStory OpenAPI JavaScript Library
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/maplestory-openapi)
|
|
4
|
+
[](https://github.com/SpiralMoon/maplestory.openapi/actions/workflows/js_test.yaml)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
넥슨의 MapleStory OpenAPI를 Javascript 환경에서 사용할 수 있게 해주는 라이브러리입니다.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
다른 언어로 작성된 패키지는 [여기](https://github.com/SpiralMoon/maplestory.openapi)에서 확인할 수 있습니다.
|
|
8
9
|
|
|
9
|
-
(
|
|
10
|
+
(English document is [HERE](https://github.com/SpiralMoon/maplestory.openapi/blob/master/js/README-en.md))
|
|
10
11
|
|
|
11
12
|
## Installation
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
npm 기반 프로젝트에 아래 정보를 입력하여 패키지를 추가하세요:
|
|
14
15
|
|
|
15
16
|
```bash
|
|
16
|
-
npm install maplestory-openapi
|
|
17
|
+
npm install maplestory-openapi
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
## Usage
|
|
20
21
|
|
|
21
22
|
### API Key
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
라이브러리를 사용하기 전에 [Nexon Open API 콘솔](https://openapi.nexon.com/my-application/)에서 애플리케이션을 등록하고 **api key**를 발급 받으세요.
|
|
24
25
|
|
|
25
26
|
### Supports
|
|
26
27
|
|
|
27
|
-
1. **CommonJS, ESM
|
|
28
|
+
1. **CommonJS, ESM 지원**: 이 라이브러리는 CommonJS 와 ESM 방식을 모두 지원합니다.
|
|
28
29
|
|
|
29
30
|
```javascript
|
|
30
31
|
const {MapleStoryApi, MapleStoryApiError} = require('maplestory-openapi'); // CommonJS
|
|
@@ -33,53 +34,62 @@ const {MapleStoryApi, MapleStoryApiError} = require('maplestory-openapi'); // Co
|
|
|
33
34
|
import {MapleStoryApi, MapleStoryApiError} from 'maplestory-openapi'; // ESM
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
2. **TypeScript
|
|
37
|
+
2. **TypeScript 지원**: 타입 정의가 포함되어 있으므로 타입스크립트 환경에서도 사용 가능합니다.
|
|
37
38
|
|
|
38
39
|
### Sample Code
|
|
39
40
|
|
|
41
|
+
아래 코드는 닉네임을 바탕으로 특정 캐릭터의 식별자를 조회한 후 캐릭터의 기본 정보를 조회하는 예시입니다.
|
|
42
|
+
|
|
40
43
|
```javascript
|
|
41
44
|
const {MapleStoryApi, MapleStoryApiError} = require('maplestory-openapi');
|
|
42
45
|
|
|
43
46
|
const apiKey = '{Your API Key}';
|
|
44
47
|
const api = new MapleStoryApi(apiKey);
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
console.log(e);
|
|
64
|
-
});
|
|
49
|
+
try {
|
|
50
|
+
// run your code
|
|
51
|
+
|
|
52
|
+
const character = await api.getCharacter('{Your Character Name}');
|
|
53
|
+
const characterBasic = await api.getCharacterBasic(character.ocid);
|
|
54
|
+
|
|
55
|
+
console.log(characterBasic);
|
|
56
|
+
} catch (e) {
|
|
57
|
+
// exception handling
|
|
58
|
+
|
|
59
|
+
if (e instanceof MapleStoryApiError) {
|
|
60
|
+
// handle MapleStoryApiError
|
|
61
|
+
} else {
|
|
62
|
+
// handle other errors
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
더 많은 예시는 아래 링크의 테스트 케이스에서 확인할 수 있습니다.
|
|
68
|
+
|
|
69
|
+
- [캐릭터 정보 조회](https://github.com/SpiralMoon/maplestory.openapi/blob/master/js/test/characterApi.test.ts)
|
|
70
|
+
- [유니온 정보 조회](https://github.com/SpiralMoon/maplestory.openapi/blob/master/js/test/unionApi.test.ts)
|
|
71
|
+
- [길드 정보 조회](https://github.com/SpiralMoon/maplestory.openapi/blob/master/js/test/guildApi.test.ts)
|
|
72
|
+
- [확률 정보 조회](https://github.com/SpiralMoon/maplestory.openapi/blob/master/js/test/historyApi.test.ts)
|
|
73
|
+
- [랭킹 정보 조회](https://github.com/SpiralMoon/maplestory.openapi/blob/master/js/test/rankingApi.test.ts)
|
|
74
|
+
- [공지 정보 조회](https://github.com/SpiralMoon/maplestory.openapi/blob/master/js/test/noticeApi.test.ts)
|
|
75
|
+
|
|
67
76
|
### Exception Handling
|
|
68
77
|
|
|
69
|
-
|
|
78
|
+
[MapleStory OpenAPI 가이드](https://openapi.nexon.com/guide/request-api/)에 서술된 에러 사유를 `MapleStoryApiError`를 통해 예외 처리 해야합니다.
|
|
70
79
|
|
|
71
|
-
|
|
80
|
+
`MapleStoryApi`는 특정 상태의 예외를 발생시키지 않도록 설계되었으나, 라이브러리를 사용하는 개발자의 실수로 인해 여전히 일부 상태의 예외가 발생할 수 있습니다.
|
|
72
81
|
|
|
73
|
-
|
|
82
|
+
따라서 아래 표에 설명된 `MapleStoryApiErrorCode` 목록을 기반으로 `MapleStoryApiError`를 예외 처리하시기 바랍니다.
|
|
74
83
|
|
|
75
|
-
| ErrorCode | Description
|
|
76
|
-
|
|
77
|
-
| OPENAPI00001 |
|
|
78
|
-
| OPENAPI00002 |
|
|
79
|
-
| OPENAPI00003 |
|
|
80
|
-
| OPENAPI00004 |
|
|
81
|
-
| OPENAPI00005 |
|
|
82
|
-
| OPENAPI00006 |
|
|
83
|
-
| OPENAPI00007 |
|
|
84
|
-
| OPENAPI00009 |
|
|
85
|
-
| OPENAPI00010 |
|
|
84
|
+
| ErrorCode | Description |
|
|
85
|
+
|--------------|--------------------|
|
|
86
|
+
| OPENAPI00001 | 서버 내부 오류 |
|
|
87
|
+
| OPENAPI00002 | 권한이 없는 경우 |
|
|
88
|
+
| OPENAPI00003 | 유효하지 않은 식별자 |
|
|
89
|
+
| OPENAPI00004 | 파라미터 누락 또는 유효하지 않음 |
|
|
90
|
+
| OPENAPI00005 | 유효하지 않은 API KEY |
|
|
91
|
+
| OPENAPI00006 | 유효하지 않은 API PATH |
|
|
92
|
+
| OPENAPI00007 | API 호출량 초과 |
|
|
93
|
+
| OPENAPI00009 | 데이터 준비 중 |
|
|
94
|
+
| OPENAPI00010 | 게임 점검 중 |
|
|
95
|
+
| OPENAPI00011 | API 점검 중 |
|