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.
Files changed (96) hide show
  1. package/README.md +51 -41
  2. package/dist/index.js +1158 -393
  3. package/dist/index.min.js +1 -1
  4. package/dist/index.mjs +1141 -393
  5. package/package.json +6 -4
  6. package/types/index.d.ts +18 -3
  7. package/types/maplestory/api/dto/character/characterAbilityDto.d.ts +1 -1
  8. package/types/maplestory/api/dto/character/characterAndroidEquipmentDto.d.ts +4 -3
  9. package/types/maplestory/api/dto/character/characterAndroidEquipmentPresetDto.d.ts +5 -4
  10. package/types/maplestory/api/dto/character/characterAndroidEquipmentSkinDto.d.ts +28 -0
  11. package/types/maplestory/api/dto/character/characterBasicDto.d.ts +21 -1
  12. package/types/maplestory/api/dto/character/characterBeautyEquipmentDto.d.ts +6 -5
  13. package/types/maplestory/api/dto/character/characterBeautyEquipmentSkinDto.d.ts +28 -0
  14. package/types/maplestory/api/dto/character/characterCashItemEquipmentDto.d.ts +1 -1
  15. package/types/maplestory/api/dto/character/characterDojangDto.d.ts +1 -1
  16. package/types/maplestory/api/dto/character/characterHexaMatrixDto.d.ts +1 -1
  17. package/types/maplestory/api/dto/character/characterHexaMatrixStatDto.d.ts +11 -3
  18. package/types/maplestory/api/dto/character/characterHyperStatDto.d.ts +1 -1
  19. package/types/maplestory/api/dto/character/characterItemEquipmentDto.d.ts +1 -1
  20. package/types/maplestory/api/dto/character/characterItemEquipmentExceptionalOptionDto.d.ts +4 -0
  21. package/types/maplestory/api/dto/character/characterLinkSkillDto.d.ts +1 -1
  22. package/types/maplestory/api/dto/character/characterLinkSkillInfoDto.d.ts +4 -0
  23. package/types/maplestory/api/dto/character/characterListAccountCharacterDto.d.ts +28 -0
  24. package/types/maplestory/api/dto/character/characterListAccountDto.d.ts +17 -0
  25. package/types/maplestory/api/dto/character/characterListDto.d.ts +13 -0
  26. package/types/maplestory/api/dto/character/characterPetEquipmentDto.d.ts +1 -1
  27. package/types/maplestory/api/dto/character/characterPopularityDto.d.ts +1 -1
  28. package/types/maplestory/api/dto/character/characterPropensityDto.d.ts +1 -1
  29. package/types/maplestory/api/dto/character/characterSetEffectDto.d.ts +3 -3
  30. package/types/maplestory/api/dto/character/characterSetEffectInfoDto.d.ts +5 -10
  31. package/types/maplestory/api/dto/character/characterSetEffectOptionFullDto.d.ts +16 -0
  32. package/types/maplestory/api/dto/character/characterSetEffectSetDto.d.ts +26 -0
  33. package/types/maplestory/api/dto/character/characterSkillDto.d.ts +1 -1
  34. package/types/maplestory/api/dto/character/characterSkillInfoDto.d.ts +4 -0
  35. package/types/maplestory/api/dto/character/characterStatDto.d.ts +1 -1
  36. package/types/maplestory/api/dto/character/characterSymbolEquipmentDto.d.ts +1 -1
  37. package/types/maplestory/api/dto/character/characterVMatrixCoreEquipmentDto.d.ts +2 -2
  38. package/types/maplestory/api/dto/character/characterVMatrixDto.d.ts +1 -1
  39. package/types/maplestory/api/dto/guild/guildBasicDto.d.ts +1 -9
  40. package/types/maplestory/api/dto/history/starforceHistoryDto.d.ts +1 -1
  41. package/types/maplestory/api/dto/notice/cashshopNoticeDetailDto.d.ts +40 -0
  42. package/types/maplestory/api/dto/notice/cashshopNoticeListDto.d.ts +13 -0
  43. package/types/maplestory/api/dto/notice/cashshopNoticeListItemDto.d.ts +40 -0
  44. package/types/maplestory/api/dto/notice/eventNoticeDetailDto.d.ts +32 -0
  45. package/types/maplestory/api/dto/notice/eventNoticeListDto.d.ts +13 -0
  46. package/types/maplestory/api/dto/notice/eventNoticeListItemDto.d.ts +32 -0
  47. package/types/maplestory/api/dto/notice/noticeDetailDto.d.ts +24 -0
  48. package/types/maplestory/api/dto/notice/noticeListDto.d.ts +13 -0
  49. package/types/maplestory/api/dto/notice/noticeListItemDto.d.ts +24 -0
  50. package/types/maplestory/api/dto/notice/updateNoticeDetailDto.d.ts +24 -0
  51. package/types/maplestory/api/dto/notice/updateNoticeListDto.d.ts +13 -0
  52. package/types/maplestory/api/dto/notice/updateNoticeListItemDto.d.ts +24 -0
  53. package/types/maplestory/api/dto/union/unionArtifactDto.d.ts +1 -1
  54. package/types/maplestory/api/dto/union/unionDto.d.ts +1 -1
  55. package/types/maplestory/api/dto/union/unionRaiderDto.d.ts +26 -1
  56. package/types/maplestory/api/dto/union/unionRaiderPresetDto.d.ts +26 -0
  57. package/types/maplestory/api/mapleStoryApi.d.ts +126 -25
  58. package/types/maplestory/api/mapleStoryApiError.d.ts +2 -1
  59. package/types/maplestory/api/response/character/characterAbilityDtoBody.d.ts +1 -1
  60. package/types/maplestory/api/response/character/characterAndroidEquipmentDtoBody.d.ts +11 -4
  61. package/types/maplestory/api/response/character/characterBasicDtoBody.d.ts +4 -1
  62. package/types/maplestory/api/response/character/characterBeautyEquipmentDtoBody.d.ts +11 -4
  63. package/types/maplestory/api/response/character/characterCashItemEquipmentDtoBody.d.ts +1 -1
  64. package/types/maplestory/api/response/character/characterDojangDtoBody.d.ts +1 -1
  65. package/types/maplestory/api/response/character/characterHexaMatrixDtoBody.d.ts +1 -1
  66. package/types/maplestory/api/response/character/characterHexaMatrixStatDtoBody.d.ts +3 -1
  67. package/types/maplestory/api/response/character/characterHyperStatDtoBody.d.ts +1 -1
  68. package/types/maplestory/api/response/character/characterItemEquipmentDtoBody.d.ts +3 -2
  69. package/types/maplestory/api/response/character/characterLinkSkillDtoBody.d.ts +2 -1
  70. package/types/maplestory/api/response/character/characterListDtoBody.d.ts +15 -0
  71. package/types/maplestory/api/response/character/characterPetEquipmentDtoBody.d.ts +1 -1
  72. package/types/maplestory/api/response/character/characterPopularityDtoBody.d.ts +1 -1
  73. package/types/maplestory/api/response/character/characterPropensityDtoBody.d.ts +1 -1
  74. package/types/maplestory/api/response/character/characterSetEffectDtoBody.d.ts +11 -6
  75. package/types/maplestory/api/response/character/characterSkillDtoBody.d.ts +2 -1
  76. package/types/maplestory/api/response/character/characterStatDtoBody.d.ts +1 -1
  77. package/types/maplestory/api/response/character/characterSymbolEquipmentDtoBody.d.ts +1 -1
  78. package/types/maplestory/api/response/character/characterVMatrixDtoBody.d.ts +3 -3
  79. package/types/maplestory/api/response/guild/guildBasicDtoBody.d.ts +1 -3
  80. package/types/maplestory/api/response/history/cubeHistoryDtoBody.d.ts +1 -1
  81. package/types/maplestory/api/response/history/cubeHistoryResponseDtoBody.d.ts +1 -1
  82. package/types/maplestory/api/response/history/starforceHistoryDtoBody.d.ts +2 -2
  83. package/types/maplestory/api/response/history/starforceHistoryResponseDtoBody.d.ts +1 -1
  84. package/types/maplestory/api/response/notice/cashshopNoticeDetailDtoBody.d.ts +10 -0
  85. package/types/maplestory/api/response/notice/cashshopNoticeListDtoBody.d.ts +13 -0
  86. package/types/maplestory/api/response/notice/eventNoticeDetailDtoBody.d.ts +9 -0
  87. package/types/maplestory/api/response/notice/eventNoticeListDtoBody.d.ts +12 -0
  88. package/types/maplestory/api/response/notice/noticeDetailDtoBody.d.ts +7 -0
  89. package/types/maplestory/api/response/notice/noticeListDtoBody.d.ts +10 -0
  90. package/types/maplestory/api/response/notice/updateNoticeDetailDtoBody.d.ts +7 -0
  91. package/types/maplestory/api/response/notice/updateNoticeListDtoBody.d.ts +10 -0
  92. package/types/maplestory/api/response/ranking/theSeedRankingResponseDtoBody.d.ts +2 -3
  93. package/types/maplestory/api/response/union/unionArtifactDtoBody.d.ts +1 -1
  94. package/types/maplestory/api/response/union/unionDtoBody.d.ts +1 -1
  95. package/types/maplestory/api/response/union/unionRaiderDtoBody.d.ts +14 -2
  96. 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
  [![npm](https://img.shields.io/npm/v/maplestory-openapi)](https://www.npmjs.com/package/maplestory-openapi)
4
+ [![JS](https://github.com/SpiralMoon/maplestory.openapi/actions/workflows/js_test.yaml/badge.svg)](https://github.com/SpiralMoon/maplestory.openapi/actions/workflows/js_test.yaml)
4
5
 
5
- This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.
6
+ 넥슨의 MapleStory OpenAPI를 Javascript 환경에서 사용할 있게 해주는 라이브러리입니다.
6
7
 
7
- Packages written in other languages can be found [HERE](https://github.com/SpiralMoon/maplestory.openapi).
8
+ 다른 언어로 작성된 패키지는 [여기](https://github.com/SpiralMoon/maplestory.openapi)에서 확인할 수 있습니다.
8
9
 
9
- (한국어 문서는 [이쪽](https://github.com/SpiralMoon/maplestory.openapi/blob/master/js/README-ko.md)입니다.)
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
- Install the latest version of the JavaScript/TypeScript library in your npm project:
14
+ npm 기반 프로젝트에 아래 정보를 입력하여 패키지를 추가하세요:
14
15
 
15
16
  ```bash
16
- npm install maplestory-openapi@2.4.1 # Replace with the latest version
17
+ npm install maplestory-openapi
17
18
  ```
18
19
 
19
20
  ## Usage
20
21
 
21
22
  ### API Key
22
23
 
23
- Before using the library, register your application and obtain an **api key** from the [Nexon Open API Console](https://openapi.nexon.com/my-application/).
24
+ 라이브러리를 사용하기 전에 [Nexon Open API 콘솔](https://openapi.nexon.com/my-application/)에서 애플리케이션을 등록하고 **api key**를 발급 받으세요.
24
25
 
25
26
  ### Supports
26
27
 
27
- 1. **CommonJS, ESM Support**: The library supports both CommonJS and ESM usage.
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 Support**: TypeScript is fully supported. Type definitions are included.
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
- api.getCubeHistory(1000, {
47
- year: 2023,
48
- month: 10,
49
- day: 15
50
- })
51
- .then((dto) => {
52
- const {count, cubeHistory, nextCursor} = dto;
53
-
54
- console.log('You used ' + count + ' cubes.');
55
- })
56
- .catch((e) => {
57
- if (e instanceof MapleStoryApiError) {
58
- // handle MapleStoryApiError
59
- } else {
60
- // handle other errors
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
- Handle `MapleStoryApiError` to safely make calls, ensuring that specific Status defined in the [MapleStory OpenAPI Guide](https://openapi.nexon.com/guide/request-api) are not encountered.
78
+ [MapleStory OpenAPI 가이드](https://openapi.nexon.com/guide/request-api/) 서술된 에러 사유를 `MapleStoryApiError`를 통해 예외 처리 해야합니다.
70
79
 
71
- While `MapleStoryApi` is designed to prevent the occurrence of certain Status, exceptions may arise due to developer mistakes.
80
+ `MapleStoryApi`는 특정 상태의 예외를 발생시키지 않도록 설계되었으나, 라이브러리를 사용하는 개발자의 실수로 인해 여전히 일부 상태의 예외가 발생할 수 있습니다.
72
81
 
73
- Therefore, it's recommended to use `MapleStoryApiError` for exception handling based on the `MapleStoryApiErrorCode` list described in the table below.
82
+ 따라서 아래 표에 설명된 `MapleStoryApiErrorCode` 목록을 기반으로 `MapleStoryApiError`를 예외 처리하시기 바랍니다.
74
83
 
75
- | ErrorCode | Description |
76
- |--------------|------------------------------------------|
77
- | OPENAPI00001 | Internal server error |
78
- | OPENAPI00002 | Access denied |
79
- | OPENAPI00003 | Invalid identifier |
80
- | OPENAPI00004 | Request format error (incorrect parameter input) |
81
- | OPENAPI00005 | Invalid api key |
82
- | OPENAPI00006 | Invalid api path |
83
- | OPENAPI00007 | Request allowance (Rate Limit) exceeded |
84
- | OPENAPI00009 | Not prepared data |
85
- | OPENAPI00010 | API server mainternence |
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 점검 중 |