@k-table/next 1.0.34 → 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 _0x1c48a8=_0x4511;(function(_0x34ad96,_0x306bc8){const _0xea51f=_0x4511,_0x23ffd6=_0x34ad96();while(!![]){try{const _0x2d8635=-parseInt(_0xea51f(0x163))/0x1*(-parseInt(_0xea51f(0x168))/0x2)+parseInt(_0xea51f(0x13e))/0x3+-parseInt(_0xea51f(0x141))/0x4+-parseInt(_0xea51f(0x13d))/0x5*(-parseInt(_0xea51f(0x13a))/0x6)+-parseInt(_0xea51f(0x132))/0x7+parseInt(_0xea51f(0x159))/0x8+parseInt(_0xea51f(0x135))/0x9*(parseInt(_0xea51f(0x118))/0xa);if(_0x2d8635===_0x306bc8)break;else _0x23ffd6['push'](_0x23ffd6['shift']());}catch(_0x174353){_0x23ffd6['push'](_0x23ffd6['shift']());}}}(_0x59d8,0x2460f));var fs=require('fs'),path=require(_0x1c48a8(0x12c)),store=require(_0x1c48a8(0x14d)),crypto=require('crypto');function resolveRoot(_0x4cd9df,_0x1cbbd8=process[_0x1c48a8(0x15b)]()){const _0x55ab86=_0x1c48a8,_0x286c45=path[_0x55ab86(0x130)](_0x4cd9df)?_0x4cd9df:path['resolve'](_0x1cbbd8,_0x4cd9df);return fs[_0x55ab86(0x157)](_0x286c45,{'recursive':!![]}),_0x286c45;}function artifactDir(_0x34d923,_0x31e9a6){const _0x77f1ab=_0x1c48a8;return path[_0x77f1ab(0x12f)](_0x34d923,_0x31e9a6);}function objectPath(_0x119e30,_0x2c1b7a){const _0x359c98=_0x1c48a8;return path['join'](_0x119e30,_0x359c98(0x117),_0x2c1b7a[_0x359c98(0x15d)](0x0,0x2),_0x2c1b7a);}function itemDir(_0x5d65b3,_0x279787,_0xdad098){const _0x4eb9e1=_0x1c48a8;return path[_0x4eb9e1(0x12f)](_0x5d65b3,_0x4eb9e1(0x13c),_0x279787,_0xdad098);}function newEtag(){const _0x4d13b8=_0x1c48a8;return Date[_0x4d13b8(0x11e)]()[_0x4d13b8(0x150)](0x24)+'-'+Math[_0x4d13b8(0x145)]()[_0x4d13b8(0x150)](0x24)[_0x4d13b8(0x15d)](0x2,0x8);}function readEtag(_0x1243bf){const _0x391374=_0x1c48a8,_0x35035b=path[_0x391374(0x12f)](_0x1243bf,_0x391374(0x133));return fs[_0x391374(0x158)](_0x35035b)?fs['readFileSync'](_0x35035b,_0x391374(0x16c))[_0x391374(0x153)]():void 0x0;}function writeArtifactDir(_0x2326e8,_0x35e904,_0x309747){const _0x2b37ca=_0x1c48a8;fs[_0x2b37ca(0x157)](path[_0x2b37ca(0x12f)](_0x2326e8,_0x2b37ca(0x14e)),{'recursive':!![]});const _0x212869=store[_0x2b37ca(0x16b)](_0x35e904);fs[_0x2b37ca(0x128)](path[_0x2b37ca(0x12f)](_0x2326e8,store['ARTIFACT_FILE_META']),_0x212869[store[_0x2b37ca(0x11b)]]??'{}','utf8'),fs[_0x2b37ca(0x128)](path[_0x2b37ca(0x12f)](_0x2326e8,store['ARTIFACT_FILE_BODY']),_0x212869[store['ARTIFACT_FILE_BODY']]??'',_0x2b37ca(0x16c));const _0xc57143=path[_0x2b37ca(0x12f)](_0x2326e8,store[_0x2b37ca(0x146)]),_0x3085fe=path[_0x2b37ca(0x12f)](_0x2326e8,store[_0x2b37ca(0x167)]);if(_0x212869[store[_0x2b37ca(0x146)]])fs[_0x2b37ca(0x128)](_0xc57143,_0x212869[store['ARTIFACT_FILE_FILL']],_0x2b37ca(0x16c));else{if(fs['existsSync'](_0xc57143))fs['rmSync'](_0xc57143);}if(_0x212869[store[_0x2b37ca(0x167)]])fs[_0x2b37ca(0x128)](_0x3085fe,_0x212869[store[_0x2b37ca(0x167)]],_0x2b37ca(0x16c));else{if(fs['existsSync'](_0x3085fe))fs[_0x2b37ca(0x11c)](_0x3085fe);}fs[_0x2b37ca(0x128)](path[_0x2b37ca(0x12f)](_0x2326e8,_0x2b37ca(0x133)),_0x309747,_0x2b37ca(0x16c));}function readArtifactDir(_0x22cf00,_0x1bb90b){const _0x34c698=_0x1c48a8,_0x392d18={},_0x539027=path[_0x34c698(0x12f)](_0x22cf00,store[_0x34c698(0x11b)]),_0x1f437a=path[_0x34c698(0x12f)](_0x22cf00,store[_0x34c698(0x147)]);if(fs[_0x34c698(0x158)](_0x539027))_0x392d18[store['ARTIFACT_FILE_META']]=fs[_0x34c698(0x126)](_0x539027,_0x34c698(0x16c));if(fs['existsSync'](_0x1f437a))_0x392d18[store[_0x34c698(0x147)]]=fs[_0x34c698(0x126)](_0x1f437a,_0x34c698(0x16c));const _0x521e62=path[_0x34c698(0x12f)](_0x22cf00,store['ARTIFACT_FILE_FILL']),_0x13863e=path[_0x34c698(0x12f)](_0x22cf00,store['ARTIFACT_FILE_REPORT']);if(fs[_0x34c698(0x158)](_0x521e62))_0x392d18[store['ARTIFACT_FILE_FILL']]=fs[_0x34c698(0x126)](_0x521e62,_0x34c698(0x16c));if(fs[_0x34c698(0x158)](_0x13863e))_0x392d18[store[_0x34c698(0x167)]]=fs[_0x34c698(0x126)](_0x13863e,_0x34c698(0x16c));return{...store[_0x34c698(0x116)](_0x392d18,_0x1bb90b),'etag':readEtag(_0x22cf00)};}function createFsArtifactStore(_0xbe169,_0x41fcae=[]){const _0x7b2bfd=_0x1c48a8;fs[_0x7b2bfd(0x157)](_0xbe169,{'recursive':!![]});for(const _0x3803e2 of _0x41fcae){const _0x500982=artifactDir(_0xbe169,_0x3803e2['id']),_0x22572d=path[_0x7b2bfd(0x12f)](_0x500982,store[_0x7b2bfd(0x147)]);if(!fs[_0x7b2bfd(0x158)](_0x22572d))writeArtifactDir(_0x500982,_0x3803e2,_0x3803e2[_0x7b2bfd(0x138)]??newEtag());}return{async 'list'(_0x407b16){const _0x2c4a74=_0x7b2bfd;if(!fs[_0x2c4a74(0x158)](_0xbe169))return[];const _0x52ba3a=[];for(const _0x5323b9 of fs[_0x2c4a74(0x15a)](_0xbe169,{'withFileTypes':!![]})){if(!_0x5323b9[_0x2c4a74(0x134)]())continue;try{const _0x6e7e34=readArtifactDir(artifactDir(_0xbe169,_0x5323b9[_0x2c4a74(0x14c)]),_0x5323b9[_0x2c4a74(0x14c)]);if(!_0x407b16||_0x6e7e34[_0x2c4a74(0x115)]===_0x407b16)_0x52ba3a['push']({'id':_0x6e7e34['id'],'name':_0x6e7e34[_0x2c4a74(0x14c)],'kind':_0x6e7e34[_0x2c4a74(0x115)]});}catch{}}return _0x52ba3a;},async 'get'(_0x2644cc){const _0x5f0c51=_0x7b2bfd,_0x480694=artifactDir(_0xbe169,_0x2644cc);if(!fs[_0x5f0c51(0x158)](_0x480694))throw new store[(_0x5f0c51(0x13f))](_0x5f0c51(0x124)+_0x2644cc);return readArtifactDir(_0x480694,_0x2644cc);},async 'save'(_0x129c56){const _0x383938=_0x7b2bfd,_0x2b00b0=artifactDir(_0xbe169,_0x129c56['id']),_0x475a00=fs[_0x383938(0x158)](_0x2b00b0)?readArtifactDir(_0x2b00b0,_0x129c56['id']):void 0x0;if(_0x129c56[_0x383938(0x138)]&&_0x475a00?.[_0x383938(0x138)]&&_0x129c56['etag']!==_0x475a00[_0x383938(0x138)])throw new store[(_0x383938(0x143))](_0x383938(0x142),_0x475a00);const _0x59ea91=newEtag();return writeArtifactDir(_0x2b00b0,_0x129c56,_0x59ea91),{..._0x129c56,'etag':_0x59ea91};},async 'create'(_0x13519b){const _0x5e8cd3=_0x7b2bfd,_0x3d17ae=_0x13519b[_0x5e8cd3(0x115)]+'-'+Math[_0x5e8cd3(0x145)]()['toString'](0x24)[_0x5e8cd3(0x15d)](0x2,0xa),_0x5ac6c6={'id':_0x3d17ae,'name':_0x13519b[_0x5e8cd3(0x14c)],'kind':_0x13519b['kind'],'ktl':store[_0x5e8cd3(0x129)]};return this[_0x5e8cd3(0x156)](_0x5ac6c6);},async 'remove'(_0x4287ed){const _0x26b372=_0x7b2bfd,_0x41678a=artifactDir(_0xbe169,_0x4287ed);if(!fs['existsSync'](_0x41678a))throw new store['KtNotFoundError']('artifact\x20'+_0x4287ed);fs[_0x26b372(0x11c)](_0x41678a,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x2df1e1,_0x8533b6={}){const _0x38fabb=_0x1c48a8;fs[_0x38fabb(0x157)](_0x2df1e1,{'recursive':!![]});const _0x58f239=_0x3a082d=>path[_0x38fabb(0x12f)](_0x2df1e1,_0x3a082d+_0x38fabb(0x121));for(const [_0x316fe0,_0x3dbb14]of Object[_0x38fabb(0x11f)](_0x8533b6)){if(!fs[_0x38fabb(0x158)](_0x58f239(_0x316fe0)))fs[_0x38fabb(0x128)](_0x58f239(_0x316fe0),JSON[_0x38fabb(0x114)](_0x3dbb14,null,0x2),_0x38fabb(0x16c));}return{async 'get'(_0x4e648e){const _0x21841c=_0x38fabb,_0x58b7df=_0x58f239(_0x4e648e);if(!fs['existsSync'](_0x58b7df))throw new store[(_0x21841c(0x13f))](_0x21841c(0x144)+_0x4e648e);return JSON[_0x21841c(0x125)](fs[_0x21841c(0x126)](_0x58b7df,_0x21841c(0x16c)));},async 'save'(_0x4cfa87,_0x340c42){const _0xb510e0=_0x38fabb,_0x548e98=_0x58f239(_0x4cfa87),_0xeb38dc=fs['existsSync'](_0x548e98)?JSON[_0xb510e0(0x125)](fs[_0xb510e0(0x126)](_0x548e98,_0xb510e0(0x16c))):{'artifactId':'','values':{}},_0x95d937={'artifactId':_0xeb38dc[_0xb510e0(0x12a)],'values':{..._0xeb38dc['values'],..._0x340c42[_0xb510e0(0x169)]},'common':{..._0xeb38dc[_0xb510e0(0x149)],..._0x340c42[_0xb510e0(0x149)]},'tabCommon':{..._0xeb38dc['tabCommon'],..._0x340c42[_0xb510e0(0x14a)]}};fs['writeFileSync'](_0x548e98,JSON['stringify'](_0x95d937,null,0x2),_0xb510e0(0x16c));},async 'list'(_0x37b724){const _0x327f0c=_0x38fabb;return fs[_0x327f0c(0x15a)](_0x2df1e1)[_0x327f0c(0x123)](_0x1424fd=>_0x1424fd[_0x327f0c(0x136)](_0x327f0c(0x121)))[_0x327f0c(0x160)](_0x519b18=>{const _0x1ec8bf=_0x327f0c,_0x596467=_0x519b18[_0x1ec8bf(0x15d)](0x0,-0x5),_0x2061dc=JSON[_0x1ec8bf(0x125)](fs[_0x1ec8bf(0x126)](path[_0x1ec8bf(0x12f)](_0x2df1e1,_0x519b18),_0x1ec8bf(0x16c)));return{'id':_0x596467,'artifactId':_0x2061dc[_0x1ec8bf(0x12a)]};})[_0x327f0c(0x123)](_0x469aa5=>!_0x37b724||_0x469aa5[_0x327f0c(0x12a)]===_0x37b724);},async 'create'(_0x4bcfb5){const _0x2cae05=_0x38fabb,_0x5bb247='inst-'+Math[_0x2cae05(0x145)]()['toString'](0x24)[_0x2cae05(0x15d)](0x2,0xa);return fs[_0x2cae05(0x128)](_0x58f239(_0x5bb247),JSON[_0x2cae05(0x114)]({'artifactId':_0x4bcfb5[_0x2cae05(0x12a)],'values':{},'common':{}},null,0x2),_0x2cae05(0x16c)),{'id':_0x5bb247};}};}function sha256Hex(_0xa69759){const _0x2b3863=_0x1c48a8,_0x439f08=typeof _0xa69759===_0x2b3863(0x164)?Buffer[_0x2b3863(0x15e)](_0xa69759,_0x2b3863(0x16c)):Buffer[_0x2b3863(0x15e)](_0xa69759);return crypto[_0x2b3863(0x11d)](_0x2b3863(0x122))['update'](_0x439f08)[_0x2b3863(0x12e)](_0x2b3863(0x140));}function writeObject(_0x18d64e,_0x1ae899){const _0xe18077=_0x1c48a8,_0x559699=sha256Hex(_0x1ae899),_0x29fb21=objectPath(_0x18d64e,_0x559699);fs[_0xe18077(0x157)](path[_0xe18077(0x131)](_0x29fb21),{'recursive':!![]});if(!fs[_0xe18077(0x158)](_0x29fb21))fs[_0xe18077(0x128)](_0x29fb21,_0x1ae899);return _0x559699;}function readLog(_0x5d982e,_0x156989,_0x1ea341){const _0x352a63=_0x1c48a8,_0x2e9ad0=itemDir(_0x5d982e,_0x156989,_0x1ea341),_0x4d847a=path[_0x352a63(0x12f)](_0x2e9ad0,_0x352a63(0x15f)),_0x232101=path[_0x352a63(0x12f)](_0x2e9ad0,_0x352a63(0x120)),_0x4409e1=fs[_0x352a63(0x158)](_0x4d847a)?JSON[_0x352a63(0x125)](fs['readFileSync'](_0x4d847a,_0x352a63(0x16c))):[],_0x380a21=fs[_0x352a63(0x158)](_0x232101)?fs[_0x352a63(0x126)](_0x232101,_0x352a63(0x16c))[_0x352a63(0x153)]():_0x4409e1['at'](-0x1)?.[_0x352a63(0x161)]??null;return{'head':_0x380a21,'items':_0x4409e1};}function writeLog(_0x123537,_0x647465,_0x1de940,_0x22d8ff,_0x3519ad){const _0x2cd7cf=_0x1c48a8,_0x23811f=itemDir(_0x123537,_0x647465,_0x1de940);fs['mkdirSync'](_0x23811f,{'recursive':!![]}),fs[_0x2cd7cf(0x128)](path['join'](_0x23811f,_0x2cd7cf(0x15f)),JSON[_0x2cd7cf(0x114)](_0x3519ad,null,0x2),_0x2cd7cf(0x16c)),fs[_0x2cd7cf(0x128)](path[_0x2cd7cf(0x12f)](_0x23811f,_0x2cd7cf(0x120)),_0x22d8ff+'\x0a',_0x2cd7cf(0x16c));}function findRev(_0x28eb25,_0x5db388){const _0x3433ea=_0x1c48a8,_0x1d21ac=path[_0x3433ea(0x12f)](_0x28eb25,'items');if(!fs[_0x3433ea(0x158)](_0x1d21ac))return void 0x0;for(const _0x1870c9 of fs[_0x3433ea(0x15a)](_0x1d21ac,{'withFileTypes':!![]})){if(!_0x1870c9[_0x3433ea(0x134)]())continue;for(const _0x4b7c5c of fs['readdirSync'](path[_0x3433ea(0x12f)](_0x1d21ac,_0x1870c9['name']),{'withFileTypes':!![]})){if(!_0x4b7c5c['isDirectory']())continue;const _0x490a87=readLog(_0x28eb25,_0x1870c9[_0x3433ea(0x14c)],_0x4b7c5c[_0x3433ea(0x14c)])[_0x3433ea(0x13c)][_0x3433ea(0x127)](_0x4e4488=>_0x4e4488[_0x3433ea(0x161)]===_0x5db388);if(_0x490a87)return _0x490a87;}}return void 0x0;}function _0x4511(_0x4f85fc,_0x4e32cd){_0x4f85fc=_0x4f85fc-0x114;const _0x59d88b=_0x59d8();let _0x45117e=_0x59d88b[_0x4f85fc];if(_0x4511['VmIVwT']===undefined){var _0x2a6934=function(_0x2e0f7b){const _0x10c2e9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5320cf='',_0x4cd9df='';for(let _0x1cbbd8=0x0,_0x286c45,_0x34d923,_0x31e9a6=0x0;_0x34d923=_0x2e0f7b['charAt'](_0x31e9a6++);~_0x34d923&&(_0x286c45=_0x1cbbd8%0x4?_0x286c45*0x40+_0x34d923:_0x34d923,_0x1cbbd8++%0x4)?_0x5320cf+=String['fromCharCode'](0xff&_0x286c45>>(-0x2*_0x1cbbd8&0x6)):0x0){_0x34d923=_0x10c2e9['indexOf'](_0x34d923);}for(let _0x119e30=0x0,_0x2c1b7a=_0x5320cf['length'];_0x119e30<_0x2c1b7a;_0x119e30++){_0x4cd9df+='%'+('00'+_0x5320cf['charCodeAt'](_0x119e30)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4cd9df);};_0x4511['NnwOyU']=_0x2a6934,_0x4511['aLZYfx']={},_0x4511['VmIVwT']=!![];}const _0x383afd=_0x59d88b[0x0];_0x4511['wwpCdG']!==_0x383afd&&(_0x4511['aLZYfx']={},_0x4511['wwpCdG']=_0x383afd);const _0x561f7c=_0x4511['aLZYfx'][_0x4f85fc];return _0x561f7c===undefined?(_0x45117e=_0x4511['NnwOyU'](_0x45117e),_0x4511['aLZYfx'][_0x4f85fc]=_0x45117e):_0x45117e=_0x561f7c,_0x45117e;}function _0x59d8(){const _0x240176=['mtG3ntK2rNbbvKDW','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','s3rdB25MBgLJDevYCM9Y','Aw5ZDgfUy2uG','CMfUzg9T','qvjusuzbq1rFrKLmrv9gsuXm','qvjusuzbq1rFrKLmrv9ct0rz','AgvHza','y29TBw9U','DgfIq29TBw9U','zMLSzxnfCxvHBa','BMfTzq','qgSTDgfIBguVCMvWB3j0l3n0B3jL','zMfJzxm','CgfKu3rHCNq','Dg9tDhjPBMC','Dg9ju09tDhjPBMC','z2v0twLUDxrLCW','DhjPBq','y29TBwL0','zgvJB2rL','C2f2zq','BwTKAxjtEw5J','zxHPC3rZu3LUyW','mtCYmdqWofPWyvrzuW','CMvHzgrPCLn5BMm','y3DK','C2vLza','C2XPy2u','zNjVBq','Bg9NlMPZB24','BwfW','CMv2','lwXVy2fSlq','mZGZvgzWC1zz','C3rYAw5N','C29YDa','z2v0tw9UDgG','qvjusuzbq1rFrKLmrv9srvbpuLq','mtqWwKzwBLbS','DMfSDwvZ','DMvYC2LVBNnsB290','yxj0AwzHy3ruB0zPBgvZ','DxrMoa','zMLSzxm','y3jLyxrLs3rgC1n0B3jLCW','C3rYAw5NAwz5','A2LUza','zMLSzxnuB0fYDgLMywn0','B2jQzwn0CW','nZy3mgfOyKXmtq','z2v0rNvSBfLLyxi','z2v0rgf0zq','qvjusuzbq1rFrKLmrv9nrvrb','CM1tEw5J','y3jLyxrLsgfZAa','BM93','zw50CMLLCW','sevbra','lMPZB24','C2HHmJu2','zMLSDgvY','yxj0AwzHy3qG','CgfYC2u','CMvHzezPBgvtEw5J','zMLUza','D3jPDgvgAwXLu3LUyW','ru1qvfLFs1rm','yxj0AwzHy3rjza','z2v0','Cgf0Aa','Aw5ZDgfUy2vZuM9VDa','zgLNzxn0','AM9PBG','AxnbyNnVBhv0zq','zgLYBMfTzq','mtG5mtGYmhLjBgjbEq','lMv0ywC','AxneAxjLy3rVCNK','mJe2ouHjzNrqEG','zw5KC1DPDgG','yxj0AwzHy3rZuM9VDa','zxrHzW','z2v0sg91CNm','nLfxrLDpyG','5OgI5Asn6iEQia','AxrLBxm','mtyXndq1t1j6Ew1X','mJe1mdDHDw1jEeq','s3roB3rgB3vUzevYCM9Y','Agv4'];_0x59d8=function(){return _0x240176;};return _0x59d8();}function filesTextOf(_0xd0bc49,_0x458d48){const _0x135124=_0x1c48a8,_0x2edbea={};for(const [_0x49fe2a,_0x47ef6b]of Object[_0x135124(0x11f)](_0x458d48[_0x135124(0x16d)])){const _0x792b31=objectPath(_0xd0bc49,_0x47ef6b);if(fs[_0x135124(0x158)](_0x792b31))_0x2edbea[_0x49fe2a]=fs[_0x135124(0x126)](_0x792b31,_0x135124(0x16c));}return _0x2edbea;}function createFsVersionStore(_0x96d5ec,_0x311dcd){const _0x509b40=_0x1c48a8;return fs[_0x509b40(0x157)](_0x96d5ec,{'recursive':!![]}),{async 'log'(_0x12d342,_0x33db5d){const {head:_0x2d0fc8,items:_0x2ff8c2}=readLog(_0x96d5ec,_0x12d342,_0x33db5d);return{'head':_0x2d0fc8,'items':[..._0x2ff8c2]['sort']((_0x1de397,_0x67e940)=>_0x1de397['at']<_0x67e940['at']?0x1:-0x1)};},async 'get'(_0x44099a){const _0x50ba48=_0x509b40,_0xe291b5=findRev(_0x96d5ec,_0x44099a);if(!_0xe291b5)throw new store[(_0x50ba48(0x13f))]('rev\x20'+_0x44099a);return _0xe291b5;},async 'readFile'(_0x4f83b6,_0xa287fb){const _0x566fed=_0x509b40,_0x18996a=await this[_0x566fed(0x12b)](_0x4f83b6),_0x5b9a33=_0x18996a[_0x566fed(0x16d)][_0xa287fb];if(!_0x5b9a33)throw new store['KtNotFoundError'](_0xa287fb);const _0x293734=objectPath(_0x96d5ec,_0x5b9a33);if(!fs[_0x566fed(0x158)](_0x293734))throw new store[(_0x566fed(0x13f))](_0xa287fb);return new Uint8Array(fs[_0x566fed(0x126)](_0x293734));},async 'commit'(_0x2ee462){const _0x3beb5f=_0x509b40;let _0x26a9a2=_0x2ee462[_0x3beb5f(0x16d)];if(!_0x26a9a2){const _0x192cb1=await _0x311dcd['get'](_0x2ee462['id']);_0x26a9a2=store[_0x3beb5f(0x16b)](_0x192cb1);}const _0x3bf659={},_0x56a642={};for(const [_0x12e71b,_0x4fb1a6]of Object[_0x3beb5f(0x11f)](_0x26a9a2)){const _0x1a457e=typeof _0x4fb1a6===_0x3beb5f(0x164)?_0x4fb1a6:new TextDecoder()[_0x3beb5f(0x155)](_0x4fb1a6);_0x3bf659[_0x12e71b]=_0x1a457e,_0x56a642[_0x12e71b]=writeObject(_0x96d5ec,typeof _0x4fb1a6===_0x3beb5f(0x164)?Buffer['from'](_0x4fb1a6,'utf8'):_0x4fb1a6);}const _0x57a64a=readLog(_0x96d5ec,_0x2ee462[_0x3beb5f(0x115)],_0x2ee462['id']);if(_0x57a64a[_0x3beb5f(0x148)]){const _0x1c9f2d=_0x57a64a['items']['find'](_0x5b8ad2=>_0x5b8ad2[_0x3beb5f(0x161)]===_0x57a64a['head']);if(_0x1c9f2d&&store[_0x3beb5f(0x14b)](_0x3bf659,filesTextOf(_0x96d5ec,_0x1c9f2d)))return _0x1c9f2d;}const _0x1bacbe=new Date(),_0xfe5ce2=String(_0x1bacbe[_0x3beb5f(0x119)]())[_0x3beb5f(0x15d)](0x2)+String(_0x1bacbe[_0x3beb5f(0x166)]()+0x1)[_0x3beb5f(0x14f)](0x2,'0')+String(_0x1bacbe[_0x3beb5f(0x11a)]())[_0x3beb5f(0x14f)](0x2,'0')+String(_0x1bacbe[_0x3beb5f(0x139)]())[_0x3beb5f(0x14f)](0x2,'0')+String(_0x1bacbe[_0x3beb5f(0x152)]())[_0x3beb5f(0x14f)](0x2,'0'),_0x2d71ee=sha256Hex(Object['values'](_0x56a642)[_0x3beb5f(0x165)]()[_0x3beb5f(0x12f)](','))['slice'](0x0,0x8),_0x2e23a2={'rev':_0xfe5ce2+_0x3beb5f(0x162)+_0x2d71ee,'kind':_0x2ee462['kind'],'id':_0x2ee462['id'],'at':_0x1bacbe[_0x3beb5f(0x151)](),'parent':_0x57a64a[_0x3beb5f(0x148)],'by':_0x2ee462['by'],'note':_0x2ee462['note'],'files':_0x56a642,'meta':_0x2ee462['meta']};return writeLog(_0x96d5ec,_0x2ee462[_0x3beb5f(0x115)],_0x2ee462['id'],_0x2e23a2['rev'],[..._0x57a64a['items'],_0x2e23a2]),_0x2e23a2;},async 'restore'(_0x1cf6b9,_0x269be5,_0x4c75c7,_0x5163be){const _0x28f822=_0x509b40,_0x314173=await this[_0x28f822(0x12b)](_0x4c75c7),_0x295381={};for(const _0x3530b8 of Object['keys'](_0x314173['files'])){_0x295381[_0x3530b8]=new TextDecoder()['decode'](await this['readFile'](_0x4c75c7,_0x3530b8));}const _0x1ea399=store[_0x28f822(0x116)](_0x295381,_0x269be5);return await _0x311dcd[_0x28f822(0x156)]({..._0x1ea399,'id':_0x269be5,'kind':_0x1ea399[_0x28f822(0x115)],'etag':void 0x0}),this[_0x28f822(0x154)]({'kind':_0x1cf6b9,'id':_0x269be5,'files':_0x295381,'by':_0x5163be,'note':_0x28f822(0x13b)+_0x4c75c7});}};}function createKtFsStores(_0x31b791){const _0x34e05f=_0x1c48a8,_0x3abe03=createFsArtifactStore(resolveRoot(_0x31b791[_0x34e05f(0x137)],_0x31b791[_0x34e05f(0x15b)]),_0x31b791[_0x34e05f(0x15c)]),_0x1aff80=_0x31b791[_0x34e05f(0x12d)]?createFsInstanceStore(resolveRoot(_0x31b791['instancesRoot'],_0x31b791['cwd']),_0x31b791['seedInstances']):void 0x0,_0x12f638=_0x31b791[_0x34e05f(0x16a)]?createFsVersionStore(resolveRoot(_0x31b791[_0x34e05f(0x16a)],_0x31b791['cwd']),_0x3abe03):void 0x0;return{'artifacts':_0x3abe03,'instances':_0x1aff80,'versions':_0x12f638};}exports[_0x1c48a8(0x16e)]=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 _0x2ad0(_0x19cee3,_0x137b43){_0x19cee3=_0x19cee3-0xe9;const _0x1fe7cb=_0x1fe7();let _0x2ad0cb=_0x1fe7cb[_0x19cee3];if(_0x2ad0['IwBAti']===undefined){var _0x166161=function(_0x4dab4f){const _0x4d21e7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x53b6cb='',_0x3ad539='';for(let _0xc891f=0x0,_0x24346d,_0x13ad40,_0x42aa47=0x0;_0x13ad40=_0x4dab4f['charAt'](_0x42aa47++);~_0x13ad40&&(_0x24346d=_0xc891f%0x4?_0x24346d*0x40+_0x13ad40:_0x13ad40,_0xc891f++%0x4)?_0x53b6cb+=String['fromCharCode'](0xff&_0x24346d>>(-0x2*_0xc891f&0x6)):0x0){_0x13ad40=_0x4d21e7['indexOf'](_0x13ad40);}for(let _0x15f205=0x0,_0x4e2379=_0x53b6cb['length'];_0x15f205<_0x4e2379;_0x15f205++){_0x3ad539+='%'+('00'+_0x53b6cb['charCodeAt'](_0x15f205)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3ad539);};_0x2ad0['yFHpQg']=_0x166161,_0x2ad0['yhgnZA']={},_0x2ad0['IwBAti']=!![];}const _0x406643=_0x1fe7cb[0x0];_0x2ad0['ViEvWd']!==_0x406643&&(_0x2ad0['yhgnZA']={},_0x2ad0['ViEvWd']=_0x406643);const _0xc9988b=_0x2ad0['yhgnZA'][_0x19cee3];return _0xc9988b===undefined?(_0x2ad0cb=_0x2ad0['yFHpQg'](_0x2ad0cb),_0x2ad0['yhgnZA'][_0x19cee3]=_0x2ad0cb):_0x2ad0cb=_0xc9988b,_0x2ad0cb;}const _0x2e7ec5=_0x2ad0;(function(_0x5a1455,_0x2defd7){const _0x3839bf=_0x2ad0,_0x33f521=_0x5a1455();while(!![]){try{const _0x1f82fa=-parseInt(_0x3839bf(0x115))/0x1*(parseInt(_0x3839bf(0x10b))/0x2)+parseInt(_0x3839bf(0x126))/0x3*(-parseInt(_0x3839bf(0x129))/0x4)+-parseInt(_0x3839bf(0xfe))/0x5*(parseInt(_0x3839bf(0x10c))/0x6)+parseInt(_0x3839bf(0x106))/0x7*(-parseInt(_0x3839bf(0xf7))/0x8)+parseInt(_0x3839bf(0x124))/0x9+-parseInt(_0x3839bf(0x11b))/0xa+parseInt(_0x3839bf(0x12f))/0xb;if(_0x1f82fa===_0x2defd7)break;else _0x33f521['push'](_0x33f521['shift']());}catch(_0xeecb85){_0x33f521['push'](_0x33f521['shift']());}}}(_0x1fe7,0x25cfb));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(_0x3ad539,_0xc891f=process[_0x2e7ec5(0x12b)]()){const _0x24346d=isAbsolute(_0x3ad539)?_0x3ad539:resolve(_0xc891f,_0x3ad539);return mkdirSync(_0x24346d,{'recursive':!![]}),_0x24346d;}function _0x1fe7(){const _0x1a2e49=['AxneAxjLy3rVCNK','mtq5mtKWmfnfD2zyyW','CMvHzezPBgu','BM93','lMv0ywC','CMv2ia','DxbKyxrL','DMfSDwvZ','C3rYAw5NAwz5','C2HHmJu2','odGZndC2z3HwC1fy','C2vLza','mty4y2TiuvvO','Aw5ZDgfUy2uG','C2XPy2u','mtm0mZzAtu1iu0O','BMfTzq','y3DK','yxj0AwzHy3rZuM9VDa','DxrMoa','z2v0twLUDxrLCW','mta4mZyWnJDzuMrIzM0','Dg9tDhjPBMC','zw5KC1DPDgG','CMfUzg9T','z2v0sg91CNm','BM90zq','DMvYC2LVBNnsB290','BwfW','z2v0tw9UDgG','Aw5ZDc0','Aw5ZDgfUy2vZuM9VDa','zMfJzxm','zMLUza','yxj0AwzHy3rjza','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','yxj0AwzHy3qG','mtz4sKzIwMG','DgfIq29TBw9U','zw50CMLLCW','z2v0','y29TBwL0','B2jQzwn0CW','zMLSzxm','mtb2u2vxA1a','Bg9NlMPZB24','zgvJB2rL','y29TBw9U','CMv2','CgfKu3rHCNq','zxrHzW','AgvHza','mtiZndq1wvDrBenn','zNjVBq','zMLSDgvY','CgfYC2u','C2f2zq','mJK4ndC2D2rTCwD2','nZCYmdm4tKLfDgr4','Dg9ju09tDhjPBMC','C3rYAw5N','AM9PBG','sevbra','DhjPBq','C29YDa','A2v5CW','lwXVy2fSlq','mMf4CxvHsW','lMPZB24','AxrLBxm','z2v0rgf0zq','A2LUza'];_0x1fe7=function(){return _0x1a2e49;};return _0x1fe7();}function artifactDir(_0x13ad40,_0x42aa47){return join(_0x13ad40,_0x42aa47);}function objectPath(_0x15f205,_0x4e2379){const _0x1cacd2=_0x2e7ec5;return join(_0x15f205,_0x1cacd2(0xfc),_0x4e2379[_0x1cacd2(0x128)](0x0,0x2),_0x4e2379);}function itemDir(_0x51bee3,_0xe3d7d4,_0x3740e9){const _0x498c7d=_0x2e7ec5;return join(_0x51bee3,_0x498c7d(0x117),_0xe3d7d4,_0x3740e9);}function newEtag(){const _0x3a6cff=_0x2e7ec5;return Date[_0x3a6cff(0x11d)]()[_0x3a6cff(0x130)](0x24)+'-'+Math[_0x3a6cff(0xea)]()[_0x3a6cff(0x130)](0x24)[_0x3a6cff(0x128)](0x2,0x8);}function readEtag(_0x6ef7b7){const _0x532c2b=_0x2e7ec5,_0x9f5b2c=join(_0x6ef7b7,'.etag');return existsSync(_0x9f5b2c)?readFileSync(_0x9f5b2c,_0x532c2b(0x12d))[_0x532c2b(0x111)]():void 0x0;}function writeArtifactDir(_0x51e527,_0x1c47b7,_0x4e917f){const _0x56bd75=_0x2e7ec5;mkdirSync(join(_0x51e527,_0x56bd75(0xf2)),{'recursive':!![]});const _0x5b6242=artifactToFiles(_0x1c47b7);writeFileSync(join(_0x51e527,ARTIFACT_FILE_META),_0x5b6242[ARTIFACT_FILE_META]??'{}',_0x56bd75(0x12d)),writeFileSync(join(_0x51e527,ARTIFACT_FILE_BODY),_0x5b6242[ARTIFACT_FILE_BODY]??'',_0x56bd75(0x12d));const _0x54ee2a=join(_0x51e527,ARTIFACT_FILE_FILL),_0x457736=join(_0x51e527,ARTIFACT_FILE_REPORT);if(_0x5b6242[ARTIFACT_FILE_FILL])writeFileSync(_0x54ee2a,_0x5b6242[ARTIFACT_FILE_FILL],_0x56bd75(0x12d));else{if(existsSync(_0x54ee2a))rmSync(_0x54ee2a);}if(_0x5b6242[ARTIFACT_FILE_REPORT])writeFileSync(_0x457736,_0x5b6242[ARTIFACT_FILE_REPORT],_0x56bd75(0x12d));else{if(existsSync(_0x457736))rmSync(_0x457736);}writeFileSync(join(_0x51e527,_0x56bd75(0x11e)),_0x4e917f,_0x56bd75(0x12d));}function readArtifactDir(_0x40f561,_0x358ddd){const _0x30514a=_0x2e7ec5,_0xc7a315={},_0x614bd1=join(_0x40f561,ARTIFACT_FILE_META),_0x3ea9f4=join(_0x40f561,ARTIFACT_FILE_BODY);if(existsSync(_0x614bd1))_0xc7a315[ARTIFACT_FILE_META]=readFileSync(_0x614bd1,_0x30514a(0x12d));if(existsSync(_0x3ea9f4))_0xc7a315[ARTIFACT_FILE_BODY]=readFileSync(_0x3ea9f4,_0x30514a(0x12d));const _0x3d5a82=join(_0x40f561,ARTIFACT_FILE_FILL),_0x494ba9=join(_0x40f561,ARTIFACT_FILE_REPORT);if(existsSync(_0x3d5a82))_0xc7a315[ARTIFACT_FILE_FILL]=readFileSync(_0x3d5a82,'utf8');if(existsSync(_0x494ba9))_0xc7a315[ARTIFACT_FILE_REPORT]=readFileSync(_0x494ba9,_0x30514a(0x12d));return{...filesToArtifact(_0xc7a315,_0x358ddd),'etag':readEtag(_0x40f561)};}function createFsArtifactStore(_0xe8c1a2,_0x2dc33e=[]){const _0x224c31=_0x2e7ec5;mkdirSync(_0xe8c1a2,{'recursive':!![]});for(const _0x24fb31 of _0x2dc33e){const _0x120cfa=artifactDir(_0xe8c1a2,_0x24fb31['id']),_0xb58ed0=join(_0x120cfa,ARTIFACT_FILE_BODY);if(!existsSync(_0xb58ed0))writeArtifactDir(_0x120cfa,_0x24fb31,_0x24fb31[_0x224c31(0x104)]??newEtag());}return{async 'list'(_0x5443d7){const _0x445b24=_0x224c31;if(!existsSync(_0xe8c1a2))return[];const _0x2fc46d=[];for(const _0x4c7df4 of readdirSync(_0xe8c1a2,{'withFileTypes':!![]})){if(!_0x4c7df4[_0x445b24(0x11a)]())continue;try{const _0x3eb70c=readArtifactDir(artifactDir(_0xe8c1a2,_0x4c7df4[_0x445b24(0x12a)]),_0x4c7df4[_0x445b24(0x12a)]);if(!_0x5443d7||_0x3eb70c[_0x445b24(0x119)]===_0x5443d7)_0x2fc46d['push']({'id':_0x3eb70c['id'],'name':_0x3eb70c[_0x445b24(0x12a)],'kind':_0x3eb70c[_0x445b24(0x119)]});}catch{}}return _0x2fc46d;},async 'get'(_0x25225f){const _0x145471=_0x224c31,_0x4126e0=artifactDir(_0xe8c1a2,_0x25225f);if(!existsSync(_0x4126e0))throw new KtNotFoundError(_0x145471(0xf6)+_0x25225f);return readArtifactDir(_0x4126e0,_0x25225f);},async 'save'(_0x32333c){const _0x5e9b4a=_0x224c31,_0x15ec2d=artifactDir(_0xe8c1a2,_0x32333c['id']),_0x21656a=existsSync(_0x15ec2d)?readArtifactDir(_0x15ec2d,_0x32333c['id']):void 0x0;if(_0x32333c[_0x5e9b4a(0x104)]&&_0x21656a?.['etag']&&_0x32333c[_0x5e9b4a(0x104)]!==_0x21656a[_0x5e9b4a(0x104)])throw new KtConflictError(_0x5e9b4a(0xf5),_0x21656a);const _0x1c264f=newEtag();return writeArtifactDir(_0x15ec2d,_0x32333c,_0x1c264f),{..._0x32333c,'etag':_0x1c264f};},async 'create'(_0x43f3bc){const _0x1909da=_0x224c31,_0x2bfcc7=_0x43f3bc[_0x1909da(0x119)]+'-'+Math[_0x1909da(0xea)]()[_0x1909da(0x130)](0x24)['slice'](0x2,0xa),_0x1d2ebd={'id':_0x2bfcc7,'name':_0x43f3bc[_0x1909da(0x12a)],'kind':_0x43f3bc[_0x1909da(0x119)],'ktl':EMPTY_KTL};return this[_0x1909da(0x10a)](_0x1d2ebd);},async 'remove'(_0x152bd0){const _0x4af6be=_0x224c31,_0x14eb3e=artifactDir(_0xe8c1a2,_0x152bd0);if(!existsSync(_0x14eb3e))throw new KtNotFoundError(_0x4af6be(0xf6)+_0x152bd0);rmSync(_0x14eb3e,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0xbeaa98,_0x359dd5={}){const _0x4096dd=_0x2e7ec5;mkdirSync(_0xbeaa98,{'recursive':!![]});const _0x32222a=_0x4525b0=>join(_0xbeaa98,_0x4525b0+_0x4096dd(0x116));for(const [_0x1d6480,_0x2f7378]of Object[_0x4096dd(0xf9)](_0x359dd5)){if(!existsSync(_0x32222a(_0x1d6480)))writeFileSync(_0x32222a(_0x1d6480),JSON[_0x4096dd(0x122)](_0x2f7378,null,0x2),_0x4096dd(0x12d));}return{async 'get'(_0x2d1732){const _0x491213=_0x4096dd,_0x276ffa=_0x32222a(_0x2d1732);if(!existsSync(_0x276ffa))throw new KtNotFoundError(_0x491213(0x127)+_0x2d1732);return JSON['parse'](readFileSync(_0x276ffa,_0x491213(0x12d)));},async 'save'(_0x29d44a,_0x45cdda){const _0x3352d7=_0x4096dd,_0x114b2d=_0x32222a(_0x29d44a),_0x2f5424=existsSync(_0x114b2d)?JSON[_0x3352d7(0x109)](readFileSync(_0x114b2d,'utf8')):{'artifactId':'','values':{}},_0x12e955={'artifactId':_0x2f5424[_0x3352d7(0xf4)],'values':{..._0x2f5424[_0x3352d7(0x121)],..._0x45cdda['values']},'common':{..._0x2f5424[_0x3352d7(0x101)],..._0x45cdda[_0x3352d7(0x101)]},'tabCommon':{..._0x2f5424[_0x3352d7(0xf8)],..._0x45cdda[_0x3352d7(0xf8)]}};writeFileSync(_0x114b2d,JSON[_0x3352d7(0x122)](_0x12e955,null,0x2),_0x3352d7(0x12d));},async 'list'(_0x52f141){const _0x43464a=_0x4096dd;return readdirSync(_0xbeaa98)[_0x43464a(0x108)](_0x2430dd=>_0x2430dd[_0x43464a(0xe9)](_0x43464a(0x116)))[_0x43464a(0xee)](_0x47c579=>{const _0x2b2c69=_0x43464a,_0x3804a2=_0x47c579[_0x2b2c69(0x128)](0x0,-0x5),_0x3fc8f3=JSON[_0x2b2c69(0x109)](readFileSync(join(_0xbeaa98,_0x47c579),_0x2b2c69(0x12d)));return{'id':_0x3804a2,'artifactId':_0x3fc8f3['artifactId']};})['filter'](_0x407c4c=>!_0x52f141||_0x407c4c['artifactId']===_0x52f141);},async 'create'(_0x15ebb6){const _0x58e071=_0x4096dd,_0x3d897e=_0x58e071(0xf0)+Math[_0x58e071(0xea)]()[_0x58e071(0x130)](0x24)[_0x58e071(0x128)](0x2,0xa);return writeFileSync(_0x32222a(_0x3d897e),JSON['stringify']({'artifactId':_0x15ebb6[_0x58e071(0xf4)],'values':{},'common':{}},null,0x2),_0x58e071(0x12d)),{'id':_0x3d897e};}};}function sha256Hex(_0x116fd4){const _0x3e098b=_0x2e7ec5,_0x3ff0af=typeof _0x116fd4===_0x3e098b(0x10e)?Buffer[_0x3e098b(0x107)](_0x116fd4,_0x3e098b(0x12d)):Buffer[_0x3e098b(0x107)](_0x116fd4);return createHash(_0x3e098b(0x123))[_0x3e098b(0x120)](_0x3ff0af)['digest']('hex');}function writeObject(_0x275423,_0x1b217e){const _0x134117=sha256Hex(_0x1b217e),_0x2b0e28=objectPath(_0x275423,_0x134117);mkdirSync(dirname(_0x2b0e28),{'recursive':!![]});if(!existsSync(_0x2b0e28))writeFileSync(_0x2b0e28,_0x1b217e);return _0x134117;}function readLog(_0x4f90ec,_0x39f3df,_0x2bc601){const _0x468c33=_0x2e7ec5,_0x41bf7b=itemDir(_0x4f90ec,_0x39f3df,_0x2bc601),_0x2894e8=join(_0x41bf7b,_0x468c33(0xff)),_0x524490=join(_0x41bf7b,'HEAD'),_0x3ee062=existsSync(_0x2894e8)?JSON[_0x468c33(0x109)](readFileSync(_0x2894e8,_0x468c33(0x12d))):[],_0x3594b8=existsSync(_0x524490)?readFileSync(_0x524490,_0x468c33(0x12d))[_0x468c33(0x111)]():_0x3ee062['at'](-0x1)?.[_0x468c33(0x102)]??null;return{'head':_0x3594b8,'items':_0x3ee062};}function writeLog(_0x4f0076,_0x2b9355,_0x5443cb,_0x27f0d6,_0x452d5e){const _0xa73dd1=_0x2e7ec5,_0x69365d=itemDir(_0x4f0076,_0x2b9355,_0x5443cb);mkdirSync(_0x69365d,{'recursive':!![]}),writeFileSync(join(_0x69365d,_0xa73dd1(0xff)),JSON[_0xa73dd1(0x122)](_0x452d5e,null,0x2),'utf8'),writeFileSync(join(_0x69365d,_0xa73dd1(0x110)),_0x27f0d6+'\x0a','utf8');}function findRev(_0x1800cd,_0x268764){const _0x5763c0=_0x2e7ec5,_0x3e478a=join(_0x1800cd,_0x5763c0(0x117));if(!existsSync(_0x3e478a))return void 0x0;for(const _0x3e2a20 of readdirSync(_0x3e478a,{'withFileTypes':!![]})){if(!_0x3e2a20[_0x5763c0(0x11a)]())continue;for(const _0x5224d6 of readdirSync(join(_0x3e478a,_0x3e2a20[_0x5763c0(0x12a)]),{'withFileTypes':!![]})){if(!_0x5224d6[_0x5763c0(0x11a)]())continue;const _0x4853b3=readLog(_0x1800cd,_0x3e2a20['name'],_0x5224d6[_0x5763c0(0x12a)])[_0x5763c0(0x117)][_0x5763c0(0xf3)](_0x150af5=>_0x150af5[_0x5763c0(0x102)]===_0x268764);if(_0x4853b3)return _0x4853b3;}}return void 0x0;}function filesTextOf(_0x3ec2f9,_0x20e6c0){const _0x5f3c7b=_0x2e7ec5,_0x56df68={};for(const [_0x2c37d9,_0x2ac57b]of Object[_0x5f3c7b(0xf9)](_0x20e6c0[_0x5f3c7b(0xfd)])){const _0x47b7b8=objectPath(_0x3ec2f9,_0x2ac57b);if(existsSync(_0x47b7b8))_0x56df68[_0x2c37d9]=readFileSync(_0x47b7b8,_0x5f3c7b(0x12d));}return _0x56df68;}function createFsVersionStore(_0x3a654b,_0x52bbea){return mkdirSync(_0x3a654b,{'recursive':!![]}),{async 'log'(_0x5e0dce,_0x44ab60){const _0x218a2e=_0x2ad0,{head:_0x4e23e4,items:_0xec6024}=readLog(_0x3a654b,_0x5e0dce,_0x44ab60);return{'head':_0x4e23e4,'items':[..._0xec6024][_0x218a2e(0x112)]((_0x2ebfef,_0x274f0e)=>_0x2ebfef['at']<_0x274f0e['at']?0x1:-0x1)};},async 'get'(_0x339c22){const _0x383d10=_0x2ad0,_0x5d9676=findRev(_0x3a654b,_0x339c22);if(!_0x5d9676)throw new KtNotFoundError(_0x383d10(0x11f)+_0x339c22);return _0x5d9676;},async 'readFile'(_0x2c0689,_0x1c50a2){const _0x7a4d7d=_0x2ad0,_0x351a60=await this[_0x7a4d7d(0xfa)](_0x2c0689),_0x5336c4=_0x351a60[_0x7a4d7d(0xfd)][_0x1c50a2];if(!_0x5336c4)throw new KtNotFoundError(_0x1c50a2);const _0x9cd760=objectPath(_0x3a654b,_0x5336c4);if(!existsSync(_0x9cd760))throw new KtNotFoundError(_0x1c50a2);return new Uint8Array(readFileSync(_0x9cd760));},async 'commit'(_0x40c266){const _0x1d2888=_0x2ad0;let _0x425876=_0x40c266[_0x1d2888(0xfd)];if(!_0x425876){const _0x48de79=await _0x52bbea[_0x1d2888(0xfa)](_0x40c266['id']);_0x425876=artifactToFiles(_0x48de79);}const _0x461dd6={},_0x39c3ff={};for(const [_0x50f01a,_0x5a5a3f]of Object['entries'](_0x425876)){const _0xfae9cc=typeof _0x5a5a3f===_0x1d2888(0x10e)?_0x5a5a3f:new TextDecoder()[_0x1d2888(0x100)](_0x5a5a3f);_0x461dd6[_0x50f01a]=_0xfae9cc,_0x39c3ff[_0x50f01a]=writeObject(_0x3a654b,typeof _0x5a5a3f==='string'?Buffer[_0x1d2888(0x107)](_0x5a5a3f,_0x1d2888(0x12d)):_0x5a5a3f);}const _0x33ea6e=readLog(_0x3a654b,_0x40c266[_0x1d2888(0x119)],_0x40c266['id']);if(_0x33ea6e[_0x1d2888(0x105)]){const _0x2cb783=_0x33ea6e['items']['find'](_0x37f14e=>_0x37f14e['rev']===_0x33ea6e[_0x1d2888(0x105)]);if(_0x2cb783&&filesEqual(_0x461dd6,filesTextOf(_0x3a654b,_0x2cb783)))return _0x2cb783;}const _0x4e97db=new Date(),_0x2b196f=String(_0x4e97db['getFullYear']())[_0x1d2888(0x128)](0x2)+String(_0x4e97db[_0x1d2888(0xef)]()+0x1)[_0x1d2888(0x103)](0x2,'0')+String(_0x4e97db[_0x1d2888(0x118)]())['padStart'](0x2,'0')+String(_0x4e97db[_0x1d2888(0xeb)]())[_0x1d2888(0x103)](0x2,'0')+String(_0x4e97db[_0x1d2888(0x12e)]())[_0x1d2888(0x103)](0x2,'0'),_0x10b335=sha256Hex(Object[_0x1d2888(0x121)](_0x39c3ff)['sort']()[_0x1d2888(0x10f)](','))[_0x1d2888(0x128)](0x0,0x8),_0x5c0bd6={'rev':_0x2b196f+_0x1d2888(0x114)+_0x10b335,'kind':_0x40c266[_0x1d2888(0x119)],'id':_0x40c266['id'],'at':_0x4e97db[_0x1d2888(0x10d)](),'parent':_0x33ea6e['head'],'by':_0x40c266['by'],'note':_0x40c266[_0x1d2888(0xec)],'files':_0x39c3ff,'meta':_0x40c266['meta']};return writeLog(_0x3a654b,_0x40c266[_0x1d2888(0x119)],_0x40c266['id'],_0x5c0bd6['rev'],[..._0x33ea6e['items'],_0x5c0bd6]),_0x5c0bd6;},async 'restore'(_0x367053,_0x3e7dae,_0x202094,_0xf885ae){const _0x470b8b=_0x2ad0,_0xe11d32=await this['get'](_0x202094),_0x34439e={};for(const _0x445e46 of Object[_0x470b8b(0x113)](_0xe11d32[_0x470b8b(0xfd)])){_0x34439e[_0x445e46]=new TextDecoder()[_0x470b8b(0x100)](await this[_0x470b8b(0x11c)](_0x202094,_0x445e46));}const _0x3488ae=filesToArtifact(_0x34439e,_0x3e7dae);return await _0x52bbea['save']({..._0x3488ae,'id':_0x3e7dae,'kind':_0x3488ae[_0x470b8b(0x119)],'etag':void 0x0}),this[_0x470b8b(0xfb)]({'kind':_0x367053,'id':_0x3e7dae,'files':_0x34439e,'by':_0xf885ae,'note':'\u6062\u590D\u81EA\x20'+_0x202094});}};}function createKtFsStores(_0x5daf39){const _0xaafbb6=_0x2e7ec5,_0x1156d2=createFsArtifactStore(resolveRoot(_0x5daf39[_0xaafbb6(0x12c)],_0x5daf39[_0xaafbb6(0x12b)]),_0x5daf39[_0xaafbb6(0x125)]),_0x3109a7=_0x5daf39[_0xaafbb6(0xf1)]?createFsInstanceStore(resolveRoot(_0x5daf39[_0xaafbb6(0xf1)],_0x5daf39[_0xaafbb6(0x12b)]),_0x5daf39['seedInstances']):void 0x0,_0x45b329=_0x5daf39[_0xaafbb6(0xed)]?createFsVersionStore(resolveRoot(_0x5daf39[_0xaafbb6(0xed)],_0x5daf39[_0xaafbb6(0x12b)]),_0x1156d2):void 0x0;return{'artifacts':_0x1156d2,'instances':_0x3109a7,'versions':_0x45b329};}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';function _0x2da7(_0x5c85b9,_0x33461a){_0x5c85b9=_0x5c85b9-0x11d;const _0x51f432=_0x51f4();let _0x2da72d=_0x51f432[_0x5c85b9];if(_0x2da7['iZOBpx']===undefined){var _0x19345e=function(_0x1ac19a){const _0x5e90c8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x30a094='',_0x2781ce='';for(let _0x2f20af=0x0,_0x344f7d,_0x238060,_0x1d84df=0x0;_0x238060=_0x1ac19a['charAt'](_0x1d84df++);~_0x238060&&(_0x344f7d=_0x2f20af%0x4?_0x344f7d*0x40+_0x238060:_0x238060,_0x2f20af++%0x4)?_0x30a094+=String['fromCharCode'](0xff&_0x344f7d>>(-0x2*_0x2f20af&0x6)):0x0){_0x238060=_0x5e90c8['indexOf'](_0x238060);}for(let _0x24faff=0x0,_0x4e9eed=_0x30a094['length'];_0x24faff<_0x4e9eed;_0x24faff++){_0x2781ce+='%'+('00'+_0x30a094['charCodeAt'](_0x24faff)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2781ce);};_0x2da7['WgYQQM']=_0x19345e,_0x2da7['houssj']={},_0x2da7['iZOBpx']=!![];}const _0x310f51=_0x51f432[0x0];_0x2da7['JfrNqm']!==_0x310f51&&(_0x2da7['houssj']={},_0x2da7['JfrNqm']=_0x310f51);const _0x35c23e=_0x2da7['houssj'][_0x5c85b9];return _0x35c23e===undefined?(_0x2da72d=_0x2da7['WgYQQM'](_0x2da72d),_0x2da7['houssj'][_0x5c85b9]=_0x2da72d):_0x2da72d=_0x35c23e,_0x2da72d;}const _0x2797f7=_0x2da7;(function(_0x5196bb,_0x27b1cd){const _0xaa79bd=_0x2da7,_0x5c9900=_0x5196bb();while(!![]){try{const _0x186668=-parseInt(_0xaa79bd(0x12a))/0x1+-parseInt(_0xaa79bd(0x141))/0x2*(parseInt(_0xaa79bd(0x140))/0x3)+parseInt(_0xaa79bd(0x122))/0x4*(parseInt(_0xaa79bd(0x11d))/0x5)+-parseInt(_0xaa79bd(0x132))/0x6+-parseInt(_0xaa79bd(0x123))/0x7+parseInt(_0xaa79bd(0x14e))/0x8+-parseInt(_0xaa79bd(0x144))/0x9*(-parseInt(_0xaa79bd(0x12f))/0xa);if(_0x186668===_0x27b1cd)break;else _0x5c9900['push'](_0x5c9900['shift']());}catch(_0x327fa9){_0x5c9900['push'](_0x5c9900['shift']());}}}(_0x51f4,0xdf3b1));var store=require(_0x2797f7(0x137));async function pathParts(_0x2781ce,_0x2f20af){const _0x42173b=_0x2797f7,_0x344f7d=_0x2781ce['params']?await _0x2781ce[_0x42173b(0x12e)]:void 0x0;if(_0x344f7d?.[_0x42173b(0x145)]?.[_0x42173b(0x138)])return _0x344f7d['path'];const _0x238060=_0x2f20af[_0x42173b(0x143)][_0x42173b(0x129)](_0x42173b(0x13c)),_0x1d84df=_0x238060>=0x0?_0x2f20af[_0x42173b(0x143)][_0x42173b(0x11f)](_0x238060+_0x42173b(0x13c)[_0x42173b(0x138)]):_0x2f20af[_0x42173b(0x143)];return _0x1d84df[_0x42173b(0x14b)]('/')['filter'](Boolean);}function json(_0x24faff,_0x4e9eed=0xc8){const _0x5def76=_0x2797f7;return new Response(JSON['stringify'](_0x24faff),{'status':_0x4e9eed,'headers':{'content-type':_0x5def76(0x150)}});}function fail(_0x44c39f){const _0x227042=_0x2797f7;if(_0x44c39f instanceof store['KtConflictError'])return json({'message':_0x44c39f['message'],'current':_0x44c39f[_0x227042(0x13f)]},0x199);if(_0x44c39f instanceof store[_0x227042(0x139)])return json({'message':_0x44c39f[_0x227042(0x134)]},0x194);if(_0x44c39f instanceof store[_0x227042(0x146)])return json({'message':_0x44c39f[_0x227042(0x134)]},_0x44c39f['status']??0x1f4);return json({'message':_0x44c39f instanceof Error?_0x44c39f[_0x227042(0x134)]:_0x227042(0x130)},0x1f4);}async function readBody(_0x21313f){const _0x5ea5c7=await _0x21313f['text']();if(!_0x5ea5c7)return null;return JSON['parse'](_0x5ea5c7);}function _0x51f4(){const _0x32f023=['zgvMAw5Ls3rdB25MAwC','C3bSAxq','CMvZDg9Yzq','yxj0AwzHy3rjza','nda4oti2nfzrq01Usq','CMvTB3zL','yxbWBgLJyxrPB24VANnVBJSGy2HHCNnLDd11DgyToa','5PYQ5OM+5yIW','mti4nxzUzfPXzq','r0vu','C2XPy2u','BgLZDa','zNjVBq','mJeZmJHfCu1uqLC','nJG3nJK1neznt3DiCG','Aw5ZDgfUy2vZioACQUMfJEE9RG','z2v0','Aw5ZDgfUy2vZ','ufvu','ue9tva','Aw5KzxHpzG','mta2oda2ngryvhnHuq','CMvTB3zLioACQUwUNUEoSa','DxjS','y3jLyxrLioACQUwUNUEoSa','CgfYyw1Z','nJqYmZGWB2rdtxLo','5yAf6yoO6zsz6k+V','yxj0AwzHy3rZ','odq2nZi0mLrnwgDlra','DMvYC2LVBNm','BwvZC2fNzq','Bg9N','DMvYC2LVBNmG5PYQ6ywn572U','qgSTDgfIBguVCMvWB3j0l3n0B3jL','BgvUz3rO','s3roB3rgB3vUzevYCM9Y','y3jLyxrLs3riyw5KBgvY','revmrvrf','l2fWAs9RDa','zMLSzq','A2LUza','y3vYCMvUDa','ndjbBufWANa','nZq5ndznEfjSyLu','y29TBwL0','Cgf0Ag5HBwu','ndiZzMvktxfb','Cgf0Aa','s3rtDg9YzuvYCM9Y','C2vHCMnOugfYyw1Z','y3jLyxrL','C2f2zq'];_0x51f4=function(){return _0x32f023;};return _0x51f4();}function createKtHandler(_0x2748fb){const _0x34919e=async(_0x4ba339,_0x4039d3={})=>{const _0x4081cd=_0x2da7;try{const _0xea4654=new URL(_0x4ba339[_0x4081cd(0x12c)]),_0x46c773=await pathParts(_0x4039d3,_0xea4654),[_0x31e9ad,_0x53b3fb,_0x52ea95]=_0x46c773,_0x31fb0a=_0x4ba339['method']['toUpperCase']();if(_0x31e9ad==='artifacts'&&!_0x53b3fb&&_0x31fb0a===_0x4081cd(0x11e)){const _0x392bca=_0xea4654[_0x4081cd(0x147)]['get'](_0x4081cd(0x13e));return json({'items':await _0x2748fb['artifacts'][_0x4081cd(0x120)](_0x392bca||void 0x0)});}if(_0x31e9ad===_0x4081cd(0x131)&&!_0x53b3fb&&_0x31fb0a===_0x4081cd(0x128)){if(!_0x2748fb[_0x4081cd(0x131)]['create'])return json({'message':_0x4081cd(0x12d)},0x194);return json(await _0x2748fb[_0x4081cd(0x131)][_0x4081cd(0x148)](await readBody(_0x4ba339)));}if(_0x31e9ad===_0x4081cd(0x131)&&_0x53b3fb&&_0x31fb0a===_0x4081cd(0x11e))return json(await _0x2748fb[_0x4081cd(0x131)]['get'](_0x53b3fb));if(_0x31e9ad===_0x4081cd(0x131)&&_0x53b3fb&&_0x31fb0a===_0x4081cd(0x127))return json(await _0x2748fb[_0x4081cd(0x131)][_0x4081cd(0x149)](await readBody(_0x4ba339)));if(_0x31e9ad===_0x4081cd(0x131)&&_0x53b3fb&&_0x31fb0a===_0x4081cd(0x13b)){if(!_0x2748fb[_0x4081cd(0x131)]['remove'])return json({'message':_0x4081cd(0x12b)},0x194);return await _0x2748fb[_0x4081cd(0x131)][_0x4081cd(0x14f)](_0x53b3fb),json({'ok':!![]});}if(_0x31e9ad===_0x4081cd(0x126)){if(!_0x2748fb['instances'])return json({'message':_0x4081cd(0x124)},0x194);if(!_0x53b3fb&&_0x31fb0a===_0x4081cd(0x11e))return json({'items':await _0x2748fb[_0x4081cd(0x126)]['list']?.(_0xea4654[_0x4081cd(0x147)][_0x4081cd(0x125)](_0x4081cd(0x14d))??void 0x0)??[]});if(!_0x53b3fb&&_0x31fb0a===_0x4081cd(0x128)){if(!_0x2748fb[_0x4081cd(0x126)]['create'])return json({'message':_0x4081cd(0x12d)},0x194);return json(await _0x2748fb['instances'][_0x4081cd(0x148)](await readBody(_0x4ba339)));}if(_0x53b3fb&&_0x31fb0a===_0x4081cd(0x11e))return json(await _0x2748fb[_0x4081cd(0x126)][_0x4081cd(0x125)](_0x53b3fb));if(_0x53b3fb&&_0x31fb0a===_0x4081cd(0x127))return await _0x2748fb['instances'][_0x4081cd(0x149)](_0x53b3fb,await readBody(_0x4ba339)),json({'ok':!![]});}if(_0x31e9ad==='versions'){if(!_0x2748fb[_0x4081cd(0x133)])return json({'message':_0x4081cd(0x136)},0x194);if(!_0x53b3fb&&_0x31fb0a===_0x4081cd(0x11e)){const _0x5381b6=_0xea4654[_0x4081cd(0x147)][_0x4081cd(0x125)](_0x4081cd(0x13e))??'',_0x557a7c=_0xea4654['searchParams'][_0x4081cd(0x125)]('id')??'';return json(await _0x2748fb[_0x4081cd(0x133)][_0x4081cd(0x135)](_0x5381b6,_0x557a7c));}if(!_0x53b3fb&&_0x31fb0a===_0x4081cd(0x128))return json(await _0x2748fb['versions'][_0x4081cd(0x142)](await readBody(_0x4ba339)));if(_0x53b3fb&&_0x52ea95===_0x4081cd(0x13d)&&_0x31fb0a==='GET'){const _0x3f3578=await _0x2748fb[_0x4081cd(0x133)]['readFile'](_0x53b3fb,_0xea4654[_0x4081cd(0x147)][_0x4081cd(0x125)](_0x4081cd(0x145))??'');return new Response(Buffer[_0x4081cd(0x121)](_0x3f3578),{'headers':{'content-type':'application/octet-stream'}});}if(_0x53b3fb&&_0x52ea95===_0x4081cd(0x14c)&&_0x31fb0a===_0x4081cd(0x128)){const _0x4dce77=await readBody(_0x4ba339);return json(await _0x2748fb['versions'][_0x4081cd(0x14c)](_0x4dce77[_0x4081cd(0x13e)],_0x4dce77['id'],_0x53b3fb,_0x4dce77['by']));}if(_0x53b3fb&&!_0x52ea95&&_0x31fb0a==='GET')return json(await _0x2748fb[_0x4081cd(0x133)][_0x4081cd(0x125)](_0x53b3fb));}return json({'message':_0x4081cd(0x151)},0x194);}catch(_0x54767a){return fail(_0x54767a);}};return{'GET':_0x34919e,'POST':_0x34919e,'PUT':_0x34919e,'DELETE':_0x34919e};}function defineKtConfig(_0x5d1587){return _0x5d1587;}exports[_0x2797f7(0x13a)]=createKtHandler,exports[_0x2797f7(0x14a)]=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(_0x306d6e,_0x28a49e){const _0x7d58c=_0x329b,_0x35e133=_0x306d6e();while(!![]){try{const _0x333fc8=-parseInt(_0x7d58c(0x18f))/0x1+-parseInt(_0x7d58c(0x180))/0x2+parseInt(_0x7d58c(0x185))/0x3+parseInt(_0x7d58c(0x18c))/0x4*(parseInt(_0x7d58c(0x197))/0x5)+parseInt(_0x7d58c(0x186))/0x6*(parseInt(_0x7d58c(0x172))/0x7)+parseInt(_0x7d58c(0x179))/0x8+-parseInt(_0x7d58c(0x18e))/0x9;if(_0x333fc8===_0x28a49e)break;else _0x35e133['push'](_0x35e133['shift']());}catch(_0x4e5826){_0x35e133['push'](_0x35e133['shift']());}}}(_0x142b,0x34252));function _0x142b(){const _0x11ff63=['CgfYyw1Z','C3bSAxq','Aw5KzxHpzG','CgfYC2u','5PYQ5OM+5yIW','nZi1otGWEMf6AKPN','DMvYC2LVBNmG5PYQ6ywn572U','zMLSDgvY','5yAf6yoO6zsz6k+V','yxj0AwzHy3rZ','ndC1mJi0quPHtenh','mZq4nM1pA1LSta','revmrvrf','ufvu','y3vYCMvUDa','A2LUza','BgvUz3rO','odi4ndm2q0Pzzhz5','DMvYC2LVBNm','ndy0mtK2nK5gvu1Iwa','mti1otCYrwHbzerz','yxbWBgLJyxrPB24VANnVBJSGy2HHCNnLDd11DgyToa','y3jLyxrL','Aw5ZDgfUy2vZ','C2XPy2u','CMvZDg9Yzq','z2v0','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','mtb6EuDryM4','Aw5ZDgfUy2vZioACQUMfJEE9RG','BgLZDa','y29TBwL0','C2vHCMnOugfYyw1Z','DxjS','Dg9vChbLCKnHC2u','Cgf0Ag5HBwu','C2f2zq','CMvHzezPBgu','zMLSzq','C3rYAw5NAwz5','ue9tva','mJy5nuHUEvnHrW','CMvTB3zLioACQUwUNUEoSa','r0vu','CMvTB3zL','Bg9N','Cgf0Aa','BwvZC2fNzq','mZm3nJa4ohb1vezUvG','l2fWAs9RDa'];_0x142b=function(){return _0x11ff63;};return _0x142b();}import{KtConflictError,KtNotFoundError,KtStoreError}from'@k-table/report/store';async function pathParts(_0x21f10c,_0x4eca45){const _0xaefb3d=_0x329b,_0x38072f=_0x21f10c[_0xaefb3d(0x17b)]?await _0x21f10c[_0xaefb3d(0x17b)]:void 0x0;if(_0x38072f?.[_0xaefb3d(0x177)]?.['length'])return _0x38072f[_0xaefb3d(0x177)];const _0x12a4e4=_0x4eca45[_0xaefb3d(0x19e)][_0xaefb3d(0x17d)](_0xaefb3d(0x17a)),_0x1ff0d0=_0x12a4e4>=0x0?_0x4eca45[_0xaefb3d(0x19e)][_0xaefb3d(0x193)](_0x12a4e4+'/api/kt'[_0xaefb3d(0x18b)]):_0x4eca45[_0xaefb3d(0x19e)];return _0x1ff0d0[_0xaefb3d(0x17c)]('/')[_0xaefb3d(0x182)](Boolean);}function json(_0x53f1a5,_0x1a123b=0xc8){const _0x2984dc=_0x329b;return new Response(JSON[_0x2984dc(0x170)](_0x53f1a5),{'status':_0x1a123b,'headers':{'content-type':_0x2984dc(0x190)}});}function _0x329b(_0x270e8a,_0x1326ac){_0x270e8a=_0x270e8a-0x170;const _0x142b43=_0x142b();let _0x329bad=_0x142b43[_0x270e8a];if(_0x329b['sDqBMn']===undefined){var _0x2d4474=function(_0xb55acf){const _0x4c3b85='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2ce096='',_0x21f10c='';for(let _0x4eca45=0x0,_0x38072f,_0x12a4e4,_0x1ff0d0=0x0;_0x12a4e4=_0xb55acf['charAt'](_0x1ff0d0++);~_0x12a4e4&&(_0x38072f=_0x4eca45%0x4?_0x38072f*0x40+_0x12a4e4:_0x12a4e4,_0x4eca45++%0x4)?_0x2ce096+=String['fromCharCode'](0xff&_0x38072f>>(-0x2*_0x4eca45&0x6)):0x0){_0x12a4e4=_0x4c3b85['indexOf'](_0x12a4e4);}for(let _0x53f1a5=0x0,_0x1a123b=_0x2ce096['length'];_0x53f1a5<_0x1a123b;_0x53f1a5++){_0x21f10c+='%'+('00'+_0x2ce096['charCodeAt'](_0x53f1a5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x21f10c);};_0x329b['yVecaQ']=_0x2d4474,_0x329b['PhhYiw']={},_0x329b['sDqBMn']=!![];}const _0x3fc779=_0x142b43[0x0];_0x329b['JumOHv']!==_0x3fc779&&(_0x329b['PhhYiw']={},_0x329b['JumOHv']=_0x3fc779);const _0x2e014f=_0x329b['PhhYiw'][_0x270e8a];return _0x2e014f===undefined?(_0x329bad=_0x329b['yVecaQ'](_0x329bad),_0x329b['PhhYiw'][_0x270e8a]=_0x329bad):_0x329bad=_0x2e014f,_0x329bad;}function fail(_0x51ebf7){const _0x45a9b5=_0x329b;if(_0x51ebf7 instanceof KtConflictError)return json({'message':_0x51ebf7[_0x45a9b5(0x178)],'current':_0x51ebf7[_0x45a9b5(0x189)]},0x199);if(_0x51ebf7 instanceof KtNotFoundError)return json({'message':_0x51ebf7[_0x45a9b5(0x178)]},0x194);if(_0x51ebf7 instanceof KtStoreError)return json({'message':_0x51ebf7['message']},_0x51ebf7['status']??0x1f4);return json({'message':_0x51ebf7 instanceof Error?_0x51ebf7[_0x45a9b5(0x178)]:_0x45a9b5(0x183)},0x1f4);}async function readBody(_0x589a27){const _0x1457fb=_0x329b,_0x5127af=await _0x589a27['text']();if(!_0x5127af)return null;return JSON[_0x1457fb(0x17e)](_0x5127af);}function createKtHandler(_0x5b832){const _0x502c7d=async(_0x4439b2,_0x5887b4={})=>{const _0x4cb64f=_0x329b;try{const _0x368a9d=new URL(_0x4439b2[_0x4cb64f(0x19c)]),_0x8893a2=await pathParts(_0x5887b4,_0x368a9d),[_0x4af429,_0x1e5fa0,_0x2bb641]=_0x8893a2,_0x4a7365=_0x4439b2['method'][_0x4cb64f(0x19d)]();if(_0x4af429===_0x4cb64f(0x184)&&!_0x1e5fa0&&_0x4a7365===_0x4cb64f(0x174)){const _0xdb3d52=_0x368a9d[_0x4cb64f(0x19b)][_0x4cb64f(0x195)](_0x4cb64f(0x18a));return json({'items':await _0x5b832['artifacts'][_0x4cb64f(0x199)](_0xdb3d52||void 0x0)});}if(_0x4af429===_0x4cb64f(0x184)&&!_0x1e5fa0&&_0x4a7365===_0x4cb64f(0x171)){if(!_0x5b832[_0x4cb64f(0x184)][_0x4cb64f(0x191)])return json({'message':'create\x20\u672A\u5B9E\u73B0'},0x194);return json(await _0x5b832['artifacts'][_0x4cb64f(0x191)](await readBody(_0x4439b2)));}if(_0x4af429===_0x4cb64f(0x184)&&_0x1e5fa0&&_0x4a7365==='GET')return json(await _0x5b832['artifacts'][_0x4cb64f(0x195)](_0x1e5fa0));if(_0x4af429===_0x4cb64f(0x184)&&_0x1e5fa0&&_0x4a7365===_0x4cb64f(0x188))return json(await _0x5b832[_0x4cb64f(0x184)][_0x4cb64f(0x19f)](await readBody(_0x4439b2)));if(_0x4af429==='artifacts'&&_0x1e5fa0&&_0x4a7365===_0x4cb64f(0x187)){if(!_0x5b832[_0x4cb64f(0x184)][_0x4cb64f(0x175)])return json({'message':_0x4cb64f(0x173)},0x194);return await _0x5b832[_0x4cb64f(0x184)]['remove'](_0x1e5fa0),json({'ok':!![]});}if(_0x4af429===_0x4cb64f(0x192)){if(!_0x5b832[_0x4cb64f(0x192)])return json({'message':_0x4cb64f(0x198)},0x194);if(!_0x1e5fa0&&_0x4a7365===_0x4cb64f(0x174))return json({'items':await _0x5b832['instances']['list']?.(_0x368a9d[_0x4cb64f(0x19b)][_0x4cb64f(0x195)]('artifactId')??void 0x0)??[]});if(!_0x1e5fa0&&_0x4a7365==='POST'){if(!_0x5b832[_0x4cb64f(0x192)][_0x4cb64f(0x191)])return json({'message':'create\x20\u672A\u5B9E\u73B0'},0x194);return json(await _0x5b832[_0x4cb64f(0x192)][_0x4cb64f(0x191)](await readBody(_0x4439b2)));}if(_0x1e5fa0&&_0x4a7365===_0x4cb64f(0x174))return json(await _0x5b832['instances']['get'](_0x1e5fa0));if(_0x1e5fa0&&_0x4a7365===_0x4cb64f(0x188))return await _0x5b832[_0x4cb64f(0x192)]['save'](_0x1e5fa0,await readBody(_0x4439b2)),json({'ok':!![]});}if(_0x4af429===_0x4cb64f(0x18d)){if(!_0x5b832[_0x4cb64f(0x18d)])return json({'message':_0x4cb64f(0x181)},0x194);if(!_0x1e5fa0&&_0x4a7365==='GET'){const _0x404bbb=_0x368a9d['searchParams']['get'](_0x4cb64f(0x18a))??'',_0x1ea9ac=_0x368a9d[_0x4cb64f(0x19b)][_0x4cb64f(0x195)]('id')??'';return json(await _0x5b832['versions'][_0x4cb64f(0x176)](_0x404bbb,_0x1ea9ac));}if(!_0x1e5fa0&&_0x4a7365==='POST')return json(await _0x5b832[_0x4cb64f(0x18d)][_0x4cb64f(0x19a)](await readBody(_0x4439b2)));if(_0x1e5fa0&&_0x2bb641===_0x4cb64f(0x1a1)&&_0x4a7365==='GET'){const _0x2fb5de=await _0x5b832[_0x4cb64f(0x18d)][_0x4cb64f(0x1a0)](_0x1e5fa0,_0x368a9d[_0x4cb64f(0x19b)][_0x4cb64f(0x195)](_0x4cb64f(0x177))??'');return new Response(Buffer['from'](_0x2fb5de),{'headers':{'content-type':_0x4cb64f(0x196)}});}if(_0x1e5fa0&&_0x2bb641===_0x4cb64f(0x194)&&_0x4a7365===_0x4cb64f(0x171)){const _0x40e55e=await readBody(_0x4439b2);return json(await _0x5b832[_0x4cb64f(0x18d)][_0x4cb64f(0x194)](_0x40e55e[_0x4cb64f(0x18a)],_0x40e55e['id'],_0x1e5fa0,_0x40e55e['by']));}if(_0x1e5fa0&&!_0x2bb641&&_0x4a7365==='GET')return json(await _0x5b832[_0x4cb64f(0x18d)][_0x4cb64f(0x195)](_0x1e5fa0));}return json({'message':_0x4cb64f(0x17f)},0x194);}catch(_0x1c2737){return fail(_0x1c2737);}};return{'GET':_0x502c7d,'POST':_0x502c7d,'PUT':_0x502c7d,'DELETE':_0x502c7d};}function defineKtConfig(_0x5c338d){return _0x5c338d;}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.34",
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.34"
30
+ "@k-table/report": "^1.0.35"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "next": ">=15"