@k-table/next 1.0.33 → 1.0.35

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 _0x32a17d=_0x5b3f;(function(_0x3457e7,_0xc06680){const _0x345f9d=_0x5b3f,_0x406a3d=_0x3457e7();while(!![]){try{const _0x552c9f=-parseInt(_0x345f9d(0xa8))/0x1+-parseInt(_0x345f9d(0x9a))/0x2*(parseInt(_0x345f9d(0x9b))/0x3)+parseInt(_0x345f9d(0x9d))/0x4+-parseInt(_0x345f9d(0xba))/0x5*(parseInt(_0x345f9d(0xb9))/0x6)+parseInt(_0x345f9d(0xe8))/0x7+-parseInt(_0x345f9d(0xc0))/0x8*(parseInt(_0x345f9d(0xc3))/0x9)+parseInt(_0x345f9d(0xb8))/0xa;if(_0x552c9f===_0xc06680)break;else _0x406a3d['push'](_0x406a3d['shift']());}catch(_0x5c28e0){_0x406a3d['push'](_0x406a3d['shift']());}}}(_0x46e5,0xdce7f));var fs=require('fs'),path=require(_0x32a17d(0xe1)),store=require(_0x32a17d(0xc6)),crypto=require('crypto');function resolveRoot(_0x14895a,_0x36e078=process[_0x32a17d(0x98)]()){const _0x29d3c6=_0x32a17d,_0x17835a=path['isAbsolute'](_0x14895a)?_0x14895a:path[_0x29d3c6(0xb1)](_0x36e078,_0x14895a);return fs[_0x29d3c6(0xb5)](_0x17835a,{'recursive':!![]}),_0x17835a;}function artifactDir(_0x3c2159,_0x50d088){const _0x30cc73=_0x32a17d;return path[_0x30cc73(0xa3)](_0x3c2159,_0x50d088);}function objectPath(_0x11161e,_0x4db21a){const _0x5e38ae=_0x32a17d;return path[_0x5e38ae(0xa3)](_0x11161e,'objects',_0x4db21a['slice'](0x0,0x2),_0x4db21a);}function itemDir(_0x222ec3,_0x145376,_0x254947){const _0x553dfd=_0x32a17d;return path[_0x553dfd(0xa3)](_0x222ec3,_0x553dfd(0xc9),_0x145376,_0x254947);}function newEtag(){const _0xbf0112=_0x32a17d;return Date['now']()[_0xbf0112(0xcb)](0x24)+'-'+Math['random']()[_0xbf0112(0xcb)](0x24)['slice'](0x2,0x8);}function _0x46e5(){const _0x30d3f7=['DgfIq29TBw9U','zgLYBMfTzq','Aw5ZDc0','Cgf0Aa','lMPZB24','z2v0sg91CNm','zMLSDgvY','qvjusuzbq1rFrKLmrv9nrvrb','DMvYC2LVBNnsB290','qvjusuzbq1rFrKLmrv9ct0rz','mteWmdG2ndHWyxDvuKS','y3jLyxrLsgfZAa','Aw5ZDgfUy2uG','zMLUza','zMLSzxnuB0fYDgLMywn0','y29TBw9U','qvjusuzbq1rFrKLmrv9gsuXm','y3DK','DxrMoa','ntK5nda2CMLXBKP1','mtHJtND2suK','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','mJK2otqWmgXqChfgsa','DhjPBq','C3rYAw5NAwz5','y29TBwL0','D3jPDgvgAwXLu3LUyW','zMLSzxm','AM9PBG','CMfUzg9T','CM1tEw5J','zxrHzW','CMvHzezPBgvtEw5J','mti2mdG3nLzzr09ZzW','zMLSzxnfCxvHBa','lwXVy2fSlq','BMfTzq','yxj0AwzHy3qG','A2LUza','C3rYAw5N','AxneAxjLy3rVCNK','yxj0AwzHy3ruB0zPBgvZ','CMvZB2X2zq','CgfKu3rHCNq','DxbKyxrL','zw50CMLLCW','BwTKAxjtEw5J','sevbra','zNjVBq','mZC0nJaXmZbWDuTNy3e','mZG0tvLvELbU','odeYodvgD2T2v28','AgvHza','CgfYC2u','z2v0tw9UDgG','Aw5ZDgfUy2vZuM9VDa','5OgI5Asn6iEQia','otK5mK95tMj4va','Dg9ju09tDhjPBMC','C2f2zq','nZyXnfPRqMnzsG','CMvHzgrPCLn5BMm','yxj0AwzHy3rZuM9VDa','qgSTDgfIBguVCMvWB3j0l3n0B3jL','C2HHmJu2','DMfSDwvZ','AxrLBxm','zw5KC1DPDgG','Dg9tDhjPBMC','CMvHzezPBgu','A2v5CW','yxj0AwzHy3rjza','CMv2','lMv0ywC','zMfJzxm','C2XPy2u','ru1qvfLFs1rm','zgvJB2rL','qvjusuzbq1rFrKLmrv9srvbpuLq','zgLNzxn0','C2vLza','s3roB3rgB3vUzevYCM9Y','zxHPC3rZu3LUyW','CMv2ia','C2vLzeLUC3rHBMnLCW','C29YDa','z2v0'];_0x46e5=function(){return _0x30d3f7;};return _0x46e5();}function readEtag(_0x261cc7){const _0x37db98=_0x32a17d,_0xcea46b=path['join'](_0x261cc7,_0x37db98(0xd0));return fs[_0x37db98(0xd9)](_0xcea46b)?fs[_0x37db98(0xa7)](_0xcea46b,_0x37db98(0x99))[_0x37db98(0x9e)]():void 0x0;}function writeArtifactDir(_0x4d2628,_0x50199e,_0x4bd218){const _0x263372=_0x32a17d;fs[_0x263372(0xb5)](path[_0x263372(0xa3)](_0x4d2628,_0x263372(0xd1)),{'recursive':!![]});const _0x49ff2e=store[_0x263372(0xb0)](_0x50199e);fs[_0x263372(0xa1)](path['join'](_0x4d2628,store[_0x263372(0xe5)]),_0x49ff2e[store[_0x263372(0xe5)]]??'{}',_0x263372(0x99)),fs['writeFileSync'](path[_0x263372(0xa3)](_0x4d2628,store[_0x263372(0xe7)]),_0x49ff2e[store[_0x263372(0xe7)]]??'',_0x263372(0x99));const _0x325b1b=path[_0x263372(0xa3)](_0x4d2628,store['ARTIFACT_FILE_FILL']),_0x476bee=path[_0x263372(0xa3)](_0x4d2628,store[_0x263372(0xd5)]);if(_0x49ff2e[store['ARTIFACT_FILE_FILL']])fs[_0x263372(0xa1)](_0x325b1b,_0x49ff2e[store['ARTIFACT_FILE_FILL']],_0x263372(0x99));else{if(fs[_0x263372(0xd9)](_0x325b1b))fs[_0x263372(0xa5)](_0x325b1b);}if(_0x49ff2e[store[_0x263372(0xd5)]])fs['writeFileSync'](_0x476bee,_0x49ff2e[store[_0x263372(0xd5)]],_0x263372(0x99));else{if(fs[_0x263372(0xd9)](_0x476bee))fs['rmSync'](_0x476bee);}fs[_0x263372(0xa1)](path[_0x263372(0xa3)](_0x4d2628,_0x263372(0xd0)),_0x4bd218,'utf8');}function readArtifactDir(_0x59b4f3,_0x84cbb6){const _0x4c2fcc=_0x32a17d,_0x3a32d3={},_0x12c666=path[_0x4c2fcc(0xa3)](_0x59b4f3,store['ARTIFACT_FILE_META']),_0x54a598=path['join'](_0x59b4f3,store['ARTIFACT_FILE_BODY']);if(fs[_0x4c2fcc(0xd9)](_0x12c666))_0x3a32d3[store['ARTIFACT_FILE_META']]=fs[_0x4c2fcc(0xa7)](_0x12c666,_0x4c2fcc(0x99));if(fs[_0x4c2fcc(0xd9)](_0x54a598))_0x3a32d3[store[_0x4c2fcc(0xe7)]]=fs[_0x4c2fcc(0xa7)](_0x54a598,_0x4c2fcc(0x99));const _0x2ae6b8=path[_0x4c2fcc(0xa3)](_0x59b4f3,store[_0x4c2fcc(0xee)]),_0x12c7cf=path[_0x4c2fcc(0xa3)](_0x59b4f3,store['ARTIFACT_FILE_REPORT']);if(fs[_0x4c2fcc(0xd9)](_0x2ae6b8))_0x3a32d3[store['ARTIFACT_FILE_FILL']]=fs[_0x4c2fcc(0xa7)](_0x2ae6b8,_0x4c2fcc(0x99));if(fs['existsSync'](_0x12c7cf))_0x3a32d3[store[_0x4c2fcc(0xd5)]]=fs[_0x4c2fcc(0xa7)](_0x12c7cf,'utf8');return{...store[_0x4c2fcc(0xec)](_0x3a32d3,_0x84cbb6),'etag':readEtag(_0x59b4f3)};}function createFsArtifactStore(_0x55a66f,_0x2cec1a=[]){const _0x54d8cc=_0x32a17d;fs[_0x54d8cc(0xb5)](_0x55a66f,{'recursive':!![]});for(const _0x2f081e of _0x2cec1a){const _0x4f989a=artifactDir(_0x55a66f,_0x2f081e['id']),_0x3593ed=path[_0x54d8cc(0xa3)](_0x4f989a,store[_0x54d8cc(0xe7)]);if(!fs['existsSync'](_0x3593ed))writeArtifactDir(_0x4f989a,_0x2f081e,_0x2f081e[_0x54d8cc(0xa6)]??newEtag());}return{async 'list'(_0x2bc398){const _0x4e5cc4=_0x54d8cc;if(!fs[_0x4e5cc4(0xd9)](_0x55a66f))return[];const _0x149fb1=[];for(const _0x22e089 of fs[_0x4e5cc4(0xc4)](_0x55a66f,{'withFileTypes':!![]})){if(!_0x22e089['isDirectory']())continue;try{const _0x5be3c4=readArtifactDir(artifactDir(_0x55a66f,_0x22e089[_0x4e5cc4(0xab)]),_0x22e089[_0x4e5cc4(0xab)]);if(!_0x2bc398||_0x5be3c4[_0x4e5cc4(0xad)]===_0x2bc398)_0x149fb1['push']({'id':_0x5be3c4['id'],'name':_0x5be3c4[_0x4e5cc4(0xab)],'kind':_0x5be3c4[_0x4e5cc4(0xad)]});}catch{}}return _0x149fb1;},async 'get'(_0x3b2dc4){const _0x4339ce=_0x54d8cc,_0x3f3865=artifactDir(_0x55a66f,_0x3b2dc4);if(!fs[_0x4339ce(0xd9)](_0x3f3865))throw new store[(_0x4339ce(0xd8))](_0x4339ce(0xac)+_0x3b2dc4);return readArtifactDir(_0x3f3865,_0x3b2dc4);},async 'save'(_0x3626ce){const _0x54a71e=_0x54d8cc,_0x219edf=artifactDir(_0x55a66f,_0x3626ce['id']),_0x38348f=fs['existsSync'](_0x219edf)?readArtifactDir(_0x219edf,_0x3626ce['id']):void 0x0;if(_0x3626ce[_0x54a71e(0xa6)]&&_0x38348f?.[_0x54a71e(0xa6)]&&_0x3626ce[_0x54a71e(0xa6)]!==_0x38348f['etag'])throw new store['KtConflictError'](_0x54a71e(0x9c),_0x38348f);const _0x91d96c=newEtag();return writeArtifactDir(_0x219edf,_0x3626ce,_0x91d96c),{..._0x3626ce,'etag':_0x91d96c};},async 'create'(_0x192d6a){const _0x3b18f5=_0x54d8cc,_0x57fa34=_0x192d6a['kind']+'-'+Math[_0x3b18f5(0xa4)]()['toString'](0x24)['slice'](0x2,0xa),_0x48aa06={'id':_0x57fa34,'name':_0x192d6a[_0x3b18f5(0xab)],'kind':_0x192d6a[_0x3b18f5(0xad)],'ktl':store[_0x3b18f5(0xd3)]};return this[_0x3b18f5(0xc2)](_0x48aa06);},async 'remove'(_0xf7d3ad){const _0xd4bb57=_0x54d8cc,_0x584657=artifactDir(_0x55a66f,_0xf7d3ad);if(!fs[_0xd4bb57(0xd9)](_0x584657))throw new store[(_0xd4bb57(0xd8))](_0xd4bb57(0xac)+_0xf7d3ad);fs[_0xd4bb57(0xa5)](_0x584657,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x1c408a,_0x499587={}){const _0x5f3379=_0x32a17d;fs['mkdirSync'](_0x1c408a,{'recursive':!![]});const _0x496b07=_0x5bc3c1=>path[_0x5f3379(0xa3)](_0x1c408a,_0x5bc3c1+_0x5f3379(0xe2));for(const [_0x9cb282,_0x5c5c88]of Object[_0x5f3379(0xb4)](_0x499587)){if(!fs['existsSync'](_0x496b07(_0x9cb282)))fs[_0x5f3379(0xa1)](_0x496b07(_0x9cb282),JSON[_0x5f3379(0x9f)](_0x5c5c88,null,0x2),_0x5f3379(0x99));}return{async 'get'(_0x147004){const _0x54b869=_0x5f3379,_0x3e0636=_0x496b07(_0x147004);if(!fs[_0x54b869(0xd9)](_0x3e0636))throw new store[(_0x54b869(0xd8))](_0x54b869(0xea)+_0x147004);return JSON['parse'](fs[_0x54b869(0xa7)](_0x3e0636,_0x54b869(0x99)));},async 'save'(_0x169d9d,_0x156b4a){const _0x39c8b0=_0x5f3379,_0x4a665a=_0x496b07(_0x169d9d),_0x538013=fs[_0x39c8b0(0xd9)](_0x4a665a)?JSON[_0x39c8b0(0xbc)](fs[_0x39c8b0(0xa7)](_0x4a665a,_0x39c8b0(0x99))):{'artifactId':'','values':{}},_0x16e73a={'artifactId':_0x538013['artifactId'],'values':{..._0x538013[_0x39c8b0(0xc8)],..._0x156b4a[_0x39c8b0(0xc8)]},'common':{..._0x538013[_0x39c8b0(0xed)],..._0x156b4a['common']},'tabCommon':{..._0x538013['tabCommon'],..._0x156b4a[_0x39c8b0(0xde)]}};fs['writeFileSync'](_0x4a665a,JSON[_0x39c8b0(0x9f)](_0x16e73a,null,0x2),_0x39c8b0(0x99));},async 'list'(_0x1b5162){const _0x2de471=_0x5f3379;return fs['readdirSync'](_0x1c408a)[_0x2de471(0xe4)](_0x3e5ddf=>_0x3e5ddf[_0x2de471(0xca)](_0x2de471(0xe2)))['map'](_0x1a901a=>{const _0x183f16=_0x2de471,_0x18e04a=_0x1a901a['slice'](0x0,-0x5),_0x219376=JSON[_0x183f16(0xbc)](fs[_0x183f16(0xa7)](path[_0x183f16(0xa3)](_0x1c408a,_0x1a901a),'utf8'));return{'id':_0x18e04a,'artifactId':_0x219376[_0x183f16(0xce)]};})['filter'](_0xdadbef=>!_0x1b5162||_0xdadbef[_0x2de471(0xce)]===_0x1b5162);},async 'create'(_0x44fef3){const _0x39dedf=_0x5f3379,_0x434ea6=_0x39dedf(0xe0)+Math[_0x39dedf(0xa4)]()[_0x39dedf(0xcb)](0x24)[_0x39dedf(0xd2)](0x2,0xa);return fs[_0x39dedf(0xa1)](_0x496b07(_0x434ea6),JSON['stringify']({'artifactId':_0x44fef3['artifactId'],'values':{},'common':{}},null,0x2),_0x39dedf(0x99)),{'id':_0x434ea6};}};}function sha256Hex(_0x1eaa3b){const _0x4f258b=_0x32a17d,_0x2383c8=typeof _0x1eaa3b===_0x4f258b(0xae)?Buffer['from'](_0x1eaa3b,'utf8'):Buffer[_0x4f258b(0xb7)](_0x1eaa3b);return crypto[_0x4f258b(0xe9)](_0x4f258b(0xc7))[_0x4f258b(0xb3)](_0x2383c8)[_0x4f258b(0xd6)]('hex');}function _0x5b3f(_0x317f5e,_0x3345a8){_0x317f5e=_0x317f5e-0x98;const _0x46e5a1=_0x46e5();let _0x5b3f74=_0x46e5a1[_0x317f5e];if(_0x5b3f['fODoPl']===undefined){var _0x35b4ea=function(_0x3cf26a){const _0x101292='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x40e149='',_0x14895a='';for(let _0x36e078=0x0,_0x17835a,_0x3c2159,_0x50d088=0x0;_0x3c2159=_0x3cf26a['charAt'](_0x50d088++);~_0x3c2159&&(_0x17835a=_0x36e078%0x4?_0x17835a*0x40+_0x3c2159:_0x3c2159,_0x36e078++%0x4)?_0x40e149+=String['fromCharCode'](0xff&_0x17835a>>(-0x2*_0x36e078&0x6)):0x0){_0x3c2159=_0x101292['indexOf'](_0x3c2159);}for(let _0x11161e=0x0,_0x4db21a=_0x40e149['length'];_0x11161e<_0x4db21a;_0x11161e++){_0x14895a+='%'+('00'+_0x40e149['charCodeAt'](_0x11161e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x14895a);};_0x5b3f['kGWMae']=_0x35b4ea,_0x5b3f['TIjDpY']={},_0x5b3f['fODoPl']=!![];}const _0x3f6c91=_0x46e5a1[0x0];_0x5b3f['JejUfy']!==_0x3f6c91&&(_0x5b3f['TIjDpY']={},_0x5b3f['JejUfy']=_0x3f6c91);const _0x1479e9=_0x5b3f['TIjDpY'][_0x317f5e];return _0x1479e9===undefined?(_0x5b3f74=_0x5b3f['kGWMae'](_0x5b3f74),_0x5b3f['TIjDpY'][_0x317f5e]=_0x5b3f74):_0x5b3f74=_0x1479e9,_0x5b3f74;}function writeObject(_0x139970,_0x3d8cc8){const _0x430201=_0x32a17d,_0x22ee05=sha256Hex(_0x3d8cc8),_0x43422a=objectPath(_0x139970,_0x22ee05);fs[_0x430201(0xb5)](path[_0x430201(0xdf)](_0x43422a),{'recursive':!![]});if(!fs['existsSync'](_0x43422a))fs[_0x430201(0xa1)](_0x43422a,_0x3d8cc8);return _0x22ee05;}function readLog(_0x34e58d,_0x4ff3e1,_0x229b5d){const _0x475bd4=_0x32a17d,_0x53209f=itemDir(_0x34e58d,_0x4ff3e1,_0x229b5d),_0x54d888=path['join'](_0x53209f,'log.json'),_0x3caf7e=path[_0x475bd4(0xa3)](_0x53209f,_0x475bd4(0xb6)),_0x24ee6b=fs['existsSync'](_0x54d888)?JSON[_0x475bd4(0xbc)](fs[_0x475bd4(0xa7)](_0x54d888,_0x475bd4(0x99))):[],_0x6f96b2=fs[_0x475bd4(0xd9)](_0x3caf7e)?fs['readFileSync'](_0x3caf7e,'utf8')[_0x475bd4(0x9e)]():_0x24ee6b['at'](-0x1)?.['rev']??null;return{'head':_0x6f96b2,'items':_0x24ee6b};}function writeLog(_0x475482,_0x11a881,_0x2c1c21,_0x50392c,_0x36895a){const _0x2c64f8=_0x32a17d,_0x8fb56b=itemDir(_0x475482,_0x11a881,_0x2c1c21);fs[_0x2c64f8(0xb5)](_0x8fb56b,{'recursive':!![]}),fs[_0x2c64f8(0xa1)](path[_0x2c64f8(0xa3)](_0x8fb56b,'log.json'),JSON[_0x2c64f8(0x9f)](_0x36895a,null,0x2),_0x2c64f8(0x99)),fs[_0x2c64f8(0xa1)](path[_0x2c64f8(0xa3)](_0x8fb56b,_0x2c64f8(0xb6)),_0x50392c+'\x0a',_0x2c64f8(0x99));}function findRev(_0x324ff3,_0x53659e){const _0x27d501=_0x32a17d,_0x107b46=path['join'](_0x324ff3,'items');if(!fs[_0x27d501(0xd9)](_0x107b46))return void 0x0;for(const _0x470b4d of fs[_0x27d501(0xc4)](_0x107b46,{'withFileTypes':!![]})){if(!_0x470b4d[_0x27d501(0xaf)]())continue;for(const _0x88f643 of fs['readdirSync'](path['join'](_0x107b46,_0x470b4d[_0x27d501(0xab)]),{'withFileTypes':!![]})){if(!_0x88f643[_0x27d501(0xaf)]())continue;const _0x34b96e=readLog(_0x324ff3,_0x470b4d[_0x27d501(0xab)],_0x88f643[_0x27d501(0xab)])[_0x27d501(0xc9)][_0x27d501(0xeb)](_0x42b85a=>_0x42b85a[_0x27d501(0xcf)]===_0x53659e);if(_0x34b96e)return _0x34b96e;}}return void 0x0;}function filesTextOf(_0x1d6cde,_0x2161fa){const _0x2f913f=_0x32a17d,_0x2562f6={};for(const [_0x14605b,_0x461ada]of Object[_0x2f913f(0xb4)](_0x2161fa['files'])){const _0x50c397=objectPath(_0x1d6cde,_0x461ada);if(fs['existsSync'](_0x50c397))_0x2562f6[_0x14605b]=fs[_0x2f913f(0xa7)](_0x50c397,_0x2f913f(0x99));}return _0x2562f6;}function createFsVersionStore(_0xd51e2a,_0x42cb1d){const _0x2f6faa=_0x32a17d;return fs[_0x2f6faa(0xb5)](_0xd51e2a,{'recursive':!![]}),{async 'log'(_0x26ba03,_0x321106){const _0x37eb21=_0x2f6faa,{head:_0xf0b866,items:_0x4088eb}=readLog(_0xd51e2a,_0x26ba03,_0x321106);return{'head':_0xf0b866,'items':[..._0x4088eb][_0x37eb21(0xdc)]((_0x2bc04c,_0xc2f345)=>_0x2bc04c['at']<_0xc2f345['at']?0x1:-0x1)};},async 'get'(_0x5e2a95){const _0x191474=_0x2f6faa,_0x2bf1e5=findRev(_0xd51e2a,_0x5e2a95);if(!_0x2bf1e5)throw new store['KtNotFoundError'](_0x191474(0xda)+_0x5e2a95);return _0x2bf1e5;},async 'readFile'(_0x102b7d,_0x56bf30){const _0x4a1606=_0x2f6faa,_0x5c1e8d=await this[_0x4a1606(0xdd)](_0x102b7d),_0x1bb9c5=_0x5c1e8d[_0x4a1606(0xa2)][_0x56bf30];if(!_0x1bb9c5)throw new store[(_0x4a1606(0xd8))](_0x56bf30);const _0x5ad934=objectPath(_0xd51e2a,_0x1bb9c5);if(!fs[_0x4a1606(0xd9)](_0x5ad934))throw new store[(_0x4a1606(0xd8))](_0x56bf30);return new Uint8Array(fs[_0x4a1606(0xa7)](_0x5ad934));},async 'commit'(_0x3d61d0){const _0x2b2fc8=_0x2f6faa;let _0x3f3a28=_0x3d61d0[_0x2b2fc8(0xa2)];if(!_0x3f3a28){const _0x591c74=await _0x42cb1d[_0x2b2fc8(0xdd)](_0x3d61d0['id']);_0x3f3a28=store['artifactToFiles'](_0x591c74);}const _0x4c45b0={},_0x12b022={};for(const [_0x4f1d09,_0x3abb02]of Object['entries'](_0x3f3a28)){const _0x5bd28f=typeof _0x3abb02===_0x2b2fc8(0xae)?_0x3abb02:new TextDecoder()[_0x2b2fc8(0xd4)](_0x3abb02);_0x4c45b0[_0x4f1d09]=_0x5bd28f,_0x12b022[_0x4f1d09]=writeObject(_0xd51e2a,typeof _0x3abb02===_0x2b2fc8(0xae)?Buffer['from'](_0x3abb02,'utf8'):_0x3abb02);}const _0x3b3b5d=readLog(_0xd51e2a,_0x3d61d0[_0x2b2fc8(0xad)],_0x3d61d0['id']);if(_0x3b3b5d[_0x2b2fc8(0xbb)]){const _0x2fe175=_0x3b3b5d[_0x2b2fc8(0xc9)][_0x2b2fc8(0xeb)](_0x1e5cd2=>_0x1e5cd2[_0x2b2fc8(0xcf)]===_0x3b3b5d['head']);if(_0x2fe175&&store[_0x2b2fc8(0xa9)](_0x4c45b0,filesTextOf(_0xd51e2a,_0x2fe175)))return _0x2fe175;}const _0x1c1177=new Date(),_0x1dddd7=String(_0x1c1177['getFullYear']())[_0x2b2fc8(0xd2)](0x2)+String(_0x1c1177[_0x2b2fc8(0xbd)]()+0x1)[_0x2b2fc8(0xb2)](0x2,'0')+String(_0x1c1177['getDate']())[_0x2b2fc8(0xb2)](0x2,'0')+String(_0x1c1177[_0x2b2fc8(0xe3)]())[_0x2b2fc8(0xb2)](0x2,'0')+String(_0x1c1177['getMinutes']())[_0x2b2fc8(0xb2)](0x2,'0'),_0x5663e2=sha256Hex(Object[_0x2b2fc8(0xc8)](_0x12b022)[_0x2b2fc8(0xdc)]()[_0x2b2fc8(0xa3)](','))[_0x2b2fc8(0xd2)](0x0,0x8),_0x5d16be={'rev':_0x1dddd7+_0x2b2fc8(0xaa)+_0x5663e2,'kind':_0x3d61d0[_0x2b2fc8(0xad)],'id':_0x3d61d0['id'],'at':_0x1c1177[_0x2b2fc8(0xc1)](),'parent':_0x3b3b5d['head'],'by':_0x3d61d0['by'],'note':_0x3d61d0['note'],'files':_0x12b022,'meta':_0x3d61d0['meta']};return writeLog(_0xd51e2a,_0x3d61d0['kind'],_0x3d61d0['id'],_0x5d16be[_0x2b2fc8(0xcf)],[..._0x3b3b5d['items'],_0x5d16be]),_0x5d16be;},async 'restore'(_0x2353c3,_0x474789,_0x37a7cd,_0x528476){const _0x39f528=_0x2f6faa,_0x1dd9ba=await this[_0x39f528(0xdd)](_0x37a7cd),_0x39b640={};for(const _0x44a645 of Object[_0x39f528(0xcd)](_0x1dd9ba[_0x39f528(0xa2)])){_0x39b640[_0x44a645]=new TextDecoder()[_0x39f528(0xd4)](await this[_0x39f528(0xcc)](_0x37a7cd,_0x44a645));}const _0x5f1f45=store[_0x39f528(0xec)](_0x39b640,_0x474789);return await _0x42cb1d[_0x39f528(0xc2)]({..._0x5f1f45,'id':_0x474789,'kind':_0x5f1f45['kind'],'etag':void 0x0}),this[_0x39f528(0xa0)]({'kind':_0x2353c3,'id':_0x474789,'files':_0x39b640,'by':_0x528476,'note':_0x39f528(0xbf)+_0x37a7cd});}};}function createKtFsStores(_0x133a54){const _0x484967=_0x32a17d,_0x3bd789=createFsArtifactStore(resolveRoot(_0x133a54[_0x484967(0xc5)],_0x133a54[_0x484967(0x98)]),_0x133a54[_0x484967(0xd7)]),_0x4e9194=_0x133a54[_0x484967(0xbe)]?createFsInstanceStore(resolveRoot(_0x133a54['instancesRoot'],_0x133a54[_0x484967(0x98)]),_0x133a54[_0x484967(0xdb)]):void 0x0,_0x1e20cc=_0x133a54[_0x484967(0xe6)]?createFsVersionStore(resolveRoot(_0x133a54[_0x484967(0xe6)],_0x133a54['cwd']),_0x3bd789):void 0x0;return{'artifacts':_0x3bd789,'instances':_0x4e9194,'versions':_0x1e20cc};}exports['createKtFsStores']=createKtFsStores;
1
+ 'use strict';const _0x489bbe=_0x35e9;(function(_0xce71cc,_0x555024){const _0x3321aa=_0x35e9,_0x424149=_0xce71cc();while(!![]){try{const _0x3ce3f7=parseInt(_0x3321aa(0xbb))/0x1+-parseInt(_0x3321aa(0xa2))/0x2+-parseInt(_0x3321aa(0xe3))/0x3*(parseInt(_0x3321aa(0x97))/0x4)+parseInt(_0x3321aa(0xd8))/0x5+parseInt(_0x3321aa(0x99))/0x6*(parseInt(_0x3321aa(0xca))/0x7)+parseInt(_0x3321aa(0xa3))/0x8+-parseInt(_0x3321aa(0xd4))/0x9;if(_0x3ce3f7===_0x555024)break;else _0x424149['push'](_0x424149['shift']());}catch(_0x317f04){_0x424149['push'](_0x424149['shift']());}}}(_0x5404,0xf27c0));var fs=require('fs'),path=require(_0x489bbe(0xcf)),store=require(_0x489bbe(0xe1)),crypto=require('crypto');function resolveRoot(_0x4e5c0c,_0x3544c1=process[_0x489bbe(0xb1)]()){const _0x4ebe35=_0x489bbe,_0x2e5da4=path[_0x4ebe35(0xb3)](_0x4e5c0c)?_0x4e5c0c:path['resolve'](_0x3544c1,_0x4e5c0c);return fs[_0x4ebe35(0x9b)](_0x2e5da4,{'recursive':!![]}),_0x2e5da4;}function _0x35e9(_0x371597,_0x4547b9){_0x371597=_0x371597-0x90;const _0x540465=_0x5404();let _0x35e943=_0x540465[_0x371597];if(_0x35e9['shTkIQ']===undefined){var _0x1cb09d=function(_0x467c20){const _0x348649='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x56e55a='',_0x4e5c0c='';for(let _0x3544c1=0x0,_0x2e5da4,_0xd9b13a,_0x11c0d1=0x0;_0xd9b13a=_0x467c20['charAt'](_0x11c0d1++);~_0xd9b13a&&(_0x2e5da4=_0x3544c1%0x4?_0x2e5da4*0x40+_0xd9b13a:_0xd9b13a,_0x3544c1++%0x4)?_0x56e55a+=String['fromCharCode'](0xff&_0x2e5da4>>(-0x2*_0x3544c1&0x6)):0x0){_0xd9b13a=_0x348649['indexOf'](_0xd9b13a);}for(let _0x3ea19a=0x0,_0x4d22b4=_0x56e55a['length'];_0x3ea19a<_0x4d22b4;_0x3ea19a++){_0x4e5c0c+='%'+('00'+_0x56e55a['charCodeAt'](_0x3ea19a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4e5c0c);};_0x35e9['mxjMOQ']=_0x1cb09d,_0x35e9['beFvau']={},_0x35e9['shTkIQ']=!![];}const _0x201cf7=_0x540465[0x0];_0x35e9['LBTjLe']!==_0x201cf7&&(_0x35e9['beFvau']={},_0x35e9['LBTjLe']=_0x201cf7);const _0x3f1bb9=_0x35e9['beFvau'][_0x371597];return _0x3f1bb9===undefined?(_0x35e943=_0x35e9['mxjMOQ'](_0x35e943),_0x35e9['beFvau'][_0x371597]=_0x35e943):_0x35e943=_0x3f1bb9,_0x35e943;}function artifactDir(_0xd9b13a,_0x11c0d1){return path['join'](_0xd9b13a,_0x11c0d1);}function objectPath(_0x3ea19a,_0x4d22b4){const _0x52a9d6=_0x489bbe;return path['join'](_0x3ea19a,_0x52a9d6(0xd1),_0x4d22b4[_0x52a9d6(0xdd)](0x0,0x2),_0x4d22b4);}function itemDir(_0x595da8,_0x28e926,_0x150aab){const _0x280807=_0x489bbe;return path['join'](_0x595da8,_0x280807(0xe0),_0x28e926,_0x150aab);}function newEtag(){const _0x3ba2eb=_0x489bbe;return Date[_0x3ba2eb(0xea)]()['toString'](0x24)+'-'+Math['random']()[_0x3ba2eb(0xa1)](0x24)[_0x3ba2eb(0xdd)](0x2,0x8);}function readEtag(_0x5df9de){const _0xf21aeb=_0x489bbe,_0x59e240=path['join'](_0x5df9de,_0xf21aeb(0xbd));return fs[_0xf21aeb(0xce)](_0x59e240)?fs[_0xf21aeb(0xa9)](_0x59e240,_0xf21aeb(0xd3))[_0xf21aeb(0x98)]():void 0x0;}function writeArtifactDir(_0x10d54f,_0x41425c,_0x38542a){const _0x139a49=_0x489bbe;fs[_0x139a49(0x9b)](path['join'](_0x10d54f,_0x139a49(0xa4)),{'recursive':!![]});const _0x33ac26=store['artifactToFiles'](_0x41425c);fs[_0x139a49(0xaa)](path['join'](_0x10d54f,store[_0x139a49(0xac)]),_0x33ac26[store[_0x139a49(0xac)]]??'{}',_0x139a49(0xd3)),fs[_0x139a49(0xaa)](path[_0x139a49(0xc1)](_0x10d54f,store[_0x139a49(0xad)]),_0x33ac26[store[_0x139a49(0xad)]]??'','utf8');const _0x241915=path[_0x139a49(0xc1)](_0x10d54f,store[_0x139a49(0xba)]),_0x179f96=path[_0x139a49(0xc1)](_0x10d54f,store[_0x139a49(0xb0)]);if(_0x33ac26[store['ARTIFACT_FILE_FILL']])fs[_0x139a49(0xaa)](_0x241915,_0x33ac26[store[_0x139a49(0xba)]],_0x139a49(0xd3));else{if(fs[_0x139a49(0xce)](_0x241915))fs[_0x139a49(0xc4)](_0x241915);}if(_0x33ac26[store['ARTIFACT_FILE_REPORT']])fs['writeFileSync'](_0x179f96,_0x33ac26[store[_0x139a49(0xb0)]],_0x139a49(0xd3));else{if(fs['existsSync'](_0x179f96))fs[_0x139a49(0xc4)](_0x179f96);}fs[_0x139a49(0xaa)](path[_0x139a49(0xc1)](_0x10d54f,_0x139a49(0xbd)),_0x38542a,'utf8');}function readArtifactDir(_0x5ce0b4,_0x2d710c){const _0x21c60c=_0x489bbe,_0x159342={},_0x420b35=path[_0x21c60c(0xc1)](_0x5ce0b4,store[_0x21c60c(0xac)]),_0x5011cb=path[_0x21c60c(0xc1)](_0x5ce0b4,store['ARTIFACT_FILE_BODY']);if(fs[_0x21c60c(0xce)](_0x420b35))_0x159342[store[_0x21c60c(0xac)]]=fs[_0x21c60c(0xa9)](_0x420b35,'utf8');if(fs['existsSync'](_0x5011cb))_0x159342[store[_0x21c60c(0xad)]]=fs[_0x21c60c(0xa9)](_0x5011cb,_0x21c60c(0xd3));const _0x328d05=path[_0x21c60c(0xc1)](_0x5ce0b4,store['ARTIFACT_FILE_FILL']),_0x592f7=path['join'](_0x5ce0b4,store['ARTIFACT_FILE_REPORT']);if(fs[_0x21c60c(0xce)](_0x328d05))_0x159342[store[_0x21c60c(0xba)]]=fs[_0x21c60c(0xa9)](_0x328d05,_0x21c60c(0xd3));if(fs[_0x21c60c(0xce)](_0x592f7))_0x159342[store[_0x21c60c(0xb0)]]=fs[_0x21c60c(0xa9)](_0x592f7,_0x21c60c(0xd3));return{...store[_0x21c60c(0xe4)](_0x159342,_0x2d710c),'etag':readEtag(_0x5ce0b4)};}function createFsArtifactStore(_0x34f4da,_0x50613f=[]){const _0x8bf40d=_0x489bbe;fs[_0x8bf40d(0x9b)](_0x34f4da,{'recursive':!![]});for(const _0x3cf0a9 of _0x50613f){const _0x324827=artifactDir(_0x34f4da,_0x3cf0a9['id']),_0x2c246b=path['join'](_0x324827,store['ARTIFACT_FILE_BODY']);if(!fs['existsSync'](_0x2c246b))writeArtifactDir(_0x324827,_0x3cf0a9,_0x3cf0a9[_0x8bf40d(0xc3)]??newEtag());}return{async 'list'(_0x4e19b7){const _0x1feda1=_0x8bf40d;if(!fs[_0x1feda1(0xce)](_0x34f4da))return[];const _0x4e3a22=[];for(const _0x59b173 of fs[_0x1feda1(0xbe)](_0x34f4da,{'withFileTypes':!![]})){if(!_0x59b173[_0x1feda1(0x9a)]())continue;try{const _0x1d2612=readArtifactDir(artifactDir(_0x34f4da,_0x59b173[_0x1feda1(0xb9)]),_0x59b173['name']);if(!_0x4e19b7||_0x1d2612[_0x1feda1(0xb2)]===_0x4e19b7)_0x4e3a22['push']({'id':_0x1d2612['id'],'name':_0x1d2612[_0x1feda1(0xb9)],'kind':_0x1d2612[_0x1feda1(0xb2)]});}catch{}}return _0x4e3a22;},async 'get'(_0x400b74){const _0x51bed0=_0x8bf40d,_0x31d520=artifactDir(_0x34f4da,_0x400b74);if(!fs[_0x51bed0(0xce)](_0x31d520))throw new store[(_0x51bed0(0xdb))](_0x51bed0(0xe9)+_0x400b74);return readArtifactDir(_0x31d520,_0x400b74);},async 'save'(_0x4a18e0){const _0xc21ad5=_0x8bf40d,_0x204455=artifactDir(_0x34f4da,_0x4a18e0['id']),_0x57a759=fs[_0xc21ad5(0xce)](_0x204455)?readArtifactDir(_0x204455,_0x4a18e0['id']):void 0x0;if(_0x4a18e0[_0xc21ad5(0xc3)]&&_0x57a759?.['etag']&&_0x4a18e0[_0xc21ad5(0xc3)]!==_0x57a759[_0xc21ad5(0xc3)])throw new store[(_0xc21ad5(0xbc))](_0xc21ad5(0xb5),_0x57a759);const _0x54a893=newEtag();return writeArtifactDir(_0x204455,_0x4a18e0,_0x54a893),{..._0x4a18e0,'etag':_0x54a893};},async 'create'(_0x27a851){const _0x418c02=_0x8bf40d,_0x4de4a5=_0x27a851[_0x418c02(0xb2)]+'-'+Math['random']()[_0x418c02(0xa1)](0x24)[_0x418c02(0xdd)](0x2,0xa),_0x2e9633={'id':_0x4de4a5,'name':_0x27a851['name'],'kind':_0x27a851[_0x418c02(0xb2)],'ktl':store['EMPTY_KTL']};return this[_0x418c02(0xe8)](_0x2e9633);},async 'remove'(_0x100f5c){const _0x256df5=_0x8bf40d,_0xde76fc=artifactDir(_0x34f4da,_0x100f5c);if(!fs['existsSync'](_0xde76fc))throw new store[(_0x256df5(0xdb))](_0x256df5(0xe9)+_0x100f5c);fs[_0x256df5(0xc4)](_0xde76fc,{'recursive':!![],'force':!![]});}};}function _0x5404(){const _0x54efc7=['nJK2mJu4mfbACeTYra','C3rYAw5N','Bwv0yq','s3roB3rgB3vUzevYCM9Y','zMLUza','C2XPy2u','zMLSzxm','zw5KC1DPDgG','AxrLBxm','qgSTDgfIBguVCMvWB3j0l3n0B3jL','C2HHmJu2','mJm4mJi3BfbAuLfX','zMLSzxnuB0fYDgLMywn0','zgLYBMfTzq','CgfKu3rHCNq','CMv2','C2f2zq','yxj0AwzHy3qG','BM93','BM90zq','zMLSDgvY','zNjVBq','C2vLza','Dg9ju09tDhjPBMC','zgLNzxn0','CMv2ia','neXiEwf0uG','DhjPBq','ndeXnZj3DeHYyu0','AxneAxjLy3rVCNK','BwTKAxjtEw5J','y3jLyxrLsgfZAa','C29YDa','Agv4','yxj0AwzHy3rjza','DgfIq29TBw9U','Dg9tDhjPBMC','mJGYodyXngXnsvHNyq','mti0ntKWodbYrLbqs1q','zMfJzxm','CMfUzg9T','zw50CMLLCW','DMvYC2LVBNnsB290','z2v0','CMvHzezPBgvtEw5J','D3jPDgvgAwXLu3LUyW','Bg9NlMPZB24','qvjusuzbq1rFrKLmrv9nrvrb','qvjusuzbq1rFrKLmrv9ct0rz','DMfSDwvZ','C3rYAw5NAwz5','qvjusuzbq1rFrKLmrv9srvbpuLq','y3DK','A2LUza','AxnbyNnVBhv0zq','zgvJB2rL','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','Aw5ZDgfUy2uG','lMPZB24','yxj0AwzHy3rZuM9VDa','BMfTzq','qvjusuzbq1rFrKLmrv9gsuXm','mtaXoti3nuTpqNzovW','s3rdB25MBgLJDevYCM9Y','lMv0ywC','CMvHzgrPCLn5BMm','z2v0tw9UDgG','Aw5ZDgfUy2vZuM9VDa','AM9PBG','zMLSzxnfCxvHBa','zxrHzW','CM1tEw5J','BwfW','y3jLyxrLs3rgC1n0B3jLCW','C2vLzeLUC3rHBMnLCW','lwXVy2fSlq','CMvHzezPBgu','mZuWvezQr2Tl','y29TBw9U','AgvHza','DxbKyxrL','zxHPC3rZu3LUyW','Cgf0Aa','CgfYC2u','B2jQzwn0CW','y29TBwL0','DxrMoa','mty0mJGWotzAze1iAeO','sevbra','z2v0sg91CNm','z2v0twLUDxrLCW'];_0x5404=function(){return _0x54efc7;};return _0x5404();}function createFsInstanceStore(_0x4125c6,_0x485d31={}){const _0x5234a0=_0x489bbe;fs[_0x5234a0(0x9b)](_0x4125c6,{'recursive':!![]});const _0x3ef3d3=_0x50c140=>path[_0x5234a0(0xc1)](_0x4125c6,_0x50c140+'.json');for(const [_0x5ef4c7,_0x2501b9]of Object['entries'](_0x485d31)){if(!fs[_0x5234a0(0xce)](_0x3ef3d3(_0x5ef4c7)))fs[_0x5234a0(0xaa)](_0x3ef3d3(_0x5ef4c7),JSON[_0x5234a0(0xaf)](_0x2501b9,null,0x2),_0x5234a0(0xd3));}return{async 'get'(_0x4d5f6e){const _0xeccb43=_0x5234a0,_0x2a7390=_0x3ef3d3(_0x4d5f6e);if(!fs['existsSync'](_0x2a7390))throw new store[(_0xeccb43(0xdb))](_0xeccb43(0xb6)+_0x4d5f6e);return JSON['parse'](fs[_0xeccb43(0xa9)](_0x2a7390,'utf8'));},async 'save'(_0x240f8f,_0x2b2b9b){const _0x488a2a=_0x5234a0,_0x5d5bc7=_0x3ef3d3(_0x240f8f),_0x38978d=fs[_0x488a2a(0xce)](_0x5d5bc7)?JSON['parse'](fs[_0x488a2a(0xa9)](_0x5d5bc7,_0x488a2a(0xd3))):{'artifactId':'','values':{}},_0x52c84f={'artifactId':_0x38978d['artifactId'],'values':{..._0x38978d[_0x488a2a(0xae)],..._0x2b2b9b['values']},'common':{..._0x38978d['common'],..._0x2b2b9b[_0x488a2a(0xcb)]},'tabCommon':{..._0x38978d[_0x488a2a(0xa0)],..._0x2b2b9b['tabCommon']}};fs[_0x488a2a(0xaa)](_0x5d5bc7,JSON['stringify'](_0x52c84f,null,0x2),_0x488a2a(0xd3));},async 'list'(_0x3045e8){const _0x326e42=_0x5234a0;return fs['readdirSync'](_0x4125c6)[_0x326e42(0x91)](_0x3c6e8d=>_0x3c6e8d[_0x326e42(0xdf)](_0x326e42(0xb7)))[_0x326e42(0xc5)](_0x2e2669=>{const _0x25b8f3=_0x326e42,_0x16ba66=_0x2e2669[_0x25b8f3(0xdd)](0x0,-0x5),_0x1ad7d9=JSON[_0x25b8f3(0xd0)](fs['readFileSync'](path['join'](_0x4125c6,_0x2e2669),_0x25b8f3(0xd3)));return{'id':_0x16ba66,'artifactId':_0x1ad7d9[_0x25b8f3(0x9f)]};})[_0x326e42(0x91)](_0x49b5a3=>!_0x3045e8||_0x49b5a3[_0x326e42(0x9f)]===_0x3045e8);},async 'create'(_0x135863){const _0x49c892=_0x5234a0,_0x295ba5='inst-'+Math[_0x49c892(0xa5)]()[_0x49c892(0xa1)](0x24)[_0x49c892(0xdd)](0x2,0xa);return fs[_0x49c892(0xaa)](_0x3ef3d3(_0x295ba5),JSON[_0x49c892(0xaf)]({'artifactId':_0x135863['artifactId'],'values':{},'common':{}},null,0x2),_0x49c892(0xd3)),{'id':_0x295ba5};}};}function sha256Hex(_0x3962ad){const _0x314915=_0x489bbe,_0x335d3f=typeof _0x3962ad==='string'?Buffer[_0x314915(0x92)](_0x3962ad,_0x314915(0xd3)):Buffer[_0x314915(0x92)](_0x3962ad);return crypto[_0x314915(0x9c)](_0x314915(0xe2))[_0x314915(0xcd)](_0x335d3f)[_0x314915(0x95)](_0x314915(0x9e));}function writeObject(_0x24713e,_0xa1a43b){const _0x27ae86=_0x489bbe,_0x10282c=sha256Hex(_0xa1a43b),_0x58130d=objectPath(_0x24713e,_0x10282c);fs['mkdirSync'](path[_0x27ae86(0xe5)](_0x58130d),{'recursive':!![]});if(!fs[_0x27ae86(0xce)](_0x58130d))fs['writeFileSync'](_0x58130d,_0xa1a43b);return _0x10282c;}function readLog(_0x1190ff,_0x290e72,_0x1893dc){const _0x34f628=_0x489bbe,_0x5d2701=itemDir(_0x1190ff,_0x290e72,_0x1893dc),_0x40bbc0=path[_0x34f628(0xc1)](_0x5d2701,_0x34f628(0xab)),_0x4b8793=path[_0x34f628(0xc1)](_0x5d2701,_0x34f628(0xd5)),_0x32ce96=fs[_0x34f628(0xce)](_0x40bbc0)?JSON[_0x34f628(0xd0)](fs[_0x34f628(0xa9)](_0x40bbc0,_0x34f628(0xd3))):[],_0x514809=fs[_0x34f628(0xce)](_0x4b8793)?fs[_0x34f628(0xa9)](_0x4b8793,_0x34f628(0xd3))['trim']():_0x32ce96['at'](-0x1)?.[_0x34f628(0xe7)]??null;return{'head':_0x514809,'items':_0x32ce96};}function writeLog(_0x2c559a,_0xfb6d31,_0x471fe2,_0xa6a663,_0x2da7ee){const _0x274057=_0x489bbe,_0x28a51f=itemDir(_0x2c559a,_0xfb6d31,_0x471fe2);fs[_0x274057(0x9b)](_0x28a51f,{'recursive':!![]}),fs[_0x274057(0xaa)](path[_0x274057(0xc1)](_0x28a51f,'log.json'),JSON['stringify'](_0x2da7ee,null,0x2),_0x274057(0xd3)),fs['writeFileSync'](path[_0x274057(0xc1)](_0x28a51f,_0x274057(0xd5)),_0xa6a663+'\x0a',_0x274057(0xd3));}function findRev(_0x58ebf8,_0x591d16){const _0x3b30d1=_0x489bbe,_0x450ffa=path[_0x3b30d1(0xc1)](_0x58ebf8,'items');if(!fs['existsSync'](_0x450ffa))return void 0x0;for(const _0x38ced7 of fs['readdirSync'](_0x450ffa,{'withFileTypes':!![]})){if(!_0x38ced7[_0x3b30d1(0x9a)]())continue;for(const _0x391966 of fs[_0x3b30d1(0xbe)](path[_0x3b30d1(0xc1)](_0x450ffa,_0x38ced7['name']),{'withFileTypes':!![]})){if(!_0x391966[_0x3b30d1(0x9a)]())continue;const _0x135e42=readLog(_0x58ebf8,_0x38ced7['name'],_0x391966['name'])[_0x3b30d1(0xe0)][_0x3b30d1(0xdc)](_0x31a5f9=>_0x31a5f9[_0x3b30d1(0xe7)]===_0x591d16);if(_0x135e42)return _0x135e42;}}return void 0x0;}function filesTextOf(_0x375a03,_0x4a27d5){const _0x345637=_0x489bbe,_0x169571={};for(const [_0x2ed9bf,_0xb3c2ed]of Object[_0x345637(0xa6)](_0x4a27d5['files'])){const _0x17dde0=objectPath(_0x375a03,_0xb3c2ed);if(fs['existsSync'](_0x17dde0))_0x169571[_0x2ed9bf]=fs[_0x345637(0xa9)](_0x17dde0,_0x345637(0xd3));}return _0x169571;}function createFsVersionStore(_0x4993aa,_0x7add18){const _0x44cfa8=_0x489bbe;return fs[_0x44cfa8(0x9b)](_0x4993aa,{'recursive':!![]}),{async 'log'(_0x4e4662,_0x1e6f5c){const _0x7abc01=_0x44cfa8,{head:_0x484070,items:_0x5557d}=readLog(_0x4993aa,_0x4e4662,_0x1e6f5c);return{'head':_0x484070,'items':[..._0x5557d][_0x7abc01(0x9d)]((_0x18e087,_0x1c0d15)=>_0x18e087['at']<_0x1c0d15['at']?0x1:-0x1)};},async 'get'(_0x162c66){const _0x3ef5b1=_0x44cfa8,_0x187928=findRev(_0x4993aa,_0x162c66);if(!_0x187928)throw new store[(_0x3ef5b1(0xdb))](_0x3ef5b1(0x96)+_0x162c66);return _0x187928;},async 'readFile'(_0x24cc13,_0xa9ce4a){const _0x53468b=_0x44cfa8,_0x5bc7bb=await this['get'](_0x24cc13),_0x3f7214=_0x5bc7bb[_0x53468b(0xde)][_0xa9ce4a];if(!_0x3f7214)throw new store[(_0x53468b(0xdb))](_0xa9ce4a);const _0x1c9413=objectPath(_0x4993aa,_0x3f7214);if(!fs[_0x53468b(0xce)](_0x1c9413))throw new store[(_0x53468b(0xdb))](_0xa9ce4a);return new Uint8Array(fs['readFileSync'](_0x1c9413));},async 'commit'(_0x56ba05){const _0x11f170=_0x44cfa8;let _0x4c8373=_0x56ba05[_0x11f170(0xde)];if(!_0x4c8373){const _0x32fc1b=await _0x7add18[_0x11f170(0xa8)](_0x56ba05['id']);_0x4c8373=store['artifactToFiles'](_0x32fc1b);}const _0x11c86e={},_0x2c2efa={};for(const [_0x4c2e82,_0x534431]of Object[_0x11f170(0xa6)](_0x4c8373)){const _0x293dbb=typeof _0x534431===_0x11f170(0xd9)?_0x534431:new TextDecoder()[_0x11f170(0xb4)](_0x534431);_0x11c86e[_0x4c2e82]=_0x293dbb,_0x2c2efa[_0x4c2e82]=writeObject(_0x4993aa,typeof _0x534431===_0x11f170(0xd9)?Buffer[_0x11f170(0x92)](_0x534431,_0x11f170(0xd3)):_0x534431);}const _0x41ad92=readLog(_0x4993aa,_0x56ba05['kind'],_0x56ba05['id']);if(_0x41ad92[_0x11f170(0xcc)]){const _0x2c6645=_0x41ad92[_0x11f170(0xe0)][_0x11f170(0xdc)](_0x2148c9=>_0x2148c9[_0x11f170(0xe7)]===_0x41ad92['head']);if(_0x2c6645&&store[_0x11f170(0xc2)](_0x11c86e,filesTextOf(_0x4993aa,_0x2c6645)))return _0x2c6645;}const _0x195bca=new Date(),_0x20a3f1=String(_0x195bca['getFullYear']())['slice'](0x2)+String(_0x195bca[_0x11f170(0xbf)]()+0x1)[_0x11f170(0xe6)](0x2,'0')+String(_0x195bca['getDate']())['padStart'](0x2,'0')+String(_0x195bca[_0x11f170(0xd6)]())[_0x11f170(0xe6)](0x2,'0')+String(_0x195bca[_0x11f170(0xd7)]())[_0x11f170(0xe6)](0x2,'0'),_0x3db4c5=sha256Hex(Object[_0x11f170(0xae)](_0x2c2efa)['sort']()[_0x11f170(0xc1)](','))['slice'](0x0,0x8),_0x26eaf1={'rev':_0x20a3f1+_0x11f170(0xc8)+_0x3db4c5,'kind':_0x56ba05[_0x11f170(0xb2)],'id':_0x56ba05['id'],'at':_0x195bca[_0x11f170(0x94)](),'parent':_0x41ad92[_0x11f170(0xcc)],'by':_0x56ba05['by'],'note':_0x56ba05[_0x11f170(0x90)],'files':_0x2c2efa,'meta':_0x56ba05[_0x11f170(0xda)]};return writeLog(_0x4993aa,_0x56ba05[_0x11f170(0xb2)],_0x56ba05['id'],_0x26eaf1[_0x11f170(0xe7)],[..._0x41ad92['items'],_0x26eaf1]),_0x26eaf1;},async 'restore'(_0x562afa,_0xcf24a7,_0x2b7da1,_0x1cbd2b){const _0x4e3af6=_0x44cfa8,_0x1f6cbc=await this['get'](_0x2b7da1),_0x366572={};for(const _0x4d5e99 of Object['keys'](_0x1f6cbc['files'])){_0x366572[_0x4d5e99]=new TextDecoder()[_0x4e3af6(0xb4)](await this[_0x4e3af6(0xc9)](_0x2b7da1,_0x4d5e99));}const _0x214658=store['filesToArtifact'](_0x366572,_0xcf24a7);return await _0x7add18[_0x4e3af6(0xe8)]({..._0x214658,'id':_0xcf24a7,'kind':_0x214658[_0x4e3af6(0xb2)],'etag':void 0x0}),this[_0x4e3af6(0xd2)]({'kind':_0x562afa,'id':_0xcf24a7,'files':_0x366572,'by':_0x1cbd2b,'note':'\u6062\u590D\u81EA\x20'+_0x2b7da1});}};}function createKtFsStores(_0x2845dd){const _0x4f8afa=_0x489bbe,_0x3bc0e1=createFsArtifactStore(resolveRoot(_0x2845dd[_0x4f8afa(0xb8)],_0x2845dd[_0x4f8afa(0xb1)]),_0x2845dd[_0x4f8afa(0x93)]),_0x2f9390=_0x2845dd[_0x4f8afa(0xc0)]?createFsInstanceStore(resolveRoot(_0x2845dd[_0x4f8afa(0xc0)],_0x2845dd[_0x4f8afa(0xb1)]),_0x2845dd[_0x4f8afa(0xc7)]):void 0x0,_0x5b96c7=_0x2845dd[_0x4f8afa(0xa7)]?createFsVersionStore(resolveRoot(_0x2845dd[_0x4f8afa(0xa7)],_0x2845dd['cwd']),_0x3bc0e1):void 0x0;return{'artifacts':_0x3bc0e1,'instances':_0x2f9390,'versions':_0x5b96c7};}exports[_0x489bbe(0xc6)]=createKtFsStores;
package/dist/fs.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5b66fe,_0x4146cb){const _0x356e14=_0x3d54,_0xf57188=_0x5b66fe();while(!![]){try{const _0x308ca5=parseInt(_0x356e14(0xa8))/0x1*(parseInt(_0x356e14(0xb0))/0x2)+-parseInt(_0x356e14(0xa0))/0x3*(parseInt(_0x356e14(0x99))/0x4)+parseInt(_0x356e14(0x90))/0x5+-parseInt(_0x356e14(0xca))/0x6*(-parseInt(_0x356e14(0x93))/0x7)+-parseInt(_0x356e14(0xa9))/0x8+parseInt(_0x356e14(0xaf))/0x9+parseInt(_0x356e14(0x9b))/0xa*(-parseInt(_0x356e14(0xb8))/0xb);if(_0x308ca5===_0x4146cb)break;else _0xf57188['push'](_0xf57188['shift']());}catch(_0x207def){_0xf57188['push'](_0xf57188['shift']());}}}(_0x18aa,0x8d3aa));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 _0x3d54(_0x5152fe,_0x13e7b1){_0x5152fe=_0x5152fe-0x8a;const _0x18aa89=_0x18aa();let _0x3d5436=_0x18aa89[_0x5152fe];if(_0x3d54['BxAJGC']===undefined){var _0x4c1b3d=function(_0x1ce162){const _0x1a9d39='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x288594='',_0x17c666='';for(let _0x24644e=0x0,_0x564893,_0x4965db,_0x1db821=0x0;_0x4965db=_0x1ce162['charAt'](_0x1db821++);~_0x4965db&&(_0x564893=_0x24644e%0x4?_0x564893*0x40+_0x4965db:_0x4965db,_0x24644e++%0x4)?_0x288594+=String['fromCharCode'](0xff&_0x564893>>(-0x2*_0x24644e&0x6)):0x0){_0x4965db=_0x1a9d39['indexOf'](_0x4965db);}for(let _0x234e58=0x0,_0x675468=_0x288594['length'];_0x234e58<_0x675468;_0x234e58++){_0x17c666+='%'+('00'+_0x288594['charCodeAt'](_0x234e58)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x17c666);};_0x3d54['DVMMDE']=_0x4c1b3d,_0x3d54['DdJMby']={},_0x3d54['BxAJGC']=!![];}const _0x5b28be=_0x18aa89[0x0];_0x3d54['OHObQa']!==_0x5b28be&&(_0x3d54['DdJMby']={},_0x3d54['OHObQa']=_0x5b28be);const _0x2925cd=_0x3d54['DdJMby'][_0x5152fe];return _0x2925cd===undefined?(_0x3d5436=_0x3d54['DVMMDE'](_0x3d5436),_0x3d54['DdJMby'][_0x5152fe]=_0x3d5436):_0x3d5436=_0x2925cd,_0x3d5436;}function resolveRoot(_0x17c666,_0x24644e=process['cwd']()){const _0x564893=isAbsolute(_0x17c666)?_0x17c666:resolve(_0x24644e,_0x17c666);return mkdirSync(_0x564893,{'recursive':!![]}),_0x564893;}function artifactDir(_0x4965db,_0x1db821){return join(_0x4965db,_0x1db821);}function objectPath(_0x234e58,_0x675468){const _0x456e95=_0x3d54;return join(_0x234e58,'objects',_0x675468[_0x456e95(0xbc)](0x0,0x2),_0x675468);}function itemDir(_0x1553d1,_0x57c266,_0x5c4c9b){return join(_0x1553d1,'items',_0x57c266,_0x5c4c9b);}function newEtag(){const _0x26e82a=_0x3d54;return Date[_0x26e82a(0x94)]()[_0x26e82a(0xb5)](0x24)+'-'+Math[_0x26e82a(0xa5)]()[_0x26e82a(0xb5)](0x24)[_0x26e82a(0xbc)](0x2,0x8);}function readEtag(_0x20c49b){const _0x9a92fa=_0x3d54,_0xf88c36=join(_0x20c49b,_0x9a92fa(0xcd));return existsSync(_0xf88c36)?readFileSync(_0xf88c36,_0x9a92fa(0x95))['trim']():void 0x0;}function writeArtifactDir(_0x58b313,_0x2674e3,_0x18f3cf){const _0x1228aa=_0x3d54;mkdirSync(join(_0x58b313,_0x1228aa(0xd1)),{'recursive':!![]});const _0xd5c982=artifactToFiles(_0x2674e3);writeFileSync(join(_0x58b313,ARTIFACT_FILE_META),_0xd5c982[ARTIFACT_FILE_META]??'{}',_0x1228aa(0x95)),writeFileSync(join(_0x58b313,ARTIFACT_FILE_BODY),_0xd5c982[ARTIFACT_FILE_BODY]??'',_0x1228aa(0x95));const _0x124bfd=join(_0x58b313,ARTIFACT_FILE_FILL),_0x57fd80=join(_0x58b313,ARTIFACT_FILE_REPORT);if(_0xd5c982[ARTIFACT_FILE_FILL])writeFileSync(_0x124bfd,_0xd5c982[ARTIFACT_FILE_FILL],_0x1228aa(0x95));else{if(existsSync(_0x124bfd))rmSync(_0x124bfd);}if(_0xd5c982[ARTIFACT_FILE_REPORT])writeFileSync(_0x57fd80,_0xd5c982[ARTIFACT_FILE_REPORT],_0x1228aa(0x95));else{if(existsSync(_0x57fd80))rmSync(_0x57fd80);}writeFileSync(join(_0x58b313,_0x1228aa(0xcd)),_0x18f3cf,_0x1228aa(0x95));}function readArtifactDir(_0x2fdc0e,_0x19f087){const _0x496dce=_0x3d54,_0x48535e={},_0x3017eb=join(_0x2fdc0e,ARTIFACT_FILE_META),_0x164123=join(_0x2fdc0e,ARTIFACT_FILE_BODY);if(existsSync(_0x3017eb))_0x48535e[ARTIFACT_FILE_META]=readFileSync(_0x3017eb,'utf8');if(existsSync(_0x164123))_0x48535e[ARTIFACT_FILE_BODY]=readFileSync(_0x164123,_0x496dce(0x95));const _0x523932=join(_0x2fdc0e,ARTIFACT_FILE_FILL),_0xf26273=join(_0x2fdc0e,ARTIFACT_FILE_REPORT);if(existsSync(_0x523932))_0x48535e[ARTIFACT_FILE_FILL]=readFileSync(_0x523932,'utf8');if(existsSync(_0xf26273))_0x48535e[ARTIFACT_FILE_REPORT]=readFileSync(_0xf26273,_0x496dce(0x95));return{...filesToArtifact(_0x48535e,_0x19f087),'etag':readEtag(_0x2fdc0e)};}function createFsArtifactStore(_0x5d79ba,_0x1a980b=[]){mkdirSync(_0x5d79ba,{'recursive':!![]});for(const _0x4c3808 of _0x1a980b){const _0x2ec9d7=artifactDir(_0x5d79ba,_0x4c3808['id']),_0x44023a=join(_0x2ec9d7,ARTIFACT_FILE_BODY);if(!existsSync(_0x44023a))writeArtifactDir(_0x2ec9d7,_0x4c3808,_0x4c3808['etag']??newEtag());}return{async 'list'(_0x47aa26){const _0x951e71=_0x3d54;if(!existsSync(_0x5d79ba))return[];const _0x4d387d=[];for(const _0x306553 of readdirSync(_0x5d79ba,{'withFileTypes':!![]})){if(!_0x306553['isDirectory']())continue;try{const _0x5e8f94=readArtifactDir(artifactDir(_0x5d79ba,_0x306553[_0x951e71(0x91)]),_0x306553[_0x951e71(0x91)]);if(!_0x47aa26||_0x5e8f94[_0x951e71(0xb4)]===_0x47aa26)_0x4d387d[_0x951e71(0xae)]({'id':_0x5e8f94['id'],'name':_0x5e8f94['name'],'kind':_0x5e8f94['kind']});}catch{}}return _0x4d387d;},async 'get'(_0x58c5ee){const _0x4b7d00=artifactDir(_0x5d79ba,_0x58c5ee);if(!existsSync(_0x4b7d00))throw new KtNotFoundError('artifact\x20'+_0x58c5ee);return readArtifactDir(_0x4b7d00,_0x58c5ee);},async 'save'(_0x5c0f29){const _0x4f2280=_0x3d54,_0x3b8c34=artifactDir(_0x5d79ba,_0x5c0f29['id']),_0x58a029=existsSync(_0x3b8c34)?readArtifactDir(_0x3b8c34,_0x5c0f29['id']):void 0x0;if(_0x5c0f29['etag']&&_0x58a029?.[_0x4f2280(0xc8)]&&_0x5c0f29['etag']!==_0x58a029[_0x4f2280(0xc8)])throw new KtConflictError(_0x4f2280(0xd2),_0x58a029);const _0xaf8c7f=newEtag();return writeArtifactDir(_0x3b8c34,_0x5c0f29,_0xaf8c7f),{..._0x5c0f29,'etag':_0xaf8c7f};},async 'create'(_0x3fd5cb){const _0xb0c684=_0x3d54,_0x40cd9a=_0x3fd5cb[_0xb0c684(0xb4)]+'-'+Math[_0xb0c684(0xa5)]()['toString'](0x24)['slice'](0x2,0xa),_0x2399e0={'id':_0x40cd9a,'name':_0x3fd5cb[_0xb0c684(0x91)],'kind':_0x3fd5cb[_0xb0c684(0xb4)],'ktl':EMPTY_KTL};return this[_0xb0c684(0xcb)](_0x2399e0);},async 'remove'(_0x9a3a2c){const _0x2f305e=_0x3d54,_0x3e833b=artifactDir(_0x5d79ba,_0x9a3a2c);if(!existsSync(_0x3e833b))throw new KtNotFoundError(_0x2f305e(0x9a)+_0x9a3a2c);rmSync(_0x3e833b,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x415253,_0x1acc19={}){const _0x4d1270=_0x3d54;mkdirSync(_0x415253,{'recursive':!![]});const _0x4571c0=_0x274929=>join(_0x415253,_0x274929+'.json');for(const [_0x1d8f89,_0x5ba91c]of Object[_0x4d1270(0xc5)](_0x1acc19)){if(!existsSync(_0x4571c0(_0x1d8f89)))writeFileSync(_0x4571c0(_0x1d8f89),JSON[_0x4d1270(0xc4)](_0x5ba91c,null,0x2),'utf8');}return{async 'get'(_0x4d95ba){const _0x399abf=_0x4d1270,_0x56d3eb=_0x4571c0(_0x4d95ba);if(!existsSync(_0x56d3eb))throw new KtNotFoundError(_0x399abf(0xba)+_0x4d95ba);return JSON['parse'](readFileSync(_0x56d3eb,'utf8'));},async 'save'(_0x2be0db,_0x4421a2){const _0x27f3c5=_0x4d1270,_0xab18a8=_0x4571c0(_0x2be0db),_0x5a6457=existsSync(_0xab18a8)?JSON[_0x27f3c5(0xad)](readFileSync(_0xab18a8,'utf8')):{'artifactId':'','values':{}},_0x12dd45={'artifactId':_0x5a6457['artifactId'],'values':{..._0x5a6457[_0x27f3c5(0xbb)],..._0x4421a2[_0x27f3c5(0xbb)]},'common':{..._0x5a6457[_0x27f3c5(0xc2)],..._0x4421a2['common']},'tabCommon':{..._0x5a6457[_0x27f3c5(0xb7)],..._0x4421a2[_0x27f3c5(0xb7)]}};writeFileSync(_0xab18a8,JSON[_0x27f3c5(0xc4)](_0x12dd45,null,0x2),'utf8');},async 'list'(_0x1070be){const _0x3f2ac2=_0x4d1270;return readdirSync(_0x415253)[_0x3f2ac2(0xaa)](_0x213831=>_0x213831[_0x3f2ac2(0x9c)](_0x3f2ac2(0x9d)))[_0x3f2ac2(0xc9)](_0x7b9b63=>{const _0x47e052=_0x3f2ac2,_0x3b3084=_0x7b9b63[_0x47e052(0xbc)](0x0,-0x5),_0x55e808=JSON['parse'](readFileSync(join(_0x415253,_0x7b9b63),'utf8'));return{'id':_0x3b3084,'artifactId':_0x55e808[_0x47e052(0xac)]};})[_0x3f2ac2(0xaa)](_0x27b9f2=>!_0x1070be||_0x27b9f2[_0x3f2ac2(0xac)]===_0x1070be);},async 'create'(_0x3029e4){const _0x3517bd=_0x4d1270,_0x50cd40='inst-'+Math['random']()[_0x3517bd(0xb5)](0x24)[_0x3517bd(0xbc)](0x2,0xa);return writeFileSync(_0x4571c0(_0x50cd40),JSON[_0x3517bd(0xc4)]({'artifactId':_0x3029e4['artifactId'],'values':{},'common':{}},null,0x2),_0x3517bd(0x95)),{'id':_0x50cd40};}};}function sha256Hex(_0x361c2c){const _0x2946ea=_0x3d54,_0x233c8d=typeof _0x361c2c===_0x2946ea(0xb1)?Buffer['from'](_0x361c2c,_0x2946ea(0x95)):Buffer[_0x2946ea(0xa7)](_0x361c2c);return createHash('sha256')[_0x2946ea(0x98)](_0x233c8d)[_0x2946ea(0xa6)](_0x2946ea(0x9f));}function writeObject(_0x4fed6e,_0xbe4b){const _0x20c28e=sha256Hex(_0xbe4b),_0x5c184e=objectPath(_0x4fed6e,_0x20c28e);mkdirSync(dirname(_0x5c184e),{'recursive':!![]});if(!existsSync(_0x5c184e))writeFileSync(_0x5c184e,_0xbe4b);return _0x20c28e;}function _0x18aa(){const _0x17e082=['mtK2otznDg9tDe8','yxj0AwzHy3qG','mtyWDe5vwMjW','zw5KC1DPDgG','lMPZB24','z2v0twLUDxrLCW','Agv4','mZz4C0fQqMy','sevbra','C2vLza','zMLSzxm','A2v5CW','CMfUzg9T','zgLNzxn0','zNjVBq','nJm4ntfZvhjzufK','mZi1ndKYoendB0PuBq','zMLSDgvY','Dg9ju09tDhjPBMC','yxj0AwzHy3rjza','CgfYC2u','ChvZAa','mZeYmdmWmfjXCff6Bq','mtrQs0vms1u','C3rYAw5N','zMLUza','y3DK','A2LUza','Dg9tDhjPBMC','z2v0tw9UDgG','DgfIq29TBw9U','ndK1oteZy2nTDK5P','z2v0','Aw5ZDgfUy2uG','DMfSDwvZ','C2XPy2u','AxneAxjLy3rVCNK','y29TBwL0','AxrLBxm','5OgI5Asn6iEQia','DhjPBq','y29TBw9U','C2vLzeLUC3rHBMnLCW','C3rYAw5NAwz5','zw50CMLLCW','AgvHza','CgfKu3rHCNq','zxrHzW','BwfW','mtHwsvHlAge','C2f2zq','z2v0rgf0zq','lMv0ywC','AM9PBG','DMvYC2LVBNnsB290','Bwv0yq','zMfJzxm','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','CMv2','BM90zq','yxj0AwzHy3rZuM9VDa','CMvHzezPBgu','C29YDa','zgvJB2rL','lwXVy2fSlq','ndC1mte2mhPws2fpsq','BMfTzq','Aw5ZDgfUy2vZuM9VDa','nteWmJntBfnPr1K','BM93','DxrMoa','Bg9NlMPZB24','z2v0rNvSBfLLyxi','DxbKyxrL'];_0x18aa=function(){return _0x17e082;};return _0x18aa();}function readLog(_0x468231,_0x1992b1,_0x4d0229){const _0xcd2ed2=_0x3d54,_0x41abcb=itemDir(_0x468231,_0x1992b1,_0x4d0229),_0x2a6a15=join(_0x41abcb,_0xcd2ed2(0x96)),_0x55520c=join(_0x41abcb,_0xcd2ed2(0xa1)),_0x20a44d=existsSync(_0x2a6a15)?JSON[_0xcd2ed2(0xad)](readFileSync(_0x2a6a15,_0xcd2ed2(0x95))):[],_0x392c29=existsSync(_0x55520c)?readFileSync(_0x55520c,_0xcd2ed2(0x95))[_0xcd2ed2(0xc1)]():_0x20a44d['at'](-0x1)?.['rev']??null;return{'head':_0x392c29,'items':_0x20a44d};}function writeLog(_0x454015,_0x49f3fa,_0x601d34,_0xf86d69,_0x120ae4){const _0x1f594b=_0x3d54,_0x5e29aa=itemDir(_0x454015,_0x49f3fa,_0x601d34);mkdirSync(_0x5e29aa,{'recursive':!![]}),writeFileSync(join(_0x5e29aa,_0x1f594b(0x96)),JSON[_0x1f594b(0xc4)](_0x120ae4,null,0x2),'utf8'),writeFileSync(join(_0x5e29aa,_0x1f594b(0xa1)),_0xf86d69+'\x0a',_0x1f594b(0x95));}function findRev(_0x116d34,_0x5095cd){const _0x1db77c=_0x3d54,_0x56be0e=join(_0x116d34,_0x1db77c(0xbf));if(!existsSync(_0x56be0e))return void 0x0;for(const _0x4221bd of readdirSync(_0x56be0e,{'withFileTypes':!![]})){if(!_0x4221bd[_0x1db77c(0xbd)]())continue;for(const _0x548625 of readdirSync(join(_0x56be0e,_0x4221bd[_0x1db77c(0x91)]),{'withFileTypes':!![]})){if(!_0x548625['isDirectory']())continue;const _0x53c8fb=readLog(_0x116d34,_0x4221bd[_0x1db77c(0x91)],_0x548625['name'])[_0x1db77c(0xbf)][_0x1db77c(0xb2)](_0x2b4557=>_0x2b4557[_0x1db77c(0xd3)]===_0x5095cd);if(_0x53c8fb)return _0x53c8fb;}}return void 0x0;}function filesTextOf(_0x1ae1d1,_0x563370){const _0x4cb759=_0x3d54,_0x1367dc={};for(const [_0x38fd19,_0x2e2039]of Object['entries'](_0x563370[_0x4cb759(0xa3)])){const _0xf0eb4=objectPath(_0x1ae1d1,_0x2e2039);if(existsSync(_0xf0eb4))_0x1367dc[_0x38fd19]=readFileSync(_0xf0eb4,_0x4cb759(0x95));}return _0x1367dc;}function createFsVersionStore(_0x247b0d,_0x3e12d3){return mkdirSync(_0x247b0d,{'recursive':!![]}),{async 'log'(_0x396622,_0x2fc1a3){const _0x495af3=_0x3d54,{head:_0x3d44fd,items:_0xb476a3}=readLog(_0x247b0d,_0x396622,_0x2fc1a3);return{'head':_0x3d44fd,'items':[..._0xb476a3][_0x495af3(0x8d)]((_0x3d3319,_0x473bc8)=>_0x3d3319['at']<_0x473bc8['at']?0x1:-0x1)};},async 'get'(_0xa2dd61){const _0xa1c8c2=findRev(_0x247b0d,_0xa2dd61);if(!_0xa1c8c2)throw new KtNotFoundError('rev\x20'+_0xa2dd61);return _0xa1c8c2;},async 'readFile'(_0x3794f0,_0x59ef62){const _0x838f32=_0x3d54,_0x426ea5=await this[_0x838f32(0xb9)](_0x3794f0),_0x5be1a4=_0x426ea5[_0x838f32(0xa3)][_0x59ef62];if(!_0x5be1a4)throw new KtNotFoundError(_0x59ef62);const _0x27766e=objectPath(_0x247b0d,_0x5be1a4);if(!existsSync(_0x27766e))throw new KtNotFoundError(_0x59ef62);return new Uint8Array(readFileSync(_0x27766e));},async 'commit'(_0x3ce27a){const _0x3b3859=_0x3d54;let _0x21b736=_0x3ce27a['files'];if(!_0x21b736){const _0x19bf4e=await _0x3e12d3[_0x3b3859(0xb9)](_0x3ce27a['id']);_0x21b736=artifactToFiles(_0x19bf4e);}const _0x82747e={},_0x52ffd3={};for(const [_0x15ee23,_0x3572a1]of Object[_0x3b3859(0xc5)](_0x21b736)){const _0x2212c0=typeof _0x3572a1==='string'?_0x3572a1:new TextDecoder()[_0x3b3859(0x8e)](_0x3572a1);_0x82747e[_0x15ee23]=_0x2212c0,_0x52ffd3[_0x15ee23]=writeObject(_0x247b0d,typeof _0x3572a1===_0x3b3859(0xb1)?Buffer[_0x3b3859(0xa7)](_0x3572a1,'utf8'):_0x3572a1);}const _0xb80ca=readLog(_0x247b0d,_0x3ce27a['kind'],_0x3ce27a['id']);if(_0xb80ca[_0x3b3859(0xc6)]){const _0x14695e=_0xb80ca['items'][_0x3b3859(0xb2)](_0x3d5c63=>_0x3d5c63['rev']===_0xb80ca[_0x3b3859(0xc6)]);if(_0x14695e&&filesEqual(_0x82747e,filesTextOf(_0x247b0d,_0x14695e)))return _0x14695e;}const _0x2fe798=new Date(),_0x3e6098=String(_0x2fe798[_0x3b3859(0x97)]())[_0x3b3859(0xbc)](0x2)+String(_0x2fe798[_0x3b3859(0xb6)]()+0x1)[_0x3b3859(0xc7)](0x2,'0')+String(_0x2fe798[_0x3b3859(0xcc)]())[_0x3b3859(0xc7)](0x2,'0')+String(_0x2fe798['getHours']())['padStart'](0x2,'0')+String(_0x2fe798[_0x3b3859(0x9e)]())[_0x3b3859(0xc7)](0x2,'0'),_0x21dd8=sha256Hex(Object['values'](_0x52ffd3)['sort']()[_0x3b3859(0xce)](','))[_0x3b3859(0xbc)](0x0,0x8),_0x13e1df={'rev':_0x3e6098+_0x3b3859(0x8f)+_0x21dd8,'kind':_0x3ce27a[_0x3b3859(0xb4)],'id':_0x3ce27a['id'],'at':_0x2fe798[_0x3b3859(0xab)](),'parent':_0xb80ca['head'],'by':_0x3ce27a['by'],'note':_0x3ce27a[_0x3b3859(0x8a)],'files':_0x52ffd3,'meta':_0x3ce27a[_0x3b3859(0xd0)]};return writeLog(_0x247b0d,_0x3ce27a[_0x3b3859(0xb4)],_0x3ce27a['id'],_0x13e1df[_0x3b3859(0xd3)],[..._0xb80ca[_0x3b3859(0xbf)],_0x13e1df]),_0x13e1df;},async 'restore'(_0x567f03,_0x120993,_0x2096fb,_0xbb88eb){const _0x25f4ea=_0x3d54,_0x28e0af=await this[_0x25f4ea(0xb9)](_0x2096fb),_0x3e22d1={};for(const _0x113328 of Object[_0x25f4ea(0xa4)](_0x28e0af[_0x25f4ea(0xa3)])){_0x3e22d1[_0x113328]=new TextDecoder()[_0x25f4ea(0x8e)](await this[_0x25f4ea(0x8c)](_0x2096fb,_0x113328));}const _0x3d3d59=filesToArtifact(_0x3e22d1,_0x120993);return await _0x3e12d3[_0x25f4ea(0xcb)]({..._0x3d3d59,'id':_0x120993,'kind':_0x3d3d59['kind'],'etag':void 0x0}),this[_0x25f4ea(0xbe)]({'kind':_0x567f03,'id':_0x120993,'files':_0x3e22d1,'by':_0xbb88eb,'note':_0x25f4ea(0xc0)+_0x2096fb});}};}function createKtFsStores(_0x30486e){const _0x3f1fd9=_0x3d54,_0x1e8307=createFsArtifactStore(resolveRoot(_0x30486e[_0x3f1fd9(0x8b)],_0x30486e[_0x3f1fd9(0xb3)]),_0x30486e[_0x3f1fd9(0xa2)]),_0x474ac6=_0x30486e['instancesRoot']?createFsInstanceStore(resolveRoot(_0x30486e[_0x3f1fd9(0x92)],_0x30486e['cwd']),_0x30486e[_0x3f1fd9(0xc3)]):void 0x0,_0x27a7de=_0x30486e[_0x3f1fd9(0xcf)]?createFsVersionStore(resolveRoot(_0x30486e[_0x3f1fd9(0xcf)],_0x30486e[_0x3f1fd9(0xb3)]),_0x1e8307):void 0x0;return{'artifacts':_0x1e8307,'instances':_0x474ac6,'versions':_0x27a7de};}export{createKtFsStores};
1
+ (function(_0x22bf45,_0x349389){const _0x3116fe=_0x5b87,_0x54ad76=_0x22bf45();while(!![]){try{const _0x2cf2ff=-parseInt(_0x3116fe(0xf4))/0x1*(-parseInt(_0x3116fe(0xfb))/0x2)+-parseInt(_0x3116fe(0xc7))/0x3+parseInt(_0x3116fe(0xe7))/0x4+parseInt(_0x3116fe(0xc4))/0x5+-parseInt(_0x3116fe(0xff))/0x6+-parseInt(_0x3116fe(0xea))/0x7*(-parseInt(_0x3116fe(0xce))/0x8)+parseInt(_0x3116fe(0x102))/0x9;if(_0x2cf2ff===_0x349389)break;else _0x54ad76['push'](_0x54ad76['shift']());}catch(_0x42e9aa){_0x54ad76['push'](_0x54ad76['shift']());}}}(_0x3506,0x5bfe9));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(_0x4dbba5,_0x579a52=process['cwd']()){const _0x545ee1=isAbsolute(_0x4dbba5)?_0x4dbba5:resolve(_0x579a52,_0x4dbba5);return mkdirSync(_0x545ee1,{'recursive':!![]}),_0x545ee1;}function artifactDir(_0x3c4e62,_0x464cef){return join(_0x3c4e62,_0x464cef);}function _0x5b87(_0x3c6b77,_0x113171){_0x3c6b77=_0x3c6b77-0xbf;const _0x350663=_0x3506();let _0x5b8724=_0x350663[_0x3c6b77];if(_0x5b87['dQZBiY']===undefined){var _0x29c6af=function(_0x13dbd2){const _0x146ce0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x13e402='',_0x4dbba5='';for(let _0x579a52=0x0,_0x545ee1,_0x3c4e62,_0x464cef=0x0;_0x3c4e62=_0x13dbd2['charAt'](_0x464cef++);~_0x3c4e62&&(_0x545ee1=_0x579a52%0x4?_0x545ee1*0x40+_0x3c4e62:_0x3c4e62,_0x579a52++%0x4)?_0x13e402+=String['fromCharCode'](0xff&_0x545ee1>>(-0x2*_0x579a52&0x6)):0x0){_0x3c4e62=_0x146ce0['indexOf'](_0x3c4e62);}for(let _0x1ef747=0x0,_0x4f4577=_0x13e402['length'];_0x1ef747<_0x4f4577;_0x1ef747++){_0x4dbba5+='%'+('00'+_0x13e402['charCodeAt'](_0x1ef747)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4dbba5);};_0x5b87['TUqwzP']=_0x29c6af,_0x5b87['eldQfJ']={},_0x5b87['dQZBiY']=!![];}const _0xf7297b=_0x350663[0x0];_0x5b87['JrMChO']!==_0xf7297b&&(_0x5b87['eldQfJ']={},_0x5b87['JrMChO']=_0xf7297b);const _0x23042d=_0x5b87['eldQfJ'][_0x3c6b77];return _0x23042d===undefined?(_0x5b8724=_0x5b87['TUqwzP'](_0x5b8724),_0x5b87['eldQfJ'][_0x3c6b77]=_0x5b8724):_0x5b8724=_0x23042d,_0x5b8724;}function objectPath(_0x1ef747,_0x4f4577){const _0x291f9c=_0x5b87;return join(_0x1ef747,_0x291f9c(0xe8),_0x4f4577[_0x291f9c(0xee)](0x0,0x2),_0x4f4577);}function _0x3506(){const _0x294872=['DMfSDwvZ','y29TBw9U','zMfJzxm','sevbra','C2vLzeLUC3rHBMnLCW','DxbKyxrL','C29YDa','zMLUza','Dg9ju09tDhjPBMC','Agv4','DhjPBq','mtG3ntaWB1bpD1LX','B2jQzwn0CW','z2v0','mtrpDhfhDwu','5OgI5Asn6iEQia','zgvJB2rL','yxj0AwzHy3qG','C2XPy2u','C3rYAw5N','C3rYAw5NAwz5','CMv2','CMfUzg9T','lMPZB24','nZu3CvrKCMfr','y29TBwL0','DgfIq29TBw9U','A2v5CW','z2v0twLUDxrLCW','z2v0rgf0zq','yxj0AwzHy3rjza','ntm0Chrnv2HJ','CgfKu3rHCNq','zgLNzxn0','lMv0ywC','otu2nJe2B3vjCgfg','CMvHzezPBgu','z2v0tw9UDgG','mti0otiZnK1ouuzhAq','zxrHzW','BwfW','y3DK','AgvHza','Aw5ZDc0','ChvZAa','zNjVBq','DxrMoa','mtqYoty4mfDKrvD4Cq','Bwv0yq','Dg9tDhjPBMC','ndGXmdy1s2HlB3nb','z2v0rNvSBfLLyxi','C2f2zq','BM93','Aw5ZDgfUy2uG','AxrLBxm','zw50CMLLCW','ote0nJrxzejItuS','BMfTzq','CgfYC2u','zw5KC1DPDgG','BM90zq','A2LUza','C2HHmJu2','Aw5ZDgfUy2vZuM9VDa','DMvYC2LVBNnsB290','CMv2ia','Bg9NlMPZB24','AxneAxjLy3rVCNK','zMLSzxm','yxj0AwzHy3rZuM9VDa'];_0x3506=function(){return _0x294872;};return _0x3506();}function itemDir(_0x11001d,_0x4b9233,_0xe457b4){const _0x8d2f13=_0x5b87;return join(_0x11001d,_0x8d2f13(0xcc),_0x4b9233,_0xe457b4);}function newEtag(){const _0x12b345=_0x5b87;return Date[_0x12b345(0xca)]()[_0x12b345(0xc6)](0x24)+'-'+Math[_0x12b345(0xf2)]()[_0x12b345(0xc6)](0x24)[_0x12b345(0xee)](0x2,0x8);}function readEtag(_0x38aa56){const _0x47d2c3=_0x5b87,_0x19f67f=join(_0x38aa56,_0x47d2c3(0xfe));return existsSync(_0x19f67f)?readFileSync(_0x19f67f,_0x47d2c3(0xc3))[_0x47d2c3(0xe6)]():void 0x0;}function writeArtifactDir(_0x8684c7,_0x2c8151,_0x2e2f5b){const _0x42b4ef=_0x5b87;mkdirSync(join(_0x8684c7,_0x42b4ef(0xde)),{'recursive':!![]});const _0xd487b2=artifactToFiles(_0x2c8151);writeFileSync(join(_0x8684c7,ARTIFACT_FILE_META),_0xd487b2[ARTIFACT_FILE_META]??'{}','utf8'),writeFileSync(join(_0x8684c7,ARTIFACT_FILE_BODY),_0xd487b2[ARTIFACT_FILE_BODY]??'','utf8');const _0x2d50a2=join(_0x8684c7,ARTIFACT_FILE_FILL),_0x17d0ba=join(_0x8684c7,ARTIFACT_FILE_REPORT);if(_0xd487b2[ARTIFACT_FILE_FILL])writeFileSync(_0x2d50a2,_0xd487b2[ARTIFACT_FILE_FILL],_0x42b4ef(0xc3));else{if(existsSync(_0x2d50a2))rmSync(_0x2d50a2);}if(_0xd487b2[ARTIFACT_FILE_REPORT])writeFileSync(_0x17d0ba,_0xd487b2[ARTIFACT_FILE_REPORT],_0x42b4ef(0xc3));else{if(existsSync(_0x17d0ba))rmSync(_0x17d0ba);}writeFileSync(join(_0x8684c7,_0x42b4ef(0xfe)),_0x2e2f5b,_0x42b4ef(0xc3));}function readArtifactDir(_0x24e932,_0x71c373){const _0x5ecae5=_0x5b87,_0x335357={},_0x42be96=join(_0x24e932,ARTIFACT_FILE_META),_0x1e19e2=join(_0x24e932,ARTIFACT_FILE_BODY);if(existsSync(_0x42be96))_0x335357[ARTIFACT_FILE_META]=readFileSync(_0x42be96,_0x5ecae5(0xc3));if(existsSync(_0x1e19e2))_0x335357[ARTIFACT_FILE_BODY]=readFileSync(_0x1e19e2,_0x5ecae5(0xc3));const _0x276c57=join(_0x24e932,ARTIFACT_FILE_FILL),_0x4e102d=join(_0x24e932,ARTIFACT_FILE_REPORT);if(existsSync(_0x276c57))_0x335357[ARTIFACT_FILE_FILL]=readFileSync(_0x276c57,_0x5ecae5(0xc3));if(existsSync(_0x4e102d))_0x335357[ARTIFACT_FILE_REPORT]=readFileSync(_0x4e102d,_0x5ecae5(0xc3));return{...filesToArtifact(_0x335357,_0x71c373),'etag':readEtag(_0x24e932)};}function createFsArtifactStore(_0x3cd14b,_0x526e9d=[]){mkdirSync(_0x3cd14b,{'recursive':!![]});for(const _0x385cb0 of _0x526e9d){const _0x5df42d=artifactDir(_0x3cd14b,_0x385cb0['id']),_0x55b32a=join(_0x5df42d,ARTIFACT_FILE_BODY);if(!existsSync(_0x55b32a))writeArtifactDir(_0x5df42d,_0x385cb0,_0x385cb0['etag']??newEtag());}return{async 'list'(_0x50c58f){const _0xca6d4f=_0x5b87;if(!existsSync(_0x3cd14b))return[];const _0x193439=[];for(const _0x1863fe of readdirSync(_0x3cd14b,{'withFileTypes':!![]})){if(!_0x1863fe[_0xca6d4f(0xd9)]())continue;try{const _0x2a82ac=readArtifactDir(artifactDir(_0x3cd14b,_0x1863fe[_0xca6d4f(0xcf)]),_0x1863fe[_0xca6d4f(0xcf)]);if(!_0x50c58f||_0x2a82ac[_0xca6d4f(0xd3)]===_0x50c58f)_0x193439[_0xca6d4f(0xc1)]({'id':_0x2a82ac['id'],'name':_0x2a82ac[_0xca6d4f(0xcf)],'kind':_0x2a82ac[_0xca6d4f(0xd3)]});}catch{}}return _0x193439;},async 'get'(_0x295350){const _0x3f5dfa=_0x5b87,_0x59cba4=artifactDir(_0x3cd14b,_0x295350);if(!existsSync(_0x59cba4))throw new KtNotFoundError(_0x3f5dfa(0xed)+_0x295350);return readArtifactDir(_0x59cba4,_0x295350);},async 'save'(_0x11059b){const _0xe1cf2c=_0x5b87,_0x2f13d3=artifactDir(_0x3cd14b,_0x11059b['id']),_0x1860c8=existsSync(_0x2f13d3)?readArtifactDir(_0x2f13d3,_0x11059b['id']):void 0x0;if(_0x11059b[_0xe1cf2c(0x103)]&&_0x1860c8?.[_0xe1cf2c(0x103)]&&_0x11059b[_0xe1cf2c(0x103)]!==_0x1860c8['etag'])throw new KtConflictError('\u5DE5\u4F5C\u526F\u672C\u5DF2\u53D8\u66F4',_0x1860c8);const _0x278278=newEtag();return writeArtifactDir(_0x2f13d3,_0x11059b,_0x278278),{..._0x11059b,'etag':_0x278278};},async 'create'(_0x36ece1){const _0x9bc488=_0x5b87,_0x418233=_0x36ece1[_0x9bc488(0xd3)]+'-'+Math[_0x9bc488(0xf2)]()['toString'](0x24)[_0x9bc488(0xee)](0x2,0xa),_0x5be1c2={'id':_0x418233,'name':_0x36ece1[_0x9bc488(0xcf)],'kind':_0x36ece1[_0x9bc488(0xd3)],'ktl':EMPTY_KTL};return this[_0x9bc488(0xc9)](_0x5be1c2);},async 'remove'(_0x5a73ec){const _0x426c85=artifactDir(_0x3cd14b,_0x5a73ec);if(!existsSync(_0x426c85))throw new KtNotFoundError('artifact\x20'+_0x5a73ec);rmSync(_0x426c85,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x1bb245,_0x498c74={}){const _0x4b45ef=_0x5b87;mkdirSync(_0x1bb245,{'recursive':!![]});const _0x564833=_0x3513fb=>join(_0x1bb245,_0x3513fb+_0x4b45ef(0xf3));for(const [_0x9de2f,_0x20853a]of Object[_0x4b45ef(0xcd)](_0x498c74)){if(!existsSync(_0x564833(_0x9de2f)))writeFileSync(_0x564833(_0x9de2f),JSON[_0x4b45ef(0xf0)](_0x20853a,null,0x2),_0x4b45ef(0xc3));}return{async 'get'(_0x2f5de1){const _0x202f46=_0x4b45ef,_0x110996=_0x564833(_0x2f5de1);if(!existsSync(_0x110996))throw new KtNotFoundError(_0x202f46(0xcb)+_0x2f5de1);return JSON[_0x202f46(0xd0)](readFileSync(_0x110996,_0x202f46(0xc3)));},async 'save'(_0x1e53a0,_0x1b1a03){const _0x1910c4=_0x4b45ef,_0x4df70e=_0x564833(_0x1e53a0),_0x29e539=existsSync(_0x4df70e)?JSON[_0x1910c4(0xd0)](readFileSync(_0x4df70e,'utf8')):{'artifactId':'','values':{}},_0x14fbaf={'artifactId':_0x29e539[_0x1910c4(0xfa)],'values':{..._0x29e539[_0x1910c4(0xdc)],..._0x1b1a03['values']},'common':{..._0x29e539[_0x1910c4(0xdd)],..._0x1b1a03[_0x1910c4(0xdd)]},'tabCommon':{..._0x29e539[_0x1910c4(0xf6)],..._0x1b1a03['tabCommon']}};writeFileSync(_0x4df70e,JSON[_0x1910c4(0xf0)](_0x14fbaf,null,0x2),_0x1910c4(0xc3));},async 'list'(_0xa01998){const _0xc7359c=_0x4b45ef;return readdirSync(_0x1bb245)['filter'](_0x3c8cda=>_0x3c8cda[_0xc7359c(0xd1)]('.json'))[_0xc7359c(0x104)](_0x456068=>{const _0x55207e=_0xc7359c,_0x33ddb4=_0x456068['slice'](0x0,-0x5),_0x11d948=JSON[_0x55207e(0xd0)](readFileSync(join(_0x1bb245,_0x456068),_0x55207e(0xc3)));return{'id':_0x33ddb4,'artifactId':_0x11d948['artifactId']};})['filter'](_0x30d114=>!_0xa01998||_0x30d114['artifactId']===_0xa01998);},async 'create'(_0x24474a){const _0x120c8a=_0x4b45ef,_0x55b47a=_0x120c8a(0xc0)+Math['random']()[_0x120c8a(0xc6)](0x24)[_0x120c8a(0xee)](0x2,0xa);return writeFileSync(_0x564833(_0x55b47a),JSON[_0x120c8a(0xf0)]({'artifactId':_0x24474a['artifactId'],'values':{},'common':{}},null,0x2),'utf8'),{'id':_0x55b47a};}};}function sha256Hex(_0x3d5466){const _0x4d45aa=_0x5b87,_0x12809d=typeof _0x3d5466===_0x4d45aa(0xef)?Buffer[_0x4d45aa(0xc2)](_0x3d5466,_0x4d45aa(0xc3)):Buffer['from'](_0x3d5466);return createHash(_0x4d45aa(0xd4))[_0x4d45aa(0xe1)](_0x12809d)[_0x4d45aa(0xfd)](_0x4d45aa(0xe5));}function writeObject(_0x4c2d72,_0x2965d8){const _0x138f90=sha256Hex(_0x2965d8),_0x450d9b=objectPath(_0x4c2d72,_0x138f90);mkdirSync(dirname(_0x450d9b),{'recursive':!![]});if(!existsSync(_0x450d9b))writeFileSync(_0x450d9b,_0x2965d8);return _0x138f90;}function readLog(_0x3bf3de,_0x5cbcc9,_0x3d19a7){const _0x28ed9f=_0x5b87,_0x3e2511=itemDir(_0x3bf3de,_0x5cbcc9,_0x3d19a7),_0x395120=join(_0x3e2511,_0x28ed9f(0xd8)),_0x4147bf=join(_0x3e2511,_0x28ed9f(0xdf)),_0x4ba93c=existsSync(_0x395120)?JSON[_0x28ed9f(0xd0)](readFileSync(_0x395120,_0x28ed9f(0xc3))):[],_0x2e80fa=existsSync(_0x4147bf)?readFileSync(_0x4147bf,'utf8')[_0x28ed9f(0xe6)]():_0x4ba93c['at'](-0x1)?.[_0x28ed9f(0xf1)]??null;return{'head':_0x2e80fa,'items':_0x4ba93c};}function writeLog(_0x2e0f6b,_0xdc7604,_0x100af4,_0x51b785,_0x17ad09){const _0x37704a=_0x5b87,_0x3d09e9=itemDir(_0x2e0f6b,_0xdc7604,_0x100af4);mkdirSync(_0x3d09e9,{'recursive':!![]}),writeFileSync(join(_0x3d09e9,_0x37704a(0xd8)),JSON[_0x37704a(0xf0)](_0x17ad09,null,0x2),_0x37704a(0xc3)),writeFileSync(join(_0x3d09e9,'HEAD'),_0x51b785+'\x0a',_0x37704a(0xc3));}function findRev(_0x38d8eb,_0x9151de){const _0x37a0e8=_0x5b87,_0x565cb7=join(_0x38d8eb,'items');if(!existsSync(_0x565cb7))return void 0x0;for(const _0xd40d8b of readdirSync(_0x565cb7,{'withFileTypes':!![]})){if(!_0xd40d8b[_0x37a0e8(0xd9)]())continue;for(const _0x231173 of readdirSync(join(_0x565cb7,_0xd40d8b[_0x37a0e8(0xcf)]),{'withFileTypes':!![]})){if(!_0x231173[_0x37a0e8(0xd9)]())continue;const _0x3f9740=readLog(_0x38d8eb,_0xd40d8b['name'],_0x231173['name'])[_0x37a0e8(0xcc)][_0x37a0e8(0xe3)](_0xb0aeb0=>_0xb0aeb0['rev']===_0x9151de);if(_0x3f9740)return _0x3f9740;}}return void 0x0;}function filesTextOf(_0x47df6e,_0x17dbf5){const _0x18105e=_0x5b87,_0x4c8516={};for(const [_0x554f4d,_0x32e40c]of Object[_0x18105e(0xcd)](_0x17dbf5[_0x18105e(0xda)])){const _0x28b534=objectPath(_0x47df6e,_0x32e40c);if(existsSync(_0x28b534))_0x4c8516[_0x554f4d]=readFileSync(_0x28b534,_0x18105e(0xc3));}return _0x4c8516;}function createFsVersionStore(_0x4c396b,_0x22b6ca){return mkdirSync(_0x4c396b,{'recursive':!![]}),{async 'log'(_0xab4d2f,_0xb6ab9){const _0x1f8dec=_0x5b87,{head:_0x5dc24c,items:_0x23d353}=readLog(_0x4c396b,_0xab4d2f,_0xb6ab9);return{'head':_0x5dc24c,'items':[..._0x23d353][_0x1f8dec(0xe2)]((_0x3cf1df,_0x6498a5)=>_0x3cf1df['at']<_0x6498a5['at']?0x1:-0x1)};},async 'get'(_0x40c47c){const _0x224453=_0x5b87,_0x5d9777=findRev(_0x4c396b,_0x40c47c);if(!_0x5d9777)throw new KtNotFoundError(_0x224453(0xd7)+_0x40c47c);return _0x5d9777;},async 'readFile'(_0x26747b,_0x43035d){const _0x551a42=_0x5b87,_0x179268=await this[_0x551a42(0xe9)](_0x26747b),_0x284ab3=_0x179268[_0x551a42(0xda)][_0x43035d];if(!_0x284ab3)throw new KtNotFoundError(_0x43035d);const _0x13713b=objectPath(_0x4c396b,_0x284ab3);if(!existsSync(_0x13713b))throw new KtNotFoundError(_0x43035d);return new Uint8Array(readFileSync(_0x13713b));},async 'commit'(_0x3dc6ec){const _0x21688c=_0x5b87;let _0x72b8f5=_0x3dc6ec['files'];if(!_0x72b8f5){const _0x2c07be=await _0x22b6ca[_0x21688c(0xe9)](_0x3dc6ec['id']);_0x72b8f5=artifactToFiles(_0x2c07be);}const _0x3af658={},_0x19427c={};for(const [_0x21f556,_0x5f0818]of Object[_0x21688c(0xcd)](_0x72b8f5)){const _0x1e1083=typeof _0x5f0818===_0x21688c(0xef)?_0x5f0818:new TextDecoder()[_0x21688c(0xec)](_0x5f0818);_0x3af658[_0x21f556]=_0x1e1083,_0x19427c[_0x21f556]=writeObject(_0x4c396b,typeof _0x5f0818===_0x21688c(0xef)?Buffer['from'](_0x5f0818,_0x21688c(0xc3)):_0x5f0818);}const _0x4aa8b0=readLog(_0x4c396b,_0x3dc6ec[_0x21688c(0xd3)],_0x3dc6ec['id']);if(_0x4aa8b0['head']){const _0x3d96de=_0x4aa8b0[_0x21688c(0xcc)]['find'](_0x16d6b=>_0x16d6b[_0x21688c(0xf1)]===_0x4aa8b0[_0x21688c(0xbf)]);if(_0x3d96de&&filesEqual(_0x3af658,filesTextOf(_0x4c396b,_0x3d96de)))return _0x3d96de;}const _0x12548d=new Date(),_0x21ba25=String(_0x12548d[_0x21688c(0xc8)]())[_0x21688c(0xee)](0x2)+String(_0x12548d[_0x21688c(0x101)]()+0x1)['padStart'](0x2,'0')+String(_0x12548d[_0x21688c(0xf9)]())[_0x21688c(0xfc)](0x2,'0')+String(_0x12548d['getHours']())[_0x21688c(0xfc)](0x2,'0')+String(_0x12548d[_0x21688c(0xf8)]())[_0x21688c(0xfc)](0x2,'0'),_0x4a73c8=sha256Hex(Object[_0x21688c(0xdc)](_0x19427c)[_0x21688c(0xe2)]()['join'](','))[_0x21688c(0xee)](0x0,0x8),_0x30fe85={'rev':_0x21ba25+'-local-'+_0x4a73c8,'kind':_0x3dc6ec[_0x21688c(0xd3)],'id':_0x3dc6ec['id'],'at':_0x12548d[_0x21688c(0xe4)](),'parent':_0x4aa8b0[_0x21688c(0xbf)],'by':_0x3dc6ec['by'],'note':_0x3dc6ec[_0x21688c(0xd2)],'files':_0x19427c,'meta':_0x3dc6ec[_0x21688c(0xc5)]};return writeLog(_0x4c396b,_0x3dc6ec[_0x21688c(0xd3)],_0x3dc6ec['id'],_0x30fe85['rev'],[..._0x4aa8b0[_0x21688c(0xcc)],_0x30fe85]),_0x30fe85;},async 'restore'(_0x3eeb6d,_0x303689,_0x5e5983,_0x2c3cbb){const _0x478039=_0x5b87,_0x39198d=await this[_0x478039(0xe9)](_0x5e5983),_0x953b6a={};for(const _0x2f7594 of Object[_0x478039(0xf7)](_0x39198d[_0x478039(0xda)])){_0x953b6a[_0x2f7594]=new TextDecoder()[_0x478039(0xec)](await this[_0x478039(0x100)](_0x5e5983,_0x2f7594));}const _0x45002a=filesToArtifact(_0x953b6a,_0x303689);return await _0x22b6ca[_0x478039(0xc9)]({..._0x45002a,'id':_0x303689,'kind':_0x45002a[_0x478039(0xd3)],'etag':void 0x0}),this[_0x478039(0xf5)]({'kind':_0x3eeb6d,'id':_0x303689,'files':_0x953b6a,'by':_0x2c3cbb,'note':_0x478039(0xeb)+_0x5e5983});}};}function createKtFsStores(_0x65989b){const _0x3bfcc9=_0x5b87,_0xf0bd34=createFsArtifactStore(resolveRoot(_0x65989b[_0x3bfcc9(0xdb)],_0x65989b['cwd']),_0x65989b['seed']),_0x2a53ee=_0x65989b['instancesRoot']?createFsInstanceStore(resolveRoot(_0x65989b[_0x3bfcc9(0xd5)],_0x65989b[_0x3bfcc9(0x105)]),_0x65989b[_0x3bfcc9(0xe0)]):void 0x0,_0x28463e=_0x65989b[_0x3bfcc9(0xd6)]?createFsVersionStore(resolveRoot(_0x65989b[_0x3bfcc9(0xd6)],_0x65989b['cwd']),_0xf0bd34):void 0x0;return{'artifacts':_0xf0bd34,'instances':_0x2a53ee,'versions':_0x28463e};}export{createKtFsStores};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';const _0x536f08=_0x3077;function _0x176c(){const _0x4ed264=['zMLSzq','otaWodrXBgjUCg4','Dgv4Da','yxj0AwzHy3rZ','DMvYC2LVBNm','C3rYAw5NAwz5','CMvTB3zL','revmrvrf','yxj0AwzHy3rjza','r0vu','Aw5ZDgfUy2vZ','mZmWodK5meHMwLDYsq','mJfLtxj5rg0','y3vYCMvUDa','y29TBwL0','mJi3n2jQB2fTva','C3bSAxq','mtGYmti4rwT5s2Lo','mJiZmJeWmNL6s1bvBW','zgvMAw5Ls3rdB25MAwC','BgvUz3rO','C3rHDhvZ','ndCXmZq3zwnnz1LS','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','Aw5KzxHpzG','m3jwzKz0ta','y3jLyxrL','CMvHzezPBgu','A2LUza','Bwv0Ag9K','s3roB3rgB3vUzevYCM9Y','CgfYyw1Z','z2v0','C2vHCMnOugfYyw1Z','BgLZDa','qgSTDgfIBguVCMvWB3j0l3n0B3jL','Bg9N','mJDUt21HyxG','CMvTB3zLioACQUwUNUEoSa','BwvZC2fNzq','C2f2zq','y3jLyxrLioACQUwUNUEoSa','CMvZDg9Yzq','ue9tva','mNrXz0LZrG','nZuWotC1zePLD01R','CgfYC2u','zMLSDgvY','Cgf0Aa','ufvu','y3jLyxrLs3riyw5KBgvY','Cgf0Ag5HBwu','Aw5ZDgfUy2vZioACQUMfJEE9RG','l2fWAs9RDa','ntmWotCZnKLqBhbbra'];_0x176c=function(){return _0x4ed264;};return _0x176c();}(function(_0x4698a0,_0x449fda){const _0x4ee267=_0x3077,_0x5eccd6=_0x4698a0();while(!![]){try{const _0x190468=parseInt(_0x4ee267(0xc9))/0x1*(-parseInt(_0x4ee267(0xdf))/0x2)+parseInt(_0x4ee267(0xcc))/0x3*(parseInt(_0x4ee267(0xe9))/0x4)+parseInt(_0x4ee267(0xe0))/0x5+parseInt(_0x4ee267(0xc5))/0x6*(parseInt(_0x4ee267(0xbf))/0x7)+-parseInt(_0x4ee267(0xc4))/0x8*(parseInt(_0x4ee267(0xd8))/0x9)+parseInt(_0x4ee267(0xbe))/0xa+parseInt(_0x4ee267(0xc2))/0xb*(-parseInt(_0x4ee267(0xeb))/0xc);if(_0x190468===_0x449fda)break;else _0x5eccd6['push'](_0x5eccd6['shift']());}catch(_0x38968a){_0x5eccd6['push'](_0x5eccd6['shift']());}}}(_0x176c,0xcae09));var store=require(_0x536f08(0xd6));async function pathParts(_0x2ddbae,_0x4bed7a){const _0xb36874=_0x536f08,_0x4a89da=_0x2ddbae[_0xb36874(0xd2)]?await _0x2ddbae[_0xb36874(0xd2)]:void 0x0;if(_0x4a89da?.[_0xb36874(0xe3)]?.['length'])return _0x4a89da[_0xb36874(0xe3)];const _0x1c994a=_0x4bed7a[_0xb36874(0xe6)][_0xb36874(0xcb)](_0xb36874(0xe8)),_0x39ba8c=_0x1c994a>=0x0?_0x4bed7a[_0xb36874(0xe6)]['slice'](_0x1c994a+'/api/kt'[_0xb36874(0xc7)]):_0x4bed7a[_0xb36874(0xe6)];return _0x39ba8c[_0xb36874(0xc3)]('/')[_0xb36874(0xe2)](Boolean);}function json(_0x3ee531,_0x581144=0xc8){const _0x2c134b=_0x536f08;return new Response(JSON[_0x2c134b(0xb8)](_0x3ee531),{'status':_0x581144,'headers':{'content-type':'application/json;\x20charset=utf-8'}});}function fail(_0x2f8b40){const _0x4e454f=_0x536f08;if(_0x2f8b40 instanceof store['KtConflictError'])return json({'message':_0x2f8b40[_0x4e454f(0xda)],'current':_0x2f8b40[_0x4e454f(0xc0)]},0x199);if(_0x2f8b40 instanceof store[_0x4e454f(0xd1)])return json({'message':_0x2f8b40[_0x4e454f(0xda)]},0x194);if(_0x2f8b40 instanceof store['KtStoreError'])return json({'message':_0x2f8b40[_0x4e454f(0xda)]},_0x2f8b40[_0x4e454f(0xc8)]??0x1f4);return json({'message':_0x2f8b40 instanceof Error?_0x2f8b40[_0x4e454f(0xda)]:'\u5185\u90E8\u9519\u8BEF'},0x1f4);}async function readBody(_0x3f56f9){const _0x3f16e0=_0x536f08,_0x10441a=await _0x3f56f9[_0x3f16e0(0xec)]();if(!_0x10441a)return null;return JSON[_0x3f16e0(0xe1)](_0x10441a);}function _0x3077(_0x1fc545,_0xdbf79e){_0x1fc545=_0x1fc545-0xb8;const _0x176c55=_0x176c();let _0x307713=_0x176c55[_0x1fc545];if(_0x3077['kXJssn']===undefined){var _0x32d5a3=function(_0x4269a6){const _0x13628d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x57c128='',_0x2ddbae='';for(let _0x4bed7a=0x0,_0x4a89da,_0x1c994a,_0x39ba8c=0x0;_0x1c994a=_0x4269a6['charAt'](_0x39ba8c++);~_0x1c994a&&(_0x4a89da=_0x4bed7a%0x4?_0x4a89da*0x40+_0x1c994a:_0x1c994a,_0x4bed7a++%0x4)?_0x57c128+=String['fromCharCode'](0xff&_0x4a89da>>(-0x2*_0x4bed7a&0x6)):0x0){_0x1c994a=_0x13628d['indexOf'](_0x1c994a);}for(let _0x3ee531=0x0,_0x581144=_0x57c128['length'];_0x3ee531<_0x581144;_0x3ee531++){_0x2ddbae+='%'+('00'+_0x57c128['charCodeAt'](_0x3ee531)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2ddbae);};_0x3077['YFxuTO']=_0x32d5a3,_0x3077['myPZSB']={},_0x3077['kXJssn']=!![];}const _0x129815=_0x176c55[0x0];_0x3077['QtGaOx']!==_0x129815&&(_0x3077['myPZSB']={},_0x3077['QtGaOx']=_0x129815);const _0xd52506=_0x3077['myPZSB'][_0x1fc545];return _0xd52506===undefined?(_0x307713=_0x3077['YFxuTO'](_0x307713),_0x3077['myPZSB'][_0x1fc545]=_0x307713):_0x307713=_0xd52506,_0x307713;}function createKtHandler(_0x100ab0){const _0x4757d5=async(_0x722d1b,_0x36dc12={})=>{const _0x494a59=_0x3077;try{const _0x3ed202=new URL(_0x722d1b['url']),_0x26a422=await pathParts(_0x36dc12,_0x3ed202),[_0x3abcc8,_0x5e80ff,_0x2503ff]=_0x26a422,_0x1cb824=_0x722d1b[_0x494a59(0xd0)]['toUpperCase']();if(_0x3abcc8===_0x494a59(0xed)&&!_0x5e80ff&&_0x1cb824===_0x494a59(0xbc)){const _0x3c8bca=_0x3ed202[_0x494a59(0xd4)][_0x494a59(0xd3)](_0x494a59(0xcf));return json({'items':await _0x100ab0[_0x494a59(0xed)][_0x494a59(0xd5)](_0x3c8bca||void 0x0)});}if(_0x3abcc8===_0x494a59(0xed)&&!_0x5e80ff&&_0x1cb824==='POST'){if(!_0x100ab0[_0x494a59(0xed)][_0x494a59(0xcd)])return json({'message':'create\x20\u672A\u5B9E\u73B0'},0x194);return json(await _0x100ab0[_0x494a59(0xed)][_0x494a59(0xcd)](await readBody(_0x722d1b)));}if(_0x3abcc8===_0x494a59(0xed)&&_0x5e80ff&&_0x1cb824===_0x494a59(0xbc))return json(await _0x100ab0[_0x494a59(0xed)][_0x494a59(0xd3)](_0x5e80ff));if(_0x3abcc8===_0x494a59(0xed)&&_0x5e80ff&&_0x1cb824===_0x494a59(0xe4))return json(await _0x100ab0[_0x494a59(0xed)][_0x494a59(0xdb)](await readBody(_0x722d1b)));if(_0x3abcc8===_0x494a59(0xed)&&_0x5e80ff&&_0x1cb824===_0x494a59(0xba)){if(!_0x100ab0[_0x494a59(0xed)][_0x494a59(0xb9)])return json({'message':_0x494a59(0xd9)},0x194);return await _0x100ab0[_0x494a59(0xed)][_0x494a59(0xb9)](_0x5e80ff),json({'ok':!![]});}if(_0x3abcc8===_0x494a59(0xbd)){if(!_0x100ab0[_0x494a59(0xbd)])return json({'message':_0x494a59(0xe7)},0x194);if(!_0x5e80ff&&_0x1cb824==='GET')return json({'items':await _0x100ab0[_0x494a59(0xbd)][_0x494a59(0xd5)]?.(_0x3ed202[_0x494a59(0xd4)][_0x494a59(0xd3)](_0x494a59(0xbb))??void 0x0)??[]});if(!_0x5e80ff&&_0x1cb824===_0x494a59(0xde)){if(!_0x100ab0[_0x494a59(0xbd)][_0x494a59(0xcd)])return json({'message':_0x494a59(0xdc)},0x194);return json(await _0x100ab0[_0x494a59(0xbd)][_0x494a59(0xcd)](await readBody(_0x722d1b)));}if(_0x5e80ff&&_0x1cb824===_0x494a59(0xbc))return json(await _0x100ab0[_0x494a59(0xbd)][_0x494a59(0xd3)](_0x5e80ff));if(_0x5e80ff&&_0x1cb824===_0x494a59(0xe4))return await _0x100ab0[_0x494a59(0xbd)][_0x494a59(0xdb)](_0x5e80ff,await readBody(_0x722d1b)),json({'ok':!![]});}if(_0x3abcc8===_0x494a59(0xee)){if(!_0x100ab0[_0x494a59(0xee)])return json({'message':'versions\x20\u672A\u914D\u7F6E'},0x194);if(!_0x5e80ff&&_0x1cb824===_0x494a59(0xbc)){const _0x4faa38=_0x3ed202[_0x494a59(0xd4)][_0x494a59(0xd3)](_0x494a59(0xcf))??'',_0x306249=_0x3ed202[_0x494a59(0xd4)][_0x494a59(0xd3)]('id')??'';return json(await _0x100ab0['versions'][_0x494a59(0xd7)](_0x4faa38,_0x306249));}if(!_0x5e80ff&&_0x1cb824===_0x494a59(0xde))return json(await _0x100ab0['versions'][_0x494a59(0xc1)](await readBody(_0x722d1b)));if(_0x5e80ff&&_0x2503ff===_0x494a59(0xea)&&_0x1cb824===_0x494a59(0xbc)){const _0x5f0d86=await _0x100ab0[_0x494a59(0xee)][_0x494a59(0xce)](_0x5e80ff,_0x3ed202[_0x494a59(0xd4)][_0x494a59(0xd3)](_0x494a59(0xe3))??'');return new Response(Buffer['from'](_0x5f0d86),{'headers':{'content-type':_0x494a59(0xca)}});}if(_0x5e80ff&&_0x2503ff===_0x494a59(0xdd)&&_0x1cb824==='POST'){const _0x35c9b7=await readBody(_0x722d1b);return json(await _0x100ab0[_0x494a59(0xee)][_0x494a59(0xdd)](_0x35c9b7[_0x494a59(0xcf)],_0x35c9b7['id'],_0x5e80ff,_0x35c9b7['by']));}if(_0x5e80ff&&!_0x2503ff&&_0x1cb824===_0x494a59(0xbc))return json(await _0x100ab0[_0x494a59(0xee)]['get'](_0x5e80ff));}return json({'message':'\u672A\u627E\u5230'},0x194);}catch(_0x302554){return fail(_0x302554);}};return{'GET':_0x4757d5,'POST':_0x4757d5,'PUT':_0x4757d5,'DELETE':_0x4757d5};}function defineKtConfig(_0x2f6713){return _0x2f6713;}exports[_0x536f08(0xe5)]=createKtHandler,exports[_0x536f08(0xc6)]=defineKtConfig;
1
+ 'use strict';const _0x50e27b=_0x4c95;(function(_0x142d70,_0x5db066){const _0x18db4f=_0x4c95,_0xb76a67=_0x142d70();while(!![]){try{const _0x12fce4=-parseInt(_0x18db4f(0x177))/0x1+-parseInt(_0x18db4f(0x16c))/0x2+-parseInt(_0x18db4f(0x175))/0x3*(-parseInt(_0x18db4f(0x173))/0x4)+-parseInt(_0x18db4f(0x165))/0x5+-parseInt(_0x18db4f(0x178))/0x6*(-parseInt(_0x18db4f(0x16b))/0x7)+parseInt(_0x18db4f(0x168))/0x8+-parseInt(_0x18db4f(0x160))/0x9;if(_0x12fce4===_0x5db066)break;else _0xb76a67['push'](_0xb76a67['shift']());}catch(_0x15835d){_0xb76a67['push'](_0xb76a67['shift']());}}}(_0x4437,0xa9640));function _0x4c95(_0x43a8b8,_0x447387){_0x43a8b8=_0x43a8b8-0x15a;const _0x44377e=_0x4437();let _0x4c95db=_0x44377e[_0x43a8b8];if(_0x4c95['npuUIH']===undefined){var _0x493ce3=function(_0x42a333){const _0x1fe1b9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xf55dc9='',_0x27776e='';for(let _0x33d707=0x0,_0x144bd,_0x241b45,_0x3a6fa6=0x0;_0x241b45=_0x42a333['charAt'](_0x3a6fa6++);~_0x241b45&&(_0x144bd=_0x33d707%0x4?_0x144bd*0x40+_0x241b45:_0x241b45,_0x33d707++%0x4)?_0xf55dc9+=String['fromCharCode'](0xff&_0x144bd>>(-0x2*_0x33d707&0x6)):0x0){_0x241b45=_0x1fe1b9['indexOf'](_0x241b45);}for(let _0x80256e=0x0,_0x565cc2=_0xf55dc9['length'];_0x80256e<_0x565cc2;_0x80256e++){_0x27776e+='%'+('00'+_0xf55dc9['charCodeAt'](_0x80256e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x27776e);};_0x4c95['jQLUGY']=_0x493ce3,_0x4c95['pgrNZN']={},_0x4c95['npuUIH']=!![];}const _0x1cbe99=_0x44377e[0x0];_0x4c95['AsUChw']!==_0x1cbe99&&(_0x4c95['pgrNZN']={},_0x4c95['AsUChw']=_0x1cbe99);const _0x18e252=_0x4c95['pgrNZN'][_0x43a8b8];return _0x18e252===undefined?(_0x4c95db=_0x4c95['jQLUGY'](_0x4c95db),_0x4c95['pgrNZN'][_0x43a8b8]=_0x4c95db):_0x4c95db=_0x18e252,_0x4c95db;}var store=require(_0x50e27b(0x176));async function pathParts(_0x27776e,_0x33d707){const _0x175a03=_0x50e27b,_0x144bd=_0x27776e[_0x175a03(0x17a)]?await _0x27776e[_0x175a03(0x17a)]:void 0x0;if(_0x144bd?.[_0x175a03(0x17b)]?.[_0x175a03(0x180)])return _0x144bd['path'];const _0x241b45=_0x33d707['pathname'][_0x175a03(0x15c)]('/api/kt'),_0x3a6fa6=_0x241b45>=0x0?_0x33d707[_0x175a03(0x17f)][_0x175a03(0x15d)](_0x241b45+'/api/kt'[_0x175a03(0x180)]):_0x33d707[_0x175a03(0x17f)];return _0x3a6fa6[_0x175a03(0x179)]('/')[_0x175a03(0x18d)](Boolean);}function json(_0x80256e,_0x565cc2=0xc8){const _0x2da060=_0x50e27b;return new Response(JSON[_0x2da060(0x18e)](_0x80256e),{'status':_0x565cc2,'headers':{'content-type':_0x2da060(0x16d)}});}function fail(_0x162240){const _0x247ab9=_0x50e27b;if(_0x162240 instanceof store['KtConflictError'])return json({'message':_0x162240['message'],'current':_0x162240[_0x247ab9(0x186)]},0x199);if(_0x162240 instanceof store[_0x247ab9(0x162)])return json({'message':_0x162240['message']},0x194);if(_0x162240 instanceof store[_0x247ab9(0x171)])return json({'message':_0x162240[_0x247ab9(0x163)]},_0x162240[_0x247ab9(0x181)]??0x1f4);return json({'message':_0x162240 instanceof Error?_0x162240[_0x247ab9(0x163)]:_0x247ab9(0x190)},0x1f4);}async function readBody(_0x520e2f){const _0x4eab04=_0x50e27b,_0x182f69=await _0x520e2f[_0x4eab04(0x167)]();if(!_0x182f69)return null;return JSON[_0x4eab04(0x185)](_0x182f69);}function createKtHandler(_0x120fe5){const _0x32670a=async(_0x23141d,_0x3736ce={})=>{const _0x21d778=_0x4c95;try{const _0x142747=new URL(_0x23141d[_0x21d778(0x187)]),_0x21be4e=await pathParts(_0x3736ce,_0x142747),[_0x1db8a7,_0x45a49d,_0x39f71a]=_0x21be4e,_0x3ba893=_0x23141d[_0x21d778(0x16a)][_0x21d778(0x184)]();if(_0x1db8a7===_0x21d778(0x17e)&&!_0x45a49d&&_0x3ba893===_0x21d778(0x18c)){const _0x25e277=_0x142747[_0x21d778(0x18b)][_0x21d778(0x189)](_0x21d778(0x18a));return json({'items':await _0x120fe5[_0x21d778(0x17e)]['list'](_0x25e277||void 0x0)});}if(_0x1db8a7==='artifacts'&&!_0x45a49d&&_0x3ba893===_0x21d778(0x17d)){if(!_0x120fe5['artifacts'][_0x21d778(0x164)])return json({'message':_0x21d778(0x182)},0x194);return json(await _0x120fe5[_0x21d778(0x17e)][_0x21d778(0x164)](await readBody(_0x23141d)));}if(_0x1db8a7===_0x21d778(0x17e)&&_0x45a49d&&_0x3ba893===_0x21d778(0x18c))return json(await _0x120fe5[_0x21d778(0x17e)][_0x21d778(0x189)](_0x45a49d));if(_0x1db8a7==='artifacts'&&_0x45a49d&&_0x3ba893===_0x21d778(0x17c))return json(await _0x120fe5[_0x21d778(0x17e)][_0x21d778(0x183)](await readBody(_0x23141d)));if(_0x1db8a7===_0x21d778(0x17e)&&_0x45a49d&&_0x3ba893===_0x21d778(0x169)){if(!_0x120fe5['artifacts'][_0x21d778(0x191)])return json({'message':'remove\x20\u672A\u5B9E\u73B0'},0x194);return await _0x120fe5[_0x21d778(0x17e)][_0x21d778(0x191)](_0x45a49d),json({'ok':!![]});}if(_0x1db8a7==='instances'){if(!_0x120fe5['instances'])return json({'message':_0x21d778(0x15b)},0x194);if(!_0x45a49d&&_0x3ba893===_0x21d778(0x18c))return json({'items':await _0x120fe5[_0x21d778(0x174)][_0x21d778(0x16f)]?.(_0x142747[_0x21d778(0x18b)][_0x21d778(0x189)](_0x21d778(0x188))??void 0x0)??[]});if(!_0x45a49d&&_0x3ba893==='POST'){if(!_0x120fe5[_0x21d778(0x174)][_0x21d778(0x164)])return json({'message':'create\x20\u672A\u5B9E\u73B0'},0x194);return json(await _0x120fe5['instances'][_0x21d778(0x164)](await readBody(_0x23141d)));}if(_0x45a49d&&_0x3ba893==='GET')return json(await _0x120fe5[_0x21d778(0x174)][_0x21d778(0x189)](_0x45a49d));if(_0x45a49d&&_0x3ba893==='PUT')return await _0x120fe5[_0x21d778(0x174)][_0x21d778(0x183)](_0x45a49d,await readBody(_0x23141d)),json({'ok':!![]});}if(_0x1db8a7===_0x21d778(0x15f)){if(!_0x120fe5[_0x21d778(0x15f)])return json({'message':_0x21d778(0x16e)},0x194);if(!_0x45a49d&&_0x3ba893===_0x21d778(0x18c)){const _0x2f0dc6=_0x142747[_0x21d778(0x18b)][_0x21d778(0x189)](_0x21d778(0x18a))??'',_0x32044f=_0x142747[_0x21d778(0x18b)][_0x21d778(0x189)]('id')??'';return json(await _0x120fe5['versions'][_0x21d778(0x18f)](_0x2f0dc6,_0x32044f));}if(!_0x45a49d&&_0x3ba893==='POST')return json(await _0x120fe5['versions'][_0x21d778(0x161)](await readBody(_0x23141d)));if(_0x45a49d&&_0x39f71a===_0x21d778(0x15e)&&_0x3ba893===_0x21d778(0x18c)){const _0x462183=await _0x120fe5[_0x21d778(0x15f)][_0x21d778(0x15a)](_0x45a49d,_0x142747['searchParams'][_0x21d778(0x189)]('path')??'');return new Response(Buffer['from'](_0x462183),{'headers':{'content-type':_0x21d778(0x166)}});}if(_0x45a49d&&_0x39f71a===_0x21d778(0x172)&&_0x3ba893==='POST'){const _0x15929d=await readBody(_0x23141d);return json(await _0x120fe5[_0x21d778(0x15f)][_0x21d778(0x172)](_0x15929d[_0x21d778(0x18a)],_0x15929d['id'],_0x45a49d,_0x15929d['by']));}if(_0x45a49d&&!_0x39f71a&&_0x3ba893===_0x21d778(0x18c))return json(await _0x120fe5['versions'][_0x21d778(0x189)](_0x45a49d));}return json({'message':'\u672A\u627E\u5230'},0x194);}catch(_0x178d14){return fail(_0x178d14);}};return{'GET':_0x32670a,'POST':_0x32670a,'PUT':_0x32670a,'DELETE':_0x32670a};}function defineKtConfig(_0x5cc2aa){return _0x5cc2aa;}function _0x4437(){const _0x51de4b=['DxjS','yxj0AwzHy3rjza','z2v0','A2LUza','C2vHCMnOugfYyw1Z','r0vu','zMLSDgvY','C3rYAw5NAwz5','Bg9N','5yAf6yoO6zsz6k+V','CMvTB3zL','CMvHzezPBgu','Aw5ZDgfUy2vZioACQUMfJEE9RG','Aw5KzxHpzG','C2XPy2u','zMLSzq','DMvYC2LVBNm','ntuZnJaXn3rcv2riEa','y29TBwL0','s3roB3rgB3vUzevYCM9Y','BwvZC2fNzq','y3jLyxrL','mtq3otu4nvLxAKDfqq','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','Dgv4Da','odC4nti4offUAeTmua','revmrvrf','Bwv0Ag9K','nZG5oda3oxH5uePhyq','ntm0mJCYBKD4zxzJ','yxbWBgLJyxrPB24VANnVBJSGy2HHCNnLDd11DgyToa','DMvYC2LVBNmG5PYQ6ywn572U','BgLZDa','y3jLyxrLs3riyw5KBgvY','s3rtDg9YzuvYCM9Y','CMvZDg9Yzq','mZjHD21Lzwq','Aw5ZDgfUy2vZ','mtuWmZqYqNHczfvV','qgSTDgfIBguVCMvWB3j0l3n0B3jL','nZu1mZGWCNnIBLnc','nMj0uhPdvW','C3bSAxq','CgfYyw1Z','Cgf0Aa','ufvu','ue9tva','yxj0AwzHy3rZ','Cgf0Ag5HBwu','BgvUz3rO','C3rHDhvZ','y3jLyxrLioACQUwUNUEoSa','C2f2zq','Dg9vChbLCKnHC2u','CgfYC2u','y3vYCMvUDa'];_0x4437=function(){return _0x51de4b;};return _0x4437();}exports[_0x50e27b(0x170)]=createKtHandler,exports['defineKtConfig']=defineKtConfig;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function _0x10c7(_0x4cfe01,_0x2a56b5){_0x4cfe01=_0x4cfe01-0x149;const _0x50e3c0=_0x50e3();let _0x10c738=_0x50e3c0[_0x4cfe01];if(_0x10c7['BMZyUu']===undefined){var _0x203a3f=function(_0x3f89fa){const _0x564c6e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4d3618='',_0x53e6ee='';for(let _0x186ce1=0x0,_0x1210e0,_0x3da20e,_0x5644f7=0x0;_0x3da20e=_0x3f89fa['charAt'](_0x5644f7++);~_0x3da20e&&(_0x1210e0=_0x186ce1%0x4?_0x1210e0*0x40+_0x3da20e:_0x3da20e,_0x186ce1++%0x4)?_0x4d3618+=String['fromCharCode'](0xff&_0x1210e0>>(-0x2*_0x186ce1&0x6)):0x0){_0x3da20e=_0x564c6e['indexOf'](_0x3da20e);}for(let _0x5d279b=0x0,_0x49da00=_0x4d3618['length'];_0x5d279b<_0x49da00;_0x5d279b++){_0x53e6ee+='%'+('00'+_0x4d3618['charCodeAt'](_0x5d279b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x53e6ee);};_0x10c7['emXJCG']=_0x203a3f,_0x10c7['otSSlj']={},_0x10c7['BMZyUu']=!![];}const _0xca764b=_0x50e3c0[0x0];_0x10c7['jIFHzI']!==_0xca764b&&(_0x10c7['otSSlj']={},_0x10c7['jIFHzI']=_0xca764b);const _0x165d5f=_0x10c7['otSSlj'][_0x4cfe01];return _0x165d5f===undefined?(_0x10c738=_0x10c7['emXJCG'](_0x10c738),_0x10c7['otSSlj'][_0x4cfe01]=_0x10c738):_0x10c738=_0x165d5f,_0x10c738;}(function(_0x49464e,_0x5510f8){const _0x3bb048=_0x10c7,_0xcc15db=_0x49464e();while(!![]){try{const _0x32f515=parseInt(_0x3bb048(0x14e))/0x1*(-parseInt(_0x3bb048(0x177))/0x2)+-parseInt(_0x3bb048(0x157))/0x3+parseInt(_0x3bb048(0x14b))/0x4*(parseInt(_0x3bb048(0x159))/0x5)+-parseInt(_0x3bb048(0x174))/0x6+parseInt(_0x3bb048(0x16b))/0x7*(-parseInt(_0x3bb048(0x165))/0x8)+-parseInt(_0x3bb048(0x150))/0x9+parseInt(_0x3bb048(0x167))/0xa;if(_0x32f515===_0x5510f8)break;else _0xcc15db['push'](_0xcc15db['shift']());}catch(_0x236e03){_0xcc15db['push'](_0xcc15db['shift']());}}}(_0x50e3,0x79c85));import{KtConflictError,KtNotFoundError,KtStoreError}from'@k-table/report/store';async function pathParts(_0x53e6ee,_0x186ce1){const _0x3e4ec6=_0x10c7,_0x1210e0=_0x53e6ee[_0x3e4ec6(0x163)]?await _0x53e6ee[_0x3e4ec6(0x163)]:void 0x0;if(_0x1210e0?.[_0x3e4ec6(0x152)]?.['length'])return _0x1210e0[_0x3e4ec6(0x152)];const _0x3da20e=_0x186ce1['pathname'][_0x3e4ec6(0x168)](_0x3e4ec6(0x173)),_0x5644f7=_0x3da20e>=0x0?_0x186ce1['pathname']['slice'](_0x3da20e+_0x3e4ec6(0x173)[_0x3e4ec6(0x161)]):_0x186ce1['pathname'];return _0x5644f7['split']('/')[_0x3e4ec6(0x170)](Boolean);}function json(_0x5d279b,_0x49da00=0xc8){const _0x306433=_0x10c7;return new Response(JSON[_0x306433(0x156)](_0x5d279b),{'status':_0x49da00,'headers':{'content-type':_0x306433(0x169)}});}function fail(_0x428769){const _0x3dcc25=_0x10c7;if(_0x428769 instanceof KtConflictError)return json({'message':_0x428769[_0x3dcc25(0x15a)],'current':_0x428769['current']},0x199);if(_0x428769 instanceof KtNotFoundError)return json({'message':_0x428769[_0x3dcc25(0x15a)]},0x194);if(_0x428769 instanceof KtStoreError)return json({'message':_0x428769['message']},_0x428769[_0x3dcc25(0x14f)]??0x1f4);return json({'message':_0x428769 instanceof Error?_0x428769[_0x3dcc25(0x15a)]:_0x3dcc25(0x14c)},0x1f4);}async function readBody(_0x10fed9){const _0x520470=_0x10c7,_0x5b3f54=await _0x10fed9[_0x520470(0x16c)]();if(!_0x5b3f54)return null;return JSON[_0x520470(0x176)](_0x5b3f54);}function createKtHandler(_0xeb063f){const _0x5204d3=async(_0x230561,_0x347272={})=>{const _0xd1ce44=_0x10c7;try{const _0x5e7c8b=new URL(_0x230561['url']),_0x410841=await pathParts(_0x347272,_0x5e7c8b),[_0x50ab72,_0x3690bb,_0x4aac47]=_0x410841,_0x13305e=_0x230561[_0xd1ce44(0x15e)][_0xd1ce44(0x175)]();if(_0x50ab72===_0xd1ce44(0x171)&&!_0x3690bb&&_0x13305e==='GET'){const _0x37e3fe=_0x5e7c8b[_0xd1ce44(0x154)]['get']('kind');return json({'items':await _0xeb063f['artifacts'][_0xd1ce44(0x153)](_0x37e3fe||void 0x0)});}if(_0x50ab72===_0xd1ce44(0x171)&&!_0x3690bb&&_0x13305e===_0xd1ce44(0x160)){if(!_0xeb063f[_0xd1ce44(0x171)][_0xd1ce44(0x162)])return json({'message':'create\x20\u672A\u5B9E\u73B0'},0x194);return json(await _0xeb063f[_0xd1ce44(0x171)][_0xd1ce44(0x162)](await readBody(_0x230561)));}if(_0x50ab72==='artifacts'&&_0x3690bb&&_0x13305e==='GET')return json(await _0xeb063f[_0xd1ce44(0x171)]['get'](_0x3690bb));if(_0x50ab72===_0xd1ce44(0x171)&&_0x3690bb&&_0x13305e===_0xd1ce44(0x16d))return json(await _0xeb063f[_0xd1ce44(0x171)][_0xd1ce44(0x14d)](await readBody(_0x230561)));if(_0x50ab72===_0xd1ce44(0x171)&&_0x3690bb&&_0x13305e===_0xd1ce44(0x16e)){if(!_0xeb063f[_0xd1ce44(0x171)]['remove'])return json({'message':_0xd1ce44(0x15c)},0x194);return await _0xeb063f[_0xd1ce44(0x171)]['remove'](_0x3690bb),json({'ok':!![]});}if(_0x50ab72==='instances'){if(!_0xeb063f[_0xd1ce44(0x15d)])return json({'message':_0xd1ce44(0x16f)},0x194);if(!_0x3690bb&&_0x13305e===_0xd1ce44(0x164))return json({'items':await _0xeb063f[_0xd1ce44(0x15d)][_0xd1ce44(0x153)]?.(_0x5e7c8b[_0xd1ce44(0x154)][_0xd1ce44(0x151)](_0xd1ce44(0x155))??void 0x0)??[]});if(!_0x3690bb&&_0x13305e==='POST'){if(!_0xeb063f[_0xd1ce44(0x15d)][_0xd1ce44(0x162)])return json({'message':_0xd1ce44(0x15f)},0x194);return json(await _0xeb063f['instances']['create'](await readBody(_0x230561)));}if(_0x3690bb&&_0x13305e===_0xd1ce44(0x164))return json(await _0xeb063f[_0xd1ce44(0x15d)][_0xd1ce44(0x151)](_0x3690bb));if(_0x3690bb&&_0x13305e==='PUT')return await _0xeb063f[_0xd1ce44(0x15d)][_0xd1ce44(0x14d)](_0x3690bb,await readBody(_0x230561)),json({'ok':!![]});}if(_0x50ab72===_0xd1ce44(0x172)){if(!_0xeb063f[_0xd1ce44(0x172)])return json({'message':_0xd1ce44(0x158)},0x194);if(!_0x3690bb&&_0x13305e===_0xd1ce44(0x164)){const _0x30e638=_0x5e7c8b[_0xd1ce44(0x154)][_0xd1ce44(0x151)]('kind')??'',_0x4a127e=_0x5e7c8b[_0xd1ce44(0x154)][_0xd1ce44(0x151)]('id')??'';return json(await _0xeb063f[_0xd1ce44(0x172)]['log'](_0x30e638,_0x4a127e));}if(!_0x3690bb&&_0x13305e==='POST')return json(await _0xeb063f[_0xd1ce44(0x172)][_0xd1ce44(0x149)](await readBody(_0x230561)));if(_0x3690bb&&_0x4aac47===_0xd1ce44(0x14a)&&_0x13305e===_0xd1ce44(0x164)){const _0x35901b=await _0xeb063f['versions']['readFile'](_0x3690bb,_0x5e7c8b[_0xd1ce44(0x154)]['get'](_0xd1ce44(0x152))??'');return new Response(Buffer['from'](_0x35901b),{'headers':{'content-type':_0xd1ce44(0x15b)}});}if(_0x3690bb&&_0x4aac47==='restore'&&_0x13305e===_0xd1ce44(0x160)){const _0x4353ef=await readBody(_0x230561);return json(await _0xeb063f[_0xd1ce44(0x172)]['restore'](_0x4353ef[_0xd1ce44(0x16a)],_0x4353ef['id'],_0x3690bb,_0x4353ef['by']));}if(_0x3690bb&&!_0x4aac47&&_0x13305e===_0xd1ce44(0x164))return json(await _0xeb063f[_0xd1ce44(0x172)][_0xd1ce44(0x151)](_0x3690bb));}return json({'message':_0xd1ce44(0x166)},0x194);}catch(_0x3489e4){return fail(_0x3489e4);}};return{'GET':_0x5204d3,'POST':_0x5204d3,'PUT':_0x5204d3,'DELETE':_0x5204d3};}function defineKtConfig(_0x1a476b){return _0x1a476b;}function _0x50e3(){const _0x33aff0=['BgvUz3rO','y3jLyxrL','CgfYyw1Z','r0vu','mtm4nZG0CLfyAg9V','5PYQ5OM+5yIW','mti2nZCZmZb2yvLHELi','Aw5KzxHpzG','yxbWBgLJyxrPB24VANnVBJSGy2HHCNnLDd11DgyToa','A2LUza','mJeWv2HurfrJ','Dgv4Da','ufvu','revmrvrf','Aw5ZDgfUy2vZioACQUMfJEE9RG','zMLSDgvY','yxj0AwzHy3rZ','DMvYC2LVBNm','l2fWAs9RDa','mta5nZG3nhzrAwDOEG','Dg9vChbLCKnHC2u','CgfYC2u','ndK3nZHIrhz5sLy','y29TBwL0','zMLSzq','mJmXnta5nMH5ufPiCa','5yAf6yoO6zsz6k+V','C2f2zq','nMXxv09nra','C3rHDhvZ','mtG3nZGWnunoru1NtG','z2v0','Cgf0Aa','BgLZDa','C2vHCMnOugfYyw1Z','yxj0AwzHy3rjza','C3rYAw5NAwz5','odu4ody0BKL2t0fp','DMvYC2LVBNmG5PYQ6ywn572U','nxr1rfnQvW','BwvZC2fNzq','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','CMvTB3zLioACQUwUNUEoSa','Aw5ZDgfUy2vZ','Bwv0Ag9K','y3jLyxrLioACQUwUNUEoSa','ue9tva'];_0x50e3=function(){return _0x33aff0;};return _0x50e3();}export{createKtHandler,defineKtConfig};
1
+ (function(_0x5a6824,_0x255400){const _0x40b063=_0x1e07,_0x4d824f=_0x5a6824();while(!![]){try{const _0x695da=parseInt(_0x40b063(0x9d))/0x1+parseInt(_0x40b063(0xa1))/0x2*(-parseInt(_0x40b063(0xaa))/0x3)+parseInt(_0x40b063(0x7d))/0x4*(-parseInt(_0x40b063(0xa8))/0x5)+-parseInt(_0x40b063(0x97))/0x6+-parseInt(_0x40b063(0xa7))/0x7*(parseInt(_0x40b063(0xa2))/0x8)+parseInt(_0x40b063(0x7b))/0x9+parseInt(_0x40b063(0x8b))/0xa;if(_0x695da===_0x255400)break;else _0x4d824f['push'](_0x4d824f['shift']());}catch(_0x3365ba){_0x4d824f['push'](_0x4d824f['shift']());}}}(_0x2b9e,0x7dbf7));import{KtConflictError,KtNotFoundError,KtStoreError}from'@k-table/report/store';async function pathParts(_0x46e498,_0x16e377){const _0x36a556=_0x1e07,_0x3dd963=_0x46e498[_0x36a556(0xa3)]?await _0x46e498[_0x36a556(0xa3)]:void 0x0;if(_0x3dd963?.['path']?.[_0x36a556(0x9e)])return _0x3dd963[_0x36a556(0x85)];const _0x5f1e29=_0x16e377['pathname'][_0x36a556(0x92)](_0x36a556(0x81)),_0x1549df=_0x5f1e29>=0x0?_0x16e377[_0x36a556(0x9b)][_0x36a556(0x8c)](_0x5f1e29+_0x36a556(0x81)['length']):_0x16e377[_0x36a556(0x9b)];return _0x1549df[_0x36a556(0x93)]('/')['filter'](Boolean);}function json(_0x4cf4e1,_0xf2da3f=0xc8){const _0x136484=_0x1e07;return new Response(JSON[_0x136484(0x91)](_0x4cf4e1),{'status':_0xf2da3f,'headers':{'content-type':_0x136484(0x86)}});}function fail(_0x4cbfd8){const _0x201a4f=_0x1e07;if(_0x4cbfd8 instanceof KtConflictError)return json({'message':_0x4cbfd8[_0x201a4f(0x98)],'current':_0x4cbfd8['current']},0x199);if(_0x4cbfd8 instanceof KtNotFoundError)return json({'message':_0x4cbfd8[_0x201a4f(0x98)]},0x194);if(_0x4cbfd8 instanceof KtStoreError)return json({'message':_0x4cbfd8[_0x201a4f(0x98)]},_0x4cbfd8[_0x201a4f(0x8a)]??0x1f4);return json({'message':_0x4cbfd8 instanceof Error?_0x4cbfd8['message']:_0x201a4f(0x80)},0x1f4);}function _0x1e07(_0xaa7e2f,_0x4d2cb3){_0xaa7e2f=_0xaa7e2f-0x7a;const _0x2b9ed9=_0x2b9e();let _0x1e0793=_0x2b9ed9[_0xaa7e2f];if(_0x1e07['XmlqOV']===undefined){var _0x2fc40a=function(_0x1eeb66){const _0x1a0f18='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x48d6b3='',_0x46e498='';for(let _0x16e377=0x0,_0x3dd963,_0x5f1e29,_0x1549df=0x0;_0x5f1e29=_0x1eeb66['charAt'](_0x1549df++);~_0x5f1e29&&(_0x3dd963=_0x16e377%0x4?_0x3dd963*0x40+_0x5f1e29:_0x5f1e29,_0x16e377++%0x4)?_0x48d6b3+=String['fromCharCode'](0xff&_0x3dd963>>(-0x2*_0x16e377&0x6)):0x0){_0x5f1e29=_0x1a0f18['indexOf'](_0x5f1e29);}for(let _0x4cf4e1=0x0,_0xf2da3f=_0x48d6b3['length'];_0x4cf4e1<_0xf2da3f;_0x4cf4e1++){_0x46e498+='%'+('00'+_0x48d6b3['charCodeAt'](_0x4cf4e1)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x46e498);};_0x1e07['gxlmpT']=_0x2fc40a,_0x1e07['hbmSuk']={},_0x1e07['XmlqOV']=!![];}const _0x2abba3=_0x2b9ed9[0x0];_0x1e07['fXenTG']!==_0x2abba3&&(_0x1e07['hbmSuk']={},_0x1e07['fXenTG']=_0x2abba3);const _0x1f4da1=_0x1e07['hbmSuk'][_0xaa7e2f];return _0x1f4da1===undefined?(_0x1e0793=_0x1e07['gxlmpT'](_0x1e0793),_0x1e07['hbmSuk'][_0xaa7e2f]=_0x1e0793):_0x1e0793=_0x1f4da1,_0x1e0793;}async function readBody(_0x1f6c81){const _0x3e611d=_0x1e07,_0x4e984=await _0x1f6c81[_0x3e611d(0xa6)]();if(!_0x4e984)return null;return JSON[_0x3e611d(0xa5)](_0x4e984);}function createKtHandler(_0x4eeab8){const _0x2e1b2c=async(_0x36fcc2,_0x128b2f={})=>{const _0x1ab029=_0x1e07;try{const _0x4a5dda=new URL(_0x36fcc2[_0x1ab029(0x99)]),_0x2107d8=await pathParts(_0x128b2f,_0x4a5dda),[_0x2dabff,_0xdb7aaf,_0x597b8f]=_0x2107d8,_0x407f43=_0x36fcc2['method']['toUpperCase']();if(_0x2dabff===_0x1ab029(0x82)&&!_0xdb7aaf&&_0x407f43===_0x1ab029(0x87)){const _0x122d28=_0x4a5dda['searchParams'][_0x1ab029(0x7c)](_0x1ab029(0x8f));return json({'items':await _0x4eeab8[_0x1ab029(0x82)]['list'](_0x122d28||void 0x0)});}if(_0x2dabff===_0x1ab029(0x82)&&!_0xdb7aaf&&_0x407f43===_0x1ab029(0xa4)){if(!_0x4eeab8[_0x1ab029(0x82)][_0x1ab029(0x9c)])return json({'message':_0x1ab029(0x8d)},0x194);return json(await _0x4eeab8[_0x1ab029(0x82)]['create'](await readBody(_0x36fcc2)));}if(_0x2dabff===_0x1ab029(0x82)&&_0xdb7aaf&&_0x407f43===_0x1ab029(0x87))return json(await _0x4eeab8[_0x1ab029(0x82)][_0x1ab029(0x7c)](_0xdb7aaf));if(_0x2dabff===_0x1ab029(0x82)&&_0xdb7aaf&&_0x407f43==='PUT')return json(await _0x4eeab8[_0x1ab029(0x82)][_0x1ab029(0x95)](await readBody(_0x36fcc2)));if(_0x2dabff===_0x1ab029(0x82)&&_0xdb7aaf&&_0x407f43===_0x1ab029(0x7f)){if(!_0x4eeab8[_0x1ab029(0x82)][_0x1ab029(0x84)])return json({'message':_0x1ab029(0x94)},0x194);return await _0x4eeab8[_0x1ab029(0x82)][_0x1ab029(0x84)](_0xdb7aaf),json({'ok':!![]});}if(_0x2dabff==='instances'){if(!_0x4eeab8[_0x1ab029(0x8e)])return json({'message':_0x1ab029(0x7e)},0x194);if(!_0xdb7aaf&&_0x407f43===_0x1ab029(0x87))return json({'items':await _0x4eeab8[_0x1ab029(0x8e)]['list']?.(_0x4a5dda[_0x1ab029(0xa0)][_0x1ab029(0x7c)]('artifactId')??void 0x0)??[]});if(!_0xdb7aaf&&_0x407f43===_0x1ab029(0xa4)){if(!_0x4eeab8[_0x1ab029(0x8e)]['create'])return json({'message':_0x1ab029(0x8d)},0x194);return json(await _0x4eeab8[_0x1ab029(0x8e)][_0x1ab029(0x9c)](await readBody(_0x36fcc2)));}if(_0xdb7aaf&&_0x407f43===_0x1ab029(0x87))return json(await _0x4eeab8[_0x1ab029(0x8e)]['get'](_0xdb7aaf));if(_0xdb7aaf&&_0x407f43===_0x1ab029(0x90))return await _0x4eeab8[_0x1ab029(0x8e)]['save'](_0xdb7aaf,await readBody(_0x36fcc2)),json({'ok':!![]});}if(_0x2dabff==='versions'){if(!_0x4eeab8[_0x1ab029(0x83)])return json({'message':_0x1ab029(0x9f)},0x194);if(!_0xdb7aaf&&_0x407f43===_0x1ab029(0x87)){const _0x488e54=_0x4a5dda[_0x1ab029(0xa0)]['get']('kind')??'',_0x5efa63=_0x4a5dda[_0x1ab029(0xa0)][_0x1ab029(0x7c)]('id')??'';return json(await _0x4eeab8[_0x1ab029(0x83)]['log'](_0x488e54,_0x5efa63));}if(!_0xdb7aaf&&_0x407f43==='POST')return json(await _0x4eeab8[_0x1ab029(0x83)][_0x1ab029(0x96)](await readBody(_0x36fcc2)));if(_0xdb7aaf&&_0x597b8f==='file'&&_0x407f43===_0x1ab029(0x87)){const _0x539b3d=await _0x4eeab8[_0x1ab029(0x83)][_0x1ab029(0x89)](_0xdb7aaf,_0x4a5dda[_0x1ab029(0xa0)][_0x1ab029(0x7c)](_0x1ab029(0x85))??'');return new Response(Buffer[_0x1ab029(0x88)](_0x539b3d),{'headers':{'content-type':_0x1ab029(0x9a)}});}if(_0xdb7aaf&&_0x597b8f===_0x1ab029(0x7a)&&_0x407f43==='POST'){const _0x4e67d7=await readBody(_0x36fcc2);return json(await _0x4eeab8['versions']['restore'](_0x4e67d7[_0x1ab029(0x8f)],_0x4e67d7['id'],_0xdb7aaf,_0x4e67d7['by']));}if(_0xdb7aaf&&!_0x597b8f&&_0x407f43===_0x1ab029(0x87))return json(await _0x4eeab8['versions'][_0x1ab029(0x7c)](_0xdb7aaf));}return json({'message':_0x1ab029(0xa9)},0x194);}catch(_0x4adedc){return fail(_0x4adedc);}};return{'GET':_0x2e1b2c,'POST':_0x2e1b2c,'PUT':_0x2e1b2c,'DELETE':_0x2e1b2c};}function _0x2b9e(){const _0x34e558=['DMvYC2LVBNm','CMvTB3zL','Cgf0Aa','yxbWBgLJyxrPB24VANnVBJSGy2HHCNnLDd11DgyToa','r0vu','zNjVBq','CMvHzezPBgu','C3rHDhvZ','nZuYmte2mejMCe9ozG','C2XPy2u','y3jLyxrLioACQUwUNUEoSa','Aw5ZDgfUy2vZ','A2LUza','ufvu','C3rYAw5NAwz5','Aw5KzxHpzG','C3bSAxq','CMvTB3zLioACQUwUNUEoSa','C2f2zq','y29TBwL0','mJiXotK1oePrAwTWBa','BwvZC2fNzq','DxjS','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','Cgf0Ag5HBwu','y3jLyxrL','ndy5odi3CeztrgHU','BgvUz3rO','DMvYC2LVBNmG5PYQ6ywn572U','C2vHCMnOugfYyw1Z','mte2mJe2y2j6rLnu','ndq5nZz2vKvHCMu','CgfYyw1Z','ue9tva','CgfYC2u','Dgv4Da','mJe3BeXJtxLW','ndaWq1nAEe1u','5PYQ5OM+5yIW','mtjcz0veCLG','CMvZDg9Yzq','nZC5nJC2m2PXzMjuCq','z2v0','mZK4mJr6AKfsrwK','Aw5ZDgfUy2vZioACQUMfJEE9RG','revmrvrf','5yAf6yoO6zsz6k+V','l2fWAs9RDa','yxj0AwzHy3rZ'];_0x2b9e=function(){return _0x34e558;};return _0x2b9e();}function defineKtConfig(_0xbb453c){return _0xbb453c;}export{createKtHandler,defineKtConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-table/next",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
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.33"
30
+ "@k-table/report": "^1.0.35"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "next": ">=15"