@treasuredata/tdx 0.3.3 → 0.3.4
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-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-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/auth-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.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.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/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
|
-
function a51_0x27d8(){const _0x2ff9aa=['NUMERIC_ID_PATTERN','upstreams','.tar.gz','force','filter','isDirectory','22228IJVdHs','exportParams','length','workflowName','downloadProjectArchive','endsWith','getAttempt','retrySession','updatedAt','listSessions','Project\x20not\x20found:\x20','lastId','9876636NSdnqU','map','sessionUuid','killAttempt','Project\x20directory\x20not\x20found:\x20','tar','fullName','revision','tasks','finishedAt','listProjects','storeParams','projects','createdAt','skipValidation','message','index','unlink','Cannot\x20read\x20workflow\x20file:\x20','sessionTime','done','path','mkdir','readdir','tdx-workflow-','project','workflow','basename','uploadProjectArchive','listAttempts','clearSchedule','last_id','5Brjygk','getAttemptTasks','join','isFile','327mVvWpD','resumeFrom','5237136xTlecj','state','retryAttemptName','client','retryParams','workflows','access','create','download','timezone','success','logger','projectName','resolveProjectId','sessionId','7186758PBvSHB','limit','config','stateParams','clearScheduleAll','kill','isGroup','attempt','16McOcJQ','extract','data','cancelRequested','74154kCRjvw','logs','attempts','name','getTaskLogs','sessions','30592860PntuXo','871029UCPlHL','fromTime','deleteProject','retryAt','listWorkflows','push','error','latest','startedAt','now','find','test'];a51_0x27d8=function(){return _0x2ff9aa;};return a51_0x27d8();}const a51_0x561558=a51_0x348f;(function(_0x280cbe,_0x1df4c9){const _0x51c74e=a51_0x348f,_0x4152f8=_0x280cbe();while(!![]){try{const _0x576c58=parseInt(_0x51c74e(0x225))/0x1+-parseInt(_0x51c74e(0x23e))/0x2*(parseInt(_0x51c74e(0x208))/0x3)+parseInt(_0x51c74e(0x20a))/0x4*(parseInt(_0x51c74e(0x204))/0x5)+-parseInt(_0x51c74e(0x219))/0x6+-parseInt(_0x51c74e(0x24a))/0x7+-parseInt(_0x51c74e(0x221))/0x8*(-parseInt(_0x51c74e(0x22c))/0x9)+parseInt(_0x51c74e(0x22b))/0xa;if(_0x576c58===_0x1df4c9)break;else _0x4152f8['push'](_0x4152f8['shift']());}catch(_0x69b943){_0x4152f8['push'](_0x4152f8['shift']());}}}(a51_0x27d8,0xc73f7));function a51_0x348f(_0x47fa3d,_0x23a560){const _0x27d82a=a51_0x27d8();return a51_0x348f=function(_0x348f1f,_0x572119){_0x348f1f=_0x348f1f-0x1f1;let _0x3e2604=_0x27d82a[_0x348f1f];return _0x3e2604;},a51_0x348f(_0x47fa3d,_0x23a560);}import{WorkflowApiClient}from'../client/workflow-client.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';export class WorkflowSDK{static [a51_0x561558(0x238)]=/^\d+$/;['client'];constructor(_0x3e7f79){const _0x3485d2=a51_0x561558;this[_0x3485d2(0x20d)]=new WorkflowApiClient(_0x3e7f79,_0x3e7f79[_0x3485d2(0x215)]);}async['resolveProjectId'](_0x557609){const _0x117186=a51_0x561558;if(WorkflowSDK['NUMERIC_ID_PATTERN'][_0x117186(0x237)](_0x557609))return{'id':_0x557609,'name':_0x557609};const _0x2b099=await this[_0x117186(0x20d)][_0x117186(0x254)]({'name_pattern':_0x557609}),_0xd6395e=_0x2b099[_0x117186(0x223)][_0x117186(0x236)](_0x4f995e=>_0x4f995e[_0x117186(0x228)]===_0x557609);if(!_0xd6395e)throw new Error('Project\x20not\x20found:\x20'+_0x557609);return{'id':_0xd6395e['id'],'name':_0xd6395e['name']};}async[a51_0x561558(0x256)](_0x4ddeb0,_0x2b5ecc){const _0x2bcc9c=a51_0x561558,_0x3ff4a8=await this[_0x2bcc9c(0x20d)][_0x2bcc9c(0x254)]({'name_pattern':_0x4ddeb0,..._0x2b5ecc});return _0x3ff4a8[_0x2bcc9c(0x223)][_0x2bcc9c(0x24b)](_0x3d2df0=>({..._0x3d2df0,'project_id':_0x3d2df0['id'],'project_name':_0x3d2df0[_0x2bcc9c(0x228)]}));}async[a51_0x561558(0x20f)](_0x3827d2,_0x3cccb3){const _0x598e5f=a51_0x561558,_0xedaba9=await this[_0x598e5f(0x20d)][_0x598e5f(0x230)]({'project_name':_0x3827d2,..._0x3cccb3});return _0xedaba9['data']['map'](_0x458b77=>({'project_id':_0x458b77[_0x598e5f(0x1fd)]?.['id'],'project_name':_0x458b77['project']?.[_0x598e5f(0x228)],'workflow_id':_0x458b77['id'],'workflow_name':_0x458b77[_0x598e5f(0x228)],'revision':_0x458b77[_0x598e5f(0x251)],'timezone':_0x458b77[_0x598e5f(0x213)],'config':_0x458b77[_0x598e5f(0x21b)],'id':_0x458b77['id'],'name':_0x458b77[_0x598e5f(0x228)],'project':_0x458b77[_0x598e5f(0x1fd)]}));}async[a51_0x561558(0x22a)](_0x2edfc4){const _0x199216=a51_0x561558;let _0x24cffd;if(_0x2edfc4?.[_0x199216(0x216)]){let _0x493241,_0x1d1575=![];while(!_0x1d1575){const _0x2cf3b2=await this['client'][_0x199216(0x254)]({'limit':0x64,'last_id':_0x493241}),_0x2555a2=_0x2cf3b2[_0x199216(0x223)][_0x199216(0x236)](_0x2bdc5f=>_0x2bdc5f[_0x199216(0x228)]===_0x2edfc4[_0x199216(0x216)]);if(_0x2555a2){_0x24cffd=_0x2555a2['id'],_0x1d1575=!![];break;}if(!_0x2cf3b2[_0x199216(0x249)]||_0x2cf3b2['data']['length']===0x0)break;_0x493241=_0x2cf3b2[_0x199216(0x249)];}if(!_0x24cffd)throw new Error(_0x199216(0x248)+_0x2edfc4[_0x199216(0x216)]);}const _0x40f53b=await this[_0x199216(0x20d)][_0x199216(0x247)]({'project_id':_0x24cffd,'project_name':_0x2edfc4?.['projectName'],'workflow_name':_0x2edfc4?.[_0x199216(0x241)],'status':_0x2edfc4?.['status'],'from_time':_0x2edfc4?.[_0x199216(0x22d)],'to_time':_0x2edfc4?.['toTime'],'limit':_0x2edfc4?.[_0x199216(0x21a)],'last_id':_0x2edfc4?.[_0x199216(0x203)]});return _0x40f53b[_0x199216(0x223)][_0x199216(0x24b)](_0x1c1936=>({'project_id':_0x1c1936['project']?.['id'],'project_name':_0x1c1936[_0x199216(0x1fd)]?.['name'],'workflow_id':_0x1c1936[_0x199216(0x1fe)]?.['id'],'workflow_name':_0x1c1936['workflow']?.['name'],'session_id':_0x1c1936['id'],'sessionUuid':_0x1c1936[_0x199216(0x24c)],'sessionTime':_0x1c1936[_0x199216(0x1f7)],'lastAttempt':_0x1c1936['lastAttempt'],'id':_0x1c1936['id'],'project':_0x1c1936[_0x199216(0x1fd)],'workflow':_0x1c1936['workflow']}));}async[a51_0x561558(0x227)](_0x3ff650){const _0x25a55b=a51_0x561558,_0x1c9305=await this[_0x25a55b(0x20d)][_0x25a55b(0x201)]({'project_name':_0x3ff650?.[_0x25a55b(0x216)],'workflow_name':_0x3ff650?.[_0x25a55b(0x241)],'include_retried':_0x3ff650?.['includeRetried'],'limit':_0x3ff650?.[_0x25a55b(0x21a)],'last_id':_0x3ff650?.[_0x25a55b(0x203)]});return _0x1c9305[_0x25a55b(0x223)][_0x25a55b(0x24b)](_0x576ad8=>({'project_id':_0x576ad8[_0x25a55b(0x1fd)]?.['id'],'project_name':_0x576ad8['project']?.[_0x25a55b(0x228)],'workflow_id':_0x576ad8[_0x25a55b(0x1fe)]?.['id'],'workflow_name':_0x576ad8[_0x25a55b(0x1fe)]?.['name'],'session_id':_0x576ad8['sessionId'],'sessionUuid':_0x576ad8['sessionUuid'],'sessionTime':_0x576ad8[_0x25a55b(0x1f7)],'attempt_id':_0x576ad8['id'],'attempt_index':_0x576ad8[_0x25a55b(0x1f4)],'retryAttemptName':_0x576ad8[_0x25a55b(0x20c)],'done':_0x576ad8[_0x25a55b(0x1f8)],'success':_0x576ad8[_0x25a55b(0x214)],'cancelRequested':_0x576ad8[_0x25a55b(0x224)],'params':_0x576ad8['params'],'createdAt':_0x576ad8[_0x25a55b(0x1f1)],'finishedAt':_0x576ad8[_0x25a55b(0x253)],'id':_0x576ad8['id'],'index':_0x576ad8['index'],'project':_0x576ad8[_0x25a55b(0x1fd)],'workflow':_0x576ad8['workflow']}));}async[a51_0x561558(0x220)](_0x490ab0){const _0x45e9b6=a51_0x561558,_0x595daf=await this[_0x45e9b6(0x20d)][_0x45e9b6(0x244)](_0x490ab0);return _0x595daf;}async[a51_0x561558(0x252)](_0x155174,_0x24c4c3=![]){const _0x26b3d2=a51_0x561558,_0x9c00fa=await this[_0x26b3d2(0x20d)][_0x26b3d2(0x205)](_0x155174,_0x24c4c3);return _0x9c00fa[_0x26b3d2(0x24b)](_0x3a2479=>({'task_id':_0x3a2479['id'],'task_name':_0x3a2479[_0x26b3d2(0x250)],'parentId':_0x3a2479['parentId'],'config':_0x3a2479['config'],'upstreams':_0x3a2479[_0x26b3d2(0x239)],'state':_0x3a2479[_0x26b3d2(0x20b)],'exportParams':_0x3a2479[_0x26b3d2(0x23f)],'storeParams':_0x3a2479[_0x26b3d2(0x255)],'stateParams':_0x3a2479[_0x26b3d2(0x21c)],'updatedAt':_0x3a2479[_0x26b3d2(0x246)],'retryAt':_0x3a2479[_0x26b3d2(0x22f)],'startedAt':_0x3a2479[_0x26b3d2(0x234)],'error':_0x3a2479[_0x26b3d2(0x232)],'isGroup':_0x3a2479[_0x26b3d2(0x21f)],'id':_0x3a2479['id'],'fullName':_0x3a2479[_0x26b3d2(0x250)]}));}async[a51_0x561558(0x226)](_0x2239e8,_0x372f3e,_0x46e116){const _0x49fe8e=a51_0x561558;return await this[_0x49fe8e(0x20d)][_0x49fe8e(0x229)](_0x2239e8,_0x372f3e,_0x46e116);}async[a51_0x561558(0x21e)](_0x5c3abe,_0x4252e6){const _0x1863e3=a51_0x561558,_0x35fe54=await this['client'][_0x1863e3(0x24d)](_0x5c3abe,_0x4252e6);return _0x35fe54[_0x1863e3(0x1f3)];}async[a51_0x561558(0x245)](_0x4520be,_0x185e88){const _0xe7771a=a51_0x561558,_0x33c2f1=await this[_0xe7771a(0x20d)][_0xe7771a(0x245)](_0x4520be,{'from_task':_0x185e88?.['fromTask'],'retry_params':_0x185e88?.[_0xe7771a(0x20e)]});return{'attemptId':_0x33c2f1['id'],'sessionId':_0x33c2f1[_0xe7771a(0x218)]};}async['retryAttempt'](_0x2a8e88,_0x374780){const _0x4dc0be=a51_0x561558,_0x7346f2=await this['client']['retryAttempt'](_0x2a8e88,{'resume_from':_0x374780?.[_0x4dc0be(0x209)],'retry_params':_0x374780?.[_0x4dc0be(0x20e)],'force':_0x374780?.[_0x4dc0be(0x23b)]});return{'attemptId':_0x7346f2['id'],'sessionId':_0x7346f2[_0x4dc0be(0x218)]};}async[a51_0x561558(0x212)](_0x2750fe,_0x128dbd,_0x1b81e7){const _0x1082d9=a51_0x561558,{promises:_0x3a7b37}=await import('fs'),_0x78423e=await import(_0x1082d9(0x1f9)),_0x55eb5e=await import('os'),_0x15e8b2=await import('tar'),{id:_0x41ff4f,name:_0x580528}=await this[_0x1082d9(0x217)](_0x2750fe),_0x12d24c=_0x55eb5e['tmpdir'](),_0x35fbc4=_0x78423e[_0x1082d9(0x206)](_0x12d24c,_0x1082d9(0x1fc)+_0x41ff4f+'-'+Date['now']()+_0x1082d9(0x23a));try{await this['client'][_0x1082d9(0x242)](_0x41ff4f,_0x35fbc4,_0x1b81e7?.[_0x1082d9(0x251)]);const _0x1f2cf0=_0x78423e[_0x1082d9(0x206)](_0x128dbd,_0x580528);await _0x3a7b37[_0x1082d9(0x1fa)](_0x1f2cf0,{'recursive':!![]}),await _0x15e8b2[_0x1082d9(0x222)]({'file':_0x35fbc4,'cwd':_0x1f2cf0,'gzip':!![]});const _0x4b68e2=async _0x473ddb=>{const _0x3613fe=_0x1082d9;let _0x59e5d1=0x0;const _0x5b58c9=await _0x3a7b37['readdir'](_0x473ddb,{'withFileTypes':!![]});for(const _0x51db83 of _0x5b58c9){const _0x4ac6ab=_0x78423e[_0x3613fe(0x206)](_0x473ddb,_0x51db83[_0x3613fe(0x228)]);if(_0x51db83[_0x3613fe(0x207)]())_0x59e5d1++;else _0x51db83['isDirectory']()&&(_0x59e5d1+=await _0x4b68e2(_0x4ac6ab));}return _0x59e5d1;},_0x361b67=await _0x4b68e2(_0x1f2cf0);return{'projectName':_0x580528,'revision':_0x1b81e7?.[_0x1082d9(0x251)]||_0x1082d9(0x233),'filesExtracted':_0x361b67};}finally{try{await _0x3a7b37[_0x1082d9(0x1f5)](_0x35fbc4);}catch{}}}async['push'](_0xe274e8,_0x236dd2){const _0x2cd5b9=a51_0x561558,{promises:_0x476bbb}=await import('fs'),_0x53c101=await import(_0x2cd5b9(0x1f9)),_0x523000=await import(_0x2cd5b9(0x24f)),_0x13d822=_0x236dd2?.[_0x2cd5b9(0x216)]||_0x53c101[_0x2cd5b9(0x1ff)](_0xe274e8),_0x37004f=_0x236dd2?.['revision']||new Date()['toISOString']()['replace'](/[:.]/g,'-');try{await _0x476bbb['access'](_0xe274e8);}catch{throw new Error(_0x2cd5b9(0x24e)+_0xe274e8);}if(!_0x236dd2?.[_0x2cd5b9(0x1f2)]){const _0x2f35e4=await _0x476bbb['readdir'](_0xe274e8),_0x1d3145=_0x2f35e4[_0x2cd5b9(0x23c)](_0x4b1f03=>_0x4b1f03[_0x2cd5b9(0x243)](WORKFLOW_FILE_EXTENSION));if(_0x1d3145[_0x2cd5b9(0x240)]===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20project\x20directory');for(const _0x68291b of _0x1d3145){const _0x500371=_0x53c101[_0x2cd5b9(0x206)](_0xe274e8,_0x68291b);try{await _0x476bbb[_0x2cd5b9(0x210)](_0x500371);}catch{throw new Error(_0x2cd5b9(0x1f6)+_0x68291b);}}}const _0x52d585=async(_0x48d19b,_0x386101='')=>{const _0x5b2ec9=_0x2cd5b9,_0x3249ef=await _0x476bbb[_0x5b2ec9(0x1fb)](_0x48d19b,{'withFileTypes':!![]}),_0x417686=[];for(const _0x4f9c45 of _0x3249ef){const _0x20685b=_0x53c101['join'](_0x386101,_0x4f9c45[_0x5b2ec9(0x228)]),_0x56a4c0=_0x53c101['join'](_0x48d19b,_0x4f9c45[_0x5b2ec9(0x228)]);if(!shouldIncludeInArchive(_0x4f9c45[_0x5b2ec9(0x228)]))continue;_0x4f9c45[_0x5b2ec9(0x23d)]()?_0x417686[_0x5b2ec9(0x231)](...await _0x52d585(_0x56a4c0,_0x20685b)):_0x417686['push'](_0x20685b);}return _0x417686;},_0x1b9003=await _0x52d585(_0xe274e8),_0x4cfdb3=await import('os'),_0x51720a=_0x4cfdb3['tmpdir'](),_0x6434b2=_0x53c101[_0x2cd5b9(0x206)](_0x51720a,'tdx-workflow-push-'+Date[_0x2cd5b9(0x235)]()+_0x2cd5b9(0x23a));try{await _0x523000[_0x2cd5b9(0x211)]({'file':_0x6434b2,'gzip':!![],'cwd':_0xe274e8,'portable':!![]},_0x1b9003);const _0x31b257=await this['client'][_0x2cd5b9(0x200)](_0x13d822,_0x37004f,_0x6434b2,{'scheduleFrom':_0x236dd2?.['scheduleFrom'],'clearSchedule':_0x236dd2?.[_0x2cd5b9(0x202)],'clearScheduleAll':_0x236dd2?.[_0x2cd5b9(0x21d)]});return{'projectId':_0x31b257['id'],'projectName':_0x31b257['name'],'revision':_0x31b257[_0x2cd5b9(0x251)]};}finally{try{await _0x476bbb[_0x2cd5b9(0x1f5)](_0x6434b2);}catch{}}}async['delete'](_0x1306c7){const _0x4d3c17=a51_0x561558,{id:_0x5d32d1}=await this[_0x4d3c17(0x217)](_0x1306c7),_0x379fd9=await this[_0x4d3c17(0x20d)][_0x4d3c17(0x22e)](_0x5d32d1);return{'projectId':_0x379fd9['id'],'projectName':_0x379fd9[_0x4d3c17(0x228)]};}}
|
|
1
|
+
const a51_0x59c529=a51_0xf5f6;function a51_0xf5f6(_0x3be8bc,_0x34a9ed){const _0x418a87=a51_0x418a();return a51_0xf5f6=function(_0xf5f6c9,_0x42131a){_0xf5f6c9=_0xf5f6c9-0x12b;let _0xbb7232=_0x418a87[_0xf5f6c9];return _0xbb7232;},a51_0xf5f6(_0x3be8bc,_0x34a9ed);}(function(_0x3c73ae,_0x277efc){const _0x145bcc=a51_0xf5f6,_0xb054c3=_0x3c73ae();while(!![]){try{const _0x39c304=-parseInt(_0x145bcc(0x152))/0x1+-parseInt(_0x145bcc(0x184))/0x2+parseInt(_0x145bcc(0x18a))/0x3+parseInt(_0x145bcc(0x16d))/0x4+parseInt(_0x145bcc(0x135))/0x5*(parseInt(_0x145bcc(0x17a))/0x6)+parseInt(_0x145bcc(0x144))/0x7*(parseInt(_0x145bcc(0x13a))/0x8)+-parseInt(_0x145bcc(0x148))/0x9;if(_0x39c304===_0x277efc)break;else _0xb054c3['push'](_0xb054c3['shift']());}catch(_0x5db702){_0xb054c3['push'](_0xb054c3['shift']());}}}(a51_0x418a,0xdf96d));import{WorkflowApiClient}from'../client/workflow-client.js';function a51_0x418a(){const _0x4c6397=['upstreams','killAttempt','isDirectory','listProjects','tar','4999112ruykrm','Project\x20directory\x20not\x20found:\x20','last_id','finishedAt','fullName','getTaskLogs','scheduleFrom','includeRetried','find','.tar.gz','download','logs','lastId','683142ctihmD','clearScheduleAll','client','extract','projects','map','Cannot\x20read\x20workflow\x20file:\x20','fromTime','resolveProjectId','timezone','1465010bFSACK','getAttemptTasks','unlink','data','clearSchedule','latest','4258287Vrvccz','retryParams','name','path','updatedAt','isFile','No\x20','deleteProject','downloadProjectArchive','success','stateParams','retryAttempt','join','status','skipValidation','35rEjnTA','attempt','revision','readdir','limit','8SoPpPt','listAttempts','push','isGroup','uploadProjectArchive','retryAttemptName','cancelRequested','config','storeParams','kill','1039661kiuiZH','retryAt','listWorkflows','tmpdir','5132016BhQwBn','length','now','fromTask','project','create','projectName','Project\x20not\x20found:\x20','basename','tdx-workflow-','1396179pWrdDN','retrySession','state','access','resumeFrom','startedAt','createdAt','workflowName','parentId','done','listSessions','delete','endsWith','mkdir','getAttempt','filter','sessions','workflows','tasks','NUMERIC_ID_PATTERN','sessionId','workflow'];a51_0x418a=function(){return _0x4c6397;};return a51_0x418a();}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'../utils/workflow-utils.js';export class WorkflowSDK{static [a51_0x59c529(0x165)]=/^\d+$/;[a51_0x59c529(0x17c)];constructor(_0x57d928){const _0x1f8e0f=a51_0x59c529;this[_0x1f8e0f(0x17c)]=new WorkflowApiClient(_0x57d928,_0x57d928['logger']);}async[a51_0x59c529(0x182)](_0x17d928){const _0x38e3c0=a51_0x59c529;if(WorkflowSDK['NUMERIC_ID_PATTERN']['test'](_0x17d928))return{'id':_0x17d928,'name':_0x17d928};const _0x45a4c6=await this[_0x38e3c0(0x17c)]['listProjects']({'name_pattern':_0x17d928}),_0x699e31=_0x45a4c6['data'][_0x38e3c0(0x175)](_0x3269df=>_0x3269df[_0x38e3c0(0x18c)]===_0x17d928);if(!_0x699e31)throw new Error(_0x38e3c0(0x14f)+_0x17d928);return{'id':_0x699e31['id'],'name':_0x699e31['name']};}async[a51_0x59c529(0x17e)](_0x33df5f,_0x2adda2){const _0x1d9592=a51_0x59c529,_0x588b85=await this[_0x1d9592(0x17c)][_0x1d9592(0x16b)]({'name_pattern':_0x33df5f,..._0x2adda2});return _0x588b85['data']['map'](_0xc3cbba=>({..._0xc3cbba,'project_id':_0xc3cbba['id'],'project_name':_0xc3cbba[_0x1d9592(0x18c)]}));}async[a51_0x59c529(0x163)](_0x44d737,_0x2c8add){const _0x51cd5e=a51_0x59c529,_0x2a0eb0=await this['client'][_0x51cd5e(0x146)]({'project_name':_0x44d737,..._0x2c8add});return _0x2a0eb0[_0x51cd5e(0x187)]['map'](_0x4bd0e3=>({'project_id':_0x4bd0e3[_0x51cd5e(0x14c)]?.['id'],'project_name':_0x4bd0e3[_0x51cd5e(0x14c)]?.[_0x51cd5e(0x18c)],'workflow_id':_0x4bd0e3['id'],'workflow_name':_0x4bd0e3['name'],'revision':_0x4bd0e3[_0x51cd5e(0x137)],'timezone':_0x4bd0e3[_0x51cd5e(0x183)],'config':_0x4bd0e3[_0x51cd5e(0x141)],'id':_0x4bd0e3['id'],'name':_0x4bd0e3[_0x51cd5e(0x18c)],'project':_0x4bd0e3[_0x51cd5e(0x14c)]}));}async[a51_0x59c529(0x162)](_0x3a9d0d){const _0x2ad519=a51_0x59c529;let _0xc8f51f;if(_0x3a9d0d?.[_0x2ad519(0x14e)]){let _0x123b3c,_0xfe2771=![];while(!_0xfe2771){const _0xab7ad5=await this['client'][_0x2ad519(0x16b)]({'limit':0x64,'last_id':_0x123b3c}),_0x4be653=_0xab7ad5['data']['find'](_0x419c30=>_0x419c30['name']===_0x3a9d0d[_0x2ad519(0x14e)]);if(_0x4be653){_0xc8f51f=_0x4be653['id'],_0xfe2771=!![];break;}if(!_0xab7ad5[_0x2ad519(0x179)]||_0xab7ad5[_0x2ad519(0x187)][_0x2ad519(0x149)]===0x0)break;_0x123b3c=_0xab7ad5[_0x2ad519(0x179)];}if(!_0xc8f51f)throw new Error(_0x2ad519(0x14f)+_0x3a9d0d['projectName']);}const _0x2dbd93=await this['client'][_0x2ad519(0x15c)]({'project_id':_0xc8f51f,'project_name':_0x3a9d0d?.['projectName'],'workflow_name':_0x3a9d0d?.[_0x2ad519(0x159)],'status':_0x3a9d0d?.[_0x2ad519(0x133)],'from_time':_0x3a9d0d?.[_0x2ad519(0x181)],'to_time':_0x3a9d0d?.['toTime'],'limit':_0x3a9d0d?.[_0x2ad519(0x139)],'last_id':_0x3a9d0d?.[_0x2ad519(0x16f)]});return _0x2dbd93['data'][_0x2ad519(0x17f)](_0x3aff34=>({'project_id':_0x3aff34[_0x2ad519(0x14c)]?.['id'],'project_name':_0x3aff34[_0x2ad519(0x14c)]?.[_0x2ad519(0x18c)],'workflow_id':_0x3aff34[_0x2ad519(0x167)]?.['id'],'workflow_name':_0x3aff34[_0x2ad519(0x167)]?.['name'],'session_id':_0x3aff34['id'],'sessionUuid':_0x3aff34['sessionUuid'],'sessionTime':_0x3aff34['sessionTime'],'lastAttempt':_0x3aff34['lastAttempt'],'id':_0x3aff34['id'],'project':_0x3aff34[_0x2ad519(0x14c)],'workflow':_0x3aff34[_0x2ad519(0x167)]}));}async['attempts'](_0x2e0aa1){const _0x116490=a51_0x59c529,_0x99f173=await this[_0x116490(0x17c)][_0x116490(0x13b)]({'project_name':_0x2e0aa1?.['projectName'],'workflow_name':_0x2e0aa1?.[_0x116490(0x159)],'include_retried':_0x2e0aa1?.[_0x116490(0x174)],'limit':_0x2e0aa1?.[_0x116490(0x139)],'last_id':_0x2e0aa1?.[_0x116490(0x16f)]});return _0x99f173[_0x116490(0x187)][_0x116490(0x17f)](_0x1d88a7=>({'project_id':_0x1d88a7[_0x116490(0x14c)]?.['id'],'project_name':_0x1d88a7['project']?.['name'],'workflow_id':_0x1d88a7[_0x116490(0x167)]?.['id'],'workflow_name':_0x1d88a7[_0x116490(0x167)]?.[_0x116490(0x18c)],'session_id':_0x1d88a7[_0x116490(0x166)],'sessionUuid':_0x1d88a7['sessionUuid'],'sessionTime':_0x1d88a7['sessionTime'],'attempt_id':_0x1d88a7['id'],'attempt_index':_0x1d88a7['index'],'retryAttemptName':_0x1d88a7[_0x116490(0x13f)],'done':_0x1d88a7[_0x116490(0x15b)],'success':_0x1d88a7[_0x116490(0x12f)],'cancelRequested':_0x1d88a7[_0x116490(0x140)],'params':_0x1d88a7['params'],'createdAt':_0x1d88a7[_0x116490(0x158)],'finishedAt':_0x1d88a7[_0x116490(0x170)],'id':_0x1d88a7['id'],'index':_0x1d88a7['index'],'project':_0x1d88a7['project'],'workflow':_0x1d88a7[_0x116490(0x167)]}));}async[a51_0x59c529(0x136)](_0x3772bc){const _0x5efbb7=a51_0x59c529,_0x8e0009=await this[_0x5efbb7(0x17c)][_0x5efbb7(0x160)](_0x3772bc);return _0x8e0009;}async[a51_0x59c529(0x164)](_0x293f6e,_0x58a46f=![]){const _0x23dfed=a51_0x59c529,_0x4ccb24=await this[_0x23dfed(0x17c)][_0x23dfed(0x185)](_0x293f6e,_0x58a46f);return _0x4ccb24[_0x23dfed(0x17f)](_0x32dd1c=>({'task_id':_0x32dd1c['id'],'task_name':_0x32dd1c[_0x23dfed(0x171)],'parentId':_0x32dd1c[_0x23dfed(0x15a)],'config':_0x32dd1c[_0x23dfed(0x141)],'upstreams':_0x32dd1c[_0x23dfed(0x168)],'state':_0x32dd1c[_0x23dfed(0x154)],'exportParams':_0x32dd1c['exportParams'],'storeParams':_0x32dd1c[_0x23dfed(0x142)],'stateParams':_0x32dd1c[_0x23dfed(0x130)],'updatedAt':_0x32dd1c[_0x23dfed(0x18e)],'retryAt':_0x32dd1c[_0x23dfed(0x145)],'startedAt':_0x32dd1c[_0x23dfed(0x157)],'error':_0x32dd1c['error'],'isGroup':_0x32dd1c[_0x23dfed(0x13d)],'id':_0x32dd1c['id'],'fullName':_0x32dd1c[_0x23dfed(0x171)]}));}async[a51_0x59c529(0x178)](_0x4498fb,_0xbb9ce4,_0x5d84f9){const _0x2c211a=a51_0x59c529;return await this[_0x2c211a(0x17c)][_0x2c211a(0x172)](_0x4498fb,_0xbb9ce4,_0x5d84f9);}async[a51_0x59c529(0x143)](_0x2ebf1b,_0x6250a1){const _0x46cf0=a51_0x59c529,_0x111d0c=await this[_0x46cf0(0x17c)][_0x46cf0(0x169)](_0x2ebf1b,_0x6250a1);return _0x111d0c['message'];}async[a51_0x59c529(0x153)](_0xe9110b,_0x5c8d1d){const _0x242d98=a51_0x59c529,_0x4b92a4=await this[_0x242d98(0x17c)][_0x242d98(0x153)](_0xe9110b,{'from_task':_0x5c8d1d?.[_0x242d98(0x14b)],'retry_params':_0x5c8d1d?.[_0x242d98(0x18b)]});return{'attemptId':_0x4b92a4['id'],'sessionId':_0x4b92a4[_0x242d98(0x166)]};}async[a51_0x59c529(0x131)](_0x3e9b17,_0x40c2c0){const _0x14446b=a51_0x59c529,_0x2173d4=await this[_0x14446b(0x17c)]['retryAttempt'](_0x3e9b17,{'resume_from':_0x40c2c0?.[_0x14446b(0x156)],'retry_params':_0x40c2c0?.[_0x14446b(0x18b)],'force':_0x40c2c0?.['force']});return{'attemptId':_0x2173d4['id'],'sessionId':_0x2173d4[_0x14446b(0x166)]};}async[a51_0x59c529(0x177)](_0x5ee4c1,_0xbbff9,_0x1cb94d){const _0x34cbcb=a51_0x59c529,{promises:_0x7a9ab4}=await import('fs'),_0x11b0b3=await import(_0x34cbcb(0x18d)),_0x104133=await import('os'),_0x96c264=await import(_0x34cbcb(0x16c)),{id:_0x1c487d,name:_0xa76381}=await this[_0x34cbcb(0x182)](_0x5ee4c1),_0x3b03e9=_0x104133[_0x34cbcb(0x147)](),_0x563761=_0x11b0b3[_0x34cbcb(0x132)](_0x3b03e9,_0x34cbcb(0x151)+_0x1c487d+'-'+Date['now']()+_0x34cbcb(0x176));try{await this['client'][_0x34cbcb(0x12e)](_0x1c487d,_0x563761,_0x1cb94d?.[_0x34cbcb(0x137)]);const _0x4e461b=_0x11b0b3[_0x34cbcb(0x132)](_0xbbff9,_0xa76381);await _0x7a9ab4[_0x34cbcb(0x15f)](_0x4e461b,{'recursive':!![]}),await _0x96c264[_0x34cbcb(0x17d)]({'file':_0x563761,'cwd':_0x4e461b,'gzip':!![]});const _0x3ede4d=async _0x6b9e25=>{const _0x7f07ad=_0x34cbcb;let _0x8da2cc=0x0;const _0x5a2fb2=await _0x7a9ab4['readdir'](_0x6b9e25,{'withFileTypes':!![]});for(const _0x5ecbbf of _0x5a2fb2){const _0x4ed06d=_0x11b0b3[_0x7f07ad(0x132)](_0x6b9e25,_0x5ecbbf[_0x7f07ad(0x18c)]);if(_0x5ecbbf[_0x7f07ad(0x12b)]())_0x8da2cc++;else _0x5ecbbf[_0x7f07ad(0x16a)]()&&(_0x8da2cc+=await _0x3ede4d(_0x4ed06d));}return _0x8da2cc;},_0x385e76=await _0x3ede4d(_0x4e461b);return{'projectName':_0xa76381,'revision':_0x1cb94d?.[_0x34cbcb(0x137)]||_0x34cbcb(0x189),'filesExtracted':_0x385e76};}finally{try{await _0x7a9ab4[_0x34cbcb(0x186)](_0x563761);}catch{}}}async[a51_0x59c529(0x13c)](_0x9eca3e,_0x42c7ad){const _0xb8975c=a51_0x59c529,{promises:_0x4481c8}=await import('fs'),_0x15964c=await import('path'),_0x136191=await import(_0xb8975c(0x16c)),_0x54853c=_0x42c7ad?.[_0xb8975c(0x14e)]||_0x15964c[_0xb8975c(0x150)](_0x9eca3e),_0x1483d1=_0x42c7ad?.['revision']||new Date()['toISOString']()['replace'](/[:.]/g,'-');try{await _0x4481c8[_0xb8975c(0x155)](_0x9eca3e);}catch{throw new Error(_0xb8975c(0x16e)+_0x9eca3e);}if(!_0x42c7ad?.[_0xb8975c(0x134)]){const _0x4f832e=await _0x4481c8[_0xb8975c(0x138)](_0x9eca3e),_0x34bca8=_0x4f832e[_0xb8975c(0x161)](_0x133946=>_0x133946[_0xb8975c(0x15e)](WORKFLOW_FILE_EXTENSION));if(_0x34bca8[_0xb8975c(0x149)]===0x0)throw new Error(_0xb8975c(0x12c)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20project\x20directory');for(const _0x390552 of _0x34bca8){const _0x1461f3=_0x15964c[_0xb8975c(0x132)](_0x9eca3e,_0x390552);try{await _0x4481c8['access'](_0x1461f3);}catch{throw new Error(_0xb8975c(0x180)+_0x390552);}}}const _0x23e32e=async(_0x3dad91,_0x587b93='')=>{const _0x4e23ca=_0xb8975c,_0x56dbe1=await _0x4481c8[_0x4e23ca(0x138)](_0x3dad91,{'withFileTypes':!![]}),_0x4663a6=[];for(const _0x2f0cbe of _0x56dbe1){const _0x1e6bfc=_0x15964c[_0x4e23ca(0x132)](_0x587b93,_0x2f0cbe[_0x4e23ca(0x18c)]),_0x15175b=_0x15964c[_0x4e23ca(0x132)](_0x3dad91,_0x2f0cbe[_0x4e23ca(0x18c)]);if(!shouldIncludeInArchive(_0x2f0cbe[_0x4e23ca(0x18c)]))continue;_0x2f0cbe[_0x4e23ca(0x16a)]()?_0x4663a6['push'](...await _0x23e32e(_0x15175b,_0x1e6bfc)):_0x4663a6[_0x4e23ca(0x13c)](_0x1e6bfc);}return _0x4663a6;},_0x14cbc7=await _0x23e32e(_0x9eca3e),_0x734ce7=await import('os'),_0x3ce5d3=_0x734ce7[_0xb8975c(0x147)](),_0x426cd0=_0x15964c['join'](_0x3ce5d3,'tdx-workflow-push-'+Date[_0xb8975c(0x14a)]()+'.tar.gz');try{await _0x136191[_0xb8975c(0x14d)]({'file':_0x426cd0,'gzip':!![],'cwd':_0x9eca3e,'portable':!![]},_0x14cbc7);const _0x4626cc=await this[_0xb8975c(0x17c)][_0xb8975c(0x13e)](_0x54853c,_0x1483d1,_0x426cd0,{'scheduleFrom':_0x42c7ad?.[_0xb8975c(0x173)],'clearSchedule':_0x42c7ad?.[_0xb8975c(0x188)],'clearScheduleAll':_0x42c7ad?.[_0xb8975c(0x17b)]});return{'projectId':_0x4626cc['id'],'projectName':_0x4626cc[_0xb8975c(0x18c)],'revision':_0x4626cc[_0xb8975c(0x137)]};}finally{try{await _0x4481c8[_0xb8975c(0x186)](_0x426cd0);}catch{}}}async[a51_0x59c529(0x15d)](_0x68964b){const _0x4c16e2=a51_0x59c529,{id:_0x4503e4}=await this[_0x4c16e2(0x182)](_0x68964b),_0x334c92=await this['client'][_0x4c16e2(0x12d)](_0x4503e4);return{'projectId':_0x334c92['id'],'projectName':_0x334c92[_0x4c16e2(0x18c)]};}}
|
package/dist/types/endpoints.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x2cc860=a55_0x10b8;(function(_0xdca077,_0x3e4bc8){const _0x497027=a55_0x10b8,_0x2759e4=_0xdca077();while(!![]){try{const _0xc3c9e4=parseInt(_0x497027(0x9a))/0x1*(parseInt(_0x497027(0xc0))/0x2)+parseInt(_0x497027(0xaf))/0x3*(parseInt(_0x497027(0x95))/0x4)+-parseInt(_0x497027(0xa1))/0x5*(parseInt(_0x497027(0xb1))/0x6)+-parseInt(_0x497027(0x8e))/0x7*(-parseInt(_0x497027(0xa4))/0x8)+-parseInt(_0x497027(0x93))/0x9*(parseInt(_0x497027(0x97))/0xa)+parseInt(_0x497027(0xc7))/0xb*(parseInt(_0x497027(0xbe))/0xc)+-parseInt(_0x497027(0xb4))/0xd*(parseInt(_0x497027(0x98))/0xe);if(_0xc3c9e4===_0x3e4bc8)break;else _0x2759e4['push'](_0x2759e4['shift']());}catch(_0x4382f5){_0x2759e4['push'](_0x2759e4['shift']());}}}(a55_0x3803,0xe2875));export const TD_ENDPOINTS={'us01':a55_0x2cc860(0xc6),'jp01':a55_0x2cc860(0xb5),'eu01':a55_0x2cc860(0xb9),'ap02':'https://api.ap02.treasuredata.com','ap03':a55_0x2cc860(0xa3),'dev-us01':a55_0x2cc860(0x8c),'dev-eu01':a55_0x2cc860(0xa8),'stg-us01':a55_0x2cc860(0x9d),'stg-jp01':a55_0x2cc860(0xb3),'stg-ap03':'https://api-staging.ap03.treasuredata.com'};export const CDP_ENDPOINTS={'us01':a55_0x2cc860(0xae),'jp01':a55_0x2cc860(0xbd),'eu01':a55_0x2cc860(0xaa),'ap02':a55_0x2cc860(0xb8),'ap03':a55_0x2cc860(0xc9),'dev-us01':a55_0x2cc860(0x8f),'dev-eu01':'https://api-development-cdp.eu01.treasuredata.com','stg-us01':'https://api-staging-cdp.us01.treasuredata.com','stg-jp01':a55_0x2cc860(0xab),'stg-ap03':a55_0x2cc860(0x9f)};function a55_0x10b8(_0x31b30b,_0x523939){const _0x38038e=a55_0x3803();return a55_0x10b8=function(_0x10b85a,_0x281c04){_0x10b85a=_0x10b85a-0x8c;let _0x97a314=_0x38038e[_0x10b85a];return _0x97a314;},a55_0x10b8(_0x31b30b,_0x523939);}export const WORKFLOW_ENDPOINTS={'us01':a55_0x2cc860(0x90),'jp01':'https://api-workflow.treasuredata.co.jp','eu01':'https://api-workflow.eu01.treasuredata.com','ap02':'https://api-workflow.ap02.treasuredata.com','ap03':'https://api-workflow.ap03.treasuredata.com','dev-us01':a55_0x2cc860(0xac),'dev-eu01':a55_0x2cc860(0xc2),'stg-us01':a55_0x2cc860(0xa2),'stg-jp01':'https://api-staging-workflow.treasuredata.co.jp','stg-ap03':a55_0x2cc860(0x9e)};export const TRINO_ENDPOINTS={'us01':a55_0x2cc860(0xb0),'jp01':a55_0x2cc860(0xa0),'eu01':a55_0x2cc860(0xc3),'ap02':'https://api-presto.ap02.treasuredata.com','ap03':a55_0x2cc860(0xb6),'dev-us01':a55_0x2cc860(0xa9),'dev-eu01':'https://api-development-presto.eu01.treasuredata.com','stg-us01':a55_0x2cc860(0x91),'stg-jp01':a55_0x2cc860(0xa7),'stg-ap03':a55_0x2cc860(0x9c)};export const LLM_ENDPOINTS={'us01':a55_0x2cc860(0x9b),'jp01':a55_0x2cc860(0xc4),'eu01':a55_0x2cc860(0xb2),'ap02':a55_0x2cc860(0x94),'ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':a55_0x2cc860(0xc5),'dev-eu01':a55_0x2cc860(0xa5),'stg-us01':a55_0x2cc860(0xca),'stg-jp01':a55_0x2cc860(0x92),'stg-ap03':a55_0x2cc860(0xbc)};export const CONSOLE_ENDPOINTS={'us01':a55_0x2cc860(0xba),'jp01':a55_0x2cc860(0x96),'eu01':a55_0x2cc860(0x8d),'ap02':a55_0x2cc860(0xcb),'ap03':'https://console.ap03.treasuredata.com','dev-us01':'https://console-development.treasuredata.com','dev-eu01':a55_0x2cc860(0x99),'stg-us01':a55_0x2cc860(0xc8),'stg-jp01':a55_0x2cc860(0xc1),'stg-ap03':a55_0x2cc860(0xb7)};function a55_0x3803(){const _0x1998db=['https://api-staging-presto.treasuredata.co.jp','https://api-development.eu01.treasuredata.com','https://api-development-presto.treasuredata.com','https://api-cdp.eu01.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://api-development-workflow.us01.treasuredata.com','https://console.','https://api-cdp.treasuredata.com','3330XUvNgD','https://api-presto.treasuredata.com','78GUycet','https://llm-api.eu01.treasuredata.com','https://api-staging.treasuredata.co.jp','39BhtAYj','https://api.treasuredata.co.jp','https://api-presto.ap03.treasuredata.com','https://console-staging.ap03.treasuredata.com','https://api-cdp.ap02.treasuredata.com','https://api.eu01.treasuredata.com','https://console.treasuredata.com','\x27\x20and\x20site\x20\x27','https://llm-api-staging.ap03.treasuredata.com','https://api-cdp.treasuredata.co.jp','533784BzAQRK','.treasuredata.com','15382YniVKU','https://console-staging.treasuredata.co.jp','https://api-development-workflow.eu01.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://llm-api.treasuredata.co.jp','https://llm-api-development.us01.treasuredata.com','https://api.treasuredata.com','132GlYyBe','https://console-staging.us01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://llm-api-staging.us01.treasuredata.com','https://console.ap02.treasuredata.com','https://api-development.treasuredata.com','https://console.eu01.treasuredata.com','42iiluju','https://api-development-cdp.us01.treasuredata.com','https://api-workflow.treasuredata.com','https://api-staging-presto.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','9KJarRJ','https://llm-api.ap02.treasuredata.com','3104GhUHBZ','https://console.treasuredata.co.jp','6394930vcdKrD','1964438DTRKVo','https://console-development.eu01.treasuredata.com','145IkCSuj','https://llm-api.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','https://api-staging.us01.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','https://api-presto.treasuredata.co.jp','530270DqbbdN','https://api-staging-workflow.us01.treasuredata.com','https://api.ap03.treasuredata.com','1142224DpSQXT','https://llm-api-development.eu01.treasuredata.com','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'];a55_0x3803=function(){return _0x1998db;};return a55_0x3803();}export function getConsoleUrl(_0x1e0df1,_0x5f2e0b){const _0x57416a=a55_0x2cc860,_0x3e3192=CONSOLE_ENDPOINTS[_0x1e0df1]||_0x57416a(0xad)+_0x1e0df1+_0x57416a(0xbf);return _0x5f2e0b?''+_0x3e3192+_0x5f2e0b:_0x3e3192;}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS};export function getEndpoint(_0x30d75a,_0x27182d='td'){const _0x168c0=a55_0x2cc860,_0x3fedb1=API_ENDPOINTS[_0x27182d]?.[_0x30d75a];if(!_0x3fedb1)throw new Error(_0x168c0(0xa6)+_0x27182d+_0x168c0(0xbb)+_0x30d75a+'\x27');return _0x3fedb1;}
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a56_0x38f8f4=a56_0x2cd6;(function(_0xee4f9b,_0x4aa044){const _0x3c5d09=a56_0x2cd6,_0x4d398f=_0xee4f9b();while(!![]){try{const _0x1747a8=-parseInt(_0x3c5d09(0x15f))/0x1*(-parseInt(_0x3c5d09(0x157))/0x2)+parseInt(_0x3c5d09(0x159))/0x3+-parseInt(_0x3c5d09(0x15b))/0x4+-parseInt(_0x3c5d09(0x15d))/0x5+parseInt(_0x3c5d09(0x155))/0x6+parseInt(_0x3c5d09(0x15c))/0x7+parseInt(_0x3c5d09(0x15e))/0x8;if(_0x1747a8===_0x4aa044)break;else _0x4d398f['push'](_0x4d398f['shift']());}catch(_0x4d509a){_0x4d398f['push'](_0x4d398f['shift']());}}}(a56_0x3d58,0x9d296));function a56_0x2cd6(_0x149c4d,_0x9a6f){const _0x3d580b=a56_0x3d58();return a56_0x2cd6=function(_0x2cd682,_0x58be62){_0x2cd682=_0x2cd682-0x155;let _0x1fb971=_0x3d580b[_0x2cd682];return _0x1fb971;},a56_0x2cd6(_0x149c4d,_0x9a6f);}export const SITE_ALIASES={'us':a56_0x38f8f4(0x156),'aws':a56_0x38f8f4(0x156),'jp':a56_0x38f8f4(0x15a),'aws-tokyo':'jp01','dev':a56_0x38f8f4(0x158),'stg':'stg-us01'};function a56_0x3d58(){const _0x42ca6b=['590077BAdmfg','1235718ghRZqu','us01','2XupGgF','dev-us01','246798cIIixd','jp01','3786704iWxJgc','346038vJkbmh','3624965sESlle','11101384kiMHqU'];a56_0x3d58=function(){return _0x42ca6b;};return a56_0x3d58();}export{getEndpoint,API_ENDPOINTS}from'./endpoints.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a61_0xc669(){const _0x15f46c=['.\x20Expected\x20\x22project_name\x22\x20or\x20\x22project_name/agent_name\x22','3677720suZciK','132141iNtpWb','19270oMmUym','Invalid\x20agent\x20reference\x20format:\x20','66101WMUbtL','14607IdqwwR','4EXgLmz','5772330ohhezE','length','trim','split','Project\x20name\x20cannot\x20be\x20empty','2113628lJpqca','1687263hrlQpV','Agent\x20name\x20cannot\x20be\x20empty','200WImtsS'];a61_0xc669=function(){return _0x15f46c;};return a61_0xc669();}(function(_0x3d2950,_0x516806){const _0x5f3b98=a61_0x4704,_0x35be87=_0x3d2950();while(!![]){try{const _0x334cad=parseInt(_0x5f3b98(0x160))/0x1+-parseInt(_0x5f3b98(0x165))/0x2*(parseInt(_0x5f3b98(0x16c))/0x3)+parseInt(_0x5f3b98(0x16b))/0x4+-parseInt(_0x5f3b98(0x15f))/0x5+-parseInt(_0x5f3b98(0x166))/0x6+parseInt(_0x5f3b98(0x163))/0x7*(-parseInt(_0x5f3b98(0x16e))/0x8)+parseInt(_0x5f3b98(0x164))/0x9*(parseInt(_0x5f3b98(0x161))/0xa);if(_0x334cad===_0x516806)break;else _0x35be87['push'](_0x35be87['shift']());}catch(_0x303d2f){_0x35be87['push'](_0x35be87['shift']());}}}(a61_0xc669,0xb21d1));function a61_0x4704(_0x51d02a,_0x549b3a){const _0xc66984=a61_0xc669();return a61_0x4704=function(_0x4704c9,_0x8d87bd){_0x4704c9=_0x4704c9-0x15e;let _0x5c6baf=_0xc66984[_0x4704c9];return _0x5c6baf;},a61_0x4704(_0x51d02a,_0x549b3a);}export function parseAgentRef(_0x4972b2){const _0x890d96=a61_0x4704;if(!_0x4972b2||_0x4972b2[_0x890d96(0x168)]()==='')throw new Error('Agent\x20reference\x20cannot\x20be\x20empty');const _0x5127e5=_0x4972b2[_0x890d96(0x168)](),_0x1ce01f=_0x5127e5[_0x890d96(0x169)]('/');if(_0x1ce01f[_0x890d96(0x167)]===0x1)return{'projectName':_0x1ce01f[0x0],'agentName':undefined};else{if(_0x1ce01f[_0x890d96(0x167)]===0x2){const [_0x102a48,_0x134e07]=_0x1ce01f;if(!_0x102a48||_0x102a48[_0x890d96(0x168)]()==='')throw new Error(_0x890d96(0x16a));if(!_0x134e07||_0x134e07[_0x890d96(0x168)]()==='')throw new Error(_0x890d96(0x16d));return{'projectName':_0x102a48[_0x890d96(0x168)](),'agentName':_0x134e07[_0x890d96(0x168)]()};}else throw new Error(_0x890d96(0x162)+_0x4972b2+_0x890d96(0x15e));}}
|
package/dist/utils/chat-cache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3cf6b4,_0x54278b){const _0x56c996=a62_0x3735,_0x432fed=_0x3cf6b4();while(!![]){try{const _0x66467f=parseInt(_0x56c996(0x73))/0x1*(parseInt(_0x56c996(0x69))/0x2)+parseInt(_0x56c996(0x72))/0x3*(parseInt(_0x56c996(0x74))/0x4)+parseInt(_0x56c996(0x71))/0x5+parseInt(_0x56c996(0x70))/0x6+parseInt(_0x56c996(0x6d))/0x7+-parseInt(_0x56c996(0x6a))/0x8*(parseInt(_0x56c996(0x68))/0x9)+-parseInt(_0x56c996(0x6f))/0xa;if(_0x66467f===_0x54278b)break;else _0x432fed['push'](_0x432fed['shift']());}catch(_0x306082){_0x432fed['push'](_0x432fed['shift']());}}}(a62_0x43b5,0xd97ed));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{join}from'path';function a62_0x3735(_0x38e553,_0x6c69ae){const _0x43b5f1=a62_0x43b5();return a62_0x3735=function(_0x373544,_0x1a6048){_0x373544=_0x373544-0x68;let _0x3db2a0=_0x43b5f1[_0x373544];return _0x3db2a0;},a62_0x3735(_0x38e553,_0x6c69ae);}function getCacheDir(){const _0x803f2e=a62_0x3735;return join(process[_0x803f2e(0x76)](),_0x803f2e(0x6b),_0x803f2e(0x6c));}function getLastChatIdPath(){const _0x49df21=a62_0x3735;return join(getCacheDir(),_0x49df21(0x75));}function ensureCacheDir(){const _0xf000b1=getCacheDir();!existsSync(_0xf000b1)&&mkdirSync(_0xf000b1,{'recursive':!![]});}export function saveLastChatId(_0x3354b7){const _0x4a3da8=a62_0x3735;ensureCacheDir();const _0x54dc68=getLastChatIdPath();writeFileSync(_0x54dc68,_0x3354b7,_0x4a3da8(0x77));}export function loadLastChatId(){const _0x6ff54e=a62_0x3735,_0x27a79e=getLastChatIdPath();if(!existsSync(_0x27a79e))return undefined;try{const _0x21c70a=readFileSync(_0x27a79e,_0x6ff54e(0x77))[_0x6ff54e(0x6e)]();return _0x21c70a||undefined;}catch{return undefined;}}function a62_0x43b5(){const _0x5edc95=['54846xxRgZv','1844WVokjF','344zxtYdJ','.cache','tdx','7072597fJvoZW','trim','52600930QvhGID','7731720UGefPk','7629905trjmMQ','4674xbkTNm','1227eAlIWR','3740nmEJvi','last_chat_id','cwd','utf-8'];a62_0x43b5=function(){return _0x5edc95;};return a62_0x43b5();}export function clearLastChatId(){const _0x1aa563=a62_0x3735,_0x74f1c9=getLastChatIdPath();if(existsSync(_0x74f1c9))try{writeFileSync(_0x74f1c9,'',_0x1aa563(0x77));}catch{}}
|
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5ab2cc,_0x2154ab){const _0x1447b9=a63_0x5166,_0x404e84=_0x5ab2cc();while(!![]){try{const _0x5c00fe=-parseInt(_0x1447b9(0xaa))/0x1+parseInt(_0x1447b9(0x9c))/0x2+parseInt(_0x1447b9(0xa3))/0x3*(parseInt(_0x1447b9(0xa8))/0x4)+parseInt(_0x1447b9(0x9b))/0x5+-parseInt(_0x1447b9(0xb4))/0x6+-parseInt(_0x1447b9(0xa6))/0x7+parseInt(_0x1447b9(0x9e))/0x8*(parseInt(_0x1447b9(0xa0))/0x9);if(_0x5c00fe===_0x2154ab)break;else _0x404e84['push'](_0x404e84['shift']());}catch(_0x1306f4){_0x404e84['push'](_0x404e84['shift']());}}}(a63_0x5be8,0xd737e));function a63_0x5be8(){const _0x52cb37=['green','633600DvZLjR','dim','null','2932705nwgaOO','3315436NxsHFs','number','464REbaRk','stringify','95202Sywnde','object','blue','29553FNAmtR','boolean','isTTY','8176868zftLNg','isArray','376AWBZpE','join','1628519mUIxNO','length','entries','color','map','repeat','yellow','noColor','string'];a63_0x5be8=function(){return _0x52cb37;};return a63_0x5be8();}import{Chalk}from'chalk';function a63_0x5166(_0x1836d4,_0x4d6253){const _0x5be818=a63_0x5be8();return a63_0x5166=function(_0x5166ca,_0x32cb99){_0x5166ca=_0x5166ca-0x9b;let _0x254cf4=_0x5be818[_0x5166ca];return _0x254cf4;},a63_0x5166(_0x1836d4,_0x4d6253);}export function shouldUseColor(_0x52829a={}){const _0x5f4795=a63_0x5166;if(_0x52829a[_0x5f4795(0xb1)]===!![])return![];if(_0x52829a[_0x5f4795(0xad)]===!![])return!![];if(process['env']['NO_COLOR']!==undefined)return![];return process['stdout'][_0x5f4795(0xa5)]??![];}export function getChalk(_0x171842={}){if(shouldUseColor(_0x171842))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0x717067,_0x4803c7={}){const _0x568ff5=a63_0x5166;return getChalk(_0x4803c7)[_0x568ff5(0xb5)](_0x717067);}export function colorHeader(_0x4eeb52,_0x200585={}){return getChalk(_0x200585)['cyan'](_0x4eeb52);}export function colorType(_0x1c39a5,_0x1630ec={}){const _0x4e2ac3=a63_0x5166;return getChalk(_0x1630ec)[_0x4e2ac3(0xb5)](_0x1c39a5);}export function colorJSONKey(_0xf89d80,_0xfc9393={}){const _0x2d18bb=a63_0x5166;return getChalk(_0xfc9393)[_0x2d18bb(0xa2)](_0xf89d80);}export function colorJSONString(_0x2eb935,_0x500068={}){const _0x524406=a63_0x5166;return getChalk(_0x500068)[_0x524406(0xb3)](_0x2eb935);}export function colorJSONNumber(_0x89ee1,_0x218c08={}){return getChalk(_0x218c08)['cyan'](_0x89ee1);}export function colorJSONBoolean(_0x249ecd,_0x1b8f06={}){const _0x12ce11=a63_0x5166;return getChalk(_0x1b8f06)[_0x12ce11(0xb0)](_0x249ecd);}export function colorJSONNull(_0x3a267f,_0x21d2ec={}){return getChalk(_0x21d2ec)['dim'](_0x3a267f);}export function colorizeJSONCompact(_0x21654f,_0x35d1be={}){const _0x2ae092=a63_0x5166;if(!shouldUseColor(_0x35d1be))return JSON[_0x2ae092(0x9f)](_0x21654f);if(_0x21654f===null)return colorJSONNull(_0x2ae092(0xb6),_0x35d1be);if(typeof _0x21654f===_0x2ae092(0xa4))return colorJSONBoolean(String(_0x21654f),_0x35d1be);if(typeof _0x21654f===_0x2ae092(0x9d))return colorJSONNumber(String(_0x21654f),_0x35d1be);if(typeof _0x21654f==='string')return colorJSONString(JSON['stringify'](_0x21654f),_0x35d1be);if(Array[_0x2ae092(0xa7)](_0x21654f)){if(_0x21654f[_0x2ae092(0xab)]===0x0)return'[]';const _0x490809=_0x21654f[_0x2ae092(0xae)](_0x29acc7=>colorizeJSONCompact(_0x29acc7,_0x35d1be));return'['+_0x490809[_0x2ae092(0xa9)](',')+']';}if(typeof _0x21654f===_0x2ae092(0xa1)){const _0x1ef01e=Object[_0x2ae092(0xac)](_0x21654f);if(_0x1ef01e[_0x2ae092(0xab)]===0x0)return'{}';const _0x301707=_0x1ef01e[_0x2ae092(0xae)](([_0x3a422f,_0x12e222])=>{const _0x287b65=_0x2ae092,_0x3c3e65=colorJSONKey(JSON[_0x287b65(0x9f)](_0x3a422f),_0x35d1be),_0x31af89=colorizeJSONCompact(_0x12e222,_0x35d1be);return _0x3c3e65+':'+_0x31af89;});return'{'+_0x301707[_0x2ae092(0xa9)](',')+'}';}return String(_0x21654f);}export function colorizeJSON(_0x196319,_0x21aa00={},_0x1233dd=0x0){const _0xd8afeb=a63_0x5166;if(!shouldUseColor(_0x21aa00))return JSON[_0xd8afeb(0x9f)](_0x196319,null,0x2);const _0x3da530='\x20'[_0xd8afeb(0xaf)](_0x1233dd),_0x2ddd22=_0x1233dd+0x2;if(_0x196319===null)return colorJSONNull(_0xd8afeb(0xb6),_0x21aa00);if(typeof _0x196319==='boolean')return colorJSONBoolean(String(_0x196319),_0x21aa00);if(typeof _0x196319===_0xd8afeb(0x9d))return colorJSONNumber(String(_0x196319),_0x21aa00);if(typeof _0x196319===_0xd8afeb(0xb2))return colorJSONString(JSON[_0xd8afeb(0x9f)](_0x196319),_0x21aa00);if(Array[_0xd8afeb(0xa7)](_0x196319)){if(_0x196319[_0xd8afeb(0xab)]===0x0)return'[]';const _0x3b1b99=_0x196319[_0xd8afeb(0xae)](_0x34d38d=>{const _0x221122=colorizeJSON(_0x34d38d,_0x21aa00,_0x2ddd22);return''+'\x20'['repeat'](_0x2ddd22)+_0x221122;});return'[\x0a'+_0x3b1b99[_0xd8afeb(0xa9)](',\x0a')+('\x0a'+_0x3da530+']');}if(typeof _0x196319===_0xd8afeb(0xa1)){const _0x43e063=Object[_0xd8afeb(0xac)](_0x196319);if(_0x43e063[_0xd8afeb(0xab)]===0x0)return'{}';const _0x1b974b=_0x43e063['map'](([_0x310dc6,_0x322b7e])=>{const _0x2b3c06=_0xd8afeb,_0x43f420=colorJSONKey(JSON[_0x2b3c06(0x9f)](_0x310dc6),_0x21aa00),_0x19e02b=colorizeJSON(_0x322b7e,_0x21aa00,_0x2ddd22);return''+'\x20'[_0x2b3c06(0xaf)](_0x2ddd22)+_0x43f420+':\x20'+_0x19e02b;});return'{\x0a'+_0x1b974b[_0xd8afeb(0xa9)](',\x0a')+('\x0a'+_0x3da530+'}');}return String(_0x196319);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5ddc88,_0x2f70b0){const _0x170b3f=a64_0x457e,_0x39b484=_0x5ddc88();while(!![]){try{const _0x51ef32=-parseInt(_0x170b3f(0xe7))/0x1*(parseInt(_0x170b3f(0xc2))/0x2)+-parseInt(_0x170b3f(0xd5))/0x3*(parseInt(_0x170b3f(0xe5))/0x4)+parseInt(_0x170b3f(0xb5))/0x5+parseInt(_0x170b3f(0xba))/0x6*(-parseInt(_0x170b3f(0xdd))/0x7)+parseInt(_0x170b3f(0xb2))/0x8+parseInt(_0x170b3f(0xca))/0x9*(-parseInt(_0x170b3f(0xd9))/0xa)+-parseInt(_0x170b3f(0xe8))/0xb*(-parseInt(_0x170b3f(0xde))/0xc);if(_0x51ef32===_0x2f70b0)break;else _0x39b484['push'](_0x39b484['shift']());}catch(_0x44e2cd){_0x39b484['push'](_0x39b484['shift']());}}}(a64_0x5438,0x8b9fb));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a64_0x18caad from'chalk';function a64_0x457e(_0x2a7075,_0x402fca){const _0x54383c=a64_0x5438();return a64_0x457e=function(_0x457ecd,_0x3f64f3){_0x457ecd=_0x457ecd-0xb1;let _0xff2969=_0x54383c[_0x457ecd];return _0xff2969;},a64_0x457e(_0x2a7075,_0x402fca);}function a64_0x5438(){const _0x296ce1=['map','[logs]','forEach','varchar','tsv','noColor','end','6iXwNsc','─┬─','No\x20data','limit','FINISHED','bigint','string','number','2538GUSDeF','max','[error]','stdin','padEnd','join','entries','inherit','close','boolean','query','1188471RDaCJV','bold','resolve','jsonl','40560AqaRjt','push','log','output','4977007uyiDhk','59916SKZyKB','─┴─','double','yellow','format','Results\x20saved\x20to\x20','filter','8SmlloU','table','279790iXjclP','5401iNRfkQ','error','spawn','debug','isTTY','stringify','write','pipe','less','object','split','9150016YnpAbb','stderr','length','2315305SzTmXc','repeat','red','stdout','sdk-result','6wYUFVD'];a64_0x5438=function(){return _0x296ce1;};return a64_0x5438();}import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x4e9b5c){const _0x5f2048=a64_0x457e;return{'format':_0x4e9b5c[_0x5f2048(0xe2)]||_0x5f2048(0xe6),'output':_0x4e9b5c[_0x5f2048(0xdc)]||'','limit':_0x4e9b5c[_0x5f2048(0xc5)],'color':_0x4e9b5c['color'],'noColor':_0x4e9b5c[_0x5f2048(0xc0)]};}function convertSDKResultToQueryResult(_0x53c0c0){const _0x44de1b=a64_0x457e,_0x19fccc=[];if(_0x53c0c0[_0x44de1b(0xb4)]>0x0){const _0x1a8eec=_0x53c0c0[0x0];for(const [_0x3ed9cb,_0x5a7a03]of Object[_0x44de1b(0xd0)](_0x1a8eec)){let _0x5d5c26=_0x44de1b(0xbe);if(typeof _0x5a7a03===_0x44de1b(0xc9))_0x5d5c26=Number['isInteger'](_0x5a7a03)?_0x44de1b(0xc7):_0x44de1b(0xe0);else{if(typeof _0x5a7a03===_0x44de1b(0xd3))_0x5d5c26=_0x44de1b(0xd3);else _0x5a7a03===null&&(_0x5d5c26=_0x44de1b(0xbe));}_0x19fccc[_0x44de1b(0xda)]({'name':_0x3ed9cb,'type':_0x5d5c26});}}return{'queryId':_0x44de1b(0xb9),'columns':_0x19fccc,'data':_0x53c0c0,'stats':{'state':_0x44de1b(0xc6),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x53c0c0['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x5ba873,_0x898dfc){const _0x3e24ea=convertSDKResultToQueryResult(_0x5ba873);return formatQueryOutput(_0x3e24ea,_0x898dfc);}export async function formatQueryOutput(_0x574924,_0x25faf9){const _0x80fdd0=a64_0x457e,{format:_0x3633c0,limit:_0x52cc5f,output:_0x3c482b,color:_0x5ece9e,noColor:_0x5555a9}=_0x25faf9,_0x90819=Boolean(_0x3c482b)&&!_0x5ece9e,_0x291b8d={'color':_0x5ece9e,'noColor':_0x5555a9||_0x90819};if(_0x3633c0===_0x80fdd0(0xe6)){const _0x350df9=shouldUseLess(_0x3633c0,_0x3c482b);return formatAsTable(_0x574924,_0x52cc5f,_0x350df9,_0x291b8d);}else{if(_0x3633c0==='json')return formatAsJSON(_0x574924,_0x291b8d);else return _0x3633c0===_0x80fdd0(0xd8)?formatAsJSONL(_0x574924,_0x291b8d):formatQueryResult(_0x574924,_0x3633c0);}}function shouldUseLess(_0x1b55c1,_0x4b1815){const _0x365cbe=a64_0x457e;return _0x1b55c1==='table'&&process[_0x365cbe(0xb8)][_0x365cbe(0xec)]&&!_0x4b1815;}export function resolveOutputOptions(_0x51b229){const _0x385e88=a64_0x457e,_0xc0012=resolveOutputFormat(_0x51b229[_0x385e88(0xe2)],_0x51b229[_0x385e88(0xdc)],_0x385e88(0xe6));let _0xf90ed1=typeof _0x51b229[_0x385e88(0xc5)]===_0x385e88(0xc9)?_0x51b229[_0x385e88(0xc5)]:parseInt(_0x51b229[_0x385e88(0xc5)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x2ff7db=_0x51b229[_0x385e88(0xdc)]||'';return shouldUseLess(_0xc0012,_0x2ff7db)&&(_0xf90ed1=Infinity),{'format':_0xc0012,'output':_0x2ff7db,'limit':_0xf90ed1,'color':_0x51b229['color'],'noColor':_0x51b229[_0x385e88(0xc0)]};}export function writeOutput(_0x5d9acb,_0x1ac36f,_0x3e17b1){const _0x19431b=a64_0x457e;return _0x1ac36f?(writeFileSync(_0x1ac36f,_0x5d9acb),console[_0x19431b(0xe9)](_0x19431b(0xe3)+_0x1ac36f),Promise[_0x19431b(0xd7)]()):shouldUseLess(_0x3e17b1||'','')?new Promise(_0x48b36c=>{const _0x2468d7=_0x19431b,_0x23bd9f=spawn(_0x2468d7(0xf0),['-FXRSn'],{'stdio':[_0x2468d7(0xef),_0x2468d7(0xd1),_0x2468d7(0xd1)]});let _0x2bd2ef=![];_0x23bd9f['on']('error',()=>{const _0xca66da=_0x2468d7;!_0x2bd2ef&&(_0x2bd2ef=!![],console[_0xca66da(0xdb)](_0x5d9acb),_0x48b36c());}),_0x23bd9f['on'](_0x2468d7(0xd2),()=>{!_0x2bd2ef&&(_0x2bd2ef=!![],_0x48b36c());}),_0x23bd9f['on'](_0x2468d7(0xea),()=>{const _0x410fd2=_0x2468d7;!_0x2bd2ef&&_0x23bd9f[_0x410fd2(0xcd)]&&(_0x23bd9f['stdin']['on'](_0x410fd2(0xe9),()=>{}),_0x23bd9f[_0x410fd2(0xcd)][_0x410fd2(0xee)](_0x5d9acb),_0x23bd9f[_0x410fd2(0xcd)][_0x410fd2(0xc1)]());}),!_0x23bd9f['stdin']&&(!_0x2bd2ef&&(_0x2bd2ef=!![],console['log'](_0x5d9acb),_0x48b36c()));}):(console[_0x19431b(0xdb)](_0x5d9acb),Promise[_0x19431b(0xd7)]());}export async function handleSDKOutput(_0x4b07a4,_0x324f47){const _0xed17ec=a64_0x457e,_0x2653be=resolveOutputOptions(_0x324f47),_0x5276bb=await formatSDKOutput(_0x4b07a4,_0x2653be);await writeOutput(_0x5276bb,_0x2653be['output']||undefined,_0x2653be[_0xed17ec(0xe2)]);}export async function handleQueryOutput(_0x59d78d,_0x2b93e2){const _0x1625da=a64_0x457e,_0x4277d9=resolveOutputOptions(_0x2b93e2),_0xd98d35=await formatQueryOutput(_0x59d78d,_0x4277d9);await writeOutput(_0xd98d35,_0x4277d9[_0x1625da(0xdc)]||undefined,_0x4277d9[_0x1625da(0xe2)]);}async function formatSingleObject(_0x2db35a,_0x2969b9){const _0x447365=a64_0x457e,{format:_0x1eb9dc,color:_0x3ddac3,noColor:_0x397203}=_0x2969b9,_0x154a12={'color':_0x3ddac3,'noColor':_0x397203};if(_0x1eb9dc==='json'){if(shouldUseColor(_0x154a12))return colorizeJSON(_0x2db35a,_0x154a12);return JSON[_0x447365(0xed)](_0x2db35a,null,0x2);}else{if(_0x1eb9dc===_0x447365(0xd8)){if(shouldUseColor(_0x154a12))return colorizeJSONCompact(_0x2db35a,_0x154a12);return JSON[_0x447365(0xed)](_0x2db35a);}else{if(_0x1eb9dc===_0x447365(0xbf))return Object[_0x447365(0xd0)](_0x2db35a)['map'](([_0x364bff,_0x5d3d59])=>_0x364bff+'\x09'+_0x5d3d59)[_0x447365(0xcf)]('\x0a');else{const _0x7b3ada=Object[_0x447365(0xd0)](_0x2db35a);if(_0x7b3ada[_0x447365(0xb4)]===0x0)return _0x447365(0xc4);const _0x32aa3a=_0x2db35a[_0x447365(0xeb)],_0x34fed5=_0x2db35a['query'],_0x163e93=_0x34fed5?typeof _0x34fed5===_0x447365(0xc8)?_0x34fed5:JSON[_0x447365(0xed)](_0x34fed5,null,0x2):undefined,_0x571e43=_0x7b3ada[_0x447365(0xe4)](([_0x1195f0])=>_0x1195f0!==_0x447365(0xeb)&&_0x1195f0!==_0x447365(0xd4)),_0x26bfe2=Math[_0x447365(0xcb)](..._0x571e43[_0x447365(0xbb)](([_0x1975a5])=>_0x1975a5[_0x447365(0xb4)])),_0x3a3037=Math[_0x447365(0xcb)](..._0x571e43[_0x447365(0xbb)](([,_0x447ba2])=>{const _0x5dd300=_0x447365;try{const _0x309b1d=_0x447ba2===null||_0x447ba2===undefined?'':typeof _0x447ba2===_0x5dd300(0xf1)?JSON[_0x5dd300(0xed)](_0x447ba2):String(_0x447ba2),_0x122b04=_0x309b1d[_0x5dd300(0xb1)]('\x0a');return Math[_0x5dd300(0xcb)](..._0x122b04['map'](_0x4ff39b=>_0x4ff39b[_0x5dd300(0xb4)]),0x0);}catch{return 0x0;}}),0x14),_0x20e9ef=[];_0x20e9ef[_0x447365(0xda)](colorBorder('┌─'+'─'[_0x447365(0xb6)](_0x26bfe2)+_0x447365(0xc3)+'─'[_0x447365(0xb6)](_0x3a3037)+'─┐',_0x154a12)),_0x571e43[_0x447365(0xbd)](([_0x4c2623,_0x3f6cc5])=>{const _0x12358d=_0x447365;let _0x216605;try{_0x216605=_0x3f6cc5===null||_0x3f6cc5===undefined?'':typeof _0x3f6cc5==='object'?JSON[_0x12358d(0xed)](_0x3f6cc5):String(_0x3f6cc5);}catch{_0x216605='[Object]';}const _0x18857a=_0x4c2623[_0x12358d(0xce)](_0x26bfe2),_0x2fdc50=_0x216605[_0x12358d(0xb1)]('\x0a');_0x2fdc50['forEach']((_0x390d9d,_0x18e1ad)=>{const _0x4513f8=_0x12358d,_0x451ab9=colorBorder('│',_0x154a12);_0x18e1ad===0x0?_0x20e9ef[_0x4513f8(0xda)](_0x451ab9+'\x20'+_0x18857a+'\x20'+_0x451ab9+'\x20'+_0x390d9d[_0x4513f8(0xce)](_0x3a3037)+'\x20'+_0x451ab9):_0x20e9ef['push'](_0x451ab9+'\x20'+'\x20'[_0x4513f8(0xb6)](_0x26bfe2)+'\x20'+_0x451ab9+'\x20'+_0x390d9d[_0x4513f8(0xce)](_0x3a3037)+'\x20'+_0x451ab9);});}),_0x20e9ef['push'](colorBorder('└─'+'─'[_0x447365(0xb6)](_0x26bfe2)+_0x447365(0xdf)+'─'['repeat'](_0x3a3037)+'─┘',_0x154a12));_0x163e93&&(_0x20e9ef[_0x447365(0xda)](''),_0x20e9ef[_0x447365(0xda)](String(a64_0x18caad[_0x447365(0xe1)]['bold']('[query]'))),_0x20e9ef['push'](_0x163e93));if(_0x32aa3a){if(_0x32aa3a['stderr']){_0x20e9ef[_0x447365(0xda)](''),_0x20e9ef['push'](String(a64_0x18caad[_0x447365(0xb7)][_0x447365(0xd6)](_0x447365(0xcc))));const _0x25e8fd=_0x32aa3a[_0x447365(0xb3)][_0x447365(0xb1)]('\x0a');_0x25e8fd[_0x447365(0xbd)](_0x447c18=>{const _0xa84417=_0x447365;_0x447c18['trim']()&&_0x20e9ef[_0xa84417(0xda)](_0x447c18);});}if(_0x32aa3a['cmdout']){_0x20e9ef['push'](''),_0x20e9ef[_0x447365(0xda)](String(a64_0x18caad['cyan'][_0x447365(0xd6)](_0x447365(0xbc))));const _0x3b56b7=_0x32aa3a['cmdout'][_0x447365(0xb1)]('\x0a');_0x3b56b7['forEach'](_0x4661a4=>{const _0x4bd0ab=_0x447365;_0x4661a4['trim']()&&_0x20e9ef[_0x4bd0ab(0xda)](_0x4661a4);});}}return _0x20e9ef['join']('\x0a');}}}}export async function handleSingleObjectOutput(_0x4be86a,_0xc91870){const _0x5cc8b2=a64_0x457e,_0x160fba=resolveOutputOptions(_0xc91870),_0x3e3778=await formatSingleObject(_0x4be86a,_0x160fba);await writeOutput(_0x3e3778,_0x160fba[_0x5cc8b2(0xdc)]||undefined,_0x160fba[_0x5cc8b2(0xe2)]);}
|
|
1
|
+
(function(_0x5a616f,_0x521d1e){const _0x1c1f0f=a64_0x55b1,_0xd6d2ed=_0x5a616f();while(!![]){try{const _0xd8723d=parseInt(_0x1c1f0f(0xb0))/0x1*(parseInt(_0x1c1f0f(0x83))/0x2)+-parseInt(_0x1c1f0f(0x92))/0x3*(-parseInt(_0x1c1f0f(0x9c))/0x4)+parseInt(_0x1c1f0f(0xc1))/0x5*(-parseInt(_0x1c1f0f(0x8e))/0x6)+-parseInt(_0x1c1f0f(0x8c))/0x7+-parseInt(_0x1c1f0f(0x9f))/0x8*(parseInt(_0x1c1f0f(0xb9))/0x9)+-parseInt(_0x1c1f0f(0x8f))/0xa*(parseInt(_0x1c1f0f(0xc3))/0xb)+parseInt(_0x1c1f0f(0xbd))/0xc;if(_0xd8723d===_0x521d1e)break;else _0xd6d2ed['push'](_0xd6d2ed['shift']());}catch(_0xb04196){_0xd6d2ed['push'](_0xd6d2ed['shift']());}}}(a64_0x4d85,0x92461));import{writeFileSync}from'fs';import{spawn}from'child_process';import{resolveOutputFormat}from'./format-detector.js';import{colorBorder,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';import a64_0x5b3058 from'chalk';import{DEFAULT_DISPLAY_LIMIT}from'./constants.js';import{formatAsTable,formatAsJSON,formatAsJSONL,formatQueryResult}from'./formatters.js';export function parseOutputOptions(_0x2de8ea){const _0x155fe4=a64_0x55b1;return{'format':_0x2de8ea['format']||_0x155fe4(0xb1),'output':_0x2de8ea[_0x155fe4(0xa0)]||'','limit':_0x2de8ea['limit'],'color':_0x2de8ea[_0x155fe4(0x85)],'noColor':_0x2de8ea[_0x155fe4(0x89)]};}function convertSDKResultToQueryResult(_0x3d0b95){const _0x470bdd=a64_0x55b1,_0x172910=[];if(_0x3d0b95[_0x470bdd(0x82)]>0x0){const _0x5adff2=_0x3d0b95[0x0];for(const [_0x29fd7f,_0x5c22bd]of Object[_0x470bdd(0xb8)](_0x5adff2)){let _0x3996ff=_0x470bdd(0xba);if(typeof _0x5c22bd===_0x470bdd(0x91))_0x3996ff=Number[_0x470bdd(0x97)](_0x5c22bd)?'bigint':_0x470bdd(0xa6);else{if(typeof _0x5c22bd===_0x470bdd(0xb7))_0x3996ff=_0x470bdd(0xb7);else _0x5c22bd===null&&(_0x3996ff=_0x470bdd(0xba));}_0x172910[_0x470bdd(0xa2)]({'name':_0x29fd7f,'type':_0x3996ff});}}return{'queryId':_0x470bdd(0x95),'columns':_0x172910,'data':_0x3d0b95,'stats':{'state':_0x470bdd(0xa1),'queued':![],'scheduled':!![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3d0b95[_0x470bdd(0x82)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}};}export async function formatSDKOutput(_0x54c211,_0x55f27f){const _0xd38d9=convertSDKResultToQueryResult(_0x54c211);return formatQueryOutput(_0xd38d9,_0x55f27f);}function a64_0x55b1(_0xd2dc5c,_0xdb8069){const _0x4d855d=a64_0x4d85();return a64_0x55b1=function(_0x55b1fd,_0x1a516d){_0x55b1fd=_0x55b1fd-0x81;let _0x1c75f4=_0x4d855d[_0x55b1fd];return _0x1c75f4;},a64_0x55b1(_0xd2dc5c,_0xdb8069);}export async function formatQueryOutput(_0x42949c,_0x1d876e){const _0x5921cc=a64_0x55b1,{format:_0x330afd,limit:_0x3ba9b4,output:_0x291624,color:_0x15a5d0,noColor:_0x4c7e90}=_0x1d876e,_0x94172a=Boolean(_0x291624)&&!_0x15a5d0,_0x900e9b={'color':_0x15a5d0,'noColor':_0x4c7e90||_0x94172a};if(_0x330afd===_0x5921cc(0xb1)){const _0x3093c9=shouldUseLess(_0x330afd,_0x291624);return formatAsTable(_0x42949c,_0x3ba9b4,_0x3093c9,_0x900e9b);}else{if(_0x330afd===_0x5921cc(0xb4))return formatAsJSON(_0x42949c,_0x900e9b);else return _0x330afd===_0x5921cc(0xaf)?formatAsJSONL(_0x42949c,_0x900e9b):formatQueryResult(_0x42949c,_0x330afd);}}function shouldUseLess(_0x18acf8,_0x250e8d){const _0x25bfc2=a64_0x55b1;return _0x18acf8===_0x25bfc2(0xb1)&&process[_0x25bfc2(0x8b)]['isTTY']&&!_0x250e8d;}export function resolveOutputOptions(_0x2a7712){const _0x10f0ff=a64_0x55b1,_0x42fbd5=resolveOutputFormat(_0x2a7712[_0x10f0ff(0xbc)],_0x2a7712[_0x10f0ff(0xa0)],'table');let _0x18a2d8=typeof _0x2a7712[_0x10f0ff(0x9d)]===_0x10f0ff(0x91)?_0x2a7712['limit']:parseInt(_0x2a7712[_0x10f0ff(0x9d)]||String(DEFAULT_DISPLAY_LIMIT),0xa);const _0x482515=_0x2a7712['output']||'';return shouldUseLess(_0x42fbd5,_0x482515)&&(_0x18a2d8=Infinity),{'format':_0x42fbd5,'output':_0x482515,'limit':_0x18a2d8,'color':_0x2a7712[_0x10f0ff(0x85)],'noColor':_0x2a7712[_0x10f0ff(0x89)]};}export function writeOutput(_0x1cec2b,_0x52d523,_0x204f52){const _0x149ca0=a64_0x55b1;return _0x52d523?(writeFileSync(_0x52d523,_0x1cec2b),console[_0x149ca0(0xa9)](_0x149ca0(0xb5)+_0x52d523),Promise[_0x149ca0(0x93)]()):shouldUseLess(_0x204f52||'','')?new Promise(_0xd3586f=>{const _0x4cacbc=_0x149ca0,_0x32db83=spawn(_0x4cacbc(0xbe),['-FXRSn'],{'stdio':[_0x4cacbc(0xac),_0x4cacbc(0x94),_0x4cacbc(0x94)]});let _0x73cd=![];_0x32db83['on'](_0x4cacbc(0xa9),()=>{!_0x73cd&&(_0x73cd=!![],console['log'](_0x1cec2b),_0xd3586f());}),_0x32db83['on'](_0x4cacbc(0x96),()=>{!_0x73cd&&(_0x73cd=!![],_0xd3586f());}),_0x32db83['on'](_0x4cacbc(0xad),()=>{const _0x550f74=_0x4cacbc;!_0x73cd&&_0x32db83['stdin']&&(_0x32db83['stdin']['on']('error',()=>{}),_0x32db83[_0x550f74(0xc0)][_0x550f74(0x9a)](_0x1cec2b),_0x32db83[_0x550f74(0xc0)][_0x550f74(0xa5)]());}),!_0x32db83['stdin']&&(!_0x73cd&&(_0x73cd=!![],console[_0x4cacbc(0xab)](_0x1cec2b),_0xd3586f()));}):(console['log'](_0x1cec2b),Promise['resolve']());}export async function handleSDKOutput(_0x4c5ec1,_0x5c4592){const _0x571278=a64_0x55b1,_0x465639=resolveOutputOptions(_0x5c4592),_0x53b684=await formatSDKOutput(_0x4c5ec1,_0x465639);await writeOutput(_0x53b684,_0x465639[_0x571278(0xa0)]||undefined,_0x465639[_0x571278(0xbc)]);}export async function handleQueryOutput(_0xca1b0e,_0x236928){const _0x5de6de=a64_0x55b1,_0x335468=resolveOutputOptions(_0x236928),_0x13542d=await formatQueryOutput(_0xca1b0e,_0x335468);await writeOutput(_0x13542d,_0x335468[_0x5de6de(0xa0)]||undefined,_0x335468[_0x5de6de(0xbc)]);}async function formatSingleObject(_0x4c6a65,_0x47d258){const _0x125b21=a64_0x55b1,{format:_0x123f2c,color:_0x4c9d0c,noColor:_0x57e43d}=_0x47d258,_0x2366be={'color':_0x4c9d0c,'noColor':_0x57e43d};if(_0x123f2c===_0x125b21(0xb4)){if(shouldUseColor(_0x2366be))return colorizeJSON(_0x4c6a65,_0x2366be);return JSON[_0x125b21(0x99)](_0x4c6a65,null,0x2);}else{if(_0x123f2c===_0x125b21(0xaf)){if(shouldUseColor(_0x2366be))return colorizeJSONCompact(_0x4c6a65,_0x2366be);return JSON[_0x125b21(0x99)](_0x4c6a65);}else{if(_0x123f2c===_0x125b21(0x9e))return Object[_0x125b21(0xb8)](_0x4c6a65)[_0x125b21(0x90)](([_0x2d4e21,_0x5ecd60])=>_0x2d4e21+'\x09'+_0x5ecd60)[_0x125b21(0x98)]('\x0a');else{const _0x3b1fd5=Object[_0x125b21(0xb8)](_0x4c6a65);if(_0x3b1fd5[_0x125b21(0x82)]===0x0)return _0x125b21(0x87);const _0x21fef8=_0x4c6a65[_0x125b21(0x84)],_0x14b6f6=_0x4c6a65[_0x125b21(0xbf)],_0x39bfef=_0x14b6f6?typeof _0x14b6f6==='string'?_0x14b6f6:JSON[_0x125b21(0x99)](_0x14b6f6,null,0x2):undefined,_0x36ed17=_0x3b1fd5[_0x125b21(0xaa)](([_0x5caaed])=>_0x5caaed!=='debug'&&_0x5caaed!==_0x125b21(0xbf)),_0x55c111=Math[_0x125b21(0x81)](..._0x36ed17[_0x125b21(0x90)](([_0x518cf7])=>_0x518cf7[_0x125b21(0x82)])),_0x31c3ae=Math[_0x125b21(0x81)](..._0x36ed17[_0x125b21(0x90)](([,_0x3e4f4a])=>{const _0x3400f7=_0x125b21;try{const _0xd6d679=_0x3e4f4a===null||_0x3e4f4a===undefined?'':typeof _0x3e4f4a===_0x3400f7(0xae)?JSON[_0x3400f7(0x99)](_0x3e4f4a):String(_0x3e4f4a),_0x41c422=_0xd6d679[_0x3400f7(0xa3)]('\x0a');return Math[_0x3400f7(0x81)](..._0x41c422['map'](_0x2f6663=>_0x2f6663[_0x3400f7(0x82)]),0x0);}catch{return 0x0;}}),0x14),_0x7ee6d9=[];_0x7ee6d9['push'](colorBorder('┌─'+'─'[_0x125b21(0xa7)](_0x55c111)+'─┬─'+'─'[_0x125b21(0xa7)](_0x31c3ae)+'─┐',_0x2366be)),_0x36ed17[_0x125b21(0xa8)](([_0x4100ff,_0x836178])=>{const _0x573dc8=_0x125b21;let _0x466970;try{_0x466970=_0x836178===null||_0x836178===undefined?'':typeof _0x836178===_0x573dc8(0xae)?JSON['stringify'](_0x836178):String(_0x836178);}catch{_0x466970=_0x573dc8(0xb6);}const _0x58e1f0=_0x4100ff[_0x573dc8(0x88)](_0x55c111),_0x19a5b8=_0x466970[_0x573dc8(0xa3)]('\x0a');_0x19a5b8[_0x573dc8(0xa8)]((_0x51b1f4,_0x304c77)=>{const _0x3b0d88=_0x573dc8,_0x3226b5=colorBorder('│',_0x2366be);_0x304c77===0x0?_0x7ee6d9[_0x3b0d88(0xa2)](_0x3226b5+'\x20'+_0x58e1f0+'\x20'+_0x3226b5+'\x20'+_0x51b1f4['padEnd'](_0x31c3ae)+'\x20'+_0x3226b5):_0x7ee6d9[_0x3b0d88(0xa2)](_0x3226b5+'\x20'+'\x20'['repeat'](_0x55c111)+'\x20'+_0x3226b5+'\x20'+_0x51b1f4[_0x3b0d88(0x88)](_0x31c3ae)+'\x20'+_0x3226b5);});}),_0x7ee6d9[_0x125b21(0xa2)](colorBorder('└─'+'─'[_0x125b21(0xa7)](_0x55c111)+'─┴─'+'─'[_0x125b21(0xa7)](_0x31c3ae)+'─┘',_0x2366be));_0x39bfef&&(_0x7ee6d9[_0x125b21(0xa2)](''),_0x7ee6d9[_0x125b21(0xa2)](String(a64_0x5b3058[_0x125b21(0xb3)]['bold'](_0x125b21(0xbb)))),_0x7ee6d9[_0x125b21(0xa2)](_0x39bfef));if(_0x21fef8){if(_0x21fef8[_0x125b21(0x9b)]){_0x7ee6d9[_0x125b21(0xa2)](''),_0x7ee6d9[_0x125b21(0xa2)](String(a64_0x5b3058[_0x125b21(0x8d)]['bold'](_0x125b21(0xb2))));const _0xa7a0da=_0x21fef8[_0x125b21(0x9b)][_0x125b21(0xa3)]('\x0a');_0xa7a0da[_0x125b21(0xa8)](_0x18bb8e=>{const _0x455db7=_0x125b21;_0x18bb8e[_0x455db7(0xa4)]()&&_0x7ee6d9[_0x455db7(0xa2)](_0x18bb8e);});}if(_0x21fef8[_0x125b21(0x8a)]){_0x7ee6d9[_0x125b21(0xa2)](''),_0x7ee6d9['push'](String(a64_0x5b3058[_0x125b21(0x86)][_0x125b21(0xc2)]('[logs]')));const _0x2b5569=_0x21fef8[_0x125b21(0x8a)][_0x125b21(0xa3)]('\x0a');_0x2b5569[_0x125b21(0xa8)](_0x442578=>{const _0x24b21a=_0x125b21;_0x442578[_0x24b21a(0xa4)]()&&_0x7ee6d9[_0x24b21a(0xa2)](_0x442578);});}}return _0x7ee6d9[_0x125b21(0x98)]('\x0a');}}}}export async function handleSingleObjectOutput(_0x23bce6,_0x4fe2d8){const _0x4c0b27=a64_0x55b1,_0x341e68=resolveOutputOptions(_0x4fe2d8),_0x20ca28=await formatSingleObject(_0x23bce6,_0x341e68);await writeOutput(_0x20ca28,_0x341e68[_0x4c0b27(0xa0)]||undefined,_0x341e68[_0x4c0b27(0xbc)]);}function a64_0x4d85(){const _0x15cfe5=['trim','end','double','repeat','forEach','error','filter','log','pipe','spawn','object','jsonl','5023RyLHye','table','[error]','yellow','json','Results\x20saved\x20to\x20','[Object]','boolean','entries','77616BFEmLw','varchar','[query]','format','31193868VwlRZo','less','query','stdin','45935SBWUET','bold','11sTqiOL','max','length','154SYecHY','debug','color','cyan','No\x20data','padEnd','noColor','cmdout','stdout','6143935yiAMhu','red','414NHzfdf','2014510UMqdLf','map','number','14016Bkwmly','resolve','inherit','sdk-result','close','isInteger','join','stringify','write','stderr','272WunPsD','limit','tsv','920epfWID','output','FINISHED','push','split'];a64_0x4d85=function(){return _0x15cfe5;};return a64_0x4d85();}
|
package/dist/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a65_0x5eac(){const _0x1066aa=['753462QrIXEb','314Jgxwat','36sJdeXL','7445658SzjSFo','number','900280fpojWQ','252jWXWGN','53706Iwuoge','2951BPeuqF','30030696TddUZd','747168GgzJEL','4cjQskc','10vIAXAb'];a65_0x5eac=function(){return _0x1066aa;};return a65_0x5eac();}(function(_0x32af22,_0xbd150b){const _0x51c1dd=a65_0x564b,_0x26aaac=_0x32af22();while(!![]){try{const _0x9ef37c=-parseInt(_0x51c1dd(0xde))/0x1*(parseInt(_0x51c1dd(0xd7))/0x2)+-parseInt(_0x51c1dd(0xd6))/0x3+parseInt(_0x51c1dd(0xd4))/0x4*(parseInt(_0x51c1dd(0xdb))/0x5)+parseInt(_0x51c1dd(0xdd))/0x6*(-parseInt(_0x51c1dd(0xdc))/0x7)+parseInt(_0x51c1dd(0xd3))/0x8*(-parseInt(_0x51c1dd(0xd8))/0x9)+-parseInt(_0x51c1dd(0xd5))/0xa*(parseInt(_0x51c1dd(0xd9))/0xb)+parseInt(_0x51c1dd(0xdf))/0xc;if(_0x9ef37c===_0xbd150b)break;else _0x26aaac['push'](_0x26aaac['shift']());}catch(_0x50c18a){_0x26aaac['push'](_0x26aaac['shift']());}}}(a65_0x5eac,0x915ff));function a65_0x564b(_0x488ad5,_0x20a894){const _0x5eacb2=a65_0x5eac();return a65_0x564b=function(_0x564bb8,_0x1ae0a9){_0x564bb8=_0x564bb8-0xd3;let _0x2e089e=_0x5eacb2[_0x564bb8];return _0x2e089e;},a65_0x564b(_0x488ad5,_0x20a894);}export const DEFAULT_DISPLAY_LIMIT=0x28;export const DEFAULT_LISTING_LIMIT=0x2710;export const DEFAULT_LLM_LIMIT=0x32;export function resolveLimit(_0x322e4e,_0x330a6b){const _0x373034=a65_0x564b;if(_0x322e4e===undefined)return _0x330a6b;if(typeof _0x322e4e===_0x373034(0xda))return _0x322e4e;return parseInt(_0x322e4e,0xa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24615c,_0x127833){const _0xfbe23c=a66_0x5693,_0x25f18f=_0x24615c();while(!![]){try{const _0x986a51=-parseInt(_0xfbe23c(0xb8))/0x1+parseInt(_0xfbe23c(0xcc))/0x2+parseInt(_0xfbe23c(0xc2))/0x3*(parseInt(_0xfbe23c(0xb9))/0x4)+-parseInt(_0xfbe23c(0xc9))/0x5*(-parseInt(_0xfbe23c(0xbc))/0x6)+parseInt(_0xfbe23c(0xc8))/0x7*(-parseInt(_0xfbe23c(0xbf))/0x8)+parseInt(_0xfbe23c(0xc0))/0x9*(-parseInt(_0xfbe23c(0xc5))/0xa)+parseInt(_0xfbe23c(0xbb))/0xb*(parseInt(_0xfbe23c(0xc7))/0xc);if(_0x986a51===_0x127833)break;else _0x25f18f['push'](_0x25f18f['shift']());}catch(_0x5864f4){_0x25f18f['push'](_0x25f18f['shift']());}}}(a66_0x2f6d,0xbb78c));import*as a66_0x1c8648 from'node:fs';function a66_0x2f6d(){const _0x4a0327=['42nFZWmK','2634330CZJhtZ','\x20has\x20insecure\x20permissions\x20(','chmodSync','2533958WiqWWu','Warning:\x20','579621OrrhkI','505364bxwtvL','toString','131296TUPMdN','6SSpIHd','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','warn','1955888EhoBcI','383463dXwevj','mode','12QFPssL','Should\x20be\x200600\x20or\x20more\x20restrictive.','dirname','120pBEuyp',').\x20','1032MdmmLp'];a66_0x2f6d=function(){return _0x4a0327;};return a66_0x2f6d();}import*as a66_0x1dfa68 from'node:path';export function setSecureFilePermissions(_0x5e0474){const _0x38966e=a66_0x5693;try{a66_0x1c8648['chmodSync'](_0x5e0474,0x180);}catch{console[_0x38966e(0xbe)](_0x38966e(0xbd)+_0x5e0474);}}export function setSecureDirectoryPermissions(_0xf10e73){const _0x5a65e0=a66_0x5693;try{a66_0x1c8648[_0x5a65e0(0xcb)](_0xf10e73,0x1c0);}catch{console[_0x5a65e0(0xbe)](_0x5a65e0(0xbd)+_0xf10e73);}}function a66_0x5693(_0x4914dc,_0x58ebac){const _0x2f6dc1=a66_0x2f6d();return a66_0x5693=function(_0x5693e0,_0x48c65a){_0x5693e0=_0x5693e0-0xb8;let _0x4c3e67=_0x2f6dc1[_0x5693e0];return _0x4c3e67;},a66_0x5693(_0x4914dc,_0x58ebac);}export function createSecureDirectory(_0x424731){!a66_0x1c8648['existsSync'](_0x424731)&&(a66_0x1c8648['mkdirSync'](_0x424731,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x424731));}export function validateSecureFilePermissions(_0x462b82){const _0x331725=a66_0x5693;try{const _0x4d576c=a66_0x1c8648['statSync'](_0x462b82),_0x21a12f=_0x4d576c[_0x331725(0xc1)]&0x1ff,_0x597c74=(_0x21a12f&0x3f)!==0x0;if(_0x597c74)return console[_0x331725(0xbe)](_0x331725(0xcd)+_0x462b82+_0x331725(0xca)+_0x21a12f[_0x331725(0xba)](0x8)+_0x331725(0xc6)+_0x331725(0xc3)),![];return!![];}catch{return!![];}}export function writeSecureFile(_0x5bcb7f,_0x2ebb49){const _0x5dd450=a66_0x5693,_0x2114e8=a66_0x1dfa68[_0x5dd450(0xc4)](_0x5bcb7f);createSecureDirectory(_0x2114e8),a66_0x1c8648['writeFileSync'](_0x5bcb7f,_0x2ebb49,{'mode':0x180}),setSecureFilePermissions(_0x5bcb7f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3489cc,_0x2cd6c7){const _0x8fb1cc=a67_0x9857,_0x41c05c=_0x3489cc();while(!![]){try{const _0x3260d2=-parseInt(_0x8fb1cc(0xc2))/0x1+parseInt(_0x8fb1cc(0xbb))/0x2+parseInt(_0x8fb1cc(0xbf))/0x3+-parseInt(_0x8fb1cc(0xc1))/0x4+parseInt(_0x8fb1cc(0xc5))/0x5+-parseInt(_0x8fb1cc(0xc6))/0x6+-parseInt(_0x8fb1cc(0xb9))/0x7*(-parseInt(_0x8fb1cc(0xc0))/0x8);if(_0x3260d2===_0x2cd6c7)break;else _0x41c05c['push'](_0x41c05c['shift']());}catch(_0x1a8b72){_0x41c05c['push'](_0x41c05c['shift']());}}}(a67_0x2a82,0xd8b91));export function detectFormatFromExtension(_0x206c1c){const _0x20c947=a67_0x9857,_0x13da1e=_0x206c1c['toLowerCase']()['split']('.')[_0x20c947(0xc3)]();switch(_0x13da1e){case _0x20c947(0xc4):return _0x20c947(0xc4);case'jsonl':return _0x20c947(0xba);case _0x20c947(0xb8):case _0x20c947(0xbe):return _0x20c947(0xb8);case _0x20c947(0xbd):case _0x20c947(0xb7):return _0x20c947(0xbc);default:return undefined;}}export function resolveOutputFormat(_0x1d7c28,_0x2bea3b,_0x191b3d){if(_0x1d7c28)return _0x1d7c28;if(_0x2bea3b){const _0x104d47=detectFormatFromExtension(_0x2bea3b);if(_0x104d47)return _0x104d47;}return _0x191b3d;}function a67_0x9857(_0x2daaba,_0x4489d6){const _0x2a8225=a67_0x2a82();return a67_0x9857=function(_0x985789,_0x3dcb09){_0x985789=_0x985789-0xb7;let _0x5aef2e=_0x2a8225[_0x985789];return _0x5aef2e;},a67_0x9857(_0x2daaba,_0x4489d6);}function a67_0x2a82(){const _0x55516c=['69207kQofWN','pop','json','1276965QvizwM','10430142alfpLp','text','tsv','21WQsdRQ','jsonl','36454YPKKpd','table','txt','tab','285003yRauhw','9694768gcRrVb','5235592BIgvCn'];a67_0x2a82=function(){return _0x55516c;};return a67_0x2a82();}
|
package/dist/utils/formatters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x33a850,_0x2e933c){const _0x61fe89=a68_0x4a39,_0x371b9f=_0x33a850();while(!![]){try{const _0x846f4c=parseInt(_0x61fe89(0xd8))/0x1+parseInt(_0x61fe89(0xbe))/0x2+-parseInt(_0x61fe89(0xe2))/0x3*(-parseInt(_0x61fe89(0xbd))/0x4)+-parseInt(_0x61fe89(0xe3))/0x5+parseInt(_0x61fe89(0xe1))/0x6+-parseInt(_0x61fe89(0xb8))/0x7*(-parseInt(_0x61fe89(0xc0))/0x8)+parseInt(_0x61fe89(0xde))/0x9*(-parseInt(_0x61fe89(0xb7))/0xa);if(_0x846f4c===_0x2e933c)break;else _0x371b9f['push'](_0x371b9f['shift']());}catch(_0x168952){_0x371b9f['push'](_0x371b9f['shift']());}}}(a68_0x1952,0xc125c));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x399d94=a68_0x4a39;return process[_0x399d94(0xd4)][_0x399d94(0xd9)]||Infinity;}export function formatAsTable(_0x18f1c6,_0x19c0ee=DEFAULT_MAX_DISPLAY_ROWS,_0x4408bc=![],_0x1eb0a1={}){const _0x4a5e32=a68_0x4a39;if(_0x18f1c6[_0x4a5e32(0xc9)]['length']===0x0)return _0x4a5e32(0xc6);const _0x42b484=_0x18f1c6[_0x4a5e32(0xd9)][_0x4a5e32(0xd0)](_0x260b9e=>_0x260b9e['name']),_0x1c26ed=_0x18f1c6['columns'][_0x4a5e32(0xd0)](_0xb6663a=>simplifyType(_0xb6663a[_0x4a5e32(0xb2)])),_0x333ea0=_0x18f1c6[_0x4a5e32(0xc9)][_0x4a5e32(0xdd)](0x0,_0x19c0ee),_0x3ee361=_0x18f1c6[_0x4a5e32(0xc9)][_0x4a5e32(0xbf)],_0x58481b=_0x3ee361>_0x19c0ee,_0x2c63d3=[],_0x154afd=getTerminalWidth(),_0x33d204=_0x154afd!==Infinity,_0x3bd37e=0x32;let _0x1bd227=_0x42b484[_0x4a5e32(0xd0)]((_0x1f62c8,_0x3c3104)=>{const _0x4c105c=_0x4a5e32,_0x4aee5a=stringWidth(_0x1c26ed[_0x3c3104]),_0x125168=Math[_0x4c105c(0xb3)](..._0x333ea0[_0x4c105c(0xd0)](_0x47b170=>{const _0x3b210d=_0x47b170[_0x1f62c8];return stringWidth(formatValue(_0x3b210d));})),_0x106b39=Math[_0x4c105c(0xb3)](stringWidth(_0x1f62c8),_0x4aee5a,_0x125168);return _0x4408bc?_0x106b39:Math[_0x4c105c(0xdf)](_0x106b39,_0x3bd37e);});if(_0x33d204&&!_0x4408bc&&_0x42b484[_0x4a5e32(0xbf)]>0x0){const _0x37887b=_0x216b7f=>{let _0x3dd748=0x1;for(const _0x15f359 of _0x216b7f){_0x3dd748+=_0x15f359+0x3;}return _0x3dd748+0x1;};let _0x4d23eb=_0x37887b(_0x1bd227);if(_0x4d23eb>_0x154afd){const _0x3ff88d=0x3;for(let _0x30543b=_0x1bd227[_0x4a5e32(0xbf)]-0x1;_0x30543b>=0x0;_0x30543b--){_0x4d23eb=_0x37887b(_0x1bd227);if(_0x4d23eb<=_0x154afd)break;const _0x54bdf6=_0x1bd227[_0x30543b],_0x55baf4=_0x4d23eb-_0x154afd,_0x4b9d6e=_0x54bdf6-_0x3ff88d,_0xcd603c=Math[_0x4a5e32(0xdf)](_0x55baf4,_0x4b9d6e);_0xcd603c>0x0&&(_0x1bd227[_0x30543b]=_0x54bdf6-_0xcd603c);}}}const _0x552fbf=_0x42b484,_0x3cf9d7=_0x1c26ed,_0x201399=_0x1bd227,_0x51b276=_0x1bd227;_0x2c63d3[_0x4a5e32(0xc3)](colorBorder('┌'+_0x51b276[_0x4a5e32(0xd0)](_0x147a9b=>'─'[_0x4a5e32(0xb1)](_0x147a9b+0x2))[_0x4a5e32(0xe0)]('┬')+'┐',_0x1eb0a1));const _0x3b2e26=_0x552fbf['map']((_0xec4b7b,_0x2a9c49)=>centerAlign(_0xec4b7b,_0x201399[_0x2a9c49]));_0x2c63d3[_0x4a5e32(0xc3)](colorBorder('│',_0x1eb0a1)+'\x20'+_0x3b2e26[_0x4a5e32(0xe0)]('\x20'+colorBorder('│',_0x1eb0a1)+'\x20')+'\x20'+colorBorder('│',_0x1eb0a1));const _0xd0881e=_0x3cf9d7[_0x4a5e32(0xd0)]((_0x21fb49,_0x18db19)=>colorType(centerAlign(_0x21fb49,_0x201399[_0x18db19]),_0x1eb0a1));_0x2c63d3[_0x4a5e32(0xc3)](colorBorder('│',_0x1eb0a1)+'\x20'+_0xd0881e[_0x4a5e32(0xe0)]('\x20'+colorBorder('│',_0x1eb0a1)+'\x20')+'\x20'+colorBorder('│',_0x1eb0a1)),_0x2c63d3[_0x4a5e32(0xc3)](colorBorder('├'+_0x51b276[_0x4a5e32(0xd0)](_0x8cbb1=>'─'[_0x4a5e32(0xb1)](_0x8cbb1+0x2))['join']('┼')+'┤',_0x1eb0a1));const _0x2ab0d6=(_0x9f0490,_0x5c473b)=>{const _0x38842d=_0x4a5e32,_0x3dddc9=stringWidth(_0x9f0490);if(_0x3dddc9<=_0x5c473b)return _0x9f0490;let _0x1f7377=_0x9f0490;while(stringWidth(_0x1f7377+'…')>_0x5c473b&&_0x1f7377[_0x38842d(0xbf)]>0x0){_0x1f7377=_0x1f7377['slice'](0x0,-0x1);}return _0x1f7377+'…';};_0x333ea0[_0x4a5e32(0xdc)](_0x50c710=>{const _0x25a97e=_0x4a5e32,_0x274565=_0x42b484[_0x25a97e(0xd0)]((_0x1de113,_0x3ecfbf)=>{const _0x382e87=_0x25a97e,_0x503fe0=_0x50c710[_0x1de113],_0x4f4e89=formatValue(_0x503fe0),_0x2964c6=_0x201399[_0x3ecfbf],_0x572c39=_0x2ab0d6(_0x4f4e89,_0x2964c6),_0x37ed79=typeof _0x503fe0==='number'||typeof _0x503fe0===_0x382e87(0xb9)&&/^-?\d+$/[_0x382e87(0xd3)](_0x503fe0);return _0x37ed79?padStart(_0x572c39,_0x2964c6):padEnd(_0x572c39,_0x2964c6);});_0x2c63d3[_0x25a97e(0xc3)](colorBorder('│',_0x1eb0a1)+'\x20'+_0x274565[_0x25a97e(0xe0)]('\x20'+colorBorder('│',_0x1eb0a1)+'\x20')+'\x20'+colorBorder('│',_0x1eb0a1));});const _0x5733c3=_0x51b276['reduce']((_0x9cccee,_0x5e8e12)=>_0x9cccee+_0x5e8e12+0x3,-0x1);_0x2c63d3[_0x4a5e32(0xc3)](colorBorder('├'+_0x51b276[_0x4a5e32(0xd0)](_0x375bc9=>'─'['repeat'](_0x375bc9+0x2))['join']('┴')+'┤',_0x1eb0a1));let _0x1e74f7;_0x58481b?_0x1e74f7=_0x3ee361+'\x20rows\x20('+_0x19c0ee+_0x4a5e32(0xb6):_0x1e74f7=_0x3ee361+_0x4a5e32(0xcc)+(_0x3ee361===0x1?'':'s');const _0x4c000c=_0x1e74f7[_0x4a5e32(0xb5)](_0x5733c3-0x2);return _0x2c63d3[_0x4a5e32(0xc3)](colorBorder('│',_0x1eb0a1)+'\x20'+_0x4c000c+'\x20'+colorBorder('│',_0x1eb0a1)),_0x2c63d3[_0x4a5e32(0xc3)](colorBorder('└'+'─'['repeat'](_0x5733c3)+'┘',_0x1eb0a1)),_0x2c63d3[_0x4a5e32(0xe0)]('\x0a');}function simplifyType(_0x129b92){const _0x1769e7=a68_0x4a39,_0x45df56={'varchar':_0x1769e7(0xb9),'bigint':'long','integer':_0x1769e7(0xc7),'double':'double','boolean':'bool','date':_0x1769e7(0xba),'timestamp':_0x1769e7(0xb0),'array':_0x1769e7(0xc4),'map':'map','row':_0x1769e7(0xcb)},_0xd0260=_0x129b92[_0x1769e7(0xc5)]();for(const [_0x198010,_0x3f21d9]of Object[_0x1769e7(0xce)](_0x45df56)){if(_0xd0260[_0x1769e7(0xaf)](_0x198010))return _0x3f21d9;}return _0x129b92[_0x1769e7(0xbf)]>0xa?_0x129b92['substring'](0x0,0xa):_0x129b92;}export function formatAsJSON(_0x341f9e,_0xa0bc11={}){const _0x13ca54=a68_0x4a39;if(_0x341f9e['data'][_0x13ca54(0xbf)]===0x0)return'[]';if(shouldUseColor(_0xa0bc11))return colorizeJSON(_0x341f9e[_0x13ca54(0xc9)],_0xa0bc11);const _0x176ec7=_0x341f9e[_0x13ca54(0xc9)][_0x13ca54(0xd0)](_0x108b90=>'\x20\x20'+JSON[_0x13ca54(0xd6)](_0x108b90));return'[\x0a'+_0x176ec7[_0x13ca54(0xe0)](',\x0a')+'\x0a]';}function a68_0x4a39(_0x31d521,_0x45ff31){const _0x19522d=a68_0x1952();return a68_0x4a39=function(_0x4a39f7,_0x40f411){_0x4a39f7=_0x4a39f7-0xaf;let _0x1c1cc2=_0x19522d[_0x4a39f7];return _0x1c1cc2;},a68_0x4a39(_0x31d521,_0x45ff31);}export function formatAsJSONL(_0x35e5b2,_0x4cd29e={}){const _0x4ec0e5=a68_0x4a39;if(_0x35e5b2[_0x4ec0e5(0xc9)][_0x4ec0e5(0xbf)]===0x0)return'';if(shouldUseColor(_0x4cd29e))return _0x35e5b2[_0x4ec0e5(0xc9)][_0x4ec0e5(0xd0)](_0xd89def=>colorizeJSONCompact(_0xd89def,_0x4cd29e))[_0x4ec0e5(0xe0)]('\x0a');return _0x35e5b2[_0x4ec0e5(0xc9)][_0x4ec0e5(0xd0)](_0x24ca78=>JSON['stringify'](_0x24ca78))[_0x4ec0e5(0xe0)]('\x0a');}export function formatAsTSV(_0x7126b5){const _0x39a90f=a68_0x4a39;if(_0x7126b5[_0x39a90f(0xc9)][_0x39a90f(0xbf)]===0x0)return'';const _0x3a8c81=[],_0x510c97=_0x7126b5[_0x39a90f(0xd9)]['map'](_0x16a629=>_0x16a629['name']);return _0x3a8c81['push'](_0x510c97[_0x39a90f(0xe0)]('\x09')),_0x7126b5['data'][_0x39a90f(0xdc)](_0x246d3b=>{const _0x5c4a51=_0x39a90f,_0x35d387=_0x510c97[_0x5c4a51(0xd0)](_0x5cc014=>{const _0x23718c=_0x246d3b[_0x5cc014];return formatValueForTSV(_0x23718c);});_0x3a8c81[_0x5c4a51(0xc3)](_0x35d387[_0x5c4a51(0xe0)]('\x09'));}),_0x3a8c81[_0x39a90f(0xe0)]('\x0a');}function formatValue(_0x266012){const _0x1e28e4=a68_0x4a39;if(_0x266012===null||_0x266012===undefined)return'';if(typeof _0x266012===_0x1e28e4(0xb9)){const _0x12defa=_0x266012[_0x1e28e4(0xcf)](/\n/g,'\x5cn')[_0x1e28e4(0xcf)](/\r/g,'\x5cr')[_0x1e28e4(0xcf)](/\t/g,'\x5ct');return _0x12defa;}if(typeof _0x266012==='number')return String(_0x266012);if(typeof _0x266012===_0x1e28e4(0xbb))return _0x266012?_0x1e28e4(0xdb):'false';if(_0x266012 instanceof Date)return _0x266012[_0x1e28e4(0xbc)]();if(typeof _0x266012==='object')return JSON['stringify'](_0x266012);return String(_0x266012);}function formatValueForTSV(_0x4f571b){const _0x34ccbb=a68_0x4a39;if(_0x4f571b===null||_0x4f571b===undefined)return'';if(typeof _0x4f571b==='string')return _0x4f571b[_0x34ccbb(0xcf)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x4f571b===_0x34ccbb(0xc2)||typeof _0x4f571b===_0x34ccbb(0xbb))return String(_0x4f571b);if(_0x4f571b instanceof Date)return _0x4f571b[_0x34ccbb(0xbc)]();if(typeof _0x4f571b===_0x34ccbb(0xd7))return JSON[_0x34ccbb(0xd6)](_0x4f571b);return String(_0x4f571b);}export function formatQueryResult(_0x3ff278,_0x3675ef){const _0xfdf75b=a68_0x4a39;switch(_0x3675ef){case _0xfdf75b(0xda):return formatAsTable(_0x3ff278);case _0xfdf75b(0xb4):return formatAsJSON(_0x3ff278);case _0xfdf75b(0xd5):return formatAsJSONL(_0x3ff278);case _0xfdf75b(0xc1):return formatAsTSV(_0x3ff278);default:return formatAsJSON(_0x3ff278);}}export function formatBytes(_0xbd345a){const _0x3d6c27=a68_0x4a39;if(_0xbd345a===0x0)return _0x3d6c27(0xca);const _0x14f9e5=['B','KB','MB','GB','TB'],_0x59457e=0x400,_0x4a5126=Math[_0x3d6c27(0xd1)](Math[_0x3d6c27(0xc8)](_0xbd345a)/Math[_0x3d6c27(0xc8)](_0x59457e)),_0x5c42f4=_0xbd345a/Math['pow'](_0x59457e,_0x4a5126),_0x5acc16=_0x5c42f4>=0xa?0x1:0x2;return _0x5c42f4[_0x3d6c27(0xcd)](_0x5acc16)+'\x20'+_0x14f9e5[_0x4a5126];}export function formatRows(_0x55d3f2){const _0x12d980=a68_0x4a39;if(_0x55d3f2==null)return'-';if(_0x55d3f2===0x0)return'0';if(_0x55d3f2<0x3e8)return _0x55d3f2['toString']();const _0xc9909c=['','K','M','B','T'],_0x770e38=0x3e8,_0x1b8b31=Math['floor'](Math['log'](_0x55d3f2)/Math[_0x12d980(0xc8)](_0x770e38)),_0x4063ae=_0x55d3f2/Math[_0x12d980(0xd2)](_0x770e38,_0x1b8b31),_0x28fadd=_0x4063ae>=0xa?0x1:0x2;return''+_0x4063ae['toFixed'](_0x28fadd)+_0xc9909c[_0x1b8b31];}function a68_0x1952(){const _0x322681=['floor','pow','test','stdout','jsonl','stringify','object','1236626wuHQxm','columns','table','true','forEach','slice','316791JVWTLF','min','join','213480fOGrJk','9VBFita','6726655gewJmG','startsWith','timestamp','repeat','type','max','json','padEnd','\x20shown)','390wutsIp','77NqiQMh','string','date','boolean','toISOString','1870292ryOOgK','1639580tnGJac','length','10552AsQYOP','tsv','number','push','array','toLowerCase','No\x20rows\x20returned','int','log','data','0\x20B','row','\x20row','toFixed','entries','replace','map'];a68_0x1952=function(){return _0x322681;};return a68_0x1952();}
|
|
1
|
+
(function(_0x351522,_0x4670d2){const _0xcd2e6c=a68_0x3388,_0x165f0e=_0x351522();while(!![]){try{const _0x2d682c=parseInt(_0xcd2e6c(0x99))/0x1*(-parseInt(_0xcd2e6c(0xb8))/0x2)+parseInt(_0xcd2e6c(0xc7))/0x3*(-parseInt(_0xcd2e6c(0x9c))/0x4)+parseInt(_0xcd2e6c(0xab))/0x5*(parseInt(_0xcd2e6c(0xa1))/0x6)+-parseInt(_0xcd2e6c(0x97))/0x7+-parseInt(_0xcd2e6c(0x9b))/0x8*(parseInt(_0xcd2e6c(0xc8))/0x9)+parseInt(_0xcd2e6c(0xc1))/0xa*(-parseInt(_0xcd2e6c(0xa9))/0xb)+parseInt(_0xcd2e6c(0xbc))/0xc;if(_0x2d682c===_0x4670d2)break;else _0x165f0e['push'](_0x165f0e['shift']());}catch(_0x543f99){_0x165f0e['push'](_0x165f0e['shift']());}}}(a68_0x1196,0x4707b));import{centerAlign,stringWidth,padEnd,padStart}from'./string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'./colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x8cc6fe=a68_0x3388;return process[_0x8cc6fe(0xa7)][_0x8cc6fe(0xb0)]||Infinity;}export function formatAsTable(_0x187028,_0x4dae69=DEFAULT_MAX_DISPLAY_ROWS,_0x4b08b9=![],_0x131f45={}){const _0x536fa6=a68_0x3388;if(_0x187028['data']['length']===0x0)return _0x536fa6(0x9d);const _0xa5d3f3=_0x187028[_0x536fa6(0xb0)][_0x536fa6(0xc6)](_0x3862d6=>_0x3862d6['name']),_0x20c414=_0x187028[_0x536fa6(0xb0)][_0x536fa6(0xc6)](_0x319182=>simplifyType(_0x319182[_0x536fa6(0xbd)])),_0x598e63=_0x187028[_0x536fa6(0xb2)][_0x536fa6(0x95)](0x0,_0x4dae69),_0x1db0a5=_0x187028['data'][_0x536fa6(0xa3)],_0x3b49e6=_0x1db0a5>_0x4dae69,_0x2cf7fb=[],_0x542ead=getTerminalWidth(),_0x2c2ac2=_0x542ead!==Infinity,_0xbad00e=0x32;let _0x1d5e19=_0xa5d3f3['map']((_0x570c30,_0x989bf1)=>{const _0x44bf90=_0x536fa6,_0x474809=stringWidth(_0x20c414[_0x989bf1]),_0x480aec=Math[_0x44bf90(0xa4)](..._0x598e63['map'](_0x3531b7=>{const _0x54d6c8=_0x3531b7[_0x570c30];return stringWidth(formatValue(_0x54d6c8));})),_0x5c5a1a=Math[_0x44bf90(0xa4)](stringWidth(_0x570c30),_0x474809,_0x480aec);return _0x4b08b9?_0x5c5a1a:Math[_0x44bf90(0xb4)](_0x5c5a1a,_0xbad00e);});if(_0x2c2ac2&&!_0x4b08b9&&_0xa5d3f3['length']>0x0){const _0x28891c=_0x4aed1d=>{let _0x380e29=0x1;for(const _0x35ce7f of _0x4aed1d){_0x380e29+=_0x35ce7f+0x3;}return _0x380e29+0x1;};let _0xddb60e=_0x28891c(_0x1d5e19);if(_0xddb60e>_0x542ead){const _0x3a1cb9=0x3;for(let _0xe668b3=_0x1d5e19['length']-0x1;_0xe668b3>=0x0;_0xe668b3--){_0xddb60e=_0x28891c(_0x1d5e19);if(_0xddb60e<=_0x542ead)break;const _0x37c60e=_0x1d5e19[_0xe668b3],_0x320f1f=_0xddb60e-_0x542ead,_0x38d915=_0x37c60e-_0x3a1cb9,_0xe8026=Math[_0x536fa6(0xb4)](_0x320f1f,_0x38d915);_0xe8026>0x0&&(_0x1d5e19[_0xe668b3]=_0x37c60e-_0xe8026);}}}const _0xfd5c16=_0xa5d3f3,_0x324e7e=_0x20c414,_0xc54c5e=_0x1d5e19,_0x5a68ec=_0x1d5e19;_0x2cf7fb['push'](colorBorder('┌'+_0x5a68ec['map'](_0x1794b6=>'─'[_0x536fa6(0xba)](_0x1794b6+0x2))[_0x536fa6(0xb5)]('┬')+'┐',_0x131f45));const _0x3e3569=_0xfd5c16['map']((_0x3fbc88,_0x32348d)=>centerAlign(_0x3fbc88,_0xc54c5e[_0x32348d]));_0x2cf7fb[_0x536fa6(0xa0)](colorBorder('│',_0x131f45)+'\x20'+_0x3e3569[_0x536fa6(0xb5)]('\x20'+colorBorder('│',_0x131f45)+'\x20')+'\x20'+colorBorder('│',_0x131f45));const _0x2582c5=_0x324e7e[_0x536fa6(0xc6)]((_0x489a65,_0x367c12)=>colorType(centerAlign(_0x489a65,_0xc54c5e[_0x367c12]),_0x131f45));_0x2cf7fb[_0x536fa6(0xa0)](colorBorder('│',_0x131f45)+'\x20'+_0x2582c5['join']('\x20'+colorBorder('│',_0x131f45)+'\x20')+'\x20'+colorBorder('│',_0x131f45)),_0x2cf7fb['push'](colorBorder('├'+_0x5a68ec[_0x536fa6(0xc6)](_0x2bc66d=>'─'['repeat'](_0x2bc66d+0x2))[_0x536fa6(0xb5)]('┼')+'┤',_0x131f45));const _0x1de09b=(_0x4b7947,_0x2d9abb)=>{const _0x2cd203=_0x536fa6,_0x42df9a=stringWidth(_0x4b7947);if(_0x42df9a<=_0x2d9abb)return _0x4b7947;let _0x2a8bfb=_0x4b7947;while(stringWidth(_0x2a8bfb+'…')>_0x2d9abb&&_0x2a8bfb[_0x2cd203(0xa3)]>0x0){_0x2a8bfb=_0x2a8bfb[_0x2cd203(0x95)](0x0,-0x1);}return _0x2a8bfb+'…';};_0x598e63['forEach'](_0x13bd65=>{const _0x50e21d=_0x536fa6,_0x20f996=_0xa5d3f3['map']((_0x5d5144,_0x247417)=>{const _0x31a4be=a68_0x3388,_0x20872f=_0x13bd65[_0x5d5144],_0x1f292d=formatValue(_0x20872f),_0x31dc3b=_0xc54c5e[_0x247417],_0x33feec=_0x1de09b(_0x1f292d,_0x31dc3b),_0x440643=typeof _0x20872f===_0x31a4be(0xad)||typeof _0x20872f===_0x31a4be(0x96)&&/^-?\d+$/['test'](_0x20872f);return _0x440643?padStart(_0x33feec,_0x31dc3b):padEnd(_0x33feec,_0x31dc3b);});_0x2cf7fb[_0x50e21d(0xa0)](colorBorder('│',_0x131f45)+'\x20'+_0x20f996[_0x50e21d(0xb5)]('\x20'+colorBorder('│',_0x131f45)+'\x20')+'\x20'+colorBorder('│',_0x131f45));});const _0x4c25be=_0x5a68ec[_0x536fa6(0xbf)]((_0x5cd6ee,_0x36d75c)=>_0x5cd6ee+_0x36d75c+0x3,-0x1);_0x2cf7fb[_0x536fa6(0xa0)](colorBorder('├'+_0x5a68ec[_0x536fa6(0xc6)](_0x58c147=>'─'[_0x536fa6(0xba)](_0x58c147+0x2))[_0x536fa6(0xb5)]('┴')+'┤',_0x131f45));let _0xaf9b6f;_0x3b49e6?_0xaf9b6f=_0x1db0a5+_0x536fa6(0x9a)+_0x4dae69+_0x536fa6(0xac):_0xaf9b6f=_0x1db0a5+_0x536fa6(0xbb)+(_0x1db0a5===0x1?'':'s');const _0x3ea393=_0xaf9b6f[_0x536fa6(0x93)](_0x4c25be-0x2);return _0x2cf7fb['push'](colorBorder('│',_0x131f45)+'\x20'+_0x3ea393+'\x20'+colorBorder('│',_0x131f45)),_0x2cf7fb[_0x536fa6(0xa0)](colorBorder('└'+'─'['repeat'](_0x4c25be)+'┘',_0x131f45)),_0x2cf7fb[_0x536fa6(0xb5)]('\x0a');}function a68_0x3388(_0x4f103a,_0x3e288e){const _0x119639=a68_0x1196();return a68_0x3388=function(_0x338819,_0x50f37c){_0x338819=_0x338819-0x93;let _0x3cea3a=_0x119639[_0x338819];return _0x3cea3a;},a68_0x3388(_0x4f103a,_0x3e288e);}function simplifyType(_0x53d121){const _0x350024=a68_0x3388,_0x5df579={'varchar':_0x350024(0x96),'bigint':_0x350024(0xaa),'integer':_0x350024(0xc5),'double':_0x350024(0x94),'boolean':_0x350024(0xc2),'date':'date','timestamp':_0x350024(0xc3),'array':'array','map':_0x350024(0xc6),'row':'row'},_0x4ee2fd=_0x53d121[_0x350024(0xb9)]();for(const [_0x57a909,_0x238af1]of Object[_0x350024(0xbe)](_0x5df579)){if(_0x4ee2fd['startsWith'](_0x57a909))return _0x238af1;}return _0x53d121['length']>0xa?_0x53d121[_0x350024(0xca)](0x0,0xa):_0x53d121;}export function formatAsJSON(_0x512350,_0x28e06b={}){const _0x2cad5b=a68_0x3388;if(_0x512350[_0x2cad5b(0xb2)][_0x2cad5b(0xa3)]===0x0)return'[]';if(shouldUseColor(_0x28e06b))return colorizeJSON(_0x512350[_0x2cad5b(0xb2)],_0x28e06b);const _0x1ffd40=_0x512350[_0x2cad5b(0xb2)]['map'](_0x446c27=>'\x20\x20'+JSON[_0x2cad5b(0xc0)](_0x446c27));return'[\x0a'+_0x1ffd40['join'](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x1ec5f0,_0x32a4e4={}){const _0x50ac50=a68_0x3388;if(_0x1ec5f0[_0x50ac50(0xb2)][_0x50ac50(0xa3)]===0x0)return'';if(shouldUseColor(_0x32a4e4))return _0x1ec5f0[_0x50ac50(0xb2)][_0x50ac50(0xc6)](_0x400c96=>colorizeJSONCompact(_0x400c96,_0x32a4e4))[_0x50ac50(0xb5)]('\x0a');return _0x1ec5f0['data']['map'](_0x3bcf47=>JSON[_0x50ac50(0xc0)](_0x3bcf47))[_0x50ac50(0xb5)]('\x0a');}export function formatAsTSV(_0x1b6337){const _0x23dac7=a68_0x3388;if(_0x1b6337[_0x23dac7(0xb2)][_0x23dac7(0xa3)]===0x0)return'';const _0x206d01=[],_0x199819=_0x1b6337[_0x23dac7(0xb0)]['map'](_0x36a70b=>_0x36a70b[_0x23dac7(0xc4)]);return _0x206d01[_0x23dac7(0xa0)](_0x199819[_0x23dac7(0xb5)]('\x09')),_0x1b6337[_0x23dac7(0xb2)]['forEach'](_0x52b89d=>{const _0x5b919c=_0x23dac7,_0x38b613=_0x199819['map'](_0x260ead=>{const _0x4ae3e8=_0x52b89d[_0x260ead];return formatValueForTSV(_0x4ae3e8);});_0x206d01['push'](_0x38b613[_0x5b919c(0xb5)]('\x09'));}),_0x206d01[_0x23dac7(0xb5)]('\x0a');}function formatValue(_0x20c1f9){const _0x1f1acb=a68_0x3388;if(_0x20c1f9===null||_0x20c1f9===undefined)return'';if(typeof _0x20c1f9==='string'){const _0x13975d=_0x20c1f9[_0x1f1acb(0xb3)](/\n/g,'\x5cn')['replace'](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x13975d;}if(typeof _0x20c1f9===_0x1f1acb(0xad))return String(_0x20c1f9);if(typeof _0x20c1f9===_0x1f1acb(0x98))return _0x20c1f9?_0x1f1acb(0xb7):_0x1f1acb(0xa8);if(_0x20c1f9 instanceof Date)return _0x20c1f9[_0x1f1acb(0xa6)]();if(typeof _0x20c1f9==='object')return JSON['stringify'](_0x20c1f9);return String(_0x20c1f9);}function formatValueForTSV(_0x243680){const _0x3c799b=a68_0x3388;if(_0x243680===null||_0x243680===undefined)return'';if(typeof _0x243680===_0x3c799b(0x96))return _0x243680['replace'](/\t/g,'\x5ct')[_0x3c799b(0xb3)](/\n/g,'\x5cn');if(typeof _0x243680==='number'||typeof _0x243680===_0x3c799b(0x98))return String(_0x243680);if(_0x243680 instanceof Date)return _0x243680[_0x3c799b(0xa6)]();if(typeof _0x243680===_0x3c799b(0xae))return JSON['stringify'](_0x243680);return String(_0x243680);}function a68_0x1196(){const _0x344c6e=['string','862211YkFPHM','boolean','17GjPuqB','\x20rows\x20(','328ntkIKW','10052QcWeua','No\x20rows\x20returned','toFixed','0\x20B','push','1659816kFmlwQ','toString','length','max','log','toISOString','stdout','false','2531903URLWBy','long','5ORfQLv','\x20shown)','number','object','floor','columns','table','data','replace','min','join','pow','true','39982sphGyw','toLowerCase','repeat','\x20row','14280696bMytee','type','entries','reduce','stringify','10CDifLs','bool','timestamp','name','int','map','39FxNESY','98757IvhlcG','jsonl','substring','json','padEnd','double','slice'];a68_0x1196=function(){return _0x344c6e;};return a68_0x1196();}export function formatQueryResult(_0x244069,_0xda2709){const _0x43bae8=a68_0x3388;switch(_0xda2709){case _0x43bae8(0xb1):return formatAsTable(_0x244069);case _0x43bae8(0xcb):return formatAsJSON(_0x244069);case _0x43bae8(0xc9):return formatAsJSONL(_0x244069);case'tsv':return formatAsTSV(_0x244069);default:return formatAsJSON(_0x244069);}}export function formatBytes(_0x571885){const _0x44336a=a68_0x3388;if(_0x571885===0x0)return _0x44336a(0x9f);const _0xb0bc41=['B','KB','MB','GB','TB'],_0x564ec0=0x400,_0x4292bd=Math['floor'](Math[_0x44336a(0xa5)](_0x571885)/Math[_0x44336a(0xa5)](_0x564ec0)),_0x6a7791=_0x571885/Math[_0x44336a(0xb6)](_0x564ec0,_0x4292bd),_0x2acffd=_0x6a7791>=0xa?0x1:0x2;return _0x6a7791[_0x44336a(0x9e)](_0x2acffd)+'\x20'+_0xb0bc41[_0x4292bd];}export function formatRows(_0x556472){const _0x52af65=a68_0x3388;if(_0x556472==null)return'-';if(_0x556472===0x0)return'0';if(_0x556472<0x3e8)return _0x556472[_0x52af65(0xa2)]();const _0x7013b3=['','K','M','B','T'],_0x505061=0x3e8,_0x479837=Math[_0x52af65(0xaf)](Math[_0x52af65(0xa5)](_0x556472)/Math[_0x52af65(0xa5)](_0x505061)),_0x4b326e=_0x556472/Math[_0x52af65(0xb6)](_0x505061,_0x479837),_0xff3b49=_0x4b326e>=0xa?0x1:0x2;return''+_0x4b326e[_0x52af65(0x9e)](_0xff3b49)+_0x7013b3[_0x479837];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a69_0x4578(_0x18c21f,_0x5d8cad){const _0x30e6cd=a69_0x30e6();return a69_0x4578=function(_0x4578ee,_0x5bf6b2){_0x4578ee=_0x4578ee-0x11a;let _0x25e54d=_0x30e6cd[_0x4578ee];return _0x25e54d;},a69_0x4578(_0x18c21f,_0x5d8cad);}(function(_0x2ebdaf,_0x5c6673){const _0x1b9c65=a69_0x4578,_0x2f9770=_0x2ebdaf();while(!![]){try{const _0x4ab1c0=-parseInt(_0x1b9c65(0x124))/0x1+-parseInt(_0x1b9c65(0x125))/0x2+-parseInt(_0x1b9c65(0x11f))/0x3+parseInt(_0x1b9c65(0x120))/0x4+parseInt(_0x1b9c65(0x12a))/0x5*(-parseInt(_0x1b9c65(0x11b))/0x6)+-parseInt(_0x1b9c65(0x121))/0x7+parseInt(_0x1b9c65(0x123))/0x8;if(_0x4ab1c0===_0x5c6673)break;else _0x2f9770['push'](_0x2f9770['shift']());}catch(_0x459182){_0x2f9770['push'](_0x2f9770['shift']());}}}(a69_0x30e6,0x92d62));import{readFile}from'fs/promises';function a69_0x30e6(){const _0x4d7f67=['EACCES','parse','752409IleEyY','1815208ugXAWD','2995524kXTnFr','ENOENT','22853856nboEJP','286499AQyAzr','1165494VACmOm','Failed\x20to\x20load\x20JSON:\x20','\x27:\x20','Permission\x20denied\x20reading\x20file:\x20','NOT_FOUND','1935185AJOHQL','Invalid\x20JSON\x20in\x20file\x20\x27','INVALID_ARGUMENT','File\x20not\x20found:\x20','INTERNAL','code','message','18GtrVin','PERMISSION_DENIED'];a69_0x30e6=function(){return _0x4d7f67;};return a69_0x30e6();}import{SDKError,ErrorCode}from'../sdk/errors.js';export async function loadJSON(_0x46187f,_0x364b47){const _0x128ca9=a69_0x4578;try{if(_0x364b47){const _0x1c9d1b=await readFile(_0x46187f,'utf-8');try{return JSON[_0x128ca9(0x11e)](_0x1c9d1b);}catch(_0x132ea9){throw new SDKError(ErrorCode[_0x128ca9(0x12c)],_0x128ca9(0x12b)+_0x46187f+_0x128ca9(0x127)+(_0x132ea9 instanceof Error?_0x132ea9[_0x128ca9(0x11a)]:String(_0x132ea9)));}}else try{return JSON[_0x128ca9(0x11e)](_0x46187f);}catch(_0x3f9524){throw new SDKError(ErrorCode[_0x128ca9(0x12c)],'Invalid\x20JSON\x20string:\x20'+(_0x3f9524 instanceof Error?_0x3f9524[_0x128ca9(0x11a)]:String(_0x3f9524)));}}catch(_0x1e6b21){if(_0x1e6b21 instanceof SDKError)throw _0x1e6b21;if(_0x1e6b21 instanceof Error&&'code'in _0x1e6b21){const _0x303dc1=_0x1e6b21;if(_0x303dc1[_0x128ca9(0x12f)]===_0x128ca9(0x122))throw new SDKError(ErrorCode[_0x128ca9(0x129)],_0x128ca9(0x12d)+_0x46187f);else{if(_0x303dc1[_0x128ca9(0x12f)]===_0x128ca9(0x11d))throw new SDKError(ErrorCode[_0x128ca9(0x11c)],_0x128ca9(0x128)+_0x46187f);}}throw new SDKError(ErrorCode[_0x128ca9(0x12e)],_0x128ca9(0x126)+(_0x1e6b21 instanceof Error?_0x1e6b21['message']:String(_0x1e6b21)));}}export async function loadJSONFromOptions(_0x4ade0a,_0x202e67){if(_0x4ade0a&&_0x202e67)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20specify\x20both\x20inline\x20JSON\x20and\x20file\x20path.\x20Use\x20one\x20or\x20the\x20other.');if(_0x4ade0a)return await loadJSON(_0x4ade0a,![]);if(_0x202e67)return await loadJSON(_0x202e67,!![]);return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a70_0x3dfa8f=a70_0x3734;(function(_0xc553f2,_0x514547){const _0x46d986=a70_0x3734,_0xb1ed61=_0xc553f2();while(!![]){try{const _0x4e2eab=-parseInt(_0x46d986(0x16b))/0x1+parseInt(_0x46d986(0x16f))/0x2*(parseInt(_0x46d986(0x168))/0x3)+parseInt(_0x46d986(0x163))/0x4*(-parseInt(_0x46d986(0x169))/0x5)+-parseInt(_0x46d986(0x164))/0x6*(-parseInt(_0x46d986(0x16c))/0x7)+parseInt(_0x46d986(0x166))/0x8+-parseInt(_0x46d986(0x167))/0x9+-parseInt(_0x46d986(0x16e))/0xa;if(_0x4e2eab===_0x514547)break;else _0xb1ed61['push'](_0xb1ed61['shift']());}catch(_0x57caf1){_0xb1ed61['push'](_0xb1ed61['shift']());}}}(a70_0x1cbc,0xb6b04));function a70_0x3734(_0x3618d9,_0x4e3cf4){const _0x1cbca8=a70_0x1cbc();return a70_0x3734=function(_0x3734e8,_0x540457){_0x3734e8=_0x3734e8-0x163;let _0x592484=_0x1cbca8[_0x3734e8];return _0x592484;},a70_0x3734(_0x3618d9,_0x4e3cf4);}const MODEL_ALIASES={'haiku':a70_0x3dfa8f(0x16a),'sonnet':'claude-4.5-sonnet'};export function extractModelAlias(_0x5c04d9){const _0x396977=a70_0x3dfa8f,_0x2e4412=_0x5c04d9[_0x396977(0x165)](/^claude-(?:\d+-)?(?:\d+-?)?(sonnet|haiku|opus)/i);if(_0x2e4412)return _0x2e4412[0x1][_0x396977(0x16d)]();return _0x5c04d9;}export function resolveModelAlias(_0x1efffd){const _0x3887a9=a70_0x3dfa8f;return MODEL_ALIASES[_0x1efffd[_0x3887a9(0x16d)]()]||_0x1efffd;}export function getModelAliases(){return{...MODEL_ALIASES};}function a70_0x1cbc(){const _0x37e08b=['172529kMWjHM','toLowerCase','1406690FCvgJC','2YfVMSu','16ULtLDO','270dKbQga','match','4417680LbqShc','1811115bFByhs','4174197HXHIWv','712085sukTXu','claude-4.5-haiku','1392860gjifYM'];a70_0x1cbc=function(){return _0x37e08b;};return a70_0x1cbc();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a71_0x5f53(){const _0x41773a=['isInteger','52659QaztQR','187245VLbawA','427255ZAZCJX','40sGXKhk','61004TRoRIt','.\x20Must\x20be\x20an\x20integer.','6NDSUCh','1458653umWeDx','51TUoviR','Invalid\x20limit\x20value:\x20','1207504vzCUzn','Invalid\x20timeout\x20value:\x20','692050hOcltV'];a71_0x5f53=function(){return _0x41773a;};return a71_0x5f53();}(function(_0x1d8959,_0x5c1c59){const _0x582564=a71_0x4f66,_0x3be68e=_0x1d8959();while(!![]){try{const _0x33271c=-parseInt(_0x582564(0x19b))/0x1+parseInt(_0x582564(0x198))/0x2+parseInt(_0x582564(0x1a2))/0x3*(parseInt(_0x582564(0x19e))/0x4)+-parseInt(_0x582564(0x19c))/0x5+-parseInt(_0x582564(0x1a0))/0x6*(parseInt(_0x582564(0x1a1))/0x7)+parseInt(_0x582564(0x196))/0x8+parseInt(_0x582564(0x19a))/0x9*(-parseInt(_0x582564(0x19d))/0xa);if(_0x33271c===_0x5c1c59)break;else _0x3be68e['push'](_0x3be68e['shift']());}catch(_0x424e7c){_0x3be68e['push'](_0x3be68e['shift']());}}}(a71_0x5f53,0x3d767));export function validateLimitOption(_0x3ab015){const _0x154fca=a71_0x4f66;if(!Number[_0x154fca(0x199)](_0x3ab015))return{'isValid':![],'error':_0x154fca(0x1a3)+_0x3ab015+_0x154fca(0x19f)};if(_0x3ab015<=0x0)return{'isValid':![],'error':_0x154fca(0x1a3)+_0x3ab015+'.\x20Must\x20be\x20a\x20positive\x20integer.'};return{'isValid':!![],'value':_0x3ab015};}function a71_0x4f66(_0x844a53,_0x586dcf){const _0x5f53b2=a71_0x5f53();return a71_0x4f66=function(_0x4f6644,_0x25b0ae){_0x4f6644=_0x4f6644-0x196;let _0x164f97=_0x5f53b2[_0x4f6644];return _0x164f97;},a71_0x4f66(_0x844a53,_0x586dcf);}export function validateTimeoutOption(_0x5a3580,_0x2a868a=0x1e){const _0x1ff64c=a71_0x4f66;if(_0x5a3580===undefined)return{'isValid':!![],'value':_0x2a868a};const _0x1fe6bc=typeof _0x5a3580==='number'?_0x5a3580:parseFloat(_0x5a3580);if(isNaN(_0x1fe6bc))return{'isValid':![],'error':_0x1ff64c(0x197)+_0x5a3580+'.\x20Must\x20be\x20a\x20number.'};if(_0x1fe6bc<=0x0)return{'isValid':![],'error':_0x1ff64c(0x197)+_0x1fe6bc+'.\x20Must\x20be\x20a\x20positive\x20number.'};return{'isValid':!![],'value':_0x1fe6bc};}
|
package/dist/utils/port.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a72_0x4dce(){const _0x250257=['error','code','0.0.0.0','1725858jpQbRN','101956QmwAJc','323576OSIMdu','8249690DVhVkE','EADDRINUSE','listening','close','8lIMTcV','\x20and\x20','once','3NMVkEZ','415sVxfbb','911112FjMPmF','45126yTKaHG','1905904EzKyqr'];a72_0x4dce=function(){return _0x250257;};return a72_0x4dce();}(function(_0x26d119,_0x5b160a){const _0x22ba99=a72_0x56bd,_0x3ccb60=_0x26d119();while(!![]){try{const _0x108ca5=parseInt(_0x22ba99(0x150))/0x1+parseInt(_0x22ba99(0x14f))/0x2+-parseInt(_0x22ba99(0x146))/0x3*(-parseInt(_0x22ba99(0x148))/0x4)+parseInt(_0x22ba99(0x147))/0x5*(parseInt(_0x22ba99(0x149))/0x6)+-parseInt(_0x22ba99(0x14a))/0x7+-parseInt(_0x22ba99(0x155))/0x8*(-parseInt(_0x22ba99(0x14e))/0x9)+-parseInt(_0x22ba99(0x151))/0xa;if(_0x108ca5===_0x5b160a)break;else _0x3ccb60['push'](_0x3ccb60['shift']());}catch(_0x9f901b){_0x3ccb60['push'](_0x3ccb60['shift']());}}}(a72_0x4dce,0x4e648));import{createServer}from'node:net';function a72_0x56bd(_0x34dd17,_0x4286a6){const _0x4dceac=a72_0x4dce();return a72_0x56bd=function(_0x56bd3f,_0x5c17cc){_0x56bd3f=_0x56bd3f-0x144;let _0x3da9f2=_0x4dceac[_0x56bd3f];return _0x3da9f2;},a72_0x56bd(_0x34dd17,_0x4286a6);}export async function isPortAvailable(_0x23cb48){return new Promise(_0x67a680=>{const _0x527ac8=a72_0x56bd,_0x5f1840=createServer();_0x5f1840['once'](_0x527ac8(0x14b),_0x71a313=>{const _0x1366cd=_0x527ac8;_0x71a313[_0x1366cd(0x14c)]===_0x1366cd(0x152)?_0x67a680(![]):_0x67a680(![]);}),_0x5f1840[_0x527ac8(0x145)](_0x527ac8(0x153),()=>{const _0x329e45=_0x527ac8;_0x5f1840[_0x329e45(0x154)](),_0x67a680(!![]);}),_0x5f1840['listen'](_0x23cb48,_0x527ac8(0x14d));});}export async function findAvailablePort(_0x51cd33=0xfa0,_0x323be8=0x64){const _0x3a7f77=a72_0x56bd;for(let _0x29ff67=0x0;_0x29ff67<_0x323be8;_0x29ff67++){const _0x48bda7=_0x51cd33+_0x29ff67;if(await isPortAvailable(_0x48bda7))return _0x48bda7;}throw new Error('No\x20available\x20port\x20found\x20between\x20'+_0x51cd33+_0x3a7f77(0x144)+(_0x51cd33+_0x323be8-0x1));}
|
package/dist/utils/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a73_0x4674(){const _0xe9c541=['ppid','1470348nrCAlR','No\x20shell\x20found\x20in\x20process\x20tree,\x20falling\x20back\x20to\x20process.ppid','elvish','dash','code',')\x20spawned\x20by\x20','bash','3088310lIrPlq','Failed\x20to\x20get\x20process\x20info\x20for\x20PID\x20','4WWJTUm','5598vSXqpU','comm','trim','join','ion','zsh','17154ILkvcQ','filter','cursor',',\x20continuing\x20up','replace','fish','win32','platform','96916QJixww','1024830jqqHjU','749mcQzaL','DEBUG','toLowerCase','kill','split','length','pid','488EwuVvE','has','6534690Bpokif','\x20-o\x20ppid=,comm=','ps\x20-p\x20','powershell','ksh','env','wmic\x20process\x20where\x20ProcessId=','Found\x20ephemeral\x20shell\x20','utf-8','\x20on\x20POSIX:','error'];a73_0x4674=function(){return _0xe9c541;};return a73_0x4674();}const a73_0x14c544=a73_0x157f;(function(_0x5eafa4,_0x21cea8){const _0x455a4f=a73_0x157f,_0x2863f=_0x5eafa4();while(!![]){try{const _0x37cb37=-parseInt(_0x455a4f(0x10d))/0x1*(-parseInt(_0x455a4f(0x11c))/0x2)+parseInt(_0x455a4f(0x11d))/0x3+-parseInt(_0x455a4f(0x104))/0x4+parseInt(_0x455a4f(0x10b))/0x5+parseInt(_0x455a4f(0x114))/0x6*(parseInt(_0x455a4f(0x11e))/0x7)+-parseInt(_0x455a4f(0x125))/0x8*(parseInt(_0x455a4f(0x10e))/0x9)+-parseInt(_0x455a4f(0x127))/0xa;if(_0x37cb37===_0x21cea8)break;else _0x2863f['push'](_0x2863f['shift']());}catch(_0x48122b){_0x2863f['push'](_0x2863f['shift']());}}}(a73_0x4674,0x61a93));import{execSync}from'node:child_process';const SHELL_NAMES=new Set([a73_0x14c544(0x10a),a73_0x14c544(0x113),'sh',a73_0x14c544(0x119),a73_0x14c544(0x12b),'tcsh','csh',a73_0x14c544(0x107),'pwsh',a73_0x14c544(0x12a),'nu',a73_0x14c544(0x112),a73_0x14c544(0x106),'xonsh']),EPHEMERAL_SHELL_SPAWNERS=new Set(['claude',a73_0x14c544(0x108),a73_0x14c544(0x116)]);function getProcessInfoWindows(_0x4967ec){const _0x295da3=a73_0x14c544;try{const _0x2dbc8e=execSync(_0x295da3(0x12d)+_0x4967ec+'\x20get\x20ParentProcessId,Name\x20/format:csv',{'encoding':'utf-8','windowsHide':!![]})[_0x295da3(0x110)](),_0x29d1d4=_0x2dbc8e[_0x295da3(0x122)]('\x0a')[_0x295da3(0x115)](_0x45df2a=>_0x45df2a[_0x295da3(0x110)]());if(_0x29d1d4[_0x295da3(0x123)]<0x2)return null;const _0x20588f=_0x29d1d4[_0x29d1d4[_0x295da3(0x123)]-0x1][_0x295da3(0x122)](',');if(_0x20588f[_0x295da3(0x123)]<0x3)return null;const _0x8d080c=_0x20588f[0x1]?.[_0x295da3(0x110)]()||'',_0x5b1f06=parseInt(_0x20588f[0x2]?.[_0x295da3(0x110)]()||'0',0xa);if(isNaN(_0x5b1f06)||!_0x8d080c)return null;return{'pid':_0x4967ec,'ppid':_0x5b1f06,'comm':_0x8d080c[_0x295da3(0x118)](/\.exe$/i,'')};}catch(_0x369dca){return process['env']['DEBUG']&&console['error'](_0x295da3(0x10c)+_0x4967ec+'\x20on\x20Windows:',_0x369dca),null;}}function getProcessInfoPosix(_0x69067e){const _0xea320c=a73_0x14c544;try{const _0x2dc498=execSync(_0xea320c(0x129)+_0x69067e+_0xea320c(0x128),{'encoding':_0xea320c(0x12f)})[_0xea320c(0x110)](),[_0x1c15db,..._0x31ab4d]=_0x2dc498[_0xea320c(0x122)](/\s+/),_0x142d1a=parseInt(_0x1c15db,0xa),_0x41ad88=_0x31ab4d[_0xea320c(0x111)]('\x20');if(isNaN(_0x142d1a))return null;return{'pid':_0x69067e,'ppid':_0x142d1a,'comm':_0x41ad88};}catch(_0x578e02){return process[_0xea320c(0x12c)][_0xea320c(0x11f)]&&console['error'](_0xea320c(0x10c)+_0x69067e+_0xea320c(0x130),_0x578e02),null;}}function getProcessInfo(_0x2665dd){const _0x10d081=a73_0x14c544;if(process[_0x10d081(0x11b)]===_0x10d081(0x11a))return getProcessInfoWindows(_0x2665dd);return getProcessInfoPosix(_0x2665dd);}function a73_0x157f(_0x270b38,_0x3d77ac){const _0x4674d2=a73_0x4674();return a73_0x157f=function(_0x157ffd,_0x541173){_0x157ffd=_0x157ffd-0x103;let _0x44d6d9=_0x4674d2[_0x157ffd];return _0x44d6d9;},a73_0x157f(_0x270b38,_0x3d77ac);}function getBasename(_0x59f965){const _0x5c2b7e=a73_0x14c544;return _0x59f965['replace'](/^-/,'')['split']('/')['pop']()?.[_0x5c2b7e(0x120)]()||'';}function isShell(_0x3b1717){const _0x1888c3=a73_0x14c544;return SHELL_NAMES[_0x1888c3(0x126)](getBasename(_0x3b1717));}function isEphemeralShellSpawner(_0x19c026){const _0x41c13d=a73_0x14c544;return EPHEMERAL_SHELL_SPAWNERS[_0x41c13d(0x126)](getBasename(_0x19c026));}let cachedShellPID;function findShellPID(){const _0x1dce25=a73_0x14c544;let _0x3df62f=process['ppid'];const _0xa654d0=0xa;let _0x2b0b8b=0x0;while(_0x2b0b8b<_0xa654d0){const _0x5b2003=getProcessInfo(_0x3df62f);if(!_0x5b2003){process[_0x1dce25(0x12c)][_0x1dce25(0x11f)]&&console[_0x1dce25(0x131)]('Could\x20not\x20get\x20process\x20info\x20for\x20PID\x20'+_0x3df62f+',\x20using\x20fallback');break;}if(isShell(_0x5b2003['comm'])){const _0x41367f=getProcessInfo(_0x5b2003[_0x1dce25(0x103)]);if(_0x41367f&&isEphemeralShellSpawner(_0x41367f[_0x1dce25(0x10f)])){process[_0x1dce25(0x12c)][_0x1dce25(0x11f)]&&console[_0x1dce25(0x131)](_0x1dce25(0x12e)+_0x5b2003[_0x1dce25(0x124)]+'\x20('+_0x5b2003[_0x1dce25(0x10f)]+_0x1dce25(0x109)+_0x41367f[_0x1dce25(0x10f)]+_0x1dce25(0x117));_0x3df62f=_0x5b2003[_0x1dce25(0x103)],_0x2b0b8b++;continue;}return _0x5b2003[_0x1dce25(0x124)];}if(_0x5b2003[_0x1dce25(0x103)]===0x0||_0x5b2003['ppid']===0x1){if(isShell(_0x5b2003[_0x1dce25(0x10f)]))return _0x5b2003[_0x1dce25(0x124)];break;}_0x3df62f=_0x5b2003[_0x1dce25(0x103)],_0x2b0b8b++;}return process[_0x1dce25(0x12c)][_0x1dce25(0x11f)]&&console[_0x1dce25(0x131)](_0x1dce25(0x105)),process[_0x1dce25(0x103)];}export function getPPID(){return cachedShellPID===undefined&&(cachedShellPID=findShellPID()),cachedShellPID;}export function clearPPIDCache(){cachedShellPID=undefined;}export function isProcessRunning(_0x34a89e){const _0x2dd224=a73_0x14c544;try{return process[_0x2dd224(0x121)](_0x34a89e,0x0),!![];}catch{return![];}}
|
package/dist/utils/prompt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15600e,_0x59c0a3){const _0x26a3e1=a74_0x1374,_0x33b06e=_0x15600e();while(!![]){try{const _0x4e67c8=parseInt(_0x26a3e1(0x87))/0x1+parseInt(_0x26a3e1(0x7e))/0x2*(parseInt(_0x26a3e1(0x7f))/0x3)+parseInt(_0x26a3e1(0x8e))/0x4+parseInt(_0x26a3e1(0x80))/0x5+parseInt(_0x26a3e1(0x8c))/0x6+parseInt(_0x26a3e1(0x8b))/0x7*(-parseInt(_0x26a3e1(0x81))/0x8)+-parseInt(_0x26a3e1(0x86))/0x9*(parseInt(_0x26a3e1(0x83))/0xa);if(_0x4e67c8===_0x59c0a3)break;else _0x33b06e['push'](_0x33b06e['shift']());}catch(_0x45ba9a){_0x33b06e['push'](_0x33b06e['shift']());}}}(a74_0x24ec,0x28e12));import*as a74_0x332227 from'readline';function a74_0x24ec(){const _0x4e7bd9=['920dbypEe','close','stdout','27369MqPtqj','265997CwhHcw','\x20(y/N):\x20','toLowerCase','stdin','217mVAwBA','134118WyfQhc','question','444532KBmKUp','yes','134ZXEkSl','2253bKSkpm','343880dxgybS','18416QFookI','createInterface'];a74_0x24ec=function(){return _0x4e7bd9;};return a74_0x24ec();}function a74_0x1374(_0x329363,_0x1f32c8){const _0x24ec5=a74_0x24ec();return a74_0x1374=function(_0x1374d7,_0x2dcb2e){_0x1374d7=_0x1374d7-0x7e;let _0x2e72ff=_0x24ec5[_0x1374d7];return _0x2e72ff;},a74_0x1374(_0x329363,_0x1f32c8);}export async function confirm(_0x1a23a4){const _0x1b2401=a74_0x1374,_0x231b4e=a74_0x332227[_0x1b2401(0x82)]({'input':process[_0x1b2401(0x8a)],'output':process[_0x1b2401(0x85)]});return new Promise(_0x58dd99=>{const _0x3e9928=_0x1b2401;_0x231b4e[_0x3e9928(0x8d)](_0x1a23a4+_0x3e9928(0x88),_0x33aa32=>{const _0x243aa3=_0x3e9928;_0x231b4e[_0x243aa3(0x84)](),_0x58dd99(_0x33aa32[_0x243aa3(0x89)]()==='y'||_0x33aa32[_0x243aa3(0x89)]()===_0x243aa3(0x8f));});});}
|