@treasuredata/tdx 0.3.4 → 0.3.5

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 (97) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/cdp-api-client.js +1 -1
  5. package/dist/client/http-client.js +1 -1
  6. package/dist/client/llm-api-client.js +1 -1
  7. package/dist/client/rate-limiter.js +1 -1
  8. package/dist/client/td-api-client.js +1 -1
  9. package/dist/client/trino-api-client.js +1 -1
  10. package/dist/client/workflow-client.d.ts +17 -1
  11. package/dist/client/workflow-client.d.ts.map +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/client/workflow-client.js.map +1 -1
  14. package/dist/commands/activations.js +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/context-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/llm-proxy.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pwd-command.js +1 -1
  33. package/dist/commands/segment-update-command.js +1 -1
  34. package/dist/commands/segment-use-command.js +1 -1
  35. package/dist/commands/segments.js +1 -1
  36. package/dist/commands/show.js +1 -1
  37. package/dist/commands/tables.js +1 -1
  38. package/dist/commands/use-command.js +1 -1
  39. package/dist/commands/workflow-command.d.ts +9 -1
  40. package/dist/commands/workflow-command.d.ts.map +1 -1
  41. package/dist/commands/workflow-command.js +1 -1
  42. package/dist/commands/workflow-command.js.map +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/config.js +1 -1
  45. package/dist/core/global-context.js +1 -1
  46. package/dist/core/profile.js +1 -1
  47. package/dist/core/project-config.js +1 -1
  48. package/dist/core/session.js +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/proxy/anthropic-adapter.js +1 -1
  51. package/dist/proxy/server.js +1 -1
  52. package/dist/proxy/session-cache.js +1 -1
  53. package/dist/sdk/api.js +1 -1
  54. package/dist/sdk/errors.js +1 -1
  55. package/dist/sdk/index.js +1 -1
  56. package/dist/sdk/job.js +1 -1
  57. package/dist/sdk/llm.js +1 -1
  58. package/dist/sdk/query.js +1 -1
  59. package/dist/sdk/segment.js +1 -1
  60. package/dist/sdk/workflow.d.ts +52 -16
  61. package/dist/sdk/workflow.d.ts.map +1 -1
  62. package/dist/sdk/workflow.js +1 -1
  63. package/dist/sdk/workflow.js.map +1 -1
  64. package/dist/types/endpoints.js +1 -1
  65. package/dist/types/index.d.ts +1 -1
  66. package/dist/types/index.d.ts.map +1 -1
  67. package/dist/types/index.js +1 -1
  68. package/dist/types/workflow.d.ts +49 -0
  69. package/dist/types/workflow.d.ts.map +1 -1
  70. package/dist/utils/agent-ref-parser.js +1 -1
  71. package/dist/utils/chat-cache.js +1 -1
  72. package/dist/utils/colors.js +1 -1
  73. package/dist/utils/command-output.d.ts.map +1 -1
  74. package/dist/utils/command-output.js +1 -1
  75. package/dist/utils/command-output.js.map +1 -1
  76. package/dist/utils/constants.js +1 -1
  77. package/dist/utils/file-permissions.js +1 -1
  78. package/dist/utils/format-detector.js +1 -1
  79. package/dist/utils/formatters.js +1 -1
  80. package/dist/utils/json-loader.js +1 -1
  81. package/dist/utils/model-aliases.js +1 -1
  82. package/dist/utils/option-validation.js +1 -1
  83. package/dist/utils/port.js +1 -1
  84. package/dist/utils/process.js +1 -1
  85. package/dist/utils/prompt.js +1 -1
  86. package/dist/utils/segment-path-parser.js +1 -1
  87. package/dist/utils/segment-ref-parser.js +1 -1
  88. package/dist/utils/spinner.js +1 -1
  89. package/dist/utils/sql-parser.js +1 -1
  90. package/dist/utils/sse-parser.js +1 -1
  91. package/dist/utils/string-utils.js +1 -1
  92. package/dist/utils/table-ref-parser.js +1 -1
  93. package/dist/utils/tdx-logger.js +1 -1
  94. package/dist/utils/tree-formatter.js +1 -1
  95. package/dist/utils/version-check.js +1 -1
  96. package/dist/utils/workflow-utils.js +1 -1
  97. package/package.json +1 -1
@@ -1 +1 @@
1
- const a20_0x52c14d=a20_0x13a0;(function(_0x3d6e14,_0x4cb654){const _0x2a0076=a20_0x13a0,_0x1ca4f1=_0x3d6e14();while(!![]){try{const _0x3ec5fb=-parseInt(_0x2a0076(0x117))/0x1+-parseInt(_0x2a0076(0x13b))/0x2*(parseInt(_0x2a0076(0x125))/0x3)+-parseInt(_0x2a0076(0x13e))/0x4+-parseInt(_0x2a0076(0x144))/0x5*(-parseInt(_0x2a0076(0x124))/0x6)+-parseInt(_0x2a0076(0x122))/0x7*(-parseInt(_0x2a0076(0x120))/0x8)+-parseInt(_0x2a0076(0x116))/0x9*(parseInt(_0x2a0076(0x133))/0xa)+-parseInt(_0x2a0076(0x11d))/0xb*(-parseInt(_0x2a0076(0x131))/0xc);if(_0x3ec5fb===_0x4cb654)break;else _0x1ca4f1['push'](_0x1ca4f1['shift']());}catch(_0x2cb078){_0x1ca4f1['push'](_0x1ca4f1['shift']());}}}(a20_0x52ae,0x1870f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a20_0x13a0(_0x3aed19,_0x4dfa42){const _0x52aec7=a20_0x52ae();return a20_0x13a0=function(_0x13a0df,_0x2e8b13){_0x13a0df=_0x13a0df-0x116;let _0x15faab=_0x52aec7[_0x13a0df];return _0x15faab;},a20_0x13a0(_0x3aed19,_0x4dfa42);}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a20_0x52ae(){const _0x5d7325=['135ueqWFK','116147DliDtK','Error:\x20Parent\x20segment\x20name\x20is\x20required','scheduleType','customerGroupFile','addBehaviors','Database:\x20','15367ulEDTB','attributes','Fetching\x20current\x20configuration\x20for\x20\x27','195184MbvIoG','behaviorsFile','7hLsibm','name','942GHWmlx','15DSXrUm','scheduleOption','Parent\x20segment:\x20','length','customerGroup','segment:parent:create','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x27...','error','Updating\x20parent\x20segment\x20\x27','addBehaviorsFile','execute','3084ebxnQZ','\x27\x20with\x20ID:\x20','101130MHKokp','verbose','table','behaviors','✔\x20Created\x20parent\x20segment\x20\x27','attributesFile','segment:parent:update','site','11862LYpxMd','data','segment','352732Aoygba','description','addAttributesFile','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','master','database','3260eXhNxK','createParent','timezone','Name:\x20'];a20_0x52ae=function(){return _0x5d7325;};return a20_0x52ae();}export class ParentSegmentCreateCommand extends BaseCommand{[a20_0x52c14d(0x123)]=a20_0x52c14d(0x12a);['description']='Create\x20new\x20parent\x20segment\x20(audience)';async[a20_0x52c14d(0x130)](_0x2f6220){const _0x44fbbd=a20_0x52c14d,{options:_0x40da52,args:_0x3109e9,tdx:_0x3f62f7}=_0x2f6220,_0x821554=_0x40da52;if(_0x3109e9['length']===0x0)return console['error'](_0x44fbbd(0x118)),console[_0x44fbbd(0x12d)](_0x44fbbd(0x12b)),0x1;const _0x1c2245=_0x3109e9[0x0];if(!_0x821554[_0x44fbbd(0x143)]||!_0x821554[_0x44fbbd(0x135)])return console['error']('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x44fbbd(0x12d)](_0x44fbbd(0x12b)),0x1;_0x821554[_0x44fbbd(0x134)]&&(console[_0x44fbbd(0x12d)]('Site:\x20'+_0x821554[_0x44fbbd(0x13a)]),console[_0x44fbbd(0x12d)](_0x44fbbd(0x147)+_0x1c2245),console['error'](_0x44fbbd(0x11c)+_0x821554[_0x44fbbd(0x143)]),console[_0x44fbbd(0x12d)]('Table:\x20'+_0x821554['table']));const _0x2f7255=await loadJSONFromOptions(_0x821554['attributes'],_0x821554[_0x44fbbd(0x138)]),_0x3ddbd6=await loadJSONFromOptions(_0x821554['behaviors'],_0x821554[_0x44fbbd(0x121)]),_0x15951f=await loadJSONFromOptions(_0x821554[_0x44fbbd(0x129)],_0x821554[_0x44fbbd(0x11a)]),_0x911e08={'name':_0x1c2245,'description':_0x821554['description'],'scheduleType':_0x821554['scheduleType'],'scheduleOption':_0x821554[_0x44fbbd(0x126)],'timezone':_0x821554[_0x44fbbd(0x146)],'master':{'parentDatabaseName':_0x821554['database'],'parentTableName':_0x821554[_0x44fbbd(0x135)]},'attributes':_0x2f7255,'behaviors':_0x3ddbd6,'customerGroup':_0x15951f},_0xd32b02=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x1c2245+'\x27...',()=>_0x3f62f7[_0x44fbbd(0x13d)][_0x44fbbd(0x145)](_0x911e08),{'verbose':_0x40da52[_0x44fbbd(0x134)]}),_0x5ccf72=_0xd32b02[_0x44fbbd(0x13c)];return console['error'](_0x44fbbd(0x137)+_0x5ccf72[_0x44fbbd(0x123)]+_0x44fbbd(0x132)+_0x5ccf72['id']),await handleSDKOutput([_0x5ccf72],_0x40da52),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a20_0x52c14d(0x139);[a20_0x52c14d(0x13f)]='Update\x20existing\x20parent\x20segment\x20(audience)';async['execute'](_0x120c0c){const _0x46448b=a20_0x52c14d,{options:_0x5c131,args:_0x122be,tdx:_0x46cb88}=_0x120c0c,_0xbfe739=_0x5c131;if(_0x122be[_0x46448b(0x128)]===0x0)return console[_0x46448b(0x12d)](_0x46448b(0x118)),console[_0x46448b(0x12d)](_0x46448b(0x141)),0x1;const _0x2287bc=_0x122be[0x0];_0xbfe739['verbose']&&(console[_0x46448b(0x12d)]('Site:\x20'+_0xbfe739['site']),console[_0x46448b(0x12d)](_0x46448b(0x127)+_0x2287bc));const _0x2d27aa=await withSpinner(_0x46448b(0x11f)+_0x2287bc+_0x46448b(0x12c),()=>_0x46cb88[_0x46448b(0x13d)]['getParentFull'](_0x2287bc),{'verbose':_0xbfe739[_0x46448b(0x134)]}),_0x3c64d8=_0x2d27aa[_0x46448b(0x13c)],_0x30966e=await loadJSONFromOptions(_0xbfe739['addAttributes'],_0xbfe739[_0x46448b(0x140)]),_0x55a955=await loadJSONFromOptions(_0xbfe739[_0x46448b(0x11b)],_0xbfe739[_0x46448b(0x12f)]),_0x168428={'name':_0x3c64d8[_0x46448b(0x123)],'description':_0xbfe739[_0x46448b(0x13f)]!==undefined?_0xbfe739['description']:_0x3c64d8[_0x46448b(0x13f)],'scheduleType':_0xbfe739['scheduleType']!==undefined?_0xbfe739[_0x46448b(0x119)]:_0x3c64d8['scheduleType'],'scheduleOption':_0xbfe739[_0x46448b(0x126)]!==undefined?_0xbfe739['scheduleOption']:_0x3c64d8['scheduleOption'],'timezone':_0xbfe739[_0x46448b(0x146)]!==undefined?_0xbfe739[_0x46448b(0x146)]:_0x3c64d8['timezone'],'master':_0x3c64d8[_0x46448b(0x142)],'attributes':_0x30966e?[..._0x3c64d8['attributes']||[],..._0x30966e]:_0x3c64d8[_0x46448b(0x11e)],'behaviors':_0x55a955?[..._0x3c64d8[_0x46448b(0x136)]||[],..._0x55a955]:_0x3c64d8[_0x46448b(0x136)],'customerGroup':_0x3c64d8[_0x46448b(0x129)]},_0x2f3f23=await withSpinner(_0x46448b(0x12e)+_0x2287bc+'\x27...',()=>_0x46cb88[_0x46448b(0x13d)]['updateParent'](_0x2287bc,_0x168428),{'verbose':_0xbfe739[_0x46448b(0x134)]}),_0xb38a47=_0x2f3f23[_0x46448b(0x13c)];return console[_0x46448b(0x12d)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0xb38a47[_0x46448b(0x123)]+'\x27'),await handleSDKOutput([_0xb38a47],_0xbfe739),0x0;}}
1
+ const a20_0x1217e4=a20_0x1a3a;(function(_0x386051,_0x275329){const _0x24f584=a20_0x1a3a,_0x1e8dae=_0x386051();while(!![]){try{const _0x1a26de=parseInt(_0x24f584(0x75))/0x1+-parseInt(_0x24f584(0x7d))/0x2*(parseInt(_0x24f584(0x8a))/0x3)+parseInt(_0x24f584(0x8c))/0x4*(parseInt(_0x24f584(0x98))/0x5)+-parseInt(_0x24f584(0x83))/0x6+-parseInt(_0x24f584(0x93))/0x7*(-parseInt(_0x24f584(0x6c))/0x8)+-parseInt(_0x24f584(0x88))/0x9*(-parseInt(_0x24f584(0x87))/0xa)+-parseInt(_0x24f584(0x70))/0xb;if(_0x1a26de===_0x275329)break;else _0x1e8dae['push'](_0x1e8dae['shift']());}catch(_0x2e6cee){_0x1e8dae['push'](_0x1e8dae['shift']());}}}(a20_0x142f,0x90d97));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';export class ParentSegmentCreateCommand extends BaseCommand{[a20_0x1217e4(0x73)]='segment:parent:create';[a20_0x1217e4(0x6d)]=a20_0x1217e4(0x7f);async[a20_0x1217e4(0x96)](_0x7f3c31){const _0x310c36=a20_0x1217e4,{options:_0x565f4b,args:_0x38dbc8,tdx:_0x77e96a}=_0x7f3c31,_0x440bf7=_0x565f4b;if(_0x38dbc8[_0x310c36(0x6b)]===0x0)return console[_0x310c36(0x95)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x5bd1df=_0x38dbc8[0x0];if(!_0x440bf7[_0x310c36(0x6f)]||!_0x440bf7['table'])return console[_0x310c36(0x95)](_0x310c36(0x67)),console[_0x310c36(0x95)](_0x310c36(0x99)),0x1;_0x440bf7[_0x310c36(0x90)]&&(console[_0x310c36(0x95)]('Site:\x20'+_0x440bf7[_0x310c36(0x8f)]),console[_0x310c36(0x95)](_0x310c36(0x89)+_0x5bd1df),console['error'](_0x310c36(0x80)+_0x440bf7[_0x310c36(0x6f)]),console[_0x310c36(0x95)]('Table:\x20'+_0x440bf7['table']));const _0xe1f48a=await loadJSONFromOptions(_0x440bf7[_0x310c36(0x77)],_0x440bf7[_0x310c36(0x85)]),_0x167d9c=await loadJSONFromOptions(_0x440bf7['behaviors'],_0x440bf7[_0x310c36(0x71)]),_0x50f61f=await loadJSONFromOptions(_0x440bf7['customerGroup'],_0x440bf7[_0x310c36(0x97)]),_0xce84d3={'name':_0x5bd1df,'description':_0x440bf7['description'],'scheduleType':_0x440bf7[_0x310c36(0x84)],'scheduleOption':_0x440bf7['scheduleOption'],'timezone':_0x440bf7['timezone'],'master':{'parentDatabaseName':_0x440bf7[_0x310c36(0x6f)],'parentTableName':_0x440bf7[_0x310c36(0x8e)]},'attributes':_0xe1f48a,'behaviors':_0x167d9c,'customerGroup':_0x50f61f},_0xf4f051=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x5bd1df+_0x310c36(0x7c),()=>_0x77e96a[_0x310c36(0x7a)]['createParent'](_0xce84d3),{'verbose':_0x565f4b[_0x310c36(0x90)]}),_0xd80ecd=_0xf4f051[_0x310c36(0x91)];return console[_0x310c36(0x95)](_0x310c36(0x8b)+_0xd80ecd[_0x310c36(0x73)]+'\x27\x20with\x20ID:\x20'+_0xd80ecd['id']),await handleSDKOutput([_0xd80ecd],_0x565f4b),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a20_0x1217e4(0x73)]=a20_0x1217e4(0x94);[a20_0x1217e4(0x6d)]=a20_0x1217e4(0x7b);async[a20_0x1217e4(0x96)](_0x570809){const _0x175cf5=a20_0x1217e4,{options:_0x1bb193,args:_0x5cc0e7,tdx:_0x189a33}=_0x570809,_0xd6c9f5=_0x1bb193;if(_0x5cc0e7[_0x175cf5(0x6b)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x175cf5(0x95)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x2b0770=_0x5cc0e7[0x0];_0xd6c9f5[_0x175cf5(0x90)]&&(console[_0x175cf5(0x95)](_0x175cf5(0x72)+_0xd6c9f5[_0x175cf5(0x8f)]),console['error'](_0x175cf5(0x74)+_0x2b0770));const _0x1cf467=await withSpinner(_0x175cf5(0x7e)+_0x2b0770+_0x175cf5(0x7c),()=>_0x189a33['segment'][_0x175cf5(0x92)](_0x2b0770),{'verbose':_0xd6c9f5[_0x175cf5(0x90)]}),_0x281318=_0x1cf467[_0x175cf5(0x91)],_0x32b121=await loadJSONFromOptions(_0xd6c9f5[_0x175cf5(0x6a)],_0xd6c9f5[_0x175cf5(0x8d)]),_0x44a261=await loadJSONFromOptions(_0xd6c9f5[_0x175cf5(0x82)],_0xd6c9f5[_0x175cf5(0x68)]),_0x3657f8={'name':_0x281318[_0x175cf5(0x73)],'description':_0xd6c9f5[_0x175cf5(0x6d)]!==undefined?_0xd6c9f5[_0x175cf5(0x6d)]:_0x281318[_0x175cf5(0x6d)],'scheduleType':_0xd6c9f5[_0x175cf5(0x84)]!==undefined?_0xd6c9f5[_0x175cf5(0x84)]:_0x281318['scheduleType'],'scheduleOption':_0xd6c9f5[_0x175cf5(0x76)]!==undefined?_0xd6c9f5['scheduleOption']:_0x281318[_0x175cf5(0x76)],'timezone':_0xd6c9f5[_0x175cf5(0x69)]!==undefined?_0xd6c9f5[_0x175cf5(0x69)]:_0x281318[_0x175cf5(0x69)],'master':_0x281318[_0x175cf5(0x86)],'attributes':_0x32b121?[..._0x281318['attributes']||[],..._0x32b121]:_0x281318[_0x175cf5(0x77)],'behaviors':_0x44a261?[..._0x281318['behaviors']||[],..._0x44a261]:_0x281318[_0x175cf5(0x6e)],'customerGroup':_0x281318[_0x175cf5(0x78)]},_0x578e9e=await withSpinner(_0x175cf5(0x81)+_0x2b0770+_0x175cf5(0x7c),()=>_0x189a33[_0x175cf5(0x7a)]['updateParent'](_0x2b0770,_0x3657f8),{'verbose':_0xd6c9f5[_0x175cf5(0x90)]}),_0x2cb7fe=_0x578e9e['data'];return console['error'](_0x175cf5(0x79)+_0x2cb7fe[_0x175cf5(0x73)]+'\x27'),await handleSDKOutput([_0x2cb7fe],_0xd6c9f5),0x0;}}function a20_0x1a3a(_0x57cbe,_0x313926){const _0x142f35=a20_0x142f();return a20_0x1a3a=function(_0x1a3ace,_0x2eb2e7){_0x1a3ace=_0x1a3ace-0x67;let _0x49d358=_0x142f35[_0x1a3ace];return _0x49d358;},a20_0x1a3a(_0x57cbe,_0x313926);}function a20_0x142f(){const _0x237b81=['addBehaviorsFile','timezone','addAttributes','length','1437872HXnjwe','description','behaviors','database','1549834NleCua','behaviorsFile','Site:\x20','name','Parent\x20segment:\x20','684473MGSiXX','scheduleOption','attributes','customerGroup','✔\x20Updated\x20parent\x20segment\x20\x27','segment','Update\x20existing\x20parent\x20segment\x20(audience)','\x27...','2wDpknR','Fetching\x20current\x20configuration\x20for\x20\x27','Create\x20new\x20parent\x20segment\x20(audience)','Database:\x20','Updating\x20parent\x20segment\x20\x27','addBehaviors','4377552igRyIY','scheduleType','attributesFile','master','10TuuFWB','1182735choIVr','Name:\x20','1013631rHYLee','✔\x20Created\x20parent\x20segment\x20\x27','1786304uWtEsM','addAttributesFile','table','site','verbose','data','getParentFull','21PQcIIz','segment:parent:update','error','execute','customerGroupFile','5OcDiar','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Error:\x20--database\x20and\x20--table\x20are\x20required'];a20_0x142f=function(){return _0x237b81;};return a20_0x142f();}
@@ -1 +1 @@
1
- const a21_0xb9d584=a21_0x31fb;(function(_0x2a369b,_0x550b9b){const _0x27cb9b=a21_0x31fb,_0x5d49fc=_0x2a369b();while(!![]){try{const _0x2a0f71=-parseInt(_0x27cb9b(0x179))/0x1+-parseInt(_0x27cb9b(0x16c))/0x2*(-parseInt(_0x27cb9b(0x17a))/0x3)+parseInt(_0x27cb9b(0x16a))/0x4+parseInt(_0x27cb9b(0x16b))/0x5*(parseInt(_0x27cb9b(0x165))/0x6)+parseInt(_0x27cb9b(0x166))/0x7*(parseInt(_0x27cb9b(0x176))/0x8)+-parseInt(_0x27cb9b(0x178))/0x9+-parseInt(_0x27cb9b(0x171))/0xa;if(_0x2a0f71===_0x550b9b)break;else _0x5d49fc['push'](_0x5d49fc['shift']());}catch(_0x2dc912){_0x5d49fc['push'](_0x5d49fc['shift']());}}}(a21_0xe85e,0x4f86d));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a21_0x31fb(_0x5cb79a,_0x3a7eaf){const _0xe85ece=a21_0xe85e();return a21_0x31fb=function(_0x31fb29,_0x490041){_0x31fb29=_0x31fb29-0x164;let _0x17fc1a=_0xe85ece[_0x31fb29];return _0x17fc1a;},a21_0x31fb(_0x5cb79a,_0x3a7eaf);}import{handleSDKOutput}from'../utils/command-output.js';function a21_0xe85e(){const _0x157a1e=['name','List\x20all\x20available\x20profiles','6120700joMlcv','message','description','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','51592XPVnDe','Error:\x20','2313054RIAjCu','61377kAMYwm','15UUOCBT','length','606ijyQzW','413PHifVL','error','execute','log','382072KlINAx','25875kewctl','103004DBdpTG','\x20\x20Global:\x20~/.config/tdx/tdx.json','config'];a21_0xe85e=function(){return _0x157a1e;};return a21_0xe85e();}export class ProfilesCommand extends BaseCommand{[a21_0xb9d584(0x16f)]='profiles';[a21_0xb9d584(0x173)]=a21_0xb9d584(0x170);async[a21_0xb9d584(0x168)](_0x4f18ce){const _0x508f30=a21_0xb9d584,{options:_0x1c3e84}=_0x4f18ce;try{const _0x2d9886=listProfiles(),_0x45ee6f=getActiveProfile();if(_0x2d9886[_0x508f30(0x164)]===0x0)return console[_0x508f30(0x169)](_0x508f30(0x175)),console[_0x508f30(0x169)](_0x508f30(0x174)),console[_0x508f30(0x169)](_0x508f30(0x16d)),0x0;const _0x145a58=_0x2d9886['map'](_0x3d5a56=>{const _0x54ea71=_0x508f30,_0x382a93=_0x3d5a56[_0x54ea71(0x16f)]===_0x45ee6f,_0xa7be95=getProfileParams(_0x3d5a56[_0x54ea71(0x16e)]);return{'name':_0x3d5a56[_0x54ea71(0x16f)],'active':_0x382a93,'scope':_0x3d5a56['scope'],'description':_0x3d5a56[_0x54ea71(0x16e)][_0x54ea71(0x173)]||'','params':_0xa7be95};});return await handleSDKOutput(_0x145a58,_0x1c3e84),0x0;}catch(_0x4504f9){return _0x4504f9 instanceof Error&&console[_0x508f30(0x167)](_0x508f30(0x177)+_0x4504f9[_0x508f30(0x172)]),0x1;}}}
1
+ const a21_0x4bda32=a21_0x24be;(function(_0x2faca4,_0x28d1bb){const _0x1ddff6=a21_0x24be,_0x2da602=_0x2faca4();while(!![]){try{const _0x56b145=-parseInt(_0x1ddff6(0x83))/0x1+-parseInt(_0x1ddff6(0x86))/0x2*(parseInt(_0x1ddff6(0x89))/0x3)+-parseInt(_0x1ddff6(0x74))/0x4*(parseInt(_0x1ddff6(0x8a))/0x5)+-parseInt(_0x1ddff6(0x78))/0x6*(parseInt(_0x1ddff6(0x8b))/0x7)+parseInt(_0x1ddff6(0x80))/0x8+-parseInt(_0x1ddff6(0x7c))/0x9+-parseInt(_0x1ddff6(0x7a))/0xa*(-parseInt(_0x1ddff6(0x84))/0xb);if(_0x56b145===_0x28d1bb)break;else _0x2da602['push'](_0x2da602['shift']());}catch(_0x55981b){_0x2da602['push'](_0x2da602['shift']());}}}(a21_0x4be9,0x9b5da));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';function a21_0x24be(_0x28f4c3,_0x2449a4){const _0x4be9c1=a21_0x4be9();return a21_0x24be=function(_0x24becf,_0x295c2f){_0x24becf=_0x24becf-0x73;let _0x53c240=_0x4be9c1[_0x24becf];return _0x53c240;},a21_0x24be(_0x28f4c3,_0x2449a4);}export class ProfilesCommand extends BaseCommand{[a21_0x4bda32(0x8c)]=a21_0x4bda32(0x76);[a21_0x4bda32(0x85)]=a21_0x4bda32(0x87);async[a21_0x4bda32(0x82)](_0x41814a){const _0x5cdd79=a21_0x4bda32,{options:_0x50ccef}=_0x41814a;try{const _0x574c41=listProfiles(),_0x19a46f=getActiveProfile();if(_0x574c41[_0x5cdd79(0x73)]===0x0)return console['log'](_0x5cdd79(0x81)),console[_0x5cdd79(0x79)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x5cdd79(0x79)](_0x5cdd79(0x7f)),0x0;const _0x258879=_0x574c41[_0x5cdd79(0x77)](_0x38158c=>{const _0x5d7959=_0x5cdd79,_0x5ba342=_0x38158c['name']===_0x19a46f,_0x452133=getProfileParams(_0x38158c[_0x5d7959(0x88)]);return{'name':_0x38158c[_0x5d7959(0x8c)],'active':_0x5ba342,'scope':_0x38158c[_0x5d7959(0x7e)],'description':_0x38158c[_0x5d7959(0x88)]['description']||'','params':_0x452133};});return await handleSDKOutput(_0x258879,_0x50ccef),0x0;}catch(_0x3f9e31){return _0x3f9e31 instanceof Error&&console[_0x5cdd79(0x7b)](_0x5cdd79(0x75)+_0x3f9e31[_0x5cdd79(0x7d)]),0x1;}}}function a21_0x4be9(){const _0xa08a20=['No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','execute','1236602EXFyWY','59994429BhLEcU','description','44baGCcK','List\x20all\x20available\x20profiles','config','154719ImIHwM','1006685rdyerI','91SnBztN','name','length','24reNrsx','Error:\x20','profiles','map','275118lKfNsT','log','10SnSyuL','error','10498347gJhsMF','message','scope','\x20\x20Global:\x20~/.config/tdx/tdx.json','4193128kuDINS'];a21_0x4be9=function(){return _0xa08a20;};return a21_0x4be9();}
@@ -1 +1 @@
1
- const a22_0x58236f=a22_0x42bc;(function(_0x20f353,_0x4bd2c0){const _0x2b8168=a22_0x42bc,_0x122326=_0x20f353();while(!![]){try{const _0x1420f8=-parseInt(_0x2b8168(0x1ce))/0x1+-parseInt(_0x2b8168(0x1d2))/0x2+-parseInt(_0x2b8168(0x1dd))/0x3+parseInt(_0x2b8168(0x1c3))/0x4+-parseInt(_0x2b8168(0x1c6))/0x5*(parseInt(_0x2b8168(0x1c2))/0x6)+parseInt(_0x2b8168(0x1c4))/0x7*(parseInt(_0x2b8168(0x1b8))/0x8)+parseInt(_0x2b8168(0x1b3))/0x9*(parseInt(_0x2b8168(0x1de))/0xa);if(_0x1420f8===_0x4bd2c0)break;else _0x122326['push'](_0x122326['shift']());}catch(_0xae8847){_0x122326['push'](_0x122326['shift']());}}}(a22_0x3feb,0x692a8));import{BaseCommand}from'./command.js';function a22_0x42bc(_0x2539c2,_0x5698bb){const _0x3feb5e=a22_0x3feb();return a22_0x42bc=function(_0x42bcf3,_0x35d425){_0x42bcf3=_0x42bcf3-0x1ad;let _0x329961=_0x3feb5e[_0x42bcf3];return _0x329961;},a22_0x42bc(_0x2539c2,_0x5698bb);}import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';function a22_0x3feb(){const _0x21d648=['setExtra','error','stats','47475GuAAYz','108470gzWpDr','in\x20','file','elapsedTimeMillis','data','name','jobId','catalog','message','1503hoViAI','processedRows','Query\x20completed:\x20Processed\x20','\x20splits','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','8WUnCuD','length','args','join','Catalog:\x20','setJobId','\x20rows\x20','totalSplits','state','Statement\x20','6tqfeYs','1460344ApaLNK','551215GUgDLX','information_schema','4245560wSrlQh','verbose','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','description','setPhase','database','completedSplits','Schema:\x20','494325zNKwbH','query','\x0aAll\x20results\x20saved\x20to\x20','output','930516vVTNxv','Site:\x20','SQL:\x20','Executing\x20query\x20[','site','Error:\x20','options','Executing\x20query...'];a22_0x3feb=function(){return _0x21d648;};return a22_0x3feb();}export class QueryCommand extends BaseCommand{[a22_0x58236f(0x1af)]=a22_0x58236f(0x1cf);[a22_0x58236f(0x1c9)]='Run\x20Trino\x20queries\x20(streaming)';async['execute'](_0x4ede67){const _0x1fcbb7=a22_0x58236f,{options:_0x27b6c7,args:_0x1166ba,tdx:_0x4f4fbe}=_0x4ede67,_0x98e7d1=_0x1166ba[0x0],_0x54b0aa=_0x27b6c7[_0x1fcbb7(0x1e0)];let _0xd65441;if(_0x54b0aa)try{_0xd65441=readSqlStatementsFromFile(_0x54b0aa);}catch(_0x2f2a34){return console['error'](_0x1fcbb7(0x1d7)+_0x2f2a34[_0x1fcbb7(0x1b2)]),0x1;}else try{_0xd65441=splitSqlStatements(_0x98e7d1);}catch(_0x264388){return console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1d7)+_0x264388[_0x1fcbb7(0x1b2)]),0x1;}const _0x273f6c=_0x27b6c7[_0x1fcbb7(0x1cb)]||_0x1fcbb7(0x1c5),_0x36105b=_0x27b6c7[_0x1fcbb7(0x1b1)];try{const _0x1b6c81=[],_0x1f4371=!!_0x27b6c7[_0x1fcbb7(0x1d1)];for(let _0x41c134=0x0;_0x41c134<_0xd65441[_0x1fcbb7(0x1b9)];_0x41c134++){const _0x49bd41=_0xd65441[_0x41c134],_0x44572a=_0x41c134+0x1,_0xeedcf8=_0xd65441[_0x1fcbb7(0x1b9)],_0x425442=_0xeedcf8>0x1;_0x27b6c7[_0x1fcbb7(0x1c7)]&&(console[_0x1fcbb7(0x1db)]('\x0a'+(_0x425442?'Statement\x20'+_0x44572a+'/'+_0xeedcf8+':':'')),console['error'](_0x1fcbb7(0x1d3)+_0x27b6c7[_0x1fcbb7(0x1d6)]),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1bc)+(_0x36105b||'td')),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1cd)+_0x273f6c),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1d4)+_0x49bd41));const _0x4a0a6e=_0x425442?'Executing\x20statement\x20'+_0x44572a+'/'+_0xeedcf8+'...':_0x1fcbb7(0x1d9);try{const _0x1b689d=await withQuerySpinner(_0x4a0a6e,async _0x4bd638=>{const _0x2d4ac0=_0x1fcbb7,_0x37826e=await _0x4f4fbe[_0x2d4ac0(0x1cf)]['execute'](_0x49bd41,{'catalog':_0x36105b,'schema':_0x273f6c,'onJobId':_0x244cb2=>{const _0x370e45=_0x2d4ac0;_0x4bd638[_0x370e45(0x1bd)](_0x244cb2);},'onProgress':_0x5a4d67=>{const _0x2b0d24=_0x2d4ac0;_0x4bd638[_0x2b0d24(0x1ca)](_0x2b0d24(0x1d5)+_0x5a4d67[_0x2b0d24(0x1c0)]+']'),_0x4bd638[_0x2b0d24(0x1da)](formatRows(_0x5a4d67[_0x2b0d24(0x1b4)])+'\x20rows\x20'+_0x5a4d67[_0x2b0d24(0x1cc)]+'/'+_0x5a4d67[_0x2b0d24(0x1bf)]+_0x2b0d24(0x1b6));}});return _0x37826e;},{'verbose':_0x27b6c7[_0x1fcbb7(0x1c7)]}),_0x4ecaee=_0x1b689d[_0x1fcbb7(0x1ae)],_0x360768=_0x4ecaee[_0x1fcbb7(0x1b0)]?'\x20[Job\x20ID:\x20'+_0x4ecaee[_0x1fcbb7(0x1b0)]+']':'',_0xc7d4c6=_0x425442?_0x1fcbb7(0x1c1)+_0x44572a+'/'+_0xeedcf8+'\x20-\x20':'';console[_0x1fcbb7(0x1db)]('✔\x20'+_0xc7d4c6+_0x1fcbb7(0x1b5)+formatRows(_0x4ecaee['stats'][_0x1fcbb7(0x1b4)])+_0x1fcbb7(0x1be)+(_0x1fcbb7(0x1df)+formatElapsed(_0x4ecaee[_0x1fcbb7(0x1dc)][_0x1fcbb7(0x1ad)])+_0x360768));if(_0x425442&&_0x1f4371){const _0x184f17=resolveOutputOptions(_0x27b6c7),_0xab2eb=await formatQueryOutput(_0x4ecaee,_0x184f17);_0x1b6c81['push'](_0xab2eb);}else await handleQueryOutput(_0x4ecaee,_0x27b6c7);}catch(_0x35fc5d){const _0x52a312=_0x425442?_0x1fcbb7(0x1c1)+_0x44572a+'/'+_0xeedcf8+':\x0a':'',_0x4a83f9=_0x35fc5d instanceof SDKError?_0x35fc5d['originalMessage']:_0x35fc5d[_0x1fcbb7(0x1b2)];return console[_0x1fcbb7(0x1db)](''+_0x52a312+_0x4a83f9),0x1;}}if(_0xd65441[_0x1fcbb7(0x1b9)]>0x1&&_0x1f4371&&_0x1b6c81['length']>0x0){const _0x2e5fdb=_0x1b6c81[_0x1fcbb7(0x1bb)]('\x0a');writeFileSync(_0x27b6c7['output'],_0x2e5fdb),console[_0x1fcbb7(0x1db)](_0x1fcbb7(0x1d0)+_0x27b6c7[_0x1fcbb7(0x1d1)]);}return 0x0;}catch(_0x3d894f){throw _0x3d894f;}}['validate'](_0x59f54f){const _0x6c52b5=a22_0x58236f,_0x5d7d14=_0x59f54f[_0x6c52b5(0x1ba)][0x0],_0x1385c0=_0x59f54f[_0x6c52b5(0x1d8)]['file'];if(!_0x5d7d14&&!_0x1385c0)return _0x6c52b5(0x1c8);if(_0x5d7d14&&_0x1385c0)return _0x6c52b5(0x1b7);return undefined;}}
1
+ const a22_0x107356=a22_0x2ed3;(function(_0x3febb4,_0x2b476e){const _0x563138=a22_0x2ed3,_0x121419=_0x3febb4();while(!![]){try{const _0x520178=parseInt(_0x563138(0xea))/0x1+-parseInt(_0x563138(0xf5))/0x2+-parseInt(_0x563138(0xfd))/0x3*(-parseInt(_0x563138(0xf8))/0x4)+-parseInt(_0x563138(0xf1))/0x5+-parseInt(_0x563138(0xeb))/0x6*(-parseInt(_0x563138(0xe6))/0x7)+-parseInt(_0x563138(0x10d))/0x8*(parseInt(_0x563138(0xfe))/0x9)+-parseInt(_0x563138(0xfc))/0xa*(-parseInt(_0x563138(0x113))/0xb);if(_0x520178===_0x2b476e)break;else _0x121419['push'](_0x121419['shift']());}catch(_0x1fcc60){_0x121419['push'](_0x121419['shift']());}}}(a22_0x3ebd,0xb09d1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a22_0x2ed3(_0x5f59e3,_0x5feaa){const _0x3ebdd8=a22_0x3ebd();return a22_0x2ed3=function(_0x2ed3e0,_0x2a8aa8){_0x2ed3e0=_0x2ed3e0-0xe3;let _0x566b58=_0x3ebdd8[_0x2ed3e0];return _0x566b58;},a22_0x2ed3(_0x5f59e3,_0x5feaa);}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,splitSqlStatements}from'../utils/sql-parser.js';import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';function a22_0x3ebd(){const _0x5a9d1a=['1429348wITjKG','data','error','3440icKTHr','Site:\x20','setPhase','in\x20','14909110tkbldT','3000yTMQhk','41049HGZAUj','jobId','elapsedTimeMillis','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20--file\x20query.sql\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','processedRows','state','stats','originalMessage','\x20-\x20','\x20[Job\x20ID:\x20','...','Executing\x20statement\x20','execute','join','SQL:\x20','152xWxPZr','\x20rows\x20','query','name','\x0aAll\x20results\x20saved\x20to\x20','options','11Zonebt','Error:\x20','totalSplits','Statement\x20','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','verbose','Executing\x20query...','Schema:\x20','args','site','completedSplits','push','7aTzmTJ','description','Catalog:\x20','Query\x20completed:\x20Processed\x20','482366vNFmmh','411630aGSjVZ','length','message','output','\x20splits','file','6885700rOmTOp','catalog','setExtra','database'];a22_0x3ebd=function(){return _0x5a9d1a;};return a22_0x3ebd();}import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a22_0x107356(0x110)]=a22_0x107356(0x10f);[a22_0x107356(0xe7)]='Run\x20Trino\x20queries\x20(streaming)';async[a22_0x107356(0x10a)](_0x13bcb7){const _0x5e4459=a22_0x107356,{options:_0x30d064,args:_0x11a8f6,tdx:_0x5015c5}=_0x13bcb7,_0x1443cd=_0x11a8f6[0x0],_0x4270fe=_0x30d064[_0x5e4459(0xf0)];let _0x375efa;if(_0x4270fe)try{_0x375efa=readSqlStatementsFromFile(_0x4270fe);}catch(_0x329cb7){return console[_0x5e4459(0xf7)](_0x5e4459(0x114)+_0x329cb7[_0x5e4459(0xed)]),0x1;}else try{_0x375efa=splitSqlStatements(_0x1443cd);}catch(_0x5b47c7){return console[_0x5e4459(0xf7)](_0x5e4459(0x114)+_0x5b47c7[_0x5e4459(0xed)]),0x1;}const _0x2823fa=_0x30d064[_0x5e4459(0xf4)]||'information_schema',_0x7c60c2=_0x30d064[_0x5e4459(0xf2)];try{const _0x13d722=[],_0xc3452d=!!_0x30d064[_0x5e4459(0xee)];for(let _0x3f21cd=0x0;_0x3f21cd<_0x375efa['length'];_0x3f21cd++){const _0x23cf7b=_0x375efa[_0x3f21cd],_0x5808b3=_0x3f21cd+0x1,_0x356c20=_0x375efa[_0x5e4459(0xec)],_0x41b348=_0x356c20>0x1;_0x30d064['verbose']&&(console[_0x5e4459(0xf7)]('\x0a'+(_0x41b348?_0x5e4459(0x116)+_0x5808b3+'/'+_0x356c20+':':'')),console[_0x5e4459(0xf7)](_0x5e4459(0xf9)+_0x30d064[_0x5e4459(0xe3)]),console[_0x5e4459(0xf7)](_0x5e4459(0xe8)+(_0x7c60c2||'td')),console[_0x5e4459(0xf7)](_0x5e4459(0x11a)+_0x2823fa),console[_0x5e4459(0xf7)](_0x5e4459(0x10c)+_0x23cf7b));const _0x3a1d21=_0x41b348?_0x5e4459(0x109)+_0x5808b3+'/'+_0x356c20+_0x5e4459(0x108):_0x5e4459(0x119);try{const _0x23bb25=await withQuerySpinner(_0x3a1d21,async _0x4c6ba8=>{const _0xb36ee6=_0x5e4459,_0x23b036=await _0x5015c5['query'][_0xb36ee6(0x10a)](_0x23cf7b,{'catalog':_0x7c60c2,'schema':_0x2823fa,'onJobId':_0x357206=>{_0x4c6ba8['setJobId'](_0x357206);},'onProgress':_0xcda6dc=>{const _0x2a0f3f=_0xb36ee6;_0x4c6ba8[_0x2a0f3f(0xfa)]('Executing\x20query\x20['+_0xcda6dc[_0x2a0f3f(0x103)]+']'),_0x4c6ba8[_0x2a0f3f(0xf3)](formatRows(_0xcda6dc[_0x2a0f3f(0x102)])+'\x20rows\x20'+_0xcda6dc[_0x2a0f3f(0xe4)]+'/'+_0xcda6dc[_0x2a0f3f(0x115)]+_0x2a0f3f(0xef));}});return _0x23b036;},{'verbose':_0x30d064[_0x5e4459(0x118)]}),_0x203c47=_0x23bb25[_0x5e4459(0xf6)],_0xacfd3=_0x203c47['jobId']?_0x5e4459(0x107)+_0x203c47[_0x5e4459(0xff)]+']':'',_0x1831ff=_0x41b348?_0x5e4459(0x116)+_0x5808b3+'/'+_0x356c20+_0x5e4459(0x106):'';console[_0x5e4459(0xf7)]('✔\x20'+_0x1831ff+_0x5e4459(0xe9)+formatRows(_0x203c47[_0x5e4459(0x104)][_0x5e4459(0x102)])+_0x5e4459(0x10e)+(_0x5e4459(0xfb)+formatElapsed(_0x203c47[_0x5e4459(0x104)][_0x5e4459(0x100)])+_0xacfd3));if(_0x41b348&&_0xc3452d){const _0x42d32c=resolveOutputOptions(_0x30d064),_0x20dbaf=await formatQueryOutput(_0x203c47,_0x42d32c);_0x13d722[_0x5e4459(0xe5)](_0x20dbaf);}else await handleQueryOutput(_0x203c47,_0x30d064);}catch(_0x127ec7){const _0x4682f2=_0x41b348?'Statement\x20'+_0x5808b3+'/'+_0x356c20+':\x0a':'',_0x3875bb=_0x127ec7 instanceof SDKError?_0x127ec7[_0x5e4459(0x105)]:_0x127ec7[_0x5e4459(0xed)];return console[_0x5e4459(0xf7)](''+_0x4682f2+_0x3875bb),0x1;}}if(_0x375efa[_0x5e4459(0xec)]>0x1&&_0xc3452d&&_0x13d722[_0x5e4459(0xec)]>0x0){const _0xb7e573=_0x13d722[_0x5e4459(0x10b)]('\x0a');writeFileSync(_0x30d064[_0x5e4459(0xee)],_0xb7e573),console[_0x5e4459(0xf7)](_0x5e4459(0x111)+_0x30d064[_0x5e4459(0xee)]);}return 0x0;}catch(_0x166a27){throw _0x166a27;}}['validate'](_0x3915a1){const _0x43f990=a22_0x107356,_0xc3515b=_0x3915a1[_0x43f990(0x11b)][0x0],_0x5bceb3=_0x3915a1[_0x43f990(0x112)][_0x43f990(0xf0)];if(!_0xc3515b&&!_0x5bceb3)return _0x43f990(0x101);if(_0xc3515b&&_0x5bceb3)return _0x43f990(0x117);return undefined;}}
@@ -1 +1 @@
1
- const a23_0x3e213e=a23_0x4b7e;function a23_0x4b7e(_0x24336d,_0x2afc19){const _0xf450b2=a23_0xf450();return a23_0x4b7e=function(_0x4b7e4b,_0x572c13){_0x4b7e4b=_0x4b7e4b-0x1ed;let _0x3c939d=_0xf450b2[_0x4b7e4b];return _0x3c939d;},a23_0x4b7e(_0x24336d,_0x2afc19);}(function(_0x2b7188,_0xbcd18a){const _0x247973=a23_0x4b7e,_0x225dc3=_0x2b7188();while(!![]){try{const _0x276d64=parseInt(_0x247973(0x217))/0x1+parseInt(_0x247973(0x227))/0x2*(parseInt(_0x247973(0x1ef))/0x3)+parseInt(_0x247973(0x20c))/0x4+-parseInt(_0x247973(0x22b))/0x5+parseInt(_0x247973(0x212))/0x6+parseInt(_0x247973(0x251))/0x7*(parseInt(_0x247973(0x23e))/0x8)+parseInt(_0x247973(0x25a))/0x9*(-parseInt(_0x247973(0x239))/0xa);if(_0x276d64===_0xbcd18a)break;else _0x225dc3['push'](_0x225dc3['shift']());}catch(_0x3cb30b){_0x225dc3['push'](_0x225dc3['shift']());}}}(a23_0xf450,0xdc9d3));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a23_0xf450(){const _0x440596=['Fetching\x20parent\x20segment\x20details...','resolveParentId','✔\x20Found\x20','resolvePathToResource','segment','Create\x20segment\x20folder\x20for\x20organization','✖\x20Query\x20failed\x20[','cause','439515OEZUZQ','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','segment:show','Usage:\x20tdx\x20segment\x20sql\x20<path>','Creating\x20folder\x20\x27','createFolder','elapsedTimeMillis','Resolved\x20parent\x20folder\x20ID:\x20','listFolders','\x20\x20Cause:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','1636773AMBahh','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','replace','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','json','parent','Folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','getParentSQL','execute','limit','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','data','information_schema','parentFolder','segment:folder:list','stats','Resolved\x20type:\x20','Fetching\x20segment\x20details...','Parent\x20name:\x20','Fetching\x20SQL\x20for\x20parent\x20segment...','log','segmentPath','verbose','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Folder\x20ID\x20missing\x20from\x20resolved\x20path','7010384kwhQej','segment:sql','Executing\x20segment\x20query...','\x20rows\x20','site','Resolved\x20folder\x20ID:\x20','8749266XhbpAR','code','Resolved\x20relative\x20path\x20to:\x20','getSegment','Examples:','1746112cEjduq','name','message','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','parentId','Folder\x20name:\x20','Resolving\x20path\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','type','\x27...','INTERNAL','includes','Parent\x20ID:\x20','\x20[Job\x20ID:\x20','2qlCOsG','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','resolveFolderId','Resolving\x20folder\x20\x27','8253395WaiQwC','format','trim','query','length','Resolving\x20parent\x20segment\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22','setJobId','\x20folder','SQL\x20query:\x0a','Error:\x20','getSegmentSQL','950iGZOCk','Show\x20segment\x20folder\x20details','segment:describe','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20show\x20<path>','88PMOTKJ','getFolder','Error:\x20Path\x20or\x20name\x20is\x20required','error','Parent\x20segment:\x20','Resolved\x20parent\x20ID:\x20','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','SELECT\x20*\x20FROM\x20(\x0a','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folder','description','segmentId','in\x20','jsonl','segment:folder:show','folderId','processedRows','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','1076173BFJWhY'];a23_0xf450=function(){return _0x440596;};return a23_0xf450();}export class SegmentDescribeCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x23b);[a23_0x3e213e(0x249)]='Show\x20segment\x20or\x20folder\x20details';async[a23_0x3e213e(0x1f9)](_0x215a2a){const _0x2d3a3b=a23_0x3e213e,{options:_0x416a24,args:_0x15271e,tdx:_0x4c406a}=_0x215a2a;if(_0x15271e['length']===0x0)return console[_0x2d3a3b(0x241)](_0x2d3a3b(0x240)),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x1ee)),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x216)),console['error'](_0x2d3a3b(0x1f0)),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x247)),console[_0x2d3a3b(0x241)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x40f754=_0x15271e[0x0],_0x40b289=_0x416a24[_0x2d3a3b(0x207)];let _0x1b2465=_0x40f754;_0x40b289&&!_0x40f754[_0x2d3a3b(0x224)]('/')&&(_0x1b2465=_0x40b289+'/'+_0x40f754,_0x416a24[_0x2d3a3b(0x208)]&&console['error'](_0x2d3a3b(0x214)+_0x1b2465));const _0x3076b3=await withSpinner(_0x2d3a3b(0x21f)+_0x1b2465+_0x2d3a3b(0x222),()=>_0x4c406a['segment'][_0x2d3a3b(0x255)](_0x1b2465),{'verbose':_0x416a24[_0x2d3a3b(0x208)]}),_0xe05657=_0x3076b3[_0x2d3a3b(0x1fd)];_0x416a24[_0x2d3a3b(0x208)]&&(console['error']('Resolved\x20type:\x20'+_0xe05657['type']),console[_0x2d3a3b(0x241)](_0x2d3a3b(0x225)+_0xe05657[_0x2d3a3b(0x21d)]),_0xe05657[_0x2d3a3b(0x24e)]&&console[_0x2d3a3b(0x241)](_0x2d3a3b(0x1f6)+_0xe05657[_0x2d3a3b(0x24e)]),_0xe05657[_0x2d3a3b(0x24a)]&&console[_0x2d3a3b(0x241)]('Segment\x20ID:\x20'+_0xe05657['segmentId']));if(_0xe05657[_0x2d3a3b(0x221)]===_0x2d3a3b(0x1f5)){const _0x37319f=await withSpinner(_0x2d3a3b(0x252),()=>_0x4c406a[_0x2d3a3b(0x256)]['getParent'](_0xe05657[_0x2d3a3b(0x21d)]),{'verbose':_0x416a24['verbose']});await handleSDKOutput([_0x37319f[_0x2d3a3b(0x1fd)]],_0x416a24);}else{if(_0xe05657[_0x2d3a3b(0x221)]===_0x2d3a3b(0x248)){if(!_0xe05657[_0x2d3a3b(0x24e)])throw new SDKError(ErrorCode['INTERNAL'],_0x2d3a3b(0x20b));const _0x19477c=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4c406a['segment'][_0x2d3a3b(0x23f)](_0xe05657[_0x2d3a3b(0x24e)]),{'verbose':_0x416a24['verbose']});await handleSDKOutput([_0x19477c[_0x2d3a3b(0x1fd)]],_0x416a24);}else{if(_0xe05657['type']===_0x2d3a3b(0x256)){if(!_0xe05657[_0x2d3a3b(0x24a)])throw new SDKError(ErrorCode['INTERNAL'],_0x2d3a3b(0x20a));const _0x18a418=await withSpinner(_0x2d3a3b(0x203),()=>_0x4c406a[_0x2d3a3b(0x256)][_0x2d3a3b(0x215)](_0xe05657[_0x2d3a3b(0x21d)],_0xe05657[_0x2d3a3b(0x24a)]),{'verbose':_0x416a24[_0x2d3a3b(0x208)]});await handleSDKOutput([_0x18a418[_0x2d3a3b(0x1fd)]],_0x416a24);}}}return 0x0;}catch(_0x621d01){if(_0x621d01 instanceof SDKError)return console[_0x2d3a3b(0x241)](_0x2d3a3b(0x237)+_0x621d01[_0x2d3a3b(0x219)]),_0x621d01[_0x2d3a3b(0x259)]&&console[_0x2d3a3b(0x241)](_0x2d3a3b(0x1ed)+_0x621d01['cause']),0x1;throw _0x621d01;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x25c);[a23_0x3e213e(0x249)]=a23_0x3e213e(0x244);async['execute'](_0x525a49){const _0x509524=a23_0x3e213e,{options:_0x382e5f,args:_0x1d2df0,tdx:_0x67a05d}=_0x525a49;if(_0x1d2df0[_0x509524(0x22f)]===0x0)return console[_0x509524(0x241)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x509524(0x241)](_0x509524(0x23d)),console[_0x509524(0x241)]('Examples:'),console[_0x509524(0x241)](_0x509524(0x233)),console[_0x509524(0x241)]('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x509524(0x241)](_0x509524(0x21a)),0x1;try{const _0x1990ce=_0x1d2df0[0x0],_0x2e228a=_0x382e5f[_0x509524(0x207)];let _0x441039=_0x1990ce;_0x2e228a&&!_0x1990ce[_0x509524(0x224)]('/')&&(_0x441039=_0x2e228a+'/'+_0x1990ce,_0x382e5f[_0x509524(0x208)]&&console['error'](_0x509524(0x214)+_0x441039));const _0x5699ad=await withSpinner(_0x509524(0x21f)+_0x441039+_0x509524(0x222),()=>_0x67a05d[_0x509524(0x256)][_0x509524(0x255)](_0x441039),{'verbose':_0x382e5f[_0x509524(0x208)]}),_0x4210f3=_0x5699ad['data'];_0x382e5f[_0x509524(0x208)]&&(console['error'](_0x509524(0x202)+_0x4210f3[_0x509524(0x221)]),console[_0x509524(0x241)](_0x509524(0x225)+_0x4210f3[_0x509524(0x21d)]));if(_0x4210f3[_0x509524(0x221)]===_0x509524(0x248))return console[_0x509524(0x241)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x509524(0x241)](_0x509524(0x21c)),0x1;let _0x23bbd5;if(_0x4210f3['type']===_0x509524(0x1f5)){const _0x29c2ed=await withSpinner(_0x509524(0x205),()=>_0x67a05d[_0x509524(0x256)][_0x509524(0x1f8)](_0x4210f3[_0x509524(0x21d)]),{'verbose':_0x382e5f['verbose']});_0x23bbd5=_0x29c2ed['data'];}else{if(!_0x4210f3[_0x509524(0x24a)])throw new SDKError(ErrorCode[_0x509524(0x223)],_0x509524(0x20a));const _0x3e6d24=await withSpinner(_0x509524(0x1f2),()=>_0x67a05d['segment'][_0x509524(0x238)](_0x4210f3[_0x509524(0x21d)],_0x4210f3[_0x509524(0x24a)]),{'verbose':_0x382e5f[_0x509524(0x208)]});_0x23bbd5=_0x3e6d24['data'];}const _0x5c77f3=resolveLimit(_0x382e5f[_0x509524(0x1fa)],DEFAULT_DISPLAY_LIMIT),_0x254abf=/\bLIMIT\s+\d+/i['test'](_0x23bbd5);!_0x254abf&&(_0x23bbd5=_0x23bbd5[_0x509524(0x22d)]()[_0x509524(0x1f1)](/;+$/,''),_0x23bbd5=_0x509524(0x245)+_0x23bbd5+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5c77f3);_0x382e5f[_0x509524(0x208)]&&console['error'](_0x509524(0x236)+_0x23bbd5);const _0xeab6ef=await withQuerySpinner(_0x509524(0x20e),async _0x1eb133=>{const _0xe8595d=_0x509524,_0x1c9c2f=await _0x67a05d[_0xe8595d(0x22e)][_0xe8595d(0x1f9)](_0x23bbd5,{'catalog':'td','schema':_0xe8595d(0x1fe),'onJobId':_0x380cdb=>{const _0x181c6d=_0xe8595d;_0x1eb133[_0x181c6d(0x234)](_0x380cdb);}});return _0x1c9c2f;},{'verbose':_0x382e5f[_0x509524(0x208)]}),_0x54244c=_0xeab6ef[_0x509524(0x1fd)],_0x5d9aa9=_0x54244c['jobId']?_0x509524(0x226)+_0x54244c['jobId']+']':'';return console[_0x509524(0x241)](_0x509524(0x220)+_0x54244c[_0x509524(0x201)][_0x509524(0x24f)]['toLocaleString']()+_0x509524(0x20f)+(_0x509524(0x24b)+formatElapsed(_0x54244c['stats'][_0x509524(0x260)])+_0x5d9aa9)),await handleQueryOutput(_0x54244c,_0x382e5f),0x0;}catch(_0x272607){if(_0x272607 instanceof SDKError)return console['error'](_0x509524(0x258)+_0x272607[_0x509524(0x213)]+']'),console[_0x509524(0x241)]('\x0a'+_0x272607[_0x509524(0x219)]),0x1;throw _0x272607;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x200);[a23_0x3e213e(0x249)]=a23_0x3e213e(0x1fc);async['execute'](_0x4d729e){const _0x12225a=a23_0x3e213e,{options:_0x37c974,args:_0x2b3861,tdx:_0x5e65e3}=_0x4d729e;if(_0x2b3861[_0x12225a(0x22f)]===0x0)return console['error'](_0x12225a(0x23c)),console[_0x12225a(0x241)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x15da0e=_0x2b3861[0x0];try{_0x37c974['verbose']&&(console[_0x12225a(0x241)](_0x12225a(0x232)+_0x37c974[_0x12225a(0x210)]),console[_0x12225a(0x241)](_0x12225a(0x204)+_0x15da0e));const _0x370c5d=await withSpinner(_0x12225a(0x230)+_0x15da0e+_0x12225a(0x222),()=>_0x5e65e3[_0x12225a(0x256)][_0x12225a(0x253)](_0x15da0e),{'verbose':_0x37c974['verbose']}),_0x4ab582=_0x370c5d[_0x12225a(0x1fd)];_0x37c974[_0x12225a(0x208)]&&console[_0x12225a(0x241)](_0x12225a(0x243)+_0x4ab582);const _0x23fd43=await withSpinner(_0x12225a(0x231)+_0x15da0e+'\x27...',()=>_0x5e65e3['segment'][_0x12225a(0x262)](_0x4ab582),{'verbose':_0x37c974[_0x12225a(0x208)]}),_0x40bf6d=_0x23fd43[_0x12225a(0x1fd)];return console[_0x12225a(0x241)](_0x12225a(0x254)+_0x40bf6d[_0x12225a(0x22f)]+_0x12225a(0x235)+(_0x40bf6d[_0x12225a(0x22f)]!==0x1?'s':'')),await handleSDKOutput(_0x40bf6d,_0x37c974),0x0;}catch(_0x59ba4f){if(_0x59ba4f instanceof SDKError)return console[_0x12225a(0x241)](_0x12225a(0x237)+_0x59ba4f[_0x12225a(0x219)]),_0x59ba4f[_0x12225a(0x259)]&&console[_0x12225a(0x241)](_0x12225a(0x1ed)+_0x59ba4f[_0x12225a(0x259)]),0x1;throw _0x59ba4f;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x24d);[a23_0x3e213e(0x249)]=a23_0x3e213e(0x23a);async[a23_0x3e213e(0x1f9)](_0x371f36){const _0x2dad99=a23_0x3e213e,{options:_0x698d67,args:_0x4fddfc,tdx:_0x2dbca9}=_0x371f36;if(_0x4fddfc[_0x2dad99(0x22f)]===0x0)return console[_0x2dad99(0x241)](_0x2dad99(0x21b)),console[_0x2dad99(0x241)](_0x2dad99(0x1f7)),0x1;try{const {parentId:_0x17dd56,childId:_0x45b978}=parseSegmentRef(_0x4fddfc[0x0]);_0x698d67['verbose']&&(console[_0x2dad99(0x241)](_0x2dad99(0x232)+_0x698d67['site']),console[_0x2dad99(0x241)](_0x2dad99(0x204)+_0x17dd56),_0x45b978&&console[_0x2dad99(0x241)](_0x2dad99(0x21e)+_0x45b978));if(!_0x45b978)return console[_0x2dad99(0x241)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x3de28c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x17dd56+_0x2dad99(0x222),()=>_0x2dbca9['segment'][_0x2dad99(0x253)](_0x17dd56),{'verbose':_0x698d67['verbose']}),_0x9742d=_0x3de28c['data'];_0x698d67['verbose']&&console[_0x2dad99(0x241)]('Resolved\x20parent\x20ID:\x20'+_0x9742d);const _0x4aba10=await withSpinner(_0x2dad99(0x22a)+_0x45b978+'\x27...',()=>_0x2dbca9['segment'][_0x2dad99(0x229)](_0x9742d,_0x45b978),{'verbose':_0x698d67[_0x2dad99(0x208)]}),_0x447a45=_0x4aba10[_0x2dad99(0x1fd)];_0x698d67['verbose']&&console[_0x2dad99(0x241)](_0x2dad99(0x211)+_0x447a45);const _0x1b35ba=await withSpinner('Fetching\x20folder\x20\x27'+_0x45b978+'\x27...',()=>_0x2dbca9[_0x2dad99(0x256)][_0x2dad99(0x23f)](_0x447a45),{'verbose':_0x698d67[_0x2dad99(0x208)]});return await handleSDKOutput([_0x1b35ba[_0x2dad99(0x1fd)]],_0x698d67),0x0;}catch(_0x57e6d0){if(_0x57e6d0 instanceof SDKError)return console[_0x2dad99(0x241)](_0x2dad99(0x237)+_0x57e6d0[_0x2dad99(0x219)]),_0x57e6d0[_0x2dad99(0x259)]&&console['error'](_0x2dad99(0x1ed)+_0x57e6d0[_0x2dad99(0x259)]),0x1;throw _0x57e6d0;}}}export class SegmentSQLCommand extends BaseCommand{[a23_0x3e213e(0x218)]=a23_0x3e213e(0x20d);['description']=a23_0x3e213e(0x209);async[a23_0x3e213e(0x1f9)](_0x1e717d){const _0x507432=a23_0x3e213e,{options:_0x28627e,args:_0x308e6b,tdx:_0x497630}=_0x1e717d;if(_0x308e6b[_0x507432(0x22f)]===0x0)return console['error'](_0x507432(0x1fb)),console[_0x507432(0x241)](_0x507432(0x25d)),console['error'](_0x507432(0x216)),console[_0x507432(0x241)]('\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22'),console[_0x507432(0x241)](_0x507432(0x1f3)),console['error']('\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),0x1;try{const _0x29942d=_0x308e6b[0x0],_0x1be7fc=_0x28627e[_0x507432(0x207)];let _0x1e9411=_0x29942d;_0x1be7fc&&!_0x29942d[_0x507432(0x224)]('/')&&(_0x1e9411=_0x1be7fc+'/'+_0x29942d,_0x28627e[_0x507432(0x208)]&&console[_0x507432(0x241)](_0x507432(0x214)+_0x1e9411));const _0x3b5089=await withSpinner(_0x507432(0x21f)+_0x1e9411+'\x27...',()=>_0x497630[_0x507432(0x256)][_0x507432(0x255)](_0x1e9411),{'verbose':_0x28627e['verbose']}),_0x56e538=_0x3b5089[_0x507432(0x1fd)];_0x28627e[_0x507432(0x208)]&&(console[_0x507432(0x241)](_0x507432(0x202)+_0x56e538[_0x507432(0x221)]),console[_0x507432(0x241)](_0x507432(0x225)+_0x56e538[_0x507432(0x21d)]));if(_0x56e538[_0x507432(0x221)]==='folder')return console[_0x507432(0x241)](_0x507432(0x25b)),console[_0x507432(0x241)](_0x507432(0x246)),0x1;let _0x60f1c0;if(_0x56e538[_0x507432(0x221)]===_0x507432(0x1f5)){const _0x335d11=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0x497630['segment'][_0x507432(0x1f8)](_0x56e538[_0x507432(0x21d)]),{'verbose':_0x28627e[_0x507432(0x208)]});_0x60f1c0=_0x335d11[_0x507432(0x1fd)];}else{if(!_0x56e538[_0x507432(0x24a)])throw new SDKError(ErrorCode[_0x507432(0x223)],_0x507432(0x20a));const _0x4c96fa=await withSpinner(_0x507432(0x1f2),()=>_0x497630['segment'][_0x507432(0x238)](_0x56e538[_0x507432(0x21d)],_0x56e538['segmentId']),{'verbose':_0x28627e[_0x507432(0x208)]});_0x60f1c0=_0x4c96fa[_0x507432(0x1fd)];}return _0x28627e[_0x507432(0x22c)]===_0x507432(0x1f4)||_0x28627e[_0x507432(0x22c)]===_0x507432(0x24c)?await handleSDKOutput([{'sql':_0x60f1c0}],_0x28627e):console[_0x507432(0x206)](_0x60f1c0),0x0;}catch(_0x43ea05){if(_0x43ea05 instanceof SDKError)return console[_0x507432(0x241)](_0x507432(0x237)+_0x43ea05[_0x507432(0x219)]),_0x43ea05[_0x507432(0x259)]&&console[_0x507432(0x241)]('\x20\x20Cause:\x20'+_0x43ea05[_0x507432(0x259)]),0x1;throw _0x43ea05;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x3e213e(0x218)]='segment:folder:create';[a23_0x3e213e(0x249)]=a23_0x3e213e(0x257);async['execute'](_0x2a21b3){const _0x2d0d66=a23_0x3e213e,{options:_0x3ca8da,args:_0x43091b,tdx:_0x4899f6}=_0x2a21b3,_0x498ce7=_0x3ca8da;if(_0x43091b['length']<0x2)return console[_0x2d0d66(0x241)](_0x2d0d66(0x250)),console[_0x2d0d66(0x241)](_0x2d0d66(0x228)),0x1;const _0x4e9f11=_0x43091b[0x0],_0x26bede=_0x43091b[0x1];_0x498ce7[_0x2d0d66(0x208)]&&(console[_0x2d0d66(0x241)](_0x2d0d66(0x232)+_0x498ce7[_0x2d0d66(0x210)]),console['error'](_0x2d0d66(0x242)+_0x4e9f11),console[_0x2d0d66(0x241)]('Folder\x20name:\x20'+_0x26bede));let _0x108872;if(_0x498ce7[_0x2d0d66(0x1ff)]){const _0x35945c=_0x498ce7['parentFolder'],_0x55fa55=await withSpinner(_0x2d0d66(0x230)+_0x4e9f11+'\x27...',()=>_0x4899f6[_0x2d0d66(0x256)][_0x2d0d66(0x253)](_0x4e9f11),{'verbose':_0x498ce7[_0x2d0d66(0x208)]}),_0x200da4=_0x55fa55[_0x2d0d66(0x1fd)],_0x4bafff=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x35945c+_0x2d0d66(0x222),()=>_0x4899f6[_0x2d0d66(0x256)][_0x2d0d66(0x229)](_0x200da4,_0x35945c),{'verbose':_0x498ce7[_0x2d0d66(0x208)]});_0x108872=_0x4bafff['data'],_0x498ce7['verbose']&&console[_0x2d0d66(0x241)](_0x2d0d66(0x261)+_0x108872);}const _0x205d7f={'name':_0x26bede,'description':_0x498ce7[_0x2d0d66(0x249)],'parentFolderId':_0x108872},_0x56de02=await withSpinner(_0x2d0d66(0x25e)+_0x26bede+_0x2d0d66(0x222),()=>_0x4899f6[_0x2d0d66(0x256)][_0x2d0d66(0x25f)](_0x4e9f11,_0x205d7f),{'verbose':_0x498ce7[_0x2d0d66(0x208)]}),_0x242346=_0x56de02[_0x2d0d66(0x1fd)];return console[_0x2d0d66(0x241)]('✔\x20Created\x20folder\x20\x27'+_0x242346['name']+'\x27\x20with\x20ID:\x20'+_0x242346['id']),await handleSDKOutput([_0x242346],_0x498ce7),0x0;}}
1
+ const a23_0x1a3ecf=a23_0x2382;(function(_0x388af2,_0x540775){const _0x4e2a47=a23_0x2382,_0x35b6c9=_0x388af2();while(!![]){try{const _0x54f882=-parseInt(_0x4e2a47(0x1c5))/0x1*(parseInt(_0x4e2a47(0x1e5))/0x2)+-parseInt(_0x4e2a47(0x1c3))/0x3+parseInt(_0x4e2a47(0x1fb))/0x4+-parseInt(_0x4e2a47(0x210))/0x5*(-parseInt(_0x4e2a47(0x1dd))/0x6)+-parseInt(_0x4e2a47(0x1f1))/0x7+parseInt(_0x4e2a47(0x213))/0x8*(parseInt(_0x4e2a47(0x1d6))/0x9)+parseInt(_0x4e2a47(0x1c1))/0xa;if(_0x54f882===_0x540775)break;else _0x35b6c9['push'](_0x35b6c9['shift']());}catch(_0x52646b){_0x35b6c9['push'](_0x35b6c9['shift']());}}}(a23_0x45c7,0x19a17));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 a23_0x2382(_0x25798a,_0x414290){const _0x45c7c8=a23_0x45c7();return a23_0x2382=function(_0x23826d,_0x380c56){_0x23826d=_0x23826d-0x1a8;let _0x49c574=_0x45c7c8[_0x23826d];return _0x49c574;},a23_0x2382(_0x25798a,_0x414290);}import{parseSegmentRef}from'../utils/segment-ref-parser.js';function a23_0x45c7(){const _0x1b200f=['Fetching\x20folder\x20details...','\x20rows\x20','name','Fetching\x20folder\x20\x27','\x20\x20Cause:\x20','segment:show','Resolved\x20type:\x20','807050pciiVX','getSegmentSQL','68052MJEoUU','data','182491AyODjb','description','includes','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Examples:','folder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','parentFolder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20SQL\x20for\x20parent\x20segment...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Folder\x20reference\x20is\x20required','segment:sql','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Site:\x20','\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience/Marketing/High\x20Value\x22','4329blIHVa','INTERNAL','segment','Segment\x20ID:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience/Marketing/High\x20Value\x22','error','elapsedTimeMillis','156168KIOGwz','\x20folder','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segment:folder:create','getSegment','Error:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','2miAWsT','Show\x20segment\x20folder\x20details','setJobId','Resolving\x20folder\x20\x27','Execute\x20segment\x20SQL\x20query\x20and\x20show\x20results','Folder\x20ID:\x20','folderId','Resolving\x20parent\x20folder\x20\x27','length','parent','\x20\x20tdx\x20segment\x20show\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Parent\x20segment:\x20','530236qltTal','✔\x20Found\x20','test','Resolving\x20path\x20\x27','Folder\x20name:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','createFolder','Listing\x20folders\x20for\x20parent\x20\x27','Executing\x20segment\x20query...','Fetching\x20SQL\x20for\x20segment...','408012qKDmlg','parentId','segmentPath','json','Show\x20segment\x20or\x20folder\x20details','type','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentId','listFolders','jobId','in\x20','replace','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20describe\x20<path>','Fetching\x20segment\x20details...','execute','Resolved\x20parent\x20ID:\x20','\x27\x20with\x20ID:\x20','stats','Use:\x20tdx\x20segment\x20describe\x20<path>\x20\x20#\x20To\x20show\x20folder\x20details','Get\x20SQL\x20query\x20for\x20parent\x20or\x20child\x20segment','20XhkTRl','format','information_schema','1648zXUejB','\x27...','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','✖\x20Query\x20failed\x20[','verbose','\x20[Job\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20sql\x20\x22My\x20Audience\x22','jsonl','Parent\x20ID:\x20','site','✔\x20Query\x20completed:\x20Processed\x20','cause','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','✔\x20Created\x20folder\x20\x27','getFolder','\x20\x20tdx\x20segment\x20sql\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SELECT\x20*\x20FROM\x20(\x0a','processedRows','getParent','Usage:\x20tdx\x20segment\x20show\x20<path>','resolvePathToResource','SQL\x20query:\x0a','code','message','Usage:\x20tdx\x20segment\x20sql\x20<path>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment:describe','resolveParentId','segment:folder:show'];a23_0x45c7=function(){return _0x1b200f;};return a23_0x45c7();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class SegmentDescribeCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1b7);[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1ff);async[a23_0x1a3ecf(0x20a)](_0x57ecec){const _0xdbc49c=a23_0x1a3ecf,{options:_0x265c13,args:_0x5a38d6,tdx:_0x48c842}=_0x57ecec;if(_0x5a38d6[_0xdbc49c(0x1ed)]===0x0)return console[_0xdbc49c(0x1db)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0xdbc49c(0x1db)](_0xdbc49c(0x208)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x1c9)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x1cf)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x201)),console[_0xdbc49c(0x1db)](_0xdbc49c(0x1c8)),0x1;try{const _0x22a5f2=_0x5a38d6[0x0],_0x3fb241=_0x265c13[_0xdbc49c(0x1fd)];let _0xc60bc0=_0x22a5f2;_0x3fb241&&!_0x22a5f2['includes']('/')&&(_0xc60bc0=_0x3fb241+'/'+_0x22a5f2,_0x265c13['verbose']&&console[_0xdbc49c(0x1db)]('Resolved\x20relative\x20path\x20to:\x20'+_0xc60bc0));const _0xf7adea=await withSpinner('Resolving\x20path\x20\x27'+_0xc60bc0+_0xdbc49c(0x214),()=>_0x48c842['segment'][_0xdbc49c(0x1b1)](_0xc60bc0),{'verbose':_0x265c13[_0xdbc49c(0x217)]}),_0x5c24dc=_0xf7adea['data'];_0x265c13[_0xdbc49c(0x217)]&&(console[_0xdbc49c(0x1db)](_0xdbc49c(0x1c0)+_0x5c24dc[_0xdbc49c(0x200)]),console[_0xdbc49c(0x1db)](_0xdbc49c(0x21c)+_0x5c24dc['parentId']),_0x5c24dc[_0xdbc49c(0x1eb)]&&console['error'](_0xdbc49c(0x1ea)+_0x5c24dc[_0xdbc49c(0x1eb)]),_0x5c24dc['segmentId']&&console['error'](_0xdbc49c(0x1d9)+_0x5c24dc[_0xdbc49c(0x202)]));if(_0x5c24dc[_0xdbc49c(0x200)]==='parent'){const _0x5ef62b=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x48c842[_0xdbc49c(0x1d8)][_0xdbc49c(0x1af)](_0x5c24dc['parentId']),{'verbose':_0x265c13['verbose']});await handleSDKOutput([_0x5ef62b['data']],_0x265c13);}else{if(_0x5c24dc[_0xdbc49c(0x200)]===_0xdbc49c(0x1ca)){if(!_0x5c24dc[_0xdbc49c(0x1eb)])throw new SDKError(ErrorCode[_0xdbc49c(0x1d7)],_0xdbc49c(0x1cb));const _0xbc6bed=await withSpinner(_0xdbc49c(0x1ba),()=>_0x48c842[_0xdbc49c(0x1d8)][_0xdbc49c(0x1ab)](_0x5c24dc[_0xdbc49c(0x1eb)]),{'verbose':_0x265c13[_0xdbc49c(0x217)]});await handleSDKOutput([_0xbc6bed[_0xdbc49c(0x1c4)]],_0x265c13);}else{if(_0x5c24dc['type']===_0xdbc49c(0x1d8)){if(!_0x5c24dc[_0xdbc49c(0x202)])throw new SDKError(ErrorCode[_0xdbc49c(0x1d7)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x295749=await withSpinner(_0xdbc49c(0x209),()=>_0x48c842[_0xdbc49c(0x1d8)][_0xdbc49c(0x1e1)](_0x5c24dc['parentId'],_0x5c24dc[_0xdbc49c(0x202)]),{'verbose':_0x265c13[_0xdbc49c(0x217)]});await handleSDKOutput([_0x295749[_0xdbc49c(0x1c4)]],_0x265c13);}}}return 0x0;}catch(_0x33db79){if(_0x33db79 instanceof SDKError)return console[_0xdbc49c(0x1db)](_0xdbc49c(0x1e2)+_0x33db79[_0xdbc49c(0x1b4)]),_0x33db79['cause']&&console[_0xdbc49c(0x1db)](_0xdbc49c(0x1be)+_0x33db79[_0xdbc49c(0x1a8)]),0x1;throw _0x33db79;}}}export class SegmentShowCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1bf);[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1e9);async[a23_0x1a3ecf(0x20a)](_0x42e6df){const _0x544360=a23_0x1a3ecf,{options:_0x231f19,args:_0x1e933f,tdx:_0x401468}=_0x42e6df;if(_0x1e933f[_0x544360(0x1ed)]===0x0)return console[_0x544360(0x1db)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x544360(0x1db)](_0x544360(0x1b0)),console[_0x544360(0x1db)](_0x544360(0x1c9)),console['error']('\x20\x20tdx\x20segment\x20show\x20\x22My\x20Audience\x22'),console['error'](_0x544360(0x1d5)),console[_0x544360(0x1db)](_0x544360(0x1ef)),0x1;try{const _0x13c6af=_0x1e933f[0x0],_0x168d73=_0x231f19[_0x544360(0x1fd)];let _0x1526fd=_0x13c6af;_0x168d73&&!_0x13c6af['includes']('/')&&(_0x1526fd=_0x168d73+'/'+_0x13c6af,_0x231f19['verbose']&&console[_0x544360(0x1db)](_0x544360(0x219)+_0x1526fd));const _0x4e4843=await withSpinner(_0x544360(0x1f4)+_0x1526fd+_0x544360(0x214),()=>_0x401468['segment'][_0x544360(0x1b1)](_0x1526fd),{'verbose':_0x231f19[_0x544360(0x217)]}),_0x140c9e=_0x4e4843[_0x544360(0x1c4)];_0x231f19[_0x544360(0x217)]&&(console['error'](_0x544360(0x1c0)+_0x140c9e['type']),console[_0x544360(0x1db)](_0x544360(0x21c)+_0x140c9e[_0x544360(0x1fc)]));if(_0x140c9e[_0x544360(0x200)]===_0x544360(0x1ca))return console[_0x544360(0x1db)](_0x544360(0x1f6)),console['error'](_0x544360(0x20e)),0x1;let _0xdb9b94;if(_0x140c9e[_0x544360(0x200)]==='parent'){const _0x1d6aa6=await withSpinner(_0x544360(0x1ce),()=>_0x401468[_0x544360(0x1d8)]['getParentSQL'](_0x140c9e['parentId']),{'verbose':_0x231f19[_0x544360(0x217)]});_0xdb9b94=_0x1d6aa6[_0x544360(0x1c4)];}else{if(!_0x140c9e[_0x544360(0x202)])throw new SDKError(ErrorCode[_0x544360(0x1d7)],_0x544360(0x1b6));const _0xb52979=await withSpinner(_0x544360(0x1fa),()=>_0x401468[_0x544360(0x1d8)][_0x544360(0x1c2)](_0x140c9e[_0x544360(0x1fc)],_0x140c9e[_0x544360(0x202)]),{'verbose':_0x231f19['verbose']});_0xdb9b94=_0xb52979[_0x544360(0x1c4)];}const _0x280ac8=resolveLimit(_0x231f19['limit'],DEFAULT_DISPLAY_LIMIT),_0x412983=/\bLIMIT\s+\d+/i[_0x544360(0x1f3)](_0xdb9b94);!_0x412983&&(_0xdb9b94=_0xdb9b94['trim']()[_0x544360(0x206)](/;+$/,''),_0xdb9b94=_0x544360(0x1ad)+_0xdb9b94+_0x544360(0x1e3)+_0x280ac8);_0x231f19[_0x544360(0x217)]&&console[_0x544360(0x1db)](_0x544360(0x1b2)+_0xdb9b94);const _0x123635=await withQuerySpinner(_0x544360(0x1f9),async _0x49419d=>{const _0x5594f7=_0x544360,_0x542f39=await _0x401468['query'][_0x5594f7(0x20a)](_0xdb9b94,{'catalog':'td','schema':_0x5594f7(0x212),'onJobId':_0x531300=>{const _0x31a3ef=_0x5594f7;_0x49419d[_0x31a3ef(0x1e7)](_0x531300);}});return _0x542f39;},{'verbose':_0x231f19['verbose']}),_0x566bd7=_0x123635[_0x544360(0x1c4)],_0x14edc7=_0x566bd7[_0x544360(0x204)]?_0x544360(0x218)+_0x566bd7['jobId']+']':'';return console[_0x544360(0x1db)](_0x544360(0x21e)+_0x566bd7[_0x544360(0x20d)][_0x544360(0x1ae)]['toLocaleString']()+_0x544360(0x1bb)+(_0x544360(0x205)+formatElapsed(_0x566bd7[_0x544360(0x20d)][_0x544360(0x1dc)])+_0x14edc7)),await handleQueryOutput(_0x566bd7,_0x231f19),0x0;}catch(_0x37f90b){if(_0x37f90b instanceof SDKError)return console[_0x544360(0x1db)](_0x544360(0x216)+_0x37f90b[_0x544360(0x1b3)]+']'),console[_0x544360(0x1db)]('\x0a'+_0x37f90b['message']),0x1;throw _0x37f90b;}}}export class SegmentFolderListCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]='segment:folder:list';[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1e4);async[a23_0x1a3ecf(0x20a)](_0x2ede41){const _0x1f1c95=a23_0x1a3ecf,{options:_0x2c707b,args:_0xfc6d75,tdx:_0x2c518f}=_0x2ede41;if(_0xfc6d75[_0x1f1c95(0x1ed)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x1f1c95(0x1db)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x2bbbea=_0xfc6d75[0x0];try{_0x2c707b['verbose']&&(console['error'](_0x1f1c95(0x1d4)+_0x2c707b['site']),console[_0x1f1c95(0x1db)]('Parent\x20name:\x20'+_0x2bbbea));const _0x413370=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2bbbea+_0x1f1c95(0x214),()=>_0x2c518f[_0x1f1c95(0x1d8)]['resolveParentId'](_0x2bbbea),{'verbose':_0x2c707b['verbose']}),_0x32cd95=_0x413370[_0x1f1c95(0x1c4)];_0x2c707b[_0x1f1c95(0x217)]&&console['error'](_0x1f1c95(0x20b)+_0x32cd95);const _0x329cde=await withSpinner(_0x1f1c95(0x1f8)+_0x2bbbea+_0x1f1c95(0x214),()=>_0x2c518f['segment'][_0x1f1c95(0x203)](_0x32cd95),{'verbose':_0x2c707b[_0x1f1c95(0x217)]}),_0x18e49a=_0x329cde[_0x1f1c95(0x1c4)];return console['error'](_0x1f1c95(0x1f2)+_0x18e49a[_0x1f1c95(0x1ed)]+_0x1f1c95(0x1de)+(_0x18e49a[_0x1f1c95(0x1ed)]!==0x1?'s':'')),await handleSDKOutput(_0x18e49a,_0x2c707b),0x0;}catch(_0x5d10a6){if(_0x5d10a6 instanceof SDKError)return console['error']('Error:\x20'+_0x5d10a6[_0x1f1c95(0x1b4)]),_0x5d10a6[_0x1f1c95(0x1a8)]&&console['error'](_0x1f1c95(0x1be)+_0x5d10a6[_0x1f1c95(0x1a8)]),0x1;throw _0x5d10a6;}}}export class SegmentFolderShowCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1b9);[a23_0x1a3ecf(0x1c6)]=a23_0x1a3ecf(0x1e6);async[a23_0x1a3ecf(0x20a)](_0x11270b){const _0x3b34a0=a23_0x1a3ecf,{options:_0x655433,args:_0x20ad35,tdx:_0x41ca9d}=_0x11270b;if(_0x20ad35[_0x3b34a0(0x1ed)]===0x0)return console['error'](_0x3b34a0(0x1d0)),console[_0x3b34a0(0x1db)](_0x3b34a0(0x1df)),0x1;try{const {parentId:_0x49917d,childId:_0x282ce7}=parseSegmentRef(_0x20ad35[0x0]);_0x655433[_0x3b34a0(0x217)]&&(console[_0x3b34a0(0x1db)](_0x3b34a0(0x1d4)+_0x655433[_0x3b34a0(0x21d)]),console['error']('Parent\x20name:\x20'+_0x49917d),_0x282ce7&&console['error'](_0x3b34a0(0x1f5)+_0x282ce7));if(!_0x282ce7)return console[_0x3b34a0(0x1db)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x474e11=await withSpinner(_0x3b34a0(0x207)+_0x49917d+_0x3b34a0(0x214),()=>_0x41ca9d[_0x3b34a0(0x1d8)]['resolveParentId'](_0x49917d),{'verbose':_0x655433[_0x3b34a0(0x217)]}),_0x1cd0a7=_0x474e11[_0x3b34a0(0x1c4)];_0x655433[_0x3b34a0(0x217)]&&console[_0x3b34a0(0x1db)](_0x3b34a0(0x20b)+_0x1cd0a7);const _0x5e4b3a=await withSpinner(_0x3b34a0(0x1e8)+_0x282ce7+_0x3b34a0(0x214),()=>_0x41ca9d[_0x3b34a0(0x1d8)]['resolveFolderId'](_0x1cd0a7,_0x282ce7),{'verbose':_0x655433[_0x3b34a0(0x217)]}),_0x9c0c03=_0x5e4b3a['data'];_0x655433[_0x3b34a0(0x217)]&&console[_0x3b34a0(0x1db)]('Resolved\x20folder\x20ID:\x20'+_0x9c0c03);const _0x529c5b=await withSpinner(_0x3b34a0(0x1bd)+_0x282ce7+_0x3b34a0(0x214),()=>_0x41ca9d['segment'][_0x3b34a0(0x1ab)](_0x9c0c03),{'verbose':_0x655433[_0x3b34a0(0x217)]});return await handleSDKOutput([_0x529c5b[_0x3b34a0(0x1c4)]],_0x655433),0x0;}catch(_0x2a5058){if(_0x2a5058 instanceof SDKError)return console['error'](_0x3b34a0(0x1e2)+_0x2a5058[_0x3b34a0(0x1b4)]),_0x2a5058[_0x3b34a0(0x1a8)]&&console['error'](_0x3b34a0(0x1be)+_0x2a5058[_0x3b34a0(0x1a8)]),0x1;throw _0x2a5058;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a23_0x1a3ecf(0x1d1);['description']=a23_0x1a3ecf(0x20f);async[a23_0x1a3ecf(0x20a)](_0x3c33e2){const _0x32404f=a23_0x1a3ecf,{options:_0x4c9c3c,args:_0x5b8463,tdx:_0xbad90e}=_0x3c33e2;if(_0x5b8463[_0x32404f(0x1ed)]===0x0)return console[_0x32404f(0x1db)](_0x32404f(0x1d3)),console[_0x32404f(0x1db)](_0x32404f(0x1b5)),console[_0x32404f(0x1db)](_0x32404f(0x1c9)),console['error'](_0x32404f(0x21a)),console[_0x32404f(0x1db)](_0x32404f(0x1da)),console['error'](_0x32404f(0x1ac)),0x1;try{const _0x211fba=_0x5b8463[0x0],_0x331053=_0x4c9c3c['segmentPath'];let _0x26066a=_0x211fba;_0x331053&&!_0x211fba[_0x32404f(0x1c7)]('/')&&(_0x26066a=_0x331053+'/'+_0x211fba,_0x4c9c3c['verbose']&&console['error'](_0x32404f(0x219)+_0x26066a));const _0x244823=await withSpinner(_0x32404f(0x1f4)+_0x26066a+'\x27...',()=>_0xbad90e[_0x32404f(0x1d8)][_0x32404f(0x1b1)](_0x26066a),{'verbose':_0x4c9c3c['verbose']}),_0x4a7537=_0x244823[_0x32404f(0x1c4)];_0x4c9c3c[_0x32404f(0x217)]&&(console['error'](_0x32404f(0x1c0)+_0x4a7537[_0x32404f(0x200)]),console[_0x32404f(0x1db)](_0x32404f(0x21c)+_0x4a7537[_0x32404f(0x1fc)]));if(_0x4a7537[_0x32404f(0x200)]===_0x32404f(0x1ca))return console[_0x32404f(0x1db)](_0x32404f(0x1a9)),console[_0x32404f(0x1db)](_0x32404f(0x1cd)),0x1;let _0x2d67e3;if(_0x4a7537['type']===_0x32404f(0x1ee)){const _0x2f3f2a=await withSpinner('Fetching\x20SQL\x20for\x20parent\x20segment...',()=>_0xbad90e[_0x32404f(0x1d8)]['getParentSQL'](_0x4a7537[_0x32404f(0x1fc)]),{'verbose':_0x4c9c3c[_0x32404f(0x217)]});_0x2d67e3=_0x2f3f2a[_0x32404f(0x1c4)];}else{if(!_0x4a7537[_0x32404f(0x202)])throw new SDKError(ErrorCode[_0x32404f(0x1d7)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x647717=await withSpinner(_0x32404f(0x1fa),()=>_0xbad90e[_0x32404f(0x1d8)]['getSegmentSQL'](_0x4a7537[_0x32404f(0x1fc)],_0x4a7537[_0x32404f(0x202)]),{'verbose':_0x4c9c3c['verbose']});_0x2d67e3=_0x647717['data'];}return _0x4c9c3c['format']===_0x32404f(0x1fe)||_0x4c9c3c[_0x32404f(0x211)]===_0x32404f(0x21b)?await handleSDKOutput([{'sql':_0x2d67e3}],_0x4c9c3c):console['log'](_0x2d67e3),0x0;}catch(_0x775ddc){if(_0x775ddc instanceof SDKError)return console['error'](_0x32404f(0x1e2)+_0x775ddc[_0x32404f(0x1b4)]),_0x775ddc['cause']&&console['error'](_0x32404f(0x1be)+_0x775ddc[_0x32404f(0x1a8)]),0x1;throw _0x775ddc;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a23_0x1a3ecf(0x1bc)]=a23_0x1a3ecf(0x1e0);['description']=a23_0x1a3ecf(0x1d2);async['execute'](_0x324010){const _0x48b92c=a23_0x1a3ecf,{options:_0x302475,args:_0x8b4590,tdx:_0x1b6a5a}=_0x324010,_0x155fe8=_0x302475;if(_0x8b4590['length']<0x2)return console[_0x48b92c(0x1db)](_0x48b92c(0x215)),console[_0x48b92c(0x1db)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x362fc2=_0x8b4590[0x0],_0x33733d=_0x8b4590[0x1];_0x155fe8['verbose']&&(console['error'](_0x48b92c(0x1d4)+_0x155fe8[_0x48b92c(0x21d)]),console['error'](_0x48b92c(0x1f0)+_0x362fc2),console[_0x48b92c(0x1db)]('Folder\x20name:\x20'+_0x33733d));let _0x22161f;if(_0x155fe8[_0x48b92c(0x1cc)]){const _0x391a09=_0x155fe8['parentFolder'],_0x467855=await withSpinner(_0x48b92c(0x207)+_0x362fc2+_0x48b92c(0x214),()=>_0x1b6a5a['segment'][_0x48b92c(0x1b8)](_0x362fc2),{'verbose':_0x155fe8[_0x48b92c(0x217)]}),_0xf577d7=_0x467855[_0x48b92c(0x1c4)],_0x105663=await withSpinner(_0x48b92c(0x1ec)+_0x391a09+_0x48b92c(0x214),()=>_0x1b6a5a[_0x48b92c(0x1d8)]['resolveFolderId'](_0xf577d7,_0x391a09),{'verbose':_0x155fe8[_0x48b92c(0x217)]});_0x22161f=_0x105663[_0x48b92c(0x1c4)],_0x155fe8['verbose']&&console[_0x48b92c(0x1db)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x22161f);}const _0x1d2d97={'name':_0x33733d,'description':_0x155fe8[_0x48b92c(0x1c6)],'parentFolderId':_0x22161f},_0x327530=await withSpinner('Creating\x20folder\x20\x27'+_0x33733d+'\x27...',()=>_0x1b6a5a[_0x48b92c(0x1d8)][_0x48b92c(0x1f7)](_0x362fc2,_0x1d2d97),{'verbose':_0x155fe8[_0x48b92c(0x217)]}),_0x673c03=_0x327530[_0x48b92c(0x1c4)];return console[_0x48b92c(0x1db)](_0x48b92c(0x1aa)+_0x673c03[_0x48b92c(0x1bc)]+_0x48b92c(0x20c)+_0x673c03['id']),await handleSDKOutput([_0x673c03],_0x155fe8),0x0;}}
@@ -1 +1 @@
1
- const a24_0x1b4b21=a24_0x511a;(function(_0x824870,_0x4f9e4f){const _0x304fc7=a24_0x511a,_0x43a3d5=_0x824870();while(!![]){try{const _0x547e98=-parseInt(_0x304fc7(0x8a))/0x1*(-parseInt(_0x304fc7(0x87))/0x2)+-parseInt(_0x304fc7(0x93))/0x3*(parseInt(_0x304fc7(0x77))/0x4)+parseInt(_0x304fc7(0x9a))/0x5+parseInt(_0x304fc7(0x94))/0x6*(-parseInt(_0x304fc7(0xa1))/0x7)+-parseInt(_0x304fc7(0x98))/0x8*(parseInt(_0x304fc7(0x91))/0x9)+-parseInt(_0x304fc7(0x80))/0xa+-parseInt(_0x304fc7(0x8f))/0xb*(-parseInt(_0x304fc7(0x86))/0xc);if(_0x547e98===_0x4f9e4f)break;else _0x43a3d5['push'](_0x43a3d5['shift']());}catch(_0x4fcf79){_0x43a3d5['push'](_0x43a3d5['shift']());}}}(a24_0x57ce,0x27ac4));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a24_0x511a(_0x4f2bc6,_0x59ff19){const _0x57ce3e=a24_0x57ce();return a24_0x511a=function(_0x511ac4,_0x13af6b){_0x511ac4=_0x511ac4-0x6c;let _0x4d1685=_0x57ce3e[_0x511ac4];return _0x4d1685;},a24_0x511a(_0x4f2bc6,_0x59ff19);}function a24_0x57ce(){const _0x55e3f0=['Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Segment\x20name:\x20','Site:\x20','length','8kyREOj','noCountPopulation','✔\x20Created\x20segment\x20\x27','segment','kind','site','data','execute','verbose','202390rUpIJb','Examples:','error','Resolving\x20folder\x20\x27','segmentPath','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','333708birska','113858gdWJyy','parent','\x27...','4NpQrpA','includes','\x27\x20with\x20ID:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','187pbZEVS','Parent:\x20','437841ydnRtD','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','466050eZDfiH','474smZtEy','folderId','name','resolvePathToResource','16nSsHDG','resolveFolderId','496510fsKjVB','folder','Resolved\x20relative\x20path\x20to:\x20','description','Create\x20child\x20segment\x20with\x20filtering\x20rules','Target\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','18522TVkuVo','\x20\x20\x20Path:\x20','resolveParentId','rule','createSegment','segments','invisible'];a24_0x57ce=function(){return _0x55e3f0;};return a24_0x57ce();}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{['name']='segment:create';[a24_0x1b4b21(0x9d)]=a24_0x1b4b21(0x9e);async[a24_0x1b4b21(0x7e)](_0x185b44){const _0x5d01be=a24_0x1b4b21,{options:_0x34242e,args:_0x4ef2dd,tdx:_0x5d9ad8}=_0x185b44,_0x2c7830=_0x34242e;if(_0x4ef2dd[_0x5d01be(0x76)]===0x0)return console[_0x5d01be(0x82)](_0x5d01be(0x92)),console[_0x5d01be(0x82)](_0x5d01be(0x85)),console[_0x5d01be(0x82)](_0x5d01be(0x81)),console[_0x5d01be(0x82)](_0x5d01be(0x8e)),console[_0x5d01be(0x82)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x48d154=_0x4ef2dd[0x0],_0x556f5d=_0x34242e[_0x5d01be(0x84)];let _0x1dc459=_0x48d154;_0x556f5d&&!_0x48d154[_0x5d01be(0x8b)]('/')&&(_0x1dc459=_0x556f5d+'/'+_0x48d154,_0x2c7830['verbose']&&console[_0x5d01be(0x82)](_0x5d01be(0x9c)+_0x1dc459));const _0x54f92b=parsePath(_0x1dc459);if(_0x54f92b[_0x5d01be(0x70)][_0x5d01be(0x76)]<0x2)return console[_0x5d01be(0x82)](_0x5d01be(0x8d)),console[_0x5d01be(0x82)](_0x5d01be(0x73)),0x1;const _0x4d05e3=_0x54f92b[_0x5d01be(0x70)][0x0],_0xedc836=getBaseName(_0x1dc459),_0x385c6b=getParentPath(_0x1dc459);_0x2c7830[_0x5d01be(0x7f)]&&(console[_0x5d01be(0x82)](_0x5d01be(0x75)+_0x2c7830[_0x5d01be(0x7c)]),console[_0x5d01be(0x82)](_0x5d01be(0x9f)+_0x1dc459),console[_0x5d01be(0x82)](_0x5d01be(0x90)+_0x4d05e3),console[_0x5d01be(0x82)](_0x5d01be(0x74)+_0xedc836),console['error']('Parent\x20path:\x20'+_0x385c6b));const _0x3af35a=await withSpinner(_0x5d01be(0xa0)+_0x4d05e3+_0x5d01be(0x89),()=>_0x5d9ad8['segment'][_0x5d01be(0x6d)](_0x4d05e3),{'verbose':_0x2c7830[_0x5d01be(0x7f)]}),_0xd33ba6=_0x3af35a[_0x5d01be(0x7d)];let _0x3a7950;if(_0x54f92b[_0x5d01be(0x70)][_0x5d01be(0x76)]>0x2){const _0x37f562=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x385c6b+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x97)](_0x385c6b),{'verbose':_0x2c7830['verbose']}),_0x3ec5cd=_0x37f562[_0x5d01be(0x7d)];if(_0x3ec5cd['type']!==_0x5d01be(0x9b)&&_0x3ec5cd['type']!==_0x5d01be(0x88))return console[_0x5d01be(0x82)](_0x5d01be(0x72)),0x1;_0x3a7950=_0x3ec5cd[_0x5d01be(0x95)];}else{if(_0x2c7830['folder']){const _0x37d6e9=await withSpinner(_0x5d01be(0x83)+_0x2c7830[_0x5d01be(0x9b)]+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x99)](_0xd33ba6,_0x2c7830[_0x5d01be(0x9b)]),{'verbose':_0x2c7830[_0x5d01be(0x7f)]});_0x3a7950=_0x37d6e9['data'];}}_0x2c7830['verbose']&&_0x3a7950&&console[_0x5d01be(0x82)]('Resolved\x20folder\x20ID:\x20'+_0x3a7950);const _0x3e11e7=await loadJSONFromOptions(_0x2c7830[_0x5d01be(0x6e)],_0x2c7830['ruleFile']),_0x1e8aa1={'name':_0xedc836,'description':_0x2c7830['description'],'rule':_0x3e11e7,'kind':_0x2c7830[_0x5d01be(0x7b)]!==undefined?parseInt(_0x2c7830[_0x5d01be(0x7b)],0xa):undefined,'isVisible':_0x2c7830[_0x5d01be(0x71)]?![]:undefined,'segmentFolderId':_0x3a7950,'countPopulation':_0x2c7830[_0x5d01be(0x78)]?![]:undefined},_0x15601d=await withSpinner('Creating\x20segment\x20\x27'+_0xedc836+_0x5d01be(0x89),()=>_0x5d9ad8[_0x5d01be(0x7a)][_0x5d01be(0x6f)](_0xd33ba6,_0x1e8aa1),{'verbose':_0x2c7830[_0x5d01be(0x7f)]}),_0x44ed0a=_0x15601d['data'];return console['error'](_0x5d01be(0x79)+_0x44ed0a[_0x5d01be(0x96)]+_0x5d01be(0x8c)+_0x44ed0a['id']),_0x1dc459!==_0x48d154&&console[_0x5d01be(0x82)](_0x5d01be(0x6c)+_0x1dc459),await handleSDKOutput([_0x44ed0a],_0x2c7830),0x0;}}
1
+ const a24_0xf7ece2=a24_0x4219;(function(_0x1cff80,_0x536201){const _0x14ad73=a24_0x4219,_0x4e93ee=_0x1cff80();while(!![]){try{const _0x5985ad=parseInt(_0x14ad73(0x137))/0x1+parseInt(_0x14ad73(0x14e))/0x2+-parseInt(_0x14ad73(0x156))/0x3*(parseInt(_0x14ad73(0x15c))/0x4)+parseInt(_0x14ad73(0x148))/0x5+parseInt(_0x14ad73(0x13f))/0x6*(-parseInt(_0x14ad73(0x15f))/0x7)+-parseInt(_0x14ad73(0x153))/0x8+-parseInt(_0x14ad73(0x161))/0x9*(-parseInt(_0x14ad73(0x162))/0xa);if(_0x5985ad===_0x536201)break;else _0x4e93ee['push'](_0x4e93ee['shift']());}catch(_0x5107ba){_0x4e93ee['push'](_0x4e93ee['shift']());}}}(a24_0x2638,0x97cf1));function a24_0x2638(){const _0x2c8bb8=['type','data','length','4063615UUqDpP','site','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','verbose','\x27...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','1260620PRLtsC','✔\x20Created\x20segment\x20\x27','folder','Create\x20child\x20segment\x20with\x20filtering\x20rules','ruleFile','6911408gaXDAp','parent','folderId','2613yJHERC','Resolving\x20folder\x20\x27','createSegment','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segment','Segment\x20name:\x20','5524dPauWP','Site:\x20','name','637770lrivRw','rule','711fdSmYu','149200zUvtrc','execute','segments','Target\x20path:\x20','Resolving\x20folder\x20path\x20\x27','error','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','noCountPopulation','invisible','includes','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','kind','Creating\x20segment\x20\x27','431313QKopgf','\x27\x20with\x20ID:\x20','Parent\x20path:\x20','resolveFolderId','description','segmentPath','Examples:','resolveParentId','24KChELM','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolvePathToResource','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Resolved\x20folder\x20ID:\x20'];a24_0x2638=function(){return _0x2c8bb8;};return a24_0x2638();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a24_0x4219(_0x4c48bd,_0xa583a5){const _0x263824=a24_0x2638();return a24_0x4219=function(_0x4219f9,_0x2e6c4d){_0x4219f9=_0x4219f9-0x12a;let _0x5b2d49=_0x263824[_0x4219f9];return _0x5b2d49;},a24_0x4219(_0x4c48bd,_0xa583a5);}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';export class SegmentCreateCommand extends BaseCommand{[a24_0xf7ece2(0x15e)]='segment:create';[a24_0xf7ece2(0x13b)]=a24_0xf7ece2(0x151);async[a24_0xf7ece2(0x12a)](_0x4a9f65){const _0x23422e=a24_0xf7ece2,{options:_0x5a1f3d,args:_0xee06c5,tdx:_0x44599c}=_0x4a9f65,_0x118e23=_0x5a1f3d;if(_0xee06c5[_0x23422e(0x147)]===0x0)return console[_0x23422e(0x12e)](_0x23422e(0x14d)),console['error'](_0x23422e(0x159)),console[_0x23422e(0x12e)](_0x23422e(0x13d)),console['error'](_0x23422e(0x134)),console[_0x23422e(0x12e)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x23422e(0x12e)](_0x23422e(0x141)),0x1;const _0x8fdc75=_0xee06c5[0x0],_0x4ddd62=_0x5a1f3d[_0x23422e(0x13c)];let _0x498b5e=_0x8fdc75;_0x4ddd62&&!_0x8fdc75[_0x23422e(0x133)]('/')&&(_0x498b5e=_0x4ddd62+'/'+_0x8fdc75,_0x118e23[_0x23422e(0x14b)]&&console['error'](_0x23422e(0x12f)+_0x498b5e));const _0x1cef59=parsePath(_0x498b5e);if(_0x1cef59[_0x23422e(0x12b)]['length']<0x2)return console['error'](_0x23422e(0x14a)),console[_0x23422e(0x12e)](_0x23422e(0x130)),0x1;const _0x467c8d=_0x1cef59[_0x23422e(0x12b)][0x0],_0xf36a16=getBaseName(_0x498b5e),_0x4ba97f=getParentPath(_0x498b5e);_0x118e23[_0x23422e(0x14b)]&&(console[_0x23422e(0x12e)](_0x23422e(0x15d)+_0x118e23[_0x23422e(0x149)]),console[_0x23422e(0x12e)](_0x23422e(0x12c)+_0x498b5e),console[_0x23422e(0x12e)]('Parent:\x20'+_0x467c8d),console[_0x23422e(0x12e)](_0x23422e(0x15b)+_0xf36a16),console['error'](_0x23422e(0x139)+_0x4ba97f));const _0x57d1d1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x467c8d+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x13e)](_0x467c8d),{'verbose':_0x118e23['verbose']}),_0x2d0614=_0x57d1d1['data'];let _0x238862;if(_0x1cef59[_0x23422e(0x12b)]['length']>0x2){const _0x20caf1=await withSpinner(_0x23422e(0x12d)+_0x4ba97f+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x142)](_0x4ba97f),{'verbose':_0x118e23[_0x23422e(0x14b)]}),_0x3a49d4=_0x20caf1[_0x23422e(0x146)];if(_0x3a49d4[_0x23422e(0x145)]!=='folder'&&_0x3a49d4[_0x23422e(0x145)]!==_0x23422e(0x154))return console[_0x23422e(0x12e)](_0x23422e(0x143)),0x1;_0x238862=_0x3a49d4[_0x23422e(0x155)];}else{if(_0x118e23[_0x23422e(0x150)]){const _0x5cab00=await withSpinner(_0x23422e(0x157)+_0x118e23[_0x23422e(0x150)]+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x13a)](_0x2d0614,_0x118e23[_0x23422e(0x150)]),{'verbose':_0x118e23['verbose']});_0x238862=_0x5cab00[_0x23422e(0x146)];}}_0x118e23[_0x23422e(0x14b)]&&_0x238862&&console[_0x23422e(0x12e)](_0x23422e(0x144)+_0x238862);const _0x4d2a23=await loadJSONFromOptions(_0x118e23[_0x23422e(0x160)],_0x118e23[_0x23422e(0x152)]),_0x1dda19={'name':_0xf36a16,'description':_0x118e23[_0x23422e(0x13b)],'rule':_0x4d2a23,'kind':_0x118e23[_0x23422e(0x135)]!==undefined?parseInt(_0x118e23['kind'],0xa):undefined,'isVisible':_0x118e23[_0x23422e(0x132)]?![]:undefined,'segmentFolderId':_0x238862,'countPopulation':_0x118e23[_0x23422e(0x131)]?![]:undefined},_0x5c1a13=await withSpinner(_0x23422e(0x136)+_0xf36a16+_0x23422e(0x14c),()=>_0x44599c[_0x23422e(0x15a)][_0x23422e(0x158)](_0x2d0614,_0x1dda19),{'verbose':_0x118e23[_0x23422e(0x14b)]}),_0x1408bd=_0x5c1a13['data'];return console[_0x23422e(0x12e)](_0x23422e(0x14f)+_0x1408bd[_0x23422e(0x15e)]+_0x23422e(0x138)+_0x1408bd['id']),_0x498b5e!==_0x8fdc75&&console[_0x23422e(0x12e)](_0x23422e(0x140)+_0x498b5e),await handleSDKOutput([_0x1408bd],_0x118e23),0x0;}}
@@ -1 +1 @@
1
- const a25_0x43c92d=a25_0xca2a;function a25_0xca2a(_0xa0095d,_0x37ab4a){const _0x5a911d=a25_0x5a91();return a25_0xca2a=function(_0xca2a5b,_0x23ce8){_0xca2a5b=_0xca2a5b-0x122;let _0x35a1e0=_0x5a911d[_0xca2a5b];return _0x35a1e0;},a25_0xca2a(_0xa0095d,_0x37ab4a);}(function(_0x4f7ed3,_0x479622){const _0x2c599d=a25_0xca2a,_0x43f235=_0x4f7ed3();while(!![]){try{const _0x7f1eaf=parseInt(_0x2c599d(0x137))/0x1+parseInt(_0x2c599d(0x123))/0x2*(-parseInt(_0x2c599d(0x12a))/0x3)+-parseInt(_0x2c599d(0x131))/0x4*(-parseInt(_0x2c599d(0x127))/0x5)+-parseInt(_0x2c599d(0x125))/0x6+-parseInt(_0x2c599d(0x129))/0x7+-parseInt(_0x2c599d(0x12e))/0x8+parseInt(_0x2c599d(0x136))/0x9;if(_0x7f1eaf===_0x479622)break;else _0x43f235['push'](_0x43f235['shift']());}catch(_0x438f33){_0x43f235['push'](_0x43f235['shift']());}}}(a25_0x5a91,0x6378c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a25_0x43c92d(0x12b);[a25_0x43c92d(0x126)]=a25_0x43c92d(0x128);async[a25_0x43c92d(0x132)](_0xd4a55d){const _0x5f74fc=a25_0x43c92d,{options:_0x175aec,args:_0x363946,tdx:_0x13d524}=_0xd4a55d;if(_0x363946[_0x5f74fc(0x12c)]===0x0)return console[_0x5f74fc(0x12f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x5f74fc(0x130)),0x1;const _0x52c26f=_0x363946[0x0];_0x175aec[_0x5f74fc(0x122)]&&(console[_0x5f74fc(0x12f)](_0x5f74fc(0x134)+_0x175aec['site']),console['error']('Parent\x20segment:\x20'+_0x52c26f));const _0x1ae501=await withSpinner(_0x5f74fc(0x124)+_0x52c26f+'\x27...',()=>_0x13d524[_0x5f74fc(0x135)]['listFields'](_0x52c26f),{'verbose':_0x175aec['verbose']}),_0x3e2c38=_0x1ae501[_0x5f74fc(0x12d)];return console[_0x5f74fc(0x12f)](_0x5f74fc(0x133)+_0x3e2c38[_0x5f74fc(0x12c)]+'\x20field'+(_0x3e2c38[_0x5f74fc(0x12c)]!==0x1?'s':'')),await handleSDKOutput(_0x3e2c38,_0x175aec),0x0;}}function a25_0x5a91(){const _0x2c6791=['538454bMEApu','3acOrml','segment:fields','length','data','5166552SsbfIu','error','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','360uwLJLG','execute','✔\x20Found\x20','Site:\x20','segment','9324036XUsOba','326984anGfcx','verbose','984564yoHziU','Listing\x20fields\x20for\x20\x27','287274eauQXP','description','17075TYqvea','List\x20available\x20fields\x20for\x20segmentation'];a25_0x5a91=function(){return _0x2c6791;};return a25_0x5a91();}
1
+ const a25_0x4bbd94=a25_0x5113;function a25_0x2e5c(){const _0x41fb56=['575OtyRJV','listFields','10170QcwBmu','name','497yCevWW','site','verbose','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','494324Gsfmin','407ynsLAr','30zASquD','356376dVQEJz','1373172UrciTS','segment','812hEImDr','List\x20available\x20fields\x20for\x20segmentation','length','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','description','✔\x20Found\x20','\x20field','Parent\x20segment:\x20','error','24080obPOvR','2950KokdUN','14975HsfZaO'];a25_0x2e5c=function(){return _0x41fb56;};return a25_0x2e5c();}(function(_0x2df506,_0x3b9818){const _0x7b2a8a=a25_0x5113,_0x1cbb08=_0x2df506();while(!![]){try{const _0x2e69a1=-parseInt(_0x7b2a8a(0x82))/0x1*(-parseInt(_0x7b2a8a(0x91))/0x2)+parseInt(_0x7b2a8a(0x8f))/0x3+parseInt(_0x7b2a8a(0x8b))/0x4+parseInt(_0x7b2a8a(0x81))/0x5*(parseInt(_0x7b2a8a(0x8d))/0x6)+parseInt(_0x7b2a8a(0x86))/0x7*(parseInt(_0x7b2a8a(0x9b))/0x8)+parseInt(_0x7b2a8a(0x84))/0x9*(parseInt(_0x7b2a8a(0x9c))/0xa)+-parseInt(_0x7b2a8a(0x8c))/0xb*(parseInt(_0x7b2a8a(0x8e))/0xc);if(_0x2e69a1===_0x3b9818)break;else _0x1cbb08['push'](_0x1cbb08['shift']());}catch(_0x30d052){_0x1cbb08['push'](_0x1cbb08['shift']());}}}(a25_0x2e5c,0x43dcc));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a25_0x5113(_0x2ab147,_0x5ba92e){const _0x2e5c45=a25_0x2e5c();return a25_0x5113=function(_0x51133e,_0x405ecd){_0x51133e=_0x51133e-0x81;let _0x451d77=_0x2e5c45[_0x51133e];return _0x451d77;},a25_0x5113(_0x2ab147,_0x5ba92e);}export class SegmentFieldsCommand extends BaseCommand{[a25_0x4bbd94(0x85)]='segment:fields';[a25_0x4bbd94(0x96)]=a25_0x4bbd94(0x92);async['execute'](_0x79b9b0){const _0x146cbd=a25_0x4bbd94,{options:_0x19b7ff,args:_0x1e6d48,tdx:_0x468aaa}=_0x79b9b0;if(_0x1e6d48[_0x146cbd(0x93)]===0x0)return console['error'](_0x146cbd(0x8a)),console[_0x146cbd(0x9a)](_0x146cbd(0x95)),0x1;const _0x7f9f50=_0x1e6d48[0x0];_0x19b7ff[_0x146cbd(0x88)]&&(console[_0x146cbd(0x9a)](_0x146cbd(0x89)+_0x19b7ff[_0x146cbd(0x87)]),console[_0x146cbd(0x9a)](_0x146cbd(0x99)+_0x7f9f50));const _0x34b2e1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x7f9f50+'\x27...',()=>_0x468aaa[_0x146cbd(0x90)][_0x146cbd(0x83)](_0x7f9f50),{'verbose':_0x19b7ff[_0x146cbd(0x88)]}),_0x34834b=_0x34b2e1[_0x146cbd(0x94)];return console[_0x146cbd(0x9a)](_0x146cbd(0x97)+_0x34834b[_0x146cbd(0x93)]+_0x146cbd(0x98)+(_0x34834b[_0x146cbd(0x93)]!==0x1?'s':'')),await handleSDKOutput(_0x34834b,_0x19b7ff),0x0;}}
@@ -1 +1 @@
1
- const a26_0x59b2e1=a26_0x1406;function a26_0x1406(_0x31620e,_0x4d92db){const _0x34d355=a26_0x34d3();return a26_0x1406=function(_0x1406f1,_0x290925){_0x1406f1=_0x1406f1-0x13e;let _0xe95d90=_0x34d355[_0x1406f1];return _0xe95d90;},a26_0x1406(_0x31620e,_0x4d92db);}(function(_0x351f12,_0x17e57e){const _0x17e786=a26_0x1406,_0x238cac=_0x351f12();while(!![]){try{const _0x4ab661=-parseInt(_0x17e786(0x14d))/0x1+parseInt(_0x17e786(0x13e))/0x2+-parseInt(_0x17e786(0x152))/0x3*(-parseInt(_0x17e786(0x146))/0x4)+parseInt(_0x17e786(0x14c))/0x5+-parseInt(_0x17e786(0x149))/0x6+-parseInt(_0x17e786(0x14b))/0x7*(parseInt(_0x17e786(0x151))/0x8)+parseInt(_0x17e786(0x150))/0x9;if(_0x4ab661===_0x17e57e)break;else _0x238cac['push'](_0x238cac['shift']());}catch(_0xc2ffbe){_0x238cac['push'](_0x238cac['shift']());}}}(a26_0x34d3,0x89eb9));import{BaseCommand}from'./command.js';function a26_0x34d3(){const _0x6bb374=['2346720PMMwCg','341359xvcPHw','execute','\x20\x20Path:\x20','14872338BiyYkB','8oscIuc','18dvbyAT','658292DQnmjH','json','log','error','stringify','format','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','description','398572uxabCJ','Context\x20details:','Show\x20current\x20segment/folder\x20context','6618006TUgvwi','jsonl','7276843PaIjZf'];a26_0x34d3=function(){return _0x6bb374;};return a26_0x34d3();}export class SegmentPwdCommand extends BaseCommand{['name']='segment:pwd';[a26_0x59b2e1(0x145)]=a26_0x59b2e1(0x148);async[a26_0x59b2e1(0x14e)](_0xd859b1){const _0x57d617=a26_0x59b2e1,{options:_0x49a56e}=_0xd859b1;try{const _0x4db1ba=_0x49a56e['segmentPath'];if(!_0x4db1ba)return _0x49a56e[_0x57d617(0x143)]===_0x57d617(0x13f)||_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x14a)?console[_0x57d617(0x140)](JSON[_0x57d617(0x142)]({'path':'/','type':'root'})):console[_0x57d617(0x140)]('/'),0x0;if(_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x13f)||_0x49a56e[_0x57d617(0x143)]===_0x57d617(0x14a)){const _0x528c95={'path':_0x4db1ba};console[_0x57d617(0x140)](JSON[_0x57d617(0x142)](_0x528c95));}else console[_0x57d617(0x140)](_0x4db1ba),_0x49a56e['verbose']&&(console[_0x57d617(0x141)](''),console[_0x57d617(0x141)](_0x57d617(0x147)),console[_0x57d617(0x141)](_0x57d617(0x14f)+_0x4db1ba),console['error'](''),console[_0x57d617(0x141)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'),console[_0x57d617(0x141)](_0x57d617(0x144)));return 0x0;}catch(_0x213782){throw _0x213782;}}}
1
+ const a26_0x10f538=a26_0x417b;(function(_0x405e2a,_0x72c23d){const _0x39d0db=a26_0x417b,_0x24f21c=_0x405e2a();while(!![]){try{const _0x99a0ea=parseInt(_0x39d0db(0x188))/0x1+parseInt(_0x39d0db(0x197))/0x2*(parseInt(_0x39d0db(0x18b))/0x3)+-parseInt(_0x39d0db(0x18c))/0x4*(parseInt(_0x39d0db(0x187))/0x5)+-parseInt(_0x39d0db(0x196))/0x6*(parseInt(_0x39d0db(0x18f))/0x7)+-parseInt(_0x39d0db(0x195))/0x8+parseInt(_0x39d0db(0x183))/0x9+parseInt(_0x39d0db(0x19a))/0xa;if(_0x99a0ea===_0x72c23d)break;else _0x24f21c['push'](_0x24f21c['shift']());}catch(_0x27e06a){_0x24f21c['push'](_0x24f21c['shift']());}}}(a26_0x1c5c,0xdf46e));function a26_0x417b(_0x44596c,_0x346cab){const _0x1c5c37=a26_0x1c5c();return a26_0x417b=function(_0x417be7,_0x52d87b){_0x417be7=_0x417be7-0x182;let _0x5850ef=_0x1c5c37[_0x417be7];return _0x5850ef;},a26_0x417b(_0x44596c,_0x346cab);}import{BaseCommand}from'./command.js';export class SegmentPwdCommand extends BaseCommand{[a26_0x10f538(0x198)]=a26_0x10f538(0x191);['description']=a26_0x10f538(0x193);async[a26_0x10f538(0x18a)](_0x242af6){const _0xe768fb=a26_0x10f538,{options:_0x386812}=_0x242af6;try{const _0x2eeacf=_0x386812[_0xe768fb(0x18e)];if(!_0x2eeacf)return _0x386812[_0xe768fb(0x185)]==='json'||_0x386812[_0xe768fb(0x185)]===_0xe768fb(0x184)?console[_0xe768fb(0x189)](JSON['stringify']({'path':'/','type':'root'})):console[_0xe768fb(0x189)]('/'),0x0;if(_0x386812[_0xe768fb(0x185)]===_0xe768fb(0x18d)||_0x386812[_0xe768fb(0x185)]===_0xe768fb(0x184)){const _0x3eb377={'path':_0x2eeacf};console['log'](JSON[_0xe768fb(0x190)](_0x3eb377));}else console['log'](_0x2eeacf),_0x386812[_0xe768fb(0x194)]&&(console[_0xe768fb(0x199)](''),console[_0xe768fb(0x199)](_0xe768fb(0x186)),console[_0xe768fb(0x199)]('\x20\x20Path:\x20'+_0x2eeacf),console[_0xe768fb(0x199)](''),console['error'](_0xe768fb(0x192)),console[_0xe768fb(0x199)](_0xe768fb(0x182)));return 0x0;}catch(_0xfa42c3){throw _0xfa42c3;}}}function a26_0x1c5c(){const _0xfee966=['4405928TanZmq','721044agOQZY','80MQsEbb','name','error','4189690bHueru','Use\x20\x22tdx\x20context\x20--debug\x22\x20to\x20see\x20context\x20sources','12897360MJgyAD','jsonl','format','Context\x20details:','7055hUZvbJ','950606dvZJNG','log','execute','55530QVToYx','2824vwiZty','json','segmentPath','63FfWXol','stringify','segment:pwd','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','Show\x20current\x20segment/folder\x20context','verbose'];a26_0x1c5c=function(){return _0xfee966;};return a26_0x1c5c();}
@@ -1 +1 @@
1
- const a27_0x345b10=a27_0x1e3d;(function(_0x13622e,_0x5d642a){const _0x50b126=a27_0x1e3d,_0x57fb90=_0x13622e();while(!![]){try{const _0x334027=-parseInt(_0x50b126(0xd7))/0x1+-parseInt(_0x50b126(0xe5))/0x2+-parseInt(_0x50b126(0xd5))/0x3+-parseInt(_0x50b126(0xe3))/0x4+-parseInt(_0x50b126(0xef))/0x5*(parseInt(_0x50b126(0xdb))/0x6)+-parseInt(_0x50b126(0xf3))/0x7+parseInt(_0x50b126(0xf4))/0x8*(parseInt(_0x50b126(0xd4))/0x9);if(_0x334027===_0x5d642a)break;else _0x57fb90['push'](_0x57fb90['shift']());}catch(_0x56136d){_0x57fb90['push'](_0x57fb90['shift']());}}}(a27_0xdfb6,0xabbec));function a27_0x1e3d(_0xb737ff,_0x526a3){const _0xdfb60=a27_0xdfb6();return a27_0x1e3d=function(_0x1e3da8,_0x5038bc){_0x1e3da8=_0x1e3da8-0xcb;let _0x14ce1d=_0xdfb60[_0x1e3da8];return _0x14ce1d;},a27_0x1e3d(_0xb737ff,_0x526a3);}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0x345b10(0xea);[a27_0x345b10(0xf9)]=a27_0x345b10(0xcf);async[a27_0x345b10(0xe9)](_0x4799b8){const _0x175041=a27_0x345b10,{options:_0x1070cf,args:_0x1d5952,tdx:_0x6c8303}=_0x4799b8,_0x23c0b=_0x1070cf;if(_0x1d5952[_0x175041(0xfc)]===0x0)return console[_0x175041(0xd3)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x175041(0xd3)](_0x175041(0xf8)),console['error'](_0x175041(0xde)),console[_0x175041(0xd3)](_0x175041(0xdf)),console[_0x175041(0xd3)](_0x175041(0xf2)),0x1;const _0x111915=_0x1d5952[0x0],_0x14b051=_0x1070cf[_0x175041(0xda)];let _0x75d171=_0x111915;_0x14b051&&!_0x111915[_0x175041(0xe6)]('/')&&(_0x75d171=_0x14b051+'/'+_0x111915,_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xd6)+_0x75d171));const _0x3516d9=await withSpinner(_0x175041(0xf0)+_0x75d171+_0x175041(0xe1),()=>_0x6c8303['segment'][_0x175041(0xce)](_0x75d171),{'verbose':_0x23c0b[_0x175041(0xdd)]}),_0x5a85d6=_0x3516d9['data'];_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xcb)+_0x5a85d6[_0x175041(0xf7)]);if(_0x5a85d6[_0x175041(0xf7)]!=='segment')return console['error'](_0x175041(0xd0)+_0x5a85d6['type']+_0x175041(0xe0)),console[_0x175041(0xd3)](_0x175041(0xf1)),0x1;if(!_0x5a85d6[_0x175041(0xcc)])throw new SDKError(ErrorCode[_0x175041(0xd9)],_0x175041(0xf6));const _0x2cdad6=_0x5a85d6['parentId'],_0x4903de=_0x5a85d6[_0x175041(0xcc)];_0x23c0b['verbose']&&(console[_0x175041(0xd3)](_0x175041(0xdc)+_0x2cdad6),console[_0x175041(0xd3)](_0x175041(0xed)+_0x4903de));let _0x4ce3e9;if(_0x23c0b['folder']){const _0x2497dd=_0x23c0b[_0x175041(0xd8)],_0x3212cd=await withSpinner(_0x175041(0xf5)+_0x2497dd+_0x175041(0xe1),()=>_0x6c8303[_0x175041(0xfa)][_0x175041(0xe8)](_0x2cdad6,_0x2497dd),{'verbose':_0x23c0b[_0x175041(0xdd)]});_0x4ce3e9=parseInt(_0x3212cd[_0x175041(0xfb)],0xa),_0x23c0b[_0x175041(0xdd)]&&console[_0x175041(0xd3)](_0x175041(0xeb)+_0x4ce3e9);}const _0x3654f0=await loadJSONFromOptions(_0x23c0b[_0x175041(0xe7)],_0x23c0b['ruleFile']),_0x1ca825={'name':_0x23c0b[_0x175041(0xec)],'description':_0x23c0b[_0x175041(0xf9)],'rule':_0x3654f0,'kind':_0x23c0b[_0x175041(0xd1)]!==undefined?parseInt(_0x23c0b['kind'],0xa):undefined,'segmentFolderId':_0x4ce3e9},_0x2273a8=await withSpinner(_0x175041(0xe4)+_0x5a85d6[_0x175041(0xee)]+_0x175041(0xe1),()=>_0x6c8303['segment'][_0x175041(0xd2)](_0x2cdad6,_0x4903de,_0x1ca825),{'verbose':_0x23c0b[_0x175041(0xdd)]}),_0x5331de=_0x2273a8[_0x175041(0xfb)];return console['error'](_0x175041(0xe2)+_0x5331de['name']+'\x27'),_0x75d171!==_0x111915&&console[_0x175041(0xd3)](_0x175041(0xcd)+_0x75d171),await handleSDKOutput([_0x5331de],_0x23c0b),0x0;}}function a27_0xdfb6(){const _0x5679a5=['updateSegmentById','error','117aSPTVA','2912157ZLCWUn','Resolved\x20relative\x20path\x20to:\x20','778631cWgTrI','folder','INTERNAL','segmentPath','1848IrKWgW','Parent\x20ID:\x20','verbose','Examples:','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x27...','✔\x20Updated\x20segment\x20\x27','1958012JkGikq','Updating\x20segment\x20\x27','702246SIWCFy','includes','rule','resolveFolderId','execute','segment:update','Resolved\x20folder\x20ID:\x20','name','Segment\x20ID:\x20','segmentName','12785GdHrbP','Resolving\x20path\x20\x27','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1409583oEEotX','2635304RWuFgI','Resolving\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','type','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','description','segment','data','length','Resolved\x20type:\x20','segmentId','\x20\x20\x20Path:\x20','resolvePathToResource','Update\x20existing\x20child\x20segment','Error:\x20Cannot\x20update\x20','kind'];a27_0xdfb6=function(){return _0x5679a5;};return a27_0xdfb6();}
1
+ const a27_0xf515b0=a27_0x4795;(function(_0x1c50c5,_0x3322e4){const _0x2aa6cf=a27_0x4795,_0x349e17=_0x1c50c5();while(!![]){try{const _0x37e773=-parseInt(_0x2aa6cf(0x118))/0x1*(-parseInt(_0x2aa6cf(0x109))/0x2)+-parseInt(_0x2aa6cf(0x11e))/0x3+-parseInt(_0x2aa6cf(0x10b))/0x4*(-parseInt(_0x2aa6cf(0x11a))/0x5)+parseInt(_0x2aa6cf(0x117))/0x6+-parseInt(_0x2aa6cf(0x12b))/0x7+parseInt(_0x2aa6cf(0x110))/0x8+parseInt(_0x2aa6cf(0x12a))/0x9*(-parseInt(_0x2aa6cf(0x11c))/0xa);if(_0x37e773===_0x3322e4)break;else _0x349e17['push'](_0x349e17['shift']());}catch(_0x3bb2a2){_0x349e17['push'](_0x349e17['shift']());}}}(a27_0xa4c6,0x4b60e));function a27_0x4795(_0x34ee83,_0x20929e){const _0xa4c637=a27_0xa4c6();return a27_0x4795=function(_0x4795d5,_0x20b652){_0x4795d5=_0x4795d5-0xfe;let _0x4fd9a2=_0xa4c637[_0x4795d5];return _0x4fd9a2;},a27_0x4795(_0x34ee83,_0x20929e);}function a27_0xa4c6(){const _0x28b9e7=['3183504KwcyCj','segmentId','rule','\x27...','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolving\x20folder\x20\x27','length','2667714pDIrzw','3237fBGpGH','data','5vJWiAs','segment','10ggeiZv','name','1046808DjMolJ','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Segment\x20ID:\x20','segmentPath','Resolved\x20type:\x20','folder','verbose','ruleFile','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Error:\x20Cannot\x20update\x20','segmentName','resolveFolderId','4247487wpVCmp','2476082fhaJro','Examples:','includes','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Parent\x20ID:\x20','execute','Resolved\x20folder\x20ID:\x20','segment:update','INTERNAL','Updating\x20segment\x20\x27','✔\x20Updated\x20segment\x20\x27','description','updateSegmentById','136blTNIC','type','1682728lHoqBh','Update\x20existing\x20child\x20segment','resolvePathToResource','kind','error'];a27_0xa4c6=function(){return _0x28b9e7;};return a27_0xa4c6();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';export class SegmentUpdateCommand extends BaseCommand{['name']=a27_0xf515b0(0x103);[a27_0xf515b0(0x107)]=a27_0xf515b0(0x10c);async[a27_0xf515b0(0x101)](_0x152470){const _0x294218=a27_0xf515b0,{options:_0x471942,args:_0x511a53,tdx:_0x29ccbe}=_0x152470,_0x49154a=_0x471942;if(_0x511a53[_0x294218(0x116)]===0x0)return console[_0x294218(0x10f)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x294218(0x10f)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x294218(0x10f)](_0x294218(0x12c)),console[_0x294218(0x10f)](_0x294218(0x11f)),console[_0x294218(0x10f)](_0x294218(0xff)),0x1;const _0x21be47=_0x511a53[0x0],_0x48e5cf=_0x471942[_0x294218(0x121)];let _0x19d5b2=_0x21be47;_0x48e5cf&&!_0x21be47[_0x294218(0xfe)]('/')&&(_0x19d5b2=_0x48e5cf+'/'+_0x21be47,_0x49154a[_0x294218(0x124)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x19d5b2));const _0x5ab69e=await withSpinner('Resolving\x20path\x20\x27'+_0x19d5b2+_0x294218(0x113),()=>_0x29ccbe[_0x294218(0x11b)][_0x294218(0x10d)](_0x19d5b2),{'verbose':_0x49154a[_0x294218(0x124)]}),_0x44e97d=_0x5ab69e[_0x294218(0x119)];_0x49154a[_0x294218(0x124)]&&console[_0x294218(0x10f)](_0x294218(0x122)+_0x44e97d[_0x294218(0x10a)]);if(_0x44e97d[_0x294218(0x10a)]!==_0x294218(0x11b))return console[_0x294218(0x10f)](_0x294218(0x127)+_0x44e97d['type']+_0x294218(0x114)),console[_0x294218(0x10f)](_0x294218(0x126)),0x1;if(!_0x44e97d[_0x294218(0x111)])throw new SDKError(ErrorCode[_0x294218(0x104)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x115cd4=_0x44e97d['parentId'],_0x1c1c9e=_0x44e97d[_0x294218(0x111)];_0x49154a[_0x294218(0x124)]&&(console[_0x294218(0x10f)](_0x294218(0x100)+_0x115cd4),console[_0x294218(0x10f)](_0x294218(0x120)+_0x1c1c9e));let _0x404cbc;if(_0x49154a[_0x294218(0x123)]){const _0x559060=_0x49154a[_0x294218(0x123)],_0x3f7941=await withSpinner(_0x294218(0x115)+_0x559060+_0x294218(0x113),()=>_0x29ccbe[_0x294218(0x11b)][_0x294218(0x129)](_0x115cd4,_0x559060),{'verbose':_0x49154a[_0x294218(0x124)]});_0x404cbc=parseInt(_0x3f7941[_0x294218(0x119)],0xa),_0x49154a[_0x294218(0x124)]&&console[_0x294218(0x10f)](_0x294218(0x102)+_0x404cbc);}const _0x8add21=await loadJSONFromOptions(_0x49154a[_0x294218(0x112)],_0x49154a[_0x294218(0x125)]),_0x4fe11d={'name':_0x49154a[_0x294218(0x11d)],'description':_0x49154a[_0x294218(0x107)],'rule':_0x8add21,'kind':_0x49154a[_0x294218(0x10e)]!==undefined?parseInt(_0x49154a[_0x294218(0x10e)],0xa):undefined,'segmentFolderId':_0x404cbc},_0xe7a75b=await withSpinner(_0x294218(0x105)+_0x44e97d[_0x294218(0x128)]+_0x294218(0x113),()=>_0x29ccbe[_0x294218(0x11b)][_0x294218(0x108)](_0x115cd4,_0x1c1c9e,_0x4fe11d),{'verbose':_0x49154a[_0x294218(0x124)]}),_0x5c3e5b=_0xe7a75b[_0x294218(0x119)];return console[_0x294218(0x10f)](_0x294218(0x106)+_0x5c3e5b[_0x294218(0x11d)]+'\x27'),_0x19d5b2!==_0x21be47&&console[_0x294218(0x10f)]('\x20\x20\x20Path:\x20'+_0x19d5b2),await handleSDKOutput([_0x5c3e5b],_0x49154a),0x0;}}
@@ -1 +1 @@
1
- const a28_0x434dc4=a28_0x37f1;(function(_0x12274b,_0x3981f1){const _0x489874=a28_0x37f1,_0x47ada6=_0x12274b();while(!![]){try{const _0x42c5c0=-parseInt(_0x489874(0x78))/0x1*(-parseInt(_0x489874(0x95))/0x2)+parseInt(_0x489874(0x83))/0x3*(parseInt(_0x489874(0x72))/0x4)+parseInt(_0x489874(0x67))/0x5+parseInt(_0x489874(0x68))/0x6*(parseInt(_0x489874(0x6e))/0x7)+parseInt(_0x489874(0x71))/0x8*(parseInt(_0x489874(0x80))/0x9)+parseInt(_0x489874(0x69))/0xa*(-parseInt(_0x489874(0x66))/0xb)+parseInt(_0x489874(0x94))/0xc*(-parseInt(_0x489874(0x86))/0xd);if(_0x42c5c0===_0x3981f1)break;else _0x47ada6['push'](_0x47ada6['shift']());}catch(_0x462f70){_0x47ada6['push'](_0x47ada6['shift']());}}}(a28_0x4b49,0xc423e));function a28_0x37f1(_0x55ff9e,_0x3a5d67){const _0x4b49e8=a28_0x4b49();return a28_0x37f1=function(_0x37f195,_0x4d6615){_0x37f195=_0x37f195-0x64;let _0x218158=_0x4b49e8[_0x37f195];return _0x218158;},a28_0x37f1(_0x55ff9e,_0x3a5d67);}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';export class SegmentUseCommand extends BaseCommand{['name']=a28_0x434dc4(0x6f);[a28_0x434dc4(0x99)]=a28_0x434dc4(0x8d);async[a28_0x434dc4(0x85)](_0x48ec6b){const _0x1d2301=a28_0x434dc4,{options:_0x465a27,args:_0x340f00,tdx:_0x252539}=_0x48ec6b;if(_0x340f00[_0x1d2301(0x65)]===0x0)return console[_0x1d2301(0x93)](_0x1d2301(0x7b)),console['error'](_0x1d2301(0x7a)),console['error']('Examples:'),console[_0x1d2301(0x93)](_0x1d2301(0x70)),console[_0x1d2301(0x93)](_0x1d2301(0x89)),console[_0x1d2301(0x93)](_0x1d2301(0x7d)),console[_0x1d2301(0x93)](_0x1d2301(0x8c)),0x1;const _0x3bf99f=_0x340f00[0x0],_0x3ab212=_0x465a27['session'];try{if(_0x3bf99f==='/')return saveSessionContext({'segment_path':undefined},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x97)),0x0;const _0x13de47=_0x465a27[_0x1d2301(0x76)];let _0x5dfec1=_0x3bf99f;const _0x45e030=parsePath(_0x3bf99f);if(!_0x45e030[_0x1d2301(0x88)]){if(!_0x13de47)return console[_0x1d2301(0x93)](_0x1d2301(0x77)),console[_0x1d2301(0x93)](_0x1d2301(0x8b)),0x1;if(_0x3bf99f==='..'){const _0x4ab308=_0x13de47[_0x1d2301(0x6b)]('/')[_0x1d2301(0x8a)](0x0,-0x1)[_0x1d2301(0x91)]('/');_0x5dfec1=_0x4ab308||'/';}else _0x3bf99f==='.'?_0x5dfec1=_0x13de47:_0x5dfec1=_0x13de47+'/'+_0x3bf99f;_0x465a27[_0x1d2301(0x92)]&&console[_0x1d2301(0x93)](_0x1d2301(0x90)+_0x5dfec1);}if(_0x5dfec1==='/'||_0x5dfec1==='')return saveSessionContext({'segment_path':undefined},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x97)),0x0;_0x5dfec1=normalizePath(_0x5dfec1);const _0x3b4988=parsePath(_0x5dfec1)['segments'];if(_0x3b4988['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x3ab212),console['log'](_0x1d2301(0x97)),0x0;_0x465a27[_0x1d2301(0x92)]&&(console[_0x1d2301(0x93)]('Site:\x20'+_0x465a27[_0x1d2301(0x7c)]),console[_0x1d2301(0x93)](_0x1d2301(0x84)+_0x5dfec1));const _0x48fd53=await withSpinner(_0x1d2301(0x7e)+_0x5dfec1+_0x1d2301(0x8e),()=>_0x252539[_0x1d2301(0x79)][_0x1d2301(0x82)](_0x5dfec1),{'verbose':_0x465a27[_0x1d2301(0x92)]}),_0x37ef4f=_0x48fd53['data'];_0x465a27[_0x1d2301(0x92)]&&(console[_0x1d2301(0x93)](_0x1d2301(0x98)+_0x37ef4f['type']),console['error'](_0x1d2301(0x74)+_0x37ef4f['parentId']),_0x37ef4f[_0x1d2301(0x87)]&&console[_0x1d2301(0x93)]('Folder\x20ID:\x20'+_0x37ef4f[_0x1d2301(0x87)]));if(_0x37ef4f[_0x1d2301(0x8f)]===_0x1d2301(0x79))return console[_0x1d2301(0x93)](_0x1d2301(0x64)),console[_0x1d2301(0x93)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x1d2301(0x93)](_0x1d2301(0x73)+_0x37ef4f['parentName']+(_0x37ef4f['folderPath']?'/'+_0x37ef4f[_0x1d2301(0x6a)][_0x1d2301(0x91)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0x37ef4f[_0x1d2301(0x81)],'parent_segment':_0x37ef4f[_0x1d2301(0x75)]},_0x3ab212),console[_0x1d2301(0x6d)](_0x1d2301(0x96)+_0x37ef4f[_0x1d2301(0x81)]),_0x465a27[_0x1d2301(0x92)]&&(console['error']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context'),console['error'](_0x1d2301(0x6c)),console['error'](_0x1d2301(0x7f))),0x0;}catch(_0x50f782){throw _0x50f782;}}}function a28_0x4b49(){const _0xfd9084=['11035277iVhBSG','6479280mlGYGf','6gdGaXo','10MjOHOH','folderPath','split','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','log','4081609TBQGTb','segment:use','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','16PiRNzy','4OnxqfW','Use:\x20tdx\x20segment\x20use\x20','Parent\x20ID:\x20','parentName','segmentPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','668611AuQaCU','segment','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20Path\x20is\x20required','site','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Resolving\x20path\x20\x27','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','2778129HnNAQM','fullPath','resolvePathToResource','1427577JKcRQV','Target\x20path:\x20','execute','23844314irBRwC','folderId','isAbsolute','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','slice','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x27...','type','Resolved\x20relative\x20path\x20to:\x20','join','verbose','error','12PGbmuB','2ytyaNg','Context\x20set\x20to:\x20','Context\x20cleared.\x20Back\x20to\x20root.','Resolved\x20path\x20type:\x20','description','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','length'];a28_0x4b49=function(){return _0xfd9084;};return a28_0x4b49();}
1
+ function a28_0x2a9f(){const _0x4a561d=['type','515iARCZB','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Usage:\x20tdx\x20segment\x20use\x20<path>','segmentPath','isAbsolute','join','data','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','segment:use','verbose','Use:\x20tdx\x20segment\x20use\x20','description','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','slice','log','parentId','\x27...','folderPath','2114570efzVpJ','5811232bRwAKc','name','Context\x20set\x20to:\x20','execute','fullPath','Context\x20cleared.\x20Back\x20to\x20root.','parentName','Target\x20path:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','folderId','Resolved\x20path\x20type:\x20','site','Use\x20\x22tdx\x20segment\x20pwd\x22\x20to\x20show\x20current\x20context','4224993ejLgEu','session','resolvePathToResource','split','Site:\x20','segments','length','4363404bkPcrr','error','19128GlYEKZ','1NWnQnC','6386282YDtgPf','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','15020MKblZW','13014dTTryK','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Folder\x20ID:\x20'];a28_0x2a9f=function(){return _0x4a561d;};return a28_0x2a9f();}const a28_0x252c63=a28_0x5dd3;(function(_0x8fd22c,_0x573107){const _0x269a11=a28_0x5dd3,_0x20ab05=_0x8fd22c();while(!![]){try{const _0x1cb7b3=parseInt(_0x269a11(0x18d))/0x1*(parseInt(_0x269a11(0x175))/0x2)+-parseInt(_0x269a11(0x183))/0x3+parseInt(_0x269a11(0x18c))/0x4*(-parseInt(_0x269a11(0x163))/0x5)+-parseInt(_0x269a11(0x18a))/0x6+parseInt(_0x269a11(0x18e))/0x7+-parseInt(_0x269a11(0x176))/0x8+-parseInt(_0x269a11(0x15e))/0x9*(-parseInt(_0x269a11(0x15d))/0xa);if(_0x1cb7b3===_0x573107)break;else _0x20ab05['push'](_0x20ab05['shift']());}catch(_0x219c3c){_0x20ab05['push'](_0x20ab05['shift']());}}}(a28_0x2a9f,0xc022c));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 a28_0x5dd3(_0xd02058,_0x5a9782){const _0x2a9fd8=a28_0x2a9f();return a28_0x5dd3=function(_0x5dd302,_0x522cf4){_0x5dd302=_0x5dd302-0x15b;let _0x14aacd=_0x2a9fd8[_0x5dd302];return _0x14aacd;},a28_0x5dd3(_0xd02058,_0x5a9782);}export class SegmentUseCommand extends BaseCommand{[a28_0x252c63(0x177)]=a28_0x252c63(0x16b);[a28_0x252c63(0x16e)]=a28_0x252c63(0x164);async[a28_0x252c63(0x179)](_0x2e78eb){const _0x47ec38=a28_0x252c63,{options:_0x2e4bbc,args:_0x14bcc5,tdx:_0x150b38}=_0x2e78eb;if(_0x14bcc5[_0x47ec38(0x189)]===0x0)return console[_0x47ec38(0x18b)]('Error:\x20Path\x20is\x20required'),console[_0x47ec38(0x18b)](_0x47ec38(0x165)),console['error']('Examples:'),console[_0x47ec38(0x18b)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x47ec38(0x18b)](_0x47ec38(0x17e)),console['error'](_0x47ec38(0x160)),console['error'](_0x47ec38(0x15c)),0x1;const _0x51a752=_0x14bcc5[0x0],_0x39875b=_0x2e4bbc[_0x47ec38(0x184)];try{if(_0x51a752==='/')return saveSessionContext({'segment_path':undefined},_0x39875b),console['log']('Context\x20cleared.\x20Back\x20to\x20root.'),0x0;const _0x420f7a=_0x2e4bbc[_0x47ec38(0x166)];let _0x34927d=_0x51a752;const _0x288dc9=parsePath(_0x51a752);if(!_0x288dc9[_0x47ec38(0x167)]){if(!_0x420f7a)return console[_0x47ec38(0x18b)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.'),console['error'](_0x47ec38(0x16a)),0x1;if(_0x51a752==='..'){const _0xd98d01=_0x420f7a[_0x47ec38(0x186)]('/')[_0x47ec38(0x170)](0x0,-0x1)[_0x47ec38(0x168)]('/');_0x34927d=_0xd98d01||'/';}else _0x51a752==='.'?_0x34927d=_0x420f7a:_0x34927d=_0x420f7a+'/'+_0x51a752;_0x2e4bbc[_0x47ec38(0x16c)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x34927d);}if(_0x34927d==='/'||_0x34927d==='')return saveSessionContext({'segment_path':undefined},_0x39875b),console[_0x47ec38(0x171)](_0x47ec38(0x17b)),0x0;_0x34927d=normalizePath(_0x34927d);const _0x115c31=parsePath(_0x34927d)[_0x47ec38(0x188)];if(_0x115c31[_0x47ec38(0x189)]===0x0)return saveSessionContext({'segment_path':undefined},_0x39875b),console[_0x47ec38(0x171)](_0x47ec38(0x17b)),0x0;_0x2e4bbc['verbose']&&(console['error'](_0x47ec38(0x187)+_0x2e4bbc[_0x47ec38(0x181)]),console['error'](_0x47ec38(0x17d)+_0x34927d));const _0x41f58e=await withSpinner('Resolving\x20path\x20\x27'+_0x34927d+_0x47ec38(0x173),()=>_0x150b38['segment'][_0x47ec38(0x185)](_0x34927d),{'verbose':_0x2e4bbc[_0x47ec38(0x16c)]}),_0xaf3309=_0x41f58e[_0x47ec38(0x169)];_0x2e4bbc[_0x47ec38(0x16c)]&&(console[_0x47ec38(0x18b)](_0x47ec38(0x180)+_0xaf3309[_0x47ec38(0x162)]),console[_0x47ec38(0x18b)]('Parent\x20ID:\x20'+_0xaf3309[_0x47ec38(0x172)]),_0xaf3309[_0x47ec38(0x17f)]&&console[_0x47ec38(0x18b)](_0x47ec38(0x161)+_0xaf3309[_0x47ec38(0x17f)]));if(_0xaf3309[_0x47ec38(0x162)]===_0x47ec38(0x15b))return console['error'](_0x47ec38(0x18f)),console[_0x47ec38(0x18b)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x47ec38(0x18b)](_0x47ec38(0x16d)+_0xaf3309[_0x47ec38(0x17c)]+(_0xaf3309[_0x47ec38(0x174)]?'/'+_0xaf3309[_0x47ec38(0x174)][_0x47ec38(0x168)]('/'):'')),0x1;return saveSessionContext({'segment_path':_0xaf3309['fullPath'],'parent_segment':_0xaf3309[_0x47ec38(0x17c)]},_0x39875b),console['log'](_0x47ec38(0x178)+_0xaf3309[_0x47ec38(0x17a)]),_0x2e4bbc[_0x47ec38(0x16c)]&&(console[_0x47ec38(0x18b)](_0x47ec38(0x16f)),console['error'](_0x47ec38(0x182)),console[_0x47ec38(0x18b)](_0x47ec38(0x15f))),0x0;}catch(_0x1ed02a){throw _0x1ed02a;}}}
@@ -1 +1 @@
1
- const a29_0x2d727a=a29_0x32d5;(function(_0x4b8ac8,_0x1e1069){const _0x2af43c=a29_0x32d5,_0xd02276=_0x4b8ac8();while(!![]){try{const _0x120197=parseInt(_0x2af43c(0xd3))/0x1*(-parseInt(_0x2af43c(0x103))/0x2)+parseInt(_0x2af43c(0xca))/0x3*(-parseInt(_0x2af43c(0xbe))/0x4)+-parseInt(_0x2af43c(0xc4))/0x5+-parseInt(_0x2af43c(0xd5))/0x6+-parseInt(_0x2af43c(0xda))/0x7*(parseInt(_0x2af43c(0xf5))/0x8)+-parseInt(_0x2af43c(0x104))/0x9+parseInt(_0x2af43c(0xc0))/0xa*(parseInt(_0x2af43c(0xf7))/0xb);if(_0x120197===_0x1e1069)break;else _0xd02276['push'](_0xd02276['shift']());}catch(_0x37d4a4){_0xd02276['push'](_0xd02276['shift']());}}}(a29_0x46b8,0xd9033));import{BaseCommand}from'./command.js';function a29_0x46b8(){const _0x397f6d=['50490VuDqlO','test','length','filter','recursive','\x20segment','384342UjVLwA','site','verbose','Listing\x20parent\x20segments...','👥\x20','\x20folder','name','jsonl','listParents','1bMbdzE','map','8778090idbHyP','sort','folder','✔\x20Found\x20','message','4305mSMgWL','Listing\x20parent\x20segments\x20matching\x20\x27','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','log','maxDepth','Error:\x20','Listing\x20folders\x20and\x20segments...','description','replace','\x20top-level\x20items','Resolving\x20context\x20path\x20\x27','cause','\x5c$&','\x20and\x20','Path/pattern\x20arg:\x20','Parent\x20ID:\x20','execute','\x27...','data','json','segments','(empty)','segment','format','segmentPath','resolvePathToResource','No\x20parent\x20segments\x20match\x20pattern:\x20','1128RHxImR','population','44eEpXyU','Current\x20context:\x20','\x20\x20Cause:\x20','Building\x20hierarchy\x20tree...','✔\x20Built\x20tree\x20with\x20','Site:\x20','localeCompare','listUnified','attributes','folderId','dim','includes','1257586sxrXiS','739044wTEMmJ','parentId','error','listRecursive','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','16tNwjkB','[parent\x20segments]','9180190zszPYC','Folder\x20ID:\x20','List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments','\x20parent\x20segment'];a29_0x46b8=function(){return _0x397f6d;};return a29_0x46b8();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a29_0x32d5(_0x21d354,_0x5d1924){const _0x46b8a6=a29_0x46b8();return a29_0x32d5=function(_0x32d552,_0x414abb){_0x32d552=_0x32d552-0xbd;let _0x5a6c49=_0x46b8a6[_0x32d552];return _0x5a6c49;},a29_0x32d5(_0x21d354,_0x5d1924);}import{formatRows}from'../utils/formatters.js';import a29_0x547f0a from'chalk';export class SegmentsCommand extends BaseCommand{[a29_0x2d727a(0xd0)]=a29_0x2d727a(0xee);[a29_0x2d727a(0xe1)]=a29_0x2d727a(0xc2);async[a29_0x2d727a(0xea)](_0xd1135f){const _0x3b8397=a29_0x2d727a,{options:_0x3a62be,args:_0x4ca2ff}=_0xd1135f,_0x44ef8b=_0x3a62be[_0x3b8397(0xc8)],_0x182cb9=_0x4ca2ff[0x0];try{const _0x37fa00=_0x3a62be[_0x3b8397(0xf2)];_0x3a62be[_0x3b8397(0xcc)]&&(console[_0x3b8397(0x106)](_0x3b8397(0xfc)+_0x3a62be[_0x3b8397(0xcb)]),console[_0x3b8397(0x106)](_0x3b8397(0xf8)+(_0x37fa00||'/')),_0x182cb9&&console['error'](_0x3b8397(0xe8)+_0x182cb9),_0x44ef8b&&console[_0x3b8397(0x106)]('Recursive\x20mode:\x20enabled'));if(_0x182cb9){const _0x2d651a=_0x182cb9[_0x3b8397(0x102)]('*')||_0x182cb9['includes']('?');if(_0x2d651a&&!_0x37fa00)return await this['listParentsWithPattern'](_0xd1135f,_0x182cb9);else return _0x2d651a?(console[_0x3b8397(0x106)](_0x3b8397(0xdc)),console[_0x3b8397(0x106)](_0x3b8397(0xbd)),0x1):_0x44ef8b?await this[_0x3b8397(0x107)](_0xd1135f,_0x182cb9):await this['listUnified'](_0xd1135f,_0x182cb9);}if(!_0x37fa00)return await this[_0x3b8397(0xd2)](_0xd1135f);return _0x44ef8b?await this[_0x3b8397(0x107)](_0xd1135f,_0x37fa00):await this['listUnified'](_0xd1135f,_0x37fa00);}catch(_0x2cddc3){if(_0x2cddc3 instanceof SDKError)return console[_0x3b8397(0x106)](_0x3b8397(0xdf)+_0x2cddc3[_0x3b8397(0xd9)]),_0x2cddc3[_0x3b8397(0xe5)]&&console[_0x3b8397(0x106)](_0x3b8397(0xf9)+_0x2cddc3['cause']),0x1;throw _0x2cddc3;}}async['listParentsWithPattern'](_0x525e1b,_0x13b428){const _0x55226e=a29_0x2d727a,{options:_0x3b3681,tdx:_0x6f8719}=_0x525e1b,_0x4a0fdd=await withSpinner(_0x55226e(0xdb)+_0x13b428+'\x27...',()=>_0x6f8719[_0x55226e(0xf0)][_0x55226e(0xd2)](),{'verbose':_0x3b3681[_0x55226e(0xcc)]}),_0x25e590=_0x4a0fdd['data'],_0x46736e=_0x13b428['replace'](/[.+^${}()|[\]\\]/g,_0x55226e(0xe6))[_0x55226e(0xe2)](/\*/g,'.*')[_0x55226e(0xe2)](/\?/g,'.'),_0x592b84=new RegExp('^'+_0x46736e+'$','i'),_0x461599=_0x25e590[_0x55226e(0xc7)](_0x406fb8=>_0x592b84[_0x55226e(0xc5)](_0x406fb8[_0x55226e(0xff)][_0x55226e(0xd0)]));console[_0x55226e(0x106)](_0x55226e(0xd8)+_0x461599['length']+_0x55226e(0xc3)+(_0x461599[_0x55226e(0xc6)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x13b428+'\x27');if(_0x3b3681['format']===_0x55226e(0xed)||_0x3b3681[_0x55226e(0xf1)]===_0x55226e(0xd1))await handleSDKOutput(_0x461599,_0x3b3681);else{if(_0x461599[_0x55226e(0xc6)]===0x0)console[_0x55226e(0xdd)](_0x55226e(0xf4)+_0x13b428);else{console['log'](_0x55226e(0xbf));for(const _0x358778 of _0x461599){const _0x490cba=_0x358778[_0x55226e(0xff)][_0x55226e(0xf6)]?a29_0x547f0a[_0x55226e(0x101)]('\x20('+formatRows(_0x358778[_0x55226e(0xff)][_0x55226e(0xf6)])+')'):'';console[_0x55226e(0xdd)](_0x55226e(0xce)+_0x358778['attributes'][_0x55226e(0xd0)]+_0x490cba);}}}return 0x0;}async[a29_0x2d727a(0xd2)](_0x3393bb){const _0x47b7a7=a29_0x2d727a,{options:_0x139af4,tdx:_0x39a223}=_0x3393bb,_0x4c367a=await withSpinner(_0x47b7a7(0xcd),()=>_0x39a223[_0x47b7a7(0xf0)][_0x47b7a7(0xd2)](),{'verbose':_0x139af4['verbose']}),_0x5404d0=_0x4c367a['data'];console['error'](_0x47b7a7(0xd8)+_0x5404d0[_0x47b7a7(0xc6)]+'\x20parent\x20segment'+(_0x5404d0[_0x47b7a7(0xc6)]!==0x1?'s':''));if(_0x139af4[_0x47b7a7(0xf1)]===_0x47b7a7(0xed)||_0x139af4[_0x47b7a7(0xf1)]===_0x47b7a7(0xd1))await handleSDKOutput(_0x5404d0,_0x139af4);else{console[_0x47b7a7(0xdd)]('[parent\x20segments]');for(const _0x4ea71e of _0x5404d0){const _0xdab95d=_0x4ea71e['attributes'][_0x47b7a7(0xf6)]?a29_0x547f0a[_0x47b7a7(0x101)]('\x20('+formatRows(_0x4ea71e[_0x47b7a7(0xff)][_0x47b7a7(0xf6)])+')'):'';console[_0x47b7a7(0xdd)](_0x47b7a7(0xce)+_0x4ea71e[_0x47b7a7(0xff)][_0x47b7a7(0xd0)]+_0xdab95d);}}return 0x0;}async[a29_0x2d727a(0xfe)](_0x59d890,_0x4f5120){const _0x1ba0bc=a29_0x2d727a,{options:_0x1e462e,tdx:_0x43a40d}=_0x59d890,_0x37f54b=await withSpinner(_0x1ba0bc(0xe4)+_0x4f5120+_0x1ba0bc(0xeb),()=>_0x43a40d['segment'][_0x1ba0bc(0xf3)](_0x4f5120),{'verbose':_0x1e462e['verbose']}),_0x3f474f=_0x37f54b[_0x1ba0bc(0xec)];_0x1e462e['verbose']&&(console[_0x1ba0bc(0x106)](_0x1ba0bc(0xe9)+_0x3f474f[_0x1ba0bc(0x105)]),_0x3f474f['folderId']&&console['error'](_0x1ba0bc(0xc1)+_0x3f474f[_0x1ba0bc(0x100)]));const _0xf47cf9=await withSpinner(_0x1ba0bc(0xe0),()=>_0x43a40d[_0x1ba0bc(0xf0)]['listUnified'](_0x3f474f[_0x1ba0bc(0x105)],_0x3f474f['folderId']),{'verbose':_0x1e462e[_0x1ba0bc(0xcc)]}),{folders:_0x5a3a4c,segments:_0x28a49d}=_0xf47cf9[_0x1ba0bc(0xec)],_0x445898=_0x5a3a4c[_0x1ba0bc(0xc6)]+_0x28a49d[_0x1ba0bc(0xc6)];console[_0x1ba0bc(0x106)](_0x1ba0bc(0xd8)+_0x5a3a4c[_0x1ba0bc(0xc6)]+_0x1ba0bc(0xcf)+(_0x5a3a4c['length']!==0x1?'s':'')+_0x1ba0bc(0xe7)+_0x28a49d[_0x1ba0bc(0xc6)]+_0x1ba0bc(0xc9)+(_0x28a49d[_0x1ba0bc(0xc6)]!==0x1?'s':''));if(_0x1e462e[_0x1ba0bc(0xf1)]==='json'||_0x1e462e[_0x1ba0bc(0xf1)]===_0x1ba0bc(0xd1)){const _0x29318d=[..._0x5a3a4c['map'](_0x50b538=>({..._0x50b538,'type':_0x1ba0bc(0xd7)})),..._0x28a49d[_0x1ba0bc(0xd4)](_0x4970a2=>({..._0x4970a2,'type':_0x1ba0bc(0xf0)}))][_0x1ba0bc(0xd6)]((_0x4eb8ed,_0x492479)=>_0x4eb8ed[_0x1ba0bc(0xd0)][_0x1ba0bc(0xfd)](_0x492479['name']));await handleSDKOutput(_0x29318d,_0x1e462e);}else{if(_0x445898===0x0)console[_0x1ba0bc(0xdd)](a29_0x547f0a['dim']('[/'+_0x4f5120+']')),console[_0x1ba0bc(0xdd)](_0x1ba0bc(0xef));else{console['log'](a29_0x547f0a['dim']('[/'+_0x4f5120+']'));const _0x2c5b0e=formatFlatList(_0x5a3a4c,_0x28a49d,{'showMetadata':!![]});console['log'](_0x2c5b0e);}}return 0x0;}async[a29_0x2d727a(0x107)](_0x41a87c,_0x58188c){const _0x44ff96=a29_0x2d727a,{options:_0x25b2ac,tdx:_0x38ec0e}=_0x41a87c,_0xf8e90b=await withSpinner(_0x44ff96(0xe4)+_0x58188c+'\x27...',()=>_0x38ec0e[_0x44ff96(0xf0)][_0x44ff96(0xf3)](_0x58188c),{'verbose':_0x25b2ac[_0x44ff96(0xcc)]}),_0x4704c4=_0xf8e90b['data'];_0x25b2ac[_0x44ff96(0xcc)]&&(console[_0x44ff96(0x106)](_0x44ff96(0xe9)+_0x4704c4[_0x44ff96(0x105)]),_0x4704c4[_0x44ff96(0x100)]&&console[_0x44ff96(0x106)](_0x44ff96(0xc1)+_0x4704c4[_0x44ff96(0x100)]));const _0x4b32fb=_0x25b2ac[_0x44ff96(0xde)]||0xa,_0x47c1b8=await withSpinner(_0x44ff96(0xfa),()=>_0x38ec0e['segment'][_0x44ff96(0x107)](_0x4704c4[_0x44ff96(0x105)],_0x4704c4[_0x44ff96(0x100)],0x0,_0x4b32fb),{'verbose':_0x25b2ac[_0x44ff96(0xcc)]}),_0x28700d=_0x47c1b8[_0x44ff96(0xec)];console['error'](_0x44ff96(0xfb)+_0x28700d['length']+_0x44ff96(0xe3));if(_0x25b2ac[_0x44ff96(0xf1)]===_0x44ff96(0xed)||_0x25b2ac[_0x44ff96(0xf1)]===_0x44ff96(0xd1))await handleSDKOutput(_0x28700d,_0x25b2ac);else{console['log'](a29_0x547f0a[_0x44ff96(0x101)]('[/'+_0x58188c+']'));const _0x38a90e=formatTree(_0x28700d,{'showMetadata':!![]});console['log'](_0x38a90e);}return 0x0;}}
1
+ const a29_0x4fb829=a29_0x2883;(function(_0x3af1e4,_0x5f3dbf){const _0x4522c2=a29_0x2883,_0x1d58ce=_0x3af1e4();while(!![]){try{const _0x5f5c42=-parseInt(_0x4522c2(0x146))/0x1+-parseInt(_0x4522c2(0x12d))/0x2*(parseInt(_0x4522c2(0x162))/0x3)+-parseInt(_0x4522c2(0x16f))/0x4+-parseInt(_0x4522c2(0x140))/0x5+-parseInt(_0x4522c2(0x164))/0x6*(-parseInt(_0x4522c2(0x156))/0x7)+-parseInt(_0x4522c2(0x148))/0x8*(-parseInt(_0x4522c2(0x139))/0x9)+parseInt(_0x4522c2(0x14c))/0xa;if(_0x5f5c42===_0x5f3dbf)break;else _0x1d58ce['push'](_0x1d58ce['shift']());}catch(_0x27d2ea){_0x1d58ce['push'](_0x1d58ce['shift']());}}}(a29_0x1598,0x4dd55));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';function a29_0x2883(_0x32cd63,_0x2ff1ba){const _0x1598d2=a29_0x1598();return a29_0x2883=function(_0x288325,_0x599e51){_0x288325=_0x288325-0x12d;let _0x10923c=_0x1598d2[_0x288325];return _0x10923c;},a29_0x2883(_0x32cd63,_0x2ff1ba);}import{formatRows}from'../utils/formatters.js';function a29_0x1598(){const _0x7385f6=['folder','description','Listing\x20folders\x20and\x20segments...','👥\x20','listUnified','\x20matching\x20\x27','name','parentId','554511rFtCZA','Clear\x20context\x20with:\x20tdx\x20segment\x20use\x20/','22566Hjjtce','map','listParentsWithPattern','\x20parent\x20segment','segment','\x27...','log','✔\x20Found\x20','\x20\x20Cause:\x20','maxDepth','json','62176wxjiJw','jsonl','Recursive\x20mode:\x20enabled','population','\x20segment','site','4TxMQhu','[parent\x20segments]','error','Folder\x20ID:\x20','✔\x20Built\x20tree\x20with\x20','data','folderId','localeCompare','segments','Error:\x20','recursive','listParents','5139bMjlCH','replace','includes','format','\x20folder','dim','Listing\x20parent\x20segments\x20matching\x20\x27','1995015cevkzV','attributes','segmentPath','(empty)','test','Error:\x20Pattern\x20matching\x20is\x20only\x20supported\x20at\x20root\x20level\x20(no\x20context\x20set).','341290OoJtzG','execute','8680XUBPFl','Site:\x20','sort','message','5276620EkEXlz','\x20and\x20','Resolving\x20context\x20path\x20\x27','resolvePathToResource','filter','verbose','listRecursive','Building\x20hierarchy\x20tree...','\x5c$&','Parent\x20ID:\x20','553kUfLpV','cause','No\x20parent\x20segments\x20match\x20pattern:\x20','length'];a29_0x1598=function(){return _0x7385f6;};return a29_0x1598();}import a29_0x3a804c from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a29_0x4fb829(0x135);[a29_0x4fb829(0x15b)]='List\x20parent\x20segments,\x20folders,\x20and\x20child\x20segments';async[a29_0x4fb829(0x147)](_0xef903d){const _0xa6e634=a29_0x4fb829,{options:_0x1cc4c8,args:_0x2cbc44}=_0xef903d,_0xe34b02=_0x1cc4c8[_0xa6e634(0x137)],_0x4646f1=_0x2cbc44[0x0];try{const _0x2dfedf=_0x1cc4c8[_0xa6e634(0x142)];_0x1cc4c8[_0xa6e634(0x151)]&&(console[_0xa6e634(0x12f)](_0xa6e634(0x149)+_0x1cc4c8[_0xa6e634(0x174)]),console[_0xa6e634(0x12f)]('Current\x20context:\x20'+(_0x2dfedf||'/')),_0x4646f1&&console[_0xa6e634(0x12f)]('Path/pattern\x20arg:\x20'+_0x4646f1),_0xe34b02&&console[_0xa6e634(0x12f)](_0xa6e634(0x171)));if(_0x4646f1){const _0x1561fb=_0x4646f1[_0xa6e634(0x13b)]('*')||_0x4646f1['includes']('?');if(_0x1561fb&&!_0x2dfedf)return await this[_0xa6e634(0x166)](_0xef903d,_0x4646f1);else return _0x1561fb?(console[_0xa6e634(0x12f)](_0xa6e634(0x145)),console[_0xa6e634(0x12f)](_0xa6e634(0x163)),0x1):_0xe34b02?await this[_0xa6e634(0x152)](_0xef903d,_0x4646f1):await this[_0xa6e634(0x15e)](_0xef903d,_0x4646f1);}if(!_0x2dfedf)return await this[_0xa6e634(0x138)](_0xef903d);return _0xe34b02?await this[_0xa6e634(0x152)](_0xef903d,_0x2dfedf):await this[_0xa6e634(0x15e)](_0xef903d,_0x2dfedf);}catch(_0x42ac81){if(_0x42ac81 instanceof SDKError)return console[_0xa6e634(0x12f)](_0xa6e634(0x136)+_0x42ac81[_0xa6e634(0x14b)]),_0x42ac81[_0xa6e634(0x157)]&&console[_0xa6e634(0x12f)](_0xa6e634(0x16c)+_0x42ac81[_0xa6e634(0x157)]),0x1;throw _0x42ac81;}}async['listParentsWithPattern'](_0x3f0c79,_0xffdf12){const _0x1f4736=a29_0x4fb829,{options:_0x335b37,tdx:_0x1aaf7c}=_0x3f0c79,_0x1c1ebb=await withSpinner(_0x1f4736(0x13f)+_0xffdf12+_0x1f4736(0x169),()=>_0x1aaf7c[_0x1f4736(0x168)][_0x1f4736(0x138)](),{'verbose':_0x335b37['verbose']}),_0x5968e0=_0x1c1ebb[_0x1f4736(0x132)],_0x11e797=_0xffdf12['replace'](/[.+^${}()|[\]\\]/g,_0x1f4736(0x154))[_0x1f4736(0x13a)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x5ce015=new RegExp('^'+_0x11e797+'$','i'),_0x4b711f=_0x5968e0[_0x1f4736(0x150)](_0x25a32c=>_0x5ce015[_0x1f4736(0x144)](_0x25a32c[_0x1f4736(0x141)]['name']));console[_0x1f4736(0x12f)](_0x1f4736(0x16b)+_0x4b711f[_0x1f4736(0x159)]+_0x1f4736(0x167)+(_0x4b711f[_0x1f4736(0x159)]!==0x1?'s':'')+_0x1f4736(0x15f)+_0xffdf12+'\x27');if(_0x335b37['format']===_0x1f4736(0x16e)||_0x335b37[_0x1f4736(0x13c)]===_0x1f4736(0x170))await handleSDKOutput(_0x4b711f,_0x335b37);else{if(_0x4b711f[_0x1f4736(0x159)]===0x0)console[_0x1f4736(0x16a)](_0x1f4736(0x158)+_0xffdf12);else{console['log']('[parent\x20segments]');for(const _0x17f61d of _0x4b711f){const _0x100b89=_0x17f61d[_0x1f4736(0x141)][_0x1f4736(0x172)]?a29_0x3a804c[_0x1f4736(0x13e)]('\x20('+formatRows(_0x17f61d[_0x1f4736(0x141)]['population'])+')'):'';console[_0x1f4736(0x16a)](_0x1f4736(0x15d)+_0x17f61d[_0x1f4736(0x141)][_0x1f4736(0x160)]+_0x100b89);}}}return 0x0;}async[a29_0x4fb829(0x138)](_0x4068ab){const _0xc720ee=a29_0x4fb829,{options:_0x3bd4ba,tdx:_0x277465}=_0x4068ab,_0x569088=await withSpinner('Listing\x20parent\x20segments...',()=>_0x277465[_0xc720ee(0x168)][_0xc720ee(0x138)](),{'verbose':_0x3bd4ba[_0xc720ee(0x151)]}),_0x45adc2=_0x569088[_0xc720ee(0x132)];console[_0xc720ee(0x12f)](_0xc720ee(0x16b)+_0x45adc2['length']+'\x20parent\x20segment'+(_0x45adc2[_0xc720ee(0x159)]!==0x1?'s':''));if(_0x3bd4ba['format']===_0xc720ee(0x16e)||_0x3bd4ba['format']===_0xc720ee(0x170))await handleSDKOutput(_0x45adc2,_0x3bd4ba);else{console[_0xc720ee(0x16a)](_0xc720ee(0x12e));for(const _0x24d51c of _0x45adc2){const _0x1f7b6c=_0x24d51c[_0xc720ee(0x141)][_0xc720ee(0x172)]?a29_0x3a804c['dim']('\x20('+formatRows(_0x24d51c[_0xc720ee(0x141)][_0xc720ee(0x172)])+')'):'';console[_0xc720ee(0x16a)]('👥\x20'+_0x24d51c['attributes']['name']+_0x1f7b6c);}}return 0x0;}async[a29_0x4fb829(0x15e)](_0x29a30d,_0x4abc1f){const _0x336099=a29_0x4fb829,{options:_0x3d42b7,tdx:_0xf754a4}=_0x29a30d,_0x2a0017=await withSpinner(_0x336099(0x14e)+_0x4abc1f+_0x336099(0x169),()=>_0xf754a4[_0x336099(0x168)][_0x336099(0x14f)](_0x4abc1f),{'verbose':_0x3d42b7['verbose']}),_0x4b3ea5=_0x2a0017[_0x336099(0x132)];_0x3d42b7[_0x336099(0x151)]&&(console['error'](_0x336099(0x155)+_0x4b3ea5[_0x336099(0x161)]),_0x4b3ea5[_0x336099(0x133)]&&console[_0x336099(0x12f)]('Folder\x20ID:\x20'+_0x4b3ea5[_0x336099(0x133)]));const _0x4fa838=await withSpinner(_0x336099(0x15c),()=>_0xf754a4[_0x336099(0x168)][_0x336099(0x15e)](_0x4b3ea5[_0x336099(0x161)],_0x4b3ea5[_0x336099(0x133)]),{'verbose':_0x3d42b7[_0x336099(0x151)]}),{folders:_0x6923af,segments:_0x27a1c4}=_0x4fa838[_0x336099(0x132)],_0xdcfec9=_0x6923af[_0x336099(0x159)]+_0x27a1c4['length'];console[_0x336099(0x12f)](_0x336099(0x16b)+_0x6923af[_0x336099(0x159)]+_0x336099(0x13d)+(_0x6923af[_0x336099(0x159)]!==0x1?'s':'')+_0x336099(0x14d)+_0x27a1c4[_0x336099(0x159)]+_0x336099(0x173)+(_0x27a1c4[_0x336099(0x159)]!==0x1?'s':''));if(_0x3d42b7['format']==='json'||_0x3d42b7[_0x336099(0x13c)]===_0x336099(0x170)){const _0x33919e=[..._0x6923af[_0x336099(0x165)](_0x47b7be=>({..._0x47b7be,'type':_0x336099(0x15a)})),..._0x27a1c4[_0x336099(0x165)](_0x5e0f33=>({..._0x5e0f33,'type':_0x336099(0x168)}))][_0x336099(0x14a)]((_0x528536,_0x10f335)=>_0x528536['name'][_0x336099(0x134)](_0x10f335[_0x336099(0x160)]));await handleSDKOutput(_0x33919e,_0x3d42b7);}else{if(_0xdcfec9===0x0)console[_0x336099(0x16a)](a29_0x3a804c[_0x336099(0x13e)]('[/'+_0x4abc1f+']')),console['log'](_0x336099(0x143));else{console[_0x336099(0x16a)](a29_0x3a804c['dim']('[/'+_0x4abc1f+']'));const _0x3a04f5=formatFlatList(_0x6923af,_0x27a1c4,{'showMetadata':!![]});console[_0x336099(0x16a)](_0x3a04f5);}}return 0x0;}async[a29_0x4fb829(0x152)](_0x173e78,_0x599a6f){const _0x5582c8=a29_0x4fb829,{options:_0x1b6698,tdx:_0x1c787b}=_0x173e78,_0xe9da6e=await withSpinner(_0x5582c8(0x14e)+_0x599a6f+_0x5582c8(0x169),()=>_0x1c787b[_0x5582c8(0x168)]['resolvePathToResource'](_0x599a6f),{'verbose':_0x1b6698[_0x5582c8(0x151)]}),_0xe5c762=_0xe9da6e['data'];_0x1b6698[_0x5582c8(0x151)]&&(console['error'](_0x5582c8(0x155)+_0xe5c762[_0x5582c8(0x161)]),_0xe5c762[_0x5582c8(0x133)]&&console['error'](_0x5582c8(0x130)+_0xe5c762[_0x5582c8(0x133)]));const _0x534d9d=_0x1b6698[_0x5582c8(0x16d)]||0xa,_0x4b8bfe=await withSpinner(_0x5582c8(0x153),()=>_0x1c787b[_0x5582c8(0x168)][_0x5582c8(0x152)](_0xe5c762[_0x5582c8(0x161)],_0xe5c762[_0x5582c8(0x133)],0x0,_0x534d9d),{'verbose':_0x1b6698['verbose']}),_0x4df7cc=_0x4b8bfe[_0x5582c8(0x132)];console[_0x5582c8(0x12f)](_0x5582c8(0x131)+_0x4df7cc[_0x5582c8(0x159)]+'\x20top-level\x20items');if(_0x1b6698[_0x5582c8(0x13c)]===_0x5582c8(0x16e)||_0x1b6698['format']===_0x5582c8(0x170))await handleSDKOutput(_0x4df7cc,_0x1b6698);else{console['log'](a29_0x3a804c[_0x5582c8(0x13e)]('[/'+_0x599a6f+']'));const _0x4df0b8=formatTree(_0x4df7cc,{'showMetadata':!![]});console[_0x5582c8(0x16a)](_0x4df0b8);}return 0x0;}}
@@ -1 +1 @@
1
- const a30_0x43d28f=a30_0x3bb4;function a30_0x3f00(){const _0x410add=['315tecBOQ','10274960vfVTFI','9oNFoco','catalog','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','limit','query','Limit:\x20','cause','15767700PtjaJA','Querying\x20','✔\x20Retrieved\x20','Site:\x20','Show\x20table\x20contents','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','\x20from\x20','654ctXIBO','validate','showTable','table','72478AKYWDq','108283yVvKtW','1379409jCJSUx','error','...','database','\x20\x20Cause:\x20','Error:\x20','name','show','60212JNnJKx','message','55304469RQrxTb','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Usage:\x20tdx\x20show\x20<database.table>','args','execute','verbose','data','24IjohIX','Database:\x20','description'];a30_0x3f00=function(){return _0x410add;};return a30_0x3f00();}(function(_0x4951cb,_0x803128){const _0x33984d=a30_0x3bb4,_0x4f1074=_0x4951cb();while(!![]){try{const _0x2a8a92=-parseInt(_0x33984d(0xcd))/0x1*(-parseInt(_0x33984d(0xe6))/0x2)+-parseInt(_0x33984d(0xe8))/0x3+parseInt(_0x33984d(0xf0))/0x4*(parseInt(_0x33984d(0xd0))/0x5)+-parseInt(_0x33984d(0xe2))/0x6*(-parseInt(_0x33984d(0xe7))/0x7)+-parseInt(_0x33984d(0xd1))/0x8*(-parseInt(_0x33984d(0xd2))/0x9)+parseInt(_0x33984d(0xd9))/0xa+-parseInt(_0x33984d(0xc6))/0xb;if(_0x2a8a92===_0x803128)break;else _0x4f1074['push'](_0x4f1074['shift']());}catch(_0x354602){_0x4f1074['push'](_0x4f1074['shift']());}}}(a30_0x3f00,0xd651e));import{BaseCommand}from'./command.js';function a30_0x3bb4(_0x2486c2,_0x1254ff){const _0x3f0085=a30_0x3f00();return a30_0x3bb4=function(_0x3bb4fb,_0x9e1444){_0x3bb4fb=_0x3bb4fb-0xc5;let _0xd28f35=_0x3f0085[_0x3bb4fb];return _0xd28f35;},a30_0x3bb4(_0x2486c2,_0x1254ff);}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a30_0x43d28f(0xee)]=a30_0x43d28f(0xef);[a30_0x43d28f(0xcf)]=a30_0x43d28f(0xdd);async[a30_0x43d28f(0xca)](_0x5caa81){const _0x239b99=a30_0x43d28f;return this[_0x239b99(0xe4)](_0x5caa81);}async[a30_0x43d28f(0xe4)](_0x147bfb){const _0x1f07e1=a30_0x43d28f,{options:_0x66f908,args:_0x953647,tdx:_0xdaf8a2}=_0x147bfb;let _0x4a6547;try{_0x4a6547=parseTableReference(_0x953647[0x0]);const _0x320f3a=_0x66f908[_0x1f07e1(0xeb)];!_0x4a6547[_0x1f07e1(0xeb)]&&_0x320f3a&&(_0x4a6547[_0x1f07e1(0xeb)]=_0x320f3a);const _0x570bb4=validateTableDescribeReference(_0x4a6547);if(_0x570bb4)return console[_0x1f07e1(0xe9)](_0x1f07e1(0xed)+_0x570bb4),console[_0x1f07e1(0xe9)](_0x1f07e1(0xc8)),console['error'](_0x1f07e1(0xd4)),console['error'](_0x1f07e1(0xde)),0x1;}catch(_0x100d80){return console['error']('Error:\x20'+_0x100d80[_0x1f07e1(0xc5)]),console[_0x1f07e1(0xe9)](_0x1f07e1(0xc8)),console[_0x1f07e1(0xe9)](_0x1f07e1(0xd4)),console['error'](_0x1f07e1(0xde)),0x1;}const _0x3dea45=_0x4a6547[_0x1f07e1(0xd3)],_0x33c144=_0x4a6547[_0x1f07e1(0xeb)],_0x21764b=_0x4a6547[_0x1f07e1(0xe5)],_0x4f3ca6=resolveLimit(_0x66f908[_0x1f07e1(0xd5)],DEFAULT_DISPLAY_LIMIT);try{_0x66f908[_0x1f07e1(0xcb)]&&(console[_0x1f07e1(0xe9)](_0x1f07e1(0xdc)+_0x66f908['site']),_0x3dea45&&console[_0x1f07e1(0xe9)]('Catalog:\x20'+_0x3dea45),console[_0x1f07e1(0xe9)](_0x1f07e1(0xce)+_0x33c144),console[_0x1f07e1(0xe9)]('Table:\x20'+_0x21764b),console[_0x1f07e1(0xe9)](_0x1f07e1(0xd7)+_0x4f3ca6));const _0x3bc7b5=_0x3dea45?_0x3dea45+'.'+_0x33c144+'.'+_0x21764b:_0x33c144+'.'+_0x21764b,_0x2d0e14=await withSpinner(_0x1f07e1(0xda)+_0x3bc7b5+_0x1f07e1(0xea),()=>_0xdaf8a2[_0x1f07e1(0xd6)][_0x1f07e1(0xe4)](_0x33c144,_0x21764b,_0x4f3ca6,_0x3dea45),{'verbose':_0x66f908[_0x1f07e1(0xcb)]}),_0x3a9cc8=_0x2d0e14[_0x1f07e1(0xcc)],_0x35bab2=_0x3a9cc8[_0x1f07e1(0xcc)];return _0x35bab2[_0x1f07e1(0xe0)]===0x0?console[_0x1f07e1(0xe9)](_0x1f07e1(0xc7)):console[_0x1f07e1(0xe9)](_0x1f07e1(0xdb)+_0x35bab2[_0x1f07e1(0xe0)]+'\x20row'+(_0x35bab2[_0x1f07e1(0xe0)]!==0x1?'s':'')+_0x1f07e1(0xe1)+_0x3bc7b5),await handleSDKOutput(_0x35bab2,_0x66f908),0x0;}catch(_0x57e55f){if(_0x57e55f instanceof SDKError)return console[_0x1f07e1(0xe9)]('Error:\x20'+_0x57e55f[_0x1f07e1(0xc5)]),_0x57e55f['cause']&&console[_0x1f07e1(0xe9)](_0x1f07e1(0xec)+_0x57e55f[_0x1f07e1(0xd8)]),0x1;throw _0x57e55f;}}[a30_0x43d28f(0xe3)](_0x30e09c){const _0x13ff48=a30_0x43d28f;if(_0x30e09c[_0x13ff48(0xc9)]['length']===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x30e09c[_0x13ff48(0xc9)][_0x13ff48(0xe0)]>0x1)return _0x13ff48(0xdf);return undefined;}}
1
+ const a30_0x72a4d8=a30_0x48ba;(function(_0x32e049,_0x114cc5){const _0x3dbbe5=a30_0x48ba,_0x3c5705=_0x32e049();while(!![]){try{const _0x2f1fdf=-parseInt(_0x3dbbe5(0xff))/0x1+-parseInt(_0x3dbbe5(0x10d))/0x2+parseInt(_0x3dbbe5(0x118))/0x3*(parseInt(_0x3dbbe5(0x106))/0x4)+parseInt(_0x3dbbe5(0xfe))/0x5*(parseInt(_0x3dbbe5(0x10c))/0x6)+-parseInt(_0x3dbbe5(0xfc))/0x7+-parseInt(_0x3dbbe5(0x107))/0x8+parseInt(_0x3dbbe5(0x11a))/0x9;if(_0x2f1fdf===_0x114cc5)break;else _0x3c5705['push'](_0x3c5705['shift']());}catch(_0x412c40){_0x3c5705['push'](_0x3c5705['shift']());}}}(a30_0x247c,0xc3d29));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a30_0x48ba(_0x1f0ac3,_0x32cf75){const _0x247cc6=a30_0x247c();return a30_0x48ba=function(_0x48ba5b,_0x490ae2){_0x48ba5b=_0x48ba5b-0xfa;let _0x3c5bbb=_0x247cc6[_0x48ba5b];return _0x3c5bbb;},a30_0x48ba(_0x1f0ac3,_0x32cf75);}function a30_0x247c(){const _0x3f8494=['validate','message','6AkZbPV','852786FRraRz','data','database','description','query','...','Limit:\x20','error','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','name','\x20row','3xhdVAl','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','11154348ndZUOI','cause','execute','Database:\x20','\x20\x20Cause:\x20','✔\x20Retrieved\x20','Usage:\x20tdx\x20show\x20<database.table>','Querying\x20','4550Uxddif','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','2013395rrxRsb','1060738IVPVQE','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','show','showTable','Table:\x20','verbose','Error:\x20','4840636xujJIe','4498720ewyaoT','\x20from\x20','length'];a30_0x247c=function(){return _0x3f8494;};return a30_0x247c();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a30_0x72a4d8(0x116)]=a30_0x72a4d8(0x101);[a30_0x72a4d8(0x110)]='Show\x20table\x20contents';async[a30_0x72a4d8(0x11c)](_0x49b2bd){const _0x1dd5e6=a30_0x72a4d8;return this[_0x1dd5e6(0x102)](_0x49b2bd);}async[a30_0x72a4d8(0x102)](_0x41da61){const _0x4faf00=a30_0x72a4d8,{options:_0x114b2e,args:_0x1714c7,tdx:_0x226657}=_0x41da61;let _0x528843;try{_0x528843=parseTableReference(_0x1714c7[0x0]);const _0xcb065f=_0x114b2e['database'];!_0x528843[_0x4faf00(0x10f)]&&_0xcb065f&&(_0x528843['database']=_0xcb065f);const _0x3f56fb=validateTableDescribeReference(_0x528843);if(_0x3f56fb)return console[_0x4faf00(0x114)](_0x4faf00(0x105)+_0x3f56fb),console[_0x4faf00(0x114)](_0x4faf00(0xfa)),console[_0x4faf00(0x114)](_0x4faf00(0xfd)),console['error'](_0x4faf00(0x119)),0x1;}catch(_0x428327){return console[_0x4faf00(0x114)](_0x4faf00(0x105)+_0x428327[_0x4faf00(0x10b)]),console['error'](_0x4faf00(0xfa)),console[_0x4faf00(0x114)](_0x4faf00(0xfd)),console[_0x4faf00(0x114)](_0x4faf00(0x119)),0x1;}const _0x1c5f30=_0x528843['catalog'],_0xedb75=_0x528843[_0x4faf00(0x10f)],_0x4603dc=_0x528843['table'],_0x133920=resolveLimit(_0x114b2e['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x114b2e[_0x4faf00(0x104)]&&(console['error']('Site:\x20'+_0x114b2e['site']),_0x1c5f30&&console['error']('Catalog:\x20'+_0x1c5f30),console[_0x4faf00(0x114)](_0x4faf00(0x11d)+_0xedb75),console['error'](_0x4faf00(0x103)+_0x4603dc),console[_0x4faf00(0x114)](_0x4faf00(0x113)+_0x133920));const _0x4a9706=_0x1c5f30?_0x1c5f30+'.'+_0xedb75+'.'+_0x4603dc:_0xedb75+'.'+_0x4603dc,_0x702bed=await withSpinner(_0x4faf00(0xfb)+_0x4a9706+_0x4faf00(0x112),()=>_0x226657[_0x4faf00(0x111)][_0x4faf00(0x102)](_0xedb75,_0x4603dc,_0x133920,_0x1c5f30),{'verbose':_0x114b2e[_0x4faf00(0x104)]}),_0x343564=_0x702bed[_0x4faf00(0x10e)],_0x3100ed=_0x343564['data'];return _0x3100ed[_0x4faf00(0x109)]===0x0?console[_0x4faf00(0x114)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x4faf00(0x114)](_0x4faf00(0x11f)+_0x3100ed[_0x4faf00(0x109)]+_0x4faf00(0x117)+(_0x3100ed[_0x4faf00(0x109)]!==0x1?'s':'')+_0x4faf00(0x108)+_0x4a9706),await handleSDKOutput(_0x3100ed,_0x114b2e),0x0;}catch(_0x5ad29f){if(_0x5ad29f instanceof SDKError)return console[_0x4faf00(0x114)](_0x4faf00(0x105)+_0x5ad29f[_0x4faf00(0x10b)]),_0x5ad29f[_0x4faf00(0x11b)]&&console[_0x4faf00(0x114)](_0x4faf00(0x11e)+_0x5ad29f['cause']),0x1;throw _0x5ad29f;}}[a30_0x72a4d8(0x10a)](_0x4c284e){const _0x12ad98=a30_0x72a4d8;if(_0x4c284e['args']['length']===0x0)return _0x12ad98(0x100);if(_0x4c284e['args'][_0x12ad98(0x109)]>0x1)return _0x12ad98(0x115);return undefined;}}