@treasuredata/tdx 0.5.0 → 0.5.1

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 (102) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-api-client.js +1 -1
  5. package/dist/client/engage-api-client.js +1 -1
  6. package/dist/client/http-client.js +1 -1
  7. package/dist/client/llm-api-client.js +1 -1
  8. package/dist/client/rate-limiter.js +1 -1
  9. package/dist/client/td-api-client.js +1 -1
  10. package/dist/client/trino-api-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/auth-command.js +1 -1
  15. package/dist/commands/chat-command.js +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/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/context-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/llm-command.d.ts +9 -0
  28. package/dist/commands/llm-command.d.ts.map +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-command.js.map +1 -1
  31. package/dist/commands/llm-proxy.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profiles-command.js +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/segment-command.js +1 -1
  36. package/dist/commands/segment-create-command.js +1 -1
  37. package/dist/commands/segment-fields-command.js +1 -1
  38. package/dist/commands/segment-pwd-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/workflow-command.js +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.js +1 -1
  52. package/dist/core/project-config.js +1 -1
  53. package/dist/core/session.js +1 -1
  54. package/dist/index.js +1 -1
  55. package/dist/proxy/anthropic-adapter.js +1 -1
  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/proxy/session-cache.js +1 -1
  60. package/dist/sdk/api.js +1 -1
  61. package/dist/sdk/engage.js +1 -1
  62. package/dist/sdk/errors.js +1 -1
  63. package/dist/sdk/index.js +1 -1
  64. package/dist/sdk/job.js +1 -1
  65. package/dist/sdk/llm.js +1 -1
  66. package/dist/sdk/query.js +1 -1
  67. package/dist/sdk/segment.js +1 -1
  68. package/dist/sdk/workflow.js +1 -1
  69. package/dist/types/endpoints.js +1 -1
  70. package/dist/types/index.js +1 -1
  71. package/dist/utils/agent-ref-parser.js +1 -1
  72. package/dist/utils/chat-cache.js +1 -1
  73. package/dist/utils/claude-usage-tracker.d.ts +1 -0
  74. package/dist/utils/claude-usage-tracker.d.ts.map +1 -1
  75. package/dist/utils/claude-usage-tracker.js +1 -1
  76. package/dist/utils/claude-usage-tracker.js.map +1 -1
  77. package/dist/utils/colors.js +1 -1
  78. package/dist/utils/command-output.js +1 -1
  79. package/dist/utils/constants.js +1 -1
  80. package/dist/utils/file-permissions.js +1 -1
  81. package/dist/utils/format-detector.js +1 -1
  82. package/dist/utils/formatters.js +1 -1
  83. package/dist/utils/json-loader.js +1 -1
  84. package/dist/utils/llm-backup-utils.js +1 -1
  85. package/dist/utils/model-aliases.js +1 -1
  86. package/dist/utils/model-factors.js +1 -1
  87. package/dist/utils/option-validation.js +1 -1
  88. package/dist/utils/port.js +1 -1
  89. package/dist/utils/process.js +1 -1
  90. package/dist/utils/prompt.js +1 -1
  91. package/dist/utils/segment-path-parser.js +1 -1
  92. package/dist/utils/segment-ref-parser.js +1 -1
  93. package/dist/utils/spinner.js +1 -1
  94. package/dist/utils/sql-parser.js +1 -1
  95. package/dist/utils/sse-parser.js +1 -1
  96. package/dist/utils/string-utils.js +1 -1
  97. package/dist/utils/table-ref-parser.js +1 -1
  98. package/dist/utils/tdx-logger.js +1 -1
  99. package/dist/utils/tree-formatter.js +1 -1
  100. package/dist/utils/version-check.js +1 -1
  101. package/dist/utils/workflow-utils.js +1 -1
  102. package/package.json +1 -1
@@ -1 +1 @@
1
- const a27_0x1b95de=a27_0x2789;(function(_0x15cb5f,_0x117af4){const _0x2b3b57=a27_0x2789,_0x303c66=_0x15cb5f();while(!![]){try{const _0x2e391f=-parseInt(_0x2b3b57(0x1ea))/0x1*(parseInt(_0x2b3b57(0x1e4))/0x2)+-parseInt(_0x2b3b57(0x1d1))/0x3+-parseInt(_0x2b3b57(0x1a0))/0x4*(parseInt(_0x2b3b57(0x1ae))/0x5)+-parseInt(_0x2b3b57(0x1cd))/0x6+-parseInt(_0x2b3b57(0x1ec))/0x7+parseInt(_0x2b3b57(0x1e6))/0x8+parseInt(_0x2b3b57(0x1a1))/0x9;if(_0x2e391f===_0x117af4)break;else _0x303c66['push'](_0x303c66['shift']());}catch(_0x494531){_0x303c66['push'](_0x303c66['shift']());}}}(a27_0x294b,0x5f318));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a27_0x2789(_0x1edf1a,_0x3bb117){const _0x294bad=a27_0x294b();return a27_0x2789=function(_0x278933,_0x3dba43){_0x278933=_0x278933-0x196;let _0x321290=_0x294bad[_0x278933];return _0x321290;},a27_0x2789(_0x1edf1a,_0x3bb117);}export class SegmentDescribeCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x1b8);[a27_0x1b95de(0x1b6)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x1b95de(0x1b4)](_0x5a75af){const _0x55b987=a27_0x1b95de,{options:_0x5e59d1,args:_0xe0e1ea,tdx:_0x2440ba}=_0x5a75af,_0x1a8320=_0xe0e1ea[0x0],_0xe438f6=!_0x1a8320&&!!_0x5e59d1[_0x55b987(0x1d6)],_0x2cdf1b=_0x1a8320||_0x5e59d1[_0x55b987(0x1d6)];if(!_0x2cdf1b)return console[_0x55b987(0x1e2)](_0x55b987(0x1a3)),console[_0x55b987(0x1e2)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x55b987(0x1e2)](_0x55b987(0x1fc)),console[_0x55b987(0x1e2)](_0x55b987(0x1ee)),console[_0x55b987(0x1e2)](_0x55b987(0x1e0)),console[_0x55b987(0x1e2)](_0x55b987(0x1c3)),console[_0x55b987(0x1e2)](_0x55b987(0x208)),0x1;try{const _0x1e2cdd=_0x5e59d1['segmentPath'];let _0x53675e=_0x2cdf1b;!_0xe438f6&&_0x1e2cdd&&!_0x2cdf1b[_0x55b987(0x1a9)]('/')&&(_0x53675e=_0x1e2cdd+'/'+_0x2cdf1b,_0x5e59d1[_0x55b987(0x1dc)]&&console['error'](_0x55b987(0x1c4)+_0x53675e));const _0x4f9317=await withSpinner(_0x55b987(0x207)+_0x53675e+_0x55b987(0x1c8),()=>_0x2440ba['segment'][_0x55b987(0x1da)](_0x53675e),{'verbose':_0x5e59d1[_0x55b987(0x1dc)]}),_0x32df5e=_0x4f9317['data'];_0x5e59d1[_0x55b987(0x1dc)]&&(console[_0x55b987(0x1e2)]('Resolved\x20type:\x20'+_0x32df5e['type']),console['error'](_0x55b987(0x1bb)+_0x32df5e[_0x55b987(0x1c2)]),_0x32df5e['folderId']&&console['error'](_0x55b987(0x1f5)+_0x32df5e['folderId']),_0x32df5e[_0x55b987(0x1c7)]&&console[_0x55b987(0x1e2)](_0x55b987(0x1e5)+_0x32df5e['segmentId']));if(_0x32df5e[_0x55b987(0x1eb)]===_0x55b987(0x1af)){const _0x596dca=await withSpinner(_0x55b987(0x1d4),()=>_0x2440ba[_0x55b987(0x1e3)]['getParent'](_0x32df5e[_0x55b987(0x1c2)]),{'verbose':_0x5e59d1[_0x55b987(0x1dc)]});await handleSingleObjectOutput(_0x596dca[_0x55b987(0x1a6)],_0x5e59d1);}else{if(_0x32df5e[_0x55b987(0x1eb)]===_0x55b987(0x206)){if(!_0x32df5e[_0x55b987(0x209)])throw new SDKError(ErrorCode[_0x55b987(0x1f4)],_0x55b987(0x1e7));const _0x453875=await withSpinner(_0x55b987(0x1c9),()=>_0x2440ba[_0x55b987(0x1e3)][_0x55b987(0x1aa)](_0x32df5e['folderId']),{'verbose':_0x5e59d1['verbose']});await handleSingleObjectOutput(_0x453875[_0x55b987(0x1a6)],_0x5e59d1);}else{if(_0x32df5e[_0x55b987(0x1eb)]===_0x55b987(0x1e3)){if(!_0x32df5e[_0x55b987(0x1c7)])throw new SDKError(ErrorCode[_0x55b987(0x1f4)],_0x55b987(0x201));const _0x4afe6d=await withSpinner(_0x55b987(0x1f7),()=>_0x2440ba[_0x55b987(0x1e3)]['getSegment'](_0x32df5e[_0x55b987(0x1c2)],_0x32df5e[_0x55b987(0x1c7)]),{'verbose':_0x5e59d1[_0x55b987(0x1dc)]});await handleSingleObjectOutput(_0x4afe6d[_0x55b987(0x1a6)],_0x5e59d1);}}}return 0x0;}catch(_0x5d7e71){if(_0x5d7e71 instanceof SDKError)return console['error'](_0x55b987(0x1de)+_0x5d7e71[_0x55b987(0x19a)]),_0x5d7e71[_0x55b987(0x1e8)]&&console[_0x55b987(0x1e2)](_0x55b987(0x1e1)+_0x5d7e71[_0x55b987(0x1e8)]),0x1;throw _0x5d7e71;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x1b2);[a27_0x1b95de(0x1b6)]=a27_0x1b95de(0x1f0);async[a27_0x1b95de(0x1b4)](_0xbf8ccb){const _0x354a6f=a27_0x1b95de,{options:_0x1178e4,args:_0x4d4c44,tdx:_0x5d9b27}=_0xbf8ccb,_0x170c93=_0x4d4c44[0x0],_0x52d927=!_0x170c93&&!!_0x1178e4[_0x354a6f(0x1d6)],_0x96e230=_0x170c93||_0x1178e4[_0x354a6f(0x1d6)];if(!_0x96e230)return console['error'](_0x354a6f(0x1c5)),console[_0x354a6f(0x1e2)](_0x354a6f(0x1c0)),console['error'](_0x354a6f(0x1fc)),console[_0x354a6f(0x1e2)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console[_0x354a6f(0x1e2)](_0x354a6f(0x1a7)),console['error'](_0x354a6f(0x1ac)),console[_0x354a6f(0x1e2)](_0x354a6f(0x208)),0x1;try{const _0xc18811=_0x1178e4['segmentPath'];let _0x48d653=_0x96e230;!_0x52d927&&_0xc18811&&!_0x96e230[_0x354a6f(0x1a9)]('/')&&(_0x48d653=_0xc18811+'/'+_0x96e230,_0x1178e4[_0x354a6f(0x1dc)]&&console['error'](_0x354a6f(0x1c4)+_0x48d653));const _0x26ed36=await withSpinner(_0x354a6f(0x207)+_0x48d653+_0x354a6f(0x1c8),()=>_0x5d9b27['segment']['resolvePathToResource'](_0x48d653),{'verbose':_0x1178e4[_0x354a6f(0x1dc)]}),_0x5cddab=_0x26ed36[_0x354a6f(0x1a6)];_0x1178e4[_0x354a6f(0x1dc)]&&(console[_0x354a6f(0x1e2)](_0x354a6f(0x1b5)+_0x5cddab[_0x354a6f(0x1eb)]),console['error'](_0x354a6f(0x1bb)+_0x5cddab[_0x354a6f(0x1c2)]));if(_0x5cddab[_0x354a6f(0x1eb)]===_0x354a6f(0x206))return console[_0x354a6f(0x1e2)](_0x354a6f(0x19f)),console[_0x354a6f(0x1e2)]('Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;let _0x42033d;if(_0x5cddab[_0x354a6f(0x1eb)]==='parent'){const _0x46aaf8=await withSpinner(_0x354a6f(0x199),()=>_0x5d9b27[_0x354a6f(0x1e3)][_0x354a6f(0x1b1)](_0x5cddab[_0x354a6f(0x1c2)]),{'verbose':_0x1178e4[_0x354a6f(0x1dc)]});_0x42033d=_0x46aaf8[_0x354a6f(0x1a6)];}else{if(!_0x5cddab[_0x354a6f(0x1c7)])throw new SDKError(ErrorCode[_0x354a6f(0x1f4)],_0x354a6f(0x201));const _0xc5263=await withSpinner(_0x354a6f(0x1cb),()=>_0x5d9b27[_0x354a6f(0x1e3)]['getSegmentSQL'](_0x5cddab[_0x354a6f(0x1c2)],_0x5cddab['segmentId']),{'verbose':_0x1178e4[_0x354a6f(0x1dc)]});_0x42033d=_0xc5263[_0x354a6f(0x1a6)];}const _0x54e3d6=resolveLimit(_0x1178e4[_0x354a6f(0x1a4)],DEFAULT_DISPLAY_LIMIT),_0x1c0439=/\bLIMIT\s+\d+/i[_0x354a6f(0x1d3)](_0x42033d);!_0x1c0439&&(_0x42033d=_0x42033d['trim']()['replace'](/;+$/,''),_0x42033d=_0x354a6f(0x19d)+_0x42033d+_0x354a6f(0x1d9)+_0x54e3d6);_0x1178e4['verbose']&&console[_0x354a6f(0x1e2)](_0x354a6f(0x1cf)+_0x42033d);const _0x4daaa2=await withQuerySpinner(_0x354a6f(0x1ef),async _0x5774bb=>{const _0x5529d7=_0x354a6f,_0x586337=await _0x5d9b27[_0x5529d7(0x1c6)][_0x5529d7(0x1b4)](_0x42033d,{'catalog':'td','schema':_0x5529d7(0x202),'onJobId':_0x5cb5c4=>{_0x5774bb['setJobId'](_0x5cb5c4);}});return _0x586337;},{'verbose':_0x1178e4['verbose']}),_0x2b9c44=_0x4daaa2[_0x354a6f(0x1a6)],_0x67bf85=_0x2b9c44[_0x354a6f(0x1cc)]?_0x354a6f(0x198)+_0x2b9c44['jobId']+']':'';return console[_0x354a6f(0x1e2)](_0x354a6f(0x19e)+_0x2b9c44[_0x354a6f(0x20a)]['processedRows']['toLocaleString']()+'\x20rows\x20'+(_0x354a6f(0x1d7)+formatElapsed(_0x2b9c44[_0x354a6f(0x20a)][_0x354a6f(0x1a5)])+_0x67bf85)),await handleQueryOutput(_0x2b9c44,_0x1178e4),0x0;}catch(_0x407cad){if(_0x407cad instanceof SDKError)return console['error'](_0x354a6f(0x1ba)+_0x407cad[_0x354a6f(0x1b7)]+']'),console['error']('\x0a'+_0x407cad['message']),0x1;throw _0x407cad;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x1b95de(0x1c1);[a27_0x1b95de(0x1b6)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a27_0x1b95de(0x1b4)](_0x26d6f5){const _0x4cb6ff=a27_0x1b95de,{options:_0x4d7362,args:_0x57bb22,tdx:_0x53f584}=_0x26d6f5;if(_0x57bb22[_0x4cb6ff(0x1b9)]===0x0)return console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1a8)),console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x20b)),0x1;const _0x34e336=_0x57bb22[0x0];try{_0x4d7362['verbose']&&(console['error'](_0x4cb6ff(0x1be)+_0x4d7362['site']),console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1b0)+_0x34e336));const _0x2e4abc=await withSpinner(_0x4cb6ff(0x1dd)+_0x34e336+'\x27...',()=>_0x53f584['segment']['resolveParentId'](_0x34e336),{'verbose':_0x4d7362[_0x4cb6ff(0x1dc)]}),_0x466f7d=_0x2e4abc[_0x4cb6ff(0x1a6)];_0x4d7362[_0x4cb6ff(0x1dc)]&&console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1f6)+_0x466f7d);const _0x5a2da8=await withSpinner(_0x4cb6ff(0x1d2)+_0x34e336+_0x4cb6ff(0x1c8),()=>_0x53f584['segment']['listFolders'](_0x466f7d),{'verbose':_0x4d7362[_0x4cb6ff(0x1dc)]}),_0x5eecb1=_0x5a2da8[_0x4cb6ff(0x1a6)];return console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1ab)+_0x5eecb1[_0x4cb6ff(0x1b9)]+_0x4cb6ff(0x1fb)+(_0x5eecb1['length']!==0x1?'s':'')),await handleSDKOutput(_0x5eecb1,_0x4d7362),0x0;}catch(_0x23a65c){if(_0x23a65c instanceof SDKError)return console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1de)+_0x23a65c['message']),_0x23a65c[_0x4cb6ff(0x1e8)]&&console[_0x4cb6ff(0x1e2)](_0x4cb6ff(0x1e1)+_0x23a65c[_0x4cb6ff(0x1e8)]),0x1;throw _0x23a65c;}}}function a27_0x294b(){const _0x206e86=['\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20Cause:\x20','error','segment','361748Jrqbxp','Segment\x20ID:\x20','148200SCqpjC','Folder\x20ID\x20missing\x20from\x20resolved\x20path','cause','name','2NYYWUb','type','3887744zDJXQR','getSegmentSQL','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Executing\x20segment\x20query...','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolved\x20parent\x20folder\x20ID:\x20','resolveParentId','log','INTERNAL','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','Fetching\x20segment\x20details...','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Parent\x20segment:\x20','\x20folder','Examples:','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','segment:folder:create','Segment\x20ID\x20missing\x20from\x20resolved\x20path','information_schema','format','Creating\x20folder\x20\x27','resolveFolderId','folder','Resolving\x20path\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','folderId','stats','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Show\x20segment\x20folder\x20details','✔\x20Created\x20folder\x20\x27','\x20[Job\x20ID:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','message','Usage:\x20tdx\x20segment\x20sql\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','4BtCsLP','22925925WCKYBC','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Path\x20or\x20name\x20is\x20required','limit','elapsedTimeMillis','data','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Parent\x20segment\x20name\x20is\x20required','includes','getFolder','✔\x20Found\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolving\x20parent\x20folder\x20\x27','2125915kSFVIS','parent','Parent\x20name:\x20','getParentSQL','segment:show','site','execute','Resolved\x20type:\x20','description','code','segment:describe','length','✖\x20Query\x20failed\x20[','Parent\x20ID:\x20','segmentPath','Resolved\x20folder\x20ID:\x20','Site:\x20','json','Usage:\x20tdx\x20segment\x20show\x20<path>','segment:folder:list','parentId','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','query','segmentId','\x27...','Fetching\x20folder\x20details...','Folder\x20name:\x20','Fetching\x20SQL\x20for\x20segment...','jobId','3041946xipwWp','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','SQL\x20query:\x0a','segment:sql','979872aUqXzw','Listing\x20folders\x20for\x20parent\x20\x27','test','Fetching\x20parent\x20segment\x20details...','Create\x20segment\x20folder\x20for\x20organization','parentSegment','in\x20','segment:folder:show','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','resolvePathToResource','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','verbose','Resolving\x20parent\x20segment\x20\x27','Error:\x20','\x27\x20with\x20ID:\x20'];a27_0x294b=function(){return _0x206e86;};return a27_0x294b();}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x1d8);[a27_0x1b95de(0x1b6)]=a27_0x1b95de(0x196);async[a27_0x1b95de(0x1b4)](_0x126955){const _0xf944af=a27_0x1b95de,{options:_0x107348,args:_0x194d73,tdx:_0x415b7a}=_0x126955;if(_0x194d73[_0xf944af(0x1b9)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0xf944af(0x1e2)](_0xf944af(0x1f8)),0x1;try{const {parentId:_0x3b7d36,childId:_0x366265}=parseSegmentRef(_0x194d73[0x0]);_0x107348[_0xf944af(0x1dc)]&&(console[_0xf944af(0x1e2)]('Site:\x20'+_0x107348[_0xf944af(0x1b3)]),console[_0xf944af(0x1e2)]('Parent\x20name:\x20'+_0x3b7d36),_0x366265&&console[_0xf944af(0x1e2)]('Folder\x20name:\x20'+_0x366265));if(!_0x366265)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x13e282=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3b7d36+_0xf944af(0x1c8),()=>_0x415b7a[_0xf944af(0x1e3)][_0xf944af(0x1f2)](_0x3b7d36),{'verbose':_0x107348['verbose']}),_0x18198a=_0x13e282[_0xf944af(0x1a6)];_0x107348[_0xf944af(0x1dc)]&&console[_0xf944af(0x1e2)]('Resolved\x20parent\x20ID:\x20'+_0x18198a);const _0x4e8fd3=await withSpinner(_0xf944af(0x1fd)+_0x366265+'\x27...',()=>_0x415b7a['segment'][_0xf944af(0x205)](_0x18198a,_0x366265),{'verbose':_0x107348[_0xf944af(0x1dc)]}),_0x4359e4=_0x4e8fd3[_0xf944af(0x1a6)];_0x107348['verbose']&&console['error'](_0xf944af(0x1bd)+_0x4359e4);const _0x3ffd9a=await withSpinner('Fetching\x20folder\x20\x27'+_0x366265+_0xf944af(0x1c8),()=>_0x415b7a[_0xf944af(0x1e3)][_0xf944af(0x1aa)](_0x4359e4),{'verbose':_0x107348['verbose']});return await handleSDKOutput([_0x3ffd9a[_0xf944af(0x1a6)]],_0x107348),0x0;}catch(_0x51ad5e){if(_0x51ad5e instanceof SDKError)return console[_0xf944af(0x1e2)]('Error:\x20'+_0x51ad5e[_0xf944af(0x19a)]),_0x51ad5e['cause']&&console[_0xf944af(0x1e2)]('\x20\x20Cause:\x20'+_0x51ad5e[_0xf944af(0x1e8)]),0x1;throw _0x51ad5e;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x1b95de(0x1d0);[a27_0x1b95de(0x1b6)]=a27_0x1b95de(0x1ce);async[a27_0x1b95de(0x1b4)](_0x34b898){const _0x39bba6=a27_0x1b95de,{options:_0x5ddc86,args:_0x29a07e,tdx:_0xd66bf7}=_0x34b898,_0xa224b=_0x29a07e[0x0],_0x3bccfc=!_0xa224b&&!!_0x5ddc86[_0x39bba6(0x1d6)],_0x7bfaaa=_0xa224b||_0x5ddc86['parentSegment'];if(!_0x7bfaaa)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x39bba6(0x19b)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1fc)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1db)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1a2)),console[_0x39bba6(0x1e2)](_0x39bba6(0x1fe)),console[_0x39bba6(0x1e2)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x28effc=_0x5ddc86[_0x39bba6(0x1bc)];let _0x1537df=_0x7bfaaa;!_0x3bccfc&&_0x28effc&&!_0x7bfaaa[_0x39bba6(0x1a9)]('/')&&(_0x1537df=_0x28effc+'/'+_0x7bfaaa,_0x5ddc86['verbose']&&console['error'](_0x39bba6(0x1c4)+_0x1537df));const _0x273f1c=await withSpinner(_0x39bba6(0x207)+_0x1537df+_0x39bba6(0x1c8),()=>_0xd66bf7[_0x39bba6(0x1e3)][_0x39bba6(0x1da)](_0x1537df),{'verbose':_0x5ddc86[_0x39bba6(0x1dc)]}),_0x4f7a36=_0x273f1c[_0x39bba6(0x1a6)];_0x5ddc86[_0x39bba6(0x1dc)]&&(console[_0x39bba6(0x1e2)](_0x39bba6(0x1b5)+_0x4f7a36[_0x39bba6(0x1eb)]),console['error']('Parent\x20ID:\x20'+_0x4f7a36[_0x39bba6(0x1c2)]));if(_0x4f7a36[_0x39bba6(0x1eb)]===_0x39bba6(0x206))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x39bba6(0x1e2)](_0x39bba6(0x1ff)),0x1;let _0x377513;if(_0x4f7a36['type']==='parent'){const _0x48dbff=await withSpinner(_0x39bba6(0x199),()=>_0xd66bf7[_0x39bba6(0x1e3)][_0x39bba6(0x1b1)](_0x4f7a36['parentId']),{'verbose':_0x5ddc86[_0x39bba6(0x1dc)]});_0x377513=_0x48dbff['data'];}else{if(!_0x4f7a36[_0x39bba6(0x1c7)])throw new SDKError(ErrorCode[_0x39bba6(0x1f4)],_0x39bba6(0x201));const _0x42d6c8=await withSpinner(_0x39bba6(0x1cb),()=>_0xd66bf7[_0x39bba6(0x1e3)][_0x39bba6(0x1ed)](_0x4f7a36[_0x39bba6(0x1c2)],_0x4f7a36['segmentId']),{'verbose':_0x5ddc86['verbose']});_0x377513=_0x42d6c8[_0x39bba6(0x1a6)];}return _0x5ddc86[_0x39bba6(0x203)]===_0x39bba6(0x1bf)||_0x5ddc86[_0x39bba6(0x203)]==='jsonl'?await handleSDKOutput([{'sql':_0x377513}],_0x5ddc86):console[_0x39bba6(0x1f3)](_0x377513),0x0;}catch(_0x2d6124){if(_0x2d6124 instanceof SDKError)return console[_0x39bba6(0x1e2)](_0x39bba6(0x1de)+_0x2d6124[_0x39bba6(0x19a)]),_0x2d6124[_0x39bba6(0x1e8)]&&console[_0x39bba6(0x1e2)](_0x39bba6(0x1e1)+_0x2d6124['cause']),0x1;throw _0x2d6124;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x1b95de(0x1e9)]=a27_0x1b95de(0x200);['description']=a27_0x1b95de(0x1d5);async[a27_0x1b95de(0x1b4)](_0xfa1b4c){const _0x3d5492=a27_0x1b95de,{options:_0x28e156,args:_0x285118,tdx:_0x4d5676}=_0xfa1b4c,_0x233c48=_0x28e156;if(_0x285118[_0x3d5492(0x1b9)]<0x2)return console[_0x3d5492(0x1e2)](_0x3d5492(0x1f9)),console[_0x3d5492(0x1e2)](_0x3d5492(0x19c)),0x1;const _0x20a8c5=_0x285118[0x0],_0x23f18c=_0x285118[0x1];_0x233c48[_0x3d5492(0x1dc)]&&(console['error'](_0x3d5492(0x1be)+_0x233c48[_0x3d5492(0x1b3)]),console[_0x3d5492(0x1e2)](_0x3d5492(0x1fa)+_0x20a8c5),console[_0x3d5492(0x1e2)](_0x3d5492(0x1ca)+_0x23f18c));let _0x49eaa5;if(_0x233c48['parentFolder']){const _0x47d96c=_0x233c48['parentFolder'],_0x3dc76d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x20a8c5+_0x3d5492(0x1c8),()=>_0x4d5676[_0x3d5492(0x1e3)]['resolveParentId'](_0x20a8c5),{'verbose':_0x233c48[_0x3d5492(0x1dc)]}),_0x11990c=_0x3dc76d['data'],_0x57d2be=await withSpinner(_0x3d5492(0x1ad)+_0x47d96c+_0x3d5492(0x1c8),()=>_0x4d5676[_0x3d5492(0x1e3)][_0x3d5492(0x205)](_0x11990c,_0x47d96c),{'verbose':_0x233c48['verbose']});_0x49eaa5=_0x57d2be[_0x3d5492(0x1a6)],_0x233c48['verbose']&&console['error'](_0x3d5492(0x1f1)+_0x49eaa5);}const _0x40ed29={'name':_0x23f18c,'description':_0x233c48['description'],'parentFolderId':_0x49eaa5},_0x526ac4=await withSpinner(_0x3d5492(0x204)+_0x23f18c+_0x3d5492(0x1c8),()=>_0x4d5676[_0x3d5492(0x1e3)]['createFolder'](_0x20a8c5,_0x40ed29),{'verbose':_0x233c48[_0x3d5492(0x1dc)]}),_0x2691e1=_0x526ac4[_0x3d5492(0x1a6)];return console[_0x3d5492(0x1e2)](_0x3d5492(0x197)+_0x2691e1[_0x3d5492(0x1e9)]+_0x3d5492(0x1df)+_0x2691e1['id']),await handleSDKOutput([_0x2691e1],_0x233c48),0x0;}}
1
+ const a27_0x346d48=a27_0x5ebf;(function(_0x140353,_0x58370a){const _0x25f0c2=a27_0x5ebf,_0x16f2cf=_0x140353();while(!![]){try{const _0x3f8712=parseInt(_0x25f0c2(0xab))/0x1*(-parseInt(_0x25f0c2(0xc0))/0x2)+-parseInt(_0x25f0c2(0x92))/0x3+parseInt(_0x25f0c2(0x87))/0x4+-parseInt(_0x25f0c2(0xbf))/0x5+parseInt(_0x25f0c2(0xaa))/0x6*(parseInt(_0x25f0c2(0xd2))/0x7)+parseInt(_0x25f0c2(0x7d))/0x8*(parseInt(_0x25f0c2(0x90))/0x9)+parseInt(_0x25f0c2(0xc9))/0xa*(parseInt(_0x25f0c2(0x97))/0xb);if(_0x3f8712===_0x58370a)break;else _0x16f2cf['push'](_0x16f2cf['shift']());}catch(_0x1f9675){_0x16f2cf['push'](_0x16f2cf['shift']());}}}(a27_0x458a,0x52e18));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a27_0x5ebf(_0x33f159,_0x5c3485){const _0x458af9=a27_0x458a();return a27_0x5ebf=function(_0x5ebfa9,_0x35092d){_0x5ebfa9=_0x5ebfa9-0x66;let _0x1e6a5d=_0x458af9[_0x5ebfa9];return _0x1e6a5d;},a27_0x5ebf(_0x33f159,_0x5c3485);}import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a27_0x346d48(0xc6)]=a27_0x346d48(0x6c);[a27_0x346d48(0xbc)]=a27_0x346d48(0xc7);async[a27_0x346d48(0xd4)](_0x57bc80){const _0x4a9776=a27_0x346d48,{options:_0x30b7c3,args:_0x5d1c62,tdx:_0x5e1fc3}=_0x57bc80,_0xfe3e4b=_0x5d1c62[0x0],_0x2ce4ff=!_0xfe3e4b&&!!_0x30b7c3[_0x4a9776(0x70)],_0x3fb083=_0xfe3e4b||_0x30b7c3['parentSegment'];if(!_0x3fb083)return console[_0x4a9776(0xd5)](_0x4a9776(0x6b)),console['error'](_0x4a9776(0x72)),console[_0x4a9776(0xd5)](_0x4a9776(0x8b)),console[_0x4a9776(0xd5)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x4a9776(0xd5)](_0x4a9776(0x94)),console[_0x4a9776(0xd5)](_0x4a9776(0xdd)),console[_0x4a9776(0xd5)](_0x4a9776(0xce)),0x1;try{const _0x182a3a=_0x30b7c3[_0x4a9776(0x9e)];let _0x358fdc=_0x3fb083;!_0x2ce4ff&&_0x182a3a&&!_0x3fb083[_0x4a9776(0xa7)]('/')&&(_0x358fdc=_0x182a3a+'/'+_0x3fb083,_0x30b7c3[_0x4a9776(0x81)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x358fdc));const _0x5e000b=await withSpinner(_0x4a9776(0xc8)+_0x358fdc+_0x4a9776(0x73),()=>_0x5e1fc3[_0x4a9776(0x9d)]['resolvePathToResource'](_0x358fdc),{'verbose':_0x30b7c3[_0x4a9776(0x81)]}),_0xd52b84=_0x5e000b[_0x4a9776(0xc5)];_0x30b7c3[_0x4a9776(0x81)]&&(console[_0x4a9776(0xd5)](_0x4a9776(0x8e)+_0xd52b84[_0x4a9776(0x98)]),console[_0x4a9776(0xd5)](_0x4a9776(0x77)+_0xd52b84[_0x4a9776(0x7b)]),_0xd52b84[_0x4a9776(0x99)]&&console[_0x4a9776(0xd5)](_0x4a9776(0xda)+_0xd52b84[_0x4a9776(0x99)]),_0xd52b84[_0x4a9776(0x9a)]&&console[_0x4a9776(0xd5)]('Segment\x20ID:\x20'+_0xd52b84[_0x4a9776(0x9a)]));if(_0xd52b84['type']===_0x4a9776(0xa4)){const _0x341487=await withSpinner(_0x4a9776(0xb6),()=>_0x5e1fc3[_0x4a9776(0x9d)]['getParent'](_0xd52b84[_0x4a9776(0x7b)]),{'verbose':_0x30b7c3['verbose']});await handleSingleObjectOutput(_0x341487[_0x4a9776(0xc5)],_0x30b7c3);}else{if(_0xd52b84[_0x4a9776(0x98)]==='folder'){if(!_0xd52b84[_0x4a9776(0x99)])throw new SDKError(ErrorCode[_0x4a9776(0xba)],_0x4a9776(0x76));const _0x54bf2f=await withSpinner(_0x4a9776(0x79),()=>_0x5e1fc3[_0x4a9776(0x9d)][_0x4a9776(0x6f)](_0xd52b84[_0x4a9776(0x99)]),{'verbose':_0x30b7c3['verbose']});await handleSingleObjectOutput(_0x54bf2f[_0x4a9776(0xc5)],_0x30b7c3);}else{if(_0xd52b84[_0x4a9776(0x98)]===_0x4a9776(0x9d)){if(!_0xd52b84[_0x4a9776(0x9a)])throw new SDKError(ErrorCode[_0x4a9776(0xba)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x55662c=await withSpinner(_0x4a9776(0x83),()=>_0x5e1fc3[_0x4a9776(0x9d)][_0x4a9776(0xb7)](_0xd52b84['parentId'],_0xd52b84[_0x4a9776(0x9a)]),{'verbose':_0x30b7c3[_0x4a9776(0x81)]});await handleSingleObjectOutput(_0x55662c[_0x4a9776(0xc5)],_0x30b7c3);}}}return 0x0;}catch(_0x5e8268){if(_0x5e8268 instanceof SDKError)return console[_0x4a9776(0xd5)](_0x4a9776(0xc1)+_0x5e8268[_0x4a9776(0xb9)]),_0x5e8268['cause']&&console[_0x4a9776(0xd5)](_0x4a9776(0x9c)+_0x5e8268[_0x4a9776(0x7c)]),0x1;throw _0x5e8268;}}}export class SegmentShowCommand extends BaseCommand{['name']=a27_0x346d48(0xaf);['description']=a27_0x346d48(0x8f);async['execute'](_0x41a087){const _0x2f8631=a27_0x346d48,{options:_0x561a70,args:_0x515030,tdx:_0xcfb28b}=_0x41a087,_0x3968e0=_0x515030[0x0],_0x3c8b4c=!_0x3968e0&&!!_0x561a70[_0x2f8631(0x70)],_0x21eae7=_0x3968e0||_0x561a70[_0x2f8631(0x70)];if(!_0x21eae7)return console[_0x2f8631(0xd5)](_0x2f8631(0xa1)),console[_0x2f8631(0xd5)](_0x2f8631(0xb1)),console['error'](_0x2f8631(0x8b)),console[_0x2f8631(0xd5)](_0x2f8631(0xd9)),console[_0x2f8631(0xd5)](_0x2f8631(0x9f)),console[_0x2f8631(0xd5)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x2f8631(0xd5)](_0x2f8631(0xce)),0x1;try{const _0x53efcb=_0x561a70[_0x2f8631(0x9e)];let _0x5ec0cd=_0x21eae7;!_0x3c8b4c&&_0x53efcb&&!_0x21eae7['includes']('/')&&(_0x5ec0cd=_0x53efcb+'/'+_0x21eae7,_0x561a70['verbose']&&console[_0x2f8631(0xd5)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5ec0cd));const _0x4cb56d=await withSpinner(_0x2f8631(0xc8)+_0x5ec0cd+_0x2f8631(0x73),()=>_0xcfb28b[_0x2f8631(0x9d)][_0x2f8631(0x91)](_0x5ec0cd),{'verbose':_0x561a70['verbose']}),_0x532f49=_0x4cb56d[_0x2f8631(0xc5)];_0x561a70[_0x2f8631(0x81)]&&(console[_0x2f8631(0xd5)]('Resolved\x20type:\x20'+_0x532f49[_0x2f8631(0x98)]),console[_0x2f8631(0xd5)]('Parent\x20ID:\x20'+_0x532f49[_0x2f8631(0x7b)]));if(_0x532f49[_0x2f8631(0x98)]==='folder')return console[_0x2f8631(0xd5)](_0x2f8631(0xb5)),console[_0x2f8631(0xd5)](_0x2f8631(0xd0)),0x1;let _0x1db695;if(_0x532f49[_0x2f8631(0x98)]===_0x2f8631(0xa4)){const _0x38d8ee=await withSpinner(_0x2f8631(0x71),()=>_0xcfb28b[_0x2f8631(0x9d)]['getParentSQL'](_0x532f49[_0x2f8631(0x7b)]),{'verbose':_0x561a70[_0x2f8631(0x81)]});_0x1db695=_0x38d8ee[_0x2f8631(0xc5)];}else{if(!_0x532f49[_0x2f8631(0x9a)])throw new SDKError(ErrorCode['INTERNAL'],_0x2f8631(0xbd));const _0x3e26fa=await withSpinner(_0x2f8631(0x85),()=>_0xcfb28b[_0x2f8631(0x9d)][_0x2f8631(0x68)](_0x532f49['parentId'],_0x532f49[_0x2f8631(0x9a)]),{'verbose':_0x561a70[_0x2f8631(0x81)]});_0x1db695=_0x3e26fa['data'];}const _0x4d07ba=resolveLimit(_0x561a70[_0x2f8631(0x7f)],DEFAULT_DISPLAY_LIMIT),_0x2129e1=/\bLIMIT\s+\d+/i[_0x2f8631(0xcf)](_0x1db695);!_0x2129e1&&(_0x1db695=_0x1db695[_0x2f8631(0xcc)]()[_0x2f8631(0xa0)](/;+$/,''),_0x1db695=_0x2f8631(0xbb)+_0x1db695+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x4d07ba);_0x561a70['verbose']&&console[_0x2f8631(0xd5)](_0x2f8631(0xde)+_0x1db695);const _0x10a69e=await withQuerySpinner(_0x2f8631(0xad),async _0x22609d=>{const _0x2eb307=_0x2f8631,_0x599426=await _0xcfb28b['query'][_0x2eb307(0xd4)](_0x1db695,{'catalog':'td','schema':_0x2eb307(0x66),'onJobId':_0xd0eb52=>{const _0x24fe40=_0x2eb307;_0x22609d[_0x24fe40(0xb0)](_0xd0eb52);}});return _0x599426;},{'verbose':_0x561a70[_0x2f8631(0x81)]}),_0x3c21d5=_0x10a69e['data'],_0x13f79c=_0x3c21d5[_0x2f8631(0xa9)]?_0x2f8631(0x69)+_0x3c21d5[_0x2f8631(0xa9)]+']':'';return console[_0x2f8631(0xd5)](_0x2f8631(0x89)+_0x3c21d5[_0x2f8631(0xdb)][_0x2f8631(0xd6)]['toLocaleString']()+_0x2f8631(0xdf)+(_0x2f8631(0xd7)+formatElapsed(_0x3c21d5[_0x2f8631(0xdb)][_0x2f8631(0xb3)])+_0x13f79c)),await handleQueryOutput(_0x3c21d5,_0x561a70),0x0;}catch(_0x5ea1e9){if(_0x5ea1e9 instanceof SDKError)return console[_0x2f8631(0xd5)](_0x2f8631(0x75)+_0x5ea1e9[_0x2f8631(0xa8)]+']'),console['error']('\x0a'+_0x5ea1e9['message']),0x1;throw _0x5ea1e9;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x346d48(0xc6)]=a27_0x346d48(0xae);[a27_0x346d48(0xbc)]=a27_0x346d48(0x6a);async['execute'](_0x28e1bd){const _0xce8971=a27_0x346d48,{options:_0x51b684,args:_0x2f17d4,tdx:_0x2d405c}=_0x28e1bd;if(_0x2f17d4[_0xce8971(0x9b)]===0x0)return console[_0xce8971(0xd5)](_0xce8971(0x80)),console[_0xce8971(0xd5)](_0xce8971(0xb8)),0x1;const _0x4861ad=_0x2f17d4[0x0];try{_0x51b684[_0xce8971(0x81)]&&(console[_0xce8971(0xd5)]('Site:\x20'+_0x51b684['site']),console[_0xce8971(0xd5)](_0xce8971(0xbe)+_0x4861ad));const _0x5abe75=await withSpinner(_0xce8971(0xa2)+_0x4861ad+_0xce8971(0x73),()=>_0x2d405c[_0xce8971(0x9d)][_0xce8971(0xb4)](_0x4861ad),{'verbose':_0x51b684[_0xce8971(0x81)]}),_0x5969fb=_0x5abe75['data'];_0x51b684[_0xce8971(0x81)]&&console[_0xce8971(0xd5)]('Resolved\x20parent\x20ID:\x20'+_0x5969fb);const _0x494988=await withSpinner(_0xce8971(0x8a)+_0x4861ad+'\x27...',()=>_0x2d405c[_0xce8971(0x9d)][_0xce8971(0x96)](_0x5969fb),{'verbose':_0x51b684['verbose']}),_0x43ddcf=_0x494988[_0xce8971(0xc5)];return console[_0xce8971(0xd5)]('✔\x20Found\x20'+_0x43ddcf[_0xce8971(0x9b)]+'\x20folder'+(_0x43ddcf[_0xce8971(0x9b)]!==0x1?'s':'')),await handleSDKOutput(_0x43ddcf,_0x51b684),0x0;}catch(_0x8afdfa){if(_0x8afdfa instanceof SDKError)return console[_0xce8971(0xd5)](_0xce8971(0xc1)+_0x8afdfa[_0xce8971(0xb9)]),_0x8afdfa['cause']&&console[_0xce8971(0xd5)](_0xce8971(0x9c)+_0x8afdfa[_0xce8971(0x7c)]),0x1;throw _0x8afdfa;}}}function a27_0x458a(){const _0x2b7163=['Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Fetching\x20parent\x20segment\x20details...','getSegment','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','message','INTERNAL','SELECT\x20*\x20FROM\x20(\x0a','description','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20name:\x20','2954385awQBif','416HcLAJk','Error:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolving\x20parent\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','data','name','Show\x20segment\x20or\x20folder\x20details','Resolving\x20path\x20\x27','745100dImXcj','✔\x20Created\x20folder\x20\x27','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','trim','json','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','test','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Resolved\x20parent\x20folder\x20ID:\x20','105PBLMGc','createFolder','execute','error','processedRows','in\x20','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Folder\x20ID:\x20','stats','folder','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SQL\x20query:\x0a','\x20rows\x20','segment:folder:create','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','information_schema','Error:\x20Folder\x20reference\x20is\x20required','getSegmentSQL','\x20[Job\x20ID:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Path\x20or\x20name\x20is\x20required','segment:describe','Creating\x20folder\x20\x27','format','getFolder','parentSegment','Fetching\x20SQL\x20for\x20parent\x20segment...','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x27...','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','✖\x20Query\x20failed\x20[','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20ID:\x20','\x27\x20with\x20ID:\x20','Fetching\x20folder\x20details...','resolveFolderId','parentId','cause','24WlLXNi','Resolved\x20parent\x20ID:\x20','limit','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','Create\x20segment\x20folder\x20for\x20organization','Fetching\x20segment\x20details...','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Fetching\x20SQL\x20for\x20segment...','Folder\x20name:\x20','407816INvLak','segment:folder:show','✔\x20Query\x20completed:\x20Processed\x20','Listing\x20folders\x20for\x20parent\x20\x27','Examples:','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','getParentSQL','Resolved\x20type:\x20','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','1803096FLfyAy','resolvePathToResource','1991343NDrdyr','parentFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Parent\x20segment:\x20','listFolders','121dMljpn','type','folderId','segmentId','length','\x20\x20Cause:\x20','segment','segmentPath','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','replace','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20parent\x20segment\x20\x27','site','parent','Show\x20segment\x20folder\x20details','segment:sql','includes','code','jobId','64476CoWOCT','431tGkJNg','Fetching\x20folder\x20\x27','Executing\x20segment\x20query...','segment:folder:list','segment:show','setJobId','Usage:\x20tdx\x20segment\x20show\x20<path>','Resolved\x20relative\x20path\x20to:\x20','elapsedTimeMillis','resolveParentId'];a27_0x458a=function(){return _0x2b7163;};return a27_0x458a();}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x346d48(0xc6)]=a27_0x346d48(0x88);[a27_0x346d48(0xbc)]=a27_0x346d48(0xa5);async[a27_0x346d48(0xd4)](_0x81b45d){const _0x560aa4=a27_0x346d48,{options:_0x22bcc5,args:_0x182a00,tdx:_0xde93d4}=_0x81b45d;if(_0x182a00[_0x560aa4(0x9b)]===0x0)return console[_0x560aa4(0xd5)](_0x560aa4(0x67)),console[_0x560aa4(0xd5)](_0x560aa4(0xe1)),0x1;try{const {parentId:_0x1ea0e4,childId:_0x7e6b6f}=parseSegmentRef(_0x182a00[0x0]);_0x22bcc5[_0x560aa4(0x81)]&&(console[_0x560aa4(0xd5)](_0x560aa4(0xd8)+_0x22bcc5[_0x560aa4(0xa3)]),console[_0x560aa4(0xd5)]('Parent\x20name:\x20'+_0x1ea0e4),_0x7e6b6f&&console[_0x560aa4(0xd5)]('Folder\x20name:\x20'+_0x7e6b6f));if(!_0x7e6b6f)return console[_0x560aa4(0xd5)](_0x560aa4(0xcb)),0x1;const _0x412004=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1ea0e4+'\x27...',()=>_0xde93d4[_0x560aa4(0x9d)][_0x560aa4(0xb4)](_0x1ea0e4),{'verbose':_0x22bcc5[_0x560aa4(0x81)]}),_0x27ecc7=_0x412004[_0x560aa4(0xc5)];_0x22bcc5[_0x560aa4(0x81)]&&console[_0x560aa4(0xd5)](_0x560aa4(0x7e)+_0x27ecc7);const _0x65b5ea=await withSpinner('Resolving\x20folder\x20\x27'+_0x7e6b6f+_0x560aa4(0x73),()=>_0xde93d4['segment']['resolveFolderId'](_0x27ecc7,_0x7e6b6f),{'verbose':_0x22bcc5[_0x560aa4(0x81)]}),_0x20b941=_0x65b5ea[_0x560aa4(0xc5)];_0x22bcc5[_0x560aa4(0x81)]&&console[_0x560aa4(0xd5)]('Resolved\x20folder\x20ID:\x20'+_0x20b941);const _0x52b605=await withSpinner(_0x560aa4(0xac)+_0x7e6b6f+_0x560aa4(0x73),()=>_0xde93d4['segment'][_0x560aa4(0x6f)](_0x20b941),{'verbose':_0x22bcc5[_0x560aa4(0x81)]});return await handleSDKOutput([_0x52b605[_0x560aa4(0xc5)]],_0x22bcc5),0x0;}catch(_0x1e1709){if(_0x1e1709 instanceof SDKError)return console[_0x560aa4(0xd5)]('Error:\x20'+_0x1e1709['message']),_0x1e1709[_0x560aa4(0x7c)]&&console[_0x560aa4(0xd5)]('\x20\x20Cause:\x20'+_0x1e1709[_0x560aa4(0x7c)]),0x1;throw _0x1e1709;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x346d48(0xc6)]=a27_0x346d48(0xa6);[a27_0x346d48(0xbc)]='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async[a27_0x346d48(0xd4)](_0x49e084){const _0x1fd27f=a27_0x346d48,{options:_0x5e05cd,args:_0x1de545,tdx:_0x49cf35}=_0x49e084,_0x4d6bb9=_0x1de545[0x0],_0x4b09c0=!_0x4d6bb9&&!!_0x5e05cd[_0x1fd27f(0x70)],_0x39ab8a=_0x4d6bb9||_0x5e05cd[_0x1fd27f(0x70)];if(!_0x39ab8a)return console[_0x1fd27f(0xd5)](_0x1fd27f(0xa1)),console[_0x1fd27f(0xd5)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x1fd27f(0xd5)](_0x1fd27f(0x8b)),console['error']('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x1fd27f(0xd5)](_0x1fd27f(0x84)),console[_0x1fd27f(0xd5)](_0x1fd27f(0x8c)),console[_0x1fd27f(0xd5)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x1a52d5=_0x5e05cd['segmentPath'];let _0x2ab03c=_0x39ab8a;!_0x4b09c0&&_0x1a52d5&&!_0x39ab8a['includes']('/')&&(_0x2ab03c=_0x1a52d5+'/'+_0x39ab8a,_0x5e05cd['verbose']&&console[_0x1fd27f(0xd5)](_0x1fd27f(0xb2)+_0x2ab03c));const _0x2a229e=await withSpinner('Resolving\x20path\x20\x27'+_0x2ab03c+_0x1fd27f(0x73),()=>_0x49cf35[_0x1fd27f(0x9d)][_0x1fd27f(0x91)](_0x2ab03c),{'verbose':_0x5e05cd[_0x1fd27f(0x81)]}),_0x11a148=_0x2a229e[_0x1fd27f(0xc5)];_0x5e05cd[_0x1fd27f(0x81)]&&(console['error'](_0x1fd27f(0x8e)+_0x11a148[_0x1fd27f(0x98)]),console[_0x1fd27f(0xd5)]('Parent\x20ID:\x20'+_0x11a148['parentId']));if(_0x11a148[_0x1fd27f(0x98)]===_0x1fd27f(0xdc))return console[_0x1fd27f(0xd5)](_0x1fd27f(0xc2)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;let _0x48505a;if(_0x11a148[_0x1fd27f(0x98)]===_0x1fd27f(0xa4)){const _0x4fd675=await withSpinner(_0x1fd27f(0x71),()=>_0x49cf35[_0x1fd27f(0x9d)][_0x1fd27f(0x8d)](_0x11a148[_0x1fd27f(0x7b)]),{'verbose':_0x5e05cd[_0x1fd27f(0x81)]});_0x48505a=_0x4fd675[_0x1fd27f(0xc5)];}else{if(!_0x11a148[_0x1fd27f(0x9a)])throw new SDKError(ErrorCode[_0x1fd27f(0xba)],_0x1fd27f(0xbd));const _0x163d2f=await withSpinner(_0x1fd27f(0x85),()=>_0x49cf35[_0x1fd27f(0x9d)][_0x1fd27f(0x68)](_0x11a148[_0x1fd27f(0x7b)],_0x11a148[_0x1fd27f(0x9a)]),{'verbose':_0x5e05cd[_0x1fd27f(0x81)]});_0x48505a=_0x163d2f[_0x1fd27f(0xc5)];}return _0x5e05cd[_0x1fd27f(0x6e)]===_0x1fd27f(0xcd)||_0x5e05cd[_0x1fd27f(0x6e)]==='jsonl'?await handleSDKOutput([{'sql':_0x48505a}],_0x5e05cd):console['log'](_0x48505a),0x0;}catch(_0x47d6e8){if(_0x47d6e8 instanceof SDKError)return console[_0x1fd27f(0xd5)]('Error:\x20'+_0x47d6e8[_0x1fd27f(0xb9)]),_0x47d6e8['cause']&&console['error'](_0x1fd27f(0x9c)+_0x47d6e8[_0x1fd27f(0x7c)]),0x1;throw _0x47d6e8;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x346d48(0xc6)]=a27_0x346d48(0xe0);[a27_0x346d48(0xbc)]=a27_0x346d48(0x82);async['execute'](_0x415455){const _0x58a052=a27_0x346d48,{options:_0x3166d5,args:_0xca339b,tdx:_0x5ba97a}=_0x415455,_0x1bc370=_0x3166d5;if(_0xca339b[_0x58a052(0x9b)]<0x2)return console['error'](_0x58a052(0xc4)),console[_0x58a052(0xd5)](_0x58a052(0x74)),0x1;const _0x596097=_0xca339b[0x0],_0x22b423=_0xca339b[0x1];_0x1bc370[_0x58a052(0x81)]&&(console['error'](_0x58a052(0xd8)+_0x1bc370[_0x58a052(0xa3)]),console[_0x58a052(0xd5)](_0x58a052(0x95)+_0x596097),console['error'](_0x58a052(0x86)+_0x22b423));let _0x1b47ae;if(_0x1bc370[_0x58a052(0x93)]){const _0x5a005e=_0x1bc370[_0x58a052(0x93)],_0x3ec5bc=await withSpinner(_0x58a052(0xa2)+_0x596097+_0x58a052(0x73),()=>_0x5ba97a[_0x58a052(0x9d)][_0x58a052(0xb4)](_0x596097),{'verbose':_0x1bc370[_0x58a052(0x81)]}),_0x119479=_0x3ec5bc[_0x58a052(0xc5)],_0x431b2a=await withSpinner(_0x58a052(0xc3)+_0x5a005e+_0x58a052(0x73),()=>_0x5ba97a[_0x58a052(0x9d)][_0x58a052(0x7a)](_0x119479,_0x5a005e),{'verbose':_0x1bc370['verbose']});_0x1b47ae=_0x431b2a['data'],_0x1bc370[_0x58a052(0x81)]&&console[_0x58a052(0xd5)](_0x58a052(0xd1)+_0x1b47ae);}const _0x1e958c={'name':_0x22b423,'description':_0x1bc370[_0x58a052(0xbc)],'parentFolderId':_0x1b47ae},_0x32aa7a=await withSpinner(_0x58a052(0x6d)+_0x22b423+_0x58a052(0x73),()=>_0x5ba97a[_0x58a052(0x9d)][_0x58a052(0xd3)](_0x596097,_0x1e958c),{'verbose':_0x1bc370[_0x58a052(0x81)]}),_0x34023d=_0x32aa7a['data'];return console[_0x58a052(0xd5)](_0x58a052(0xca)+_0x34023d[_0x58a052(0xc6)]+_0x58a052(0x78)+_0x34023d['id']),await handleSDKOutput([_0x34023d],_0x1bc370),0x0;}}
@@ -1 +1 @@
1
- const a28_0x590336=a28_0xceb6;function a28_0x104b(){const _0x485f3b=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','resolveParentId','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','1tzgoIQ','Creating\x20segment\x20\x27','description','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1093560esjJFD','4642740kEVyQL','ruleFile','verbose','createSegment','resolveFolderId','execute','data','Examples:','355ItVBUu','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20folder\x20ID:\x20','Segment\x20name:\x20','10820oAlrZy','segments','Resolving\x20parent\x20segment\x20\x27','Resolving\x20folder\x20path\x20\x27','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','2064755zljvQp','15qorRcx','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Parent\x20path:\x20','length','invisible','segment:create','parent','Resolving\x20folder\x20\x27','segment','24FGzRhS','includes','\x27...','resolvePathToResource','name','kind','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','noCountPopulation','965570brYETQ','folder','Parent:\x20','Target\x20path:\x20','8426GaVPnd','error','250552UosoJk','23982uTSQCp','folderId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x27\x20with\x20ID:\x20','\x20\x20\x20Path:\x20','rule','8Jwsuva','type','site','Resolved\x20relative\x20path\x20to:\x20','segmentPath'];a28_0x104b=function(){return _0x485f3b;};return a28_0x104b();}(function(_0x1582a5,_0x653196){const _0x4e7c84=a28_0xceb6,_0x1f1ba1=_0x1582a5();while(!![]){try{const _0x5e4dd9=parseInt(_0x4e7c84(0x122))/0x1*(parseInt(_0x4e7c84(0x10d))/0x2)+-parseInt(_0x4e7c84(0x139))/0x3*(-parseInt(_0x4e7c84(0x113))/0x4)+-parseInt(_0x4e7c84(0x12f))/0x5*(parseInt(_0x4e7c84(0x114))/0x6)+parseInt(_0x4e7c84(0x138))/0x7+-parseInt(_0x4e7c84(0x11a))/0x8*(-parseInt(_0x4e7c84(0x127))/0x9)+-parseInt(_0x4e7c84(0x133))/0xa*(parseInt(_0x4e7c84(0x111))/0xb)+-parseInt(_0x4e7c84(0x104))/0xc*(-parseInt(_0x4e7c84(0x126))/0xd);if(_0x5e4dd9===_0x653196)break;else _0x1f1ba1['push'](_0x1f1ba1['shift']());}catch(_0x115591){_0x1f1ba1['push'](_0x1f1ba1['shift']());}}}(a28_0x104b,0xa1ba9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a28_0xceb6(_0x46c348,_0x11b968){const _0x104b64=a28_0x104b();return a28_0xceb6=function(_0xceb6a0,_0x4f019c){_0xceb6a0=_0xceb6a0-0xfd;let _0x550338=_0x104b64[_0xceb6a0];return _0x550338;},a28_0xceb6(_0x46c348,_0x11b968);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']=a28_0x590336(0x100);[a28_0x590336(0x124)]=a28_0x590336(0x130);async[a28_0x590336(0x12c)](_0x291282){const _0x147e8c=a28_0x590336,{options:_0x4809aa,args:_0x128da6,tdx:_0x4dce54}=_0x291282,_0x2681d9=_0x4809aa;if(_0x128da6[_0x147e8c(0xfe)]===0x0)return console[_0x147e8c(0x112)](_0x147e8c(0x10b)),console[_0x147e8c(0x112)](_0x147e8c(0x10a)),console[_0x147e8c(0x112)](_0x147e8c(0x12e)),console[_0x147e8c(0x112)](_0x147e8c(0x13a)),console[_0x147e8c(0x112)](_0x147e8c(0x11f)),console[_0x147e8c(0x112)](_0x147e8c(0x125)),0x1;const _0x544c0b=_0x128da6[0x0],_0xc66312=_0x4809aa[_0x147e8c(0x11e)];let _0x18663f=_0x544c0b;_0xc66312&&!_0x544c0b[_0x147e8c(0x105)]('/')&&(_0x18663f=_0xc66312+'/'+_0x544c0b,_0x2681d9['verbose']&&console[_0x147e8c(0x112)](_0x147e8c(0x11d)+_0x18663f));const _0x286e5e=parsePath(_0x18663f);if(_0x286e5e[_0x147e8c(0x134)][_0x147e8c(0xfe)]<0x2)return console[_0x147e8c(0x112)](_0x147e8c(0x137)),console[_0x147e8c(0x112)](_0x147e8c(0x121)),0x1;const _0x3637fc=_0x286e5e['segments'][0x0],_0x48f861=getBaseName(_0x18663f),_0x37f58a=getParentPath(_0x18663f);_0x2681d9[_0x147e8c(0x129)]&&(console['error']('Site:\x20'+_0x2681d9[_0x147e8c(0x11c)]),console[_0x147e8c(0x112)](_0x147e8c(0x110)+_0x18663f),console[_0x147e8c(0x112)](_0x147e8c(0x10f)+_0x3637fc),console[_0x147e8c(0x112)](_0x147e8c(0x132)+_0x48f861),console[_0x147e8c(0x112)](_0x147e8c(0xfd)+_0x37f58a));const _0x583350=await withSpinner(_0x147e8c(0x135)+_0x3637fc+_0x147e8c(0x106),()=>_0x4dce54[_0x147e8c(0x103)][_0x147e8c(0x120)](_0x3637fc),{'verbose':_0x2681d9[_0x147e8c(0x129)]}),_0x3e76ba=_0x583350[_0x147e8c(0x12d)];let _0xb1667b;if(_0x286e5e['segments'][_0x147e8c(0xfe)]>0x2){const _0x4c14dd=await withSpinner(_0x147e8c(0x136)+_0x37f58a+_0x147e8c(0x106),()=>_0x4dce54['segment'][_0x147e8c(0x107)](_0x37f58a),{'verbose':_0x2681d9[_0x147e8c(0x129)]}),_0x48e5e7=_0x4c14dd[_0x147e8c(0x12d)];if(_0x48e5e7[_0x147e8c(0x11b)]!==_0x147e8c(0x10e)&&_0x48e5e7[_0x147e8c(0x11b)]!==_0x147e8c(0x101))return console[_0x147e8c(0x112)](_0x147e8c(0x116)),0x1;_0xb1667b=_0x48e5e7[_0x147e8c(0x115)];}else{if(_0x2681d9[_0x147e8c(0x10e)]){const _0x8c5024=await withSpinner(_0x147e8c(0x102)+_0x2681d9['folder']+_0x147e8c(0x106),()=>_0x4dce54[_0x147e8c(0x103)][_0x147e8c(0x12b)](_0x3e76ba,_0x2681d9[_0x147e8c(0x10e)]),{'verbose':_0x2681d9[_0x147e8c(0x129)]});_0xb1667b=_0x8c5024[_0x147e8c(0x12d)];}}_0x2681d9[_0x147e8c(0x129)]&&_0xb1667b&&console['error'](_0x147e8c(0x131)+_0xb1667b);const _0xc7867b=await loadJSONFromOptions(_0x2681d9[_0x147e8c(0x119)],_0x2681d9[_0x147e8c(0x128)]),_0xcfcbd9={'name':_0x48f861,'description':_0x2681d9['description'],'rule':_0xc7867b,'kind':_0x2681d9[_0x147e8c(0x109)]!==undefined?parseInt(_0x2681d9[_0x147e8c(0x109)],0xa):undefined,'isVisible':_0x2681d9[_0x147e8c(0xff)]?![]:undefined,'segmentFolderId':_0xb1667b,'countPopulation':_0x2681d9[_0x147e8c(0x10c)]?![]:undefined},_0x507fb3=await withSpinner(_0x147e8c(0x123)+_0x48f861+_0x147e8c(0x106),()=>_0x4dce54[_0x147e8c(0x103)][_0x147e8c(0x12a)](_0x3e76ba,_0xcfcbd9),{'verbose':_0x2681d9[_0x147e8c(0x129)]}),_0x33bcb5=_0x507fb3['data'];return console['error']('✔\x20Created\x20segment\x20\x27'+_0x33bcb5[_0x147e8c(0x108)]+_0x147e8c(0x117)+_0x33bcb5['id']),_0x18663f!==_0x544c0b&&console[_0x147e8c(0x112)](_0x147e8c(0x118)+_0x18663f),await handleSDKOutput([_0x33bcb5],_0x2681d9),0x0;}}
1
+ const a28_0x210e68=a28_0x2802;(function(_0x42c7c2,_0x44d38b){const _0x1cad14=a28_0x2802,_0x1224c5=_0x42c7c2();while(!![]){try{const _0x1aa452=-parseInt(_0x1cad14(0x104))/0x1*(-parseInt(_0x1cad14(0x123))/0x2)+-parseInt(_0x1cad14(0x119))/0x3+-parseInt(_0x1cad14(0x10e))/0x4*(-parseInt(_0x1cad14(0x120))/0x5)+parseInt(_0x1cad14(0x108))/0x6*(parseInt(_0x1cad14(0x124))/0x7)+parseInt(_0x1cad14(0x116))/0x8*(parseInt(_0x1cad14(0x130))/0x9)+-parseInt(_0x1cad14(0x103))/0xa+-parseInt(_0x1cad14(0x100))/0xb;if(_0x1aa452===_0x44d38b)break;else _0x1224c5['push'](_0x1224c5['shift']());}catch(_0x1ad199){_0x1224c5['push'](_0x1224c5['shift']());}}}(a28_0x3874,0x69475));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a28_0x2802(_0x3667d1,_0x3ae104){const _0x38746c=a28_0x3874();return a28_0x2802=function(_0x2802ca,_0x16aa86){_0x2802ca=_0x2802ca-0x100;let _0x18fa3b=_0x38746c[_0x2802ca];return _0x18fa3b;},a28_0x2802(_0x3667d1,_0x3ae104);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a28_0x3874(){const _0x5eeb8f=['6CgoaUV','Creating\x20segment\x20\x27','folder','✔\x20Created\x20segment\x20\x27','resolveParentId','kind','12MPkZLv','type','Resolving\x20parent\x20segment\x20\x27','error','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Parent\x20path:\x20','resolvePathToResource','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','4183120qgdnHx','Create\x20child\x20segment\x20with\x20filtering\x20rules','\x20\x20\x20Path:\x20','1150722ZMyIoK','Resolving\x20folder\x20\x27','segment:create','includes','segments','\x27...','ruleFile','195955HiEbXq','Resolving\x20folder\x20path\x20\x27','Parent:\x20','36814pMJhJf','5835151LwbAIK','description','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','site','noCountPopulation','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','data','Site:\x20','name','length','Examples:','\x27\x20with\x20ID:\x20','9IqGJWh','segment','execute','11410388hKbAwK','parent','verbose','1005350mwTjJW','26UUkyup','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Target\x20path:\x20'];a28_0x3874=function(){return _0x5eeb8f;};return a28_0x3874();}export class SegmentCreateCommand extends BaseCommand{[a28_0x210e68(0x12c)]=a28_0x210e68(0x11b);[a28_0x210e68(0x125)]=a28_0x210e68(0x117);async[a28_0x210e68(0x132)](_0x14282b){const _0x26788a=a28_0x210e68,{options:_0x68907e,args:_0x1e07a2,tdx:_0x40c977}=_0x14282b,_0x4a5a63=_0x68907e;if(_0x1e07a2[_0x26788a(0x12d)]===0x0)return console[_0x26788a(0x111)](_0x26788a(0x115)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x26788a(0x111)](_0x26788a(0x12e)),console[_0x26788a(0x111)](_0x26788a(0x129)),console['error'](_0x26788a(0x112)),console['error'](_0x26788a(0x126)),0x1;const _0x4fe49a=_0x1e07a2[0x0],_0x3988cb=_0x68907e['segmentPath'];let _0x178bea=_0x4fe49a;_0x3988cb&&!_0x4fe49a[_0x26788a(0x11c)]('/')&&(_0x178bea=_0x3988cb+'/'+_0x4fe49a,_0x4a5a63[_0x26788a(0x102)]&&console[_0x26788a(0x111)]('Resolved\x20relative\x20path\x20to:\x20'+_0x178bea));const _0x4faae9=parsePath(_0x178bea);if(_0x4faae9['segments'][_0x26788a(0x12d)]<0x2)return console[_0x26788a(0x111)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x26788a(0x111)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x7bf65e=_0x4faae9[_0x26788a(0x11d)][0x0],_0x15b24d=getBaseName(_0x178bea),_0x4b57f5=getParentPath(_0x178bea);_0x4a5a63[_0x26788a(0x102)]&&(console['error'](_0x26788a(0x12b)+_0x4a5a63[_0x26788a(0x127)]),console[_0x26788a(0x111)](_0x26788a(0x107)+_0x178bea),console[_0x26788a(0x111)](_0x26788a(0x122)+_0x7bf65e),console['error']('Segment\x20name:\x20'+_0x15b24d),console[_0x26788a(0x111)](_0x26788a(0x113)+_0x4b57f5));const _0x37bfe8=await withSpinner(_0x26788a(0x110)+_0x7bf65e+_0x26788a(0x11e),()=>_0x40c977[_0x26788a(0x131)][_0x26788a(0x10c)](_0x7bf65e),{'verbose':_0x4a5a63[_0x26788a(0x102)]}),_0x179f71=_0x37bfe8['data'];let _0x13f2a3;if(_0x4faae9[_0x26788a(0x11d)][_0x26788a(0x12d)]>0x2){const _0x3be2cf=await withSpinner(_0x26788a(0x121)+_0x4b57f5+_0x26788a(0x11e),()=>_0x40c977[_0x26788a(0x131)][_0x26788a(0x114)](_0x4b57f5),{'verbose':_0x4a5a63[_0x26788a(0x102)]}),_0x4b520d=_0x3be2cf[_0x26788a(0x12a)];if(_0x4b520d[_0x26788a(0x10f)]!=='folder'&&_0x4b520d[_0x26788a(0x10f)]!==_0x26788a(0x101))return console[_0x26788a(0x111)](_0x26788a(0x106)),0x1;_0x13f2a3=_0x4b520d['folderId'];}else{if(_0x4a5a63[_0x26788a(0x10a)]){const _0x1f3392=await withSpinner(_0x26788a(0x11a)+_0x4a5a63[_0x26788a(0x10a)]+_0x26788a(0x11e),()=>_0x40c977[_0x26788a(0x131)]['resolveFolderId'](_0x179f71,_0x4a5a63['folder']),{'verbose':_0x4a5a63[_0x26788a(0x102)]});_0x13f2a3=_0x1f3392['data'];}}_0x4a5a63[_0x26788a(0x102)]&&_0x13f2a3&&console[_0x26788a(0x111)](_0x26788a(0x105)+_0x13f2a3);const _0xecf0f=await loadJSONFromOptions(_0x4a5a63['rule'],_0x4a5a63[_0x26788a(0x11f)]),_0xf6387d={'name':_0x15b24d,'description':_0x4a5a63[_0x26788a(0x125)],'rule':_0xecf0f,'kind':_0x4a5a63[_0x26788a(0x10d)]!==undefined?parseInt(_0x4a5a63[_0x26788a(0x10d)],0xa):undefined,'isVisible':_0x4a5a63['invisible']?![]:undefined,'segmentFolderId':_0x13f2a3,'countPopulation':_0x4a5a63[_0x26788a(0x128)]?![]:undefined},_0x309ab2=await withSpinner(_0x26788a(0x109)+_0x15b24d+_0x26788a(0x11e),()=>_0x40c977[_0x26788a(0x131)]['createSegment'](_0x179f71,_0xf6387d),{'verbose':_0x4a5a63[_0x26788a(0x102)]}),_0x4f3382=_0x309ab2[_0x26788a(0x12a)];return console['error'](_0x26788a(0x10b)+_0x4f3382['name']+_0x26788a(0x12f)+_0x4f3382['id']),_0x178bea!==_0x4fe49a&&console[_0x26788a(0x111)](_0x26788a(0x118)+_0x178bea),await handleSDKOutput([_0x4f3382],_0x4a5a63),0x0;}}
@@ -1 +1 @@
1
- const a29_0x2ef354=a29_0x2c55;(function(_0x1f06c0,_0x3b6a2b){const _0x1455be=a29_0x2c55,_0x4cb512=_0x1f06c0();while(!![]){try{const _0x199362=parseInt(_0x1455be(0x1eb))/0x1+-parseInt(_0x1455be(0x1e2))/0x2+-parseInt(_0x1455be(0x1e4))/0x3+parseInt(_0x1455be(0x1e5))/0x4+-parseInt(_0x1455be(0x1e8))/0x5+-parseInt(_0x1455be(0x1ed))/0x6+-parseInt(_0x1455be(0x1f5))/0x7*(-parseInt(_0x1455be(0x1f3))/0x8);if(_0x199362===_0x3b6a2b)break;else _0x4cb512['push'](_0x4cb512['shift']());}catch(_0x5f2c94){_0x4cb512['push'](_0x4cb512['shift']());}}}(a29_0x2898,0xca9f2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x2c55(_0x26918d,_0x494602){const _0x28987f=a29_0x2898();return a29_0x2c55=function(_0x2c55f0,_0x2e3211){_0x2c55f0=_0x2c55f0-0x1df;let _0x20eb02=_0x28987f[_0x2c55f0];return _0x20eb02;},a29_0x2c55(_0x26918d,_0x494602);}export class SegmentFieldsCommand extends BaseCommand{['name']=a29_0x2ef354(0x1f0);[a29_0x2ef354(0x1ee)]=a29_0x2ef354(0x1f1);async['execute'](_0x147a0f){const _0x4fc79c=a29_0x2ef354,{options:_0x3b0d04,args:_0x21490c,tdx:_0x547b8e}=_0x147a0f,_0x13ab18=_0x21490c[0x0]||_0x3b0d04[_0x4fc79c(0x1e6)];if(!_0x13ab18)return console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1e9)),console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1f4)),console['error'](_0x4fc79c(0x1f2)),0x1;_0x3b0d04['verbose']&&(console['error'](_0x4fc79c(0x1f6)+_0x3b0d04['site']),console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1e1)+_0x13ab18));const _0x5d6e4a=await withSpinner(_0x4fc79c(0x1e7)+_0x13ab18+_0x4fc79c(0x1ec),()=>_0x547b8e[_0x4fc79c(0x1df)]['listFields'](_0x13ab18),{'verbose':_0x3b0d04[_0x4fc79c(0x1ea)]}),_0x4cd566=_0x5d6e4a['data'];return console[_0x4fc79c(0x1ef)](_0x4fc79c(0x1e3)+_0x4cd566[_0x4fc79c(0x1e0)]+'\x20field'+(_0x4cd566['length']!==0x1?'s':'')),await handleSDKOutput(_0x4cd566,_0x3b0d04),0x0;}}function a29_0x2898(){const _0x4559ba=['1612286cbrNZO','✔\x20Found\x20','2102694KfPNlV','6173144rOtlih','parentSegment','Listing\x20fields\x20for\x20\x27','1514630TeHwKx','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','731453eRCVmB','\x27...','9483276pGonpA','description','error','segment:fields','List\x20available\x20fields\x20for\x20segmentation','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','15565696fRGdzs','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','7fCfNeP','Site:\x20','segment','length','Parent\x20segment:\x20'];a29_0x2898=function(){return _0x4559ba;};return a29_0x2898();}
1
+ const a29_0x147a30=a29_0x121a;function a29_0x4ea0(){const _0x2084dd=['site','Listing\x20fields\x20for\x20\x27','error','List\x20available\x20fields\x20for\x20segmentation','\x27...','282TVvNBC','768QjEQEg','4enOQbi','parentSegment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1958368GzaLCH','134787EresHh','length','verbose','Error:\x20Parent\x20segment\x20name\x20is\x20required','4100516jTFyOl','1484073GvYgTC','data','7401vtheDl','Parent\x20segment:\x20','name','segment:fields','3285yUJPva','33yBgbVu','964330wjaqtU','\x20field','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Site:\x20'];a29_0x4ea0=function(){return _0x2084dd;};return a29_0x4ea0();}(function(_0x1642c8,_0x18514b){const _0x2bb2d2=a29_0x121a,_0x583c41=_0x1642c8();while(!![]){try{const _0x1091a6=-parseInt(_0x2bb2d2(0x87))/0x1*(parseInt(_0x2bb2d2(0x83))/0x2)+parseInt(_0x2bb2d2(0x8e))/0x3*(parseInt(_0x2bb2d2(0x82))/0x4)+-parseInt(_0x2bb2d2(0x76))/0x5*(parseInt(_0x2bb2d2(0x81))/0x6)+parseInt(_0x2bb2d2(0x8b))/0x7+-parseInt(_0x2bb2d2(0x86))/0x8+parseInt(_0x2bb2d2(0x8c))/0x9+parseInt(_0x2bb2d2(0x78))/0xa*(-parseInt(_0x2bb2d2(0x77))/0xb);if(_0x1091a6===_0x18514b)break;else _0x583c41['push'](_0x583c41['shift']());}catch(_0xae7c5b){_0x583c41['push'](_0x583c41['shift']());}}}(a29_0x4ea0,0x5f2a9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a29_0x121a(_0x449ec8,_0x400c7b){const _0x4ea0df=a29_0x4ea0();return a29_0x121a=function(_0x121a09,_0x63c969){_0x121a09=_0x121a09-0x73;let _0x457fe4=_0x4ea0df[_0x121a09];return _0x457fe4;},a29_0x121a(_0x449ec8,_0x400c7b);}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x147a30(0x74)]=a29_0x147a30(0x75);['description']=a29_0x147a30(0x7f);async['execute'](_0x491511){const _0x29fa10=a29_0x147a30,{options:_0x485efc,args:_0x1eff6e,tdx:_0xcbecda}=_0x491511,_0x1bc327=_0x1eff6e[0x0]||_0x485efc[_0x29fa10(0x84)];if(!_0x1bc327)return console[_0x29fa10(0x7e)](_0x29fa10(0x8a)),console[_0x29fa10(0x7e)](_0x29fa10(0x7a)),console['error'](_0x29fa10(0x85)),0x1;_0x485efc[_0x29fa10(0x89)]&&(console[_0x29fa10(0x7e)](_0x29fa10(0x7b)+_0x485efc[_0x29fa10(0x7c)]),console[_0x29fa10(0x7e)](_0x29fa10(0x73)+_0x1bc327));const _0x1871ba=await withSpinner(_0x29fa10(0x7d)+_0x1bc327+_0x29fa10(0x80),()=>_0xcbecda['segment']['listFields'](_0x1bc327),{'verbose':_0x485efc[_0x29fa10(0x89)]}),_0x2fcdc1=_0x1871ba[_0x29fa10(0x8d)];return console[_0x29fa10(0x7e)]('✔\x20Found\x20'+_0x2fcdc1[_0x29fa10(0x88)]+_0x29fa10(0x79)+(_0x2fcdc1['length']!==0x1?'s':'')),await handleSDKOutput(_0x2fcdc1,_0x485efc),0x0;}}
@@ -1 +1 @@
1
- function a30_0x405b(_0x17116d,_0x298ba5){const _0x291375=a30_0x2913();return a30_0x405b=function(_0x405b50,_0x3960ed){_0x405b50=_0x405b50-0x1b5;let _0x32958f=_0x291375[_0x405b50];return _0x32958f;},a30_0x405b(_0x17116d,_0x298ba5);}function a30_0x2913(){const _0x3dfa12=['9GYctBn','4ysmCJl','1166bRAZLk','description','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','449896UEAubQ','1566020gjGTFM','Context\x20details:','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','error','34671hJtlYI','526530TtKWcL','root','name','210uOBZIO','segment:pwd','format','jsonl','1652KeGnkc','log','\x20\x20Path:\x20','368072ClYnQh','segmentPath','json','Show\x20current\x20segment/folder\x20context','36jjoWKm','73428UoAlIn'];a30_0x2913=function(){return _0x3dfa12;};return a30_0x2913();}const a30_0x8a1c12=a30_0x405b;(function(_0x3594ec,_0x2c1c6e){const _0x5ef3d6=a30_0x405b,_0x3b1b53=_0x3594ec();while(!![]){try{const _0xb02987=-parseInt(_0x5ef3d6(0x1cc))/0x1+parseInt(_0x5ef3d6(0x1be))/0x2*(-parseInt(_0x5ef3d6(0x1c7))/0x3)+parseInt(_0x5ef3d6(0x1c8))/0x4*(-parseInt(_0x5ef3d6(0x1b7))/0x5)+-parseInt(_0x5ef3d6(0x1ba))/0x6*(parseInt(_0x5ef3d6(0x1b6))/0x7)+-parseInt(_0x5ef3d6(0x1c1))/0x8*(-parseInt(_0x5ef3d6(0x1c5))/0x9)+parseInt(_0x5ef3d6(0x1cd))/0xa+-parseInt(_0x5ef3d6(0x1c9))/0xb*(-parseInt(_0x5ef3d6(0x1c6))/0xc);if(_0xb02987===_0x2c1c6e)break;else _0x3b1b53['push'](_0x3b1b53['shift']());}catch(_0x4a796f){_0x3b1b53['push'](_0x3b1b53['shift']());}}}(a30_0x2913,0x3f0a9));import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a30_0x8a1c12(0x1b9)]=a30_0x8a1c12(0x1bb);[a30_0x8a1c12(0x1ca)]=a30_0x8a1c12(0x1c4);async['execute'](_0x5bf1d8){const _0x33e072=a30_0x8a1c12,{options:_0x50a8b9}=_0x5bf1d8;try{const _0x412c59=_0x50a8b9[_0x33e072(0x1c2)];if(!_0x412c59)return _0x50a8b9['format']===_0x33e072(0x1c3)||_0x50a8b9[_0x33e072(0x1bc)]===_0x33e072(0x1bd)?console['log'](JSON['stringify']({'path':'/','type':_0x33e072(0x1b8)})):console[_0x33e072(0x1bf)]('/'),0x0;if(_0x50a8b9[_0x33e072(0x1bc)]==='json'||_0x50a8b9[_0x33e072(0x1bc)]===_0x33e072(0x1bd)){const _0x4e1454={'path':_0x412c59};console[_0x33e072(0x1bf)](JSON['stringify'](_0x4e1454));}else console[_0x33e072(0x1bf)](_0x412c59),_0x50a8b9['verbose']&&(console[_0x33e072(0x1b5)](''),console[_0x33e072(0x1b5)](_0x33e072(0x1ce)),console[_0x33e072(0x1b5)](_0x33e072(0x1c0)+_0x412c59),console[_0x33e072(0x1b5)](''),console[_0x33e072(0x1b5)](_0x33e072(0x1cf)),console['error'](_0x33e072(0x1cb)));return 0x0;}catch(_0x25257a){throw _0x25257a;}}}
1
+ function a30_0x494d(){const _0x581b28=['791598Wriitn','root','execute','5KweahE','error','\x20\x20Path:\x20','description','log','format','374102yhZxuc','520840FVEiVK','segmentPath','name','239720euxYfi','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','jsonl','786NEdGsn','16509273tFMCuL','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','verbose','10qvlFqV','20wDOgVN','stringify','json','4279506OuHvqW','63TOtASf'];a30_0x494d=function(){return _0x581b28;};return a30_0x494d();}const a30_0x3a3c48=a30_0x90da;(function(_0x46995d,_0x392155){const _0x4b828b=a30_0x90da,_0x1a2fbe=_0x46995d();while(!![]){try{const _0x46db90=-parseInt(_0x4b828b(0x7a))/0x1+-parseInt(_0x4b828b(0x7b))/0x2+parseInt(_0x4b828b(0x81))/0x3*(-parseInt(_0x4b828b(0x86))/0x4)+-parseInt(_0x4b828b(0x74))/0x5*(parseInt(_0x4b828b(0x71))/0x6)+-parseInt(_0x4b828b(0x6f))/0x7+parseInt(_0x4b828b(0x7e))/0x8*(parseInt(_0x4b828b(0x70))/0x9)+-parseInt(_0x4b828b(0x85))/0xa*(-parseInt(_0x4b828b(0x82))/0xb);if(_0x46db90===_0x392155)break;else _0x1a2fbe['push'](_0x1a2fbe['shift']());}catch(_0x33e9b0){_0x1a2fbe['push'](_0x1a2fbe['shift']());}}}(a30_0x494d,0x50ed3));function a30_0x90da(_0x2fe361,_0x508cdd){const _0x494d7b=a30_0x494d();return a30_0x90da=function(_0x90dafb,_0x5e6f6e){_0x90dafb=_0x90dafb-0x6f;let _0x179138=_0x494d7b[_0x90dafb];return _0x179138;},a30_0x90da(_0x2fe361,_0x508cdd);}import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a30_0x3a3c48(0x7d)]='segment:pwd';[a30_0x3a3c48(0x77)]='Show\x20current\x20segment/folder\x20context';async[a30_0x3a3c48(0x73)](_0x51ad4f){const _0x15d4f0=a30_0x3a3c48,{options:_0x52bf68}=_0x51ad4f;try{const _0xbbf7b5=_0x52bf68[_0x15d4f0(0x7c)];if(!_0xbbf7b5)return _0x52bf68[_0x15d4f0(0x79)]===_0x15d4f0(0x88)||_0x52bf68[_0x15d4f0(0x79)]===_0x15d4f0(0x80)?console[_0x15d4f0(0x78)](JSON[_0x15d4f0(0x87)]({'path':'/','type':_0x15d4f0(0x72)})):console['log']('/'),0x0;if(_0x52bf68[_0x15d4f0(0x79)]===_0x15d4f0(0x88)||_0x52bf68['format']===_0x15d4f0(0x80)){const _0x49259f={'path':_0xbbf7b5};console[_0x15d4f0(0x78)](JSON[_0x15d4f0(0x87)](_0x49259f));}else console[_0x15d4f0(0x78)](_0xbbf7b5),_0x52bf68[_0x15d4f0(0x84)]&&(console['error'](''),console[_0x15d4f0(0x75)]('Context\x20details:'),console[_0x15d4f0(0x75)](_0x15d4f0(0x76)+_0xbbf7b5),console['error'](''),console[_0x15d4f0(0x75)](_0x15d4f0(0x83)),console['error'](_0x15d4f0(0x7f)));return 0x0;}catch(_0x320ec5){throw _0x320ec5;}}}
@@ -1 +1 @@
1
- const a31_0x57de1a=a31_0x4f17;(function(_0x369a68,_0x366d73){const _0x5176f4=a31_0x4f17,_0x69c80d=_0x369a68();while(!![]){try{const _0xac8a32=-parseInt(_0x5176f4(0x7f))/0x1*(parseInt(_0x5176f4(0x99))/0x2)+parseInt(_0x5176f4(0x85))/0x3+-parseInt(_0x5176f4(0x8d))/0x4+-parseInt(_0x5176f4(0x9f))/0x5*(-parseInt(_0x5176f4(0x8a))/0x6)+-parseInt(_0x5176f4(0x81))/0x7+-parseInt(_0x5176f4(0x93))/0x8*(-parseInt(_0x5176f4(0x92))/0x9)+parseInt(_0x5176f4(0x95))/0xa;if(_0xac8a32===_0x366d73)break;else _0x69c80d['push'](_0x69c80d['shift']());}catch(_0x2d7e80){_0x69c80d['push'](_0x69c80d['shift']());}}}(a31_0x2a86,0x81f4e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a31_0x2a86(){const _0x4cd8ed=['.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x27...','segmentId','2893420nqALOI','Segment\x20ID:\x20','name','ruleFile','segmentName','✔\x20Updated\x20segment\x20\x27','Updating\x20segment\x20\x27','includes','Resolving\x20path\x20\x27','updateSegmentById','type','verbose','117709GCBXyG','Resolved\x20folder\x20ID:\x20','5841409yhLzyG','Resolving\x20folder\x20\x27','resolveFolderId','folder','593064mOQyEj','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Examples:','parentId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','6reZGiR','resolvePathToResource','Resolved\x20type:\x20','433556LIwVWi','segment','kind','Parent\x20ID:\x20','error','4058217uINXHM','16gPOHvl','execute','3855250RUvTOc','rule','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','description','10lQggBD','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','length'];a31_0x2a86=function(){return _0x4cd8ed;};return a31_0x2a86();}import{withSpinner}from'../utils/spinner.js';function a31_0x4f17(_0x236c0d,_0x1defcf){const _0x2a8639=a31_0x2a86();return a31_0x4f17=function(_0x4f17b8,_0x2358b6){_0x4f17b8=_0x4f17b8-0x7c;let _0x54d7a1=_0x2a8639[_0x4f17b8];return _0x54d7a1;},a31_0x4f17(_0x236c0d,_0x1defcf);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';['description']='Update\x20existing\x20child\x20segment';async[a31_0x57de1a(0x94)](_0x50a668){const _0x3875e5=a31_0x57de1a,{options:_0x44db19,args:_0x5589a8,tdx:_0x3a6e6a}=_0x50a668,_0x1bf2ca=_0x44db19;if(_0x5589a8[_0x3875e5(0x9b)]===0x0)return console[_0x3875e5(0x91)](_0x3875e5(0x89)),console[_0x3875e5(0x91)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x3875e5(0x91)](_0x3875e5(0x87)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x3875e5(0x91)](_0x3875e5(0x97)),0x1;const _0x3450c8=_0x5589a8[0x0],_0x5acff9=_0x44db19['segmentPath'];let _0x4f2fb5=_0x3450c8;_0x5acff9&&!_0x3450c8[_0x3875e5(0xa6)]('/')&&(_0x4f2fb5=_0x5acff9+'/'+_0x3450c8,_0x1bf2ca['verbose']&&console[_0x3875e5(0x91)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4f2fb5));const _0x35afa3=await withSpinner(_0x3875e5(0xa7)+_0x4f2fb5+_0x3875e5(0x9d),()=>_0x3a6e6a[_0x3875e5(0x8e)][_0x3875e5(0x8b)](_0x4f2fb5),{'verbose':_0x1bf2ca[_0x3875e5(0x7e)]}),_0x6c6a92=_0x35afa3['data'];_0x1bf2ca[_0x3875e5(0x7e)]&&console[_0x3875e5(0x91)](_0x3875e5(0x8c)+_0x6c6a92[_0x3875e5(0x7d)]);if(_0x6c6a92[_0x3875e5(0x7d)]!==_0x3875e5(0x8e))return console['error']('Error:\x20Cannot\x20update\x20'+_0x6c6a92[_0x3875e5(0x7d)]+_0x3875e5(0x9c)),console[_0x3875e5(0x91)](_0x3875e5(0x9a)),0x1;if(!_0x6c6a92[_0x3875e5(0x9e)])throw new SDKError(ErrorCode['INTERNAL'],_0x3875e5(0x86));const _0x386e12=_0x6c6a92[_0x3875e5(0x88)],_0x1c04d0=_0x6c6a92[_0x3875e5(0x9e)];_0x1bf2ca[_0x3875e5(0x7e)]&&(console['error'](_0x3875e5(0x90)+_0x386e12),console[_0x3875e5(0x91)](_0x3875e5(0xa0)+_0x1c04d0));let _0x18eb8f;if(_0x1bf2ca[_0x3875e5(0x84)]){const _0x33ea65=_0x1bf2ca[_0x3875e5(0x84)],_0x81e871=await withSpinner(_0x3875e5(0x82)+_0x33ea65+'\x27...',()=>_0x3a6e6a[_0x3875e5(0x8e)][_0x3875e5(0x83)](_0x386e12,_0x33ea65),{'verbose':_0x1bf2ca[_0x3875e5(0x7e)]});_0x18eb8f=parseInt(_0x81e871['data'],0xa),_0x1bf2ca[_0x3875e5(0x7e)]&&console[_0x3875e5(0x91)](_0x3875e5(0x80)+_0x18eb8f);}const _0x2deabd=await loadJSONFromOptions(_0x1bf2ca[_0x3875e5(0x96)],_0x1bf2ca[_0x3875e5(0xa2)]),_0x29ef7e={'name':_0x1bf2ca[_0x3875e5(0xa1)],'description':_0x1bf2ca[_0x3875e5(0x98)],'rule':_0x2deabd,'kind':_0x1bf2ca[_0x3875e5(0x8f)]!==undefined?parseInt(_0x1bf2ca[_0x3875e5(0x8f)],0xa):undefined,'segmentFolderId':_0x18eb8f},_0x465760=await withSpinner(_0x3875e5(0xa5)+_0x6c6a92[_0x3875e5(0xa3)]+_0x3875e5(0x9d),()=>_0x3a6e6a[_0x3875e5(0x8e)][_0x3875e5(0x7c)](_0x386e12,_0x1c04d0,_0x29ef7e),{'verbose':_0x1bf2ca[_0x3875e5(0x7e)]}),_0x3c2ceb=_0x465760['data'];return console[_0x3875e5(0x91)](_0x3875e5(0xa4)+_0x3c2ceb[_0x3875e5(0xa1)]+'\x27'),_0x4f2fb5!==_0x3450c8&&console[_0x3875e5(0x91)]('\x20\x20\x20Path:\x20'+_0x4f2fb5),await handleSDKOutput([_0x3c2ceb],_0x1bf2ca),0x0;}}
1
+ const a31_0x223067=a31_0x11e0;(function(_0x50e599,_0x1d9125){const _0x532936=a31_0x11e0,_0x15e19f=_0x50e599();while(!![]){try{const _0x3f8cc8=parseInt(_0x532936(0x179))/0x1+-parseInt(_0x532936(0x160))/0x2+-parseInt(_0x532936(0x15d))/0x3*(parseInt(_0x532936(0x162))/0x4)+parseInt(_0x532936(0x173))/0x5+-parseInt(_0x532936(0x170))/0x6*(-parseInt(_0x532936(0x16c))/0x7)+-parseInt(_0x532936(0x159))/0x8+parseInt(_0x532936(0x15c))/0x9;if(_0x3f8cc8===_0x1d9125)break;else _0x15e19f['push'](_0x15e19f['shift']());}catch(_0x2d3b33){_0x15e19f['push'](_0x15e19f['shift']());}}}(a31_0x54d8,0x25298));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{[a31_0x223067(0x15b)]=a31_0x223067(0x153);['description']=a31_0x223067(0x17c);async[a31_0x223067(0x17e)](_0x429cca){const _0x20fc11=a31_0x223067,{options:_0x56cc3a,args:_0x201a71,tdx:_0x530bc9}=_0x429cca,_0x4eed6d=_0x56cc3a;if(_0x201a71[_0x20fc11(0x15a)]===0x0)return console['error'](_0x20fc11(0x16f)),console[_0x20fc11(0x181)](_0x20fc11(0x163)),console[_0x20fc11(0x181)](_0x20fc11(0x172)),console[_0x20fc11(0x181)](_0x20fc11(0x16e)),console[_0x20fc11(0x181)](_0x20fc11(0x174)),0x1;const _0x4b2b06=_0x201a71[0x0],_0x25b746=_0x56cc3a[_0x20fc11(0x17b)];let _0x3fd130=_0x4b2b06;_0x25b746&&!_0x4b2b06[_0x20fc11(0x167)]('/')&&(_0x3fd130=_0x25b746+'/'+_0x4b2b06,_0x4eed6d[_0x20fc11(0x17f)]&&console[_0x20fc11(0x181)](_0x20fc11(0x175)+_0x3fd130));const _0x251ea0=await withSpinner(_0x20fc11(0x178)+_0x3fd130+'\x27...',()=>_0x530bc9[_0x20fc11(0x16d)]['resolvePathToResource'](_0x3fd130),{'verbose':_0x4eed6d['verbose']}),_0xab5a40=_0x251ea0[_0x20fc11(0x16b)];_0x4eed6d['verbose']&&console['error'](_0x20fc11(0x154)+_0xab5a40[_0x20fc11(0x15e)]);if(_0xab5a40['type']!=='segment')return console['error']('Error:\x20Cannot\x20update\x20'+_0xab5a40['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x20fc11(0x181)](_0x20fc11(0x156)),0x1;if(!_0xab5a40[_0x20fc11(0x164)])throw new SDKError(ErrorCode[_0x20fc11(0x180)],_0x20fc11(0x17a));const _0x3c0090=_0xab5a40[_0x20fc11(0x177)],_0x51a70b=_0xab5a40[_0x20fc11(0x164)];_0x4eed6d[_0x20fc11(0x17f)]&&(console[_0x20fc11(0x181)](_0x20fc11(0x155)+_0x3c0090),console['error'](_0x20fc11(0x166)+_0x51a70b));let _0x51f33e;if(_0x4eed6d['folder']){const _0x248c2e=_0x4eed6d[_0x20fc11(0x171)],_0x19f740=await withSpinner(_0x20fc11(0x161)+_0x248c2e+_0x20fc11(0x165),()=>_0x530bc9[_0x20fc11(0x16d)][_0x20fc11(0x16a)](_0x3c0090,_0x248c2e),{'verbose':_0x4eed6d[_0x20fc11(0x17f)]});_0x51f33e=parseInt(_0x19f740[_0x20fc11(0x16b)],0xa),_0x4eed6d[_0x20fc11(0x17f)]&&console[_0x20fc11(0x181)](_0x20fc11(0x182)+_0x51f33e);}const _0x2d267e=await loadJSONFromOptions(_0x4eed6d[_0x20fc11(0x169)],_0x4eed6d['ruleFile']),_0x4d81b5={'name':_0x4eed6d[_0x20fc11(0x15b)],'description':_0x4eed6d[_0x20fc11(0x15f)],'rule':_0x2d267e,'kind':_0x4eed6d[_0x20fc11(0x17d)]!==undefined?parseInt(_0x4eed6d[_0x20fc11(0x17d)],0xa):undefined,'segmentFolderId':_0x51f33e},_0x1edd35=await withSpinner(_0x20fc11(0x168)+_0xab5a40[_0x20fc11(0x176)]+'\x27...',()=>_0x530bc9[_0x20fc11(0x16d)][_0x20fc11(0x157)](_0x3c0090,_0x51a70b,_0x4d81b5),{'verbose':_0x4eed6d['verbose']}),_0x1010e6=_0x1edd35[_0x20fc11(0x16b)];return console['error'](_0x20fc11(0x158)+_0x1010e6[_0x20fc11(0x15b)]+'\x27'),_0x3fd130!==_0x4b2b06&&console[_0x20fc11(0x181)]('\x20\x20\x20Path:\x20'+_0x3fd130),await handleSDKOutput([_0x1010e6],_0x4eed6d),0x0;}}function a31_0x11e0(_0x35acc1,_0x14dd03){const _0x54d8f4=a31_0x54d8();return a31_0x11e0=function(_0x11e093,_0x5b76d8){_0x11e093=_0x11e093-0x153;let _0x3799a2=_0x54d8f4[_0x11e093];return _0x3799a2;},a31_0x11e0(_0x35acc1,_0x14dd03);}function a31_0x54d8(){const _0x29dc0d=['includes','Updating\x20segment\x20\x27','rule','resolveFolderId','data','207214ZziPsI','segment','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','60OIjCKN','folder','Examples:','367885KrFpiP','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolved\x20relative\x20path\x20to:\x20','segmentName','parentId','Resolving\x20path\x20\x27','123619mhSgsA','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segmentPath','Update\x20existing\x20child\x20segment','kind','execute','verbose','INTERNAL','error','Resolved\x20folder\x20ID:\x20','segment:update','Resolved\x20type:\x20','Parent\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','updateSegmentById','✔\x20Updated\x20segment\x20\x27','1964056LHYVIK','length','name','1035711ZvUYKj','490404JJPsOw','type','description','94208AOiqul','Resolving\x20folder\x20\x27','4fayOXb','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentId','\x27...','Segment\x20ID:\x20'];a31_0x54d8=function(){return _0x29dc0d;};return a31_0x54d8();}
@@ -1 +1 @@
1
- function a32_0x3804(_0x567e8f,_0x5eba8c){const _0x1e4aec=a32_0x1e4a();return a32_0x3804=function(_0x38049d,_0x106967){_0x38049d=_0x38049d-0x1c4;let _0x5113ed=_0x1e4aec[_0x38049d];return _0x5113ed;},a32_0x3804(_0x567e8f,_0x5eba8c);}function a32_0x1e4a(){const _0x4fb647=['10CHVRcb','folderId','Use:\x20tdx\x20segment\x20use\x20','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','segmentPath','length','Target\x20path:\x20','type','segment:use','Context\x20set\x20to:\x20','Resolved\x20path\x20type:\x20','segment','segments','slice','Resolving\x20path\x20\x27','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','1369902UTKVYg','session','parentId','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','isAbsolute','1670184lslQtu','error','parentName','join','data','fullPath','Usage:\x20tdx\x20segment\x20use\x20<path>','folderPath','site','log','4989447txiDZp','458620iGOGuJ','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','1804105AJcFLA','Context\x20cleared.\x20Back\x20to\x20root.','Site:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','2053940NaMIWa','Parent\x20ID:\x20','Error:\x20Path\x20is\x20required','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','name','\x27...','3ICjVRV','resolvePathToResource','2tEqjWn','151483bjiLpR','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','verbose'];a32_0x1e4a=function(){return _0x4fb647;};return a32_0x1e4a();}const a32_0x19e94f=a32_0x3804;(function(_0x4a36a6,_0x331b7e){const _0x139bb4=a32_0x3804,_0x1a2ef8=_0x4a36a6();while(!![]){try{const _0x50f377=parseInt(_0x139bb4(0x1e6))/0x1*(parseInt(_0x139bb4(0x1e5))/0x2)+parseInt(_0x139bb4(0x1e3))/0x3*(parseInt(_0x139bb4(0x1d5))/0x4)+parseInt(_0x139bb4(0x1d7))/0x5+parseInt(_0x139bb4(0x1c5))/0x6+-parseInt(_0x139bb4(0x1dc))/0x7+parseInt(_0x139bb4(0x1ca))/0x8+-parseInt(_0x139bb4(0x1d4))/0x9*(parseInt(_0x139bb4(0x1e9))/0xa);if(_0x50f377===_0x331b7e)break;else _0x1a2ef8['push'](_0x1a2ef8['shift']());}catch(_0x8969ff){_0x1a2ef8['push'](_0x1a2ef8['shift']());}}}(a32_0x1e4a,0x34cb6));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{[a32_0x19e94f(0x1e1)]=a32_0x19e94f(0x1f1);['description']=a32_0x19e94f(0x1f9);async['execute'](_0x8b5bd7){const _0x38124d=a32_0x19e94f,{options:_0x5b8f70,args:_0x17987c,tdx:_0x4d83fe}=_0x8b5bd7;if(_0x17987c[_0x38124d(0x1ee)]===0x0)return console[_0x38124d(0x1cb)](_0x38124d(0x1de)),console['error'](_0x38124d(0x1d0)),console[_0x38124d(0x1cb)]('Examples:'),console[_0x38124d(0x1cb)](_0x38124d(0x1e0)),console[_0x38124d(0x1cb)](_0x38124d(0x1db)),console[_0x38124d(0x1cb)](_0x38124d(0x1da)),console[_0x38124d(0x1cb)](_0x38124d(0x1c8)),0x1;const _0x292fa3=_0x17987c[0x0],_0x4b502e=_0x5b8f70[_0x38124d(0x1c6)];try{if(_0x292fa3==='/')return saveSessionContext({'segment_path':undefined},_0x4b502e),console['log'](_0x38124d(0x1d8)),0x0;const _0x1d0c09=_0x5b8f70[_0x38124d(0x1ed)];let _0x7c1a90=_0x292fa3;const _0x22ac11=parsePath(_0x292fa3);if(!_0x22ac11[_0x38124d(0x1c9)]){if(!_0x1d0c09)return console[_0x38124d(0x1cb)](_0x38124d(0x1e7)),console[_0x38124d(0x1cb)](_0x38124d(0x1f8)),0x1;if(_0x292fa3==='..'){const _0x4bb992=_0x1d0c09['split']('/')[_0x38124d(0x1f6)](0x0,-0x1)[_0x38124d(0x1cd)]('/');_0x7c1a90=_0x4bb992||'/';}else _0x292fa3==='.'?_0x7c1a90=_0x1d0c09:_0x7c1a90=_0x1d0c09+'/'+_0x292fa3;_0x5b8f70[_0x38124d(0x1e8)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x7c1a90);}if(_0x7c1a90==='/'||_0x7c1a90==='')return saveSessionContext({'segment_path':undefined},_0x4b502e),console[_0x38124d(0x1d3)](_0x38124d(0x1d8)),0x0;_0x7c1a90=normalizePath(_0x7c1a90);const _0x2043cb=parsePath(_0x7c1a90)[_0x38124d(0x1f5)];if(_0x2043cb[_0x38124d(0x1ee)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4b502e),console['log'](_0x38124d(0x1d8)),0x0;_0x5b8f70[_0x38124d(0x1e8)]&&(console[_0x38124d(0x1cb)](_0x38124d(0x1d9)+_0x5b8f70[_0x38124d(0x1d2)]),console[_0x38124d(0x1cb)](_0x38124d(0x1ef)+_0x7c1a90));const _0x5e7b67=await withSpinner(_0x38124d(0x1f7)+_0x7c1a90+_0x38124d(0x1e2),()=>_0x4d83fe[_0x38124d(0x1f4)][_0x38124d(0x1e4)](_0x7c1a90),{'verbose':_0x5b8f70[_0x38124d(0x1e8)]}),_0x33b094=_0x5e7b67[_0x38124d(0x1ce)];_0x5b8f70[_0x38124d(0x1e8)]&&(console[_0x38124d(0x1cb)](_0x38124d(0x1f3)+_0x33b094[_0x38124d(0x1f0)]),console[_0x38124d(0x1cb)](_0x38124d(0x1dd)+_0x33b094[_0x38124d(0x1c7)]),_0x33b094['folderId']&&console[_0x38124d(0x1cb)](_0x38124d(0x1df)+_0x33b094[_0x38124d(0x1ea)]));if(_0x33b094[_0x38124d(0x1f0)]===_0x38124d(0x1f4))return console[_0x38124d(0x1cb)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'),console[_0x38124d(0x1cb)](_0x38124d(0x1c4)),console[_0x38124d(0x1cb)](_0x38124d(0x1eb)+_0x33b094[_0x38124d(0x1cc)]+(_0x33b094[_0x38124d(0x1d1)]?'/'+_0x33b094['folderPath'][_0x38124d(0x1cd)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x33b094[_0x38124d(0x1cf)],'parent_segment':_0x33b094[_0x38124d(0x1cc)]},_0x4b502e),console[_0x38124d(0x1d3)](_0x38124d(0x1f2)+_0x33b094[_0x38124d(0x1cf)]),_0x5b8f70['verbose']&&(console[_0x38124d(0x1cb)](_0x38124d(0x1d6)),console['error'](_0x38124d(0x1ec)),console[_0x38124d(0x1cb)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters')),0x0;}catch(_0x3b597c){throw _0x3b597c;}}}
1
+ const a32_0x555413=a32_0x49ae;function a32_0x49ae(_0x1d671b,_0x3e3d48){const _0x12c7a5=a32_0x12c7();return a32_0x49ae=function(_0x49ae7c,_0x133ca0){_0x49ae7c=_0x49ae7c-0x18d;let _0x27fd23=_0x12c7a5[_0x49ae7c];return _0x27fd23;},a32_0x49ae(_0x1d671b,_0x3e3d48);}(function(_0x56c40d,_0x1cf9f5){const _0x4b9553=a32_0x49ae,_0x4b7b51=_0x56c40d();while(!![]){try{const _0x2355ff=parseInt(_0x4b9553(0x1bc))/0x1+parseInt(_0x4b9553(0x19f))/0x2*(parseInt(_0x4b9553(0x19d))/0x3)+-parseInt(_0x4b9553(0x1a4))/0x4+parseInt(_0x4b9553(0x1a5))/0x5*(-parseInt(_0x4b9553(0x1b9))/0x6)+parseInt(_0x4b9553(0x195))/0x7+-parseInt(_0x4b9553(0x1aa))/0x8*(-parseInt(_0x4b9553(0x18d))/0x9)+-parseInt(_0x4b9553(0x1b0))/0xa*(parseInt(_0x4b9553(0x196))/0xb);if(_0x2355ff===_0x1cf9f5)break;else _0x4b7b51['push'](_0x4b7b51['shift']());}catch(_0x37268a){_0x4b7b51['push'](_0x4b7b51['shift']());}}}(a32_0x12c7,0x545c8));import{BaseCommand}from'./command.js';function a32_0x12c7(){const _0x31e9fa=['Target\x20path:\x20','Resolved\x20path\x20type:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','fullPath','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','450HpgdAW','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Site:\x20','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','log','slice','segment:use','isAbsolute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','1616178FvtShV','Parent\x20ID:\x20','segmentPath','203748XPkDxG','5537475ksYeWr','\x27...','folderId','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','type','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','length','verbose','3354428UDjNgr','108317yhMdfu','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','parentName','join','error','Resolving\x20path\x20\x27','Use:\x20tdx\x20segment\x20use\x20','61449JXEohY','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','32JcKxgT','name','Error:\x20Path\x20is\x20required','Folder\x20ID:\x20','Context\x20set\x20to:\x20','2271732CwXxQc','5FNfXph','Context\x20cleared.\x20Back\x20to\x20root.','split','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','session','8wxIQhN'];a32_0x12c7=function(){return _0x31e9fa;};return a32_0x12c7();}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{[a32_0x555413(0x1a0)]=a32_0x555413(0x1b6);['description']=a32_0x555413(0x1b8);async['execute'](_0x61875a){const _0x169acc=a32_0x555413,{options:_0x26dc57,args:_0x4b6098,tdx:_0x2d0b06}=_0x61875a;if(_0x4b6098[_0x169acc(0x193)]===0x0)return console[_0x169acc(0x19a)](_0x169acc(0x1a1)),console[_0x169acc(0x19a)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x169acc(0x19a)]('Examples:'),console[_0x169acc(0x19a)](_0x169acc(0x1ad)),console[_0x169acc(0x19a)](_0x169acc(0x1a8)),console['error'](_0x169acc(0x19e)),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 _0x1d1cb9=_0x4b6098[0x0],_0x3dcea3=_0x26dc57[_0x169acc(0x1a9)];try{if(_0x1d1cb9==='/')return saveSessionContext({'segment_path':undefined},_0x3dcea3),console[_0x169acc(0x1b4)](_0x169acc(0x1a6)),0x0;const _0x109360=_0x26dc57[_0x169acc(0x1bb)];let _0x3d6ec0=_0x1d1cb9;const _0x5160a8=parsePath(_0x1d1cb9);if(!_0x5160a8[_0x169acc(0x1b7)]){if(!_0x109360)return console[_0x169acc(0x19a)](_0x169acc(0x192)),console[_0x169acc(0x19a)](_0x169acc(0x190)),0x1;if(_0x1d1cb9==='..'){const _0x32732d=_0x109360[_0x169acc(0x1a7)]('/')[_0x169acc(0x1b5)](0x0,-0x1)['join']('/');_0x3d6ec0=_0x32732d||'/';}else _0x1d1cb9==='.'?_0x3d6ec0=_0x109360:_0x3d6ec0=_0x109360+'/'+_0x1d1cb9;_0x26dc57[_0x169acc(0x194)]&&console[_0x169acc(0x19a)]('Resolved\x20relative\x20path\x20to:\x20'+_0x3d6ec0);}if(_0x3d6ec0==='/'||_0x3d6ec0==='')return saveSessionContext({'segment_path':undefined},_0x3dcea3),console['log'](_0x169acc(0x1a6)),0x0;_0x3d6ec0=normalizePath(_0x3d6ec0);const _0xb36c32=parsePath(_0x3d6ec0)['segments'];if(_0xb36c32['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3dcea3),console[_0x169acc(0x1b4)](_0x169acc(0x1a6)),0x0;_0x26dc57[_0x169acc(0x194)]&&(console[_0x169acc(0x19a)](_0x169acc(0x1b2)+_0x26dc57['site']),console['error'](_0x169acc(0x1ab)+_0x3d6ec0));const _0x22c4ad=await withSpinner(_0x169acc(0x19b)+_0x3d6ec0+_0x169acc(0x18e),()=>_0x2d0b06['segment']['resolvePathToResource'](_0x3d6ec0),{'verbose':_0x26dc57[_0x169acc(0x194)]}),_0x281ea2=_0x22c4ad['data'];_0x26dc57[_0x169acc(0x194)]&&(console['error'](_0x169acc(0x1ac)+_0x281ea2[_0x169acc(0x191)]),console[_0x169acc(0x19a)](_0x169acc(0x1ba)+_0x281ea2['parentId']),_0x281ea2[_0x169acc(0x18f)]&&console['error'](_0x169acc(0x1a2)+_0x281ea2[_0x169acc(0x18f)]));if(_0x281ea2[_0x169acc(0x191)]==='segment')return console[_0x169acc(0x19a)](_0x169acc(0x1b1)),console[_0x169acc(0x19a)](_0x169acc(0x197)),console['error'](_0x169acc(0x19c)+_0x281ea2['parentName']+(_0x281ea2['folderPath']?'/'+_0x281ea2['folderPath'][_0x169acc(0x199)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x281ea2[_0x169acc(0x1ae)],'parent_segment':_0x281ea2[_0x169acc(0x198)]},_0x3dcea3),console[_0x169acc(0x1b4)](_0x169acc(0x1a3)+_0x281ea2[_0x169acc(0x1ae)]),_0x26dc57[_0x169acc(0x194)]&&(console[_0x169acc(0x19a)](_0x169acc(0x1af)),console['error']('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console['error'](_0x169acc(0x1b3))),0x0;}catch(_0x491a90){throw _0x491a90;}}}
@@ -1 +1 @@
1
- function a33_0x2c71(){const _0x4d1f99=['listParentsWithPattern','Parent\x20ID:\x20','data','6cEWsHX','jsonl','includes','389074QyoPgO','population','resolvePathToResource','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','execute','\x20\x20Cause:\x20','name','maxDepth','\x20folder','Listing\x20folders\x20and\x20segments...','No\x20parent\x20segments\x20match\x20pattern:\x20','9648dNqGmi','localeCompare','✔\x20Found\x20','👥\x20','log','filter','Folder\x20ID:\x20','Error:\x20','recursive','557868IVJSEN','listRecursive','folder','length','[parent\x20segments]','695276XzJAym','1DRtqyv','Listing\x20parent\x20segments\x20matching\x20\x27','12931180vJfswp','\x20and\x20','Listing\x20parent\x20segments...','Path/pattern\x20arg:\x20','Resolving\x20context\x20path\x20\x27','Site:\x20','✔\x20Built\x20tree\x20with\x20','2007YzFWKB','2105135XJvkCB','message','parentId','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','folderId','format','cause','json','attributes','listParents','\x27...','test','\x20matching\x20\x27','\x20parent\x20segment','map','listUnified','Current\x20context:\x20','verbose','segments','description','replace','dim','site','\x5c$&','1318080UjspMl','segment','Building\x20hierarchy\x20tree...','error'];a33_0x2c71=function(){return _0x4d1f99;};return a33_0x2c71();}const a33_0x375287=a33_0x54d8;(function(_0x225559,_0x1008f7){const _0x4dc994=a33_0x54d8,_0x4a25b6=_0x225559();while(!![]){try{const _0x3f12ed=parseInt(_0x4dc994(0xe9))/0x1*(-parseInt(_0x4dc994(0xe8))/0x2)+-parseInt(_0x4dc994(0x129))/0x3+-parseInt(_0x4dc994(0x10b))/0x4+-parseInt(_0x4dc994(0xf3))/0x5+parseInt(_0x4dc994(0x112))/0x6*(-parseInt(_0x4dc994(0x115))/0x7)+-parseInt(_0x4dc994(0x120))/0x8*(-parseInt(_0x4dc994(0xf2))/0x9)+parseInt(_0x4dc994(0xeb))/0xa;if(_0x3f12ed===_0x1008f7)break;else _0x4a25b6['push'](_0x4a25b6['shift']());}catch(_0x3959d9){_0x4a25b6['push'](_0x4a25b6['shift']());}}}(a33_0x2c71,0x3647d));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 a33_0x890f77 from'chalk';function a33_0x54d8(_0x473280,_0x3b5bb1){const _0x2c7145=a33_0x2c71();return a33_0x54d8=function(_0x54d83b,_0x5c700d){_0x54d83b=_0x54d83b-0xe4;let _0x12bedb=_0x2c7145[_0x54d83b];return _0x12bedb;},a33_0x54d8(_0x473280,_0x3b5bb1);}export class SegmentsCommand extends BaseCommand{[a33_0x375287(0x11b)]=a33_0x375287(0x105);[a33_0x375287(0x106)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a33_0x375287(0x119)](_0x231dea){const _0x41fab6=a33_0x375287,{options:_0x122d11,args:_0x3c7ae8}=_0x231dea,_0x274740=_0x122d11[_0x41fab6(0x128)],_0x446fb7=_0x3c7ae8[0x0];try{const _0x48cba0=_0x122d11['segmentPath'];_0x122d11[_0x41fab6(0x104)]&&(console[_0x41fab6(0x10e)](_0x41fab6(0xf0)+_0x122d11[_0x41fab6(0x109)]),console[_0x41fab6(0x10e)](_0x41fab6(0x103)+(_0x48cba0||'/')),_0x446fb7&&console[_0x41fab6(0x10e)](_0x41fab6(0xee)+_0x446fb7),_0x274740&&console[_0x41fab6(0x10e)]('Recursive\x20mode:\x20enabled'));if(_0x446fb7){const _0x10a39b=_0x446fb7['includes']('*')||_0x446fb7[_0x41fab6(0x114)]('?');if(_0x10a39b&&!_0x48cba0)return await this[_0x41fab6(0x10f)](_0x231dea,_0x446fb7);else return _0x10a39b?(console[_0x41fab6(0x10e)](_0x41fab6(0x118)),console['error'](_0x41fab6(0xf6)),0x1):_0x274740?await this['listRecursive'](_0x231dea,_0x446fb7):await this[_0x41fab6(0x102)](_0x231dea,_0x446fb7);}if(!_0x48cba0)return await this[_0x41fab6(0xfc)](_0x231dea);return _0x274740?await this[_0x41fab6(0xe4)](_0x231dea,_0x48cba0):await this[_0x41fab6(0x102)](_0x231dea,_0x48cba0);}catch(_0x3d098c){if(_0x3d098c instanceof SDKError)return console[_0x41fab6(0x10e)](_0x41fab6(0x127)+_0x3d098c[_0x41fab6(0xf4)]),_0x3d098c[_0x41fab6(0xf9)]&&console[_0x41fab6(0x10e)](_0x41fab6(0x11a)+_0x3d098c['cause']),0x1;throw _0x3d098c;}}async['listParentsWithPattern'](_0x1dbcbd,_0x5f1031){const _0xf68ad9=a33_0x375287,{options:_0x35f568,tdx:_0x310250}=_0x1dbcbd,_0x43f9de=await withSpinner(_0xf68ad9(0xea)+_0x5f1031+_0xf68ad9(0xfd),()=>_0x310250['segment'][_0xf68ad9(0xfc)](),{'verbose':_0x35f568[_0xf68ad9(0x104)]}),_0x355fa6=_0x43f9de[_0xf68ad9(0x111)],_0x284436=_0x5f1031[_0xf68ad9(0x107)](/[.+^${}()|[\]\\]/g,_0xf68ad9(0x10a))['replace'](/\*/g,'.*')[_0xf68ad9(0x107)](/\?/g,'.'),_0x4b56b1=new RegExp('^'+_0x284436+'$','i'),_0x5259a9=_0x355fa6[_0xf68ad9(0x125)](_0x43dfd4=>_0x4b56b1[_0xf68ad9(0xfe)](_0x43dfd4[_0xf68ad9(0xfb)][_0xf68ad9(0x11b)]));console['error']('✔\x20Found\x20'+_0x5259a9['length']+'\x20parent\x20segment'+(_0x5259a9[_0xf68ad9(0xe6)]!==0x1?'s':'')+_0xf68ad9(0xff)+_0x5f1031+'\x27');if(_0x35f568[_0xf68ad9(0xf8)]===_0xf68ad9(0xfa)||_0x35f568[_0xf68ad9(0xf8)]==='jsonl')await handleSDKOutput(_0x5259a9,_0x35f568);else{if(_0x5259a9[_0xf68ad9(0xe6)]===0x0)console[_0xf68ad9(0x124)](_0xf68ad9(0x11f)+_0x5f1031);else{console[_0xf68ad9(0x124)]('[parent\x20segments]');for(const _0x2a8010 of _0x5259a9){const _0xb488ab=_0x2a8010[_0xf68ad9(0xfb)][_0xf68ad9(0x116)]?a33_0x890f77[_0xf68ad9(0x108)]('\x20('+formatRows(_0x2a8010[_0xf68ad9(0xfb)][_0xf68ad9(0x116)])+')'):'';console[_0xf68ad9(0x124)](_0xf68ad9(0x123)+_0x2a8010[_0xf68ad9(0xfb)][_0xf68ad9(0x11b)]+_0xb488ab);}}}return 0x0;}async[a33_0x375287(0xfc)](_0x63002b){const _0x2830c5=a33_0x375287,{options:_0x27a0c2,tdx:_0xefe561}=_0x63002b,_0x7519e0=await withSpinner(_0x2830c5(0xed),()=>_0xefe561[_0x2830c5(0x10c)][_0x2830c5(0xfc)](),{'verbose':_0x27a0c2['verbose']}),_0x3bb367=_0x7519e0['data'];console[_0x2830c5(0x10e)](_0x2830c5(0x122)+_0x3bb367[_0x2830c5(0xe6)]+_0x2830c5(0x100)+(_0x3bb367[_0x2830c5(0xe6)]!==0x1?'s':''));if(_0x27a0c2[_0x2830c5(0xf8)]===_0x2830c5(0xfa)||_0x27a0c2[_0x2830c5(0xf8)]===_0x2830c5(0x113))await handleSDKOutput(_0x3bb367,_0x27a0c2);else{console[_0x2830c5(0x124)](_0x2830c5(0xe7));for(const _0x3cc942 of _0x3bb367){const _0x25127e=_0x3cc942[_0x2830c5(0xfb)][_0x2830c5(0x116)]?a33_0x890f77['dim']('\x20('+formatRows(_0x3cc942[_0x2830c5(0xfb)][_0x2830c5(0x116)])+')'):'';console[_0x2830c5(0x124)]('👥\x20'+_0x3cc942['attributes'][_0x2830c5(0x11b)]+_0x25127e);}}return 0x0;}async[a33_0x375287(0x102)](_0x3d35c3,_0x2c08e2){const _0x1fc851=a33_0x375287,{options:_0x82254d,tdx:_0x4dc833}=_0x3d35c3,_0x256e2d=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x2c08e2+_0x1fc851(0xfd),()=>_0x4dc833[_0x1fc851(0x10c)][_0x1fc851(0x117)](_0x2c08e2),{'verbose':_0x82254d['verbose']}),_0x4b6677=_0x256e2d['data'];_0x82254d['verbose']&&(console[_0x1fc851(0x10e)](_0x1fc851(0x110)+_0x4b6677['parentId']),_0x4b6677[_0x1fc851(0xf7)]&&console[_0x1fc851(0x10e)]('Folder\x20ID:\x20'+_0x4b6677[_0x1fc851(0xf7)]));const _0xa6b7e4=await withSpinner(_0x1fc851(0x11e),()=>_0x4dc833[_0x1fc851(0x10c)][_0x1fc851(0x102)](_0x4b6677[_0x1fc851(0xf5)],_0x4b6677[_0x1fc851(0xf7)]),{'verbose':_0x82254d['verbose']}),{folders:_0x3c20cc,segments:_0x53a84f}=_0xa6b7e4[_0x1fc851(0x111)],_0xc66c23=_0x3c20cc[_0x1fc851(0xe6)]+_0x53a84f['length'];console['error'](_0x1fc851(0x122)+_0x3c20cc[_0x1fc851(0xe6)]+_0x1fc851(0x11d)+(_0x3c20cc[_0x1fc851(0xe6)]!==0x1?'s':'')+_0x1fc851(0xec)+_0x53a84f[_0x1fc851(0xe6)]+'\x20segment'+(_0x53a84f[_0x1fc851(0xe6)]!==0x1?'s':''));if(_0x82254d[_0x1fc851(0xf8)]===_0x1fc851(0xfa)||_0x82254d[_0x1fc851(0xf8)]===_0x1fc851(0x113)){const _0x389576=[..._0x3c20cc[_0x1fc851(0x101)](_0x1c183b=>({..._0x1c183b,'type':_0x1fc851(0xe5)})),..._0x53a84f[_0x1fc851(0x101)](_0x396854=>({..._0x396854,'type':'segment'}))]['sort']((_0x39e36c,_0xfde7bd)=>_0x39e36c['name'][_0x1fc851(0x121)](_0xfde7bd[_0x1fc851(0x11b)]));await handleSDKOutput(_0x389576,_0x82254d);}else{if(_0xc66c23===0x0)console[_0x1fc851(0x124)](a33_0x890f77['dim']('[/'+_0x2c08e2+']')),console[_0x1fc851(0x124)]('(empty)');else{console['log'](a33_0x890f77['dim']('[/'+_0x2c08e2+']'));const _0x1e3d6d=formatFlatList(_0x3c20cc,_0x53a84f,{'showMetadata':!![]});console[_0x1fc851(0x124)](_0x1e3d6d);}}return 0x0;}async[a33_0x375287(0xe4)](_0x338125,_0x106831){const _0x464834=a33_0x375287,{options:_0xddb72d,tdx:_0x2ad819}=_0x338125,_0x13bbba=await withSpinner(_0x464834(0xef)+_0x106831+'\x27...',()=>_0x2ad819[_0x464834(0x10c)]['resolvePathToResource'](_0x106831),{'verbose':_0xddb72d['verbose']}),_0x3df995=_0x13bbba[_0x464834(0x111)];_0xddb72d[_0x464834(0x104)]&&(console[_0x464834(0x10e)](_0x464834(0x110)+_0x3df995[_0x464834(0xf5)]),_0x3df995['folderId']&&console[_0x464834(0x10e)](_0x464834(0x126)+_0x3df995[_0x464834(0xf7)]));const _0x168e17=_0xddb72d[_0x464834(0x11c)]||0xa,_0x3b8250=await withSpinner(_0x464834(0x10d),()=>_0x2ad819[_0x464834(0x10c)][_0x464834(0xe4)](_0x3df995[_0x464834(0xf5)],_0x3df995[_0x464834(0xf7)],0x0,_0x168e17),{'verbose':_0xddb72d[_0x464834(0x104)]}),_0x1cd18b=_0x3b8250['data'];console[_0x464834(0x10e)](_0x464834(0xf1)+_0x1cd18b[_0x464834(0xe6)]+'\x20top-level\x20items');if(_0xddb72d[_0x464834(0xf8)]===_0x464834(0xfa)||_0xddb72d[_0x464834(0xf8)]===_0x464834(0x113))await handleSDKOutput(_0x1cd18b,_0xddb72d);else{console[_0x464834(0x124)](a33_0x890f77[_0x464834(0x108)]('[/'+_0x106831+']'));const _0x226c42=formatTree(_0x1cd18b,{'showMetadata':!![]});console[_0x464834(0x124)](_0x226c42);}return 0x0;}}
1
+ function a33_0x1b5e(_0x4dc6c4,_0x135f63){const _0x4f2d35=a33_0x4f2d();return a33_0x1b5e=function(_0x1b5ee5,_0xabbde){_0x1b5ee5=_0x1b5ee5-0x82;let _0x5a1a8d=_0x4f2d35[_0x1b5ee5];return _0x5a1a8d;},a33_0x1b5e(_0x4dc6c4,_0x135f63);}const a33_0x1068df=a33_0x1b5e;(function(_0x3fa36f,_0x59063a){const _0x4c1c34=a33_0x1b5e,_0xa260fe=_0x3fa36f();while(!![]){try{const _0x35675e=parseInt(_0x4c1c34(0xb6))/0x1*(parseInt(_0x4c1c34(0x92))/0x2)+parseInt(_0x4c1c34(0xa7))/0x3*(parseInt(_0x4c1c34(0x87))/0x4)+-parseInt(_0x4c1c34(0x9e))/0x5+parseInt(_0x4c1c34(0x9d))/0x6+parseInt(_0x4c1c34(0x89))/0x7+-parseInt(_0x4c1c34(0xad))/0x8+parseInt(_0x4c1c34(0x8f))/0x9*(parseInt(_0x4c1c34(0xbc))/0xa);if(_0x35675e===_0x59063a)break;else _0xa260fe['push'](_0xa260fe['shift']());}catch(_0x5d59c5){_0xa260fe['push'](_0xa260fe['shift']());}}}(a33_0x4f2d,0x9484b));function a33_0x4f2d(){const _0x5f383c=['log','23DGruPC','segment','folderId','recursive','execute','json','233260OFFPrw','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','test','site','\x20parent\x20segment','maxDepth','\x5c$&','Current\x20context:\x20','verbose','attributes','data','👥\x20','message','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','\x20and\x20','sort','listParents','12QHhmft','listRecursive','2617580HAcOnu','resolvePathToResource','format','No\x20parent\x20segments\x20match\x20pattern:\x20','listParentsWithPattern','[parent\x20segments]','180oBGGjU','Recursive\x20mode:\x20enabled','dim','14100Gtkpet','population','description','Path/pattern\x20arg:\x20','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','listUnified','✔\x20Found\x20','replace','segmentPath','\x20top-level\x20items','\x20\x20Cause:\x20','2028762lmpmyu','4863010XGgERg','Listing\x20folders\x20and\x20segments...','jsonl','Site:\x20','folder','\x27...','Folder\x20ID:\x20','\x20segment','cause','857088rhLxLR','name','parentId','length','✔\x20Built\x20tree\x20with\x20','Parent\x20ID:\x20','4935136kzCWBS','Resolving\x20context\x20path\x20\x27','map','error','(empty)','\x20matching\x20\x27','Listing\x20parent\x20segments\x20matching\x20\x27','segments'];a33_0x4f2d=function(){return _0x5f383c;};return a33_0x4f2d();}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 a33_0x484237 from'chalk';export class SegmentsCommand extends BaseCommand{[a33_0x1068df(0xa8)]=a33_0x1068df(0xb4);[a33_0x1068df(0x94)]=a33_0x1068df(0x96);async[a33_0x1068df(0xba)](_0x5364dd){const _0x3b570b=a33_0x1068df,{options:_0x83853a,args:_0x412721}=_0x5364dd,_0x5001a3=_0x83853a[_0x3b570b(0xb9)],_0x201684=_0x412721[0x0];try{const _0x2a2eb4=_0x83853a[_0x3b570b(0x9a)];_0x83853a['verbose']&&(console['error'](_0x3b570b(0xa1)+_0x83853a[_0x3b570b(0xbf)]),console['error'](_0x3b570b(0xc3)+(_0x2a2eb4||'/')),_0x201684&&console[_0x3b570b(0xb0)](_0x3b570b(0x95)+_0x201684),_0x5001a3&&console[_0x3b570b(0xb0)](_0x3b570b(0x90)));if(_0x201684){const _0x435473=_0x201684['includes']('*')||_0x201684['includes']('?');if(_0x435473&&!_0x2a2eb4)return await this['listParentsWithPattern'](_0x5364dd,_0x201684);else return _0x435473?(console[_0x3b570b(0xb0)](_0x3b570b(0x83)),console[_0x3b570b(0xb0)](_0x3b570b(0xbd)),0x1):_0x5001a3?await this['listRecursive'](_0x5364dd,_0x201684):await this['listUnified'](_0x5364dd,_0x201684);}if(!_0x2a2eb4)return await this[_0x3b570b(0x86)](_0x5364dd);return _0x5001a3?await this[_0x3b570b(0x88)](_0x5364dd,_0x2a2eb4):await this[_0x3b570b(0x97)](_0x5364dd,_0x2a2eb4);}catch(_0x196026){if(_0x196026 instanceof SDKError)return console[_0x3b570b(0xb0)]('Error:\x20'+_0x196026[_0x3b570b(0x82)]),_0x196026[_0x3b570b(0xa6)]&&console[_0x3b570b(0xb0)](_0x3b570b(0x9c)+_0x196026[_0x3b570b(0xa6)]),0x1;throw _0x196026;}}async[a33_0x1068df(0x8d)](_0xc575b3,_0xd9949d){const _0x543ba0=a33_0x1068df,{options:_0x330b5e,tdx:_0x552636}=_0xc575b3,_0x22e762=await withSpinner(_0x543ba0(0xb3)+_0xd9949d+_0x543ba0(0xa3),()=>_0x552636[_0x543ba0(0xb7)][_0x543ba0(0x86)](),{'verbose':_0x330b5e[_0x543ba0(0xc4)]}),_0x425576=_0x22e762[_0x543ba0(0xc6)],_0x349724=_0xd9949d['replace'](/[.+^${}()|[\]\\]/g,_0x543ba0(0xc2))[_0x543ba0(0x99)](/\*/g,'.*')[_0x543ba0(0x99)](/\?/g,'.'),_0x3efd6e=new RegExp('^'+_0x349724+'$','i'),_0x43de74=_0x425576['filter'](_0x3fa567=>_0x3efd6e[_0x543ba0(0xbe)](_0x3fa567['attributes'][_0x543ba0(0xa8)]));console[_0x543ba0(0xb0)](_0x543ba0(0x98)+_0x43de74[_0x543ba0(0xaa)]+_0x543ba0(0xc0)+(_0x43de74[_0x543ba0(0xaa)]!==0x1?'s':'')+_0x543ba0(0xb2)+_0xd9949d+'\x27');if(_0x330b5e[_0x543ba0(0x8b)]===_0x543ba0(0xbb)||_0x330b5e[_0x543ba0(0x8b)]===_0x543ba0(0xa0))await handleSDKOutput(_0x43de74,_0x330b5e);else{if(_0x43de74[_0x543ba0(0xaa)]===0x0)console['log'](_0x543ba0(0x8c)+_0xd9949d);else{console['log']('[parent\x20segments]');for(const _0x3cc286 of _0x43de74){const _0x5d77d3=_0x3cc286[_0x543ba0(0xc5)]['population']?a33_0x484237[_0x543ba0(0x91)]('\x20('+formatRows(_0x3cc286['attributes'][_0x543ba0(0x93)])+')'):'';console['log'](_0x543ba0(0xc7)+_0x3cc286[_0x543ba0(0xc5)][_0x543ba0(0xa8)]+_0x5d77d3);}}}return 0x0;}async[a33_0x1068df(0x86)](_0x559c7e){const _0x25937f=a33_0x1068df,{options:_0x33b38e,tdx:_0x63c2a4}=_0x559c7e,_0x276248=await withSpinner('Listing\x20parent\x20segments...',()=>_0x63c2a4[_0x25937f(0xb7)][_0x25937f(0x86)](),{'verbose':_0x33b38e[_0x25937f(0xc4)]}),_0xf1e9fe=_0x276248[_0x25937f(0xc6)];console[_0x25937f(0xb0)](_0x25937f(0x98)+_0xf1e9fe[_0x25937f(0xaa)]+'\x20parent\x20segment'+(_0xf1e9fe[_0x25937f(0xaa)]!==0x1?'s':''));if(_0x33b38e[_0x25937f(0x8b)]===_0x25937f(0xbb)||_0x33b38e[_0x25937f(0x8b)]===_0x25937f(0xa0))await handleSDKOutput(_0xf1e9fe,_0x33b38e);else{console[_0x25937f(0xb5)](_0x25937f(0x8e));for(const _0x503d69 of _0xf1e9fe){const _0x2bc740=_0x503d69[_0x25937f(0xc5)][_0x25937f(0x93)]?a33_0x484237[_0x25937f(0x91)]('\x20('+formatRows(_0x503d69[_0x25937f(0xc5)][_0x25937f(0x93)])+')'):'';console[_0x25937f(0xb5)](_0x25937f(0xc7)+_0x503d69[_0x25937f(0xc5)]['name']+_0x2bc740);}}return 0x0;}async['listUnified'](_0x150f5a,_0x140375){const _0x3ce85d=a33_0x1068df,{options:_0x3e1488,tdx:_0x46ab0b}=_0x150f5a,_0x4b7a9b=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x140375+_0x3ce85d(0xa3),()=>_0x46ab0b['segment'][_0x3ce85d(0x8a)](_0x140375),{'verbose':_0x3e1488[_0x3ce85d(0xc4)]}),_0x3ba0d2=_0x4b7a9b['data'];_0x3e1488['verbose']&&(console[_0x3ce85d(0xb0)](_0x3ce85d(0xac)+_0x3ba0d2[_0x3ce85d(0xa9)]),_0x3ba0d2['folderId']&&console[_0x3ce85d(0xb0)](_0x3ce85d(0xa4)+_0x3ba0d2[_0x3ce85d(0xb8)]));const _0x275260=await withSpinner(_0x3ce85d(0x9f),()=>_0x46ab0b[_0x3ce85d(0xb7)][_0x3ce85d(0x97)](_0x3ba0d2[_0x3ce85d(0xa9)],_0x3ba0d2['folderId']),{'verbose':_0x3e1488['verbose']}),{folders:_0x3c3b27,segments:_0x40eb36}=_0x275260['data'],_0x3a500a=_0x3c3b27[_0x3ce85d(0xaa)]+_0x40eb36[_0x3ce85d(0xaa)];console[_0x3ce85d(0xb0)](_0x3ce85d(0x98)+_0x3c3b27[_0x3ce85d(0xaa)]+'\x20folder'+(_0x3c3b27['length']!==0x1?'s':'')+_0x3ce85d(0x84)+_0x40eb36[_0x3ce85d(0xaa)]+_0x3ce85d(0xa5)+(_0x40eb36[_0x3ce85d(0xaa)]!==0x1?'s':''));if(_0x3e1488[_0x3ce85d(0x8b)]===_0x3ce85d(0xbb)||_0x3e1488[_0x3ce85d(0x8b)]===_0x3ce85d(0xa0)){const _0x53ef8c=[..._0x3c3b27[_0x3ce85d(0xaf)](_0x4e2986=>({..._0x4e2986,'type':_0x3ce85d(0xa2)})),..._0x40eb36[_0x3ce85d(0xaf)](_0x343e49=>({..._0x343e49,'type':_0x3ce85d(0xb7)}))][_0x3ce85d(0x85)]((_0x485f6d,_0xc593e1)=>_0x485f6d[_0x3ce85d(0xa8)]['localeCompare'](_0xc593e1['name']));await handleSDKOutput(_0x53ef8c,_0x3e1488);}else{if(_0x3a500a===0x0)console['log'](a33_0x484237[_0x3ce85d(0x91)]('[/'+_0x140375+']')),console[_0x3ce85d(0xb5)](_0x3ce85d(0xb1));else{console['log'](a33_0x484237[_0x3ce85d(0x91)]('[/'+_0x140375+']'));const _0x13eb12=formatFlatList(_0x3c3b27,_0x40eb36,{'showMetadata':!![]});console[_0x3ce85d(0xb5)](_0x13eb12);}}return 0x0;}async[a33_0x1068df(0x88)](_0x52e22e,_0x2f8d66){const _0xe9b58a=a33_0x1068df,{options:_0xfd1d87,tdx:_0x1f9256}=_0x52e22e,_0xef9c7=await withSpinner(_0xe9b58a(0xae)+_0x2f8d66+_0xe9b58a(0xa3),()=>_0x1f9256['segment'][_0xe9b58a(0x8a)](_0x2f8d66),{'verbose':_0xfd1d87['verbose']}),_0x66623a=_0xef9c7['data'];_0xfd1d87[_0xe9b58a(0xc4)]&&(console[_0xe9b58a(0xb0)]('Parent\x20ID:\x20'+_0x66623a['parentId']),_0x66623a[_0xe9b58a(0xb8)]&&console[_0xe9b58a(0xb0)](_0xe9b58a(0xa4)+_0x66623a[_0xe9b58a(0xb8)]));const _0x22f310=_0xfd1d87[_0xe9b58a(0xc1)]||0xa,_0x2a373a=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x1f9256['segment']['listRecursive'](_0x66623a[_0xe9b58a(0xa9)],_0x66623a[_0xe9b58a(0xb8)],0x0,_0x22f310),{'verbose':_0xfd1d87[_0xe9b58a(0xc4)]}),_0x565043=_0x2a373a[_0xe9b58a(0xc6)];console['error'](_0xe9b58a(0xab)+_0x565043['length']+_0xe9b58a(0x9b));if(_0xfd1d87[_0xe9b58a(0x8b)]==='json'||_0xfd1d87['format']===_0xe9b58a(0xa0))await handleSDKOutput(_0x565043,_0xfd1d87);else{console[_0xe9b58a(0xb5)](a33_0x484237['dim']('[/'+_0x2f8d66+']'));const _0xeaadda=formatTree(_0x565043,{'showMetadata':!![]});console[_0xe9b58a(0xb5)](_0xeaadda);}return 0x0;}}
@@ -1 +1 @@
1
- const a34_0x4ac922=a34_0x2bb3;(function(_0x2a6661,_0x142b97){const _0x300fac=a34_0x2bb3,_0x135700=_0x2a6661();while(!![]){try{const _0x54b5e6=-parseInt(_0x300fac(0x173))/0x1*(parseInt(_0x300fac(0x14c))/0x2)+-parseInt(_0x300fac(0x148))/0x3+-parseInt(_0x300fac(0x172))/0x4+parseInt(_0x300fac(0x149))/0x5*(-parseInt(_0x300fac(0x15a))/0x6)+-parseInt(_0x300fac(0x15f))/0x7*(-parseInt(_0x300fac(0x155))/0x8)+parseInt(_0x300fac(0x14e))/0x9+-parseInt(_0x300fac(0x158))/0xa*(-parseInt(_0x300fac(0x15d))/0xb);if(_0x54b5e6===_0x142b97)break;else _0x135700['push'](_0x135700['shift']());}catch(_0x348606){_0x135700['push'](_0x135700['shift']());}}}(a34_0x2015,0x351af));function a34_0x2015(){const _0x1ca1f9=['...','223298EIaUbo','Show\x20table\x20contents','1258812BJQzCr','show','description','Catalog:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','cause','32ZMzxTH','validate','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','87490ilioCn','Error:\x20','2009634pzUfbB','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','Site:\x20','825xiyXFC','error','291872LoDTsy','message','Table:\x20','length','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','database','query','verbose','site','name','\x20\x20Cause:\x20','showTable','args','table','Database:\x20','data','\x20row','limit','Usage:\x20tdx\x20show\x20<database.table>','337580bNGmIN','1GDkSsa','642975deEVfd','5zRkxby','catalog'];a34_0x2015=function(){return _0x1ca1f9;};return a34_0x2015();}function a34_0x2bb3(_0x55e1d7,_0x30b495){const _0x20154f=a34_0x2015();return a34_0x2bb3=function(_0x2bb33e,_0x3d63c4){_0x2bb33e=_0x2bb33e-0x148;let _0x2ea764=_0x20154f[_0x2bb33e];return _0x2ea764;},a34_0x2bb3(_0x55e1d7,_0x30b495);}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a34_0x4ac922(0x168)]=a34_0x4ac922(0x14f);[a34_0x4ac922(0x150)]=a34_0x4ac922(0x14d);async['execute'](_0x4e3cff){const _0x2e1ce5=a34_0x4ac922;return this[_0x2e1ce5(0x16a)](_0x4e3cff);}async[a34_0x4ac922(0x16a)](_0x11cbac){const _0x53cefc=a34_0x4ac922,{options:_0xf3ef4e,args:_0x2c408e,tdx:_0x32ba68}=_0x11cbac;let _0x2c8cbb;try{_0x2c8cbb=parseTableReference(_0x2c408e[0x0]);const _0xd6d27b=_0xf3ef4e[_0x53cefc(0x164)];!_0x2c8cbb[_0x53cefc(0x164)]&&_0xd6d27b&&(_0x2c8cbb['database']=_0xd6d27b);const _0x3f7d39=validateTableDescribeReference(_0x2c8cbb);if(_0x3f7d39)return console[_0x53cefc(0x15e)](_0x53cefc(0x159)+_0x3f7d39),console[_0x53cefc(0x15e)](_0x53cefc(0x171)),console[_0x53cefc(0x15e)](_0x53cefc(0x163)),console[_0x53cefc(0x15e)](_0x53cefc(0x153)),0x1;}catch(_0x2c9a74){return console['error'](_0x53cefc(0x159)+_0x2c9a74['message']),console[_0x53cefc(0x15e)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x53cefc(0x15e)](_0x53cefc(0x163)),console['error'](_0x53cefc(0x153)),0x1;}const _0x4d61bc=_0x2c8cbb[_0x53cefc(0x14a)],_0x5ef4bb=_0x2c8cbb[_0x53cefc(0x164)],_0x2b0579=_0x2c8cbb[_0x53cefc(0x16c)],_0x2b7087=resolveLimit(_0xf3ef4e[_0x53cefc(0x170)],DEFAULT_DISPLAY_LIMIT);try{_0xf3ef4e[_0x53cefc(0x166)]&&(console[_0x53cefc(0x15e)](_0x53cefc(0x15c)+_0xf3ef4e[_0x53cefc(0x167)]),_0x4d61bc&&console[_0x53cefc(0x15e)](_0x53cefc(0x151)+_0x4d61bc),console[_0x53cefc(0x15e)](_0x53cefc(0x16d)+_0x5ef4bb),console[_0x53cefc(0x15e)](_0x53cefc(0x161)+_0x2b0579),console[_0x53cefc(0x15e)]('Limit:\x20'+_0x2b7087));const _0x151c7f=_0x4d61bc?_0x4d61bc+'.'+_0x5ef4bb+'.'+_0x2b0579:_0x5ef4bb+'.'+_0x2b0579,_0x3df78a=await withSpinner('Querying\x20'+_0x151c7f+_0x53cefc(0x14b),()=>_0x32ba68[_0x53cefc(0x165)][_0x53cefc(0x16a)](_0x5ef4bb,_0x2b0579,_0x2b7087,_0x4d61bc),{'verbose':_0xf3ef4e[_0x53cefc(0x166)]}),_0x3952b1=_0x3df78a[_0x53cefc(0x16e)],_0xcefbc9=_0x3952b1[_0x53cefc(0x16e)];return _0xcefbc9['length']===0x0?console[_0x53cefc(0x15e)](_0x53cefc(0x152)):console[_0x53cefc(0x15e)]('✔\x20Retrieved\x20'+_0xcefbc9[_0x53cefc(0x162)]+_0x53cefc(0x16f)+(_0xcefbc9['length']!==0x1?'s':'')+'\x20from\x20'+_0x151c7f),await handleSDKOutput(_0xcefbc9,_0xf3ef4e),0x0;}catch(_0x4f8913){if(_0x4f8913 instanceof SDKError)return console[_0x53cefc(0x15e)]('Error:\x20'+_0x4f8913[_0x53cefc(0x160)]),_0x4f8913['cause']&&console[_0x53cefc(0x15e)](_0x53cefc(0x169)+_0x4f8913[_0x53cefc(0x154)]),0x1;throw _0x4f8913;}}[a34_0x4ac922(0x156)](_0x57f1dc){const _0x3ad9ca=a34_0x4ac922;if(_0x57f1dc[_0x3ad9ca(0x16b)][_0x3ad9ca(0x162)]===0x0)return _0x3ad9ca(0x15b);if(_0x57f1dc['args']['length']>0x1)return _0x3ad9ca(0x157);return undefined;}}
1
+ const a34_0x1ba000=a34_0x64e0;(function(_0xfeb34a,_0x3eddf4){const _0x50f54c=a34_0x64e0,_0x1f0410=_0xfeb34a();while(!![]){try{const _0x10163d=parseInt(_0x50f54c(0x1ff))/0x1*(parseInt(_0x50f54c(0x1f0))/0x2)+parseInt(_0x50f54c(0x204))/0x3+parseInt(_0x50f54c(0x1e8))/0x4*(-parseInt(_0x50f54c(0x1f3))/0x5)+parseInt(_0x50f54c(0x1db))/0x6*(-parseInt(_0x50f54c(0x1ed))/0x7)+parseInt(_0x50f54c(0x1f9))/0x8*(parseInt(_0x50f54c(0x1da))/0x9)+-parseInt(_0x50f54c(0x1d8))/0xa+-parseInt(_0x50f54c(0x1e0))/0xb*(-parseInt(_0x50f54c(0x1ee))/0xc);if(_0x10163d===_0x3eddf4)break;else _0x1f0410['push'](_0x1f0410['shift']());}catch(_0x3aa351){_0x1f0410['push'](_0x1f0410['shift']());}}}(a34_0xcdda,0x9b25a));import{BaseCommand}from'./command.js';function a34_0x64e0(_0x3dbd78,_0x31fbad){const _0xcdda81=a34_0xcdda();return a34_0x64e0=function(_0x64e0ec,_0xdd8446){_0x64e0ec=_0x64e0ec-0x1d7;let _0x5d9206=_0xcdda81[_0x64e0ec];return _0x5d9206;},a34_0x64e0(_0x3dbd78,_0x31fbad);}import{SDKError}from'../sdk/index.js';function a34_0xcdda(){const _0x254557=['name','\x20from\x20','2340234PFDYKU','Database:\x20','9076990egpycw','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','657xyMVtE','4572258fcozol','limit','execute','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Limit:\x20','15002020sSkBcc','verbose','length','cause','table','\x20\x20Cause:\x20','Error:\x20','validate','4GSmhpi','Catalog:\x20','database','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','catalog','7HFcIjS','12vsseFh','show','1631638QoxfEo','data','error','4855470PkspkA','query','Site:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','...','Usage:\x20tdx\x20show\x20<database.table>','34696OHDxRX','site','Querying\x20','Show\x20table\x20contents','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','showTable','1dAnzLN','\x20row','message'];a34_0xcdda=function(){return _0x254557;};return a34_0xcdda();}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a34_0x1ba000(0x202)]=a34_0x1ba000(0x1ef);['description']=a34_0x1ba000(0x1fc);async[a34_0x1ba000(0x1dd)](_0x5c7755){return this['showTable'](_0x5c7755);}async['showTable'](_0x593ecc){const _0x27dc51=a34_0x1ba000,{options:_0x3fd084,args:_0x4aa488,tdx:_0x5b938e}=_0x593ecc;let _0x234ac6;try{_0x234ac6=parseTableReference(_0x4aa488[0x0]);const _0xb46a5d=_0x3fd084['database'];!_0x234ac6[_0x27dc51(0x1ea)]&&_0xb46a5d&&(_0x234ac6[_0x27dc51(0x1ea)]=_0xb46a5d);const _0x4240a3=validateTableDescribeReference(_0x234ac6);if(_0x4240a3)return console[_0x27dc51(0x1f2)](_0x27dc51(0x1e6)+_0x4240a3),console[_0x27dc51(0x1f2)](_0x27dc51(0x1f8)),console['error'](_0x27dc51(0x1d9)),console['error'](_0x27dc51(0x1fd)),0x1;}catch(_0x23e870){return console['error'](_0x27dc51(0x1e6)+_0x23e870[_0x27dc51(0x201)]),console[_0x27dc51(0x1f2)](_0x27dc51(0x1f8)),console[_0x27dc51(0x1f2)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x27dc51(0x1f2)](_0x27dc51(0x1fd)),0x1;}const _0x3df6b5=_0x234ac6[_0x27dc51(0x1ec)],_0x2f8bc5=_0x234ac6[_0x27dc51(0x1ea)],_0x42ec3c=_0x234ac6[_0x27dc51(0x1e4)],_0x1f4255=resolveLimit(_0x3fd084[_0x27dc51(0x1dc)],DEFAULT_DISPLAY_LIMIT);try{_0x3fd084[_0x27dc51(0x1e1)]&&(console[_0x27dc51(0x1f2)](_0x27dc51(0x1f5)+_0x3fd084[_0x27dc51(0x1fa)]),_0x3df6b5&&console[_0x27dc51(0x1f2)](_0x27dc51(0x1e9)+_0x3df6b5),console['error'](_0x27dc51(0x1d7)+_0x2f8bc5),console['error']('Table:\x20'+_0x42ec3c),console[_0x27dc51(0x1f2)](_0x27dc51(0x1df)+_0x1f4255));const _0x3f94ab=_0x3df6b5?_0x3df6b5+'.'+_0x2f8bc5+'.'+_0x42ec3c:_0x2f8bc5+'.'+_0x42ec3c,_0x1f2016=await withSpinner(_0x27dc51(0x1fb)+_0x3f94ab+_0x27dc51(0x1f7),()=>_0x5b938e[_0x27dc51(0x1f4)][_0x27dc51(0x1fe)](_0x2f8bc5,_0x42ec3c,_0x1f4255,_0x3df6b5),{'verbose':_0x3fd084['verbose']}),_0x4bf063=_0x1f2016[_0x27dc51(0x1f1)],_0x3b42a4=_0x4bf063[_0x27dc51(0x1f1)];return _0x3b42a4[_0x27dc51(0x1e2)]===0x0?console['error'](_0x27dc51(0x1de)):console[_0x27dc51(0x1f2)]('✔\x20Retrieved\x20'+_0x3b42a4[_0x27dc51(0x1e2)]+_0x27dc51(0x200)+(_0x3b42a4[_0x27dc51(0x1e2)]!==0x1?'s':'')+_0x27dc51(0x203)+_0x3f94ab),await handleSDKOutput(_0x3b42a4,_0x3fd084),0x0;}catch(_0xa3395a){if(_0xa3395a instanceof SDKError)return console['error'](_0x27dc51(0x1e6)+_0xa3395a[_0x27dc51(0x201)]),_0xa3395a[_0x27dc51(0x1e3)]&&console[_0x27dc51(0x1f2)](_0x27dc51(0x1e5)+_0xa3395a['cause']),0x1;throw _0xa3395a;}}[a34_0x1ba000(0x1e7)](_0x1f0837){const _0x5d3a92=a34_0x1ba000;if(_0x1f0837['args'][_0x5d3a92(0x1e2)]===0x0)return _0x5d3a92(0x1eb);if(_0x1f0837['args'][_0x5d3a92(0x1e2)]>0x1)return _0x5d3a92(0x1f6);return undefined;}}
@@ -1 +1 @@
1
- function a35_0x29ec(){const _0x289ecc=['\x20table','219200UzBkHB','length','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','519834WxzoLB','Error:\x20','266106ecyvcD','196889vvNcCs','\x20\x20Use:\x20tdx\x20tables\x20\x22','5Antwdq','tables','message','database','Database\x20pattern:\x20','Note:\x20\x27','.*\x22','includes','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Listing\x20tables...','Site:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','\x20\x20Cause:\x20','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','cause','39621cdNDCR','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','description','334990OTduDj','error','validate','limit','60HZpWub','verbose','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','site','27IPOdgn','✖\x20No\x20tables\x20found','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','16VGdvxm','207645XUlHes','Table\x20pattern:\x20','table','\x27\x20across\x20all\x20databases.','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','\x27\x20is\x20ambiguous.'];a35_0x29ec=function(){return _0x289ecc;};return a35_0x29ec();}function a35_0x3ea9(_0x1028b6,_0x48c5f2){const _0x29ec57=a35_0x29ec();return a35_0x3ea9=function(_0x3ea9b0,_0x51fd66){_0x3ea9b0=_0x3ea9b0-0x10d;let _0x5e804b=_0x29ec57[_0x3ea9b0];return _0x5e804b;},a35_0x3ea9(_0x1028b6,_0x48c5f2);}const a35_0x4ce7f7=a35_0x3ea9;(function(_0x5a9866,_0x3496cd){const _0x2e97db=a35_0x3ea9,_0xe55174=_0x5a9866();while(!![]){try{const _0x2c3fc0=parseInt(_0x2e97db(0x10e))/0x1+parseInt(_0x2e97db(0x115))/0x2+parseInt(_0x2e97db(0x12c))/0x3*(-parseInt(_0x2e97db(0x133))/0x4)+-parseInt(_0x2e97db(0x11d))/0x5*(parseInt(_0x2e97db(0x11a))/0x6)+parseInt(_0x2e97db(0x118))/0x7*(parseInt(_0x2e97db(0x10d))/0x8)+-parseInt(_0x2e97db(0x137))/0x9*(parseInt(_0x2e97db(0x12f))/0xa)+-parseInt(_0x2e97db(0x11b))/0xb;if(_0x2c3fc0===_0x3496cd)break;else _0xe55174['push'](_0xe55174['shift']());}catch(_0x1b5831){_0xe55174['push'](_0xe55174['shift']());}}}(a35_0x29ec,0x199d5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{['name']=a35_0x4ce7f7(0x11e);[a35_0x4ce7f7(0x12e)]='List\x20tables\x20in\x20a\x20database';async['execute'](_0x34ef31){const _0x1e45ba=a35_0x4ce7f7,{options:_0x2378bf,args:_0x5c7137,tdx:_0x112bc5}=_0x34ef31;let _0x53f358;if(_0x5c7137[_0x1e45ba(0x116)]===0x0)_0x53f358={'database':undefined,'table':undefined,'original':''};else{if(_0x5c7137[_0x1e45ba(0x116)]===0x1)try{_0x53f358=parseTableReference(_0x5c7137[0x0]);if(_0x53f358[_0x1e45ba(0x110)]&&!_0x53f358[_0x1e45ba(0x120)]&&!_0x53f358[_0x1e45ba(0x110)][_0x1e45ba(0x124)]('*')&&!_0x53f358[_0x1e45ba(0x110)][_0x1e45ba(0x124)]('?'))return console['error']('Error:\x20Pattern\x20\x27'+_0x5c7137[0x0]+_0x1e45ba(0x113)),console[_0x1e45ba(0x130)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x53f358[_0x1e45ba(0x110)]+'\x27?'),console[_0x1e45ba(0x130)](_0x1e45ba(0x11c)+_0x53f358['table']+_0x1e45ba(0x123)),console[_0x1e45ba(0x130)](_0x1e45ba(0x128)+_0x53f358[_0x1e45ba(0x110)]),console[_0x1e45ba(0x130)](_0x1e45ba(0x125)+_0x53f358[_0x1e45ba(0x110)]),console[_0x1e45ba(0x130)](''),console[_0x1e45ba(0x130)](_0x1e45ba(0x122)+_0x5c7137[0x0]+_0x1e45ba(0x12a)+_0x53f358['table']+_0x1e45ba(0x111)),0x1;}catch(_0x4de77f){return console[_0x1e45ba(0x130)]('Error:\x20'+_0x4de77f[_0x1e45ba(0x11f)]),0x1;}else return console[_0x1e45ba(0x130)](_0x1e45ba(0x135)),console['error']('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console['error'](_0x1e45ba(0x139)),console[_0x1e45ba(0x130)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x1e45ba(0x130)](_0x1e45ba(0x112)),console[_0x1e45ba(0x130)]('Or\x20use\x20--in\x20flag:'),console['error'](_0x1e45ba(0x12d)),0x1;}const _0x3e5524=_0x2378bf[_0x1e45ba(0x120)];!_0x53f358['database']&&_0x3e5524&&(_0x53f358[_0x1e45ba(0x120)]=_0x3e5524);try{const _0x3e9895=_0x23f34b=>_0x23f34b&&(_0x23f34b[_0x1e45ba(0x124)]('*')||_0x23f34b['includes']('?')),_0x5753f8=_0x3e9895(_0x53f358[_0x1e45ba(0x120)]);_0x2378bf['verbose']&&(console[_0x1e45ba(0x130)](_0x1e45ba(0x127)+_0x2378bf[_0x1e45ba(0x136)]),_0x53f358[_0x1e45ba(0x120)]?_0x5753f8?console[_0x1e45ba(0x130)](_0x1e45ba(0x121)+_0x53f358[_0x1e45ba(0x120)]):console[_0x1e45ba(0x130)]('Database:\x20'+_0x53f358[_0x1e45ba(0x120)]):console[_0x1e45ba(0x130)]('Database:\x20all'),_0x53f358[_0x1e45ba(0x110)]&&console[_0x1e45ba(0x130)](_0x1e45ba(0x10f)+_0x53f358[_0x1e45ba(0x110)]));const _0x50fdda=_0x53f358[_0x1e45ba(0x120)]&&!_0x5753f8?_0x53f358['database']:undefined,_0x525317=_0x5753f8?_0x53f358[_0x1e45ba(0x120)]:undefined,_0xe8fd33=_0x53f358[_0x1e45ba(0x110)],_0x125662=resolveLimit(_0x2378bf[_0x1e45ba(0x132)],DEFAULT_LISTING_LIMIT),_0x396153=await withSpinner(_0x1e45ba(0x126),()=>_0x112bc5['query']['listTables'](_0x50fdda,_0xe8fd33,_0x525317,_0x125662),{'verbose':_0x2378bf[_0x1e45ba(0x134)]}),_0xf86a08=_0x396153['data'];if(_0xf86a08[_0x1e45ba(0x116)]===0x0&&_0x53f358['database']&&!_0x5753f8)return console[_0x1e45ba(0x130)](_0x1e45ba(0x138)),console[_0x1e45ba(0x130)]('Database\x20\x27'+_0x53f358[_0x1e45ba(0x120)]+_0x1e45ba(0x117)),0x1;return console['error']('✔\x20Found\x20'+_0xf86a08['length']+_0x1e45ba(0x114)+(_0xf86a08[_0x1e45ba(0x116)]!==0x1?'s':'')),await handleSDKOutput(_0xf86a08,{..._0x2378bf,'limit':_0x125662}),0x0;}catch(_0x15f4da){if(_0x15f4da instanceof SDKError)return console[_0x1e45ba(0x130)](_0x1e45ba(0x119)+_0x15f4da['message']),_0x15f4da[_0x1e45ba(0x12b)]&&console[_0x1e45ba(0x130)](_0x1e45ba(0x129)+_0x15f4da[_0x1e45ba(0x12b)]),0x1;throw _0x15f4da;}}[a35_0x4ce7f7(0x131)](_0x2aa291){return undefined;}}
1
+ const a35_0x4d82cf=a35_0x4f05;(function(_0x30d944,_0x40c3d5){const _0x1f6da=a35_0x4f05,_0x42c635=_0x30d944();while(!![]){try{const _0x40f3d5=parseInt(_0x1f6da(0x132))/0x1+-parseInt(_0x1f6da(0x138))/0x2*(parseInt(_0x1f6da(0x12a))/0x3)+parseInt(_0x1f6da(0x123))/0x4+parseInt(_0x1f6da(0x145))/0x5+-parseInt(_0x1f6da(0x143))/0x6+-parseInt(_0x1f6da(0x126))/0x7*(-parseInt(_0x1f6da(0x130))/0x8)+parseInt(_0x1f6da(0x12b))/0x9;if(_0x40f3d5===_0x40c3d5)break;else _0x42c635['push'](_0x42c635['shift']());}catch(_0x4d7d11){_0x42c635['push'](_0x42c635['shift']());}}}(a35_0x404e,0x6e059));function a35_0x404e(){const _0x1865cd=['Or\x20use\x20--in\x20flag:','284790cWPIaP','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Table\x20pattern:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','Site:\x20','verbose','50842vxizyy','Database:\x20all','.*\x22','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Database:\x20','site','tables','includes','cause','message','Error:\x20Pattern\x20\x27','4728936cpKyHm','table','282025ZaDKHa','length','\x27\x20across\x20all\x20databases.','description','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','execute','Error:\x20','Database\x20\x27','database','Listing\x20tables...','\x20\x20Use:\x20tdx\x20tables\x20\x22','data','validate','\x20\x20Cause:\x20','1913148zARaiN','✔\x20Found\x20','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','82124pIBxag','\x27\x20is\x20ambiguous.','List\x20tables\x20in\x20a\x20database','\x20table','99QwvjUS','10162476hCsVCG','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','name','error','limit','88lLygyO'];a35_0x404e=function(){return _0x1865cd;};return a35_0x404e();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a35_0x4f05(_0x552ac6,_0x5368e6){const _0x404e2b=a35_0x404e();return a35_0x4f05=function(_0x4f0578,_0x38f08a){_0x4f0578=_0x4f0578-0x11d;let _0x34ff32=_0x404e2b[_0x4f0578];return _0x34ff32;},a35_0x4f05(_0x552ac6,_0x5368e6);}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a35_0x4d82cf(0x12d)]=a35_0x4d82cf(0x13e);[a35_0x4d82cf(0x148)]=a35_0x4d82cf(0x128);async[a35_0x4d82cf(0x14a)](_0x4a243f){const _0x2e2af4=a35_0x4d82cf,{options:_0x25e2f6,args:_0x1fc973,tdx:_0x120931}=_0x4a243f;let _0x1b1a8c;if(_0x1fc973[_0x2e2af4(0x146)]===0x0)_0x1b1a8c={'database':undefined,'table':undefined,'original':''};else{if(_0x1fc973[_0x2e2af4(0x146)]===0x1)try{_0x1b1a8c=parseTableReference(_0x1fc973[0x0]);if(_0x1b1a8c[_0x2e2af4(0x144)]&&!_0x1b1a8c[_0x2e2af4(0x11d)]&&!_0x1b1a8c[_0x2e2af4(0x144)][_0x2e2af4(0x13f)]('*')&&!_0x1b1a8c[_0x2e2af4(0x144)][_0x2e2af4(0x13f)]('?'))return console[_0x2e2af4(0x12e)](_0x2e2af4(0x142)+_0x1fc973[0x0]+_0x2e2af4(0x127)),console[_0x2e2af4(0x12e)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x1b1a8c[_0x2e2af4(0x144)]+'\x27?'),console['error'](_0x2e2af4(0x11f)+_0x1b1a8c['table']+_0x2e2af4(0x13a)),console[_0x2e2af4(0x12e)](_0x2e2af4(0x135)+_0x1b1a8c['table']),console[_0x2e2af4(0x12e)](_0x2e2af4(0x133)+_0x1b1a8c[_0x2e2af4(0x144)]),console['error'](''),console[_0x2e2af4(0x12e)]('Note:\x20\x27'+_0x1fc973[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x1b1a8c[_0x2e2af4(0x144)]+_0x2e2af4(0x147)),0x1;}catch(_0x4440c3){return console[_0x2e2af4(0x12e)](_0x2e2af4(0x14b)+_0x4440c3[_0x2e2af4(0x141)]),0x1;}else return console[_0x2e2af4(0x12e)](_0x2e2af4(0x149)),console['error']('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x2e2af4(0x12e)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x2e2af4(0x12e)](_0x2e2af4(0x125)),console['error'](_0x2e2af4(0x13b)),console[_0x2e2af4(0x12e)](_0x2e2af4(0x131)),console[_0x2e2af4(0x12e)](_0x2e2af4(0x12c)),0x1;}const _0x3a83ae=_0x25e2f6[_0x2e2af4(0x11d)];!_0x1b1a8c['database']&&_0x3a83ae&&(_0x1b1a8c[_0x2e2af4(0x11d)]=_0x3a83ae);try{const _0x1ee97b=_0x3f9fe0=>_0x3f9fe0&&(_0x3f9fe0[_0x2e2af4(0x13f)]('*')||_0x3f9fe0['includes']('?')),_0x3cee48=_0x1ee97b(_0x1b1a8c['database']);_0x25e2f6[_0x2e2af4(0x137)]&&(console[_0x2e2af4(0x12e)](_0x2e2af4(0x136)+_0x25e2f6[_0x2e2af4(0x13d)]),_0x1b1a8c[_0x2e2af4(0x11d)]?_0x3cee48?console[_0x2e2af4(0x12e)]('Database\x20pattern:\x20'+_0x1b1a8c[_0x2e2af4(0x11d)]):console[_0x2e2af4(0x12e)](_0x2e2af4(0x13c)+_0x1b1a8c[_0x2e2af4(0x11d)]):console[_0x2e2af4(0x12e)](_0x2e2af4(0x139)),_0x1b1a8c['table']&&console[_0x2e2af4(0x12e)](_0x2e2af4(0x134)+_0x1b1a8c[_0x2e2af4(0x144)]));const _0x522cc5=_0x1b1a8c['database']&&!_0x3cee48?_0x1b1a8c['database']:undefined,_0x210902=_0x3cee48?_0x1b1a8c[_0x2e2af4(0x11d)]:undefined,_0x2b0635=_0x1b1a8c[_0x2e2af4(0x144)],_0x2bf256=resolveLimit(_0x25e2f6[_0x2e2af4(0x12f)],DEFAULT_LISTING_LIMIT),_0x55b07f=await withSpinner(_0x2e2af4(0x11e),()=>_0x120931['query']['listTables'](_0x522cc5,_0x2b0635,_0x210902,_0x2bf256),{'verbose':_0x25e2f6['verbose']}),_0xac4b96=_0x55b07f[_0x2e2af4(0x120)];if(_0xac4b96['length']===0x0&&_0x1b1a8c[_0x2e2af4(0x11d)]&&!_0x3cee48)return console['error']('✖\x20No\x20tables\x20found'),console['error'](_0x2e2af4(0x14c)+_0x1b1a8c[_0x2e2af4(0x11d)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console['error'](_0x2e2af4(0x124)+_0xac4b96[_0x2e2af4(0x146)]+_0x2e2af4(0x129)+(_0xac4b96['length']!==0x1?'s':'')),await handleSDKOutput(_0xac4b96,{..._0x25e2f6,'limit':_0x2bf256}),0x0;}catch(_0x3ddd37){if(_0x3ddd37 instanceof SDKError)return console[_0x2e2af4(0x12e)]('Error:\x20'+_0x3ddd37[_0x2e2af4(0x141)]),_0x3ddd37[_0x2e2af4(0x140)]&&console[_0x2e2af4(0x12e)](_0x2e2af4(0x122)+_0x3ddd37['cause']),0x1;throw _0x3ddd37;}}[a35_0x4d82cf(0x121)](_0x38e8ab){return undefined;}}
@@ -1 +1 @@
1
- const a36_0x19574c=a36_0x32e7;(function(_0x120912,_0x87da02){const _0x329556=a36_0x32e7,_0x255dc2=_0x120912();while(!![]){try{const _0x3adb17=parseInt(_0x329556(0x112))/0x1+-parseInt(_0x329556(0xfa))/0x2+-parseInt(_0x329556(0x109))/0x3*(-parseInt(_0x329556(0x117))/0x4)+parseInt(_0x329556(0x10e))/0x5+parseInt(_0x329556(0x11f))/0x6*(parseInt(_0x329556(0x108))/0x7)+-parseInt(_0x329556(0x11e))/0x8*(-parseInt(_0x329556(0x118))/0x9)+parseInt(_0x329556(0x10b))/0xa*(-parseInt(_0x329556(0x100))/0xb);if(_0x3adb17===_0x87da02)break;else _0x255dc2['push'](_0x255dc2['shift']());}catch(_0x5ecd0f){_0x255dc2['push'](_0x255dc2['shift']());}}}(a36_0x4d1e,0xa9d67));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';function a36_0x32e7(_0x5e0ded,_0x2af2f6){const _0x4d1e70=a36_0x4d1e();return a36_0x32e7=function(_0x32e79b,_0x1599c3){_0x32e79b=_0x32e79b-0xf9;let _0x599d46=_0x4d1e70[_0x32e79b];return _0x599d46;},a36_0x32e7(_0x5e0ded,_0x2af2f6);}export class UseCommand extends BaseCommand{[a36_0x19574c(0xfc)]='use';[a36_0x19574c(0x105)]=a36_0x19574c(0x116);[a36_0x19574c(0x114)](_0x1bc2e7){const _0x54d52f=a36_0x19574c,{args:_0x2f10b1}=_0x1bc2e7;if(_0x2f10b1[_0x54d52f(0x110)]<0x2)return _0x54d52f(0x10d)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x54d52f(0x121)+_0x54d52f(0x10c);const _0x374089=_0x2f10b1[0x0],_0x3fa1cb=[_0x54d52f(0x115),_0x54d52f(0xff),_0x54d52f(0x111),'profile',_0x54d52f(0x119)];if(!_0x3fa1cb[_0x54d52f(0x11a)](_0x374089))return'Invalid\x20resource:\x20'+_0x374089+_0x54d52f(0x107)+_0x3fa1cb[_0x54d52f(0x10a)](',\x20');return undefined;}async[a36_0x19574c(0x10f)](_0x1c4186){const _0x1f2d69=a36_0x19574c,{args:_0x1a5f46,options:_0x542430}=_0x1c4186;try{const _0x4634f5=_0x1a5f46[0x0],_0x3e4bca=_0x1a5f46[0x1];if(_0x4634f5==='profile'){if(!profileExists(_0x3e4bca))return console[_0x1f2d69(0xfd)](_0x1f2d69(0xf9)+_0x3e4bca+_0x1f2d69(0x101)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x4718c7=_0x542430[_0x1f2d69(0xfb)]||getCurrentSessionPID()[_0x1f2d69(0x11b)]();return saveSessionContext({'profile':_0x3e4bca},_0x542430[_0x1f2d69(0xfb)]),console['log'](_0x1f2d69(0x104)+_0x3e4bca+'\x20(session:\x20'+_0x4718c7+')'),console[_0x1f2d69(0xfe)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}const _0x2e3345={},_0x139581=_0x542430[_0x1f2d69(0xfb)]||getCurrentSessionPID()[_0x1f2d69(0x11b)]();switch(_0x4634f5){case'database':_0x2e3345[_0x1f2d69(0x115)]=_0x3e4bca,console[_0x1f2d69(0xfe)](_0x1f2d69(0x11d)+_0x3e4bca+_0x1f2d69(0x102)+_0x139581+')');break;case _0x1f2d69(0xff):_0x2e3345[_0x1f2d69(0xff)]=_0x3e4bca,console[_0x1f2d69(0xfe)](_0x1f2d69(0x113)+_0x3e4bca+_0x1f2d69(0x102)+_0x139581+')');break;case _0x1f2d69(0x111):_0x2e3345[_0x1f2d69(0x111)]=_0x3e4bca,console[_0x1f2d69(0xfe)](_0x1f2d69(0x120)+_0x3e4bca+_0x1f2d69(0x102)+_0x139581+')');break;case _0x1f2d69(0x119):_0x2e3345[_0x1f2d69(0x119)]=_0x3e4bca,console[_0x1f2d69(0xfe)](_0x1f2d69(0x106)+_0x3e4bca+_0x1f2d69(0x102)+_0x139581+')');break;}return saveSessionContext(_0x2e3345,_0x542430[_0x1f2d69(0xfb)]),console[_0x1f2d69(0xfe)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}catch(_0x365f9e){return _0x365f9e instanceof Error&&console[_0x1f2d69(0xfd)](_0x1f2d69(0x11c)+_0x365f9e[_0x1f2d69(0x103)]),0x1;}}}function a36_0x4d1e(){const _0x2e36ca=['length','llm_project','1165396tUqzcS','Session\x20parent_segment\x20set\x20to:\x20','validate','database','Set\x20session-level\x20context','40pdpUsd','1132938AZxoij','engage_workspace','includes','toString','Error:\x20','Session\x20database\x20set\x20to:\x20','8NwpFzB','6eVxeXO','Session\x20llm_project\x20set\x20to:\x20','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Error:\x20Profile\x20\x27','902874lnItfd','session','name','error','log','parent_segment','11cjeAJk','\x27\x20does\x20not\x20exist','\x20(session:\x20','message','Session\x20profile\x20set\x20to:\x20','description','Session\x20engage_workspace\x20set\x20to:\x20','.\x20Must\x20be\x20one\x20of:\x20','3343942vQYptB','177789VTKESF','join','22202300XQrdgb','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','5028540MNwKIh','execute'];a36_0x4d1e=function(){return _0x2e36ca;};return a36_0x4d1e();}
1
+ const a36_0x402f71=a36_0xf1ca;function a36_0x541b(){const _0x28f70a=['418831LKWyTJ','llm_project','\x20(session:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a','log','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','profile','81530hNkBbY','1230717BaRhev','Error:\x20Profile\x20\x27','engage_workspace','validate','use','Session\x20engage_workspace\x20set\x20to:\x20','length','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','parent_segment','2JYZoCZ','includes','250726EXnlgN','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','150IDLfHk','.\x20Must\x20be\x20one\x20of:\x20','description','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','Session\x20database\x20set\x20to:\x20','database','message','1528312MEmoTf','toString','session','3213272Xcjpce','join','10796535ZGZOXq','error','\x27\x20does\x20not\x20exist'];a36_0x541b=function(){return _0x28f70a;};return a36_0x541b();}(function(_0x2ad48e,_0x520f3a){const _0x48e7f3=a36_0xf1ca,_0x280aae=_0x2ad48e();while(!![]){try{const _0x1a8470=-parseInt(_0x48e7f3(0x14e))/0x1+parseInt(_0x48e7f3(0x14c))/0x2*(-parseInt(_0x48e7f3(0x168))/0x3)+-parseInt(_0x48e7f3(0x158))/0x4+-parseInt(_0x48e7f3(0x167))/0x5*(-parseInt(_0x48e7f3(0x150))/0x6)+parseInt(_0x48e7f3(0x160))/0x7+-parseInt(_0x48e7f3(0x15b))/0x8+parseInt(_0x48e7f3(0x15d))/0x9;if(_0x1a8470===_0x520f3a)break;else _0x280aae['push'](_0x280aae['shift']());}catch(_0x296fef){_0x280aae['push'](_0x280aae['shift']());}}}(a36_0x541b,0x364bc));import{BaseCommand}from'./command.js';function a36_0xf1ca(_0x4d1daa,_0x34716a){const _0x541bb1=a36_0x541b();return a36_0xf1ca=function(_0xf1cadd,_0x3b26da){_0xf1cadd=_0xf1cadd-0x14b;let _0x57c266=_0x541bb1[_0xf1cadd];return _0x57c266;},a36_0xf1ca(_0x4d1daa,_0x34716a);}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{['name']=a36_0x402f71(0x16c);[a36_0x402f71(0x152)]='Set\x20session-level\x20context';[a36_0x402f71(0x16b)](_0x14f17d){const _0x13ec9f=a36_0x402f71,{args:_0x3b626b}=_0x14f17d;if(_0x3b626b[_0x13ec9f(0x16e)]<0x2)return _0x13ec9f(0x14f)+_0x13ec9f(0x163)+_0x13ec9f(0x16f)+_0x13ec9f(0x165);const _0x12f2e2=_0x3b626b[0x0],_0x3954a5=[_0x13ec9f(0x156),_0x13ec9f(0x14b),_0x13ec9f(0x161),_0x13ec9f(0x166),'engage_workspace'];if(!_0x3954a5[_0x13ec9f(0x14d)](_0x12f2e2))return'Invalid\x20resource:\x20'+_0x12f2e2+_0x13ec9f(0x151)+_0x3954a5[_0x13ec9f(0x15c)](',\x20');return undefined;}async['execute'](_0xde3491){const _0x2c005d=a36_0x402f71,{args:_0x5da192,options:_0x2888ea}=_0xde3491;try{const _0x55c258=_0x5da192[0x0],_0x4f30b9=_0x5da192[0x1];if(_0x55c258===_0x2c005d(0x166)){if(!profileExists(_0x4f30b9))return console[_0x2c005d(0x15e)](_0x2c005d(0x169)+_0x4f30b9+_0x2c005d(0x15f)),console[_0x2c005d(0x15e)](_0x2c005d(0x154)),0x1;const _0x3e3981=_0x2888ea[_0x2c005d(0x15a)]||getCurrentSessionPID()[_0x2c005d(0x159)]();return saveSessionContext({'profile':_0x4f30b9},_0x2888ea[_0x2c005d(0x15a)]),console[_0x2c005d(0x164)]('Session\x20profile\x20set\x20to:\x20'+_0x4f30b9+_0x2c005d(0x162)+_0x3e3981+')'),console[_0x2c005d(0x164)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}const _0x429f7c={},_0x56ec96=_0x2888ea[_0x2c005d(0x15a)]||getCurrentSessionPID()[_0x2c005d(0x159)]();switch(_0x55c258){case _0x2c005d(0x156):_0x429f7c[_0x2c005d(0x156)]=_0x4f30b9,console['log'](_0x2c005d(0x155)+_0x4f30b9+_0x2c005d(0x162)+_0x56ec96+')');break;case'parent_segment':_0x429f7c[_0x2c005d(0x14b)]=_0x4f30b9,console[_0x2c005d(0x164)]('Session\x20parent_segment\x20set\x20to:\x20'+_0x4f30b9+_0x2c005d(0x162)+_0x56ec96+')');break;case _0x2c005d(0x161):_0x429f7c['llm_project']=_0x4f30b9,console[_0x2c005d(0x164)]('Session\x20llm_project\x20set\x20to:\x20'+_0x4f30b9+'\x20(session:\x20'+_0x56ec96+')');break;case _0x2c005d(0x16a):_0x429f7c[_0x2c005d(0x16a)]=_0x4f30b9,console['log'](_0x2c005d(0x16d)+_0x4f30b9+'\x20(session:\x20'+_0x56ec96+')');break;}return saveSessionContext(_0x429f7c,_0x2888ea[_0x2c005d(0x15a)]),console['log'](_0x2c005d(0x153)),0x0;}catch(_0x1703c8){return _0x1703c8 instanceof Error&&console['error']('Error:\x20'+_0x1703c8[_0x2c005d(0x157)]),0x1;}}}