@treasuredata/tdx 0.8.0 → 0.8.2

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 (125) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client/cdp-api-client.js +1 -1
  8. package/dist/client/engage-api-client.js +1 -1
  9. package/dist/client/http-client.js +1 -1
  10. package/dist/client/llm-api-client.js +1 -1
  11. package/dist/client/rate-limiter.js +1 -1
  12. package/dist/client/td-api-client.d.ts +2 -0
  13. package/dist/client/td-api-client.d.ts.map +1 -1
  14. package/dist/client/td-api-client.js +1 -1
  15. package/dist/client/td-api-client.js.map +1 -1
  16. package/dist/client/trino-api-client.js +1 -1
  17. package/dist/client/workflow-client.js +1 -1
  18. package/dist/commands/activations.js +1 -1
  19. package/dist/commands/api-command.js +1 -1
  20. package/dist/commands/auth-command.js +1 -1
  21. package/dist/commands/chat-command.js +1 -1
  22. package/dist/commands/claude-command.d.ts.map +1 -1
  23. package/dist/commands/claude-command.js +1 -1
  24. package/dist/commands/claude-command.js.map +1 -1
  25. package/dist/commands/claude-statusline-command.d.ts +1 -1
  26. package/dist/commands/claude-statusline-command.d.ts.map +1 -1
  27. package/dist/commands/claude-statusline-command.js +1 -1
  28. package/dist/commands/claude-statusline-command.js.map +1 -1
  29. package/dist/commands/claude-usage-command.js +1 -1
  30. package/dist/commands/command.js +1 -1
  31. package/dist/commands/connection-command.js +1 -1
  32. package/dist/commands/context-command.js +1 -1
  33. package/dist/commands/databases.js +1 -1
  34. package/dist/commands/describe.js +1 -1
  35. package/dist/commands/engage-command.js +1 -1
  36. package/dist/commands/job-command.js +1 -1
  37. package/dist/commands/llm-command.js +1 -1
  38. package/dist/commands/llm-proxy.js +1 -1
  39. package/dist/commands/parent-segment-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/config.d.ts +26 -0
  57. package/dist/core/config.d.ts.map +1 -1
  58. package/dist/core/config.js +1 -1
  59. package/dist/core/config.js.map +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/credential-cache.js +1 -1
  62. package/dist/core/global-context.js +1 -1
  63. package/dist/core/keychain.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/index.js +1 -1
  69. package/dist/proxy/anthropic-adapter.js +1 -1
  70. package/dist/proxy/claude-usage-tracker.js +1 -1
  71. package/dist/proxy/context-signature.js +1 -1
  72. package/dist/proxy/conversation-utils.js +1 -1
  73. package/dist/proxy/server.js +1 -1
  74. package/dist/proxy/session-cache.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/connection.js +1 -1
  77. package/dist/sdk/engage.js +1 -1
  78. package/dist/sdk/errors.js +1 -1
  79. package/dist/sdk/index.js +1 -1
  80. package/dist/sdk/job.js +1 -1
  81. package/dist/sdk/llm.js +1 -1
  82. package/dist/sdk/query.js +1 -1
  83. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  84. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  85. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  86. package/dist/sdk/segment.js +1 -1
  87. package/dist/sdk/user.js +1 -1
  88. package/dist/sdk/workflow.js +1 -1
  89. package/dist/types/endpoints.js +1 -1
  90. package/dist/types/index.d.ts +20 -1
  91. package/dist/types/index.d.ts.map +1 -1
  92. package/dist/types/index.js +1 -1
  93. package/dist/types/index.js.map +1 -1
  94. package/dist/utils/agent-ref-parser.js +1 -1
  95. package/dist/utils/async.js +1 -1
  96. package/dist/utils/chat-cache.js +1 -1
  97. package/dist/utils/colors.js +1 -1
  98. package/dist/utils/command-output.js +1 -1
  99. package/dist/utils/constants.js +1 -1
  100. package/dist/utils/diff.js +1 -1
  101. package/dist/utils/fields-display.js +1 -1
  102. package/dist/utils/file-permissions.js +1 -1
  103. package/dist/utils/format-detector.js +1 -1
  104. package/dist/utils/formatters.js +1 -1
  105. package/dist/utils/json-loader.js +1 -1
  106. package/dist/utils/llm-backup-utils.js +1 -1
  107. package/dist/utils/model-aliases.js +1 -1
  108. package/dist/utils/model-factors.js +1 -1
  109. package/dist/utils/option-validation.js +1 -1
  110. package/dist/utils/port.js +1 -1
  111. package/dist/utils/process.js +1 -1
  112. package/dist/utils/prompt.js +1 -1
  113. package/dist/utils/segment-path-parser.js +1 -1
  114. package/dist/utils/segment-ref-parser.js +1 -1
  115. package/dist/utils/spinner.js +1 -1
  116. package/dist/utils/sql-parser.js +1 -1
  117. package/dist/utils/sse-parser.js +1 -1
  118. package/dist/utils/string-utils.js +1 -1
  119. package/dist/utils/table-ref-parser.js +1 -1
  120. package/dist/utils/tdx-config.js +1 -1
  121. package/dist/utils/tdx-logger.js +1 -1
  122. package/dist/utils/tree-formatter.js +1 -1
  123. package/dist/utils/version-check.js +1 -1
  124. package/dist/utils/workflow-utils.js +1 -1
  125. package/package.json +1 -1
@@ -1 +1 @@
1
- const a33_0x40d9c1=a33_0x52b2;(function(_0xbf0b51,_0x24f0f5){const _0x2934b8=a33_0x52b2,_0x53c7bf=_0xbf0b51();while(!![]){try{const _0x26a244=parseInt(_0x2934b8(0xa6))/0x1*(parseInt(_0x2934b8(0xfe))/0x2)+-parseInt(_0x2934b8(0xcc))/0x3*(parseInt(_0x2934b8(0xec))/0x4)+parseInt(_0x2934b8(0xae))/0x5+-parseInt(_0x2934b8(0xbd))/0x6*(parseInt(_0x2934b8(0xbf))/0x7)+parseInt(_0x2934b8(0xe9))/0x8*(parseInt(_0x2934b8(0xfc))/0x9)+parseInt(_0x2934b8(0xf6))/0xa*(parseInt(_0x2934b8(0xf0))/0xb)+parseInt(_0x2934b8(0xd1))/0xc*(-parseInt(_0x2934b8(0xd5))/0xd);if(_0x26a244===_0x24f0f5)break;else _0x53c7bf['push'](_0x53c7bf['shift']());}catch(_0x4b92ed){_0x53c7bf['push'](_0x53c7bf['shift']());}}}(a33_0x1d1b,0x4d565));import{BaseCommand}from'./command.js';import{withSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString}from'../sdk/segment/child-segment-yaml.js';import a33_0x1feed2 from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a33_0x53f8f8 from'path';export class SegmentPullCommand extends BaseCommand{['name']=a33_0x40d9c1(0xd9);[a33_0x40d9c1(0xa5)]=a33_0x40d9c1(0xcf);async[a33_0x40d9c1(0xcd)](_0x3d33a5){const _0x4a052c=a33_0x40d9c1,{options:_0x26977b,args:_0x47474d,tdx:_0xb819d}=_0x3d33a5,_0x2e4bca=_0x26977b,_0x2d6a27=_0x26977b[_0x4a052c(0xc6)],_0x164943=_0x47474d[0x0],_0x2571f4=findTdxConfigPath();let _0x5c8437,_0x42dc15;if(!_0x164943&&_0x2571f4){const _0x50fbf2=loadTdxConfig(_0x2571f4);_0x5c8437=_0x50fbf2[_0x4a052c(0xe5)],_0x42dc15=a33_0x53f8f8[_0x4a052c(0xd4)](_0x2571f4),_0x2e4bca[_0x4a052c(0xdd)]&&(console[_0x4a052c(0xf4)](_0x4a052c(0x101)+_0x2571f4),console[_0x4a052c(0xf4)]('Using\x20parent\x20segment:\x20'+_0x5c8437));}else{if(_0x164943){if(existsSync(_0x164943)&&statSync(_0x164943)[_0x4a052c(0xee)]()){const _0x40d11f=findTdxConfigPath(_0x164943);if(_0x40d11f){const _0xaa886f=loadTdxConfig(_0x40d11f);_0x5c8437=_0xaa886f[_0x4a052c(0xe5)],_0x42dc15=a33_0x53f8f8['dirname'](_0x40d11f),_0x2e4bca[_0x4a052c(0xdd)]&&(console['error']('Found\x20tdx.json\x20at:\x20'+_0x40d11f),console['error']('Using\x20parent\x20segment:\x20'+_0x5c8437));}else return console['error'](a33_0x1feed2[_0x4a052c(0xe1)](_0x4a052c(0xbc)+_0x164943+'\x0a')),console[_0x4a052c(0xf4)](a33_0x1feed2[_0x4a052c(0xfb)](_0x4a052c(0x103))),0x1;}else _0x5c8437=_0x164943;}else _0x5c8437=_0x2d6a27;}if(!_0x5c8437)return console[_0x4a052c(0xf4)](a33_0x1feed2['red'](_0x4a052c(0xc3))),console['error'](_0x4a052c(0xdb)),console[_0x4a052c(0xf4)](_0x4a052c(0xb9)),console[_0x4a052c(0xf4)](_0x4a052c(0xdf)),console['error'](a33_0x1feed2[_0x4a052c(0xfb)]('Tip:\x20Set\x20context\x20with\x20`tdx\x20segment\x20use\x20<parent_name>`\x20or\x20`tdx\x20ps\x20use\x20<parent_name>`')),0x1;_0x2e4bca[_0x4a052c(0xdd)]&&(console['error']('Site:\x20'+_0x2e4bca[_0x4a052c(0xed)]),console[_0x4a052c(0xf4)](_0x4a052c(0xa7)+_0x5c8437));const _0x1944ab=await withSpinner(_0x4a052c(0xfd)+_0x5c8437+_0x4a052c(0xe6),()=>_0xb819d[_0x4a052c(0xbb)][_0x4a052c(0xb4)](_0x5c8437),{'verbose':_0x2e4bca[_0x4a052c(0xdd)]}),_0xfd2f5f=_0x1944ab['data'],_0x482856=await withSpinner('Fetching\x20parent\x20segment\x20info...',()=>_0xb819d[_0x4a052c(0xbb)][_0x4a052c(0xca)](_0xfd2f5f),{'verbose':_0x2e4bca['verbose']}),_0x42ae96=_0x482856['data'][_0x4a052c(0xa3)]['name'];_0x2e4bca[_0x4a052c(0xdd)]&&console[_0x4a052c(0xf4)](_0x4a052c(0xa4)+_0x42ae96);const [_0xd8cee0,_0xfe1025]=await Promise[_0x4a052c(0xc9)]([withSpinner('Fetching\x20segments...',()=>_0xb819d['segment'][_0x4a052c(0xf5)](_0xfd2f5f),{'verbose':_0x2e4bca[_0x4a052c(0xdd)]}),withSpinner(_0x4a052c(0xe4),()=>_0xb819d[_0x4a052c(0xbb)][_0x4a052c(0xc1)](_0xfd2f5f),{'verbose':_0x2e4bca[_0x4a052c(0xdd)]})]),_0x11b497=_0xd8cee0['data'],_0x1b2f70=_0xfe1025['data'];if(_0x11b497['length']===0x0)return console[_0x4a052c(0xf4)](a33_0x1feed2[_0x4a052c(0xd6)]('No\x20segments\x20found\x20in\x20parent\x20segment\x20\x27'+_0x42ae96+'\x27')),0x0;const _0x2a4ece=buildFolderPathMap(_0x1b2f70),_0x200d19=_0x42dc15||getSegmentRootDir(sanitizeFileName(_0x5c8437)),_0x120d97=new Map();await withSpinner('Fetching\x20activations...',async()=>{await batchAsync(_0x11b497,async _0x4beb8f=>{const _0x5220ac=a33_0x52b2,_0xcb3f5e=await _0xb819d[_0x5220ac(0xbb)][_0x5220ac(0xd0)](_0xfd2f5f,_0x4beb8f['id']);_0x120d97[_0x5220ac(0xcb)](_0x4beb8f['id'],_0xcb3f5e);});},{'verbose':_0x2e4bca['verbose']});const _0x309981=await withSpinner(_0x4a052c(0xeb),()=>_0xb819d[_0x4a052c(0xc5)][_0x4a052c(0xc8)](),{'verbose':_0x2e4bca[_0x4a052c(0xdd)]})['then'](_0x562dd7=>_0x562dd7[_0x4a052c(0xc0)]),_0x24cbb3=await withSpinner(_0x4a052c(0xb1),()=>_0xb819d[_0x4a052c(0x100)]['buildIdToNameMap'](),{'verbose':_0x2e4bca[_0x4a052c(0xdd)]})[_0x4a052c(0xff)](_0x230f24=>_0x230f24['data']),_0x5dca01=[],_0x268999=a33_0x53f8f8[_0x4a052c(0x102)](_0x200d19,_0x4a052c(0xbe)),_0x2b739c=createTdxConfigContent(_0x42ae96);_0x5dca01[_0x4a052c(0xc2)](prepareFile(_0x268999,_0x2b739c,_0x200d19));const _0x23c02b=new Map();for(const _0x1b625d of _0x11b497){const _0x33e1c8=_0x1b625d['segmentFolderId']?_0x2a4ece[_0x4a052c(0xef)](_0x1b625d['segmentFolderId'])||'':'',_0x443b74=_0x120d97[_0x4a052c(0xef)](_0x1b625d['id'])||[],_0x471dc1=segmentWithActivationsToYaml(_0x1b625d,_0x443b74,undefined,_0x309981,_0x24cbb3),_0x40a2bc=_0x33e1c8?a33_0x53f8f8['join'](_0x200d19,_0x33e1c8):_0x200d19,_0x436a87=sanitizeFileName(_0x1b625d[_0x4a052c(0xde)]),_0x63dc49=getUniqueFileName(_0x40a2bc,_0x436a87,_0x23c02b),_0x58463e=a33_0x53f8f8[_0x4a052c(0x102)](_0x40a2bc,_0x63dc49+_0x4a052c(0xc7)),_0x31a6d8=segmentToYamlString(_0x471dc1);_0x5dca01[_0x4a052c(0xc2)](prepareFile(_0x58463e,_0x31a6d8,_0x200d19));}const _0x2cfd77=Array[_0x4a052c(0xb7)](_0x120d97[_0x4a052c(0xa9)]())[_0x4a052c(0xd2)]((_0x5488a2,_0x2083c9)=>_0x5488a2+_0x2083c9['length'],0x0),_0x187ac8=_0x5dca01[_0x4a052c(0xd7)](_0x886ce2=>_0x886ce2[_0x4a052c(0xac)]),_0x363745=_0x5dca01[_0x4a052c(0xd7)](_0x337eef=>!_0x337eef['isNew']&&_0x337eef[_0x4a052c(0xd8)]),_0x362481=_0x5dca01[_0x4a052c(0xd7)](_0x5af49b=>!_0x5af49b['isNew']&&!_0x5af49b[_0x4a052c(0xd8)]);console[_0x4a052c(0xf4)]('\x0aPull\x20summary\x20for\x20\x27'+_0x42ae96+'\x27:'),console[_0x4a052c(0xf4)]('\x20\x20'+a33_0x1feed2[_0x4a052c(0xfb)](_0x11b497[_0x4a052c(0xda)]+_0x4a052c(0xe3))+_0x4a052c(0xf2)+a33_0x1feed2[_0x4a052c(0xfb)](_0x2cfd77+_0x4a052c(0xfa))),console[_0x4a052c(0xf4)]('\x20\x20'+a33_0x1feed2['green']('+\x20'+_0x187ac8[_0x4a052c(0xda)]+_0x4a052c(0xb5))),console[_0x4a052c(0xf4)]('\x20\x20'+a33_0x1feed2[_0x4a052c(0xd6)]('~\x20'+_0x363745['length']+_0x4a052c(0xaa))),console[_0x4a052c(0xf4)]('\x20\x20'+a33_0x1feed2[_0x4a052c(0xe0)]('=\x20'+_0x362481[_0x4a052c(0xda)]+_0x4a052c(0xba))),console[_0x4a052c(0xf4)](_0x4a052c(0xc4)+a33_0x1feed2[_0x4a052c(0xfb)](_0x200d19)+'\x0a');if(_0x363745[_0x4a052c(0xda)]>0x0)for(const _0x580f54 of _0x363745){console[_0x4a052c(0xf4)]('\x0aChanges\x20to\x20\x27'+_0x580f54[_0x4a052c(0xe7)]+'\x27:'),console[_0x4a052c(0xf4)]('─'[_0x4a052c(0xb2)](0x3c)),console['error'](_0x580f54['diff']),console[_0x4a052c(0xf4)]('─'[_0x4a052c(0xb2)](0x3c));}if(_0x2e4bca[_0x4a052c(0xf7)])return console[_0x4a052c(0xf4)](a33_0x1feed2[_0x4a052c(0xd6)](_0x4a052c(0xf1))),0x0;if(_0x187ac8[_0x4a052c(0xda)]===0x0&&_0x363745['length']===0x0)return console[_0x4a052c(0xf4)](a33_0x1feed2[_0x4a052c(0xe8)](_0x4a052c(0xb0))),saveSessionContext({'parent_segment':_0x42ae96},_0x2e4bca[_0x4a052c(0xb3)]),console[_0x4a052c(0xf4)](a33_0x1feed2[_0x4a052c(0xe8)](_0x4a052c(0xb8)+a33_0x1feed2['dim']('parent_segment')+'\x20=\x20'+a33_0x1feed2[_0x4a052c(0xfb)](_0x42ae96))),0x0;if(!_0x2e4bca[_0x4a052c(0xdc)]&&(_0x187ac8[_0x4a052c(0xda)]>0x0||_0x363745[_0x4a052c(0xda)]>0x0)){const _0x106820=await confirmKey(_0x4a052c(0xe2)+(_0x187ac8[_0x4a052c(0xda)]+_0x363745[_0x4a052c(0xda)])+'\x20files?');if(!_0x106820)return console['error'](_0x4a052c(0xab)),0x1;}for(const _0x51f828 of _0x5dca01){if(_0x51f828[_0x4a052c(0xac)]||_0x51f828[_0x4a052c(0xd8)]){const _0x1fe85a=a33_0x53f8f8[_0x4a052c(0xd4)](_0x51f828['absolutePath']);!existsSync(_0x1fe85a)&&mkdirSync(_0x1fe85a,{'recursive':!![]}),writeFileSync(_0x51f828[_0x4a052c(0xd3)],_0x51f828[_0x4a052c(0xce)],_0x4a052c(0xad));}}return console[_0x4a052c(0xf4)](a33_0x1feed2[_0x4a052c(0xe8)](_0x4a052c(0xb6)+(_0x187ac8[_0x4a052c(0xda)]+_0x363745[_0x4a052c(0xda)])+_0x4a052c(0xa8)+_0x200d19)),saveSessionContext({'parent_segment':_0x42ae96},_0x2e4bca['session']),console[_0x4a052c(0xf4)](a33_0x1feed2[_0x4a052c(0xe8)](_0x4a052c(0xb8)+a33_0x1feed2[_0x4a052c(0xe0)](_0x4a052c(0xe5))+_0x4a052c(0xf8)+a33_0x1feed2['cyan'](_0x42ae96))),0x0;}}function a33_0x1d1b(){const _0x2fc9c9=['filter','hasChanges','segment:pull','length','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','yes','verbose','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file\x0a','dim','red','Write\x20','\x20segments','Fetching\x20folders...','parent_segment','\x27...','relativePath','green','96YbBXVh','replace','Fetching\x20users\x20for\x20email\x20resolution...','4kUVHNO','site','isDirectory','get','77xUSqOx','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20with\x20','has','error','listSegments','734960TNtRFR','dryRun','\x20=\x20','parentFolderId','\x20activations','cyan','412749CPgKee','Resolving\x20parent\x20segment\x20\x27','443810DVCFMX','then','connection','Found\x20existing\x20tdx.json\x20at:\x20','join','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','attributes','Resolved\x20parent\x20name:\x20','description','1AsGjxM','Parent\x20segment:\x20','\x20files\x20to\x20','values','\x20changed\x20files','Aborted.','isNew','utf-8','2989330QXZxMo','toLowerCase','✔\x20All\x20files\x20are\x20up\x20to\x20date','Fetching\x20connections\x20for\x20name\x20resolution...','repeat','session','resolveParentId','\x20new\x20files','✔\x20Pulled\x20','from','✔\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20unchanged\x20files','segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','1242522dUpntb','tdx.json','7wvMfaE','data','listFolders','push','Error:\x20Parent\x20segment\x20is\x20required\x0a','\x20\x20Target:\x20','user','parentSegment','.yml','buildIdToEmailMap','all','getParent','set','976062vwnIwW','execute','content','Pull\x20child\x20segments\x20to\x20YAML\x20files','listActivations','12424332tThyFw','reduce','absolutePath','dirname','13nqHOpQ','yellow'];a33_0x1d1b=function(){return _0x2fc9c9;};return a33_0x1d1b();}function a33_0x52b2(_0x39c017,_0x188dd9){_0x39c017=_0x39c017-0xa3;const _0x1d1ba8=a33_0x1d1b();let _0x52b244=_0x1d1ba8[_0x39c017];return _0x52b244;}function buildFolderPathMap(_0x5d9027){const _0x3d3ae6=a33_0x40d9c1,_0x318d72=new Map(),_0x4e1305=new Map();for(const _0x58c3a4 of _0x5d9027){_0x4e1305[_0x3d3ae6(0xcb)](_0x58c3a4['id'],_0x58c3a4);}const _0x1d8b1e=new Set();for(const _0x583c47 of _0x5d9027){!_0x583c47[_0x3d3ae6(0xf9)]&&_0x1d8b1e['add'](_0x583c47['id']);}function _0x1df023(_0x5b20de){const _0x493226=_0x3d3ae6;if(_0x318d72['has'](_0x5b20de['id']))return _0x318d72[_0x493226(0xef)](_0x5b20de['id']);if(_0x1d8b1e[_0x493226(0xf3)](_0x5b20de['id']))return _0x318d72['set'](_0x5b20de['id'],''),'';if(_0x5b20de[_0x493226(0xf9)]){const _0x3732bd=_0x4e1305[_0x493226(0xef)](_0x5b20de[_0x493226(0xf9)]);if(_0x3732bd){const _0x30ce0f=_0x1df023(_0x3732bd),_0x49494d=_0x30ce0f?_0x30ce0f+'/'+_0x5b20de['name']:_0x5b20de[_0x493226(0xde)];return _0x318d72['set'](_0x5b20de['id'],_0x49494d),_0x49494d;}}const _0xf94642=_0x5b20de[_0x493226(0xde)];return _0x318d72[_0x493226(0xcb)](_0x5b20de['id'],_0xf94642),_0xf94642;}for(const _0x1beb50 of _0x5d9027){_0x1df023(_0x1beb50);}return _0x318d72;}function sanitizeFileName(_0x3e32a1){const _0x49fba0=a33_0x40d9c1;return _0x3e32a1[_0x49fba0(0xaf)]()[_0x49fba0(0xea)](/[/\\:*?"<>|]/g,'-')[_0x49fba0(0xea)](/\s+/g,'-')[_0x49fba0(0xea)](/-+/g,'-')[_0x49fba0(0xea)](/^-|-$/g,'');}function getUniqueFileName(_0x9a7e96,_0x4150d7,_0x138560){const _0x1e08e1=a33_0x40d9c1,_0x5d1c1a=_0x9a7e96+':'+_0x4150d7,_0xe72b3a=_0x138560[_0x1e08e1(0xef)](_0x5d1c1a)||0x0;_0x138560[_0x1e08e1(0xcb)](_0x5d1c1a,_0xe72b3a+0x1);if(_0xe72b3a===0x0)return _0x4150d7;return _0x4150d7+'-'+_0xe72b3a;}function prepareFile(_0x106d65,_0x17db91,_0x166be6){const _0x352991=a33_0x53f8f8['relative'](_0x166be6,_0x106d65);if(existsSync(_0x106d65)){const _0x2245f4=readFileSync(_0x106d65,'utf-8'),_0x85aefd=generateDiff(_0x2245f4,_0x17db91),_0x19efd0=hasChanges(_0x85aefd);return{'relativePath':_0x352991,'absolutePath':_0x106d65,'content':_0x17db91,'isNew':![],'hasChanges':_0x19efd0,'diff':_0x19efd0?formatDiffWithColors(_0x85aefd):undefined};}return{'relativePath':_0x352991,'absolutePath':_0x106d65,'content':_0x17db91,'isNew':!![],'hasChanges':![]};}
1
+ const a33_0x39d1b7=a33_0x25c6;function a33_0x5a03(){const _0x2c8694=['segment:pull','data','values','1972905zJCdSW','resolveParentId','absolutePath','Write\x20','getParent','listFolders','Resolving\x20parent\x20segment\x20\x27','No\x20segments\x20found\x20in\x20parent\x20segment\x20\x27','length','buildIdToEmailMap','\x20files\x20to\x20','diff','Fetching\x20folders...','cyan','name','description','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','buildIdToNameMap','\x20new\x20files','segmentFolderId','connection','Found\x20existing\x20tdx.json\x20at:\x20','parentFolderId','join','\x0aPull\x20summary\x20for\x20\x27','set','256955YPBPJA','listActivations','259425KXaXOA','Using\x20parent\x20segment:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x27...','8zDwnRV','28UMUZsH','relative','1264668TbxYgE','400QPdmqv','segment','\x20=\x20','dirname','attributes','yellow','session','\x20changed\x20files','isNew','user','error','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','Site:\x20','Error:\x20Parent\x20segment\x20is\x20required\x0a','Fetching\x20activations...','has','red','✔\x20Context\x20set:\x20','\x20unchanged\x20files','3450204LZdKgq','\x20files?','1878324fKMWto','then','8970776kBRnVy','verbose','Found\x20tdx.json\x20at:\x20','push','Fetching\x20connections\x20for\x20name\x20resolution...','Tip:\x20Set\x20context\x20with\x20`tdx\x20segment\x20use\x20<parent_name>`\x20or\x20`tdx\x20ps\x20use\x20<parent_name>`','get','replace','Parent\x20segment:\x20','utf-8','dim','Fetching\x20segments...','Fetching\x20parent\x20segment\x20info...','green','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','site','.yml','repeat','dryRun','Resolved\x20parent\x20name:\x20','parent_segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file\x0a','filter','add','Fetching\x20users\x20for\x20email\x20resolution...','Aborted.','hasChanges','yes'];a33_0x5a03=function(){return _0x2c8694;};return a33_0x5a03();}(function(_0x3fc081,_0x81c1a6){const _0x515664=a33_0x25c6,_0x5d33aa=_0x3fc081();while(!![]){try{const _0x24167b=-parseInt(_0x515664(0x1bd))/0x1*(-parseInt(_0x515664(0x1c3))/0x2)+-parseInt(_0x515664(0x182))/0x3+-parseInt(_0x515664(0x180))/0x4+-parseInt(_0x515664(0x1a3))/0x5+parseInt(_0x515664(0x1c6))/0x6*(-parseInt(_0x515664(0x1c4))/0x7)+parseInt(_0x515664(0x184))/0x8+-parseInt(_0x515664(0x1bf))/0x9*(-parseInt(_0x515664(0x1c7))/0xa);if(_0x24167b===_0x81c1a6)break;else _0x5d33aa['push'](_0x5d33aa['shift']());}catch(_0x1f5a1d){_0x5d33aa['push'](_0x5d33aa['shift']());}}}(a33_0x5a03,0x8c947));function a33_0x25c6(_0x343ce6,_0x3a05d9){_0x343ce6=_0x343ce6-0x176;const _0x5a03bb=a33_0x5a03();let _0x25c6dc=_0x5a03bb[_0x343ce6];return _0x25c6dc;}import{BaseCommand}from'./command.js';import{withSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,createTdxConfigContent,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{saveSessionContext}from'../core/session.js';import{segmentWithActivationsToYaml,segmentToYamlString}from'../sdk/segment/child-segment-yaml.js';import a33_0x48240e from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a33_0x589d36 from'path';export class SegmentPullCommand extends BaseCommand{[a33_0x39d1b7(0x1b1)]=a33_0x39d1b7(0x1a0);[a33_0x39d1b7(0x1b2)]='Pull\x20child\x20segments\x20to\x20YAML\x20files';async['execute'](_0x4df509){const _0x4e5283=a33_0x39d1b7,{options:_0x558ccc,args:_0x3d6c4e,tdx:_0x14780e}=_0x4df509,_0x262377=_0x558ccc,_0xe16bbe=_0x558ccc['parentSegment'],_0x317081=_0x3d6c4e[0x0],_0x1ebff8=findTdxConfigPath();let _0x1ab07b,_0x4e201c;if(!_0x317081&&_0x1ebff8){const _0x3d5383=loadTdxConfig(_0x1ebff8);_0x1ab07b=_0x3d5383[_0x4e5283(0x198)],_0x4e201c=a33_0x589d36[_0x4e5283(0x1ca)](_0x1ebff8),_0x262377[_0x4e5283(0x185)]&&(console[_0x4e5283(0x177)](_0x4e5283(0x1b8)+_0x1ebff8),console[_0x4e5283(0x177)](_0x4e5283(0x1c0)+_0x1ab07b));}else{if(_0x317081){if(existsSync(_0x317081)&&statSync(_0x317081)['isDirectory']()){const _0x2ece09=findTdxConfigPath(_0x317081);if(_0x2ece09){const _0x4e18c7=loadTdxConfig(_0x2ece09);_0x1ab07b=_0x4e18c7[_0x4e5283(0x198)],_0x4e201c=a33_0x589d36[_0x4e5283(0x1ca)](_0x2ece09),_0x262377['verbose']&&(console[_0x4e5283(0x177)](_0x4e5283(0x186)+_0x2ece09),console[_0x4e5283(0x177)](_0x4e5283(0x1c0)+_0x1ab07b));}else return console['error'](a33_0x48240e[_0x4e5283(0x17d)](_0x4e5283(0x192)+_0x317081+'\x0a')),console[_0x4e5283(0x177)](a33_0x48240e[_0x4e5283(0x1b0)](_0x4e5283(0x1b3))),0x1;}else _0x1ab07b=_0x317081;}else _0x1ab07b=_0xe16bbe;}if(!_0x1ab07b)return console[_0x4e5283(0x177)](a33_0x48240e['red'](_0x4e5283(0x17a))),console[_0x4e5283(0x177)](_0x4e5283(0x178)),console[_0x4e5283(0x177)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console['error'](_0x4e5283(0x199)),console[_0x4e5283(0x177)](a33_0x48240e[_0x4e5283(0x1b0)](_0x4e5283(0x189))),0x1;_0x262377[_0x4e5283(0x185)]&&(console[_0x4e5283(0x177)](_0x4e5283(0x179)+_0x262377[_0x4e5283(0x193)]),console[_0x4e5283(0x177)](_0x4e5283(0x18c)+_0x1ab07b));const _0x41322d=await withSpinner(_0x4e5283(0x1a9)+_0x1ab07b+_0x4e5283(0x1c2),()=>_0x14780e[_0x4e5283(0x1c8)][_0x4e5283(0x1a4)](_0x1ab07b),{'verbose':_0x262377[_0x4e5283(0x185)]}),_0x57a971=_0x41322d[_0x4e5283(0x1a1)],_0x5448b6=await withSpinner(_0x4e5283(0x190),()=>_0x14780e[_0x4e5283(0x1c8)][_0x4e5283(0x1a7)](_0x57a971),{'verbose':_0x262377[_0x4e5283(0x185)]}),_0x9d74f3=_0x5448b6[_0x4e5283(0x1a1)][_0x4e5283(0x1cb)]['name'];_0x262377[_0x4e5283(0x185)]&&console[_0x4e5283(0x177)](_0x4e5283(0x197)+_0x9d74f3);const [_0x1d1d4c,_0x25aa60]=await Promise['all']([withSpinner(_0x4e5283(0x18f),()=>_0x14780e[_0x4e5283(0x1c8)]['listSegments'](_0x57a971),{'verbose':_0x262377[_0x4e5283(0x185)]}),withSpinner(_0x4e5283(0x1af),()=>_0x14780e[_0x4e5283(0x1c8)][_0x4e5283(0x1a8)](_0x57a971),{'verbose':_0x262377[_0x4e5283(0x185)]})]),_0x20a915=_0x1d1d4c[_0x4e5283(0x1a1)],_0x4c2699=_0x25aa60['data'];if(_0x20a915['length']===0x0)return console[_0x4e5283(0x177)](a33_0x48240e[_0x4e5283(0x1cc)](_0x4e5283(0x1aa)+_0x9d74f3+'\x27')),0x0;const _0x2a4880=buildFolderPathMap(_0x4c2699),_0x57c247=_0x4e201c||getSegmentRootDir(sanitizeFileName(_0x1ab07b)),_0x14229e=new Map();await withSpinner(_0x4e5283(0x17b),async()=>{await batchAsync(_0x20a915,async _0x5301ba=>{const _0x9fb39c=a33_0x25c6,_0x21610c=await _0x14780e['segment'][_0x9fb39c(0x1be)](_0x57a971,_0x5301ba['id']);_0x14229e[_0x9fb39c(0x1bc)](_0x5301ba['id'],_0x21610c);});},{'verbose':_0x262377[_0x4e5283(0x185)]});const _0x3de5f7=await withSpinner(_0x4e5283(0x19c),()=>_0x14780e[_0x4e5283(0x176)][_0x4e5283(0x1ac)](),{'verbose':_0x262377[_0x4e5283(0x185)]})['then'](_0x17f47d=>_0x17f47d[_0x4e5283(0x1a1)]),_0x5ee732=await withSpinner(_0x4e5283(0x188),()=>_0x14780e[_0x4e5283(0x1b7)][_0x4e5283(0x1b4)](),{'verbose':_0x262377['verbose']})[_0x4e5283(0x183)](_0x61bd1=>_0x61bd1[_0x4e5283(0x1a1)]),_0x4f30af=[],_0x2519c4=a33_0x589d36[_0x4e5283(0x1ba)](_0x57c247,'tdx.json'),_0x103e6e=createTdxConfigContent(_0x9d74f3);_0x4f30af[_0x4e5283(0x187)](prepareFile(_0x2519c4,_0x103e6e,_0x57c247));const _0x51f31f=new Map();for(const _0x59fae2 of _0x20a915){const _0x94348a=_0x59fae2[_0x4e5283(0x1b6)]?_0x2a4880[_0x4e5283(0x18a)](_0x59fae2[_0x4e5283(0x1b6)])||'':'',_0x516de3=_0x14229e[_0x4e5283(0x18a)](_0x59fae2['id'])||[],_0x4100c7=segmentWithActivationsToYaml(_0x59fae2,_0x516de3,undefined,_0x3de5f7,_0x5ee732),_0x17526b=_0x94348a?a33_0x589d36[_0x4e5283(0x1ba)](_0x57c247,_0x94348a):_0x57c247,_0x427931=sanitizeFileName(_0x59fae2[_0x4e5283(0x1b1)]),_0x19cba6=getUniqueFileName(_0x17526b,_0x427931,_0x51f31f),_0x340e81=a33_0x589d36[_0x4e5283(0x1ba)](_0x17526b,_0x19cba6+_0x4e5283(0x194)),_0xf3f324=segmentToYamlString(_0x4100c7);_0x4f30af[_0x4e5283(0x187)](prepareFile(_0x340e81,_0xf3f324,_0x57c247));}const _0x311446=Array['from'](_0x14229e[_0x4e5283(0x1a2)]())['reduce']((_0x19ad6e,_0x4ebd20)=>_0x19ad6e+_0x4ebd20[_0x4e5283(0x1ab)],0x0),_0x4fa7df=_0x4f30af[_0x4e5283(0x19a)](_0x20d012=>_0x20d012[_0x4e5283(0x1cf)]),_0xe188de=_0x4f30af[_0x4e5283(0x19a)](_0xcd9302=>!_0xcd9302[_0x4e5283(0x1cf)]&&_0xcd9302['hasChanges']),_0x103337=_0x4f30af['filter'](_0x4dbdf4=>!_0x4dbdf4['isNew']&&!_0x4dbdf4['hasChanges']);console[_0x4e5283(0x177)](_0x4e5283(0x1bb)+_0x9d74f3+'\x27:'),console[_0x4e5283(0x177)]('\x20\x20'+a33_0x48240e[_0x4e5283(0x1b0)](_0x20a915[_0x4e5283(0x1ab)]+'\x20segments')+'\x20with\x20'+a33_0x48240e[_0x4e5283(0x1b0)](_0x311446+'\x20activations')),console[_0x4e5283(0x177)]('\x20\x20'+a33_0x48240e[_0x4e5283(0x191)]('+\x20'+_0x4fa7df['length']+_0x4e5283(0x1b5))),console[_0x4e5283(0x177)]('\x20\x20'+a33_0x48240e[_0x4e5283(0x1cc)]('~\x20'+_0xe188de[_0x4e5283(0x1ab)]+_0x4e5283(0x1ce))),console[_0x4e5283(0x177)]('\x20\x20'+a33_0x48240e[_0x4e5283(0x18e)]('=\x20'+_0x103337['length']+_0x4e5283(0x17f))),console['error']('\x20\x20Target:\x20'+a33_0x48240e[_0x4e5283(0x1b0)](_0x57c247)+'\x0a');if(_0xe188de['length']>0x0)for(const _0x20f777 of _0xe188de){console[_0x4e5283(0x177)]('\x0aChanges\x20to\x20\x27'+_0x20f777['relativePath']+'\x27:'),console[_0x4e5283(0x177)]('─'['repeat'](0x3c)),console[_0x4e5283(0x177)](_0x20f777[_0x4e5283(0x1ae)]),console[_0x4e5283(0x177)]('─'[_0x4e5283(0x195)](0x3c));}if(_0x262377[_0x4e5283(0x196)])return console[_0x4e5283(0x177)](a33_0x48240e[_0x4e5283(0x1cc)](_0x4e5283(0x1c1))),0x0;if(_0x4fa7df[_0x4e5283(0x1ab)]===0x0&&_0xe188de[_0x4e5283(0x1ab)]===0x0)return console[_0x4e5283(0x177)](a33_0x48240e[_0x4e5283(0x191)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x9d74f3},_0x262377[_0x4e5283(0x1cd)]),console[_0x4e5283(0x177)](a33_0x48240e[_0x4e5283(0x191)](_0x4e5283(0x17e)+a33_0x48240e[_0x4e5283(0x18e)](_0x4e5283(0x198))+_0x4e5283(0x1c9)+a33_0x48240e[_0x4e5283(0x1b0)](_0x9d74f3))),0x0;if(!_0x262377[_0x4e5283(0x19f)]&&(_0x4fa7df[_0x4e5283(0x1ab)]>0x0||_0xe188de[_0x4e5283(0x1ab)]>0x0)){const _0x22ecac=await confirmKey(_0x4e5283(0x1a6)+(_0x4fa7df[_0x4e5283(0x1ab)]+_0xe188de[_0x4e5283(0x1ab)])+_0x4e5283(0x181));if(!_0x22ecac)return console[_0x4e5283(0x177)](_0x4e5283(0x19d)),0x1;}for(const _0x36567f of _0x4f30af){if(_0x36567f['isNew']||_0x36567f[_0x4e5283(0x19e)]){const _0x4c7165=a33_0x589d36['dirname'](_0x36567f[_0x4e5283(0x1a5)]);!existsSync(_0x4c7165)&&mkdirSync(_0x4c7165,{'recursive':!![]}),writeFileSync(_0x36567f[_0x4e5283(0x1a5)],_0x36567f['content'],_0x4e5283(0x18d));}}return console['error'](a33_0x48240e[_0x4e5283(0x191)]('✔\x20Pulled\x20'+(_0x4fa7df[_0x4e5283(0x1ab)]+_0xe188de[_0x4e5283(0x1ab)])+_0x4e5283(0x1ad)+_0x57c247)),saveSessionContext({'parent_segment':_0x9d74f3},_0x262377[_0x4e5283(0x1cd)]),console[_0x4e5283(0x177)](a33_0x48240e[_0x4e5283(0x191)](_0x4e5283(0x17e)+a33_0x48240e[_0x4e5283(0x18e)](_0x4e5283(0x198))+_0x4e5283(0x1c9)+a33_0x48240e['cyan'](_0x9d74f3))),0x0;}}function buildFolderPathMap(_0x1881ed){const _0x44aead=a33_0x39d1b7,_0x533a9e=new Map(),_0x50a482=new Map();for(const _0x355b47 of _0x1881ed){_0x50a482[_0x44aead(0x1bc)](_0x355b47['id'],_0x355b47);}const _0x330489=new Set();for(const _0x502dfa of _0x1881ed){!_0x502dfa['parentFolderId']&&_0x330489[_0x44aead(0x19b)](_0x502dfa['id']);}function _0x121d07(_0x29dea8){const _0x32855d=_0x44aead;if(_0x533a9e[_0x32855d(0x17c)](_0x29dea8['id']))return _0x533a9e[_0x32855d(0x18a)](_0x29dea8['id']);if(_0x330489['has'](_0x29dea8['id']))return _0x533a9e[_0x32855d(0x1bc)](_0x29dea8['id'],''),'';if(_0x29dea8[_0x32855d(0x1b9)]){const _0x1477b4=_0x50a482[_0x32855d(0x18a)](_0x29dea8['parentFolderId']);if(_0x1477b4){const _0x236a49=_0x121d07(_0x1477b4),_0x8231d7=_0x236a49?_0x236a49+'/'+_0x29dea8[_0x32855d(0x1b1)]:_0x29dea8[_0x32855d(0x1b1)];return _0x533a9e[_0x32855d(0x1bc)](_0x29dea8['id'],_0x8231d7),_0x8231d7;}}const _0x404b8c=_0x29dea8['name'];return _0x533a9e['set'](_0x29dea8['id'],_0x404b8c),_0x404b8c;}for(const _0x548775 of _0x1881ed){_0x121d07(_0x548775);}return _0x533a9e;}function sanitizeFileName(_0x1cb95c){const _0x5b59cb=a33_0x39d1b7;return _0x1cb95c['toLowerCase']()['replace'](/[/\\:*?"<>|]/g,'-')[_0x5b59cb(0x18b)](/\s+/g,'-')[_0x5b59cb(0x18b)](/-+/g,'-')[_0x5b59cb(0x18b)](/^-|-$/g,'');}function getUniqueFileName(_0x123844,_0x20b421,_0x598443){const _0x7dc3c5=a33_0x39d1b7,_0x383f6d=_0x123844+':'+_0x20b421,_0x395316=_0x598443[_0x7dc3c5(0x18a)](_0x383f6d)||0x0;_0x598443['set'](_0x383f6d,_0x395316+0x1);if(_0x395316===0x0)return _0x20b421;return _0x20b421+'-'+_0x395316;}function prepareFile(_0x5d1132,_0x262050,_0x3769e2){const _0x27390b=a33_0x39d1b7,_0x37d199=a33_0x589d36[_0x27390b(0x1c5)](_0x3769e2,_0x5d1132);if(existsSync(_0x5d1132)){const _0x428d26=readFileSync(_0x5d1132,_0x27390b(0x18d)),_0x34bae5=generateDiff(_0x428d26,_0x262050),_0x2429b9=hasChanges(_0x34bae5);return{'relativePath':_0x37d199,'absolutePath':_0x5d1132,'content':_0x262050,'isNew':![],'hasChanges':_0x2429b9,'diff':_0x2429b9?formatDiffWithColors(_0x34bae5):undefined};}return{'relativePath':_0x37d199,'absolutePath':_0x5d1132,'content':_0x262050,'isNew':!![],'hasChanges':![]};}
@@ -1 +1 @@
1
- const a34_0xb3c545=a34_0x1604;(function(_0x232ccc,_0x381284){const _0x57451c=a34_0x1604,_0x28be58=_0x232ccc();while(!![]){try{const _0xaebf0c=-parseInt(_0x57451c(0xf6))/0x1*(-parseInt(_0x57451c(0xd3))/0x2)+parseInt(_0x57451c(0x136))/0x3*(parseInt(_0x57451c(0xe9))/0x4)+parseInt(_0x57451c(0xe3))/0x5+parseInt(_0x57451c(0xdb))/0x6*(parseInt(_0x57451c(0x11d))/0x7)+-parseInt(_0x57451c(0x100))/0x8*(parseInt(_0x57451c(0x140))/0x9)+-parseInt(_0x57451c(0xee))/0xa*(parseInt(_0x57451c(0x11c))/0xb)+-parseInt(_0x57451c(0x10b))/0xc;if(_0xaebf0c===_0x381284)break;else _0x28be58['push'](_0x28be58['shift']());}catch(_0x4cb9ef){_0x28be58['push'](_0x28be58['shift']());}}}(a34_0x22bb,0x1d268));import{BaseCommand}from'./command.js';import{withSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';function a34_0x22bb(){const _0x1b20b5=['\x20to\x20update','Fetching\x20users\x20for\x20email\x20resolution...','existingSegment','delete','parent_segment','listActivations','34628svVkGA','1590421dWnXvC','activationActions','yamlActivation','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20segments\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','entries','verbose','createFolder','user','\x20deleted','\x20\x20✔\x20Created\x20activation\x20\x27','\x20\x20Segments:\x20','dirname','Deleting\x20activation\x20\x27','Delete\x20segment:','all','relative','.yaml','Error:\x20No\x20segment\x20YAML\x20files\x20found\x20in\x20','green','buildUserMaps','Parent\x20segment:\x20','repeat','error','\x20\x20Source:\x20','3EHhLbD','\x20changed\x20segments','\x20segments\x20to\x20delete','parentSegment','existingActivation','\x20\x20Activations:\x20','push','name','Fetching\x20connections\x20for\x20name\x20resolution...','filter','9mXUXRh','Push\x20','\x20new\x20segments','get','stringify','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Error\x20parsing\x20','\x20activations]','from','length','Creating\x20folder\x20\x27','Error:\x20Parent\x20segment\x20is\x20required\x0a','description','sort','✔\x20Created\x20segment\x20\x27','Changes\x20to:','Fetching\x20existing\x20activations...','segmentFolderId','then','activations','update','red','\x20\x20✔\x20Deleted\x20activation\x20\x27','listFolders','folderPath','Creating\x20activation\x20\x27','startsWith','\x20to\x20delete','updateActivation','Error:\x20Directory\x20not\x20found:\x20','148872NAzTpw','create','Aborted.','add','configDir','listSegments','diff','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file\x0a','6OTUooK','set','Site:\x20','slice','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20files','type','config','toString','1062670YtXWpE','Fetching\x20existing\x20segments...','\x0aPush\x20summary\x20for\x20\x27','No\x20segment\x20YAML\x20files\x20found','join','.yml','835428nysVqw','split','has','parentFolderId','segment','450hUsuQC','connection','yellow','\x27...','createSegment','blue','\x20to\x20create','dryRun','3oSNhAl','isNew','Creating\x20segment\x20\x27','toLowerCase','\x20\x20\x20\x20','flatMap','📁\x20','replace','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','✔\x20Updated\x20segment\x20\x27','797608ndtFtn','Tip:\x20Set\x20context\x20with\x20`tdx\x20segment\x20use\x20<parent_name>`\x20or\x20`tdx\x20ps\x20use\x20<parent_name>`','yamlConfig','dim','cyan','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20✔\x20Updated\x20activation\x20\x27','Source\x20directory:\x20','Deleting\x20segment\x20\x27','isDirectory','6133692qNIBLO','hasChanges','cwd','data','Folders\x20to\x20create:','execute','deleteSegment','\x20created','resolveParentId','endsWith','createActivation'];a34_0x22bb=function(){return _0x1b20b5;};return a34_0x22bb();}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a34_0x1604(_0x262c04,_0x464cfa){_0x262c04=_0x262c04-0xbc;const _0x22bb56=a34_0x22bb();let _0x160437=_0x22bb56[_0x262c04];return _0x160437;}import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,yamlActivationToUpdateRequest,activationToYaml}from'../sdk/segment/child-segment-yaml.js';import a34_0x2f3d18 from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a34_0x81b7ad from'path';import*as a34_0x29250e from'yaml';function sanitizeFileName(_0x1d3a65){const _0x4f4518=a34_0x1604;return _0x1d3a65[_0x4f4518(0xf9)]()[_0x4f4518(0xfd)](/[/\\:*?"<>|]/g,'-')[_0x4f4518(0xfd)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x4f4518(0xfd)](/^-|-$/g,'');}function tryFindTdxConfig(_0x5eb609){try{return findTdxConfig(_0x5eb609);}catch{return null;}}function resolveTDFolderPath(_0x17d6be,_0x48bc45,_0x2a9e3a){if(!_0x48bc45)return _0x17d6be;return _0x17d6be?_0x2a9e3a+'/'+_0x17d6be:_0x2a9e3a;}export class SegmentPushCommand extends BaseCommand{[a34_0xb3c545(0x13d)]='segment:push';[a34_0xb3c545(0xc1)]=a34_0xb3c545(0x145);async[a34_0xb3c545(0x110)](_0x5cb61d){const _0x50bca9=a34_0xb3c545,{options:_0x34214c,args:_0x2c0092,tdx:_0x189e83}=_0x5cb61d,_0x2f7cb2=_0x34214c,_0x4755cd=_0x34214c[_0x50bca9(0x139)],_0xfcf0fc=_0x2c0092[0x0];let _0xf9f857,_0x405d0b,_0x2ad32c;if(_0xfcf0fc){if(existsSync(_0xfcf0fc)&&statSync(_0xfcf0fc)[_0x50bca9(0x10a)]()){const _0x434673=tryFindTdxConfig(_0xfcf0fc);if(_0x434673)_0xf9f857=_0x434673[_0x50bca9(0xe1)][_0x50bca9(0x11a)],_0x405d0b=_0xfcf0fc,_0x2ad32c=_0x434673['configDir'];else return console['error'](a34_0x2f3d18['red'](_0x50bca9(0xfe)+_0xfcf0fc+'\x0a')),console['error'](a34_0x2f3d18['cyan'](_0x50bca9(0x120))),0x1;}else _0xf9f857=_0xfcf0fc;}else{const _0x4a4162=tryFindTdxConfig(process[_0x50bca9(0x10d)]());_0x4a4162?(_0xf9f857=_0x4a4162[_0x50bca9(0xe1)]['parent_segment'],_0x405d0b=process['cwd'](),_0x2ad32c=_0x4a4162[_0x50bca9(0xd7)]):_0xf9f857=_0x4755cd;}if(!_0xf9f857)return console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0xca)](_0x50bca9(0xc0))),console[_0x50bca9(0x134)](_0x50bca9(0x105)),console[_0x50bca9(0x134)](_0x50bca9(0x106)),console[_0x50bca9(0x134)](_0x50bca9(0xda)),console['error'](a34_0x2f3d18[_0x50bca9(0x104)](_0x50bca9(0x101))),0x1;const _0xa327e6=_0x405d0b||getSegmentRootDir(sanitizeFileName(_0xf9f857)),_0x426205=_0x2ad32c||_0xa327e6,_0xeb44cb=a34_0x81b7ad[_0x50bca9(0x12d)](_0x426205,_0xa327e6),_0x732016=_0xeb44cb!==''&&_0xeb44cb!=='.';if(!existsSync(_0xa327e6))return console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0xca)](_0x50bca9(0xd2)+_0xa327e6+'\x0a')),console['error'](a34_0x2f3d18[_0x50bca9(0x104)](_0x50bca9(0x120))),0x1;_0x2f7cb2[_0x50bca9(0x123)]&&(console[_0x50bca9(0x134)](_0x50bca9(0xdd)+_0x2f7cb2['site']),console['error'](_0x50bca9(0x132)+_0xf9f857),console[_0x50bca9(0x134)](_0x50bca9(0x108)+_0xa327e6),_0x732016&&console[_0x50bca9(0x134)]('Scoped\x20to\x20folder:\x20'+_0xeb44cb));const _0x13cae4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf9f857+_0x50bca9(0xf1),()=>_0x189e83[_0x50bca9(0xed)][_0x50bca9(0x113)](_0xf9f857),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]}),_0x1b12c9=_0x13cae4[_0x50bca9(0x10e)],[_0x5395c8,_0x1f6893,_0x49cadc]=await Promise[_0x50bca9(0x12c)]([withSpinner(_0x50bca9(0xe4),()=>_0x189e83[_0x50bca9(0xed)][_0x50bca9(0xd8)](_0x1b12c9),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x189e83['segment'][_0x50bca9(0xcc)](_0x1b12c9),{'verbose':_0x2f7cb2['verbose']}),withSpinner(_0x50bca9(0x117),()=>_0x189e83[_0x50bca9(0x125)][_0x50bca9(0x131)](),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]})[_0x50bca9(0xc7)](_0x3ae9f9=>_0x3ae9f9[_0x50bca9(0x10e)])]),_0x3c1b68=_0x5395c8[_0x50bca9(0x10e)],_0x4d37aa=_0x1f6893['data'],{emailToId:_0x974567,idToEmail:_0x394f8a}=_0x49cadc,[_0x3232be,_0x463562]=await withSpinner(_0x50bca9(0x13e),async()=>{const _0xb39b19=_0x50bca9,[_0x5c0b41,_0x27c8af]=await Promise[_0xb39b19(0x12c)]([_0x189e83[_0xb39b19(0xef)]['buildNameToIdMap'](),_0x189e83[_0xb39b19(0xef)]['buildIdToNameMap']()]);return[_0x5c0b41,_0x27c8af];},{'verbose':_0x2f7cb2['verbose']})[_0x50bca9(0xc7)](_0x209661=>_0x209661[_0x50bca9(0x10e)]),_0x1d58ca=buildFolderPathToIdMap(_0x4d37aa),_0x5f449e=new Map();for(const [_0x310019,_0x2f3c57]of _0x1d58ca[_0x50bca9(0x122)]()){_0x5f449e[_0x50bca9(0xdc)](_0x2f3c57,_0x310019);}const _0x327042=new Map();for(const _0xb5d6bd of _0x3c1b68){const _0x39718e=_0xb5d6bd['segmentFolderId']?_0x5f449e['get'](_0xb5d6bd[_0x50bca9(0xc6)][_0x50bca9(0xe2)]())||'':'',_0x4c9b92=_0x39718e+':'+_0xb5d6bd[_0x50bca9(0x13d)];_0x327042['set'](_0x4c9b92,_0xb5d6bd);}const _0x2c6a1b=findYamlFiles(_0xa327e6);if(_0x2c6a1b['length']===0x0)return console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0xca)](_0x50bca9(0x12f)+_0xa327e6+'\x0a')),console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0x104)](_0x50bca9(0xdf))),0x1;const _0x2a68cd=[];for(const _0x318976 of _0x2c6a1b){const _0x4cfea6=a34_0x81b7ad[_0x50bca9(0x12d)](_0xa327e6,a34_0x81b7ad[_0x50bca9(0x129)](_0x318976)),_0x2d89ee=_0x4cfea6==='.'?'':_0x4cfea6,_0x3b9977=readFileSync(_0x318976,'utf-8');try{const _0x295b4e=parseSegmentYamlFile(_0x3b9977);_0x2a68cd[_0x50bca9(0x13c)]({'yamlConfig':_0x295b4e,'folderPath':_0x2d89ee,'sourcePath':_0x318976});}catch(_0x1a2ed8){return console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0xca)](_0x50bca9(0x146)+_0x318976+':\x20'+(_0x1a2ed8 instanceof Error?_0x1a2ed8['message']:_0x1a2ed8))),0x1;}}if(_0x2a68cd[_0x50bca9(0xbe)]===0x0)return console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0xf0)](_0x50bca9(0xe6))),0x0;const _0x34d459=new Map();_0x3c1b68[_0x50bca9(0xbe)]>0x0&&await withSpinner(_0x50bca9(0xc5),async()=>{await batchAsync(_0x3c1b68,async _0x5aaf7a=>{const _0xae78fd=a34_0x1604,_0x428151=await _0x189e83[_0xae78fd(0xed)][_0xae78fd(0x11b)](_0x1b12c9,_0x5aaf7a['id']);_0x34d459[_0xae78fd(0xdc)](_0x5aaf7a['id'],_0x428151);});},{'verbose':_0x2f7cb2['verbose']});const _0x1fc446=[],_0x13bd51=new Set();for(const {yamlConfig:_0x326aaf,folderPath:_0x2f57f7,sourcePath:_0x1e6af1}of _0x2a68cd){const _0x8fb79a=resolveTDFolderPath(_0x2f57f7,_0x732016,_0xeb44cb),_0x1c72d1=_0x8fb79a+':'+_0x326aaf['name'],_0xed01d7=_0x327042[_0x50bca9(0x143)](_0x1c72d1),_0x33e150=_0xed01d7?_0x34d459['get'](_0xed01d7['id'])||[]:[];if(_0x8fb79a&&!_0x1d58ca[_0x50bca9(0xeb)](_0x8fb79a)){const _0x4cd61f=_0x8fb79a[_0x50bca9(0xea)]('/');let _0x300b89='';for(const _0x55bc0a of _0x4cd61f){_0x300b89=_0x300b89?_0x300b89+'/'+_0x55bc0a:_0x55bc0a,!_0x1d58ca[_0x50bca9(0xeb)](_0x300b89)&&_0x13bd51[_0x50bca9(0xd6)](_0x300b89);}}const _0x36818b=calculateActivationActions(_0x326aaf[_0x50bca9(0xc8)]||[],_0x33e150,_0x394f8a,_0x463562),_0x3fce52=segmentToYamlString(_0x326aaf);let _0x1b8357,_0x137990=![],_0x176324;if(_0xed01d7){const _0x5cc95e=segmentWithActivationsToYaml(_0xed01d7,_0x33e150,undefined,_0x394f8a,_0x463562),_0x44c7bd=segmentToYamlString(_0x5cc95e);_0x1b8357=generateDiff(_0x44c7bd,_0x3fce52),_0x137990=hasChanges(_0x1b8357),_0x137990&&(_0x176324=formatDiffWithColors(_0x1b8357));}else _0x1b8357=generateDiff('',_0x3fce52),_0x176324=formatDiffWithColors(_0x1b8357);_0x1fc446['push']({'relativePath':_0x326aaf['name'],'absolutePath':_0x1e6af1,'yamlConfig':_0x326aaf,'folderPath':_0x8fb79a,'existingSegment':_0xed01d7,'existingActivations':_0x33e150,'isNew':!_0xed01d7,'hasChanges':_0x137990,'diff':_0x176324,'activationActions':_0x36818b});}const _0x3d96d3=new Set();for(const {yamlConfig:_0x1519cc,folderPath:_0x402766}of _0x2a68cd){const _0x292313=resolveTDFolderPath(_0x402766,_0x732016,_0xeb44cb);_0x3d96d3[_0x50bca9(0xd6)](_0x292313+':'+_0x1519cc[_0x50bca9(0x13d)]);}const _0x42f76d=_0x3c1b68['filter'](_0x3d7b5a=>{const _0x3a3222=_0x50bca9,_0x3221c0=_0x3d7b5a['segmentFolderId']?_0x5f449e['get'](_0x3d7b5a[_0x3a3222(0xc6)][_0x3a3222(0xe2)]())||'':'',_0x356d73=_0x3221c0+':'+_0x3d7b5a[_0x3a3222(0x13d)];if(_0x3d96d3[_0x3a3222(0xeb)](_0x356d73))return![];if(_0x732016)return _0x3221c0===_0xeb44cb||_0x3221c0[_0x3a3222(0xcf)](_0xeb44cb+'/');return!![];}),_0x425242=_0x1fc446[_0x50bca9(0x13f)](_0x4f893e=>_0x4f893e['isNew']),_0x328871=_0x1fc446['filter'](_0x51f2c7=>!_0x51f2c7['isNew']&&_0x51f2c7['hasChanges']),_0x442bcd=_0x1fc446['filter'](_0xae0e8a=>!_0xae0e8a[_0x50bca9(0xf7)]&&!_0xae0e8a['hasChanges']),_0x38c89d=Array[_0x50bca9(0xbd)](_0x13bd51)[_0x50bca9(0xc2)](),_0x2162d6=_0x2f7cb2[_0x50bca9(0x119)]?_0x42f76d:[],_0x40711d=_0x1fc446[_0x50bca9(0xfb)](_0x37b0d9=>_0x37b0d9[_0x50bca9(0x11e)]),_0x747a86=_0x40711d['filter'](_0x28425e=>_0x28425e[_0x50bca9(0xe0)]===_0x50bca9(0xd4)),_0x555106=_0x40711d[_0x50bca9(0x13f)](_0x75f769=>_0x75f769[_0x50bca9(0xe0)]===_0x50bca9(0xc9)),_0x350b59=_0x40711d['filter'](_0x54971e=>_0x54971e[_0x50bca9(0xe0)]==='delete');console['error'](_0x50bca9(0xe5)+_0xf9f857+'\x27:');_0x38c89d[_0x50bca9(0xbe)]>0x0&&console[_0x50bca9(0x134)]('\x20\x20'+a34_0x2f3d18['blue'](_0x50bca9(0xfc)+_0x38c89d[_0x50bca9(0xbe)]+'\x20folders\x20to\x20create'));console['error']('\x20\x20'+a34_0x2f3d18[_0x50bca9(0x130)]('+\x20'+_0x425242[_0x50bca9(0xbe)]+_0x50bca9(0x142))),console[_0x50bca9(0x134)]('\x20\x20'+a34_0x2f3d18[_0x50bca9(0xf0)]('~\x20'+_0x328871[_0x50bca9(0xbe)]+_0x50bca9(0x137)));if(_0x2162d6[_0x50bca9(0xbe)]>0x0)console[_0x50bca9(0x134)]('\x20\x20'+a34_0x2f3d18['red']('-\x20'+_0x2162d6[_0x50bca9(0xbe)]+_0x50bca9(0x138)));else _0x42f76d[_0x50bca9(0xbe)]>0x0&&!_0x2f7cb2[_0x50bca9(0x119)]&&console[_0x50bca9(0x134)]('\x20\x20'+a34_0x2f3d18[_0x50bca9(0x103)]('\x20\x20'+_0x42f76d[_0x50bca9(0xbe)]+_0x50bca9(0x121)));console[_0x50bca9(0x134)]('\x20\x20'+a34_0x2f3d18[_0x50bca9(0x103)]('=\x20'+_0x442bcd['length']+'\x20unchanged\x20segments'));_0x40711d[_0x50bca9(0xbe)]>0x0&&(console[_0x50bca9(0x134)](''),console[_0x50bca9(0x134)]('\x20\x20Activations:'),_0x747a86[_0x50bca9(0xbe)]>0x0&&console[_0x50bca9(0x134)]('\x20\x20\x20\x20'+a34_0x2f3d18['green']('+\x20'+_0x747a86[_0x50bca9(0xbe)]+_0x50bca9(0xf4))),_0x555106['length']>0x0&&console[_0x50bca9(0x134)](_0x50bca9(0xfa)+a34_0x2f3d18[_0x50bca9(0xf0)]('~\x20'+_0x555106[_0x50bca9(0xbe)]+_0x50bca9(0x116))),_0x350b59[_0x50bca9(0xbe)]>0x0&&console[_0x50bca9(0x134)]('\x20\x20\x20\x20'+a34_0x2f3d18[_0x50bca9(0xca)]('-\x20'+_0x350b59[_0x50bca9(0xbe)]+_0x50bca9(0xd0))));console['error'](_0x50bca9(0x135)+a34_0x2f3d18[_0x50bca9(0x104)](_0xa327e6)+'\x0a');if(_0x38c89d[_0x50bca9(0xbe)]>0x0){console[_0x50bca9(0x134)](_0x50bca9(0x10f));for(const _0x3f60e8 of _0x38c89d){console[_0x50bca9(0x134)]('\x20\x20'+a34_0x2f3d18[_0x50bca9(0xf3)]('+')+'\x20'+_0x3f60e8);}console[_0x50bca9(0x134)]('');}if(_0x425242[_0x50bca9(0xbe)]>0x0)for(const _0x20eb20 of _0x425242){const _0x27edb0=_0x20eb20[_0x50bca9(0xcd)]?_0x20eb20[_0x50bca9(0xcd)]+'/'+_0x20eb20[_0x50bca9(0x102)]['name']:_0x20eb20[_0x50bca9(0x102)][_0x50bca9(0x13d)],_0x16a798=_0x20eb20[_0x50bca9(0x102)][_0x50bca9(0xc8)]?.['length']||0x0,_0x438e02=_0x16a798>0x0?a34_0x2f3d18[_0x50bca9(0x103)]('\x20['+_0x16a798+_0x50bca9(0xbc)):'';console[_0x50bca9(0x134)]('\x0a'+a34_0x2f3d18[_0x50bca9(0x130)]('New\x20segment:')+'\x20'+_0x27edb0+_0x438e02),console['error']('─'[_0x50bca9(0x133)](0x3c)),_0x20eb20[_0x50bca9(0xd9)]&&console[_0x50bca9(0x134)](_0x20eb20[_0x50bca9(0xd9)]),console[_0x50bca9(0x134)]('─'[_0x50bca9(0x133)](0x3c));}if(_0x2162d6['length']>0x0)for(const _0x3c5f71 of _0x2162d6){const _0x16de5d=_0x3c5f71[_0x50bca9(0xc6)]?_0x5f449e[_0x50bca9(0x143)](_0x3c5f71['segmentFolderId']['toString']())||'':'',_0x17ed77=_0x16de5d?_0x16de5d+'/'+_0x3c5f71[_0x50bca9(0x13d)]:_0x3c5f71[_0x50bca9(0x13d)],_0x287b1c=_0x34d459['get'](_0x3c5f71['id'])||[],_0x3710ae=_0x287b1c['length']>0x0?a34_0x2f3d18[_0x50bca9(0x103)]('\x20['+_0x287b1c['length']+_0x50bca9(0xbc)):'';console[_0x50bca9(0x134)]('\x0a'+a34_0x2f3d18[_0x50bca9(0xca)](_0x50bca9(0x12b))+'\x20'+_0x17ed77+_0x3710ae),console['error']('─'[_0x50bca9(0x133)](0x3c));const _0x1b1fb8=segmentWithActivationsToYaml(_0x3c5f71,_0x287b1c,undefined,_0x394f8a,_0x463562),_0x22a575=segmentToYamlString(_0x1b1fb8),_0x30a068=generateDiff(_0x22a575,'');console['error'](formatDiffWithColors(_0x30a068)),console[_0x50bca9(0x134)]('─'[_0x50bca9(0x133)](0x3c));}const _0x5bf209=_0x1fc446[_0x50bca9(0x13f)](_0x3c3b6a=>!_0x3c3b6a[_0x50bca9(0xf7)]&&_0x3c3b6a[_0x50bca9(0xd9)]);if(_0x5bf209[_0x50bca9(0xbe)]>0x0)for(const _0x4444bf of _0x5bf209){const _0x2545c4=_0x4444bf[_0x50bca9(0xcd)]?_0x4444bf['folderPath']+'/'+_0x4444bf[_0x50bca9(0x102)][_0x50bca9(0x13d)]:_0x4444bf[_0x50bca9(0x102)]['name'];console['error']('\x0a'+a34_0x2f3d18[_0x50bca9(0xf0)](_0x50bca9(0xc4))+'\x20'+_0x2545c4),console[_0x50bca9(0x134)]('─'[_0x50bca9(0x133)](0x3c)),console['error'](_0x4444bf[_0x50bca9(0xd9)]),console['error']('─'['repeat'](0x3c));}if(_0x2f7cb2[_0x50bca9(0xf5)])return console['error'](a34_0x2f3d18[_0x50bca9(0xf0)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x5910f9=_0x425242['length']>0x0||_0x328871[_0x50bca9(0xbe)]>0x0||_0x2162d6[_0x50bca9(0xbe)]>0x0,_0x1a1646=_0x40711d[_0x50bca9(0xbe)]>0x0,_0x4e3c57=_0x38c89d[_0x50bca9(0xbe)]>0x0;if(!_0x5910f9&&!_0x1a1646&&!_0x4e3c57)return console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0x130)]('✔\x20All\x20segments\x20and\x20activations\x20are\x20up\x20to\x20date')),0x0;const _0x2e18d1=_0x425242[_0x50bca9(0xbe)]+_0x328871[_0x50bca9(0xbe)]+_0x2162d6[_0x50bca9(0xbe)]+_0x38c89d[_0x50bca9(0xbe)]+_0x40711d[_0x50bca9(0xbe)];if(!_0x2f7cb2['yes']&&_0x2e18d1>0x0){const _0x3a5ffb=await confirmKey(_0x50bca9(0x141)+_0x2e18d1+'\x20changes?');if(!_0x3a5ffb)return console[_0x50bca9(0x134)](_0x50bca9(0xd5)),0x1;}for(const _0x3ac9d0 of _0x38c89d){const _0x55073f=_0x3ac9d0[_0x50bca9(0xea)]('/'),_0x50a962=_0x55073f[_0x55073f[_0x50bca9(0xbe)]-0x1],_0x5c37aa=_0x55073f[_0x50bca9(0xde)](0x0,-0x1)['join']('/'),_0x1c157a=_0x1d58ca[_0x50bca9(0x143)](_0x5c37aa),_0x2d98f1={'name':_0x50a962,'parentFolderId':_0x1c157a},_0x1e0ede=await withSpinner(_0x50bca9(0xbf)+_0x3ac9d0+_0x50bca9(0xf1),()=>_0x189e83[_0x50bca9(0xed)][_0x50bca9(0x124)](_0x1b12c9,_0x2d98f1),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]});_0x1d58ca['set'](_0x3ac9d0,_0x1e0ede[_0x50bca9(0x10e)]['id']),console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0xf3)]('✔\x20Created\x20folder\x20\x27'+_0x3ac9d0+'\x27'));}let _0x29273d=0x0,_0x3f6290=0x0,_0x3e135d=0x0,_0xdc3b47=0x0,_0x6f44a7=0x0,_0x147547=0x0;const _0x23fdfd=new Map();for(const _0x37f13b of _0x1fc446){const _0x4eb619=_0x37f13b['folderPath']?_0x1d58ca['get'](_0x37f13b[_0x50bca9(0xcd)]):undefined;let _0x2da702;if(_0x37f13b[_0x50bca9(0xf7)]){const _0x5a1a05=yamlToCreateRequest(_0x37f13b[_0x50bca9(0x102)],_0x4eb619),_0x504843=await withSpinner(_0x50bca9(0xf8)+_0x37f13b['yamlConfig']['name']+_0x50bca9(0xf1),()=>_0x189e83[_0x50bca9(0xed)][_0x50bca9(0xf2)](_0x1b12c9,_0x5a1a05),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]});_0x2da702=_0x504843[_0x50bca9(0x10e)]['id'],_0x23fdfd['set'](_0x37f13b[_0x50bca9(0x102)][_0x50bca9(0x13d)],_0x2da702),console['error'](a34_0x2f3d18[_0x50bca9(0x130)](_0x50bca9(0xc3)+_0x37f13b[_0x50bca9(0x102)][_0x50bca9(0x13d)]+'\x27')),_0x29273d++;}else{if(_0x37f13b[_0x50bca9(0x10c)]){const _0x6a935e=yamlToUpdateRequest(_0x37f13b[_0x50bca9(0x102)]);_0x4eb619!==_0x37f13b[_0x50bca9(0x118)]?.[_0x50bca9(0xc6)]&&(_0x6a935e[_0x50bca9(0xc6)]=_0x4eb619?parseInt(_0x4eb619,0xa):undefined),await withSpinner('Updating\x20segment\x20\x27'+_0x37f13b[_0x50bca9(0x102)][_0x50bca9(0x13d)]+_0x50bca9(0xf1),()=>_0x189e83['segment']['updateSegmentById'](_0x1b12c9,_0x37f13b[_0x50bca9(0x118)]['id'],_0x6a935e),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]}),_0x2da702=_0x37f13b[_0x50bca9(0x118)]['id'],console['error'](a34_0x2f3d18[_0x50bca9(0xf0)](_0x50bca9(0xff)+_0x37f13b['yamlConfig']['name']+'\x27')),_0x3f6290++;}else _0x2da702=_0x37f13b[_0x50bca9(0x118)]['id'];}for(const _0x438970 of _0x37f13b['activationActions']){if(_0x438970[_0x50bca9(0xe0)]===_0x50bca9(0xd4)&&_0x438970[_0x50bca9(0x11f)]){const _0x2c4603=yamlActivationToCreateRequest(_0x438970[_0x50bca9(0x11f)],_0x974567,_0x3232be);await withSpinner(_0x50bca9(0xce)+_0x438970[_0x50bca9(0x13d)]+'\x27...',()=>_0x189e83['segment'][_0x50bca9(0x115)](_0x1b12c9,_0x2da702,_0x2c4603),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]}),console[_0x50bca9(0x134)](a34_0x2f3d18['green'](_0x50bca9(0x127)+_0x438970[_0x50bca9(0x13d)]+'\x27')),_0xdc3b47++;}else{if(_0x438970[_0x50bca9(0xe0)]===_0x50bca9(0xc9)&&_0x438970['yamlActivation']&&_0x438970[_0x50bca9(0x13a)]){const _0x17cf73=yamlActivationToUpdateRequest(_0x438970[_0x50bca9(0x11f)],_0x974567,_0x3232be);await withSpinner('Updating\x20activation\x20\x27'+_0x438970[_0x50bca9(0x13d)]+_0x50bca9(0xf1),()=>_0x189e83[_0x50bca9(0xed)][_0x50bca9(0xd1)](_0x1b12c9,_0x2da702,_0x438970['existingActivation']['id'],_0x17cf73),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]}),console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0xf0)](_0x50bca9(0x107)+_0x438970[_0x50bca9(0x13d)]+'\x27')),_0x6f44a7++;}else _0x438970[_0x50bca9(0xe0)]===_0x50bca9(0x119)&&_0x438970['existingActivation']&&(await withSpinner(_0x50bca9(0x12a)+_0x438970[_0x50bca9(0x13d)]+'\x27...',()=>_0x189e83['segment']['deleteActivation'](_0x1b12c9,_0x2da702,_0x438970['existingActivation']['id']),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]}),console[_0x50bca9(0x134)](a34_0x2f3d18['red'](_0x50bca9(0xcb)+_0x438970[_0x50bca9(0x13d)]+'\x27')),_0x147547++);}}}for(const _0x22f564 of _0x2162d6){await withSpinner(_0x50bca9(0x109)+_0x22f564[_0x50bca9(0x13d)]+_0x50bca9(0xf1),()=>_0x189e83['segment'][_0x50bca9(0x111)](_0x22f564['id']),{'verbose':_0x2f7cb2[_0x50bca9(0x123)]}),console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0xca)]('✔\x20Deleted\x20segment\x20\x27'+_0x22f564[_0x50bca9(0x13d)]+'\x27')),_0x3e135d++;}const _0x379eb5=[];if(_0x29273d>0x0)_0x379eb5['push'](_0x29273d+_0x50bca9(0x112));if(_0x3f6290>0x0)_0x379eb5[_0x50bca9(0x13c)](_0x3f6290+'\x20updated');if(_0x3e135d>0x0)_0x379eb5[_0x50bca9(0x13c)](_0x3e135d+_0x50bca9(0x126));const _0x409728=[];if(_0xdc3b47>0x0)_0x409728['push'](_0xdc3b47+_0x50bca9(0x112));if(_0x6f44a7>0x0)_0x409728[_0x50bca9(0x13c)](_0x6f44a7+'\x20updated');if(_0x147547>0x0)_0x409728['push'](_0x147547+_0x50bca9(0x126));return console[_0x50bca9(0x134)](a34_0x2f3d18[_0x50bca9(0x130)]('\x0a✔\x20Push\x20complete')),_0x379eb5[_0x50bca9(0xbe)]>0x0&&console['error'](_0x50bca9(0x128)+_0x379eb5[_0x50bca9(0xe7)](',\x20')),_0x409728[_0x50bca9(0xbe)]>0x0&&console[_0x50bca9(0x134)](_0x50bca9(0x13b)+_0x409728[_0x50bca9(0xe7)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x157356){const _0x1b7444=a34_0xb3c545,_0x3a26dc=new Map(),_0x27221e=new Map();for(const _0x11b128 of _0x157356){_0x27221e['set'](_0x11b128['id'],_0x11b128);}const _0xf04186=new Set();for(const _0x499925 of _0x157356){!_0x499925[_0x1b7444(0xec)]&&_0xf04186[_0x1b7444(0xd6)](_0x499925['id']);}function _0x5ac5b9(_0x183e67){const _0x567bd7=_0x1b7444;if(_0xf04186[_0x567bd7(0xeb)](_0x183e67['id']))return'';if(_0x183e67['parentFolderId']){const _0x494936=_0x27221e['get'](_0x183e67[_0x567bd7(0xec)]);if(_0x494936){const _0x3430ae=_0x5ac5b9(_0x494936);return _0x3430ae?_0x3430ae+'/'+_0x183e67[_0x567bd7(0x13d)]:_0x183e67[_0x567bd7(0x13d)];}}return _0x183e67['name'];}for(const _0x1d77ab of _0x157356){const _0x43aba0=_0x5ac5b9(_0x1d77ab);_0x3a26dc[_0x1b7444(0xdc)](_0x43aba0,_0x1d77ab['id']);}return _0x3a26dc;}function findYamlFiles(_0x2e1f2f){const _0xec7976=[];function _0x386458(_0x56603e){const _0x31b69b=a34_0x1604,_0x10099c=readdirSync(_0x56603e,{'withFileTypes':!![]});for(const _0x306245 of _0x10099c){const _0x359a93=a34_0x81b7ad['join'](_0x56603e,_0x306245['name']);if(_0x306245['isDirectory']())_0x386458(_0x359a93);else(_0x306245[_0x31b69b(0x13d)][_0x31b69b(0x114)](_0x31b69b(0xe8))||_0x306245[_0x31b69b(0x13d)]['endsWith'](_0x31b69b(0x12e)))&&_0xec7976[_0x31b69b(0x13c)](_0x359a93);}}return _0x386458(_0x2e1f2f),_0xec7976;}function calculateActivationActions(_0x5c1da2,_0x1026bc,_0x282db7,_0x324406){const _0x318fef=a34_0xb3c545,_0x3ce73b=[],_0x3deca6=new Map();for(const _0x155e17 of _0x1026bc){_0x3deca6[_0x318fef(0xdc)](_0x155e17[_0x318fef(0x13d)],_0x155e17);}const _0x4d8701=new Map();for(const _0x3dcdc4 of _0x5c1da2){_0x4d8701[_0x318fef(0xdc)](_0x3dcdc4[_0x318fef(0x13d)],_0x3dcdc4);}for(const _0x5888c1 of _0x5c1da2){const _0x47f034=_0x3deca6[_0x318fef(0x143)](_0x5888c1[_0x318fef(0x13d)]);if(!_0x47f034)_0x3ce73b['push']({'type':_0x318fef(0xd4),'name':_0x5888c1[_0x318fef(0x13d)],'yamlActivation':_0x5888c1});else{const _0x5b0220=activationToYaml(_0x47f034,_0x282db7,_0x324406),_0x5a6ef9=a34_0x29250e[_0x318fef(0x144)](_0x5b0220),_0x23de60=a34_0x29250e[_0x318fef(0x144)](_0x5888c1);_0x5a6ef9!==_0x23de60&&_0x3ce73b[_0x318fef(0x13c)]({'type':_0x318fef(0xc9),'name':_0x5888c1['name'],'yamlActivation':_0x5888c1,'existingActivation':_0x47f034});}}for(const _0x1db285 of _0x1026bc){!_0x4d8701[_0x318fef(0xeb)](_0x1db285[_0x318fef(0x13d)])&&_0x3ce73b['push']({'type':_0x318fef(0x119),'name':_0x1db285['name'],'existingActivation':_0x1db285});}return _0x3ce73b;}
1
+ function a34_0x5a5f(_0x400b99,_0x1e98b0){_0x400b99=_0x400b99-0x1eb;const _0x3cc010=a34_0x3cc0();let _0x5a5f9b=_0x3cc010[_0x400b99];return _0x5a5f9b;}const a34_0x2515d0=a34_0x5a5f;(function(_0x2dcbc3,_0x31ac78){const _0x2b2f7c=a34_0x5a5f,_0x1044d0=_0x2dcbc3();while(!![]){try{const _0x4c119c=-parseInt(_0x2b2f7c(0x235))/0x1*(-parseInt(_0x2b2f7c(0x257))/0x2)+parseInt(_0x2b2f7c(0x271))/0x3+parseInt(_0x2b2f7c(0x206))/0x4*(-parseInt(_0x2b2f7c(0x200))/0x5)+parseInt(_0x2b2f7c(0x262))/0x6*(-parseInt(_0x2b2f7c(0x24d))/0x7)+parseInt(_0x2b2f7c(0x26b))/0x8+parseInt(_0x2b2f7c(0x1fe))/0x9+parseInt(_0x2b2f7c(0x263))/0xa*(parseInt(_0x2b2f7c(0x239))/0xb);if(_0x4c119c===_0x31ac78)break;else _0x1044d0['push'](_0x1044d0['shift']());}catch(_0x3bccb8){_0x1044d0['push'](_0x1044d0['shift']());}}}(a34_0x3cc0,0x47831));import{BaseCommand}from'./command.js';import{withSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{getSegmentRootDir,findTdxConfig}from'../utils/tdx-config.js';import{segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,yamlToCreateRequest,yamlToUpdateRequest,yamlActivationToCreateRequest,yamlActivationToUpdateRequest,activationToYaml}from'../sdk/segment/child-segment-yaml.js';function a34_0x3cc0(){const _0x50767c=['\x27...','Source\x20directory:\x20','blue','listFolders','Error:\x20Parent\x20segment\x20is\x20required\x0a','buildNameToIdMap','\x20segments\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','✔\x20All\x20segments\x20and\x20activations\x20are\x20up\x20to\x20date','relative','configDir','execute','\x20deleted','Deleting\x20segment\x20\x27','endsWith','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20activations]','Updating\x20activation\x20\x27','\x20changes?','Fetching\x20existing\x20folders...','12523itkuTQ','Creating\x20segment\x20\x27','parent_segment','\x20changed\x20segments','Aborted.','cwd','red','\x20\x20✔\x20Deleted\x20activation\x20\x27','flatMap','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','105284aorzMs','isNew','site','listSegments','delete','name','Fetching\x20connections\x20for\x20name\x20resolution...','✔\x20Created\x20segment\x20\x27','yellow','filter','Error:\x20No\x20segment\x20YAML\x20files\x20found\x20in\x20','1308UyGcAP','1850lNtbif','Error:\x20Directory\x20not\x20found:\x20','Resolving\x20parent\x20segment\x20\x27','create','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20to\x20delete','parentSegment','hasChanges','3862416dhNSsu','dim','then','buildIdToNameMap','\x20\x20Segments:\x20','parentFolderId','34941dVFEVq','all','.yaml','join','.yml','\x20\x20✔\x20Created\x20activation\x20\x27','createActivation','type','diff','utf-8','\x20updated','Creating\x20activation\x20\x27','\x20\x20Activations:\x20','stringify','resolveParentId','Updating\x20segment\x20\x27','activations','toLowerCase','📁\x20','listActivations','updateSegmentById','\x20created','2259189mjcYjQ','Creating\x20folder\x20\x27','5VSeWfC','get','update','connection','Fetching\x20existing\x20activations...','from','1775844emYumy','has','error','config','deleteSegment','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','New\x20segment:','add','folderPath','✔\x20Created\x20folder\x20\x27','✔\x20Updated\x20segment\x20\x27','\x20to\x20create','Fetching\x20users\x20for\x20email\x20resolution...','yamlActivation','\x0a✔\x20Push\x20complete','Delete\x20segment:','sort','segment','\x20\x20\x20\x20','cyan','existingSegment','replace','existingActivation','push','dirname','yamlConfig','Changes\x20to:','\x0aPush\x20summary\x20for\x20\x27','Error\x20parsing\x20','Deleting\x20activation\x20\x27','Push\x20','green','verbose','\x20\x20Source:\x20','segmentFolderId','repeat','activationActions','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file\x0a','toString','length','dryRun','\x20unchanged\x20segments','set','isDirectory','No\x20segment\x20YAML\x20files\x20found','createFolder','3xFjJXg','entries','buildUserMaps','data','13288NvPcOm'];a34_0x3cc0=function(){return _0x50767c;};return a34_0x3cc0();}import a34_0x46b2dd from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a34_0x5d5a02 from'path';import*as a34_0x37a678 from'yaml';function sanitizeFileName(_0x33d90c){const _0x5ab813=a34_0x5a5f;return _0x33d90c[_0x5ab813(0x1f9)]()[_0x5ab813(0x21c)](/[/\\:*?"<>|]/g,'-')[_0x5ab813(0x21c)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x5ab813(0x21c)](/^-|-$/g,'');}function tryFindTdxConfig(_0x1c6a61){try{return findTdxConfig(_0x1c6a61);}catch{return null;}}function resolveTDFolderPath(_0x4e2ded,_0x31a1fd,_0x32074b){if(!_0x31a1fd)return _0x4e2ded;return _0x4e2ded?_0x32074b+'/'+_0x4e2ded:_0x32074b;}export class SegmentPushCommand extends BaseCommand{[a34_0x2515d0(0x25c)]='segment:push';['description']=a34_0x2515d0(0x20b);async[a34_0x2515d0(0x244)](_0x11eff9){const _0x2e412d=a34_0x2515d0,{options:_0x3c0c94,args:_0x220362,tdx:_0x3b31e6}=_0x11eff9,_0x4b497a=_0x3c0c94,_0x136726=_0x3c0c94[_0x2e412d(0x269)],_0x11f466=_0x220362[0x0];let _0x5ec2e0,_0x5aa8f1,_0x4737e8;if(_0x11f466){if(existsSync(_0x11f466)&&statSync(_0x11f466)[_0x2e412d(0x232)]()){const _0x22b3b0=tryFindTdxConfig(_0x11f466);if(_0x22b3b0)_0x5ec2e0=_0x22b3b0[_0x2e412d(0x209)][_0x2e412d(0x24f)],_0x5aa8f1=_0x11f466,_0x4737e8=_0x22b3b0[_0x2e412d(0x243)];else return console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x253)](_0x2e412d(0x248)+_0x11f466+'\x0a')),console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x21a)](_0x2e412d(0x267))),0x1;}else _0x5ec2e0=_0x11f466;}else{const _0x12c07f=tryFindTdxConfig(process[_0x2e412d(0x252)]());_0x12c07f?(_0x5ec2e0=_0x12c07f['config'][_0x2e412d(0x24f)],_0x5aa8f1=process[_0x2e412d(0x252)](),_0x4737e8=_0x12c07f[_0x2e412d(0x243)]):_0x5ec2e0=_0x136726;}if(!_0x5ec2e0)return console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x253)](_0x2e412d(0x23e))),console[_0x2e412d(0x208)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x2e412d(0x208)](_0x2e412d(0x256)),console[_0x2e412d(0x208)](_0x2e412d(0x22c)),console[_0x2e412d(0x208)](a34_0x46b2dd['cyan']('Tip:\x20Set\x20context\x20with\x20`tdx\x20segment\x20use\x20<parent_name>`\x20or\x20`tdx\x20ps\x20use\x20<parent_name>`')),0x1;const _0x44822d=_0x5aa8f1||getSegmentRootDir(sanitizeFileName(_0x5ec2e0)),_0x26ae07=_0x4737e8||_0x44822d,_0x3b26c3=a34_0x5d5a02[_0x2e412d(0x242)](_0x26ae07,_0x44822d),_0x2fb5bd=_0x3b26c3!==''&&_0x3b26c3!=='.';if(!existsSync(_0x44822d))return console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x253)](_0x2e412d(0x264)+_0x44822d+'\x0a')),console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x21a)](_0x2e412d(0x267))),0x1;_0x4b497a[_0x2e412d(0x227)]&&(console[_0x2e412d(0x208)]('Site:\x20'+_0x4b497a[_0x2e412d(0x259)]),console[_0x2e412d(0x208)]('Parent\x20segment:\x20'+_0x5ec2e0),console[_0x2e412d(0x208)](_0x2e412d(0x23b)+_0x44822d),_0x2fb5bd&&console[_0x2e412d(0x208)]('Scoped\x20to\x20folder:\x20'+_0x3b26c3));const _0x24380c=await withSpinner(_0x2e412d(0x265)+_0x5ec2e0+'\x27...',()=>_0x3b31e6[_0x2e412d(0x218)][_0x2e412d(0x1f6)](_0x5ec2e0),{'verbose':_0x4b497a['verbose']}),_0x1949bc=_0x24380c[_0x2e412d(0x238)],[_0x11cad5,_0x3730e1,_0x3c8f70]=await Promise[_0x2e412d(0x272)]([withSpinner('Fetching\x20existing\x20segments...',()=>_0x3b31e6[_0x2e412d(0x218)][_0x2e412d(0x25a)](_0x1949bc),{'verbose':_0x4b497a[_0x2e412d(0x227)]}),withSpinner(_0x2e412d(0x24c),()=>_0x3b31e6['segment'][_0x2e412d(0x23d)](_0x1949bc),{'verbose':_0x4b497a[_0x2e412d(0x227)]}),withSpinner(_0x2e412d(0x213),()=>_0x3b31e6['user'][_0x2e412d(0x237)](),{'verbose':_0x4b497a[_0x2e412d(0x227)]})[_0x2e412d(0x26d)](_0x4ae97c=>_0x4ae97c[_0x2e412d(0x238)])]),_0x198769=_0x11cad5['data'],_0x5a9ef5=_0x3730e1[_0x2e412d(0x238)],{emailToId:_0x523ae6,idToEmail:_0x288383}=_0x3c8f70,[_0x352001,_0x6ab6b3]=await withSpinner(_0x2e412d(0x25d),async()=>{const _0x314d75=_0x2e412d,[_0x45d91a,_0x1ed354]=await Promise[_0x314d75(0x272)]([_0x3b31e6[_0x314d75(0x203)][_0x314d75(0x23f)](),_0x3b31e6[_0x314d75(0x203)][_0x314d75(0x26e)]()]);return[_0x45d91a,_0x1ed354];},{'verbose':_0x4b497a['verbose']})[_0x2e412d(0x26d)](_0x1c08e0=>_0x1c08e0[_0x2e412d(0x238)]),_0x530c3f=buildFolderPathToIdMap(_0x5a9ef5),_0x3ea168=new Map();for(const [_0x57b708,_0x4be976]of _0x530c3f[_0x2e412d(0x236)]()){_0x3ea168[_0x2e412d(0x231)](_0x4be976,_0x57b708);}const _0x16712c=new Map();for(const _0x58a630 of _0x198769){const _0xc6f529=_0x58a630['segmentFolderId']?_0x3ea168[_0x2e412d(0x201)](_0x58a630[_0x2e412d(0x229)]['toString']())||'':'',_0x4689b8=_0xc6f529+':'+_0x58a630[_0x2e412d(0x25c)];_0x16712c[_0x2e412d(0x231)](_0x4689b8,_0x58a630);}const _0x595bc6=findYamlFiles(_0x44822d);if(_0x595bc6[_0x2e412d(0x22e)]===0x0)return console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x253)](_0x2e412d(0x261)+_0x44822d+'\x0a')),console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x21a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20files')),0x1;const _0x3a4edc=[];for(const _0x5e2fd4 of _0x595bc6){const _0x2e2732=a34_0x5d5a02['relative'](_0x44822d,a34_0x5d5a02[_0x2e412d(0x21f)](_0x5e2fd4)),_0x3f65b7=_0x2e2732==='.'?'':_0x2e2732,_0x364f08=readFileSync(_0x5e2fd4,_0x2e412d(0x1f1));try{const _0x141e71=parseSegmentYamlFile(_0x364f08);_0x3a4edc[_0x2e412d(0x21e)]({'yamlConfig':_0x141e71,'folderPath':_0x3f65b7,'sourcePath':_0x5e2fd4});}catch(_0x261199){return console['error'](a34_0x46b2dd[_0x2e412d(0x253)](_0x2e412d(0x223)+_0x5e2fd4+':\x20'+(_0x261199 instanceof Error?_0x261199['message']:_0x261199))),0x1;}}if(_0x3a4edc[_0x2e412d(0x22e)]===0x0)return console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x25f)](_0x2e412d(0x233))),0x0;const _0x451e43=new Map();_0x198769[_0x2e412d(0x22e)]>0x0&&await withSpinner(_0x2e412d(0x204),async()=>{await batchAsync(_0x198769,async _0x384116=>{const _0x4ec2cb=a34_0x5a5f,_0x1184f2=await _0x3b31e6[_0x4ec2cb(0x218)][_0x4ec2cb(0x1fb)](_0x1949bc,_0x384116['id']);_0x451e43[_0x4ec2cb(0x231)](_0x384116['id'],_0x1184f2);});},{'verbose':_0x4b497a[_0x2e412d(0x227)]});const _0x23cb27=[],_0x181227=new Set();for(const {yamlConfig:_0xe5c1b2,folderPath:_0x113501,sourcePath:_0x4fbba8}of _0x3a4edc){const _0x12c139=resolveTDFolderPath(_0x113501,_0x2fb5bd,_0x3b26c3),_0x5801fb=_0x12c139+':'+_0xe5c1b2['name'],_0x3c37ce=_0x16712c[_0x2e412d(0x201)](_0x5801fb),_0xbb3268=_0x3c37ce?_0x451e43[_0x2e412d(0x201)](_0x3c37ce['id'])||[]:[];if(_0x12c139&&!_0x530c3f[_0x2e412d(0x207)](_0x12c139)){const _0x3cbfc1=_0x12c139['split']('/');let _0x1e2add='';for(const _0x7c2b40 of _0x3cbfc1){_0x1e2add=_0x1e2add?_0x1e2add+'/'+_0x7c2b40:_0x7c2b40,!_0x530c3f['has'](_0x1e2add)&&_0x181227[_0x2e412d(0x20e)](_0x1e2add);}}const _0x40f779=calculateActivationActions(_0xe5c1b2[_0x2e412d(0x1f8)]||[],_0xbb3268,_0x288383,_0x6ab6b3),_0x35fb20=segmentToYamlString(_0xe5c1b2);let _0x244e7f,_0x3870b3=![],_0xb4af26;if(_0x3c37ce){const _0x5a55d6=segmentWithActivationsToYaml(_0x3c37ce,_0xbb3268,undefined,_0x288383,_0x6ab6b3),_0xdd54fd=segmentToYamlString(_0x5a55d6);_0x244e7f=generateDiff(_0xdd54fd,_0x35fb20),_0x3870b3=hasChanges(_0x244e7f),_0x3870b3&&(_0xb4af26=formatDiffWithColors(_0x244e7f));}else _0x244e7f=generateDiff('',_0x35fb20),_0xb4af26=formatDiffWithColors(_0x244e7f);_0x23cb27[_0x2e412d(0x21e)]({'relativePath':_0xe5c1b2[_0x2e412d(0x25c)],'absolutePath':_0x4fbba8,'yamlConfig':_0xe5c1b2,'folderPath':_0x12c139,'existingSegment':_0x3c37ce,'existingActivations':_0xbb3268,'isNew':!_0x3c37ce,'hasChanges':_0x3870b3,'diff':_0xb4af26,'activationActions':_0x40f779});}const _0x25d178=new Set();for(const {yamlConfig:_0x429ab5,folderPath:_0x257e9d}of _0x3a4edc){const _0x3f1e1f=resolveTDFolderPath(_0x257e9d,_0x2fb5bd,_0x3b26c3);_0x25d178['add'](_0x3f1e1f+':'+_0x429ab5[_0x2e412d(0x25c)]);}const _0x59db1c=_0x198769[_0x2e412d(0x260)](_0x163a53=>{const _0x402654=_0x2e412d,_0x11783b=_0x163a53[_0x402654(0x229)]?_0x3ea168[_0x402654(0x201)](_0x163a53[_0x402654(0x229)][_0x402654(0x22d)]())||'':'',_0x4c8e2a=_0x11783b+':'+_0x163a53[_0x402654(0x25c)];if(_0x25d178['has'](_0x4c8e2a))return![];if(_0x2fb5bd)return _0x11783b===_0x3b26c3||_0x11783b['startsWith'](_0x3b26c3+'/');return!![];}),_0x42520c=_0x23cb27[_0x2e412d(0x260)](_0x3e81f7=>_0x3e81f7[_0x2e412d(0x258)]),_0x1c0872=_0x23cb27['filter'](_0x44dd72=>!_0x44dd72[_0x2e412d(0x258)]&&_0x44dd72[_0x2e412d(0x26a)]),_0x34fc79=_0x23cb27[_0x2e412d(0x260)](_0xad451f=>!_0xad451f[_0x2e412d(0x258)]&&!_0xad451f['hasChanges']),_0x293782=Array[_0x2e412d(0x205)](_0x181227)[_0x2e412d(0x217)](),_0x1f80c5=_0x4b497a['delete']?_0x59db1c:[],_0x34ad9b=_0x23cb27[_0x2e412d(0x255)](_0x8b867=>_0x8b867[_0x2e412d(0x22b)]),_0x4268c3=_0x34ad9b[_0x2e412d(0x260)](_0x2f8da4=>_0x2f8da4[_0x2e412d(0x1ef)]===_0x2e412d(0x266)),_0x3916eb=_0x34ad9b[_0x2e412d(0x260)](_0xfdbe3=>_0xfdbe3[_0x2e412d(0x1ef)]===_0x2e412d(0x202)),_0x34e4d3=_0x34ad9b['filter'](_0x26a351=>_0x26a351[_0x2e412d(0x1ef)]===_0x2e412d(0x25b));console['error'](_0x2e412d(0x222)+_0x5ec2e0+'\x27:');_0x293782[_0x2e412d(0x22e)]>0x0&&console[_0x2e412d(0x208)]('\x20\x20'+a34_0x46b2dd[_0x2e412d(0x23c)](_0x2e412d(0x1fa)+_0x293782[_0x2e412d(0x22e)]+'\x20folders\x20to\x20create'));console['error']('\x20\x20'+a34_0x46b2dd[_0x2e412d(0x226)]('+\x20'+_0x42520c[_0x2e412d(0x22e)]+'\x20new\x20segments')),console[_0x2e412d(0x208)]('\x20\x20'+a34_0x46b2dd['yellow']('~\x20'+_0x1c0872[_0x2e412d(0x22e)]+_0x2e412d(0x250)));if(_0x1f80c5[_0x2e412d(0x22e)]>0x0)console['error']('\x20\x20'+a34_0x46b2dd['red']('-\x20'+_0x1f80c5[_0x2e412d(0x22e)]+'\x20segments\x20to\x20delete'));else _0x59db1c['length']>0x0&&!_0x4b497a['delete']&&console[_0x2e412d(0x208)]('\x20\x20'+a34_0x46b2dd['dim']('\x20\x20'+_0x59db1c[_0x2e412d(0x22e)]+_0x2e412d(0x240)));console['error']('\x20\x20'+a34_0x46b2dd[_0x2e412d(0x26c)]('=\x20'+_0x34fc79[_0x2e412d(0x22e)]+_0x2e412d(0x230)));_0x34ad9b[_0x2e412d(0x22e)]>0x0&&(console['error'](''),console[_0x2e412d(0x208)]('\x20\x20Activations:'),_0x4268c3[_0x2e412d(0x22e)]>0x0&&console[_0x2e412d(0x208)]('\x20\x20\x20\x20'+a34_0x46b2dd[_0x2e412d(0x226)]('+\x20'+_0x4268c3['length']+_0x2e412d(0x212))),_0x3916eb['length']>0x0&&console['error'](_0x2e412d(0x219)+a34_0x46b2dd[_0x2e412d(0x25f)]('~\x20'+_0x3916eb[_0x2e412d(0x22e)]+'\x20to\x20update')),_0x34e4d3[_0x2e412d(0x22e)]>0x0&&console[_0x2e412d(0x208)]('\x20\x20\x20\x20'+a34_0x46b2dd[_0x2e412d(0x253)]('-\x20'+_0x34e4d3['length']+_0x2e412d(0x268))));console[_0x2e412d(0x208)](_0x2e412d(0x228)+a34_0x46b2dd['cyan'](_0x44822d)+'\x0a');if(_0x293782[_0x2e412d(0x22e)]>0x0){console[_0x2e412d(0x208)]('Folders\x20to\x20create:');for(const _0x6b1271 of _0x293782){console['error']('\x20\x20'+a34_0x46b2dd['blue']('+')+'\x20'+_0x6b1271);}console[_0x2e412d(0x208)]('');}if(_0x42520c['length']>0x0)for(const _0x4ea021 of _0x42520c){const _0x26eeed=_0x4ea021['folderPath']?_0x4ea021[_0x2e412d(0x20f)]+'/'+_0x4ea021[_0x2e412d(0x220)]['name']:_0x4ea021['yamlConfig'][_0x2e412d(0x25c)],_0x2ec185=_0x4ea021[_0x2e412d(0x220)][_0x2e412d(0x1f8)]?.[_0x2e412d(0x22e)]||0x0,_0x51468d=_0x2ec185>0x0?a34_0x46b2dd[_0x2e412d(0x26c)]('\x20['+_0x2ec185+_0x2e412d(0x249)):'';console[_0x2e412d(0x208)]('\x0a'+a34_0x46b2dd['green'](_0x2e412d(0x20d))+'\x20'+_0x26eeed+_0x51468d),console[_0x2e412d(0x208)]('─'['repeat'](0x3c)),_0x4ea021[_0x2e412d(0x1f0)]&&console['error'](_0x4ea021[_0x2e412d(0x1f0)]),console['error']('─'[_0x2e412d(0x22a)](0x3c));}if(_0x1f80c5[_0x2e412d(0x22e)]>0x0)for(const _0x231941 of _0x1f80c5){const _0xc9ce5f=_0x231941['segmentFolderId']?_0x3ea168[_0x2e412d(0x201)](_0x231941[_0x2e412d(0x229)][_0x2e412d(0x22d)]())||'':'',_0x4fe6c9=_0xc9ce5f?_0xc9ce5f+'/'+_0x231941[_0x2e412d(0x25c)]:_0x231941['name'],_0x1ddbcf=_0x451e43[_0x2e412d(0x201)](_0x231941['id'])||[],_0x43af5c=_0x1ddbcf[_0x2e412d(0x22e)]>0x0?a34_0x46b2dd['dim']('\x20['+_0x1ddbcf[_0x2e412d(0x22e)]+_0x2e412d(0x249)):'';console[_0x2e412d(0x208)]('\x0a'+a34_0x46b2dd[_0x2e412d(0x253)](_0x2e412d(0x216))+'\x20'+_0x4fe6c9+_0x43af5c),console[_0x2e412d(0x208)]('─'[_0x2e412d(0x22a)](0x3c));const _0x528dc2=segmentWithActivationsToYaml(_0x231941,_0x1ddbcf,undefined,_0x288383,_0x6ab6b3),_0xc2bf33=segmentToYamlString(_0x528dc2),_0x42c07b=generateDiff(_0xc2bf33,'');console[_0x2e412d(0x208)](formatDiffWithColors(_0x42c07b)),console[_0x2e412d(0x208)]('─'['repeat'](0x3c));}const _0x15b50b=_0x23cb27[_0x2e412d(0x260)](_0xdda11b=>!_0xdda11b['isNew']&&_0xdda11b['diff']);if(_0x15b50b['length']>0x0)for(const _0x34bf8c of _0x15b50b){const _0x5f261c=_0x34bf8c[_0x2e412d(0x20f)]?_0x34bf8c['folderPath']+'/'+_0x34bf8c['yamlConfig'][_0x2e412d(0x25c)]:_0x34bf8c[_0x2e412d(0x220)][_0x2e412d(0x25c)];console[_0x2e412d(0x208)]('\x0a'+a34_0x46b2dd[_0x2e412d(0x25f)](_0x2e412d(0x221))+'\x20'+_0x5f261c),console[_0x2e412d(0x208)]('─'['repeat'](0x3c)),console[_0x2e412d(0x208)](_0x34bf8c[_0x2e412d(0x1f0)]),console[_0x2e412d(0x208)]('─'['repeat'](0x3c));}if(_0x4b497a[_0x2e412d(0x22f)])return console['error'](a34_0x46b2dd[_0x2e412d(0x25f)](_0x2e412d(0x20c))),0x0;const _0x59e7ff=_0x42520c[_0x2e412d(0x22e)]>0x0||_0x1c0872[_0x2e412d(0x22e)]>0x0||_0x1f80c5[_0x2e412d(0x22e)]>0x0,_0x43d6e5=_0x34ad9b[_0x2e412d(0x22e)]>0x0,_0x2a4bcd=_0x293782[_0x2e412d(0x22e)]>0x0;if(!_0x59e7ff&&!_0x43d6e5&&!_0x2a4bcd)return console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x226)](_0x2e412d(0x241))),0x0;const _0x48d4ff=_0x42520c['length']+_0x1c0872[_0x2e412d(0x22e)]+_0x1f80c5[_0x2e412d(0x22e)]+_0x293782['length']+_0x34ad9b[_0x2e412d(0x22e)];if(!_0x4b497a['yes']&&_0x48d4ff>0x0){const _0x1ab1a7=await confirmKey(_0x2e412d(0x225)+_0x48d4ff+_0x2e412d(0x24b));if(!_0x1ab1a7)return console[_0x2e412d(0x208)](_0x2e412d(0x251)),0x1;}for(const _0x345b08 of _0x293782){const _0x2cd4ec=_0x345b08['split']('/'),_0x230a14=_0x2cd4ec[_0x2cd4ec[_0x2e412d(0x22e)]-0x1],_0x58531c=_0x2cd4ec['slice'](0x0,-0x1)['join']('/'),_0x52011e=_0x530c3f[_0x2e412d(0x201)](_0x58531c),_0x28be0a={'name':_0x230a14,'parentFolderId':_0x52011e},_0x28b2f3=await withSpinner(_0x2e412d(0x1ff)+_0x345b08+_0x2e412d(0x23a),()=>_0x3b31e6[_0x2e412d(0x218)][_0x2e412d(0x234)](_0x1949bc,_0x28be0a),{'verbose':_0x4b497a['verbose']});_0x530c3f[_0x2e412d(0x231)](_0x345b08,_0x28b2f3['data']['id']),console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x23c)](_0x2e412d(0x210)+_0x345b08+'\x27'));}let _0x27cbf8=0x0,_0x443bbb=0x0,_0x24afec=0x0,_0xff7b09=0x0,_0x5b0b25=0x0,_0x4c50ef=0x0;const _0x19fbde=new Map();for(const _0x18568c of _0x23cb27){const _0x30251d=_0x18568c[_0x2e412d(0x20f)]?_0x530c3f['get'](_0x18568c[_0x2e412d(0x20f)]):undefined;let _0x47fbf9;if(_0x18568c['isNew']){const _0x58893f=yamlToCreateRequest(_0x18568c[_0x2e412d(0x220)],_0x30251d),_0x53328a=await withSpinner(_0x2e412d(0x24e)+_0x18568c[_0x2e412d(0x220)][_0x2e412d(0x25c)]+'\x27...',()=>_0x3b31e6[_0x2e412d(0x218)]['createSegment'](_0x1949bc,_0x58893f),{'verbose':_0x4b497a['verbose']});_0x47fbf9=_0x53328a[_0x2e412d(0x238)]['id'],_0x19fbde[_0x2e412d(0x231)](_0x18568c[_0x2e412d(0x220)][_0x2e412d(0x25c)],_0x47fbf9),console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x226)](_0x2e412d(0x25e)+_0x18568c[_0x2e412d(0x220)]['name']+'\x27')),_0x27cbf8++;}else{if(_0x18568c[_0x2e412d(0x26a)]){const _0x2a3af1=yamlToUpdateRequest(_0x18568c[_0x2e412d(0x220)]);_0x30251d!==_0x18568c[_0x2e412d(0x21b)]?.[_0x2e412d(0x229)]&&(_0x2a3af1[_0x2e412d(0x229)]=_0x30251d?parseInt(_0x30251d,0xa):undefined),await withSpinner(_0x2e412d(0x1f7)+_0x18568c['yamlConfig'][_0x2e412d(0x25c)]+_0x2e412d(0x23a),()=>_0x3b31e6[_0x2e412d(0x218)][_0x2e412d(0x1fc)](_0x1949bc,_0x18568c[_0x2e412d(0x21b)]['id'],_0x2a3af1),{'verbose':_0x4b497a['verbose']}),_0x47fbf9=_0x18568c[_0x2e412d(0x21b)]['id'],console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x25f)](_0x2e412d(0x211)+_0x18568c[_0x2e412d(0x220)]['name']+'\x27')),_0x443bbb++;}else _0x47fbf9=_0x18568c[_0x2e412d(0x21b)]['id'];}for(const _0x4ae3d5 of _0x18568c['activationActions']){if(_0x4ae3d5[_0x2e412d(0x1ef)]===_0x2e412d(0x266)&&_0x4ae3d5[_0x2e412d(0x214)]){const _0x1983bd=yamlActivationToCreateRequest(_0x4ae3d5[_0x2e412d(0x214)],_0x523ae6,_0x352001);await withSpinner(_0x2e412d(0x1f3)+_0x4ae3d5[_0x2e412d(0x25c)]+_0x2e412d(0x23a),()=>_0x3b31e6[_0x2e412d(0x218)][_0x2e412d(0x1ee)](_0x1949bc,_0x47fbf9,_0x1983bd),{'verbose':_0x4b497a[_0x2e412d(0x227)]}),console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x226)](_0x2e412d(0x1ed)+_0x4ae3d5['name']+'\x27')),_0xff7b09++;}else{if(_0x4ae3d5[_0x2e412d(0x1ef)]===_0x2e412d(0x202)&&_0x4ae3d5[_0x2e412d(0x214)]&&_0x4ae3d5[_0x2e412d(0x21d)]){const _0x1345f1=yamlActivationToUpdateRequest(_0x4ae3d5['yamlActivation'],_0x523ae6,_0x352001);await withSpinner(_0x2e412d(0x24a)+_0x4ae3d5[_0x2e412d(0x25c)]+'\x27...',()=>_0x3b31e6[_0x2e412d(0x218)]['updateActivation'](_0x1949bc,_0x47fbf9,_0x4ae3d5['existingActivation']['id'],_0x1345f1),{'verbose':_0x4b497a['verbose']}),console['error'](a34_0x46b2dd[_0x2e412d(0x25f)]('\x20\x20✔\x20Updated\x20activation\x20\x27'+_0x4ae3d5['name']+'\x27')),_0x5b0b25++;}else _0x4ae3d5['type']===_0x2e412d(0x25b)&&_0x4ae3d5[_0x2e412d(0x21d)]&&(await withSpinner(_0x2e412d(0x224)+_0x4ae3d5[_0x2e412d(0x25c)]+_0x2e412d(0x23a),()=>_0x3b31e6[_0x2e412d(0x218)]['deleteActivation'](_0x1949bc,_0x47fbf9,_0x4ae3d5[_0x2e412d(0x21d)]['id']),{'verbose':_0x4b497a[_0x2e412d(0x227)]}),console[_0x2e412d(0x208)](a34_0x46b2dd['red'](_0x2e412d(0x254)+_0x4ae3d5[_0x2e412d(0x25c)]+'\x27')),_0x4c50ef++);}}}for(const _0x37811e of _0x1f80c5){await withSpinner(_0x2e412d(0x246)+_0x37811e[_0x2e412d(0x25c)]+_0x2e412d(0x23a),()=>_0x3b31e6[_0x2e412d(0x218)][_0x2e412d(0x20a)](_0x37811e['id']),{'verbose':_0x4b497a[_0x2e412d(0x227)]}),console[_0x2e412d(0x208)](a34_0x46b2dd['red']('✔\x20Deleted\x20segment\x20\x27'+_0x37811e['name']+'\x27')),_0x24afec++;}const _0x32076e=[];if(_0x27cbf8>0x0)_0x32076e[_0x2e412d(0x21e)](_0x27cbf8+'\x20created');if(_0x443bbb>0x0)_0x32076e[_0x2e412d(0x21e)](_0x443bbb+'\x20updated');if(_0x24afec>0x0)_0x32076e[_0x2e412d(0x21e)](_0x24afec+_0x2e412d(0x245));const _0x34de29=[];if(_0xff7b09>0x0)_0x34de29[_0x2e412d(0x21e)](_0xff7b09+_0x2e412d(0x1fd));if(_0x5b0b25>0x0)_0x34de29[_0x2e412d(0x21e)](_0x5b0b25+_0x2e412d(0x1f2));if(_0x4c50ef>0x0)_0x34de29[_0x2e412d(0x21e)](_0x4c50ef+'\x20deleted');return console[_0x2e412d(0x208)](a34_0x46b2dd[_0x2e412d(0x226)](_0x2e412d(0x215))),_0x32076e[_0x2e412d(0x22e)]>0x0&&console[_0x2e412d(0x208)](_0x2e412d(0x26f)+_0x32076e[_0x2e412d(0x1eb)](',\x20')),_0x34de29[_0x2e412d(0x22e)]>0x0&&console['error'](_0x2e412d(0x1f4)+_0x34de29[_0x2e412d(0x1eb)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x292d95){const _0x2be9a3=a34_0x2515d0,_0x146c8f=new Map(),_0x3514a5=new Map();for(const _0x26963b of _0x292d95){_0x3514a5[_0x2be9a3(0x231)](_0x26963b['id'],_0x26963b);}const _0x131cad=new Set();for(const _0x473715 of _0x292d95){!_0x473715['parentFolderId']&&_0x131cad[_0x2be9a3(0x20e)](_0x473715['id']);}function _0x193f1b(_0x1e37ba){const _0x72e6=_0x2be9a3;if(_0x131cad[_0x72e6(0x207)](_0x1e37ba['id']))return'';if(_0x1e37ba['parentFolderId']){const _0x5286c2=_0x3514a5[_0x72e6(0x201)](_0x1e37ba[_0x72e6(0x270)]);if(_0x5286c2){const _0x2dec45=_0x193f1b(_0x5286c2);return _0x2dec45?_0x2dec45+'/'+_0x1e37ba[_0x72e6(0x25c)]:_0x1e37ba[_0x72e6(0x25c)];}}return _0x1e37ba[_0x72e6(0x25c)];}for(const _0x36c3fd of _0x292d95){const _0x104025=_0x193f1b(_0x36c3fd);_0x146c8f[_0x2be9a3(0x231)](_0x104025,_0x36c3fd['id']);}return _0x146c8f;}function findYamlFiles(_0x2b39b9){const _0x20837c=[];function _0x40e827(_0x39d7c8){const _0x1ec092=a34_0x5a5f,_0x375da5=readdirSync(_0x39d7c8,{'withFileTypes':!![]});for(const _0x24e4fd of _0x375da5){const _0x3b1df0=a34_0x5d5a02[_0x1ec092(0x1eb)](_0x39d7c8,_0x24e4fd[_0x1ec092(0x25c)]);if(_0x24e4fd[_0x1ec092(0x232)]())_0x40e827(_0x3b1df0);else(_0x24e4fd['name'][_0x1ec092(0x247)](_0x1ec092(0x1ec))||_0x24e4fd['name'][_0x1ec092(0x247)](_0x1ec092(0x273)))&&_0x20837c[_0x1ec092(0x21e)](_0x3b1df0);}}return _0x40e827(_0x2b39b9),_0x20837c;}function calculateActivationActions(_0x5f0d6c,_0x4a018b,_0x4c49b7,_0xc7f765){const _0x25698c=a34_0x2515d0,_0x402d14=[],_0x12b35a=new Map();for(const _0x19a809 of _0x4a018b){_0x12b35a['set'](_0x19a809[_0x25698c(0x25c)],_0x19a809);}const _0x4558a4=new Map();for(const _0x54ca16 of _0x5f0d6c){_0x4558a4[_0x25698c(0x231)](_0x54ca16[_0x25698c(0x25c)],_0x54ca16);}for(const _0x4fca69 of _0x5f0d6c){const _0x5c6cf3=_0x12b35a[_0x25698c(0x201)](_0x4fca69[_0x25698c(0x25c)]);if(!_0x5c6cf3)_0x402d14[_0x25698c(0x21e)]({'type':'create','name':_0x4fca69[_0x25698c(0x25c)],'yamlActivation':_0x4fca69});else{const _0x4f3cd3=activationToYaml(_0x5c6cf3,_0x4c49b7,_0xc7f765),_0x2b631f=a34_0x37a678[_0x25698c(0x1f5)](_0x4f3cd3),_0xfe6f8e=a34_0x37a678[_0x25698c(0x1f5)](_0x4fca69);_0x2b631f!==_0xfe6f8e&&_0x402d14[_0x25698c(0x21e)]({'type':_0x25698c(0x202),'name':_0x4fca69[_0x25698c(0x25c)],'yamlActivation':_0x4fca69,'existingActivation':_0x5c6cf3});}}for(const _0x386c1c of _0x4a018b){!_0x4558a4['has'](_0x386c1c[_0x25698c(0x25c)])&&_0x402d14[_0x25698c(0x21e)]({'type':'delete','name':_0x386c1c['name'],'existingActivation':_0x386c1c});}return _0x402d14;}
@@ -1 +1 @@
1
- const a35_0x2e895d=a35_0x4903;(function(_0x3d8be6,_0x3d2ab4){const _0x5adc2f=a35_0x4903,_0x1e2144=_0x3d8be6();while(!![]){try{const _0x8ef8c6=parseInt(_0x5adc2f(0xf4))/0x1+-parseInt(_0x5adc2f(0x10a))/0x2*(-parseInt(_0x5adc2f(0xf6))/0x3)+-parseInt(_0x5adc2f(0x11b))/0x4*(parseInt(_0x5adc2f(0x118))/0x5)+parseInt(_0x5adc2f(0x101))/0x6+-parseInt(_0x5adc2f(0xf3))/0x7+parseInt(_0x5adc2f(0x102))/0x8*(-parseInt(_0x5adc2f(0x107))/0x9)+parseInt(_0x5adc2f(0x11c))/0xa*(-parseInt(_0x5adc2f(0x109))/0xb);if(_0x8ef8c6===_0x3d2ab4)break;else _0x1e2144['push'](_0x1e2144['shift']());}catch(_0x2ecac2){_0x1e2144['push'](_0x1e2144['shift']());}}}(a35_0x5d70,0x34f29));function a35_0x5d70(){const _0x521ea7=['2xLiJuy','segment','Error:\x20Cannot\x20update\x20','Resolving\x20folder\x20\x27','Update\x20existing\x20child\x20segment','Parent\x20ID:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','data','includes','kind','yellow','15yxqxDB','segmentPath','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','154280sWtYCR','50bpTKby','name','\x20\x20\x20Path:\x20','parentId','Examples:','type','✔\x20Updated\x20segment\x20\x27','Updating\x20segment\x20\x27','2294369wRVihP','392729yunijZ','segment:update','846849uwzrcb','error','folder','\x27...','Resolving\x20path\x20\x27','segmentName','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','updateSegmentById','description','resolvePathToResource','Resolved\x20folder\x20ID:\x20','2349774IWaqyn','8ZfiGxe','Segment\x20ID:\x20','segmentId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','INTERNAL','230949HWKGOX','verbose','837386LPgGKS'];a35_0x5d70=function(){return _0x521ea7;};return a35_0x5d70();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a35_0x4903(_0x30159d,_0x1aa30d){_0x30159d=_0x30159d-0xf0;const _0x5d704d=a35_0x5d70();let _0x49031d=_0x5d704d[_0x30159d];return _0x49031d;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a35_0x1856e from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a35_0x2e895d(0x11d)]=a35_0x2e895d(0xf5);[a35_0x2e895d(0xfe)]=a35_0x2e895d(0x10e);async['execute'](_0x241666){const _0x55434c=a35_0x2e895d;console['error'](a35_0x1856e[_0x55434c(0x117)](_0x55434c(0x110))),console[_0x55434c(0xf7)](a35_0x1856e['yellow'](_0x55434c(0x111)));const {options:_0x1074b0,args:_0x104c85,tdx:_0x4c4f9a}=_0x241666,_0x145b3b=_0x1074b0;if(_0x104c85['length']===0x0)return console[_0x55434c(0xf7)](_0x55434c(0x11a)),console[_0x55434c(0xf7)](_0x55434c(0x113)),console[_0x55434c(0xf7)](_0x55434c(0x120)),console[_0x55434c(0xf7)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x55434c(0xf7)](_0x55434c(0x112)),0x1;const _0x4bfa8d=_0x104c85[0x0],_0x50e9e9=_0x1074b0[_0x55434c(0x119)];let _0x3506fa=_0x4bfa8d;_0x50e9e9&&!_0x4bfa8d[_0x55434c(0x115)]('/')&&(_0x3506fa=_0x50e9e9+'/'+_0x4bfa8d,_0x145b3b[_0x55434c(0x108)]&&console[_0x55434c(0xf7)]('Resolved\x20relative\x20path\x20to:\x20'+_0x3506fa));const _0x1a3ec9=await withSpinner(_0x55434c(0xfa)+_0x3506fa+_0x55434c(0xf9),()=>_0x4c4f9a[_0x55434c(0x10b)][_0x55434c(0xff)](_0x3506fa),{'verbose':_0x145b3b['verbose']}),_0x464368=_0x1a3ec9[_0x55434c(0x114)];_0x145b3b['verbose']&&console['error']('Resolved\x20type:\x20'+_0x464368[_0x55434c(0xf0)]);if(_0x464368[_0x55434c(0xf0)]!==_0x55434c(0x10b))return console['error'](_0x55434c(0x10c)+_0x464368[_0x55434c(0xf0)]+_0x55434c(0xfc)),console[_0x55434c(0xf7)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x464368[_0x55434c(0x104)])throw new SDKError(ErrorCode[_0x55434c(0x106)],_0x55434c(0x105));const _0x72d34d=_0x464368[_0x55434c(0x11f)],_0xde60c1=_0x464368[_0x55434c(0x104)];_0x145b3b[_0x55434c(0x108)]&&(console['error'](_0x55434c(0x10f)+_0x72d34d),console[_0x55434c(0xf7)](_0x55434c(0x103)+_0xde60c1));let _0x1b2344;if(_0x145b3b[_0x55434c(0xf8)]){const _0x2aedcf=_0x145b3b[_0x55434c(0xf8)],_0x3e8c78=await withSpinner(_0x55434c(0x10d)+_0x2aedcf+_0x55434c(0xf9),()=>_0x4c4f9a[_0x55434c(0x10b)]['resolveFolderId'](_0x72d34d,_0x2aedcf),{'verbose':_0x145b3b[_0x55434c(0x108)]});_0x1b2344=parseInt(_0x3e8c78[_0x55434c(0x114)],0xa),_0x145b3b[_0x55434c(0x108)]&&console[_0x55434c(0xf7)](_0x55434c(0x100)+_0x1b2344);}const _0x4e5e76=await loadJSONFromOptions(_0x145b3b['rule'],_0x145b3b['ruleFile']),_0x5a08e6={'name':_0x145b3b['name'],'description':_0x145b3b[_0x55434c(0xfe)],'rule':_0x4e5e76,'kind':_0x145b3b[_0x55434c(0x116)]!==undefined?parseInt(_0x145b3b[_0x55434c(0x116)],0xa):undefined,'segmentFolderId':_0x1b2344},_0x2b45ed=await withSpinner(_0x55434c(0xf2)+_0x464368[_0x55434c(0xfb)]+_0x55434c(0xf9),()=>_0x4c4f9a[_0x55434c(0x10b)][_0x55434c(0xfd)](_0x72d34d,_0xde60c1,_0x5a08e6),{'verbose':_0x145b3b['verbose']}),_0x4d8c66=_0x2b45ed[_0x55434c(0x114)];return console['error'](_0x55434c(0xf1)+_0x4d8c66[_0x55434c(0x11d)]+'\x27'),_0x3506fa!==_0x4bfa8d&&console[_0x55434c(0xf7)](_0x55434c(0x11e)+_0x3506fa),await handleSDKOutput([_0x4d8c66],_0x145b3b),0x0;}}
1
+ const a35_0x2fdc21=a35_0x2c6c;(function(_0x4c44cc,_0x454d85){const _0x421a2f=a35_0x2c6c,_0x404633=_0x4c44cc();while(!![]){try{const _0x23c949=parseInt(_0x421a2f(0x1c7))/0x1*(-parseInt(_0x421a2f(0x1a0))/0x2)+parseInt(_0x421a2f(0x1c9))/0x3+parseInt(_0x421a2f(0x1c8))/0x4+-parseInt(_0x421a2f(0x1c5))/0x5+parseInt(_0x421a2f(0x1b4))/0x6*(-parseInt(_0x421a2f(0x1ad))/0x7)+-parseInt(_0x421a2f(0x1be))/0x8*(-parseInt(_0x421a2f(0x1a4))/0x9)+parseInt(_0x421a2f(0x199))/0xa*(-parseInt(_0x421a2f(0x1a2))/0xb);if(_0x23c949===_0x454d85)break;else _0x404633['push'](_0x404633['shift']());}catch(_0x3c1d20){_0x404633['push'](_0x404633['shift']());}}}(a35_0x2b40,0x3515e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a35_0x2c6c(_0x54f056,_0x56d10b){_0x54f056=_0x54f056-0x199;const _0x2b4024=a35_0x2b40();let _0x2c6ceb=_0x2b4024[_0x54f056];return _0x2c6ceb;}function a35_0x2b40(){const _0x23e758=['\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Error:\x20Cannot\x20update\x20','Examples:','segmentPath','570adCkXn','yellow','Resolving\x20folder\x20\x27','description','segmentId','Resolved\x20folder\x20ID:\x20','type','name','Updating\x20segment\x20\x27','Segment\x20ID:\x20','931016RbrQXd','length','parentId','Resolved\x20type:\x20','updateSegmentById','includes','error','311465iqCAii','verbose','473Ukjyjb','669368moPAKZ','1141956LUdMJV','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','data','30IXUAkh','segment','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','resolveFolderId','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','\x27...','154mlQkPb','✔\x20Updated\x20segment\x20\x27','591987eETcUt','INTERNAL','18svxcZE','kind','folder','Update\x20existing\x20child\x20segment','\x20\x20\x20Path:\x20','segmentName','segment:update','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20path\x20\x27','22337LjQwjC','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolvePathToResource'];a35_0x2b40=function(){return _0x23e758;};return a35_0x2b40();}import a35_0x3add9c from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a35_0x2fdc21(0x1aa);['description']=a35_0x2fdc21(0x1a7);async['execute'](_0x3c3227){const _0xa93c37=a35_0x2fdc21;console['error'](a35_0x3add9c[_0xa93c37(0x1b5)](_0xa93c37(0x19e))),console[_0xa93c37(0x1c4)](a35_0x3add9c[_0xa93c37(0x1b5)](_0xa93c37(0x1b0)));const {options:_0x5d9726,args:_0x207767,tdx:_0x13060c}=_0x3c3227,_0x3ec707=_0x5d9726;if(_0x207767[_0xa93c37(0x1bf)]===0x0)return console['error'](_0xa93c37(0x1ae)),console[_0xa93c37(0x1c4)](_0xa93c37(0x19b)),console['error'](_0xa93c37(0x1b2)),console[_0xa93c37(0x1c4)](_0xa93c37(0x1ca)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x556a19=_0x207767[0x0],_0x122a32=_0x5d9726[_0xa93c37(0x1b3)];let _0x3452d5=_0x556a19;_0x122a32&&!_0x556a19[_0xa93c37(0x1c3)]('/')&&(_0x3452d5=_0x122a32+'/'+_0x556a19,_0x3ec707[_0xa93c37(0x1c6)]&&console[_0xa93c37(0x1c4)]('Resolved\x20relative\x20path\x20to:\x20'+_0x3452d5));const _0x3f074b=await withSpinner(_0xa93c37(0x1ac)+_0x3452d5+_0xa93c37(0x19f),()=>_0x13060c[_0xa93c37(0x19a)][_0xa93c37(0x1af)](_0x3452d5),{'verbose':_0x3ec707[_0xa93c37(0x1c6)]}),_0x643722=_0x3f074b[_0xa93c37(0x1cb)];_0x3ec707[_0xa93c37(0x1c6)]&&console['error'](_0xa93c37(0x1c1)+_0x643722[_0xa93c37(0x1ba)]);if(_0x643722[_0xa93c37(0x1ba)]!==_0xa93c37(0x19a))return console[_0xa93c37(0x1c4)](_0xa93c37(0x1b1)+_0x643722[_0xa93c37(0x1ba)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x643722[_0xa93c37(0x1b8)])throw new SDKError(ErrorCode[_0xa93c37(0x1a3)],_0xa93c37(0x1ab));const _0x1d46ca=_0x643722[_0xa93c37(0x1c0)],_0x5dcf86=_0x643722[_0xa93c37(0x1b8)];_0x3ec707[_0xa93c37(0x1c6)]&&(console[_0xa93c37(0x1c4)]('Parent\x20ID:\x20'+_0x1d46ca),console[_0xa93c37(0x1c4)](_0xa93c37(0x1bd)+_0x5dcf86));let _0x26e2b1;if(_0x3ec707[_0xa93c37(0x1a6)]){const _0x2ac7fc=_0x3ec707[_0xa93c37(0x1a6)],_0x511365=await withSpinner(_0xa93c37(0x1b6)+_0x2ac7fc+_0xa93c37(0x19f),()=>_0x13060c[_0xa93c37(0x19a)][_0xa93c37(0x19c)](_0x1d46ca,_0x2ac7fc),{'verbose':_0x3ec707['verbose']});_0x26e2b1=parseInt(_0x511365[_0xa93c37(0x1cb)],0xa),_0x3ec707[_0xa93c37(0x1c6)]&&console[_0xa93c37(0x1c4)](_0xa93c37(0x1b9)+_0x26e2b1);}const _0x2d1cc9=await loadJSONFromOptions(_0x3ec707[_0xa93c37(0x19d)],_0x3ec707['ruleFile']),_0xeedf3f={'name':_0x3ec707[_0xa93c37(0x1bb)],'description':_0x3ec707[_0xa93c37(0x1b7)],'rule':_0x2d1cc9,'kind':_0x3ec707[_0xa93c37(0x1a5)]!==undefined?parseInt(_0x3ec707[_0xa93c37(0x1a5)],0xa):undefined,'segmentFolderId':_0x26e2b1},_0x3c6b05=await withSpinner(_0xa93c37(0x1bc)+_0x643722[_0xa93c37(0x1a9)]+'\x27...',()=>_0x13060c['segment'][_0xa93c37(0x1c2)](_0x1d46ca,_0x5dcf86,_0xeedf3f),{'verbose':_0x3ec707[_0xa93c37(0x1c6)]}),_0x574786=_0x3c6b05[_0xa93c37(0x1cb)];return console[_0xa93c37(0x1c4)](_0xa93c37(0x1a1)+_0x574786['name']+'\x27'),_0x3452d5!==_0x556a19&&console[_0xa93c37(0x1c4)](_0xa93c37(0x1a8)+_0x3452d5),await handleSDKOutput([_0x574786],_0x3ec707),0x0;}}
@@ -1 +1 @@
1
- const a36_0x97076a=a36_0x5b8f;(function(_0x36cd6f,_0x304a55){const _0x3b3e1f=a36_0x5b8f,_0x5c0f52=_0x36cd6f();while(!![]){try{const _0xe25188=-parseInt(_0x3b3e1f(0x1c1))/0x1*(parseInt(_0x3b3e1f(0x1ca))/0x2)+parseInt(_0x3b3e1f(0x1c7))/0x3*(-parseInt(_0x3b3e1f(0x1b8))/0x4)+parseInt(_0x3b3e1f(0x1b2))/0x5*(parseInt(_0x3b3e1f(0x19e))/0x6)+-parseInt(_0x3b3e1f(0x19d))/0x7*(-parseInt(_0x3b3e1f(0x196))/0x8)+parseInt(_0x3b3e1f(0x1c2))/0x9+parseInt(_0x3b3e1f(0x1bd))/0xa+-parseInt(_0x3b3e1f(0x1b0))/0xb*(parseInt(_0x3b3e1f(0x1bb))/0xc);if(_0xe25188===_0x304a55)break;else _0x5c0f52['push'](_0x5c0f52['shift']());}catch(_0x3b5d1c){_0x5c0f52['push'](_0x5c0f52['shift']());}}}(a36_0x1f65,0x6878c));import{existsSync,statSync}from'fs';import a36_0x3477bd from'chalk';import{BaseCommand}from'./command.js';function a36_0x5b8f(_0xbeb32d,_0x252334){_0xbeb32d=_0xbeb32d-0x191;const _0x1f6530=a36_0x1f65();let _0x5b8f4c=_0x1f6530[_0xbeb32d];return _0x5b8f4c;}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../utils/segment-path-parser.js';function a36_0x1f65(){const _0x1878d2=['folderPath','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Resolving\x20path\x20\x27','1798448TgQZDE','type','folderId','parentName','verbose','Examples:','segment:use','21eHYnrh','4353690nGZSeq','parentId','red','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','cyan','segmentPath','split','Target\x20path:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','site','error','\x27...','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','dim','description','Error:\x20Path\x20is\x20required\x0a','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','66hTpAdi','✔\x20Context\x20set\x20to:\x20','5UAyAUe','segment','resolvePathToResource','fullPath','slice','parent_segment','366832JexPcw','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','session','3960228wqLqPG','log','6697850EVieyB','Use:\x20tdx\x20segment\x20use\x20','isDirectory','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','97GIEXmk','5339799OqQExv','data','isAbsolute','green','join','6ykMBdy','Site:\x20','segments','1478SHcYyA','Resolved\x20relative\x20path\x20to:\x20','execute','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','length','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'];a36_0x1f65=function(){return _0x1878d2;};return a36_0x1f65();}import{findTdxConfig}from'../utils/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a36_0x97076a(0x19c);[a36_0x97076a(0x1ad)]=a36_0x97076a(0x1af);async[a36_0x97076a(0x1cc)](_0x136235){const _0x2e4eb0=a36_0x97076a,{options:_0x1d3e71,args:_0x9eb6e8,tdx:_0x58df07}=_0x136235;if(_0x9eb6e8[_0x2e4eb0(0x191)]===0x0)return console[_0x2e4eb0(0x1a8)](a36_0x3477bd[_0x2e4eb0(0x1a0)](_0x2e4eb0(0x1ae))),console[_0x2e4eb0(0x1a8)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x2e4eb0(0x1a8)](_0x2e4eb0(0x19b)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error'](_0x2e4eb0(0x1aa)),console['error'](_0x2e4eb0(0x1ce)),console['error'](_0x2e4eb0(0x1ab)),0x1;const _0x46de0d=_0x9eb6e8[0x0],_0x43809e=_0x1d3e71[_0x2e4eb0(0x1ba)];try{if(_0x46de0d==='/')return saveSessionContext({'segment_path':undefined},_0x43809e),console[_0x2e4eb0(0x1bc)](a36_0x3477bd[_0x2e4eb0(0x1c5)](_0x2e4eb0(0x1a1))),0x0;if(existsSync(_0x46de0d)&&statSync(_0x46de0d)[_0x2e4eb0(0x1bf)]()){let _0x4e5a48;try{_0x4e5a48=findTdxConfig(_0x46de0d);}catch{return console[_0x2e4eb0(0x1a8)](a36_0x3477bd[_0x2e4eb0(0x1a0)](_0x2e4eb0(0x1cd)+_0x46de0d)),console[_0x2e4eb0(0x1a8)](a36_0x3477bd[_0x2e4eb0(0x1a2)](_0x2e4eb0(0x1c0))),0x1;}const _0x3e51a1=_0x4e5a48['config'][_0x2e4eb0(0x1b7)];return saveSessionContext({'segment_path':_0x3e51a1,'parent_segment':_0x3e51a1},_0x43809e),console[_0x2e4eb0(0x1bc)](a36_0x3477bd[_0x2e4eb0(0x1c5)]('✔\x20Context\x20set\x20to:\x20'+a36_0x3477bd[_0x2e4eb0(0x1a2)](_0x3e51a1))),0x0;}const _0x90b1a0=_0x1d3e71[_0x2e4eb0(0x1a3)];let _0x530e74=_0x46de0d;const _0x327f15=parsePath(_0x46de0d);if(!_0x327f15[_0x2e4eb0(0x1c4)]){if(!_0x90b1a0)return console['error'](a36_0x3477bd[_0x2e4eb0(0x1a0)](_0x2e4eb0(0x1a6))),console[_0x2e4eb0(0x1a8)](a36_0x3477bd[_0x2e4eb0(0x1a2)](_0x2e4eb0(0x192))),0x1;if(_0x46de0d==='..'){const _0x2ac9ee=_0x90b1a0[_0x2e4eb0(0x1a4)]('/')[_0x2e4eb0(0x1b6)](0x0,-0x1)[_0x2e4eb0(0x1c6)]('/');_0x530e74=_0x2ac9ee||'/';}else _0x46de0d==='.'?_0x530e74=_0x90b1a0:_0x530e74=_0x90b1a0+'/'+_0x46de0d;_0x1d3e71[_0x2e4eb0(0x19a)]&&console[_0x2e4eb0(0x1a8)](_0x2e4eb0(0x1cb)+_0x530e74);}if(_0x530e74==='/'||_0x530e74==='')return saveSessionContext({'segment_path':undefined},_0x43809e),console['log'](a36_0x3477bd[_0x2e4eb0(0x1c5)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x530e74=normalizePath(_0x530e74);const _0x420178=parsePath(_0x530e74)[_0x2e4eb0(0x1c9)];if(_0x420178[_0x2e4eb0(0x191)]===0x0)return saveSessionContext({'segment_path':undefined},_0x43809e),console[_0x2e4eb0(0x1bc)](a36_0x3477bd[_0x2e4eb0(0x1c5)](_0x2e4eb0(0x1a1))),0x0;_0x1d3e71[_0x2e4eb0(0x19a)]&&(console[_0x2e4eb0(0x1a8)](_0x2e4eb0(0x1c8)+_0x1d3e71[_0x2e4eb0(0x1a7)]),console[_0x2e4eb0(0x1a8)](_0x2e4eb0(0x1a5)+_0x530e74));const _0x45fea7=await withSpinner(_0x2e4eb0(0x195)+_0x530e74+_0x2e4eb0(0x1a9),()=>_0x58df07['segment'][_0x2e4eb0(0x1b4)](_0x530e74),{'verbose':_0x1d3e71[_0x2e4eb0(0x19a)]}),_0x4db301=_0x45fea7[_0x2e4eb0(0x1c3)];_0x1d3e71[_0x2e4eb0(0x19a)]&&(console[_0x2e4eb0(0x1a8)]('Resolved\x20path\x20type:\x20'+_0x4db301[_0x2e4eb0(0x197)]),console['error']('Parent\x20ID:\x20'+_0x4db301[_0x2e4eb0(0x19f)]),_0x4db301[_0x2e4eb0(0x198)]&&console[_0x2e4eb0(0x1a8)]('Folder\x20ID:\x20'+_0x4db301[_0x2e4eb0(0x198)]));if(_0x4db301['type']===_0x2e4eb0(0x1b3))return console[_0x2e4eb0(0x1a8)](a36_0x3477bd[_0x2e4eb0(0x1a0)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x2e4eb0(0x1a8)](_0x2e4eb0(0x194)),console['error'](a36_0x3477bd[_0x2e4eb0(0x1a2)](_0x2e4eb0(0x1be)+_0x4db301[_0x2e4eb0(0x199)]+(_0x4db301[_0x2e4eb0(0x193)]?'/'+_0x4db301['folderPath']['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x4db301[_0x2e4eb0(0x1b5)],'parent_segment':_0x4db301[_0x2e4eb0(0x199)]},_0x43809e),console[_0x2e4eb0(0x1bc)](a36_0x3477bd[_0x2e4eb0(0x1c5)](_0x2e4eb0(0x1b1)+a36_0x3477bd['cyan'](_0x4db301['fullPath']))),_0x1d3e71['verbose']&&(console['error'](a36_0x3477bd[_0x2e4eb0(0x1ac)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x2e4eb0(0x1a8)](a36_0x3477bd[_0x2e4eb0(0x1ac)](_0x2e4eb0(0x1b9)))),0x0;}catch(_0x33d4b3){throw _0x33d4b3;}}}
1
+ const a36_0x4531a9=a36_0x16ce;(function(_0x262784,_0x19c988){const _0x3267d9=a36_0x16ce,_0x37c228=_0x262784();while(!![]){try{const _0x2d5b1f=-parseInt(_0x3267d9(0x161))/0x1+-parseInt(_0x3267d9(0x15e))/0x2*(-parseInt(_0x3267d9(0x172))/0x3)+-parseInt(_0x3267d9(0x174))/0x4+-parseInt(_0x3267d9(0x181))/0x5*(parseInt(_0x3267d9(0x159))/0x6)+-parseInt(_0x3267d9(0x16a))/0x7+-parseInt(_0x3267d9(0x170))/0x8*(-parseInt(_0x3267d9(0x163))/0x9)+parseInt(_0x3267d9(0x151))/0xa*(parseInt(_0x3267d9(0x167))/0xb);if(_0x2d5b1f===_0x19c988)break;else _0x37c228['push'](_0x37c228['shift']());}catch(_0x49e102){_0x37c228['push'](_0x37c228['shift']());}}}(a36_0x1fee,0x33880));import{existsSync,statSync}from'fs';import a36_0x1f79b5 from'chalk';function a36_0x16ce(_0x36d0a2,_0x199f8a){_0x36d0a2=_0x36d0a2-0x150;const _0x1fee3e=a36_0x1fee();let _0x16ceef=_0x1fee3e[_0x36d0a2];return _0x16ceef;}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';import{findTdxConfig}from'../utils/tdx-config.js';function a36_0x1fee(){const _0x49983d=['dim','24VOJBaN','Error:\x20Path\x20is\x20required\x0a','6gKPDKE','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','4752oVTAJK','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters','slice','Target\x20path:\x20','✔\x20Context\x20set\x20to:\x20','\x27...','parentId','data','parent_segment','fullPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','58065fgrGUu','segment:use','cyan','folderPath','verbose','isDirectory','Site:\x20','Resolved\x20path\x20type:\x20','length','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','red','440SncsIh','split','resolvePathToResource','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','segment','parentName','Parent\x20ID:\x20','config','30pqEwMX','name','green','type','error','311208tTKYFz','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segments','370050AyvAtS','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','3366MXqBtK','Usage:\x20tdx\x20segment\x20use\x20<path>','log','folderId','154770yYLMlP','Use:\x20tdx\x20segment\x20use\x20','site','2037245XqiXKC','Resolved\x20relative\x20path\x20to:\x20','join','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'];a36_0x1fee=function(){return _0x49983d;};return a36_0x1fee();}export class SegmentUseCommand extends BaseCommand{[a36_0x4531a9(0x15a)]=a36_0x4531a9(0x182);['description']=a36_0x4531a9(0x154);async['execute'](_0x1c473e){const _0x478191=a36_0x4531a9,{options:_0x582ac2,args:_0x87b3e4,tdx:_0x55d2c3}=_0x1c473e;if(_0x87b3e4[_0x478191(0x189)]===0x0)return console[_0x478191(0x15d)](a36_0x1f79b5[_0x478191(0x150)](_0x478191(0x171))),console[_0x478191(0x15d)](_0x478191(0x164)),console[_0x478191(0x15d)]('Examples:'),console[_0x478191(0x15d)](_0x478191(0x16e)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error'](_0x478191(0x180)),console[_0x478191(0x15d)](_0x478191(0x175)),0x1;const _0x4d445b=_0x87b3e4[0x0],_0xc2548b=_0x582ac2['session'];try{if(_0x4d445b==='/')return saveSessionContext({'segment_path':undefined},_0xc2548b),console['log'](a36_0x1f79b5[_0x478191(0x15b)](_0x478191(0x17f))),0x0;if(existsSync(_0x4d445b)&&statSync(_0x4d445b)[_0x478191(0x186)]()){let _0x1a98a6;try{_0x1a98a6=findTdxConfig(_0x4d445b);}catch{return console[_0x478191(0x15d)](a36_0x1f79b5[_0x478191(0x150)](_0x478191(0x162)+_0x4d445b)),console['error'](a36_0x1f79b5[_0x478191(0x183)](_0x478191(0x173))),0x1;}const _0x379a08=_0x1a98a6[_0x478191(0x158)][_0x478191(0x17d)];return saveSessionContext({'segment_path':_0x379a08,'parent_segment':_0x379a08},_0xc2548b),console[_0x478191(0x165)](a36_0x1f79b5[_0x478191(0x15b)](_0x478191(0x179)+a36_0x1f79b5['cyan'](_0x379a08))),0x0;}const _0x4b80c1=_0x582ac2['segmentPath'];let _0x39c35f=_0x4d445b;const _0x47825b=parsePath(_0x4d445b);if(!_0x47825b['isAbsolute']){if(!_0x4b80c1)return console['error'](a36_0x1f79b5[_0x478191(0x150)](_0x478191(0x16d))),console[_0x478191(0x15d)](a36_0x1f79b5[_0x478191(0x183)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x4d445b==='..'){const _0x13fef9=_0x4b80c1[_0x478191(0x152)]('/')[_0x478191(0x177)](0x0,-0x1)[_0x478191(0x16c)]('/');_0x39c35f=_0x13fef9||'/';}else _0x4d445b==='.'?_0x39c35f=_0x4b80c1:_0x39c35f=_0x4b80c1+'/'+_0x4d445b;_0x582ac2[_0x478191(0x185)]&&console['error'](_0x478191(0x16b)+_0x39c35f);}if(_0x39c35f==='/'||_0x39c35f==='')return saveSessionContext({'segment_path':undefined},_0xc2548b),console[_0x478191(0x165)](a36_0x1f79b5[_0x478191(0x15b)](_0x478191(0x17f))),0x0;_0x39c35f=normalizePath(_0x39c35f);const _0x44d0b3=parsePath(_0x39c35f)[_0x478191(0x160)];if(_0x44d0b3[_0x478191(0x189)]===0x0)return saveSessionContext({'segment_path':undefined},_0xc2548b),console['log'](a36_0x1f79b5[_0x478191(0x15b)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x582ac2[_0x478191(0x185)]&&(console[_0x478191(0x15d)](_0x478191(0x187)+_0x582ac2[_0x478191(0x169)]),console['error'](_0x478191(0x178)+_0x39c35f));const _0x35c22e=await withSpinner('Resolving\x20path\x20\x27'+_0x39c35f+_0x478191(0x17a),()=>_0x55d2c3[_0x478191(0x155)][_0x478191(0x153)](_0x39c35f),{'verbose':_0x582ac2[_0x478191(0x185)]}),_0x556b8c=_0x35c22e[_0x478191(0x17c)];_0x582ac2[_0x478191(0x185)]&&(console[_0x478191(0x15d)](_0x478191(0x188)+_0x556b8c['type']),console['error'](_0x478191(0x157)+_0x556b8c[_0x478191(0x17b)]),_0x556b8c[_0x478191(0x166)]&&console[_0x478191(0x15d)]('Folder\x20ID:\x20'+_0x556b8c[_0x478191(0x166)]));if(_0x556b8c[_0x478191(0x15c)]===_0x478191(0x155))return console[_0x478191(0x15d)](a36_0x1f79b5[_0x478191(0x150)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error'](_0x478191(0x15f)),console[_0x478191(0x15d)](a36_0x1f79b5['cyan'](_0x478191(0x168)+_0x556b8c[_0x478191(0x156)]+(_0x556b8c[_0x478191(0x184)]?'/'+_0x556b8c[_0x478191(0x184)][_0x478191(0x16c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x556b8c[_0x478191(0x17e)],'parent_segment':_0x556b8c[_0x478191(0x156)]},_0xc2548b),console['log'](a36_0x1f79b5[_0x478191(0x15b)](_0x478191(0x179)+a36_0x1f79b5['cyan'](_0x556b8c['fullPath']))),_0x582ac2[_0x478191(0x185)]&&(console[_0x478191(0x15d)](a36_0x1f79b5[_0x478191(0x16f)](_0x478191(0x18a))),console[_0x478191(0x15d)](a36_0x1f79b5[_0x478191(0x16f)](_0x478191(0x176)))),0x0;}catch(_0x4b4611){throw _0x4b4611;}}}
@@ -1 +1 @@
1
- const a37_0x56b3e8=a37_0x28f5;(function(_0x3d43ed,_0x2cc1c3){const _0x5a58b8=a37_0x28f5,_0x288327=_0x3d43ed();while(!![]){try{const _0x595b7b=parseInt(_0x5a58b8(0x125))/0x1*(-parseInt(_0x5a58b8(0x138))/0x2)+-parseInt(_0x5a58b8(0x11a))/0x3*(-parseInt(_0x5a58b8(0x127))/0x4)+parseInt(_0x5a58b8(0x12d))/0x5*(-parseInt(_0x5a58b8(0x13f))/0x6)+-parseInt(_0x5a58b8(0x151))/0x7*(-parseInt(_0x5a58b8(0x110))/0x8)+-parseInt(_0x5a58b8(0x136))/0x9+parseInt(_0x5a58b8(0x13b))/0xa+parseInt(_0x5a58b8(0x13c))/0xb;if(_0x595b7b===_0x2cc1c3)break;else _0x288327['push'](_0x288327['shift']());}catch(_0x3257f8){_0x288327['push'](_0x288327['shift']());}}}(a37_0xb4e3,0x81baf));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 a37_0xb4e3(){const _0x1e2bcc=['map','Error:\x20','log','Folder/pattern\x20arg:\x20','235285dVeujT','Resolving\x20path\x20\x27','resolvePathToResource','Recursive\x20mode:\x20enabled','dim','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Listing\x20folders\x20and\x20segments...','Resolving\x20parent\x20segment\x20\x27','Error:\x20No\x20parent\x20segment\x20context\x20set.','4332600mMxWaQ','Folder\x20ID:\x20','2OTAxLE','segment','(empty)','4101230WsFjVQ','5799662wwBWsv','format','filter','18SHZGRI','\x20segment','✔\x20Built\x20tree\x20with\x20','\x20and\x20','\x27...','test','json','\x20matching\x20\x27','Parent\x20segment\x20context:\x20','folderId','includes','No\x20items\x20match\x20pattern:\x20','parentSegment','segments','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','(not\x20set)','verbose','name','582253OtFfaO','length','description','56KcnZiv','listWithPattern','\x20top-level\x20items','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Set\x20a\x20parent\x20segment\x20context\x20first:','listUnified','replace','jsonl','\x5c$&',']\x20matching\x20\x27','51TFwslf','parentId','\x20folder','execute','folder','Parent\x20ID:\x20','maxDepth','sort','data','error','cause','766855mpacvJ','\x20\x20Cause:\x20','94396hQckEq','✔\x20Found\x20'];a37_0xb4e3=function(){return _0x1e2bcc;};return a37_0xb4e3();}import a37_0xfb1f4d from'chalk';function a37_0x28f5(_0x1c750d,_0x22fecc){_0x1c750d=_0x1c750d-0x10e;const _0xb4e3a2=a37_0xb4e3();let _0x28f5bd=_0xb4e3a2[_0x1c750d];return _0x28f5bd;}export class SegmentsCommand extends BaseCommand{[a37_0x56b3e8(0x150)]=a37_0x56b3e8(0x14c);[a37_0x56b3e8(0x10f)]='List\x20folders\x20and\x20child\x20segments';async[a37_0x56b3e8(0x11d)](_0x2eab4a){const _0x105911=a37_0x56b3e8,{options:_0x2ff47b,args:_0x39482c}=_0x2eab4a,_0xedba27=_0x2ff47b['recursive'],_0x5b35c6=_0x39482c[0x0];try{const _0x1ed55d=_0x2ff47b[_0x105911(0x14b)];_0x2ff47b[_0x105911(0x14f)]&&(console['error']('Site:\x20'+_0x2ff47b['site']),console[_0x105911(0x123)](_0x105911(0x147)+(_0x1ed55d||_0x105911(0x14e))),_0x5b35c6&&console[_0x105911(0x123)](_0x105911(0x12c)+_0x5b35c6),_0xedba27&&console[_0x105911(0x123)](_0x105911(0x130)));if(!_0x1ed55d)return console[_0x105911(0x123)](_0x105911(0x135)),console[_0x105911(0x123)](''),console[_0x105911(0x123)](_0x105911(0x114)),console[_0x105911(0x123)](_0x105911(0x113)),console['error'](_0x105911(0x14d)),console[_0x105911(0x123)](''),console[_0x105911(0x123)](_0x105911(0x132)),0x1;const _0xc8a8f1=_0x5b35c6&&(_0x5b35c6['includes']('*')||_0x5b35c6[_0x105911(0x149)]('?'));if(_0xc8a8f1)return await this['listWithPattern'](_0x2eab4a,_0x1ed55d,_0x5b35c6);const _0x1f26ed=_0x5b35c6?_0x1ed55d+'/'+_0x5b35c6:_0x1ed55d;return _0xedba27?await this['listRecursive'](_0x2eab4a,_0x1f26ed):await this[_0x105911(0x115)](_0x2eab4a,_0x1f26ed);}catch(_0x51b8a2){if(_0x51b8a2 instanceof SDKError)return console[_0x105911(0x123)](_0x105911(0x12a)+_0x51b8a2['message']),_0x51b8a2['cause']&&console[_0x105911(0x123)](_0x105911(0x126)+_0x51b8a2[_0x105911(0x124)]),0x1;throw _0x51b8a2;}}async[a37_0x56b3e8(0x111)](_0x5bbeaa,_0x340853,_0x75f4bf){const _0x4f1b72=a37_0x56b3e8,{options:_0x33468b,tdx:_0x5e51bf}=_0x5bbeaa,_0x47b60a=await withSpinner(_0x4f1b72(0x134)+_0x340853+_0x4f1b72(0x143),()=>_0x5e51bf[_0x4f1b72(0x139)][_0x4f1b72(0x12f)](_0x340853),{'verbose':_0x33468b[_0x4f1b72(0x14f)]}),_0x4780b2=_0x47b60a['data'],_0x3f4b14=await withSpinner(_0x4f1b72(0x133),()=>_0x5e51bf[_0x4f1b72(0x139)][_0x4f1b72(0x115)](_0x4780b2['parentId'],_0x4780b2[_0x4f1b72(0x148)]),{'verbose':_0x33468b[_0x4f1b72(0x14f)]}),{folders:_0x20432f,segments:_0x126943}=_0x3f4b14['data'],_0x549fd8=_0x75f4bf[_0x4f1b72(0x116)](/[.+^${}()|[\]\\]/g,_0x4f1b72(0x118))[_0x4f1b72(0x116)](/\*/g,'.*')[_0x4f1b72(0x116)](/\?/g,'.'),_0x428523=new RegExp('^'+_0x549fd8+'$','i'),_0x3da1e7=_0x20432f[_0x4f1b72(0x13e)](_0x248f2d=>_0x428523[_0x4f1b72(0x144)](_0x248f2d[_0x4f1b72(0x150)])),_0x111a10=_0x126943[_0x4f1b72(0x13e)](_0x5656a9=>_0x428523[_0x4f1b72(0x144)](_0x5656a9[_0x4f1b72(0x150)])),_0x239711=_0x3da1e7[_0x4f1b72(0x10e)]+_0x111a10[_0x4f1b72(0x10e)];console[_0x4f1b72(0x123)](_0x4f1b72(0x128)+_0x3da1e7[_0x4f1b72(0x10e)]+'\x20folder'+(_0x3da1e7[_0x4f1b72(0x10e)]!==0x1?'s':'')+_0x4f1b72(0x142)+_0x111a10['length']+_0x4f1b72(0x140)+(_0x111a10[_0x4f1b72(0x10e)]!==0x1?'s':'')+_0x4f1b72(0x146)+_0x75f4bf+'\x27');if(_0x33468b[_0x4f1b72(0x13d)]===_0x4f1b72(0x145)||_0x33468b[_0x4f1b72(0x13d)]==='jsonl'){const _0x163031=[..._0x3da1e7['map'](_0x3125e1=>({..._0x3125e1,'type':_0x4f1b72(0x11e)})),..._0x111a10[_0x4f1b72(0x129)](_0x2297cf=>({..._0x2297cf,'type':_0x4f1b72(0x139)}))][_0x4f1b72(0x121)]((_0x5f0f3b,_0x60a4f7)=>_0x5f0f3b[_0x4f1b72(0x150)]['localeCompare'](_0x60a4f7[_0x4f1b72(0x150)]));await handleSDKOutput(_0x163031,_0x33468b);}else{if(_0x239711===0x0)console[_0x4f1b72(0x12b)](_0x4f1b72(0x14a)+_0x75f4bf);else{console['log'](a37_0xfb1f4d['dim']('['+_0x340853+_0x4f1b72(0x119)+_0x75f4bf+'\x27'));const _0x306d59=formatFlatList(_0x3da1e7,_0x111a10,{'showMetadata':!![]});console[_0x4f1b72(0x12b)](_0x306d59);}}return 0x0;}async[a37_0x56b3e8(0x115)](_0x1d54c0,_0x6cac2c){const _0x1f419c=a37_0x56b3e8,{options:_0x4e9a7b,tdx:_0x5395e4}=_0x1d54c0,_0x2ffb26=await withSpinner(_0x1f419c(0x12e)+_0x6cac2c+_0x1f419c(0x143),()=>_0x5395e4[_0x1f419c(0x139)][_0x1f419c(0x12f)](_0x6cac2c),{'verbose':_0x4e9a7b[_0x1f419c(0x14f)]}),_0x1a3193=_0x2ffb26[_0x1f419c(0x122)];_0x4e9a7b[_0x1f419c(0x14f)]&&(console[_0x1f419c(0x123)](_0x1f419c(0x11f)+_0x1a3193[_0x1f419c(0x11b)]),_0x1a3193[_0x1f419c(0x148)]&&console[_0x1f419c(0x123)](_0x1f419c(0x137)+_0x1a3193[_0x1f419c(0x148)]));const _0x2bb8d8=await withSpinner(_0x1f419c(0x133),()=>_0x5395e4[_0x1f419c(0x139)][_0x1f419c(0x115)](_0x1a3193[_0x1f419c(0x11b)],_0x1a3193['folderId']),{'verbose':_0x4e9a7b[_0x1f419c(0x14f)]}),{folders:_0x385c22,segments:_0x5b3bda}=_0x2bb8d8[_0x1f419c(0x122)],_0x4afb0e=_0x385c22[_0x1f419c(0x10e)]+_0x5b3bda[_0x1f419c(0x10e)];console['error']('✔\x20Found\x20'+_0x385c22['length']+_0x1f419c(0x11c)+(_0x385c22[_0x1f419c(0x10e)]!==0x1?'s':'')+_0x1f419c(0x142)+_0x5b3bda[_0x1f419c(0x10e)]+_0x1f419c(0x140)+(_0x5b3bda['length']!==0x1?'s':''));if(_0x4e9a7b[_0x1f419c(0x13d)]===_0x1f419c(0x145)||_0x4e9a7b[_0x1f419c(0x13d)]===_0x1f419c(0x117)){const _0x1d33f6=[..._0x385c22[_0x1f419c(0x129)](_0x3ca3a7=>({..._0x3ca3a7,'type':'folder'})),..._0x5b3bda['map'](_0x1317a8=>({..._0x1317a8,'type':_0x1f419c(0x139)}))][_0x1f419c(0x121)]((_0x9673,_0x4b4732)=>_0x9673[_0x1f419c(0x150)]['localeCompare'](_0x4b4732[_0x1f419c(0x150)]));await handleSDKOutput(_0x1d33f6,_0x4e9a7b);}else{if(_0x4afb0e===0x0)console['log'](a37_0xfb1f4d[_0x1f419c(0x131)]('['+_0x6cac2c+']')),console[_0x1f419c(0x12b)](_0x1f419c(0x13a));else{console[_0x1f419c(0x12b)](a37_0xfb1f4d['dim']('['+_0x6cac2c+']'));const _0x5a598d=formatFlatList(_0x385c22,_0x5b3bda,{'showMetadata':!![]});console[_0x1f419c(0x12b)](_0x5a598d);}}return 0x0;}async['listRecursive'](_0x5770c0,_0x20d204){const _0x50d8e0=a37_0x56b3e8,{options:_0x56bfd3,tdx:_0x30c5ea}=_0x5770c0,_0x4e8ae4=await withSpinner(_0x50d8e0(0x12e)+_0x20d204+_0x50d8e0(0x143),()=>_0x30c5ea['segment']['resolvePathToResource'](_0x20d204),{'verbose':_0x56bfd3[_0x50d8e0(0x14f)]}),_0x4c2b76=_0x4e8ae4[_0x50d8e0(0x122)];_0x56bfd3[_0x50d8e0(0x14f)]&&(console[_0x50d8e0(0x123)](_0x50d8e0(0x11f)+_0x4c2b76['parentId']),_0x4c2b76[_0x50d8e0(0x148)]&&console[_0x50d8e0(0x123)](_0x50d8e0(0x137)+_0x4c2b76[_0x50d8e0(0x148)]));const _0x1d29f2=_0x56bfd3[_0x50d8e0(0x120)]||0xa,_0x5602f1=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x30c5ea[_0x50d8e0(0x139)]['listRecursive'](_0x4c2b76[_0x50d8e0(0x11b)],_0x4c2b76[_0x50d8e0(0x148)],0x0,_0x1d29f2),{'verbose':_0x56bfd3[_0x50d8e0(0x14f)]}),_0xb1a96d=_0x5602f1['data'];console[_0x50d8e0(0x123)](_0x50d8e0(0x141)+_0xb1a96d[_0x50d8e0(0x10e)]+_0x50d8e0(0x112));if(_0x56bfd3[_0x50d8e0(0x13d)]===_0x50d8e0(0x145)||_0x56bfd3['format']===_0x50d8e0(0x117))await handleSDKOutput(_0xb1a96d,_0x56bfd3);else{console[_0x50d8e0(0x12b)](a37_0xfb1f4d[_0x50d8e0(0x131)]('['+_0x20d204+']'));const _0x4d9d65=formatTree(_0xb1a96d,{'showMetadata':!![]});console['log'](_0x4d9d65);}return 0x0;}}
1
+ const a37_0x176df8=a37_0x6fa9;(function(_0x1cc7a1,_0x27dfc0){const _0x21edb6=a37_0x6fa9,_0x3c7c68=_0x1cc7a1();while(!![]){try{const _0x371e3a=-parseInt(_0x21edb6(0x1be))/0x1*(parseInt(_0x21edb6(0x1bc))/0x2)+parseInt(_0x21edb6(0x1b7))/0x3*(-parseInt(_0x21edb6(0x19d))/0x4)+-parseInt(_0x21edb6(0x1b0))/0x5+parseInt(_0x21edb6(0x1c8))/0x6+-parseInt(_0x21edb6(0x1a4))/0x7*(-parseInt(_0x21edb6(0x1c6))/0x8)+parseInt(_0x21edb6(0x1ac))/0x9*(parseInt(_0x21edb6(0x189))/0xa)+parseInt(_0x21edb6(0x1b6))/0xb;if(_0x371e3a===_0x27dfc0)break;else _0x3c7c68['push'](_0x3c7c68['shift']());}catch(_0x2a08cc){_0x3c7c68['push'](_0x3c7c68['shift']());}}}(a37_0x502d,0x8582c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x6fa9(_0x23aa12,_0x729984){_0x23aa12=_0x23aa12-0x188;const _0x502ddd=a37_0x502d();let _0x6fa906=_0x502ddd[_0x23aa12];return _0x6fa906;}import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import a37_0x3b65a1 from'chalk';function a37_0x502d(){const _0x165db0=['Parent\x20ID:\x20','Error:\x20No\x20parent\x20segment\x20context\x20set.','Recursive\x20mode:\x20enabled','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','539772iKbeyN','listUnified','recursive','List\x20folders\x20and\x20child\x20segments','dim','\x20and\x20','✔\x20Found\x20','31381JkZPnA','site','Building\x20hierarchy\x20tree...','maxDepth','(empty)','localeCompare','verbose','jsonl','18SmvVpO','message','\x20\x20Cause:\x20','json','4598355HUCkiT','Folder\x20ID:\x20','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x5c$&','execute','log','7682466IfyHjU','3EzfitW','error','map','No\x20items\x20match\x20pattern:\x20','format','2daJQuB','sort','891178wHbLXz','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','cause','data','replace','Folder/pattern\x20arg:\x20','Resolving\x20path\x20\x27','segment','1648uWKlty','\x27...','1367292JhUpOe',']\x20matching\x20\x27','Error:\x20','length','Listing\x20folders\x20and\x20segments...','Set\x20a\x20parent\x20segment\x20context\x20first:','\x20matching\x20\x27','filter','3214330oSzmID','parentId','\x20segment','folder','\x20folder','(not\x20set)','segments','listRecursive','✔\x20Built\x20tree\x20with\x20','name','folderId','resolvePathToResource','\x20top-level\x20items','includes','Resolving\x20parent\x20segment\x20\x27','test'];a37_0x502d=function(){return _0x165db0;};return a37_0x502d();}export class SegmentsCommand extends BaseCommand{[a37_0x176df8(0x192)]=a37_0x176df8(0x18f);['description']=a37_0x176df8(0x1a0);async[a37_0x176df8(0x1b4)](_0x3308b0){const _0x354627=a37_0x176df8,{options:_0x26e5a4,args:_0x3a5536}=_0x3308b0,_0x2896bb=_0x26e5a4[_0x354627(0x19f)],_0x1ccdcf=_0x3a5536[0x0];try{const _0x2ce06e=_0x26e5a4['parentSegment'];_0x26e5a4[_0x354627(0x1aa)]&&(console['error']('Site:\x20'+_0x26e5a4[_0x354627(0x1a5)]),console['error']('Parent\x20segment\x20context:\x20'+(_0x2ce06e||_0x354627(0x18e))),_0x1ccdcf&&console['error'](_0x354627(0x1c3)+_0x1ccdcf),_0x2896bb&&console[_0x354627(0x1b8)](_0x354627(0x19b)));if(!_0x2ce06e)return console['error'](_0x354627(0x19a)),console['error'](''),console['error'](_0x354627(0x1cd)),console['error'](_0x354627(0x19c)),console[_0x354627(0x1b8)](_0x354627(0x1bf)),console[_0x354627(0x1b8)](''),console[_0x354627(0x1b8)](_0x354627(0x1b2)),0x1;const _0x23ccc7=_0x1ccdcf&&(_0x1ccdcf[_0x354627(0x196)]('*')||_0x1ccdcf[_0x354627(0x196)]('?'));if(_0x23ccc7)return await this['listWithPattern'](_0x3308b0,_0x2ce06e,_0x1ccdcf);const _0x441d49=_0x1ccdcf?_0x2ce06e+'/'+_0x1ccdcf:_0x2ce06e;return _0x2896bb?await this[_0x354627(0x190)](_0x3308b0,_0x441d49):await this[_0x354627(0x19e)](_0x3308b0,_0x441d49);}catch(_0x45ff35){if(_0x45ff35 instanceof SDKError)return console[_0x354627(0x1b8)](_0x354627(0x1ca)+_0x45ff35[_0x354627(0x1ad)]),_0x45ff35[_0x354627(0x1c0)]&&console[_0x354627(0x1b8)](_0x354627(0x1ae)+_0x45ff35[_0x354627(0x1c0)]),0x1;throw _0x45ff35;}}async['listWithPattern'](_0x40421f,_0x3f15de,_0x37cc33){const _0x229a3c=a37_0x176df8,{options:_0x289bd8,tdx:_0x48456e}=_0x40421f,_0x1fcdfd=await withSpinner(_0x229a3c(0x197)+_0x3f15de+_0x229a3c(0x1c7),()=>_0x48456e[_0x229a3c(0x1c5)][_0x229a3c(0x194)](_0x3f15de),{'verbose':_0x289bd8[_0x229a3c(0x1aa)]}),_0x1843b3=_0x1fcdfd[_0x229a3c(0x1c1)],_0x2cd204=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x48456e['segment'][_0x229a3c(0x19e)](_0x1843b3[_0x229a3c(0x18a)],_0x1843b3[_0x229a3c(0x193)]),{'verbose':_0x289bd8['verbose']}),{folders:_0x286369,segments:_0x1da6c0}=_0x2cd204[_0x229a3c(0x1c1)],_0x41d739=_0x37cc33[_0x229a3c(0x1c2)](/[.+^${}()|[\]\\]/g,_0x229a3c(0x1b3))['replace'](/\*/g,'.*')[_0x229a3c(0x1c2)](/\?/g,'.'),_0x1639dd=new RegExp('^'+_0x41d739+'$','i'),_0x5181c7=_0x286369['filter'](_0x3cabe0=>_0x1639dd[_0x229a3c(0x198)](_0x3cabe0[_0x229a3c(0x192)])),_0x53d09f=_0x1da6c0[_0x229a3c(0x188)](_0x443cbe=>_0x1639dd['test'](_0x443cbe[_0x229a3c(0x192)])),_0x2a3c81=_0x5181c7[_0x229a3c(0x1cb)]+_0x53d09f[_0x229a3c(0x1cb)];console[_0x229a3c(0x1b8)]('✔\x20Found\x20'+_0x5181c7['length']+_0x229a3c(0x18d)+(_0x5181c7[_0x229a3c(0x1cb)]!==0x1?'s':'')+_0x229a3c(0x1a2)+_0x53d09f[_0x229a3c(0x1cb)]+_0x229a3c(0x18b)+(_0x53d09f[_0x229a3c(0x1cb)]!==0x1?'s':'')+_0x229a3c(0x1ce)+_0x37cc33+'\x27');if(_0x289bd8['format']===_0x229a3c(0x1af)||_0x289bd8[_0x229a3c(0x1bb)]==='jsonl'){const _0x8bd112=[..._0x5181c7[_0x229a3c(0x1b9)](_0x2c9e26=>({..._0x2c9e26,'type':_0x229a3c(0x18c)})),..._0x53d09f[_0x229a3c(0x1b9)](_0x451cde=>({..._0x451cde,'type':_0x229a3c(0x1c5)}))][_0x229a3c(0x1bd)]((_0x267235,_0x462dcb)=>_0x267235[_0x229a3c(0x192)][_0x229a3c(0x1a9)](_0x462dcb[_0x229a3c(0x192)]));await handleSDKOutput(_0x8bd112,_0x289bd8);}else{if(_0x2a3c81===0x0)console[_0x229a3c(0x1b5)](_0x229a3c(0x1ba)+_0x37cc33);else{console[_0x229a3c(0x1b5)](a37_0x3b65a1['dim']('['+_0x3f15de+_0x229a3c(0x1c9)+_0x37cc33+'\x27'));const _0x57f1b7=formatFlatList(_0x5181c7,_0x53d09f,{'showMetadata':!![]});console[_0x229a3c(0x1b5)](_0x57f1b7);}}return 0x0;}async[a37_0x176df8(0x19e)](_0x2d7fb1,_0x45868c){const _0x15ab15=a37_0x176df8,{options:_0x4798d5,tdx:_0x57328d}=_0x2d7fb1,_0x214734=await withSpinner(_0x15ab15(0x1c4)+_0x45868c+'\x27...',()=>_0x57328d[_0x15ab15(0x1c5)]['resolvePathToResource'](_0x45868c),{'verbose':_0x4798d5[_0x15ab15(0x1aa)]}),_0x5f3e86=_0x214734['data'];_0x4798d5[_0x15ab15(0x1aa)]&&(console[_0x15ab15(0x1b8)](_0x15ab15(0x199)+_0x5f3e86[_0x15ab15(0x18a)]),_0x5f3e86[_0x15ab15(0x193)]&&console[_0x15ab15(0x1b8)](_0x15ab15(0x1b1)+_0x5f3e86[_0x15ab15(0x193)]));const _0xb3671a=await withSpinner(_0x15ab15(0x1cc),()=>_0x57328d[_0x15ab15(0x1c5)][_0x15ab15(0x19e)](_0x5f3e86[_0x15ab15(0x18a)],_0x5f3e86['folderId']),{'verbose':_0x4798d5['verbose']}),{folders:_0x3ae3bf,segments:_0x37c63d}=_0xb3671a['data'],_0x58b677=_0x3ae3bf[_0x15ab15(0x1cb)]+_0x37c63d[_0x15ab15(0x1cb)];console[_0x15ab15(0x1b8)](_0x15ab15(0x1a3)+_0x3ae3bf[_0x15ab15(0x1cb)]+'\x20folder'+(_0x3ae3bf[_0x15ab15(0x1cb)]!==0x1?'s':'')+_0x15ab15(0x1a2)+_0x37c63d[_0x15ab15(0x1cb)]+_0x15ab15(0x18b)+(_0x37c63d[_0x15ab15(0x1cb)]!==0x1?'s':''));if(_0x4798d5[_0x15ab15(0x1bb)]==='json'||_0x4798d5[_0x15ab15(0x1bb)]===_0x15ab15(0x1ab)){const _0x8dacd9=[..._0x3ae3bf[_0x15ab15(0x1b9)](_0x573820=>({..._0x573820,'type':'folder'})),..._0x37c63d[_0x15ab15(0x1b9)](_0x4dc9c0=>({..._0x4dc9c0,'type':_0x15ab15(0x1c5)}))][_0x15ab15(0x1bd)]((_0x4196f2,_0x2a7f19)=>_0x4196f2[_0x15ab15(0x192)][_0x15ab15(0x1a9)](_0x2a7f19[_0x15ab15(0x192)]));await handleSDKOutput(_0x8dacd9,_0x4798d5);}else{if(_0x58b677===0x0)console['log'](a37_0x3b65a1['dim']('['+_0x45868c+']')),console[_0x15ab15(0x1b5)](_0x15ab15(0x1a8));else{console[_0x15ab15(0x1b5)](a37_0x3b65a1[_0x15ab15(0x1a1)]('['+_0x45868c+']'));const _0x1e2e29=formatFlatList(_0x3ae3bf,_0x37c63d,{'showMetadata':!![]});console['log'](_0x1e2e29);}}return 0x0;}async[a37_0x176df8(0x190)](_0x237e8d,_0x16620d){const _0x234de1=a37_0x176df8,{options:_0x17dd9b,tdx:_0x51ba8b}=_0x237e8d,_0x4cfb69=await withSpinner(_0x234de1(0x1c4)+_0x16620d+_0x234de1(0x1c7),()=>_0x51ba8b['segment'][_0x234de1(0x194)](_0x16620d),{'verbose':_0x17dd9b[_0x234de1(0x1aa)]}),_0x4314cf=_0x4cfb69['data'];_0x17dd9b['verbose']&&(console[_0x234de1(0x1b8)](_0x234de1(0x199)+_0x4314cf[_0x234de1(0x18a)]),_0x4314cf[_0x234de1(0x193)]&&console[_0x234de1(0x1b8)](_0x234de1(0x1b1)+_0x4314cf[_0x234de1(0x193)]));const _0x1d6e93=_0x17dd9b[_0x234de1(0x1a7)]||0xa,_0x2635ff=await withSpinner(_0x234de1(0x1a6),()=>_0x51ba8b[_0x234de1(0x1c5)][_0x234de1(0x190)](_0x4314cf[_0x234de1(0x18a)],_0x4314cf[_0x234de1(0x193)],0x0,_0x1d6e93),{'verbose':_0x17dd9b['verbose']}),_0x55d64a=_0x2635ff['data'];console[_0x234de1(0x1b8)](_0x234de1(0x191)+_0x55d64a['length']+_0x234de1(0x195));if(_0x17dd9b['format']===_0x234de1(0x1af)||_0x17dd9b['format']==='jsonl')await handleSDKOutput(_0x55d64a,_0x17dd9b);else{console[_0x234de1(0x1b5)](a37_0x3b65a1[_0x234de1(0x1a1)]('['+_0x16620d+']'));const _0x106fa2=formatTree(_0x55d64a,{'showMetadata':!![]});console['log'](_0x106fa2);}return 0x0;}}
@@ -1 +1 @@
1
- function a38_0x1668(_0x339aef,_0x20d665){_0x339aef=_0x339aef-0x7b;const _0x3ff92d=a38_0x3ff9();let _0x16685a=_0x3ff92d[_0x339aef];return _0x16685a;}const a38_0x1437cf=a38_0x1668;(function(_0x4251a9,_0x48d43b){const _0x386bdc=a38_0x1668,_0x1e37ed=_0x4251a9();while(!![]){try{const _0x4be5c8=-parseInt(_0x386bdc(0x83))/0x1*(parseInt(_0x386bdc(0xa1))/0x2)+parseInt(_0x386bdc(0x92))/0x3+-parseInt(_0x386bdc(0x7b))/0x4*(-parseInt(_0x386bdc(0x7d))/0x5)+parseInt(_0x386bdc(0x99))/0x6+-parseInt(_0x386bdc(0x84))/0x7*(parseInt(_0x386bdc(0x9b))/0x8)+-parseInt(_0x386bdc(0x89))/0x9+parseInt(_0x386bdc(0x8a))/0xa;if(_0x4be5c8===_0x48d43b)break;else _0x1e37ed['push'](_0x1e37ed['shift']());}catch(_0xc40d64){_0x1e37ed['push'](_0x1e37ed['shift']());}}}(a38_0x3ff9,0x583c9));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a38_0x3ff9(){const _0x50c56e=['\x20from\x20','execute','1997514Pwrpdh','2577820MjHcuI','\x20\x20Cause:\x20','error','showTable','Limit:\x20','description','args','Site:\x20','671133BJpFlP','message','verbose','\x20row','Querying\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','limit','1792590Cjzrpo','data','48PmbxXD','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','...','cause','Show\x20table\x20contents','site','3018JFENkh','8WHgsIy','catalog','882340hoJHFJ','Usage:\x20tdx\x20show\x20<database.table>','database','Error:\x20','name','Catalog:\x20','133IUbNYN','407323XBLaiG','length','Table:\x20'];a38_0x3ff9=function(){return _0x50c56e;};return a38_0x3ff9();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a38_0x1437cf(0x81)]='show';[a38_0x1437cf(0x8f)]=a38_0x1437cf(0x9f);async[a38_0x1437cf(0x88)](_0x227c94){const _0x5531f7=a38_0x1437cf;return this[_0x5531f7(0x8d)](_0x227c94);}async[a38_0x1437cf(0x8d)](_0x23db05){const _0x494cc8=a38_0x1437cf,{options:_0x1e6c58,args:_0x14051c,tdx:_0x2cb7db}=_0x23db05;let _0x21f9b6;try{_0x21f9b6=parseTableReference(_0x14051c[0x0]);const _0x2404b8=_0x1e6c58['database'];!_0x21f9b6[_0x494cc8(0x7f)]&&_0x2404b8&&(_0x21f9b6[_0x494cc8(0x7f)]=_0x2404b8);const _0xaa4e4f=validateTableDescribeReference(_0x21f9b6);if(_0xaa4e4f)return console[_0x494cc8(0x8c)](_0x494cc8(0x80)+_0xaa4e4f),console[_0x494cc8(0x8c)](_0x494cc8(0x7e)),console[_0x494cc8(0x8c)](_0x494cc8(0x97)),console[_0x494cc8(0x8c)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x3000dd){return console[_0x494cc8(0x8c)](_0x494cc8(0x80)+_0x3000dd[_0x494cc8(0x93)]),console[_0x494cc8(0x8c)](_0x494cc8(0x7e)),console['error'](_0x494cc8(0x97)),console[_0x494cc8(0x8c)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x2cac74=_0x21f9b6[_0x494cc8(0x7c)],_0x5c3ded=_0x21f9b6[_0x494cc8(0x7f)],_0x41a342=_0x21f9b6['table'],_0x50c7fa=resolveLimit(_0x1e6c58[_0x494cc8(0x98)],DEFAULT_DISPLAY_LIMIT);try{_0x1e6c58[_0x494cc8(0x94)]&&(console[_0x494cc8(0x8c)](_0x494cc8(0x91)+_0x1e6c58[_0x494cc8(0xa0)]),_0x2cac74&&console['error'](_0x494cc8(0x82)+_0x2cac74),console[_0x494cc8(0x8c)]('Database:\x20'+_0x5c3ded),console['error'](_0x494cc8(0x86)+_0x41a342),console['error'](_0x494cc8(0x8e)+_0x50c7fa));const _0x4d0395=_0x2cac74?_0x2cac74+'.'+_0x5c3ded+'.'+_0x41a342:_0x5c3ded+'.'+_0x41a342,_0x28ad8c=await withSpinner(_0x494cc8(0x96)+_0x4d0395+_0x494cc8(0x9d),()=>_0x2cb7db['query']['showTable'](_0x5c3ded,_0x41a342,_0x50c7fa,_0x2cac74),{'verbose':_0x1e6c58[_0x494cc8(0x94)]}),_0x296858=_0x28ad8c['data'],_0x204e5e=_0x296858[_0x494cc8(0x9a)];return _0x204e5e['length']===0x0?console[_0x494cc8(0x8c)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x494cc8(0x8c)]('✔\x20Retrieved\x20'+_0x204e5e[_0x494cc8(0x85)]+_0x494cc8(0x95)+(_0x204e5e[_0x494cc8(0x85)]!==0x1?'s':'')+_0x494cc8(0x87)+_0x4d0395),await handleSDKOutput(_0x204e5e,_0x1e6c58),0x0;}catch(_0xfc45a8){if(_0xfc45a8 instanceof SDKError)return console[_0x494cc8(0x8c)](_0x494cc8(0x80)+_0xfc45a8[_0x494cc8(0x93)]),_0xfc45a8[_0x494cc8(0x9e)]&&console[_0x494cc8(0x8c)](_0x494cc8(0x8b)+_0xfc45a8['cause']),0x1;throw _0xfc45a8;}}['validate'](_0x26f8b3){const _0x22ae0c=a38_0x1437cf;if(_0x26f8b3[_0x22ae0c(0x90)]['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(_0x26f8b3[_0x22ae0c(0x90)]['length']>0x1)return _0x22ae0c(0x9c);return undefined;}}
1
+ const a38_0x14439f=a38_0x2a76;(function(_0x36dcd4,_0x5861ae){const _0x41829f=a38_0x2a76,_0x3a7285=_0x36dcd4();while(!![]){try{const _0x201472=parseInt(_0x41829f(0xb6))/0x1*(parseInt(_0x41829f(0xa4))/0x2)+parseInt(_0x41829f(0xa0))/0x3+parseInt(_0x41829f(0xa1))/0x4*(-parseInt(_0x41829f(0xc3))/0x5)+parseInt(_0x41829f(0xb0))/0x6+parseInt(_0x41829f(0xbb))/0x7+-parseInt(_0x41829f(0xa7))/0x8*(parseInt(_0x41829f(0xbf))/0x9)+-parseInt(_0x41829f(0xad))/0xa;if(_0x201472===_0x5861ae)break;else _0x3a7285['push'](_0x3a7285['shift']());}catch(_0x2e0929){_0x3a7285['push'](_0x3a7285['shift']());}}}(a38_0x1263,0xad1ff));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 a38_0x1263(){const _0x1467c9=['Site:\x20','5aWTqoR','showTable','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','✔\x20Retrieved\x20','description','2993091mghdzm','3286060AUFtBN','Table:\x20','message','22LRGlLz','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Show\x20table\x20contents','8uPpEAK','show','site','table','...','length','2070510XQDLoI','error','data','6963798GABKJk','catalog','query','cause','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','verbose','38237vGvQWF','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','validate','database','2386489TYmLVV','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','limit','\x20from\x20','10639611lrPpNG','\x20\x20Cause:\x20','Error:\x20'];a38_0x1263=function(){return _0x1467c9;};return a38_0x1263();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a38_0x2a76(_0x4caa0a,_0x4ec24f){_0x4caa0a=_0x4caa0a-0xa0;const _0x1263fb=a38_0x1263();let _0x2a764d=_0x1263fb[_0x4caa0a];return _0x2a764d;}export class ShowCommand extends BaseCommand{[a38_0x14439f(0xb8)]=a38_0x14439f(0xa8);[a38_0x14439f(0xc7)]=a38_0x14439f(0xa6);async['execute'](_0x312806){const _0x388c42=a38_0x14439f;return this[_0x388c42(0xc4)](_0x312806);}async[a38_0x14439f(0xc4)](_0x3b388c){const _0x15d873=a38_0x14439f,{options:_0x55ae2e,args:_0x44cfe6,tdx:_0x25e802}=_0x3b388c;let _0xbe2e0b;try{_0xbe2e0b=parseTableReference(_0x44cfe6[0x0]);const _0x5bd93b=_0x55ae2e[_0x15d873(0xba)];!_0xbe2e0b[_0x15d873(0xba)]&&_0x5bd93b&&(_0xbe2e0b[_0x15d873(0xba)]=_0x5bd93b);const _0x47c3e1=validateTableDescribeReference(_0xbe2e0b);if(_0x47c3e1)return console[_0x15d873(0xae)]('Error:\x20'+_0x47c3e1),console[_0x15d873(0xae)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x15d873(0xae)](_0x15d873(0xc5)),console[_0x15d873(0xae)](_0x15d873(0xa5)),0x1;}catch(_0x549ef1){return console[_0x15d873(0xae)]('Error:\x20'+_0x549ef1['message']),console[_0x15d873(0xae)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x15d873(0xae)](_0x15d873(0xc5)),console[_0x15d873(0xae)](_0x15d873(0xa5)),0x1;}const _0xf3e1c0=_0xbe2e0b[_0x15d873(0xb1)],_0xdb70dc=_0xbe2e0b[_0x15d873(0xba)],_0x40c797=_0xbe2e0b[_0x15d873(0xaa)],_0x112486=resolveLimit(_0x55ae2e[_0x15d873(0xbd)],DEFAULT_DISPLAY_LIMIT);try{_0x55ae2e[_0x15d873(0xb5)]&&(console[_0x15d873(0xae)](_0x15d873(0xc2)+_0x55ae2e[_0x15d873(0xa9)]),_0xf3e1c0&&console['error']('Catalog:\x20'+_0xf3e1c0),console[_0x15d873(0xae)]('Database:\x20'+_0xdb70dc),console[_0x15d873(0xae)](_0x15d873(0xa2)+_0x40c797),console[_0x15d873(0xae)]('Limit:\x20'+_0x112486));const _0xbea139=_0xf3e1c0?_0xf3e1c0+'.'+_0xdb70dc+'.'+_0x40c797:_0xdb70dc+'.'+_0x40c797,_0x102263=await withSpinner('Querying\x20'+_0xbea139+_0x15d873(0xab),()=>_0x25e802[_0x15d873(0xb2)][_0x15d873(0xc4)](_0xdb70dc,_0x40c797,_0x112486,_0xf3e1c0),{'verbose':_0x55ae2e[_0x15d873(0xb5)]}),_0x411652=_0x102263[_0x15d873(0xaf)],_0x44fd02=_0x411652[_0x15d873(0xaf)];return _0x44fd02[_0x15d873(0xac)]===0x0?console[_0x15d873(0xae)](_0x15d873(0xbc)):console[_0x15d873(0xae)](_0x15d873(0xc6)+_0x44fd02[_0x15d873(0xac)]+'\x20row'+(_0x44fd02[_0x15d873(0xac)]!==0x1?'s':'')+_0x15d873(0xbe)+_0xbea139),await handleSDKOutput(_0x44fd02,_0x55ae2e),0x0;}catch(_0x58adf7){if(_0x58adf7 instanceof SDKError)return console[_0x15d873(0xae)](_0x15d873(0xc1)+_0x58adf7[_0x15d873(0xa3)]),_0x58adf7[_0x15d873(0xb3)]&&console[_0x15d873(0xae)](_0x15d873(0xc0)+_0x58adf7[_0x15d873(0xb3)]),0x1;throw _0x58adf7;}}[a38_0x14439f(0xb9)](_0x3d3adc){const _0x1041ff=a38_0x14439f;if(_0x3d3adc['args'][_0x1041ff(0xac)]===0x0)return _0x1041ff(0xb4);if(_0x3d3adc['args'][_0x1041ff(0xac)]>0x1)return _0x1041ff(0xb7);return undefined;}}
@@ -1 +1 @@
1
- const a39_0x1591d2=a39_0x3d0f;(function(_0xc115b6,_0x2129d8){const _0x3e751d=a39_0x3d0f,_0x2ee5c5=_0xc115b6();while(!![]){try{const _0x5dac5e=-parseInt(_0x3e751d(0xe2))/0x1*(-parseInt(_0x3e751d(0xdd))/0x2)+-parseInt(_0x3e751d(0xe1))/0x3*(parseInt(_0x3e751d(0xd6))/0x4)+-parseInt(_0x3e751d(0xda))/0x5*(-parseInt(_0x3e751d(0xe8))/0x6)+-parseInt(_0x3e751d(0xc8))/0x7*(-parseInt(_0x3e751d(0xd9))/0x8)+parseInt(_0x3e751d(0xdb))/0x9+-parseInt(_0x3e751d(0xcb))/0xa+-parseInt(_0x3e751d(0xf4))/0xb*(parseInt(_0x3e751d(0xc9))/0xc);if(_0x5dac5e===_0x2129d8)break;else _0x2ee5c5['push'](_0x2ee5c5['shift']());}catch(_0x55ef3b){_0x2ee5c5['push'](_0x2ee5c5['shift']());}}}(a39_0x3059,0xed6d9));import{BaseCommand}from'./command.js';function a39_0x3059(){const _0x1d8fc4=['listTables','.*\x22','\x27\x20across\x20all\x20databases.','query','721554OptZeP','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','database','execute','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','message','includes','Table\x20pattern:\x20','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','site','limit','cause','3542rynAEP','Note:\x20\x27','\x27\x20is\x20ambiguous.','\x20table','28UEpMhj','86244ruuTdu','List\x20tables\x20in\x20a\x20database','12072250lGCAhm','error','Or\x20use\x20--in\x20flag:','length','Site:\x20','tables','Database\x20pattern:\x20','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','data','name','Database:\x20all','372ZgpfOC','table','✖\x20No\x20tables\x20found','2429176ckYgAL','20TxnuuF','15380919aEJSVh','Error:\x20','422504nGwLJv','description','validate','✔\x20Found\x20','19377OHwsCU','8qeWAZG','Database\x20\x27'];a39_0x3059=function(){return _0x1d8fc4;};return a39_0x3059();}import{SDKError}from'../sdk/index.js';function a39_0x3d0f(_0x4e3903,_0x2a0c17){_0x4e3903=_0x4e3903-0xc6;const _0x30598b=a39_0x3059();let _0x3d0f01=_0x30598b[_0x4e3903];return _0x3d0f01;}import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a39_0x1591d2(0xd4)]=a39_0x1591d2(0xd0);[a39_0x1591d2(0xde)]=a39_0x1591d2(0xca);async[a39_0x1591d2(0xeb)](_0xf6b809){const _0x2a1701=a39_0x1591d2,{options:_0x4bcba3,args:_0x2d9abe,tdx:_0x5d12e3}=_0xf6b809;let _0x36ebde;if(_0x2d9abe[_0x2a1701(0xce)]===0x0)_0x36ebde={'database':undefined,'table':undefined,'original':''};else{if(_0x2d9abe[_0x2a1701(0xce)]===0x1)try{_0x36ebde=parseTableReference(_0x2d9abe[0x0]);if(_0x36ebde[_0x2a1701(0xd7)]&&!_0x36ebde[_0x2a1701(0xea)]&&!_0x36ebde[_0x2a1701(0xd7)]['includes']('*')&&!_0x36ebde[_0x2a1701(0xd7)][_0x2a1701(0xee)]('?'))return console[_0x2a1701(0xcc)]('Error:\x20Pattern\x20\x27'+_0x2d9abe[0x0]+_0x2a1701(0xc6)),console[_0x2a1701(0xcc)](_0x2a1701(0xd2)+_0x36ebde['table']+'\x27?'),console[_0x2a1701(0xcc)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x36ebde['table']+_0x2a1701(0xe5)),console[_0x2a1701(0xcc)](_0x2a1701(0xf0)+_0x36ebde[_0x2a1701(0xd7)]),console[_0x2a1701(0xcc)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x36ebde[_0x2a1701(0xd7)]),console[_0x2a1701(0xcc)](''),console[_0x2a1701(0xcc)](_0x2a1701(0xf5)+_0x2d9abe[0x0]+'\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27'+_0x36ebde[_0x2a1701(0xd7)]+_0x2a1701(0xe6)),0x1;}catch(_0x1f8b8c){return console[_0x2a1701(0xcc)]('Error:\x20'+_0x1f8b8c[_0x2a1701(0xed)]),0x1;}else return console[_0x2a1701(0xcc)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console['error']('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x2a1701(0xcc)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console['error'](_0x2a1701(0xe9)),console[_0x2a1701(0xcc)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x2a1701(0xcc)](_0x2a1701(0xcd)),console[_0x2a1701(0xcc)](_0x2a1701(0xec)),0x1;}const _0x23bdc8=_0x4bcba3[_0x2a1701(0xea)];!_0x36ebde[_0x2a1701(0xea)]&&_0x23bdc8&&(_0x36ebde[_0x2a1701(0xea)]=_0x23bdc8);try{const _0x5e6b69=_0x932a5c=>_0x932a5c&&(_0x932a5c[_0x2a1701(0xee)]('*')||_0x932a5c[_0x2a1701(0xee)]('?')),_0x413c19=_0x5e6b69(_0x36ebde[_0x2a1701(0xea)]);_0x4bcba3['verbose']&&(console[_0x2a1701(0xcc)](_0x2a1701(0xcf)+_0x4bcba3[_0x2a1701(0xf1)]),_0x36ebde[_0x2a1701(0xea)]?_0x413c19?console[_0x2a1701(0xcc)](_0x2a1701(0xd1)+_0x36ebde['database']):console[_0x2a1701(0xcc)]('Database:\x20'+_0x36ebde['database']):console[_0x2a1701(0xcc)](_0x2a1701(0xd5)),_0x36ebde['table']&&console[_0x2a1701(0xcc)](_0x2a1701(0xef)+_0x36ebde[_0x2a1701(0xd7)]));const _0x5d24=_0x36ebde[_0x2a1701(0xea)]&&!_0x413c19?_0x36ebde[_0x2a1701(0xea)]:undefined,_0x3d48c8=_0x413c19?_0x36ebde['database']:undefined,_0x3ee72c=_0x36ebde[_0x2a1701(0xd7)],_0x5dc10c=resolveLimit(_0x4bcba3[_0x2a1701(0xf2)],DEFAULT_LISTING_LIMIT),_0xb7f134=await withSpinner('Listing\x20tables...',()=>_0x5d12e3[_0x2a1701(0xe7)][_0x2a1701(0xe4)](_0x5d24,_0x3ee72c,_0x3d48c8,_0x5dc10c),{'verbose':_0x4bcba3['verbose']}),_0x1d2c93=_0xb7f134[_0x2a1701(0xd3)];if(_0x1d2c93[_0x2a1701(0xce)]===0x0&&_0x36ebde[_0x2a1701(0xea)]&&!_0x413c19)return console['error'](_0x2a1701(0xd8)),console['error'](_0x2a1701(0xe3)+_0x36ebde['database']+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console[_0x2a1701(0xcc)](_0x2a1701(0xe0)+_0x1d2c93['length']+_0x2a1701(0xc7)+(_0x1d2c93[_0x2a1701(0xce)]!==0x1?'s':'')),await handleSDKOutput(_0x1d2c93,{..._0x4bcba3,'limit':_0x5dc10c}),0x0;}catch(_0x12e460){if(_0x12e460 instanceof SDKError)return console[_0x2a1701(0xcc)](_0x2a1701(0xdc)+_0x12e460[_0x2a1701(0xed)]),_0x12e460['cause']&&console[_0x2a1701(0xcc)]('\x20\x20Cause:\x20'+_0x12e460[_0x2a1701(0xf3)]),0x1;throw _0x12e460;}}[a39_0x1591d2(0xdf)](_0x300bbb){return undefined;}}
1
+ const a39_0x572e2a=a39_0x5997;function a39_0x5997(_0x9d4bba,_0x4a850b){_0x9d4bba=_0x9d4bba-0x170;const _0x3a9219=a39_0x3a92();let _0x599717=_0x3a9219[_0x9d4bba];return _0x599717;}(function(_0x432dd8,_0x41337b){const _0x102a52=a39_0x5997,_0x23ba20=_0x432dd8();while(!![]){try{const _0x2ff759=parseInt(_0x102a52(0x186))/0x1*(parseInt(_0x102a52(0x18d))/0x2)+-parseInt(_0x102a52(0x17c))/0x3*(parseInt(_0x102a52(0x187))/0x4)+parseInt(_0x102a52(0x194))/0x5+parseInt(_0x102a52(0x18c))/0x6+parseInt(_0x102a52(0x198))/0x7*(parseInt(_0x102a52(0x18a))/0x8)+-parseInt(_0x102a52(0x189))/0x9+-parseInt(_0x102a52(0x17b))/0xa;if(_0x2ff759===_0x41337b)break;else _0x23ba20['push'](_0x23ba20['shift']());}catch(_0x2f807e){_0x23ba20['push'](_0x23ba20['shift']());}}}(a39_0x3a92,0xaa9db));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a39_0x3a92(){const _0x1a20b9=['Or\x20use\x20--in\x20flag:','data','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Database:\x20all','message','database','4491120ycRjad','173973NeelkU','limit','.*\x22','query','tables','error','execute','validate','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','cause','66415nhRckq','44cboJFF','description','11886264WzGyoq','4888kwvdFY','Table\x20pattern:\x20','5488470eYbAPs','36ckSylX','Listing\x20tables...','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','verbose','List\x20tables\x20in\x20a\x20database','Note:\x20\x27','listTables','3723025mCPhLv','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','✔\x20Found\x20','Error:\x20Pattern\x20\x27','2884BGCBRI','\x20\x20Cause:\x20','length','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','site','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','includes','table','✖\x20No\x20tables\x20found','Error:\x20','name','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Site:\x20','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'];a39_0x3a92=function(){return _0x1a20b9;};return a39_0x3a92();}import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a39_0x572e2a(0x170)]=a39_0x572e2a(0x180);[a39_0x572e2a(0x188)]=a39_0x572e2a(0x191);async[a39_0x572e2a(0x182)](_0x1caaae){const _0x2be761=a39_0x572e2a,{options:_0x1fdaf9,args:_0x2ccd21,tdx:_0xb1b16b}=_0x1caaae;let _0x342ef5;if(_0x2ccd21[_0x2be761(0x19a)]===0x0)_0x342ef5={'database':undefined,'table':undefined,'original':''};else{if(_0x2ccd21[_0x2be761(0x19a)]===0x1)try{_0x342ef5=parseTableReference(_0x2ccd21[0x0]);if(_0x342ef5[_0x2be761(0x19f)]&&!_0x342ef5['database']&&!_0x342ef5['table']['includes']('*')&&!_0x342ef5['table']['includes']('?'))return console['error'](_0x2be761(0x197)+_0x2ccd21[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x2be761(0x181)](_0x2be761(0x19b)+_0x342ef5['table']+'\x27?'),console[_0x2be761(0x181)]('\x20\x20Use:\x20tdx\x20tables\x20\x22'+_0x342ef5[_0x2be761(0x19f)]+_0x2be761(0x17e)),console[_0x2be761(0x181)](_0x2be761(0x18f)+_0x342ef5[_0x2be761(0x19f)]),console[_0x2be761(0x181)](_0x2be761(0x177)+_0x342ef5[_0x2be761(0x19f)]),console['error'](''),console[_0x2be761(0x181)](_0x2be761(0x192)+_0x2ccd21[0x0]+_0x2be761(0x184)+_0x342ef5[_0x2be761(0x19f)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x3b7640){return console['error'](_0x2be761(0x1a1)+_0x3b7640[_0x2be761(0x179)]),0x1;}else return console['error']('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x2be761(0x181)](_0x2be761(0x171)),console[_0x2be761(0x181)](_0x2be761(0x173)),console[_0x2be761(0x181)](_0x2be761(0x19d)),console[_0x2be761(0x181)]('\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases'),console[_0x2be761(0x181)](_0x2be761(0x174)),console['error'](_0x2be761(0x176)),0x1;}const _0x1e4649=_0x1fdaf9[_0x2be761(0x17a)];!_0x342ef5[_0x2be761(0x17a)]&&_0x1e4649&&(_0x342ef5[_0x2be761(0x17a)]=_0x1e4649);try{const _0x3f4fc5=_0x292944=>_0x292944&&(_0x292944[_0x2be761(0x19e)]('*')||_0x292944['includes']('?')),_0x5be578=_0x3f4fc5(_0x342ef5[_0x2be761(0x17a)]);_0x1fdaf9[_0x2be761(0x190)]&&(console[_0x2be761(0x181)](_0x2be761(0x172)+_0x1fdaf9[_0x2be761(0x19c)]),_0x342ef5[_0x2be761(0x17a)]?_0x5be578?console[_0x2be761(0x181)]('Database\x20pattern:\x20'+_0x342ef5[_0x2be761(0x17a)]):console[_0x2be761(0x181)]('Database:\x20'+_0x342ef5['database']):console['error'](_0x2be761(0x178)),_0x342ef5[_0x2be761(0x19f)]&&console[_0x2be761(0x181)](_0x2be761(0x18b)+_0x342ef5['table']));const _0x552edf=_0x342ef5[_0x2be761(0x17a)]&&!_0x5be578?_0x342ef5['database']:undefined,_0x56b306=_0x5be578?_0x342ef5[_0x2be761(0x17a)]:undefined,_0x31580d=_0x342ef5['table'],_0x3cafac=resolveLimit(_0x1fdaf9[_0x2be761(0x17d)],DEFAULT_LISTING_LIMIT),_0x6272b6=await withSpinner(_0x2be761(0x18e),()=>_0xb1b16b[_0x2be761(0x17f)][_0x2be761(0x193)](_0x552edf,_0x31580d,_0x56b306,_0x3cafac),{'verbose':_0x1fdaf9[_0x2be761(0x190)]}),_0x508417=_0x6272b6[_0x2be761(0x175)];if(_0x508417['length']===0x0&&_0x342ef5[_0x2be761(0x17a)]&&!_0x5be578)return console[_0x2be761(0x181)](_0x2be761(0x1a0)),console[_0x2be761(0x181)]('Database\x20\x27'+_0x342ef5[_0x2be761(0x17a)]+_0x2be761(0x195)),0x1;return console[_0x2be761(0x181)](_0x2be761(0x196)+_0x508417[_0x2be761(0x19a)]+'\x20table'+(_0x508417[_0x2be761(0x19a)]!==0x1?'s':'')),await handleSDKOutput(_0x508417,{..._0x1fdaf9,'limit':_0x3cafac}),0x0;}catch(_0x3b6236){if(_0x3b6236 instanceof SDKError)return console[_0x2be761(0x181)]('Error:\x20'+_0x3b6236[_0x2be761(0x179)]),_0x3b6236[_0x2be761(0x185)]&&console[_0x2be761(0x181)](_0x2be761(0x199)+_0x3b6236[_0x2be761(0x185)]),0x1;throw _0x3b6236;}}[a39_0x572e2a(0x183)](_0x3857ec){return undefined;}}
@@ -1 +1 @@
1
- const a40_0x3800e9=a40_0x2e77;(function(_0x58182c,_0x3e29f9){const _0x50ae27=a40_0x2e77,_0x91e66e=_0x58182c();while(!![]){try{const _0x2a1eb1=-parseInt(_0x50ae27(0x8f))/0x1+parseInt(_0x50ae27(0x88))/0x2+-parseInt(_0x50ae27(0x8d))/0x3*(parseInt(_0x50ae27(0x8a))/0x4)+-parseInt(_0x50ae27(0x6e))/0x5*(-parseInt(_0x50ae27(0x79))/0x6)+-parseInt(_0x50ae27(0x7e))/0x7+-parseInt(_0x50ae27(0x97))/0x8+parseInt(_0x50ae27(0x82))/0x9;if(_0x2a1eb1===_0x3e29f9)break;else _0x91e66e['push'](_0x91e66e['shift']());}catch(_0x86cd1){_0x91e66e['push'](_0x91e66e['shift']());}}}(a40_0xc885,0x4e9fc));function a40_0xc885(){const _0x40c031=['105504sZrKVr','Error:\x20Profile\x20\x27','clear','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','\x27\x20does\x20not\x20exist','Invalid\x20resource:\x20','message','Set\x20session-level\x20context','3078544WRRzfn','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','llm_project','execute','389145RRRzPJ','cleared','session','description','length','log','database','Session\x20context\x20','profile','join','parent_segment','6yfbWsX','use','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','dim','Session\x20llm_project\x20set\x20to:\x20','1878919uFgBfX','toString','Session\x20profile\x20set\x20to:\x20','green','12907152KeCgpr','Session\x20parent_segment\x20set\x20to:\x20','Session\x20database\x20set\x20to:\x20','name','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Error:\x20','72946elbelF','debug','12388WzqjNV','(session:\x20','error','453BRylup','engage_workspace'];a40_0xc885=function(){return _0x40c031;};return a40_0xc885();}function a40_0x2e77(_0x5a50e6,_0x371c44){_0x5a50e6=_0x5a50e6-0x6d;const _0xc88548=a40_0xc885();let _0x2e77f1=_0xc88548[_0x5a50e6];return _0x2e77f1;}import{BaseCommand}from'./command.js';import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import a40_0x4dfb50 from'chalk';export class UseCommand extends BaseCommand{[a40_0x3800e9(0x85)]=a40_0x3800e9(0x7a);[a40_0x3800e9(0x71)]=a40_0x3800e9(0x96);['validate'](_0x15af93){const _0xee4abe=a40_0x3800e9,{args:_0x5dd1e3}=_0x15af93;if(_0x5dd1e3['length']===0x0)return undefined;if(_0x5dd1e3['length']===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0xee4abe(0x98)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a'+_0xee4abe(0x7b);const _0x546f33=_0x5dd1e3[0x0],_0xa2d9d=[_0xee4abe(0x74),'parent_segment',_0xee4abe(0x99),'profile',_0xee4abe(0x8e)];if(!_0xa2d9d['includes'](_0x546f33))return _0xee4abe(0x94)+_0x546f33+'.\x20Must\x20be\x20one\x20of:\x20'+_0xa2d9d[_0xee4abe(0x77)](',\x20');return undefined;}async[a40_0x3800e9(0x6d)](_0x402091){const _0x2047c8=a40_0x3800e9,{args:_0x39be94,options:_0x4eafa9}=_0x402091,_0xb8534b=_0x4eafa9[_0x2047c8(0x89)],_0x445108=_0x4eafa9[_0x2047c8(0x91)];cleanExpiredSessions();try{if(_0x445108){clearSessionContext(_0x4eafa9['session']);const _0x2f62dc=_0x4eafa9[_0x2047c8(0x70)]||getCurrentSessionPID()[_0x2047c8(0x7f)]();return console['log'](_0x2047c8(0x75)+a40_0x4dfb50['green'](_0x2047c8(0x6f))+'\x20'+a40_0x4dfb50[_0x2047c8(0x7c)](_0x2047c8(0x8b)+_0x2f62dc+')')),0x0;}if(_0x39be94[_0x2047c8(0x72)]===0x0){const _0xfc2890=new GlobalContext(_0x4eafa9);return _0xb8534b?_0xfc2890['displayWithSources']():_0xfc2890['display'](),console['log'](a40_0x4dfb50[_0x2047c8(0x7c)]('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console[_0x2047c8(0x73)](a40_0x4dfb50[_0x2047c8(0x7c)](_0x2047c8(0x92))),0x0;}const _0xc1bd4=_0x39be94[0x0],_0x44ab93=_0x39be94[0x1];if(_0xc1bd4===_0x2047c8(0x76)){if(!profileExists(_0x44ab93))return console['error'](_0x2047c8(0x90)+_0x44ab93+_0x2047c8(0x93)),console['error']('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x48b6c4=_0x4eafa9['session']||getCurrentSessionPID()[_0x2047c8(0x7f)]();return saveSessionContext({'profile':_0x44ab93},_0x4eafa9[_0x2047c8(0x70)]),console[_0x2047c8(0x73)](_0x2047c8(0x80)+a40_0x4dfb50[_0x2047c8(0x81)](_0x44ab93)+'\x20'+a40_0x4dfb50[_0x2047c8(0x7c)]('(session:\x20'+_0x48b6c4+')')),console['log'](a40_0x4dfb50[_0x2047c8(0x7c)](_0x2047c8(0x86))),0x0;}const _0x2c0079={},_0x362eec=_0x4eafa9[_0x2047c8(0x70)]||getCurrentSessionPID()[_0x2047c8(0x7f)]();switch(_0xc1bd4){case'database':_0x2c0079[_0x2047c8(0x74)]=_0x44ab93,console[_0x2047c8(0x73)](_0x2047c8(0x84)+a40_0x4dfb50[_0x2047c8(0x81)](_0x44ab93)+'\x20'+a40_0x4dfb50['dim'](_0x2047c8(0x8b)+_0x362eec+')'));break;case _0x2047c8(0x78):_0x2c0079['parent_segment']=_0x44ab93,console[_0x2047c8(0x73)](_0x2047c8(0x83)+a40_0x4dfb50[_0x2047c8(0x81)](_0x44ab93)+'\x20'+a40_0x4dfb50['dim'](_0x2047c8(0x8b)+_0x362eec+')'));break;case _0x2047c8(0x99):_0x2c0079[_0x2047c8(0x99)]=_0x44ab93,console[_0x2047c8(0x73)](_0x2047c8(0x7d)+a40_0x4dfb50[_0x2047c8(0x81)](_0x44ab93)+'\x20'+a40_0x4dfb50[_0x2047c8(0x7c)](_0x2047c8(0x8b)+_0x362eec+')'));break;case _0x2047c8(0x8e):_0x2c0079[_0x2047c8(0x8e)]=_0x44ab93,console[_0x2047c8(0x73)]('Session\x20engage_workspace\x20set\x20to:\x20'+a40_0x4dfb50['green'](_0x44ab93)+'\x20'+a40_0x4dfb50[_0x2047c8(0x7c)](_0x2047c8(0x8b)+_0x362eec+')'));break;}return saveSessionContext(_0x2c0079,_0x4eafa9['session']),console[_0x2047c8(0x73)](a40_0x4dfb50['dim'](_0x2047c8(0x86))),0x0;}catch(_0x165699){return _0x165699 instanceof Error&&console[_0x2047c8(0x8c)](_0x2047c8(0x87)+_0x165699[_0x2047c8(0x95)]),0x1;}}}
1
+ const a40_0x256c5d=a40_0x27be;(function(_0x4f19d1,_0x15267b){const _0x1a058b=a40_0x27be,_0x372f08=_0x4f19d1();while(!![]){try{const _0x23e78f=-parseInt(_0x1a058b(0xf8))/0x1*(parseInt(_0x1a058b(0xf0))/0x2)+parseInt(_0x1a058b(0xdb))/0x3+-parseInt(_0x1a058b(0xfb))/0x4*(-parseInt(_0x1a058b(0xef))/0x5)+parseInt(_0x1a058b(0xf1))/0x6+parseInt(_0x1a058b(0xea))/0x7+-parseInt(_0x1a058b(0xee))/0x8*(parseInt(_0x1a058b(0xe5))/0x9)+-parseInt(_0x1a058b(0xf2))/0xa;if(_0x23e78f===_0x15267b)break;else _0x372f08['push'](_0x372f08['shift']());}catch(_0x58273e){_0x372f08['push'](_0x372f08['shift']());}}}(a40_0x21b4,0x43f33));import{BaseCommand}from'./command.js';function a40_0x27be(_0xa8a014,_0x54e42a){_0xa8a014=_0xa8a014-0xd0;const _0x21b4e9=a40_0x21b4();let _0x27be21=_0x21b4e9[_0xa8a014];return _0x27be21;}import{saveSessionContext,getCurrentSessionPID,cleanExpiredSessions,clearSessionContext}from'../core/session.js';import{profileExists}from'../core/profile.js';import{GlobalContext}from'../core/global-context.js';import a40_0x371e4a from'chalk';function a40_0x21b4(){const _0x7c3add=['Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a','1359fjRMMh','Error:\x20Profile\x20\x27','engage_workspace','parent_segment','.\x20Must\x20be\x20one\x20of:\x20','2858863MJipfJ','\x27\x20does\x20not\x20exist','execute','cleared','27176GvYJEf','35ofFhkQ','4WssGsE','2303082hMHmaA','1596840zFSxGo','join','description','Session\x20profile\x20set\x20to:\x20','message','includes','149449ALtthk','green','dim','61444DgsWTw','validate','Set\x20session-level\x20context','log','Session\x20llm_project\x20set\x20to:\x20','displayWithSources','profile','debug','session','use','\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context\x0a','length','Invalid\x20resource:\x20','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','llm_project','1050207eqeoUD','toString','database','(session:\x20','Session\x20parent_segment\x20set\x20to:\x20','error','Session\x20database\x20set\x20to:\x20','Session\x20engage_workspace\x20set\x20to:\x20'];a40_0x21b4=function(){return _0x7c3add;};return a40_0x21b4();}export class UseCommand extends BaseCommand{['name']=a40_0x256c5d(0xd5);[a40_0x256c5d(0xf4)]=a40_0x256c5d(0xfd);[a40_0x256c5d(0xfc)](_0x344b31){const _0x577015=a40_0x256c5d,{args:_0x1ec5a2}=_0x344b31;if(_0x1ec5a2[_0x577015(0xd7)]===0x0)return undefined;if(_0x1ec5a2[_0x577015(0xd7)]===0x1)return'Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a'+_0x577015(0xd6)+_0x577015(0xe4)+'\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a'+'\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options';const _0x2fb3b7=_0x1ec5a2[0x0],_0x5159f4=['database',_0x577015(0xe8),_0x577015(0xda),_0x577015(0xd2),'engage_workspace'];if(!_0x5159f4[_0x577015(0xf7)](_0x2fb3b7))return _0x577015(0xd8)+_0x2fb3b7+_0x577015(0xe9)+_0x5159f4[_0x577015(0xf3)](',\x20');return undefined;}async[a40_0x256c5d(0xec)](_0x306dc0){const _0x3a2f51=a40_0x256c5d,{args:_0x270331,options:_0x54d1c5}=_0x306dc0,_0x2ecdfd=_0x54d1c5[_0x3a2f51(0xd3)],_0xc8264=_0x54d1c5['clear'];cleanExpiredSessions();try{if(_0xc8264){clearSessionContext(_0x54d1c5[_0x3a2f51(0xd4)]);const _0x8f8b55=_0x54d1c5['session']||getCurrentSessionPID()[_0x3a2f51(0xdc)]();return console[_0x3a2f51(0xfe)]('Session\x20context\x20'+a40_0x371e4a[_0x3a2f51(0xf9)](_0x3a2f51(0xed))+'\x20'+a40_0x371e4a[_0x3a2f51(0xfa)]('(session:\x20'+_0x8f8b55+')')),0x0;}if(_0x270331[_0x3a2f51(0xd7)]===0x0){const _0x521ed5=new GlobalContext(_0x54d1c5);return _0x2ecdfd?_0x521ed5[_0x3a2f51(0xd1)]():_0x521ed5['display'](),console['log'](a40_0x371e4a[_0x3a2f51(0xfa)]('\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>')),console['log'](a40_0x371e4a[_0x3a2f51(0xfa)]('Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace')),0x0;}const _0x1bbbcf=_0x270331[0x0],_0x1d9c2a=_0x270331[0x1];if(_0x1bbbcf===_0x3a2f51(0xd2)){if(!profileExists(_0x1d9c2a))return console[_0x3a2f51(0xe0)](_0x3a2f51(0xe6)+_0x1d9c2a+_0x3a2f51(0xeb)),console[_0x3a2f51(0xe0)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x334f0b=_0x54d1c5[_0x3a2f51(0xd4)]||getCurrentSessionPID()[_0x3a2f51(0xdc)]();return saveSessionContext({'profile':_0x1d9c2a},_0x54d1c5[_0x3a2f51(0xd4)]),console[_0x3a2f51(0xfe)](_0x3a2f51(0xf5)+a40_0x371e4a['green'](_0x1d9c2a)+'\x20'+a40_0x371e4a[_0x3a2f51(0xfa)](_0x3a2f51(0xde)+_0x334f0b+')')),console[_0x3a2f51(0xfe)](a40_0x371e4a[_0x3a2f51(0xfa)](_0x3a2f51(0xd9))),0x0;}const _0x1e4d27={},_0x165133=_0x54d1c5['session']||getCurrentSessionPID()[_0x3a2f51(0xdc)]();switch(_0x1bbbcf){case _0x3a2f51(0xdd):_0x1e4d27[_0x3a2f51(0xdd)]=_0x1d9c2a,console[_0x3a2f51(0xfe)](_0x3a2f51(0xe1)+a40_0x371e4a[_0x3a2f51(0xf9)](_0x1d9c2a)+'\x20'+a40_0x371e4a['dim'](_0x3a2f51(0xde)+_0x165133+')'));break;case _0x3a2f51(0xe8):_0x1e4d27['parent_segment']=_0x1d9c2a,console[_0x3a2f51(0xfe)](_0x3a2f51(0xdf)+a40_0x371e4a['green'](_0x1d9c2a)+'\x20'+a40_0x371e4a['dim']('(session:\x20'+_0x165133+')'));break;case _0x3a2f51(0xda):_0x1e4d27[_0x3a2f51(0xda)]=_0x1d9c2a,console[_0x3a2f51(0xfe)](_0x3a2f51(0xd0)+a40_0x371e4a[_0x3a2f51(0xf9)](_0x1d9c2a)+'\x20'+a40_0x371e4a[_0x3a2f51(0xfa)](_0x3a2f51(0xde)+_0x165133+')'));break;case _0x3a2f51(0xe7):_0x1e4d27['engage_workspace']=_0x1d9c2a,console[_0x3a2f51(0xfe)](_0x3a2f51(0xe2)+a40_0x371e4a[_0x3a2f51(0xf9)](_0x1d9c2a)+'\x20'+a40_0x371e4a[_0x3a2f51(0xfa)]('(session:\x20'+_0x165133+')'));break;}return saveSessionContext(_0x1e4d27,_0x54d1c5[_0x3a2f51(0xd4)]),console[_0x3a2f51(0xfe)](a40_0x371e4a['dim'](_0x3a2f51(0xd9))),0x0;}catch(_0x5ce6a8){return _0x5ce6a8 instanceof Error&&console[_0x3a2f51(0xe0)](_0x3a2f51(0xe3)+_0x5ce6a8[_0x3a2f51(0xf6)]),0x1;}}}