@k-table/next 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/fs.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';const _0x3f0497=_0x19c8;(function(_0x42ce21,_0x2acbc2){const _0x319a7a=_0x19c8,_0x2dc75a=_0x42ce21();while(!![]){try{const _0x1e742a=parseInt(_0x319a7a(0x1ba))/0x1+parseInt(_0x319a7a(0x1c0))/0x2*(-parseInt(_0x319a7a(0x1cd))/0x3)+-parseInt(_0x319a7a(0x1d5))/0x4+parseInt(_0x319a7a(0x1c2))/0x5*(-parseInt(_0x319a7a(0x1e7))/0x6)+-parseInt(_0x319a7a(0x1f5))/0x7+parseInt(_0x319a7a(0x1d9))/0x8*(-parseInt(_0x319a7a(0x1fb))/0x9)+parseInt(_0x319a7a(0x1c7))/0xa;if(_0x1e742a===_0x2acbc2)break;else _0x2dc75a['push'](_0x2dc75a['shift']());}catch(_0x2ffc99){_0x2dc75a['push'](_0x2dc75a['shift']());}}}(_0x5968,0x60bef));function _0x19c8(_0x84ef4a,_0x49a2cc){_0x84ef4a=_0x84ef4a-0x1b6;const _0x596815=_0x5968();let _0x19c808=_0x596815[_0x84ef4a];if(_0x19c8['XUBJWa']===undefined){var _0x258982=function(_0x49b6ae){const _0x244c73='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x32abe5='',_0x5957c8='';for(let _0x17b2f9=0x0,_0x28c070,_0x54331b,_0x4a7a1c=0x0;_0x54331b=_0x49b6ae['charAt'](_0x4a7a1c++);~_0x54331b&&(_0x28c070=_0x17b2f9%0x4?_0x28c070*0x40+_0x54331b:_0x54331b,_0x17b2f9++%0x4)?_0x32abe5+=String['fromCharCode'](0xff&_0x28c070>>(-0x2*_0x17b2f9&0x6)):0x0){_0x54331b=_0x244c73['indexOf'](_0x54331b);}for(let _0x4d9a12=0x0,_0x4fb02d=_0x32abe5['length'];_0x4d9a12<_0x4fb02d;_0x4d9a12++){_0x5957c8+='%'+('00'+_0x32abe5['charCodeAt'](_0x4d9a12)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5957c8);};_0x19c8['WBpQET']=_0x258982,_0x19c8['vpaLad']={},_0x19c8['XUBJWa']=!![];}const _0x26d169=_0x596815[0x0];_0x19c8['ufltcu']!==_0x26d169&&(_0x19c8['vpaLad']={},_0x19c8['ufltcu']=_0x26d169);const _0x2f01cc=_0x19c8['vpaLad'][_0x84ef4a];return _0x2f01cc===undefined?(_0x19c808=_0x19c8['WBpQET'](_0x19c808),_0x19c8['vpaLad'][_0x84ef4a]=_0x19c808):_0x19c808=_0x2f01cc,_0x19c808;}var fs=require('fs'),path=require(_0x3f0497(0x1f4)),store=require(_0x3f0497(0x1de)),crypto=require('crypto');function resolveRoot(_0x5957c8,_0x17b2f9=process[_0x3f0497(0x20e)]()){const _0x195069=_0x3f0497,_0x28c070=path[_0x195069(0x1f9)](_0x5957c8)?_0x5957c8:path[_0x195069(0x1c4)](_0x17b2f9,_0x5957c8);return fs[_0x195069(0x20a)](_0x28c070,{'recursive':!![]}),_0x28c070;}function artifactDir(_0x54331b,_0x4a7a1c){return path['join'](_0x54331b,_0x4a7a1c);}function objectPath(_0x4d9a12,_0x4fb02d){const _0x3b332f=_0x3f0497;return path[_0x3b332f(0x1bb)](_0x4d9a12,_0x3b332f(0x1d1),_0x4fb02d[_0x3b332f(0x206)](0x0,0x2),_0x4fb02d);}function itemDir(_0xc2a8c8,_0x20f01d,_0x230803){const _0x6223be=_0x3f0497;return path['join'](_0xc2a8c8,_0x6223be(0x201),_0x20f01d,_0x230803);}function newEtag(){const _0x1f86f9=_0x3f0497;return Date['now']()[_0x1f86f9(0x1e5)](0x24)+'-'+Math[_0x1f86f9(0x1f6)]()[_0x1f86f9(0x1e5)](0x24)[_0x1f86f9(0x206)](0x2,0x8);}function readEtag(_0x20d698){const _0x4b6d68=_0x3f0497,_0x3f8565=path['join'](_0x20d698,_0x4b6d68(0x1fd));return fs[_0x4b6d68(0x1fe)](_0x3f8565)?fs[_0x4b6d68(0x1bd)](_0x3f8565,_0x4b6d68(0x1df))[_0x4b6d68(0x1eb)]():void 0x0;}function writeArtifactDir(_0x2f98d7,_0x33fbd6,_0x4066f0){const _0x23005a=_0x3f0497;fs['mkdirSync'](path[_0x23005a(0x1bb)](_0x2f98d7,_0x23005a(0x1db)),{'recursive':!![]});const _0x4801c6=store['artifactToFiles'](_0x33fbd6);fs[_0x23005a(0x1e0)](path[_0x23005a(0x1bb)](_0x2f98d7,store[_0x23005a(0x1c1)]),_0x4801c6[store[_0x23005a(0x1c1)]]??'{}',_0x23005a(0x1df)),fs[_0x23005a(0x1e0)](path[_0x23005a(0x1bb)](_0x2f98d7,store[_0x23005a(0x204)]),_0x4801c6[store[_0x23005a(0x204)]]??'',_0x23005a(0x1df));const _0x2b82ca=path[_0x23005a(0x1bb)](_0x2f98d7,store[_0x23005a(0x1d7)]),_0x1ec8b0=path[_0x23005a(0x1bb)](_0x2f98d7,store[_0x23005a(0x1ff)]);if(_0x4801c6[store[_0x23005a(0x1d7)]])fs[_0x23005a(0x1e0)](_0x2b82ca,_0x4801c6[store['ARTIFACT_FILE_FILL']],_0x23005a(0x1df));else{if(fs[_0x23005a(0x1fe)](_0x2b82ca))fs['rmSync'](_0x2b82ca);}if(_0x4801c6[store[_0x23005a(0x1ff)]])fs[_0x23005a(0x1e0)](_0x1ec8b0,_0x4801c6[store[_0x23005a(0x1ff)]],_0x23005a(0x1df));else{if(fs['existsSync'](_0x1ec8b0))fs['rmSync'](_0x1ec8b0);}fs[_0x23005a(0x1e0)](path[_0x23005a(0x1bb)](_0x2f98d7,_0x23005a(0x1fd)),_0x4066f0,_0x23005a(0x1df));}function readArtifactDir(_0x236e36,_0x21b417){const _0x3bbb91=_0x3f0497,_0x2e3475={},_0xfadec0=path[_0x3bbb91(0x1bb)](_0x236e36,store[_0x3bbb91(0x1c1)]),_0x19565b=path[_0x3bbb91(0x1bb)](_0x236e36,store[_0x3bbb91(0x204)]);if(fs[_0x3bbb91(0x1fe)](_0xfadec0))_0x2e3475[store['ARTIFACT_FILE_META']]=fs[_0x3bbb91(0x1bd)](_0xfadec0,_0x3bbb91(0x1df));if(fs[_0x3bbb91(0x1fe)](_0x19565b))_0x2e3475[store['ARTIFACT_FILE_BODY']]=fs[_0x3bbb91(0x1bd)](_0x19565b,_0x3bbb91(0x1df));const _0x17c60d=path[_0x3bbb91(0x1bb)](_0x236e36,store['ARTIFACT_FILE_FILL']),_0x32d214=path['join'](_0x236e36,store[_0x3bbb91(0x1ff)]);if(fs[_0x3bbb91(0x1fe)](_0x17c60d))_0x2e3475[store['ARTIFACT_FILE_FILL']]=fs[_0x3bbb91(0x1bd)](_0x17c60d,_0x3bbb91(0x1df));if(fs[_0x3bbb91(0x1fe)](_0x32d214))_0x2e3475[store[_0x3bbb91(0x1ff)]]=fs[_0x3bbb91(0x1bd)](_0x32d214,'utf8');return{...store[_0x3bbb91(0x1d0)](_0x2e3475,_0x21b417),'etag':readEtag(_0x236e36)};}function createFsArtifactStore(_0x4e1c5f,_0x47b08d=[]){const _0x54d846=_0x3f0497;fs[_0x54d846(0x20a)](_0x4e1c5f,{'recursive':!![]});for(const _0x19d711 of _0x47b08d){const _0x3ffcee=artifactDir(_0x4e1c5f,_0x19d711['id']),_0x5a807b=path[_0x54d846(0x1bb)](_0x3ffcee,store['ARTIFACT_FILE_BODY']);if(!fs[_0x54d846(0x1fe)](_0x5a807b))writeArtifactDir(_0x3ffcee,_0x19d711,_0x19d711['etag']??newEtag());}return{async 'list'(_0x5f21f2){const _0x4f0d92=_0x54d846;if(!fs[_0x4f0d92(0x1fe)](_0x4e1c5f))return[];const _0x357dec=[];for(const _0x7eabc3 of fs['readdirSync'](_0x4e1c5f,{'withFileTypes':!![]})){if(!_0x7eabc3[_0x4f0d92(0x209)]())continue;try{const _0x58dd95=readArtifactDir(artifactDir(_0x4e1c5f,_0x7eabc3[_0x4f0d92(0x1ea)]),_0x7eabc3[_0x4f0d92(0x1ea)]);if(!_0x5f21f2||_0x58dd95[_0x4f0d92(0x20b)]===_0x5f21f2)_0x357dec[_0x4f0d92(0x1f7)]({'id':_0x58dd95['id'],'name':_0x58dd95[_0x4f0d92(0x1ea)],'kind':_0x58dd95[_0x4f0d92(0x20b)]});}catch{}}return _0x357dec;},async 'get'(_0x208079){const _0x598d8c=_0x54d846,_0x2c685e=artifactDir(_0x4e1c5f,_0x208079);if(!fs['existsSync'](_0x2c685e))throw new store[(_0x598d8c(0x1fa))](_0x598d8c(0x1d4)+_0x208079);return readArtifactDir(_0x2c685e,_0x208079);},async 'save'(_0x2c06a9){const _0x235cff=_0x54d846,_0x4cd12d=artifactDir(_0x4e1c5f,_0x2c06a9['id']),_0x456776=fs[_0x235cff(0x1fe)](_0x4cd12d)?readArtifactDir(_0x4cd12d,_0x2c06a9['id']):void 0x0;if(_0x2c06a9['etag']&&_0x456776?.['etag']&&_0x2c06a9[_0x235cff(0x1e3)]!==_0x456776['etag'])throw new store[(_0x235cff(0x208))](_0x235cff(0x1e6),_0x456776);const _0x4c5bc2=newEtag();return writeArtifactDir(_0x4cd12d,_0x2c06a9,_0x4c5bc2),{..._0x2c06a9,'etag':_0x4c5bc2};},async 'create'(_0x16dd3d){const _0x1f578c=_0x54d846,_0x1636d6=_0x16dd3d[_0x1f578c(0x20b)]+'-'+Math[_0x1f578c(0x1f6)]()[_0x1f578c(0x1e5)](0x24)[_0x1f578c(0x206)](0x2,0xa),_0x276765={'id':_0x1636d6,'name':_0x16dd3d[_0x1f578c(0x1ea)],'kind':_0x16dd3d[_0x1f578c(0x20b)],'ktl':store[_0x1f578c(0x1b9)]};return this[_0x1f578c(0x1e9)](_0x276765);},async 'remove'(_0x5d2994){const _0x3a9dc1=_0x54d846,_0x25cf61=artifactDir(_0x4e1c5f,_0x5d2994);if(!fs[_0x3a9dc1(0x1fe)](_0x25cf61))throw new store['KtNotFoundError']('artifact\x20'+_0x5d2994);fs['rmSync'](_0x25cf61,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x4c2225,_0x5ec070={}){const _0x5f1cbe=_0x3f0497;fs[_0x5f1cbe(0x20a)](_0x4c2225,{'recursive':!![]});const _0x197b17=_0x2f7a8f=>path[_0x5f1cbe(0x1bb)](_0x4c2225,_0x2f7a8f+_0x5f1cbe(0x20c));for(const [_0x3424a2,_0xf4be68]of Object['entries'](_0x5ec070)){if(!fs['existsSync'](_0x197b17(_0x3424a2)))fs[_0x5f1cbe(0x1e0)](_0x197b17(_0x3424a2),JSON[_0x5f1cbe(0x1be)](_0xf4be68,null,0x2),'utf8');}return{async 'get'(_0x287e72){const _0x22fbf1=_0x5f1cbe,_0x44d0d2=_0x197b17(_0x287e72);if(!fs[_0x22fbf1(0x1fe)](_0x44d0d2))throw new store[(_0x22fbf1(0x1fa))]('instance\x20'+_0x287e72);return JSON['parse'](fs[_0x22fbf1(0x1bd)](_0x44d0d2,_0x22fbf1(0x1df)));},async 'save'(_0x1addad,_0x5e8a3c){const _0xde9d49=_0x5f1cbe,_0x476360=_0x197b17(_0x1addad),_0x56223c=fs['existsSync'](_0x476360)?JSON[_0xde9d49(0x207)](fs[_0xde9d49(0x1bd)](_0x476360,_0xde9d49(0x1df))):{'artifactId':'','values':{}},_0x2aa4cc={'artifactId':_0x56223c['artifactId'],'values':{..._0x56223c[_0xde9d49(0x1f1)],..._0x5e8a3c[_0xde9d49(0x1f1)]},'common':{..._0x56223c['common'],..._0x5e8a3c[_0xde9d49(0x1c8)]},'tabCommon':{..._0x56223c['tabCommon'],..._0x5e8a3c['tabCommon']}};fs[_0xde9d49(0x1e0)](_0x476360,JSON[_0xde9d49(0x1be)](_0x2aa4cc,null,0x2),_0xde9d49(0x1df));},async 'list'(_0x3e9cd4){const _0x4dddbe=_0x5f1cbe;return fs[_0x4dddbe(0x1f2)](_0x4c2225)['filter'](_0x2399a4=>_0x2399a4[_0x4dddbe(0x203)](_0x4dddbe(0x20c)))[_0x4dddbe(0x1d2)](_0x2f4410=>{const _0xd3995f=_0x4dddbe,_0x4ac663=_0x2f4410['slice'](0x0,-0x5),_0x1d2cb3=JSON[_0xd3995f(0x207)](fs[_0xd3995f(0x1bd)](path[_0xd3995f(0x1bb)](_0x4c2225,_0x2f4410),'utf8'));return{'id':_0x4ac663,'artifactId':_0x1d2cb3[_0xd3995f(0x1da)]};})[_0x4dddbe(0x1b7)](_0x251f59=>!_0x3e9cd4||_0x251f59[_0x4dddbe(0x1da)]===_0x3e9cd4);},async 'create'(_0x3fde7f){const _0x122ca2=_0x5f1cbe,_0x15fcc2=_0x122ca2(0x1f8)+Math[_0x122ca2(0x1f6)]()[_0x122ca2(0x1e5)](0x24)[_0x122ca2(0x206)](0x2,0xa);return fs[_0x122ca2(0x1e0)](_0x197b17(_0x15fcc2),JSON[_0x122ca2(0x1be)]({'artifactId':_0x3fde7f[_0x122ca2(0x1da)],'values':{},'common':{}},null,0x2),_0x122ca2(0x1df)),{'id':_0x15fcc2};}};}function sha256Hex(_0x38a9a6){const _0x553f35=_0x3f0497,_0x36ae97=typeof _0x38a9a6===_0x553f35(0x1cb)?Buffer['from'](_0x38a9a6,'utf8'):Buffer[_0x553f35(0x1dd)](_0x38a9a6);return crypto[_0x553f35(0x1b6)]('sha256')[_0x553f35(0x1e4)](_0x36ae97)[_0x553f35(0x1dc)](_0x553f35(0x1c9));}function writeObject(_0x5e5e66,_0xe07eba){const _0x4bd87c=_0x3f0497,_0x308e78=sha256Hex(_0xe07eba),_0x559eb5=objectPath(_0x5e5e66,_0x308e78);fs[_0x4bd87c(0x20a)](path[_0x4bd87c(0x200)](_0x559eb5),{'recursive':!![]});if(!fs[_0x4bd87c(0x1fe)](_0x559eb5))fs[_0x4bd87c(0x1e0)](_0x559eb5,_0xe07eba);return _0x308e78;}function _0x5968(){const _0x313f63=['zMfJzxm','zgLNzxn0','zNjVBq','qgSTDgfIBguVCMvWB3j0l3n0B3jL','DxrMoa','D3jPDgvgAwXLu3LUyW','y29TBwL0','z2v0rNvSBfLLyxi','zxrHzW','DxbKyxrL','Dg9tDhjPBMC','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','mJC0mJm2nNjrvgHKqW','z2v0rgf0zq','C2f2zq','BMfTzq','DhjPBq','CMv2','z2v0','yxj0AwzHy3rZuM9VDa','z2v0sg91CNm','C2vLza','DMfSDwvZ','CMvHzgrPCLn5BMm','5OgI5Asn6iEQia','Cgf0Aa','mZuXmZeZmKTjB0v0rG','CMfUzg9T','ChvZAa','Aw5ZDc0','AxnbyNnVBhv0zq','s3roB3rgB3vUzevYCM9Y','mJa4mtuYA0nkt0L6','CMv2ia','lMv0ywC','zxHPC3rZu3LUyW','qvjusuzbq1rFrKLmrv9srvbpuLq','zgLYBMfTzq','AxrLBxm','lwXVy2fSlq','zw5KC1DPDgG','qvjusuzbq1rFrKLmrv9ct0rz','C2vLzeLUC3rHBMnLCW','C2XPy2u','CgfYC2u','s3rdB25MBgLJDevYCM9Y','AxneAxjLy3rVCNK','BwTKAxjtEw5J','A2LUza','lMPZB24','Aw5ZDgfUy2vZuM9VDa','y3DK','y3jLyxrLsgfZAa','zMLSDgvY','Bg9NlMPZB24','ru1qvfLFs1rm','nZaWmdK3DvDXu3Hy','AM9PBG','A2v5CW','CMvHzezPBgvtEw5J','C3rYAw5NAwz5','yxj0AwzHy3ruB0zPBgvZ','nJu5nZjxCeztyvq','qvjusuzbq1rFrKLmrv9nrvrb','nxPys3vUAG','CgfKu3rHCNq','CMvZB2X2zq','zMLUza','sevbra','mtiXnduYnJboteXYCwi','y29TBw9U','Agv4','zgvJB2rL','C3rYAw5N','zMLSzxm','oxbcBvbfBG','zw50CMLLCW','C29YDa','zMLSzxnuB0fYDgLMywn0','B2jQzwn0CW','BwfW','Dg9ju09tDhjPBMC','yxj0AwzHy3qG','mtq3mtC4mgjzAfjHBq','AgvHza','qvjusuzbq1rFrKLmrv9gsuXm','y3jLyxrLs3rgC1n0B3jLCW','mZjRtNvozK4','yxj0AwzHy3rjza'];_0x5968=function(){return _0x313f63;};return _0x5968();}function readLog(_0x1c39ee,_0x5988f9,_0x3da3e2){const _0x1fd752=_0x3f0497,_0x2e4efe=itemDir(_0x1c39ee,_0x5988f9,_0x3da3e2),_0x47280c=path[_0x1fd752(0x1bb)](_0x2e4efe,_0x1fd752(0x1b8)),_0x1384fb=path['join'](_0x2e4efe,_0x1fd752(0x1c6)),_0x1d9c0b=fs[_0x1fd752(0x1fe)](_0x47280c)?JSON[_0x1fd752(0x207)](fs['readFileSync'](_0x47280c,_0x1fd752(0x1df))):[],_0x368b7d=fs['existsSync'](_0x1384fb)?fs[_0x1fd752(0x1bd)](_0x1384fb,_0x1fd752(0x1df))[_0x1fd752(0x1eb)]():_0x1d9c0b['at'](-0x1)?.[_0x1fd752(0x1ec)]??null;return{'head':_0x368b7d,'items':_0x1d9c0b};}function writeLog(_0x2c322d,_0x49f8f0,_0x3703f7,_0x47aac8,_0x26d616){const _0x185dd4=_0x3f0497,_0x1d7ccc=itemDir(_0x2c322d,_0x49f8f0,_0x3703f7);fs[_0x185dd4(0x20a)](_0x1d7ccc,{'recursive':!![]}),fs[_0x185dd4(0x1e0)](path[_0x185dd4(0x1bb)](_0x1d7ccc,'log.json'),JSON[_0x185dd4(0x1be)](_0x26d616,null,0x2),'utf8'),fs['writeFileSync'](path[_0x185dd4(0x1bb)](_0x1d7ccc,_0x185dd4(0x1c6)),_0x47aac8+'\x0a',_0x185dd4(0x1df));}function findRev(_0x497092,_0x264abc){const _0x4af96b=_0x3f0497,_0x1e2a9a=path[_0x4af96b(0x1bb)](_0x497092,_0x4af96b(0x201));if(!fs[_0x4af96b(0x1fe)](_0x1e2a9a))return void 0x0;for(const _0x441dc4 of fs[_0x4af96b(0x1f2)](_0x1e2a9a,{'withFileTypes':!![]})){if(!_0x441dc4['isDirectory']())continue;for(const _0xc069f1 of fs[_0x4af96b(0x1f2)](path['join'](_0x1e2a9a,_0x441dc4['name']),{'withFileTypes':!![]})){if(!_0xc069f1[_0x4af96b(0x209)]())continue;const _0x212c60=readLog(_0x497092,_0x441dc4[_0x4af96b(0x1ea)],_0xc069f1[_0x4af96b(0x1ea)])[_0x4af96b(0x201)]['find'](_0x12dd79=>_0x12dd79[_0x4af96b(0x1ec)]===_0x264abc);if(_0x212c60)return _0x212c60;}}return void 0x0;}function filesTextOf(_0x45e3f0,_0x1cebeb){const _0x43a794=_0x3f0497,_0x542d31={};for(const [_0x5ba622,_0x2fbf4c]of Object[_0x43a794(0x1ce)](_0x1cebeb['files'])){const _0x1b8e8f=objectPath(_0x45e3f0,_0x2fbf4c);if(fs['existsSync'](_0x1b8e8f))_0x542d31[_0x5ba622]=fs[_0x43a794(0x1bd)](_0x1b8e8f,_0x43a794(0x1df));}return _0x542d31;}function createFsVersionStore(_0x5c0b78,_0xa78984){const _0x50a36a=_0x3f0497;return fs[_0x50a36a(0x20a)](_0x5c0b78,{'recursive':!![]}),{async 'log'(_0x2928c1,_0xbbe966){const _0x16f3a5=_0x50a36a,{head:_0x2093a9,items:_0x394cf2}=readLog(_0x5c0b78,_0x2928c1,_0xbbe966);return{'head':_0x2093a9,'items':[..._0x394cf2][_0x16f3a5(0x1cf)]((_0x568039,_0x59ecdc)=>_0x568039['at']<_0x59ecdc['at']?0x1:-0x1)};},async 'get'(_0x2fa693){const _0x4788a8=_0x50a36a,_0x5673f8=findRev(_0x5c0b78,_0x2fa693);if(!_0x5673f8)throw new store[(_0x4788a8(0x1fa))](_0x4788a8(0x1fc)+_0x2fa693);return _0x5673f8;},async 'readFile'(_0x39dd7c,_0x47f6bc){const _0x36ba43=_0x50a36a,_0x1a7dc8=await this[_0x36ba43(0x1ed)](_0x39dd7c),_0x3aaa0c=_0x1a7dc8[_0x36ba43(0x1cc)][_0x47f6bc];if(!_0x3aaa0c)throw new store[(_0x36ba43(0x1fa))](_0x47f6bc);const _0x587c27=objectPath(_0x5c0b78,_0x3aaa0c);if(!fs[_0x36ba43(0x1fe)](_0x587c27))throw new store[(_0x36ba43(0x1fa))](_0x47f6bc);return new Uint8Array(fs[_0x36ba43(0x1bd)](_0x587c27));},async 'commit'(_0x5f209e){const _0x50d6ba=_0x50a36a;let _0x53d8fe=_0x5f209e[_0x50d6ba(0x1cc)];if(!_0x53d8fe){const _0x3a6adf=await _0xa78984['get'](_0x5f209e['id']);_0x53d8fe=store[_0x50d6ba(0x1bf)](_0x3a6adf);}const _0x2a0521={},_0x5454d9={};for(const [_0x97cf2e,_0x32b2bf]of Object['entries'](_0x53d8fe)){const _0x5077d6=typeof _0x32b2bf===_0x50d6ba(0x1cb)?_0x32b2bf:new TextDecoder()[_0x50d6ba(0x1ca)](_0x32b2bf);_0x2a0521[_0x97cf2e]=_0x5077d6,_0x5454d9[_0x97cf2e]=writeObject(_0x5c0b78,typeof _0x32b2bf===_0x50d6ba(0x1cb)?Buffer['from'](_0x32b2bf,_0x50d6ba(0x1df)):_0x32b2bf);}const _0x21f0f8=readLog(_0x5c0b78,_0x5f209e[_0x50d6ba(0x20b)],_0x5f209e['id']);if(_0x21f0f8[_0x50d6ba(0x1d6)]){const _0x36147d=_0x21f0f8[_0x50d6ba(0x201)][_0x50d6ba(0x1c5)](_0x1adb96=>_0x1adb96[_0x50d6ba(0x1ec)]===_0x21f0f8[_0x50d6ba(0x1d6)]);if(_0x36147d&&store['filesEqual'](_0x2a0521,filesTextOf(_0x5c0b78,_0x36147d)))return _0x36147d;}const _0x415fc4=new Date(),_0x1c550b=String(_0x415fc4[_0x50d6ba(0x1e2)]())[_0x50d6ba(0x206)](0x2)+String(_0x415fc4['getMonth']()+0x1)[_0x50d6ba(0x1c3)](0x2,'0')+String(_0x415fc4[_0x50d6ba(0x1e8)]())[_0x50d6ba(0x1c3)](0x2,'0')+String(_0x415fc4[_0x50d6ba(0x1ef)]())['padStart'](0x2,'0')+String(_0x415fc4['getMinutes']())[_0x50d6ba(0x1c3)](0x2,'0'),_0x5030e1=sha256Hex(Object[_0x50d6ba(0x1f1)](_0x5454d9)[_0x50d6ba(0x1cf)]()[_0x50d6ba(0x1bb)](','))[_0x50d6ba(0x206)](0x0,0x8),_0x9d90e9={'rev':_0x1c550b+_0x50d6ba(0x202)+_0x5030e1,'kind':_0x5f209e['kind'],'id':_0x5f209e['id'],'at':_0x415fc4[_0x50d6ba(0x1d3)](),'parent':_0x21f0f8[_0x50d6ba(0x1d6)],'by':_0x5f209e['by'],'note':_0x5f209e['note'],'files':_0x5454d9,'meta':_0x5f209e['meta']};return writeLog(_0x5c0b78,_0x5f209e[_0x50d6ba(0x20b)],_0x5f209e['id'],_0x9d90e9['rev'],[..._0x21f0f8[_0x50d6ba(0x201)],_0x9d90e9]),_0x9d90e9;},async 'restore'(_0x330555,_0x372fc6,_0x191537,_0x2f50af){const _0x314206=_0x50a36a,_0x21a67d=await this[_0x314206(0x1ed)](_0x191537),_0x1c2c42={};for(const _0x3d28d0 of Object[_0x314206(0x1bc)](_0x21a67d[_0x314206(0x1cc)])){_0x1c2c42[_0x3d28d0]=new TextDecoder()[_0x314206(0x1ca)](await this['readFile'](_0x191537,_0x3d28d0));}const _0x43e296=store['filesToArtifact'](_0x1c2c42,_0x372fc6);return await _0xa78984[_0x314206(0x1e9)]({..._0x43e296,'id':_0x372fc6,'kind':_0x43e296[_0x314206(0x20b)],'etag':void 0x0}),this[_0x314206(0x1e1)]({'kind':_0x330555,'id':_0x372fc6,'files':_0x1c2c42,'by':_0x2f50af,'note':_0x314206(0x1f3)+_0x191537});}};}function createKtFsStores(_0x2a5050){const _0x2f09ef=_0x3f0497,_0x5bc871=createFsArtifactStore(resolveRoot(_0x2a5050[_0x2f09ef(0x1ee)],_0x2a5050['cwd']),_0x2a5050[_0x2f09ef(0x1f0)]),_0x51fa91=_0x2a5050[_0x2f09ef(0x20d)]?createFsInstanceStore(resolveRoot(_0x2a5050[_0x2f09ef(0x20d)],_0x2a5050[_0x2f09ef(0x20e)]),_0x2a5050[_0x2f09ef(0x205)]):void 0x0,_0xf70dd0=_0x2a5050['versionsRoot']?createFsVersionStore(resolveRoot(_0x2a5050['versionsRoot'],_0x2a5050[_0x2f09ef(0x20e)]),_0x5bc871):void 0x0;return{'artifacts':_0x5bc871,'instances':_0x51fa91,'versions':_0xf70dd0};}exports[_0x3f0497(0x1d8)]=createKtFsStores;
1
+ 'use strict';const _0xf8d0=_0x2ad6;(function(_0x1d6e4c,_0x26e9a9){const _0x185cb9=_0x2ad6,_0x2d9f67=_0x1d6e4c();while(!![]){try{const _0x5c49df=-parseInt(_0x185cb9(0xdc))/0x1+parseInt(_0x185cb9(0xf9))/0x2+parseInt(_0x185cb9(0xd1))/0x3+parseInt(_0x185cb9(0xbc))/0x4+parseInt(_0x185cb9(0xbb))/0x5+parseInt(_0x185cb9(0xc1))/0x6+parseInt(_0x185cb9(0xf3))/0x7*(-parseInt(_0x185cb9(0xcc))/0x8);if(_0x5c49df===_0x26e9a9)break;else _0x2d9f67['push'](_0x2d9f67['shift']());}catch(_0x503394){_0x2d9f67['push'](_0x2d9f67['shift']());}}}(_0x189e,0x67ec8));var fs=require('fs'),path=require(_0xf8d0(0xfb)),store=require(_0xf8d0(0xad)),crypto=require('crypto');function resolveRoot(_0x42e2bd,_0x1b9106=process[_0xf8d0(0xd2)]()){const _0x317cab=_0xf8d0,_0x182eb3=path[_0x317cab(0xb7)](_0x42e2bd)?_0x42e2bd:path['resolve'](_0x1b9106,_0x42e2bd);return fs['mkdirSync'](_0x182eb3,{'recursive':!![]}),_0x182eb3;}function artifactDir(_0x17146e,_0xc89820){const _0x22ee36=_0xf8d0;return path[_0x22ee36(0xb8)](_0x17146e,_0xc89820);}function objectPath(_0x5bcdd7,_0x2ab37b){const _0x57769b=_0xf8d0;return path['join'](_0x5bcdd7,_0x57769b(0xd8),_0x2ab37b[_0x57769b(0xde)](0x0,0x2),_0x2ab37b);}function itemDir(_0x734ed7,_0x3c8393,_0x311756){const _0x5571b5=_0xf8d0;return path[_0x5571b5(0xb8)](_0x734ed7,'items',_0x3c8393,_0x311756);}function newEtag(){const _0x2b46cf=_0xf8d0;return Date['now']()['toString'](0x24)+'-'+Math['random']()[_0x2b46cf(0xec)](0x24)[_0x2b46cf(0xde)](0x2,0x8);}function readEtag(_0xf937d3){const _0x45d5a7=_0xf8d0,_0x10dc80=path[_0x45d5a7(0xb8)](_0xf937d3,'.etag');return fs[_0x45d5a7(0xf8)](_0x10dc80)?fs[_0x45d5a7(0xda)](_0x10dc80,_0x45d5a7(0xb1))[_0x45d5a7(0xf7)]():void 0x0;}function writeArtifactDir(_0x5821e6,_0x35c2cf,_0x43ddc2){const _0x4d02e2=_0xf8d0;fs[_0x4d02e2(0xd6)](path[_0x4d02e2(0xb8)](_0x5821e6,_0x4d02e2(0xfc)),{'recursive':!![]});const _0x2f0b2c=store[_0x4d02e2(0xd3)](_0x35c2cf);fs['writeFileSync'](path[_0x4d02e2(0xb8)](_0x5821e6,store[_0x4d02e2(0xef)]),_0x2f0b2c[store['ARTIFACT_FILE_META']]??'{}',_0x4d02e2(0xb1)),fs[_0x4d02e2(0xcf)](path['join'](_0x5821e6,store['ARTIFACT_FILE_BODY']),_0x2f0b2c[store[_0x4d02e2(0xff)]]??'',_0x4d02e2(0xb1));const _0x497e19=path['join'](_0x5821e6,store[_0x4d02e2(0xfd)]),_0x315f72=path[_0x4d02e2(0xb8)](_0x5821e6,store[_0x4d02e2(0xd7)]);if(_0x2f0b2c[store[_0x4d02e2(0xfd)]])fs[_0x4d02e2(0xcf)](_0x497e19,_0x2f0b2c[store[_0x4d02e2(0xfd)]],'utf8');else{if(fs[_0x4d02e2(0xf8)](_0x497e19))fs[_0x4d02e2(0xc6)](_0x497e19);}if(_0x2f0b2c[store[_0x4d02e2(0xd7)]])fs['writeFileSync'](_0x315f72,_0x2f0b2c[store['ARTIFACT_FILE_REPORT']],_0x4d02e2(0xb1));else{if(fs[_0x4d02e2(0xf8)](_0x315f72))fs[_0x4d02e2(0xc6)](_0x315f72);}fs[_0x4d02e2(0xcf)](path[_0x4d02e2(0xb8)](_0x5821e6,_0x4d02e2(0xfa)),_0x43ddc2,'utf8');}function readArtifactDir(_0x42a3df,_0x47ac77){const _0x2376ea=_0xf8d0,_0x358b95={},_0x210ca0=path[_0x2376ea(0xb8)](_0x42a3df,store[_0x2376ea(0xef)]),_0x387912=path[_0x2376ea(0xb8)](_0x42a3df,store['ARTIFACT_FILE_BODY']);if(fs['existsSync'](_0x210ca0))_0x358b95[store[_0x2376ea(0xef)]]=fs['readFileSync'](_0x210ca0,'utf8');if(fs[_0x2376ea(0xf8)](_0x387912))_0x358b95[store[_0x2376ea(0xff)]]=fs[_0x2376ea(0xda)](_0x387912,'utf8');const _0x79ce11=path[_0x2376ea(0xb8)](_0x42a3df,store[_0x2376ea(0xfd)]),_0x5741c6=path[_0x2376ea(0xb8)](_0x42a3df,store[_0x2376ea(0xd7)]);if(fs['existsSync'](_0x79ce11))_0x358b95[store[_0x2376ea(0xfd)]]=fs[_0x2376ea(0xda)](_0x79ce11,_0x2376ea(0xb1));if(fs['existsSync'](_0x5741c6))_0x358b95[store[_0x2376ea(0xd7)]]=fs[_0x2376ea(0xda)](_0x5741c6,_0x2376ea(0xb1));return{...store[_0x2376ea(0xb0)](_0x358b95,_0x47ac77),'etag':readEtag(_0x42a3df)};}function createFsArtifactStore(_0x38a67e,_0x1f6648=[]){const _0x2b4cef=_0xf8d0;fs[_0x2b4cef(0xd6)](_0x38a67e,{'recursive':!![]});for(const _0x389cb of _0x1f6648){const _0x42496a=artifactDir(_0x38a67e,_0x389cb['id']),_0x5a0eb8=path['join'](_0x42496a,store['ARTIFACT_FILE_BODY']);if(!fs[_0x2b4cef(0xf8)](_0x5a0eb8))writeArtifactDir(_0x42496a,_0x389cb,_0x389cb[_0x2b4cef(0xaa)]??newEtag());}return{async 'list'(_0x3cf943){const _0xd25468=_0x2b4cef;if(!fs[_0xd25468(0xf8)](_0x38a67e))return[];const _0x2f045d=[];for(const _0x375ffa of fs[_0xd25468(0xf2)](_0x38a67e,{'withFileTypes':!![]})){if(!_0x375ffa['isDirectory']())continue;try{const _0x5c9346=readArtifactDir(artifactDir(_0x38a67e,_0x375ffa['name']),_0x375ffa[_0xd25468(0xca)]);if(!_0x3cf943||_0x5c9346[_0xd25468(0xc0)]===_0x3cf943)_0x2f045d[_0xd25468(0xd5)]({'id':_0x5c9346['id'],'name':_0x5c9346['name'],'kind':_0x5c9346[_0xd25468(0xc0)]});}catch{}}return _0x2f045d;},async 'get'(_0x4de4d0){const _0x126aee=_0x2b4cef,_0x306d2a=artifactDir(_0x38a67e,_0x4de4d0);if(!fs[_0x126aee(0xf8)](_0x306d2a))throw new store['KtNotFoundError'](_0x126aee(0xcb)+_0x4de4d0);return readArtifactDir(_0x306d2a,_0x4de4d0);},async 'save'(_0x481d56){const _0x72456=_0x2b4cef,_0xd28689=artifactDir(_0x38a67e,_0x481d56['id']),_0x4ddf9d=fs[_0x72456(0xf8)](_0xd28689)?readArtifactDir(_0xd28689,_0x481d56['id']):void 0x0;if(_0x481d56[_0x72456(0xaa)]&&_0x4ddf9d?.['etag']&&_0x481d56['etag']!==_0x4ddf9d[_0x72456(0xaa)])throw new store[(_0x72456(0xe1))](_0x72456(0xaf),_0x4ddf9d);const _0x15dead=newEtag();return writeArtifactDir(_0xd28689,_0x481d56,_0x15dead),{..._0x481d56,'etag':_0x15dead};},async 'create'(_0x5094c6){const _0x4c6ea4=_0x2b4cef,_0x2137fd=_0x5094c6[_0x4c6ea4(0xc0)]+'-'+Math[_0x4c6ea4(0xc3)]()[_0x4c6ea4(0xec)](0x24)[_0x4c6ea4(0xde)](0x2,0xa),_0x1662f3={'id':_0x2137fd,'name':_0x5094c6[_0x4c6ea4(0xca)],'kind':_0x5094c6[_0x4c6ea4(0xc0)],'ktl':store['EMPTY_KTL']};return this[_0x4c6ea4(0xea)](_0x1662f3);},async 'remove'(_0x316b70){const _0x991f3a=_0x2b4cef,_0x498ce5=artifactDir(_0x38a67e,_0x316b70);if(!fs[_0x991f3a(0xf8)](_0x498ce5))throw new store[(_0x991f3a(0xb4))]('artifact\x20'+_0x316b70);fs[_0x991f3a(0xc6)](_0x498ce5,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x353354,_0xc9de44={}){const _0x8595cc=_0xf8d0;fs[_0x8595cc(0xd6)](_0x353354,{'recursive':!![]});const _0x464a1f=_0x10744a=>path[_0x8595cc(0xb8)](_0x353354,_0x10744a+_0x8595cc(0xee));for(const [_0x1593cd,_0x26c2c0]of Object[_0x8595cc(0xf5)](_0xc9de44)){if(!fs[_0x8595cc(0xf8)](_0x464a1f(_0x1593cd)))fs[_0x8595cc(0xcf)](_0x464a1f(_0x1593cd),JSON[_0x8595cc(0xe4)](_0x26c2c0,null,0x2),_0x8595cc(0xb1));}return{async 'get'(_0x4bda19){const _0x2e5ee5=_0x8595cc,_0x31fcd3=_0x464a1f(_0x4bda19);if(!fs['existsSync'](_0x31fcd3))throw new store[(_0x2e5ee5(0xb4))]('instance\x20'+_0x4bda19);return JSON[_0x2e5ee5(0xe6)](fs[_0x2e5ee5(0xda)](_0x31fcd3,_0x2e5ee5(0xb1)));},async 'save'(_0x1fb75a,_0x412d18){const _0x3f16b2=_0x8595cc,_0x588903=_0x464a1f(_0x1fb75a),_0x4538b4=fs[_0x3f16b2(0xf8)](_0x588903)?JSON['parse'](fs[_0x3f16b2(0xda)](_0x588903,'utf8')):{'artifactId':'','values':{}},_0x33f55e={'artifactId':_0x4538b4[_0x3f16b2(0xbf)],'values':{..._0x4538b4[_0x3f16b2(0xc8)],..._0x412d18[_0x3f16b2(0xc8)]},'common':{..._0x4538b4[_0x3f16b2(0xbe)],..._0x412d18[_0x3f16b2(0xbe)]},'tabCommon':{..._0x4538b4[_0x3f16b2(0xed)],..._0x412d18[_0x3f16b2(0xed)]}};fs[_0x3f16b2(0xcf)](_0x588903,JSON['stringify'](_0x33f55e,null,0x2),_0x3f16b2(0xb1));},async 'list'(_0x24f3f3){const _0xdfe53a=_0x8595cc;return fs[_0xdfe53a(0xf2)](_0x353354)['filter'](_0x5ada39=>_0x5ada39[_0xdfe53a(0xe3)](_0xdfe53a(0xee)))[_0xdfe53a(0xc4)](_0x7c9698=>{const _0x3dbb75=_0xdfe53a,_0x136a6e=_0x7c9698[_0x3dbb75(0xde)](0x0,-0x5),_0x2b3e75=JSON[_0x3dbb75(0xe6)](fs[_0x3dbb75(0xda)](path['join'](_0x353354,_0x7c9698),_0x3dbb75(0xb1)));return{'id':_0x136a6e,'artifactId':_0x2b3e75[_0x3dbb75(0xbf)]};})[_0xdfe53a(0xbd)](_0x11963a=>!_0x24f3f3||_0x11963a[_0xdfe53a(0xbf)]===_0x24f3f3);},async 'create'(_0x25ee74){const _0x354a02=_0x8595cc,_0x7d4183='inst-'+Math[_0x354a02(0xc3)]()[_0x354a02(0xec)](0x24)[_0x354a02(0xde)](0x2,0xa);return fs[_0x354a02(0xcf)](_0x464a1f(_0x7d4183),JSON[_0x354a02(0xe4)]({'artifactId':_0x25ee74[_0x354a02(0xbf)],'values':{},'common':{}},null,0x2),_0x354a02(0xb1)),{'id':_0x7d4183};}};}function sha256Hex(_0x37913b){const _0x30b413=_0xf8d0,_0x272afc=typeof _0x37913b===_0x30b413(0xdb)?Buffer['from'](_0x37913b,'utf8'):Buffer[_0x30b413(0xab)](_0x37913b);return crypto[_0x30b413(0xb6)]('sha256')[_0x30b413(0xdf)](_0x272afc)[_0x30b413(0xd4)]('hex');}function writeObject(_0x173374,_0x5b3a19){const _0x5005e2=_0xf8d0,_0x25ad2d=sha256Hex(_0x5b3a19),_0x516a31=objectPath(_0x173374,_0x25ad2d);fs['mkdirSync'](path[_0x5005e2(0xe8)](_0x516a31),{'recursive':!![]});if(!fs[_0x5005e2(0xf8)](_0x516a31))fs[_0x5005e2(0xcf)](_0x516a31,_0x5b3a19);return _0x25ad2d;}function _0x2ad6(_0x26e19c,_0x22097e){_0x26e19c=_0x26e19c-0xa9;const _0x189e75=_0x189e();let _0x2ad6b3=_0x189e75[_0x26e19c];if(_0x2ad6['gxlMfR']===undefined){var _0x3d903c=function(_0x9c8f96){const _0x500934='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1b17a9='',_0x42e2bd='';for(let _0x1b9106=0x0,_0x182eb3,_0x17146e,_0xc89820=0x0;_0x17146e=_0x9c8f96['charAt'](_0xc89820++);~_0x17146e&&(_0x182eb3=_0x1b9106%0x4?_0x182eb3*0x40+_0x17146e:_0x17146e,_0x1b9106++%0x4)?_0x1b17a9+=String['fromCharCode'](0xff&_0x182eb3>>(-0x2*_0x1b9106&0x6)):0x0){_0x17146e=_0x500934['indexOf'](_0x17146e);}for(let _0x5bcdd7=0x0,_0x2ab37b=_0x1b17a9['length'];_0x5bcdd7<_0x2ab37b;_0x5bcdd7++){_0x42e2bd+='%'+('00'+_0x1b17a9['charCodeAt'](_0x5bcdd7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x42e2bd);};_0x2ad6['aSxljy']=_0x3d903c,_0x2ad6['gWVakp']={},_0x2ad6['gxlMfR']=!![];}const _0x24d156=_0x189e75[0x0];_0x2ad6['ofIskg']!==_0x24d156&&(_0x2ad6['gWVakp']={},_0x2ad6['ofIskg']=_0x24d156);const _0x509e3c=_0x2ad6['gWVakp'][_0x26e19c];return _0x509e3c===undefined?(_0x2ad6b3=_0x2ad6['aSxljy'](_0x2ad6b3),_0x2ad6['gWVakp'][_0x26e19c]=_0x2ad6b3):_0x2ad6b3=_0x509e3c,_0x2ad6b3;}function readLog(_0x4e4e7e,_0x37bd5d,_0x2eeae0){const _0x510813=_0xf8d0,_0x300269=itemDir(_0x4e4e7e,_0x37bd5d,_0x2eeae0),_0x11c743=path[_0x510813(0xb8)](_0x300269,_0x510813(0xa9)),_0x366bdc=path[_0x510813(0xb8)](_0x300269,_0x510813(0xdd)),_0x1153f5=fs['existsSync'](_0x11c743)?JSON[_0x510813(0xe6)](fs[_0x510813(0xda)](_0x11c743,'utf8')):[],_0x6a802e=fs[_0x510813(0xf8)](_0x366bdc)?fs[_0x510813(0xda)](_0x366bdc,_0x510813(0xb1))[_0x510813(0xf7)]():_0x1153f5['at'](-0x1)?.['rev']??null;return{'head':_0x6a802e,'items':_0x1153f5};}function _0x189e(){const _0x17ecb9=['zMLSDgvY','y29TBw9U','yxj0AwzHy3rjza','A2LUza','mZC0mJm2ohbhuxnjwG','5OgI5Asn6iEQia','CMfUzg9T','BwfW','zMLUza','CM1tEw5J','Bwv0yq','DMfSDwvZ','lwXVy2fSlq','BMfTzq','yxj0AwzHy3qG','nZjTD2fMrgG','CMv2ia','zgvJB2rL','D3jPDgvgAwXLu3LUyW','DMvYC2LVBNnsB290','ndaXote2uMPtwxvW','y3DK','yxj0AwzHy3ruB0zPBgvZ','zgLNzxn0','ChvZAa','BwTKAxjtEw5J','qvjusuzbq1rFrKLmrv9srvbpuLq','B2jQzwn0CW','A2v5CW','CMvHzezPBgvtEw5J','C3rYAw5N','mtmWmdq3EeTzuer0','sevbra','C2XPy2u','DxbKyxrL','C2vLzeLUC3rHBMnLCW','s3rdB25MBgLJDevYCM9Y','Aw5ZDgfUy2vZuM9VDa','zw5KC1DPDgG','C3rYAw5NAwz5','zMLSzxm','CgfYC2u','z2v0sg91CNm','zgLYBMfTzq','Dg9ju09tDhjPBMC','C2f2zq','AxrLBxm','Dg9tDhjPBMC','DgfIq29TBw9U','lMPZB24','qvjusuzbq1rFrKLmrv9nrvrb','AgvHza','AxneAxjLy3rVCNK','CMvHzgrPCLn5BMm','mte2mdK1meP4BeTYDW','z2v0rgf0zq','zw50CMLLCW','C2vLza','DhjPBq','zxHPC3rZu3LUyW','mte5mdmYmgv4rhzptG','lMv0ywC','Cgf0Aa','zMfJzxm','qvjusuzbq1rFrKLmrv9gsuXm','CgfKu3rHCNq','qvjusuzbq1rFrKLmrv9ct0rz','Bg9NlMPZB24','zxrHzW','zNjVBq','z2v0rNvSBfLLyxi','qgSTDgfIBguVCMvWB3j0l3n0B3jL','y3jLyxrLs3rgC1n0B3jLCW','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','zMLSzxnuB0fYDgLMywn0','DxrMoa','z2v0','CMv2','s3roB3rgB3vUzevYCM9Y','BM90zq','y3jLyxrLsgfZAa','AxnbyNnVBhv0zq','AM9PBG','CMvHzezPBgu','C29YDa','mZm4odmXnuffwhziAG','nZeZodrquuXsCMy'];_0x189e=function(){return _0x17ecb9;};return _0x189e();}function writeLog(_0x5faa0b,_0x13e1c7,_0x260400,_0x552273,_0x27d8f7){const _0x16c6a7=_0xf8d0,_0x527c5c=itemDir(_0x5faa0b,_0x13e1c7,_0x260400);fs[_0x16c6a7(0xd6)](_0x527c5c,{'recursive':!![]}),fs[_0x16c6a7(0xcf)](path[_0x16c6a7(0xb8)](_0x527c5c,_0x16c6a7(0xa9)),JSON['stringify'](_0x27d8f7,null,0x2),'utf8'),fs[_0x16c6a7(0xcf)](path[_0x16c6a7(0xb8)](_0x527c5c,_0x16c6a7(0xdd)),_0x552273+'\x0a',_0x16c6a7(0xb1));}function findRev(_0x280fb9,_0x22c228){const _0x1806b6=_0xf8d0,_0x5dbb0f=path[_0x1806b6(0xb8)](_0x280fb9,'items');if(!fs['existsSync'](_0x5dbb0f))return void 0x0;for(const _0x2fd6f6 of fs[_0x1806b6(0xf2)](_0x5dbb0f,{'withFileTypes':!![]})){if(!_0x2fd6f6['isDirectory']())continue;for(const _0x59dc1f of fs[_0x1806b6(0xf2)](path['join'](_0x5dbb0f,_0x2fd6f6['name']),{'withFileTypes':!![]})){if(!_0x59dc1f[_0x1806b6(0xf1)]())continue;const _0x23384f=readLog(_0x280fb9,_0x2fd6f6[_0x1806b6(0xca)],_0x59dc1f[_0x1806b6(0xca)])[_0x1806b6(0xeb)][_0x1806b6(0xc5)](_0x6af0c0=>_0x6af0c0[_0x1806b6(0xb3)]===_0x22c228);if(_0x23384f)return _0x23384f;}}return void 0x0;}function filesTextOf(_0x135027,_0x5a5847){const _0x2e8419=_0xf8d0,_0x5e4c16={};for(const [_0xb418aa,_0x35f3d7]of Object[_0x2e8419(0xf5)](_0x5a5847[_0x2e8419(0xe5)])){const _0x5a8a24=objectPath(_0x135027,_0x35f3d7);if(fs[_0x2e8419(0xf8)](_0x5a8a24))_0x5e4c16[_0xb418aa]=fs[_0x2e8419(0xda)](_0x5a8a24,_0x2e8419(0xb1));}return _0x5e4c16;}function createFsVersionStore(_0x1752d9,_0x1663b7){const _0x40f3e2=_0xf8d0;return fs[_0x40f3e2(0xd6)](_0x1752d9,{'recursive':!![]}),{async 'log'(_0x2b1333,_0x384570){const {head:_0x5f2668,items:_0x2f6a5b}=readLog(_0x1752d9,_0x2b1333,_0x384570);return{'head':_0x5f2668,'items':[..._0x2f6a5b]['sort']((_0x2a39ac,_0x296f47)=>_0x2a39ac['at']<_0x296f47['at']?0x1:-0x1)};},async 'get'(_0x45e254){const _0x420b33=_0x40f3e2,_0x4c3711=findRev(_0x1752d9,_0x45e254);if(!_0x4c3711)throw new store[(_0x420b33(0xb4))](_0x420b33(0xcd)+_0x45e254);return _0x4c3711;},async 'readFile'(_0x80871b,_0xed011e){const _0x5ec71f=_0x40f3e2,_0x57f932=await this['get'](_0x80871b),_0x3fa71b=_0x57f932[_0x5ec71f(0xe5)][_0xed011e];if(!_0x3fa71b)throw new store[(_0x5ec71f(0xb4))](_0xed011e);const _0x406b58=objectPath(_0x1752d9,_0x3fa71b);if(!fs[_0x5ec71f(0xf8)](_0x406b58))throw new store[(_0x5ec71f(0xb4))](_0xed011e);return new Uint8Array(fs[_0x5ec71f(0xda)](_0x406b58));},async 'commit'(_0x3fea2c){const _0x3af0f6=_0x40f3e2;let _0x1e75c1=_0x3fea2c[_0x3af0f6(0xe5)];if(!_0x1e75c1){const _0x53b0c5=await _0x1663b7['get'](_0x3fea2c['id']);_0x1e75c1=store[_0x3af0f6(0xd3)](_0x53b0c5);}const _0x426e89={},_0xfd314d={};for(const [_0x3c8003,_0x5aa0f1]of Object['entries'](_0x1e75c1)){const _0x37e0db=typeof _0x5aa0f1===_0x3af0f6(0xdb)?_0x5aa0f1:new TextDecoder()['decode'](_0x5aa0f1);_0x426e89[_0x3c8003]=_0x37e0db,_0xfd314d[_0x3c8003]=writeObject(_0x1752d9,typeof _0x5aa0f1===_0x3af0f6(0xdb)?Buffer[_0x3af0f6(0xab)](_0x5aa0f1,_0x3af0f6(0xb1)):_0x5aa0f1);}const _0x2778f6=readLog(_0x1752d9,_0x3fea2c[_0x3af0f6(0xc0)],_0x3fea2c['id']);if(_0x2778f6[_0x3af0f6(0xf0)]){const _0x1be639=_0x2778f6['items'][_0x3af0f6(0xc5)](_0x1b462b=>_0x1b462b[_0x3af0f6(0xb3)]===_0x2778f6['head']);if(_0x1be639&&store['filesEqual'](_0x426e89,filesTextOf(_0x1752d9,_0x1be639)))return _0x1be639;}const _0x102d41=new Date(),_0x361e74=String(_0x102d41[_0x3af0f6(0xac)]())['slice'](0x2)+String(_0x102d41['getMonth']()+0x1)[_0x3af0f6(0xfe)](0x2,'0')+String(_0x102d41[_0x3af0f6(0xf4)]())[_0x3af0f6(0xfe)](0x2,'0')+String(_0x102d41[_0x3af0f6(0xe7)]())[_0x3af0f6(0xfe)](0x2,'0')+String(_0x102d41['getMinutes']())[_0x3af0f6(0xfe)](0x2,'0'),_0x476a1a=sha256Hex(Object[_0x3af0f6(0xc8)](_0xfd314d)[_0x3af0f6(0xba)]()[_0x3af0f6(0xb8)](','))[_0x3af0f6(0xde)](0x0,0x8),_0xee2dc2={'rev':_0x361e74+_0x3af0f6(0xc9)+_0x476a1a,'kind':_0x3fea2c['kind'],'id':_0x3fea2c['id'],'at':_0x102d41[_0x3af0f6(0xe9)](),'parent':_0x2778f6['head'],'by':_0x3fea2c['by'],'note':_0x3fea2c[_0x3af0f6(0xb5)],'files':_0xfd314d,'meta':_0x3fea2c[_0x3af0f6(0xc7)]};return writeLog(_0x1752d9,_0x3fea2c[_0x3af0f6(0xc0)],_0x3fea2c['id'],_0xee2dc2['rev'],[..._0x2778f6[_0x3af0f6(0xeb)],_0xee2dc2]),_0xee2dc2;},async 'restore'(_0x45f75d,_0x19257e,_0x70c2ad,_0x31f92e){const _0x362a84=_0x40f3e2,_0x19b198=await this[_0x362a84(0xb2)](_0x70c2ad),_0x27760d={};for(const _0x1111ff of Object[_0x362a84(0xd9)](_0x19b198[_0x362a84(0xe5)])){_0x27760d[_0x1111ff]=new TextDecoder()[_0x362a84(0xce)](await this[_0x362a84(0xb9)](_0x70c2ad,_0x1111ff));}const _0x2ccc0e=store['filesToArtifact'](_0x27760d,_0x19257e);return await _0x1663b7[_0x362a84(0xea)]({..._0x2ccc0e,'id':_0x19257e,'kind':_0x2ccc0e['kind'],'etag':void 0x0}),this['commit']({'kind':_0x45f75d,'id':_0x19257e,'files':_0x27760d,'by':_0x31f92e,'note':_0x362a84(0xc2)+_0x70c2ad});}};}function createKtFsStores(_0xe5b1df){const _0x27f45c=_0xf8d0,_0x3183b7=createFsArtifactStore(resolveRoot(_0xe5b1df['artifactsRoot'],_0xe5b1df[_0x27f45c(0xd2)]),_0xe5b1df[_0x27f45c(0xf6)]),_0x2ac8f2=_0xe5b1df['instancesRoot']?createFsInstanceStore(resolveRoot(_0xe5b1df[_0x27f45c(0xe2)],_0xe5b1df[_0x27f45c(0xd2)]),_0xe5b1df[_0x27f45c(0xe0)]):void 0x0,_0x34e06d=_0xe5b1df[_0x27f45c(0xd0)]?createFsVersionStore(resolveRoot(_0xe5b1df[_0x27f45c(0xd0)],_0xe5b1df[_0x27f45c(0xd2)]),_0x3183b7):void 0x0;return{'artifacts':_0x3183b7,'instances':_0x2ac8f2,'versions':_0x34e06d};}exports[_0xf8d0(0xae)]=createKtFsStores;
package/dist/fs.js CHANGED
@@ -1 +1 @@
1
- const _0x10d79a=_0x3c19;(function(_0x33d4ca,_0x35f4a3){const _0x2f4b87=_0x3c19,_0xa34c9a=_0x33d4ca();while(!![]){try{const _0x24e217=parseInt(_0x2f4b87(0x16c))/0x1*(parseInt(_0x2f4b87(0x143))/0x2)+-parseInt(_0x2f4b87(0x141))/0x3+parseInt(_0x2f4b87(0x174))/0x4*(parseInt(_0x2f4b87(0x14c))/0x5)+parseInt(_0x2f4b87(0x14f))/0x6*(parseInt(_0x2f4b87(0x16a))/0x7)+-parseInt(_0x2f4b87(0x15c))/0x8*(parseInt(_0x2f4b87(0x14a))/0x9)+-parseInt(_0x2f4b87(0x148))/0xa+-parseInt(_0x2f4b87(0x166))/0xb*(-parseInt(_0x2f4b87(0x151))/0xc);if(_0x24e217===_0x35f4a3)break;else _0xa34c9a['push'](_0xa34c9a['shift']());}catch(_0x28aebd){_0xa34c9a['push'](_0xa34c9a['shift']());}}}(_0x5e53,0x5dff3));import{mkdirSync,existsSync,rmSync,readdirSync,writeFileSync,readFileSync}from'fs';function _0x5e53(){const _0xdb7c27=['yxj0AwzHy3rjza','mZC2ChjrvwHM','CMfUzg9T','lwXVy2fSlq','A2LUza','zw50CMLLCW','C3rYAw5N','zMLSDgvY','y3DK','yxj0AwzHy3rZuM9VDa','BMfTzq','Bg9NlMPZB24','sevbra','DMfSDwvZ','CMvHzezPBgu','C2vLza','DMvYC2LVBNnsB290','z2v0rNvSBfLLyxi','Dg9ju09tDhjPBMC','yxj0AwzHy3qG','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','AxrLBxm','mtu0mtqYngXXC3fiza','zxrHzW','mJm4CxvNzKfk','zNjVBq','AxneAxjLy3rVCNK','zMLSzxm','C2vLzeLUC3rHBMnLCW','nZe2mtCYmgzwz0XPqG','AgvHza','mJDdvhrnDeC','AM9PBG','nJeWnwrREK9eDq','lMPZB24','BM93','oty0otG2BhfnzND1','zgLNzxn0','mtj1yLPftvi','DxbKyxrL','DhjPBq','z2v0twLUDxrLCW','zgvJB2rL','CgfYC2u','C29YDa','Dg9tDhjPBMC','C2HHmJu2','CMv2','C3rYAw5NAwz5','nJyYmJq4DNP4EuLZ','Bwv0yq','z2v0sg91CNm','CgfKu3rHCNq','lMv0ywC','z2v0rgf0zq','y29TBw9U','BM90zq','Agv4','zMLUza','ntKZoduZn2fHvgvNEq','BwfW','DxrMoa','y29TBwL0','mJHnzMvPq1m','B2jQzwn0CW','ndC1mxzRDNjVCq','C2XPy2u','DgfIq29TBw9U','z2v0','z2v0tw9UDgG','Aw5ZDgfUy2vZuM9VDa','C2f2zq'];_0x5e53=function(){return _0xdb7c27;};return _0x5e53();}import{join,isAbsolute,resolve,dirname}from'path';import{ARTIFACT_FILE_BODY,KtNotFoundError,EMPTY_KTL,KtConflictError,filesToArtifact,artifactToFiles,filesEqual,ARTIFACT_FILE_META,ARTIFACT_FILE_FILL,ARTIFACT_FILE_REPORT}from'@k-table/report/store';import{createHash}from'crypto';function resolveRoot(_0x459604,_0x217967=process[_0x10d79a(0x17b)]()){const _0x453aee=isAbsolute(_0x459604)?_0x459604:resolve(_0x217967,_0x459604);return mkdirSync(_0x453aee,{'recursive':!![]}),_0x453aee;}function artifactDir(_0x1b29bb,_0x710e8b){return join(_0x1b29bb,_0x710e8b);}function objectPath(_0xda810a,_0x2998f5){const _0x1abca6=_0x10d79a;return join(_0xda810a,_0x1abca6(0x16b),_0x2998f5[_0x1abca6(0x16d)](0x0,0x2),_0x2998f5);}function itemDir(_0x4d7517,_0x2ab4cd,_0x5c98dc){const _0x5611b2=_0x10d79a;return join(_0x4d7517,_0x5611b2(0x188),_0x2ab4cd,_0x5c98dc);}function newEtag(){const _0x45f636=_0x10d79a;return Date[_0x45f636(0x14e)]()['toString'](0x24)+'-'+Math['random']()['toString'](0x24)['slice'](0x2,0x8);}function _0x3c19(_0x35d921,_0x3d24a3){_0x35d921=_0x35d921-0x141;const _0x5e535d=_0x5e53();let _0x3c199a=_0x5e535d[_0x35d921];if(_0x3c19['SICUIB']===undefined){var _0x1df0e3=function(_0x2949bf){const _0x2c4b94='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x48a46f='',_0x459604='';for(let _0x217967=0x0,_0x453aee,_0x1b29bb,_0x710e8b=0x0;_0x1b29bb=_0x2949bf['charAt'](_0x710e8b++);~_0x1b29bb&&(_0x453aee=_0x217967%0x4?_0x453aee*0x40+_0x1b29bb:_0x1b29bb,_0x217967++%0x4)?_0x48a46f+=String['fromCharCode'](0xff&_0x453aee>>(-0x2*_0x217967&0x6)):0x0){_0x1b29bb=_0x2c4b94['indexOf'](_0x1b29bb);}for(let _0xda810a=0x0,_0x2998f5=_0x48a46f['length'];_0xda810a<_0x2998f5;_0xda810a++){_0x459604+='%'+('00'+_0x48a46f['charCodeAt'](_0xda810a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x459604);};_0x3c19['DxaUkW']=_0x1df0e3,_0x3c19['igXpQc']={},_0x3c19['SICUIB']=!![];}const _0x2e1496=_0x5e535d[0x0];_0x3c19['IHYTTz']!==_0x2e1496&&(_0x3c19['igXpQc']={},_0x3c19['IHYTTz']=_0x2e1496);const _0x24844a=_0x3c19['igXpQc'][_0x35d921];return _0x24844a===undefined?(_0x3c199a=_0x3c19['DxaUkW'](_0x3c199a),_0x3c19['igXpQc'][_0x35d921]=_0x3c199a):_0x3c199a=_0x24844a,_0x3c199a;}function readEtag(_0x575dba){const _0x2ad4c0=_0x10d79a,_0x5f5cd6=join(_0x575dba,_0x2ad4c0(0x160));return existsSync(_0x5f5cd6)?readFileSync(_0x5f5cd6,_0x2ad4c0(0x168))[_0x2ad4c0(0x153)]():void 0x0;}function writeArtifactDir(_0x1a7eb6,_0x4344c1,_0x4383e7){const _0x3e6a6a=_0x10d79a;mkdirSync(join(_0x1a7eb6,'faces'),{'recursive':!![]});const _0x2e9517=artifactToFiles(_0x4344c1);writeFileSync(join(_0x1a7eb6,ARTIFACT_FILE_META),_0x2e9517[ARTIFACT_FILE_META]??'{}','utf8'),writeFileSync(join(_0x1a7eb6,ARTIFACT_FILE_BODY),_0x2e9517[ARTIFACT_FILE_BODY]??'',_0x3e6a6a(0x168));const _0x23186e=join(_0x1a7eb6,ARTIFACT_FILE_FILL),_0x2c818f=join(_0x1a7eb6,ARTIFACT_FILE_REPORT);if(_0x2e9517[ARTIFACT_FILE_FILL])writeFileSync(_0x23186e,_0x2e9517[ARTIFACT_FILE_FILL],'utf8');else{if(existsSync(_0x23186e))rmSync(_0x23186e);}if(_0x2e9517[ARTIFACT_FILE_REPORT])writeFileSync(_0x2c818f,_0x2e9517[ARTIFACT_FILE_REPORT],_0x3e6a6a(0x168));else{if(existsSync(_0x2c818f))rmSync(_0x2c818f);}writeFileSync(join(_0x1a7eb6,_0x3e6a6a(0x160)),_0x4383e7,_0x3e6a6a(0x168));}function readArtifactDir(_0x4d1912,_0x5fc445){const _0x8a82ff=_0x10d79a,_0x308fcc={},_0x5313de=join(_0x4d1912,ARTIFACT_FILE_META),_0x56215c=join(_0x4d1912,ARTIFACT_FILE_BODY);if(existsSync(_0x5313de))_0x308fcc[ARTIFACT_FILE_META]=readFileSync(_0x5313de,_0x8a82ff(0x168));if(existsSync(_0x56215c))_0x308fcc[ARTIFACT_FILE_BODY]=readFileSync(_0x56215c,_0x8a82ff(0x168));const _0x472643=join(_0x4d1912,ARTIFACT_FILE_FILL),_0x4c6b5a=join(_0x4d1912,ARTIFACT_FILE_REPORT);if(existsSync(_0x472643))_0x308fcc[ARTIFACT_FILE_FILL]=readFileSync(_0x472643,_0x8a82ff(0x168));if(existsSync(_0x4c6b5a))_0x308fcc[ARTIFACT_FILE_REPORT]=readFileSync(_0x4c6b5a,_0x8a82ff(0x168));return{...filesToArtifact(_0x308fcc,_0x5fc445),'etag':readEtag(_0x4d1912)};}function createFsArtifactStore(_0xc5080f,_0x43dc35=[]){const _0x5a97a6=_0x10d79a;mkdirSync(_0xc5080f,{'recursive':!![]});for(const _0x1f319d of _0x43dc35){const _0x31fb38=artifactDir(_0xc5080f,_0x1f319d['id']),_0x4afbde=join(_0x31fb38,ARTIFACT_FILE_BODY);if(!existsSync(_0x4afbde))writeArtifactDir(_0x31fb38,_0x1f319d,_0x1f319d[_0x5a97a6(0x142)]??newEtag());}return{async 'list'(_0x49a861){const _0x3ff209=_0x5a97a6;if(!existsSync(_0xc5080f))return[];const _0x26991c=[];for(const _0x4eed5e of readdirSync(_0xc5080f,{'withFileTypes':!![]})){if(!_0x4eed5e['isDirectory']())continue;try{const _0x5458a=readArtifactDir(artifactDir(_0xc5080f,_0x4eed5e[_0x3ff209(0x17d)]),_0x4eed5e[_0x3ff209(0x17d)]);if(!_0x49a861||_0x5458a[_0x3ff209(0x177)]===_0x49a861)_0x26991c['push']({'id':_0x5458a['id'],'name':_0x5458a['name'],'kind':_0x5458a[_0x3ff209(0x177)]});}catch{}}return _0x26991c;},async 'get'(_0x5e6fa0){const _0x1bbf96=_0x5a97a6,_0x567d24=artifactDir(_0xc5080f,_0x5e6fa0);if(!existsSync(_0x567d24))throw new KtNotFoundError(_0x1bbf96(0x186)+_0x5e6fa0);return readArtifactDir(_0x567d24,_0x5e6fa0);},async 'save'(_0x3773f0){const _0x5023ce=_0x5a97a6,_0x7cd2ee=artifactDir(_0xc5080f,_0x3773f0['id']),_0x5a6799=existsSync(_0x7cd2ee)?readArtifactDir(_0x7cd2ee,_0x3773f0['id']):void 0x0;if(_0x3773f0['etag']&&_0x5a6799?.['etag']&&_0x3773f0[_0x5023ce(0x142)]!==_0x5a6799['etag'])throw new KtConflictError(_0x5023ce(0x187),_0x5a6799);const _0x1c38f3=newEtag();return writeArtifactDir(_0x7cd2ee,_0x3773f0,_0x1c38f3),{..._0x3773f0,'etag':_0x1c38f3};},async 'create'(_0x58e1ff){const _0x3f4f2b=_0x5a97a6,_0x202db2=_0x58e1ff[_0x3f4f2b(0x177)]+'-'+Math[_0x3f4f2b(0x175)]()['toString'](0x24)[_0x3f4f2b(0x16d)](0x2,0xa),_0x487024={'id':_0x202db2,'name':_0x58e1ff['name'],'kind':_0x58e1ff[_0x3f4f2b(0x177)],'ktl':EMPTY_KTL};return this[_0x3f4f2b(0x172)](_0x487024);},async 'remove'(_0x54aec0){const _0x1cbc7f=_0x5a97a6,_0xb3e6fc=artifactDir(_0xc5080f,_0x54aec0);if(!existsSync(_0xb3e6fc))throw new KtNotFoundError(_0x1cbc7f(0x186)+_0x54aec0);rmSync(_0xb3e6fc,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x210907,_0x45f064={}){const _0x1225af=_0x10d79a;mkdirSync(_0x210907,{'recursive':!![]});const _0x2e03d2=_0xb73dc2=>join(_0x210907,_0xb73dc2+'.json');for(const [_0x88a4e4,_0x160fa1]of Object[_0x1225af(0x178)](_0x45f064)){if(!existsSync(_0x2e03d2(_0x88a4e4)))writeFileSync(_0x2e03d2(_0x88a4e4),JSON['stringify'](_0x160fa1,null,0x2),_0x1225af(0x168));}return{async 'get'(_0x55c80c){const _0x4b4482=_0x1225af,_0x337cf6=_0x2e03d2(_0x55c80c);if(!existsSync(_0x337cf6))throw new KtNotFoundError('instance\x20'+_0x55c80c);return JSON[_0x4b4482(0x156)](readFileSync(_0x337cf6,_0x4b4482(0x168)));},async 'save'(_0x5ee90a,_0x243a20){const _0x49c59b=_0x1225af,_0x392b60=_0x2e03d2(_0x5ee90a),_0x55381f=existsSync(_0x392b60)?JSON[_0x49c59b(0x156)](readFileSync(_0x392b60,_0x49c59b(0x168))):{'artifactId':'','values':{}},_0x53375b={'artifactId':_0x55381f['artifactId'],'values':{..._0x55381f[_0x49c59b(0x180)],..._0x243a20[_0x49c59b(0x180)]},'common':{..._0x55381f[_0x49c59b(0x162)],..._0x243a20['common']},'tabCommon':{..._0x55381f[_0x49c59b(0x16e)],..._0x243a20['tabCommon']}};writeFileSync(_0x392b60,JSON[_0x49c59b(0x15b)](_0x53375b,null,0x2),_0x49c59b(0x168));},async 'list'(_0x365a7c){const _0x425414=_0x1225af;return readdirSync(_0x210907)[_0x425414(0x17a)](_0x1e304f=>_0x1e304f['endsWith'](_0x425414(0x14d)))[_0x425414(0x167)](_0x48bd56=>{const _0x108b42=_0x425414,_0xf38f5=_0x48bd56[_0x108b42(0x16d)](0x0,-0x5),_0x259204=JSON['parse'](readFileSync(join(_0x210907,_0x48bd56),_0x108b42(0x168)));return{'id':_0xf38f5,'artifactId':_0x259204[_0x108b42(0x173)]};})['filter'](_0x40d8c5=>!_0x365a7c||_0x40d8c5[_0x425414(0x173)]===_0x365a7c);},async 'create'(_0x34594d){const _0x2dea41=_0x1225af,_0x43cfd8='inst-'+Math[_0x2dea41(0x175)]()[_0x2dea41(0x158)](0x24)[_0x2dea41(0x16d)](0x2,0xa);return writeFileSync(_0x2e03d2(_0x43cfd8),JSON['stringify']({'artifactId':_0x34594d[_0x2dea41(0x173)],'values':{},'common':{}},null,0x2),_0x2dea41(0x168)),{'id':_0x43cfd8};}};}function sha256Hex(_0x57cdae){const _0x2a884f=_0x10d79a,_0x505c60=typeof _0x57cdae===_0x2a884f(0x179)?Buffer[_0x2a884f(0x144)](_0x57cdae,_0x2a884f(0x168)):Buffer[_0x2a884f(0x144)](_0x57cdae);return createHash(_0x2a884f(0x159))[_0x2a884f(0x152)](_0x505c60)[_0x2a884f(0x150)](_0x2a884f(0x164));}function writeObject(_0x3f1a0d,_0x170ab6){const _0x2e3bbe=sha256Hex(_0x170ab6),_0x2ec74f=objectPath(_0x3f1a0d,_0x2e3bbe);mkdirSync(dirname(_0x2ec74f),{'recursive':!![]});if(!existsSync(_0x2ec74f))writeFileSync(_0x2ec74f,_0x170ab6);return _0x2e3bbe;}function readLog(_0xcd3804,_0x3b478d,_0x3d5ca5){const _0x25cd59=_0x10d79a,_0x14f564=itemDir(_0xcd3804,_0x3b478d,_0x3d5ca5),_0x3f53e8=join(_0x14f564,'log.json'),_0x1c297f=join(_0x14f564,_0x25cd59(0x17f)),_0x300b36=existsSync(_0x3f53e8)?JSON[_0x25cd59(0x156)](readFileSync(_0x3f53e8,_0x25cd59(0x168))):[],_0x33d729=existsSync(_0x1c297f)?readFileSync(_0x1c297f,_0x25cd59(0x168))[_0x25cd59(0x153)]():_0x300b36['at'](-0x1)?.[_0x25cd59(0x15a)]??null;return{'head':_0x33d729,'items':_0x300b36};}function writeLog(_0x2e4899,_0x2d0b88,_0x5c007e,_0x4239c0,_0x34ab12){const _0x3740d6=_0x10d79a,_0x1358e3=itemDir(_0x2e4899,_0x2d0b88,_0x5c007e);mkdirSync(_0x1358e3,{'recursive':!![]}),writeFileSync(join(_0x1358e3,_0x3740d6(0x17e)),JSON[_0x3740d6(0x15b)](_0x34ab12,null,0x2),'utf8'),writeFileSync(join(_0x1358e3,_0x3740d6(0x17f)),_0x4239c0+'\x0a','utf8');}function findRev(_0x3c06ec,_0x516279){const _0x2832f2=_0x10d79a,_0x271958=join(_0x3c06ec,'items');if(!existsSync(_0x271958))return void 0x0;for(const _0x3d900e of readdirSync(_0x271958,{'withFileTypes':!![]})){if(!_0x3d900e[_0x2832f2(0x145)]())continue;for(const _0x5cc581 of readdirSync(join(_0x271958,_0x3d900e['name']),{'withFileTypes':!![]})){if(!_0x5cc581[_0x2832f2(0x145)]())continue;const _0x1c76f1=readLog(_0x3c06ec,_0x3d900e[_0x2832f2(0x17d)],_0x5cc581[_0x2832f2(0x17d)])[_0x2832f2(0x188)][_0x2832f2(0x165)](_0x507104=>_0x507104[_0x2832f2(0x15a)]===_0x516279);if(_0x1c76f1)return _0x1c76f1;}}return void 0x0;}function filesTextOf(_0x408886,_0x2d0b3e){const _0x3dc9ab=_0x10d79a,_0x235268={};for(const [_0x30f59c,_0x3b8ed9]of Object[_0x3dc9ab(0x178)](_0x2d0b3e['files'])){const _0x2e944a=objectPath(_0x408886,_0x3b8ed9);if(existsSync(_0x2e944a))_0x235268[_0x30f59c]=readFileSync(_0x2e944a,_0x3dc9ab(0x168));}return _0x235268;}function createFsVersionStore(_0x18975f,_0x40cfe4){return mkdirSync(_0x18975f,{'recursive':!![]}),{async 'log'(_0x49a3cc,_0x22dc43){const _0x78949e=_0x3c19,{head:_0x1a6fb7,items:_0x5062db}=readLog(_0x18975f,_0x49a3cc,_0x22dc43);return{'head':_0x1a6fb7,'items':[..._0x5062db][_0x78949e(0x157)]((_0x3416c2,_0x5773b5)=>_0x3416c2['at']<_0x5773b5['at']?0x1:-0x1)};},async 'get'(_0xf70973){const _0x5d21c9=findRev(_0x18975f,_0xf70973);if(!_0x5d21c9)throw new KtNotFoundError('rev\x20'+_0xf70973);return _0x5d21c9;},async 'readFile'(_0x2c5fe7,_0x5d28b5){const _0x1d79d7=_0x3c19,_0x4c8281=await this[_0x1d79d7(0x16f)](_0x2c5fe7),_0x21daaf=_0x4c8281['files'][_0x5d28b5];if(!_0x21daaf)throw new KtNotFoundError(_0x5d28b5);const _0x42ae06=objectPath(_0x18975f,_0x21daaf);if(!existsSync(_0x42ae06))throw new KtNotFoundError(_0x5d28b5);return new Uint8Array(readFileSync(_0x42ae06));},async 'commit'(_0x5761ae){const _0x46889d=_0x3c19;let _0x6a8dc7=_0x5761ae[_0x46889d(0x146)];if(!_0x6a8dc7){const _0x5f1614=await _0x40cfe4[_0x46889d(0x16f)](_0x5761ae['id']);_0x6a8dc7=artifactToFiles(_0x5f1614);}const _0x2fd9b8={},_0x39f314={};for(const [_0x1b7c51,_0x59fb1f]of Object['entries'](_0x6a8dc7)){const _0x4b45f4=typeof _0x59fb1f===_0x46889d(0x179)?_0x59fb1f:new TextDecoder()['decode'](_0x59fb1f);_0x2fd9b8[_0x1b7c51]=_0x4b45f4,_0x39f314[_0x1b7c51]=writeObject(_0x18975f,typeof _0x59fb1f==='string'?Buffer[_0x46889d(0x144)](_0x59fb1f,_0x46889d(0x168)):_0x59fb1f);}const _0x5d0c9b=readLog(_0x18975f,_0x5761ae[_0x46889d(0x177)],_0x5761ae['id']);if(_0x5d0c9b[_0x46889d(0x149)]){const _0x1de677=_0x5d0c9b[_0x46889d(0x188)]['find'](_0x3d5507=>_0x3d5507[_0x46889d(0x15a)]===_0x5d0c9b[_0x46889d(0x149)]);if(_0x1de677&&filesEqual(_0x2fd9b8,filesTextOf(_0x18975f,_0x1de677)))return _0x1de677;}const _0x50be89=new Date(),_0x568e9b=String(_0x50be89[_0x46889d(0x184)]())[_0x46889d(0x16d)](0x2)+String(_0x50be89[_0x46889d(0x170)]()+0x1)['padStart'](0x2,'0')+String(_0x50be89[_0x46889d(0x161)]())['padStart'](0x2,'0')+String(_0x50be89[_0x46889d(0x15e)]())[_0x46889d(0x15f)](0x2,'0')+String(_0x50be89[_0x46889d(0x154)]())[_0x46889d(0x15f)](0x2,'0'),_0x4d1492=sha256Hex(Object['values'](_0x39f314)['sort']()[_0x46889d(0x14b)](','))[_0x46889d(0x16d)](0x0,0x8),_0x24335e={'rev':_0x568e9b+_0x46889d(0x176)+_0x4d1492,'kind':_0x5761ae[_0x46889d(0x177)],'id':_0x5761ae['id'],'at':_0x50be89[_0x46889d(0x185)](),'parent':_0x5d0c9b[_0x46889d(0x149)],'by':_0x5761ae['by'],'note':_0x5761ae[_0x46889d(0x163)],'files':_0x39f314,'meta':_0x5761ae[_0x46889d(0x15d)]};return writeLog(_0x18975f,_0x5761ae[_0x46889d(0x177)],_0x5761ae['id'],_0x24335e[_0x46889d(0x15a)],[..._0x5d0c9b[_0x46889d(0x188)],_0x24335e]),_0x24335e;},async 'restore'(_0x1dbb66,_0x53fbe5,_0x4e1754,_0x2ff4c2){const _0x465fcf=_0x3c19,_0x7de088=await this[_0x465fcf(0x16f)](_0x4e1754),_0x3448db={};for(const _0x1b9d9b of Object['keys'](_0x7de088[_0x465fcf(0x146)])){_0x3448db[_0x1b9d9b]=new TextDecoder()[_0x465fcf(0x155)](await this[_0x465fcf(0x181)](_0x4e1754,_0x1b9d9b));}const _0x219b6a=filesToArtifact(_0x3448db,_0x53fbe5);return await _0x40cfe4[_0x465fcf(0x172)]({..._0x219b6a,'id':_0x53fbe5,'kind':_0x219b6a[_0x465fcf(0x177)],'etag':void 0x0}),this[_0x465fcf(0x169)]({'kind':_0x1dbb66,'id':_0x53fbe5,'files':_0x3448db,'by':_0x2ff4c2,'note':'\u6062\u590D\u81EA\x20'+_0x4e1754});}};}function createKtFsStores(_0x5ee207){const _0x2bd423=_0x10d79a,_0x267e42=createFsArtifactStore(resolveRoot(_0x5ee207[_0x2bd423(0x17c)],_0x5ee207[_0x2bd423(0x17b)]),_0x5ee207[_0x2bd423(0x182)]),_0x3fff59=_0x5ee207['instancesRoot']?createFsInstanceStore(resolveRoot(_0x5ee207[_0x2bd423(0x171)],_0x5ee207[_0x2bd423(0x17b)]),_0x5ee207[_0x2bd423(0x147)]):void 0x0,_0x3d1ac2=_0x5ee207[_0x2bd423(0x183)]?createFsVersionStore(resolveRoot(_0x5ee207[_0x2bd423(0x183)],_0x5ee207[_0x2bd423(0x17b)]),_0x267e42):void 0x0;return{'artifacts':_0x267e42,'instances':_0x3fff59,'versions':_0x3d1ac2};}export{createKtFsStores};
1
+ const _0x2afcb0=_0x3778;(function(_0x267145,_0x2f087f){const _0xa86319=_0x3778,_0x5ceac5=_0x267145();while(!![]){try{const _0x42a931=parseInt(_0xa86319(0x9d))/0x1*(parseInt(_0xa86319(0x76))/0x2)+-parseInt(_0xa86319(0xad))/0x3+parseInt(_0xa86319(0x68))/0x4+-parseInt(_0xa86319(0x87))/0x5+-parseInt(_0xa86319(0x7b))/0x6*(-parseInt(_0xa86319(0x78))/0x7)+-parseInt(_0xa86319(0x82))/0x8*(-parseInt(_0xa86319(0x6f))/0x9)+parseInt(_0xa86319(0x8a))/0xa;if(_0x42a931===_0x2f087f)break;else _0x5ceac5['push'](_0x5ceac5['shift']());}catch(_0x11cdc9){_0x5ceac5['push'](_0x5ceac5['shift']());}}}(_0x480e,0x7d9f0));import{mkdirSync,existsSync,rmSync,readdirSync,writeFileSync,readFileSync}from'fs';import{join,isAbsolute,resolve,dirname}from'path';import{ARTIFACT_FILE_BODY,KtNotFoundError,EMPTY_KTL,KtConflictError,filesToArtifact,artifactToFiles,filesEqual,ARTIFACT_FILE_META,ARTIFACT_FILE_FILL,ARTIFACT_FILE_REPORT}from'@k-table/report/store';import{createHash}from'crypto';function resolveRoot(_0xb43e26,_0x1a14dd=process[_0x2afcb0(0x7a)]()){const _0x1a6e5d=isAbsolute(_0xb43e26)?_0xb43e26:resolve(_0x1a14dd,_0xb43e26);return mkdirSync(_0x1a6e5d,{'recursive':!![]}),_0x1a6e5d;}function artifactDir(_0x400320,_0x160626){return join(_0x400320,_0x160626);}function objectPath(_0x3bff2c,_0x5c92ec){const _0x26a7e6=_0x2afcb0;return join(_0x3bff2c,_0x26a7e6(0x7e),_0x5c92ec['slice'](0x0,0x2),_0x5c92ec);}function itemDir(_0x55ea1a,_0x5ed0f4,_0x287cc1){const _0x29a9cd=_0x2afcb0;return join(_0x55ea1a,_0x29a9cd(0x85),_0x5ed0f4,_0x287cc1);}function newEtag(){const _0xd30aeb=_0x2afcb0;return Date[_0xd30aeb(0x7d)]()[_0xd30aeb(0x8d)](0x24)+'-'+Math[_0xd30aeb(0xa1)]()['toString'](0x24)[_0xd30aeb(0x88)](0x2,0x8);}function readEtag(_0x374e49){const _0x3705fd=_0x2afcb0,_0x1f1aa3=join(_0x374e49,_0x3705fd(0x95));return existsSync(_0x1f1aa3)?readFileSync(_0x1f1aa3,'utf8')[_0x3705fd(0xae)]():void 0x0;}function writeArtifactDir(_0x2111e5,_0x1dc14c,_0x2ce2b4){const _0x4f474e=_0x2afcb0;mkdirSync(join(_0x2111e5,'faces'),{'recursive':!![]});const _0x1bda4f=artifactToFiles(_0x1dc14c);writeFileSync(join(_0x2111e5,ARTIFACT_FILE_META),_0x1bda4f[ARTIFACT_FILE_META]??'{}',_0x4f474e(0x98)),writeFileSync(join(_0x2111e5,ARTIFACT_FILE_BODY),_0x1bda4f[ARTIFACT_FILE_BODY]??'',_0x4f474e(0x98));const _0x41c38b=join(_0x2111e5,ARTIFACT_FILE_FILL),_0x5acf2a=join(_0x2111e5,ARTIFACT_FILE_REPORT);if(_0x1bda4f[ARTIFACT_FILE_FILL])writeFileSync(_0x41c38b,_0x1bda4f[ARTIFACT_FILE_FILL],_0x4f474e(0x98));else{if(existsSync(_0x41c38b))rmSync(_0x41c38b);}if(_0x1bda4f[ARTIFACT_FILE_REPORT])writeFileSync(_0x5acf2a,_0x1bda4f[ARTIFACT_FILE_REPORT],_0x4f474e(0x98));else{if(existsSync(_0x5acf2a))rmSync(_0x5acf2a);}writeFileSync(join(_0x2111e5,_0x4f474e(0x95)),_0x2ce2b4,_0x4f474e(0x98));}function _0x480e(){const _0x45c113=['DMfSDwvZ','C2vLzeLUC3rHBMnLCW','zNjVBq','lMv0ywC','C2f2zq','y29TBw9U','DxrMoa','Dg9ju09tDhjPBMC','y29TBwL0','Bg9NlMPZB24','AxneAxjLy3rVCNK','mta3n0XvChn5yq','A2v5CW','CMv2','zgLNzxn0','CMfUzg9T','CgfKu3rHCNq','zMLSDgvY','A2LUza','BM90zq','z2v0twLUDxrLCW','CgfYC2u','Aw5ZDc0','Aw5ZDgfUy2vZuM9VDa','zw50CMLLCW','AgvHza','C2vLza','mJaWntG3nwzfrxjQrq','DhjPBq','ndqYnZG4uMfbvKfK','zMLUza','sevbra','lwXVy2fSlq','zMLSzxm','DMvYC2LVBNnsB290','z2v0sg91CNm','mti3ota3mu5MwwPiAq','lMPZB24','yxj0AwzHy3rjza','C29YDa','DxbKyxrL','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','Aw5ZDgfUy2uG','nJe4rfjKChPe','z2v0','mZiYntC0rgjvAMD2','z2v0rgf0zq','y3DK','nJz3tLLQCeu','zgvJB2rL','BM93','B2jQzwn0CW','zxrHzW','C2HHmJu2','yxj0AwzHy3qG','mJrtA3bRA3C','AM9PBG','DgfIq29TBw9U','AxrLBxm','BMfTzq','mJq3otC1meHws3v6Bq','C2XPy2u','C3rYAw5N','mZaYmZCWmgLgA3PhzG','C3rYAw5NAwz5','zw5KC1DPDgG','Dg9tDhjPBMC','z2v0tw9UDgG','CMvHzezPBgu','z2v0rNvSBfLLyxi','yxj0AwzHy3rZuM9VDa'];_0x480e=function(){return _0x45c113;};return _0x480e();}function readArtifactDir(_0x7c1af5,_0x355e48){const _0x5b23cf=_0x2afcb0,_0x298712={},_0x28f37c=join(_0x7c1af5,ARTIFACT_FILE_META),_0x406a40=join(_0x7c1af5,ARTIFACT_FILE_BODY);if(existsSync(_0x28f37c))_0x298712[ARTIFACT_FILE_META]=readFileSync(_0x28f37c,_0x5b23cf(0x98));if(existsSync(_0x406a40))_0x298712[ARTIFACT_FILE_BODY]=readFileSync(_0x406a40,'utf8');const _0x24fe86=join(_0x7c1af5,ARTIFACT_FILE_FILL),_0x426fd6=join(_0x7c1af5,ARTIFACT_FILE_REPORT);if(existsSync(_0x24fe86))_0x298712[ARTIFACT_FILE_FILL]=readFileSync(_0x24fe86,_0x5b23cf(0x98));if(existsSync(_0x426fd6))_0x298712[ARTIFACT_FILE_REPORT]=readFileSync(_0x426fd6,_0x5b23cf(0x98));return{...filesToArtifact(_0x298712,_0x355e48),'etag':readEtag(_0x7c1af5)};}function createFsArtifactStore(_0x53aea5,_0x4521a2=[]){const _0x2c8722=_0x2afcb0;mkdirSync(_0x53aea5,{'recursive':!![]});for(const _0x316d63 of _0x4521a2){const _0xeeb9b4=artifactDir(_0x53aea5,_0x316d63['id']),_0x871299=join(_0xeeb9b4,ARTIFACT_FILE_BODY);if(!existsSync(_0x871299))writeArtifactDir(_0xeeb9b4,_0x316d63,_0x316d63[_0x2c8722(0x7f)]??newEtag());}return{async 'list'(_0x512366){const _0x1dbf29=_0x2c8722;if(!existsSync(_0x53aea5))return[];const _0x1b0056=[];for(const _0x790c97 of readdirSync(_0x53aea5,{'withFileTypes':!![]})){if(!_0x790c97['isDirectory']())continue;try{const _0x5b0f41=readArtifactDir(artifactDir(_0x53aea5,_0x790c97[_0x1dbf29(0x86)]),_0x790c97[_0x1dbf29(0x86)]);if(!_0x512366||_0x5b0f41[_0x1dbf29(0xa4)]===_0x512366)_0x1b0056['push']({'id':_0x5b0f41['id'],'name':_0x5b0f41['name'],'kind':_0x5b0f41[_0x1dbf29(0xa4)]});}catch{}}return _0x1b0056;},async 'get'(_0x241293){const _0x52a9a9=_0x2c8722,_0x3e1775=artifactDir(_0x53aea5,_0x241293);if(!existsSync(_0x3e1775))throw new KtNotFoundError(_0x52a9a9(0x81)+_0x241293);return readArtifactDir(_0x3e1775,_0x241293);},async 'save'(_0x84c6d4){const _0x258b32=_0x2c8722,_0x21e7f4=artifactDir(_0x53aea5,_0x84c6d4['id']),_0xab548d=existsSync(_0x21e7f4)?readArtifactDir(_0x21e7f4,_0x84c6d4['id']):void 0x0;if(_0x84c6d4[_0x258b32(0x7f)]&&_0xab548d?.[_0x258b32(0x7f)]&&_0x84c6d4[_0x258b32(0x7f)]!==_0xab548d['etag'])throw new KtConflictError(_0x258b32(0x74),_0xab548d);const _0x17f5db=newEtag();return writeArtifactDir(_0x21e7f4,_0x84c6d4,_0x17f5db),{..._0x84c6d4,'etag':_0x17f5db};},async 'create'(_0x4000a8){const _0x15f9e2=_0x2c8722,_0x1807a1=_0x4000a8[_0x15f9e2(0xa4)]+'-'+Math['random']()[_0x15f9e2(0x8d)](0x24)[_0x15f9e2(0x88)](0x2,0xa),_0x2b0313={'id':_0x1807a1,'name':_0x4000a8['name'],'kind':_0x4000a8['kind'],'ktl':EMPTY_KTL};return this[_0x15f9e2(0x96)](_0x2b0313);},async 'remove'(_0x3db9f3){const _0x202260=_0x2c8722,_0x3937c0=artifactDir(_0x53aea5,_0x3db9f3);if(!existsSync(_0x3937c0))throw new KtNotFoundError(_0x202260(0x81)+_0x3db9f3);rmSync(_0x3937c0,{'recursive':!![],'force':!![]});}};}function _0x3778(_0x264a7d,_0x432404){_0x264a7d=_0x264a7d-0x68;const _0x480efb=_0x480e();let _0x3778db=_0x480efb[_0x264a7d];if(_0x3778['LYEaOX']===undefined){var _0x222413=function(_0x39ae65){const _0x5af5d0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3d3239='',_0xb43e26='';for(let _0x1a14dd=0x0,_0x1a6e5d,_0x400320,_0x160626=0x0;_0x400320=_0x39ae65['charAt'](_0x160626++);~_0x400320&&(_0x1a6e5d=_0x1a14dd%0x4?_0x1a6e5d*0x40+_0x400320:_0x400320,_0x1a14dd++%0x4)?_0x3d3239+=String['fromCharCode'](0xff&_0x1a6e5d>>(-0x2*_0x1a14dd&0x6)):0x0){_0x400320=_0x5af5d0['indexOf'](_0x400320);}for(let _0x3bff2c=0x0,_0x5c92ec=_0x3d3239['length'];_0x3bff2c<_0x5c92ec;_0x3bff2c++){_0xb43e26+='%'+('00'+_0x3d3239['charCodeAt'](_0x3bff2c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xb43e26);};_0x3778['rZfaxX']=_0x222413,_0x3778['wQKhFd']={},_0x3778['LYEaOX']=!![];}const _0x9b8c43=_0x480efb[0x0];_0x3778['upgzAq']!==_0x9b8c43&&(_0x3778['wQKhFd']={},_0x3778['upgzAq']=_0x9b8c43);const _0x23720d=_0x3778['wQKhFd'][_0x264a7d];return _0x23720d===undefined?(_0x3778db=_0x3778['rZfaxX'](_0x3778db),_0x3778['wQKhFd'][_0x264a7d]=_0x3778db):_0x3778db=_0x23720d,_0x3778db;}function createFsInstanceStore(_0x40298d,_0x1f6fbd={}){const _0x5db1ee=_0x2afcb0;mkdirSync(_0x40298d,{'recursive':!![]});const _0x1e32d4=_0x266fea=>join(_0x40298d,_0x266fea+'.json');for(const [_0x51f349,_0x56bf91]of Object[_0x5db1ee(0xaa)](_0x1f6fbd)){if(!existsSync(_0x1e32d4(_0x51f349)))writeFileSync(_0x1e32d4(_0x51f349),JSON[_0x5db1ee(0x8b)](_0x56bf91,null,0x2),'utf8');}return{async 'get'(_0x203332){const _0x2f5fd3=_0x5db1ee,_0x42443d=_0x1e32d4(_0x203332);if(!existsSync(_0x42443d))throw new KtNotFoundError(_0x2f5fd3(0x75)+_0x203332);return JSON[_0x2f5fd3(0xa7)](readFileSync(_0x42443d,_0x2f5fd3(0x98)));},async 'save'(_0x46bf10,_0x42a5e5){const _0x5e2c96=_0x5db1ee,_0x514188=_0x1e32d4(_0x46bf10),_0x505d33=existsSync(_0x514188)?JSON['parse'](readFileSync(_0x514188,_0x5e2c96(0x98))):{'artifactId':'','values':{}},_0xeae3f4={'artifactId':_0x505d33[_0x5e2c96(0x71)],'values':{..._0x505d33['values'],..._0x42a5e5[_0x5e2c96(0x92)]},'common':{..._0x505d33[_0x5e2c96(0x97)],..._0x42a5e5[_0x5e2c96(0x97)]},'tabCommon':{..._0x505d33['tabCommon'],..._0x42a5e5[_0x5e2c96(0x84)]}};writeFileSync(_0x514188,JSON[_0x5e2c96(0x8b)](_0xeae3f4,null,0x2),_0x5e2c96(0x98));},async 'list'(_0x326954){const _0x1ef43b=_0x5db1ee;return readdirSync(_0x40298d)[_0x1ef43b(0xa3)](_0x356f5d=>_0x356f5d[_0x1ef43b(0x8c)](_0x1ef43b(0x70)))['map'](_0x413fb7=>{const _0x5d4563=_0x1ef43b,_0x384831=_0x413fb7[_0x5d4563(0x88)](0x0,-0x5),_0x513137=JSON[_0x5d4563(0xa7)](readFileSync(join(_0x40298d,_0x413fb7),_0x5d4563(0x98)));return{'id':_0x384831,'artifactId':_0x513137[_0x5d4563(0x71)]};})[_0x1ef43b(0xa3)](_0x4d7667=>!_0x326954||_0x4d7667[_0x1ef43b(0x71)]===_0x326954);},async 'create'(_0x19d772){const _0x7991d2=_0x5db1ee,_0x5bc1a3=_0x7991d2(0xa8)+Math[_0x7991d2(0xa1)]()['toString'](0x24)[_0x7991d2(0x88)](0x2,0xa);return writeFileSync(_0x1e32d4(_0x5bc1a3),JSON[_0x7991d2(0x8b)]({'artifactId':_0x19d772[_0x7991d2(0x71)],'values':{},'common':{}},null,0x2),_0x7991d2(0x98)),{'id':_0x5bc1a3};}};}function sha256Hex(_0x297f44){const _0x336c71=_0x2afcb0,_0x87c77a=typeof _0x297f44===_0x336c71(0x89)?Buffer[_0x336c71(0x94)](_0x297f44,'utf8'):Buffer[_0x336c71(0x94)](_0x297f44);return createHash(_0x336c71(0x80))[_0x336c71(0x73)](_0x87c77a)[_0x336c71(0xa0)]('hex');}function writeObject(_0x2f71a6,_0x5114d4){const _0x2ee8d4=sha256Hex(_0x5114d4),_0x3b7bc3=objectPath(_0x2f71a6,_0x2ee8d4);mkdirSync(dirname(_0x3b7bc3),{'recursive':!![]});if(!existsSync(_0x3b7bc3))writeFileSync(_0x3b7bc3,_0x5114d4);return _0x2ee8d4;}function readLog(_0x45d627,_0x9d8e9f,_0x42d671){const _0x3e89b0=_0x2afcb0,_0x219479=itemDir(_0x45d627,_0x9d8e9f,_0x42d671),_0x549d69=join(_0x219479,_0x3e89b0(0x9b)),_0x1d55b3=join(_0x219479,_0x3e89b0(0x6a)),_0x5e583a=existsSync(_0x549d69)?JSON[_0x3e89b0(0xa7)](readFileSync(_0x549d69,'utf8')):[],_0x29a9db=existsSync(_0x1d55b3)?readFileSync(_0x1d55b3,_0x3e89b0(0x98))['trim']():_0x5e583a['at'](-0x1)?.[_0x3e89b0(0x9f)]??null;return{'head':_0x29a9db,'items':_0x5e583a};}function writeLog(_0x58c994,_0x1ca090,_0x4cc90f,_0x4b387f,_0x36aff2){const _0x42f4bd=_0x2afcb0,_0x4997a9=itemDir(_0x58c994,_0x1ca090,_0x4cc90f);mkdirSync(_0x4997a9,{'recursive':!![]}),writeFileSync(join(_0x4997a9,'log.json'),JSON[_0x42f4bd(0x8b)](_0x36aff2,null,0x2),_0x42f4bd(0x98)),writeFileSync(join(_0x4997a9,'HEAD'),_0x4b387f+'\x0a',_0x42f4bd(0x98));}function findRev(_0x488417,_0xd37d23){const _0x46cf17=_0x2afcb0,_0x103cdb=join(_0x488417,_0x46cf17(0x85));if(!existsSync(_0x103cdb))return void 0x0;for(const _0x10e6bf of readdirSync(_0x103cdb,{'withFileTypes':!![]})){if(!_0x10e6bf[_0x46cf17(0x9c)]())continue;for(const _0xc8b69d of readdirSync(join(_0x103cdb,_0x10e6bf[_0x46cf17(0x86)]),{'withFileTypes':!![]})){if(!_0xc8b69d[_0x46cf17(0x9c)]())continue;const _0x338f52=readLog(_0x488417,_0x10e6bf[_0x46cf17(0x86)],_0xc8b69d[_0x46cf17(0x86)])['items'][_0x46cf17(0x69)](_0x198f9a=>_0x198f9a['rev']===_0xd37d23);if(_0x338f52)return _0x338f52;}}return void 0x0;}function filesTextOf(_0x421f83,_0x34994a){const _0x1dec85=_0x2afcb0,_0x70b37a={};for(const [_0x443395,_0x48de21]of Object[_0x1dec85(0xaa)](_0x34994a[_0x1dec85(0x6c)])){const _0x67c7d0=objectPath(_0x421f83,_0x48de21);if(existsSync(_0x67c7d0))_0x70b37a[_0x443395]=readFileSync(_0x67c7d0,_0x1dec85(0x98));}return _0x70b37a;}function createFsVersionStore(_0x3c67c0,_0x1d20c6){return mkdirSync(_0x3c67c0,{'recursive':!![]}),{async 'log'(_0x1d0f39,_0x9e729b){const _0x5dbeb5=_0x3778,{head:_0x3a9f22,items:_0x31ac55}=readLog(_0x3c67c0,_0x1d0f39,_0x9e729b);return{'head':_0x3a9f22,'items':[..._0x31ac55][_0x5dbeb5(0x72)]((_0xb2cfb8,_0x3b2f76)=>_0xb2cfb8['at']<_0x3b2f76['at']?0x1:-0x1)};},async 'get'(_0x3ed1ef){const _0x229cab=findRev(_0x3c67c0,_0x3ed1ef);if(!_0x229cab)throw new KtNotFoundError('rev\x20'+_0x3ed1ef);return _0x229cab;},async 'readFile'(_0x1ab92d,_0x48fdb6){const _0xb80d6d=await this['get'](_0x1ab92d),_0xebcef5=_0xb80d6d['files'][_0x48fdb6];if(!_0xebcef5)throw new KtNotFoundError(_0x48fdb6);const _0x2bb2ec=objectPath(_0x3c67c0,_0xebcef5);if(!existsSync(_0x2bb2ec))throw new KtNotFoundError(_0x48fdb6);return new Uint8Array(readFileSync(_0x2bb2ec));},async 'commit'(_0x30da1b){const _0x5136a2=_0x3778;let _0x2dac04=_0x30da1b['files'];if(!_0x2dac04){const _0x33f907=await _0x1d20c6[_0x5136a2(0x77)](_0x30da1b['id']);_0x2dac04=artifactToFiles(_0x33f907);}const _0x3ccc67={},_0x4aeb4f={};for(const [_0x352090,_0x5117f0]of Object[_0x5136a2(0xaa)](_0x2dac04)){const _0x469f27=typeof _0x5117f0==='string'?_0x5117f0:new TextDecoder()[_0x5136a2(0x7c)](_0x5117f0);_0x3ccc67[_0x352090]=_0x469f27,_0x4aeb4f[_0x352090]=writeObject(_0x3c67c0,typeof _0x5117f0==='string'?Buffer[_0x5136a2(0x94)](_0x5117f0,'utf8'):_0x5117f0);}const _0x1a2927=readLog(_0x3c67c0,_0x30da1b[_0x5136a2(0xa4)],_0x30da1b['id']);if(_0x1a2927[_0x5136a2(0xab)]){const _0xf40991=_0x1a2927[_0x5136a2(0x85)][_0x5136a2(0x69)](_0xb04601=>_0xb04601[_0x5136a2(0x9f)]===_0x1a2927['head']);if(_0xf40991&&filesEqual(_0x3ccc67,filesTextOf(_0x3c67c0,_0xf40991)))return _0xf40991;}const _0x539f08=new Date(),_0x256c3a=String(_0x539f08[_0x5136a2(0x90)]())[_0x5136a2(0x88)](0x2)+String(_0x539f08[_0x5136a2(0x8e)]()+0x1)[_0x5136a2(0xa2)](0x2,'0')+String(_0x539f08[_0x5136a2(0x79)]())[_0x5136a2(0xa2)](0x2,'0')+String(_0x539f08[_0x5136a2(0x6e)]())[_0x5136a2(0xa2)](0x2,'0')+String(_0x539f08[_0x5136a2(0xa6)]())[_0x5136a2(0xa2)](0x2,'0'),_0x16647d=sha256Hex(Object[_0x5136a2(0x92)](_0x4aeb4f)[_0x5136a2(0x72)]()[_0x5136a2(0x83)](','))[_0x5136a2(0x88)](0x0,0x8),_0x423405={'rev':_0x256c3a+_0x5136a2(0x6b)+_0x16647d,'kind':_0x30da1b['kind'],'id':_0x30da1b['id'],'at':_0x539f08[_0x5136a2(0x99)](),'parent':_0x1a2927[_0x5136a2(0xab)],'by':_0x30da1b['by'],'note':_0x30da1b[_0x5136a2(0xa5)],'files':_0x4aeb4f,'meta':_0x30da1b['meta']};return writeLog(_0x3c67c0,_0x30da1b[_0x5136a2(0xa4)],_0x30da1b['id'],_0x423405['rev'],[..._0x1a2927[_0x5136a2(0x85)],_0x423405]),_0x423405;},async 'restore'(_0x282058,_0x19c936,_0x39e744,_0x5106e5){const _0x635646=_0x3778,_0x13d130=await this[_0x635646(0x77)](_0x39e744),_0x35381f={};for(const _0xe8d823 of Object[_0x635646(0x9e)](_0x13d130['files'])){_0x35381f[_0xe8d823]=new TextDecoder()['decode'](await this[_0x635646(0x8f)](_0x39e744,_0xe8d823));}const _0xc3272=filesToArtifact(_0x35381f,_0x19c936);return await _0x1d20c6[_0x635646(0x96)]({..._0xc3272,'id':_0x19c936,'kind':_0xc3272[_0x635646(0xa4)],'etag':void 0x0}),this[_0x635646(0x9a)]({'kind':_0x282058,'id':_0x19c936,'files':_0x35381f,'by':_0x5106e5,'note':'\u6062\u590D\u81EA\x20'+_0x39e744});}};}function createKtFsStores(_0x1b1f03){const _0x2d3ca5=_0x2afcb0,_0x16076f=createFsArtifactStore(resolveRoot(_0x1b1f03[_0x2d3ca5(0x91)],_0x1b1f03[_0x2d3ca5(0x7a)]),_0x1b1f03[_0x2d3ca5(0xac)]),_0x4ebd7c=_0x1b1f03['instancesRoot']?createFsInstanceStore(resolveRoot(_0x1b1f03[_0x2d3ca5(0xa9)],_0x1b1f03[_0x2d3ca5(0x7a)]),_0x1b1f03[_0x2d3ca5(0x93)]):void 0x0,_0x23e75f=_0x1b1f03[_0x2d3ca5(0x6d)]?createFsVersionStore(resolveRoot(_0x1b1f03['versionsRoot'],_0x1b1f03[_0x2d3ca5(0x7a)]),_0x16076f):void 0x0;return{'artifacts':_0x16076f,'instances':_0x4ebd7c,'versions':_0x23e75f};}export{createKtFsStores};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';const _0x57821b=_0x1721;function _0xcfa7(){const _0xc101d4=['5yAf6yoO6zsz6k+V','ohDMtwnkva','s3rtDg9YzuvYCM9Y','C2XPy2u','Aw5ZDgfUy2vZioACQUMfJEE9RG','y3vYCMvUDa','C2vHCMnOugfYyw1Z','A2LUza','DMvYC2LVBNm','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','mJy2mNvNvMrIra','CMvTB3zLioACQUwUNUEoSa','C3bSAxq','Bg9N','BgLZDa','5PYQ5OM+5yIW','y29TBwL0','ue9tva','qgSTDgfIBguVCMvWB3j0l3n0B3jL','CMvZDg9Yzq','mta0ntmWveXJu0TN','Aw5ZDgfUy2vZ','ufvu','mJeXmZiYn2rrwuzzva','s3rdB25MBgLJDevYCM9Y','Bwv0Ag9K','BwvZC2fNzq','y3jLyxrLs3riyw5KBgvY','CgfYyw1Z','y3jLyxrLioACQUwUNUEoSa','y3jLyxrL','DMvYC2LVBNmG5PYQ6ywn572U','zgvMAw5Ls3rdB25MAwC','yxj0AwzHy3rZ','BgvUz3rO','Dg9vChbLCKnHC2u','Cgf0Ag5HBwu','nJC3mdGYrevdBM1m','r0vu','z2v0','yxj0AwzHy3rjza','DxjS','Cgf0Aa','nJy5mdi2n2T2swPjtq','ntKZnZC4Ewvvt0T2','mte1ntiYoejxtwDLtq','l2fWAs9RDa','mJfPC2zUAeW','mJu2otC4mhv4B2LkAW','CMvHzezPBgu','nhznwLvfzW','Aw5KzxHpzG'];_0xcfa7=function(){return _0xc101d4;};return _0xcfa7();}(function(_0x2e085e,_0x2ba0a6){const _0x4874bb=_0x1721,_0x4d57b3=_0x2e085e();while(!![]){try{const _0x3f01eb=parseInt(_0x4874bb(0x1e9))/0x1+-parseInt(_0x4874bb(0x1f0))/0x2+parseInt(_0x4874bb(0x20f))/0x3+-parseInt(_0x4874bb(0x1f6))/0x4*(-parseInt(_0x4874bb(0x1f4))/0x5)+parseInt(_0x4874bb(0x1f1))/0x6*(parseInt(_0x4874bb(0x1f3))/0x7)+parseInt(_0x4874bb(0x1f9))/0x8*(parseInt(_0x4874bb(0x1ef))/0x9)+parseInt(_0x4874bb(0x20c))/0xa*(-parseInt(_0x4874bb(0x202))/0xb);if(_0x3f01eb===_0x2ba0a6)break;else _0x4d57b3['push'](_0x4d57b3['shift']());}catch(_0x1bb166){_0x4d57b3['push'](_0x4d57b3['shift']());}}}(_0xcfa7,0x5f315));var store=require(_0x57821b(0x20a));async function pathParts(_0x3a5039,_0x431439){const _0x35423d=_0x57821b,_0x13152b=_0x3a5039[_0x35423d(0x214)]?await _0x3a5039['params']:void 0x0;if(_0x13152b?.[_0x35423d(0x1ee)]?.[_0x35423d(0x1e6)])return _0x13152b['path'];const _0x4b06b5=_0x431439['pathname'][_0x35423d(0x1f7)](_0x35423d(0x1f2)),_0x53bee7=_0x4b06b5>=0x0?_0x431439[_0x35423d(0x1e8)][_0x35423d(0x1fb)](_0x4b06b5+_0x35423d(0x1f2)[_0x35423d(0x1e6)]):_0x431439[_0x35423d(0x1e8)];return _0x53bee7[_0x35423d(0x204)]('/')['filter'](Boolean);}function _0x1721(_0x31eb35,_0x28282a){_0x31eb35=_0x31eb35-0x1e2;const _0xcfa7de=_0xcfa7();let _0x17213f=_0xcfa7de[_0x31eb35];if(_0x1721['IytDXS']===undefined){var _0x32699f=function(_0x2c39b4){const _0x2087ba='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2ccff4='',_0x3a5039='';for(let _0x431439=0x0,_0x13152b,_0x4b06b5,_0x53bee7=0x0;_0x4b06b5=_0x2c39b4['charAt'](_0x53bee7++);~_0x4b06b5&&(_0x13152b=_0x431439%0x4?_0x13152b*0x40+_0x4b06b5:_0x4b06b5,_0x431439++%0x4)?_0x2ccff4+=String['fromCharCode'](0xff&_0x13152b>>(-0x2*_0x431439&0x6)):0x0){_0x4b06b5=_0x2087ba['indexOf'](_0x4b06b5);}for(let _0x2f33b5=0x0,_0x1061f5=_0x2ccff4['length'];_0x2f33b5<_0x1061f5;_0x2f33b5++){_0x3a5039+='%'+('00'+_0x2ccff4['charCodeAt'](_0x2f33b5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3a5039);};_0x1721['CleQGt']=_0x32699f,_0x1721['queuND']={},_0x1721['IytDXS']=!![];}const _0x2ccf1c=_0xcfa7de[0x0];_0x1721['xDfNEC']!==_0x2ccf1c&&(_0x1721['queuND']={},_0x1721['xDfNEC']=_0x2ccf1c);const _0x321e8a=_0x1721['queuND'][_0x31eb35];return _0x321e8a===undefined?(_0x17213f=_0x1721['CleQGt'](_0x17213f),_0x1721['queuND'][_0x31eb35]=_0x17213f):_0x17213f=_0x321e8a,_0x17213f;}function json(_0x2f33b5,_0x1061f5=0xc8){return new Response(JSON['stringify'](_0x2f33b5),{'status':_0x1061f5,'headers':{'content-type':'application/json;\x20charset=utf-8'}});}function fail(_0x1e2ab3){const _0x33a672=_0x57821b;if(_0x1e2ab3 instanceof store[_0x33a672(0x210)])return json({'message':_0x1e2ab3[_0x33a672(0x212)],'current':_0x1e2ab3[_0x33a672(0x1fd)]},0x199);if(_0x1e2ab3 instanceof store['KtNotFoundError'])return json({'message':_0x1e2ab3[_0x33a672(0x212)]},0x194);if(_0x1e2ab3 instanceof store[_0x33a672(0x1fa)])return json({'message':_0x1e2ab3['message']},_0x1e2ab3['status']??0x1f4);return json({'message':_0x1e2ab3 instanceof Error?_0x1e2ab3['message']:_0x33a672(0x1f8)},0x1f4);}async function readBody(_0x25b0eb){const _0x2dab84=await _0x25b0eb['text']();if(!_0x2dab84)return null;return JSON['parse'](_0x2dab84);}function createKtHandler(_0x506eb6){const _0x4b7420=async(_0x311614,_0x3242ac={})=>{const _0x4acbb6=_0x1721;try{const _0x361629=new URL(_0x311614[_0x4acbb6(0x1ed)]),_0x46318f=await pathParts(_0x3242ac,_0x361629),[_0x321d5a,_0x36353d,_0x1c474a]=_0x46318f,_0x4a4359=_0x311614[_0x4acbb6(0x211)][_0x4acbb6(0x1e7)]();if(_0x321d5a===_0x4acbb6(0x1e5)&&!_0x36353d&&_0x4a4359==='GET'){const _0x972bff=_0x361629['searchParams'][_0x4acbb6(0x1eb)](_0x4acbb6(0x1ff));return json({'items':await _0x506eb6[_0x4acbb6(0x1e5)][_0x4acbb6(0x206)](_0x972bff||void 0x0)});}if(_0x321d5a===_0x4acbb6(0x1e5)&&!_0x36353d&&_0x4a4359===_0x4acbb6(0x209)){if(!_0x506eb6[_0x4acbb6(0x1e5)][_0x4acbb6(0x1e2)])return json({'message':_0x4acbb6(0x215)},0x194);return json(await _0x506eb6[_0x4acbb6(0x1e5)][_0x4acbb6(0x1e2)](await readBody(_0x311614)));}if(_0x321d5a===_0x4acbb6(0x1e5)&&_0x36353d&&_0x4a4359===_0x4acbb6(0x1ea))return json(await _0x506eb6[_0x4acbb6(0x1e5)][_0x4acbb6(0x1eb)](_0x36353d));if(_0x321d5a===_0x4acbb6(0x1e5)&&_0x36353d&&_0x4a4359===_0x4acbb6(0x20e))return json(await _0x506eb6[_0x4acbb6(0x1e5)]['save'](await readBody(_0x311614)));if(_0x321d5a===_0x4acbb6(0x1e5)&&_0x36353d&&_0x4a4359==='DELETE'){if(!_0x506eb6[_0x4acbb6(0x1e5)]['remove'])return json({'message':_0x4acbb6(0x203)},0x194);return await _0x506eb6[_0x4acbb6(0x1e5)]['remove'](_0x36353d),json({'ok':!![]});}if(_0x321d5a===_0x4acbb6(0x20d)){if(!_0x506eb6[_0x4acbb6(0x20d)])return json({'message':_0x4acbb6(0x1fc)},0x194);if(!_0x36353d&&_0x4a4359===_0x4acbb6(0x1ea))return json({'items':await _0x506eb6[_0x4acbb6(0x20d)][_0x4acbb6(0x206)]?.(_0x361629[_0x4acbb6(0x1fe)][_0x4acbb6(0x1eb)](_0x4acbb6(0x1ec))??void 0x0)??[]});if(!_0x36353d&&_0x4a4359===_0x4acbb6(0x209)){if(!_0x506eb6[_0x4acbb6(0x20d)]['create'])return json({'message':_0x4acbb6(0x215)},0x194);return json(await _0x506eb6['instances'][_0x4acbb6(0x1e2)](await readBody(_0x311614)));}if(_0x36353d&&_0x4a4359===_0x4acbb6(0x1ea))return json(await _0x506eb6[_0x4acbb6(0x20d)][_0x4acbb6(0x1eb)](_0x36353d));if(_0x36353d&&_0x4a4359===_0x4acbb6(0x20e))return await _0x506eb6[_0x4acbb6(0x20d)]['save'](_0x36353d,await readBody(_0x311614)),json({'ok':!![]});}if(_0x321d5a===_0x4acbb6(0x200)){if(!_0x506eb6[_0x4acbb6(0x200)])return json({'message':_0x4acbb6(0x1e3)},0x194);if(!_0x36353d&&_0x4a4359==='GET'){const _0x542ff9=_0x361629[_0x4acbb6(0x1fe)][_0x4acbb6(0x1eb)](_0x4acbb6(0x1ff))??'',_0x1bb336=_0x361629['searchParams'][_0x4acbb6(0x1eb)]('id')??'';return json(await _0x506eb6[_0x4acbb6(0x200)][_0x4acbb6(0x205)](_0x542ff9,_0x1bb336));}if(!_0x36353d&&_0x4a4359===_0x4acbb6(0x209))return json(await _0x506eb6[_0x4acbb6(0x200)][_0x4acbb6(0x208)](await readBody(_0x311614)));if(_0x36353d&&_0x1c474a==='file'&&_0x4a4359===_0x4acbb6(0x1ea)){const _0x4522b8=await _0x506eb6[_0x4acbb6(0x200)][_0x4acbb6(0x1f5)](_0x36353d,_0x361629['searchParams'][_0x4acbb6(0x1eb)](_0x4acbb6(0x1ee))??'');return new Response(Buffer['from'](_0x4522b8),{'headers':{'content-type':_0x4acbb6(0x201)}});}if(_0x36353d&&_0x1c474a===_0x4acbb6(0x20b)&&_0x4a4359==='POST'){const _0x525934=await readBody(_0x311614);return json(await _0x506eb6[_0x4acbb6(0x200)][_0x4acbb6(0x20b)](_0x525934[_0x4acbb6(0x1ff)],_0x525934['id'],_0x36353d,_0x525934['by']));}if(_0x36353d&&!_0x1c474a&&_0x4a4359==='GET')return json(await _0x506eb6['versions'][_0x4acbb6(0x1eb)](_0x36353d));}return json({'message':_0x4acbb6(0x207)},0x194);}catch(_0x2df919){return fail(_0x2df919);}};return{'GET':_0x4b7420,'POST':_0x4b7420,'PUT':_0x4b7420,'DELETE':_0x4b7420};}function defineKtConfig(_0x358c69){return _0x358c69;}exports[_0x57821b(0x213)]=createKtHandler,exports[_0x57821b(0x1e4)]=defineKtConfig;
1
+ 'use strict';const _0x1f6271=_0x1c30;(function(_0x264036,_0x857ea4){const _0x14281f=_0x1c30,_0x47382f=_0x264036();while(!![]){try{const _0x348813=-parseInt(_0x14281f(0xa3))/0x1*(-parseInt(_0x14281f(0x9c))/0x2)+parseInt(_0x14281f(0x97))/0x3+-parseInt(_0x14281f(0x83))/0x4+parseInt(_0x14281f(0x9f))/0x5*(-parseInt(_0x14281f(0x7f))/0x6)+-parseInt(_0x14281f(0xaa))/0x7*(-parseInt(_0x14281f(0xa0))/0x8)+-parseInt(_0x14281f(0x85))/0x9*(parseInt(_0x14281f(0x8c))/0xa)+parseInt(_0x14281f(0xab))/0xb*(parseInt(_0x14281f(0x94))/0xc);if(_0x348813===_0x857ea4)break;else _0x47382f['push'](_0x47382f['shift']());}catch(_0x4229ee){_0x47382f['push'](_0x47382f['shift']());}}}(_0x8ab0,0x8153b));var store=require('@k-table/report/store');async function pathParts(_0x31fc8d,_0x55b432){const _0x5cbe58=_0x1c30,_0x27ca76=_0x31fc8d['params']?await _0x31fc8d[_0x5cbe58(0x87)]:void 0x0;if(_0x27ca76?.[_0x5cbe58(0x86)]?.[_0x5cbe58(0x91)])return _0x27ca76[_0x5cbe58(0x86)];const _0x2fd974=_0x55b432[_0x5cbe58(0x7d)][_0x5cbe58(0x9a)](_0x5cbe58(0x8e)),_0x269cb2=_0x2fd974>=0x0?_0x55b432['pathname']['slice'](_0x2fd974+'/api/kt'[_0x5cbe58(0x91)]):_0x55b432[_0x5cbe58(0x7d)];return _0x269cb2[_0x5cbe58(0x7a)]('/')['filter'](Boolean);}function json(_0x407be3,_0x14bdb6=0xc8){const _0x2b9d73=_0x1c30;return new Response(JSON[_0x2b9d73(0xad)](_0x407be3),{'status':_0x14bdb6,'headers':{'content-type':'application/json;\x20charset=utf-8'}});}function _0x1c30(_0x460f50,_0x13908f){_0x460f50=_0x460f50-0x7a;const _0x8ab0ca=_0x8ab0();let _0x1c3010=_0x8ab0ca[_0x460f50];if(_0x1c30['hszCdq']===undefined){var _0x5d8754=function(_0x4c2d65){const _0x514bf4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x22ce3e='',_0x31fc8d='';for(let _0x55b432=0x0,_0x27ca76,_0x2fd974,_0x269cb2=0x0;_0x2fd974=_0x4c2d65['charAt'](_0x269cb2++);~_0x2fd974&&(_0x27ca76=_0x55b432%0x4?_0x27ca76*0x40+_0x2fd974:_0x2fd974,_0x55b432++%0x4)?_0x22ce3e+=String['fromCharCode'](0xff&_0x27ca76>>(-0x2*_0x55b432&0x6)):0x0){_0x2fd974=_0x514bf4['indexOf'](_0x2fd974);}for(let _0x407be3=0x0,_0x14bdb6=_0x22ce3e['length'];_0x407be3<_0x14bdb6;_0x407be3++){_0x31fc8d+='%'+('00'+_0x22ce3e['charCodeAt'](_0x407be3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x31fc8d);};_0x1c30['YnhOyc']=_0x5d8754,_0x1c30['GwnhtB']={},_0x1c30['hszCdq']=!![];}const _0x116b88=_0x8ab0ca[0x0];_0x1c30['ZCYivB']!==_0x116b88&&(_0x1c30['GwnhtB']={},_0x1c30['ZCYivB']=_0x116b88);const _0x285d08=_0x1c30['GwnhtB'][_0x460f50];return _0x285d08===undefined?(_0x1c3010=_0x1c30['YnhOyc'](_0x1c3010),_0x1c30['GwnhtB'][_0x460f50]=_0x1c3010):_0x1c3010=_0x285d08,_0x1c3010;}function fail(_0x3ff954){const _0x240980=_0x1c30;if(_0x3ff954 instanceof store[_0x240980(0x7c)])return json({'message':_0x3ff954['message'],'current':_0x3ff954['current']},0x199);if(_0x3ff954 instanceof store['KtNotFoundError'])return json({'message':_0x3ff954['message']},0x194);if(_0x3ff954 instanceof store[_0x240980(0x8d)])return json({'message':_0x3ff954[_0x240980(0xa1)]},_0x3ff954['status']??0x1f4);return json({'message':_0x3ff954 instanceof Error?_0x3ff954[_0x240980(0xa1)]:'\u5185\u90E8\u9519\u8BEF'},0x1f4);}async function readBody(_0x2a92c){const _0x2874fe=_0x1c30,_0x4103be=await _0x2a92c[_0x2874fe(0x81)]();if(!_0x4103be)return null;return JSON['parse'](_0x4103be);}function createKtHandler(_0x135c0a){const _0x4c2610=async(_0x4cd37f,_0xc231f5={})=>{const _0x3e42ba=_0x1c30;try{const _0x28fe46=new URL(_0x4cd37f[_0x3e42ba(0x8a)]),_0x5738ed=await pathParts(_0xc231f5,_0x28fe46),[_0x3db766,_0x8fb148,_0x3164ff]=_0x5738ed,_0x103d81=_0x4cd37f[_0x3e42ba(0xa9)][_0x3e42ba(0xa4)]();if(_0x3db766===_0x3e42ba(0x96)&&!_0x8fb148&&_0x103d81===_0x3e42ba(0x9d)){const _0x3da354=_0x28fe46[_0x3e42ba(0xa8)][_0x3e42ba(0x88)]('kind');return json({'items':await _0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0x93)](_0x3da354||void 0x0)});}if(_0x3db766===_0x3e42ba(0x96)&&!_0x8fb148&&_0x103d81==='POST'){if(!_0x135c0a['artifacts']['create'])return json({'message':_0x3e42ba(0xa6)},0x194);return json(await _0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0x8b)](await readBody(_0x4cd37f)));}if(_0x3db766===_0x3e42ba(0x96)&&_0x8fb148&&_0x103d81===_0x3e42ba(0x9d))return json(await _0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0x88)](_0x8fb148));if(_0x3db766==='artifacts'&&_0x8fb148&&_0x103d81===_0x3e42ba(0x84))return json(await _0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0xa7)](await readBody(_0x4cd37f)));if(_0x3db766===_0x3e42ba(0x96)&&_0x8fb148&&_0x103d81==='DELETE'){if(!_0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0x92)])return json({'message':_0x3e42ba(0x9e)},0x194);return await _0x135c0a[_0x3e42ba(0x96)]['remove'](_0x8fb148),json({'ok':!![]});}if(_0x3db766==='instances'){if(!_0x135c0a['instances'])return json({'message':_0x3e42ba(0x80)},0x194);if(!_0x8fb148&&_0x103d81===_0x3e42ba(0x9d))return json({'items':await _0x135c0a[_0x3e42ba(0x89)][_0x3e42ba(0x93)]?.(_0x28fe46[_0x3e42ba(0xa8)]['get']('artifactId')??void 0x0)??[]});if(!_0x8fb148&&_0x103d81===_0x3e42ba(0x8f)){if(!_0x135c0a['instances'][_0x3e42ba(0x8b)])return json({'message':_0x3e42ba(0xa6)},0x194);return json(await _0x135c0a['instances']['create'](await readBody(_0x4cd37f)));}if(_0x8fb148&&_0x103d81===_0x3e42ba(0x9d))return json(await _0x135c0a[_0x3e42ba(0x89)][_0x3e42ba(0x88)](_0x8fb148));if(_0x8fb148&&_0x103d81===_0x3e42ba(0x84))return await _0x135c0a[_0x3e42ba(0x89)][_0x3e42ba(0xa7)](_0x8fb148,await readBody(_0x4cd37f)),json({'ok':!![]});}if(_0x3db766===_0x3e42ba(0x82)){if(!_0x135c0a['versions'])return json({'message':_0x3e42ba(0x90)},0x194);if(!_0x8fb148&&_0x103d81==='GET'){const _0x1cb7f0=_0x28fe46[_0x3e42ba(0xa8)]['get']('kind')??'',_0x27858a=_0x28fe46[_0x3e42ba(0xa8)][_0x3e42ba(0x88)]('id')??'';return json(await _0x135c0a[_0x3e42ba(0x82)][_0x3e42ba(0x7e)](_0x1cb7f0,_0x27858a));}if(!_0x8fb148&&_0x103d81===_0x3e42ba(0x8f))return json(await _0x135c0a[_0x3e42ba(0x82)]['commit'](await readBody(_0x4cd37f)));if(_0x8fb148&&_0x3164ff===_0x3e42ba(0x7b)&&_0x103d81===_0x3e42ba(0x9d)){const _0x154532=await _0x135c0a[_0x3e42ba(0x82)][_0x3e42ba(0xac)](_0x8fb148,_0x28fe46[_0x3e42ba(0xa8)]['get']('path')??'');return new Response(Buffer[_0x3e42ba(0x98)](_0x154532),{'headers':{'content-type':_0x3e42ba(0x9b)}});}if(_0x8fb148&&_0x3164ff===_0x3e42ba(0x99)&&_0x103d81===_0x3e42ba(0x8f)){const _0x1bed3b=await readBody(_0x4cd37f);return json(await _0x135c0a[_0x3e42ba(0x82)]['restore'](_0x1bed3b['kind'],_0x1bed3b['id'],_0x8fb148,_0x1bed3b['by']));}if(_0x8fb148&&!_0x3164ff&&_0x103d81===_0x3e42ba(0x9d))return json(await _0x135c0a[_0x3e42ba(0x82)][_0x3e42ba(0x88)](_0x8fb148));}return json({'message':_0x3e42ba(0xa5)},0x194);}catch(_0x28cd76){return fail(_0x28cd76);}};return{'GET':_0x4c2610,'POST':_0x4c2610,'PUT':_0x4c2610,'DELETE':_0x4c2610};}function defineKtConfig(_0x1ddc97){return _0x1ddc97;}exports[_0x1f6271(0xa2)]=createKtHandler,exports[_0x1f6271(0x95)]=defineKtConfig;function _0x8ab0(){const _0x38028a=['mtC0nZmWmfzptujrDW','ufvu','mtHgv0DIDMu','Cgf0Aa','CgfYyw1Z','z2v0','Aw5ZDgfUy2vZ','DxjS','y3jLyxrL','mZq3mZaYme9eAeDRDW','s3rtDg9YzuvYCM9Y','l2fWAs9RDa','ue9tva','DMvYC2LVBNmG5PYQ6ywn572U','BgvUz3rO','CMvTB3zL','BgLZDa','mtK5mJCYBuTkBM1I','zgvMAw5Ls3rdB25MAwC','yxj0AwzHy3rZ','mtG1mda0m1PTD2nPvG','zNjVBq','CMvZDg9Yzq','Aw5KzxHpzG','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','mJe3nZzSv2fPBxa','r0vu','CMvTB3zLioACQUwUNUEoSa','ntq5mZvjsxfbDfi','mtzMwuHpBe4','BwvZC2fNzq','y3jLyxrLs3riyw5KBgvY','odrAs3PYvvK','Dg9vChbLCKnHC2u','5PYQ5OM+5yIW','y3jLyxrLioACQUwUNUEoSa','C2f2zq','C2vHCMnOugfYyw1Z','Bwv0Ag9K','mJCZnte1mKDRwvzWAG','mtG3wKPmEwrg','CMvHzezPBgu','C3rYAw5NAwz5','C3bSAxq','zMLSzq','s3rdB25MBgLJDevYCM9Y','Cgf0Ag5HBwu','Bg9N','nteWDuzrDNzq','Aw5ZDgfUy2vZioACQUMfJEE9RG','Dgv4Da','DMvYC2LVBNm'];_0x8ab0=function(){return _0x38028a;};return _0x8ab0();}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- (function(_0x30cce7,_0x16d873){const _0x3e37cb=_0x1666,_0x2558b5=_0x30cce7();while(!![]){try{const _0x2fc00f=parseInt(_0x3e37cb(0x113))/0x1+parseInt(_0x3e37cb(0xfd))/0x2*(-parseInt(_0x3e37cb(0x118))/0x3)+parseInt(_0x3e37cb(0xf4))/0x4*(parseInt(_0x3e37cb(0xef))/0x5)+-parseInt(_0x3e37cb(0x115))/0x6+parseInt(_0x3e37cb(0x11b))/0x7*(-parseInt(_0x3e37cb(0xfa))/0x8)+parseInt(_0x3e37cb(0xf3))/0x9+parseInt(_0x3e37cb(0x119))/0xa;if(_0x2fc00f===_0x16d873)break;else _0x2558b5['push'](_0x2558b5['shift']());}catch(_0xd6ecaf){_0x2558b5['push'](_0x2558b5['shift']());}}}(_0x81cc,0x5956d));function _0x81cc(){const _0x2fb662=['ntmZmtKWnhnqCNL6Aq','C3bSAxq','Cgf0Aa','nhP2uwPdvW','CMvTB3zLioACQUwUNUEoSa','BgvUz3rO','BgLZDa','Aw5KzxHpzG','Aw5ZDgfUy2vZ','Aw5ZDgfUy2vZioACQUMfJEE9RG','C3rYAw5NAwz5','yxj0AwzHy3rjza','Bg9N','ue9tva','ufvu','A2LUza','CgfYC2u','r0vu','y3vYCMvUDa','yxj0AwzHy3rZ','C2vHCMnOugfYyw1Z','BwvZC2fNzq','DMvYC2LVBNmG5PYQ6ywn572U','Dgv4Da','y29TBwL0','mJq2nJe1yxLuufDd','CMvZDg9Yzq','mJmZntGXmND2t2HwCq','yxbWBgLJyxrPB24VANnVBJSGy2HHCNnLDd11DgyToa','CMvTB3zL','ntyXndG5EhrVANLN','odm4mtK2mhr6rLzrwG','z2v0','n2rly2Peza','revmrvrf','DMvYC2LVBNm','CMvHzezPBgu','zMLSzq','C2XPy2u','DxjS','mJC3mhHzqvDfCG','CgfYyw1Z','C3rHDhvZ','Dg9vChbLCKnHC2u','ntaYmdaYmeTWD3fpDW','mteWognptwvHuq','zMLSDgvY','l2fWAs9RDa','C2f2zq','y3jLyxrLioACQUwUNUEoSa','y3jLyxrL'];_0x81cc=function(){return _0x2fb662;};return _0x81cc();}import{KtConflictError,KtNotFoundError,KtStoreError}from'@k-table/report/store';async function pathParts(_0x5e8320,_0x28b89c){const _0xfa9480=_0x1666,_0x43f544=_0x5e8320[_0xfa9480(0xf0)]?await _0x5e8320[_0xfa9480(0xf0)]:void 0x0;if(_0x43f544?.[_0xfa9480(0xfc)]?.[_0xfa9480(0xff)])return _0x43f544['path'];const _0x592c8f=_0x28b89c['pathname'][_0xfa9480(0x101)]('/api/kt'),_0x2690ee=_0x592c8f>=0x0?_0x28b89c['pathname'][_0xfa9480(0xed)](_0x592c8f+_0xfa9480(0xf6)[_0xfa9480(0xff)]):_0x28b89c['pathname'];return _0x2690ee[_0xfa9480(0xfb)]('/')[_0xfa9480(0xf5)](Boolean);}function json(_0x535116,_0x34bcd7=0xc8){const _0x358db3=_0x1666;return new Response(JSON[_0x358db3(0x104)](_0x535116),{'status':_0x34bcd7,'headers':{'content-type':_0x358db3(0x116)}});}function fail(_0x5856bd){const _0x49f5ad=_0x1666;if(_0x5856bd instanceof KtConflictError)return json({'message':_0x5856bd[_0x49f5ad(0x10f)],'current':_0x5856bd[_0x49f5ad(0x10c)]},0x199);if(_0x5856bd instanceof KtNotFoundError)return json({'message':_0x5856bd[_0x49f5ad(0x10f)]},0x194);if(_0x5856bd instanceof KtStoreError)return json({'message':_0x5856bd['message']},_0x5856bd[_0x49f5ad(0xf1)]??0x1f4);return json({'message':_0x5856bd instanceof Error?_0x5856bd['message']:'\u5185\u90E8\u9519\u8BEF'},0x1f4);}async function readBody(_0x2b629f){const _0x5b939c=_0x1666,_0x2af377=await _0x2b629f[_0x5b939c(0x111)]();if(!_0x2af377)return null;return JSON[_0x5b939c(0x10a)](_0x2af377);}function createKtHandler(_0x167462){const _0x39dcb1=async(_0x8f2e98,_0x2dc771={})=>{const _0x3b79c6=_0x1666;try{const _0x2505d3=new URL(_0x8f2e98[_0x3b79c6(0xee)]),_0x54170f=await pathParts(_0x2dc771,_0x2505d3),[_0x4eca9b,_0x15d276,_0x51749b]=_0x54170f,_0x110e26=_0x8f2e98['method'][_0x3b79c6(0xf2)]();if(_0x4eca9b===_0x3b79c6(0x10d)&&!_0x15d276&&_0x110e26===_0x3b79c6(0x10b)){const _0x8e0868=_0x2505d3[_0x3b79c6(0x10e)]['get'](_0x3b79c6(0x109));return json({'items':await _0x167462['artifacts'][_0x3b79c6(0x100)](_0x8e0868||void 0x0)});}if(_0x4eca9b===_0x3b79c6(0x10d)&&!_0x15d276&&_0x110e26===_0x3b79c6(0x107)){if(!_0x167462['artifacts'][_0x3b79c6(0xf9)])return json({'message':_0x3b79c6(0xf8)},0x194);return json(await _0x167462['artifacts'][_0x3b79c6(0xf9)](await readBody(_0x8f2e98)));}if(_0x4eca9b===_0x3b79c6(0x10d)&&_0x15d276&&_0x110e26===_0x3b79c6(0x10b))return json(await _0x167462[_0x3b79c6(0x10d)][_0x3b79c6(0x11a)](_0x15d276));if(_0x4eca9b===_0x3b79c6(0x10d)&&_0x15d276&&_0x110e26===_0x3b79c6(0x108))return json(await _0x167462[_0x3b79c6(0x10d)][_0x3b79c6(0xf7)](await readBody(_0x8f2e98)));if(_0x4eca9b===_0x3b79c6(0x10d)&&_0x15d276&&_0x110e26===_0x3b79c6(0x11c)){if(!_0x167462['artifacts'][_0x3b79c6(0x117)])return json({'message':_0x3b79c6(0xfe)},0x194);return await _0x167462[_0x3b79c6(0x10d)][_0x3b79c6(0x117)](_0x15d276),json({'ok':!![]});}if(_0x4eca9b===_0x3b79c6(0x102)){if(!_0x167462[_0x3b79c6(0x102)])return json({'message':_0x3b79c6(0x103)},0x194);if(!_0x15d276&&_0x110e26===_0x3b79c6(0x10b))return json({'items':await _0x167462['instances'][_0x3b79c6(0x100)]?.(_0x2505d3[_0x3b79c6(0x10e)][_0x3b79c6(0x11a)](_0x3b79c6(0x105))??void 0x0)??[]});if(!_0x15d276&&_0x110e26==='POST'){if(!_0x167462[_0x3b79c6(0x102)][_0x3b79c6(0xf9)])return json({'message':'create\x20\u672A\u5B9E\u73B0'},0x194);return json(await _0x167462['instances']['create'](await readBody(_0x8f2e98)));}if(_0x15d276&&_0x110e26===_0x3b79c6(0x10b))return json(await _0x167462[_0x3b79c6(0x102)][_0x3b79c6(0x11a)](_0x15d276));if(_0x15d276&&_0x110e26==='PUT')return await _0x167462[_0x3b79c6(0x102)]['save'](_0x15d276,await readBody(_0x8f2e98)),json({'ok':!![]});}if(_0x4eca9b===_0x3b79c6(0x11d)){if(!_0x167462['versions'])return json({'message':_0x3b79c6(0x110)},0x194);if(!_0x15d276&&_0x110e26==='GET'){const _0x347cd2=_0x2505d3[_0x3b79c6(0x10e)][_0x3b79c6(0x11a)]('kind')??'',_0x354625=_0x2505d3[_0x3b79c6(0x10e)][_0x3b79c6(0x11a)]('id')??'';return json(await _0x167462[_0x3b79c6(0x11d)][_0x3b79c6(0x106)](_0x347cd2,_0x354625));}if(!_0x15d276&&_0x110e26==='POST')return json(await _0x167462[_0x3b79c6(0x11d)][_0x3b79c6(0x112)](await readBody(_0x8f2e98)));if(_0x15d276&&_0x51749b===_0x3b79c6(0x11f)&&_0x110e26===_0x3b79c6(0x10b)){const _0x47f819=await _0x167462[_0x3b79c6(0x11d)][_0x3b79c6(0x11e)](_0x15d276,_0x2505d3[_0x3b79c6(0x10e)][_0x3b79c6(0x11a)](_0x3b79c6(0xfc))??'');return new Response(Buffer['from'](_0x47f819),{'headers':{'content-type':'application/octet-stream'}});}if(_0x15d276&&_0x51749b===_0x3b79c6(0x114)&&_0x110e26===_0x3b79c6(0x107)){const _0x2ef2af=await readBody(_0x8f2e98);return json(await _0x167462[_0x3b79c6(0x11d)][_0x3b79c6(0x114)](_0x2ef2af['kind'],_0x2ef2af['id'],_0x15d276,_0x2ef2af['by']));}if(_0x15d276&&!_0x51749b&&_0x110e26===_0x3b79c6(0x10b))return json(await _0x167462[_0x3b79c6(0x11d)][_0x3b79c6(0x11a)](_0x15d276));}return json({'message':'\u672A\u627E\u5230'},0x194);}catch(_0x2c3f14){return fail(_0x2c3f14);}};return{'GET':_0x39dcb1,'POST':_0x39dcb1,'PUT':_0x39dcb1,'DELETE':_0x39dcb1};}function defineKtConfig(_0xbcc98f){return _0xbcc98f;}function _0x1666(_0x247e35,_0x38da69){_0x247e35=_0x247e35-0xed;const _0x81cc65=_0x81cc();let _0x166650=_0x81cc65[_0x247e35];if(_0x1666['iartxa']===undefined){var _0x592af8=function(_0x12e5ea){const _0x5b8284='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4abc34='',_0x5e8320='';for(let _0x28b89c=0x0,_0x43f544,_0x592c8f,_0x2690ee=0x0;_0x592c8f=_0x12e5ea['charAt'](_0x2690ee++);~_0x592c8f&&(_0x43f544=_0x28b89c%0x4?_0x43f544*0x40+_0x592c8f:_0x592c8f,_0x28b89c++%0x4)?_0x4abc34+=String['fromCharCode'](0xff&_0x43f544>>(-0x2*_0x28b89c&0x6)):0x0){_0x592c8f=_0x5b8284['indexOf'](_0x592c8f);}for(let _0x535116=0x0,_0x34bcd7=_0x4abc34['length'];_0x535116<_0x34bcd7;_0x535116++){_0x5e8320+='%'+('00'+_0x4abc34['charCodeAt'](_0x535116)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5e8320);};_0x1666['MBRXMT']=_0x592af8,_0x1666['QSVlSN']={},_0x1666['iartxa']=!![];}const _0x1b7b60=_0x81cc65[0x0];_0x1666['aFrgVb']!==_0x1b7b60&&(_0x1666['QSVlSN']={},_0x1666['aFrgVb']=_0x1b7b60);const _0x2552f7=_0x1666['QSVlSN'][_0x247e35];return _0x2552f7===undefined?(_0x166650=_0x1666['MBRXMT'](_0x166650),_0x1666['QSVlSN'][_0x247e35]=_0x166650):_0x166650=_0x2552f7,_0x166650;}export{createKtHandler,defineKtConfig};
1
+ (function(_0x4819dd,_0xf83285){const _0x38f013=_0x2e57,_0x58d205=_0x4819dd();while(!![]){try{const _0x1c2ab0=parseInt(_0x38f013(0xa1))/0x1+parseInt(_0x38f013(0x79))/0x2*(parseInt(_0x38f013(0x80))/0x3)+parseInt(_0x38f013(0x8f))/0x4+parseInt(_0x38f013(0x9f))/0x5*(-parseInt(_0x38f013(0x97))/0x6)+parseInt(_0x38f013(0x8d))/0x7*(-parseInt(_0x38f013(0x89))/0x8)+parseInt(_0x38f013(0x8e))/0x9+-parseInt(_0x38f013(0x94))/0xa;if(_0x1c2ab0===_0xf83285)break;else _0x58d205['push'](_0x58d205['shift']());}catch(_0x348723){_0x58d205['push'](_0x58d205['shift']());}}}(_0x3d38,0x81960));import{KtConflictError,KtNotFoundError,KtStoreError}from'@k-table/report/store';async function pathParts(_0x52297d,_0x3b7e60){const _0x4b956a=_0x2e57,_0x87fa3f=_0x52297d[_0x4b956a(0x95)]?await _0x52297d[_0x4b956a(0x95)]:void 0x0;if(_0x87fa3f?.[_0x4b956a(0x96)]?.[_0x4b956a(0x7f)])return _0x87fa3f[_0x4b956a(0x96)];const _0x56b64a=_0x3b7e60['pathname'][_0x4b956a(0x82)](_0x4b956a(0x74)),_0x217a40=_0x56b64a>=0x0?_0x3b7e60[_0x4b956a(0x7a)][_0x4b956a(0x7d)](_0x56b64a+_0x4b956a(0x74)[_0x4b956a(0x7f)]):_0x3b7e60['pathname'];return _0x217a40[_0x4b956a(0x75)]('/')[_0x4b956a(0x84)](Boolean);}function json(_0xe7ade9,_0x34f371=0xc8){const _0x29f651=_0x2e57;return new Response(JSON[_0x29f651(0x81)](_0xe7ade9),{'status':_0x34f371,'headers':{'content-type':'application/json;\x20charset=utf-8'}});}function fail(_0x549539){const _0x56f04f=_0x2e57;if(_0x549539 instanceof KtConflictError)return json({'message':_0x549539[_0x56f04f(0x99)],'current':_0x549539[_0x56f04f(0x72)]},0x199);if(_0x549539 instanceof KtNotFoundError)return json({'message':_0x549539[_0x56f04f(0x99)]},0x194);if(_0x549539 instanceof KtStoreError)return json({'message':_0x549539[_0x56f04f(0x99)]},_0x549539[_0x56f04f(0x7e)]??0x1f4);return json({'message':_0x549539 instanceof Error?_0x549539[_0x56f04f(0x99)]:'\u5185\u90E8\u9519\u8BEF'},0x1f4);}async function readBody(_0x235156){const _0x1a8abb=_0x2e57,_0x19130a=await _0x235156[_0x1a8abb(0x8a)]();if(!_0x19130a)return null;return JSON[_0x1a8abb(0x87)](_0x19130a);}function createKtHandler(_0x543606){const _0x419a2b=async(_0x2624ff,_0x442d31={})=>{const _0x4e183a=_0x2e57;try{const _0x414487=new URL(_0x2624ff[_0x4e183a(0x88)]),_0x494b2c=await pathParts(_0x442d31,_0x414487),[_0x1fde77,_0x180715,_0x1e3894]=_0x494b2c,_0x205d58=_0x2624ff[_0x4e183a(0x90)][_0x4e183a(0x92)]();if(_0x1fde77===_0x4e183a(0x78)&&!_0x180715&&_0x205d58==='GET'){const _0x16b997=_0x414487['searchParams']['get'](_0x4e183a(0x9d));return json({'items':await _0x543606[_0x4e183a(0x78)][_0x4e183a(0x85)](_0x16b997||void 0x0)});}if(_0x1fde77===_0x4e183a(0x78)&&!_0x180715&&_0x205d58==='POST'){if(!_0x543606[_0x4e183a(0x78)]['create'])return json({'message':'create\x20\u672A\u5B9E\u73B0'},0x194);return json(await _0x543606[_0x4e183a(0x78)][_0x4e183a(0x71)](await readBody(_0x2624ff)));}if(_0x1fde77==='artifacts'&&_0x180715&&_0x205d58==='GET')return json(await _0x543606[_0x4e183a(0x78)][_0x4e183a(0x93)](_0x180715));if(_0x1fde77===_0x4e183a(0x78)&&_0x180715&&_0x205d58==='PUT')return json(await _0x543606[_0x4e183a(0x78)]['save'](await readBody(_0x2624ff)));if(_0x1fde77===_0x4e183a(0x78)&&_0x180715&&_0x205d58===_0x4e183a(0x83)){if(!_0x543606['artifacts']['remove'])return json({'message':'remove\x20\u672A\u5B9E\u73B0'},0x194);return await _0x543606[_0x4e183a(0x78)][_0x4e183a(0x7b)](_0x180715),json({'ok':!![]});}if(_0x1fde77==='instances'){if(!_0x543606[_0x4e183a(0xa0)])return json({'message':_0x4e183a(0x91)},0x194);if(!_0x180715&&_0x205d58===_0x4e183a(0x70))return json({'items':await _0x543606[_0x4e183a(0xa0)]['list']?.(_0x414487[_0x4e183a(0x8b)][_0x4e183a(0x93)]('artifactId')??void 0x0)??[]});if(!_0x180715&&_0x205d58===_0x4e183a(0x9e)){if(!_0x543606[_0x4e183a(0xa0)][_0x4e183a(0x71)])return json({'message':_0x4e183a(0xa2)},0x194);return json(await _0x543606['instances']['create'](await readBody(_0x2624ff)));}if(_0x180715&&_0x205d58===_0x4e183a(0x70))return json(await _0x543606['instances']['get'](_0x180715));if(_0x180715&&_0x205d58===_0x4e183a(0x86))return await _0x543606[_0x4e183a(0xa0)][_0x4e183a(0x73)](_0x180715,await readBody(_0x2624ff)),json({'ok':!![]});}if(_0x1fde77===_0x4e183a(0x98)){if(!_0x543606[_0x4e183a(0x98)])return json({'message':_0x4e183a(0x76)},0x194);if(!_0x180715&&_0x205d58===_0x4e183a(0x70)){const _0x4a68b2=_0x414487['searchParams'][_0x4e183a(0x93)](_0x4e183a(0x9d))??'',_0x1f5e3f=_0x414487[_0x4e183a(0x8b)][_0x4e183a(0x93)]('id')??'';return json(await _0x543606['versions'][_0x4e183a(0x9b)](_0x4a68b2,_0x1f5e3f));}if(!_0x180715&&_0x205d58==='POST')return json(await _0x543606[_0x4e183a(0x98)][_0x4e183a(0x7c)](await readBody(_0x2624ff)));if(_0x180715&&_0x1e3894==='file'&&_0x205d58===_0x4e183a(0x70)){const _0x4d9ee6=await _0x543606[_0x4e183a(0x98)][_0x4e183a(0x9a)](_0x180715,_0x414487[_0x4e183a(0x8b)][_0x4e183a(0x93)](_0x4e183a(0x96))??'');return new Response(Buffer['from'](_0x4d9ee6),{'headers':{'content-type':_0x4e183a(0x8c)}});}if(_0x180715&&_0x1e3894===_0x4e183a(0x77)&&_0x205d58==='POST'){const _0x15e234=await readBody(_0x2624ff);return json(await _0x543606[_0x4e183a(0x98)]['restore'](_0x15e234[_0x4e183a(0x9d)],_0x15e234['id'],_0x180715,_0x15e234['by']));}if(_0x180715&&!_0x1e3894&&_0x205d58==='GET')return json(await _0x543606[_0x4e183a(0x98)]['get'](_0x180715));}return json({'message':_0x4e183a(0x9c)},0x194);}catch(_0x2bfa57){return fail(_0x2bfa57);}};return{'GET':_0x419a2b,'POST':_0x419a2b,'PUT':_0x419a2b,'DELETE':_0x419a2b};}function _0x2e57(_0x242f3e,_0x2c03ec){_0x242f3e=_0x242f3e-0x70;const _0x3d38b7=_0x3d38();let _0x2e57a3=_0x3d38b7[_0x242f3e];if(_0x2e57['SeqjQX']===undefined){var _0xfd3a71=function(_0x420b0d){const _0x39211b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x535006='',_0x52297d='';for(let _0x3b7e60=0x0,_0x87fa3f,_0x56b64a,_0x217a40=0x0;_0x56b64a=_0x420b0d['charAt'](_0x217a40++);~_0x56b64a&&(_0x87fa3f=_0x3b7e60%0x4?_0x87fa3f*0x40+_0x56b64a:_0x56b64a,_0x3b7e60++%0x4)?_0x535006+=String['fromCharCode'](0xff&_0x87fa3f>>(-0x2*_0x3b7e60&0x6)):0x0){_0x56b64a=_0x39211b['indexOf'](_0x56b64a);}for(let _0xe7ade9=0x0,_0x34f371=_0x535006['length'];_0xe7ade9<_0x34f371;_0xe7ade9++){_0x52297d+='%'+('00'+_0x535006['charCodeAt'](_0xe7ade9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x52297d);};_0x2e57['PiKGEs']=_0xfd3a71,_0x2e57['uUCnWk']={},_0x2e57['SeqjQX']=!![];}const _0x21d26f=_0x3d38b7[0x0];_0x2e57['iOhqMD']!==_0x21d26f&&(_0x2e57['uUCnWk']={},_0x2e57['iOhqMD']=_0x21d26f);const _0x12f36c=_0x2e57['uUCnWk'][_0x242f3e];return _0x12f36c===undefined?(_0x2e57a3=_0x2e57['PiKGEs'](_0x2e57a3),_0x2e57['uUCnWk'][_0x242f3e]=_0x2e57a3):_0x2e57a3=_0x12f36c,_0x2e57a3;}function defineKtConfig(_0x13a38a){return _0x13a38a;}function _0x3d38(){const _0x4d7aed=['y3jLyxrLioACQUwUNUEoSa','r0vu','y3jLyxrL','y3vYCMvUDa','C2f2zq','l2fWAs9RDa','C3bSAxq','DMvYC2LVBNmG5PYQ6ywn572U','CMvZDg9Yzq','yxj0AwzHy3rZ','nJC0rLfTr1zH','Cgf0Ag5HBwu','CMvTB3zL','y29TBwL0','C2XPy2u','C3rHDhvZ','BgvUz3rO','mtu5tgLcyujb','C3rYAw5NAwz5','Aw5KzxHpzG','revmrvrf','zMLSDgvY','BgLZDa','ufvu','CgfYC2u','DxjS','nZeYCeDkCNfb','Dgv4Da','C2vHCMnOugfYyw1Z','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','ntiWmZfezxjhBfe','ody0mJq2nMPfAgLpDW','mJu1otuZnK1jAfzKAW','Bwv0Ag9K','Aw5ZDgfUy2vZioACQUMfJEE9RG','Dg9vChbLCKnHC2u','z2v0','mteYmJq0mgfzEwLgAq','CgfYyw1Z','Cgf0Aa','mZG0mJK0AM5sBK1e','DMvYC2LVBNm','BwvZC2fNzq','CMvHzezPBgu','Bg9N','5PYQ5OM+5yIW','A2LUza','ue9tva','mJviqM5pwLK','Aw5ZDgfUy2vZ','nJC5mvDQrfz0ra'];_0x3d38=function(){return _0x4d7aed;};return _0x3d38();}export{createKtHandler,defineKtConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-table/next",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "publishConfig": { "access": "public" },
5
5
  "license": "UNLICENSED",
6
6
  "description": "KT Next 适配:/api/kt 默认 handler 与 fs 存储(无鉴权)",
@@ -27,7 +27,7 @@
27
27
  "test": "vitest run"
28
28
  },
29
29
  "dependencies": {
30
- "@k-table/report": "^1.0.12"
30
+ "@k-table/report": "^1.0.13"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "next": ">=15"