017741cbe969b4c80cc781ced4d031c59011c7ea
[motion-next.git] / server / api / attachment / attachment.rpc.js
1 const a31_0x4dc9=['stringify','message','catch','rpc','options','info','../../config/logger','body','then','CreateAttachment','error','debug'];(function(_0x4b84a0,_0x4dc9d6){const _0x214c71=function(_0x503e2a){while(--_0x503e2a){_0x4b84a0['push'](_0x4b84a0['shift']());}};_0x214c71(++_0x4dc9d6);}(a31_0x4dc9,0x15f));const a31_0x214c=function(_0x4b84a0,_0x4dc9d6){_0x4b84a0=_0x4b84a0-0x0;let _0x214c71=a31_0x4dc9[_0x4b84a0];return _0x214c71;};const _0x25a584=a31_0x214c;'use strict';const db=require('../../mysqldb')['db'],logger=require(_0x25a584('0x3'))(_0x25a584('0x0'));exports[_0x25a584('0x6')]=function(_0x503e2a){const _0x1f7fbf=this;return new Promise(function(_0x35be5d,_0x3cca40){const _0x367bce=a31_0x214c;return db['Attachment']['create'](_0x503e2a[_0x367bce('0x4')],{'raw':_0x503e2a[_0x367bce('0x1')]?_0x503e2a['options']['raw']===undefined?!![]:![]:!![]})[_0x367bce('0x5')](function(_0xd9a8a4){const _0x46ed3d=_0x367bce;logger[_0x46ed3d('0x2')](_0x46ed3d('0x6'),_0x503e2a),logger[_0x46ed3d('0x8')](_0x46ed3d('0x6'),_0x503e2a,JSON[_0x46ed3d('0x9')](_0xd9a8a4)),_0x35be5d(_0xd9a8a4);})[_0x367bce('0xb')](function(_0x4a3ecf){const _0x1a43f1=_0x367bce;logger[_0x1a43f1('0x7')](_0x1a43f1('0x6'),_0x4a3ecf[_0x1a43f1('0xa')],_0x503e2a),_0x3cca40(_0x1f7fbf[_0x1a43f1('0x7')](0x1f4,_0x4a3ecf['message']));});});};