@treasuredata/tdx 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-api-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-api-client.js +1 -1
  7. package/dist/client/rate-limiter.js +1 -1
  8. package/dist/client/td-api-client.js +1 -1
  9. package/dist/client/trino-api-client.js +1 -1
  10. package/dist/client/workflow-client.js +1 -1
  11. package/dist/commands/activations.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/context-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/llm-command.js +1 -1
  22. package/dist/commands/llm-proxy.js +1 -1
  23. package/dist/commands/parent-segment-command.js +1 -1
  24. package/dist/commands/profiles-command.js +1 -1
  25. package/dist/commands/query-command.js +1 -1
  26. package/dist/commands/segment-command.js +1 -1
  27. package/dist/commands/segment-create-command.js +1 -1
  28. package/dist/commands/segment-fields-command.js +1 -1
  29. package/dist/commands/segment-pwd-command.js +1 -1
  30. package/dist/commands/segment-update-command.js +1 -1
  31. package/dist/commands/segment-use-command.js +1 -1
  32. package/dist/commands/segments.js +1 -1
  33. package/dist/commands/show.js +1 -1
  34. package/dist/commands/tables.js +1 -1
  35. package/dist/commands/use-command.js +1 -1
  36. package/dist/commands/workflow-command.js +1 -1
  37. package/dist/core/auth.js +1 -1
  38. package/dist/core/config.js +1 -1
  39. package/dist/core/global-context.js +1 -1
  40. package/dist/core/profile.js +1 -1
  41. package/dist/core/project-config.js +1 -1
  42. package/dist/core/session.js +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/proxy/anthropic-adapter.js +1 -1
  45. package/dist/proxy/server.js +1 -1
  46. package/dist/proxy/session-cache.js +1 -1
  47. package/dist/sdk/api.js +1 -1
  48. package/dist/sdk/errors.js +1 -1
  49. package/dist/sdk/index.js +1 -1
  50. package/dist/sdk/job.js +1 -1
  51. package/dist/sdk/llm.js +1 -1
  52. package/dist/sdk/query.js +1 -1
  53. package/dist/sdk/segment.js +1 -1
  54. package/dist/sdk/workflow.js +1 -1
  55. package/dist/types/endpoints.js +1 -1
  56. package/dist/types/index.js +1 -1
  57. package/dist/utils/agent-ref-parser.js +1 -1
  58. package/dist/utils/chat-cache.js +1 -1
  59. package/dist/utils/colors.js +1 -1
  60. package/dist/utils/command-output.js +1 -1
  61. package/dist/utils/constants.js +1 -1
  62. package/dist/utils/file-permissions.js +1 -1
  63. package/dist/utils/format-detector.js +1 -1
  64. package/dist/utils/formatters.js +1 -1
  65. package/dist/utils/json-loader.js +1 -1
  66. package/dist/utils/model-aliases.js +1 -1
  67. package/dist/utils/option-validation.js +1 -1
  68. package/dist/utils/port.js +1 -1
  69. package/dist/utils/process.js +1 -1
  70. package/dist/utils/prompt.js +1 -1
  71. package/dist/utils/segment-path-parser.js +1 -1
  72. package/dist/utils/segment-ref-parser.js +1 -1
  73. package/dist/utils/spinner.js +1 -1
  74. package/dist/utils/sql-parser.js +1 -1
  75. package/dist/utils/sse-parser.js +1 -1
  76. package/dist/utils/string-utils.js +1 -1
  77. package/dist/utils/table-ref-parser.js +1 -1
  78. package/dist/utils/tdx-logger.js +1 -1
  79. package/dist/utils/tdx-logger.js.map +1 -1
  80. package/dist/utils/tree-formatter.js +1 -1
  81. package/dist/utils/version-check.js +1 -1
  82. package/dist/utils/workflow-utils.js +1 -1
  83. package/package.json +1 -1
@@ -1 +1 @@
1
- const a21_0x1187ce=a21_0x15b0;function a21_0x15b0(_0x39b843,_0x566e5b){const _0x1e436e=a21_0x1e43();return a21_0x15b0=function(_0x15b0df,_0x13dda9){_0x15b0df=_0x15b0df-0x1e8;let _0x24d2a6=_0x1e436e[_0x15b0df];return _0x24d2a6;},a21_0x15b0(_0x39b843,_0x566e5b);}(function(_0x28cd60,_0x30d918){const _0x142a97=a21_0x15b0,_0x5db389=_0x28cd60();while(!![]){try{const _0x39ac23=parseInt(_0x142a97(0x1f0))/0x1*(parseInt(_0x142a97(0x1e8))/0x2)+-parseInt(_0x142a97(0x1f5))/0x3+parseInt(_0x142a97(0x1ee))/0x4*(-parseInt(_0x142a97(0x1ed))/0x5)+-parseInt(_0x142a97(0x1f3))/0x6+parseInt(_0x142a97(0x200))/0x7*(-parseInt(_0x142a97(0x1fb))/0x8)+-parseInt(_0x142a97(0x1fc))/0x9+-parseInt(_0x142a97(0x1ea))/0xa*(-parseInt(_0x142a97(0x1e9))/0xb);if(_0x39ac23===_0x30d918)break;else _0x5db389['push'](_0x5db389['shift']());}catch(_0x59e375){_0x5db389['push'](_0x5db389['shift']());}}}(a21_0x1e43,0x2f316));function a21_0x1e43(){const _0x35a319=['2073650wmggZk','profiles','config','205UeRCnp','19308lXPqJx','Error:\x20','2gtEzmF','map','length','1108254Wxftuo','List\x20all\x20available\x20profiles','112428hxhIjf','description','message','execute','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','name','2448mVhlDJ','526743YDHaEv','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','log','\x20\x20Global:\x20~/.config/tdx/tdx.json','3164DNDVMv','188138NWheOm','33WlXQSY'];a21_0x1e43=function(){return _0x35a319;};return a21_0x1e43();}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a21_0x1187ce(0x1fa)]=a21_0x1187ce(0x1eb);[a21_0x1187ce(0x1f6)]=a21_0x1187ce(0x1f4);async[a21_0x1187ce(0x1f8)](_0x204af4){const _0x266d19=a21_0x1187ce,{options:_0x3dc351}=_0x204af4;try{const _0x34c97a=listProfiles(),_0x2d2a85=getActiveProfile();if(_0x34c97a[_0x266d19(0x1f2)]===0x0)return console[_0x266d19(0x1fe)](_0x266d19(0x1f9)),console[_0x266d19(0x1fe)](_0x266d19(0x1fd)),console['log'](_0x266d19(0x1ff)),0x0;const _0x480215=_0x34c97a[_0x266d19(0x1f1)](_0x557718=>{const _0x28fd22=_0x266d19,_0x7973ec=_0x557718[_0x28fd22(0x1fa)]===_0x2d2a85,_0x2b3524=getProfileParams(_0x557718[_0x28fd22(0x1ec)]);return{'name':_0x557718[_0x28fd22(0x1fa)],'active':_0x7973ec,'scope':_0x557718['scope'],'description':_0x557718['config']['description']||'','params':_0x2b3524};});return await handleSDKOutput(_0x480215,_0x3dc351),0x0;}catch(_0x3d38d5){return _0x3d38d5 instanceof Error&&console['error'](_0x266d19(0x1ef)+_0x3d38d5[_0x266d19(0x1f7)]),0x1;}}}
1
+ const a21_0x54df58=a21_0x5982;(function(_0x3e98a8,_0xb26d29){const _0x16a166=a21_0x5982,_0x1bf980=_0x3e98a8();while(!![]){try{const _0x4def1f=-parseInt(_0x16a166(0xec))/0x1+-parseInt(_0x16a166(0xf3))/0x2*(parseInt(_0x16a166(0xef))/0x3)+-parseInt(_0x16a166(0xed))/0x4*(parseInt(_0x16a166(0xf4))/0x5)+parseInt(_0x16a166(0xf2))/0x6+parseInt(_0x16a166(0xf1))/0x7*(parseInt(_0x16a166(0xf0))/0x8)+-parseInt(_0x16a166(0xe8))/0x9+parseInt(_0x16a166(0xfd))/0xa*(parseInt(_0x16a166(0xf9))/0xb);if(_0x4def1f===_0xb26d29)break;else _0x1bf980['push'](_0x1bf980['shift']());}catch(_0xd3c919){_0x1bf980['push'](_0x1bf980['shift']());}}}(a21_0x3f60,0x98dcd));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a21_0x3f60(){const _0xd19f10=['Error:\x20','135586fABdpB','description','log','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','2440IEOWxx','\x20\x20Global:\x20~/.config/tdx/tdx.json','error','config','10958976ILafkL','scope','List\x20all\x20available\x20profiles','execute','732582SanHSH','4284536gicPou','name','25593NTUDTE','6312ZSGrRO','308VlKdUM','5422980sOQrEc','70NSiZYU','5nrSqey','profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','message'];a21_0x3f60=function(){return _0xd19f10;};return a21_0x3f60();}function a21_0x5982(_0x38cbcc,_0x3e57ba){const _0x3f60d1=a21_0x3f60();return a21_0x5982=function(_0x5982f1,_0x44b9e3){_0x5982f1=_0x5982f1-0xe6;let _0x249357=_0x3f60d1[_0x5982f1];return _0x249357;},a21_0x5982(_0x38cbcc,_0x3e57ba);}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a21_0x54df58(0xee)]=a21_0x54df58(0xf5);[a21_0x54df58(0xfa)]=a21_0x54df58(0xea);async[a21_0x54df58(0xeb)](_0x53b4f7){const _0x221e65=a21_0x54df58,{options:_0x472f09}=_0x53b4f7;try{const _0x12d3bf=listProfiles(),_0x36b3bc=getActiveProfile();if(_0x12d3bf['length']===0x0)return console[_0x221e65(0xfb)](_0x221e65(0xf6)),console[_0x221e65(0xfb)](_0x221e65(0xfc)),console['log'](_0x221e65(0xfe)),0x0;const _0x2898fd=_0x12d3bf['map'](_0x1c3005=>{const _0x594093=_0x221e65,_0x2a1fb9=_0x1c3005[_0x594093(0xee)]===_0x36b3bc,_0xccede8=getProfileParams(_0x1c3005[_0x594093(0xe7)]);return{'name':_0x1c3005[_0x594093(0xee)],'active':_0x2a1fb9,'scope':_0x1c3005[_0x594093(0xe9)],'description':_0x1c3005['config'][_0x594093(0xfa)]||'','params':_0xccede8};});return await handleSDKOutput(_0x2898fd,_0x472f09),0x0;}catch(_0x13cc51){return _0x13cc51 instanceof Error&&console[_0x221e65(0xe6)](_0x221e65(0xf8)+_0x13cc51[_0x221e65(0xf7)]),0x1;}}}
@@ -1 +1 @@
1
- const a22_0x2a8a55=a22_0x3ccb;(function(_0x116f53,_0x50568b){const _0x400c59=a22_0x3ccb,_0x3c7a11=_0x116f53();while(!![]){try{const _0x117d7d=-parseInt(_0x400c59(0xf4))/0x1+-parseInt(_0x400c59(0xf5))/0x2*(parseInt(_0x400c59(0xfe))/0x3)+parseInt(_0x400c59(0xec))/0x4*(parseInt(_0x400c59(0x110))/0x5)+-parseInt(_0x400c59(0xfa))/0x6*(parseInt(_0x400c59(0x106))/0x7)+parseInt(_0x400c59(0x112))/0x8*(parseInt(_0x400c59(0x118))/0x9)+parseInt(_0x400c59(0x105))/0xa+parseInt(_0x400c59(0xef))/0xb*(parseInt(_0x400c59(0x11f))/0xc);if(_0x117d7d===_0x50568b)break;else _0x3c7a11['push'](_0x3c7a11['shift']());}catch(_0x4f81e2){_0x3c7a11['push'](_0x3c7a11['shift']());}}}(a22_0xd9a1,0x89ccb));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x3ccb(_0x21f74e,_0x54b5c5){const _0xd9a184=a22_0xd9a1();return a22_0x3ccb=function(_0x3ccb8a,_0xa00895){_0x3ccb8a=_0x3ccb8a-0xec;let _0x53973=_0xd9a184[_0x3ccb8a];return _0x53973;},a22_0x3ccb(_0x21f74e,_0x54b5c5);}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a22_0x2a8a55(0x11a)]=a22_0x2a8a55(0xfb);[a22_0x2a8a55(0x101)]=a22_0x2a8a55(0x103);async[a22_0x2a8a55(0xf9)](_0x1c514e){const _0x5bc910=a22_0x2a8a55,{options:_0xa9a9f7,args:_0xdfbe36,tdx:_0x2a2d77}=_0x1c514e,_0x40d19f=_0xdfbe36[0x0],_0x39891d=_0xa9a9f7[_0x5bc910(0x10d)];let _0x2e91d3;if(_0x39891d)try{_0x2e91d3=readSqlStatementsFromFile(_0x39891d);}catch(_0x299897){return console[_0x5bc910(0xf2)](_0x5bc910(0x114)+_0x299897[_0x5bc910(0xf1)]),0x1;}else try{_0x2e91d3=splitSqlStatements(_0x40d19f);}catch(_0x2157de){return console['error'](_0x5bc910(0x114)+_0x2157de[_0x5bc910(0xf1)]),0x1;}const _0x1eedde=_0xa9a9f7['database']||_0x5bc910(0xf0),_0x1ae81d=_0xa9a9f7[_0x5bc910(0x10f)];try{const _0x392f1d=[],_0x3f16bb=!!_0xa9a9f7[_0x5bc910(0x115)];for(let _0x59e2ce=0x0;_0x59e2ce<_0x2e91d3['length'];_0x59e2ce++){const _0x16beda=_0x2e91d3[_0x59e2ce],_0x5c02c2=_0x59e2ce+0x1,_0x1c14aa=_0x2e91d3[_0x5bc910(0xf6)],_0x569566=_0x1c14aa>0x1;_0xa9a9f7[_0x5bc910(0xf7)]&&(console[_0x5bc910(0xf2)]('\x0a'+(_0x569566?_0x5bc910(0x10a)+_0x5c02c2+'/'+_0x1c14aa+':':'')),console[_0x5bc910(0xf2)](_0x5bc910(0x120)+_0xa9a9f7['site']),console[_0x5bc910(0xf2)](_0x5bc910(0xed)+(_0x1ae81d||'td')),console[_0x5bc910(0xf2)](_0x5bc910(0x10c)+_0x1eedde),console[_0x5bc910(0xf2)]('SQL:\x20'+_0x16beda));const _0x17c207=_0x569566?_0x5bc910(0xf8)+_0x5c02c2+'/'+_0x1c14aa+_0x5bc910(0x117):_0x5bc910(0x111);try{const _0x5a4cbf=await withQuerySpinner(_0x17c207,async _0x720abc=>{const _0x1314c9=_0x5bc910,_0x2a786d=await _0x2a2d77['query'][_0x1314c9(0xf9)](_0x16beda,{'catalog':_0x1ae81d,'schema':_0x1eedde,'onJobId':_0x188e6c=>{const _0x47fb24=_0x1314c9;_0x720abc[_0x47fb24(0x11e)](_0x188e6c);},'onProgress':_0x57e275=>{const _0x3490ec=_0x1314c9;_0x720abc[_0x3490ec(0xfc)](_0x3490ec(0x121)+_0x57e275[_0x3490ec(0xff)]+']'),_0x720abc[_0x3490ec(0x104)](formatRows(_0x57e275[_0x3490ec(0xfd)])+'\x20rows\x20'+_0x57e275[_0x3490ec(0x109)]+'/'+_0x57e275['totalSplits']+'\x20splits');}});return _0x2a786d;},{'verbose':_0xa9a9f7[_0x5bc910(0xf7)]}),_0xbfd22a=_0x5a4cbf[_0x5bc910(0x107)],_0x509353=_0xbfd22a[_0x5bc910(0x108)]?_0x5bc910(0xf3)+_0xbfd22a[_0x5bc910(0x108)]+']':'',_0x4ce23b=_0x569566?_0x5bc910(0x10a)+_0x5c02c2+'/'+_0x1c14aa+_0x5bc910(0x10e):'';console[_0x5bc910(0xf2)]('✔\x20'+_0x4ce23b+'Query\x20completed:\x20Processed\x20'+formatRows(_0xbfd22a[_0x5bc910(0x11d)][_0x5bc910(0xfd)])+_0x5bc910(0x11b)+('in\x20'+formatElapsed(_0xbfd22a['stats']['elapsedTimeMillis'])+_0x509353));if(_0x569566&&_0x3f16bb){const _0x43d069=resolveOutputOptions(_0xa9a9f7),_0x3ada08=await formatQueryOutput(_0xbfd22a,_0x43d069);_0x392f1d[_0x5bc910(0x113)](_0x3ada08);}else await handleQueryOutput(_0xbfd22a,_0xa9a9f7);}catch(_0x3ed788){const _0x198c9f=_0x569566?_0x5bc910(0x10a)+_0x5c02c2+'/'+_0x1c14aa+':\x0a':'',_0x46d561=_0x3ed788 instanceof SDKError?_0x3ed788[_0x5bc910(0x100)]:_0x3ed788[_0x5bc910(0xf1)];return console[_0x5bc910(0xf2)](''+_0x198c9f+_0x46d561),0x1;}}if(_0x2e91d3[_0x5bc910(0xf6)]>0x1&&_0x3f16bb&&_0x392f1d[_0x5bc910(0xf6)]>0x0){const _0x4eef1c=_0x392f1d[_0x5bc910(0x116)]('\x0a');writeFileSync(_0xa9a9f7[_0x5bc910(0x115)],_0x4eef1c),console[_0x5bc910(0xf2)]('\x0aAll\x20results\x20saved\x20to\x20'+_0xa9a9f7[_0x5bc910(0x115)]);}return 0x0;}catch(_0x52fc04){throw _0x52fc04;}}[a22_0x2a8a55(0x10b)](_0x5e668e){const _0x217f3e=a22_0x2a8a55,_0x260d08=_0x5e668e[_0x217f3e(0x11c)][0x0],_0x18b007=_0x5e668e[_0x217f3e(0x119)][_0x217f3e(0x10d)];if(!_0x260d08&&!_0x18b007)return _0x217f3e(0x102);if(_0x260d08&&_0x18b007)return _0x217f3e(0xee);return undefined;}}function a22_0xd9a1(){const _0x5b251c=['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','Run\x20Trino\x20queries\x20(streaming)','setExtra','3533600IhLZOD','11599yloVLe','data','jobId','completedSplits','Statement\x20','validate','Schema:\x20','file','\x20-\x20','catalog','1886265suXwbm','Executing\x20query...','88AQQBhn','push','Error:\x20','output','join','...','723924rDnHgZ','options','name','\x20rows\x20','args','stats','setJobId','5444148nRFYYJ','Site:\x20','Executing\x20query\x20[','8HszvGn','Catalog:\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','11rfQcYy','information_schema','message','error','\x20[Job\x20ID:\x20','571856TvUGMy','1672312fwFiKV','length','verbose','Executing\x20statement\x20','execute','1716Mepnuq','query','setPhase','processedRows','3xsrckq','state','originalMessage','description'];a22_0xd9a1=function(){return _0x5b251c;};return a22_0xd9a1();}
1
+ const a22_0x9ddf19=a22_0x4bc1;(function(_0x1d27d8,_0x1968c6){const _0x35dd43=a22_0x4bc1,_0x269e67=_0x1d27d8();while(!![]){try{const _0x1d09ef=parseInt(_0x35dd43(0x14d))/0x1+-parseInt(_0x35dd43(0x13c))/0x2+parseInt(_0x35dd43(0x142))/0x3*(-parseInt(_0x35dd43(0x13d))/0x4)+-parseInt(_0x35dd43(0x15f))/0x5+-parseInt(_0x35dd43(0x135))/0x6+parseInt(_0x35dd43(0x13e))/0x7+parseInt(_0x35dd43(0x14f))/0x8;if(_0x1d09ef===_0x1968c6)break;else _0x269e67['push'](_0x269e67['shift']());}catch(_0x466be5){_0x269e67['push'](_0x269e67['shift']());}}}(a22_0x282a,0xb9d7c));function a22_0x4bc1(_0x52605f,_0x3b31fc){const _0x282ab7=a22_0x282a();return a22_0x4bc1=function(_0x4bc113,_0x36221d){_0x4bc113=_0x4bc113-0x12b;let _0x3334b7=_0x282ab7[_0x4bc113];return _0x3334b7;},a22_0x4bc1(_0x52605f,_0x3b31fc);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';function a22_0x282a(){const _0x2bf896=['validate','length','Site:\x20','7123060eAdcCm','Statement\x20','file','Query\x20completed:\x20Processed\x20','\x0aAll\x20results\x20saved\x20to\x20','\x20[Job\x20ID:\x20','verbose','args','SQL:\x20','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','\x20rows\x20','7539726eJoKbZ','Executing\x20query\x20[','push','Catalog:\x20','stats','setPhase','name','2921940djkrIr','256928VhLPOM','9933623rdEQJW','query','elapsedTimeMillis','join','12RirTAQ','options','execute','catalog','description','processedRows','message','Error:\x20','site','setJobId','output','585453bqyCWt','state','25246408oEtoRU','Executing\x20query...','originalMessage','\x20-\x20','database','information_schema','jobId','completedSplits','error','data','Executing\x20statement\x20','in\x20','\x20splits'];a22_0x282a=function(){return _0x2bf896;};return a22_0x282a();}export class QueryCommand extends BaseCommand{[a22_0x9ddf19(0x13b)]=a22_0x9ddf19(0x13f);[a22_0x9ddf19(0x146)]='Run\x20Trino\x20queries\x20(streaming)';async[a22_0x9ddf19(0x144)](_0x2e79df){const _0x2db9ee=a22_0x9ddf19,{options:_0x40ebf9,args:_0x57f522,tdx:_0x139879}=_0x2e79df,_0x3e7329=_0x57f522[0x0],_0x42643e=_0x40ebf9['file'];let _0x1502ee;if(_0x42643e)try{_0x1502ee=readSqlStatementsFromFile(_0x42643e);}catch(_0x640be){return console[_0x2db9ee(0x157)](_0x2db9ee(0x149)+_0x640be[_0x2db9ee(0x148)]),0x1;}else try{_0x1502ee=splitSqlStatements(_0x3e7329);}catch(_0x38768e){return console[_0x2db9ee(0x157)](_0x2db9ee(0x149)+_0x38768e['message']),0x1;}const _0x386821=_0x40ebf9[_0x2db9ee(0x153)]||_0x2db9ee(0x154),_0x507b85=_0x40ebf9[_0x2db9ee(0x145)];try{const _0x26817a=[],_0x5279de=!!_0x40ebf9[_0x2db9ee(0x14c)];for(let _0xbd07f6=0x0;_0xbd07f6<_0x1502ee[_0x2db9ee(0x15d)];_0xbd07f6++){const _0x5a10e8=_0x1502ee[_0xbd07f6],_0x5dbdaf=_0xbd07f6+0x1,_0x403e95=_0x1502ee[_0x2db9ee(0x15d)],_0x3b88d4=_0x403e95>0x1;_0x40ebf9[_0x2db9ee(0x130)]&&(console['error']('\x0a'+(_0x3b88d4?_0x2db9ee(0x12b)+_0x5dbdaf+'/'+_0x403e95+':':'')),console[_0x2db9ee(0x157)](_0x2db9ee(0x15e)+_0x40ebf9[_0x2db9ee(0x14a)]),console['error'](_0x2db9ee(0x138)+(_0x507b85||'td')),console['error']('Schema:\x20'+_0x386821),console[_0x2db9ee(0x157)](_0x2db9ee(0x132)+_0x5a10e8));const _0x386623=_0x3b88d4?_0x2db9ee(0x159)+_0x5dbdaf+'/'+_0x403e95+'...':_0x2db9ee(0x150);try{const _0x1d4523=await withQuerySpinner(_0x386623,async _0x4c0dcc=>{const _0x2fbc01=_0x2db9ee,_0x13ae69=await _0x139879[_0x2fbc01(0x13f)]['execute'](_0x5a10e8,{'catalog':_0x507b85,'schema':_0x386821,'onJobId':_0x440af9=>{const _0x3e4791=_0x2fbc01;_0x4c0dcc[_0x3e4791(0x14b)](_0x440af9);},'onProgress':_0x369644=>{const _0x40c689=_0x2fbc01;_0x4c0dcc[_0x40c689(0x13a)](_0x40c689(0x136)+_0x369644[_0x40c689(0x14e)]+']'),_0x4c0dcc['setExtra'](formatRows(_0x369644[_0x40c689(0x147)])+_0x40c689(0x134)+_0x369644[_0x40c689(0x156)]+'/'+_0x369644['totalSplits']+_0x40c689(0x15b));}});return _0x13ae69;},{'verbose':_0x40ebf9[_0x2db9ee(0x130)]}),_0x45b0f0=_0x1d4523[_0x2db9ee(0x158)],_0x44e5f0=_0x45b0f0[_0x2db9ee(0x155)]?_0x2db9ee(0x12f)+_0x45b0f0[_0x2db9ee(0x155)]+']':'',_0x2934e2=_0x3b88d4?_0x2db9ee(0x12b)+_0x5dbdaf+'/'+_0x403e95+_0x2db9ee(0x152):'';console[_0x2db9ee(0x157)]('✔\x20'+_0x2934e2+_0x2db9ee(0x12d)+formatRows(_0x45b0f0[_0x2db9ee(0x139)][_0x2db9ee(0x147)])+'\x20rows\x20'+(_0x2db9ee(0x15a)+formatElapsed(_0x45b0f0[_0x2db9ee(0x139)][_0x2db9ee(0x140)])+_0x44e5f0));if(_0x3b88d4&&_0x5279de){const _0x24dbe9=resolveOutputOptions(_0x40ebf9),_0xd84464=await formatQueryOutput(_0x45b0f0,_0x24dbe9);_0x26817a[_0x2db9ee(0x137)](_0xd84464);}else await handleQueryOutput(_0x45b0f0,_0x40ebf9);}catch(_0x368ae7){const _0x3a201d=_0x3b88d4?_0x2db9ee(0x12b)+_0x5dbdaf+'/'+_0x403e95+':\x0a':'',_0x4546e0=_0x368ae7 instanceof SDKError?_0x368ae7[_0x2db9ee(0x151)]:_0x368ae7['message'];return console[_0x2db9ee(0x157)](''+_0x3a201d+_0x4546e0),0x1;}}if(_0x1502ee[_0x2db9ee(0x15d)]>0x1&&_0x5279de&&_0x26817a[_0x2db9ee(0x15d)]>0x0){const _0x46c74=_0x26817a[_0x2db9ee(0x141)]('\x0a');writeFileSync(_0x40ebf9[_0x2db9ee(0x14c)],_0x46c74),console['error'](_0x2db9ee(0x12e)+_0x40ebf9[_0x2db9ee(0x14c)]);}return 0x0;}catch(_0x2a1494){throw _0x2a1494;}}[a22_0x9ddf19(0x15c)](_0x29ad52){const _0x3778e7=a22_0x9ddf19,_0x52a64e=_0x29ad52[_0x3778e7(0x131)][0x0],_0x1aecfd=_0x29ad52[_0x3778e7(0x143)][_0x3778e7(0x12c)];if(!_0x52a64e&&!_0x1aecfd)return _0x3778e7(0x133);if(_0x52a64e&&_0x1aecfd)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';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_0xe3fb7b=a23_0x169b;(function(_0x51a431,_0x4e8838){const _0xdcd664=a23_0x169b,_0x1911ca=_0x51a431();while(!![]){try{const _0x545756=-parseInt(_0xdcd664(0x1da))/0x1*(-parseInt(_0xdcd664(0x1dc))/0x2)+-parseInt(_0xdcd664(0x1b0))/0x3*(-parseInt(_0xdcd664(0x18b))/0x4)+parseInt(_0xdcd664(0x19d))/0x5+-parseInt(_0xdcd664(0x1d3))/0x6+-parseInt(_0xdcd664(0x1c6))/0x7*(-parseInt(_0xdcd664(0x1cf))/0x8)+parseInt(_0xdcd664(0x17a))/0x9+-parseInt(_0xdcd664(0x1a4))/0xa;if(_0x545756===_0x4e8838)break;else _0x1911ca['push'](_0x1911ca['shift']());}catch(_0x37ec59){_0x1911ca['push'](_0x1911ca['shift']());}}}(a23_0x3d43,0xa14ca));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a23_0x3d43(){const _0x59ffd5=['getParent','processedRows','error','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','setJobId','Folder\x20ID:\x20','Executing\x20segment\x20query...','query','log','\x27\x20with\x20ID:\x20','in\x20','trim','\x27...','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','execute','\x20folder','2335950SpqErV','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','segmentId','toLocaleString','segment:describe','getSegment','createFolder','getSegmentSQL','cause','type','parent','json','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Fetching\x20SQL\x20for\x20parent\x20segment...','Parent\x20segment:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','Create\x20segment\x20folder\x20for\x20organization','1168qUAOHw','folderId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:folder:create','Listing\x20folders\x20for\x20parent\x20\x27','Fetching\x20parent\x20segment\x20details...','Folder\x20ID\x20missing\x20from\x20resolved\x20path','✖\x20Query\x20failed\x20[','jsonl','getFolder','description','site','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20[Job\x20ID:\x20','Parent\x20name:\x20','parentId','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','3573680JXlsgR','segment:folder:list','Parent\x20ID:\x20','includes','Error:\x20Path\x20or\x20name\x20is\x20required','Fetching\x20segment\x20details...','Examples:','6913130ACpEFA','segment:show','segmentPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','format','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','name','Fetching\x20folder\x20\x27','resolveFolderId','Site:\x20','INTERNAL','2007zTYJWu','replace','\x20rows\x20','Resolving\x20parent\x20segment\x20\x27','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Creating\x20folder\x20\x27','Fetching\x20SQL\x20for\x20segment...','listFolders','information_schema','segment','folder','data','Resolving\x20parent\x20folder\x20\x27','Error:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','stats','parentFolder','\x20\x20Cause:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','✔\x20Created\x20folder\x20\x27','4111653wvYujp','Error:\x20Parent\x20segment\x20name\x20is\x20required','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Folder\x20reference\x20is\x20required','resolveParentId','getParentSQL','verbose','8rLgBxg','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Show\x20segment\x20or\x20folder\x20details','message','6112110PMtaIy','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','SQL\x20query:\x0a','length','Resolved\x20type:\x20','Resolving\x20folder\x20\x27','Resolved\x20relative\x20path\x20to:\x20','1XgCDbP','✔\x20Query\x20completed:\x20Processed\x20','1227334UHysob','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Resolved\x20parent\x20folder\x20ID:\x20','jobId','resolvePathToResource'];a23_0x3d43=function(){return _0x59ffd5;};return a23_0x3d43();}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_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x17e);[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x1d1);async[a23_0xe3fb7b(0x1f0)](_0x582219){const _0x2ca564=a23_0xe3fb7b,{options:_0x53e843,args:_0x3f14f1,tdx:_0x4b8d4f}=_0x582219;if(_0x3f14f1[_0x2ca564(0x1d6)]===0x0)return console[_0x2ca564(0x1e4)](_0x2ca564(0x1a1)),console[_0x2ca564(0x1e4)](_0x2ca564(0x198)),console['error'](_0x2ca564(0x1a3)),console['error'](_0x2ca564(0x1de)),console[_0x2ca564(0x1e4)](_0x2ca564(0x1a7)),console[_0x2ca564(0x1e4)](_0x2ca564(0x1ef)),0x1;try{const _0x303772=_0x3f14f1[0x0],_0x2b3c9b=_0x53e843[_0x2ca564(0x1a6)];let _0x2911d0=_0x303772;_0x2b3c9b&&!_0x303772[_0x2ca564(0x1a0)]('/')&&(_0x2911d0=_0x2b3c9b+'/'+_0x303772,_0x53e843[_0x2ca564(0x1ce)]&&console[_0x2ca564(0x1e4)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2911d0));const _0x1478df=await withSpinner(_0x2ca564(0x1b4)+_0x2911d0+_0x2ca564(0x1ee),()=>_0x4b8d4f['segment'][_0x2ca564(0x1e1)](_0x2911d0),{'verbose':_0x53e843[_0x2ca564(0x1ce)]}),_0x8cf3bd=_0x1478df['data'];_0x53e843[_0x2ca564(0x1ce)]&&(console['error']('Resolved\x20type:\x20'+_0x8cf3bd[_0x2ca564(0x183)]),console['error'](_0x2ca564(0x19f)+_0x8cf3bd['parentId']),_0x8cf3bd['folderId']&&console[_0x2ca564(0x1e4)](_0x2ca564(0x1e7)+_0x8cf3bd[_0x2ca564(0x18c)]),_0x8cf3bd[_0x2ca564(0x17c)]&&console[_0x2ca564(0x1e4)]('Segment\x20ID:\x20'+_0x8cf3bd[_0x2ca564(0x17c)]));if(_0x8cf3bd[_0x2ca564(0x183)]===_0x2ca564(0x184)){const _0xacfea1=await withSpinner(_0x2ca564(0x191),()=>_0x4b8d4f[_0x2ca564(0x1bb)][_0x2ca564(0x1e2)](_0x8cf3bd[_0x2ca564(0x19b)]),{'verbose':_0x53e843[_0x2ca564(0x1ce)]});await handleSDKOutput([_0xacfea1['data']],_0x53e843);}else{if(_0x8cf3bd[_0x2ca564(0x183)]===_0x2ca564(0x1bc)){if(!_0x8cf3bd[_0x2ca564(0x18c)])throw new SDKError(ErrorCode[_0x2ca564(0x1af)],_0x2ca564(0x192));const _0x50c843=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4b8d4f[_0x2ca564(0x1bb)][_0x2ca564(0x195)](_0x8cf3bd['folderId']),{'verbose':_0x53e843['verbose']});await handleSDKOutput([_0x50c843[_0x2ca564(0x1bd)]],_0x53e843);}else{if(_0x8cf3bd['type']==='segment'){if(!_0x8cf3bd[_0x2ca564(0x17c)])throw new SDKError(ErrorCode[_0x2ca564(0x1af)],_0x2ca564(0x18d));const _0x563c62=await withSpinner(_0x2ca564(0x1a2),()=>_0x4b8d4f[_0x2ca564(0x1bb)][_0x2ca564(0x17f)](_0x8cf3bd[_0x2ca564(0x19b)],_0x8cf3bd[_0x2ca564(0x17c)]),{'verbose':_0x53e843[_0x2ca564(0x1ce)]});await handleSDKOutput([_0x563c62[_0x2ca564(0x1bd)]],_0x53e843);}}}return 0x0;}catch(_0x59c82c){if(_0x59c82c instanceof SDKError)return console['error']('Error:\x20'+_0x59c82c[_0x2ca564(0x1d2)]),_0x59c82c[_0x2ca564(0x182)]&&console['error'](_0x2ca564(0x1c3)+_0x59c82c[_0x2ca564(0x182)]),0x1;throw _0x59c82c;}}}export class SegmentShowCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x1a5);['description']=a23_0xe3fb7b(0x1aa);async[a23_0xe3fb7b(0x1f0)](_0x3ab9d2){const _0x35125e=a23_0xe3fb7b,{options:_0x1eed68,args:_0x59991e,tdx:_0x2b0adc}=_0x3ab9d2;if(_0x59991e[_0x35125e(0x1d6)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x35125e(0x1e4)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x35125e(0x1e4)]('Examples:'),console[_0x35125e(0x1e4)](_0x35125e(0x19c)),console[_0x35125e(0x1e4)](_0x35125e(0x18e)),console['error'](_0x35125e(0x1a8)),0x1;try{const _0x4fc08a=_0x59991e[0x0],_0x5e7397=_0x1eed68[_0x35125e(0x1a6)];let _0x2c237e=_0x4fc08a;_0x5e7397&&!_0x4fc08a[_0x35125e(0x1a0)]('/')&&(_0x2c237e=_0x5e7397+'/'+_0x4fc08a,_0x1eed68[_0x35125e(0x1ce)]&&console[_0x35125e(0x1e4)](_0x35125e(0x1d9)+_0x2c237e));const _0x35cbd2=await withSpinner(_0x35125e(0x1b4)+_0x2c237e+_0x35125e(0x1ee),()=>_0x2b0adc[_0x35125e(0x1bb)][_0x35125e(0x1e1)](_0x2c237e),{'verbose':_0x1eed68[_0x35125e(0x1ce)]}),_0x303414=_0x35cbd2['data'];_0x1eed68[_0x35125e(0x1ce)]&&(console[_0x35125e(0x1e4)](_0x35125e(0x1d7)+_0x303414[_0x35125e(0x183)]),console[_0x35125e(0x1e4)]('Parent\x20ID:\x20'+_0x303414['parentId']));if(_0x303414[_0x35125e(0x183)]===_0x35125e(0x1bc))return console[_0x35125e(0x1e4)](_0x35125e(0x17b)),console[_0x35125e(0x1e4)](_0x35125e(0x1b6)),0x1;let _0x1d3c09;if(_0x303414[_0x35125e(0x183)]===_0x35125e(0x184)){const _0x256fbf=await withSpinner(_0x35125e(0x187),()=>_0x2b0adc['segment'][_0x35125e(0x1cd)](_0x303414['parentId']),{'verbose':_0x1eed68['verbose']});_0x1d3c09=_0x256fbf[_0x35125e(0x1bd)];}else{if(!_0x303414['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],_0x35125e(0x18d));const _0x1f7123=await withSpinner(_0x35125e(0x1b8),()=>_0x2b0adc[_0x35125e(0x1bb)][_0x35125e(0x181)](_0x303414['parentId'],_0x303414[_0x35125e(0x17c)]),{'verbose':_0x1eed68[_0x35125e(0x1ce)]});_0x1d3c09=_0x1f7123[_0x35125e(0x1bd)];}const _0x3e8305=resolveLimit(_0x1eed68['limit'],DEFAULT_DISPLAY_LIMIT),_0xb13f38=/\bLIMIT\s+\d+/i['test'](_0x1d3c09);!_0xb13f38&&(_0x1d3c09=_0x1d3c09[_0x35125e(0x1ed)]()[_0x35125e(0x1b1)](/;+$/,''),_0x1d3c09=_0x35125e(0x1ca)+_0x1d3c09+_0x35125e(0x1dd)+_0x3e8305);_0x1eed68['verbose']&&console['error'](_0x35125e(0x1d5)+_0x1d3c09);const _0x344d6f=await withQuerySpinner(_0x35125e(0x1e8),async _0x2dbd86=>{const _0x327233=_0x35125e,_0x150a42=await _0x2b0adc[_0x327233(0x1e9)][_0x327233(0x1f0)](_0x1d3c09,{'catalog':'td','schema':_0x327233(0x1ba),'onJobId':_0x59cc3e=>{const _0x307d3e=_0x327233;_0x2dbd86[_0x307d3e(0x1e6)](_0x59cc3e);}});return _0x150a42;},{'verbose':_0x1eed68[_0x35125e(0x1ce)]}),_0x5a72c=_0x344d6f[_0x35125e(0x1bd)],_0x38a0dc=_0x5a72c[_0x35125e(0x1e0)]?_0x35125e(0x199)+_0x5a72c[_0x35125e(0x1e0)]+']':'';return console[_0x35125e(0x1e4)](_0x35125e(0x1db)+_0x5a72c[_0x35125e(0x1c1)][_0x35125e(0x1e3)][_0x35125e(0x17d)]()+_0x35125e(0x1b2)+(_0x35125e(0x1ec)+formatElapsed(_0x5a72c[_0x35125e(0x1c1)]['elapsedTimeMillis'])+_0x38a0dc)),await handleQueryOutput(_0x5a72c,_0x1eed68),0x0;}catch(_0x247e7a){if(_0x247e7a instanceof SDKError)return console[_0x35125e(0x1e4)](_0x35125e(0x193)+_0x247e7a['code']+']'),console[_0x35125e(0x1e4)]('\x0a'+_0x247e7a['message']),0x1;throw _0x247e7a;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x19e);[a23_0xe3fb7b(0x196)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a23_0xe3fb7b(0x1f0)](_0x4826be){const _0x3578bd=a23_0xe3fb7b,{options:_0x484a7d,args:_0x4510c0,tdx:_0x2cb398}=_0x4826be;if(_0x4510c0[_0x3578bd(0x1d6)]===0x0)return console[_0x3578bd(0x1e4)](_0x3578bd(0x1c7)),console[_0x3578bd(0x1e4)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x1e7378=_0x4510c0[0x0];try{_0x484a7d[_0x3578bd(0x1ce)]&&(console['error'](_0x3578bd(0x1ae)+_0x484a7d[_0x3578bd(0x197)]),console[_0x3578bd(0x1e4)](_0x3578bd(0x19a)+_0x1e7378));const _0x17ad80=await withSpinner(_0x3578bd(0x1b3)+_0x1e7378+_0x3578bd(0x1ee),()=>_0x2cb398['segment'][_0x3578bd(0x1cc)](_0x1e7378),{'verbose':_0x484a7d['verbose']}),_0x3dea59=_0x17ad80[_0x3578bd(0x1bd)];_0x484a7d['verbose']&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x3dea59);const _0x4f3d2a=await withSpinner(_0x3578bd(0x190)+_0x1e7378+_0x3578bd(0x1ee),()=>_0x2cb398['segment'][_0x3578bd(0x1b9)](_0x3dea59),{'verbose':_0x484a7d[_0x3578bd(0x1ce)]}),_0x5f6173=_0x4f3d2a['data'];return console[_0x3578bd(0x1e4)]('✔\x20Found\x20'+_0x5f6173[_0x3578bd(0x1d6)]+_0x3578bd(0x1f1)+(_0x5f6173[_0x3578bd(0x1d6)]!==0x1?'s':'')),await handleSDKOutput(_0x5f6173,_0x484a7d),0x0;}catch(_0x117ade){if(_0x117ade instanceof SDKError)return console[_0x3578bd(0x1e4)](_0x3578bd(0x1bf)+_0x117ade['message']),_0x117ade['cause']&&console[_0x3578bd(0x1e4)](_0x3578bd(0x1c3)+_0x117ade[_0x3578bd(0x182)]),0x1;throw _0x117ade;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]='segment:folder:show';[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x1c8);async[a23_0xe3fb7b(0x1f0)](_0x38c801){const _0x4856da=a23_0xe3fb7b,{options:_0xaaaf14,args:_0x11a2f1,tdx:_0x2b00e3}=_0x38c801;if(_0x11a2f1[_0x4856da(0x1d6)]===0x0)return console['error'](_0x4856da(0x1cb)),console[_0x4856da(0x1e4)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x46ab0e,childId:_0xc540e9}=parseSegmentRef(_0x11a2f1[0x0]);_0xaaaf14[_0x4856da(0x1ce)]&&(console[_0x4856da(0x1e4)](_0x4856da(0x1ae)+_0xaaaf14['site']),console[_0x4856da(0x1e4)]('Parent\x20name:\x20'+_0x46ab0e),_0xc540e9&&console['error']('Folder\x20name:\x20'+_0xc540e9));if(!_0xc540e9)return console[_0x4856da(0x1e4)](_0x4856da(0x1c0)),0x1;const _0x4c12cf=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x46ab0e+_0x4856da(0x1ee),()=>_0x2b00e3[_0x4856da(0x1bb)][_0x4856da(0x1cc)](_0x46ab0e),{'verbose':_0xaaaf14[_0x4856da(0x1ce)]}),_0x3ec330=_0x4c12cf[_0x4856da(0x1bd)];_0xaaaf14[_0x4856da(0x1ce)]&&console[_0x4856da(0x1e4)]('Resolved\x20parent\x20ID:\x20'+_0x3ec330);const _0x5da319=await withSpinner(_0x4856da(0x1d8)+_0xc540e9+'\x27...',()=>_0x2b00e3[_0x4856da(0x1bb)][_0x4856da(0x1ad)](_0x3ec330,_0xc540e9),{'verbose':_0xaaaf14[_0x4856da(0x1ce)]}),_0x79ac68=_0x5da319['data'];_0xaaaf14['verbose']&&console[_0x4856da(0x1e4)]('Resolved\x20folder\x20ID:\x20'+_0x79ac68);const _0x31d61c=await withSpinner(_0x4856da(0x1ac)+_0xc540e9+_0x4856da(0x1ee),()=>_0x2b00e3['segment']['getFolder'](_0x79ac68),{'verbose':_0xaaaf14[_0x4856da(0x1ce)]});return await handleSDKOutput([_0x31d61c[_0x4856da(0x1bd)]],_0xaaaf14),0x0;}catch(_0x21b78e){if(_0x21b78e instanceof SDKError)return console[_0x4856da(0x1e4)](_0x4856da(0x1bf)+_0x21b78e[_0x4856da(0x1d2)]),_0x21b78e[_0x4856da(0x182)]&&console[_0x4856da(0x1e4)](_0x4856da(0x1c3)+_0x21b78e[_0x4856da(0x182)]),0x1;throw _0x21b78e;}}}export class SegmentSQLCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]='segment:sql';[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x1e5);async[a23_0xe3fb7b(0x1f0)](_0x18b286){const _0x2cf7ef=a23_0xe3fb7b,{options:_0x181d4b,args:_0x58390f,tdx:_0x3e993d}=_0x18b286;if(_0x58390f[_0x2cf7ef(0x1d6)]===0x0)return console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x186)),console[_0x2cf7ef(0x1e4)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console['error'](_0x2cf7ef(0x1a3)),console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x189)),console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1b5)),console['error'](_0x2cf7ef(0x1c9)),0x1;try{const _0x483506=_0x58390f[0x0],_0x505e2c=_0x181d4b['segmentPath'];let _0x13b18e=_0x483506;_0x505e2c&&!_0x483506[_0x2cf7ef(0x1a0)]('/')&&(_0x13b18e=_0x505e2c+'/'+_0x483506,_0x181d4b[_0x2cf7ef(0x1ce)]&&console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1d9)+_0x13b18e));const _0x124a37=await withSpinner(_0x2cf7ef(0x1b4)+_0x13b18e+'\x27...',()=>_0x3e993d[_0x2cf7ef(0x1bb)][_0x2cf7ef(0x1e1)](_0x13b18e),{'verbose':_0x181d4b[_0x2cf7ef(0x1ce)]}),_0x255aa2=_0x124a37[_0x2cf7ef(0x1bd)];_0x181d4b[_0x2cf7ef(0x1ce)]&&(console[_0x2cf7ef(0x1e4)]('Resolved\x20type:\x20'+_0x255aa2[_0x2cf7ef(0x183)]),console[_0x2cf7ef(0x1e4)]('Parent\x20ID:\x20'+_0x255aa2[_0x2cf7ef(0x19b)]));if(_0x255aa2[_0x2cf7ef(0x183)]===_0x2cf7ef(0x1bc))return console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1d4)),console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1d0)),0x1;let _0x5b8285;if(_0x255aa2[_0x2cf7ef(0x183)]==='parent'){const _0x251211=await withSpinner(_0x2cf7ef(0x187),()=>_0x3e993d[_0x2cf7ef(0x1bb)][_0x2cf7ef(0x1cd)](_0x255aa2[_0x2cf7ef(0x19b)]),{'verbose':_0x181d4b['verbose']});_0x5b8285=_0x251211[_0x2cf7ef(0x1bd)];}else{if(!_0x255aa2[_0x2cf7ef(0x17c)])throw new SDKError(ErrorCode[_0x2cf7ef(0x1af)],_0x2cf7ef(0x18d));const _0x429079=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3e993d[_0x2cf7ef(0x1bb)][_0x2cf7ef(0x181)](_0x255aa2[_0x2cf7ef(0x19b)],_0x255aa2[_0x2cf7ef(0x17c)]),{'verbose':_0x181d4b[_0x2cf7ef(0x1ce)]});_0x5b8285=_0x429079[_0x2cf7ef(0x1bd)];}return _0x181d4b[_0x2cf7ef(0x1a9)]===_0x2cf7ef(0x185)||_0x181d4b[_0x2cf7ef(0x1a9)]===_0x2cf7ef(0x194)?await handleSDKOutput([{'sql':_0x5b8285}],_0x181d4b):console[_0x2cf7ef(0x1ea)](_0x5b8285),0x0;}catch(_0x37e8ed){if(_0x37e8ed instanceof SDKError)return console[_0x2cf7ef(0x1e4)](_0x2cf7ef(0x1bf)+_0x37e8ed[_0x2cf7ef(0x1d2)]),_0x37e8ed[_0x2cf7ef(0x182)]&&console['error'](_0x2cf7ef(0x1c3)+_0x37e8ed[_0x2cf7ef(0x182)]),0x1;throw _0x37e8ed;}}}function a23_0x169b(_0x5cd79f,_0x3878ff){const _0x3d43ca=a23_0x3d43();return a23_0x169b=function(_0x169b79,_0x4f2b92){_0x169b79=_0x169b79-0x17a;let _0x511b41=_0x3d43ca[_0x169b79];return _0x511b41;},a23_0x169b(_0x5cd79f,_0x3878ff);}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0xe3fb7b(0x1ab)]=a23_0xe3fb7b(0x18f);[a23_0xe3fb7b(0x196)]=a23_0xe3fb7b(0x18a);async[a23_0xe3fb7b(0x1f0)](_0x1cb8c4){const _0x19a596=a23_0xe3fb7b,{options:_0x517f6e,args:_0x14a249,tdx:_0x3efa8b}=_0x1cb8c4,_0x500660=_0x517f6e;if(_0x14a249[_0x19a596(0x1d6)]<0x2)return console[_0x19a596(0x1e4)](_0x19a596(0x1c4)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3b3672=_0x14a249[0x0],_0x41166c=_0x14a249[0x1];_0x500660[_0x19a596(0x1ce)]&&(console[_0x19a596(0x1e4)](_0x19a596(0x1ae)+_0x500660[_0x19a596(0x197)]),console[_0x19a596(0x1e4)](_0x19a596(0x188)+_0x3b3672),console[_0x19a596(0x1e4)]('Folder\x20name:\x20'+_0x41166c));let _0x2f2efb;if(_0x500660[_0x19a596(0x1c2)]){const _0x129c64=_0x500660[_0x19a596(0x1c2)],_0x370288=await withSpinner(_0x19a596(0x1b3)+_0x3b3672+_0x19a596(0x1ee),()=>_0x3efa8b[_0x19a596(0x1bb)][_0x19a596(0x1cc)](_0x3b3672),{'verbose':_0x500660[_0x19a596(0x1ce)]}),_0x2b42c5=_0x370288[_0x19a596(0x1bd)],_0x36e143=await withSpinner(_0x19a596(0x1be)+_0x129c64+_0x19a596(0x1ee),()=>_0x3efa8b['segment'][_0x19a596(0x1ad)](_0x2b42c5,_0x129c64),{'verbose':_0x500660['verbose']});_0x2f2efb=_0x36e143[_0x19a596(0x1bd)],_0x500660[_0x19a596(0x1ce)]&&console[_0x19a596(0x1e4)](_0x19a596(0x1df)+_0x2f2efb);}const _0x40816e={'name':_0x41166c,'description':_0x500660['description'],'parentFolderId':_0x2f2efb},_0x2bf799=await withSpinner(_0x19a596(0x1b7)+_0x41166c+_0x19a596(0x1ee),()=>_0x3efa8b[_0x19a596(0x1bb)][_0x19a596(0x180)](_0x3b3672,_0x40816e),{'verbose':_0x500660[_0x19a596(0x1ce)]}),_0x333f1d=_0x2bf799['data'];return console[_0x19a596(0x1e4)](_0x19a596(0x1c5)+_0x333f1d['name']+_0x19a596(0x1eb)+_0x333f1d['id']),await handleSDKOutput([_0x333f1d],_0x500660),0x0;}}
@@ -1 +1 @@
1
- const a24_0x53d9cf=a24_0x4303;function a24_0x4303(_0x4fc0c7,_0x3c3729){const _0x431183=a24_0x4311();return a24_0x4303=function(_0x430353,_0x2b3eeb){_0x430353=_0x430353-0x155;let _0x1dbd7b=_0x431183[_0x430353];return _0x1dbd7b;},a24_0x4303(_0x4fc0c7,_0x3c3729);}(function(_0x27124f,_0x262783){const _0x5e314e=a24_0x4303,_0xb29c0c=_0x27124f();while(!![]){try{const _0x2bde9c=parseInt(_0x5e314e(0x163))/0x1+-parseInt(_0x5e314e(0x16c))/0x2*(parseInt(_0x5e314e(0x155))/0x3)+parseInt(_0x5e314e(0x159))/0x4+-parseInt(_0x5e314e(0x16e))/0x5*(parseInt(_0x5e314e(0x15b))/0x6)+-parseInt(_0x5e314e(0x179))/0x7+-parseInt(_0x5e314e(0x171))/0x8*(parseInt(_0x5e314e(0x15f))/0x9)+-parseInt(_0x5e314e(0x17c))/0xa*(-parseInt(_0x5e314e(0x16a))/0xb);if(_0x2bde9c===_0x262783)break;else _0xb29c0c['push'](_0xb29c0c['shift']());}catch(_0x454589){_0xb29c0c['push'](_0xb29c0c['shift']());}}}(a24_0x4311,0x85a84));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']='segment:create';[a24_0x53d9cf(0x184)]=a24_0x53d9cf(0x160);async[a24_0x53d9cf(0x173)](_0x1fe1c9){const _0x50a27d=a24_0x53d9cf,{options:_0x2a2d23,args:_0xf540f6,tdx:_0x2279bc}=_0x1fe1c9,_0x4ba9d3=_0x2a2d23;if(_0xf540f6['length']===0x0)return console['error'](_0x50a27d(0x172)),console['error'](_0x50a27d(0x181)),console['error'](_0x50a27d(0x187)),console[_0x50a27d(0x157)](_0x50a27d(0x15a)),console[_0x50a27d(0x157)](_0x50a27d(0x16f)),console[_0x50a27d(0x157)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x37ac63=_0xf540f6[0x0],_0x5d8c67=_0x2a2d23[_0x50a27d(0x178)];let _0x15c07e=_0x37ac63;_0x5d8c67&&!_0x37ac63[_0x50a27d(0x158)]('/')&&(_0x15c07e=_0x5d8c67+'/'+_0x37ac63,_0x4ba9d3[_0x50a27d(0x164)]&&console[_0x50a27d(0x157)](_0x50a27d(0x182)+_0x15c07e));const _0x5740d5=parsePath(_0x15c07e);if(_0x5740d5[_0x50a27d(0x186)][_0x50a27d(0x17f)]<0x2)return console[_0x50a27d(0x157)](_0x50a27d(0x168)),console[_0x50a27d(0x157)](_0x50a27d(0x169)),0x1;const _0x4bf7db=_0x5740d5['segments'][0x0],_0x41baa3=getBaseName(_0x15c07e),_0x3d3ec0=getParentPath(_0x15c07e);_0x4ba9d3['verbose']&&(console[_0x50a27d(0x157)](_0x50a27d(0x17e)+_0x4ba9d3['site']),console[_0x50a27d(0x157)]('Target\x20path:\x20'+_0x15c07e),console['error'](_0x50a27d(0x15e)+_0x4bf7db),console['error'](_0x50a27d(0x162)+_0x41baa3),console[_0x50a27d(0x157)](_0x50a27d(0x166)+_0x3d3ec0));const _0x2cecc8=await withSpinner(_0x50a27d(0x156)+_0x4bf7db+_0x50a27d(0x175),()=>_0x2279bc[_0x50a27d(0x188)][_0x50a27d(0x174)](_0x4bf7db),{'verbose':_0x4ba9d3['verbose']}),_0x35a28b=_0x2cecc8['data'];let _0x9e0627;if(_0x5740d5[_0x50a27d(0x186)][_0x50a27d(0x17f)]>0x2){const _0xd91013=await withSpinner(_0x50a27d(0x15d)+_0x3d3ec0+_0x50a27d(0x175),()=>_0x2279bc[_0x50a27d(0x188)][_0x50a27d(0x167)](_0x3d3ec0),{'verbose':_0x4ba9d3['verbose']}),_0x4d6cdc=_0xd91013['data'];if(_0x4d6cdc[_0x50a27d(0x15c)]!==_0x50a27d(0x183)&&_0x4d6cdc[_0x50a27d(0x15c)]!==_0x50a27d(0x161))return console[_0x50a27d(0x157)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x9e0627=_0x4d6cdc[_0x50a27d(0x170)];}else{if(_0x4ba9d3['folder']){const _0x4efe1f=await withSpinner(_0x50a27d(0x165)+_0x4ba9d3['folder']+'\x27...',()=>_0x2279bc[_0x50a27d(0x188)][_0x50a27d(0x17b)](_0x35a28b,_0x4ba9d3['folder']),{'verbose':_0x4ba9d3[_0x50a27d(0x164)]});_0x9e0627=_0x4efe1f[_0x50a27d(0x189)];}}_0x4ba9d3['verbose']&&_0x9e0627&&console[_0x50a27d(0x157)](_0x50a27d(0x180)+_0x9e0627);const _0x5dda47=await loadJSONFromOptions(_0x4ba9d3['rule'],_0x4ba9d3[_0x50a27d(0x17d)]),_0x1543fb={'name':_0x41baa3,'description':_0x4ba9d3[_0x50a27d(0x184)],'rule':_0x5dda47,'kind':_0x4ba9d3[_0x50a27d(0x185)]!==undefined?parseInt(_0x4ba9d3['kind'],0xa):undefined,'isVisible':_0x4ba9d3[_0x50a27d(0x16b)]?![]:undefined,'segmentFolderId':_0x9e0627,'countPopulation':_0x4ba9d3[_0x50a27d(0x17a)]?![]:undefined},_0x56d885=await withSpinner(_0x50a27d(0x176)+_0x41baa3+_0x50a27d(0x175),()=>_0x2279bc['segment'][_0x50a27d(0x177)](_0x35a28b,_0x1543fb),{'verbose':_0x4ba9d3[_0x50a27d(0x164)]}),_0x35b1b9=_0x56d885[_0x50a27d(0x189)];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x35b1b9[_0x50a27d(0x16d)]+_0x50a27d(0x18a)+_0x35b1b9['id']),_0x15c07e!==_0x37ac63&&console[_0x50a27d(0x157)]('\x20\x20\x20Path:\x20'+_0x15c07e),await handleSDKOutput([_0x35b1b9],_0x4ba9d3),0x0;}}function a24_0x4311(){const _0x26d237=['Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolved\x20relative\x20path\x20to:\x20','folder','description','kind','segments','Examples:','segment','data','\x27\x20with\x20ID:\x20','243pUpPnW','Resolving\x20parent\x20segment\x20\x27','error','includes','1755344tMCLTp','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','60EDKpZr','type','Resolving\x20folder\x20path\x20\x27','Parent:\x20','17559UUYDxf','Create\x20child\x20segment\x20with\x20filtering\x20rules','parent','Segment\x20name:\x20','181871YgpgYt','verbose','Resolving\x20folder\x20\x27','Parent\x20path:\x20','resolvePathToResource','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','53141qtbTHn','invisible','21212ZYRXjf','name','252705oWzXID','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','folderId','3064DqKxGl','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','resolveParentId','\x27...','Creating\x20segment\x20\x27','createSegment','segmentPath','1354080ofLJTn','noCountPopulation','resolveFolderId','4620eiAcbK','ruleFile','Site:\x20','length','Resolved\x20folder\x20ID:\x20'];a24_0x4311=function(){return _0x26d237;};return a24_0x4311();}
1
+ function a24_0x4389(_0x54be1c,_0x2dd73f){const _0x30f35f=a24_0x30f3();return a24_0x4389=function(_0x4389a4,_0x57101b){_0x4389a4=_0x4389a4-0x78;let _0x110305=_0x30f35f[_0x4389a4];return _0x110305;},a24_0x4389(_0x54be1c,_0x2dd73f);}const a24_0x1d0eb3=a24_0x4389;(function(_0xed5ec8,_0x2eee77){const _0x146548=a24_0x4389,_0x206c81=_0xed5ec8();while(!![]){try{const _0x1ece72=-parseInt(_0x146548(0x7d))/0x1+-parseInt(_0x146548(0x8b))/0x2+parseInt(_0x146548(0x88))/0x3+-parseInt(_0x146548(0x94))/0x4*(-parseInt(_0x146548(0x91))/0x5)+-parseInt(_0x146548(0x95))/0x6*(-parseInt(_0x146548(0x98))/0x7)+parseInt(_0x146548(0x7f))/0x8+-parseInt(_0x146548(0x79))/0x9;if(_0x1ece72===_0x2eee77)break;else _0x206c81['push'](_0x206c81['shift']());}catch(_0x4fc025){_0x206c81['push'](_0x206c81['shift']());}}}(a24_0x30f3,0x88978));function a24_0x30f3(){const _0x3313b7=['verbose','site','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','208076fQeqTA','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','2515712fpWgif','\x20\x20\x20Path:\x20','kind','createSegment','segment','error','Resolved\x20folder\x20ID:\x20','resolveParentId','resolvePathToResource','1689921QqhJiH','Resolving\x20folder\x20path\x20\x27','Site:\x20','1785390xVmGSk','Resolved\x20relative\x20path\x20to:\x20','description','data','Create\x20child\x20segment\x20with\x20filtering\x20rules','type','10PRZQEL','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','invisible','650728NgpwlW','478296RTfSPB','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','segmentPath','70toYkbN','ruleFile','\x27\x20with\x20ID:\x20','Parent\x20path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','name','Resolving\x20folder\x20\x27','\x27...','Resolving\x20parent\x20segment\x20\x27','rule','length','segment:create','folder','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segments','includes','3060396wiFSdx'];a24_0x30f3=function(){return _0x3313b7;};return a24_0x30f3();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a24_0x1d0eb3(0x9d)]=a24_0x1d0eb3(0xa3);[a24_0x1d0eb3(0x8d)]=a24_0x1d0eb3(0x8f);async['execute'](_0x17d510){const _0x10a400=a24_0x1d0eb3,{options:_0x250648,args:_0xe3ec74,tdx:_0x50715c}=_0x17d510,_0x42cf2a=_0x250648;if(_0xe3ec74[_0x10a400(0xa2)]===0x0)return console['error'](_0x10a400(0x92)),console[_0x10a400(0x84)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x10a400(0x84)]('Examples:'),console['error'](_0x10a400(0x96)),console[_0x10a400(0x84)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x10a400(0x84)](_0x10a400(0x9c)),0x1;const _0x723541=_0xe3ec74[0x0],_0x215608=_0x250648[_0x10a400(0x97)];let _0x29c2b5=_0x723541;_0x215608&&!_0x723541[_0x10a400(0x78)]('/')&&(_0x29c2b5=_0x215608+'/'+_0x723541,_0x42cf2a[_0x10a400(0x7a)]&&console[_0x10a400(0x84)](_0x10a400(0x8c)+_0x29c2b5));const _0x4035ff=parsePath(_0x29c2b5);if(_0x4035ff[_0x10a400(0xa6)][_0x10a400(0xa2)]<0x2)return console['error'](_0x10a400(0xa5)),console[_0x10a400(0x84)](_0x10a400(0x7c)),0x1;const _0x46e62b=_0x4035ff[_0x10a400(0xa6)][0x0],_0x37a615=getBaseName(_0x29c2b5),_0x205463=getParentPath(_0x29c2b5);_0x42cf2a[_0x10a400(0x7a)]&&(console['error'](_0x10a400(0x8a)+_0x42cf2a[_0x10a400(0x7b)]),console['error']('Target\x20path:\x20'+_0x29c2b5),console[_0x10a400(0x84)]('Parent:\x20'+_0x46e62b),console[_0x10a400(0x84)]('Segment\x20name:\x20'+_0x37a615),console[_0x10a400(0x84)](_0x10a400(0x9b)+_0x205463));const _0xa39a7b=await withSpinner(_0x10a400(0xa0)+_0x46e62b+_0x10a400(0x9f),()=>_0x50715c[_0x10a400(0x83)][_0x10a400(0x86)](_0x46e62b),{'verbose':_0x42cf2a[_0x10a400(0x7a)]}),_0x410a4f=_0xa39a7b[_0x10a400(0x8e)];let _0x4ca677;if(_0x4035ff[_0x10a400(0xa6)][_0x10a400(0xa2)]>0x2){const _0x3251e1=await withSpinner(_0x10a400(0x89)+_0x205463+'\x27...',()=>_0x50715c['segment'][_0x10a400(0x87)](_0x205463),{'verbose':_0x42cf2a[_0x10a400(0x7a)]}),_0x4b393e=_0x3251e1[_0x10a400(0x8e)];if(_0x4b393e['type']!=='folder'&&_0x4b393e[_0x10a400(0x90)]!=='parent')return console[_0x10a400(0x84)](_0x10a400(0x7e)),0x1;_0x4ca677=_0x4b393e['folderId'];}else{if(_0x42cf2a[_0x10a400(0xa4)]){const _0x429920=await withSpinner(_0x10a400(0x9e)+_0x42cf2a[_0x10a400(0xa4)]+_0x10a400(0x9f),()=>_0x50715c['segment']['resolveFolderId'](_0x410a4f,_0x42cf2a[_0x10a400(0xa4)]),{'verbose':_0x42cf2a[_0x10a400(0x7a)]});_0x4ca677=_0x429920[_0x10a400(0x8e)];}}_0x42cf2a['verbose']&&_0x4ca677&&console[_0x10a400(0x84)](_0x10a400(0x85)+_0x4ca677);const _0x273ffb=await loadJSONFromOptions(_0x42cf2a[_0x10a400(0xa1)],_0x42cf2a[_0x10a400(0x99)]),_0x29ebbf={'name':_0x37a615,'description':_0x42cf2a[_0x10a400(0x8d)],'rule':_0x273ffb,'kind':_0x42cf2a[_0x10a400(0x81)]!==undefined?parseInt(_0x42cf2a[_0x10a400(0x81)],0xa):undefined,'isVisible':_0x42cf2a[_0x10a400(0x93)]?![]:undefined,'segmentFolderId':_0x4ca677,'countPopulation':_0x42cf2a['noCountPopulation']?![]:undefined},_0x22d7e7=await withSpinner('Creating\x20segment\x20\x27'+_0x37a615+'\x27...',()=>_0x50715c[_0x10a400(0x83)][_0x10a400(0x82)](_0x410a4f,_0x29ebbf),{'verbose':_0x42cf2a[_0x10a400(0x7a)]}),_0xbfa5ea=_0x22d7e7['data'];return console['error']('✔\x20Created\x20segment\x20\x27'+_0xbfa5ea[_0x10a400(0x9d)]+_0x10a400(0x9a)+_0xbfa5ea['id']),_0x29c2b5!==_0x723541&&console['error'](_0x10a400(0x80)+_0x29c2b5),await handleSDKOutput([_0xbfa5ea],_0x42cf2a),0x0;}}
@@ -1 +1 @@
1
- const a25_0x4f5d2d=a25_0x53d0;function a25_0x3a18(){const _0x1a5afe=['355196yuyzqM','4388028fGCdEk','4mRNtyw','segment','length','listFields','data','verbose','22615gKCehW','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','39756876TxdYFk','\x27...','8KxnGCp','Parent\x20segment:\x20','error','12703933yMKFLv','List\x20available\x20fields\x20for\x20segmentation','70thVOrD','5llWlUH','✔\x20Found\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','site','1110AgjqXe','execute','Listing\x20fields\x20for\x20\x27','segment:fields','1416501mJvKFP','name','7656061AbGEeO'];a25_0x3a18=function(){return _0x1a5afe;};return a25_0x3a18();}(function(_0x346b41,_0x19a370){const _0x2f0fe5=a25_0x53d0,_0x10a0dc=_0x346b41();while(!![]){try{const _0x2e6b6d=-parseInt(_0x2f0fe5(0x1a6))/0x1*(parseInt(_0x2f0fe5(0x1b1))/0x2)+parseInt(_0x2f0fe5(0x1b2))/0x3*(-parseInt(_0x2f0fe5(0x1b3))/0x4)+-parseInt(_0x2f0fe5(0x19b))/0x5*(-parseInt(_0x2f0fe5(0x1aa))/0x6)+-parseInt(_0x2f0fe5(0x1b0))/0x7*(parseInt(_0x2f0fe5(0x1a0))/0x8)+parseInt(_0x2f0fe5(0x1ae))/0x9*(-parseInt(_0x2f0fe5(0x1a5))/0xa)+parseInt(_0x2f0fe5(0x1a3))/0xb+parseInt(_0x2f0fe5(0x19e))/0xc;if(_0x2e6b6d===_0x19a370)break;else _0x10a0dc['push'](_0x10a0dc['shift']());}catch(_0x264c5f){_0x10a0dc['push'](_0x10a0dc['shift']());}}}(a25_0x3a18,0xb935b));function a25_0x53d0(_0xd39361,_0xb8fe40){const _0x3a1846=a25_0x3a18();return a25_0x53d0=function(_0x53d0ff,_0x5d285c){_0x53d0ff=_0x53d0ff-0x198;let _0x42f9b0=_0x3a1846[_0x53d0ff];return _0x42f9b0;},a25_0x53d0(_0xd39361,_0xb8fe40);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a25_0x4f5d2d(0x1af)]=a25_0x4f5d2d(0x1ad);['description']=a25_0x4f5d2d(0x1a4);async[a25_0x4f5d2d(0x1ab)](_0x319c9f){const _0x3a205c=a25_0x4f5d2d,{options:_0x42aa46,args:_0x17fc88,tdx:_0x6e65d8}=_0x319c9f;if(_0x17fc88['length']===0x0)return console[_0x3a205c(0x1a2)](_0x3a205c(0x19d)),console[_0x3a205c(0x1a2)](_0x3a205c(0x1a8)),0x1;const _0x20df08=_0x17fc88[0x0];_0x42aa46[_0x3a205c(0x19a)]&&(console[_0x3a205c(0x1a2)](_0x3a205c(0x19c)+_0x42aa46[_0x3a205c(0x1a9)]),console['error'](_0x3a205c(0x1a1)+_0x20df08));const _0x4a579f=await withSpinner(_0x3a205c(0x1ac)+_0x20df08+_0x3a205c(0x19f),()=>_0x6e65d8[_0x3a205c(0x1b4)][_0x3a205c(0x198)](_0x20df08),{'verbose':_0x42aa46['verbose']}),_0x4ec794=_0x4a579f[_0x3a205c(0x199)];return console[_0x3a205c(0x1a2)](_0x3a205c(0x1a7)+_0x4ec794[_0x3a205c(0x1b5)]+'\x20field'+(_0x4ec794[_0x3a205c(0x1b5)]!==0x1?'s':'')),await handleSDKOutput(_0x4ec794,_0x42aa46),0x0;}}
1
+ const a25_0x3c5d29=a25_0x3dbc;function a25_0x3dbc(_0x2fbafd,_0x377d1f){const _0x3b47b7=a25_0x3b47();return a25_0x3dbc=function(_0x3dbc96,_0x39d720){_0x3dbc96=_0x3dbc96-0x173;let _0x143568=_0x3b47b7[_0x3dbc96];return _0x143568;},a25_0x3dbc(_0x2fbafd,_0x377d1f);}function a25_0x3b47(){const _0x1df7d3=['length','511304rHYZXY','35KULJwa','\x27...','171mxjBsk','segment','Error:\x20Parent\x20segment\x20name\x20is\x20required','166062ubXkrV','List\x20available\x20fields\x20for\x20segmentation','verbose','133128BMPeAM','site','Parent\x20segment:\x20','✔\x20Found\x20','data','\x20field','description','14bnsZtQ','listFields','161034bZrDif','194230PwBENG','104978JjrUda','732092NkYpya','error','name','execute','Site:\x20'];a25_0x3b47=function(){return _0x1df7d3;};return a25_0x3b47();}(function(_0x7143fe,_0x1f1a2b){const _0x35586a=a25_0x3dbc,_0x201b01=_0x7143fe();while(!![]){try{const _0x54aa53=parseInt(_0x35586a(0x178))/0x1+parseInt(_0x35586a(0x185))/0x2+parseInt(_0x35586a(0x188))/0x3+-parseInt(_0x35586a(0x179))/0x4+parseInt(_0x35586a(0x180))/0x5*(-parseInt(_0x35586a(0x176))/0x6)+parseInt(_0x35586a(0x174))/0x7*(-parseInt(_0x35586a(0x17f))/0x8)+parseInt(_0x35586a(0x182))/0x9*(parseInt(_0x35586a(0x177))/0xa);if(_0x54aa53===_0x1f1a2b)break;else _0x201b01['push'](_0x201b01['shift']());}catch(_0xfb9aff){_0x201b01['push'](_0x201b01['shift']());}}}(a25_0x3b47,0x1912c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a25_0x3c5d29(0x17b)]='segment:fields';[a25_0x3c5d29(0x173)]=a25_0x3c5d29(0x186);async[a25_0x3c5d29(0x17c)](_0x17644c){const _0x2bcb70=a25_0x3c5d29,{options:_0x1eedcc,args:_0x435f2c,tdx:_0x1722d3}=_0x17644c;if(_0x435f2c['length']===0x0)return console[_0x2bcb70(0x17a)](_0x2bcb70(0x184)),console[_0x2bcb70(0x17a)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),0x1;const _0x4a1085=_0x435f2c[0x0];_0x1eedcc[_0x2bcb70(0x187)]&&(console[_0x2bcb70(0x17a)](_0x2bcb70(0x17d)+_0x1eedcc[_0x2bcb70(0x189)]),console[_0x2bcb70(0x17a)](_0x2bcb70(0x18a)+_0x4a1085));const _0x47e3d4=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x4a1085+_0x2bcb70(0x181),()=>_0x1722d3[_0x2bcb70(0x183)][_0x2bcb70(0x175)](_0x4a1085),{'verbose':_0x1eedcc['verbose']}),_0x5c4f2e=_0x47e3d4[_0x2bcb70(0x18c)];return console[_0x2bcb70(0x17a)](_0x2bcb70(0x18b)+_0x5c4f2e[_0x2bcb70(0x17e)]+_0x2bcb70(0x18d)+(_0x5c4f2e['length']!==0x1?'s':'')),await handleSDKOutput(_0x5c4f2e,_0x1eedcc),0x0;}}
@@ -1 +1 @@
1
- function a26_0x1b5f(){const _0x2db47c=['jsonl','310NuXlMn','segment:pwd','json','16ZuWgvG','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','5072010dvbruo','format','\x20\x20Path:\x20','4651767zNjVcu','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','12850425HCIelR','9655fFqzDc','verbose','error','segmentPath','log','Show\x20current\x20segment/folder\x20context','stringify','228LymLgp','6363812bkMvkC','36675CMMpmV','5050927hopqru'];a26_0x1b5f=function(){return _0x2db47c;};return a26_0x1b5f();}const a26_0xbfee8d=a26_0x5426;(function(_0x2d9295,_0x1f4748){const _0xed390f=a26_0x5426,_0x11eb1e=_0x2d9295();while(!![]){try{const _0x3279dc=parseInt(_0xed390f(0xaf))/0x1*(-parseInt(_0xed390f(0xbb))/0x2)+parseInt(_0xed390f(0xac))/0x3+parseInt(_0xed390f(0xb7))/0x4+parseInt(_0xed390f(0xb8))/0x5*(-parseInt(_0xed390f(0xb6))/0x6)+parseInt(_0xed390f(0xb9))/0x7*(parseInt(_0xed390f(0xbe))/0x8)+-parseInt(_0xed390f(0xae))/0x9+-parseInt(_0xed390f(0xc0))/0xa;if(_0x3279dc===_0x1f4748)break;else _0x11eb1e['push'](_0x11eb1e['shift']());}catch(_0x83eea4){_0x11eb1e['push'](_0x11eb1e['shift']());}}}(a26_0x1b5f,0xd578f));import{BaseCommand}from'./command.js';function a26_0x5426(_0x759355,_0x53bff1){const _0x1b5f0d=a26_0x1b5f();return a26_0x5426=function(_0x5426d0,_0x468b25){_0x5426d0=_0x5426d0-0xaa;let _0x21f3ff=_0x1b5f0d[_0x5426d0];return _0x21f3ff;},a26_0x5426(_0x759355,_0x53bff1);}export class SegmentPwdCommand extends BaseCommand{['name']=a26_0xbfee8d(0xbc);['description']=a26_0xbfee8d(0xb4);async['execute'](_0x3359d3){const _0x5b1c85=a26_0xbfee8d,{options:_0x4a6145}=_0x3359d3;try{const _0x2d55be=_0x4a6145[_0x5b1c85(0xb2)];if(!_0x2d55be)return _0x4a6145[_0x5b1c85(0xaa)]===_0x5b1c85(0xbd)||_0x4a6145[_0x5b1c85(0xaa)]===_0x5b1c85(0xba)?console[_0x5b1c85(0xb3)](JSON[_0x5b1c85(0xb5)]({'path':'/','type':'root'})):console[_0x5b1c85(0xb3)]('/'),0x0;if(_0x4a6145[_0x5b1c85(0xaa)]===_0x5b1c85(0xbd)||_0x4a6145[_0x5b1c85(0xaa)]==='jsonl'){const _0x5db3f2={'path':_0x2d55be};console[_0x5b1c85(0xb3)](JSON['stringify'](_0x5db3f2));}else console[_0x5b1c85(0xb3)](_0x2d55be),_0x4a6145[_0x5b1c85(0xb0)]&&(console[_0x5b1c85(0xb1)](''),console[_0x5b1c85(0xb1)]('Context\x20details:'),console[_0x5b1c85(0xb1)](_0x5b1c85(0xab)+_0x2d55be),console[_0x5b1c85(0xb1)](''),console['error'](_0x5b1c85(0xbf)),console['error'](_0x5b1c85(0xad)));return 0x0;}catch(_0x32edcc){throw _0x32edcc;}}}
1
+ const a26_0x128061=a26_0x31b9;function a26_0x31b9(_0x26e2ca,_0x3040e8){const _0x3b0a99=a26_0x3b0a();return a26_0x31b9=function(_0x31b997,_0x2de440){_0x31b997=_0x31b997-0x90;let _0x114bdb=_0x3b0a99[_0x31b997];return _0x114bdb;},a26_0x31b9(_0x26e2ca,_0x3040e8);}(function(_0x4b0877,_0x1c85ce){const _0x1ec776=a26_0x31b9,_0x59fe62=_0x4b0877();while(!![]){try{const _0x2d8f51=parseInt(_0x1ec776(0xa2))/0x1+parseInt(_0x1ec776(0xa4))/0x2+-parseInt(_0x1ec776(0xa6))/0x3*(-parseInt(_0x1ec776(0x9f))/0x4)+parseInt(_0x1ec776(0x91))/0x5+-parseInt(_0x1ec776(0xa7))/0x6*(-parseInt(_0x1ec776(0x90))/0x7)+parseInt(_0x1ec776(0x96))/0x8*(-parseInt(_0x1ec776(0x98))/0x9)+-parseInt(_0x1ec776(0x9c))/0xa*(parseInt(_0x1ec776(0x92))/0xb);if(_0x2d8f51===_0x1c85ce)break;else _0x59fe62['push'](_0x59fe62['shift']());}catch(_0x3ebf0e){_0x59fe62['push'](_0x59fe62['shift']());}}}(a26_0x3b0a,0xe6435));function a26_0x3b0a(){const _0x417798=['9363190DvFtBM','55XfpqNf','name','error','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','337128aMSHIN','Context\x20details:','261BbRdIY','segmentPath','format','json','3173050OndYQJ','Show\x20current\x20segment/folder\x20context','stringify','1700164CdtJwn','log','execute','300949OFqkzX','verbose','1446686bwTGjT','\x20\x20Path:\x20','3QQbncw','73680RjZHfr','segment:pwd','jsonl','245ZbFqKC'];a26_0x3b0a=function(){return _0x417798;};return a26_0x3b0a();}import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a26_0x128061(0x93)]=a26_0x128061(0xa8);['description']=a26_0x128061(0x9d);async[a26_0x128061(0xa1)](_0x5ae4a0){const _0x66ec81=a26_0x128061,{options:_0x5c5167}=_0x5ae4a0;try{const _0x1dda7a=_0x5c5167[_0x66ec81(0x99)];if(!_0x1dda7a)return _0x5c5167['format']==='json'||_0x5c5167['format']==='jsonl'?console[_0x66ec81(0xa0)](JSON[_0x66ec81(0x9e)]({'path':'/','type':'root'})):console[_0x66ec81(0xa0)]('/'),0x0;if(_0x5c5167[_0x66ec81(0x9a)]===_0x66ec81(0x9b)||_0x5c5167[_0x66ec81(0x9a)]===_0x66ec81(0xa9)){const _0xfcba51={'path':_0x1dda7a};console['log'](JSON[_0x66ec81(0x9e)](_0xfcba51));}else console[_0x66ec81(0xa0)](_0x1dda7a),_0x5c5167[_0x66ec81(0xa3)]&&(console['error'](''),console['error'](_0x66ec81(0x97)),console[_0x66ec81(0x94)](_0x66ec81(0xa5)+_0x1dda7a),console['error'](''),console[_0x66ec81(0x94)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x66ec81(0x94)](_0x66ec81(0x95)));return 0x0;}catch(_0x3a1993){throw _0x3a1993;}}}
@@ -1 +1 @@
1
- const a27_0x250804=a27_0x37fe;(function(_0x2a43c0,_0x25ba2f){const _0x1f0549=a27_0x37fe,_0x3f8da8=_0x2a43c0();while(!![]){try{const _0x4a5b14=-parseInt(_0x1f0549(0x168))/0x1*(parseInt(_0x1f0549(0x171))/0x2)+-parseInt(_0x1f0549(0x14e))/0x3*(parseInt(_0x1f0549(0x16a))/0x4)+-parseInt(_0x1f0549(0x16f))/0x5+-parseInt(_0x1f0549(0x156))/0x6+parseInt(_0x1f0549(0x15a))/0x7*(-parseInt(_0x1f0549(0x16d))/0x8)+-parseInt(_0x1f0549(0x15c))/0x9+parseInt(_0x1f0549(0x14a))/0xa;if(_0x4a5b14===_0x25ba2f)break;else _0x3f8da8['push'](_0x3f8da8['shift']());}catch(_0x74d0b4){_0x3f8da8['push'](_0x3f8da8['shift']());}}}(a27_0x58c4,0xb961c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a27_0x58c4(){const _0x1d9bbd=['Segment\x20ID\x20missing\x20from\x20resolved\x20path','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Update\x20existing\x20child\x20segment','segmentName','Segment\x20ID:\x20','\x27...','Resolved\x20relative\x20path\x20to:\x20','resolveFolderId','\x20\x20\x20Path:\x20','folder','33DDqwta','kind','1436EXugFH','parentId','Error:\x20Cannot\x20update\x20','1336GxEBQv','segmentId','1391040pFqaDX','segment','42818nNjbQF','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','name','updateSegmentById','description','Resolving\x20folder\x20\x27','error','54289240QIPgzC','length','rule','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','1707UbySao','Parent\x20ID:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','data','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Updating\x20segment\x20\x27','Resolved\x20folder\x20ID:\x20','7228998CSuixO','Resolved\x20type:\x20','includes','Examples:','57197hZXcSm','type','8201106xyMlvi','verbose'];a27_0x58c4=function(){return _0x1d9bbd;};return a27_0x58c4();}import{withSpinner}from'../utils/spinner.js';function a27_0x37fe(_0x57c7ac,_0x1d4bd1){const _0x58c403=a27_0x58c4();return a27_0x37fe=function(_0x37fe86,_0xb110c4){_0x37fe86=_0x37fe86-0x149;let _0x53d9ed=_0x58c403[_0x37fe86];return _0x53d9ed;},a27_0x37fe(_0x57c7ac,_0x1d4bd1);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a27_0x250804(0x173)]='segment:update';[a27_0x250804(0x175)]=a27_0x250804(0x160);async[a27_0x250804(0x151)](_0x4c28f8){const _0x40ba4b=a27_0x250804,{options:_0x28e4ad,args:_0x22bc52,tdx:_0x37a34a}=_0x4c28f8,_0x1e4153=_0x28e4ad;if(_0x22bc52[_0x40ba4b(0x14b)]===0x0)return console['error'](_0x40ba4b(0x150)),console['error'](_0x40ba4b(0x14d)),console[_0x40ba4b(0x149)](_0x40ba4b(0x159)),console['error'](_0x40ba4b(0x153)),console[_0x40ba4b(0x149)](_0x40ba4b(0x172)),0x1;const _0x2ace2b=_0x22bc52[0x0],_0x98fbd4=_0x28e4ad['segmentPath'];let _0x2d6b88=_0x2ace2b;_0x98fbd4&&!_0x2ace2b[_0x40ba4b(0x158)]('/')&&(_0x2d6b88=_0x98fbd4+'/'+_0x2ace2b,_0x1e4153[_0x40ba4b(0x15d)]&&console[_0x40ba4b(0x149)](_0x40ba4b(0x164)+_0x2d6b88));const _0x7cc02e=await withSpinner('Resolving\x20path\x20\x27'+_0x2d6b88+'\x27...',()=>_0x37a34a[_0x40ba4b(0x170)]['resolvePathToResource'](_0x2d6b88),{'verbose':_0x1e4153[_0x40ba4b(0x15d)]}),_0x3c9a6b=_0x7cc02e[_0x40ba4b(0x152)];_0x1e4153[_0x40ba4b(0x15d)]&&console[_0x40ba4b(0x149)](_0x40ba4b(0x157)+_0x3c9a6b[_0x40ba4b(0x15b)]);if(_0x3c9a6b[_0x40ba4b(0x15b)]!=='segment')return console[_0x40ba4b(0x149)](_0x40ba4b(0x16c)+_0x3c9a6b[_0x40ba4b(0x15b)]+_0x40ba4b(0x15f)),console[_0x40ba4b(0x149)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3c9a6b[_0x40ba4b(0x16e)])throw new SDKError(ErrorCode['INTERNAL'],_0x40ba4b(0x15e));const _0x59a96f=_0x3c9a6b[_0x40ba4b(0x16b)],_0x29de5b=_0x3c9a6b['segmentId'];_0x1e4153[_0x40ba4b(0x15d)]&&(console[_0x40ba4b(0x149)](_0x40ba4b(0x14f)+_0x59a96f),console[_0x40ba4b(0x149)](_0x40ba4b(0x162)+_0x29de5b));let _0xcc05ee;if(_0x1e4153[_0x40ba4b(0x167)]){const _0x1040de=_0x1e4153['folder'],_0x207a90=await withSpinner(_0x40ba4b(0x176)+_0x1040de+_0x40ba4b(0x163),()=>_0x37a34a['segment'][_0x40ba4b(0x165)](_0x59a96f,_0x1040de),{'verbose':_0x1e4153[_0x40ba4b(0x15d)]});_0xcc05ee=parseInt(_0x207a90[_0x40ba4b(0x152)],0xa),_0x1e4153[_0x40ba4b(0x15d)]&&console[_0x40ba4b(0x149)](_0x40ba4b(0x155)+_0xcc05ee);}const _0x5879b4=await loadJSONFromOptions(_0x1e4153[_0x40ba4b(0x14c)],_0x1e4153['ruleFile']),_0x40c8f1={'name':_0x1e4153[_0x40ba4b(0x173)],'description':_0x1e4153[_0x40ba4b(0x175)],'rule':_0x5879b4,'kind':_0x1e4153[_0x40ba4b(0x169)]!==undefined?parseInt(_0x1e4153[_0x40ba4b(0x169)],0xa):undefined,'segmentFolderId':_0xcc05ee},_0x184df2=await withSpinner(_0x40ba4b(0x154)+_0x3c9a6b[_0x40ba4b(0x161)]+'\x27...',()=>_0x37a34a[_0x40ba4b(0x170)][_0x40ba4b(0x174)](_0x59a96f,_0x29de5b,_0x40c8f1),{'verbose':_0x1e4153['verbose']}),_0x126c5a=_0x184df2[_0x40ba4b(0x152)];return console[_0x40ba4b(0x149)]('✔\x20Updated\x20segment\x20\x27'+_0x126c5a[_0x40ba4b(0x173)]+'\x27'),_0x2d6b88!==_0x2ace2b&&console['error'](_0x40ba4b(0x166)+_0x2d6b88),await handleSDKOutput([_0x126c5a],_0x1e4153),0x0;}}
1
+ const a27_0x51cf5c=a27_0x12cd;function a27_0x12cd(_0xd48412,_0x36eff4){const _0x47703a=a27_0x4770();return a27_0x12cd=function(_0x12cde2,_0x40622d){_0x12cde2=_0x12cde2-0x131;let _0x40a3b4=_0x47703a[_0x12cde2];return _0x40a3b4;},a27_0x12cd(_0xd48412,_0x36eff4);}(function(_0x35cc06,_0x4ac389){const _0x58cdbb=a27_0x12cd,_0x2b65eb=_0x35cc06();while(!![]){try{const _0x52a7aa=-parseInt(_0x58cdbb(0x139))/0x1*(-parseInt(_0x58cdbb(0x150))/0x2)+parseInt(_0x58cdbb(0x14b))/0x3+-parseInt(_0x58cdbb(0x14a))/0x4+parseInt(_0x58cdbb(0x13e))/0x5*(-parseInt(_0x58cdbb(0x155))/0x6)+parseInt(_0x58cdbb(0x13c))/0x7+parseInt(_0x58cdbb(0x15b))/0x8*(parseInt(_0x58cdbb(0x144))/0x9)+parseInt(_0x58cdbb(0x159))/0xa*(-parseInt(_0x58cdbb(0x134))/0xb);if(_0x52a7aa===_0x4ac389)break;else _0x2b65eb['push'](_0x2b65eb['shift']());}catch(_0x238897){_0x2b65eb['push'](_0x2b65eb['shift']());}}}(a27_0x4770,0xc4267));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a27_0x4770(){const _0x26756d=['703415cZTbkE','segment:update','Segment\x20ID:\x20','parentId','verbose','Resolved\x20type:\x20','3609OoTBBi','segmentPath','data','Resolving\x20path\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','632188ZJjksB','916146DEqwqi','\x20\x20\x20Path:\x20','segment','Resolving\x20folder\x20\x27','error','2XQsxpa','execute','Update\x20existing\x20child\x20segment','Parent\x20ID:\x20','rule','6LiYDHV','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x27...','description','1510dSraVK','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','13096IYhrNl','includes','folder','segmentName','resolvePathToResource','kind','resolveFolderId','ruleFile','Examples:','115027hVfMtp','updateSegmentById','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segmentId','type','1154035kgvAyW','Updating\x20segment\x20\x27','name','3957198KTVEsm','✔\x20Updated\x20segment\x20\x27'];a27_0x4770=function(){return _0x26756d;};return a27_0x4770();}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_0x51cf5c(0x13f);['description']=a27_0x51cf5c(0x152);async[a27_0x51cf5c(0x151)](_0x48135){const _0x2323ad=a27_0x51cf5c,{options:_0x3e9ff5,args:_0x2af222,tdx:_0x428484}=_0x48135,_0x4715b7=_0x3e9ff5;if(_0x2af222['length']===0x0)return console[_0x2323ad(0x14f)](_0x2323ad(0x148)),console[_0x2323ad(0x14f)](_0x2323ad(0x15a)),console['error'](_0x2323ad(0x133)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error'](_0x2323ad(0x156)),0x1;const _0x136f23=_0x2af222[0x0],_0x3f307c=_0x3e9ff5[_0x2323ad(0x145)];let _0x5f57f8=_0x136f23;_0x3f307c&&!_0x136f23[_0x2323ad(0x15c)]('/')&&(_0x5f57f8=_0x3f307c+'/'+_0x136f23,_0x4715b7[_0x2323ad(0x142)]&&console[_0x2323ad(0x14f)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5f57f8));const _0x164c62=await withSpinner(_0x2323ad(0x147)+_0x5f57f8+_0x2323ad(0x157),()=>_0x428484[_0x2323ad(0x14d)][_0x2323ad(0x15f)](_0x5f57f8),{'verbose':_0x4715b7[_0x2323ad(0x142)]}),_0x850af1=_0x164c62[_0x2323ad(0x146)];_0x4715b7[_0x2323ad(0x142)]&&console[_0x2323ad(0x14f)](_0x2323ad(0x143)+_0x850af1['type']);if(_0x850af1[_0x2323ad(0x138)]!==_0x2323ad(0x14d))return console[_0x2323ad(0x14f)]('Error:\x20Cannot\x20update\x20'+_0x850af1[_0x2323ad(0x138)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x2323ad(0x136)),0x1;if(!_0x850af1[_0x2323ad(0x137)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xd917e0=_0x850af1[_0x2323ad(0x141)],_0x5166c7=_0x850af1['segmentId'];_0x4715b7[_0x2323ad(0x142)]&&(console[_0x2323ad(0x14f)](_0x2323ad(0x153)+_0xd917e0),console[_0x2323ad(0x14f)](_0x2323ad(0x140)+_0x5166c7));let _0x2c5cf0;if(_0x4715b7['folder']){const _0x245b76=_0x4715b7[_0x2323ad(0x15d)],_0x45ecdc=await withSpinner(_0x2323ad(0x14e)+_0x245b76+_0x2323ad(0x157),()=>_0x428484[_0x2323ad(0x14d)][_0x2323ad(0x131)](_0xd917e0,_0x245b76),{'verbose':_0x4715b7['verbose']});_0x2c5cf0=parseInt(_0x45ecdc['data'],0xa),_0x4715b7[_0x2323ad(0x142)]&&console[_0x2323ad(0x14f)](_0x2323ad(0x149)+_0x2c5cf0);}const _0x55750e=await loadJSONFromOptions(_0x4715b7[_0x2323ad(0x154)],_0x4715b7[_0x2323ad(0x132)]),_0xf7737={'name':_0x4715b7[_0x2323ad(0x13b)],'description':_0x4715b7[_0x2323ad(0x158)],'rule':_0x55750e,'kind':_0x4715b7[_0x2323ad(0x160)]!==undefined?parseInt(_0x4715b7[_0x2323ad(0x160)],0xa):undefined,'segmentFolderId':_0x2c5cf0},_0x2fb761=await withSpinner(_0x2323ad(0x13a)+_0x850af1[_0x2323ad(0x15e)]+_0x2323ad(0x157),()=>_0x428484[_0x2323ad(0x14d)][_0x2323ad(0x135)](_0xd917e0,_0x5166c7,_0xf7737),{'verbose':_0x4715b7['verbose']}),_0x530a11=_0x2fb761[_0x2323ad(0x146)];return console['error'](_0x2323ad(0x13d)+_0x530a11[_0x2323ad(0x13b)]+'\x27'),_0x5f57f8!==_0x136f23&&console[_0x2323ad(0x14f)](_0x2323ad(0x14c)+_0x5f57f8),await handleSDKOutput([_0x530a11],_0x4715b7),0x0;}}
@@ -1 +1 @@
1
- const a28_0x337bb6=a28_0x1318;(function(_0x12dc42,_0x1c039c){const _0x387c44=a28_0x1318,_0x2eae22=_0x12dc42();while(!![]){try{const _0x34e45e=parseInt(_0x387c44(0x104))/0x1+-parseInt(_0x387c44(0x117))/0x2+-parseInt(_0x387c44(0xff))/0x3+-parseInt(_0x387c44(0x125))/0x4+parseInt(_0x387c44(0x120))/0x5+parseInt(_0x387c44(0x107))/0x6+parseInt(_0x387c44(0x122))/0x7*(parseInt(_0x387c44(0x106))/0x8);if(_0x34e45e===_0x1c039c)break;else _0x2eae22['push'](_0x2eae22['shift']());}catch(_0x48c382){_0x2eae22['push'](_0x2eae22['shift']());}}}(a28_0x37aa,0xd641a));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a28_0x37aa(){const _0x503196=['Use:\x20tdx\x20segment\x20use\x20','split','folderPath','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parentName','2516188kpEetn','verbose','Context\x20set\x20to:\x20','segmentPath','Resolved\x20relative\x20path\x20to:\x20','log','resolvePathToResource','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','8713510OeQusw','Context\x20cleared.\x20Back\x20to\x20root.','35RabaSV','parentId','Error:\x20Path\x20is\x20required','6438380omfTHQ','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','error','segments','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','folderId','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Site:\x20','segment:use','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','4299216lqFczC','Parent\x20ID:\x20','join','fullPath','Target\x20path:\x20','1369590yUxJcR','segment','2167696DjuKhz','4267518omrdRb','site','session','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','name','slice','description','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','Examples:'];a28_0x37aa=function(){return _0x503196;};return a28_0x37aa();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a28_0x1318(_0x282d57,_0x5237da){const _0x37aaf2=a28_0x37aa();return a28_0x1318=function(_0x131896,_0x428026){_0x131896=_0x131896-0xf8;let _0x5e199d=_0x37aaf2[_0x131896];return _0x5e199d;},a28_0x1318(_0x282d57,_0x5237da);}export class SegmentUseCommand extends BaseCommand{[a28_0x337bb6(0x10b)]=a28_0x337bb6(0xfd);[a28_0x337bb6(0x10d)]=a28_0x337bb6(0x10a);async['execute'](_0x45982e){const _0x455059=a28_0x337bb6,{options:_0x22e120,args:_0x427807,tdx:_0x2fadb8}=_0x45982e;if(_0x427807['length']===0x0)return console[_0x455059(0x127)](_0x455059(0x124)),console[_0x455059(0x127)](_0x455059(0x11e)),console['error'](_0x455059(0x110)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error'](_0x455059(0x10e)),console[_0x455059(0x127)](_0x455059(0xfb)),console[_0x455059(0x127)](_0x455059(0x114)),0x1;const _0x55ba9a=_0x427807[0x0],_0x22f81d=_0x22e120[_0x455059(0x109)];try{if(_0x55ba9a==='/')return saveSessionContext({'segment_path':undefined},_0x22f81d),console['log'](_0x455059(0x121)),0x0;const _0x49d2b3=_0x22e120[_0x455059(0x11a)];let _0x1d90d0=_0x55ba9a;const _0x397cd7=parsePath(_0x55ba9a);if(!_0x397cd7['isAbsolute']){if(!_0x49d2b3)return console['error'](_0x455059(0x11f)),console[_0x455059(0x127)](_0x455059(0xfe)),0x1;if(_0x55ba9a==='..'){const _0x5526ab=_0x49d2b3[_0x455059(0x112)]('/')[_0x455059(0x10c)](0x0,-0x1)['join']('/');_0x1d90d0=_0x5526ab||'/';}else _0x55ba9a==='.'?_0x1d90d0=_0x49d2b3:_0x1d90d0=_0x49d2b3+'/'+_0x55ba9a;_0x22e120[_0x455059(0x118)]&&console['error'](_0x455059(0x11b)+_0x1d90d0);}if(_0x1d90d0==='/'||_0x1d90d0==='')return saveSessionContext({'segment_path':undefined},_0x22f81d),console['log']('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x1d90d0=normalizePath(_0x1d90d0);const _0x33032a=parsePath(_0x1d90d0)[_0x455059(0x128)];if(_0x33032a['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x22f81d),console['log'](_0x455059(0x121)),0x0;_0x22e120[_0x455059(0x118)]&&(console[_0x455059(0x127)](_0x455059(0xfc)+_0x22e120[_0x455059(0x108)]),console[_0x455059(0x127)](_0x455059(0x103)+_0x1d90d0));const _0x342c43=await withSpinner('Resolving\x20path\x20\x27'+_0x1d90d0+'\x27...',()=>_0x2fadb8[_0x455059(0x105)][_0x455059(0x11d)](_0x1d90d0),{'verbose':_0x22e120[_0x455059(0x118)]}),_0x43e285=_0x342c43['data'];_0x22e120[_0x455059(0x118)]&&(console[_0x455059(0x127)]('Resolved\x20path\x20type:\x20'+_0x43e285['type']),console['error'](_0x455059(0x100)+_0x43e285[_0x455059(0x123)]),_0x43e285['folderId']&&console[_0x455059(0x127)]('Folder\x20ID:\x20'+_0x43e285[_0x455059(0xfa)]));if(_0x43e285['type']==='segment')return console[_0x455059(0x127)](_0x455059(0x126)),console['error'](_0x455059(0xf9)),console[_0x455059(0x127)](_0x455059(0x111)+_0x43e285[_0x455059(0x116)]+(_0x43e285[_0x455059(0x113)]?'/'+_0x43e285['folderPath'][_0x455059(0x101)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x43e285[_0x455059(0x102)],'parent_segment':_0x43e285[_0x455059(0x116)]},_0x22f81d),console[_0x455059(0x11c)](_0x455059(0x119)+_0x43e285[_0x455059(0x102)]),_0x22e120[_0x455059(0x118)]&&(console['error'](_0x455059(0x115)),console[_0x455059(0x127)](_0x455059(0x10f)),console['error'](_0x455059(0xf8))),0x0;}catch(_0x4b764e){throw _0x4b764e;}}}
1
+ const a28_0x569401=a28_0xe759;(function(_0x44679e,_0x14b229){const _0xc83485=a28_0xe759,_0x501226=_0x44679e();while(!![]){try{const _0x557416=parseInt(_0xc83485(0x1cb))/0x1*(-parseInt(_0xc83485(0x1e7))/0x2)+parseInt(_0xc83485(0x1be))/0x3*(parseInt(_0xc83485(0x1ed))/0x4)+-parseInt(_0xc83485(0x1eb))/0x5*(-parseInt(_0xc83485(0x1e1))/0x6)+-parseInt(_0xc83485(0x1d7))/0x7+parseInt(_0xc83485(0x1d5))/0x8+-parseInt(_0xc83485(0x1cd))/0x9+-parseInt(_0xc83485(0x1d1))/0xa*(-parseInt(_0xc83485(0x1db))/0xb);if(_0x557416===_0x14b229)break;else _0x501226['push'](_0x501226['shift']());}catch(_0x5e64fb){_0x501226['push'](_0x501226['shift']());}}}(a28_0x3800,0xd3ee6));import{BaseCommand}from'./command.js';function a28_0xe759(_0x3c592a,_0xa7d8db){const _0x380075=a28_0x3800();return a28_0xe759=function(_0xe7592b,_0xf820c){_0xe7592b=_0xe7592b-0x1bb;let _0x48e269=_0x380075[_0xe7592b];return _0x48e269;},a28_0xe759(_0x3c592a,_0xa7d8db);}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a28_0x3800(){const _0x47532a=['Context\x20cleared.\x20Back\x20to\x20root.','folderPath','2415960fNrYSi','segment','8017758fjpITF','Parent\x20ID:\x20','data','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','11XiqpEf','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','join','fullPath','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','3022902WBEhAF','folderId','parentName','segmentPath','Target\x20path:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','17642qUTpBJ','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','resolvePathToResource','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','5BfcXJR','split','4SKWBsS','isAbsolute','error','execute','273342gehLNb','Use:\x20tdx\x20segment\x20use\x20','Resolving\x20path\x20\x27','length','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','session','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x27...','description','Site:\x20','Context\x20set\x20to:\x20','log','segment:use','53irlUvL','name','9452295MdJpmf','verbose','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Examples:','26343060usqbGi','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'];a28_0x3800=function(){return _0x47532a;};return a28_0x3800();}export class SegmentUseCommand extends BaseCommand{[a28_0x569401(0x1cc)]=a28_0x569401(0x1ca);[a28_0x569401(0x1c6)]=a28_0x569401(0x1e6);async[a28_0x569401(0x1bd)](_0x2e40a5){const _0x14d11c=a28_0x569401,{options:_0x583ff1,args:_0x35b85d,tdx:_0x3a9d83}=_0x2e40a5;if(_0x35b85d[_0x14d11c(0x1c1)]===0x0)return console['error']('Error:\x20Path\x20is\x20required'),console[_0x14d11c(0x1bc)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x14d11c(0x1bc)](_0x14d11c(0x1d0)),console[_0x14d11c(0x1bc)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x14d11c(0x1bc)](_0x14d11c(0x1ea)),console['error'](_0x14d11c(0x1e8)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1cf)),0x1;const _0x1de7a8=_0x35b85d[0x0],_0xedc921=_0x583ff1[_0x14d11c(0x1c3)];try{if(_0x1de7a8==='/')return saveSessionContext({'segment_path':undefined},_0xedc921),console['log']('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x2bdc7f=_0x583ff1[_0x14d11c(0x1e4)];let _0x30b05d=_0x1de7a8;const _0x80eac0=parsePath(_0x1de7a8);if(!_0x80eac0[_0x14d11c(0x1bb)]){if(!_0x2bdc7f)return console[_0x14d11c(0x1bc)](_0x14d11c(0x1d2)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1e0)),0x1;if(_0x1de7a8==='..'){const _0xc8f93c=_0x2bdc7f[_0x14d11c(0x1ec)]('/')['slice'](0x0,-0x1)[_0x14d11c(0x1de)]('/');_0x30b05d=_0xc8f93c||'/';}else _0x1de7a8==='.'?_0x30b05d=_0x2bdc7f:_0x30b05d=_0x2bdc7f+'/'+_0x1de7a8;_0x583ff1[_0x14d11c(0x1ce)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x30b05d);}if(_0x30b05d==='/'||_0x30b05d==='')return saveSessionContext({'segment_path':undefined},_0xedc921),console[_0x14d11c(0x1c9)](_0x14d11c(0x1d3)),0x0;_0x30b05d=normalizePath(_0x30b05d);const _0x543aed=parsePath(_0x30b05d)['segments'];if(_0x543aed[_0x14d11c(0x1c1)]===0x0)return saveSessionContext({'segment_path':undefined},_0xedc921),console[_0x14d11c(0x1c9)](_0x14d11c(0x1d3)),0x0;_0x583ff1[_0x14d11c(0x1ce)]&&(console[_0x14d11c(0x1bc)](_0x14d11c(0x1c7)+_0x583ff1['site']),console['error'](_0x14d11c(0x1e5)+_0x30b05d));const _0x1b164e=await withSpinner(_0x14d11c(0x1c0)+_0x30b05d+_0x14d11c(0x1c5),()=>_0x3a9d83[_0x14d11c(0x1d6)][_0x14d11c(0x1e9)](_0x30b05d),{'verbose':_0x583ff1[_0x14d11c(0x1ce)]}),_0x42a4af=_0x1b164e[_0x14d11c(0x1d9)];_0x583ff1[_0x14d11c(0x1ce)]&&(console[_0x14d11c(0x1bc)]('Resolved\x20path\x20type:\x20'+_0x42a4af['type']),console[_0x14d11c(0x1bc)](_0x14d11c(0x1d8)+_0x42a4af['parentId']),_0x42a4af[_0x14d11c(0x1e2)]&&console[_0x14d11c(0x1bc)]('Folder\x20ID:\x20'+_0x42a4af[_0x14d11c(0x1e2)]));if(_0x42a4af['type']===_0x14d11c(0x1d6))return console[_0x14d11c(0x1bc)](_0x14d11c(0x1c4)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1da)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1bf)+_0x42a4af[_0x14d11c(0x1e3)]+(_0x42a4af[_0x14d11c(0x1d4)]?'/'+_0x42a4af[_0x14d11c(0x1d4)][_0x14d11c(0x1de)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x42a4af[_0x14d11c(0x1df)],'parent_segment':_0x42a4af[_0x14d11c(0x1e3)]},_0xedc921),console[_0x14d11c(0x1c9)](_0x14d11c(0x1c8)+_0x42a4af[_0x14d11c(0x1df)]),_0x583ff1['verbose']&&(console[_0x14d11c(0x1bc)](_0x14d11c(0x1c2)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1dd)),console[_0x14d11c(0x1bc)](_0x14d11c(0x1dc))),0x0;}catch(_0x147880){throw _0x147880;}}}
@@ -1 +1 @@
1
- const a29_0x40da83=a29_0x55e4;(function(_0x332fae,_0x309178){const _0x335455=a29_0x55e4,_0x470654=_0x332fae();while(!![]){try{const _0x13c641=parseInt(_0x335455(0x176))/0x1+parseInt(_0x335455(0x179))/0x2+-parseInt(_0x335455(0x17f))/0x3+-parseInt(_0x335455(0x16d))/0x4*(-parseInt(_0x335455(0x1a5))/0x5)+-parseInt(_0x335455(0x182))/0x6*(parseInt(_0x335455(0x190))/0x7)+parseInt(_0x335455(0x193))/0x8*(-parseInt(_0x335455(0x17b))/0x9)+-parseInt(_0x335455(0x187))/0xa;if(_0x13c641===_0x309178)break;else _0x470654['push'](_0x470654['shift']());}catch(_0x2cf6a9){_0x470654['push'](_0x470654['shift']());}}}(a29_0x3908,0x407ce));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x55e4(_0x33bf71,_0x26a0da){const _0x390841=a29_0x3908();return a29_0x55e4=function(_0x55e460,_0x5da598){_0x55e460=_0x55e460-0x16b;let _0x116ea8=_0x390841[_0x55e460];return _0x116ea8;},a29_0x55e4(_0x33bf71,_0x26a0da);}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a29_0x3908(){const _0xc39c8d=['Current\x20context:\x20','210qgnXvP','\x20parent\x20segment','parentId','attributes','verbose','message','32388vGEItf','\x20segment','name','jsonl','population','json','includes','site','listParents','482890zeDjTH','[parent\x20segments]','Parent\x20ID:\x20','684062iFAwGX','Folder\x20ID:\x20','11763CodICk','\x20matching\x20\x27','listParentsWithPattern','execute','243078eFanTh','length','map','204pHPJsU','cause','segmentPath','folder','error','3449240dUtGlN','segments','recursive','replace','log','Listing\x20parent\x20segments...','listRecursive','Site:\x20','\x27...','30233hLXJAb','Resolving\x20context\x20path\x20\x27','sort','2008DYiprS','test','resolvePathToResource','\x5c$&','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','Listing\x20parent\x20segments\x20matching\x20\x27','format','Building\x20hierarchy\x20tree...','dim','segment','✔\x20Found\x20','Error:\x20','Listing\x20folders\x20and\x20segments...','Path/pattern\x20arg:\x20','data','folderId','listUnified'];a29_0x3908=function(){return _0xc39c8d;};return a29_0x3908();}import{formatRows}from'../utils/formatters.js';import a29_0x4d6586 from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0x40da83(0x16f)]=a29_0x40da83(0x188);['description']=a29_0x40da83(0x197);async[a29_0x40da83(0x17e)](_0x9674bd){const _0x95f770=a29_0x40da83,{options:_0x57c45d,args:_0x396e20}=_0x9674bd,_0x4d975e=_0x57c45d[_0x95f770(0x189)],_0x338ca1=_0x396e20[0x0];try{const _0x100c1b=_0x57c45d[_0x95f770(0x184)];_0x57c45d[_0x95f770(0x16b)]&&(console[_0x95f770(0x186)](_0x95f770(0x18e)+_0x57c45d[_0x95f770(0x174)]),console['error'](_0x95f770(0x1a4)+(_0x100c1b||'/')),_0x338ca1&&console[_0x95f770(0x186)](_0x95f770(0x1a0)+_0x338ca1),_0x4d975e&&console[_0x95f770(0x186)]('Recursive\x20mode:\x20enabled'));if(_0x338ca1){const _0x7109=_0x338ca1[_0x95f770(0x173)]('*')||_0x338ca1[_0x95f770(0x173)]('?');if(_0x7109&&!_0x100c1b)return await this[_0x95f770(0x17d)](_0x9674bd,_0x338ca1);else return _0x7109?(console[_0x95f770(0x186)]('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x95f770(0x186)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x4d975e?await this[_0x95f770(0x18d)](_0x9674bd,_0x338ca1):await this[_0x95f770(0x1a3)](_0x9674bd,_0x338ca1);}if(!_0x100c1b)return await this[_0x95f770(0x175)](_0x9674bd);return _0x4d975e?await this[_0x95f770(0x18d)](_0x9674bd,_0x100c1b):await this['listUnified'](_0x9674bd,_0x100c1b);}catch(_0x49571b){if(_0x49571b instanceof SDKError)return console[_0x95f770(0x186)](_0x95f770(0x19e)+_0x49571b[_0x95f770(0x16c)]),_0x49571b['cause']&&console['error']('\x20\x20Cause:\x20'+_0x49571b[_0x95f770(0x183)]),0x1;throw _0x49571b;}}async['listParentsWithPattern'](_0x5ed733,_0x1effb6){const _0x4d9097=a29_0x40da83,{options:_0x2b6d90,tdx:_0x30a2cb}=_0x5ed733,_0x315940=await withSpinner(_0x4d9097(0x198)+_0x1effb6+_0x4d9097(0x18f),()=>_0x30a2cb['segment'][_0x4d9097(0x175)](),{'verbose':_0x2b6d90[_0x4d9097(0x16b)]}),_0x52548e=_0x315940[_0x4d9097(0x1a1)],_0x467b51=_0x1effb6[_0x4d9097(0x18a)](/[.+^${}()|[\]\\]/g,_0x4d9097(0x196))[_0x4d9097(0x18a)](/\*/g,'.*')[_0x4d9097(0x18a)](/\?/g,'.'),_0x343be9=new RegExp('^'+_0x467b51+'$','i'),_0x55079a=_0x52548e['filter'](_0x188024=>_0x343be9[_0x4d9097(0x194)](_0x188024['attributes']['name']));console[_0x4d9097(0x186)](_0x4d9097(0x19d)+_0x55079a['length']+'\x20parent\x20segment'+(_0x55079a[_0x4d9097(0x180)]!==0x1?'s':'')+_0x4d9097(0x17c)+_0x1effb6+'\x27');if(_0x2b6d90['format']===_0x4d9097(0x172)||_0x2b6d90[_0x4d9097(0x199)]===_0x4d9097(0x170))await handleSDKOutput(_0x55079a,_0x2b6d90);else{if(_0x55079a[_0x4d9097(0x180)]===0x0)console[_0x4d9097(0x18b)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x1effb6);else{console[_0x4d9097(0x18b)](_0x4d9097(0x177));for(const _0x1eca21 of _0x55079a){const _0x55c36c=_0x1eca21[_0x4d9097(0x1a8)]['population']?a29_0x4d6586[_0x4d9097(0x19b)]('\x20('+formatRows(_0x1eca21[_0x4d9097(0x1a8)][_0x4d9097(0x171)])+')'):'';console[_0x4d9097(0x18b)]('👥\x20'+_0x1eca21[_0x4d9097(0x1a8)][_0x4d9097(0x16f)]+_0x55c36c);}}}return 0x0;}async[a29_0x40da83(0x175)](_0x3b05eb){const _0x57a8f4=a29_0x40da83,{options:_0x2456b3,tdx:_0x68d8eb}=_0x3b05eb,_0x5e9102=await withSpinner(_0x57a8f4(0x18c),()=>_0x68d8eb[_0x57a8f4(0x19c)][_0x57a8f4(0x175)](),{'verbose':_0x2456b3[_0x57a8f4(0x16b)]}),_0x515c0b=_0x5e9102['data'];console['error'](_0x57a8f4(0x19d)+_0x515c0b[_0x57a8f4(0x180)]+_0x57a8f4(0x1a6)+(_0x515c0b['length']!==0x1?'s':''));if(_0x2456b3[_0x57a8f4(0x199)]===_0x57a8f4(0x172)||_0x2456b3[_0x57a8f4(0x199)]===_0x57a8f4(0x170))await handleSDKOutput(_0x515c0b,_0x2456b3);else{console[_0x57a8f4(0x18b)](_0x57a8f4(0x177));for(const _0x3e3419 of _0x515c0b){const _0x52f5d6=_0x3e3419[_0x57a8f4(0x1a8)]['population']?a29_0x4d6586[_0x57a8f4(0x19b)]('\x20('+formatRows(_0x3e3419[_0x57a8f4(0x1a8)][_0x57a8f4(0x171)])+')'):'';console['log']('👥\x20'+_0x3e3419[_0x57a8f4(0x1a8)][_0x57a8f4(0x16f)]+_0x52f5d6);}}return 0x0;}async[a29_0x40da83(0x1a3)](_0x38dd74,_0x13a46d){const _0x4f3299=a29_0x40da83,{options:_0x516bae,tdx:_0x54363c}=_0x38dd74,_0x1cefec=await withSpinner(_0x4f3299(0x191)+_0x13a46d+_0x4f3299(0x18f),()=>_0x54363c[_0x4f3299(0x19c)][_0x4f3299(0x195)](_0x13a46d),{'verbose':_0x516bae['verbose']}),_0x1d3875=_0x1cefec[_0x4f3299(0x1a1)];_0x516bae[_0x4f3299(0x16b)]&&(console[_0x4f3299(0x186)](_0x4f3299(0x178)+_0x1d3875[_0x4f3299(0x1a7)]),_0x1d3875[_0x4f3299(0x1a2)]&&console[_0x4f3299(0x186)](_0x4f3299(0x17a)+_0x1d3875[_0x4f3299(0x1a2)]));const _0xc250cc=await withSpinner(_0x4f3299(0x19f),()=>_0x54363c[_0x4f3299(0x19c)][_0x4f3299(0x1a3)](_0x1d3875[_0x4f3299(0x1a7)],_0x1d3875[_0x4f3299(0x1a2)]),{'verbose':_0x516bae[_0x4f3299(0x16b)]}),{folders:_0x3622e9,segments:_0x4adea0}=_0xc250cc[_0x4f3299(0x1a1)],_0x504998=_0x3622e9['length']+_0x4adea0[_0x4f3299(0x180)];console['error'](_0x4f3299(0x19d)+_0x3622e9[_0x4f3299(0x180)]+'\x20folder'+(_0x3622e9[_0x4f3299(0x180)]!==0x1?'s':'')+'\x20and\x20'+_0x4adea0[_0x4f3299(0x180)]+_0x4f3299(0x16e)+(_0x4adea0[_0x4f3299(0x180)]!==0x1?'s':''));if(_0x516bae[_0x4f3299(0x199)]==='json'||_0x516bae[_0x4f3299(0x199)]===_0x4f3299(0x170)){const _0x5a9963=[..._0x3622e9[_0x4f3299(0x181)](_0x8f1b63=>({..._0x8f1b63,'type':_0x4f3299(0x185)})),..._0x4adea0[_0x4f3299(0x181)](_0x544f45=>({..._0x544f45,'type':_0x4f3299(0x19c)}))][_0x4f3299(0x192)]((_0x2ff565,_0x211b0f)=>_0x2ff565['name']['localeCompare'](_0x211b0f[_0x4f3299(0x16f)]));await handleSDKOutput(_0x5a9963,_0x516bae);}else{if(_0x504998===0x0)console[_0x4f3299(0x18b)](a29_0x4d6586['dim']('[/'+_0x13a46d+']')),console[_0x4f3299(0x18b)]('(empty)');else{console['log'](a29_0x4d6586[_0x4f3299(0x19b)]('[/'+_0x13a46d+']'));const _0x2b7f1c=formatFlatList(_0x3622e9,_0x4adea0,{'showMetadata':!![]});console[_0x4f3299(0x18b)](_0x2b7f1c);}}return 0x0;}async['listRecursive'](_0x501cb3,_0x2e2e04){const _0x1dd99f=a29_0x40da83,{options:_0x266069,tdx:_0x5b022d}=_0x501cb3,_0x1197cc=await withSpinner(_0x1dd99f(0x191)+_0x2e2e04+'\x27...',()=>_0x5b022d[_0x1dd99f(0x19c)][_0x1dd99f(0x195)](_0x2e2e04),{'verbose':_0x266069[_0x1dd99f(0x16b)]}),_0x4c49fb=_0x1197cc[_0x1dd99f(0x1a1)];_0x266069['verbose']&&(console[_0x1dd99f(0x186)](_0x1dd99f(0x178)+_0x4c49fb['parentId']),_0x4c49fb[_0x1dd99f(0x1a2)]&&console['error'](_0x1dd99f(0x17a)+_0x4c49fb['folderId']));const _0x26c247=_0x266069['maxDepth']||0xa,_0x21f1e5=await withSpinner(_0x1dd99f(0x19a),()=>_0x5b022d[_0x1dd99f(0x19c)][_0x1dd99f(0x18d)](_0x4c49fb[_0x1dd99f(0x1a7)],_0x4c49fb['folderId'],0x0,_0x26c247),{'verbose':_0x266069['verbose']}),_0x2c19b8=_0x21f1e5['data'];console[_0x1dd99f(0x186)]('✔\x20Built\x20tree\x20with\x20'+_0x2c19b8[_0x1dd99f(0x180)]+'\x20top-level\x20items');if(_0x266069[_0x1dd99f(0x199)]==='json'||_0x266069['format']===_0x1dd99f(0x170))await handleSDKOutput(_0x2c19b8,_0x266069);else{console[_0x1dd99f(0x18b)](a29_0x4d6586[_0x1dd99f(0x19b)]('[/'+_0x2e2e04+']'));const _0x1dcab9=formatTree(_0x2c19b8,{'showMetadata':!![]});console['log'](_0x1dcab9);}return 0x0;}}
1
+ function a29_0x1af6(){const _0x320010=['40loEfYh','No\x20parent\x20segments\x20match\x20pattern:\x20','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','error','includes','format','Building\x20hierarchy\x20tree...','13840ipEydz','39565920rnsWqF','segment','(empty)','execute','288039yGqTis','population','\x20matching\x20\x27','\x20folder','sort','folderId','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','\x20segment','jsonl','log','Parent\x20ID:\x20','name','maxDepth','✔\x20Built\x20tree\x20with\x20','300jpPpIi','listRecursive','cause','3615405zUVmvD','1476QaIjyp','Folder\x20ID:\x20','verbose','\x20and\x20','localeCompare','folder','Listing\x20parent\x20segments...','\x5c$&','Recursive\x20mode:\x20enabled','listParents','Site:\x20','data','Current\x20context:\x20','replace','[parent\x20segments]','30RLfyHH','Resolving\x20context\x20path\x20\x27','filter','329989EgNtXP','\x20\x20Cause:\x20','Listing\x20folders\x20and\x20segments...','test','Path/pattern\x20arg:\x20','✔\x20Found\x20','length','\x20parent\x20segment','site','listParentsWithPattern','resolvePathToResource','parentId','json','message','919dvlkcX','Listing\x20parent\x20segments\x20matching\x20\x27','description','\x27...','attributes','map','listUnified','1674281DjKmYj','70AFulzU','👥\x20','segments','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','recursive','dim'];a29_0x1af6=function(){return _0x320010;};return a29_0x1af6();}const a29_0x4166a1=a29_0x3ffe;(function(_0x429873,_0x1af4b0){const _0xa1fdc5=a29_0x3ffe,_0x3babee=_0x429873();while(!![]){try{const _0x3748db=parseInt(_0xa1fdc5(0x126))/0x1*(parseInt(_0xa1fdc5(0x102))/0x2)+-parseInt(_0xa1fdc5(0xf4))/0x3*(parseInt(_0xa1fdc5(0xe8))/0x4)+-parseInt(_0xa1fdc5(0x105))/0x5+parseInt(_0xa1fdc5(0x115))/0x6*(-parseInt(_0xa1fdc5(0x12d))/0x7)+-parseInt(_0xa1fdc5(0xef))/0x8*(-parseInt(_0xa1fdc5(0x106))/0x9)+-parseInt(_0xa1fdc5(0x12e))/0xa*(parseInt(_0xa1fdc5(0x118))/0xb)+parseInt(_0xa1fdc5(0xf0))/0xc;if(_0x3748db===_0x1af4b0)break;else _0x3babee['push'](_0x3babee['shift']());}catch(_0x1fb14d){_0x3babee['push'](_0x3babee['shift']());}}}(a29_0x1af6,0x99b6b));import{BaseCommand}from'./command.js';function a29_0x3ffe(_0x9d6062,_0x3b46e3){const _0x1af65a=a29_0x1af6();return a29_0x3ffe=function(_0x3ffe6a,_0x37cbb){_0x3ffe6a=_0x3ffe6a-0xe5;let _0x160dc6=_0x1af65a[_0x3ffe6a];return _0x160dc6;},a29_0x3ffe(_0x9d6062,_0x3b46e3);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a29_0x119a9c from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0x4166a1(0xff)]=a29_0x4166a1(0x130);[a29_0x4166a1(0x128)]=a29_0x4166a1(0xe5);async[a29_0x4166a1(0xf3)](_0x306c98){const _0xffb84a=a29_0x4166a1,{options:_0x9082af,args:_0x40d818}=_0x306c98,_0xb67c75=_0x9082af[_0xffb84a(0xe6)],_0x14c4da=_0x40d818[0x0];try{const _0x594a27=_0x9082af['segmentPath'];_0x9082af[_0xffb84a(0x108)]&&(console[_0xffb84a(0xeb)](_0xffb84a(0x110)+_0x9082af[_0xffb84a(0x120)]),console['error'](_0xffb84a(0x112)+(_0x594a27||'/')),_0x14c4da&&console[_0xffb84a(0xeb)](_0xffb84a(0x11c)+_0x14c4da),_0xb67c75&&console[_0xffb84a(0xeb)](_0xffb84a(0x10e)));if(_0x14c4da){const _0x101bac=_0x14c4da[_0xffb84a(0xec)]('*')||_0x14c4da[_0xffb84a(0xec)]('?');if(_0x101bac&&!_0x594a27)return await this[_0xffb84a(0x121)](_0x306c98,_0x14c4da);else return _0x101bac?(console[_0xffb84a(0xeb)](_0xffb84a(0xfa)),console['error'](_0xffb84a(0xea)),0x1):_0xb67c75?await this[_0xffb84a(0x103)](_0x306c98,_0x14c4da):await this['listUnified'](_0x306c98,_0x14c4da);}if(!_0x594a27)return await this[_0xffb84a(0x10f)](_0x306c98);return _0xb67c75?await this[_0xffb84a(0x103)](_0x306c98,_0x594a27):await this[_0xffb84a(0x12c)](_0x306c98,_0x594a27);}catch(_0x107f54){if(_0x107f54 instanceof SDKError)return console[_0xffb84a(0xeb)]('Error:\x20'+_0x107f54[_0xffb84a(0x125)]),_0x107f54[_0xffb84a(0x104)]&&console[_0xffb84a(0xeb)](_0xffb84a(0x119)+_0x107f54[_0xffb84a(0x104)]),0x1;throw _0x107f54;}}async[a29_0x4166a1(0x121)](_0x29534e,_0x5aefa9){const _0x5034de=a29_0x4166a1,{options:_0x4a7d8a,tdx:_0x10c439}=_0x29534e,_0x54992b=await withSpinner(_0x5034de(0x127)+_0x5aefa9+_0x5034de(0x129),()=>_0x10c439[_0x5034de(0xf1)][_0x5034de(0x10f)](),{'verbose':_0x4a7d8a['verbose']}),_0x2e1c34=_0x54992b['data'],_0x2fb4f7=_0x5aefa9[_0x5034de(0x113)](/[.+^${}()|[\]\\]/g,_0x5034de(0x10d))[_0x5034de(0x113)](/\*/g,'.*')[_0x5034de(0x113)](/\?/g,'.'),_0x2a6b46=new RegExp('^'+_0x2fb4f7+'$','i'),_0x4712c1=_0x2e1c34[_0x5034de(0x117)](_0x97f28f=>_0x2a6b46[_0x5034de(0x11b)](_0x97f28f[_0x5034de(0x12a)][_0x5034de(0xff)]));console['error'](_0x5034de(0x11d)+_0x4712c1[_0x5034de(0x11e)]+_0x5034de(0x11f)+(_0x4712c1[_0x5034de(0x11e)]!==0x1?'s':'')+_0x5034de(0xf6)+_0x5aefa9+'\x27');if(_0x4a7d8a['format']===_0x5034de(0x124)||_0x4a7d8a[_0x5034de(0xed)]===_0x5034de(0xfc))await handleSDKOutput(_0x4712c1,_0x4a7d8a);else{if(_0x4712c1['length']===0x0)console['log'](_0x5034de(0xe9)+_0x5aefa9);else{console[_0x5034de(0xfd)](_0x5034de(0x114));for(const _0x228e65 of _0x4712c1){const _0x2e50c1=_0x228e65['attributes'][_0x5034de(0xf5)]?a29_0x119a9c[_0x5034de(0xe7)]('\x20('+formatRows(_0x228e65[_0x5034de(0x12a)]['population'])+')'):'';console['log'](_0x5034de(0x12f)+_0x228e65[_0x5034de(0x12a)][_0x5034de(0xff)]+_0x2e50c1);}}}return 0x0;}async[a29_0x4166a1(0x10f)](_0x46f627){const _0x4ed81f=a29_0x4166a1,{options:_0x498f1d,tdx:_0x14234b}=_0x46f627,_0x13da2a=await withSpinner(_0x4ed81f(0x10c),()=>_0x14234b[_0x4ed81f(0xf1)][_0x4ed81f(0x10f)](),{'verbose':_0x498f1d[_0x4ed81f(0x108)]}),_0x5053cd=_0x13da2a['data'];console[_0x4ed81f(0xeb)](_0x4ed81f(0x11d)+_0x5053cd[_0x4ed81f(0x11e)]+'\x20parent\x20segment'+(_0x5053cd[_0x4ed81f(0x11e)]!==0x1?'s':''));if(_0x498f1d[_0x4ed81f(0xed)]==='json'||_0x498f1d[_0x4ed81f(0xed)]==='jsonl')await handleSDKOutput(_0x5053cd,_0x498f1d);else{console['log'](_0x4ed81f(0x114));for(const _0x2f8c95 of _0x5053cd){const _0x3cdc8d=_0x2f8c95[_0x4ed81f(0x12a)][_0x4ed81f(0xf5)]?a29_0x119a9c[_0x4ed81f(0xe7)]('\x20('+formatRows(_0x2f8c95[_0x4ed81f(0x12a)][_0x4ed81f(0xf5)])+')'):'';console[_0x4ed81f(0xfd)](_0x4ed81f(0x12f)+_0x2f8c95[_0x4ed81f(0x12a)][_0x4ed81f(0xff)]+_0x3cdc8d);}}return 0x0;}async[a29_0x4166a1(0x12c)](_0x35d4b6,_0x3bbea8){const _0x3727ed=a29_0x4166a1,{options:_0x6d7a5d,tdx:_0x38ab0c}=_0x35d4b6,_0x560637=await withSpinner(_0x3727ed(0x116)+_0x3bbea8+_0x3727ed(0x129),()=>_0x38ab0c['segment'][_0x3727ed(0x122)](_0x3bbea8),{'verbose':_0x6d7a5d['verbose']}),_0x53741a=_0x560637[_0x3727ed(0x111)];_0x6d7a5d[_0x3727ed(0x108)]&&(console[_0x3727ed(0xeb)](_0x3727ed(0xfe)+_0x53741a['parentId']),_0x53741a[_0x3727ed(0xf9)]&&console[_0x3727ed(0xeb)]('Folder\x20ID:\x20'+_0x53741a[_0x3727ed(0xf9)]));const _0x26ba48=await withSpinner(_0x3727ed(0x11a),()=>_0x38ab0c[_0x3727ed(0xf1)][_0x3727ed(0x12c)](_0x53741a['parentId'],_0x53741a['folderId']),{'verbose':_0x6d7a5d[_0x3727ed(0x108)]}),{folders:_0x3069a8,segments:_0x93e8e8}=_0x26ba48[_0x3727ed(0x111)],_0x152ecf=_0x3069a8[_0x3727ed(0x11e)]+_0x93e8e8[_0x3727ed(0x11e)];console['error'](_0x3727ed(0x11d)+_0x3069a8[_0x3727ed(0x11e)]+_0x3727ed(0xf7)+(_0x3069a8[_0x3727ed(0x11e)]!==0x1?'s':'')+_0x3727ed(0x109)+_0x93e8e8[_0x3727ed(0x11e)]+_0x3727ed(0xfb)+(_0x93e8e8['length']!==0x1?'s':''));if(_0x6d7a5d[_0x3727ed(0xed)]==='json'||_0x6d7a5d[_0x3727ed(0xed)]==='jsonl'){const _0x222e99=[..._0x3069a8[_0x3727ed(0x12b)](_0x5d0955=>({..._0x5d0955,'type':_0x3727ed(0x10b)})),..._0x93e8e8[_0x3727ed(0x12b)](_0x5be29e=>({..._0x5be29e,'type':_0x3727ed(0xf1)}))][_0x3727ed(0xf8)]((_0x347301,_0x179541)=>_0x347301[_0x3727ed(0xff)][_0x3727ed(0x10a)](_0x179541[_0x3727ed(0xff)]));await handleSDKOutput(_0x222e99,_0x6d7a5d);}else{if(_0x152ecf===0x0)console[_0x3727ed(0xfd)](a29_0x119a9c[_0x3727ed(0xe7)]('[/'+_0x3bbea8+']')),console[_0x3727ed(0xfd)](_0x3727ed(0xf2));else{console['log'](a29_0x119a9c['dim']('[/'+_0x3bbea8+']'));const _0x4009b1=formatFlatList(_0x3069a8,_0x93e8e8,{'showMetadata':!![]});console[_0x3727ed(0xfd)](_0x4009b1);}}return 0x0;}async[a29_0x4166a1(0x103)](_0x352817,_0x22e37a){const _0xffe6fc=a29_0x4166a1,{options:_0x44ced7,tdx:_0x4876c0}=_0x352817,_0x33f165=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x22e37a+_0xffe6fc(0x129),()=>_0x4876c0[_0xffe6fc(0xf1)][_0xffe6fc(0x122)](_0x22e37a),{'verbose':_0x44ced7[_0xffe6fc(0x108)]}),_0x2ac9a8=_0x33f165[_0xffe6fc(0x111)];_0x44ced7[_0xffe6fc(0x108)]&&(console[_0xffe6fc(0xeb)]('Parent\x20ID:\x20'+_0x2ac9a8[_0xffe6fc(0x123)]),_0x2ac9a8['folderId']&&console[_0xffe6fc(0xeb)](_0xffe6fc(0x107)+_0x2ac9a8['folderId']));const _0x1e613e=_0x44ced7[_0xffe6fc(0x100)]||0xa,_0x2c10b5=await withSpinner(_0xffe6fc(0xee),()=>_0x4876c0[_0xffe6fc(0xf1)][_0xffe6fc(0x103)](_0x2ac9a8[_0xffe6fc(0x123)],_0x2ac9a8[_0xffe6fc(0xf9)],0x0,_0x1e613e),{'verbose':_0x44ced7[_0xffe6fc(0x108)]}),_0x4b1d83=_0x2c10b5[_0xffe6fc(0x111)];console[_0xffe6fc(0xeb)](_0xffe6fc(0x101)+_0x4b1d83[_0xffe6fc(0x11e)]+'\x20top-level\x20items');if(_0x44ced7[_0xffe6fc(0xed)]===_0xffe6fc(0x124)||_0x44ced7[_0xffe6fc(0xed)]===_0xffe6fc(0xfc))await handleSDKOutput(_0x4b1d83,_0x44ced7);else{console[_0xffe6fc(0xfd)](a29_0x119a9c[_0xffe6fc(0xe7)]('[/'+_0x22e37a+']'));const _0x30cff3=formatTree(_0x4b1d83,{'showMetadata':!![]});console['log'](_0x30cff3);}return 0x0;}}
@@ -1 +1 @@
1
- function a30_0x62ac(_0x37670,_0x5ca302){const _0x2713be=a30_0x2713();return a30_0x62ac=function(_0x62acb5,_0x4d2d1d){_0x62acb5=_0x62acb5-0x1bb;let _0x1ae7e2=_0x2713be[_0x62acb5];return _0x1ae7e2;},a30_0x62ac(_0x37670,_0x5ca302);}const a30_0x248b47=a30_0x62ac;(function(_0x5224b1,_0x19f3c8){const _0x5e11ab=a30_0x62ac,_0x25bac9=_0x5224b1();while(!![]){try{const _0x482479=-parseInt(_0x5e11ab(0x1d4))/0x1*(parseInt(_0x5e11ab(0x1ca))/0x2)+parseInt(_0x5e11ab(0x1be))/0x3+-parseInt(_0x5e11ab(0x1d2))/0x4*(-parseInt(_0x5e11ab(0x1bb))/0x5)+-parseInt(_0x5e11ab(0x1bd))/0x6+parseInt(_0x5e11ab(0x1d7))/0x7+parseInt(_0x5e11ab(0x1dd))/0x8+-parseInt(_0x5e11ab(0x1bc))/0x9;if(_0x482479===_0x19f3c8)break;else _0x25bac9['push'](_0x25bac9['shift']());}catch(_0x4698b3){_0x25bac9['push'](_0x25bac9['shift']());}}}(a30_0x2713,0x37ad1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a30_0x2713(){const _0x41d530=['table','length','verbose','execute','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','site','data','1004hjoCjf','limit','Error:\x20','args','Querying\x20','showTable','✔\x20Retrieved\x20','cause','457124IzUNBD','Database:\x20','626KZVMaq','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','\x20row','1003583YcPRkH','Usage:\x20tdx\x20show\x20<database.table>','\x20from\x20','database','error','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','2869648eHUMRH','Limit:\x20','15eCUHev','4098069LjnTkF','1783146RJkBAf','1349745aoNWlx','...'];a30_0x2713=function(){return _0x41d530;};return a30_0x2713();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']='show';['description']='Show\x20table\x20contents';async[a30_0x248b47(0x1c3)](_0x4300f1){const _0x1c7c41=a30_0x248b47;return this[_0x1c7c41(0x1cf)](_0x4300f1);}async['showTable'](_0x3a436d){const _0x36a986=a30_0x248b47,{options:_0x71004c,args:_0x24fdc0,tdx:_0x56f51c}=_0x3a436d;let _0x3a1f9d;try{_0x3a1f9d=parseTableReference(_0x24fdc0[0x0]);const _0x5bb09b=_0x71004c[_0x36a986(0x1da)];!_0x3a1f9d[_0x36a986(0x1da)]&&_0x5bb09b&&(_0x3a1f9d[_0x36a986(0x1da)]=_0x5bb09b);const _0x14ecff=validateTableDescribeReference(_0x3a1f9d);if(_0x14ecff)return console[_0x36a986(0x1db)]('Error:\x20'+_0x14ecff),console[_0x36a986(0x1db)](_0x36a986(0x1d8)),console[_0x36a986(0x1db)](_0x36a986(0x1c6)),console[_0x36a986(0x1db)](_0x36a986(0x1c7)),0x1;}catch(_0x7182a2){return console[_0x36a986(0x1db)]('Error:\x20'+_0x7182a2['message']),console[_0x36a986(0x1db)](_0x36a986(0x1d8)),console['error'](_0x36a986(0x1c6)),console[_0x36a986(0x1db)](_0x36a986(0x1c7)),0x1;}const _0x57bc67=_0x3a1f9d['catalog'],_0x36d5f2=_0x3a1f9d[_0x36a986(0x1da)],_0x464ad3=_0x3a1f9d[_0x36a986(0x1c0)],_0x4b7c7=resolveLimit(_0x71004c[_0x36a986(0x1cb)],DEFAULT_DISPLAY_LIMIT);try{_0x71004c['verbose']&&(console[_0x36a986(0x1db)]('Site:\x20'+_0x71004c[_0x36a986(0x1c8)]),_0x57bc67&&console[_0x36a986(0x1db)](_0x36a986(0x1c5)+_0x57bc67),console[_0x36a986(0x1db)](_0x36a986(0x1d3)+_0x36d5f2),console['error']('Table:\x20'+_0x464ad3),console['error'](_0x36a986(0x1de)+_0x4b7c7));const _0x372464=_0x57bc67?_0x57bc67+'.'+_0x36d5f2+'.'+_0x464ad3:_0x36d5f2+'.'+_0x464ad3,_0x126ace=await withSpinner(_0x36a986(0x1ce)+_0x372464+_0x36a986(0x1bf),()=>_0x56f51c['query'][_0x36a986(0x1cf)](_0x36d5f2,_0x464ad3,_0x4b7c7,_0x57bc67),{'verbose':_0x71004c[_0x36a986(0x1c2)]}),_0x3b5da2=_0x126ace['data'],_0x2148bf=_0x3b5da2[_0x36a986(0x1c9)];return _0x2148bf['length']===0x0?console[_0x36a986(0x1db)](_0x36a986(0x1c4)):console[_0x36a986(0x1db)](_0x36a986(0x1d0)+_0x2148bf[_0x36a986(0x1c1)]+_0x36a986(0x1d6)+(_0x2148bf['length']!==0x1?'s':'')+_0x36a986(0x1d9)+_0x372464),await handleSDKOutput(_0x2148bf,_0x71004c),0x0;}catch(_0x3f3684){if(_0x3f3684 instanceof SDKError)return console['error'](_0x36a986(0x1cc)+_0x3f3684['message']),_0x3f3684[_0x36a986(0x1d1)]&&console[_0x36a986(0x1db)]('\x20\x20Cause:\x20'+_0x3f3684[_0x36a986(0x1d1)]),0x1;throw _0x3f3684;}}['validate'](_0x5b9c2c){const _0x52970b=a30_0x248b47;if(_0x5b9c2c[_0x52970b(0x1cd)][_0x52970b(0x1c1)]===0x0)return _0x52970b(0x1d5);if(_0x5b9c2c[_0x52970b(0x1cd)][_0x52970b(0x1c1)]>0x1)return _0x52970b(0x1dc);return undefined;}}
1
+ const a30_0x437caf=a30_0x5311;(function(_0x186618,_0x19c300){const _0x69ef3e=a30_0x5311,_0x2c4f10=_0x186618();while(!![]){try{const _0x2c7cec=parseInt(_0x69ef3e(0x17a))/0x1+-parseInt(_0x69ef3e(0x16b))/0x2*(parseInt(_0x69ef3e(0x189))/0x3)+parseInt(_0x69ef3e(0x187))/0x4+parseInt(_0x69ef3e(0x17b))/0x5*(parseInt(_0x69ef3e(0x166))/0x6)+parseInt(_0x69ef3e(0x16a))/0x7+parseInt(_0x69ef3e(0x184))/0x8*(-parseInt(_0x69ef3e(0x171))/0x9)+parseInt(_0x69ef3e(0x173))/0xa;if(_0x2c7cec===_0x19c300)break;else _0x2c4f10['push'](_0x2c4f10['shift']());}catch(_0xca78a8){_0x2c4f10['push'](_0x2c4f10['shift']());}}}(a30_0x8c5a,0xb0e09));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a30_0x8c5a(){const _0x7b6488=['500396KYEIwh','length','146031pRkMAR','cause','Querying\x20','verbose','showTable','site','description','3764784fjOjFZ','\x20row','Table:\x20','Limit:\x20','944517quZnHD','22STEaOv','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','query','limit','args','error','18jShVAe','...','6089230SorHQi','Catalog:\x20','database','\x20from\x20','execute','table','Error:\x20','417641YWhbNv','10tIUXxU','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Site:\x20','data','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','catalog','show','message','5126344TUSenU','\x20\x20Cause:\x20','validate'];a30_0x8c5a=function(){return _0x7b6488;};return a30_0x8c5a();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a30_0x5311(_0x4b825d,_0x13bb2d){const _0x8c5aa5=a30_0x8c5a();return a30_0x5311=function(_0x531120,_0x2299ac){_0x531120=_0x531120-0x163;let _0x10bf9a=_0x8c5aa5[_0x531120];return _0x10bf9a;},a30_0x5311(_0x4b825d,_0x13bb2d);}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{['name']=a30_0x437caf(0x182);[a30_0x437caf(0x165)]='Show\x20table\x20contents';async[a30_0x437caf(0x177)](_0x4f5f6d){return this['showTable'](_0x4f5f6d);}async[a30_0x437caf(0x163)](_0x5b2077){const _0x52d058=a30_0x437caf,{options:_0x2bf801,args:_0x13a70d,tdx:_0x4d1462}=_0x5b2077;let _0x23f79e;try{_0x23f79e=parseTableReference(_0x13a70d[0x0]);const _0x1e18eb=_0x2bf801[_0x52d058(0x175)];!_0x23f79e[_0x52d058(0x175)]&&_0x1e18eb&&(_0x23f79e[_0x52d058(0x175)]=_0x1e18eb);const _0x393645=validateTableDescribeReference(_0x23f79e);if(_0x393645)return console[_0x52d058(0x170)](_0x52d058(0x179)+_0x393645),console[_0x52d058(0x170)](_0x52d058(0x17f)),console['error'](_0x52d058(0x180)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x2b7be2){return console[_0x52d058(0x170)](_0x52d058(0x179)+_0x2b7be2[_0x52d058(0x183)]),console['error'](_0x52d058(0x17f)),console[_0x52d058(0x170)](_0x52d058(0x180)),console[_0x52d058(0x170)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x41ea11=_0x23f79e[_0x52d058(0x181)],_0x28a26c=_0x23f79e[_0x52d058(0x175)],_0x14468e=_0x23f79e[_0x52d058(0x178)],_0x551535=resolveLimit(_0x2bf801[_0x52d058(0x16e)],DEFAULT_DISPLAY_LIMIT);try{_0x2bf801['verbose']&&(console['error'](_0x52d058(0x17d)+_0x2bf801[_0x52d058(0x164)]),_0x41ea11&&console[_0x52d058(0x170)](_0x52d058(0x174)+_0x41ea11),console[_0x52d058(0x170)]('Database:\x20'+_0x28a26c),console[_0x52d058(0x170)](_0x52d058(0x168)+_0x14468e),console[_0x52d058(0x170)](_0x52d058(0x169)+_0x551535));const _0x578f71=_0x41ea11?_0x41ea11+'.'+_0x28a26c+'.'+_0x14468e:_0x28a26c+'.'+_0x14468e,_0x3cb813=await withSpinner(_0x52d058(0x18b)+_0x578f71+_0x52d058(0x172),()=>_0x4d1462[_0x52d058(0x16d)][_0x52d058(0x163)](_0x28a26c,_0x14468e,_0x551535,_0x41ea11),{'verbose':_0x2bf801[_0x52d058(0x18c)]}),_0x563020=_0x3cb813[_0x52d058(0x17e)],_0x18c0a1=_0x563020[_0x52d058(0x17e)];return _0x18c0a1['length']===0x0?console[_0x52d058(0x170)](_0x52d058(0x17c)):console['error']('✔\x20Retrieved\x20'+_0x18c0a1['length']+_0x52d058(0x167)+(_0x18c0a1['length']!==0x1?'s':'')+_0x52d058(0x176)+_0x578f71),await handleSDKOutput(_0x18c0a1,_0x2bf801),0x0;}catch(_0x1c6df0){if(_0x1c6df0 instanceof SDKError)return console[_0x52d058(0x170)]('Error:\x20'+_0x1c6df0[_0x52d058(0x183)]),_0x1c6df0[_0x52d058(0x18a)]&&console['error'](_0x52d058(0x185)+_0x1c6df0[_0x52d058(0x18a)]),0x1;throw _0x1c6df0;}}[a30_0x437caf(0x186)](_0x261d57){const _0x3404a7=a30_0x437caf;if(_0x261d57[_0x3404a7(0x16f)][_0x3404a7(0x188)]===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(_0x261d57[_0x3404a7(0x16f)][_0x3404a7(0x188)]>0x1)return _0x3404a7(0x16c);return undefined;}}
@@ -1 +1 @@
1
- const a31_0x2a6bcf=a31_0x537c;(function(_0x1752cd,_0x443fab){const _0x331711=a31_0x537c,_0x213621=_0x1752cd();while(!![]){try{const _0x87148c=parseInt(_0x331711(0x1f3))/0x1+parseInt(_0x331711(0x216))/0x2*(-parseInt(_0x331711(0x1f8))/0x3)+parseInt(_0x331711(0x1e2))/0x4*(-parseInt(_0x331711(0x1e7))/0x5)+-parseInt(_0x331711(0x20b))/0x6+parseInt(_0x331711(0x20c))/0x7*(parseInt(_0x331711(0x20f))/0x8)+-parseInt(_0x331711(0x1f0))/0x9*(parseInt(_0x331711(0x205))/0xa)+parseInt(_0x331711(0x1f6))/0xb*(parseInt(_0x331711(0x215))/0xc);if(_0x87148c===_0x443fab)break;else _0x213621['push'](_0x213621['shift']());}catch(_0x109515){_0x213621['push'](_0x213621['shift']());}}}(a31_0x4971,0xdd6fe));function a31_0x4971(){const _0x145c65=['1113nIZCPy','listTables','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','data','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Error:\x20','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database\x20pattern:\x20','Database:\x20','message','cause','tables','310YXjybc','execute','includes','Listing\x20tables...','length','Note:\x20\x27','637350DnRQoX','21zWwKxO','query','\x20\x20Cause:\x20','957544RJtkzW','database','Or\x20use\x20--in\x20flag:','error','\x27\x20across\x20all\x20databases.','verbose','23818884BzyPgD','6042WOyqCn','List\x20tables\x20in\x20a\x20database','Database:\x20all','4VIpZbl','Error:\x20Pattern\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','table','5589880dVCdVA','Site:\x20','Table\x20pattern:\x20','site','\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x20\x20Use:\x20tdx\x20tables\x20\x22','description','✖\x20No\x20tables\x20found','211761upkNvf','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','validate','1637411zvmKfB','.*\x22','name','11TlVNvR','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'];a31_0x4971=function(){return _0x145c65;};return a31_0x4971();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0x537c(_0x50186c,_0x53c367){const _0x49710a=a31_0x4971();return a31_0x537c=function(_0x537ca9,_0x380304){_0x537ca9=_0x537ca9-0x1e2;let _0x58cb76=_0x49710a[_0x537ca9];return _0x58cb76;},a31_0x537c(_0x50186c,_0x53c367);}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a31_0x2a6bcf(0x1f5)]=a31_0x2a6bcf(0x204);[a31_0x2a6bcf(0x1ee)]=a31_0x2a6bcf(0x217);async[a31_0x2a6bcf(0x206)](_0x2beaec){const _0x40212c=a31_0x2a6bcf,{options:_0x23084b,args:_0x93bf2,tdx:_0x3e63ce}=_0x2beaec;let _0x4b94c4;if(_0x93bf2['length']===0x0)_0x4b94c4={'database':undefined,'table':undefined,'original':''};else{if(_0x93bf2[_0x40212c(0x209)]===0x1)try{_0x4b94c4=parseTableReference(_0x93bf2[0x0]);if(_0x4b94c4[_0x40212c(0x1e6)]&&!_0x4b94c4[_0x40212c(0x210)]&&!_0x4b94c4[_0x40212c(0x1e6)][_0x40212c(0x207)]('*')&&!_0x4b94c4[_0x40212c(0x1e6)][_0x40212c(0x207)]('?'))return console[_0x40212c(0x212)](_0x40212c(0x1e3)+_0x93bf2[0x0]+_0x40212c(0x1eb)),console['error']('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x4b94c4['table']+'\x27?'),console['error'](_0x40212c(0x1ed)+_0x4b94c4['table']+_0x40212c(0x1f4)),console[_0x40212c(0x212)](_0x40212c(0x1fd)+_0x4b94c4[_0x40212c(0x1e6)]),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x4b94c4[_0x40212c(0x1e6)]),console['error'](''),console['error'](_0x40212c(0x20a)+_0x93bf2[0x0]+_0x40212c(0x1e5)+_0x4b94c4['table']+_0x40212c(0x213)),0x1;}catch(_0x470021){return console[_0x40212c(0x212)](_0x40212c(0x1fe)+_0x470021[_0x40212c(0x202)]),0x1;}else return console[_0x40212c(0x212)](_0x40212c(0x1f7)),console[_0x40212c(0x212)](_0x40212c(0x1fc)),console[_0x40212c(0x212)](_0x40212c(0x1ff)),console['error'](_0x40212c(0x1e4)),console['error'](_0x40212c(0x1ec)),console[_0x40212c(0x212)](_0x40212c(0x211)),console['error'](_0x40212c(0x1fa)),0x1;}const _0x420fb1=_0x23084b[_0x40212c(0x210)];!_0x4b94c4[_0x40212c(0x210)]&&_0x420fb1&&(_0x4b94c4[_0x40212c(0x210)]=_0x420fb1);try{const _0x5b87aa=_0x54e854=>_0x54e854&&(_0x54e854['includes']('*')||_0x54e854[_0x40212c(0x207)]('?')),_0x125d96=_0x5b87aa(_0x4b94c4[_0x40212c(0x210)]);_0x23084b[_0x40212c(0x214)]&&(console['error'](_0x40212c(0x1e8)+_0x23084b[_0x40212c(0x1ea)]),_0x4b94c4[_0x40212c(0x210)]?_0x125d96?console[_0x40212c(0x212)](_0x40212c(0x200)+_0x4b94c4[_0x40212c(0x210)]):console[_0x40212c(0x212)](_0x40212c(0x201)+_0x4b94c4['database']):console[_0x40212c(0x212)](_0x40212c(0x218)),_0x4b94c4[_0x40212c(0x1e6)]&&console['error'](_0x40212c(0x1e9)+_0x4b94c4[_0x40212c(0x1e6)]));const _0x6ce647=_0x4b94c4[_0x40212c(0x210)]&&!_0x125d96?_0x4b94c4[_0x40212c(0x210)]:undefined,_0x1718ea=_0x125d96?_0x4b94c4['database']:undefined,_0x348036=_0x4b94c4[_0x40212c(0x1e6)],_0x188b12=resolveLimit(_0x23084b['limit'],DEFAULT_LISTING_LIMIT),_0x281992=await withSpinner(_0x40212c(0x208),()=>_0x3e63ce[_0x40212c(0x20d)][_0x40212c(0x1f9)](_0x6ce647,_0x348036,_0x1718ea,_0x188b12),{'verbose':_0x23084b[_0x40212c(0x214)]}),_0x72059d=_0x281992[_0x40212c(0x1fb)];if(_0x72059d[_0x40212c(0x209)]===0x0&&_0x4b94c4[_0x40212c(0x210)]&&!_0x125d96)return console[_0x40212c(0x212)](_0x40212c(0x1ef)),console[_0x40212c(0x212)]('Database\x20\x27'+_0x4b94c4['database']+_0x40212c(0x1f1)),0x1;return console[_0x40212c(0x212)]('✔\x20Found\x20'+_0x72059d['length']+'\x20table'+(_0x72059d[_0x40212c(0x209)]!==0x1?'s':'')),await handleSDKOutput(_0x72059d,{..._0x23084b,'limit':_0x188b12}),0x0;}catch(_0x271e57){if(_0x271e57 instanceof SDKError)return console[_0x40212c(0x212)]('Error:\x20'+_0x271e57['message']),_0x271e57['cause']&&console[_0x40212c(0x212)](_0x40212c(0x20e)+_0x271e57[_0x40212c(0x203)]),0x1;throw _0x271e57;}}[a31_0x2a6bcf(0x1f2)](_0x4b79c5){return undefined;}}
1
+ function a31_0x1264(_0x385df0,_0x18b90d){const _0x55a162=a31_0x55a1();return a31_0x1264=function(_0x12647a,_0x387f14){_0x12647a=_0x12647a-0x17e;let _0x183d99=_0x55a162[_0x12647a];return _0x183d99;},a31_0x1264(_0x385df0,_0x18b90d);}const a31_0x456647=a31_0x1264;(function(_0x22e36e,_0x391550){const _0xa8c9fa=a31_0x1264,_0xd4b1d2=_0x22e36e();while(!![]){try{const _0x32b96a=parseInt(_0xa8c9fa(0x18a))/0x1+-parseInt(_0xa8c9fa(0x198))/0x2*(-parseInt(_0xa8c9fa(0x1a4))/0x3)+parseInt(_0xa8c9fa(0x1ae))/0x4+-parseInt(_0xa8c9fa(0x19b))/0x5*(parseInt(_0xa8c9fa(0x1ac))/0x6)+parseInt(_0xa8c9fa(0x1a3))/0x7*(-parseInt(_0xa8c9fa(0x1aa))/0x8)+-parseInt(_0xa8c9fa(0x1b0))/0x9*(-parseInt(_0xa8c9fa(0x183))/0xa)+parseInt(_0xa8c9fa(0x1b1))/0xb;if(_0x32b96a===_0x391550)break;else _0xd4b1d2['push'](_0xd4b1d2['shift']());}catch(_0x101a80){_0xd4b1d2['push'](_0xd4b1d2['shift']());}}}(a31_0x55a1,0x4da11));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0x55a1(){const _0x1a1777=['\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','table','site','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','validate','name','cause','68789BrXLAS','552OiriYW','includes','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database:\x20','database','Error:\x20','368obAewi','Table\x20pattern:\x20','42552SwzsPd','Error:\x20Pattern\x20\x27','287628PgyeKL','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','9Cotjrj','4487648UPkdOT','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','verbose','\x20table','\x20\x20Use:\x20tdx\x20tables\x20\x22','Or\x20use\x20--in\x20flag:','tables','\x20\x20Cause:\x20','2439150ysFBBh','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','\x27\x20across\x20all\x20databases.','\x27\x20is\x20ambiguous.','description','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Database\x20pattern:\x20','456785KoJcuz','error','Listing\x20tables...','listTables','Note:\x20\x27','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Database:\x20all','length','limit','query','✖\x20No\x20tables\x20found','data','message','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','548LykbdV','execute','.*\x22','325hRyLBx'];a31_0x55a1=function(){return _0x1a1777;};return a31_0x55a1();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a31_0x456647(0x1a1)]=a31_0x456647(0x181);[a31_0x456647(0x187)]='List\x20tables\x20in\x20a\x20database';async[a31_0x456647(0x199)](_0x16cf28){const _0x12dafb=a31_0x456647,{options:_0x1cbd5a,args:_0xe38ad0,tdx:_0x4710ec}=_0x16cf28;let _0x8254e0;if(_0xe38ad0['length']===0x0)_0x8254e0={'database':undefined,'table':undefined,'original':''};else{if(_0xe38ad0['length']===0x1)try{_0x8254e0=parseTableReference(_0xe38ad0[0x0]);if(_0x8254e0[_0x12dafb(0x19d)]&&!_0x8254e0['database']&&!_0x8254e0[_0x12dafb(0x19d)][_0x12dafb(0x1a5)]('*')&&!_0x8254e0[_0x12dafb(0x19d)][_0x12dafb(0x1a5)]('?'))return console[_0x12dafb(0x18b)](_0x12dafb(0x1ad)+_0xe38ad0[0x0]+_0x12dafb(0x186)),console[_0x12dafb(0x18b)](_0x12dafb(0x197)+_0x8254e0[_0x12dafb(0x19d)]+'\x27?'),console['error'](_0x12dafb(0x17f)+_0x8254e0[_0x12dafb(0x19d)]+_0x12dafb(0x19a)),console['error'](_0x12dafb(0x19f)+_0x8254e0[_0x12dafb(0x19d)]),console['error'](_0x12dafb(0x19c)+_0x8254e0['table']),console[_0x12dafb(0x18b)](''),console['error'](_0x12dafb(0x18e)+_0xe38ad0[0x0]+_0x12dafb(0x1af)+_0x8254e0[_0x12dafb(0x19d)]+_0x12dafb(0x185)),0x1;}catch(_0x1c9fa0){return console[_0x12dafb(0x18b)](_0x12dafb(0x1a9)+_0x1c9fa0[_0x12dafb(0x196)]),0x1;}else return console[_0x12dafb(0x18b)](_0x12dafb(0x184)),console['error'](_0x12dafb(0x1a6)),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console['error'](_0x12dafb(0x1b2)),console[_0x12dafb(0x18b)](_0x12dafb(0x18f)),console['error'](_0x12dafb(0x180)),console[_0x12dafb(0x18b)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x5be292=_0x1cbd5a[_0x12dafb(0x1a8)];!_0x8254e0['database']&&_0x5be292&&(_0x8254e0[_0x12dafb(0x1a8)]=_0x5be292);try{const _0x5afc3d=_0x486edb=>_0x486edb&&(_0x486edb['includes']('*')||_0x486edb[_0x12dafb(0x1a5)]('?')),_0x2c7ab7=_0x5afc3d(_0x8254e0[_0x12dafb(0x1a8)]);_0x1cbd5a[_0x12dafb(0x1b3)]&&(console[_0x12dafb(0x18b)]('Site:\x20'+_0x1cbd5a[_0x12dafb(0x19e)]),_0x8254e0[_0x12dafb(0x1a8)]?_0x2c7ab7?console[_0x12dafb(0x18b)](_0x12dafb(0x189)+_0x8254e0[_0x12dafb(0x1a8)]):console[_0x12dafb(0x18b)](_0x12dafb(0x1a7)+_0x8254e0['database']):console[_0x12dafb(0x18b)](_0x12dafb(0x190)),_0x8254e0[_0x12dafb(0x19d)]&&console[_0x12dafb(0x18b)](_0x12dafb(0x1ab)+_0x8254e0[_0x12dafb(0x19d)]));const _0x393c5e=_0x8254e0['database']&&!_0x2c7ab7?_0x8254e0[_0x12dafb(0x1a8)]:undefined,_0xae37f6=_0x2c7ab7?_0x8254e0['database']:undefined,_0x3ec76a=_0x8254e0[_0x12dafb(0x19d)],_0x2b1c94=resolveLimit(_0x1cbd5a[_0x12dafb(0x192)],DEFAULT_LISTING_LIMIT),_0x31ee0f=await withSpinner(_0x12dafb(0x18c),()=>_0x4710ec[_0x12dafb(0x193)][_0x12dafb(0x18d)](_0x393c5e,_0x3ec76a,_0xae37f6,_0x2b1c94),{'verbose':_0x1cbd5a[_0x12dafb(0x1b3)]}),_0x23c359=_0x31ee0f[_0x12dafb(0x195)];if(_0x23c359[_0x12dafb(0x191)]===0x0&&_0x8254e0[_0x12dafb(0x1a8)]&&!_0x2c7ab7)return console['error'](_0x12dafb(0x194)),console[_0x12dafb(0x18b)]('Database\x20\x27'+_0x8254e0[_0x12dafb(0x1a8)]+_0x12dafb(0x188)),0x1;return console[_0x12dafb(0x18b)]('✔\x20Found\x20'+_0x23c359[_0x12dafb(0x191)]+_0x12dafb(0x17e)+(_0x23c359['length']!==0x1?'s':'')),await handleSDKOutput(_0x23c359,{..._0x1cbd5a,'limit':_0x2b1c94}),0x0;}catch(_0x57c385){if(_0x57c385 instanceof SDKError)return console[_0x12dafb(0x18b)]('Error:\x20'+_0x57c385[_0x12dafb(0x196)]),_0x57c385[_0x12dafb(0x1a2)]&&console['error'](_0x12dafb(0x182)+_0x57c385[_0x12dafb(0x1a2)]),0x1;throw _0x57c385;}}[a31_0x456647(0x1a0)](_0x17d777){return undefined;}}