@treasuredata/tdx 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pwd-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tdx-logger.js.map +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_0x58236f=a22_0x42bc;(function(_0x20f353,_0x4bd2c0){const _0x2b8168=a22_0x42bc,_0x122326=_0x20f353();while(!![]){try{const _0x1420f8=-parseInt(_0x2b8168(0x1ce))/0x1+-parseInt(_0x2b8168(0x1d2))/0x2+-parseInt(_0x2b8168(0x1dd))/0x3+parseInt(_0x2b8168(0x1c3))/0x4+-parseInt(_0x2b8168(0x1c6))/0x5*(parseInt(_0x2b8168(0x1c2))/0x6)+parseInt(_0x2b8168(0x1c4))/0x7*(parseInt(_0x2b8168(0x1b8))/0x8)+parseInt(_0x2b8168(0x1b3))/0x9*(parseInt(_0x2b8168(0x1de))/0xa);if(_0x1420f8===_0x4bd2c0)break;else _0x122326['push'](_0x122326['shift']());}catch(_0xae8847){_0x122326['push'](_0x122326['shift']());}}}(a22_0x3feb,0x692a8));import{BaseCommand}from'./command.js';function a22_0x42bc(_0x2539c2,_0x5698bb){const _0x3feb5e=a22_0x3feb();return a22_0x42bc=function(_0x42bcf3,_0x35d425){_0x42bcf3=_0x42bcf3-0x1ad;let _0x329961=_0x3feb5e[_0x42bcf3];return _0x329961;},a22_0x42bc(_0x2539c2,_0x5698bb);}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';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';function a22_0x3feb(){const _0x21d648=['setExtra','error','stats','47475GuAAYz','108470gzWpDr','in\x20','file','elapsedTimeMillis','data','name','jobId','catalog','message','1503hoViAI','processedRows','Query\x20completed:\x20Processed\x20','\x20splits','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','8WUnCuD','length','args','join','Catalog:\x20','setJobId','\x20rows\x20','totalSplits','state','Statement\x20','6tqfeYs','1460344ApaLNK','551215GUgDLX','information_schema','4245560wSrlQh','verbose','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','description','setPhase','database','completedSplits','Schema:\x20','494325zNKwbH','query','\x0aAll\x20results\x20saved\x20to\x20','output','930516vVTNxv','Site:\x20','SQL:\x20','Executing\x20query\x20[','site','Error:\x20','options','Executing\x20query...'];a22_0x3feb=function(){return _0x21d648;};return a22_0x3feb();}export class QueryCommand extends BaseCommand{[a22_0x58236f(0x1af)]=a22_0x58236f(0x1cf);[a22_0x58236f(0x1c9)]='Run\x20Trino\x20queries\x20(streaming)';async['execute'](_0x4ede67){const _0x1fcbb7=a22_0x58236f,{options:_0x27b6c7,args:_0x1166ba,tdx:_0x4f4fbe}=_0x4ede67,_0x98e7d1=_0x1166ba[0x0],_0x54b0aa=_0x27b6c7[_0x1fcbb7(0x1e0)];let _0xd65441;if(_0x54b0aa)try{_0xd65441=readSqlStatementsFromFile(_0x54b0aa);}catch(_0x2f2a34){return console['error'](_0x1fcbb7(0x1d7)+_0x2f2a34[_0x1fcbb7(0x1b2)]),0x1;}else try{_0xd65441=splitSqlStatements(_0x98e7d1);}catch(_0x264388){return console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1d7)+_0x264388[_0x1fcbb7(0x1b2)]),0x1;}const _0x273f6c=_0x27b6c7[_0x1fcbb7(0x1cb)]||_0x1fcbb7(0x1c5),_0x36105b=_0x27b6c7[_0x1fcbb7(0x1b1)];try{const _0x1b6c81=[],_0x1f4371=!!_0x27b6c7[_0x1fcbb7(0x1d1)];for(let _0x41c134=0x0;_0x41c134<_0xd65441[_0x1fcbb7(0x1b9)];_0x41c134++){const _0x49bd41=_0xd65441[_0x41c134],_0x44572a=_0x41c134+0x1,_0xeedcf8=_0xd65441[_0x1fcbb7(0x1b9)],_0x425442=_0xeedcf8>0x1;_0x27b6c7[_0x1fcbb7(0x1c7)]&&(console[_0x1fcbb7(0x1db)]('\x0a'+(_0x425442?'Statement\x20'+_0x44572a+'/'+_0xeedcf8+':':'')),console['error'](_0x1fcbb7(0x1d3)+_0x27b6c7[_0x1fcbb7(0x1d6)]),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1bc)+(_0x36105b||'td')),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1cd)+_0x273f6c),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1d4)+_0x49bd41));const _0x4a0a6e=_0x425442?'Executing\x20statement\x20'+_0x44572a+'/'+_0xeedcf8+'...':_0x1fcbb7(0x1d9);try{const _0x1b689d=await withQuerySpinner(_0x4a0a6e,async _0x4bd638=>{const _0x2d4ac0=_0x1fcbb7,_0x37826e=await _0x4f4fbe[_0x2d4ac0(0x1cf)]['execute'](_0x49bd41,{'catalog':_0x36105b,'schema':_0x273f6c,'onJobId':_0x244cb2=>{const _0x370e45=_0x2d4ac0;_0x4bd638[_0x370e45(0x1bd)](_0x244cb2);},'onProgress':_0x5a4d67=>{const _0x2b0d24=_0x2d4ac0;_0x4bd638[_0x2b0d24(0x1ca)](_0x2b0d24(0x1d5)+_0x5a4d67[_0x2b0d24(0x1c0)]+']'),_0x4bd638[_0x2b0d24(0x1da)](formatRows(_0x5a4d67[_0x2b0d24(0x1b4)])+'\x20rows\x20'+_0x5a4d67[_0x2b0d24(0x1cc)]+'/'+_0x5a4d67[_0x2b0d24(0x1bf)]+_0x2b0d24(0x1b6));}});return _0x37826e;},{'verbose':_0x27b6c7[_0x1fcbb7(0x1c7)]}),_0x4ecaee=_0x1b689d[_0x1fcbb7(0x1ae)],_0x360768=_0x4ecaee[_0x1fcbb7(0x1b0)]?'\x20[Job\x20ID:\x20'+_0x4ecaee[_0x1fcbb7(0x1b0)]+']':'',_0xc7d4c6=_0x425442?_0x1fcbb7(0x1c1)+_0x44572a+'/'+_0xeedcf8+'\x20-\x20':'';console[_0x1fcbb7(0x1db)]('✔\x20'+_0xc7d4c6+_0x1fcbb7(0x1b5)+formatRows(_0x4ecaee['stats'][_0x1fcbb7(0x1b4)])+_0x1fcbb7(0x1be)+(_0x1fcbb7(0x1df)+formatElapsed(_0x4ecaee[_0x1fcbb7(0x1dc)][_0x1fcbb7(0x1ad)])+_0x360768));if(_0x425442&&_0x1f4371){const _0x184f17=resolveOutputOptions(_0x27b6c7),_0xab2eb=await formatQueryOutput(_0x4ecaee,_0x184f17);_0x1b6c81['push'](_0xab2eb);}else await handleQueryOutput(_0x4ecaee,_0x27b6c7);}catch(_0x35fc5d){const _0x52a312=_0x425442?_0x1fcbb7(0x1c1)+_0x44572a+'/'+_0xeedcf8+':\x0a':'',_0x4a83f9=_0x35fc5d instanceof SDKError?_0x35fc5d['originalMessage']:_0x35fc5d[_0x1fcbb7(0x1b2)];return console[_0x1fcbb7(0x1db)](''+_0x52a312+_0x4a83f9),0x1;}}if(_0xd65441[_0x1fcbb7(0x1b9)]>0x1&&_0x1f4371&&_0x1b6c81['length']>0x0){const _0x2e5fdb=_0x1b6c81[_0x1fcbb7(0x1bb)]('\x0a');writeFileSync(_0x27b6c7['output'],_0x2e5fdb),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1d0)+_0x27b6c7[_0x1fcbb7(0x1d1)]);}return 0x0;}catch(_0x3d894f){throw _0x3d894f;}}['validate'](_0x59f54f){const _0x6c52b5=a22_0x58236f,_0x5d7d14=_0x59f54f[_0x6c52b5(0x1ba)][0x0],_0x1385c0=_0x59f54f[_0x6c52b5(0x1d8)]['file'];if(!_0x5d7d14&&!_0x1385c0)return _0x6c52b5(0x1c8);if(_0x5d7d14&&_0x1385c0)return _0x6c52b5(0x1b7);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x62bb42=a23_0x42b5;function a23_0x2c1d(){const _0x42b721=['\x20folder','\x20rows\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Fetching\x20parent\x20segment\x20details...','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20type:\x20','limit','1889260MiwHcn','Error:\x20Path\x20or\x20name\x20is\x20required','Resolved\x20relative\x20path\x20to:\x20','jobId','getParent','execute','message','includes','setJobId','✖\x20Query\x20failed\x20[','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Examples:','getParentSQL','parent','Folder\x20ID:\x20','segment:describe','Folder\x20name:\x20','75PwrboY','Creating\x20folder\x20\x27','Resolved\x20parent\x20ID:\x20','in\x20','replace','segment','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','folder','\x27...','getSegment','jsonl','segment:sql','Resolving\x20folder\x20\x27','folderId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolveFolderId','log','Executing\x20segment\x20query...','toLocaleString','Fetching\x20SQL\x20for\x20parent\x20segment...','parentId','resolveParentId','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','379SCzQhl','INTERNAL','description','25685165HRQXsi','Parent\x20ID:\x20','data','Usage:\x20tdx\x20segment\x20describe\x20<path>','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x27\x20with\x20ID:\x20','elapsedTimeMillis','type','processedRows','Create\x20segment\x20folder\x20for\x20organization','Resolved\x20folder\x20ID:\x20','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Fetching\x20SQL\x20for\x20segment...','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','12AtuWjZ','Parent\x20segment:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','site','Error:\x20','Listing\x20folders\x20for\x20parent\x20\x27','code','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','6268598XLFSiD','test','cause','\x20\x20Cause:\x20','verbose','Fetching\x20folder\x20details...','63vRaEjo','181752paWuWz','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getSegmentSQL','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','parentFolder','getFolder','Parent\x20name:\x20','resolvePathToResource','segmentPath','Resolving\x20parent\x20segment\x20\x27','Fetching\x20segment\x20details...','Resolving\x20path\x20\x27','2532JgawbF','information_schema','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','6143964xWKwxB','Resolving\x20parent\x20folder\x20\x27','✔\x20Created\x20folder\x20\x27','stats','SQL\x20query:\x0a','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','6338400EgnFFJ','error','name','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','segmentId','length','segment:folder:list','Site:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20show\x20<path>','5IMVZcC'];a23_0x2c1d=function(){return _0x42b721;};return a23_0x2c1d();}(function(_0x1813f4,_0x158c01){const _0x4940e2=a23_0x42b5,_0x44a436=_0x1813f4();while(!![]){try{const _0x5f5951=parseInt(_0x4940e2(0xca))/0x1*(-parseInt(_0x4940e2(0xf8))/0x2)+-parseInt(_0x4940e2(0x128))/0x3*(-parseInt(_0x4940e2(0xeb))/0x4)+parseInt(_0x4940e2(0x10e))/0x5*(-parseInt(_0x4940e2(0xfc))/0x6)+parseInt(_0x4940e2(0xe4))/0x7+-parseInt(_0x4940e2(0x102))/0x8+parseInt(_0x4940e2(0xea))/0x9*(-parseInt(_0x4940e2(0x117))/0xa)+parseInt(_0x4940e2(0xcd))/0xb*(parseInt(_0x4940e2(0xdb))/0xc);if(_0x5f5951===_0x158c01)break;else _0x44a436['push'](_0x44a436['shift']());}catch(_0x1f81ac){_0x44a436['push'](_0x44a436['shift']());}}}(a23_0x2c1d,0xb6971));function a23_0x42b5(_0x281536,_0x45ed1e){const _0x2c1d40=a23_0x2c1d();return a23_0x42b5=function(_0x42b5b8,_0x283a40){_0x42b5b8=_0x42b5b8-0xb6;let _0x14822f=_0x2c1d40[_0x42b5b8];return _0x14822f;},a23_0x42b5(_0x281536,_0x45ed1e);}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}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_0x62bb42(0x104)]=a23_0x62bb42(0x126);[a23_0x62bb42(0xcc)]='Show\x20segment\x20or\x20folder\x20details';async[a23_0x62bb42(0x11c)](_0x919f8c){const _0x387887=a23_0x62bb42,{options:_0x4994ed,args:_0x7ac881,tdx:_0x5e54f3}=_0x919f8c;if(_0x7ac881[_0x387887(0x108)]===0x0)return console[_0x387887(0x103)](_0x387887(0x118)),console[_0x387887(0x103)](_0x387887(0xd0)),console[_0x387887(0x103)]('Examples:'),console[_0x387887(0x103)](_0x387887(0x111)),console[_0x387887(0x103)](_0x387887(0x101)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x41a7ca=_0x7ac881[0x0],_0x446bbb=_0x4994ed['segmentPath'];let _0x4fea9b=_0x41a7ca;_0x446bbb&&!_0x41a7ca[_0x387887(0x11e)]('/')&&(_0x4fea9b=_0x446bbb+'/'+_0x41a7ca,_0x4994ed[_0x387887(0xe8)]&&console[_0x387887(0x103)](_0x387887(0x119)+_0x4fea9b));const _0x3b3638=await withSpinner(_0x387887(0xf7)+_0x4fea9b+_0x387887(0xbb),()=>_0x5e54f3[_0x387887(0xb8)]['resolvePathToResource'](_0x4fea9b),{'verbose':_0x4994ed['verbose']}),_0x230281=_0x3b3638[_0x387887(0xcf)];_0x4994ed['verbose']&&(console['error'](_0x387887(0x115)+_0x230281[_0x387887(0xd4)]),console[_0x387887(0x103)](_0x387887(0xce)+_0x230281['parentId']),_0x230281[_0x387887(0xc0)]&&console[_0x387887(0x103)](_0x387887(0x125)+_0x230281[_0x387887(0xc0)]),_0x230281[_0x387887(0x107)]&&console[_0x387887(0x103)](_0x387887(0x10c)+_0x230281[_0x387887(0x107)]));if(_0x230281[_0x387887(0xd4)]===_0x387887(0x124)){const _0x2880e7=await withSpinner(_0x387887(0x112),()=>_0x5e54f3[_0x387887(0xb8)][_0x387887(0x11b)](_0x230281[_0x387887(0xc7)]),{'verbose':_0x4994ed[_0x387887(0xe8)]});await handleSDKOutput([_0x2880e7[_0x387887(0xcf)]],_0x4994ed);}else{if(_0x230281[_0x387887(0xd4)]===_0x387887(0xba)){if(!_0x230281['folderId'])throw new SDKError(ErrorCode[_0x387887(0xcb)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3374e0=await withSpinner(_0x387887(0xe9),()=>_0x5e54f3['segment'][_0x387887(0xf1)](_0x230281['folderId']),{'verbose':_0x4994ed[_0x387887(0xe8)]});await handleSDKOutput([_0x3374e0['data']],_0x4994ed);}else{if(_0x230281[_0x387887(0xd4)]==='segment'){if(!_0x230281[_0x387887(0x107)])throw new SDKError(ErrorCode['INTERNAL'],_0x387887(0x121));const _0x53d67c=await withSpinner(_0x387887(0xf6),()=>_0x5e54f3['segment'][_0x387887(0xbc)](_0x230281['parentId'],_0x230281[_0x387887(0x107)]),{'verbose':_0x4994ed[_0x387887(0xe8)]});await handleSDKOutput([_0x53d67c[_0x387887(0xcf)]],_0x4994ed);}}}return 0x0;}catch(_0x58bf7f){if(_0x58bf7f instanceof SDKError)return console[_0x387887(0x103)](_0x387887(0xdf)+_0x58bf7f[_0x387887(0x11d)]),_0x58bf7f[_0x387887(0xe6)]&&console[_0x387887(0x103)](_0x387887(0xe7)+_0x58bf7f[_0x387887(0xe6)]),0x1;throw _0x58bf7f;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x62bb42(0x104)]='segment:show';[a23_0x62bb42(0xcc)]=a23_0x62bb42(0xc9);async[a23_0x62bb42(0x11c)](_0x3a89c3){const _0x52b787=a23_0x62bb42,{options:_0x168959,args:_0x17fbff,tdx:_0x3622a7}=_0x3a89c3;if(_0x17fbff[_0x52b787(0x108)]===0x0)return console[_0x52b787(0x103)](_0x52b787(0xc1)),console[_0x52b787(0x103)](_0x52b787(0x10d)),console[_0x52b787(0x103)](_0x52b787(0x122)),console[_0x52b787(0x103)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x52b787(0x103)](_0x52b787(0xec)),console[_0x52b787(0x103)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x57794e=_0x17fbff[0x0],_0x79bda9=_0x168959[_0x52b787(0xf4)];let _0x222d8c=_0x57794e;_0x79bda9&&!_0x57794e['includes']('/')&&(_0x222d8c=_0x79bda9+'/'+_0x57794e,_0x168959[_0x52b787(0xe8)]&&console[_0x52b787(0x103)](_0x52b787(0x119)+_0x222d8c));const _0x583bb1=await withSpinner(_0x52b787(0xf7)+_0x222d8c+'\x27...',()=>_0x3622a7[_0x52b787(0xb8)][_0x52b787(0xf3)](_0x222d8c),{'verbose':_0x168959['verbose']}),_0x379165=_0x583bb1[_0x52b787(0xcf)];_0x168959[_0x52b787(0xe8)]&&(console['error']('Resolved\x20type:\x20'+_0x379165[_0x52b787(0xd4)]),console['error'](_0x52b787(0xce)+_0x379165[_0x52b787(0xc7)]));if(_0x379165[_0x52b787(0xd4)]===_0x52b787(0xba))return console[_0x52b787(0x103)](_0x52b787(0xb9)),console[_0x52b787(0x103)](_0x52b787(0xda)),0x1;let _0x55507d;if(_0x379165['type']==='parent'){const _0x4a9e3f=await withSpinner(_0x52b787(0xc6),()=>_0x3622a7[_0x52b787(0xb8)][_0x52b787(0x123)](_0x379165[_0x52b787(0xc7)]),{'verbose':_0x168959[_0x52b787(0xe8)]});_0x55507d=_0x4a9e3f[_0x52b787(0xcf)];}else{if(!_0x379165['segmentId'])throw new SDKError(ErrorCode[_0x52b787(0xcb)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1cbf4d=await withSpinner(_0x52b787(0xd9),()=>_0x3622a7['segment'][_0x52b787(0xed)](_0x379165[_0x52b787(0xc7)],_0x379165[_0x52b787(0x107)]),{'verbose':_0x168959[_0x52b787(0xe8)]});_0x55507d=_0x1cbf4d[_0x52b787(0xcf)];}const _0x88c316=resolveLimit(_0x168959[_0x52b787(0x116)],DEFAULT_DISPLAY_LIMIT),_0x4f7917=/\bLIMIT\s+\d+/i[_0x52b787(0xe5)](_0x55507d);!_0x4f7917&&(_0x55507d=_0x55507d['trim']()[_0x52b787(0xb7)](/;+$/,''),_0x55507d=_0x52b787(0x113)+_0x55507d+_0x52b787(0x106)+_0x88c316);_0x168959['verbose']&&console['error'](_0x52b787(0x100)+_0x55507d);const _0x309c8f=await withQuerySpinner(_0x52b787(0xc4),async _0x16cd2c=>{const _0x2614a3=_0x52b787,_0x4f7b23=await _0x3622a7['query'][_0x2614a3(0x11c)](_0x55507d,{'catalog':'td','schema':_0x2614a3(0xf9),'onJobId':_0x3ead57=>{const _0x2f9cae=_0x2614a3;_0x16cd2c[_0x2f9cae(0x11f)](_0x3ead57);}});return _0x4f7b23;},{'verbose':_0x168959['verbose']}),_0x427e6b=_0x309c8f[_0x52b787(0xcf)],_0x41a5f2=_0x427e6b[_0x52b787(0x11a)]?'\x20[Job\x20ID:\x20'+_0x427e6b[_0x52b787(0x11a)]+']':'';return console[_0x52b787(0x103)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x427e6b[_0x52b787(0xff)][_0x52b787(0xd5)][_0x52b787(0xc5)]()+_0x52b787(0x110)+(_0x52b787(0xb6)+formatElapsed(_0x427e6b[_0x52b787(0xff)][_0x52b787(0xd3)])+_0x41a5f2)),await handleQueryOutput(_0x427e6b,_0x168959),0x0;}catch(_0x3dc142){if(_0x3dc142 instanceof SDKError)return console[_0x52b787(0x103)](_0x52b787(0x120)+_0x3dc142[_0x52b787(0xe1)]+']'),console[_0x52b787(0x103)]('\x0a'+_0x3dc142[_0x52b787(0x11d)]),0x1;throw _0x3dc142;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x62bb42(0x104)]=a23_0x62bb42(0x109);[a23_0x62bb42(0xcc)]=a23_0x62bb42(0xdd);async[a23_0x62bb42(0x11c)](_0x1dd62a){const _0x54cab8=a23_0x62bb42,{options:_0x1651ec,args:_0x464757,tdx:_0x20d51c}=_0x1dd62a;if(_0x464757[_0x54cab8(0x108)]===0x0)return console[_0x54cab8(0x103)](_0x54cab8(0xee)),console['error'](_0x54cab8(0xe3)),0x1;const _0x4346c7=_0x464757[0x0];try{_0x1651ec['verbose']&&(console[_0x54cab8(0x103)]('Site:\x20'+_0x1651ec[_0x54cab8(0xde)]),console['error'](_0x54cab8(0xf2)+_0x4346c7));const _0x33e124=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4346c7+_0x54cab8(0xbb),()=>_0x20d51c[_0x54cab8(0xb8)][_0x54cab8(0xc8)](_0x4346c7),{'verbose':_0x1651ec[_0x54cab8(0xe8)]}),_0xd026a=_0x33e124['data'];_0x1651ec['verbose']&&console[_0x54cab8(0x103)](_0x54cab8(0x12a)+_0xd026a);const _0x42a0fe=await withSpinner(_0x54cab8(0xe0)+_0x4346c7+'\x27...',()=>_0x20d51c[_0x54cab8(0xb8)]['listFolders'](_0xd026a),{'verbose':_0x1651ec[_0x54cab8(0xe8)]}),_0x314db5=_0x42a0fe['data'];return console[_0x54cab8(0x103)]('✔\x20Found\x20'+_0x314db5[_0x54cab8(0x108)]+_0x54cab8(0x10f)+(_0x314db5[_0x54cab8(0x108)]!==0x1?'s':'')),await handleSDKOutput(_0x314db5,_0x1651ec),0x0;}catch(_0x305e9c){if(_0x305e9c instanceof SDKError)return console[_0x54cab8(0x103)]('Error:\x20'+_0x305e9c[_0x54cab8(0x11d)]),_0x305e9c[_0x54cab8(0xe6)]&&console[_0x54cab8(0x103)](_0x54cab8(0xe7)+_0x305e9c[_0x54cab8(0xe6)]),0x1;throw _0x305e9c;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x62bb42(0x104)]='segment:folder:show';[a23_0x62bb42(0xcc)]='Show\x20segment\x20folder\x20details';async[a23_0x62bb42(0x11c)](_0x59e463){const _0x95664=a23_0x62bb42,{options:_0x3764ef,args:_0x548b57,tdx:_0x822daa}=_0x59e463;if(_0x548b57[_0x95664(0x108)]===0x0)return console[_0x95664(0x103)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x95664(0x103)](_0x95664(0x105)),0x1;try{const {parentId:_0x389896,childId:_0x54a3c2}=parseSegmentRef(_0x548b57[0x0]);_0x3764ef[_0x95664(0xe8)]&&(console[_0x95664(0x103)](_0x95664(0x10a)+_0x3764ef[_0x95664(0xde)]),console['error'](_0x95664(0xf2)+_0x389896),_0x54a3c2&&console[_0x95664(0x103)]('Folder\x20name:\x20'+_0x54a3c2));if(!_0x54a3c2)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x214252=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x389896+'\x27...',()=>_0x822daa[_0x95664(0xb8)][_0x95664(0xc8)](_0x389896),{'verbose':_0x3764ef[_0x95664(0xe8)]}),_0x3f0dda=_0x214252['data'];_0x3764ef[_0x95664(0xe8)]&&console[_0x95664(0x103)](_0x95664(0x12a)+_0x3f0dda);const _0x19c51c=await withSpinner(_0x95664(0xbf)+_0x54a3c2+_0x95664(0xbb),()=>_0x822daa[_0x95664(0xb8)][_0x95664(0xc2)](_0x3f0dda,_0x54a3c2),{'verbose':_0x3764ef[_0x95664(0xe8)]}),_0x4fd199=_0x19c51c[_0x95664(0xcf)];_0x3764ef[_0x95664(0xe8)]&&console[_0x95664(0x103)](_0x95664(0xd7)+_0x4fd199);const _0x2405c7=await withSpinner('Fetching\x20folder\x20\x27'+_0x54a3c2+_0x95664(0xbb),()=>_0x822daa[_0x95664(0xb8)][_0x95664(0xf1)](_0x4fd199),{'verbose':_0x3764ef[_0x95664(0xe8)]});return await handleSDKOutput([_0x2405c7[_0x95664(0xcf)]],_0x3764ef),0x0;}catch(_0x3fd690){if(_0x3fd690 instanceof SDKError)return console['error'](_0x95664(0xdf)+_0x3fd690[_0x95664(0x11d)]),_0x3fd690[_0x95664(0xe6)]&&console[_0x95664(0x103)]('\x20\x20Cause:\x20'+_0x3fd690['cause']),0x1;throw _0x3fd690;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a23_0x62bb42(0xbe);[a23_0x62bb42(0xcc)]=a23_0x62bb42(0xd8);async[a23_0x62bb42(0x11c)](_0x3ba52c){const _0x12d677=a23_0x62bb42,{options:_0x37b6eb,args:_0x3e08e9,tdx:_0x59da57}=_0x3ba52c;if(_0x3e08e9[_0x12d677(0x108)]===0x0)return console['error'](_0x12d677(0xc1)),console[_0x12d677(0x103)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x12d677(0x103)](_0x12d677(0x122)),console['error'](_0x12d677(0xfb)),console[_0x12d677(0x103)](_0x12d677(0xef)),console['error'](_0x12d677(0x114)),0x1;try{const _0x15684e=_0x3e08e9[0x0],_0x39c0c6=_0x37b6eb[_0x12d677(0xf4)];let _0x4a3d28=_0x15684e;_0x39c0c6&&!_0x15684e[_0x12d677(0x11e)]('/')&&(_0x4a3d28=_0x39c0c6+'/'+_0x15684e,_0x37b6eb[_0x12d677(0xe8)]&&console['error'](_0x12d677(0x119)+_0x4a3d28));const _0x48b392=await withSpinner(_0x12d677(0xf7)+_0x4a3d28+_0x12d677(0xbb),()=>_0x59da57['segment'][_0x12d677(0xf3)](_0x4a3d28),{'verbose':_0x37b6eb[_0x12d677(0xe8)]}),_0x2f2003=_0x48b392[_0x12d677(0xcf)];_0x37b6eb[_0x12d677(0xe8)]&&(console[_0x12d677(0x103)](_0x12d677(0x115)+_0x2f2003[_0x12d677(0xd4)]),console[_0x12d677(0x103)](_0x12d677(0xce)+_0x2f2003[_0x12d677(0xc7)]));if(_0x2f2003['type']==='folder')return console[_0x12d677(0x103)](_0x12d677(0xe2)),console['error'](_0x12d677(0xd1)),0x1;let _0x1b215a;if(_0x2f2003[_0x12d677(0xd4)]==='parent'){const _0x2bd21d=await withSpinner(_0x12d677(0xc6),()=>_0x59da57[_0x12d677(0xb8)][_0x12d677(0x123)](_0x2f2003['parentId']),{'verbose':_0x37b6eb[_0x12d677(0xe8)]});_0x1b215a=_0x2bd21d['data'];}else{if(!_0x2f2003[_0x12d677(0x107)])throw new SDKError(ErrorCode[_0x12d677(0xcb)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4ca8c2=await withSpinner(_0x12d677(0xd9),()=>_0x59da57[_0x12d677(0xb8)]['getSegmentSQL'](_0x2f2003[_0x12d677(0xc7)],_0x2f2003[_0x12d677(0x107)]),{'verbose':_0x37b6eb[_0x12d677(0xe8)]});_0x1b215a=_0x4ca8c2[_0x12d677(0xcf)];}return _0x37b6eb['format']==='json'||_0x37b6eb['format']===_0x12d677(0xbd)?await handleSDKOutput([{'sql':_0x1b215a}],_0x37b6eb):console[_0x12d677(0xc3)](_0x1b215a),0x0;}catch(_0x3734dd){if(_0x3734dd instanceof SDKError)return console[_0x12d677(0x103)](_0x12d677(0xdf)+_0x3734dd[_0x12d677(0x11d)]),_0x3734dd[_0x12d677(0xe6)]&&console['error']('\x20\x20Cause:\x20'+_0x3734dd[_0x12d677(0xe6)]),0x1;throw _0x3734dd;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x62bb42(0x104)]='segment:folder:create';[a23_0x62bb42(0xcc)]=a23_0x62bb42(0xd6);async[a23_0x62bb42(0x11c)](_0x567a8e){const _0x369710=a23_0x62bb42,{options:_0x45d6fc,args:_0x4c0e9c,tdx:_0x170270}=_0x567a8e,_0x524f4c=_0x45d6fc;if(_0x4c0e9c['length']<0x2)return console[_0x369710(0x103)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x369710(0x103)](_0x369710(0x10b)),0x1;const _0x44d7fa=_0x4c0e9c[0x0],_0x5f366a=_0x4c0e9c[0x1];_0x524f4c['verbose']&&(console[_0x369710(0x103)](_0x369710(0x10a)+_0x524f4c[_0x369710(0xde)]),console[_0x369710(0x103)](_0x369710(0xdc)+_0x44d7fa),console[_0x369710(0x103)](_0x369710(0x127)+_0x5f366a));let _0x248267;if(_0x524f4c['parentFolder']){const _0x288eb9=_0x524f4c[_0x369710(0xf0)],_0x27e6d0=await withSpinner(_0x369710(0xf5)+_0x44d7fa+_0x369710(0xbb),()=>_0x170270[_0x369710(0xb8)]['resolveParentId'](_0x44d7fa),{'verbose':_0x524f4c['verbose']}),_0x4da2a6=_0x27e6d0[_0x369710(0xcf)],_0x39b7b7=await withSpinner(_0x369710(0xfd)+_0x288eb9+_0x369710(0xbb),()=>_0x170270[_0x369710(0xb8)]['resolveFolderId'](_0x4da2a6,_0x288eb9),{'verbose':_0x524f4c['verbose']});_0x248267=_0x39b7b7[_0x369710(0xcf)],_0x524f4c[_0x369710(0xe8)]&&console[_0x369710(0x103)](_0x369710(0xfa)+_0x248267);}const _0x419a64={'name':_0x5f366a,'description':_0x524f4c['description'],'parentFolderId':_0x248267},_0x1fafea=await withSpinner(_0x369710(0x129)+_0x5f366a+_0x369710(0xbb),()=>_0x170270[_0x369710(0xb8)]['createFolder'](_0x44d7fa,_0x419a64),{'verbose':_0x524f4c[_0x369710(0xe8)]}),_0x2c3ba0=_0x1fafea[_0x369710(0xcf)];return console['error'](_0x369710(0xfe)+_0x2c3ba0[_0x369710(0x104)]+_0x369710(0xd2)+_0x2c3ba0['id']),await handleSDKOutput([_0x2c3ba0],_0x524f4c),0x0;}}
|
|
1
|
+
const a23_0x3e213e=a23_0x4b7e;function a23_0x4b7e(_0x24336d,_0x2afc19){const _0xf450b2=a23_0xf450();return a23_0x4b7e=function(_0x4b7e4b,_0x572c13){_0x4b7e4b=_0x4b7e4b-0x1ed;let _0x3c939d=_0xf450b2[_0x4b7e4b];return _0x3c939d;},a23_0x4b7e(_0x24336d,_0x2afc19);}(function(_0x2b7188,_0xbcd18a){const _0x247973=a23_0x4b7e,_0x225dc3=_0x2b7188();while(!![]){try{const _0x276d64=parseInt(_0x247973(0x217))/0x1+parseInt(_0x247973(0x227))/0x2*(parseInt(_0x247973(0x1ef))/0x3)+parseInt(_0x247973(0x20c))/0x4+-parseInt(_0x247973(0x22b))/0x5+parseInt(_0x247973(0x212))/0x6+parseInt(_0x247973(0x251))/0x7*(parseInt(_0x247973(0x23e))/0x8)+parseInt(_0x247973(0x25a))/0x9*(-parseInt(_0x247973(0x239))/0xa);if(_0x276d64===_0xbcd18a)break;else _0x225dc3['push'](_0x225dc3['shift']());}catch(_0x3cb30b){_0x225dc3['push'](_0x225dc3['shift']());}}}(a23_0xf450,0xdc9d3));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}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';function a23_0xf450(){const _0x440596=['Fetching\x20parent\x20segment\x20details...','resolveParentId','✔\x20Found\x20','resolvePathToResource','segment','Create\x20segment\x20folder\x20for\x20organization','✖\x20Query\x20failed\x20[','cause','439515OEZUZQ','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','segment:show','Usage:\x20tdx\x20segment\x20sql\x20<path>','Creating\x20folder\x20\x27','createFolder','elapsedTimeMillis','Resolved\x20parent\x20folder\x20ID:\x20','listFolders','\x20\x20Cause:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','1636773AMBahh','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','replace','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','json','parent','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','getParentSQL','execute','limit','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','data','information_schema','parentFolder','segment:folder:list','stats','Resolved\x20type:\x20','Fetching\x20segment\x20details...','Parent\x20name:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','log','segmentPath','verbose','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Folder\x20ID\x20missing\x20from\x20resolved\x20path','7010384kwhQej','segment:sql','Executing\x20segment\x20query...','\x20rows\x20','site','Resolved\x20folder\x20ID:\x20','8749266XhbpAR','code','Resolved\x20relative\x20path\x20to:\x20','getSegment','Examples:','1746112cEjduq','name','message','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','parentId','Folder\x20name:\x20','Resolving\x20path\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','type','\x27...','INTERNAL','includes','Parent\x20ID:\x20','\x20[Job\x20ID:\x20','2qlCOsG','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','resolveFolderId','Resolving\x20folder\x20\x27','8253395WaiQwC','format','trim','query','length','Resolving\x20parent\x20segment\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','setJobId','\x20folder','SQL\x20query:\x0a','Error:\x20','getSegmentSQL','950iGZOCk','Show\x20segment\x20folder\x20details','segment:describe','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20show\x20<path>','88PMOTKJ','getFolder','Error:\x20Path\x20or\x20name\x20is\x20required','error','Parent\x20segment:\x20','Resolved\x20parent\x20ID:\x20','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','SELECT\x20*\x20FROM\x20(\x0a','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folder','description','segmentId','in\x20','jsonl','segment:folder:show','folderId','processedRows','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','1076173BFJWhY'];a23_0xf450=function(){return _0x440596;};return a23_0xf450();}export class SegmentDescribeCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x23b);[a23_0x3e213e(0x249)]='Show\x20segment\x20or\x20folder\x20details';async[a23_0x3e213e(0x1f9)](_0x215a2a){const _0x2d3a3b=a23_0x3e213e,{options:_0x416a24,args:_0x15271e,tdx:_0x4c406a}=_0x215a2a;if(_0x15271e['length']===0x0)return console[_0x2d3a3b(0x241)](_0x2d3a3b(0x240)),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x1ee)),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x216)),console['error'](_0x2d3a3b(0x1f0)),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x247)),console[_0x2d3a3b(0x241)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x40f754=_0x15271e[0x0],_0x40b289=_0x416a24[_0x2d3a3b(0x207)];let _0x1b2465=_0x40f754;_0x40b289&&!_0x40f754[_0x2d3a3b(0x224)]('/')&&(_0x1b2465=_0x40b289+'/'+_0x40f754,_0x416a24[_0x2d3a3b(0x208)]&&console['error'](_0x2d3a3b(0x214)+_0x1b2465));const _0x3076b3=await withSpinner(_0x2d3a3b(0x21f)+_0x1b2465+_0x2d3a3b(0x222),()=>_0x4c406a['segment'][_0x2d3a3b(0x255)](_0x1b2465),{'verbose':_0x416a24[_0x2d3a3b(0x208)]}),_0xe05657=_0x3076b3[_0x2d3a3b(0x1fd)];_0x416a24[_0x2d3a3b(0x208)]&&(console['error']('Resolved\x20type:\x20'+_0xe05657['type']),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x225)+_0xe05657[_0x2d3a3b(0x21d)]),_0xe05657[_0x2d3a3b(0x24e)]&&console[_0x2d3a3b(0x241)](_0x2d3a3b(0x1f6)+_0xe05657[_0x2d3a3b(0x24e)]),_0xe05657[_0x2d3a3b(0x24a)]&&console[_0x2d3a3b(0x241)]('Segment\x20ID:\x20'+_0xe05657['segmentId']));if(_0xe05657[_0x2d3a3b(0x221)]===_0x2d3a3b(0x1f5)){const _0x37319f=await withSpinner(_0x2d3a3b(0x252),()=>_0x4c406a[_0x2d3a3b(0x256)]['getParent'](_0xe05657[_0x2d3a3b(0x21d)]),{'verbose':_0x416a24['verbose']});await handleSDKOutput([_0x37319f[_0x2d3a3b(0x1fd)]],_0x416a24);}else{if(_0xe05657[_0x2d3a3b(0x221)]===_0x2d3a3b(0x248)){if(!_0xe05657[_0x2d3a3b(0x24e)])throw new SDKError(ErrorCode['INTERNAL'],_0x2d3a3b(0x20b));const _0x19477c=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4c406a['segment'][_0x2d3a3b(0x23f)](_0xe05657[_0x2d3a3b(0x24e)]),{'verbose':_0x416a24['verbose']});await handleSDKOutput([_0x19477c[_0x2d3a3b(0x1fd)]],_0x416a24);}else{if(_0xe05657['type']===_0x2d3a3b(0x256)){if(!_0xe05657[_0x2d3a3b(0x24a)])throw new SDKError(ErrorCode['INTERNAL'],_0x2d3a3b(0x20a));const _0x18a418=await withSpinner(_0x2d3a3b(0x203),()=>_0x4c406a[_0x2d3a3b(0x256)][_0x2d3a3b(0x215)](_0xe05657[_0x2d3a3b(0x21d)],_0xe05657[_0x2d3a3b(0x24a)]),{'verbose':_0x416a24[_0x2d3a3b(0x208)]});await handleSDKOutput([_0x18a418[_0x2d3a3b(0x1fd)]],_0x416a24);}}}return 0x0;}catch(_0x621d01){if(_0x621d01 instanceof SDKError)return console[_0x2d3a3b(0x241)](_0x2d3a3b(0x237)+_0x621d01[_0x2d3a3b(0x219)]),_0x621d01[_0x2d3a3b(0x259)]&&console[_0x2d3a3b(0x241)](_0x2d3a3b(0x1ed)+_0x621d01['cause']),0x1;throw _0x621d01;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x25c);[a23_0x3e213e(0x249)]=a23_0x3e213e(0x244);async['execute'](_0x525a49){const _0x509524=a23_0x3e213e,{options:_0x382e5f,args:_0x1d2df0,tdx:_0x67a05d}=_0x525a49;if(_0x1d2df0[_0x509524(0x22f)]===0x0)return console[_0x509524(0x241)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x509524(0x241)](_0x509524(0x23d)),console[_0x509524(0x241)]('Examples:'),console[_0x509524(0x241)](_0x509524(0x233)),console[_0x509524(0x241)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x509524(0x241)](_0x509524(0x21a)),0x1;try{const _0x1990ce=_0x1d2df0[0x0],_0x2e228a=_0x382e5f[_0x509524(0x207)];let _0x441039=_0x1990ce;_0x2e228a&&!_0x1990ce[_0x509524(0x224)]('/')&&(_0x441039=_0x2e228a+'/'+_0x1990ce,_0x382e5f[_0x509524(0x208)]&&console['error'](_0x509524(0x214)+_0x441039));const _0x5699ad=await withSpinner(_0x509524(0x21f)+_0x441039+_0x509524(0x222),()=>_0x67a05d[_0x509524(0x256)][_0x509524(0x255)](_0x441039),{'verbose':_0x382e5f[_0x509524(0x208)]}),_0x4210f3=_0x5699ad['data'];_0x382e5f[_0x509524(0x208)]&&(console['error'](_0x509524(0x202)+_0x4210f3[_0x509524(0x221)]),console[_0x509524(0x241)](_0x509524(0x225)+_0x4210f3[_0x509524(0x21d)]));if(_0x4210f3[_0x509524(0x221)]===_0x509524(0x248))return console[_0x509524(0x241)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x509524(0x241)](_0x509524(0x21c)),0x1;let _0x23bbd5;if(_0x4210f3['type']===_0x509524(0x1f5)){const _0x29c2ed=await withSpinner(_0x509524(0x205),()=>_0x67a05d[_0x509524(0x256)][_0x509524(0x1f8)](_0x4210f3[_0x509524(0x21d)]),{'verbose':_0x382e5f['verbose']});_0x23bbd5=_0x29c2ed['data'];}else{if(!_0x4210f3[_0x509524(0x24a)])throw new SDKError(ErrorCode[_0x509524(0x223)],_0x509524(0x20a));const _0x3e6d24=await withSpinner(_0x509524(0x1f2),()=>_0x67a05d['segment'][_0x509524(0x238)](_0x4210f3[_0x509524(0x21d)],_0x4210f3[_0x509524(0x24a)]),{'verbose':_0x382e5f[_0x509524(0x208)]});_0x23bbd5=_0x3e6d24['data'];}const _0x5c77f3=resolveLimit(_0x382e5f[_0x509524(0x1fa)],DEFAULT_DISPLAY_LIMIT),_0x254abf=/\bLIMIT\s+\d+/i['test'](_0x23bbd5);!_0x254abf&&(_0x23bbd5=_0x23bbd5[_0x509524(0x22d)]()[_0x509524(0x1f1)](/;+$/,''),_0x23bbd5=_0x509524(0x245)+_0x23bbd5+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5c77f3);_0x382e5f[_0x509524(0x208)]&&console['error'](_0x509524(0x236)+_0x23bbd5);const _0xeab6ef=await withQuerySpinner(_0x509524(0x20e),async _0x1eb133=>{const _0xe8595d=_0x509524,_0x1c9c2f=await _0x67a05d[_0xe8595d(0x22e)][_0xe8595d(0x1f9)](_0x23bbd5,{'catalog':'td','schema':_0xe8595d(0x1fe),'onJobId':_0x380cdb=>{const _0x181c6d=_0xe8595d;_0x1eb133[_0x181c6d(0x234)](_0x380cdb);}});return _0x1c9c2f;},{'verbose':_0x382e5f[_0x509524(0x208)]}),_0x54244c=_0xeab6ef[_0x509524(0x1fd)],_0x5d9aa9=_0x54244c['jobId']?_0x509524(0x226)+_0x54244c['jobId']+']':'';return console[_0x509524(0x241)](_0x509524(0x220)+_0x54244c[_0x509524(0x201)][_0x509524(0x24f)]['toLocaleString']()+_0x509524(0x20f)+(_0x509524(0x24b)+formatElapsed(_0x54244c['stats'][_0x509524(0x260)])+_0x5d9aa9)),await handleQueryOutput(_0x54244c,_0x382e5f),0x0;}catch(_0x272607){if(_0x272607 instanceof SDKError)return console['error'](_0x509524(0x258)+_0x272607[_0x509524(0x213)]+']'),console[_0x509524(0x241)]('\x0a'+_0x272607[_0x509524(0x219)]),0x1;throw _0x272607;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x200);[a23_0x3e213e(0x249)]=a23_0x3e213e(0x1fc);async['execute'](_0x4d729e){const _0x12225a=a23_0x3e213e,{options:_0x37c974,args:_0x2b3861,tdx:_0x5e65e3}=_0x4d729e;if(_0x2b3861[_0x12225a(0x22f)]===0x0)return console['error'](_0x12225a(0x23c)),console[_0x12225a(0x241)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x15da0e=_0x2b3861[0x0];try{_0x37c974['verbose']&&(console[_0x12225a(0x241)](_0x12225a(0x232)+_0x37c974[_0x12225a(0x210)]),console[_0x12225a(0x241)](_0x12225a(0x204)+_0x15da0e));const _0x370c5d=await withSpinner(_0x12225a(0x230)+_0x15da0e+_0x12225a(0x222),()=>_0x5e65e3[_0x12225a(0x256)][_0x12225a(0x253)](_0x15da0e),{'verbose':_0x37c974['verbose']}),_0x4ab582=_0x370c5d[_0x12225a(0x1fd)];_0x37c974[_0x12225a(0x208)]&&console[_0x12225a(0x241)](_0x12225a(0x243)+_0x4ab582);const _0x23fd43=await withSpinner(_0x12225a(0x231)+_0x15da0e+'\x27...',()=>_0x5e65e3['segment'][_0x12225a(0x262)](_0x4ab582),{'verbose':_0x37c974[_0x12225a(0x208)]}),_0x40bf6d=_0x23fd43[_0x12225a(0x1fd)];return console[_0x12225a(0x241)](_0x12225a(0x254)+_0x40bf6d[_0x12225a(0x22f)]+_0x12225a(0x235)+(_0x40bf6d[_0x12225a(0x22f)]!==0x1?'s':'')),await handleSDKOutput(_0x40bf6d,_0x37c974),0x0;}catch(_0x59ba4f){if(_0x59ba4f instanceof SDKError)return console[_0x12225a(0x241)](_0x12225a(0x237)+_0x59ba4f[_0x12225a(0x219)]),_0x59ba4f[_0x12225a(0x259)]&&console[_0x12225a(0x241)](_0x12225a(0x1ed)+_0x59ba4f[_0x12225a(0x259)]),0x1;throw _0x59ba4f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x24d);[a23_0x3e213e(0x249)]=a23_0x3e213e(0x23a);async[a23_0x3e213e(0x1f9)](_0x371f36){const _0x2dad99=a23_0x3e213e,{options:_0x698d67,args:_0x4fddfc,tdx:_0x2dbca9}=_0x371f36;if(_0x4fddfc[_0x2dad99(0x22f)]===0x0)return console[_0x2dad99(0x241)](_0x2dad99(0x21b)),console[_0x2dad99(0x241)](_0x2dad99(0x1f7)),0x1;try{const {parentId:_0x17dd56,childId:_0x45b978}=parseSegmentRef(_0x4fddfc[0x0]);_0x698d67['verbose']&&(console[_0x2dad99(0x241)](_0x2dad99(0x232)+_0x698d67['site']),console[_0x2dad99(0x241)](_0x2dad99(0x204)+_0x17dd56),_0x45b978&&console[_0x2dad99(0x241)](_0x2dad99(0x21e)+_0x45b978));if(!_0x45b978)return console[_0x2dad99(0x241)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x3de28c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x17dd56+_0x2dad99(0x222),()=>_0x2dbca9['segment'][_0x2dad99(0x253)](_0x17dd56),{'verbose':_0x698d67['verbose']}),_0x9742d=_0x3de28c['data'];_0x698d67['verbose']&&console[_0x2dad99(0x241)]('Resolved\x20parent\x20ID:\x20'+_0x9742d);const _0x4aba10=await withSpinner(_0x2dad99(0x22a)+_0x45b978+'\x27...',()=>_0x2dbca9['segment'][_0x2dad99(0x229)](_0x9742d,_0x45b978),{'verbose':_0x698d67[_0x2dad99(0x208)]}),_0x447a45=_0x4aba10[_0x2dad99(0x1fd)];_0x698d67['verbose']&&console[_0x2dad99(0x241)](_0x2dad99(0x211)+_0x447a45);const _0x1b35ba=await withSpinner('Fetching\x20folder\x20\x27'+_0x45b978+'\x27...',()=>_0x2dbca9[_0x2dad99(0x256)][_0x2dad99(0x23f)](_0x447a45),{'verbose':_0x698d67[_0x2dad99(0x208)]});return await handleSDKOutput([_0x1b35ba[_0x2dad99(0x1fd)]],_0x698d67),0x0;}catch(_0x57e6d0){if(_0x57e6d0 instanceof SDKError)return console[_0x2dad99(0x241)](_0x2dad99(0x237)+_0x57e6d0[_0x2dad99(0x219)]),_0x57e6d0[_0x2dad99(0x259)]&&console['error'](_0x2dad99(0x1ed)+_0x57e6d0[_0x2dad99(0x259)]),0x1;throw _0x57e6d0;}}}export class SegmentSQLCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x20d);['description']=a23_0x3e213e(0x209);async[a23_0x3e213e(0x1f9)](_0x1e717d){const _0x507432=a23_0x3e213e,{options:_0x28627e,args:_0x308e6b,tdx:_0x497630}=_0x1e717d;if(_0x308e6b[_0x507432(0x22f)]===0x0)return console['error'](_0x507432(0x1fb)),console[_0x507432(0x241)](_0x507432(0x25d)),console['error'](_0x507432(0x216)),console[_0x507432(0x241)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x507432(0x241)](_0x507432(0x1f3)),console['error']('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x29942d=_0x308e6b[0x0],_0x1be7fc=_0x28627e[_0x507432(0x207)];let _0x1e9411=_0x29942d;_0x1be7fc&&!_0x29942d[_0x507432(0x224)]('/')&&(_0x1e9411=_0x1be7fc+'/'+_0x29942d,_0x28627e[_0x507432(0x208)]&&console[_0x507432(0x241)](_0x507432(0x214)+_0x1e9411));const _0x3b5089=await withSpinner(_0x507432(0x21f)+_0x1e9411+'\x27...',()=>_0x497630[_0x507432(0x256)][_0x507432(0x255)](_0x1e9411),{'verbose':_0x28627e['verbose']}),_0x56e538=_0x3b5089[_0x507432(0x1fd)];_0x28627e[_0x507432(0x208)]&&(console[_0x507432(0x241)](_0x507432(0x202)+_0x56e538[_0x507432(0x221)]),console[_0x507432(0x241)](_0x507432(0x225)+_0x56e538[_0x507432(0x21d)]));if(_0x56e538[_0x507432(0x221)]==='folder')return console[_0x507432(0x241)](_0x507432(0x25b)),console[_0x507432(0x241)](_0x507432(0x246)),0x1;let _0x60f1c0;if(_0x56e538[_0x507432(0x221)]===_0x507432(0x1f5)){const _0x335d11=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x497630['segment'][_0x507432(0x1f8)](_0x56e538[_0x507432(0x21d)]),{'verbose':_0x28627e[_0x507432(0x208)]});_0x60f1c0=_0x335d11[_0x507432(0x1fd)];}else{if(!_0x56e538[_0x507432(0x24a)])throw new SDKError(ErrorCode[_0x507432(0x223)],_0x507432(0x20a));const _0x4c96fa=await withSpinner(_0x507432(0x1f2),()=>_0x497630['segment'][_0x507432(0x238)](_0x56e538[_0x507432(0x21d)],_0x56e538['segmentId']),{'verbose':_0x28627e[_0x507432(0x208)]});_0x60f1c0=_0x4c96fa[_0x507432(0x1fd)];}return _0x28627e[_0x507432(0x22c)]===_0x507432(0x1f4)||_0x28627e[_0x507432(0x22c)]===_0x507432(0x24c)?await handleSDKOutput([{'sql':_0x60f1c0}],_0x28627e):console[_0x507432(0x206)](_0x60f1c0),0x0;}catch(_0x43ea05){if(_0x43ea05 instanceof SDKError)return console[_0x507432(0x241)](_0x507432(0x237)+_0x43ea05[_0x507432(0x219)]),_0x43ea05[_0x507432(0x259)]&&console[_0x507432(0x241)]('\x20\x20Cause:\x20'+_0x43ea05[_0x507432(0x259)]),0x1;throw _0x43ea05;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x3e213e(0x218)]='segment:folder:create';[a23_0x3e213e(0x249)]=a23_0x3e213e(0x257);async['execute'](_0x2a21b3){const _0x2d0d66=a23_0x3e213e,{options:_0x3ca8da,args:_0x43091b,tdx:_0x4899f6}=_0x2a21b3,_0x498ce7=_0x3ca8da;if(_0x43091b['length']<0x2)return console[_0x2d0d66(0x241)](_0x2d0d66(0x250)),console[_0x2d0d66(0x241)](_0x2d0d66(0x228)),0x1;const _0x4e9f11=_0x43091b[0x0],_0x26bede=_0x43091b[0x1];_0x498ce7[_0x2d0d66(0x208)]&&(console[_0x2d0d66(0x241)](_0x2d0d66(0x232)+_0x498ce7[_0x2d0d66(0x210)]),console['error'](_0x2d0d66(0x242)+_0x4e9f11),console[_0x2d0d66(0x241)]('Folder\x20name:\x20'+_0x26bede));let _0x108872;if(_0x498ce7[_0x2d0d66(0x1ff)]){const _0x35945c=_0x498ce7['parentFolder'],_0x55fa55=await withSpinner(_0x2d0d66(0x230)+_0x4e9f11+'\x27...',()=>_0x4899f6[_0x2d0d66(0x256)][_0x2d0d66(0x253)](_0x4e9f11),{'verbose':_0x498ce7[_0x2d0d66(0x208)]}),_0x200da4=_0x55fa55[_0x2d0d66(0x1fd)],_0x4bafff=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x35945c+_0x2d0d66(0x222),()=>_0x4899f6[_0x2d0d66(0x256)][_0x2d0d66(0x229)](_0x200da4,_0x35945c),{'verbose':_0x498ce7[_0x2d0d66(0x208)]});_0x108872=_0x4bafff['data'],_0x498ce7['verbose']&&console[_0x2d0d66(0x241)](_0x2d0d66(0x261)+_0x108872);}const _0x205d7f={'name':_0x26bede,'description':_0x498ce7[_0x2d0d66(0x249)],'parentFolderId':_0x108872},_0x56de02=await withSpinner(_0x2d0d66(0x25e)+_0x26bede+_0x2d0d66(0x222),()=>_0x4899f6[_0x2d0d66(0x256)][_0x2d0d66(0x25f)](_0x4e9f11,_0x205d7f),{'verbose':_0x498ce7[_0x2d0d66(0x208)]}),_0x242346=_0x56de02[_0x2d0d66(0x1fd)];return console[_0x2d0d66(0x241)]('✔\x20Created\x20folder\x20\x27'+_0x242346['name']+'\x27\x20with\x20ID:\x20'+_0x242346['id']),await handleSDKOutput([_0x242346],_0x498ce7),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x1b4b21=a24_0x511a;(function(_0x824870,_0x4f9e4f){const _0x304fc7=a24_0x511a,_0x43a3d5=_0x824870();while(!![]){try{const _0x547e98=-parseInt(_0x304fc7(0x8a))/0x1*(-parseInt(_0x304fc7(0x87))/0x2)+-parseInt(_0x304fc7(0x93))/0x3*(parseInt(_0x304fc7(0x77))/0x4)+parseInt(_0x304fc7(0x9a))/0x5+parseInt(_0x304fc7(0x94))/0x6*(-parseInt(_0x304fc7(0xa1))/0x7)+-parseInt(_0x304fc7(0x98))/0x8*(parseInt(_0x304fc7(0x91))/0x9)+-parseInt(_0x304fc7(0x80))/0xa+-parseInt(_0x304fc7(0x8f))/0xb*(-parseInt(_0x304fc7(0x86))/0xc);if(_0x547e98===_0x4f9e4f)break;else _0x43a3d5['push'](_0x43a3d5['shift']());}catch(_0x4fcf79){_0x43a3d5['push'](_0x43a3d5['shift']());}}}(a24_0x57ce,0x27ac4));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';function a24_0x511a(_0x4f2bc6,_0x59ff19){const _0x57ce3e=a24_0x57ce();return a24_0x511a=function(_0x511ac4,_0x13af6b){_0x511ac4=_0x511ac4-0x6c;let _0x4d1685=_0x57ce3e[_0x511ac4];return _0x4d1685;},a24_0x511a(_0x4f2bc6,_0x59ff19);}function a24_0x57ce(){const _0x55e3f0=['Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Segment\x20name:\x20','Site:\x20','length','8kyREOj','noCountPopulation','✔\x20Created\x20segment\x20\x27','segment','kind','site','data','execute','verbose','202390rUpIJb','Examples:','error','Resolving\x20folder\x20\x27','segmentPath','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','333708birska','113858gdWJyy','parent','\x27...','4NpQrpA','includes','\x27\x20with\x20ID:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','187pbZEVS','Parent:\x20','437841ydnRtD','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','466050eZDfiH','474smZtEy','folderId','name','resolvePathToResource','16nSsHDG','resolveFolderId','496510fsKjVB','folder','Resolved\x20relative\x20path\x20to:\x20','description','Create\x20child\x20segment\x20with\x20filtering\x20rules','Target\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','18522TVkuVo','\x20\x20\x20Path:\x20','resolveParentId','rule','createSegment','segments','invisible'];a24_0x57ce=function(){return _0x55e3f0;};return a24_0x57ce();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']='segment:create';[a24_0x1b4b21(0x9d)]=a24_0x1b4b21(0x9e);async[a24_0x1b4b21(0x7e)](_0x185b44){const _0x5d01be=a24_0x1b4b21,{options:_0x34242e,args:_0x4ef2dd,tdx:_0x5d9ad8}=_0x185b44,_0x2c7830=_0x34242e;if(_0x4ef2dd[_0x5d01be(0x76)]===0x0)return console[_0x5d01be(0x82)](_0x5d01be(0x92)),console[_0x5d01be(0x82)](_0x5d01be(0x85)),console[_0x5d01be(0x82)](_0x5d01be(0x81)),console[_0x5d01be(0x82)](_0x5d01be(0x8e)),console[_0x5d01be(0x82)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x48d154=_0x4ef2dd[0x0],_0x556f5d=_0x34242e[_0x5d01be(0x84)];let _0x1dc459=_0x48d154;_0x556f5d&&!_0x48d154[_0x5d01be(0x8b)]('/')&&(_0x1dc459=_0x556f5d+'/'+_0x48d154,_0x2c7830['verbose']&&console[_0x5d01be(0x82)](_0x5d01be(0x9c)+_0x1dc459));const _0x54f92b=parsePath(_0x1dc459);if(_0x54f92b[_0x5d01be(0x70)][_0x5d01be(0x76)]<0x2)return console[_0x5d01be(0x82)](_0x5d01be(0x8d)),console[_0x5d01be(0x82)](_0x5d01be(0x73)),0x1;const _0x4d05e3=_0x54f92b[_0x5d01be(0x70)][0x0],_0xedc836=getBaseName(_0x1dc459),_0x385c6b=getParentPath(_0x1dc459);_0x2c7830[_0x5d01be(0x7f)]&&(console[_0x5d01be(0x82)](_0x5d01be(0x75)+_0x2c7830[_0x5d01be(0x7c)]),console[_0x5d01be(0x82)](_0x5d01be(0x9f)+_0x1dc459),console[_0x5d01be(0x82)](_0x5d01be(0x90)+_0x4d05e3),console[_0x5d01be(0x82)](_0x5d01be(0x74)+_0xedc836),console['error']('Parent\x20path:\x20'+_0x385c6b));const _0x3af35a=await withSpinner(_0x5d01be(0xa0)+_0x4d05e3+_0x5d01be(0x89),()=>_0x5d9ad8['segment'][_0x5d01be(0x6d)](_0x4d05e3),{'verbose':_0x2c7830[_0x5d01be(0x7f)]}),_0xd33ba6=_0x3af35a[_0x5d01be(0x7d)];let _0x3a7950;if(_0x54f92b[_0x5d01be(0x70)][_0x5d01be(0x76)]>0x2){const _0x37f562=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x385c6b+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x97)](_0x385c6b),{'verbose':_0x2c7830['verbose']}),_0x3ec5cd=_0x37f562[_0x5d01be(0x7d)];if(_0x3ec5cd['type']!==_0x5d01be(0x9b)&&_0x3ec5cd['type']!==_0x5d01be(0x88))return console[_0x5d01be(0x82)](_0x5d01be(0x72)),0x1;_0x3a7950=_0x3ec5cd[_0x5d01be(0x95)];}else{if(_0x2c7830['folder']){const _0x37d6e9=await withSpinner(_0x5d01be(0x83)+_0x2c7830[_0x5d01be(0x9b)]+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x99)](_0xd33ba6,_0x2c7830[_0x5d01be(0x9b)]),{'verbose':_0x2c7830[_0x5d01be(0x7f)]});_0x3a7950=_0x37d6e9['data'];}}_0x2c7830['verbose']&&_0x3a7950&&console[_0x5d01be(0x82)]('Resolved\x20folder\x20ID:\x20'+_0x3a7950);const _0x3e11e7=await loadJSONFromOptions(_0x2c7830[_0x5d01be(0x6e)],_0x2c7830['ruleFile']),_0x1e8aa1={'name':_0xedc836,'description':_0x2c7830['description'],'rule':_0x3e11e7,'kind':_0x2c7830[_0x5d01be(0x7b)]!==undefined?parseInt(_0x2c7830[_0x5d01be(0x7b)],0xa):undefined,'isVisible':_0x2c7830[_0x5d01be(0x71)]?![]:undefined,'segmentFolderId':_0x3a7950,'countPopulation':_0x2c7830[_0x5d01be(0x78)]?![]:undefined},_0x15601d=await withSpinner('Creating\x20segment\x20\x27'+_0xedc836+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x6f)](_0xd33ba6,_0x1e8aa1),{'verbose':_0x2c7830[_0x5d01be(0x7f)]}),_0x44ed0a=_0x15601d['data'];return console['error'](_0x5d01be(0x79)+_0x44ed0a[_0x5d01be(0x96)]+_0x5d01be(0x8c)+_0x44ed0a['id']),_0x1dc459!==_0x48d154&&console[_0x5d01be(0x82)](_0x5d01be(0x6c)+_0x1dc459),await handleSDKOutput([_0x44ed0a],_0x2c7830),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x43c92d=a25_0xca2a;function a25_0xca2a(_0xa0095d,_0x37ab4a){const _0x5a911d=a25_0x5a91();return a25_0xca2a=function(_0xca2a5b,_0x23ce8){_0xca2a5b=_0xca2a5b-0x122;let _0x35a1e0=_0x5a911d[_0xca2a5b];return _0x35a1e0;},a25_0xca2a(_0xa0095d,_0x37ab4a);}(function(_0x4f7ed3,_0x479622){const _0x2c599d=a25_0xca2a,_0x43f235=_0x4f7ed3();while(!![]){try{const _0x7f1eaf=parseInt(_0x2c599d(0x137))/0x1+parseInt(_0x2c599d(0x123))/0x2*(-parseInt(_0x2c599d(0x12a))/0x3)+-parseInt(_0x2c599d(0x131))/0x4*(-parseInt(_0x2c599d(0x127))/0x5)+-parseInt(_0x2c599d(0x125))/0x6+-parseInt(_0x2c599d(0x129))/0x7+-parseInt(_0x2c599d(0x12e))/0x8+parseInt(_0x2c599d(0x136))/0x9;if(_0x7f1eaf===_0x479622)break;else _0x43f235['push'](_0x43f235['shift']());}catch(_0x438f33){_0x43f235['push'](_0x43f235['shift']());}}}(a25_0x5a91,0x6378c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a25_0x43c92d(0x12b);[a25_0x43c92d(0x126)]=a25_0x43c92d(0x128);async[a25_0x43c92d(0x132)](_0xd4a55d){const _0x5f74fc=a25_0x43c92d,{options:_0x175aec,args:_0x363946,tdx:_0x13d524}=_0xd4a55d;if(_0x363946[_0x5f74fc(0x12c)]===0x0)return console[_0x5f74fc(0x12f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x5f74fc(0x130)),0x1;const _0x52c26f=_0x363946[0x0];_0x175aec[_0x5f74fc(0x122)]&&(console[_0x5f74fc(0x12f)](_0x5f74fc(0x134)+_0x175aec['site']),console['error']('Parent\x20segment:\x20'+_0x52c26f));const _0x1ae501=await withSpinner(_0x5f74fc(0x124)+_0x52c26f+'\x27...',()=>_0x13d524[_0x5f74fc(0x135)]['listFields'](_0x52c26f),{'verbose':_0x175aec['verbose']}),_0x3e2c38=_0x1ae501[_0x5f74fc(0x12d)];return console[_0x5f74fc(0x12f)](_0x5f74fc(0x133)+_0x3e2c38[_0x5f74fc(0x12c)]+'\x20field'+(_0x3e2c38[_0x5f74fc(0x12c)]!==0x1?'s':'')),await handleSDKOutput(_0x3e2c38,_0x175aec),0x0;}}function a25_0x5a91(){const _0x2c6791=['538454bMEApu','3acOrml','segment:fields','length','data','5166552SsbfIu','error','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','360uwLJLG','execute','✔\x20Found\x20','Site:\x20','segment','9324036XUsOba','326984anGfcx','verbose','984564yoHziU','Listing\x20fields\x20for\x20\x27','287274eauQXP','description','17075TYqvea','List\x20available\x20fields\x20for\x20segmentation'];a25_0x5a91=function(){return _0x2c6791;};return a25_0x5a91();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a26_0x59b2e1=a26_0x1406;function a26_0x1406(_0x31620e,_0x4d92db){const _0x34d355=a26_0x34d3();return a26_0x1406=function(_0x1406f1,_0x290925){_0x1406f1=_0x1406f1-0x13e;let _0xe95d90=_0x34d355[_0x1406f1];return _0xe95d90;},a26_0x1406(_0x31620e,_0x4d92db);}(function(_0x351f12,_0x17e57e){const _0x17e786=a26_0x1406,_0x238cac=_0x351f12();while(!![]){try{const _0x4ab661=-parseInt(_0x17e786(0x14d))/0x1+parseInt(_0x17e786(0x13e))/0x2+-parseInt(_0x17e786(0x152))/0x3*(-parseInt(_0x17e786(0x146))/0x4)+parseInt(_0x17e786(0x14c))/0x5+-parseInt(_0x17e786(0x149))/0x6+-parseInt(_0x17e786(0x14b))/0x7*(parseInt(_0x17e786(0x151))/0x8)+parseInt(_0x17e786(0x150))/0x9;if(_0x4ab661===_0x17e57e)break;else _0x238cac['push'](_0x238cac['shift']());}catch(_0xc2ffbe){_0x238cac['push'](_0x238cac['shift']());}}}(a26_0x34d3,0x89eb9));import{BaseCommand}from'./command.js';function a26_0x34d3(){const _0x6bb374=['2346720PMMwCg','341359xvcPHw','execute','\x20\x20Path:\x20','14872338BiyYkB','8oscIuc','18dvbyAT','658292DQnmjH','json','log','error','stringify','format','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','description','398572uxabCJ','Context\x20details:','Show\x20current\x20segment/folder\x20context','6618006TUgvwi','jsonl','7276843PaIjZf'];a26_0x34d3=function(){return _0x6bb374;};return a26_0x34d3();}export class SegmentPwdCommand extends BaseCommand{['name']='segment:pwd';[a26_0x59b2e1(0x145)]=a26_0x59b2e1(0x148);async[a26_0x59b2e1(0x14e)](_0xd859b1){const _0x57d617=a26_0x59b2e1,{options:_0x49a56e}=_0xd859b1;try{const _0x4db1ba=_0x49a56e['segmentPath'];if(!_0x4db1ba)return _0x49a56e[_0x57d617(0x143)]===_0x57d617(0x13f)||_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x14a)?console[_0x57d617(0x140)](JSON[_0x57d617(0x142)]({'path':'/','type':'root'})):console[_0x57d617(0x140)]('/'),0x0;if(_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x13f)||_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x14a)){const _0x528c95={'path':_0x4db1ba};console[_0x57d617(0x140)](JSON[_0x57d617(0x142)](_0x528c95));}else console[_0x57d617(0x140)](_0x4db1ba),_0x49a56e['verbose']&&(console[_0x57d617(0x141)](''),console[_0x57d617(0x141)](_0x57d617(0x147)),console[_0x57d617(0x141)](_0x57d617(0x14f)+_0x4db1ba),console['error'](''),console[_0x57d617(0x141)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x57d617(0x141)](_0x57d617(0x144)));return 0x0;}catch(_0x213782){throw _0x213782;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x345b10=a27_0x1e3d;(function(_0x13622e,_0x5d642a){const _0x50b126=a27_0x1e3d,_0x57fb90=_0x13622e();while(!![]){try{const _0x334027=-parseInt(_0x50b126(0xd7))/0x1+-parseInt(_0x50b126(0xe5))/0x2+-parseInt(_0x50b126(0xd5))/0x3+-parseInt(_0x50b126(0xe3))/0x4+-parseInt(_0x50b126(0xef))/0x5*(parseInt(_0x50b126(0xdb))/0x6)+-parseInt(_0x50b126(0xf3))/0x7+parseInt(_0x50b126(0xf4))/0x8*(parseInt(_0x50b126(0xd4))/0x9);if(_0x334027===_0x5d642a)break;else _0x57fb90['push'](_0x57fb90['shift']());}catch(_0x56136d){_0x57fb90['push'](_0x57fb90['shift']());}}}(a27_0xdfb6,0xabbec));function a27_0x1e3d(_0xb737ff,_0x526a3){const _0xdfb60=a27_0xdfb6();return a27_0x1e3d=function(_0x1e3da8,_0x5038bc){_0x1e3da8=_0x1e3da8-0xcb;let _0x14ce1d=_0xdfb60[_0x1e3da8];return _0x14ce1d;},a27_0x1e3d(_0xb737ff,_0x526a3);}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{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0x345b10(0xea);[a27_0x345b10(0xf9)]=a27_0x345b10(0xcf);async[a27_0x345b10(0xe9)](_0x4799b8){const _0x175041=a27_0x345b10,{options:_0x1070cf,args:_0x1d5952,tdx:_0x6c8303}=_0x4799b8,_0x23c0b=_0x1070cf;if(_0x1d5952[_0x175041(0xfc)]===0x0)return console[_0x175041(0xd3)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x175041(0xd3)](_0x175041(0xf8)),console['error'](_0x175041(0xde)),console[_0x175041(0xd3)](_0x175041(0xdf)),console[_0x175041(0xd3)](_0x175041(0xf2)),0x1;const _0x111915=_0x1d5952[0x0],_0x14b051=_0x1070cf[_0x175041(0xda)];let _0x75d171=_0x111915;_0x14b051&&!_0x111915[_0x175041(0xe6)]('/')&&(_0x75d171=_0x14b051+'/'+_0x111915,_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xd6)+_0x75d171));const _0x3516d9=await withSpinner(_0x175041(0xf0)+_0x75d171+_0x175041(0xe1),()=>_0x6c8303['segment'][_0x175041(0xce)](_0x75d171),{'verbose':_0x23c0b[_0x175041(0xdd)]}),_0x5a85d6=_0x3516d9['data'];_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xcb)+_0x5a85d6[_0x175041(0xf7)]);if(_0x5a85d6[_0x175041(0xf7)]!=='segment')return console['error'](_0x175041(0xd0)+_0x5a85d6['type']+_0x175041(0xe0)),console[_0x175041(0xd3)](_0x175041(0xf1)),0x1;if(!_0x5a85d6[_0x175041(0xcc)])throw new SDKError(ErrorCode[_0x175041(0xd9)],_0x175041(0xf6));const _0x2cdad6=_0x5a85d6['parentId'],_0x4903de=_0x5a85d6[_0x175041(0xcc)];_0x23c0b['verbose']&&(console[_0x175041(0xd3)](_0x175041(0xdc)+_0x2cdad6),console[_0x175041(0xd3)](_0x175041(0xed)+_0x4903de));let _0x4ce3e9;if(_0x23c0b['folder']){const _0x2497dd=_0x23c0b[_0x175041(0xd8)],_0x3212cd=await withSpinner(_0x175041(0xf5)+_0x2497dd+_0x175041(0xe1),()=>_0x6c8303[_0x175041(0xfa)][_0x175041(0xe8)](_0x2cdad6,_0x2497dd),{'verbose':_0x23c0b[_0x175041(0xdd)]});_0x4ce3e9=parseInt(_0x3212cd[_0x175041(0xfb)],0xa),_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xeb)+_0x4ce3e9);}const _0x3654f0=await loadJSONFromOptions(_0x23c0b[_0x175041(0xe7)],_0x23c0b['ruleFile']),_0x1ca825={'name':_0x23c0b[_0x175041(0xec)],'description':_0x23c0b[_0x175041(0xf9)],'rule':_0x3654f0,'kind':_0x23c0b[_0x175041(0xd1)]!==undefined?parseInt(_0x23c0b['kind'],0xa):undefined,'segmentFolderId':_0x4ce3e9},_0x2273a8=await withSpinner(_0x175041(0xe4)+_0x5a85d6[_0x175041(0xee)]+_0x175041(0xe1),()=>_0x6c8303['segment'][_0x175041(0xd2)](_0x2cdad6,_0x4903de,_0x1ca825),{'verbose':_0x23c0b[_0x175041(0xdd)]}),_0x5331de=_0x2273a8[_0x175041(0xfb)];return console['error'](_0x175041(0xe2)+_0x5331de['name']+'\x27'),_0x75d171!==_0x111915&&console[_0x175041(0xd3)](_0x175041(0xcd)+_0x75d171),await handleSDKOutput([_0x5331de],_0x23c0b),0x0;}}function a27_0xdfb6(){const _0x5679a5=['updateSegmentById','error','117aSPTVA','2912157ZLCWUn','Resolved\x20relative\x20path\x20to:\x20','778631cWgTrI','folder','INTERNAL','segmentPath','1848IrKWgW','Parent\x20ID:\x20','verbose','Examples:','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x27...','✔\x20Updated\x20segment\x20\x27','1958012JkGikq','Updating\x20segment\x20\x27','702246SIWCFy','includes','rule','resolveFolderId','execute','segment:update','Resolved\x20folder\x20ID:\x20','name','Segment\x20ID:\x20','segmentName','12785GdHrbP','Resolving\x20path\x20\x27','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1409583oEEotX','2635304RWuFgI','Resolving\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','type','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','description','segment','data','length','Resolved\x20type:\x20','segmentId','\x20\x20\x20Path:\x20','resolvePathToResource','Update\x20existing\x20child\x20segment','Error:\x20Cannot\x20update\x20','kind'];a27_0xdfb6=function(){return _0x5679a5;};return a27_0xdfb6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x434dc4=a28_0x37f1;(function(_0x12274b,_0x3981f1){const _0x489874=a28_0x37f1,_0x47ada6=_0x12274b();while(!![]){try{const _0x42c5c0=-parseInt(_0x489874(0x78))/0x1*(-parseInt(_0x489874(0x95))/0x2)+parseInt(_0x489874(0x83))/0x3*(parseInt(_0x489874(0x72))/0x4)+parseInt(_0x489874(0x67))/0x5+parseInt(_0x489874(0x68))/0x6*(parseInt(_0x489874(0x6e))/0x7)+parseInt(_0x489874(0x71))/0x8*(parseInt(_0x489874(0x80))/0x9)+parseInt(_0x489874(0x69))/0xa*(-parseInt(_0x489874(0x66))/0xb)+parseInt(_0x489874(0x94))/0xc*(-parseInt(_0x489874(0x86))/0xd);if(_0x42c5c0===_0x3981f1)break;else _0x47ada6['push'](_0x47ada6['shift']());}catch(_0x462f70){_0x47ada6['push'](_0x47ada6['shift']());}}}(a28_0x4b49,0xc423e));function a28_0x37f1(_0x55ff9e,_0x3a5d67){const _0x4b49e8=a28_0x4b49();return a28_0x37f1=function(_0x37f195,_0x4d6615){_0x37f195=_0x37f195-0x64;let _0x218158=_0x4b49e8[_0x37f195];return _0x218158;},a28_0x37f1(_0x55ff9e,_0x3a5d67);}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_0x434dc4(0x6f);[a28_0x434dc4(0x99)]=a28_0x434dc4(0x8d);async[a28_0x434dc4(0x85)](_0x48ec6b){const _0x1d2301=a28_0x434dc4,{options:_0x465a27,args:_0x340f00,tdx:_0x252539}=_0x48ec6b;if(_0x340f00[_0x1d2301(0x65)]===0x0)return console[_0x1d2301(0x93)](_0x1d2301(0x7b)),console['error'](_0x1d2301(0x7a)),console['error']('Examples:'),console[_0x1d2301(0x93)](_0x1d2301(0x70)),console[_0x1d2301(0x93)](_0x1d2301(0x89)),console[_0x1d2301(0x93)](_0x1d2301(0x7d)),console[_0x1d2301(0x93)](_0x1d2301(0x8c)),0x1;const _0x3bf99f=_0x340f00[0x0],_0x3ab212=_0x465a27['session'];try{if(_0x3bf99f==='/')return saveSessionContext({'segment_path':undefined},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x97)),0x0;const _0x13de47=_0x465a27[_0x1d2301(0x76)];let _0x5dfec1=_0x3bf99f;const _0x45e030=parsePath(_0x3bf99f);if(!_0x45e030[_0x1d2301(0x88)]){if(!_0x13de47)return console[_0x1d2301(0x93)](_0x1d2301(0x77)),console[_0x1d2301(0x93)](_0x1d2301(0x8b)),0x1;if(_0x3bf99f==='..'){const _0x4ab308=_0x13de47[_0x1d2301(0x6b)]('/')[_0x1d2301(0x8a)](0x0,-0x1)[_0x1d2301(0x91)]('/');_0x5dfec1=_0x4ab308||'/';}else _0x3bf99f==='.'?_0x5dfec1=_0x13de47:_0x5dfec1=_0x13de47+'/'+_0x3bf99f;_0x465a27[_0x1d2301(0x92)]&&console[_0x1d2301(0x93)](_0x1d2301(0x90)+_0x5dfec1);}if(_0x5dfec1==='/'||_0x5dfec1==='')return saveSessionContext({'segment_path':undefined},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x97)),0x0;_0x5dfec1=normalizePath(_0x5dfec1);const _0x3b4988=parsePath(_0x5dfec1)['segments'];if(_0x3b4988['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3ab212),console['log'](_0x1d2301(0x97)),0x0;_0x465a27[_0x1d2301(0x92)]&&(console[_0x1d2301(0x93)]('Site:\x20'+_0x465a27[_0x1d2301(0x7c)]),console[_0x1d2301(0x93)](_0x1d2301(0x84)+_0x5dfec1));const _0x48fd53=await withSpinner(_0x1d2301(0x7e)+_0x5dfec1+_0x1d2301(0x8e),()=>_0x252539[_0x1d2301(0x79)][_0x1d2301(0x82)](_0x5dfec1),{'verbose':_0x465a27[_0x1d2301(0x92)]}),_0x37ef4f=_0x48fd53['data'];_0x465a27[_0x1d2301(0x92)]&&(console[_0x1d2301(0x93)](_0x1d2301(0x98)+_0x37ef4f['type']),console['error'](_0x1d2301(0x74)+_0x37ef4f['parentId']),_0x37ef4f[_0x1d2301(0x87)]&&console[_0x1d2301(0x93)]('Folder\x20ID:\x20'+_0x37ef4f[_0x1d2301(0x87)]));if(_0x37ef4f[_0x1d2301(0x8f)]===_0x1d2301(0x79))return console[_0x1d2301(0x93)](_0x1d2301(0x64)),console[_0x1d2301(0x93)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x1d2301(0x93)](_0x1d2301(0x73)+_0x37ef4f['parentName']+(_0x37ef4f['folderPath']?'/'+_0x37ef4f[_0x1d2301(0x6a)][_0x1d2301(0x91)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x37ef4f[_0x1d2301(0x81)],'parent_segment':_0x37ef4f[_0x1d2301(0x75)]},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x96)+_0x37ef4f[_0x1d2301(0x81)]),_0x465a27[_0x1d2301(0x92)]&&(console['error']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context'),console['error'](_0x1d2301(0x6c)),console['error'](_0x1d2301(0x7f))),0x0;}catch(_0x50f782){throw _0x50f782;}}}function a28_0x4b49(){const _0xfd9084=['11035277iVhBSG','6479280mlGYGf','6gdGaXo','10MjOHOH','folderPath','split','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','log','4081609TBQGTb','segment:use','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','16PiRNzy','4OnxqfW','Use:\x20tdx\x20segment\x20use\x20','Parent\x20ID:\x20','parentName','segmentPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','668611AuQaCU','segment','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20Path\x20is\x20required','site','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Resolving\x20path\x20\x27','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','2778129HnNAQM','fullPath','resolvePathToResource','1427577JKcRQV','Target\x20path:\x20','execute','23844314irBRwC','folderId','isAbsolute','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','slice','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x27...','type','Resolved\x20relative\x20path\x20to:\x20','join','verbose','error','12PGbmuB','2ytyaNg','Context\x20set\x20to:\x20','Context\x20cleared.\x20Back\x20to\x20root.','Resolved\x20path\x20type:\x20','description','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','length'];a28_0x4b49=function(){return _0xfd9084;};return a28_0x4b49();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x2d727a=a29_0x32d5;(function(_0x4b8ac8,_0x1e1069){const _0x2af43c=a29_0x32d5,_0xd02276=_0x4b8ac8();while(!![]){try{const _0x120197=parseInt(_0x2af43c(0xd3))/0x1*(-parseInt(_0x2af43c(0x103))/0x2)+parseInt(_0x2af43c(0xca))/0x3*(-parseInt(_0x2af43c(0xbe))/0x4)+-parseInt(_0x2af43c(0xc4))/0x5+-parseInt(_0x2af43c(0xd5))/0x6+-parseInt(_0x2af43c(0xda))/0x7*(parseInt(_0x2af43c(0xf5))/0x8)+-parseInt(_0x2af43c(0x104))/0x9+parseInt(_0x2af43c(0xc0))/0xa*(parseInt(_0x2af43c(0xf7))/0xb);if(_0x120197===_0x1e1069)break;else _0xd02276['push'](_0xd02276['shift']());}catch(_0x37d4a4){_0xd02276['push'](_0xd02276['shift']());}}}(a29_0x46b8,0xd9033));import{BaseCommand}from'./command.js';function a29_0x46b8(){const _0x397f6d=['50490VuDqlO','test','length','filter','recursive','\x20segment','384342UjVLwA','site','verbose','Listing\x20parent\x20segments...','👥\x20','\x20folder','name','jsonl','listParents','1bMbdzE','map','8778090idbHyP','sort','folder','✔\x20Found\x20','message','4305mSMgWL','Listing\x20parent\x20segments\x20matching\x20\x27','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','log','maxDepth','Error:\x20','Listing\x20folders\x20and\x20segments...','description','replace','\x20top-level\x20items','Resolving\x20context\x20path\x20\x27','cause','\x5c$&','\x20and\x20','Path/pattern\x20arg:\x20','Parent\x20ID:\x20','execute','\x27...','data','json','segments','(empty)','segment','format','segmentPath','resolvePathToResource','No\x20parent\x20segments\x20match\x20pattern:\x20','1128RHxImR','population','44eEpXyU','Current\x20context:\x20','\x20\x20Cause:\x20','Building\x20hierarchy\x20tree...','✔\x20Built\x20tree\x20with\x20','Site:\x20','localeCompare','listUnified','attributes','folderId','dim','includes','1257586sxrXiS','739044wTEMmJ','parentId','error','listRecursive','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','16tNwjkB','[parent\x20segments]','9180190zszPYC','Folder\x20ID:\x20','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','\x20parent\x20segment'];a29_0x46b8=function(){return _0x397f6d;};return a29_0x46b8();}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';function a29_0x32d5(_0x21d354,_0x5d1924){const _0x46b8a6=a29_0x46b8();return a29_0x32d5=function(_0x32d552,_0x414abb){_0x32d552=_0x32d552-0xbd;let _0x5a6c49=_0x46b8a6[_0x32d552];return _0x5a6c49;},a29_0x32d5(_0x21d354,_0x5d1924);}import{formatRows}from'../utils/formatters.js';import a29_0x547f0a from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0x2d727a(0xd0)]=a29_0x2d727a(0xee);[a29_0x2d727a(0xe1)]=a29_0x2d727a(0xc2);async[a29_0x2d727a(0xea)](_0xd1135f){const _0x3b8397=a29_0x2d727a,{options:_0x3a62be,args:_0x4ca2ff}=_0xd1135f,_0x44ef8b=_0x3a62be[_0x3b8397(0xc8)],_0x182cb9=_0x4ca2ff[0x0];try{const _0x37fa00=_0x3a62be[_0x3b8397(0xf2)];_0x3a62be[_0x3b8397(0xcc)]&&(console[_0x3b8397(0x106)](_0x3b8397(0xfc)+_0x3a62be[_0x3b8397(0xcb)]),console[_0x3b8397(0x106)](_0x3b8397(0xf8)+(_0x37fa00||'/')),_0x182cb9&&console['error'](_0x3b8397(0xe8)+_0x182cb9),_0x44ef8b&&console[_0x3b8397(0x106)]('Recursive\x20mode:\x20enabled'));if(_0x182cb9){const _0x2d651a=_0x182cb9[_0x3b8397(0x102)]('*')||_0x182cb9['includes']('?');if(_0x2d651a&&!_0x37fa00)return await this['listParentsWithPattern'](_0xd1135f,_0x182cb9);else return _0x2d651a?(console[_0x3b8397(0x106)](_0x3b8397(0xdc)),console[_0x3b8397(0x106)](_0x3b8397(0xbd)),0x1):_0x44ef8b?await this[_0x3b8397(0x107)](_0xd1135f,_0x182cb9):await this['listUnified'](_0xd1135f,_0x182cb9);}if(!_0x37fa00)return await this[_0x3b8397(0xd2)](_0xd1135f);return _0x44ef8b?await this[_0x3b8397(0x107)](_0xd1135f,_0x37fa00):await this['listUnified'](_0xd1135f,_0x37fa00);}catch(_0x2cddc3){if(_0x2cddc3 instanceof SDKError)return console[_0x3b8397(0x106)](_0x3b8397(0xdf)+_0x2cddc3[_0x3b8397(0xd9)]),_0x2cddc3[_0x3b8397(0xe5)]&&console[_0x3b8397(0x106)](_0x3b8397(0xf9)+_0x2cddc3['cause']),0x1;throw _0x2cddc3;}}async['listParentsWithPattern'](_0x525e1b,_0x13b428){const _0x55226e=a29_0x2d727a,{options:_0x3b3681,tdx:_0x6f8719}=_0x525e1b,_0x4a0fdd=await withSpinner(_0x55226e(0xdb)+_0x13b428+'\x27...',()=>_0x6f8719[_0x55226e(0xf0)][_0x55226e(0xd2)](),{'verbose':_0x3b3681[_0x55226e(0xcc)]}),_0x25e590=_0x4a0fdd['data'],_0x46736e=_0x13b428['replace'](/[.+^${}()|[\]\\]/g,_0x55226e(0xe6))[_0x55226e(0xe2)](/\*/g,'.*')[_0x55226e(0xe2)](/\?/g,'.'),_0x592b84=new RegExp('^'+_0x46736e+'$','i'),_0x461599=_0x25e590[_0x55226e(0xc7)](_0x406fb8=>_0x592b84[_0x55226e(0xc5)](_0x406fb8[_0x55226e(0xff)][_0x55226e(0xd0)]));console[_0x55226e(0x106)](_0x55226e(0xd8)+_0x461599['length']+_0x55226e(0xc3)+(_0x461599[_0x55226e(0xc6)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x13b428+'\x27');if(_0x3b3681['format']===_0x55226e(0xed)||_0x3b3681[_0x55226e(0xf1)]===_0x55226e(0xd1))await handleSDKOutput(_0x461599,_0x3b3681);else{if(_0x461599[_0x55226e(0xc6)]===0x0)console[_0x55226e(0xdd)](_0x55226e(0xf4)+_0x13b428);else{console['log'](_0x55226e(0xbf));for(const _0x358778 of _0x461599){const _0x490cba=_0x358778[_0x55226e(0xff)][_0x55226e(0xf6)]?a29_0x547f0a[_0x55226e(0x101)]('\x20('+formatRows(_0x358778[_0x55226e(0xff)][_0x55226e(0xf6)])+')'):'';console[_0x55226e(0xdd)](_0x55226e(0xce)+_0x358778['attributes'][_0x55226e(0xd0)]+_0x490cba);}}}return 0x0;}async[a29_0x2d727a(0xd2)](_0x3393bb){const _0x47b7a7=a29_0x2d727a,{options:_0x139af4,tdx:_0x39a223}=_0x3393bb,_0x4c367a=await withSpinner(_0x47b7a7(0xcd),()=>_0x39a223[_0x47b7a7(0xf0)][_0x47b7a7(0xd2)](),{'verbose':_0x139af4['verbose']}),_0x5404d0=_0x4c367a['data'];console['error'](_0x47b7a7(0xd8)+_0x5404d0[_0x47b7a7(0xc6)]+'\x20parent\x20segment'+(_0x5404d0[_0x47b7a7(0xc6)]!==0x1?'s':''));if(_0x139af4[_0x47b7a7(0xf1)]===_0x47b7a7(0xed)||_0x139af4[_0x47b7a7(0xf1)]===_0x47b7a7(0xd1))await handleSDKOutput(_0x5404d0,_0x139af4);else{console[_0x47b7a7(0xdd)]('[parent\x20segments]');for(const _0x4ea71e of _0x5404d0){const _0xdab95d=_0x4ea71e['attributes'][_0x47b7a7(0xf6)]?a29_0x547f0a[_0x47b7a7(0x101)]('\x20('+formatRows(_0x4ea71e[_0x47b7a7(0xff)][_0x47b7a7(0xf6)])+')'):'';console[_0x47b7a7(0xdd)](_0x47b7a7(0xce)+_0x4ea71e[_0x47b7a7(0xff)][_0x47b7a7(0xd0)]+_0xdab95d);}}return 0x0;}async[a29_0x2d727a(0xfe)](_0x59d890,_0x4f5120){const _0x1ba0bc=a29_0x2d727a,{options:_0x1e462e,tdx:_0x43a40d}=_0x59d890,_0x37f54b=await withSpinner(_0x1ba0bc(0xe4)+_0x4f5120+_0x1ba0bc(0xeb),()=>_0x43a40d['segment'][_0x1ba0bc(0xf3)](_0x4f5120),{'verbose':_0x1e462e['verbose']}),_0x3f474f=_0x37f54b[_0x1ba0bc(0xec)];_0x1e462e['verbose']&&(console[_0x1ba0bc(0x106)](_0x1ba0bc(0xe9)+_0x3f474f[_0x1ba0bc(0x105)]),_0x3f474f['folderId']&&console['error'](_0x1ba0bc(0xc1)+_0x3f474f[_0x1ba0bc(0x100)]));const _0xf47cf9=await withSpinner(_0x1ba0bc(0xe0),()=>_0x43a40d[_0x1ba0bc(0xf0)]['listUnified'](_0x3f474f[_0x1ba0bc(0x105)],_0x3f474f['folderId']),{'verbose':_0x1e462e[_0x1ba0bc(0xcc)]}),{folders:_0x5a3a4c,segments:_0x28a49d}=_0xf47cf9[_0x1ba0bc(0xec)],_0x445898=_0x5a3a4c[_0x1ba0bc(0xc6)]+_0x28a49d[_0x1ba0bc(0xc6)];console[_0x1ba0bc(0x106)](_0x1ba0bc(0xd8)+_0x5a3a4c[_0x1ba0bc(0xc6)]+_0x1ba0bc(0xcf)+(_0x5a3a4c['length']!==0x1?'s':'')+_0x1ba0bc(0xe7)+_0x28a49d[_0x1ba0bc(0xc6)]+_0x1ba0bc(0xc9)+(_0x28a49d[_0x1ba0bc(0xc6)]!==0x1?'s':''));if(_0x1e462e[_0x1ba0bc(0xf1)]==='json'||_0x1e462e[_0x1ba0bc(0xf1)]===_0x1ba0bc(0xd1)){const _0x29318d=[..._0x5a3a4c['map'](_0x50b538=>({..._0x50b538,'type':_0x1ba0bc(0xd7)})),..._0x28a49d[_0x1ba0bc(0xd4)](_0x4970a2=>({..._0x4970a2,'type':_0x1ba0bc(0xf0)}))][_0x1ba0bc(0xd6)]((_0x4eb8ed,_0x492479)=>_0x4eb8ed[_0x1ba0bc(0xd0)][_0x1ba0bc(0xfd)](_0x492479['name']));await handleSDKOutput(_0x29318d,_0x1e462e);}else{if(_0x445898===0x0)console[_0x1ba0bc(0xdd)](a29_0x547f0a['dim']('[/'+_0x4f5120+']')),console[_0x1ba0bc(0xdd)](_0x1ba0bc(0xef));else{console['log'](a29_0x547f0a['dim']('[/'+_0x4f5120+']'));const _0x2c5b0e=formatFlatList(_0x5a3a4c,_0x28a49d,{'showMetadata':!![]});console['log'](_0x2c5b0e);}}return 0x0;}async[a29_0x2d727a(0x107)](_0x41a87c,_0x58188c){const _0x44ff96=a29_0x2d727a,{options:_0x25b2ac,tdx:_0x38ec0e}=_0x41a87c,_0xf8e90b=await withSpinner(_0x44ff96(0xe4)+_0x58188c+'\x27...',()=>_0x38ec0e[_0x44ff96(0xf0)][_0x44ff96(0xf3)](_0x58188c),{'verbose':_0x25b2ac[_0x44ff96(0xcc)]}),_0x4704c4=_0xf8e90b['data'];_0x25b2ac[_0x44ff96(0xcc)]&&(console[_0x44ff96(0x106)](_0x44ff96(0xe9)+_0x4704c4[_0x44ff96(0x105)]),_0x4704c4[_0x44ff96(0x100)]&&console[_0x44ff96(0x106)](_0x44ff96(0xc1)+_0x4704c4[_0x44ff96(0x100)]));const _0x4b32fb=_0x25b2ac[_0x44ff96(0xde)]||0xa,_0x47c1b8=await withSpinner(_0x44ff96(0xfa),()=>_0x38ec0e['segment'][_0x44ff96(0x107)](_0x4704c4[_0x44ff96(0x105)],_0x4704c4[_0x44ff96(0x100)],0x0,_0x4b32fb),{'verbose':_0x25b2ac[_0x44ff96(0xcc)]}),_0x28700d=_0x47c1b8[_0x44ff96(0xec)];console['error'](_0x44ff96(0xfb)+_0x28700d['length']+_0x44ff96(0xe3));if(_0x25b2ac[_0x44ff96(0xf1)]===_0x44ff96(0xed)||_0x25b2ac[_0x44ff96(0xf1)]===_0x44ff96(0xd1))await handleSDKOutput(_0x28700d,_0x25b2ac);else{console['log'](a29_0x547f0a[_0x44ff96(0x101)]('[/'+_0x58188c+']'));const _0x38a90e=formatTree(_0x28700d,{'showMetadata':!![]});console['log'](_0x38a90e);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a30_0x43d28f=a30_0x3bb4;function a30_0x3f00(){const _0x410add=['315tecBOQ','10274960vfVTFI','9oNFoco','catalog','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','limit','query','Limit:\x20','cause','15767700PtjaJA','Querying\x20','✔\x20Retrieved\x20','Site:\x20','Show\x20table\x20contents','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','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','length','\x20from\x20','654ctXIBO','validate','showTable','table','72478AKYWDq','108283yVvKtW','1379409jCJSUx','error','...','database','\x20\x20Cause:\x20','Error:\x20','name','show','60212JNnJKx','message','55304469RQrxTb','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Usage:\x20tdx\x20show\x20<database.table>','args','execute','verbose','data','24IjohIX','Database:\x20','description'];a30_0x3f00=function(){return _0x410add;};return a30_0x3f00();}(function(_0x4951cb,_0x803128){const _0x33984d=a30_0x3bb4,_0x4f1074=_0x4951cb();while(!![]){try{const _0x2a8a92=-parseInt(_0x33984d(0xcd))/0x1*(-parseInt(_0x33984d(0xe6))/0x2)+-parseInt(_0x33984d(0xe8))/0x3+parseInt(_0x33984d(0xf0))/0x4*(parseInt(_0x33984d(0xd0))/0x5)+-parseInt(_0x33984d(0xe2))/0x6*(-parseInt(_0x33984d(0xe7))/0x7)+-parseInt(_0x33984d(0xd1))/0x8*(-parseInt(_0x33984d(0xd2))/0x9)+parseInt(_0x33984d(0xd9))/0xa+-parseInt(_0x33984d(0xc6))/0xb;if(_0x2a8a92===_0x803128)break;else _0x4f1074['push'](_0x4f1074['shift']());}catch(_0x354602){_0x4f1074['push'](_0x4f1074['shift']());}}}(a30_0x3f00,0xd651e));import{BaseCommand}from'./command.js';function a30_0x3bb4(_0x2486c2,_0x1254ff){const _0x3f0085=a30_0x3f00();return a30_0x3bb4=function(_0x3bb4fb,_0x9e1444){_0x3bb4fb=_0x3bb4fb-0xc5;let _0xd28f35=_0x3f0085[_0x3bb4fb];return _0xd28f35;},a30_0x3bb4(_0x2486c2,_0x1254ff);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';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_0x43d28f(0xee)]=a30_0x43d28f(0xef);[a30_0x43d28f(0xcf)]=a30_0x43d28f(0xdd);async[a30_0x43d28f(0xca)](_0x5caa81){const _0x239b99=a30_0x43d28f;return this[_0x239b99(0xe4)](_0x5caa81);}async[a30_0x43d28f(0xe4)](_0x147bfb){const _0x1f07e1=a30_0x43d28f,{options:_0x66f908,args:_0x953647,tdx:_0xdaf8a2}=_0x147bfb;let _0x4a6547;try{_0x4a6547=parseTableReference(_0x953647[0x0]);const _0x320f3a=_0x66f908[_0x1f07e1(0xeb)];!_0x4a6547[_0x1f07e1(0xeb)]&&_0x320f3a&&(_0x4a6547[_0x1f07e1(0xeb)]=_0x320f3a);const _0x570bb4=validateTableDescribeReference(_0x4a6547);if(_0x570bb4)return console[_0x1f07e1(0xe9)](_0x1f07e1(0xed)+_0x570bb4),console[_0x1f07e1(0xe9)](_0x1f07e1(0xc8)),console['error'](_0x1f07e1(0xd4)),console['error'](_0x1f07e1(0xde)),0x1;}catch(_0x100d80){return console['error']('Error:\x20'+_0x100d80[_0x1f07e1(0xc5)]),console[_0x1f07e1(0xe9)](_0x1f07e1(0xc8)),console[_0x1f07e1(0xe9)](_0x1f07e1(0xd4)),console['error'](_0x1f07e1(0xde)),0x1;}const _0x3dea45=_0x4a6547[_0x1f07e1(0xd3)],_0x33c144=_0x4a6547[_0x1f07e1(0xeb)],_0x21764b=_0x4a6547[_0x1f07e1(0xe5)],_0x4f3ca6=resolveLimit(_0x66f908[_0x1f07e1(0xd5)],DEFAULT_DISPLAY_LIMIT);try{_0x66f908[_0x1f07e1(0xcb)]&&(console[_0x1f07e1(0xe9)](_0x1f07e1(0xdc)+_0x66f908['site']),_0x3dea45&&console[_0x1f07e1(0xe9)]('Catalog:\x20'+_0x3dea45),console[_0x1f07e1(0xe9)](_0x1f07e1(0xce)+_0x33c144),console[_0x1f07e1(0xe9)]('Table:\x20'+_0x21764b),console[_0x1f07e1(0xe9)](_0x1f07e1(0xd7)+_0x4f3ca6));const _0x3bc7b5=_0x3dea45?_0x3dea45+'.'+_0x33c144+'.'+_0x21764b:_0x33c144+'.'+_0x21764b,_0x2d0e14=await withSpinner(_0x1f07e1(0xda)+_0x3bc7b5+_0x1f07e1(0xea),()=>_0xdaf8a2[_0x1f07e1(0xd6)][_0x1f07e1(0xe4)](_0x33c144,_0x21764b,_0x4f3ca6,_0x3dea45),{'verbose':_0x66f908[_0x1f07e1(0xcb)]}),_0x3a9cc8=_0x2d0e14[_0x1f07e1(0xcc)],_0x35bab2=_0x3a9cc8[_0x1f07e1(0xcc)];return _0x35bab2[_0x1f07e1(0xe0)]===0x0?console[_0x1f07e1(0xe9)](_0x1f07e1(0xc7)):console[_0x1f07e1(0xe9)](_0x1f07e1(0xdb)+_0x35bab2[_0x1f07e1(0xe0)]+'\x20row'+(_0x35bab2[_0x1f07e1(0xe0)]!==0x1?'s':'')+_0x1f07e1(0xe1)+_0x3bc7b5),await handleSDKOutput(_0x35bab2,_0x66f908),0x0;}catch(_0x57e55f){if(_0x57e55f instanceof SDKError)return console[_0x1f07e1(0xe9)]('Error:\x20'+_0x57e55f[_0x1f07e1(0xc5)]),_0x57e55f['cause']&&console[_0x1f07e1(0xe9)](_0x1f07e1(0xec)+_0x57e55f[_0x1f07e1(0xd8)]),0x1;throw _0x57e55f;}}[a30_0x43d28f(0xe3)](_0x30e09c){const _0x13ff48=a30_0x43d28f;if(_0x30e09c[_0x13ff48(0xc9)]['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(_0x30e09c[_0x13ff48(0xc9)][_0x13ff48(0xe0)]>0x1)return _0x13ff48(0xdf);return undefined;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x42384c=a31_0x1864;(function(_0x40442f,_0x1f0125){const _0x490d0a=a31_0x1864,_0x24a0b6=_0x40442f();while(!![]){try{const _0x21e392=parseInt(_0x490d0a(0x185))/0x1+parseInt(_0x490d0a(0x17b))/0x2*(parseInt(_0x490d0a(0x176))/0x3)+-parseInt(_0x490d0a(0x174))/0x4*(-parseInt(_0x490d0a(0x169))/0x5)+parseInt(_0x490d0a(0x183))/0x6*(parseInt(_0x490d0a(0x194))/0x7)+-parseInt(_0x490d0a(0x189))/0x8*(-parseInt(_0x490d0a(0x187))/0x9)+-parseInt(_0x490d0a(0x170))/0xa+-parseInt(_0x490d0a(0x193))/0xb*(parseInt(_0x490d0a(0x190))/0xc);if(_0x21e392===_0x1f0125)break;else _0x24a0b6['push'](_0x24a0b6['shift']());}catch(_0x4b59ce){_0x24a0b6['push'](_0x24a0b6['shift']());}}}(a31_0xd63d,0x22b36));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0xd63d(){const _0x10ed19=['includes','name','site','2168UKaIuI','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','62574jIdRRJ','listTables','\x20\x20Cause:\x20','database','message','16FtaUIN','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','data','length','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Database:\x20','\x27\x20across\x20all\x20databases.','verbose','726dcJMeU','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','200668vnvCkc','.*\x22','9cVwYMb','Listing\x20tables...','1697048pUquMx','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','table','cause','Site:\x20','\x27\x20is\x20ambiguous.','Database:\x20all','6792NhfolA','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','tables','11363oOxbLD','8729bqDBfX','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','description','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','execute','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','validate','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Error:\x20','1445KCpvwQ','Note:\x20\x27','\x20table','error','limit','Table\x20pattern:\x20','List\x20tables\x20in\x20a\x20database','1603760NYXigj'];a31_0xd63d=function(){return _0x10ed19;};return a31_0xd63d();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';function a31_0x1864(_0x259cd4,_0x478bcc){const _0xd63d32=a31_0xd63d();return a31_0x1864=function(_0x186463,_0x546b27){_0x186463=_0x186463-0x161;let _0x4f1396=_0xd63d32[_0x186463];return _0x4f1396;},a31_0x1864(_0x259cd4,_0x478bcc);}import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a31_0x42384c(0x172)]=a31_0x42384c(0x192);[a31_0x42384c(0x161)]=a31_0x42384c(0x16f);async[a31_0x42384c(0x163)](_0x4879dc){const _0x410931=a31_0x42384c,{options:_0x4bba7d,args:_0x4f98cf,tdx:_0x59253c}=_0x4879dc;let _0x58b250;if(_0x4f98cf['length']===0x0)_0x58b250={'database':undefined,'table':undefined,'original':''};else{if(_0x4f98cf[_0x410931(0x17e)]===0x1)try{_0x58b250=parseTableReference(_0x4f98cf[0x0]);if(_0x58b250['table']&&!_0x58b250[_0x410931(0x179)]&&!_0x58b250[_0x410931(0x18b)][_0x410931(0x171)]('*')&&!_0x58b250['table']['includes']('?'))return console[_0x410931(0x16c)]('Error:\x20Pattern\x20\x27'+_0x4f98cf[0x0]+_0x410931(0x18e)),console[_0x410931(0x16c)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x58b250[_0x410931(0x18b)]+'\x27?'),console[_0x410931(0x16c)](_0x410931(0x164)+_0x58b250[_0x410931(0x18b)]+_0x410931(0x186)),console[_0x410931(0x16c)](_0x410931(0x191)+_0x58b250[_0x410931(0x18b)]),console['error'](_0x410931(0x17f)+_0x58b250[_0x410931(0x18b)]),console[_0x410931(0x16c)](''),console[_0x410931(0x16c)](_0x410931(0x16a)+_0x4f98cf[0x0]+_0x410931(0x175)+_0x58b250[_0x410931(0x18b)]+_0x410931(0x181)),0x1;}catch(_0x38a6e8){return console[_0x410931(0x16c)](_0x410931(0x168)+_0x38a6e8['message']),0x1;}else return console[_0x410931(0x16c)](_0x410931(0x195)),console['error'](_0x410931(0x18a)),console[_0x410931(0x16c)](_0x410931(0x184)),console[_0x410931(0x16c)](_0x410931(0x17c)),console[_0x410931(0x16c)](_0x410931(0x165)),console[_0x410931(0x16c)]('Or\x20use\x20--in\x20flag:'),console[_0x410931(0x16c)](_0x410931(0x162)),0x1;}const _0x538d2a=_0x4bba7d[_0x410931(0x179)];!_0x58b250[_0x410931(0x179)]&&_0x538d2a&&(_0x58b250[_0x410931(0x179)]=_0x538d2a);try{const _0x330e5e=_0x30da6f=>_0x30da6f&&(_0x30da6f[_0x410931(0x171)]('*')||_0x30da6f[_0x410931(0x171)]('?')),_0x1ce00b=_0x330e5e(_0x58b250[_0x410931(0x179)]);_0x4bba7d['verbose']&&(console['error'](_0x410931(0x18d)+_0x4bba7d[_0x410931(0x173)]),_0x58b250[_0x410931(0x179)]?_0x1ce00b?console[_0x410931(0x16c)]('Database\x20pattern:\x20'+_0x58b250[_0x410931(0x179)]):console['error'](_0x410931(0x180)+_0x58b250[_0x410931(0x179)]):console[_0x410931(0x16c)](_0x410931(0x18f)),_0x58b250['table']&&console[_0x410931(0x16c)](_0x410931(0x16e)+_0x58b250[_0x410931(0x18b)]));const _0x1f47eb=_0x58b250[_0x410931(0x179)]&&!_0x1ce00b?_0x58b250[_0x410931(0x179)]:undefined,_0x2277b3=_0x1ce00b?_0x58b250[_0x410931(0x179)]:undefined,_0x15c02b=_0x58b250[_0x410931(0x18b)],_0x21d9b8=resolveLimit(_0x4bba7d[_0x410931(0x16d)],DEFAULT_LISTING_LIMIT),_0x29bbf3=await withSpinner(_0x410931(0x188),()=>_0x59253c['query'][_0x410931(0x177)](_0x1f47eb,_0x15c02b,_0x2277b3,_0x21d9b8),{'verbose':_0x4bba7d[_0x410931(0x182)]}),_0xe4185e=_0x29bbf3[_0x410931(0x17d)];if(_0xe4185e[_0x410931(0x17e)]===0x0&&_0x58b250['database']&&!_0x1ce00b)return console[_0x410931(0x16c)]('✖\x20No\x20tables\x20found'),console[_0x410931(0x16c)]('Database\x20\x27'+_0x58b250[_0x410931(0x179)]+_0x410931(0x167)),0x1;return console[_0x410931(0x16c)]('✔\x20Found\x20'+_0xe4185e[_0x410931(0x17e)]+_0x410931(0x16b)+(_0xe4185e[_0x410931(0x17e)]!==0x1?'s':'')),await handleSDKOutput(_0xe4185e,{..._0x4bba7d,'limit':_0x21d9b8}),0x0;}catch(_0x974726){if(_0x974726 instanceof SDKError)return console[_0x410931(0x16c)](_0x410931(0x168)+_0x974726[_0x410931(0x17a)]),_0x974726[_0x410931(0x18c)]&&console[_0x410931(0x16c)](_0x410931(0x178)+_0x974726[_0x410931(0x18c)]),0x1;throw _0x974726;}}[a31_0x42384c(0x166)](_0xf1db6a){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x1e2d02=a32_0x25ed;(function(_0x152599,_0xb30cf7){const _0x4d0ba3=a32_0x25ed,_0x27809d=_0x152599();while(!![]){try{const _0x348ed5=-parseInt(_0x4d0ba3(0x145))/0x1*(-parseInt(_0x4d0ba3(0x125))/0x2)+parseInt(_0x4d0ba3(0x12b))/0x3*(parseInt(_0x4d0ba3(0x13d))/0x4)+-parseInt(_0x4d0ba3(0x14a))/0x5*(parseInt(_0x4d0ba3(0x135))/0x6)+-parseInt(_0x4d0ba3(0x146))/0x7+parseInt(_0x4d0ba3(0x132))/0x8+parseInt(_0x4d0ba3(0x137))/0x9*(parseInt(_0x4d0ba3(0x129))/0xa)+parseInt(_0x4d0ba3(0x128))/0xb*(-parseInt(_0x4d0ba3(0x12a))/0xc);if(_0x348ed5===_0xb30cf7)break;else _0x27809d['push'](_0x27809d['shift']());}catch(_0x3b612c){_0x27809d['push'](_0x27809d['shift']());}}}(a32_0x1ef3,0x6b849));import{BaseCommand}from'./command.js';function a32_0x1ef3(){const _0x3cab1f=['\x20(session:\x20','3MvFFzo','4335884kiQBqd','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','error','message','3629870YcXOJc','length','329150rXPMPT','parent_segment','session','22cPsTch','40cHZQfh','1552956vxCVSe','1929813gynFSw','log','Set\x20session-level\x20context','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','includes','llm_project','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','6193224sjRAtB','profile','Session\x20parent_segment\x20set\x20to:\x20','6MBjPPx','toString','300276jUWQgW','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Session\x20profile\x20set\x20to:\x20','database','\x27\x20does\x20not\x20exist','4FCEMCP','Error:\x20','validate','use','name','join','.\x20Must\x20be\x20one\x20of:\x20'];a32_0x1ef3=function(){return _0x3cab1f;};return a32_0x1ef3();}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';function a32_0x25ed(_0x15755f,_0x4bc920){const _0x1ef3aa=a32_0x1ef3();return a32_0x25ed=function(_0x25ed95,_0x29c2cd){_0x25ed95=_0x25ed95-0x125;let _0x4f48af=_0x1ef3aa[_0x25ed95];return _0x4f48af;},a32_0x25ed(_0x15755f,_0x4bc920);}import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a32_0x1e2d02(0x141)]=a32_0x1e2d02(0x140);['description']=a32_0x1e2d02(0x12d);[a32_0x1e2d02(0x13f)](_0x22549b){const _0x224565=a32_0x1e2d02,{args:_0x78891e}=_0x22549b;if(_0x78891e[_0x224565(0x14b)]<0x2)return _0x224565(0x138)+_0x224565(0x147)+_0x224565(0x131)+_0x224565(0x139);const _0x318723=_0x78891e[0x0],_0x23ec99=[_0x224565(0x13b),_0x224565(0x126),_0x224565(0x130),'profile'];if(!_0x23ec99[_0x224565(0x12f)](_0x318723))return'Invalid\x20resource:\x20'+_0x318723+_0x224565(0x143)+_0x23ec99[_0x224565(0x142)](',\x20');return undefined;}async['execute'](_0x23f6d9){const _0x4cde9d=a32_0x1e2d02,{args:_0x1ebdd8,options:_0x18a83a}=_0x23f6d9;try{const _0x5cefe1=_0x1ebdd8[0x0],_0x4cd752=_0x1ebdd8[0x1];if(_0x5cefe1===_0x4cde9d(0x133)){if(!profileExists(_0x4cd752))return console['error']('Error:\x20Profile\x20\x27'+_0x4cd752+_0x4cde9d(0x13c)),console[_0x4cde9d(0x148)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x314deb=_0x18a83a[_0x4cde9d(0x127)]||getCurrentSessionPID()[_0x4cde9d(0x136)]();return saveSessionContext({'profile':_0x4cd752},_0x18a83a['session']),console[_0x4cde9d(0x12c)](_0x4cde9d(0x13a)+_0x4cd752+_0x4cde9d(0x144)+_0x314deb+')'),console['log'](_0x4cde9d(0x12e)),0x0;}const _0x16b21a={},_0x4c67c9=_0x18a83a[_0x4cde9d(0x127)]||getCurrentSessionPID()[_0x4cde9d(0x136)]();switch(_0x5cefe1){case'database':_0x16b21a[_0x4cde9d(0x13b)]=_0x4cd752,console[_0x4cde9d(0x12c)]('Session\x20database\x20set\x20to:\x20'+_0x4cd752+'\x20(session:\x20'+_0x4c67c9+')');break;case _0x4cde9d(0x126):_0x16b21a[_0x4cde9d(0x126)]=_0x4cd752,console[_0x4cde9d(0x12c)](_0x4cde9d(0x134)+_0x4cd752+'\x20(session:\x20'+_0x4c67c9+')');break;case'llm_project':_0x16b21a[_0x4cde9d(0x130)]=_0x4cd752,console[_0x4cde9d(0x12c)]('Session\x20llm_project\x20set\x20to:\x20'+_0x4cd752+'\x20(session:\x20'+_0x4c67c9+')');break;}return saveSessionContext(_0x16b21a,_0x18a83a[_0x4cde9d(0x127)]),console[_0x4cde9d(0x12c)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x5c2996){return _0x5c2996 instanceof Error&&console[_0x4cde9d(0x148)](_0x4cde9d(0x13e)+_0x5c2996[_0x4cde9d(0x149)]),0x1;}}}
|