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/dist/index.js ADDED
@@ -0,0 +1,811 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
31
+
32
+ // src/index.ts
33
+ var index_exports = {};
34
+ __export(index_exports, {
35
+ BaseApi: () => BaseApi,
36
+ CharacterApi: () => CharacterApi,
37
+ GuildApi: () => GuildApi,
38
+ HistoryApi: () => HistoryApi,
39
+ MapleApiError: () => MapleApiError,
40
+ MapleNetworkError: () => MapleNetworkError,
41
+ MapleStoryClient: () => MapleStoryClient,
42
+ NoticeApi: () => NoticeApi,
43
+ RankingApi: () => RankingApi,
44
+ UnionApi: () => UnionApi,
45
+ formatDate: () => formatDate,
46
+ getYesterdayDate: () => getYesterdayDate
47
+ });
48
+ module.exports = __toCommonJS(index_exports);
49
+
50
+ // src/types/common.ts
51
+ function formatDate(input) {
52
+ if (typeof input === "string") {
53
+ return input;
54
+ }
55
+ return input.toISOString().split("T")[0];
56
+ }
57
+ function getYesterdayDate() {
58
+ const yesterday = /* @__PURE__ */ new Date();
59
+ yesterday.setDate(yesterday.getDate() - 1);
60
+ return formatDate(yesterday);
61
+ }
62
+
63
+ // src/api/base.ts
64
+ var import_ky = __toESM(require("ky"));
65
+
66
+ // src/errors.ts
67
+ var MapleApiError = class _MapleApiError extends Error {
68
+ constructor(options) {
69
+ super(options.message);
70
+ /** Error code from Nexon API (e.g., "OPENAPI00001") */
71
+ __publicField(this, "code");
72
+ /** HTTP status code (400, 403, 429, 500, etc.) */
73
+ __publicField(this, "httpStatus");
74
+ /** Original error for debugging purposes */
75
+ __publicField(this, "originalError");
76
+ /** Retry-After header value in seconds (for rate limit errors) */
77
+ __publicField(this, "retryAfter");
78
+ this.name = options.name;
79
+ this.code = options.code;
80
+ this.httpStatus = options.httpStatus;
81
+ this.originalError = options.originalError;
82
+ this.retryAfter = options.retryAfter;
83
+ if (Error.captureStackTrace) {
84
+ Error.captureStackTrace(this, _MapleApiError);
85
+ }
86
+ }
87
+ /**
88
+ * Check if this is an authentication error (403)
89
+ */
90
+ isAuthError() {
91
+ return this.httpStatus === 403;
92
+ }
93
+ /**
94
+ * Check if this is a rate limit error (429)
95
+ */
96
+ isRateLimitError() {
97
+ return this.httpStatus === 429;
98
+ }
99
+ /**
100
+ * Check if this is a bad request error (400)
101
+ */
102
+ isBadRequestError() {
103
+ return this.httpStatus === 400;
104
+ }
105
+ /**
106
+ * Check if this is a server error (5xx)
107
+ */
108
+ isServerError() {
109
+ return this.httpStatus >= 500 && this.httpStatus < 600;
110
+ }
111
+ /**
112
+ * Creates a string representation of the error
113
+ */
114
+ toString() {
115
+ return `MapleApiError: [${this.code}] ${this.message} (HTTP ${this.httpStatus})`;
116
+ }
117
+ };
118
+ var MapleNetworkError = class _MapleNetworkError extends Error {
119
+ constructor(options) {
120
+ super(options.message);
121
+ /** Original error for debugging */
122
+ __publicField(this, "originalError");
123
+ /** Whether this is a timeout error */
124
+ __publicField(this, "isTimeout");
125
+ this.name = "MapleNetworkError";
126
+ this.originalError = options.originalError;
127
+ this.isTimeout = options.isTimeout ?? false;
128
+ if (Error.captureStackTrace) {
129
+ Error.captureStackTrace(this, _MapleNetworkError);
130
+ }
131
+ }
132
+ };
133
+
134
+ // src/api/base.ts
135
+ var BaseApi = class {
136
+ constructor(apiKey) {
137
+ __publicField(this, "client");
138
+ this.client = import_ky.default.create({
139
+ prefixUrl: "https://open.api.nexon.com",
140
+ headers: {
141
+ "x-nxopen-api-key": apiKey
142
+ },
143
+ hooks: {
144
+ afterResponse: [
145
+ async (_request, _options, response) => {
146
+ if (!response.ok) {
147
+ await this.handleErrorResponse(response);
148
+ }
149
+ return response;
150
+ }
151
+ ]
152
+ }
153
+ });
154
+ }
155
+ /**
156
+ * Handles error responses and throws appropriate error types
157
+ */
158
+ async handleErrorResponse(response) {
159
+ let errorData = null;
160
+ try {
161
+ errorData = await response.json();
162
+ } catch {
163
+ }
164
+ const retryAfter = response.headers.get("Retry-After");
165
+ throw new MapleApiError({
166
+ name: errorData?.error?.name ?? "UNKNOWN_ERROR",
167
+ message: errorData?.error?.message ?? `HTTP ${response.status} Error`,
168
+ code: errorData?.error?.name ?? "UNKNOWN",
169
+ httpStatus: response.status,
170
+ retryAfter: retryAfter ? Number.parseInt(retryAfter, 10) : void 0
171
+ });
172
+ }
173
+ /**
174
+ * Makes a GET request with proper error handling
175
+ */
176
+ async get(endpoint, searchParams, options) {
177
+ try {
178
+ const filteredParams = {};
179
+ if (searchParams) {
180
+ for (const [key, value] of Object.entries(searchParams)) {
181
+ if (value !== void 0) {
182
+ filteredParams[key] = value;
183
+ }
184
+ }
185
+ }
186
+ const kyOptions = {
187
+ searchParams: Object.keys(filteredParams).length > 0 ? filteredParams : void 0
188
+ };
189
+ if (options?.signal) {
190
+ kyOptions.signal = options.signal;
191
+ }
192
+ const normalizedEndpoint = endpoint.startsWith("/") ? endpoint.slice(1) : endpoint;
193
+ return await this.client.get(normalizedEndpoint, kyOptions).json();
194
+ } catch (error) {
195
+ if (error instanceof MapleApiError) {
196
+ throw error;
197
+ }
198
+ if (error instanceof TypeError && error.message.includes("fetch")) {
199
+ throw new MapleNetworkError({
200
+ message: "Network error: Unable to connect to API",
201
+ originalError: error
202
+ });
203
+ }
204
+ if (error instanceof DOMException && error.name === "AbortError") {
205
+ throw new MapleNetworkError({
206
+ message: "Request was aborted",
207
+ originalError: error,
208
+ isTimeout: true
209
+ });
210
+ }
211
+ throw error;
212
+ }
213
+ }
214
+ };
215
+
216
+ // src/api/character.ts
217
+ var CharacterApi = class extends BaseApi {
218
+ /**
219
+ * ์บ๋ฆญํ„ฐ ๋ชฉ๋ก ์กฐํšŒ
220
+ */
221
+ async getList(options) {
222
+ return this.get("/maplestory/v1/character/list", void 0, options);
223
+ }
224
+ /**
225
+ * ์—…์  ์ •๋ณด ์กฐํšŒ
226
+ */
227
+ async getAchievement(options) {
228
+ return this.get("/maplestory/v1/user/achievement", void 0, options);
229
+ }
230
+ /**
231
+ * ์บ๋ฆญํ„ฐ ์‹๋ณ„์ž(ocid) ์กฐํšŒ
232
+ */
233
+ async getId(params, options) {
234
+ const searchParams = {};
235
+ searchParams.character_name = String(params.characterName);
236
+ return this.get("/maplestory/v1/id", searchParams, options);
237
+ }
238
+ /**
239
+ * ๊ธฐ๋ณธ ์ •๋ณด ์กฐํšŒ
240
+ */
241
+ async getBasic(params, options) {
242
+ const searchParams = {};
243
+ searchParams.ocid = String(params.ocid);
244
+ if (params.date !== void 0) {
245
+ searchParams.date = formatDate(params.date);
246
+ }
247
+ return this.get("/maplestory/v1/character/basic", searchParams, options);
248
+ }
249
+ /**
250
+ * ์ธ๊ธฐ๋„ ์ •๋ณด ์กฐํšŒ
251
+ */
252
+ async getPopularity(params, options) {
253
+ const searchParams = {};
254
+ searchParams.ocid = String(params.ocid);
255
+ if (params.date !== void 0) {
256
+ searchParams.date = formatDate(params.date);
257
+ }
258
+ return this.get("/maplestory/v1/character/popularity", searchParams, options);
259
+ }
260
+ /**
261
+ * ์ข…ํ•ฉ ๋Šฅ๋ ฅ์น˜ ์ •๋ณด ์กฐํšŒ
262
+ */
263
+ async getStat(params, options) {
264
+ const searchParams = {};
265
+ searchParams.ocid = String(params.ocid);
266
+ if (params.date !== void 0) {
267
+ searchParams.date = formatDate(params.date);
268
+ }
269
+ return this.get("/maplestory/v1/character/stat", searchParams, options);
270
+ }
271
+ /**
272
+ * ํ•˜์ดํผ์Šคํƒฏ ์ •๋ณด ์กฐํšŒ
273
+ */
274
+ async getHyperstat(params, options) {
275
+ const searchParams = {};
276
+ searchParams.ocid = String(params.ocid);
277
+ if (params.date !== void 0) {
278
+ searchParams.date = formatDate(params.date);
279
+ }
280
+ return this.get("/maplestory/v1/character/hyper-stat", searchParams, options);
281
+ }
282
+ /**
283
+ * ์„ฑํ–ฅ ์ •๋ณด ์กฐํšŒ
284
+ */
285
+ async getPropensity(params, options) {
286
+ const searchParams = {};
287
+ searchParams.ocid = String(params.ocid);
288
+ if (params.date !== void 0) {
289
+ searchParams.date = formatDate(params.date);
290
+ }
291
+ return this.get("/maplestory/v1/character/propensity", searchParams, options);
292
+ }
293
+ /**
294
+ * ์–ด๋นŒ๋ฆฌํ‹ฐ ์ •๋ณด ์กฐํšŒ
295
+ */
296
+ async getAbility(params, options) {
297
+ const searchParams = {};
298
+ searchParams.ocid = String(params.ocid);
299
+ if (params.date !== void 0) {
300
+ searchParams.date = formatDate(params.date);
301
+ }
302
+ return this.get("/maplestory/v1/character/ability", searchParams, options);
303
+ }
304
+ /**
305
+ * ์žฅ์ฐฉ ์žฅ๋น„ ์ •๋ณด ์กฐํšŒ (์บ์‹œ ์žฅ๋น„ ์ œ์™ธ)
306
+ */
307
+ async getItemequipment(params, options) {
308
+ const searchParams = {};
309
+ searchParams.ocid = String(params.ocid);
310
+ if (params.date !== void 0) {
311
+ searchParams.date = formatDate(params.date);
312
+ }
313
+ return this.get("/maplestory/v1/character/item-equipment", searchParams, options);
314
+ }
315
+ /**
316
+ * ์žฅ์ฐฉ ์บ์‹œ ์žฅ๋น„ ์ •๋ณด ์กฐํšŒ
317
+ */
318
+ async getCashitemequipment(params, options) {
319
+ const searchParams = {};
320
+ searchParams.ocid = String(params.ocid);
321
+ if (params.date !== void 0) {
322
+ searchParams.date = formatDate(params.date);
323
+ }
324
+ return this.get("/maplestory/v1/character/cashitem-equipment", searchParams, options);
325
+ }
326
+ /**
327
+ * ์žฅ์ฐฉ ์‹ฌ๋ณผ ์ •๋ณด ์กฐํšŒ
328
+ */
329
+ async getSymbolequipment(params, options) {
330
+ const searchParams = {};
331
+ searchParams.ocid = String(params.ocid);
332
+ if (params.date !== void 0) {
333
+ searchParams.date = formatDate(params.date);
334
+ }
335
+ return this.get("/maplestory/v1/character/symbol-equipment", searchParams, options);
336
+ }
337
+ /**
338
+ * ์ ์šฉ ์„ธํŠธ ํšจ๊ณผ ์ •๋ณด ์กฐํšŒ
339
+ */
340
+ async getSeteffect(params, options) {
341
+ const searchParams = {};
342
+ searchParams.ocid = String(params.ocid);
343
+ if (params.date !== void 0) {
344
+ searchParams.date = formatDate(params.date);
345
+ }
346
+ return this.get("/maplestory/v1/character/set-effect", searchParams, options);
347
+ }
348
+ /**
349
+ * ์žฅ์ฐฉ ํ—ค์–ด, ์„ฑํ˜•, ํ”ผ๋ถ€ ์ •๋ณด ์กฐํšŒ
350
+ */
351
+ async getBeautyequipment(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/beauty-equipment", searchParams, options);
358
+ }
359
+ /**
360
+ * ์žฅ์ฐฉ ์•ˆ๋“œ๋กœ์ด๋“œ ์ •๋ณด ์กฐํšŒ
361
+ */
362
+ async getAndroidequipment(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/android-equipment", searchParams, options);
369
+ }
370
+ /**
371
+ * ์žฅ์ฐฉ ํŽซ ์ •๋ณด ์กฐํšŒ
372
+ */
373
+ async getPetequipment(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/pet-equipment", searchParams, options);
380
+ }
381
+ /**
382
+ * ์Šคํ‚ฌ ์ •๋ณด ์กฐํšŒ
383
+ */
384
+ async getSkill(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
+ searchParams.character_skill_grade = String(params.characterSkillGrade);
391
+ return this.get("/maplestory/v1/character/skill", searchParams, options);
392
+ }
393
+ /**
394
+ * ์žฅ์ฐฉ ๋งํฌ ์Šคํ‚ฌ ์ •๋ณด ์กฐํšŒ
395
+ */
396
+ async getLinkskill(params, options) {
397
+ const searchParams = {};
398
+ searchParams.ocid = String(params.ocid);
399
+ if (params.date !== void 0) {
400
+ searchParams.date = formatDate(params.date);
401
+ }
402
+ return this.get("/maplestory/v1/character/link-skill", searchParams, options);
403
+ }
404
+ /**
405
+ * V๋งคํŠธ๋ฆญ์Šค ์ •๋ณด ์กฐํšŒ
406
+ */
407
+ async getVmatrix(params, options) {
408
+ const searchParams = {};
409
+ searchParams.ocid = String(params.ocid);
410
+ if (params.date !== void 0) {
411
+ searchParams.date = formatDate(params.date);
412
+ }
413
+ return this.get("/maplestory/v1/character/vmatrix", searchParams, options);
414
+ }
415
+ /**
416
+ * HEXA ์ฝ”์–ด ์ •๋ณด ์กฐํšŒ
417
+ */
418
+ async getHexamatrix(params, options) {
419
+ const searchParams = {};
420
+ searchParams.ocid = String(params.ocid);
421
+ if (params.date !== void 0) {
422
+ searchParams.date = formatDate(params.date);
423
+ }
424
+ return this.get("/maplestory/v1/character/hexamatrix", searchParams, options);
425
+ }
426
+ /**
427
+ * HEXA ๋งคํŠธ๋ฆญ์Šค ์„ค์ • HEXA ์Šคํƒฏ ์ •๋ณด ์กฐํšŒ
428
+ */
429
+ async getHexamatrixstat(params, options) {
430
+ const searchParams = {};
431
+ searchParams.ocid = String(params.ocid);
432
+ if (params.date !== void 0) {
433
+ searchParams.date = formatDate(params.date);
434
+ }
435
+ return this.get("/maplestory/v1/character/hexamatrix-stat", searchParams, options);
436
+ }
437
+ /**
438
+ * ๋ฌด๋ฆ‰๋„์žฅ ์ตœ๊ณ  ๊ธฐ๋ก ์ •๋ณด ์กฐํšŒ
439
+ */
440
+ async getDojang(params, options) {
441
+ const searchParams = {};
442
+ searchParams.ocid = String(params.ocid);
443
+ if (params.date !== void 0) {
444
+ searchParams.date = formatDate(params.date);
445
+ }
446
+ return this.get("/maplestory/v1/character/dojang", searchParams, options);
447
+ }
448
+ /**
449
+ * ๊ธฐํƒ€ ๋Šฅ๋ ฅ์น˜ ์˜ํ–ฅ ์š”์†Œ ์ •๋ณด ์กฐํšŒ
450
+ */
451
+ async getOtherstat(params, options) {
452
+ const searchParams = {};
453
+ searchParams.ocid = String(params.ocid);
454
+ if (params.date !== void 0) {
455
+ searchParams.date = formatDate(params.date);
456
+ }
457
+ return this.get("/maplestory/v1/character/other-stat", searchParams, options);
458
+ }
459
+ /**
460
+ * ๋ง ์ต์Šค์ฒด์ธ์ง€ ์Šคํ‚ฌ ๋“ฑ๋ก ์žฅ๋น„ ์กฐํšŒ
461
+ */
462
+ async getRingexchangeskillequipment(params, options) {
463
+ const searchParams = {};
464
+ searchParams.ocid = String(params.ocid);
465
+ if (params.date !== void 0) {
466
+ searchParams.date = formatDate(params.date);
467
+ }
468
+ return this.get("/maplestory/v1/character/ring-exchange-skill-equipment", searchParams, options);
469
+ }
470
+ };
471
+
472
+ // src/api/guild.ts
473
+ var GuildApi = class extends BaseApi {
474
+ /**
475
+ * ๊ธธ๋“œ ์‹๋ณ„์ž(oguild_id) ์ •๋ณด ์กฐํšŒ
476
+ */
477
+ async getId(params, options) {
478
+ const searchParams = {};
479
+ searchParams.guild_name = String(params.guildName);
480
+ searchParams.world_name = String(params.worldName);
481
+ return this.get("/maplestory/v1/guild/id", searchParams, options);
482
+ }
483
+ /**
484
+ * ๊ธฐ๋ณธ ์ •๋ณด ์กฐํšŒ
485
+ */
486
+ async getBasic(params, options) {
487
+ const searchParams = {};
488
+ searchParams.oguild_id = String(params.oguildId);
489
+ if (params.date !== void 0) {
490
+ searchParams.date = formatDate(params.date);
491
+ }
492
+ return this.get("/maplestory/v1/guild/basic", searchParams, options);
493
+ }
494
+ };
495
+
496
+ // src/api/history.ts
497
+ var HistoryApi = class extends BaseApi {
498
+ /**
499
+ * ๊ณ„์ • ์‹๋ณ„์ž(ouid) ์กฐํšŒ (๊ตฌ API KEY ์‚ฌ์šฉ)
500
+ */
501
+ async getLegacyouid(options) {
502
+ return this.get("/maplestory/legacy/ouid", void 0, options);
503
+ }
504
+ /**
505
+ * ๊ณ„์ • ์‹๋ณ„์ž(ouid) ์กฐํšŒ
506
+ */
507
+ async getOuid(options) {
508
+ return this.get("/maplestory/v1/ouid", void 0, options);
509
+ }
510
+ /**
511
+ * ์Šคํƒ€ํฌ์Šค ๊ฐ•ํ™” ๊ฒฐ๊ณผ ์กฐํšŒ
512
+ */
513
+ async getStarforce(params, options) {
514
+ const searchParams = {};
515
+ searchParams.count = String(params.count);
516
+ if (params.date !== void 0) {
517
+ searchParams.date = formatDate(params.date);
518
+ }
519
+ if (params.cursor !== void 0) {
520
+ searchParams.cursor = String(params.cursor);
521
+ }
522
+ return this.get("/maplestory/v1/history/starforce", searchParams, options);
523
+ }
524
+ /**
525
+ * ์ž ์žฌ๋Šฅ๋ ฅ ์žฌ์„ค์ • ์ด์šฉ ๊ฒฐ๊ณผ ์กฐํšŒ
526
+ */
527
+ async getPotential(params, options) {
528
+ const searchParams = {};
529
+ searchParams.count = String(params.count);
530
+ if (params.date !== void 0) {
531
+ searchParams.date = formatDate(params.date);
532
+ }
533
+ if (params.cursor !== void 0) {
534
+ searchParams.cursor = String(params.cursor);
535
+ }
536
+ return this.get("/maplestory/v1/history/potential", searchParams, options);
537
+ }
538
+ /**
539
+ * ํ๋ธŒ ์‚ฌ์šฉ ๊ฒฐ๊ณผ ์กฐํšŒ
540
+ */
541
+ async getCube(params, options) {
542
+ const searchParams = {};
543
+ searchParams.count = String(params.count);
544
+ if (params.date !== void 0) {
545
+ searchParams.date = formatDate(params.date);
546
+ }
547
+ if (params.cursor !== void 0) {
548
+ searchParams.cursor = String(params.cursor);
549
+ }
550
+ return this.get("/maplestory/v1/history/cube", searchParams, options);
551
+ }
552
+ };
553
+
554
+ // src/api/notice.ts
555
+ var NoticeApi = class extends BaseApi {
556
+ /**
557
+ * ๊ณต์ง€์‚ฌํ•ญ ๋ชฉ๋ก ์กฐํšŒ
558
+ */
559
+ async getNotice(options) {
560
+ return this.get("/maplestory/v1/notice", void 0, options);
561
+ }
562
+ /**
563
+ * ๊ณต์ง€์‚ฌํ•ญ ์ƒ์„ธ ์กฐํšŒ
564
+ */
565
+ async getDetail(params, options) {
566
+ const searchParams = {};
567
+ searchParams.notice_id = String(params.noticeId);
568
+ return this.get("/maplestory/v1/notice/detail", searchParams, options);
569
+ }
570
+ /**
571
+ * ์—…๋ฐ์ดํŠธ ๋ชฉ๋ก ์กฐํšŒ
572
+ */
573
+ async getNoticeupdate(options) {
574
+ return this.get("/maplestory/v1/notice-update", void 0, options);
575
+ }
576
+ /**
577
+ * ์—…๋ฐ์ดํŠธ ์ƒ์„ธ ์กฐํšŒ
578
+ */
579
+ async getUpdatedetail(params, options) {
580
+ const searchParams = {};
581
+ searchParams.notice_id = String(params.noticeId);
582
+ return this.get("/maplestory/v1/notice-update/detail", searchParams, options);
583
+ }
584
+ /**
585
+ * ์ง„ํ–‰ ์ค‘ ์ด๋ฒคํŠธ ๋ชฉ๋ก ์กฐํšŒ
586
+ */
587
+ async getNoticeevent(options) {
588
+ return this.get("/maplestory/v1/notice-event", void 0, options);
589
+ }
590
+ /**
591
+ * ์ง„ํ–‰ ์ค‘ ์ด๋ฒคํŠธ ์ƒ์„ธ ์กฐํšŒ
592
+ */
593
+ async getEventdetail(params, options) {
594
+ const searchParams = {};
595
+ searchParams.notice_id = String(params.noticeId);
596
+ return this.get("/maplestory/v1/notice-event/detail", searchParams, options);
597
+ }
598
+ /**
599
+ * ์บ์‹œ์ƒต ๊ณต์ง€ ๋ชฉ๋ก ์กฐํšŒ
600
+ */
601
+ async getNoticecashshop(options) {
602
+ return this.get("/maplestory/v1/notice-cashshop", void 0, options);
603
+ }
604
+ /**
605
+ * ์บ์‹œ์ƒต ๊ณต์ง€ ์ƒ์„ธ ์กฐํšŒ
606
+ */
607
+ async getCashshopdetail(params, options) {
608
+ const searchParams = {};
609
+ searchParams.notice_id = String(params.noticeId);
610
+ return this.get("/maplestory/v1/notice-cashshop/detail", searchParams, options);
611
+ }
612
+ };
613
+
614
+ // src/api/ranking.ts
615
+ var RankingApi = class extends BaseApi {
616
+ /**
617
+ * ์ข…ํ•ฉ ๋žญํ‚น ์ •๋ณด ์กฐํšŒ
618
+ */
619
+ async getOverall(params, options) {
620
+ const searchParams = {};
621
+ searchParams.date = formatDate(params.date);
622
+ if (params.worldName !== void 0) {
623
+ searchParams.world_name = String(params.worldName);
624
+ }
625
+ if (params.worldType !== void 0) {
626
+ searchParams.world_type = String(params.worldType);
627
+ }
628
+ if (params.class !== void 0) {
629
+ searchParams.class = String(params.class);
630
+ }
631
+ if (params.ocid !== void 0) {
632
+ searchParams.ocid = String(params.ocid);
633
+ }
634
+ if (params.page !== void 0) {
635
+ searchParams.page = String(params.page);
636
+ }
637
+ return this.get("/maplestory/v1/ranking/overall", searchParams, options);
638
+ }
639
+ /**
640
+ * ์œ ๋‹ˆ์˜จ ๋žญํ‚น ์ •๋ณด ์กฐํšŒ
641
+ */
642
+ async getUnion(params, options) {
643
+ const searchParams = {};
644
+ searchParams.date = formatDate(params.date);
645
+ if (params.worldName !== void 0) {
646
+ searchParams.world_name = String(params.worldName);
647
+ }
648
+ if (params.ocid !== void 0) {
649
+ searchParams.ocid = String(params.ocid);
650
+ }
651
+ if (params.page !== void 0) {
652
+ searchParams.page = String(params.page);
653
+ }
654
+ return this.get("/maplestory/v1/ranking/union", searchParams, options);
655
+ }
656
+ /**
657
+ * ๊ธธ๋“œ ๋žญํ‚น ์ •๋ณด ์กฐํšŒ
658
+ */
659
+ async getGuild(params, options) {
660
+ const searchParams = {};
661
+ searchParams.date = formatDate(params.date);
662
+ if (params.worldName !== void 0) {
663
+ searchParams.world_name = String(params.worldName);
664
+ }
665
+ searchParams.ranking_type = String(params.rankingType);
666
+ if (params.guildName !== void 0) {
667
+ searchParams.guild_name = String(params.guildName);
668
+ }
669
+ if (params.page !== void 0) {
670
+ searchParams.page = String(params.page);
671
+ }
672
+ return this.get("/maplestory/v1/ranking/guild", searchParams, options);
673
+ }
674
+ /**
675
+ * ๋ฌด๋ฆ‰๋„์žฅ ๋žญํ‚น ์ •๋ณด ์กฐํšŒ
676
+ */
677
+ async getDojang(params, options) {
678
+ const searchParams = {};
679
+ searchParams.date = formatDate(params.date);
680
+ if (params.worldName !== void 0) {
681
+ searchParams.world_name = String(params.worldName);
682
+ }
683
+ searchParams.difficulty = String(params.difficulty);
684
+ if (params.class !== void 0) {
685
+ searchParams.class = String(params.class);
686
+ }
687
+ if (params.ocid !== void 0) {
688
+ searchParams.ocid = String(params.ocid);
689
+ }
690
+ if (params.page !== void 0) {
691
+ searchParams.page = String(params.page);
692
+ }
693
+ return this.get("/maplestory/v1/ranking/dojang", searchParams, options);
694
+ }
695
+ /**
696
+ * ๋” ์‹œ๋“œ ๋žญํ‚น ์ •๋ณด ์กฐํšŒ
697
+ */
698
+ async getTheseed(params, options) {
699
+ const searchParams = {};
700
+ searchParams.date = formatDate(params.date);
701
+ if (params.worldName !== void 0) {
702
+ searchParams.world_name = String(params.worldName);
703
+ }
704
+ if (params.ocid !== void 0) {
705
+ searchParams.ocid = String(params.ocid);
706
+ }
707
+ if (params.page !== void 0) {
708
+ searchParams.page = String(params.page);
709
+ }
710
+ return this.get("/maplestory/v1/ranking/theseed", searchParams, options);
711
+ }
712
+ /**
713
+ * ์—…์  ๋žญํ‚น ์ •๋ณด ์กฐํšŒ
714
+ */
715
+ async getAchievement(params, options) {
716
+ const searchParams = {};
717
+ searchParams.date = formatDate(params.date);
718
+ if (params.ocid !== void 0) {
719
+ searchParams.ocid = String(params.ocid);
720
+ }
721
+ if (params.page !== void 0) {
722
+ searchParams.page = String(params.page);
723
+ }
724
+ return this.get("/maplestory/v1/ranking/achievement", searchParams, options);
725
+ }
726
+ };
727
+
728
+ // src/api/union.ts
729
+ var UnionApi = class extends BaseApi {
730
+ /**
731
+ * ์œ ๋‹ˆ์˜จ ์ •๋ณด ์กฐํšŒ
732
+ */
733
+ async getUnion(params, options) {
734
+ const searchParams = {};
735
+ searchParams.ocid = String(params.ocid);
736
+ if (params.date !== void 0) {
737
+ searchParams.date = formatDate(params.date);
738
+ }
739
+ return this.get("/maplestory/v1/user/union", searchParams, options);
740
+ }
741
+ /**
742
+ * ์œ ๋‹ˆ์˜จ ๊ณต๊ฒฉ๋Œ€ ์ •๋ณด ์กฐํšŒ
743
+ */
744
+ async getUnionraider(params, options) {
745
+ const searchParams = {};
746
+ searchParams.ocid = String(params.ocid);
747
+ if (params.date !== void 0) {
748
+ searchParams.date = formatDate(params.date);
749
+ }
750
+ return this.get("/maplestory/v1/user/union-raider", searchParams, options);
751
+ }
752
+ /**
753
+ * ์œ ๋‹ˆ์˜จ ์•„ํ‹ฐํŒฉํŠธ ์ •๋ณด ์กฐํšŒ
754
+ */
755
+ async getUnionartifact(params, options) {
756
+ const searchParams = {};
757
+ searchParams.ocid = String(params.ocid);
758
+ if (params.date !== void 0) {
759
+ searchParams.date = formatDate(params.date);
760
+ }
761
+ return this.get("/maplestory/v1/user/union-artifact", searchParams, options);
762
+ }
763
+ /**
764
+ * ์œ ๋‹ˆ์˜จ ์ฑ”ํ”ผ์–ธ ์ •๋ณด ์กฐํšŒ
765
+ */
766
+ async getUnionchampion(params, options) {
767
+ const searchParams = {};
768
+ searchParams.ocid = String(params.ocid);
769
+ if (params.date !== void 0) {
770
+ searchParams.date = formatDate(params.date);
771
+ }
772
+ return this.get("/maplestory/v1/user/union-champion", searchParams, options);
773
+ }
774
+ };
775
+
776
+ // src/client.ts
777
+ var MapleStoryClient = class {
778
+ constructor(options) {
779
+ __publicField(this, "character");
780
+ __publicField(this, "guild");
781
+ __publicField(this, "history");
782
+ __publicField(this, "notice");
783
+ __publicField(this, "ranking");
784
+ __publicField(this, "union");
785
+ if (!options.apiKey) {
786
+ throw new Error("API key is required");
787
+ }
788
+ this.character = new CharacterApi(options.apiKey);
789
+ this.guild = new GuildApi(options.apiKey);
790
+ this.history = new HistoryApi(options.apiKey);
791
+ this.notice = new NoticeApi(options.apiKey);
792
+ this.ranking = new RankingApi(options.apiKey);
793
+ this.union = new UnionApi(options.apiKey);
794
+ }
795
+ };
796
+ // Annotate the CommonJS export names for ESM import in node:
797
+ 0 && (module.exports = {
798
+ BaseApi,
799
+ CharacterApi,
800
+ GuildApi,
801
+ HistoryApi,
802
+ MapleApiError,
803
+ MapleNetworkError,
804
+ MapleStoryClient,
805
+ NoticeApi,
806
+ RankingApi,
807
+ UnionApi,
808
+ formatDate,
809
+ getYesterdayDate
810
+ });
811
+ //# sourceMappingURL=index.js.map