@k-table/next 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fs.cjs +1 -1
- package/dist/fs.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/fs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x4aaa52=_0x6bdc;(function(_0x3270d3,_0x379246){const _0xfa281=_0x6bdc,_0x4f315c=_0x3270d3();while(!![]){try{const _0x3a4996=parseInt(_0xfa281(0x1e5))/0x1+-parseInt(_0xfa281(0x207))/0x2*(-parseInt(_0xfa281(0x211))/0x3)+parseInt(_0xfa281(0x213))/0x4*(-parseInt(_0xfa281(0x225))/0x5)+-parseInt(_0xfa281(0x204))/0x6+parseInt(_0xfa281(0x236))/0x7+parseInt(_0xfa281(0x20d))/0x8*(-parseInt(_0xfa281(0x1e8))/0x9)+parseInt(_0xfa281(0x1f7))/0xa*(parseInt(_0xfa281(0x1fd))/0xb);if(_0x3a4996===_0x379246)break;else _0x4f315c['push'](_0x4f315c['shift']());}catch(_0x4e969e){_0x4f315c['push'](_0x4f315c['shift']());}}}(_0x3940,0x57a12));var fs=require('fs'),path=require(_0x4aaa52(0x215)),store=require(_0x4aaa52(0x1ff)),crypto=require('crypto');function resolveRoot(_0xabfbb8,_0x424aa8=process[_0x4aaa52(0x21c)]()){const _0x59109d=_0x4aaa52,_0x2f7354=path[_0x59109d(0x21b)](_0xabfbb8)?_0xabfbb8:path[_0x59109d(0x219)](_0x424aa8,_0xabfbb8);return fs[_0x59109d(0x212)](_0x2f7354,{'recursive':!![]}),_0x2f7354;}function artifactDir(_0x4bcf5e,_0x27f28a){const _0x41d1a7=_0x4aaa52;return path[_0x41d1a7(0x20a)](_0x4bcf5e,_0x27f28a);}function objectPath(_0x1940b2,_0x446986){const _0x31b503=_0x4aaa52;return path[_0x31b503(0x20a)](_0x1940b2,_0x31b503(0x229),_0x446986['slice'](0x0,0x2),_0x446986);}function itemDir(_0x22afb9,_0x18e246,_0x40df0f){const _0x4ef231=_0x4aaa52;return path[_0x4ef231(0x20a)](_0x22afb9,_0x4ef231(0x221),_0x18e246,_0x40df0f);}function newEtag(){const _0x110c72=_0x4aaa52;return Date['now']()[_0x110c72(0x1e0)](0x24)+'-'+Math['random']()['toString'](0x24)[_0x110c72(0x222)](0x2,0x8);}function readEtag(_0x30d384){const _0x5d8b55=_0x4aaa52,_0x53ad00=path[_0x5d8b55(0x20a)](_0x30d384,_0x5d8b55(0x1e9));return fs[_0x5d8b55(0x20c)](_0x53ad00)?fs[_0x5d8b55(0x232)](_0x53ad00,_0x5d8b55(0x231))[_0x5d8b55(0x1e1)]():void 0x0;}function writeArtifactDir(_0x37c8f7,_0x2621e4,_0xefe08a){const _0x3682c5=_0x4aaa52;fs['mkdirSync'](path['join'](_0x37c8f7,_0x3682c5(0x20f)),{'recursive':!![]});const _0x13a179=store[_0x3682c5(0x1e3)](_0x2621e4);fs[_0x3682c5(0x210)](path[_0x3682c5(0x20a)](_0x37c8f7,store[_0x3682c5(0x22f)]),_0x13a179[store[_0x3682c5(0x22f)]]??'{}',_0x3682c5(0x231)),fs[_0x3682c5(0x210)](path[_0x3682c5(0x20a)](_0x37c8f7,store[_0x3682c5(0x1ea)]),_0x13a179[store['ARTIFACT_FILE_BODY']]??'',_0x3682c5(0x231));const _0x40b309=path[_0x3682c5(0x20a)](_0x37c8f7,store[_0x3682c5(0x1fc)]),_0x3664c2=path[_0x3682c5(0x20a)](_0x37c8f7,store[_0x3682c5(0x1f3)]);if(_0x13a179[store[_0x3682c5(0x1fc)]])fs['writeFileSync'](_0x40b309,_0x13a179[store[_0x3682c5(0x1fc)]],_0x3682c5(0x231));else{if(fs['existsSync'](_0x40b309))fs['rmSync'](_0x40b309);}if(_0x13a179[store['ARTIFACT_FILE_REPORT']])fs[_0x3682c5(0x210)](_0x3664c2,_0x13a179[store['ARTIFACT_FILE_REPORT']],'utf8');else{if(fs[_0x3682c5(0x20c)](_0x3664c2))fs[_0x3682c5(0x209)](_0x3664c2);}fs[_0x3682c5(0x210)](path[_0x3682c5(0x20a)](_0x37c8f7,'.etag'),_0xefe08a,'utf8');}function readArtifactDir(_0x237810,_0x28162d){const _0x4b6c31=_0x4aaa52,_0x5c0388={},_0x5adfca=path[_0x4b6c31(0x20a)](_0x237810,store[_0x4b6c31(0x22f)]),_0x5ada9d=path[_0x4b6c31(0x20a)](_0x237810,store[_0x4b6c31(0x1ea)]);if(fs[_0x4b6c31(0x20c)](_0x5adfca))_0x5c0388[store[_0x4b6c31(0x22f)]]=fs['readFileSync'](_0x5adfca,'utf8');if(fs[_0x4b6c31(0x20c)](_0x5ada9d))_0x5c0388[store[_0x4b6c31(0x1ea)]]=fs['readFileSync'](_0x5ada9d,_0x4b6c31(0x231));const _0x398925=path[_0x4b6c31(0x20a)](_0x237810,store[_0x4b6c31(0x1fc)]),_0x422fb6=path[_0x4b6c31(0x20a)](_0x237810,store[_0x4b6c31(0x1f3)]);if(fs[_0x4b6c31(0x20c)](_0x398925))_0x5c0388[store[_0x4b6c31(0x1fc)]]=fs[_0x4b6c31(0x232)](_0x398925,_0x4b6c31(0x231));if(fs[_0x4b6c31(0x20c)](_0x422fb6))_0x5c0388[store['ARTIFACT_FILE_REPORT']]=fs['readFileSync'](_0x422fb6,_0x4b6c31(0x231));return{...store[_0x4b6c31(0x1ed)](_0x5c0388,_0x28162d),'etag':readEtag(_0x237810)};}function createFsArtifactStore(_0x55ebe0,_0x4dd2c0=[]){const _0x5bd8b7=_0x4aaa52;fs['mkdirSync'](_0x55ebe0,{'recursive':!![]});for(const _0x267f6f of _0x4dd2c0){const _0x550b32=artifactDir(_0x55ebe0,_0x267f6f['id']),_0x5bf0f7=path['join'](_0x550b32,store[_0x5bd8b7(0x1ea)]);if(!fs[_0x5bd8b7(0x20c)](_0x5bf0f7))writeArtifactDir(_0x550b32,_0x267f6f,_0x267f6f[_0x5bd8b7(0x22b)]??newEtag());}return{async 'list'(_0x40c2c0){const _0x5ef31d=_0x5bd8b7;if(!fs[_0x5ef31d(0x20c)](_0x55ebe0))return[];const _0x25759d=[];for(const _0x3b0dc0 of fs[_0x5ef31d(0x202)](_0x55ebe0,{'withFileTypes':!![]})){if(!_0x3b0dc0[_0x5ef31d(0x1f1)]())continue;try{const _0x4760fb=readArtifactDir(artifactDir(_0x55ebe0,_0x3b0dc0[_0x5ef31d(0x237)]),_0x3b0dc0[_0x5ef31d(0x237)]);if(!_0x40c2c0||_0x4760fb[_0x5ef31d(0x21d)]===_0x40c2c0)_0x25759d[_0x5ef31d(0x218)]({'id':_0x4760fb['id'],'name':_0x4760fb[_0x5ef31d(0x237)],'kind':_0x4760fb[_0x5ef31d(0x21d)]});}catch{}}return _0x25759d;},async 'get'(_0x519a54){const _0x46dd3d=_0x5bd8b7,_0x4afe48=artifactDir(_0x55ebe0,_0x519a54);if(!fs['existsSync'](_0x4afe48))throw new store[(_0x46dd3d(0x1f5))](_0x46dd3d(0x22e)+_0x519a54);return readArtifactDir(_0x4afe48,_0x519a54);},async 'save'(_0x357b32){const _0x4bcd50=_0x5bd8b7,_0x52ba62=artifactDir(_0x55ebe0,_0x357b32['id']),_0x1bd838=fs[_0x4bcd50(0x20c)](_0x52ba62)?readArtifactDir(_0x52ba62,_0x357b32['id']):void 0x0;if(_0x357b32[_0x4bcd50(0x22b)]&&_0x1bd838?.[_0x4bcd50(0x22b)]&&_0x357b32[_0x4bcd50(0x22b)]!==_0x1bd838['etag'])throw new store[(_0x4bcd50(0x206))](_0x4bcd50(0x233),_0x1bd838);const _0xd4f37b=newEtag();return writeArtifactDir(_0x52ba62,_0x357b32,_0xd4f37b),{..._0x357b32,'etag':_0xd4f37b};},async 'create'(_0x382313){const _0x136c01=_0x5bd8b7,_0x19d33a=_0x382313['kind']+'-'+Math[_0x136c01(0x238)]()['toString'](0x24)[_0x136c01(0x222)](0x2,0xa),_0x31f1b6={'id':_0x19d33a,'name':_0x382313[_0x136c01(0x237)],'kind':_0x382313['kind'],'ktl':store[_0x136c01(0x1eb)]};return this[_0x136c01(0x239)](_0x31f1b6);},async 'remove'(_0x5b0bea){const _0x8b17c5=_0x5bd8b7,_0x48f188=artifactDir(_0x55ebe0,_0x5b0bea);if(!fs[_0x8b17c5(0x20c)](_0x48f188))throw new store[(_0x8b17c5(0x1f5))](_0x8b17c5(0x22e)+_0x5b0bea);fs[_0x8b17c5(0x209)](_0x48f188,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x4e7476,_0x5e6374={}){const _0x549a57=_0x4aaa52;fs[_0x549a57(0x212)](_0x4e7476,{'recursive':!![]});const _0x36fb16=_0x26f332=>path[_0x549a57(0x20a)](_0x4e7476,_0x26f332+_0x549a57(0x223));for(const [_0x46c518,_0x5da218]of Object[_0x549a57(0x230)](_0x5e6374)){if(!fs[_0x549a57(0x20c)](_0x36fb16(_0x46c518)))fs[_0x549a57(0x210)](_0x36fb16(_0x46c518),JSON['stringify'](_0x5da218,null,0x2),_0x549a57(0x231));}return{async 'get'(_0x5e3fc0){const _0xe8cf3f=_0x549a57,_0x161490=_0x36fb16(_0x5e3fc0);if(!fs[_0xe8cf3f(0x20c)](_0x161490))throw new store[(_0xe8cf3f(0x1f5))]('instance\x20'+_0x5e3fc0);return JSON[_0xe8cf3f(0x1e7)](fs[_0xe8cf3f(0x232)](_0x161490,_0xe8cf3f(0x231)));},async 'save'(_0x235505,_0x48bc53){const _0x236921=_0x549a57,_0x1819d9=_0x36fb16(_0x235505),_0x3951d7=fs[_0x236921(0x20c)](_0x1819d9)?JSON['parse'](fs[_0x236921(0x232)](_0x1819d9,_0x236921(0x231))):{'artifactId':'','values':{}},_0x2682dc={'artifactId':_0x3951d7[_0x236921(0x216)],'values':{..._0x3951d7[_0x236921(0x1fe)],..._0x48bc53[_0x236921(0x1fe)]},'common':{..._0x3951d7[_0x236921(0x22d)],..._0x48bc53[_0x236921(0x22d)]},'tabCommon':{..._0x3951d7[_0x236921(0x220)],..._0x48bc53[_0x236921(0x220)]}};fs[_0x236921(0x210)](_0x1819d9,JSON[_0x236921(0x200)](_0x2682dc,null,0x2),_0x236921(0x231));},async 'list'(_0x463db5){const _0x1f4f97=_0x549a57;return fs['readdirSync'](_0x4e7476)[_0x1f4f97(0x1e6)](_0x1d2f83=>_0x1d2f83[_0x1f4f97(0x214)](_0x1f4f97(0x223)))[_0x1f4f97(0x1ef)](_0x286794=>{const _0x1b8101=_0x1f4f97,_0x564702=_0x286794[_0x1b8101(0x222)](0x0,-0x5),_0x4532ef=JSON['parse'](fs[_0x1b8101(0x232)](path[_0x1b8101(0x20a)](_0x4e7476,_0x286794),_0x1b8101(0x231)));return{'id':_0x564702,'artifactId':_0x4532ef['artifactId']};})[_0x1f4f97(0x1e6)](_0x4af339=>!_0x463db5||_0x4af339[_0x1f4f97(0x216)]===_0x463db5);},async 'create'(_0x3cf28c){const _0x4006ea=_0x549a57,_0x55bc7e=_0x4006ea(0x1f6)+Math[_0x4006ea(0x238)]()['toString'](0x24)[_0x4006ea(0x222)](0x2,0xa);return fs[_0x4006ea(0x210)](_0x36fb16(_0x55bc7e),JSON['stringify']({'artifactId':_0x3cf28c[_0x4006ea(0x216)],'values':{},'common':{}},null,0x2),_0x4006ea(0x231)),{'id':_0x55bc7e};}};}function sha256Hex(_0x3befd){const _0x39444f=_0x4aaa52,_0x416d5b=typeof _0x3befd===_0x39444f(0x21e)?Buffer[_0x39444f(0x20e)](_0x3befd,_0x39444f(0x231)):Buffer[_0x39444f(0x20e)](_0x3befd);return crypto[_0x39444f(0x1f0)](_0x39444f(0x235))[_0x39444f(0x21f)](_0x416d5b)[_0x39444f(0x1f9)](_0x39444f(0x203));}function writeObject(_0x140f01,_0x5af43b){const _0x20e45c=_0x4aaa52,_0x386de1=sha256Hex(_0x5af43b),_0x1d88e8=objectPath(_0x140f01,_0x386de1);fs[_0x20e45c(0x212)](path[_0x20e45c(0x21a)](_0x1d88e8),{'recursive':!![]});if(!fs[_0x20e45c(0x20c)](_0x1d88e8))fs[_0x20e45c(0x210)](_0x1d88e8,_0x5af43b);return _0x386de1;}function readLog(_0x23e909,_0x9d8c59,_0x318da9){const _0x4c42ad=_0x4aaa52,_0x186f5f=itemDir(_0x23e909,_0x9d8c59,_0x318da9),_0x1370fb=path['join'](_0x186f5f,_0x4c42ad(0x1f4)),_0x2880f1=path[_0x4c42ad(0x20a)](_0x186f5f,'HEAD'),_0x58d66e=fs[_0x4c42ad(0x20c)](_0x1370fb)?JSON[_0x4c42ad(0x1e7)](fs[_0x4c42ad(0x232)](_0x1370fb,'utf8')):[],_0x40cb7c=fs[_0x4c42ad(0x20c)](_0x2880f1)?fs[_0x4c42ad(0x232)](_0x2880f1,_0x4c42ad(0x231))[_0x4c42ad(0x1e1)]():_0x58d66e['at'](-0x1)?.[_0x4c42ad(0x20b)]??null;return{'head':_0x40cb7c,'items':_0x58d66e};}function _0x6bdc(_0x1b0880,_0x4653f9){_0x1b0880=_0x1b0880-0x1df;const _0x39405d=_0x3940();let _0x6bdc90=_0x39405d[_0x1b0880];if(_0x6bdc['EXVmdn']===undefined){var _0x1829dd=function(_0x503f69){const _0x6e4ad0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3ebc35='',_0xabfbb8='';for(let _0x424aa8=0x0,_0x2f7354,_0x4bcf5e,_0x27f28a=0x0;_0x4bcf5e=_0x503f69['charAt'](_0x27f28a++);~_0x4bcf5e&&(_0x2f7354=_0x424aa8%0x4?_0x2f7354*0x40+_0x4bcf5e:_0x4bcf5e,_0x424aa8++%0x4)?_0x3ebc35+=String['fromCharCode'](0xff&_0x2f7354>>(-0x2*_0x424aa8&0x6)):0x0){_0x4bcf5e=_0x6e4ad0['indexOf'](_0x4bcf5e);}for(let _0x1940b2=0x0,_0x446986=_0x3ebc35['length'];_0x1940b2<_0x446986;_0x1940b2++){_0xabfbb8+='%'+('00'+_0x3ebc35['charCodeAt'](_0x1940b2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xabfbb8);};_0x6bdc['pwswEu']=_0x1829dd,_0x6bdc['AWjnZm']={},_0x6bdc['EXVmdn']=!![];}const _0x5aa247=_0x39405d[0x0];_0x6bdc['HvQrDD']!==_0x5aa247&&(_0x6bdc['AWjnZm']={},_0x6bdc['HvQrDD']=_0x5aa247);const _0x1b642f=_0x6bdc['AWjnZm'][_0x1b0880];return _0x1b642f===undefined?(_0x6bdc90=_0x6bdc['pwswEu'](_0x6bdc90),_0x6bdc['AWjnZm'][_0x1b0880]=_0x6bdc90):_0x6bdc90=_0x1b642f,_0x6bdc90;}function writeLog(_0x37f2d3,_0x167196,_0x1620d5,_0x41901f,_0x4b4768){const _0x4825f1=_0x4aaa52,_0x53056f=itemDir(_0x37f2d3,_0x167196,_0x1620d5);fs[_0x4825f1(0x212)](_0x53056f,{'recursive':!![]}),fs[_0x4825f1(0x210)](path[_0x4825f1(0x20a)](_0x53056f,_0x4825f1(0x1f4)),JSON[_0x4825f1(0x200)](_0x4b4768,null,0x2),_0x4825f1(0x231)),fs[_0x4825f1(0x210)](path[_0x4825f1(0x20a)](_0x53056f,_0x4825f1(0x1f2)),_0x41901f+'\x0a',_0x4825f1(0x231));}function findRev(_0x37e25a,_0x564a91){const _0x22f593=_0x4aaa52,_0x895e2c=path[_0x22f593(0x20a)](_0x37e25a,'items');if(!fs[_0x22f593(0x20c)](_0x895e2c))return void 0x0;for(const _0x388586 of fs[_0x22f593(0x202)](_0x895e2c,{'withFileTypes':!![]})){if(!_0x388586[_0x22f593(0x1f1)]())continue;for(const _0x3a857e of fs[_0x22f593(0x202)](path[_0x22f593(0x20a)](_0x895e2c,_0x388586[_0x22f593(0x237)]),{'withFileTypes':!![]})){if(!_0x3a857e[_0x22f593(0x1f1)]())continue;const _0x1cc927=readLog(_0x37e25a,_0x388586['name'],_0x3a857e[_0x22f593(0x237)])['items'][_0x22f593(0x1e4)](_0x4a4be1=>_0x4a4be1[_0x22f593(0x20b)]===_0x564a91);if(_0x1cc927)return _0x1cc927;}}return void 0x0;}function filesTextOf(_0x302872,_0x1b9dfd){const _0x367d42=_0x4aaa52,_0x1fc0c5={};for(const [_0x5b8419,_0x51b1a0]of Object[_0x367d42(0x230)](_0x1b9dfd[_0x367d42(0x217)])){const _0x1fbbc1=objectPath(_0x302872,_0x51b1a0);if(fs[_0x367d42(0x20c)](_0x1fbbc1))_0x1fc0c5[_0x5b8419]=fs[_0x367d42(0x232)](_0x1fbbc1,_0x367d42(0x231));}return _0x1fc0c5;}function createFsVersionStore(_0x4bb0e1,_0x5859ae){const _0x5abd39=_0x4aaa52;return fs[_0x5abd39(0x212)](_0x4bb0e1,{'recursive':!![]}),{async 'log'(_0x49efe4,_0xdc1ce5){const _0x29ffd1=_0x5abd39,{head:_0xcf9f18,items:_0x3e5426}=readLog(_0x4bb0e1,_0x49efe4,_0xdc1ce5);return{'head':_0xcf9f18,'items':[..._0x3e5426][_0x29ffd1(0x228)]((_0x541662,_0xb77d63)=>_0x541662['at']<_0xb77d63['at']?0x1:-0x1)};},async 'get'(_0x49b4eb){const _0x5a0633=_0x5abd39,_0x1adb46=findRev(_0x4bb0e1,_0x49b4eb);if(!_0x1adb46)throw new store[(_0x5a0633(0x1f5))]('rev\x20'+_0x49b4eb);return _0x1adb46;},async 'readFile'(_0x1608ac,_0x3a6b24){const _0x4b56f3=_0x5abd39,_0x2d3aee=await this[_0x4b56f3(0x22a)](_0x1608ac),_0x41549a=_0x2d3aee['files'][_0x3a6b24];if(!_0x41549a)throw new store[(_0x4b56f3(0x1f5))](_0x3a6b24);const _0x193abd=objectPath(_0x4bb0e1,_0x41549a);if(!fs[_0x4b56f3(0x20c)](_0x193abd))throw new store[(_0x4b56f3(0x1f5))](_0x3a6b24);return new Uint8Array(fs[_0x4b56f3(0x232)](_0x193abd));},async 'commit'(_0x31d969){const _0x409909=_0x5abd39;let _0x1ad295=_0x31d969[_0x409909(0x217)];if(!_0x1ad295){const _0x4dc48b=await _0x5859ae[_0x409909(0x22a)](_0x31d969['id']);_0x1ad295=store[_0x409909(0x1e3)](_0x4dc48b);}const _0x265b98={},_0x40f4de={};for(const [_0x377d4d,_0x5f3834]of Object[_0x409909(0x230)](_0x1ad295)){const _0x1f3dc2=typeof _0x5f3834===_0x409909(0x21e)?_0x5f3834:new TextDecoder()['decode'](_0x5f3834);_0x265b98[_0x377d4d]=_0x1f3dc2,_0x40f4de[_0x377d4d]=writeObject(_0x4bb0e1,typeof _0x5f3834===_0x409909(0x21e)?Buffer[_0x409909(0x20e)](_0x5f3834,_0x409909(0x231)):_0x5f3834);}const _0x5b8fae=readLog(_0x4bb0e1,_0x31d969[_0x409909(0x21d)],_0x31d969['id']);if(_0x5b8fae[_0x409909(0x201)]){const _0x582015=_0x5b8fae[_0x409909(0x221)][_0x409909(0x1e4)](_0x286478=>_0x286478[_0x409909(0x20b)]===_0x5b8fae['head']);if(_0x582015&&store['filesEqual'](_0x265b98,filesTextOf(_0x4bb0e1,_0x582015)))return _0x582015;}const _0x59b71f=new Date(),_0x135371=String(_0x59b71f[_0x409909(0x22c)]())[_0x409909(0x222)](0x2)+String(_0x59b71f[_0x409909(0x227)]()+0x1)[_0x409909(0x208)](0x2,'0')+String(_0x59b71f[_0x409909(0x1df)]())[_0x409909(0x208)](0x2,'0')+String(_0x59b71f[_0x409909(0x224)]())['padStart'](0x2,'0')+String(_0x59b71f[_0x409909(0x1f8)]())[_0x409909(0x208)](0x2,'0'),_0x4be691=sha256Hex(Object[_0x409909(0x1fe)](_0x40f4de)[_0x409909(0x228)]()[_0x409909(0x20a)](','))[_0x409909(0x222)](0x0,0x8),_0x5ed864={'rev':_0x135371+_0x409909(0x1ec)+_0x4be691,'kind':_0x31d969['kind'],'id':_0x31d969['id'],'at':_0x59b71f['toISOString'](),'parent':_0x5b8fae[_0x409909(0x201)],'by':_0x31d969['by'],'note':_0x31d969[_0x409909(0x226)],'files':_0x40f4de,'meta':_0x31d969[_0x409909(0x234)]};return writeLog(_0x4bb0e1,_0x31d969[_0x409909(0x21d)],_0x31d969['id'],_0x5ed864[_0x409909(0x20b)],[..._0x5b8fae['items'],_0x5ed864]),_0x5ed864;},async 'restore'(_0x445850,_0x22de22,_0x59f782,_0x4a781b){const _0xd66b4a=_0x5abd39,_0x1af1e2=await this[_0xd66b4a(0x22a)](_0x59f782),_0x1aa609={};for(const _0x3e1480 of Object['keys'](_0x1af1e2[_0xd66b4a(0x217)])){_0x1aa609[_0x3e1480]=new TextDecoder()['decode'](await this['readFile'](_0x59f782,_0x3e1480));}const _0x99f643=store['filesToArtifact'](_0x1aa609,_0x22de22);return await _0x5859ae[_0xd66b4a(0x239)]({..._0x99f643,'id':_0x22de22,'kind':_0x99f643[_0xd66b4a(0x21d)],'etag':void 0x0}),this[_0xd66b4a(0x23a)]({'kind':_0x445850,'id':_0x22de22,'files':_0x1aa609,'by':_0x4a781b,'note':'\u6062\u590D\u81EA\x20'+_0x59f782});}};}function _0x3940(){const _0x3b8601=['Cgf0Aa','yxj0AwzHy3rjza','zMLSzxm','ChvZAa','CMvZB2X2zq','zgLYBMfTzq','AxnbyNnVBhv0zq','y3DK','A2LUza','C3rYAw5N','DxbKyxrL','DgfIq29TBw9U','AxrLBxm','C2XPy2u','lMPZB24','z2v0sg91CNm','ntbzzNfKv28','BM90zq','z2v0tw9UDgG','C29YDa','B2jQzwn0CW','z2v0','zxrHzW','z2v0rNvSBfLLyxi','y29TBw9U','yxj0AwzHy3qG','qvjusuzbq1rFrKLmrv9nrvrb','zw50CMLLCW','DxrMoa','CMvHzezPBgvtEw5J','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','Bwv0yq','C2HHmJu2','mtKWnZK5menlufLUBa','BMfTzq','CMfUzg9T','C2f2zq','y29TBwL0','z2v0rgf0zq','Dg9tDhjPBMC','DhjPBq','y3jLyxrLs3rgC1n0B3jLCW','yxj0AwzHy3ruB0zPBgvZ','zMLUza','mJKXmZyYCgfzCfzJ','zMLSDgvY','CgfYC2u','mJmYmtKXENzOrg9J','lMv0ywC','qvjusuzbq1rFrKLmrv9ct0rz','ru1qvfLFs1rm','lwXVy2fSlq','zMLSzxnuB0fYDgLMywn0','C2vLzeLUC3rHBMnLCW','BwfW','y3jLyxrLsgfZAa','AxneAxjLy3rVCNK','sevbra','qvjusuzbq1rFrKLmrv9srvbpuLq','Bg9NlMPZB24','s3roB3rgB3vUzevYCM9Y','Aw5ZDc0','ndmWqNniEvzs','z2v0twLUDxrLCW','zgLNzxn0','Aw5ZDgfUy2vZuM9VDa','DMvYC2LVBNnsB290','qvjusuzbq1rFrKLmrv9gsuXm','mJeYmdKXzgf3EwzA','DMfSDwvZ','qgSTDgfIBguVCMvWB3j0l3n0B3jL','C3rYAw5NAwz5','AgvHza','CMvHzgrPCLn5BMm','Agv4','mZiZnJy5nezPvevxCq','C2vLza','s3rdB25MBgLJDevYCM9Y','ntm3mffoqwvjza','CgfKu3rHCNq','CM1tEw5J','AM9PBG','CMv2','zxHPC3rZu3LUyW','nZjgyu55u0C','zNjVBq','zMfJzxm','D3jPDgvgAwXLu3LUyW','mZaZzhvrCKTs','BwTKAxjtEw5J','mJeZnduYBgrJr1DT','zw5KC1DPDgG'];_0x3940=function(){return _0x3b8601;};return _0x3940();}function createKtFsStores(_0x494c07){const _0xeac51a=_0x4aaa52,_0x4ccbf9=createFsArtifactStore(resolveRoot(_0x494c07['artifactsRoot'],_0x494c07[_0xeac51a(0x21c)]),_0x494c07[_0xeac51a(0x205)]),_0x305364=_0x494c07['instancesRoot']?createFsInstanceStore(resolveRoot(_0x494c07[_0xeac51a(0x1fa)],_0x494c07[_0xeac51a(0x21c)]),_0x494c07[_0xeac51a(0x1ee)]):void 0x0,_0x18b7a9=_0x494c07[_0xeac51a(0x1fb)]?createFsVersionStore(resolveRoot(_0x494c07[_0xeac51a(0x1fb)],_0x494c07['cwd']),_0x4ccbf9):void 0x0;return{'artifacts':_0x4ccbf9,'instances':_0x305364,'versions':_0x18b7a9};}exports[_0x4aaa52(0x1e2)]=createKtFsStores;
|
|
1
|
+
'use strict';const _0xf8d0=_0x2ad6;(function(_0x1d6e4c,_0x26e9a9){const _0x185cb9=_0x2ad6,_0x2d9f67=_0x1d6e4c();while(!![]){try{const _0x5c49df=-parseInt(_0x185cb9(0xdc))/0x1+parseInt(_0x185cb9(0xf9))/0x2+parseInt(_0x185cb9(0xd1))/0x3+parseInt(_0x185cb9(0xbc))/0x4+parseInt(_0x185cb9(0xbb))/0x5+parseInt(_0x185cb9(0xc1))/0x6+parseInt(_0x185cb9(0xf3))/0x7*(-parseInt(_0x185cb9(0xcc))/0x8);if(_0x5c49df===_0x26e9a9)break;else _0x2d9f67['push'](_0x2d9f67['shift']());}catch(_0x503394){_0x2d9f67['push'](_0x2d9f67['shift']());}}}(_0x189e,0x67ec8));var fs=require('fs'),path=require(_0xf8d0(0xfb)),store=require(_0xf8d0(0xad)),crypto=require('crypto');function resolveRoot(_0x42e2bd,_0x1b9106=process[_0xf8d0(0xd2)]()){const _0x317cab=_0xf8d0,_0x182eb3=path[_0x317cab(0xb7)](_0x42e2bd)?_0x42e2bd:path['resolve'](_0x1b9106,_0x42e2bd);return fs['mkdirSync'](_0x182eb3,{'recursive':!![]}),_0x182eb3;}function artifactDir(_0x17146e,_0xc89820){const _0x22ee36=_0xf8d0;return path[_0x22ee36(0xb8)](_0x17146e,_0xc89820);}function objectPath(_0x5bcdd7,_0x2ab37b){const _0x57769b=_0xf8d0;return path['join'](_0x5bcdd7,_0x57769b(0xd8),_0x2ab37b[_0x57769b(0xde)](0x0,0x2),_0x2ab37b);}function itemDir(_0x734ed7,_0x3c8393,_0x311756){const _0x5571b5=_0xf8d0;return path[_0x5571b5(0xb8)](_0x734ed7,'items',_0x3c8393,_0x311756);}function newEtag(){const _0x2b46cf=_0xf8d0;return Date['now']()['toString'](0x24)+'-'+Math['random']()[_0x2b46cf(0xec)](0x24)[_0x2b46cf(0xde)](0x2,0x8);}function readEtag(_0xf937d3){const _0x45d5a7=_0xf8d0,_0x10dc80=path[_0x45d5a7(0xb8)](_0xf937d3,'.etag');return fs[_0x45d5a7(0xf8)](_0x10dc80)?fs[_0x45d5a7(0xda)](_0x10dc80,_0x45d5a7(0xb1))[_0x45d5a7(0xf7)]():void 0x0;}function writeArtifactDir(_0x5821e6,_0x35c2cf,_0x43ddc2){const _0x4d02e2=_0xf8d0;fs[_0x4d02e2(0xd6)](path[_0x4d02e2(0xb8)](_0x5821e6,_0x4d02e2(0xfc)),{'recursive':!![]});const _0x2f0b2c=store[_0x4d02e2(0xd3)](_0x35c2cf);fs['writeFileSync'](path[_0x4d02e2(0xb8)](_0x5821e6,store[_0x4d02e2(0xef)]),_0x2f0b2c[store['ARTIFACT_FILE_META']]??'{}',_0x4d02e2(0xb1)),fs[_0x4d02e2(0xcf)](path['join'](_0x5821e6,store['ARTIFACT_FILE_BODY']),_0x2f0b2c[store[_0x4d02e2(0xff)]]??'',_0x4d02e2(0xb1));const _0x497e19=path['join'](_0x5821e6,store[_0x4d02e2(0xfd)]),_0x315f72=path[_0x4d02e2(0xb8)](_0x5821e6,store[_0x4d02e2(0xd7)]);if(_0x2f0b2c[store[_0x4d02e2(0xfd)]])fs[_0x4d02e2(0xcf)](_0x497e19,_0x2f0b2c[store[_0x4d02e2(0xfd)]],'utf8');else{if(fs[_0x4d02e2(0xf8)](_0x497e19))fs[_0x4d02e2(0xc6)](_0x497e19);}if(_0x2f0b2c[store[_0x4d02e2(0xd7)]])fs['writeFileSync'](_0x315f72,_0x2f0b2c[store['ARTIFACT_FILE_REPORT']],_0x4d02e2(0xb1));else{if(fs[_0x4d02e2(0xf8)](_0x315f72))fs[_0x4d02e2(0xc6)](_0x315f72);}fs[_0x4d02e2(0xcf)](path[_0x4d02e2(0xb8)](_0x5821e6,_0x4d02e2(0xfa)),_0x43ddc2,'utf8');}function readArtifactDir(_0x42a3df,_0x47ac77){const _0x2376ea=_0xf8d0,_0x358b95={},_0x210ca0=path[_0x2376ea(0xb8)](_0x42a3df,store[_0x2376ea(0xef)]),_0x387912=path[_0x2376ea(0xb8)](_0x42a3df,store['ARTIFACT_FILE_BODY']);if(fs['existsSync'](_0x210ca0))_0x358b95[store[_0x2376ea(0xef)]]=fs['readFileSync'](_0x210ca0,'utf8');if(fs[_0x2376ea(0xf8)](_0x387912))_0x358b95[store[_0x2376ea(0xff)]]=fs[_0x2376ea(0xda)](_0x387912,'utf8');const _0x79ce11=path[_0x2376ea(0xb8)](_0x42a3df,store[_0x2376ea(0xfd)]),_0x5741c6=path[_0x2376ea(0xb8)](_0x42a3df,store[_0x2376ea(0xd7)]);if(fs['existsSync'](_0x79ce11))_0x358b95[store[_0x2376ea(0xfd)]]=fs[_0x2376ea(0xda)](_0x79ce11,_0x2376ea(0xb1));if(fs['existsSync'](_0x5741c6))_0x358b95[store[_0x2376ea(0xd7)]]=fs[_0x2376ea(0xda)](_0x5741c6,_0x2376ea(0xb1));return{...store[_0x2376ea(0xb0)](_0x358b95,_0x47ac77),'etag':readEtag(_0x42a3df)};}function createFsArtifactStore(_0x38a67e,_0x1f6648=[]){const _0x2b4cef=_0xf8d0;fs[_0x2b4cef(0xd6)](_0x38a67e,{'recursive':!![]});for(const _0x389cb of _0x1f6648){const _0x42496a=artifactDir(_0x38a67e,_0x389cb['id']),_0x5a0eb8=path['join'](_0x42496a,store['ARTIFACT_FILE_BODY']);if(!fs[_0x2b4cef(0xf8)](_0x5a0eb8))writeArtifactDir(_0x42496a,_0x389cb,_0x389cb[_0x2b4cef(0xaa)]??newEtag());}return{async 'list'(_0x3cf943){const _0xd25468=_0x2b4cef;if(!fs[_0xd25468(0xf8)](_0x38a67e))return[];const _0x2f045d=[];for(const _0x375ffa of fs[_0xd25468(0xf2)](_0x38a67e,{'withFileTypes':!![]})){if(!_0x375ffa['isDirectory']())continue;try{const _0x5c9346=readArtifactDir(artifactDir(_0x38a67e,_0x375ffa['name']),_0x375ffa[_0xd25468(0xca)]);if(!_0x3cf943||_0x5c9346[_0xd25468(0xc0)]===_0x3cf943)_0x2f045d[_0xd25468(0xd5)]({'id':_0x5c9346['id'],'name':_0x5c9346['name'],'kind':_0x5c9346[_0xd25468(0xc0)]});}catch{}}return _0x2f045d;},async 'get'(_0x4de4d0){const _0x126aee=_0x2b4cef,_0x306d2a=artifactDir(_0x38a67e,_0x4de4d0);if(!fs[_0x126aee(0xf8)](_0x306d2a))throw new store['KtNotFoundError'](_0x126aee(0xcb)+_0x4de4d0);return readArtifactDir(_0x306d2a,_0x4de4d0);},async 'save'(_0x481d56){const _0x72456=_0x2b4cef,_0xd28689=artifactDir(_0x38a67e,_0x481d56['id']),_0x4ddf9d=fs[_0x72456(0xf8)](_0xd28689)?readArtifactDir(_0xd28689,_0x481d56['id']):void 0x0;if(_0x481d56[_0x72456(0xaa)]&&_0x4ddf9d?.['etag']&&_0x481d56['etag']!==_0x4ddf9d[_0x72456(0xaa)])throw new store[(_0x72456(0xe1))](_0x72456(0xaf),_0x4ddf9d);const _0x15dead=newEtag();return writeArtifactDir(_0xd28689,_0x481d56,_0x15dead),{..._0x481d56,'etag':_0x15dead};},async 'create'(_0x5094c6){const _0x4c6ea4=_0x2b4cef,_0x2137fd=_0x5094c6[_0x4c6ea4(0xc0)]+'-'+Math[_0x4c6ea4(0xc3)]()[_0x4c6ea4(0xec)](0x24)[_0x4c6ea4(0xde)](0x2,0xa),_0x1662f3={'id':_0x2137fd,'name':_0x5094c6[_0x4c6ea4(0xca)],'kind':_0x5094c6[_0x4c6ea4(0xc0)],'ktl':store['EMPTY_KTL']};return this[_0x4c6ea4(0xea)](_0x1662f3);},async 'remove'(_0x316b70){const _0x991f3a=_0x2b4cef,_0x498ce5=artifactDir(_0x38a67e,_0x316b70);if(!fs[_0x991f3a(0xf8)](_0x498ce5))throw new store[(_0x991f3a(0xb4))]('artifact\x20'+_0x316b70);fs[_0x991f3a(0xc6)](_0x498ce5,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x353354,_0xc9de44={}){const _0x8595cc=_0xf8d0;fs[_0x8595cc(0xd6)](_0x353354,{'recursive':!![]});const _0x464a1f=_0x10744a=>path[_0x8595cc(0xb8)](_0x353354,_0x10744a+_0x8595cc(0xee));for(const [_0x1593cd,_0x26c2c0]of Object[_0x8595cc(0xf5)](_0xc9de44)){if(!fs[_0x8595cc(0xf8)](_0x464a1f(_0x1593cd)))fs[_0x8595cc(0xcf)](_0x464a1f(_0x1593cd),JSON[_0x8595cc(0xe4)](_0x26c2c0,null,0x2),_0x8595cc(0xb1));}return{async 'get'(_0x4bda19){const _0x2e5ee5=_0x8595cc,_0x31fcd3=_0x464a1f(_0x4bda19);if(!fs['existsSync'](_0x31fcd3))throw new store[(_0x2e5ee5(0xb4))]('instance\x20'+_0x4bda19);return JSON[_0x2e5ee5(0xe6)](fs[_0x2e5ee5(0xda)](_0x31fcd3,_0x2e5ee5(0xb1)));},async 'save'(_0x1fb75a,_0x412d18){const _0x3f16b2=_0x8595cc,_0x588903=_0x464a1f(_0x1fb75a),_0x4538b4=fs[_0x3f16b2(0xf8)](_0x588903)?JSON['parse'](fs[_0x3f16b2(0xda)](_0x588903,'utf8')):{'artifactId':'','values':{}},_0x33f55e={'artifactId':_0x4538b4[_0x3f16b2(0xbf)],'values':{..._0x4538b4[_0x3f16b2(0xc8)],..._0x412d18[_0x3f16b2(0xc8)]},'common':{..._0x4538b4[_0x3f16b2(0xbe)],..._0x412d18[_0x3f16b2(0xbe)]},'tabCommon':{..._0x4538b4[_0x3f16b2(0xed)],..._0x412d18[_0x3f16b2(0xed)]}};fs[_0x3f16b2(0xcf)](_0x588903,JSON['stringify'](_0x33f55e,null,0x2),_0x3f16b2(0xb1));},async 'list'(_0x24f3f3){const _0xdfe53a=_0x8595cc;return fs[_0xdfe53a(0xf2)](_0x353354)['filter'](_0x5ada39=>_0x5ada39[_0xdfe53a(0xe3)](_0xdfe53a(0xee)))[_0xdfe53a(0xc4)](_0x7c9698=>{const _0x3dbb75=_0xdfe53a,_0x136a6e=_0x7c9698[_0x3dbb75(0xde)](0x0,-0x5),_0x2b3e75=JSON[_0x3dbb75(0xe6)](fs[_0x3dbb75(0xda)](path['join'](_0x353354,_0x7c9698),_0x3dbb75(0xb1)));return{'id':_0x136a6e,'artifactId':_0x2b3e75[_0x3dbb75(0xbf)]};})[_0xdfe53a(0xbd)](_0x11963a=>!_0x24f3f3||_0x11963a[_0xdfe53a(0xbf)]===_0x24f3f3);},async 'create'(_0x25ee74){const _0x354a02=_0x8595cc,_0x7d4183='inst-'+Math[_0x354a02(0xc3)]()[_0x354a02(0xec)](0x24)[_0x354a02(0xde)](0x2,0xa);return fs[_0x354a02(0xcf)](_0x464a1f(_0x7d4183),JSON[_0x354a02(0xe4)]({'artifactId':_0x25ee74[_0x354a02(0xbf)],'values':{},'common':{}},null,0x2),_0x354a02(0xb1)),{'id':_0x7d4183};}};}function sha256Hex(_0x37913b){const _0x30b413=_0xf8d0,_0x272afc=typeof _0x37913b===_0x30b413(0xdb)?Buffer['from'](_0x37913b,'utf8'):Buffer[_0x30b413(0xab)](_0x37913b);return crypto[_0x30b413(0xb6)]('sha256')[_0x30b413(0xdf)](_0x272afc)[_0x30b413(0xd4)]('hex');}function writeObject(_0x173374,_0x5b3a19){const _0x5005e2=_0xf8d0,_0x25ad2d=sha256Hex(_0x5b3a19),_0x516a31=objectPath(_0x173374,_0x25ad2d);fs['mkdirSync'](path[_0x5005e2(0xe8)](_0x516a31),{'recursive':!![]});if(!fs[_0x5005e2(0xf8)](_0x516a31))fs[_0x5005e2(0xcf)](_0x516a31,_0x5b3a19);return _0x25ad2d;}function _0x2ad6(_0x26e19c,_0x22097e){_0x26e19c=_0x26e19c-0xa9;const _0x189e75=_0x189e();let _0x2ad6b3=_0x189e75[_0x26e19c];if(_0x2ad6['gxlMfR']===undefined){var _0x3d903c=function(_0x9c8f96){const _0x500934='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1b17a9='',_0x42e2bd='';for(let _0x1b9106=0x0,_0x182eb3,_0x17146e,_0xc89820=0x0;_0x17146e=_0x9c8f96['charAt'](_0xc89820++);~_0x17146e&&(_0x182eb3=_0x1b9106%0x4?_0x182eb3*0x40+_0x17146e:_0x17146e,_0x1b9106++%0x4)?_0x1b17a9+=String['fromCharCode'](0xff&_0x182eb3>>(-0x2*_0x1b9106&0x6)):0x0){_0x17146e=_0x500934['indexOf'](_0x17146e);}for(let _0x5bcdd7=0x0,_0x2ab37b=_0x1b17a9['length'];_0x5bcdd7<_0x2ab37b;_0x5bcdd7++){_0x42e2bd+='%'+('00'+_0x1b17a9['charCodeAt'](_0x5bcdd7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x42e2bd);};_0x2ad6['aSxljy']=_0x3d903c,_0x2ad6['gWVakp']={},_0x2ad6['gxlMfR']=!![];}const _0x24d156=_0x189e75[0x0];_0x2ad6['ofIskg']!==_0x24d156&&(_0x2ad6['gWVakp']={},_0x2ad6['ofIskg']=_0x24d156);const _0x509e3c=_0x2ad6['gWVakp'][_0x26e19c];return _0x509e3c===undefined?(_0x2ad6b3=_0x2ad6['aSxljy'](_0x2ad6b3),_0x2ad6['gWVakp'][_0x26e19c]=_0x2ad6b3):_0x2ad6b3=_0x509e3c,_0x2ad6b3;}function readLog(_0x4e4e7e,_0x37bd5d,_0x2eeae0){const _0x510813=_0xf8d0,_0x300269=itemDir(_0x4e4e7e,_0x37bd5d,_0x2eeae0),_0x11c743=path[_0x510813(0xb8)](_0x300269,_0x510813(0xa9)),_0x366bdc=path[_0x510813(0xb8)](_0x300269,_0x510813(0xdd)),_0x1153f5=fs['existsSync'](_0x11c743)?JSON[_0x510813(0xe6)](fs[_0x510813(0xda)](_0x11c743,'utf8')):[],_0x6a802e=fs[_0x510813(0xf8)](_0x366bdc)?fs[_0x510813(0xda)](_0x366bdc,_0x510813(0xb1))[_0x510813(0xf7)]():_0x1153f5['at'](-0x1)?.['rev']??null;return{'head':_0x6a802e,'items':_0x1153f5};}function _0x189e(){const _0x17ecb9=['zMLSDgvY','y29TBw9U','yxj0AwzHy3rjza','A2LUza','mZC0mJm2ohbhuxnjwG','5OgI5Asn6iEQia','CMfUzg9T','BwfW','zMLUza','CM1tEw5J','Bwv0yq','DMfSDwvZ','lwXVy2fSlq','BMfTzq','yxj0AwzHy3qG','nZjTD2fMrgG','CMv2ia','zgvJB2rL','D3jPDgvgAwXLu3LUyW','DMvYC2LVBNnsB290','ndaXote2uMPtwxvW','y3DK','yxj0AwzHy3ruB0zPBgvZ','zgLNzxn0','ChvZAa','BwTKAxjtEw5J','qvjusuzbq1rFrKLmrv9srvbpuLq','B2jQzwn0CW','A2v5CW','CMvHzezPBgvtEw5J','C3rYAw5N','mtmWmdq3EeTzuer0','sevbra','C2XPy2u','DxbKyxrL','C2vLzeLUC3rHBMnLCW','s3rdB25MBgLJDevYCM9Y','Aw5ZDgfUy2vZuM9VDa','zw5KC1DPDgG','C3rYAw5NAwz5','zMLSzxm','CgfYC2u','z2v0sg91CNm','zgLYBMfTzq','Dg9ju09tDhjPBMC','C2f2zq','AxrLBxm','Dg9tDhjPBMC','DgfIq29TBw9U','lMPZB24','qvjusuzbq1rFrKLmrv9nrvrb','AgvHza','AxneAxjLy3rVCNK','CMvHzgrPCLn5BMm','mte2mdK1meP4BeTYDW','z2v0rgf0zq','zw50CMLLCW','C2vLza','DhjPBq','zxHPC3rZu3LUyW','mte5mdmYmgv4rhzptG','lMv0ywC','Cgf0Aa','zMfJzxm','qvjusuzbq1rFrKLmrv9gsuXm','CgfKu3rHCNq','qvjusuzbq1rFrKLmrv9ct0rz','Bg9NlMPZB24','zxrHzW','zNjVBq','z2v0rNvSBfLLyxi','qgSTDgfIBguVCMvWB3j0l3n0B3jL','y3jLyxrLs3rgC1n0B3jLCW','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','zMLSzxnuB0fYDgLMywn0','DxrMoa','z2v0','CMv2','s3roB3rgB3vUzevYCM9Y','BM90zq','y3jLyxrLsgfZAa','AxnbyNnVBhv0zq','AM9PBG','CMvHzezPBgu','C29YDa','mZm4odmXnuffwhziAG','nZeZodrquuXsCMy'];_0x189e=function(){return _0x17ecb9;};return _0x189e();}function writeLog(_0x5faa0b,_0x13e1c7,_0x260400,_0x552273,_0x27d8f7){const _0x16c6a7=_0xf8d0,_0x527c5c=itemDir(_0x5faa0b,_0x13e1c7,_0x260400);fs[_0x16c6a7(0xd6)](_0x527c5c,{'recursive':!![]}),fs[_0x16c6a7(0xcf)](path[_0x16c6a7(0xb8)](_0x527c5c,_0x16c6a7(0xa9)),JSON['stringify'](_0x27d8f7,null,0x2),'utf8'),fs[_0x16c6a7(0xcf)](path[_0x16c6a7(0xb8)](_0x527c5c,_0x16c6a7(0xdd)),_0x552273+'\x0a',_0x16c6a7(0xb1));}function findRev(_0x280fb9,_0x22c228){const _0x1806b6=_0xf8d0,_0x5dbb0f=path[_0x1806b6(0xb8)](_0x280fb9,'items');if(!fs['existsSync'](_0x5dbb0f))return void 0x0;for(const _0x2fd6f6 of fs[_0x1806b6(0xf2)](_0x5dbb0f,{'withFileTypes':!![]})){if(!_0x2fd6f6['isDirectory']())continue;for(const _0x59dc1f of fs[_0x1806b6(0xf2)](path['join'](_0x5dbb0f,_0x2fd6f6['name']),{'withFileTypes':!![]})){if(!_0x59dc1f[_0x1806b6(0xf1)]())continue;const _0x23384f=readLog(_0x280fb9,_0x2fd6f6[_0x1806b6(0xca)],_0x59dc1f[_0x1806b6(0xca)])[_0x1806b6(0xeb)][_0x1806b6(0xc5)](_0x6af0c0=>_0x6af0c0[_0x1806b6(0xb3)]===_0x22c228);if(_0x23384f)return _0x23384f;}}return void 0x0;}function filesTextOf(_0x135027,_0x5a5847){const _0x2e8419=_0xf8d0,_0x5e4c16={};for(const [_0xb418aa,_0x35f3d7]of Object[_0x2e8419(0xf5)](_0x5a5847[_0x2e8419(0xe5)])){const _0x5a8a24=objectPath(_0x135027,_0x35f3d7);if(fs[_0x2e8419(0xf8)](_0x5a8a24))_0x5e4c16[_0xb418aa]=fs[_0x2e8419(0xda)](_0x5a8a24,_0x2e8419(0xb1));}return _0x5e4c16;}function createFsVersionStore(_0x1752d9,_0x1663b7){const _0x40f3e2=_0xf8d0;return fs[_0x40f3e2(0xd6)](_0x1752d9,{'recursive':!![]}),{async 'log'(_0x2b1333,_0x384570){const {head:_0x5f2668,items:_0x2f6a5b}=readLog(_0x1752d9,_0x2b1333,_0x384570);return{'head':_0x5f2668,'items':[..._0x2f6a5b]['sort']((_0x2a39ac,_0x296f47)=>_0x2a39ac['at']<_0x296f47['at']?0x1:-0x1)};},async 'get'(_0x45e254){const _0x420b33=_0x40f3e2,_0x4c3711=findRev(_0x1752d9,_0x45e254);if(!_0x4c3711)throw new store[(_0x420b33(0xb4))](_0x420b33(0xcd)+_0x45e254);return _0x4c3711;},async 'readFile'(_0x80871b,_0xed011e){const _0x5ec71f=_0x40f3e2,_0x57f932=await this['get'](_0x80871b),_0x3fa71b=_0x57f932[_0x5ec71f(0xe5)][_0xed011e];if(!_0x3fa71b)throw new store[(_0x5ec71f(0xb4))](_0xed011e);const _0x406b58=objectPath(_0x1752d9,_0x3fa71b);if(!fs[_0x5ec71f(0xf8)](_0x406b58))throw new store[(_0x5ec71f(0xb4))](_0xed011e);return new Uint8Array(fs[_0x5ec71f(0xda)](_0x406b58));},async 'commit'(_0x3fea2c){const _0x3af0f6=_0x40f3e2;let _0x1e75c1=_0x3fea2c[_0x3af0f6(0xe5)];if(!_0x1e75c1){const _0x53b0c5=await _0x1663b7['get'](_0x3fea2c['id']);_0x1e75c1=store[_0x3af0f6(0xd3)](_0x53b0c5);}const _0x426e89={},_0xfd314d={};for(const [_0x3c8003,_0x5aa0f1]of Object['entries'](_0x1e75c1)){const _0x37e0db=typeof _0x5aa0f1===_0x3af0f6(0xdb)?_0x5aa0f1:new TextDecoder()['decode'](_0x5aa0f1);_0x426e89[_0x3c8003]=_0x37e0db,_0xfd314d[_0x3c8003]=writeObject(_0x1752d9,typeof _0x5aa0f1===_0x3af0f6(0xdb)?Buffer[_0x3af0f6(0xab)](_0x5aa0f1,_0x3af0f6(0xb1)):_0x5aa0f1);}const _0x2778f6=readLog(_0x1752d9,_0x3fea2c[_0x3af0f6(0xc0)],_0x3fea2c['id']);if(_0x2778f6[_0x3af0f6(0xf0)]){const _0x1be639=_0x2778f6['items'][_0x3af0f6(0xc5)](_0x1b462b=>_0x1b462b[_0x3af0f6(0xb3)]===_0x2778f6['head']);if(_0x1be639&&store['filesEqual'](_0x426e89,filesTextOf(_0x1752d9,_0x1be639)))return _0x1be639;}const _0x102d41=new Date(),_0x361e74=String(_0x102d41[_0x3af0f6(0xac)]())['slice'](0x2)+String(_0x102d41['getMonth']()+0x1)[_0x3af0f6(0xfe)](0x2,'0')+String(_0x102d41[_0x3af0f6(0xf4)]())[_0x3af0f6(0xfe)](0x2,'0')+String(_0x102d41[_0x3af0f6(0xe7)]())[_0x3af0f6(0xfe)](0x2,'0')+String(_0x102d41['getMinutes']())[_0x3af0f6(0xfe)](0x2,'0'),_0x476a1a=sha256Hex(Object[_0x3af0f6(0xc8)](_0xfd314d)[_0x3af0f6(0xba)]()[_0x3af0f6(0xb8)](','))[_0x3af0f6(0xde)](0x0,0x8),_0xee2dc2={'rev':_0x361e74+_0x3af0f6(0xc9)+_0x476a1a,'kind':_0x3fea2c['kind'],'id':_0x3fea2c['id'],'at':_0x102d41[_0x3af0f6(0xe9)](),'parent':_0x2778f6['head'],'by':_0x3fea2c['by'],'note':_0x3fea2c[_0x3af0f6(0xb5)],'files':_0xfd314d,'meta':_0x3fea2c[_0x3af0f6(0xc7)]};return writeLog(_0x1752d9,_0x3fea2c[_0x3af0f6(0xc0)],_0x3fea2c['id'],_0xee2dc2['rev'],[..._0x2778f6[_0x3af0f6(0xeb)],_0xee2dc2]),_0xee2dc2;},async 'restore'(_0x45f75d,_0x19257e,_0x70c2ad,_0x31f92e){const _0x362a84=_0x40f3e2,_0x19b198=await this[_0x362a84(0xb2)](_0x70c2ad),_0x27760d={};for(const _0x1111ff of Object[_0x362a84(0xd9)](_0x19b198[_0x362a84(0xe5)])){_0x27760d[_0x1111ff]=new TextDecoder()[_0x362a84(0xce)](await this[_0x362a84(0xb9)](_0x70c2ad,_0x1111ff));}const _0x2ccc0e=store['filesToArtifact'](_0x27760d,_0x19257e);return await _0x1663b7[_0x362a84(0xea)]({..._0x2ccc0e,'id':_0x19257e,'kind':_0x2ccc0e['kind'],'etag':void 0x0}),this['commit']({'kind':_0x45f75d,'id':_0x19257e,'files':_0x27760d,'by':_0x31f92e,'note':_0x362a84(0xc2)+_0x70c2ad});}};}function createKtFsStores(_0xe5b1df){const _0x27f45c=_0xf8d0,_0x3183b7=createFsArtifactStore(resolveRoot(_0xe5b1df['artifactsRoot'],_0xe5b1df[_0x27f45c(0xd2)]),_0xe5b1df[_0x27f45c(0xf6)]),_0x2ac8f2=_0xe5b1df['instancesRoot']?createFsInstanceStore(resolveRoot(_0xe5b1df[_0x27f45c(0xe2)],_0xe5b1df[_0x27f45c(0xd2)]),_0xe5b1df[_0x27f45c(0xe0)]):void 0x0,_0x34e06d=_0xe5b1df[_0x27f45c(0xd0)]?createFsVersionStore(resolveRoot(_0xe5b1df[_0x27f45c(0xd0)],_0xe5b1df[_0x27f45c(0xd2)]),_0x3183b7):void 0x0;return{'artifacts':_0x3183b7,'instances':_0x2ac8f2,'versions':_0x34e06d};}exports[_0xf8d0(0xae)]=createKtFsStores;
|
package/dist/fs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3094ce=_0x6f1c;(function(_0x9b06cf,_0x252bbb){const _0x10fcc9=_0x6f1c,_0x96d6da=_0x9b06cf();while(!![]){try{const _0x5df160=parseInt(_0x10fcc9(0x21c))/0x1+parseInt(_0x10fcc9(0x1f9))/0x2*(parseInt(_0x10fcc9(0x1ff))/0x3)+parseInt(_0x10fcc9(0x20a))/0x4+parseInt(_0x10fcc9(0x1fb))/0x5+parseInt(_0x10fcc9(0x1fa))/0x6*(parseInt(_0x10fcc9(0x1fe))/0x7)+parseInt(_0x10fcc9(0x219))/0x8*(-parseInt(_0x10fcc9(0x218))/0x9)+parseInt(_0x10fcc9(0x220))/0xa*(-parseInt(_0x10fcc9(0x1e3))/0xb);if(_0x5df160===_0x252bbb)break;else _0x96d6da['push'](_0x96d6da['shift']());}catch(_0x1c2754){_0x96d6da['push'](_0x96d6da['shift']());}}}(_0x7de7,0x67cc2));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(_0x5e0302,_0x47dfae=process[_0x3094ce(0x205)]()){const _0x1b17c8=isAbsolute(_0x5e0302)?_0x5e0302:resolve(_0x47dfae,_0x5e0302);return mkdirSync(_0x1b17c8,{'recursive':!![]}),_0x1b17c8;}function artifactDir(_0x24f9e4,_0x382247){return join(_0x24f9e4,_0x382247);}function _0x7de7(){const _0x17d64c=['zgvJB2rL','mZe3ndiWrxvxC2XW','zMLUza','CMv2','B2jQzwn0CW','C29YDa','z2v0tw9UDgG','DMfSDwvZ','ChvZAa','Dg9tDhjPBMC','Aw5ZDc0','yxj0AwzHy3rjza','Bg9NlMPZB24','DMvYC2LVBNnsB290','AxneAxjLy3rVCNK','mJi4nZG5u011terZ','mJaWsuHLuM11','BM93','z2v0','nZa2mdmXr2r6C1Dg','BwfW','sevbra','A2LUza','ndC3nZCWvwrqtenx','CMvHzezPBgu','y29TBw9U','C3rYAw5NAwz5','C3rYAw5N','5OgI5Asn6iEQia','zgLNzxn0','lMPZB24','lwXVy2fSlq','mJa5BKDkA1rU','zNjVBq','CMfUzg9T','Bwv0yq','zw5KC1DPDgG','z2v0rgf0zq','BM90zq','zw50CMLLCW','zMLSzxm','Dg9ju09tDhjPBMC','Aw5ZDgfUy2vZuM9VDa','AgvHza','CMv2ia','DgfIq29TBw9U','C2XPy2u','DxrMoa','yxj0AwzHy3rZuM9VDa','DxbKyxrL','AM9PBG','z2v0sg91CNm','C2HHmJu2','zxrHzW','ndeWnZa4uePrrMPk','mJmZnfjuuMn2EG','nJyYnda1EuXXzKXr','CgfYC2u','CgfKu3rHCNq','nZGXovDlDvn6vq','ovv6AgjmyG','zMLSDgvY','AxrLBxm','DhjPBq','y29TBwL0','C2f2zq','y3DK','BMfTzq','lMv0ywC','z2v0rNvSBfLLyxi'];_0x7de7=function(){return _0x17d64c;};return _0x7de7();}function objectPath(_0x260a78,_0x34c2f0){const _0x1e8a0d=_0x3094ce;return join(_0x260a78,_0x1e8a0d(0x20d),_0x34c2f0[_0x1e8a0d(0x1f1)](0x0,0x2),_0x34c2f0);}function itemDir(_0x28ef4a,_0x29f3c1,_0x5f43cc){const _0x1c37a5=_0x3094ce;return join(_0x28ef4a,_0x1c37a5(0x201),_0x29f3c1,_0x5f43cc);}function newEtag(){const _0x577113=_0x3094ce;return Date[_0x577113(0x21a)]()['toString'](0x24)+'-'+Math[_0x577113(0x1e5)]()[_0x577113(0x212)](0x24)[_0x577113(0x1f1)](0x2,0x8);}function readEtag(_0x12090b){const _0x49133d=join(_0x12090b,'.etag');return existsSync(_0x49133d)?readFileSync(_0x49133d,'utf8')['trim']():void 0x0;}function writeArtifactDir(_0x1bb59a,_0x2a0b24,_0x195b67){const _0x4e34df=_0x3094ce;mkdirSync(join(_0x1bb59a,'faces'),{'recursive':!![]});const _0x91c229=artifactToFiles(_0x2a0b24);writeFileSync(join(_0x1bb59a,ARTIFACT_FILE_META),_0x91c229[ARTIFACT_FILE_META]??'{}',_0x4e34df(0x1f2)),writeFileSync(join(_0x1bb59a,ARTIFACT_FILE_BODY),_0x91c229[ARTIFACT_FILE_BODY]??'','utf8');const _0x377b72=join(_0x1bb59a,ARTIFACT_FILE_FILL),_0x30f4ba=join(_0x1bb59a,ARTIFACT_FILE_REPORT);if(_0x91c229[ARTIFACT_FILE_FILL])writeFileSync(_0x377b72,_0x91c229[ARTIFACT_FILE_FILL],_0x4e34df(0x1f2));else{if(existsSync(_0x377b72))rmSync(_0x377b72);}if(_0x91c229[ARTIFACT_FILE_REPORT])writeFileSync(_0x30f4ba,_0x91c229[ARTIFACT_FILE_REPORT],_0x4e34df(0x1f2));else{if(existsSync(_0x30f4ba))rmSync(_0x30f4ba);}writeFileSync(join(_0x1bb59a,_0x4e34df(0x207)),_0x195b67,_0x4e34df(0x1f2));}function readArtifactDir(_0x1a2a3f,_0x1990e0){const _0x2c7a7a=_0x3094ce,_0x16065f={},_0x536717=join(_0x1a2a3f,ARTIFACT_FILE_META),_0x186622=join(_0x1a2a3f,ARTIFACT_FILE_BODY);if(existsSync(_0x536717))_0x16065f[ARTIFACT_FILE_META]=readFileSync(_0x536717,_0x2c7a7a(0x1f2));if(existsSync(_0x186622))_0x16065f[ARTIFACT_FILE_BODY]=readFileSync(_0x186622,_0x2c7a7a(0x1f2));const _0x352075=join(_0x1a2a3f,ARTIFACT_FILE_FILL),_0x50095d=join(_0x1a2a3f,ARTIFACT_FILE_REPORT);if(existsSync(_0x352075))_0x16065f[ARTIFACT_FILE_FILL]=readFileSync(_0x352075,'utf8');if(existsSync(_0x50095d))_0x16065f[ARTIFACT_FILE_REPORT]=readFileSync(_0x50095d,'utf8');return{...filesToArtifact(_0x16065f,_0x1990e0),'etag':readEtag(_0x1a2a3f)};}function createFsArtifactStore(_0x34337d,_0x2a176a=[]){const _0x110bfd=_0x3094ce;mkdirSync(_0x34337d,{'recursive':!![]});for(const _0x48f572 of _0x2a176a){const _0x18eedd=artifactDir(_0x34337d,_0x48f572['id']),_0xaca0a2=join(_0x18eedd,ARTIFACT_FILE_BODY);if(!existsSync(_0xaca0a2))writeArtifactDir(_0x18eedd,_0x48f572,_0x48f572[_0x110bfd(0x1f8)]??newEtag());}return{async 'list'(_0x415b6a){const _0x1ff934=_0x110bfd;if(!existsSync(_0x34337d))return[];const _0x4e0476=[];for(const _0x576f2 of readdirSync(_0x34337d,{'withFileTypes':!![]})){if(!_0x576f2['isDirectory']())continue;try{const _0x49394e=readArtifactDir(artifactDir(_0x34337d,_0x576f2[_0x1ff934(0x206)]),_0x576f2[_0x1ff934(0x206)]);if(!_0x415b6a||_0x49394e[_0x1ff934(0x21f)]===_0x415b6a)_0x4e0476[_0x1ff934(0x211)]({'id':_0x49394e['id'],'name':_0x49394e[_0x1ff934(0x206)],'kind':_0x49394e[_0x1ff934(0x21f)]});}catch{}}return _0x4e0476;},async 'get'(_0x11518e){const _0x31ebb3=artifactDir(_0x34337d,_0x11518e);if(!existsSync(_0x31ebb3))throw new KtNotFoundError('artifact\x20'+_0x11518e);return readArtifactDir(_0x31ebb3,_0x11518e);},async 'save'(_0x1d4712){const _0x5cc7a7=_0x110bfd,_0x4687e2=artifactDir(_0x34337d,_0x1d4712['id']),_0x5d6f10=existsSync(_0x4687e2)?readArtifactDir(_0x4687e2,_0x1d4712['id']):void 0x0;if(_0x1d4712[_0x5cc7a7(0x1f8)]&&_0x5d6f10?.['etag']&&_0x1d4712[_0x5cc7a7(0x1f8)]!==_0x5d6f10[_0x5cc7a7(0x1f8)])throw new KtConflictError('\u5DE5\u4F5C\u526F\u672C\u5DF2\u53D8\u66F4',_0x5d6f10);const _0x5056d7=newEtag();return writeArtifactDir(_0x4687e2,_0x1d4712,_0x5056d7),{..._0x1d4712,'etag':_0x5056d7};},async 'create'(_0x594a0e){const _0x2ec2d8=_0x110bfd,_0x17f85c=_0x594a0e['kind']+'-'+Math[_0x2ec2d8(0x1e5)]()['toString'](0x24)[_0x2ec2d8(0x1f1)](0x2,0xa),_0x52fadb={'id':_0x17f85c,'name':_0x594a0e[_0x2ec2d8(0x206)],'kind':_0x594a0e['kind'],'ktl':EMPTY_KTL};return this['save'](_0x52fadb);},async 'remove'(_0x3e5545){const _0x5a016f=artifactDir(_0x34337d,_0x3e5545);if(!existsSync(_0x5a016f))throw new KtNotFoundError('artifact\x20'+_0x3e5545);rmSync(_0x5a016f,{'recursive':!![],'force':!![]});}};}function createFsInstanceStore(_0x5e3e90,_0x49165c={}){const _0x156eeb=_0x3094ce;mkdirSync(_0x5e3e90,{'recursive':!![]});const _0x57e1da=_0x3761cc=>join(_0x5e3e90,_0x3761cc+_0x156eeb(0x1e1));for(const [_0x2a7fec,_0x2a5a70]of Object[_0x156eeb(0x1ea)](_0x49165c)){if(!existsSync(_0x57e1da(_0x2a7fec)))writeFileSync(_0x57e1da(_0x2a7fec),JSON[_0x156eeb(0x223)](_0x2a5a70,null,0x2),_0x156eeb(0x1f2));}return{async 'get'(_0x29341){const _0x29eb4e=_0x156eeb,_0xafa0a9=_0x57e1da(_0x29341);if(!existsSync(_0xafa0a9))throw new KtNotFoundError('instance\x20'+_0x29341);return JSON[_0x29eb4e(0x1fc)](readFileSync(_0xafa0a9,_0x29eb4e(0x1f2)));},async 'save'(_0x5676e8,_0x30db77){const _0x235b89=_0x156eeb,_0x41064e=_0x57e1da(_0x5676e8),_0x38afd1=existsSync(_0x41064e)?JSON[_0x235b89(0x1fc)](readFileSync(_0x41064e,_0x235b89(0x1f2))):{'artifactId':'','values':{}},_0x5f4489={'artifactId':_0x38afd1[_0x235b89(0x214)],'values':{..._0x38afd1[_0x235b89(0x210)],..._0x30db77[_0x235b89(0x210)]},'common':{..._0x38afd1[_0x235b89(0x222)],..._0x30db77[_0x235b89(0x222)]},'tabCommon':{..._0x38afd1[_0x235b89(0x1f0)],..._0x30db77[_0x235b89(0x1f0)]}};writeFileSync(_0x41064e,JSON[_0x235b89(0x223)](_0x5f4489,null,0x2),_0x235b89(0x1f2));},async 'list'(_0x522b43){const _0x3ae6a8=_0x156eeb;return readdirSync(_0x5e3e90)[_0x3ae6a8(0x200)](_0x3f6a23=>_0x3f6a23[_0x3ae6a8(0x1e7)](_0x3ae6a8(0x1e1)))[_0x3ae6a8(0x21d)](_0x33ebfc=>{const _0xce321d=_0x3ae6a8,_0x408324=_0x33ebfc[_0xce321d(0x1f1)](0x0,-0x5),_0x5f26b6=JSON['parse'](readFileSync(join(_0x5e3e90,_0x33ebfc),'utf8'));return{'id':_0x408324,'artifactId':_0x5f26b6['artifactId']};})[_0x3ae6a8(0x200)](_0x3c4046=>!_0x522b43||_0x3c4046['artifactId']===_0x522b43);},async 'create'(_0x161282){const _0x3efa68=_0x156eeb,_0x16ee77=_0x3efa68(0x213)+Math[_0x3efa68(0x1e5)]()[_0x3efa68(0x212)](0x24)[_0x3efa68(0x1f1)](0x2,0xa);return writeFileSync(_0x57e1da(_0x16ee77),JSON[_0x3efa68(0x223)]({'artifactId':_0x161282[_0x3efa68(0x214)],'values':{},'common':{}},null,0x2),_0x3efa68(0x1f2)),{'id':_0x16ee77};}};}function _0x6f1c(_0x139e93,_0x1f5010){_0x139e93=_0x139e93-0x1de;const _0x7de71f=_0x7de7();let _0x6f1c83=_0x7de71f[_0x139e93];if(_0x6f1c['WTzKab']===undefined){var _0x2350cd=function(_0x57c60f){const _0x29d141='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1398db='',_0x5e0302='';for(let _0x47dfae=0x0,_0x1b17c8,_0x24f9e4,_0x382247=0x0;_0x24f9e4=_0x57c60f['charAt'](_0x382247++);~_0x24f9e4&&(_0x1b17c8=_0x47dfae%0x4?_0x1b17c8*0x40+_0x24f9e4:_0x24f9e4,_0x47dfae++%0x4)?_0x1398db+=String['fromCharCode'](0xff&_0x1b17c8>>(-0x2*_0x47dfae&0x6)):0x0){_0x24f9e4=_0x29d141['indexOf'](_0x24f9e4);}for(let _0x260a78=0x0,_0x34c2f0=_0x1398db['length'];_0x260a78<_0x34c2f0;_0x260a78++){_0x5e0302+='%'+('00'+_0x1398db['charCodeAt'](_0x260a78)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5e0302);};_0x6f1c['hdLxUX']=_0x2350cd,_0x6f1c['WTXXgL']={},_0x6f1c['WTzKab']=!![];}const _0x20e693=_0x7de71f[0x0];_0x6f1c['NHzoUW']!==_0x20e693&&(_0x6f1c['WTXXgL']={},_0x6f1c['NHzoUW']=_0x20e693);const _0x247320=_0x6f1c['WTXXgL'][_0x139e93];return _0x247320===undefined?(_0x6f1c83=_0x6f1c['hdLxUX'](_0x6f1c83),_0x6f1c['WTXXgL'][_0x139e93]=_0x6f1c83):_0x6f1c83=_0x247320,_0x6f1c83;}function sha256Hex(_0x2f2264){const _0x457fe3=_0x3094ce,_0x37eab3=typeof _0x2f2264==='string'?Buffer[_0x457fe3(0x1e4)](_0x2f2264,_0x457fe3(0x1f2)):Buffer[_0x457fe3(0x1e4)](_0x2f2264);return createHash(_0x457fe3(0x1f7))[_0x457fe3(0x1f4)](_0x37eab3)[_0x457fe3(0x1e0)]('hex');}function writeObject(_0x5dee77,_0x1978ab){const _0x389191=sha256Hex(_0x1978ab),_0x568a3b=objectPath(_0x5dee77,_0x389191);mkdirSync(dirname(_0x568a3b),{'recursive':!![]});if(!existsSync(_0x568a3b))writeFileSync(_0x568a3b,_0x1978ab);return _0x389191;}function readLog(_0x2fa876,_0x131af3,_0x21ef0a){const _0x2aa3be=_0x3094ce,_0x3827e8=itemDir(_0x2fa876,_0x131af3,_0x21ef0a),_0x590449=join(_0x3827e8,_0x2aa3be(0x215)),_0x14da8d=join(_0x3827e8,_0x2aa3be(0x21e)),_0x1c3aaf=existsSync(_0x590449)?JSON[_0x2aa3be(0x1fc)](readFileSync(_0x590449,'utf8')):[],_0x31f426=existsSync(_0x14da8d)?readFileSync(_0x14da8d,_0x2aa3be(0x1f2))[_0x2aa3be(0x202)]():_0x1c3aaf['at'](-0x1)?.['rev']??null;return{'head':_0x31f426,'items':_0x1c3aaf};}function writeLog(_0x231658,_0x1b57ea,_0x3b2dab,_0x2d2381,_0x49ff74){const _0x100e29=_0x3094ce,_0x47eb43=itemDir(_0x231658,_0x1b57ea,_0x3b2dab);mkdirSync(_0x47eb43,{'recursive':!![]}),writeFileSync(join(_0x47eb43,_0x100e29(0x215)),JSON['stringify'](_0x49ff74,null,0x2),_0x100e29(0x1f2)),writeFileSync(join(_0x47eb43,'HEAD'),_0x2d2381+'\x0a','utf8');}function findRev(_0x4d68b9,_0x55cc44){const _0x450fd6=_0x3094ce,_0x21377f=join(_0x4d68b9,_0x450fd6(0x201));if(!existsSync(_0x21377f))return void 0x0;for(const _0x557a78 of readdirSync(_0x21377f,{'withFileTypes':!![]})){if(!_0x557a78[_0x450fd6(0x217)]())continue;for(const _0x2b22e7 of readdirSync(join(_0x21377f,_0x557a78['name']),{'withFileTypes':!![]})){if(!_0x2b22e7['isDirectory']())continue;const _0x250fde=readLog(_0x4d68b9,_0x557a78[_0x450fd6(0x206)],_0x2b22e7['name'])[_0x450fd6(0x201)]['find'](_0x48c1b8=>_0x48c1b8[_0x450fd6(0x20c)]===_0x55cc44);if(_0x250fde)return _0x250fde;}}return void 0x0;}function filesTextOf(_0x4a0256,_0x2f462b){const _0x5c4c57=_0x3094ce,_0x1131c7={};for(const [_0x12cf7f,_0x6740d9]of Object['entries'](_0x2f462b[_0x5c4c57(0x1eb)])){const _0x278a06=objectPath(_0x4a0256,_0x6740d9);if(existsSync(_0x278a06))_0x1131c7[_0x12cf7f]=readFileSync(_0x278a06,'utf8');}return _0x1131c7;}function createFsVersionStore(_0x5ec914,_0x2b12ed){return mkdirSync(_0x5ec914,{'recursive':!![]}),{async 'log'(_0x313641,_0x39639f){const _0x1a4ac6=_0x6f1c,{head:_0x3d202b,items:_0x22fe51}=readLog(_0x5ec914,_0x313641,_0x39639f);return{'head':_0x3d202b,'items':[..._0x22fe51][_0x1a4ac6(0x20e)]((_0x283be1,_0x5e5131)=>_0x283be1['at']<_0x5e5131['at']?0x1:-0x1)};},async 'get'(_0x4c1955){const _0x10fab6=_0x6f1c,_0x49e1bf=findRev(_0x5ec914,_0x4c1955);if(!_0x49e1bf)throw new KtNotFoundError(_0x10fab6(0x1ef)+_0x4c1955);return _0x49e1bf;},async 'readFile'(_0x4fa07b,_0x1d8fab){const _0x540099=_0x6f1c,_0x100157=await this[_0x540099(0x21b)](_0x4fa07b),_0x21b0a2=_0x100157['files'][_0x1d8fab];if(!_0x21b0a2)throw new KtNotFoundError(_0x1d8fab);const _0x22fe7f=objectPath(_0x5ec914,_0x21b0a2);if(!existsSync(_0x22fe7f))throw new KtNotFoundError(_0x1d8fab);return new Uint8Array(readFileSync(_0x22fe7f));},async 'commit'(_0x38e6fa){const _0x45b31b=_0x6f1c;let _0x143cf7=_0x38e6fa[_0x45b31b(0x1eb)];if(!_0x143cf7){const _0x56d553=await _0x2b12ed[_0x45b31b(0x21b)](_0x38e6fa['id']);_0x143cf7=artifactToFiles(_0x56d553);}const _0x3ec1bb={},_0x3ffcce={};for(const [_0x5ce231,_0x2aa720]of Object[_0x45b31b(0x1ea)](_0x143cf7)){const _0x3b9d94=typeof _0x2aa720===_0x45b31b(0x1de)?_0x2aa720:new TextDecoder()[_0x45b31b(0x209)](_0x2aa720);_0x3ec1bb[_0x5ce231]=_0x3b9d94,_0x3ffcce[_0x5ce231]=writeObject(_0x5ec914,typeof _0x2aa720===_0x45b31b(0x1de)?Buffer['from'](_0x2aa720,'utf8'):_0x2aa720);}const _0x3f3586=readLog(_0x5ec914,_0x38e6fa[_0x45b31b(0x21f)],_0x38e6fa['id']);if(_0x3f3586[_0x45b31b(0x1ee)]){const _0x4a2e36=_0x3f3586['items'][_0x45b31b(0x20b)](_0x48eebd=>_0x48eebd['rev']===_0x3f3586[_0x45b31b(0x1ee)]);if(_0x4a2e36&&filesEqual(_0x3ec1bb,filesTextOf(_0x5ec914,_0x4a2e36)))return _0x4a2e36;}const _0x86dd2c=new Date(),_0x1cc720=String(_0x86dd2c[_0x45b31b(0x208)]())['slice'](0x2)+String(_0x86dd2c[_0x45b31b(0x20f)]()+0x1)['padStart'](0x2,'0')+String(_0x86dd2c[_0x45b31b(0x1e8)]())[_0x45b31b(0x1fd)](0x2,'0')+String(_0x86dd2c[_0x45b31b(0x1f6)]())[_0x45b31b(0x1fd)](0x2,'0')+String(_0x86dd2c['getMinutes']())[_0x45b31b(0x1fd)](0x2,'0'),_0x43e1f2=sha256Hex(Object[_0x45b31b(0x210)](_0x3ffcce)[_0x45b31b(0x20e)]()[_0x45b31b(0x1f5)](','))[_0x45b31b(0x1f1)](0x0,0x8),_0x18419a={'rev':_0x1cc720+_0x45b31b(0x1e2)+_0x43e1f2,'kind':_0x38e6fa['kind'],'id':_0x38e6fa['id'],'at':_0x86dd2c[_0x45b31b(0x1ec)](),'parent':_0x3f3586[_0x45b31b(0x1ee)],'by':_0x38e6fa['by'],'note':_0x38e6fa[_0x45b31b(0x1e9)],'files':_0x3ffcce,'meta':_0x38e6fa[_0x45b31b(0x1e6)]};return writeLog(_0x5ec914,_0x38e6fa[_0x45b31b(0x21f)],_0x38e6fa['id'],_0x18419a[_0x45b31b(0x20c)],[..._0x3f3586[_0x45b31b(0x201)],_0x18419a]),_0x18419a;},async 'restore'(_0x48a483,_0x4804fa,_0x5db768,_0x2e128e){const _0x314612=_0x6f1c,_0x130353=await this[_0x314612(0x21b)](_0x5db768),_0x8543a5={};for(const _0x535866 of Object['keys'](_0x130353[_0x314612(0x1eb)])){_0x8543a5[_0x535866]=new TextDecoder()[_0x314612(0x209)](await this[_0x314612(0x221)](_0x5db768,_0x535866));}const _0x466a02=filesToArtifact(_0x8543a5,_0x4804fa);return await _0x2b12ed[_0x314612(0x204)]({..._0x466a02,'id':_0x4804fa,'kind':_0x466a02[_0x314612(0x21f)],'etag':void 0x0}),this[_0x314612(0x203)]({'kind':_0x48a483,'id':_0x4804fa,'files':_0x8543a5,'by':_0x2e128e,'note':_0x314612(0x1df)+_0x5db768});}};}function createKtFsStores(_0x49f5d7){const _0x5011c6=_0x3094ce,_0x59e926=createFsArtifactStore(resolveRoot(_0x49f5d7[_0x5011c6(0x1f3)],_0x49f5d7[_0x5011c6(0x205)]),_0x49f5d7['seed']),_0x389d8c=_0x49f5d7[_0x5011c6(0x1ed)]?createFsInstanceStore(resolveRoot(_0x49f5d7[_0x5011c6(0x1ed)],_0x49f5d7['cwd']),_0x49f5d7['seedInstances']):void 0x0,_0x298d4c=_0x49f5d7[_0x5011c6(0x216)]?createFsVersionStore(resolveRoot(_0x49f5d7['versionsRoot'],_0x49f5d7[_0x5011c6(0x205)]),_0x59e926):void 0x0;return{'artifacts':_0x59e926,'instances':_0x389d8c,'versions':_0x298d4c};}export{createKtFsStores};
|
|
1
|
+
const _0x2afcb0=_0x3778;(function(_0x267145,_0x2f087f){const _0xa86319=_0x3778,_0x5ceac5=_0x267145();while(!![]){try{const _0x42a931=parseInt(_0xa86319(0x9d))/0x1*(parseInt(_0xa86319(0x76))/0x2)+-parseInt(_0xa86319(0xad))/0x3+parseInt(_0xa86319(0x68))/0x4+-parseInt(_0xa86319(0x87))/0x5+-parseInt(_0xa86319(0x7b))/0x6*(-parseInt(_0xa86319(0x78))/0x7)+-parseInt(_0xa86319(0x82))/0x8*(-parseInt(_0xa86319(0x6f))/0x9)+parseInt(_0xa86319(0x8a))/0xa;if(_0x42a931===_0x2f087f)break;else _0x5ceac5['push'](_0x5ceac5['shift']());}catch(_0x11cdc9){_0x5ceac5['push'](_0x5ceac5['shift']());}}}(_0x480e,0x7d9f0));import{mkdirSync,existsSync,rmSync,readdirSync,writeFileSync,readFileSync}from'fs';import{join,isAbsolute,resolve,dirname}from'path';import{ARTIFACT_FILE_BODY,KtNotFoundError,EMPTY_KTL,KtConflictError,filesToArtifact,artifactToFiles,filesEqual,ARTIFACT_FILE_META,ARTIFACT_FILE_FILL,ARTIFACT_FILE_REPORT}from'@k-table/report/store';import{createHash}from'crypto';function resolveRoot(_0xb43e26,_0x1a14dd=process[_0x2afcb0(0x7a)]()){const _0x1a6e5d=isAbsolute(_0xb43e26)?_0xb43e26:resolve(_0x1a14dd,_0xb43e26);return mkdirSync(_0x1a6e5d,{'recursive':!![]}),_0x1a6e5d;}function artifactDir(_0x400320,_0x160626){return join(_0x400320,_0x160626);}function objectPath(_0x3bff2c,_0x5c92ec){const _0x26a7e6=_0x2afcb0;return join(_0x3bff2c,_0x26a7e6(0x7e),_0x5c92ec['slice'](0x0,0x2),_0x5c92ec);}function itemDir(_0x55ea1a,_0x5ed0f4,_0x287cc1){const _0x29a9cd=_0x2afcb0;return join(_0x55ea1a,_0x29a9cd(0x85),_0x5ed0f4,_0x287cc1);}function newEtag(){const _0xd30aeb=_0x2afcb0;return Date[_0xd30aeb(0x7d)]()[_0xd30aeb(0x8d)](0x24)+'-'+Math[_0xd30aeb(0xa1)]()['toString'](0x24)[_0xd30aeb(0x88)](0x2,0x8);}function readEtag(_0x374e49){const _0x3705fd=_0x2afcb0,_0x1f1aa3=join(_0x374e49,_0x3705fd(0x95));return existsSync(_0x1f1aa3)?readFileSync(_0x1f1aa3,'utf8')[_0x3705fd(0xae)]():void 0x0;}function writeArtifactDir(_0x2111e5,_0x1dc14c,_0x2ce2b4){const _0x4f474e=_0x2afcb0;mkdirSync(join(_0x2111e5,'faces'),{'recursive':!![]});const _0x1bda4f=artifactToFiles(_0x1dc14c);writeFileSync(join(_0x2111e5,ARTIFACT_FILE_META),_0x1bda4f[ARTIFACT_FILE_META]??'{}',_0x4f474e(0x98)),writeFileSync(join(_0x2111e5,ARTIFACT_FILE_BODY),_0x1bda4f[ARTIFACT_FILE_BODY]??'',_0x4f474e(0x98));const _0x41c38b=join(_0x2111e5,ARTIFACT_FILE_FILL),_0x5acf2a=join(_0x2111e5,ARTIFACT_FILE_REPORT);if(_0x1bda4f[ARTIFACT_FILE_FILL])writeFileSync(_0x41c38b,_0x1bda4f[ARTIFACT_FILE_FILL],_0x4f474e(0x98));else{if(existsSync(_0x41c38b))rmSync(_0x41c38b);}if(_0x1bda4f[ARTIFACT_FILE_REPORT])writeFileSync(_0x5acf2a,_0x1bda4f[ARTIFACT_FILE_REPORT],_0x4f474e(0x98));else{if(existsSync(_0x5acf2a))rmSync(_0x5acf2a);}writeFileSync(join(_0x2111e5,_0x4f474e(0x95)),_0x2ce2b4,_0x4f474e(0x98));}function _0x480e(){const _0x45c113=['DMfSDwvZ','C2vLzeLUC3rHBMnLCW','zNjVBq','lMv0ywC','C2f2zq','y29TBw9U','DxrMoa','Dg9ju09tDhjPBMC','y29TBwL0','Bg9NlMPZB24','AxneAxjLy3rVCNK','mta3n0XvChn5yq','A2v5CW','CMv2','zgLNzxn0','CMfUzg9T','CgfKu3rHCNq','zMLSDgvY','A2LUza','BM90zq','z2v0twLUDxrLCW','CgfYC2u','Aw5ZDc0','Aw5ZDgfUy2vZuM9VDa','zw50CMLLCW','AgvHza','C2vLza','mJaWntG3nwzfrxjQrq','DhjPBq','ndqYnZG4uMfbvKfK','zMLUza','sevbra','lwXVy2fSlq','zMLSzxm','DMvYC2LVBNnsB290','z2v0sg91CNm','mti3ota3mu5MwwPiAq','lMPZB24','yxj0AwzHy3rjza','C29YDa','DxbKyxrL','5BEL5l2C5yMV5PYS5BEY5y+y5PU0','Aw5ZDgfUy2uG','nJe4rfjKChPe','z2v0','mZiYntC0rgjvAMD2','z2v0rgf0zq','y3DK','nJz3tLLQCeu','zgvJB2rL','BM93','B2jQzwn0CW','zxrHzW','C2HHmJu2','yxj0AwzHy3qG','mJrtA3bRA3C','AM9PBG','DgfIq29TBw9U','AxrLBxm','BMfTzq','mJq3otC1meHws3v6Bq','C2XPy2u','C3rYAw5N','mZaYmZCWmgLgA3PhzG','C3rYAw5NAwz5','zw5KC1DPDgG','Dg9tDhjPBMC','z2v0tw9UDgG','CMvHzezPBgu','z2v0rNvSBfLLyxi','yxj0AwzHy3rZuM9VDa'];_0x480e=function(){return _0x45c113;};return _0x480e();}function readArtifactDir(_0x7c1af5,_0x355e48){const _0x5b23cf=_0x2afcb0,_0x298712={},_0x28f37c=join(_0x7c1af5,ARTIFACT_FILE_META),_0x406a40=join(_0x7c1af5,ARTIFACT_FILE_BODY);if(existsSync(_0x28f37c))_0x298712[ARTIFACT_FILE_META]=readFileSync(_0x28f37c,_0x5b23cf(0x98));if(existsSync(_0x406a40))_0x298712[ARTIFACT_FILE_BODY]=readFileSync(_0x406a40,'utf8');const _0x24fe86=join(_0x7c1af5,ARTIFACT_FILE_FILL),_0x426fd6=join(_0x7c1af5,ARTIFACT_FILE_REPORT);if(existsSync(_0x24fe86))_0x298712[ARTIFACT_FILE_FILL]=readFileSync(_0x24fe86,_0x5b23cf(0x98));if(existsSync(_0x426fd6))_0x298712[ARTIFACT_FILE_REPORT]=readFileSync(_0x426fd6,_0x5b23cf(0x98));return{...filesToArtifact(_0x298712,_0x355e48),'etag':readEtag(_0x7c1af5)};}function createFsArtifactStore(_0x53aea5,_0x4521a2=[]){const _0x2c8722=_0x2afcb0;mkdirSync(_0x53aea5,{'recursive':!![]});for(const _0x316d63 of _0x4521a2){const _0xeeb9b4=artifactDir(_0x53aea5,_0x316d63['id']),_0x871299=join(_0xeeb9b4,ARTIFACT_FILE_BODY);if(!existsSync(_0x871299))writeArtifactDir(_0xeeb9b4,_0x316d63,_0x316d63[_0x2c8722(0x7f)]??newEtag());}return{async 'list'(_0x512366){const _0x1dbf29=_0x2c8722;if(!existsSync(_0x53aea5))return[];const _0x1b0056=[];for(const _0x790c97 of readdirSync(_0x53aea5,{'withFileTypes':!![]})){if(!_0x790c97['isDirectory']())continue;try{const _0x5b0f41=readArtifactDir(artifactDir(_0x53aea5,_0x790c97[_0x1dbf29(0x86)]),_0x790c97[_0x1dbf29(0x86)]);if(!_0x512366||_0x5b0f41[_0x1dbf29(0xa4)]===_0x512366)_0x1b0056['push']({'id':_0x5b0f41['id'],'name':_0x5b0f41['name'],'kind':_0x5b0f41[_0x1dbf29(0xa4)]});}catch{}}return _0x1b0056;},async 'get'(_0x241293){const _0x52a9a9=_0x2c8722,_0x3e1775=artifactDir(_0x53aea5,_0x241293);if(!existsSync(_0x3e1775))throw new KtNotFoundError(_0x52a9a9(0x81)+_0x241293);return readArtifactDir(_0x3e1775,_0x241293);},async 'save'(_0x84c6d4){const _0x258b32=_0x2c8722,_0x21e7f4=artifactDir(_0x53aea5,_0x84c6d4['id']),_0xab548d=existsSync(_0x21e7f4)?readArtifactDir(_0x21e7f4,_0x84c6d4['id']):void 0x0;if(_0x84c6d4[_0x258b32(0x7f)]&&_0xab548d?.[_0x258b32(0x7f)]&&_0x84c6d4[_0x258b32(0x7f)]!==_0xab548d['etag'])throw new KtConflictError(_0x258b32(0x74),_0xab548d);const _0x17f5db=newEtag();return writeArtifactDir(_0x21e7f4,_0x84c6d4,_0x17f5db),{..._0x84c6d4,'etag':_0x17f5db};},async 'create'(_0x4000a8){const _0x15f9e2=_0x2c8722,_0x1807a1=_0x4000a8[_0x15f9e2(0xa4)]+'-'+Math['random']()[_0x15f9e2(0x8d)](0x24)[_0x15f9e2(0x88)](0x2,0xa),_0x2b0313={'id':_0x1807a1,'name':_0x4000a8['name'],'kind':_0x4000a8['kind'],'ktl':EMPTY_KTL};return this[_0x15f9e2(0x96)](_0x2b0313);},async 'remove'(_0x3db9f3){const _0x202260=_0x2c8722,_0x3937c0=artifactDir(_0x53aea5,_0x3db9f3);if(!existsSync(_0x3937c0))throw new KtNotFoundError(_0x202260(0x81)+_0x3db9f3);rmSync(_0x3937c0,{'recursive':!![],'force':!![]});}};}function _0x3778(_0x264a7d,_0x432404){_0x264a7d=_0x264a7d-0x68;const _0x480efb=_0x480e();let _0x3778db=_0x480efb[_0x264a7d];if(_0x3778['LYEaOX']===undefined){var _0x222413=function(_0x39ae65){const _0x5af5d0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3d3239='',_0xb43e26='';for(let _0x1a14dd=0x0,_0x1a6e5d,_0x400320,_0x160626=0x0;_0x400320=_0x39ae65['charAt'](_0x160626++);~_0x400320&&(_0x1a6e5d=_0x1a14dd%0x4?_0x1a6e5d*0x40+_0x400320:_0x400320,_0x1a14dd++%0x4)?_0x3d3239+=String['fromCharCode'](0xff&_0x1a6e5d>>(-0x2*_0x1a14dd&0x6)):0x0){_0x400320=_0x5af5d0['indexOf'](_0x400320);}for(let _0x3bff2c=0x0,_0x5c92ec=_0x3d3239['length'];_0x3bff2c<_0x5c92ec;_0x3bff2c++){_0xb43e26+='%'+('00'+_0x3d3239['charCodeAt'](_0x3bff2c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xb43e26);};_0x3778['rZfaxX']=_0x222413,_0x3778['wQKhFd']={},_0x3778['LYEaOX']=!![];}const _0x9b8c43=_0x480efb[0x0];_0x3778['upgzAq']!==_0x9b8c43&&(_0x3778['wQKhFd']={},_0x3778['upgzAq']=_0x9b8c43);const _0x23720d=_0x3778['wQKhFd'][_0x264a7d];return _0x23720d===undefined?(_0x3778db=_0x3778['rZfaxX'](_0x3778db),_0x3778['wQKhFd'][_0x264a7d]=_0x3778db):_0x3778db=_0x23720d,_0x3778db;}function createFsInstanceStore(_0x40298d,_0x1f6fbd={}){const _0x5db1ee=_0x2afcb0;mkdirSync(_0x40298d,{'recursive':!![]});const _0x1e32d4=_0x266fea=>join(_0x40298d,_0x266fea+'.json');for(const [_0x51f349,_0x56bf91]of Object[_0x5db1ee(0xaa)](_0x1f6fbd)){if(!existsSync(_0x1e32d4(_0x51f349)))writeFileSync(_0x1e32d4(_0x51f349),JSON[_0x5db1ee(0x8b)](_0x56bf91,null,0x2),'utf8');}return{async 'get'(_0x203332){const _0x2f5fd3=_0x5db1ee,_0x42443d=_0x1e32d4(_0x203332);if(!existsSync(_0x42443d))throw new KtNotFoundError(_0x2f5fd3(0x75)+_0x203332);return JSON[_0x2f5fd3(0xa7)](readFileSync(_0x42443d,_0x2f5fd3(0x98)));},async 'save'(_0x46bf10,_0x42a5e5){const _0x5e2c96=_0x5db1ee,_0x514188=_0x1e32d4(_0x46bf10),_0x505d33=existsSync(_0x514188)?JSON['parse'](readFileSync(_0x514188,_0x5e2c96(0x98))):{'artifactId':'','values':{}},_0xeae3f4={'artifactId':_0x505d33[_0x5e2c96(0x71)],'values':{..._0x505d33['values'],..._0x42a5e5[_0x5e2c96(0x92)]},'common':{..._0x505d33[_0x5e2c96(0x97)],..._0x42a5e5[_0x5e2c96(0x97)]},'tabCommon':{..._0x505d33['tabCommon'],..._0x42a5e5[_0x5e2c96(0x84)]}};writeFileSync(_0x514188,JSON[_0x5e2c96(0x8b)](_0xeae3f4,null,0x2),_0x5e2c96(0x98));},async 'list'(_0x326954){const _0x1ef43b=_0x5db1ee;return readdirSync(_0x40298d)[_0x1ef43b(0xa3)](_0x356f5d=>_0x356f5d[_0x1ef43b(0x8c)](_0x1ef43b(0x70)))['map'](_0x413fb7=>{const _0x5d4563=_0x1ef43b,_0x384831=_0x413fb7[_0x5d4563(0x88)](0x0,-0x5),_0x513137=JSON[_0x5d4563(0xa7)](readFileSync(join(_0x40298d,_0x413fb7),_0x5d4563(0x98)));return{'id':_0x384831,'artifactId':_0x513137[_0x5d4563(0x71)]};})[_0x1ef43b(0xa3)](_0x4d7667=>!_0x326954||_0x4d7667[_0x1ef43b(0x71)]===_0x326954);},async 'create'(_0x19d772){const _0x7991d2=_0x5db1ee,_0x5bc1a3=_0x7991d2(0xa8)+Math[_0x7991d2(0xa1)]()['toString'](0x24)[_0x7991d2(0x88)](0x2,0xa);return writeFileSync(_0x1e32d4(_0x5bc1a3),JSON[_0x7991d2(0x8b)]({'artifactId':_0x19d772[_0x7991d2(0x71)],'values':{},'common':{}},null,0x2),_0x7991d2(0x98)),{'id':_0x5bc1a3};}};}function sha256Hex(_0x297f44){const _0x336c71=_0x2afcb0,_0x87c77a=typeof _0x297f44===_0x336c71(0x89)?Buffer[_0x336c71(0x94)](_0x297f44,'utf8'):Buffer[_0x336c71(0x94)](_0x297f44);return createHash(_0x336c71(0x80))[_0x336c71(0x73)](_0x87c77a)[_0x336c71(0xa0)]('hex');}function writeObject(_0x2f71a6,_0x5114d4){const _0x2ee8d4=sha256Hex(_0x5114d4),_0x3b7bc3=objectPath(_0x2f71a6,_0x2ee8d4);mkdirSync(dirname(_0x3b7bc3),{'recursive':!![]});if(!existsSync(_0x3b7bc3))writeFileSync(_0x3b7bc3,_0x5114d4);return _0x2ee8d4;}function readLog(_0x45d627,_0x9d8e9f,_0x42d671){const _0x3e89b0=_0x2afcb0,_0x219479=itemDir(_0x45d627,_0x9d8e9f,_0x42d671),_0x549d69=join(_0x219479,_0x3e89b0(0x9b)),_0x1d55b3=join(_0x219479,_0x3e89b0(0x6a)),_0x5e583a=existsSync(_0x549d69)?JSON[_0x3e89b0(0xa7)](readFileSync(_0x549d69,'utf8')):[],_0x29a9db=existsSync(_0x1d55b3)?readFileSync(_0x1d55b3,_0x3e89b0(0x98))['trim']():_0x5e583a['at'](-0x1)?.[_0x3e89b0(0x9f)]??null;return{'head':_0x29a9db,'items':_0x5e583a};}function writeLog(_0x58c994,_0x1ca090,_0x4cc90f,_0x4b387f,_0x36aff2){const _0x42f4bd=_0x2afcb0,_0x4997a9=itemDir(_0x58c994,_0x1ca090,_0x4cc90f);mkdirSync(_0x4997a9,{'recursive':!![]}),writeFileSync(join(_0x4997a9,'log.json'),JSON[_0x42f4bd(0x8b)](_0x36aff2,null,0x2),_0x42f4bd(0x98)),writeFileSync(join(_0x4997a9,'HEAD'),_0x4b387f+'\x0a',_0x42f4bd(0x98));}function findRev(_0x488417,_0xd37d23){const _0x46cf17=_0x2afcb0,_0x103cdb=join(_0x488417,_0x46cf17(0x85));if(!existsSync(_0x103cdb))return void 0x0;for(const _0x10e6bf of readdirSync(_0x103cdb,{'withFileTypes':!![]})){if(!_0x10e6bf[_0x46cf17(0x9c)]())continue;for(const _0xc8b69d of readdirSync(join(_0x103cdb,_0x10e6bf[_0x46cf17(0x86)]),{'withFileTypes':!![]})){if(!_0xc8b69d[_0x46cf17(0x9c)]())continue;const _0x338f52=readLog(_0x488417,_0x10e6bf[_0x46cf17(0x86)],_0xc8b69d[_0x46cf17(0x86)])['items'][_0x46cf17(0x69)](_0x198f9a=>_0x198f9a['rev']===_0xd37d23);if(_0x338f52)return _0x338f52;}}return void 0x0;}function filesTextOf(_0x421f83,_0x34994a){const _0x1dec85=_0x2afcb0,_0x70b37a={};for(const [_0x443395,_0x48de21]of Object[_0x1dec85(0xaa)](_0x34994a[_0x1dec85(0x6c)])){const _0x67c7d0=objectPath(_0x421f83,_0x48de21);if(existsSync(_0x67c7d0))_0x70b37a[_0x443395]=readFileSync(_0x67c7d0,_0x1dec85(0x98));}return _0x70b37a;}function createFsVersionStore(_0x3c67c0,_0x1d20c6){return mkdirSync(_0x3c67c0,{'recursive':!![]}),{async 'log'(_0x1d0f39,_0x9e729b){const _0x5dbeb5=_0x3778,{head:_0x3a9f22,items:_0x31ac55}=readLog(_0x3c67c0,_0x1d0f39,_0x9e729b);return{'head':_0x3a9f22,'items':[..._0x31ac55][_0x5dbeb5(0x72)]((_0xb2cfb8,_0x3b2f76)=>_0xb2cfb8['at']<_0x3b2f76['at']?0x1:-0x1)};},async 'get'(_0x3ed1ef){const _0x229cab=findRev(_0x3c67c0,_0x3ed1ef);if(!_0x229cab)throw new KtNotFoundError('rev\x20'+_0x3ed1ef);return _0x229cab;},async 'readFile'(_0x1ab92d,_0x48fdb6){const _0xb80d6d=await this['get'](_0x1ab92d),_0xebcef5=_0xb80d6d['files'][_0x48fdb6];if(!_0xebcef5)throw new KtNotFoundError(_0x48fdb6);const _0x2bb2ec=objectPath(_0x3c67c0,_0xebcef5);if(!existsSync(_0x2bb2ec))throw new KtNotFoundError(_0x48fdb6);return new Uint8Array(readFileSync(_0x2bb2ec));},async 'commit'(_0x30da1b){const _0x5136a2=_0x3778;let _0x2dac04=_0x30da1b['files'];if(!_0x2dac04){const _0x33f907=await _0x1d20c6[_0x5136a2(0x77)](_0x30da1b['id']);_0x2dac04=artifactToFiles(_0x33f907);}const _0x3ccc67={},_0x4aeb4f={};for(const [_0x352090,_0x5117f0]of Object[_0x5136a2(0xaa)](_0x2dac04)){const _0x469f27=typeof _0x5117f0==='string'?_0x5117f0:new TextDecoder()[_0x5136a2(0x7c)](_0x5117f0);_0x3ccc67[_0x352090]=_0x469f27,_0x4aeb4f[_0x352090]=writeObject(_0x3c67c0,typeof _0x5117f0==='string'?Buffer[_0x5136a2(0x94)](_0x5117f0,'utf8'):_0x5117f0);}const _0x1a2927=readLog(_0x3c67c0,_0x30da1b[_0x5136a2(0xa4)],_0x30da1b['id']);if(_0x1a2927[_0x5136a2(0xab)]){const _0xf40991=_0x1a2927[_0x5136a2(0x85)][_0x5136a2(0x69)](_0xb04601=>_0xb04601[_0x5136a2(0x9f)]===_0x1a2927['head']);if(_0xf40991&&filesEqual(_0x3ccc67,filesTextOf(_0x3c67c0,_0xf40991)))return _0xf40991;}const _0x539f08=new Date(),_0x256c3a=String(_0x539f08[_0x5136a2(0x90)]())[_0x5136a2(0x88)](0x2)+String(_0x539f08[_0x5136a2(0x8e)]()+0x1)[_0x5136a2(0xa2)](0x2,'0')+String(_0x539f08[_0x5136a2(0x79)]())[_0x5136a2(0xa2)](0x2,'0')+String(_0x539f08[_0x5136a2(0x6e)]())[_0x5136a2(0xa2)](0x2,'0')+String(_0x539f08[_0x5136a2(0xa6)]())[_0x5136a2(0xa2)](0x2,'0'),_0x16647d=sha256Hex(Object[_0x5136a2(0x92)](_0x4aeb4f)[_0x5136a2(0x72)]()[_0x5136a2(0x83)](','))[_0x5136a2(0x88)](0x0,0x8),_0x423405={'rev':_0x256c3a+_0x5136a2(0x6b)+_0x16647d,'kind':_0x30da1b['kind'],'id':_0x30da1b['id'],'at':_0x539f08[_0x5136a2(0x99)](),'parent':_0x1a2927[_0x5136a2(0xab)],'by':_0x30da1b['by'],'note':_0x30da1b[_0x5136a2(0xa5)],'files':_0x4aeb4f,'meta':_0x30da1b['meta']};return writeLog(_0x3c67c0,_0x30da1b[_0x5136a2(0xa4)],_0x30da1b['id'],_0x423405['rev'],[..._0x1a2927[_0x5136a2(0x85)],_0x423405]),_0x423405;},async 'restore'(_0x282058,_0x19c936,_0x39e744,_0x5106e5){const _0x635646=_0x3778,_0x13d130=await this[_0x635646(0x77)](_0x39e744),_0x35381f={};for(const _0xe8d823 of Object[_0x635646(0x9e)](_0x13d130['files'])){_0x35381f[_0xe8d823]=new TextDecoder()['decode'](await this[_0x635646(0x8f)](_0x39e744,_0xe8d823));}const _0xc3272=filesToArtifact(_0x35381f,_0x19c936);return await _0x1d20c6[_0x635646(0x96)]({..._0xc3272,'id':_0x19c936,'kind':_0xc3272[_0x635646(0xa4)],'etag':void 0x0}),this[_0x635646(0x9a)]({'kind':_0x282058,'id':_0x19c936,'files':_0x35381f,'by':_0x5106e5,'note':'\u6062\u590D\u81EA\x20'+_0x39e744});}};}function createKtFsStores(_0x1b1f03){const _0x2d3ca5=_0x2afcb0,_0x16076f=createFsArtifactStore(resolveRoot(_0x1b1f03[_0x2d3ca5(0x91)],_0x1b1f03[_0x2d3ca5(0x7a)]),_0x1b1f03[_0x2d3ca5(0xac)]),_0x4ebd7c=_0x1b1f03['instancesRoot']?createFsInstanceStore(resolveRoot(_0x1b1f03[_0x2d3ca5(0xa9)],_0x1b1f03[_0x2d3ca5(0x7a)]),_0x1b1f03[_0x2d3ca5(0x93)]):void 0x0,_0x23e75f=_0x1b1f03[_0x2d3ca5(0x6d)]?createFsVersionStore(resolveRoot(_0x1b1f03['versionsRoot'],_0x1b1f03[_0x2d3ca5(0x7a)]),_0x16076f):void 0x0;return{'artifacts':_0x16076f,'instances':_0x4ebd7c,'versions':_0x23e75f};}export{createKtFsStores};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const _0x1f6271=_0x1c30;(function(_0x264036,_0x857ea4){const _0x14281f=_0x1c30,_0x47382f=_0x264036();while(!![]){try{const _0x348813=-parseInt(_0x14281f(0xa3))/0x1*(-parseInt(_0x14281f(0x9c))/0x2)+parseInt(_0x14281f(0x97))/0x3+-parseInt(_0x14281f(0x83))/0x4+parseInt(_0x14281f(0x9f))/0x5*(-parseInt(_0x14281f(0x7f))/0x6)+-parseInt(_0x14281f(0xaa))/0x7*(-parseInt(_0x14281f(0xa0))/0x8)+-parseInt(_0x14281f(0x85))/0x9*(parseInt(_0x14281f(0x8c))/0xa)+parseInt(_0x14281f(0xab))/0xb*(parseInt(_0x14281f(0x94))/0xc);if(_0x348813===_0x857ea4)break;else _0x47382f['push'](_0x47382f['shift']());}catch(_0x4229ee){_0x47382f['push'](_0x47382f['shift']());}}}(_0x8ab0,0x8153b));var store=require('@k-table/report/store');async function pathParts(_0x31fc8d,_0x55b432){const _0x5cbe58=_0x1c30,_0x27ca76=_0x31fc8d['params']?await _0x31fc8d[_0x5cbe58(0x87)]:void 0x0;if(_0x27ca76?.[_0x5cbe58(0x86)]?.[_0x5cbe58(0x91)])return _0x27ca76[_0x5cbe58(0x86)];const _0x2fd974=_0x55b432[_0x5cbe58(0x7d)][_0x5cbe58(0x9a)](_0x5cbe58(0x8e)),_0x269cb2=_0x2fd974>=0x0?_0x55b432['pathname']['slice'](_0x2fd974+'/api/kt'[_0x5cbe58(0x91)]):_0x55b432[_0x5cbe58(0x7d)];return _0x269cb2[_0x5cbe58(0x7a)]('/')['filter'](Boolean);}function json(_0x407be3,_0x14bdb6=0xc8){const _0x2b9d73=_0x1c30;return new Response(JSON[_0x2b9d73(0xad)](_0x407be3),{'status':_0x14bdb6,'headers':{'content-type':'application/json;\x20charset=utf-8'}});}function _0x1c30(_0x460f50,_0x13908f){_0x460f50=_0x460f50-0x7a;const _0x8ab0ca=_0x8ab0();let _0x1c3010=_0x8ab0ca[_0x460f50];if(_0x1c30['hszCdq']===undefined){var _0x5d8754=function(_0x4c2d65){const _0x514bf4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x22ce3e='',_0x31fc8d='';for(let _0x55b432=0x0,_0x27ca76,_0x2fd974,_0x269cb2=0x0;_0x2fd974=_0x4c2d65['charAt'](_0x269cb2++);~_0x2fd974&&(_0x27ca76=_0x55b432%0x4?_0x27ca76*0x40+_0x2fd974:_0x2fd974,_0x55b432++%0x4)?_0x22ce3e+=String['fromCharCode'](0xff&_0x27ca76>>(-0x2*_0x55b432&0x6)):0x0){_0x2fd974=_0x514bf4['indexOf'](_0x2fd974);}for(let _0x407be3=0x0,_0x14bdb6=_0x22ce3e['length'];_0x407be3<_0x14bdb6;_0x407be3++){_0x31fc8d+='%'+('00'+_0x22ce3e['charCodeAt'](_0x407be3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x31fc8d);};_0x1c30['YnhOyc']=_0x5d8754,_0x1c30['GwnhtB']={},_0x1c30['hszCdq']=!![];}const _0x116b88=_0x8ab0ca[0x0];_0x1c30['ZCYivB']!==_0x116b88&&(_0x1c30['GwnhtB']={},_0x1c30['ZCYivB']=_0x116b88);const _0x285d08=_0x1c30['GwnhtB'][_0x460f50];return _0x285d08===undefined?(_0x1c3010=_0x1c30['YnhOyc'](_0x1c3010),_0x1c30['GwnhtB'][_0x460f50]=_0x1c3010):_0x1c3010=_0x285d08,_0x1c3010;}function fail(_0x3ff954){const _0x240980=_0x1c30;if(_0x3ff954 instanceof store[_0x240980(0x7c)])return json({'message':_0x3ff954['message'],'current':_0x3ff954['current']},0x199);if(_0x3ff954 instanceof store['KtNotFoundError'])return json({'message':_0x3ff954['message']},0x194);if(_0x3ff954 instanceof store[_0x240980(0x8d)])return json({'message':_0x3ff954[_0x240980(0xa1)]},_0x3ff954['status']??0x1f4);return json({'message':_0x3ff954 instanceof Error?_0x3ff954[_0x240980(0xa1)]:'\u5185\u90E8\u9519\u8BEF'},0x1f4);}async function readBody(_0x2a92c){const _0x2874fe=_0x1c30,_0x4103be=await _0x2a92c[_0x2874fe(0x81)]();if(!_0x4103be)return null;return JSON['parse'](_0x4103be);}function createKtHandler(_0x135c0a){const _0x4c2610=async(_0x4cd37f,_0xc231f5={})=>{const _0x3e42ba=_0x1c30;try{const _0x28fe46=new URL(_0x4cd37f[_0x3e42ba(0x8a)]),_0x5738ed=await pathParts(_0xc231f5,_0x28fe46),[_0x3db766,_0x8fb148,_0x3164ff]=_0x5738ed,_0x103d81=_0x4cd37f[_0x3e42ba(0xa9)][_0x3e42ba(0xa4)]();if(_0x3db766===_0x3e42ba(0x96)&&!_0x8fb148&&_0x103d81===_0x3e42ba(0x9d)){const _0x3da354=_0x28fe46[_0x3e42ba(0xa8)][_0x3e42ba(0x88)]('kind');return json({'items':await _0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0x93)](_0x3da354||void 0x0)});}if(_0x3db766===_0x3e42ba(0x96)&&!_0x8fb148&&_0x103d81==='POST'){if(!_0x135c0a['artifacts']['create'])return json({'message':_0x3e42ba(0xa6)},0x194);return json(await _0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0x8b)](await readBody(_0x4cd37f)));}if(_0x3db766===_0x3e42ba(0x96)&&_0x8fb148&&_0x103d81===_0x3e42ba(0x9d))return json(await _0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0x88)](_0x8fb148));if(_0x3db766==='artifacts'&&_0x8fb148&&_0x103d81===_0x3e42ba(0x84))return json(await _0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0xa7)](await readBody(_0x4cd37f)));if(_0x3db766===_0x3e42ba(0x96)&&_0x8fb148&&_0x103d81==='DELETE'){if(!_0x135c0a[_0x3e42ba(0x96)][_0x3e42ba(0x92)])return json({'message':_0x3e42ba(0x9e)},0x194);return await _0x135c0a[_0x3e42ba(0x96)]['remove'](_0x8fb148),json({'ok':!![]});}if(_0x3db766==='instances'){if(!_0x135c0a['instances'])return json({'message':_0x3e42ba(0x80)},0x194);if(!_0x8fb148&&_0x103d81===_0x3e42ba(0x9d))return json({'items':await _0x135c0a[_0x3e42ba(0x89)][_0x3e42ba(0x93)]?.(_0x28fe46[_0x3e42ba(0xa8)]['get']('artifactId')??void 0x0)??[]});if(!_0x8fb148&&_0x103d81===_0x3e42ba(0x8f)){if(!_0x135c0a['instances'][_0x3e42ba(0x8b)])return json({'message':_0x3e42ba(0xa6)},0x194);return json(await _0x135c0a['instances']['create'](await readBody(_0x4cd37f)));}if(_0x8fb148&&_0x103d81===_0x3e42ba(0x9d))return json(await _0x135c0a[_0x3e42ba(0x89)][_0x3e42ba(0x88)](_0x8fb148));if(_0x8fb148&&_0x103d81===_0x3e42ba(0x84))return await _0x135c0a[_0x3e42ba(0x89)][_0x3e42ba(0xa7)](_0x8fb148,await readBody(_0x4cd37f)),json({'ok':!![]});}if(_0x3db766===_0x3e42ba(0x82)){if(!_0x135c0a['versions'])return json({'message':_0x3e42ba(0x90)},0x194);if(!_0x8fb148&&_0x103d81==='GET'){const _0x1cb7f0=_0x28fe46[_0x3e42ba(0xa8)]['get']('kind')??'',_0x27858a=_0x28fe46[_0x3e42ba(0xa8)][_0x3e42ba(0x88)]('id')??'';return json(await _0x135c0a[_0x3e42ba(0x82)][_0x3e42ba(0x7e)](_0x1cb7f0,_0x27858a));}if(!_0x8fb148&&_0x103d81===_0x3e42ba(0x8f))return json(await _0x135c0a[_0x3e42ba(0x82)]['commit'](await readBody(_0x4cd37f)));if(_0x8fb148&&_0x3164ff===_0x3e42ba(0x7b)&&_0x103d81===_0x3e42ba(0x9d)){const _0x154532=await _0x135c0a[_0x3e42ba(0x82)][_0x3e42ba(0xac)](_0x8fb148,_0x28fe46[_0x3e42ba(0xa8)]['get']('path')??'');return new Response(Buffer[_0x3e42ba(0x98)](_0x154532),{'headers':{'content-type':_0x3e42ba(0x9b)}});}if(_0x8fb148&&_0x3164ff===_0x3e42ba(0x99)&&_0x103d81===_0x3e42ba(0x8f)){const _0x1bed3b=await readBody(_0x4cd37f);return json(await _0x135c0a[_0x3e42ba(0x82)]['restore'](_0x1bed3b['kind'],_0x1bed3b['id'],_0x8fb148,_0x1bed3b['by']));}if(_0x8fb148&&!_0x3164ff&&_0x103d81===_0x3e42ba(0x9d))return json(await _0x135c0a[_0x3e42ba(0x82)][_0x3e42ba(0x88)](_0x8fb148));}return json({'message':_0x3e42ba(0xa5)},0x194);}catch(_0x28cd76){return fail(_0x28cd76);}};return{'GET':_0x4c2610,'POST':_0x4c2610,'PUT':_0x4c2610,'DELETE':_0x4c2610};}function defineKtConfig(_0x1ddc97){return _0x1ddc97;}exports[_0x1f6271(0xa2)]=createKtHandler,exports[_0x1f6271(0x95)]=defineKtConfig;function _0x8ab0(){const _0x38028a=['mtC0nZmWmfzptujrDW','ufvu','mtHgv0DIDMu','Cgf0Aa','CgfYyw1Z','z2v0','Aw5ZDgfUy2vZ','DxjS','y3jLyxrL','mZq3mZaYme9eAeDRDW','s3rtDg9YzuvYCM9Y','l2fWAs9RDa','ue9tva','DMvYC2LVBNmG5PYQ6ywn572U','BgvUz3rO','CMvTB3zL','BgLZDa','mtK5mJCYBuTkBM1I','zgvMAw5Ls3rdB25MAwC','yxj0AwzHy3rZ','mtG1mda0m1PTD2nPvG','zNjVBq','CMvZDg9Yzq','Aw5KzxHpzG','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','mJe3nZzSv2fPBxa','r0vu','CMvTB3zLioACQUwUNUEoSa','ntq5mZvjsxfbDfi','mtzMwuHpBe4','BwvZC2fNzq','y3jLyxrLs3riyw5KBgvY','odrAs3PYvvK','Dg9vChbLCKnHC2u','5PYQ5OM+5yIW','y3jLyxrLioACQUwUNUEoSa','C2f2zq','C2vHCMnOugfYyw1Z','Bwv0Ag9K','mJCZnte1mKDRwvzWAG','mtG3wKPmEwrg','CMvHzezPBgu','C3rYAw5NAwz5','C3bSAxq','zMLSzq','s3rdB25MBgLJDevYCM9Y','Cgf0Ag5HBwu','Bg9N','nteWDuzrDNzq','Aw5ZDgfUy2vZioACQUMfJEE9RG','Dgv4Da','DMvYC2LVBNm'];_0x8ab0=function(){return _0x38028a;};return _0x8ab0();}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4819dd,_0xf83285){const _0x38f013=_0x2e57,_0x58d205=_0x4819dd();while(!![]){try{const _0x1c2ab0=parseInt(_0x38f013(0xa1))/0x1+parseInt(_0x38f013(0x79))/0x2*(parseInt(_0x38f013(0x80))/0x3)+parseInt(_0x38f013(0x8f))/0x4+parseInt(_0x38f013(0x9f))/0x5*(-parseInt(_0x38f013(0x97))/0x6)+parseInt(_0x38f013(0x8d))/0x7*(-parseInt(_0x38f013(0x89))/0x8)+parseInt(_0x38f013(0x8e))/0x9+-parseInt(_0x38f013(0x94))/0xa;if(_0x1c2ab0===_0xf83285)break;else _0x58d205['push'](_0x58d205['shift']());}catch(_0x348723){_0x58d205['push'](_0x58d205['shift']());}}}(_0x3d38,0x81960));import{KtConflictError,KtNotFoundError,KtStoreError}from'@k-table/report/store';async function pathParts(_0x52297d,_0x3b7e60){const _0x4b956a=_0x2e57,_0x87fa3f=_0x52297d[_0x4b956a(0x95)]?await _0x52297d[_0x4b956a(0x95)]:void 0x0;if(_0x87fa3f?.[_0x4b956a(0x96)]?.[_0x4b956a(0x7f)])return _0x87fa3f[_0x4b956a(0x96)];const _0x56b64a=_0x3b7e60['pathname'][_0x4b956a(0x82)](_0x4b956a(0x74)),_0x217a40=_0x56b64a>=0x0?_0x3b7e60[_0x4b956a(0x7a)][_0x4b956a(0x7d)](_0x56b64a+_0x4b956a(0x74)[_0x4b956a(0x7f)]):_0x3b7e60['pathname'];return _0x217a40[_0x4b956a(0x75)]('/')[_0x4b956a(0x84)](Boolean);}function json(_0xe7ade9,_0x34f371=0xc8){const _0x29f651=_0x2e57;return new Response(JSON[_0x29f651(0x81)](_0xe7ade9),{'status':_0x34f371,'headers':{'content-type':'application/json;\x20charset=utf-8'}});}function fail(_0x549539){const _0x56f04f=_0x2e57;if(_0x549539 instanceof KtConflictError)return json({'message':_0x549539[_0x56f04f(0x99)],'current':_0x549539[_0x56f04f(0x72)]},0x199);if(_0x549539 instanceof KtNotFoundError)return json({'message':_0x549539[_0x56f04f(0x99)]},0x194);if(_0x549539 instanceof KtStoreError)return json({'message':_0x549539[_0x56f04f(0x99)]},_0x549539[_0x56f04f(0x7e)]??0x1f4);return json({'message':_0x549539 instanceof Error?_0x549539[_0x56f04f(0x99)]:'\u5185\u90E8\u9519\u8BEF'},0x1f4);}async function readBody(_0x235156){const _0x1a8abb=_0x2e57,_0x19130a=await _0x235156[_0x1a8abb(0x8a)]();if(!_0x19130a)return null;return JSON[_0x1a8abb(0x87)](_0x19130a);}function createKtHandler(_0x543606){const _0x419a2b=async(_0x2624ff,_0x442d31={})=>{const _0x4e183a=_0x2e57;try{const _0x414487=new URL(_0x2624ff[_0x4e183a(0x88)]),_0x494b2c=await pathParts(_0x442d31,_0x414487),[_0x1fde77,_0x180715,_0x1e3894]=_0x494b2c,_0x205d58=_0x2624ff[_0x4e183a(0x90)][_0x4e183a(0x92)]();if(_0x1fde77===_0x4e183a(0x78)&&!_0x180715&&_0x205d58==='GET'){const _0x16b997=_0x414487['searchParams']['get'](_0x4e183a(0x9d));return json({'items':await _0x543606[_0x4e183a(0x78)][_0x4e183a(0x85)](_0x16b997||void 0x0)});}if(_0x1fde77===_0x4e183a(0x78)&&!_0x180715&&_0x205d58==='POST'){if(!_0x543606[_0x4e183a(0x78)]['create'])return json({'message':'create\x20\u672A\u5B9E\u73B0'},0x194);return json(await _0x543606[_0x4e183a(0x78)][_0x4e183a(0x71)](await readBody(_0x2624ff)));}if(_0x1fde77==='artifacts'&&_0x180715&&_0x205d58==='GET')return json(await _0x543606[_0x4e183a(0x78)][_0x4e183a(0x93)](_0x180715));if(_0x1fde77===_0x4e183a(0x78)&&_0x180715&&_0x205d58==='PUT')return json(await _0x543606[_0x4e183a(0x78)]['save'](await readBody(_0x2624ff)));if(_0x1fde77===_0x4e183a(0x78)&&_0x180715&&_0x205d58===_0x4e183a(0x83)){if(!_0x543606['artifacts']['remove'])return json({'message':'remove\x20\u672A\u5B9E\u73B0'},0x194);return await _0x543606[_0x4e183a(0x78)][_0x4e183a(0x7b)](_0x180715),json({'ok':!![]});}if(_0x1fde77==='instances'){if(!_0x543606[_0x4e183a(0xa0)])return json({'message':_0x4e183a(0x91)},0x194);if(!_0x180715&&_0x205d58===_0x4e183a(0x70))return json({'items':await _0x543606[_0x4e183a(0xa0)]['list']?.(_0x414487[_0x4e183a(0x8b)][_0x4e183a(0x93)]('artifactId')??void 0x0)??[]});if(!_0x180715&&_0x205d58===_0x4e183a(0x9e)){if(!_0x543606[_0x4e183a(0xa0)][_0x4e183a(0x71)])return json({'message':_0x4e183a(0xa2)},0x194);return json(await _0x543606['instances']['create'](await readBody(_0x2624ff)));}if(_0x180715&&_0x205d58===_0x4e183a(0x70))return json(await _0x543606['instances']['get'](_0x180715));if(_0x180715&&_0x205d58===_0x4e183a(0x86))return await _0x543606[_0x4e183a(0xa0)][_0x4e183a(0x73)](_0x180715,await readBody(_0x2624ff)),json({'ok':!![]});}if(_0x1fde77===_0x4e183a(0x98)){if(!_0x543606[_0x4e183a(0x98)])return json({'message':_0x4e183a(0x76)},0x194);if(!_0x180715&&_0x205d58===_0x4e183a(0x70)){const _0x4a68b2=_0x414487['searchParams'][_0x4e183a(0x93)](_0x4e183a(0x9d))??'',_0x1f5e3f=_0x414487[_0x4e183a(0x8b)][_0x4e183a(0x93)]('id')??'';return json(await _0x543606['versions'][_0x4e183a(0x9b)](_0x4a68b2,_0x1f5e3f));}if(!_0x180715&&_0x205d58==='POST')return json(await _0x543606[_0x4e183a(0x98)][_0x4e183a(0x7c)](await readBody(_0x2624ff)));if(_0x180715&&_0x1e3894==='file'&&_0x205d58===_0x4e183a(0x70)){const _0x4d9ee6=await _0x543606[_0x4e183a(0x98)][_0x4e183a(0x9a)](_0x180715,_0x414487[_0x4e183a(0x8b)][_0x4e183a(0x93)](_0x4e183a(0x96))??'');return new Response(Buffer['from'](_0x4d9ee6),{'headers':{'content-type':_0x4e183a(0x8c)}});}if(_0x180715&&_0x1e3894===_0x4e183a(0x77)&&_0x205d58==='POST'){const _0x15e234=await readBody(_0x2624ff);return json(await _0x543606[_0x4e183a(0x98)]['restore'](_0x15e234[_0x4e183a(0x9d)],_0x15e234['id'],_0x180715,_0x15e234['by']));}if(_0x180715&&!_0x1e3894&&_0x205d58==='GET')return json(await _0x543606[_0x4e183a(0x98)]['get'](_0x180715));}return json({'message':_0x4e183a(0x9c)},0x194);}catch(_0x2bfa57){return fail(_0x2bfa57);}};return{'GET':_0x419a2b,'POST':_0x419a2b,'PUT':_0x419a2b,'DELETE':_0x419a2b};}function _0x2e57(_0x242f3e,_0x2c03ec){_0x242f3e=_0x242f3e-0x70;const _0x3d38b7=_0x3d38();let _0x2e57a3=_0x3d38b7[_0x242f3e];if(_0x2e57['SeqjQX']===undefined){var _0xfd3a71=function(_0x420b0d){const _0x39211b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x535006='',_0x52297d='';for(let _0x3b7e60=0x0,_0x87fa3f,_0x56b64a,_0x217a40=0x0;_0x56b64a=_0x420b0d['charAt'](_0x217a40++);~_0x56b64a&&(_0x87fa3f=_0x3b7e60%0x4?_0x87fa3f*0x40+_0x56b64a:_0x56b64a,_0x3b7e60++%0x4)?_0x535006+=String['fromCharCode'](0xff&_0x87fa3f>>(-0x2*_0x3b7e60&0x6)):0x0){_0x56b64a=_0x39211b['indexOf'](_0x56b64a);}for(let _0xe7ade9=0x0,_0x34f371=_0x535006['length'];_0xe7ade9<_0x34f371;_0xe7ade9++){_0x52297d+='%'+('00'+_0x535006['charCodeAt'](_0xe7ade9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x52297d);};_0x2e57['PiKGEs']=_0xfd3a71,_0x2e57['uUCnWk']={},_0x2e57['SeqjQX']=!![];}const _0x21d26f=_0x3d38b7[0x0];_0x2e57['iOhqMD']!==_0x21d26f&&(_0x2e57['uUCnWk']={},_0x2e57['iOhqMD']=_0x21d26f);const _0x12f36c=_0x2e57['uUCnWk'][_0x242f3e];return _0x12f36c===undefined?(_0x2e57a3=_0x2e57['PiKGEs'](_0x2e57a3),_0x2e57['uUCnWk'][_0x242f3e]=_0x2e57a3):_0x2e57a3=_0x12f36c,_0x2e57a3;}function defineKtConfig(_0x13a38a){return _0x13a38a;}function _0x3d38(){const _0x4d7aed=['y3jLyxrLioACQUwUNUEoSa','r0vu','y3jLyxrL','y3vYCMvUDa','C2f2zq','l2fWAs9RDa','C3bSAxq','DMvYC2LVBNmG5PYQ6ywn572U','CMvZDg9Yzq','yxj0AwzHy3rZ','nJC0rLfTr1zH','Cgf0Ag5HBwu','CMvTB3zL','y29TBwL0','C2XPy2u','C3rHDhvZ','BgvUz3rO','mtu5tgLcyujb','C3rYAw5NAwz5','Aw5KzxHpzG','revmrvrf','zMLSDgvY','BgLZDa','ufvu','CgfYC2u','DxjS','nZeYCeDkCNfb','Dgv4Da','C2vHCMnOugfYyw1Z','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','ntiWmZfezxjhBfe','ody0mJq2nMPfAgLpDW','mJu1otuZnK1jAfzKAW','Bwv0Ag9K','Aw5ZDgfUy2vZioACQUMfJEE9RG','Dg9vChbLCKnHC2u','z2v0','mteYmJq0mgfzEwLgAq','CgfYyw1Z','Cgf0Aa','mZG0mJK0AM5sBK1e','DMvYC2LVBNm','BwvZC2fNzq','CMvHzezPBgu','Bg9N','5PYQ5OM+5yIW','A2LUza','ue9tva','mJviqM5pwLK','Aw5ZDgfUy2vZ','nJC5mvDQrfz0ra'];_0x3d38=function(){return _0x4d7aed;};return _0x3d38();}export{createKtHandler,defineKtConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k-table/next",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"publishConfig": { "access": "public" },
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"description": "KT Next 适配:/api/kt 默认 handler 与 fs 存储(无鉴权)",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"test": "vitest run"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@k-table/report": "^1.0.
|
|
30
|
+
"@k-table/report": "^1.0.13"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"next": ">=15"
|