@treasuredata/tdx 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +2 -2
- package/dist/cli.js +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/llm-client.js.map +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/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.js +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/proxy/session-cache.d.ts +3 -1
- package/dist/proxy/session-cache.d.ts.map +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/session-cache.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/constants.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/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
package/dist/sdk/workflow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a52_0x1018ca=a52_0x5d20;(function(_0x2e6554,_0x56d9ed){const _0x17e896=a52_0x5d20,_0x31e5b8=_0x2e6554();while(!![]){try{const _0x461236=-parseInt(_0x17e896(0x145))/0x1+parseInt(_0x17e896(0x118))/0x2+-parseInt(_0x17e896(0x165))/0x3*(-parseInt(_0x17e896(0x15c))/0x4)+-parseInt(_0x17e896(0x125))/0x5+-parseInt(_0x17e896(0x11d))/0x6+parseInt(_0x17e896(0x123))/0x7*(parseInt(_0x17e896(0x153))/0x8)+parseInt(_0x17e896(0x121))/0x9;if(_0x461236===_0x56d9ed)break;else _0x31e5b8['push'](_0x31e5b8['shift']());}catch(_0x39e142){_0x31e5b8['push'](_0x31e5b8['shift']());}}}(a52_0x3ba8,0x49b65));function a52_0x5d20(_0x1d8180,_0x38ea05){const _0x3ba873=a52_0x3ba8();return a52_0x5d20=function(_0x5d20bf,_0x37865e){_0x5d20bf=_0x5d20bf-0x117;let _0x1e6a84=_0x3ba873[_0x5d20bf];return _0x1e6a84;},a52_0x5d20(_0x1d8180,_0x38ea05);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';function a52_0x3ba8(){const _0x24065b=['5532QclzrB','NUMERIC_ID_PATTERN','Project\x20not\x20found:\x20','join','download','resolveProjectId','tar','basename','isDirectory','756vkvPhV','includeRetried','path','workflowName','getAttempt','retrySession','cancelRequested','readdir','listProjects','retryAttempt','createdAt','create','done','lastId','sessionTime','807398wzuSaW','sessionId','isGroup','client','getTaskLogs','1968468tyWGCd','unlink','extract','last_id','4567860SeIdPf','push','440279GuhWGu','toISOString','499850XPZeKj','error','revision','index','latest','access','.tar.gz','workflow','config','listWorkflows','uploadProjectArchive','attempts','fromTask','isFile','params','toTime','getAttemptTasks','Project\x20directory\x20not\x20found:\x20','clearSchedule','mkdir','name','data','clearScheduleAll','downloadProjectArchive','listSessions','finishedAt','length','timezone','retryParams','tdx-workflow-push-','parentId','now','592679kAVuBZ','tmpdir','\x20workflow\x20files\x20found\x20in\x20project\x20directory','retryAttemptName','replace','projects','listAttempts','limit','map','projectName','find','sessionUuid','message','No\x20','8MTdtxd','attempt','fromTime','tasks','project','workflows','test','startedAt','lastAttempt'];a52_0x3ba8=function(){return _0x24065b;};return a52_0x3ba8();}export class WorkflowAPI{[a52_0x1018ca(0x11b)];static [a52_0x1018ca(0x15d)]=/^\d+$/;constructor(_0x40a373){const _0x11152f=a52_0x1018ca;this[_0x11152f(0x11b)]=_0x40a373;}async['resolveProjectId'](_0x419bba){const _0x56ec7c=a52_0x1018ca;if(WorkflowAPI['NUMERIC_ID_PATTERN'][_0x56ec7c(0x159)](_0x419bba))return{'id':_0x419bba,'name':_0x419bba};const _0x49f731=await this[_0x56ec7c(0x11b)][_0x56ec7c(0x16d)]({'name_pattern':_0x419bba}),_0x337c4e=_0x49f731['data']['find'](_0x1d3a86=>_0x1d3a86['name']===_0x419bba);if(!_0x337c4e)throw new Error(_0x56ec7c(0x15e)+_0x419bba);return{'id':_0x337c4e['id'],'name':_0x337c4e[_0x56ec7c(0x139)]};}async[a52_0x1018ca(0x14a)](_0x542cc0,_0x12bf9c){const _0x2c4ed0=a52_0x1018ca,_0x48343a=await this[_0x2c4ed0(0x11b)][_0x2c4ed0(0x16d)]({'name_pattern':_0x542cc0,..._0x12bf9c});return _0x48343a['data'][_0x2c4ed0(0x14d)](_0x27c5ed=>({..._0x27c5ed,'project_id':_0x27c5ed['id'],'project_name':_0x27c5ed[_0x2c4ed0(0x139)]}));}async[a52_0x1018ca(0x158)](_0x51df3c,_0x139c63){const _0x2c2c63=a52_0x1018ca,_0x4d7038=await this['client'][_0x2c2c63(0x12e)]({'project_name':_0x51df3c,..._0x139c63});return _0x4d7038[_0x2c2c63(0x13a)][_0x2c2c63(0x14d)](_0x691d1e=>({'project_id':_0x691d1e[_0x2c2c63(0x157)]?.['id'],'project_name':_0x691d1e[_0x2c2c63(0x157)]?.['name'],'workflow_id':_0x691d1e['id'],'workflow_name':_0x691d1e['name'],'revision':_0x691d1e[_0x2c2c63(0x127)],'timezone':_0x691d1e[_0x2c2c63(0x140)],'config':_0x691d1e['config'],'id':_0x691d1e['id'],'name':_0x691d1e[_0x2c2c63(0x139)],'project':_0x691d1e[_0x2c2c63(0x157)]}));}async['sessions'](_0x3ba5d1){const _0x1e210f=a52_0x1018ca;let _0x962177;if(_0x3ba5d1?.['projectName']){let _0x2ecde8,_0x571979=![];while(!_0x571979){const _0x52027b=await this[_0x1e210f(0x11b)]['listProjects']({'limit':0x64,'last_id':_0x2ecde8}),_0x30888d=_0x52027b[_0x1e210f(0x13a)][_0x1e210f(0x14f)](_0x4dddbf=>_0x4dddbf[_0x1e210f(0x139)]===_0x3ba5d1[_0x1e210f(0x14e)]);if(_0x30888d){_0x962177=_0x30888d['id'],_0x571979=!![];break;}if(!_0x52027b[_0x1e210f(0x172)]||_0x52027b[_0x1e210f(0x13a)][_0x1e210f(0x13f)]===0x0)break;_0x2ecde8=_0x52027b[_0x1e210f(0x172)];}if(!_0x962177)throw new Error('Project\x20not\x20found:\x20'+_0x3ba5d1[_0x1e210f(0x14e)]);}const _0x26c560=await this[_0x1e210f(0x11b)][_0x1e210f(0x13d)]({'project_id':_0x962177,'project_name':_0x3ba5d1?.[_0x1e210f(0x14e)],'workflow_name':_0x3ba5d1?.[_0x1e210f(0x168)],'status':_0x3ba5d1?.['status'],'from_time':_0x3ba5d1?.[_0x1e210f(0x155)],'to_time':_0x3ba5d1?.[_0x1e210f(0x134)],'limit':_0x3ba5d1?.[_0x1e210f(0x14c)],'last_id':_0x3ba5d1?.[_0x1e210f(0x120)]});return _0x26c560['data'][_0x1e210f(0x14d)](_0x251b93=>({'project_id':_0x251b93[_0x1e210f(0x157)]?.['id'],'project_name':_0x251b93['project']?.[_0x1e210f(0x139)],'workflow_id':_0x251b93[_0x1e210f(0x12c)]?.['id'],'workflow_name':_0x251b93['workflow']?.[_0x1e210f(0x139)],'session_id':_0x251b93['id'],'sessionUuid':_0x251b93[_0x1e210f(0x150)],'sessionTime':_0x251b93[_0x1e210f(0x117)],'lastAttempt':_0x251b93[_0x1e210f(0x15b)],'id':_0x251b93['id'],'project':_0x251b93['project'],'workflow':_0x251b93[_0x1e210f(0x12c)]}));}async[a52_0x1018ca(0x130)](_0xd897bd){const _0x4a0c13=a52_0x1018ca,_0x58d46f=await this[_0x4a0c13(0x11b)][_0x4a0c13(0x14b)]({'project_name':_0xd897bd?.[_0x4a0c13(0x14e)],'workflow_name':_0xd897bd?.['workflowName'],'include_retried':_0xd897bd?.[_0x4a0c13(0x166)],'limit':_0xd897bd?.[_0x4a0c13(0x14c)],'last_id':_0xd897bd?.['last_id']});return _0x58d46f[_0x4a0c13(0x13a)]['map'](_0x3fce42=>({'project_id':_0x3fce42[_0x4a0c13(0x157)]?.['id'],'project_name':_0x3fce42['project']?.[_0x4a0c13(0x139)],'workflow_id':_0x3fce42['workflow']?.['id'],'workflow_name':_0x3fce42[_0x4a0c13(0x12c)]?.['name'],'session_id':_0x3fce42['sessionId'],'sessionUuid':_0x3fce42[_0x4a0c13(0x150)],'sessionTime':_0x3fce42['sessionTime'],'attempt_id':_0x3fce42['id'],'attempt_index':_0x3fce42[_0x4a0c13(0x128)],'retryAttemptName':_0x3fce42[_0x4a0c13(0x148)],'done':_0x3fce42[_0x4a0c13(0x171)],'success':_0x3fce42['success'],'cancelRequested':_0x3fce42[_0x4a0c13(0x16b)],'params':_0x3fce42[_0x4a0c13(0x133)],'createdAt':_0x3fce42[_0x4a0c13(0x16f)],'finishedAt':_0x3fce42[_0x4a0c13(0x13e)],'id':_0x3fce42['id'],'index':_0x3fce42[_0x4a0c13(0x128)],'project':_0x3fce42[_0x4a0c13(0x157)],'workflow':_0x3fce42['workflow']}));}async[a52_0x1018ca(0x154)](_0x44cda4){const _0x1e2322=a52_0x1018ca,_0x4df66e=await this['client'][_0x1e2322(0x169)](_0x44cda4);return _0x4df66e;}async[a52_0x1018ca(0x156)](_0x59427f,_0x4927fb=![]){const _0x46ec2e=a52_0x1018ca,_0x1796d2=await this[_0x46ec2e(0x11b)][_0x46ec2e(0x135)](_0x59427f,_0x4927fb);return _0x1796d2[_0x46ec2e(0x14d)](_0x41930b=>({'task_id':_0x41930b['id'],'task_name':_0x41930b['fullName'],'parentId':_0x41930b[_0x46ec2e(0x143)],'config':_0x41930b[_0x46ec2e(0x12d)],'upstreams':_0x41930b['upstreams'],'state':_0x41930b['state'],'exportParams':_0x41930b['exportParams'],'storeParams':_0x41930b['storeParams'],'stateParams':_0x41930b['stateParams'],'updatedAt':_0x41930b['updatedAt'],'retryAt':_0x41930b['retryAt'],'startedAt':_0x41930b[_0x46ec2e(0x15a)],'error':_0x41930b[_0x46ec2e(0x126)],'isGroup':_0x41930b[_0x46ec2e(0x11a)],'id':_0x41930b['id'],'fullName':_0x41930b['fullName']}));}async['logs'](_0x2aaeaf,_0x2eafbc,_0x4fe759){const _0x10fca4=a52_0x1018ca;return await this[_0x10fca4(0x11b)][_0x10fca4(0x11c)](_0x2aaeaf,_0x2eafbc,_0x4fe759);}async['kill'](_0x26453d,_0x9c1ac7){const _0x233adc=a52_0x1018ca,_0x19037d=await this['client']['killAttempt'](_0x26453d,_0x9c1ac7);return _0x19037d[_0x233adc(0x151)];}async[a52_0x1018ca(0x16a)](_0x571baa,_0x2c3735){const _0x59917b=a52_0x1018ca,_0x21e219=await this['client'][_0x59917b(0x16a)](_0x571baa,{'from_task':_0x2c3735?.[_0x59917b(0x131)],'retry_params':_0x2c3735?.[_0x59917b(0x141)]});return{'attemptId':_0x21e219['id'],'sessionId':_0x21e219[_0x59917b(0x119)]};}async[a52_0x1018ca(0x16e)](_0x1bc72d,_0x2b9b54){const _0x30a303=a52_0x1018ca,_0x328d8c=await this[_0x30a303(0x11b)][_0x30a303(0x16e)](_0x1bc72d,{'resume_from':_0x2b9b54?.['resumeFrom'],'retry_params':_0x2b9b54?.[_0x30a303(0x141)],'force':_0x2b9b54?.['force']});return{'attemptId':_0x328d8c['id'],'sessionId':_0x328d8c[_0x30a303(0x119)]};}async[a52_0x1018ca(0x160)](_0x4bb803,_0x1f9eb4,_0x25e323){const _0x44c69f=a52_0x1018ca,{promises:_0x5dc25d}=await import('fs'),_0x3a3459=await import(_0x44c69f(0x167)),_0x456b0f=await import('os'),_0x49794a=await import(_0x44c69f(0x162)),{id:_0x557e8c,name:_0x59d3e0}=await this[_0x44c69f(0x161)](_0x4bb803),_0x4f4bd6=_0x456b0f[_0x44c69f(0x146)](),_0x4c1fbe=_0x3a3459['join'](_0x4f4bd6,'tdx-workflow-'+_0x557e8c+'-'+Date[_0x44c69f(0x144)]()+_0x44c69f(0x12b));try{await this[_0x44c69f(0x11b)][_0x44c69f(0x13c)](_0x557e8c,_0x4c1fbe,_0x25e323?.['revision']);const _0x3b65f1=_0x3a3459[_0x44c69f(0x15f)](_0x1f9eb4,_0x59d3e0);await _0x5dc25d[_0x44c69f(0x138)](_0x3b65f1,{'recursive':!![]}),await _0x49794a[_0x44c69f(0x11f)]({'file':_0x4c1fbe,'cwd':_0x3b65f1,'gzip':!![]});const _0x13b4bf=async _0xcff23=>{const _0x20d80e=_0x44c69f;let _0x57fb9c=0x0;const _0x51148c=await _0x5dc25d[_0x20d80e(0x16c)](_0xcff23,{'withFileTypes':!![]});for(const _0x1c906c of _0x51148c){const _0x2eec30=_0x3a3459[_0x20d80e(0x15f)](_0xcff23,_0x1c906c[_0x20d80e(0x139)]);if(_0x1c906c[_0x20d80e(0x132)]())_0x57fb9c++;else _0x1c906c[_0x20d80e(0x164)]()&&(_0x57fb9c+=await _0x13b4bf(_0x2eec30));}return _0x57fb9c;},_0x21c75b=await _0x13b4bf(_0x3b65f1);return{'projectName':_0x59d3e0,'revision':_0x25e323?.[_0x44c69f(0x127)]||_0x44c69f(0x129),'filesExtracted':_0x21c75b};}finally{try{await _0x5dc25d[_0x44c69f(0x11e)](_0x4c1fbe);}catch{}}}async['push'](_0x2c19ba,_0x5bdbe9){const _0xd6c3eb=a52_0x1018ca,{promises:_0xe7e0fa}=await import('fs'),_0x17c1ff=await import(_0xd6c3eb(0x167)),_0x4cbb40=await import(_0xd6c3eb(0x162)),_0xb01d3a=_0x5bdbe9?.[_0xd6c3eb(0x14e)]||_0x17c1ff[_0xd6c3eb(0x163)](_0x2c19ba),_0x1b103c=_0x5bdbe9?.[_0xd6c3eb(0x127)]||new Date()[_0xd6c3eb(0x124)]()[_0xd6c3eb(0x149)](/[:.]/g,'-');try{await _0xe7e0fa[_0xd6c3eb(0x12a)](_0x2c19ba);}catch{throw new Error(_0xd6c3eb(0x136)+_0x2c19ba);}if(!_0x5bdbe9?.['skipValidation']){const _0x50dddf=await _0xe7e0fa[_0xd6c3eb(0x16c)](_0x2c19ba),_0x18549c=_0x50dddf['filter'](_0x48b3c9=>_0x48b3c9['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x18549c['length']===0x0)throw new Error(_0xd6c3eb(0x152)+WORKFLOW_FILE_EXTENSION+_0xd6c3eb(0x147));for(const _0x4dcf66 of _0x18549c){const _0x3d2378=_0x17c1ff[_0xd6c3eb(0x15f)](_0x2c19ba,_0x4dcf66);try{await _0xe7e0fa['access'](_0x3d2378);}catch{throw new Error('Cannot\x20read\x20workflow\x20file:\x20'+_0x4dcf66);}}}const _0xd4790a=async(_0x13bfbe,_0x4185a9='')=>{const _0xd9bb5c=_0xd6c3eb,_0xcc7cf1=await _0xe7e0fa[_0xd9bb5c(0x16c)](_0x13bfbe,{'withFileTypes':!![]}),_0x269c73=[];for(const _0x59b511 of _0xcc7cf1){const _0x126190=_0x17c1ff[_0xd9bb5c(0x15f)](_0x4185a9,_0x59b511[_0xd9bb5c(0x139)]),_0x2615f8=_0x17c1ff[_0xd9bb5c(0x15f)](_0x13bfbe,_0x59b511['name']);if(!shouldIncludeInArchive(_0x59b511[_0xd9bb5c(0x139)]))continue;_0x59b511['isDirectory']()?_0x269c73[_0xd9bb5c(0x122)](...await _0xd4790a(_0x2615f8,_0x126190)):_0x269c73['push'](_0x126190);}return _0x269c73;},_0x2c7221=await _0xd4790a(_0x2c19ba),_0x5cc9ad=await import('os'),_0x4945ff=_0x5cc9ad[_0xd6c3eb(0x146)](),_0x1c9aee=_0x17c1ff[_0xd6c3eb(0x15f)](_0x4945ff,_0xd6c3eb(0x142)+Date[_0xd6c3eb(0x144)]()+_0xd6c3eb(0x12b));try{await _0x4cbb40[_0xd6c3eb(0x170)]({'file':_0x1c9aee,'gzip':!![],'cwd':_0x2c19ba,'portable':!![]},_0x2c7221);const _0x2efdaf=await this[_0xd6c3eb(0x11b)][_0xd6c3eb(0x12f)](_0xb01d3a,_0x1b103c,_0x1c9aee,{'scheduleFrom':_0x5bdbe9?.['scheduleFrom'],'clearSchedule':_0x5bdbe9?.[_0xd6c3eb(0x137)],'clearScheduleAll':_0x5bdbe9?.[_0xd6c3eb(0x13b)]});return{'projectId':_0x2efdaf['id'],'projectName':_0x2efdaf[_0xd6c3eb(0x139)],'revision':_0x2efdaf['revision']};}finally{try{await _0xe7e0fa[_0xd6c3eb(0x11e)](_0x1c9aee);}catch{}}}async['delete'](_0x34a843){const _0x4cedad=a52_0x1018ca,{id:_0x40dbfe}=await this['resolveProjectId'](_0x34a843),_0x256150=await this[_0x4cedad(0x11b)]['deleteProject'](_0x40dbfe);return{'projectId':_0x256150['id'],'projectName':_0x256150[_0x4cedad(0x139)]};}}
|
|
1
|
+
const a52_0x124c6a=a52_0x2254;(function(_0x1b9b32,_0x4dc049){const _0x356995=a52_0x2254,_0x6a8a12=_0x1b9b32();while(!![]){try{const _0x5348e0=parseInt(_0x356995(0x1de))/0x1+parseInt(_0x356995(0x1f3))/0x2*(parseInt(_0x356995(0x1e0))/0x3)+-parseInt(_0x356995(0x1f9))/0x4+parseInt(_0x356995(0x21f))/0x5+parseInt(_0x356995(0x21c))/0x6*(-parseInt(_0x356995(0x239))/0x7)+parseInt(_0x356995(0x1f0))/0x8*(parseInt(_0x356995(0x238))/0x9)+parseInt(_0x356995(0x1f8))/0xa*(-parseInt(_0x356995(0x1fa))/0xb);if(_0x5348e0===_0x4dc049)break;else _0x6a8a12['push'](_0x6a8a12['shift']());}catch(_0x4ee9c0){_0x6a8a12['push'](_0x6a8a12['shift']());}}}(a52_0x1a68,0xd7cb5));import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';export class WorkflowAPI{[a52_0x124c6a(0x216)];static [a52_0x124c6a(0x1fb)]=/^\d+$/;constructor(_0x4e67ff){const _0x4fc113=a52_0x124c6a;this[_0x4fc113(0x216)]=_0x4e67ff;}async[a52_0x124c6a(0x237)](_0x3f1103){const _0x25d951=a52_0x124c6a;if(WorkflowAPI['NUMERIC_ID_PATTERN'][_0x25d951(0x1e2)](_0x3f1103))return{'id':_0x3f1103,'name':_0x3f1103};const _0x789079=await this[_0x25d951(0x216)]['listProjects']({'name_pattern':_0x3f1103}),_0x152349=_0x789079['data'][_0x25d951(0x206)](_0x497bf4=>_0x497bf4[_0x25d951(0x1f6)]===_0x3f1103);if(!_0x152349)throw new Error(_0x25d951(0x241)+_0x3f1103);return{'id':_0x152349['id'],'name':_0x152349[_0x25d951(0x1f6)]};}async[a52_0x124c6a(0x21b)](_0x1e52f2,_0xe75bb8){const _0x28ffb3=a52_0x124c6a,_0x3af044=await this[_0x28ffb3(0x216)][_0x28ffb3(0x205)]({'name_pattern':_0x1e52f2,..._0xe75bb8});return _0x3af044[_0x28ffb3(0x226)][_0x28ffb3(0x21e)](_0x5a09b0=>({..._0x5a09b0,'project_id':_0x5a09b0['id'],'project_name':_0x5a09b0[_0x28ffb3(0x1f6)]}));}async[a52_0x124c6a(0x21a)](_0x28e805,_0x5deee0){const _0x2f5b09=a52_0x124c6a,_0x31b4d5=await this[_0x2f5b09(0x216)][_0x2f5b09(0x1eb)]({'project_name':_0x28e805,..._0x5deee0});return _0x31b4d5['data'][_0x2f5b09(0x21e)](_0x167f5a=>({'project_id':_0x167f5a[_0x2f5b09(0x224)]?.['id'],'project_name':_0x167f5a[_0x2f5b09(0x224)]?.[_0x2f5b09(0x1f6)],'workflow_id':_0x167f5a['id'],'workflow_name':_0x167f5a[_0x2f5b09(0x1f6)],'revision':_0x167f5a['revision'],'timezone':_0x167f5a[_0x2f5b09(0x21d)],'config':_0x167f5a['config'],'id':_0x167f5a['id'],'name':_0x167f5a[_0x2f5b09(0x1f6)],'project':_0x167f5a['project']}));}async[a52_0x124c6a(0x232)](_0x5a1d23){const _0x216163=a52_0x124c6a;let _0x7fd90f;if(_0x5a1d23?.[_0x216163(0x204)]){let _0xea6117,_0x30e01c=![];while(!_0x30e01c){const _0x371142=await this[_0x216163(0x216)][_0x216163(0x205)]({'limit':0x64,'last_id':_0xea6117}),_0x5e35f7=_0x371142[_0x216163(0x226)]['find'](_0x4bfe6a=>_0x4bfe6a[_0x216163(0x1f6)]===_0x5a1d23[_0x216163(0x204)]);if(_0x5e35f7){_0x7fd90f=_0x5e35f7['id'],_0x30e01c=!![];break;}if(!_0x371142[_0x216163(0x20a)]||_0x371142['data']['length']===0x0)break;_0xea6117=_0x371142[_0x216163(0x20a)];}if(!_0x7fd90f)throw new Error(_0x216163(0x241)+_0x5a1d23['projectName']);}const _0x32592a=await this['client'][_0x216163(0x1ee)]({'project_id':_0x7fd90f,'project_name':_0x5a1d23?.[_0x216163(0x204)],'workflow_name':_0x5a1d23?.['workflowName'],'status':_0x5a1d23?.[_0x216163(0x219)],'from_time':_0x5a1d23?.[_0x216163(0x1e3)],'to_time':_0x5a1d23?.[_0x216163(0x20e)],'limit':_0x5a1d23?.[_0x216163(0x22d)],'last_id':_0x5a1d23?.['last_id']});return _0x32592a['data'][_0x216163(0x21e)](_0x7b4666=>({'project_id':_0x7b4666[_0x216163(0x224)]?.['id'],'project_name':_0x7b4666['project']?.[_0x216163(0x1f6)],'workflow_id':_0x7b4666['workflow']?.['id'],'workflow_name':_0x7b4666[_0x216163(0x20b)]?.[_0x216163(0x1f6)],'session_id':_0x7b4666['id'],'sessionUuid':_0x7b4666[_0x216163(0x214)],'sessionTime':_0x7b4666[_0x216163(0x207)],'lastAttempt':_0x7b4666['lastAttempt'],'id':_0x7b4666['id'],'project':_0x7b4666[_0x216163(0x224)],'workflow':_0x7b4666['workflow']}));}async[a52_0x124c6a(0x22e)](_0x21e433){const _0x4eea79=a52_0x124c6a,_0x9199d2=await this[_0x4eea79(0x216)][_0x4eea79(0x231)]({'project_name':_0x21e433?.['projectName'],'workflow_name':_0x21e433?.[_0x4eea79(0x1e9)],'include_retried':_0x21e433?.[_0x4eea79(0x209)],'limit':_0x21e433?.['limit'],'last_id':_0x21e433?.[_0x4eea79(0x225)]});return _0x9199d2['data']['map'](_0x14cacf=>({'project_id':_0x14cacf[_0x4eea79(0x224)]?.['id'],'project_name':_0x14cacf['project']?.[_0x4eea79(0x1f6)],'workflow_id':_0x14cacf['workflow']?.['id'],'workflow_name':_0x14cacf[_0x4eea79(0x20b)]?.[_0x4eea79(0x1f6)],'session_id':_0x14cacf[_0x4eea79(0x1ff)],'sessionUuid':_0x14cacf['sessionUuid'],'sessionTime':_0x14cacf[_0x4eea79(0x207)],'attempt_id':_0x14cacf['id'],'attempt_index':_0x14cacf[_0x4eea79(0x220)],'retryAttemptName':_0x14cacf[_0x4eea79(0x20c)],'done':_0x14cacf[_0x4eea79(0x1ea)],'success':_0x14cacf[_0x4eea79(0x1f7)],'cancelRequested':_0x14cacf[_0x4eea79(0x223)],'params':_0x14cacf[_0x4eea79(0x22c)],'createdAt':_0x14cacf[_0x4eea79(0x22b)],'finishedAt':_0x14cacf[_0x4eea79(0x203)],'id':_0x14cacf['id'],'index':_0x14cacf[_0x4eea79(0x220)],'project':_0x14cacf[_0x4eea79(0x224)],'workflow':_0x14cacf[_0x4eea79(0x20b)]}));}async[a52_0x124c6a(0x234)](_0x161c0b){const _0x24c46b=a52_0x124c6a,_0x112260=await this['client'][_0x24c46b(0x1e5)](_0x161c0b);return _0x112260;}async[a52_0x124c6a(0x242)](_0x4efcf7,_0x3a4dfa=![]){const _0x54be9f=a52_0x124c6a,_0x3baabe=await this[_0x54be9f(0x216)][_0x54be9f(0x23c)](_0x4efcf7,_0x3a4dfa);return _0x3baabe['map'](_0x567e47=>({'task_id':_0x567e47['id'],'task_name':_0x567e47[_0x54be9f(0x240)],'parentId':_0x567e47[_0x54be9f(0x23b)],'config':_0x567e47[_0x54be9f(0x1f1)],'upstreams':_0x567e47[_0x54be9f(0x1dd)],'state':_0x567e47[_0x54be9f(0x230)],'exportParams':_0x567e47[_0x54be9f(0x23e)],'storeParams':_0x567e47[_0x54be9f(0x20d)],'stateParams':_0x567e47[_0x54be9f(0x23d)],'updatedAt':_0x567e47[_0x54be9f(0x1ed)],'retryAt':_0x567e47[_0x54be9f(0x1fc)],'startedAt':_0x567e47[_0x54be9f(0x1fe)],'error':_0x567e47[_0x54be9f(0x215)],'isGroup':_0x567e47['isGroup'],'id':_0x567e47['id'],'fullName':_0x567e47[_0x54be9f(0x240)]}));}async[a52_0x124c6a(0x221)](_0xbc8fd9,_0x4bced5,_0x396a8d){const _0xc1632b=a52_0x124c6a;return await this['client'][_0xc1632b(0x22a)](_0xbc8fd9,_0x4bced5,_0x396a8d);}async['kill'](_0x4b9eeb,_0x55f519){const _0x4df3fa=a52_0x124c6a,_0x2a5830=await this[_0x4df3fa(0x216)][_0x4df3fa(0x20f)](_0x4b9eeb,_0x55f519);return _0x2a5830[_0x4df3fa(0x1e6)];}async[a52_0x124c6a(0x202)](_0xa849f8,_0x36a70e){const _0x49d954=a52_0x124c6a,_0xb5dbff=await this[_0x49d954(0x216)][_0x49d954(0x202)](_0xa849f8,{'from_task':_0x36a70e?.[_0x49d954(0x212)],'retry_params':_0x36a70e?.['retryParams']});return{'attemptId':_0xb5dbff['id'],'sessionId':_0xb5dbff[_0x49d954(0x1ff)]};}async['retryAttempt'](_0x5edfde,_0x3e4d3b){const _0x4274f9=a52_0x124c6a,_0xc10d2c=await this['client'][_0x4274f9(0x1f4)](_0x5edfde,{'resume_from':_0x3e4d3b?.['resumeFrom'],'retry_params':_0x3e4d3b?.[_0x4274f9(0x1e8)],'force':_0x3e4d3b?.['force']});return{'attemptId':_0xc10d2c['id'],'sessionId':_0xc10d2c['sessionId']};}async[a52_0x124c6a(0x23a)](_0x3ecd3e,_0x3e5226,_0x3fac8d){const _0x4799af=a52_0x124c6a,{promises:_0x32e5d3}=await import('fs'),_0x48f19d=await import(_0x4799af(0x235)),_0x5cec83=await import('os'),_0x33b1a2=await import(_0x4799af(0x1ec)),{id:_0xd00612,name:_0xc89210}=await this[_0x4799af(0x237)](_0x3ecd3e),_0x2767fe=_0x5cec83['tmpdir'](),_0x50fb78=_0x48f19d[_0x4799af(0x1e7)](_0x2767fe,_0x4799af(0x201)+_0xd00612+'-'+Date['now']()+'.tar.gz');try{await this[_0x4799af(0x216)][_0x4799af(0x218)](_0xd00612,_0x50fb78,_0x3fac8d?.[_0x4799af(0x243)]);const _0x1d96d0=_0x48f19d[_0x4799af(0x1e7)](_0x3e5226,_0xc89210);await _0x32e5d3['mkdir'](_0x1d96d0,{'recursive':!![]}),await _0x33b1a2[_0x4799af(0x208)]({'file':_0x50fb78,'cwd':_0x1d96d0,'gzip':!![]});const _0x245d09=async _0x3f5d9d=>{const _0xd515e1=_0x4799af;let _0x3445c6=0x0;const _0x9da883=await _0x32e5d3[_0xd515e1(0x23f)](_0x3f5d9d,{'withFileTypes':!![]});for(const _0x439571 of _0x9da883){const _0x1bb68c=_0x48f19d[_0xd515e1(0x1e7)](_0x3f5d9d,_0x439571[_0xd515e1(0x1f6)]);if(_0x439571['isFile']())_0x3445c6++;else _0x439571[_0xd515e1(0x1e1)]()&&(_0x3445c6+=await _0x245d09(_0x1bb68c));}return _0x3445c6;},_0x91bd8c=await _0x245d09(_0x1d96d0);return{'projectName':_0xc89210,'revision':_0x3fac8d?.[_0x4799af(0x243)]||_0x4799af(0x210),'filesExtracted':_0x91bd8c};}finally{try{await _0x32e5d3[_0x4799af(0x229)](_0x50fb78);}catch{}}}async['push'](_0x5cfa15,_0x30b19a){const _0xbbe05f=a52_0x124c6a,{promises:_0xef8e4d}=await import('fs'),_0x1c85ae=await import(_0xbbe05f(0x235)),_0x3c3c42=await import('tar'),_0xcef5de=_0x30b19a?.['projectName']||_0x1c85ae['basename'](_0x5cfa15),_0x324587=_0x30b19a?.[_0xbbe05f(0x243)]||new Date()[_0xbbe05f(0x222)]()['replace'](/[:.]/g,'-');try{await _0xef8e4d[_0xbbe05f(0x236)](_0x5cfa15);}catch{throw new Error(_0xbbe05f(0x1e4)+_0x5cfa15);}if(!_0x30b19a?.['skipValidation']){const _0x4ba0c2=await _0xef8e4d[_0xbbe05f(0x23f)](_0x5cfa15),_0x254b48=_0x4ba0c2['filter'](_0x68a7e3=>_0x68a7e3[_0xbbe05f(0x233)](WORKFLOW_FILE_EXTENSION));if(_0x254b48[_0xbbe05f(0x227)]===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0xbbe05f(0x211));for(const _0x208430 of _0x254b48){const _0x443a12=_0x1c85ae['join'](_0x5cfa15,_0x208430);try{await _0xef8e4d[_0xbbe05f(0x236)](_0x443a12);}catch{throw new Error(_0xbbe05f(0x228)+_0x208430);}}}const _0x15d389=async(_0x36e802,_0x51b573='')=>{const _0x1818d1=_0xbbe05f,_0x324e09=await _0xef8e4d['readdir'](_0x36e802,{'withFileTypes':!![]}),_0x572151=[];for(const _0x19a86b of _0x324e09){const _0x27471d=_0x1c85ae['join'](_0x51b573,_0x19a86b[_0x1818d1(0x1f6)]),_0x390cbd=_0x1c85ae[_0x1818d1(0x1e7)](_0x36e802,_0x19a86b[_0x1818d1(0x1f6)]);if(!shouldIncludeInArchive(_0x19a86b[_0x1818d1(0x1f6)]))continue;_0x19a86b[_0x1818d1(0x1e1)]()?_0x572151[_0x1818d1(0x1fd)](...await _0x15d389(_0x390cbd,_0x27471d)):_0x572151['push'](_0x27471d);}return _0x572151;},_0x13e153=await _0x15d389(_0x5cfa15),_0x20a379=await import('os'),_0x38191c=_0x20a379['tmpdir'](),_0x980b22=_0x1c85ae['join'](_0x38191c,_0xbbe05f(0x1f2)+Date[_0xbbe05f(0x1ef)]()+_0xbbe05f(0x22f));try{await _0x3c3c42[_0xbbe05f(0x217)]({'file':_0x980b22,'gzip':!![],'cwd':_0x5cfa15,'portable':!![]},_0x13e153);const _0x7198cd=await this[_0xbbe05f(0x216)]['uploadProjectArchive'](_0xcef5de,_0x324587,_0x980b22,{'scheduleFrom':_0x30b19a?.[_0xbbe05f(0x1f5)],'clearSchedule':_0x30b19a?.[_0xbbe05f(0x1df)],'clearScheduleAll':_0x30b19a?.[_0xbbe05f(0x213)]});return{'projectId':_0x7198cd['id'],'projectName':_0x7198cd[_0xbbe05f(0x1f6)],'revision':_0x7198cd[_0xbbe05f(0x243)]};}finally{try{await _0xef8e4d[_0xbbe05f(0x229)](_0x980b22);}catch{}}}async[a52_0x124c6a(0x200)](_0x4379ca){const _0x4b3668=a52_0x124c6a,{id:_0xcfd2b2}=await this[_0x4b3668(0x237)](_0x4379ca),_0x2527c9=await this[_0x4b3668(0x216)]['deleteProject'](_0xcfd2b2);return{'projectId':_0x2527c9['id'],'projectName':_0x2527c9[_0x4b3668(0x1f6)]};}}function a52_0x2254(_0x49d8da,_0x228db4){const _0x1a68d0=a52_0x1a68();return a52_0x2254=function(_0x2254f9,_0x30cfc3){_0x2254f9=_0x2254f9-0x1dd;let _0x4aae7b=_0x1a68d0[_0x2254f9];return _0x4aae7b;},a52_0x2254(_0x49d8da,_0x228db4);}function a52_0x1a68(){const _0x5f19a9=['access','resolveProjectId','27OwnmgN','53564mCufzT','download','parentId','getAttemptTasks','stateParams','exportParams','readdir','fullName','Project\x20not\x20found:\x20','tasks','revision','upstreams','1184691VHTimU','clearSchedule','108kcVoSw','isDirectory','test','fromTime','Project\x20directory\x20not\x20found:\x20','getAttempt','message','join','retryParams','workflowName','done','listWorkflows','tar','updatedAt','listSessions','now','1786696QPteQp','config','tdx-workflow-push-','8936LLHzwM','retryAttempt','scheduleFrom','name','success','145180MuUdin','3114912NNuxbJ','110pISxoZ','NUMERIC_ID_PATTERN','retryAt','push','startedAt','sessionId','delete','tdx-workflow-','retrySession','finishedAt','projectName','listProjects','find','sessionTime','extract','includeRetried','lastId','workflow','retryAttemptName','storeParams','toTime','killAttempt','latest','\x20workflow\x20files\x20found\x20in\x20project\x20directory','fromTask','clearScheduleAll','sessionUuid','error','client','create','downloadProjectArchive','status','workflows','projects','930JWFWKv','timezone','map','4891555PQGQLH','index','logs','toISOString','cancelRequested','project','last_id','data','length','Cannot\x20read\x20workflow\x20file:\x20','unlink','getTaskLogs','createdAt','params','limit','attempts','.tar.gz','state','listAttempts','sessions','endsWith','attempt','path'];a52_0x1a68=function(){return _0x5f19a9;};return a52_0x1a68();}
|
package/dist/types/endpoints.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a55_0x13927d=a55_0x2771;(function(_0x2cf41f,_0x42905e){const _0x5289f6=a55_0x2771,_0x479064=_0x2cf41f();while(!![]){try{const _0x255f8a=parseInt(_0x5289f6(0x117))/0x1*(parseInt(_0x5289f6(0x109))/0x2)+parseInt(_0x5289f6(0x108))/0x3*(parseInt(_0x5289f6(0x128))/0x4)+parseInt(_0x5289f6(0x11d))/0x5+-parseInt(_0x5289f6(0x111))/0x6+parseInt(_0x5289f6(0x106))/0x7+parseInt(_0x5289f6(0x11a))/0x8+parseInt(_0x5289f6(0xfe))/0x9*(-parseInt(_0x5289f6(0x103))/0xa);if(_0x255f8a===_0x42905e)break;else _0x479064['push'](_0x479064['shift']());}catch(_0x4b0020){_0x479064['push'](_0x479064['shift']());}}}(a55_0x4093,0x43d4a));export const TD_ENDPOINTS={'us01':'https://api.treasuredata.com','jp01':a55_0x13927d(0x113),'eu01':a55_0x13927d(0x11e),'ap02':'https://api.ap02.treasuredata.com','ap03':a55_0x13927d(0x112),'dev-us01':'https://api-development.us01.treasuredata.com','dev-eu01':a55_0x13927d(0x104),'stg-us01':'https://api-staging.us01.treasuredata.com','stg-jp01':'https://api-staging.treasuredata.co.jp','stg-ap03':a55_0x13927d(0x116)};export const CDP_ENDPOINTS={'us01':'https://api-cdp.treasuredata.com','jp01':a55_0x13927d(0x105),'eu01':a55_0x13927d(0x120),'ap02':'https://api-cdp.ap02.treasuredata.com','ap03':a55_0x13927d(0x124),'dev-us01':'https://api-development-cdp.us01.treasuredata.com','dev-eu01':'https://api-development-cdp.eu01.treasuredata.com','stg-us01':a55_0x13927d(0x119),'stg-jp01':a55_0x13927d(0x114),'stg-ap03':a55_0x13927d(0x11b)};function a55_0x4093(){const _0xcf53f4=['2124UZsVFG','52862vpqxuC','https://llm-api-development.us01.treasuredata.com','https://api-presto.treasuredata.com','https://llm-api.treasuredata.co.jp','https://api-staging-workflow.treasuredata.co.jp','https://llm-api-staging.us01.treasuredata.com','https://api-workflow.ap03.treasuredata.com','https://api-presto.treasuredata.co.jp','2870406XAOAWw','https://api.ap03.treasuredata.com','https://api.treasuredata.co.jp','https://api-staging-cdp.treasuredata.co.jp','https://api-workflow.treasuredata.co.jp','https://api-staging.ap03.treasuredata.com','4aKOtDg','https://api-development-workflow.us01.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','2512304yWbhDQ','https://api-staging-cdp.ap03.treasuredata.com','https://api-development-workflow.eu01.treasuredata.com','771760DDwMNs','https://api.eu01.treasuredata.com','https://llm-api.treasuredata.com','https://api-cdp.eu01.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://api-workflow.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','https://api-presto.ap03.treasuredata.com','1952DwyDRd','53577YgUcUo','https://llm-api-staging.treasuredata.co.jp','https://api-staging-presto.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','https://api-presto.eu01.treasuredata.com','450mTbeip','https://api-development.eu01.treasuredata.com','https://api-cdp.treasuredata.co.jp','731514xiVexi','https://api-staging-presto.treasuredata.co.jp'];a55_0x4093=function(){return _0xcf53f4;};return a55_0x4093();}function a55_0x2771(_0x14ea6e,_0x1a9638){const _0x40930a=a55_0x4093();return a55_0x2771=function(_0x2771c7,_0x497bbf){_0x2771c7=_0x2771c7-0xfe;let _0x100d04=_0x40930a[_0x2771c7];return _0x100d04;},a55_0x2771(_0x14ea6e,_0x1a9638);}export const WORKFLOW_ENDPOINTS={'us01':a55_0x13927d(0x123),'jp01':a55_0x13927d(0x115),'eu01':a55_0x13927d(0x121),'ap02':'https://api-workflow.ap02.treasuredata.com','ap03':a55_0x13927d(0x10f),'dev-us01':a55_0x13927d(0x118),'dev-eu01':a55_0x13927d(0x11c),'stg-us01':'https://api-staging-workflow.us01.treasuredata.com','stg-jp01':a55_0x13927d(0x10d),'stg-ap03':'https://api-staging-workflow.ap03.treasuredata.com'};export const TRINO_ENDPOINTS={'us01':a55_0x13927d(0x10b),'jp01':a55_0x13927d(0x110),'eu01':a55_0x13927d(0x102),'ap02':'https://api-presto.ap02.treasuredata.com','ap03':a55_0x13927d(0x127),'dev-us01':'https://api-development-presto.treasuredata.com','dev-eu01':'https://api-development-presto.eu01.treasuredata.com','stg-us01':a55_0x13927d(0x100),'stg-jp01':a55_0x13927d(0x107),'stg-ap03':a55_0x13927d(0x126)};export const LLM_ENDPOINTS={'us01':a55_0x13927d(0x11f),'jp01':a55_0x13927d(0x10c),'eu01':'https://llm-api.eu01.treasuredata.com','ap02':'https://llm-api.ap02.treasuredata.com','ap03':a55_0x13927d(0x122),'dev-us01':a55_0x13927d(0x10a),'dev-eu01':a55_0x13927d(0x101),'stg-us01':a55_0x13927d(0x10e),'stg-jp01':a55_0x13927d(0xff),'stg-ap03':a55_0x13927d(0x125)};export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS};export function getEndpoint(_0x215340,_0x36c1df='td'){const _0x462af2=API_ENDPOINTS[_0x36c1df]?.[_0x215340];if(!_0x462af2)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x36c1df+'\x27\x20and\x20site\x20\x27'+_0x215340+'\x27');return _0x462af2;}
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a56_0x4f0c(){const _0x4d419c=['5TtJtNd','2434BTuPda','dev-us01','10786720oqYweo','stg-us01','jp01','5196244rDImrf','11964MBciBW','4711XTLDDX','474bAbhUT','366IuxINq','694947epUpcz','670HCeWKV','8517411jvyUxd'];a56_0x4f0c=function(){return _0x4d419c;};return a56_0x4f0c();}function a56_0xcdcd(_0x34405a,_0x4abdd1){const _0x4f0c2b=a56_0x4f0c();return a56_0xcdcd=function(_0xcdcd89,_0x5bc9a0){_0xcdcd89=_0xcdcd89-0x1bb;let _0x3aa0c4=_0x4f0c2b[_0xcdcd89];return _0x3aa0c4;},a56_0xcdcd(_0x34405a,_0x4abdd1);}const a56_0x2a1a24=a56_0xcdcd;(function(_0x58bd6e,_0x54c38c){const _0x3801b4=a56_0xcdcd,_0x5349a8=_0x58bd6e();while(!![]){try{const _0x5c478f=-parseInt(_0x3801b4(0x1bc))/0x1+-parseInt(_0x3801b4(0x1c4))/0x2*(-parseInt(_0x3801b4(0x1bf))/0x3)+parseInt(_0x3801b4(0x1bb))/0x4*(-parseInt(_0x3801b4(0x1c3))/0x5)+parseInt(_0x3801b4(0x1be))/0x6*(-parseInt(_0x3801b4(0x1bd))/0x7)+-parseInt(_0x3801b4(0x1c6))/0x8+-parseInt(_0x3801b4(0x1c2))/0x9+parseInt(_0x3801b4(0x1c1))/0xa*(parseInt(_0x3801b4(0x1c0))/0xb);if(_0x5c478f===_0x54c38c)break;else _0x5349a8['push'](_0x5349a8['shift']());}catch(_0x2cd563){_0x5349a8['push'](_0x5349a8['shift']());}}}(a56_0x4f0c,0xb05f6));export const SITE_ALIASES={'us':'us01','aws':'us01','jp':a56_0x2a1a24(0x1c8),'aws-tokyo':'jp01','dev':a56_0x2a1a24(0x1c5),'stg':a56_0x2a1a24(0x1c7)};export{getEndpoint,API_ENDPOINTS}from'./endpoints.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3efcb9,_0x35d7ba){const _0xcdee0f=a59_0x5763,_0x3ea2d1=_0x3efcb9();while(!![]){try{const _0x201457=parseInt(_0xcdee0f(0xc7))/0x1*(-parseInt(_0xcdee0f(0xc9))/0x2)+-parseInt(_0xcdee0f(0xba))/0x3*(parseInt(_0xcdee0f(0xc1))/0x4)+parseInt(_0xcdee0f(0xca))/0x5*(-parseInt(_0xcdee0f(0xc3))/0x6)+-parseInt(_0xcdee0f(0xc0))/0x7*(parseInt(_0xcdee0f(0xc4))/0x8)+parseInt(_0xcdee0f(0xc5))/0x9*(-parseInt(_0xcdee0f(0xcc))/0xa)+parseInt(_0xcdee0f(0xbf))/0xb*(parseInt(_0xcdee0f(0xc2))/0xc)+parseInt(_0xcdee0f(0xbd))/0xd;if(_0x201457===_0x35d7ba)break;else _0x3ea2d1['push'](_0x3ea2d1['shift']());}catch(_0x12968a){_0x3ea2d1['push'](_0x3ea2d1['shift']());}}}(a59_0x7fc9,0xda268));function a59_0x7fc9(){const _0x59ac17=['132kkEnQd','2646WnAkHE','112yGXbXU','54OPUMHJ','trim','281KPTTVS','Agent\x20reference\x20cannot\x20be\x20empty','11114kraDqc','300kIjLgw','split','1342130FuvewG','18753kWPKGM','length','Agent\x20name\x20cannot\x20be\x20empty','48283066jkuOvk','Invalid\x20agent\x20reference\x20format:\x20','731896ltnaTG','282667YhERAs','380DeHEFr'];a59_0x7fc9=function(){return _0x59ac17;};return a59_0x7fc9();}function a59_0x5763(_0x346a50,_0x3e85b4){const _0x7fc902=a59_0x7fc9();return a59_0x5763=function(_0x576397,_0x4dd429){_0x576397=_0x576397-0xba;let _0x522b42=_0x7fc902[_0x576397];return _0x522b42;},a59_0x5763(_0x346a50,_0x3e85b4);}export function parseAgentRef(_0x117e5d){const _0x486a5d=a59_0x5763;if(!_0x117e5d||_0x117e5d[_0x486a5d(0xc6)]()==='')throw new Error(_0x486a5d(0xc8));const _0x477c38=_0x117e5d[_0x486a5d(0xc6)](),_0x184150=_0x477c38[_0x486a5d(0xcb)]('/');if(_0x184150[_0x486a5d(0xbb)]===0x1)return{'projectName':_0x184150[0x0],'agentName':undefined};else{if(_0x184150[_0x486a5d(0xbb)]===0x2){const [_0x5e25a3,_0x5c20b3]=_0x184150;if(!_0x5e25a3||_0x5e25a3[_0x486a5d(0xc6)]()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');if(!_0x5c20b3||_0x5c20b3[_0x486a5d(0xc6)]()==='')throw new Error(_0x486a5d(0xbc));return{'projectName':_0x5e25a3[_0x486a5d(0xc6)](),'agentName':_0x5c20b3[_0x486a5d(0xc6)]()};}else throw new Error(_0x486a5d(0xbe)+_0x117e5d+'.\x20Expected\x20\x22project_name\x22\x20or\x20\x22project_name/agent_name\x22');}}
|
package/dist/utils/chat-cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12b8c4,_0x5f55f0){const _0x93fbe7=a60_0x351e,_0x1ee1e8=_0x12b8c4();while(!![]){try{const _0x4c2f9c=-parseInt(_0x93fbe7(0x15b))/0x1*(parseInt(_0x93fbe7(0x164))/0x2)+parseInt(_0x93fbe7(0x15a))/0x3+parseInt(_0x93fbe7(0x159))/0x4+-parseInt(_0x93fbe7(0x163))/0x5+-parseInt(_0x93fbe7(0x166))/0x6*(parseInt(_0x93fbe7(0x15d))/0x7)+parseInt(_0x93fbe7(0x165))/0x8*(parseInt(_0x93fbe7(0x15f))/0x9)+parseInt(_0x93fbe7(0x161))/0xa*(parseInt(_0x93fbe7(0x162))/0xb);if(_0x4c2f9c===_0x5f55f0)break;else _0x1ee1e8['push'](_0x1ee1e8['shift']());}catch(_0x55971f){_0x1ee1e8['push'](_0x1ee1e8['shift']());}}}(a60_0x17e3,0x9d997));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';function a60_0x17e3(){const _0x37845d=['3245920cbjFiI','2763045MHJvFR','37CwZoKM','.cache','7AtWPuZ','cwd','1584DJCMif','trim','15150140lPZlAb','11pKvPMi','4075250fctcfJ','59870LUrLOm','24680GuJMAq','7333782aDFCQV','utf-8'];a60_0x17e3=function(){return _0x37845d;};return a60_0x17e3();}import{join}from'path';function getCacheDir(){const _0x207e89=a60_0x351e;return join(process[_0x207e89(0x15e)](),_0x207e89(0x15c),'tdx');}function getLastChatIdPath(){return join(getCacheDir(),'last_chat_id');}function ensureCacheDir(){const _0x328d19=getCacheDir();!existsSync(_0x328d19)&&mkdirSync(_0x328d19,{'recursive':!![]});}function a60_0x351e(_0xcd5e95,_0x5904f7){const _0x17e3c4=a60_0x17e3();return a60_0x351e=function(_0x351eda,_0x1f27f9){_0x351eda=_0x351eda-0x159;let _0x3c9f89=_0x17e3c4[_0x351eda];return _0x3c9f89;},a60_0x351e(_0xcd5e95,_0x5904f7);}export function saveLastChatId(_0x1243e6){const _0x620a34=a60_0x351e;ensureCacheDir();const _0x5af0af=getLastChatIdPath();writeFileSync(_0x5af0af,_0x1243e6,_0x620a34(0x167));}export function loadLastChatId(){const _0x11931f=a60_0x351e,_0x49c915=getLastChatIdPath();if(!existsSync(_0x49c915))return undefined;try{const _0x45a2d7=readFileSync(_0x49c915,_0x11931f(0x167))[_0x11931f(0x160)]();return _0x45a2d7||undefined;}catch{return undefined;}}export function clearLastChatId(){const _0x6808a0=a60_0x351e,_0x125f56=getLastChatIdPath();if(existsSync(_0x125f56))try{writeFileSync(_0x125f56,'',_0x6808a0(0x167));}catch{}}
|
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5eca20,_0x412605){const _0x343e14=a61_0x21e6,_0xc09f30=_0x5eca20();while(!![]){try{const _0x3fd331=-parseInt(_0x343e14(0xe8))/0x1+-parseInt(_0x343e14(0x100))/0x2*(parseInt(_0x343e14(0xe7))/0x3)+parseInt(_0x343e14(0xed))/0x4+parseInt(_0x343e14(0xea))/0x5*(parseInt(_0x343e14(0xf9))/0x6)+-parseInt(_0x343e14(0xeb))/0x7+parseInt(_0x343e14(0xf2))/0x8+-parseInt(_0x343e14(0xf3))/0x9;if(_0x3fd331===_0x412605)break;else _0xc09f30['push'](_0xc09f30['shift']());}catch(_0x56483a){_0xc09f30['push'](_0xc09f30['shift']());}}}(a61_0x54ce,0x6f82b));import{Chalk}from'chalk';function a61_0x54ce(){const _0x185645=['2920264UWGuqX','203265zoSZXO','boolean','noColor','length','stdout','stringify','1323492WJUbUl','blue','null','color','isArray','green','cyan','2018naZIYy','env','number','map','NO_COLOR','join','1005yTJSmo','911828xAkDbs','dim','20tAEvmk','883393eXKWNo','entries','2432052sSBXdc','object','repeat','yellow','string'];a61_0x54ce=function(){return _0x185645;};return a61_0x54ce();}export function shouldUseColor(_0x19cd9f={}){const _0x17eeaf=a61_0x21e6;if(_0x19cd9f[_0x17eeaf(0xf5)]===!![])return![];if(_0x19cd9f[_0x17eeaf(0xfc)]===!![])return!![];if(process[_0x17eeaf(0xe2)][_0x17eeaf(0xe5)]!==undefined)return![];return process[_0x17eeaf(0xf7)]['isTTY']??![];}export function getChalk(_0x215c0a={}){if(shouldUseColor(_0x215c0a))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0x388f45,_0x154f7c={}){const _0x480ff9=a61_0x21e6;return getChalk(_0x154f7c)[_0x480ff9(0xe9)](_0x388f45);}export function colorHeader(_0x58f645,_0x4073f1={}){return getChalk(_0x4073f1)['cyan'](_0x58f645);}function a61_0x21e6(_0x5e9ddd,_0x4cb2d6){const _0x54ce52=a61_0x54ce();return a61_0x21e6=function(_0x21e6b6,_0xe1c637){_0x21e6b6=_0x21e6b6-0xe2;let _0x3f189c=_0x54ce52[_0x21e6b6];return _0x3f189c;},a61_0x21e6(_0x5e9ddd,_0x4cb2d6);}export function colorType(_0x4fbc2c,_0x101933={}){const _0x162ba6=a61_0x21e6;return getChalk(_0x101933)[_0x162ba6(0xe9)](_0x4fbc2c);}export function colorJSONKey(_0xbebf13,_0x573463={}){const _0x5cce97=a61_0x21e6;return getChalk(_0x573463)[_0x5cce97(0xfa)](_0xbebf13);}export function colorJSONString(_0x226713,_0x55200f={}){const _0x3a20fc=a61_0x21e6;return getChalk(_0x55200f)[_0x3a20fc(0xfe)](_0x226713);}export function colorJSONNumber(_0x4d2c7c,_0xb35d88={}){const _0x3d18c4=a61_0x21e6;return getChalk(_0xb35d88)[_0x3d18c4(0xff)](_0x4d2c7c);}export function colorJSONBoolean(_0xacbdb2,_0x577900={}){const _0x4c0b74=a61_0x21e6;return getChalk(_0x577900)[_0x4c0b74(0xf0)](_0xacbdb2);}export function colorJSONNull(_0x1e25ba,_0x14d65a={}){const _0x49ecd4=a61_0x21e6;return getChalk(_0x14d65a)[_0x49ecd4(0xe9)](_0x1e25ba);}export function colorizeJSONCompact(_0xb8759b,_0x5cb33e={}){const _0x15ac13=a61_0x21e6;if(!shouldUseColor(_0x5cb33e))return JSON[_0x15ac13(0xf8)](_0xb8759b);if(_0xb8759b===null)return colorJSONNull(_0x15ac13(0xfb),_0x5cb33e);if(typeof _0xb8759b===_0x15ac13(0xf4))return colorJSONBoolean(String(_0xb8759b),_0x5cb33e);if(typeof _0xb8759b===_0x15ac13(0xe3))return colorJSONNumber(String(_0xb8759b),_0x5cb33e);if(typeof _0xb8759b===_0x15ac13(0xf1))return colorJSONString(JSON[_0x15ac13(0xf8)](_0xb8759b),_0x5cb33e);if(Array[_0x15ac13(0xfd)](_0xb8759b)){if(_0xb8759b['length']===0x0)return'[]';const _0x3899d2=_0xb8759b[_0x15ac13(0xe4)](_0x1db64e=>colorizeJSONCompact(_0x1db64e,_0x5cb33e));return'['+_0x3899d2[_0x15ac13(0xe6)](',')+']';}if(typeof _0xb8759b==='object'){const _0x596126=Object['entries'](_0xb8759b);if(_0x596126['length']===0x0)return'{}';const _0x2de985=_0x596126[_0x15ac13(0xe4)](([_0x52aec0,_0x19a167])=>{const _0x1cb30d=_0x15ac13,_0x54c0a5=colorJSONKey(JSON[_0x1cb30d(0xf8)](_0x52aec0),_0x5cb33e),_0x587f22=colorizeJSONCompact(_0x19a167,_0x5cb33e);return _0x54c0a5+':'+_0x587f22;});return'{'+_0x2de985[_0x15ac13(0xe6)](',')+'}';}return String(_0xb8759b);}export function colorizeJSON(_0x3cf523,_0x24f2b8={},_0x3cc437=0x0){const _0x3ae661=a61_0x21e6;if(!shouldUseColor(_0x24f2b8))return JSON['stringify'](_0x3cf523,null,0x2);const _0xc629da='\x20'['repeat'](_0x3cc437),_0x24e03b=_0x3cc437+0x2;if(_0x3cf523===null)return colorJSONNull(_0x3ae661(0xfb),_0x24f2b8);if(typeof _0x3cf523===_0x3ae661(0xf4))return colorJSONBoolean(String(_0x3cf523),_0x24f2b8);if(typeof _0x3cf523===_0x3ae661(0xe3))return colorJSONNumber(String(_0x3cf523),_0x24f2b8);if(typeof _0x3cf523===_0x3ae661(0xf1))return colorJSONString(JSON[_0x3ae661(0xf8)](_0x3cf523),_0x24f2b8);if(Array[_0x3ae661(0xfd)](_0x3cf523)){if(_0x3cf523['length']===0x0)return'[]';const _0x4ee497=_0x3cf523['map'](_0x8ea54c=>{const _0x481eb6=_0x3ae661,_0x380ea0=colorizeJSON(_0x8ea54c,_0x24f2b8,_0x24e03b);return''+'\x20'[_0x481eb6(0xef)](_0x24e03b)+_0x380ea0;});return'[\x0a'+_0x4ee497['join'](',\x0a')+('\x0a'+_0xc629da+']');}if(typeof _0x3cf523===_0x3ae661(0xee)){const _0x5348e5=Object[_0x3ae661(0xec)](_0x3cf523);if(_0x5348e5[_0x3ae661(0xf6)]===0x0)return'{}';const _0x260388=_0x5348e5[_0x3ae661(0xe4)](([_0x2469a8,_0x4a07d1])=>{const _0x316134=_0x3ae661,_0x11a1f9=colorJSONKey(JSON[_0x316134(0xf8)](_0x2469a8),_0x24f2b8),_0x566ffa=colorizeJSON(_0x4a07d1,_0x24f2b8,_0x24e03b);return''+'\x20'[_0x316134(0xef)](_0x24e03b)+_0x11a1f9+':\x20'+_0x566ffa;});return'{\x0a'+_0x260388['join'](',\x0a')+('\x0a'+_0xc629da+'}');}return String(_0x3cf523);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x504c3c,_0x5b0487){const _0x1d8db4=a62_0x4687,_0x5d336f=_0x504c3c();while(!![]){try{const _0x2f969a=parseInt(_0x1d8db4(0x131))/0x1+-parseInt(_0x1d8db4(0x145))/0x2*(-parseInt(_0x1d8db4(0x12c))/0x3)+parseInt(_0x1d8db4(0x139))/0x4*(parseInt(_0x1d8db4(0x137))/0x5)+parseInt(_0x1d8db4(0x146))/0x6+parseInt(_0x1d8db4(0x15c))/0x7*(parseInt(_0x1d8db4(0x12f))/0x8)+parseInt(_0x1d8db4(0x15a))/0x9+-parseInt(_0x1d8db4(0x14f))/0xa;if(_0x2f969a===_0x5b0487)break;else _0x5d336f['push'](_0x5d336f['shift']());}catch(_0x319a24){_0x5d336f['push'](_0x5d336f['shift']());}}}(a62_0x3de3,0xcfc2d));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';function a62_0x4687(_0x339a8f,_0x36f527){const _0x3de3ee=a62_0x3de3();return a62_0x4687=function(_0x4687d6,_0x1f0391){_0x4687d6=_0x4687d6-0x11e;let _0x2d2e35=_0x3de3ee[_0x4687d6];return _0x2d2e35;},a62_0x4687(_0x339a8f,_0x36f527);}import a62_0x260ecc from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x3af49e){const _0x5f1e40=a62_0x4687;return{'format':_0x3af49e[_0x5f1e40(0x141)]||_0x5f1e40(0x124),'output':_0x3af49e[_0x5f1e40(0x12d)]||'','limit':_0x3af49e[_0x5f1e40(0x154)],'color':_0x3af49e[_0x5f1e40(0x151)],'noColor':_0x3af49e[_0x5f1e40(0x126)]};}function convertSDKResultToQueryResult(_0x7a7b13){const _0x2b30f1=a62_0x4687,_0xc3e630=[];if(_0x7a7b13[_0x2b30f1(0x120)]>0x0){const _0x4e0ace=_0x7a7b13[0x0];for(const [_0xc05396,_0x43c7f3]of Object[_0x2b30f1(0x12a)](_0x4e0ace)){let _0x4de1dc=_0x2b30f1(0x142);if(typeof _0x43c7f3==='number')_0x4de1dc=Number['isInteger'](_0x43c7f3)?'bigint':_0x2b30f1(0x128);else{if(typeof _0x43c7f3===_0x2b30f1(0x138))_0x4de1dc=_0x2b30f1(0x138);else _0x43c7f3===null&&(_0x4de1dc=_0x2b30f1(0x142));}_0xc3e630[_0x2b30f1(0x12b)]({'name':_0xc05396,'type':_0x4de1dc});}}return{'queryId':'sdk-result','columns':_0xc3e630,'data':_0x7a7b13,'stats':{'state':_0x2b30f1(0x14e),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x7a7b13[_0x2b30f1(0x120)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x47195b,_0x2424ac){const _0x4d9a15=convertSDKResultToQueryResult(_0x47195b);return formatQueryOutput(_0x4d9a15,_0x2424ac);}export async function formatQueryOutput(_0x31cee9,_0x352799){const _0x49bd24=a62_0x4687,{format:_0x35228b,limit:_0x4d8bf0,output:_0x19d13d,color:_0x1b825a,noColor:_0x54b37d}=_0x352799,_0x57e66f=Boolean(_0x19d13d)&&!_0x1b825a,_0x3eb275={'color':_0x1b825a,'noColor':_0x54b37d||_0x57e66f};if(_0x35228b===_0x49bd24(0x124)){const _0x10b465=shouldUseLess(_0x35228b,_0x19d13d);return formatAsTable(_0x31cee9,_0x4d8bf0,_0x10b465,_0x3eb275);}else{if(_0x35228b===_0x49bd24(0x125))return formatAsJSON(_0x31cee9,_0x3eb275);else return _0x35228b===_0x49bd24(0x157)?formatAsJSONL(_0x31cee9,_0x3eb275):formatQueryResult(_0x31cee9,_0x35228b);}}function shouldUseLess(_0xab4fa,_0x11d1ca){const _0x4b216a=a62_0x4687;return _0xab4fa===_0x4b216a(0x124)&&process[_0x4b216a(0x123)][_0x4b216a(0x152)]&&!_0x11d1ca;}export function resolveOutputOptions(_0x4208b0){const _0x45b425=a62_0x4687,_0x382bee=resolveOutputFormat(_0x4208b0[_0x45b425(0x141)],_0x4208b0[_0x45b425(0x12d)],_0x45b425(0x124));let _0x3c83be=typeof _0x4208b0[_0x45b425(0x154)]==='number'?_0x4208b0[_0x45b425(0x154)]:parseInt(_0x4208b0[_0x45b425(0x154)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x4e485a=_0x4208b0[_0x45b425(0x12d)]||'';return shouldUseLess(_0x382bee,_0x4e485a)&&(_0x3c83be=Infinity),{'format':_0x382bee,'output':_0x4e485a,'limit':_0x3c83be,'color':_0x4208b0['color'],'noColor':_0x4208b0['noColor']};}function a62_0x3de3(){const _0x58292e=['error','FINISHED','40899720UArCJH','cyan','color','isTTY','end','limit','trim','forEach','jsonl','tsv','inherit','11898450wemxvg','[logs]','72366UBrtKR','log','join','length','pipe','repeat','stdout','table','json','noColor','max','double','query','entries','push','246nKtamQ','output','write','1016YzDvZQ','[query]','783076ippHhY','yellow','object','─┬─','spawn','cmdout','5uMbuXK','boolean','1675100BzIhcj','split','debug','resolve','-FXRSn','stringify','padEnd','bold','format','varchar','─┴─','map','942vylPRl','6393072uqdRmi','close','stderr','[error]','less','stdin','red'];a62_0x3de3=function(){return _0x58292e;};return a62_0x3de3();}export function writeOutput(_0x53f440,_0x40a66c,_0xa3bab2){const _0x50eb10=a62_0x4687;return _0x40a66c?(writeFileSync(_0x40a66c,_0x53f440),console[_0x50eb10(0x14d)]('Results\x20saved\x20to\x20'+_0x40a66c),Promise['resolve']()):shouldUseLess(_0xa3bab2||'','')?new Promise(_0x4d8e38=>{const _0x310dc9=_0x50eb10,_0x93041b=spawn(_0x310dc9(0x14a),[_0x310dc9(0x13d)],{'stdio':[_0x310dc9(0x121),_0x310dc9(0x159),_0x310dc9(0x159)]});let _0x487c5b=![];_0x93041b['on'](_0x310dc9(0x14d),()=>{const _0x24884e=_0x310dc9;!_0x487c5b&&(_0x487c5b=!![],console[_0x24884e(0x11e)](_0x53f440),_0x4d8e38());}),_0x93041b['on'](_0x310dc9(0x147),()=>{!_0x487c5b&&(_0x487c5b=!![],_0x4d8e38());}),_0x93041b['on'](_0x310dc9(0x135),()=>{const _0x3d8c2b=_0x310dc9;!_0x487c5b&&_0x93041b[_0x3d8c2b(0x14b)]&&(_0x93041b[_0x3d8c2b(0x14b)]['on'](_0x3d8c2b(0x14d),()=>{}),_0x93041b['stdin'][_0x3d8c2b(0x12e)](_0x53f440),_0x93041b[_0x3d8c2b(0x14b)][_0x3d8c2b(0x153)]());}),!_0x93041b[_0x310dc9(0x14b)]&&(!_0x487c5b&&(_0x487c5b=!![],console[_0x310dc9(0x11e)](_0x53f440),_0x4d8e38()));}):(console[_0x50eb10(0x11e)](_0x53f440),Promise[_0x50eb10(0x13c)]());}export async function handleSDKOutput(_0x5ac1fc,_0x2c3d78){const _0x2225ca=a62_0x4687,_0x5e1417=resolveOutputOptions(_0x2c3d78),_0x51c558=await formatSDKOutput(_0x5ac1fc,_0x5e1417);await writeOutput(_0x51c558,_0x5e1417[_0x2225ca(0x12d)]||undefined,_0x5e1417[_0x2225ca(0x141)]);}export async function handleQueryOutput(_0x579b7a,_0x1aed31){const _0x206d84=a62_0x4687,_0x36266b=resolveOutputOptions(_0x1aed31),_0x3d8474=await formatQueryOutput(_0x579b7a,_0x36266b);await writeOutput(_0x3d8474,_0x36266b[_0x206d84(0x12d)]||undefined,_0x36266b[_0x206d84(0x141)]);}async function formatSingleObject(_0x26939f,_0x3071a2){const _0x347e48=a62_0x4687,{format:_0xf207d0,color:_0x32f237,noColor:_0x359140}=_0x3071a2,_0x19f38f={'color':_0x32f237,'noColor':_0x359140};if(_0xf207d0===_0x347e48(0x125)){if(shouldUseColor(_0x19f38f))return colorizeJSON(_0x26939f,_0x19f38f);return JSON['stringify'](_0x26939f,null,0x2);}else{if(_0xf207d0===_0x347e48(0x157)){if(shouldUseColor(_0x19f38f))return colorizeJSONCompact(_0x26939f,_0x19f38f);return JSON[_0x347e48(0x13e)](_0x26939f);}else{if(_0xf207d0===_0x347e48(0x158))return Object['entries'](_0x26939f)['map'](([_0x5b862e,_0x29f294])=>_0x5b862e+'\x09'+_0x29f294)[_0x347e48(0x11f)]('\x0a');else{const _0x257fdc=Object[_0x347e48(0x12a)](_0x26939f);if(_0x257fdc[_0x347e48(0x120)]===0x0)return'No\x20data';const _0x4329d8=_0x26939f['debug'],_0x1e36b5=_0x26939f[_0x347e48(0x129)],_0xf241ad=_0x1e36b5?typeof _0x1e36b5==='string'?_0x1e36b5:JSON['stringify'](_0x1e36b5,null,0x2):undefined,_0x333a7d=_0x257fdc['filter'](([_0x1712ec])=>_0x1712ec!==_0x347e48(0x13b)&&_0x1712ec!==_0x347e48(0x129)),_0x43d344=Math[_0x347e48(0x127)](..._0x333a7d[_0x347e48(0x144)](([_0x2f5a30])=>_0x2f5a30[_0x347e48(0x120)])),_0x3a8e9b=Math[_0x347e48(0x127)](..._0x333a7d[_0x347e48(0x144)](([,_0x252f37])=>{const _0x507cae=_0x347e48;try{const _0x2144c0=_0x252f37===null||_0x252f37===undefined?'':typeof _0x252f37===_0x507cae(0x133)?JSON[_0x507cae(0x13e)](_0x252f37):String(_0x252f37),_0x319e45=_0x2144c0[_0x507cae(0x13a)]('\x0a');return Math['max'](..._0x319e45[_0x507cae(0x144)](_0x435a89=>_0x435a89[_0x507cae(0x120)]),0x0);}catch{return 0x0;}}),0x14),_0x3e070a=[];_0x3e070a[_0x347e48(0x12b)](colorBorder('┌─'+'─'[_0x347e48(0x122)](_0x43d344)+_0x347e48(0x134)+'─'['repeat'](_0x3a8e9b)+'─┐',_0x19f38f)),_0x333a7d[_0x347e48(0x156)](([_0x10b739,_0x1ae48b])=>{const _0x29ef3e=_0x347e48;let _0x526dae;try{_0x526dae=_0x1ae48b===null||_0x1ae48b===undefined?'':typeof _0x1ae48b===_0x29ef3e(0x133)?JSON[_0x29ef3e(0x13e)](_0x1ae48b):String(_0x1ae48b);}catch{_0x526dae='[Object]';}const _0x2dcb20=_0x10b739[_0x29ef3e(0x13f)](_0x43d344),_0x5ec1f1=_0x526dae[_0x29ef3e(0x13a)]('\x0a');_0x5ec1f1['forEach']((_0x3bc13d,_0x2426bb)=>{const _0x557b7f=_0x29ef3e,_0x117ec7=colorBorder('│',_0x19f38f);_0x2426bb===0x0?_0x3e070a[_0x557b7f(0x12b)](_0x117ec7+'\x20'+_0x2dcb20+'\x20'+_0x117ec7+'\x20'+_0x3bc13d['padEnd'](_0x3a8e9b)+'\x20'+_0x117ec7):_0x3e070a[_0x557b7f(0x12b)](_0x117ec7+'\x20'+'\x20'['repeat'](_0x43d344)+'\x20'+_0x117ec7+'\x20'+_0x3bc13d[_0x557b7f(0x13f)](_0x3a8e9b)+'\x20'+_0x117ec7);});}),_0x3e070a[_0x347e48(0x12b)](colorBorder('└─'+'─'['repeat'](_0x43d344)+_0x347e48(0x143)+'─'['repeat'](_0x3a8e9b)+'─┘',_0x19f38f));_0xf241ad&&(_0x3e070a[_0x347e48(0x12b)](''),_0x3e070a[_0x347e48(0x12b)](String(a62_0x260ecc[_0x347e48(0x132)][_0x347e48(0x140)](_0x347e48(0x130)))),_0x3e070a[_0x347e48(0x12b)](_0xf241ad));if(_0x4329d8){if(_0x4329d8[_0x347e48(0x148)]){_0x3e070a[_0x347e48(0x12b)](''),_0x3e070a[_0x347e48(0x12b)](String(a62_0x260ecc[_0x347e48(0x14c)][_0x347e48(0x140)](_0x347e48(0x149))));const _0x3a4673=_0x4329d8[_0x347e48(0x148)]['split']('\x0a');_0x3a4673[_0x347e48(0x156)](_0x509341=>{const _0x2135ad=_0x347e48;_0x509341[_0x2135ad(0x155)]()&&_0x3e070a[_0x2135ad(0x12b)](_0x509341);});}if(_0x4329d8['cmdout']){_0x3e070a[_0x347e48(0x12b)](''),_0x3e070a[_0x347e48(0x12b)](String(a62_0x260ecc[_0x347e48(0x150)][_0x347e48(0x140)](_0x347e48(0x15b))));const _0x95207c=_0x4329d8[_0x347e48(0x136)][_0x347e48(0x13a)]('\x0a');_0x95207c['forEach'](_0x4128bb=>{const _0x65b675=_0x347e48;_0x4128bb['trim']()&&_0x3e070a[_0x65b675(0x12b)](_0x4128bb);});}}return _0x3e070a[_0x347e48(0x11f)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x5a6dce,_0x30aa9c){const _0xf6f4b1=a62_0x4687,_0x134985=resolveOutputOptions(_0x30aa9c),_0x1e38e8=await formatSingleObject(_0x5a6dce,_0x134985);await writeOutput(_0x1e38e8,_0x134985[_0xf6f4b1(0x12d)]||undefined,_0x134985[_0xf6f4b1(0x141)]);}
|
|
1
|
+
(function(_0x358954,_0x111198){const _0xf55a31=a62_0x170f,_0x18f526=_0x358954();while(!![]){try{const _0x1d552d=-parseInt(_0xf55a31(0xf0))/0x1*(parseInt(_0xf55a31(0xe6))/0x2)+-parseInt(_0xf55a31(0xce))/0x3+-parseInt(_0xf55a31(0xe4))/0x4*(-parseInt(_0xf55a31(0xe7))/0x5)+-parseInt(_0xf55a31(0xd6))/0x6+-parseInt(_0xf55a31(0xf3))/0x7+parseInt(_0xf55a31(0xd8))/0x8+parseInt(_0xf55a31(0xc1))/0x9;if(_0x1d552d===_0x111198)break;else _0x18f526['push'](_0x18f526['shift']());}catch(_0x46d57e){_0x18f526['push'](_0x18f526['shift']());}}}(a62_0x326e,0x4f23b));function a62_0x170f(_0x1eedd6,_0x5768ee){const _0x326ea1=a62_0x326e();return a62_0x170f=function(_0x170ffc,_0x5021b1){_0x170ffc=_0x170ffc-0xba;let _0x1c536b=_0x326ea1[_0x170ffc];return _0x1c536b;},a62_0x170f(_0x1eedd6,_0x5768ee);}import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';function a62_0x326e(){const _0x43bd2e=['yellow','error','boolean','bold','3216816TTjjnM','format','trim','stderr','stdout','filter','table','cyan','forEach','[query]','object','double','-FXRSn','295164joaoMd','push','isTTY','stdin','split','[error]','tsv','red','302580crgxgZ','jsonl','355904MOCCtq','number','color','end','less','─┴─','isInteger','json','noColor','output','entries','resolve','288156dDBfXc','padEnd','1990FLbOYk','25SIObWp','[Object]','─┬─','length','varchar','join','repeat','bigint','max','219uoCKSR','log','pipe','498603JTPQHc','map','limit','stringify','cmdout','write'];a62_0x326e=function(){return _0x43bd2e;};return a62_0x326e();}import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a62_0x377716 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x1306eb){const _0x2f966c=a62_0x170f;return{'format':_0x1306eb[_0x2f966c(0xc2)]||_0x2f966c(0xc7),'output':_0x1306eb[_0x2f966c(0xe1)]||'','limit':_0x1306eb['limit'],'color':_0x1306eb[_0x2f966c(0xda)],'noColor':_0x1306eb[_0x2f966c(0xe0)]};}function convertSDKResultToQueryResult(_0x1d73ff){const _0x3b553e=a62_0x170f,_0x22fb31=[];if(_0x1d73ff[_0x3b553e(0xea)]>0x0){const _0x461376=_0x1d73ff[0x0];for(const [_0x55a2ae,_0xc7a87e]of Object[_0x3b553e(0xe2)](_0x461376)){let _0x512c27=_0x3b553e(0xeb);if(typeof _0xc7a87e===_0x3b553e(0xd9))_0x512c27=Number[_0x3b553e(0xde)](_0xc7a87e)?_0x3b553e(0xee):_0x3b553e(0xcc);else{if(typeof _0xc7a87e===_0x3b553e(0xbf))_0x512c27='boolean';else _0xc7a87e===null&&(_0x512c27='varchar');}_0x22fb31[_0x3b553e(0xcf)]({'name':_0x55a2ae,'type':_0x512c27});}}return{'queryId':'sdk-result','columns':_0x22fb31,'data':_0x1d73ff,'stats':{'state':'FINISHED','queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1d73ff[_0x3b553e(0xea)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x511b20,_0x2f13ba){const _0x149111=convertSDKResultToQueryResult(_0x511b20);return formatQueryOutput(_0x149111,_0x2f13ba);}export async function formatQueryOutput(_0x220ee8,_0x510fc8){const _0xadacf1=a62_0x170f,{format:_0x505ed6,limit:_0x9e2873,output:_0xfe3f00,color:_0x18581f,noColor:_0x4aa056}=_0x510fc8,_0x160823=Boolean(_0xfe3f00)&&!_0x18581f,_0x139460={'color':_0x18581f,'noColor':_0x4aa056||_0x160823};if(_0x505ed6===_0xadacf1(0xc7)){const _0x9ee3e5=shouldUseLess(_0x505ed6,_0xfe3f00);return formatAsTable(_0x220ee8,_0x9e2873,_0x9ee3e5,_0x139460);}else{if(_0x505ed6==='json')return formatAsJSON(_0x220ee8,_0x139460);else return _0x505ed6===_0xadacf1(0xd7)?formatAsJSONL(_0x220ee8,_0x139460):formatQueryResult(_0x220ee8,_0x505ed6);}}function shouldUseLess(_0x2c7c36,_0x1b32b8){const _0x10df0d=a62_0x170f;return _0x2c7c36===_0x10df0d(0xc7)&&process[_0x10df0d(0xc5)][_0x10df0d(0xd0)]&&!_0x1b32b8;}export function resolveOutputOptions(_0x4f7f65){const _0x2dcb50=a62_0x170f,_0x462058=resolveOutputFormat(_0x4f7f65[_0x2dcb50(0xc2)],_0x4f7f65[_0x2dcb50(0xe1)],_0x2dcb50(0xc7));let _0x4c2581=typeof _0x4f7f65[_0x2dcb50(0xf5)]===_0x2dcb50(0xd9)?_0x4f7f65[_0x2dcb50(0xf5)]:parseInt(_0x4f7f65[_0x2dcb50(0xf5)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x30c289=_0x4f7f65['output']||'';return shouldUseLess(_0x462058,_0x30c289)&&(_0x4c2581=Infinity),{'format':_0x462058,'output':_0x30c289,'limit':_0x4c2581,'color':_0x4f7f65[_0x2dcb50(0xda)],'noColor':_0x4f7f65[_0x2dcb50(0xe0)]};}export function writeOutput(_0xa9141,_0x4d52f5,_0x3af47d){const _0x50b5e5=a62_0x170f;return _0x4d52f5?(writeFileSync(_0x4d52f5,_0xa9141),console[_0x50b5e5(0xbe)]('Results\x20saved\x20to\x20'+_0x4d52f5),Promise[_0x50b5e5(0xe3)]()):shouldUseLess(_0x3af47d||'','')?new Promise(_0x3c4a75=>{const _0x3b4b10=_0x50b5e5,_0x1714ae=spawn(_0x3b4b10(0xdc),[_0x3b4b10(0xcd)],{'stdio':[_0x3b4b10(0xf2),'inherit','inherit']});let _0x990051=![];_0x1714ae['on'](_0x3b4b10(0xbe),()=>{!_0x990051&&(_0x990051=!![],console['log'](_0xa9141),_0x3c4a75());}),_0x1714ae['on']('close',()=>{!_0x990051&&(_0x990051=!![],_0x3c4a75());}),_0x1714ae['on']('spawn',()=>{const _0x5c777b=_0x3b4b10;!_0x990051&&_0x1714ae[_0x5c777b(0xd1)]&&(_0x1714ae[_0x5c777b(0xd1)]['on']('error',()=>{}),_0x1714ae[_0x5c777b(0xd1)][_0x5c777b(0xbc)](_0xa9141),_0x1714ae[_0x5c777b(0xd1)][_0x5c777b(0xdb)]());}),!_0x1714ae[_0x3b4b10(0xd1)]&&(!_0x990051&&(_0x990051=!![],console['log'](_0xa9141),_0x3c4a75()));}):(console[_0x50b5e5(0xf1)](_0xa9141),Promise['resolve']());}export async function handleSDKOutput(_0xbc8a5c,_0x9f6477){const _0x31bdf0=a62_0x170f,_0x35b587=resolveOutputOptions(_0x9f6477),_0x239ad5=await formatSDKOutput(_0xbc8a5c,_0x35b587);await writeOutput(_0x239ad5,_0x35b587[_0x31bdf0(0xe1)]||undefined,_0x35b587[_0x31bdf0(0xc2)]);}export async function handleQueryOutput(_0x2e0ac3,_0x486238){const _0x165dae=a62_0x170f,_0x10e03c=resolveOutputOptions(_0x486238),_0x2a1110=await formatQueryOutput(_0x2e0ac3,_0x10e03c);await writeOutput(_0x2a1110,_0x10e03c[_0x165dae(0xe1)]||undefined,_0x10e03c[_0x165dae(0xc2)]);}async function formatSingleObject(_0x48af7c,_0x1dc0cf){const _0x32fe88=a62_0x170f,{format:_0x2a624b,color:_0x4c2a2f,noColor:_0x224f2b}=_0x1dc0cf,_0x269b19={'color':_0x4c2a2f,'noColor':_0x224f2b};if(_0x2a624b===_0x32fe88(0xdf)){if(shouldUseColor(_0x269b19))return colorizeJSON(_0x48af7c,_0x269b19);return JSON[_0x32fe88(0xba)](_0x48af7c,null,0x2);}else{if(_0x2a624b===_0x32fe88(0xd7)){if(shouldUseColor(_0x269b19))return colorizeJSONCompact(_0x48af7c,_0x269b19);return JSON[_0x32fe88(0xba)](_0x48af7c);}else{if(_0x2a624b===_0x32fe88(0xd4))return Object[_0x32fe88(0xe2)](_0x48af7c)[_0x32fe88(0xf4)](([_0x17741,_0x46de00])=>_0x17741+'\x09'+_0x46de00)[_0x32fe88(0xec)]('\x0a');else{const _0x2aeec0=Object[_0x32fe88(0xe2)](_0x48af7c);if(_0x2aeec0[_0x32fe88(0xea)]===0x0)return'No\x20data';const _0x5f4b8c=_0x48af7c['debug'],_0x18977d=_0x48af7c['query'],_0x5e618b=_0x18977d?typeof _0x18977d==='string'?_0x18977d:JSON[_0x32fe88(0xba)](_0x18977d,null,0x2):undefined,_0x562ccb=_0x2aeec0[_0x32fe88(0xc6)](([_0x511921])=>_0x511921!=='debug'&&_0x511921!=='query'),_0x2784a3=Math[_0x32fe88(0xef)](..._0x562ccb[_0x32fe88(0xf4)](([_0x4c2fe6])=>_0x4c2fe6[_0x32fe88(0xea)])),_0xb10f45=Math[_0x32fe88(0xef)](..._0x562ccb['map'](([,_0x541da3])=>{const _0x46475e=_0x32fe88;try{const _0x158470=_0x541da3===null||_0x541da3===undefined?'':typeof _0x541da3===_0x46475e(0xcb)?JSON[_0x46475e(0xba)](_0x541da3):String(_0x541da3),_0x4bfc79=_0x158470['split']('\x0a');return Math['max'](..._0x4bfc79['map'](_0x4f8ded=>_0x4f8ded[_0x46475e(0xea)]),0x0);}catch{return 0x0;}}),0x14),_0x2a51c0=[];_0x2a51c0[_0x32fe88(0xcf)](colorBorder('┌─'+'─'[_0x32fe88(0xed)](_0x2784a3)+_0x32fe88(0xe9)+'─'[_0x32fe88(0xed)](_0xb10f45)+'─┐',_0x269b19)),_0x562ccb[_0x32fe88(0xc9)](([_0x1567da,_0x4e62a0])=>{const _0x4d82e9=_0x32fe88;let _0x35ac5e;try{_0x35ac5e=_0x4e62a0===null||_0x4e62a0===undefined?'':typeof _0x4e62a0==='object'?JSON['stringify'](_0x4e62a0):String(_0x4e62a0);}catch{_0x35ac5e=_0x4d82e9(0xe8);}const _0x3516f8=_0x1567da[_0x4d82e9(0xe5)](_0x2784a3),_0x487298=_0x35ac5e[_0x4d82e9(0xd2)]('\x0a');_0x487298['forEach']((_0x363cfb,_0x3dc8d9)=>{const _0x465928=_0x4d82e9,_0x463f73=colorBorder('│',_0x269b19);_0x3dc8d9===0x0?_0x2a51c0['push'](_0x463f73+'\x20'+_0x3516f8+'\x20'+_0x463f73+'\x20'+_0x363cfb[_0x465928(0xe5)](_0xb10f45)+'\x20'+_0x463f73):_0x2a51c0[_0x465928(0xcf)](_0x463f73+'\x20'+'\x20'[_0x465928(0xed)](_0x2784a3)+'\x20'+_0x463f73+'\x20'+_0x363cfb[_0x465928(0xe5)](_0xb10f45)+'\x20'+_0x463f73);});}),_0x2a51c0['push'](colorBorder('└─'+'─'[_0x32fe88(0xed)](_0x2784a3)+_0x32fe88(0xdd)+'─'[_0x32fe88(0xed)](_0xb10f45)+'─┘',_0x269b19));_0x5e618b&&(_0x2a51c0[_0x32fe88(0xcf)](''),_0x2a51c0[_0x32fe88(0xcf)](String(a62_0x377716[_0x32fe88(0xbd)][_0x32fe88(0xc0)](_0x32fe88(0xca)))),_0x2a51c0[_0x32fe88(0xcf)](_0x5e618b));if(_0x5f4b8c){if(_0x5f4b8c[_0x32fe88(0xc4)]){_0x2a51c0[_0x32fe88(0xcf)](''),_0x2a51c0[_0x32fe88(0xcf)](String(a62_0x377716[_0x32fe88(0xd5)][_0x32fe88(0xc0)](_0x32fe88(0xd3))));const _0x1f8138=_0x5f4b8c[_0x32fe88(0xc4)][_0x32fe88(0xd2)]('\x0a');_0x1f8138[_0x32fe88(0xc9)](_0x1e8945=>{const _0xc27b02=_0x32fe88;_0x1e8945[_0xc27b02(0xc3)]()&&_0x2a51c0[_0xc27b02(0xcf)](_0x1e8945);});}if(_0x5f4b8c[_0x32fe88(0xbb)]){_0x2a51c0['push'](''),_0x2a51c0[_0x32fe88(0xcf)](String(a62_0x377716[_0x32fe88(0xc8)][_0x32fe88(0xc0)]('[logs]')));const _0x3593b6=_0x5f4b8c[_0x32fe88(0xbb)][_0x32fe88(0xd2)]('\x0a');_0x3593b6['forEach'](_0x1883f1=>{const _0x4ce7c0=_0x32fe88;_0x1883f1[_0x4ce7c0(0xc3)]()&&_0x2a51c0[_0x4ce7c0(0xcf)](_0x1883f1);});}}return _0x2a51c0['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x15b9b0,_0x2b0bf7){const _0x5c7c12=a62_0x170f,_0x4b4e7e=resolveOutputOptions(_0x2b0bf7),_0x4b5ca2=await formatSingleObject(_0x15b9b0,_0x4b4e7e);await writeOutput(_0x4b5ca2,_0x4b4e7e[_0x5c7c12(0xe1)]||undefined,_0x4b4e7e[_0x5c7c12(0xc2)]);}
|
package/dist/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x28ae10,_0xb8bbae){const _0x32de9e=a63_0x520d,_0xbba833=_0x28ae10();while(!![]){try{const _0x1be206=parseInt(_0x32de9e(0x79))/0x1+parseInt(_0x32de9e(0x77))/0x2+parseInt(_0x32de9e(0x7e))/0x3+-parseInt(_0x32de9e(0x7b))/0x4+parseInt(_0x32de9e(0x7a))/0x5*(parseInt(_0x32de9e(0x78))/0x6)+-parseInt(_0x32de9e(0x7c))/0x7*(-parseInt(_0x32de9e(0x76))/0x8)+-parseInt(_0x32de9e(0x7d))/0x9*(parseInt(_0x32de9e(0x74))/0xa);if(_0x1be206===_0xb8bbae)break;else _0xbba833['push'](_0xbba833['shift']());}catch(_0x55f128){_0xbba833['push'](_0xbba833['shift']());}}}(a63_0x33c5,0xa93dc));export const DEFAULT_DISPLAY_LIMIT=0x28;function a63_0x33c5(){const _0x4582db=['2125760aVJsnC','6202584FRbITW','2650992RxlLMc','30dYWdxI','number','16mYRnGg','1382792ezPuIL','1101066RSiFFO','570368igReaJ','25orYfJu','3638412ZqMIIa'];a63_0x33c5=function(){return _0x4582db;};return a63_0x33c5();}export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;function a63_0x520d(_0x3c1d1c,_0x2be17e){const _0x33c5fe=a63_0x33c5();return a63_0x520d=function(_0x520d1b,_0x3207f8){_0x520d1b=_0x520d1b-0x74;let _0x7a049a=_0x33c5fe[_0x520d1b];return _0x7a049a;},a63_0x520d(_0x3c1d1c,_0x2be17e);}export function resolveLimit(_0x34c256,_0x5c5d5f){const _0x329464=a63_0x520d;if(_0x34c256===undefined)return _0x5c5d5f;if(typeof _0x34c256===_0x329464(0x75))return _0x34c256;return parseInt(_0x34c256,0xa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x331290,_0x1b1425){const _0x35e7f9=a64_0x3cd5,_0x40c46d=_0x331290();while(!![]){try{const _0xca2207=parseInt(_0x35e7f9(0x1a5))/0x1*(-parseInt(_0x35e7f9(0x1a0))/0x2)+-parseInt(_0x35e7f9(0x1b0))/0x3*(-parseInt(_0x35e7f9(0x1a8))/0x4)+parseInt(_0x35e7f9(0x1ab))/0x5+parseInt(_0x35e7f9(0x1a9))/0x6+parseInt(_0x35e7f9(0x1af))/0x7+parseInt(_0x35e7f9(0x1aa))/0x8+-parseInt(_0x35e7f9(0x19e))/0x9*(parseInt(_0x35e7f9(0x1a7))/0xa);if(_0xca2207===_0x1b1425)break;else _0x40c46d['push'](_0x40c46d['shift']());}catch(_0x2d23ee){_0x40c46d['push'](_0x40c46d['shift']());}}}(a64_0x3b7f,0x6cbe2));import*as a64_0x3da3d2 from'node:fs';function a64_0x3cd5(_0xe799ed,_0xa2bd49){const _0x3b7fcd=a64_0x3b7f();return a64_0x3cd5=function(_0x3cd5ab,_0x55123d){_0x3cd5ab=_0x3cd5ab-0x19e;let _0x3c970b=_0x3b7fcd[_0x3cd5ab];return _0x3c970b;},a64_0x3cd5(_0xe799ed,_0xa2bd49);}import*as a64_0x5c6d05 from'node:path';export function setSecureFilePermissions(_0x2f260e){const _0x181668=a64_0x3cd5;try{a64_0x3da3d2[_0x181668(0x19f)](_0x2f260e,0x180);}catch{console['warn'](_0x181668(0x1a6)+_0x2f260e);}}export function setSecureDirectoryPermissions(_0x5cd62b){const _0x5ec65c=a64_0x3cd5;try{a64_0x3da3d2['chmodSync'](_0x5cd62b,0x1c0);}catch{console[_0x5ec65c(0x1ae)]('Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20'+_0x5cd62b);}}export function createSecureDirectory(_0x45411a){const _0x2d1f35=a64_0x3cd5;!a64_0x3da3d2['existsSync'](_0x45411a)&&(a64_0x3da3d2[_0x2d1f35(0x1ad)](_0x45411a,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x45411a));}function a64_0x3b7f(){const _0x27de09=['392NKNrlE','599400IOeHcV','3468656LtAmVC','1471175rzyfPz','writeFileSync','mkdirSync','warn','370769oqXdKi','16527GGxwpf','1962OELqRq','chmodSync','15172mWEhrm','Warning:\x20',').\x20','toString','statSync','113dxNCCc','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','5410QTYEsX'];a64_0x3b7f=function(){return _0x27de09;};return a64_0x3b7f();}export function validateSecureFilePermissions(_0x11805d){const _0x289221=a64_0x3cd5;try{const _0x2ed1f3=a64_0x3da3d2[_0x289221(0x1a4)](_0x11805d),_0x5a282f=_0x2ed1f3['mode']&0x1ff,_0x2cb1d7=(_0x5a282f&0x3f)!==0x0;if(_0x2cb1d7)return console[_0x289221(0x1ae)](_0x289221(0x1a1)+_0x11805d+'\x20has\x20insecure\x20permissions\x20('+_0x5a282f[_0x289221(0x1a3)](0x8)+_0x289221(0x1a2)+'Should\x20be\x200600\x20or\x20more\x20restrictive.'),![];return!![];}catch{return!![];}}export function writeSecureFile(_0x55368f,_0x294645){const _0x589290=a64_0x3cd5,_0x5f07bb=a64_0x5c6d05['dirname'](_0x55368f);createSecureDirectory(_0x5f07bb),a64_0x3da3d2[_0x589290(0x1ac)](_0x55368f,_0x294645,{'mode':0x180}),setSecureFilePermissions(_0x55368f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a65_0x3847(_0x2873fb,_0x2cd701){const _0x8531b9=a65_0x8531();return a65_0x3847=function(_0x3847f4,_0xd0f1f7){_0x3847f4=_0x3847f4-0x91;let _0x13b73c=_0x8531b9[_0x3847f4];return _0x13b73c;},a65_0x3847(_0x2873fb,_0x2cd701);}(function(_0x2f5d39,_0x3a6b2d){const _0x206486=a65_0x3847,_0x24baf5=_0x2f5d39();while(!![]){try{const _0x370e79=parseInt(_0x206486(0x91))/0x1+parseInt(_0x206486(0x9b))/0x2+-parseInt(_0x206486(0x9d))/0x3+-parseInt(_0x206486(0x99))/0x4+-parseInt(_0x206486(0x97))/0x5*(-parseInt(_0x206486(0x9c))/0x6)+-parseInt(_0x206486(0x95))/0x7*(-parseInt(_0x206486(0x94))/0x8)+-parseInt(_0x206486(0x9a))/0x9;if(_0x370e79===_0x3a6b2d)break;else _0x24baf5['push'](_0x24baf5['shift']());}catch(_0x447d13){_0x24baf5['push'](_0x24baf5['shift']());}}}(a65_0x8531,0x32eb9));function a65_0x8531(){const _0x2efc70=['100DpcVIf','txt','842272AIAUcK','6232959JixPjR','795758zstdsN','81150zPnGvP','310602JpSsSB','json','pop','tab','177468FLRVEW','jsonl','split','3000zqRuhG','6895dajCpP','text'];a65_0x8531=function(){return _0x2efc70;};return a65_0x8531();}export function detectFormatFromExtension(_0x205c51){const _0x2dd0e6=a65_0x3847,_0x1ad635=_0x205c51['toLowerCase']()[_0x2dd0e6(0x93)]('.')[_0x2dd0e6(0x9f)]();switch(_0x1ad635){case _0x2dd0e6(0x9e):return _0x2dd0e6(0x9e);case _0x2dd0e6(0x92):return _0x2dd0e6(0x92);case'tsv':case _0x2dd0e6(0xa0):return'tsv';case _0x2dd0e6(0x98):case _0x2dd0e6(0x96):return'table';default:return undefined;}}export function resolveOutputFormat(_0x34b63e,_0x3c89a0,_0xb5034c){if(_0x34b63e)return _0x34b63e;if(_0x3c89a0){const _0x866c=detectFormatFromExtension(_0x3c89a0);if(_0x866c)return _0x866c;}return _0xb5034c;}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2b8124,_0x29dd26){const _0x3230bd=a66_0x4b5c,_0x9b45db=_0x2b8124();while(!![]){try{const _0x560a2a=-parseInt(_0x3230bd(0xca))/0x1+parseInt(_0x3230bd(0xea))/0x2+parseInt(_0x3230bd(0xe8))/0x3+parseInt(_0x3230bd(0xcb))/0x4+-parseInt(_0x3230bd(0xc6))/0x5+-parseInt(_0x3230bd(0xd9))/0x6*(-parseInt(_0x3230bd(0xd1))/0x7)+-parseInt(_0x3230bd(0xf1))/0x8*(parseInt(_0x3230bd(0xed))/0x9);if(_0x560a2a===_0x29dd26)break;else _0x9b45db['push'](_0x9b45db['shift']());}catch(_0xe39fe8){_0x9b45db['push'](_0x9b45db['shift']());}}}(a66_0x402b,0x2cf87));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(){return process['stdout']['columns']||Infinity;}function a66_0x4b5c(_0x5d5734,_0x61a34){const _0x402bf2=a66_0x402b();return a66_0x4b5c=function(_0x4b5c3e,_0x372700){_0x4b5c3e=_0x4b5c3e-0xbf;let _0x1b9ddc=_0x402bf2[_0x4b5c3e];return _0x1b9ddc;},a66_0x4b5c(_0x5d5734,_0x61a34);}function a66_0x402b(){const _0x59a804=['\x20row','605280NhZOtW','type','replace','join','174868oYdytV','1447404KgAPXE','map','date','table','entries','json','84259tzyvwf','jsonl','true','floor','\x20shown)','toISOString','padEnd','long','30LUQAyH','int','bool','No\x20rows\x20returned','tsv','test','log','boolean','row','min','timestamp','\x20rows\x20(','length','0\x20B','max','142008dtYSYW','repeat','418916TzYfaY','toFixed','pow','9wQErgJ','substring','reduce','data','1589656oKKNgm','string','stringify','forEach','push','array','columns','toString','double','false'];a66_0x402b=function(){return _0x59a804;};return a66_0x402b();}export function formatAsTable(_0x27ca73,_0x150483=DEFAULT_MAX_DISPLAY_ROWS,_0x23d152=![],_0x39e0f0={}){const _0x341e4b=a66_0x4b5c;if(_0x27ca73[_0x341e4b(0xf0)]['length']===0x0)return _0x341e4b(0xdc);const _0x42c948=_0x27ca73[_0x341e4b(0xc1)][_0x341e4b(0xcc)](_0xa9d6ac=>_0xa9d6ac['name']),_0x45654a=_0x27ca73[_0x341e4b(0xc1)][_0x341e4b(0xcc)](_0x2fe0bc=>simplifyType(_0x2fe0bc[_0x341e4b(0xc7)])),_0x5677d3=_0x27ca73[_0x341e4b(0xf0)]['slice'](0x0,_0x150483),_0x30765b=_0x27ca73[_0x341e4b(0xf0)][_0x341e4b(0xe5)],_0xe967bb=_0x30765b>_0x150483,_0x14145d=[],_0x11e32e=getTerminalWidth(),_0x3ea038=_0x11e32e!==Infinity,_0x3e7995=0x32;let _0x4b025c=_0x42c948[_0x341e4b(0xcc)]((_0x1774db,_0x5199f3)=>{const _0x474069=_0x341e4b,_0x31e9b3=stringWidth(_0x45654a[_0x5199f3]),_0x502fba=Math[_0x474069(0xe7)](..._0x5677d3[_0x474069(0xcc)](_0x1b4e0d=>{const _0x4b52cb=_0x1b4e0d[_0x1774db];return stringWidth(formatValue(_0x4b52cb));})),_0x42d68d=Math[_0x474069(0xe7)](stringWidth(_0x1774db),_0x31e9b3,_0x502fba);return _0x23d152?_0x42d68d:Math[_0x474069(0xe2)](_0x42d68d,_0x3e7995);});if(_0x3ea038&&!_0x23d152&&_0x42c948[_0x341e4b(0xe5)]>0x0){const _0x52546b=_0x22dcec=>{let _0x386ab4=0x1;for(const _0xddc0a6 of _0x22dcec){_0x386ab4+=_0xddc0a6+0x3;}return _0x386ab4+0x1;};let _0x1d5650=_0x52546b(_0x4b025c);if(_0x1d5650>_0x11e32e){const _0x52a7a2=0x3;for(let _0x584168=_0x4b025c[_0x341e4b(0xe5)]-0x1;_0x584168>=0x0;_0x584168--){_0x1d5650=_0x52546b(_0x4b025c);if(_0x1d5650<=_0x11e32e)break;const _0x4c89f9=_0x4b025c[_0x584168],_0x41f2be=_0x1d5650-_0x11e32e,_0x117dab=_0x4c89f9-_0x52a7a2,_0x30d631=Math[_0x341e4b(0xe2)](_0x41f2be,_0x117dab);_0x30d631>0x0&&(_0x4b025c[_0x584168]=_0x4c89f9-_0x30d631);}}}const _0xa2ad4e=_0x42c948,_0xcb8095=_0x45654a,_0x4313aa=_0x4b025c,_0xd4c888=_0x4b025c;_0x14145d[_0x341e4b(0xbf)](colorBorder('┌'+_0xd4c888[_0x341e4b(0xcc)](_0x5c8e01=>'─'[_0x341e4b(0xe9)](_0x5c8e01+0x2))['join']('┬')+'┐',_0x39e0f0));const _0x10c390=_0xa2ad4e[_0x341e4b(0xcc)]((_0x169913,_0x30d27e)=>centerAlign(_0x169913,_0x4313aa[_0x30d27e]));_0x14145d[_0x341e4b(0xbf)](colorBorder('│',_0x39e0f0)+'\x20'+_0x10c390['join']('\x20'+colorBorder('│',_0x39e0f0)+'\x20')+'\x20'+colorBorder('│',_0x39e0f0));const _0x22d8f9=_0xcb8095[_0x341e4b(0xcc)]((_0x37f581,_0x3a0129)=>colorType(centerAlign(_0x37f581,_0x4313aa[_0x3a0129]),_0x39e0f0));_0x14145d[_0x341e4b(0xbf)](colorBorder('│',_0x39e0f0)+'\x20'+_0x22d8f9[_0x341e4b(0xc9)]('\x20'+colorBorder('│',_0x39e0f0)+'\x20')+'\x20'+colorBorder('│',_0x39e0f0)),_0x14145d['push'](colorBorder('├'+_0xd4c888['map'](_0x42b07e=>'─'[_0x341e4b(0xe9)](_0x42b07e+0x2))[_0x341e4b(0xc9)]('┼')+'┤',_0x39e0f0));const _0x1954bc=(_0x304b56,_0xc590cf)=>{const _0x47ea56=_0x341e4b,_0x31b51a=stringWidth(_0x304b56);if(_0x31b51a<=_0xc590cf)return _0x304b56;let _0x329e3a=_0x304b56;while(stringWidth(_0x329e3a+'…')>_0xc590cf&&_0x329e3a[_0x47ea56(0xe5)]>0x0){_0x329e3a=_0x329e3a['slice'](0x0,-0x1);}return _0x329e3a+'…';};_0x5677d3[_0x341e4b(0xf4)](_0x50e462=>{const _0x5c35e7=_0x341e4b,_0x16a395=_0x42c948[_0x5c35e7(0xcc)]((_0x27f800,_0x269f1b)=>{const _0x4bf6c9=_0x5c35e7,_0x44c9fd=_0x50e462[_0x27f800],_0x55c406=formatValue(_0x44c9fd),_0x56b804=_0x4313aa[_0x269f1b],_0x326a3f=_0x1954bc(_0x55c406,_0x56b804),_0x1892e5=typeof _0x44c9fd==='number'||typeof _0x44c9fd===_0x4bf6c9(0xf2)&&/^-?\d+$/[_0x4bf6c9(0xde)](_0x44c9fd);return _0x1892e5?padStart(_0x326a3f,_0x56b804):padEnd(_0x326a3f,_0x56b804);});_0x14145d[_0x5c35e7(0xbf)](colorBorder('│',_0x39e0f0)+'\x20'+_0x16a395[_0x5c35e7(0xc9)]('\x20'+colorBorder('│',_0x39e0f0)+'\x20')+'\x20'+colorBorder('│',_0x39e0f0));});const _0x541d4e=_0xd4c888[_0x341e4b(0xef)]((_0x573812,_0xf866f3)=>_0x573812+_0xf866f3+0x3,-0x1);_0x14145d[_0x341e4b(0xbf)](colorBorder('├'+_0xd4c888['map'](_0x4d1c1b=>'─'['repeat'](_0x4d1c1b+0x2))[_0x341e4b(0xc9)]('┴')+'┤',_0x39e0f0));let _0x3007b6;_0xe967bb?_0x3007b6=_0x30765b+_0x341e4b(0xe4)+_0x150483+_0x341e4b(0xd5):_0x3007b6=_0x30765b+_0x341e4b(0xc5)+(_0x30765b===0x1?'':'s');const _0x43e867=_0x3007b6[_0x341e4b(0xd7)](_0x541d4e-0x2);return _0x14145d['push'](colorBorder('│',_0x39e0f0)+'\x20'+_0x43e867+'\x20'+colorBorder('│',_0x39e0f0)),_0x14145d[_0x341e4b(0xbf)](colorBorder('└'+'─'[_0x341e4b(0xe9)](_0x541d4e)+'┘',_0x39e0f0)),_0x14145d[_0x341e4b(0xc9)]('\x0a');}function simplifyType(_0xe922bd){const _0xe8f755=a66_0x4b5c,_0x584a68={'varchar':_0xe8f755(0xf2),'bigint':_0xe8f755(0xd8),'integer':_0xe8f755(0xda),'double':_0xe8f755(0xc3),'boolean':_0xe8f755(0xdb),'date':_0xe8f755(0xcd),'timestamp':_0xe8f755(0xe3),'array':_0xe8f755(0xc0),'map':_0xe8f755(0xcc),'row':_0xe8f755(0xe1)},_0x427cf1=_0xe922bd['toLowerCase']();for(const [_0x5664b4,_0x2eb36e]of Object[_0xe8f755(0xcf)](_0x584a68)){if(_0x427cf1['startsWith'](_0x5664b4))return _0x2eb36e;}return _0xe922bd['length']>0xa?_0xe922bd[_0xe8f755(0xee)](0x0,0xa):_0xe922bd;}export function formatAsJSON(_0x2b597f,_0x45e588={}){const _0xa89566=a66_0x4b5c;if(_0x2b597f[_0xa89566(0xf0)]['length']===0x0)return'[]';if(shouldUseColor(_0x45e588))return colorizeJSON(_0x2b597f[_0xa89566(0xf0)],_0x45e588);const _0x4bf933=_0x2b597f[_0xa89566(0xf0)]['map'](_0x15f55e=>'\x20\x20'+JSON['stringify'](_0x15f55e));return'[\x0a'+_0x4bf933['join'](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x397ac7,_0x2d5ed8={}){const _0x1c683d=a66_0x4b5c;if(_0x397ac7[_0x1c683d(0xf0)][_0x1c683d(0xe5)]===0x0)return'';if(shouldUseColor(_0x2d5ed8))return _0x397ac7[_0x1c683d(0xf0)][_0x1c683d(0xcc)](_0x1f2805=>colorizeJSONCompact(_0x1f2805,_0x2d5ed8))[_0x1c683d(0xc9)]('\x0a');return _0x397ac7[_0x1c683d(0xf0)][_0x1c683d(0xcc)](_0xc80125=>JSON[_0x1c683d(0xf3)](_0xc80125))['join']('\x0a');}export function formatAsTSV(_0x46f65d){const _0x5e0149=a66_0x4b5c;if(_0x46f65d[_0x5e0149(0xf0)][_0x5e0149(0xe5)]===0x0)return'';const _0x54adda=[],_0x324dc6=_0x46f65d[_0x5e0149(0xc1)]['map'](_0x5812d3=>_0x5812d3['name']);return _0x54adda[_0x5e0149(0xbf)](_0x324dc6[_0x5e0149(0xc9)]('\x09')),_0x46f65d[_0x5e0149(0xf0)][_0x5e0149(0xf4)](_0x46a7f1=>{const _0x326de9=_0x5e0149,_0xf3a9b4=_0x324dc6[_0x326de9(0xcc)](_0x3cba24=>{const _0x1ed6d7=_0x46a7f1[_0x3cba24];return formatValueForTSV(_0x1ed6d7);});_0x54adda[_0x326de9(0xbf)](_0xf3a9b4[_0x326de9(0xc9)]('\x09'));}),_0x54adda['join']('\x0a');}function formatValue(_0xe4032e){const _0x25d061=a66_0x4b5c;if(_0xe4032e===null||_0xe4032e===undefined)return'';if(typeof _0xe4032e===_0x25d061(0xf2)){const _0x28385d=_0xe4032e['replace'](/\n/g,'\x5cn')[_0x25d061(0xc8)](/\r/g,'\x5cr')[_0x25d061(0xc8)](/\t/g,'\x5ct');return _0x28385d;}if(typeof _0xe4032e==='number')return String(_0xe4032e);if(typeof _0xe4032e===_0x25d061(0xe0))return _0xe4032e?_0x25d061(0xd3):_0x25d061(0xc4);if(_0xe4032e instanceof Date)return _0xe4032e[_0x25d061(0xd6)]();if(typeof _0xe4032e==='object')return JSON[_0x25d061(0xf3)](_0xe4032e);return String(_0xe4032e);}function formatValueForTSV(_0x37627c){const _0x570ce0=a66_0x4b5c;if(_0x37627c===null||_0x37627c===undefined)return'';if(typeof _0x37627c==='string')return _0x37627c[_0x570ce0(0xc8)](/\t/g,'\x5ct')[_0x570ce0(0xc8)](/\n/g,'\x5cn');if(typeof _0x37627c==='number'||typeof _0x37627c===_0x570ce0(0xe0))return String(_0x37627c);if(_0x37627c instanceof Date)return _0x37627c[_0x570ce0(0xd6)]();if(typeof _0x37627c==='object')return JSON['stringify'](_0x37627c);return String(_0x37627c);}export function formatQueryResult(_0x5d2176,_0x45dae9){const _0x488741=a66_0x4b5c;switch(_0x45dae9){case _0x488741(0xce):return formatAsTable(_0x5d2176);case _0x488741(0xd0):return formatAsJSON(_0x5d2176);case _0x488741(0xd2):return formatAsJSONL(_0x5d2176);case _0x488741(0xdd):return formatAsTSV(_0x5d2176);default:return formatAsJSON(_0x5d2176);}}export function formatBytes(_0x40715e){const _0x627ec=a66_0x4b5c;if(_0x40715e===0x0)return _0x627ec(0xe6);const _0x3ca535=['B','KB','MB','GB','TB'],_0x13e356=0x400,_0x3989c9=Math[_0x627ec(0xd4)](Math[_0x627ec(0xdf)](_0x40715e)/Math[_0x627ec(0xdf)](_0x13e356)),_0x3ba73e=_0x40715e/Math[_0x627ec(0xec)](_0x13e356,_0x3989c9),_0x5406d0=_0x3ba73e>=0xa?0x1:0x2;return _0x3ba73e[_0x627ec(0xeb)](_0x5406d0)+'\x20'+_0x3ca535[_0x3989c9];}export function formatRows(_0x25d8cc){const _0x14610d=a66_0x4b5c;if(_0x25d8cc==null)return'-';if(_0x25d8cc===0x0)return'0';if(_0x25d8cc<0x3e8)return _0x25d8cc[_0x14610d(0xc2)]();const _0x186b32=['','K','M','B','T'],_0x337787=0x3e8,_0x254f4e=Math[_0x14610d(0xd4)](Math[_0x14610d(0xdf)](_0x25d8cc)/Math[_0x14610d(0xdf)](_0x337787)),_0x1d4ce9=_0x25d8cc/Math[_0x14610d(0xec)](_0x337787,_0x254f4e),_0x27713c=_0x1d4ce9>=0xa?0x1:0x2;return''+_0x1d4ce9[_0x14610d(0xeb)](_0x27713c)+_0x186b32[_0x254f4e];}
|
|
1
|
+
(function(_0x4f8b78,_0x4b499b){const _0x1c9f13=a66_0x1a69,_0x1deffc=_0x4f8b78();while(!![]){try{const _0x4d8c87=-parseInt(_0x1c9f13(0xc9))/0x1+-parseInt(_0x1c9f13(0xbf))/0x2*(parseInt(_0x1c9f13(0xee))/0x3)+parseInt(_0x1c9f13(0xd9))/0x4+parseInt(_0x1c9f13(0xf4))/0x5*(parseInt(_0x1c9f13(0xe7))/0x6)+-parseInt(_0x1c9f13(0xdc))/0x7+-parseInt(_0x1c9f13(0xd4))/0x8*(-parseInt(_0x1c9f13(0xc0))/0x9)+parseInt(_0x1c9f13(0xf1))/0xa;if(_0x4d8c87===_0x4b499b)break;else _0x1deffc['push'](_0x1deffc['shift']());}catch(_0x114c31){_0x1deffc['push'](_0x1deffc['shift']());}}}(a66_0x3cf8,0x3d106));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 a66_0x3cf8(){const _0x7d75d2=['768090iDbDZv','tsv','log','timestamp','202WNKNYX','405fleBWa','repeat','columns','stringify','push','map','max','padEnd','number','359610eaaCNf','floor','long','date','array','entries','data','row','pow','double','stdout','56008rRQcCO','No\x20rows\x20returned','min','object','replace','187276uTtqXJ','string','true','1352099GBLLBS','boolean','jsonl','slice','substring','json','toLowerCase','type','\x20rows\x20(','toString','\x20row','6XPTHtN','name','bool','toFixed','0\x20B','join','false','14151kAqoat','toISOString','length','7638200zKmULB','reduce','startsWith'];a66_0x3cf8=function(){return _0x7d75d2;};return a66_0x3cf8();}function getTerminalWidth(){const _0x9df38b=a66_0x1a69;return process[_0x9df38b(0xd3)][_0x9df38b(0xc2)]||Infinity;}export function formatAsTable(_0x5e4ed7,_0x329826=DEFAULT_MAX_DISPLAY_ROWS,_0x3d71b3=![],_0x72c3a0={}){const _0x3a7e91=a66_0x1a69;if(_0x5e4ed7['data'][_0x3a7e91(0xf0)]===0x0)return _0x3a7e91(0xd5);const _0x47f170=_0x5e4ed7[_0x3a7e91(0xc2)][_0x3a7e91(0xc5)](_0x232538=>_0x232538[_0x3a7e91(0xe8)]),_0x23c351=_0x5e4ed7[_0x3a7e91(0xc2)][_0x3a7e91(0xc5)](_0x10e57e=>simplifyType(_0x10e57e[_0x3a7e91(0xe3)])),_0x1013ee=_0x5e4ed7[_0x3a7e91(0xcf)][_0x3a7e91(0xdf)](0x0,_0x329826),_0x3a0f22=_0x5e4ed7[_0x3a7e91(0xcf)][_0x3a7e91(0xf0)],_0x245ec0=_0x3a0f22>_0x329826,_0x37cc4d=[],_0x384e40=getTerminalWidth(),_0x57480b=_0x384e40!==Infinity,_0x556a20=0x32;let _0x476abb=_0x47f170[_0x3a7e91(0xc5)]((_0x2d1b91,_0x1c568c)=>{const _0x3f2597=_0x3a7e91,_0x534ded=stringWidth(_0x23c351[_0x1c568c]),_0x5c2439=Math[_0x3f2597(0xc6)](..._0x1013ee[_0x3f2597(0xc5)](_0x277f52=>{const _0x26d1a6=_0x277f52[_0x2d1b91];return stringWidth(formatValue(_0x26d1a6));})),_0x255b2a=Math[_0x3f2597(0xc6)](stringWidth(_0x2d1b91),_0x534ded,_0x5c2439);return _0x3d71b3?_0x255b2a:Math['min'](_0x255b2a,_0x556a20);});if(_0x57480b&&!_0x3d71b3&&_0x47f170[_0x3a7e91(0xf0)]>0x0){const _0x3ed682=_0xca15ac=>{let _0x5d9ff8=0x1;for(const _0x1cb2ba of _0xca15ac){_0x5d9ff8+=_0x1cb2ba+0x3;}return _0x5d9ff8+0x1;};let _0x47fe6d=_0x3ed682(_0x476abb);if(_0x47fe6d>_0x384e40){const _0x550799=0x3;for(let _0x2ce56c=_0x476abb[_0x3a7e91(0xf0)]-0x1;_0x2ce56c>=0x0;_0x2ce56c--){_0x47fe6d=_0x3ed682(_0x476abb);if(_0x47fe6d<=_0x384e40)break;const _0x225ab6=_0x476abb[_0x2ce56c],_0x24cd0a=_0x47fe6d-_0x384e40,_0x432492=_0x225ab6-_0x550799,_0x54415c=Math[_0x3a7e91(0xd6)](_0x24cd0a,_0x432492);_0x54415c>0x0&&(_0x476abb[_0x2ce56c]=_0x225ab6-_0x54415c);}}}const _0x158b76=_0x47f170,_0x54d130=_0x23c351,_0x194eeb=_0x476abb,_0x202095=_0x476abb;_0x37cc4d[_0x3a7e91(0xc4)](colorBorder('┌'+_0x202095['map'](_0x181994=>'─'[_0x3a7e91(0xc1)](_0x181994+0x2))[_0x3a7e91(0xec)]('┬')+'┐',_0x72c3a0));const _0x5667a0=_0x158b76['map']((_0x1677f1,_0x217c91)=>centerAlign(_0x1677f1,_0x194eeb[_0x217c91]));_0x37cc4d['push'](colorBorder('│',_0x72c3a0)+'\x20'+_0x5667a0[_0x3a7e91(0xec)]('\x20'+colorBorder('│',_0x72c3a0)+'\x20')+'\x20'+colorBorder('│',_0x72c3a0));const _0x93b9=_0x54d130[_0x3a7e91(0xc5)]((_0x404f19,_0x3d6030)=>colorType(centerAlign(_0x404f19,_0x194eeb[_0x3d6030]),_0x72c3a0));_0x37cc4d[_0x3a7e91(0xc4)](colorBorder('│',_0x72c3a0)+'\x20'+_0x93b9[_0x3a7e91(0xec)]('\x20'+colorBorder('│',_0x72c3a0)+'\x20')+'\x20'+colorBorder('│',_0x72c3a0)),_0x37cc4d['push'](colorBorder('├'+_0x202095[_0x3a7e91(0xc5)](_0xebd05d=>'─'[_0x3a7e91(0xc1)](_0xebd05d+0x2))[_0x3a7e91(0xec)]('┼')+'┤',_0x72c3a0));const _0x463ae4=(_0x5122ff,_0x2a5b9a)=>{const _0x270012=_0x3a7e91,_0xa4ffaa=stringWidth(_0x5122ff);if(_0xa4ffaa<=_0x2a5b9a)return _0x5122ff;let _0x3bd3e9=_0x5122ff;while(stringWidth(_0x3bd3e9+'…')>_0x2a5b9a&&_0x3bd3e9[_0x270012(0xf0)]>0x0){_0x3bd3e9=_0x3bd3e9[_0x270012(0xdf)](0x0,-0x1);}return _0x3bd3e9+'…';};_0x1013ee['forEach'](_0x3c8d8e=>{const _0x534924=_0x3a7e91,_0x5b5c33=_0x47f170[_0x534924(0xc5)]((_0x49ab78,_0x2e03cb)=>{const _0x1d112e=_0x534924,_0x920470=_0x3c8d8e[_0x49ab78],_0x2e2d58=formatValue(_0x920470),_0x1d5ea8=_0x194eeb[_0x2e03cb],_0x2572a0=_0x463ae4(_0x2e2d58,_0x1d5ea8),_0x83e81d=typeof _0x920470==='number'||typeof _0x920470===_0x1d112e(0xda)&&/^-?\d+$/['test'](_0x920470);return _0x83e81d?padStart(_0x2572a0,_0x1d5ea8):padEnd(_0x2572a0,_0x1d5ea8);});_0x37cc4d[_0x534924(0xc4)](colorBorder('│',_0x72c3a0)+'\x20'+_0x5b5c33[_0x534924(0xec)]('\x20'+colorBorder('│',_0x72c3a0)+'\x20')+'\x20'+colorBorder('│',_0x72c3a0));});const _0x4bd889=_0x202095[_0x3a7e91(0xf2)]((_0x395516,_0x407167)=>_0x395516+_0x407167+0x3,-0x1);_0x37cc4d[_0x3a7e91(0xc4)](colorBorder('├'+_0x202095[_0x3a7e91(0xc5)](_0x550d83=>'─'[_0x3a7e91(0xc1)](_0x550d83+0x2))[_0x3a7e91(0xec)]('┴')+'┤',_0x72c3a0));let _0x5d8abf;_0x245ec0?_0x5d8abf=_0x3a0f22+_0x3a7e91(0xe4)+_0x329826+'\x20shown)':_0x5d8abf=_0x3a0f22+_0x3a7e91(0xe6)+(_0x3a0f22===0x1?'':'s');const _0x332b16=_0x5d8abf[_0x3a7e91(0xc7)](_0x4bd889-0x2);return _0x37cc4d[_0x3a7e91(0xc4)](colorBorder('│',_0x72c3a0)+'\x20'+_0x332b16+'\x20'+colorBorder('│',_0x72c3a0)),_0x37cc4d[_0x3a7e91(0xc4)](colorBorder('└'+'─'[_0x3a7e91(0xc1)](_0x4bd889)+'┘',_0x72c3a0)),_0x37cc4d[_0x3a7e91(0xec)]('\x0a');}function simplifyType(_0x2edb9a){const _0x3840d3=a66_0x1a69,_0x3c372b={'varchar':_0x3840d3(0xda),'bigint':_0x3840d3(0xcb),'integer':'int','double':_0x3840d3(0xd2),'boolean':_0x3840d3(0xe9),'date':_0x3840d3(0xcc),'timestamp':_0x3840d3(0xbe),'array':_0x3840d3(0xcd),'map':_0x3840d3(0xc5),'row':_0x3840d3(0xd0)},_0x4ef7ba=_0x2edb9a[_0x3840d3(0xe2)]();for(const [_0x2840ce,_0x24ddeb]of Object[_0x3840d3(0xce)](_0x3c372b)){if(_0x4ef7ba[_0x3840d3(0xf3)](_0x2840ce))return _0x24ddeb;}return _0x2edb9a[_0x3840d3(0xf0)]>0xa?_0x2edb9a[_0x3840d3(0xe0)](0x0,0xa):_0x2edb9a;}export function formatAsJSON(_0x3f1c7b,_0x5b0f07={}){const _0x4512ba=a66_0x1a69;if(_0x3f1c7b[_0x4512ba(0xcf)][_0x4512ba(0xf0)]===0x0)return'[]';if(shouldUseColor(_0x5b0f07))return colorizeJSON(_0x3f1c7b[_0x4512ba(0xcf)],_0x5b0f07);const _0x4f9940=_0x3f1c7b['data'][_0x4512ba(0xc5)](_0x20b72c=>'\x20\x20'+JSON[_0x4512ba(0xc3)](_0x20b72c));return'[\x0a'+_0x4f9940[_0x4512ba(0xec)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0xc8f984,_0x20b019={}){const _0x44e63f=a66_0x1a69;if(_0xc8f984['data']['length']===0x0)return'';if(shouldUseColor(_0x20b019))return _0xc8f984['data']['map'](_0x2b5ddd=>colorizeJSONCompact(_0x2b5ddd,_0x20b019))['join']('\x0a');return _0xc8f984[_0x44e63f(0xcf)][_0x44e63f(0xc5)](_0x5cdd98=>JSON[_0x44e63f(0xc3)](_0x5cdd98))['join']('\x0a');}export function formatAsTSV(_0x3d0dfb){const _0x565d70=a66_0x1a69;if(_0x3d0dfb[_0x565d70(0xcf)][_0x565d70(0xf0)]===0x0)return'';const _0x72cf2e=[],_0x56acac=_0x3d0dfb[_0x565d70(0xc2)][_0x565d70(0xc5)](_0x43b370=>_0x43b370['name']);return _0x72cf2e[_0x565d70(0xc4)](_0x56acac[_0x565d70(0xec)]('\x09')),_0x3d0dfb['data']['forEach'](_0x328b53=>{const _0x21546e=_0x565d70,_0x32e54c=_0x56acac[_0x21546e(0xc5)](_0x39099f=>{const _0x3dcbc3=_0x328b53[_0x39099f];return formatValueForTSV(_0x3dcbc3);});_0x72cf2e[_0x21546e(0xc4)](_0x32e54c[_0x21546e(0xec)]('\x09'));}),_0x72cf2e[_0x565d70(0xec)]('\x0a');}function a66_0x1a69(_0xc751cd,_0x26a616){const _0x3cf8f6=a66_0x3cf8();return a66_0x1a69=function(_0x1a695b,_0x5e97d5){_0x1a695b=_0x1a695b-0xbe;let _0x30eb33=_0x3cf8f6[_0x1a695b];return _0x30eb33;},a66_0x1a69(_0xc751cd,_0x26a616);}function formatValue(_0x474bc1){const _0x1e02a3=a66_0x1a69;if(_0x474bc1===null||_0x474bc1===undefined)return'';if(typeof _0x474bc1===_0x1e02a3(0xda)){const _0x959e47=_0x474bc1[_0x1e02a3(0xd8)](/\n/g,'\x5cn')[_0x1e02a3(0xd8)](/\r/g,'\x5cr')[_0x1e02a3(0xd8)](/\t/g,'\x5ct');return _0x959e47;}if(typeof _0x474bc1===_0x1e02a3(0xc8))return String(_0x474bc1);if(typeof _0x474bc1==='boolean')return _0x474bc1?_0x1e02a3(0xdb):_0x1e02a3(0xed);if(_0x474bc1 instanceof Date)return _0x474bc1[_0x1e02a3(0xef)]();if(typeof _0x474bc1===_0x1e02a3(0xd7))return JSON[_0x1e02a3(0xc3)](_0x474bc1);return String(_0x474bc1);}function formatValueForTSV(_0x431fd3){const _0x247a44=a66_0x1a69;if(_0x431fd3===null||_0x431fd3===undefined)return'';if(typeof _0x431fd3==='string')return _0x431fd3[_0x247a44(0xd8)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x431fd3===_0x247a44(0xc8)||typeof _0x431fd3===_0x247a44(0xdd))return String(_0x431fd3);if(_0x431fd3 instanceof Date)return _0x431fd3['toISOString']();if(typeof _0x431fd3===_0x247a44(0xd7))return JSON[_0x247a44(0xc3)](_0x431fd3);return String(_0x431fd3);}export function formatQueryResult(_0x3d3683,_0xb30b55){const _0x597eeb=a66_0x1a69;switch(_0xb30b55){case'table':return formatAsTable(_0x3d3683);case _0x597eeb(0xe1):return formatAsJSON(_0x3d3683);case _0x597eeb(0xde):return formatAsJSONL(_0x3d3683);case _0x597eeb(0xf5):return formatAsTSV(_0x3d3683);default:return formatAsJSON(_0x3d3683);}}export function formatBytes(_0xecf04f){const _0x58b1a4=a66_0x1a69;if(_0xecf04f===0x0)return _0x58b1a4(0xeb);const _0x2d5bcd=['B','KB','MB','GB','TB'],_0x36c6aa=0x400,_0x35ca8d=Math['floor'](Math[_0x58b1a4(0xf6)](_0xecf04f)/Math[_0x58b1a4(0xf6)](_0x36c6aa)),_0x1027b2=_0xecf04f/Math[_0x58b1a4(0xd1)](_0x36c6aa,_0x35ca8d),_0x1fc6c6=_0x1027b2>=0xa?0x1:0x2;return _0x1027b2[_0x58b1a4(0xea)](_0x1fc6c6)+'\x20'+_0x2d5bcd[_0x35ca8d];}export function formatRows(_0x85d977){const _0x44dd08=a66_0x1a69;if(_0x85d977==null)return'-';if(_0x85d977===0x0)return'0';if(_0x85d977<0x3e8)return _0x85d977[_0x44dd08(0xe5)]();const _0x7b8fc8=['','K','M','B','T'],_0x24815a=0x3e8,_0x4196ee=Math[_0x44dd08(0xca)](Math[_0x44dd08(0xf6)](_0x85d977)/Math['log'](_0x24815a)),_0x1cc955=_0x85d977/Math[_0x44dd08(0xd1)](_0x24815a,_0x4196ee),_0x4518a5=_0x1cc955>=0xa?0x1:0x2;return''+_0x1cc955[_0x44dd08(0xea)](_0x4518a5)+_0x7b8fc8[_0x4196ee];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a67_0x3b90(){const _0x172620=['PERMISSION_DENIED','10077152BOPOoT','2222828EJHJmp','File\x20not\x20found:\x20','INVALID_ARGUMENT','EACCES','parse','1gejnKE','420882LjelqV','3zBBjBJ','Invalid\x20JSON\x20string:\x20','22978116QpfBLg','Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.','6479646bsPOwT','79005hIMPFf','code','\x27:\x20','2148106RJqmkl','message'];a67_0x3b90=function(){return _0x172620;};return a67_0x3b90();}(function(_0x4a7429,_0x3cce91){const _0x5c7aa4=a67_0x43d2,_0x94710a=_0x4a7429();while(!![]){try{const _0x319240=-parseInt(_0x5c7aa4(0xd6))/0x1*(parseInt(_0x5c7aa4(0xcd))/0x2)+parseInt(_0x5c7aa4(0xc5))/0x3*(-parseInt(_0x5c7aa4(0xd1))/0x4)+-parseInt(_0x5c7aa4(0xca))/0x5+parseInt(_0x5c7aa4(0xc9))/0x6+-parseInt(_0x5c7aa4(0xc4))/0x7+-parseInt(_0x5c7aa4(0xd0))/0x8+parseInt(_0x5c7aa4(0xc7))/0x9;if(_0x319240===_0x3cce91)break;else _0x94710a['push'](_0x94710a['shift']());}catch(_0x43e2bf){_0x94710a['push'](_0x94710a['shift']());}}}(a67_0x3b90,0xa3056));import{readFile}from'fs/promises';function a67_0x43d2(_0x3134ea,_0x2fb9e5){const _0x3b9020=a67_0x3b90();return a67_0x43d2=function(_0x43d286,_0x186a14){_0x43d286=_0x43d286-0xc4;let _0x43308c=_0x3b9020[_0x43d286];return _0x43308c;},a67_0x43d2(_0x3134ea,_0x2fb9e5);}import{SDKError,ErrorCode}from'../sdk/errors.js';export async function loadJSON(_0x1a36c4,_0x491bbb){const _0x20d08f=a67_0x43d2;try{if(_0x491bbb){const _0x57c0cf=await readFile(_0x1a36c4,'utf-8');try{return JSON[_0x20d08f(0xd5)](_0x57c0cf);}catch(_0x4a2a0b){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Invalid\x20JSON\x20in\x20file\x20\x27'+_0x1a36c4+_0x20d08f(0xcc)+(_0x4a2a0b instanceof Error?_0x4a2a0b['message']:String(_0x4a2a0b)));}}else try{return JSON[_0x20d08f(0xd5)](_0x1a36c4);}catch(_0x529a30){throw new SDKError(ErrorCode[_0x20d08f(0xd3)],_0x20d08f(0xc6)+(_0x529a30 instanceof Error?_0x529a30['message']:String(_0x529a30)));}}catch(_0x535749){if(_0x535749 instanceof SDKError)throw _0x535749;if(_0x535749 instanceof Error&&_0x20d08f(0xcb)in _0x535749){const _0x22319f=_0x535749;if(_0x22319f['code']==='ENOENT')throw new SDKError(ErrorCode['NOT_FOUND'],_0x20d08f(0xd2)+_0x1a36c4);else{if(_0x22319f[_0x20d08f(0xcb)]===_0x20d08f(0xd4))throw new SDKError(ErrorCode[_0x20d08f(0xcf)],'Permission\x20denied\x20reading\x20file:\x20'+_0x1a36c4);}}throw new SDKError(ErrorCode['INTERNAL'],'Failed\x20to\x20load\x20JSON:\x20'+(_0x535749 instanceof Error?_0x535749[_0x20d08f(0xce)]:String(_0x535749)));}}export async function loadJSONFromOptions(_0x5ec232,_0x615f18){const _0x4b888f=a67_0x43d2;if(_0x5ec232&&_0x615f18)throw new SDKError(ErrorCode[_0x4b888f(0xd3)],_0x4b888f(0xc8));if(_0x5ec232)return await loadJSON(_0x5ec232,![]);if(_0x615f18)return await loadJSON(_0x615f18,!![]);return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a68_0x20d444=a68_0x26fc;(function(_0x22ecd7,_0x2a6766){const _0x317329=a68_0x26fc,_0x1ddf55=_0x22ecd7();while(!![]){try{const _0x46553a=-parseInt(_0x317329(0x1d4))/0x1*(-parseInt(_0x317329(0x1d7))/0x2)+-parseInt(_0x317329(0x1d6))/0x3+-parseInt(_0x317329(0x1da))/0x4*(parseInt(_0x317329(0x1d9))/0x5)+parseInt(_0x317329(0x1d2))/0x6+-parseInt(_0x317329(0x1d1))/0x7+-parseInt(_0x317329(0x1d0))/0x8*(parseInt(_0x317329(0x1cf))/0x9)+parseInt(_0x317329(0x1d3))/0xa;if(_0x46553a===_0x2a6766)break;else _0x1ddf55['push'](_0x1ddf55['shift']());}catch(_0x469b3a){_0x1ddf55['push'](_0x1ddf55['shift']());}}}(a68_0xc2de,0x75bfb));const MODEL_ALIASES={'haiku':a68_0x20d444(0x1db),'sonnet':a68_0x20d444(0x1d8)};export function extractModelAlias(_0x337c54){const _0x100e7c=a68_0x20d444,_0x101ce0=_0x337c54[_0x100e7c(0x1d5)](/^claude-(?:\d+-)?(?:\d+-?)?(sonnet|haiku|opus)/i);if(_0x101ce0)return _0x101ce0[0x1][_0x100e7c(0x1dc)]();return _0x337c54;}export function resolveModelAlias(_0x13dfbe){const _0x33f3ea=a68_0x20d444;return MODEL_ALIASES[_0x13dfbe[_0x33f3ea(0x1dc)]()]||_0x13dfbe;}function a68_0x26fc(_0x47dd0f,_0x3251af){const _0xc2de85=a68_0xc2de();return a68_0x26fc=function(_0x26fc63,_0x2ff08b){_0x26fc63=_0x26fc63-0x1cf;let _0x37238b=_0xc2de85[_0x26fc63];return _0x37238b;},a68_0x26fc(_0x47dd0f,_0x3251af);}export function getModelAliases(){return{...MODEL_ALIASES};}function a68_0xc2de(){const _0x53685f=['2720640tbUxop','10646270MhCZqM','441001aXFCNP','match','496530CBuRAx','2oSSqDU','claude-4.5-sonnet','920aegvZR','2640LAmPqY','claude-4.5-haiku','toLowerCase','4194396DuKgcG','8roCaKC','5066425IPChIN'];a68_0xc2de=function(){return _0x53685f;};return a68_0xc2de();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a69_0x137f(_0x205377,_0x186f75){const _0x9480d4=a69_0x9480();return a69_0x137f=function(_0x137f53,_0x5da21a){_0x137f53=_0x137f53-0x1df;let _0x4a2451=_0x9480d4[_0x137f53];return _0x4a2451;},a69_0x137f(_0x205377,_0x186f75);}function a69_0x9480(){const _0x8827e0=['78WYDgYd','.\x20Must\x20be\x20a\x20positive\x20integer.','Invalid\x20limit\x20value:\x20','3424516wWPHYE','number','.\x20Must\x20be\x20a\x20positive\x20number.','2301948ZZFOwx','.\x20Must\x20be\x20a\x20number.','429185lSogON','7gmsvdd','Invalid\x20timeout\x20value:\x20','1168857xdVvpz','isInteger','240994YvloBq','892072UtHlII','130TcMBip','194778sFrOHD'];a69_0x9480=function(){return _0x8827e0;};return a69_0x9480();}(function(_0x32851c,_0x9993c6){const _0x55cab0=a69_0x137f,_0x5e0023=_0x32851c();while(!![]){try{const _0x308358=-parseInt(_0x55cab0(0x1e7))/0x1+parseInt(_0x55cab0(0x1ea))/0x2+parseInt(_0x55cab0(0x1e0))/0x3+parseInt(_0x55cab0(0x1ee))/0x4+parseInt(_0x55cab0(0x1e2))/0x5*(parseInt(_0x55cab0(0x1eb))/0x6)+-parseInt(_0x55cab0(0x1e3))/0x7*(parseInt(_0x55cab0(0x1e8))/0x8)+parseInt(_0x55cab0(0x1e5))/0x9*(-parseInt(_0x55cab0(0x1e9))/0xa);if(_0x308358===_0x9993c6)break;else _0x5e0023['push'](_0x5e0023['shift']());}catch(_0x3ade71){_0x5e0023['push'](_0x5e0023['shift']());}}}(a69_0x9480,0xc24d7));export function validateLimitOption(_0x4578cf){const _0x50c266=a69_0x137f;if(!Number[_0x50c266(0x1e6)](_0x4578cf))return{'isValid':![],'error':'Invalid\x20limit\x20value:\x20'+_0x4578cf+'.\x20Must\x20be\x20an\x20integer.'};if(_0x4578cf<=0x0)return{'isValid':![],'error':_0x50c266(0x1ed)+_0x4578cf+_0x50c266(0x1ec)};return{'isValid':!![],'value':_0x4578cf};}export function validateTimeoutOption(_0x476209,_0x1554d8=0x1e){const _0x51e666=a69_0x137f;if(_0x476209===undefined)return{'isValid':!![],'value':_0x1554d8};const _0x3d8191=typeof _0x476209===_0x51e666(0x1ef)?_0x476209:parseFloat(_0x476209);if(isNaN(_0x3d8191))return{'isValid':![],'error':_0x51e666(0x1e4)+_0x476209+_0x51e666(0x1e1)};if(_0x3d8191<=0x0)return{'isValid':![],'error':_0x51e666(0x1e4)+_0x3d8191+_0x51e666(0x1df)};return{'isValid':!![],'value':_0x3d8191};}
|
package/dist/utils/port.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a70_0x4e86(){const _0x36d53b=['29313laKrAa','36QQlmJe','once','0.0.0.0','3464dqqOgD','error','No\x20available\x20port\x20found\x20between\x20','158978rILAVp','close','2560BggLfy','2765516GuPviA','90770SxSNgw','\x20and\x20','517YxDHvm','457388sZkXSe','3UWheqp','listen','1182ZgUliq','listening','904rJGhSY','12621OitsXm','code'];a70_0x4e86=function(){return _0x36d53b;};return a70_0x4e86();}(function(_0xd0549f,_0x587983){const _0x2d862a=a70_0x34a1,_0x2d91fb=_0xd0549f();while(!![]){try{const _0x1fe2c4=-parseInt(_0x2d862a(0xb9))/0x1+parseInt(_0x2d862a(0xaa))/0x2*(-parseInt(_0x2d862a(0xab))/0x3)+parseInt(_0x2d862a(0xb6))/0x4*(-parseInt(_0x2d862a(0xbb))/0x5)+-parseInt(_0x2d862a(0xad))/0x6*(parseInt(_0x2d862a(0xb0))/0x7)+parseInt(_0x2d862a(0xaf))/0x8*(parseInt(_0x2d862a(0xb2))/0x9)+parseInt(_0x2d862a(0xbd))/0xa*(parseInt(_0x2d862a(0xbf))/0xb)+-parseInt(_0x2d862a(0xb3))/0xc*(-parseInt(_0x2d862a(0xbc))/0xd);if(_0x1fe2c4===_0x587983)break;else _0x2d91fb['push'](_0x2d91fb['shift']());}catch(_0x1d7a4e){_0x2d91fb['push'](_0x2d91fb['shift']());}}}(a70_0x4e86,0x3c349));import{createServer}from'node:net';export async function isPortAvailable(_0x20f981){return new Promise(_0x52c358=>{const _0x517421=a70_0x34a1,_0xeda5a9=createServer();_0xeda5a9[_0x517421(0xb4)](_0x517421(0xb7),_0x3bb9e4=>{const _0x4699bb=_0x517421;_0x3bb9e4[_0x4699bb(0xb1)]==='EADDRINUSE'?_0x52c358(![]):_0x52c358(![]);}),_0xeda5a9[_0x517421(0xb4)](_0x517421(0xae),()=>{const _0x151749=_0x517421;_0xeda5a9[_0x151749(0xba)](),_0x52c358(!![]);}),_0xeda5a9[_0x517421(0xac)](_0x20f981,_0x517421(0xb5));});}function a70_0x34a1(_0x145b6d,_0xf507f7){const _0x4e8670=a70_0x4e86();return a70_0x34a1=function(_0x34a197,_0x219359){_0x34a197=_0x34a197-0xaa;let _0x422be2=_0x4e8670[_0x34a197];return _0x422be2;},a70_0x34a1(_0x145b6d,_0xf507f7);}export async function findAvailablePort(_0x4374c2=0xfa0,_0x22f406=0x64){const _0xfdc405=a70_0x34a1;for(let _0xb7c879=0x0;_0xb7c879<_0x22f406;_0xb7c879++){const _0x5f2ac2=_0x4374c2+_0xb7c879;if(await isPortAvailable(_0x5f2ac2))return _0x5f2ac2;}throw new Error(_0xfdc405(0xb8)+_0x4374c2+_0xfdc405(0xbe)+(_0x4374c2+_0x22f406-0x1));}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a71_0x53d680=a71_0x37ef;(function(_0x5cb54a,_0x1db429){const _0x366b48=a71_0x37ef,_0xf17069=_0x5cb54a();while(!![]){try{const _0x1414f6=-parseInt(_0x366b48(0x161))/0x1*(parseInt(_0x366b48(0x166))/0x2)+parseInt(_0x366b48(0x16a))/0x3+-parseInt(_0x366b48(0x154))/0x4*(parseInt(_0x366b48(0x169))/0x5)+parseInt(_0x366b48(0x15e))/0x6+-parseInt(_0x366b48(0x170))/0x7*(parseInt(_0x366b48(0x157))/0x8)+-parseInt(_0x366b48(0x14f))/0x9*(-parseInt(_0x366b48(0x155))/0xa)+parseInt(_0x366b48(0x15b))/0xb;if(_0x1414f6===_0x1db429)break;else _0xf17069['push'](_0xf17069['shift']());}catch(_0x2243fe){_0xf17069['push'](_0xf17069['shift']());}}}(a71_0x3297,0x810e6));import{execSync}from'node:child_process';const SHELL_NAMES=new Set([a71_0x53d680(0x16f),'zsh','sh',a71_0x53d680(0x16d),'ksh',a71_0x53d680(0x14e),'csh',a71_0x53d680(0x14c),a71_0x53d680(0x14b),a71_0x53d680(0x165),'nu',a71_0x53d680(0x14a),a71_0x53d680(0x15f),'xonsh']);function getProcessInfoWindows(_0x47466d){const _0x7e3350=a71_0x53d680;try{const _0x2c59d2=execSync(_0x7e3350(0x171)+_0x47466d+'\x20get\x20ParentProcessId,Name\x20/format:csv',{'encoding':'utf-8','windowsHide':!![]})[_0x7e3350(0x150)](),_0x30cbfe=_0x2c59d2['split']('\x0a')[_0x7e3350(0x172)](_0x2271e0=>_0x2271e0[_0x7e3350(0x150)]());if(_0x30cbfe['length']<0x2)return null;const _0x4bd1ff=_0x30cbfe[_0x30cbfe['length']-0x1]['split'](',');if(_0x4bd1ff[_0x7e3350(0x162)]<0x3)return null;const _0x42cba3=_0x4bd1ff[0x1]?.[_0x7e3350(0x150)]()||'',_0xbe5df9=parseInt(_0x4bd1ff[0x2]?.[_0x7e3350(0x150)]()||'0',0xa);if(isNaN(_0xbe5df9)||!_0x42cba3)return null;return{'pid':_0x47466d,'ppid':_0xbe5df9,'comm':_0x42cba3[_0x7e3350(0x163)](/\.exe$/i,'')};}catch(_0x4acc76){return process[_0x7e3350(0x168)][_0x7e3350(0x156)]&&console[_0x7e3350(0x158)](_0x7e3350(0x16b)+_0x47466d+'\x20on\x20Windows:',_0x4acc76),null;}}function a71_0x3297(){const _0x121c2c=['7HAEjFd','wmic\x20process\x20where\x20ProcessId=','filter','utf-8','\x20-o\x20ppid=,comm=','ion','pwsh','dash','kill','tcsh','5427xBAlvA','trim','comm','toLowerCase','No\x20shell\x20found\x20in\x20process\x20tree,\x20falling\x20back\x20to\x20process.ppid','2617140hwpiZh','1090szZiog','DEBUG','2750128smqiRr','error','\x20on\x20POSIX:','win32','3430889SSraiI','join','split','5085396oLiGFq','elvish','pop','695798cQXeWh','length','replace','pid','powershell','2HZrpLJ','has','env','5wjiwln','2991813zWTWYV','Failed\x20to\x20get\x20process\x20info\x20for\x20PID\x20','platform','fish','ppid','bash'];a71_0x3297=function(){return _0x121c2c;};return a71_0x3297();}function getProcessInfoPosix(_0xdc1df9){const _0x2317ac=a71_0x53d680;try{const _0x4b9e12=execSync('ps\x20-p\x20'+_0xdc1df9+_0x2317ac(0x149),{'encoding':_0x2317ac(0x148)})[_0x2317ac(0x150)](),[_0x3fa51d,..._0x1cda97]=_0x4b9e12[_0x2317ac(0x15d)](/\s+/),_0x1275e0=parseInt(_0x3fa51d,0xa),_0x2b85db=_0x1cda97[_0x2317ac(0x15c)]('\x20');if(isNaN(_0x1275e0))return null;return{'pid':_0xdc1df9,'ppid':_0x1275e0,'comm':_0x2b85db};}catch(_0x3df01f){return process[_0x2317ac(0x168)][_0x2317ac(0x156)]&&console[_0x2317ac(0x158)]('Failed\x20to\x20get\x20process\x20info\x20for\x20PID\x20'+_0xdc1df9+_0x2317ac(0x159),_0x3df01f),null;}}function getProcessInfo(_0x20707f){const _0x17e099=a71_0x53d680;if(process[_0x17e099(0x16c)]===_0x17e099(0x15a))return getProcessInfoWindows(_0x20707f);return getProcessInfoPosix(_0x20707f);}function a71_0x37ef(_0x346a57,_0x373c12){const _0x3297c0=a71_0x3297();return a71_0x37ef=function(_0x37ef1f,_0x47ece5){_0x37ef1f=_0x37ef1f-0x148;let _0x2beace=_0x3297c0[_0x37ef1f];return _0x2beace;},a71_0x37ef(_0x346a57,_0x373c12);}function isShell(_0x366873){const _0x31506e=a71_0x53d680,_0x345220=_0x366873[_0x31506e(0x163)](/^-/,'')[_0x31506e(0x15d)]('/')[_0x31506e(0x160)]()||'';return SHELL_NAMES[_0x31506e(0x167)](_0x345220[_0x31506e(0x152)]());}let cachedShellPID;function findShellPID(){const _0x13841e=a71_0x53d680;let _0x5f200f=process[_0x13841e(0x16e)];const _0x1a8dcf=0xa;let _0x19240d=0x0;while(_0x19240d<_0x1a8dcf){const _0x433a10=getProcessInfo(_0x5f200f);if(!_0x433a10){process[_0x13841e(0x168)][_0x13841e(0x156)]&&console['error']('Could\x20not\x20get\x20process\x20info\x20for\x20PID\x20'+_0x5f200f+',\x20using\x20fallback');break;}if(isShell(_0x433a10[_0x13841e(0x151)]))return _0x433a10[_0x13841e(0x164)];if(_0x433a10[_0x13841e(0x16e)]===0x0||_0x433a10[_0x13841e(0x16e)]===0x1){if(isShell(_0x433a10[_0x13841e(0x151)]))return _0x433a10[_0x13841e(0x164)];break;}_0x5f200f=_0x433a10[_0x13841e(0x16e)],_0x19240d++;}return process[_0x13841e(0x168)][_0x13841e(0x156)]&&console[_0x13841e(0x158)](_0x13841e(0x153)),process['ppid'];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0x4ed3e4){const _0x4e55b8=a71_0x53d680;try{return process[_0x4e55b8(0x14d)](_0x4ed3e4,0x0),!![];}catch{return![];}}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e8318,_0xa124d8){const _0x554fe5=a72_0x4cf1,_0x12d114=_0x4e8318();while(!![]){try{const _0x2e07bd=-parseInt(_0x554fe5(0x6e))/0x1*(-parseInt(_0x554fe5(0x71))/0x2)+parseInt(_0x554fe5(0x69))/0x3+parseInt(_0x554fe5(0x6a))/0x4+parseInt(_0x554fe5(0x67))/0x5+parseInt(_0x554fe5(0x6b))/0x6+parseInt(_0x554fe5(0x70))/0x7+-parseInt(_0x554fe5(0x65))/0x8;if(_0x2e07bd===_0xa124d8)break;else _0x12d114['push'](_0x12d114['shift']());}catch(_0x56b10c){_0x12d114['push'](_0x12d114['shift']());}}}(a72_0xfe70,0x58b90));function a72_0x4cf1(_0x502649,_0xf40a77){const _0xfe70b4=a72_0xfe70();return a72_0x4cf1=function(_0x4cf122,_0x15a388){_0x4cf122=_0x4cf122-0x64;let _0x21a7bb=_0xfe70b4[_0x4cf122];return _0x21a7bb;},a72_0x4cf1(_0x502649,_0xf40a77);}import*as a72_0x4f2197 from'readline';export async function confirm(_0x1b39a3){const _0x2eb83a=a72_0x4cf1,_0x2ae6ff=a72_0x4f2197[_0x2eb83a(0x6c)]({'input':process['stdin'],'output':process[_0x2eb83a(0x64)]});return new Promise(_0x385a9f=>{const _0x261d53=_0x2eb83a;_0x2ae6ff['question'](_0x1b39a3+_0x261d53(0x66),_0x224965=>{const _0x488dfe=_0x261d53;_0x2ae6ff[_0x488dfe(0x68)](),_0x385a9f(_0x224965[_0x488dfe(0x6f)]()==='y'||_0x224965['toLowerCase']()===_0x488dfe(0x6d));});});}function a72_0xfe70(){const _0x38016b=['close','2121033ngEMvE','2726816DtAjmm','533028CGqHxK','createInterface','yes','2413GtanKC','toLowerCase','4002390yjQMfh','582guIDDZ','stdout','23300328JGPyaY','\x20(y/N):\x20','2622215zPFYNl'];a72_0xfe70=function(){return _0x38016b;};return a72_0xfe70();}
|