kms-open-api 1.0.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 +147 -0
- package/dist/index.d.mts +2874 -0
- package/dist/index.d.ts +2874 -0
- package/dist/index.js +811 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +765 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# MapleStory Open API
|
|
2
|
+
|
|
3
|
+
Nexon MapleStory Open API (https://openapi.nexon.com/ko/game/maplestory) TypeScript 클라이언트 패키지
|
|
4
|
+
|
|
5
|
+
## 설치
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## API 문서 크롤러
|
|
12
|
+
|
|
13
|
+
Swagger UI 기반의 MapleStory Open API 문서를 크롤링하여 JSON 스키마와 TypeScript 타입을 자동 생성합니다.
|
|
14
|
+
|
|
15
|
+
### 사용법
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 전체 카테고리 크롤링 (기본 모드)
|
|
19
|
+
pnpm crawl
|
|
20
|
+
|
|
21
|
+
# 상세 모드 (파라미터, 응답 스키마 포함)
|
|
22
|
+
pnpm crawl --detailed
|
|
23
|
+
|
|
24
|
+
# 특정 카테고리만 크롤링
|
|
25
|
+
pnpm crawl -c character -c ranking --detailed
|
|
26
|
+
|
|
27
|
+
# JSON만 생성
|
|
28
|
+
pnpm crawl --detailed --json-only
|
|
29
|
+
|
|
30
|
+
# TypeScript 타입만 생성
|
|
31
|
+
pnpm crawl --detailed --types-only
|
|
32
|
+
|
|
33
|
+
# 브라우저 표시 모드
|
|
34
|
+
pnpm crawl --detailed --no-headless
|
|
35
|
+
|
|
36
|
+
# 드라이런 (파일 생성 없이 시뮬레이션)
|
|
37
|
+
pnpm crawl --dry-run
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### CLI 옵션
|
|
41
|
+
|
|
42
|
+
| 옵션 | 단축 | 설명 |
|
|
43
|
+
|------|------|------|
|
|
44
|
+
| `--category` | `-c` | 크롤링할 카테고리 지정 (복수 가능) |
|
|
45
|
+
| `--output` | `-o` | 출력 디렉토리 (기본: `./output`) |
|
|
46
|
+
| `--detailed` | `-d` | 상세 모드 (파라미터/응답 스키마 추출) |
|
|
47
|
+
| `--json-only` | | JSON 파일만 생성 |
|
|
48
|
+
| `--types-only` | | TypeScript 타입만 생성 |
|
|
49
|
+
| `--headless` | | 헤드리스 브라우저 모드 (기본값) |
|
|
50
|
+
| `--no-headless` | | 브라우저 창 표시 |
|
|
51
|
+
| `--timeout` | `-t` | 타임아웃 (ms, 기본: 10000) |
|
|
52
|
+
| `--verbose` | `-v` | 상세 로그 출력 |
|
|
53
|
+
| `--dry-run` | | 시뮬레이션 모드 |
|
|
54
|
+
|
|
55
|
+
### 지원 카테고리
|
|
56
|
+
|
|
57
|
+
| 카테고리 | ID | 설명 |
|
|
58
|
+
|----------|----|----|
|
|
59
|
+
| `character` | 14 | 캐릭터 정보 조회 |
|
|
60
|
+
| `union` | 15 | 유니온 정보 조회 |
|
|
61
|
+
| `guild` | 16 | 길드 정보 조회 |
|
|
62
|
+
| `history` | 17 | 확률 정보 조회 (스타포스, 잠재능력, 큐브) |
|
|
63
|
+
| `ranking` | 18 | 랭킹 정보 조회 |
|
|
64
|
+
| `notice` | 24 | 공지 정보 조회 |
|
|
65
|
+
|
|
66
|
+
### 출력 구조
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
output/
|
|
70
|
+
├── json/
|
|
71
|
+
│ ├── character.json
|
|
72
|
+
│ ├── union.json
|
|
73
|
+
│ ├── guild.json
|
|
74
|
+
│ ├── history.json
|
|
75
|
+
│ ├── ranking.json
|
|
76
|
+
│ └── notice.json
|
|
77
|
+
└── types/
|
|
78
|
+
├── index.ts
|
|
79
|
+
├── common.types.ts
|
|
80
|
+
├── character.types.ts
|
|
81
|
+
├── union.types.ts
|
|
82
|
+
├── guild.types.ts
|
|
83
|
+
├── history.types.ts
|
|
84
|
+
├── ranking.types.ts
|
|
85
|
+
└── notice.types.ts
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 생성된 타입 사용 예시
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
import type {
|
|
92
|
+
CharacterBasicResponse,
|
|
93
|
+
CharacterBasicParams,
|
|
94
|
+
RankingOverallResponse,
|
|
95
|
+
RankingOverallParams,
|
|
96
|
+
} from './output/types';
|
|
97
|
+
|
|
98
|
+
// 캐릭터 기본 정보 조회
|
|
99
|
+
const params: CharacterBasicParams = {
|
|
100
|
+
ocid: 'character-ocid',
|
|
101
|
+
date: '2024-12-24',
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// 응답 타입
|
|
105
|
+
const response: CharacterBasicResponse = {
|
|
106
|
+
character_name: '캐릭터명',
|
|
107
|
+
world_name: '스카니아',
|
|
108
|
+
character_class: '아크메이지(불,독)',
|
|
109
|
+
character_level: 275,
|
|
110
|
+
// ...
|
|
111
|
+
};
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 개발
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# 빌드
|
|
118
|
+
pnpm build
|
|
119
|
+
|
|
120
|
+
# 테스트
|
|
121
|
+
pnpm test
|
|
122
|
+
|
|
123
|
+
# 린트 & 포맷
|
|
124
|
+
pnpm biome check . --write
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## 기술 스택
|
|
128
|
+
|
|
129
|
+
- **Package Manager**: pnpm
|
|
130
|
+
- **HTTP Client**: ky
|
|
131
|
+
- **Build Tool**: tsup
|
|
132
|
+
- **Browser Automation**: Playwright
|
|
133
|
+
- **Linter/Formatter**: Biome
|
|
134
|
+
- **Test Framework**: Vitest
|
|
135
|
+
- **Language**: TypeScript
|
|
136
|
+
|
|
137
|
+
## API 참고
|
|
138
|
+
|
|
139
|
+
- **Base URL**: `https://open.api.nexon.com`
|
|
140
|
+
- **인증**: 모든 요청에 `x-nxopen-api-key` 헤더 필요
|
|
141
|
+
- **Rate Limits**:
|
|
142
|
+
- Development: 5 req/sec, 1,000 req/day
|
|
143
|
+
- Production: 500 req/sec, 20,000,000 req/day
|
|
144
|
+
|
|
145
|
+
## 라이선스
|
|
146
|
+
|
|
147
|
+
MIT
|