@treasuredata/tdx 0.1.16 → 0.1.18

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 (85) hide show
  1. package/README.md +10 -0
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-client.js +1 -1
  7. package/dist/client/rate-limiter.js +1 -1
  8. package/dist/client/td-client.js +1 -1
  9. package/dist/client/trino-client.js +1 -1
  10. package/dist/client/workflow-client.js +1 -1
  11. package/dist/commands/activations.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/context-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/llm-command.js +1 -1
  22. package/dist/commands/llm-proxy.js +1 -1
  23. package/dist/commands/parent-segment-command.js +1 -1
  24. package/dist/commands/profiles-command.js +1 -1
  25. package/dist/commands/query-command.js +1 -1
  26. package/dist/commands/segment-command.js +1 -1
  27. package/dist/commands/segment-create-command.js +1 -1
  28. package/dist/commands/segment-fields-command.js +1 -1
  29. package/dist/commands/segment-pwd-command.js +1 -1
  30. package/dist/commands/segment-update-command.js +1 -1
  31. package/dist/commands/segment-use-command.js +1 -1
  32. package/dist/commands/segments.js +1 -1
  33. package/dist/commands/show.js +1 -1
  34. package/dist/commands/tables.js +1 -1
  35. package/dist/commands/use-command.js +1 -1
  36. package/dist/commands/workflow-command.js +1 -1
  37. package/dist/core/auth.js +1 -1
  38. package/dist/core/config.js +1 -1
  39. package/dist/core/global-context.js +1 -1
  40. package/dist/core/profile.js +1 -1
  41. package/dist/core/project-config.js +1 -1
  42. package/dist/core/session.js +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/proxy/anthropic-adapter.d.ts +20 -2
  45. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  46. package/dist/proxy/anthropic-adapter.js +1 -1
  47. package/dist/proxy/anthropic-adapter.js.map +1 -1
  48. package/dist/proxy/server.d.ts.map +1 -1
  49. package/dist/proxy/server.js +1 -1
  50. package/dist/proxy/server.js.map +1 -1
  51. package/dist/sdk/api.js +1 -1
  52. package/dist/sdk/database.js +1 -1
  53. package/dist/sdk/errors.js +1 -1
  54. package/dist/sdk/index.js +1 -1
  55. package/dist/sdk/job.js +1 -1
  56. package/dist/sdk/llm.js +1 -1
  57. package/dist/sdk/query.js +1 -1
  58. package/dist/sdk/segment.js +1 -1
  59. package/dist/sdk/table.js +1 -1
  60. package/dist/sdk/workflow.js +1 -1
  61. package/dist/types/endpoints.js +1 -1
  62. package/dist/types/index.js +1 -1
  63. package/dist/utils/agent-ref-parser.js +1 -1
  64. package/dist/utils/chat-cache.js +1 -1
  65. package/dist/utils/colors.js +1 -1
  66. package/dist/utils/command-output.js +1 -1
  67. package/dist/utils/file-permissions.js +1 -1
  68. package/dist/utils/format-detector.js +1 -1
  69. package/dist/utils/formatters.js +1 -1
  70. package/dist/utils/json-loader.js +1 -1
  71. package/dist/utils/model-aliases.js +1 -1
  72. package/dist/utils/option-validation.js +1 -1
  73. package/dist/utils/port.js +1 -1
  74. package/dist/utils/process.js +1 -1
  75. package/dist/utils/prompt.js +1 -1
  76. package/dist/utils/segment-path-parser.js +1 -1
  77. package/dist/utils/segment-ref-parser.js +1 -1
  78. package/dist/utils/spinner.js +1 -1
  79. package/dist/utils/sql-parser.js +1 -1
  80. package/dist/utils/sse-parser.js +1 -1
  81. package/dist/utils/string-utils.js +1 -1
  82. package/dist/utils/table-ref-parser.js +1 -1
  83. package/dist/utils/tree-formatter.js +1 -1
  84. package/dist/utils/workflow-utils.js +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- const a22_0x2f57a5=a22_0x548f;(function(_0x451db9,_0x268c7b){const _0x452b88=a22_0x548f,_0x5e533e=_0x451db9();while(!![]){try{const _0xb452f0=-parseInt(_0x452b88(0x1d5))/0x1*(-parseInt(_0x452b88(0x1ad))/0x2)+parseInt(_0x452b88(0x1f1))/0x3*(parseInt(_0x452b88(0x1bd))/0x4)+parseInt(_0x452b88(0x1c8))/0x5+-parseInt(_0x452b88(0x1e7))/0x6+parseInt(_0x452b88(0x1c1))/0x7+-parseInt(_0x452b88(0x1ba))/0x8*(parseInt(_0x452b88(0x19e))/0x9)+-parseInt(_0x452b88(0x1b6))/0xa*(parseInt(_0x452b88(0x1ab))/0xb);if(_0xb452f0===_0x268c7b)break;else _0x5e533e['push'](_0x5e533e['shift']());}catch(_0x3425f1){_0x5e533e['push'](_0x5e533e['shift']());}}}(a22_0x3f09,0x8304d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';function a22_0x548f(_0x3b2740,_0xf08107){const _0x3f09d6=a22_0x3f09();return a22_0x548f=function(_0x548f55,_0x257fcd){_0x548f55=_0x548f55-0x17b;let _0x2d2de1=_0x3f09d6[_0x548f55];return _0x2d2de1;},a22_0x548f(_0x3b2740,_0xf08107);}import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x3f09(){const _0x2c5cec=['8680370iRHbYV','Resolving\x20parent\x20folder\x20\x27','jsonl','Creating\x20folder\x20\x27','496248eUeblv','Fetching\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','2492JWcVOj','resolvePathToResource','length','execute','3643010UVvXKA','Parent\x20ID:\x20','SQL\x20query:\x0a','code','Parent\x20name:\x20','segmentId','Site:\x20','4059080wTfqMU','Error:\x20','Resolving\x20parent\x20segment\x20\x27','test','cause','site','createFolder','\x20folder','getSegmentSQL','\x20\x20Cause:\x20','getFolder','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','data','1cDZfOY','segment:describe','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','toLocaleString','jobId','setJobId','Fetching\x20SQL\x20for\x20parent\x20segment...','format','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20rows\x20','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getSegment','folder','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','description','includes','parentFolder','2421132KKtjKr','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','segment:folder:create','\x27...','Show\x20segment\x20folder\x20details','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','Usage:\x20tdx\x20segment\x20describe\x20<path>','segment:folder:show','3099dJKSvM','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','json','trim','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','getParentSQL','Resolved\x20parent\x20ID:\x20','Show\x20segment\x20or\x20folder\x20details','type','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','resolveParentId','✖\x20Query\x20failed\x20[','Resolved\x20parent\x20folder\x20ID:\x20','Listing\x20folders\x20for\x20parent\x20\x27','Examples:','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20sql\x20<path>','Parent\x20segment:\x20','in\x20','processedRows','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','replace','Executing\x20segment\x20query...','segmentPath','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','SELECT\x20*\x20FROM\x20(\x0a','query','✔\x20Found\x20','segment:show','listFolders','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segment','Resolving\x20folder\x20\x27','144uIcOYs','parent','name','message','log','segment:folder:list','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','information_schema','folderId','parentId','Resolving\x20path\x20\x27','stats','verbose','11TKiPYg','INTERNAL','1649806SoZEAw','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','error','Fetching\x20segment\x20details...','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Folder\x20ID:\x20','Segment\x20ID:\x20','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20SQL\x20for\x20segment...'];a22_0x3f09=function(){return _0x2c5cec;};return a22_0x3f09();}import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x2f57a5(0x1a0)]=a22_0x2f57a5(0x1d6);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x184);async[a22_0x2f57a5(0x1c0)](_0xdf8316){const _0x530318=a22_0x2f57a5,{options:_0x8909d4,args:_0x23ccf9,tdx:_0x271b9b}=_0xdf8316;if(_0x23ccf9[_0x530318(0x1bf)]===0x0)return console['error'](_0x530318(0x180)),console['error'](_0x530318(0x1ef)),console[_0x530318(0x1af)](_0x530318(0x18b)),console['error'](_0x530318(0x1d7)),console[_0x530318(0x1af)](_0x530318(0x1e0)),console[_0x530318(0x1af)](_0x530318(0x19b)),0x1;try{const _0x7e0034=_0x23ccf9[0x0],_0x1c0073=_0x8909d4['segmentPath'];let _0x48463c=_0x7e0034;_0x1c0073&&!_0x7e0034[_0x530318(0x1e5)]('/')&&(_0x48463c=_0x1c0073+'/'+_0x7e0034,_0x8909d4[_0x530318(0x1aa)]&&console['error'](_0x530318(0x18c)+_0x48463c));const _0x2385e0=await withSpinner(_0x530318(0x1a8)+_0x48463c+'\x27...',()=>_0x271b9b[_0x530318(0x19c)][_0x530318(0x1be)](_0x48463c),{'verbose':_0x8909d4[_0x530318(0x1aa)]}),_0x4ea133=_0x2385e0['data'];_0x8909d4[_0x530318(0x1aa)]&&(console[_0x530318(0x1af)](_0x530318(0x1df)+_0x4ea133[_0x530318(0x185)]),console['error'](_0x530318(0x1c2)+_0x4ea133[_0x530318(0x1a7)]),_0x4ea133['folderId']&&console[_0x530318(0x1af)](_0x530318(0x1b2)+_0x4ea133['folderId']),_0x4ea133[_0x530318(0x1c6)]&&console[_0x530318(0x1af)](_0x530318(0x1b3)+_0x4ea133['segmentId']));if(_0x4ea133[_0x530318(0x185)]===_0x530318(0x19f)){const _0x3e7a5c=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x271b9b['segment']['getParent'](_0x4ea133[_0x530318(0x1a7)]),{'verbose':_0x8909d4[_0x530318(0x1aa)]});await handleSDKOutput([_0x3e7a5c[_0x530318(0x1d4)]],_0x8909d4);}else{if(_0x4ea133[_0x530318(0x185)]===_0x530318(0x1e2)){if(!_0x4ea133[_0x530318(0x1a6)])throw new SDKError(ErrorCode['INTERNAL'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x281bdc=await withSpinner('Fetching\x20folder\x20details...',()=>_0x271b9b[_0x530318(0x19c)]['getFolder'](_0x4ea133[_0x530318(0x1a6)]),{'verbose':_0x8909d4[_0x530318(0x1aa)]});await handleSDKOutput([_0x281bdc['data']],_0x8909d4);}else{if(_0x4ea133[_0x530318(0x185)]===_0x530318(0x19c)){if(!_0x4ea133[_0x530318(0x1c6)])throw new SDKError(ErrorCode[_0x530318(0x1ac)],_0x530318(0x1bc));const _0x35edc3=await withSpinner(_0x530318(0x1b0),()=>_0x271b9b['segment'][_0x530318(0x1e1)](_0x4ea133[_0x530318(0x1a7)],_0x4ea133[_0x530318(0x1c6)]),{'verbose':_0x8909d4['verbose']});await handleSDKOutput([_0x35edc3[_0x530318(0x1d4)]],_0x8909d4);}}}return 0x0;}catch(_0x4503f5){if(_0x4503f5 instanceof SDKError)return console[_0x530318(0x1af)](_0x530318(0x1c9)+_0x4503f5['message']),_0x4503f5[_0x530318(0x1cc)]&&console['error'](_0x530318(0x1d1)+_0x4503f5[_0x530318(0x1cc)]),0x1;throw _0x4503f5;}}}export class SegmentShowCommand extends BaseCommand{['name']=a22_0x2f57a5(0x199);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x1d3);async['execute'](_0x344cab){const _0x2b3ac2=a22_0x2f57a5,{options:_0x48def8,args:_0x295898,tdx:_0x1cb361}=_0x344cab;if(_0x295898['length']===0x0)return console[_0x2b3ac2(0x1af)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x2b3ac2(0x1af)]('Usage:\x20tdx\x20segment\x20show\x20<path>'),console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x18b)),console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1ee)),console['error'](_0x2b3ac2(0x1dd)),console[_0x2b3ac2(0x1af)]('\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x35cf47=_0x295898[0x0],_0x270537=_0x48def8[_0x2b3ac2(0x194)];let _0x30ab55=_0x35cf47;_0x270537&&!_0x35cf47[_0x2b3ac2(0x1e5)]('/')&&(_0x30ab55=_0x270537+'/'+_0x35cf47,_0x48def8[_0x2b3ac2(0x1aa)]&&console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x18c)+_0x30ab55));const _0x179e59=await withSpinner(_0x2b3ac2(0x1a8)+_0x30ab55+_0x2b3ac2(0x1eb),()=>_0x1cb361[_0x2b3ac2(0x19c)][_0x2b3ac2(0x1be)](_0x30ab55),{'verbose':_0x48def8['verbose']}),_0x1255e6=_0x179e59[_0x2b3ac2(0x1d4)];_0x48def8[_0x2b3ac2(0x1aa)]&&(console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1df)+_0x1255e6['type']),console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1c2)+_0x1255e6[_0x2b3ac2(0x1a7)]));if(_0x1255e6[_0x2b3ac2(0x185)]==='folder')return console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x181)),console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1e9)),0x1;let _0x5ab848;if(_0x1255e6['type']==='parent'){const _0x4f7f56=await withSpinner(_0x2b3ac2(0x1db),()=>_0x1cb361[_0x2b3ac2(0x19c)][_0x2b3ac2(0x182)](_0x1255e6[_0x2b3ac2(0x1a7)]),{'verbose':_0x48def8[_0x2b3ac2(0x1aa)]});_0x5ab848=_0x4f7f56['data'];}else{if(!_0x1255e6[_0x2b3ac2(0x1c6)])throw new SDKError(ErrorCode[_0x2b3ac2(0x1ac)],_0x2b3ac2(0x1bc));const _0x5c3101=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1cb361[_0x2b3ac2(0x19c)]['getSegmentSQL'](_0x1255e6['parentId'],_0x1255e6[_0x2b3ac2(0x1c6)]),{'verbose':_0x48def8[_0x2b3ac2(0x1aa)]});_0x5ab848=_0x5c3101['data'];}const _0x46b838=_0x48def8['limit'],_0x105dec=/\bLIMIT\s+\d+/i[_0x2b3ac2(0x1cb)](_0x5ab848);!_0x105dec&&(_0x5ab848=_0x5ab848[_0x2b3ac2(0x17d)]()[_0x2b3ac2(0x192)](/;+$/,''),_0x5ab848=_0x2b3ac2(0x196)+_0x5ab848+_0x2b3ac2(0x17e)+_0x46b838);_0x48def8['verbose']&&console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1c3)+_0x5ab848);const _0x273405=await withQuerySpinner(_0x2b3ac2(0x193),async _0x374402=>{const _0x1fee18=_0x2b3ac2,_0x4db2c2=await _0x1cb361[_0x1fee18(0x197)](_0x5ab848,{'catalog':'td','schema':_0x1fee18(0x1a5),'onJobId':_0x259cd3=>{const _0x18b73d=_0x1fee18;_0x374402[_0x18b73d(0x1da)](_0x259cd3);}});return _0x4db2c2;},{'verbose':_0x48def8[_0x2b3ac2(0x1aa)]}),_0x13dc84=_0x273405[_0x2b3ac2(0x1d4)],_0x1f2c6d=_0x13dc84[_0x2b3ac2(0x1d9)]?'\x20[Job\x20ID:\x20'+_0x13dc84[_0x2b3ac2(0x1d9)]+']':'';return console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x1b4)+_0x13dc84[_0x2b3ac2(0x1a9)][_0x2b3ac2(0x190)][_0x2b3ac2(0x1d8)]()+_0x2b3ac2(0x1de)+(_0x2b3ac2(0x18f)+formatElapsed(_0x13dc84[_0x2b3ac2(0x1a9)]['elapsedTimeMillis'])+_0x1f2c6d)),await handleQueryOutput(_0x13dc84,_0x48def8),0x0;}catch(_0x5ac234){if(_0x5ac234 instanceof SDKError)return console[_0x2b3ac2(0x1af)](_0x2b3ac2(0x188)+_0x5ac234[_0x2b3ac2(0x1c4)]+']'),console[_0x2b3ac2(0x1af)]('\x0a'+_0x5ac234['message']),0x1;throw _0x5ac234;}}}export class SegmentFolderListCommand extends BaseCommand{[a22_0x2f57a5(0x1a0)]=a22_0x2f57a5(0x1a3);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x1b1);async[a22_0x2f57a5(0x1c0)](_0x3fb56e){const _0x1ee06e=a22_0x2f57a5,{options:_0x502be1,args:_0x40c82c,tdx:_0x29b20d}=_0x3fb56e;if(_0x40c82c[_0x1ee06e(0x1bf)]===0x0)return console[_0x1ee06e(0x1af)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1ee06e(0x1af)](_0x1ee06e(0x1e3)),0x1;const _0x993b=_0x40c82c[0x0];try{_0x502be1[_0x1ee06e(0x1aa)]&&(console['error'](_0x1ee06e(0x1c7)+_0x502be1[_0x1ee06e(0x1cd)]),console[_0x1ee06e(0x1af)](_0x1ee06e(0x1c5)+_0x993b));const _0x5e61bd=await withSpinner(_0x1ee06e(0x1ca)+_0x993b+_0x1ee06e(0x1eb),()=>_0x29b20d['segment'][_0x1ee06e(0x187)](_0x993b),{'verbose':_0x502be1[_0x1ee06e(0x1aa)]}),_0x26238f=_0x5e61bd['data'];_0x502be1['verbose']&&console[_0x1ee06e(0x1af)](_0x1ee06e(0x183)+_0x26238f);const _0x3b6d8b=await withSpinner(_0x1ee06e(0x18a)+_0x993b+'\x27...',()=>_0x29b20d[_0x1ee06e(0x19c)][_0x1ee06e(0x19a)](_0x26238f),{'verbose':_0x502be1[_0x1ee06e(0x1aa)]}),_0x498981=_0x3b6d8b[_0x1ee06e(0x1d4)];return console[_0x1ee06e(0x1af)](_0x1ee06e(0x198)+_0x498981[_0x1ee06e(0x1bf)]+_0x1ee06e(0x1cf)+(_0x498981[_0x1ee06e(0x1bf)]!==0x1?'s':'')),await handleSDKOutput(_0x498981,_0x502be1),0x0;}catch(_0x1b38d8){if(_0x1b38d8 instanceof SDKError)return console['error'](_0x1ee06e(0x1c9)+_0x1b38d8[_0x1ee06e(0x1a1)]),_0x1b38d8[_0x1ee06e(0x1cc)]&&console[_0x1ee06e(0x1af)](_0x1ee06e(0x1d1)+_0x1b38d8[_0x1ee06e(0x1cc)]),0x1;throw _0x1b38d8;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a22_0x2f57a5(0x1f0);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x1ec);async[a22_0x2f57a5(0x1c0)](_0x474dca){const _0xe94027=a22_0x2f57a5,{options:_0x53e75d,args:_0x3f836d,tdx:_0x4bc095}=_0x474dca;if(_0x3f836d[_0xe94027(0x1bf)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0xe94027(0x1af)](_0xe94027(0x191)),0x1;try{const {parentId:_0x56fffe,childId:_0x88f5a1}=parseSegmentRef(_0x3f836d[0x0]);_0x53e75d['verbose']&&(console[_0xe94027(0x1af)](_0xe94027(0x1c7)+_0x53e75d[_0xe94027(0x1cd)]),console[_0xe94027(0x1af)]('Parent\x20name:\x20'+_0x56fffe),_0x88f5a1&&console[_0xe94027(0x1af)](_0xe94027(0x1f2)+_0x88f5a1));if(!_0x88f5a1)return console[_0xe94027(0x1af)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x5c8715=await withSpinner(_0xe94027(0x1ca)+_0x56fffe+_0xe94027(0x1eb),()=>_0x4bc095[_0xe94027(0x19c)][_0xe94027(0x187)](_0x56fffe),{'verbose':_0x53e75d['verbose']}),_0x656f0a=_0x5c8715['data'];_0x53e75d['verbose']&&console[_0xe94027(0x1af)](_0xe94027(0x183)+_0x656f0a);const _0x6c7402=await withSpinner(_0xe94027(0x19d)+_0x88f5a1+_0xe94027(0x1eb),()=>_0x4bc095[_0xe94027(0x19c)]['resolveFolderId'](_0x656f0a,_0x88f5a1),{'verbose':_0x53e75d[_0xe94027(0x1aa)]}),_0x20c6dc=_0x6c7402[_0xe94027(0x1d4)];_0x53e75d['verbose']&&console[_0xe94027(0x1af)](_0xe94027(0x1ed)+_0x20c6dc);const _0x5804cf=await withSpinner(_0xe94027(0x1bb)+_0x88f5a1+'\x27...',()=>_0x4bc095[_0xe94027(0x19c)][_0xe94027(0x1d2)](_0x20c6dc),{'verbose':_0x53e75d[_0xe94027(0x1aa)]});return await handleSDKOutput([_0x5804cf[_0xe94027(0x1d4)]],_0x53e75d),0x0;}catch(_0xf4c115){if(_0xf4c115 instanceof SDKError)return console[_0xe94027(0x1af)](_0xe94027(0x1c9)+_0xf4c115['message']),_0xf4c115['cause']&&console[_0xe94027(0x1af)](_0xe94027(0x1d1)+_0xf4c115[_0xe94027(0x1cc)]),0x1;throw _0xf4c115;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x2f57a5(0x1a0)]='segment:sql';['description']='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async[a22_0x2f57a5(0x1c0)](_0x27fa26){const _0x5c7a54=a22_0x2f57a5,{options:_0x56cffa,args:_0x49628a,tdx:_0x2c2671}=_0x27fa26;if(_0x49628a[_0x5c7a54(0x1bf)]===0x0)return console[_0x5c7a54(0x1af)](_0x5c7a54(0x1ae)),console[_0x5c7a54(0x1af)](_0x5c7a54(0x18d)),console[_0x5c7a54(0x1af)](_0x5c7a54(0x18b)),console[_0x5c7a54(0x1af)](_0x5c7a54(0x186)),console[_0x5c7a54(0x1af)](_0x5c7a54(0x1e8)),console[_0x5c7a54(0x1af)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x121271=_0x49628a[0x0],_0x50232c=_0x56cffa['segmentPath'];let _0x1538ae=_0x121271;_0x50232c&&!_0x121271[_0x5c7a54(0x1e5)]('/')&&(_0x1538ae=_0x50232c+'/'+_0x121271,_0x56cffa[_0x5c7a54(0x1aa)]&&console[_0x5c7a54(0x1af)](_0x5c7a54(0x18c)+_0x1538ae));const _0x86d665=await withSpinner(_0x5c7a54(0x1a8)+_0x1538ae+'\x27...',()=>_0x2c2671['segment'][_0x5c7a54(0x1be)](_0x1538ae),{'verbose':_0x56cffa[_0x5c7a54(0x1aa)]}),_0x1736c3=_0x86d665[_0x5c7a54(0x1d4)];_0x56cffa['verbose']&&(console[_0x5c7a54(0x1af)]('Resolved\x20type:\x20'+_0x1736c3[_0x5c7a54(0x185)]),console['error'](_0x5c7a54(0x1c2)+_0x1736c3[_0x5c7a54(0x1a7)]));if(_0x1736c3['type']===_0x5c7a54(0x1e2))return console[_0x5c7a54(0x1af)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x5c7a54(0x1af)](_0x5c7a54(0x1a4)),0x1;let _0x194a7f;if(_0x1736c3[_0x5c7a54(0x185)]===_0x5c7a54(0x19f)){const _0x4ba06f=await withSpinner(_0x5c7a54(0x1db),()=>_0x2c2671[_0x5c7a54(0x19c)][_0x5c7a54(0x182)](_0x1736c3[_0x5c7a54(0x1a7)]),{'verbose':_0x56cffa[_0x5c7a54(0x1aa)]});_0x194a7f=_0x4ba06f['data'];}else{if(!_0x1736c3[_0x5c7a54(0x1c6)])throw new SDKError(ErrorCode[_0x5c7a54(0x1ac)],_0x5c7a54(0x1bc));const _0x22aeec=await withSpinner(_0x5c7a54(0x1b5),()=>_0x2c2671['segment'][_0x5c7a54(0x1d0)](_0x1736c3[_0x5c7a54(0x1a7)],_0x1736c3['segmentId']),{'verbose':_0x56cffa[_0x5c7a54(0x1aa)]});_0x194a7f=_0x22aeec[_0x5c7a54(0x1d4)];}return _0x56cffa[_0x5c7a54(0x1dc)]===_0x5c7a54(0x17c)||_0x56cffa['format']===_0x5c7a54(0x1b8)?await handleSDKOutput([{'sql':_0x194a7f}],_0x56cffa):console[_0x5c7a54(0x1a2)](_0x194a7f),0x0;}catch(_0x2e7197){if(_0x2e7197 instanceof SDKError)return console[_0x5c7a54(0x1af)]('Error:\x20'+_0x2e7197['message']),_0x2e7197[_0x5c7a54(0x1cc)]&&console[_0x5c7a54(0x1af)](_0x5c7a54(0x1d1)+_0x2e7197['cause']),0x1;throw _0x2e7197;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a22_0x2f57a5(0x1ea);[a22_0x2f57a5(0x1e4)]=a22_0x2f57a5(0x17f);async[a22_0x2f57a5(0x1c0)](_0x3abfdd){const _0x4da58f=a22_0x2f57a5,{options:_0x12ce4f,args:_0x543c12,tdx:_0x11e3c2}=_0x3abfdd,_0x53a0b5=_0x12ce4f;if(_0x543c12['length']<0x2)return console[_0x4da58f(0x1af)](_0x4da58f(0x195)),console[_0x4da58f(0x1af)](_0x4da58f(0x17b)),0x1;const _0x3c3824=_0x543c12[0x0],_0x21df32=_0x543c12[0x1];_0x53a0b5['verbose']&&(console[_0x4da58f(0x1af)](_0x4da58f(0x1c7)+_0x53a0b5[_0x4da58f(0x1cd)]),console[_0x4da58f(0x1af)](_0x4da58f(0x18e)+_0x3c3824),console['error'](_0x4da58f(0x1f2)+_0x21df32));let _0x4d3576;if(_0x53a0b5[_0x4da58f(0x1e6)]){const _0x5bcd67=_0x53a0b5[_0x4da58f(0x1e6)],_0xb60423=await withSpinner(_0x4da58f(0x1ca)+_0x3c3824+_0x4da58f(0x1eb),()=>_0x11e3c2['segment'][_0x4da58f(0x187)](_0x3c3824),{'verbose':_0x53a0b5[_0x4da58f(0x1aa)]}),_0x5b2aa2=_0xb60423[_0x4da58f(0x1d4)],_0x6b42a5=await withSpinner(_0x4da58f(0x1b7)+_0x5bcd67+'\x27...',()=>_0x11e3c2[_0x4da58f(0x19c)]['resolveFolderId'](_0x5b2aa2,_0x5bcd67),{'verbose':_0x53a0b5[_0x4da58f(0x1aa)]});_0x4d3576=_0x6b42a5[_0x4da58f(0x1d4)],_0x53a0b5[_0x4da58f(0x1aa)]&&console['error'](_0x4da58f(0x189)+_0x4d3576);}const _0x1193a0={'name':_0x21df32,'description':_0x53a0b5[_0x4da58f(0x1e4)],'parentFolderId':_0x4d3576},_0x4ad705=await withSpinner(_0x4da58f(0x1b9)+_0x21df32+_0x4da58f(0x1eb),()=>_0x11e3c2[_0x4da58f(0x19c)][_0x4da58f(0x1ce)](_0x3c3824,_0x1193a0),{'verbose':_0x53a0b5[_0x4da58f(0x1aa)]}),_0x292192=_0x4ad705[_0x4da58f(0x1d4)];return console[_0x4da58f(0x1af)]('✔\x20Created\x20folder\x20\x27'+_0x292192[_0x4da58f(0x1a0)]+'\x27\x20with\x20ID:\x20'+_0x292192['id']),await handleSDKOutput([_0x292192],_0x53a0b5),0x0;}}
1
+ const a22_0x14b7e1=a22_0x25ac;(function(_0x3cfa12,_0x47cd52){const _0xd2da4f=a22_0x25ac,_0x1ac2a1=_0x3cfa12();while(!![]){try{const _0xb453e6=parseInt(_0xd2da4f(0x1f4))/0x1*(-parseInt(_0xd2da4f(0x1c9))/0x2)+parseInt(_0xd2da4f(0x1da))/0x3*(parseInt(_0xd2da4f(0x1a1))/0x4)+parseInt(_0xd2da4f(0x18d))/0x5+-parseInt(_0xd2da4f(0x19d))/0x6+-parseInt(_0xd2da4f(0x1ba))/0x7*(-parseInt(_0xd2da4f(0x1e0))/0x8)+parseInt(_0xd2da4f(0x183))/0x9+parseInt(_0xd2da4f(0x1ab))/0xa*(parseInt(_0xd2da4f(0x1b3))/0xb);if(_0xb453e6===_0x47cd52)break;else _0x1ac2a1['push'](_0x1ac2a1['shift']());}catch(_0x59d00e){_0x1ac2a1['push'](_0x1ac2a1['shift']());}}}(a22_0x4f69,0x4bd78));function a22_0x4f69(){const _0x85d79=['Examples:','Resolved\x20parent\x20folder\x20ID:\x20','verbose','Folder\x20name:\x20','Creating\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Parent\x20ID:\x20','1347756mQcmNd','in\x20','\x20rows\x20','elapsedTimeMillis','32TWeTMs','segment:sql','✔\x20Found\x20','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Parent\x20segment:\x20','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','information_schema','Usage:\x20tdx\x20segment\x20show\x20<path>','22160omiylI','✖\x20Query\x20failed\x20[','✔\x20Created\x20folder\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','resolvePathToResource','Site:\x20','folderId','3388RlcohA','site','segment:describe','data','Fetching\x20SQL\x20for\x20parent\x20segment...','parentId','Error:\x20Parent\x20segment\x20name\x20is\x20required','7XrpJOp','setJobId','length','Resolving\x20path\x20\x27','trim','Error:\x20','segmentId','Resolving\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20folder\x20details...','INTERNAL','resolveFolderId','jsonl','query','getParent','2QIrYjU','segment','format','stats','Resolved\x20parent\x20ID:\x20','listFolders','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','resolveParentId','message','getParentSQL','Resolved\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Path\x20or\x20name\x20is\x20required','createFolder','70539hOJOKD','getSegment','SELECT\x20*\x20FROM\x20(\x0a','✔\x20Query\x20completed:\x20Processed\x20','parentFolder','description','541088otePME','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','jobId','folder','Folder\x20ID:\x20','Show\x20segment\x20folder\x20details','SQL\x20query:\x0a','segment:folder:show','Executing\x20segment\x20query...','parent','segment:show','processedRows','test','\x27...','cause','Resolving\x20parent\x20folder\x20\x27','Fetching\x20segment\x20details...','Fetching\x20parent\x20segment\x20details...','segmentPath','getSegmentSQL','590422absqOd','Segment\x20ID:\x20','125334cZEZsD','execute','getFolder','Resolved\x20type:\x20','name','Usage:\x20tdx\x20segment\x20describe\x20<path>','Parent\x20name:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Resolved\x20relative\x20path\x20to:\x20','867510eImwBF','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','type','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20parent\x20segment\x20\x27','error','Show\x20segment\x20or\x20folder\x20details','includes','\x20\x20Cause:\x20'];a22_0x4f69=function(){return _0x85d79;};return a22_0x4f69();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x25ac(_0x37e3c3,_0x44864c){const _0x4f69f1=a22_0x4f69();return a22_0x25ac=function(_0x25acc8,_0x11b0c4){_0x25acc8=_0x25acc8-0x183;let _0x4cb02a=_0x4f69f1[_0x25acc8];return _0x4cb02a;},a22_0x25ac(_0x37e3c3,_0x44864c);}import{parseSegmentRef}from'../utils/segment-ref-parser.js';export class SegmentDescribeCommand extends BaseCommand{[a22_0x14b7e1(0x187)]=a22_0x14b7e1(0x1b5);[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x193);async[a22_0x14b7e1(0x184)](_0x4a6a5b){const _0x3bbebd=a22_0x14b7e1,{options:_0x58fd3a,args:_0xd9ca7c,tdx:_0x46e972}=_0x4a6a5b;if(_0xd9ca7c[_0x3bbebd(0x1bc)]===0x0)return console[_0x3bbebd(0x192)](_0x3bbebd(0x1d8)),console[_0x3bbebd(0x192)](_0x3bbebd(0x188)),console[_0x3bbebd(0x192)](_0x3bbebd(0x196)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x3bbebd(0x192)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x3bbebd(0x192)](_0x3bbebd(0x1ae)),0x1;try{const _0x260c47=_0xd9ca7c[0x0],_0x1485b0=_0x58fd3a[_0x3bbebd(0x1f2)];let _0x256c14=_0x260c47;_0x1485b0&&!_0x260c47[_0x3bbebd(0x194)]('/')&&(_0x256c14=_0x1485b0+'/'+_0x260c47,_0x58fd3a['verbose']&&console[_0x3bbebd(0x192)](_0x3bbebd(0x18c)+_0x256c14));const _0x28581d=await withSpinner(_0x3bbebd(0x1bd)+_0x256c14+_0x3bbebd(0x1ed),()=>_0x46e972[_0x3bbebd(0x1ca)][_0x3bbebd(0x1b0)](_0x256c14),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]}),_0x328f7c=_0x28581d[_0x3bbebd(0x1b6)];_0x58fd3a[_0x3bbebd(0x198)]&&(console['error'](_0x3bbebd(0x186)+_0x328f7c[_0x3bbebd(0x18f)]),console[_0x3bbebd(0x192)](_0x3bbebd(0x19c)+_0x328f7c['parentId']),_0x328f7c[_0x3bbebd(0x1b2)]&&console['error'](_0x3bbebd(0x1e4)+_0x328f7c[_0x3bbebd(0x1b2)]),_0x328f7c['segmentId']&&console[_0x3bbebd(0x192)](_0x3bbebd(0x1f5)+_0x328f7c['segmentId']));if(_0x328f7c['type']===_0x3bbebd(0x1e9)){const _0x544792=await withSpinner(_0x3bbebd(0x1f1),()=>_0x46e972[_0x3bbebd(0x1ca)][_0x3bbebd(0x1c8)](_0x328f7c[_0x3bbebd(0x1b8)]),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]});await handleSDKOutput([_0x544792[_0x3bbebd(0x1b6)]],_0x58fd3a);}else{if(_0x328f7c['type']===_0x3bbebd(0x1e3)){if(!_0x328f7c[_0x3bbebd(0x1b2)])throw new SDKError(ErrorCode[_0x3bbebd(0x1c4)],_0x3bbebd(0x1c2));const _0x2b0e9e=await withSpinner(_0x3bbebd(0x1c3),()=>_0x46e972['segment'][_0x3bbebd(0x185)](_0x328f7c[_0x3bbebd(0x1b2)]),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]});await handleSDKOutput([_0x2b0e9e['data']],_0x58fd3a);}else{if(_0x328f7c['type']==='segment'){if(!_0x328f7c[_0x3bbebd(0x1c0)])throw new SDKError(ErrorCode[_0x3bbebd(0x1c4)],_0x3bbebd(0x18a));const _0x1886e5=await withSpinner(_0x3bbebd(0x1f0),()=>_0x46e972[_0x3bbebd(0x1ca)][_0x3bbebd(0x1db)](_0x328f7c['parentId'],_0x328f7c[_0x3bbebd(0x1c0)]),{'verbose':_0x58fd3a[_0x3bbebd(0x198)]});await handleSDKOutput([_0x1886e5[_0x3bbebd(0x1b6)]],_0x58fd3a);}}}return 0x0;}catch(_0x51a417){if(_0x51a417 instanceof SDKError)return console[_0x3bbebd(0x192)](_0x3bbebd(0x1bf)+_0x51a417[_0x3bbebd(0x1d3)]),_0x51a417[_0x3bbebd(0x1ee)]&&console['error'](_0x3bbebd(0x195)+_0x51a417['cause']),0x1;throw _0x51a417;}}}export class SegmentShowCommand extends BaseCommand{[a22_0x14b7e1(0x187)]=a22_0x14b7e1(0x1ea);[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x1a5);async['execute'](_0x504d46){const _0x3b15df=a22_0x14b7e1,{options:_0x518090,args:_0x1dfe93,tdx:_0x2ee8df}=_0x504d46;if(_0x1dfe93['length']===0x0)return console['error'](_0x3b15df(0x1cf)),console[_0x3b15df(0x192)](_0x3b15df(0x1aa)),console['error'](_0x3b15df(0x196)),console[_0x3b15df(0x192)](_0x3b15df(0x1d1)),console[_0x3b15df(0x192)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x3b15df(0x192)](_0x3b15df(0x1a4)),0x1;try{const _0x4f0c46=_0x1dfe93[0x0],_0x46e3f0=_0x518090['segmentPath'];let _0x1d6361=_0x4f0c46;_0x46e3f0&&!_0x4f0c46[_0x3b15df(0x194)]('/')&&(_0x1d6361=_0x46e3f0+'/'+_0x4f0c46,_0x518090[_0x3b15df(0x198)]&&console[_0x3b15df(0x192)]('Resolved\x20relative\x20path\x20to:\x20'+_0x1d6361));const _0x512bef=await withSpinner(_0x3b15df(0x1bd)+_0x1d6361+_0x3b15df(0x1ed),()=>_0x2ee8df['segment'][_0x3b15df(0x1b0)](_0x1d6361),{'verbose':_0x518090[_0x3b15df(0x198)]}),_0x33835c=_0x512bef[_0x3b15df(0x1b6)];_0x518090[_0x3b15df(0x198)]&&(console[_0x3b15df(0x192)](_0x3b15df(0x186)+_0x33835c[_0x3b15df(0x18f)]),console[_0x3b15df(0x192)]('Parent\x20ID:\x20'+_0x33835c[_0x3b15df(0x1b8)]));if(_0x33835c['type']===_0x3b15df(0x1e3))return console[_0x3b15df(0x192)](_0x3b15df(0x1e1)),console[_0x3b15df(0x192)](_0x3b15df(0x1a8)),0x1;let _0x1a1381;if(_0x33835c[_0x3b15df(0x18f)]==='parent'){const _0x1b7edd=await withSpinner(_0x3b15df(0x1b7),()=>_0x2ee8df[_0x3b15df(0x1ca)][_0x3b15df(0x1d4)](_0x33835c[_0x3b15df(0x1b8)]),{'verbose':_0x518090[_0x3b15df(0x198)]});_0x1a1381=_0x1b7edd['data'];}else{if(!_0x33835c[_0x3b15df(0x1c0)])throw new SDKError(ErrorCode[_0x3b15df(0x1c4)],_0x3b15df(0x18a));const _0x58920a=await withSpinner(_0x3b15df(0x1d6),()=>_0x2ee8df[_0x3b15df(0x1ca)]['getSegmentSQL'](_0x33835c[_0x3b15df(0x1b8)],_0x33835c[_0x3b15df(0x1c0)]),{'verbose':_0x518090[_0x3b15df(0x198)]});_0x1a1381=_0x58920a[_0x3b15df(0x1b6)];}const _0x474261=_0x518090['limit'],_0x1cbbfc=/\bLIMIT\s+\d+/i[_0x3b15df(0x1ec)](_0x1a1381);!_0x1cbbfc&&(_0x1a1381=_0x1a1381[_0x3b15df(0x1be)]()['replace'](/;+$/,''),_0x1a1381=_0x3b15df(0x1dc)+_0x1a1381+_0x3b15df(0x190)+_0x474261);_0x518090[_0x3b15df(0x198)]&&console['error'](_0x3b15df(0x1e6)+_0x1a1381);const _0x202444=await withQuerySpinner(_0x3b15df(0x1e8),async _0x3a7a22=>{const _0x4ff6f2=_0x3b15df,_0x4e763e=await _0x2ee8df[_0x4ff6f2(0x1c7)](_0x1a1381,{'catalog':'td','schema':_0x4ff6f2(0x1a9),'onJobId':_0x34b6bf=>{const _0x498a74=_0x4ff6f2;_0x3a7a22[_0x498a74(0x1bb)](_0x34b6bf);}});return _0x4e763e;},{'verbose':_0x518090[_0x3b15df(0x198)]}),_0x1d07c9=_0x202444[_0x3b15df(0x1b6)],_0x3bfba6=_0x1d07c9[_0x3b15df(0x1e2)]?'\x20[Job\x20ID:\x20'+_0x1d07c9['jobId']+']':'';return console[_0x3b15df(0x192)](_0x3b15df(0x1dd)+_0x1d07c9['stats'][_0x3b15df(0x1eb)]['toLocaleString']()+_0x3b15df(0x19f)+(_0x3b15df(0x19e)+formatElapsed(_0x1d07c9[_0x3b15df(0x1cc)][_0x3b15df(0x1a0)])+_0x3bfba6)),await handleQueryOutput(_0x1d07c9,_0x518090),0x0;}catch(_0x4cb028){if(_0x4cb028 instanceof SDKError)return console['error'](_0x3b15df(0x1ac)+_0x4cb028['code']+']'),console[_0x3b15df(0x192)]('\x0a'+_0x4cb028[_0x3b15df(0x1d3)]),0x1;throw _0x4cb028;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x1d0);async['execute'](_0x38cdaf){const _0x2efa88=a22_0x14b7e1,{options:_0x12da7e,args:_0x904d31,tdx:_0x15b9c6}=_0x38cdaf;if(_0x904d31[_0x2efa88(0x1bc)]===0x0)return console[_0x2efa88(0x192)](_0x2efa88(0x1b9)),console[_0x2efa88(0x192)](_0x2efa88(0x19b)),0x1;const _0x27e3a6=_0x904d31[0x0];try{_0x12da7e[_0x2efa88(0x198)]&&(console[_0x2efa88(0x192)](_0x2efa88(0x1b1)+_0x12da7e[_0x2efa88(0x1b4)]),console[_0x2efa88(0x192)](_0x2efa88(0x189)+_0x27e3a6));const _0x2d4c8c=await withSpinner(_0x2efa88(0x191)+_0x27e3a6+_0x2efa88(0x1ed),()=>_0x15b9c6[_0x2efa88(0x1ca)]['resolveParentId'](_0x27e3a6),{'verbose':_0x12da7e['verbose']}),_0x1edba7=_0x2d4c8c[_0x2efa88(0x1b6)];_0x12da7e[_0x2efa88(0x198)]&&console[_0x2efa88(0x192)](_0x2efa88(0x1cd)+_0x1edba7);const _0xea6e08=await withSpinner(_0x2efa88(0x1d7)+_0x27e3a6+_0x2efa88(0x1ed),()=>_0x15b9c6[_0x2efa88(0x1ca)][_0x2efa88(0x1ce)](_0x1edba7),{'verbose':_0x12da7e[_0x2efa88(0x198)]}),_0x3e162e=_0xea6e08[_0x2efa88(0x1b6)];return console[_0x2efa88(0x192)](_0x2efa88(0x1a3)+_0x3e162e['length']+'\x20folder'+(_0x3e162e['length']!==0x1?'s':'')),await handleSDKOutput(_0x3e162e,_0x12da7e),0x0;}catch(_0x34f15d){if(_0x34f15d instanceof SDKError)return console[_0x2efa88(0x192)](_0x2efa88(0x1bf)+_0x34f15d[_0x2efa88(0x1d3)]),_0x34f15d[_0x2efa88(0x1ee)]&&console[_0x2efa88(0x192)](_0x2efa88(0x195)+_0x34f15d[_0x2efa88(0x1ee)]),0x1;throw _0x34f15d;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a22_0x14b7e1(0x1e7);[a22_0x14b7e1(0x1df)]=a22_0x14b7e1(0x1e5);async['execute'](_0x33e7a4){const _0x123cb9=a22_0x14b7e1,{options:_0x276c76,args:_0x33ecd2,tdx:_0x5199ae}=_0x33e7a4;if(_0x33ecd2[_0x123cb9(0x1bc)]===0x0)return console[_0x123cb9(0x192)](_0x123cb9(0x1a7)),console[_0x123cb9(0x192)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x4369e6,childId:_0x4feaa9}=parseSegmentRef(_0x33ecd2[0x0]);_0x276c76['verbose']&&(console[_0x123cb9(0x192)](_0x123cb9(0x1b1)+_0x276c76[_0x123cb9(0x1b4)]),console[_0x123cb9(0x192)](_0x123cb9(0x189)+_0x4369e6),_0x4feaa9&&console['error']('Folder\x20name:\x20'+_0x4feaa9));if(!_0x4feaa9)return console[_0x123cb9(0x192)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x1b25d4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4369e6+_0x123cb9(0x1ed),()=>_0x5199ae[_0x123cb9(0x1ca)][_0x123cb9(0x1d2)](_0x4369e6),{'verbose':_0x276c76['verbose']}),_0x55c5dc=_0x1b25d4['data'];_0x276c76[_0x123cb9(0x198)]&&console[_0x123cb9(0x192)](_0x123cb9(0x1cd)+_0x55c5dc);const _0x39cb58=await withSpinner(_0x123cb9(0x1c1)+_0x4feaa9+'\x27...',()=>_0x5199ae[_0x123cb9(0x1ca)][_0x123cb9(0x1c5)](_0x55c5dc,_0x4feaa9),{'verbose':_0x276c76[_0x123cb9(0x198)]}),_0x25ffaa=_0x39cb58[_0x123cb9(0x1b6)];_0x276c76[_0x123cb9(0x198)]&&console[_0x123cb9(0x192)](_0x123cb9(0x1d5)+_0x25ffaa);const _0x2c14a9=await withSpinner('Fetching\x20folder\x20\x27'+_0x4feaa9+'\x27...',()=>_0x5199ae[_0x123cb9(0x1ca)]['getFolder'](_0x25ffaa),{'verbose':_0x276c76[_0x123cb9(0x198)]});return await handleSDKOutput([_0x2c14a9[_0x123cb9(0x1b6)]],_0x276c76),0x0;}catch(_0x279d2f){if(_0x279d2f instanceof SDKError)return console['error']('Error:\x20'+_0x279d2f['message']),_0x279d2f['cause']&&console[_0x123cb9(0x192)]('\x20\x20Cause:\x20'+_0x279d2f[_0x123cb9(0x1ee)]),0x1;throw _0x279d2f;}}}export class SegmentSQLCommand extends BaseCommand{[a22_0x14b7e1(0x187)]=a22_0x14b7e1(0x1a2);[a22_0x14b7e1(0x1df)]='Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment';async['execute'](_0x23a57a){const _0x4d68e8=a22_0x14b7e1,{options:_0x4334c1,args:_0x31e420,tdx:_0x3ed2c1}=_0x23a57a;if(_0x31e420[_0x4d68e8(0x1bc)]===0x0)return console[_0x4d68e8(0x192)](_0x4d68e8(0x1cf)),console[_0x4d68e8(0x192)]('Usage:\x20tdx\x20segment\x20sql\x20<path>'),console[_0x4d68e8(0x192)]('Examples:'),console[_0x4d68e8(0x192)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x4d68e8(0x192)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x4d68e8(0x192)]('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x3cb893=_0x31e420[0x0],_0x45b301=_0x4334c1[_0x4d68e8(0x1f2)];let _0x35e528=_0x3cb893;_0x45b301&&!_0x3cb893[_0x4d68e8(0x194)]('/')&&(_0x35e528=_0x45b301+'/'+_0x3cb893,_0x4334c1[_0x4d68e8(0x198)]&&console[_0x4d68e8(0x192)](_0x4d68e8(0x18c)+_0x35e528));const _0x107bf9=await withSpinner('Resolving\x20path\x20\x27'+_0x35e528+'\x27...',()=>_0x3ed2c1[_0x4d68e8(0x1ca)][_0x4d68e8(0x1b0)](_0x35e528),{'verbose':_0x4334c1[_0x4d68e8(0x198)]}),_0x212abe=_0x107bf9[_0x4d68e8(0x1b6)];_0x4334c1['verbose']&&(console[_0x4d68e8(0x192)]('Resolved\x20type:\x20'+_0x212abe[_0x4d68e8(0x18f)]),console[_0x4d68e8(0x192)](_0x4d68e8(0x19c)+_0x212abe[_0x4d68e8(0x1b8)]));if(_0x212abe[_0x4d68e8(0x18f)]===_0x4d68e8(0x1e3))return console[_0x4d68e8(0x192)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x4d68e8(0x192)](_0x4d68e8(0x18e)),0x1;let _0x4a29c8;if(_0x212abe['type']===_0x4d68e8(0x1e9)){const _0x1b8bb6=await withSpinner(_0x4d68e8(0x1b7),()=>_0x3ed2c1[_0x4d68e8(0x1ca)][_0x4d68e8(0x1d4)](_0x212abe[_0x4d68e8(0x1b8)]),{'verbose':_0x4334c1[_0x4d68e8(0x198)]});_0x4a29c8=_0x1b8bb6[_0x4d68e8(0x1b6)];}else{if(!_0x212abe[_0x4d68e8(0x1c0)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x58aee9=await withSpinner(_0x4d68e8(0x1d6),()=>_0x3ed2c1[_0x4d68e8(0x1ca)][_0x4d68e8(0x1f3)](_0x212abe['parentId'],_0x212abe[_0x4d68e8(0x1c0)]),{'verbose':_0x4334c1[_0x4d68e8(0x198)]});_0x4a29c8=_0x58aee9[_0x4d68e8(0x1b6)];}return _0x4334c1[_0x4d68e8(0x1cb)]==='json'||_0x4334c1['format']===_0x4d68e8(0x1c6)?await handleSDKOutput([{'sql':_0x4a29c8}],_0x4334c1):console['log'](_0x4a29c8),0x0;}catch(_0x43a378){if(_0x43a378 instanceof SDKError)return console['error']('Error:\x20'+_0x43a378[_0x4d68e8(0x1d3)]),_0x43a378['cause']&&console[_0x4d68e8(0x192)](_0x4d68e8(0x195)+_0x43a378['cause']),0x1;throw _0x43a378;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a22_0x14b7e1(0x187)]='segment:folder:create';[a22_0x14b7e1(0x1df)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x4159c2){const _0x5e0b57=a22_0x14b7e1,{options:_0x3889fe,args:_0x400ef1,tdx:_0x3e378f}=_0x4159c2,_0x50ec8a=_0x3889fe;if(_0x400ef1['length']<0x2)return console[_0x5e0b57(0x192)](_0x5e0b57(0x18b)),console[_0x5e0b57(0x192)](_0x5e0b57(0x1af)),0x1;const _0x519321=_0x400ef1[0x0],_0x3530a4=_0x400ef1[0x1];_0x50ec8a[_0x5e0b57(0x198)]&&(console[_0x5e0b57(0x192)]('Site:\x20'+_0x50ec8a[_0x5e0b57(0x1b4)]),console[_0x5e0b57(0x192)](_0x5e0b57(0x1a6)+_0x519321),console[_0x5e0b57(0x192)](_0x5e0b57(0x199)+_0x3530a4));let _0x15355f;if(_0x50ec8a[_0x5e0b57(0x1de)]){const _0x325b3d=_0x50ec8a[_0x5e0b57(0x1de)],_0x1784b6=await withSpinner(_0x5e0b57(0x191)+_0x519321+_0x5e0b57(0x1ed),()=>_0x3e378f[_0x5e0b57(0x1ca)][_0x5e0b57(0x1d2)](_0x519321),{'verbose':_0x50ec8a[_0x5e0b57(0x198)]}),_0x20e870=_0x1784b6[_0x5e0b57(0x1b6)],_0x495e1a=await withSpinner(_0x5e0b57(0x1ef)+_0x325b3d+'\x27...',()=>_0x3e378f[_0x5e0b57(0x1ca)][_0x5e0b57(0x1c5)](_0x20e870,_0x325b3d),{'verbose':_0x50ec8a['verbose']});_0x15355f=_0x495e1a['data'],_0x50ec8a[_0x5e0b57(0x198)]&&console[_0x5e0b57(0x192)](_0x5e0b57(0x197)+_0x15355f);}const _0x3a194a={'name':_0x3530a4,'description':_0x50ec8a[_0x5e0b57(0x1df)],'parentFolderId':_0x15355f},_0x1ee4c2=await withSpinner(_0x5e0b57(0x19a)+_0x3530a4+_0x5e0b57(0x1ed),()=>_0x3e378f[_0x5e0b57(0x1ca)][_0x5e0b57(0x1d9)](_0x519321,_0x3a194a),{'verbose':_0x50ec8a[_0x5e0b57(0x198)]}),_0x438e24=_0x1ee4c2[_0x5e0b57(0x1b6)];return console[_0x5e0b57(0x192)](_0x5e0b57(0x1ad)+_0x438e24[_0x5e0b57(0x187)]+'\x27\x20with\x20ID:\x20'+_0x438e24['id']),await handleSDKOutput([_0x438e24],_0x50ec8a),0x0;}}
@@ -1 +1 @@
1
- const a23_0x3364f1=a23_0x104b;function a23_0x104b(_0x368e21,_0xf8200b){const _0x2677d6=a23_0x2677();return a23_0x104b=function(_0x104be9,_0x15fcd8){_0x104be9=_0x104be9-0xfc;let _0x538f80=_0x2677d6[_0x104be9];return _0x538f80;},a23_0x104b(_0x368e21,_0xf8200b);}(function(_0x56bf4a,_0x52ff9d){const _0x32cbb9=a23_0x104b,_0x572642=_0x56bf4a();while(!![]){try{const _0x5b7118=parseInt(_0x32cbb9(0x121))/0x1+parseInt(_0x32cbb9(0x12c))/0x2*(parseInt(_0x32cbb9(0x11e))/0x3)+-parseInt(_0x32cbb9(0x103))/0x4*(-parseInt(_0x32cbb9(0x119))/0x5)+parseInt(_0x32cbb9(0x122))/0x6*(-parseInt(_0x32cbb9(0x10c))/0x7)+parseInt(_0x32cbb9(0x120))/0x8*(parseInt(_0x32cbb9(0x107))/0x9)+-parseInt(_0x32cbb9(0x11d))/0xa*(parseInt(_0x32cbb9(0x125))/0xb)+-parseInt(_0x32cbb9(0x105))/0xc*(parseInt(_0x32cbb9(0x10b))/0xd);if(_0x5b7118===_0x52ff9d)break;else _0x572642['push'](_0x572642['shift']());}catch(_0x3f71d9){_0x572642['push'](_0x572642['shift']());}}}(a23_0x2677,0xa3430));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a23_0x2677(){const _0x1f4fda=['segments','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','18514015YOqmPr','14WwVHeW','ruleFile','kind','verbose','description','\x27...','Resolved\x20folder\x20ID:\x20','segment','segment:create','length','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','createSegment','error','8420oErqHb','invisible','Examples:','data','10oKpnvS','703533JGIDOd','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','1664MgYJjO','318627SUUgQc','215466JoCcuG','resolveFolderId','execute','12575134nFtzRJ','\x27\x20with\x20ID:\x20','folderId','resolvePathToResource','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Segment\x20name:\x20','name','8GaRZLR','resolveParentId','✔\x20Created\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Target\x20path:\x20','Parent:\x20','includes','site','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Site:\x20','2980MclMxV','Resolving\x20folder\x20path\x20\x27','12XcPElm','folder','34470WkNDFL','Create\x20child\x20segment\x20with\x20filtering\x20rules'];a23_0x2677=function(){return _0x1f4fda;};return a23_0x2677();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a23_0x3364f1(0x12b)]=a23_0x3364f1(0x114);[a23_0x3364f1(0x110)]=a23_0x3364f1(0x108);async[a23_0x3364f1(0x124)](_0x24baec){const _0x228f27=a23_0x3364f1,{options:_0x49b21a,args:_0x35e0d3,tdx:_0x2c109b}=_0x24baec,_0x4b3823=_0x49b21a;if(_0x35e0d3['length']===0x0)return console['error'](_0x228f27(0xfc)),console['error'](_0x228f27(0x11f)),console[_0x228f27(0x118)](_0x228f27(0x11b)),console[_0x228f27(0x118)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x228f27(0x118)](_0x228f27(0x101)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x3a3e9c=_0x35e0d3[0x0],_0x3e690d=_0x49b21a['segmentPath'];let _0x16d20b=_0x3a3e9c;_0x3e690d&&!_0x3a3e9c[_0x228f27(0xff)]('/')&&(_0x16d20b=_0x3e690d+'/'+_0x3a3e9c,_0x4b3823[_0x228f27(0x10f)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x16d20b));const _0x3ec7cf=parsePath(_0x16d20b);if(_0x3ec7cf[_0x228f27(0x109)][_0x228f27(0x115)]<0x2)return console[_0x228f27(0x118)](_0x228f27(0x10a)),console[_0x228f27(0x118)](_0x228f27(0x129)),0x1;const _0x15e13f=_0x3ec7cf[_0x228f27(0x109)][0x0],_0x61c335=getBaseName(_0x16d20b),_0x58e6bd=getParentPath(_0x16d20b);_0x4b3823[_0x228f27(0x10f)]&&(console['error'](_0x228f27(0x102)+_0x4b3823[_0x228f27(0x100)]),console[_0x228f27(0x118)](_0x228f27(0xfd)+_0x16d20b),console[_0x228f27(0x118)](_0x228f27(0xfe)+_0x15e13f),console['error'](_0x228f27(0x12a)+_0x61c335),console[_0x228f27(0x118)]('Parent\x20path:\x20'+_0x58e6bd));const _0x36eb5a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x15e13f+'\x27...',()=>_0x2c109b[_0x228f27(0x113)][_0x228f27(0x12d)](_0x15e13f),{'verbose':_0x4b3823[_0x228f27(0x10f)]}),_0x379ec9=_0x36eb5a[_0x228f27(0x11c)];let _0x4da8aa;if(_0x3ec7cf['segments'][_0x228f27(0x115)]>0x2){const _0x112565=await withSpinner(_0x228f27(0x104)+_0x58e6bd+_0x228f27(0x111),()=>_0x2c109b['segment'][_0x228f27(0x128)](_0x58e6bd),{'verbose':_0x4b3823['verbose']}),_0x34e17c=_0x112565[_0x228f27(0x11c)];if(_0x34e17c['type']!==_0x228f27(0x106)&&_0x34e17c['type']!=='parent')return console[_0x228f27(0x118)](_0x228f27(0x116)),0x1;_0x4da8aa=_0x34e17c[_0x228f27(0x127)];}else{if(_0x4b3823['folder']){const _0x201f43=await withSpinner('Resolving\x20folder\x20\x27'+_0x4b3823[_0x228f27(0x106)]+_0x228f27(0x111),()=>_0x2c109b[_0x228f27(0x113)][_0x228f27(0x123)](_0x379ec9,_0x4b3823[_0x228f27(0x106)]),{'verbose':_0x4b3823[_0x228f27(0x10f)]});_0x4da8aa=_0x201f43[_0x228f27(0x11c)];}}_0x4b3823['verbose']&&_0x4da8aa&&console[_0x228f27(0x118)](_0x228f27(0x112)+_0x4da8aa);const _0x3be43e=await loadJSONFromOptions(_0x4b3823['rule'],_0x4b3823[_0x228f27(0x10d)]),_0x436679={'name':_0x61c335,'description':_0x4b3823['description'],'rule':_0x3be43e,'kind':_0x4b3823[_0x228f27(0x10e)]!==undefined?parseInt(_0x4b3823[_0x228f27(0x10e)],0xa):undefined,'isVisible':_0x4b3823[_0x228f27(0x11a)]?![]:undefined,'segmentFolderId':_0x4da8aa,'countPopulation':_0x4b3823['noCountPopulation']?![]:undefined},_0x5091f6=await withSpinner('Creating\x20segment\x20\x27'+_0x61c335+_0x228f27(0x111),()=>_0x2c109b[_0x228f27(0x113)][_0x228f27(0x117)](_0x379ec9,_0x436679),{'verbose':_0x4b3823[_0x228f27(0x10f)]}),_0x242332=_0x5091f6['data'];return console['error'](_0x228f27(0x12e)+_0x242332[_0x228f27(0x12b)]+_0x228f27(0x126)+_0x242332['id']),_0x16d20b!==_0x3a3e9c&&console[_0x228f27(0x118)]('\x20\x20\x20Path:\x20'+_0x16d20b),await handleSDKOutput([_0x242332],_0x4b3823),0x0;}}
1
+ const a23_0x19a1af=a23_0xd175;(function(_0x2e135d,_0x663958){const _0x45ae55=a23_0xd175,_0x561cc0=_0x2e135d();while(!![]){try{const _0x391daf=-parseInt(_0x45ae55(0x1fc))/0x1*(parseInt(_0x45ae55(0x1e4))/0x2)+parseInt(_0x45ae55(0x209))/0x3+parseInt(_0x45ae55(0x208))/0x4+parseInt(_0x45ae55(0x1f2))/0x5*(parseInt(_0x45ae55(0x1eb))/0x6)+parseInt(_0x45ae55(0x204))/0x7*(-parseInt(_0x45ae55(0x1e7))/0x8)+parseInt(_0x45ae55(0x1f4))/0x9+-parseInt(_0x45ae55(0x1fe))/0xa;if(_0x391daf===_0x663958)break;else _0x561cc0['push'](_0x561cc0['shift']());}catch(_0x462183){_0x561cc0['push'](_0x561cc0['shift']());}}}(a23_0x408f,0x678de));import{BaseCommand}from'./command.js';function a23_0x408f(){const _0x237912=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','\x20\x20\x20Path:\x20','execute','invisible','type','Creating\x20segment\x20\x27','244eBtzSz','resolveFolderId','resolvePathToResource','260152hxxtlF','Examples:','parent','createSegment','930ZdpbyM','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent:\x20','folder','\x27...','description','ruleFile','20665QhCKDW','Site:\x20','1241685kiQOjV','error','Resolved\x20relative\x20path\x20to:\x20','segment','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','site','name','4000buuCLE','Parent\x20path:\x20','943530qwVFWd','data','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Segment\x20name:\x20','noCountPopulation','rule','175fbxHmH','verbose','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','3304124RvMFUy','644625qNiMVy','length','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segments','kind','\x27\x20with\x20ID:\x20'];a23_0x408f=function(){return _0x237912;};return a23_0x408f();}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a23_0xd175(_0x3fc8e7,_0x5bc5b2){const _0x408f90=a23_0x408f();return a23_0xd175=function(_0xd1755e,_0x2ca9e1){_0xd1755e=_0xd1755e-0x1de;let _0xde8712=_0x408f90[_0xd1755e];return _0xde8712;},a23_0xd175(_0x3fc8e7,_0x5bc5b2);}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']='segment:create';[a23_0x19a1af(0x1f0)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a23_0x19a1af(0x1e0)](_0x51ca16){const _0xee6a22=a23_0x19a1af,{options:_0x162bec,args:_0x2f2c0d,tdx:_0x4815cd}=_0x51ca16,_0x5c1d40=_0x162bec;if(_0x2f2c0d[_0xee6a22(0x20a)]===0x0)return console[_0xee6a22(0x1f5)](_0xee6a22(0x1ec)),console[_0xee6a22(0x1f5)](_0xee6a22(0x206)),console[_0xee6a22(0x1f5)](_0xee6a22(0x1e8)),console[_0xee6a22(0x1f5)](_0xee6a22(0x207)),console[_0xee6a22(0x1f5)](_0xee6a22(0x1de)),console[_0xee6a22(0x1f5)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x160626=_0x2f2c0d[0x0],_0x50925f=_0x162bec['segmentPath'];let _0x17f674=_0x160626;_0x50925f&&!_0x160626['includes']('/')&&(_0x17f674=_0x50925f+'/'+_0x160626,_0x5c1d40[_0xee6a22(0x205)]&&console['error'](_0xee6a22(0x1f6)+_0x17f674));const _0x55de20=parsePath(_0x17f674);if(_0x55de20[_0xee6a22(0x20c)][_0xee6a22(0x20a)]<0x2)return console[_0xee6a22(0x1f5)](_0xee6a22(0x20b)),console[_0xee6a22(0x1f5)](_0xee6a22(0x200)),0x1;const _0x56896f=_0x55de20['segments'][0x0],_0x53949f=getBaseName(_0x17f674),_0x5a2917=getParentPath(_0x17f674);_0x5c1d40['verbose']&&(console[_0xee6a22(0x1f5)](_0xee6a22(0x1f3)+_0x5c1d40[_0xee6a22(0x1fa)]),console[_0xee6a22(0x1f5)]('Target\x20path:\x20'+_0x17f674),console[_0xee6a22(0x1f5)](_0xee6a22(0x1ed)+_0x56896f),console[_0xee6a22(0x1f5)](_0xee6a22(0x201)+_0x53949f),console[_0xee6a22(0x1f5)](_0xee6a22(0x1fd)+_0x5a2917));const _0x507b9d=await withSpinner(_0xee6a22(0x1f8)+_0x56896f+_0xee6a22(0x1ef),()=>_0x4815cd[_0xee6a22(0x1f7)]['resolveParentId'](_0x56896f),{'verbose':_0x5c1d40['verbose']}),_0x579871=_0x507b9d['data'];let _0x211400;if(_0x55de20['segments'][_0xee6a22(0x20a)]>0x2){const _0x15fde8=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x5a2917+_0xee6a22(0x1ef),()=>_0x4815cd[_0xee6a22(0x1f7)][_0xee6a22(0x1e6)](_0x5a2917),{'verbose':_0x5c1d40[_0xee6a22(0x205)]}),_0x11cd77=_0x15fde8['data'];if(_0x11cd77[_0xee6a22(0x1e2)]!==_0xee6a22(0x1ee)&&_0x11cd77[_0xee6a22(0x1e2)]!==_0xee6a22(0x1e9))return console[_0xee6a22(0x1f5)](_0xee6a22(0x1f9)),0x1;_0x211400=_0x11cd77['folderId'];}else{if(_0x5c1d40['folder']){const _0xb708ab=await withSpinner('Resolving\x20folder\x20\x27'+_0x5c1d40['folder']+_0xee6a22(0x1ef),()=>_0x4815cd[_0xee6a22(0x1f7)][_0xee6a22(0x1e5)](_0x579871,_0x5c1d40[_0xee6a22(0x1ee)]),{'verbose':_0x5c1d40[_0xee6a22(0x205)]});_0x211400=_0xb708ab[_0xee6a22(0x1ff)];}}_0x5c1d40[_0xee6a22(0x205)]&&_0x211400&&console[_0xee6a22(0x1f5)]('Resolved\x20folder\x20ID:\x20'+_0x211400);const _0xf0638=await loadJSONFromOptions(_0x5c1d40[_0xee6a22(0x203)],_0x5c1d40[_0xee6a22(0x1f1)]),_0x30e416={'name':_0x53949f,'description':_0x5c1d40[_0xee6a22(0x1f0)],'rule':_0xf0638,'kind':_0x5c1d40['kind']!==undefined?parseInt(_0x5c1d40[_0xee6a22(0x20d)],0xa):undefined,'isVisible':_0x5c1d40[_0xee6a22(0x1e1)]?![]:undefined,'segmentFolderId':_0x211400,'countPopulation':_0x5c1d40[_0xee6a22(0x202)]?![]:undefined},_0x3f6131=await withSpinner(_0xee6a22(0x1e3)+_0x53949f+_0xee6a22(0x1ef),()=>_0x4815cd['segment'][_0xee6a22(0x1ea)](_0x579871,_0x30e416),{'verbose':_0x5c1d40['verbose']}),_0x22a49d=_0x3f6131[_0xee6a22(0x1ff)];return console[_0xee6a22(0x1f5)]('✔\x20Created\x20segment\x20\x27'+_0x22a49d[_0xee6a22(0x1fb)]+_0xee6a22(0x20e)+_0x22a49d['id']),_0x17f674!==_0x160626&&console[_0xee6a22(0x1f5)](_0xee6a22(0x1df)+_0x17f674),await handleSDKOutput([_0x22a49d],_0x5c1d40),0x0;}}
@@ -1 +1 @@
1
- function a24_0xef35(_0x2163fb,_0x1c95e9){const _0x262157=a24_0x2621();return a24_0xef35=function(_0xef356f,_0x550d00){_0xef356f=_0xef356f-0x1ee;let _0x5ca62a=_0x262157[_0xef356f];return _0x5ca62a;},a24_0xef35(_0x2163fb,_0x1c95e9);}const a24_0x4e09f0=a24_0xef35;(function(_0x75511e,_0x3a5e65){const _0x387a8e=a24_0xef35,_0x29c0d1=_0x75511e();while(!![]){try{const _0x527775=parseInt(_0x387a8e(0x1f2))/0x1+-parseInt(_0x387a8e(0x1f6))/0x2+-parseInt(_0x387a8e(0x1fd))/0x3*(-parseInt(_0x387a8e(0x1ee))/0x4)+-parseInt(_0x387a8e(0x201))/0x5+-parseInt(_0x387a8e(0x204))/0x6*(-parseInt(_0x387a8e(0x1f0))/0x7)+-parseInt(_0x387a8e(0x1f1))/0x8+parseInt(_0x387a8e(0x1f4))/0x9*(parseInt(_0x387a8e(0x203))/0xa);if(_0x527775===_0x3a5e65)break;else _0x29c0d1['push'](_0x29c0d1['shift']());}catch(_0x737075){_0x29c0d1['push'](_0x29c0d1['shift']());}}}(a24_0x2621,0xbd255));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a24_0x2621(){const _0x272638=['site','Parent\x20segment:\x20','2477210lmMwLf','description','24257620yacRBn','496860cmxuId','name','20ARhNvb','\x27...','21JdfCAG','6326488BrfyLh','127082zSkuUV','error','9aIVUmk','execute','1694580mIGuRc','segment:fields','\x20field','segment','✔\x20Found\x20','verbose','length','64206DWiWiN','List\x20available\x20fields\x20for\x20segmentation'];a24_0x2621=function(){return _0x272638;};return a24_0x2621();}import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{[a24_0x4e09f0(0x205)]=a24_0x4e09f0(0x1f7);[a24_0x4e09f0(0x202)]=a24_0x4e09f0(0x1fe);async[a24_0x4e09f0(0x1f5)](_0x480787){const _0x67d960=a24_0x4e09f0,{options:_0x291939,args:_0x15c3dc,tdx:_0x17cbc1}=_0x480787;if(_0x15c3dc['length']===0x0)return console[_0x67d960(0x1f3)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x67d960(0x1f3)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),0x1;const _0x4c2ede=_0x15c3dc[0x0];_0x291939[_0x67d960(0x1fb)]&&(console[_0x67d960(0x1f3)]('Site:\x20'+_0x291939[_0x67d960(0x1ff)]),console[_0x67d960(0x1f3)](_0x67d960(0x200)+_0x4c2ede));const _0x3a8e62=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x4c2ede+_0x67d960(0x1ef),()=>_0x17cbc1[_0x67d960(0x1f9)]['listFields'](_0x4c2ede),{'verbose':_0x291939[_0x67d960(0x1fb)]}),_0x551142=_0x3a8e62['data'];return console[_0x67d960(0x1f3)](_0x67d960(0x1fa)+_0x551142[_0x67d960(0x1fc)]+_0x67d960(0x1f8)+(_0x551142[_0x67d960(0x1fc)]!==0x1?'s':'')),await handleSDKOutput(_0x551142,_0x291939),0x0;}}
1
+ const a24_0x41f898=a24_0x3fc9;function a24_0x3fc9(_0x508ac4,_0x3b4e70){const _0x4ba170=a24_0x4ba1();return a24_0x3fc9=function(_0x3fc93c,_0x4c49dc){_0x3fc93c=_0x3fc93c-0x140;let _0x4a31b4=_0x4ba170[_0x3fc93c];return _0x4a31b4;},a24_0x3fc9(_0x508ac4,_0x3b4e70);}function a24_0x4ba1(){const _0x597a86=['Site:\x20','\x27...','24130719jnDZHW','404438IhKTZM','Listing\x20fields\x20for\x20\x27','segment','description','\x20field','2ZzhpiX','3414776HCLaOX','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','2165051jbjSjo','site','verbose','segment:fields','error','List\x20available\x20fields\x20for\x20segmentation','2785rhRjZo','length','4383330lQaAJP','2306169opLFZJ','1868dFgYay'];a24_0x4ba1=function(){return _0x597a86;};return a24_0x4ba1();}(function(_0x5317ec,_0x406522){const _0x1af11d=a24_0x3fc9,_0x512058=_0x5317ec();while(!![]){try{const _0x2294e5=parseInt(_0x1af11d(0x148))/0x1*(-parseInt(_0x1af11d(0x14d))/0x2)+-parseInt(_0x1af11d(0x143))/0x3+parseInt(_0x1af11d(0x144))/0x4*(-parseInt(_0x1af11d(0x140))/0x5)+-parseInt(_0x1af11d(0x142))/0x6+parseInt(_0x1af11d(0x150))/0x7+-parseInt(_0x1af11d(0x14e))/0x8+parseInt(_0x1af11d(0x147))/0x9;if(_0x2294e5===_0x406522)break;else _0x512058['push'](_0x512058['shift']());}catch(_0x3aaad1){_0x512058['push'](_0x512058['shift']());}}}(a24_0x4ba1,0x619ba));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a24_0x41f898(0x153);[a24_0x41f898(0x14b)]=a24_0x41f898(0x155);async['execute'](_0x429a68){const _0x9aa037=a24_0x41f898,{options:_0x5b287a,args:_0x542ef5,tdx:_0x303511}=_0x429a68;if(_0x542ef5[_0x9aa037(0x141)]===0x0)return console[_0x9aa037(0x154)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x9aa037(0x154)](_0x9aa037(0x14f)),0x1;const _0x3f7205=_0x542ef5[0x0];_0x5b287a[_0x9aa037(0x152)]&&(console[_0x9aa037(0x154)](_0x9aa037(0x145)+_0x5b287a[_0x9aa037(0x151)]),console[_0x9aa037(0x154)]('Parent\x20segment:\x20'+_0x3f7205));const _0x157605=await withSpinner(_0x9aa037(0x149)+_0x3f7205+_0x9aa037(0x146),()=>_0x303511[_0x9aa037(0x14a)]['listFields'](_0x3f7205),{'verbose':_0x5b287a[_0x9aa037(0x152)]}),_0x17a75f=_0x157605['data'];return console[_0x9aa037(0x154)]('✔\x20Found\x20'+_0x17a75f['length']+_0x9aa037(0x14c)+(_0x17a75f[_0x9aa037(0x141)]!==0x1?'s':'')),await handleSDKOutput(_0x17a75f,_0x5b287a),0x0;}}
@@ -1 +1 @@
1
- const a25_0x3a78cc=a25_0x1867;(function(_0x35027e,_0x291182){const _0x23630d=a25_0x1867,_0x539128=_0x35027e();while(!![]){try{const _0x4dd3d0=parseInt(_0x23630d(0x1a3))/0x1*(parseInt(_0x23630d(0x1a4))/0x2)+-parseInt(_0x23630d(0x193))/0x3*(-parseInt(_0x23630d(0x1a2))/0x4)+parseInt(_0x23630d(0x19f))/0x5*(parseInt(_0x23630d(0x195))/0x6)+-parseInt(_0x23630d(0x190))/0x7*(-parseInt(_0x23630d(0x19d))/0x8)+parseInt(_0x23630d(0x1a1))/0x9+-parseInt(_0x23630d(0x196))/0xa+-parseInt(_0x23630d(0x18f))/0xb*(parseInt(_0x23630d(0x18c))/0xc);if(_0x4dd3d0===_0x291182)break;else _0x539128['push'](_0x539128['shift']());}catch(_0x2191ba){_0x539128['push'](_0x539128['shift']());}}}(a25_0x4f58,0x23f63));import{BaseCommand}from'./command.js';function a25_0x4f58(){const _0x5cf978=['4bLKFYm','46ImTToS','8434Rhulyo','name','89748iYKgyd','segmentPath','jsonl','1111AAraFw','1077209gMqczh','json','Show\x20current\x20segment/folder\x20context','392613yQpKka','error','1340634dcoZVg','48340tJGTkQ','format','execute','stringify','verbose','Context\x20details:','log','8driAAj','description','5LDdQaz','\x20\x20Path:\x20','1847997NoSfbn'];a25_0x4f58=function(){return _0x5cf978;};return a25_0x4f58();}function a25_0x1867(_0x4f2f06,_0x33f80f){const _0x4f5848=a25_0x4f58();return a25_0x1867=function(_0x186755,_0x31d83b){_0x186755=_0x186755-0x18c;let _0x2bdb64=_0x4f5848[_0x186755];return _0x2bdb64;},a25_0x1867(_0x4f2f06,_0x33f80f);}export class SegmentPwdCommand extends BaseCommand{[a25_0x3a78cc(0x1a5)]='segment:pwd';[a25_0x3a78cc(0x19e)]=a25_0x3a78cc(0x192);async[a25_0x3a78cc(0x198)](_0x4ad7d6){const _0x5e3ab3=a25_0x3a78cc,{options:_0x39d0a1}=_0x4ad7d6;try{const _0x2bd4f0=_0x39d0a1[_0x5e3ab3(0x18d)];if(!_0x2bd4f0)return _0x39d0a1[_0x5e3ab3(0x197)]==='json'||_0x39d0a1[_0x5e3ab3(0x197)]===_0x5e3ab3(0x18e)?console[_0x5e3ab3(0x19c)](JSON['stringify']({'path':'/','type':'root'})):console['log']('/'),0x0;if(_0x39d0a1[_0x5e3ab3(0x197)]===_0x5e3ab3(0x191)||_0x39d0a1[_0x5e3ab3(0x197)]===_0x5e3ab3(0x18e)){const _0x4a5aec={'path':_0x2bd4f0};console[_0x5e3ab3(0x19c)](JSON[_0x5e3ab3(0x199)](_0x4a5aec));}else console[_0x5e3ab3(0x19c)](_0x2bd4f0),_0x39d0a1[_0x5e3ab3(0x19a)]&&(console[_0x5e3ab3(0x194)](''),console[_0x5e3ab3(0x194)](_0x5e3ab3(0x19b)),console[_0x5e3ab3(0x194)](_0x5e3ab3(0x1a0)+_0x2bd4f0),console['error'](''),console[_0x5e3ab3(0x194)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x5e3ab3(0x194)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0x26f9f2){throw _0x26f9f2;}}}
1
+ const a25_0x2e744b=a25_0x2e6c;function a25_0x2e6c(_0x3f387a,_0x58176c){const _0x547b87=a25_0x547b();return a25_0x2e6c=function(_0x2e6caa,_0x502150){_0x2e6caa=_0x2e6caa-0x106;let _0xfecbe1=_0x547b87[_0x2e6caa];return _0xfecbe1;},a25_0x2e6c(_0x3f387a,_0x58176c);}(function(_0x56d376,_0x2b096e){const _0x50d10d=a25_0x2e6c,_0x1a6b0c=_0x56d376();while(!![]){try{const _0x578a47=parseInt(_0x50d10d(0x120))/0x1*(parseInt(_0x50d10d(0x10b))/0x2)+-parseInt(_0x50d10d(0x107))/0x3+parseInt(_0x50d10d(0x106))/0x4*(-parseInt(_0x50d10d(0x116))/0x5)+-parseInt(_0x50d10d(0x121))/0x6+parseInt(_0x50d10d(0x10e))/0x7*(-parseInt(_0x50d10d(0x114))/0x8)+parseInt(_0x50d10d(0x11b))/0x9+parseInt(_0x50d10d(0x11f))/0xa*(parseInt(_0x50d10d(0x112))/0xb);if(_0x578a47===_0x2b096e)break;else _0x1a6b0c['push'](_0x1a6b0c['shift']());}catch(_0x4fe9cf){_0x1a6b0c['push'](_0x1a6b0c['shift']());}}}(a25_0x547b,0xbbd25));import{BaseCommand}from'./command.js';function a25_0x547b(){const _0x30adfd=['error','verbose','1500202qIHNln','name','8maUMyU','Show\x20current\x20segment/folder\x20context','315415DlPmLw','Context\x20details:','segment:pwd','\x20\x20Path:\x20','execute','4185333TTNDyA','stringify','segmentPath','format','120zeICZM','1005457WdPdzY','7254366FPFPLz','4nbUFie','608541jvUjSc','jsonl','json','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','2VDBDga','description','log','6039390WDRZtI','root'];a25_0x547b=function(){return _0x30adfd;};return a25_0x547b();}export class SegmentPwdCommand extends BaseCommand{[a25_0x2e744b(0x113)]=a25_0x2e744b(0x118);[a25_0x2e744b(0x10c)]=a25_0x2e744b(0x115);async[a25_0x2e744b(0x11a)](_0x9827b0){const _0x4a8c53=a25_0x2e744b,{options:_0x6e6d0a}=_0x9827b0;try{const _0x2be092=_0x6e6d0a[_0x4a8c53(0x11d)];if(!_0x2be092)return _0x6e6d0a['format']===_0x4a8c53(0x109)||_0x6e6d0a[_0x4a8c53(0x11e)]===_0x4a8c53(0x108)?console[_0x4a8c53(0x10d)](JSON[_0x4a8c53(0x11c)]({'path':'/','type':_0x4a8c53(0x10f)})):console[_0x4a8c53(0x10d)]('/'),0x0;if(_0x6e6d0a['format']==='json'||_0x6e6d0a[_0x4a8c53(0x11e)]===_0x4a8c53(0x108)){const _0x21e985={'path':_0x2be092};console[_0x4a8c53(0x10d)](JSON['stringify'](_0x21e985));}else console[_0x4a8c53(0x10d)](_0x2be092),_0x6e6d0a[_0x4a8c53(0x111)]&&(console[_0x4a8c53(0x110)](''),console[_0x4a8c53(0x110)](_0x4a8c53(0x117)),console[_0x4a8c53(0x110)](_0x4a8c53(0x119)+_0x2be092),console[_0x4a8c53(0x110)](''),console[_0x4a8c53(0x110)](_0x4a8c53(0x10a)),console[_0x4a8c53(0x110)]('Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources'));return 0x0;}catch(_0xb2e594){throw _0xb2e594;}}}
@@ -1 +1 @@
1
- const a26_0x52befe=a26_0x3420;function a26_0x3420(_0xf5d057,_0x36a1fe){const _0x49abf7=a26_0x49ab();return a26_0x3420=function(_0x342046,_0x187542){_0x342046=_0x342046-0x1bb;let _0x1f08f9=_0x49abf7[_0x342046];return _0x1f08f9;},a26_0x3420(_0xf5d057,_0x36a1fe);}(function(_0x48dff0,_0x996baa){const _0x4a3353=a26_0x3420,_0x42d448=_0x48dff0();while(!![]){try{const _0x5e8947=parseInt(_0x4a3353(0x1d9))/0x1+-parseInt(_0x4a3353(0x1e5))/0x2+parseInt(_0x4a3353(0x1bd))/0x3+-parseInt(_0x4a3353(0x1c7))/0x4*(-parseInt(_0x4a3353(0x1d1))/0x5)+-parseInt(_0x4a3353(0x1c8))/0x6+parseInt(_0x4a3353(0x1dd))/0x7+-parseInt(_0x4a3353(0x1c2))/0x8;if(_0x5e8947===_0x996baa)break;else _0x42d448['push'](_0x42d448['shift']());}catch(_0x355f93){_0x42d448['push'](_0x42d448['shift']());}}}(a26_0x49ab,0x383ab));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';function a26_0x49ab(){const _0x2df24a=['Resolved\x20folder\x20ID:\x20','Resolving\x20folder\x20\x27','ruleFile','type','Parent\x20ID:\x20','857335DvTtCM','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','verbose','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','segment','Examples:','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','166220SLuLuv','\x27...','\x20\x20\x20Path:\x20','parentId','606263omQCbQ','error','segmentId','folder','segmentPath','length','kind','Updating\x20segment\x20\x27','232858zcsqHB','Resolved\x20relative\x20path\x20to:\x20','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','1026090AHbJIB','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','execute','2706184xkdNWS','resolvePathToResource','name','data','description','8nFbOQn','1516656cLwgHV','Segment\x20ID\x20missing\x20from\x20resolved\x20path','updateSegmentById','Error:\x20Cannot\x20update\x20'];a26_0x49ab=function(){return _0x2df24a;};return a26_0x49ab();}export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';[a26_0x52befe(0x1c6)]='Update\x20existing\x20child\x20segment';async[a26_0x52befe(0x1c1)](_0x91471b){const _0x5534b5=a26_0x52befe,{options:_0x273776,args:_0x853bb4,tdx:_0x5d3971}=_0x91471b,_0x1d21b2=_0x273776;if(_0x853bb4[_0x5534b5(0x1e2)]===0x0)return console[_0x5534b5(0x1de)](_0x5534b5(0x1be)),console[_0x5534b5(0x1de)](_0x5534b5(0x1d2)),console[_0x5534b5(0x1de)](_0x5534b5(0x1d6)),console[_0x5534b5(0x1de)](_0x5534b5(0x1d4)),console[_0x5534b5(0x1de)](_0x5534b5(0x1c0)),0x1;const _0x55e0e1=_0x853bb4[0x0],_0x33553=_0x273776[_0x5534b5(0x1e1)];let _0x88cb5e=_0x55e0e1;_0x33553&&!_0x55e0e1['includes']('/')&&(_0x88cb5e=_0x33553+'/'+_0x55e0e1,_0x1d21b2[_0x5534b5(0x1d3)]&&console[_0x5534b5(0x1de)](_0x5534b5(0x1bb)+_0x88cb5e));const _0x3ec8ce=await withSpinner(_0x5534b5(0x1d8)+_0x88cb5e+_0x5534b5(0x1da),()=>_0x5d3971[_0x5534b5(0x1d5)][_0x5534b5(0x1c3)](_0x88cb5e),{'verbose':_0x1d21b2['verbose']}),_0x7c58b4=_0x3ec8ce[_0x5534b5(0x1c5)];_0x1d21b2[_0x5534b5(0x1d3)]&&console[_0x5534b5(0x1de)](_0x5534b5(0x1bf)+_0x7c58b4[_0x5534b5(0x1cf)]);if(_0x7c58b4[_0x5534b5(0x1cf)]!==_0x5534b5(0x1d5))return console['error'](_0x5534b5(0x1cb)+_0x7c58b4['type']+_0x5534b5(0x1bc)),console[_0x5534b5(0x1de)](_0x5534b5(0x1d7)),0x1;if(!_0x7c58b4[_0x5534b5(0x1df)])throw new SDKError(ErrorCode['INTERNAL'],_0x5534b5(0x1c9));const _0x2ef99d=_0x7c58b4[_0x5534b5(0x1dc)],_0x2682a0=_0x7c58b4['segmentId'];_0x1d21b2[_0x5534b5(0x1d3)]&&(console[_0x5534b5(0x1de)](_0x5534b5(0x1d0)+_0x2ef99d),console[_0x5534b5(0x1de)]('Segment\x20ID:\x20'+_0x2682a0));let _0x129921;if(_0x1d21b2[_0x5534b5(0x1e0)]){const _0x44b224=_0x1d21b2[_0x5534b5(0x1e0)],_0x2eee0e=await withSpinner(_0x5534b5(0x1cd)+_0x44b224+'\x27...',()=>_0x5d3971[_0x5534b5(0x1d5)]['resolveFolderId'](_0x2ef99d,_0x44b224),{'verbose':_0x1d21b2[_0x5534b5(0x1d3)]});_0x129921=parseInt(_0x2eee0e[_0x5534b5(0x1c5)],0xa),_0x1d21b2[_0x5534b5(0x1d3)]&&console['error'](_0x5534b5(0x1cc)+_0x129921);}const _0x43f0eb=await loadJSONFromOptions(_0x1d21b2['rule'],_0x1d21b2[_0x5534b5(0x1ce)]),_0x4c01d2={'name':_0x1d21b2[_0x5534b5(0x1c4)],'description':_0x1d21b2[_0x5534b5(0x1c6)],'rule':_0x43f0eb,'kind':_0x1d21b2[_0x5534b5(0x1e3)]!==undefined?parseInt(_0x1d21b2['kind'],0xa):undefined,'segmentFolderId':_0x129921},_0x39a9d8=await withSpinner(_0x5534b5(0x1e4)+_0x7c58b4['segmentName']+_0x5534b5(0x1da),()=>_0x5d3971[_0x5534b5(0x1d5)][_0x5534b5(0x1ca)](_0x2ef99d,_0x2682a0,_0x4c01d2),{'verbose':_0x1d21b2[_0x5534b5(0x1d3)]}),_0x53bacd=_0x39a9d8[_0x5534b5(0x1c5)];return console[_0x5534b5(0x1de)]('✔\x20Updated\x20segment\x20\x27'+_0x53bacd[_0x5534b5(0x1c4)]+'\x27'),_0x88cb5e!==_0x55e0e1&&console[_0x5534b5(0x1de)](_0x5534b5(0x1db)+_0x88cb5e),await handleSDKOutput([_0x53bacd],_0x1d21b2),0x0;}}
1
+ const a26_0x1c4733=a26_0x565d;(function(_0x3dd3f8,_0x25d620){const _0x2a04d7=a26_0x565d,_0x54b54d=_0x3dd3f8();while(!![]){try{const _0x451aa1=-parseInt(_0x2a04d7(0xf9))/0x1+-parseInt(_0x2a04d7(0xf1))/0x2+-parseInt(_0x2a04d7(0xe5))/0x3+parseInt(_0x2a04d7(0xeb))/0x4*(parseInt(_0x2a04d7(0xf8))/0x5)+-parseInt(_0x2a04d7(0x101))/0x6+-parseInt(_0x2a04d7(0xe8))/0x7+parseInt(_0x2a04d7(0xfd))/0x8;if(_0x451aa1===_0x25d620)break;else _0x54b54d['push'](_0x54b54d['shift']());}catch(_0x4f2eb3){_0x54b54d['push'](_0x54b54d['shift']());}}}(a26_0x12e0,0xb9925));function a26_0x12e0(){const _0x3b95e5=['Error:\x20Cannot\x20update\x20','42987688SmCUnR','\x27...','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','✔\x20Updated\x20segment\x20\x27','2480250RJEzNz','includes','error','resolvePathToResource','folder','verbose','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','type','Resolved\x20relative\x20path\x20to:\x20','Examples:','rule','Segment\x20ID\x20missing\x20from\x20resolved\x20path','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','3640722BYzrVq','Resolved\x20folder\x20ID:\x20','Resolved\x20type:\x20','7525539bYnOUO','parentId','segmentId','8zODtTM','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentPath','data','updateSegmentById','kind','2570728qVbTBQ','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20path\x20\x27','description','Update\x20existing\x20child\x20segment','segment','name','1049210pojYCk','1045654priDlM','\x20\x20\x20Path:\x20','segment:update'];a26_0x12e0=function(){return _0x3b95e5;};return a26_0x12e0();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x565d(_0x2569d7,_0x24ce53){const _0x12e07e=a26_0x12e0();return a26_0x565d=function(_0x565d8e,_0x4d9885){_0x565d8e=_0x565d8e-0xde;let _0x257402=_0x12e07e[_0x565d8e];return _0x257402;},a26_0x565d(_0x2569d7,_0x24ce53);}import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{[a26_0x1c4733(0xf7)]=a26_0x1c4733(0xfb);[a26_0x1c4733(0xf4)]=a26_0x1c4733(0xf5);async['execute'](_0x5cc718){const _0x403ded=a26_0x1c4733,{options:_0x4919a0,args:_0xc5f995,tdx:_0x32bf1f}=_0x5cc718,_0x42e320=_0x4919a0;if(_0xc5f995['length']===0x0)return console['error'](_0x403ded(0xf2)),console[_0x403ded(0x103)](_0x403ded(0xec)),console[_0x403ded(0x103)](_0x403ded(0xe1)),console['error'](_0x403ded(0xde)),console[_0x403ded(0x103)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1442bf=_0xc5f995[0x0],_0x5bf24f=_0x4919a0[_0x403ded(0xed)];let _0x37d24c=_0x1442bf;_0x5bf24f&&!_0x1442bf[_0x403ded(0x102)]('/')&&(_0x37d24c=_0x5bf24f+'/'+_0x1442bf,_0x42e320[_0x403ded(0x106)]&&console[_0x403ded(0x103)](_0x403ded(0xe0)+_0x37d24c));const _0x1b5ec8=await withSpinner(_0x403ded(0xf3)+_0x37d24c+'\x27...',()=>_0x32bf1f[_0x403ded(0xf6)][_0x403ded(0x104)](_0x37d24c),{'verbose':_0x42e320['verbose']}),_0x1a7f86=_0x1b5ec8[_0x403ded(0xee)];_0x42e320['verbose']&&console[_0x403ded(0x103)](_0x403ded(0xe7)+_0x1a7f86[_0x403ded(0xdf)]);if(_0x1a7f86[_0x403ded(0xdf)]!==_0x403ded(0xf6))return console[_0x403ded(0x103)](_0x403ded(0xfc)+_0x1a7f86[_0x403ded(0xdf)]+_0x403ded(0xe4)),console[_0x403ded(0x103)](_0x403ded(0xff)),0x1;if(!_0x1a7f86['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],_0x403ded(0xe3));const _0x43218a=_0x1a7f86[_0x403ded(0xe9)],_0x133215=_0x1a7f86[_0x403ded(0xea)];_0x42e320[_0x403ded(0x106)]&&(console['error']('Parent\x20ID:\x20'+_0x43218a),console[_0x403ded(0x103)]('Segment\x20ID:\x20'+_0x133215));let _0x377f0b;if(_0x42e320[_0x403ded(0x105)]){const _0xf68345=_0x42e320[_0x403ded(0x105)],_0x5b6b2b=await withSpinner('Resolving\x20folder\x20\x27'+_0xf68345+_0x403ded(0xfe),()=>_0x32bf1f[_0x403ded(0xf6)]['resolveFolderId'](_0x43218a,_0xf68345),{'verbose':_0x42e320[_0x403ded(0x106)]});_0x377f0b=parseInt(_0x5b6b2b[_0x403ded(0xee)],0xa),_0x42e320['verbose']&&console[_0x403ded(0x103)](_0x403ded(0xe6)+_0x377f0b);}const _0x1b8e42=await loadJSONFromOptions(_0x42e320[_0x403ded(0xe2)],_0x42e320['ruleFile']),_0x155287={'name':_0x42e320[_0x403ded(0xf7)],'description':_0x42e320[_0x403ded(0xf4)],'rule':_0x1b8e42,'kind':_0x42e320[_0x403ded(0xf0)]!==undefined?parseInt(_0x42e320[_0x403ded(0xf0)],0xa):undefined,'segmentFolderId':_0x377f0b},_0x4fdcc0=await withSpinner('Updating\x20segment\x20\x27'+_0x1a7f86['segmentName']+_0x403ded(0xfe),()=>_0x32bf1f[_0x403ded(0xf6)][_0x403ded(0xef)](_0x43218a,_0x133215,_0x155287),{'verbose':_0x42e320['verbose']}),_0x354034=_0x4fdcc0['data'];return console['error'](_0x403ded(0x100)+_0x354034[_0x403ded(0xf7)]+'\x27'),_0x37d24c!==_0x1442bf&&console['error'](_0x403ded(0xfa)+_0x37d24c),await handleSDKOutput([_0x354034],_0x42e320),0x0;}}
@@ -1 +1 @@
1
- const a27_0x11164a=a27_0x1258;function a27_0x1258(_0x3a67e2,_0x36bb2a){const _0x40c9b8=a27_0x40c9();return a27_0x1258=function(_0x125855,_0x5b77a9){_0x125855=_0x125855-0xba;let _0x30044c=_0x40c9b8[_0x125855];return _0x30044c;},a27_0x1258(_0x3a67e2,_0x36bb2a);}function a27_0x40c9(){const _0x38d5d5=['Context\x20cleared.\x20Back\x20to\x20root.','resolvePathToResource','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','segment','segmentPath','execute','Site:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','join','Parent\x20ID:\x20','Examples:','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','length','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','315845dfvnRa','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','329418mQJFbW','site','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','3771901KYplxa','slice','data','823616PTzfdh','description','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','parentName','14FRRZLj','log','folderId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','verbose','Use:\x20tdx\x20segment\x20use\x20','segments','fullPath','parentId','type','Resolved\x20path\x20type:\x20','Resolving\x20path\x20\x27','session','Target\x20path:\x20','72gnzjvd','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','folderPath','26244252ymDVyH','name','Resolved\x20relative\x20path\x20to:\x20','949324YYtNFz','error','7542736VXjbGd'];a27_0x40c9=function(){return _0x38d5d5;};return a27_0x40c9();}(function(_0x3faf78,_0x26443d){const _0x37df89=a27_0x1258,_0x451c2d=_0x3faf78();while(!![]){try{const _0x1eb383=-parseInt(_0x37df89(0xd2))/0x1+-parseInt(_0x37df89(0xbe))/0x2*(parseInt(_0x37df89(0xe6))/0x3)+parseInt(_0x37df89(0xba))/0x4+-parseInt(_0x37df89(0xe4))/0x5*(-parseInt(_0x37df89(0xcc))/0x6)+-parseInt(_0x37df89(0xea))/0x7+-parseInt(_0x37df89(0xd4))/0x8+parseInt(_0x37df89(0xcf))/0x9;if(_0x1eb383===_0x26443d)break;else _0x451c2d['push'](_0x451c2d['shift']());}catch(_0x40221a){_0x451c2d['push'](_0x451c2d['shift']());}}}(a27_0x40c9,0xa6175));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{[a27_0x11164a(0xd0)]='segment:use';[a27_0x11164a(0xbb)]=a27_0x11164a(0xe8);async[a27_0x11164a(0xdb)](_0x4932ad){const _0x5ceb23=a27_0x11164a,{options:_0x49b034,args:_0x1e5cee,tdx:_0x4ffeb6}=_0x4932ad;if(_0x1e5cee[_0x5ceb23(0xe2)]===0x0)return console['error']('Error:\x20Path\x20is\x20required'),console[_0x5ceb23(0xd3)](_0x5ceb23(0xdd)),console['error'](_0x5ceb23(0xe0)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xc1)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xe5)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xe9)),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 _0x5a520d=_0x1e5cee[0x0],_0x22090f=_0x49b034[_0x5ceb23(0xca)];try{if(_0x5a520d==='/')return saveSessionContext({'segment_path':undefined},_0x22090f),console['log'](_0x5ceb23(0xd5)),0x0;const _0x5226de=_0x49b034[_0x5ceb23(0xda)];let _0x4705ae=_0x5a520d;const _0x3e4d42=parsePath(_0x5a520d);if(!_0x3e4d42['isAbsolute']){if(!_0x5226de)return console[_0x5ceb23(0xd3)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console[_0x5ceb23(0xd3)](_0x5ceb23(0xcd)),0x1;if(_0x5a520d==='..'){const _0x5d4d0a=_0x5226de['split']('/')[_0x5ceb23(0xeb)](0x0,-0x1)[_0x5ceb23(0xde)]('/');_0x4705ae=_0x5d4d0a||'/';}else _0x5a520d==='.'?_0x4705ae=_0x5226de:_0x4705ae=_0x5226de+'/'+_0x5a520d;_0x49b034[_0x5ceb23(0xc2)]&&console[_0x5ceb23(0xd3)](_0x5ceb23(0xd1)+_0x4705ae);}if(_0x4705ae==='/'||_0x4705ae==='')return saveSessionContext({'segment_path':undefined},_0x22090f),console[_0x5ceb23(0xbf)](_0x5ceb23(0xd5)),0x0;_0x4705ae=normalizePath(_0x4705ae);const _0x53b865=parsePath(_0x4705ae)[_0x5ceb23(0xc4)];if(_0x53b865[_0x5ceb23(0xe2)]===0x0)return saveSessionContext({'segment_path':undefined},_0x22090f),console['log']('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;_0x49b034['verbose']&&(console[_0x5ceb23(0xd3)](_0x5ceb23(0xdc)+_0x49b034[_0x5ceb23(0xe7)]),console[_0x5ceb23(0xd3)](_0x5ceb23(0xcb)+_0x4705ae));const _0x4d99f1=await withSpinner(_0x5ceb23(0xc9)+_0x4705ae+'\x27...',()=>_0x4ffeb6[_0x5ceb23(0xd9)][_0x5ceb23(0xd6)](_0x4705ae),{'verbose':_0x49b034[_0x5ceb23(0xc2)]}),_0x17ff94=_0x4d99f1[_0x5ceb23(0xec)];_0x49b034[_0x5ceb23(0xc2)]&&(console[_0x5ceb23(0xd3)](_0x5ceb23(0xc8)+_0x17ff94[_0x5ceb23(0xc7)]),console['error'](_0x5ceb23(0xdf)+_0x17ff94[_0x5ceb23(0xc6)]),_0x17ff94[_0x5ceb23(0xc0)]&&console[_0x5ceb23(0xd3)]('Folder\x20ID:\x20'+_0x17ff94['folderId']));if(_0x17ff94[_0x5ceb23(0xc7)]==='segment')return console[_0x5ceb23(0xd3)](_0x5ceb23(0xbc)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xe1)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xc3)+_0x17ff94['parentName']+(_0x17ff94['folderPath']?'/'+_0x17ff94[_0x5ceb23(0xce)]['join']('/'):'')),0x1;return saveSessionContext({'segment_path':_0x17ff94[_0x5ceb23(0xc5)],'parent_segment':_0x17ff94[_0x5ceb23(0xbd)]},_0x22090f),console[_0x5ceb23(0xbf)]('Context\x20set\x20to:\x20'+_0x17ff94[_0x5ceb23(0xc5)]),_0x49b034[_0x5ceb23(0xc2)]&&(console[_0x5ceb23(0xd3)](_0x5ceb23(0xd8)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xd7)),console[_0x5ceb23(0xd3)](_0x5ceb23(0xe3))),0x0;}catch(_0x278f8c){throw _0x278f8c;}}}
1
+ const a27_0x247628=a27_0x1c20;(function(_0x7bca58,_0x3bd679){const _0x18496f=a27_0x1c20,_0x200c63=_0x7bca58();while(!![]){try{const _0x5cd9f0=parseInt(_0x18496f(0x149))/0x1+-parseInt(_0x18496f(0x153))/0x2+-parseInt(_0x18496f(0x15d))/0x3+parseInt(_0x18496f(0x143))/0x4+parseInt(_0x18496f(0x148))/0x5*(-parseInt(_0x18496f(0x13e))/0x6)+-parseInt(_0x18496f(0x157))/0x7+parseInt(_0x18496f(0x14f))/0x8;if(_0x5cd9f0===_0x3bd679)break;else _0x200c63['push'](_0x200c63['shift']());}catch(_0x18a3d2){_0x200c63['push'](_0x200c63['shift']());}}}(a27_0x1f01,0x49651));function a27_0x1f01(){const _0x2c994f=['Parent\x20ID:\x20','\x27...','42UHKNhY','name','isAbsolute','folderPath','verbose','739124QBCFfJ','resolvePathToResource','Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Resolved\x20path\x20type:\x20','163675eeeOJr','239920kbYKSJ','Examples:','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Context\x20cleared.\x20Back\x20to\x20root.','split','folderId','11836688qhOUFD','Resolved\x20relative\x20path\x20to:\x20','Use:\x20tdx\x20segment\x20use\x20','Site:\x20','676706Siojgl','parentName','Error:\x20Path\x20is\x20required','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','3335892mVKBaf','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','log','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','session','1678824lLoSLk','site','segments','type','slice','fullPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','join','error','data','segmentPath','segment','length','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','description'];a27_0x1f01=function(){return _0x2c994f;};return a27_0x1f01();}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';function a27_0x1c20(_0x265817,_0x2ae963){const _0x1f0179=a27_0x1f01();return a27_0x1c20=function(_0x1c2054,_0x4e1e4b){_0x1c2054=_0x1c2054-0x137;let _0x29ab09=_0x1f0179[_0x1c2054];return _0x29ab09;},a27_0x1c20(_0x265817,_0x2ae963);}export class SegmentUseCommand extends BaseCommand{[a27_0x247628(0x13f)]='segment:use';[a27_0x247628(0x13b)]=a27_0x247628(0x163);async['execute'](_0x11d146){const _0x266926=a27_0x247628,{options:_0x192c7a,args:_0x55440b,tdx:_0xb5cad0}=_0x11d146;if(_0x55440b[_0x266926(0x139)]===0x0)return console[_0x266926(0x167)](_0x266926(0x155)),console[_0x266926(0x167)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x266926(0x167)](_0x266926(0x14a)),console[_0x266926(0x167)](_0x266926(0x15b)),console[_0x266926(0x167)](_0x266926(0x146)),console['error'](_0x266926(0x158)),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 _0x22b1fc=_0x55440b[0x0],_0x228d78=_0x192c7a[_0x266926(0x15c)];try{if(_0x22b1fc==='/')return saveSessionContext({'segment_path':undefined},_0x228d78),console['log'](_0x266926(0x14c)),0x0;const _0x571643=_0x192c7a[_0x266926(0x137)];let _0x119c2d=_0x22b1fc;const _0x3acf3c=parsePath(_0x22b1fc);if(!_0x3acf3c[_0x266926(0x140)]){if(!_0x571643)return console[_0x266926(0x167)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console['error'](_0x266926(0x156)),0x1;if(_0x22b1fc==='..'){const _0x3f2300=_0x571643[_0x266926(0x14d)]('/')[_0x266926(0x161)](0x0,-0x1)[_0x266926(0x166)]('/');_0x119c2d=_0x3f2300||'/';}else _0x22b1fc==='.'?_0x119c2d=_0x571643:_0x119c2d=_0x571643+'/'+_0x22b1fc;_0x192c7a[_0x266926(0x142)]&&console['error'](_0x266926(0x150)+_0x119c2d);}if(_0x119c2d==='/'||_0x119c2d==='')return saveSessionContext({'segment_path':undefined},_0x228d78),console[_0x266926(0x159)](_0x266926(0x14c)),0x0;_0x119c2d=normalizePath(_0x119c2d);const _0xeef7ee=parsePath(_0x119c2d)[_0x266926(0x15f)];if(_0xeef7ee[_0x266926(0x139)]===0x0)return saveSessionContext({'segment_path':undefined},_0x228d78),console[_0x266926(0x159)](_0x266926(0x14c)),0x0;_0x192c7a[_0x266926(0x142)]&&(console[_0x266926(0x167)](_0x266926(0x152)+_0x192c7a[_0x266926(0x15e)]),console[_0x266926(0x167)]('Target\x20path:\x20'+_0x119c2d));const _0x4979dc=await withSpinner(_0x266926(0x15a)+_0x119c2d+_0x266926(0x13d),()=>_0xb5cad0[_0x266926(0x138)][_0x266926(0x144)](_0x119c2d),{'verbose':_0x192c7a[_0x266926(0x142)]}),_0x36053e=_0x4979dc[_0x266926(0x168)];_0x192c7a[_0x266926(0x142)]&&(console[_0x266926(0x167)](_0x266926(0x147)+_0x36053e[_0x266926(0x160)]),console[_0x266926(0x167)](_0x266926(0x13c)+_0x36053e['parentId']),_0x36053e['folderId']&&console[_0x266926(0x167)]('Folder\x20ID:\x20'+_0x36053e[_0x266926(0x14e)]));if(_0x36053e[_0x266926(0x160)]===_0x266926(0x138))return console[_0x266926(0x167)](_0x266926(0x164)),console['error'](_0x266926(0x13a)),console[_0x266926(0x167)](_0x266926(0x151)+_0x36053e[_0x266926(0x154)]+(_0x36053e[_0x266926(0x141)]?'/'+_0x36053e[_0x266926(0x141)][_0x266926(0x166)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x36053e[_0x266926(0x162)],'parent_segment':_0x36053e[_0x266926(0x154)]},_0x228d78),console[_0x266926(0x159)](_0x266926(0x145)+_0x36053e['fullPath']),_0x192c7a['verbose']&&(console[_0x266926(0x167)](_0x266926(0x165)),console['error']('Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context'),console[_0x266926(0x167)](_0x266926(0x14b))),0x0;}catch(_0x2799aa){throw _0x2799aa;}}}
@@ -1 +1 @@
1
- const a28_0x34baa7=a28_0x2f66;(function(_0x1eab11,_0x5694af){const _0x4d3c33=a28_0x2f66,_0x473b8d=_0x1eab11();while(!![]){try{const _0x58e2b0=-parseInt(_0x4d3c33(0x21d))/0x1+-parseInt(_0x4d3c33(0x1f3))/0x2*(-parseInt(_0x4d3c33(0x20f))/0x3)+-parseInt(_0x4d3c33(0x223))/0x4+parseInt(_0x4d3c33(0x20b))/0x5*(-parseInt(_0x4d3c33(0x21f))/0x6)+-parseInt(_0x4d3c33(0x210))/0x7*(parseInt(_0x4d3c33(0x1e9))/0x8)+parseInt(_0x4d3c33(0x222))/0x9+parseInt(_0x4d3c33(0x209))/0xa;if(_0x58e2b0===_0x5694af)break;else _0x473b8d['push'](_0x473b8d['shift']());}catch(_0x1ea52f){_0x473b8d['push'](_0x473b8d['shift']());}}}(a28_0x4f7b,0xa4811));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a28_0x2f66(_0xe58cb1,_0x1a82b3){const _0x4f7b3e=a28_0x4f7b();return a28_0x2f66=function(_0x2f6676,_0xb75d8){_0x2f6676=_0x2f6676-0x1e5;let _0x130d4f=_0x4f7b3e[_0x2f6676];return _0x130d4f;},a28_0x2f66(_0xe58cb1,_0x1a82b3);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import{formatRows}from'../utils/formatters.js';import a28_0x2df25f from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x34baa7(0x202)]=a28_0x34baa7(0x1ff);['description']='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a28_0x34baa7(0x216)](_0x42f665){const _0x448f4b=a28_0x34baa7,{options:_0x3e93f5,args:_0x4389d3}=_0x42f665,_0x4d8630=_0x3e93f5[_0x448f4b(0x1ef)],_0x5c861e=_0x4389d3[0x0];try{const _0x5c9e56=_0x3e93f5['segmentPath'];_0x3e93f5[_0x448f4b(0x20c)]&&(console[_0x448f4b(0x208)]('Site:\x20'+_0x3e93f5[_0x448f4b(0x1ee)]),console[_0x448f4b(0x208)]('Current\x20context:\x20'+(_0x5c9e56||'/')),_0x5c861e&&console['error'](_0x448f4b(0x1ed)+_0x5c861e),_0x4d8630&&console[_0x448f4b(0x208)]('Recursive\x20mode:\x20enabled'));if(_0x5c861e){const _0x5d1a16=_0x5c861e['includes']('*')||_0x5c861e['includes']('?');if(_0x5d1a16&&!_0x5c9e56)return await this[_0x448f4b(0x1fa)](_0x42f665,_0x5c861e);else return _0x5d1a16?(console[_0x448f4b(0x208)](_0x448f4b(0x214)),console[_0x448f4b(0x208)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x4d8630?await this[_0x448f4b(0x20d)](_0x42f665,_0x5c861e):await this['listUnified'](_0x42f665,_0x5c861e);}if(!_0x5c9e56)return await this[_0x448f4b(0x213)](_0x42f665);return _0x4d8630?await this['listRecursive'](_0x42f665,_0x5c9e56):await this[_0x448f4b(0x1e8)](_0x42f665,_0x5c9e56);}catch(_0x5375d9){if(_0x5375d9 instanceof SDKError)return console[_0x448f4b(0x208)](_0x448f4b(0x1f4)+_0x5375d9[_0x448f4b(0x1f0)]),_0x5375d9[_0x448f4b(0x1f6)]&&console['error'](_0x448f4b(0x217)+_0x5375d9[_0x448f4b(0x1f6)]),0x1;throw _0x5375d9;}}async[a28_0x34baa7(0x1fa)](_0x44839d,_0x20460c){const _0x14607a=a28_0x34baa7,{options:_0x2e06ef,tdx:_0x5dfec7}=_0x44839d,_0x1a0b19=await withSpinner(_0x14607a(0x1fb)+_0x20460c+'\x27...',()=>_0x5dfec7[_0x14607a(0x224)][_0x14607a(0x213)](),{'verbose':_0x2e06ef['verbose']}),_0x96f0b9=_0x1a0b19['data'],_0x4a2e02=_0x20460c[_0x14607a(0x201)](/[.+^${}()|[\]\\]/g,_0x14607a(0x21e))[_0x14607a(0x201)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1b9650=new RegExp('^'+_0x4a2e02+'$','i'),_0x169ef7=_0x96f0b9[_0x14607a(0x1e5)](_0x4c571f=>_0x1b9650[_0x14607a(0x1f1)](_0x4c571f[_0x14607a(0x1ea)]['name']));console[_0x14607a(0x208)]('✔\x20Found\x20'+_0x169ef7[_0x14607a(0x21b)]+'\x20parent\x20segment'+(_0x169ef7[_0x14607a(0x21b)]!==0x1?'s':'')+_0x14607a(0x20a)+_0x20460c+'\x27');if(_0x2e06ef[_0x14607a(0x211)]===_0x14607a(0x221)||_0x2e06ef[_0x14607a(0x211)]===_0x14607a(0x219))await handleSDKOutput(_0x169ef7,_0x2e06ef);else{if(_0x169ef7['length']===0x0)console[_0x14607a(0x1ec)](_0x14607a(0x1f2)+_0x20460c);else{console['log'](_0x14607a(0x21a));for(const _0x1272dd of _0x169ef7){const _0x37fd17=_0x1272dd[_0x14607a(0x1ea)][_0x14607a(0x1fc)]?a28_0x2df25f[_0x14607a(0x205)]('\x20('+formatRows(_0x1272dd[_0x14607a(0x1ea)][_0x14607a(0x1fc)])+')'):'';console[_0x14607a(0x1ec)]('👥\x20'+_0x1272dd[_0x14607a(0x1ea)][_0x14607a(0x202)]+_0x37fd17);}}}return 0x0;}async[a28_0x34baa7(0x213)](_0x55ce6e){const _0x5d4b46=a28_0x34baa7,{options:_0x1f75f8,tdx:_0x5b9d1e}=_0x55ce6e,_0x27768d=await withSpinner(_0x5d4b46(0x204),()=>_0x5b9d1e[_0x5d4b46(0x224)][_0x5d4b46(0x213)](),{'verbose':_0x1f75f8['verbose']}),_0x5ea374=_0x27768d['data'];console['error']('✔\x20Found\x20'+_0x5ea374[_0x5d4b46(0x21b)]+'\x20parent\x20segment'+(_0x5ea374[_0x5d4b46(0x21b)]!==0x1?'s':''));if(_0x1f75f8['format']===_0x5d4b46(0x221)||_0x1f75f8[_0x5d4b46(0x211)]==='jsonl')await handleSDKOutput(_0x5ea374,_0x1f75f8);else{console[_0x5d4b46(0x1ec)](_0x5d4b46(0x21a));for(const _0x3b7c83 of _0x5ea374){const _0x2e9ade=_0x3b7c83[_0x5d4b46(0x1ea)][_0x5d4b46(0x1fc)]?a28_0x2df25f[_0x5d4b46(0x205)]('\x20('+formatRows(_0x3b7c83[_0x5d4b46(0x1ea)][_0x5d4b46(0x1fc)])+')'):'';console['log'](_0x5d4b46(0x1f8)+_0x3b7c83['attributes'][_0x5d4b46(0x202)]+_0x2e9ade);}}return 0x0;}async['listUnified'](_0x1cc21d,_0x1120e9){const _0x18849d=a28_0x34baa7,{options:_0x438bf0,tdx:_0x283ee7}=_0x1cc21d,_0x301f07=await withSpinner(_0x18849d(0x218)+_0x1120e9+'\x27...',()=>_0x283ee7[_0x18849d(0x224)]['resolvePathToResource'](_0x1120e9),{'verbose':_0x438bf0[_0x18849d(0x20c)]}),_0x3c991c=_0x301f07[_0x18849d(0x1fe)];_0x438bf0[_0x18849d(0x20c)]&&(console[_0x18849d(0x208)](_0x18849d(0x1f9)+_0x3c991c[_0x18849d(0x200)]),_0x3c991c[_0x18849d(0x20e)]&&console[_0x18849d(0x208)](_0x18849d(0x207)+_0x3c991c[_0x18849d(0x20e)]));const _0x1e75d2=await withSpinner(_0x18849d(0x212),()=>_0x283ee7[_0x18849d(0x224)][_0x18849d(0x1e8)](_0x3c991c['parentId'],_0x3c991c[_0x18849d(0x20e)]),{'verbose':_0x438bf0['verbose']}),{folders:_0x36e239,segments:_0x586df0}=_0x1e75d2[_0x18849d(0x1fe)],_0x2ff133=_0x36e239[_0x18849d(0x21b)]+_0x586df0['length'];console[_0x18849d(0x208)](_0x18849d(0x206)+_0x36e239[_0x18849d(0x21b)]+'\x20folder'+(_0x36e239['length']!==0x1?'s':'')+'\x20and\x20'+_0x586df0[_0x18849d(0x21b)]+_0x18849d(0x220)+(_0x586df0['length']!==0x1?'s':''));if(_0x438bf0[_0x18849d(0x211)]===_0x18849d(0x221)||_0x438bf0[_0x18849d(0x211)]===_0x18849d(0x219)){const _0xabccc2=[..._0x36e239['map'](_0x2d07f3=>({..._0x2d07f3,'type':_0x18849d(0x203)})),..._0x586df0[_0x18849d(0x1e7)](_0x2d6517=>({..._0x2d6517,'type':_0x18849d(0x224)}))][_0x18849d(0x215)]((_0x586aeb,_0x3c79f1)=>_0x586aeb[_0x18849d(0x202)][_0x18849d(0x1e6)](_0x3c79f1[_0x18849d(0x202)]));await handleSDKOutput(_0xabccc2,_0x438bf0);}else{if(_0x2ff133===0x0)console[_0x18849d(0x1ec)](a28_0x2df25f[_0x18849d(0x205)]('[/'+_0x1120e9+']')),console[_0x18849d(0x1ec)](_0x18849d(0x21c));else{console[_0x18849d(0x1ec)](a28_0x2df25f[_0x18849d(0x205)]('[/'+_0x1120e9+']'));const _0xd3286a=formatFlatList(_0x36e239,_0x586df0,{'showMetadata':!![]});console[_0x18849d(0x1ec)](_0xd3286a);}}return 0x0;}async[a28_0x34baa7(0x20d)](_0x3e896f,_0x3fd5e6){const _0x5900e9=a28_0x34baa7,{options:_0x30f81e,tdx:_0x1c248a}=_0x3e896f,_0x4c4d54=await withSpinner('Resolving\x20context\x20path\x20\x27'+_0x3fd5e6+_0x5900e9(0x1eb),()=>_0x1c248a[_0x5900e9(0x224)]['resolvePathToResource'](_0x3fd5e6),{'verbose':_0x30f81e[_0x5900e9(0x20c)]}),_0xb6f80e=_0x4c4d54[_0x5900e9(0x1fe)];_0x30f81e['verbose']&&(console[_0x5900e9(0x208)](_0x5900e9(0x1f9)+_0xb6f80e[_0x5900e9(0x200)]),_0xb6f80e[_0x5900e9(0x20e)]&&console['error'](_0x5900e9(0x207)+_0xb6f80e[_0x5900e9(0x20e)]));const _0x58eb8c=_0x30f81e[_0x5900e9(0x1f5)]||0xa,_0x2395d1=await withSpinner(_0x5900e9(0x1fd),()=>_0x1c248a[_0x5900e9(0x224)]['listRecursive'](_0xb6f80e['parentId'],_0xb6f80e['folderId'],0x0,_0x58eb8c),{'verbose':_0x30f81e['verbose']}),_0x5456ff=_0x2395d1['data'];console[_0x5900e9(0x208)]('✔\x20Built\x20tree\x20with\x20'+_0x5456ff[_0x5900e9(0x21b)]+_0x5900e9(0x1f7));if(_0x30f81e['format']===_0x5900e9(0x221)||_0x30f81e[_0x5900e9(0x211)]===_0x5900e9(0x219))await handleSDKOutput(_0x5456ff,_0x30f81e);else{console[_0x5900e9(0x1ec)](a28_0x2df25f['dim']('[/'+_0x3fd5e6+']'));const _0x21e9f8=formatTree(_0x5456ff,{'showMetadata':!![]});console[_0x5900e9(0x1ec)](_0x21e9f8);}return 0x0;}}function a28_0x4f7b(){const _0x414a2b=['json','1033128TvGSWU','196964vFfxoU','segment','filter','localeCompare','map','listUnified','1827792NDTmMP','attributes','\x27...','log','Path/pattern\x20arg:\x20','site','recursive','message','test','No\x20parent\x20segments\x20match\x20pattern:\x20','2FhmmDq','Error:\x20','maxDepth','cause','\x20top-level\x20items','👥\x20','Parent\x20ID:\x20','listParentsWithPattern','Listing\x20parent\x20segments\x20matching\x20\x27','population','Building\x20hierarchy\x20tree...','data','segments','parentId','replace','name','folder','Listing\x20parent\x20segments...','dim','✔\x20Found\x20','Folder\x20ID:\x20','error','16259330uxSGmS','\x20matching\x20\x27','1996525RauyxL','verbose','listRecursive','folderId','1510503NoZhfW','28ZMTIop','format','Listing\x20folders\x20and\x20segments...','listParents','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','sort','execute','\x20\x20Cause:\x20','Resolving\x20context\x20path\x20\x27','jsonl','[parent\x20segments]','length','(empty)','207975zQxrZM','\x5c$&','6gVOhdZ','\x20segment'];a28_0x4f7b=function(){return _0x414a2b;};return a28_0x4f7b();}
1
+ const a28_0x1dc4c6=a28_0x4c0f;(function(_0x205937,_0x1cd109){const _0x66c1c3=a28_0x4c0f,_0xe97810=_0x205937();while(!![]){try{const _0x3b6be0=parseInt(_0x66c1c3(0x103))/0x1+-parseInt(_0x66c1c3(0x119))/0x2*(parseInt(_0x66c1c3(0x10d))/0x3)+parseInt(_0x66c1c3(0x11b))/0x4*(-parseInt(_0x66c1c3(0x13a))/0x5)+parseInt(_0x66c1c3(0x128))/0x6+-parseInt(_0x66c1c3(0x126))/0x7+-parseInt(_0x66c1c3(0x116))/0x8+parseInt(_0x66c1c3(0x118))/0x9*(parseInt(_0x66c1c3(0x10f))/0xa);if(_0x3b6be0===_0x1cd109)break;else _0xe97810['push'](_0xe97810['shift']());}catch(_0xc0855b){_0xe97810['push'](_0xe97810['shift']());}}}(a28_0x3a4f,0x9aadf));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a28_0x4c0f(_0x26209d,_0x2d5b2a){const _0x3a4fed=a28_0x3a4f();return a28_0x4c0f=function(_0x4c0f34,_0x5d8a8b){_0x4c0f34=_0x4c0f34-0xfd;let _0x1dd75e=_0x3a4fed[_0x4c0f34];return _0x1dd75e;},a28_0x4c0f(_0x26209d,_0x2d5b2a);}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a28_0x3a4f(){const _0x266949=['2017036XjVjBS','execute','✔\x20Found\x20','No\x20parent\x20segments\x20match\x20pattern:\x20','Parent\x20ID:\x20','map','replace','resolvePathToResource','filter','length','site','348250bQUkCg','segment','138342NOeBCW','includes','description','\x20\x20Cause:\x20','(empty)','error','Listing\x20folders\x20and\x20segments...','listParentsWithPattern','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','cause','\x20folder','listRecursive','verbose','\x20segment','Resolving\x20context\x20path\x20\x27','Folder\x20ID:\x20','\x20parent\x20segment','localeCompare','5MWSJBh','Building\x20hierarchy\x20tree...','Path/pattern\x20arg:\x20','dim','segments','[parent\x20segments]','Site:\x20','format','491698WKThLB','Listing\x20parent\x20segments...','listUnified','\x20top-level\x20items','attributes','jsonl','parentId','listParents','Listing\x20parent\x20segments\x20matching\x20\x27','recursive','78YlKIOU','name','22178670ZzeCAO','folderId','json','👥\x20','\x5c$&','log','\x27...','8203072WUdpug','population','9uCresW','39974HgHYGG','data'];a28_0x3a4f=function(){return _0x266949;};return a28_0x3a4f();}import{formatRows}from'../utils/formatters.js';import a28_0x52f7c9 from'chalk';export class SegmentsCommand extends BaseCommand{[a28_0x1dc4c6(0x10e)]=a28_0x1dc4c6(0xff);[a28_0x1dc4c6(0x12a)]=a28_0x1dc4c6(0x130);async[a28_0x1dc4c6(0x11c)](_0x459eae){const _0x8489e7=a28_0x1dc4c6,{options:_0x565ab8,args:_0x288c21}=_0x459eae,_0x2c42b9=_0x565ab8[_0x8489e7(0x10c)],_0x228617=_0x288c21[0x0];try{const _0x4a0e23=_0x565ab8['segmentPath'];_0x565ab8['verbose']&&(console[_0x8489e7(0x12d)](_0x8489e7(0x101)+_0x565ab8[_0x8489e7(0x125)]),console[_0x8489e7(0x12d)]('Current\x20context:\x20'+(_0x4a0e23||'/')),_0x228617&&console[_0x8489e7(0x12d)](_0x8489e7(0xfd)+_0x228617),_0x2c42b9&&console['error']('Recursive\x20mode:\x20enabled'));if(_0x228617){const _0x275e15=_0x228617[_0x8489e7(0x129)]('*')||_0x228617[_0x8489e7(0x129)]('?');if(_0x275e15&&!_0x4a0e23)return await this[_0x8489e7(0x12f)](_0x459eae,_0x228617);else return _0x275e15?(console['error']('Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).'),console[_0x8489e7(0x12d)]('Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/'),0x1):_0x2c42b9?await this['listRecursive'](_0x459eae,_0x228617):await this[_0x8489e7(0x105)](_0x459eae,_0x228617);}if(!_0x4a0e23)return await this[_0x8489e7(0x10a)](_0x459eae);return _0x2c42b9?await this['listRecursive'](_0x459eae,_0x4a0e23):await this[_0x8489e7(0x105)](_0x459eae,_0x4a0e23);}catch(_0x3d4250){if(_0x3d4250 instanceof SDKError)return console[_0x8489e7(0x12d)]('Error:\x20'+_0x3d4250['message']),_0x3d4250[_0x8489e7(0x131)]&&console[_0x8489e7(0x12d)](_0x8489e7(0x12b)+_0x3d4250[_0x8489e7(0x131)]),0x1;throw _0x3d4250;}}async['listParentsWithPattern'](_0x20f16a,_0x56c077){const _0x15832a=a28_0x1dc4c6,{options:_0x2e17f3,tdx:_0x27b6ff}=_0x20f16a,_0x2345cb=await withSpinner(_0x15832a(0x10b)+_0x56c077+_0x15832a(0x115),()=>_0x27b6ff[_0x15832a(0x127)]['listParents'](),{'verbose':_0x2e17f3[_0x15832a(0x134)]}),_0x27a3a5=_0x2345cb['data'],_0x58fd33=_0x56c077[_0x15832a(0x121)](/[.+^${}()|[\]\\]/g,_0x15832a(0x113))[_0x15832a(0x121)](/\*/g,'.*')[_0x15832a(0x121)](/\?/g,'.'),_0x92ab0=new RegExp('^'+_0x58fd33+'$','i'),_0x47986a=_0x27a3a5[_0x15832a(0x123)](_0x4d84ff=>_0x92ab0['test'](_0x4d84ff[_0x15832a(0x107)][_0x15832a(0x10e)]));console[_0x15832a(0x12d)](_0x15832a(0x11d)+_0x47986a['length']+_0x15832a(0x138)+(_0x47986a[_0x15832a(0x124)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x56c077+'\x27');if(_0x2e17f3[_0x15832a(0x102)]===_0x15832a(0x111)||_0x2e17f3['format']===_0x15832a(0x108))await handleSDKOutput(_0x47986a,_0x2e17f3);else{if(_0x47986a[_0x15832a(0x124)]===0x0)console[_0x15832a(0x114)](_0x15832a(0x11e)+_0x56c077);else{console[_0x15832a(0x114)](_0x15832a(0x100));for(const _0x53ffdd of _0x47986a){const _0x21fb9f=_0x53ffdd[_0x15832a(0x107)][_0x15832a(0x117)]?a28_0x52f7c9[_0x15832a(0xfe)]('\x20('+formatRows(_0x53ffdd['attributes'][_0x15832a(0x117)])+')'):'';console[_0x15832a(0x114)](_0x15832a(0x112)+_0x53ffdd[_0x15832a(0x107)][_0x15832a(0x10e)]+_0x21fb9f);}}}return 0x0;}async[a28_0x1dc4c6(0x10a)](_0x1bcf57){const _0x3633ac=a28_0x1dc4c6,{options:_0x113726,tdx:_0x52d9f4}=_0x1bcf57,_0x482d02=await withSpinner(_0x3633ac(0x104),()=>_0x52d9f4[_0x3633ac(0x127)][_0x3633ac(0x10a)](),{'verbose':_0x113726[_0x3633ac(0x134)]}),_0x42b758=_0x482d02['data'];console[_0x3633ac(0x12d)](_0x3633ac(0x11d)+_0x42b758[_0x3633ac(0x124)]+_0x3633ac(0x138)+(_0x42b758[_0x3633ac(0x124)]!==0x1?'s':''));if(_0x113726[_0x3633ac(0x102)]===_0x3633ac(0x111)||_0x113726[_0x3633ac(0x102)]==='jsonl')await handleSDKOutput(_0x42b758,_0x113726);else{console[_0x3633ac(0x114)](_0x3633ac(0x100));for(const _0x121fd0 of _0x42b758){const _0x53fe33=_0x121fd0['attributes'][_0x3633ac(0x117)]?a28_0x52f7c9[_0x3633ac(0xfe)]('\x20('+formatRows(_0x121fd0[_0x3633ac(0x107)][_0x3633ac(0x117)])+')'):'';console[_0x3633ac(0x114)](_0x3633ac(0x112)+_0x121fd0[_0x3633ac(0x107)][_0x3633ac(0x10e)]+_0x53fe33);}}return 0x0;}async[a28_0x1dc4c6(0x105)](_0x2b9dac,_0x84e14b){const _0x485c65=a28_0x1dc4c6,{options:_0x3007ad,tdx:_0x50a694}=_0x2b9dac,_0x2a20a5=await withSpinner(_0x485c65(0x136)+_0x84e14b+_0x485c65(0x115),()=>_0x50a694[_0x485c65(0x127)][_0x485c65(0x122)](_0x84e14b),{'verbose':_0x3007ad[_0x485c65(0x134)]}),_0x27eebf=_0x2a20a5['data'];_0x3007ad['verbose']&&(console[_0x485c65(0x12d)](_0x485c65(0x11f)+_0x27eebf['parentId']),_0x27eebf['folderId']&&console['error'](_0x485c65(0x137)+_0x27eebf[_0x485c65(0x110)]));const _0x586625=await withSpinner(_0x485c65(0x12e),()=>_0x50a694[_0x485c65(0x127)][_0x485c65(0x105)](_0x27eebf['parentId'],_0x27eebf[_0x485c65(0x110)]),{'verbose':_0x3007ad[_0x485c65(0x134)]}),{folders:_0x57df89,segments:_0x34e46e}=_0x586625[_0x485c65(0x11a)],_0xea7ae8=_0x57df89[_0x485c65(0x124)]+_0x34e46e[_0x485c65(0x124)];console['error'](_0x485c65(0x11d)+_0x57df89['length']+_0x485c65(0x132)+(_0x57df89[_0x485c65(0x124)]!==0x1?'s':'')+'\x20and\x20'+_0x34e46e['length']+_0x485c65(0x135)+(_0x34e46e['length']!==0x1?'s':''));if(_0x3007ad[_0x485c65(0x102)]===_0x485c65(0x111)||_0x3007ad[_0x485c65(0x102)]===_0x485c65(0x108)){const _0x271ac3=[..._0x57df89[_0x485c65(0x120)](_0x53da88=>({..._0x53da88,'type':'folder'})),..._0x34e46e['map'](_0x1f857a=>({..._0x1f857a,'type':_0x485c65(0x127)}))]['sort']((_0x2c3d34,_0x34e0b5)=>_0x2c3d34[_0x485c65(0x10e)][_0x485c65(0x139)](_0x34e0b5['name']));await handleSDKOutput(_0x271ac3,_0x3007ad);}else{if(_0xea7ae8===0x0)console[_0x485c65(0x114)](a28_0x52f7c9[_0x485c65(0xfe)]('[/'+_0x84e14b+']')),console[_0x485c65(0x114)](_0x485c65(0x12c));else{console[_0x485c65(0x114)](a28_0x52f7c9[_0x485c65(0xfe)]('[/'+_0x84e14b+']'));const _0x5aeb22=formatFlatList(_0x57df89,_0x34e46e,{'showMetadata':!![]});console[_0x485c65(0x114)](_0x5aeb22);}}return 0x0;}async[a28_0x1dc4c6(0x133)](_0x1c8f96,_0x409872){const _0x585247=a28_0x1dc4c6,{options:_0x2d87be,tdx:_0x5acdbf}=_0x1c8f96,_0x14518a=await withSpinner(_0x585247(0x136)+_0x409872+_0x585247(0x115),()=>_0x5acdbf[_0x585247(0x127)][_0x585247(0x122)](_0x409872),{'verbose':_0x2d87be[_0x585247(0x134)]}),_0x2be6b3=_0x14518a[_0x585247(0x11a)];_0x2d87be['verbose']&&(console['error'](_0x585247(0x11f)+_0x2be6b3[_0x585247(0x109)]),_0x2be6b3[_0x585247(0x110)]&&console[_0x585247(0x12d)]('Folder\x20ID:\x20'+_0x2be6b3[_0x585247(0x110)]));const _0x56fe4f=_0x2d87be['maxDepth']||0xa,_0x1348d6=await withSpinner(_0x585247(0x13b),()=>_0x5acdbf[_0x585247(0x127)][_0x585247(0x133)](_0x2be6b3[_0x585247(0x109)],_0x2be6b3[_0x585247(0x110)],0x0,_0x56fe4f),{'verbose':_0x2d87be[_0x585247(0x134)]}),_0x1800a3=_0x1348d6[_0x585247(0x11a)];console[_0x585247(0x12d)]('✔\x20Built\x20tree\x20with\x20'+_0x1800a3[_0x585247(0x124)]+_0x585247(0x106));if(_0x2d87be[_0x585247(0x102)]===_0x585247(0x111)||_0x2d87be[_0x585247(0x102)]===_0x585247(0x108))await handleSDKOutput(_0x1800a3,_0x2d87be);else{console['log'](a28_0x52f7c9[_0x585247(0xfe)]('[/'+_0x409872+']'));const _0x41551c=formatTree(_0x1800a3,{'showMetadata':!![]});console[_0x585247(0x114)](_0x41551c);}return 0x0;}}
@@ -1 +1 @@
1
- const a29_0x461745=a29_0x14f2;function a29_0x4cf8(){const _0x5868a0=['Database:\x20','verbose','Table:\x20','args','\x20\x20Cause:\x20','743788VirWwJ','Limit:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','database','length','table','data','\x20row','2438530wBHMrg','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','1521xiXsrb','843270kbQzOd','1848300tJDkbE','272964DjXaGF','Show\x20table\x20contents','message','Querying\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','cause','show','showTable','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','validate','\x20from\x20','name','error','limit','Site:\x20','23224ORwiSU','Usage:\x20tdx\x20show\x20<database.table>','execute','68968lVuGOl','Error:\x20','21AltEYW','site'];a29_0x4cf8=function(){return _0x5868a0;};return a29_0x4cf8();}(function(_0xc44888,_0x25c752){const _0x1eff81=a29_0x14f2,_0x5e82e7=_0xc44888();while(!![]){try{const _0xa718aa=parseInt(_0x1eff81(0x1b1))/0x1+parseInt(_0x1eff81(0x1ba))/0x2+-parseInt(_0x1eff81(0x1c7))/0x3+parseInt(_0x1eff81(0x1c6))/0x4+-parseInt(_0x1eff81(0x1c2))/0x5+parseInt(_0x1eff81(0x1c5))/0x6*(parseInt(_0x1eff81(0x1b3))/0x7)+parseInt(_0x1eff81(0x1ae))/0x8*(-parseInt(_0x1eff81(0x1c4))/0x9);if(_0xa718aa===_0x25c752)break;else _0x5e82e7['push'](_0x5e82e7['shift']());}catch(_0x3367aa){_0x5e82e7['push'](_0x5e82e7['shift']());}}}(a29_0x4cf8,0x3e527));import{BaseCommand}from'./command.js';function a29_0x14f2(_0x509498,_0x3439b4){const _0x4cf884=a29_0x4cf8();return a29_0x14f2=function(_0x14f26c,_0x3023cf){_0x14f26c=_0x14f26c-0x1a6;let _0x457882=_0x4cf884[_0x14f26c];return _0x457882;},a29_0x14f2(_0x509498,_0x3439b4);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x461745(0x1aa)]=a29_0x461745(0x1cd);['description']=a29_0x461745(0x1c8);async[a29_0x461745(0x1b0)](_0x2729bf){const _0x51ac5a=a29_0x461745;return this[_0x51ac5a(0x1a6)](_0x2729bf);}async['showTable'](_0x4eefe7){const _0x23382f=a29_0x461745,{options:_0x3a7ef6,args:_0x31f914,tdx:_0x2f861a}=_0x4eefe7;let _0x47172a;try{_0x47172a=parseTableReference(_0x31f914[0x0]);const _0xee5188=_0x3a7ef6['database'];!_0x47172a[_0x23382f(0x1bd)]&&_0xee5188&&(_0x47172a[_0x23382f(0x1bd)]=_0xee5188);const _0x4e5ea4=validateTableDescribeReference(_0x47172a);if(_0x4e5ea4)return console[_0x23382f(0x1ab)](_0x23382f(0x1b2)+_0x4e5ea4),console[_0x23382f(0x1ab)](_0x23382f(0x1af)),console[_0x23382f(0x1ab)](_0x23382f(0x1c3)),console[_0x23382f(0x1ab)](_0x23382f(0x1cb)),0x1;}catch(_0x1f5f10){return console[_0x23382f(0x1ab)](_0x23382f(0x1b2)+_0x1f5f10[_0x23382f(0x1c9)]),console[_0x23382f(0x1ab)](_0x23382f(0x1af)),console[_0x23382f(0x1ab)](_0x23382f(0x1c3)),console['error'](_0x23382f(0x1cb)),0x1;}const _0x1abd27=_0x47172a['catalog'],_0x53b250=_0x47172a[_0x23382f(0x1bd)],_0x520768=_0x47172a[_0x23382f(0x1bf)],_0x4a3259=_0x3a7ef6[_0x23382f(0x1ac)];try{_0x3a7ef6[_0x23382f(0x1b6)]&&(console[_0x23382f(0x1ab)](_0x23382f(0x1ad)+_0x3a7ef6[_0x23382f(0x1b4)]),_0x1abd27&&console[_0x23382f(0x1ab)]('Catalog:\x20'+_0x1abd27),console[_0x23382f(0x1ab)](_0x23382f(0x1b5)+_0x53b250),console['error'](_0x23382f(0x1b7)+_0x520768),console[_0x23382f(0x1ab)](_0x23382f(0x1bb)+_0x4a3259));const _0x25dde7=_0x1abd27?_0x1abd27+'.'+_0x53b250+'.'+_0x520768:_0x53b250+'.'+_0x520768,_0x737159=await withSpinner(_0x23382f(0x1ca)+_0x25dde7+'...',()=>_0x2f861a[_0x23382f(0x1bf)][_0x23382f(0x1cd)](_0x53b250,_0x520768,_0x4a3259,_0x1abd27),{'verbose':_0x3a7ef6[_0x23382f(0x1b6)]}),_0x9d8686=_0x737159[_0x23382f(0x1c0)],_0x41cece=_0x9d8686['data'];return _0x41cece[_0x23382f(0x1be)]===0x0?console[_0x23382f(0x1ab)](_0x23382f(0x1bc)):console['error']('✔\x20Retrieved\x20'+_0x41cece[_0x23382f(0x1be)]+_0x23382f(0x1c1)+(_0x41cece[_0x23382f(0x1be)]!==0x1?'s':'')+_0x23382f(0x1a9)+_0x25dde7),await handleSDKOutput(_0x41cece,_0x3a7ef6),0x0;}catch(_0x110f5f){if(_0x110f5f instanceof SDKError)return console[_0x23382f(0x1ab)](_0x23382f(0x1b2)+_0x110f5f[_0x23382f(0x1c9)]),_0x110f5f['cause']&&console[_0x23382f(0x1ab)](_0x23382f(0x1b9)+_0x110f5f[_0x23382f(0x1cc)]),0x1;throw _0x110f5f;}}[a29_0x461745(0x1a8)](_0x30ec61){const _0x23e8ab=a29_0x461745;if(_0x30ec61['args'][_0x23e8ab(0x1be)]===0x0)return _0x23e8ab(0x1a7);if(_0x30ec61[_0x23e8ab(0x1b8)][_0x23e8ab(0x1be)]>0x1)return'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';return undefined;}}
1
+ const a29_0x4162b1=a29_0x114f;function a29_0x114f(_0x25f2d1,_0x51e5e3){const _0x52a07a=a29_0x52a0();return a29_0x114f=function(_0x114f04,_0x1dfe2d){_0x114f04=_0x114f04-0xc3;let _0x30d1f3=_0x52a07a[_0x114f04];return _0x30d1f3;},a29_0x114f(_0x25f2d1,_0x51e5e3);}(function(_0x399f35,_0x38e9d9){const _0x5970eb=a29_0x114f,_0x10ebb9=_0x399f35();while(!![]){try{const _0x36a104=-parseInt(_0x5970eb(0xc8))/0x1*(-parseInt(_0x5970eb(0xc6))/0x2)+-parseInt(_0x5970eb(0xc9))/0x3*(-parseInt(_0x5970eb(0xcd))/0x4)+parseInt(_0x5970eb(0xe3))/0x5*(parseInt(_0x5970eb(0xe2))/0x6)+-parseInt(_0x5970eb(0xc4))/0x7*(parseInt(_0x5970eb(0xdd))/0x8)+-parseInt(_0x5970eb(0xcb))/0x9*(parseInt(_0x5970eb(0xde))/0xa)+-parseInt(_0x5970eb(0xe5))/0xb+parseInt(_0x5970eb(0xec))/0xc;if(_0x36a104===_0x38e9d9)break;else _0x10ebb9['push'](_0x10ebb9['shift']());}catch(_0x38c13b){_0x10ebb9['push'](_0x10ebb9['shift']());}}}(a29_0x52a0,0xabdc3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a29_0x52a0(){const _0x2000d6=['\x20row','verbose','Show\x20table\x20contents','Error:\x20','site','error','message','cause','2325936fhWtqv','489950MKIpXj','✔\x20Retrieved\x20','database','showTable','30yGztca','618675DWgMDx','description','7820351OcOlaZ','table','...','Site:\x20','Catalog:\x20','show','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','7919100gmDilL','args','14aKLSBg','length','30ETAfCT','catalog','79791TNyjiy','473502wEHCNA','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','117UWTOkq','Usage:\x20tdx\x20show\x20<database.table>','4HQNhZr','validate','name','Table:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20from\x20','data','execute'];a29_0x52a0=function(){return _0x2000d6;};return a29_0x52a0();}import{withSpinner}from'../utils/spinner.js';export class ShowCommand extends BaseCommand{[a29_0x4162b1(0xcf)]=a29_0x4162b1(0xea);[a29_0x4162b1(0xe4)]=a29_0x4162b1(0xd7);async[a29_0x4162b1(0xd4)](_0x32e594){const _0x4afef4=a29_0x4162b1;return this[_0x4afef4(0xe1)](_0x32e594);}async[a29_0x4162b1(0xe1)](_0x2535d7){const _0x47b16f=a29_0x4162b1,{options:_0x57b520,args:_0x4e7444,tdx:_0x292c75}=_0x2535d7;let _0x383d53;try{_0x383d53=parseTableReference(_0x4e7444[0x0]);const _0x450373=_0x57b520[_0x47b16f(0xe0)];!_0x383d53[_0x47b16f(0xe0)]&&_0x450373&&(_0x383d53[_0x47b16f(0xe0)]=_0x450373);const _0x1ba9c7=validateTableDescribeReference(_0x383d53);if(_0x1ba9c7)return console[_0x47b16f(0xda)]('Error:\x20'+_0x1ba9c7),console[_0x47b16f(0xda)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x47b16f(0xda)](_0x47b16f(0xd1)),console[_0x47b16f(0xda)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0xea9fbf){return console[_0x47b16f(0xda)](_0x47b16f(0xd8)+_0xea9fbf[_0x47b16f(0xdb)]),console[_0x47b16f(0xda)](_0x47b16f(0xcc)),console[_0x47b16f(0xda)](_0x47b16f(0xd1)),console[_0x47b16f(0xda)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x471d7b=_0x383d53[_0x47b16f(0xc7)],_0x105906=_0x383d53[_0x47b16f(0xe0)],_0x3c2dbe=_0x383d53[_0x47b16f(0xe6)],_0x54e283=_0x57b520['limit'];try{_0x57b520[_0x47b16f(0xd6)]&&(console[_0x47b16f(0xda)](_0x47b16f(0xe8)+_0x57b520[_0x47b16f(0xd9)]),_0x471d7b&&console[_0x47b16f(0xda)](_0x47b16f(0xe9)+_0x471d7b),console[_0x47b16f(0xda)]('Database:\x20'+_0x105906),console[_0x47b16f(0xda)](_0x47b16f(0xd0)+_0x3c2dbe),console[_0x47b16f(0xda)]('Limit:\x20'+_0x54e283));const _0x5ce6fe=_0x471d7b?_0x471d7b+'.'+_0x105906+'.'+_0x3c2dbe:_0x105906+'.'+_0x3c2dbe,_0x4fb5b0=await withSpinner('Querying\x20'+_0x5ce6fe+_0x47b16f(0xe7),()=>_0x292c75[_0x47b16f(0xe6)][_0x47b16f(0xea)](_0x105906,_0x3c2dbe,_0x54e283,_0x471d7b),{'verbose':_0x57b520['verbose']}),_0xa172e1=_0x4fb5b0[_0x47b16f(0xd3)],_0x51808f=_0xa172e1[_0x47b16f(0xd3)];return _0x51808f[_0x47b16f(0xc5)]===0x0?console[_0x47b16f(0xda)](_0x47b16f(0xca)):console[_0x47b16f(0xda)](_0x47b16f(0xdf)+_0x51808f[_0x47b16f(0xc5)]+_0x47b16f(0xd5)+(_0x51808f[_0x47b16f(0xc5)]!==0x1?'s':'')+_0x47b16f(0xd2)+_0x5ce6fe),await handleSDKOutput(_0x51808f,_0x57b520),0x0;}catch(_0x26a6d0){if(_0x26a6d0 instanceof SDKError)return console[_0x47b16f(0xda)]('Error:\x20'+_0x26a6d0['message']),_0x26a6d0[_0x47b16f(0xdc)]&&console[_0x47b16f(0xda)]('\x20\x20Cause:\x20'+_0x26a6d0[_0x47b16f(0xdc)]),0x1;throw _0x26a6d0;}}[a29_0x4162b1(0xce)](_0xd331c7){const _0x572f82=a29_0x4162b1;if(_0xd331c7[_0x572f82(0xc3)][_0x572f82(0xc5)]===0x0)return _0x572f82(0xeb);if(_0xd331c7[_0x572f82(0xc3)][_0x572f82(0xc5)]>0x1)return'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';return undefined;}}
@@ -1 +1 @@
1
- function a30_0x4004(){const _0x26827f=['validate','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Error:\x20','.*\x22','cause','list','Database\x20pattern:\x20','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','Database:\x20','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','verbose','300IAbnyF','length','\x20table','site','277096OQAWIO','description','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','473886WeKePZ','357302BGNhtr','error','Note:\x20\x27','27ehDIpC','execute','table','\x27\x20across\x20all\x20databases.','includes','name','1250136mZefHL','450366Cmjbrp','✖\x20No\x20tables\x20found','Listing\x20tables...','tables','3308207poTwum','55adFhob','18296qpxvwt','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','database','message','219OREUTS','✔\x20Found\x20','Table\x20pattern:\x20','data'];a30_0x4004=function(){return _0x26827f;};return a30_0x4004();}const a30_0x132627=a30_0x5284;function a30_0x5284(_0x4eb0fa,_0x146682){const _0x4004da=a30_0x4004();return a30_0x5284=function(_0x5284b0,_0x138ad7){_0x5284b0=_0x5284b0-0xcc;let _0x2e9a17=_0x4004da[_0x5284b0];return _0x2e9a17;},a30_0x5284(_0x4eb0fa,_0x146682);}(function(_0x34bc5d,_0x10ab6b){const _0x33eda3=a30_0x5284,_0x27d77b=_0x34bc5d();while(!![]){try{const _0x30f8fd=parseInt(_0x33eda3(0xd5))/0x1+-parseInt(_0x33eda3(0xe3))/0x2+parseInt(_0x33eda3(0xee))/0x3*(-parseInt(_0x33eda3(0xe9))/0x4)+parseInt(_0x33eda3(0xe8))/0x5*(parseInt(_0x33eda3(0xd8))/0x6)+parseInt(_0x33eda3(0xe7))/0x7+parseInt(_0x33eda3(0xe2))/0x8*(parseInt(_0x33eda3(0xdc))/0x9)+-parseInt(_0x33eda3(0xd1))/0xa*(parseInt(_0x33eda3(0xd9))/0xb);if(_0x30f8fd===_0x10ab6b)break;else _0x27d77b['push'](_0x27d77b['shift']());}catch(_0x2cca15){_0x27d77b['push'](_0x27d77b['shift']());}}}(a30_0x4004,0x87310));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{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a30_0x132627(0xe1)]=a30_0x132627(0xe6);[a30_0x132627(0xd6)]='List\x20tables\x20in\x20a\x20database';async[a30_0x132627(0xdd)](_0x1572f4){const _0x1f80ae=a30_0x132627,{options:_0x32e0c6,args:_0x51d474,tdx:_0x52b47e}=_0x1572f4;let _0x1e65b8;if(_0x51d474[_0x1f80ae(0xd2)]===0x0)_0x1e65b8={'database':undefined,'table':undefined,'original':''};else{if(_0x51d474[_0x1f80ae(0xd2)]===0x1)try{_0x1e65b8=parseTableReference(_0x51d474[0x0]);if(_0x1e65b8['table']&&!_0x1e65b8[_0x1f80ae(0xec)]&&!_0x1e65b8[_0x1f80ae(0xde)]['includes']('*')&&!_0x1e65b8[_0x1f80ae(0xde)]['includes']('?'))return console[_0x1f80ae(0xda)]('Error:\x20Pattern\x20\x27'+_0x51d474[0x0]+'\x27\x20is\x20ambiguous.'),console['error'](_0x1f80ae(0xd7)+_0x1e65b8[_0x1f80ae(0xde)]+'\x27?'),console['error'](_0x1f80ae(0xce)+_0x1e65b8[_0x1f80ae(0xde)]+_0x1f80ae(0xf5)),console[_0x1f80ae(0xda)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x1e65b8[_0x1f80ae(0xde)]),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x1e65b8[_0x1f80ae(0xde)]),console[_0x1f80ae(0xda)](''),console[_0x1f80ae(0xda)](_0x1f80ae(0xdb)+_0x51d474[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x1e65b8[_0x1f80ae(0xde)]+_0x1f80ae(0xdf)),0x1;}catch(_0xcfc31a){return console[_0x1f80ae(0xda)](_0x1f80ae(0xf4)+_0xcfc31a[_0x1f80ae(0xed)]),0x1;}else return console[_0x1f80ae(0xda)](_0x1f80ae(0xeb)),console[_0x1f80ae(0xda)](_0x1f80ae(0xea)),console['error'](_0x1f80ae(0xcd)),console[_0x1f80ae(0xda)](_0x1f80ae(0xcf)),console[_0x1f80ae(0xda)](_0x1f80ae(0xf3)),console[_0x1f80ae(0xda)]('Or\x20use\x20--in\x20flag:'),console[_0x1f80ae(0xda)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0xfa84df=_0x32e0c6[_0x1f80ae(0xec)];!_0x1e65b8[_0x1f80ae(0xec)]&&_0xfa84df&&(_0x1e65b8[_0x1f80ae(0xec)]=_0xfa84df);try{const _0x5f1bac=_0x6313dc=>_0x6313dc&&(_0x6313dc[_0x1f80ae(0xe0)]('*')||_0x6313dc[_0x1f80ae(0xe0)]('?')),_0x520e75=_0x5f1bac(_0x1e65b8['database']);_0x32e0c6[_0x1f80ae(0xd0)]&&(console[_0x1f80ae(0xda)]('Site:\x20'+_0x32e0c6[_0x1f80ae(0xd4)]),_0x1e65b8[_0x1f80ae(0xec)]?_0x520e75?console[_0x1f80ae(0xda)](_0x1f80ae(0xf8)+_0x1e65b8[_0x1f80ae(0xec)]):console[_0x1f80ae(0xda)](_0x1f80ae(0xcc)+_0x1e65b8[_0x1f80ae(0xec)]):console[_0x1f80ae(0xda)]('Database:\x20all'),_0x1e65b8[_0x1f80ae(0xde)]&&console[_0x1f80ae(0xda)](_0x1f80ae(0xf0)+_0x1e65b8['table']));const _0x283565=_0x1e65b8[_0x1f80ae(0xec)]&&!_0x520e75?_0x1e65b8[_0x1f80ae(0xec)]:undefined,_0x52cfc1=_0x520e75?_0x1e65b8[_0x1f80ae(0xec)]:undefined,_0x3452bb=_0x1e65b8['table'],_0xd0945c=await withSpinner(_0x1f80ae(0xe5),()=>_0x52b47e['table'][_0x1f80ae(0xf7)](_0x283565,_0x3452bb,_0x52cfc1),{'verbose':_0x32e0c6[_0x1f80ae(0xd0)]}),_0x161c23=_0xd0945c[_0x1f80ae(0xf1)];if(_0x161c23['length']===0x0&&_0x1e65b8[_0x1f80ae(0xec)]&&!_0x520e75)return console[_0x1f80ae(0xda)](_0x1f80ae(0xe4)),console['error']('Database\x20\x27'+_0x1e65b8[_0x1f80ae(0xec)]+_0x1f80ae(0xf9)),0x1;return console[_0x1f80ae(0xda)](_0x1f80ae(0xef)+_0x161c23[_0x1f80ae(0xd2)]+_0x1f80ae(0xd3)+(_0x161c23['length']!==0x1?'s':'')),await handleSDKOutput(_0x161c23,_0x32e0c6),0x0;}catch(_0x271898){if(_0x271898 instanceof SDKError)return console['error']('Error:\x20'+_0x271898[_0x1f80ae(0xed)]),_0x271898['cause']&&console['error']('\x20\x20Cause:\x20'+_0x271898[_0x1f80ae(0xf6)]),0x1;throw _0x271898;}}[a30_0x132627(0xf2)](_0x13c38a){return undefined;}}
1
+ const a30_0x28aa27=a30_0x37ab;(function(_0x177102,_0x8c15d1){const _0x239dbb=a30_0x37ab,_0x1da8e1=_0x177102();while(!![]){try{const _0x3ad1d1=-parseInt(_0x239dbb(0x165))/0x1+-parseInt(_0x239dbb(0x15d))/0x2*(-parseInt(_0x239dbb(0x16c))/0x3)+parseInt(_0x239dbb(0x173))/0x4*(parseInt(_0x239dbb(0x174))/0x5)+-parseInt(_0x239dbb(0x163))/0x6+parseInt(_0x239dbb(0x162))/0x7*(parseInt(_0x239dbb(0x161))/0x8)+-parseInt(_0x239dbb(0x169))/0x9+parseInt(_0x239dbb(0x166))/0xa;if(_0x3ad1d1===_0x8c15d1)break;else _0x1da8e1['push'](_0x1da8e1['shift']());}catch(_0x45227a){_0x1da8e1['push'](_0x1da8e1['shift']());}}}(a30_0x70c7,0xd07ec));function a30_0x37ab(_0x3eb59b,_0x168a96){const _0x70c72a=a30_0x70c7();return a30_0x37ab=function(_0x37abcf,_0x254e5e){_0x37abcf=_0x37abcf-0x15d;let _0x4d6b2a=_0x70c72a[_0x37abcf];return _0x4d6b2a;},a30_0x37ab(_0x3eb59b,_0x168a96);}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{withSpinner}from'../utils/spinner.js';function a30_0x70c7(){const _0x134223=['✖\x20No\x20tables\x20found','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','✔\x20Found\x20','190XISpzi','\x20\x20Cause:\x20','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','tables','40QsHHEV','2180969GsXxwh','2043894wsXxfc','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','1386452xvsixQ','12053250TamZib','validate','\x20\x20Use:\x20tdx\x20tables\x20\x22','14261535tFfMeb','list','.*\x22','35835JWMSGp','\x27\x20across\x20all\x20databases.','table','\x20table','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','Database\x20\x27','error','12RqYLOb','446295OmKslc','Database\x20pattern:\x20','Error:\x20','execute','message','database','length','site','Error:\x20Pattern\x20\x27','name','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Or\x20use\x20--in\x20flag:','verbose','includes','description','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'];a30_0x70c7=function(){return _0x134223;};return a30_0x70c7();}export class TablesCommand extends BaseCommand{[a30_0x28aa27(0x17d)]=a30_0x28aa27(0x160);[a30_0x28aa27(0x182)]='List\x20tables\x20in\x20a\x20database';async[a30_0x28aa27(0x177)](_0xdc8b09){const _0x1818d3=a30_0x28aa27,{options:_0x1f9fd3,args:_0x28c8c1,tdx:_0x29dca4}=_0xdc8b09;let _0x23bd49;if(_0x28c8c1[_0x1818d3(0x17a)]===0x0)_0x23bd49={'database':undefined,'table':undefined,'original':''};else{if(_0x28c8c1['length']===0x1)try{_0x23bd49=parseTableReference(_0x28c8c1[0x0]);if(_0x23bd49[_0x1818d3(0x16e)]&&!_0x23bd49['database']&&!_0x23bd49[_0x1818d3(0x16e)][_0x1818d3(0x181)]('*')&&!_0x23bd49[_0x1818d3(0x16e)][_0x1818d3(0x181)]('?'))return console[_0x1818d3(0x172)](_0x1818d3(0x17c)+_0x28c8c1[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x1818d3(0x172)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x23bd49['table']+'\x27?'),console['error'](_0x1818d3(0x168)+_0x23bd49[_0x1818d3(0x16e)]+_0x1818d3(0x16b)),console[_0x1818d3(0x172)](_0x1818d3(0x184)+_0x23bd49[_0x1818d3(0x16e)]),console[_0x1818d3(0x172)](_0x1818d3(0x17e)+_0x23bd49['table']),console[_0x1818d3(0x172)](''),console[_0x1818d3(0x172)]('Note:\x20\x27'+_0x28c8c1[0x0]+_0x1818d3(0x186)+_0x23bd49[_0x1818d3(0x16e)]+_0x1818d3(0x16d)),0x1;}catch(_0xbd64e3){return console[_0x1818d3(0x172)]('Error:\x20'+_0xbd64e3[_0x1818d3(0x178)]),0x1;}else return console[_0x1818d3(0x172)](_0x1818d3(0x164)),console[_0x1818d3(0x172)](_0x1818d3(0x183)),console[_0x1818d3(0x172)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x1818d3(0x172)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x1818d3(0x15f)),console['error'](_0x1818d3(0x17f)),console[_0x1818d3(0x172)](_0x1818d3(0x170)),0x1;}const _0x18793c=_0x1f9fd3[_0x1818d3(0x179)];!_0x23bd49[_0x1818d3(0x179)]&&_0x18793c&&(_0x23bd49[_0x1818d3(0x179)]=_0x18793c);try{const _0x51aaba=_0x11156e=>_0x11156e&&(_0x11156e['includes']('*')||_0x11156e[_0x1818d3(0x181)]('?')),_0x926b5a=_0x51aaba(_0x23bd49['database']);_0x1f9fd3[_0x1818d3(0x180)]&&(console[_0x1818d3(0x172)]('Site:\x20'+_0x1f9fd3[_0x1818d3(0x17b)]),_0x23bd49[_0x1818d3(0x179)]?_0x926b5a?console[_0x1818d3(0x172)](_0x1818d3(0x175)+_0x23bd49[_0x1818d3(0x179)]):console[_0x1818d3(0x172)]('Database:\x20'+_0x23bd49[_0x1818d3(0x179)]):console['error']('Database:\x20all'),_0x23bd49['table']&&console[_0x1818d3(0x172)]('Table\x20pattern:\x20'+_0x23bd49[_0x1818d3(0x16e)]));const _0x476521=_0x23bd49[_0x1818d3(0x179)]&&!_0x926b5a?_0x23bd49[_0x1818d3(0x179)]:undefined,_0x482a09=_0x926b5a?_0x23bd49[_0x1818d3(0x179)]:undefined,_0x3e53eb=_0x23bd49[_0x1818d3(0x16e)],_0x175e1e=await withSpinner('Listing\x20tables...',()=>_0x29dca4['table'][_0x1818d3(0x16a)](_0x476521,_0x3e53eb,_0x482a09),{'verbose':_0x1f9fd3[_0x1818d3(0x180)]}),_0x4de6ab=_0x175e1e['data'];if(_0x4de6ab[_0x1818d3(0x17a)]===0x0&&_0x23bd49[_0x1818d3(0x179)]&&!_0x926b5a)return console[_0x1818d3(0x172)](_0x1818d3(0x185)),console[_0x1818d3(0x172)](_0x1818d3(0x171)+_0x23bd49[_0x1818d3(0x179)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console[_0x1818d3(0x172)](_0x1818d3(0x187)+_0x4de6ab[_0x1818d3(0x17a)]+_0x1818d3(0x16f)+(_0x4de6ab[_0x1818d3(0x17a)]!==0x1?'s':'')),await handleSDKOutput(_0x4de6ab,_0x1f9fd3),0x0;}catch(_0x3d85db){if(_0x3d85db instanceof SDKError)return console[_0x1818d3(0x172)](_0x1818d3(0x176)+_0x3d85db[_0x1818d3(0x178)]),_0x3d85db['cause']&&console['error'](_0x1818d3(0x15e)+_0x3d85db['cause']),0x1;throw _0x3d85db;}}[a30_0x28aa27(0x167)](_0x227976){return undefined;}}
@@ -1 +1 @@
1
- function a31_0x2044(_0x9b03a3,_0x17e313){const _0x213f63=a31_0x213f();return a31_0x2044=function(_0x20447f,_0x2123dd){_0x20447f=_0x20447f-0x172;let _0x306ad4=_0x213f63[_0x20447f];return _0x306ad4;},a31_0x2044(_0x9b03a3,_0x17e313);}const a31_0x1613dd=a31_0x2044;function a31_0x213f(){const _0x326654=['validate','join','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','execute','Session\x20database\x20set\x20to:\x20','5768yvWHoZ','9rcldlP','Invalid\x20resource:\x20','toString','1206340brihrx','5399530xRzKKG','Session\x20llm_project\x20set\x20to:\x20','699014XQRHAW','245pFwUUO','description','session','includes','llm_project','3sQhFzT','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','6109776fcYpjB','Error:\x20Profile\x20\x27','parent_segment','log','\x27\x20does\x20not\x20exist','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','use','error','Error:\x20','41556053gLPteL','2100744mvMgVD','profile','database','\x20(session:\x20','.\x20Must\x20be\x20one\x20of:\x20','length','name','28jIAIYH','Session\x20profile\x20set\x20to:\x20'];a31_0x213f=function(){return _0x326654;};return a31_0x213f();}(function(_0x18fd28,_0x436ec0){const _0x3ffc30=a31_0x2044,_0x1ca7ef=_0x18fd28();while(!![]){try{const _0x1569a8=-parseInt(_0x3ffc30(0x192))/0x1+-parseInt(_0x3ffc30(0x195))/0x2*(parseInt(_0x3ffc30(0x174))/0x3)+parseInt(_0x3ffc30(0x18e))/0x4*(parseInt(_0x3ffc30(0x196))/0x5)+-parseInt(_0x3ffc30(0x176))/0x6+parseInt(_0x3ffc30(0x187))/0x7*(-parseInt(_0x3ffc30(0x180))/0x8)+-parseInt(_0x3ffc30(0x18f))/0x9*(-parseInt(_0x3ffc30(0x193))/0xa)+parseInt(_0x3ffc30(0x17f))/0xb;if(_0x1569a8===_0x436ec0)break;else _0x1ca7ef['push'](_0x1ca7ef['shift']());}catch(_0x17837e){_0x1ca7ef['push'](_0x1ca7ef['shift']());}}}(a31_0x213f,0xba80f));import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x1613dd(0x186)]=a31_0x1613dd(0x17c);[a31_0x1613dd(0x197)]='Set\x20session-level\x20context';[a31_0x1613dd(0x189)](_0xa54840){const _0x622c10=a31_0x1613dd,{args:_0x175d6b}=_0xa54840;if(_0x175d6b[_0x622c10(0x185)]<0x2)return _0x622c10(0x18b)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+'Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a'+_0x622c10(0x17b);const _0x46a0d4=_0x175d6b[0x0],_0x44505c=[_0x622c10(0x182),_0x622c10(0x178),_0x622c10(0x173),_0x622c10(0x181)];if(!_0x44505c[_0x622c10(0x172)](_0x46a0d4))return _0x622c10(0x190)+_0x46a0d4+_0x622c10(0x184)+_0x44505c[_0x622c10(0x18a)](',\x20');return undefined;}async[a31_0x1613dd(0x18c)](_0xab0fc7){const _0x1acc5c=a31_0x1613dd,{args:_0xd6bed6,options:_0xaeda1c}=_0xab0fc7;try{const _0x2c6bfd=_0xd6bed6[0x0],_0x2b7c5e=_0xd6bed6[0x1];if(_0x2c6bfd===_0x1acc5c(0x181)){if(!profileExists(_0x2b7c5e))return console[_0x1acc5c(0x17d)](_0x1acc5c(0x177)+_0x2b7c5e+_0x1acc5c(0x17a)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x46df0e=_0xaeda1c[_0x1acc5c(0x198)]||getCurrentSessionPID()[_0x1acc5c(0x191)]();return saveSessionContext({'profile':_0x2b7c5e},_0xaeda1c[_0x1acc5c(0x198)]),console[_0x1acc5c(0x179)](_0x1acc5c(0x188)+_0x2b7c5e+_0x1acc5c(0x183)+_0x46df0e+')'),console['log'](_0x1acc5c(0x175)),0x0;}const _0x49561a={},_0x5ca48=_0xaeda1c['session']||getCurrentSessionPID()[_0x1acc5c(0x191)]();switch(_0x2c6bfd){case _0x1acc5c(0x182):_0x49561a[_0x1acc5c(0x182)]=_0x2b7c5e,console[_0x1acc5c(0x179)](_0x1acc5c(0x18d)+_0x2b7c5e+_0x1acc5c(0x183)+_0x5ca48+')');break;case _0x1acc5c(0x178):_0x49561a[_0x1acc5c(0x178)]=_0x2b7c5e,console[_0x1acc5c(0x179)]('Session\x20parent_segment\x20set\x20to:\x20'+_0x2b7c5e+'\x20(session:\x20'+_0x5ca48+')');break;case _0x1acc5c(0x173):_0x49561a['llm_project']=_0x2b7c5e,console['log'](_0x1acc5c(0x194)+_0x2b7c5e+'\x20(session:\x20'+_0x5ca48+')');break;}return saveSessionContext(_0x49561a,_0xaeda1c[_0x1acc5c(0x198)]),console[_0x1acc5c(0x179)](_0x1acc5c(0x175)),0x0;}catch(_0x1e69dd){return _0x1e69dd instanceof Error&&console[_0x1acc5c(0x17d)](_0x1acc5c(0x17e)+_0x1e69dd['message']),0x1;}}}
1
+ function a31_0x583f(_0x331f96,_0x8cf5e){const _0x7b06f2=a31_0x7b06();return a31_0x583f=function(_0x583f5e,_0x498591){_0x583f5e=_0x583f5e-0x1a9;let _0x4c9617=_0x7b06f2[_0x583f5e];return _0x4c9617;},a31_0x583f(_0x331f96,_0x8cf5e);}const a31_0x1c82eb=a31_0x583f;(function(_0x25de69,_0x348e37){const _0x5aa95f=a31_0x583f,_0x590f31=_0x25de69();while(!![]){try{const _0x33f473=parseInt(_0x5aa95f(0x1c3))/0x1+-parseInt(_0x5aa95f(0x1c8))/0x2+parseInt(_0x5aa95f(0x1af))/0x3*(parseInt(_0x5aa95f(0x1c5))/0x4)+parseInt(_0x5aa95f(0x1ab))/0x5*(parseInt(_0x5aa95f(0x1a9))/0x6)+-parseInt(_0x5aa95f(0x1b1))/0x7+-parseInt(_0x5aa95f(0x1be))/0x8+parseInt(_0x5aa95f(0x1b2))/0x9;if(_0x33f473===_0x348e37)break;else _0x590f31['push'](_0x590f31['shift']());}catch(_0x2df7da){_0x590f31['push'](_0x590f31['shift']());}}}(a31_0x7b06,0xa79fd));import{BaseCommand}from'./command.js';function a31_0x7b06(){const _0x70414f=['description','profile','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','.\x20Must\x20be\x20one\x20of:\x20','llm_project','session','\x20(session:\x20','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','\x27\x20does\x20not\x20exist','join','log','4266608sFNRCp','Session\x20llm_project\x20set\x20to:\x20','toString','Session\x20profile\x20set\x20to:\x20','name','713426hzMUAL','parent_segment','1583480IzCixv','Set\x20session-level\x20context','Session\x20database\x20set\x20to:\x20','1072792XNwJwW','\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles','validate','Or\x20use:\x20tdx\x20context\x20--clear\x20to\x20clear\x20session\x20context\x0a','Invalid\x20resource:\x20','3318744JIAZnW','Session\x20parent_segment\x20set\x20to:\x20','10OLroHB','use','database','error','3uFQijP','execute','7180446QBTKSW','5098905gDmjHy'];a31_0x7b06=function(){return _0x70414f;};return a31_0x7b06();}import{saveSessionContext,getCurrentSessionPID}from'../core/session.js';import{profileExists}from'../core/profile.js';export class UseCommand extends BaseCommand{[a31_0x1c82eb(0x1c2)]=a31_0x1c82eb(0x1ac);[a31_0x1c82eb(0x1b3)]=a31_0x1c82eb(0x1c6);[a31_0x1c82eb(0x1ca)](_0x5a50e0){const _0x1d5406=a31_0x1c82eb,{args:_0x30428e}=_0x5a50e0;if(_0x30428e['length']<0x2)return _0x1d5406(0x1b5)+'Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile\x0a'+_0x1d5406(0x1cb)+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x388efb=_0x30428e[0x0],_0x1bf524=[_0x1d5406(0x1ad),_0x1d5406(0x1c4),_0x1d5406(0x1b7),_0x1d5406(0x1b4)];if(!_0x1bf524['includes'](_0x388efb))return _0x1d5406(0x1cc)+_0x388efb+_0x1d5406(0x1b6)+_0x1bf524[_0x1d5406(0x1bc)](',\x20');return undefined;}async[a31_0x1c82eb(0x1b0)](_0x3ae843){const _0x5d0320=a31_0x1c82eb,{args:_0x6f7bd5,options:_0x140e90}=_0x3ae843;try{const _0x4439e8=_0x6f7bd5[0x0],_0x1e0aa4=_0x6f7bd5[0x1];if(_0x4439e8===_0x5d0320(0x1b4)){if(!profileExists(_0x1e0aa4))return console[_0x5d0320(0x1ae)]('Error:\x20Profile\x20\x27'+_0x1e0aa4+_0x5d0320(0x1bb)),console['error'](_0x5d0320(0x1c9)),0x1;const _0x549967=_0x140e90[_0x5d0320(0x1b8)]||getCurrentSessionPID()[_0x5d0320(0x1c0)]();return saveSessionContext({'profile':_0x1e0aa4},_0x140e90['session']),console[_0x5d0320(0x1bd)](_0x5d0320(0x1c1)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x549967+')'),console['log'](_0x5d0320(0x1ba)),0x0;}const _0x409b07={},_0x5d16ec=_0x140e90[_0x5d0320(0x1b8)]||getCurrentSessionPID()['toString']();switch(_0x4439e8){case _0x5d0320(0x1ad):_0x409b07[_0x5d0320(0x1ad)]=_0x1e0aa4,console['log'](_0x5d0320(0x1c7)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x5d16ec+')');break;case _0x5d0320(0x1c4):_0x409b07['parent_segment']=_0x1e0aa4,console[_0x5d0320(0x1bd)](_0x5d0320(0x1aa)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x5d16ec+')');break;case _0x5d0320(0x1b7):_0x409b07[_0x5d0320(0x1b7)]=_0x1e0aa4,console[_0x5d0320(0x1bd)](_0x5d0320(0x1bf)+_0x1e0aa4+_0x5d0320(0x1b9)+_0x5d16ec+')');break;}return saveSessionContext(_0x409b07,_0x140e90['session']),console['log'](_0x5d0320(0x1ba)),0x0;}catch(_0x34d10f){return _0x34d10f instanceof Error&&console[_0x5d0320(0x1ae)]('Error:\x20'+_0x34d10f['message']),0x1;}}}