@k-table/next 1.0.26 → 1.0.28
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 +1 -1
- package/dist/fs.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/fs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x56a09c=_0x2aae;function _0x34a1(){const _0x453038=['CgfKu3rHCNq','CMv2','BM90zq','C2vLzeLUC3rHBMnLCW','A2v5CW','sevbra','z2v0','CMvHzezPBgu','Aw5ZDgfUy2uG','Aw5ZDc0','DMvYC2LVBNnsB290','BM93','zgLNzxn0','mtaWntC2oe1VsKfzEq','DMfSDwvZ','zNjVBq','AxrLBxm','lMv0ywC','AxneAxjLy3rVCNK','ChvZAa','zgLYBMfTzq','mZC0oduWog9eAezoAW','CMvZB2X2zq','s3rdB25MBgLJDevYCM9Y','Cgf0Aa','mtaWotG2sLzpAxDH','zw50CMLLCW','C3rYAw5N','C2XPy2u','DhjPBq','CMvHzezPBgvtEw5J','zMLSzxnfCxvHBa','y29TBw9U','CMv2ia','CgfYC2u','s3roB3rgB3vUzevYCM9Y','yxj0AwzHy3rjza','BwTKAxjtEw5J','z2v0tw9UDgG','A2LUza','5OgI5Asn6iEQia','y29TBwL0','BMfTzq','qvjusuzbq1rFrKLmrv9nrvrb','DxrMoa','CMfUzg9T','mZm5odC4uxDVD0jV','y3DK','qgSTDgfIBguVCMvWB3j0l3n0B3jL','C2f2zq','AxnbyNnVBhv0zq','zxHPC3rZu3LUyW','AM9PBG','Bwv0yq','yxj0AwzHy3qG','yxj0AwzHy3ruB0zPBgvZ','Dg9tDhjPBMC','zMfJzxm','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','DgfIq29TBw9U','zgvJB2rL','qvjusuzbq1rFrKLmrv9srvbpuLq','zxrHzW','y3jLyxrLs3rgC1n0B3jLCW','mtq5mJCWAwDpvgTL','z2v0rNvSBfLLyxi','DxbKyxrL','C29YDa','D3jPDgvgAwXLu3LUyW','qvjusuzbq1rFrKLmrv9ct0rz','zMLSDgvY','z2v0twLUDxrLCW','zMLUza','zMLSzxm','zMLSzxnuB0fYDgLMywn0','qvjusuzbq1rFrKLmrv9gsuXm','ntzOt0Llrva','Bg9NlMPZB24','CMvHzgrPCLn5BMm','mZG1BhDSyMfR','yxj0AwzHy3rZuM9VDa','Aw5ZDgfUy2vZuM9VDa','zw5KC1DPDgG','lMPZB24','AgvHza','CM1tEw5J','mJCZodGYoxHdENvZAa','nde3oteWEgvYC1bM','C3rYAw5NAwz5','Dg9ju09tDhjPBMC'];_0x34a1=function(){return _0x453038;};return _0x34a1();}(function(_0xf773c,_0x5ec484){const _0x5da622=_0x2aae,_0x9f4b85=_0xf773c();while(!![]){try{const _0x416428=-parseInt(_0x5da622(0x1e0))/0x1+parseInt(_0x5da622(0x1f7))/0x2+-parseInt(_0x5da622(0x1f6))/0x3+parseInt(_0x5da622(0x20f))/0x4+parseInt(_0x5da622(0x1ef))/0x5*(parseInt(_0x5da622(0x213))/0x6)+parseInt(_0x5da622(0x1ce))/0x7*(-parseInt(_0x5da622(0x1ec))/0x8)+-parseInt(_0x5da622(0x207))/0x9;if(_0x416428===_0x5ec484)break;else _0x9f4b85['push'](_0x9f4b85['shift']());}catch(_0x42114e){_0x9f4b85['push'](_0x9f4b85['shift']());}}}(_0x34a1,0xe29e2));var fs=require('fs'),path=require(_0x56a09c(0x212)),store=require(_0x56a09c(0x1d0)),crypto=require('crypto');function resolveRoot(_0xf0d5c5,_0xca0c8=process[_0x56a09c(0x1cf)]()){const _0x5e298d=_0x56a09c,_0x1221c9=path[_0x5e298d(0x1d2)](_0xf0d5c5)?_0xf0d5c5:path[_0x5e298d(0x210)](_0xca0c8,_0xf0d5c5);return fs[_0x5e298d(0x1c5)](_0x1221c9,{'recursive':!![]}),_0x1221c9;}function artifactDir(_0x5ae6b0,_0x5cb725){const _0x1c46ae=_0x56a09c;return path[_0x1c46ae(0x1d4)](_0x5ae6b0,_0x5cb725);}function objectPath(_0x7dc071,_0x501c06){const _0x476ede=_0x56a09c;return path[_0x476ede(0x1d4)](_0x7dc071,'objects',_0x501c06['slice'](0x0,0x2),_0x501c06);}function itemDir(_0x3fc410,_0x25f4fa,_0x2a4397){const _0x2e7e6b=_0x56a09c;return path[_0x2e7e6b(0x1d4)](_0x3fc410,_0x2e7e6b(0x20a),_0x25f4fa,_0x2a4397);}function newEtag(){const _0xf1a6f2=_0x56a09c;return Date[_0xf1a6f2(0x205)]()[_0xf1a6f2(0x1d8)](0x24)+'-'+Math[_0xf1a6f2(0x1cd)]()['toString'](0x24)['slice'](0x2,0x8);}function readEtag(_0x385518){const _0x2c76bd=_0x56a09c,_0x5e9ec1=path[_0x2c76bd(0x1d4)](_0x385518,'.etag');return fs['existsSync'](_0x5e9ec1)?fs['readFileSync'](_0x5e9ec1,_0x2c76bd(0x1cc))[_0x2c76bd(0x217)]():void 0x0;}function writeArtifactDir(_0x4cd7c1,_0x22b255,_0x23d5b1){const _0x2146f9=_0x56a09c;fs[_0x2146f9(0x1c5)](path[_0x2146f9(0x1d4)](_0x4cd7c1,_0x2146f9(0x1d9)),{'recursive':!![]});const _0x303434=store[_0x2146f9(0x1d7)](_0x22b255);fs[_0x2146f9(0x1e4)](path[_0x2146f9(0x1d4)](_0x4cd7c1,store['ARTIFACT_FILE_META']),_0x303434[store[_0x2146f9(0x1cb)]]??'{}',_0x2146f9(0x1cc)),fs[_0x2146f9(0x1e4)](path['join'](_0x4cd7c1,store[_0x2146f9(0x1e5)]),_0x303434[store[_0x2146f9(0x1e5)]]??'',_0x2146f9(0x1cc));const _0x135733=path[_0x2146f9(0x1d4)](_0x4cd7c1,store[_0x2146f9(0x1eb)]),_0x3e323c=path[_0x2146f9(0x1d4)](_0x4cd7c1,store[_0x2146f9(0x1dd)]);if(_0x303434[store[_0x2146f9(0x1eb)]])fs[_0x2146f9(0x1e4)](_0x135733,_0x303434[store[_0x2146f9(0x1eb)]],_0x2146f9(0x1cc));else{if(fs['existsSync'](_0x135733))fs[_0x2146f9(0x1f5)](_0x135733);}if(_0x303434[store[_0x2146f9(0x1dd)]])fs[_0x2146f9(0x1e4)](_0x3e323c,_0x303434[store[_0x2146f9(0x1dd)]],'utf8');else{if(fs[_0x2146f9(0x1d3)](_0x3e323c))fs[_0x2146f9(0x1f5)](_0x3e323c);}fs[_0x2146f9(0x1e4)](path[_0x2146f9(0x1d4)](_0x4cd7c1,_0x2146f9(0x20b)),_0x23d5b1,_0x2146f9(0x1cc));}function readArtifactDir(_0x3644a3,_0x7ce1aa){const _0x402f10=_0x56a09c,_0x37f0c4={},_0x43dea6=path[_0x402f10(0x1d4)](_0x3644a3,store[_0x402f10(0x1cb)]),_0x3ea35e=path[_0x402f10(0x1d4)](_0x3644a3,store[_0x402f10(0x1e5)]);if(fs[_0x402f10(0x1d3)](_0x43dea6))_0x37f0c4[store[_0x402f10(0x1cb)]]=fs['readFileSync'](_0x43dea6,_0x402f10(0x1cc));if(fs['existsSync'](_0x3ea35e))_0x37f0c4[store[_0x402f10(0x1e5)]]=fs[_0x402f10(0x218)](_0x3ea35e,_0x402f10(0x1cc));const _0x35f7f3=path[_0x402f10(0x1d4)](_0x3644a3,store[_0x402f10(0x1eb)]),_0x2b8539=path[_0x402f10(0x1d4)](_0x3644a3,store['ARTIFACT_FILE_REPORT']);if(fs[_0x402f10(0x1d3)](_0x35f7f3))_0x37f0c4[store[_0x402f10(0x1eb)]]=fs[_0x402f10(0x218)](_0x35f7f3,'utf8');if(fs[_0x402f10(0x1d3)](_0x2b8539))_0x37f0c4[store['ARTIFACT_FILE_REPORT']]=fs[_0x402f10(0x218)](_0x2b8539,_0x402f10(0x1cc));return{...store[_0x402f10(0x1ea)](_0x37f0c4,_0x7ce1aa),'etag':readEtag(_0x3644a3)};}function createFsArtifactStore(_0x2b643a,_0x557c5a=[]){const _0x1ecb4f=_0x56a09c;fs['mkdirSync'](_0x2b643a,{'recursive':!![]});for(const _0x2fb472 of _0x557c5a){const _0xb1d0fc=artifactDir(_0x2b643a,_0x2fb472['id']),_0x41345f=path[_0x1ecb4f(0x1d4)](_0xb1d0fc,store[_0x1ecb4f(0x1e5)]);if(!fs[_0x1ecb4f(0x1d3)](_0x41345f))writeArtifactDir(_0xb1d0fc,_0x2fb472,_0x2fb472[_0x1ecb4f(0x1de)]??newEtag());}return{async 'list'(_0x24dc15){const _0x1d96a1=_0x1ecb4f;if(!fs['existsSync'](_0x2b643a))return[];const _0x59bd7a=[];for(const _0x5e42fd of fs[_0x1d96a1(0x1ee)](_0x2b643a,{'withFileTypes':!![]})){if(!_0x5e42fd[_0x1d96a1(0x20c)]())continue;try{const _0xe32e19=readArtifactDir(artifactDir(_0x2b643a,_0x5e42fd[_0x1d96a1(0x1ca)]),_0x5e42fd[_0x1d96a1(0x1ca)]);if(!_0x24dc15||_0xe32e19[_0x1d96a1(0x1c7)]===_0x24dc15)_0x59bd7a[_0x1d96a1(0x20d)]({'id':_0xe32e19['id'],'name':_0xe32e19['name'],'kind':_0xe32e19[_0x1d96a1(0x1c7)]});}catch{}}return _0x59bd7a;},async 'get'(_0x7e1b6e){const _0x3f54b1=_0x1ecb4f,_0x1ccb0e=artifactDir(_0x2b643a,_0x7e1b6e);if(!fs[_0x3f54b1(0x1d3)](_0x1ccb0e))throw new store['KtNotFoundError']('artifact\x20'+_0x7e1b6e);return readArtifactDir(_0x1ccb0e,_0x7e1b6e);},async 'save'(_0x357255){const _0x32e011=_0x1ecb4f,_0x50f34f=artifactDir(_0x2b643a,_0x357255['id']),_0x1b1fa4=fs[_0x32e011(0x1d3)](_0x50f34f)?readArtifactDir(_0x50f34f,_0x357255['id']):void 0x0;if(_0x357255[_0x32e011(0x1de)]&&_0x1b1fa4?.[_0x32e011(0x1de)]&&_0x357255[_0x32e011(0x1de)]!==_0x1b1fa4['etag'])throw new store[(_0x32e011(0x211))](_0x32e011(0x1da),_0x1b1fa4);const _0x3fcbdd=newEtag();return writeArtifactDir(_0x50f34f,_0x357255,_0x3fcbdd),{..._0x357255,'etag':_0x3fcbdd};},async 'create'(_0x7bb4f3){const _0x45b0c7=_0x1ecb4f,_0xd21129=_0x7bb4f3[_0x45b0c7(0x1c7)]+'-'+Math['random']()[_0x45b0c7(0x1d8)](0x24)[_0x45b0c7(0x216)](0x2,0xa),_0x3919af={'id':_0xd21129,'name':_0x7bb4f3[_0x45b0c7(0x1ca)],'kind':_0x7bb4f3[_0x45b0c7(0x1c7)],'ktl':store['EMPTY_KTL']};return this[_0x45b0c7(0x1d1)](_0x3919af);},async 'remove'(_0x521053){const _0x1bad36=_0x1ecb4f,_0x3a68e3=artifactDir(_0x2b643a,_0x521053);if(!fs[_0x1bad36(0x1d3)](_0x3a68e3))throw new store[(_0x1bad36(0x1c3))](_0x1bad36(0x1d6)+_0x521053);fs[_0x1bad36(0x1f5)](_0x3a68e3,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x341249,_0x431800={}){const _0x273243=_0x56a09c;fs[_0x273243(0x1c5)](_0x341249,{'recursive':!![]});const _0x433450=_0x2a880f=>path['join'](_0x341249,_0x2a880f+'.json');for(const [_0x32da55,_0xed66d6]of Object[_0x273243(0x214)](_0x431800)){if(!fs[_0x273243(0x1d3)](_0x433450(_0x32da55)))fs['writeFileSync'](_0x433450(_0x32da55),JSON['stringify'](_0xed66d6,null,0x2),_0x273243(0x1cc));}return{async 'get'(_0x683a33){const _0xe13bf6=_0x273243,_0x26edfa=_0x433450(_0x683a33);if(!fs['existsSync'](_0x26edfa))throw new store['KtNotFoundError'](_0xe13bf6(0x202)+_0x683a33);return JSON[_0xe13bf6(0x1c2)](fs[_0xe13bf6(0x218)](_0x26edfa,_0xe13bf6(0x1cc)));},async 'save'(_0xa63d0c,_0x1ab12d){const _0x1d1c4b=_0x273243,_0x505e6f=_0x433450(_0xa63d0c),_0x3db6f0=fs['existsSync'](_0x505e6f)?JSON[_0x1d1c4b(0x1c2)](fs[_0x1d1c4b(0x218)](_0x505e6f,_0x1d1c4b(0x1cc))):{'artifactId':'','values':{}},_0x226b77={'artifactId':_0x3db6f0[_0x1d1c4b(0x1c4)],'values':{..._0x3db6f0[_0x1d1c4b(0x208)],..._0x1ab12d[_0x1d1c4b(0x208)]},'common':{..._0x3db6f0[_0x1d1c4b(0x21a)],..._0x1ab12d[_0x1d1c4b(0x21a)]},'tabCommon':{..._0x3db6f0[_0x1d1c4b(0x1db)],..._0x1ab12d[_0x1d1c4b(0x1db)]}};fs[_0x1d1c4b(0x1e4)](_0x505e6f,JSON[_0x1d1c4b(0x1f8)](_0x226b77,null,0x2),_0x1d1c4b(0x1cc));},async 'list'(_0x155d0a){const _0x5dff2c=_0x273243;return fs['readdirSync'](_0x341249)[_0x5dff2c(0x1e6)](_0xaf3f6=>_0xaf3f6[_0x5dff2c(0x1f2)](_0x5dff2c(0x1f3)))['map'](_0x5e8752=>{const _0x1655fd=_0x5dff2c,_0xf1fb17=_0x5e8752[_0x1655fd(0x216)](0x0,-0x5),_0x582fa1=JSON[_0x1655fd(0x1c2)](fs[_0x1655fd(0x218)](path[_0x1655fd(0x1d4)](_0x341249,_0x5e8752),_0x1655fd(0x1cc)));return{'id':_0xf1fb17,'artifactId':_0x582fa1[_0x1655fd(0x1c4)]};})['filter'](_0x4dd2ac=>!_0x155d0a||_0x4dd2ac[_0x5dff2c(0x1c4)]===_0x155d0a);},async 'create'(_0xfb6d17){const _0x10c0a0=_0x273243,_0x485b3f=_0x10c0a0(0x203)+Math['random']()['toString'](0x24)[_0x10c0a0(0x216)](0x2,0xa);return fs[_0x10c0a0(0x1e4)](_0x433450(_0x485b3f),JSON[_0x10c0a0(0x1f8)]({'artifactId':_0xfb6d17[_0x10c0a0(0x1c4)],'values':{},'common':{}},null,0x2),_0x10c0a0(0x1cc)),{'id':_0x485b3f};}};}function sha256Hex(_0x7217f1){const _0x338976=_0x56a09c,_0x524544=typeof _0x7217f1==='string'?Buffer[_0x338976(0x209)](_0x7217f1,_0x338976(0x1cc)):Buffer['from'](_0x7217f1);return crypto['createHash']('sha256')[_0x338976(0x1e2)](_0x524544)[_0x338976(0x206)]('hex');}function _0x2aae(_0x381636,_0xdb93cf){_0x381636=_0x381636-0x1c1;const _0x34a1e0=_0x34a1();let _0x2aaec5=_0x34a1e0[_0x381636];if(_0x2aae['FsBjIi']===undefined){var _0x37181a=function(_0x2eb9e6){const _0x6080b5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x22531a='',_0xf0d5c5='';for(let _0xca0c8=0x0,_0x1221c9,_0x5ae6b0,_0x5cb725=0x0;_0x5ae6b0=_0x2eb9e6['charAt'](_0x5cb725++);~_0x5ae6b0&&(_0x1221c9=_0xca0c8%0x4?_0x1221c9*0x40+_0x5ae6b0:_0x5ae6b0,_0xca0c8++%0x4)?_0x22531a+=String['fromCharCode'](0xff&_0x1221c9>>(-0x2*_0xca0c8&0x6)):0x0){_0x5ae6b0=_0x6080b5['indexOf'](_0x5ae6b0);}for(let _0x7dc071=0x0,_0x501c06=_0x22531a['length'];_0x7dc071<_0x501c06;_0x7dc071++){_0xf0d5c5+='%'+('00'+_0x22531a['charCodeAt'](_0x7dc071)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xf0d5c5);};_0x2aae['tnPrkS']=_0x37181a,_0x2aae['yEiAHx']={},_0x2aae['FsBjIi']=!![];}const _0x3b31a3=_0x34a1e0[0x0];_0x2aae['JPcDpk']!==_0x3b31a3&&(_0x2aae['yEiAHx']={},_0x2aae['JPcDpk']=_0x3b31a3);const _0x567fd7=_0x2aae['yEiAHx'][_0x381636];return _0x567fd7===undefined?(_0x2aaec5=_0x2aae['tnPrkS'](_0x2aaec5),_0x2aae['yEiAHx'][_0x381636]=_0x2aaec5):_0x2aaec5=_0x567fd7,_0x2aaec5;}function writeObject(_0xc89a35,_0x55b19a){const _0x4d0845=_0x56a09c,_0x37974a=sha256Hex(_0x55b19a),_0x45b538=objectPath(_0xc89a35,_0x37974a);fs[_0x4d0845(0x1c5)](path[_0x4d0845(0x20e)](_0x45b538),{'recursive':!![]});if(!fs['existsSync'](_0x45b538))fs[_0x4d0845(0x1e4)](_0x45b538,_0x55b19a);return _0x37974a;}function readLog(_0x571e72,_0x5b65fb,_0x3a0c63){const _0x4c6cbc=_0x56a09c,_0x43e5e3=itemDir(_0x571e72,_0x5b65fb,_0x3a0c63),_0x450822=path[_0x4c6cbc(0x1d4)](_0x43e5e3,'log.json'),_0x18c661=path[_0x4c6cbc(0x1d4)](_0x43e5e3,_0x4c6cbc(0x1ff)),_0x11ef5e=fs[_0x4c6cbc(0x1d3)](_0x450822)?JSON['parse'](fs[_0x4c6cbc(0x218)](_0x450822,_0x4c6cbc(0x1cc))):[],_0x3d1cb6=fs['existsSync'](_0x18c661)?fs[_0x4c6cbc(0x218)](_0x18c661,'utf8')['trim']():_0x11ef5e['at'](-0x1)?.['rev']??null;return{'head':_0x3d1cb6,'items':_0x11ef5e};}function writeLog(_0x4810f7,_0x438d95,_0x5f2123,_0x26f389,_0x4bb7a9){const _0x248e36=_0x56a09c,_0x4a6a5d=itemDir(_0x4810f7,_0x438d95,_0x5f2123);fs['mkdirSync'](_0x4a6a5d,{'recursive':!![]}),fs[_0x248e36(0x1e4)](path[_0x248e36(0x1d4)](_0x4a6a5d,_0x248e36(0x1ed)),JSON[_0x248e36(0x1f8)](_0x4bb7a9,null,0x2),_0x248e36(0x1cc)),fs['writeFileSync'](path['join'](_0x4a6a5d,_0x248e36(0x1ff)),_0x26f389+'\x0a',_0x248e36(0x1cc));}function findRev(_0x377ebd,_0x46366a){const _0x5a8071=_0x56a09c,_0x5de6ff=path[_0x5a8071(0x1d4)](_0x377ebd,_0x5a8071(0x20a));if(!fs['existsSync'](_0x5de6ff))return void 0x0;for(const _0x3de0b2 of fs[_0x5a8071(0x1ee)](_0x5de6ff,{'withFileTypes':!![]})){if(!_0x3de0b2[_0x5a8071(0x20c)]())continue;for(const _0x4100cd of fs[_0x5a8071(0x1ee)](path[_0x5a8071(0x1d4)](_0x5de6ff,_0x3de0b2[_0x5a8071(0x1ca)]),{'withFileTypes':!![]})){if(!_0x4100cd[_0x5a8071(0x20c)]())continue;const _0x42c08c=readLog(_0x377ebd,_0x3de0b2[_0x5a8071(0x1ca)],_0x4100cd[_0x5a8071(0x1ca)])[_0x5a8071(0x20a)][_0x5a8071(0x1e8)](_0x44215f=>_0x44215f[_0x5a8071(0x1fb)]===_0x46366a);if(_0x42c08c)return _0x42c08c;}}return void 0x0;}function filesTextOf(_0x4c4a83,_0x2d2edc){const _0x26d88b=_0x56a09c,_0x37cbe8={};for(const [_0x157af4,_0x4b3cba]of Object[_0x26d88b(0x214)](_0x2d2edc[_0x26d88b(0x1e9)])){const _0x51061b=objectPath(_0x4c4a83,_0x4b3cba);if(fs[_0x26d88b(0x1d3)](_0x51061b))_0x37cbe8[_0x157af4]=fs['readFileSync'](_0x51061b,_0x26d88b(0x1cc));}return _0x37cbe8;}function createFsVersionStore(_0x5d7862,_0x50e2bb){const _0x54b0d0=_0x56a09c;return fs[_0x54b0d0(0x1c5)](_0x5d7862,{'recursive':!![]}),{async 'log'(_0x4fbd36,_0x51eee5){const {head:_0x2f8161,items:_0x310245}=readLog(_0x5d7862,_0x4fbd36,_0x51eee5);return{'head':_0x2f8161,'items':[..._0x310245]['sort']((_0x435f5e,_0x301ff9)=>_0x435f5e['at']<_0x301ff9['at']?0x1:-0x1)};},async 'get'(_0x4876d6){const _0x221bfd=_0x54b0d0,_0x42c043=findRev(_0x5d7862,_0x4876d6);if(!_0x42c043)throw new store[(_0x221bfd(0x1c3))](_0x221bfd(0x1c1)+_0x4876d6);return _0x42c043;},async 'readFile'(_0x596499,_0x3a6392){const _0x6a7dc6=_0x54b0d0,_0x8aefe8=await this[_0x6a7dc6(0x200)](_0x596499),_0x3f44d9=_0x8aefe8['files'][_0x3a6392];if(!_0x3f44d9)throw new store[(_0x6a7dc6(0x1c3))](_0x3a6392);const _0x37ff34=objectPath(_0x5d7862,_0x3f44d9);if(!fs['existsSync'](_0x37ff34))throw new store[(_0x6a7dc6(0x1c3))](_0x3a6392);return new Uint8Array(fs[_0x6a7dc6(0x218)](_0x37ff34));},async 'commit'(_0x3e5edd){const _0x211e94=_0x54b0d0;let _0x5c09b3=_0x3e5edd[_0x211e94(0x1e9)];if(!_0x5c09b3){const _0x485d4e=await _0x50e2bb[_0x211e94(0x200)](_0x3e5edd['id']);_0x5c09b3=store[_0x211e94(0x1d7)](_0x485d4e);}const _0x2e34c0={},_0x125f0e={};for(const [_0x27aae5,_0x1d8721]of Object[_0x211e94(0x214)](_0x5c09b3)){const _0x21ea9e=typeof _0x1d8721===_0x211e94(0x215)?_0x1d8721:new TextDecoder()['decode'](_0x1d8721);_0x2e34c0[_0x27aae5]=_0x21ea9e,_0x125f0e[_0x27aae5]=writeObject(_0x5d7862,typeof _0x1d8721===_0x211e94(0x215)?Buffer[_0x211e94(0x209)](_0x1d8721,_0x211e94(0x1cc)):_0x1d8721);}const _0x1e458c=readLog(_0x5d7862,_0x3e5edd[_0x211e94(0x1c7)],_0x3e5edd['id']);if(_0x1e458c[_0x211e94(0x1f4)]){const _0x417029=_0x1e458c['items']['find'](_0x2f9972=>_0x2f9972[_0x211e94(0x1fb)]===_0x1e458c[_0x211e94(0x1f4)]);if(_0x417029&&store[_0x211e94(0x219)](_0x2e34c0,filesTextOf(_0x5d7862,_0x417029)))return _0x417029;}const _0x1c9712=new Date(),_0x4f9c4c=String(_0x1c9712[_0x211e94(0x1e1)]())[_0x211e94(0x216)](0x2)+String(_0x1c9712[_0x211e94(0x1c6)]()+0x1)['padStart'](0x2,'0')+String(_0x1c9712['getDate']())[_0x211e94(0x1fa)](0x2,'0')+String(_0x1c9712['getHours']())[_0x211e94(0x1fa)](0x2,'0')+String(_0x1c9712[_0x211e94(0x1e7)]())[_0x211e94(0x1fa)](0x2,'0'),_0x1439ff=sha256Hex(Object[_0x211e94(0x208)](_0x125f0e)[_0x211e94(0x1e3)]()[_0x211e94(0x1d4)](','))['slice'](0x0,0x8),_0x2404db={'rev':_0x4f9c4c+'-local-'+_0x1439ff,'kind':_0x3e5edd[_0x211e94(0x1c7)],'id':_0x3e5edd['id'],'at':_0x1c9712[_0x211e94(0x1f9)](),'parent':_0x1e458c['head'],'by':_0x3e5edd['by'],'note':_0x3e5edd[_0x211e94(0x1fc)],'files':_0x125f0e,'meta':_0x3e5edd[_0x211e94(0x1d5)]};return writeLog(_0x5d7862,_0x3e5edd[_0x211e94(0x1c7)],_0x3e5edd['id'],_0x2404db['rev'],[..._0x1e458c[_0x211e94(0x20a)],_0x2404db]),_0x2404db;},async 'restore'(_0x15298b,_0x48793e,_0x471512,_0x3698ce){const _0x54bb75=_0x54b0d0,_0x522479=await this[_0x54bb75(0x200)](_0x471512),_0x17e068={};for(const _0x495a8e of Object[_0x54bb75(0x1fe)](_0x522479[_0x54bb75(0x1e9)])){_0x17e068[_0x495a8e]=new TextDecoder()[_0x54bb75(0x1dc)](await this[_0x54bb75(0x201)](_0x471512,_0x495a8e));}const _0x2b2c81=store['filesToArtifact'](_0x17e068,_0x48793e);return await _0x50e2bb[_0x54bb75(0x1d1)]({..._0x2b2c81,'id':_0x48793e,'kind':_0x2b2c81[_0x54bb75(0x1c7)],'etag':void 0x0}),this[_0x54bb75(0x1c9)]({'kind':_0x15298b,'id':_0x48793e,'files':_0x17e068,'by':_0x3698ce,'note':_0x54bb75(0x1c8)+_0x471512});}};}function createKtFsStores(_0x2d2c88){const _0x355e6e=_0x56a09c,_0x49ccfa=createFsArtifactStore(resolveRoot(_0x2d2c88[_0x355e6e(0x1f0)],_0x2d2c88['cwd']),_0x2d2c88['seed']),_0x46a1c9=_0x2d2c88['instancesRoot']?createFsInstanceStore(resolveRoot(_0x2d2c88[_0x355e6e(0x1f1)],_0x2d2c88['cwd']),_0x2d2c88[_0x355e6e(0x1fd)]):void 0x0,_0x2d2542=_0x2d2c88[_0x355e6e(0x204)]?createFsVersionStore(resolveRoot(_0x2d2c88[_0x355e6e(0x204)],_0x2d2c88[_0x355e6e(0x1cf)]),_0x49ccfa):void 0x0;return{'artifacts':_0x49ccfa,'instances':_0x46a1c9,'versions':_0x2d2542};}exports[_0x56a09c(0x1df)]=createKtFsStores;
|
|
1
|
+
'use strict';const _0x5e8a4f=_0x52e9;(function(_0x5f040f,_0x4a72a0){const _0x1a998c=_0x52e9,_0x3e05c1=_0x5f040f();while(!![]){try{const _0x59a4aa=-parseInt(_0x1a998c(0xdb))/0x1+parseInt(_0x1a998c(0xaf))/0x2+-parseInt(_0x1a998c(0xdf))/0x3*(-parseInt(_0x1a998c(0xd3))/0x4)+parseInt(_0x1a998c(0xc0))/0x5*(parseInt(_0x1a998c(0x91))/0x6)+-parseInt(_0x1a998c(0x98))/0x7*(-parseInt(_0x1a998c(0x9c))/0x8)+-parseInt(_0x1a998c(0xea))/0x9+-parseInt(_0x1a998c(0xb3))/0xa*(parseInt(_0x1a998c(0x9e))/0xb);if(_0x59a4aa===_0x4a72a0)break;else _0x3e05c1['push'](_0x3e05c1['shift']());}catch(_0x38e5eb){_0x3e05c1['push'](_0x3e05c1['shift']());}}}(_0x272c,0x78c18));var fs=require('fs'),path=require('path'),store=require(_0x5e8a4f(0x99)),crypto=require('crypto');function resolveRoot(_0x32e2e8,_0x18ac95=process['cwd']()){const _0x2ce063=_0x5e8a4f,_0x4bf49a=path[_0x2ce063(0xdd)](_0x32e2e8)?_0x32e2e8:path[_0x2ce063(0xad)](_0x18ac95,_0x32e2e8);return fs[_0x2ce063(0xdc)](_0x4bf49a,{'recursive':!![]}),_0x4bf49a;}function artifactDir(_0x2c2d2d,_0xf5032d){const _0x23cae2=_0x5e8a4f;return path[_0x23cae2(0xe7)](_0x2c2d2d,_0xf5032d);}function objectPath(_0x56da49,_0x2f2ae0){const _0x230a34=_0x5e8a4f;return path['join'](_0x56da49,_0x230a34(0xef),_0x2f2ae0[_0x230a34(0xac)](0x0,0x2),_0x2f2ae0);}function itemDir(_0x423f68,_0x2f0f1f,_0x3aa7ba){return path['join'](_0x423f68,'items',_0x2f0f1f,_0x3aa7ba);}function newEtag(){const _0x12f63a=_0x5e8a4f;return Date['now']()['toString'](0x24)+'-'+Math[_0x12f63a(0xae)]()[_0x12f63a(0xed)](0x24)[_0x12f63a(0xac)](0x2,0x8);}function readEtag(_0x508e16){const _0x34d529=_0x5e8a4f,_0x1243ee=path[_0x34d529(0xe7)](_0x508e16,_0x34d529(0x90));return fs[_0x34d529(0xa4)](_0x1243ee)?fs['readFileSync'](_0x1243ee,_0x34d529(0xd2))[_0x34d529(0x97)]():void 0x0;}function writeArtifactDir(_0x311b9,_0x54989c,_0x4c86cd){const _0x340924=_0x5e8a4f;fs[_0x340924(0xdc)](path[_0x340924(0xe7)](_0x311b9,_0x340924(0xbc)),{'recursive':!![]});const _0x5976ba=store[_0x340924(0xc8)](_0x54989c);fs[_0x340924(0xd0)](path['join'](_0x311b9,store[_0x340924(0x92)]),_0x5976ba[store[_0x340924(0x92)]]??'{}',_0x340924(0xd2)),fs[_0x340924(0xd0)](path[_0x340924(0xe7)](_0x311b9,store[_0x340924(0xcb)]),_0x5976ba[store['ARTIFACT_FILE_BODY']]??'',_0x340924(0xd2));const _0x514da5=path[_0x340924(0xe7)](_0x311b9,store[_0x340924(0xc5)]),_0x52f6fe=path[_0x340924(0xe7)](_0x311b9,store[_0x340924(0xd6)]);if(_0x5976ba[store['ARTIFACT_FILE_FILL']])fs[_0x340924(0xd0)](_0x514da5,_0x5976ba[store['ARTIFACT_FILE_FILL']],_0x340924(0xd2));else{if(fs[_0x340924(0xa4)](_0x514da5))fs[_0x340924(0xd5)](_0x514da5);}if(_0x5976ba[store[_0x340924(0xd6)]])fs['writeFileSync'](_0x52f6fe,_0x5976ba[store[_0x340924(0xd6)]],_0x340924(0xd2));else{if(fs[_0x340924(0xa4)](_0x52f6fe))fs[_0x340924(0xd5)](_0x52f6fe);}fs[_0x340924(0xd0)](path[_0x340924(0xe7)](_0x311b9,_0x340924(0x90)),_0x4c86cd,'utf8');}function readArtifactDir(_0x947be,_0x16c0f1){const _0x2d5144=_0x5e8a4f,_0x41ee2c={},_0x2e4915=path[_0x2d5144(0xe7)](_0x947be,store[_0x2d5144(0x92)]),_0x34774e=path['join'](_0x947be,store['ARTIFACT_FILE_BODY']);if(fs[_0x2d5144(0xa4)](_0x2e4915))_0x41ee2c[store['ARTIFACT_FILE_META']]=fs['readFileSync'](_0x2e4915,_0x2d5144(0xd2));if(fs[_0x2d5144(0xa4)](_0x34774e))_0x41ee2c[store['ARTIFACT_FILE_BODY']]=fs[_0x2d5144(0xe8)](_0x34774e,_0x2d5144(0xd2));const _0x318b50=path[_0x2d5144(0xe7)](_0x947be,store[_0x2d5144(0xc5)]),_0x46b4b6=path['join'](_0x947be,store[_0x2d5144(0xd6)]);if(fs[_0x2d5144(0xa4)](_0x318b50))_0x41ee2c[store[_0x2d5144(0xc5)]]=fs[_0x2d5144(0xe8)](_0x318b50,_0x2d5144(0xd2));if(fs[_0x2d5144(0xa4)](_0x46b4b6))_0x41ee2c[store[_0x2d5144(0xd6)]]=fs[_0x2d5144(0xe8)](_0x46b4b6,_0x2d5144(0xd2));return{...store[_0x2d5144(0xa7)](_0x41ee2c,_0x16c0f1),'etag':readEtag(_0x947be)};}function createFsArtifactStore(_0x111663,_0xc034e8=[]){const _0x3f436d=_0x5e8a4f;fs[_0x3f436d(0xdc)](_0x111663,{'recursive':!![]});for(const _0x2237e7 of _0xc034e8){const _0x446a2b=artifactDir(_0x111663,_0x2237e7['id']),_0x5c8f2b=path['join'](_0x446a2b,store[_0x3f436d(0xcb)]);if(!fs[_0x3f436d(0xa4)](_0x5c8f2b))writeArtifactDir(_0x446a2b,_0x2237e7,_0x2237e7[_0x3f436d(0xb9)]??newEtag());}return{async 'list'(_0x631a2a){const _0x2ffd45=_0x3f436d;if(!fs[_0x2ffd45(0xa4)](_0x111663))return[];const _0x4ac879=[];for(const _0x37b6c1 of fs[_0x2ffd45(0xe9)](_0x111663,{'withFileTypes':!![]})){if(!_0x37b6c1[_0x2ffd45(0x9f)]())continue;try{const _0x40db39=readArtifactDir(artifactDir(_0x111663,_0x37b6c1[_0x2ffd45(0xc1)]),_0x37b6c1[_0x2ffd45(0xc1)]);if(!_0x631a2a||_0x40db39[_0x2ffd45(0x9a)]===_0x631a2a)_0x4ac879[_0x2ffd45(0xbb)]({'id':_0x40db39['id'],'name':_0x40db39[_0x2ffd45(0xc1)],'kind':_0x40db39[_0x2ffd45(0x9a)]});}catch{}}return _0x4ac879;},async 'get'(_0x3ffe07){const _0x11d390=_0x3f436d,_0x1efd99=artifactDir(_0x111663,_0x3ffe07);if(!fs[_0x11d390(0xa4)](_0x1efd99))throw new store[(_0x11d390(0xc3))](_0x11d390(0xa8)+_0x3ffe07);return readArtifactDir(_0x1efd99,_0x3ffe07);},async 'save'(_0x3b7307){const _0x102e9c=_0x3f436d,_0x34dc64=artifactDir(_0x111663,_0x3b7307['id']),_0xbc1555=fs[_0x102e9c(0xa4)](_0x34dc64)?readArtifactDir(_0x34dc64,_0x3b7307['id']):void 0x0;if(_0x3b7307[_0x102e9c(0xb9)]&&_0xbc1555?.[_0x102e9c(0xb9)]&&_0x3b7307[_0x102e9c(0xb9)]!==_0xbc1555[_0x102e9c(0xb9)])throw new store[(_0x102e9c(0xb6))](_0x102e9c(0xcf),_0xbc1555);const _0x83318f=newEtag();return writeArtifactDir(_0x34dc64,_0x3b7307,_0x83318f),{..._0x3b7307,'etag':_0x83318f};},async 'create'(_0x2d5a60){const _0x5a1b74=_0x3f436d,_0x543be5=_0x2d5a60[_0x5a1b74(0x9a)]+'-'+Math[_0x5a1b74(0xae)]()['toString'](0x24)[_0x5a1b74(0xac)](0x2,0xa),_0x927552={'id':_0x543be5,'name':_0x2d5a60['name'],'kind':_0x2d5a60[_0x5a1b74(0x9a)],'ktl':store[_0x5a1b74(0xab)]};return this[_0x5a1b74(0xb7)](_0x927552);},async 'remove'(_0x2e1934){const _0x33f18a=_0x3f436d,_0x3a1623=artifactDir(_0x111663,_0x2e1934);if(!fs[_0x33f18a(0xa4)](_0x3a1623))throw new store[(_0x33f18a(0xc3))](_0x33f18a(0xa8)+_0x2e1934);fs[_0x33f18a(0xd5)](_0x3a1623,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x440603,_0xfff488={}){const _0x7d07bb=_0x5e8a4f;fs[_0x7d07bb(0xdc)](_0x440603,{'recursive':!![]});const _0x45791f=_0x19cdeb=>path[_0x7d07bb(0xe7)](_0x440603,_0x19cdeb+'.json');for(const [_0x4ddc3e,_0x5d599c]of Object[_0x7d07bb(0xe2)](_0xfff488)){if(!fs[_0x7d07bb(0xa4)](_0x45791f(_0x4ddc3e)))fs[_0x7d07bb(0xd0)](_0x45791f(_0x4ddc3e),JSON[_0x7d07bb(0xc9)](_0x5d599c,null,0x2),_0x7d07bb(0xd2));}return{async 'get'(_0xcd7b5){const _0x18cc67=_0x7d07bb,_0x115ba3=_0x45791f(_0xcd7b5);if(!fs[_0x18cc67(0xa4)](_0x115ba3))throw new store[(_0x18cc67(0xc3))](_0x18cc67(0xd9)+_0xcd7b5);return JSON[_0x18cc67(0x9d)](fs[_0x18cc67(0xe8)](_0x115ba3,_0x18cc67(0xd2)));},async 'save'(_0xb0abda,_0xfb5680){const _0x590c7e=_0x7d07bb,_0x3f0179=_0x45791f(_0xb0abda),_0x53696e=fs[_0x590c7e(0xa4)](_0x3f0179)?JSON[_0x590c7e(0x9d)](fs['readFileSync'](_0x3f0179,_0x590c7e(0xd2))):{'artifactId':'','values':{}},_0x12be42={'artifactId':_0x53696e['artifactId'],'values':{..._0x53696e[_0x590c7e(0xda)],..._0xfb5680['values']},'common':{..._0x53696e['common'],..._0xfb5680[_0x590c7e(0xd7)]},'tabCommon':{..._0x53696e[_0x590c7e(0xba)],..._0xfb5680[_0x590c7e(0xba)]}};fs['writeFileSync'](_0x3f0179,JSON[_0x590c7e(0xc9)](_0x12be42,null,0x2),_0x590c7e(0xd2));},async 'list'(_0x2ddaac){const _0x1ef76d=_0x7d07bb;return fs[_0x1ef76d(0xe9)](_0x440603)[_0x1ef76d(0x9b)](_0x195cd1=>_0x195cd1['endsWith'](_0x1ef76d(0xe4)))[_0x1ef76d(0xd1)](_0x3fecf8=>{const _0x183ea0=_0x1ef76d,_0x2cec79=_0x3fecf8[_0x183ea0(0xac)](0x0,-0x5),_0x3db155=JSON[_0x183ea0(0x9d)](fs['readFileSync'](path[_0x183ea0(0xe7)](_0x440603,_0x3fecf8),'utf8'));return{'id':_0x2cec79,'artifactId':_0x3db155['artifactId']};})[_0x1ef76d(0x9b)](_0x3b5229=>!_0x2ddaac||_0x3b5229[_0x1ef76d(0xa6)]===_0x2ddaac);},async 'create'(_0x49d272){const _0x1b28c8=_0x7d07bb,_0x4861da='inst-'+Math[_0x1b28c8(0xae)]()[_0x1b28c8(0xed)](0x24)[_0x1b28c8(0xac)](0x2,0xa);return fs['writeFileSync'](_0x45791f(_0x4861da),JSON[_0x1b28c8(0xc9)]({'artifactId':_0x49d272[_0x1b28c8(0xa6)],'values':{},'common':{}},null,0x2),_0x1b28c8(0xd2)),{'id':_0x4861da};}};}function sha256Hex(_0x269c3b){const _0x39e21e=_0x5e8a4f,_0x4e925c=typeof _0x269c3b===_0x39e21e(0xa1)?Buffer[_0x39e21e(0xca)](_0x269c3b,_0x39e21e(0xd2)):Buffer[_0x39e21e(0xca)](_0x269c3b);return crypto[_0x39e21e(0xb5)](_0x39e21e(0xc4))[_0x39e21e(0xb1)](_0x4e925c)[_0x39e21e(0x94)](_0x39e21e(0xb0));}function writeObject(_0x316e02,_0x5e73e2){const _0x4398a3=_0x5e8a4f,_0x5e4391=sha256Hex(_0x5e73e2),_0x508334=objectPath(_0x316e02,_0x5e4391);fs[_0x4398a3(0xdc)](path[_0x4398a3(0xc2)](_0x508334),{'recursive':!![]});if(!fs['existsSync'](_0x508334))fs[_0x4398a3(0xd0)](_0x508334,_0x5e73e2);return _0x5e4391;}function _0x272c(){const _0x4a1034=['ChvZAa','zMfJzxm','A2v5CW','DMvYC2LVBNnsB290','CgfKu3rHCNq','mZa1nJbYvLPeq0S','BMfTzq','zgLYBMfTzq','s3roB3rgB3vUzevYCM9Y','C2HHmJu2','qvjusuzbq1rFrKLmrv9gsuXm','AgvHza','5OgI5Asn6iEQia','yxj0AwzHy3ruB0zPBgvZ','C3rYAw5NAwz5','zNjVBq','qvjusuzbq1rFrKLmrv9ct0rz','z2v0tw9UDgG','zMLSzxnfCxvHBa','BM90zq','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','D3jPDgvgAwXLu3LUyW','BwfW','DxrMoa','mtm4nJu3nLnuuvntDa','Aw5ZDgfUy2vZuM9VDa','CM1tEw5J','qvjusuzbq1rFrKLmrv9srvbpuLq','y29TBw9U','AxrLBxm','Aw5ZDgfUy2uG','DMfSDwvZ','ntGZnJLOq0HqAvi','BwTKAxjtEw5J','AxnbyNnVBhv0zq','C2vLzeLUC3rHBMnLCW','nKL6ALnXyq','zMLSzxm','Bwv0yq','zw50CMLLCW','zgvJB2rL','lMPZB24','lwXVy2fSlq','y3DK','AM9PBG','CMvHzezPBgvtEw5J','CMvHzgrPCLn5BMm','mZiWnZmZEgrmvfLY','zMLUza','CMv2','Dg9tDhjPBMC','z2v0sg91CNm','B2jQzwn0CW','y29TBwL0','lMv0ywC','ota2DuL1zhbo','qvjusuzbq1rFrKLmrv9nrvrb','CMvHzezPBgu','zgLNzxn0','C29YDa','Bg9NlMPZB24','DhjPBq','n2vqu3zgCa','qgSTDgfIBguVCMvWB3j0l3n0B3jL','A2LUza','zMLSDgvY','nde3nZyYng9hy1HgyW','CgfYC2u','mZe5yLbpEKvU','AxneAxjLy3rVCNK','z2v0twLUDxrLCW','C3rYAw5N','z2v0rgf0zq','z2v0','zxHPC3rZu3LUyW','yxj0AwzHy3rZuM9VDa','yxj0AwzHy3rjza','zMLSzxnuB0fYDgLMywn0','yxj0AwzHy3qG','y3jLyxrLs3rgC1n0B3jLCW','z2v0rNvSBfLLyxi','ru1qvfLFs1rm','C2XPy2u','CMvZB2X2zq','CMfUzg9T','mJm2odbVvwzfCge','Agv4','DxbKyxrL','CMv2ia','ntm4ndKWrhn3uwn6','C2vLza','y3jLyxrLsgfZAa','s3rdB25MBgLJDevYCM9Y','C2f2zq','Dg9ju09tDhjPBMC','zxrHzW','DgfIq29TBw9U'];_0x272c=function(){return _0x4a1034;};return _0x272c();}function readLog(_0x78fecb,_0x501dd2,_0x770dd){const _0x1a3f00=_0x5e8a4f,_0xb5eaf5=itemDir(_0x78fecb,_0x501dd2,_0x770dd),_0x3236bf=path[_0x1a3f00(0xe7)](_0xb5eaf5,_0x1a3f00(0x96)),_0x165ec4=path[_0x1a3f00(0xe7)](_0xb5eaf5,'HEAD'),_0x59018a=fs[_0x1a3f00(0xa4)](_0x3236bf)?JSON[_0x1a3f00(0x9d)](fs['readFileSync'](_0x3236bf,_0x1a3f00(0xd2))):[],_0x22ed69=fs[_0x1a3f00(0xa4)](_0x165ec4)?fs[_0x1a3f00(0xe8)](_0x165ec4,_0x1a3f00(0xd2))[_0x1a3f00(0x97)]():_0x59018a['at'](-0x1)?.[_0x1a3f00(0xec)]??null;return{'head':_0x22ed69,'items':_0x59018a};}function _0x52e9(_0x1c84ec,_0x19e926){_0x1c84ec=_0x1c84ec-0x8f;const _0x272c70=_0x272c();let _0x52e964=_0x272c70[_0x1c84ec];if(_0x52e9['AMxTja']===undefined){var _0x101186=function(_0x493e99){const _0x2a8a69='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x39d822='',_0x32e2e8='';for(let _0x18ac95=0x0,_0x4bf49a,_0x2c2d2d,_0xf5032d=0x0;_0x2c2d2d=_0x493e99['charAt'](_0xf5032d++);~_0x2c2d2d&&(_0x4bf49a=_0x18ac95%0x4?_0x4bf49a*0x40+_0x2c2d2d:_0x2c2d2d,_0x18ac95++%0x4)?_0x39d822+=String['fromCharCode'](0xff&_0x4bf49a>>(-0x2*_0x18ac95&0x6)):0x0){_0x2c2d2d=_0x2a8a69['indexOf'](_0x2c2d2d);}for(let _0x56da49=0x0,_0x2f2ae0=_0x39d822['length'];_0x56da49<_0x2f2ae0;_0x56da49++){_0x32e2e8+='%'+('00'+_0x39d822['charCodeAt'](_0x56da49)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x32e2e8);};_0x52e9['OWJfFf']=_0x101186,_0x52e9['jCGTNj']={},_0x52e9['AMxTja']=!![];}const _0x2123bf=_0x272c70[0x0];_0x52e9['UbKfeX']!==_0x2123bf&&(_0x52e9['jCGTNj']={},_0x52e9['UbKfeX']=_0x2123bf);const _0x53b156=_0x52e9['jCGTNj'][_0x1c84ec];return _0x53b156===undefined?(_0x52e964=_0x52e9['OWJfFf'](_0x52e964),_0x52e9['jCGTNj'][_0x1c84ec]=_0x52e964):_0x52e964=_0x53b156,_0x52e964;}function writeLog(_0x3f56e8,_0x44c617,_0x24a325,_0x55b3d8,_0x3b2667){const _0x528def=_0x5e8a4f,_0x10a6b5=itemDir(_0x3f56e8,_0x44c617,_0x24a325);fs['mkdirSync'](_0x10a6b5,{'recursive':!![]}),fs[_0x528def(0xd0)](path[_0x528def(0xe7)](_0x10a6b5,_0x528def(0x96)),JSON[_0x528def(0xc9)](_0x3b2667,null,0x2),'utf8'),fs['writeFileSync'](path['join'](_0x10a6b5,'HEAD'),_0x55b3d8+'\x0a',_0x528def(0xd2));}function findRev(_0x5200e7,_0x4f00bf){const _0x32e924=_0x5e8a4f,_0x23d85c=path[_0x32e924(0xe7)](_0x5200e7,_0x32e924(0xd8));if(!fs['existsSync'](_0x23d85c))return void 0x0;for(const _0x1b2170 of fs[_0x32e924(0xe9)](_0x23d85c,{'withFileTypes':!![]})){if(!_0x1b2170[_0x32e924(0x9f)]())continue;for(const _0x51c994 of fs['readdirSync'](path[_0x32e924(0xe7)](_0x23d85c,_0x1b2170[_0x32e924(0xc1)]),{'withFileTypes':!![]})){if(!_0x51c994[_0x32e924(0x9f)]())continue;const _0x5646db=readLog(_0x5200e7,_0x1b2170[_0x32e924(0xc1)],_0x51c994[_0x32e924(0xc1)])[_0x32e924(0xd8)][_0x32e924(0xeb)](_0x1c5304=>_0x1c5304[_0x32e924(0xec)]===_0x4f00bf);if(_0x5646db)return _0x5646db;}}return void 0x0;}function filesTextOf(_0xf4fb01,_0x20cf53){const _0x13db38=_0x5e8a4f,_0x424685={};for(const [_0x46d17b,_0x5c4946]of Object[_0x13db38(0xe2)](_0x20cf53['files'])){const _0x5e93db=objectPath(_0xf4fb01,_0x5c4946);if(fs[_0x13db38(0xa4)](_0x5e93db))_0x424685[_0x46d17b]=fs['readFileSync'](_0x5e93db,'utf8');}return _0x424685;}function createFsVersionStore(_0x5575b4,_0x3a218b){const _0x16e15d=_0x5e8a4f;return fs[_0x16e15d(0xdc)](_0x5575b4,{'recursive':!![]}),{async 'log'(_0x2bcad9,_0x93e7bb){const _0x4de42e=_0x16e15d,{head:_0x3a2066,items:_0x2e3476}=readLog(_0x5575b4,_0x2bcad9,_0x93e7bb);return{'head':_0x3a2066,'items':[..._0x2e3476][_0x4de42e(0x95)]((_0xca77cd,_0x233207)=>_0xca77cd['at']<_0x233207['at']?0x1:-0x1)};},async 'get'(_0x3d5d01){const _0x3f9829=_0x16e15d,_0x16a82f=findRev(_0x5575b4,_0x3d5d01);if(!_0x16a82f)throw new store[(_0x3f9829(0xc3))](_0x3f9829(0xb2)+_0x3d5d01);return _0x16a82f;},async 'readFile'(_0x440b17,_0x2d9c08){const _0x10cc48=_0x16e15d,_0xcbeb6a=await this[_0x10cc48(0xa3)](_0x440b17),_0x48ff7c=_0xcbeb6a[_0x10cc48(0xe0)][_0x2d9c08];if(!_0x48ff7c)throw new store['KtNotFoundError'](_0x2d9c08);const _0x363749=objectPath(_0x5575b4,_0x48ff7c);if(!fs[_0x10cc48(0xa4)](_0x363749))throw new store[(_0x10cc48(0xc3))](_0x2d9c08);return new Uint8Array(fs[_0x10cc48(0xe8)](_0x363749));},async 'commit'(_0x1b7041){const _0x1364e0=_0x16e15d;let _0x444bb0=_0x1b7041['files'];if(!_0x444bb0){const _0x463162=await _0x3a218b[_0x1364e0(0xa3)](_0x1b7041['id']);_0x444bb0=store['artifactToFiles'](_0x463162);}const _0x2db435={},_0x57c259={};for(const [_0x444107,_0x3466be]of Object[_0x1364e0(0xe2)](_0x444bb0)){const _0x51378d=typeof _0x3466be===_0x1364e0(0xa1)?_0x3466be:new TextDecoder()[_0x1364e0(0xe3)](_0x3466be);_0x2db435[_0x444107]=_0x51378d,_0x57c259[_0x444107]=writeObject(_0x5575b4,typeof _0x3466be===_0x1364e0(0xa1)?Buffer[_0x1364e0(0xca)](_0x3466be,_0x1364e0(0xd2)):_0x3466be);}const _0x227af9=readLog(_0x5575b4,_0x1b7041['kind'],_0x1b7041['id']);if(_0x227af9[_0x1364e0(0xc6)]){const _0x5b24fd=_0x227af9[_0x1364e0(0xd8)][_0x1364e0(0xeb)](_0x2f5079=>_0x2f5079[_0x1364e0(0xec)]===_0x227af9[_0x1364e0(0xc6)]);if(_0x5b24fd&&store[_0x1364e0(0xcd)](_0x2db435,filesTextOf(_0x5575b4,_0x5b24fd)))return _0x5b24fd;}const _0x138bf3=new Date(),_0x3c4596=String(_0x138bf3[_0x1364e0(0xaa)]())[_0x1364e0(0xac)](0x2)+String(_0x138bf3[_0x1364e0(0xcc)]()+0x1)[_0x1364e0(0xbf)](0x2,'0')+String(_0x138bf3[_0x1364e0(0xa2)]())[_0x1364e0(0xbf)](0x2,'0')+String(_0x138bf3[_0x1364e0(0xee)]())[_0x1364e0(0xbf)](0x2,'0')+String(_0x138bf3[_0x1364e0(0xa0)]())[_0x1364e0(0xbf)](0x2,'0'),_0x208f78=sha256Hex(Object[_0x1364e0(0xda)](_0x57c259)[_0x1364e0(0x95)]()[_0x1364e0(0xe7)](','))[_0x1364e0(0xac)](0x0,0x8),_0x4af3b9={'rev':_0x3c4596+_0x1364e0(0xe5)+_0x208f78,'kind':_0x1b7041[_0x1364e0(0x9a)],'id':_0x1b7041['id'],'at':_0x138bf3[_0x1364e0(0xb8)](),'parent':_0x227af9['head'],'by':_0x1b7041['by'],'note':_0x1b7041[_0x1364e0(0xce)],'files':_0x57c259,'meta':_0x1b7041[_0x1364e0(0xe1)]};return writeLog(_0x5575b4,_0x1b7041[_0x1364e0(0x9a)],_0x1b7041['id'],_0x4af3b9['rev'],[..._0x227af9[_0x1364e0(0xd8)],_0x4af3b9]),_0x4af3b9;},async 'restore'(_0x3c2ffe,_0x989fb9,_0x40f515,_0x18e2c2){const _0x3b02b8=_0x16e15d,_0x58fa93=await this['get'](_0x40f515),_0x43665e={};for(const _0x48fa4a of Object[_0x3b02b8(0xbd)](_0x58fa93[_0x3b02b8(0xe0)])){_0x43665e[_0x48fa4a]=new TextDecoder()['decode'](await this[_0x3b02b8(0x93)](_0x40f515,_0x48fa4a));}const _0x39a867=store[_0x3b02b8(0xa7)](_0x43665e,_0x989fb9);return await _0x3a218b[_0x3b02b8(0xb7)]({..._0x39a867,'id':_0x989fb9,'kind':_0x39a867[_0x3b02b8(0x9a)],'etag':void 0x0}),this[_0x3b02b8(0x8f)]({'kind':_0x3c2ffe,'id':_0x989fb9,'files':_0x43665e,'by':_0x18e2c2,'note':_0x3b02b8(0xc7)+_0x40f515});}};}function createKtFsStores(_0x26f54e){const _0x4fdfe0=_0x5e8a4f,_0x1183d9=createFsArtifactStore(resolveRoot(_0x26f54e[_0x4fdfe0(0xa5)],_0x26f54e[_0x4fdfe0(0xe6)]),_0x26f54e[_0x4fdfe0(0xb4)]),_0x20d7f6=_0x26f54e[_0x4fdfe0(0xd4)]?createFsInstanceStore(resolveRoot(_0x26f54e[_0x4fdfe0(0xd4)],_0x26f54e[_0x4fdfe0(0xe6)]),_0x26f54e[_0x4fdfe0(0xde)]):void 0x0,_0x24bde0=_0x26f54e['versionsRoot']?createFsVersionStore(resolveRoot(_0x26f54e[_0x4fdfe0(0xbe)],_0x26f54e['cwd']),_0x1183d9):void 0x0;return{'artifacts':_0x1183d9,'instances':_0x20d7f6,'versions':_0x24bde0};}exports[_0x5e8a4f(0xa9)]=createKtFsStores;
|
package/dist/fs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3e87bf,_0x5e8de0){const _0x5de8a6=_0x4a51,_0x27d363=_0x3e87bf();while(!![]){try{const _0x382759=-parseInt(_0x5de8a6(0x192))/0x1+-parseInt(_0x5de8a6(0x1af))/0x2+-parseInt(_0x5de8a6(0x1ab))/0x3+parseInt(_0x5de8a6(0x193))/0x4*(-parseInt(_0x5de8a6(0x1cb))/0x5)+parseInt(_0x5de8a6(0x1b4))/0x6*(parseInt(_0x5de8a6(0x1c5))/0x7)+parseInt(_0x5de8a6(0x1ae))/0x8*(parseInt(_0x5de8a6(0x1aa))/0x9)+parseInt(_0x5de8a6(0x1b1))/0xa;if(_0x382759===_0x5e8de0)break;else _0x27d363['push'](_0x27d363['shift']());}catch(_0x165012){_0x27d363['push'](_0x27d363['shift']());}}}(_0xcbbb,0xe1764));function _0xcbbb(){const _0xe66db6=['C2vLzeLUC3rHBMnLCW','DgfIq29TBw9U','AM9PBG','Agv4','zMLUza','zMLSDgvY','Bwv0yq','lMv0ywC','zxrHzW','Aw5ZDgfUy2vZuM9VDa','DxbKyxrL','sevbra','z2v0rNvSBfLLyxi','BM90zq','yxj0AwzHy3qG','zgLNzxn0','C3rYAw5NAwz5','yxj0AwzHy3rjza','y29TBw9U','zNjVBq','ota2ndHJAuvyD0W','mtC3ndu5oxH2BNHWAq','5OgI5Asn6iEQia','BwfW','nZy4s0Ljy1nr','mJK1mJm0mhvvq291yG','DxrMoa','mJG3mte3nZbUu0DfC20','z2v0rgf0zq','BMfTzq','mJCZndK4zuvVDgXp','C2XPy2u','BM93','zgvJB2rL','CMv2','zMLSzxm','CMfUzg9T','lwXVy2fSlq','yxj0AwzHy3rZuM9VDa','DMfSDwvZ','z2v0twLUDxrLCW','AxneAxjLy3rVCNK','A2v5CW','Dg9ju09tDhjPBMC','zMfJzxm','z2v0sg91CNm','B2jQzwn0CW','nJnss1r6CKy','Dg9tDhjPBMC','Bg9NlMPZB24','z2v0','C2f2zq','CMv2ia','ndb2tNn5wMy','zw50CMLLCW','C2vLza','CgfKu3rHCNq','ChvZAa','y3DK','Aw5ZDgfUy2uG','C2HHmJu2','CgfYC2u','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','AxrLBxm','A2LUza','C3rYAw5N','C29YDa','mJiYntmZAfHWsNfL','nte3mZa0tLPhA3rv','AgvHza','z2v0tw9UDgG'];_0xcbbb=function(){return _0xe66db6;};return _0xcbbb();}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(_0x158950,_0x4db5f0=process['cwd']()){const _0x12e773=isAbsolute(_0x158950)?_0x158950:resolve(_0x4db5f0,_0x158950);return mkdirSync(_0x12e773,{'recursive':!![]}),_0x12e773;}function artifactDir(_0x57a121,_0x254eb4){return join(_0x57a121,_0x254eb4);}function objectPath(_0x4ab7de,_0xf727dc){const _0x1a3af8=_0x4a51;return join(_0x4ab7de,_0x1a3af8(0x1c4),_0xf727dc[_0x1a3af8(0x1b5)](0x0,0x2),_0xf727dc);}function itemDir(_0x21061e,_0x10a742,_0x110928){const _0x22854b=_0x4a51;return join(_0x21061e,_0x22854b(0x18e),_0x10a742,_0x110928);}function newEtag(){const _0x2e6150=_0x4a51;return Date[_0x2e6150(0x1b6)]()[_0x2e6150(0x1c6)](0x24)+'-'+Math[_0x2e6150(0x1ba)]()[_0x2e6150(0x1c6)](0x24)[_0x2e6150(0x1b5)](0x2,0x8);}function readEtag(_0x24ddf7){const _0x20c691=_0x4a51,_0x86fc6d=join(_0x24ddf7,'.etag');return existsSync(_0x86fc6d)?readFileSync(_0x86fc6d,_0x20c691(0x1b0))['trim']():void 0x0;}function writeArtifactDir(_0x445d5e,_0x550de7,_0x4a9552){const _0x986aff=_0x4a51;mkdirSync(join(_0x445d5e,_0x986aff(0x1c2)),{'recursive':!![]});const _0x14ea54=artifactToFiles(_0x550de7);writeFileSync(join(_0x445d5e,ARTIFACT_FILE_META),_0x14ea54[ARTIFACT_FILE_META]??'{}',_0x986aff(0x1b0)),writeFileSync(join(_0x445d5e,ARTIFACT_FILE_BODY),_0x14ea54[ARTIFACT_FILE_BODY]??'',_0x986aff(0x1b0));const _0xc86a8e=join(_0x445d5e,ARTIFACT_FILE_FILL),_0x37ccb5=join(_0x445d5e,ARTIFACT_FILE_REPORT);if(_0x14ea54[ARTIFACT_FILE_FILL])writeFileSync(_0xc86a8e,_0x14ea54[ARTIFACT_FILE_FILL],_0x986aff(0x1b0));else{if(existsSync(_0xc86a8e))rmSync(_0xc86a8e);}if(_0x14ea54[ARTIFACT_FILE_REPORT])writeFileSync(_0x37ccb5,_0x14ea54[ARTIFACT_FILE_REPORT],'utf8');else{if(existsSync(_0x37ccb5))rmSync(_0x37ccb5);}writeFileSync(join(_0x445d5e,_0x986aff(0x19d)),_0x4a9552,_0x986aff(0x1b0));}function readArtifactDir(_0x1c3572,_0x59a882){const _0x555911=_0x4a51,_0x4a1357={},_0x58f8a6=join(_0x1c3572,ARTIFACT_FILE_META),_0x42d24e=join(_0x1c3572,ARTIFACT_FILE_BODY);if(existsSync(_0x58f8a6))_0x4a1357[ARTIFACT_FILE_META]=readFileSync(_0x58f8a6,_0x555911(0x1b0));if(existsSync(_0x42d24e))_0x4a1357[ARTIFACT_FILE_BODY]=readFileSync(_0x42d24e,_0x555911(0x1b0));const _0x37c397=join(_0x1c3572,ARTIFACT_FILE_FILL),_0x111c4f=join(_0x1c3572,ARTIFACT_FILE_REPORT);if(existsSync(_0x37c397))_0x4a1357[ARTIFACT_FILE_FILL]=readFileSync(_0x37c397,_0x555911(0x1b0));if(existsSync(_0x111c4f))_0x4a1357[ARTIFACT_FILE_REPORT]=readFileSync(_0x111c4f,_0x555911(0x1b0));return{...filesToArtifact(_0x4a1357,_0x59a882),'etag':readEtag(_0x1c3572)};}function createFsArtifactStore(_0x38df4e,_0x55a80b=[]){mkdirSync(_0x38df4e,{'recursive':!![]});for(const _0x4808d8 of _0x55a80b){const _0x413625=artifactDir(_0x38df4e,_0x4808d8['id']),_0x344fa2=join(_0x413625,ARTIFACT_FILE_BODY);if(!existsSync(_0x344fa2))writeArtifactDir(_0x413625,_0x4808d8,_0x4808d8['etag']??newEtag());}return{async 'list'(_0x131281){const _0x2a7459=_0x4a51;if(!existsSync(_0x38df4e))return[];const _0x2a2c8a=[];for(const _0x275fba of readdirSync(_0x38df4e,{'withFileTypes':!![]})){if(!_0x275fba[_0x2a7459(0x1bf)]())continue;try{const _0x1c5141=readArtifactDir(artifactDir(_0x38df4e,_0x275fba[_0x2a7459(0x1b3)]),_0x275fba[_0x2a7459(0x1b3)]);if(!_0x131281||_0x1c5141['kind']===_0x131281)_0x2a2c8a[_0x2a7459(0x1cf)]({'id':_0x1c5141['id'],'name':_0x1c5141[_0x2a7459(0x1b3)],'kind':_0x1c5141[_0x2a7459(0x18f)]});}catch{}}return _0x2a2c8a;},async 'get'(_0x54c0a0){const _0x39258b=_0x4a51,_0x5751bb=artifactDir(_0x38df4e,_0x54c0a0);if(!existsSync(_0x5751bb))throw new KtNotFoundError(_0x39258b(0x1a4)+_0x54c0a0);return readArtifactDir(_0x5751bb,_0x54c0a0);},async 'save'(_0x1c1c22){const _0xb107ed=_0x4a51,_0x21dd54=artifactDir(_0x38df4e,_0x1c1c22['id']),_0xb87e13=existsSync(_0x21dd54)?readArtifactDir(_0x21dd54,_0x1c1c22['id']):void 0x0;if(_0x1c1c22[_0xb107ed(0x19e)]&&_0xb87e13?.[_0xb107ed(0x19e)]&&_0x1c1c22[_0xb107ed(0x19e)]!==_0xb87e13[_0xb107ed(0x19e)])throw new KtConflictError(_0xb107ed(0x18d),_0xb87e13);const _0x4ff33e=newEtag();return writeArtifactDir(_0x21dd54,_0x1c1c22,_0x4ff33e),{..._0x1c1c22,'etag':_0x4ff33e};},async 'create'(_0x26fabe){const _0x1c87df=_0x4a51,_0x9ee860=_0x26fabe[_0x1c87df(0x18f)]+'-'+Math[_0x1c87df(0x1ba)]()[_0x1c87df(0x1c6)](0x24)[_0x1c87df(0x1b5)](0x2,0xa),_0x522280={'id':_0x9ee860,'name':_0x26fabe['name'],'kind':_0x26fabe[_0x1c87df(0x18f)],'ktl':EMPTY_KTL};return this[_0x1c87df(0x1c9)](_0x522280);},async 'remove'(_0x1653b8){const _0xbc3fc0=_0x4a51,_0x73c630=artifactDir(_0x38df4e,_0x1653b8);if(!existsSync(_0x73c630))throw new KtNotFoundError(_0xbc3fc0(0x1a4)+_0x1653b8);rmSync(_0x73c630,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x23edc9,_0x17acba={}){const _0x1630f5=_0x4a51;mkdirSync(_0x23edc9,{'recursive':!![]});const _0x2bffa7=_0x1d47be=>join(_0x23edc9,_0x1d47be+'.json');for(const [_0x4ecf5b,_0x20a524]of Object[_0x1630f5(0x1cc)](_0x17acba)){if(!existsSync(_0x2bffa7(_0x4ecf5b)))writeFileSync(_0x2bffa7(_0x4ecf5b),JSON[_0x1630f5(0x1a6)](_0x20a524,null,0x2),_0x1630f5(0x1b0));}return{async 'get'(_0x16d297){const _0x27595a=_0x1630f5,_0x25afe8=_0x2bffa7(_0x16d297);if(!existsSync(_0x25afe8))throw new KtNotFoundError(_0x27595a(0x18a)+_0x16d297);return JSON[_0x27595a(0x18c)](readFileSync(_0x25afe8,_0x27595a(0x1b0)));},async 'save'(_0x32b7f4,_0x7df401){const _0x4fda44=_0x1630f5,_0x395aa0=_0x2bffa7(_0x32b7f4),_0x6b617c=existsSync(_0x395aa0)?JSON[_0x4fda44(0x18c)](readFileSync(_0x395aa0,_0x4fda44(0x1b0))):{'artifactId':'','values':{}},_0x5f130b={'artifactId':_0x6b617c['artifactId'],'values':{..._0x6b617c[_0x4fda44(0x1bd)],..._0x7df401['values']},'common':{..._0x6b617c[_0x4fda44(0x1a8)],..._0x7df401[_0x4fda44(0x1a8)]},'tabCommon':{..._0x6b617c[_0x4fda44(0x197)],..._0x7df401[_0x4fda44(0x197)]}};writeFileSync(_0x395aa0,JSON[_0x4fda44(0x1a6)](_0x5f130b,null,0x2),_0x4fda44(0x1b0));},async 'list'(_0x4c28ce){const _0x308d0a=_0x1630f5;return readdirSync(_0x23edc9)[_0x308d0a(0x19b)](_0x39d463=>_0x39d463['endsWith']('.json'))[_0x308d0a(0x1ad)](_0x330393=>{const _0x470f86=_0x308d0a,_0x124352=_0x330393[_0x470f86(0x1b5)](0x0,-0x5),_0xb77a52=JSON[_0x470f86(0x18c)](readFileSync(join(_0x23edc9,_0x330393),_0x470f86(0x1b0)));return{'id':_0x124352,'artifactId':_0xb77a52[_0x470f86(0x1a7)]};})[_0x308d0a(0x19b)](_0x1fcded=>!_0x4c28ce||_0x1fcded['artifactId']===_0x4c28ce);},async 'create'(_0x21d7fc){const _0x3a5157=_0x1630f5,_0x3bbb8b='inst-'+Math[_0x3a5157(0x1ba)]()[_0x3a5157(0x1c6)](0x24)[_0x3a5157(0x1b5)](0x2,0xa);return writeFileSync(_0x2bffa7(_0x3bbb8b),JSON['stringify']({'artifactId':_0x21d7fc[_0x3a5157(0x1a7)],'values':{},'common':{}},null,0x2),'utf8'),{'id':_0x3bbb8b};}};}function sha256Hex(_0x3b7cee){const _0x2c903f=_0x4a51,_0x4374c1=typeof _0x3b7cee==='string'?Buffer[_0x2c903f(0x1a9)](_0x3b7cee,_0x2c903f(0x1b0)):Buffer['from'](_0x3b7cee);return createHash(_0x2c903f(0x18b))[_0x2c903f(0x1a0)](_0x4374c1)[_0x2c903f(0x1a5)](_0x2c903f(0x199));}function writeObject(_0x59384b,_0x22c836){const _0x31b9de=sha256Hex(_0x22c836),_0x332ee8=objectPath(_0x59384b,_0x31b9de);mkdirSync(dirname(_0x332ee8),{'recursive':!![]});if(!existsSync(_0x332ee8))writeFileSync(_0x332ee8,_0x22c836);return _0x31b9de;}function readLog(_0x394894,_0x11e30f,_0x35e5f2){const _0x349c17=_0x4a51,_0x132257=itemDir(_0x394894,_0x11e30f,_0x35e5f2),_0x54c721=join(_0x132257,_0x349c17(0x1c7)),_0x3ec852=join(_0x132257,_0x349c17(0x1a1)),_0x5893c6=existsSync(_0x54c721)?JSON[_0x349c17(0x18c)](readFileSync(_0x54c721,'utf8')):[],_0x28867a=existsSync(_0x3ec852)?readFileSync(_0x3ec852,'utf8')['trim']():_0x5893c6['at'](-0x1)?.[_0x349c17(0x1b8)]??null;return{'head':_0x28867a,'items':_0x5893c6};}function _0x4a51(_0x5aca6c,_0x5b8d99){_0x5aca6c=_0x5aca6c-0x18a;const _0xcbbbd5=_0xcbbb();let _0x4a5139=_0xcbbbd5[_0x5aca6c];if(_0x4a51['extYxb']===undefined){var _0x15bf4e=function(_0x4c53b3){const _0x551fb9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4564f6='',_0x158950='';for(let _0x4db5f0=0x0,_0x12e773,_0x57a121,_0x254eb4=0x0;_0x57a121=_0x4c53b3['charAt'](_0x254eb4++);~_0x57a121&&(_0x12e773=_0x4db5f0%0x4?_0x12e773*0x40+_0x57a121:_0x57a121,_0x4db5f0++%0x4)?_0x4564f6+=String['fromCharCode'](0xff&_0x12e773>>(-0x2*_0x4db5f0&0x6)):0x0){_0x57a121=_0x551fb9['indexOf'](_0x57a121);}for(let _0x4ab7de=0x0,_0xf727dc=_0x4564f6['length'];_0x4ab7de<_0xf727dc;_0x4ab7de++){_0x158950+='%'+('00'+_0x4564f6['charCodeAt'](_0x4ab7de)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x158950);};_0x4a51['koyQHq']=_0x15bf4e,_0x4a51['BqDZRQ']={},_0x4a51['extYxb']=!![];}const _0x1da9ff=_0xcbbbd5[0x0];_0x4a51['JdnUjD']!==_0x1da9ff&&(_0x4a51['BqDZRQ']={},_0x4a51['JdnUjD']=_0x1da9ff);const _0x1eaf24=_0x4a51['BqDZRQ'][_0x5aca6c];return _0x1eaf24===undefined?(_0x4a5139=_0x4a51['koyQHq'](_0x4a5139),_0x4a51['BqDZRQ'][_0x5aca6c]=_0x4a5139):_0x4a5139=_0x1eaf24,_0x4a5139;}function writeLog(_0x5924a2,_0x2b3bc6,_0x5752eb,_0x16c792,_0x2e20a0){const _0x1a503f=_0x4a51,_0x2ed130=itemDir(_0x5924a2,_0x2b3bc6,_0x5752eb);mkdirSync(_0x2ed130,{'recursive':!![]}),writeFileSync(join(_0x2ed130,'log.json'),JSON['stringify'](_0x2e20a0,null,0x2),'utf8'),writeFileSync(join(_0x2ed130,_0x1a503f(0x1a1)),_0x16c792+'\x0a','utf8');}function findRev(_0x5eada4,_0x59c566){const _0x2d9660=_0x4a51,_0x1a8587=join(_0x5eada4,_0x2d9660(0x18e));if(!existsSync(_0x1a8587))return void 0x0;for(const _0x5061c0 of readdirSync(_0x1a8587,{'withFileTypes':!![]})){if(!_0x5061c0[_0x2d9660(0x1bf)]())continue;for(const _0x97a4eb of readdirSync(join(_0x1a8587,_0x5061c0[_0x2d9660(0x1b3)]),{'withFileTypes':!![]})){if(!_0x97a4eb[_0x2d9660(0x1bf)]())continue;const _0x65be25=readLog(_0x5eada4,_0x5061c0[_0x2d9660(0x1b3)],_0x97a4eb[_0x2d9660(0x1b3)])[_0x2d9660(0x18e)][_0x2d9660(0x19a)](_0x58d634=>_0x58d634[_0x2d9660(0x1b8)]===_0x59c566);if(_0x65be25)return _0x65be25;}}return void 0x0;}function filesTextOf(_0x404327,_0x3beca3){const _0xb0a063=_0x4a51,_0x38284c={};for(const [_0x402a55,_0x4f55b6]of Object['entries'](_0x3beca3[_0xb0a063(0x1b9)])){const _0x2302bc=objectPath(_0x404327,_0x4f55b6);if(existsSync(_0x2302bc))_0x38284c[_0x402a55]=readFileSync(_0x2302bc,_0xb0a063(0x1b0));}return _0x38284c;}function createFsVersionStore(_0x2bee1f,_0x1e1604){return mkdirSync(_0x2bee1f,{'recursive':!![]}),{async 'log'(_0x56aeab,_0x438e08){const {head:_0x386cd8,items:_0x162cb8}=readLog(_0x2bee1f,_0x56aeab,_0x438e08);return{'head':_0x386cd8,'items':[..._0x162cb8]['sort']((_0xd2611b,_0x5ace1a)=>_0xd2611b['at']<_0x5ace1a['at']?0x1:-0x1)};},async 'get'(_0x32f611){const _0x875ecc=_0x4a51,_0x59450d=findRev(_0x2bee1f,_0x32f611);if(!_0x59450d)throw new KtNotFoundError(_0x875ecc(0x1ca)+_0x32f611);return _0x59450d;},async 'readFile'(_0x2c2263,_0x37834b){const _0x2f694e=_0x4a51,_0x24505e=await this[_0x2f694e(0x1c8)](_0x2c2263),_0x4350cc=_0x24505e[_0x2f694e(0x1b9)][_0x37834b];if(!_0x4350cc)throw new KtNotFoundError(_0x37834b);const _0x4bcda2=objectPath(_0x2bee1f,_0x4350cc);if(!existsSync(_0x4bcda2))throw new KtNotFoundError(_0x37834b);return new Uint8Array(readFileSync(_0x4bcda2));},async 'commit'(_0x41947){const _0x7d09e8=_0x4a51;let _0x9f9e8d=_0x41947['files'];if(!_0x9f9e8d){const _0x24e96a=await _0x1e1604[_0x7d09e8(0x1c8)](_0x41947['id']);_0x9f9e8d=artifactToFiles(_0x24e96a);}const _0x526582={},_0x20261b={};for(const [_0x4124a5,_0x1cd9ff]of Object[_0x7d09e8(0x1cc)](_0x9f9e8d)){const _0x4a3390=typeof _0x1cd9ff===_0x7d09e8(0x190)?_0x1cd9ff:new TextDecoder()[_0x7d09e8(0x1b7)](_0x1cd9ff);_0x526582[_0x4124a5]=_0x4a3390,_0x20261b[_0x4124a5]=writeObject(_0x2bee1f,typeof _0x1cd9ff==='string'?Buffer[_0x7d09e8(0x1a9)](_0x1cd9ff,_0x7d09e8(0x1b0)):_0x1cd9ff);}const _0x18437b=readLog(_0x2bee1f,_0x41947['kind'],_0x41947['id']);if(_0x18437b[_0x7d09e8(0x194)]){const _0x4b3423=_0x18437b['items'][_0x7d09e8(0x19a)](_0x373b61=>_0x373b61[_0x7d09e8(0x1b8)]===_0x18437b[_0x7d09e8(0x194)]);if(_0x4b3423&&filesEqual(_0x526582,filesTextOf(_0x2bee1f,_0x4b3423)))return _0x4b3423;}const _0x74a136=new Date(),_0xe59fc6=String(_0x74a136[_0x7d09e8(0x1a2)]())['slice'](0x2)+String(_0x74a136[_0x7d09e8(0x195)]()+0x1)[_0x7d09e8(0x1ce)](0x2,'0')+String(_0x74a136[_0x7d09e8(0x1b2)]())['padStart'](0x2,'0')+String(_0x74a136[_0x7d09e8(0x1c3)]())[_0x7d09e8(0x1ce)](0x2,'0')+String(_0x74a136[_0x7d09e8(0x1be)]())[_0x7d09e8(0x1ce)](0x2,'0'),_0x2439b2=sha256Hex(Object[_0x7d09e8(0x1bd)](_0x20261b)[_0x7d09e8(0x191)]()[_0x7d09e8(0x198)](','))['slice'](0x0,0x8),_0x59d605={'rev':_0xe59fc6+_0x7d09e8(0x1bb)+_0x2439b2,'kind':_0x41947[_0x7d09e8(0x18f)],'id':_0x41947['id'],'at':_0x74a136[_0x7d09e8(0x1c1)](),'parent':_0x18437b[_0x7d09e8(0x194)],'by':_0x41947['by'],'note':_0x41947[_0x7d09e8(0x1a3)],'files':_0x20261b,'meta':_0x41947[_0x7d09e8(0x19c)]};return writeLog(_0x2bee1f,_0x41947['kind'],_0x41947['id'],_0x59d605[_0x7d09e8(0x1b8)],[..._0x18437b[_0x7d09e8(0x18e)],_0x59d605]),_0x59d605;},async 'restore'(_0x31b39a,_0x5ba69e,_0x568409,_0x1182ce){const _0x2b0742=_0x4a51,_0x2578f3=await this[_0x2b0742(0x1c8)](_0x568409),_0x146e3b={};for(const _0x30769e of Object[_0x2b0742(0x1c0)](_0x2578f3[_0x2b0742(0x1b9)])){_0x146e3b[_0x30769e]=new TextDecoder()['decode'](await this['readFile'](_0x568409,_0x30769e));}const _0x16dad2=filesToArtifact(_0x146e3b,_0x5ba69e);return await _0x1e1604['save']({..._0x16dad2,'id':_0x5ba69e,'kind':_0x16dad2[_0x2b0742(0x18f)],'etag':void 0x0}),this['commit']({'kind':_0x31b39a,'id':_0x5ba69e,'files':_0x146e3b,'by':_0x1182ce,'note':_0x2b0742(0x1ac)+_0x568409});}};}function createKtFsStores(_0x1f60a4){const _0x3eed57=_0x4a51,_0x4bfe3b=createFsArtifactStore(resolveRoot(_0x1f60a4[_0x3eed57(0x1bc)],_0x1f60a4[_0x3eed57(0x1d0)]),_0x1f60a4[_0x3eed57(0x1cd)]),_0x357daa=_0x1f60a4[_0x3eed57(0x19f)]?createFsInstanceStore(resolveRoot(_0x1f60a4[_0x3eed57(0x19f)],_0x1f60a4[_0x3eed57(0x1d0)]),_0x1f60a4[_0x3eed57(0x196)]):void 0x0,_0x4825e3=_0x1f60a4['versionsRoot']?createFsVersionStore(resolveRoot(_0x1f60a4['versionsRoot'],_0x1f60a4[_0x3eed57(0x1d0)]),_0x4bfe3b):void 0x0;return{'artifacts':_0x4bfe3b,'instances':_0x357daa,'versions':_0x4825e3};}export{createKtFsStores};
|
|
1
|
+
const _0x2a8a16=_0x3162;(function(_0x435736,_0x15def6){const _0x3e1066=_0x3162,_0x5e580b=_0x435736();while(!![]){try{const _0x38db8e=-parseInt(_0x3e1066(0x135))/0x1*(-parseInt(_0x3e1066(0xf3))/0x2)+parseInt(_0x3e1066(0x106))/0x3+-parseInt(_0x3e1066(0x131))/0x4*(parseInt(_0x3e1066(0xf9))/0x5)+-parseInt(_0x3e1066(0x10d))/0x6*(parseInt(_0x3e1066(0xf5))/0x7)+-parseInt(_0x3e1066(0x11e))/0x8+parseInt(_0x3e1066(0x130))/0x9*(-parseInt(_0x3e1066(0x126))/0xa)+parseInt(_0x3e1066(0xf8))/0xb;if(_0x38db8e===_0x15def6)break;else _0x5e580b['push'](_0x5e580b['shift']());}catch(_0x5a82a0){_0x5e580b['push'](_0x5e580b['shift']());}}}(_0xc1d1,0xd7cad));import{mkdirSync,existsSync,rmSync,readdirSync,writeFileSync,readFileSync}from'fs';function _0xc1d1(){const _0x2366dd=['zNjVBq','otqWmJmYuhnVt1HL','CMvHzezPBgu','y29TBwL0','BwfW','C2f2zq','z2v0twLUDxrLCW','yxj0AwzHy3qG','zMfJzxm','mtKZnZCZmerJqw1jzq','z2v0rgf0zq','sevbra','AxneAxjLy3rVCNK','lMPZB24','Aw5ZDgfUy2vZuM9VDa','DhjPBq','C2HHmJu2','DxbKyxrL','zgLNzxn0','oxvqsvPKyG','nta1ndHPExL3vwe','lMv0ywC','BM90zq','zMLSDgvY','mJnzEKfXs08','Bg9NlMPZB24','yxj0AwzHy3rZuM9VDa','BMfTzq','zw50CMLLCW','Dg9tDhjPBMC','nJG1mZr0A1LWrxm','Agv4','ndL2EvvkwMy','zMLUza','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','mZKWnJG3mePjtK9Xva','mZb2CLPty2y','C3rYAw5NAwz5','zMLSzxm','y3DK','AxrLBxm','C2XPy2u','C2vLza','CMv2','z2v0sg91CNm','DxrMoa','Aw5ZDc0','5OgI5Asn6iEQia','AgvHza','mtiXotm3n2XJuvH3Ba','C2vLzeLUC3rHBMnLCW','Dg9ju09tDhjPBMC','Bwv0yq','DMfSDwvZ','zxrHzW','zw5KC1DPDgG','mJm4otm4BgD1vwDW','zgvJB2rL','A2LUza','z2v0tw9UDgG','C29YDa','z2v0rNvSBfLLyxi','yxj0AwzHy3rjza','z2v0','CgfKu3rHCNq','C3rYAw5N','CgfYC2u','B2jQzwn0CW','DMvYC2LVBNnsB290','DgfIq29TBw9U','CMfUzg9T','y29TBw9U'];_0xc1d1=function(){return _0x2366dd;};return _0xc1d1();}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(_0x4fa984,_0x1330ff=process[_0x2a8a16(0xfc)]()){const _0x218151=isAbsolute(_0x4fa984)?_0x4fa984:resolve(_0x1330ff,_0x4fa984);return mkdirSync(_0x218151,{'recursive':!![]}),_0x218151;}function artifactDir(_0x4fa5d6,_0x1402a2){return join(_0x4fa5d6,_0x1402a2);}function objectPath(_0x423327,_0x3137e9){const _0x40c4bc=_0x2a8a16;return join(_0x423327,_0x40c4bc(0x118),_0x3137e9[_0x40c4bc(0xfe)](0x0,0x2),_0x3137e9);}function itemDir(_0x41646a,_0x2c09da,_0x3f0c20){const _0x5433a8=_0x2a8a16;return join(_0x41646a,_0x5433a8(0xfd),_0x2c09da,_0x3f0c20);}function newEtag(){const _0x324132=_0x2a8a16;return Date['now']()[_0x324132(0xf2)](0x24)+'-'+Math[_0x324132(0x11b)]()[_0x324132(0xf2)](0x24)['slice'](0x2,0x8);}function readEtag(_0x391236){const _0x340f23=_0x2a8a16,_0x386ad6=join(_0x391236,_0x340f23(0x132));return existsSync(_0x386ad6)?readFileSync(_0x386ad6,_0x340f23(0x102))[_0x340f23(0x12c)]():void 0x0;}function writeArtifactDir(_0x77ec67,_0x22976d,_0x134964){const _0x2238d8=_0x2a8a16;mkdirSync(join(_0x77ec67,_0x2238d8(0x125)),{'recursive':!![]});const _0x2f0f22=artifactToFiles(_0x22976d);writeFileSync(join(_0x77ec67,ARTIFACT_FILE_META),_0x2f0f22[ARTIFACT_FILE_META]??'{}',_0x2238d8(0x102)),writeFileSync(join(_0x77ec67,ARTIFACT_FILE_BODY),_0x2f0f22[ARTIFACT_FILE_BODY]??'',_0x2238d8(0x102));const _0xb4fc5e=join(_0x77ec67,ARTIFACT_FILE_FILL),_0x596c93=join(_0x77ec67,ARTIFACT_FILE_REPORT);if(_0x2f0f22[ARTIFACT_FILE_FILL])writeFileSync(_0xb4fc5e,_0x2f0f22[ARTIFACT_FILE_FILL],'utf8');else{if(existsSync(_0xb4fc5e))rmSync(_0xb4fc5e);}if(_0x2f0f22[ARTIFACT_FILE_REPORT])writeFileSync(_0x596c93,_0x2f0f22[ARTIFACT_FILE_REPORT],_0x2238d8(0x102));else{if(existsSync(_0x596c93))rmSync(_0x596c93);}writeFileSync(join(_0x77ec67,_0x2238d8(0x132)),_0x134964,_0x2238d8(0x102));}function readArtifactDir(_0x1d7bdf,_0x3fc68a){const _0x1f8b81=_0x2a8a16,_0x34267a={},_0x1cd7e3=join(_0x1d7bdf,ARTIFACT_FILE_META),_0x6b50cb=join(_0x1d7bdf,ARTIFACT_FILE_BODY);if(existsSync(_0x1cd7e3))_0x34267a[ARTIFACT_FILE_META]=readFileSync(_0x1cd7e3,_0x1f8b81(0x102));if(existsSync(_0x6b50cb))_0x34267a[ARTIFACT_FILE_BODY]=readFileSync(_0x6b50cb,_0x1f8b81(0x102));const _0x5b425a=join(_0x1d7bdf,ARTIFACT_FILE_FILL),_0x1f3e80=join(_0x1d7bdf,ARTIFACT_FILE_REPORT);if(existsSync(_0x5b425a))_0x34267a[ARTIFACT_FILE_FILL]=readFileSync(_0x5b425a,_0x1f8b81(0x102));if(existsSync(_0x1f3e80))_0x34267a[ARTIFACT_FILE_REPORT]=readFileSync(_0x1f3e80,_0x1f8b81(0x102));return{...filesToArtifact(_0x34267a,_0x3fc68a),'etag':readEtag(_0x1d7bdf)};}function createFsArtifactStore(_0x3337d0,_0x4aeada=[]){mkdirSync(_0x3337d0,{'recursive':!![]});for(const _0x223d1a of _0x4aeada){const _0x26e355=artifactDir(_0x3337d0,_0x223d1a['id']),_0x1f576d=join(_0x26e355,ARTIFACT_FILE_BODY);if(!existsSync(_0x1f576d))writeArtifactDir(_0x26e355,_0x223d1a,_0x223d1a['etag']??newEtag());}return{async 'list'(_0x47ebc7){const _0x549b5f=_0x3162;if(!existsSync(_0x3337d0))return[];const _0x40bb0e=[];for(const _0x44b13e of readdirSync(_0x3337d0,{'withFileTypes':!![]})){if(!_0x44b13e[_0x549b5f(0x129)]())continue;try{const _0x369085=readArtifactDir(artifactDir(_0x3337d0,_0x44b13e[_0x549b5f(0xf0)]),_0x44b13e['name']);if(!_0x47ebc7||_0x369085[_0x549b5f(0x10f)]===_0x47ebc7)_0x40bb0e['push']({'id':_0x369085['id'],'name':_0x369085[_0x549b5f(0xf0)],'kind':_0x369085[_0x549b5f(0x10f)]});}catch{}}return _0x40bb0e;},async 'get'(_0x2c5b5e){const _0x3d8bf4=artifactDir(_0x3337d0,_0x2c5b5e);if(!existsSync(_0x3d8bf4))throw new KtNotFoundError('artifact\x20'+_0x2c5b5e);return readArtifactDir(_0x3d8bf4,_0x2c5b5e);},async 'save'(_0x1682bb){const _0xb44b01=_0x3162,_0xc6fb54=artifactDir(_0x3337d0,_0x1682bb['id']),_0x52d61f=existsSync(_0xc6fb54)?readArtifactDir(_0xc6fb54,_0x1682bb['id']):void 0x0;if(_0x1682bb[_0xb44b01(0x10b)]&&_0x52d61f?.[_0xb44b01(0x10b)]&&_0x1682bb[_0xb44b01(0x10b)]!==_0x52d61f['etag'])throw new KtConflictError(_0xb44b01(0xf7),_0x52d61f);const _0x41f0e3=newEtag();return writeArtifactDir(_0xc6fb54,_0x1682bb,_0x41f0e3),{..._0x1682bb,'etag':_0x41f0e3};},async 'create'(_0x1a4343){const _0x2e2670=_0x3162,_0x5aff1d=_0x1a4343[_0x2e2670(0x10f)]+'-'+Math[_0x2e2670(0x11b)]()[_0x2e2670(0xf2)](0x24)[_0x2e2670(0xfe)](0x2,0xa),_0x3a9a2a={'id':_0x5aff1d,'name':_0x1a4343[_0x2e2670(0xf0)],'kind':_0x1a4343[_0x2e2670(0x10f)],'ktl':EMPTY_KTL};return this[_0x2e2670(0x122)](_0x3a9a2a);},async 'remove'(_0x290bc2){const _0x61745b=_0x3162,_0x52d0be=artifactDir(_0x3337d0,_0x290bc2);if(!existsSync(_0x52d0be))throw new KtNotFoundError(_0x61745b(0x124)+_0x290bc2);rmSync(_0x52d0be,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x4586ff,_0x3e8c3d={}){const _0x2ca557=_0x2a8a16;mkdirSync(_0x4586ff,{'recursive':!![]});const _0x7a9ba5=_0x4f1692=>join(_0x4586ff,_0x4f1692+_0x2ca557(0x12a));for(const [_0x22279f,_0x36ac85]of Object[_0x2ca557(0xf1)](_0x3e8c3d)){if(!existsSync(_0x7a9ba5(_0x22279f)))writeFileSync(_0x7a9ba5(_0x22279f),JSON['stringify'](_0x36ac85,null,0x2),_0x2ca557(0x102));}return{async 'get'(_0x562fc3){const _0xe17c26=_0x2ca557,_0x2fd489=_0x7a9ba5(_0x562fc3);if(!existsSync(_0x2fd489))throw new KtNotFoundError('instance\x20'+_0x562fc3);return JSON[_0xe17c26(0x117)](readFileSync(_0x2fd489,_0xe17c26(0x102)));},async 'save'(_0x3a5287,_0x4404c1){const _0x363285=_0x2ca557,_0x2e68d0=_0x7a9ba5(_0x3a5287),_0x4fa53f=existsSync(_0x2e68d0)?JSON[_0x363285(0x117)](readFileSync(_0x2e68d0,_0x363285(0x102))):{'artifactId':'','values':{}},_0x469d65={'artifactId':_0x4fa53f[_0x363285(0x113)],'values':{..._0x4fa53f['values'],..._0x4404c1[_0x363285(0x10a)]},'common':{..._0x4fa53f[_0x363285(0x11c)],..._0x4404c1[_0x363285(0x11c)]},'tabCommon':{..._0x4fa53f[_0x363285(0x11a)],..._0x4404c1['tabCommon']}};writeFileSync(_0x2e68d0,JSON[_0x363285(0xfa)](_0x469d65,null,0x2),_0x363285(0x102));},async 'list'(_0x143656){const _0x151adb=_0x2ca557;return readdirSync(_0x4586ff)[_0x151adb(0x134)](_0x44e41d=>_0x44e41d[_0x151adb(0x10c)](_0x151adb(0x12a)))[_0x151adb(0x121)](_0x3fb1ea=>{const _0x1d4fa5=_0x151adb,_0x28f073=_0x3fb1ea[_0x1d4fa5(0xfe)](0x0,-0x5),_0x4a3538=JSON['parse'](readFileSync(join(_0x4586ff,_0x3fb1ea),_0x1d4fa5(0x102)));return{'id':_0x28f073,'artifactId':_0x4a3538[_0x1d4fa5(0x113)]};})[_0x151adb(0x134)](_0x19ff64=>!_0x143656||_0x19ff64['artifactId']===_0x143656);},async 'create'(_0x21c26a){const _0x35c0d3=_0x2ca557,_0x167628=_0x35c0d3(0x103)+Math[_0x35c0d3(0x11b)]()['toString'](0x24)[_0x35c0d3(0xfe)](0x2,0xa);return writeFileSync(_0x7a9ba5(_0x167628),JSON[_0x35c0d3(0xfa)]({'artifactId':_0x21c26a[_0x35c0d3(0x113)],'values':{},'common':{}},null,0x2),_0x35c0d3(0x102)),{'id':_0x167628};}};}function sha256Hex(_0x4b085a){const _0x522b65=_0x2a8a16,_0x29e939=typeof _0x4b085a===_0x522b65(0x116)?Buffer[_0x522b65(0x11d)](_0x4b085a,'utf8'):Buffer[_0x522b65(0x11d)](_0x4b085a);return createHash(_0x522b65(0x12d))[_0x522b65(0x12e)](_0x29e939)[_0x522b65(0x12f)](_0x522b65(0xf4));}function writeObject(_0x882292,_0x583048){const _0x5bd892=sha256Hex(_0x583048),_0x1d66f0=objectPath(_0x882292,_0x5bd892);mkdirSync(dirname(_0x1d66f0),{'recursive':!![]});if(!existsSync(_0x1d66f0))writeFileSync(_0x1d66f0,_0x583048);return _0x5bd892;}function readLog(_0x13f1fe,_0x327fb8,_0x1aae72){const _0x46405f=_0x2a8a16,_0x40dd7e=itemDir(_0x13f1fe,_0x327fb8,_0x1aae72),_0x18c143=join(_0x40dd7e,_0x46405f(0x136)),_0x1aad90=join(_0x40dd7e,_0x46405f(0x128)),_0x160a89=existsSync(_0x18c143)?JSON[_0x46405f(0x117)](readFileSync(_0x18c143,_0x46405f(0x102))):[],_0x17bbf1=existsSync(_0x1aad90)?readFileSync(_0x1aad90,_0x46405f(0x102))[_0x46405f(0x12c)]():_0x160a89['at'](-0x1)?.[_0x46405f(0x100)]??null;return{'head':_0x17bbf1,'items':_0x160a89};}function _0x3162(_0x5b4c63,_0x3ab039){_0x5b4c63=_0x5b4c63-0xef;const _0xc1d100=_0xc1d1();let _0x31620a=_0xc1d100[_0x5b4c63];if(_0x3162['Tblijf']===undefined){var _0x290f18=function(_0x4dd8ad){const _0x3df99b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x434521='',_0x4fa984='';for(let _0x1330ff=0x0,_0x218151,_0x4fa5d6,_0x1402a2=0x0;_0x4fa5d6=_0x4dd8ad['charAt'](_0x1402a2++);~_0x4fa5d6&&(_0x218151=_0x1330ff%0x4?_0x218151*0x40+_0x4fa5d6:_0x4fa5d6,_0x1330ff++%0x4)?_0x434521+=String['fromCharCode'](0xff&_0x218151>>(-0x2*_0x1330ff&0x6)):0x0){_0x4fa5d6=_0x3df99b['indexOf'](_0x4fa5d6);}for(let _0x423327=0x0,_0x3137e9=_0x434521['length'];_0x423327<_0x3137e9;_0x423327++){_0x4fa984+='%'+('00'+_0x434521['charCodeAt'](_0x423327)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4fa984);};_0x3162['aDMfkJ']=_0x290f18,_0x3162['vBnJTZ']={},_0x3162['Tblijf']=!![];}const _0x48b345=_0xc1d100[0x0];_0x3162['EfMcpl']!==_0x48b345&&(_0x3162['vBnJTZ']={},_0x3162['EfMcpl']=_0x48b345);const _0x34178e=_0x3162['vBnJTZ'][_0x5b4c63];return _0x34178e===undefined?(_0x31620a=_0x3162['aDMfkJ'](_0x31620a),_0x3162['vBnJTZ'][_0x5b4c63]=_0x31620a):_0x31620a=_0x34178e,_0x31620a;}function writeLog(_0xbeb0,_0x389e97,_0x31b641,_0x1c8bd1,_0x4db8e2){const _0x1a060c=_0x2a8a16,_0x350b08=itemDir(_0xbeb0,_0x389e97,_0x31b641);mkdirSync(_0x350b08,{'recursive':!![]}),writeFileSync(join(_0x350b08,'log.json'),JSON[_0x1a060c(0xfa)](_0x4db8e2,null,0x2),_0x1a060c(0x102)),writeFileSync(join(_0x350b08,_0x1a060c(0x128)),_0x1c8bd1+'\x0a',_0x1a060c(0x102));}function findRev(_0x5d5dfa,_0x1812c7){const _0x39eb3b=_0x2a8a16,_0x981666=join(_0x5d5dfa,'items');if(!existsSync(_0x981666))return void 0x0;for(const _0x24f8fe of readdirSync(_0x981666,{'withFileTypes':!![]})){if(!_0x24f8fe['isDirectory']())continue;for(const _0x164aae of readdirSync(join(_0x981666,_0x24f8fe[_0x39eb3b(0xf0)]),{'withFileTypes':!![]})){if(!_0x164aae[_0x39eb3b(0x129)]())continue;const _0x58d129=readLog(_0x5d5dfa,_0x24f8fe[_0x39eb3b(0xf0)],_0x164aae['name'])[_0x39eb3b(0xfd)][_0x39eb3b(0xf6)](_0xa6899b=>_0xa6899b[_0x39eb3b(0x100)]===_0x1812c7);if(_0x58d129)return _0x58d129;}}return void 0x0;}function filesTextOf(_0x112673,_0x730742){const _0x13d514=_0x2a8a16,_0x14e2af={};for(const [_0x3633d0,_0x14ad23]of Object['entries'](_0x730742[_0x13d514(0xfb)])){const _0x43a370=objectPath(_0x112673,_0x14ad23);if(existsSync(_0x43a370))_0x14e2af[_0x3633d0]=readFileSync(_0x43a370,_0x13d514(0x102));}return _0x14e2af;}function createFsVersionStore(_0x237051,_0x44aacb){return mkdirSync(_0x237051,{'recursive':!![]}),{async 'log'(_0x27b528,_0x33c11f){const {head:_0x198942,items:_0x3c62e7}=readLog(_0x237051,_0x27b528,_0x33c11f);return{'head':_0x198942,'items':[..._0x3c62e7]['sort']((_0x158d54,_0x537cdb)=>_0x158d54['at']<_0x537cdb['at']?0x1:-0x1)};},async 'get'(_0x4af4ee){const _0x3632ae=findRev(_0x237051,_0x4af4ee);if(!_0x3632ae)throw new KtNotFoundError('rev\x20'+_0x4af4ee);return _0x3632ae;},async 'readFile'(_0x857fdf,_0x568c2c){const _0x1ce3ef=_0x3162,_0x1ea5a4=await this[_0x1ce3ef(0x114)](_0x857fdf),_0x5d2ace=_0x1ea5a4['files'][_0x568c2c];if(!_0x5d2ace)throw new KtNotFoundError(_0x568c2c);const _0xe50715=objectPath(_0x237051,_0x5d2ace);if(!existsSync(_0xe50715))throw new KtNotFoundError(_0x568c2c);return new Uint8Array(readFileSync(_0xe50715));},async 'commit'(_0x2c4bf1){const _0x3c2bd3=_0x3162;let _0x298ab3=_0x2c4bf1[_0x3c2bd3(0xfb)];if(!_0x298ab3){const _0x49be43=await _0x44aacb[_0x3c2bd3(0x114)](_0x2c4bf1['id']);_0x298ab3=artifactToFiles(_0x49be43);}const _0x4dde42={},_0x5c1414={};for(const [_0x49614c,_0x5f2ec9]of Object[_0x3c2bd3(0xf1)](_0x298ab3)){const _0x4db314=typeof _0x5f2ec9===_0x3c2bd3(0x116)?_0x5f2ec9:new TextDecoder()[_0x3c2bd3(0x10e)](_0x5f2ec9);_0x4dde42[_0x49614c]=_0x4db314,_0x5c1414[_0x49614c]=writeObject(_0x237051,typeof _0x5f2ec9==='string'?Buffer[_0x3c2bd3(0x11d)](_0x5f2ec9,_0x3c2bd3(0x102)):_0x5f2ec9);}const _0x33930b=readLog(_0x237051,_0x2c4bf1[_0x3c2bd3(0x10f)],_0x2c4bf1['id']);if(_0x33930b[_0x3c2bd3(0x105)]){const _0x5704ca=_0x33930b[_0x3c2bd3(0xfd)]['find'](_0x422159=>_0x422159[_0x3c2bd3(0x100)]===_0x33930b[_0x3c2bd3(0x105)]);if(_0x5704ca&&filesEqual(_0x4dde42,filesTextOf(_0x237051,_0x5704ca)))return _0x5704ca;}const _0x217891=new Date(),_0xa200ef=String(_0x217891[_0x3c2bd3(0x112)]())[_0x3c2bd3(0xfe)](0x2)+String(_0x217891[_0x3c2bd3(0x110)]()+0x1)[_0x3c2bd3(0x115)](0x2,'0')+String(_0x217891[_0x3c2bd3(0x127)]())[_0x3c2bd3(0x115)](0x2,'0')+String(_0x217891[_0x3c2bd3(0x101)]())[_0x3c2bd3(0x115)](0x2,'0')+String(_0x217891[_0x3c2bd3(0x123)]())[_0x3c2bd3(0x115)](0x2,'0'),_0x344911=sha256Hex(Object[_0x3c2bd3(0x10a)](_0x5c1414)[_0x3c2bd3(0x111)]()['join'](','))['slice'](0x0,0x8),_0x2f7944={'rev':_0xa200ef+'-local-'+_0x344911,'kind':_0x2c4bf1[_0x3c2bd3(0x10f)],'id':_0x2c4bf1['id'],'at':_0x217891[_0x3c2bd3(0x108)](),'parent':_0x33930b['head'],'by':_0x2c4bf1['by'],'note':_0x2c4bf1[_0x3c2bd3(0x133)],'files':_0x5c1414,'meta':_0x2c4bf1[_0x3c2bd3(0x109)]};return writeLog(_0x237051,_0x2c4bf1[_0x3c2bd3(0x10f)],_0x2c4bf1['id'],_0x2f7944[_0x3c2bd3(0x100)],[..._0x33930b[_0x3c2bd3(0xfd)],_0x2f7944]),_0x2f7944;},async 'restore'(_0x42742a,_0x48d412,_0x16f120,_0x8f46f4){const _0x33d0b4=_0x3162,_0x231944=await this[_0x33d0b4(0x114)](_0x16f120),_0x100286={};for(const _0x3731f9 of Object['keys'](_0x231944[_0x33d0b4(0xfb)])){_0x100286[_0x3731f9]=new TextDecoder()[_0x33d0b4(0x10e)](await this[_0x33d0b4(0x11f)](_0x16f120,_0x3731f9));}const _0x5f488d=filesToArtifact(_0x100286,_0x48d412);return await _0x44aacb[_0x33d0b4(0x122)]({..._0x5f488d,'id':_0x48d412,'kind':_0x5f488d[_0x33d0b4(0x10f)],'etag':void 0x0}),this[_0x33d0b4(0x120)]({'kind':_0x42742a,'id':_0x48d412,'files':_0x100286,'by':_0x8f46f4,'note':_0x33d0b4(0x104)+_0x16f120});}};}function createKtFsStores(_0x13675a){const _0x33f1a1=_0x2a8a16,_0x34d3df=createFsArtifactStore(resolveRoot(_0x13675a[_0x33f1a1(0xef)],_0x13675a[_0x33f1a1(0xfc)]),_0x13675a[_0x33f1a1(0xff)]),_0x529560=_0x13675a[_0x33f1a1(0x12b)]?createFsInstanceStore(resolveRoot(_0x13675a[_0x33f1a1(0x12b)],_0x13675a[_0x33f1a1(0xfc)]),_0x13675a[_0x33f1a1(0x107)]):void 0x0,_0x5c27ac=_0x13675a[_0x33f1a1(0x119)]?createFsVersionStore(resolveRoot(_0x13675a[_0x33f1a1(0x119)],_0x13675a['cwd']),_0x34d3df):void 0x0;return{'artifacts':_0x34d3df,'instances':_0x529560,'versions':_0x5c27ac};}export{createKtFsStores};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const _0x1b14eb=_0x1eaa;(function(_0x4ce2f9,_0x68e74f){const _0xc130bb=_0x1eaa,_0x7780f7=_0x4ce2f9();while(!![]){try{const _0x305de5=parseInt(_0xc130bb(0xd3))/0x1+-parseInt(_0xc130bb(0xf2))/0x2+parseInt(_0xc130bb(0xcc))/0x3+-parseInt(_0xc130bb(0xec))/0x4+-parseInt(_0xc130bb(0xeb))/0x5+parseInt(_0xc130bb(0xfa))/0x6*(parseInt(_0xc130bb(0xfb))/0x7)+-parseInt(_0xc130bb(0xd5))/0x8*(-parseInt(_0xc130bb(0xd2))/0x9);if(_0x305de5===_0x68e74f)break;else _0x7780f7['push'](_0x7780f7['shift']());}catch(_0x5b727d){_0x7780f7['push'](_0x7780f7['shift']());}}}(_0x4559,0x88f67));function _0x4559(){const _0x54039c=['CMvZDg9Yzq','Cgf0Aa','nMDlAMjktG','nZa1ntKZtwv5zen3','BwvZC2fNzq','C2vHCMnOugfYyw1Z','y3vYCMvUDa','mtm3mZm3mhDYu1L4yq','BgLZDa','C2f2zq','y29TBwL0','qgSTDgfIBguVCMvWB3j0l3n0B3jL','ufvu','mtm2ofzpyNfotW','nJqWmtu4zgfyAwPr','z2v0','mta1mda4t2zAzxP4','BgvUz3rO','C2XPy2u','CMvTB3zL','Bg9N','DMvYC2LVBNmG5PYQ6ywn572U','Aw5ZDgfUy2vZ','CMvTB3zLioACQUwUNUEoSa','r0vu','zgvMAw5Ls3rdB25MAwC','zMLSzq','Aw5KzxHpzG','l2fWAs9RDa','C3rHDhvZ','CgfYyw1Z','5yAf6yoO6zsz6k+V','ue9tva','y3jLyxrL','C3rYAw5NAwz5','Dg9vChbLCKnHC2u','zNjVBq','Dgv4Da','ntq1ode4nwHNueLTEG','mZaYodqYmeTWBvffEG','Cgf0Ag5HBwu','yxj0AwzHy3rZ','C3bSAxq','A2LUza','DMvYC2LVBNm','mtu2odmXnKPWC1HhtW','5PYQ5OM+5yIW','y3jLyxrLioACQUwUNUEoSa','yxj0AwzHy3rjza','DxjS','s3rdB25MBgLJDevYCM9Y'];_0x4559=function(){return _0x54039c;};return _0x4559();}var store=require(_0x1b14eb(0xd0));async function pathParts(_0x2fbee5,_0x4bfccb){const _0x40c60a=_0x1b14eb,_0x5dbdde=_0x2fbee5['params']?await _0x2fbee5[_0x40c60a(0xe3)]:void 0x0;if(_0x5dbdde?.[_0x40c60a(0xf9)]?.[_0x40c60a(0xd6)])return _0x5dbdde[_0x40c60a(0xf9)];const _0xed5b01=_0x4bfccb['pathname'][_0x40c60a(0xe0)](_0x40c60a(0xe1)),_0x568d90=_0xed5b01>=0x0?_0x4bfccb['pathname'][_0x40c60a(0xd7)](_0xed5b01+_0x40c60a(0xe1)[_0x40c60a(0xd6)]):_0x4bfccb[_0x40c60a(0xed)];return _0x568d90[_0x40c60a(0xef)]('/')['filter'](Boolean);}function json(_0x27f1aa,_0x1a2b74=0xc8){const _0x7c379f=_0x1b14eb;return new Response(JSON[_0x7c379f(0xe7)](_0x27f1aa),{'status':_0x1a2b74,'headers':{'content-type':'application/json;\x20charset=utf-8'}});}function fail(_0x37aef9){const _0x1f9c5f=_0x1b14eb;if(_0x37aef9 instanceof store[_0x1f9c5f(0xf7)])return json({'message':_0x37aef9[_0x1f9c5f(0xfc)],'current':_0x37aef9[_0x1f9c5f(0xcb)]},0x199);if(_0x37aef9 instanceof store['KtNotFoundError'])return json({'message':_0x37aef9[_0x1f9c5f(0xfc)]},0x194);if(_0x37aef9 instanceof store['KtStoreError'])return json({'message':_0x37aef9[_0x1f9c5f(0xfc)]},_0x37aef9[_0x1f9c5f(0xe2)]??0x1f4);return json({'message':_0x37aef9 instanceof Error?_0x37aef9[_0x1f9c5f(0xfc)]:_0x1f9c5f(0xe4)},0x1f4);}async function readBody(_0x36adef){const _0x454e43=_0x1b14eb,_0x120953=await _0x36adef[_0x454e43(0xea)]();if(!_0x120953)return null;return JSON['parse'](_0x120953);}function _0x1eaa(_0x84f659,_0x50b03f){_0x84f659=_0x84f659-0xca;const _0x45599e=_0x4559();let _0x1eaac1=_0x45599e[_0x84f659];if(_0x1eaa['QSSXQN']===undefined){var _0x32937e=function(_0x23fcf4){const _0x1fe91c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2020a7='',_0x2fbee5='';for(let _0x4bfccb=0x0,_0x5dbdde,_0xed5b01,_0x568d90=0x0;_0xed5b01=_0x23fcf4['charAt'](_0x568d90++);~_0xed5b01&&(_0x5dbdde=_0x4bfccb%0x4?_0x5dbdde*0x40+_0xed5b01:_0xed5b01,_0x4bfccb++%0x4)?_0x2020a7+=String['fromCharCode'](0xff&_0x5dbdde>>(-0x2*_0x4bfccb&0x6)):0x0){_0xed5b01=_0x1fe91c['indexOf'](_0xed5b01);}for(let _0x27f1aa=0x0,_0x1a2b74=_0x2020a7['length'];_0x27f1aa<_0x1a2b74;_0x27f1aa++){_0x2fbee5+='%'+('00'+_0x2020a7['charCodeAt'](_0x27f1aa)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2fbee5);};_0x1eaa['VVCTBV']=_0x32937e,_0x1eaa['veormc']={},_0x1eaa['QSSXQN']=!![];}const _0x571489=_0x45599e[0x0];_0x1eaa['nXADUn']!==_0x571489&&(_0x1eaa['veormc']={},_0x1eaa['nXADUn']=_0x571489);const _0x10970c=_0x1eaa['veormc'][_0x84f659];return _0x10970c===undefined?(_0x1eaac1=_0x1eaa['VVCTBV'](_0x1eaac1),_0x1eaa['veormc'][_0x84f659]=_0x1eaac1):_0x1eaac1=_0x10970c,_0x1eaac1;}function createKtHandler(_0xdc3827){const _0xf6007c=async(_0x1bf946,_0xbfdb93={})=>{const _0x126e82=_0x1eaa;try{const _0x5668f9=new URL(_0x1bf946[_0x126e82(0xf6)]),_0x295455=await pathParts(_0xbfdb93,_0x5668f9),[_0x322883,_0x4ed382,_0x18a4b1]=_0x295455,_0x377235=_0x1bf946['method'][_0x126e82(0xe8)]();if(_0x322883===_0x126e82(0xee)&&!_0x4ed382&&_0x377235===_0x126e82(0xdd)){const _0x2ebd50=_0x5668f9[_0x126e82(0xca)][_0x126e82(0xd4)](_0x126e82(0xf0));return json({'items':await _0xdc3827[_0x126e82(0xee)]['list'](_0x2ebd50||void 0x0)});}if(_0x322883==='artifacts'&&!_0x4ed382&&_0x377235===_0x126e82(0xe5)){if(!_0xdc3827[_0x126e82(0xee)]['create'])return json({'message':_0x126e82(0xf4)},0x194);return json(await _0xdc3827[_0x126e82(0xee)][_0x126e82(0xe6)](await readBody(_0x1bf946)));}if(_0x322883===_0x126e82(0xee)&&_0x4ed382&&_0x377235===_0x126e82(0xdd))return json(await _0xdc3827[_0x126e82(0xee)]['get'](_0x4ed382));if(_0x322883===_0x126e82(0xee)&&_0x4ed382&&_0x377235===_0x126e82(0xd1))return json(await _0xdc3827['artifacts']['save'](await readBody(_0x1bf946)));if(_0x322883===_0x126e82(0xee)&&_0x4ed382&&_0x377235==='DELETE'){if(!_0xdc3827[_0x126e82(0xee)]['remove'])return json({'message':_0x126e82(0xdc)},0x194);return await _0xdc3827[_0x126e82(0xee)][_0x126e82(0xd8)](_0x4ed382),json({'ok':!![]});}if(_0x322883===_0x126e82(0xdb)){if(!_0xdc3827[_0x126e82(0xdb)])return json({'message':'instances\x20\u672A\u914D\u7F6E'},0x194);if(!_0x4ed382&&_0x377235===_0x126e82(0xdd))return json({'items':await _0xdc3827[_0x126e82(0xdb)][_0x126e82(0xcd)]?.(_0x5668f9[_0x126e82(0xca)][_0x126e82(0xd4)](_0x126e82(0xf5))??void 0x0)??[]});if(!_0x4ed382&&_0x377235===_0x126e82(0xe5)){if(!_0xdc3827[_0x126e82(0xdb)][_0x126e82(0xe6)])return json({'message':_0x126e82(0xf4)},0x194);return json(await _0xdc3827['instances'][_0x126e82(0xe6)](await readBody(_0x1bf946)));}if(_0x4ed382&&_0x377235===_0x126e82(0xdd))return json(await _0xdc3827[_0x126e82(0xdb)]['get'](_0x4ed382));if(_0x4ed382&&_0x377235===_0x126e82(0xd1))return await _0xdc3827[_0x126e82(0xdb)][_0x126e82(0xce)](_0x4ed382,await readBody(_0x1bf946)),json({'ok':!![]});}if(_0x322883===_0x126e82(0xf1)){if(!_0xdc3827[_0x126e82(0xf1)])return json({'message':_0x126e82(0xda)},0x194);if(!_0x4ed382&&_0x377235==='GET'){const _0x595a32=_0x5668f9[_0x126e82(0xca)]['get'](_0x126e82(0xf0))??'',_0x150c6d=_0x5668f9[_0x126e82(0xca)][_0x126e82(0xd4)]('id')??'';return json(await _0xdc3827[_0x126e82(0xf1)][_0x126e82(0xd9)](_0x595a32,_0x150c6d));}if(!_0x4ed382&&_0x377235===_0x126e82(0xe5))return json(await _0xdc3827[_0x126e82(0xf1)][_0x126e82(0xcf)](await readBody(_0x1bf946)));if(_0x4ed382&&_0x18a4b1===_0x126e82(0xdf)&&_0x377235===_0x126e82(0xdd)){const _0x239ae9=await _0xdc3827[_0x126e82(0xf1)]['readFile'](_0x4ed382,_0x5668f9[_0x126e82(0xca)][_0x126e82(0xd4)](_0x126e82(0xf9))??'');return new Response(Buffer[_0x126e82(0xe9)](_0x239ae9),{'headers':{'content-type':'application/octet-stream'}});}if(_0x4ed382&&_0x18a4b1===_0x126e82(0xf8)&&_0x377235===_0x126e82(0xe5)){const _0x1c409e=await readBody(_0x1bf946);return json(await _0xdc3827[_0x126e82(0xf1)][_0x126e82(0xf8)](_0x1c409e[_0x126e82(0xf0)],_0x1c409e['id'],_0x4ed382,_0x1c409e['by']));}if(_0x4ed382&&!_0x18a4b1&&_0x377235===_0x126e82(0xdd))return json(await _0xdc3827[_0x126e82(0xf1)][_0x126e82(0xd4)](_0x4ed382));}return json({'message':_0x126e82(0xf3)},0x194);}catch(_0x179fff){return fail(_0x179fff);}};return{'GET':_0xf6007c,'POST':_0xf6007c,'PUT':_0xf6007c,'DELETE':_0xf6007c};}function defineKtConfig(_0x32a562){return _0x32a562;}exports['createKtHandler']=createKtHandler,exports[_0x1b14eb(0xde)]=defineKtConfig;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19e534,_0x38e0b1){const _0x6a76be=_0x187a,_0x308936=_0x19e534();while(!![]){try{const _0x137e9b=parseInt(_0x6a76be(0x98))/0x1*(parseInt(_0x6a76be(0x8e))/0x2)+parseInt(_0x6a76be(0x90))/0x3+parseInt(_0x6a76be(0x72))/0x4*(-parseInt(_0x6a76be(0x80))/0x5)+-parseInt(_0x6a76be(0x83))/0x6+parseInt(_0x6a76be(0x75))/0x7*(parseInt(_0x6a76be(0x87))/0x8)+-parseInt(_0x6a76be(0x7e))/0x9*(parseInt(_0x6a76be(0x71))/0xa)+parseInt(_0x6a76be(0x88))/0xb;if(_0x137e9b===_0x38e0b1)break;else _0x308936['push'](_0x308936['shift']());}catch(_0x1bc747){_0x308936['push'](_0x308936['shift']());}}}(_0x2c82,0xe70c8));import{KtConflictError,KtNotFoundError,KtStoreError}from'@k-table/report/store';function _0x187a(_0x16914a,_0x5a65bc){_0x16914a=_0x16914a-0x6d;const _0x2c8213=_0x2c82();let _0x187a42=_0x2c8213[_0x16914a];if(_0x187a['zYcZar']===undefined){var _0x3641a8=function(_0x118089){const _0x235da8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x353113='',_0x2d9a20='';for(let _0x6b2cdd=0x0,_0x4c03b6,_0x6c45b4,_0x966e79=0x0;_0x6c45b4=_0x118089['charAt'](_0x966e79++);~_0x6c45b4&&(_0x4c03b6=_0x6b2cdd%0x4?_0x4c03b6*0x40+_0x6c45b4:_0x6c45b4,_0x6b2cdd++%0x4)?_0x353113+=String['fromCharCode'](0xff&_0x4c03b6>>(-0x2*_0x6b2cdd&0x6)):0x0){_0x6c45b4=_0x235da8['indexOf'](_0x6c45b4);}for(let _0x234a31=0x0,_0x48a056=_0x353113['length'];_0x234a31<_0x48a056;_0x234a31++){_0x2d9a20+='%'+('00'+_0x353113['charCodeAt'](_0x234a31)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2d9a20);};_0x187a['skvcnj']=_0x3641a8,_0x187a['bVJZpA']={},_0x187a['zYcZar']=!![];}const _0x3b9c23=_0x2c8213[0x0];_0x187a['ZsOruy']!==_0x3b9c23&&(_0x187a['bVJZpA']={},_0x187a['ZsOruy']=_0x3b9c23);const _0x30aed7=_0x187a['bVJZpA'][_0x16914a];return _0x30aed7===undefined?(_0x187a42=_0x187a['skvcnj'](_0x187a42),_0x187a['bVJZpA'][_0x16914a]=_0x187a42):_0x187a42=_0x30aed7,_0x187a42;}async function pathParts(_0x2d9a20,_0x6b2cdd){const _0x49495b=_0x187a,_0x4c03b6=_0x2d9a20[_0x49495b(0x86)]?await _0x2d9a20[_0x49495b(0x86)]:void 0x0;if(_0x4c03b6?.[_0x49495b(0x79)]?.[_0x49495b(0x76)])return _0x4c03b6[_0x49495b(0x79)];const _0x6c45b4=_0x6b2cdd[_0x49495b(0x8c)]['indexOf'](_0x49495b(0x92)),_0x966e79=_0x6c45b4>=0x0?_0x6b2cdd[_0x49495b(0x8c)][_0x49495b(0x6d)](_0x6c45b4+_0x49495b(0x92)[_0x49495b(0x76)]):_0x6b2cdd['pathname'];return _0x966e79['split']('/')[_0x49495b(0x97)](Boolean);}function json(_0x234a31,_0x48a056=0xc8){return new Response(JSON['stringify'](_0x234a31),{'status':_0x48a056,'headers':{'content-type':'application/json;\x20charset=utf-8'}});}function fail(_0x1d5c5c){const _0x1c5b21=_0x187a;if(_0x1d5c5c instanceof KtConflictError)return json({'message':_0x1d5c5c[_0x1c5b21(0x95)],'current':_0x1d5c5c['current']},0x199);if(_0x1d5c5c instanceof KtNotFoundError)return json({'message':_0x1d5c5c[_0x1c5b21(0x95)]},0x194);if(_0x1d5c5c instanceof KtStoreError)return json({'message':_0x1d5c5c[_0x1c5b21(0x95)]},_0x1d5c5c[_0x1c5b21(0x96)]??0x1f4);return json({'message':_0x1d5c5c instanceof Error?_0x1d5c5c[_0x1c5b21(0x95)]:'\u5185\u90E8\u9519\u8BEF'},0x1f4);}async function readBody(_0x11ea81){const _0x2aa644=_0x187a,_0x2e1aaa=await _0x11ea81[_0x2aa644(0x8a)]();if(!_0x2e1aaa)return null;return JSON[_0x2aa644(0x7f)](_0x2e1aaa);}function createKtHandler(_0xd05ace){const _0x297fd3=async(_0x1549a7,_0x239608={})=>{const _0x3f9f12=_0x187a;try{const _0x1b14a2=new URL(_0x1549a7['url']),_0x31f603=await pathParts(_0x239608,_0x1b14a2),[_0x31361f,_0x94c35e,_0x59e3cc]=_0x31f603,_0x4da295=_0x1549a7[_0x3f9f12(0x89)][_0x3f9f12(0x84)]();if(_0x31361f===_0x3f9f12(0x7c)&&!_0x94c35e&&_0x4da295==='GET'){const _0x164f0a=_0x1b14a2[_0x3f9f12(0x7a)][_0x3f9f12(0x8d)](_0x3f9f12(0x99));return json({'items':await _0xd05ace['artifacts'][_0x3f9f12(0x85)](_0x164f0a||void 0x0)});}if(_0x31361f===_0x3f9f12(0x7c)&&!_0x94c35e&&_0x4da295===_0x3f9f12(0x81)){if(!_0xd05ace[_0x3f9f12(0x7c)][_0x3f9f12(0x78)])return json({'message':_0x3f9f12(0x82)},0x194);return json(await _0xd05ace[_0x3f9f12(0x7c)]['create'](await readBody(_0x1549a7)));}if(_0x31361f==='artifacts'&&_0x94c35e&&_0x4da295===_0x3f9f12(0x93))return json(await _0xd05ace[_0x3f9f12(0x7c)][_0x3f9f12(0x8d)](_0x94c35e));if(_0x31361f===_0x3f9f12(0x7c)&&_0x94c35e&&_0x4da295===_0x3f9f12(0x73))return json(await _0xd05ace[_0x3f9f12(0x7c)][_0x3f9f12(0x7d)](await readBody(_0x1549a7)));if(_0x31361f===_0x3f9f12(0x7c)&&_0x94c35e&&_0x4da295===_0x3f9f12(0x8b)){if(!_0xd05ace[_0x3f9f12(0x7c)][_0x3f9f12(0x77)])return json({'message':'remove\x20\u672A\u5B9E\u73B0'},0x194);return await _0xd05ace[_0x3f9f12(0x7c)][_0x3f9f12(0x77)](_0x94c35e),json({'ok':!![]});}if(_0x31361f===_0x3f9f12(0x7b)){if(!_0xd05ace[_0x3f9f12(0x7b)])return json({'message':_0x3f9f12(0x91)},0x194);if(!_0x94c35e&&_0x4da295===_0x3f9f12(0x93))return json({'items':await _0xd05ace[_0x3f9f12(0x7b)]['list']?.(_0x1b14a2['searchParams'][_0x3f9f12(0x8d)]('artifactId')??void 0x0)??[]});if(!_0x94c35e&&_0x4da295==='POST'){if(!_0xd05ace['instances'][_0x3f9f12(0x78)])return json({'message':_0x3f9f12(0x82)},0x194);return json(await _0xd05ace[_0x3f9f12(0x7b)][_0x3f9f12(0x78)](await readBody(_0x1549a7)));}if(_0x94c35e&&_0x4da295==='GET')return json(await _0xd05ace[_0x3f9f12(0x7b)][_0x3f9f12(0x8d)](_0x94c35e));if(_0x94c35e&&_0x4da295==='PUT')return await _0xd05ace[_0x3f9f12(0x7b)][_0x3f9f12(0x7d)](_0x94c35e,await readBody(_0x1549a7)),json({'ok':!![]});}if(_0x31361f===_0x3f9f12(0x8f)){if(!_0xd05ace[_0x3f9f12(0x8f)])return json({'message':_0x3f9f12(0x6e)},0x194);if(!_0x94c35e&&_0x4da295===_0x3f9f12(0x93)){const _0x18aa58=_0x1b14a2[_0x3f9f12(0x7a)]['get']('kind')??'',_0x72337c=_0x1b14a2[_0x3f9f12(0x7a)][_0x3f9f12(0x8d)]('id')??'';return json(await _0xd05ace[_0x3f9f12(0x8f)]['log'](_0x18aa58,_0x72337c));}if(!_0x94c35e&&_0x4da295===_0x3f9f12(0x81))return json(await _0xd05ace[_0x3f9f12(0x8f)][_0x3f9f12(0x6f)](await readBody(_0x1549a7)));if(_0x94c35e&&_0x59e3cc==='file'&&_0x4da295==='GET'){const _0x39bc24=await _0xd05ace[_0x3f9f12(0x8f)][_0x3f9f12(0x70)](_0x94c35e,_0x1b14a2[_0x3f9f12(0x7a)][_0x3f9f12(0x8d)](_0x3f9f12(0x79))??'');return new Response(Buffer[_0x3f9f12(0x74)](_0x39bc24),{'headers':{'content-type':'application/octet-stream'}});}if(_0x94c35e&&_0x59e3cc===_0x3f9f12(0x94)&&_0x4da295===_0x3f9f12(0x81)){const _0x1e8d2f=await readBody(_0x1549a7);return json(await _0xd05ace[_0x3f9f12(0x8f)][_0x3f9f12(0x94)](_0x1e8d2f['kind'],_0x1e8d2f['id'],_0x94c35e,_0x1e8d2f['by']));}if(_0x94c35e&&!_0x59e3cc&&_0x4da295===_0x3f9f12(0x93))return json(await _0xd05ace[_0x3f9f12(0x8f)][_0x3f9f12(0x8d)](_0x94c35e));}return json({'message':'\u672A\u627E\u5230'},0x194);}catch(_0x7173a2){return fail(_0x7173a2);}};return{'GET':_0x297fd3,'POST':_0x297fd3,'PUT':_0x297fd3,'DELETE':_0x297fd3};}function defineKtConfig(_0x3617a4){return _0x3617a4;}function _0x2c82(){const _0x1eb50a=['Bwv0Ag9K','Dgv4Da','revmrvrf','Cgf0Ag5HBwu','z2v0','mZm1ofDgBLjKra','DMvYC2LVBNm','mZm0mtq3mK5Yt1fxDW','Aw5ZDgfUy2vZioACQUMfJEE9RG','l2fWAs9RDa','r0vu','CMvZDg9Yzq','BwvZC2fNzq','C3rHDhvZ','zMLSDgvY','mta2mgviwKTuuW','A2LUza','C2XPy2u','DMvYC2LVBNmG5PYQ6ywn572U','y29TBwL0','CMvHzezPBgu','mJboEgjkyxK','ody3mMD2twzQvq','ufvu','zNjVBq','mZCZmJmZEK9nBenz','BgvUz3rO','CMvTB3zL','y3jLyxrL','Cgf0Aa','C2vHCMnOugfYyw1Z','Aw5ZDgfUy2vZ','yxj0AwzHy3rZ','C2f2zq','nZa3mZi4ou5hDeDbAq','CgfYC2u','ndi2mgnzrhPtzG','ue9tva','y3jLyxrLioACQUwUNUEoSa','odeYnJqWtgvxqKrU','Dg9vChbLCKnHC2u','BgLZDa','CgfYyw1Z','ogLSwgjquq','mtCWotmWmJfICwLPs1e'];_0x2c82=function(){return _0x1eb50a;};return _0x2c82();}export{createKtHandler,defineKtConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k-table/next",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
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.
|
|
30
|
+
"@k-table/report": "^1.0.28"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"next": ">=15"
|