@taazkareem/clickup-mcp-server
Version:
ClickUp MCP Server - Powering AI Agents with full ClickUp task, document, and chat management capabilities.
1 lines • 9.99 kB
JavaScript
function a0_0x4b39(_0x2122f1,_0x2ae428){_0x2122f1=_0x2122f1-0xed;const _0xe2ce10=a0_0xe2ce();let _0x4b39c6=_0xe2ce10[_0x2122f1];if(a0_0x4b39['JKfPfa']===undefined){var _0x2a79c1=function(_0x2b9612){const _0x900aac='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x30190e='',_0x2ed741='';for(let _0x549aec=0x0,_0x25b814,_0x2bef57,_0x161892=0x0;_0x2bef57=_0x2b9612['charAt'](_0x161892++);~_0x2bef57&&(_0x25b814=_0x549aec%0x4?_0x25b814*0x40+_0x2bef57:_0x2bef57,_0x549aec++%0x4)?_0x30190e+=String['fromCharCode'](0xff&_0x25b814>>(-0x2*_0x549aec&0x6)):0x0){_0x2bef57=_0x900aac['indexOf'](_0x2bef57);}for(let _0x2e4388=0x0,_0x2a0348=_0x30190e['length'];_0x2e4388<_0x2a0348;_0x2e4388++){_0x2ed741+='%'+('00'+_0x30190e['charCodeAt'](_0x2e4388)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2ed741);};a0_0x4b39['CFEIlP']=_0x2a79c1,a0_0x4b39['plbOaw']={},a0_0x4b39['JKfPfa']=!![];}const _0x39e2e1=_0xe2ce10[0x0],_0x5b7b14=_0x2122f1+_0x39e2e1,_0x145dbb=a0_0x4b39['plbOaw'][_0x5b7b14];return!_0x145dbb?(_0x4b39c6=a0_0x4b39['CFEIlP'](_0x4b39c6),a0_0x4b39['plbOaw'][_0x5b7b14]=_0x4b39c6):_0x4b39c6=_0x145dbb,_0x4b39c6;}const a0_0x235a06=a0_0x4b39;(function(_0x1b6e8f,_0x2a1a44){const _0x2ad9d0=a0_0x4b39,_0x301551=_0x1b6e8f();while(!![]){try{const _0x5ca3bb=parseInt(_0x2ad9d0(0xf7))/0x1*(parseInt(_0x2ad9d0(0x108))/0x2)+parseInt(_0x2ad9d0(0xf5))/0x3*(parseInt(_0x2ad9d0(0x11d))/0x4)+parseInt(_0x2ad9d0(0x10f))/0x5+parseInt(_0x2ad9d0(0xee))/0x6+-parseInt(_0x2ad9d0(0x104))/0x7+-parseInt(_0x2ad9d0(0x117))/0x8+-parseInt(_0x2ad9d0(0xff))/0x9*(parseInt(_0x2ad9d0(0x131))/0xa);if(_0x5ca3bb===_0x2a1a44)break;else _0x301551['push'](_0x301551['shift']());}catch(_0x345510){_0x301551['push'](_0x301551['shift']());}}}(a0_0xe2ce,0x9acb2));import{BaseClickUpService,ClickUpServiceError,ErrorCode}from'./base.js';export class DocumentService extends BaseClickUpService{constructor(_0x2ff458,_0x4c3d9d,_0x3ae974,_0x3e530c){const _0x2aeb26=a0_0x4b39,_0x356794={'SRPzk':function(_0x159a06,_0x26aaa3){return _0x159a06||_0x26aaa3;}};super(_0x2ff458,_0x4c3d9d,_0x356794['SRPzk'](_0x3ae974,'https'+_0x2aeb26(0x125)+_0x2aeb26(0x136)+_0x2aeb26(0x135)+'com/a'+'pi/v3'),_0x3e530c);}[a0_0x235a06(0x138)+a0_0x235a06(0x142)+'r'](_0x1500c6,_0x2c8278){const _0x30fdd5=a0_0x235a06;if(_0x1500c6 instanceof ClickUpServiceError)return _0x1500c6;return new ClickUpServiceError(_0x2c8278||'Docum'+_0x30fdd5(0x124)+_0x30fdd5(0x13c)+'e\x20err'+_0x30fdd5(0x11a)+_0x1500c6['messa'+'ge'],ErrorCode[_0x30fdd5(0x134)+'WN'],_0x1500c6);}async[a0_0x235a06(0xf0)+a0_0x235a06(0x14f)+a0_0x235a06(0x113)](_0x171822){const _0x5d58f2=a0_0x235a06,_0x427ca4={'Gwkdz':_0x5d58f2(0x121)+_0x5d58f2(0x103)+_0x5d58f2(0x14e)+_0x5d58f2(0x10a)+_0x5d58f2(0x140)+'ta:','QzCJk':_0x5d58f2(0x132)+'TE','oghqn':'Faile'+'d\x20to\x20'+_0x5d58f2(0xf0)+_0x5d58f2(0x10b)+_0x5d58f2(0x112)};try{this['logOp'+'erati'+'on'](_0x427ca4[_0x5d58f2(0x101)],{'data':_0x171822});const _0x4cecee=await this['clien'+'t']['post']('/work'+_0x5d58f2(0x10e)+'s/'+this[_0x5d58f2(0x12f)+'d']+'/docs',{'name':_0x171822[_0x5d58f2(0x14a)],'parent':_0x171822[_0x5d58f2(0xf1)+'t'],'visibility':_0x171822[_0x5d58f2(0x107)+'ility']||_0x427ca4[_0x5d58f2(0x137)],'create_page':_0x171822['creat'+_0x5d58f2(0x116)+'e']!==undefined?_0x171822[_0x5d58f2(0xf0)+'e_pag'+'e']:!![]});return _0x4cecee[_0x5d58f2(0x11f)];}catch(_0x122625){throw this['handl'+'eErro'+'r'](_0x122625,_0x427ca4[_0x5d58f2(0x146)]);}}async[a0_0x235a06(0xf0)+a0_0x235a06(0x12d)](_0x5ae0d4,_0x178dd1){const _0x378e01=a0_0x235a06;try{this['logOp'+'erati'+'on'](_0x378e01(0x121)+_0x378e01(0xf4)+_0x378e01(0x145)+_0x378e01(0x13e)+_0x378e01(0x112)+_0x378e01(0x11b)+_0x378e01(0x11e)+':',{'documentId':_0x5ae0d4,'data':_0x178dd1});const _0x4544f2=await this[_0x378e01(0x111)+'t'][_0x378e01(0xfb)](_0x378e01(0x11c)+_0x378e01(0x10e)+'s/'+this['teamI'+'d']+('/docs'+'/')+_0x5ae0d4+('/page'+'s'),_0x178dd1);return _0x4544f2['data'];}catch(_0x5a480e){throw this[_0x378e01(0x138)+_0x378e01(0x142)+'r'](_0x5a480e,_0x378e01(0x149)+_0x378e01(0x129)+_0x378e01(0xf0)+_0x378e01(0x127)+_0x378e01(0x100)+_0x378e01(0x123)+'ent\x20'+_0x5ae0d4);}}async['getDo'+a0_0x235a06(0x150)+'t'](_0x42cc4f){const _0x516c2a=a0_0x235a06;try{this['logOp'+_0x516c2a(0x128)+'on']('Getti'+'ng\x20do'+_0x516c2a(0x150)+_0x516c2a(0x122)+_0x516c2a(0x148),{'documentId':_0x42cc4f});const _0x21daed=await this[_0x516c2a(0x111)+'t'][_0x516c2a(0x126)](_0x516c2a(0x11c)+_0x516c2a(0x10e)+'s/'+this[_0x516c2a(0x12f)+'d']+('/docs'+'/')+_0x42cc4f);return _0x21daed[_0x516c2a(0x11f)];}catch(_0x27e2f1){throw this['handl'+'eErro'+'r'](_0x27e2f1,'Faile'+'d\x20to\x20'+_0x516c2a(0xf3)+_0x516c2a(0x14e)+'nt\x20'+_0x42cc4f);}}async['listD'+a0_0x235a06(0x14e)+a0_0x235a06(0xf8)](_0x139eb6={}){const _0x411b00=a0_0x235a06,_0x84893e={'NGLuw':_0x411b00(0x149)+_0x411b00(0x129)+'list\x20'+_0x411b00(0x123)+'ents'};try{this[_0x411b00(0x10c)+_0x411b00(0x128)+'on']('Listi'+_0x411b00(0x109)+_0x411b00(0x150)+_0x411b00(0x12a)+_0x411b00(0x147)+_0x411b00(0x144)+':',{'options':_0x139eb6});const _0x43b06d=await this[_0x411b00(0x111)+'t'][_0x411b00(0x126)](_0x411b00(0x11c)+'space'+'s/'+this['teamI'+'d']+_0x411b00(0x13d),{'params':_0x139eb6});return _0x43b06d[_0x411b00(0x11f)];}catch(_0x3100d6){throw this[_0x411b00(0x138)+_0x411b00(0x142)+'r'](_0x3100d6,_0x84893e['NGLuw']);}}async[a0_0x235a06(0x12c)+a0_0x235a06(0x14e)+a0_0x235a06(0xf2)+'es'](_0x2406ba,_0x2b270e={}){const _0x3b4d04=a0_0x235a06,_0x5b6fcc={'sTXsm':_0x3b4d04(0x133)+_0x3b4d04(0x130)+_0x3b4d04(0xef)+_0x3b4d04(0x13a)+_0x3b4d04(0x150)+'t\x20wit'+_0x3b4d04(0x148)};try{this[_0x3b4d04(0x10c)+_0x3b4d04(0x128)+'on'](_0x5b6fcc['sTXsm'],{'documentId':_0x2406ba,'options':_0x2b270e});const _0x5e5a7f=await this[_0x3b4d04(0x111)+'t'][_0x3b4d04(0x126)]('/work'+_0x3b4d04(0x10e)+'s/'+this[_0x3b4d04(0x12f)+'d']+(_0x3b4d04(0x13d)+'/')+_0x2406ba+(_0x3b4d04(0x141)+'Listi'+'ng'),{'params':_0x2b270e});return _0x5e5a7f[_0x3b4d04(0x11f)];}catch(_0xd18e64){throw this[_0x3b4d04(0x138)+_0x3b4d04(0x142)+'r'](_0xd18e64,'Faile'+_0x3b4d04(0x129)+'list\x20'+_0x3b4d04(0x102)+_0x3b4d04(0xfe)+_0x3b4d04(0x123)+_0x3b4d04(0x10d)+_0x2406ba);}}async['getDo'+a0_0x235a06(0x150)+a0_0x235a06(0x115)+'s'](_0x3cd269,_0x1ecfc8,_0x53e09f={}){const _0x2c1403=a0_0x235a06,_0x40bd01={'LIfHs':_0x2c1403(0x110)+_0x2c1403(0x130)+_0x2c1403(0xef)+'or\x20do'+_0x2c1403(0x150)+_0x2c1403(0x122)+_0x2c1403(0x148)};try{this[_0x2c1403(0x10c)+_0x2c1403(0x128)+'on'](_0x40bd01[_0x2c1403(0x14b)],{'documentId':_0x3cd269,'pageIds':_0x1ecfc8,'options':_0x53e09f});const _0x47fb71=_0x1ecfc8[_0x2c1403(0x120)](_0x4ddc9d=>this['clien'+'t']['get'](_0x2c1403(0x11c)+_0x2c1403(0x10e)+'s/'+this[_0x2c1403(0x12f)+'d']+('/docs'+'/')+_0x3cd269+('/page'+'s/')+_0x4ddc9d,{'params':_0x53e09f})),_0x378387=await Promise[_0x2c1403(0x105)](_0x47fb71),_0x1e6e08=_0x378387[_0x2c1403(0x120)](_0x53012e=>_0x53012e[_0x2c1403(0x11f)]);return{'pages':_0x1e6e08};}catch(_0xc0aeb7){throw this[_0x2c1403(0x138)+_0x2c1403(0x142)+'r'](_0xc0aeb7,_0x2c1403(0x149)+'d\x20to\x20'+'get\x20p'+_0x2c1403(0x114)+_0x2c1403(0x143)+_0x2c1403(0x14e)+_0x2c1403(0xf6)+_0x3cd269);}}async['getDo'+a0_0x235a06(0x150)+a0_0x235a06(0x115)](_0x5519f5,_0xad63c3,_0x3fae49={}){const _0x36d85f=a0_0x235a06;try{this[_0x36d85f(0x10c)+_0x36d85f(0x128)+'on'](_0x36d85f(0x110)+_0x36d85f(0xf9)+_0x36d85f(0x119)+_0x36d85f(0x118)+_0x36d85f(0x143)+_0x36d85f(0x14e)+'nt:',{'documentId':_0x5519f5,'pageId':_0xad63c3,'options':_0x3fae49});const _0x1b8507=await this[_0x36d85f(0x111)+'t'][_0x36d85f(0x126)]('/work'+'space'+'s/'+this[_0x36d85f(0x12f)+'d']+(_0x36d85f(0x13d)+'/')+_0x5519f5+(_0x36d85f(0x141)+'s/')+_0xad63c3,{'params':_0x3fae49});return _0x1b8507[_0x36d85f(0x11f)];}catch(_0x773d00){throw this[_0x36d85f(0x138)+'eErro'+'r'](_0x773d00,_0x36d85f(0x149)+_0x36d85f(0x129)+'get\x20p'+_0x36d85f(0x14c)+_0xad63c3+(_0x36d85f(0xfe)+_0x36d85f(0x123)+_0x36d85f(0x10d))+_0x5519f5);}}async['updat'+a0_0x235a06(0x12d)](_0x446b48,_0xc62719,_0x30c5c1){const _0x5a7424=a0_0x235a06;try{this[_0x5a7424(0x10c)+_0x5a7424(0x128)+'on']('Updat'+_0x5a7424(0xf4)+_0x5a7424(0x145)+_0x5a7424(0x13e)+'ument'+_0x5a7424(0x11b)+_0x5a7424(0xfc),{'documentId':_0x446b48,'pageId':_0xc62719,'data':_0x30c5c1});const _0xc8d4fc=await this[_0x5a7424(0x111)+'t'][_0x5a7424(0x13f)](_0x5a7424(0x11c)+_0x5a7424(0x10e)+'s/'+this[_0x5a7424(0x12f)+'d']+(_0x5a7424(0x13d)+'/')+_0x446b48+(_0x5a7424(0x141)+'s/')+_0xc62719,{..._0x30c5c1,'content_format':_0x30c5c1[_0x5a7424(0x14d)+_0x5a7424(0xfa)+_0x5a7424(0x12e)]||_0x5a7424(0xed)+'md','content_edit_mode':_0x30c5c1['conte'+_0x5a7424(0x12b)+_0x5a7424(0x106)+'de']||_0x5a7424(0x139)+'d'});return _0xc8d4fc[_0x5a7424(0x11f)];}catch(_0x44b261){throw this[_0x5a7424(0x138)+_0x5a7424(0x142)+'r'](_0x44b261,_0x5a7424(0x149)+'d\x20to\x20'+_0x5a7424(0xfd)+'e\x20pag'+'e\x20'+_0xc62719+(_0x5a7424(0x13b)+_0x5a7424(0x14e)+_0x5a7424(0xf6))+_0x446b48);}}}function a0_0xe2ce(){const _0x55054f=['DfbHz2u','zv9WywC','oduWntq0AMXXEeTv','CgfNzsa','BMDSzsa','B3i6ia','ihDPDgG','l3DVCMS','oda2mg1SrNDPwG','igrHDge','zgf0yq','BwfW','q3jLyxq','Dcb3Axq','zg9JDw0','zw50ihm','oI8Vyxa','z2v0','zsbWywC','zxjHDgK','zcb0BYa','DhmGD2K','BNrFzwq','BgLZDeq','zvbHz2u','CM1HDa','DgvHBuK','BMCGCge','mtbzreLZq0u','ufjjvKe','tgLZDgK','vu5ltK8','y2T1Cc4','As5JBgK','uxPdsMS','AgfUzgW','yxbWzw4','B3iGzg8','igLUigq','zxj2Awm','l2rVy3m','BIbKB2m','Chv0','DgGGzge','l3bHz2u','zuvYCM8','zM9Yigq','DgLVBNm','ywDLigK','B2DOCw4','DgGGB3a','AcbjrdO','rMfPBgu','BMfTzq','teLMshm','ywDLia','y29UDgu','B2n1Bwu','zurVy3u','y3vTzw4','Dgv4Dc8','nteWmtu1nermzhzYvW','z2vZigy','y3jLyxq','CgfYzw4','BNrqywC','z2v0igq','Aw5Niha','mtmYowTNDLfPBq','BNqG','otGZntL2rwT2y1a','BNrZ','BMCGC2K','BNrFzM8','Cg9ZDa','ieLeoG','DxbKyxq','igzVCIa','nJG2ode3mgnUDgnZyG','zsbPBIa','r3DRzhO','CgfNzxm','Aw5Nigq','nZC4nZG1n3L5rvHhDG','ywXS','AxrFBw8','DMLZAwi','mtjrDLzPq1y','BMCGzg8','BNqGD2K','zsbKB2m','Bg9Nt3a','zw50ia','C3bHy2u','mtqXndG3nwzgyNvAvW','r2v0DgK','y2XPzw4','Dw1LBNq','BwvUDa','ywDLCYa'];a0_0xe2ce=function(){return _0x55054f;};return a0_0xe2ce();}