maplestory-openapi 1.0.1 → 2.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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/maplestory-openapi)](https://www.npmjs.com/package/maplestory-openapi)
4
4
 
5
- This JavaScript library enables the use of the MapleStory OpenAPI provided by Nexon.
5
+ This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.
6
6
 
7
7
  Packages written in other languages can be found [HERE](https://github.com/SpiralMoon/maplestory.openapi).
8
8
 
@@ -13,11 +13,15 @@ Packages written in other languages can be found [HERE](https://github.com/Spira
13
13
  Install the latest version of the JavaScript/TypeScript library in your npm project:
14
14
 
15
15
  ```bash
16
- npm install maplestory-openapi@1.0.1 # Replace with the latest version
16
+ npm install maplestory-openapi@2.0.0 # Replace with the latest version
17
17
  ```
18
18
 
19
19
  ## Usage
20
20
 
21
+ ### API Key
22
+
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
+
21
25
  ### Supports
22
26
 
23
27
  1. **CommonJS, ESM Support**: The library supports both CommonJS and ESM usage.
@@ -45,7 +49,7 @@ api.getCubeResult(1000, {
45
49
  day: 15
46
50
  })
47
51
  .then((dto) => {
48
- const {count, cubeHistories, nextCursor} = dto;
52
+ const {count, cubeHistory, nextCursor} = dto;
49
53
 
50
54
  console.log('You used ' + count + ' cubes.');
51
55
  })
@@ -62,17 +66,18 @@ api.getCubeResult(1000, {
62
66
 
63
67
  ### Exception Handling
64
68
 
65
- Handle `MapleStoryApiError` to safely make calls, ensuring that specific Status defined in the [MapleStory OpenAPI Guide](https://developers.nexon.com/Maplestory/guides) are not encountered.
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.
66
70
 
67
71
  While `MapleStoryApi` is designed to prevent the occurrence of certain Status, exceptions may arise due to developer mistakes.
68
72
 
69
- Therefore, it's recommended to use `MapleStoryApiError` for exception handling based on the Status list described in the table below.
70
-
71
- | Status | Message |
72
- |--------|---------------------------------------------------------|
73
- | 400 | Request format error (incorrect parameter input) |
74
- | 401 | Unauthorized service (unsupported service, service type) |
75
- | 403 | Unauthorized AccessToken usage |
76
- | 429 | AccessToken's request allowance (Rate Limit) exceeded |
77
- | 500 | Internal server error |
78
- | 504 | Internal server processing timeout |
73
+ Therefore, it's recommended to use `MapleStoryApiError` for exception handling based on the `MapleStoryApiErrorCode` list described in the table below.
74
+
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 |
package/dist/index.js CHANGED
@@ -2,11 +2,13 @@
2
2
 
3
3
  var axios = require('axios');
4
4
  var dayjs = require('dayjs');
5
+ var xml2js = require('xml2js');
5
6
 
6
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
8
 
8
9
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
9
10
  var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
11
+ var xml2js__default = /*#__PURE__*/_interopDefaultLegacy(xml2js);
10
12
 
11
13
  exports.PotentialOptionGrade = void 0;
12
14
  (function (PotentialOptionGrade) {
@@ -39,7 +41,7 @@ const potentialOptionGradeFromString = (text) => {
39
41
  */
40
42
  class CubeResultOptionDto {
41
43
  /**
42
- * 옵션 이름
44
+ * 옵션
43
45
  */
44
46
  value;
45
47
  /**
@@ -57,31 +59,31 @@ class CubeResultOptionDto {
57
59
  }
58
60
 
59
61
  /**
60
- * 큐브히스토리 정보
62
+ * 큐브 히스토리
61
63
  */
62
64
  class CubeHistoryDto {
63
65
  /**
64
- * 큐브 사용 내역에 대한 고유 식별자
66
+ * 큐브 히스토리 식별자
65
67
  */
66
68
  id;
67
69
  /**
68
- * 캐릭터이름
70
+ * 캐릭터 명
69
71
  */
70
72
  characterName;
71
73
  /**
72
- * 월드 이름
74
+ * 월드
73
75
  */
74
76
  worldName;
75
77
  /**
76
- * 큐브 사용 날짜
78
+ * 사용 일시
77
79
  */
78
- createDate;
80
+ dateCreate;
79
81
  /**
80
- * 사용한 큐브
82
+ * 사용 큐브
81
83
  */
82
84
  cubeType;
83
85
  /**
84
- * 큐브 사용 결과
86
+ * 사용 결과
85
87
  */
86
88
  itemUpgradeResult;
87
89
  /**
@@ -91,13 +93,13 @@ class CubeHistoryDto {
91
93
  /**
92
94
  * 장비 분류
93
95
  */
94
- itemEquipPart;
96
+ itemEquipmentPart;
95
97
  /**
96
98
  * 장비 레벨
97
99
  */
98
100
  itemLevel;
99
101
  /**
100
- * 큐브를 사용한 장비
102
+ * 큐브 사용한 장비
101
103
  */
102
104
  targetItem;
103
105
  /**
@@ -117,41 +119,41 @@ class CubeHistoryDto {
117
119
  */
118
120
  upgradeGuaranteeCount;
119
121
  /**
120
- * 큐브 사용 전 잠재능력 옵션
122
+ * 사용 전 잠재능력 옵션
121
123
  */
122
- beforePotentialOptions;
124
+ beforePotentialOption;
123
125
  /**
124
- * 큐브 사용 전 에디셔널 잠재능력 옵션
126
+ * 사용 전 에디셔널 잠재능력 옵션
125
127
  */
126
- beforeAdditionalPotentialOptions;
128
+ beforeAdditionalPotentialOption;
127
129
  /**
128
- * 큐브 사용 후 잠재능력 옵션
130
+ * 사용 후 잠재능력 옵션
129
131
  */
130
- afterPotentialOptions;
132
+ afterPotentialOption;
131
133
  /**
132
- * 큐브 사용 후 에디셔널 잠재능력 옵션
134
+ * 사용 후 에디셔널 잠재능력 옵션
133
135
  */
134
- afterAdditionalPotentialOptions;
136
+ afterAdditionalPotentialOption;
135
137
  constructor(obj) {
136
- const { id, character_name, world_name, create_date, cube_type, item_upgrade_result, miracle_time_flag, item_equip_part, item_level, target_item, potential_option_grade, additional_potential_option_grade, upgradeguarantee, upgradeguaranteecount, before_potential_options, before_additional_potential_options, after_potential_options, after_additional_potential_options } = obj;
138
+ const { id, character_name, world_name, date_create, cube_type, item_upgrade_result, miracle_time_flag, item_equipment_part, item_level, target_item, potential_option_grade, additional_potential_option_grade, upgrade_guarantee, upgrade_guarantee_count, before_potential_option, before_additional_potential_option, after_potential_option, after_additional_potential_option } = obj;
137
139
  this.id = id;
138
140
  this.characterName = character_name;
139
141
  this.worldName = world_name;
140
- this.createDate = create_date;
142
+ this.dateCreate = new Date(date_create);
141
143
  this.cubeType = cube_type;
142
144
  this.itemUpgradeResult = item_upgrade_result;
143
145
  this.miracleTimeFlag = miracle_time_flag;
144
- this.itemEquipPart = item_equip_part;
146
+ this.itemEquipmentPart = item_equipment_part;
145
147
  this.itemLevel = item_level;
146
148
  this.targetItem = target_item;
147
149
  this.potentialOptionGrade = potential_option_grade;
148
150
  this.additionalPotentialOptionGrade = additional_potential_option_grade;
149
- this.upgradeGuarantee = upgradeguarantee;
150
- this.upgradeGuaranteeCount = upgradeguaranteecount;
151
- this.beforePotentialOptions = before_potential_options.map(origin => new CubeResultOptionDto(origin));
152
- this.beforeAdditionalPotentialOptions = before_additional_potential_options.map(origin => new CubeResultOptionDto(origin));
153
- this.afterPotentialOptions = after_potential_options.map(origin => new CubeResultOptionDto(origin));
154
- this.afterAdditionalPotentialOptions = after_additional_potential_options.map(origin => new CubeResultOptionDto(origin));
151
+ this.upgradeGuarantee = upgrade_guarantee;
152
+ this.upgradeGuaranteeCount = upgrade_guarantee_count;
153
+ this.beforePotentialOption = before_potential_option.map(origin => new CubeResultOptionDto(origin));
154
+ this.beforeAdditionalPotentialOption = before_additional_potential_option.map(origin => new CubeResultOptionDto(origin));
155
+ this.afterPotentialOption = after_potential_option.map(origin => new CubeResultOptionDto(origin));
156
+ this.afterAdditionalPotentialOption = after_additional_potential_option.map(origin => new CubeResultOptionDto(origin));
155
157
  }
156
158
  get isItemUpgrade() {
157
159
  return this.itemUpgradeResult === '성공';
@@ -168,7 +170,7 @@ class CubeHistoryDto {
168
170
  }
169
171
 
170
172
  /**
171
- * 큐브히스토리 응답 정보
173
+ * 큐브 히스토리 응답 정보
172
174
  */
173
175
  class CubeHistoryResponseDto {
174
176
  /**
@@ -178,34 +180,86 @@ class CubeHistoryResponseDto {
178
180
  /**
179
181
  * 큐브 히스토리
180
182
  */
181
- cubeHistories;
183
+ cubeHistory;
182
184
  /**
183
185
  * 페이징 처리를 위한 cursor
184
186
  */
185
187
  nextCursor;
186
188
  constructor(obj) {
187
- const { count, cube_histories, next_cursor } = obj;
189
+ const { count, cube_history, next_cursor } = obj;
188
190
  this.count = count;
189
- this.cubeHistories = cube_histories.map(origin => new CubeHistoryDto(origin));
191
+ this.cubeHistory = cube_history.map(origin => new CubeHistoryDto(origin));
190
192
  this.nextCursor = next_cursor;
191
193
  }
192
194
  }
193
195
 
196
+ /**
197
+ * 서버 점검 정보
198
+ */
199
+ class InspectionInfoDto {
200
+ /**
201
+ * 서비스 코드
202
+ */
203
+ serviceCode;
204
+ /**
205
+ * 점검 시작 시각
206
+ */
207
+ startDateTime;
208
+ /**
209
+ * 점검 종료 시각
210
+ */
211
+ endDateTime;
212
+ /**
213
+ * 점검 안내 제목
214
+ */
215
+ strObstacleContents;
216
+ constructor(obj) {
217
+ const inspectionInfoTag = obj["soap:Envelope"]['soap:Body'][0]['GetInspectionInfoResponse'][0]['GetInspectionInfoResult'][0]['diffgr:diffgram'][0]['NewDataSet'][0]['InspectionInfo'][0];
218
+ this.serviceCode = Number(inspectionInfoTag.serviceCode[0]);
219
+ this.startDateTime = new Date(inspectionInfoTag.startDateTime[0]);
220
+ this.endDateTime = new Date(inspectionInfoTag.endDateTime[0]);
221
+ this.strObstacleContents = inspectionInfoTag.strObstacleContents[0];
222
+ }
223
+ }
224
+
194
225
  /**
195
226
  * MapleStory OpenAPI error.<br>
196
- * Please refer to <a href="https://developers.nexon.com/Maplestory/guides">MapleStory API guide</a> for the error details.
227
+ * Please refer to <a href="https://openapi.nexon.com/guide/request-api/">MapleStory API guide</a> for the error details.
197
228
  */
198
229
  class MapleStoryApiError extends Error {
199
230
  name = 'MapleStoryApiError';
200
- status;
231
+ errorCode;
201
232
  message;
202
- constructor(params) {
203
- const { status, message } = params;
233
+ constructor(errorBody) {
234
+ const { name, message } = errorBody.error;
204
235
  super(message);
205
- this.status = status;
236
+ this.errorCode = errorMap[name];
206
237
  this.message = message;
207
238
  }
208
239
  }
240
+ /**
241
+ * MapleStory OpenAPI error codes.<br>
242
+ * Please refer to <a href="https://openapi.nexon.com/guide/request-api/">MapleStory API guide</a> for the error code details.
243
+ */
244
+ exports.MapleStoryApiErrorCode = void 0;
245
+ (function (MapleStoryApiErrorCode) {
246
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00001"] = 0] = "OPENAPI00001";
247
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00002"] = 1] = "OPENAPI00002";
248
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00003"] = 2] = "OPENAPI00003";
249
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00004"] = 3] = "OPENAPI00004";
250
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00005"] = 4] = "OPENAPI00005";
251
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00006"] = 5] = "OPENAPI00006";
252
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00007"] = 6] = "OPENAPI00007";
253
+ })(exports.MapleStoryApiErrorCode || (exports.MapleStoryApiErrorCode = {}));
254
+ const errorMap = {
255
+ ['OPENAPI00001']: exports.MapleStoryApiErrorCode.OPENAPI00001,
256
+ ['OPENAPI00002']: exports.MapleStoryApiErrorCode.OPENAPI00002,
257
+ ['OPENAPI00003']: exports.MapleStoryApiErrorCode.OPENAPI00003,
258
+ ['OPENAPI00004']: exports.MapleStoryApiErrorCode.OPENAPI00004,
259
+ ['OPENAPI00005']: exports.MapleStoryApiErrorCode.OPENAPI00005,
260
+ ['OPENAPI00006']: exports.MapleStoryApiErrorCode.OPENAPI00006,
261
+ ['OPENAPI00007']: exports.MapleStoryApiErrorCode.OPENAPI00007,
262
+ };
209
263
 
210
264
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
211
265
 
@@ -227,9 +281,13 @@ var utc = utc$1.exports;
227
281
 
228
282
  dayjs__default["default"].extend(timezone);
229
283
  dayjs__default["default"].extend(utc);
284
+ /**
285
+ * MapleStory OpenAPI client.<br>
286
+ * This is an implementation of <a href="https://openapi.nexon.com/game/maplestory">MapleStory API</a>
287
+ */
230
288
  class MapleStoryApi {
231
289
  apiKey;
232
- static baseUrl = 'https://public.api.nexon.com/';
290
+ static BASE_URL = 'https://open.api.nexon.com/';
233
291
  static kstOffset = 540;
234
292
  timeout;
235
293
  constructor(apiKey) {
@@ -249,16 +307,16 @@ class MapleStoryApi {
249
307
  throw new Error('You can only retrieve data after 2022-11-25.');
250
308
  }
251
309
  const date = dayjs__default["default"](`${year}-${month}-${day}`).utcOffset(MapleStoryApi.kstOffset);
252
- query.date = date.format('YYYY-MM-DD');
310
+ query.date_kst = date.format('YYYYMMDD');
253
311
  }
254
312
  else {
255
313
  const now = dayjs__default["default"]().utcOffset(MapleStoryApi.kstOffset);
256
- query.date = now.format('YYYY-MM-DD');
314
+ query.date_kst = now.format('YYYYMMDD');
257
315
  }
258
316
  try {
259
- const path = 'openapi/maplestory/v1/cube-use-results';
317
+ const path = 'maplestory/v1/history/cube';
260
318
  const response = await axios__default["default"].get(path, {
261
- baseURL: MapleStoryApi.baseUrl,
319
+ baseURL: MapleStoryApi.BASE_URL,
262
320
  timeout: this.timeout,
263
321
  headers: this.buildHeaders(),
264
322
  params: query
@@ -273,9 +331,45 @@ class MapleStoryApi {
273
331
  throw e;
274
332
  }
275
333
  }
334
+ /**
335
+ * 서버 점검 정보를 조회합니다.
336
+ */
337
+ async getInspectionInfo() {
338
+ const xmlBuilder = new xml2js__default["default"].Builder();
339
+ const soapEnvelop = {
340
+ 'soap:Envelope': {
341
+ $: {
342
+ 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
343
+ 'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
344
+ 'xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/'
345
+ },
346
+ 'soap:Body': {
347
+ 'GetInspectionInfo': {
348
+ $: {
349
+ 'xmlns': 'https://api.maplestory.nexon.com/soap/'
350
+ }
351
+ }
352
+ }
353
+ }
354
+ };
355
+ const baseUrl = 'https://api.maplestory.nexon.com/';
356
+ const path = 'soap/maplestory.asmx';
357
+ const headers = {
358
+ 'SOAPAction': 'https://api.maplestory.nexon.com/soap/GetInspectionInfo',
359
+ 'Content-Type': 'text/xml; charset=utf-8'
360
+ };
361
+ const body = xmlBuilder.buildObject(soapEnvelop);
362
+ const response = await axios__default["default"].post(path, body, {
363
+ baseURL: baseUrl,
364
+ timeout: this.timeout,
365
+ headers,
366
+ });
367
+ const xml = await xml2js__default["default"].parseStringPromise(response.data);
368
+ return new InspectionInfoDto(xml);
369
+ }
276
370
  buildHeaders() {
277
371
  return {
278
- 'authorization': this.apiKey
372
+ 'x-nxopen-api-key': this.apiKey
279
373
  };
280
374
  }
281
375
  }
@@ -283,6 +377,7 @@ class MapleStoryApi {
283
377
  exports.CubeHistoryDto = CubeHistoryDto;
284
378
  exports.CubeHistoryResponseDto = CubeHistoryResponseDto;
285
379
  exports.CubeResultOptionDto = CubeResultOptionDto;
380
+ exports.InspectionInfoDto = InspectionInfoDto;
286
381
  exports.MapleStoryApi = MapleStoryApi;
287
382
  exports.MapleStoryApiError = MapleStoryApiError;
288
383
  exports.potentialOptionGradeFromString = potentialOptionGradeFromString;
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios"),require("dayjs")):"function"==typeof define&&define.amd?define(["exports","axios","dayjs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["maplestory-openapi"]={},t.axios,t.dayjs)}(this,(function(t,e,i){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o,n=a(e),r=a(i);t.PotentialOptionGrade=void 0,(o=t.PotentialOptionGrade||(t.PotentialOptionGrade={}))[o.RARE=0]="RARE",o[o.EPIC=1]="EPIC",o[o.UNIQUE=2]="UNIQUE",o[o.LEGENDARY=3]="LEGENDARY";const s=e=>{const i={"레어":t.PotentialOptionGrade.RARE,"에픽":t.PotentialOptionGrade.EPIC,"유니크":t.PotentialOptionGrade.UNIQUE,"레전드리":t.PotentialOptionGrade.LEGENDARY}[e];if(!i)throw new TypeError("No enum constant for string: "+e);return i};class u{value;grade;constructor(t){const{value:e,grade:i}=t;this.value=e,this.grade=i}get gradeEnum(){return s(this.grade)}}class f{id;characterName;worldName;createDate;cubeType;itemUpgradeResult;miracleTimeFlag;itemEquipPart;itemLevel;targetItem;potentialOptionGrade;additionalPotentialOptionGrade;upgradeGuarantee;upgradeGuaranteeCount;beforePotentialOptions;beforeAdditionalPotentialOptions;afterPotentialOptions;afterAdditionalPotentialOptions;constructor(t){const{id:e,character_name:i,world_name:a,create_date:o,cube_type:n,item_upgrade_result:r,miracle_time_flag:s,item_equip_part:f,item_level:l,target_item:c,potential_option_grade:d,additional_potential_option_grade:h,upgradeguarantee:p,upgradeguaranteecount:m,before_potential_options:g,before_additional_potential_options:v,after_potential_options:$,after_additional_potential_options:O}=t;this.id=e,this.characterName=i,this.worldName=a,this.createDate=o,this.cubeType=n,this.itemUpgradeResult=r,this.miracleTimeFlag=s,this.itemEquipPart=f,this.itemLevel=l,this.targetItem=c,this.potentialOptionGrade=d,this.additionalPotentialOptionGrade=h,this.upgradeGuarantee=p,this.upgradeGuaranteeCount=m,this.beforePotentialOptions=g.map((t=>new u(t))),this.beforeAdditionalPotentialOptions=v.map((t=>new u(t))),this.afterPotentialOptions=$.map((t=>new u(t))),this.afterAdditionalPotentialOptions=O.map((t=>new u(t)))}get isItemUpgrade(){return"성공"===this.itemUpgradeResult}get isMiracleTimeFlag(){return"이벤트 적용되지 않음"!==this.miracleTimeFlag}get potentialOptionGradeEnum(){return s(this.potentialOptionGrade)}get additionalPotentialOptionGradeEnum(){return s(this.additionalPotentialOptionGrade)}}class l{count;cubeHistories;nextCursor;constructor(t){const{count:e,cube_histories:i,next_cursor:a}=t;this.count=e,this.cubeHistories=i.map((t=>new f(t))),this.nextCursor=a}}class c extends Error{name="MapleStoryApiError";status;message;constructor(t){const{status:e,message:i}=t;super(i),this.status=e,this.message=i}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var d={exports:{}};!function(t,e){var i,a;t.exports=(i={year:0,month:1,day:2,hour:3,minute:4,second:5},a={},function(t,e,o){var n,r=function(t,e,i){void 0===i&&(i={});var o=new Date(t),n=function(t,e){void 0===e&&(e={});var i=e.timeZoneName||"short",o=t+"|"+i,n=a[o];return n||(n=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),a[o]=n),n}(e,i);return n.formatToParts(o)},s=function(t,e){for(var a=r(t,e),n=[],s=0;s<a.length;s+=1){var u=a[s],f=u.type,l=u.value,c=i[f];c>=0&&(n[c]=parseInt(l,10))}var d=n[3],h=24===d?0:d,p=n[0]+"-"+n[1]+"-"+n[2]+" "+h+":"+n[4]+":"+n[5]+":000",m=+t;return(o.utc(p).valueOf()-(m-=m%1e3))/6e4},u=e.prototype;u.tz=function(t,e){void 0===t&&(t=n);var i=this.utcOffset(),a=this.toDate(),r=a.toLocaleString("en-US",{timeZone:t}),s=Math.round((a-new Date(r))/1e3/60),u=o(r,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(a.getTimezoneOffset()/15)-s,!0);if(e){var f=u.utcOffset();u=u.add(i-f,"minute")}return u.$x.$timezone=t,u},u.offsetName=function(t){var e=this.$x.$timezone||o.tz.guess(),i=r(this.valueOf(),e,{timeZoneName:t}).find((function(t){return"timezonename"===t.type.toLowerCase()}));return i&&i.value};var f=u.startOf;u.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return f.call(this,t,e);var i=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return f.call(i,t,e).tz(this.$x.$timezone,!0)},o.tz=function(t,e,i){var a=i&&e,r=i||e||n,u=s(+o(),r);if("string"!=typeof t)return o(t).tz(r);var f=function(t,e,i){var a=t-60*e*1e3,o=s(a,i);if(e===o)return[a,e];var n=s(a-=60*(o-e)*1e3,i);return o===n?[a,o]:[t-60*Math.min(o,n)*1e3,Math.max(o,n)]}(o.utc(t,a).valueOf(),u,r),l=f[0],c=f[1],d=o(l).utcOffset(c);return d.$x.$timezone=r,d},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(t){n=t}})}(d);var h=d.exports,p={exports:{}};!function(t,e){var i,a,o;t.exports=(i="minute",a=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g,function(t,e,n){var r=e.prototype;n.utc=function(t){return new e({date:t,utc:!0,args:arguments})},r.utc=function(t){var e=n(this.toDate(),{locale:this.$L,utc:!0});return t?e.add(this.utcOffset(),i):e},r.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var s=r.parse;r.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),s.call(this,t)};var u=r.init;r.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else u.call(this)};var f=r.utcOffset;r.utcOffset=function(t,e){var n=this.$utils().u;if(n(t))return this.$u?0:n(this.$offset)?f.call(this):this.$offset;if("string"==typeof t&&(t=function(t){void 0===t&&(t="");var e=t.match(a);if(!e)return null;var i=(""+e[0]).match(o)||["-",0,0],n=i[0],r=60*+i[1]+ +i[2];return 0===r?0:"+"===n?r:-r}(t),null===t))return this;var r=Math.abs(t)<=16?60*t:t,s=this;if(e)return s.$offset=r,s.$u=0===t,s;if(0!==t){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(r+u,i)).$offset=r,s.$x.$localOffset=u}else s=this.utc();return s};var l=r.format;r.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,e)},r.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},r.isUTC=function(){return!!this.$u},r.toISOString=function(){return this.toDate().toISOString()},r.toString=function(){return this.toDate().toUTCString()};var c=r.toDate;r.toDate=function(t){return"s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var d=r.diff;r.diff=function(t,e,i){if(t&&this.$u===t.$u)return d.call(this,t,e,i);var a=this.local(),o=n(t).local();return d.call(a,o,e,i)}})}(p);var m=p.exports;r.default.extend(h),r.default.extend(m);class g{apiKey;static baseUrl="https://public.api.nexon.com/";static kstOffset=540;timeout;constructor(t){this.apiKey=t,this.timeout=5e3}async getCubeResult(t,i){const a={count:t};if("string"==typeof i)a.cursor=i;else if("object"==typeof i){const{year:t,month:e,day:o}=i;if(t<=2022&&e<=11&&o<25)throw new Error("You can only retrieve data after 2022-11-25.");const n=r.default(`${t}-${e}-${o}`).utcOffset(g.kstOffset);a.date=n.format("YYYY-MM-DD")}else{const t=r.default().utcOffset(g.kstOffset);a.date=t.format("YYYY-MM-DD")}try{const t="openapi/maplestory/v1/cube-use-results",e=await n.default.get(t,{baseURL:g.baseUrl,timeout:this.timeout,headers:this.buildHeaders(),params:a});return new l(e.data)}catch(t){if(t instanceof e.AxiosError){const e=t.response.data;throw new c(e)}throw t}}buildHeaders(){return{authorization:this.apiKey}}}t.CubeHistoryDto=f,t.CubeHistoryResponseDto=l,t.CubeResultOptionDto=u,t.MapleStoryApi=g,t.MapleStoryApiError=c,t.potentialOptionGradeFromString=s}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("axios"),require("dayjs"),require("xml2js")):"function"==typeof define&&define.amd?define(["exports","axios","dayjs","xml2js"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["maplestory-openapi"]={},t.axios,t.dayjs,t.xml2js)}(this,(function(t,e,i,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r,n=a(e),s=a(i),u=a(o);t.PotentialOptionGrade=void 0,(r=t.PotentialOptionGrade||(t.PotentialOptionGrade={}))[r.RARE=0]="RARE",r[r.EPIC=1]="EPIC",r[r.UNIQUE=2]="UNIQUE",r[r.LEGENDARY=3]="LEGENDARY";const l=e=>{const i={"레어":t.PotentialOptionGrade.RARE,"에픽":t.PotentialOptionGrade.EPIC,"유니크":t.PotentialOptionGrade.UNIQUE,"레전드리":t.PotentialOptionGrade.LEGENDARY}[e];if(!i)throw new TypeError("No enum constant for string: "+e);return i};class f{value;grade;constructor(t){const{value:e,grade:i}=t;this.value=e,this.grade=i}get gradeEnum(){return l(this.grade)}}class d{id;characterName;worldName;dateCreate;cubeType;itemUpgradeResult;miracleTimeFlag;itemEquipmentPart;itemLevel;targetItem;potentialOptionGrade;additionalPotentialOptionGrade;upgradeGuarantee;upgradeGuaranteeCount;beforePotentialOption;beforeAdditionalPotentialOption;afterPotentialOption;afterAdditionalPotentialOption;constructor(t){const{id:e,character_name:i,world_name:o,date_create:a,cube_type:r,item_upgrade_result:n,miracle_time_flag:s,item_equipment_part:u,item_level:l,target_item:d,potential_option_grade:p,additional_potential_option_grade:c,upgrade_guarantee:h,upgrade_guarantee_count:m,before_potential_option:O,before_additional_potential_option:g,after_potential_option:P,after_additional_potential_option:y}=t;this.id=e,this.characterName=i,this.worldName=o,this.dateCreate=new Date(a),this.cubeType=r,this.itemUpgradeResult=n,this.miracleTimeFlag=s,this.itemEquipmentPart=u,this.itemLevel=l,this.targetItem=d,this.potentialOptionGrade=p,this.additionalPotentialOptionGrade=c,this.upgradeGuarantee=h,this.upgradeGuaranteeCount=m,this.beforePotentialOption=O.map((t=>new f(t))),this.beforeAdditionalPotentialOption=g.map((t=>new f(t))),this.afterPotentialOption=P.map((t=>new f(t))),this.afterAdditionalPotentialOption=y.map((t=>new f(t)))}get isItemUpgrade(){return"성공"===this.itemUpgradeResult}get isMiracleTimeFlag(){return"이벤트 적용되지 않음"!==this.miracleTimeFlag}get potentialOptionGradeEnum(){return l(this.potentialOptionGrade)}get additionalPotentialOptionGradeEnum(){return l(this.additionalPotentialOptionGrade)}}class p{count;cubeHistory;nextCursor;constructor(t){const{count:e,cube_history:i,next_cursor:o}=t;this.count=e,this.cubeHistory=i.map((t=>new d(t))),this.nextCursor=o}}class c{serviceCode;startDateTime;endDateTime;strObstacleContents;constructor(t){const e=t["soap:Envelope"]["soap:Body"][0].GetInspectionInfoResponse[0].GetInspectionInfoResult[0]["diffgr:diffgram"][0].NewDataSet[0].InspectionInfo[0];this.serviceCode=Number(e.serviceCode[0]),this.startDateTime=new Date(e.startDateTime[0]),this.endDateTime=new Date(e.endDateTime[0]),this.strObstacleContents=e.strObstacleContents[0]}}class h extends Error{name="MapleStoryApiError";errorCode;message;constructor(t){const{name:e,message:i}=t.error;super(i),this.errorCode=O[e],this.message=i}}var m;t.MapleStoryApiErrorCode=void 0,(m=t.MapleStoryApiErrorCode||(t.MapleStoryApiErrorCode={}))[m.OPENAPI00001=0]="OPENAPI00001",m[m.OPENAPI00002=1]="OPENAPI00002",m[m.OPENAPI00003=2]="OPENAPI00003",m[m.OPENAPI00004=3]="OPENAPI00004",m[m.OPENAPI00005=4]="OPENAPI00005",m[m.OPENAPI00006=5]="OPENAPI00006",m[m.OPENAPI00007=6]="OPENAPI00007";const O={OPENAPI00001:t.MapleStoryApiErrorCode.OPENAPI00001,OPENAPI00002:t.MapleStoryApiErrorCode.OPENAPI00002,OPENAPI00003:t.MapleStoryApiErrorCode.OPENAPI00003,OPENAPI00004:t.MapleStoryApiErrorCode.OPENAPI00004,OPENAPI00005:t.MapleStoryApiErrorCode.OPENAPI00005,OPENAPI00006:t.MapleStoryApiErrorCode.OPENAPI00006,OPENAPI00007:t.MapleStoryApiErrorCode.OPENAPI00007};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var g={exports:{}};!function(t,e){var i,o;t.exports=(i={year:0,month:1,day:2,hour:3,minute:4,second:5},o={},function(t,e,a){var r,n=function(t,e,i){void 0===i&&(i={});var a=new Date(t),r=function(t,e){void 0===e&&(e={});var i=e.timeZoneName||"short",a=t+"|"+i,r=o[a];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),o[a]=r),r}(e,i);return r.formatToParts(a)},s=function(t,e){for(var o=n(t,e),r=[],s=0;s<o.length;s+=1){var u=o[s],l=u.type,f=u.value,d=i[l];d>=0&&(r[d]=parseInt(f,10))}var p=r[3],c=24===p?0:p,h=r[0]+"-"+r[1]+"-"+r[2]+" "+c+":"+r[4]+":"+r[5]+":000",m=+t;return(a.utc(h).valueOf()-(m-=m%1e3))/6e4},u=e.prototype;u.tz=function(t,e){void 0===t&&(t=r);var i=this.utcOffset(),o=this.toDate(),n=o.toLocaleString("en-US",{timeZone:t}),s=Math.round((o-new Date(n))/1e3/60),u=a(n,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(o.getTimezoneOffset()/15)-s,!0);if(e){var l=u.utcOffset();u=u.add(i-l,"minute")}return u.$x.$timezone=t,u},u.offsetName=function(t){var e=this.$x.$timezone||a.tz.guess(),i=n(this.valueOf(),e,{timeZoneName:t}).find((function(t){return"timezonename"===t.type.toLowerCase()}));return i&&i.value};var l=u.startOf;u.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return l.call(this,t,e);var i=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(i,t,e).tz(this.$x.$timezone,!0)},a.tz=function(t,e,i){var o=i&&e,n=i||e||r,u=s(+a(),n);if("string"!=typeof t)return a(t).tz(n);var l=function(t,e,i){var o=t-60*e*1e3,a=s(o,i);if(e===a)return[o,e];var r=s(o-=60*(a-e)*1e3,i);return a===r?[o,a]:[t-60*Math.min(a,r)*1e3,Math.max(a,r)]}(a.utc(t,o).valueOf(),u,n),f=l[0],d=l[1],p=a(f).utcOffset(d);return p.$x.$timezone=n,p},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(t){r=t}})}(g);var P=g.exports,y={exports:{}};!function(t,e){var i,o,a;t.exports=(i="minute",o=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g,function(t,e,r){var n=e.prototype;r.utc=function(t){return new e({date:t,utc:!0,args:arguments})},n.utc=function(t){var e=r(this.toDate(),{locale:this.$L,utc:!0});return t?e.add(this.utcOffset(),i):e},n.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var s=n.parse;n.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),s.call(this,t)};var u=n.init;n.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else u.call(this)};var l=n.utcOffset;n.utcOffset=function(t,e){var r=this.$utils().u;if(r(t))return this.$u?0:r(this.$offset)?l.call(this):this.$offset;if("string"==typeof t&&(t=function(t){void 0===t&&(t="");var e=t.match(o);if(!e)return null;var i=(""+e[0]).match(a)||["-",0,0],r=i[0],n=60*+i[1]+ +i[2];return 0===n?0:"+"===r?n:-n}(t),null===t))return this;var n=Math.abs(t)<=16?60*t:t,s=this;if(e)return s.$offset=n,s.$u=0===t,s;if(0!==t){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(n+u,i)).$offset=n,s.$x.$localOffset=u}else s=this.utc();return s};var f=n.format;n.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,e)},n.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var d=n.toDate;n.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var p=n.diff;n.diff=function(t,e,i){if(t&&this.$u===t.$u)return p.call(this,t,e,i);var o=this.local(),a=r(t).local();return p.call(o,a,e,i)}})}(y);var E=y.exports;s.default.extend(P),s.default.extend(E);class v{apiKey;static BASE_URL="https://open.api.nexon.com/";static kstOffset=540;timeout;constructor(t){this.apiKey=t,this.timeout=5e3}async getCubeResult(t,i){const o={count:t};if("string"==typeof i)o.cursor=i;else if("object"==typeof i){const{year:t,month:e,day:a}=i;if(t<=2022&&e<=11&&a<25)throw new Error("You can only retrieve data after 2022-11-25.");const r=s.default(`${t}-${e}-${a}`).utcOffset(v.kstOffset);o.date_kst=r.format("YYYYMMDD")}else{const t=s.default().utcOffset(v.kstOffset);o.date_kst=t.format("YYYYMMDD")}try{const t="maplestory/v1/history/cube",e=await n.default.get(t,{baseURL:v.BASE_URL,timeout:this.timeout,headers:this.buildHeaders(),params:o});return new p(e.data)}catch(t){if(t instanceof e.AxiosError){const e=t.response.data;throw new h(e)}throw t}}async getInspectionInfo(){const t=(new u.default.Builder).buildObject({"soap:Envelope":{$:{"xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:soap":"http://schemas.xmlsoap.org/soap/envelope/"},"soap:Body":{GetInspectionInfo:{$:{xmlns:"https://api.maplestory.nexon.com/soap/"}}}}}),e=await n.default.post("soap/maplestory.asmx",t,{baseURL:"https://api.maplestory.nexon.com/",timeout:this.timeout,headers:{SOAPAction:"https://api.maplestory.nexon.com/soap/GetInspectionInfo","Content-Type":"text/xml; charset=utf-8"}}),i=await u.default.parseStringPromise(e.data);return new c(i)}buildHeaders(){return{"x-nxopen-api-key":this.apiKey}}}t.CubeHistoryDto=d,t.CubeHistoryResponseDto=p,t.CubeResultOptionDto=f,t.InspectionInfoDto=c,t.MapleStoryApi=v,t.MapleStoryApiError=h,t.potentialOptionGradeFromString=l}));
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import axios, { AxiosError } from 'axios';
2
2
  import dayjs from 'dayjs';
3
+ import xml2js from 'xml2js';
3
4
 
4
5
  var PotentialOptionGrade;
5
6
  (function (PotentialOptionGrade) {
@@ -32,7 +33,7 @@ const potentialOptionGradeFromString = (text) => {
32
33
  */
33
34
  class CubeResultOptionDto {
34
35
  /**
35
- * 옵션 이름
36
+ * 옵션
36
37
  */
37
38
  value;
38
39
  /**
@@ -50,31 +51,31 @@ class CubeResultOptionDto {
50
51
  }
51
52
 
52
53
  /**
53
- * 큐브히스토리 정보
54
+ * 큐브 히스토리
54
55
  */
55
56
  class CubeHistoryDto {
56
57
  /**
57
- * 큐브 사용 내역에 대한 고유 식별자
58
+ * 큐브 히스토리 식별자
58
59
  */
59
60
  id;
60
61
  /**
61
- * 캐릭터이름
62
+ * 캐릭터 명
62
63
  */
63
64
  characterName;
64
65
  /**
65
- * 월드 이름
66
+ * 월드
66
67
  */
67
68
  worldName;
68
69
  /**
69
- * 큐브 사용 날짜
70
+ * 사용 일시
70
71
  */
71
- createDate;
72
+ dateCreate;
72
73
  /**
73
- * 사용한 큐브
74
+ * 사용 큐브
74
75
  */
75
76
  cubeType;
76
77
  /**
77
- * 큐브 사용 결과
78
+ * 사용 결과
78
79
  */
79
80
  itemUpgradeResult;
80
81
  /**
@@ -84,13 +85,13 @@ class CubeHistoryDto {
84
85
  /**
85
86
  * 장비 분류
86
87
  */
87
- itemEquipPart;
88
+ itemEquipmentPart;
88
89
  /**
89
90
  * 장비 레벨
90
91
  */
91
92
  itemLevel;
92
93
  /**
93
- * 큐브를 사용한 장비
94
+ * 큐브 사용한 장비
94
95
  */
95
96
  targetItem;
96
97
  /**
@@ -110,41 +111,41 @@ class CubeHistoryDto {
110
111
  */
111
112
  upgradeGuaranteeCount;
112
113
  /**
113
- * 큐브 사용 전 잠재능력 옵션
114
+ * 사용 전 잠재능력 옵션
114
115
  */
115
- beforePotentialOptions;
116
+ beforePotentialOption;
116
117
  /**
117
- * 큐브 사용 전 에디셔널 잠재능력 옵션
118
+ * 사용 전 에디셔널 잠재능력 옵션
118
119
  */
119
- beforeAdditionalPotentialOptions;
120
+ beforeAdditionalPotentialOption;
120
121
  /**
121
- * 큐브 사용 후 잠재능력 옵션
122
+ * 사용 후 잠재능력 옵션
122
123
  */
123
- afterPotentialOptions;
124
+ afterPotentialOption;
124
125
  /**
125
- * 큐브 사용 후 에디셔널 잠재능력 옵션
126
+ * 사용 후 에디셔널 잠재능력 옵션
126
127
  */
127
- afterAdditionalPotentialOptions;
128
+ afterAdditionalPotentialOption;
128
129
  constructor(obj) {
129
- const { id, character_name, world_name, create_date, cube_type, item_upgrade_result, miracle_time_flag, item_equip_part, item_level, target_item, potential_option_grade, additional_potential_option_grade, upgradeguarantee, upgradeguaranteecount, before_potential_options, before_additional_potential_options, after_potential_options, after_additional_potential_options } = obj;
130
+ const { id, character_name, world_name, date_create, cube_type, item_upgrade_result, miracle_time_flag, item_equipment_part, item_level, target_item, potential_option_grade, additional_potential_option_grade, upgrade_guarantee, upgrade_guarantee_count, before_potential_option, before_additional_potential_option, after_potential_option, after_additional_potential_option } = obj;
130
131
  this.id = id;
131
132
  this.characterName = character_name;
132
133
  this.worldName = world_name;
133
- this.createDate = create_date;
134
+ this.dateCreate = new Date(date_create);
134
135
  this.cubeType = cube_type;
135
136
  this.itemUpgradeResult = item_upgrade_result;
136
137
  this.miracleTimeFlag = miracle_time_flag;
137
- this.itemEquipPart = item_equip_part;
138
+ this.itemEquipmentPart = item_equipment_part;
138
139
  this.itemLevel = item_level;
139
140
  this.targetItem = target_item;
140
141
  this.potentialOptionGrade = potential_option_grade;
141
142
  this.additionalPotentialOptionGrade = additional_potential_option_grade;
142
- this.upgradeGuarantee = upgradeguarantee;
143
- this.upgradeGuaranteeCount = upgradeguaranteecount;
144
- this.beforePotentialOptions = before_potential_options.map(origin => new CubeResultOptionDto(origin));
145
- this.beforeAdditionalPotentialOptions = before_additional_potential_options.map(origin => new CubeResultOptionDto(origin));
146
- this.afterPotentialOptions = after_potential_options.map(origin => new CubeResultOptionDto(origin));
147
- this.afterAdditionalPotentialOptions = after_additional_potential_options.map(origin => new CubeResultOptionDto(origin));
143
+ this.upgradeGuarantee = upgrade_guarantee;
144
+ this.upgradeGuaranteeCount = upgrade_guarantee_count;
145
+ this.beforePotentialOption = before_potential_option.map(origin => new CubeResultOptionDto(origin));
146
+ this.beforeAdditionalPotentialOption = before_additional_potential_option.map(origin => new CubeResultOptionDto(origin));
147
+ this.afterPotentialOption = after_potential_option.map(origin => new CubeResultOptionDto(origin));
148
+ this.afterAdditionalPotentialOption = after_additional_potential_option.map(origin => new CubeResultOptionDto(origin));
148
149
  }
149
150
  get isItemUpgrade() {
150
151
  return this.itemUpgradeResult === '성공';
@@ -161,7 +162,7 @@ class CubeHistoryDto {
161
162
  }
162
163
 
163
164
  /**
164
- * 큐브히스토리 응답 정보
165
+ * 큐브 히스토리 응답 정보
165
166
  */
166
167
  class CubeHistoryResponseDto {
167
168
  /**
@@ -171,34 +172,86 @@ class CubeHistoryResponseDto {
171
172
  /**
172
173
  * 큐브 히스토리
173
174
  */
174
- cubeHistories;
175
+ cubeHistory;
175
176
  /**
176
177
  * 페이징 처리를 위한 cursor
177
178
  */
178
179
  nextCursor;
179
180
  constructor(obj) {
180
- const { count, cube_histories, next_cursor } = obj;
181
+ const { count, cube_history, next_cursor } = obj;
181
182
  this.count = count;
182
- this.cubeHistories = cube_histories.map(origin => new CubeHistoryDto(origin));
183
+ this.cubeHistory = cube_history.map(origin => new CubeHistoryDto(origin));
183
184
  this.nextCursor = next_cursor;
184
185
  }
185
186
  }
186
187
 
188
+ /**
189
+ * 서버 점검 정보
190
+ */
191
+ class InspectionInfoDto {
192
+ /**
193
+ * 서비스 코드
194
+ */
195
+ serviceCode;
196
+ /**
197
+ * 점검 시작 시각
198
+ */
199
+ startDateTime;
200
+ /**
201
+ * 점검 종료 시각
202
+ */
203
+ endDateTime;
204
+ /**
205
+ * 점검 안내 제목
206
+ */
207
+ strObstacleContents;
208
+ constructor(obj) {
209
+ const inspectionInfoTag = obj["soap:Envelope"]['soap:Body'][0]['GetInspectionInfoResponse'][0]['GetInspectionInfoResult'][0]['diffgr:diffgram'][0]['NewDataSet'][0]['InspectionInfo'][0];
210
+ this.serviceCode = Number(inspectionInfoTag.serviceCode[0]);
211
+ this.startDateTime = new Date(inspectionInfoTag.startDateTime[0]);
212
+ this.endDateTime = new Date(inspectionInfoTag.endDateTime[0]);
213
+ this.strObstacleContents = inspectionInfoTag.strObstacleContents[0];
214
+ }
215
+ }
216
+
187
217
  /**
188
218
  * MapleStory OpenAPI error.<br>
189
- * Please refer to <a href="https://developers.nexon.com/Maplestory/guides">MapleStory API guide</a> for the error details.
219
+ * Please refer to <a href="https://openapi.nexon.com/guide/request-api/">MapleStory API guide</a> for the error details.
190
220
  */
191
221
  class MapleStoryApiError extends Error {
192
222
  name = 'MapleStoryApiError';
193
- status;
223
+ errorCode;
194
224
  message;
195
- constructor(params) {
196
- const { status, message } = params;
225
+ constructor(errorBody) {
226
+ const { name, message } = errorBody.error;
197
227
  super(message);
198
- this.status = status;
228
+ this.errorCode = errorMap[name];
199
229
  this.message = message;
200
230
  }
201
231
  }
232
+ /**
233
+ * MapleStory OpenAPI error codes.<br>
234
+ * Please refer to <a href="https://openapi.nexon.com/guide/request-api/">MapleStory API guide</a> for the error code details.
235
+ */
236
+ var MapleStoryApiErrorCode;
237
+ (function (MapleStoryApiErrorCode) {
238
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00001"] = 0] = "OPENAPI00001";
239
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00002"] = 1] = "OPENAPI00002";
240
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00003"] = 2] = "OPENAPI00003";
241
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00004"] = 3] = "OPENAPI00004";
242
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00005"] = 4] = "OPENAPI00005";
243
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00006"] = 5] = "OPENAPI00006";
244
+ MapleStoryApiErrorCode[MapleStoryApiErrorCode["OPENAPI00007"] = 6] = "OPENAPI00007";
245
+ })(MapleStoryApiErrorCode || (MapleStoryApiErrorCode = {}));
246
+ const errorMap = {
247
+ ['OPENAPI00001']: MapleStoryApiErrorCode.OPENAPI00001,
248
+ ['OPENAPI00002']: MapleStoryApiErrorCode.OPENAPI00002,
249
+ ['OPENAPI00003']: MapleStoryApiErrorCode.OPENAPI00003,
250
+ ['OPENAPI00004']: MapleStoryApiErrorCode.OPENAPI00004,
251
+ ['OPENAPI00005']: MapleStoryApiErrorCode.OPENAPI00005,
252
+ ['OPENAPI00006']: MapleStoryApiErrorCode.OPENAPI00006,
253
+ ['OPENAPI00007']: MapleStoryApiErrorCode.OPENAPI00007,
254
+ };
202
255
 
203
256
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
204
257
 
@@ -220,9 +273,13 @@ var utc = utc$1.exports;
220
273
 
221
274
  dayjs.extend(timezone);
222
275
  dayjs.extend(utc);
276
+ /**
277
+ * MapleStory OpenAPI client.<br>
278
+ * This is an implementation of <a href="https://openapi.nexon.com/game/maplestory">MapleStory API</a>
279
+ */
223
280
  class MapleStoryApi {
224
281
  apiKey;
225
- static baseUrl = 'https://public.api.nexon.com/';
282
+ static BASE_URL = 'https://open.api.nexon.com/';
226
283
  static kstOffset = 540;
227
284
  timeout;
228
285
  constructor(apiKey) {
@@ -242,16 +299,16 @@ class MapleStoryApi {
242
299
  throw new Error('You can only retrieve data after 2022-11-25.');
243
300
  }
244
301
  const date = dayjs(`${year}-${month}-${day}`).utcOffset(MapleStoryApi.kstOffset);
245
- query.date = date.format('YYYY-MM-DD');
302
+ query.date_kst = date.format('YYYYMMDD');
246
303
  }
247
304
  else {
248
305
  const now = dayjs().utcOffset(MapleStoryApi.kstOffset);
249
- query.date = now.format('YYYY-MM-DD');
306
+ query.date_kst = now.format('YYYYMMDD');
250
307
  }
251
308
  try {
252
- const path = 'openapi/maplestory/v1/cube-use-results';
309
+ const path = 'maplestory/v1/history/cube';
253
310
  const response = await axios.get(path, {
254
- baseURL: MapleStoryApi.baseUrl,
311
+ baseURL: MapleStoryApi.BASE_URL,
255
312
  timeout: this.timeout,
256
313
  headers: this.buildHeaders(),
257
314
  params: query
@@ -266,11 +323,47 @@ class MapleStoryApi {
266
323
  throw e;
267
324
  }
268
325
  }
326
+ /**
327
+ * 서버 점검 정보를 조회합니다.
328
+ */
329
+ async getInspectionInfo() {
330
+ const xmlBuilder = new xml2js.Builder();
331
+ const soapEnvelop = {
332
+ 'soap:Envelope': {
333
+ $: {
334
+ 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
335
+ 'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
336
+ 'xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/'
337
+ },
338
+ 'soap:Body': {
339
+ 'GetInspectionInfo': {
340
+ $: {
341
+ 'xmlns': 'https://api.maplestory.nexon.com/soap/'
342
+ }
343
+ }
344
+ }
345
+ }
346
+ };
347
+ const baseUrl = 'https://api.maplestory.nexon.com/';
348
+ const path = 'soap/maplestory.asmx';
349
+ const headers = {
350
+ 'SOAPAction': 'https://api.maplestory.nexon.com/soap/GetInspectionInfo',
351
+ 'Content-Type': 'text/xml; charset=utf-8'
352
+ };
353
+ const body = xmlBuilder.buildObject(soapEnvelop);
354
+ const response = await axios.post(path, body, {
355
+ baseURL: baseUrl,
356
+ timeout: this.timeout,
357
+ headers,
358
+ });
359
+ const xml = await xml2js.parseStringPromise(response.data);
360
+ return new InspectionInfoDto(xml);
361
+ }
269
362
  buildHeaders() {
270
363
  return {
271
- 'authorization': this.apiKey
364
+ 'x-nxopen-api-key': this.apiKey
272
365
  };
273
366
  }
274
367
  }
275
368
 
276
- export { CubeHistoryDto, CubeHistoryResponseDto, CubeResultOptionDto, MapleStoryApi, MapleStoryApiError, PotentialOptionGrade, potentialOptionGradeFromString };
369
+ export { CubeHistoryDto, CubeHistoryResponseDto, CubeResultOptionDto, InspectionInfoDto, MapleStoryApi, MapleStoryApiError, MapleStoryApiErrorCode, PotentialOptionGrade, potentialOptionGradeFromString };
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "maplestory-openapi",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
+ "description": "This JavaScript library enables the use of the MapleStory OpenAPI of Nexon.",
4
5
  "keywords": [
5
6
  "maplestory",
6
7
  "maplestory openapi",
7
8
  "maplestory api",
8
9
  "cube",
9
10
  "nexon",
10
- "nexon developers"
11
+ "nexon developers",
12
+ "nexon openapi"
11
13
  ],
12
- "description": "This JavaScript library enables the use of the MapleStory OpenAPI provided by Nexon.",
13
14
  "homepage": "https://github.com/SpiralMoon/maplestory.openapi",
14
15
  "bugs": {
15
16
  "url": "https://github.com/SpiralMoon/maplestory.openapi/issues"
@@ -45,11 +46,13 @@
45
46
  },
46
47
  "dependencies": {
47
48
  "axios": "^1.6.0",
48
- "dayjs": "^1.11.10"
49
+ "dayjs": "^1.11.10",
50
+ "xml2js": "^0.6.2"
49
51
  },
50
52
  "devDependencies": {
51
53
  "@rollup/plugin-commonjs": "^21.1.0",
52
54
  "@rollup/plugin-node-resolve": "13.1.3",
55
+ "@types/xml2js": "^0.4.14",
53
56
  "rollup": "2.66.1",
54
57
  "rollup-plugin-terser": "7.0.2",
55
58
  "rollup-plugin-typescript2": "0.27.1",
package/types/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export * from './maplestory/api/mapleStoryApiError';
3
3
  export * from './maplestory/api/dto/cubeHistoryDto';
4
4
  export * from './maplestory/api/dto/cubeHistoryResponseDto';
5
5
  export * from './maplestory/api/dto/cubeResultOptionDto';
6
+ export * from './maplestory/api/dto/inspectionInfoDto';
6
7
  export * from './maplestory/api/dto/potentialOptionGrade';
@@ -2,31 +2,31 @@ import { CubeResultOptionDto } from "./cubeResultOptionDto";
2
2
  import { CubeHistoryDtoBody } from "../response/cubeHistoryDtoBody";
3
3
  import { PotentialOptionGrade } from "./potentialOptionGrade";
4
4
  /**
5
- * 큐브히스토리 정보
5
+ * 큐브 히스토리
6
6
  */
7
7
  declare class CubeHistoryDto {
8
8
  /**
9
- * 큐브 사용 내역에 대한 고유 식별자
9
+ * 큐브 히스토리 식별자
10
10
  */
11
11
  id: string;
12
12
  /**
13
- * 캐릭터이름
13
+ * 캐릭터 명
14
14
  */
15
15
  characterName: string;
16
16
  /**
17
- * 월드 이름
17
+ * 월드
18
18
  */
19
19
  worldName: string;
20
20
  /**
21
- * 큐브 사용 날짜
21
+ * 사용 일시
22
22
  */
23
- createDate: string;
23
+ dateCreate: Date;
24
24
  /**
25
- * 사용한 큐브
25
+ * 사용 큐브
26
26
  */
27
27
  cubeType: string;
28
28
  /**
29
- * 큐브 사용 결과
29
+ * 사용 결과
30
30
  */
31
31
  itemUpgradeResult: string;
32
32
  /**
@@ -36,13 +36,13 @@ declare class CubeHistoryDto {
36
36
  /**
37
37
  * 장비 분류
38
38
  */
39
- itemEquipPart: string;
39
+ itemEquipmentPart: string;
40
40
  /**
41
41
  * 장비 레벨
42
42
  */
43
43
  itemLevel: number;
44
44
  /**
45
- * 큐브를 사용한 장비
45
+ * 큐브 사용한 장비
46
46
  */
47
47
  targetItem: string;
48
48
  /**
@@ -62,21 +62,21 @@ declare class CubeHistoryDto {
62
62
  */
63
63
  upgradeGuaranteeCount: number;
64
64
  /**
65
- * 큐브 사용 전 잠재능력 옵션
65
+ * 사용 전 잠재능력 옵션
66
66
  */
67
- beforePotentialOptions: CubeResultOptionDto[];
67
+ beforePotentialOption: CubeResultOptionDto[];
68
68
  /**
69
- * 큐브 사용 전 에디셔널 잠재능력 옵션
69
+ * 사용 전 에디셔널 잠재능력 옵션
70
70
  */
71
- beforeAdditionalPotentialOptions: CubeResultOptionDto[];
71
+ beforeAdditionalPotentialOption: CubeResultOptionDto[];
72
72
  /**
73
- * 큐브 사용 후 잠재능력 옵션
73
+ * 사용 후 잠재능력 옵션
74
74
  */
75
- afterPotentialOptions: CubeResultOptionDto[];
75
+ afterPotentialOption: CubeResultOptionDto[];
76
76
  /**
77
- * 큐브 사용 후 에디셔널 잠재능력 옵션
77
+ * 사용 후 에디셔널 잠재능력 옵션
78
78
  */
79
- afterAdditionalPotentialOptions: CubeResultOptionDto[];
79
+ afterAdditionalPotentialOption: CubeResultOptionDto[];
80
80
  constructor(obj: CubeHistoryDtoBody);
81
81
  get isItemUpgrade(): boolean;
82
82
  get isMiracleTimeFlag(): boolean;
@@ -1,7 +1,7 @@
1
1
  import { CubeHistoryDto } from "./cubeHistoryDto";
2
2
  import { CubeHistoryResponseDtoBody } from "../response/cubeHistoryResponseDtoBody";
3
3
  /**
4
- * 큐브히스토리 응답 정보
4
+ * 큐브 히스토리 응답 정보
5
5
  */
6
6
  declare class CubeHistoryResponseDto {
7
7
  /**
@@ -11,7 +11,7 @@ declare class CubeHistoryResponseDto {
11
11
  /**
12
12
  * 큐브 히스토리
13
13
  */
14
- cubeHistories: CubeHistoryDto[];
14
+ cubeHistory: CubeHistoryDto[];
15
15
  /**
16
16
  * 페이징 처리를 위한 cursor
17
17
  */
@@ -5,7 +5,7 @@ import { PotentialOptionGrade } from "./potentialOptionGrade";
5
5
  */
6
6
  declare class CubeResultOptionDto {
7
7
  /**
8
- * 옵션 이름
8
+ * 옵션
9
9
  */
10
10
  value: string;
11
11
  /**
@@ -0,0 +1,24 @@
1
+ import { InspectionInfoSoapBody } from "../response/inspectionInfoSoapBody";
2
+ /**
3
+ * 서버 점검 정보
4
+ */
5
+ declare class InspectionInfoDto {
6
+ /**
7
+ * 서비스 코드
8
+ */
9
+ serviceCode: number;
10
+ /**
11
+ * 점검 시작 시각
12
+ */
13
+ startDateTime: Date;
14
+ /**
15
+ * 점검 종료 시각
16
+ */
17
+ endDateTime: Date;
18
+ /**
19
+ * 점검 안내 제목
20
+ */
21
+ strObstacleContents: string;
22
+ constructor(obj: InspectionInfoSoapBody);
23
+ }
24
+ export { InspectionInfoDto };
@@ -1,36 +1,48 @@
1
1
  import { CubeHistoryResponseDto } from "./dto/cubeHistoryResponseDto";
2
+ import { InspectionInfoDto } from "./dto/inspectionInfoDto";
3
+ /**
4
+ * MapleStory OpenAPI client.<br>
5
+ * This is an implementation of <a href="https://openapi.nexon.com/game/maplestory">MapleStory API</a>
6
+ */
2
7
  declare class MapleStoryApi {
3
8
  private readonly apiKey;
4
- private static baseUrl;
9
+ private static BASE_URL;
5
10
  private static kstOffset;
6
11
  timeout: number;
7
12
  constructor(apiKey: string);
8
13
  /**
9
- * 오늘 날짜의 확률형 아이템 큐브의 사용 결과를 조회합니다.<br>
10
- * 데이터는 일단위로 갱신되며, 오전 4 조회 시 전일 데이터를 조회할 수 있습니다.<br>
11
- * 데이터는 2022년 11월 25일부터 조회할 수 있습니다.<br>
14
+ * 오늘 날짜의 큐브 사용 결과를 조회합니다.<br>
15
+ * 큐브 사용 결과 데이터는 매일 오전 4시, 전일 데이터가 갱신됩니다.<br>
16
+ * 큐브 사용 결과 데이터는 2022년 11월 25일부터 조회할 수 있습니다.<br>
17
+ * e.g. 오늘 오후 3시 5분 큐브 확률 정보 조회 시, 어제의 큐브 확률 정보 데이터를 조회할 수 있습니다.<br>
12
18
  *
13
- * @param count 한번에 가져오려는 결과의 갯수(최소 10, 최대 1000) Default value : 10
19
+ * @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000)
14
20
  */
15
21
  getCubeResult(count: number): Promise<CubeHistoryResponseDto>;
16
22
  /**
17
- * 지목한 날짜의 확률형 아이템 큐브의 사용 결과를 조회합니다.<br>
18
- * 데이터는 일단위로 갱신되며, 오전 4 조회 시 전일 데이터를 조회할 수 있습니다.<br>
19
- * 데이터는 2022년 11월 25일부터 조회할 수 있습니다.<br>
23
+ * 지목한 날짜의 큐브 사용 결과를 조회합니다.<br>
24
+ * 큐브 사용 결과 데이터는 매일 오전 4시, 전일 데이터가 갱신됩니다.<br>
25
+ * 큐브 사용 결과 데이터는 2022년 11월 25일부터 조회할 수 있습니다.<br>
26
+ * e.g. 오늘 오후 3시 5분 큐브 확률 정보 조회 시, 어제의 큐브 확률 정보 데이터를 조회할 수 있습니다.<br>
20
27
  *
21
- * @param count 한번에 가져오려는 결과의 갯수(최소 10, 최대 1000) Default value : 10
22
- * @param dateOptions 조회할 연월일 날짜 정보
28
+ * @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000)
29
+ * @param dateOptions 조회 기준일 (KST)
23
30
  */
24
31
  getCubeResult(count: number, dateOptions: DateOptions): Promise<CubeHistoryResponseDto>;
25
32
  /**
26
- * 확률형 아이템 큐브의 사용 결과를 조회합니다.<br>
27
- * 데이터는 일단위로 갱신되며, 오전 4 조회 시 전일 데이터를 조회할 수 있습니다.<br>
28
- * 데이터는 2022년 11월 25일부터 조회할 수 있습니다.<br>
33
+ * 큐브 사용 결과를 조회합니다.<br>
34
+ * 큐브 사용 결과 데이터는 매일 오전 4시, 전일 데이터가 갱신됩니다.<br>
35
+ * 큐브 사용 결과 데이터는 2022년 11월 25일부터 조회할 수 있습니다.<br>
36
+ * e.g. 오늘 오후 3시 5분 큐브 확률 정보 조회 시, 어제의 큐브 확률 정보 데이터를 조회할 수 있습니다.<br>
29
37
  *
30
- * @param count 한번에 가져오려는 결과의 갯수(최소 10, 최대 1000) Default value : 10
31
- * @param cursor
38
+ * @param count 한번에 가져오려는 결과의 개수(최소 10, 최대 1000)
39
+ * @param cursor 페이징 처리를 위한 cursor
32
40
  */
33
41
  getCubeResult(count: number, cursor: string): Promise<CubeHistoryResponseDto>;
42
+ /**
43
+ * 서버 점검 정보를 조회합니다.
44
+ */
45
+ getInspectionInfo(): Promise<InspectionInfoDto>;
34
46
  private buildHeaders;
35
47
  }
36
48
  type DateOptions = {
@@ -38,4 +50,10 @@ type DateOptions = {
38
50
  month: number;
39
51
  day: number;
40
52
  };
41
- export { MapleStoryApi };
53
+ type MapleStoryErrorBody = {
54
+ error: {
55
+ name: string;
56
+ message: string;
57
+ };
58
+ };
59
+ export { MapleStoryApi, MapleStoryErrorBody };
@@ -1,14 +1,25 @@
1
+ import { MapleStoryErrorBody } from "./mapleStoryApi";
1
2
  /**
2
3
  * MapleStory OpenAPI error.<br>
3
- * Please refer to <a href="https://developers.nexon.com/Maplestory/guides">MapleStory API guide</a> for the error details.
4
+ * Please refer to <a href="https://openapi.nexon.com/guide/request-api/">MapleStory API guide</a> for the error details.
4
5
  */
5
6
  declare class MapleStoryApiError extends Error {
6
7
  readonly name = "MapleStoryApiError";
7
- readonly status: number;
8
+ readonly errorCode: MapleStoryApiErrorCode;
8
9
  readonly message: string;
9
- constructor(params: {
10
- status: number;
11
- message: string;
12
- });
10
+ constructor(errorBody: MapleStoryErrorBody);
13
11
  }
14
- export { MapleStoryApiError };
12
+ /**
13
+ * MapleStory OpenAPI error codes.<br>
14
+ * Please refer to <a href="https://openapi.nexon.com/guide/request-api/">MapleStory API guide</a> for the error code details.
15
+ */
16
+ declare enum MapleStoryApiErrorCode {
17
+ OPENAPI00001 = 0,
18
+ OPENAPI00002 = 1,
19
+ OPENAPI00003 = 2,
20
+ OPENAPI00004 = 3,
21
+ OPENAPI00005 = 4,
22
+ OPENAPI00006 = 5,
23
+ OPENAPI00007 = 6
24
+ }
25
+ export { MapleStoryApiError, MapleStoryApiErrorCode };
@@ -3,20 +3,20 @@ type CubeHistoryDtoBody = {
3
3
  id: string;
4
4
  character_name: string;
5
5
  world_name: string;
6
- create_date: string;
6
+ date_create: string;
7
7
  cube_type: string;
8
8
  item_upgrade_result: string;
9
9
  miracle_time_flag: string;
10
- item_equip_part: string;
10
+ item_equipment_part: string;
11
11
  item_level: number;
12
12
  target_item: string;
13
13
  potential_option_grade: string;
14
14
  additional_potential_option_grade: string;
15
- upgradeguarantee: boolean;
16
- upgradeguaranteecount: number;
17
- before_potential_options: CubeResultOptionDtoBody[];
18
- before_additional_potential_options: CubeResultOptionDtoBody[];
19
- after_potential_options: CubeResultOptionDtoBody[];
20
- after_additional_potential_options: CubeResultOptionDtoBody[];
15
+ upgrade_guarantee: boolean;
16
+ upgrade_guarantee_count: number;
17
+ before_potential_option: CubeResultOptionDtoBody[];
18
+ before_additional_potential_option: CubeResultOptionDtoBody[];
19
+ after_potential_option: CubeResultOptionDtoBody[];
20
+ after_additional_potential_option: CubeResultOptionDtoBody[];
21
21
  };
22
22
  export type { CubeHistoryDtoBody };
@@ -1,7 +1,7 @@
1
1
  import { CubeHistoryDtoBody } from "./cubeHistoryDtoBody";
2
2
  type CubeHistoryResponseDtoBody = {
3
3
  count: number;
4
- cube_histories: CubeHistoryDtoBody[];
4
+ cube_history: CubeHistoryDtoBody[];
5
5
  next_cursor: string;
6
6
  };
7
7
  export type { CubeHistoryResponseDtoBody };
@@ -0,0 +1,137 @@
1
+ type InspectionInfoSoapBody = {
2
+ 'soap:Envelope': {
3
+ "$": {
4
+ "xmlns:soap": "http://schemas.xmlsoap.org/soap/envelope/";
5
+ "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance";
6
+ "xmlns:xsd": "http://www.w3.org/2001/XMLSchema";
7
+ };
8
+ "soap:Body": [
9
+ {
10
+ "GetInspectionInfoResponse": [
11
+ {
12
+ "$": {
13
+ "xmlns": "https://api.maplestory.nexon.com/soap/";
14
+ };
15
+ "GetInspectionInfoResult": [
16
+ {
17
+ "xs:schema": [
18
+ {
19
+ "$": {
20
+ "id": "NewDataSet";
21
+ "xmlns": "";
22
+ "xmlns:xs": "http://www.w3.org/2001/XMLSchema";
23
+ "xmlns:msdata": "urn:schemas-microsoft-com:xml-msdata";
24
+ };
25
+ "xs:element": [
26
+ {
27
+ "$": {
28
+ "name": "NewDataSet";
29
+ "msdata:IsDataSet": "true";
30
+ "msdata:UseCurrentLocale": "true";
31
+ };
32
+ "xs:complexType": [
33
+ {
34
+ "xs:choice": [
35
+ {
36
+ "$": {
37
+ "minOccurs": "0";
38
+ "maxOccurs": "unbounded";
39
+ };
40
+ "xs:element": [
41
+ {
42
+ "$": {
43
+ "name": "InspectionInfo";
44
+ };
45
+ "xs:complexType": [
46
+ {
47
+ "xs:sequence": [
48
+ {
49
+ "xs:element": [
50
+ {
51
+ "$": {
52
+ "name": "serviceCode";
53
+ "type": "xs:unsignedByte";
54
+ "minOccurs": "0";
55
+ };
56
+ },
57
+ {
58
+ "$": {
59
+ "name": "startDateTime";
60
+ "type": "xs:dateTime";
61
+ "minOccurs": "0";
62
+ };
63
+ },
64
+ {
65
+ "$": {
66
+ "name": "endDateTime";
67
+ "type": "xs:dateTime";
68
+ "minOccurs": "0";
69
+ };
70
+ },
71
+ {
72
+ "$": {
73
+ "name": "strObstacleContents";
74
+ "type": "xs:string";
75
+ "minOccurs": "0";
76
+ };
77
+ }
78
+ ];
79
+ }
80
+ ];
81
+ }
82
+ ];
83
+ }
84
+ ];
85
+ }
86
+ ];
87
+ }
88
+ ];
89
+ }
90
+ ];
91
+ }
92
+ ];
93
+ "diffgr:diffgram": [
94
+ {
95
+ "$": {
96
+ "xmlns:msdata": "urn:schemas-microsoft-com:xml-msdata";
97
+ "xmlns:diffgr": "urn:schemas-microsoft-com:xml-diffgram-v1";
98
+ };
99
+ "NewDataSet": [
100
+ {
101
+ "$": {
102
+ "xmlns": "";
103
+ };
104
+ "InspectionInfo": [
105
+ {
106
+ "$": {
107
+ "diffgr:id": "InspectionInfo1";
108
+ "msdata:rowOrder": "0";
109
+ "diffgr:hasChanges": "inserted";
110
+ };
111
+ "serviceCode": [
112
+ string
113
+ ];
114
+ "startDateTime": [
115
+ string
116
+ ];
117
+ "endDateTime": [
118
+ string
119
+ ];
120
+ "strObstacleContents": [
121
+ string
122
+ ];
123
+ }
124
+ ];
125
+ }
126
+ ];
127
+ }
128
+ ];
129
+ }
130
+ ];
131
+ }
132
+ ];
133
+ }
134
+ ];
135
+ };
136
+ };
137
+ export type { InspectionInfoSoapBody };