maplestory-openapi
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -5,2 +5,3 @@ 'use strict'; | ||
var dayjs = require('dayjs'); | ||
var xml2js = require('xml2js'); | ||
@@ -11,2 +12,3 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs); | ||
var xml2js__default = /*#__PURE__*/_interopDefaultLegacy(xml2js); | ||
@@ -197,2 +199,31 @@ exports.PotentialOptionGrade = void 0; | ||
/** | ||
* 서버 점검 정보 | ||
*/ | ||
class InspectionInfoDto { | ||
/** | ||
* 서비스 코드 | ||
*/ | ||
serviceCode; | ||
/** | ||
* 점검 시작 시각 | ||
*/ | ||
startDateTime; | ||
/** | ||
* 점검 종료 시각 | ||
*/ | ||
endDateTime; | ||
/** | ||
* 점검 안내 제목 | ||
*/ | ||
strObstacleContents; | ||
constructor(obj) { | ||
const inspectionInfoTag = obj["soap:Envelope"]['soap:Body'][0]['GetInspectionInfoResponse'][0]['GetInspectionInfoResult'][0]['diffgr:diffgram'][0]['NewDataSet'][0]['InspectionInfo'][0]; | ||
this.serviceCode = Number(inspectionInfoTag.serviceCode[0]); | ||
this.startDateTime = new Date(inspectionInfoTag.startDateTime[0]); | ||
this.endDateTime = new Date(inspectionInfoTag.endDateTime[0]); | ||
this.strObstacleContents = inspectionInfoTag.strObstacleContents[0]; | ||
} | ||
} | ||
/** | ||
* MapleStory OpenAPI error.<br> | ||
@@ -279,2 +310,38 @@ * Please refer to <a href="https://developers.nexon.com/Maplestory/guides">MapleStory API guide</a> for the error details. | ||
} | ||
/** | ||
* 서버 점검 정보를 조회합니다. | ||
*/ | ||
async getInspectionInfo() { | ||
const xmlBuilder = new xml2js__default["default"].Builder(); | ||
const soapEnvelop = { | ||
'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/' | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
const baseUrl = 'https://api.maplestory.nexon.com/'; | ||
const path = 'soap/maplestory.asmx'; | ||
const headers = { | ||
'SOAPAction': 'https://api.maplestory.nexon.com/soap/GetInspectionInfo', | ||
'Content-Type': 'text/xml; charset=utf-8' | ||
}; | ||
const body = xmlBuilder.buildObject(soapEnvelop); | ||
const response = await axios__default["default"].post(path, body, { | ||
baseURL: baseUrl, | ||
timeout: this.timeout, | ||
headers, | ||
}); | ||
const xml = await xml2js__default["default"].parseStringPromise(response.data); | ||
return new InspectionInfoDto(xml); | ||
} | ||
buildHeaders() { | ||
@@ -290,4 +357,5 @@ return { | ||
exports.CubeResultOptionDto = CubeResultOptionDto; | ||
exports.InspectionInfoDto = InspectionInfoDto; | ||
exports.MapleStoryApi = MapleStoryApi; | ||
exports.MapleStoryApiError = MapleStoryApiError; | ||
exports.potentialOptionGradeFromString = potentialOptionGradeFromString; |
@@ -1,1 +0,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})); | ||
!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,a){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n,s=o(e),r=o(i),u=o(a);t.PotentialOptionGrade=void 0,(n=t.PotentialOptionGrade||(t.PotentialOptionGrade={}))[n.RARE=0]="RARE",n[n.EPIC=1]="EPIC",n[n.UNIQUE=2]="UNIQUE",n[n.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 c{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:s,miracle_time_flag:r,item_equip_part:u,item_level:l,target_item:c,potential_option_grade:d,additional_potential_option_grade:p,upgradeguarantee:h,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=s,this.miracleTimeFlag=r,this.itemEquipPart=u,this.itemLevel=l,this.targetItem=c,this.potentialOptionGrade=d,this.additionalPotentialOptionGrade=p,this.upgradeGuarantee=h,this.upgradeGuaranteeCount=m,this.beforePotentialOptions=g.map((t=>new f(t))),this.beforeAdditionalPotentialOptions=v.map((t=>new f(t))),this.afterPotentialOptions=$.map((t=>new f(t))),this.afterAdditionalPotentialOptions=O.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 d{count;cubeHistories;nextCursor;constructor(t){const{count:e,cube_histories:i,next_cursor:a}=t;this.count=e,this.cubeHistories=i.map((t=>new c(t))),this.nextCursor=a}}class p{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";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 m={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,s=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)},r=function(t,e){for(var a=s(t,e),n=[],r=0;r<a.length;r+=1){var u=a[r],l=u.type,f=u.value,c=i[l];c>=0&&(n[c]=parseInt(f,10))}var d=n[3],p=24===d?0:d,h=n[0]+"-"+n[1]+"-"+n[2]+" "+p+":"+n[4]+":"+n[5]+":000",m=+t;return(o.utc(h).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(),s=a.toLocaleString("en-US",{timeZone:t}),r=Math.round((a-new Date(s))/1e3/60),u=o(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(a.getTimezoneOffset()/15)-r,!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||o.tz.guess(),i=s(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=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(i,t,e).tz(this.$x.$timezone,!0)},o.tz=function(t,e,i){var a=i&&e,s=i||e||n,u=r(+o(),s);if("string"!=typeof t)return o(t).tz(s);var l=function(t,e,i){var a=t-60*e*1e3,o=r(a,i);if(e===o)return[a,e];var n=r(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,s),f=l[0],c=l[1],d=o(f).utcOffset(c);return d.$x.$timezone=s,d},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(t){n=t}})}(m);var g=m.exports,v={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 s=e.prototype;n.utc=function(t){return new e({date:t,utc:!0,args:arguments})},s.utc=function(t){var e=n(this.toDate(),{locale:this.$L,utc:!0});return t?e.add(this.utcOffset(),i):e},s.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var r=s.parse;s.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),r.call(this,t)};var u=s.init;s.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=s.utcOffset;s.utcOffset=function(t,e){var n=this.$utils().u;if(n(t))return this.$u?0:n(this.$offset)?l.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],s=60*+i[1]+ +i[2];return 0===s?0:"+"===n?s:-s}(t),null===t))return this;var s=Math.abs(t)<=16?60*t:t,r=this;if(e)return r.$offset=s,r.$u=0===t,r;if(0!==t){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(r=this.local().add(s+u,i)).$offset=s,r.$x.$localOffset=u}else r=this.utc();return r};var f=s.format;s.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,e)},s.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var c=s.toDate;s.toDate=function(t){return"s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var d=s.diff;s.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)}})}(v);var $=v.exports;r.default.extend(g),r.default.extend($);class O{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(O.kstOffset);a.date=n.format("YYYY-MM-DD")}else{const t=r.default().utcOffset(O.kstOffset);a.date=t.format("YYYY-MM-DD")}try{const t="openapi/maplestory/v1/cube-use-results",e=await s.default.get(t,{baseURL:O.baseUrl,timeout:this.timeout,headers:this.buildHeaders(),params:a});return new d(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 s.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 p(i)}buildHeaders(){return{authorization:this.apiKey}}}t.CubeHistoryDto=c,t.CubeHistoryResponseDto=d,t.CubeResultOptionDto=f,t.InspectionInfoDto=p,t.MapleStoryApi=O,t.MapleStoryApiError=h,t.potentialOptionGradeFromString=l})); |
{ | ||
"name": "maplestory-openapi", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "This JavaScript library enables the use of the MapleStory OpenAPI provided by Nexon.", | ||
"keywords": [ | ||
@@ -12,3 +13,2 @@ "maplestory", | ||
], | ||
"description": "This JavaScript library enables the use of the MapleStory OpenAPI provided by Nexon.", | ||
"homepage": "https://github.com/SpiralMoon/maplestory.openapi", | ||
@@ -49,3 +49,4 @@ "bugs": { | ||
"axios": "^1.6.0", | ||
"dayjs": "^1.11.10" | ||
"dayjs": "^1.11.10", | ||
"xml2js": "^0.6.2" | ||
}, | ||
@@ -55,2 +56,3 @@ "devDependencies": { | ||
"@rollup/plugin-node-resolve": "13.1.3", | ||
"@types/xml2js": "^0.4.14", | ||
"rollup": "2.66.1", | ||
@@ -57,0 +59,0 @@ "rollup-plugin-terser": "7.0.2", |
@@ -16,3 +16,3 @@ # MapleStory OpenAPI JavaScript Library | ||
```bash | ||
npm install maplestory-openapi@1.0.1 # Replace with the latest version | ||
npm install maplestory-openapi@1.1.0 # Replace with the latest version | ||
``` | ||
@@ -19,0 +19,0 @@ |
@@ -6,2 +6,3 @@ export * from './maplestory/api/mapleStoryApi'; | ||
export * from './maplestory/api/dto/cubeResultOptionDto'; | ||
export * from './maplestory/api/dto/inspectionInfoDto'; | ||
export * from './maplestory/api/dto/potentialOptionGrade'; |
import { CubeHistoryResponseDto } from "./dto/cubeHistoryResponseDto"; | ||
import { InspectionInfoDto } from "./dto/inspectionInfoDto"; | ||
declare class MapleStoryApi { | ||
@@ -34,2 +35,6 @@ private readonly apiKey; | ||
getCubeResult(count: number, cursor: string): Promise<CubeHistoryResponseDto>; | ||
/** | ||
* 서버 점검 정보를 조회합니다. | ||
*/ | ||
getInspectionInfo(): Promise<InspectionInfoDto>; | ||
private buildHeaders; | ||
@@ -36,0 +41,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60508
17
1131
3
10
+ Addedxml2js@^0.6.2
+ Addedsax@1.4.1(transitive)
+ Addedxml2js@0.6.2(transitive)
+ Addedxmlbuilder@11.0.1(transitive)