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/dist/index.mjs
ADDED
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
|
|
5
|
+
// src/types/common.ts
|
|
6
|
+
function formatDate(input) {
|
|
7
|
+
if (typeof input === "string") {
|
|
8
|
+
return input;
|
|
9
|
+
}
|
|
10
|
+
return input.toISOString().split("T")[0];
|
|
11
|
+
}
|
|
12
|
+
function getYesterdayDate() {
|
|
13
|
+
const yesterday = /* @__PURE__ */ new Date();
|
|
14
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
15
|
+
return formatDate(yesterday);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// src/api/base.ts
|
|
19
|
+
import ky from "ky";
|
|
20
|
+
|
|
21
|
+
// src/errors.ts
|
|
22
|
+
var MapleApiError = class _MapleApiError extends Error {
|
|
23
|
+
constructor(options) {
|
|
24
|
+
super(options.message);
|
|
25
|
+
/** Error code from Nexon API (e.g., "OPENAPI00001") */
|
|
26
|
+
__publicField(this, "code");
|
|
27
|
+
/** HTTP status code (400, 403, 429, 500, etc.) */
|
|
28
|
+
__publicField(this, "httpStatus");
|
|
29
|
+
/** Original error for debugging purposes */
|
|
30
|
+
__publicField(this, "originalError");
|
|
31
|
+
/** Retry-After header value in seconds (for rate limit errors) */
|
|
32
|
+
__publicField(this, "retryAfter");
|
|
33
|
+
this.name = options.name;
|
|
34
|
+
this.code = options.code;
|
|
35
|
+
this.httpStatus = options.httpStatus;
|
|
36
|
+
this.originalError = options.originalError;
|
|
37
|
+
this.retryAfter = options.retryAfter;
|
|
38
|
+
if (Error.captureStackTrace) {
|
|
39
|
+
Error.captureStackTrace(this, _MapleApiError);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Check if this is an authentication error (403)
|
|
44
|
+
*/
|
|
45
|
+
isAuthError() {
|
|
46
|
+
return this.httpStatus === 403;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Check if this is a rate limit error (429)
|
|
50
|
+
*/
|
|
51
|
+
isRateLimitError() {
|
|
52
|
+
return this.httpStatus === 429;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Check if this is a bad request error (400)
|
|
56
|
+
*/
|
|
57
|
+
isBadRequestError() {
|
|
58
|
+
return this.httpStatus === 400;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Check if this is a server error (5xx)
|
|
62
|
+
*/
|
|
63
|
+
isServerError() {
|
|
64
|
+
return this.httpStatus >= 500 && this.httpStatus < 600;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Creates a string representation of the error
|
|
68
|
+
*/
|
|
69
|
+
toString() {
|
|
70
|
+
return `MapleApiError: [${this.code}] ${this.message} (HTTP ${this.httpStatus})`;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var MapleNetworkError = class _MapleNetworkError extends Error {
|
|
74
|
+
constructor(options) {
|
|
75
|
+
super(options.message);
|
|
76
|
+
/** Original error for debugging */
|
|
77
|
+
__publicField(this, "originalError");
|
|
78
|
+
/** Whether this is a timeout error */
|
|
79
|
+
__publicField(this, "isTimeout");
|
|
80
|
+
this.name = "MapleNetworkError";
|
|
81
|
+
this.originalError = options.originalError;
|
|
82
|
+
this.isTimeout = options.isTimeout ?? false;
|
|
83
|
+
if (Error.captureStackTrace) {
|
|
84
|
+
Error.captureStackTrace(this, _MapleNetworkError);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// src/api/base.ts
|
|
90
|
+
var BaseApi = class {
|
|
91
|
+
constructor(apiKey) {
|
|
92
|
+
__publicField(this, "client");
|
|
93
|
+
this.client = ky.create({
|
|
94
|
+
prefixUrl: "https://open.api.nexon.com",
|
|
95
|
+
headers: {
|
|
96
|
+
"x-nxopen-api-key": apiKey
|
|
97
|
+
},
|
|
98
|
+
hooks: {
|
|
99
|
+
afterResponse: [
|
|
100
|
+
async (_request, _options, response) => {
|
|
101
|
+
if (!response.ok) {
|
|
102
|
+
await this.handleErrorResponse(response);
|
|
103
|
+
}
|
|
104
|
+
return response;
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Handles error responses and throws appropriate error types
|
|
112
|
+
*/
|
|
113
|
+
async handleErrorResponse(response) {
|
|
114
|
+
let errorData = null;
|
|
115
|
+
try {
|
|
116
|
+
errorData = await response.json();
|
|
117
|
+
} catch {
|
|
118
|
+
}
|
|
119
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
120
|
+
throw new MapleApiError({
|
|
121
|
+
name: errorData?.error?.name ?? "UNKNOWN_ERROR",
|
|
122
|
+
message: errorData?.error?.message ?? `HTTP ${response.status} Error`,
|
|
123
|
+
code: errorData?.error?.name ?? "UNKNOWN",
|
|
124
|
+
httpStatus: response.status,
|
|
125
|
+
retryAfter: retryAfter ? Number.parseInt(retryAfter, 10) : void 0
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Makes a GET request with proper error handling
|
|
130
|
+
*/
|
|
131
|
+
async get(endpoint, searchParams, options) {
|
|
132
|
+
try {
|
|
133
|
+
const filteredParams = {};
|
|
134
|
+
if (searchParams) {
|
|
135
|
+
for (const [key, value] of Object.entries(searchParams)) {
|
|
136
|
+
if (value !== void 0) {
|
|
137
|
+
filteredParams[key] = value;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const kyOptions = {
|
|
142
|
+
searchParams: Object.keys(filteredParams).length > 0 ? filteredParams : void 0
|
|
143
|
+
};
|
|
144
|
+
if (options?.signal) {
|
|
145
|
+
kyOptions.signal = options.signal;
|
|
146
|
+
}
|
|
147
|
+
const normalizedEndpoint = endpoint.startsWith("/") ? endpoint.slice(1) : endpoint;
|
|
148
|
+
return await this.client.get(normalizedEndpoint, kyOptions).json();
|
|
149
|
+
} catch (error) {
|
|
150
|
+
if (error instanceof MapleApiError) {
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
if (error instanceof TypeError && error.message.includes("fetch")) {
|
|
154
|
+
throw new MapleNetworkError({
|
|
155
|
+
message: "Network error: Unable to connect to API",
|
|
156
|
+
originalError: error
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
160
|
+
throw new MapleNetworkError({
|
|
161
|
+
message: "Request was aborted",
|
|
162
|
+
originalError: error,
|
|
163
|
+
isTimeout: true
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// src/api/character.ts
|
|
172
|
+
var CharacterApi = class extends BaseApi {
|
|
173
|
+
/**
|
|
174
|
+
* 캐릭터 목록 조회
|
|
175
|
+
*/
|
|
176
|
+
async getList(options) {
|
|
177
|
+
return this.get("/maplestory/v1/character/list", void 0, options);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 업적 정보 조회
|
|
181
|
+
*/
|
|
182
|
+
async getAchievement(options) {
|
|
183
|
+
return this.get("/maplestory/v1/user/achievement", void 0, options);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* 캐릭터 식별자(ocid) 조회
|
|
187
|
+
*/
|
|
188
|
+
async getId(params, options) {
|
|
189
|
+
const searchParams = {};
|
|
190
|
+
searchParams.character_name = String(params.characterName);
|
|
191
|
+
return this.get("/maplestory/v1/id", searchParams, options);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* 기본 정보 조회
|
|
195
|
+
*/
|
|
196
|
+
async getBasic(params, options) {
|
|
197
|
+
const searchParams = {};
|
|
198
|
+
searchParams.ocid = String(params.ocid);
|
|
199
|
+
if (params.date !== void 0) {
|
|
200
|
+
searchParams.date = formatDate(params.date);
|
|
201
|
+
}
|
|
202
|
+
return this.get("/maplestory/v1/character/basic", searchParams, options);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* 인기도 정보 조회
|
|
206
|
+
*/
|
|
207
|
+
async getPopularity(params, options) {
|
|
208
|
+
const searchParams = {};
|
|
209
|
+
searchParams.ocid = String(params.ocid);
|
|
210
|
+
if (params.date !== void 0) {
|
|
211
|
+
searchParams.date = formatDate(params.date);
|
|
212
|
+
}
|
|
213
|
+
return this.get("/maplestory/v1/character/popularity", searchParams, options);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* 종합 능력치 정보 조회
|
|
217
|
+
*/
|
|
218
|
+
async getStat(params, options) {
|
|
219
|
+
const searchParams = {};
|
|
220
|
+
searchParams.ocid = String(params.ocid);
|
|
221
|
+
if (params.date !== void 0) {
|
|
222
|
+
searchParams.date = formatDate(params.date);
|
|
223
|
+
}
|
|
224
|
+
return this.get("/maplestory/v1/character/stat", searchParams, options);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* 하이퍼스탯 정보 조회
|
|
228
|
+
*/
|
|
229
|
+
async getHyperstat(params, options) {
|
|
230
|
+
const searchParams = {};
|
|
231
|
+
searchParams.ocid = String(params.ocid);
|
|
232
|
+
if (params.date !== void 0) {
|
|
233
|
+
searchParams.date = formatDate(params.date);
|
|
234
|
+
}
|
|
235
|
+
return this.get("/maplestory/v1/character/hyper-stat", searchParams, options);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* 성향 정보 조회
|
|
239
|
+
*/
|
|
240
|
+
async getPropensity(params, options) {
|
|
241
|
+
const searchParams = {};
|
|
242
|
+
searchParams.ocid = String(params.ocid);
|
|
243
|
+
if (params.date !== void 0) {
|
|
244
|
+
searchParams.date = formatDate(params.date);
|
|
245
|
+
}
|
|
246
|
+
return this.get("/maplestory/v1/character/propensity", searchParams, options);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* 어빌리티 정보 조회
|
|
250
|
+
*/
|
|
251
|
+
async getAbility(params, options) {
|
|
252
|
+
const searchParams = {};
|
|
253
|
+
searchParams.ocid = String(params.ocid);
|
|
254
|
+
if (params.date !== void 0) {
|
|
255
|
+
searchParams.date = formatDate(params.date);
|
|
256
|
+
}
|
|
257
|
+
return this.get("/maplestory/v1/character/ability", searchParams, options);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* 장착 장비 정보 조회 (캐시 장비 제외)
|
|
261
|
+
*/
|
|
262
|
+
async getItemequipment(params, options) {
|
|
263
|
+
const searchParams = {};
|
|
264
|
+
searchParams.ocid = String(params.ocid);
|
|
265
|
+
if (params.date !== void 0) {
|
|
266
|
+
searchParams.date = formatDate(params.date);
|
|
267
|
+
}
|
|
268
|
+
return this.get("/maplestory/v1/character/item-equipment", searchParams, options);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* 장착 캐시 장비 정보 조회
|
|
272
|
+
*/
|
|
273
|
+
async getCashitemequipment(params, options) {
|
|
274
|
+
const searchParams = {};
|
|
275
|
+
searchParams.ocid = String(params.ocid);
|
|
276
|
+
if (params.date !== void 0) {
|
|
277
|
+
searchParams.date = formatDate(params.date);
|
|
278
|
+
}
|
|
279
|
+
return this.get("/maplestory/v1/character/cashitem-equipment", searchParams, options);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* 장착 심볼 정보 조회
|
|
283
|
+
*/
|
|
284
|
+
async getSymbolequipment(params, options) {
|
|
285
|
+
const searchParams = {};
|
|
286
|
+
searchParams.ocid = String(params.ocid);
|
|
287
|
+
if (params.date !== void 0) {
|
|
288
|
+
searchParams.date = formatDate(params.date);
|
|
289
|
+
}
|
|
290
|
+
return this.get("/maplestory/v1/character/symbol-equipment", searchParams, options);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* 적용 세트 효과 정보 조회
|
|
294
|
+
*/
|
|
295
|
+
async getSeteffect(params, options) {
|
|
296
|
+
const searchParams = {};
|
|
297
|
+
searchParams.ocid = String(params.ocid);
|
|
298
|
+
if (params.date !== void 0) {
|
|
299
|
+
searchParams.date = formatDate(params.date);
|
|
300
|
+
}
|
|
301
|
+
return this.get("/maplestory/v1/character/set-effect", searchParams, options);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* 장착 헤어, 성형, 피부 정보 조회
|
|
305
|
+
*/
|
|
306
|
+
async getBeautyequipment(params, options) {
|
|
307
|
+
const searchParams = {};
|
|
308
|
+
searchParams.ocid = String(params.ocid);
|
|
309
|
+
if (params.date !== void 0) {
|
|
310
|
+
searchParams.date = formatDate(params.date);
|
|
311
|
+
}
|
|
312
|
+
return this.get("/maplestory/v1/character/beauty-equipment", searchParams, options);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* 장착 안드로이드 정보 조회
|
|
316
|
+
*/
|
|
317
|
+
async getAndroidequipment(params, options) {
|
|
318
|
+
const searchParams = {};
|
|
319
|
+
searchParams.ocid = String(params.ocid);
|
|
320
|
+
if (params.date !== void 0) {
|
|
321
|
+
searchParams.date = formatDate(params.date);
|
|
322
|
+
}
|
|
323
|
+
return this.get("/maplestory/v1/character/android-equipment", searchParams, options);
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* 장착 펫 정보 조회
|
|
327
|
+
*/
|
|
328
|
+
async getPetequipment(params, options) {
|
|
329
|
+
const searchParams = {};
|
|
330
|
+
searchParams.ocid = String(params.ocid);
|
|
331
|
+
if (params.date !== void 0) {
|
|
332
|
+
searchParams.date = formatDate(params.date);
|
|
333
|
+
}
|
|
334
|
+
return this.get("/maplestory/v1/character/pet-equipment", searchParams, options);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* 스킬 정보 조회
|
|
338
|
+
*/
|
|
339
|
+
async getSkill(params, options) {
|
|
340
|
+
const searchParams = {};
|
|
341
|
+
searchParams.ocid = String(params.ocid);
|
|
342
|
+
if (params.date !== void 0) {
|
|
343
|
+
searchParams.date = formatDate(params.date);
|
|
344
|
+
}
|
|
345
|
+
searchParams.character_skill_grade = String(params.characterSkillGrade);
|
|
346
|
+
return this.get("/maplestory/v1/character/skill", searchParams, options);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* 장착 링크 스킬 정보 조회
|
|
350
|
+
*/
|
|
351
|
+
async getLinkskill(params, options) {
|
|
352
|
+
const searchParams = {};
|
|
353
|
+
searchParams.ocid = String(params.ocid);
|
|
354
|
+
if (params.date !== void 0) {
|
|
355
|
+
searchParams.date = formatDate(params.date);
|
|
356
|
+
}
|
|
357
|
+
return this.get("/maplestory/v1/character/link-skill", searchParams, options);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* V매트릭스 정보 조회
|
|
361
|
+
*/
|
|
362
|
+
async getVmatrix(params, options) {
|
|
363
|
+
const searchParams = {};
|
|
364
|
+
searchParams.ocid = String(params.ocid);
|
|
365
|
+
if (params.date !== void 0) {
|
|
366
|
+
searchParams.date = formatDate(params.date);
|
|
367
|
+
}
|
|
368
|
+
return this.get("/maplestory/v1/character/vmatrix", searchParams, options);
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* HEXA 코어 정보 조회
|
|
372
|
+
*/
|
|
373
|
+
async getHexamatrix(params, options) {
|
|
374
|
+
const searchParams = {};
|
|
375
|
+
searchParams.ocid = String(params.ocid);
|
|
376
|
+
if (params.date !== void 0) {
|
|
377
|
+
searchParams.date = formatDate(params.date);
|
|
378
|
+
}
|
|
379
|
+
return this.get("/maplestory/v1/character/hexamatrix", searchParams, options);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* HEXA 매트릭스 설정 HEXA 스탯 정보 조회
|
|
383
|
+
*/
|
|
384
|
+
async getHexamatrixstat(params, options) {
|
|
385
|
+
const searchParams = {};
|
|
386
|
+
searchParams.ocid = String(params.ocid);
|
|
387
|
+
if (params.date !== void 0) {
|
|
388
|
+
searchParams.date = formatDate(params.date);
|
|
389
|
+
}
|
|
390
|
+
return this.get("/maplestory/v1/character/hexamatrix-stat", searchParams, options);
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* 무릉도장 최고 기록 정보 조회
|
|
394
|
+
*/
|
|
395
|
+
async getDojang(params, options) {
|
|
396
|
+
const searchParams = {};
|
|
397
|
+
searchParams.ocid = String(params.ocid);
|
|
398
|
+
if (params.date !== void 0) {
|
|
399
|
+
searchParams.date = formatDate(params.date);
|
|
400
|
+
}
|
|
401
|
+
return this.get("/maplestory/v1/character/dojang", searchParams, options);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* 기타 능력치 영향 요소 정보 조회
|
|
405
|
+
*/
|
|
406
|
+
async getOtherstat(params, options) {
|
|
407
|
+
const searchParams = {};
|
|
408
|
+
searchParams.ocid = String(params.ocid);
|
|
409
|
+
if (params.date !== void 0) {
|
|
410
|
+
searchParams.date = formatDate(params.date);
|
|
411
|
+
}
|
|
412
|
+
return this.get("/maplestory/v1/character/other-stat", searchParams, options);
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* 링 익스체인지 스킬 등록 장비 조회
|
|
416
|
+
*/
|
|
417
|
+
async getRingexchangeskillequipment(params, options) {
|
|
418
|
+
const searchParams = {};
|
|
419
|
+
searchParams.ocid = String(params.ocid);
|
|
420
|
+
if (params.date !== void 0) {
|
|
421
|
+
searchParams.date = formatDate(params.date);
|
|
422
|
+
}
|
|
423
|
+
return this.get("/maplestory/v1/character/ring-exchange-skill-equipment", searchParams, options);
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
// src/api/guild.ts
|
|
428
|
+
var GuildApi = class extends BaseApi {
|
|
429
|
+
/**
|
|
430
|
+
* 길드 식별자(oguild_id) 정보 조회
|
|
431
|
+
*/
|
|
432
|
+
async getId(params, options) {
|
|
433
|
+
const searchParams = {};
|
|
434
|
+
searchParams.guild_name = String(params.guildName);
|
|
435
|
+
searchParams.world_name = String(params.worldName);
|
|
436
|
+
return this.get("/maplestory/v1/guild/id", searchParams, options);
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* 기본 정보 조회
|
|
440
|
+
*/
|
|
441
|
+
async getBasic(params, options) {
|
|
442
|
+
const searchParams = {};
|
|
443
|
+
searchParams.oguild_id = String(params.oguildId);
|
|
444
|
+
if (params.date !== void 0) {
|
|
445
|
+
searchParams.date = formatDate(params.date);
|
|
446
|
+
}
|
|
447
|
+
return this.get("/maplestory/v1/guild/basic", searchParams, options);
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
// src/api/history.ts
|
|
452
|
+
var HistoryApi = class extends BaseApi {
|
|
453
|
+
/**
|
|
454
|
+
* 계정 식별자(ouid) 조회 (구 API KEY 사용)
|
|
455
|
+
*/
|
|
456
|
+
async getLegacyouid(options) {
|
|
457
|
+
return this.get("/maplestory/legacy/ouid", void 0, options);
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* 계정 식별자(ouid) 조회
|
|
461
|
+
*/
|
|
462
|
+
async getOuid(options) {
|
|
463
|
+
return this.get("/maplestory/v1/ouid", void 0, options);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* 스타포스 강화 결과 조회
|
|
467
|
+
*/
|
|
468
|
+
async getStarforce(params, options) {
|
|
469
|
+
const searchParams = {};
|
|
470
|
+
searchParams.count = String(params.count);
|
|
471
|
+
if (params.date !== void 0) {
|
|
472
|
+
searchParams.date = formatDate(params.date);
|
|
473
|
+
}
|
|
474
|
+
if (params.cursor !== void 0) {
|
|
475
|
+
searchParams.cursor = String(params.cursor);
|
|
476
|
+
}
|
|
477
|
+
return this.get("/maplestory/v1/history/starforce", searchParams, options);
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* 잠재능력 재설정 이용 결과 조회
|
|
481
|
+
*/
|
|
482
|
+
async getPotential(params, options) {
|
|
483
|
+
const searchParams = {};
|
|
484
|
+
searchParams.count = String(params.count);
|
|
485
|
+
if (params.date !== void 0) {
|
|
486
|
+
searchParams.date = formatDate(params.date);
|
|
487
|
+
}
|
|
488
|
+
if (params.cursor !== void 0) {
|
|
489
|
+
searchParams.cursor = String(params.cursor);
|
|
490
|
+
}
|
|
491
|
+
return this.get("/maplestory/v1/history/potential", searchParams, options);
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* 큐브 사용 결과 조회
|
|
495
|
+
*/
|
|
496
|
+
async getCube(params, options) {
|
|
497
|
+
const searchParams = {};
|
|
498
|
+
searchParams.count = String(params.count);
|
|
499
|
+
if (params.date !== void 0) {
|
|
500
|
+
searchParams.date = formatDate(params.date);
|
|
501
|
+
}
|
|
502
|
+
if (params.cursor !== void 0) {
|
|
503
|
+
searchParams.cursor = String(params.cursor);
|
|
504
|
+
}
|
|
505
|
+
return this.get("/maplestory/v1/history/cube", searchParams, options);
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
// src/api/notice.ts
|
|
510
|
+
var NoticeApi = class extends BaseApi {
|
|
511
|
+
/**
|
|
512
|
+
* 공지사항 목록 조회
|
|
513
|
+
*/
|
|
514
|
+
async getNotice(options) {
|
|
515
|
+
return this.get("/maplestory/v1/notice", void 0, options);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* 공지사항 상세 조회
|
|
519
|
+
*/
|
|
520
|
+
async getDetail(params, options) {
|
|
521
|
+
const searchParams = {};
|
|
522
|
+
searchParams.notice_id = String(params.noticeId);
|
|
523
|
+
return this.get("/maplestory/v1/notice/detail", searchParams, options);
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* 업데이트 목록 조회
|
|
527
|
+
*/
|
|
528
|
+
async getNoticeupdate(options) {
|
|
529
|
+
return this.get("/maplestory/v1/notice-update", void 0, options);
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* 업데이트 상세 조회
|
|
533
|
+
*/
|
|
534
|
+
async getUpdatedetail(params, options) {
|
|
535
|
+
const searchParams = {};
|
|
536
|
+
searchParams.notice_id = String(params.noticeId);
|
|
537
|
+
return this.get("/maplestory/v1/notice-update/detail", searchParams, options);
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* 진행 중 이벤트 목록 조회
|
|
541
|
+
*/
|
|
542
|
+
async getNoticeevent(options) {
|
|
543
|
+
return this.get("/maplestory/v1/notice-event", void 0, options);
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* 진행 중 이벤트 상세 조회
|
|
547
|
+
*/
|
|
548
|
+
async getEventdetail(params, options) {
|
|
549
|
+
const searchParams = {};
|
|
550
|
+
searchParams.notice_id = String(params.noticeId);
|
|
551
|
+
return this.get("/maplestory/v1/notice-event/detail", searchParams, options);
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* 캐시샵 공지 목록 조회
|
|
555
|
+
*/
|
|
556
|
+
async getNoticecashshop(options) {
|
|
557
|
+
return this.get("/maplestory/v1/notice-cashshop", void 0, options);
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* 캐시샵 공지 상세 조회
|
|
561
|
+
*/
|
|
562
|
+
async getCashshopdetail(params, options) {
|
|
563
|
+
const searchParams = {};
|
|
564
|
+
searchParams.notice_id = String(params.noticeId);
|
|
565
|
+
return this.get("/maplestory/v1/notice-cashshop/detail", searchParams, options);
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
// src/api/ranking.ts
|
|
570
|
+
var RankingApi = class extends BaseApi {
|
|
571
|
+
/**
|
|
572
|
+
* 종합 랭킹 정보 조회
|
|
573
|
+
*/
|
|
574
|
+
async getOverall(params, options) {
|
|
575
|
+
const searchParams = {};
|
|
576
|
+
searchParams.date = formatDate(params.date);
|
|
577
|
+
if (params.worldName !== void 0) {
|
|
578
|
+
searchParams.world_name = String(params.worldName);
|
|
579
|
+
}
|
|
580
|
+
if (params.worldType !== void 0) {
|
|
581
|
+
searchParams.world_type = String(params.worldType);
|
|
582
|
+
}
|
|
583
|
+
if (params.class !== void 0) {
|
|
584
|
+
searchParams.class = String(params.class);
|
|
585
|
+
}
|
|
586
|
+
if (params.ocid !== void 0) {
|
|
587
|
+
searchParams.ocid = String(params.ocid);
|
|
588
|
+
}
|
|
589
|
+
if (params.page !== void 0) {
|
|
590
|
+
searchParams.page = String(params.page);
|
|
591
|
+
}
|
|
592
|
+
return this.get("/maplestory/v1/ranking/overall", searchParams, options);
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* 유니온 랭킹 정보 조회
|
|
596
|
+
*/
|
|
597
|
+
async getUnion(params, options) {
|
|
598
|
+
const searchParams = {};
|
|
599
|
+
searchParams.date = formatDate(params.date);
|
|
600
|
+
if (params.worldName !== void 0) {
|
|
601
|
+
searchParams.world_name = String(params.worldName);
|
|
602
|
+
}
|
|
603
|
+
if (params.ocid !== void 0) {
|
|
604
|
+
searchParams.ocid = String(params.ocid);
|
|
605
|
+
}
|
|
606
|
+
if (params.page !== void 0) {
|
|
607
|
+
searchParams.page = String(params.page);
|
|
608
|
+
}
|
|
609
|
+
return this.get("/maplestory/v1/ranking/union", searchParams, options);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* 길드 랭킹 정보 조회
|
|
613
|
+
*/
|
|
614
|
+
async getGuild(params, options) {
|
|
615
|
+
const searchParams = {};
|
|
616
|
+
searchParams.date = formatDate(params.date);
|
|
617
|
+
if (params.worldName !== void 0) {
|
|
618
|
+
searchParams.world_name = String(params.worldName);
|
|
619
|
+
}
|
|
620
|
+
searchParams.ranking_type = String(params.rankingType);
|
|
621
|
+
if (params.guildName !== void 0) {
|
|
622
|
+
searchParams.guild_name = String(params.guildName);
|
|
623
|
+
}
|
|
624
|
+
if (params.page !== void 0) {
|
|
625
|
+
searchParams.page = String(params.page);
|
|
626
|
+
}
|
|
627
|
+
return this.get("/maplestory/v1/ranking/guild", searchParams, options);
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* 무릉도장 랭킹 정보 조회
|
|
631
|
+
*/
|
|
632
|
+
async getDojang(params, options) {
|
|
633
|
+
const searchParams = {};
|
|
634
|
+
searchParams.date = formatDate(params.date);
|
|
635
|
+
if (params.worldName !== void 0) {
|
|
636
|
+
searchParams.world_name = String(params.worldName);
|
|
637
|
+
}
|
|
638
|
+
searchParams.difficulty = String(params.difficulty);
|
|
639
|
+
if (params.class !== void 0) {
|
|
640
|
+
searchParams.class = String(params.class);
|
|
641
|
+
}
|
|
642
|
+
if (params.ocid !== void 0) {
|
|
643
|
+
searchParams.ocid = String(params.ocid);
|
|
644
|
+
}
|
|
645
|
+
if (params.page !== void 0) {
|
|
646
|
+
searchParams.page = String(params.page);
|
|
647
|
+
}
|
|
648
|
+
return this.get("/maplestory/v1/ranking/dojang", searchParams, options);
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* 더 시드 랭킹 정보 조회
|
|
652
|
+
*/
|
|
653
|
+
async getTheseed(params, options) {
|
|
654
|
+
const searchParams = {};
|
|
655
|
+
searchParams.date = formatDate(params.date);
|
|
656
|
+
if (params.worldName !== void 0) {
|
|
657
|
+
searchParams.world_name = String(params.worldName);
|
|
658
|
+
}
|
|
659
|
+
if (params.ocid !== void 0) {
|
|
660
|
+
searchParams.ocid = String(params.ocid);
|
|
661
|
+
}
|
|
662
|
+
if (params.page !== void 0) {
|
|
663
|
+
searchParams.page = String(params.page);
|
|
664
|
+
}
|
|
665
|
+
return this.get("/maplestory/v1/ranking/theseed", searchParams, options);
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* 업적 랭킹 정보 조회
|
|
669
|
+
*/
|
|
670
|
+
async getAchievement(params, options) {
|
|
671
|
+
const searchParams = {};
|
|
672
|
+
searchParams.date = formatDate(params.date);
|
|
673
|
+
if (params.ocid !== void 0) {
|
|
674
|
+
searchParams.ocid = String(params.ocid);
|
|
675
|
+
}
|
|
676
|
+
if (params.page !== void 0) {
|
|
677
|
+
searchParams.page = String(params.page);
|
|
678
|
+
}
|
|
679
|
+
return this.get("/maplestory/v1/ranking/achievement", searchParams, options);
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
// src/api/union.ts
|
|
684
|
+
var UnionApi = class extends BaseApi {
|
|
685
|
+
/**
|
|
686
|
+
* 유니온 정보 조회
|
|
687
|
+
*/
|
|
688
|
+
async getUnion(params, options) {
|
|
689
|
+
const searchParams = {};
|
|
690
|
+
searchParams.ocid = String(params.ocid);
|
|
691
|
+
if (params.date !== void 0) {
|
|
692
|
+
searchParams.date = formatDate(params.date);
|
|
693
|
+
}
|
|
694
|
+
return this.get("/maplestory/v1/user/union", searchParams, options);
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* 유니온 공격대 정보 조회
|
|
698
|
+
*/
|
|
699
|
+
async getUnionraider(params, options) {
|
|
700
|
+
const searchParams = {};
|
|
701
|
+
searchParams.ocid = String(params.ocid);
|
|
702
|
+
if (params.date !== void 0) {
|
|
703
|
+
searchParams.date = formatDate(params.date);
|
|
704
|
+
}
|
|
705
|
+
return this.get("/maplestory/v1/user/union-raider", searchParams, options);
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* 유니온 아티팩트 정보 조회
|
|
709
|
+
*/
|
|
710
|
+
async getUnionartifact(params, options) {
|
|
711
|
+
const searchParams = {};
|
|
712
|
+
searchParams.ocid = String(params.ocid);
|
|
713
|
+
if (params.date !== void 0) {
|
|
714
|
+
searchParams.date = formatDate(params.date);
|
|
715
|
+
}
|
|
716
|
+
return this.get("/maplestory/v1/user/union-artifact", searchParams, options);
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* 유니온 챔피언 정보 조회
|
|
720
|
+
*/
|
|
721
|
+
async getUnionchampion(params, options) {
|
|
722
|
+
const searchParams = {};
|
|
723
|
+
searchParams.ocid = String(params.ocid);
|
|
724
|
+
if (params.date !== void 0) {
|
|
725
|
+
searchParams.date = formatDate(params.date);
|
|
726
|
+
}
|
|
727
|
+
return this.get("/maplestory/v1/user/union-champion", searchParams, options);
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
// src/client.ts
|
|
732
|
+
var MapleStoryClient = class {
|
|
733
|
+
constructor(options) {
|
|
734
|
+
__publicField(this, "character");
|
|
735
|
+
__publicField(this, "guild");
|
|
736
|
+
__publicField(this, "history");
|
|
737
|
+
__publicField(this, "notice");
|
|
738
|
+
__publicField(this, "ranking");
|
|
739
|
+
__publicField(this, "union");
|
|
740
|
+
if (!options.apiKey) {
|
|
741
|
+
throw new Error("API key is required");
|
|
742
|
+
}
|
|
743
|
+
this.character = new CharacterApi(options.apiKey);
|
|
744
|
+
this.guild = new GuildApi(options.apiKey);
|
|
745
|
+
this.history = new HistoryApi(options.apiKey);
|
|
746
|
+
this.notice = new NoticeApi(options.apiKey);
|
|
747
|
+
this.ranking = new RankingApi(options.apiKey);
|
|
748
|
+
this.union = new UnionApi(options.apiKey);
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
export {
|
|
752
|
+
BaseApi,
|
|
753
|
+
CharacterApi,
|
|
754
|
+
GuildApi,
|
|
755
|
+
HistoryApi,
|
|
756
|
+
MapleApiError,
|
|
757
|
+
MapleNetworkError,
|
|
758
|
+
MapleStoryClient,
|
|
759
|
+
NoticeApi,
|
|
760
|
+
RankingApi,
|
|
761
|
+
UnionApi,
|
|
762
|
+
formatDate,
|
|
763
|
+
getYesterdayDate
|
|
764
|
+
};
|
|
765
|
+
//# sourceMappingURL=index.mjs.map
|