@treasuredata/tdx 0.1.17 → 0.1.19

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 (111) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/client/cdp-client.js +1 -1
  4. package/dist/client/http-client.js +1 -1
  5. package/dist/client/llm-client.d.ts +2 -2
  6. package/dist/client/llm-client.d.ts.map +1 -1
  7. package/dist/client/llm-client.js +1 -1
  8. package/dist/client/rate-limiter.js +1 -1
  9. package/dist/client/td-client.js +1 -1
  10. package/dist/client/trino-client.js +1 -1
  11. package/dist/client/workflow-client.js +1 -1
  12. package/dist/commands/activations.js +1 -1
  13. package/dist/commands/api-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/chat-command.js.map +1 -1
  16. package/dist/commands/claude-command.d.ts.map +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-command.js.map +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/context-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/llm-command.d.ts.map +1 -1
  25. package/dist/commands/llm-command.js +1 -1
  26. package/dist/commands/llm-command.js.map +1 -1
  27. package/dist/commands/llm-proxy.d.ts.map +1 -1
  28. package/dist/commands/llm-proxy.js +1 -1
  29. package/dist/commands/llm-proxy.js.map +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profiles-command.js +1 -1
  32. package/dist/commands/query-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pwd-command.js +1 -1
  37. package/dist/commands/segment-update-command.js +1 -1
  38. package/dist/commands/segment-use-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/global-context.js +1 -1
  47. package/dist/core/profile.js +1 -1
  48. package/dist/core/project-config.js +1 -1
  49. package/dist/core/session.js +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/proxy/anthropic-adapter.d.ts +3 -3
  52. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  53. package/dist/proxy/anthropic-adapter.js +1 -1
  54. package/dist/proxy/anthropic-adapter.js.map +1 -1
  55. package/dist/proxy/server.d.ts +5 -3
  56. package/dist/proxy/server.d.ts.map +1 -1
  57. package/dist/proxy/server.js +1 -1
  58. package/dist/proxy/server.js.map +1 -1
  59. package/dist/sdk/api.js +1 -1
  60. package/dist/sdk/database.js +1 -1
  61. package/dist/sdk/errors.js +1 -1
  62. package/dist/sdk/index.js +1 -1
  63. package/dist/sdk/job.js +1 -1
  64. package/dist/sdk/llm.d.ts +14 -0
  65. package/dist/sdk/llm.d.ts.map +1 -1
  66. package/dist/sdk/llm.js +1 -1
  67. package/dist/sdk/llm.js.map +1 -1
  68. package/dist/sdk/query.js +1 -1
  69. package/dist/sdk/segment.js +1 -1
  70. package/dist/sdk/table.js +1 -1
  71. package/dist/sdk/workflow.js +1 -1
  72. package/dist/types/endpoints.js +1 -1
  73. package/dist/types/index.d.ts +41 -21
  74. package/dist/types/index.d.ts.map +1 -1
  75. package/dist/types/index.js +1 -1
  76. package/dist/utils/agent-ref-parser.js +1 -1
  77. package/dist/utils/chat-cache.js +1 -1
  78. package/dist/utils/colors.d.ts +4 -0
  79. package/dist/utils/colors.d.ts.map +1 -1
  80. package/dist/utils/colors.js +1 -1
  81. package/dist/utils/colors.js.map +1 -1
  82. package/dist/utils/command-output.js +1 -1
  83. package/dist/utils/file-permissions.js +1 -1
  84. package/dist/utils/format-detector.js +1 -1
  85. package/dist/utils/formatters.js +1 -1
  86. package/dist/utils/json-loader.js +1 -1
  87. package/dist/utils/model-aliases.d.ts +15 -0
  88. package/dist/utils/model-aliases.d.ts.map +1 -1
  89. package/dist/utils/model-aliases.js +1 -1
  90. package/dist/utils/model-aliases.js.map +1 -1
  91. package/dist/utils/option-validation.js +1 -1
  92. package/dist/utils/port.js +1 -1
  93. package/dist/utils/process.js +1 -1
  94. package/dist/utils/prompt.js +1 -1
  95. package/dist/utils/segment-path-parser.js +1 -1
  96. package/dist/utils/segment-ref-parser.js +1 -1
  97. package/dist/utils/spinner.js +1 -1
  98. package/dist/utils/sql-parser.js +1 -1
  99. package/dist/utils/sse-parser.d.ts +2 -2
  100. package/dist/utils/sse-parser.d.ts.map +1 -1
  101. package/dist/utils/sse-parser.js +1 -1
  102. package/dist/utils/sse-parser.js.map +1 -1
  103. package/dist/utils/string-utils.js +1 -1
  104. package/dist/utils/table-ref-parser.js +1 -1
  105. package/dist/utils/tree-formatter.js +1 -1
  106. package/dist/utils/version-check.d.ts +28 -0
  107. package/dist/utils/version-check.d.ts.map +1 -0
  108. package/dist/utils/version-check.js +1 -0
  109. package/dist/utils/version-check.js.map +1 -0
  110. package/dist/utils/workflow-utils.js +1 -1
  111. package/package.json +3 -1
@@ -1 +1 @@
1
- const a19_0x3bbb43=a19_0x1ed9;function a19_0x1773(){const _0x1cc2e6=['Error:\x20--database\x20and\x20--table\x20are\x20required','✔\x20Updated\x20parent\x20segment\x20\x27','30243ZoXvyl','behaviorsFile','customerGroupFile','755450Njsceo','Parent\x20segment:\x20','186fzJkbe','scheduleType','468734zcAJiZ','scheduleOption','467334wXjjKq','Error:\x20Parent\x20segment\x20name\x20is\x20required','table','error','368811sxnOgu','name','addBehaviorsFile','44qqvmuZ','getParentFull','data','timezone','120MLZiEk','description','\x27...','addAttributes','addBehaviors','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','updateParent','addAttributesFile','length','Name:\x20','\x27\x20with\x20ID:\x20','attributesFile','✔\x20Created\x20parent\x20segment\x20\x27','customerGroup','1052894rtSeaY','Site:\x20','verbose','createParent','35950ZdlOJf','attributes','database','Table:\x20','segment:parent:create','40Jndtds','segment','Create\x20new\x20parent\x20segment\x20(audience)','Update\x20existing\x20parent\x20segment\x20(audience)','segment:parent:update','master','behaviors'];a19_0x1773=function(){return _0x1cc2e6;};return a19_0x1773();}(function(_0x3c4c0f,_0x32c261){const _0x3eefce=a19_0x1ed9,_0x361f5b=_0x3c4c0f();while(!![]){try{const _0x2cf428=-parseInt(_0x3eefce(0x1f1))/0x1+parseInt(_0x3eefce(0x20a))/0x2+parseInt(_0x3eefce(0x21c))/0x3*(parseInt(_0x3eefce(0x213))/0x4)+-parseInt(_0x3eefce(0x20e))/0x5*(parseInt(_0x3eefce(0x221))/0x6)+parseInt(_0x3eefce(0x223))/0x7+-parseInt(_0x3eefce(0x1fc))/0x8*(-parseInt(_0x3eefce(0x1f5))/0x9)+parseInt(_0x3eefce(0x21f))/0xa*(-parseInt(_0x3eefce(0x1f8))/0xb);if(_0x2cf428===_0x32c261)break;else _0x361f5b['push'](_0x361f5b['shift']());}catch(_0x3adbc3){_0x361f5b['push'](_0x361f5b['shift']());}}}(a19_0x1773,0x4d454));function a19_0x1ed9(_0x3f603d,_0x43755e){const _0x1773df=a19_0x1773();return a19_0x1ed9=function(_0x1ed917,_0x528a5d){_0x1ed917=_0x1ed917-0x1f0;let _0x21a8d5=_0x1773df[_0x1ed917];return _0x21a8d5;},a19_0x1ed9(_0x3f603d,_0x43755e);}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';export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x3bbb43(0x1f6)]=a19_0x3bbb43(0x212);[a19_0x3bbb43(0x1fd)]=a19_0x3bbb43(0x215);async['execute'](_0x1b669a){const _0x41f712=a19_0x3bbb43,{options:_0x45da1d,args:_0x5c98ef,tdx:_0x56e939}=_0x1b669a,_0x289a16=_0x45da1d;if(_0x5c98ef[_0x41f712(0x204)]===0x0)return console['error'](_0x41f712(0x1f2)),console[_0x41f712(0x1f4)](_0x41f712(0x201)),0x1;const _0x1ece13=_0x5c98ef[0x0];if(!_0x289a16[_0x41f712(0x210)]||!_0x289a16[_0x41f712(0x1f3)])return console[_0x41f712(0x1f4)](_0x41f712(0x21a)),console['error'](_0x41f712(0x201)),0x1;_0x289a16[_0x41f712(0x20c)]&&(console['error'](_0x41f712(0x20b)+_0x289a16['site']),console[_0x41f712(0x1f4)](_0x41f712(0x205)+_0x1ece13),console['error']('Database:\x20'+_0x289a16[_0x41f712(0x210)]),console['error'](_0x41f712(0x211)+_0x289a16[_0x41f712(0x1f3)]));const _0x4cca28=await loadJSONFromOptions(_0x289a16[_0x41f712(0x20f)],_0x289a16[_0x41f712(0x207)]),_0x3b1f6f=await loadJSONFromOptions(_0x289a16['behaviors'],_0x289a16[_0x41f712(0x21d)]),_0x5c8e6b=await loadJSONFromOptions(_0x289a16[_0x41f712(0x209)],_0x289a16[_0x41f712(0x21e)]),_0x4afb28={'name':_0x1ece13,'description':_0x289a16[_0x41f712(0x1fd)],'scheduleType':_0x289a16[_0x41f712(0x222)],'scheduleOption':_0x289a16[_0x41f712(0x1f0)],'timezone':_0x289a16[_0x41f712(0x1fb)],'master':{'parentDatabaseName':_0x289a16[_0x41f712(0x210)],'parentTableName':_0x289a16[_0x41f712(0x1f3)]},'attributes':_0x4cca28,'behaviors':_0x3b1f6f,'customerGroup':_0x5c8e6b},_0x10525a=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x1ece13+_0x41f712(0x1fe),()=>_0x56e939['segment'][_0x41f712(0x20d)](_0x4afb28),{'verbose':_0x45da1d[_0x41f712(0x20c)]}),_0x551f5d=_0x10525a[_0x41f712(0x1fa)];return console[_0x41f712(0x1f4)](_0x41f712(0x208)+_0x551f5d['name']+_0x41f712(0x206)+_0x551f5d['id']),await handleSDKOutput([_0x551f5d],_0x45da1d),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a19_0x3bbb43(0x1f6)]=a19_0x3bbb43(0x217);[a19_0x3bbb43(0x1fd)]=a19_0x3bbb43(0x216);async['execute'](_0x5d3059){const _0x34e6dc=a19_0x3bbb43,{options:_0x49c227,args:_0x2206c6,tdx:_0x4d3938}=_0x5d3059,_0x4412b0=_0x49c227;if(_0x2206c6[_0x34e6dc(0x204)]===0x0)return console[_0x34e6dc(0x1f4)](_0x34e6dc(0x1f2)),console[_0x34e6dc(0x1f4)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x5d2c0b=_0x2206c6[0x0];_0x4412b0[_0x34e6dc(0x20c)]&&(console['error'](_0x34e6dc(0x20b)+_0x4412b0['site']),console[_0x34e6dc(0x1f4)](_0x34e6dc(0x220)+_0x5d2c0b));const _0x29fd0a=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x5d2c0b+_0x34e6dc(0x1fe),()=>_0x4d3938[_0x34e6dc(0x214)][_0x34e6dc(0x1f9)](_0x5d2c0b),{'verbose':_0x4412b0[_0x34e6dc(0x20c)]}),_0x5e23a9=_0x29fd0a[_0x34e6dc(0x1fa)],_0x57b91b=await loadJSONFromOptions(_0x4412b0[_0x34e6dc(0x1ff)],_0x4412b0[_0x34e6dc(0x203)]),_0x3814c4=await loadJSONFromOptions(_0x4412b0[_0x34e6dc(0x200)],_0x4412b0[_0x34e6dc(0x1f7)]),_0x235cac={'name':_0x5e23a9['name'],'description':_0x4412b0['description']!==undefined?_0x4412b0[_0x34e6dc(0x1fd)]:_0x5e23a9[_0x34e6dc(0x1fd)],'scheduleType':_0x4412b0['scheduleType']!==undefined?_0x4412b0[_0x34e6dc(0x222)]:_0x5e23a9[_0x34e6dc(0x222)],'scheduleOption':_0x4412b0[_0x34e6dc(0x1f0)]!==undefined?_0x4412b0[_0x34e6dc(0x1f0)]:_0x5e23a9[_0x34e6dc(0x1f0)],'timezone':_0x4412b0['timezone']!==undefined?_0x4412b0[_0x34e6dc(0x1fb)]:_0x5e23a9[_0x34e6dc(0x1fb)],'master':_0x5e23a9[_0x34e6dc(0x218)],'attributes':_0x57b91b?[..._0x5e23a9[_0x34e6dc(0x20f)]||[],..._0x57b91b]:_0x5e23a9[_0x34e6dc(0x20f)],'behaviors':_0x3814c4?[..._0x5e23a9[_0x34e6dc(0x219)]||[],..._0x3814c4]:_0x5e23a9[_0x34e6dc(0x219)],'customerGroup':_0x5e23a9[_0x34e6dc(0x209)]},_0x7c9bf2=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x5d2c0b+_0x34e6dc(0x1fe),()=>_0x4d3938[_0x34e6dc(0x214)][_0x34e6dc(0x202)](_0x5d2c0b,_0x235cac),{'verbose':_0x4412b0[_0x34e6dc(0x20c)]}),_0x4ba87a=_0x7c9bf2[_0x34e6dc(0x1fa)];return console['error'](_0x34e6dc(0x21b)+_0x4ba87a[_0x34e6dc(0x1f6)]+'\x27'),await handleSDKOutput([_0x4ba87a],_0x4412b0),0x0;}}
1
+ const a19_0x938094=a19_0x551a;function a19_0x551a(_0x26fe72,_0x3970e4){const _0x516324=a19_0x5163();return a19_0x551a=function(_0x551acd,_0x38cb13){_0x551acd=_0x551acd-0x14c;let _0x468aab=_0x516324[_0x551acd];return _0x468aab;},a19_0x551a(_0x26fe72,_0x3970e4);}(function(_0x46f05b,_0x5a592c){const _0x215f73=a19_0x551a,_0x124c35=_0x46f05b();while(!![]){try{const _0x49f105=parseInt(_0x215f73(0x162))/0x1+-parseInt(_0x215f73(0x157))/0x2+-parseInt(_0x215f73(0x15e))/0x3+parseInt(_0x215f73(0x165))/0x4*(-parseInt(_0x215f73(0x178))/0x5)+-parseInt(_0x215f73(0x169))/0x6+parseInt(_0x215f73(0x16e))/0x7*(parseInt(_0x215f73(0x15b))/0x8)+-parseInt(_0x215f73(0x155))/0x9*(-parseInt(_0x215f73(0x14f))/0xa);if(_0x49f105===_0x5a592c)break;else _0x124c35['push'](_0x124c35['shift']());}catch(_0xb64f4e){_0x124c35['push'](_0x124c35['shift']());}}}(a19_0x5163,0x45e7b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a19_0x5163(){const _0x21038e=['table','createParent','site','9rxSPWG','master','612858JPLFPs','segment:parent:create','addAttributes','addBehaviorsFile','248gfkOwK','✔\x20Created\x20parent\x20segment\x20\x27','Create\x20new\x20parent\x20segment\x20(audience)','250974wgSKxo','\x27...','customerGroup','Site:\x20','11021sxvmPX','execute','description','2032588JVVFHq','addAttributesFile','Update\x20existing\x20parent\x20segment\x20(audience)','name','3115740GkBnpF','Error:\x20--database\x20and\x20--table\x20are\x20required','Parent\x20segment:\x20','updateParent','attributes','58933BkPAyl','addBehaviors','data','verbose','behaviorsFile','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Database:\x20','scheduleOption','behaviors','timezone','5CXklld','scheduleType','length','Updating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Error:\x20Parent\x20segment\x20name\x20is\x20required','database','Name:\x20','segment','segment:parent:update','Table:\x20','14318450OerlxW','error','\x27\x20with\x20ID:\x20'];a19_0x5163=function(){return _0x21038e;};return a19_0x5163();}export class ParentSegmentCreateCommand extends BaseCommand{[a19_0x938094(0x168)]=a19_0x938094(0x158);[a19_0x938094(0x164)]=a19_0x938094(0x15d);async['execute'](_0x2023bb){const _0x5bb1ec=a19_0x938094,{options:_0x2d3622,args:_0x4cb9ae,tdx:_0x2b4ddc}=_0x2023bb,_0x2a4541=_0x2d3622;if(_0x4cb9ae[_0x5bb1ec(0x17a)]===0x0)return console[_0x5bb1ec(0x150)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x5bb1ec(0x150)](_0x5bb1ec(0x173)),0x1;const _0x122c9e=_0x4cb9ae[0x0];if(!_0x2a4541['database']||!_0x2a4541[_0x5bb1ec(0x152)])return console[_0x5bb1ec(0x150)](_0x5bb1ec(0x16a)),console[_0x5bb1ec(0x150)](_0x5bb1ec(0x173)),0x1;_0x2a4541[_0x5bb1ec(0x171)]&&(console[_0x5bb1ec(0x150)](_0x5bb1ec(0x161)+_0x2a4541[_0x5bb1ec(0x154)]),console['error'](_0x5bb1ec(0x17f)+_0x122c9e),console[_0x5bb1ec(0x150)](_0x5bb1ec(0x174)+_0x2a4541[_0x5bb1ec(0x17e)]),console[_0x5bb1ec(0x150)](_0x5bb1ec(0x14e)+_0x2a4541[_0x5bb1ec(0x152)]));const _0x379b24=await loadJSONFromOptions(_0x2a4541[_0x5bb1ec(0x16d)],_0x2a4541['attributesFile']),_0x548968=await loadJSONFromOptions(_0x2a4541['behaviors'],_0x2a4541[_0x5bb1ec(0x172)]),_0x29a622=await loadJSONFromOptions(_0x2a4541[_0x5bb1ec(0x160)],_0x2a4541['customerGroupFile']),_0x528207={'name':_0x122c9e,'description':_0x2a4541[_0x5bb1ec(0x164)],'scheduleType':_0x2a4541['scheduleType'],'scheduleOption':_0x2a4541[_0x5bb1ec(0x175)],'timezone':_0x2a4541[_0x5bb1ec(0x177)],'master':{'parentDatabaseName':_0x2a4541[_0x5bb1ec(0x17e)],'parentTableName':_0x2a4541[_0x5bb1ec(0x152)]},'attributes':_0x379b24,'behaviors':_0x548968,'customerGroup':_0x29a622},_0x27d8de=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x122c9e+'\x27...',()=>_0x2b4ddc[_0x5bb1ec(0x14c)][_0x5bb1ec(0x153)](_0x528207),{'verbose':_0x2d3622[_0x5bb1ec(0x171)]}),_0x3c8499=_0x27d8de[_0x5bb1ec(0x170)];return console[_0x5bb1ec(0x150)](_0x5bb1ec(0x15c)+_0x3c8499[_0x5bb1ec(0x168)]+_0x5bb1ec(0x151)+_0x3c8499['id']),await handleSDKOutput([_0x3c8499],_0x2d3622),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a19_0x938094(0x14d);[a19_0x938094(0x164)]=a19_0x938094(0x167);async[a19_0x938094(0x163)](_0x449d80){const _0x3e3f98=a19_0x938094,{options:_0x3afa42,args:_0xc42d71,tdx:_0x154290}=_0x449d80,_0x4c6ea3=_0x3afa42;if(_0xc42d71[_0x3e3f98(0x17a)]===0x0)return console[_0x3e3f98(0x150)](_0x3e3f98(0x17d)),console[_0x3e3f98(0x150)](_0x3e3f98(0x17c)),0x1;const _0x55798c=_0xc42d71[0x0];_0x4c6ea3[_0x3e3f98(0x171)]&&(console[_0x3e3f98(0x150)](_0x3e3f98(0x161)+_0x4c6ea3[_0x3e3f98(0x154)]),console[_0x3e3f98(0x150)](_0x3e3f98(0x16b)+_0x55798c));const _0x5b6263=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x55798c+_0x3e3f98(0x15f),()=>_0x154290[_0x3e3f98(0x14c)]['getParentFull'](_0x55798c),{'verbose':_0x4c6ea3[_0x3e3f98(0x171)]}),_0x28acde=_0x5b6263['data'],_0x1ec822=await loadJSONFromOptions(_0x4c6ea3[_0x3e3f98(0x159)],_0x4c6ea3[_0x3e3f98(0x166)]),_0x3b326e=await loadJSONFromOptions(_0x4c6ea3[_0x3e3f98(0x16f)],_0x4c6ea3[_0x3e3f98(0x15a)]),_0x227b18={'name':_0x28acde[_0x3e3f98(0x168)],'description':_0x4c6ea3[_0x3e3f98(0x164)]!==undefined?_0x4c6ea3['description']:_0x28acde[_0x3e3f98(0x164)],'scheduleType':_0x4c6ea3[_0x3e3f98(0x179)]!==undefined?_0x4c6ea3[_0x3e3f98(0x179)]:_0x28acde[_0x3e3f98(0x179)],'scheduleOption':_0x4c6ea3['scheduleOption']!==undefined?_0x4c6ea3[_0x3e3f98(0x175)]:_0x28acde[_0x3e3f98(0x175)],'timezone':_0x4c6ea3[_0x3e3f98(0x177)]!==undefined?_0x4c6ea3[_0x3e3f98(0x177)]:_0x28acde[_0x3e3f98(0x177)],'master':_0x28acde[_0x3e3f98(0x156)],'attributes':_0x1ec822?[..._0x28acde[_0x3e3f98(0x16d)]||[],..._0x1ec822]:_0x28acde[_0x3e3f98(0x16d)],'behaviors':_0x3b326e?[..._0x28acde[_0x3e3f98(0x176)]||[],..._0x3b326e]:_0x28acde[_0x3e3f98(0x176)],'customerGroup':_0x28acde['customerGroup']},_0x14652e=await withSpinner(_0x3e3f98(0x17b)+_0x55798c+'\x27...',()=>_0x154290[_0x3e3f98(0x14c)][_0x3e3f98(0x16c)](_0x55798c,_0x227b18),{'verbose':_0x4c6ea3[_0x3e3f98(0x171)]}),_0xbde26b=_0x14652e[_0x3e3f98(0x170)];return console[_0x3e3f98(0x150)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0xbde26b[_0x3e3f98(0x168)]+'\x27'),await handleSDKOutput([_0xbde26b],_0x4c6ea3),0x0;}}
@@ -1 +1 @@
1
- const a20_0x259480=a20_0x16fc;function a20_0x3f66(){const _0x3b2250=['75098bEpMbV','771230hFlsAz','866464dNzACT','11244ekYFKa','execute','List\x20all\x20available\x20profiles','1EVjxqZ','2079QmGMiv','10PpPoOu','2008728jvDQQP','description','map','34909PyWZfK','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','Error:\x20','profiles','9TqFVjU','error','scope','40TjZeAE','name','log','1309854zvGMGG','config'];a20_0x3f66=function(){return _0x3b2250;};return a20_0x3f66();}(function(_0x5c47e9,_0x547c21){const _0x4e3762=a20_0x16fc,_0x27c3d3=_0x5c47e9();while(!![]){try{const _0x4f1fe2=parseInt(_0x4e3762(0x167))/0x1*(-parseInt(_0x4e3762(0x161))/0x2)+-parseInt(_0x4e3762(0x15f))/0x3+parseInt(_0x4e3762(0x163))/0x4*(parseInt(_0x4e3762(0x169))/0x5)+parseInt(_0x4e3762(0x16a))/0x6+parseInt(_0x4e3762(0x16d))/0x7*(parseInt(_0x4e3762(0x15c))/0x8)+-parseInt(_0x4e3762(0x159))/0x9*(-parseInt(_0x4e3762(0x162))/0xa)+parseInt(_0x4e3762(0x168))/0xb*(-parseInt(_0x4e3762(0x164))/0xc);if(_0x4f1fe2===_0x547c21)break;else _0x27c3d3['push'](_0x27c3d3['shift']());}catch(_0x55daee){_0x27c3d3['push'](_0x27c3d3['shift']());}}}(a20_0x3f66,0x356c2));function a20_0x16fc(_0x34c415,_0x46dae5){const _0x3f669c=a20_0x3f66();return a20_0x16fc=function(_0x16fc81,_0x107c9a){_0x16fc81=_0x16fc81-0x157;let _0x3b6b17=_0x3f669c[_0x16fc81];return _0x3b6b17;},a20_0x16fc(_0x34c415,_0x46dae5);}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{[a20_0x259480(0x15d)]=a20_0x259480(0x158);[a20_0x259480(0x16b)]=a20_0x259480(0x166);async[a20_0x259480(0x165)](_0x3a0b6e){const _0x5866b6=a20_0x259480,{options:_0x4f8cbb}=_0x3a0b6e;try{const _0x5e608a=listProfiles(),_0x5466ad=getActiveProfile();if(_0x5e608a['length']===0x0)return console[_0x5866b6(0x15e)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x5866b6(0x15e)](_0x5866b6(0x16e)),console['log']('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x4f6ff6=_0x5e608a[_0x5866b6(0x16c)](_0x20f6c0=>{const _0x3841e5=_0x5866b6,_0x58ac9f=_0x20f6c0[_0x3841e5(0x15d)]===_0x5466ad,_0x39a7cf=getProfileParams(_0x20f6c0[_0x3841e5(0x160)]);return{'name':_0x20f6c0[_0x3841e5(0x15d)],'active':_0x58ac9f,'scope':_0x20f6c0[_0x3841e5(0x15b)],'description':_0x20f6c0[_0x3841e5(0x160)][_0x3841e5(0x16b)]||'','params':_0x39a7cf};});return await handleSDKOutput(_0x4f6ff6,_0x4f8cbb),0x0;}catch(_0x455121){return _0x455121 instanceof Error&&console[_0x5866b6(0x15a)](_0x5866b6(0x157)+_0x455121['message']),0x1;}}}
1
+ const a20_0x12d757=a20_0x2b38;(function(_0x4b86fd,_0x40cf69){const _0x458848=a20_0x2b38,_0x5721c2=_0x4b86fd();while(!![]){try{const _0x72a340=-parseInt(_0x458848(0x190))/0x1*(-parseInt(_0x458848(0x18e))/0x2)+-parseInt(_0x458848(0x18f))/0x3*(parseInt(_0x458848(0x184))/0x4)+parseInt(_0x458848(0x183))/0x5+-parseInt(_0x458848(0x186))/0x6+parseInt(_0x458848(0x181))/0x7+-parseInt(_0x458848(0x193))/0x8+parseInt(_0x458848(0x192))/0x9;if(_0x72a340===_0x40cf69)break;else _0x5721c2['push'](_0x5721c2['shift']());}catch(_0x45f5b7){_0x5721c2['push'](_0x5721c2['shift']());}}}(a20_0x47de,0x35965));import{BaseCommand}from'./command.js';function a20_0x47de(){const _0x26b90c=['profiles','log','109576CmYEaq','3bbXcyw','3aLSpFi','config','3113856TpUbIU','582904RJUCwb','672588dFGpwP','name','1024890RfntDE','1507228aPWZsy','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','853482UDYdPD','description','scope','map','Error:\x20','List\x20all\x20available\x20profiles'];a20_0x47de=function(){return _0x26b90c;};return a20_0x47de();}function a20_0x2b38(_0x4b529c,_0x166fef){const _0x47de18=a20_0x47de();return a20_0x2b38=function(_0x2b386e,_0x2c0824){_0x2b386e=_0x2b386e-0x181;let _0x22e925=_0x47de18[_0x2b386e];return _0x22e925;},a20_0x2b38(_0x4b529c,_0x166fef);}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a20_0x12d757(0x182)]=a20_0x12d757(0x18c);['description']=a20_0x12d757(0x18b);async['execute'](_0x74c12a){const _0x236bf9=a20_0x12d757,{options:_0x518daf}=_0x74c12a;try{const _0x8eb783=listProfiles(),_0xeed69d=getActiveProfile();if(_0x8eb783['length']===0x0)return console[_0x236bf9(0x18d)]('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x236bf9(0x18d)](_0x236bf9(0x185)),console[_0x236bf9(0x18d)]('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x4098c5=_0x8eb783[_0x236bf9(0x189)](_0x10aac2=>{const _0x118d46=_0x236bf9,_0x40e6a7=_0x10aac2['name']===_0xeed69d,_0x422e92=getProfileParams(_0x10aac2[_0x118d46(0x191)]);return{'name':_0x10aac2['name'],'active':_0x40e6a7,'scope':_0x10aac2[_0x118d46(0x188)],'description':_0x10aac2[_0x118d46(0x191)][_0x118d46(0x187)]||'','params':_0x422e92};});return await handleSDKOutput(_0x4098c5,_0x518daf),0x0;}catch(_0x1935d4){return _0x1935d4 instanceof Error&&console['error'](_0x236bf9(0x18a)+_0x1935d4['message']),0x1;}}}
@@ -1 +1 @@
1
- function a21_0x3c32(_0x4ad793,_0x5240c1){const _0x756fbf=a21_0x756f();return a21_0x3c32=function(_0x3c3234,_0x526ed8){_0x3c3234=_0x3c3234-0x14e;let _0x1d0e1f=_0x756fbf[_0x3c3234];return _0x1d0e1f;},a21_0x3c32(_0x4ad793,_0x5240c1);}const a21_0x3ae19d=a21_0x3c32;(function(_0x3631c4,_0x56e3fa){const _0x347c07=a21_0x3c32,_0x99f200=_0x3631c4();while(!![]){try{const _0x5c5e67=parseInt(_0x347c07(0x180))/0x1*(parseInt(_0x347c07(0x164))/0x2)+-parseInt(_0x347c07(0x17f))/0x3+-parseInt(_0x347c07(0x176))/0x4*(-parseInt(_0x347c07(0x175))/0x5)+-parseInt(_0x347c07(0x17b))/0x6+parseInt(_0x347c07(0x172))/0x7+parseInt(_0x347c07(0x16f))/0x8*(-parseInt(_0x347c07(0x150))/0x9)+parseInt(_0x347c07(0x154))/0xa;if(_0x5c5e67===_0x56e3fa)break;else _0x99f200['push'](_0x99f200['shift']());}catch(_0x241c7d){_0x99f200['push'](_0x99f200['shift']());}}}(a21_0x756f,0x7144b));import{BaseCommand}from'./command.js';function a21_0x756f(){const _0x311e3f=['stats','Site:\x20','execute','setExtra','6xYBImq','\x20splits','query','\x0aAll\x20results\x20saved\x20to\x20','Run\x20Trino\x20queries\x20(streaming)','output','length','Error:\x20','message','\x20rows\x20','elapsedTimeMillis','48zrMaQM','push','args','3847235oXvNxo','processedRows','totalSplits','5kNxbDr','2760112UucEOw','state','completedSplits','validate','\x20[Job\x20ID:\x20','2271486KkbfSZ','Executing\x20query...','description','options','368721WiUQfH','48666cakzjn','setPhase','site','1066734JfRhVf','Query\x20completed:\x20Processed\x20','error','Executing\x20statement\x20','2909600VjuCBN','Statement\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','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','...','../utils/command-output.js','setJobId','file','jobId','database','\x20-\x20','information_schema'];a21_0x756f=function(){return _0x311e3f;};return a21_0x756f();}import{SDKError}from'../sdk/index.js';import{handleQueryOutput}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';export class QueryCommand extends BaseCommand{['name']=a21_0x3ae19d(0x166);[a21_0x3ae19d(0x17d)]=a21_0x3ae19d(0x168);async[a21_0x3ae19d(0x162)](_0x56296c){const _0x1553f4=a21_0x3ae19d,{options:_0x33811d,args:_0x168f13,tdx:_0xcacb7d}=_0x56296c,_0x2a3c53=_0x168f13[0x0],_0x16e1a1=_0x33811d[_0x1553f4(0x15b)];let _0xd7452d;if(_0x16e1a1)try{_0xd7452d=readSqlStatementsFromFile(_0x16e1a1);}catch(_0x23678c){return console['error'](_0x1553f4(0x16b)+_0x23678c['message']),0x1;}else try{_0xd7452d=splitSqlStatements(_0x2a3c53);}catch(_0x33227e){return console['error'](_0x1553f4(0x16b)+_0x33227e[_0x1553f4(0x16c)]),0x1;}const _0x30d155=_0x33811d[_0x1553f4(0x15d)]||_0x1553f4(0x15f),_0x2234d4=_0x33811d['catalog'];try{const _0x89df2f=[],_0x5203be=!!_0x33811d['output'];for(let _0x2250ee=0x0;_0x2250ee<_0xd7452d['length'];_0x2250ee++){const _0x4cd4ea=_0xd7452d[_0x2250ee],_0x3794ba=_0x2250ee+0x1,_0x20d233=_0xd7452d[_0x1553f4(0x16a)],_0x293330=_0x20d233>0x1;_0x33811d['verbose']&&(console[_0x1553f4(0x152)]('\x0a'+(_0x293330?_0x1553f4(0x155)+_0x3794ba+'/'+_0x20d233+':':'')),console[_0x1553f4(0x152)](_0x1553f4(0x161)+_0x33811d[_0x1553f4(0x14f)]),console[_0x1553f4(0x152)]('Catalog:\x20'+(_0x2234d4||'td')),console[_0x1553f4(0x152)]('Schema:\x20'+_0x30d155),console['error']('SQL:\x20'+_0x4cd4ea));const _0x2aa1b6=_0x293330?_0x1553f4(0x153)+_0x3794ba+'/'+_0x20d233+_0x1553f4(0x158):_0x1553f4(0x17c);try{const _0x564056=await withQuerySpinner(_0x2aa1b6,async _0x1c2899=>{const _0xc3bad9=await _0xcacb7d['query'](_0x4cd4ea,{'catalog':_0x2234d4,'schema':_0x30d155,'onJobId':_0x532f87=>{const _0x399cfc=a21_0x3c32;_0x1c2899[_0x399cfc(0x15a)](_0x532f87);},'onProgress':_0x549863=>{const _0x304d5f=a21_0x3c32;_0x1c2899[_0x304d5f(0x14e)]('Executing\x20query\x20['+_0x549863[_0x304d5f(0x177)]+']'),_0x1c2899[_0x304d5f(0x163)](formatRows(_0x549863[_0x304d5f(0x173)])+_0x304d5f(0x16d)+_0x549863[_0x304d5f(0x178)]+'/'+_0x549863[_0x304d5f(0x174)]+_0x304d5f(0x165));}});return _0xc3bad9;},{'verbose':_0x33811d['verbose']}),_0x4514b2=_0x564056['data'],_0x495f51=_0x4514b2[_0x1553f4(0x15c)]?_0x1553f4(0x17a)+_0x4514b2['jobId']+']':'',_0x57189b=_0x293330?_0x1553f4(0x155)+_0x3794ba+'/'+_0x20d233+_0x1553f4(0x15e):'';console['error']('✔\x20'+_0x57189b+_0x1553f4(0x151)+formatRows(_0x4514b2[_0x1553f4(0x160)][_0x1553f4(0x173)])+_0x1553f4(0x16d)+('in\x20'+formatElapsed(_0x4514b2[_0x1553f4(0x160)][_0x1553f4(0x16e)])+_0x495f51));if(_0x293330&&_0x5203be){const {formatQueryOutput:_0x21b52a,resolveOutputOptions:_0x2091af}=await import(_0x1553f4(0x159)),_0x25cd71=_0x2091af(_0x33811d),_0x329f1a=await _0x21b52a(_0x4514b2,_0x25cd71);_0x89df2f[_0x1553f4(0x170)](_0x329f1a);}else await handleQueryOutput(_0x4514b2,_0x33811d);}catch(_0xca5c20){const _0x30df9b=_0x293330?_0x1553f4(0x155)+_0x3794ba+'/'+_0x20d233+':\x0a':'',_0x1c74e4=_0xca5c20 instanceof SDKError?_0xca5c20['originalMessage']:_0xca5c20[_0x1553f4(0x16c)];return console[_0x1553f4(0x152)](''+_0x30df9b+_0x1c74e4),0x1;}}if(_0xd7452d[_0x1553f4(0x16a)]>0x1&&_0x5203be&&_0x89df2f[_0x1553f4(0x16a)]>0x0){const _0x282d9a=_0x89df2f['join']('\x0a');writeFileSync(_0x33811d[_0x1553f4(0x169)],_0x282d9a),console[_0x1553f4(0x152)](_0x1553f4(0x167)+_0x33811d[_0x1553f4(0x169)]);}return 0x0;}catch(_0x55f0b1){throw _0x55f0b1;}}[a21_0x3ae19d(0x179)](_0x29b938){const _0x2591f3=a21_0x3ae19d,_0x18837f=_0x29b938[_0x2591f3(0x171)][0x0],_0x417af7=_0x29b938[_0x2591f3(0x17e)][_0x2591f3(0x15b)];if(!_0x18837f&&!_0x417af7)return _0x2591f3(0x156);if(_0x18837f&&_0x417af7)return _0x2591f3(0x157);return undefined;}}
1
+ const a21_0x2fb6b=a21_0x1252;function a21_0x3933(){const _0x5ca5fa=['elapsedTimeMillis','completedSplits','output','\x20splits','execute','Executing\x20query...','length','4UtOPjx','stats','\x20rows\x20','../utils/command-output.js','Error:\x20','Executing\x20query\x20[','state','processedRows','totalSplits','information_schema','message','\x20[Job\x20ID:\x20','args','in\x20','file','originalMessage','22itnegc','608594iokuHL','catalog','...','Catalog:\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','name','setPhase','Statement\x20','verbose','4537550lcRcig','\x20-\x20','2725479PsqBgj','27856WzDNnw','options','data','query','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','1300953XgACMP','setExtra','Run\x20Trino\x20queries\x20(streaming)','741480bpkwLP','description','8iTIWCi','error','485375uLzGmK','validate','setJobId','join'];a21_0x3933=function(){return _0x5ca5fa;};return a21_0x3933();}function a21_0x1252(_0x5dd3d4,_0x54a4d5){const _0x39335b=a21_0x3933();return a21_0x1252=function(_0x125227,_0x259bdd){_0x125227=_0x125227-0xd2;let _0x4f076a=_0x39335b[_0x125227];return _0x4f076a;},a21_0x1252(_0x5dd3d4,_0x54a4d5);}(function(_0x32da85,_0x5ec800){const _0x53b3ce=a21_0x1252,_0x249d2a=_0x32da85();while(!![]){try{const _0x5b9c31=parseInt(_0x53b3ce(0xe0))/0x1*(-parseInt(_0x53b3ce(0xd3))/0x2)+-parseInt(_0x53b3ce(0xe5))/0x3*(-parseInt(_0x53b3ce(0xf7))/0x4)+-parseInt(_0x53b3ce(0xec))/0x5+parseInt(_0x53b3ce(0xe8))/0x6+-parseInt(_0x53b3ce(0xd4))/0x7*(parseInt(_0x53b3ce(0xea))/0x8)+-parseInt(_0x53b3ce(0xdf))/0x9+parseInt(_0x53b3ce(0xdd))/0xa;if(_0x5b9c31===_0x5ec800)break;else _0x249d2a['push'](_0x249d2a['shift']());}catch(_0x363dfa){_0x249d2a['push'](_0x249d2a['shift']());}}}(a21_0x3933,0x3527a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput}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';export class QueryCommand extends BaseCommand{[a21_0x2fb6b(0xd9)]=a21_0x2fb6b(0xe3);[a21_0x2fb6b(0xe9)]=a21_0x2fb6b(0xe7);async[a21_0x2fb6b(0xf4)](_0x5784dd){const _0x21f479=a21_0x2fb6b,{options:_0x4df3f8,args:_0x3c59cc,tdx:_0x558e91}=_0x5784dd,_0x382c98=_0x3c59cc[0x0],_0x53a612=_0x4df3f8[_0x21f479(0x105)];let _0x4f3e25;if(_0x53a612)try{_0x4f3e25=readSqlStatementsFromFile(_0x53a612);}catch(_0x53a798){return console[_0x21f479(0xeb)]('Error:\x20'+_0x53a798[_0x21f479(0x101)]),0x1;}else try{_0x4f3e25=splitSqlStatements(_0x382c98);}catch(_0x420cff){return console[_0x21f479(0xeb)](_0x21f479(0xfb)+_0x420cff[_0x21f479(0x101)]),0x1;}const _0x3c078e=_0x4df3f8['database']||_0x21f479(0x100),_0x3281d7=_0x4df3f8[_0x21f479(0xd5)];try{const _0x191f75=[],_0x54ecce=!!_0x4df3f8[_0x21f479(0xf2)];for(let _0x4bc93e=0x0;_0x4bc93e<_0x4f3e25[_0x21f479(0xf6)];_0x4bc93e++){const _0x44bab3=_0x4f3e25[_0x4bc93e],_0x5a10f0=_0x4bc93e+0x1,_0x2642fc=_0x4f3e25[_0x21f479(0xf6)],_0x101ce8=_0x2642fc>0x1;_0x4df3f8['verbose']&&(console[_0x21f479(0xeb)]('\x0a'+(_0x101ce8?_0x21f479(0xdb)+_0x5a10f0+'/'+_0x2642fc+':':'')),console[_0x21f479(0xeb)]('Site:\x20'+_0x4df3f8['site']),console['error'](_0x21f479(0xd7)+(_0x3281d7||'td')),console[_0x21f479(0xeb)]('Schema:\x20'+_0x3c078e),console['error']('SQL:\x20'+_0x44bab3));const _0x1bb932=_0x101ce8?'Executing\x20statement\x20'+_0x5a10f0+'/'+_0x2642fc+_0x21f479(0xd6):_0x21f479(0xf5);try{const _0x3dd4cf=await withQuerySpinner(_0x1bb932,async _0x173b25=>{const _0x47b6b3=_0x21f479,_0xf76101=await _0x558e91[_0x47b6b3(0xe3)](_0x44bab3,{'catalog':_0x3281d7,'schema':_0x3c078e,'onJobId':_0x5aec23=>{const _0x4eab1e=_0x47b6b3;_0x173b25[_0x4eab1e(0xee)](_0x5aec23);},'onProgress':_0x31445a=>{const _0x240a1d=_0x47b6b3;_0x173b25[_0x240a1d(0xda)](_0x240a1d(0xfc)+_0x31445a[_0x240a1d(0xfd)]+']'),_0x173b25[_0x240a1d(0xe6)](formatRows(_0x31445a['processedRows'])+_0x240a1d(0xf9)+_0x31445a[_0x240a1d(0xf1)]+'/'+_0x31445a[_0x240a1d(0xff)]+_0x240a1d(0xf3));}});return _0xf76101;},{'verbose':_0x4df3f8[_0x21f479(0xdc)]}),_0x2b8f28=_0x3dd4cf[_0x21f479(0xe2)],_0x1a42e2=_0x2b8f28['jobId']?_0x21f479(0x102)+_0x2b8f28['jobId']+']':'',_0x1d6d18=_0x101ce8?_0x21f479(0xdb)+_0x5a10f0+'/'+_0x2642fc+_0x21f479(0xde):'';console[_0x21f479(0xeb)]('✔\x20'+_0x1d6d18+'Query\x20completed:\x20Processed\x20'+formatRows(_0x2b8f28[_0x21f479(0xf8)][_0x21f479(0xfe)])+_0x21f479(0xf9)+(_0x21f479(0x104)+formatElapsed(_0x2b8f28[_0x21f479(0xf8)][_0x21f479(0xf0)])+_0x1a42e2));if(_0x101ce8&&_0x54ecce){const {formatQueryOutput:_0x28ad07,resolveOutputOptions:_0x5deb13}=await import(_0x21f479(0xfa)),_0x57ee0d=_0x5deb13(_0x4df3f8),_0xb4fc32=await _0x28ad07(_0x2b8f28,_0x57ee0d);_0x191f75['push'](_0xb4fc32);}else await handleQueryOutput(_0x2b8f28,_0x4df3f8);}catch(_0x28a531){const _0x3b55a7=_0x101ce8?'Statement\x20'+_0x5a10f0+'/'+_0x2642fc+':\x0a':'',_0x19e3cf=_0x28a531 instanceof SDKError?_0x28a531[_0x21f479(0xd2)]:_0x28a531['message'];return console[_0x21f479(0xeb)](''+_0x3b55a7+_0x19e3cf),0x1;}}if(_0x4f3e25[_0x21f479(0xf6)]>0x1&&_0x54ecce&&_0x191f75[_0x21f479(0xf6)]>0x0){const _0x12b324=_0x191f75[_0x21f479(0xef)]('\x0a');writeFileSync(_0x4df3f8['output'],_0x12b324),console['error']('\x0aAll\x20results\x20saved\x20to\x20'+_0x4df3f8[_0x21f479(0xf2)]);}return 0x0;}catch(_0x144df1){throw _0x144df1;}}[a21_0x2fb6b(0xed)](_0x2fccb4){const _0x53475d=a21_0x2fb6b,_0x23e1e8=_0x2fccb4[_0x53475d(0x103)][0x0],_0x4eb242=_0x2fccb4[_0x53475d(0xe1)][_0x53475d(0x105)];if(!_0x23e1e8&&!_0x4eb242)return _0x53475d(0xd8);if(_0x23e1e8&&_0x4eb242)return _0x53475d(0xe4);return undefined;}}
@@ -1 +1 @@
1
- const a22_0x43e269=a22_0x2c81;(function(_0x181fbd,_0x18b3f7){const _0x5179b6=a22_0x2c81,_0x1bb1dc=_0x181fbd();while(!![]){try{const _0x308956=parseInt(_0x5179b6(0x108))/0x1+parseInt(_0x5179b6(0x14d))/0x2+parseInt(_0x5179b6(0x127))/0x3+-parseInt(_0x5179b6(0x152))/0x4*(-parseInt(_0x5179b6(0x128))/0x5)+parseInt(_0x5179b6(0x143))/0x6+-parseInt(_0x5179b6(0x15d))/0x7+-parseInt(_0x5179b6(0x15f))/0x8;if(_0x308956===_0x18b3f7)break;else _0x1bb1dc['push'](_0x1bb1dc['shift']());}catch(_0x33721a){_0x1bb1dc['push'](_0x1bb1dc['shift']());}}}(a22_0x309e,0x2e981));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';function a22_0x2c81(_0x5a87b4,_0x4b684a){const _0x309eee=a22_0x309e();return a22_0x2c81=function(_0x2c81a3,_0x3f805d){_0x2c81a3=_0x2c81a3-0xf5;let _0x3f348f=_0x309eee[_0x2c81a3];return _0x3f348f;},a22_0x2c81(_0x5a87b4,_0x4b684a);}import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x43e269(0x134)]=a22_0x43e269(0x105);['description']=a22_0x43e269(0x149);async[a22_0x43e269(0x14c)](_0xe3f6a1){const _0x2c8874=a22_0x43e269,{options:_0x263427,args:_0x108bfd,tdx:_0x53a6ba}=_0xe3f6a1;if(_0x108bfd[_0x2c8874(0x109)]===0x0)return console[_0x2c8874(0x164)](_0x2c8874(0x142)),console[_0x2c8874(0x164)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x2c8874(0x164)]('Examples:'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x2c8874(0x164)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x32abcc=_0x108bfd[0x0],_0x27ac2b=_0x263427[_0x2c8874(0x121)];let _0x5c38af=_0x32abcc;_0x27ac2b&&!_0x32abcc[_0x2c8874(0xf9)]('/')&&(_0x5c38af=_0x27ac2b+'/'+_0x32abcc,_0x263427[_0x2c8874(0x123)]&&console[_0x2c8874(0x164)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5c38af));const _0x5497ac=await withSpinner(_0x2c8874(0xfd)+_0x5c38af+_0x2c8874(0x10e),()=>_0x53a6ba[_0x2c8874(0x141)][_0x2c8874(0x102)](_0x5c38af),{'verbose':_0x263427['verbose']}),_0x558a21=_0x5497ac[_0x2c8874(0x12c)];_0x263427[_0x2c8874(0x123)]&&(console['error'](_0x2c8874(0x13c)+_0x558a21['type']),console['error'](_0x2c8874(0x15b)+_0x558a21['parentId']),_0x558a21[_0x2c8874(0x14f)]&&console[_0x2c8874(0x164)](_0x2c8874(0xf6)+_0x558a21[_0x2c8874(0x14f)]),_0x558a21[_0x2c8874(0x122)]&&console[_0x2c8874(0x164)](_0x2c8874(0x129)+_0x558a21[_0x2c8874(0x122)]));if(_0x558a21[_0x2c8874(0x157)]===_0x2c8874(0x13d)){const _0x4d450f=await withSpinner(_0x2c8874(0x110),()=>_0x53a6ba[_0x2c8874(0x141)][_0x2c8874(0x119)](_0x558a21[_0x2c8874(0x144)]),{'verbose':_0x263427[_0x2c8874(0x123)]});await handleSDKOutput([_0x4d450f['data']],_0x263427);}else{if(_0x558a21['type']===_0x2c8874(0x114)){if(!_0x558a21[_0x2c8874(0x14f)])throw new SDKError(ErrorCode[_0x2c8874(0x150)],_0x2c8874(0x130));const _0x36cbf1=await withSpinner(_0x2c8874(0x136),()=>_0x53a6ba['segment'][_0x2c8874(0x10f)](_0x558a21[_0x2c8874(0x14f)]),{'verbose':_0x263427[_0x2c8874(0x123)]});await handleSDKOutput([_0x36cbf1[_0x2c8874(0x12c)]],_0x263427);}else{if(_0x558a21[_0x2c8874(0x157)]===_0x2c8874(0x141)){if(!_0x558a21['segmentId'])throw new SDKError(ErrorCode[_0x2c8874(0x150)],_0x2c8874(0x10c));const _0x4fc4f8=await withSpinner(_0x2c8874(0x10d),()=>_0x53a6ba[_0x2c8874(0x141)]['getSegment'](_0x558a21[_0x2c8874(0x144)],_0x558a21['segmentId']),{'verbose':_0x263427[_0x2c8874(0x123)]});await handleSDKOutput([_0x4fc4f8[_0x2c8874(0x12c)]],_0x263427);}}}return 0x0;}catch(_0x3c273b){if(_0x3c273b instanceof SDKError)return console[_0x2c8874(0x164)](_0x2c8874(0xf7)+_0x3c273b['message']),_0x3c273b[_0x2c8874(0x16a)]&&console[_0x2c8874(0x164)](_0x2c8874(0xfb)+_0x3c273b[_0x2c8874(0x16a)]),0x1;throw _0x3c273b;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x43e269(0x134)]=a22_0x43e269(0xf8);['description']=a22_0x43e269(0x117);async[a22_0x43e269(0x14c)](_0x301690){const _0x31db38=a22_0x43e269,{options:_0x41c626,args:_0xd00321,tdx:_0x163a1d}=_0x301690;if(_0xd00321['length']===0x0)return console[_0x31db38(0x164)](_0x31db38(0x13b)),console[_0x31db38(0x164)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x31db38(0x164)]('Examples:'),console[_0x31db38(0x164)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x31db38(0x161)),console[_0x31db38(0x164)](_0x31db38(0x125)),0x1;try{const _0x38fef2=_0xd00321[0x0],_0x11fa3e=_0x41c626[_0x31db38(0x121)];let _0x41e696=_0x38fef2;_0x11fa3e&&!_0x38fef2[_0x31db38(0xf9)]('/')&&(_0x41e696=_0x11fa3e+'/'+_0x38fef2,_0x41c626[_0x31db38(0x123)]&&console[_0x31db38(0x164)](_0x31db38(0x11d)+_0x41e696));const _0x1ecbd1=await withSpinner(_0x31db38(0xfd)+_0x41e696+_0x31db38(0x10e),()=>_0x163a1d[_0x31db38(0x141)][_0x31db38(0x102)](_0x41e696),{'verbose':_0x41c626[_0x31db38(0x123)]}),_0x5f0561=_0x1ecbd1[_0x31db38(0x12c)];_0x41c626['verbose']&&(console[_0x31db38(0x164)](_0x31db38(0x13c)+_0x5f0561[_0x31db38(0x157)]),console['error']('Parent\x20ID:\x20'+_0x5f0561[_0x31db38(0x144)]));if(_0x5f0561[_0x31db38(0x157)]===_0x31db38(0x114))return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console['error'](_0x31db38(0x15a)),0x1;let _0x4e8e4a;if(_0x5f0561['type']==='parent'){const _0x592a5d=await withSpinner(_0x31db38(0x163),()=>_0x163a1d[_0x31db38(0x141)]['getParentSQL'](_0x5f0561[_0x31db38(0x144)]),{'verbose':_0x41c626[_0x31db38(0x123)]});_0x4e8e4a=_0x592a5d[_0x31db38(0x12c)];}else{if(!_0x5f0561[_0x31db38(0x122)])throw new SDKError(ErrorCode[_0x31db38(0x150)],_0x31db38(0x10c));const _0x2f9856=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x163a1d['segment'][_0x31db38(0x169)](_0x5f0561[_0x31db38(0x144)],_0x5f0561[_0x31db38(0x122)]),{'verbose':_0x41c626[_0x31db38(0x123)]});_0x4e8e4a=_0x2f9856[_0x31db38(0x12c)];}const _0x4ddf7e=_0x41c626[_0x31db38(0xfe)],_0x8b4867=/\bLIMIT\s+\d+/i[_0x31db38(0x14b)](_0x4e8e4a);!_0x8b4867&&(_0x4e8e4a=_0x4e8e4a[_0x31db38(0x104)]()[_0x31db38(0x131)](/;+$/,''),_0x4e8e4a=_0x31db38(0x11b)+_0x4e8e4a+_0x31db38(0x106)+_0x4ddf7e);_0x41c626[_0x31db38(0x123)]&&console[_0x31db38(0x164)](_0x31db38(0x118)+_0x4e8e4a);const _0x320709=await withQuerySpinner(_0x31db38(0x140),async _0x11e928=>{const _0x59d7c=await _0x163a1d['query'](_0x4e8e4a,{'catalog':'td','schema':'information_schema','onJobId':_0x54f212=>{const _0x3ddc6f=a22_0x2c81;_0x11e928[_0x3ddc6f(0x162)](_0x54f212);}});return _0x59d7c;},{'verbose':_0x41c626['verbose']}),_0x44fc09=_0x320709[_0x31db38(0x12c)],_0x1d6035=_0x44fc09[_0x31db38(0x154)]?'\x20[Job\x20ID:\x20'+_0x44fc09['jobId']+']':'';return console[_0x31db38(0x164)](_0x31db38(0x10b)+_0x44fc09[_0x31db38(0x13f)][_0x31db38(0x167)][_0x31db38(0x16b)]()+_0x31db38(0x13e)+(_0x31db38(0x135)+formatElapsed(_0x44fc09[_0x31db38(0x13f)][_0x31db38(0x111)])+_0x1d6035)),await handleQueryOutput(_0x44fc09,_0x41c626),0x0;}catch(_0x1b320b){if(_0x1b320b instanceof SDKError)return console[_0x31db38(0x164)](_0x31db38(0x14e)+_0x1b320b[_0x31db38(0xfc)]+']'),console[_0x31db38(0x164)]('\x0a'+_0x1b320b[_0x31db38(0x12f)]),0x1;throw _0x1b320b;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x43e269(0x134)]='segment:folder:list';[a22_0x43e269(0x103)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x5b96e6){const _0x13c805=a22_0x43e269,{options:_0x19fcb8,args:_0x409c17,tdx:_0x1fe7c5}=_0x5b96e6;if(_0x409c17['length']===0x0)return console[_0x13c805(0x164)](_0x13c805(0x11c)),console[_0x13c805(0x164)](_0x13c805(0x155)),0x1;const _0x218d20=_0x409c17[0x0];try{_0x19fcb8['verbose']&&(console[_0x13c805(0x164)](_0x13c805(0x137)+_0x19fcb8[_0x13c805(0x115)]),console[_0x13c805(0x164)]('Parent\x20name:\x20'+_0x218d20));const _0x213587=await withSpinner(_0x13c805(0x11e)+_0x218d20+_0x13c805(0x10e),()=>_0x1fe7c5['segment'][_0x13c805(0x166)](_0x218d20),{'verbose':_0x19fcb8[_0x13c805(0x123)]}),_0x934d68=_0x213587['data'];_0x19fcb8[_0x13c805(0x123)]&&console[_0x13c805(0x164)](_0x13c805(0x112)+_0x934d68);const _0x4a554e=await withSpinner(_0x13c805(0x13a)+_0x218d20+_0x13c805(0x10e),()=>_0x1fe7c5[_0x13c805(0x141)][_0x13c805(0x159)](_0x934d68),{'verbose':_0x19fcb8[_0x13c805(0x123)]}),_0x232c5b=_0x4a554e[_0x13c805(0x12c)];return console['error'](_0x13c805(0x147)+_0x232c5b[_0x13c805(0x109)]+_0x13c805(0x138)+(_0x232c5b[_0x13c805(0x109)]!==0x1?'s':'')),await handleSDKOutput(_0x232c5b,_0x19fcb8),0x0;}catch(_0x1243ce){if(_0x1243ce instanceof SDKError)return console['error']('Error:\x20'+_0x1243ce[_0x13c805(0x12f)]),_0x1243ce[_0x13c805(0x16a)]&&console[_0x13c805(0x164)]('\x20\x20Cause:\x20'+_0x1243ce[_0x13c805(0x16a)]),0x1;throw _0x1243ce;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x43e269(0x134)]=a22_0x43e269(0x12d);[a22_0x43e269(0x103)]=a22_0x43e269(0x14a);async[a22_0x43e269(0x14c)](_0x3b7575){const _0x16e446=a22_0x43e269,{options:_0x4acd3a,args:_0x474c5d,tdx:_0x3ee2a3}=_0x3b7575;if(_0x474c5d[_0x16e446(0x109)]===0x0)return console['error'](_0x16e446(0xfa)),console[_0x16e446(0x164)](_0x16e446(0x12a)),0x1;try{const {parentId:_0x1858b9,childId:_0x13eac7}=parseSegmentRef(_0x474c5d[0x0]);_0x4acd3a[_0x16e446(0x123)]&&(console[_0x16e446(0x164)]('Site:\x20'+_0x4acd3a[_0x16e446(0x115)]),console[_0x16e446(0x164)](_0x16e446(0x11a)+_0x1858b9),_0x13eac7&&console[_0x16e446(0x164)]('Folder\x20name:\x20'+_0x13eac7));if(!_0x13eac7)return console[_0x16e446(0x164)](_0x16e446(0x120)),0x1;const _0x4e68cb=await withSpinner(_0x16e446(0x11e)+_0x1858b9+_0x16e446(0x10e),()=>_0x3ee2a3[_0x16e446(0x141)]['resolveParentId'](_0x1858b9),{'verbose':_0x4acd3a['verbose']}),_0x2076d4=_0x4e68cb[_0x16e446(0x12c)];_0x4acd3a[_0x16e446(0x123)]&&console[_0x16e446(0x164)](_0x16e446(0x112)+_0x2076d4);const _0x310f17=await withSpinner(_0x16e446(0x153)+_0x13eac7+_0x16e446(0x10e),()=>_0x3ee2a3['segment']['resolveFolderId'](_0x2076d4,_0x13eac7),{'verbose':_0x4acd3a[_0x16e446(0x123)]}),_0x7d756e=_0x310f17['data'];_0x4acd3a[_0x16e446(0x123)]&&console[_0x16e446(0x164)](_0x16e446(0x101)+_0x7d756e);const _0x1edd91=await withSpinner(_0x16e446(0x160)+_0x13eac7+_0x16e446(0x10e),()=>_0x3ee2a3[_0x16e446(0x141)][_0x16e446(0x10f)](_0x7d756e),{'verbose':_0x4acd3a[_0x16e446(0x123)]});return await handleSDKOutput([_0x1edd91[_0x16e446(0x12c)]],_0x4acd3a),0x0;}catch(_0x154655){if(_0x154655 instanceof SDKError)return console[_0x16e446(0x164)]('Error:\x20'+_0x154655['message']),_0x154655[_0x16e446(0x16a)]&&console['error'](_0x16e446(0xfb)+_0x154655[_0x16e446(0x16a)]),0x1;throw _0x154655;}}}function a22_0x309e(){const _0x33108a=['\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','203454dEhpcm','15IPZgCi','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','format','data','segment:folder:show','Folder\x20name:\x20','message','Folder\x20ID\x20missing\x20from\x20resolved\x20path','replace','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','log','name','in\x20','Fetching\x20folder\x20details...','Site:\x20','\x20folder','segment:folder:create','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20type:\x20','parent','\x20rows\x20','stats','Executing\x20segment\x20query...','segment','Error:\x20Path\x20or\x20name\x20is\x20required','2141544gtjVpQ','parentId','parentFolder','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','✔\x20Found\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Show\x20segment\x20or\x20folder\x20details','Show\x20segment\x20folder\x20details','test','execute','410650TdhcXN','✖\x20Query\x20failed\x20[','folderId','INTERNAL','Usage:\x20tdx\x20segment\x20sql\x20<path>','478508mQwaag','Resolving\x20folder\x20\x27','jobId','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Examples:','type','Parent\x20segment:\x20','listFolders','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Parent\x20ID:\x20','json','875056mQpIEP','resolveFolderId','7280136rBdTwn','Fetching\x20folder\x20\x27','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','setJobId','Fetching\x20SQL\x20for\x20parent\x20segment...','error','segment:sql','resolveParentId','processedRows','\x27\x20with\x20ID:\x20','getSegmentSQL','cause','toLocaleString','Resolving\x20parent\x20folder\x20\x27','Folder\x20ID:\x20','Error:\x20','segment:show','includes','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20Cause:\x20','code','Resolving\x20path\x20\x27','limit','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','getParentSQL','Resolved\x20folder\x20ID:\x20','resolvePathToResource','description','trim','segment:describe','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','236926rykrAP','length','jsonl','✔\x20Query\x20completed:\x20Processed\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','\x27...','getFolder','Fetching\x20parent\x20segment\x20details...','elapsedTimeMillis','Resolved\x20parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','folder','site','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','SQL\x20query:\x0a','getParent','Parent\x20name:\x20','SELECT\x20*\x20FROM\x20(\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20parent\x20segment\x20\x27','Creating\x20folder\x20\x27','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segmentPath','segmentId','verbose','Fetching\x20SQL\x20for\x20segment...'];a22_0x309e=function(){return _0x33108a;};return a22_0x309e();}export class SegmentSQLCommand extends BaseCommand{['name']=a22_0x43e269(0x165);[a22_0x43e269(0x103)]=a22_0x43e269(0x116);async[a22_0x43e269(0x14c)](_0x1fa8e6){const _0x56ef9f=a22_0x43e269,{options:_0x530963,args:_0x2f970b,tdx:_0xf567ca}=_0x1fa8e6;if(_0x2f970b[_0x56ef9f(0x109)]===0x0)return console['error'](_0x56ef9f(0x13b)),console[_0x56ef9f(0x164)](_0x56ef9f(0x151)),console[_0x56ef9f(0x164)](_0x56ef9f(0x156)),console['error'](_0x56ef9f(0xff)),console[_0x56ef9f(0x164)](_0x56ef9f(0x126)),console[_0x56ef9f(0x164)](_0x56ef9f(0x146)),0x1;try{const _0x166a2d=_0x2f970b[0x0],_0x3bcb05=_0x530963[_0x56ef9f(0x121)];let _0x71ed64=_0x166a2d;_0x3bcb05&&!_0x166a2d[_0x56ef9f(0xf9)]('/')&&(_0x71ed64=_0x3bcb05+'/'+_0x166a2d,_0x530963[_0x56ef9f(0x123)]&&console[_0x56ef9f(0x164)](_0x56ef9f(0x11d)+_0x71ed64));const _0x385119=await withSpinner(_0x56ef9f(0xfd)+_0x71ed64+'\x27...',()=>_0xf567ca[_0x56ef9f(0x141)][_0x56ef9f(0x102)](_0x71ed64),{'verbose':_0x530963['verbose']}),_0x735123=_0x385119['data'];_0x530963[_0x56ef9f(0x123)]&&(console[_0x56ef9f(0x164)]('Resolved\x20type:\x20'+_0x735123[_0x56ef9f(0x157)]),console[_0x56ef9f(0x164)](_0x56ef9f(0x15b)+_0x735123[_0x56ef9f(0x144)]));if(_0x735123[_0x56ef9f(0x157)]===_0x56ef9f(0x114))return console[_0x56ef9f(0x164)](_0x56ef9f(0x132)),console[_0x56ef9f(0x164)](_0x56ef9f(0x107)),0x1;let _0x18b505;if(_0x735123[_0x56ef9f(0x157)]==='parent'){const _0x106022=await withSpinner(_0x56ef9f(0x163),()=>_0xf567ca[_0x56ef9f(0x141)][_0x56ef9f(0x100)](_0x735123[_0x56ef9f(0x144)]),{'verbose':_0x530963[_0x56ef9f(0x123)]});_0x18b505=_0x106022[_0x56ef9f(0x12c)];}else{if(!_0x735123[_0x56ef9f(0x122)])throw new SDKError(ErrorCode[_0x56ef9f(0x150)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2816f8=await withSpinner(_0x56ef9f(0x124),()=>_0xf567ca[_0x56ef9f(0x141)][_0x56ef9f(0x169)](_0x735123[_0x56ef9f(0x144)],_0x735123[_0x56ef9f(0x122)]),{'verbose':_0x530963[_0x56ef9f(0x123)]});_0x18b505=_0x2816f8['data'];}return _0x530963[_0x56ef9f(0x12b)]===_0x56ef9f(0x15c)||_0x530963['format']===_0x56ef9f(0x10a)?await handleSDKOutput([{'sql':_0x18b505}],_0x530963):console[_0x56ef9f(0x133)](_0x18b505),0x0;}catch(_0x5e74bf){if(_0x5e74bf instanceof SDKError)return console['error'](_0x56ef9f(0xf7)+_0x5e74bf['message']),_0x5e74bf['cause']&&console[_0x56ef9f(0x164)](_0x56ef9f(0xfb)+_0x5e74bf[_0x56ef9f(0x16a)]),0x1;throw _0x5e74bf;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x43e269(0x134)]=a22_0x43e269(0x139);['description']='Create\x20segment\x20folder\x20for\x20organization';async[a22_0x43e269(0x14c)](_0x2f29a){const _0x3f09cd=a22_0x43e269,{options:_0x47d47b,args:_0x5abf6f,tdx:_0x4b0a18}=_0x2f29a,_0x3aa974=_0x47d47b;if(_0x5abf6f[_0x3f09cd(0x109)]<0x2)return console['error'](_0x3f09cd(0x148)),console[_0x3f09cd(0x164)](_0x3f09cd(0x113)),0x1;const _0x52273a=_0x5abf6f[0x0],_0x462bbd=_0x5abf6f[0x1];_0x3aa974[_0x3f09cd(0x123)]&&(console['error'](_0x3f09cd(0x137)+_0x3aa974['site']),console[_0x3f09cd(0x164)](_0x3f09cd(0x158)+_0x52273a),console[_0x3f09cd(0x164)](_0x3f09cd(0x12e)+_0x462bbd));let _0x410320;if(_0x3aa974[_0x3f09cd(0x145)]){const _0x538609=_0x3aa974[_0x3f09cd(0x145)],_0x202ff3=await withSpinner(_0x3f09cd(0x11e)+_0x52273a+_0x3f09cd(0x10e),()=>_0x4b0a18[_0x3f09cd(0x141)][_0x3f09cd(0x166)](_0x52273a),{'verbose':_0x3aa974[_0x3f09cd(0x123)]}),_0x5abd43=_0x202ff3[_0x3f09cd(0x12c)],_0x475819=await withSpinner(_0x3f09cd(0xf5)+_0x538609+_0x3f09cd(0x10e),()=>_0x4b0a18[_0x3f09cd(0x141)][_0x3f09cd(0x15e)](_0x5abd43,_0x538609),{'verbose':_0x3aa974[_0x3f09cd(0x123)]});_0x410320=_0x475819[_0x3f09cd(0x12c)],_0x3aa974[_0x3f09cd(0x123)]&&console[_0x3f09cd(0x164)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x410320);}const _0x414dc7={'name':_0x462bbd,'description':_0x3aa974['description'],'parentFolderId':_0x410320},_0x12dd4b=await withSpinner(_0x3f09cd(0x11f)+_0x462bbd+_0x3f09cd(0x10e),()=>_0x4b0a18['segment']['createFolder'](_0x52273a,_0x414dc7),{'verbose':_0x3aa974[_0x3f09cd(0x123)]}),_0x13d5f0=_0x12dd4b['data'];return console[_0x3f09cd(0x164)]('✔\x20Created\x20folder\x20\x27'+_0x13d5f0[_0x3f09cd(0x134)]+_0x3f09cd(0x168)+_0x13d5f0['id']),await handleSDKOutput([_0x13d5f0],_0x3aa974),0x0;}}
1
+ const a22_0x6aa9a0=a22_0x3b02;(function(_0x536975,_0x3669ab){const _0x3654f2=a22_0x3b02,_0x76324d=_0x536975();while(!![]){try{const _0x324ffa=parseInt(_0x3654f2(0x18c))/0x1+-parseInt(_0x3654f2(0x164))/0x2+parseInt(_0x3654f2(0x187))/0x3*(parseInt(_0x3654f2(0x141))/0x4)+parseInt(_0x3654f2(0x16f))/0x5+-parseInt(_0x3654f2(0x14e))/0x6*(-parseInt(_0x3654f2(0x179))/0x7)+parseInt(_0x3654f2(0x14c))/0x8+parseInt(_0x3654f2(0x13a))/0x9*(-parseInt(_0x3654f2(0x17d))/0xa);if(_0x324ffa===_0x3669ab)break;else _0x76324d['push'](_0x76324d['shift']());}catch(_0x40de57){_0x76324d['push'](_0x76324d['shift']());}}}(a22_0x3554,0xd5145));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';function a22_0x3554(){const _0x56f382=['message','folder','Fetching\x20folder\x20\x27','getSegmentSQL','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Fetching\x20folder\x20details...','INTERNAL','query','toLocaleString','261GztdPi','description','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','length','folderId','segmentId','name','4lVZRpb','Resolved\x20parent\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','in\x20','segment','Creating\x20folder\x20\x27','Parent\x20name:\x20','stats','parent','site','includes','9280000lZxrLS','Fetching\x20SQL\x20for\x20segment...','1230GghRYf','limit','cause','format','Usage:\x20tdx\x20segment\x20describe\x20<path>','code','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Resolving\x20path\x20\x27','createFolder','segment:describe','jobId','error','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Examples:','setJobId','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','execute','Fetching\x20segment\x20details...','parentId','1384396NjIffa','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','parentFolder','Executing\x20segment\x20query...','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','getParentSQL','\x27\x20with\x20ID:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','resolveParentId','Error:\x20Path\x20or\x20name\x20is\x20required','getFolder','5145555VcXTKg','Parent\x20segment:\x20','\x20folder','Create\x20segment\x20folder\x20for\x20organization','type','Usage:\x20tdx\x20segment\x20show\x20<path>','processedRows','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','✖\x20Query\x20failed\x20[','Resolved\x20relative\x20path\x20to:\x20','7406dzstvq','segment:folder:list','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x27...','1034560MPQgWE','segment:show','getSegment','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','segment:sql','Folder\x20name:\x20','Resolved\x20folder\x20ID:\x20','\x20[Job\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','Segment\x20ID:\x20','2720871wnkSzH','\x20rows\x20','information_schema','resolvePathToResource','SQL\x20query:\x0a','1252237sudulw','Error:\x20Folder\x20reference\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','verbose','Error:\x20','segmentPath','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','resolveFolderId','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Site:\x20','Show\x20segment\x20folder\x20details','data','\x20\x20Cause:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','✔\x20Query\x20completed:\x20Processed\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'];a22_0x3554=function(){return _0x56f382;};return a22_0x3554();}import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{['name']=a22_0x6aa9a0(0x157);[a22_0x6aa9a0(0x13b)]='Show\x20segment\x20or\x20folder\x20details';async[a22_0x6aa9a0(0x161)](_0x3efd96){const _0x546715=a22_0x6aa9a0,{options:_0x25a5ab,args:_0x28554f,tdx:_0x4a26e7}=_0x3efd96;if(_0x28554f[_0x546715(0x13d)]===0x0)return console['error'](_0x546715(0x16d)),console['error'](_0x546715(0x152)),console[_0x546715(0x159)](_0x546715(0x15e)),console[_0x546715(0x159)](_0x546715(0x15d)),console[_0x546715(0x159)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error'](_0x546715(0x195)),0x1;try{const _0x34bf27=_0x28554f[0x0],_0x3f80a9=_0x25a5ab[_0x546715(0x191)];let _0x582eff=_0x34bf27;_0x3f80a9&&!_0x34bf27[_0x546715(0x14b)]('/')&&(_0x582eff=_0x3f80a9+'/'+_0x34bf27,_0x25a5ab[_0x546715(0x18f)]&&console[_0x546715(0x159)](_0x546715(0x178)+_0x582eff));const _0x418dd7=await withSpinner(_0x546715(0x155)+_0x582eff+_0x546715(0x17c),()=>_0x4a26e7[_0x546715(0x145)][_0x546715(0x18a)](_0x582eff),{'verbose':_0x25a5ab['verbose']}),_0x14e66e=_0x418dd7[_0x546715(0x19a)];_0x25a5ab[_0x546715(0x18f)]&&(console['error'](_0x546715(0x15c)+_0x14e66e[_0x546715(0x173)]),console[_0x546715(0x159)](_0x546715(0x19f)+_0x14e66e[_0x546715(0x163)]),_0x14e66e[_0x546715(0x13e)]&&console[_0x546715(0x159)]('Folder\x20ID:\x20'+_0x14e66e['folderId']),_0x14e66e[_0x546715(0x13f)]&&console[_0x546715(0x159)](_0x546715(0x186)+_0x14e66e[_0x546715(0x13f)]));if(_0x14e66e[_0x546715(0x173)]===_0x546715(0x149)){const _0x4823ee=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x4a26e7[_0x546715(0x145)]['getParent'](_0x14e66e[_0x546715(0x163)]),{'verbose':_0x25a5ab[_0x546715(0x18f)]});await handleSDKOutput([_0x4823ee['data']],_0x25a5ab);}else{if(_0x14e66e['type']===_0x546715(0x132)){if(!_0x14e66e[_0x546715(0x13e)])throw new SDKError(ErrorCode[_0x546715(0x137)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x824cf9=await withSpinner(_0x546715(0x136),()=>_0x4a26e7['segment']['getFolder'](_0x14e66e[_0x546715(0x13e)]),{'verbose':_0x25a5ab[_0x546715(0x18f)]});await handleSDKOutput([_0x824cf9[_0x546715(0x19a)]],_0x25a5ab);}else{if(_0x14e66e['type']===_0x546715(0x145)){if(!_0x14e66e['segmentId'])throw new SDKError(ErrorCode[_0x546715(0x137)],_0x546715(0x19c));const _0x55e291=await withSpinner(_0x546715(0x162),()=>_0x4a26e7[_0x546715(0x145)][_0x546715(0x17f)](_0x14e66e[_0x546715(0x163)],_0x14e66e[_0x546715(0x13f)]),{'verbose':_0x25a5ab[_0x546715(0x18f)]});await handleSDKOutput([_0x55e291['data']],_0x25a5ab);}}}return 0x0;}catch(_0x58902d){if(_0x58902d instanceof SDKError)return console[_0x546715(0x159)](_0x546715(0x190)+_0x58902d[_0x546715(0x1a1)]),_0x58902d[_0x546715(0x150)]&&console[_0x546715(0x159)]('\x20\x20Cause:\x20'+_0x58902d[_0x546715(0x150)]),0x1;throw _0x58902d;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x6aa9a0(0x140)]=a22_0x6aa9a0(0x17e);[a22_0x6aa9a0(0x13b)]=a22_0x6aa9a0(0x160);async[a22_0x6aa9a0(0x161)](_0x8887f8){const _0x1ab5b2=a22_0x6aa9a0,{options:_0x4de180,args:_0x30df0b,tdx:_0x1285ef}=_0x8887f8;if(_0x30df0b[_0x1ab5b2(0x13d)]===0x0)return console['error'](_0x1ab5b2(0x17b)),console[_0x1ab5b2(0x159)](_0x1ab5b2(0x174)),console[_0x1ab5b2(0x159)](_0x1ab5b2(0x15e)),console['error'](_0x1ab5b2(0x135)),console[_0x1ab5b2(0x159)](_0x1ab5b2(0x1a0)),console[_0x1ab5b2(0x159)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x21fb9b=_0x30df0b[0x0],_0xf06781=_0x4de180[_0x1ab5b2(0x191)];let _0x4e0def=_0x21fb9b;_0xf06781&&!_0x21fb9b[_0x1ab5b2(0x14b)]('/')&&(_0x4e0def=_0xf06781+'/'+_0x21fb9b,_0x4de180[_0x1ab5b2(0x18f)]&&console[_0x1ab5b2(0x159)](_0x1ab5b2(0x178)+_0x4e0def));const _0x15dc8a=await withSpinner('Resolving\x20path\x20\x27'+_0x4e0def+'\x27...',()=>_0x1285ef[_0x1ab5b2(0x145)][_0x1ab5b2(0x18a)](_0x4e0def),{'verbose':_0x4de180['verbose']}),_0x4e620b=_0x15dc8a['data'];_0x4de180[_0x1ab5b2(0x18f)]&&(console['error'](_0x1ab5b2(0x15c)+_0x4e620b['type']),console[_0x1ab5b2(0x159)](_0x1ab5b2(0x19f)+_0x4e620b['parentId']));if(_0x4e620b[_0x1ab5b2(0x173)]==='folder')return console[_0x1ab5b2(0x159)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console['error'](_0x1ab5b2(0x154)),0x1;let _0x1b38c3;if(_0x4e620b[_0x1ab5b2(0x173)]===_0x1ab5b2(0x149)){const _0x5adf4f=await withSpinner(_0x1ab5b2(0x16b),()=>_0x1285ef[_0x1ab5b2(0x145)][_0x1ab5b2(0x169)](_0x4e620b[_0x1ab5b2(0x163)]),{'verbose':_0x4de180[_0x1ab5b2(0x18f)]});_0x1b38c3=_0x5adf4f[_0x1ab5b2(0x19a)];}else{if(!_0x4e620b[_0x1ab5b2(0x13f)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2e708f=await withSpinner(_0x1ab5b2(0x14d),()=>_0x1285ef['segment'][_0x1ab5b2(0x134)](_0x4e620b[_0x1ab5b2(0x163)],_0x4e620b[_0x1ab5b2(0x13f)]),{'verbose':_0x4de180['verbose']});_0x1b38c3=_0x2e708f['data'];}const _0x2724b6=_0x4de180[_0x1ab5b2(0x14f)],_0xbea732=/\bLIMIT\s+\d+/i['test'](_0x1b38c3);!_0xbea732&&(_0x1b38c3=_0x1b38c3['trim']()['replace'](/;+$/,''),_0x1b38c3=_0x1ab5b2(0x185)+_0x1b38c3+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x2724b6);_0x4de180['verbose']&&console[_0x1ab5b2(0x159)](_0x1ab5b2(0x18b)+_0x1b38c3);const _0x34ea77=await withQuerySpinner(_0x1ab5b2(0x167),async _0x1f0db9=>{const _0x2c3104=_0x1ab5b2,_0x4ebfca=await _0x1285ef[_0x2c3104(0x138)](_0x1b38c3,{'catalog':'td','schema':_0x2c3104(0x189),'onJobId':_0x51a2d8=>{const _0x2bc4c6=_0x2c3104;_0x1f0db9[_0x2bc4c6(0x15f)](_0x51a2d8);}});return _0x4ebfca;},{'verbose':_0x4de180[_0x1ab5b2(0x18f)]}),_0xaef9d7=_0x34ea77[_0x1ab5b2(0x19a)],_0x42fef9=_0xaef9d7['jobId']?_0x1ab5b2(0x184)+_0xaef9d7[_0x1ab5b2(0x158)]+']':'';return console[_0x1ab5b2(0x159)](_0x1ab5b2(0x19d)+_0xaef9d7[_0x1ab5b2(0x148)][_0x1ab5b2(0x175)][_0x1ab5b2(0x139)]()+_0x1ab5b2(0x188)+(_0x1ab5b2(0x144)+formatElapsed(_0xaef9d7[_0x1ab5b2(0x148)]['elapsedTimeMillis'])+_0x42fef9)),await handleQueryOutput(_0xaef9d7,_0x4de180),0x0;}catch(_0x580257){if(_0x580257 instanceof SDKError)return console[_0x1ab5b2(0x159)](_0x1ab5b2(0x177)+_0x580257[_0x1ab5b2(0x153)]+']'),console['error']('\x0a'+_0x580257[_0x1ab5b2(0x1a1)]),0x1;throw _0x580257;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a22_0x6aa9a0(0x17a);[a22_0x6aa9a0(0x13b)]=a22_0x6aa9a0(0x165);async[a22_0x6aa9a0(0x161)](_0x32b433){const _0x443c18=a22_0x6aa9a0,{options:_0x3868e5,args:_0x57962c,tdx:_0x1c438f}=_0x32b433;if(_0x57962c[_0x443c18(0x13d)]===0x0)return console[_0x443c18(0x159)](_0x443c18(0x19e)),console[_0x443c18(0x159)](_0x443c18(0x15b)),0x1;const _0x34b24e=_0x57962c[0x0];try{_0x3868e5[_0x443c18(0x18f)]&&(console['error'](_0x443c18(0x198)+_0x3868e5[_0x443c18(0x14a)]),console[_0x443c18(0x159)](_0x443c18(0x147)+_0x34b24e));const _0x4c6d3c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x34b24e+_0x443c18(0x17c),()=>_0x1c438f[_0x443c18(0x145)][_0x443c18(0x16c)](_0x34b24e),{'verbose':_0x3868e5['verbose']}),_0x59b5cc=_0x4c6d3c[_0x443c18(0x19a)];_0x3868e5[_0x443c18(0x18f)]&&console['error'](_0x443c18(0x142)+_0x59b5cc);const _0x1e1fc8=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x34b24e+'\x27...',()=>_0x1c438f[_0x443c18(0x145)]['listFolders'](_0x59b5cc),{'verbose':_0x3868e5[_0x443c18(0x18f)]}),_0x3700ee=_0x1e1fc8['data'];return console[_0x443c18(0x159)]('✔\x20Found\x20'+_0x3700ee[_0x443c18(0x13d)]+_0x443c18(0x171)+(_0x3700ee[_0x443c18(0x13d)]!==0x1?'s':'')),await handleSDKOutput(_0x3700ee,_0x3868e5),0x0;}catch(_0x29a081){if(_0x29a081 instanceof SDKError)return console[_0x443c18(0x159)](_0x443c18(0x190)+_0x29a081[_0x443c18(0x1a1)]),_0x29a081[_0x443c18(0x150)]&&console[_0x443c18(0x159)](_0x443c18(0x19b)+_0x29a081[_0x443c18(0x150)]),0x1;throw _0x29a081;}}}export class SegmentFolderShowCommand extends BaseCommand{[a22_0x6aa9a0(0x140)]='segment:folder:show';['description']=a22_0x6aa9a0(0x199);async[a22_0x6aa9a0(0x161)](_0x3ddd1d){const _0x32d27d=a22_0x6aa9a0,{options:_0x3409ec,args:_0x2e6ef3,tdx:_0x5215d5}=_0x3ddd1d;if(_0x2e6ef3[_0x32d27d(0x13d)]===0x0)return console[_0x32d27d(0x159)](_0x32d27d(0x18d)),console[_0x32d27d(0x159)](_0x32d27d(0x197)),0x1;try{const {parentId:_0x394bed,childId:_0x2f3af2}=parseSegmentRef(_0x2e6ef3[0x0]);_0x3409ec[_0x32d27d(0x18f)]&&(console[_0x32d27d(0x159)](_0x32d27d(0x198)+_0x3409ec[_0x32d27d(0x14a)]),console['error'](_0x32d27d(0x147)+_0x394bed),_0x2f3af2&&console[_0x32d27d(0x159)](_0x32d27d(0x182)+_0x2f3af2));if(!_0x2f3af2)return console[_0x32d27d(0x159)](_0x32d27d(0x176)),0x1;const _0x3b9823=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x394bed+'\x27...',()=>_0x5215d5[_0x32d27d(0x145)][_0x32d27d(0x16c)](_0x394bed),{'verbose':_0x3409ec[_0x32d27d(0x18f)]}),_0x55123f=_0x3b9823[_0x32d27d(0x19a)];_0x3409ec[_0x32d27d(0x18f)]&&console[_0x32d27d(0x159)](_0x32d27d(0x142)+_0x55123f);const _0x320e8d=await withSpinner(_0x32d27d(0x194)+_0x2f3af2+_0x32d27d(0x17c),()=>_0x5215d5['segment'][_0x32d27d(0x193)](_0x55123f,_0x2f3af2),{'verbose':_0x3409ec[_0x32d27d(0x18f)]}),_0x520c9d=_0x320e8d[_0x32d27d(0x19a)];_0x3409ec[_0x32d27d(0x18f)]&&console[_0x32d27d(0x159)](_0x32d27d(0x183)+_0x520c9d);const _0x2a5f35=await withSpinner(_0x32d27d(0x133)+_0x2f3af2+_0x32d27d(0x17c),()=>_0x5215d5[_0x32d27d(0x145)][_0x32d27d(0x16e)](_0x520c9d),{'verbose':_0x3409ec[_0x32d27d(0x18f)]});return await handleSDKOutput([_0x2a5f35['data']],_0x3409ec),0x0;}catch(_0x22c1ee){if(_0x22c1ee instanceof SDKError)return console[_0x32d27d(0x159)]('Error:\x20'+_0x22c1ee['message']),_0x22c1ee['cause']&&console['error'](_0x32d27d(0x19b)+_0x22c1ee[_0x32d27d(0x150)]),0x1;throw _0x22c1ee;}}}function a22_0x3b02(_0x6324fb,_0x266986){const _0x35546f=a22_0x3554();return a22_0x3b02=function(_0x3b027d,_0x2a9953){_0x3b027d=_0x3b027d-0x132;let _0xb1f282=_0x35546f[_0x3b027d];return _0xb1f282;},a22_0x3b02(_0x6324fb,_0x266986);}export class SegmentSQLCommand extends BaseCommand{[a22_0x6aa9a0(0x140)]=a22_0x6aa9a0(0x181);[a22_0x6aa9a0(0x13b)]=a22_0x6aa9a0(0x180);async[a22_0x6aa9a0(0x161)](_0x2b1818){const _0x4fecc8=a22_0x6aa9a0,{options:_0x45d9a6,args:_0x9e977e,tdx:_0x2dfa98}=_0x2b1818;if(_0x9e977e[_0x4fecc8(0x13d)]===0x0)return console['error'](_0x4fecc8(0x17b)),console[_0x4fecc8(0x159)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x4fecc8(0x159)]('Examples:'),console[_0x4fecc8(0x159)](_0x4fecc8(0x13c)),console['error']('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error'](_0x4fecc8(0x168)),0x1;try{const _0x2ac7c6=_0x9e977e[0x0],_0x5e0878=_0x45d9a6[_0x4fecc8(0x191)];let _0x345913=_0x2ac7c6;_0x5e0878&&!_0x2ac7c6[_0x4fecc8(0x14b)]('/')&&(_0x345913=_0x5e0878+'/'+_0x2ac7c6,_0x45d9a6[_0x4fecc8(0x18f)]&&console[_0x4fecc8(0x159)](_0x4fecc8(0x178)+_0x345913));const _0x41efb3=await withSpinner(_0x4fecc8(0x155)+_0x345913+_0x4fecc8(0x17c),()=>_0x2dfa98[_0x4fecc8(0x145)][_0x4fecc8(0x18a)](_0x345913),{'verbose':_0x45d9a6[_0x4fecc8(0x18f)]}),_0x8a293=_0x41efb3['data'];_0x45d9a6[_0x4fecc8(0x18f)]&&(console[_0x4fecc8(0x159)]('Resolved\x20type:\x20'+_0x8a293['type']),console[_0x4fecc8(0x159)](_0x4fecc8(0x19f)+_0x8a293[_0x4fecc8(0x163)]));if(_0x8a293[_0x4fecc8(0x173)]===_0x4fecc8(0x132))return console[_0x4fecc8(0x159)](_0x4fecc8(0x192)),console[_0x4fecc8(0x159)](_0x4fecc8(0x196)),0x1;let _0x395275;if(_0x8a293[_0x4fecc8(0x173)]===_0x4fecc8(0x149)){const _0x47caa5=await withSpinner(_0x4fecc8(0x16b),()=>_0x2dfa98[_0x4fecc8(0x145)][_0x4fecc8(0x169)](_0x8a293[_0x4fecc8(0x163)]),{'verbose':_0x45d9a6[_0x4fecc8(0x18f)]});_0x395275=_0x47caa5[_0x4fecc8(0x19a)];}else{if(!_0x8a293[_0x4fecc8(0x13f)])throw new SDKError(ErrorCode[_0x4fecc8(0x137)],_0x4fecc8(0x19c));const _0x40cf93=await withSpinner(_0x4fecc8(0x14d),()=>_0x2dfa98[_0x4fecc8(0x145)][_0x4fecc8(0x134)](_0x8a293[_0x4fecc8(0x163)],_0x8a293[_0x4fecc8(0x13f)]),{'verbose':_0x45d9a6['verbose']});_0x395275=_0x40cf93[_0x4fecc8(0x19a)];}return _0x45d9a6[_0x4fecc8(0x151)]==='json'||_0x45d9a6[_0x4fecc8(0x151)]==='jsonl'?await handleSDKOutput([{'sql':_0x395275}],_0x45d9a6):console['log'](_0x395275),0x0;}catch(_0x168178){if(_0x168178 instanceof SDKError)return console[_0x4fecc8(0x159)](_0x4fecc8(0x190)+_0x168178['message']),_0x168178['cause']&&console[_0x4fecc8(0x159)]('\x20\x20Cause:\x20'+_0x168178[_0x4fecc8(0x150)]),0x1;throw _0x168178;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x6aa9a0(0x140)]='segment:folder:create';[a22_0x6aa9a0(0x13b)]=a22_0x6aa9a0(0x172);async['execute'](_0x4fe84a){const _0x1e983e=a22_0x6aa9a0,{options:_0x4de514,args:_0x5ef6dd,tdx:_0x3d488f}=_0x4fe84a,_0xd0590a=_0x4de514;if(_0x5ef6dd[_0x1e983e(0x13d)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1e983e(0x159)](_0x1e983e(0x18e)),0x1;const _0x150b8c=_0x5ef6dd[0x0],_0x44bf63=_0x5ef6dd[0x1];_0xd0590a[_0x1e983e(0x18f)]&&(console[_0x1e983e(0x159)]('Site:\x20'+_0xd0590a['site']),console[_0x1e983e(0x159)](_0x1e983e(0x170)+_0x150b8c),console[_0x1e983e(0x159)](_0x1e983e(0x182)+_0x44bf63));let _0xdd43e;if(_0xd0590a[_0x1e983e(0x166)]){const _0x383b9b=_0xd0590a[_0x1e983e(0x166)],_0x3c4c63=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x150b8c+_0x1e983e(0x17c),()=>_0x3d488f[_0x1e983e(0x145)][_0x1e983e(0x16c)](_0x150b8c),{'verbose':_0xd0590a['verbose']}),_0x4dc232=_0x3c4c63[_0x1e983e(0x19a)],_0x44b3c1=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x383b9b+'\x27...',()=>_0x3d488f['segment'][_0x1e983e(0x193)](_0x4dc232,_0x383b9b),{'verbose':_0xd0590a[_0x1e983e(0x18f)]});_0xdd43e=_0x44b3c1[_0x1e983e(0x19a)],_0xd0590a[_0x1e983e(0x18f)]&&console[_0x1e983e(0x159)](_0x1e983e(0x143)+_0xdd43e);}const _0x4f2318={'name':_0x44bf63,'description':_0xd0590a[_0x1e983e(0x13b)],'parentFolderId':_0xdd43e},_0x1c731c=await withSpinner(_0x1e983e(0x146)+_0x44bf63+_0x1e983e(0x17c),()=>_0x3d488f['segment'][_0x1e983e(0x156)](_0x150b8c,_0x4f2318),{'verbose':_0xd0590a[_0x1e983e(0x18f)]}),_0x9180=_0x1c731c[_0x1e983e(0x19a)];return console[_0x1e983e(0x159)](_0x1e983e(0x15a)+_0x9180[_0x1e983e(0x140)]+_0x1e983e(0x16a)+_0x9180['id']),await handleSDKOutput([_0x9180],_0xd0590a),0x0;}}
@@ -1 +1 @@
1
- const a23_0x56e567=a23_0x51aa;function a23_0x4e44(){const _0x2bfe0f=['2786PtycMq','kind','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Parent:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20folder\x20path\x20\x27','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20parent\x20segment\x20\x27','invisible','Create\x20child\x20segment\x20with\x20filtering\x20rules','Creating\x20segment\x20\x27','description','5oNiYpD','Parent\x20path:\x20','24EVoAUf','rule','6912356iEUCQq','segmentPath','verbose','ruleFile','4167KVVFeh','segment','createSegment','1254yyXWmD','Site:\x20','type','Resolving\x20folder\x20\x27','execute','parent','31560oWoASY','error','name','32050EnYPof','noCountPopulation','folder','\x20\x20\x20Path:\x20','site','folderId','Target\x20path:\x20','Segment\x20name:\x20','197308kTOAmp','84hqKSxb','Examples:','segments','data','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x27...','10359132WrCQSW','Resolved\x20folder\x20ID:\x20','length','13437263mRZuWw','✔\x20Created\x20segment\x20\x27'];a23_0x4e44=function(){return _0x2bfe0f;};return a23_0x4e44();}(function(_0x1f5f0a,_0x27614c){const _0x37fb7a=a23_0x51aa,_0x5e54ae=_0x1f5f0a();while(!![]){try{const _0xba7bac=parseInt(_0x37fb7a(0x190))/0x1*(-parseInt(_0x37fb7a(0x1ad))/0x2)+-parseInt(_0x37fb7a(0x1bc))/0x3*(parseInt(_0x37fb7a(0x1a1))/0x4)+-parseInt(_0x37fb7a(0x1ba))/0x5*(parseInt(_0x37fb7a(0x1a8))/0x6)+parseInt(_0x37fb7a(0x1ab))/0x7+-parseInt(_0x37fb7a(0x196))/0x8+parseInt(_0x37fb7a(0x18d))/0x9*(-parseInt(_0x37fb7a(0x199))/0xa)+parseInt(_0x37fb7a(0x189))/0xb*(parseInt(_0x37fb7a(0x1a2))/0xc);if(_0xba7bac===_0x27614c)break;else _0x5e54ae['push'](_0x5e54ae['shift']());}catch(_0x2482b2){_0x5e54ae['push'](_0x5e54ae['shift']());}}}(a23_0x4e44,0xeb001));import{BaseCommand}from'./command.js';function a23_0x51aa(_0x16ebf7,_0xf1b3ee){const _0x4e441d=a23_0x4e44();return a23_0x51aa=function(_0x51aaa7,_0x5cba34){_0x51aaa7=_0x51aaa7-0x188;let _0xefebfa=_0x4e441d[_0x51aaa7];return _0xefebfa;},a23_0x51aa(_0x16ebf7,_0xf1b3ee);}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{[a23_0x56e567(0x198)]='segment:create';[a23_0x56e567(0x1b9)]=a23_0x56e567(0x1b7);async[a23_0x56e567(0x194)](_0x5a33d5){const _0xb61423=a23_0x56e567,{options:_0x162a5a,args:_0x1e3751,tdx:_0x31dcef}=_0x5a33d5,_0x2cfbb9=_0x162a5a;if(_0x1e3751['length']===0x0)return console[_0xb61423(0x197)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error'](_0xb61423(0x1a3)),console[_0xb61423(0x197)](_0xb61423(0x1af)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0xb61423(0x197)](_0xb61423(0x1b1)),0x1;const _0x4a5ea3=_0x1e3751[0x0],_0x43a180=_0x162a5a[_0xb61423(0x18a)];let _0x2301fe=_0x4a5ea3;_0x43a180&&!_0x4a5ea3['includes']('/')&&(_0x2301fe=_0x43a180+'/'+_0x4a5ea3,_0x2cfbb9[_0xb61423(0x18b)]&&console['error'](_0xb61423(0x1b4)+_0x2301fe));const _0x16e190=parsePath(_0x2301fe);if(_0x16e190['segments'][_0xb61423(0x1aa)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console['error'](_0xb61423(0x1a6)),0x1;const _0x28611f=_0x16e190[_0xb61423(0x1a4)][0x0],_0xb8861d=getBaseName(_0x2301fe),_0x3456f7=getParentPath(_0x2301fe);_0x2cfbb9[_0xb61423(0x18b)]&&(console[_0xb61423(0x197)](_0xb61423(0x191)+_0x2cfbb9[_0xb61423(0x19d)]),console['error'](_0xb61423(0x19f)+_0x2301fe),console[_0xb61423(0x197)](_0xb61423(0x1b0)+_0x28611f),console[_0xb61423(0x197)](_0xb61423(0x1a0)+_0xb8861d),console[_0xb61423(0x197)](_0xb61423(0x1bb)+_0x3456f7));const _0x2fc386=await withSpinner(_0xb61423(0x1b5)+_0x28611f+_0xb61423(0x1a7),()=>_0x31dcef[_0xb61423(0x18e)]['resolveParentId'](_0x28611f),{'verbose':_0x2cfbb9[_0xb61423(0x18b)]}),_0x352d94=_0x2fc386[_0xb61423(0x1a5)];let _0xbf961a;if(_0x16e190[_0xb61423(0x1a4)][_0xb61423(0x1aa)]>0x2){const _0x1caa2a=await withSpinner(_0xb61423(0x1b2)+_0x3456f7+'\x27...',()=>_0x31dcef[_0xb61423(0x18e)][_0xb61423(0x1b3)](_0x3456f7),{'verbose':_0x2cfbb9[_0xb61423(0x18b)]}),_0x13c915=_0x1caa2a[_0xb61423(0x1a5)];if(_0x13c915[_0xb61423(0x192)]!==_0xb61423(0x19b)&&_0x13c915[_0xb61423(0x192)]!==_0xb61423(0x195))return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0xbf961a=_0x13c915[_0xb61423(0x19e)];}else{if(_0x2cfbb9['folder']){const _0x4e8ace=await withSpinner(_0xb61423(0x193)+_0x2cfbb9['folder']+_0xb61423(0x1a7),()=>_0x31dcef[_0xb61423(0x18e)]['resolveFolderId'](_0x352d94,_0x2cfbb9[_0xb61423(0x19b)]),{'verbose':_0x2cfbb9[_0xb61423(0x18b)]});_0xbf961a=_0x4e8ace[_0xb61423(0x1a5)];}}_0x2cfbb9[_0xb61423(0x18b)]&&_0xbf961a&&console[_0xb61423(0x197)](_0xb61423(0x1a9)+_0xbf961a);const _0x26c5ce=await loadJSONFromOptions(_0x2cfbb9[_0xb61423(0x188)],_0x2cfbb9[_0xb61423(0x18c)]),_0x5689fa={'name':_0xb8861d,'description':_0x2cfbb9[_0xb61423(0x1b9)],'rule':_0x26c5ce,'kind':_0x2cfbb9['kind']!==undefined?parseInt(_0x2cfbb9[_0xb61423(0x1ae)],0xa):undefined,'isVisible':_0x2cfbb9[_0xb61423(0x1b6)]?![]:undefined,'segmentFolderId':_0xbf961a,'countPopulation':_0x2cfbb9[_0xb61423(0x19a)]?![]:undefined},_0x756e01=await withSpinner(_0xb61423(0x1b8)+_0xb8861d+'\x27...',()=>_0x31dcef[_0xb61423(0x18e)][_0xb61423(0x18f)](_0x352d94,_0x5689fa),{'verbose':_0x2cfbb9[_0xb61423(0x18b)]}),_0x551d97=_0x756e01[_0xb61423(0x1a5)];return console[_0xb61423(0x197)](_0xb61423(0x1ac)+_0x551d97[_0xb61423(0x198)]+'\x27\x20with\x20ID:\x20'+_0x551d97['id']),_0x2301fe!==_0x4a5ea3&&console[_0xb61423(0x197)](_0xb61423(0x19c)+_0x2301fe),await handleSDKOutput([_0x551d97],_0x2cfbb9),0x0;}}
1
+ function a23_0x2a18(_0x184c67,_0x54b034){const _0x9a2c83=a23_0x9a2c();return a23_0x2a18=function(_0x2a18fd,_0x4a81c6){_0x2a18fd=_0x2a18fd-0x146;let _0x105870=_0x9a2c83[_0x2a18fd];return _0x105870;},a23_0x2a18(_0x184c67,_0x54b034);}const a23_0x5b6c97=a23_0x2a18;(function(_0x1f74f0,_0xe94a1b){const _0x691b96=a23_0x2a18,_0x14f8c4=_0x1f74f0();while(!![]){try{const _0x3494e4=-parseInt(_0x691b96(0x151))/0x1*(-parseInt(_0x691b96(0x16c))/0x2)+-parseInt(_0x691b96(0x175))/0x3+-parseInt(_0x691b96(0x149))/0x4*(parseInt(_0x691b96(0x174))/0x5)+-parseInt(_0x691b96(0x147))/0x6+-parseInt(_0x691b96(0x171))/0x7*(-parseInt(_0x691b96(0x165))/0x8)+-parseInt(_0x691b96(0x16f))/0x9*(parseInt(_0x691b96(0x14c))/0xa)+parseInt(_0x691b96(0x167))/0xb*(parseInt(_0x691b96(0x148))/0xc);if(_0x3494e4===_0xe94a1b)break;else _0x14f8c4['push'](_0x14f8c4['shift']());}catch(_0x24a7b2){_0x14f8c4['push'](_0x14f8c4['shift']());}}}(a23_0x9a2c,0x39850));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a23_0x9a2c(){const _0x3b067c=['name','Resolved\x20relative\x20path\x20to:\x20','kind','424gLkkYT','error','3005244dgGWrH','Resolving\x20folder\x20\x27','verbose','Resolving\x20parent\x20segment\x20\x27','createSegment','2dLzDBR','includes','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','1322019sHDyaV','segmentPath','7483GvWSGK','resolvePathToResource','Parent\x20path:\x20','1752280ErDGyY','750996miKvaq','Site:\x20','segment','\x27...','920562GDJhnf','36XcnoON','4IqWSKR','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','resolveFolderId','10OLFJYz','Creating\x20segment\x20\x27','✔\x20Created\x20segment\x20\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Create\x20child\x20segment\x20with\x20filtering\x20rules','260437eiOmcX','data','parent','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folder','segments','Resolved\x20folder\x20ID:\x20','description','\x27\x20with\x20ID:\x20','ruleFile','length','type','execute','Parent:\x20','noCountPopulation','site','Resolving\x20folder\x20path\x20\x27'];a23_0x9a2c=function(){return _0x3b067c;};return a23_0x9a2c();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x5b6c97(0x162)]='segment:create';[a23_0x5b6c97(0x158)]=a23_0x5b6c97(0x150);async[a23_0x5b6c97(0x15d)](_0x27c989){const _0x2a00e1=a23_0x5b6c97,{options:_0x4eed8e,args:_0x144f61,tdx:_0x31cfcf}=_0x27c989,_0x335060=_0x4eed8e;if(_0x144f61[_0x2a00e1(0x15b)]===0x0)return console[_0x2a00e1(0x166)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x2a00e1(0x166)](_0x2a00e1(0x14a)),console[_0x2a00e1(0x166)]('Examples:'),console[_0x2a00e1(0x166)](_0x2a00e1(0x16e)),console[_0x2a00e1(0x166)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x2a00e1(0x166)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x38a4db=_0x144f61[0x0],_0x297738=_0x4eed8e[_0x2a00e1(0x170)];let _0x32efed=_0x38a4db;_0x297738&&!_0x38a4db[_0x2a00e1(0x16d)]('/')&&(_0x32efed=_0x297738+'/'+_0x38a4db,_0x335060['verbose']&&console[_0x2a00e1(0x166)](_0x2a00e1(0x163)+_0x32efed));const _0x155d93=parsePath(_0x32efed);if(_0x155d93[_0x2a00e1(0x156)][_0x2a00e1(0x15b)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x2a00e1(0x166)](_0x2a00e1(0x154)),0x1;const _0x8f3147=_0x155d93[_0x2a00e1(0x156)][0x0],_0x4b40fd=getBaseName(_0x32efed),_0x3c98fc=getParentPath(_0x32efed);_0x335060['verbose']&&(console['error'](_0x2a00e1(0x176)+_0x335060[_0x2a00e1(0x160)]),console['error']('Target\x20path:\x20'+_0x32efed),console['error'](_0x2a00e1(0x15e)+_0x8f3147),console[_0x2a00e1(0x166)]('Segment\x20name:\x20'+_0x4b40fd),console[_0x2a00e1(0x166)](_0x2a00e1(0x173)+_0x3c98fc));const _0x544d9b=await withSpinner(_0x2a00e1(0x16a)+_0x8f3147+_0x2a00e1(0x146),()=>_0x31cfcf['segment']['resolveParentId'](_0x8f3147),{'verbose':_0x335060[_0x2a00e1(0x169)]}),_0x29261d=_0x544d9b[_0x2a00e1(0x152)];let _0x2800dd;if(_0x155d93[_0x2a00e1(0x156)][_0x2a00e1(0x15b)]>0x2){const _0x39c570=await withSpinner(_0x2a00e1(0x161)+_0x3c98fc+_0x2a00e1(0x146),()=>_0x31cfcf[_0x2a00e1(0x177)][_0x2a00e1(0x172)](_0x3c98fc),{'verbose':_0x335060[_0x2a00e1(0x169)]}),_0x418f9d=_0x39c570[_0x2a00e1(0x152)];if(_0x418f9d[_0x2a00e1(0x15c)]!==_0x2a00e1(0x155)&&_0x418f9d['type']!==_0x2a00e1(0x153))return console['error'](_0x2a00e1(0x14f)),0x1;_0x2800dd=_0x418f9d['folderId'];}else{if(_0x335060[_0x2a00e1(0x155)]){const _0x1c4e93=await withSpinner(_0x2a00e1(0x168)+_0x335060[_0x2a00e1(0x155)]+_0x2a00e1(0x146),()=>_0x31cfcf[_0x2a00e1(0x177)][_0x2a00e1(0x14b)](_0x29261d,_0x335060[_0x2a00e1(0x155)]),{'verbose':_0x335060[_0x2a00e1(0x169)]});_0x2800dd=_0x1c4e93['data'];}}_0x335060[_0x2a00e1(0x169)]&&_0x2800dd&&console['error'](_0x2a00e1(0x157)+_0x2800dd);const _0x1d6197=await loadJSONFromOptions(_0x335060['rule'],_0x335060[_0x2a00e1(0x15a)]),_0x2efe4c={'name':_0x4b40fd,'description':_0x335060[_0x2a00e1(0x158)],'rule':_0x1d6197,'kind':_0x335060[_0x2a00e1(0x164)]!==undefined?parseInt(_0x335060[_0x2a00e1(0x164)],0xa):undefined,'isVisible':_0x335060['invisible']?![]:undefined,'segmentFolderId':_0x2800dd,'countPopulation':_0x335060[_0x2a00e1(0x15f)]?![]:undefined},_0xa41fd1=await withSpinner(_0x2a00e1(0x14d)+_0x4b40fd+_0x2a00e1(0x146),()=>_0x31cfcf[_0x2a00e1(0x177)][_0x2a00e1(0x16b)](_0x29261d,_0x2efe4c),{'verbose':_0x335060[_0x2a00e1(0x169)]}),_0x47332b=_0xa41fd1[_0x2a00e1(0x152)];return console['error'](_0x2a00e1(0x14e)+_0x47332b[_0x2a00e1(0x162)]+_0x2a00e1(0x159)+_0x47332b['id']),_0x32efed!==_0x38a4db&&console[_0x2a00e1(0x166)]('\x20\x20\x20Path:\x20'+_0x32efed),await handleSDKOutput([_0x47332b],_0x335060),0x0;}}
@@ -1 +1 @@
1
- const a24_0x5329d7=a24_0x2560;(function(_0x114485,_0x310943){const _0x1881d1=a24_0x2560,_0x3b5dd6=_0x114485();while(!![]){try{const _0x2dec3f=parseInt(_0x1881d1(0x1e4))/0x1*(parseInt(_0x1881d1(0x1e1))/0x2)+parseInt(_0x1881d1(0x1e8))/0x3*(-parseInt(_0x1881d1(0x1f7))/0x4)+parseInt(_0x1881d1(0x1f3))/0x5+-parseInt(_0x1881d1(0x1eb))/0x6+-parseInt(_0x1881d1(0x1ea))/0x7+parseInt(_0x1881d1(0x1e2))/0x8+parseInt(_0x1881d1(0x1f1))/0x9;if(_0x2dec3f===_0x310943)break;else _0x3b5dd6['push'](_0x3b5dd6['shift']());}catch(_0x2a0c3c){_0x3b5dd6['push'](_0x3b5dd6['shift']());}}}(a24_0x4132,0x6a7fa));function a24_0x4132(){const _0x1fe830=['Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','✔\x20Found\x20','length','476488yWHdvz','verbose','Parent\x20segment:\x20','Site:\x20','32816rsuSwQ','5049392TRRlaK','site','8dQQDzn','execute','error','listFields','15qeaBRb','segment:fields','520275QXoIRW','4457274RwBEUm','List\x20available\x20fields\x20for\x20segmentation','\x27...','segment','name','data','8542125vRsbdl','\x20field','687345kmWuUP'];a24_0x4132=function(){return _0x1fe830;};return a24_0x4132();}import{BaseCommand}from'./command.js';function a24_0x2560(_0x1da7b9,_0x2a59d6){const _0x413246=a24_0x4132();return a24_0x2560=function(_0x2560f0,_0x3ad551){_0x2560f0=_0x2560f0-0x1e0;let _0x412e87=_0x413246[_0x2560f0];return _0x412e87;},a24_0x2560(_0x1da7b9,_0x2a59d6);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x5329d7(0x1ef)]=a24_0x5329d7(0x1e9);['description']=a24_0x5329d7(0x1ec);async[a24_0x5329d7(0x1e5)](_0x411011){const _0x34d5f4=a24_0x5329d7,{options:_0x3be565,args:_0x1bc5e0,tdx:_0x2897bc}=_0x411011;if(_0x1bc5e0[_0x34d5f4(0x1f6)]===0x0)return console[_0x34d5f4(0x1e6)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x34d5f4(0x1e6)](_0x34d5f4(0x1f4)),0x1;const _0x451a1b=_0x1bc5e0[0x0];_0x3be565[_0x34d5f4(0x1f8)]&&(console['error'](_0x34d5f4(0x1e0)+_0x3be565[_0x34d5f4(0x1e3)]),console[_0x34d5f4(0x1e6)](_0x34d5f4(0x1f9)+_0x451a1b));const _0x557274=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x451a1b+_0x34d5f4(0x1ed),()=>_0x2897bc[_0x34d5f4(0x1ee)][_0x34d5f4(0x1e7)](_0x451a1b),{'verbose':_0x3be565['verbose']}),_0x8584=_0x557274[_0x34d5f4(0x1f0)];return console[_0x34d5f4(0x1e6)](_0x34d5f4(0x1f5)+_0x8584['length']+_0x34d5f4(0x1f2)+(_0x8584[_0x34d5f4(0x1f6)]!==0x1?'s':'')),await handleSDKOutput(_0x8584,_0x3be565),0x0;}}
1
+ function a24_0x4cd3(_0x5f508a,_0x1c91bf){const _0x174aab=a24_0x174a();return a24_0x4cd3=function(_0x4cd3f4,_0x182b1a){_0x4cd3f4=_0x4cd3f4-0x95;let _0x3a27fd=_0x174aab[_0x4cd3f4];return _0x3a27fd;},a24_0x4cd3(_0x5f508a,_0x1c91bf);}const a24_0x37f92c=a24_0x4cd3;function a24_0x174a(){const _0x2a1925=['Site:\x20','6wEWIjx','✔\x20Found\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','393833GUizdK','2483852WmZJWX','error','segment:fields','4925970elsGrO','8880504BuYWcs','segment','data','name','20601495dfgLGN','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x27...','length','execute','List\x20available\x20fields\x20for\x20segmentation','1447786bGEKbP','24kHOWqO','description','\x20field','verbose','listFields','site','4566472NGvRFh'];a24_0x174a=function(){return _0x2a1925;};return a24_0x174a();}(function(_0x13e138,_0xb54547){const _0x278799=a24_0x4cd3,_0x51e1db=_0x13e138();while(!![]){try{const _0x356a3c=-parseInt(_0x278799(0x9f))/0x1+parseInt(_0x278799(0xae))/0x2*(parseInt(_0x278799(0x9c))/0x3)+parseInt(_0x278799(0x9a))/0x4+-parseInt(_0x278799(0xa3))/0x5+-parseInt(_0x278799(0xa4))/0x6+-parseInt(_0x278799(0xa0))/0x7*(parseInt(_0x278799(0xaf))/0x8)+parseInt(_0x278799(0xa8))/0x9;if(_0x356a3c===_0xb54547)break;else _0x51e1db['push'](_0x51e1db['shift']());}catch(_0x4ae25d){_0x51e1db['push'](_0x51e1db['shift']());}}}(a24_0x174a,0xe91d8));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x37f92c(0xa7)]=a24_0x37f92c(0xa2);[a24_0x37f92c(0x95)]=a24_0x37f92c(0xad);async[a24_0x37f92c(0xac)](_0x4217d8){const _0x5f3ef5=a24_0x37f92c,{options:_0x5e12cc,args:_0x5644cd,tdx:_0x1ece1f}=_0x4217d8;if(_0x5644cd[_0x5f3ef5(0xab)]===0x0)return console[_0x5f3ef5(0xa1)](_0x5f3ef5(0x9e)),console[_0x5f3ef5(0xa1)](_0x5f3ef5(0xa9)),0x1;const _0x50975c=_0x5644cd[0x0];_0x5e12cc[_0x5f3ef5(0x97)]&&(console[_0x5f3ef5(0xa1)](_0x5f3ef5(0x9b)+_0x5e12cc[_0x5f3ef5(0x99)]),console[_0x5f3ef5(0xa1)]('Parent\x20segment:\x20'+_0x50975c));const _0xd7ad14=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x50975c+_0x5f3ef5(0xaa),()=>_0x1ece1f[_0x5f3ef5(0xa5)][_0x5f3ef5(0x98)](_0x50975c),{'verbose':_0x5e12cc[_0x5f3ef5(0x97)]}),_0x55b2ac=_0xd7ad14[_0x5f3ef5(0xa6)];return console[_0x5f3ef5(0xa1)](_0x5f3ef5(0x9d)+_0x55b2ac[_0x5f3ef5(0xab)]+_0x5f3ef5(0x96)+(_0x55b2ac['length']!==0x1?'s':'')),await handleSDKOutput(_0x55b2ac,_0x5e12cc),0x0;}}
@@ -1 +1 @@
1
- const a25_0x20f662=a25_0x5207;(function(_0x4e9130,_0x27bfd1){const _0x4db32b=a25_0x5207,_0x1aa8f0=_0x4e9130();while(!![]){try{const _0xc7dd91=parseInt(_0x4db32b(0x1d7))/0x1*(-parseInt(_0x4db32b(0x1d3))/0x2)+parseInt(_0x4db32b(0x1c9))/0x3+parseInt(_0x4db32b(0x1cb))/0x4+-parseInt(_0x4db32b(0x1cc))/0x5*(parseInt(_0x4db32b(0x1c8))/0x6)+parseInt(_0x4db32b(0x1dc))/0x7+parseInt(_0x4db32b(0x1ce))/0x8+parseInt(_0x4db32b(0x1d8))/0x9*(-parseInt(_0x4db32b(0x1da))/0xa);if(_0xc7dd91===_0x27bfd1)break;else _0x1aa8f0['push'](_0x1aa8f0['shift']());}catch(_0x2f71bd){_0x1aa8f0['push'](_0x1aa8f0['shift']());}}}(a25_0x9798,0x4b4ae));function a25_0x5207(_0x5399f1,_0x42ca3f){const _0x9798af=a25_0x9798();return a25_0x5207=function(_0x52070f,_0x268f6a){_0x52070f=_0x52070f-0x1c8;let _0x4f7c6c=_0x9798af[_0x52070f];return _0x4f7c6c;},a25_0x5207(_0x5399f1,_0x42ca3f);}import{BaseCommand}from'./command.js';function a25_0x9798(){const _0x4a34a1=['root','3417799NIcsDT','format','json','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','jsonl','730326kRFKDi','1718961tAMMMy','segmentPath','1933028phIvtN','5JktmxR','name','683560NXoygP','segment:pwd','Context\x20details:','log','error','103198xevIOB','description','execute','\x20\x20Path:\x20','3zrMMfW','315WplnBe','stringify','298580EZgBBc'];a25_0x9798=function(){return _0x4a34a1;};return a25_0x9798();}export class SegmentPwdCommand extends BaseCommand{[a25_0x20f662(0x1cd)]=a25_0x20f662(0x1cf);[a25_0x20f662(0x1d4)]='Show\x20current\x20segment/folder\x20context';async[a25_0x20f662(0x1d5)](_0x2760ac){const _0x2115fb=a25_0x20f662,{options:_0x1d6317}=_0x2760ac;try{const _0x3904ad=_0x1d6317[_0x2115fb(0x1ca)];if(!_0x3904ad)return _0x1d6317[_0x2115fb(0x1dd)]===_0x2115fb(0x1de)||_0x1d6317['format']===_0x2115fb(0x1e0)?console[_0x2115fb(0x1d1)](JSON[_0x2115fb(0x1d9)]({'path':'/','type':_0x2115fb(0x1db)})):console[_0x2115fb(0x1d1)]('/'),0x0;if(_0x1d6317[_0x2115fb(0x1dd)]===_0x2115fb(0x1de)||_0x1d6317['format']===_0x2115fb(0x1e0)){const _0x5a10be={'path':_0x3904ad};console[_0x2115fb(0x1d1)](JSON['stringify'](_0x5a10be));}else console[_0x2115fb(0x1d1)](_0x3904ad),_0x1d6317['verbose']&&(console[_0x2115fb(0x1d2)](''),console[_0x2115fb(0x1d2)](_0x2115fb(0x1d0)),console['error'](_0x2115fb(0x1d6)+_0x3904ad),console[_0x2115fb(0x1d2)](''),console[_0x2115fb(0x1d2)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x2115fb(0x1d2)](_0x2115fb(0x1df)));return 0x0;}catch(_0x58714f){throw _0x58714f;}}}
1
+ const a25_0x228263=a25_0x9fa6;function a25_0x9fa6(_0x406f8c,_0x5978fb){const _0x2a9b24=a25_0x2a9b();return a25_0x9fa6=function(_0x9fa6c9,_0x299e79){_0x9fa6c9=_0x9fa6c9-0x87;let _0x142005=_0x2a9b24[_0x9fa6c9];return _0x142005;},a25_0x9fa6(_0x406f8c,_0x5978fb);}function a25_0x2a9b(){const _0x44971d=['2593947AWUMLn','log','error','format','json','1vmeQDK','jsonl','120zYNVmz','1852982oFAGNm','979240OLSobL','Show\x20current\x20segment/folder\x20context','18746541sWCLAU','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','8NkMWWH','Context\x20details:','execute','description','1022316otiHGQ','root','187254PEQyjY','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','\x20\x20Path:\x20','name','6728554UGmCBZ','segment:pwd','stringify','5ydQVGx'];a25_0x2a9b=function(){return _0x44971d;};return a25_0x2a9b();}(function(_0x201501,_0xe03d06){const _0x8ad86c=a25_0x9fa6,_0x37a5e0=_0x201501();while(!![]){try{const _0x4fcf39=parseInt(_0x8ad86c(0x93))/0x1*(parseInt(_0x8ad86c(0x96))/0x2)+-parseInt(_0x8ad86c(0x8e))/0x3+parseInt(_0x8ad86c(0x97))/0x4*(-parseInt(_0x8ad86c(0x8d))/0x5)+parseInt(_0x8ad86c(0x9f))/0x6+parseInt(_0x8ad86c(0x8a))/0x7*(-parseInt(_0x8ad86c(0x9b))/0x8)+-parseInt(_0x8ad86c(0xa1))/0x9*(parseInt(_0x8ad86c(0x95))/0xa)+parseInt(_0x8ad86c(0x99))/0xb;if(_0x4fcf39===_0xe03d06)break;else _0x37a5e0['push'](_0x37a5e0['shift']());}catch(_0x373d44){_0x37a5e0['push'](_0x37a5e0['shift']());}}}(a25_0x2a9b,0x755f3));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a25_0x228263(0x89)]=a25_0x228263(0x8b);[a25_0x228263(0x9e)]=a25_0x228263(0x98);async[a25_0x228263(0x9d)](_0x375f1d){const _0x3d3b02=a25_0x228263,{options:_0x1d2d49}=_0x375f1d;try{const _0x2cd60d=_0x1d2d49['segmentPath'];if(!_0x2cd60d)return _0x1d2d49[_0x3d3b02(0x91)]==='json'||_0x1d2d49[_0x3d3b02(0x91)]===_0x3d3b02(0x94)?console[_0x3d3b02(0x8f)](JSON[_0x3d3b02(0x8c)]({'path':'/','type':_0x3d3b02(0xa0)})):console[_0x3d3b02(0x8f)]('/'),0x0;if(_0x1d2d49[_0x3d3b02(0x91)]===_0x3d3b02(0x92)||_0x1d2d49[_0x3d3b02(0x91)]===_0x3d3b02(0x94)){const _0x69cbf1={'path':_0x2cd60d};console[_0x3d3b02(0x8f)](JSON[_0x3d3b02(0x8c)](_0x69cbf1));}else console[_0x3d3b02(0x8f)](_0x2cd60d),_0x1d2d49['verbose']&&(console['error'](''),console[_0x3d3b02(0x90)](_0x3d3b02(0x9c)),console[_0x3d3b02(0x90)](_0x3d3b02(0x88)+_0x2cd60d),console['error'](''),console['error'](_0x3d3b02(0x9a)),console['error'](_0x3d3b02(0x87)));return 0x0;}catch(_0x367c91){throw _0x367c91;}}}
@@ -1 +1 @@
1
- const a26_0x3cd972=a26_0x55c7;(function(_0x191788,_0x6b95c1){const _0x557f3a=a26_0x55c7,_0xba089b=_0x191788();while(!![]){try{const _0x28c6be=-parseInt(_0x557f3a(0x171))/0x1+-parseInt(_0x557f3a(0x167))/0x2*(-parseInt(_0x557f3a(0x14d))/0x3)+-parseInt(_0x557f3a(0x157))/0x4*(parseInt(_0x557f3a(0x169))/0x5)+parseInt(_0x557f3a(0x158))/0x6+parseInt(_0x557f3a(0x16e))/0x7+parseInt(_0x557f3a(0x16b))/0x8*(parseInt(_0x557f3a(0x168))/0x9)+-parseInt(_0x557f3a(0x174))/0xa;if(_0x28c6be===_0x6b95c1)break;else _0xba089b['push'](_0xba089b['shift']());}catch(_0x27ebb1){_0xba089b['push'](_0xba089b['shift']());}}}(a26_0x1548,0x438d1));import{BaseCommand}from'./command.js';function a26_0x1548(){const _0x64d201=['kind','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','length','updateSegmentById','execute','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','name','Segment\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','data','1059006LduWUJ','63kOxjRF','2360VJhoIr','includes','141080TGDEqD','folder','Update\x20existing\x20child\x20segment','1797999DCeIhJ','✔\x20Updated\x20segment\x20\x27','Error:\x20Cannot\x20update\x20','503129IFOSij','rule','Examples:','365210XpqUau','\x27...','description','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segmentId','Resolved\x20folder\x20ID:\x20','3lDXNIf','Resolved\x20type:\x20','Updating\x20segment\x20\x27','error','parentId','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','segmentName','segment','type','4148ynwkrh','2375988ozbeRN','verbose','INTERNAL','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20\x20Path:\x20'];a26_0x1548=function(){return _0x64d201;};return a26_0x1548();}import{handleSDKOutput}from'../utils/command-output.js';function a26_0x55c7(_0x2467b6,_0x5c3d37){const _0x1548a7=a26_0x1548();return a26_0x55c7=function(_0x55c75f,_0x4f36a3){_0x55c75f=_0x55c75f-0x14d;let _0x5d3ee6=_0x1548a7[_0x55c75f];return _0x5d3ee6;},a26_0x55c7(_0x2467b6,_0x5c3d37);}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{[a26_0x3cd972(0x163)]='segment:update';['description']=a26_0x3cd972(0x16d);async[a26_0x3cd972(0x161)](_0x314c44){const _0x2dd5e7=a26_0x3cd972,{options:_0x30070c,args:_0x1d62ca,tdx:_0x1213ac}=_0x314c44,_0x48d990=_0x30070c;if(_0x1d62ca[_0x2dd5e7(0x15f)]===0x0)return console['error'](_0x2dd5e7(0x177)),console[_0x2dd5e7(0x150)](_0x2dd5e7(0x15b)),console[_0x2dd5e7(0x150)](_0x2dd5e7(0x173)),console[_0x2dd5e7(0x150)](_0x2dd5e7(0x15e)),console[_0x2dd5e7(0x150)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x19e233=_0x1d62ca[0x0],_0x2ef3eb=_0x30070c['segmentPath'];let _0x1ea9e9=_0x19e233;_0x2ef3eb&&!_0x19e233[_0x2dd5e7(0x16a)]('/')&&(_0x1ea9e9=_0x2ef3eb+'/'+_0x19e233,_0x48d990[_0x2dd5e7(0x159)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x1ea9e9));const _0x3d3d80=await withSpinner('Resolving\x20path\x20\x27'+_0x1ea9e9+'\x27...',()=>_0x1213ac['segment']['resolvePathToResource'](_0x1ea9e9),{'verbose':_0x48d990['verbose']}),_0xc820b4=_0x3d3d80['data'];_0x48d990[_0x2dd5e7(0x159)]&&console[_0x2dd5e7(0x150)](_0x2dd5e7(0x14e)+_0xc820b4[_0x2dd5e7(0x156)]);if(_0xc820b4[_0x2dd5e7(0x156)]!==_0x2dd5e7(0x155))return console[_0x2dd5e7(0x150)](_0x2dd5e7(0x170)+_0xc820b4[_0x2dd5e7(0x156)]+_0x2dd5e7(0x162)),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0xc820b4['segmentId'])throw new SDKError(ErrorCode[_0x2dd5e7(0x15a)],_0x2dd5e7(0x165));const _0x54a9bf=_0xc820b4[_0x2dd5e7(0x151)],_0x429a6a=_0xc820b4[_0x2dd5e7(0x178)];_0x48d990[_0x2dd5e7(0x159)]&&(console[_0x2dd5e7(0x150)](_0x2dd5e7(0x153)+_0x54a9bf),console[_0x2dd5e7(0x150)](_0x2dd5e7(0x164)+_0x429a6a));let _0x24b871;if(_0x48d990[_0x2dd5e7(0x16c)]){const _0x4e212c=_0x48d990[_0x2dd5e7(0x16c)],_0x3805e3=await withSpinner(_0x2dd5e7(0x152)+_0x4e212c+_0x2dd5e7(0x175),()=>_0x1213ac[_0x2dd5e7(0x155)]['resolveFolderId'](_0x54a9bf,_0x4e212c),{'verbose':_0x48d990['verbose']});_0x24b871=parseInt(_0x3805e3[_0x2dd5e7(0x166)],0xa),_0x48d990[_0x2dd5e7(0x159)]&&console[_0x2dd5e7(0x150)](_0x2dd5e7(0x179)+_0x24b871);}const _0x36fa5c=await loadJSONFromOptions(_0x48d990[_0x2dd5e7(0x172)],_0x48d990['ruleFile']),_0x1ae0cd={'name':_0x48d990[_0x2dd5e7(0x163)],'description':_0x48d990[_0x2dd5e7(0x176)],'rule':_0x36fa5c,'kind':_0x48d990[_0x2dd5e7(0x15d)]!==undefined?parseInt(_0x48d990[_0x2dd5e7(0x15d)],0xa):undefined,'segmentFolderId':_0x24b871},_0x13e072=await withSpinner(_0x2dd5e7(0x14f)+_0xc820b4[_0x2dd5e7(0x154)]+_0x2dd5e7(0x175),()=>_0x1213ac[_0x2dd5e7(0x155)][_0x2dd5e7(0x160)](_0x54a9bf,_0x429a6a,_0x1ae0cd),{'verbose':_0x48d990[_0x2dd5e7(0x159)]}),_0x5afc32=_0x13e072[_0x2dd5e7(0x166)];return console[_0x2dd5e7(0x150)](_0x2dd5e7(0x16f)+_0x5afc32[_0x2dd5e7(0x163)]+'\x27'),_0x1ea9e9!==_0x19e233&&console[_0x2dd5e7(0x150)](_0x2dd5e7(0x15c)+_0x1ea9e9),await handleSDKOutput([_0x5afc32],_0x48d990),0x0;}}
1
+ function a26_0x3996(_0x518b39,_0x32686e){const _0x4a39ef=a26_0x4a39();return a26_0x3996=function(_0x39962c,_0x45fa00){_0x39962c=_0x39962c-0x17e;let _0x3e1bf5=_0x4a39ef[_0x39962c];return _0x3e1bf5;},a26_0x3996(_0x518b39,_0x32686e);}const a26_0x3102da=a26_0x3996;(function(_0xfb4f3e,_0x2326ca){const _0x3cfbac=a26_0x3996,_0x54dde6=_0xfb4f3e();while(!![]){try{const _0x353ed4=parseInt(_0x3cfbac(0x19c))/0x1*(parseInt(_0x3cfbac(0x1a4))/0x2)+parseInt(_0x3cfbac(0x18e))/0x3*(parseInt(_0x3cfbac(0x198))/0x4)+parseInt(_0x3cfbac(0x197))/0x5+-parseInt(_0x3cfbac(0x18a))/0x6*(parseInt(_0x3cfbac(0x1a9))/0x7)+parseInt(_0x3cfbac(0x19f))/0x8*(-parseInt(_0x3cfbac(0x182))/0x9)+parseInt(_0x3cfbac(0x192))/0xa+-parseInt(_0x3cfbac(0x1a5))/0xb*(parseInt(_0x3cfbac(0x18d))/0xc);if(_0x353ed4===_0x2326ca)break;else _0x54dde6['push'](_0x54dde6['shift']());}catch(_0x16ceb7){_0x54dde6['push'](_0x54dde6['shift']());}}}(a26_0x4a39,0xc15c2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x3102da(0x188)]=a26_0x3102da(0x191);[a26_0x3102da(0x183)]='Update\x20existing\x20child\x20segment';async[a26_0x3102da(0x19b)](_0x6a4808){const _0x4f0ab3=a26_0x3102da,{options:_0x218d70,args:_0x514146,tdx:_0x1a9b73}=_0x6a4808,_0x1e0b4a=_0x218d70;if(_0x514146[_0x4f0ab3(0x1ad)]===0x0)return console[_0x4f0ab3(0x184)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x4f0ab3(0x184)](_0x4f0ab3(0x1a7)),console[_0x4f0ab3(0x184)]('Examples:'),console[_0x4f0ab3(0x184)](_0x4f0ab3(0x19a)),console[_0x4f0ab3(0x184)](_0x4f0ab3(0x19d)),0x1;const _0xed911e=_0x514146[0x0],_0xef7c09=_0x218d70[_0x4f0ab3(0x199)];let _0x1dc514=_0xed911e;_0xef7c09&&!_0xed911e[_0x4f0ab3(0x1aa)]('/')&&(_0x1dc514=_0xef7c09+'/'+_0xed911e,_0x1e0b4a['verbose']&&console[_0x4f0ab3(0x184)](_0x4f0ab3(0x187)+_0x1dc514));const _0x528064=await withSpinner(_0x4f0ab3(0x189)+_0x1dc514+_0x4f0ab3(0x196),()=>_0x1a9b73[_0x4f0ab3(0x185)][_0x4f0ab3(0x1ab)](_0x1dc514),{'verbose':_0x1e0b4a[_0x4f0ab3(0x1ac)]}),_0x5d9f63=_0x528064[_0x4f0ab3(0x18c)];_0x1e0b4a['verbose']&&console[_0x4f0ab3(0x184)]('Resolved\x20type:\x20'+_0x5d9f63['type']);if(_0x5d9f63[_0x4f0ab3(0x1ae)]!==_0x4f0ab3(0x185))return console['error'](_0x4f0ab3(0x18f)+_0x5d9f63[_0x4f0ab3(0x1ae)]+_0x4f0ab3(0x17e)),console[_0x4f0ab3(0x184)](_0x4f0ab3(0x1a2)),0x1;if(!_0x5d9f63[_0x4f0ab3(0x193)])throw new SDKError(ErrorCode['INTERNAL'],_0x4f0ab3(0x186));const _0x49b666=_0x5d9f63[_0x4f0ab3(0x1a1)],_0x40cd41=_0x5d9f63[_0x4f0ab3(0x193)];_0x1e0b4a[_0x4f0ab3(0x1ac)]&&(console['error'](_0x4f0ab3(0x1a0)+_0x49b666),console['error']('Segment\x20ID:\x20'+_0x40cd41));let _0x53d266;if(_0x1e0b4a[_0x4f0ab3(0x190)]){const _0x3b49e9=_0x1e0b4a[_0x4f0ab3(0x190)],_0x18758a=await withSpinner(_0x4f0ab3(0x19e)+_0x3b49e9+'\x27...',()=>_0x1a9b73[_0x4f0ab3(0x185)][_0x4f0ab3(0x1a6)](_0x49b666,_0x3b49e9),{'verbose':_0x1e0b4a[_0x4f0ab3(0x1ac)]});_0x53d266=parseInt(_0x18758a['data'],0xa),_0x1e0b4a[_0x4f0ab3(0x1ac)]&&console[_0x4f0ab3(0x184)](_0x4f0ab3(0x181)+_0x53d266);}const _0x383830=await loadJSONFromOptions(_0x1e0b4a[_0x4f0ab3(0x18b)],_0x1e0b4a[_0x4f0ab3(0x180)]),_0x2a9460={'name':_0x1e0b4a[_0x4f0ab3(0x188)],'description':_0x1e0b4a[_0x4f0ab3(0x183)],'rule':_0x383830,'kind':_0x1e0b4a['kind']!==undefined?parseInt(_0x1e0b4a[_0x4f0ab3(0x1a8)],0xa):undefined,'segmentFolderId':_0x53d266},_0x52d082=await withSpinner(_0x4f0ab3(0x195)+_0x5d9f63[_0x4f0ab3(0x194)]+'\x27...',()=>_0x1a9b73['segment'][_0x4f0ab3(0x1a3)](_0x49b666,_0x40cd41,_0x2a9460),{'verbose':_0x1e0b4a[_0x4f0ab3(0x1ac)]}),_0x217105=_0x52d082['data'];return console[_0x4f0ab3(0x184)]('✔\x20Updated\x20segment\x20\x27'+_0x217105[_0x4f0ab3(0x188)]+'\x27'),_0x1dc514!==_0xed911e&&console[_0x4f0ab3(0x184)](_0x4f0ab3(0x17f)+_0x1dc514),await handleSDKOutput([_0x217105],_0x1e0b4a),0x0;}}function a26_0x4a39(){const _0x4d0eef=['Resolving\x20path\x20\x27','2889294hrxhPT','rule','data','6559068OtvHaF','534pFVPaE','Error:\x20Cannot\x20update\x20','folder','segment:update','2867510WnGqas','segmentId','segmentName','Updating\x20segment\x20\x27','\x27...','652545ZHuoAr','10072VXMhMZ','segmentPath','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','execute','1ubZjBR','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20folder\x20\x27','7256smIxoL','Parent\x20ID:\x20','parentId','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','updateSegmentById','2894218qyiYnK','11hRyKEz','resolveFolderId','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','kind','14WeiNkp','includes','resolvePathToResource','verbose','length','type','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x20\x20\x20Path:\x20','ruleFile','Resolved\x20folder\x20ID:\x20','108JkyLlx','description','error','segment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20relative\x20path\x20to:\x20','name'];a26_0x4a39=function(){return _0x4d0eef;};return a26_0x4a39();}
@@ -1 +1 @@
1
- const a27_0x8348b4=a27_0x4c00;(function(_0x203811,_0x4b286d){const _0x590c4c=a27_0x4c00,_0x1390eb=_0x203811();while(!![]){try{const _0x213332=-parseInt(_0x590c4c(0x8f))/0x1+-parseInt(_0x590c4c(0x97))/0x2+parseInt(_0x590c4c(0x7d))/0x3+-parseInt(_0x590c4c(0x7e))/0x4+-parseInt(_0x590c4c(0x80))/0x5+parseInt(_0x590c4c(0x92))/0x6*(parseInt(_0x590c4c(0x71))/0x7)+parseInt(_0x590c4c(0x75))/0x8;if(_0x213332===_0x4b286d)break;else _0x1390eb['push'](_0x1390eb['shift']());}catch(_0x3e7627){_0x1390eb['push'](_0x1390eb['shift']());}}}(a27_0x20df,0x483ea));function a27_0x20df(){const _0x2cc423=['folderId','64044ZkniAy','1711348DweyWH','segments','56240Ljcwke','split','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','description','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','execute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','length','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parentName','session','folderPath','Use:\x20tdx\x20segment\x20use\x20','segment','498462bfysis','Resolved\x20path\x20type:\x20','log','6eMiGYm','site','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Usage:\x20tdx\x20segment\x20use\x20<path>','fullPath','38466UjTWfK','Examples:','data','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Error:\x20Path\x20is\x20required','join','segmentPath','error','Resolved\x20relative\x20path\x20to:\x20','slice','Context\x20set\x20to:\x20','resolvePathToResource','verbose','isAbsolute','424571avqvuP','Target\x20path:\x20','Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','9365544QSROBq','Parent\x20ID:\x20','\x27...','type','parentId','Resolving\x20path\x20\x27','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'];a27_0x20df=function(){return _0x2cc423;};return a27_0x20df();}function a27_0x4c00(_0x4957da,_0x6a2fc4){const _0x20df7f=a27_0x20df();return a27_0x4c00=function(_0x4c00d8,_0x5b4025){_0x4c00d8=_0x4c00d8-0x68;let _0x2ee101=_0x20df7f[_0x4c00d8];return _0x2ee101;},a27_0x4c00(_0x4957da,_0x6a2fc4);}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{['name']='segment:use';[a27_0x8348b4(0x83)]=a27_0x8348b4(0x86);async[a27_0x8348b4(0x85)](_0x53dab0){const _0x38bf41=a27_0x8348b4,{options:_0x4aabdc,args:_0x46c390,tdx:_0x850414}=_0x53dab0;if(_0x46c390[_0x38bf41(0x88)]===0x0)return console[_0x38bf41(0x6a)](_0x38bf41(0x9c)),console['error'](_0x38bf41(0x95)),console[_0x38bf41(0x6a)](_0x38bf41(0x98)),console['error'](_0x38bf41(0x9a)),console[_0x38bf41(0x6a)](_0x38bf41(0x87)),console[_0x38bf41(0x6a)](_0x38bf41(0x82)),console[_0x38bf41(0x6a)](_0x38bf41(0x74)),0x1;const _0x56caef=_0x46c390[0x0],_0x164f39=_0x4aabdc[_0x38bf41(0x8b)];try{if(_0x56caef==='/')return saveSessionContext({'segment_path':undefined},_0x164f39),console[_0x38bf41(0x91)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x53c32e=_0x4aabdc[_0x38bf41(0x69)];let _0x4e990b=_0x56caef;const _0x521396=parsePath(_0x56caef);if(!_0x521396[_0x38bf41(0x70)]){if(!_0x53c32e)return console[_0x38bf41(0x6a)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console[_0x38bf41(0x6a)](_0x38bf41(0x7b)),0x1;if(_0x56caef==='..'){const _0x25f060=_0x53c32e[_0x38bf41(0x81)]('/')[_0x38bf41(0x6c)](0x0,-0x1)[_0x38bf41(0x68)]('/');_0x4e990b=_0x25f060||'/';}else _0x56caef==='.'?_0x4e990b=_0x53c32e:_0x4e990b=_0x53c32e+'/'+_0x56caef;_0x4aabdc[_0x38bf41(0x6f)]&&console[_0x38bf41(0x6a)](_0x38bf41(0x6b)+_0x4e990b);}if(_0x4e990b==='/'||_0x4e990b==='')return saveSessionContext({'segment_path':undefined},_0x164f39),console[_0x38bf41(0x91)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x4e990b=normalizePath(_0x4e990b);const _0x39952c=parsePath(_0x4e990b)[_0x38bf41(0x7f)];if(_0x39952c[_0x38bf41(0x88)]===0x0)return saveSessionContext({'segment_path':undefined},_0x164f39),console[_0x38bf41(0x91)](_0x38bf41(0x73)),0x0;_0x4aabdc['verbose']&&(console[_0x38bf41(0x6a)]('Site:\x20'+_0x4aabdc[_0x38bf41(0x93)]),console[_0x38bf41(0x6a)](_0x38bf41(0x72)+_0x4e990b));const _0x3f9449=await withSpinner(_0x38bf41(0x7a)+_0x4e990b+_0x38bf41(0x77),()=>_0x850414[_0x38bf41(0x8e)][_0x38bf41(0x6e)](_0x4e990b),{'verbose':_0x4aabdc[_0x38bf41(0x6f)]}),_0x12ce0e=_0x3f9449[_0x38bf41(0x99)];_0x4aabdc['verbose']&&(console[_0x38bf41(0x6a)](_0x38bf41(0x90)+_0x12ce0e[_0x38bf41(0x78)]),console[_0x38bf41(0x6a)](_0x38bf41(0x76)+_0x12ce0e[_0x38bf41(0x79)]),_0x12ce0e['folderId']&&console[_0x38bf41(0x6a)]('Folder\x20ID:\x20'+_0x12ce0e[_0x38bf41(0x7c)]));if(_0x12ce0e[_0x38bf41(0x78)]===_0x38bf41(0x8e))return console['error'](_0x38bf41(0x9b)),console[_0x38bf41(0x6a)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x38bf41(0x6a)](_0x38bf41(0x8d)+_0x12ce0e[_0x38bf41(0x8a)]+(_0x12ce0e[_0x38bf41(0x8c)]?'/'+_0x12ce0e[_0x38bf41(0x8c)][_0x38bf41(0x68)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x12ce0e['fullPath'],'parent_segment':_0x12ce0e[_0x38bf41(0x8a)]},_0x164f39),console[_0x38bf41(0x91)](_0x38bf41(0x6d)+_0x12ce0e[_0x38bf41(0x96)]),_0x4aabdc[_0x38bf41(0x6f)]&&(console['error'](_0x38bf41(0x89)),console[_0x38bf41(0x6a)](_0x38bf41(0x84)),console[_0x38bf41(0x6a)](_0x38bf41(0x94))),0x0;}catch(_0x1ea298){throw _0x1ea298;}}}
1
+ function a27_0x3927(_0x1895ee,_0x16bd68){const _0x5a6cac=a27_0x5a6c();return a27_0x3927=function(_0x392719,_0x4dbe79){_0x392719=_0x392719-0x19e;let _0x359118=_0x5a6cac[_0x392719];return _0x359118;},a27_0x3927(_0x1895ee,_0x16bd68);}const a27_0x4fed3b=a27_0x3927;(function(_0x504700,_0x4d01c3){const _0x2e2a69=a27_0x3927,_0x55ef70=_0x504700();while(!![]){try{const _0x5da315=parseInt(_0x2e2a69(0x1a7))/0x1*(parseInt(_0x2e2a69(0x1c4))/0x2)+-parseInt(_0x2e2a69(0x1bb))/0x3*(-parseInt(_0x2e2a69(0x1c8))/0x4)+-parseInt(_0x2e2a69(0x1cd))/0x5*(parseInt(_0x2e2a69(0x1a0))/0x6)+parseInt(_0x2e2a69(0x1a5))/0x7*(parseInt(_0x2e2a69(0x1bf))/0x8)+parseInt(_0x2e2a69(0x1a4))/0x9*(parseInt(_0x2e2a69(0x1bd))/0xa)+parseInt(_0x2e2a69(0x1b9))/0xb*(-parseInt(_0x2e2a69(0x1c2))/0xc)+-parseInt(_0x2e2a69(0x1ac))/0xd;if(_0x5da315===_0x4d01c3)break;else _0x55ef70['push'](_0x55ef70['shift']());}catch(_0x26cc6e){_0x55ef70['push'](_0x55ef70['shift']());}}}(a27_0x5a6c,0x4bf94));import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{['name']=a27_0x4fed3b(0x1b0);['description']=a27_0x4fed3b(0x1cf);async[a27_0x4fed3b(0x1af)](_0x2c7206){const _0x5e2de5=a27_0x4fed3b,{options:_0x502a11,args:_0xf050ba,tdx:_0x199d3d}=_0x2c7206;if(_0xf050ba[_0x5e2de5(0x1b3)]===0x0)return console['error']('Error:\x20Path\x20is\x20required'),console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1ca)),console[_0x5e2de5(0x1ad)]('Examples:'),console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1bc)),console[_0x5e2de5(0x1ad)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error'](_0x5e2de5(0x1a6)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x1bc056=_0xf050ba[0x0],_0x3a13fd=_0x502a11['session'];try{if(_0x1bc056==='/')return saveSessionContext({'segment_path':undefined},_0x3a13fd),console['log'](_0x5e2de5(0x1c7)),0x0;const _0x47c227=_0x502a11[_0x5e2de5(0x1aa)];let _0x4c785f=_0x1bc056;const _0x4f942c=parsePath(_0x1bc056);if(!_0x4f942c[_0x5e2de5(0x1b4)]){if(!_0x47c227)return console[_0x5e2de5(0x1ad)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1cc)),0x1;if(_0x1bc056==='..'){const _0x26b5c1=_0x47c227[_0x5e2de5(0x1a2)]('/')[_0x5e2de5(0x1b1)](0x0,-0x1)[_0x5e2de5(0x1a3)]('/');_0x4c785f=_0x26b5c1||'/';}else _0x1bc056==='.'?_0x4c785f=_0x47c227:_0x4c785f=_0x47c227+'/'+_0x1bc056;_0x502a11[_0x5e2de5(0x1b8)]&&console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1c5)+_0x4c785f);}if(_0x4c785f==='/'||_0x4c785f==='')return saveSessionContext({'segment_path':undefined},_0x3a13fd),console[_0x5e2de5(0x1ba)]('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x4c785f=normalizePath(_0x4c785f);const _0x4c7132=parsePath(_0x4c785f)['segments'];if(_0x4c7132['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3a13fd),console[_0x5e2de5(0x1ba)](_0x5e2de5(0x1c7)),0x0;_0x502a11['verbose']&&(console['error'](_0x5e2de5(0x1b2)+_0x502a11[_0x5e2de5(0x1a9)]),console['error'](_0x5e2de5(0x19f)+_0x4c785f));const _0x38567f=await withSpinner('Resolving\x20path\x20\x27'+_0x4c785f+'\x27...',()=>_0x199d3d[_0x5e2de5(0x1ae)]['resolvePathToResource'](_0x4c785f),{'verbose':_0x502a11['verbose']}),_0xd0bd8f=_0x38567f[_0x5e2de5(0x1b6)];_0x502a11[_0x5e2de5(0x1b8)]&&(console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1ce)+_0xd0bd8f[_0x5e2de5(0x1c1)]),console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1c9)+_0xd0bd8f[_0x5e2de5(0x19e)]),_0xd0bd8f[_0x5e2de5(0x1ab)]&&console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1b7)+_0xd0bd8f[_0x5e2de5(0x1ab)]));if(_0xd0bd8f[_0x5e2de5(0x1c1)]==='segment')return console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1a1)),console[_0x5e2de5(0x1ad)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error']('Use:\x20tdx\x20segment\x20use\x20'+_0xd0bd8f[_0x5e2de5(0x1be)]+(_0xd0bd8f['folderPath']?'/'+_0xd0bd8f[_0x5e2de5(0x1b5)][_0x5e2de5(0x1a3)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0xd0bd8f[_0x5e2de5(0x1c3)],'parent_segment':_0xd0bd8f[_0x5e2de5(0x1be)]},_0x3a13fd),console[_0x5e2de5(0x1ba)](_0x5e2de5(0x1c0)+_0xd0bd8f['fullPath']),_0x502a11['verbose']&&(console['error'](_0x5e2de5(0x1c6)),console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1a8)),console[_0x5e2de5(0x1ad)](_0x5e2de5(0x1cb))),0x0;}catch(_0x69d296){throw _0x69d296;}}}function a27_0x5a6c(){const _0x1630c3=['execute','segment:use','slice','Site:\x20','length','isAbsolute','folderPath','data','Folder\x20ID:\x20','verbose','1507qREaIG','log','3HjlywA','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','1609320zuDAfy','parentName','2989928Lzyfty','Context\x20set\x20to:\x20','type','27780XgZjvy','fullPath','2SdefvP','Resolved\x20relative\x20path\x20to:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Context\x20cleared.\x20Back\x20to\x20root.','1032684QcFkKM','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','15DtUjpd','Resolved\x20path\x20type:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','parentId','Target\x20path:\x20','667890HafgaF','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','split','join','18NYpDXC','7uZvHqQ','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','109315zpDevj','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','site','segmentPath','folderId','1310439aEowDA','error','segment'];a27_0x5a6c=function(){return _0x1630c3;};return a27_0x5a6c();}
@@ -1 +1 @@
1
- const a28_0x5c2266=a28_0x39ed;function a28_0x39ed(_0x537bbe,_0x3ea9f3){const _0x5a06c9=a28_0x5a06();return a28_0x39ed=function(_0x39ed6f,_0x12fab2){_0x39ed6f=_0x39ed6f-0x104;let _0x295459=_0x5a06c9[_0x39ed6f];return _0x295459;},a28_0x39ed(_0x537bbe,_0x3ea9f3);}(function(_0x33e92e,_0x497abd){const _0x33e3ee=a28_0x39ed,_0x2ef7ad=_0x33e92e();while(!![]){try{const _0x48ff57=parseInt(_0x33e3ee(0x121))/0x1+-parseInt(_0x33e3ee(0x127))/0x2+-parseInt(_0x33e3ee(0x140))/0x3*(-parseInt(_0x33e3ee(0x10e))/0x4)+parseInt(_0x33e3ee(0x13d))/0x5*(-parseInt(_0x33e3ee(0x145))/0x6)+parseInt(_0x33e3ee(0x128))/0x7*(-parseInt(_0x33e3ee(0x10f))/0x8)+-parseInt(_0x33e3ee(0x12c))/0x9*(-parseInt(_0x33e3ee(0x133))/0xa)+-parseInt(_0x33e3ee(0x148))/0xb*(-parseInt(_0x33e3ee(0x123))/0xc);if(_0x48ff57===_0x497abd)break;else _0x2ef7ad['push'](_0x2ef7ad['shift']());}catch(_0x3c8ca4){_0x2ef7ad['push'](_0x2ef7ad['shift']());}}}(a28_0x5a06,0x7fd9c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a28_0x6bbc90 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x5c2266(0x107)]=a28_0x5c2266(0x106);[a28_0x5c2266(0x12a)]=a28_0x5c2266(0x12e);async[a28_0x5c2266(0x10c)](_0x5ca625){const _0x3d6bf0=a28_0x5c2266,{options:_0x2b805e,args:_0xb18279}=_0x5ca625,_0x5b1193=_0x2b805e[_0x3d6bf0(0x117)],_0x14dd2f=_0xb18279[0x0];try{const _0x5b7d7b=_0x2b805e[_0x3d6bf0(0x13e)];_0x2b805e[_0x3d6bf0(0x13a)]&&(console[_0x3d6bf0(0x138)]('Site:\x20'+_0x2b805e[_0x3d6bf0(0x10a)]),console[_0x3d6bf0(0x138)](_0x3d6bf0(0x122)+(_0x5b7d7b||'/')),_0x14dd2f&&console[_0x3d6bf0(0x138)](_0x3d6bf0(0x111)+_0x14dd2f),_0x5b1193&&console[_0x3d6bf0(0x138)](_0x3d6bf0(0x12b)));if(_0x14dd2f){const _0x301993=_0x14dd2f[_0x3d6bf0(0x146)]('*')||_0x14dd2f[_0x3d6bf0(0x146)]('?');if(_0x301993&&!_0x5b7d7b)return await this[_0x3d6bf0(0x118)](_0x5ca625,_0x14dd2f);else return _0x301993?(console[_0x3d6bf0(0x138)]('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x3d6bf0(0x138)](_0x3d6bf0(0x12f)),0x1):_0x5b1193?await this[_0x3d6bf0(0x109)](_0x5ca625,_0x14dd2f):await this[_0x3d6bf0(0x120)](_0x5ca625,_0x14dd2f);}if(!_0x5b7d7b)return await this[_0x3d6bf0(0x129)](_0x5ca625);return _0x5b1193?await this[_0x3d6bf0(0x109)](_0x5ca625,_0x5b7d7b):await this[_0x3d6bf0(0x120)](_0x5ca625,_0x5b7d7b);}catch(_0x59d1ba){if(_0x59d1ba instanceof SDKError)return console['error']('Error:\x20'+_0x59d1ba[_0x3d6bf0(0x13f)]),_0x59d1ba[_0x3d6bf0(0x110)]&&console[_0x3d6bf0(0x138)](_0x3d6bf0(0x14a)+_0x59d1ba['cause']),0x1;throw _0x59d1ba;}}async[a28_0x5c2266(0x118)](_0xdcea58,_0x344111){const _0x3c6f9a=a28_0x5c2266,{options:_0x4002ab,tdx:_0x7436c5}=_0xdcea58,_0x9a0cfe=await withSpinner(_0x3c6f9a(0x13c)+_0x344111+_0x3c6f9a(0x119),()=>_0x7436c5[_0x3c6f9a(0x141)][_0x3c6f9a(0x129)](),{'verbose':_0x4002ab[_0x3c6f9a(0x13a)]}),_0xc7a196=_0x9a0cfe[_0x3c6f9a(0x114)],_0x106449=_0x344111[_0x3c6f9a(0x126)](/[.+^${}()|[\]\\]/g,_0x3c6f9a(0x149))[_0x3c6f9a(0x126)](/\*/g,'.*')[_0x3c6f9a(0x126)](/\?/g,'.'),_0x5885a9=new RegExp('^'+_0x106449+'$','i'),_0x4f9ef2=_0xc7a196[_0x3c6f9a(0x11d)](_0x3ae503=>_0x5885a9['test'](_0x3ae503[_0x3c6f9a(0x113)][_0x3c6f9a(0x107)]));console[_0x3c6f9a(0x138)]('✔\x20Found\x20'+_0x4f9ef2[_0x3c6f9a(0x131)]+_0x3c6f9a(0x104)+(_0x4f9ef2[_0x3c6f9a(0x131)]!==0x1?'s':'')+_0x3c6f9a(0x11b)+_0x344111+'\x27');if(_0x4002ab[_0x3c6f9a(0x130)]===_0x3c6f9a(0x124)||_0x4002ab['format']===_0x3c6f9a(0x137))await handleSDKOutput(_0x4f9ef2,_0x4002ab);else{if(_0x4f9ef2['length']===0x0)console[_0x3c6f9a(0x11e)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x344111);else{console[_0x3c6f9a(0x11e)](_0x3c6f9a(0x147));for(const _0x4f8e3c of _0x4f9ef2){const _0x47f047=_0x4f8e3c[_0x3c6f9a(0x113)][_0x3c6f9a(0x139)]?a28_0x6bbc90[_0x3c6f9a(0x13b)]('\x20('+formatRows(_0x4f8e3c[_0x3c6f9a(0x113)]['population'])+')'):'';console[_0x3c6f9a(0x11e)]('👥\x20'+_0x4f8e3c[_0x3c6f9a(0x113)][_0x3c6f9a(0x107)]+_0x47f047);}}}return 0x0;}async[a28_0x5c2266(0x129)](_0x265b87){const _0x4bf4b2=a28_0x5c2266,{options:_0x5f346d,tdx:_0x27131c}=_0x265b87,_0xcea1af=await withSpinner(_0x4bf4b2(0x142),()=>_0x27131c[_0x4bf4b2(0x141)]['listParents'](),{'verbose':_0x5f346d[_0x4bf4b2(0x13a)]}),_0x28ad6b=_0xcea1af[_0x4bf4b2(0x114)];console[_0x4bf4b2(0x138)](_0x4bf4b2(0x116)+_0x28ad6b['length']+_0x4bf4b2(0x104)+(_0x28ad6b[_0x4bf4b2(0x131)]!==0x1?'s':''));if(_0x5f346d['format']===_0x4bf4b2(0x124)||_0x5f346d['format']==='jsonl')await handleSDKOutput(_0x28ad6b,_0x5f346d);else{console[_0x4bf4b2(0x11e)](_0x4bf4b2(0x147));for(const _0x52170a of _0x28ad6b){const _0x3f8447=_0x52170a[_0x4bf4b2(0x113)]['population']?a28_0x6bbc90[_0x4bf4b2(0x13b)]('\x20('+formatRows(_0x52170a[_0x4bf4b2(0x113)][_0x4bf4b2(0x139)])+')'):'';console[_0x4bf4b2(0x11e)]('👥\x20'+_0x52170a['attributes'][_0x4bf4b2(0x107)]+_0x3f8447);}}return 0x0;}async[a28_0x5c2266(0x120)](_0x98f116,_0x556130){const _0x10b7c5=a28_0x5c2266,{options:_0x4fd90b,tdx:_0x5507b5}=_0x98f116,_0x11bf62=await withSpinner(_0x10b7c5(0x11c)+_0x556130+'\x27...',()=>_0x5507b5[_0x10b7c5(0x141)]['resolvePathToResource'](_0x556130),{'verbose':_0x4fd90b[_0x10b7c5(0x13a)]}),_0x77c79e=_0x11bf62['data'];_0x4fd90b[_0x10b7c5(0x13a)]&&(console['error'](_0x10b7c5(0x135)+_0x77c79e[_0x10b7c5(0x134)]),_0x77c79e[_0x10b7c5(0x11f)]&&console[_0x10b7c5(0x138)](_0x10b7c5(0x105)+_0x77c79e[_0x10b7c5(0x11f)]));const _0x41ba8e=await withSpinner(_0x10b7c5(0x10d),()=>_0x5507b5['segment']['listUnified'](_0x77c79e[_0x10b7c5(0x134)],_0x77c79e[_0x10b7c5(0x11f)]),{'verbose':_0x4fd90b['verbose']}),{folders:_0x992c0f,segments:_0x22afff}=_0x41ba8e[_0x10b7c5(0x114)],_0x351327=_0x992c0f[_0x10b7c5(0x131)]+_0x22afff[_0x10b7c5(0x131)];console[_0x10b7c5(0x138)](_0x10b7c5(0x116)+_0x992c0f['length']+_0x10b7c5(0x10b)+(_0x992c0f[_0x10b7c5(0x131)]!==0x1?'s':'')+_0x10b7c5(0x12d)+_0x22afff[_0x10b7c5(0x131)]+_0x10b7c5(0x11a)+(_0x22afff['length']!==0x1?'s':''));if(_0x4fd90b[_0x10b7c5(0x130)]===_0x10b7c5(0x124)||_0x4fd90b[_0x10b7c5(0x130)]===_0x10b7c5(0x137)){const _0x413ce6=[..._0x992c0f[_0x10b7c5(0x136)](_0x4b7379=>({..._0x4b7379,'type':_0x10b7c5(0x143)})),..._0x22afff['map'](_0x43e15e=>({..._0x43e15e,'type':_0x10b7c5(0x141)}))][_0x10b7c5(0x125)]((_0x101a10,_0x39015c)=>_0x101a10[_0x10b7c5(0x107)]['localeCompare'](_0x39015c[_0x10b7c5(0x107)]));await handleSDKOutput(_0x413ce6,_0x4fd90b);}else{if(_0x351327===0x0)console['log'](a28_0x6bbc90[_0x10b7c5(0x13b)]('[/'+_0x556130+']')),console[_0x10b7c5(0x11e)](_0x10b7c5(0x115));else{console[_0x10b7c5(0x11e)](a28_0x6bbc90[_0x10b7c5(0x13b)]('[/'+_0x556130+']'));const _0x26059b=formatFlatList(_0x992c0f,_0x22afff,{'showMetadata':!![]});console['log'](_0x26059b);}}return 0x0;}async[a28_0x5c2266(0x109)](_0x1cbb1f,_0x43cf4c){const _0x15f754=a28_0x5c2266,{options:_0x3506e3,tdx:_0x1bda1a}=_0x1cbb1f,_0x1e75bd=await withSpinner(_0x15f754(0x11c)+_0x43cf4c+_0x15f754(0x119),()=>_0x1bda1a[_0x15f754(0x141)][_0x15f754(0x108)](_0x43cf4c),{'verbose':_0x3506e3[_0x15f754(0x13a)]}),_0x2f6b58=_0x1e75bd['data'];_0x3506e3['verbose']&&(console[_0x15f754(0x138)]('Parent\x20ID:\x20'+_0x2f6b58[_0x15f754(0x134)]),_0x2f6b58[_0x15f754(0x11f)]&&console['error'](_0x15f754(0x105)+_0x2f6b58[_0x15f754(0x11f)]));const _0x422f86=_0x3506e3[_0x15f754(0x112)]||0xa,_0x17f3b6=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x1bda1a[_0x15f754(0x141)]['listRecursive'](_0x2f6b58[_0x15f754(0x134)],_0x2f6b58['folderId'],0x0,_0x422f86),{'verbose':_0x3506e3[_0x15f754(0x13a)]}),_0x5696e4=_0x17f3b6[_0x15f754(0x114)];console[_0x15f754(0x138)](_0x15f754(0x144)+_0x5696e4[_0x15f754(0x131)]+_0x15f754(0x132));if(_0x3506e3[_0x15f754(0x130)]===_0x15f754(0x124)||_0x3506e3[_0x15f754(0x130)]===_0x15f754(0x137))await handleSDKOutput(_0x5696e4,_0x3506e3);else{console[_0x15f754(0x11e)](a28_0x6bbc90[_0x15f754(0x13b)]('[/'+_0x43cf4c+']'));const _0xd29824=formatTree(_0x5696e4,{'showMetadata':!![]});console[_0x15f754(0x11e)](_0xd29824);}return 0x0;}}function a28_0x5a06(){const _0xbdd31b=['(empty)','✔\x20Found\x20','recursive','listParentsWithPattern','\x27...','\x20segment','\x20matching\x20\x27','Resolving\x20context\x20path\x20\x27','filter','log','folderId','listUnified','14068mlnofE','Current\x20context:\x20','65676ewWzwm','json','sort','replace','1583318JVvhqO','7XXdkWC','listParents','description','Recursive\x20mode:\x20enabled','8497278UjjOQB','\x20and\x20','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','format','length','\x20top-level\x20items','10SoaFxi','parentId','Parent\x20ID:\x20','map','jsonl','error','population','verbose','dim','Listing\x20parent\x20segments\x20matching\x20\x27','3722855nbXxLf','segmentPath','message','1122DikmYo','segment','Listing\x20parent\x20segments...','folder','✔\x20Built\x20tree\x20with\x20','6JRULtD','includes','[parent\x20segments]','1045yJEGYT','\x5c$&','\x20\x20Cause:\x20','\x20parent\x20segment','Folder\x20ID:\x20','segments','name','resolvePathToResource','listRecursive','site','\x20folder','execute','Listing\x20folders\x20and\x20segments...','9840cYyhnh','2706232UdJwnZ','cause','Path/pattern\x20arg:\x20','maxDepth','attributes','data'];a28_0x5a06=function(){return _0xbdd31b;};return a28_0x5a06();}
1
+ const a28_0x21e6b6=a28_0x6ec0;(function(_0x5151cc,_0x2884c1){const _0x14eb2f=a28_0x6ec0,_0xda4bf3=_0x5151cc();while(!![]){try{const _0x5372a1=-parseInt(_0x14eb2f(0x115))/0x1+-parseInt(_0x14eb2f(0x109))/0x2*(parseInt(_0x14eb2f(0x123))/0x3)+-parseInt(_0x14eb2f(0x120))/0x4*(parseInt(_0x14eb2f(0xe9))/0x5)+-parseInt(_0x14eb2f(0x125))/0x6*(parseInt(_0x14eb2f(0x11e))/0x7)+parseInt(_0x14eb2f(0x11a))/0x8+parseInt(_0x14eb2f(0x129))/0x9+parseInt(_0x14eb2f(0x110))/0xa;if(_0x5372a1===_0x2884c1)break;else _0xda4bf3['push'](_0xda4bf3['shift']());}catch(_0x398e6c){_0xda4bf3['push'](_0xda4bf3['shift']());}}}(a28_0x4528,0xb62af));function a28_0x4528(){const _0x2a5f10=['filter','Path/pattern\x20arg:\x20','Listing\x20folders\x20and\x20segments...','11315178HfHOwA','format','\x20parent\x20segment','listRecursive','Error:\x20','\x27...','65lIYmbN','verbose','localeCompare','Parent\x20ID:\x20','test','log','\x20\x20Cause:\x20','data','json','parentId','listUnified','segmentPath','length','✔\x20Built\x20tree\x20with\x20','recursive','\x20folder','listParents','Current\x20context:\x20','site','Listing\x20parent\x20segments...','description','No\x20parent\x20segments\x20match\x20pattern:\x20','✔\x20Found\x20','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','\x20matching\x20\x27','Building\x20hierarchy\x20tree...','map','\x20and\x20','attributes','(empty)','\x20segment','segments','96814dALnaH','population','replace','Recursive\x20mode:\x20enabled','error','includes','\x20top-level\x20items','6450230XrOOrv','dim','Folder\x20ID:\x20','sort','cause','48605CYvkGi','jsonl','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','resolvePathToResource','execute','6442008tuyVio','maxDepth','\x5c$&','folderId','2227162fGWTZs','Resolving\x20context\x20path\x20\x27','237436nXZVas','segment','👥\x20','51zUamuo','name','6xyTTEb'];a28_0x4528=function(){return _0x2a5f10;};return a28_0x4528();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a28_0x6ec0(_0x3940ad,_0x3eb636){const _0x45280d=a28_0x4528();return a28_0x6ec0=function(_0x6ec0a8,_0x3175fd){_0x6ec0a8=_0x6ec0a8-0xe5;let _0x2484c6=_0x45280d[_0x6ec0a8];return _0x2484c6;},a28_0x6ec0(_0x3940ad,_0x3eb636);}import{formatRows}from'../utils/formatters.js';import a28_0x31c6cb from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x21e6b6(0x124)]=a28_0x21e6b6(0x108);[a28_0x21e6b6(0xfd)]=a28_0x21e6b6(0x117);async[a28_0x21e6b6(0x119)](_0x487ee5){const _0x4e3b62=a28_0x21e6b6,{options:_0x54a6d7,args:_0x47534f}=_0x487ee5,_0x7d3e6a=_0x54a6d7[_0x4e3b62(0xf7)],_0x3d61c=_0x47534f[0x0];try{const _0xae1c31=_0x54a6d7[_0x4e3b62(0xf4)];_0x54a6d7[_0x4e3b62(0xea)]&&(console[_0x4e3b62(0x10d)]('Site:\x20'+_0x54a6d7[_0x4e3b62(0xfb)]),console[_0x4e3b62(0x10d)](_0x4e3b62(0xfa)+(_0xae1c31||'/')),_0x3d61c&&console[_0x4e3b62(0x10d)](_0x4e3b62(0x127)+_0x3d61c),_0x7d3e6a&&console['error'](_0x4e3b62(0x10c)));if(_0x3d61c){const _0x5b8ec4=_0x3d61c[_0x4e3b62(0x10e)]('*')||_0x3d61c[_0x4e3b62(0x10e)]('?');if(_0x5b8ec4&&!_0xae1c31)return await this['listParentsWithPattern'](_0x487ee5,_0x3d61c);else return _0x5b8ec4?(console['error'](_0x4e3b62(0x100)),console[_0x4e3b62(0x10d)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x7d3e6a?await this[_0x4e3b62(0xe6)](_0x487ee5,_0x3d61c):await this[_0x4e3b62(0xf3)](_0x487ee5,_0x3d61c);}if(!_0xae1c31)return await this[_0x4e3b62(0xf9)](_0x487ee5);return _0x7d3e6a?await this['listRecursive'](_0x487ee5,_0xae1c31):await this['listUnified'](_0x487ee5,_0xae1c31);}catch(_0x5aeef2){if(_0x5aeef2 instanceof SDKError)return console[_0x4e3b62(0x10d)](_0x4e3b62(0xe7)+_0x5aeef2['message']),_0x5aeef2[_0x4e3b62(0x114)]&&console[_0x4e3b62(0x10d)](_0x4e3b62(0xef)+_0x5aeef2[_0x4e3b62(0x114)]),0x1;throw _0x5aeef2;}}async['listParentsWithPattern'](_0x1cf3f5,_0x88e0d2){const _0x3f5563=a28_0x21e6b6,{options:_0x159758,tdx:_0x1fabc2}=_0x1cf3f5,_0x6c2c3d=await withSpinner('Listing\x20parent\x20segments\x20matching\x20\x27'+_0x88e0d2+_0x3f5563(0xe8),()=>_0x1fabc2[_0x3f5563(0x121)][_0x3f5563(0xf9)](),{'verbose':_0x159758[_0x3f5563(0xea)]}),_0x23f92b=_0x6c2c3d['data'],_0x3ab225=_0x88e0d2[_0x3f5563(0x10b)](/[.+^${}()|[\]\\]/g,_0x3f5563(0x11c))[_0x3f5563(0x10b)](/\*/g,'.*')[_0x3f5563(0x10b)](/\?/g,'.'),_0x44e6a0=new RegExp('^'+_0x3ab225+'$','i'),_0x392442=_0x23f92b[_0x3f5563(0x126)](_0x43dfb6=>_0x44e6a0[_0x3f5563(0xed)](_0x43dfb6[_0x3f5563(0x105)][_0x3f5563(0x124)]));console[_0x3f5563(0x10d)](_0x3f5563(0xff)+_0x392442[_0x3f5563(0xf5)]+_0x3f5563(0xe5)+(_0x392442[_0x3f5563(0xf5)]!==0x1?'s':'')+_0x3f5563(0x101)+_0x88e0d2+'\x27');if(_0x159758[_0x3f5563(0x12a)]==='json'||_0x159758[_0x3f5563(0x12a)]===_0x3f5563(0x116))await handleSDKOutput(_0x392442,_0x159758);else{if(_0x392442[_0x3f5563(0xf5)]===0x0)console['log'](_0x3f5563(0xfe)+_0x88e0d2);else{console['log']('[parent\x20segments]');for(const _0x8dc583 of _0x392442){const _0x28d2ba=_0x8dc583[_0x3f5563(0x105)]['population']?a28_0x31c6cb[_0x3f5563(0x111)]('\x20('+formatRows(_0x8dc583[_0x3f5563(0x105)][_0x3f5563(0x10a)])+')'):'';console[_0x3f5563(0xee)]('👥\x20'+_0x8dc583['attributes']['name']+_0x28d2ba);}}}return 0x0;}async['listParents'](_0x5fe53b){const _0xbdd117=a28_0x21e6b6,{options:_0x237e36,tdx:_0x56cfa6}=_0x5fe53b,_0x341142=await withSpinner(_0xbdd117(0xfc),()=>_0x56cfa6[_0xbdd117(0x121)][_0xbdd117(0xf9)](),{'verbose':_0x237e36[_0xbdd117(0xea)]}),_0x1588d1=_0x341142[_0xbdd117(0xf0)];console[_0xbdd117(0x10d)](_0xbdd117(0xff)+_0x1588d1['length']+'\x20parent\x20segment'+(_0x1588d1[_0xbdd117(0xf5)]!==0x1?'s':''));if(_0x237e36[_0xbdd117(0x12a)]==='json'||_0x237e36[_0xbdd117(0x12a)]===_0xbdd117(0x116))await handleSDKOutput(_0x1588d1,_0x237e36);else{console[_0xbdd117(0xee)]('[parent\x20segments]');for(const _0x557be9 of _0x1588d1){const _0x204671=_0x557be9[_0xbdd117(0x105)][_0xbdd117(0x10a)]?a28_0x31c6cb[_0xbdd117(0x111)]('\x20('+formatRows(_0x557be9[_0xbdd117(0x105)]['population'])+')'):'';console['log'](_0xbdd117(0x122)+_0x557be9[_0xbdd117(0x105)][_0xbdd117(0x124)]+_0x204671);}}return 0x0;}async[a28_0x21e6b6(0xf3)](_0x48d2b5,_0x4edf63){const _0x2b71e6=a28_0x21e6b6,{options:_0x3d60b5,tdx:_0x1bd803}=_0x48d2b5,_0x2ca4a3=await withSpinner(_0x2b71e6(0x11f)+_0x4edf63+_0x2b71e6(0xe8),()=>_0x1bd803[_0x2b71e6(0x121)][_0x2b71e6(0x118)](_0x4edf63),{'verbose':_0x3d60b5[_0x2b71e6(0xea)]}),_0xf73b6=_0x2ca4a3[_0x2b71e6(0xf0)];_0x3d60b5[_0x2b71e6(0xea)]&&(console[_0x2b71e6(0x10d)]('Parent\x20ID:\x20'+_0xf73b6[_0x2b71e6(0xf2)]),_0xf73b6[_0x2b71e6(0x11d)]&&console[_0x2b71e6(0x10d)](_0x2b71e6(0x112)+_0xf73b6[_0x2b71e6(0x11d)]));const _0x2e89e5=await withSpinner(_0x2b71e6(0x128),()=>_0x1bd803['segment'][_0x2b71e6(0xf3)](_0xf73b6[_0x2b71e6(0xf2)],_0xf73b6[_0x2b71e6(0x11d)]),{'verbose':_0x3d60b5[_0x2b71e6(0xea)]}),{folders:_0x2e6a60,segments:_0x7f17dc}=_0x2e89e5[_0x2b71e6(0xf0)],_0x29846b=_0x2e6a60[_0x2b71e6(0xf5)]+_0x7f17dc[_0x2b71e6(0xf5)];console[_0x2b71e6(0x10d)](_0x2b71e6(0xff)+_0x2e6a60[_0x2b71e6(0xf5)]+_0x2b71e6(0xf8)+(_0x2e6a60[_0x2b71e6(0xf5)]!==0x1?'s':'')+_0x2b71e6(0x104)+_0x7f17dc[_0x2b71e6(0xf5)]+_0x2b71e6(0x107)+(_0x7f17dc[_0x2b71e6(0xf5)]!==0x1?'s':''));if(_0x3d60b5[_0x2b71e6(0x12a)]===_0x2b71e6(0xf1)||_0x3d60b5['format']===_0x2b71e6(0x116)){const _0x5c4baf=[..._0x2e6a60[_0x2b71e6(0x103)](_0x23dcea=>({..._0x23dcea,'type':'folder'})),..._0x7f17dc[_0x2b71e6(0x103)](_0x36b459=>({..._0x36b459,'type':'segment'}))][_0x2b71e6(0x113)]((_0x3c61a2,_0x3b9823)=>_0x3c61a2[_0x2b71e6(0x124)][_0x2b71e6(0xeb)](_0x3b9823['name']));await handleSDKOutput(_0x5c4baf,_0x3d60b5);}else{if(_0x29846b===0x0)console[_0x2b71e6(0xee)](a28_0x31c6cb[_0x2b71e6(0x111)]('[/'+_0x4edf63+']')),console['log'](_0x2b71e6(0x106));else{console['log'](a28_0x31c6cb[_0x2b71e6(0x111)]('[/'+_0x4edf63+']'));const _0x498585=formatFlatList(_0x2e6a60,_0x7f17dc,{'showMetadata':!![]});console[_0x2b71e6(0xee)](_0x498585);}}return 0x0;}async[a28_0x21e6b6(0xe6)](_0x4f7a51,_0x5428df){const _0x5a3e6a=a28_0x21e6b6,{options:_0x553c22,tdx:_0x3ee72c}=_0x4f7a51,_0x207639=await withSpinner(_0x5a3e6a(0x11f)+_0x5428df+_0x5a3e6a(0xe8),()=>_0x3ee72c[_0x5a3e6a(0x121)][_0x5a3e6a(0x118)](_0x5428df),{'verbose':_0x553c22[_0x5a3e6a(0xea)]}),_0x4350cd=_0x207639[_0x5a3e6a(0xf0)];_0x553c22[_0x5a3e6a(0xea)]&&(console['error'](_0x5a3e6a(0xec)+_0x4350cd[_0x5a3e6a(0xf2)]),_0x4350cd[_0x5a3e6a(0x11d)]&&console['error'](_0x5a3e6a(0x112)+_0x4350cd[_0x5a3e6a(0x11d)]));const _0x4565ac=_0x553c22[_0x5a3e6a(0x11b)]||0xa,_0x4d7dd8=await withSpinner(_0x5a3e6a(0x102),()=>_0x3ee72c[_0x5a3e6a(0x121)][_0x5a3e6a(0xe6)](_0x4350cd[_0x5a3e6a(0xf2)],_0x4350cd[_0x5a3e6a(0x11d)],0x0,_0x4565ac),{'verbose':_0x553c22['verbose']}),_0x552a50=_0x4d7dd8[_0x5a3e6a(0xf0)];console['error'](_0x5a3e6a(0xf6)+_0x552a50[_0x5a3e6a(0xf5)]+_0x5a3e6a(0x10f));if(_0x553c22[_0x5a3e6a(0x12a)]===_0x5a3e6a(0xf1)||_0x553c22[_0x5a3e6a(0x12a)]===_0x5a3e6a(0x116))await handleSDKOutput(_0x552a50,_0x553c22);else{console[_0x5a3e6a(0xee)](a28_0x31c6cb['dim']('[/'+_0x5428df+']'));const _0x4fe12a=formatTree(_0x552a50,{'showMetadata':!![]});console[_0x5a3e6a(0xee)](_0x4fe12a);}return 0x0;}}
@@ -1 +1 @@
1
- const a29_0x1ed28d=a29_0x1a92;(function(_0x20bbdf,_0x43265b){const _0x369a15=a29_0x1a92,_0x279ff0=_0x20bbdf();while(!![]){try{const _0x8f62a4=-parseInt(_0x369a15(0x1cd))/0x1+-parseInt(_0x369a15(0x1e3))/0x2+-parseInt(_0x369a15(0x1c6))/0x3+-parseInt(_0x369a15(0x1d0))/0x4*(parseInt(_0x369a15(0x1e1))/0x5)+-parseInt(_0x369a15(0x1dd))/0x6+parseInt(_0x369a15(0x1d8))/0x7+parseInt(_0x369a15(0x1e6))/0x8;if(_0x8f62a4===_0x43265b)break;else _0x279ff0['push'](_0x279ff0['shift']());}catch(_0x4ddbbe){_0x279ff0['push'](_0x279ff0['shift']());}}}(a29_0xd942,0xe753e));import{BaseCommand}from'./command.js';function a29_0x1a92(_0xb83a23,_0x5aef10){const _0xd94230=a29_0xd942();return a29_0x1a92=function(_0x1a9296,_0x5e3c0a){_0x1a9296=_0x1a9296-0x1c5;let _0x46e14f=_0xd94230[_0x1a9296];return _0x46e14f;},a29_0x1a92(_0xb83a23,_0x5aef10);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a29_0xd942(){const _0x4fb2b7=['length','message','490856WeBKqi','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','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','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','data','verbose','description','show','4972450eYmoFL','Usage:\x20tdx\x20show\x20<database.table>','error','execute','database','6567360IFXFLf','✔\x20Retrieved\x20','...','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','50TtRvlw','Catalog:\x20','2530518MCtdVq','args','name','35497888GdNFOv','cause','\x20\x20Cause:\x20','validate','1298985LveKJR','Error:\x20','Site:\x20','Limit:\x20','showTable','table','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','180114rHBkvZ'];a29_0xd942=function(){return _0x4fb2b7;};return a29_0xd942();}import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x1ed28d(0x1e5)]='show';[a29_0x1ed28d(0x1d6)]='Show\x20table\x20contents';async[a29_0x1ed28d(0x1db)](_0x3f1900){const _0x56b62f=a29_0x1ed28d;return this[_0x56b62f(0x1ca)](_0x3f1900);}async['showTable'](_0x5872c3){const _0x1b0f3e=a29_0x1ed28d,{options:_0x2326cf,args:_0x300a4d,tdx:_0x34f8b1}=_0x5872c3;let _0x5a10a6;try{_0x5a10a6=parseTableReference(_0x300a4d[0x0]);const _0x49cde9=_0x2326cf[_0x1b0f3e(0x1dc)];!_0x5a10a6[_0x1b0f3e(0x1dc)]&&_0x49cde9&&(_0x5a10a6[_0x1b0f3e(0x1dc)]=_0x49cde9);const _0x240d76=validateTableDescribeReference(_0x5a10a6);if(_0x240d76)return console[_0x1b0f3e(0x1da)]('Error:\x20'+_0x240d76),console['error'](_0x1b0f3e(0x1d9)),console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1cc)),console[_0x1b0f3e(0x1da)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x57b5fe){return console['error'](_0x1b0f3e(0x1c7)+_0x57b5fe['message']),console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1d9)),console['error'](_0x1b0f3e(0x1cc)),console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1d3)),0x1;}const _0x1fd10f=_0x5a10a6['catalog'],_0x3c7e6f=_0x5a10a6[_0x1b0f3e(0x1dc)],_0x4bf580=_0x5a10a6[_0x1b0f3e(0x1cb)],_0x261382=_0x2326cf['limit'];try{_0x2326cf[_0x1b0f3e(0x1d5)]&&(console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1c8)+_0x2326cf['site']),_0x1fd10f&&console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1e2)+_0x1fd10f),console[_0x1b0f3e(0x1da)]('Database:\x20'+_0x3c7e6f),console['error']('Table:\x20'+_0x4bf580),console['error'](_0x1b0f3e(0x1c9)+_0x261382));const _0x4032a0=_0x1fd10f?_0x1fd10f+'.'+_0x3c7e6f+'.'+_0x4bf580:_0x3c7e6f+'.'+_0x4bf580,_0x17d031=await withSpinner('Querying\x20'+_0x4032a0+_0x1b0f3e(0x1df),()=>_0x34f8b1['table'][_0x1b0f3e(0x1d7)](_0x3c7e6f,_0x4bf580,_0x261382,_0x1fd10f),{'verbose':_0x2326cf[_0x1b0f3e(0x1d5)]}),_0x53db01=_0x17d031[_0x1b0f3e(0x1d4)],_0x308f32=_0x53db01['data'];return _0x308f32[_0x1b0f3e(0x1ce)]===0x0?console['error'](_0x1b0f3e(0x1e0)):console['error'](_0x1b0f3e(0x1de)+_0x308f32[_0x1b0f3e(0x1ce)]+'\x20row'+(_0x308f32['length']!==0x1?'s':'')+'\x20from\x20'+_0x4032a0),await handleSDKOutput(_0x308f32,_0x2326cf),0x0;}catch(_0x31d9d1){if(_0x31d9d1 instanceof SDKError)return console[_0x1b0f3e(0x1da)]('Error:\x20'+_0x31d9d1[_0x1b0f3e(0x1cf)]),_0x31d9d1[_0x1b0f3e(0x1e7)]&&console[_0x1b0f3e(0x1da)](_0x1b0f3e(0x1e8)+_0x31d9d1[_0x1b0f3e(0x1e7)]),0x1;throw _0x31d9d1;}}[a29_0x1ed28d(0x1c5)](_0x25db93){const _0x24430c=a29_0x1ed28d;if(_0x25db93[_0x24430c(0x1e4)]['length']===0x0)return _0x24430c(0x1d2);if(_0x25db93[_0x24430c(0x1e4)]['length']>0x1)return _0x24430c(0x1d1);return undefined;}}
1
+ const a29_0x332c9d=a29_0x5df9;(function(_0x371ae8,_0x7167d7){const _0x2c8c02=a29_0x5df9,_0x41a13a=_0x371ae8();while(!![]){try{const _0x28521e=parseInt(_0x2c8c02(0xbf))/0x1*(-parseInt(_0x2c8c02(0xb7))/0x2)+-parseInt(_0x2c8c02(0xa6))/0x3+parseInt(_0x2c8c02(0xb9))/0x4*(parseInt(_0x2c8c02(0xc3))/0x5)+parseInt(_0x2c8c02(0xb4))/0x6+-parseInt(_0x2c8c02(0xa2))/0x7+parseInt(_0x2c8c02(0xac))/0x8*(-parseInt(_0x2c8c02(0xc6))/0x9)+parseInt(_0x2c8c02(0xb0))/0xa;if(_0x28521e===_0x7167d7)break;else _0x41a13a['push'](_0x41a13a['shift']());}catch(_0x56fc4d){_0x41a13a['push'](_0x41a13a['shift']());}}}(a29_0x50fb,0xa8aef));import{BaseCommand}from'./command.js';function a29_0x50fb(){const _0x3865dd=['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','5652997JasZvN','Table:\x20','description','Database:\x20','4142646oaGEKc','show','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','cause','verbose','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','5336PyJpID','database','error','\x20\x20Cause:\x20','19431280MNznmi','length','limit','execute','2257992HTcApF','message','✔\x20Retrieved\x20','24KnwRvz','Show\x20table\x20contents','308020hhXuds','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','name','Usage:\x20tdx\x20show\x20<database.table>','Limit:\x20','validate','22316RGlzrF','Catalog:\x20','showTable','\x20row','55XjXWGU','catalog','\x20from\x20','261uUoQlu','Error:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','table','site','Querying\x20','data','args'];a29_0x50fb=function(){return _0x3865dd;};return a29_0x50fb();}function a29_0x5df9(_0x510a7c,_0x5d1dc8){const _0x50fbd8=a29_0x50fb();return a29_0x5df9=function(_0x5df933,_0x3f9f72){_0x5df933=_0x5df933-0x9b;let _0x4b7ff3=_0x50fbd8[_0x5df933];return _0x4b7ff3;},a29_0x5df9(_0x510a7c,_0x5d1dc8);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x332c9d(0xbb)]='show';[a29_0x332c9d(0xa4)]=a29_0x332c9d(0xb8);async[a29_0x332c9d(0xb3)](_0x2e607f){return this['showTable'](_0x2e607f);}async[a29_0x332c9d(0xc1)](_0x3f4e31){const _0x51e1e9=a29_0x332c9d,{options:_0x4d827d,args:_0x316376,tdx:_0x4e5942}=_0x3f4e31;let _0x1a2ecc;try{_0x1a2ecc=parseTableReference(_0x316376[0x0]);const _0x5bf890=_0x4d827d[_0x51e1e9(0xad)];!_0x1a2ecc[_0x51e1e9(0xad)]&&_0x5bf890&&(_0x1a2ecc[_0x51e1e9(0xad)]=_0x5bf890);const _0x255b1d=validateTableDescribeReference(_0x1a2ecc);if(_0x255b1d)return console[_0x51e1e9(0xae)]('Error:\x20'+_0x255b1d),console[_0x51e1e9(0xae)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x51e1e9(0xae)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x51e1e9(0xae)](_0x51e1e9(0xab)),0x1;}catch(_0x58b88a){return console[_0x51e1e9(0xae)](_0x51e1e9(0xc7)+_0x58b88a[_0x51e1e9(0xb5)]),console[_0x51e1e9(0xae)](_0x51e1e9(0xbc)),console[_0x51e1e9(0xae)](_0x51e1e9(0x9b)),console['error'](_0x51e1e9(0xab)),0x1;}const _0x413100=_0x1a2ecc[_0x51e1e9(0xc4)],_0x4c847d=_0x1a2ecc[_0x51e1e9(0xad)],_0x91b43f=_0x1a2ecc[_0x51e1e9(0x9c)],_0x118443=_0x4d827d[_0x51e1e9(0xb2)];try{_0x4d827d[_0x51e1e9(0xaa)]&&(console[_0x51e1e9(0xae)]('Site:\x20'+_0x4d827d[_0x51e1e9(0x9d)]),_0x413100&&console['error'](_0x51e1e9(0xc0)+_0x413100),console['error'](_0x51e1e9(0xa5)+_0x4c847d),console[_0x51e1e9(0xae)](_0x51e1e9(0xa3)+_0x91b43f),console[_0x51e1e9(0xae)](_0x51e1e9(0xbd)+_0x118443));const _0x203614=_0x413100?_0x413100+'.'+_0x4c847d+'.'+_0x91b43f:_0x4c847d+'.'+_0x91b43f,_0x130d0c=await withSpinner(_0x51e1e9(0x9e)+_0x203614+'...',()=>_0x4e5942[_0x51e1e9(0x9c)][_0x51e1e9(0xa7)](_0x4c847d,_0x91b43f,_0x118443,_0x413100),{'verbose':_0x4d827d[_0x51e1e9(0xaa)]}),_0x3b3508=_0x130d0c[_0x51e1e9(0x9f)],_0x319ceb=_0x3b3508['data'];return _0x319ceb['length']===0x0?console[_0x51e1e9(0xae)](_0x51e1e9(0xa8)):console['error'](_0x51e1e9(0xb6)+_0x319ceb[_0x51e1e9(0xb1)]+_0x51e1e9(0xc2)+(_0x319ceb['length']!==0x1?'s':'')+_0x51e1e9(0xc5)+_0x203614),await handleSDKOutput(_0x319ceb,_0x4d827d),0x0;}catch(_0x108b34){if(_0x108b34 instanceof SDKError)return console[_0x51e1e9(0xae)]('Error:\x20'+_0x108b34[_0x51e1e9(0xb5)]),_0x108b34['cause']&&console['error'](_0x51e1e9(0xaf)+_0x108b34[_0x51e1e9(0xa9)]),0x1;throw _0x108b34;}}[a29_0x332c9d(0xbe)](_0x50e071){const _0x54e01e=a29_0x332c9d;if(_0x50e071[_0x54e01e(0xa0)][_0x54e01e(0xb1)]===0x0)return _0x54e01e(0xa1);if(_0x50e071[_0x54e01e(0xa0)][_0x54e01e(0xb1)]>0x1)return _0x54e01e(0xba);return undefined;}}