@treasuredata/tdx 0.4.2 → 0.4.3
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.d.ts.map +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/llm-api-client.js.map +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/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.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/llm-backup-utils.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
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x4402ef=a22_0x820a;(function(_0x202e10,_0x8045da){const _0x1f34ab=a22_0x820a,_0xa1e82d=_0x202e10();while(!![]){try{const _0x240c2a=parseInt(_0x1f34ab(0x1fc))/0x1+parseInt(_0x1f34ab(0x1ec))/0x2*(parseInt(_0x1f34ab(0x1e7))/0x3)+-parseInt(_0x1f34ab(0x1eb))/0x4*(-parseInt(_0x1f34ab(0x1e8))/0x5)+parseInt(_0x1f34ab(0x1f8))/0x6*(-parseInt(_0x1f34ab(0x1f1))/0x7)+-parseInt(_0x1f34ab(0x200))/0x8+parseInt(_0x1f34ab(0x1d9))/0x9*(parseInt(_0x1f34ab(0x1e5))/0xa)+parseInt(_0x1f34ab(0x1d5))/0xb*(-parseInt(_0x1f34ab(0x1e3))/0xc);if(_0x240c2a===_0x8045da)break;else _0xa1e82d['push'](_0xa1e82d['shift']());}catch(_0x41ad05){_0xa1e82d['push'](_0xa1e82d['shift']());}}}(a22_0x9cf7,0x59f45));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';function a22_0x9cf7(){const _0x3cd456=['380QspIoN','totalSplits','3fYvObV','16505jexUpb','length','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','824IOhDhF','727952XUbgVi','state','message','jobId','Statement\x20','131257PuRxtH','execute','join','Site:\x20','Catalog:\x20','processedRows','Error:\x20','114AMaplu','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','stats','SQL:\x20','691058QhWLUE','verbose','\x20splits','validate','5415376wZXWUL','query','error','elapsedTimeMillis','output','Schema:\x20','setJobId','data','4873VJCVWF','push','Executing\x20statement\x20','args','25749roTeBr','...','catalog','setPhase','information_schema','completedSplits','Executing\x20query\x20[','in\x20','database','Executing\x20query...','11976MxRJGL','file'];a22_0x9cf7=function(){return _0x3cd456;};return a22_0x9cf7();}function a22_0x820a(_0x30d04a,_0x4a1f91){const _0x9cf735=a22_0x9cf7();return a22_0x820a=function(_0x820ac3,_0x4d58f6){_0x820ac3=_0x820ac3-0x1d4;let _0x30715a=_0x9cf735[_0x820ac3];return _0x30715a;},a22_0x820a(_0x30d04a,_0x4a1f91);}import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']=a22_0x4402ef(0x201);['description']='Run\x20Trino\x20queries\x20(streaming)';async[a22_0x4402ef(0x1f2)](_0x172ce2){const _0x1ff00d=a22_0x4402ef,{options:_0x1afa73,args:_0x760183,tdx:_0xa529b7}=_0x172ce2,_0x4a4971=_0x760183[0x0],_0x312672=_0x1afa73[_0x1ff00d(0x1e4)];let _0xb0280f;if(_0x312672)try{_0xb0280f=readSqlStatementsFromFile(_0x312672);}catch(_0x279bef){return console[_0x1ff00d(0x202)](_0x1ff00d(0x1f7)+_0x279bef['message']),0x1;}else try{_0xb0280f=splitSqlStatements(_0x4a4971);}catch(_0x284ca2){return console[_0x1ff00d(0x202)](_0x1ff00d(0x1f7)+_0x284ca2[_0x1ff00d(0x1ee)]),0x1;}const _0x3ce267=_0x1afa73[_0x1ff00d(0x1e1)]||_0x1ff00d(0x1dd),_0x266385=_0x1afa73[_0x1ff00d(0x1db)];try{const _0x15adbd=[],_0x419d42=!!_0x1afa73[_0x1ff00d(0x204)];for(let _0x234861=0x0;_0x234861<_0xb0280f['length'];_0x234861++){const _0x2e29b8=_0xb0280f[_0x234861],_0xf715e8=_0x234861+0x1,_0x570b52=_0xb0280f[_0x1ff00d(0x1e9)],_0x31b9f6=_0x570b52>0x1;_0x1afa73[_0x1ff00d(0x1fd)]&&(console[_0x1ff00d(0x202)]('\x0a'+(_0x31b9f6?_0x1ff00d(0x1f0)+_0xf715e8+'/'+_0x570b52+':':'')),console[_0x1ff00d(0x202)](_0x1ff00d(0x1f4)+_0x1afa73['site']),console['error'](_0x1ff00d(0x1f5)+(_0x266385||'td')),console[_0x1ff00d(0x202)](_0x1ff00d(0x205)+_0x3ce267),console[_0x1ff00d(0x202)](_0x1ff00d(0x1fb)+_0x2e29b8));const _0x27dd4b=_0x31b9f6?_0x1ff00d(0x1d7)+_0xf715e8+'/'+_0x570b52+_0x1ff00d(0x1da):_0x1ff00d(0x1e2);try{const _0x4a1c24=await withQuerySpinner(_0x27dd4b,async _0x548954=>{const _0x4b97b1=_0x1ff00d,_0x7b65cc=await _0xa529b7[_0x4b97b1(0x201)]['execute'](_0x2e29b8,{'catalog':_0x266385,'schema':_0x3ce267,'onJobId':_0x1b296a=>{const _0x28adb9=_0x4b97b1;_0x548954[_0x28adb9(0x206)](_0x1b296a);},'onProgress':_0x37da0f=>{const _0x1f0cbb=_0x4b97b1;_0x548954[_0x1f0cbb(0x1dc)](_0x1f0cbb(0x1df)+_0x37da0f[_0x1f0cbb(0x1ed)]+']'),_0x548954['setExtra'](formatRows(_0x37da0f[_0x1f0cbb(0x1f6)])+'\x20rows\x20'+_0x37da0f[_0x1f0cbb(0x1de)]+'/'+_0x37da0f[_0x1f0cbb(0x1e6)]+_0x1f0cbb(0x1fe));}});return _0x7b65cc;},{'verbose':_0x1afa73['verbose']}),_0x323e06=_0x4a1c24[_0x1ff00d(0x1d4)],_0x281c37=_0x323e06[_0x1ff00d(0x1ef)]?'\x20[Job\x20ID:\x20'+_0x323e06['jobId']+']':'',_0x4e1508=_0x31b9f6?_0x1ff00d(0x1f0)+_0xf715e8+'/'+_0x570b52+'\x20-\x20':'';console[_0x1ff00d(0x202)]('✔\x20'+_0x4e1508+'Query\x20completed:\x20Processed\x20'+formatRows(_0x323e06[_0x1ff00d(0x1fa)]['processedRows'])+'\x20rows\x20'+(_0x1ff00d(0x1e0)+formatElapsed(_0x323e06['stats'][_0x1ff00d(0x203)])+_0x281c37));if(_0x31b9f6&&_0x419d42){const _0x2c5364=resolveOutputOptions(_0x1afa73),_0x24111f=await formatQueryOutput(_0x323e06,_0x2c5364);_0x15adbd[_0x1ff00d(0x1d6)](_0x24111f);}else await handleQueryOutput(_0x323e06,_0x1afa73);}catch(_0x3f59e5){const _0x58b7e1=_0x31b9f6?_0x1ff00d(0x1f0)+_0xf715e8+'/'+_0x570b52+':\x0a':'',_0x37fbdf=_0x3f59e5 instanceof SDKError?_0x3f59e5['originalMessage']:_0x3f59e5[_0x1ff00d(0x1ee)];return console[_0x1ff00d(0x202)](''+_0x58b7e1+_0x37fbdf),0x1;}}if(_0xb0280f[_0x1ff00d(0x1e9)]>0x1&&_0x419d42&&_0x15adbd[_0x1ff00d(0x1e9)]>0x0){const _0x57fb49=_0x15adbd[_0x1ff00d(0x1f3)]('\x0a');writeFileSync(_0x1afa73[_0x1ff00d(0x204)],_0x57fb49),console[_0x1ff00d(0x202)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x1afa73[_0x1ff00d(0x204)]);}return 0x0;}catch(_0x4b8a4e){throw _0x4b8a4e;}}[a22_0x4402ef(0x1ff)](_0x512173){const _0x4f22bc=a22_0x4402ef,_0x39f216=_0x512173[_0x4f22bc(0x1d8)][0x0],_0x278bbe=_0x512173['options'][_0x4f22bc(0x1e4)];if(!_0x39f216&&!_0x278bbe)return _0x4f22bc(0x1ea);if(_0x39f216&&_0x278bbe)return _0x4f22bc(0x1f9);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a23_0x3df1(_0x4031b0,_0x235938){const _0x53aab6=a23_0x53aa();return a23_0x3df1=function(_0x3df164,_0x4d0871){_0x3df164=_0x3df164-0x1e9;let _0x3f1b3=_0x53aab6[_0x3df164];return _0x3f1b3;},a23_0x3df1(_0x4031b0,_0x235938);}const a23_0x1d6a95=a23_0x3df1;(function(_0x3f97c0,_0x41f311){const _0x45e8ea=a23_0x3df1,_0x54cdbc=_0x3f97c0();while(!![]){try{const _0x2db398=parseInt(_0x45e8ea(0x250))/0x1+parseInt(_0x45e8ea(0x232))/0x2+-parseInt(_0x45e8ea(0x265))/0x3*(-parseInt(_0x45e8ea(0x1f8))/0x4)+parseInt(_0x45e8ea(0x22a))/0x5*(parseInt(_0x45e8ea(0x21c))/0x6)+-parseInt(_0x45e8ea(0x24d))/0x7*(parseInt(_0x45e8ea(0x1fd))/0x8)+-parseInt(_0x45e8ea(0x20a))/0x9*(parseInt(_0x45e8ea(0x1fe))/0xa)+-parseInt(_0x45e8ea(0x256))/0xb;if(_0x2db398===_0x41f311)break;else _0x54cdbc['push'](_0x54cdbc['shift']());}catch(_0x2de3da){_0x54cdbc['push'](_0x54cdbc['shift']());}}}(a23_0x53aa,0x55358));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0x1d6a95(0x22f)]=a23_0x1d6a95(0x257);[a23_0x1d6a95(0x25e)]=a23_0x1d6a95(0x223);async['execute'](_0x166c01){const _0x52dbcc=a23_0x1d6a95,{options:_0x39270b,args:_0x3ce757,tdx:_0x28ed85}=_0x166c01,_0x35b773=_0x3ce757[0x0],_0x4b7cf9=!_0x35b773&&!!_0x39270b[_0x52dbcc(0x220)],_0x371825=_0x35b773||_0x39270b[_0x52dbcc(0x220)];if(!_0x371825)return console['error'](_0x52dbcc(0x21d)),console[_0x52dbcc(0x24c)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x52dbcc(0x24c)]('Examples:'),console[_0x52dbcc(0x24c)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console['error'](_0x52dbcc(0x1f9)),console['error'](_0x52dbcc(0x205)),console[_0x52dbcc(0x24c)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x38de83=_0x39270b['segmentPath'];let _0x28b859=_0x371825;!_0x4b7cf9&&_0x38de83&&!_0x371825[_0x52dbcc(0x24f)]('/')&&(_0x28b859=_0x38de83+'/'+_0x371825,_0x39270b[_0x52dbcc(0x245)]&&console['error'](_0x52dbcc(0x252)+_0x28b859));const _0x9f4e32=await withSpinner(_0x52dbcc(0x251)+_0x28b859+_0x52dbcc(0x25b),()=>_0x28ed85[_0x52dbcc(0x1ec)]['resolvePathToResource'](_0x28b859),{'verbose':_0x39270b[_0x52dbcc(0x245)]}),_0x25db66=_0x9f4e32[_0x52dbcc(0x264)];_0x39270b[_0x52dbcc(0x245)]&&(console[_0x52dbcc(0x24c)](_0x52dbcc(0x1fa)+_0x25db66[_0x52dbcc(0x235)]),console['error'](_0x52dbcc(0x219)+_0x25db66['parentId']),_0x25db66[_0x52dbcc(0x1ef)]&&console[_0x52dbcc(0x24c)](_0x52dbcc(0x244)+_0x25db66[_0x52dbcc(0x1ef)]),_0x25db66[_0x52dbcc(0x23d)]&&console[_0x52dbcc(0x24c)]('Segment\x20ID:\x20'+_0x25db66[_0x52dbcc(0x23d)]));if(_0x25db66['type']==='parent'){const _0xc5d243=await withSpinner(_0x52dbcc(0x248),()=>_0x28ed85[_0x52dbcc(0x1ec)][_0x52dbcc(0x20e)](_0x25db66['parentId']),{'verbose':_0x39270b[_0x52dbcc(0x245)]});await handleSingleObjectOutput(_0xc5d243[_0x52dbcc(0x264)],_0x39270b);}else{if(_0x25db66[_0x52dbcc(0x235)]===_0x52dbcc(0x261)){if(!_0x25db66[_0x52dbcc(0x1ef)])throw new SDKError(ErrorCode[_0x52dbcc(0x203)],_0x52dbcc(0x262));const _0x4083e3=await withSpinner(_0x52dbcc(0x230),()=>_0x28ed85[_0x52dbcc(0x1ec)][_0x52dbcc(0x226)](_0x25db66['folderId']),{'verbose':_0x39270b[_0x52dbcc(0x245)]});await handleSingleObjectOutput(_0x4083e3[_0x52dbcc(0x264)],_0x39270b);}else{if(_0x25db66['type']===_0x52dbcc(0x1ec)){if(!_0x25db66['segmentId'])throw new SDKError(ErrorCode[_0x52dbcc(0x203)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2364f9=await withSpinner(_0x52dbcc(0x258),()=>_0x28ed85['segment'][_0x52dbcc(0x25a)](_0x25db66[_0x52dbcc(0x237)],_0x25db66[_0x52dbcc(0x23d)]),{'verbose':_0x39270b[_0x52dbcc(0x245)]});await handleSingleObjectOutput(_0x2364f9[_0x52dbcc(0x264)],_0x39270b);}}}return 0x0;}catch(_0xd12a4a){if(_0xd12a4a instanceof SDKError)return console[_0x52dbcc(0x24c)](_0x52dbcc(0x231)+_0xd12a4a[_0x52dbcc(0x241)]),_0xd12a4a[_0x52dbcc(0x1ea)]&&console[_0x52dbcc(0x24c)](_0x52dbcc(0x217)+_0xd12a4a[_0x52dbcc(0x1ea)]),0x1;throw _0xd12a4a;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x1d6a95(0x22f)]=a23_0x1d6a95(0x207);[a23_0x1d6a95(0x25e)]=a23_0x1d6a95(0x21a);async[a23_0x1d6a95(0x1f3)](_0x1fbb00){const _0x89e733=a23_0x1d6a95,{options:_0x2c5c39,args:_0x15c12e,tdx:_0x41028a}=_0x1fbb00,_0x2f19e3=_0x15c12e[0x0],_0xc95859=!_0x2f19e3&&!!_0x2c5c39[_0x89e733(0x220)],_0x44c7d1=_0x2f19e3||_0x2c5c39[_0x89e733(0x220)];if(!_0x44c7d1)return console['error'](_0x89e733(0x242)),console['error'](_0x89e733(0x247)),console['error'](_0x89e733(0x215)),console[_0x89e733(0x24c)](_0x89e733(0x263)),console[_0x89e733(0x24c)](_0x89e733(0x249)),console[_0x89e733(0x24c)](_0x89e733(0x23f)),console[_0x89e733(0x24c)](_0x89e733(0x24e)),0x1;try{const _0x51aedf=_0x2c5c39[_0x89e733(0x234)];let _0x57d61d=_0x44c7d1;!_0xc95859&&_0x51aedf&&!_0x44c7d1[_0x89e733(0x24f)]('/')&&(_0x57d61d=_0x51aedf+'/'+_0x44c7d1,_0x2c5c39[_0x89e733(0x245)]&&console['error'](_0x89e733(0x252)+_0x57d61d));const _0xfc25cb=await withSpinner(_0x89e733(0x251)+_0x57d61d+_0x89e733(0x25b),()=>_0x41028a[_0x89e733(0x1ec)][_0x89e733(0x23c)](_0x57d61d),{'verbose':_0x2c5c39[_0x89e733(0x245)]}),_0x57e2e5=_0xfc25cb['data'];_0x2c5c39[_0x89e733(0x245)]&&(console['error']('Resolved\x20type:\x20'+_0x57e2e5['type']),console['error'](_0x89e733(0x219)+_0x57e2e5[_0x89e733(0x237)]));if(_0x57e2e5['type']===_0x89e733(0x261))return console[_0x89e733(0x24c)](_0x89e733(0x209)),console['error'](_0x89e733(0x255)),0x1;let _0x3942af;if(_0x57e2e5[_0x89e733(0x235)]===_0x89e733(0x1eb)){const _0x3a2f33=await withSpinner(_0x89e733(0x240),()=>_0x41028a[_0x89e733(0x1ec)]['getParentSQL'](_0x57e2e5['parentId']),{'verbose':_0x2c5c39[_0x89e733(0x245)]});_0x3942af=_0x3a2f33[_0x89e733(0x264)];}else{if(!_0x57e2e5['segmentId'])throw new SDKError(ErrorCode[_0x89e733(0x203)],_0x89e733(0x1f5));const _0x18b23a=await withSpinner(_0x89e733(0x214),()=>_0x41028a[_0x89e733(0x1ec)][_0x89e733(0x1fc)](_0x57e2e5['parentId'],_0x57e2e5[_0x89e733(0x23d)]),{'verbose':_0x2c5c39['verbose']});_0x3942af=_0x18b23a['data'];}const _0x3aac66=resolveLimit(_0x2c5c39[_0x89e733(0x22b)],DEFAULT_DISPLAY_LIMIT),_0x6f5828=/\bLIMIT\s+\d+/i['test'](_0x3942af);!_0x6f5828&&(_0x3942af=_0x3942af[_0x89e733(0x1f6)]()[_0x89e733(0x22e)](/;+$/,''),_0x3942af=_0x89e733(0x225)+_0x3942af+_0x89e733(0x233)+_0x3aac66);_0x2c5c39[_0x89e733(0x245)]&&console[_0x89e733(0x24c)](_0x89e733(0x24b)+_0x3942af);const _0x13224d=await withQuerySpinner(_0x89e733(0x20f),async _0xabaaa7=>{const _0x1e9ca8=_0x89e733,_0xbdc02d=await _0x41028a[_0x1e9ca8(0x1f1)][_0x1e9ca8(0x1f3)](_0x3942af,{'catalog':'td','schema':_0x1e9ca8(0x25f),'onJobId':_0x2e420c=>{const _0x48306f=_0x1e9ca8;_0xabaaa7[_0x48306f(0x238)](_0x2e420c);}});return _0xbdc02d;},{'verbose':_0x2c5c39['verbose']}),_0x44c73c=_0x13224d[_0x89e733(0x264)],_0x930071=_0x44c73c[_0x89e733(0x1ff)]?_0x89e733(0x206)+_0x44c73c['jobId']+']':'';return console[_0x89e733(0x24c)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x44c73c[_0x89e733(0x23a)][_0x89e733(0x22c)][_0x89e733(0x1ed)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x44c73c[_0x89e733(0x23a)][_0x89e733(0x239)])+_0x930071)),await handleQueryOutput(_0x44c73c,_0x2c5c39),0x0;}catch(_0x53abb4){if(_0x53abb4 instanceof SDKError)return console[_0x89e733(0x24c)](_0x89e733(0x1ee)+_0x53abb4['code']+']'),console[_0x89e733(0x24c)]('\x0a'+_0x53abb4['message']),0x1;throw _0x53abb4;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a23_0x1d6a95(0x1f0);[a23_0x1d6a95(0x25e)]=a23_0x1d6a95(0x21e);async[a23_0x1d6a95(0x1f3)](_0x26124b){const _0x584235=a23_0x1d6a95,{options:_0x3832e8,args:_0x1f86b8,tdx:_0x445364}=_0x26124b;if(_0x1f86b8[_0x584235(0x25d)]===0x0)return console[_0x584235(0x24c)](_0x584235(0x216)),console[_0x584235(0x24c)](_0x584235(0x22d)),0x1;const _0x1cd1e2=_0x1f86b8[0x0];try{_0x3832e8[_0x584235(0x245)]&&(console[_0x584235(0x24c)](_0x584235(0x1f7)+_0x3832e8[_0x584235(0x213)]),console[_0x584235(0x24c)](_0x584235(0x204)+_0x1cd1e2));const _0x2d5456=await withSpinner(_0x584235(0x1f4)+_0x1cd1e2+_0x584235(0x25b),()=>_0x445364[_0x584235(0x1ec)][_0x584235(0x201)](_0x1cd1e2),{'verbose':_0x3832e8[_0x584235(0x245)]}),_0x578f6c=_0x2d5456['data'];_0x3832e8['verbose']&&console[_0x584235(0x24c)](_0x584235(0x1f2)+_0x578f6c);const _0x27de5b=await withSpinner(_0x584235(0x211)+_0x1cd1e2+_0x584235(0x25b),()=>_0x445364[_0x584235(0x1ec)][_0x584235(0x222)](_0x578f6c),{'verbose':_0x3832e8['verbose']}),_0x5abfc3=_0x27de5b[_0x584235(0x264)];return console[_0x584235(0x24c)](_0x584235(0x224)+_0x5abfc3[_0x584235(0x25d)]+_0x584235(0x236)+(_0x5abfc3[_0x584235(0x25d)]!==0x1?'s':'')),await handleSDKOutput(_0x5abfc3,_0x3832e8),0x0;}catch(_0x2a0215){if(_0x2a0215 instanceof SDKError)return console['error'](_0x584235(0x231)+_0x2a0215[_0x584235(0x241)]),_0x2a0215[_0x584235(0x1ea)]&&console[_0x584235(0x24c)](_0x584235(0x217)+_0x2a0215[_0x584235(0x1ea)]),0x1;throw _0x2a0215;}}}function a23_0x53aa(){const _0x19ff0d=['Fetching\x20SQL\x20for\x20parent\x20segment...','message','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Fetching\x20folder\x20\x27','Folder\x20ID:\x20','verbose','createFolder','Usage:\x20tdx\x20segment\x20show\x20<path>','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentFolder','SQL\x20query:\x0a','error','7uJmkfg','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','includes','316214CzcnYl','Resolving\x20path\x20\x27','Resolved\x20relative\x20path\x20to:\x20','resolveFolderId','\x27\x20with\x20ID:\x20','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','11892870OTGAUb','segment:describe','Fetching\x20segment\x20details...','Show\x20segment\x20folder\x20details','getSegment','\x27...','Folder\x20name:\x20','length','description','information_schema','format','folder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','data','813kCPluZ','jsonl','cause','parent','segment','toLocaleString','✖\x20Query\x20failed\x20[','folderId','segment:folder:list','query','Resolved\x20parent\x20ID:\x20','execute','Resolving\x20parent\x20segment\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','trim','Site:\x20','8712EnsgYx','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20type:\x20','Creating\x20folder\x20\x27','getSegmentSQL','11424jvmStc','2114330KBSZrP','jobId','Parent\x20segment:\x20','resolveParentId','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','INTERNAL','Parent\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20[Job\x20ID:\x20','segment:show','✔\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','18vTYmSi','Resolved\x20parent\x20folder\x20ID:\x20','Create\x20segment\x20folder\x20for\x20organization','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getParent','Executing\x20segment\x20query...','Resolving\x20parent\x20folder\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','site','Fetching\x20SQL\x20for\x20segment...','Examples:','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Cause:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Parent\x20ID:\x20','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','66ffYKJS','Error:\x20Path\x20or\x20name\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','getParentSQL','parentSegment','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','listFolders','Show\x20segment\x20or\x20folder\x20details','✔\x20Found\x20','SELECT\x20*\x20FROM\x20(\x0a','getFolder','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','log','280910kkEGzx','limit','processedRows','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','replace','name','Fetching\x20folder\x20details...','Error:\x20','660052clznoc','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segmentPath','type','\x20folder','parentId','setJobId','elapsedTimeMillis','stats','Resolving\x20folder\x20\x27','resolvePathToResource','segmentId','segment:folder:show','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'];a23_0x53aa=function(){return _0x19ff0d;};return a23_0x53aa();}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x1d6a95(0x22f)]=a23_0x1d6a95(0x23e);[a23_0x1d6a95(0x25e)]=a23_0x1d6a95(0x259);async[a23_0x1d6a95(0x1f3)](_0x51026a){const _0x59bdfe=a23_0x1d6a95,{options:_0x5d0ef5,args:_0x2b00ea,tdx:_0x57a45f}=_0x51026a;if(_0x2b00ea['length']===0x0)return console[_0x59bdfe(0x24c)]('Error:\x20Folder\x20reference\x20is\x20required'),console['error'](_0x59bdfe(0x218)),0x1;try{const {parentId:_0x1c07c6,childId:_0x63bd37}=parseSegmentRef(_0x2b00ea[0x0]);_0x5d0ef5[_0x59bdfe(0x245)]&&(console['error'](_0x59bdfe(0x1f7)+_0x5d0ef5[_0x59bdfe(0x213)]),console[_0x59bdfe(0x24c)]('Parent\x20name:\x20'+_0x1c07c6),_0x63bd37&&console['error'](_0x59bdfe(0x25c)+_0x63bd37));if(!_0x63bd37)return console['error'](_0x59bdfe(0x221)),0x1;const _0x361628=await withSpinner(_0x59bdfe(0x1f4)+_0x1c07c6+'\x27...',()=>_0x57a45f['segment']['resolveParentId'](_0x1c07c6),{'verbose':_0x5d0ef5['verbose']}),_0x154cf0=_0x361628[_0x59bdfe(0x264)];_0x5d0ef5['verbose']&&console[_0x59bdfe(0x24c)](_0x59bdfe(0x1f2)+_0x154cf0);const _0x643753=await withSpinner(_0x59bdfe(0x23b)+_0x63bd37+_0x59bdfe(0x25b),()=>_0x57a45f[_0x59bdfe(0x1ec)]['resolveFolderId'](_0x154cf0,_0x63bd37),{'verbose':_0x5d0ef5[_0x59bdfe(0x245)]}),_0x29b49d=_0x643753[_0x59bdfe(0x264)];_0x5d0ef5[_0x59bdfe(0x245)]&&console[_0x59bdfe(0x24c)]('Resolved\x20folder\x20ID:\x20'+_0x29b49d);const _0x4d30c8=await withSpinner(_0x59bdfe(0x243)+_0x63bd37+_0x59bdfe(0x25b),()=>_0x57a45f[_0x59bdfe(0x1ec)][_0x59bdfe(0x226)](_0x29b49d),{'verbose':_0x5d0ef5[_0x59bdfe(0x245)]});return await handleSDKOutput([_0x4d30c8[_0x59bdfe(0x264)]],_0x5d0ef5),0x0;}catch(_0x2840e2){if(_0x2840e2 instanceof SDKError)return console[_0x59bdfe(0x24c)](_0x59bdfe(0x231)+_0x2840e2[_0x59bdfe(0x241)]),_0x2840e2[_0x59bdfe(0x1ea)]&&console[_0x59bdfe(0x24c)](_0x59bdfe(0x217)+_0x2840e2[_0x59bdfe(0x1ea)]),0x1;throw _0x2840e2;}}}export class SegmentSQLCommand extends BaseCommand{[a23_0x1d6a95(0x22f)]='segment:sql';[a23_0x1d6a95(0x25e)]='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async[a23_0x1d6a95(0x1f3)](_0x151cb6){const _0x35e0d3=a23_0x1d6a95,{options:_0x1b01b9,args:_0x592f02,tdx:_0x5aae69}=_0x151cb6,_0x2e6b1b=_0x592f02[0x0],_0x180ef1=!_0x2e6b1b&&!!_0x1b01b9[_0x35e0d3(0x220)],_0xf47efe=_0x2e6b1b||_0x1b01b9[_0x35e0d3(0x220)];if(!_0xf47efe)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x35e0d3(0x24c)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console['error'](_0x35e0d3(0x215)),console[_0x35e0d3(0x24c)](_0x35e0d3(0x228)),console[_0x35e0d3(0x24c)](_0x35e0d3(0x20d)),console['error'](_0x35e0d3(0x227)),console[_0x35e0d3(0x24c)](_0x35e0d3(0x24e)),0x1;try{const _0x57e981=_0x1b01b9[_0x35e0d3(0x234)];let _0x221b82=_0xf47efe;!_0x180ef1&&_0x57e981&&!_0xf47efe[_0x35e0d3(0x24f)]('/')&&(_0x221b82=_0x57e981+'/'+_0xf47efe,_0x1b01b9[_0x35e0d3(0x245)]&&console['error'](_0x35e0d3(0x252)+_0x221b82));const _0x15b31d=await withSpinner(_0x35e0d3(0x251)+_0x221b82+_0x35e0d3(0x25b),()=>_0x5aae69[_0x35e0d3(0x1ec)][_0x35e0d3(0x23c)](_0x221b82),{'verbose':_0x1b01b9[_0x35e0d3(0x245)]}),_0x5776c6=_0x15b31d[_0x35e0d3(0x264)];_0x1b01b9[_0x35e0d3(0x245)]&&(console[_0x35e0d3(0x24c)]('Resolved\x20type:\x20'+_0x5776c6[_0x35e0d3(0x235)]),console[_0x35e0d3(0x24c)](_0x35e0d3(0x219)+_0x5776c6[_0x35e0d3(0x237)]));if(_0x5776c6['type']===_0x35e0d3(0x261))return console['error'](_0x35e0d3(0x212)),console[_0x35e0d3(0x24c)](_0x35e0d3(0x202)),0x1;let _0x29ecfa;if(_0x5776c6[_0x35e0d3(0x235)]===_0x35e0d3(0x1eb)){const _0x203499=await withSpinner(_0x35e0d3(0x240),()=>_0x5aae69[_0x35e0d3(0x1ec)][_0x35e0d3(0x21f)](_0x5776c6[_0x35e0d3(0x237)]),{'verbose':_0x1b01b9['verbose']});_0x29ecfa=_0x203499['data'];}else{if(!_0x5776c6['segmentId'])throw new SDKError(ErrorCode[_0x35e0d3(0x203)],_0x35e0d3(0x1f5));const _0x247529=await withSpinner(_0x35e0d3(0x214),()=>_0x5aae69[_0x35e0d3(0x1ec)][_0x35e0d3(0x1fc)](_0x5776c6[_0x35e0d3(0x237)],_0x5776c6[_0x35e0d3(0x23d)]),{'verbose':_0x1b01b9[_0x35e0d3(0x245)]});_0x29ecfa=_0x247529[_0x35e0d3(0x264)];}return _0x1b01b9[_0x35e0d3(0x260)]==='json'||_0x1b01b9['format']===_0x35e0d3(0x1e9)?await handleSDKOutput([{'sql':_0x29ecfa}],_0x1b01b9):console[_0x35e0d3(0x229)](_0x29ecfa),0x0;}catch(_0x14b24e){if(_0x14b24e instanceof SDKError)return console[_0x35e0d3(0x24c)](_0x35e0d3(0x231)+_0x14b24e['message']),_0x14b24e[_0x35e0d3(0x1ea)]&&console['error'](_0x35e0d3(0x217)+_0x14b24e[_0x35e0d3(0x1ea)]),0x1;throw _0x14b24e;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x1d6a95(0x22f)]='segment:folder:create';['description']=a23_0x1d6a95(0x20c);async['execute'](_0x4540d7){const _0x429cd8=a23_0x1d6a95,{options:_0x2dfa67,args:_0x2c6f1c,tdx:_0x2037a7}=_0x4540d7,_0x43e856=_0x2dfa67;if(_0x2c6f1c[_0x429cd8(0x25d)]<0x2)return console[_0x429cd8(0x24c)](_0x429cd8(0x21b)),console[_0x429cd8(0x24c)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3a3d44=_0x2c6f1c[0x0],_0x344043=_0x2c6f1c[0x1];_0x43e856[_0x429cd8(0x245)]&&(console[_0x429cd8(0x24c)]('Site:\x20'+_0x43e856[_0x429cd8(0x213)]),console[_0x429cd8(0x24c)](_0x429cd8(0x200)+_0x3a3d44),console['error'](_0x429cd8(0x25c)+_0x344043));let _0x5047c4;if(_0x43e856[_0x429cd8(0x24a)]){const _0x5196d3=_0x43e856[_0x429cd8(0x24a)],_0x469d34=await withSpinner(_0x429cd8(0x1f4)+_0x3a3d44+_0x429cd8(0x25b),()=>_0x2037a7[_0x429cd8(0x1ec)][_0x429cd8(0x201)](_0x3a3d44),{'verbose':_0x43e856[_0x429cd8(0x245)]}),_0xf0329d=_0x469d34[_0x429cd8(0x264)],_0x3dbd68=await withSpinner(_0x429cd8(0x210)+_0x5196d3+'\x27...',()=>_0x2037a7[_0x429cd8(0x1ec)][_0x429cd8(0x253)](_0xf0329d,_0x5196d3),{'verbose':_0x43e856['verbose']});_0x5047c4=_0x3dbd68[_0x429cd8(0x264)],_0x43e856[_0x429cd8(0x245)]&&console[_0x429cd8(0x24c)](_0x429cd8(0x20b)+_0x5047c4);}const _0x302274={'name':_0x344043,'description':_0x43e856[_0x429cd8(0x25e)],'parentFolderId':_0x5047c4},_0x19cebc=await withSpinner(_0x429cd8(0x1fb)+_0x344043+_0x429cd8(0x25b),()=>_0x2037a7['segment'][_0x429cd8(0x246)](_0x3a3d44,_0x302274),{'verbose':_0x43e856[_0x429cd8(0x245)]}),_0x33c8ab=_0x19cebc['data'];return console['error'](_0x429cd8(0x208)+_0x33c8ab['name']+_0x429cd8(0x254)+_0x33c8ab['id']),await handleSDKOutput([_0x33c8ab],_0x43e856),0x0;}}
|
|
1
|
+
const a23_0x5bde68=a23_0x59cb;(function(_0x452969,_0xffc48e){const _0x156db5=a23_0x59cb,_0x593705=_0x452969();while(!![]){try{const _0x97a4b4=-parseInt(_0x156db5(0x1fc))/0x1+parseInt(_0x156db5(0x19e))/0x2+parseInt(_0x156db5(0x1f6))/0x3+parseInt(_0x156db5(0x208))/0x4+parseInt(_0x156db5(0x1b6))/0x5*(parseInt(_0x156db5(0x1f0))/0x6)+parseInt(_0x156db5(0x1de))/0x7*(parseInt(_0x156db5(0x1db))/0x8)+-parseInt(_0x156db5(0x1f8))/0x9;if(_0x97a4b4===_0xffc48e)break;else _0x593705['push'](_0x593705['shift']());}catch(_0x4368a0){_0x593705['push'](_0x593705['shift']());}}}(a23_0x2438,0x5a4aa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';function a23_0x2438(){const _0x1f81d0=['Error:\x20','stats','listFolders','Usage:\x20tdx\x20segment\x20sql\x20<path>','Error:\x20Parent\x20segment\x20name\x20is\x20required','data','getParent','INTERNAL','2512vSzlqC','jsonl','getSegment','2849aeAgps','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','processedRows','verbose','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','description','getParentSQL','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Folder\x20name:\x20','message','trim','resolvePathToResource','Usage:\x20tdx\x20segment\x20show\x20<path>','createFolder','segmentPath','Segment\x20ID:\x20','6fwAvTb','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','error','Fetching\x20segment\x20details...','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','length','660468ymZDzw','query','3791007QcVMGm','parentId','segment:folder:show','Resolved\x20parent\x20folder\x20ID:\x20','690862jEGTKO','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','jobId','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','segment:folder:list','code','in\x20','✖\x20Query\x20failed\x20[','Parent\x20name:\x20','segment:folder:create','SQL\x20query:\x0a','Fetching\x20folder\x20details...','1542656PQRPwr','parent','Examples:','json','Folder\x20ID\x20missing\x20from\x20resolved\x20path','SELECT\x20*\x20FROM\x20(\x0a','477470GjLIVX','replace','\x20folder','type','\x20\x20Cause:\x20','cause','\x20rows\x20','segment:show','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','test','site','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','folderId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','segment','includes','Site:\x20','execute','Resolved\x20relative\x20path\x20to:\x20','✔\x20Query\x20completed:\x20Processed\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','2547830qpPbek','\x27...','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentSegment','Create\x20segment\x20folder\x20for\x20organization','folder','Resolving\x20path\x20\x27','Parent\x20ID:\x20','Error:\x20Folder\x20reference\x20is\x20required','parentFolder','name','✔\x20Created\x20folder\x20\x27','getSegmentSQL','limit','segmentId','Resolved\x20type:\x20','format','information_schema','Show\x20segment\x20or\x20folder\x20details','Parent\x20segment:\x20','resolveParentId','log','Fetching\x20SQL\x20for\x20segment...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x27\x20with\x20ID:\x20','Resolved\x20parent\x20ID:\x20','segment:describe','Executing\x20segment\x20query...'];a23_0x2438=function(){return _0x1f81d0;};return a23_0x2438();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x1d1);[a23_0x5bde68(0x1e3)]=a23_0x5bde68(0x1c9);async[a23_0x5bde68(0x1b2)](_0xd0dbba){const _0x79d0ae=a23_0x5bde68,{options:_0x858281,args:_0x5167c0,tdx:_0x3bd52e}=_0xd0dbba,_0x33002e=_0x5167c0[0x0],_0x145e57=!_0x33002e&&!!_0x858281[_0x79d0ae(0x1ba)],_0x4124b5=_0x33002e||_0x858281[_0x79d0ae(0x1ba)];if(!_0x4124b5)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x79d0ae(0x1f2)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x79d0ae(0x1f2)](_0x79d0ae(0x20a)),console['error'](_0x79d0ae(0x1ae)),console[_0x79d0ae(0x1f2)](_0x79d0ae(0x1a6)),console[_0x79d0ae(0x1f2)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x79d0ae(0x1f2)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x39d305=_0x858281['segmentPath'];let _0x210cf3=_0x4124b5;!_0x145e57&&_0x39d305&&!_0x4124b5[_0x79d0ae(0x1b0)]('/')&&(_0x210cf3=_0x39d305+'/'+_0x4124b5,_0x858281[_0x79d0ae(0x1e1)]&&console[_0x79d0ae(0x1f2)]('Resolved\x20relative\x20path\x20to:\x20'+_0x210cf3));const _0x5d394a=await withSpinner('Resolving\x20path\x20\x27'+_0x210cf3+_0x79d0ae(0x1b7),()=>_0x3bd52e[_0x79d0ae(0x1af)]['resolvePathToResource'](_0x210cf3),{'verbose':_0x858281[_0x79d0ae(0x1e1)]}),_0x3732a1=_0x5d394a[_0x79d0ae(0x1d8)];_0x858281['verbose']&&(console[_0x79d0ae(0x1f2)](_0x79d0ae(0x1c6)+_0x3732a1['type']),console[_0x79d0ae(0x1f2)](_0x79d0ae(0x1be)+_0x3732a1[_0x79d0ae(0x1f9)]),_0x3732a1[_0x79d0ae(0x1ad)]&&console[_0x79d0ae(0x1f2)]('Folder\x20ID:\x20'+_0x3732a1[_0x79d0ae(0x1ad)]),_0x3732a1['segmentId']&&console['error'](_0x79d0ae(0x1ef)+_0x3732a1['segmentId']));if(_0x3732a1['type']===_0x79d0ae(0x209)){const _0x54ef99=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x3bd52e[_0x79d0ae(0x1af)][_0x79d0ae(0x1d9)](_0x3732a1['parentId']),{'verbose':_0x858281['verbose']});await handleSingleObjectOutput(_0x54ef99[_0x79d0ae(0x1d8)],_0x858281);}else{if(_0x3732a1[_0x79d0ae(0x1a1)]===_0x79d0ae(0x1bc)){if(!_0x3732a1[_0x79d0ae(0x1ad)])throw new SDKError(ErrorCode[_0x79d0ae(0x1da)],_0x79d0ae(0x20c));const _0x2ade64=await withSpinner(_0x79d0ae(0x207),()=>_0x3bd52e['segment']['getFolder'](_0x3732a1[_0x79d0ae(0x1ad)]),{'verbose':_0x858281[_0x79d0ae(0x1e1)]});await handleSingleObjectOutput(_0x2ade64['data'],_0x858281);}else{if(_0x3732a1[_0x79d0ae(0x1a1)]===_0x79d0ae(0x1af)){if(!_0x3732a1[_0x79d0ae(0x1c5)])throw new SDKError(ErrorCode['INTERNAL'],_0x79d0ae(0x1b5));const _0x2304b8=await withSpinner(_0x79d0ae(0x1f3),()=>_0x3bd52e[_0x79d0ae(0x1af)][_0x79d0ae(0x1dd)](_0x3732a1['parentId'],_0x3732a1[_0x79d0ae(0x1c5)]),{'verbose':_0x858281[_0x79d0ae(0x1e1)]});await handleSingleObjectOutput(_0x2304b8[_0x79d0ae(0x1d8)],_0x858281);}}}return 0x0;}catch(_0x326a85){if(_0x326a85 instanceof SDKError)return console['error'](_0x79d0ae(0x1d3)+_0x326a85['message']),_0x326a85[_0x79d0ae(0x1a3)]&&console[_0x79d0ae(0x1f2)]('\x20\x20Cause:\x20'+_0x326a85[_0x79d0ae(0x1a3)]),0x1;throw _0x326a85;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x1a5);['description']='Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a23_0x5bde68(0x1b2)](_0x283033){const _0x360b08=a23_0x5bde68,{options:_0x32397d,args:_0x4e07a8,tdx:_0x500c4d}=_0x283033,_0x31794e=_0x4e07a8[0x0],_0x1131cf=!_0x31794e&&!!_0x32397d[_0x360b08(0x1ba)],_0x181214=_0x31794e||_0x32397d[_0x360b08(0x1ba)];if(!_0x181214)return console['error'](_0x360b08(0x1ce)),console[_0x360b08(0x1f2)](_0x360b08(0x1ec)),console[_0x360b08(0x1f2)]('Examples:'),console['error'](_0x360b08(0x1e7)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x360b08(0x1f2)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x360b08(0x1f2)](_0x360b08(0x1e6)),0x1;try{const _0x1cb44e=_0x32397d[_0x360b08(0x1ee)];let _0x491cfa=_0x181214;!_0x1131cf&&_0x1cb44e&&!_0x181214['includes']('/')&&(_0x491cfa=_0x1cb44e+'/'+_0x181214,_0x32397d[_0x360b08(0x1e1)]&&console['error'](_0x360b08(0x1b3)+_0x491cfa));const _0x4b244a=await withSpinner(_0x360b08(0x1bd)+_0x491cfa+_0x360b08(0x1b7),()=>_0x500c4d[_0x360b08(0x1af)][_0x360b08(0x1eb)](_0x491cfa),{'verbose':_0x32397d[_0x360b08(0x1e1)]}),_0x4a92ea=_0x4b244a[_0x360b08(0x1d8)];_0x32397d[_0x360b08(0x1e1)]&&(console[_0x360b08(0x1f2)](_0x360b08(0x1c6)+_0x4a92ea[_0x360b08(0x1a1)]),console[_0x360b08(0x1f2)](_0x360b08(0x1be)+_0x4a92ea['parentId']));if(_0x4a92ea[_0x360b08(0x1a1)]==='folder')return console[_0x360b08(0x1f2)](_0x360b08(0x1f1)),console[_0x360b08(0x1f2)](_0x360b08(0x1f4)),0x1;let _0x13c98e;if(_0x4a92ea['type']==='parent'){const _0x4d1b55=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x500c4d[_0x360b08(0x1af)][_0x360b08(0x1e4)](_0x4a92ea[_0x360b08(0x1f9)]),{'verbose':_0x32397d[_0x360b08(0x1e1)]});_0x13c98e=_0x4d1b55[_0x360b08(0x1d8)];}else{if(!_0x4a92ea[_0x360b08(0x1c5)])throw new SDKError(ErrorCode[_0x360b08(0x1da)],_0x360b08(0x1b5));const _0x3e798f=await withSpinner(_0x360b08(0x1cd),()=>_0x500c4d[_0x360b08(0x1af)][_0x360b08(0x1c3)](_0x4a92ea[_0x360b08(0x1f9)],_0x4a92ea[_0x360b08(0x1c5)]),{'verbose':_0x32397d[_0x360b08(0x1e1)]});_0x13c98e=_0x3e798f[_0x360b08(0x1d8)];}const _0x5c9de8=resolveLimit(_0x32397d[_0x360b08(0x1c4)],DEFAULT_DISPLAY_LIMIT),_0x1d913d=/\bLIMIT\s+\d+/i[_0x360b08(0x1a7)](_0x13c98e);!_0x1d913d&&(_0x13c98e=_0x13c98e[_0x360b08(0x1ea)]()[_0x360b08(0x19f)](/;+$/,''),_0x13c98e=_0x360b08(0x19d)+_0x13c98e+_0x360b08(0x1fd)+_0x5c9de8);_0x32397d[_0x360b08(0x1e1)]&&console[_0x360b08(0x1f2)](_0x360b08(0x206)+_0x13c98e);const _0x1de18b=await withQuerySpinner(_0x360b08(0x1d2),async _0x5e1722=>{const _0x51eedb=_0x360b08,_0x4d823c=await _0x500c4d[_0x51eedb(0x1f7)]['execute'](_0x13c98e,{'catalog':'td','schema':_0x51eedb(0x1c8),'onJobId':_0x380d53=>{_0x5e1722['setJobId'](_0x380d53);}});return _0x4d823c;},{'verbose':_0x32397d['verbose']}),_0x2ac937=_0x1de18b[_0x360b08(0x1d8)],_0x1bbef6=_0x2ac937['jobId']?'\x20[Job\x20ID:\x20'+_0x2ac937[_0x360b08(0x1fe)]+']':'';return console[_0x360b08(0x1f2)](_0x360b08(0x1b4)+_0x2ac937[_0x360b08(0x1d4)][_0x360b08(0x1e0)]['toLocaleString']()+_0x360b08(0x1a4)+(_0x360b08(0x202)+formatElapsed(_0x2ac937['stats']['elapsedTimeMillis'])+_0x1bbef6)),await handleQueryOutput(_0x2ac937,_0x32397d),0x0;}catch(_0x5ef710){if(_0x5ef710 instanceof SDKError)return console[_0x360b08(0x1f2)](_0x360b08(0x203)+_0x5ef710[_0x360b08(0x201)]+']'),console[_0x360b08(0x1f2)]('\x0a'+_0x5ef710[_0x360b08(0x1e9)]),0x1;throw _0x5ef710;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x200);[a23_0x5bde68(0x1e3)]=a23_0x5bde68(0x1e5);async['execute'](_0x1de00c){const _0x5e1aed=a23_0x5bde68,{options:_0x1331c2,args:_0x598abc,tdx:_0x47739c}=_0x1de00c;if(_0x598abc['length']===0x0)return console[_0x5e1aed(0x1f2)](_0x5e1aed(0x1d7)),console[_0x5e1aed(0x1f2)](_0x5e1aed(0x1ac)),0x1;const _0xadfa6d=_0x598abc[0x0];try{_0x1331c2[_0x5e1aed(0x1e1)]&&(console[_0x5e1aed(0x1f2)]('Site:\x20'+_0x1331c2[_0x5e1aed(0x1a8)]),console['error'](_0x5e1aed(0x204)+_0xadfa6d));const _0x134f0c=await withSpinner(_0x5e1aed(0x1a9)+_0xadfa6d+_0x5e1aed(0x1b7),()=>_0x47739c[_0x5e1aed(0x1af)][_0x5e1aed(0x1cb)](_0xadfa6d),{'verbose':_0x1331c2[_0x5e1aed(0x1e1)]}),_0x1a8956=_0x134f0c[_0x5e1aed(0x1d8)];_0x1331c2['verbose']&&console['error'](_0x5e1aed(0x1d0)+_0x1a8956);const _0x350479=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0xadfa6d+_0x5e1aed(0x1b7),()=>_0x47739c[_0x5e1aed(0x1af)][_0x5e1aed(0x1d5)](_0x1a8956),{'verbose':_0x1331c2[_0x5e1aed(0x1e1)]}),_0x1c0cda=_0x350479[_0x5e1aed(0x1d8)];return console['error']('✔\x20Found\x20'+_0x1c0cda[_0x5e1aed(0x1f5)]+_0x5e1aed(0x1a0)+(_0x1c0cda[_0x5e1aed(0x1f5)]!==0x1?'s':'')),await handleSDKOutput(_0x1c0cda,_0x1331c2),0x0;}catch(_0x2fcbfd){if(_0x2fcbfd instanceof SDKError)return console[_0x5e1aed(0x1f2)](_0x5e1aed(0x1d3)+_0x2fcbfd['message']),_0x2fcbfd[_0x5e1aed(0x1a3)]&&console[_0x5e1aed(0x1f2)](_0x5e1aed(0x1a2)+_0x2fcbfd[_0x5e1aed(0x1a3)]),0x1;throw _0x2fcbfd;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x1fa);['description']='Show\x20segment\x20folder\x20details';async[a23_0x5bde68(0x1b2)](_0x173de7){const _0x459036=a23_0x5bde68,{options:_0x29e926,args:_0x4f42a1,tdx:_0x7ce0fb}=_0x173de7;if(_0x4f42a1[_0x459036(0x1f5)]===0x0)return console[_0x459036(0x1f2)](_0x459036(0x1bf)),console[_0x459036(0x1f2)](_0x459036(0x1aa)),0x1;try{const {parentId:_0x2a0131,childId:_0x1c1006}=parseSegmentRef(_0x4f42a1[0x0]);_0x29e926['verbose']&&(console[_0x459036(0x1f2)](_0x459036(0x1b1)+_0x29e926[_0x459036(0x1a8)]),console[_0x459036(0x1f2)](_0x459036(0x204)+_0x2a0131),_0x1c1006&&console[_0x459036(0x1f2)](_0x459036(0x1e8)+_0x1c1006));if(!_0x1c1006)return console[_0x459036(0x1f2)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x47d4d4=await withSpinner(_0x459036(0x1a9)+_0x2a0131+_0x459036(0x1b7),()=>_0x7ce0fb[_0x459036(0x1af)]['resolveParentId'](_0x2a0131),{'verbose':_0x29e926['verbose']}),_0x3348d6=_0x47d4d4[_0x459036(0x1d8)];_0x29e926[_0x459036(0x1e1)]&&console[_0x459036(0x1f2)](_0x459036(0x1d0)+_0x3348d6);const _0x24e4d7=await withSpinner('Resolving\x20folder\x20\x27'+_0x1c1006+_0x459036(0x1b7),()=>_0x7ce0fb[_0x459036(0x1af)]['resolveFolderId'](_0x3348d6,_0x1c1006),{'verbose':_0x29e926[_0x459036(0x1e1)]}),_0x262211=_0x24e4d7['data'];_0x29e926[_0x459036(0x1e1)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x262211);const _0x51e935=await withSpinner('Fetching\x20folder\x20\x27'+_0x1c1006+_0x459036(0x1b7),()=>_0x7ce0fb['segment']['getFolder'](_0x262211),{'verbose':_0x29e926[_0x459036(0x1e1)]});return await handleSDKOutput([_0x51e935[_0x459036(0x1d8)]],_0x29e926),0x0;}catch(_0x572aff){if(_0x572aff instanceof SDKError)return console['error'](_0x459036(0x1d3)+_0x572aff[_0x459036(0x1e9)]),_0x572aff[_0x459036(0x1a3)]&&console[_0x459036(0x1f2)](_0x459036(0x1a2)+_0x572aff[_0x459036(0x1a3)]),0x1;throw _0x572aff;}}}export class SegmentSQLCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]='segment:sql';[a23_0x5bde68(0x1e3)]=a23_0x5bde68(0x1ab);async[a23_0x5bde68(0x1b2)](_0x4f7939){const _0x2ec5c5=a23_0x5bde68,{options:_0x13a79d,args:_0x30e003,tdx:_0x55f48b}=_0x4f7939,_0x15edc6=_0x30e003[0x0],_0x833fe8=!_0x15edc6&&!!_0x13a79d[_0x2ec5c5(0x1ba)],_0x397f89=_0x15edc6||_0x13a79d['parentSegment'];if(!_0x397f89)return console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1ce)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1d6)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x20a)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1ff)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1b9)),console['error'](_0x2ec5c5(0x1e2)),console[_0x2ec5c5(0x1f2)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x1bbe5f=_0x13a79d[_0x2ec5c5(0x1ee)];let _0x32334d=_0x397f89;!_0x833fe8&&_0x1bbe5f&&!_0x397f89[_0x2ec5c5(0x1b0)]('/')&&(_0x32334d=_0x1bbe5f+'/'+_0x397f89,_0x13a79d[_0x2ec5c5(0x1e1)]&&console[_0x2ec5c5(0x1f2)]('Resolved\x20relative\x20path\x20to:\x20'+_0x32334d));const _0x5015c4=await withSpinner('Resolving\x20path\x20\x27'+_0x32334d+'\x27...',()=>_0x55f48b[_0x2ec5c5(0x1af)]['resolvePathToResource'](_0x32334d),{'verbose':_0x13a79d[_0x2ec5c5(0x1e1)]}),_0x4a192d=_0x5015c4[_0x2ec5c5(0x1d8)];_0x13a79d[_0x2ec5c5(0x1e1)]&&(console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1c6)+_0x4a192d[_0x2ec5c5(0x1a1)]),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1be)+_0x4a192d[_0x2ec5c5(0x1f9)]));if(_0x4a192d[_0x2ec5c5(0x1a1)]==='folder')return console['error'](_0x2ec5c5(0x1b8)),console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1df)),0x1;let _0x54fbf3;if(_0x4a192d['type']==='parent'){const _0x568328=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x55f48b['segment'][_0x2ec5c5(0x1e4)](_0x4a192d['parentId']),{'verbose':_0x13a79d[_0x2ec5c5(0x1e1)]});_0x54fbf3=_0x568328['data'];}else{if(!_0x4a192d[_0x2ec5c5(0x1c5)])throw new SDKError(ErrorCode[_0x2ec5c5(0x1da)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x398c34=await withSpinner(_0x2ec5c5(0x1cd),()=>_0x55f48b[_0x2ec5c5(0x1af)][_0x2ec5c5(0x1c3)](_0x4a192d[_0x2ec5c5(0x1f9)],_0x4a192d[_0x2ec5c5(0x1c5)]),{'verbose':_0x13a79d[_0x2ec5c5(0x1e1)]});_0x54fbf3=_0x398c34[_0x2ec5c5(0x1d8)];}return _0x13a79d[_0x2ec5c5(0x1c7)]===_0x2ec5c5(0x20b)||_0x13a79d['format']===_0x2ec5c5(0x1dc)?await handleSDKOutput([{'sql':_0x54fbf3}],_0x13a79d):console[_0x2ec5c5(0x1cc)](_0x54fbf3),0x0;}catch(_0x53db5d){if(_0x53db5d instanceof SDKError)return console['error'](_0x2ec5c5(0x1d3)+_0x53db5d[_0x2ec5c5(0x1e9)]),_0x53db5d['cause']&&console[_0x2ec5c5(0x1f2)](_0x2ec5c5(0x1a2)+_0x53db5d[_0x2ec5c5(0x1a3)]),0x1;throw _0x53db5d;}}}function a23_0x59cb(_0x1f3a32,_0x6eee0c){const _0x2438fb=a23_0x2438();return a23_0x59cb=function(_0x59cb6f,_0xd2b194){_0x59cb6f=_0x59cb6f-0x19d;let _0x463c48=_0x2438fb[_0x59cb6f];return _0x463c48;},a23_0x59cb(_0x1f3a32,_0x6eee0c);}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x5bde68(0x1c1)]=a23_0x5bde68(0x205);[a23_0x5bde68(0x1e3)]=a23_0x5bde68(0x1bb);async[a23_0x5bde68(0x1b2)](_0x4c4514){const _0x295331=a23_0x5bde68,{options:_0x12cd68,args:_0x1307ec,tdx:_0x19308d}=_0x4c4514,_0x37832f=_0x12cd68;if(_0x1307ec[_0x295331(0x1f5)]<0x2)return console[_0x295331(0x1f2)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x2bfd2d=_0x1307ec[0x0],_0x4554a6=_0x1307ec[0x1];_0x37832f[_0x295331(0x1e1)]&&(console[_0x295331(0x1f2)](_0x295331(0x1b1)+_0x37832f[_0x295331(0x1a8)]),console[_0x295331(0x1f2)](_0x295331(0x1ca)+_0x2bfd2d),console[_0x295331(0x1f2)](_0x295331(0x1e8)+_0x4554a6));let _0x3cc720;if(_0x37832f[_0x295331(0x1c0)]){const _0x3749e2=_0x37832f[_0x295331(0x1c0)],_0x2b4ec0=await withSpinner(_0x295331(0x1a9)+_0x2bfd2d+_0x295331(0x1b7),()=>_0x19308d[_0x295331(0x1af)]['resolveParentId'](_0x2bfd2d),{'verbose':_0x37832f['verbose']}),_0x410157=_0x2b4ec0[_0x295331(0x1d8)],_0xd8cf48=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x3749e2+_0x295331(0x1b7),()=>_0x19308d[_0x295331(0x1af)]['resolveFolderId'](_0x410157,_0x3749e2),{'verbose':_0x37832f['verbose']});_0x3cc720=_0xd8cf48[_0x295331(0x1d8)],_0x37832f[_0x295331(0x1e1)]&&console[_0x295331(0x1f2)](_0x295331(0x1fb)+_0x3cc720);}const _0x594c21={'name':_0x4554a6,'description':_0x37832f[_0x295331(0x1e3)],'parentFolderId':_0x3cc720},_0x366ae0=await withSpinner('Creating\x20folder\x20\x27'+_0x4554a6+_0x295331(0x1b7),()=>_0x19308d[_0x295331(0x1af)][_0x295331(0x1ed)](_0x2bfd2d,_0x594c21),{'verbose':_0x37832f[_0x295331(0x1e1)]}),_0x3917c7=_0x366ae0[_0x295331(0x1d8)];return console[_0x295331(0x1f2)](_0x295331(0x1c2)+_0x3917c7['name']+_0x295331(0x1cf)+_0x3917c7['id']),await handleSDKOutput([_0x3917c7],_0x37832f),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x39026f=a24_0x3924;(function(_0xac719d,_0xab3466){const _0x6e32ac=a24_0x3924,_0x43fc98=_0xac719d();while(!![]){try{const _0x482103=-parseInt(_0x6e32ac(0x15a))/0x1+-parseInt(_0x6e32ac(0x170))/0x2*(parseInt(_0x6e32ac(0x187))/0x3)+parseInt(_0x6e32ac(0x161))/0x4+-parseInt(_0x6e32ac(0x17c))/0x5+-parseInt(_0x6e32ac(0x15f))/0x6*(-parseInt(_0x6e32ac(0x177))/0x7)+parseInt(_0x6e32ac(0x181))/0x8*(-parseInt(_0x6e32ac(0x17d))/0x9)+-parseInt(_0x6e32ac(0x16e))/0xa*(-parseInt(_0x6e32ac(0x183))/0xb);if(_0x482103===_0xab3466)break;else _0x43fc98['push'](_0x43fc98['shift']());}catch(_0x308c37){_0x43fc98['push'](_0x43fc98['shift']());}}}(a24_0x8107,0x6bbc7));function a24_0x3924(_0x5e5fb3,_0x2e81db){const _0x810753=a24_0x8107();return a24_0x3924=function(_0x3924c5,_0x3afd43){_0x3924c5=_0x3924c5-0x15a;let _0x1114ae=_0x810753[_0x3924c5];return _0x1114ae;},a24_0x3924(_0x5e5fb3,_0x2e81db);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a24_0x8107(){const _0x48700b=['Parent\x20path:\x20','45660RyTqbj','\x20\x20\x20Path:\x20','1306732lBTHMd','site','Parent:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','folder','noCountPopulation','data','\x27...','type','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Site:\x20','610860UqtfKA','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','3316PPnFBo','verbose','Segment\x20name:\x20','\x27\x20with\x20ID:\x20','folderId','segments','Resolving\x20folder\x20\x27','35pZIoUY','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','ruleFile','error','Resolving\x20parent\x20segment\x20\x27','3263515psQFCa','45ttgOyP','invisible','name','resolveParentId','134560uDEwVp','segment:create','231khYXJo','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','resolveFolderId','length','288FkYzzw','segment','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','310281OuzYfF','kind','Creating\x20segment\x20\x27','description'];a24_0x8107=function(){return _0x48700b;};return a24_0x8107();}export class SegmentCreateCommand extends BaseCommand{[a24_0x39026f(0x17f)]=a24_0x39026f(0x182);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0x5d16cc){const _0x532881=a24_0x39026f,{options:_0x3c7b65,args:_0x51a72f,tdx:_0x235a33}=_0x5d16cc,_0x279338=_0x3c7b65;if(_0x51a72f[_0x532881(0x186)]===0x0)return console['error'](_0x532881(0x164)),console[_0x532881(0x17a)](_0x532881(0x184)),console[_0x532881(0x17a)]('Examples:'),console[_0x532881(0x17a)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x532881(0x17a)](_0x532881(0x16c)),console[_0x532881(0x17a)](_0x532881(0x189)),0x1;const _0x2119e6=_0x51a72f[0x0],_0x22f067=_0x3c7b65['segmentPath'];let _0xb48b10=_0x2119e6;_0x22f067&&!_0x2119e6['includes']('/')&&(_0xb48b10=_0x22f067+'/'+_0x2119e6,_0x279338[_0x532881(0x171)]&&console[_0x532881(0x17a)]('Resolved\x20relative\x20path\x20to:\x20'+_0xb48b10));const _0x407350=parsePath(_0xb48b10);if(_0x407350[_0x532881(0x175)][_0x532881(0x186)]<0x2)return console[_0x532881(0x17a)](_0x532881(0x16f)),console[_0x532881(0x17a)](_0x532881(0x16b)),0x1;const _0x1e9048=_0x407350['segments'][0x0],_0x17e1d0=getBaseName(_0xb48b10),_0x2339db=getParentPath(_0xb48b10);_0x279338['verbose']&&(console['error'](_0x532881(0x16d)+_0x279338[_0x532881(0x162)]),console[_0x532881(0x17a)]('Target\x20path:\x20'+_0xb48b10),console[_0x532881(0x17a)](_0x532881(0x163)+_0x1e9048),console[_0x532881(0x17a)](_0x532881(0x172)+_0x17e1d0),console['error'](_0x532881(0x15e)+_0x2339db));const _0x1ba771=await withSpinner(_0x532881(0x17b)+_0x1e9048+'\x27...',()=>_0x235a33[_0x532881(0x188)][_0x532881(0x180)](_0x1e9048),{'verbose':_0x279338[_0x532881(0x171)]}),_0x3adf59=_0x1ba771[_0x532881(0x168)];let _0x5a12c8;if(_0x407350['segments'][_0x532881(0x186)]>0x2){const _0x3f06e1=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x2339db+_0x532881(0x169),()=>_0x235a33[_0x532881(0x188)]['resolvePathToResource'](_0x2339db),{'verbose':_0x279338[_0x532881(0x171)]}),_0x3fb819=_0x3f06e1['data'];if(_0x3fb819['type']!==_0x532881(0x166)&&_0x3fb819[_0x532881(0x16a)]!=='parent')return console[_0x532881(0x17a)](_0x532881(0x178)),0x1;_0x5a12c8=_0x3fb819[_0x532881(0x174)];}else{if(_0x279338['folder']){const _0x3d7518=await withSpinner(_0x532881(0x176)+_0x279338[_0x532881(0x166)]+'\x27...',()=>_0x235a33[_0x532881(0x188)][_0x532881(0x185)](_0x3adf59,_0x279338[_0x532881(0x166)]),{'verbose':_0x279338['verbose']});_0x5a12c8=_0x3d7518[_0x532881(0x168)];}}_0x279338['verbose']&&_0x5a12c8&&console[_0x532881(0x17a)](_0x532881(0x165)+_0x5a12c8);const _0x1cb41e=await loadJSONFromOptions(_0x279338['rule'],_0x279338[_0x532881(0x179)]),_0x39ba96={'name':_0x17e1d0,'description':_0x279338[_0x532881(0x15d)],'rule':_0x1cb41e,'kind':_0x279338['kind']!==undefined?parseInt(_0x279338[_0x532881(0x15b)],0xa):undefined,'isVisible':_0x279338[_0x532881(0x17e)]?![]:undefined,'segmentFolderId':_0x5a12c8,'countPopulation':_0x279338[_0x532881(0x167)]?![]:undefined},_0xe5a8b1=await withSpinner(_0x532881(0x15c)+_0x17e1d0+'\x27...',()=>_0x235a33['segment']['createSegment'](_0x3adf59,_0x39ba96),{'verbose':_0x279338[_0x532881(0x171)]}),_0x460cd7=_0xe5a8b1[_0x532881(0x168)];return console[_0x532881(0x17a)]('✔\x20Created\x20segment\x20\x27'+_0x460cd7[_0x532881(0x17f)]+_0x532881(0x173)+_0x460cd7['id']),_0xb48b10!==_0x2119e6&&console[_0x532881(0x17a)](_0x532881(0x160)+_0xb48b10),await handleSDKOutput([_0x460cd7],_0x279338),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a25_0x10b3(_0x13b197,_0x3744b5){const _0x176eff=a25_0x176e();return a25_0x10b3=function(_0x10b36b,_0x2a5e94){_0x10b36b=_0x10b36b-0x189;let _0x15561f=_0x176eff[_0x10b36b];return _0x15561f;},a25_0x10b3(_0x13b197,_0x3744b5);}const a25_0xb97ffd=a25_0x10b3;(function(_0x187dbb,_0x5008a8){const _0x24699d=a25_0x10b3,_0x39a604=_0x187dbb();while(!![]){try{const _0x48a188=parseInt(_0x24699d(0x18d))/0x1+-parseInt(_0x24699d(0x199))/0x2*(parseInt(_0x24699d(0x197))/0x3)+parseInt(_0x24699d(0x1a1))/0x4+-parseInt(_0x24699d(0x18c))/0x5+parseInt(_0x24699d(0x1a4))/0x6*(-parseInt(_0x24699d(0x1a7))/0x7)+-parseInt(_0x24699d(0x189))/0x8+-parseInt(_0x24699d(0x194))/0x9*(-parseInt(_0x24699d(0x190))/0xa);if(_0x48a188===_0x5008a8)break;else _0x39a604['push'](_0x39a604['shift']());}catch(_0x40a73c){_0x39a604['push'](_0x39a604['shift']());}}}(a25_0x176e,0xb1ac2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a25_0x176e(){const _0x40186a=['execute','length','1479770GXfKiI','verbose','✔\x20Found\x20','segment','9LeUncq','data','\x20field','3KxWmcX','Site:\x20','1792542XaNHyf','\x27...','error','site','listFields','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','segment:fields','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','5452344sRocFM','List\x20available\x20fields\x20for\x20segmentation','description','3784020gggLcF','Listing\x20fields\x20for\x20\x27','parentSegment','7kDhbXX','242992ZHJWow','Error:\x20Parent\x20segment\x20name\x20is\x20required','name','389725ZoXaMF','851943kKCXqG'];a25_0x176e=function(){return _0x40186a;};return a25_0x176e();}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a25_0xb97ffd(0x18b)]=a25_0xb97ffd(0x19f);[a25_0xb97ffd(0x1a3)]=a25_0xb97ffd(0x1a2);async[a25_0xb97ffd(0x18e)](_0x5b76e9){const _0x584f6a=a25_0xb97ffd,{options:_0xb5f8be,args:_0x5ac79f,tdx:_0x1d3da5}=_0x5b76e9,_0x3a7384=_0x5ac79f[0x0]||_0xb5f8be[_0x584f6a(0x1a6)];if(!_0x3a7384)return console['error'](_0x584f6a(0x18a)),console['error'](_0x584f6a(0x19e)),console[_0x584f6a(0x19b)](_0x584f6a(0x1a0)),0x1;_0xb5f8be[_0x584f6a(0x191)]&&(console[_0x584f6a(0x19b)](_0x584f6a(0x198)+_0xb5f8be[_0x584f6a(0x19c)]),console['error']('Parent\x20segment:\x20'+_0x3a7384));const _0x54ebbd=await withSpinner(_0x584f6a(0x1a5)+_0x3a7384+_0x584f6a(0x19a),()=>_0x1d3da5[_0x584f6a(0x193)][_0x584f6a(0x19d)](_0x3a7384),{'verbose':_0xb5f8be['verbose']}),_0xc6c047=_0x54ebbd[_0x584f6a(0x195)];return console[_0x584f6a(0x19b)](_0x584f6a(0x192)+_0xc6c047[_0x584f6a(0x18f)]+_0x584f6a(0x196)+(_0xc6c047['length']!==0x1?'s':'')),await handleSDKOutput(_0xc6c047,_0xb5f8be),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x2db883=a26_0x28cb;(function(_0x50d1b1,_0xb8e3b8){const _0x4f90c5=a26_0x28cb,_0x3a8565=_0x50d1b1();while(!![]){try{const _0x37b64e=-parseInt(_0x4f90c5(0xc8))/0x1*(parseInt(_0x4f90c5(0xce))/0x2)+parseInt(_0x4f90c5(0xcb))/0x3+-parseInt(_0x4f90c5(0xd7))/0x4*(parseInt(_0x4f90c5(0xd0))/0x5)+parseInt(_0x4f90c5(0xde))/0x6+-parseInt(_0x4f90c5(0xda))/0x7*(-parseInt(_0x4f90c5(0xdc))/0x8)+-parseInt(_0x4f90c5(0xdd))/0x9+-parseInt(_0x4f90c5(0xd6))/0xa*(-parseInt(_0x4f90c5(0xcc))/0xb);if(_0x37b64e===_0xb8e3b8)break;else _0x3a8565['push'](_0x3a8565['shift']());}catch(_0x490b30){_0x3a8565['push'](_0x3a8565['shift']());}}}(a26_0x1a02,0x4a46f));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a26_0x2db883(0xd3)]=a26_0x2db883(0xdb);[a26_0x2db883(0xd1)]=a26_0x2db883(0xca);async[a26_0x2db883(0xc9)](_0x234f76){const _0x57afc0=a26_0x2db883,{options:_0x8a373f}=_0x234f76;try{const _0x33252b=_0x8a373f[_0x57afc0(0xd5)];if(!_0x33252b)return _0x8a373f[_0x57afc0(0xd2)]===_0x57afc0(0xcd)||_0x8a373f[_0x57afc0(0xd2)]===_0x57afc0(0xd9)?console[_0x57afc0(0xd8)](JSON[_0x57afc0(0xd4)]({'path':'/','type':'root'})):console[_0x57afc0(0xd8)]('/'),0x0;if(_0x8a373f['format']===_0x57afc0(0xcd)||_0x8a373f[_0x57afc0(0xd2)]==='jsonl'){const _0x5af748={'path':_0x33252b};console[_0x57afc0(0xd8)](JSON[_0x57afc0(0xd4)](_0x5af748));}else console[_0x57afc0(0xd8)](_0x33252b),_0x8a373f['verbose']&&(console[_0x57afc0(0xc7)](''),console['error'](_0x57afc0(0xcf)),console[_0x57afc0(0xc7)]('\x20\x20Path:\x20'+_0x33252b),console['error'](''),console[_0x57afc0(0xc7)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x57afc0(0xc7)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x56863f){throw _0x56863f;}}}function a26_0x28cb(_0xed4b0d,_0x404cd5){const _0x1a02a6=a26_0x1a02();return a26_0x28cb=function(_0x28cb5f,_0x1b9ddb){_0x28cb5f=_0x28cb5f-0xc7;let _0x209284=_0x1a02a6[_0x28cb5f];return _0x209284;},a26_0x28cb(_0xed4b0d,_0x404cd5);}function a26_0x1a02(){const _0x18dc32=['execute','Show\x20current\x20segment/folder\x20context','1479588gIxhAf','187YYdCVp','json','420482WtCsZE','Context\x20details:','18750mLEycG','description','format','name','stringify','segmentPath','220970dZSacP','344UTFAxY','log','jsonl','3129fVcFrx','segment:pwd','368QXGSsr','3623301ONnZhF','2100972lSMxSF','error','1DJkTmH'];a26_0x1a02=function(){return _0x18dc32;};return a26_0x1a02();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x4ea326=a27_0x4f26;(function(_0x47f1f5,_0x7c0191){const _0x17302c=a27_0x4f26,_0x158d0b=_0x47f1f5();while(!![]){try{const _0x4776b0=-parseInt(_0x17302c(0x154))/0x1+parseInt(_0x17302c(0x150))/0x2+-parseInt(_0x17302c(0x157))/0x3+parseInt(_0x17302c(0x14b))/0x4*(-parseInt(_0x17302c(0x14e))/0x5)+parseInt(_0x17302c(0x145))/0x6*(parseInt(_0x17302c(0x149))/0x7)+parseInt(_0x17302c(0x169))/0x8+parseInt(_0x17302c(0x147))/0x9;if(_0x4776b0===_0x7c0191)break;else _0x158d0b['push'](_0x158d0b['shift']());}catch(_0x337799){_0x158d0b['push'](_0x158d0b['shift']());}}}(a27_0xef06,0xbb63c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a27_0x4f26(_0x35cc63,_0x2b0667){const _0xef06eb=a27_0xef06();return a27_0x4f26=function(_0x4f26da,_0xb9c0aa){_0x4f26da=_0x4f26da-0x145;let _0x5f41ee=_0xef06eb[_0x4f26da];return _0x5f41ee;},a27_0x4f26(_0x35cc63,_0x2b0667);}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0x4ea326(0x15d);[a27_0x4ea326(0x148)]=a27_0x4ea326(0x161);async['execute'](_0x3c2585){const _0x5ec769=a27_0x4ea326,{options:_0x15beb3,args:_0x3ee667,tdx:_0x54ee85}=_0x3c2585,_0x5ec885=_0x15beb3;if(_0x3ee667['length']===0x0)return console[_0x5ec769(0x151)](_0x5ec769(0x16a)),console[_0x5ec769(0x151)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x5ec769(0x151)](_0x5ec769(0x15a)),console[_0x5ec769(0x151)](_0x5ec769(0x14f)),console[_0x5ec769(0x151)](_0x5ec769(0x16c)),0x1;const _0xaa977f=_0x3ee667[0x0],_0x43261c=_0x15beb3[_0x5ec769(0x15b)];let _0x216c69=_0xaa977f;_0x43261c&&!_0xaa977f[_0x5ec769(0x16e)]('/')&&(_0x216c69=_0x43261c+'/'+_0xaa977f,_0x5ec885[_0x5ec769(0x163)]&&console[_0x5ec769(0x151)](_0x5ec769(0x146)+_0x216c69));const _0x1cda58=await withSpinner(_0x5ec769(0x164)+_0x216c69+_0x5ec769(0x171),()=>_0x54ee85[_0x5ec769(0x159)][_0x5ec769(0x15f)](_0x216c69),{'verbose':_0x5ec885[_0x5ec769(0x163)]}),_0x3f9225=_0x1cda58['data'];_0x5ec885[_0x5ec769(0x163)]&&console[_0x5ec769(0x151)](_0x5ec769(0x15c)+_0x3f9225[_0x5ec769(0x14a)]);if(_0x3f9225[_0x5ec769(0x14a)]!==_0x5ec769(0x159))return console[_0x5ec769(0x151)](_0x5ec769(0x153)+_0x3f9225[_0x5ec769(0x14a)]+_0x5ec769(0x152)),console[_0x5ec769(0x151)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3f9225[_0x5ec769(0x14d)])throw new SDKError(ErrorCode[_0x5ec769(0x16b)],_0x5ec769(0x168));const _0xf38fc3=_0x3f9225[_0x5ec769(0x15e)],_0x23f6bb=_0x3f9225[_0x5ec769(0x14d)];_0x5ec885[_0x5ec769(0x163)]&&(console['error']('Parent\x20ID:\x20'+_0xf38fc3),console[_0x5ec769(0x151)]('Segment\x20ID:\x20'+_0x23f6bb));let _0x126a3b;if(_0x5ec885['folder']){const _0x18f7e0=_0x5ec885[_0x5ec769(0x162)],_0x1670c8=await withSpinner(_0x5ec769(0x167)+_0x18f7e0+_0x5ec769(0x171),()=>_0x54ee85[_0x5ec769(0x159)][_0x5ec769(0x166)](_0xf38fc3,_0x18f7e0),{'verbose':_0x5ec885[_0x5ec769(0x163)]});_0x126a3b=parseInt(_0x1670c8[_0x5ec769(0x155)],0xa),_0x5ec885[_0x5ec769(0x163)]&&console[_0x5ec769(0x151)](_0x5ec769(0x165)+_0x126a3b);}const _0x245444=await loadJSONFromOptions(_0x5ec885[_0x5ec769(0x160)],_0x5ec885[_0x5ec769(0x14c)]),_0x31ed1f={'name':_0x5ec885[_0x5ec769(0x158)],'description':_0x5ec885[_0x5ec769(0x148)],'rule':_0x245444,'kind':_0x5ec885[_0x5ec769(0x170)]!==undefined?parseInt(_0x5ec885[_0x5ec769(0x170)],0xa):undefined,'segmentFolderId':_0x126a3b},_0x261458=await withSpinner(_0x5ec769(0x156)+_0x3f9225[_0x5ec769(0x16d)]+_0x5ec769(0x171),()=>_0x54ee85[_0x5ec769(0x159)]['updateSegmentById'](_0xf38fc3,_0x23f6bb,_0x31ed1f),{'verbose':_0x5ec885['verbose']}),_0x3bd63d=_0x261458[_0x5ec769(0x155)];return console[_0x5ec769(0x151)](_0x5ec769(0x16f)+_0x3bd63d[_0x5ec769(0x158)]+'\x27'),_0x216c69!==_0xaa977f&&console['error']('\x20\x20\x20Path:\x20'+_0x216c69),await handleSDKOutput([_0x3bd63d],_0x5ec885),0x0;}}function a27_0xef06(){const _0x578ac0=['data','Updating\x20segment\x20\x27','3088119vtOLzX','name','segment','Examples:','segmentPath','Resolved\x20type:\x20','segment:update','parentId','resolvePathToResource','rule','Update\x20existing\x20child\x20segment','folder','verbose','Resolving\x20path\x20\x27','Resolved\x20folder\x20ID:\x20','resolveFolderId','Resolving\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','5966048QSHvyL','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentName','includes','✔\x20Updated\x20segment\x20\x27','kind','\x27...','2224758akkpBn','Resolved\x20relative\x20path\x20to:\x20','11031021OcrYwN','description','14iBbDrv','type','656pEtBAi','ruleFile','segmentId','23515daKsSF','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','487912CzCARl','error','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','388754UyGyCJ'];a27_0xef06=function(){return _0x578ac0;};return a27_0xef06();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x4d9f16=a28_0x37e1;function a28_0x37e1(_0x7c8dbf,_0xeb48fc){const _0x2fe9e3=a28_0x2fe9();return a28_0x37e1=function(_0x37e1cd,_0x3f067a){_0x37e1cd=_0x37e1cd-0x15f;let _0x896ae1=_0x2fe9e3[_0x37e1cd];return _0x896ae1;},a28_0x37e1(_0x7c8dbf,_0xeb48fc);}(function(_0x57ad55,_0x193d35){const _0x1f38f6=a28_0x37e1,_0x291c45=_0x57ad55();while(!![]){try{const _0x882518=parseInt(_0x1f38f6(0x160))/0x1*(-parseInt(_0x1f38f6(0x17c))/0x2)+parseInt(_0x1f38f6(0x17a))/0x3+parseInt(_0x1f38f6(0x17b))/0x4*(parseInt(_0x1f38f6(0x180))/0x5)+parseInt(_0x1f38f6(0x16b))/0x6*(-parseInt(_0x1f38f6(0x161))/0x7)+-parseInt(_0x1f38f6(0x169))/0x8+-parseInt(_0x1f38f6(0x18a))/0x9*(parseInt(_0x1f38f6(0x171))/0xa)+parseInt(_0x1f38f6(0x189))/0xb;if(_0x882518===_0x193d35)break;else _0x291c45['push'](_0x291c45['shift']());}catch(_0x2d1063){_0x291c45['push'](_0x291c45['shift']());}}}(a28_0x2fe9,0x2652c));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{['name']=a28_0x4d9f16(0x18d);[a28_0x4d9f16(0x167)]=a28_0x4d9f16(0x17d);async[a28_0x4d9f16(0x183)](_0xebed9b){const _0x2cce9f=a28_0x4d9f16,{options:_0x25d644,args:_0x233e23,tdx:_0x1de6be}=_0xebed9b;if(_0x233e23[_0x2cce9f(0x175)]===0x0)return console[_0x2cce9f(0x16a)](_0x2cce9f(0x16c)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x162)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x16e)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x18f)),console[_0x2cce9f(0x16a)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error'](_0x2cce9f(0x192)),console['error'](_0x2cce9f(0x178)),0x1;const _0x27372b=_0x233e23[0x0],_0x1720ad=_0x25d644['session'];try{if(_0x27372b==='/')return saveSessionContext({'segment_path':undefined},_0x1720ad),console[_0x2cce9f(0x18c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x52c470=_0x25d644[_0x2cce9f(0x181)];let _0x23431b=_0x27372b;const _0x26ddd6=parsePath(_0x27372b);if(!_0x26ddd6[_0x2cce9f(0x173)]){if(!_0x52c470)return console[_0x2cce9f(0x16a)](_0x2cce9f(0x172)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x174)),0x1;if(_0x27372b==='..'){const _0x35fae8=_0x52c470[_0x2cce9f(0x170)]('/')[_0x2cce9f(0x190)](0x0,-0x1)[_0x2cce9f(0x179)]('/');_0x23431b=_0x35fae8||'/';}else _0x27372b==='.'?_0x23431b=_0x52c470:_0x23431b=_0x52c470+'/'+_0x27372b;_0x25d644[_0x2cce9f(0x166)]&&console['error'](_0x2cce9f(0x191)+_0x23431b);}if(_0x23431b==='/'||_0x23431b==='')return saveSessionContext({'segment_path':undefined},_0x1720ad),console[_0x2cce9f(0x18c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x23431b=normalizePath(_0x23431b);const _0x2723cb=parsePath(_0x23431b)[_0x2cce9f(0x188)];if(_0x2723cb[_0x2cce9f(0x175)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1720ad),console[_0x2cce9f(0x18c)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x25d644['verbose']&&(console[_0x2cce9f(0x16a)]('Site:\x20'+_0x25d644['site']),console['error']('Target\x20path:\x20'+_0x23431b));const _0x109f1e=await withSpinner(_0x2cce9f(0x185)+_0x23431b+_0x2cce9f(0x184),()=>_0x1de6be[_0x2cce9f(0x17f)][_0x2cce9f(0x16d)](_0x23431b),{'verbose':_0x25d644['verbose']}),_0x262cf9=_0x109f1e[_0x2cce9f(0x182)];_0x25d644['verbose']&&(console['error'](_0x2cce9f(0x18b)+_0x262cf9[_0x2cce9f(0x17e)]),console[_0x2cce9f(0x16a)](_0x2cce9f(0x176)+_0x262cf9['parentId']),_0x262cf9[_0x2cce9f(0x186)]&&console[_0x2cce9f(0x16a)](_0x2cce9f(0x177)+_0x262cf9['folderId']));if(_0x262cf9[_0x2cce9f(0x17e)]==='segment')return console[_0x2cce9f(0x16a)](_0x2cce9f(0x164)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x18e)),console[_0x2cce9f(0x16a)]('Use:\x20tdx\x20segment\x20use\x20'+_0x262cf9['parentName']+(_0x262cf9[_0x2cce9f(0x16f)]?'/'+_0x262cf9[_0x2cce9f(0x16f)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x262cf9['fullPath'],'parent_segment':_0x262cf9[_0x2cce9f(0x168)]},_0x1720ad),console['log'](_0x2cce9f(0x187)+_0x262cf9[_0x2cce9f(0x15f)]),_0x25d644['verbose']&&(console['error'](_0x2cce9f(0x163)),console[_0x2cce9f(0x16a)](_0x2cce9f(0x165)),console['error'](_0x2cce9f(0x193))),0x0;}catch(_0xcdc2b9){throw _0xcdc2b9;}}}function a28_0x2fe9(){const _0x277013=['type','segment','105FBLUMr','segmentPath','data','execute','\x27...','Resolving\x20path\x20\x27','folderId','Context\x20set\x20to:\x20','segments','5544143YBPAtF','130581aORrKX','Resolved\x20path\x20type:\x20','log','segment:use','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','slice','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','fullPath','139KgfEXz','13069CaFrkv','Usage:\x20tdx\x20segment\x20use\x20<path>','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','verbose','description','parentName','781904YcCtqL','error','774dqGTzY','Error:\x20Path\x20is\x20required','resolvePathToResource','Examples:','folderPath','split','140mXcoxp','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','isAbsolute','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','length','Parent\x20ID:\x20','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','join','254322oNyOlP','54636RbdbFc','2546qRvESL','Set\x20current\x20segment/folder\x20context\x20for\x20navigation'];a28_0x2fe9=function(){return _0x277013;};return a28_0x2fe9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0xf84c78=a29_0x80df;(function(_0x5f22ce,_0x567c60){const _0x425bcc=a29_0x80df,_0x1bb071=_0x5f22ce();while(!![]){try{const _0x148448=-parseInt(_0x425bcc(0x165))/0x1*(parseInt(_0x425bcc(0x175))/0x2)+-parseInt(_0x425bcc(0x15c))/0x3+parseInt(_0x425bcc(0x171))/0x4*(parseInt(_0x425bcc(0x142))/0x5)+-parseInt(_0x425bcc(0x14b))/0x6*(parseInt(_0x425bcc(0x148))/0x7)+parseInt(_0x425bcc(0x178))/0x8+parseInt(_0x425bcc(0x153))/0x9+parseInt(_0x425bcc(0x149))/0xa;if(_0x148448===_0x567c60)break;else _0x1bb071['push'](_0x1bb071['shift']());}catch(_0x18b141){_0x1bb071['push'](_0x1bb071['shift']());}}}(a29_0x2907,0xf347d));function a29_0x80df(_0x4937e3,_0x7cbc5f){const _0x2907ca=a29_0x2907();return a29_0x80df=function(_0x80dfcd,_0x3baaaf){_0x80dfcd=_0x80dfcd-0x140;let _0x3f0f7e=_0x2907ca[_0x80dfcd];return _0x3f0f7e;},a29_0x80df(_0x4937e3,_0x7cbc5f);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';function a29_0x2907(){const _0x25f8bc=['Folder\x20ID:\x20','log','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','42pikVBK','13477020xqpmum','No\x20parent\x20segments\x20match\x20pattern:\x20','797058ZLErAj','error','map','\x20parent\x20segment','listUnified','\x20segment','cause','localeCompare','5730579fzXXRp','replace','description','recursive','Listing\x20parent\x20segments...','Recursive\x20mode:\x20enabled','(empty)','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','site','1915956gavIbJ','sort','resolvePathToResource','folder','folderId','Listing\x20folders\x20and\x20segments...','segment','parentId','Listing\x20parent\x20segments\x20matching\x20\x27','7177KbNYGU','Building\x20hierarchy\x20tree...','verbose','listParents','✔\x20Built\x20tree\x20with\x20','Parent\x20ID:\x20','message','\x20matching\x20\x27','✔\x20Found\x20','Path/pattern\x20arg:\x20','json','listRecursive','12ARfVaJ','Resolving\x20context\x20path\x20\x27','data','segmentPath','76ookmQT','test','dim','2537088NPxiZR','listParentsWithPattern','execute','length','\x27...','population','👥\x20','jsonl','attributes','Error:\x20','[parent\x20segments]','name','672240nkxlRR','includes','format'];a29_0x2907=function(){return _0x25f8bc;};return a29_0x2907();}import a29_0x31bb3b from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0xf84c78(0x141)]='segments';[a29_0xf84c78(0x155)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a29_0xf84c78(0x17a)](_0x35932b){const _0x298757=a29_0xf84c78,{options:_0x2e3d50,args:_0x516794}=_0x35932b,_0x4d7ac2=_0x2e3d50[_0x298757(0x156)],_0x22a0b2=_0x516794[0x0];try{const _0x3b6876=_0x2e3d50[_0x298757(0x174)];_0x2e3d50[_0x298757(0x167)]&&(console['error']('Site:\x20'+_0x2e3d50[_0x298757(0x15b)]),console[_0x298757(0x14c)]('Current\x20context:\x20'+(_0x3b6876||'/')),_0x22a0b2&&console[_0x298757(0x14c)](_0x298757(0x16e)+_0x22a0b2),_0x4d7ac2&&console[_0x298757(0x14c)](_0x298757(0x158)));if(_0x22a0b2){const _0x508ffb=_0x22a0b2[_0x298757(0x143)]('*')||_0x22a0b2[_0x298757(0x143)]('?');if(_0x508ffb&&!_0x3b6876)return await this[_0x298757(0x179)](_0x35932b,_0x22a0b2);else return _0x508ffb?(console['error'](_0x298757(0x147)),console[_0x298757(0x14c)](_0x298757(0x15a)),0x1):_0x4d7ac2?await this['listRecursive'](_0x35932b,_0x22a0b2):await this[_0x298757(0x14f)](_0x35932b,_0x22a0b2);}if(!_0x3b6876)return await this[_0x298757(0x168)](_0x35932b);return _0x4d7ac2?await this[_0x298757(0x170)](_0x35932b,_0x3b6876):await this['listUnified'](_0x35932b,_0x3b6876);}catch(_0x12d0a0){if(_0x12d0a0 instanceof SDKError)return console[_0x298757(0x14c)](_0x298757(0x181)+_0x12d0a0[_0x298757(0x16b)]),_0x12d0a0[_0x298757(0x151)]&&console['error']('\x20\x20Cause:\x20'+_0x12d0a0[_0x298757(0x151)]),0x1;throw _0x12d0a0;}}async[a29_0xf84c78(0x179)](_0x542cd3,_0x575c69){const _0x2cc558=a29_0xf84c78,{options:_0x1b73c7,tdx:_0x169208}=_0x542cd3,_0x4ae15b=await withSpinner(_0x2cc558(0x164)+_0x575c69+'\x27...',()=>_0x169208[_0x2cc558(0x162)][_0x2cc558(0x168)](),{'verbose':_0x1b73c7['verbose']}),_0x580af9=_0x4ae15b[_0x2cc558(0x173)],_0x58abcc=_0x575c69['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x2cc558(0x154)](/\?/g,'.'),_0x5d7f7b=new RegExp('^'+_0x58abcc+'$','i'),_0x9d1c20=_0x580af9['filter'](_0x494d78=>_0x5d7f7b[_0x2cc558(0x176)](_0x494d78['attributes']['name']));console[_0x2cc558(0x14c)](_0x2cc558(0x16d)+_0x9d1c20[_0x2cc558(0x17b)]+_0x2cc558(0x14e)+(_0x9d1c20[_0x2cc558(0x17b)]!==0x1?'s':'')+_0x2cc558(0x16c)+_0x575c69+'\x27');if(_0x1b73c7[_0x2cc558(0x144)]==='json'||_0x1b73c7[_0x2cc558(0x144)]==='jsonl')await handleSDKOutput(_0x9d1c20,_0x1b73c7);else{if(_0x9d1c20[_0x2cc558(0x17b)]===0x0)console['log'](_0x2cc558(0x14a)+_0x575c69);else{console['log'](_0x2cc558(0x140));for(const _0x4bb183 of _0x9d1c20){const _0x4288e8=_0x4bb183['attributes'][_0x2cc558(0x17d)]?a29_0x31bb3b[_0x2cc558(0x177)]('\x20('+formatRows(_0x4bb183[_0x2cc558(0x180)]['population'])+')'):'';console[_0x2cc558(0x146)](_0x2cc558(0x17e)+_0x4bb183[_0x2cc558(0x180)][_0x2cc558(0x141)]+_0x4288e8);}}}return 0x0;}async[a29_0xf84c78(0x168)](_0x57a3b7){const _0x545582=a29_0xf84c78,{options:_0x4c5534,tdx:_0x16ae57}=_0x57a3b7,_0x8eaba5=await withSpinner(_0x545582(0x157),()=>_0x16ae57[_0x545582(0x162)][_0x545582(0x168)](),{'verbose':_0x4c5534[_0x545582(0x167)]}),_0x5093d3=_0x8eaba5[_0x545582(0x173)];console[_0x545582(0x14c)](_0x545582(0x16d)+_0x5093d3[_0x545582(0x17b)]+'\x20parent\x20segment'+(_0x5093d3[_0x545582(0x17b)]!==0x1?'s':''));if(_0x4c5534[_0x545582(0x144)]===_0x545582(0x16f)||_0x4c5534[_0x545582(0x144)]===_0x545582(0x17f))await handleSDKOutput(_0x5093d3,_0x4c5534);else{console[_0x545582(0x146)](_0x545582(0x140));for(const _0x3ce9a4 of _0x5093d3){const _0x550058=_0x3ce9a4[_0x545582(0x180)]['population']?a29_0x31bb3b[_0x545582(0x177)]('\x20('+formatRows(_0x3ce9a4['attributes'][_0x545582(0x17d)])+')'):'';console[_0x545582(0x146)](_0x545582(0x17e)+_0x3ce9a4[_0x545582(0x180)][_0x545582(0x141)]+_0x550058);}}return 0x0;}async[a29_0xf84c78(0x14f)](_0x655df9,_0x48a473){const _0x545d08=a29_0xf84c78,{options:_0x237186,tdx:_0x832194}=_0x655df9,_0x144a87=await withSpinner(_0x545d08(0x172)+_0x48a473+'\x27...',()=>_0x832194[_0x545d08(0x162)][_0x545d08(0x15e)](_0x48a473),{'verbose':_0x237186['verbose']}),_0x39cdd3=_0x144a87[_0x545d08(0x173)];_0x237186['verbose']&&(console[_0x545d08(0x14c)](_0x545d08(0x16a)+_0x39cdd3[_0x545d08(0x163)]),_0x39cdd3['folderId']&&console[_0x545d08(0x14c)](_0x545d08(0x145)+_0x39cdd3[_0x545d08(0x160)]));const _0x509565=await withSpinner(_0x545d08(0x161),()=>_0x832194['segment'][_0x545d08(0x14f)](_0x39cdd3[_0x545d08(0x163)],_0x39cdd3['folderId']),{'verbose':_0x237186[_0x545d08(0x167)]}),{folders:_0x58ec9c,segments:_0xd45f12}=_0x509565[_0x545d08(0x173)],_0x5c1c49=_0x58ec9c['length']+_0xd45f12[_0x545d08(0x17b)];console['error'](_0x545d08(0x16d)+_0x58ec9c[_0x545d08(0x17b)]+'\x20folder'+(_0x58ec9c[_0x545d08(0x17b)]!==0x1?'s':'')+'\x20and\x20'+_0xd45f12['length']+_0x545d08(0x150)+(_0xd45f12['length']!==0x1?'s':''));if(_0x237186['format']===_0x545d08(0x16f)||_0x237186[_0x545d08(0x144)]===_0x545d08(0x17f)){const _0x15d6fb=[..._0x58ec9c[_0x545d08(0x14d)](_0x34da7a=>({..._0x34da7a,'type':_0x545d08(0x15f)})),..._0xd45f12['map'](_0x4ac27d=>({..._0x4ac27d,'type':_0x545d08(0x162)}))][_0x545d08(0x15d)]((_0x3a4699,_0x37715f)=>_0x3a4699[_0x545d08(0x141)][_0x545d08(0x152)](_0x37715f[_0x545d08(0x141)]));await handleSDKOutput(_0x15d6fb,_0x237186);}else{if(_0x5c1c49===0x0)console[_0x545d08(0x146)](a29_0x31bb3b[_0x545d08(0x177)]('[/'+_0x48a473+']')),console[_0x545d08(0x146)](_0x545d08(0x159));else{console[_0x545d08(0x146)](a29_0x31bb3b[_0x545d08(0x177)]('[/'+_0x48a473+']'));const _0xeede00=formatFlatList(_0x58ec9c,_0xd45f12,{'showMetadata':!![]});console[_0x545d08(0x146)](_0xeede00);}}return 0x0;}async['listRecursive'](_0x5bb62e,_0x427637){const _0x40c732=a29_0xf84c78,{options:_0x4a5b33,tdx:_0x1ae9ad}=_0x5bb62e,_0x25e233=await withSpinner(_0x40c732(0x172)+_0x427637+_0x40c732(0x17c),()=>_0x1ae9ad[_0x40c732(0x162)]['resolvePathToResource'](_0x427637),{'verbose':_0x4a5b33[_0x40c732(0x167)]}),_0x251f67=_0x25e233['data'];_0x4a5b33[_0x40c732(0x167)]&&(console['error'](_0x40c732(0x16a)+_0x251f67[_0x40c732(0x163)]),_0x251f67[_0x40c732(0x160)]&&console[_0x40c732(0x14c)](_0x40c732(0x145)+_0x251f67['folderId']));const _0x3279c6=_0x4a5b33['maxDepth']||0xa,_0x59d7d9=await withSpinner(_0x40c732(0x166),()=>_0x1ae9ad[_0x40c732(0x162)][_0x40c732(0x170)](_0x251f67['parentId'],_0x251f67['folderId'],0x0,_0x3279c6),{'verbose':_0x4a5b33[_0x40c732(0x167)]}),_0x3faf71=_0x59d7d9[_0x40c732(0x173)];console[_0x40c732(0x14c)](_0x40c732(0x169)+_0x3faf71[_0x40c732(0x17b)]+'\x20top-level\x20items');if(_0x4a5b33[_0x40c732(0x144)]===_0x40c732(0x16f)||_0x4a5b33[_0x40c732(0x144)]===_0x40c732(0x17f))await handleSDKOutput(_0x3faf71,_0x4a5b33);else{console[_0x40c732(0x146)](a29_0x31bb3b[_0x40c732(0x177)]('[/'+_0x427637+']'));const _0x40d2f9=formatTree(_0x3faf71,{'showMetadata':!![]});console[_0x40c732(0x146)](_0x40d2f9);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x27b6a9=a30_0x1bbd;(function(_0x502da1,_0x1b1702){const _0x188db0=a30_0x1bbd,_0x31228b=_0x502da1();while(!![]){try{const _0x3ef125=-parseInt(_0x188db0(0xbc))/0x1+parseInt(_0x188db0(0xb6))/0x2*(-parseInt(_0x188db0(0xca))/0x3)+parseInt(_0x188db0(0xc2))/0x4+parseInt(_0x188db0(0xb1))/0x5+parseInt(_0x188db0(0xcf))/0x6*(-parseInt(_0x188db0(0xc6))/0x7)+parseInt(_0x188db0(0xb2))/0x8+-parseInt(_0x188db0(0xbb))/0x9*(-parseInt(_0x188db0(0xc7))/0xa);if(_0x3ef125===_0x1b1702)break;else _0x31228b['push'](_0x31228b['shift']());}catch(_0x43a616){_0x31228b['push'](_0x31228b['shift']());}}}(a30_0x96ea,0x65c32));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a30_0x96ea(){const _0x1c6314=['✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','33692lTQnJW','Site:\x20','site','execute','name','67950akNNNm','656366WnVSTF','table','\x20\x20Cause:\x20','Show\x20table\x20contents','error','args','2798792ENNynp','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','data','✔\x20Retrieved\x20','21CvgEJs','1440BxVpfD','message','cause','105hOdyEc','Usage:\x20tdx\x20show\x20<database.table>','\x20row','show','showTable','1604838ZYUMgA','Catalog:\x20','...','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','database','Error:\x20','length','1233580hciASi','3452792KquALt','\x20from\x20','Querying\x20'];a30_0x96ea=function(){return _0x1c6314;};return a30_0x96ea();}function a30_0x1bbd(_0x11d40d,_0x3796db){const _0x96ea17=a30_0x96ea();return a30_0x1bbd=function(_0x1bbd77,_0x26ff0b){_0x1bbd77=_0x1bbd77-0xab;let _0x53a665=_0x96ea17[_0x1bbd77];return _0x53a665;},a30_0x1bbd(_0x11d40d,_0x3796db);}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a30_0x27b6a9(0xba)]=a30_0x27b6a9(0xcd);['description']=a30_0x27b6a9(0xbf);async[a30_0x27b6a9(0xb9)](_0x48d375){return this['showTable'](_0x48d375);}async[a30_0x27b6a9(0xce)](_0x336e98){const _0x2ea7e2=a30_0x27b6a9,{options:_0x559687,args:_0x3cc433,tdx:_0x52a9db}=_0x336e98;let _0x862563;try{_0x862563=parseTableReference(_0x3cc433[0x0]);const _0x16fa75=_0x559687[_0x2ea7e2(0xae)];!_0x862563[_0x2ea7e2(0xae)]&&_0x16fa75&&(_0x862563[_0x2ea7e2(0xae)]=_0x16fa75);const _0x9e819b=validateTableDescribeReference(_0x862563);if(_0x9e819b)return console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xaf)+_0x9e819b),console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xcb)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x2ea7e2(0xc0)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x4baa9b){return console[_0x2ea7e2(0xc0)]('Error:\x20'+_0x4baa9b[_0x2ea7e2(0xc8)]),console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xcb)),console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xc3)),console[_0x2ea7e2(0xc0)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x2fb66d=_0x862563['catalog'],_0x96c9ed=_0x862563[_0x2ea7e2(0xae)],_0x42df2d=_0x862563[_0x2ea7e2(0xbd)],_0x473758=resolveLimit(_0x559687['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x559687['verbose']&&(console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xb7)+_0x559687[_0x2ea7e2(0xb8)]),_0x2fb66d&&console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xab)+_0x2fb66d),console[_0x2ea7e2(0xc0)]('Database:\x20'+_0x96c9ed),console[_0x2ea7e2(0xc0)]('Table:\x20'+_0x42df2d),console[_0x2ea7e2(0xc0)]('Limit:\x20'+_0x473758));const _0x3d8619=_0x2fb66d?_0x2fb66d+'.'+_0x96c9ed+'.'+_0x42df2d:_0x96c9ed+'.'+_0x42df2d,_0xc6fca3=await withSpinner(_0x2ea7e2(0xb4)+_0x3d8619+_0x2ea7e2(0xac),()=>_0x52a9db['query'][_0x2ea7e2(0xce)](_0x96c9ed,_0x42df2d,_0x473758,_0x2fb66d),{'verbose':_0x559687['verbose']}),_0x2fbacd=_0xc6fca3[_0x2ea7e2(0xc4)],_0x3dfe09=_0x2fbacd[_0x2ea7e2(0xc4)];return _0x3dfe09[_0x2ea7e2(0xb0)]===0x0?console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xb5)):console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xc5)+_0x3dfe09['length']+_0x2ea7e2(0xcc)+(_0x3dfe09[_0x2ea7e2(0xb0)]!==0x1?'s':'')+_0x2ea7e2(0xb3)+_0x3d8619),await handleSDKOutput(_0x3dfe09,_0x559687),0x0;}catch(_0x21d4f4){if(_0x21d4f4 instanceof SDKError)return console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xaf)+_0x21d4f4[_0x2ea7e2(0xc8)]),_0x21d4f4[_0x2ea7e2(0xc9)]&&console[_0x2ea7e2(0xc0)](_0x2ea7e2(0xbe)+_0x21d4f4[_0x2ea7e2(0xc9)]),0x1;throw _0x21d4f4;}}['validate'](_0x20a777){const _0x18f656=a30_0x27b6a9;if(_0x20a777['args']['length']===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x20a777[_0x18f656(0xc1)]['length']>0x1)return _0x18f656(0xad);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a31_0x50aa3c=a31_0xface;(function(_0x9e0b0,_0x1dd120){const _0x1ac5bd=a31_0xface,_0x39ec5f=_0x9e0b0();while(!![]){try{const _0x3818ef=parseInt(_0x1ac5bd(0x8f))/0x1+parseInt(_0x1ac5bd(0x8a))/0x2+parseInt(_0x1ac5bd(0x94))/0x3+-parseInt(_0x1ac5bd(0x9e))/0x4*(parseInt(_0x1ac5bd(0x92))/0x5)+parseInt(_0x1ac5bd(0x9f))/0x6*(parseInt(_0x1ac5bd(0xae))/0x7)+parseInt(_0x1ac5bd(0xa1))/0x8*(-parseInt(_0x1ac5bd(0xb8))/0x9)+parseInt(_0x1ac5bd(0x95))/0xa;if(_0x3818ef===_0x1dd120)break;else _0x39ec5f['push'](_0x39ec5f['shift']());}catch(_0x16cf00){_0x39ec5f['push'](_0x39ec5f['shift']());}}}(a31_0x53d6,0xe67d7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a31_0x53d6(){const _0x42254e=['Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','database','limit','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','.*\x22','✖\x20No\x20tables\x20found','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Database\x20\x27','1779001sBHsWS','Error:\x20Pattern\x20\x27','listTables','Database:\x20all','table','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Site:\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x27\x20is\x20ambiguous.','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','14103486dpqMOY','114406rmTVZm','site','cause','✔\x20Found\x20','Listing\x20tables...','422194XncjOe','execute','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','32105qeDhWa','List\x20tables\x20in\x20a\x20database','5562633gPrTfq','12231290qVOgqF','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Error:\x20','Or\x20use\x20--in\x20flag:','data','message','includes','Table\x20pattern:\x20','verbose','968EtBsos','12AkyrDT','description','8DYSouh','error','length','name'];a31_0x53d6=function(){return _0x42254e;};return a31_0x53d6();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a31_0xface(_0x415ec7,_0x5387ec){const _0x53d618=a31_0x53d6();return a31_0xface=function(_0xface7d,_0x39c5ae){_0xface7d=_0xface7d-0x8a;let _0x3f9806=_0x53d618[_0xface7d];return _0x3f9806;},a31_0xface(_0x415ec7,_0x5387ec);}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a31_0x50aa3c(0xa4)]='tables';[a31_0x50aa3c(0xa0)]=a31_0x50aa3c(0x93);async[a31_0x50aa3c(0x90)](_0x37cfa4){const _0x31cad6=a31_0x50aa3c,{options:_0x1315b1,args:_0x55dcee,tdx:_0x5f52a9}=_0x37cfa4;let _0x266494;if(_0x55dcee[_0x31cad6(0xa3)]===0x0)_0x266494={'database':undefined,'table':undefined,'original':''};else{if(_0x55dcee[_0x31cad6(0xa3)]===0x1)try{_0x266494=parseTableReference(_0x55dcee[0x0]);if(_0x266494[_0x31cad6(0xb2)]&&!_0x266494[_0x31cad6(0xa7)]&&!_0x266494[_0x31cad6(0xb2)][_0x31cad6(0x9b)]('*')&&!_0x266494[_0x31cad6(0xb2)][_0x31cad6(0x9b)]('?'))return console['error'](_0x31cad6(0xaf)+_0x55dcee[0x0]+_0x31cad6(0xb6)),console[_0x31cad6(0xa2)](_0x31cad6(0xa5)+_0x266494[_0x31cad6(0xb2)]+'\x27?'),console[_0x31cad6(0xa2)](_0x31cad6(0xb5)+_0x266494[_0x31cad6(0xb2)]+_0x31cad6(0xaa)),console[_0x31cad6(0xa2)](_0x31cad6(0x91)+_0x266494[_0x31cad6(0xb2)]),console[_0x31cad6(0xa2)](_0x31cad6(0xb7)+_0x266494['table']),console['error'](''),console[_0x31cad6(0xa2)]('Note:\x20\x27'+_0x55dcee[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x266494['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x381f49){return console[_0x31cad6(0xa2)]('Error:\x20'+_0x381f49[_0x31cad6(0x9a)]),0x1;}else return console[_0x31cad6(0xa2)](_0x31cad6(0xac)),console[_0x31cad6(0xa2)](_0x31cad6(0xa6)),console[_0x31cad6(0xa2)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console['error'](_0x31cad6(0xa9)),console[_0x31cad6(0xa2)](_0x31cad6(0xb3)),console[_0x31cad6(0xa2)](_0x31cad6(0x98)),console[_0x31cad6(0xa2)](_0x31cad6(0x96)),0x1;}const _0x22afcd=_0x1315b1[_0x31cad6(0xa7)];!_0x266494[_0x31cad6(0xa7)]&&_0x22afcd&&(_0x266494[_0x31cad6(0xa7)]=_0x22afcd);try{const _0x12cb1c=_0x272d7e=>_0x272d7e&&(_0x272d7e['includes']('*')||_0x272d7e[_0x31cad6(0x9b)]('?')),_0x2473bf=_0x12cb1c(_0x266494[_0x31cad6(0xa7)]);_0x1315b1[_0x31cad6(0x9d)]&&(console[_0x31cad6(0xa2)](_0x31cad6(0xb4)+_0x1315b1[_0x31cad6(0x8b)]),_0x266494[_0x31cad6(0xa7)]?_0x2473bf?console[_0x31cad6(0xa2)]('Database\x20pattern:\x20'+_0x266494[_0x31cad6(0xa7)]):console[_0x31cad6(0xa2)]('Database:\x20'+_0x266494[_0x31cad6(0xa7)]):console['error'](_0x31cad6(0xb1)),_0x266494['table']&&console[_0x31cad6(0xa2)](_0x31cad6(0x9c)+_0x266494['table']));const _0x3217e7=_0x266494['database']&&!_0x2473bf?_0x266494[_0x31cad6(0xa7)]:undefined,_0x17b7e6=_0x2473bf?_0x266494[_0x31cad6(0xa7)]:undefined,_0x5362c8=_0x266494['table'],_0xb9b217=resolveLimit(_0x1315b1[_0x31cad6(0xa8)],DEFAULT_LISTING_LIMIT),_0x1c75e8=await withSpinner(_0x31cad6(0x8e),()=>_0x5f52a9['query'][_0x31cad6(0xb0)](_0x3217e7,_0x5362c8,_0x17b7e6,_0xb9b217),{'verbose':_0x1315b1[_0x31cad6(0x9d)]}),_0x47e065=_0x1c75e8[_0x31cad6(0x99)];if(_0x47e065[_0x31cad6(0xa3)]===0x0&&_0x266494[_0x31cad6(0xa7)]&&!_0x2473bf)return console[_0x31cad6(0xa2)](_0x31cad6(0xab)),console[_0x31cad6(0xa2)](_0x31cad6(0xad)+_0x266494[_0x31cad6(0xa7)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console['error'](_0x31cad6(0x8d)+_0x47e065[_0x31cad6(0xa3)]+'\x20table'+(_0x47e065[_0x31cad6(0xa3)]!==0x1?'s':'')),await handleSDKOutput(_0x47e065,{..._0x1315b1,'limit':_0xb9b217}),0x0;}catch(_0x3eb98b){if(_0x3eb98b instanceof SDKError)return console[_0x31cad6(0xa2)](_0x31cad6(0x97)+_0x3eb98b['message']),_0x3eb98b['cause']&&console[_0x31cad6(0xa2)]('\x20\x20Cause:\x20'+_0x3eb98b[_0x31cad6(0x8c)]),0x1;throw _0x3eb98b;}}['validate'](_0x36fbf0){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a32_0x5830(_0x1bbeaf,_0x1d3458){const _0x5a4526=a32_0x5a45();return a32_0x5830=function(_0x583086,_0x3fe8d7){_0x583086=_0x583086-0xac;let _0x4e446a=_0x5a4526[_0x583086];return _0x4e446a;},a32_0x5830(_0x1bbeaf,_0x1d3458);}const a32_0xae3c99=a32_0x5830;function a32_0x5a45(){const _0x4003e3=['join','database','execute','Session\x20llm_project\x20set\x20to:\x20','\x27\x20does\x20not\x20exist','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','length','763978woypLJ','8kOJwdU','Session\x20parent_segment\x20set\x20to:\x20','log','\x20(session:\x20','5312916dIRfCW','error','291TCPRTq','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','profile','1606ahmszn','name','139454fgwRTn','Invalid\x20resource:\x20','session','155276eErmGP','Error:\x20Profile\x20\x27','Session\x20database\x20set\x20to:\x20','parent_segment','toString','2912904WlsHLf','12954700doNBPZ','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','llm_project','15KBvqEx','.\x20Must\x20be\x20one\x20of:\x20'];a32_0x5a45=function(){return _0x4003e3;};return a32_0x5a45();}(function(_0x35fb66,_0x5a1a06){const _0x56c582=a32_0x5830,_0x57d8f6=_0x35fb66();while(!![]){try{const _0x392bd5=parseInt(_0x56c582(0xcc))/0x1+parseInt(_0x56c582(0xb3))/0x2*(-parseInt(_0x56c582(0xb0))/0x3)+-parseInt(_0x56c582(0xb8))/0x4*(parseInt(_0x56c582(0xc1))/0x5)+parseInt(_0x56c582(0xae))/0x6+parseInt(_0x56c582(0xb5))/0x7*(-parseInt(_0x56c582(0xcd))/0x8)+parseInt(_0x56c582(0xbd))/0x9+-parseInt(_0x56c582(0xbe))/0xa;if(_0x392bd5===_0x5a1a06)break;else _0x57d8f6['push'](_0x57d8f6['shift']());}catch(_0x4519d4){_0x57d8f6['push'](_0x57d8f6['shift']());}}}(a32_0x5a45,0x71214));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a32_0xae3c99(0xb4)]='use';['description']='Set\x20session-level\x20context';['validate'](_0x1e094c){const _0x2ec330=a32_0xae3c99,{args:_0x46339e}=_0x1e094c;if(_0x46339e[_0x2ec330(0xcb)]<0x2)return _0x2ec330(0xb1)+_0x2ec330(0xbf)+_0x2ec330(0xc9)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x27411f=_0x46339e[0x0],_0x1fbad1=[_0x2ec330(0xc4),_0x2ec330(0xbb),_0x2ec330(0xc0),'profile'];if(!_0x1fbad1['includes'](_0x27411f))return _0x2ec330(0xb6)+_0x27411f+_0x2ec330(0xc2)+_0x1fbad1[_0x2ec330(0xc3)](',\x20');return undefined;}async[a32_0xae3c99(0xc5)](_0x24a3d6){const _0x1c498c=a32_0xae3c99,{args:_0x10de50,options:_0x292726}=_0x24a3d6;try{const _0x5cc847=_0x10de50[0x0],_0x3eec8e=_0x10de50[0x1];if(_0x5cc847===_0x1c498c(0xb2)){if(!profileExists(_0x3eec8e))return console['error'](_0x1c498c(0xb9)+_0x3eec8e+_0x1c498c(0xc7)),console[_0x1c498c(0xaf)](_0x1c498c(0xca)),0x1;const _0x4b7329=_0x292726[_0x1c498c(0xb7)]||getCurrentSessionPID()[_0x1c498c(0xbc)]();return saveSessionContext({'profile':_0x3eec8e},_0x292726['session']),console['log']('Session\x20profile\x20set\x20to:\x20'+_0x3eec8e+_0x1c498c(0xad)+_0x4b7329+')'),console[_0x1c498c(0xac)](_0x1c498c(0xc8)),0x0;}const _0x50344d={},_0x45936d=_0x292726['session']||getCurrentSessionPID()[_0x1c498c(0xbc)]();switch(_0x5cc847){case _0x1c498c(0xc4):_0x50344d[_0x1c498c(0xc4)]=_0x3eec8e,console[_0x1c498c(0xac)](_0x1c498c(0xba)+_0x3eec8e+_0x1c498c(0xad)+_0x45936d+')');break;case _0x1c498c(0xbb):_0x50344d['parent_segment']=_0x3eec8e,console[_0x1c498c(0xac)](_0x1c498c(0xce)+_0x3eec8e+_0x1c498c(0xad)+_0x45936d+')');break;case'llm_project':_0x50344d['llm_project']=_0x3eec8e,console[_0x1c498c(0xac)](_0x1c498c(0xc6)+_0x3eec8e+_0x1c498c(0xad)+_0x45936d+')');break;}return saveSessionContext(_0x50344d,_0x292726[_0x1c498c(0xb7)]),console[_0x1c498c(0xac)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x414d8d){return _0x414d8d instanceof Error&&console['error']('Error:\x20'+_0x414d8d['message']),0x1;}}}
|