@treasuredata/tdx 0.8.2 → 0.8.3

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 (115) 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.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/api-command.js +1 -1
  15. package/dist/commands/auth-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/context-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/llm-command.js +1 -1
  28. package/dist/commands/llm-proxy.js +1 -1
  29. package/dist/commands/parent-segment-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/segment-command.js +1 -1
  33. package/dist/commands/segment-create-command.js +1 -1
  34. package/dist/commands/segment-fields-command.js +1 -1
  35. package/dist/commands/segment-pull-command.js +1 -1
  36. package/dist/commands/segment-push-command.js +1 -1
  37. package/dist/commands/segment-update-command.js +1 -1
  38. package/dist/commands/segment-use-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/connection-cache.js +1 -1
  48. package/dist/core/credential-cache.js +1 -1
  49. package/dist/core/global-context.js +1 -1
  50. package/dist/core/keychain.js +1 -1
  51. package/dist/core/profile.js +1 -1
  52. package/dist/core/project-config.js +1 -1
  53. package/dist/core/session.js +1 -1
  54. package/dist/core/user-cache.js +1 -1
  55. package/dist/index.js +1 -1
  56. package/dist/proxy/anthropic-adapter.d.ts +11 -19
  57. package/dist/proxy/anthropic-adapter.d.ts.map +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/anthropic-adapter.js.map +1 -1
  60. package/dist/proxy/claude-usage-tracker.js +1 -1
  61. package/dist/proxy/context-signature.js +1 -1
  62. package/dist/proxy/conversation-utils.js +1 -1
  63. package/dist/proxy/conversation-utils.js.map +1 -1
  64. package/dist/proxy/server.d.ts.map +1 -1
  65. package/dist/proxy/server.js +1 -1
  66. package/dist/proxy/server.js.map +1 -1
  67. package/dist/proxy/session-cache.js +1 -1
  68. package/dist/sdk/api.js +1 -1
  69. package/dist/sdk/connection.js +1 -1
  70. package/dist/sdk/engage.js +1 -1
  71. package/dist/sdk/errors.js +1 -1
  72. package/dist/sdk/index.js +1 -1
  73. package/dist/sdk/job.js +1 -1
  74. package/dist/sdk/llm.js +1 -1
  75. package/dist/sdk/query.js +1 -1
  76. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  77. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  78. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  79. package/dist/sdk/segment.js +1 -1
  80. package/dist/sdk/user.js +1 -1
  81. package/dist/sdk/workflow.js +1 -1
  82. package/dist/types/endpoints.js +1 -1
  83. package/dist/types/index.js +1 -1
  84. package/dist/utils/agent-ref-parser.js +1 -1
  85. package/dist/utils/async.js +1 -1
  86. package/dist/utils/chat-cache.js +1 -1
  87. package/dist/utils/colors.js +1 -1
  88. package/dist/utils/command-output.js +1 -1
  89. package/dist/utils/constants.js +1 -1
  90. package/dist/utils/diff.js +1 -1
  91. package/dist/utils/fields-display.js +1 -1
  92. package/dist/utils/file-permissions.js +1 -1
  93. package/dist/utils/format-detector.js +1 -1
  94. package/dist/utils/formatters.js +1 -1
  95. package/dist/utils/json-loader.js +1 -1
  96. package/dist/utils/llm-backup-utils.js +1 -1
  97. package/dist/utils/model-aliases.js +1 -1
  98. package/dist/utils/model-factors.js +1 -1
  99. package/dist/utils/option-validation.js +1 -1
  100. package/dist/utils/port.js +1 -1
  101. package/dist/utils/process.js +1 -1
  102. package/dist/utils/prompt.js +1 -1
  103. package/dist/utils/segment-path-parser.js +1 -1
  104. package/dist/utils/segment-ref-parser.js +1 -1
  105. package/dist/utils/spinner.js +1 -1
  106. package/dist/utils/sql-parser.js +1 -1
  107. package/dist/utils/sse-parser.js +1 -1
  108. package/dist/utils/string-utils.js +1 -1
  109. package/dist/utils/table-ref-parser.js +1 -1
  110. package/dist/utils/tdx-config.js +1 -1
  111. package/dist/utils/tdx-logger.js +1 -1
  112. package/dist/utils/tree-formatter.js +1 -1
  113. package/dist/utils/version-check.js +1 -1
  114. package/dist/utils/workflow-utils.js +1 -1
  115. package/package.json +1 -1
@@ -1 +1 @@
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
+ function a33_0x24dd(){const _0x58e95e=['Resolved\x20parent\x20name:\x20','4gGtNxu','buildIdToEmailMap','1148420ZGHPps','Site:\x20','✔\x20Context\x20set:\x20','relativePath','2017170JwLYOu','\x20files\x20to\x20','from','yes','899129AMWpNB','Fetching\x20activations...','\x20segments','\x0aPull\x20summary\x20for\x20\x27','segment','Tip:\x20Set\x20context\x20with\x20`tdx\x20segment\x20use\x20<parent_name>`\x20or\x20`tdx\x20ps\x20use\x20<parent_name>`','description','absolutePath','segment:pull','attributes','error','user','38NRtUbL','all','90ngACZY','reduce','hasChanges','listSegments','17414avUBhV','filter','verbose','red','buildIdToNameMap','\x20changed\x20files','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','.yml','\x27...','\x20=\x20','Found\x20tdx.json\x20at:\x20','dirname','utf-8','Error:\x20Parent\x20segment\x20is\x20required\x0a','isNew','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)','Fetching\x20segments...','parent_segment','Fetching\x20folders...','✔\x20All\x20files\x20are\x20up\x20to\x20date','set','join','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','cyan','data','dryRun','repeat','isDirectory','Fetching\x20connections\x20for\x20name\x20resolution...','6376mQJQkm','\x20\x20Target:\x20','green','dim','\x20files?','replace','yellow','\x20activations','parentFolderId','1610913ajISuk','Fetching\x20parent\x20segment\x20info...','\x0aChanges\x20to\x20\x27','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','values','session','add','Write\x20','Parent\x20segment:\x20','get','segmentFolderId','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','then','3127470KVjPTt','push','Using\x20parent\x20segment:\x20','Fetching\x20users\x20for\x20email\x20resolution...','diff','name','execute','No\x20segments\x20found\x20in\x20parent\x20segment\x20\x27','Resolving\x20parent\x20segment\x20\x27','toLowerCase','10827WMzZul','has'];a33_0x24dd=function(){return _0x58e95e;};return a33_0x24dd();}const a33_0xcd88f=a33_0xd775;(function(_0x5666ab,_0x2af087){const _0x3382bc=a33_0xd775,_0x21bd7c=_0x5666ab();while(!![]){try{const _0xc546a4=parseInt(_0x3382bc(0x1cc))/0x1*(-parseInt(_0x3382bc(0x1c6))/0x2)+-parseInt(_0x3382bc(0x1f2))/0x3*(parseInt(_0x3382bc(0x1b0))/0x4)+parseInt(_0x3382bc(0x200))/0x5+parseInt(_0x3382bc(0x1b6))/0x6+parseInt(_0x3382bc(0x1b2))/0x7+-parseInt(_0x3382bc(0x1e9))/0x8*(-parseInt(_0x3382bc(0x1ad))/0x9)+parseInt(_0x3382bc(0x1c8))/0xa*(-parseInt(_0x3382bc(0x1ba))/0xb);if(_0xc546a4===_0x2af087)break;else _0x21bd7c['push'](_0x21bd7c['shift']());}catch(_0x235dd2){_0x21bd7c['push'](_0x21bd7c['shift']());}}}(a33_0x24dd,0x7571c));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_0x2b3860 from'chalk';import{existsSync,mkdirSync,readFileSync,writeFileSync,statSync}from'fs';import a33_0x267a4b from'path';export class SegmentPullCommand extends BaseCommand{['name']=a33_0xcd88f(0x1c2);[a33_0xcd88f(0x1c0)]='Pull\x20child\x20segments\x20to\x20YAML\x20files';async[a33_0xcd88f(0x1a9)](_0x598b68){const _0x2cce72=a33_0xcd88f,{options:_0x2b1a1f,args:_0x12a581,tdx:_0x2c26e9}=_0x598b68,_0x56abc5=_0x2b1a1f,_0x24d4c1=_0x2b1a1f['parentSegment'],_0x1c49fc=_0x12a581[0x0],_0x31c9ee=findTdxConfigPath();let _0x811a3e,_0x296c76;if(!_0x1c49fc&&_0x31c9ee){const _0x53f55d=loadTdxConfig(_0x31c9ee);_0x811a3e=_0x53f55d[_0x2cce72(0x1dd)],_0x296c76=a33_0x267a4b[_0x2cce72(0x1d7)](_0x31c9ee),_0x56abc5[_0x2cce72(0x1ce)]&&(console[_0x2cce72(0x1c4)]('Found\x20existing\x20tdx.json\x20at:\x20'+_0x31c9ee),console[_0x2cce72(0x1c4)](_0x2cce72(0x202)+_0x811a3e));}else{if(_0x1c49fc){if(existsSync(_0x1c49fc)&&statSync(_0x1c49fc)[_0x2cce72(0x1e7)]()){const _0x36f340=findTdxConfigPath(_0x1c49fc);if(_0x36f340){const _0x8918b1=loadTdxConfig(_0x36f340);_0x811a3e=_0x8918b1[_0x2cce72(0x1dd)],_0x296c76=a33_0x267a4b[_0x2cce72(0x1d7)](_0x36f340),_0x56abc5[_0x2cce72(0x1ce)]&&(console[_0x2cce72(0x1c4)](_0x2cce72(0x1d6)+_0x36f340),console[_0x2cce72(0x1c4)](_0x2cce72(0x202)+_0x811a3e));}else return console['error'](a33_0x2b3860[_0x2cce72(0x1cf)](_0x2cce72(0x1e2)+_0x1c49fc+'\x0a')),console[_0x2cce72(0x1c4)](a33_0x2b3860['cyan'](_0x2cce72(0x1f5))),0x1;}else _0x811a3e=_0x1c49fc;}else _0x811a3e=_0x24d4c1;}if(!_0x811a3e)return console['error'](a33_0x2b3860[_0x2cce72(0x1cf)](_0x2cce72(0x1d9))),console[_0x2cce72(0x1c4)](_0x2cce72(0x1db)),console[_0x2cce72(0x1c4)](_0x2cce72(0x1fe)),console[_0x2cce72(0x1c4)]('\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'),console['error'](a33_0x2b3860[_0x2cce72(0x1e3)](_0x2cce72(0x1bf))),0x1;_0x56abc5[_0x2cce72(0x1ce)]&&(console['error'](_0x2cce72(0x1b3)+_0x56abc5['site']),console[_0x2cce72(0x1c4)](_0x2cce72(0x1fa)+_0x811a3e));const _0x198a15=await withSpinner(_0x2cce72(0x1ab)+_0x811a3e+_0x2cce72(0x1d4),()=>_0x2c26e9[_0x2cce72(0x1be)]['resolveParentId'](_0x811a3e),{'verbose':_0x56abc5[_0x2cce72(0x1ce)]}),_0x127040=_0x198a15[_0x2cce72(0x1e4)],_0x470832=await withSpinner(_0x2cce72(0x1f3),()=>_0x2c26e9[_0x2cce72(0x1be)]['getParent'](_0x127040),{'verbose':_0x56abc5[_0x2cce72(0x1ce)]}),_0x497eb3=_0x470832[_0x2cce72(0x1e4)][_0x2cce72(0x1c3)]['name'];_0x56abc5[_0x2cce72(0x1ce)]&&console[_0x2cce72(0x1c4)](_0x2cce72(0x1af)+_0x497eb3);const [_0x309e7d,_0x12f309]=await Promise[_0x2cce72(0x1c7)]([withSpinner(_0x2cce72(0x1dc),()=>_0x2c26e9[_0x2cce72(0x1be)][_0x2cce72(0x1cb)](_0x127040),{'verbose':_0x56abc5[_0x2cce72(0x1ce)]}),withSpinner(_0x2cce72(0x1de),()=>_0x2c26e9[_0x2cce72(0x1be)]['listFolders'](_0x127040),{'verbose':_0x56abc5[_0x2cce72(0x1ce)]})]),_0x2f3e2b=_0x309e7d[_0x2cce72(0x1e4)],_0xf02c02=_0x12f309[_0x2cce72(0x1e4)];if(_0x2f3e2b['length']===0x0)return console['error'](a33_0x2b3860['yellow'](_0x2cce72(0x1aa)+_0x497eb3+'\x27')),0x0;const _0x52c6dc=buildFolderPathMap(_0xf02c02),_0x32166e=_0x296c76||getSegmentRootDir(sanitizeFileName(_0x811a3e)),_0x59452c=new Map();await withSpinner(_0x2cce72(0x1bb),async()=>{await batchAsync(_0x2f3e2b,async _0x33a8c5=>{const _0x256b46=a33_0xd775,_0x1d4e2b=await _0x2c26e9[_0x256b46(0x1be)]['listActivations'](_0x127040,_0x33a8c5['id']);_0x59452c[_0x256b46(0x1e0)](_0x33a8c5['id'],_0x1d4e2b);});},{'verbose':_0x56abc5[_0x2cce72(0x1ce)]});const _0x4f8cac=await withSpinner(_0x2cce72(0x1a6),()=>_0x2c26e9[_0x2cce72(0x1c5)][_0x2cce72(0x1b1)](),{'verbose':_0x56abc5[_0x2cce72(0x1ce)]})[_0x2cce72(0x1ff)](_0x4d55cb=>_0x4d55cb[_0x2cce72(0x1e4)]),_0x27e5ec=await withSpinner(_0x2cce72(0x1e8),()=>_0x2c26e9['connection'][_0x2cce72(0x1d0)](),{'verbose':_0x56abc5[_0x2cce72(0x1ce)]})[_0x2cce72(0x1ff)](_0x87cb42=>_0x87cb42[_0x2cce72(0x1e4)]),_0x448681=[],_0x4fffe8=a33_0x267a4b['join'](_0x32166e,'tdx.json'),_0x19a235=createTdxConfigContent(_0x497eb3);_0x448681['push'](prepareFile(_0x4fffe8,_0x19a235,_0x32166e));const _0x3792ff=new Map();for(const _0x2e4350 of _0x2f3e2b){const _0x3731f7=_0x2e4350[_0x2cce72(0x1fc)]?_0x52c6dc['get'](_0x2e4350[_0x2cce72(0x1fc)])||'':'',_0x2563de=_0x59452c['get'](_0x2e4350['id'])||[],_0x2e127c=segmentWithActivationsToYaml(_0x2e4350,_0x2563de,undefined,_0x4f8cac,_0x27e5ec),_0x75ecda=_0x3731f7?a33_0x267a4b[_0x2cce72(0x1e1)](_0x32166e,_0x3731f7):_0x32166e,_0x2c0801=sanitizeFileName(_0x2e4350[_0x2cce72(0x1a8)]),_0x1f91c8=getUniqueFileName(_0x75ecda,_0x2c0801,_0x3792ff),_0x3616a2=a33_0x267a4b[_0x2cce72(0x1e1)](_0x75ecda,_0x1f91c8+_0x2cce72(0x1d3)),_0x39d742=segmentToYamlString(_0x2e127c);_0x448681[_0x2cce72(0x201)](prepareFile(_0x3616a2,_0x39d742,_0x32166e));}const _0x41f90c=Array[_0x2cce72(0x1b8)](_0x59452c[_0x2cce72(0x1f6)]())[_0x2cce72(0x1c9)]((_0x1719bc,_0x22aa96)=>_0x1719bc+_0x22aa96['length'],0x0),_0x4a15e1=_0x448681['filter'](_0x116883=>_0x116883[_0x2cce72(0x1da)]),_0x146f8a=_0x448681['filter'](_0x4955cd=>!_0x4955cd[_0x2cce72(0x1da)]&&_0x4955cd['hasChanges']),_0x211451=_0x448681[_0x2cce72(0x1cd)](_0x58c2cd=>!_0x58c2cd[_0x2cce72(0x1da)]&&!_0x58c2cd[_0x2cce72(0x1ca)]);console['error'](_0x2cce72(0x1bd)+_0x497eb3+'\x27:'),console[_0x2cce72(0x1c4)]('\x20\x20'+a33_0x2b3860[_0x2cce72(0x1e3)](_0x2f3e2b['length']+_0x2cce72(0x1bc))+'\x20with\x20'+a33_0x2b3860['cyan'](_0x41f90c+_0x2cce72(0x1f0))),console['error']('\x20\x20'+a33_0x2b3860[_0x2cce72(0x1eb)]('+\x20'+_0x4a15e1[_0x2cce72(0x1fd)]+'\x20new\x20files')),console['error']('\x20\x20'+a33_0x2b3860[_0x2cce72(0x1ef)]('~\x20'+_0x146f8a[_0x2cce72(0x1fd)]+_0x2cce72(0x1d1))),console[_0x2cce72(0x1c4)]('\x20\x20'+a33_0x2b3860['dim']('=\x20'+_0x211451['length']+'\x20unchanged\x20files')),console[_0x2cce72(0x1c4)](_0x2cce72(0x1ea)+a33_0x2b3860[_0x2cce72(0x1e3)](_0x32166e)+'\x0a');if(_0x146f8a['length']>0x0)for(const _0x4e1fe8 of _0x146f8a){console['error'](_0x2cce72(0x1f4)+_0x4e1fe8[_0x2cce72(0x1b5)]+'\x27:'),console[_0x2cce72(0x1c4)]('─'[_0x2cce72(0x1e6)](0x3c)),console[_0x2cce72(0x1c4)](_0x4e1fe8[_0x2cce72(0x1a7)]),console[_0x2cce72(0x1c4)]('─'[_0x2cce72(0x1e6)](0x3c));}if(_0x56abc5[_0x2cce72(0x1e5)])return console[_0x2cce72(0x1c4)](a33_0x2b3860[_0x2cce72(0x1ef)](_0x2cce72(0x1d2))),0x0;if(_0x4a15e1[_0x2cce72(0x1fd)]===0x0&&_0x146f8a[_0x2cce72(0x1fd)]===0x0)return console[_0x2cce72(0x1c4)](a33_0x2b3860[_0x2cce72(0x1eb)](_0x2cce72(0x1df))),saveSessionContext({'parent_segment':_0x497eb3},_0x56abc5[_0x2cce72(0x1f7)]),console[_0x2cce72(0x1c4)](a33_0x2b3860[_0x2cce72(0x1eb)](_0x2cce72(0x1b4)+a33_0x2b3860[_0x2cce72(0x1ec)](_0x2cce72(0x1dd))+_0x2cce72(0x1d5)+a33_0x2b3860[_0x2cce72(0x1e3)](_0x497eb3))),0x0;if(!_0x56abc5[_0x2cce72(0x1b9)]&&(_0x4a15e1['length']>0x0||_0x146f8a[_0x2cce72(0x1fd)]>0x0)){const _0x378442=await confirmKey(_0x2cce72(0x1f9)+(_0x4a15e1[_0x2cce72(0x1fd)]+_0x146f8a[_0x2cce72(0x1fd)])+_0x2cce72(0x1ed));if(!_0x378442)return console[_0x2cce72(0x1c4)]('Aborted.'),0x1;}for(const _0x3f86ec of _0x448681){if(_0x3f86ec['isNew']||_0x3f86ec[_0x2cce72(0x1ca)]){const _0x3dc69c=a33_0x267a4b[_0x2cce72(0x1d7)](_0x3f86ec[_0x2cce72(0x1c1)]);!existsSync(_0x3dc69c)&&mkdirSync(_0x3dc69c,{'recursive':!![]}),writeFileSync(_0x3f86ec[_0x2cce72(0x1c1)],_0x3f86ec['content'],_0x2cce72(0x1d8));}}return console[_0x2cce72(0x1c4)](a33_0x2b3860['green']('✔\x20Pulled\x20'+(_0x4a15e1[_0x2cce72(0x1fd)]+_0x146f8a['length'])+_0x2cce72(0x1b7)+_0x32166e)),saveSessionContext({'parent_segment':_0x497eb3},_0x56abc5[_0x2cce72(0x1f7)]),console[_0x2cce72(0x1c4)](a33_0x2b3860[_0x2cce72(0x1eb)](_0x2cce72(0x1b4)+a33_0x2b3860['dim'](_0x2cce72(0x1dd))+_0x2cce72(0x1d5)+a33_0x2b3860[_0x2cce72(0x1e3)](_0x497eb3))),0x0;}}function buildFolderPathMap(_0x30cfdf){const _0x3f7604=a33_0xcd88f,_0x1e1e02=new Map(),_0x4b0de0=new Map();for(const _0x126e73 of _0x30cfdf){_0x4b0de0[_0x3f7604(0x1e0)](_0x126e73['id'],_0x126e73);}const _0x1c243c=new Set();for(const _0x46b2b6 of _0x30cfdf){!_0x46b2b6[_0x3f7604(0x1f1)]&&_0x1c243c[_0x3f7604(0x1f8)](_0x46b2b6['id']);}function _0x1b7a2b(_0x11476a){const _0x5a1d48=_0x3f7604;if(_0x1e1e02[_0x5a1d48(0x1ae)](_0x11476a['id']))return _0x1e1e02['get'](_0x11476a['id']);if(_0x1c243c[_0x5a1d48(0x1ae)](_0x11476a['id']))return _0x1e1e02['set'](_0x11476a['id'],''),'';if(_0x11476a[_0x5a1d48(0x1f1)]){const _0x4c0d0e=_0x4b0de0[_0x5a1d48(0x1fb)](_0x11476a[_0x5a1d48(0x1f1)]);if(_0x4c0d0e){const _0x22cf64=_0x1b7a2b(_0x4c0d0e),_0x22ff38=_0x22cf64?_0x22cf64+'/'+_0x11476a[_0x5a1d48(0x1a8)]:_0x11476a[_0x5a1d48(0x1a8)];return _0x1e1e02[_0x5a1d48(0x1e0)](_0x11476a['id'],_0x22ff38),_0x22ff38;}}const _0x2c48bc=_0x11476a['name'];return _0x1e1e02[_0x5a1d48(0x1e0)](_0x11476a['id'],_0x2c48bc),_0x2c48bc;}for(const _0x40289a of _0x30cfdf){_0x1b7a2b(_0x40289a);}return _0x1e1e02;}function sanitizeFileName(_0x4eb687){const _0x41e332=a33_0xcd88f;return _0x4eb687[_0x41e332(0x1ac)]()[_0x41e332(0x1ee)](/[/\\:*?"<>|]/g,'-')[_0x41e332(0x1ee)](/\s+/g,'-')['replace'](/-+/g,'-')[_0x41e332(0x1ee)](/^-|-$/g,'');}function a33_0xd775(_0x1306e9,_0x4cd772){_0x1306e9=_0x1306e9-0x1a6;const _0x24dd92=a33_0x24dd();let _0xd775f3=_0x24dd92[_0x1306e9];return _0xd775f3;}function getUniqueFileName(_0x311ed3,_0x6173ce,_0x450505){const _0x41b6a7=a33_0xcd88f,_0x4a4590=_0x311ed3+':'+_0x6173ce,_0x3f7bf4=_0x450505[_0x41b6a7(0x1fb)](_0x4a4590)||0x0;_0x450505['set'](_0x4a4590,_0x3f7bf4+0x1);if(_0x3f7bf4===0x0)return _0x6173ce;return _0x6173ce+'-'+_0x3f7bf4;}function prepareFile(_0x347989,_0x5a4dcc,_0x18ea41){const _0x3f7e7e=a33_0x267a4b['relative'](_0x18ea41,_0x347989);if(existsSync(_0x347989)){const _0x54111f=readFileSync(_0x347989,'utf-8'),_0x4f9ab1=generateDiff(_0x54111f,_0x5a4dcc),_0x46bbbc=hasChanges(_0x4f9ab1);return{'relativePath':_0x3f7e7e,'absolutePath':_0x347989,'content':_0x5a4dcc,'isNew':![],'hasChanges':_0x46bbbc,'diff':_0x46bbbc?formatDiffWithColors(_0x4f9ab1):undefined};}return{'relativePath':_0x3f7e7e,'absolutePath':_0x347989,'content':_0x5a4dcc,'isNew':!![],'hasChanges':![]};}
@@ -1 +1 @@
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
+ const a34_0x247e21=a34_0xe85f;(function(_0x28c67b,_0x43b0d9){const _0x1d73d3=a34_0xe85f,_0x57ac90=_0x28c67b();while(!![]){try{const _0x292d86=-parseInt(_0x1d73d3(0x200))/0x1+parseInt(_0x1d73d3(0x20d))/0x2*(-parseInt(_0x1d73d3(0x1f6))/0x3)+parseInt(_0x1d73d3(0x1a5))/0x4*(parseInt(_0x1d73d3(0x1b7))/0x5)+parseInt(_0x1d73d3(0x1cb))/0x6*(parseInt(_0x1d73d3(0x20c))/0x7)+-parseInt(_0x1d73d3(0x209))/0x8+-parseInt(_0x1d73d3(0x1f4))/0x9+parseInt(_0x1d73d3(0x1df))/0xa;if(_0x292d86===_0x43b0d9)break;else _0x57ac90['push'](_0x57ac90['shift']());}catch(_0x5ee537){_0x57ac90['push'](_0x57ac90['shift']());}}}(a34_0x1321,0x8e943));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';import a34_0x5f1c93 from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a34_0x14ebde from'path';function a34_0x1321(){const _0x338f80=['.yml','dryRun','deleteSegment','Source\x20directory:\x20','segment','parent_segment','yamlActivation','parentFolderId','listFolders','cwd','create','add','cyan','\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','parentSegment','activations','387744cakaZD','\x20updated','\x20deleted','createFolder','Error:\x20Parent\x20segment\x20is\x20required\x0a','\x20activations]','relative','connection','isNew','Updating\x20segment\x20\x27','Fetching\x20existing\x20activations...','createActivation','\x20created','length','buildIdToNameMap','updateSegmentById','Parent\x20segment:\x20','\x20\x20✔\x20Updated\x20activation\x20\x27','config','\x27...','14211410VHfZRg','.yaml','dirname','sort','red','Creating\x20activation\x20\x27','push','slice','error','✔\x20Updated\x20segment\x20\x27','resolveParentId','segmentFolderId','Creating\x20folder\x20\x27','delete','then','type','\x20segments\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Error:\x20No\x20segment\x20YAML\x20files\x20found\x20in\x20','Resolving\x20parent\x20segment\x20\x27','filter','listActivations','3477186eROiyc','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','87NiyXwN','listSegments','Site:\x20','buildUserMaps','✔\x20All\x20segments\x20and\x20activations\x20are\x20up\x20to\x20date','repeat','✔\x20Created\x20folder\x20\x27','isDirectory','split','\x0a✔\x20Push\x20complete','1014820ZiaKWK','replace','folderPath','segment:push','update','set','diff','Deleting\x20activation\x20\x27','user','5553672noWDMp','get','data','91KFvzrB','2126TZNpEF','No\x20segment\x20YAML\x20files\x20found','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20\x20✔\x20Deleted\x20activation\x20\x27','stringify','entries','activationActions','blue','existingActivation','📁\x20','yellow','\x20to\x20update','flatMap','configDir','toString','✔\x20Created\x20segment\x20\x27','green','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20files','Fetching\x20existing\x20segments...','Tip:\x20Set\x20context\x20with\x20`tdx\x20segment\x20use\x20<parent_name>`\x20or\x20`tdx\x20ps\x20use\x20<parent_name>`','site','verbose','\x20\x20Activations:','\x20\x20✔\x20Created\x20activation\x20\x27','\x20\x20\x20\x20','all','1472pwEMIo','utf-8','\x20\x20Source:\x20','existingSegment','\x20\x20Segments:\x20','\x20folders\x20to\x20create','name','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Aborted.','message','\x20\x20Activations:\x20','dim','Fetching\x20existing\x20folders...','Creating\x20segment\x20\x27','yamlConfig','Folders\x20to\x20create:','has','Updating\x20activation\x20\x27','6100vXPbkT','join','\x20segments\x20to\x20delete','hasChanges'];a34_0x1321=function(){return _0x338f80;};return a34_0x1321();}import*as a34_0x54d242 from'yaml';function sanitizeFileName(_0x217645){const _0x3d4a48=a34_0xe85f;return _0x217645['toLowerCase']()[_0x3d4a48(0x201)](/[/\\:*?"<>|]/g,'-')[_0x3d4a48(0x201)](/\s+/g,'-')[_0x3d4a48(0x201)](/-+/g,'-')[_0x3d4a48(0x201)](/^-|-$/g,'');}function tryFindTdxConfig(_0x49b125){try{return findTdxConfig(_0x49b125);}catch{return null;}}function resolveTDFolderPath(_0x443103,_0x570fcf,_0x4ce74a){if(!_0x570fcf)return _0x443103;return _0x443103?_0x4ce74a+'/'+_0x443103:_0x4ce74a;}export class SegmentPushCommand extends BaseCommand{[a34_0x247e21(0x1ab)]=a34_0x247e21(0x203);['description']=a34_0x247e21(0x20f);async['execute'](_0x5efdeb){const _0x596eda=a34_0x247e21,{options:_0x1ed5e6,args:_0x494d63,tdx:_0x20ad71}=_0x5efdeb,_0x2208ca=_0x1ed5e6,_0x37006c=_0x1ed5e6[_0x596eda(0x1c9)],_0x3c6ff0=_0x494d63[0x0];let _0x11b2c6,_0x54b6ba,_0x258825;if(_0x3c6ff0){if(existsSync(_0x3c6ff0)&&statSync(_0x3c6ff0)[_0x596eda(0x1fd)]()){const _0x3cf618=tryFindTdxConfig(_0x3c6ff0);if(_0x3cf618)_0x11b2c6=_0x3cf618[_0x596eda(0x1dd)][_0x596eda(0x1c0)],_0x54b6ba=_0x3c6ff0,_0x258825=_0x3cf618[_0x596eda(0x198)];else return console[_0x596eda(0x1e7)](a34_0x5f1c93['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x3c6ff0+'\x0a')),console[_0x596eda(0x1e7)](a34_0x5f1c93['cyan'](_0x596eda(0x1ac))),0x1;}else _0x11b2c6=_0x3c6ff0;}else{const _0x3bcce6=tryFindTdxConfig(process['cwd']());_0x3bcce6?(_0x11b2c6=_0x3bcce6['config'][_0x596eda(0x1c0)],_0x54b6ba=process[_0x596eda(0x1c4)](),_0x258825=_0x3bcce6[_0x596eda(0x198)]):_0x11b2c6=_0x37006c;}if(!_0x11b2c6)return console['error'](a34_0x5f1c93[_0x596eda(0x1e3)](_0x596eda(0x1cf))),console[_0x596eda(0x1e7)]('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[_0x596eda(0x1e7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x596eda(0x1e7)](_0x596eda(0x1c8)),console['error'](a34_0x5f1c93[_0x596eda(0x1c7)](_0x596eda(0x19e))),0x1;const _0xc1a389=_0x54b6ba||getSegmentRootDir(sanitizeFileName(_0x11b2c6)),_0x1d6f63=_0x258825||_0xc1a389,_0x3e8f13=a34_0x14ebde['relative'](_0x1d6f63,_0xc1a389),_0x28d875=_0x3e8f13!==''&&_0x3e8f13!=='.';if(!existsSync(_0xc1a389))return console['error'](a34_0x5f1c93[_0x596eda(0x1e3)]('Error:\x20Directory\x20not\x20found:\x20'+_0xc1a389+'\x0a')),console[_0x596eda(0x1e7)](a34_0x5f1c93[_0x596eda(0x1c7)](_0x596eda(0x1ac))),0x1;_0x2208ca['verbose']&&(console[_0x596eda(0x1e7)](_0x596eda(0x1f8)+_0x2208ca[_0x596eda(0x19f)]),console['error'](_0x596eda(0x1db)+_0x11b2c6),console[_0x596eda(0x1e7)](_0x596eda(0x1be)+_0xc1a389),_0x28d875&&console[_0x596eda(0x1e7)]('Scoped\x20to\x20folder:\x20'+_0x3e8f13));const _0x2193b1=await withSpinner(_0x596eda(0x1f1)+_0x11b2c6+'\x27...',()=>_0x20ad71[_0x596eda(0x1bf)][_0x596eda(0x1e9)](_0x11b2c6),{'verbose':_0x2208ca['verbose']}),_0x4e4df6=_0x2193b1[_0x596eda(0x20b)],[_0x108240,_0x185844,_0x412d9d]=await Promise[_0x596eda(0x1a4)]([withSpinner(_0x596eda(0x19d),()=>_0x20ad71['segment'][_0x596eda(0x1f7)](_0x4e4df6),{'verbose':_0x2208ca[_0x596eda(0x1a0)]}),withSpinner(_0x596eda(0x1b1),()=>_0x20ad71[_0x596eda(0x1bf)][_0x596eda(0x1c3)](_0x4e4df6),{'verbose':_0x2208ca[_0x596eda(0x1a0)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x20ad71[_0x596eda(0x208)][_0x596eda(0x1f9)](),{'verbose':_0x2208ca['verbose']})[_0x596eda(0x1ed)](_0x525b89=>_0x525b89[_0x596eda(0x20b)])]),_0x5b72d4=_0x108240[_0x596eda(0x20b)],_0x5b2e20=_0x185844[_0x596eda(0x20b)],{emailToId:_0x88e6ab,idToEmail:_0x3713e1}=_0x412d9d,[_0x34832d,_0x18a879]=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2ad455=_0x596eda,[_0x42da6e,_0x29415a]=await Promise[_0x2ad455(0x1a4)]([_0x20ad71['connection']['buildNameToIdMap'](),_0x20ad71[_0x2ad455(0x1d2)][_0x2ad455(0x1d9)]()]);return[_0x42da6e,_0x29415a];},{'verbose':_0x2208ca[_0x596eda(0x1a0)]})['then'](_0x3ca207=>_0x3ca207[_0x596eda(0x20b)]),_0x29bfe3=buildFolderPathToIdMap(_0x5b2e20),_0x18fcae=new Map();for(const [_0xd4a3cb,_0xfb14df]of _0x29bfe3[_0x596eda(0x212)]()){_0x18fcae[_0x596eda(0x205)](_0xfb14df,_0xd4a3cb);}const _0x167944=new Map();for(const _0x235644 of _0x5b72d4){const _0x286865=_0x235644[_0x596eda(0x1ea)]?_0x18fcae['get'](_0x235644[_0x596eda(0x1ea)][_0x596eda(0x199)]())||'':'',_0x38b9a2=_0x286865+':'+_0x235644[_0x596eda(0x1ab)];_0x167944[_0x596eda(0x205)](_0x38b9a2,_0x235644);}const _0x1eac55=findYamlFiles(_0xc1a389);if(_0x1eac55[_0x596eda(0x1d8)]===0x0)return console['error'](a34_0x5f1c93[_0x596eda(0x1e3)](_0x596eda(0x1f0)+_0xc1a389+'\x0a')),console[_0x596eda(0x1e7)](a34_0x5f1c93[_0x596eda(0x1c7)](_0x596eda(0x19c))),0x1;const _0x3fe49e=[];for(const _0x44258b of _0x1eac55){const _0x4b4f3=a34_0x14ebde[_0x596eda(0x1d1)](_0xc1a389,a34_0x14ebde[_0x596eda(0x1e1)](_0x44258b)),_0x528888=_0x4b4f3==='.'?'':_0x4b4f3,_0x191ccf=readFileSync(_0x44258b,_0x596eda(0x1a6));try{const _0x2dacdd=parseSegmentYamlFile(_0x191ccf);_0x3fe49e[_0x596eda(0x1e5)]({'yamlConfig':_0x2dacdd,'folderPath':_0x528888,'sourcePath':_0x44258b});}catch(_0x489f69){return console[_0x596eda(0x1e7)](a34_0x5f1c93['red']('Error\x20parsing\x20'+_0x44258b+':\x20'+(_0x489f69 instanceof Error?_0x489f69[_0x596eda(0x1ae)]:_0x489f69))),0x1;}}if(_0x3fe49e[_0x596eda(0x1d8)]===0x0)return console[_0x596eda(0x1e7)](a34_0x5f1c93[_0x596eda(0x217)](_0x596eda(0x20e))),0x0;const _0x3b47cd=new Map();_0x5b72d4[_0x596eda(0x1d8)]>0x0&&await withSpinner(_0x596eda(0x1d5),async()=>{await batchAsync(_0x5b72d4,async _0x373bc8=>{const _0x1c6e17=a34_0xe85f,_0x5631bf=await _0x20ad71['segment'][_0x1c6e17(0x1f3)](_0x4e4df6,_0x373bc8['id']);_0x3b47cd[_0x1c6e17(0x205)](_0x373bc8['id'],_0x5631bf);});},{'verbose':_0x2208ca['verbose']});const _0x3b88d9=[],_0x232cfc=new Set();for(const {yamlConfig:_0x351da1,folderPath:_0x1f9688,sourcePath:_0xb821e5}of _0x3fe49e){const _0x2d7f8c=resolveTDFolderPath(_0x1f9688,_0x28d875,_0x3e8f13),_0x39b216=_0x2d7f8c+':'+_0x351da1[_0x596eda(0x1ab)],_0x58ae80=_0x167944[_0x596eda(0x20a)](_0x39b216),_0x5475e6=_0x58ae80?_0x3b47cd['get'](_0x58ae80['id'])||[]:[];if(_0x2d7f8c&&!_0x29bfe3['has'](_0x2d7f8c)){const _0x59d2a2=_0x2d7f8c[_0x596eda(0x1fe)]('/');let _0x262d15='';for(const _0x32f221 of _0x59d2a2){_0x262d15=_0x262d15?_0x262d15+'/'+_0x32f221:_0x32f221,!_0x29bfe3[_0x596eda(0x1b5)](_0x262d15)&&_0x232cfc[_0x596eda(0x1c6)](_0x262d15);}}const _0x587128=calculateActivationActions(_0x351da1[_0x596eda(0x1ca)]||[],_0x5475e6,_0x3713e1,_0x18a879),_0x1f0426=segmentToYamlString(_0x351da1);let _0x5baa1a,_0x5b4657=![],_0x104381;if(_0x58ae80){const _0x2a2c65=segmentWithActivationsToYaml(_0x58ae80,_0x5475e6,undefined,_0x3713e1,_0x18a879),_0x1bf810=segmentToYamlString(_0x2a2c65);_0x5baa1a=generateDiff(_0x1bf810,_0x1f0426),_0x5b4657=hasChanges(_0x5baa1a),_0x5b4657&&(_0x104381=formatDiffWithColors(_0x5baa1a));}else _0x5baa1a=generateDiff('',_0x1f0426),_0x104381=formatDiffWithColors(_0x5baa1a);_0x3b88d9[_0x596eda(0x1e5)]({'relativePath':_0x351da1['name'],'absolutePath':_0xb821e5,'yamlConfig':_0x351da1,'folderPath':_0x2d7f8c,'existingSegment':_0x58ae80,'existingActivations':_0x5475e6,'isNew':!_0x58ae80,'hasChanges':_0x5b4657,'diff':_0x104381,'activationActions':_0x587128});}const _0x2cbd50=new Set();for(const {yamlConfig:_0x44ec13,folderPath:_0x2d2069}of _0x3fe49e){const _0x394f01=resolveTDFolderPath(_0x2d2069,_0x28d875,_0x3e8f13);_0x2cbd50['add'](_0x394f01+':'+_0x44ec13[_0x596eda(0x1ab)]);}const _0x1d70a2=_0x5b72d4['filter'](_0x33dc3b=>{const _0x100ac6=_0x596eda,_0xc4e936=_0x33dc3b[_0x100ac6(0x1ea)]?_0x18fcae['get'](_0x33dc3b['segmentFolderId']['toString']())||'':'',_0x2360e8=_0xc4e936+':'+_0x33dc3b['name'];if(_0x2cbd50[_0x100ac6(0x1b5)](_0x2360e8))return![];if(_0x28d875)return _0xc4e936===_0x3e8f13||_0xc4e936['startsWith'](_0x3e8f13+'/');return!![];}),_0xec7fda=_0x3b88d9[_0x596eda(0x1f2)](_0x424baa=>_0x424baa[_0x596eda(0x1d3)]),_0x3f27b6=_0x3b88d9[_0x596eda(0x1f2)](_0x11aa90=>!_0x11aa90[_0x596eda(0x1d3)]&&_0x11aa90[_0x596eda(0x1ba)]),_0x3ae575=_0x3b88d9[_0x596eda(0x1f2)](_0x6db935=>!_0x6db935[_0x596eda(0x1d3)]&&!_0x6db935[_0x596eda(0x1ba)]),_0xd2a783=Array['from'](_0x232cfc)[_0x596eda(0x1e2)](),_0x22d2d3=_0x2208ca[_0x596eda(0x1ec)]?_0x1d70a2:[],_0x6437ba=_0x3b88d9[_0x596eda(0x197)](_0x3d1dc2=>_0x3d1dc2['activationActions']),_0x3c5597=_0x6437ba[_0x596eda(0x1f2)](_0x3cb0f3=>_0x3cb0f3[_0x596eda(0x1ee)]===_0x596eda(0x1c5)),_0x430579=_0x6437ba[_0x596eda(0x1f2)](_0x2c0ddb=>_0x2c0ddb[_0x596eda(0x1ee)]===_0x596eda(0x204)),_0x215e35=_0x6437ba[_0x596eda(0x1f2)](_0x2ec056=>_0x2ec056[_0x596eda(0x1ee)]===_0x596eda(0x1ec));console[_0x596eda(0x1e7)]('\x0aPush\x20summary\x20for\x20\x27'+_0x11b2c6+'\x27:');_0xd2a783[_0x596eda(0x1d8)]>0x0&&console[_0x596eda(0x1e7)]('\x20\x20'+a34_0x5f1c93[_0x596eda(0x214)](_0x596eda(0x216)+_0xd2a783['length']+_0x596eda(0x1aa)));console[_0x596eda(0x1e7)]('\x20\x20'+a34_0x5f1c93[_0x596eda(0x19b)]('+\x20'+_0xec7fda[_0x596eda(0x1d8)]+'\x20new\x20segments')),console[_0x596eda(0x1e7)]('\x20\x20'+a34_0x5f1c93[_0x596eda(0x217)]('~\x20'+_0x3f27b6[_0x596eda(0x1d8)]+'\x20changed\x20segments'));if(_0x22d2d3[_0x596eda(0x1d8)]>0x0)console[_0x596eda(0x1e7)]('\x20\x20'+a34_0x5f1c93['red']('-\x20'+_0x22d2d3[_0x596eda(0x1d8)]+_0x596eda(0x1b9)));else _0x1d70a2[_0x596eda(0x1d8)]>0x0&&!_0x2208ca[_0x596eda(0x1ec)]&&console[_0x596eda(0x1e7)]('\x20\x20'+a34_0x5f1c93[_0x596eda(0x1b0)]('\x20\x20'+_0x1d70a2[_0x596eda(0x1d8)]+_0x596eda(0x1ef)));console[_0x596eda(0x1e7)]('\x20\x20'+a34_0x5f1c93[_0x596eda(0x1b0)]('=\x20'+_0x3ae575['length']+'\x20unchanged\x20segments'));_0x6437ba['length']>0x0&&(console[_0x596eda(0x1e7)](''),console[_0x596eda(0x1e7)](_0x596eda(0x1a1)),_0x3c5597[_0x596eda(0x1d8)]>0x0&&console[_0x596eda(0x1e7)]('\x20\x20\x20\x20'+a34_0x5f1c93['green']('+\x20'+_0x3c5597['length']+'\x20to\x20create')),_0x430579[_0x596eda(0x1d8)]>0x0&&console[_0x596eda(0x1e7)](_0x596eda(0x1a3)+a34_0x5f1c93[_0x596eda(0x217)]('~\x20'+_0x430579[_0x596eda(0x1d8)]+_0x596eda(0x196))),_0x215e35[_0x596eda(0x1d8)]>0x0&&console[_0x596eda(0x1e7)](_0x596eda(0x1a3)+a34_0x5f1c93['red']('-\x20'+_0x215e35['length']+'\x20to\x20delete')));console[_0x596eda(0x1e7)](_0x596eda(0x1a7)+a34_0x5f1c93[_0x596eda(0x1c7)](_0xc1a389)+'\x0a');if(_0xd2a783[_0x596eda(0x1d8)]>0x0){console['error'](_0x596eda(0x1b4));for(const _0x1f9b5d of _0xd2a783){console['error']('\x20\x20'+a34_0x5f1c93[_0x596eda(0x214)]('+')+'\x20'+_0x1f9b5d);}console[_0x596eda(0x1e7)]('');}if(_0xec7fda['length']>0x0)for(const _0x145f02 of _0xec7fda){const _0x24927d=_0x145f02[_0x596eda(0x202)]?_0x145f02['folderPath']+'/'+_0x145f02[_0x596eda(0x1b3)][_0x596eda(0x1ab)]:_0x145f02[_0x596eda(0x1b3)][_0x596eda(0x1ab)],_0x5aef70=_0x145f02[_0x596eda(0x1b3)][_0x596eda(0x1ca)]?.[_0x596eda(0x1d8)]||0x0,_0x4f1342=_0x5aef70>0x0?a34_0x5f1c93[_0x596eda(0x1b0)]('\x20['+_0x5aef70+'\x20activations]'):'';console[_0x596eda(0x1e7)]('\x0a'+a34_0x5f1c93[_0x596eda(0x19b)]('New\x20segment:')+'\x20'+_0x24927d+_0x4f1342),console[_0x596eda(0x1e7)]('─'[_0x596eda(0x1fb)](0x3c)),_0x145f02['diff']&&console[_0x596eda(0x1e7)](_0x145f02[_0x596eda(0x206)]),console[_0x596eda(0x1e7)]('─'['repeat'](0x3c));}if(_0x22d2d3[_0x596eda(0x1d8)]>0x0)for(const _0x7c5195 of _0x22d2d3){const _0x3579a1=_0x7c5195[_0x596eda(0x1ea)]?_0x18fcae[_0x596eda(0x20a)](_0x7c5195[_0x596eda(0x1ea)][_0x596eda(0x199)]())||'':'',_0x52d006=_0x3579a1?_0x3579a1+'/'+_0x7c5195[_0x596eda(0x1ab)]:_0x7c5195[_0x596eda(0x1ab)],_0xcb729b=_0x3b47cd[_0x596eda(0x20a)](_0x7c5195['id'])||[],_0x97a97d=_0xcb729b['length']>0x0?a34_0x5f1c93[_0x596eda(0x1b0)]('\x20['+_0xcb729b[_0x596eda(0x1d8)]+_0x596eda(0x1d0)):'';console['error']('\x0a'+a34_0x5f1c93[_0x596eda(0x1e3)]('Delete\x20segment:')+'\x20'+_0x52d006+_0x97a97d),console['error']('─'[_0x596eda(0x1fb)](0x3c));const _0x266ae5=segmentWithActivationsToYaml(_0x7c5195,_0xcb729b,undefined,_0x3713e1,_0x18a879),_0x541ee2=segmentToYamlString(_0x266ae5),_0x1d32d9=generateDiff(_0x541ee2,'');console[_0x596eda(0x1e7)](formatDiffWithColors(_0x1d32d9)),console[_0x596eda(0x1e7)]('─'[_0x596eda(0x1fb)](0x3c));}const _0x43c06c=_0x3b88d9[_0x596eda(0x1f2)](_0xb4a5=>!_0xb4a5['isNew']&&_0xb4a5['diff']);if(_0x43c06c[_0x596eda(0x1d8)]>0x0)for(const _0x5403ef of _0x43c06c){const _0x4caac6=_0x5403ef[_0x596eda(0x202)]?_0x5403ef[_0x596eda(0x202)]+'/'+_0x5403ef[_0x596eda(0x1b3)][_0x596eda(0x1ab)]:_0x5403ef[_0x596eda(0x1b3)][_0x596eda(0x1ab)];console[_0x596eda(0x1e7)]('\x0a'+a34_0x5f1c93[_0x596eda(0x217)]('Changes\x20to:')+'\x20'+_0x4caac6),console[_0x596eda(0x1e7)]('─'[_0x596eda(0x1fb)](0x3c)),console[_0x596eda(0x1e7)](_0x5403ef[_0x596eda(0x206)]),console[_0x596eda(0x1e7)]('─'['repeat'](0x3c));}if(_0x2208ca[_0x596eda(0x1bc)])return console[_0x596eda(0x1e7)](a34_0x5f1c93[_0x596eda(0x217)](_0x596eda(0x1f5))),0x0;const _0x5bb73d=_0xec7fda[_0x596eda(0x1d8)]>0x0||_0x3f27b6[_0x596eda(0x1d8)]>0x0||_0x22d2d3[_0x596eda(0x1d8)]>0x0,_0x499607=_0x6437ba['length']>0x0,_0x49d49b=_0xd2a783['length']>0x0;if(!_0x5bb73d&&!_0x499607&&!_0x49d49b)return console[_0x596eda(0x1e7)](a34_0x5f1c93['green'](_0x596eda(0x1fa))),0x0;const _0x19dc85=_0xec7fda[_0x596eda(0x1d8)]+_0x3f27b6[_0x596eda(0x1d8)]+_0x22d2d3[_0x596eda(0x1d8)]+_0xd2a783['length']+_0x6437ba['length'];if(!_0x2208ca['yes']&&_0x19dc85>0x0){const _0x10abee=await confirmKey('Push\x20'+_0x19dc85+'\x20changes?');if(!_0x10abee)return console[_0x596eda(0x1e7)](_0x596eda(0x1ad)),0x1;}for(const _0x27d5df of _0xd2a783){const _0x1313af=_0x27d5df[_0x596eda(0x1fe)]('/'),_0x499813=_0x1313af[_0x1313af[_0x596eda(0x1d8)]-0x1],_0x489922=_0x1313af[_0x596eda(0x1e6)](0x0,-0x1)[_0x596eda(0x1b8)]('/'),_0xe676ec=_0x29bfe3[_0x596eda(0x20a)](_0x489922),_0x371a5e={'name':_0x499813,'parentFolderId':_0xe676ec},_0x135b94=await withSpinner(_0x596eda(0x1eb)+_0x27d5df+'\x27...',()=>_0x20ad71[_0x596eda(0x1bf)][_0x596eda(0x1ce)](_0x4e4df6,_0x371a5e),{'verbose':_0x2208ca[_0x596eda(0x1a0)]});_0x29bfe3['set'](_0x27d5df,_0x135b94[_0x596eda(0x20b)]['id']),console[_0x596eda(0x1e7)](a34_0x5f1c93[_0x596eda(0x214)](_0x596eda(0x1fc)+_0x27d5df+'\x27'));}let _0x3ceced=0x0,_0x48ee31=0x0,_0x3295bd=0x0,_0x30b66d=0x0,_0x3d11ca=0x0,_0x392fd5=0x0;const _0x37aad9=new Map();for(const _0x232083 of _0x3b88d9){const _0x313f4e=_0x232083[_0x596eda(0x202)]?_0x29bfe3[_0x596eda(0x20a)](_0x232083[_0x596eda(0x202)]):undefined;let _0x2cc333;if(_0x232083['isNew']){const _0x302021=yamlToCreateRequest(_0x232083['yamlConfig'],_0x313f4e),_0x4c74a7=await withSpinner(_0x596eda(0x1b2)+_0x232083[_0x596eda(0x1b3)][_0x596eda(0x1ab)]+'\x27...',()=>_0x20ad71['segment']['createSegment'](_0x4e4df6,_0x302021),{'verbose':_0x2208ca['verbose']});_0x2cc333=_0x4c74a7[_0x596eda(0x20b)]['id'],_0x37aad9[_0x596eda(0x205)](_0x232083[_0x596eda(0x1b3)][_0x596eda(0x1ab)],_0x2cc333),console['error'](a34_0x5f1c93['green'](_0x596eda(0x19a)+_0x232083[_0x596eda(0x1b3)][_0x596eda(0x1ab)]+'\x27')),_0x3ceced++;}else{if(_0x232083[_0x596eda(0x1ba)]){const _0x5d06e0=yamlToUpdateRequest(_0x232083[_0x596eda(0x1b3)]);_0x313f4e!==_0x232083[_0x596eda(0x1a8)]?.[_0x596eda(0x1ea)]&&(_0x5d06e0[_0x596eda(0x1ea)]=_0x313f4e?parseInt(_0x313f4e,0xa):undefined),await withSpinner(_0x596eda(0x1d4)+_0x232083[_0x596eda(0x1b3)][_0x596eda(0x1ab)]+_0x596eda(0x1de),()=>_0x20ad71[_0x596eda(0x1bf)][_0x596eda(0x1da)](_0x4e4df6,_0x232083['existingSegment']['id'],_0x5d06e0),{'verbose':_0x2208ca[_0x596eda(0x1a0)]}),_0x2cc333=_0x232083[_0x596eda(0x1a8)]['id'],console[_0x596eda(0x1e7)](a34_0x5f1c93[_0x596eda(0x217)](_0x596eda(0x1e8)+_0x232083[_0x596eda(0x1b3)]['name']+'\x27')),_0x48ee31++;}else _0x2cc333=_0x232083[_0x596eda(0x1a8)]['id'];}for(const _0x99af04 of _0x232083[_0x596eda(0x213)]){if(_0x99af04[_0x596eda(0x1ee)]===_0x596eda(0x1c5)&&_0x99af04['yamlActivation']){const _0x2b9c7b=yamlActivationToCreateRequest(_0x99af04[_0x596eda(0x1c1)],_0x88e6ab,_0x34832d);await withSpinner(_0x596eda(0x1e4)+_0x99af04[_0x596eda(0x1ab)]+'\x27...',()=>_0x20ad71['segment'][_0x596eda(0x1d6)](_0x4e4df6,_0x2cc333,_0x2b9c7b),{'verbose':_0x2208ca[_0x596eda(0x1a0)]}),console[_0x596eda(0x1e7)](a34_0x5f1c93[_0x596eda(0x19b)](_0x596eda(0x1a2)+_0x99af04[_0x596eda(0x1ab)]+'\x27')),_0x30b66d++;}else{if(_0x99af04['type']===_0x596eda(0x204)&&_0x99af04[_0x596eda(0x1c1)]&&_0x99af04[_0x596eda(0x215)]){const _0x5d7491=yamlActivationToUpdateRequest(_0x99af04[_0x596eda(0x1c1)],_0x88e6ab,_0x34832d);await withSpinner(_0x596eda(0x1b6)+_0x99af04[_0x596eda(0x1ab)]+_0x596eda(0x1de),()=>_0x20ad71[_0x596eda(0x1bf)]['updateActivation'](_0x4e4df6,_0x2cc333,_0x99af04['existingActivation']['id'],_0x5d7491),{'verbose':_0x2208ca[_0x596eda(0x1a0)]}),console[_0x596eda(0x1e7)](a34_0x5f1c93[_0x596eda(0x217)](_0x596eda(0x1dc)+_0x99af04[_0x596eda(0x1ab)]+'\x27')),_0x3d11ca++;}else _0x99af04['type']==='delete'&&_0x99af04[_0x596eda(0x215)]&&(await withSpinner(_0x596eda(0x207)+_0x99af04['name']+_0x596eda(0x1de),()=>_0x20ad71[_0x596eda(0x1bf)]['deleteActivation'](_0x4e4df6,_0x2cc333,_0x99af04[_0x596eda(0x215)]['id']),{'verbose':_0x2208ca['verbose']}),console['error'](a34_0x5f1c93[_0x596eda(0x1e3)](_0x596eda(0x210)+_0x99af04['name']+'\x27')),_0x392fd5++);}}}for(const _0x3db667 of _0x22d2d3){await withSpinner('Deleting\x20segment\x20\x27'+_0x3db667[_0x596eda(0x1ab)]+_0x596eda(0x1de),()=>_0x20ad71['segment'][_0x596eda(0x1bd)](_0x3db667['id']),{'verbose':_0x2208ca[_0x596eda(0x1a0)]}),console[_0x596eda(0x1e7)](a34_0x5f1c93[_0x596eda(0x1e3)]('✔\x20Deleted\x20segment\x20\x27'+_0x3db667[_0x596eda(0x1ab)]+'\x27')),_0x3295bd++;}const _0x48cad7=[];if(_0x3ceced>0x0)_0x48cad7[_0x596eda(0x1e5)](_0x3ceced+_0x596eda(0x1d7));if(_0x48ee31>0x0)_0x48cad7[_0x596eda(0x1e5)](_0x48ee31+_0x596eda(0x1cc));if(_0x3295bd>0x0)_0x48cad7[_0x596eda(0x1e5)](_0x3295bd+_0x596eda(0x1cd));const _0x20f308=[];if(_0x30b66d>0x0)_0x20f308[_0x596eda(0x1e5)](_0x30b66d+_0x596eda(0x1d7));if(_0x3d11ca>0x0)_0x20f308[_0x596eda(0x1e5)](_0x3d11ca+_0x596eda(0x1cc));if(_0x392fd5>0x0)_0x20f308[_0x596eda(0x1e5)](_0x392fd5+_0x596eda(0x1cd));return console['error'](a34_0x5f1c93[_0x596eda(0x19b)](_0x596eda(0x1ff))),_0x48cad7[_0x596eda(0x1d8)]>0x0&&console[_0x596eda(0x1e7)](_0x596eda(0x1a9)+_0x48cad7['join'](',\x20')),_0x20f308['length']>0x0&&console[_0x596eda(0x1e7)](_0x596eda(0x1af)+_0x20f308[_0x596eda(0x1b8)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x146a65){const _0x2e2c29=a34_0x247e21,_0x596689=new Map(),_0x1de93f=new Map();for(const _0x45c53b of _0x146a65){_0x1de93f[_0x2e2c29(0x205)](_0x45c53b['id'],_0x45c53b);}const _0x23d2e1=new Set();for(const _0x37d54e of _0x146a65){!_0x37d54e[_0x2e2c29(0x1c2)]&&_0x23d2e1[_0x2e2c29(0x1c6)](_0x37d54e['id']);}function _0x49302a(_0x219971){const _0x12648a=_0x2e2c29;if(_0x23d2e1['has'](_0x219971['id']))return'';if(_0x219971['parentFolderId']){const _0x8edb49=_0x1de93f[_0x12648a(0x20a)](_0x219971[_0x12648a(0x1c2)]);if(_0x8edb49){const _0xf116f7=_0x49302a(_0x8edb49);return _0xf116f7?_0xf116f7+'/'+_0x219971[_0x12648a(0x1ab)]:_0x219971[_0x12648a(0x1ab)];}}return _0x219971['name'];}for(const _0x46f632 of _0x146a65){const _0x5d534c=_0x49302a(_0x46f632);_0x596689[_0x2e2c29(0x205)](_0x5d534c,_0x46f632['id']);}return _0x596689;}function a34_0xe85f(_0x354c6d,_0x32b361){_0x354c6d=_0x354c6d-0x196;const _0x132122=a34_0x1321();let _0xe85ff9=_0x132122[_0x354c6d];return _0xe85ff9;}function findYamlFiles(_0x5b59ac){const _0x4d6d6a=[];function _0x3e89b1(_0x5c0b6e){const _0x362d02=a34_0xe85f,_0x3a4108=readdirSync(_0x5c0b6e,{'withFileTypes':!![]});for(const _0x419282 of _0x3a4108){const _0xdd6e40=a34_0x14ebde[_0x362d02(0x1b8)](_0x5c0b6e,_0x419282[_0x362d02(0x1ab)]);if(_0x419282[_0x362d02(0x1fd)]())_0x3e89b1(_0xdd6e40);else(_0x419282[_0x362d02(0x1ab)]['endsWith'](_0x362d02(0x1bb))||_0x419282[_0x362d02(0x1ab)]['endsWith'](_0x362d02(0x1e0)))&&_0x4d6d6a[_0x362d02(0x1e5)](_0xdd6e40);}}return _0x3e89b1(_0x5b59ac),_0x4d6d6a;}function calculateActivationActions(_0x218e59,_0x25600a,_0xeb3dd8,_0x407c81){const _0xa42e1a=a34_0x247e21,_0x4cc088=[],_0x5e795f=new Map();for(const _0xc65895 of _0x25600a){_0x5e795f['set'](_0xc65895['name'],_0xc65895);}const _0x1b9edf=new Map();for(const _0x19f871 of _0x218e59){_0x1b9edf[_0xa42e1a(0x205)](_0x19f871[_0xa42e1a(0x1ab)],_0x19f871);}for(const _0xdf943e of _0x218e59){const _0x1017b0=_0x5e795f[_0xa42e1a(0x20a)](_0xdf943e['name']);if(!_0x1017b0)_0x4cc088['push']({'type':_0xa42e1a(0x1c5),'name':_0xdf943e['name'],'yamlActivation':_0xdf943e});else{const _0x42ffea=activationToYaml(_0x1017b0,_0xeb3dd8,_0x407c81),_0x54a117=a34_0x54d242['stringify'](_0x42ffea),_0x34c15d=a34_0x54d242[_0xa42e1a(0x211)](_0xdf943e);_0x54a117!==_0x34c15d&&_0x4cc088[_0xa42e1a(0x1e5)]({'type':_0xa42e1a(0x204),'name':_0xdf943e[_0xa42e1a(0x1ab)],'yamlActivation':_0xdf943e,'existingActivation':_0x1017b0});}}for(const _0x4d303e of _0x25600a){!_0x1b9edf['has'](_0x4d303e[_0xa42e1a(0x1ab)])&&_0x4cc088[_0xa42e1a(0x1e5)]({'type':_0xa42e1a(0x1ec),'name':_0x4d303e[_0xa42e1a(0x1ab)],'existingActivation':_0x4d303e});}return _0x4cc088;}
@@ -1 +1 @@
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
+ function a35_0x5f03(_0x13ea23,_0x3b9ab9){_0x13ea23=_0x13ea23-0x1ce;const _0x1b4088=a35_0x1b40();let _0x5f03ea=_0x1b4088[_0x13ea23];return _0x5f03ea;}const a35_0x309974=a35_0x5f03;(function(_0x256fe9,_0x5642fb){const _0x244b2e=a35_0x5f03,_0x46079e=_0x256fe9();while(!![]){try{const _0x5f4dba=parseInt(_0x244b2e(0x1f7))/0x1+parseInt(_0x244b2e(0x1e7))/0x2*(-parseInt(_0x244b2e(0x1f6))/0x3)+-parseInt(_0x244b2e(0x1d9))/0x4*(parseInt(_0x244b2e(0x1e3))/0x5)+parseInt(_0x244b2e(0x1ea))/0x6*(-parseInt(_0x244b2e(0x1de))/0x7)+-parseInt(_0x244b2e(0x1f2))/0x8+-parseInt(_0x244b2e(0x1ee))/0x9+parseInt(_0x244b2e(0x1d7))/0xa;if(_0x5f4dba===_0x5642fb)break;else _0x46079e['push'](_0x46079e['shift']());}catch(_0x30cfb6){_0x46079e['push'](_0x46079e['shift']());}}}(a35_0x1b40,0x4875b));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';import a35_0x42dbae from'chalk';function a35_0x1b40(){const _0x2b6ffe=['execute','373745fHyufT','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','\x20\x20\x20Path:\x20','folder','4xvkSUE','Examples:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','636jAzhEG','kind','verbose','yellow','1695024qaAkwh','ruleFile','✔\x20Updated\x20segment\x20\x27','type','2295208qmuKNA','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','rule','error','69294lwGlsF','1083DcrJqm','INTERNAL','data','Resolved\x20relative\x20path\x20to:\x20','segmentId','Resolved\x20type:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolved\x20folder\x20ID:\x20','updateSegmentById','\x27...','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','name','Segment\x20ID:\x20','14038820kabfvc','Updating\x20segment\x20\x27','28FiXiyP','includes','Resolving\x20folder\x20\x27','description','segment:update','4193dTwxnO','resolveFolderId','Error:\x20Cannot\x20update\x20','segment'];a35_0x1b40=function(){return _0x2b6ffe;};return a35_0x1b40();}export class SegmentUpdateCommand extends BaseCommand{[a35_0x309974(0x1d5)]=a35_0x309974(0x1dd);[a35_0x309974(0x1dc)]='Update\x20existing\x20child\x20segment';async[a35_0x309974(0x1e2)](_0x3811b7){const _0x1705c2=a35_0x309974;console[_0x1705c2(0x1f5)](a35_0x42dbae[_0x1705c2(0x1ed)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x1705c2(0x1f5)](a35_0x42dbae[_0x1705c2(0x1ed)](_0x1705c2(0x1d4)));const {options:_0x9c0f7d,args:_0x5ac9ed,tdx:_0x1a24e4}=_0x3811b7,_0x2f3593=_0x9c0f7d;if(_0x5ac9ed['length']===0x0)return console[_0x1705c2(0x1f5)](_0x1705c2(0x1f3)),console['error'](_0x1705c2(0x1d0)),console['error'](_0x1705c2(0x1e8)),console[_0x1705c2(0x1f5)](_0x1705c2(0x1e4)),console[_0x1705c2(0x1f5)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x6aa24=_0x5ac9ed[0x0],_0x10b1a4=_0x9c0f7d['segmentPath'];let _0x27d652=_0x6aa24;_0x10b1a4&&!_0x6aa24[_0x1705c2(0x1da)]('/')&&(_0x27d652=_0x10b1a4+'/'+_0x6aa24,_0x2f3593[_0x1705c2(0x1ec)]&&console[_0x1705c2(0x1f5)](_0x1705c2(0x1fa)+_0x27d652));const _0x154802=await withSpinner('Resolving\x20path\x20\x27'+_0x27d652+_0x1705c2(0x1d3),()=>_0x1a24e4['segment']['resolvePathToResource'](_0x27d652),{'verbose':_0x2f3593['verbose']}),_0x4aa5c8=_0x154802['data'];_0x2f3593[_0x1705c2(0x1ec)]&&console[_0x1705c2(0x1f5)](_0x1705c2(0x1cf)+_0x4aa5c8[_0x1705c2(0x1f1)]);if(_0x4aa5c8[_0x1705c2(0x1f1)]!==_0x1705c2(0x1e1))return console[_0x1705c2(0x1f5)](_0x1705c2(0x1e0)+_0x4aa5c8[_0x1705c2(0x1f1)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x4aa5c8[_0x1705c2(0x1ce)])throw new SDKError(ErrorCode[_0x1705c2(0x1f8)],_0x1705c2(0x1e9));const _0x579b16=_0x4aa5c8['parentId'],_0x4891a0=_0x4aa5c8['segmentId'];_0x2f3593[_0x1705c2(0x1ec)]&&(console[_0x1705c2(0x1f5)]('Parent\x20ID:\x20'+_0x579b16),console[_0x1705c2(0x1f5)](_0x1705c2(0x1d6)+_0x4891a0));let _0x15c56e;if(_0x2f3593[_0x1705c2(0x1e6)]){const _0x4434c1=_0x2f3593[_0x1705c2(0x1e6)],_0x2fd8c3=await withSpinner(_0x1705c2(0x1db)+_0x4434c1+_0x1705c2(0x1d3),()=>_0x1a24e4[_0x1705c2(0x1e1)][_0x1705c2(0x1df)](_0x579b16,_0x4434c1),{'verbose':_0x2f3593[_0x1705c2(0x1ec)]});_0x15c56e=parseInt(_0x2fd8c3['data'],0xa),_0x2f3593[_0x1705c2(0x1ec)]&&console[_0x1705c2(0x1f5)](_0x1705c2(0x1d1)+_0x15c56e);}const _0x2b0f17=await loadJSONFromOptions(_0x2f3593[_0x1705c2(0x1f4)],_0x2f3593[_0x1705c2(0x1ef)]),_0xf66264={'name':_0x2f3593['name'],'description':_0x2f3593[_0x1705c2(0x1dc)],'rule':_0x2b0f17,'kind':_0x2f3593['kind']!==undefined?parseInt(_0x2f3593[_0x1705c2(0x1eb)],0xa):undefined,'segmentFolderId':_0x15c56e},_0x13626d=await withSpinner(_0x1705c2(0x1d8)+_0x4aa5c8['segmentName']+_0x1705c2(0x1d3),()=>_0x1a24e4['segment'][_0x1705c2(0x1d2)](_0x579b16,_0x4891a0,_0xf66264),{'verbose':_0x2f3593[_0x1705c2(0x1ec)]}),_0x51dc80=_0x13626d[_0x1705c2(0x1f9)];return console[_0x1705c2(0x1f5)](_0x1705c2(0x1f0)+_0x51dc80[_0x1705c2(0x1d5)]+'\x27'),_0x27d652!==_0x6aa24&&console[_0x1705c2(0x1f5)](_0x1705c2(0x1e5)+_0x27d652),await handleSDKOutput([_0x51dc80],_0x2f3593),0x0;}}
@@ -1 +1 @@
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
+ const a36_0x5b7f9f=a36_0x251e;(function(_0x228886,_0x42f8a4){const _0x561087=a36_0x251e,_0x35ce1c=_0x228886();while(!![]){try{const _0x4bbe39=-parseInt(_0x561087(0x1f8))/0x1+-parseInt(_0x561087(0x20b))/0x2*(-parseInt(_0x561087(0x1ea))/0x3)+-parseInt(_0x561087(0x21d))/0x4+parseInt(_0x561087(0x203))/0x5+parseInt(_0x561087(0x20e))/0x6*(parseInt(_0x561087(0x201))/0x7)+-parseInt(_0x561087(0x21b))/0x8+parseInt(_0x561087(0x20a))/0x9;if(_0x4bbe39===_0x42f8a4)break;else _0x35ce1c['push'](_0x35ce1c['shift']());}catch(_0xf72b3a){_0x35ce1c['push'](_0x35ce1c['shift']());}}}(a36_0x322e,0x1d2a5));import{existsSync,statSync}from'fs';function a36_0x322e(){const _0x206729=['18273idTmnW','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','error','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Parent\x20ID:\x20','isDirectory','green','length','red','376089jGpOdW','Resolving\x20path\x20\x27','558970KvlCWe','\x27...','data','folderId','log','✔\x20Context\x20set\x20to:\x20','isAbsolute','227907awmmBQ','457706laXmGa','session','Resolved\x20relative\x20path\x20to:\x20','12EqzAVl','Examples:','Use:\x20tdx\x20segment\x20use\x20','site','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','folderPath','segment:use','Folder\x20ID:\x20','parentName','split','config','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segment','1316440TLsTLW','dim','684540mwgUFF','fullPath','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','type','Target\x20path:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','3katwzr','Site:\x20','slice','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','join','cyan','verbose','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','parentId','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','execute','Resolved\x20path\x20type:\x20'];a36_0x322e=function(){return _0x206729;};return a36_0x322e();}import a36_0x1d002c from'chalk';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_0x251e(_0x2d385c,_0x8d2b01){_0x2d385c=_0x2d385c-0x1e9;const _0x322ee3=a36_0x322e();let _0x251ebf=_0x322ee3[_0x2d385c];return _0x251ebf;}export class SegmentUseCommand extends BaseCommand{['name']=a36_0x5b7f9f(0x214);['description']=a36_0x5b7f9f(0x212);async[a36_0x5b7f9f(0x1f6)](_0x2b4e43){const _0x20fab5=a36_0x5b7f9f,{options:_0x4846e4,args:_0x202d25,tdx:_0x45c4f5}=_0x2b4e43;if(_0x202d25[_0x20fab5(0x1ff)]===0x0)return console['error'](a36_0x1d002c[_0x20fab5(0x200)]('Error:\x20Path\x20is\x20required\x0a')),console['error'](_0x20fab5(0x1f3)),console['error'](_0x20fab5(0x20f)),console[_0x20fab5(0x1fa)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x20fab5(0x1fa)](_0x20fab5(0x1ed)),console['error'](_0x20fab5(0x21f)),console[_0x20fab5(0x1fa)](_0x20fab5(0x1f1)),0x1;const _0x454480=_0x202d25[0x0],_0x120ede=_0x4846e4[_0x20fab5(0x20c)];try{if(_0x454480==='/')return saveSessionContext({'segment_path':undefined},_0x120ede),console['log'](a36_0x1d002c[_0x20fab5(0x1fe)](_0x20fab5(0x1f5))),0x0;if(existsSync(_0x454480)&&statSync(_0x454480)[_0x20fab5(0x1fd)]()){let _0x672d87;try{_0x672d87=findTdxConfig(_0x454480);}catch{return console[_0x20fab5(0x1fa)](a36_0x1d002c[_0x20fab5(0x200)](_0x20fab5(0x1f4)+_0x454480)),console['error'](a36_0x1d002c[_0x20fab5(0x1ef)](_0x20fab5(0x1f9))),0x1;}const _0x13ce47=_0x672d87[_0x20fab5(0x218)]['parent_segment'];return saveSessionContext({'segment_path':_0x13ce47,'parent_segment':_0x13ce47},_0x120ede),console[_0x20fab5(0x207)](a36_0x1d002c[_0x20fab5(0x1fe)](_0x20fab5(0x208)+a36_0x1d002c[_0x20fab5(0x1ef)](_0x13ce47))),0x0;}const _0x1520e9=_0x4846e4['segmentPath'];let _0x49fa3a=_0x454480;const _0x175249=parsePath(_0x454480);if(!_0x175249[_0x20fab5(0x209)]){if(!_0x1520e9)return console[_0x20fab5(0x1fa)](a36_0x1d002c[_0x20fab5(0x200)](_0x20fab5(0x1fb))),console[_0x20fab5(0x1fa)](a36_0x1d002c['cyan'](_0x20fab5(0x1e9))),0x1;if(_0x454480==='..'){const _0x12ca7c=_0x1520e9[_0x20fab5(0x217)]('/')[_0x20fab5(0x1ec)](0x0,-0x1)[_0x20fab5(0x1ee)]('/');_0x49fa3a=_0x12ca7c||'/';}else _0x454480==='.'?_0x49fa3a=_0x1520e9:_0x49fa3a=_0x1520e9+'/'+_0x454480;_0x4846e4[_0x20fab5(0x1f0)]&&console[_0x20fab5(0x1fa)](_0x20fab5(0x20d)+_0x49fa3a);}if(_0x49fa3a==='/'||_0x49fa3a==='')return saveSessionContext({'segment_path':undefined},_0x120ede),console['log'](a36_0x1d002c[_0x20fab5(0x1fe)](_0x20fab5(0x1f5))),0x0;_0x49fa3a=normalizePath(_0x49fa3a);const _0x4c4657=parsePath(_0x49fa3a)['segments'];if(_0x4c4657[_0x20fab5(0x1ff)]===0x0)return saveSessionContext({'segment_path':undefined},_0x120ede),console[_0x20fab5(0x207)](a36_0x1d002c[_0x20fab5(0x1fe)](_0x20fab5(0x1f5))),0x0;_0x4846e4[_0x20fab5(0x1f0)]&&(console[_0x20fab5(0x1fa)](_0x20fab5(0x1eb)+_0x4846e4[_0x20fab5(0x211)]),console[_0x20fab5(0x1fa)](_0x20fab5(0x221)+_0x49fa3a));const _0x3db3de=await withSpinner(_0x20fab5(0x202)+_0x49fa3a+_0x20fab5(0x204),()=>_0x45c4f5[_0x20fab5(0x21a)]['resolvePathToResource'](_0x49fa3a),{'verbose':_0x4846e4[_0x20fab5(0x1f0)]}),_0x3204bd=_0x3db3de[_0x20fab5(0x205)];_0x4846e4[_0x20fab5(0x1f0)]&&(console[_0x20fab5(0x1fa)](_0x20fab5(0x1f7)+_0x3204bd[_0x20fab5(0x220)]),console['error'](_0x20fab5(0x1fc)+_0x3204bd[_0x20fab5(0x1f2)]),_0x3204bd[_0x20fab5(0x206)]&&console[_0x20fab5(0x1fa)](_0x20fab5(0x215)+_0x3204bd['folderId']));if(_0x3204bd['type']===_0x20fab5(0x21a))return console[_0x20fab5(0x1fa)](a36_0x1d002c['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error'](_0x20fab5(0x219)),console['error'](a36_0x1d002c['cyan'](_0x20fab5(0x210)+_0x3204bd[_0x20fab5(0x216)]+(_0x3204bd[_0x20fab5(0x213)]?'/'+_0x3204bd[_0x20fab5(0x213)][_0x20fab5(0x1ee)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3204bd['fullPath'],'parent_segment':_0x3204bd[_0x20fab5(0x216)]},_0x120ede),console[_0x20fab5(0x207)](a36_0x1d002c['green'](_0x20fab5(0x208)+a36_0x1d002c[_0x20fab5(0x1ef)](_0x3204bd[_0x20fab5(0x21e)]))),_0x4846e4[_0x20fab5(0x1f0)]&&(console[_0x20fab5(0x1fa)](a36_0x1d002c[_0x20fab5(0x21c)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console['error'](a36_0x1d002c[_0x20fab5(0x21c)]('Use\x20\x22tdx\x20context\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x2e3b77){throw _0x2e3b77;}}}
@@ -1 +1 @@
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
+ function a37_0x9a11(){const _0x392808=['1403710USJBgk','Resolving\x20path\x20\x27','message','listWithPattern','\x20top-level\x20items','cause','\x20and\x20','parentSegment','format','Set\x20a\x20parent\x20segment\x20context\x20first:','name','site','data','27tPLKZu','4496260jhlswS','description','jsonl','segment','recursive','\x20folder','resolvePathToResource','Folder\x20ID:\x20','\x27...','330BwxNyK','4869176SBJKhS','includes','execute','Listing\x20folders\x20and\x20segments...','json','listUnified','dim','Folder/pattern\x20arg:\x20','map','test','2RgINQW','List\x20folders\x20and\x20child\x20segments','(empty)','Parent\x20ID:\x20','6tOlOSq','localeCompare','parentId','sort','Building\x20hierarchy\x20tree...','1105762bjrDCe','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','log','Site:\x20','error','\x20segment','\x5c$&','5472700pjTYHA','Resolving\x20parent\x20segment\x20\x27','Recursive\x20mode:\x20enabled','folder','length','(not\x20set)','listRecursive','No\x20items\x20match\x20pattern:\x20','filter','Parent\x20segment\x20context:\x20','folderId','verbose','replace','✔\x20Built\x20tree\x20with\x20','segments','1077927EDigFY'];a37_0x9a11=function(){return _0x392808;};return a37_0x9a11();}const a37_0x1bd8c=a37_0xeb6b;(function(_0x1c1db8,_0x210ee1){const _0x2d9a84=a37_0xeb6b,_0x54ba72=_0x1c1db8();while(!![]){try{const _0x4097d0=-parseInt(_0x2d9a84(0x1e5))/0x1*(-parseInt(_0x2d9a84(0x1ac))/0x2)+-parseInt(_0x2d9a84(0x1c2))/0x3+parseInt(_0x2d9a84(0x1b3))/0x4+-parseInt(_0x2d9a84(0x1d1))/0x5+-parseInt(_0x2d9a84(0x1a7))/0x6*(-parseInt(_0x2d9a84(0x1c3))/0x7)+-parseInt(_0x2d9a84(0x1db))/0x8+parseInt(_0x2d9a84(0x1d0))/0x9*(-parseInt(_0x2d9a84(0x1da))/0xa);if(_0x4097d0===_0x210ee1)break;else _0x54ba72['push'](_0x54ba72['shift']());}catch(_0x1de155){_0x54ba72['push'](_0x54ba72['shift']());}}}(a37_0x9a11,0xc50f8));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a37_0xeb6b(_0x4fc77e,_0x48567c){_0x4fc77e=_0x4fc77e-0x1a7;const _0x9a118e=a37_0x9a11();let _0xeb6b7c=_0x9a118e[_0x4fc77e];return _0xeb6b7c;}import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../utils/tree-formatter.js';import a37_0x3b7547 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a37_0x1bd8c(0x1c1);[a37_0x1bd8c(0x1d2)]=a37_0x1bd8c(0x1e6);async[a37_0x1bd8c(0x1dd)](_0x54c796){const _0x5cff9f=a37_0x1bd8c,{options:_0x55bae1,args:_0x496169}=_0x54c796,_0x53d089=_0x55bae1[_0x5cff9f(0x1d5)],_0x1834aa=_0x496169[0x0];try{const _0x40164c=_0x55bae1[_0x5cff9f(0x1ca)];_0x55bae1[_0x5cff9f(0x1be)]&&(console['error'](_0x5cff9f(0x1af)+_0x55bae1[_0x5cff9f(0x1ce)]),console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1bc)+(_0x40164c||_0x5cff9f(0x1b8))),_0x1834aa&&console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1e2)+_0x1834aa),_0x53d089&&console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1b5)));if(!_0x40164c)return console[_0x5cff9f(0x1b0)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1cc)),console[_0x5cff9f(0x1b0)](_0x5cff9f(0x1ad)),console[_0x5cff9f(0x1b0)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x5cff9f(0x1b0)](''),console[_0x5cff9f(0x1b0)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x35cabe=_0x1834aa&&(_0x1834aa[_0x5cff9f(0x1dc)]('*')||_0x1834aa['includes']('?'));if(_0x35cabe)return await this[_0x5cff9f(0x1c6)](_0x54c796,_0x40164c,_0x1834aa);const _0x2e9742=_0x1834aa?_0x40164c+'/'+_0x1834aa:_0x40164c;return _0x53d089?await this[_0x5cff9f(0x1b9)](_0x54c796,_0x2e9742):await this[_0x5cff9f(0x1e0)](_0x54c796,_0x2e9742);}catch(_0x285293){if(_0x285293 instanceof SDKError)return console[_0x5cff9f(0x1b0)]('Error:\x20'+_0x285293[_0x5cff9f(0x1c5)]),_0x285293['cause']&&console[_0x5cff9f(0x1b0)]('\x20\x20Cause:\x20'+_0x285293[_0x5cff9f(0x1c8)]),0x1;throw _0x285293;}}async[a37_0x1bd8c(0x1c6)](_0x385c7f,_0x32616d,_0x2c519f){const _0x4ba7f6=a37_0x1bd8c,{options:_0x109568,tdx:_0x3a4865}=_0x385c7f,_0x3eb955=await withSpinner(_0x4ba7f6(0x1b4)+_0x32616d+_0x4ba7f6(0x1d9),()=>_0x3a4865['segment'][_0x4ba7f6(0x1d7)](_0x32616d),{'verbose':_0x109568[_0x4ba7f6(0x1be)]}),_0x40c734=_0x3eb955['data'],_0x24ee75=await withSpinner(_0x4ba7f6(0x1de),()=>_0x3a4865['segment'][_0x4ba7f6(0x1e0)](_0x40c734[_0x4ba7f6(0x1a9)],_0x40c734['folderId']),{'verbose':_0x109568[_0x4ba7f6(0x1be)]}),{folders:_0x36a304,segments:_0x557fc5}=_0x24ee75[_0x4ba7f6(0x1cf)],_0x42450c=_0x2c519f[_0x4ba7f6(0x1bf)](/[.+^${}()|[\]\\]/g,_0x4ba7f6(0x1b2))[_0x4ba7f6(0x1bf)](/\*/g,'.*')[_0x4ba7f6(0x1bf)](/\?/g,'.'),_0x1bf2dd=new RegExp('^'+_0x42450c+'$','i'),_0x3fbf05=_0x36a304[_0x4ba7f6(0x1bb)](_0x48e4ee=>_0x1bf2dd[_0x4ba7f6(0x1e4)](_0x48e4ee[_0x4ba7f6(0x1cd)])),_0x1fad7f=_0x557fc5[_0x4ba7f6(0x1bb)](_0x48ca15=>_0x1bf2dd[_0x4ba7f6(0x1e4)](_0x48ca15[_0x4ba7f6(0x1cd)])),_0x274765=_0x3fbf05['length']+_0x1fad7f['length'];console[_0x4ba7f6(0x1b0)]('✔\x20Found\x20'+_0x3fbf05['length']+_0x4ba7f6(0x1d6)+(_0x3fbf05[_0x4ba7f6(0x1b7)]!==0x1?'s':'')+_0x4ba7f6(0x1c9)+_0x1fad7f['length']+_0x4ba7f6(0x1b1)+(_0x1fad7f['length']!==0x1?'s':'')+'\x20matching\x20\x27'+_0x2c519f+'\x27');if(_0x109568[_0x4ba7f6(0x1cb)]===_0x4ba7f6(0x1df)||_0x109568[_0x4ba7f6(0x1cb)]==='jsonl'){const _0x44130c=[..._0x3fbf05[_0x4ba7f6(0x1e3)](_0x4e911b=>({..._0x4e911b,'type':_0x4ba7f6(0x1b6)})),..._0x1fad7f[_0x4ba7f6(0x1e3)](_0x231f42=>({..._0x231f42,'type':_0x4ba7f6(0x1d4)}))][_0x4ba7f6(0x1aa)]((_0x28148c,_0x1291de)=>_0x28148c['name'][_0x4ba7f6(0x1a8)](_0x1291de[_0x4ba7f6(0x1cd)]));await handleSDKOutput(_0x44130c,_0x109568);}else{if(_0x274765===0x0)console[_0x4ba7f6(0x1ae)](_0x4ba7f6(0x1ba)+_0x2c519f);else{console[_0x4ba7f6(0x1ae)](a37_0x3b7547[_0x4ba7f6(0x1e1)]('['+_0x32616d+']\x20matching\x20\x27'+_0x2c519f+'\x27'));const _0x2a6410=formatFlatList(_0x3fbf05,_0x1fad7f,{'showMetadata':!![]});console['log'](_0x2a6410);}}return 0x0;}async[a37_0x1bd8c(0x1e0)](_0xe51b97,_0x289873){const _0x479a49=a37_0x1bd8c,{options:_0xf58c68,tdx:_0x78484f}=_0xe51b97,_0x12a503=await withSpinner(_0x479a49(0x1c4)+_0x289873+'\x27...',()=>_0x78484f['segment'][_0x479a49(0x1d7)](_0x289873),{'verbose':_0xf58c68[_0x479a49(0x1be)]}),_0x2a2c92=_0x12a503[_0x479a49(0x1cf)];_0xf58c68[_0x479a49(0x1be)]&&(console['error']('Parent\x20ID:\x20'+_0x2a2c92[_0x479a49(0x1a9)]),_0x2a2c92[_0x479a49(0x1bd)]&&console[_0x479a49(0x1b0)](_0x479a49(0x1d8)+_0x2a2c92[_0x479a49(0x1bd)]));const _0x11ef13=await withSpinner('Listing\x20folders\x20and\x20segments...',()=>_0x78484f[_0x479a49(0x1d4)][_0x479a49(0x1e0)](_0x2a2c92['parentId'],_0x2a2c92[_0x479a49(0x1bd)]),{'verbose':_0xf58c68['verbose']}),{folders:_0x43b342,segments:_0x57a2c8}=_0x11ef13[_0x479a49(0x1cf)],_0x5e2899=_0x43b342[_0x479a49(0x1b7)]+_0x57a2c8[_0x479a49(0x1b7)];console['error']('✔\x20Found\x20'+_0x43b342[_0x479a49(0x1b7)]+'\x20folder'+(_0x43b342[_0x479a49(0x1b7)]!==0x1?'s':'')+_0x479a49(0x1c9)+_0x57a2c8[_0x479a49(0x1b7)]+'\x20segment'+(_0x57a2c8[_0x479a49(0x1b7)]!==0x1?'s':''));if(_0xf58c68[_0x479a49(0x1cb)]==='json'||_0xf58c68[_0x479a49(0x1cb)]===_0x479a49(0x1d3)){const _0x1c02aa=[..._0x43b342['map'](_0x5aa05c=>({..._0x5aa05c,'type':_0x479a49(0x1b6)})),..._0x57a2c8[_0x479a49(0x1e3)](_0x135d6e=>({..._0x135d6e,'type':'segment'}))][_0x479a49(0x1aa)]((_0x772996,_0x43df46)=>_0x772996[_0x479a49(0x1cd)][_0x479a49(0x1a8)](_0x43df46['name']));await handleSDKOutput(_0x1c02aa,_0xf58c68);}else{if(_0x5e2899===0x0)console[_0x479a49(0x1ae)](a37_0x3b7547[_0x479a49(0x1e1)]('['+_0x289873+']')),console[_0x479a49(0x1ae)](_0x479a49(0x1e7));else{console[_0x479a49(0x1ae)](a37_0x3b7547[_0x479a49(0x1e1)]('['+_0x289873+']'));const _0x202084=formatFlatList(_0x43b342,_0x57a2c8,{'showMetadata':!![]});console[_0x479a49(0x1ae)](_0x202084);}}return 0x0;}async[a37_0x1bd8c(0x1b9)](_0x3ae208,_0xe7bd9e){const _0x3bf8e1=a37_0x1bd8c,{options:_0x3e1517,tdx:_0x56e350}=_0x3ae208,_0x5b049c=await withSpinner(_0x3bf8e1(0x1c4)+_0xe7bd9e+_0x3bf8e1(0x1d9),()=>_0x56e350[_0x3bf8e1(0x1d4)]['resolvePathToResource'](_0xe7bd9e),{'verbose':_0x3e1517[_0x3bf8e1(0x1be)]}),_0x147730=_0x5b049c[_0x3bf8e1(0x1cf)];_0x3e1517['verbose']&&(console[_0x3bf8e1(0x1b0)](_0x3bf8e1(0x1e8)+_0x147730[_0x3bf8e1(0x1a9)]),_0x147730[_0x3bf8e1(0x1bd)]&&console[_0x3bf8e1(0x1b0)](_0x3bf8e1(0x1d8)+_0x147730[_0x3bf8e1(0x1bd)]));const _0xe143d=_0x3e1517['maxDepth']||0xa,_0xa7273e=await withSpinner(_0x3bf8e1(0x1ab),()=>_0x56e350['segment']['listRecursive'](_0x147730[_0x3bf8e1(0x1a9)],_0x147730[_0x3bf8e1(0x1bd)],0x0,_0xe143d),{'verbose':_0x3e1517[_0x3bf8e1(0x1be)]}),_0x127407=_0xa7273e['data'];console[_0x3bf8e1(0x1b0)](_0x3bf8e1(0x1c0)+_0x127407[_0x3bf8e1(0x1b7)]+_0x3bf8e1(0x1c7));if(_0x3e1517[_0x3bf8e1(0x1cb)]===_0x3bf8e1(0x1df)||_0x3e1517[_0x3bf8e1(0x1cb)]===_0x3bf8e1(0x1d3))await handleSDKOutput(_0x127407,_0x3e1517);else{console[_0x3bf8e1(0x1ae)](a37_0x3b7547[_0x3bf8e1(0x1e1)]('['+_0xe7bd9e+']'));const _0x4153b9=formatTree(_0x127407,{'showMetadata':!![]});console[_0x3bf8e1(0x1ae)](_0x4153b9);}return 0x0;}}
@@ -1 +1 @@
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
+ const a38_0x5a833c=a38_0xfed1;function a38_0x5484(){const _0x2e774d=['Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','data','3619233pjAwbv','table','name','40576gubmyf','420827lETtQa','1538481rHsXNO','110TFXGND','409746NFsuWf','Querying\x20','length','site','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','\x20\x20Cause:\x20','error','execute','database','Usage:\x20tdx\x20show\x20<database.table>','query','✔\x20Retrieved\x20','315455xxGFYn','cause','Catalog:\x20','8HzwICl','Limit:\x20','args','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','show','6ThnKHo','catalog','\x20from\x20','Error:\x20','...','showTable','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','message','limit','\x20row','Site:\x20','12RgpbmN','2611040mEHvBn','description'];a38_0x5484=function(){return _0x2e774d;};return a38_0x5484();}(function(_0x279e26,_0x1576fd){const _0x115bf6=a38_0xfed1,_0x12a9e0=_0x279e26();while(!![]){try{const _0x181d63=-parseInt(_0x115bf6(0x18d))/0x1+-parseInt(_0x115bf6(0x189))/0x2*(-parseInt(_0x115bf6(0x17f))/0x3)+parseInt(_0x115bf6(0x180))/0x4+-parseInt(_0x115bf6(0x199))/0x5+-parseInt(_0x115bf6(0x1a1))/0x6*(-parseInt(_0x115bf6(0x18b))/0x7)+parseInt(_0x115bf6(0x19c))/0x8*(parseInt(_0x115bf6(0x186))/0x9)+-parseInt(_0x115bf6(0x18c))/0xa*(parseInt(_0x115bf6(0x18a))/0xb);if(_0x181d63===_0x1576fd)break;else _0x12a9e0['push'](_0x12a9e0['shift']());}catch(_0x46370d){_0x12a9e0['push'](_0x12a9e0['shift']());}}}(a38_0x5484,0x70d58));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';function a38_0xfed1(_0x2c150f,_0x402cce){_0x2c150f=_0x2c150f-0x17d;const _0x548450=a38_0x5484();let _0xfed1d7=_0x548450[_0x2c150f];return _0xfed1d7;}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class ShowCommand extends BaseCommand{[a38_0x5a833c(0x188)]=a38_0x5a833c(0x1a0);[a38_0x5a833c(0x181)]='Show\x20table\x20contents';async[a38_0x5a833c(0x194)](_0x5db902){const _0x53866a=a38_0x5a833c;return this[_0x53866a(0x1a6)](_0x5db902);}async['showTable'](_0x15396b){const _0x4a9f42=a38_0x5a833c,{options:_0x3b924c,args:_0x6334e5,tdx:_0x32ca37}=_0x15396b;let _0x23c81c;try{_0x23c81c=parseTableReference(_0x6334e5[0x0]);const _0x558518=_0x3b924c[_0x4a9f42(0x195)];!_0x23c81c['database']&&_0x558518&&(_0x23c81c['database']=_0x558518);const _0xd8ab4b=validateTableDescribeReference(_0x23c81c);if(_0xd8ab4b)return console[_0x4a9f42(0x193)]('Error:\x20'+_0xd8ab4b),console[_0x4a9f42(0x193)](_0x4a9f42(0x196)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x4a9f42(0x193)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x55f681){return console[_0x4a9f42(0x193)](_0x4a9f42(0x1a4)+_0x55f681[_0x4a9f42(0x1a8)]),console[_0x4a9f42(0x193)](_0x4a9f42(0x196)),console[_0x4a9f42(0x193)](_0x4a9f42(0x183)),console[_0x4a9f42(0x193)](_0x4a9f42(0x19f)),0x1;}const _0x5b4995=_0x23c81c[_0x4a9f42(0x1a2)],_0x2355d5=_0x23c81c[_0x4a9f42(0x195)],_0x390c77=_0x23c81c[_0x4a9f42(0x187)],_0x3bc5e7=resolveLimit(_0x3b924c[_0x4a9f42(0x1a9)],DEFAULT_DISPLAY_LIMIT);try{_0x3b924c[_0x4a9f42(0x184)]&&(console[_0x4a9f42(0x193)](_0x4a9f42(0x17e)+_0x3b924c[_0x4a9f42(0x190)]),_0x5b4995&&console[_0x4a9f42(0x193)](_0x4a9f42(0x19b)+_0x5b4995),console['error']('Database:\x20'+_0x2355d5),console[_0x4a9f42(0x193)]('Table:\x20'+_0x390c77),console[_0x4a9f42(0x193)](_0x4a9f42(0x19d)+_0x3bc5e7));const _0x5ac9a6=_0x5b4995?_0x5b4995+'.'+_0x2355d5+'.'+_0x390c77:_0x2355d5+'.'+_0x390c77,_0x599bd2=await withSpinner(_0x4a9f42(0x18e)+_0x5ac9a6+_0x4a9f42(0x1a5),()=>_0x32ca37[_0x4a9f42(0x197)][_0x4a9f42(0x1a6)](_0x2355d5,_0x390c77,_0x3bc5e7,_0x5b4995),{'verbose':_0x3b924c['verbose']}),_0x2038e2=_0x599bd2[_0x4a9f42(0x185)],_0x38fde2=_0x2038e2[_0x4a9f42(0x185)];return _0x38fde2[_0x4a9f42(0x18f)]===0x0?console[_0x4a9f42(0x193)](_0x4a9f42(0x1a7)):console[_0x4a9f42(0x193)](_0x4a9f42(0x198)+_0x38fde2[_0x4a9f42(0x18f)]+_0x4a9f42(0x17d)+(_0x38fde2[_0x4a9f42(0x18f)]!==0x1?'s':'')+_0x4a9f42(0x1a3)+_0x5ac9a6),await handleSDKOutput(_0x38fde2,_0x3b924c),0x0;}catch(_0x125562){if(_0x125562 instanceof SDKError)return console[_0x4a9f42(0x193)](_0x4a9f42(0x1a4)+_0x125562['message']),_0x125562[_0x4a9f42(0x19a)]&&console[_0x4a9f42(0x193)](_0x4a9f42(0x192)+_0x125562['cause']),0x1;throw _0x125562;}}['validate'](_0x41fa42){const _0x5d97e5=a38_0x5a833c;if(_0x41fa42[_0x5d97e5(0x19e)][_0x5d97e5(0x18f)]===0x0)return _0x5d97e5(0x182);if(_0x41fa42[_0x5d97e5(0x19e)][_0x5d97e5(0x18f)]>0x1)return _0x5d97e5(0x191);return undefined;}}
@@ -1 +1 @@
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
+ const a39_0x237ccd=a39_0x5051;(function(_0x1a7c1f,_0x8d4533){const _0x5b5044=a39_0x5051,_0x59f6fb=_0x1a7c1f();while(!![]){try{const _0x2b4fc9=parseInt(_0x5b5044(0x11c))/0x1*(-parseInt(_0x5b5044(0x128))/0x2)+parseInt(_0x5b5044(0x109))/0x3*(parseInt(_0x5b5044(0x139))/0x4)+-parseInt(_0x5b5044(0x123))/0x5*(-parseInt(_0x5b5044(0x125))/0x6)+parseInt(_0x5b5044(0x11d))/0x7+-parseInt(_0x5b5044(0x110))/0x8*(-parseInt(_0x5b5044(0x108))/0x9)+parseInt(_0x5b5044(0x138))/0xa*(-parseInt(_0x5b5044(0x10e))/0xb)+parseInt(_0x5b5044(0x124))/0xc;if(_0x2b4fc9===_0x8d4533)break;else _0x59f6fb['push'](_0x59f6fb['shift']());}catch(_0x4ce54f){_0x59f6fb['push'](_0x59f6fb['shift']());}}}(a39_0x3bcb,0xbf9e3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a39_0x5051(_0x199ddf,_0x3f1708){_0x199ddf=_0x199ddf-0x106;const _0x3bcb9b=a39_0x3bcb();let _0x505172=_0x3bcb9b[_0x199ddf];return _0x505172;}function a39_0x3bcb(){const _0x4019ae=['\x27\x20is\x20ambiguous.','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb','Database:\x20all','5228970EAgLKe','18314940kgLvSS','6gwHBld','✔\x20Found\x20','includes','564aFDgyZ','tables','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Site:\x20','error','\x20\x20Use:\x20tdx\x20tables\x20\x22','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Listing\x20tables...','.*\x22','\x20table','execute','verbose','database','limit','Error:\x20','cause','4990ofBHxi','16qDPakn','Error:\x20Pattern\x20\x27','length','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','1287027iwbHYG','363021ZHUobH','site','listTables','List\x20tables\x20in\x20a\x20database','Note:\x20\x27','33231fFgZpW','data','16sfJvkV','Table\x20pattern:\x20','description','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Database\x20pattern:\x20','\x20\x20Cause:\x20','table','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','validate','message','Database\x20\x27','4435cFZLYU','1406601oyDyre','✖\x20No\x20tables\x20found','Database:\x20'];a39_0x3bcb=function(){return _0x4019ae;};return a39_0x3bcb();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{['name']=a39_0x237ccd(0x129);[a39_0x237ccd(0x112)]=a39_0x237ccd(0x10c);async[a39_0x237ccd(0x132)](_0xd1022b){const _0x392b74=a39_0x237ccd,{options:_0x4cb1e5,args:_0x1ab8db,tdx:_0x406bfd}=_0xd1022b;let _0x2703af;if(_0x1ab8db[_0x392b74(0x106)]===0x0)_0x2703af={'database':undefined,'table':undefined,'original':''};else{if(_0x1ab8db['length']===0x1)try{_0x2703af=parseTableReference(_0x1ab8db[0x0]);if(_0x2703af[_0x392b74(0x116)]&&!_0x2703af['database']&&!_0x2703af[_0x392b74(0x116)][_0x392b74(0x127)]('*')&&!_0x2703af[_0x392b74(0x116)][_0x392b74(0x127)]('?'))return console[_0x392b74(0x12c)](_0x392b74(0x13a)+_0x1ab8db[0x0]+_0x392b74(0x120)),console[_0x392b74(0x12c)](_0x392b74(0x117)+_0x2703af[_0x392b74(0x116)]+'\x27?'),console[_0x392b74(0x12c)](_0x392b74(0x12d)+_0x2703af[_0x392b74(0x116)]+_0x392b74(0x130)),console['error'](_0x392b74(0x118)+_0x2703af[_0x392b74(0x116)]),console['error'](_0x392b74(0x12e)+_0x2703af[_0x392b74(0x116)]),console[_0x392b74(0x12c)](''),console[_0x392b74(0x12c)](_0x392b74(0x10d)+_0x1ab8db[0x0]+_0x392b74(0x12a)+_0x2703af['table']+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x4e2c6d){return console[_0x392b74(0x12c)](_0x392b74(0x136)+_0x4e2c6d[_0x392b74(0x11a)]),0x1;}else return console['error']('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x392b74(0x12c)]('\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases'),console[_0x392b74(0x12c)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console['error'](_0x392b74(0x121)),console[_0x392b74(0x12c)](_0x392b74(0x113)),console['error']('Or\x20use\x20--in\x20flag:'),console[_0x392b74(0x12c)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x5cb57e=_0x4cb1e5[_0x392b74(0x134)];!_0x2703af['database']&&_0x5cb57e&&(_0x2703af[_0x392b74(0x134)]=_0x5cb57e);try{const _0x5a077c=_0x54cbe7=>_0x54cbe7&&(_0x54cbe7['includes']('*')||_0x54cbe7[_0x392b74(0x127)]('?')),_0x143226=_0x5a077c(_0x2703af['database']);_0x4cb1e5[_0x392b74(0x133)]&&(console[_0x392b74(0x12c)](_0x392b74(0x12b)+_0x4cb1e5[_0x392b74(0x10a)]),_0x2703af[_0x392b74(0x134)]?_0x143226?console[_0x392b74(0x12c)](_0x392b74(0x114)+_0x2703af['database']):console[_0x392b74(0x12c)](_0x392b74(0x11f)+_0x2703af[_0x392b74(0x134)]):console[_0x392b74(0x12c)](_0x392b74(0x122)),_0x2703af[_0x392b74(0x116)]&&console[_0x392b74(0x12c)](_0x392b74(0x111)+_0x2703af[_0x392b74(0x116)]));const _0x47f153=_0x2703af[_0x392b74(0x134)]&&!_0x143226?_0x2703af[_0x392b74(0x134)]:undefined,_0x54b936=_0x143226?_0x2703af[_0x392b74(0x134)]:undefined,_0x5a0e09=_0x2703af[_0x392b74(0x116)],_0x52baaa=resolveLimit(_0x4cb1e5[_0x392b74(0x135)],DEFAULT_LISTING_LIMIT),_0x1bbc83=await withSpinner(_0x392b74(0x12f),()=>_0x406bfd['query'][_0x392b74(0x10b)](_0x47f153,_0x5a0e09,_0x54b936,_0x52baaa),{'verbose':_0x4cb1e5[_0x392b74(0x133)]}),_0x1189a5=_0x1bbc83[_0x392b74(0x10f)];if(_0x1189a5['length']===0x0&&_0x2703af['database']&&!_0x143226)return console[_0x392b74(0x12c)](_0x392b74(0x11e)),console[_0x392b74(0x12c)](_0x392b74(0x11b)+_0x2703af[_0x392b74(0x134)]+_0x392b74(0x107)),0x1;return console[_0x392b74(0x12c)](_0x392b74(0x126)+_0x1189a5[_0x392b74(0x106)]+_0x392b74(0x131)+(_0x1189a5['length']!==0x1?'s':'')),await handleSDKOutput(_0x1189a5,{..._0x4cb1e5,'limit':_0x52baaa}),0x0;}catch(_0x5ef81a){if(_0x5ef81a instanceof SDKError)return console[_0x392b74(0x12c)](_0x392b74(0x136)+_0x5ef81a['message']),_0x5ef81a[_0x392b74(0x137)]&&console[_0x392b74(0x12c)](_0x392b74(0x115)+_0x5ef81a[_0x392b74(0x137)]),0x1;throw _0x5ef81a;}}[a39_0x237ccd(0x119)](_0x1660ee){return undefined;}}
@@ -1 +1 @@
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;}}}
1
+ const a40_0x2df415=a40_0x5024;(function(_0x567ec4,_0x1674d9){const _0x3fc9b9=a40_0x5024,_0x4bdd3c=_0x567ec4();while(!![]){try{const _0x3076e0=parseInt(_0x3fc9b9(0x1c3))/0x1+parseInt(_0x3fc9b9(0x1d1))/0x2+-parseInt(_0x3fc9b9(0x1c7))/0x3*(-parseInt(_0x3fc9b9(0x1e3))/0x4)+parseInt(_0x3fc9b9(0x1ca))/0x5*(parseInt(_0x3fc9b9(0x1ea))/0x6)+-parseInt(_0x3fc9b9(0x1be))/0x7*(parseInt(_0x3fc9b9(0x1e0))/0x8)+parseInt(_0x3fc9b9(0x1c9))/0x9+parseInt(_0x3fc9b9(0x1d6))/0xa*(-parseInt(_0x3fc9b9(0x1cf))/0xb);if(_0x3076e0===_0x1674d9)break;else _0x4bdd3c['push'](_0x4bdd3c['shift']());}catch(_0x4797a6){_0x4bdd3c['push'](_0x4bdd3c['shift']());}}}(a40_0x6563,0xd465f));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';function a40_0x6563(){const _0x19afb4=['\x27\x20does\x20not\x20exist','147228ihadbF','Session\x20llm_project\x20set\x20to:\x20','11457981FctXpY','185QJpvOc','llm_project','Session\x20engage_workspace\x20set\x20to:\x20','.\x20Must\x20be\x20one\x20of:\x20','\x0aSet\x20context:\x20tdx\x20use\x20<resource>\x20<value>','11YZwzAG','message','301842xpREOa','green','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','toString','(session:\x20','39756590ETZZPn','display','description','log','\x0aRun\x20\x27tdx\x20use\x20--help\x27\x20for\x20more\x20options','join','Session\x20parent_segment\x20set\x20to:\x20','Resources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace','session','Invalid\x20resource:\x20','2792ZoRXUj','engage_workspace','\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','104ZeOGwb','length','profile','Error:\x20','displayWithSources','Error:\x20Profile\x20\x27','Session\x20database\x20set\x20to:\x20','249864ftwLqB','use','Usage:\x20tdx\x20use\x20<resource>\x20<value>\x0a','debug','18053oQdpTk','dim','error','parent_segment','validate','1504879QJqHfh','\x0aResources:\x20database,\x20parent_segment,\x20llm_project,\x20profile,\x20engage_workspace\x0a','includes'];a40_0x6563=function(){return _0x19afb4;};return a40_0x6563();}function a40_0x5024(_0x3a0b1d,_0x33a1c3){_0x3a0b1d=_0x3a0b1d-0x1bc;const _0x65632e=a40_0x6563();let _0x502427=_0x65632e[_0x3a0b1d];return _0x502427;}import a40_0x23b7bf from'chalk';export class UseCommand extends BaseCommand{['name']=a40_0x2df415(0x1eb);[a40_0x2df415(0x1d8)]='Set\x20session-level\x20context';[a40_0x2df415(0x1c2)](_0x4d086c){const _0x227dd3=a40_0x2df415,{args:_0x4871e7}=_0x4d086c;if(_0x4871e7[_0x227dd3(0x1e4)]===0x0)return undefined;if(_0x4871e7['length']===0x1)return _0x227dd3(0x1bc)+_0x227dd3(0x1e2)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20use\x20--clear\x20\x20\x20\x20\x20\x20#\x20Clear\x20session\x20context\x0a'+_0x227dd3(0x1c4)+_0x227dd3(0x1da);const _0x17be3b=_0x4871e7[0x0],_0x595515=['database',_0x227dd3(0x1c1),_0x227dd3(0x1cb),_0x227dd3(0x1e5),_0x227dd3(0x1e1)];if(!_0x595515[_0x227dd3(0x1c5)](_0x17be3b))return _0x227dd3(0x1df)+_0x17be3b+_0x227dd3(0x1cd)+_0x595515[_0x227dd3(0x1db)](',\x20');return undefined;}async['execute'](_0x40479b){const _0x22d210=a40_0x2df415,{args:_0xd2cd79,options:_0x4de33e}=_0x40479b,_0x2e8e53=_0x4de33e[_0x22d210(0x1bd)],_0x2cf97b=_0x4de33e['clear'];cleanExpiredSessions();try{if(_0x2cf97b){clearSessionContext(_0x4de33e['session']);const _0x5e5984=_0x4de33e[_0x22d210(0x1de)]||getCurrentSessionPID()['toString']();return console[_0x22d210(0x1d9)]('Session\x20context\x20'+a40_0x23b7bf['green']('cleared')+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)]('(session:\x20'+_0x5e5984+')')),0x0;}if(_0xd2cd79[_0x22d210(0x1e4)]===0x0){const _0x26a464=new GlobalContext(_0x4de33e);return _0x2e8e53?_0x26a464[_0x22d210(0x1e7)]():_0x26a464[_0x22d210(0x1d7)](),console[_0x22d210(0x1d9)](a40_0x23b7bf['dim'](_0x22d210(0x1ce))),console[_0x22d210(0x1d9)](a40_0x23b7bf['dim'](_0x22d210(0x1dd))),0x0;}const _0x5463af=_0xd2cd79[0x0],_0x5c3a98=_0xd2cd79[0x1];if(_0x5463af==='profile'){if(!profileExists(_0x5c3a98))return console[_0x22d210(0x1c0)](_0x22d210(0x1e8)+_0x5c3a98+_0x22d210(0x1c6)),console[_0x22d210(0x1c0)]('\x0aUse\x20\x27tdx\x20profiles\x27\x20to\x20see\x20available\x20profiles'),0x1;const _0x11215d=_0x4de33e['session']||getCurrentSessionPID()[_0x22d210(0x1d4)]();return saveSessionContext({'profile':_0x5c3a98},_0x4de33e[_0x22d210(0x1de)]),console[_0x22d210(0x1d9)]('Session\x20profile\x20set\x20to:\x20'+a40_0x23b7bf[_0x22d210(0x1d2)](_0x5c3a98)+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d5)+_0x11215d+')')),console['log'](a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d3))),0x0;}const _0x27c3ee={},_0x4482df=_0x4de33e[_0x22d210(0x1de)]||getCurrentSessionPID()['toString']();switch(_0x5463af){case'database':_0x27c3ee['database']=_0x5c3a98,console['log'](_0x22d210(0x1e9)+a40_0x23b7bf[_0x22d210(0x1d2)](_0x5c3a98)+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d5)+_0x4482df+')'));break;case'parent_segment':_0x27c3ee[_0x22d210(0x1c1)]=_0x5c3a98,console['log'](_0x22d210(0x1dc)+a40_0x23b7bf[_0x22d210(0x1d2)](_0x5c3a98)+'\x20'+a40_0x23b7bf['dim'](_0x22d210(0x1d5)+_0x4482df+')'));break;case'llm_project':_0x27c3ee[_0x22d210(0x1cb)]=_0x5c3a98,console['log'](_0x22d210(0x1c8)+a40_0x23b7bf['green'](_0x5c3a98)+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)]('(session:\x20'+_0x4482df+')'));break;case _0x22d210(0x1e1):_0x27c3ee[_0x22d210(0x1e1)]=_0x5c3a98,console['log'](_0x22d210(0x1cc)+a40_0x23b7bf[_0x22d210(0x1d2)](_0x5c3a98)+'\x20'+a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d5)+_0x4482df+')'));break;}return saveSessionContext(_0x27c3ee,_0x4de33e[_0x22d210(0x1de)]),console[_0x22d210(0x1d9)](a40_0x23b7bf[_0x22d210(0x1bf)](_0x22d210(0x1d3))),0x0;}catch(_0x5297c5){return _0x5297c5 instanceof Error&&console[_0x22d210(0x1c0)](_0x22d210(0x1e6)+_0x5297c5[_0x22d210(0x1d0)]),0x1;}}}