@treasuredata/tdx 0.1.16 → 0.1.18
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/README.md +10 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-client.js +1 -1
- package/dist/client/trino-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.d.ts +20 -2
- package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/anthropic-adapter.js.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/server.js.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/database.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/table.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
package/dist/sdk/segment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a49_0x100cb7=a49_0x3020;(function(_0x401043,_0x31dd16){const _0x5f4093=a49_0x3020,_0x550a03=_0x401043();while(!![]){try{const _0x246236=-parseInt(_0x5f4093(0x133))/0x1*(-parseInt(_0x5f4093(0x14b))/0x2)+-parseInt(_0x5f4093(0x17a))/0x3*(-parseInt(_0x5f4093(0x150))/0x4)+-parseInt(_0x5f4093(0x176))/0x5*(parseInt(_0x5f4093(0x173))/0x6)+-parseInt(_0x5f4093(0x16d))/0x7+-parseInt(_0x5f4093(0x15b))/0x8+-parseInt(_0x5f4093(0x136))/0x9*(-parseInt(_0x5f4093(0x167))/0xa)+parseInt(_0x5f4093(0x180))/0xb;if(_0x246236===_0x31dd16)break;else _0x550a03['push'](_0x550a03['shift']());}catch(_0x240883){_0x550a03['push'](_0x550a03['shift']());}}}(a49_0x4363,0x99bc9));function a49_0x3020(_0x409e4b,_0x36e5b5){const _0x4363aa=a49_0x4363();return a49_0x3020=function(_0x3020fd,_0x121672){_0x3020fd=_0x3020fd-0x131;let _0x406216=_0x4363aa[_0x3020fd];return _0x406216;},a49_0x3020(_0x409e4b,_0x36e5b5);}function a49_0x4363(){const _0xd163ff=['listSegmentFolders','rootFolderId','segments','listFields',')\x20exceeded','updateParent','\x27\x20not\x20found\x20in\x20','description','updateSegmentById','662260USirGr','type','listParentSegments','createSegmentFolder','listRecursive','getParentFull','6544713eOvWyV','createParentSegment','join','resolveParentId','client','push','121848QtUcYr','find','isAbsolute','290kxTKDj','listActivations','NOT_FOUND','resolveParentIdOrName','280863lihaGk','resolveSegmentId','detectResourceType','listFolders','Child\x20segment\x20not\x20found:\x20','parentFolderId','9679758AuhVGo','Segment\x20\x27','parentTableName','getSegmentFolder','Resource\x20\x27','getSegmentSQL','some','listSegments','schema','updateParentSegment','length','getSegment','2oTlqrr','behaviors','Folder\x20not\x20found:\x20','99RHLIOV','listUnified','filter','Folder\x20\x27','\x27\x20not\x20found\x20in\x20path','detectResourceTypeInFolder','getParentSegmentFull','name','traversePath','catch','resolveFolderId','\x27\x20not\x20found','parent\x20segment','isArray','all','ambiguous','createSegment','test','updateSegment','INVALID_ARGUMENT','createdAt','301998ECflrT','getFolder','segmentFolderId','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','behavior','44PpgQFH','updatedAt','parentDatabaseName','parentColumn','getParentSegmentSQL','Maximum\x20recursion\x20depth\x20(','getParentSegment','segment','attributes','folder','attribute','1582120RpEjaV','then','createFolder'];a49_0x4363=function(){return _0xd163ff;};return a49_0x4363();}import{SDKError,ErrorCode}from'./errors.js';export class SegmentAPI{[a49_0x100cb7(0x171)];constructor(_0x34c6e9){const _0x91fef1=a49_0x100cb7;this[_0x91fef1(0x171)]=_0x34c6e9;}async['listParents'](){const _0x855a36=a49_0x100cb7;return await this[_0x855a36(0x171)][_0x855a36(0x169)]();}async['getParent'](_0x3fe5e5){const _0x286f33=a49_0x100cb7;return await this['client'][_0x286f33(0x156)](_0x3fe5e5);}async['listSegments'](_0x52bc17){const _0x144805=a49_0x100cb7;return await this[_0x144805(0x171)]['listSegments'](_0x52bc17);}async['getSegment'](_0x5850e7,_0x1f00ea){const _0x5de584=a49_0x100cb7;return await this[_0x5de584(0x171)][_0x5de584(0x132)](_0x5850e7,_0x1f00ea);}async[a49_0x100cb7(0x17d)](_0x131b04){const _0xe66439=a49_0x100cb7;return await this['client'][_0xe66439(0x15e)](_0x131b04);}async[a49_0x100cb7(0x14c)](_0x41579a){const _0x2e3b3f=a49_0x100cb7;return await this['client'][_0x2e3b3f(0x183)](_0x41579a);}async[a49_0x100cb7(0x177)](_0xdb2782,_0x2b7908){const _0x635154=a49_0x100cb7;return await this[_0x635154(0x171)][_0x635154(0x177)](_0xdb2782,_0x2b7908);}async['getParentSQL'](_0x6e734){const _0x130a6b=a49_0x100cb7;return await this['client'][_0x130a6b(0x154)](_0x6e734);}async[a49_0x100cb7(0x185)](_0x3a676e,_0x4629be){const _0x1c772a=a49_0x100cb7;return await this[_0x1c772a(0x171)]['getSegmentSQL'](_0x3a676e,_0x4629be);}async[a49_0x100cb7(0x170)](_0x5502cf){const _0x2840fd=a49_0x100cb7,_0x33ac77=await this['listParents'](),_0x1af58d=_0x33ac77[_0x2840fd(0x174)](_0x31bd=>_0x31bd[_0x2840fd(0x158)]['name']===_0x5502cf);if(!_0x1af58d)throw new SDKError(ErrorCode[_0x2840fd(0x178)],'Parent\x20segment\x20not\x20found:\x20'+_0x5502cf);return _0x1af58d['id'];}async['resolveSegmentId'](_0x3ddb47,_0x264d85){const _0x827cb0=a49_0x100cb7,_0x1f2b8d=await this[_0x827cb0(0x187)](_0x3ddb47),_0x1a883c=_0x1f2b8d[_0x827cb0(0x174)](_0x3f3e03=>_0x3f3e03[_0x827cb0(0x13d)]===_0x264d85);if(!_0x1a883c)throw new SDKError(ErrorCode['NOT_FOUND'],_0x827cb0(0x17e)+_0x264d85+'\x20in\x20parent\x20'+_0x3ddb47);return _0x1a883c['id'];}async['resolveFolderId'](_0x4914c6,_0x21605c){const _0x135d40=a49_0x100cb7,_0x451b63=await this[_0x135d40(0x17d)](_0x4914c6),_0x47f812=_0x451b63[_0x135d40(0x174)](_0x1ad7b5=>_0x1ad7b5['name']===_0x21605c);if(!_0x47f812)throw new SDKError(ErrorCode[_0x135d40(0x178)],_0x135d40(0x135)+_0x21605c+'\x20in\x20parent\x20'+_0x4914c6);return _0x47f812['id'];}async[a49_0x100cb7(0x161)](_0x2d8602){const _0x4b299a=a49_0x100cb7,_0x50dea5=await this[_0x4b299a(0x179)](_0x2d8602),_0x21e932=await this[_0x4b299a(0x171)][_0x4b299a(0x13c)](_0x50dea5),_0x41cc8b=[];if(_0x21e932['attributes']&&Array['isArray'](_0x21e932[_0x4b299a(0x158)]))for(const _0x5754ee of _0x21e932['attributes']){const _0x1c1c99=_0x5754ee;_0x1c1c99['name']&&_0x1c1c99['type']&&_0x41cc8b[_0x4b299a(0x172)]({'name':_0x1c1c99[_0x4b299a(0x13d)],'type':_0x1c1c99[_0x4b299a(0x168)],'source':_0x4b299a(0x15a),'parentDatabaseName':_0x1c1c99[_0x4b299a(0x152)],'parentTableName':_0x1c1c99[_0x4b299a(0x182)],'parentColumn':_0x1c1c99[_0x4b299a(0x153)]});}if(_0x21e932[_0x4b299a(0x134)]&&Array[_0x4b299a(0x143)](_0x21e932['behaviors']))for(const _0x4b0a14 of _0x21e932[_0x4b299a(0x134)]){const _0x53ef33=_0x4b0a14,_0x35ad09=_0x53ef33[_0x4b299a(0x13d)];if(_0x35ad09&&_0x53ef33[_0x4b299a(0x188)]&&Array['isArray'](_0x53ef33['schema']))for(const _0x263e4a of _0x53ef33[_0x4b299a(0x188)]){_0x263e4a[_0x4b299a(0x13d)]&&_0x263e4a[_0x4b299a(0x168)]&&_0x41cc8b[_0x4b299a(0x172)]({'name':_0x35ad09+'.'+_0x263e4a[_0x4b299a(0x13d)],'type':_0x263e4a['type'],'source':_0x4b299a(0x14f),'behaviorName':_0x35ad09,'parentDatabaseName':_0x53ef33[_0x4b299a(0x152)],'parentTableName':_0x53ef33['parentTableName'],'parentColumn':_0x263e4a[_0x4b299a(0x153)]});}}return _0x41cc8b;}async['createParent'](_0x29a8fb){const _0xbea210=a49_0x100cb7;return await this[_0xbea210(0x171)][_0xbea210(0x16e)](_0x29a8fb);}async[a49_0x100cb7(0x163)](_0x527318,_0x5984d2){const _0x4de4ac=a49_0x100cb7,_0x3b57a9=await this[_0x4de4ac(0x179)](_0x527318);return await this[_0x4de4ac(0x171)][_0x4de4ac(0x189)](_0x3b57a9,_0x5984d2);}async[a49_0x100cb7(0x16c)](_0x364a5e){const _0x372dc5=a49_0x100cb7,_0x113b50=await this[_0x372dc5(0x179)](_0x364a5e);return await this[_0x372dc5(0x171)][_0x372dc5(0x13c)](_0x113b50);}async[a49_0x100cb7(0x146)](_0x21117d,_0x491db9){const _0x3be43f=a49_0x100cb7;return await this[_0x3be43f(0x171)][_0x3be43f(0x146)](_0x21117d,_0x491db9);}async[a49_0x100cb7(0x166)](_0x2564a4,_0x318291,_0x198356){const _0x3a3457=a49_0x100cb7;return await this[_0x3a3457(0x171)][_0x3a3457(0x148)](_0x2564a4,_0x318291,_0x198356);}async[a49_0x100cb7(0x15d)](_0x298500,_0x4bbb46){const _0x2f3fcf=a49_0x100cb7,_0x3799e5=await this[_0x2f3fcf(0x179)](_0x298500);return await this['client'][_0x2f3fcf(0x16a)](_0x3799e5,_0x4bbb46);}async[a49_0x100cb7(0x179)](_0x28fba3){const _0xa8a59=a49_0x100cb7;if(/^\d+$/[_0xa8a59(0x147)](_0x28fba3))return _0x28fba3;return await this[_0xa8a59(0x170)](_0x28fba3);}async[a49_0x100cb7(0x17c)](_0x423c7f,_0x54ba98){const _0x29050d=a49_0x100cb7,[_0x2836fa,_0x5c00cb]=await Promise['all']([this[_0x29050d(0x140)](_0x423c7f,_0x54ba98)['then'](()=>!![])[_0x29050d(0x13f)](()=>![]),this[_0x29050d(0x17b)](_0x423c7f,_0x54ba98)[_0x29050d(0x15c)](()=>!![])[_0x29050d(0x13f)](()=>![])]);if(_0x2836fa&&_0x5c00cb)return _0x29050d(0x145);else{if(_0x2836fa)return _0x29050d(0x159);else{if(_0x5c00cb)return _0x29050d(0x157);}}throw new SDKError(ErrorCode['NOT_FOUND'],'Resource\x20\x27'+_0x54ba98+'\x27\x20not\x20found\x20in\x20parent\x20segment');}async[a49_0x100cb7(0x13b)](_0x492865,_0x28cb2d,_0x1c8a23){const _0x75bc19=a49_0x100cb7,[_0x12eb82,_0x290bb4]=await Promise[_0x75bc19(0x144)]([this[_0x75bc19(0x17d)](_0x492865),this[_0x75bc19(0x187)](_0x492865)]),_0x53340d=_0x1c8a23?_0x12eb82[_0x75bc19(0x138)](_0x3751bd=>_0x3751bd[_0x75bc19(0x17f)]===_0x1c8a23):_0x12eb82[_0x75bc19(0x138)](_0x2ec6ce=>!_0x2ec6ce[_0x75bc19(0x17f)]),_0x458f91=_0x1c8a23?_0x290bb4[_0x75bc19(0x138)](_0x5c9a65=>_0x5c9a65['segmentFolderId']===_0x1c8a23):_0x290bb4[_0x75bc19(0x138)](_0x503f68=>!_0x503f68[_0x75bc19(0x14d)]),_0x7e22ac=_0x53340d[_0x75bc19(0x186)](_0x5a4b57=>_0x5a4b57['name']===_0x28cb2d),_0x3d80f4=_0x458f91['some'](_0x276239=>_0x276239[_0x75bc19(0x13d)]===_0x28cb2d);if(_0x7e22ac&&_0x3d80f4)return'ambiguous';else{if(_0x7e22ac)return _0x75bc19(0x159);else{if(_0x3d80f4)return _0x75bc19(0x157);}}throw new SDKError(ErrorCode[_0x75bc19(0x178)],_0x75bc19(0x184)+_0x28cb2d+_0x75bc19(0x164)+(_0x1c8a23?'folder':_0x75bc19(0x142)));}async['traversePath'](_0x45fa41){const _0x379f2d=a49_0x100cb7;if(_0x45fa41[_0x379f2d(0x131)]===0x0)throw new SDKError(ErrorCode[_0x379f2d(0x149)],'Path\x20cannot\x20be\x20empty');const _0x507a65=_0x45fa41[0x0],_0x165641=await this[_0x379f2d(0x170)](_0x507a65);if(_0x45fa41[_0x379f2d(0x131)]===0x1)return{'parentId':_0x165641,'parentName':_0x507a65,'type':'parent','fullPath':_0x507a65};const _0x568bb7=await this['getParentFull'](_0x165641),_0x20ab26=_0x568bb7['rootFolderId'],_0x6d1eb1=[];let _0x1dbaa5=_0x20ab26;for(let _0x4e1b2d=0x1;_0x4e1b2d<_0x45fa41[_0x379f2d(0x131)]-0x1;_0x4e1b2d++){const _0x55e728=_0x45fa41[_0x4e1b2d],_0x298342=await this['listFolders'](_0x165641),_0x315a69=_0x1dbaa5?_0x298342[_0x379f2d(0x174)](_0x5576a6=>_0x5576a6[_0x379f2d(0x13d)]===_0x55e728&&_0x5576a6[_0x379f2d(0x17f)]===_0x1dbaa5):_0x298342['find'](_0x2c43c2=>_0x2c43c2[_0x379f2d(0x13d)]===_0x55e728&&!_0x2c43c2[_0x379f2d(0x17f)]);if(!_0x315a69)throw new SDKError(ErrorCode[_0x379f2d(0x178)],_0x379f2d(0x139)+_0x55e728+_0x379f2d(0x13a));_0x6d1eb1[_0x379f2d(0x172)](_0x55e728),_0x1dbaa5=_0x315a69['id'];}const _0x1b46f1=_0x45fa41[_0x45fa41[_0x379f2d(0x131)]-0x1],_0x37b4a2=await this['detectResourceTypeInFolder'](_0x165641,_0x1b46f1,_0x1dbaa5);if(_0x37b4a2===_0x379f2d(0x145))return{'parentId':_0x165641,'parentName':_0x507a65,'folderId':_0x1dbaa5,'folderPath':_0x6d1eb1[_0x379f2d(0x131)]>0x0?_0x6d1eb1:undefined,'type':'folder','fullPath':_0x45fa41['join']('/')};else{if(_0x37b4a2===_0x379f2d(0x159)){const _0x173775=await this[_0x379f2d(0x17d)](_0x165641),_0xf960b8=_0x1dbaa5?_0x173775[_0x379f2d(0x174)](_0x18ac07=>_0x18ac07[_0x379f2d(0x13d)]===_0x1b46f1&&_0x18ac07[_0x379f2d(0x17f)]===_0x1dbaa5):_0x173775[_0x379f2d(0x174)](_0x36f653=>_0x36f653[_0x379f2d(0x13d)]===_0x1b46f1&&!_0x36f653[_0x379f2d(0x17f)]);if(!_0xf960b8)throw new SDKError(ErrorCode[_0x379f2d(0x178)],_0x379f2d(0x139)+_0x1b46f1+_0x379f2d(0x141));return _0x6d1eb1[_0x379f2d(0x172)](_0x1b46f1),{'parentId':_0x165641,'parentName':_0x507a65,'folderId':_0xf960b8['id'],'folderPath':_0x6d1eb1,'type':_0x379f2d(0x159),'fullPath':_0x45fa41[_0x379f2d(0x16f)]('/')};}else{const _0x27c0ba=await this[_0x379f2d(0x187)](_0x165641),_0x2340d5=_0x1dbaa5?_0x27c0ba['find'](_0x2e1d29=>_0x2e1d29[_0x379f2d(0x13d)]===_0x1b46f1&&_0x2e1d29[_0x379f2d(0x14d)]===_0x1dbaa5):_0x27c0ba[_0x379f2d(0x174)](_0x359030=>_0x359030[_0x379f2d(0x13d)]===_0x1b46f1&&!_0x359030[_0x379f2d(0x14d)]);if(!_0x2340d5)throw new SDKError(ErrorCode[_0x379f2d(0x178)],_0x379f2d(0x181)+_0x1b46f1+'\x27\x20not\x20found');return{'parentId':_0x165641,'parentName':_0x507a65,'folderId':_0x1dbaa5,'folderPath':_0x6d1eb1['length']>0x0?_0x6d1eb1:undefined,'segmentId':_0x2340d5['id'],'segmentName':_0x1b46f1,'type':_0x379f2d(0x157),'fullPath':_0x45fa41[_0x379f2d(0x16f)]('/')};}}}async['resolvePathToResource'](_0x591e08){const _0x51b716=a49_0x100cb7,{parsePath:_0x3b3342}=await import('../utils/segment-path-parser.js'),_0x14d1a5=_0x3b3342(_0x591e08);if(!_0x14d1a5[_0x51b716(0x175)])throw new SDKError(ErrorCode[_0x51b716(0x149)],_0x51b716(0x14e));return await this[_0x51b716(0x13e)](_0x14d1a5[_0x51b716(0x160)]);}async[a49_0x100cb7(0x137)](_0x3b72d5,_0x4bf9ec){const _0x1577a3=a49_0x100cb7,[_0x4486cd,_0x32a718]=await Promise[_0x1577a3(0x144)]([this['listFolders'](_0x3b72d5),this[_0x1577a3(0x187)](_0x3b72d5)]);if(_0x4bf9ec){const _0x2c66dd=_0x4486cd[_0x1577a3(0x138)](_0x557994=>_0x557994['parentFolderId']===_0x4bf9ec),_0x5e6e84=_0x32a718[_0x1577a3(0x138)](_0x250998=>_0x250998['segmentFolderId']===_0x4bf9ec);return{'folders':_0x2c66dd,'segments':_0x5e6e84};}const _0x3f3c40=await this['getParentFull'](_0x3b72d5),_0x3e9138=_0x3f3c40[_0x1577a3(0x15f)];if(_0x3e9138){const _0x28f55d=_0x4486cd[_0x1577a3(0x138)](_0x3d65c9=>_0x3d65c9[_0x1577a3(0x17f)]===_0x3e9138),_0x5a66a5=_0x32a718['filter'](_0x5552f1=>_0x5552f1[_0x1577a3(0x14d)]===_0x3e9138);return{'folders':_0x28f55d,'segments':_0x5a66a5};}const _0x181a9f=_0x4486cd[_0x1577a3(0x138)](_0x1fc61f=>!_0x1fc61f[_0x1577a3(0x17f)]),_0x4d6202=_0x32a718[_0x1577a3(0x138)](_0x387d78=>!_0x387d78[_0x1577a3(0x14d)]);return{'folders':_0x181a9f,'segments':_0x4d6202};}async[a49_0x100cb7(0x16b)](_0x12218,_0x401542,_0x1481e0=0x0,_0x20366e=0xa){const _0x773c84=a49_0x100cb7;if(_0x1481e0>=_0x20366e)throw new SDKError(ErrorCode[_0x773c84(0x149)],_0x773c84(0x155)+_0x20366e+_0x773c84(0x162));const {folders:_0x654721,segments:_0x3d5d12}=await this['listUnified'](_0x12218,_0x401542),_0x41df05=[];for(const _0x5dfdee of _0x654721){const _0x189cca=await this[_0x773c84(0x16b)](_0x12218,_0x5dfdee['id'],_0x1481e0+0x1,_0x20366e);_0x41df05[_0x773c84(0x172)]({'type':_0x773c84(0x159),'id':_0x5dfdee['id'],'name':_0x5dfdee[_0x773c84(0x13d)],'children':_0x189cca[_0x773c84(0x131)]>0x0?_0x189cca:undefined,'metadata':{'description':_0x5dfdee['description']||undefined,'folderCount':_0x189cca['filter'](_0x15cb6d=>_0x15cb6d[_0x773c84(0x168)]===_0x773c84(0x159))['length'],'segmentCount':_0x189cca[_0x773c84(0x138)](_0x138e26=>_0x138e26['type']===_0x773c84(0x157))[_0x773c84(0x131)],'createdAt':_0x5dfdee[_0x773c84(0x14a)],'updatedAt':_0x5dfdee[_0x773c84(0x151)]}});}for(const _0x59d9f8 of _0x3d5d12){_0x41df05[_0x773c84(0x172)]({'type':_0x773c84(0x157),'id':_0x59d9f8['id'],'name':_0x59d9f8[_0x773c84(0x13d)],'population':_0x59d9f8['population'],'metadata':{'description':_0x59d9f8[_0x773c84(0x165)],'createdAt':_0x59d9f8['createdAt'],'updatedAt':_0x59d9f8['updatedAt']}});}return _0x41df05;}}
|
|
1
|
+
const a49_0x389d76=a49_0x6f0c;(function(_0xba3d0a,_0x30c0b9){const _0x559aa3=a49_0x6f0c,_0x4850c5=_0xba3d0a();while(!![]){try{const _0xc15d76=-parseInt(_0x559aa3(0x16c))/0x1*(parseInt(_0x559aa3(0x17f))/0x2)+parseInt(_0x559aa3(0x15e))/0x3*(-parseInt(_0x559aa3(0x156))/0x4)+parseInt(_0x559aa3(0x193))/0x5*(-parseInt(_0x559aa3(0x154))/0x6)+-parseInt(_0x559aa3(0x1a3))/0x7*(-parseInt(_0x559aa3(0x175))/0x8)+-parseInt(_0x559aa3(0x169))/0x9+parseInt(_0x559aa3(0x155))/0xa*(parseInt(_0x559aa3(0x18b))/0xb)+-parseInt(_0x559aa3(0x186))/0xc*(-parseInt(_0x559aa3(0x16f))/0xd);if(_0xc15d76===_0x30c0b9)break;else _0x4850c5['push'](_0x4850c5['shift']());}catch(_0x4dbe98){_0x4850c5['push'](_0x4850c5['shift']());}}}(a49_0x3c2b,0x325b2));function a49_0x6f0c(_0x2786bc,_0x20bbe6){const _0x3c2b94=a49_0x3c2b();return a49_0x6f0c=function(_0x6f0c2f,_0x11b43b){_0x6f0c2f=_0x6f0c2f-0x150;let _0xea6649=_0x3c2b94[_0x6f0c2f];return _0xea6649;},a49_0x6f0c(_0x2786bc,_0x20bbe6);}import{SDKError,ErrorCode}from'./errors.js';function a49_0x3c2b(){const _0x46d187=['\x27\x20not\x20found','join','getSegment','resolveFolderId','catch','folder','189708NpKvEy','createSegmentFolder','listFields','listRecursive','rootFolderId','2799379reSJaI','createSegment','updatedAt','resolveSegmentId','listSegmentFolders','resolveParentIdOrName','resolveParentId','Path\x20cannot\x20be\x20empty','55BCPwFe','getFolder','isArray','createParentSegment','getParentFull','then','getParentSQL','schema','segment','client','segmentFolderId','NOT_FOUND','name','parentFolderId','isAbsolute','getParentSegment','231651WfQixC','createParent','Parent\x20segment\x20not\x20found:\x20','Resource\x20\x27','\x20in\x20parent\x20','all','INVALID_ARGUMENT','description','length','attributes','187998ZGkgYc','10faxGFF','189780RKzjgo','parentColumn','population','Folder\x20not\x20found:\x20','test','behavior','getParentSegmentSQL','filter','15klqMam','\x27\x20not\x20found\x20in\x20parent\x20segment','updateSegment','listUnified','createdAt','ambiguous','parentTableName','Folder\x20\x27','listActivations','listSegments','parent\x20segment','3589443VtfKlG','listParents','type','67FHMbVq','../utils/segment-path-parser.js','getSegmentSQL','858CsIbPc','detectResourceType','attribute',')\x20exceeded','behaviors','updateParentSegment','40YJdJkW','listFolders','parent','find','push','traversePath','\x27\x20not\x20found\x20in\x20','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','detectResourceTypeInFolder','getParentSegmentFull','8250yFgkfk'];a49_0x3c2b=function(){return _0x46d187;};return a49_0x3c2b();}export class SegmentAPI{[a49_0x389d76(0x19c)];constructor(_0xcdfa3f){const _0x1fb2b6=a49_0x389d76;this[_0x1fb2b6(0x19c)]=_0xcdfa3f;}async[a49_0x389d76(0x16a)](){const _0x41888e=a49_0x389d76;return await this[_0x41888e(0x19c)]['listParentSegments']();}async['getParent'](_0x588069){const _0x312ca2=a49_0x389d76;return await this['client'][_0x312ca2(0x1a2)](_0x588069);}async[a49_0x389d76(0x167)](_0x8c8e4f){const _0x3becad=a49_0x389d76;return await this[_0x3becad(0x19c)]['listSegments'](_0x8c8e4f);}async[a49_0x389d76(0x182)](_0x1674d7,_0x577921){const _0x5d5c4d=a49_0x389d76;return await this[_0x5d5c4d(0x19c)][_0x5d5c4d(0x182)](_0x1674d7,_0x577921);}async[a49_0x389d76(0x176)](_0x4e8afa){const _0x298cae=a49_0x389d76;return await this[_0x298cae(0x19c)][_0x298cae(0x18f)](_0x4e8afa);}async[a49_0x389d76(0x194)](_0x32d2d7){const _0x53dc50=a49_0x389d76;return await this[_0x53dc50(0x19c)]['getSegmentFolder'](_0x32d2d7);}async[a49_0x389d76(0x166)](_0x6cb743,_0x295ac4){const _0x520107=a49_0x389d76;return await this[_0x520107(0x19c)][_0x520107(0x166)](_0x6cb743,_0x295ac4);}async[a49_0x389d76(0x199)](_0x182dd4){const _0x4aa6df=a49_0x389d76;return await this[_0x4aa6df(0x19c)][_0x4aa6df(0x15c)](_0x182dd4);}async[a49_0x389d76(0x16e)](_0x38c2bd,_0x391a1c){const _0x53ae37=a49_0x389d76;return await this['client'][_0x53ae37(0x16e)](_0x38c2bd,_0x391a1c);}async[a49_0x389d76(0x191)](_0x5504d0){const _0x409eb5=a49_0x389d76,_0x51f5a6=await this[_0x409eb5(0x16a)](),_0x335430=_0x51f5a6[_0x409eb5(0x178)](_0x35c02e=>_0x35c02e[_0x409eb5(0x153)][_0x409eb5(0x19f)]===_0x5504d0);if(!_0x335430)throw new SDKError(ErrorCode[_0x409eb5(0x19e)],_0x409eb5(0x1a5)+_0x5504d0);return _0x335430['id'];}async[a49_0x389d76(0x18e)](_0x47a399,_0x3310ec){const _0x24e4c1=a49_0x389d76,_0x1abe38=await this[_0x24e4c1(0x167)](_0x47a399),_0x579a26=_0x1abe38[_0x24e4c1(0x178)](_0x3d0c0d=>_0x3d0c0d[_0x24e4c1(0x19f)]===_0x3310ec);if(!_0x579a26)throw new SDKError(ErrorCode[_0x24e4c1(0x19e)],'Child\x20segment\x20not\x20found:\x20'+_0x3310ec+_0x24e4c1(0x1a7)+_0x47a399);return _0x579a26['id'];}async[a49_0x389d76(0x183)](_0xa522c4,_0x101913){const _0x3b45cc=a49_0x389d76,_0x5d15a3=await this['listFolders'](_0xa522c4),_0x3dbcfe=_0x5d15a3[_0x3b45cc(0x178)](_0x170665=>_0x170665[_0x3b45cc(0x19f)]===_0x101913);if(!_0x3dbcfe)throw new SDKError(ErrorCode[_0x3b45cc(0x19e)],_0x3b45cc(0x159)+_0x101913+_0x3b45cc(0x1a7)+_0xa522c4);return _0x3dbcfe['id'];}async[a49_0x389d76(0x188)](_0x12be90){const _0x4338de=a49_0x389d76,_0x227e3c=await this['resolveParentIdOrName'](_0x12be90),_0x5bee35=await this['client'][_0x4338de(0x17e)](_0x227e3c),_0x32348f=[];if(_0x5bee35[_0x4338de(0x153)]&&Array['isArray'](_0x5bee35[_0x4338de(0x153)]))for(const _0x5367ff of _0x5bee35[_0x4338de(0x153)]){const _0x5dd5e5=_0x5367ff;_0x5dd5e5['name']&&_0x5dd5e5[_0x4338de(0x16b)]&&_0x32348f[_0x4338de(0x179)]({'name':_0x5dd5e5[_0x4338de(0x19f)],'type':_0x5dd5e5[_0x4338de(0x16b)],'source':_0x4338de(0x171),'parentDatabaseName':_0x5dd5e5['parentDatabaseName'],'parentTableName':_0x5dd5e5[_0x4338de(0x164)],'parentColumn':_0x5dd5e5[_0x4338de(0x157)]});}if(_0x5bee35[_0x4338de(0x173)]&&Array[_0x4338de(0x195)](_0x5bee35['behaviors']))for(const _0x4165f7 of _0x5bee35[_0x4338de(0x173)]){const _0x5c40e5=_0x4165f7,_0x1a1d84=_0x5c40e5['name'];if(_0x1a1d84&&_0x5c40e5[_0x4338de(0x19a)]&&Array[_0x4338de(0x195)](_0x5c40e5[_0x4338de(0x19a)]))for(const _0x172043 of _0x5c40e5[_0x4338de(0x19a)]){_0x172043[_0x4338de(0x19f)]&&_0x172043['type']&&_0x32348f['push']({'name':_0x1a1d84+'.'+_0x172043[_0x4338de(0x19f)],'type':_0x172043[_0x4338de(0x16b)],'source':_0x4338de(0x15b),'behaviorName':_0x1a1d84,'parentDatabaseName':_0x5c40e5['parentDatabaseName'],'parentTableName':_0x5c40e5[_0x4338de(0x164)],'parentColumn':_0x172043['parentColumn']});}}return _0x32348f;}async[a49_0x389d76(0x1a4)](_0x19454c){const _0x2c3f48=a49_0x389d76;return await this['client'][_0x2c3f48(0x196)](_0x19454c);}async['updateParent'](_0x589baf,_0x851d93){const _0x577fb8=a49_0x389d76,_0x276e9d=await this[_0x577fb8(0x190)](_0x589baf);return await this[_0x577fb8(0x19c)][_0x577fb8(0x174)](_0x276e9d,_0x851d93);}async[a49_0x389d76(0x197)](_0xb6543d){const _0xcd0bb6=a49_0x389d76,_0x1b5911=await this[_0xcd0bb6(0x190)](_0xb6543d);return await this[_0xcd0bb6(0x19c)][_0xcd0bb6(0x17e)](_0x1b5911);}async[a49_0x389d76(0x18c)](_0x241807,_0x37dcb8){const _0x1a95fc=a49_0x389d76;return await this[_0x1a95fc(0x19c)]['createSegment'](_0x241807,_0x37dcb8);}async['updateSegmentById'](_0x295edc,_0x49a328,_0x450efe){const _0x5d74fb=a49_0x389d76;return await this[_0x5d74fb(0x19c)][_0x5d74fb(0x160)](_0x295edc,_0x49a328,_0x450efe);}async['createFolder'](_0x4c089a,_0x4ec91d){const _0x37a9a7=a49_0x389d76,_0x4a79e6=await this[_0x37a9a7(0x190)](_0x4c089a);return await this[_0x37a9a7(0x19c)][_0x37a9a7(0x187)](_0x4a79e6,_0x4ec91d);}async[a49_0x389d76(0x190)](_0x28a95b){const _0x2615e4=a49_0x389d76;if(/^\d+$/[_0x2615e4(0x15a)](_0x28a95b))return _0x28a95b;return await this[_0x2615e4(0x191)](_0x28a95b);}async[a49_0x389d76(0x170)](_0x173d25,_0x52db6f){const _0x3a7d1b=a49_0x389d76,[_0x2a6041,_0x398f01]=await Promise[_0x3a7d1b(0x1a8)]([this[_0x3a7d1b(0x183)](_0x173d25,_0x52db6f)[_0x3a7d1b(0x198)](()=>!![])[_0x3a7d1b(0x184)](()=>![]),this[_0x3a7d1b(0x18e)](_0x173d25,_0x52db6f)[_0x3a7d1b(0x198)](()=>!![])[_0x3a7d1b(0x184)](()=>![])]);if(_0x2a6041&&_0x398f01)return _0x3a7d1b(0x163);else{if(_0x2a6041)return _0x3a7d1b(0x185);else{if(_0x398f01)return'segment';}}throw new SDKError(ErrorCode[_0x3a7d1b(0x19e)],_0x3a7d1b(0x1a6)+_0x52db6f+_0x3a7d1b(0x15f));}async['detectResourceTypeInFolder'](_0x37b589,_0x273a23,_0x1ae8db){const _0x55cb42=a49_0x389d76,[_0x560186,_0x1f11f7]=await Promise[_0x55cb42(0x1a8)]([this[_0x55cb42(0x176)](_0x37b589),this[_0x55cb42(0x167)](_0x37b589)]),_0x172b69=_0x1ae8db?_0x560186['filter'](_0x1df83b=>_0x1df83b[_0x55cb42(0x1a0)]===_0x1ae8db):_0x560186[_0x55cb42(0x15d)](_0x150471=>!_0x150471[_0x55cb42(0x1a0)]),_0x358580=_0x1ae8db?_0x1f11f7[_0x55cb42(0x15d)](_0x45a5fd=>_0x45a5fd[_0x55cb42(0x19d)]===_0x1ae8db):_0x1f11f7[_0x55cb42(0x15d)](_0x38e2a3=>!_0x38e2a3[_0x55cb42(0x19d)]),_0x35d4c4=_0x172b69['some'](_0x591fb8=>_0x591fb8[_0x55cb42(0x19f)]===_0x273a23),_0x55f519=_0x358580['some'](_0x51885a=>_0x51885a['name']===_0x273a23);if(_0x35d4c4&&_0x55f519)return _0x55cb42(0x163);else{if(_0x35d4c4)return _0x55cb42(0x185);else{if(_0x55f519)return'segment';}}throw new SDKError(ErrorCode[_0x55cb42(0x19e)],'Resource\x20\x27'+_0x273a23+_0x55cb42(0x17b)+(_0x1ae8db?'folder':_0x55cb42(0x168)));}async[a49_0x389d76(0x17a)](_0x170215){const _0x58d5c3=a49_0x389d76;if(_0x170215[_0x58d5c3(0x152)]===0x0)throw new SDKError(ErrorCode[_0x58d5c3(0x150)],_0x58d5c3(0x192));const _0x1c7d44=_0x170215[0x0],_0x2d51da=await this[_0x58d5c3(0x191)](_0x1c7d44);if(_0x170215[_0x58d5c3(0x152)]===0x1)return{'parentId':_0x2d51da,'parentName':_0x1c7d44,'type':_0x58d5c3(0x177),'fullPath':_0x1c7d44};const _0x2d66f0=await this['getParentFull'](_0x2d51da),_0x13ea18=_0x2d66f0[_0x58d5c3(0x18a)],_0x2eae98=[];let _0x1365f9=_0x13ea18;for(let _0x17f422=0x1;_0x17f422<_0x170215[_0x58d5c3(0x152)]-0x1;_0x17f422++){const _0x604c45=_0x170215[_0x17f422],_0x574bd7=await this[_0x58d5c3(0x176)](_0x2d51da),_0x5f2049=_0x1365f9?_0x574bd7['find'](_0x47bd21=>_0x47bd21['name']===_0x604c45&&_0x47bd21[_0x58d5c3(0x1a0)]===_0x1365f9):_0x574bd7[_0x58d5c3(0x178)](_0x355140=>_0x355140[_0x58d5c3(0x19f)]===_0x604c45&&!_0x355140['parentFolderId']);if(!_0x5f2049)throw new SDKError(ErrorCode['NOT_FOUND'],'Folder\x20\x27'+_0x604c45+'\x27\x20not\x20found\x20in\x20path');_0x2eae98[_0x58d5c3(0x179)](_0x604c45),_0x1365f9=_0x5f2049['id'];}const _0x5e43b4=_0x170215[_0x170215[_0x58d5c3(0x152)]-0x1],_0x581a3d=await this[_0x58d5c3(0x17d)](_0x2d51da,_0x5e43b4,_0x1365f9);if(_0x581a3d===_0x58d5c3(0x163))return{'parentId':_0x2d51da,'parentName':_0x1c7d44,'folderId':_0x1365f9,'folderPath':_0x2eae98[_0x58d5c3(0x152)]>0x0?_0x2eae98:undefined,'type':'folder','fullPath':_0x170215[_0x58d5c3(0x181)]('/')};else{if(_0x581a3d==='folder'){const _0x1933bf=await this['listFolders'](_0x2d51da),_0x32cdbe=_0x1365f9?_0x1933bf[_0x58d5c3(0x178)](_0x504b3f=>_0x504b3f[_0x58d5c3(0x19f)]===_0x5e43b4&&_0x504b3f['parentFolderId']===_0x1365f9):_0x1933bf[_0x58d5c3(0x178)](_0x2f2ed8=>_0x2f2ed8[_0x58d5c3(0x19f)]===_0x5e43b4&&!_0x2f2ed8[_0x58d5c3(0x1a0)]);if(!_0x32cdbe)throw new SDKError(ErrorCode['NOT_FOUND'],_0x58d5c3(0x165)+_0x5e43b4+_0x58d5c3(0x180));return _0x2eae98[_0x58d5c3(0x179)](_0x5e43b4),{'parentId':_0x2d51da,'parentName':_0x1c7d44,'folderId':_0x32cdbe['id'],'folderPath':_0x2eae98,'type':_0x58d5c3(0x185),'fullPath':_0x170215[_0x58d5c3(0x181)]('/')};}else{const _0x1af03e=await this[_0x58d5c3(0x167)](_0x2d51da),_0x188d6a=_0x1365f9?_0x1af03e[_0x58d5c3(0x178)](_0x3211f8=>_0x3211f8[_0x58d5c3(0x19f)]===_0x5e43b4&&_0x3211f8[_0x58d5c3(0x19d)]===_0x1365f9):_0x1af03e['find'](_0xcbaffc=>_0xcbaffc[_0x58d5c3(0x19f)]===_0x5e43b4&&!_0xcbaffc[_0x58d5c3(0x19d)]);if(!_0x188d6a)throw new SDKError(ErrorCode[_0x58d5c3(0x19e)],'Segment\x20\x27'+_0x5e43b4+_0x58d5c3(0x180));return{'parentId':_0x2d51da,'parentName':_0x1c7d44,'folderId':_0x1365f9,'folderPath':_0x2eae98[_0x58d5c3(0x152)]>0x0?_0x2eae98:undefined,'segmentId':_0x188d6a['id'],'segmentName':_0x5e43b4,'type':_0x58d5c3(0x19b),'fullPath':_0x170215[_0x58d5c3(0x181)]('/')};}}}async['resolvePathToResource'](_0x477df9){const _0x549cfe=a49_0x389d76,{parsePath:_0x1eb777}=await import(_0x549cfe(0x16d)),_0x173430=_0x1eb777(_0x477df9);if(!_0x173430[_0x549cfe(0x1a1)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x549cfe(0x17c));return await this[_0x549cfe(0x17a)](_0x173430['segments']);}async['listUnified'](_0x54b7f2,_0x475fe0){const _0x4eb782=a49_0x389d76,[_0x323894,_0x5d1970]=await Promise[_0x4eb782(0x1a8)]([this[_0x4eb782(0x176)](_0x54b7f2),this['listSegments'](_0x54b7f2)]);if(_0x475fe0){const _0x47d7f8=_0x323894[_0x4eb782(0x15d)](_0x4671ca=>_0x4671ca[_0x4eb782(0x1a0)]===_0x475fe0),_0x35f21a=_0x5d1970[_0x4eb782(0x15d)](_0x28dbf6=>_0x28dbf6['segmentFolderId']===_0x475fe0);return{'folders':_0x47d7f8,'segments':_0x35f21a};}const _0x9f89bf=await this[_0x4eb782(0x197)](_0x54b7f2),_0x1d31f8=_0x9f89bf[_0x4eb782(0x18a)];if(_0x1d31f8){const _0x5b0fba=_0x323894['filter'](_0x4e0729=>_0x4e0729[_0x4eb782(0x1a0)]===_0x1d31f8),_0x547c39=_0x5d1970[_0x4eb782(0x15d)](_0x3693ac=>_0x3693ac[_0x4eb782(0x19d)]===_0x1d31f8);return{'folders':_0x5b0fba,'segments':_0x547c39};}const _0x3a556d=_0x323894['filter'](_0x5a3645=>!_0x5a3645[_0x4eb782(0x1a0)]),_0x654471=_0x5d1970[_0x4eb782(0x15d)](_0xf53110=>!_0xf53110[_0x4eb782(0x19d)]);return{'folders':_0x3a556d,'segments':_0x654471};}async[a49_0x389d76(0x189)](_0x5d7924,_0x1580fb,_0x4a6bdc=0x0,_0x5b80c3=0xa){const _0x307806=a49_0x389d76;if(_0x4a6bdc>=_0x5b80c3)throw new SDKError(ErrorCode[_0x307806(0x150)],'Maximum\x20recursion\x20depth\x20('+_0x5b80c3+_0x307806(0x172));const {folders:_0x41cd5a,segments:_0x4d8eb3}=await this[_0x307806(0x161)](_0x5d7924,_0x1580fb),_0x392583=[];for(const _0x1d6f7a of _0x41cd5a){const _0x12ae25=await this[_0x307806(0x189)](_0x5d7924,_0x1d6f7a['id'],_0x4a6bdc+0x1,_0x5b80c3);_0x392583[_0x307806(0x179)]({'type':'folder','id':_0x1d6f7a['id'],'name':_0x1d6f7a[_0x307806(0x19f)],'children':_0x12ae25[_0x307806(0x152)]>0x0?_0x12ae25:undefined,'metadata':{'description':_0x1d6f7a[_0x307806(0x151)]||undefined,'folderCount':_0x12ae25['filter'](_0x57dffa=>_0x57dffa['type']===_0x307806(0x185))[_0x307806(0x152)],'segmentCount':_0x12ae25[_0x307806(0x15d)](_0x2ec7a0=>_0x2ec7a0[_0x307806(0x16b)]===_0x307806(0x19b))[_0x307806(0x152)],'createdAt':_0x1d6f7a[_0x307806(0x162)],'updatedAt':_0x1d6f7a[_0x307806(0x18d)]}});}for(const _0x237a07 of _0x4d8eb3){_0x392583[_0x307806(0x179)]({'type':_0x307806(0x19b),'id':_0x237a07['id'],'name':_0x237a07['name'],'population':_0x237a07[_0x307806(0x158)],'metadata':{'description':_0x237a07[_0x307806(0x151)],'createdAt':_0x237a07['createdAt'],'updatedAt':_0x237a07[_0x307806(0x18d)]}});}return _0x392583;}}
|
package/dist/sdk/table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x19bfc5=a50_0x152e;(function(_0x58987e,_0x42383d){const _0x5370e2=a50_0x152e,_0x4bfc84=_0x58987e();while(!![]){try{const _0x2968c6=parseInt(_0x5370e2(0xff))/0x1*(-parseInt(_0x5370e2(0x114))/0x2)+-parseInt(_0x5370e2(0x105))/0x3+parseInt(_0x5370e2(0x11a))/0x4+-parseInt(_0x5370e2(0x122))/0x5+parseInt(_0x5370e2(0x103))/0x6*(-parseInt(_0x5370e2(0x117))/0x7)+-parseInt(_0x5370e2(0x121))/0x8+parseInt(_0x5370e2(0x116))/0x9*(parseInt(_0x5370e2(0x107))/0xa);if(_0x2968c6===_0x42383d)break;else _0x4bfc84['push'](_0x4bfc84['shift']());}catch(_0x2f7f0d){_0x4bfc84['push'](_0x4bfc84['shift']());}}}(a50_0x923e,0xcd13b));import{escapeStringLiteral,buildLikePattern}from'../utils/string-utils.js';import{SDKError,ErrorCode}from'./errors.js';function a50_0x923e(){const _0x5c7ed4=['data','Database\x20pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','client','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22user_*\x22)\x20or\x20omit\x20to\x20list\x20all\x20tables.','list','Provide\x20a\x20valid\x20database\x20name\x20or\x20omit\x20to\x20list\x20tables\x20from\x20all\x20databases.','\x0a\x20\x20AND\x20table_schema\x20LIKE\x20','Use\x20--limit\x20<number>\x20to\x20specify\x20row\x20limit\x20(must\x20be\x20positive).','\x0a\x20\x20AND\x20table_name\x20LIKE\x20','MISSING_ARGUMENT','42154NRJjYu','validateTable','9hfcFMB','7HaTgwI','slice','executeQuery','5307268AgkyBo','\x20ESCAPE\x20\x27\x5c\x27','trim','Database\x20name\x20is\x20required','SELECT\x20*\x20FROM\x20','\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20ordinal_position\x0a\x20\x20\x20\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_schema\x20AS\x20database_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20','12826400ueaURS','5651985FIaqrQ','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','Usage:\x20tdx\x20describe\x20<database.table>','\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20','Database\x20name\x20cannot\x20be\x20empty\x20or\x20whitespace-only','\x0a\x20\x20\x20\x20\x20\x20','\x0a\x20\x20\x20\x20','Table\x20name\x20is\x20required','\x0aORDER\x20BY\x20database_name,\x20table_name\x0aLIMIT\x2010000','length','45vLRUiW','\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.schemata\x0a\x20\x20\x20\x20\x20\x20WHERE\x20catalog_name\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20schema_name\x20=\x20','\x0a\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20column_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20data_type,\x0a\x20\x20\x20\x20\x20\x20\x20\x20is_nullable\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.columns\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','\x20LIMIT\x20','6104454OAhOFe','INVALID_ARGUMENT','4648686HvxKvI','Limit\x20must\x20be\x20a\x20positive\x20integer','57623110SycHxt','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20'];a50_0x923e=function(){return _0x5c7ed4;};return a50_0x923e();}function a50_0x152e(_0xe81e52,_0x415082){const _0x923e17=a50_0x923e();return a50_0x152e=function(_0x152e05,_0x3d79f0){_0x152e05=_0x152e05-0xff;let _0xae8b76=_0x923e17[_0x152e05];return _0xae8b76;},a50_0x152e(_0xe81e52,_0x415082);}export class TableAPI{[a50_0x19bfc5(0x10c)];constructor(_0x5da347){const _0x14e5db=a50_0x19bfc5;this[_0x14e5db(0x10c)]=_0x5da347;}async[a50_0x19bfc5(0x10e)](_0x1e46b2,_0x17c2fa,_0x3e9140){const _0x4e2bd6=a50_0x19bfc5;if(_0x1e46b2!==undefined&&_0x1e46b2[_0x4e2bd6(0x11c)]()[_0x4e2bd6(0x12b)]===0x0)throw new SDKError(ErrorCode[_0x4e2bd6(0x104)],_0x4e2bd6(0x126),undefined,{'helpText':_0x4e2bd6(0x10f)});if(_0x17c2fa!==undefined&&_0x17c2fa['trim']()[_0x4e2bd6(0x12b)]===0x0)throw new SDKError(ErrorCode[_0x4e2bd6(0x104)],_0x4e2bd6(0x123),undefined,{'helpText':_0x4e2bd6(0x10d)});if(_0x3e9140!==undefined&&_0x3e9140[_0x4e2bd6(0x11c)]()[_0x4e2bd6(0x12b)]===0x0)throw new SDKError(ErrorCode[_0x4e2bd6(0x104)],_0x4e2bd6(0x10b),undefined,{'helpText':'Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20to\x20search\x20all\x20databases.'});let _0x2255c9;_0x1e46b2?(_0x2255c9=_0x4e2bd6(0x108)+escapeStringLiteral(_0x1e46b2)+_0x4e2bd6(0x127),_0x17c2fa&&(_0x2255c9+=_0x4e2bd6(0x112)+buildLikePattern(_0x17c2fa)+_0x4e2bd6(0x11b)),_0x2255c9+='\x0aORDER\x20BY\x20table_name\x0aLIMIT\x2010000'):(_0x2255c9=_0x4e2bd6(0x120),_0x3e9140&&(_0x2255c9+=_0x4e2bd6(0x110)+buildLikePattern(_0x3e9140)+_0x4e2bd6(0x11b)),_0x17c2fa&&(_0x2255c9+=_0x4e2bd6(0x112)+buildLikePattern(_0x17c2fa)+_0x4e2bd6(0x11b)),_0x2255c9+=_0x4e2bd6(0x12a));const _0x1d0377=await this[_0x4e2bd6(0x10c)][_0x4e2bd6(0x119)](_0x2255c9[_0x4e2bd6(0x11c)]());return _0x1d0377[_0x4e2bd6(0x10a)];}async['validateDatabase'](_0x4d7709){const _0x17b343=a50_0x19bfc5,_0x3399ad=(_0x17b343(0x100)+escapeStringLiteral(_0x4d7709)+_0x17b343(0x128))[_0x17b343(0x11c)](),_0x152ae8=await this['client'][_0x17b343(0x119)](_0x3399ad);return _0x152ae8['data'][_0x17b343(0x12b)]>0x0;}async[a50_0x19bfc5(0x115)](_0x35de73,_0x83bace){const _0x56e035=a50_0x19bfc5,_0x2f5036=(_0x56e035(0x109)+escapeStringLiteral(_0x35de73)+_0x56e035(0x125)+escapeStringLiteral(_0x83bace)+'\x0a\x20\x20\x20\x20')['trim'](),_0x527f63=await this['client'][_0x56e035(0x119)](_0x2f5036);return _0x527f63[_0x56e035(0x10a)][_0x56e035(0x12b)]>0x0;}async['describe'](_0x1ca944,_0x3b3b86){const _0x1150a6=a50_0x19bfc5;if(!_0x1ca944||_0x1ca944[_0x1150a6(0x11c)]()[_0x1150a6(0x12b)]===0x0)throw new SDKError(ErrorCode[_0x1150a6(0x113)],'Database\x20name\x20is\x20required',undefined,{'helpText':_0x1150a6(0x124)});if(!_0x3b3b86||_0x3b3b86[_0x1150a6(0x11c)]()[_0x1150a6(0x12b)]===0x0)throw new SDKError(ErrorCode[_0x1150a6(0x113)],_0x1150a6(0x129),undefined,{'helpText':'Usage:\x20tdx\x20describe\x20<database.table>'});const _0x3235a1=(_0x1150a6(0x101)+escapeStringLiteral(_0x1ca944)+_0x1150a6(0x125)+escapeStringLiteral(_0x3b3b86)+_0x1150a6(0x11f))[_0x1150a6(0x11c)](),_0x249528=await this[_0x1150a6(0x10c)][_0x1150a6(0x119)](_0x3235a1);return _0x249528[_0x1150a6(0x10a)];}async['show'](_0x5d3fe8,_0x2de911,_0x5d49f8=0x28,_0x3d395e){const _0x2a3dc1=a50_0x19bfc5;try{if(!_0x5d3fe8||_0x5d3fe8[_0x2a3dc1(0x11c)]()[_0x2a3dc1(0x12b)]===0x0)throw new SDKError(ErrorCode[_0x2a3dc1(0x113)],_0x2a3dc1(0x11d),undefined,{'helpText':'Usage:\x20tdx\x20show\x20<database.table>'});if(!_0x2de911||_0x2de911[_0x2a3dc1(0x11c)]()[_0x2a3dc1(0x12b)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x2a3dc1(0x129),undefined,{'helpText':'Usage:\x20tdx\x20show\x20<database.table>'});if(!Number['isInteger'](_0x5d49f8)||_0x5d49f8<=0x0)throw new SDKError(ErrorCode[_0x2a3dc1(0x104)],_0x2a3dc1(0x106),undefined,{'helpText':_0x2a3dc1(0x111)});const _0x2ff669=escapeStringLiteral(_0x5d3fe8)[_0x2a3dc1(0x118)](0x1,-0x1)+'.'+escapeStringLiteral(_0x2de911)[_0x2a3dc1(0x118)](0x1,-0x1),_0x1f0f07=_0x2a3dc1(0x11e)+_0x2ff669+_0x2a3dc1(0x102)+_0x5d49f8,_0x399996=await this[_0x2a3dc1(0x10c)]['executeQuery'](_0x1f0f07,{'catalog':_0x3d395e,'schema':_0x5d3fe8});return _0x399996;}catch(_0x240bd0){if(_0x240bd0 instanceof SDKError)throw _0x240bd0;throw _0x240bd0;}}}
|
package/dist/sdk/workflow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a51_0x1722(_0x4714b1,_0x4f2bd0){const _0xf7e3d7=a51_0xf7e3();return a51_0x1722=function(_0x172275,_0x1b3b19){_0x172275=_0x172275-0x151;let _0x3ea00b=_0xf7e3d7[_0x172275];return _0x3ea00b;},a51_0x1722(_0x4714b1,_0x4f2bd0);}const a51_0x5705c1=a51_0x1722;function a51_0xf7e3(){const _0x391c00=['push','268434XrBuzV','includeRetried','filter','resumeFrom','resolveProjectId','fullName','readdir','projects','retryAttempt','upstreams','project','last_id','parentId','kill','.tar.gz','isDirectory','unlink','sessionTime','extract','now','limit','tdx-workflow-','test','Project\x20not\x20found:\x20','success','timezone','done','endsWith','download','102389aKCUiN','sessionId','projectName','retryAt','\x20workflow\x20files\x20found\x20in\x20project\x20directory','attempts','join','listProjects','1244155QNZzTM','mkdir','startedAt','scheduleFrom','find','6pgsIQO','skipValidation','data','607288ekaPEK','1057120NYPeRi','status','logs','basename','exportParams','downloadProjectArchive','client','retryParams','map','name','lastAttempt','finishedAt','create','getTaskLogs','NUMERIC_ID_PATTERN','getAttempt','381422sLgePz','replace','cancelRequested','lastId','Cannot\x20read\x20workflow\x20file:\x20','fromTask','isGroup','3TGISeI','listSessions','access','length','config','deleteProject','force','clearScheduleAll','1626660JertUn','message','tar','tdx-workflow-push-','workflowName','No\x20','workflows','createdAt','workflow','revision','sessionUuid','toISOString','tasks'];a51_0xf7e3=function(){return _0x391c00;};return a51_0xf7e3();}(function(_0x272c7d,_0x2446f7){const _0x3a2f5c=a51_0x1722,_0x2bcf43=_0x272c7d();while(!![]){try{const _0x166a5c=-parseInt(_0x3a2f5c(0x155))/0x1+parseInt(_0x3a2f5c(0x176))/0x2*(-parseInt(_0x3a2f5c(0x17d))/0x3)+-parseInt(_0x3a2f5c(0x165))/0x4+-parseInt(_0x3a2f5c(0x15d))/0x5*(-parseInt(_0x3a2f5c(0x162))/0x6)+parseInt(_0x3a2f5c(0x185))/0x7+parseInt(_0x3a2f5c(0x166))/0x8+-parseInt(_0x3a2f5c(0x193))/0x9;if(_0x166a5c===_0x2446f7)break;else _0x2bcf43['push'](_0x2bcf43['shift']());}catch(_0x3560bd){_0x2bcf43['push'](_0x2bcf43['shift']());}}}(a51_0xf7e3,0x21d6b));import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';export class WorkflowAPI{[a51_0x5705c1(0x16c)];static [a51_0x5705c1(0x174)]=/^\d+$/;constructor(_0x1f78b1){const _0x2d62fe=a51_0x5705c1;this[_0x2d62fe(0x16c)]=_0x1f78b1;}async[a51_0x5705c1(0x197)](_0x392938){const _0x206718=a51_0x5705c1;if(WorkflowAPI[_0x206718(0x174)][_0x206718(0x1a9)](_0x392938))return{'id':_0x392938,'name':_0x392938};const _0x47b5bf=await this[_0x206718(0x16c)][_0x206718(0x15c)]({'name_pattern':_0x392938}),_0xc2ce74=_0x47b5bf[_0x206718(0x164)][_0x206718(0x161)](_0x4fae67=>_0x4fae67['name']===_0x392938);if(!_0xc2ce74)throw new Error(_0x206718(0x1aa)+_0x392938);return{'id':_0xc2ce74['id'],'name':_0xc2ce74['name']};}async[a51_0x5705c1(0x19a)](_0x416513,_0x4f3df7){const _0x19c68c=a51_0x5705c1,_0x113972=await this[_0x19c68c(0x16c)][_0x19c68c(0x15c)]({'name_pattern':_0x416513,..._0x4f3df7});return _0x113972[_0x19c68c(0x164)][_0x19c68c(0x16e)](_0xe6ce34=>({..._0xe6ce34,'project_id':_0xe6ce34['id'],'project_name':_0xe6ce34[_0x19c68c(0x16f)]}));}async[a51_0x5705c1(0x18b)](_0x3ed575,_0x580b06){const _0x47d8fc=a51_0x5705c1,_0x4255cc=await this['client']['listWorkflows']({'project_name':_0x3ed575,..._0x580b06});return _0x4255cc['data'][_0x47d8fc(0x16e)](_0x2bb568=>({'project_id':_0x2bb568[_0x47d8fc(0x19d)]?.['id'],'project_name':_0x2bb568[_0x47d8fc(0x19d)]?.[_0x47d8fc(0x16f)],'workflow_id':_0x2bb568['id'],'workflow_name':_0x2bb568['name'],'revision':_0x2bb568[_0x47d8fc(0x18e)],'timezone':_0x2bb568[_0x47d8fc(0x151)],'config':_0x2bb568[_0x47d8fc(0x181)],'id':_0x2bb568['id'],'name':_0x2bb568[_0x47d8fc(0x16f)],'project':_0x2bb568[_0x47d8fc(0x19d)]}));}async['sessions'](_0x47ad28){const _0x3411f7=a51_0x5705c1;let _0x891fbc;if(_0x47ad28?.[_0x3411f7(0x157)]){let _0x34521c,_0x1cd473=![];while(!_0x1cd473){const _0xbdd266=await this[_0x3411f7(0x16c)]['listProjects']({'limit':0x64,'last_id':_0x34521c}),_0x1fd4f1=_0xbdd266[_0x3411f7(0x164)][_0x3411f7(0x161)](_0x3f044f=>_0x3f044f[_0x3411f7(0x16f)]===_0x47ad28[_0x3411f7(0x157)]);if(_0x1fd4f1){_0x891fbc=_0x1fd4f1['id'],_0x1cd473=!![];break;}if(!_0xbdd266[_0x3411f7(0x179)]||_0xbdd266[_0x3411f7(0x164)][_0x3411f7(0x180)]===0x0)break;_0x34521c=_0xbdd266[_0x3411f7(0x179)];}if(!_0x891fbc)throw new Error(_0x3411f7(0x1aa)+_0x47ad28[_0x3411f7(0x157)]);}const _0x3ca94b=await this[_0x3411f7(0x16c)][_0x3411f7(0x17e)]({'project_id':_0x891fbc,'project_name':_0x47ad28?.[_0x3411f7(0x157)],'workflow_name':_0x47ad28?.['workflowName'],'status':_0x47ad28?.[_0x3411f7(0x167)],'from_time':_0x47ad28?.['fromTime'],'to_time':_0x47ad28?.['toTime'],'limit':_0x47ad28?.[_0x3411f7(0x1a7)],'last_id':_0x47ad28?.['last_id']});return _0x3ca94b[_0x3411f7(0x164)][_0x3411f7(0x16e)](_0x525142=>({'project_id':_0x525142['project']?.['id'],'project_name':_0x525142[_0x3411f7(0x19d)]?.[_0x3411f7(0x16f)],'workflow_id':_0x525142[_0x3411f7(0x18d)]?.['id'],'workflow_name':_0x525142[_0x3411f7(0x18d)]?.[_0x3411f7(0x16f)],'session_id':_0x525142['id'],'sessionUuid':_0x525142[_0x3411f7(0x18f)],'sessionTime':_0x525142[_0x3411f7(0x1a4)],'lastAttempt':_0x525142[_0x3411f7(0x170)],'id':_0x525142['id'],'project':_0x525142[_0x3411f7(0x19d)],'workflow':_0x525142[_0x3411f7(0x18d)]}));}async[a51_0x5705c1(0x15a)](_0x20d5d7){const _0x1eded0=a51_0x5705c1,_0x126632=await this[_0x1eded0(0x16c)]['listAttempts']({'project_name':_0x20d5d7?.[_0x1eded0(0x157)],'workflow_name':_0x20d5d7?.[_0x1eded0(0x189)],'include_retried':_0x20d5d7?.[_0x1eded0(0x194)],'limit':_0x20d5d7?.[_0x1eded0(0x1a7)],'last_id':_0x20d5d7?.[_0x1eded0(0x19e)]});return _0x126632[_0x1eded0(0x164)][_0x1eded0(0x16e)](_0x3bcf69=>({'project_id':_0x3bcf69[_0x1eded0(0x19d)]?.['id'],'project_name':_0x3bcf69[_0x1eded0(0x19d)]?.['name'],'workflow_id':_0x3bcf69[_0x1eded0(0x18d)]?.['id'],'workflow_name':_0x3bcf69[_0x1eded0(0x18d)]?.[_0x1eded0(0x16f)],'session_id':_0x3bcf69[_0x1eded0(0x156)],'sessionUuid':_0x3bcf69['sessionUuid'],'sessionTime':_0x3bcf69[_0x1eded0(0x1a4)],'attempt_id':_0x3bcf69['id'],'attempt_index':_0x3bcf69['index'],'retryAttemptName':_0x3bcf69['retryAttemptName'],'done':_0x3bcf69[_0x1eded0(0x152)],'success':_0x3bcf69[_0x1eded0(0x1ab)],'cancelRequested':_0x3bcf69[_0x1eded0(0x178)],'params':_0x3bcf69['params'],'createdAt':_0x3bcf69[_0x1eded0(0x18c)],'finishedAt':_0x3bcf69[_0x1eded0(0x171)],'id':_0x3bcf69['id'],'index':_0x3bcf69['index'],'project':_0x3bcf69['project'],'workflow':_0x3bcf69[_0x1eded0(0x18d)]}));}async['attempt'](_0x68c6){const _0x1d5ee5=a51_0x5705c1,_0x3e427a=await this[_0x1d5ee5(0x16c)][_0x1d5ee5(0x175)](_0x68c6);return _0x3e427a;}async[a51_0x5705c1(0x191)](_0x39b505,_0x206e7a=![]){const _0x306469=a51_0x5705c1,_0xfa9771=await this[_0x306469(0x16c)]['getAttemptTasks'](_0x39b505,_0x206e7a);return _0xfa9771[_0x306469(0x16e)](_0x1402eb=>({'task_id':_0x1402eb['id'],'task_name':_0x1402eb[_0x306469(0x198)],'parentId':_0x1402eb[_0x306469(0x19f)],'config':_0x1402eb[_0x306469(0x181)],'upstreams':_0x1402eb[_0x306469(0x19c)],'state':_0x1402eb['state'],'exportParams':_0x1402eb[_0x306469(0x16a)],'storeParams':_0x1402eb['storeParams'],'stateParams':_0x1402eb['stateParams'],'updatedAt':_0x1402eb['updatedAt'],'retryAt':_0x1402eb[_0x306469(0x158)],'startedAt':_0x1402eb[_0x306469(0x15f)],'error':_0x1402eb['error'],'isGroup':_0x1402eb[_0x306469(0x17c)],'id':_0x1402eb['id'],'fullName':_0x1402eb[_0x306469(0x198)]}));}async[a51_0x5705c1(0x168)](_0x64a919,_0x359bf2,_0x59c54a){const _0x88d931=a51_0x5705c1;return await this[_0x88d931(0x16c)][_0x88d931(0x173)](_0x64a919,_0x359bf2,_0x59c54a);}async[a51_0x5705c1(0x1a0)](_0x2d93ee,_0x2a257f){const _0x128bd7=a51_0x5705c1,_0x5c51d0=await this[_0x128bd7(0x16c)]['killAttempt'](_0x2d93ee,_0x2a257f);return _0x5c51d0[_0x128bd7(0x186)];}async['retrySession'](_0x286000,_0x1c8add){const _0x191ef1=a51_0x5705c1,_0x1e84f5=await this[_0x191ef1(0x16c)]['retrySession'](_0x286000,{'from_task':_0x1c8add?.[_0x191ef1(0x17b)],'retry_params':_0x1c8add?.['retryParams']});return{'attemptId':_0x1e84f5['id'],'sessionId':_0x1e84f5['sessionId']};}async[a51_0x5705c1(0x19b)](_0x78fc11,_0xb4d0f5){const _0x3a8595=a51_0x5705c1,_0x10be3f=await this[_0x3a8595(0x16c)][_0x3a8595(0x19b)](_0x78fc11,{'resume_from':_0xb4d0f5?.[_0x3a8595(0x196)],'retry_params':_0xb4d0f5?.[_0x3a8595(0x16d)],'force':_0xb4d0f5?.[_0x3a8595(0x183)]});return{'attemptId':_0x10be3f['id'],'sessionId':_0x10be3f[_0x3a8595(0x156)]};}async[a51_0x5705c1(0x154)](_0x39a94f,_0x1cacf5,_0x3e2e0b){const _0x141d96=a51_0x5705c1,{promises:_0x5b415f}=await import('fs'),_0xf07c43=await import('path'),_0x14a0bf=await import('os'),_0x2dbed5=await import(_0x141d96(0x187)),{id:_0x3c2894,name:_0x16e401}=await this[_0x141d96(0x197)](_0x39a94f),_0x8bef75=_0x14a0bf['tmpdir'](),_0x55b578=_0xf07c43[_0x141d96(0x15b)](_0x8bef75,_0x141d96(0x1a8)+_0x3c2894+'-'+Date[_0x141d96(0x1a6)]()+'.tar.gz');try{await this[_0x141d96(0x16c)][_0x141d96(0x16b)](_0x3c2894,_0x55b578,_0x3e2e0b?.['revision']);const _0x5decfa=_0xf07c43[_0x141d96(0x15b)](_0x1cacf5,_0x16e401);await _0x5b415f[_0x141d96(0x15e)](_0x5decfa,{'recursive':!![]}),await _0x2dbed5[_0x141d96(0x1a5)]({'file':_0x55b578,'cwd':_0x5decfa,'gzip':!![]});const _0x2e6d9c=async _0x36499f=>{const _0x1f1092=_0x141d96;let _0x1a4475=0x0;const _0x4f639d=await _0x5b415f[_0x1f1092(0x199)](_0x36499f,{'withFileTypes':!![]});for(const _0x34ca91 of _0x4f639d){const _0x573f7f=_0xf07c43[_0x1f1092(0x15b)](_0x36499f,_0x34ca91[_0x1f1092(0x16f)]);if(_0x34ca91['isFile']())_0x1a4475++;else _0x34ca91[_0x1f1092(0x1a2)]()&&(_0x1a4475+=await _0x2e6d9c(_0x573f7f));}return _0x1a4475;},_0x273b4c=await _0x2e6d9c(_0x5decfa);return{'projectName':_0x16e401,'revision':_0x3e2e0b?.[_0x141d96(0x18e)]||'latest','filesExtracted':_0x273b4c};}finally{try{await _0x5b415f[_0x141d96(0x1a3)](_0x55b578);}catch{}}}async[a51_0x5705c1(0x192)](_0x39dee6,_0x39c46a){const _0x239fc7=a51_0x5705c1,{promises:_0x562b96}=await import('fs'),_0x4d470e=await import('path'),_0x2bb7be=await import(_0x239fc7(0x187)),_0x3326d1=_0x39c46a?.[_0x239fc7(0x157)]||_0x4d470e[_0x239fc7(0x169)](_0x39dee6),_0x2329ad=_0x39c46a?.[_0x239fc7(0x18e)]||new Date()[_0x239fc7(0x190)]()[_0x239fc7(0x177)](/[:.]/g,'-');try{await _0x562b96['access'](_0x39dee6);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x39dee6);}if(!_0x39c46a?.[_0x239fc7(0x163)]){const _0x37ee31=await _0x562b96['readdir'](_0x39dee6),_0x1c1023=_0x37ee31[_0x239fc7(0x195)](_0x117150=>_0x117150[_0x239fc7(0x153)](WORKFLOW_FILE_EXTENSION));if(_0x1c1023['length']===0x0)throw new Error(_0x239fc7(0x18a)+WORKFLOW_FILE_EXTENSION+_0x239fc7(0x159));for(const _0x1914c7 of _0x1c1023){const _0x264871=_0x4d470e[_0x239fc7(0x15b)](_0x39dee6,_0x1914c7);try{await _0x562b96[_0x239fc7(0x17f)](_0x264871);}catch{throw new Error(_0x239fc7(0x17a)+_0x1914c7);}}}const _0x33a162=async(_0x1354ca,_0x1a1ac9='')=>{const _0x4e68ba=_0x239fc7,_0x41f166=await _0x562b96['readdir'](_0x1354ca,{'withFileTypes':!![]}),_0x4ebe4d=[];for(const _0x58355a of _0x41f166){const _0xa1f6b7=_0x4d470e[_0x4e68ba(0x15b)](_0x1a1ac9,_0x58355a[_0x4e68ba(0x16f)]),_0x1cb4be=_0x4d470e['join'](_0x1354ca,_0x58355a['name']);if(!shouldIncludeInArchive(_0x58355a[_0x4e68ba(0x16f)]))continue;_0x58355a['isDirectory']()?_0x4ebe4d[_0x4e68ba(0x192)](...await _0x33a162(_0x1cb4be,_0xa1f6b7)):_0x4ebe4d['push'](_0xa1f6b7);}return _0x4ebe4d;},_0x5c8e35=await _0x33a162(_0x39dee6),_0x3eee7a=await import('os'),_0x3eb60d=_0x3eee7a['tmpdir'](),_0x210e2e=_0x4d470e[_0x239fc7(0x15b)](_0x3eb60d,_0x239fc7(0x188)+Date['now']()+_0x239fc7(0x1a1));try{await _0x2bb7be[_0x239fc7(0x172)]({'file':_0x210e2e,'gzip':!![],'cwd':_0x39dee6,'portable':!![]},_0x5c8e35);const _0x3e138b=await this['client']['uploadProjectArchive'](_0x3326d1,_0x2329ad,_0x210e2e,{'scheduleFrom':_0x39c46a?.[_0x239fc7(0x160)],'clearSchedule':_0x39c46a?.['clearSchedule'],'clearScheduleAll':_0x39c46a?.[_0x239fc7(0x184)]});return{'projectId':_0x3e138b['id'],'projectName':_0x3e138b[_0x239fc7(0x16f)],'revision':_0x3e138b[_0x239fc7(0x18e)]};}finally{try{await _0x562b96[_0x239fc7(0x1a3)](_0x210e2e);}catch{}}}async['delete'](_0x22700e){const _0x40a4e4=a51_0x5705c1,{id:_0x5bd035}=await this[_0x40a4e4(0x197)](_0x22700e),_0xfc39c7=await this[_0x40a4e4(0x16c)][_0x40a4e4(0x182)](_0x5bd035);return{'projectId':_0xfc39c7['id'],'projectName':_0xfc39c7[_0x40a4e4(0x16f)]};}}
|
|
1
|
+
function a51_0x3112(_0x44de39,_0x460b37){const _0x5f114a=a51_0x5f11();return a51_0x3112=function(_0x3112f1,_0x1e3bc1){_0x3112f1=_0x3112f1-0x1b9;let _0x39fe4e=_0x5f114a[_0x3112f1];return _0x39fe4e;},a51_0x3112(_0x44de39,_0x460b37);}const a51_0x5e9f24=a51_0x3112;(function(_0x2821d5,_0x4b053f){const _0x5c2159=a51_0x3112,_0x3898d2=_0x2821d5();while(!![]){try{const _0x44d309=-parseInt(_0x5c2159(0x21c))/0x1*(-parseInt(_0x5c2159(0x1f4))/0x2)+-parseInt(_0x5c2159(0x1f0))/0x3*(parseInt(_0x5c2159(0x209))/0x4)+parseInt(_0x5c2159(0x221))/0x5*(parseInt(_0x5c2159(0x1e0))/0x6)+parseInt(_0x5c2159(0x21e))/0x7+parseInt(_0x5c2159(0x1f9))/0x8*(parseInt(_0x5c2159(0x20d))/0x9)+parseInt(_0x5c2159(0x20c))/0xa*(parseInt(_0x5c2159(0x1fa))/0xb)+-parseInt(_0x5c2159(0x211))/0xc;if(_0x44d309===_0x4b053f)break;else _0x3898d2['push'](_0x3898d2['shift']());}catch(_0x143923){_0x3898d2['push'](_0x3898d2['shift']());}}}(a51_0x5f11,0x4fb4a));import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';function a51_0x5f11(){const _0x413db5=['getAttemptTasks','access','mkdir','config','deleteProject','workflowName','getAttempt','254049UhSkWi','download','406399sYWCGS','.tar.gz','uploadProjectArchive','781370MEUTrK','logs','workflows','sessionId','retrySession','listSessions','fromTime','workflow','upstreams','toTime','join','timezone','lastAttempt','No\x20','Project\x20not\x20found:\x20','data','isDirectory','done','project','endsWith','retryParams','updatedAt','retryAttempt','tmpdir','resolveProjectId','latest','name','limit','getTaskLogs','status','test','toISOString','revision','map','retryAt','listWorkflows','NUMERIC_ID_PATTERN','tasks','projectName','lastId','6Oyandn','push','success','message','Project\x20directory\x20not\x20found:\x20','tdx-workflow-','now','projects','client','basename','attempt','index','readdir','unlink','Cannot\x20read\x20workflow\x20file:\x20','retryAttemptName','2847BQgFtW','downloadProjectArchive','isGroup','storeParams','4kkWJyL','find','listProjects','filter','clearScheduleAll','2243576OYtRSP','11ejvjxv','replace','fullName','delete','force','finishedAt','kill','sessionTime','path','includeRetried','tdx-workflow-push-','resumeFrom','create','tar','parentId','84LwgtSV','cancelRequested','\x20workflow\x20files\x20found\x20in\x20project\x20directory','462190NRextO','18TZrQPb','last_id','createdAt','extract','11797668NFrgRm','clearSchedule','startedAt','killAttempt'];a51_0x5f11=function(){return _0x413db5;};return a51_0x5f11();}export class WorkflowAPI{['client'];static [a51_0x5e9f24(0x1dc)]=/^\d+$/;constructor(_0x1f421a){const _0x4d4298=a51_0x5e9f24;this[_0x4d4298(0x1e8)]=_0x1f421a;}async[a51_0x5e9f24(0x1d0)](_0x25104f){const _0x3d45bc=a51_0x5e9f24;if(WorkflowAPI['NUMERIC_ID_PATTERN'][_0x3d45bc(0x1d6)](_0x25104f))return{'id':_0x25104f,'name':_0x25104f};const _0xe8ac74=await this[_0x3d45bc(0x1e8)]['listProjects']({'name_pattern':_0x25104f}),_0x6fd69c=_0xe8ac74[_0x3d45bc(0x1c7)]['find'](_0x91751a=>_0x91751a[_0x3d45bc(0x1d2)]===_0x25104f);if(!_0x6fd69c)throw new Error(_0x3d45bc(0x1c6)+_0x25104f);return{'id':_0x6fd69c['id'],'name':_0x6fd69c[_0x3d45bc(0x1d2)]};}async[a51_0x5e9f24(0x1e7)](_0x2ee5ae,_0x39af4c){const _0x2f9884=a51_0x5e9f24,_0x1ac937=await this['client']['listProjects']({'name_pattern':_0x2ee5ae,..._0x39af4c});return _0x1ac937[_0x2f9884(0x1c7)][_0x2f9884(0x1d9)](_0x53e346=>({..._0x53e346,'project_id':_0x53e346['id'],'project_name':_0x53e346[_0x2f9884(0x1d2)]}));}async[a51_0x5e9f24(0x1ba)](_0x5e5036,_0xf2b86f){const _0x29e5c7=a51_0x5e9f24,_0x52351c=await this[_0x29e5c7(0x1e8)][_0x29e5c7(0x1db)]({'project_name':_0x5e5036,..._0xf2b86f});return _0x52351c['data']['map'](_0x467ee9=>({'project_id':_0x467ee9[_0x29e5c7(0x1ca)]?.['id'],'project_name':_0x467ee9[_0x29e5c7(0x1ca)]?.['name'],'workflow_id':_0x467ee9['id'],'workflow_name':_0x467ee9[_0x29e5c7(0x1d2)],'revision':_0x467ee9[_0x29e5c7(0x1d8)],'timezone':_0x467ee9[_0x29e5c7(0x1c3)],'config':_0x467ee9['config'],'id':_0x467ee9['id'],'name':_0x467ee9['name'],'project':_0x467ee9[_0x29e5c7(0x1ca)]}));}async['sessions'](_0x391af9){const _0x2a8ff4=a51_0x5e9f24;let _0x26028d;if(_0x391af9?.['projectName']){let _0x290750,_0x2cfed3=![];while(!_0x2cfed3){const _0x1c1c1e=await this[_0x2a8ff4(0x1e8)][_0x2a8ff4(0x1f6)]({'limit':0x64,'last_id':_0x290750}),_0x52c55f=_0x1c1c1e[_0x2a8ff4(0x1c7)][_0x2a8ff4(0x1f5)](_0x43032d=>_0x43032d[_0x2a8ff4(0x1d2)]===_0x391af9['projectName']);if(_0x52c55f){_0x26028d=_0x52c55f['id'],_0x2cfed3=!![];break;}if(!_0x1c1c1e[_0x2a8ff4(0x1df)]||_0x1c1c1e[_0x2a8ff4(0x1c7)]['length']===0x0)break;_0x290750=_0x1c1c1e[_0x2a8ff4(0x1df)];}if(!_0x26028d)throw new Error(_0x2a8ff4(0x1c6)+_0x391af9[_0x2a8ff4(0x1de)]);}const _0x5922cb=await this[_0x2a8ff4(0x1e8)][_0x2a8ff4(0x1bd)]({'project_id':_0x26028d,'project_name':_0x391af9?.[_0x2a8ff4(0x1de)],'workflow_name':_0x391af9?.[_0x2a8ff4(0x21a)],'status':_0x391af9?.[_0x2a8ff4(0x1d5)],'from_time':_0x391af9?.[_0x2a8ff4(0x1be)],'to_time':_0x391af9?.[_0x2a8ff4(0x1c1)],'limit':_0x391af9?.[_0x2a8ff4(0x1d3)],'last_id':_0x391af9?.[_0x2a8ff4(0x20e)]});return _0x5922cb['data'][_0x2a8ff4(0x1d9)](_0x5c1936=>({'project_id':_0x5c1936[_0x2a8ff4(0x1ca)]?.['id'],'project_name':_0x5c1936[_0x2a8ff4(0x1ca)]?.[_0x2a8ff4(0x1d2)],'workflow_id':_0x5c1936[_0x2a8ff4(0x1bf)]?.['id'],'workflow_name':_0x5c1936[_0x2a8ff4(0x1bf)]?.['name'],'session_id':_0x5c1936['id'],'sessionUuid':_0x5c1936['sessionUuid'],'sessionTime':_0x5c1936[_0x2a8ff4(0x201)],'lastAttempt':_0x5c1936[_0x2a8ff4(0x1c4)],'id':_0x5c1936['id'],'project':_0x5c1936[_0x2a8ff4(0x1ca)],'workflow':_0x5c1936['workflow']}));}async['attempts'](_0x4977a9){const _0x427ce6=a51_0x5e9f24,_0x5a11d9=await this[_0x427ce6(0x1e8)]['listAttempts']({'project_name':_0x4977a9?.[_0x427ce6(0x1de)],'workflow_name':_0x4977a9?.['workflowName'],'include_retried':_0x4977a9?.[_0x427ce6(0x203)],'limit':_0x4977a9?.[_0x427ce6(0x1d3)],'last_id':_0x4977a9?.[_0x427ce6(0x20e)]});return _0x5a11d9[_0x427ce6(0x1c7)][_0x427ce6(0x1d9)](_0x4a45c0=>({'project_id':_0x4a45c0[_0x427ce6(0x1ca)]?.['id'],'project_name':_0x4a45c0['project']?.['name'],'workflow_id':_0x4a45c0[_0x427ce6(0x1bf)]?.['id'],'workflow_name':_0x4a45c0[_0x427ce6(0x1bf)]?.[_0x427ce6(0x1d2)],'session_id':_0x4a45c0[_0x427ce6(0x1bb)],'sessionUuid':_0x4a45c0['sessionUuid'],'sessionTime':_0x4a45c0[_0x427ce6(0x201)],'attempt_id':_0x4a45c0['id'],'attempt_index':_0x4a45c0[_0x427ce6(0x1eb)],'retryAttemptName':_0x4a45c0[_0x427ce6(0x1ef)],'done':_0x4a45c0[_0x427ce6(0x1c9)],'success':_0x4a45c0[_0x427ce6(0x1e2)],'cancelRequested':_0x4a45c0[_0x427ce6(0x20a)],'params':_0x4a45c0['params'],'createdAt':_0x4a45c0[_0x427ce6(0x20f)],'finishedAt':_0x4a45c0[_0x427ce6(0x1ff)],'id':_0x4a45c0['id'],'index':_0x4a45c0[_0x427ce6(0x1eb)],'project':_0x4a45c0[_0x427ce6(0x1ca)],'workflow':_0x4a45c0[_0x427ce6(0x1bf)]}));}async[a51_0x5e9f24(0x1ea)](_0x84e649){const _0x43b2cf=a51_0x5e9f24,_0x1b70df=await this[_0x43b2cf(0x1e8)][_0x43b2cf(0x21b)](_0x84e649);return _0x1b70df;}async[a51_0x5e9f24(0x1dd)](_0x29cd42,_0x45ae08=![]){const _0x314f2b=a51_0x5e9f24,_0x2c94a3=await this['client'][_0x314f2b(0x215)](_0x29cd42,_0x45ae08);return _0x2c94a3[_0x314f2b(0x1d9)](_0x47214f=>({'task_id':_0x47214f['id'],'task_name':_0x47214f[_0x314f2b(0x1fc)],'parentId':_0x47214f[_0x314f2b(0x208)],'config':_0x47214f[_0x314f2b(0x218)],'upstreams':_0x47214f[_0x314f2b(0x1c0)],'state':_0x47214f['state'],'exportParams':_0x47214f['exportParams'],'storeParams':_0x47214f[_0x314f2b(0x1f3)],'stateParams':_0x47214f['stateParams'],'updatedAt':_0x47214f[_0x314f2b(0x1cd)],'retryAt':_0x47214f[_0x314f2b(0x1da)],'startedAt':_0x47214f[_0x314f2b(0x213)],'error':_0x47214f['error'],'isGroup':_0x47214f[_0x314f2b(0x1f2)],'id':_0x47214f['id'],'fullName':_0x47214f[_0x314f2b(0x1fc)]}));}async[a51_0x5e9f24(0x1b9)](_0x2c1123,_0xca7b79,_0x3666f5){const _0x104f19=a51_0x5e9f24;return await this[_0x104f19(0x1e8)][_0x104f19(0x1d4)](_0x2c1123,_0xca7b79,_0x3666f5);}async[a51_0x5e9f24(0x200)](_0x33fe7b,_0x32b454){const _0x5ae511=a51_0x5e9f24,_0xd6c3e4=await this[_0x5ae511(0x1e8)][_0x5ae511(0x214)](_0x33fe7b,_0x32b454);return _0xd6c3e4[_0x5ae511(0x1e3)];}async[a51_0x5e9f24(0x1bc)](_0xe36342,_0x3cd50e){const _0x505d46=a51_0x5e9f24,_0x17bbab=await this[_0x505d46(0x1e8)]['retrySession'](_0xe36342,{'from_task':_0x3cd50e?.['fromTask'],'retry_params':_0x3cd50e?.['retryParams']});return{'attemptId':_0x17bbab['id'],'sessionId':_0x17bbab[_0x505d46(0x1bb)]};}async[a51_0x5e9f24(0x1ce)](_0x14fc51,_0x4d2194){const _0x1de78e=a51_0x5e9f24,_0xedbf7d=await this['client'][_0x1de78e(0x1ce)](_0x14fc51,{'resume_from':_0x4d2194?.[_0x1de78e(0x205)],'retry_params':_0x4d2194?.[_0x1de78e(0x1cc)],'force':_0x4d2194?.[_0x1de78e(0x1fe)]});return{'attemptId':_0xedbf7d['id'],'sessionId':_0xedbf7d[_0x1de78e(0x1bb)]};}async[a51_0x5e9f24(0x21d)](_0x3d7026,_0x251076,_0x4bcb66){const _0x3ac6a9=a51_0x5e9f24,{promises:_0x28bd9f}=await import('fs'),_0x4ce3ee=await import(_0x3ac6a9(0x202)),_0x57cc93=await import('os'),_0x27dd31=await import(_0x3ac6a9(0x207)),{id:_0x174b2f,name:_0x4ae2fc}=await this[_0x3ac6a9(0x1d0)](_0x3d7026),_0x252e07=_0x57cc93[_0x3ac6a9(0x1cf)](),_0x12112a=_0x4ce3ee[_0x3ac6a9(0x1c2)](_0x252e07,_0x3ac6a9(0x1e5)+_0x174b2f+'-'+Date[_0x3ac6a9(0x1e6)]()+_0x3ac6a9(0x21f));try{await this[_0x3ac6a9(0x1e8)][_0x3ac6a9(0x1f1)](_0x174b2f,_0x12112a,_0x4bcb66?.[_0x3ac6a9(0x1d8)]);const _0xc9e408=_0x4ce3ee[_0x3ac6a9(0x1c2)](_0x251076,_0x4ae2fc);await _0x28bd9f[_0x3ac6a9(0x217)](_0xc9e408,{'recursive':!![]}),await _0x27dd31[_0x3ac6a9(0x210)]({'file':_0x12112a,'cwd':_0xc9e408,'gzip':!![]});const _0xdb4db5=async _0x318e0b=>{const _0x28d215=_0x3ac6a9;let _0x4fedf1=0x0;const _0x53b6ea=await _0x28bd9f[_0x28d215(0x1ec)](_0x318e0b,{'withFileTypes':!![]});for(const _0x31a95a of _0x53b6ea){const _0x590bdb=_0x4ce3ee['join'](_0x318e0b,_0x31a95a[_0x28d215(0x1d2)]);if(_0x31a95a['isFile']())_0x4fedf1++;else _0x31a95a[_0x28d215(0x1c8)]()&&(_0x4fedf1+=await _0xdb4db5(_0x590bdb));}return _0x4fedf1;},_0x573819=await _0xdb4db5(_0xc9e408);return{'projectName':_0x4ae2fc,'revision':_0x4bcb66?.[_0x3ac6a9(0x1d8)]||_0x3ac6a9(0x1d1),'filesExtracted':_0x573819};}finally{try{await _0x28bd9f['unlink'](_0x12112a);}catch{}}}async[a51_0x5e9f24(0x1e1)](_0x1881df,_0x37446d){const _0x30c55d=a51_0x5e9f24,{promises:_0xcd7e9e}=await import('fs'),_0x3f75b2=await import(_0x30c55d(0x202)),_0x569c69=await import(_0x30c55d(0x207)),_0x557318=_0x37446d?.[_0x30c55d(0x1de)]||_0x3f75b2[_0x30c55d(0x1e9)](_0x1881df),_0xfd546d=_0x37446d?.['revision']||new Date()[_0x30c55d(0x1d7)]()[_0x30c55d(0x1fb)](/[:.]/g,'-');try{await _0xcd7e9e[_0x30c55d(0x216)](_0x1881df);}catch{throw new Error(_0x30c55d(0x1e4)+_0x1881df);}if(!_0x37446d?.['skipValidation']){const _0x1241d9=await _0xcd7e9e[_0x30c55d(0x1ec)](_0x1881df),_0x3ae420=_0x1241d9[_0x30c55d(0x1f7)](_0x3f25a2=>_0x3f25a2[_0x30c55d(0x1cb)](WORKFLOW_FILE_EXTENSION));if(_0x3ae420['length']===0x0)throw new Error(_0x30c55d(0x1c5)+WORKFLOW_FILE_EXTENSION+_0x30c55d(0x20b));for(const _0x38fb56 of _0x3ae420){const _0x51dacd=_0x3f75b2['join'](_0x1881df,_0x38fb56);try{await _0xcd7e9e[_0x30c55d(0x216)](_0x51dacd);}catch{throw new Error(_0x30c55d(0x1ee)+_0x38fb56);}}}const _0x3c0a83=async(_0x236626,_0xe21336='')=>{const _0x364374=_0x30c55d,_0x20699d=await _0xcd7e9e[_0x364374(0x1ec)](_0x236626,{'withFileTypes':!![]}),_0x14de0f=[];for(const _0x2d3d22 of _0x20699d){const _0x21c4b8=_0x3f75b2['join'](_0xe21336,_0x2d3d22['name']),_0x77051d=_0x3f75b2[_0x364374(0x1c2)](_0x236626,_0x2d3d22[_0x364374(0x1d2)]);if(!shouldIncludeInArchive(_0x2d3d22['name']))continue;_0x2d3d22[_0x364374(0x1c8)]()?_0x14de0f[_0x364374(0x1e1)](...await _0x3c0a83(_0x77051d,_0x21c4b8)):_0x14de0f[_0x364374(0x1e1)](_0x21c4b8);}return _0x14de0f;},_0x295ba1=await _0x3c0a83(_0x1881df),_0x146fbb=await import('os'),_0x5260ac=_0x146fbb['tmpdir'](),_0x428ecf=_0x3f75b2[_0x30c55d(0x1c2)](_0x5260ac,_0x30c55d(0x204)+Date['now']()+'.tar.gz');try{await _0x569c69[_0x30c55d(0x206)]({'file':_0x428ecf,'gzip':!![],'cwd':_0x1881df,'portable':!![]},_0x295ba1);const _0x5b23f5=await this[_0x30c55d(0x1e8)][_0x30c55d(0x220)](_0x557318,_0xfd546d,_0x428ecf,{'scheduleFrom':_0x37446d?.['scheduleFrom'],'clearSchedule':_0x37446d?.[_0x30c55d(0x212)],'clearScheduleAll':_0x37446d?.[_0x30c55d(0x1f8)]});return{'projectId':_0x5b23f5['id'],'projectName':_0x5b23f5['name'],'revision':_0x5b23f5[_0x30c55d(0x1d8)]};}finally{try{await _0xcd7e9e[_0x30c55d(0x1ed)](_0x428ecf);}catch{}}}async[a51_0x5e9f24(0x1fd)](_0x1b4f7f){const _0x20afde=a51_0x5e9f24,{id:_0x4ebc0d}=await this['resolveProjectId'](_0x1b4f7f),_0x2229c3=await this['client'][_0x20afde(0x219)](_0x4ebc0d);return{'projectId':_0x2229c3['id'],'projectName':_0x2229c3['name']};}}
|
package/dist/types/endpoints.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a54_0x1b4c(){const _0xc338d5=['No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','https://api-cdp.ap02.treasuredata.com','https://api-presto.ap02.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://api.treasuredata.co.jp','https://api.treasuredata.com','5366382zbrnQi','https://api-staging-cdp.us01.treasuredata.com','https://api-workflow.ap02.treasuredata.com','https://llm-api.eu01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://api-presto.treasuredata.co.jp','https://llm-api-development.us01.treasuredata.com','https://api-development-presto.treasuredata.com','https://api-staging.treasuredata.co.jp','https://api-workflow.ap03.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://llm-api-staging.us01.treasuredata.com','3546824wstWAB','https://api-development-cdp.eu01.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://llm-api.treasuredata.co.jp','https://api-cdp.treasuredata.com','9wJjfYO','https://api-staging-workflow.ap03.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://api-staging.us01.treasuredata.com','2994082COMoZC','https://api-staging-presto.treasuredata.com','https://api-cdp.eu01.treasuredata.com','5059495OQcYgN','1702964SICfIl','https://llm-api-staging.treasuredata.co.jp','\x27\x20and\x20site\x20\x27','https://api-staging-presto.treasuredata.co.jp','https://api-staging.ap03.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','21iRRrKr','https://api-staging-workflow.treasuredata.co.jp','386700AVYAqk','https://api-staging-cdp.ap03.treasuredata.com','https://api.ap03.treasuredata.com','https://api-workflow.treasuredata.com','126062MjWzJS','https://api-development.us01.treasuredata.com','https://api-presto.treasuredata.com'];a54_0x1b4c=function(){return _0xc338d5;};return a54_0x1b4c();}const a54_0xcbe5a0=a54_0x34d9;(function(_0x21a8ff,_0x41c1df){const _0x163949=a54_0x34d9,_0x106a7e=_0x21a8ff();while(!![]){try{const _0x5ac9c1=-parseInt(_0x163949(0x19e))/0x1+parseInt(_0x163949(0x1a2))/0x2*(-parseInt(_0x163949(0x19c))/0x3)+parseInt(_0x163949(0x196))/0x4+parseInt(_0x163949(0x1c4))/0x5+parseInt(_0x163949(0x1ab))/0x6+-parseInt(_0x163949(0x1c1))/0x7+-parseInt(_0x163949(0x1b7))/0x8*(parseInt(_0x163949(0x1bd))/0x9);if(_0x5ac9c1===_0x41c1df)break;else _0x106a7e['push'](_0x106a7e['shift']());}catch(_0x16f565){_0x106a7e['push'](_0x106a7e['shift']());}}}(a54_0x1b4c,0x9a8d1));export const TD_ENDPOINTS={'us01':a54_0xcbe5a0(0x1aa),'jp01':a54_0xcbe5a0(0x1a9),'eu01':'https://api.eu01.treasuredata.com','ap02':'https://api.ap02.treasuredata.com','ap03':a54_0xcbe5a0(0x1a0),'dev-us01':a54_0xcbe5a0(0x1a3),'dev-eu01':'https://api-development.eu01.treasuredata.com','stg-us01':a54_0xcbe5a0(0x1c0),'stg-jp01':a54_0xcbe5a0(0x1b3),'stg-ap03':a54_0xcbe5a0(0x19a)};function a54_0x34d9(_0x14bef5,_0x580643){const _0x1b4c61=a54_0x1b4c();return a54_0x34d9=function(_0x34d95c,_0x3e7991){_0x34d95c=_0x34d95c-0x196;let _0xcf8ebe=_0x1b4c61[_0x34d95c];return _0xcf8ebe;},a54_0x34d9(_0x14bef5,_0x580643);}export const CDP_ENDPOINTS={'us01':a54_0xcbe5a0(0x1bc),'jp01':'https://api-cdp.treasuredata.co.jp','eu01':a54_0xcbe5a0(0x1c3),'ap02':a54_0xcbe5a0(0x1a6),'ap03':a54_0xcbe5a0(0x1af),'dev-us01':'https://api-development-cdp.us01.treasuredata.com','dev-eu01':a54_0xcbe5a0(0x1b8),'stg-us01':a54_0xcbe5a0(0x1ac),'stg-jp01':'https://api-staging-cdp.treasuredata.co.jp','stg-ap03':a54_0xcbe5a0(0x19f)};export const WORKFLOW_ENDPOINTS={'us01':a54_0xcbe5a0(0x1a1),'jp01':a54_0xcbe5a0(0x1bf),'eu01':a54_0xcbe5a0(0x1a8),'ap02':a54_0xcbe5a0(0x1ad),'ap03':a54_0xcbe5a0(0x1b4),'dev-us01':'https://api-development-workflow.us01.treasuredata.com','dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':'https://api-staging-workflow.us01.treasuredata.com','stg-jp01':a54_0xcbe5a0(0x19d),'stg-ap03':a54_0xcbe5a0(0x1be)};export const TRINO_ENDPOINTS={'us01':a54_0xcbe5a0(0x1a4),'jp01':a54_0xcbe5a0(0x1b0),'eu01':a54_0xcbe5a0(0x1b5),'ap02':a54_0xcbe5a0(0x1a7),'ap03':'https://api-presto.ap03.treasuredata.com','dev-us01':a54_0xcbe5a0(0x1b2),'dev-eu01':'https://api-development-presto.eu01.treasuredata.com','stg-us01':a54_0xcbe5a0(0x1c2),'stg-jp01':a54_0xcbe5a0(0x199),'stg-ap03':a54_0xcbe5a0(0x19b)};export const LLM_ENDPOINTS={'us01':'https://llm-api.treasuredata.com','jp01':a54_0xcbe5a0(0x1bb),'eu01':a54_0xcbe5a0(0x1ae),'ap02':a54_0xcbe5a0(0x1ba),'ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':a54_0xcbe5a0(0x1b1),'dev-eu01':'https://llm-api-development.eu01.treasuredata.com','stg-us01':a54_0xcbe5a0(0x1b6),'stg-jp01':a54_0xcbe5a0(0x197),'stg-ap03':a54_0xcbe5a0(0x1b9)};export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS};export function getEndpoint(_0x1e1177,_0x4d3da7='td'){const _0xf02fd8=a54_0xcbe5a0,_0x2384af=API_ENDPOINTS[_0x4d3da7]?.[_0x1e1177];if(!_0x2384af)throw new Error(_0xf02fd8(0x1a5)+_0x4d3da7+_0xf02fd8(0x198)+_0x1e1177+'\x27');return _0x2384af;}
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a55_0x41e1(_0x20b3a0,_0x7c1e04){const _0xe4484c=a55_0xe448();return a55_0x41e1=function(_0x41e136,_0x468fb9){_0x41e136=_0x41e136-0x1a1;let _0x47a050=_0xe4484c[_0x41e136];return _0x47a050;},a55_0x41e1(_0x20b3a0,_0x7c1e04);}const a55_0x20012b=a55_0x41e1;function a55_0xe448(){const _0x2091ed=['444aZZaUM','1542teFUSr','402777zeICsC','256RHLqpK','8478404kaaoIV','jp01','15449fmuMiH','5pXXXlF','stg-us01','dev-us01','5438980byibvE','1553931eTLfQU','1970244rDTtoK','8RzuSJn','us01'];a55_0xe448=function(){return _0x2091ed;};return a55_0xe448();}(function(_0x32a0f5,_0x38f93b){const _0x21581d=a55_0x41e1,_0x2494dc=_0x32a0f5();while(!![]){try{const _0x5a01b9=parseInt(_0x21581d(0x1a7))/0x1*(parseInt(_0x21581d(0x1aa))/0x2)+parseInt(_0x21581d(0x1a3))/0x3+-parseInt(_0x21581d(0x1a4))/0x4*(-parseInt(_0x21581d(0x1ae))/0x5)+-parseInt(_0x21581d(0x1a8))/0x6*(parseInt(_0x21581d(0x1ad))/0x7)+parseInt(_0x21581d(0x1a5))/0x8*(parseInt(_0x21581d(0x1a9))/0x9)+parseInt(_0x21581d(0x1a2))/0xa+-parseInt(_0x21581d(0x1ab))/0xb;if(_0x5a01b9===_0x38f93b)break;else _0x2494dc['push'](_0x2494dc['shift']());}catch(_0x5281dc){_0x2494dc['push'](_0x2494dc['shift']());}}}(a55_0xe448,0x4da6a));export const SITE_ALIASES={'us':'us01','aws':a55_0x20012b(0x1a6),'jp':a55_0x20012b(0x1ac),'aws-tokyo':a55_0x20012b(0x1ac),'dev':a55_0x20012b(0x1a1),'stg':a55_0x20012b(0x1af)};export{getEndpoint,API_ENDPOINTS}from'./endpoints.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1cab53,_0x9a2d){const _0x3e468d=a58_0x3ab8,_0x595918=_0x1cab53();while(!![]){try{const _0x26362c=-parseInt(_0x3e468d(0xff))/0x1*(parseInt(_0x3e468d(0xfb))/0x2)+parseInt(_0x3e468d(0x100))/0x3+-parseInt(_0x3e468d(0xf6))/0x4+-parseInt(_0x3e468d(0xfe))/0x5+parseInt(_0x3e468d(0xf8))/0x6+-parseInt(_0x3e468d(0xf5))/0x7+parseInt(_0x3e468d(0x103))/0x8;if(_0x26362c===_0x9a2d)break;else _0x595918['push'](_0x595918['shift']());}catch(_0x3ab1bd){_0x595918['push'](_0x595918['shift']());}}}(a58_0x2f30,0xf396f));function a58_0x3ab8(_0x38f399,_0xe2ae52){const _0x2f3086=a58_0x2f30();return a58_0x3ab8=function(_0x3ab8fa,_0x2503f1){_0x3ab8fa=_0x3ab8fa-0xf5;let _0x443256=_0x2f3086[_0x3ab8fa];return _0x443256;},a58_0x3ab8(_0x38f399,_0xe2ae52);}export function parseAgentRef(_0x3763e4){const _0x185d51=a58_0x3ab8;if(!_0x3763e4||_0x3763e4['trim']()==='')throw new Error(_0x185d51(0x102));const _0x1381fa=_0x3763e4[_0x185d51(0xfd)](),_0x2b6d3e=_0x1381fa[_0x185d51(0xf9)]('/');if(_0x2b6d3e[_0x185d51(0xfc)]===0x1)return{'projectName':_0x2b6d3e[0x0],'agentName':undefined};else{if(_0x2b6d3e[_0x185d51(0xfc)]===0x2){const [_0x3e1354,_0x485832]=_0x2b6d3e;if(!_0x3e1354||_0x3e1354[_0x185d51(0xfd)]()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');if(!_0x485832||_0x485832[_0x185d51(0xfd)]()==='')throw new Error(_0x185d51(0xf7));return{'projectName':_0x3e1354[_0x185d51(0xfd)](),'agentName':_0x485832[_0x185d51(0xfd)]()};}else throw new Error(_0x185d51(0x101)+_0x3763e4+_0x185d51(0xfa));}}function a58_0x2f30(){const _0x40a4d8=['.\x20Expected\x20\x22project_name\x22\x20or\x20\x22project_name/agent_name\x22','20qdYwPE','length','trim','2042070TwjzYt','71993rphvYW','2642934JbiQgj','Invalid\x20agent\x20reference\x20format:\x20','Agent\x20reference\x20cannot\x20be\x20empty','14386080OLyouu','161511dXzTiD','6059416XwyuGa','Agent\x20name\x20cannot\x20be\x20empty','5908656RSCcoM','split'];a58_0x2f30=function(){return _0x40a4d8;};return a58_0x2f30();}
|
package/dist/utils/chat-cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2528a1,_0x127b36){const _0x3e147f=a59_0x2078,_0x42dee7=_0x2528a1();while(!![]){try{const _0x2d9316=-parseInt(_0x3e147f(0x12a))/0x1*(-parseInt(_0x3e147f(0x12d))/0x2)+-parseInt(_0x3e147f(0x12e))/0x3+-parseInt(_0x3e147f(0x12b))/0x4+parseInt(_0x3e147f(0x128))/0x5*(parseInt(_0x3e147f(0x12c))/0x6)+-parseInt(_0x3e147f(0x127))/0x7*(-parseInt(_0x3e147f(0x130))/0x8)+-parseInt(_0x3e147f(0x129))/0x9+parseInt(_0x3e147f(0x126))/0xa;if(_0x2d9316===_0x127b36)break;else _0x42dee7['push'](_0x42dee7['shift']());}catch(_0x869d8c){_0x42dee7['push'](_0x42dee7['shift']());}}}(a59_0x1f5f,0x61dbd));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{join}from'path';function getCacheDir(){const _0x5847ec=a59_0x2078;return join(process[_0x5847ec(0x124)](),_0x5847ec(0x125),'tdx');}function getLastChatIdPath(){const _0x2bd160=a59_0x2078;return join(getCacheDir(),_0x2bd160(0x12f));}function a59_0x1f5f(){const _0x25d447=['2934714LmomLu','30WRhdiQ','1840920tnwnfW','last_chat_id','3498536BMJEAn','utf-8','cwd','.cache','9468080GJaYZy','7WsfdoJ','5KdkKwz','4557807BNjxty','29327DKbDTz','3169028zPlAmx'];a59_0x1f5f=function(){return _0x25d447;};return a59_0x1f5f();}function ensureCacheDir(){const _0x25f4ee=getCacheDir();!existsSync(_0x25f4ee)&&mkdirSync(_0x25f4ee,{'recursive':!![]});}export function saveLastChatId(_0x44aa02){ensureCacheDir();const _0x4740e2=getLastChatIdPath();writeFileSync(_0x4740e2,_0x44aa02,'utf-8');}export function loadLastChatId(){const _0x1cf7cd=a59_0x2078,_0x124ef8=getLastChatIdPath();if(!existsSync(_0x124ef8))return undefined;try{const _0x53bb1b=readFileSync(_0x124ef8,_0x1cf7cd(0x123))['trim']();return _0x53bb1b||undefined;}catch{return undefined;}}function a59_0x2078(_0x45abc9,_0x254d68){const _0x1f5f98=a59_0x1f5f();return a59_0x2078=function(_0x20787a,_0x6556a1){_0x20787a=_0x20787a-0x123;let _0x2ae32c=_0x1f5f98[_0x20787a];return _0x2ae32c;},a59_0x2078(_0x45abc9,_0x254d68);}export function clearLastChatId(){const _0x3148a6=getLastChatIdPath();if(existsSync(_0x3148a6))try{writeFileSync(_0x3148a6,'','utf-8');}catch{}}
|
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19e966,_0x4437b2){const _0x3975aa=a60_0x1095,_0x2400c8=_0x19e966();while(!![]){try{const _0x1c97c1=parseInt(_0x3975aa(0x1b3))/0x1*(-parseInt(_0x3975aa(0x1a6))/0x2)+-parseInt(_0x3975aa(0x1a3))/0x3*(parseInt(_0x3975aa(0x1b2))/0x4)+-parseInt(_0x3975aa(0x1ba))/0x5+-parseInt(_0x3975aa(0x1c0))/0x6*(-parseInt(_0x3975aa(0x1aa))/0x7)+-parseInt(_0x3975aa(0x1b4))/0x8*(-parseInt(_0x3975aa(0x1ad))/0x9)+parseInt(_0x3975aa(0x1b8))/0xa+parseInt(_0x3975aa(0x1b7))/0xb*(parseInt(_0x3975aa(0x1ac))/0xc);if(_0x1c97c1===_0x4437b2)break;else _0x2400c8['push'](_0x2400c8['shift']());}catch(_0x46aa88){_0x2400c8['push'](_0x2400c8['shift']());}}}(a60_0x4624,0x5cdb2));import{Chalk}from'chalk';export function shouldUseColor(_0xcd93db={}){const _0xc7b9d0=a60_0x1095;if(_0xcd93db['noColor']===!![])return![];if(_0xcd93db[_0xc7b9d0(0x1b6)]===!![])return!![];if(process[_0xc7b9d0(0x1a7)]['NO_COLOR']!==undefined)return![];return process['stdout'][_0xc7b9d0(0x1a8)]??![];}function getChalk(_0x2f4b0d={}){if(shouldUseColor(_0x2f4b0d))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}function a60_0x1095(_0x5dc27e,_0x3a52b8){const _0x46242c=a60_0x4624();return a60_0x1095=function(_0x1095e3,_0x30e9ad){_0x1095e3=_0x1095e3-0x1a2;let _0x4ce684=_0x46242c[_0x1095e3];return _0x4ce684;},a60_0x1095(_0x5dc27e,_0x3a52b8);}export function colorBorder(_0x119838,_0x18c5fb={}){const _0x230fd7=a60_0x1095;return getChalk(_0x18c5fb)[_0x230fd7(0x1b5)](_0x119838);}export function colorHeader(_0xfffb17,_0x5b4329={}){const _0x14e7f3=a60_0x1095;return getChalk(_0x5b4329)[_0x14e7f3(0x1bc)](_0xfffb17);}export function colorType(_0x597ab1,_0x580e7a={}){const _0x1691fb=a60_0x1095;return getChalk(_0x580e7a)[_0x1691fb(0x1b5)](_0x597ab1);}export function colorJSONKey(_0x263949,_0x5939c8={}){const _0x20a4ac=a60_0x1095;return getChalk(_0x5939c8)[_0x20a4ac(0x1ab)](_0x263949);}export function colorJSONString(_0x386366,_0x3bec3f={}){return getChalk(_0x3bec3f)['green'](_0x386366);}export function colorJSONNumber(_0x1fff38,_0x117a00={}){const _0x16c498=a60_0x1095;return getChalk(_0x117a00)[_0x16c498(0x1bc)](_0x1fff38);}export function colorJSONBoolean(_0x5adb26,_0x20bfc9={}){const _0x2f48f7=a60_0x1095;return getChalk(_0x20bfc9)[_0x2f48f7(0x1a5)](_0x5adb26);}function a60_0x4624(){const _0x150306=['length','3778890xDXnEN','boolean','cyan','number','entries','null','6eEcJGW','object','56184ArfLOX','map','yellow','4qpSGak','env','isTTY','repeat','2689645OhpnTb','blue','84inLytb','112014ZWDiVH','join','isArray','string','stringify','136GGeDAb','100643VvVipi','128KVDNyM','dim','color','1786884nuByrf','2536750RtTxKh'];a60_0x4624=function(){return _0x150306;};return a60_0x4624();}export function colorJSONNull(_0x49bdd1,_0x470dbc={}){return getChalk(_0x470dbc)['dim'](_0x49bdd1);}export function colorizeJSONCompact(_0x380642,_0x1a4d26={}){const _0x3e7096=a60_0x1095;if(!shouldUseColor(_0x1a4d26))return JSON[_0x3e7096(0x1b1)](_0x380642);if(_0x380642===null)return colorJSONNull('null',_0x1a4d26);if(typeof _0x380642===_0x3e7096(0x1bb))return colorJSONBoolean(String(_0x380642),_0x1a4d26);if(typeof _0x380642===_0x3e7096(0x1bd))return colorJSONNumber(String(_0x380642),_0x1a4d26);if(typeof _0x380642===_0x3e7096(0x1b0))return colorJSONString(JSON[_0x3e7096(0x1b1)](_0x380642),_0x1a4d26);if(Array[_0x3e7096(0x1af)](_0x380642)){if(_0x380642[_0x3e7096(0x1b9)]===0x0)return'[]';const _0x14c4ea=_0x380642['map'](_0x4b9827=>colorizeJSONCompact(_0x4b9827,_0x1a4d26));return'['+_0x14c4ea['join'](',')+']';}if(typeof _0x380642===_0x3e7096(0x1a2)){const _0x3eb218=Object[_0x3e7096(0x1be)](_0x380642);if(_0x3eb218['length']===0x0)return'{}';const _0x5524f6=_0x3eb218[_0x3e7096(0x1a4)](([_0x38fa03,_0x4bbc80])=>{const _0x1c98a5=_0x3e7096,_0xd8b043=colorJSONKey(JSON[_0x1c98a5(0x1b1)](_0x38fa03),_0x1a4d26),_0x3bb0cd=colorizeJSONCompact(_0x4bbc80,_0x1a4d26);return _0xd8b043+':'+_0x3bb0cd;});return'{'+_0x5524f6[_0x3e7096(0x1ae)](',')+'}';}return String(_0x380642);}export function colorizeJSON(_0x2dd6fa,_0xf233a={},_0x460873=0x0){const _0x2e970c=a60_0x1095;if(!shouldUseColor(_0xf233a))return JSON[_0x2e970c(0x1b1)](_0x2dd6fa,null,0x2);const _0x9ec5b9='\x20'[_0x2e970c(0x1a9)](_0x460873),_0x4717dd=_0x460873+0x2;if(_0x2dd6fa===null)return colorJSONNull(_0x2e970c(0x1bf),_0xf233a);if(typeof _0x2dd6fa===_0x2e970c(0x1bb))return colorJSONBoolean(String(_0x2dd6fa),_0xf233a);if(typeof _0x2dd6fa===_0x2e970c(0x1bd))return colorJSONNumber(String(_0x2dd6fa),_0xf233a);if(typeof _0x2dd6fa==='string')return colorJSONString(JSON[_0x2e970c(0x1b1)](_0x2dd6fa),_0xf233a);if(Array[_0x2e970c(0x1af)](_0x2dd6fa)){if(_0x2dd6fa['length']===0x0)return'[]';const _0x51164c=_0x2dd6fa['map'](_0x27de5c=>{const _0x28d84f=_0x2e970c,_0x17660c=colorizeJSON(_0x27de5c,_0xf233a,_0x4717dd);return''+'\x20'[_0x28d84f(0x1a9)](_0x4717dd)+_0x17660c;});return'[\x0a'+_0x51164c[_0x2e970c(0x1ae)](',\x0a')+('\x0a'+_0x9ec5b9+']');}if(typeof _0x2dd6fa===_0x2e970c(0x1a2)){const _0x17592d=Object[_0x2e970c(0x1be)](_0x2dd6fa);if(_0x17592d[_0x2e970c(0x1b9)]===0x0)return'{}';const _0x2ce7f8=_0x17592d[_0x2e970c(0x1a4)](([_0x4ea676,_0x34533a])=>{const _0x324e9e=_0x2e970c,_0x534bdb=colorJSONKey(JSON['stringify'](_0x4ea676),_0xf233a),_0x2b3885=colorizeJSON(_0x34533a,_0xf233a,_0x4717dd);return''+'\x20'[_0x324e9e(0x1a9)](_0x4717dd)+_0x534bdb+':\x20'+_0x2b3885;});return'{\x0a'+_0x2ce7f8[_0x2e970c(0x1ae)](',\x0a')+('\x0a'+_0x9ec5b9+'}');}return String(_0x2dd6fa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a61_0x3b65(){const _0x21b79b=['stderr','No\x20data','max','red','4522510gRJjvK','length','json','759885jstGwB','[error]','2953755FQJEqd','noColor','tsv','18mIgMQm','bold','format','string','bigint','./formatters.js','color','table','log','5214520gRgqhM','jsonl','5517140piKVhi','isTTY','stringify','forEach','debug','[query]','sdk-result','[logs]','boolean','[Object]','push','close','error','join','isInteger','less','-FXRSn','varchar','object','map','split','trim','entries','cmdout','Results\x20saved\x20to\x20','66ntouGH','─┬─','query','number','85655mbdUzB','1262tElyMq','limit','816LHHtOX','resolve','FINISHED','double','end','stdin','padEnd','output','stdout','inherit','repeat'];a61_0x3b65=function(){return _0x21b79b;};return a61_0x3b65();}(function(_0x3bec3d,_0x19eaa2){const _0x122115=a61_0x214b,_0xa1c79=_0x3bec3d();while(!![]){try{const _0x5ec541=parseInt(_0x122115(0x18f))/0x1+parseInt(_0x122115(0x190))/0x2*(-parseInt(_0x122115(0x192))/0x3)+-parseInt(_0x122115(0x1b4))/0x4+-parseInt(_0x122115(0x1a6))/0x5+parseInt(_0x122115(0x18b))/0x6*(parseInt(_0x122115(0x1a4))/0x7)+parseInt(_0x122115(0x1b2))/0x8+-parseInt(_0x122115(0x1a9))/0x9*(-parseInt(_0x122115(0x1a1))/0xa);if(_0x5ec541===_0x19eaa2)break;else _0xa1c79['push'](_0xa1c79['shift']());}catch(_0x2c34ea){_0xa1c79['push'](_0xa1c79['shift']());}}}(a61_0x3b65,0xa9889));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';function a61_0x214b(_0x470877,_0xe9a763){const _0x3b65c4=a61_0x3b65();return a61_0x214b=function(_0x214bda,_0x18bc39){_0x214bda=_0x214bda-0x184;let _0x465b66=_0x3b65c4[_0x214bda];return _0x465b66;},a61_0x214b(_0x470877,_0xe9a763);}import a61_0x1fee3b from'chalk';export function parseOutputOptions(_0x2f9206){const _0x3500f9=a61_0x214b;return{'format':_0x2f9206[_0x3500f9(0x1ab)]||_0x3500f9(0x1b0),'output':_0x2f9206[_0x3500f9(0x199)]||'','limit':_0x2f9206[_0x3500f9(0x191)],'color':_0x2f9206[_0x3500f9(0x1af)],'noColor':_0x2f9206[_0x3500f9(0x1a7)]};}function convertSDKResultToQueryResult(_0x5eaab6){const _0x1dd1eb=a61_0x214b,_0x122de2=[];if(_0x5eaab6[_0x1dd1eb(0x1a2)]>0x0){const _0x42f092=_0x5eaab6[0x0];for(const [_0x1b9418,_0x2a7534]of Object[_0x1dd1eb(0x188)](_0x42f092)){let _0x39cca1=_0x1dd1eb(0x1c5);if(typeof _0x2a7534===_0x1dd1eb(0x18e))_0x39cca1=Number[_0x1dd1eb(0x1c2)](_0x2a7534)?_0x1dd1eb(0x1ad):_0x1dd1eb(0x195);else{if(typeof _0x2a7534==='boolean')_0x39cca1=_0x1dd1eb(0x1bc);else _0x2a7534===null&&(_0x39cca1=_0x1dd1eb(0x1c5));}_0x122de2[_0x1dd1eb(0x1be)]({'name':_0x1b9418,'type':_0x39cca1});}}return{'queryId':_0x1dd1eb(0x1ba),'columns':_0x122de2,'data':_0x5eaab6,'stats':{'state':_0x1dd1eb(0x194),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x5eaab6[_0x1dd1eb(0x1a2)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0xf95628,_0x1962fe){const _0x3e72ac=convertSDKResultToQueryResult(_0xf95628);return formatQueryOutput(_0x3e72ac,_0x1962fe);}export async function formatQueryOutput(_0x12e388,_0x5f54fb){const _0x139cfe=a61_0x214b,{format:_0x20df1d,limit:_0x4b02d1,output:_0x1a7f9c,color:_0xd5b459,noColor:_0x15a019}=_0x5f54fb,_0x14190e=Boolean(_0x1a7f9c)&&!_0xd5b459,_0x28ab23={'color':_0xd5b459,'noColor':_0x15a019||_0x14190e};if(_0x20df1d===_0x139cfe(0x1b0)){const {formatAsTable:_0x4683d4}=await import('./formatters.js'),_0x2f59ee=shouldUseLess(_0x20df1d,_0x1a7f9c);return _0x4683d4(_0x12e388,_0x4b02d1,_0x2f59ee,_0x28ab23);}else{if(_0x20df1d===_0x139cfe(0x1a3)){const {formatAsJSON:_0x1eaa89}=await import('./formatters.js');return _0x1eaa89(_0x12e388,_0x28ab23);}else{if(_0x20df1d===_0x139cfe(0x1b3)){const {formatAsJSONL:_0xefda12}=await import('./formatters.js');return _0xefda12(_0x12e388,_0x28ab23);}else{const {formatQueryResult:_0x3f9b6f}=await import(_0x139cfe(0x1ae));return _0x3f9b6f(_0x12e388,_0x20df1d);}}}}function shouldUseLess(_0x4a62fd,_0x4dc49b){const _0x27a236=a61_0x214b;return _0x4a62fd===_0x27a236(0x1b0)&&process[_0x27a236(0x19a)][_0x27a236(0x1b5)]&&!_0x4dc49b;}export function resolveOutputOptions(_0x1fbbf6){const _0x369085=a61_0x214b,_0x232d5b=resolveOutputFormat(_0x1fbbf6[_0x369085(0x1ab)],_0x1fbbf6[_0x369085(0x199)],'table');let _0x250108=typeof _0x1fbbf6[_0x369085(0x191)]==='number'?_0x1fbbf6['limit']:parseInt(_0x1fbbf6[_0x369085(0x191)]||'40',0xa);const _0x167906=_0x1fbbf6[_0x369085(0x199)]||'';return shouldUseLess(_0x232d5b,_0x167906)&&(_0x250108=Infinity),{'format':_0x232d5b,'output':_0x167906,'limit':_0x250108,'color':_0x1fbbf6['color'],'noColor':_0x1fbbf6[_0x369085(0x1a7)]};}export function writeOutput(_0x23d418,_0x3664f2,_0x3a9448){const _0x1dfdbb=a61_0x214b;return _0x3664f2?(writeFileSync(_0x3664f2,_0x23d418),console[_0x1dfdbb(0x1c0)](_0x1dfdbb(0x18a)+_0x3664f2),Promise[_0x1dfdbb(0x193)]()):shouldUseLess(_0x3a9448||'','')?new Promise(_0x1f1616=>{const _0x41c732=_0x1dfdbb,_0x460621=spawn(_0x41c732(0x1c3),[_0x41c732(0x1c4)],{'stdio':['pipe',_0x41c732(0x19b),_0x41c732(0x19b)]});let _0x1854db=![];_0x460621['on'](_0x41c732(0x1c0),()=>{const _0x8b0592=_0x41c732;!_0x1854db&&(_0x1854db=!![],console[_0x8b0592(0x1b1)](_0x23d418),_0x1f1616());}),_0x460621['on'](_0x41c732(0x1bf),()=>{!_0x1854db&&(_0x1854db=!![],_0x1f1616());}),_0x460621['on']('spawn',()=>{const _0x2240da=_0x41c732;!_0x1854db&&_0x460621['stdin']&&(_0x460621[_0x2240da(0x197)]['on'](_0x2240da(0x1c0),()=>{}),_0x460621[_0x2240da(0x197)]['write'](_0x23d418),_0x460621[_0x2240da(0x197)][_0x2240da(0x196)]());}),!_0x460621['stdin']&&(!_0x1854db&&(_0x1854db=!![],console[_0x41c732(0x1b1)](_0x23d418),_0x1f1616()));}):(console[_0x1dfdbb(0x1b1)](_0x23d418),Promise[_0x1dfdbb(0x193)]());}export async function handleSDKOutput(_0x68dd79,_0xda66a7){const _0x564b0b=a61_0x214b,_0x3ed167=resolveOutputOptions(_0xda66a7),_0x4b6118=await formatSDKOutput(_0x68dd79,_0x3ed167);await writeOutput(_0x4b6118,_0x3ed167[_0x564b0b(0x199)]||undefined,_0x3ed167[_0x564b0b(0x1ab)]);}export async function handleQueryOutput(_0x2ef5c1,_0x321466){const _0x5cd266=a61_0x214b,_0x13013e=resolveOutputOptions(_0x321466),_0x545744=await formatQueryOutput(_0x2ef5c1,_0x13013e);await writeOutput(_0x545744,_0x13013e[_0x5cd266(0x199)]||undefined,_0x13013e[_0x5cd266(0x1ab)]);}async function formatSingleObject(_0x498651,_0x3345f1){const _0x42c7fd=a61_0x214b,{format:_0x44d3c9,color:_0x3d6b3f,noColor:_0x34aa1e}=_0x3345f1,_0x4ba43f={'color':_0x3d6b3f,'noColor':_0x34aa1e};if(_0x44d3c9===_0x42c7fd(0x1a3)){if(shouldUseColor(_0x4ba43f))return colorizeJSON(_0x498651,_0x4ba43f);return JSON[_0x42c7fd(0x1b6)](_0x498651,null,0x2);}else{if(_0x44d3c9===_0x42c7fd(0x1b3)){if(shouldUseColor(_0x4ba43f))return colorizeJSONCompact(_0x498651,_0x4ba43f);return JSON[_0x42c7fd(0x1b6)](_0x498651);}else{if(_0x44d3c9===_0x42c7fd(0x1a8))return Object[_0x42c7fd(0x188)](_0x498651)[_0x42c7fd(0x185)](([_0x41f5eb,_0x3c07ee])=>_0x41f5eb+'\x09'+_0x3c07ee)[_0x42c7fd(0x1c1)]('\x0a');else{const _0x551073=Object[_0x42c7fd(0x188)](_0x498651);if(_0x551073[_0x42c7fd(0x1a2)]===0x0)return _0x42c7fd(0x19e);const _0x171208=_0x498651['debug'],_0x3f1cac=_0x498651[_0x42c7fd(0x18d)],_0x285f69=_0x3f1cac?typeof _0x3f1cac===_0x42c7fd(0x1ac)?_0x3f1cac:JSON['stringify'](_0x3f1cac,null,0x2):undefined,_0x12f095=_0x551073['filter'](([_0x5b5680])=>_0x5b5680!==_0x42c7fd(0x1b8)&&_0x5b5680!=='query'),_0x412156=Math[_0x42c7fd(0x19f)](..._0x12f095[_0x42c7fd(0x185)](([_0xead548])=>_0xead548[_0x42c7fd(0x1a2)])),_0x134afe=Math[_0x42c7fd(0x19f)](..._0x12f095[_0x42c7fd(0x185)](([,_0x1cbc3e])=>{const _0x2eafc2=_0x42c7fd;try{const _0x28a52f=_0x1cbc3e===null||_0x1cbc3e===undefined?'':typeof _0x1cbc3e===_0x2eafc2(0x184)?JSON[_0x2eafc2(0x1b6)](_0x1cbc3e):String(_0x1cbc3e),_0x3a0e82=_0x28a52f[_0x2eafc2(0x186)]('\x0a');return Math[_0x2eafc2(0x19f)](..._0x3a0e82[_0x2eafc2(0x185)](_0x590bf6=>_0x590bf6[_0x2eafc2(0x1a2)]),0x0);}catch{return 0x0;}}),0x14),_0x5bf38b=[];_0x5bf38b[_0x42c7fd(0x1be)](colorBorder('┌─'+'─'[_0x42c7fd(0x19c)](_0x412156)+_0x42c7fd(0x18c)+'─'[_0x42c7fd(0x19c)](_0x134afe)+'─┐',_0x4ba43f)),_0x12f095[_0x42c7fd(0x1b7)](([_0x1a13cc,_0x4d1b89])=>{const _0x460c78=_0x42c7fd;let _0x475d4f;try{_0x475d4f=_0x4d1b89===null||_0x4d1b89===undefined?'':typeof _0x4d1b89===_0x460c78(0x184)?JSON['stringify'](_0x4d1b89):String(_0x4d1b89);}catch{_0x475d4f=_0x460c78(0x1bd);}const _0x29e706=_0x1a13cc[_0x460c78(0x198)](_0x412156),_0x220540=_0x475d4f[_0x460c78(0x186)]('\x0a');_0x220540[_0x460c78(0x1b7)]((_0xe3366e,_0x18c271)=>{const _0x313772=_0x460c78,_0x1763b0=colorBorder('│',_0x4ba43f);_0x18c271===0x0?_0x5bf38b[_0x313772(0x1be)](_0x1763b0+'\x20'+_0x29e706+'\x20'+_0x1763b0+'\x20'+_0xe3366e[_0x313772(0x198)](_0x134afe)+'\x20'+_0x1763b0):_0x5bf38b[_0x313772(0x1be)](_0x1763b0+'\x20'+'\x20'['repeat'](_0x412156)+'\x20'+_0x1763b0+'\x20'+_0xe3366e[_0x313772(0x198)](_0x134afe)+'\x20'+_0x1763b0);});}),_0x5bf38b['push'](colorBorder('└─'+'─'[_0x42c7fd(0x19c)](_0x412156)+'─┴─'+'─'[_0x42c7fd(0x19c)](_0x134afe)+'─┘',_0x4ba43f));_0x285f69&&(_0x5bf38b[_0x42c7fd(0x1be)](''),_0x5bf38b[_0x42c7fd(0x1be)](String(a61_0x1fee3b['yellow'][_0x42c7fd(0x1aa)](_0x42c7fd(0x1b9)))),_0x5bf38b[_0x42c7fd(0x1be)](_0x285f69));if(_0x171208){if(_0x171208[_0x42c7fd(0x19d)]){_0x5bf38b['push'](''),_0x5bf38b['push'](String(a61_0x1fee3b[_0x42c7fd(0x1a0)]['bold'](_0x42c7fd(0x1a5))));const _0xf1d7b4=_0x171208[_0x42c7fd(0x19d)][_0x42c7fd(0x186)]('\x0a');_0xf1d7b4[_0x42c7fd(0x1b7)](_0x44cd76=>{const _0x4c2bd9=_0x42c7fd;_0x44cd76[_0x4c2bd9(0x187)]()&&_0x5bf38b[_0x4c2bd9(0x1be)](_0x44cd76);});}if(_0x171208[_0x42c7fd(0x189)]){_0x5bf38b[_0x42c7fd(0x1be)](''),_0x5bf38b[_0x42c7fd(0x1be)](String(a61_0x1fee3b['cyan']['bold'](_0x42c7fd(0x1bb))));const _0x1df129=_0x171208[_0x42c7fd(0x189)][_0x42c7fd(0x186)]('\x0a');_0x1df129[_0x42c7fd(0x1b7)](_0x2dd464=>{const _0x3a9ea9=_0x42c7fd;_0x2dd464[_0x3a9ea9(0x187)]()&&_0x5bf38b[_0x3a9ea9(0x1be)](_0x2dd464);});}}return _0x5bf38b[_0x42c7fd(0x1c1)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x353efa,_0x33241c){const _0x4ff609=a61_0x214b,_0x41bbd7=resolveOutputOptions(_0x33241c),_0x3c2e45=await formatSingleObject(_0x353efa,_0x41bbd7);await writeOutput(_0x3c2e45,_0x41bbd7[_0x4ff609(0x199)]||undefined,_0x41bbd7[_0x4ff609(0x1ab)]);}
|
|
1
|
+
(function(_0xeeff7a,_0x1e9a0b){const _0x4f8416=a61_0x463c,_0x18b3c4=_0xeeff7a();while(!![]){try{const _0x488ee2=parseInt(_0x4f8416(0x20f))/0x1*(-parseInt(_0x4f8416(0x204))/0x2)+-parseInt(_0x4f8416(0x201))/0x3+-parseInt(_0x4f8416(0x203))/0x4*(parseInt(_0x4f8416(0x1e9))/0x5)+parseInt(_0x4f8416(0x215))/0x6+parseInt(_0x4f8416(0x1e7))/0x7+-parseInt(_0x4f8416(0x212))/0x8+parseInt(_0x4f8416(0x1eb))/0x9*(parseInt(_0x4f8416(0x1f3))/0xa);if(_0x488ee2===_0x1e9a0b)break;else _0x18b3c4['push'](_0x18b3c4['shift']());}catch(_0x98fe7e){_0x18b3c4['push'](_0x18b3c4['shift']());}}}(a61_0x1b7d,0xce7e9));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a61_0x53d639 from'chalk';export function parseOutputOptions(_0x488874){const _0x52fd6c=a61_0x463c;return{'format':_0x488874[_0x52fd6c(0x205)]||_0x52fd6c(0x220),'output':_0x488874[_0x52fd6c(0x1f0)]||'','limit':_0x488874[_0x52fd6c(0x21b)],'color':_0x488874[_0x52fd6c(0x1f8)],'noColor':_0x488874[_0x52fd6c(0x20d)]};}function convertSDKResultToQueryResult(_0x3157de){const _0x214b33=a61_0x463c,_0x7e5c6a=[];if(_0x3157de[_0x214b33(0x1f9)]>0x0){const _0x1f96d8=_0x3157de[0x0];for(const [_0x1ef79e,_0x273ef9]of Object[_0x214b33(0x1fc)](_0x1f96d8)){let _0x36c9fa=_0x214b33(0x222);if(typeof _0x273ef9===_0x214b33(0x209))_0x36c9fa=Number[_0x214b33(0x1f2)](_0x273ef9)?_0x214b33(0x202):'double';else{if(typeof _0x273ef9==='boolean')_0x36c9fa='boolean';else _0x273ef9===null&&(_0x36c9fa=_0x214b33(0x222));}_0x7e5c6a[_0x214b33(0x1ff)]({'name':_0x1ef79e,'type':_0x36c9fa});}}return{'queryId':_0x214b33(0x1f6),'columns':_0x7e5c6a,'data':_0x3157de,'stats':{'state':_0x214b33(0x21c),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3157de[_0x214b33(0x1f9)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}function a61_0x1b7d(){const _0x597c1d=['isTTY','number','[error]','cmdout','log','noColor','object','247759DGiiUk','map','split','11522632TyCmlG','write','stdout','9631668HiyOfW','pipe','padEnd','stdin','Results\x20saved\x20to\x20','stringify','limit','FINISHED','─┴─','end','[logs]','table','No\x20data','varchar','─┬─','./formatters.js','-FXRSn','cyan','join','1093715dhTSJK','tsv','65WTeiHV','[query]','9GQTBVU','red','debug','[Object]','json','output','query','isInteger','37975570lVcFUn','trim','spawn','sdk-result','forEach','color','length','stderr','bold','entries','string','less','push','resolve','3105306jzkibi','bigint','459868pAGLAg','6pOfPnU','format','jsonl','repeat'];a61_0x1b7d=function(){return _0x597c1d;};return a61_0x1b7d();}export async function formatSDKOutput(_0x2f0f22,_0x4ee25f){const _0x46a821=convertSDKResultToQueryResult(_0x2f0f22);return formatQueryOutput(_0x46a821,_0x4ee25f);}export async function formatQueryOutput(_0x556a2c,_0x10a268){const _0x535d5e=a61_0x463c,{format:_0x270304,limit:_0x5d8393,output:_0x4c59f3,color:_0xf8af6d,noColor:_0x3897c4}=_0x10a268,_0x29de2f=Boolean(_0x4c59f3)&&!_0xf8af6d,_0x130047={'color':_0xf8af6d,'noColor':_0x3897c4||_0x29de2f};if(_0x270304===_0x535d5e(0x220)){const {formatAsTable:_0x1f3c64}=await import(_0x535d5e(0x224)),_0x338e13=shouldUseLess(_0x270304,_0x4c59f3);return _0x1f3c64(_0x556a2c,_0x5d8393,_0x338e13,_0x130047);}else{if(_0x270304===_0x535d5e(0x1ef)){const {formatAsJSON:_0x50bcc3}=await import(_0x535d5e(0x224));return _0x50bcc3(_0x556a2c,_0x130047);}else{if(_0x270304===_0x535d5e(0x206)){const {formatAsJSONL:_0x9877c7}=await import(_0x535d5e(0x224));return _0x9877c7(_0x556a2c,_0x130047);}else{const {formatQueryResult:_0x11d5c5}=await import(_0x535d5e(0x224));return _0x11d5c5(_0x556a2c,_0x270304);}}}}function shouldUseLess(_0x97eae,_0x343c9f){const _0x14847e=a61_0x463c;return _0x97eae===_0x14847e(0x220)&&process[_0x14847e(0x214)][_0x14847e(0x208)]&&!_0x343c9f;}export function resolveOutputOptions(_0x34670c){const _0xf13da8=a61_0x463c,_0x471175=resolveOutputFormat(_0x34670c['format'],_0x34670c[_0xf13da8(0x1f0)],'table');let _0xb102af=typeof _0x34670c[_0xf13da8(0x21b)]===_0xf13da8(0x209)?_0x34670c[_0xf13da8(0x21b)]:parseInt(_0x34670c[_0xf13da8(0x21b)]||'40',0xa);const _0x248cf1=_0x34670c[_0xf13da8(0x1f0)]||'';return shouldUseLess(_0x471175,_0x248cf1)&&(_0xb102af=Infinity),{'format':_0x471175,'output':_0x248cf1,'limit':_0xb102af,'color':_0x34670c[_0xf13da8(0x1f8)],'noColor':_0x34670c[_0xf13da8(0x20d)]};}export function writeOutput(_0xc80368,_0x18498b,_0xa96749){const _0x2c2520=a61_0x463c;return _0x18498b?(writeFileSync(_0x18498b,_0xc80368),console['error'](_0x2c2520(0x219)+_0x18498b),Promise['resolve']()):shouldUseLess(_0xa96749||'','')?new Promise(_0x97b086=>{const _0x1acbb6=_0x2c2520,_0x48c3a0=spawn(_0x1acbb6(0x1fe),[_0x1acbb6(0x225)],{'stdio':[_0x1acbb6(0x216),'inherit','inherit']});let _0x39f027=![];_0x48c3a0['on']('error',()=>{const _0x2033b7=_0x1acbb6;!_0x39f027&&(_0x39f027=!![],console[_0x2033b7(0x20c)](_0xc80368),_0x97b086());}),_0x48c3a0['on']('close',()=>{!_0x39f027&&(_0x39f027=!![],_0x97b086());}),_0x48c3a0['on'](_0x1acbb6(0x1f5),()=>{const _0x5b337e=_0x1acbb6;!_0x39f027&&_0x48c3a0['stdin']&&(_0x48c3a0[_0x5b337e(0x218)]['on']('error',()=>{}),_0x48c3a0[_0x5b337e(0x218)][_0x5b337e(0x213)](_0xc80368),_0x48c3a0[_0x5b337e(0x218)][_0x5b337e(0x21e)]());}),!_0x48c3a0['stdin']&&(!_0x39f027&&(_0x39f027=!![],console['log'](_0xc80368),_0x97b086()));}):(console[_0x2c2520(0x20c)](_0xc80368),Promise[_0x2c2520(0x200)]());}function a61_0x463c(_0x343bc4,_0x6dbe83){const _0x1b7da4=a61_0x1b7d();return a61_0x463c=function(_0x463c9b,_0x1f6eb4){_0x463c9b=_0x463c9b-0x1e5;let _0x4d512f=_0x1b7da4[_0x463c9b];return _0x4d512f;},a61_0x463c(_0x343bc4,_0x6dbe83);}export async function handleSDKOutput(_0x454a65,_0x1e53bc){const _0x1c3c90=resolveOutputOptions(_0x1e53bc),_0x51f416=await formatSDKOutput(_0x454a65,_0x1c3c90);await writeOutput(_0x51f416,_0x1c3c90['output']||undefined,_0x1c3c90['format']);}export async function handleQueryOutput(_0x22aac3,_0x565f44){const _0x1c6228=a61_0x463c,_0x3fb7d8=resolveOutputOptions(_0x565f44),_0x1fdd33=await formatQueryOutput(_0x22aac3,_0x3fb7d8);await writeOutput(_0x1fdd33,_0x3fb7d8[_0x1c6228(0x1f0)]||undefined,_0x3fb7d8[_0x1c6228(0x205)]);}async function formatSingleObject(_0x1152a4,_0x267843){const _0x853e77=a61_0x463c,{format:_0x59dabf,color:_0x1e84eb,noColor:_0x16564c}=_0x267843,_0x43142b={'color':_0x1e84eb,'noColor':_0x16564c};if(_0x59dabf===_0x853e77(0x1ef)){if(shouldUseColor(_0x43142b))return colorizeJSON(_0x1152a4,_0x43142b);return JSON[_0x853e77(0x21a)](_0x1152a4,null,0x2);}else{if(_0x59dabf===_0x853e77(0x206)){if(shouldUseColor(_0x43142b))return colorizeJSONCompact(_0x1152a4,_0x43142b);return JSON[_0x853e77(0x21a)](_0x1152a4);}else{if(_0x59dabf===_0x853e77(0x1e8))return Object['entries'](_0x1152a4)[_0x853e77(0x210)](([_0x3c6e94,_0x4b0980])=>_0x3c6e94+'\x09'+_0x4b0980)[_0x853e77(0x1e6)]('\x0a');else{const _0x3abea0=Object['entries'](_0x1152a4);if(_0x3abea0[_0x853e77(0x1f9)]===0x0)return _0x853e77(0x221);const _0x25449e=_0x1152a4[_0x853e77(0x1ed)],_0x1da0cd=_0x1152a4[_0x853e77(0x1f1)],_0x9324c=_0x1da0cd?typeof _0x1da0cd===_0x853e77(0x1fd)?_0x1da0cd:JSON[_0x853e77(0x21a)](_0x1da0cd,null,0x2):undefined,_0xbfa834=_0x3abea0['filter'](([_0x72da1e])=>_0x72da1e!==_0x853e77(0x1ed)&&_0x72da1e!==_0x853e77(0x1f1)),_0x4b6722=Math['max'](..._0xbfa834[_0x853e77(0x210)](([_0x61e5bb])=>_0x61e5bb[_0x853e77(0x1f9)])),_0x23fa5d=Math['max'](..._0xbfa834[_0x853e77(0x210)](([,_0x1b1049])=>{const _0x12fcad=_0x853e77;try{const _0x29dba9=_0x1b1049===null||_0x1b1049===undefined?'':typeof _0x1b1049==='object'?JSON[_0x12fcad(0x21a)](_0x1b1049):String(_0x1b1049),_0x10b4d9=_0x29dba9[_0x12fcad(0x211)]('\x0a');return Math['max'](..._0x10b4d9[_0x12fcad(0x210)](_0x5989f5=>_0x5989f5[_0x12fcad(0x1f9)]),0x0);}catch{return 0x0;}}),0x14),_0x2e81a0=[];_0x2e81a0['push'](colorBorder('┌─'+'─'['repeat'](_0x4b6722)+_0x853e77(0x223)+'─'['repeat'](_0x23fa5d)+'─┐',_0x43142b)),_0xbfa834[_0x853e77(0x1f7)](([_0x570ecf,_0x4fa4d1])=>{const _0x4f012a=_0x853e77;let _0x53dace;try{_0x53dace=_0x4fa4d1===null||_0x4fa4d1===undefined?'':typeof _0x4fa4d1===_0x4f012a(0x20e)?JSON[_0x4f012a(0x21a)](_0x4fa4d1):String(_0x4fa4d1);}catch{_0x53dace=_0x4f012a(0x1ee);}const _0x1b8dca=_0x570ecf[_0x4f012a(0x217)](_0x4b6722),_0x3df9a0=_0x53dace[_0x4f012a(0x211)]('\x0a');_0x3df9a0[_0x4f012a(0x1f7)]((_0x39dc57,_0x5a4c79)=>{const _0x27526f=_0x4f012a,_0x1b47b7=colorBorder('│',_0x43142b);_0x5a4c79===0x0?_0x2e81a0[_0x27526f(0x1ff)](_0x1b47b7+'\x20'+_0x1b8dca+'\x20'+_0x1b47b7+'\x20'+_0x39dc57['padEnd'](_0x23fa5d)+'\x20'+_0x1b47b7):_0x2e81a0[_0x27526f(0x1ff)](_0x1b47b7+'\x20'+'\x20'[_0x27526f(0x207)](_0x4b6722)+'\x20'+_0x1b47b7+'\x20'+_0x39dc57[_0x27526f(0x217)](_0x23fa5d)+'\x20'+_0x1b47b7);});}),_0x2e81a0[_0x853e77(0x1ff)](colorBorder('└─'+'─'['repeat'](_0x4b6722)+_0x853e77(0x21d)+'─'['repeat'](_0x23fa5d)+'─┘',_0x43142b));_0x9324c&&(_0x2e81a0['push'](''),_0x2e81a0[_0x853e77(0x1ff)](String(a61_0x53d639['yellow']['bold'](_0x853e77(0x1ea)))),_0x2e81a0[_0x853e77(0x1ff)](_0x9324c));if(_0x25449e){if(_0x25449e[_0x853e77(0x1fa)]){_0x2e81a0[_0x853e77(0x1ff)](''),_0x2e81a0[_0x853e77(0x1ff)](String(a61_0x53d639[_0x853e77(0x1ec)][_0x853e77(0x1fb)](_0x853e77(0x20a))));const _0x507f90=_0x25449e['stderr'][_0x853e77(0x211)]('\x0a');_0x507f90[_0x853e77(0x1f7)](_0xcefe09=>{const _0x29244c=_0x853e77;_0xcefe09[_0x29244c(0x1f4)]()&&_0x2e81a0[_0x29244c(0x1ff)](_0xcefe09);});}if(_0x25449e['cmdout']){_0x2e81a0[_0x853e77(0x1ff)](''),_0x2e81a0[_0x853e77(0x1ff)](String(a61_0x53d639[_0x853e77(0x1e5)][_0x853e77(0x1fb)](_0x853e77(0x21f))));const _0x5ca365=_0x25449e[_0x853e77(0x20b)][_0x853e77(0x211)]('\x0a');_0x5ca365[_0x853e77(0x1f7)](_0x3c5eed=>{const _0x400e7d=_0x853e77;_0x3c5eed[_0x400e7d(0x1f4)]()&&_0x2e81a0['push'](_0x3c5eed);});}}return _0x2e81a0[_0x853e77(0x1e6)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x32c5bd,_0x427369){const _0x124f78=a61_0x463c,_0x5a2b18=resolveOutputOptions(_0x427369),_0x4e3281=await formatSingleObject(_0x32c5bd,_0x5a2b18);await writeOutput(_0x4e3281,_0x5a2b18['output']||undefined,_0x5a2b18[_0x124f78(0x205)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x240b09,_0x583f36){const _0xdef83d=a62_0x4f71,_0x30b1de=_0x240b09();while(!![]){try{const _0x4db9c0=parseInt(_0xdef83d(0x198))/0x1+-parseInt(_0xdef83d(0x199))/0x2*(-parseInt(_0xdef83d(0x1a0))/0x3)+-parseInt(_0xdef83d(0x18d))/0x4+-parseInt(_0xdef83d(0x18e))/0x5*(parseInt(_0xdef83d(0x197))/0x6)+-parseInt(_0xdef83d(0x196))/0x7+parseInt(_0xdef83d(0x194))/0x8+parseInt(_0xdef83d(0x191))/0x9;if(_0x4db9c0===_0x583f36)break;else _0x30b1de['push'](_0x30b1de['shift']());}catch(_0x23bc2c){_0x30b1de['push'](_0x30b1de['shift']());}}}(a62_0x3cda,0xab9cf));function a62_0x4f71(_0xc38c17,_0x4b5b8a){const _0x3cda8e=a62_0x3cda();return a62_0x4f71=function(_0x4f710b,_0x58485a){_0x4f710b=_0x4f710b-0x18d;let _0x5ecbbc=_0x3cda8e[_0x4f710b];return _0x5ecbbc;},a62_0x4f71(_0xc38c17,_0x4b5b8a);}import*as a62_0x568a9d from'node:fs';import*as a62_0x265d87 from'node:path';export function setSecureFilePermissions(_0x43d1a9){const _0x7f990b=a62_0x4f71;try{a62_0x568a9d[_0x7f990b(0x19c)](_0x43d1a9,0x180);}catch{console[_0x7f990b(0x1a1)]('Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20'+_0x43d1a9);}}export function setSecureDirectoryPermissions(_0xf8d2f2){const _0xb1ec7c=a62_0x4f71;try{a62_0x568a9d[_0xb1ec7c(0x19c)](_0xf8d2f2,0x1c0);}catch{console[_0xb1ec7c(0x1a1)](_0xb1ec7c(0x190)+_0xf8d2f2);}}export function createSecureDirectory(_0x2369df){const _0x4e482b=a62_0x4f71;!a62_0x568a9d[_0x4e482b(0x18f)](_0x2369df)&&(a62_0x568a9d[_0x4e482b(0x19f)](_0x2369df,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x2369df));}export function validateSecureFilePermissions(_0x48d46e){const _0xb6b3fe=a62_0x4f71;try{const _0x134bad=a62_0x568a9d[_0xb6b3fe(0x193)](_0x48d46e),_0x6f09a1=_0x134bad[_0xb6b3fe(0x19e)]&0x1ff,_0x1e3a91=(_0x6f09a1&0x3f)!==0x0;if(_0x1e3a91)return console[_0xb6b3fe(0x1a1)](_0xb6b3fe(0x192)+_0x48d46e+'\x20has\x20insecure\x20permissions\x20('+_0x6f09a1[_0xb6b3fe(0x19a)](0x8)+_0xb6b3fe(0x19b)+_0xb6b3fe(0x195)),![];return!![];}catch{return!![];}}export function writeSecureFile(_0x1c0244,_0x4daa1f){const _0x188372=a62_0x4f71,_0x353960=a62_0x265d87['dirname'](_0x1c0244);createSecureDirectory(_0x353960),a62_0x568a9d[_0x188372(0x19d)](_0x1c0244,_0x4daa1f,{'mode':0x180}),setSecureFilePermissions(_0x1c0244);}function a62_0x3cda(){const _0xcba61d=['224736ClHZsD','2AqiyJL','toString',').\x20','chmodSync','writeFileSync','mode','mkdirSync','3883887WqCRWo','warn','5155560JCMvIt','262235hDGbzj','existsSync','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','6417594xaeLaw','Warning:\x20','statSync','2854368FjVAMq','Should\x20be\x200600\x20or\x20more\x20restrictive.','510580RVlNsr','60CnxLWK'];a62_0x3cda=function(){return _0xcba61d;};return a62_0x3cda();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a63_0x314e(){const _0x3b3b14=['411960EHaRKA','text','546460CHGNBY','185632QFjlJE','7DIDZWX','tsv','txt','472qghQak','10mGTyBo','442122rUzUWk','tab','split','table','json','jsonl','35703TRRaGM','76582fFVfNU','143632GOVFBi'];a63_0x314e=function(){return _0x3b3b14;};return a63_0x314e();}(function(_0x54949f,_0x90833a){const _0x24b49b=a63_0x1905,_0x1a12cc=_0x54949f();while(!![]){try{const _0x2b3211=-parseInt(_0x24b49b(0xaa))/0x1+parseInt(_0x24b49b(0xa9))/0x2+parseInt(_0x24b49b(0xab))/0x3+-parseInt(_0x24b49b(0xae))/0x4*(parseInt(_0x24b49b(0xb3))/0x5)+-parseInt(_0x24b49b(0xa2))/0x6*(parseInt(_0x24b49b(0xaf))/0x7)+-parseInt(_0x24b49b(0xb2))/0x8*(-parseInt(_0x24b49b(0xa8))/0x9)+parseInt(_0x24b49b(0xad))/0xa;if(_0x2b3211===_0x90833a)break;else _0x1a12cc['push'](_0x1a12cc['shift']());}catch(_0x21cead){_0x1a12cc['push'](_0x1a12cc['shift']());}}}(a63_0x314e,0x25a3f));export function detectFormatFromExtension(_0xb2dbbd){const _0x2b95f7=a63_0x1905,_0x12da30=_0xb2dbbd['toLowerCase']()[_0x2b95f7(0xa4)]('.')['pop']();switch(_0x12da30){case'json':return _0x2b95f7(0xa6);case _0x2b95f7(0xa7):return _0x2b95f7(0xa7);case _0x2b95f7(0xb0):case _0x2b95f7(0xa3):return _0x2b95f7(0xb0);case _0x2b95f7(0xb1):case _0x2b95f7(0xac):return _0x2b95f7(0xa5);default:return undefined;}}function a63_0x1905(_0x10d092,_0x570867){const _0x314e1c=a63_0x314e();return a63_0x1905=function(_0x190507,_0x574136){_0x190507=_0x190507-0xa2;let _0x42a1dd=_0x314e1c[_0x190507];return _0x42a1dd;},a63_0x1905(_0x10d092,_0x570867);}export function resolveOutputFormat(_0x39ea2e,_0x40d08f,_0x45075a){if(_0x39ea2e)return _0x39ea2e;if(_0x40d08f){const _0x3ac102=detectFormatFromExtension(_0x40d08f);if(_0x3ac102)return _0x3ac102;}return _0x45075a;}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x13e094,_0x5f5aa2){const _0x4b2a36=a64_0x3647,_0xc488fc=_0x13e094();while(!![]){try{const _0x449fad=-parseInt(_0x4b2a36(0xbb))/0x1+-parseInt(_0x4b2a36(0xc9))/0x2*(-parseInt(_0x4b2a36(0xb2))/0x3)+parseInt(_0x4b2a36(0xc2))/0x4+-parseInt(_0x4b2a36(0xaa))/0x5+-parseInt(_0x4b2a36(0xc8))/0x6+-parseInt(_0x4b2a36(0xa9))/0x7+parseInt(_0x4b2a36(0xd0))/0x8;if(_0x449fad===_0x5f5aa2)break;else _0xc488fc['push'](_0xc488fc['shift']());}catch(_0xa29f49){_0xc488fc['push'](_0xc488fc['shift']());}}}(a64_0xc488,0xb9f66));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x16c2dd=a64_0x3647;return process[_0x16c2dd(0xb6)]['columns']||Infinity;}export function formatAsTable(_0x46992b,_0x136569=DEFAULT_MAX_DISPLAY_ROWS,_0x3c5bae=![],_0x120bbb={}){const _0x25242e=a64_0x3647;if(_0x46992b[_0x25242e(0xa5)][_0x25242e(0xd5)]===0x0)return _0x25242e(0xc6);const _0x43ed3f=_0x46992b['columns'][_0x25242e(0xa6)](_0x4cd254=>_0x4cd254['name']),_0xe99021=_0x46992b['columns'][_0x25242e(0xa6)](_0x575fa9=>simplifyType(_0x575fa9[_0x25242e(0xc0)])),_0xfd3421=_0x46992b[_0x25242e(0xa5)][_0x25242e(0xb9)](0x0,_0x136569),_0x24fe11=_0x46992b[_0x25242e(0xa5)][_0x25242e(0xd5)],_0x59c175=_0x24fe11>_0x136569,_0x4c40c4=[],_0x1219df=getTerminalWidth(),_0x173480=_0x1219df!==Infinity,_0x26167d=0x32;let _0x10bd7f=_0x43ed3f['map']((_0x9c8e79,_0x325bfc)=>{const _0x4dc326=_0x25242e,_0x1c0937=stringWidth(_0xe99021[_0x325bfc]),_0x132b66=Math[_0x4dc326(0xae)](..._0xfd3421[_0x4dc326(0xa6)](_0x436123=>{const _0x59f5c0=_0x436123[_0x9c8e79];return stringWidth(formatValue(_0x59f5c0));})),_0x2d025b=Math[_0x4dc326(0xae)](stringWidth(_0x9c8e79),_0x1c0937,_0x132b66);return _0x3c5bae?_0x2d025b:Math[_0x4dc326(0xc5)](_0x2d025b,_0x26167d);});if(_0x173480&&!_0x3c5bae&&_0x43ed3f[_0x25242e(0xd5)]>0x0){const _0x23bc1d=_0x521cea=>{let _0x24798e=0x1;for(const _0x63dac3 of _0x521cea){_0x24798e+=_0x63dac3+0x3;}return _0x24798e+0x1;};let _0x44012e=_0x23bc1d(_0x10bd7f);if(_0x44012e>_0x1219df){const _0x2a9f45=0x3;for(let _0x165dc2=_0x10bd7f[_0x25242e(0xd5)]-0x1;_0x165dc2>=0x0;_0x165dc2--){_0x44012e=_0x23bc1d(_0x10bd7f);if(_0x44012e<=_0x1219df)break;const _0x4775ae=_0x10bd7f[_0x165dc2],_0x28ac34=_0x44012e-_0x1219df,_0x129984=_0x4775ae-_0x2a9f45,_0x1a1f92=Math[_0x25242e(0xc5)](_0x28ac34,_0x129984);_0x1a1f92>0x0&&(_0x10bd7f[_0x165dc2]=_0x4775ae-_0x1a1f92);}}}const _0x1ef2b2=_0x43ed3f,_0x4841aa=_0xe99021,_0x879344=_0x10bd7f,_0x53ee8e=_0x10bd7f;_0x4c40c4[_0x25242e(0xb7)](colorBorder('┌'+_0x53ee8e[_0x25242e(0xa6)](_0x262300=>'─'['repeat'](_0x262300+0x2))[_0x25242e(0xa7)]('┬')+'┐',_0x120bbb));const _0x1cca48=_0x1ef2b2['map']((_0x5ac5e3,_0x2cf12e)=>centerAlign(_0x5ac5e3,_0x879344[_0x2cf12e]));_0x4c40c4['push'](colorBorder('│',_0x120bbb)+'\x20'+_0x1cca48[_0x25242e(0xa7)]('\x20'+colorBorder('│',_0x120bbb)+'\x20')+'\x20'+colorBorder('│',_0x120bbb));const _0x16f141=_0x4841aa[_0x25242e(0xa6)]((_0x1c7aa4,_0xf9466f)=>colorType(centerAlign(_0x1c7aa4,_0x879344[_0xf9466f]),_0x120bbb));_0x4c40c4[_0x25242e(0xb7)](colorBorder('│',_0x120bbb)+'\x20'+_0x16f141[_0x25242e(0xa7)]('\x20'+colorBorder('│',_0x120bbb)+'\x20')+'\x20'+colorBorder('│',_0x120bbb)),_0x4c40c4[_0x25242e(0xb7)](colorBorder('├'+_0x53ee8e[_0x25242e(0xa6)](_0x313a7b=>'─'['repeat'](_0x313a7b+0x2))[_0x25242e(0xa7)]('┼')+'┤',_0x120bbb));const _0x130666=(_0x3e4bcf,_0x1b0e27)=>{const _0x47c325=_0x25242e,_0x466ada=stringWidth(_0x3e4bcf);if(_0x466ada<=_0x1b0e27)return _0x3e4bcf;let _0x12060e=_0x3e4bcf;while(stringWidth(_0x12060e+'…')>_0x1b0e27&&_0x12060e[_0x47c325(0xd5)]>0x0){_0x12060e=_0x12060e['slice'](0x0,-0x1);}return _0x12060e+'…';};_0xfd3421['forEach'](_0x4edec8=>{const _0x5dbf01=_0x25242e,_0x20d8b1=_0x43ed3f[_0x5dbf01(0xa6)]((_0x1352f7,_0x2bcfc5)=>{const _0x1ce371=_0x5dbf01,_0x38f600=_0x4edec8[_0x1352f7],_0x3e74b6=formatValue(_0x38f600),_0x232fb2=_0x879344[_0x2bcfc5],_0x4354eb=_0x130666(_0x3e74b6,_0x232fb2),_0x509aa2=typeof _0x38f600==='number'||typeof _0x38f600===_0x1ce371(0xba)&&/^-?\d+$/[_0x1ce371(0xad)](_0x38f600);return _0x509aa2?padStart(_0x4354eb,_0x232fb2):padEnd(_0x4354eb,_0x232fb2);});_0x4c40c4[_0x5dbf01(0xb7)](colorBorder('│',_0x120bbb)+'\x20'+_0x20d8b1[_0x5dbf01(0xa7)]('\x20'+colorBorder('│',_0x120bbb)+'\x20')+'\x20'+colorBorder('│',_0x120bbb));});const _0x5d33ad=_0x53ee8e[_0x25242e(0xca)]((_0x5b2972,_0x1c1180)=>_0x5b2972+_0x1c1180+0x3,-0x1);_0x4c40c4[_0x25242e(0xb7)](colorBorder('├'+_0x53ee8e['map'](_0x1bea3b=>'─'[_0x25242e(0xcb)](_0x1bea3b+0x2))[_0x25242e(0xa7)]('┴')+'┤',_0x120bbb));let _0x2e7eeb;_0x59c175?_0x2e7eeb=_0x24fe11+_0x25242e(0xd4)+_0x136569+_0x25242e(0xab):_0x2e7eeb=_0x24fe11+_0x25242e(0xc3)+(_0x24fe11===0x1?'':'s');const _0x168d3e=_0x2e7eeb[_0x25242e(0xb1)](_0x5d33ad-0x2);return _0x4c40c4[_0x25242e(0xb7)](colorBorder('│',_0x120bbb)+'\x20'+_0x168d3e+'\x20'+colorBorder('│',_0x120bbb)),_0x4c40c4['push'](colorBorder('└'+'─'[_0x25242e(0xcb)](_0x5d33ad)+'┘',_0x120bbb)),_0x4c40c4[_0x25242e(0xa7)]('\x0a');}function simplifyType(_0x274eb3){const _0x15f901=a64_0x3647,_0x383abe={'varchar':_0x15f901(0xba),'bigint':_0x15f901(0xc1),'integer':_0x15f901(0xb3),'double':_0x15f901(0xbc),'boolean':'bool','date':_0x15f901(0xaf),'timestamp':_0x15f901(0xbd),'array':_0x15f901(0xa8),'map':_0x15f901(0xa6),'row':_0x15f901(0xd7)},_0x23a441=_0x274eb3['toLowerCase']();for(const [_0x3061e3,_0x162dce]of Object[_0x15f901(0xd3)](_0x383abe)){if(_0x23a441['startsWith'](_0x3061e3))return _0x162dce;}return _0x274eb3['length']>0xa?_0x274eb3[_0x15f901(0xce)](0x0,0xa):_0x274eb3;}export function formatAsJSON(_0x361c02,_0x559437={}){const _0x54f7ef=a64_0x3647;if(_0x361c02[_0x54f7ef(0xa5)]['length']===0x0)return'[]';if(shouldUseColor(_0x559437))return colorizeJSON(_0x361c02['data'],_0x559437);const _0x2e2115=_0x361c02[_0x54f7ef(0xa5)][_0x54f7ef(0xa6)](_0x27eee9=>'\x20\x20'+JSON[_0x54f7ef(0xc7)](_0x27eee9));return'[\x0a'+_0x2e2115['join'](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x16f767,_0x2f6510={}){const _0x1a3c8e=a64_0x3647;if(_0x16f767['data'][_0x1a3c8e(0xd5)]===0x0)return'';if(shouldUseColor(_0x2f6510))return _0x16f767[_0x1a3c8e(0xa5)][_0x1a3c8e(0xa6)](_0x11cb8e=>colorizeJSONCompact(_0x11cb8e,_0x2f6510))['join']('\x0a');return _0x16f767[_0x1a3c8e(0xa5)][_0x1a3c8e(0xa6)](_0x4db5f6=>JSON[_0x1a3c8e(0xc7)](_0x4db5f6))[_0x1a3c8e(0xa7)]('\x0a');}export function formatAsTSV(_0x555110){const _0x11c1bc=a64_0x3647;if(_0x555110[_0x11c1bc(0xa5)][_0x11c1bc(0xd5)]===0x0)return'';const _0x457aaa=[],_0x2358ee=_0x555110['columns']['map'](_0x1cfc49=>_0x1cfc49['name']);return _0x457aaa[_0x11c1bc(0xb7)](_0x2358ee[_0x11c1bc(0xa7)]('\x09')),_0x555110[_0x11c1bc(0xa5)][_0x11c1bc(0xac)](_0x2984a1=>{const _0x121338=_0x11c1bc,_0x4491f3=_0x2358ee[_0x121338(0xa6)](_0x41464e=>{const _0x4ed8db=_0x2984a1[_0x41464e];return formatValueForTSV(_0x4ed8db);});_0x457aaa[_0x121338(0xb7)](_0x4491f3[_0x121338(0xa7)]('\x09'));}),_0x457aaa[_0x11c1bc(0xa7)]('\x0a');}function formatValue(_0x265ac1){const _0x48a83a=a64_0x3647;if(_0x265ac1===null||_0x265ac1===undefined)return'';if(typeof _0x265ac1===_0x48a83a(0xba)){const _0x39e1d3=_0x265ac1[_0x48a83a(0xcd)](/\n/g,'\x5cn')[_0x48a83a(0xcd)](/\r/g,'\x5cr')[_0x48a83a(0xcd)](/\t/g,'\x5ct');return _0x39e1d3;}if(typeof _0x265ac1===_0x48a83a(0xd6))return String(_0x265ac1);if(typeof _0x265ac1==='boolean')return _0x265ac1?'true':'false';if(_0x265ac1 instanceof Date)return _0x265ac1[_0x48a83a(0xbf)]();if(typeof _0x265ac1===_0x48a83a(0xb5))return JSON['stringify'](_0x265ac1);return String(_0x265ac1);}function formatValueForTSV(_0x1d335e){const _0x5bf04e=a64_0x3647;if(_0x1d335e===null||_0x1d335e===undefined)return'';if(typeof _0x1d335e===_0x5bf04e(0xba))return _0x1d335e[_0x5bf04e(0xcd)](/\t/g,'\x5ct')[_0x5bf04e(0xcd)](/\n/g,'\x5cn');if(typeof _0x1d335e==='number'||typeof _0x1d335e===_0x5bf04e(0xd1))return String(_0x1d335e);if(_0x1d335e instanceof Date)return _0x1d335e[_0x5bf04e(0xbf)]();if(typeof _0x1d335e===_0x5bf04e(0xb5))return JSON[_0x5bf04e(0xc7)](_0x1d335e);return String(_0x1d335e);}export function formatQueryResult(_0x2e251c,_0x5e3b11){const _0x3e4fba=a64_0x3647;switch(_0x5e3b11){case _0x3e4fba(0xcf):return formatAsTable(_0x2e251c);case _0x3e4fba(0xb8):return formatAsJSON(_0x2e251c);case _0x3e4fba(0xcc):return formatAsJSONL(_0x2e251c);case _0x3e4fba(0xc4):return formatAsTSV(_0x2e251c);default:return formatAsJSON(_0x2e251c);}}function a64_0x3647(_0x1dfa4e,_0x2280db){const _0xc48878=a64_0xc488();return a64_0x3647=function(_0x3647f3,_0x4e1e3f){_0x3647f3=_0x3647f3-0xa5;let _0x391b3a=_0xc48878[_0x3647f3];return _0x391b3a;},a64_0x3647(_0x1dfa4e,_0x2280db);}function a64_0xc488(){const _0xe8231b=['test','max','date','floor','padEnd','7131eoQEXR','int','log','object','stdout','push','json','slice','string','796994ELczCi','double','timestamp','toFixed','toISOString','type','long','2074684guXgqD','\x20row','tsv','min','No\x20rows\x20returned','stringify','454320FifBZc','874cbDkxQ','reduce','repeat','jsonl','replace','substring','table','12782288GKvZfU','boolean','pow','entries','\x20rows\x20(','length','number','row','data','map','join','array','696087YpsybE','7106745hggQqm','\x20shown)','forEach'];a64_0xc488=function(){return _0xe8231b;};return a64_0xc488();}export function formatBytes(_0x485681){const _0x15425a=a64_0x3647;if(_0x485681===0x0)return'0\x20B';const _0x3bc586=['B','KB','MB','GB','TB'],_0x8b5ce=0x400,_0x2c69d3=Math['floor'](Math['log'](_0x485681)/Math[_0x15425a(0xb4)](_0x8b5ce)),_0x27aa93=_0x485681/Math['pow'](_0x8b5ce,_0x2c69d3),_0xbcd3a6=_0x27aa93>=0xa?0x1:0x2;return _0x27aa93[_0x15425a(0xbe)](_0xbcd3a6)+'\x20'+_0x3bc586[_0x2c69d3];}export function formatRows(_0xf90cf8){const _0x1965f6=a64_0x3647;if(_0xf90cf8==null)return'-';if(_0xf90cf8===0x0)return'0';if(_0xf90cf8<0x3e8)return _0xf90cf8['toString']();const _0x4fa2bd=['','K','M','B','T'],_0x6b08cc=0x3e8,_0x56b01b=Math[_0x1965f6(0xb0)](Math[_0x1965f6(0xb4)](_0xf90cf8)/Math[_0x1965f6(0xb4)](_0x6b08cc)),_0x6ffe5f=_0xf90cf8/Math[_0x1965f6(0xd2)](_0x6b08cc,_0x56b01b),_0x484219=_0x6ffe5f>=0xa?0x1:0x2;return''+_0x6ffe5f[_0x1965f6(0xbe)](_0x484219)+_0x4fa2bd[_0x56b01b];}
|
|
1
|
+
(function(_0x41deaa,_0x387c4a){const _0x3233d0=a64_0x3cce,_0x4b66fc=_0x41deaa();while(!![]){try{const _0x12b081=-parseInt(_0x3233d0(0xd2))/0x1+parseInt(_0x3233d0(0xb9))/0x2*(parseInt(_0x3233d0(0xe3))/0x3)+-parseInt(_0x3233d0(0xbc))/0x4+-parseInt(_0x3233d0(0xc2))/0x5*(parseInt(_0x3233d0(0xd8))/0x6)+-parseInt(_0x3233d0(0xd0))/0x7+-parseInt(_0x3233d0(0xcc))/0x8*(parseInt(_0x3233d0(0xdb))/0x9)+parseInt(_0x3233d0(0xb3))/0xa;if(_0x12b081===_0x387c4a)break;else _0x4b66fc['push'](_0x4b66fc['shift']());}catch(_0x3d7267){_0x4b66fc['push'](_0x4b66fc['shift']());}}}(a64_0x1823,0xafe7f));function a64_0x1823(){const _0x26f270=['18927HZeAbE','log','columns','join','double','string','startsWith','stdout','3543exPDIy','replace','int','row','jsonl','push','\x20rows\x20(','43820410lJpYvG','table','array','toFixed','repeat','max','2026nMdpBY','json','false','1248480euZjlF','toISOString','\x20shown)','slice','object','min','5eZJvDP','floor','name','map','entries','forEach','padEnd','toString','tsv','boolean','2648LahZQx','type','reduce','true','7118076jfthYF','number','1399305AkrwBi','stringify','pow','date','length','data','8600982COojls','test','timestamp'];a64_0x1823=function(){return _0x26f270;};return a64_0x1823();}import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';function a64_0x3cce(_0x12f683,_0x250d7f){const _0x1823ed=a64_0x1823();return a64_0x3cce=function(_0x3cce3c,_0x25e274){_0x3cce3c=_0x3cce3c-0xb0;let _0x244a4f=_0x1823ed[_0x3cce3c];return _0x244a4f;},a64_0x3cce(_0x12f683,_0x250d7f);}const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x4e3d35=a64_0x3cce;return process[_0x4e3d35(0xe2)][_0x4e3d35(0xdd)]||Infinity;}export function formatAsTable(_0x1ec80a,_0x52d8bd=DEFAULT_MAX_DISPLAY_ROWS,_0x1e9a48=![],_0x1abba9={}){const _0x1e3262=a64_0x3cce;if(_0x1ec80a[_0x1e3262(0xd7)][_0x1e3262(0xd6)]===0x0)return'No\x20rows\x20returned';const _0xcde938=_0x1ec80a['columns'][_0x1e3262(0xc5)](_0x21375d=>_0x21375d['name']),_0x2bdf21=_0x1ec80a[_0x1e3262(0xdd)]['map'](_0x2ec669=>simplifyType(_0x2ec669[_0x1e3262(0xcd)])),_0x48a004=_0x1ec80a['data']['slice'](0x0,_0x52d8bd),_0x522a88=_0x1ec80a[_0x1e3262(0xd7)][_0x1e3262(0xd6)],_0xf854e4=_0x522a88>_0x52d8bd,_0x108ae9=[],_0x1e708a=getTerminalWidth(),_0x5232f3=_0x1e708a!==Infinity,_0x2b1739=0x32;let _0x23554b=_0xcde938[_0x1e3262(0xc5)]((_0x2ba646,_0x17e2a9)=>{const _0x30adf7=_0x1e3262,_0x105454=stringWidth(_0x2bdf21[_0x17e2a9]),_0x1a3935=Math[_0x30adf7(0xb8)](..._0x48a004['map'](_0x151a6d=>{const _0x22f8d1=_0x151a6d[_0x2ba646];return stringWidth(formatValue(_0x22f8d1));})),_0x16a155=Math[_0x30adf7(0xb8)](stringWidth(_0x2ba646),_0x105454,_0x1a3935);return _0x1e9a48?_0x16a155:Math['min'](_0x16a155,_0x2b1739);});if(_0x5232f3&&!_0x1e9a48&&_0xcde938[_0x1e3262(0xd6)]>0x0){const _0x1d8c57=_0x1473d7=>{let _0x35acfd=0x1;for(const _0x266195 of _0x1473d7){_0x35acfd+=_0x266195+0x3;}return _0x35acfd+0x1;};let _0x512847=_0x1d8c57(_0x23554b);if(_0x512847>_0x1e708a){const _0x56915b=0x3;for(let _0x327721=_0x23554b['length']-0x1;_0x327721>=0x0;_0x327721--){_0x512847=_0x1d8c57(_0x23554b);if(_0x512847<=_0x1e708a)break;const _0x2a36e0=_0x23554b[_0x327721],_0x5b10a9=_0x512847-_0x1e708a,_0x2b060f=_0x2a36e0-_0x56915b,_0x31bc25=Math[_0x1e3262(0xc1)](_0x5b10a9,_0x2b060f);_0x31bc25>0x0&&(_0x23554b[_0x327721]=_0x2a36e0-_0x31bc25);}}}const _0x317ed6=_0xcde938,_0x3459d4=_0x2bdf21,_0x3be1ae=_0x23554b,_0x51ecf6=_0x23554b;_0x108ae9[_0x1e3262(0xb1)](colorBorder('┌'+_0x51ecf6['map'](_0x48e550=>'─'[_0x1e3262(0xb7)](_0x48e550+0x2))['join']('┬')+'┐',_0x1abba9));const _0x3eb5b8=_0x317ed6[_0x1e3262(0xc5)]((_0x910e7c,_0x4a01c9)=>centerAlign(_0x910e7c,_0x3be1ae[_0x4a01c9]));_0x108ae9[_0x1e3262(0xb1)](colorBorder('│',_0x1abba9)+'\x20'+_0x3eb5b8[_0x1e3262(0xde)]('\x20'+colorBorder('│',_0x1abba9)+'\x20')+'\x20'+colorBorder('│',_0x1abba9));const _0x3a0144=_0x3459d4[_0x1e3262(0xc5)]((_0x524991,_0x4c61cd)=>colorType(centerAlign(_0x524991,_0x3be1ae[_0x4c61cd]),_0x1abba9));_0x108ae9[_0x1e3262(0xb1)](colorBorder('│',_0x1abba9)+'\x20'+_0x3a0144['join']('\x20'+colorBorder('│',_0x1abba9)+'\x20')+'\x20'+colorBorder('│',_0x1abba9)),_0x108ae9['push'](colorBorder('├'+_0x51ecf6[_0x1e3262(0xc5)](_0x398e63=>'─'['repeat'](_0x398e63+0x2))[_0x1e3262(0xde)]('┼')+'┤',_0x1abba9));const _0x86c9c=(_0x423b63,_0x1b2a1b)=>{const _0x209937=_0x1e3262,_0x183fd9=stringWidth(_0x423b63);if(_0x183fd9<=_0x1b2a1b)return _0x423b63;let _0xda5ed0=_0x423b63;while(stringWidth(_0xda5ed0+'…')>_0x1b2a1b&&_0xda5ed0[_0x209937(0xd6)]>0x0){_0xda5ed0=_0xda5ed0[_0x209937(0xbf)](0x0,-0x1);}return _0xda5ed0+'…';};_0x48a004['forEach'](_0x1bf979=>{const _0x6242b4=_0x1e3262,_0x1d46cb=_0xcde938[_0x6242b4(0xc5)]((_0x27b9a1,_0x31d6ee)=>{const _0x488c52=_0x6242b4,_0x22419c=_0x1bf979[_0x27b9a1],_0x4a745c=formatValue(_0x22419c),_0x283f0f=_0x3be1ae[_0x31d6ee],_0x45b287=_0x86c9c(_0x4a745c,_0x283f0f),_0x14e98b=typeof _0x22419c===_0x488c52(0xd1)||typeof _0x22419c===_0x488c52(0xe0)&&/^-?\d+$/[_0x488c52(0xd9)](_0x22419c);return _0x14e98b?padStart(_0x45b287,_0x283f0f):padEnd(_0x45b287,_0x283f0f);});_0x108ae9[_0x6242b4(0xb1)](colorBorder('│',_0x1abba9)+'\x20'+_0x1d46cb[_0x6242b4(0xde)]('\x20'+colorBorder('│',_0x1abba9)+'\x20')+'\x20'+colorBorder('│',_0x1abba9));});const _0x45e862=_0x51ecf6[_0x1e3262(0xce)]((_0x115e49,_0x902d3d)=>_0x115e49+_0x902d3d+0x3,-0x1);_0x108ae9[_0x1e3262(0xb1)](colorBorder('├'+_0x51ecf6['map'](_0x516405=>'─'[_0x1e3262(0xb7)](_0x516405+0x2))[_0x1e3262(0xde)]('┴')+'┤',_0x1abba9));let _0x59e4e3;_0xf854e4?_0x59e4e3=_0x522a88+_0x1e3262(0xb2)+_0x52d8bd+_0x1e3262(0xbe):_0x59e4e3=_0x522a88+'\x20row'+(_0x522a88===0x1?'':'s');const _0x57a955=_0x59e4e3[_0x1e3262(0xc8)](_0x45e862-0x2);return _0x108ae9[_0x1e3262(0xb1)](colorBorder('│',_0x1abba9)+'\x20'+_0x57a955+'\x20'+colorBorder('│',_0x1abba9)),_0x108ae9[_0x1e3262(0xb1)](colorBorder('└'+'─'[_0x1e3262(0xb7)](_0x45e862)+'┘',_0x1abba9)),_0x108ae9['join']('\x0a');}function simplifyType(_0x4a5cf7){const _0x55a141=a64_0x3cce,_0x1e32a3={'varchar':_0x55a141(0xe0),'bigint':'long','integer':_0x55a141(0xe5),'double':_0x55a141(0xdf),'boolean':'bool','date':_0x55a141(0xd5),'timestamp':_0x55a141(0xda),'array':_0x55a141(0xb5),'map':_0x55a141(0xc5),'row':_0x55a141(0xe6)},_0xca7aa1=_0x4a5cf7['toLowerCase']();for(const [_0x2b62b9,_0x22fb32]of Object[_0x55a141(0xc6)](_0x1e32a3)){if(_0xca7aa1[_0x55a141(0xe1)](_0x2b62b9))return _0x22fb32;}return _0x4a5cf7['length']>0xa?_0x4a5cf7['substring'](0x0,0xa):_0x4a5cf7;}export function formatAsJSON(_0xfc230f,_0x4df240={}){const _0x1a11d6=a64_0x3cce;if(_0xfc230f['data'][_0x1a11d6(0xd6)]===0x0)return'[]';if(shouldUseColor(_0x4df240))return colorizeJSON(_0xfc230f[_0x1a11d6(0xd7)],_0x4df240);const _0x4c85f0=_0xfc230f['data']['map'](_0x14e800=>'\x20\x20'+JSON[_0x1a11d6(0xd3)](_0x14e800));return'[\x0a'+_0x4c85f0[_0x1a11d6(0xde)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x16fa75,_0x334623={}){const _0x5cad55=a64_0x3cce;if(_0x16fa75['data'][_0x5cad55(0xd6)]===0x0)return'';if(shouldUseColor(_0x334623))return _0x16fa75[_0x5cad55(0xd7)][_0x5cad55(0xc5)](_0x4975f5=>colorizeJSONCompact(_0x4975f5,_0x334623))[_0x5cad55(0xde)]('\x0a');return _0x16fa75[_0x5cad55(0xd7)][_0x5cad55(0xc5)](_0x4af8cc=>JSON[_0x5cad55(0xd3)](_0x4af8cc))[_0x5cad55(0xde)]('\x0a');}export function formatAsTSV(_0xe2780b){const _0x270106=a64_0x3cce;if(_0xe2780b[_0x270106(0xd7)][_0x270106(0xd6)]===0x0)return'';const _0xf08c90=[],_0x543003=_0xe2780b[_0x270106(0xdd)]['map'](_0x2b3131=>_0x2b3131[_0x270106(0xc4)]);return _0xf08c90[_0x270106(0xb1)](_0x543003[_0x270106(0xde)]('\x09')),_0xe2780b['data'][_0x270106(0xc7)](_0x3af789=>{const _0x34853c=_0x270106,_0x33a976=_0x543003[_0x34853c(0xc5)](_0xb3b4d=>{const _0x5e2fb9=_0x3af789[_0xb3b4d];return formatValueForTSV(_0x5e2fb9);});_0xf08c90[_0x34853c(0xb1)](_0x33a976[_0x34853c(0xde)]('\x09'));}),_0xf08c90[_0x270106(0xde)]('\x0a');}function formatValue(_0xb6a22d){const _0x481032=a64_0x3cce;if(_0xb6a22d===null||_0xb6a22d===undefined)return'';if(typeof _0xb6a22d===_0x481032(0xe0)){const _0x4bb83c=_0xb6a22d[_0x481032(0xe4)](/\n/g,'\x5cn')[_0x481032(0xe4)](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x4bb83c;}if(typeof _0xb6a22d===_0x481032(0xd1))return String(_0xb6a22d);if(typeof _0xb6a22d===_0x481032(0xcb))return _0xb6a22d?_0x481032(0xcf):_0x481032(0xbb);if(_0xb6a22d instanceof Date)return _0xb6a22d[_0x481032(0xbd)]();if(typeof _0xb6a22d===_0x481032(0xc0))return JSON['stringify'](_0xb6a22d);return String(_0xb6a22d);}function formatValueForTSV(_0x51f585){const _0x20c541=a64_0x3cce;if(_0x51f585===null||_0x51f585===undefined)return'';if(typeof _0x51f585===_0x20c541(0xe0))return _0x51f585['replace'](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x51f585==='number'||typeof _0x51f585===_0x20c541(0xcb))return String(_0x51f585);if(_0x51f585 instanceof Date)return _0x51f585[_0x20c541(0xbd)]();if(typeof _0x51f585===_0x20c541(0xc0))return JSON[_0x20c541(0xd3)](_0x51f585);return String(_0x51f585);}export function formatQueryResult(_0xa649b6,_0x297702){const _0x4e6fb4=a64_0x3cce;switch(_0x297702){case _0x4e6fb4(0xb4):return formatAsTable(_0xa649b6);case _0x4e6fb4(0xba):return formatAsJSON(_0xa649b6);case _0x4e6fb4(0xb0):return formatAsJSONL(_0xa649b6);case _0x4e6fb4(0xca):return formatAsTSV(_0xa649b6);default:return formatAsJSON(_0xa649b6);}}export function formatBytes(_0x31ca7e){const _0x20ce43=a64_0x3cce;if(_0x31ca7e===0x0)return'0\x20B';const _0x472fe6=['B','KB','MB','GB','TB'],_0x36295a=0x400,_0xbe94d5=Math[_0x20ce43(0xc3)](Math[_0x20ce43(0xdc)](_0x31ca7e)/Math[_0x20ce43(0xdc)](_0x36295a)),_0x5b2e88=_0x31ca7e/Math['pow'](_0x36295a,_0xbe94d5),_0x2dffcd=_0x5b2e88>=0xa?0x1:0x2;return _0x5b2e88[_0x20ce43(0xb6)](_0x2dffcd)+'\x20'+_0x472fe6[_0xbe94d5];}export function formatRows(_0x5cdc38){const _0x3045ec=a64_0x3cce;if(_0x5cdc38==null)return'-';if(_0x5cdc38===0x0)return'0';if(_0x5cdc38<0x3e8)return _0x5cdc38[_0x3045ec(0xc9)]();const _0x75b327=['','K','M','B','T'],_0x4de839=0x3e8,_0x4ad9e3=Math['floor'](Math[_0x3045ec(0xdc)](_0x5cdc38)/Math[_0x3045ec(0xdc)](_0x4de839)),_0x50308c=_0x5cdc38/Math[_0x3045ec(0xd4)](_0x4de839,_0x4ad9e3),_0x3a2413=_0x50308c>=0xa?0x1:0x2;return''+_0x50308c[_0x3045ec(0xb6)](_0x3a2413)+_0x75b327[_0x4ad9e3];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3024c2,_0xbd231){const _0x3476fc=a65_0x5c16,_0x34649f=_0x3024c2();while(!![]){try{const _0x151c8f=parseInt(_0x3476fc(0x11a))/0x1+parseInt(_0x3476fc(0x115))/0x2+parseInt(_0x3476fc(0x119))/0x3*(parseInt(_0x3476fc(0x11c))/0x4)+parseInt(_0x3476fc(0x117))/0x5+-parseInt(_0x3476fc(0x11d))/0x6+parseInt(_0x3476fc(0x123))/0x7*(-parseInt(_0x3476fc(0x12a))/0x8)+-parseInt(_0x3476fc(0x127))/0x9;if(_0x151c8f===_0xbd231)break;else _0x34649f['push'](_0x34649f['shift']());}catch(_0x42bcd4){_0x34649f['push'](_0x34649f['shift']());}}}(a65_0x1ef4,0xe30b5));import{readFile}from'fs/promises';import{SDKError,ErrorCode}from'../sdk/errors.js';function a65_0x1ef4(){const _0x29c30d=['Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.','1382715sYUOnh','1634984vZWqeK','message','12mBuihX','8646834mvGgKE','NOT_FOUND','Failed\x20to\x20load\x20JSON:\x20','\x27:\x20','Invalid\x20JSON\x20in\x20file\x20\x27','PERMISSION_DENIED','1260OzoujV','parse','code','Invalid\x20JSON\x20string:\x20','24410151LFenOo','EACCES','INVALID_ARGUMENT','5440oDyIlZ','utf-8','INTERNAL','2334018UzQEdh','ENOENT','5105215OEmsZB'];a65_0x1ef4=function(){return _0x29c30d;};return a65_0x1ef4();}function a65_0x5c16(_0x207a47,_0xa65516){const _0x1ef4f3=a65_0x1ef4();return a65_0x5c16=function(_0x5c1610,_0x53338c){_0x5c1610=_0x5c1610-0x114;let _0x4c7669=_0x1ef4f3[_0x5c1610];return _0x4c7669;},a65_0x5c16(_0x207a47,_0xa65516);}export async function loadJSON(_0x10ae4a,_0x495470){const _0x5307b2=a65_0x5c16;try{if(_0x495470){const _0x41f7d1=await readFile(_0x10ae4a,_0x5307b2(0x12b));try{return JSON[_0x5307b2(0x124)](_0x41f7d1);}catch(_0x31ea1f){throw new SDKError(ErrorCode[_0x5307b2(0x129)],_0x5307b2(0x121)+_0x10ae4a+_0x5307b2(0x120)+(_0x31ea1f instanceof Error?_0x31ea1f[_0x5307b2(0x11b)]:String(_0x31ea1f)));}}else try{return JSON[_0x5307b2(0x124)](_0x10ae4a);}catch(_0xc16d29){throw new SDKError(ErrorCode[_0x5307b2(0x129)],_0x5307b2(0x126)+(_0xc16d29 instanceof Error?_0xc16d29[_0x5307b2(0x11b)]:String(_0xc16d29)));}}catch(_0x36cc5b){if(_0x36cc5b instanceof SDKError)throw _0x36cc5b;if(_0x36cc5b instanceof Error&&_0x5307b2(0x125)in _0x36cc5b){const _0x591265=_0x36cc5b;if(_0x591265[_0x5307b2(0x125)]===_0x5307b2(0x116))throw new SDKError(ErrorCode[_0x5307b2(0x11e)],'File\x20not\x20found:\x20'+_0x10ae4a);else{if(_0x591265['code']===_0x5307b2(0x128))throw new SDKError(ErrorCode[_0x5307b2(0x122)],'Permission\x20denied\x20reading\x20file:\x20'+_0x10ae4a);}}throw new SDKError(ErrorCode[_0x5307b2(0x114)],_0x5307b2(0x11f)+(_0x36cc5b instanceof Error?_0x36cc5b[_0x5307b2(0x11b)]:String(_0x36cc5b)));}}export async function loadJSONFromOptions(_0x55e8ad,_0x41ae74){const _0x4d82cd=a65_0x5c16;if(_0x55e8ad&&_0x41ae74)throw new SDKError(ErrorCode[_0x4d82cd(0x129)],_0x4d82cd(0x118));if(_0x55e8ad)return await loadJSON(_0x55e8ad,![]);if(_0x41ae74)return await loadJSON(_0x41ae74,!![]);return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x4a825b=a66_0x2844;(function(_0x49a7cb,_0x3654d0){const _0x1b531f=a66_0x2844,_0x1fd4a3=_0x49a7cb();while(!![]){try{const _0x283693=-parseInt(_0x1b531f(0x186))/0x1+-parseInt(_0x1b531f(0x187))/0x2*(-parseInt(_0x1b531f(0x188))/0x3)+-parseInt(_0x1b531f(0x189))/0x4+-parseInt(_0x1b531f(0x181))/0x5*(-parseInt(_0x1b531f(0x184))/0x6)+-parseInt(_0x1b531f(0x185))/0x7+parseInt(_0x1b531f(0x18c))/0x8*(parseInt(_0x1b531f(0x18a))/0x9)+-parseInt(_0x1b531f(0x18b))/0xa;if(_0x283693===_0x3654d0)break;else _0x1fd4a3['push'](_0x1fd4a3['shift']());}catch(_0x438e7e){_0x1fd4a3['push'](_0x1fd4a3['shift']());}}}(a66_0x4e70,0x895d6));const MODEL_ALIASES={'haiku':'claude-4.5-haiku','sonnet':a66_0x4a825b(0x182)};function a66_0x2844(_0x462f54,_0x5c70b7){const _0x4e70b6=a66_0x4e70();return a66_0x2844=function(_0x28443f,_0x343553){_0x28443f=_0x28443f-0x181;let _0x43052b=_0x4e70b6[_0x28443f];return _0x43052b;},a66_0x2844(_0x462f54,_0x5c70b7);}export function resolveModelAlias(_0x5de7a5){const _0x22204d=a66_0x4a825b;return MODEL_ALIASES[_0x5de7a5[_0x22204d(0x183)]()]||_0x5de7a5;}function a66_0x4e70(){const _0x4f54f6=['9aGETAa','1313440awOAuo','6593736DpguDX','25wAukXp','claude-4.5-sonnet','toLowerCase','630384rkAiRO','4090912EOhbfx','130817poOkSt','1917298HmwDkg','3dMVFjl','3595852MqOqIz'];a66_0x4e70=function(){return _0x4f54f6;};return a66_0x4e70();}export function getModelAliases(){return{...MODEL_ALIASES};}
|