@treasuredata/tdx 0.14.2 → 0.14.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 (145) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/api-command.js +1 -1
  8. package/dist/commands/auth-command.d.ts.map +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-command.js +1 -1
  20. package/dist/commands/job-command.js +1 -1
  21. package/dist/commands/journey-command.js +1 -1
  22. package/dist/commands/journey-validate-command.js +1 -1
  23. package/dist/commands/llm-command.js +1 -1
  24. package/dist/commands/llm-proxy.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.js +1 -1
  43. package/dist/core/auth.js +1 -1
  44. package/dist/core/command-output.js +1 -1
  45. package/dist/core/config.js +1 -1
  46. package/dist/core/connection-cache.js +1 -1
  47. package/dist/core/constants.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.d.ts +15 -0
  52. package/dist/core/profile.d.ts.map +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/profile.js.map +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/core/version.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/proxy/anthropic-adapter.js +1 -1
  61. package/dist/proxy/claude-usage-tracker.js +1 -1
  62. package/dist/proxy/context-signature.js +1 -1
  63. package/dist/proxy/conversation-utils.js +1 -1
  64. package/dist/proxy/passthrough-server.d.ts +13 -2
  65. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  66. package/dist/proxy/passthrough-server.js +1 -1
  67. package/dist/proxy/passthrough-server.js.map +1 -1
  68. package/dist/proxy/server.js +1 -1
  69. package/dist/proxy/session-cache.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/api.js +1 -1
  75. package/dist/sdk/client/cdp-api-client.js +1 -1
  76. package/dist/sdk/client/endpoints.js +1 -1
  77. package/dist/sdk/client/engage-api-client.js +1 -1
  78. package/dist/sdk/client/http-client.js +1 -1
  79. package/dist/sdk/client/llm-api-client.js +1 -1
  80. package/dist/sdk/client/rate-limiter.js +1 -1
  81. package/dist/sdk/client/td-api-client.js +1 -1
  82. package/dist/sdk/client/trino-api-client.js +1 -1
  83. package/dist/sdk/client/workflow-client.js +1 -1
  84. package/dist/sdk/connection-validator.js +1 -1
  85. package/dist/sdk/connection.js +1 -1
  86. package/dist/sdk/engage.js +1 -1
  87. package/dist/sdk/errors.js +1 -1
  88. package/dist/sdk/index.js +1 -1
  89. package/dist/sdk/io/index.js +1 -1
  90. package/dist/sdk/io/node-filesystem.js +1 -1
  91. package/dist/sdk/job.js +1 -1
  92. package/dist/sdk/journey.js +1 -1
  93. package/dist/sdk/llm/chat-cache.js +1 -1
  94. package/dist/sdk/llm/index.js +1 -1
  95. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  96. package/dist/sdk/llm/model-aliases.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  101. package/dist/sdk/segment/fields-display.js +1 -1
  102. package/dist/sdk/segment/file-discovery.js +1 -1
  103. package/dist/sdk/segment/journey-utils.js +1 -1
  104. package/dist/sdk/segment/journey-yaml.js +1 -1
  105. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  106. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  107. package/dist/sdk/segment/pull-workflow.js +1 -1
  108. package/dist/sdk/segment/push-workflow.js +1 -1
  109. package/dist/sdk/segment/resolution-context.js +1 -1
  110. package/dist/sdk/segment/segment-path-parser.js +1 -1
  111. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  112. package/dist/sdk/segment/target-resolution.js +1 -1
  113. package/dist/sdk/segment/tdx-config.js +1 -1
  114. package/dist/sdk/segment/validate-files.js +1 -1
  115. package/dist/sdk/segment/yaml-validator.js +1 -1
  116. package/dist/sdk/segment.js +1 -1
  117. package/dist/sdk/types/index.js +1 -1
  118. package/dist/sdk/types/progress.js +1 -1
  119. package/dist/sdk/user.js +1 -1
  120. package/dist/sdk/util/format-detector.js +1 -1
  121. package/dist/sdk/util/formatters.js +1 -1
  122. package/dist/sdk/util/index.js +1 -1
  123. package/dist/sdk/util/tree-formatter.js +1 -1
  124. package/dist/sdk/workflow/clone-workflow.js +1 -1
  125. package/dist/sdk/workflow/index.js +1 -1
  126. package/dist/sdk/workflow/pull-workflow.js +1 -1
  127. package/dist/sdk/workflow/push-workflow.js +1 -1
  128. package/dist/sdk/workflow/tdx-config.js +1 -1
  129. package/dist/sdk/workflow/workflow-utils.js +1 -1
  130. package/dist/utils/async.js +1 -1
  131. package/dist/utils/colors.js +1 -1
  132. package/dist/utils/diff.js +1 -1
  133. package/dist/utils/file-permissions.js +1 -1
  134. package/dist/utils/json-loader.js +1 -1
  135. package/dist/utils/option-validation.js +1 -1
  136. package/dist/utils/port.js +1 -1
  137. package/dist/utils/process.js +1 -1
  138. package/dist/utils/prompt.js +1 -1
  139. package/dist/utils/spinner.js +1 -1
  140. package/dist/utils/sse-parser.js +1 -1
  141. package/dist/utils/string-utils.js +1 -1
  142. package/dist/utils/table-ref-parser.js +1 -1
  143. package/dist/utils/tdx-logger.js +1 -1
  144. package/dist/utils/version-check.js +1 -1
  145. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0xa0b743=a25_0x46e2;(function(_0x55cab0,_0x8c84e7){const _0x241b70=a25_0x46e2,_0x28683a=_0x55cab0();while(!![]){try{const _0x3ec7e6=-parseInt(_0x241b70(0x212))/0x1*(parseInt(_0x241b70(0x250))/0x2)+-parseInt(_0x241b70(0x200))/0x3+parseInt(_0x241b70(0x220))/0x4+parseInt(_0x241b70(0x219))/0x5+-parseInt(_0x241b70(0x1f5))/0x6*(-parseInt(_0x241b70(0x243))/0x7)+parseInt(_0x241b70(0x24a))/0x8+-parseInt(_0x241b70(0x1f2))/0x9;if(_0x3ec7e6===_0x8c84e7)break;else _0x28683a['push'](_0x28683a['shift']());}catch(_0x55c8d9){_0x28683a['push'](_0x28683a['shift']());}}}(a25_0xb8e9,0x81935));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x1e7ed9 from'chalk';async function resolveSegmentTarget(_0x37b8ed,_0x33544d,_0x11f520){const _0x2e9876=a25_0x46e2;if(isYamlFilePath(_0x37b8ed))try{const _0x4a3322=await resolveYamlFilePath(_0x37b8ed);return _0x11f520&&(console[_0x2e9876(0x206)](_0x2e9876(0x1f9)+_0x37b8ed),console[_0x2e9876(0x206)](_0x2e9876(0x227)+_0x4a3322[_0x2e9876(0x275)]),console[_0x2e9876(0x206)]('\x20\x20Segment\x20name:\x20'+_0x4a3322[_0x2e9876(0x1f8)]),console[_0x2e9876(0x206)](_0x2e9876(0x278)+(_0x4a3322[_0x2e9876(0x27b)]||_0x2e9876(0x24b))),console[_0x2e9876(0x206)]('\x20\x20Full\x20path:\x20'+_0x4a3322[_0x2e9876(0x26d)])),_0x4a3322['fullPath'];}catch(_0x4a8885){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2e9876(0x265)+_0x4a8885[_0x2e9876(0x27c)]);}if(!_0x33544d)throw new SDKError(ErrorCode[_0x2e9876(0x245)],_0x2e9876(0x21c));return _0x33544d+'/'+_0x37b8ed;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0xa0b743(0x267);[a25_0xa0b743(0x1ed)]=a25_0xa0b743(0x22a);async[a25_0xa0b743(0x1eb)](_0x32bda9){const _0x2492a4=a25_0xa0b743,{options:_0x3fb9f0,args:_0x572fa6,tdx:_0x3064ce}=_0x32bda9,_0x477c93=_0x572fa6[0x0],_0x184ef0=!_0x477c93&&!!_0x3fb9f0[_0x2492a4(0x275)],_0x5dd4c3=_0x477c93||_0x3fb9f0[_0x2492a4(0x275)];if(!_0x5dd4c3)return console[_0x2492a4(0x206)](_0x2492a4(0x226)),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x2492a4(0x206)]('Examples:'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x2492a4(0x206)](_0x2492a4(0x235)),console[_0x2492a4(0x206)](_0x2492a4(0x270)),console[_0x2492a4(0x206)](_0x2492a4(0x1e6)),0x1;try{const _0x9937b=_0x3fb9f0['segmentPath'];let _0x4cc7af=_0x5dd4c3;!_0x184ef0&&_0x9937b&&!_0x5dd4c3[_0x2492a4(0x242)]('/')&&(_0x4cc7af=_0x9937b+'/'+_0x5dd4c3,_0x3fb9f0[_0x2492a4(0x1ef)]&&console[_0x2492a4(0x206)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4cc7af));const _0x51152d=await withSpinner('Resolving\x20path\x20\x27'+_0x4cc7af+_0x2492a4(0x27e),()=>_0x3064ce[_0x2492a4(0x27d)]['resolvePathToResource'](_0x4cc7af),{'verbose':_0x3fb9f0['verbose']}),_0x3110fd=_0x51152d['data'];_0x3fb9f0['verbose']&&(console[_0x2492a4(0x206)](_0x2492a4(0x268)+_0x3110fd['type']),console['error'](_0x2492a4(0x224)+_0x3110fd[_0x2492a4(0x276)]),_0x3110fd['folderId']&&console[_0x2492a4(0x206)](_0x2492a4(0x1ff)+_0x3110fd[_0x2492a4(0x1f1)]),_0x3110fd['segmentId']&&console[_0x2492a4(0x206)](_0x2492a4(0x1ee)+_0x3110fd[_0x2492a4(0x233)]));if(_0x3110fd[_0x2492a4(0x21d)]===_0x2492a4(0x25a)){const _0x51e314=await withSpinner(_0x2492a4(0x262),()=>_0x3064ce[_0x2492a4(0x27d)][_0x2492a4(0x228)](_0x3110fd[_0x2492a4(0x276)]),{'verbose':_0x3fb9f0[_0x2492a4(0x1ef)]});await handleSingleObjectOutput(_0x51e314[_0x2492a4(0x256)],_0x3fb9f0);}else{if(_0x3110fd[_0x2492a4(0x21d)]===_0x2492a4(0x251)){if(!_0x3110fd[_0x2492a4(0x1f1)])throw new SDKError(ErrorCode[_0x2492a4(0x216)],_0x2492a4(0x22e));const _0x8acc20=await withSpinner(_0x2492a4(0x25d),()=>_0x3064ce[_0x2492a4(0x27d)][_0x2492a4(0x261)](_0x3110fd[_0x2492a4(0x1f1)]),{'verbose':_0x3fb9f0[_0x2492a4(0x1ef)]});await handleSingleObjectOutput(_0x8acc20[_0x2492a4(0x256)],_0x3fb9f0);}else{if(_0x3110fd[_0x2492a4(0x21d)]==='segment'){if(!_0x3110fd['segmentId'])throw new SDKError(ErrorCode[_0x2492a4(0x21b)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x138caa=await withSpinner(_0x2492a4(0x208),()=>_0x3064ce['segment'][_0x2492a4(0x25f)](_0x3110fd['parentId'],_0x3110fd[_0x2492a4(0x233)]),{'verbose':_0x3fb9f0[_0x2492a4(0x1ef)]});await handleSingleObjectOutput(_0x138caa[_0x2492a4(0x256)],_0x3fb9f0);}}}return 0x0;}catch(_0x3d7297){if(_0x3d7297 instanceof SDKError)return console[_0x2492a4(0x206)]('Error:\x20'+_0x3d7297[_0x2492a4(0x27c)]),_0x3d7297[_0x2492a4(0x23a)]&&console[_0x2492a4(0x206)]('\x20\x20Cause:\x20'+_0x3d7297['cause']),0x1;throw _0x3d7297;}}}export class SegmentShowCommand extends BaseCommand{[a25_0xa0b743(0x266)]=a25_0xa0b743(0x26e);[a25_0xa0b743(0x1ed)]=a25_0xa0b743(0x1fb);async['execute'](_0x1e3e96){const _0x333cf0=a25_0xa0b743,{options:_0x2ad473,args:_0x2b1d16,tdx:_0x382aa0}=_0x1e3e96,_0x348b47=_0x2b1d16[0x0];if(!_0x348b47)return console[_0x333cf0(0x206)](_0x333cf0(0x234)),console[_0x333cf0(0x206)](_0x333cf0(0x217)),console[_0x333cf0(0x206)](_0x333cf0(0x236)),console[_0x333cf0(0x206)](_0x333cf0(0x204)),console[_0x333cf0(0x206)](_0x333cf0(0x22b)),console[_0x333cf0(0x206)](_0x333cf0(0x1e8)),0x1;try{const _0x5c99e9=_0x2ad473[_0x333cf0(0x275)],_0x495937=await resolveSegmentTarget(_0x348b47,_0x5c99e9,_0x2ad473[_0x333cf0(0x1ef)]);_0x2ad473[_0x333cf0(0x1ef)]&&console['error']('Target\x20path:\x20'+_0x495937);const _0x192f29=await withSpinner(_0x333cf0(0x26b)+_0x348b47+_0x333cf0(0x27e),()=>_0x382aa0[_0x333cf0(0x27d)][_0x333cf0(0x230)](_0x495937),{'verbose':_0x2ad473[_0x333cf0(0x1ef)]}),_0x2cc749=_0x192f29[_0x333cf0(0x256)];_0x2ad473[_0x333cf0(0x1ef)]&&(console[_0x333cf0(0x206)](_0x333cf0(0x268)+_0x2cc749[_0x333cf0(0x21d)]),console[_0x333cf0(0x206)](_0x333cf0(0x224)+_0x2cc749[_0x333cf0(0x276)]));if(_0x2cc749[_0x333cf0(0x21d)]===_0x333cf0(0x251))return console[_0x333cf0(0x206)](_0x333cf0(0x260)),console['error'](_0x333cf0(0x211)),0x1;if(_0x2cc749[_0x333cf0(0x21d)]===_0x333cf0(0x25a))return console[_0x333cf0(0x206)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x333cf0(0x206)](_0x333cf0(0x1fa)),0x1;if(!_0x2cc749['segmentId'])throw new SDKError(ErrorCode[_0x333cf0(0x21b)],_0x333cf0(0x22d));const _0x1897db=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x382aa0[_0x333cf0(0x27d)][_0x333cf0(0x207)](_0x2cc749[_0x333cf0(0x276)],_0x2cc749['segmentId']),{'verbose':_0x2ad473[_0x333cf0(0x1ef)]});let _0x2994c9=_0x1897db['data'];const _0x2ee28d=resolveLimit(_0x2ad473['limit'],DEFAULT_DISPLAY_LIMIT),_0x5be6b9=/\bLIMIT\s+\d+/i['test'](_0x2994c9);!_0x5be6b9&&(_0x2994c9=_0x2994c9[_0x333cf0(0x25c)]()['replace'](/;+$/,''),_0x2994c9=_0x333cf0(0x222)+_0x2994c9+_0x333cf0(0x24f)+_0x2ee28d);_0x2ad473['verbose']&&console['error'](_0x333cf0(0x253)+_0x2994c9);const _0x15f35b=await withProgressSpinner(_0x333cf0(0x257),async _0x46b9b9=>{const _0x59aa74=_0x333cf0,_0x1d8d51=await _0x382aa0[_0x59aa74(0x22f)][_0x59aa74(0x1eb)](_0x2994c9,{'catalog':'td','schema':'information_schema','onJobId':_0x3a1cda=>{_0x46b9b9['setJobId'](_0x3a1cda);}});return _0x1d8d51;},{'verbose':_0x2ad473[_0x333cf0(0x1ef)]}),_0x5c180d=_0x15f35b['data'],_0x23b00f=_0x5c180d[_0x333cf0(0x248)]?_0x333cf0(0x274)+_0x5c180d[_0x333cf0(0x248)]+']':'';return console['error'](_0x333cf0(0x232)+_0x5c180d[_0x333cf0(0x246)][_0x333cf0(0x277)]['toLocaleString']()+_0x333cf0(0x273)+(_0x333cf0(0x239)+formatElapsed(_0x5c180d['stats']['elapsedTimeMillis'])+_0x23b00f)),await handleQueryOutput(_0x5c180d,_0x2ad473),0x0;}catch(_0x61afc2){if(_0x61afc2 instanceof SDKError)return console[_0x333cf0(0x206)]('✖\x20Query\x20failed\x20['+_0x61afc2[_0x333cf0(0x1e7)]+']'),console['error']('\x0a'+_0x61afc2[_0x333cf0(0x27c)]),0x1;throw _0x61afc2;}}}function a25_0xb8e9(){const _0x374708=['INVALID_ARGUMENT','stats','Use:\x20tdx\x20ps\x20desc','jobId','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','4872344iEMtDT','(root)','Usage:\x20tdx\x20sg\x20sql\x20<name>','/e/','Use:\x20tdx\x20ps\x20view\x20-w','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','2uQjuTd','folder','segment:view','SQL\x20query:\x0a','Resolved\x20parent\x20folder\x20ID:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','data','Executing\x20segment\x20query...','Show\x20segment\x20folder\x20details','Error:\x20','parent','/app/ps/','trim','Fetching\x20folder\x20details...','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','getSegment','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','getFolder','Fetching\x20parent\x20segment\x20details...','Fetching\x20folder\x20\x27','segment:folder:show','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','name','segment:describe','Resolved\x20type:\x20','parentFolder','cyan','Resolving\x20\x27','Parent\x20name:\x20','fullPath','segment:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x27\x20with\x20ID:\x20','\x20rows\x20','\x20[Job\x20ID:\x20','parentSegment','parentId','processedRows','\x20\x20Folder\x20path:\x20','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20view','folderPath','message','segment','\x27...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','code','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Creating\x20folder\x20\x27','execute','Show\x20child\x20segment\x20schema\x20(column\x20types)','description','Segment\x20ID:\x20','verbose','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','folderId','11528847SqUwAh','Site:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','66rlEhaa','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','listFolders','segmentName','Resolved\x20YAML\x20file:\x20','Use:\x20tdx\x20ps\x20show','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolving\x20parent\x20segment\x20\x27','Folder\x20name:\x20','Use:\x20tdx\x20ps\x20sql','Folder\x20ID:\x20','96909kPQMSC','✔\x20Found\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','resolveFolderId','Examples:','Create\x20segment\x20folder\x20for\x20organization','error','getSegmentSQL','Fetching\x20segment\x20details...','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Parent\x20segment:\x20','Resolving\x20folder\x20\x27','format','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','log','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','573499wbtvBg','site','Error:\x20Folder\x20reference\x20is\x20required','web','SEGMENT_FOLDER_NOT_FOUND','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','1609550lGsCmh','Fetching\x20SQL\x20for\x20segment...','SEGMENT_NOT_FOUND','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','type','length','segment:desc','2713568dZLJgW','segment:sql','SELECT\x20*\x20FROM\x20(\x0a','createFolder','Parent\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20Parent\x20segment:\x20','getParent','resolveParentId','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Target\x20path:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Folder\x20ID\x20missing\x20from\x20resolved\x20path','query','resolvePathToResource','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','✔\x20Query\x20completed:\x20Processed\x20','segmentId','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','segment:folder:create','in\x20','cause','\x20\x20Cause:\x20','Listing\x20folders\x20for\x20parent\x20\x27','url','Resolved\x20parent\x20ID:\x20','\x20Opening\x20','\x20folder','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','includes','514297hGwWzN','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'];a25_0xb8e9=function(){return _0x374708;};return a25_0xb8e9();}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a25_0xa0b743(0x1ed)]=a25_0xa0b743(0x210);async[a25_0xa0b743(0x1eb)](_0x334c11){const _0x18cfab=a25_0xa0b743,{options:_0x3d5747,args:_0x4ffd6f,tdx:_0x454016}=_0x334c11;if(_0x4ffd6f[_0x18cfab(0x21e)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x18cfab(0x206)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x4b10f4=_0x4ffd6f[0x0];try{_0x3d5747[_0x18cfab(0x1ef)]&&(console['error']('Site:\x20'+_0x3d5747[_0x18cfab(0x213)]),console[_0x18cfab(0x206)]('Parent\x20name:\x20'+_0x4b10f4));const _0x10354b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4b10f4+_0x18cfab(0x27e),()=>_0x454016['segment'][_0x18cfab(0x229)](_0x4b10f4),{'verbose':_0x3d5747[_0x18cfab(0x1ef)]}),_0x3ec745=_0x10354b['data'];_0x3d5747['verbose']&&console['error'](_0x18cfab(0x23e)+_0x3ec745);const _0x249d35=await withSpinner(_0x18cfab(0x23c)+_0x4b10f4+_0x18cfab(0x27e),()=>_0x454016[_0x18cfab(0x27d)][_0x18cfab(0x1f7)](_0x3ec745),{'verbose':_0x3d5747[_0x18cfab(0x1ef)]}),_0x3f7128=_0x249d35[_0x18cfab(0x256)];return console[_0x18cfab(0x206)](_0x18cfab(0x201)+_0x3f7128[_0x18cfab(0x21e)]+_0x18cfab(0x240)+(_0x3f7128[_0x18cfab(0x21e)]!==0x1?'s':'')),await handleSDKOutput(_0x3f7128,_0x3d5747),0x0;}catch(_0xe4c08a){if(_0xe4c08a instanceof SDKError)return console[_0x18cfab(0x206)]('Error:\x20'+_0xe4c08a['message']),_0xe4c08a[_0x18cfab(0x23a)]&&console[_0x18cfab(0x206)](_0x18cfab(0x23b)+_0xe4c08a[_0x18cfab(0x23a)]),0x1;throw _0xe4c08a;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a25_0xa0b743(0x264);['description']=a25_0xa0b743(0x258);async[a25_0xa0b743(0x1eb)](_0x87c9bc){const _0x19595f=a25_0xa0b743,{options:_0x587d86,args:_0x2b8424,tdx:_0x54b796}=_0x87c9bc;if(_0x2b8424[_0x19595f(0x21e)]===0x0)return console['error'](_0x19595f(0x214)),console[_0x19595f(0x206)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x5b4941,childId:_0x50df3a}=parseSegmentRef(_0x2b8424[0x0]);_0x587d86[_0x19595f(0x1ef)]&&(console[_0x19595f(0x206)]('Site:\x20'+_0x587d86[_0x19595f(0x213)]),console['error'](_0x19595f(0x26c)+_0x5b4941),_0x50df3a&&console[_0x19595f(0x206)](_0x19595f(0x1fd)+_0x50df3a));if(!_0x50df3a)return console[_0x19595f(0x206)](_0x19595f(0x209)),0x1;const _0x44bb2e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5b4941+_0x19595f(0x27e),()=>_0x54b796['segment'][_0x19595f(0x229)](_0x5b4941),{'verbose':_0x587d86[_0x19595f(0x1ef)]}),_0x4ddbf1=_0x44bb2e[_0x19595f(0x256)];_0x587d86[_0x19595f(0x1ef)]&&console[_0x19595f(0x206)]('Resolved\x20parent\x20ID:\x20'+_0x4ddbf1);const _0x52b62b=await withSpinner(_0x19595f(0x20b)+_0x50df3a+_0x19595f(0x27e),()=>_0x54b796[_0x19595f(0x27d)][_0x19595f(0x203)](_0x4ddbf1,_0x50df3a),{'verbose':_0x587d86[_0x19595f(0x1ef)]}),_0x42b375=_0x52b62b[_0x19595f(0x256)];_0x587d86[_0x19595f(0x1ef)]&&console[_0x19595f(0x206)]('Resolved\x20folder\x20ID:\x20'+_0x42b375);const _0x173b3f=await withSpinner(_0x19595f(0x263)+_0x50df3a+'\x27...',()=>_0x54b796[_0x19595f(0x27d)][_0x19595f(0x261)](_0x42b375),{'verbose':_0x587d86[_0x19595f(0x1ef)]});return await handleSDKOutput([_0x173b3f['data']],_0x587d86),0x0;}catch(_0x2f49a1){if(_0x2f49a1 instanceof SDKError)return console[_0x19595f(0x206)]('Error:\x20'+_0x2f49a1['message']),_0x2f49a1['cause']&&console[_0x19595f(0x206)]('\x20\x20Cause:\x20'+_0x2f49a1[_0x19595f(0x23a)]),0x1;throw _0x2f49a1;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0xa0b743(0x266)]=a25_0xa0b743(0x221);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0xcb0557){const _0x3a8f5b=a25_0xa0b743,{options:_0x23c9b1,args:_0x2d35dd,tdx:_0x22f59f}=_0xcb0557,_0x2f2eab=_0x2d35dd[0x0];if(!_0x2f2eab)return console['error'](_0x3a8f5b(0x234)),console[_0x3a8f5b(0x206)](_0x3a8f5b(0x24c)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x3a8f5b(0x206)](_0x3a8f5b(0x204)),console[_0x3a8f5b(0x206)](_0x3a8f5b(0x237)),console[_0x3a8f5b(0x206)](_0x3a8f5b(0x279)),0x1;try{const _0x50868c=_0x23c9b1['parentSegment'],_0x703950=await resolveSegmentTarget(_0x2f2eab,_0x50868c,_0x23c9b1['verbose']);_0x23c9b1['verbose']&&console['error'](_0x3a8f5b(0x22c)+_0x703950);const _0x1a67c3=await withSpinner(_0x3a8f5b(0x26b)+_0x2f2eab+_0x3a8f5b(0x27e),()=>_0x22f59f[_0x3a8f5b(0x27d)][_0x3a8f5b(0x230)](_0x703950),{'verbose':_0x23c9b1['verbose']}),_0x1805c0=_0x1a67c3['data'];_0x23c9b1[_0x3a8f5b(0x1ef)]&&(console[_0x3a8f5b(0x206)](_0x3a8f5b(0x268)+_0x1805c0[_0x3a8f5b(0x21d)]),console[_0x3a8f5b(0x206)](_0x3a8f5b(0x224)+_0x1805c0[_0x3a8f5b(0x276)]));if(_0x1805c0['type']===_0x3a8f5b(0x251))return console[_0x3a8f5b(0x206)](_0x3a8f5b(0x1f4)),console['error'](_0x3a8f5b(0x25e)),0x1;if(_0x1805c0[_0x3a8f5b(0x21d)]===_0x3a8f5b(0x25a))return console[_0x3a8f5b(0x206)](_0x3a8f5b(0x202)),console[_0x3a8f5b(0x206)](_0x3a8f5b(0x1fe)),0x1;if(!_0x1805c0[_0x3a8f5b(0x233)])throw new SDKError(ErrorCode[_0x3a8f5b(0x21b)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1bcbfe=await withSpinner(_0x3a8f5b(0x21a),()=>_0x22f59f['segment']['getSegmentSQL'](_0x1805c0[_0x3a8f5b(0x276)],_0x1805c0['segmentId']),{'verbose':_0x23c9b1[_0x3a8f5b(0x1ef)]}),_0x35c008=_0x1bcbfe[_0x3a8f5b(0x256)];return _0x23c9b1[_0x3a8f5b(0x20c)]==='json'||_0x23c9b1[_0x3a8f5b(0x20c)]==='jsonl'?await handleSDKOutput([{'sql':_0x35c008}],_0x23c9b1):console[_0x3a8f5b(0x20f)](_0x35c008),0x0;}catch(_0x5efd66){if(_0x5efd66 instanceof SDKError)return console[_0x3a8f5b(0x206)]('Error:\x20'+_0x5efd66[_0x3a8f5b(0x27c)]),_0x5efd66[_0x3a8f5b(0x23a)]&&console[_0x3a8f5b(0x206)](_0x3a8f5b(0x23b)+_0x5efd66[_0x3a8f5b(0x23a)]),0x1;throw _0x5efd66;}}}function a25_0x46e2(_0x1fa089,_0x2c8d80){_0x1fa089=_0x1fa089-0x1e6;const _0xb8e96a=a25_0xb8e9();let _0x46e23d=_0xb8e96a[_0x1fa089];return _0x46e23d;}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0xa0b743(0x266)]=a25_0xa0b743(0x238);[a25_0xa0b743(0x1ed)]=a25_0xa0b743(0x205);async[a25_0xa0b743(0x1eb)](_0x32b0bd){const _0x1d2683=a25_0xa0b743,{options:_0x56de62,args:_0x1c569c,tdx:_0x51091a}=_0x32b0bd,_0x99125=_0x56de62;if(_0x1c569c[_0x1d2683(0x21e)]<0x2)return console['error'](_0x1d2683(0x1f6)),console[_0x1d2683(0x206)](_0x1d2683(0x249)),0x1;const _0x91bdde=_0x1c569c[0x0],_0x7e3dc0=_0x1c569c[0x1];_0x99125[_0x1d2683(0x1ef)]&&(console[_0x1d2683(0x206)](_0x1d2683(0x1f3)+_0x99125[_0x1d2683(0x213)]),console[_0x1d2683(0x206)](_0x1d2683(0x20a)+_0x91bdde),console[_0x1d2683(0x206)](_0x1d2683(0x1fd)+_0x7e3dc0));let _0x3f7ad6;if(_0x99125[_0x1d2683(0x269)]){const _0x180b42=_0x99125[_0x1d2683(0x269)],_0x21523d=await withSpinner(_0x1d2683(0x1fc)+_0x91bdde+_0x1d2683(0x27e),()=>_0x51091a[_0x1d2683(0x27d)][_0x1d2683(0x229)](_0x91bdde),{'verbose':_0x99125['verbose']}),_0x5c470b=_0x21523d[_0x1d2683(0x256)],_0x2b948b=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x180b42+_0x1d2683(0x27e),()=>_0x51091a[_0x1d2683(0x27d)][_0x1d2683(0x203)](_0x5c470b,_0x180b42),{'verbose':_0x99125[_0x1d2683(0x1ef)]});_0x3f7ad6=_0x2b948b['data'],_0x99125['verbose']&&console[_0x1d2683(0x206)](_0x1d2683(0x254)+_0x3f7ad6);}const _0x192de1={'name':_0x7e3dc0,'description':_0x99125[_0x1d2683(0x1ed)],'parentFolderId':_0x3f7ad6},_0x45fdfa=await withSpinner(_0x1d2683(0x1ea)+_0x7e3dc0+_0x1d2683(0x27e),()=>_0x51091a[_0x1d2683(0x27d)][_0x1d2683(0x223)](_0x91bdde,_0x192de1),{'verbose':_0x99125[_0x1d2683(0x1ef)]}),_0xe12101=_0x45fdfa[_0x1d2683(0x256)];return console[_0x1d2683(0x206)](_0x1d2683(0x20d)+_0xe12101['name']+_0x1d2683(0x272)+_0xe12101['id']),await handleSDKOutput([_0xe12101],_0x99125),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a25_0xa0b743(0x252);[a25_0xa0b743(0x1ed)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a25_0xa0b743(0x1eb)](_0x16f451){const _0x560eca=a25_0xa0b743,{options:_0x2007b7,args:_0x1a3a4e,tdx:_0x4c4ee7}=_0x16f451,_0x1940d0=_0x1a3a4e[0x0];if(!_0x1940d0)return console[_0x560eca(0x206)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x560eca(0x206)](_0x560eca(0x20e)),console['error'](_0x560eca(0x26f)),console[_0x560eca(0x206)]('Options:'),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x560eca(0x206)]('Examples:'),console[_0x560eca(0x206)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error'](_0x560eca(0x231)),console[_0x560eca(0x206)](_0x560eca(0x218)),console['error'](_0x560eca(0x271)),0x1;try{const _0x2196dd=_0x2007b7['parentSegment'],_0x1a283a=await resolveSegmentTarget(_0x1940d0,_0x2196dd,_0x2007b7[_0x560eca(0x1ef)]);_0x2007b7[_0x560eca(0x1ef)]&&console[_0x560eca(0x206)](_0x560eca(0x22c)+_0x1a283a);const _0x399b10=await withSpinner(_0x560eca(0x26b)+_0x1940d0+_0x560eca(0x27e),()=>_0x4c4ee7[_0x560eca(0x27d)]['resolvePathToResource'](_0x1a283a),{'verbose':_0x2007b7[_0x560eca(0x1ef)]}),_0x35e231=_0x399b10['data'];_0x2007b7['verbose']&&(console[_0x560eca(0x206)](_0x560eca(0x268)+_0x35e231[_0x560eca(0x21d)]),console[_0x560eca(0x206)]('Parent\x20ID:\x20'+_0x35e231[_0x560eca(0x276)]),_0x35e231[_0x560eca(0x1f1)]&&console['error']('Folder\x20ID:\x20'+_0x35e231['folderId']),_0x35e231[_0x560eca(0x233)]&&console[_0x560eca(0x206)](_0x560eca(0x1ee)+_0x35e231[_0x560eca(0x233)]));if(_0x2007b7[_0x560eca(0x215)]){if(_0x35e231[_0x560eca(0x21d)]===_0x560eca(0x251))return console[_0x560eca(0x206)](_0x560eca(0x244)),0x1;if(_0x35e231['type']===_0x560eca(0x25a))return console['error'](_0x560eca(0x255)),console[_0x560eca(0x206)](_0x560eca(0x24e)),0x1;if(!_0x35e231[_0x560eca(0x233)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x38b344=getConsoleNextUrl(_0x2007b7[_0x560eca(0x213)],_0x560eca(0x25b)+_0x35e231['parentId']+_0x560eca(0x24d)+_0x35e231[_0x560eca(0x233)]);return console['error'](a25_0x1e7ed9['green']('✔')+_0x560eca(0x23f)+a25_0x1e7ed9[_0x560eca(0x26a)](_0x38b344)),openBrowser(_0x38b344),0x0;}if(_0x35e231['type']===_0x560eca(0x251)){if(!_0x35e231[_0x560eca(0x1f1)])throw new SDKError(ErrorCode[_0x560eca(0x216)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x25ce19=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4c4ee7[_0x560eca(0x27d)][_0x560eca(0x261)](_0x35e231[_0x560eca(0x1f1)]),{'verbose':_0x2007b7['verbose']});await handleSingleObjectOutput(_0x25ce19[_0x560eca(0x256)],_0x2007b7);}else{if(_0x35e231[_0x560eca(0x21d)]==='segment'){if(!_0x35e231[_0x560eca(0x233)])throw new SDKError(ErrorCode[_0x560eca(0x21b)],_0x560eca(0x22d));const _0x48cfe4=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4c4ee7[_0x560eca(0x27d)][_0x560eca(0x25f)](_0x35e231[_0x560eca(0x276)],_0x35e231['segmentId']),{'verbose':_0x2007b7[_0x560eca(0x1ef)]}),_0x3af575=getConsoleNextUrl(_0x2007b7[_0x560eca(0x213)],'/app/ps/'+_0x35e231[_0x560eca(0x276)]+'/e/'+_0x35e231['segmentId']),_0x404505=_0x48cfe4[_0x560eca(0x256)];_0x404505[_0x560eca(0x23d)]=_0x3af575,await handleSingleObjectOutput(_0x404505,_0x2007b7);}else return console[_0x560eca(0x206)](_0x560eca(0x225)),console[_0x560eca(0x206)](_0x560eca(0x27a)),0x1;}return 0x0;}catch(_0x539f88){if(_0x539f88 instanceof SDKError)return console[_0x560eca(0x206)]('Error:\x20'+_0x539f88[_0x560eca(0x27c)]),_0x539f88[_0x560eca(0x23a)]&&console[_0x560eca(0x206)](_0x560eca(0x23b)+_0x539f88[_0x560eca(0x23a)]),0x1;throw _0x539f88;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0xa0b743(0x266)]=a25_0xa0b743(0x21f);[a25_0xa0b743(0x1ed)]=a25_0xa0b743(0x1ec);async[a25_0xa0b743(0x1eb)](_0x449f96){const _0x2b0fe2=a25_0xa0b743,{options:_0x5bdb82,args:_0x561e28,tdx:_0x245fad}=_0x449f96,_0x111791=_0x561e28[0x0];if(!_0x111791)return console['error'](_0x2b0fe2(0x234)),console[_0x2b0fe2(0x206)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x2b0fe2(0x1e9)),console[_0x2b0fe2(0x206)]('Examples:'),console[_0x2b0fe2(0x206)](_0x2b0fe2(0x241)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3bfbeb=_0x5bdb82[_0x2b0fe2(0x275)],_0x47335b=await resolveSegmentTarget(_0x111791,_0x3bfbeb,_0x5bdb82[_0x2b0fe2(0x1ef)]);_0x5bdb82['verbose']&&console[_0x2b0fe2(0x206)](_0x2b0fe2(0x22c)+_0x47335b);const _0x31457b=await withSpinner(_0x2b0fe2(0x26b)+_0x111791+_0x2b0fe2(0x27e),()=>_0x245fad[_0x2b0fe2(0x27d)]['resolvePathToResource'](_0x47335b),{'verbose':_0x5bdb82[_0x2b0fe2(0x1ef)]}),_0x1a3ca5=_0x31457b['data'];_0x5bdb82[_0x2b0fe2(0x1ef)]&&(console['error'](_0x2b0fe2(0x268)+_0x1a3ca5[_0x2b0fe2(0x21d)]),console['error']('Parent\x20ID:\x20'+_0x1a3ca5[_0x2b0fe2(0x276)]));if(_0x1a3ca5[_0x2b0fe2(0x21d)]==='folder')return console[_0x2b0fe2(0x206)](_0x2b0fe2(0x1f0)),console[_0x2b0fe2(0x206)](_0x2b0fe2(0x25e)),0x1;if(_0x1a3ca5['type']===_0x2b0fe2(0x25a))return console[_0x2b0fe2(0x206)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x2b0fe2(0x206)](_0x2b0fe2(0x247)),0x1;if(!_0x1a3ca5['segmentId'])throw new SDKError(ErrorCode[_0x2b0fe2(0x21b)],_0x2b0fe2(0x22d));const _0x25d8dc=await withSpinner(_0x2b0fe2(0x21a),()=>_0x245fad['segment']['getSegmentSQL'](_0x1a3ca5[_0x2b0fe2(0x276)],_0x1a3ca5['segmentId']),{'verbose':_0x5bdb82[_0x2b0fe2(0x1ef)]}),_0x5326b0=_0x25d8dc[_0x2b0fe2(0x256)],_0x2a3bb3=await executeSchemaQuery(_0x5326b0,_0x245fad,_0x5bdb82);return await handleQueryOutput(_0x2a3bb3,_0x5bdb82),0x0;}catch(_0x80070f){if(_0x80070f instanceof SDKError)return console['error'](_0x2b0fe2(0x259)+_0x80070f[_0x2b0fe2(0x27c)]),_0x80070f[_0x2b0fe2(0x23a)]&&console[_0x2b0fe2(0x206)](_0x2b0fe2(0x23b)+_0x80070f['cause']),0x1;throw _0x80070f;}}}
1
+ const a25_0x288065=a25_0x561c;(function(_0x1911e8,_0x330b18){const _0x2686ad=a25_0x561c,_0x5b6cc3=_0x1911e8();while(!![]){try{const _0x10fdaa=parseInt(_0x2686ad(0x1c7))/0x1+-parseInt(_0x2686ad(0x221))/0x2+parseInt(_0x2686ad(0x229))/0x3+parseInt(_0x2686ad(0x201))/0x4*(-parseInt(_0x2686ad(0x21a))/0x5)+-parseInt(_0x2686ad(0x1e5))/0x6*(parseInt(_0x2686ad(0x215))/0x7)+parseInt(_0x2686ad(0x1e3))/0x8+parseInt(_0x2686ad(0x1bd))/0x9;if(_0x10fdaa===_0x330b18)break;else _0x5b6cc3['push'](_0x5b6cc3['shift']());}catch(_0x48d37e){_0x5b6cc3['push'](_0x5b6cc3['shift']());}}}(a25_0x3390,0x49b00));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x3e730a from'chalk';async function resolveSegmentTarget(_0x38ac81,_0x470330,_0x5a0800){const _0x16e07c=a25_0x561c;if(isYamlFilePath(_0x38ac81))try{const _0x31ab08=await resolveYamlFilePath(_0x38ac81);return _0x5a0800&&(console[_0x16e07c(0x202)](_0x16e07c(0x1ee)+_0x38ac81),console[_0x16e07c(0x202)](_0x16e07c(0x1ed)+_0x31ab08[_0x16e07c(0x21b)]),console[_0x16e07c(0x202)](_0x16e07c(0x21f)+_0x31ab08['segmentName']),console[_0x16e07c(0x202)]('\x20\x20Folder\x20path:\x20'+(_0x31ab08['folderPath']||_0x16e07c(0x1bf))),console[_0x16e07c(0x202)]('\x20\x20Full\x20path:\x20'+_0x31ab08[_0x16e07c(0x1dc)])),_0x31ab08[_0x16e07c(0x1dc)];}catch(_0x9d9f10){throw new SDKError(ErrorCode[_0x16e07c(0x1d8)],_0x16e07c(0x242)+_0x9d9f10['message']);}if(!_0x470330)throw new SDKError(ErrorCode[_0x16e07c(0x1d8)],_0x16e07c(0x217));return _0x470330+'/'+_0x38ac81;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:describe';['description']=a25_0x288065(0x234);async[a25_0x288065(0x222)](_0x159c23){const _0x175344=a25_0x288065,{options:_0xcb18d7,args:_0x5b8c7e,tdx:_0x177bff}=_0x159c23,_0x1caa22=_0x5b8c7e[0x0],_0x160cb4=!_0x1caa22&&!!_0xcb18d7[_0x175344(0x21b)],_0xb9b95d=_0x1caa22||_0xcb18d7[_0x175344(0x21b)];if(!_0xb9b95d)return console[_0x175344(0x202)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x175344(0x202)](_0x175344(0x20d)),console[_0x175344(0x202)](_0x175344(0x211)),console[_0x175344(0x202)](_0x175344(0x1f2)),console[_0x175344(0x202)](_0x175344(0x246)),console[_0x175344(0x202)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x175344(0x202)](_0x175344(0x23d)),0x1;try{const _0x384af8=_0xcb18d7['segmentPath'];let _0x2b7af6=_0xb9b95d;!_0x160cb4&&_0x384af8&&!_0xb9b95d['includes']('/')&&(_0x2b7af6=_0x384af8+'/'+_0xb9b95d,_0xcb18d7['verbose']&&console[_0x175344(0x202)](_0x175344(0x1d2)+_0x2b7af6));const _0x5d70a8=await withSpinner(_0x175344(0x22f)+_0x2b7af6+_0x175344(0x1f4),()=>_0x177bff[_0x175344(0x20c)][_0x175344(0x1c6)](_0x2b7af6),{'verbose':_0xcb18d7[_0x175344(0x1e0)]}),_0x2f1ff8=_0x5d70a8[_0x175344(0x23a)];_0xcb18d7['verbose']&&(console[_0x175344(0x202)]('Resolved\x20type:\x20'+_0x2f1ff8['type']),console[_0x175344(0x202)](_0x175344(0x22c)+_0x2f1ff8[_0x175344(0x24e)]),_0x2f1ff8[_0x175344(0x243)]&&console[_0x175344(0x202)](_0x175344(0x1e2)+_0x2f1ff8[_0x175344(0x243)]),_0x2f1ff8[_0x175344(0x1ba)]&&console['error']('Segment\x20ID:\x20'+_0x2f1ff8[_0x175344(0x1ba)]));if(_0x2f1ff8[_0x175344(0x1c1)]===_0x175344(0x255)){const _0x2faf37=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x177bff['segment'][_0x175344(0x1cc)](_0x2f1ff8['parentId']),{'verbose':_0xcb18d7[_0x175344(0x1e0)]});await handleSingleObjectOutput(_0x2faf37[_0x175344(0x23a)],_0xcb18d7);}else{if(_0x2f1ff8[_0x175344(0x1c1)]===_0x175344(0x227)){if(!_0x2f1ff8[_0x175344(0x243)])throw new SDKError(ErrorCode[_0x175344(0x216)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5f2ca5=await withSpinner(_0x175344(0x1d1),()=>_0x177bff[_0x175344(0x20c)][_0x175344(0x1dd)](_0x2f1ff8['folderId']),{'verbose':_0xcb18d7[_0x175344(0x1e0)]});await handleSingleObjectOutput(_0x5f2ca5['data'],_0xcb18d7);}else{if(_0x2f1ff8[_0x175344(0x1c1)]===_0x175344(0x20c)){if(!_0x2f1ff8[_0x175344(0x1ba)])throw new SDKError(ErrorCode[_0x175344(0x251)],_0x175344(0x23e));const _0x548ef3=await withSpinner('Fetching\x20segment\x20details...',()=>_0x177bff[_0x175344(0x20c)]['getSegment'](_0x2f1ff8[_0x175344(0x24e)],_0x2f1ff8['segmentId']),{'verbose':_0xcb18d7['verbose']});await handleSingleObjectOutput(_0x548ef3[_0x175344(0x23a)],_0xcb18d7);}}}return 0x0;}catch(_0x3b82dc){if(_0x3b82dc instanceof SDKError)return console['error'](_0x175344(0x1c5)+_0x3b82dc[_0x175344(0x256)]),_0x3b82dc[_0x175344(0x232)]&&console[_0x175344(0x202)]('\x20\x20Cause:\x20'+_0x3b82dc[_0x175344(0x232)]),0x1;throw _0x3b82dc;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:show';['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a25_0x288065(0x222)](_0x3a9e93){const _0x1e8107=a25_0x288065,{options:_0x5ae287,args:_0x87f429,tdx:_0xdc1ee9}=_0x3a9e93,_0x9aad9f=_0x87f429[0x0];if(!_0x9aad9f)return console[_0x1e8107(0x202)](_0x1e8107(0x24d)),console['error'](_0x1e8107(0x1c8)),console[_0x1e8107(0x202)](_0x1e8107(0x1de)),console[_0x1e8107(0x202)](_0x1e8107(0x211)),console[_0x1e8107(0x202)](_0x1e8107(0x213)),console[_0x1e8107(0x202)](_0x1e8107(0x23f)),0x1;try{const _0x365e08=_0x5ae287[_0x1e8107(0x21b)],_0x1863af=await resolveSegmentTarget(_0x9aad9f,_0x365e08,_0x5ae287[_0x1e8107(0x1e0)]);_0x5ae287['verbose']&&console[_0x1e8107(0x202)](_0x1e8107(0x1fb)+_0x1863af);const _0x146ccd=await withSpinner(_0x1e8107(0x1ce)+_0x9aad9f+_0x1e8107(0x1f4),()=>_0xdc1ee9[_0x1e8107(0x20c)][_0x1e8107(0x1c6)](_0x1863af),{'verbose':_0x5ae287['verbose']}),_0x3351ea=_0x146ccd[_0x1e8107(0x23a)];_0x5ae287[_0x1e8107(0x1e0)]&&(console[_0x1e8107(0x202)](_0x1e8107(0x1f1)+_0x3351ea[_0x1e8107(0x1c1)]),console[_0x1e8107(0x202)](_0x1e8107(0x22c)+_0x3351ea[_0x1e8107(0x24e)]));if(_0x3351ea['type']===_0x1e8107(0x227))return console['error'](_0x1e8107(0x1e4)),console[_0x1e8107(0x202)](_0x1e8107(0x1d4)),0x1;if(_0x3351ea[_0x1e8107(0x1c1)]===_0x1e8107(0x255))return console[_0x1e8107(0x202)](_0x1e8107(0x205)),console['error']('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x3351ea['segmentId'])throw new SDKError(ErrorCode[_0x1e8107(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2e6f18=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0xdc1ee9[_0x1e8107(0x20c)][_0x1e8107(0x1cf)](_0x3351ea[_0x1e8107(0x24e)],_0x3351ea[_0x1e8107(0x1ba)]),{'verbose':_0x5ae287[_0x1e8107(0x1e0)]});let _0x4d1cff=_0x2e6f18['data'];const _0x1c4d8c=resolveLimit(_0x5ae287['limit'],DEFAULT_DISPLAY_LIMIT),_0x87c235=/\bLIMIT\s+\d+/i[_0x1e8107(0x241)](_0x4d1cff);!_0x87c235&&(_0x4d1cff=_0x4d1cff[_0x1e8107(0x248)]()[_0x1e8107(0x239)](/;+$/,''),_0x4d1cff='SELECT\x20*\x20FROM\x20(\x0a'+_0x4d1cff+_0x1e8107(0x1c0)+_0x1c4d8c);_0x5ae287[_0x1e8107(0x1e0)]&&console[_0x1e8107(0x202)](_0x1e8107(0x1fc)+_0x4d1cff);const _0x357cb9=await withProgressSpinner(_0x1e8107(0x1ec),async _0xebec26=>{const _0x60c046=_0x1e8107,_0x1bba4b=await _0xdc1ee9[_0x60c046(0x22d)][_0x60c046(0x222)](_0x4d1cff,{'catalog':'td','schema':'information_schema','onJobId':_0x55acc7=>{const _0x24c358=_0x60c046;_0xebec26[_0x24c358(0x1da)](_0x55acc7);}});return _0x1bba4b;},{'verbose':_0x5ae287[_0x1e8107(0x1e0)]}),_0x52b71b=_0x357cb9[_0x1e8107(0x23a)],_0x1086bc=_0x52b71b[_0x1e8107(0x230)]?_0x1e8107(0x1c9)+_0x52b71b[_0x1e8107(0x230)]+']':'';return console['error'](_0x1e8107(0x219)+_0x52b71b[_0x1e8107(0x24f)]['processedRows'][_0x1e8107(0x1f7)]()+_0x1e8107(0x1e6)+(_0x1e8107(0x226)+formatElapsed(_0x52b71b[_0x1e8107(0x24f)][_0x1e8107(0x231)])+_0x1086bc)),await handleQueryOutput(_0x52b71b,_0x5ae287),0x0;}catch(_0x2516d4){if(_0x2516d4 instanceof SDKError)return console[_0x1e8107(0x202)](_0x1e8107(0x24a)+_0x2516d4[_0x1e8107(0x1d0)]+']'),console[_0x1e8107(0x202)]('\x0a'+_0x2516d4[_0x1e8107(0x256)]),0x1;throw _0x2516d4;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x288065(0x233)]=a25_0x288065(0x1f9);[a25_0x288065(0x1e8)]=a25_0x288065(0x1fa);async[a25_0x288065(0x222)](_0x3e9d03){const _0x24a281=a25_0x288065,{options:_0x12c926,args:_0x1e6038,tdx:_0x42e274}=_0x3e9d03;if(_0x1e6038[_0x24a281(0x210)]===0x0)return console['error'](_0x24a281(0x1ca)),console['error'](_0x24a281(0x20e)),0x1;const _0x1dc154=_0x1e6038[0x0];try{_0x12c926[_0x24a281(0x1e0)]&&(console['error'](_0x24a281(0x1d6)+_0x12c926[_0x24a281(0x235)]),console[_0x24a281(0x202)](_0x24a281(0x21d)+_0x1dc154));const _0x5bc0a8=await withSpinner(_0x24a281(0x250)+_0x1dc154+_0x24a281(0x1f4),()=>_0x42e274[_0x24a281(0x20c)][_0x24a281(0x21e)](_0x1dc154),{'verbose':_0x12c926['verbose']}),_0x2b724f=_0x5bc0a8['data'];_0x12c926[_0x24a281(0x1e0)]&&console[_0x24a281(0x202)](_0x24a281(0x220)+_0x2b724f);const _0x5738e4=await withSpinner(_0x24a281(0x1e7)+_0x1dc154+_0x24a281(0x1f4),()=>_0x42e274['segment'][_0x24a281(0x206)](_0x2b724f),{'verbose':_0x12c926[_0x24a281(0x1e0)]}),_0x41500f=_0x5738e4[_0x24a281(0x23a)];return console[_0x24a281(0x202)](_0x24a281(0x24c)+_0x41500f['length']+_0x24a281(0x237)+(_0x41500f[_0x24a281(0x210)]!==0x1?'s':'')),await handleSDKOutput(_0x41500f,_0x12c926),0x0;}catch(_0x28cdfc){if(_0x28cdfc instanceof SDKError)return console[_0x24a281(0x202)](_0x24a281(0x1c5)+_0x28cdfc[_0x24a281(0x256)]),_0x28cdfc[_0x24a281(0x232)]&&console[_0x24a281(0x202)](_0x24a281(0x1ff)+_0x28cdfc[_0x24a281(0x232)]),0x1;throw _0x28cdfc;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:folder:show';['description']=a25_0x288065(0x1c3);async[a25_0x288065(0x222)](_0x236bc7){const _0x32ade6=a25_0x288065,{options:_0x1e3408,args:_0x113c7b,tdx:_0x4a47a3}=_0x236bc7;if(_0x113c7b[_0x32ade6(0x210)]===0x0)return console[_0x32ade6(0x202)](_0x32ade6(0x1f0)),console['error'](_0x32ade6(0x253)),0x1;try{const {parentId:_0xf38790,childId:_0x5176a8}=parseSegmentRef(_0x113c7b[0x0]);_0x1e3408['verbose']&&(console[_0x32ade6(0x202)](_0x32ade6(0x1d6)+_0x1e3408['site']),console[_0x32ade6(0x202)](_0x32ade6(0x21d)+_0xf38790),_0x5176a8&&console[_0x32ade6(0x202)](_0x32ade6(0x23b)+_0x5176a8));if(!_0x5176a8)return console[_0x32ade6(0x202)](_0x32ade6(0x1ea)),0x1;const _0x4cfc9a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf38790+_0x32ade6(0x1f4),()=>_0x4a47a3[_0x32ade6(0x20c)][_0x32ade6(0x21e)](_0xf38790),{'verbose':_0x1e3408[_0x32ade6(0x1e0)]}),_0x8c003=_0x4cfc9a['data'];_0x1e3408[_0x32ade6(0x1e0)]&&console[_0x32ade6(0x202)](_0x32ade6(0x220)+_0x8c003);const _0x487055=await withSpinner(_0x32ade6(0x257)+_0x5176a8+_0x32ade6(0x1f4),()=>_0x4a47a3[_0x32ade6(0x20c)][_0x32ade6(0x224)](_0x8c003,_0x5176a8),{'verbose':_0x1e3408[_0x32ade6(0x1e0)]}),_0x23726e=_0x487055['data'];_0x1e3408[_0x32ade6(0x1e0)]&&console[_0x32ade6(0x202)](_0x32ade6(0x1f3)+_0x23726e);const _0x312c46=await withSpinner(_0x32ade6(0x209)+_0x5176a8+'\x27...',()=>_0x4a47a3[_0x32ade6(0x20c)]['getFolder'](_0x23726e),{'verbose':_0x1e3408['verbose']});return await handleSDKOutput([_0x312c46['data']],_0x1e3408),0x0;}catch(_0x374fd4){if(_0x374fd4 instanceof SDKError)return console[_0x32ade6(0x202)](_0x32ade6(0x1c5)+_0x374fd4[_0x32ade6(0x256)]),_0x374fd4['cause']&&console[_0x32ade6(0x202)](_0x32ade6(0x1ff)+_0x374fd4[_0x32ade6(0x232)]),0x1;throw _0x374fd4;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x288065(0x233)]=a25_0x288065(0x1e1);[a25_0x288065(0x1e8)]=a25_0x288065(0x1f6);async[a25_0x288065(0x222)](_0x4631fa){const _0x5d660d=a25_0x288065,{options:_0x20b2cc,args:_0x1f1b3e,tdx:_0x56a761}=_0x4631fa,_0x528dbf=_0x1f1b3e[0x0];if(!_0x528dbf)return console[_0x5d660d(0x202)](_0x5d660d(0x24d)),console[_0x5d660d(0x202)](_0x5d660d(0x204)),console[_0x5d660d(0x202)](_0x5d660d(0x245)),console[_0x5d660d(0x202)]('Examples:'),console[_0x5d660d(0x202)](_0x5d660d(0x1c2)),console['error'](_0x5d660d(0x247)),0x1;try{const _0x4b694d=_0x20b2cc[_0x5d660d(0x21b)],_0x1c45b0=await resolveSegmentTarget(_0x528dbf,_0x4b694d,_0x20b2cc[_0x5d660d(0x1e0)]);_0x20b2cc[_0x5d660d(0x1e0)]&&console[_0x5d660d(0x202)](_0x5d660d(0x1fb)+_0x1c45b0);const _0x257987=await withSpinner(_0x5d660d(0x1ce)+_0x528dbf+_0x5d660d(0x1f4),()=>_0x56a761[_0x5d660d(0x20c)]['resolvePathToResource'](_0x1c45b0),{'verbose':_0x20b2cc[_0x5d660d(0x1e0)]}),_0x463f2d=_0x257987[_0x5d660d(0x23a)];_0x20b2cc[_0x5d660d(0x1e0)]&&(console['error'](_0x5d660d(0x1f1)+_0x463f2d[_0x5d660d(0x1c1)]),console[_0x5d660d(0x202)](_0x5d660d(0x22c)+_0x463f2d['parentId']));if(_0x463f2d[_0x5d660d(0x1c1)]===_0x5d660d(0x227))return console[_0x5d660d(0x202)](_0x5d660d(0x207)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x463f2d['type']===_0x5d660d(0x255))return console[_0x5d660d(0x202)](_0x5d660d(0x1cb)),console[_0x5d660d(0x202)](_0x5d660d(0x252)),0x1;if(!_0x463f2d['segmentId'])throw new SDKError(ErrorCode[_0x5d660d(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x43d052=await withSpinner(_0x5d660d(0x214),()=>_0x56a761['segment'][_0x5d660d(0x1cf)](_0x463f2d['parentId'],_0x463f2d[_0x5d660d(0x1ba)]),{'verbose':_0x20b2cc[_0x5d660d(0x1e0)]}),_0x5551c3=_0x43d052['data'];return _0x20b2cc['format']===_0x5d660d(0x1f8)||_0x20b2cc['format']==='jsonl'?await handleSDKOutput([{'sql':_0x5551c3}],_0x20b2cc):console[_0x5d660d(0x1be)](_0x5551c3),0x0;}catch(_0x3abf40){if(_0x3abf40 instanceof SDKError)return console[_0x5d660d(0x202)](_0x5d660d(0x1c5)+_0x3abf40['message']),_0x3abf40['cause']&&console[_0x5d660d(0x202)](_0x5d660d(0x1ff)+_0x3abf40[_0x5d660d(0x232)]),0x1;throw _0x3abf40;}}}function a25_0x561c(_0x1f2e15,_0x2c7ece){_0x1f2e15=_0x1f2e15-0x1ba;const _0x3390d2=a25_0x3390();let _0x561ccc=_0x3390d2[_0x1f2e15];return _0x561ccc;}function a25_0x3390(){const _0xaaf216=['Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','18AywYBH','\x20rows\x20','Listing\x20folders\x20for\x20parent\x20\x27','description','segment:folder:create','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','/app/ps/','Executing\x20segment\x20query...','\x20\x20Parent\x20segment:\x20','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Resolved\x20folder\x20ID:\x20','\x27...','✔\x20Created\x20folder\x20\x27','Get\x20SQL\x20query\x20for\x20child\x20segment','toLocaleString','json','segment:folder:list','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Target\x20path:\x20','SQL\x20query:\x0a','/e/','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20Cause:\x20','Creating\x20folder\x20\x27','4qduKCL','error','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','listFolders','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','getSegment','Fetching\x20folder\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','segment','Usage:\x20tdx\x20segment\x20describe\x20<path>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','length','Examples:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Fetching\x20SQL\x20for\x20segment...','813491AUBTKB','SEGMENT_FOLDER_NOT_FOUND','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','✔\x20Query\x20completed:\x20Processed\x20','467165eyoeEd','parentSegment','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Parent\x20name:\x20','resolveParentId','\x20\x20Segment\x20name:\x20','Resolved\x20parent\x20ID:\x20','398588LzTIif','execute','Options:','resolveFolderId','Resolving\x20parent\x20folder\x20\x27','in\x20','folder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','1281207RzKmEL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','green','Parent\x20ID:\x20','query','Segment\x20ID:\x20','Resolving\x20path\x20\x27','jobId','elapsedTimeMillis','cause','name','Show\x20segment\x20or\x20folder\x20details','site','parentFolder','\x20folder','Fetching\x20segment\x20details...','replace','data','Folder\x20name:\x20','\x20Opening\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','test','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','folderId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','trim','Usage:\x20tdx\x20sg\x20desc\x20<name>','✖\x20Query\x20failed\x20[','Show\x20folder\x20or\x20child\x20segment\x20details','✔\x20Found\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','parentId','stats','Resolving\x20parent\x20segment\x20\x27','SEGMENT_NOT_FOUND','Use:\x20tdx\x20ps\x20sql','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Use:\x20tdx\x20ps\x20view','parent','message','Resolving\x20folder\x20\x27','segmentId','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','cyan','1436589UZhtsa','log','(root)','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','type','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20','resolvePathToResource','272570OYIAAP','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20[Job\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','getParent','Create\x20segment\x20folder\x20for\x20organization','Resolving\x20\x27','getSegmentSQL','code','Fetching\x20folder\x20details...','Resolved\x20relative\x20path\x20to:\x20','url','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segment:desc','Site:\x20','Resolved\x20parent\x20folder\x20ID:\x20','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','setJobId','Parent\x20segment:\x20','fullPath','getFolder','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x27\x20with\x20ID:\x20','verbose','segment:sql','Folder\x20ID:\x20','671440ktdJhU'];a25_0x3390=function(){return _0xaaf216;};return a25_0x3390();}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x288065(0x1e9);[a25_0x288065(0x1e8)]=a25_0x288065(0x1cd);async[a25_0x288065(0x222)](_0x5d4598){const _0x25807b=a25_0x288065,{options:_0x68defc,args:_0x12be7b,tdx:_0x4bb95d}=_0x5d4598,_0xb3406b=_0x68defc;if(_0x12be7b[_0x25807b(0x210)]<0x2)return console['error'](_0x25807b(0x244)),console[_0x25807b(0x202)](_0x25807b(0x1bb)),0x1;const _0x53e814=_0x12be7b[0x0],_0x100f43=_0x12be7b[0x1];_0xb3406b[_0x25807b(0x1e0)]&&(console['error'](_0x25807b(0x1d6)+_0xb3406b[_0x25807b(0x235)]),console['error'](_0x25807b(0x1db)+_0x53e814),console[_0x25807b(0x202)]('Folder\x20name:\x20'+_0x100f43));let _0x541d79;if(_0xb3406b['parentFolder']){const _0xf3b569=_0xb3406b[_0x25807b(0x236)],_0x52ab34=await withSpinner(_0x25807b(0x250)+_0x53e814+_0x25807b(0x1f4),()=>_0x4bb95d['segment']['resolveParentId'](_0x53e814),{'verbose':_0xb3406b[_0x25807b(0x1e0)]}),_0x5c3d80=_0x52ab34[_0x25807b(0x23a)],_0x123f26=await withSpinner(_0x25807b(0x225)+_0xf3b569+_0x25807b(0x1f4),()=>_0x4bb95d[_0x25807b(0x20c)]['resolveFolderId'](_0x5c3d80,_0xf3b569),{'verbose':_0xb3406b[_0x25807b(0x1e0)]});_0x541d79=_0x123f26[_0x25807b(0x23a)],_0xb3406b[_0x25807b(0x1e0)]&&console['error'](_0x25807b(0x1d7)+_0x541d79);}const _0x9a1b44={'name':_0x100f43,'description':_0xb3406b['description'],'parentFolderId':_0x541d79},_0x4656b1=await withSpinner(_0x25807b(0x200)+_0x100f43+_0x25807b(0x1f4),()=>_0x4bb95d[_0x25807b(0x20c)]['createFolder'](_0x53e814,_0x9a1b44),{'verbose':_0xb3406b[_0x25807b(0x1e0)]}),_0x50e522=_0x4656b1['data'];return console[_0x25807b(0x202)](_0x25807b(0x1f5)+_0x50e522[_0x25807b(0x233)]+_0x25807b(0x1df)+_0x50e522['id']),await handleSDKOutput([_0x50e522],_0xb3406b),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x288065(0x233)]='segment:view';[a25_0x288065(0x1e8)]=a25_0x288065(0x24b);async[a25_0x288065(0x222)](_0xc79376){const _0x474c9e=a25_0x288065,{options:_0x3a1052,args:_0x456311,tdx:_0x54ea9d}=_0xc79376,_0xf9cc2=_0x456311[0x0];if(!_0xf9cc2)return console[_0x474c9e(0x202)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x474c9e(0x202)](_0x474c9e(0x203)),console['error'](_0x474c9e(0x22a)),console[_0x474c9e(0x202)](_0x474c9e(0x223)),console['error'](_0x474c9e(0x20a)),console[_0x474c9e(0x202)]('Examples:'),console['error'](_0x474c9e(0x1ef)),console[_0x474c9e(0x202)](_0x474c9e(0x21c)),console['error'](_0x474c9e(0x240)),console[_0x474c9e(0x202)](_0x474c9e(0x1c4)),0x1;try{const _0x329212=_0x3a1052[_0x474c9e(0x21b)],_0x1b2181=await resolveSegmentTarget(_0xf9cc2,_0x329212,_0x3a1052[_0x474c9e(0x1e0)]);_0x3a1052[_0x474c9e(0x1e0)]&&console[_0x474c9e(0x202)](_0x474c9e(0x1fb)+_0x1b2181);const _0x4a67f1=await withSpinner(_0x474c9e(0x1ce)+_0xf9cc2+_0x474c9e(0x1f4),()=>_0x54ea9d['segment']['resolvePathToResource'](_0x1b2181),{'verbose':_0x3a1052[_0x474c9e(0x1e0)]}),_0x38b0a2=_0x4a67f1[_0x474c9e(0x23a)];_0x3a1052[_0x474c9e(0x1e0)]&&(console['error']('Resolved\x20type:\x20'+_0x38b0a2[_0x474c9e(0x1c1)]),console[_0x474c9e(0x202)](_0x474c9e(0x22c)+_0x38b0a2[_0x474c9e(0x24e)]),_0x38b0a2[_0x474c9e(0x243)]&&console[_0x474c9e(0x202)](_0x474c9e(0x1e2)+_0x38b0a2[_0x474c9e(0x243)]),_0x38b0a2['segmentId']&&console['error'](_0x474c9e(0x22e)+_0x38b0a2[_0x474c9e(0x1ba)]));if(_0x3a1052['web']){if(_0x38b0a2[_0x474c9e(0x1c1)]===_0x474c9e(0x227))return console[_0x474c9e(0x202)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x38b0a2[_0x474c9e(0x1c1)]===_0x474c9e(0x255))return console['error'](_0x474c9e(0x1fe)),console['error']('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x38b0a2[_0x474c9e(0x1ba)])throw new SDKError(ErrorCode[_0x474c9e(0x251)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4404e4=getConsoleNextUrl(_0x3a1052['site'],_0x474c9e(0x1eb)+_0x38b0a2[_0x474c9e(0x24e)]+'/e/'+_0x38b0a2[_0x474c9e(0x1ba)]);return console[_0x474c9e(0x202)](a25_0x3e730a[_0x474c9e(0x22b)]('✔')+_0x474c9e(0x23c)+a25_0x3e730a[_0x474c9e(0x1bc)](_0x4404e4)),openBrowser(_0x4404e4),0x0;}if(_0x38b0a2['type']===_0x474c9e(0x227)){if(!_0x38b0a2['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4c82ba=await withSpinner(_0x474c9e(0x1d1),()=>_0x54ea9d['segment'][_0x474c9e(0x1dd)](_0x38b0a2[_0x474c9e(0x243)]),{'verbose':_0x3a1052[_0x474c9e(0x1e0)]});await handleSingleObjectOutput(_0x4c82ba['data'],_0x3a1052);}else{if(_0x38b0a2[_0x474c9e(0x1c1)]===_0x474c9e(0x20c)){if(!_0x38b0a2[_0x474c9e(0x1ba)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x474c9e(0x23e));const _0x47e318=await withSpinner(_0x474c9e(0x238),()=>_0x54ea9d[_0x474c9e(0x20c)][_0x474c9e(0x208)](_0x38b0a2[_0x474c9e(0x24e)],_0x38b0a2[_0x474c9e(0x1ba)]),{'verbose':_0x3a1052[_0x474c9e(0x1e0)]}),_0x208781=getConsoleNextUrl(_0x3a1052[_0x474c9e(0x235)],_0x474c9e(0x1eb)+_0x38b0a2['parentId']+_0x474c9e(0x1fd)+_0x38b0a2[_0x474c9e(0x1ba)]),_0x132be2=_0x47e318[_0x474c9e(0x23a)];_0x132be2[_0x474c9e(0x1d3)]=_0x208781,await handleSingleObjectOutput(_0x132be2,_0x3a1052);}else return console[_0x474c9e(0x202)](_0x474c9e(0x20b)),console[_0x474c9e(0x202)](_0x474c9e(0x254)),0x1;}return 0x0;}catch(_0xd8b2e){if(_0xd8b2e instanceof SDKError)return console[_0x474c9e(0x202)]('Error:\x20'+_0xd8b2e['message']),_0xd8b2e[_0x474c9e(0x232)]&&console[_0x474c9e(0x202)](_0x474c9e(0x1ff)+_0xd8b2e[_0x474c9e(0x232)]),0x1;throw _0xd8b2e;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x288065(0x233)]=a25_0x288065(0x1d5);[a25_0x288065(0x1e8)]=a25_0x288065(0x20f);async[a25_0x288065(0x222)](_0x2a3d1b){const _0x488397=a25_0x288065,{options:_0x130154,args:_0x354c3a,tdx:_0x497d7c}=_0x2a3d1b,_0x19a9c5=_0x354c3a[0x0];if(!_0x19a9c5)return console['error'](_0x488397(0x24d)),console[_0x488397(0x202)](_0x488397(0x249)),console['error'](_0x488397(0x212)),console['error'](_0x488397(0x211)),console[_0x488397(0x202)](_0x488397(0x1d9)),console[_0x488397(0x202)](_0x488397(0x218)),0x1;try{const _0x30027b=_0x130154[_0x488397(0x21b)],_0x52798f=await resolveSegmentTarget(_0x19a9c5,_0x30027b,_0x130154[_0x488397(0x1e0)]);_0x130154[_0x488397(0x1e0)]&&console['error'](_0x488397(0x1fb)+_0x52798f);const _0x2b92f2=await withSpinner(_0x488397(0x1ce)+_0x19a9c5+'\x27...',()=>_0x497d7c['segment'][_0x488397(0x1c6)](_0x52798f),{'verbose':_0x130154['verbose']}),_0x17a1bd=_0x2b92f2[_0x488397(0x23a)];_0x130154['verbose']&&(console[_0x488397(0x202)](_0x488397(0x1f1)+_0x17a1bd[_0x488397(0x1c1)]),console[_0x488397(0x202)](_0x488397(0x22c)+_0x17a1bd['parentId']));if(_0x17a1bd[_0x488397(0x1c1)]===_0x488397(0x227))return console[_0x488397(0x202)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error'](_0x488397(0x228)),0x1;if(_0x17a1bd[_0x488397(0x1c1)]===_0x488397(0x255))return console[_0x488397(0x202)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x17a1bd[_0x488397(0x1ba)])throw new SDKError(ErrorCode[_0x488397(0x251)],_0x488397(0x23e));const _0x122a79=await withSpinner(_0x488397(0x214),()=>_0x497d7c['segment'][_0x488397(0x1cf)](_0x17a1bd[_0x488397(0x24e)],_0x17a1bd['segmentId']),{'verbose':_0x130154['verbose']}),_0x443c1d=_0x122a79[_0x488397(0x23a)],_0x3b7aff=await executeSchemaQuery(_0x443c1d,_0x497d7c,_0x130154);return await handleQueryOutput(_0x3b7aff,_0x130154),0x0;}catch(_0x1bd040){if(_0x1bd040 instanceof SDKError)return console[_0x488397(0x202)](_0x488397(0x1c5)+_0x1bd040[_0x488397(0x256)]),_0x1bd040[_0x488397(0x232)]&&console[_0x488397(0x202)](_0x488397(0x1ff)+_0x1bd040['cause']),0x1;throw _0x1bd040;}}}
@@ -1 +1 @@
1
- const a26_0x23ab82=a26_0x11e6;(function(_0x5e229c,_0x4bf5a9){const _0x3946fc=a26_0x11e6,_0x45b280=_0x5e229c();while(!![]){try{const _0x29960e=-parseInt(_0x3946fc(0x1a7))/0x1+-parseInt(_0x3946fc(0x190))/0x2+parseInt(_0x3946fc(0x188))/0x3+-parseInt(_0x3946fc(0x191))/0x4*(parseInt(_0x3946fc(0x18f))/0x5)+parseInt(_0x3946fc(0x1a0))/0x6*(parseInt(_0x3946fc(0x193))/0x7)+-parseInt(_0x3946fc(0x177))/0x8+-parseInt(_0x3946fc(0x192))/0x9*(-parseInt(_0x3946fc(0x189))/0xa);if(_0x29960e===_0x4bf5a9)break;else _0x45b280['push'](_0x45b280['shift']());}catch(_0x5aa436){_0x45b280['push'](_0x45b280['shift']());}}}(a26_0x246b,0x498ce));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a26_0x11e6(_0x3c9f3a,_0x1a16fe){_0x3c9f3a=_0x3c9f3a-0x172;const _0x246b24=a26_0x246b();let _0x11e63d=_0x246b24[_0x3c9f3a];return _0x11e63d;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x246b(){const _0x54c143=['segmentPath','folder','segments','data','description','43712teNXge','✔\x20Created\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','verbose','invisible','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','842328ajekbU','Resolving\x20folder\x20path\x20\x27','Site:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolving\x20folder\x20\x27','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segment','\x20\x20\x20Path:\x20','Examples:','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','error','name','ruleFile','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','resolveFolderId','site','835935acxaiD','20pmdrCO','Create\x20child\x20segment\x20with\x20filtering\x20rules','resolveParentId','Parent:\x20','Segment\x20name:\x20','Creating\x20segment\x20\x27','35vMpwvt','312982VmoyWc','17468HDgsXG','988974vBvXRB','5929aLlwyg','type','includes','parent','createSegment','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','folderId','yellow','length','Parent\x20path:\x20','\x27...','984mxVeIl','kind'];a26_0x246b=function(){return _0x54c143;};return a26_0x246b();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0xb79d68 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x23ab82(0x183)]='segment:create';[a26_0x23ab82(0x1a6)]=a26_0x23ab82(0x18a);async['execute'](_0x1ec11f){const _0x2f3fd7=a26_0x23ab82;console[_0x2f3fd7(0x182)](a26_0xb79d68['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x2f3fd7(0x182)](a26_0xb79d68[_0x2f3fd7(0x19c)](_0x2f3fd7(0x17a)));const {options:_0x393594,args:_0x38a2c8,tdx:_0x244be6}=_0x1ec11f,_0x21eec2=_0x393594;if(_0x38a2c8[_0x2f3fd7(0x19d)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x2f3fd7(0x182)](_0x2f3fd7(0x173)),console[_0x2f3fd7(0x182)](_0x2f3fd7(0x17f)),console['error'](_0x2f3fd7(0x185)),console['error'](_0x2f3fd7(0x19a)),console[_0x2f3fd7(0x182)](_0x2f3fd7(0x198)),0x1;const _0x511e1b=_0x38a2c8[0x0],_0x27b863=_0x393594[_0x2f3fd7(0x1a2)];let _0xf475fc=_0x511e1b;_0x27b863&&!_0x511e1b[_0x2f3fd7(0x195)]('/')&&(_0xf475fc=_0x27b863+'/'+_0x511e1b,_0x21eec2[_0x2f3fd7(0x174)]&&console[_0x2f3fd7(0x182)]('Resolved\x20relative\x20path\x20to:\x20'+_0xf475fc));const _0x2b2eff=parsePath(_0xf475fc);if(_0x2b2eff[_0x2f3fd7(0x1a4)]['length']<0x2)return console['error'](_0x2f3fd7(0x17c)),console[_0x2f3fd7(0x182)](_0x2f3fd7(0x199)),0x1;const _0x1f2826=_0x2b2eff[_0x2f3fd7(0x1a4)][0x0],_0x54794e=getBaseName(_0xf475fc),_0x38d7af=getParentPath(_0xf475fc);_0x21eec2['verbose']&&(console[_0x2f3fd7(0x182)](_0x2f3fd7(0x179)+_0x21eec2[_0x2f3fd7(0x187)]),console[_0x2f3fd7(0x182)]('Target\x20path:\x20'+_0xf475fc),console['error'](_0x2f3fd7(0x18c)+_0x1f2826),console[_0x2f3fd7(0x182)](_0x2f3fd7(0x18d)+_0x54794e),console[_0x2f3fd7(0x182)](_0x2f3fd7(0x19e)+_0x38d7af));const _0xd4cebc=await withSpinner(_0x2f3fd7(0x181)+_0x1f2826+_0x2f3fd7(0x19f),()=>_0x244be6[_0x2f3fd7(0x17d)][_0x2f3fd7(0x18b)](_0x1f2826),{'verbose':_0x21eec2[_0x2f3fd7(0x174)]}),_0x14ffb0=_0xd4cebc[_0x2f3fd7(0x1a5)];let _0x4b125c;if(_0x2b2eff['segments'][_0x2f3fd7(0x19d)]>0x2){const _0x2b94ec=await withSpinner(_0x2f3fd7(0x178)+_0x38d7af+_0x2f3fd7(0x19f),()=>_0x244be6['segment']['resolvePathToResource'](_0x38d7af),{'verbose':_0x21eec2[_0x2f3fd7(0x174)]}),_0x27604c=_0x2b94ec[_0x2f3fd7(0x1a5)];if(_0x27604c[_0x2f3fd7(0x194)]!==_0x2f3fd7(0x1a3)&&_0x27604c[_0x2f3fd7(0x194)]!==_0x2f3fd7(0x196))return console[_0x2f3fd7(0x182)](_0x2f3fd7(0x176)),0x1;_0x4b125c=_0x27604c[_0x2f3fd7(0x19b)];}else{if(_0x21eec2['folder']){const _0x1c9efc=await withSpinner(_0x2f3fd7(0x17b)+_0x21eec2[_0x2f3fd7(0x1a3)]+'\x27...',()=>_0x244be6[_0x2f3fd7(0x17d)][_0x2f3fd7(0x186)](_0x14ffb0,_0x21eec2[_0x2f3fd7(0x1a3)]),{'verbose':_0x21eec2[_0x2f3fd7(0x174)]});_0x4b125c=_0x1c9efc[_0x2f3fd7(0x1a5)];}}_0x21eec2['verbose']&&_0x4b125c&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x4b125c);const _0x47a826=await loadJSONFromOptions(_0x21eec2['rule'],_0x21eec2[_0x2f3fd7(0x184)]),_0x5d6b52={'name':_0x54794e,'description':_0x21eec2['description'],'rule':_0x47a826,'kind':_0x21eec2[_0x2f3fd7(0x1a1)]!==undefined?parseInt(_0x21eec2[_0x2f3fd7(0x1a1)],0xa):undefined,'isVisible':_0x21eec2[_0x2f3fd7(0x175)]?![]:undefined,'segmentFolderId':_0x4b125c,'countPopulation':_0x21eec2['noCountPopulation']?![]:undefined},_0x3186d5=await withSpinner(_0x2f3fd7(0x18e)+_0x54794e+_0x2f3fd7(0x19f),()=>_0x244be6[_0x2f3fd7(0x17d)][_0x2f3fd7(0x197)](_0x14ffb0,_0x5d6b52),{'verbose':_0x21eec2[_0x2f3fd7(0x174)]}),_0x1eaea4=_0x3186d5[_0x2f3fd7(0x1a5)];return console[_0x2f3fd7(0x182)](_0x2f3fd7(0x172)+_0x1eaea4[_0x2f3fd7(0x183)]+_0x2f3fd7(0x180)+_0x1eaea4['id']),_0xf475fc!==_0x511e1b&&console[_0x2f3fd7(0x182)](_0x2f3fd7(0x17e)+_0xf475fc),await handleSDKOutput([_0x1eaea4],_0x21eec2),0x0;}}
1
+ function a26_0x5e6a(_0x1d674d,_0x18c0f5){_0x1d674d=_0x1d674d-0x136;const _0x50adf8=a26_0x50ad();let _0x5e6ac3=_0x50adf8[_0x1d674d];return _0x5e6ac3;}const a26_0x3c5b1f=a26_0x5e6a;(function(_0x4cac37,_0x121ff5){const _0x7995ad=a26_0x5e6a,_0x6a379f=_0x4cac37();while(!![]){try{const _0x5409a8=parseInt(_0x7995ad(0x138))/0x1+-parseInt(_0x7995ad(0x137))/0x2*(-parseInt(_0x7995ad(0x13f))/0x3)+parseInt(_0x7995ad(0x160))/0x4*(-parseInt(_0x7995ad(0x154))/0x5)+parseInt(_0x7995ad(0x141))/0x6*(-parseInt(_0x7995ad(0x14f))/0x7)+parseInt(_0x7995ad(0x152))/0x8+-parseInt(_0x7995ad(0x13e))/0x9+-parseInt(_0x7995ad(0x167))/0xa*(-parseInt(_0x7995ad(0x164))/0xb);if(_0x5409a8===_0x121ff5)break;else _0x6a379f['push'](_0x6a379f['shift']());}catch(_0x2d7be6){_0x6a379f['push'](_0x6a379f['shift']());}}}(a26_0x50ad,0x97d91));function a26_0x50ad(){const _0x872b3f=['Target\x20path:\x20','length','18978322ZcIYDh','error','Resolving\x20folder\x20path\x20\x27','10klhGNp','\x27...','verbose','noCountPopulation','✔\x20Created\x20segment\x20\x27','invisible','Site:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','site','14ViwMvf','858028PqQHxW','Creating\x20segment\x20\x27','Parent\x20path:\x20','segments','segment','name','8272917NtTyjC','28479kBhKdG','createSegment','282mCeEoL','resolveFolderId','yellow','type','parent','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Parent:\x20','execute','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','kind','rule','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','147427EOClrB','segment:create','resolveParentId','892360wyqGEX','folder','295fXOSKQ','Segment\x20name:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Create\x20child\x20segment\x20with\x20filtering\x20rules','data','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','ruleFile','\x20\x20\x20Path:\x20','folderId','description','15612xqtOVY','Resolved\x20relative\x20path\x20to:\x20'];a26_0x50ad=function(){return _0x872b3f;};return a26_0x50ad();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x1b64ae from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x3c5b1f(0x13d)]=a26_0x3c5b1f(0x150);['description']=a26_0x3c5b1f(0x157);async[a26_0x3c5b1f(0x149)](_0x1e2311){const _0x5f243d=a26_0x3c5b1f;console[_0x5f243d(0x165)](a26_0x1b64ae[_0x5f243d(0x143)](_0x5f243d(0x159))),console['error'](a26_0x1b64ae['yellow'](_0x5f243d(0x14e)));const {options:_0x3bdcc1,args:_0x250983,tdx:_0x34a0ce}=_0x1e2311,_0x214eb5=_0x3bdcc1;if(_0x250983['length']===0x0)return console['error'](_0x5f243d(0x15a)),console['error'](_0x5f243d(0x156)),console[_0x5f243d(0x165)]('Examples:'),console[_0x5f243d(0x165)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x5f243d(0x165)](_0x5f243d(0x14a)),console[_0x5f243d(0x165)](_0x5f243d(0x147)),0x1;const _0x3c9090=_0x250983[0x0],_0x2c10fc=_0x3bdcc1['segmentPath'];let _0x5de42f=_0x3c9090;_0x2c10fc&&!_0x3c9090['includes']('/')&&(_0x5de42f=_0x2c10fc+'/'+_0x3c9090,_0x214eb5[_0x5f243d(0x169)]&&console['error'](_0x5f243d(0x161)+_0x5de42f));const _0x5bbe45=parsePath(_0x5de42f);if(_0x5bbe45[_0x5f243d(0x13b)][_0x5f243d(0x163)]<0x2)return console['error'](_0x5f243d(0x16e)),console[_0x5f243d(0x165)](_0x5f243d(0x146)),0x1;const _0x2306c9=_0x5bbe45[_0x5f243d(0x13b)][0x0],_0x43a5b4=getBaseName(_0x5de42f),_0x3a78af=getParentPath(_0x5de42f);_0x214eb5[_0x5f243d(0x169)]&&(console[_0x5f243d(0x165)](_0x5f243d(0x16d)+_0x214eb5[_0x5f243d(0x136)]),console['error'](_0x5f243d(0x162)+_0x5de42f),console[_0x5f243d(0x165)](_0x5f243d(0x148)+_0x2306c9),console[_0x5f243d(0x165)](_0x5f243d(0x155)+_0x43a5b4),console[_0x5f243d(0x165)](_0x5f243d(0x13a)+_0x3a78af));const _0x28b160=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2306c9+'\x27...',()=>_0x34a0ce[_0x5f243d(0x13c)][_0x5f243d(0x151)](_0x2306c9),{'verbose':_0x214eb5[_0x5f243d(0x169)]}),_0x3e2ba7=_0x28b160[_0x5f243d(0x158)];let _0x26d32e;if(_0x5bbe45[_0x5f243d(0x13b)][_0x5f243d(0x163)]>0x2){const _0x2494fb=await withSpinner(_0x5f243d(0x166)+_0x3a78af+_0x5f243d(0x168),()=>_0x34a0ce[_0x5f243d(0x13c)]['resolvePathToResource'](_0x3a78af),{'verbose':_0x214eb5[_0x5f243d(0x169)]}),_0x2373c1=_0x2494fb[_0x5f243d(0x158)];if(_0x2373c1['type']!=='folder'&&_0x2373c1[_0x5f243d(0x144)]!==_0x5f243d(0x145))return console[_0x5f243d(0x165)](_0x5f243d(0x14b)),0x1;_0x26d32e=_0x2373c1[_0x5f243d(0x15e)];}else{if(_0x214eb5[_0x5f243d(0x153)]){const _0x443ef1=await withSpinner('Resolving\x20folder\x20\x27'+_0x214eb5['folder']+_0x5f243d(0x168),()=>_0x34a0ce[_0x5f243d(0x13c)][_0x5f243d(0x142)](_0x3e2ba7,_0x214eb5[_0x5f243d(0x153)]),{'verbose':_0x214eb5['verbose']});_0x26d32e=_0x443ef1[_0x5f243d(0x158)];}}_0x214eb5['verbose']&&_0x26d32e&&console['error'](_0x5f243d(0x15b)+_0x26d32e);const _0x40a6c1=await loadJSONFromOptions(_0x214eb5[_0x5f243d(0x14d)],_0x214eb5[_0x5f243d(0x15c)]),_0x2032bd={'name':_0x43a5b4,'description':_0x214eb5[_0x5f243d(0x15f)],'rule':_0x40a6c1,'kind':_0x214eb5[_0x5f243d(0x14c)]!==undefined?parseInt(_0x214eb5[_0x5f243d(0x14c)],0xa):undefined,'isVisible':_0x214eb5[_0x5f243d(0x16c)]?![]:undefined,'segmentFolderId':_0x26d32e,'countPopulation':_0x214eb5[_0x5f243d(0x16a)]?![]:undefined},_0x43035d=await withSpinner(_0x5f243d(0x139)+_0x43a5b4+_0x5f243d(0x168),()=>_0x34a0ce['segment'][_0x5f243d(0x140)](_0x3e2ba7,_0x2032bd),{'verbose':_0x214eb5['verbose']}),_0x69967b=_0x43035d[_0x5f243d(0x158)];return console[_0x5f243d(0x165)](_0x5f243d(0x16b)+_0x69967b[_0x5f243d(0x13d)]+'\x27\x20with\x20ID:\x20'+_0x69967b['id']),_0x5de42f!==_0x3c9090&&console[_0x5f243d(0x165)](_0x5f243d(0x15d)+_0x5de42f),await handleSDKOutput([_0x69967b],_0x214eb5),0x0;}}
@@ -1 +1 @@
1
- const a27_0x1ca03e=a27_0x3ecc;(function(_0x6b4b02,_0x4057a5){const _0x49f187=a27_0x3ecc,_0x3e0207=_0x6b4b02();while(!![]){try{const _0xb3d5e2=-parseInt(_0x49f187(0x11f))/0x1+-parseInt(_0x49f187(0x122))/0x2+-parseInt(_0x49f187(0x127))/0x3+-parseInt(_0x49f187(0x12a))/0x4+-parseInt(_0x49f187(0x131))/0x5*(parseInt(_0x49f187(0x12b))/0x6)+parseInt(_0x49f187(0x12e))/0x7+parseInt(_0x49f187(0x11d))/0x8;if(_0xb3d5e2===_0x4057a5)break;else _0x3e0207['push'](_0x3e0207['shift']());}catch(_0x569e7f){_0x3e0207['push'](_0x3e0207['shift']());}}}(a27_0x2ab6,0x25c66));function a27_0x2ab6(){const _0x27250e=['51160CEcBxn','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment:fields','87980icPifZ','description','Listing\x20fields\x20for\x20\x27','jsonl','error','284520NKCTlo','Site:\x20','verbose','280220qHNiwG','229818MziAKE','site','List\x20available\x20fields\x20for\x20segmentation','1136016JOLMRc','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','name','5lxzdmQ','\x20field','Parent\x20segment:\x20','parentSegment','✔\x20Found\x20','\x27...','2326288ywFMIL','Error:\x20Parent\x20segment\x20name\x20is\x20required'];a27_0x2ab6=function(){return _0x27250e;};return a27_0x2ab6();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a27_0x3ecc(_0x1b1658,_0xa9c0a3){_0x1b1658=_0x1b1658-0x11a;const _0x2ab6f8=a27_0x2ab6();let _0x3ecce2=_0x2ab6f8[_0x1b1658];return _0x3ecce2;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x1ca03e(0x130)]=a27_0x1ca03e(0x121);[a27_0x1ca03e(0x123)]=a27_0x1ca03e(0x12d);async['execute'](_0x38c021){const _0x4e25c1=a27_0x1ca03e,{options:_0x3bfb3d,args:_0x48892c,tdx:_0x817703}=_0x38c021,_0x27950b=_0x48892c[0x0]||_0x3bfb3d[_0x4e25c1(0x11a)];if(!_0x27950b)return console['error'](_0x4e25c1(0x11e)),console[_0x4e25c1(0x126)](_0x4e25c1(0x12f)),console[_0x4e25c1(0x126)](_0x4e25c1(0x120)),0x1;_0x3bfb3d[_0x4e25c1(0x129)]&&(console[_0x4e25c1(0x126)](_0x4e25c1(0x128)+_0x3bfb3d[_0x4e25c1(0x12c)]),console[_0x4e25c1(0x126)](_0x4e25c1(0x133)+_0x27950b));const _0x3bc704=await withSpinner(_0x4e25c1(0x124)+_0x27950b+_0x4e25c1(0x11c),()=>_0x817703['segment']['listFields'](_0x27950b),{'verbose':_0x3bfb3d['verbose']}),_0x418085=_0x3bc704['data'];console[_0x4e25c1(0x126)](_0x4e25c1(0x11b)+_0x418085['length']+_0x4e25c1(0x132)+(_0x418085['length']!==0x1?'s':''));if(_0x3bfb3d['json']||_0x3bfb3d[_0x4e25c1(0x125)])return await handleSDKOutput(_0x418085,_0x3bfb3d),0x0;return displayFieldsHumanReadable(_0x418085,_0x27950b),0x0;}}
1
+ const a27_0x1bf3b0=a27_0x1cc8;(function(_0x3d60c8,_0x294b35){const _0x45363b=a27_0x1cc8,_0x47cec0=_0x3d60c8();while(!![]){try{const _0x1050ad=parseInt(_0x45363b(0x1ae))/0x1*(-parseInt(_0x45363b(0x1a4))/0x2)+-parseInt(_0x45363b(0x1b0))/0x3+parseInt(_0x45363b(0x1bc))/0x4*(-parseInt(_0x45363b(0x1ab))/0x5)+-parseInt(_0x45363b(0x1b2))/0x6+parseInt(_0x45363b(0x1a8))/0x7*(parseInt(_0x45363b(0x1b7))/0x8)+-parseInt(_0x45363b(0x1a9))/0x9*(-parseInt(_0x45363b(0x1b1))/0xa)+parseInt(_0x45363b(0x1b6))/0xb;if(_0x1050ad===_0x294b35)break;else _0x47cec0['push'](_0x47cec0['shift']());}catch(_0xf63f87){_0x47cec0['push'](_0x47cec0['shift']());}}}(a27_0x2b90,0x4110e));function a27_0x2b90(){const _0x1de37d=['2ozigxO','site','json','data','3021081aQLWnW','9aDCUKB','Parent\x20segment:\x20','5zwVuzS','description','segment:fields','98876lLsLwL','Error:\x20Parent\x20segment\x20name\x20is\x20required','37269dCfvet','1645690QarRxe','647058jLqKZL','\x27...','execute','parentSegment','1331693Cvcodc','8SQGiQi','\x20field','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Site:\x20','926252CHDSmn','length','verbose','error','✔\x20Found\x20','jsonl','listFields'];a27_0x2b90=function(){return _0x1de37d;};return a27_0x2b90();}function a27_0x1cc8(_0x4c5d4e,_0x5e32c9){_0x4c5d4e=_0x4c5d4e-0x1a3;const _0x2b9094=a27_0x2b90();let _0x1cc813=_0x2b9094[_0x4c5d4e];return _0x1cc813;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a27_0x1bf3b0(0x1ad);[a27_0x1bf3b0(0x1ac)]='List\x20available\x20fields\x20for\x20segmentation';async[a27_0x1bf3b0(0x1b4)](_0x4eae07){const _0x50eeda=a27_0x1bf3b0,{options:_0x4bfe2b,args:_0x7f00e9,tdx:_0x3e2c4c}=_0x4eae07,_0x51204a=_0x7f00e9[0x0]||_0x4bfe2b[_0x50eeda(0x1b5)];if(!_0x51204a)return console[_0x50eeda(0x1bf)](_0x50eeda(0x1af)),console[_0x50eeda(0x1bf)](_0x50eeda(0x1b9)),console[_0x50eeda(0x1bf)](_0x50eeda(0x1ba)),0x1;_0x4bfe2b[_0x50eeda(0x1be)]&&(console[_0x50eeda(0x1bf)](_0x50eeda(0x1bb)+_0x4bfe2b[_0x50eeda(0x1a5)]),console[_0x50eeda(0x1bf)](_0x50eeda(0x1aa)+_0x51204a));const _0x5d6bb1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x51204a+_0x50eeda(0x1b3),()=>_0x3e2c4c['segment'][_0x50eeda(0x1a3)](_0x51204a),{'verbose':_0x4bfe2b[_0x50eeda(0x1be)]}),_0x260343=_0x5d6bb1[_0x50eeda(0x1a7)];console[_0x50eeda(0x1bf)](_0x50eeda(0x1c0)+_0x260343[_0x50eeda(0x1bd)]+_0x50eeda(0x1b8)+(_0x260343[_0x50eeda(0x1bd)]!==0x1?'s':''));if(_0x4bfe2b[_0x50eeda(0x1a6)]||_0x4bfe2b[_0x50eeda(0x1c1)])return await handleSDKOutput(_0x260343,_0x4bfe2b),0x0;return displayFieldsHumanReadable(_0x260343,_0x51204a),0x0;}}
@@ -1 +1 @@
1
- const a28_0x897b72=a28_0x2d36;(function(_0x50baed,_0x230cc3){const _0x4050ae=a28_0x2d36,_0x3c427c=_0x50baed();while(!![]){try{const _0x360efd=parseInt(_0x4050ae(0x1a2))/0x1+parseInt(_0x4050ae(0x1a3))/0x2+parseInt(_0x4050ae(0x1c8))/0x3*(-parseInt(_0x4050ae(0x198))/0x4)+parseInt(_0x4050ae(0x1bc))/0x5+parseInt(_0x4050ae(0x1ab))/0x6*(parseInt(_0x4050ae(0x1d4))/0x7)+parseInt(_0x4050ae(0x1c7))/0x8*(-parseInt(_0x4050ae(0x1aa))/0x9)+-parseInt(_0x4050ae(0x1c6))/0xa;if(_0x360efd===_0x230cc3)break;else _0x3c427c['push'](_0x3c427c['shift']());}catch(_0x65b654){_0x3c427c['push'](_0x3c427c['shift']());}}}(a28_0x2e76,0xa0b1b));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';function a28_0x2d36(_0x57e224,_0x5983e4){_0x57e224=_0x57e224-0x194;const _0x2e76b1=a28_0x2e76();let _0x2d3622=_0x2e76b1[_0x57e224];return _0x2d3622;}function a28_0x2e76(){const _0x2b8aa2=['absolutePath','dirname','568736kxImcs','1401162cEUrcD','Site:\x20','setPhase','no_parent','helpText','yellow','segment','891342AEUyZC','2706cFgxmn','description','Write\x20','\x20changed\x20files','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','isNew','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','diff','parentName','\x0aChanges\x20to\x20\x27','file','cyan','data','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20activations','utf-8','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','946075rzpkXp','message','resourceName','Parent\x20segment:\x20','length','errorCode','journeys','content','\x20=\x20','relativePath','13666110nrjvAi','8iCeDeT','175605sqRzsV','\x20new\x20files','counts','green','\x20with\x20','\x20unchanged\x20files','red','✔\x20Pulled\x20','files','pullSegments','\x20files\x20to\x20','\x20\x20Target:\x20','11235icPjdP','targetDir','\x0aPull\x20summary\x20for\x20\x27','error','✔\x20All\x20files\x20are\x20up\x20to\x20date','site','Pulling\x20segments\x20from\x20\x27','\x20journeys','✔\x20Context\x20set:\x20','verbose','journeyVersions','\x20versions)','Target\x20resource:\x20','repeat','filter','\x20\x20🎯\x20','Aborted.','4RuktxK','\x27...','hasChanges','type','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)','Error:\x20','dim','segments'];a28_0x2e76=function(){return _0x2b8aa2;};return a28_0x2e76();}import{saveSessionContext}from'../core/session.js';import a28_0x12f19e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x5e97f9 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a28_0x897b72(0x1ac)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x1aa3f0){const _0x597e3f=a28_0x897b72,{options:_0x196512,args:_0x350c73,tdx:_0x1a0afe}=_0x1aa3f0,_0x7f9bde=_0x196512,_0x4e57bf=await resolveTarget({'arg':_0x350c73[0x0],'contextParent':_0x196512['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4e57bf))return _0x4e57bf[_0x597e3f(0x1c1)]===_0x597e3f(0x1a6)?(console[_0x597e3f(0x1d7)](a28_0x12f19e[_0x597e3f(0x1a8)](_0x597e3f(0x1b1))),console['error'](_0x597e3f(0x19c)),console[_0x597e3f(0x1d7)](_0x597e3f(0x1bb)),console[_0x597e3f(0x1d7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x597e3f(0x1d7)](a28_0x12f19e[_0x597e3f(0x1ce)](_0x597e3f(0x19d)+_0x4e57bf[_0x597e3f(0x1bd)]+'\x0a')),_0x4e57bf[_0x597e3f(0x1a7)]&&console[_0x597e3f(0x1d7)](a28_0x12f19e[_0x597e3f(0x1b6)](_0x4e57bf['helpText']))),0x1;const _0x52e995=_0x4e57bf['parentName'],_0x2b0833=_0x4e57bf[_0x597e3f(0x1d5)],_0x48330e=_0x4e57bf[_0x597e3f(0x19b)]===_0x597e3f(0x1b5)?_0x4e57bf[_0x597e3f(0x1be)]:undefined;_0x7f9bde['verbose']&&(console['error'](_0x597e3f(0x1a4)+_0x7f9bde[_0x597e3f(0x1d9)]),console[_0x597e3f(0x1d7)](_0x597e3f(0x1bf)+_0x52e995),_0x48330e&&console['error'](_0x597e3f(0x1e0)+_0x48330e));const _0x2d644e=await withProgressSpinner(_0x597e3f(0x1da)+_0x52e995+_0x597e3f(0x199),_0x3f7b5c=>_0x1a0afe[_0x597e3f(0x1a9)][_0x597e3f(0x1d1)](_0x52e995,{'targetDir':_0x2b0833,'targetResourceName':_0x48330e,'verbose':_0x7f9bde[_0x597e3f(0x1dd)],'progress':{'update':_0x562042=>{const _0x5a4355=_0x597e3f;_0x3f7b5c[_0x5a4355(0x1a5)](_0x562042),_0x7f9bde['verbose']&&console[_0x5a4355(0x1d7)]('\x20\x20'+_0x562042);}}}),{'verbose':_0x7f9bde['verbose']}),_0x1e10a2=_0x2d644e[_0x597e3f(0x1b7)];if(_0x1e10a2['counts'][_0x597e3f(0x19f)]===0x0&&_0x1e10a2[_0x597e3f(0x1ca)][_0x597e3f(0x1c2)]===0x0)return console[_0x597e3f(0x1d7)](a28_0x12f19e[_0x597e3f(0x1a8)](_0x597e3f(0x1af)+_0x1e10a2[_0x597e3f(0x1b3)]+'\x27')),0x0;const _0x52465e=_0x1e10a2[_0x597e3f(0x1d0)]['filter'](_0x2edfd6=>_0x2edfd6[_0x597e3f(0x1b0)]),_0x30388c=_0x1e10a2[_0x597e3f(0x1d0)][_0x597e3f(0x195)](_0x14e223=>!_0x14e223[_0x597e3f(0x1b0)]&&_0x14e223[_0x597e3f(0x19a)]),_0x332954=_0x1e10a2[_0x597e3f(0x1d0)][_0x597e3f(0x195)](_0x17c246=>!_0x17c246[_0x597e3f(0x1b0)]&&!_0x17c246[_0x597e3f(0x19a)]);console[_0x597e3f(0x1d7)](_0x597e3f(0x1d6)+_0x1e10a2[_0x597e3f(0x1b3)]+'\x27:'),console[_0x597e3f(0x1d7)](_0x597e3f(0x196)+a28_0x12f19e['cyan'](_0x1e10a2['counts']['segments']+'\x20segments')+_0x597e3f(0x1cc)+a28_0x12f19e['cyan'](_0x1e10a2[_0x597e3f(0x1ca)]['activations']+_0x597e3f(0x1b9)));if(_0x1e10a2[_0x597e3f(0x1ca)][_0x597e3f(0x1c2)]>0x0){const _0x13bc11=_0x1e10a2[_0x597e3f(0x1ca)][_0x597e3f(0x1de)]>_0x1e10a2['counts'][_0x597e3f(0x1c2)]?'\x20('+_0x1e10a2[_0x597e3f(0x1ca)][_0x597e3f(0x1de)]+_0x597e3f(0x1df):'';console[_0x597e3f(0x1d7)]('\x20\x20🗺️\x20\x20'+a28_0x12f19e[_0x597e3f(0x1b6)](_0x1e10a2[_0x597e3f(0x1ca)][_0x597e3f(0x1c2)]+_0x597e3f(0x1db))+a28_0x12f19e['dim'](_0x13bc11));}console[_0x597e3f(0x1d7)]('\x20\x20'+a28_0x12f19e[_0x597e3f(0x1cb)]('+\x20'+_0x52465e[_0x597e3f(0x1c0)]+_0x597e3f(0x1c9))),console[_0x597e3f(0x1d7)]('\x20\x20'+a28_0x12f19e[_0x597e3f(0x1a8)]('~\x20'+_0x30388c[_0x597e3f(0x1c0)]+_0x597e3f(0x1ae))),console[_0x597e3f(0x1d7)]('\x20\x20'+a28_0x12f19e[_0x597e3f(0x19e)]('=\x20'+_0x332954[_0x597e3f(0x1c0)]+_0x597e3f(0x1cd))),console[_0x597e3f(0x1d7)](_0x597e3f(0x1d3)+a28_0x12f19e[_0x597e3f(0x1b6)](_0x1e10a2['targetDir'])+'\x0a');if(_0x30388c[_0x597e3f(0x1c0)]>0x0)for(const _0x5ba79 of _0x30388c){console['error'](_0x597e3f(0x1b4)+_0x5ba79[_0x597e3f(0x1c5)]+'\x27:'),console[_0x597e3f(0x1d7)]('─'['repeat'](0x3c)),console[_0x597e3f(0x1d7)](_0x5ba79[_0x597e3f(0x1b2)]),console[_0x597e3f(0x1d7)]('─'[_0x597e3f(0x194)](0x3c));}if(_0x7f9bde['dryRun'])return console[_0x597e3f(0x1d7)](a28_0x12f19e[_0x597e3f(0x1a8)](_0x597e3f(0x1b8))),0x0;if(_0x52465e[_0x597e3f(0x1c0)]===0x0&&_0x30388c[_0x597e3f(0x1c0)]===0x0)return console['error'](a28_0x12f19e[_0x597e3f(0x1cb)](_0x597e3f(0x1d8))),saveSessionContext({'parent_segment':_0x1e10a2[_0x597e3f(0x1b3)]},_0x7f9bde['session']),console[_0x597e3f(0x1d7)](a28_0x12f19e['green'](_0x597e3f(0x1dc)+a28_0x12f19e['dim']('parent_segment')+'\x20=\x20'+a28_0x12f19e[_0x597e3f(0x1b6)](_0x1e10a2[_0x597e3f(0x1b3)]))),0x0;if(!_0x7f9bde['yes']){const _0x49b3f9=await confirmKey(_0x597e3f(0x1ad)+(_0x52465e[_0x597e3f(0x1c0)]+_0x30388c[_0x597e3f(0x1c0)])+'\x20files?');if(!_0x49b3f9)return console[_0x597e3f(0x1d7)](_0x597e3f(0x197)),0x1;}for(const _0x3cfb7d of _0x1e10a2[_0x597e3f(0x1d0)]){if(_0x3cfb7d[_0x597e3f(0x1b0)]||_0x3cfb7d['hasChanges']){const _0x28428f=a28_0x5e97f9[_0x597e3f(0x1a1)](_0x3cfb7d[_0x597e3f(0x1a0)]);!existsSync(_0x28428f)&&mkdirSync(_0x28428f,{'recursive':!![]}),writeFileSync(_0x3cfb7d['absolutePath'],_0x3cfb7d[_0x597e3f(0x1c3)],_0x597e3f(0x1ba));}}return console[_0x597e3f(0x1d7)](a28_0x12f19e[_0x597e3f(0x1cb)](_0x597e3f(0x1cf)+(_0x52465e[_0x597e3f(0x1c0)]+_0x30388c[_0x597e3f(0x1c0)])+_0x597e3f(0x1d2)+_0x1e10a2[_0x597e3f(0x1d5)])),saveSessionContext({'parent_segment':_0x1e10a2[_0x597e3f(0x1b3)]},_0x7f9bde['session']),console[_0x597e3f(0x1d7)](a28_0x12f19e[_0x597e3f(0x1cb)](_0x597e3f(0x1dc)+a28_0x12f19e[_0x597e3f(0x19e)]('parent_segment')+_0x597e3f(0x1c4)+a28_0x12f19e['cyan'](_0x1e10a2['parentName']))),0x0;}}
1
+ function a28_0x255f(){const _0xb97d66=['content','journeyVersions','8xlFVrG','Error:\x20','error','cwd','Target\x20resource:\x20','\x20unchanged\x20files','✔\x20Context\x20set:\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Site:\x20','Pulling\x20segments\x20from\x20\x27','isNew','dryRun','\x20files?','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x27...','36990QJdFDV','\x0aPull\x20summary\x20for\x20\x27','\x20segments','yellow','segment','621004JNWKur','\x20with\x20','red','message','\x0aChanges\x20to\x20\x27','\x20changed\x20files','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','1344246sljtrc','absolutePath','\x20\x20🗺️\x20\x20','relativePath','\x20new\x20files','5CVmfMo','6XhFibw','parentSegment','verbose','Parent\x20segment:\x20','4llUEcC','green','pullSegments','session','parent_segment','hasChanges','targetDir','data','2679488xtjfxg','2648940HeAOmk','11xmsZoB','file','dim','Write\x20','segments','dirname','parentName','Aborted.','counts','\x20\x20Target:\x20','132380cOvNsY','\x20versions)','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)','1439beLDRU','description','helpText','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','utf-8','files','errorCode','filter','activations','\x20files\x20to\x20','repeat','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','length','\x20\x20🎯\x20','journeys'];a28_0x255f=function(){return _0xb97d66;};return a28_0x255f();}const a28_0x59b5e4=a28_0xbc2e;(function(_0x581d92,_0x2ae7b4){const _0x5876f4=a28_0xbc2e,_0x32718a=_0x581d92();while(!![]){try{const _0x25796c=-parseInt(_0x5876f4(0x1fb))/0x1*(parseInt(_0x5876f4(0x233))/0x2)+-parseInt(_0x5876f4(0x22f))/0x3*(-parseInt(_0x5876f4(0x222))/0x4)+-parseInt(_0x5876f4(0x22e))/0x5*(parseInt(_0x5876f4(0x229))/0x6)+-parseInt(_0x5876f4(0x23b))/0x7*(-parseInt(_0x5876f4(0x20d))/0x8)+-parseInt(_0x5876f4(0x21d))/0x9+parseInt(_0x5876f4(0x1f8))/0xa+parseInt(_0x5876f4(0x23d))/0xb*(-parseInt(_0x5876f4(0x23c))/0xc);if(_0x25796c===_0x2ae7b4)break;else _0x32718a['push'](_0x32718a['shift']());}catch(_0x1390e0){_0x32718a['push'](_0x32718a['shift']());}}}(a28_0x255f,0x3e31e));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a28_0xbc2e(_0x486375,_0x5a8c25){_0x486375=_0x486375-0x1f3;const _0x255f6a=a28_0x255f();let _0xbc2ec3=_0x255f6a[_0x486375];return _0xbc2ec3;}import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x7d6aa0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x121ed6 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a28_0x59b5e4(0x1fc)]=a28_0x59b5e4(0x228);async['execute'](_0x2df472){const _0x1891a2=a28_0x59b5e4,{options:_0x4f8dd6,args:_0x24c966,tdx:_0x376b8e}=_0x2df472,_0x370165=_0x4f8dd6,_0x5a3891=await resolveTarget({'arg':_0x24c966[0x0],'contextParent':_0x4f8dd6[_0x1891a2(0x230)],'cwd':process[_0x1891a2(0x210)]()});if(!isSuccessfulResolution(_0x5a3891))return _0x5a3891[_0x1891a2(0x202)]==='no_parent'?(console['error'](a28_0x7d6aa0[_0x1891a2(0x220)](_0x1891a2(0x215))),console['error'](_0x1891a2(0x1fa)),console[_0x1891a2(0x20f)](_0x1891a2(0x1ff)),console[_0x1891a2(0x20f)](_0x1891a2(0x21b))):(console[_0x1891a2(0x20f)](a28_0x7d6aa0[_0x1891a2(0x224)](_0x1891a2(0x20e)+_0x5a3891[_0x1891a2(0x225)]+'\x0a')),_0x5a3891[_0x1891a2(0x1fd)]&&console[_0x1891a2(0x20f)](a28_0x7d6aa0['cyan'](_0x5a3891['helpText']))),0x1;const _0x21aaf3=_0x5a3891[_0x1891a2(0x1f4)],_0x43aea7=_0x5a3891[_0x1891a2(0x239)],_0x551b4b=_0x5a3891['type']===_0x1891a2(0x23e)?_0x5a3891['resourceName']:undefined;_0x370165[_0x1891a2(0x231)]&&(console[_0x1891a2(0x20f)](_0x1891a2(0x216)+_0x370165['site']),console['error'](_0x1891a2(0x232)+_0x21aaf3),_0x551b4b&&console['error'](_0x1891a2(0x211)+_0x551b4b));const _0x32c443=await withProgressSpinner(_0x1891a2(0x217)+_0x21aaf3+_0x1891a2(0x21c),_0x3d8d87=>_0x376b8e[_0x1891a2(0x221)][_0x1891a2(0x235)](_0x21aaf3,{'targetDir':_0x43aea7,'targetResourceName':_0x551b4b,'verbose':_0x370165[_0x1891a2(0x231)],'progress':{'update':_0xcee9ad=>{const _0x1cb098=_0x1891a2;_0x3d8d87['setPhase'](_0xcee9ad),_0x370165[_0x1cb098(0x231)]&&console['error']('\x20\x20'+_0xcee9ad);}}}),{'verbose':_0x370165[_0x1891a2(0x231)]}),_0x2a7382=_0x32c443[_0x1891a2(0x23a)];if(_0x2a7382['counts']['segments']===0x0&&_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x20a)]===0x0)return console[_0x1891a2(0x20f)](a28_0x7d6aa0['yellow'](_0x1891a2(0x214)+_0x2a7382[_0x1891a2(0x1f4)]+'\x27')),0x0;const _0x4c1249=_0x2a7382[_0x1891a2(0x201)][_0x1891a2(0x203)](_0x39966c=>_0x39966c[_0x1891a2(0x218)]),_0x5df05a=_0x2a7382[_0x1891a2(0x201)]['filter'](_0x1404f3=>!_0x1404f3[_0x1891a2(0x218)]&&_0x1404f3[_0x1891a2(0x238)]),_0x5231fc=_0x2a7382[_0x1891a2(0x201)][_0x1891a2(0x203)](_0x17916a=>!_0x17916a[_0x1891a2(0x218)]&&!_0x17916a[_0x1891a2(0x238)]);console[_0x1891a2(0x20f)](_0x1891a2(0x21e)+_0x2a7382['parentName']+'\x27:'),console[_0x1891a2(0x20f)](_0x1891a2(0x209)+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x241)]+_0x1891a2(0x21f))+_0x1891a2(0x223)+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x204)]+'\x20activations'));if(_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x20a)]>0x0){const _0x32c7ea=_0x2a7382['counts']['journeyVersions']>_0x2a7382['counts'][_0x1891a2(0x20a)]?'\x20('+_0x2a7382[_0x1891a2(0x1f6)][_0x1891a2(0x20c)]+_0x1891a2(0x1f9):'';console[_0x1891a2(0x20f)](_0x1891a2(0x22b)+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382['counts'][_0x1891a2(0x20a)]+'\x20journeys')+a28_0x7d6aa0[_0x1891a2(0x23f)](_0x32c7ea));}console['error']('\x20\x20'+a28_0x7d6aa0[_0x1891a2(0x234)]('+\x20'+_0x4c1249[_0x1891a2(0x208)]+_0x1891a2(0x22d))),console['error']('\x20\x20'+a28_0x7d6aa0['yellow']('~\x20'+_0x5df05a[_0x1891a2(0x208)]+_0x1891a2(0x227))),console[_0x1891a2(0x20f)]('\x20\x20'+a28_0x7d6aa0[_0x1891a2(0x23f)]('=\x20'+_0x5231fc[_0x1891a2(0x208)]+_0x1891a2(0x212))),console['error'](_0x1891a2(0x1f7)+a28_0x7d6aa0['cyan'](_0x2a7382[_0x1891a2(0x239)])+'\x0a');if(_0x5df05a['length']>0x0)for(const _0x1262d4 of _0x5df05a){console[_0x1891a2(0x20f)](_0x1891a2(0x226)+_0x1262d4[_0x1891a2(0x22c)]+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](_0x1262d4['diff']),console['error']('─'[_0x1891a2(0x206)](0x3c));}if(_0x370165[_0x1891a2(0x219)])return console[_0x1891a2(0x20f)](a28_0x7d6aa0[_0x1891a2(0x220)](_0x1891a2(0x207))),0x0;if(_0x4c1249[_0x1891a2(0x208)]===0x0&&_0x5df05a[_0x1891a2(0x208)]===0x0)return console[_0x1891a2(0x20f)](a28_0x7d6aa0['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2a7382[_0x1891a2(0x1f4)]},_0x370165[_0x1891a2(0x236)]),console[_0x1891a2(0x20f)](a28_0x7d6aa0[_0x1891a2(0x234)](_0x1891a2(0x213)+a28_0x7d6aa0[_0x1891a2(0x23f)](_0x1891a2(0x237))+'\x20=\x20'+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382['parentName']))),0x0;if(!_0x370165['yes']){const _0x11dd62=await confirmKey(_0x1891a2(0x240)+(_0x4c1249[_0x1891a2(0x208)]+_0x5df05a[_0x1891a2(0x208)])+_0x1891a2(0x21a));if(!_0x11dd62)return console[_0x1891a2(0x20f)](_0x1891a2(0x1f5)),0x1;}for(const _0x2f6df9 of _0x2a7382['files']){if(_0x2f6df9[_0x1891a2(0x218)]||_0x2f6df9['hasChanges']){const _0x28a4ed=a28_0x121ed6[_0x1891a2(0x1f3)](_0x2f6df9[_0x1891a2(0x22a)]);!existsSync(_0x28a4ed)&&mkdirSync(_0x28a4ed,{'recursive':!![]}),writeFileSync(_0x2f6df9[_0x1891a2(0x22a)],_0x2f6df9[_0x1891a2(0x20b)],_0x1891a2(0x200));}}return console[_0x1891a2(0x20f)](a28_0x7d6aa0[_0x1891a2(0x234)]('✔\x20Pulled\x20'+(_0x4c1249[_0x1891a2(0x208)]+_0x5df05a['length'])+_0x1891a2(0x205)+_0x2a7382[_0x1891a2(0x239)])),saveSessionContext({'parent_segment':_0x2a7382[_0x1891a2(0x1f4)]},_0x370165[_0x1891a2(0x236)]),console[_0x1891a2(0x20f)](a28_0x7d6aa0['green'](_0x1891a2(0x213)+a28_0x7d6aa0[_0x1891a2(0x23f)](_0x1891a2(0x237))+'\x20=\x20'+a28_0x7d6aa0[_0x1891a2(0x1fe)](_0x2a7382[_0x1891a2(0x1f4)]))),0x0;}}
@@ -1 +1 @@
1
- const a29_0xd81b79=a29_0x3db9;(function(_0x336827,_0x4d1238){const _0x2d9462=a29_0x3db9,_0x56eb51=_0x336827();while(!![]){try{const _0x1a84ac=-parseInt(_0x2d9462(0x74))/0x1+-parseInt(_0x2d9462(0x6e))/0x2+parseInt(_0x2d9462(0x8b))/0x3+-parseInt(_0x2d9462(0xc6))/0x4+parseInt(_0x2d9462(0xb4))/0x5*(-parseInt(_0x2d9462(0x94))/0x6)+-parseInt(_0x2d9462(0xe2))/0x7*(parseInt(_0x2d9462(0xd2))/0x8)+parseInt(_0x2d9462(0x77))/0x9;if(_0x1a84ac===_0x4d1238)break;else _0x56eb51['push'](_0x56eb51['shift']());}catch(_0x56e8d7){_0x56eb51['push'](_0x56eb51['shift']());}}}(a29_0x3fc1,0xc0a8e));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x23cc89 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a29_0x3fc1(){const _0x50489f=['Error:\x20Directory\x20not\x20found:\x20','toUpdate','journeys','parentSegment','activations','changed','set','\x20to\x20delete','buildUserMaps','Fetching\x20parent\x20segment\x20details...','/app/ps/','Changes\x20to\x20journey:','delete','Error:\x20','\x20to\x20create','message','nameToType','listSegments','\x20new','unchanged','then','Scoped\x20to\x20folder:\x20','35510EpbGPR','\x20deleted','\x27...','segment:push','\x20\x20Activations:\x20','dim','toCreate','Preparing\x20journeys...','filePath','yes','journeysOnly','segments','setPhase','nameToId','/j/da/je','name','idToName','/e/','1402152TIBiMB','\x20\x20\x20\x20','Folders\x20to\x20create:','join','red','filter','relationships','(Journey\x20will\x20be\x20deleted)','Site:\x20','updated','existingJourney','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','24wsiDDI','deleted','\x20unchanged','cwd','isScoped','scopedFolderPath','file','listFolders','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','green','getOutputSchemaWithCache','\x20\x20Source:\x20','helpText','\x20\x20Activations:','New\x20journey:','folderPath','1987916kHmGLZ','resolveParentId','listJourneysWithDetailsFromParentSegment','paused','\x20created','created','segmentFolderId','yellow','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20updated','length','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','connection','\x20\x20Segments:\x20','journeyId','.yaml','targetDir','journey','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','segment','cyan','.yml','execute','\x20activations]','Error\x20parsing\x20YAML:\x20','getParent','\x20\x20📊\x20Segments:','journeyBundleName','Fetching\x20users\x20for\x20email\x20resolution...','state','description','results','errorCode','2852150GXhwRc','Delete\x20journey:','\x0aPush\x20summary\x20for\x20\x27','type','error','site','1506474IVDWkh','data','\x0a✔\x20Push\x20complete','40372470WRDQwb','diff','get','dryRun','repeat','push','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','getJourney','Parent\x20segment:\x20','Fetching\x20existing\x20activations...','Fetching\x20connections\x20for\x20name\x20resolution...','Fetching\x20existing\x20folders...','folders','list','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','all','map','Delete\x20segment:','Fetching\x20existing\x20journeys...','📁\x20','3275217epZSHG','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','attributes','new','user','segment\x20or\x20journey','Push\x20','verbose','folderId','552sEXIOP','Aborted.','listActivations','Resolving\x20parent\x20segment\x20\x27','parentName','yamlConfig','toDelete','blue','\x20\x20🗺️\x20\x20Journeys:','New\x20segment:'];a29_0x3fc1=function(){return _0x50489f;};return a29_0x3fc1();}import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a29_0x3db9(_0x2dc45a,_0x2cbf8f){_0x2dc45a=_0x2dc45a-0x69;const _0x3fc131=a29_0x3fc1();let _0x3db941=_0x3fc131[_0x2dc45a];return _0x3db941;}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a29_0xd81b79(0xb7);[a29_0xd81b79(0x6b)]=a29_0xd81b79(0xea);async[a29_0xd81b79(0xf8)](_0xc953e2){const _0x5c8320=a29_0xd81b79,{options:_0x53338b,args:_0x525037,tdx:_0x1a5074}=_0xc953e2,_0x1716c3=_0x53338b,_0x4e8628=await resolveTarget({'arg':_0x525037[0x0],'contextParent':_0x53338b[_0x5c8320(0xa1)],'cwd':process[_0x5c8320(0xd5)]()});if(!isSuccessfulResolution(_0x4e8628))return _0x4e8628[_0x5c8320(0x6d)]==='no_parent'?(console['error'](a29_0x23cc89[_0x5c8320(0xe9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x5c8320(0x72)]('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['error'](_0x5c8320(0xd1)),console[_0x5c8320(0x72)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x5c8320(0x72)](a29_0x23cc89['red'](_0x5c8320(0xab)+_0x4e8628[_0x5c8320(0xad)]+'\x0a')),_0x4e8628[_0x5c8320(0xde)]&&console[_0x5c8320(0x72)](a29_0x23cc89[_0x5c8320(0xf6)](_0x4e8628[_0x5c8320(0xde)]))),0x1;if(_0x4e8628['type']==='parent_name')return console['error'](a29_0x23cc89[_0x5c8320(0xca)](_0x5c8320(0x9e)+_0x4e8628[_0x5c8320(0xf2)]+'\x0a')),console[_0x5c8320(0x72)](a29_0x23cc89[_0x5c8320(0xf6)](_0x5c8320(0x8c))),0x1;const _0x1fa6e7=_0x4e8628[_0x5c8320(0x98)],_0x1780da=_0x4e8628[_0x5c8320(0xf2)],_0x18abf9=_0x4e8628[_0x5c8320(0x71)]===_0x5c8320(0xd8)?_0x4e8628[_0x5c8320(0xbc)]:undefined,_0x4e3433=getScopedDetails(_0x4e8628),_0x56f883=_0x4e3433?.[_0x5c8320(0xd6)]??![],_0x352517=_0x4e3433?.[_0x5c8320(0xd7)]??'';if(!existsSync(_0x1780da))return console[_0x5c8320(0x72)](a29_0x23cc89['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x1780da+'\x0a')),console[_0x5c8320(0x72)](a29_0x23cc89[_0x5c8320(0xf6)](_0x5c8320(0x8c))),0x1;_0x1716c3['verbose']&&(console[_0x5c8320(0x72)](_0x5c8320(0xce)+_0x1716c3[_0x5c8320(0x73)]),console['error'](_0x5c8320(0x7f)+_0x1fa6e7),console['error']('Source\x20directory:\x20'+_0x1780da),_0x56f883&&console[_0x5c8320(0x72)](_0x5c8320(0xb3)+_0x352517));const _0x4fc09f=await withSpinner(_0x5c8320(0x97)+_0x1fa6e7+_0x5c8320(0xb6),()=>_0x1a5074[_0x5c8320(0xf5)][_0x5c8320(0xe3)](_0x1fa6e7),{'verbose':_0x1716c3['verbose']}),_0x3e67a0=_0x4fc09f[_0x5c8320(0x75)],[_0x4265ff,_0x18dabd,_0x4f1260,_0x124dc2,_0x4e3e33]=await Promise[_0x5c8320(0x86)]([withSpinner(_0x5c8320(0xa7),()=>_0x1a5074[_0x5c8320(0xf5)][_0x5c8320(0xfb)](_0x3e67a0),{'verbose':_0x1716c3[_0x5c8320(0x92)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x1a5074[_0x5c8320(0xf5)][_0x5c8320(0xaf)](_0x3e67a0),{'verbose':_0x1716c3[_0x5c8320(0x92)]}),withSpinner(_0x5c8320(0x82),()=>_0x1a5074[_0x5c8320(0xf5)][_0x5c8320(0xd9)](_0x3e67a0),{'verbose':_0x1716c3[_0x5c8320(0x92)]}),withSpinner(_0x5c8320(0x89),()=>_0x1a5074[_0x5c8320(0xf3)][_0x5c8320(0xe4)](_0x3e67a0,{'includeAllVersions':!![]}),{'verbose':_0x1716c3[_0x5c8320(0x92)]}),withSpinner(_0x5c8320(0x69),()=>_0x1a5074[_0x5c8320(0x8f)][_0x5c8320(0xa6)](),{'verbose':_0x1716c3[_0x5c8320(0x92)]})['then'](_0x518a50=>_0x518a50[_0x5c8320(0x75)])]),_0xca36a4=_0x4265ff[_0x5c8320(0x75)],_0x5e820b=extractRootFolderId(_0xca36a4),_0x5748b2=_0x18dabd[_0x5c8320(0x75)],_0x556197=_0x4f1260[_0x5c8320(0x75)],{journeys:_0x292556,activationStepsById:_0x48c59f}=_0x124dc2[_0x5c8320(0x75)],_0x438cd5=new Map(_0x292556[_0x5c8320(0x87)](_0x55b094=>[_0x55b094['id'],_0x55b094])),_0xa2d679=_0x292556[_0x5c8320(0x87)](_0x120d43=>({'id':_0x120d43['id'],'name':_0x120d43[_0x5c8320(0x8d)][_0x5c8320(0xc3)],'journeyBundleName':_0x120d43['attributes'][_0x5c8320(0xfd)]||'','journeyBundleId':_0x120d43[_0x5c8320(0x8d)]['journeyBundleId']||'','versionNumber':_0x120d43[_0x5c8320(0x8d)]['versionNumber'],'description':_0x120d43['attributes']['description'],'state':_0x120d43[_0x5c8320(0x8d)][_0x5c8320(0x6a)],'paused':_0x120d43[_0x5c8320(0x8d)][_0x5c8320(0xe5)],'audienceId':_0x120d43['attributes']['audienceId'],'folderId':_0x120d43[_0x5c8320(0xcc)]?.['parentFolder']?.[_0x5c8320(0x75)]?.['id'],'createdAt':_0x120d43['attributes']['createdAt'],'updatedAt':_0x120d43[_0x5c8320(0x8d)]['updatedAt']})),{emailToId:_0x2404d3,idToEmail:_0x1bd91e}=_0x4e3e33,_0x11852f=await withSpinner(_0x5c8320(0x81),async()=>{const _0x127dde=_0x5c8320,_0x2c61c1=await _0x1a5074[_0x127dde(0xee)][_0x127dde(0x84)]();return buildConnectionMaps(_0x2c61c1);},{'verbose':_0x1716c3[_0x5c8320(0x92)]})[_0x5c8320(0xb2)](_0x1a5393=>_0x1a5393['data']),_0x183191=_0x11852f['nameToId'],_0x2e698e=_0x11852f[_0x5c8320(0xc4)],_0xe99475=_0x11852f[_0x5c8320(0xae)],_0x13c8e8={'emailToIdMap':_0x2404d3,'connectionNameToIdMap':_0x183191,'connectionNameToTypeMap':_0xe99475,'getSchema':_0x61f357=>_0x1a5074[_0x5c8320(0xee)][_0x5c8320(0xdc)](_0x61f357)};let {pathToId:_0x38bf71,idToPath:_0x4cf4c4}=buildFolderMaps(_0x556197);const _0x22c282=buildSegmentLookupMap(_0x5748b2,_0x4cf4c4),_0x219fe0=buildSegmentNameToIdMap(_0x5748b2),_0x1ff779=buildJourneyBundleLookupMap(_0xa2d679,_0x4cf4c4);let _0x31bb5b;if(_0x18abf9){if(!_0x18abf9['endsWith'](_0x5c8320(0xf7))&&!_0x18abf9['endsWith'](_0x5c8320(0xf1)))return console[_0x5c8320(0x72)](a29_0x23cc89['red'](_0x5c8320(0x7d)+_0x18abf9+'\x0a')),0x1;_0x31bb5b=[_0x18abf9];}else _0x31bb5b=findYamlFiles(_0x1780da);if(_0x31bb5b[_0x5c8320(0xec)]===0x0)return console[_0x5c8320(0x72)](a29_0x23cc89[_0x5c8320(0xca)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x1780da+'\x0a')),console['error'](a29_0x23cc89[_0x5c8320(0xf6)](_0x5c8320(0x85))),0x1;let _0x2086a0,_0x191578;try{const _0x1480cd=parseAndClassifyYamlFiles(_0x31bb5b,_0x1780da,{'skipSegments':_0x1716c3['journeysOnly']});_0x2086a0=_0x1480cd['segments'],_0x191578=_0x1480cd[_0x5c8320(0xa0)];const _0x149c38=validateParsedFiles(_0x1480cd,_0x1780da);if(_0x149c38[_0x5c8320(0xec)]>0x0)return console[_0x5c8320(0x72)](a29_0x23cc89[_0x5c8320(0xca)]('\x0aValidation\x20failed:')),console[_0x5c8320(0x72)](formatValidationErrors(_0x149c38)),console[_0x5c8320(0x72)](a29_0x23cc89['yellow'](_0x5c8320(0xda))),0x1;}catch(_0x3d6cf9){return console[_0x5c8320(0x72)](a29_0x23cc89['red'](_0x5c8320(0xfa)+(_0x3d6cf9 instanceof Error?_0x3d6cf9[_0x5c8320(0xad)]:_0x3d6cf9))),0x1;}if(_0x2086a0[_0x5c8320(0xec)]===0x0&&_0x191578[_0x5c8320(0xec)]===0x0){const _0x4262ac=_0x1716c3[_0x5c8320(0xbe)]?_0x5c8320(0xf3):_0x5c8320(0x90);return console['error'](a29_0x23cc89[_0x5c8320(0xe9)]('No\x20'+_0x4262ac+'\x20YAML\x20files\x20found')),0x0;}const _0xf0e166=new Map();_0x5748b2['length']>0x0&&!_0x1716c3[_0x5c8320(0xbe)]&&await withSpinner(_0x5c8320(0x80),async()=>{await batchAsync(_0x5748b2,async _0x5ccef5=>{const _0x2a2a61=a29_0x3db9,_0x589241=await _0x1a5074[_0x2a2a61(0xf5)][_0x2a2a61(0x96)](_0x3e67a0,_0x5ccef5['id']);_0xf0e166[_0x2a2a61(0xa4)](_0x5ccef5['id'],_0x589241);});},{'verbose':_0x1716c3['verbose']});const {segmentFiles:_0x5aec0c,foldersToCreate:_0x470f46}=await prepareSegmentFiles(_0x2086a0,{'segmentByFolderAndName':_0x22c282,'activationsBySegmentId':_0xf0e166,'folderPathToId':_0x38bf71,'idToEmailMap':_0x1bd91e,'connectionIdToNameMap':_0x2e698e},_0x13c8e8,_0x56f883,_0x352517),_0x180322=_0x18abf9?[]:findSegmentsToDelete(_0x5748b2,_0x2086a0[_0x5c8320(0x87)](({yamlConfig:_0x2e0b2e,folderPath:_0x320db8})=>({'yamlConfig':_0x2e0b2e,'folderPath':resolveTDFolderPath(_0x320db8,_0x56f883,_0x352517)})),_0x4cf4c4,_0x352517,_0x56f883),{journeyFiles:_0x2de132,foldersToCreate:_0x352a9c}=await withProgressSpinner(_0x5c8320(0xbb),async _0x5b082d=>prepareJourneyFiles(_0x191578,{'fetchJourney':async _0x6bc279=>_0x1a5074[_0x5c8320(0xf3)][_0x5c8320(0x7e)](_0x6bc279[_0x5c8320(0xf0)]),'journeyBundlesByFolderAndName':_0x1ff779,'folderPathToId':_0x38bf71,'idToEmailMap':_0x1bd91e,'connectionIdToNameMap':_0x2e698e,'existingSegments':_0x5748b2,'parentId':_0x3e67a0,'deps':_0x1a5074,'progress':{'update':_0x4f6c2e=>{const _0x1cb185=_0x5c8320;_0x5b082d[_0x1cb185(0xc0)](_0x4f6c2e),_0x1716c3[_0x1cb185(0x92)]&&console['error']('\x20\x20'+_0x4f6c2e);}},'journeyById':_0x438cd5,'activationStepsById':_0x48c59f},_0x56f883,_0x352517),{'verbose':_0x1716c3[_0x5c8320(0x92)]})[_0x5c8320(0xb2)](_0xf2b2fb=>_0xf2b2fb[_0x5c8320(0x75)]);for(const _0xdb7c3d of _0x352a9c){_0x470f46['add'](_0xdb7c3d);}const _0x5db2a0=_0x18abf9?[]:findJourneysToDelete(_0xa2d679,_0x191578['map'](({yamlConfig:_0x621559,folderPath:_0x1e35cd})=>({'yamlConfig':_0x621559,'folderPath':resolveTDFolderPath(_0x1e35cd,_0x56f883,_0x352517)})),_0x4cf4c4,_0x352517,_0x56f883),_0x2d37cf=calculatePushStats(_0x5aec0c,_0x2de132,_0x470f46,_0x180322,_0x5db2a0,!!_0x1716c3[_0x5c8320(0xaa)],!!_0x1716c3['journeysOnly']),_0x16bde8=_0x2d37cf[_0x5c8320(0xbf)][_0x5c8320(0x8e)],_0x94639=_0x2d37cf[_0x5c8320(0xbf)][_0x5c8320(0xa3)],_0x356126=_0x2d37cf[_0x5c8320(0xbf)][_0x5c8320(0xb1)],_0xc2f612=_0x2d37cf[_0x5c8320(0xbf)][_0x5c8320(0x9a)],_0x4f5f8d=_0x2d37cf[_0x5c8320(0x83)][_0x5c8320(0xba)],_0x26eb35=_0x2d37cf['journeys'][_0x5c8320(0x8e)],_0x1a3497=_0x2d37cf['journeys']['changed'],_0x4b3b7e=_0x2d37cf[_0x5c8320(0xa0)]['unchanged'],_0x34cde9=_0x2d37cf['journeys'][_0x5c8320(0x9a)],_0x4f7306=_0x2d37cf[_0x5c8320(0xa2)][_0x5c8320(0x86)],_0xc6175c=_0x2d37cf['activations'][_0x5c8320(0xba)],_0x2f81fe=_0x2d37cf[_0x5c8320(0xa2)][_0x5c8320(0x9f)],_0x3135fd=_0x2d37cf[_0x5c8320(0xa2)][_0x5c8320(0x9a)];console['error'](_0x5c8320(0x70)+_0x1fa6e7+'\x27:');_0x4f5f8d[_0x5c8320(0xec)]>0x0&&console[_0x5c8320(0x72)]('\x20\x20'+a29_0x23cc89[_0x5c8320(0x9b)](_0x5c8320(0x8a)+_0x4f5f8d[_0x5c8320(0xec)]+'\x20folders\x20to\x20create'));if(!_0x1716c3['journeysOnly']){console[_0x5c8320(0x72)](_0x5c8320(0xfc)),console[_0x5c8320(0x72)](_0x5c8320(0xc7)+a29_0x23cc89['green']('+\x20'+_0x16bde8[_0x5c8320(0xec)]+_0x5c8320(0xb0))),console['error'](_0x5c8320(0xc7)+a29_0x23cc89[_0x5c8320(0xe9)]('~\x20'+_0x94639['length']+'\x20changed'));if(_0xc2f612[_0x5c8320(0xec)]>0x0)console[_0x5c8320(0x72)](_0x5c8320(0xc7)+a29_0x23cc89[_0x5c8320(0xca)]('-\x20'+_0xc2f612[_0x5c8320(0xec)]+_0x5c8320(0xa5)));else _0x180322['length']>0x0&&!_0x1716c3[_0x5c8320(0xaa)]&&console[_0x5c8320(0x72)]('\x20\x20\x20\x20'+a29_0x23cc89[_0x5c8320(0xb9)](_0x180322[_0x5c8320(0xec)]+_0x5c8320(0xed)));console[_0x5c8320(0x72)](_0x5c8320(0xc7)+a29_0x23cc89[_0x5c8320(0xb9)]('=\x20'+_0x356126[_0x5c8320(0xec)]+'\x20unchanged'));}if(_0x2de132[_0x5c8320(0xec)]>0x0||_0x5db2a0[_0x5c8320(0xec)]>0x0){console[_0x5c8320(0x72)](_0x5c8320(0x9c)),console[_0x5c8320(0x72)]('\x20\x20\x20\x20'+a29_0x23cc89[_0x5c8320(0xdb)]('+\x20'+_0x26eb35[_0x5c8320(0xec)]+_0x5c8320(0xb0))),console[_0x5c8320(0x72)](_0x5c8320(0xc7)+a29_0x23cc89[_0x5c8320(0xe9)]('~\x20'+_0x1a3497[_0x5c8320(0xec)]+'\x20changed'));if(_0x34cde9[_0x5c8320(0xec)]>0x0)console[_0x5c8320(0x72)](_0x5c8320(0xc7)+a29_0x23cc89['red']('-\x20'+_0x34cde9[_0x5c8320(0xec)]+_0x5c8320(0xa5)));else _0x5db2a0[_0x5c8320(0xec)]>0x0&&!_0x1716c3[_0x5c8320(0xaa)]&&console[_0x5c8320(0x72)]('\x20\x20\x20\x20'+a29_0x23cc89[_0x5c8320(0xb9)](_0x5db2a0[_0x5c8320(0xec)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5c8320(0x72)](_0x5c8320(0xc7)+a29_0x23cc89[_0x5c8320(0xb9)]('=\x20'+_0x4b3b7e['length']+_0x5c8320(0xd4)));}_0x4f7306[_0x5c8320(0xec)]>0x0&&!_0x1716c3[_0x5c8320(0xbe)]&&(console[_0x5c8320(0x72)](''),console['error'](_0x5c8320(0xdf)),_0xc6175c[_0x5c8320(0xec)]>0x0&&console[_0x5c8320(0x72)](_0x5c8320(0xc7)+a29_0x23cc89[_0x5c8320(0xdb)]('+\x20'+_0xc6175c['length']+_0x5c8320(0xac))),_0x2f81fe['length']>0x0&&console[_0x5c8320(0x72)](_0x5c8320(0xc7)+a29_0x23cc89[_0x5c8320(0xe9)]('~\x20'+_0x2f81fe[_0x5c8320(0xec)]+'\x20to\x20update')),_0x3135fd[_0x5c8320(0xec)]>0x0&&console[_0x5c8320(0x72)](_0x5c8320(0xc7)+a29_0x23cc89['red']('-\x20'+_0x3135fd['length']+_0x5c8320(0xa5))));console['error'](_0x5c8320(0xdd)+a29_0x23cc89['cyan'](_0x1780da)+'\x0a');if(_0x4f5f8d[_0x5c8320(0xec)]>0x0){console[_0x5c8320(0x72)](_0x5c8320(0xc8));for(const _0x4baf13 of _0x4f5f8d){console['error']('\x20\x20'+a29_0x23cc89[_0x5c8320(0x9b)]('+')+'\x20'+_0x4baf13);}console[_0x5c8320(0x72)]('');}if(_0x16bde8[_0x5c8320(0xec)]>0x0&&!_0x1716c3['journeysOnly'])for(const _0x2c7b68 of _0x16bde8){const _0x28a001=_0x2c7b68[_0x5c8320(0xe1)]?_0x2c7b68['folderPath']+'/'+_0x2c7b68[_0x5c8320(0x99)]['name']:_0x2c7b68['yamlConfig']['name'],_0x2f264c=_0x2c7b68[_0x5c8320(0x99)][_0x5c8320(0xa2)]?.[_0x5c8320(0xec)]||0x0,_0x10d256=_0x2f264c>0x0?a29_0x23cc89['dim']('\x20['+_0x2f264c+'\x20activations]'):'';console[_0x5c8320(0x72)]('\x0a'+a29_0x23cc89[_0x5c8320(0xdb)](_0x5c8320(0x9d))+'\x20'+_0x28a001+_0x10d256),console['error']('─'[_0x5c8320(0x7b)](0x3c)),_0x2c7b68['diff']&&console[_0x5c8320(0x72)](_0x2c7b68[_0x5c8320(0x78)]),console['error']('─'['repeat'](0x3c));}if(_0xc2f612[_0x5c8320(0xec)]>0x0&&!_0x1716c3['journeysOnly'])for(const _0x5de2e9 of _0xc2f612){const _0x276892=_0x5de2e9[_0x5c8320(0xe8)]?_0x4cf4c4[_0x5c8320(0x79)](_0x5de2e9[_0x5c8320(0xe8)]['toString']())||'':'',_0xa84537=_0x276892?_0x276892+'/'+_0x5de2e9['name']:_0x5de2e9[_0x5c8320(0xc3)],_0x354f1f=_0xf0e166['get'](_0x5de2e9['id'])||[],_0x5f29c8=_0x354f1f[_0x5c8320(0xec)]>0x0?a29_0x23cc89[_0x5c8320(0xb9)]('\x20['+_0x354f1f[_0x5c8320(0xec)]+_0x5c8320(0xf9)):'';console[_0x5c8320(0x72)]('\x0a'+a29_0x23cc89[_0x5c8320(0xca)](_0x5c8320(0x88))+'\x20'+_0xa84537+_0x5f29c8),console[_0x5c8320(0x72)]('─'[_0x5c8320(0x7b)](0x3c));const _0x267e37=segmentWithActivationsToYaml(_0x5de2e9,_0x354f1f,undefined,_0x1bd91e,_0x2e698e),_0xc5bc15=segmentToYamlString(_0x267e37),_0x402eae=generateDiff(_0xc5bc15,'');console[_0x5c8320(0x72)](formatDiffWithColors(_0x402eae)),console[_0x5c8320(0x72)]('─'[_0x5c8320(0x7b)](0x3c));}const _0x29c654=_0x5aec0c[_0x5c8320(0xcb)](_0x5316bf=>!_0x5316bf['isNew']&&_0x5316bf['diff']);if(_0x29c654[_0x5c8320(0xec)]>0x0&&!_0x1716c3[_0x5c8320(0xbe)])for(const _0x2e4ca0 of _0x29c654){const _0x8987e6=_0x2e4ca0[_0x5c8320(0xe1)]?_0x2e4ca0[_0x5c8320(0xe1)]+'/'+_0x2e4ca0['yamlConfig'][_0x5c8320(0xc3)]:_0x2e4ca0[_0x5c8320(0x99)]['name'];console[_0x5c8320(0x72)]('\x0a'+a29_0x23cc89['yellow']('Changes\x20to:')+'\x20'+_0x8987e6),console[_0x5c8320(0x72)]('─'[_0x5c8320(0x7b)](0x3c)),console[_0x5c8320(0x72)](_0x2e4ca0['diff']),console[_0x5c8320(0x72)]('─'['repeat'](0x3c));}if(_0x26eb35['length']>0x0)for(const _0x5a2977 of _0x26eb35){const _0x2c75a6=_0x5a2977['folderPath']?_0x5a2977['folderPath']+'/'+_0x5a2977['yamlConfig'][_0x5c8320(0xc3)]:_0x5a2977[_0x5c8320(0x99)][_0x5c8320(0xc3)];console['error']('\x0a'+a29_0x23cc89[_0x5c8320(0xdb)](_0x5c8320(0xe0))+'\x20'+_0x2c75a6),console[_0x5c8320(0x72)]('─'[_0x5c8320(0x7b)](0x3c)),_0x5a2977[_0x5c8320(0x78)]&&console[_0x5c8320(0x72)](_0x5a2977['diff']),console['error']('─'[_0x5c8320(0x7b)](0x3c));}const _0xc2d20d=_0x2de132[_0x5c8320(0xcb)](_0x3605a0=>!_0x3605a0['isNew']&&_0x3605a0[_0x5c8320(0x78)]);if(_0xc2d20d['length']>0x0)for(const _0x250da4 of _0xc2d20d){const _0x271584=_0x250da4['folderPath']?_0x250da4['folderPath']+'/'+_0x250da4[_0x5c8320(0x99)][_0x5c8320(0xc3)]:_0x250da4[_0x5c8320(0x99)][_0x5c8320(0xc3)];console[_0x5c8320(0x72)]('\x0a'+a29_0x23cc89['yellow'](_0x5c8320(0xa9))+'\x20'+_0x271584),console[_0x5c8320(0x72)]('─'[_0x5c8320(0x7b)](0x3c)),console['error'](_0x250da4[_0x5c8320(0x78)]),console[_0x5c8320(0x72)]('─'[_0x5c8320(0x7b)](0x3c));}if(_0x34cde9[_0x5c8320(0xec)]>0x0)for(const _0x3b4e00 of _0x34cde9){const _0x51cbe3=_0x3b4e00[_0x5c8320(0x93)]?_0x4cf4c4[_0x5c8320(0x79)](_0x3b4e00['folderId'])||'':'',_0x2f3991=_0x51cbe3?_0x51cbe3+'/'+_0x3b4e00['journeyBundleName']:_0x3b4e00[_0x5c8320(0xfd)];console[_0x5c8320(0x72)]('\x0a'+a29_0x23cc89[_0x5c8320(0xca)](_0x5c8320(0x6f))+'\x20'+_0x2f3991),console[_0x5c8320(0x72)]('─'[_0x5c8320(0x7b)](0x3c)),console['error'](a29_0x23cc89[_0x5c8320(0xca)](_0x5c8320(0xcd))),console[_0x5c8320(0x72)]('─'['repeat'](0x3c));}if(_0x1716c3[_0x5c8320(0x7a)])return console[_0x5c8320(0x72)](a29_0x23cc89['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4e0b9f=_0x1716c3['journeysOnly']?![]:_0x16bde8[_0x5c8320(0xec)]>0x0||_0x94639['length']>0x0||_0xc2f612['length']>0x0,_0x5019ad=_0x26eb35['length']>0x0||_0x1a3497['length']>0x0||_0x34cde9[_0x5c8320(0xec)]>0x0,_0xc5d577=_0x1716c3[_0x5c8320(0xbe)]?![]:_0x4f7306[_0x5c8320(0xec)]>0x0,_0xfbfc82=_0x4f5f8d[_0x5c8320(0xec)]>0x0;if(!_0x4e0b9f&&!_0x5019ad&&!_0xc5d577&&!_0xfbfc82){const _0x4ec29d=_0x1716c3[_0x5c8320(0xbe)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x5c8320(0xf4);console[_0x5c8320(0x72)](a29_0x23cc89[_0x5c8320(0xdb)](_0x4ec29d));if(_0x18abf9&&_0x4b3b7e[_0x5c8320(0xec)]===0x1){const _0x723282=_0x4b3b7e[0x0];if(_0x723282[_0x5c8320(0xd0)]?.['id']){const _0x513502=getConsoleNextUrl(_0x1716c3[_0x5c8320(0x73)],_0x5c8320(0xa8)+_0x3e67a0+_0x5c8320(0xc5)+_0x723282[_0x5c8320(0xd0)]['id']+'/j/da/je');console['error']('\x20\x20'+a29_0x23cc89[_0x5c8320(0xf6)](_0x513502));}}return 0x0;}const _0x498dd0=_0x1716c3['journeysOnly']?_0x26eb35['length']+_0x1a3497['length']+_0x34cde9[_0x5c8320(0xec)]+_0x4f5f8d[_0x5c8320(0xec)]:_0x16bde8[_0x5c8320(0xec)]+_0x94639[_0x5c8320(0xec)]+_0xc2f612[_0x5c8320(0xec)]+_0x26eb35[_0x5c8320(0xec)]+_0x1a3497[_0x5c8320(0xec)]+_0x34cde9['length']+_0x4f5f8d['length']+_0x4f7306[_0x5c8320(0xec)];if(!_0x1716c3[_0x5c8320(0xbd)]&&_0x498dd0>0x0){const _0x4e64e4=await confirmKey(_0x5c8320(0x91)+_0x498dd0+'\x20changes?');if(!_0x4e64e4)return console['error'](_0x5c8320(0x95)),0x1;}const _0x1ff790={'withProgress':async(_0x315a34,_0x272954)=>{const _0x3e9fdc=_0x5c8320,_0x575dc6=await withSpinner(_0x315a34,_0x272954,{'verbose':_0x1716c3[_0x3e9fdc(0x92)]});return{'data':_0x575dc6[_0x3e9fdc(0x75)]};},'logInfo':_0x5c7cb3=>console[_0x5c8320(0x72)](a29_0x23cc89[_0x5c8320(0x9b)]('✔\x20'+_0x5c7cb3)),'logSuccess':_0x4d42c5=>console[_0x5c8320(0x72)](a29_0x23cc89[_0x5c8320(0xdb)]('✔\x20'+_0x4d42c5)),'logWarning':_0x3f4d1d=>console[_0x5c8320(0x72)](a29_0x23cc89['yellow']('⚠\x20'+_0x3f4d1d)),'logDeleted':_0x16a8d6=>console[_0x5c8320(0x72)](a29_0x23cc89['red']('✔\x20'+_0x16a8d6))},_0x55d3e9={'segment':_0x1a5074[_0x5c8320(0xf5)],'journey':_0x1a5074[_0x5c8320(0xf3)],'user':_0x1a5074[_0x5c8320(0x8f)],'connection':_0x1a5074[_0x5c8320(0xee)]};_0x4f5f8d['length']>0x0&&(_0x38bf71=await executePushFolders(_0x55d3e9,_0x4f5f8d,_0x38bf71,{'parentId':_0x3e67a0},_0x1ff790));const _0xd288c1={'rootFolderId':_0x5e820b,'folderPathToId':_0x38bf71,'folderIdToPath':_0x4cf4c4,'segmentNameToId':_0x219fe0,'activationsBySegmentId':_0xf0e166,'emailToIdMap':_0x2404d3,'idToEmailMap':_0x1bd91e,'connectionNameToIdMap':_0x11852f[_0x5c8320(0xc1)],'connectionIdToNameMap':_0x11852f['idToName'],'connectionNameToTypeMap':_0xe99475},_0x2ad97f=await executePushSegments(_0x55d3e9,_0x1716c3[_0x5c8320(0xbe)]?[]:_0x5aec0c,_0xd288c1,{'parentId':_0x3e67a0},_0x1ff790),_0x221961=_0x2ad97f['created'],_0x29b02f=_0x2ad97f[_0x5c8320(0xcf)],_0x5635c1=_0x2ad97f['activations'][_0x5c8320(0xe7)],_0x483b1c=_0x2ad97f['activations'][_0x5c8320(0xcf)],_0x53382c=_0x2ad97f['activations'][_0x5c8320(0xd3)],_0x2d57a3=await executePushSegmentDeletions(_0x55d3e9,_0x1716c3[_0x5c8320(0xbe)]?[]:_0xc2f612,_0x1ff790);let _0x1f0075=0x0,_0x2a1f35=0x0,_0x40ba3b=0x0;const _0x59a24e=new Map(_0x219fe0);for(const [_0x3fca0f,_0x4ccb34]of _0x2ad97f['createdSegmentIds']){_0x59a24e[_0x5c8320(0xa4)](_0x3fca0f,_0x4ccb34);}if(_0x2de132[_0x5c8320(0xec)]>0x0){const _0x5120cc={..._0xd288c1,'segmentNameToId':_0x59a24e,'existingSegments':_0x5748b2,'activationContext':_0x13c8e8},_0x435f7c=await executePushJourneys(_0x55d3e9,_0x2de132,_0x5120cc,{'parentId':_0x3e67a0,'rootFolderId':_0x5e820b,'verbose':_0x1716c3[_0x5c8320(0x92)]},_0x1ff790);_0x1f0075=_0x435f7c[_0x5c8320(0xe7)],_0x2a1f35=_0x435f7c['updated'];if(_0x18abf9&&_0x435f7c[_0x5c8320(0x6c)]['length']===0x1){const _0x3d8e22=_0x435f7c[_0x5c8320(0x6c)][0x0];if(_0x3d8e22[_0x5c8320(0xf0)]){const _0x121e16=getConsoleNextUrl(_0x1716c3[_0x5c8320(0x73)],_0x5c8320(0xa8)+_0x3e67a0+'/e/'+_0x3d8e22[_0x5c8320(0xf0)]+_0x5c8320(0xc2));console[_0x5c8320(0x72)]('\x20\x20'+a29_0x23cc89[_0x5c8320(0xf6)](_0x121e16));}}}for(const _0x18ea9e of _0x34cde9){console[_0x5c8320(0x72)](a29_0x23cc89['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x18ea9e[_0x5c8320(0xfd)])),_0x40ba3b++;}const _0x2555ff=[];if(_0x221961>0x0)_0x2555ff['push'](_0x221961+_0x5c8320(0xe6));if(_0x29b02f>0x0)_0x2555ff[_0x5c8320(0x7c)](_0x29b02f+_0x5c8320(0xeb));if(_0x2d57a3>0x0)_0x2555ff[_0x5c8320(0x7c)](_0x2d57a3+_0x5c8320(0xb5));const _0x312303=[];if(_0x1f0075>0x0)_0x312303[_0x5c8320(0x7c)](_0x1f0075+_0x5c8320(0xe6));if(_0x2a1f35>0x0)_0x312303[_0x5c8320(0x7c)](_0x2a1f35+_0x5c8320(0xeb));if(_0x40ba3b>0x0)_0x312303[_0x5c8320(0x7c)](_0x40ba3b+_0x5c8320(0xb5));const _0x4efa6e=[];if(_0x5635c1>0x0)_0x4efa6e[_0x5c8320(0x7c)](_0x5635c1+_0x5c8320(0xe6));if(_0x483b1c>0x0)_0x4efa6e[_0x5c8320(0x7c)](_0x483b1c+_0x5c8320(0xeb));if(_0x53382c>0x0)_0x4efa6e['push'](_0x53382c+_0x5c8320(0xb5));return console['error'](a29_0x23cc89[_0x5c8320(0xdb)](_0x5c8320(0x76))),_0x2555ff[_0x5c8320(0xec)]>0x0&&!_0x1716c3[_0x5c8320(0xbe)]&&console[_0x5c8320(0x72)](_0x5c8320(0xef)+_0x2555ff[_0x5c8320(0xc9)](',\x20')),_0x312303[_0x5c8320(0xec)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x312303[_0x5c8320(0xc9)](',\x20')),_0x4efa6e['length']>0x0&&!_0x1716c3[_0x5c8320(0xbe)]&&console[_0x5c8320(0x72)](_0x5c8320(0xb8)+_0x4efa6e['join'](',\x20')),0x0;}}
1
+ const a29_0x1aaedb=a29_0x34e3;(function(_0x49e24e,_0xb6d422){const _0x480d08=a29_0x34e3,_0x257466=_0x49e24e();while(!![]){try{const _0x2f0d66=-parseInt(_0x480d08(0x112))/0x1*(-parseInt(_0x480d08(0x8a))/0x2)+-parseInt(_0x480d08(0xb5))/0x3*(parseInt(_0x480d08(0x124))/0x4)+parseInt(_0x480d08(0xbb))/0x5*(-parseInt(_0x480d08(0x106))/0x6)+parseInt(_0x480d08(0xe6))/0x7+parseInt(_0x480d08(0xbd))/0x8*(-parseInt(_0x480d08(0xd1))/0x9)+parseInt(_0x480d08(0x94))/0xa*(-parseInt(_0x480d08(0xdc))/0xb)+parseInt(_0x480d08(0x123))/0xc;if(_0x2f0d66===_0xb6d422)break;else _0x257466['push'](_0x257466['shift']());}catch(_0x43a38d){_0x257466['push'](_0x257466['shift']());}}}(a29_0x1fb6,0xcfddc));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a29_0x34e3(_0xf0de1e,_0x5f2a2b){_0xf0de1e=_0xf0de1e-0x86;const _0x1fb613=a29_0x1fb6();let _0x34e35c=_0x1fb613[_0xf0de1e];return _0x34e35c;}import{batchAsync}from'../utils/async.js';function a29_0x1fb6(){const _0x545402=['\x20folders\x20to\x20create','1759359pzXczf','resolveParentId','name','\x20\x20\x20\x20','Fetching\x20users\x20for\x20email\x20resolution...','Folders\x20to\x20create:','delete','set','.yml','all','Fetching\x20parent\x20segment\x20details...','📁\x20','helpText','results','message','New\x20journey:','data','idToName','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','dim','\x20to\x20delete','Fetching\x20existing\x20journeys...','join','journeyId','dryRun','\x20deleted','endsWith','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','setPhase','\x20changes?','\x20unchanged','toDelete','540lmFypz','/e/','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','user','updated','errorCode','Scoped\x20to\x20folder:\x20','Fetching\x20existing\x20folders...','\x20new','repeat','journeyBundleId','\x20changed','1126847YosrEp','yes','getParent','/j/da/je','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','new','\x20\x20🗺️\x20\x20Journeys:','connection','cwd','\x0aValidation\x20failed:','Parent\x20segment:\x20','cyan','description','journey','paused','Fetching\x20existing\x20activations...','relationships','37925628MmUEXJ','748MAzYlz','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)','Error\x20parsing\x20YAML:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','diff','add','2CZjiIJ','nameToType','\x20\x20Journeys:\x20','Error:\x20Directory\x20not\x20found:\x20','\x0a✔\x20Push\x20complete','\x20to\x20update','Fetching\x20connections\x20for\x20name\x20resolution...','length','Changes\x20to:','deleted','113770MDWXSz','state','New\x20segment:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Delete\x20segment:','yamlConfig','No\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','journeysOnly','red','existingJourney','toString','getJourney','blue','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','listJourneysWithDetailsFromParentSegment','getOutputSchemaWithCache','green','get','yellow','\x20created','Error:\x20','\x20YAML\x20files\x20found','Fetching\x20existing\x20segments...','toUpdate','filter','activations','map','isNew','buildUserMaps','journeys','site','23184onDXkr','segmentFolderId','Push\x20','Changes\x20to\x20journey:','.yaml','Delete\x20journey:','2095TMAEeI','listFolders','5608GgTGLW','segment','folderId','versionNumber','type','\x20updated','filePath','parentFolder','changed','parentName','\x20\x20Activations:','\x20activations]','audienceId','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aPush\x20summary\x20for\x20\x27','segments','listActivations','listSegments','Aborted.','error','20268ZvJarZ','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20\x20Source:\x20','journeyBundleName','toCreate','nameToId','then','no_parent','folders','verbose','\x20to\x20create','605XnjiXc','Resolving\x20parent\x20segment\x20\x27','push','folderPath','attributes','parent_name','created','(Journey\x20will\x20be\x20deleted)','/app/ps/'];a29_0x1fb6=function(){return _0x545402;};return a29_0x1fb6();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x41437a from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a29_0x1aaedb(0xe8)]='segment:push';[a29_0x1aaedb(0x11e)]=a29_0x1aaedb(0x97);async['execute'](_0x1b86bc){const _0x518948=a29_0x1aaedb,{options:_0x2135c2,args:_0x589a59,tdx:_0x424321}=_0x1b86bc,_0x4b34ba=_0x2135c2,_0x28762e=await resolveTarget({'arg':_0x589a59[0x0],'contextParent':_0x2135c2['parentSegment'],'cwd':process[_0x518948(0x11a)]()});if(!isSuccessfulResolution(_0x28762e))return _0x28762e[_0x518948(0x10b)]===_0x518948(0xd8)?(console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x518948(0xd0)](_0x518948(0x125)),console[_0x518948(0xd0)](_0x518948(0x108)),console[_0x518948(0xd0)](_0x518948(0x9c))):(console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0xaa)+_0x28762e[_0x518948(0xf4)]+'\x0a')),_0x28762e[_0x518948(0xf2)]&&console['error'](a29_0x41437a['cyan'](_0x28762e['helpText']))),0x1;if(_0x28762e[_0x518948(0xc1)]===_0x518948(0xe1))return console['error'](a29_0x41437a['red'](_0x518948(0x8d)+_0x28762e['targetDir']+'\x0a')),console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x11d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0xb86f41=_0x28762e[_0x518948(0xc6)],_0x1ce4f7=_0x28762e['targetDir'],_0x1ea3f8=_0x28762e[_0x518948(0xc1)]==='file'?_0x28762e[_0x518948(0xc3)]:undefined,_0x4eb4d8=getScopedDetails(_0x28762e),_0x1e5a93=_0x4eb4d8?.['isScoped']??![],_0x25429c=_0x4eb4d8?.['scopedFolderPath']??'';if(!existsSync(_0x1ce4f7))return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x8d)+_0x1ce4f7+'\x0a')),console['error'](a29_0x41437a[_0x518948(0x11d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x4b34ba[_0x518948(0xda)]&&(console[_0x518948(0xd0)]('Site:\x20'+_0x4b34ba[_0x518948(0xb4)]),console[_0x518948(0xd0)](_0x518948(0x11c)+_0xb86f41),console[_0x518948(0xd0)]('Source\x20directory:\x20'+_0x1ce4f7),_0x1e5a93&&console[_0x518948(0xd0)](_0x518948(0x10c)+_0x25429c));const _0xa09d2d=await withSpinner(_0x518948(0xdd)+_0xb86f41+'\x27...',()=>_0x424321[_0x518948(0xbe)][_0x518948(0xe7)](_0xb86f41),{'verbose':_0x4b34ba['verbose']}),_0x39c6a2=_0xa09d2d['data'],[_0x405b34,_0x367368,_0x4835c7,_0x2f69e8,_0x472523]=await Promise[_0x518948(0xef)]([withSpinner(_0x518948(0xf0),()=>_0x424321['segment'][_0x518948(0x114)](_0x39c6a2),{'verbose':_0x4b34ba[_0x518948(0xda)]}),withSpinner(_0x518948(0xac),()=>_0x424321[_0x518948(0xbe)][_0x518948(0xce)](_0x39c6a2),{'verbose':_0x4b34ba[_0x518948(0xda)]}),withSpinner(_0x518948(0x10d),()=>_0x424321[_0x518948(0xbe)][_0x518948(0xbc)](_0x39c6a2),{'verbose':_0x4b34ba['verbose']}),withSpinner(_0x518948(0xfb),()=>_0x424321['journey'][_0x518948(0xa4)](_0x39c6a2,{'includeAllVersions':!![]}),{'verbose':_0x4b34ba[_0x518948(0xda)]}),withSpinner(_0x518948(0xea),()=>_0x424321[_0x518948(0x109)][_0x518948(0xb2)](),{'verbose':_0x4b34ba[_0x518948(0xda)]})['then'](_0x269074=>_0x269074[_0x518948(0xf6)])]),_0xd07a0d=_0x405b34[_0x518948(0xf6)],_0x4b7a36=extractRootFolderId(_0xd07a0d),_0x371b81=_0x367368[_0x518948(0xf6)],_0x14438c=_0x4835c7['data'],{journeys:_0x52b3d2,activationStepsById:_0x105872}=_0x2f69e8['data'],_0x46c8e1=new Map(_0x52b3d2[_0x518948(0xb0)](_0x3b7b9d=>[_0x3b7b9d['id'],_0x3b7b9d])),_0x46f229=_0x52b3d2[_0x518948(0xb0)](_0xd7e947=>({'id':_0xd7e947['id'],'name':_0xd7e947[_0x518948(0xe0)]['name'],'journeyBundleName':_0xd7e947['attributes'][_0x518948(0xd4)]||'','journeyBundleId':_0xd7e947['attributes'][_0x518948(0x110)]||'','versionNumber':_0xd7e947[_0x518948(0xe0)][_0x518948(0xc0)],'description':_0xd7e947['attributes'][_0x518948(0x11e)],'state':_0xd7e947[_0x518948(0xe0)][_0x518948(0x95)],'paused':_0xd7e947[_0x518948(0xe0)][_0x518948(0x120)],'audienceId':_0xd7e947['attributes'][_0x518948(0xc9)],'folderId':_0xd7e947[_0x518948(0x122)]?.[_0x518948(0xc4)]?.[_0x518948(0xf6)]?.['id'],'createdAt':_0xd7e947[_0x518948(0xe0)]['createdAt'],'updatedAt':_0xd7e947[_0x518948(0xe0)]['updatedAt']})),{emailToId:_0x145a24,idToEmail:_0x7c5a05}=_0x472523,_0x10426c=await withSpinner(_0x518948(0x90),async()=>{const _0x15aa0a=_0x518948,_0x4d6aae=await _0x424321[_0x15aa0a(0x119)]['list']();return buildConnectionMaps(_0x4d6aae);},{'verbose':_0x4b34ba['verbose']})[_0x518948(0xd7)](_0x5f2b52=>_0x5f2b52[_0x518948(0xf6)]),_0x6c537d=_0x10426c[_0x518948(0xd6)],_0x246193=_0x10426c[_0x518948(0xf7)],_0x19d89f=_0x10426c[_0x518948(0x8b)],_0x37da93={'emailToIdMap':_0x145a24,'connectionNameToIdMap':_0x6c537d,'connectionNameToTypeMap':_0x19d89f,'getSchema':_0x361e23=>_0x424321[_0x518948(0x119)][_0x518948(0xa5)](_0x361e23)};let {pathToId:_0x46f139,idToPath:_0x253b15}=buildFolderMaps(_0x14438c);const _0xd620aa=buildSegmentLookupMap(_0x371b81,_0x253b15),_0x729cdc=buildSegmentNameToIdMap(_0x371b81),_0x16ff36=buildJourneyBundleLookupMap(_0x46f229,_0x253b15);let _0xa6c3e3;if(_0x1ea3f8){if(!_0x1ea3f8[_0x518948(0x100)](_0x518948(0xee))&&!_0x1ea3f8[_0x518948(0x100)](_0x518948(0xb9)))return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x116)+_0x1ea3f8+'\x0a')),0x1;_0xa6c3e3=[_0x1ea3f8];}else _0xa6c3e3=findYamlFiles(_0x1ce4f7);if(_0xa6c3e3['length']===0x0)return console[_0x518948(0xd0)](a29_0x41437a['red'](_0x518948(0xa3)+_0x1ce4f7+'\x0a')),console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x11d)](_0x518948(0xf8))),0x1;let _0x3c727e,_0x373c4c;try{const _0x232888=parseAndClassifyYamlFiles(_0xa6c3e3,_0x1ce4f7,{'skipSegments':_0x4b34ba[_0x518948(0x9d)]});_0x3c727e=_0x232888[_0x518948(0xcc)],_0x373c4c=_0x232888['journeys'];const _0x3f70f3=validateParsedFiles(_0x232888,_0x1ce4f7);if(_0x3f70f3[_0x518948(0x91)]>0x0)return console['error'](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x11b))),console[_0x518948(0xd0)](formatValidationErrors(_0x3f70f3)),console['error'](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x87))),0x1;}catch(_0x30f82d){return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0x86)+(_0x30f82d instanceof Error?_0x30f82d[_0x518948(0xf4)]:_0x30f82d))),0x1;}if(_0x3c727e[_0x518948(0x91)]===0x0&&_0x373c4c[_0x518948(0x91)]===0x0){const _0x332330=_0x4b34ba[_0x518948(0x9d)]?_0x518948(0x11f):'segment\x20or\x20journey';return console['error'](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x9a)+_0x332330+_0x518948(0xab))),0x0;}const _0x495d66=new Map();_0x371b81[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&await withSpinner(_0x518948(0x121),async()=>{await batchAsync(_0x371b81,async _0x4ab78b=>{const _0x1f4c1c=a29_0x34e3,_0x58d426=await _0x424321[_0x1f4c1c(0xbe)][_0x1f4c1c(0xcd)](_0x39c6a2,_0x4ab78b['id']);_0x495d66[_0x1f4c1c(0xed)](_0x4ab78b['id'],_0x58d426);});},{'verbose':_0x4b34ba[_0x518948(0xda)]});const {segmentFiles:_0x2a5e49,foldersToCreate:_0x20e931}=await prepareSegmentFiles(_0x3c727e,{'segmentByFolderAndName':_0xd620aa,'activationsBySegmentId':_0x495d66,'folderPathToId':_0x46f139,'idToEmailMap':_0x7c5a05,'connectionIdToNameMap':_0x246193},_0x37da93,_0x1e5a93,_0x25429c),_0x11cd80=_0x1ea3f8?[]:findSegmentsToDelete(_0x371b81,_0x3c727e[_0x518948(0xb0)](({yamlConfig:_0x4fd741,folderPath:_0x158eb8})=>({'yamlConfig':_0x4fd741,'folderPath':resolveTDFolderPath(_0x158eb8,_0x1e5a93,_0x25429c)})),_0x253b15,_0x25429c,_0x1e5a93),{journeyFiles:_0x1ea6d5,foldersToCreate:_0x83cd9d}=await withProgressSpinner('Preparing\x20journeys...',async _0x223637=>prepareJourneyFiles(_0x373c4c,{'fetchJourney':async _0x925d1d=>_0x424321[_0x518948(0x11f)][_0x518948(0xa1)](_0x925d1d[_0x518948(0xfd)]),'journeyBundlesByFolderAndName':_0x16ff36,'folderPathToId':_0x46f139,'idToEmailMap':_0x7c5a05,'connectionIdToNameMap':_0x246193,'existingSegments':_0x371b81,'parentId':_0x39c6a2,'deps':_0x424321,'progress':{'update':_0x5572ef=>{const _0x51814a=_0x518948;_0x223637[_0x51814a(0x102)](_0x5572ef),_0x4b34ba[_0x51814a(0xda)]&&console[_0x51814a(0xd0)]('\x20\x20'+_0x5572ef);}},'journeyById':_0x46c8e1,'activationStepsById':_0x105872},_0x1e5a93,_0x25429c),{'verbose':_0x4b34ba[_0x518948(0xda)]})[_0x518948(0xd7)](_0x3b6311=>_0x3b6311[_0x518948(0xf6)]);for(const _0x1b3b48 of _0x83cd9d){_0x20e931[_0x518948(0x89)](_0x1b3b48);}const _0xebf947=_0x1ea3f8?[]:findJourneysToDelete(_0x46f229,_0x373c4c[_0x518948(0xb0)](({yamlConfig:_0x5ed124,folderPath:_0x3e277a})=>({'yamlConfig':_0x5ed124,'folderPath':resolveTDFolderPath(_0x3e277a,_0x1e5a93,_0x25429c)})),_0x253b15,_0x25429c,_0x1e5a93),_0x302570=calculatePushStats(_0x2a5e49,_0x1ea6d5,_0x20e931,_0x11cd80,_0xebf947,!!_0x4b34ba[_0x518948(0xec)],!!_0x4b34ba[_0x518948(0x9d)]),_0x5b340c=_0x302570['segments'][_0x518948(0x117)],_0x2ac72d=_0x302570[_0x518948(0xcc)]['changed'],_0x29941c=_0x302570['segments']['unchanged'],_0x3ce5cf=_0x302570['segments']['toDelete'],_0x25c233=_0x302570[_0x518948(0xd9)][_0x518948(0xd5)],_0x1a7544=_0x302570[_0x518948(0xb3)][_0x518948(0x117)],_0x74bc24=_0x302570[_0x518948(0xb3)][_0x518948(0xc5)],_0x3ca522=_0x302570['journeys']['unchanged'],_0x597227=_0x302570['journeys'][_0x518948(0x105)],_0x1a5035=_0x302570[_0x518948(0xaf)]['all'],_0xaae605=_0x302570[_0x518948(0xaf)][_0x518948(0xd5)],_0x137c4e=_0x302570[_0x518948(0xaf)][_0x518948(0xad)],_0x4f93f6=_0x302570[_0x518948(0xaf)][_0x518948(0x105)];console['error'](_0x518948(0xcb)+_0xb86f41+'\x27:');_0x25c233[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a[_0x518948(0xa2)](_0x518948(0xf1)+_0x25c233[_0x518948(0x91)]+_0x518948(0xe5)));if(!_0x4b34ba[_0x518948(0x9d)]){console[_0x518948(0xd0)]('\x20\x20📊\x20Segments:'),console[_0x518948(0xd0)]('\x20\x20\x20\x20'+a29_0x41437a[_0x518948(0xa6)]('+\x20'+_0x5b340c[_0x518948(0x91)]+_0x518948(0x10e))),console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a['yellow']('~\x20'+_0x2ac72d[_0x518948(0x91)]+'\x20changed'));if(_0x3ce5cf[_0x518948(0x91)]>0x0)console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a['red']('-\x20'+_0x3ce5cf[_0x518948(0x91)]+'\x20to\x20delete'));else _0x11cd80[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0xec)]&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xf9)](_0x11cd80[_0x518948(0x91)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xf9)]('=\x20'+_0x29941c['length']+_0x518948(0x104)));}if(_0x1ea6d5[_0x518948(0x91)]>0x0||_0xebf947[_0x518948(0x91)]>0x0){console[_0x518948(0xd0)](_0x518948(0x118)),console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xa6)]('+\x20'+_0x1a7544[_0x518948(0x91)]+_0x518948(0x10e))),console[_0x518948(0xd0)]('\x20\x20\x20\x20'+a29_0x41437a[_0x518948(0xa8)]('~\x20'+_0x74bc24[_0x518948(0x91)]+_0x518948(0x111)));if(_0x597227['length']>0x0)console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0x9e)]('-\x20'+_0x597227[_0x518948(0x91)]+_0x518948(0xfa)));else _0xebf947[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0xec)]&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xf9)](_0xebf947[_0x518948(0x91)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x518948(0xd0)]('\x20\x20\x20\x20'+a29_0x41437a[_0x518948(0xf9)]('=\x20'+_0x3ca522[_0x518948(0x91)]+'\x20unchanged'));}_0x1a5035['length']>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&(console['error'](''),console[_0x518948(0xd0)](_0x518948(0xc7)),_0xaae605[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xa6)]('+\x20'+_0xaae605[_0x518948(0x91)]+_0x518948(0xdb))),_0x137c4e[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0xa8)]('~\x20'+_0x137c4e[_0x518948(0x91)]+_0x518948(0x8f))),_0x4f93f6[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0xe9)+a29_0x41437a[_0x518948(0x9e)]('-\x20'+_0x4f93f6['length']+_0x518948(0xfa))));console[_0x518948(0xd0)](_0x518948(0xd3)+a29_0x41437a[_0x518948(0x11d)](_0x1ce4f7)+'\x0a');if(_0x25c233['length']>0x0){console[_0x518948(0xd0)](_0x518948(0xeb));for(const _0x1b6601 of _0x25c233){console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a[_0x518948(0xa2)]('+')+'\x20'+_0x1b6601);}console['error']('');}if(_0x5b340c[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)])for(const _0x3d7c97 of _0x5b340c){const _0x133ca7=_0x3d7c97[_0x518948(0xdf)]?_0x3d7c97[_0x518948(0xdf)]+'/'+_0x3d7c97[_0x518948(0x99)][_0x518948(0xe8)]:_0x3d7c97[_0x518948(0x99)]['name'],_0x453bca=_0x3d7c97[_0x518948(0x99)][_0x518948(0xaf)]?.[_0x518948(0x91)]||0x0,_0x5745dc=_0x453bca>0x0?a29_0x41437a['dim']('\x20['+_0x453bca+'\x20activations]'):'';console[_0x518948(0xd0)]('\x0a'+a29_0x41437a[_0x518948(0xa6)](_0x518948(0x96))+'\x20'+_0x133ca7+_0x5745dc),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c)),_0x3d7c97[_0x518948(0x88)]&&console['error'](_0x3d7c97[_0x518948(0x88)]),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}if(_0x3ce5cf['length']>0x0&&!_0x4b34ba['journeysOnly'])for(const _0x1a6cd0 of _0x3ce5cf){const _0x2ae34a=_0x1a6cd0[_0x518948(0xb6)]?_0x253b15[_0x518948(0xa7)](_0x1a6cd0[_0x518948(0xb6)][_0x518948(0xa0)]())||'':'',_0x4d2582=_0x2ae34a?_0x2ae34a+'/'+_0x1a6cd0['name']:_0x1a6cd0[_0x518948(0xe8)],_0x16e402=_0x495d66[_0x518948(0xa7)](_0x1a6cd0['id'])||[],_0x531330=_0x16e402[_0x518948(0x91)]>0x0?a29_0x41437a['dim']('\x20['+_0x16e402['length']+_0x518948(0xc8)):'';console[_0x518948(0xd0)]('\x0a'+a29_0x41437a[_0x518948(0x9e)](_0x518948(0x98))+'\x20'+_0x4d2582+_0x531330),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));const _0x214578=segmentWithActivationsToYaml(_0x1a6cd0,_0x16e402,undefined,_0x7c5a05,_0x246193),_0x5a862c=segmentToYamlString(_0x214578),_0x311952=generateDiff(_0x5a862c,'');console[_0x518948(0xd0)](formatDiffWithColors(_0x311952)),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}const _0x4663b2=_0x2a5e49['filter'](_0x206eec=>!_0x206eec[_0x518948(0xb1)]&&_0x206eec[_0x518948(0x88)]);if(_0x4663b2[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)])for(const _0x28ed3b of _0x4663b2){const _0x56e5cd=_0x28ed3b[_0x518948(0xdf)]?_0x28ed3b[_0x518948(0xdf)]+'/'+_0x28ed3b[_0x518948(0x99)][_0x518948(0xe8)]:_0x28ed3b[_0x518948(0x99)][_0x518948(0xe8)];console['error']('\x0a'+a29_0x41437a['yellow'](_0x518948(0x92))+'\x20'+_0x56e5cd),console[_0x518948(0xd0)]('─'['repeat'](0x3c)),console[_0x518948(0xd0)](_0x28ed3b[_0x518948(0x88)]),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}if(_0x1a7544[_0x518948(0x91)]>0x0)for(const _0x166982 of _0x1a7544){const _0x483292=_0x166982[_0x518948(0xdf)]?_0x166982[_0x518948(0xdf)]+'/'+_0x166982['yamlConfig']['name']:_0x166982[_0x518948(0x99)][_0x518948(0xe8)];console['error']('\x0a'+a29_0x41437a[_0x518948(0xa6)](_0x518948(0xf5))+'\x20'+_0x483292),console[_0x518948(0xd0)]('─'['repeat'](0x3c)),_0x166982[_0x518948(0x88)]&&console[_0x518948(0xd0)](_0x166982['diff']),console[_0x518948(0xd0)]('─'['repeat'](0x3c));}const _0x574fac=_0x1ea6d5[_0x518948(0xae)](_0x3bae4a=>!_0x3bae4a[_0x518948(0xb1)]&&_0x3bae4a['diff']);if(_0x574fac[_0x518948(0x91)]>0x0)for(const _0x4dac8a of _0x574fac){const _0xa86708=_0x4dac8a[_0x518948(0xdf)]?_0x4dac8a[_0x518948(0xdf)]+'/'+_0x4dac8a[_0x518948(0x99)][_0x518948(0xe8)]:_0x4dac8a[_0x518948(0x99)][_0x518948(0xe8)];console['error']('\x0a'+a29_0x41437a[_0x518948(0xa8)](_0x518948(0xb8))+'\x20'+_0xa86708),console['error']('─'['repeat'](0x3c)),console['error'](_0x4dac8a['diff']),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}if(_0x597227[_0x518948(0x91)]>0x0)for(const _0x2026a5 of _0x597227){const _0x2e345b=_0x2026a5[_0x518948(0xbf)]?_0x253b15[_0x518948(0xa7)](_0x2026a5[_0x518948(0xbf)])||'':'',_0x2e4535=_0x2e345b?_0x2e345b+'/'+_0x2026a5[_0x518948(0xd4)]:_0x2026a5['journeyBundleName'];console[_0x518948(0xd0)]('\x0a'+a29_0x41437a['red'](_0x518948(0xba))+'\x20'+_0x2e4535),console[_0x518948(0xd0)]('─'['repeat'](0x3c)),console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)](_0x518948(0xe3))),console[_0x518948(0xd0)]('─'[_0x518948(0x10f)](0x3c));}if(_0x4b34ba[_0x518948(0xfe)])return console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x9b))),0x0;const _0x179ff7=_0x4b34ba[_0x518948(0x9d)]?![]:_0x5b340c[_0x518948(0x91)]>0x0||_0x2ac72d[_0x518948(0x91)]>0x0||_0x3ce5cf[_0x518948(0x91)]>0x0,_0x356d57=_0x1a7544[_0x518948(0x91)]>0x0||_0x74bc24[_0x518948(0x91)]>0x0||_0x597227[_0x518948(0x91)]>0x0,_0x4ce680=_0x4b34ba[_0x518948(0x9d)]?![]:_0x1a5035[_0x518948(0x91)]>0x0,_0x552a5f=_0x25c233[_0x518948(0x91)]>0x0;if(!_0x179ff7&&!_0x356d57&&!_0x4ce680&&!_0x552a5f){const _0x523706=_0x4b34ba['journeysOnly']?_0x518948(0xca):_0x518948(0xd2);console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa6)](_0x523706));if(_0x1ea3f8&&_0x3ca522['length']===0x1){const _0x5377a2=_0x3ca522[0x0];if(_0x5377a2[_0x518948(0x9f)]?.['id']){const _0xa54812=getConsoleNextUrl(_0x4b34ba[_0x518948(0xb4)],'/app/ps/'+_0x39c6a2+_0x518948(0x107)+_0x5377a2[_0x518948(0x9f)]['id']+_0x518948(0x115));console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a['cyan'](_0xa54812));}}return 0x0;}const _0x2010b7=_0x4b34ba[_0x518948(0x9d)]?_0x1a7544[_0x518948(0x91)]+_0x74bc24[_0x518948(0x91)]+_0x597227['length']+_0x25c233[_0x518948(0x91)]:_0x5b340c[_0x518948(0x91)]+_0x2ac72d[_0x518948(0x91)]+_0x3ce5cf[_0x518948(0x91)]+_0x1a7544[_0x518948(0x91)]+_0x74bc24[_0x518948(0x91)]+_0x597227[_0x518948(0x91)]+_0x25c233[_0x518948(0x91)]+_0x1a5035['length'];if(!_0x4b34ba[_0x518948(0x113)]&&_0x2010b7>0x0){const _0x115faa=await confirmKey(_0x518948(0xb7)+_0x2010b7+_0x518948(0x103));if(!_0x115faa)return console[_0x518948(0xd0)](_0x518948(0xcf)),0x1;}const _0x261f6b={'withProgress':async(_0x481da8,_0x3f6bf8)=>{const _0x294a55=_0x518948,_0x23d9c8=await withSpinner(_0x481da8,_0x3f6bf8,{'verbose':_0x4b34ba[_0x294a55(0xda)]});return{'data':_0x23d9c8[_0x294a55(0xf6)]};},'logInfo':_0x4d0a4c=>console[_0x518948(0xd0)](a29_0x41437a['blue']('✔\x20'+_0x4d0a4c)),'logSuccess':_0x333b42=>console['error'](a29_0x41437a['green']('✔\x20'+_0x333b42)),'logWarning':_0x14c67a=>console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)]('⚠\x20'+_0x14c67a)),'logDeleted':_0x1923f3=>console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0x9e)]('✔\x20'+_0x1923f3))},_0x3415f4={'segment':_0x424321['segment'],'journey':_0x424321[_0x518948(0x11f)],'user':_0x424321[_0x518948(0x109)],'connection':_0x424321[_0x518948(0x119)]};_0x25c233['length']>0x0&&(_0x46f139=await executePushFolders(_0x3415f4,_0x25c233,_0x46f139,{'parentId':_0x39c6a2},_0x261f6b));const _0x407b02={'rootFolderId':_0x4b7a36,'folderPathToId':_0x46f139,'folderIdToPath':_0x253b15,'segmentNameToId':_0x729cdc,'activationsBySegmentId':_0x495d66,'emailToIdMap':_0x145a24,'idToEmailMap':_0x7c5a05,'connectionNameToIdMap':_0x10426c[_0x518948(0xd6)],'connectionIdToNameMap':_0x10426c[_0x518948(0xf7)],'connectionNameToTypeMap':_0x19d89f},_0x319af7=await executePushSegments(_0x3415f4,_0x4b34ba[_0x518948(0x9d)]?[]:_0x2a5e49,_0x407b02,{'parentId':_0x39c6a2},_0x261f6b),_0x5177d4=_0x319af7[_0x518948(0xe2)],_0x511627=_0x319af7[_0x518948(0x10a)],_0x4045e3=_0x319af7['activations'][_0x518948(0xe2)],_0x40688d=_0x319af7[_0x518948(0xaf)][_0x518948(0x10a)],_0x493d33=_0x319af7[_0x518948(0xaf)][_0x518948(0x93)],_0x515328=await executePushSegmentDeletions(_0x3415f4,_0x4b34ba[_0x518948(0x9d)]?[]:_0x3ce5cf,_0x261f6b);let _0x2b944f=0x0,_0x3c7994=0x0,_0x546f29=0x0;const _0x26a477=new Map(_0x729cdc);for(const [_0x9f5684,_0x3a29e2]of _0x319af7['createdSegmentIds']){_0x26a477[_0x518948(0xed)](_0x9f5684,_0x3a29e2);}if(_0x1ea6d5[_0x518948(0x91)]>0x0){const _0x5a2787={..._0x407b02,'segmentNameToId':_0x26a477,'existingSegments':_0x371b81,'activationContext':_0x37da93},_0x24a290=await executePushJourneys(_0x3415f4,_0x1ea6d5,_0x5a2787,{'parentId':_0x39c6a2,'rootFolderId':_0x4b7a36,'verbose':_0x4b34ba[_0x518948(0xda)]},_0x261f6b);_0x2b944f=_0x24a290[_0x518948(0xe2)],_0x3c7994=_0x24a290[_0x518948(0x10a)];if(_0x1ea3f8&&_0x24a290[_0x518948(0xf3)][_0x518948(0x91)]===0x1){const _0x553910=_0x24a290['results'][0x0];if(_0x553910[_0x518948(0xfd)]){const _0x37aecb=getConsoleNextUrl(_0x4b34ba['site'],_0x518948(0xe4)+_0x39c6a2+'/e/'+_0x553910['journeyId']+'/j/da/je');console[_0x518948(0xd0)]('\x20\x20'+a29_0x41437a['cyan'](_0x37aecb));}}}for(const _0x59fba4 of _0x597227){console[_0x518948(0xd0)](a29_0x41437a[_0x518948(0xa8)](_0x518948(0x101)+_0x59fba4[_0x518948(0xd4)])),_0x546f29++;}const _0x518ee0=[];if(_0x5177d4>0x0)_0x518ee0[_0x518948(0xde)](_0x5177d4+_0x518948(0xa9));if(_0x511627>0x0)_0x518ee0['push'](_0x511627+_0x518948(0xc2));if(_0x515328>0x0)_0x518ee0[_0x518948(0xde)](_0x515328+'\x20deleted');const _0x115bb3=[];if(_0x2b944f>0x0)_0x115bb3[_0x518948(0xde)](_0x2b944f+'\x20created');if(_0x3c7994>0x0)_0x115bb3['push'](_0x3c7994+_0x518948(0xc2));if(_0x546f29>0x0)_0x115bb3[_0x518948(0xde)](_0x546f29+_0x518948(0xff));const _0x484924=[];if(_0x4045e3>0x0)_0x484924['push'](_0x4045e3+_0x518948(0xa9));if(_0x40688d>0x0)_0x484924['push'](_0x40688d+_0x518948(0xc2));if(_0x493d33>0x0)_0x484924[_0x518948(0xde)](_0x493d33+_0x518948(0xff));return console['error'](a29_0x41437a['green'](_0x518948(0x8e))),_0x518ee0[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&console[_0x518948(0xd0)]('\x20\x20Segments:\x20'+_0x518ee0[_0x518948(0xfc)](',\x20')),_0x115bb3[_0x518948(0x91)]>0x0&&console[_0x518948(0xd0)](_0x518948(0x8c)+_0x115bb3[_0x518948(0xfc)](',\x20')),_0x484924[_0x518948(0x91)]>0x0&&!_0x4b34ba[_0x518948(0x9d)]&&console[_0x518948(0xd0)]('\x20\x20Activations:\x20'+_0x484924[_0x518948(0xfc)](',\x20')),0x0;}}
@@ -1 +1 @@
1
- const a30_0xa52670=a30_0x4409;(function(_0x618e5e,_0x4b4c0e){const _0xb66e93=a30_0x4409,_0x318a99=_0x618e5e();while(!![]){try{const _0x53d402=-parseInt(_0xb66e93(0x208))/0x1*(parseInt(_0xb66e93(0x214))/0x2)+parseInt(_0xb66e93(0x203))/0x3*(-parseInt(_0xb66e93(0x20b))/0x4)+parseInt(_0xb66e93(0x207))/0x5+parseInt(_0xb66e93(0x212))/0x6*(-parseInt(_0xb66e93(0x1ff))/0x7)+parseInt(_0xb66e93(0x1fc))/0x8*(parseInt(_0xb66e93(0x21c))/0x9)+-parseInt(_0xb66e93(0x213))/0xa+parseInt(_0xb66e93(0x206))/0xb*(parseInt(_0xb66e93(0x209))/0xc);if(_0x53d402===_0x4b4c0e)break;else _0x318a99['push'](_0x318a99['shift']());}catch(_0x2732ae){_0x318a99['push'](_0x318a99['shift']());}}}(a30_0x2150,0xe73b5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a30_0x2150(){const _0x4d5833=['\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Segment\x20ID\x20missing\x20from\x20resolved\x20path','kind','7412202dbjska','5073570ltkiKM','3948qgzHaC','error','length','segmentPath','data','resolvePathToResource','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20folder\x20\x27','261pmNROl','yellow','\x20\x20\x20Path:\x20','Segment\x20ID:\x20','Updating\x20segment\x20\x27','Examples:','Error:\x20Cannot\x20update\x20','description','\x27...','Update\x20existing\x20child\x20segment','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','✔\x20Updated\x20segment\x20\x27','238088LuTUIT','INTERNAL','segment','7gCAdrq','execute','name','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','3NuhdTD','Resolving\x20path\x20\x27','type','561NgmCtS','7427280UXyVjM','271qURokv','525828NIiAXP','resolveFolderId','5433964TSCSPv','includes','verbose','Resolved\x20relative\x20path\x20to:\x20'];a30_0x2150=function(){return _0x4d5833;};return a30_0x2150();}import{withSpinner}from'../utils/spinner.js';function a30_0x4409(_0x1b847b,_0x276733){_0x1b847b=_0x1b847b-0x1f3;const _0x2150f9=a30_0x2150();let _0x4409de=_0x2150f9[_0x1b847b];return _0x4409de;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x231aae from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0xa52670(0x201)]='segment:update';[a30_0xa52670(0x1f7)]=a30_0xa52670(0x1f9);async[a30_0xa52670(0x200)](_0x11ffa1){const _0x822514=a30_0xa52670;console['error'](a30_0x231aae['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a30_0x231aae[_0x822514(0x21d)](_0x822514(0x20f)));const {options:_0x27fc16,args:_0x23c86c,tdx:_0x2300d5}=_0x11ffa1,_0x269ba4=_0x27fc16;if(_0x23c86c[_0x822514(0x216)]===0x0)return console[_0x822514(0x215)](_0x822514(0x21a)),console[_0x822514(0x215)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x822514(0x215)](_0x822514(0x1f5)),console[_0x822514(0x215)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x822514(0x215)](_0x822514(0x202)),0x1;const _0x174780=_0x23c86c[0x0],_0x47e7c9=_0x27fc16[_0x822514(0x217)];let _0x3533ab=_0x174780;_0x47e7c9&&!_0x174780[_0x822514(0x20c)]('/')&&(_0x3533ab=_0x47e7c9+'/'+_0x174780,_0x269ba4[_0x822514(0x20d)]&&console[_0x822514(0x215)](_0x822514(0x20e)+_0x3533ab));const _0x1f594d=await withSpinner(_0x822514(0x204)+_0x3533ab+_0x822514(0x1f8),()=>_0x2300d5['segment'][_0x822514(0x219)](_0x3533ab),{'verbose':_0x269ba4[_0x822514(0x20d)]}),_0x351d61=_0x1f594d[_0x822514(0x218)];_0x269ba4[_0x822514(0x20d)]&&console[_0x822514(0x215)]('Resolved\x20type:\x20'+_0x351d61[_0x822514(0x205)]);if(_0x351d61[_0x822514(0x205)]!==_0x822514(0x1fe))return console[_0x822514(0x215)](_0x822514(0x1f6)+_0x351d61['type']+_0x822514(0x1fa)),console[_0x822514(0x215)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x351d61['segmentId'])throw new SDKError(ErrorCode[_0x822514(0x1fd)],_0x822514(0x210));const _0x295511=_0x351d61['parentId'],_0x4566a9=_0x351d61['segmentId'];_0x269ba4['verbose']&&(console['error']('Parent\x20ID:\x20'+_0x295511),console[_0x822514(0x215)](_0x822514(0x1f3)+_0x4566a9));let _0x3a6d8b;if(_0x269ba4['folder']){const _0x23789f=_0x269ba4['folder'],_0x1bec28=await withSpinner(_0x822514(0x21b)+_0x23789f+_0x822514(0x1f8),()=>_0x2300d5[_0x822514(0x1fe)][_0x822514(0x20a)](_0x295511,_0x23789f),{'verbose':_0x269ba4['verbose']});_0x3a6d8b=parseInt(_0x1bec28[_0x822514(0x218)],0xa),_0x269ba4[_0x822514(0x20d)]&&console[_0x822514(0x215)]('Resolved\x20folder\x20ID:\x20'+_0x3a6d8b);}const _0x48146b=await loadJSONFromOptions(_0x269ba4['rule'],_0x269ba4['ruleFile']),_0x5692b9={'name':_0x269ba4[_0x822514(0x201)],'description':_0x269ba4[_0x822514(0x1f7)],'rule':_0x48146b,'kind':_0x269ba4[_0x822514(0x211)]!==undefined?parseInt(_0x269ba4[_0x822514(0x211)],0xa):undefined,'segmentFolderId':_0x3a6d8b},_0x2dff0b=await withSpinner(_0x822514(0x1f4)+_0x351d61['segmentName']+_0x822514(0x1f8),()=>_0x2300d5[_0x822514(0x1fe)]['updateSegmentById'](_0x295511,_0x4566a9,_0x5692b9),{'verbose':_0x269ba4['verbose']}),_0x123186=_0x2dff0b[_0x822514(0x218)];return console[_0x822514(0x215)](_0x822514(0x1fb)+_0x123186[_0x822514(0x201)]+'\x27'),_0x3533ab!==_0x174780&&console[_0x822514(0x215)](_0x822514(0x21e)+_0x3533ab),await handleSDKOutput([_0x123186],_0x269ba4),0x0;}}
1
+ function a30_0x1e0c(){const _0x3e3566=['data','Error:\x20Cannot\x20update\x20','Updating\x20segment\x20\x27','7446224NEvkmc','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','folder','segment:update','2915066pywVha','length','error','2220094nmHHpA','\x20\x20\x20Path:\x20','ruleFile','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20path\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','30OFaOXG','parentId','1105225kXvsEI','rule','INTERNAL','name','\x27...','segment','description','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolveFolderId','Examples:','4LUKNun','24282770BsvTPK','updateSegmentById','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Parent\x20ID:\x20','resolvePathToResource','Update\x20existing\x20child\x20segment','Segment\x20ID:\x20','type','verbose','yellow','3268299sRokdl','724840iItloW','9gQnXxt','Resolving\x20folder\x20\x27'];a30_0x1e0c=function(){return _0x3e3566;};return a30_0x1e0c();}const a30_0x5868ca=a30_0x3328;(function(_0x5be571,_0x3c4dfb){const _0x4954dd=a30_0x3328,_0x4a4ddc=_0x5be571();while(!![]){try{const _0xff60df=parseInt(_0x4954dd(0x1d5))/0x1+parseInt(_0x4954dd(0x1b7))/0x2+parseInt(_0x4954dd(0x1d4))/0x3*(parseInt(_0x4954dd(0x1c9))/0x4)+-parseInt(_0x4954dd(0x1bf))/0x5*(parseInt(_0x4954dd(0x1bd))/0x6)+parseInt(_0x4954dd(0x1b4))/0x7+parseInt(_0x4954dd(0x1ad))/0x8+-parseInt(_0x4954dd(0x1d6))/0x9*(parseInt(_0x4954dd(0x1ca))/0xa);if(_0xff60df===_0x3c4dfb)break;else _0x4a4ddc['push'](_0x4a4ddc['shift']());}catch(_0xf6af0e){_0x4a4ddc['push'](_0x4a4ddc['shift']());}}}(a30_0x1e0c,0xb42f2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a30_0x3328(_0xa8b8c3,_0x5b7d57){_0xa8b8c3=_0xa8b8c3-0x1ac;const _0x1e0c44=a30_0x1e0c();let _0x332805=_0x1e0c44[_0xa8b8c3];return _0x332805;}import a30_0x11072f from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']=a30_0x5868ca(0x1b3);[a30_0x5868ca(0x1c5)]=a30_0x5868ca(0x1cf);async['execute'](_0x35d870){const _0x4a0c0e=a30_0x5868ca;console[_0x4a0c0e(0x1b6)](a30_0x11072f[_0x4a0c0e(0x1d3)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x4a0c0e(0x1b6)](a30_0x11072f[_0x4a0c0e(0x1d3)](_0x4a0c0e(0x1bc)));const {options:_0x197fd5,args:_0x5cf358,tdx:_0x143b5a}=_0x35d870,_0x89d606=_0x197fd5;if(_0x5cf358[_0x4a0c0e(0x1b5)]===0x0)return console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1ba)),console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1ae)),console['error'](_0x4a0c0e(0x1c8)),console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1c6)),console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1cc)),0x1;const _0x593159=_0x5cf358[0x0],_0x39d533=_0x197fd5['segmentPath'];let _0xb473df=_0x593159;_0x39d533&&!_0x593159['includes']('/')&&(_0xb473df=_0x39d533+'/'+_0x593159,_0x89d606[_0x4a0c0e(0x1d2)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0xb473df));const _0x3d0ee4=await withSpinner(_0x4a0c0e(0x1bb)+_0xb473df+_0x4a0c0e(0x1c3),()=>_0x143b5a['segment'][_0x4a0c0e(0x1ce)](_0xb473df),{'verbose':_0x89d606[_0x4a0c0e(0x1d2)]}),_0x3bd4d1=_0x3d0ee4[_0x4a0c0e(0x1d8)];_0x89d606[_0x4a0c0e(0x1d2)]&&console[_0x4a0c0e(0x1b6)]('Resolved\x20type:\x20'+_0x3bd4d1[_0x4a0c0e(0x1d1)]);if(_0x3bd4d1[_0x4a0c0e(0x1d1)]!==_0x4a0c0e(0x1c4))return console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1d9)+_0x3bd4d1[_0x4a0c0e(0x1d1)]+_0x4a0c0e(0x1b1)),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3bd4d1[_0x4a0c0e(0x1af)])throw new SDKError(ErrorCode[_0x4a0c0e(0x1c1)],_0x4a0c0e(0x1b0));const _0x5b53e5=_0x3bd4d1[_0x4a0c0e(0x1be)],_0x5bed86=_0x3bd4d1[_0x4a0c0e(0x1af)];_0x89d606[_0x4a0c0e(0x1d2)]&&(console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1cd)+_0x5b53e5),console['error'](_0x4a0c0e(0x1d0)+_0x5bed86));let _0xdaa0a;if(_0x89d606[_0x4a0c0e(0x1b2)]){const _0x32eac3=_0x89d606['folder'],_0x5835c4=await withSpinner(_0x4a0c0e(0x1d7)+_0x32eac3+_0x4a0c0e(0x1c3),()=>_0x143b5a[_0x4a0c0e(0x1c4)][_0x4a0c0e(0x1c7)](_0x5b53e5,_0x32eac3),{'verbose':_0x89d606[_0x4a0c0e(0x1d2)]});_0xdaa0a=parseInt(_0x5835c4[_0x4a0c0e(0x1d8)],0xa),_0x89d606[_0x4a0c0e(0x1d2)]&&console[_0x4a0c0e(0x1b6)]('Resolved\x20folder\x20ID:\x20'+_0xdaa0a);}const _0x3e09ed=await loadJSONFromOptions(_0x89d606[_0x4a0c0e(0x1c0)],_0x89d606[_0x4a0c0e(0x1b9)]),_0x1461aa={'name':_0x89d606['name'],'description':_0x89d606[_0x4a0c0e(0x1c5)],'rule':_0x3e09ed,'kind':_0x89d606['kind']!==undefined?parseInt(_0x89d606['kind'],0xa):undefined,'segmentFolderId':_0xdaa0a},_0x198c1b=await withSpinner(_0x4a0c0e(0x1ac)+_0x3bd4d1['segmentName']+_0x4a0c0e(0x1c3),()=>_0x143b5a['segment'][_0x4a0c0e(0x1cb)](_0x5b53e5,_0x5bed86,_0x1461aa),{'verbose':_0x89d606[_0x4a0c0e(0x1d2)]}),_0x15ee85=_0x198c1b[_0x4a0c0e(0x1d8)];return console['error']('✔\x20Updated\x20segment\x20\x27'+_0x15ee85[_0x4a0c0e(0x1c2)]+'\x27'),_0xb473df!==_0x593159&&console[_0x4a0c0e(0x1b6)](_0x4a0c0e(0x1b8)+_0xb473df),await handleSDKOutput([_0x15ee85],_0x89d606),0x0;}}
@@ -1 +1 @@
1
- const a31_0x2c49da=a31_0x4320;(function(_0x4aa9a,_0x938b5e){const _0x5bbf95=a31_0x4320,_0x1e4669=_0x4aa9a();while(!![]){try{const _0x4ea88b=parseInt(_0x5bbf95(0x97))/0x1+parseInt(_0x5bbf95(0xc1))/0x2*(parseInt(_0x5bbf95(0xbc))/0x3)+parseInt(_0x5bbf95(0xb6))/0x4*(-parseInt(_0x5bbf95(0xa1))/0x5)+-parseInt(_0x5bbf95(0xae))/0x6*(-parseInt(_0x5bbf95(0xa3))/0x7)+parseInt(_0x5bbf95(0xb7))/0x8+parseInt(_0x5bbf95(0xab))/0x9+-parseInt(_0x5bbf95(0xb5))/0xa;if(_0x4ea88b===_0x938b5e)break;else _0x1e4669['push'](_0x1e4669['shift']());}catch(_0x48c3e7){_0x1e4669['push'](_0x1e4669['shift']());}}}(a31_0x4907,0x8acd4));function a31_0x4320(_0x48938a,_0x435e79){_0x48938a=_0x48938a-0x96;const _0x490742=a31_0x4907();let _0x4320b9=_0x490742[_0x48938a];return _0x4320b9;}function a31_0x4907(){const _0x498d56=['Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','folderId','2980UBVNKR','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','291487xOknMh','error','Folder\x20ID:\x20','folderPath','config','session','cyan','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','6676101RGJcPV','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','segment:use','54VKBDKF','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','verbose','dim','slice','Use:\x20tdx\x20segment\x20use\x20','fullPath','22251470KMTQGg','1228XuNSFq','8204392GUxUNL','segmentPath','site','Resolved\x20relative\x20path\x20to:\x20','name','357873oKWEVR','red','resolvePathToResource','split','type','2RwBfFE','Usage:\x20tdx\x20segment\x20use\x20<path>','parentName','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','length','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Target\x20path:\x20','\x27...','log','segment','Site:\x20','Resolving\x20path\x20\x27','data','parentId','parent_segment','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Resolved\x20path\x20type:\x20','segments','715253rocFvY','description','execute','✔\x20Context\x20set\x20to:\x20','green','join','Examples:','Set\x20current\x20segment/folder\x20context\x20for\x20navigation'];a31_0x4907=function(){return _0x498d56;};return a31_0x4907();}import{existsSync,statSync}from'fs';import a31_0x656a78 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a31_0x2c49da(0xbb)]=a31_0x2c49da(0xad);[a31_0x2c49da(0x98)]=a31_0x2c49da(0x9e);async[a31_0x2c49da(0x99)](_0x3b457d){const _0x551e24=a31_0x2c49da,{options:_0x1c51a0,args:_0x56db42,tdx:_0x1c2cc1}=_0x3b457d;if(_0x56db42['length']===0x0)return console[_0x551e24(0xa4)](a31_0x656a78[_0x551e24(0xbd)]('Error:\x20Path\x20is\x20required\x0a')),console['error'](_0x551e24(0xc2)),console[_0x551e24(0xa4)](_0x551e24(0x9d)),console[_0x551e24(0xa4)](_0x551e24(0xc4)),console[_0x551e24(0xa4)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error'](_0x551e24(0xaf)),console['error'](_0x551e24(0xac)),0x1;const _0x3322bb=_0x56db42[0x0],_0x33e8a1=_0x1c51a0[_0x551e24(0xa8)];try{if(_0x3322bb==='/')return saveSessionContext({'segment_path':undefined},_0x33e8a1),console[_0x551e24(0xcb)](a31_0x656a78['green'](_0x551e24(0xd2))),0x0;if(existsSync(_0x3322bb)&&statSync(_0x3322bb)['isDirectory']()){let _0x18d026;try{_0x18d026=findTdxConfig(_0x3322bb);}catch{return console[_0x551e24(0xa4)](a31_0x656a78[_0x551e24(0xbd)](_0x551e24(0x9f)+_0x3322bb)),console[_0x551e24(0xa4)](a31_0x656a78[_0x551e24(0xa9)](_0x551e24(0xc7))),0x1;}const _0x3bba3c=_0x18d026[_0x551e24(0xa7)][_0x551e24(0xd1)];return saveSessionContext({'segment_path':_0x3bba3c,'parent_segment':_0x3bba3c},_0x33e8a1),console[_0x551e24(0xcb)](a31_0x656a78[_0x551e24(0x9b)](_0x551e24(0x9a)+a31_0x656a78['cyan'](_0x3bba3c))),0x0;}const _0x3edbf5=_0x1c51a0[_0x551e24(0xb8)];let _0x5c73d9=_0x3322bb;const _0x50180b=parsePath(_0x3322bb);if(!_0x50180b['isAbsolute']){if(!_0x3edbf5)return console[_0x551e24(0xa4)](a31_0x656a78[_0x551e24(0xbd)](_0x551e24(0xc5))),console['error'](a31_0x656a78['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x3322bb==='..'){const _0x519111=_0x3edbf5[_0x551e24(0xbf)]('/')[_0x551e24(0xb2)](0x0,-0x1)[_0x551e24(0x9c)]('/');_0x5c73d9=_0x519111||'/';}else _0x3322bb==='.'?_0x5c73d9=_0x3edbf5:_0x5c73d9=_0x3edbf5+'/'+_0x3322bb;_0x1c51a0[_0x551e24(0xb0)]&&console[_0x551e24(0xa4)](_0x551e24(0xba)+_0x5c73d9);}if(_0x5c73d9==='/'||_0x5c73d9==='')return saveSessionContext({'segment_path':undefined},_0x33e8a1),console[_0x551e24(0xcb)](a31_0x656a78[_0x551e24(0x9b)](_0x551e24(0xd2))),0x0;_0x5c73d9=normalizePath(_0x5c73d9);const _0x15abd6=parsePath(_0x5c73d9)[_0x551e24(0x96)];if(_0x15abd6[_0x551e24(0xc6)]===0x0)return saveSessionContext({'segment_path':undefined},_0x33e8a1),console[_0x551e24(0xcb)](a31_0x656a78[_0x551e24(0x9b)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x1c51a0['verbose']&&(console['error'](_0x551e24(0xcd)+_0x1c51a0[_0x551e24(0xb9)]),console[_0x551e24(0xa4)](_0x551e24(0xc9)+_0x5c73d9));const _0x58d5e3=await withSpinner(_0x551e24(0xce)+_0x5c73d9+_0x551e24(0xca),()=>_0x1c2cc1[_0x551e24(0xcc)][_0x551e24(0xbe)](_0x5c73d9),{'verbose':_0x1c51a0[_0x551e24(0xb0)]}),_0x1b80e8=_0x58d5e3[_0x551e24(0xcf)];_0x1c51a0[_0x551e24(0xb0)]&&(console[_0x551e24(0xa4)](_0x551e24(0xd3)+_0x1b80e8['type']),console[_0x551e24(0xa4)]('Parent\x20ID:\x20'+_0x1b80e8[_0x551e24(0xd0)]),_0x1b80e8[_0x551e24(0xa0)]&&console[_0x551e24(0xa4)](_0x551e24(0xa5)+_0x1b80e8[_0x551e24(0xa0)]));if(_0x1b80e8[_0x551e24(0xc0)]===_0x551e24(0xcc))return console['error'](a31_0x656a78['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x551e24(0xa4)](_0x551e24(0xa2)),console[_0x551e24(0xa4)](a31_0x656a78[_0x551e24(0xa9)](_0x551e24(0xb3)+_0x1b80e8[_0x551e24(0xc3)]+(_0x1b80e8[_0x551e24(0xa6)]?'/'+_0x1b80e8[_0x551e24(0xa6)][_0x551e24(0x9c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1b80e8[_0x551e24(0xb4)],'parent_segment':_0x1b80e8[_0x551e24(0xc3)]},_0x33e8a1),console[_0x551e24(0xcb)](a31_0x656a78['green'](_0x551e24(0x9a)+a31_0x656a78[_0x551e24(0xa9)](_0x1b80e8['fullPath']))),_0x1c51a0[_0x551e24(0xb0)]&&(console['error'](a31_0x656a78['dim'](_0x551e24(0xaa))),console[_0x551e24(0xa4)](a31_0x656a78[_0x551e24(0xb1)](_0x551e24(0xc8)))),0x0;}catch(_0x330036){throw _0x330036;}}}
1
+ function a31_0x4338(){const _0x509c05=['1377528AhMSBh','Resolved\x20path\x20type:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','segment:use','dim','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','fullPath','isAbsolute','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','split','isDirectory','folderId','config','✔\x20Context\x20set\x20to:\x20','Resolving\x20path\x20\x27','1641824vXkAkb','parentName','cyan','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','folderPath','green','red','Resolved\x20relative\x20path\x20to:\x20','join','session','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','type','Folder\x20ID:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','2983430sOGVwy','segmentPath','32CKfNjy','log','segments','723790tJoeWY','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','length','execute','\x27...','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','463206pXXIDB','612948LfBOfx','1TraukU','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use:\x20tdx\x20segment\x20use\x20','verbose','parent_segment','36FGaNDS','Site:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Usage:\x20tdx\x20segment\x20use\x20<path>','Parent\x20ID:\x20','2405223LYAMcO','Target\x20path:\x20','error','data'];a31_0x4338=function(){return _0x509c05;};return a31_0x4338();}const a31_0x311253=a31_0x28f8;(function(_0x4670eb,_0x594b1f){const _0x4f7b63=a31_0x28f8,_0x119a04=_0x4670eb();while(!![]){try{const _0x39f11f=parseInt(_0x4f7b63(0xd2))/0x1*(-parseInt(_0x4f7b63(0xd0))/0x2)+parseInt(_0x4f7b63(0xdc))/0x3+-parseInt(_0x4f7b63(0xf0))/0x4+parseInt(_0x4f7b63(0xc5))/0x5+-parseInt(_0x4f7b63(0xe0))/0x6+parseInt(_0x4f7b63(0xd1))/0x7*(-parseInt(_0x4f7b63(0xc7))/0x8)+-parseInt(_0x4f7b63(0xd7))/0x9*(-parseInt(_0x4f7b63(0xca))/0xa);if(_0x39f11f===_0x594b1f)break;else _0x119a04['push'](_0x119a04['shift']());}catch(_0x337c33){_0x119a04['push'](_0x119a04['shift']());}}}(a31_0x4338,0x71c78));function a31_0x28f8(_0x4c34b2,_0x57299e){_0x4c34b2=_0x4c34b2-0xc1;const _0x4338d3=a31_0x4338();let _0x28f867=_0x4338d3[_0x4c34b2];return _0x28f867;}import{existsSync,statSync}from'fs';import a31_0x162a24 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a31_0x311253(0xe3);['description']=a31_0x311253(0xd9);async[a31_0x311253(0xcd)](_0x5ab65a){const _0x208929=a31_0x311253,{options:_0x1c42fb,args:_0x55187d,tdx:_0x165d26}=_0x5ab65a;if(_0x55187d['length']===0x0)return console['error'](a31_0x162a24[_0x208929(0xf6)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x208929(0xde)](_0x208929(0xda)),console[_0x208929(0xde)]('Examples:'),console[_0x208929(0xde)](_0x208929(0xcf)),console[_0x208929(0xde)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x208929(0xde)](_0x208929(0xe8)),console[_0x208929(0xde)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x1c53ff=_0x55187d[0x0],_0xa60065=_0x1c42fb[_0x208929(0xf9)];try{if(_0x1c53ff==='/')return saveSessionContext({'segment_path':undefined},_0xa60065),console['log'](a31_0x162a24[_0x208929(0xf5)](_0x208929(0xc4))),0x0;if(existsSync(_0x1c53ff)&&statSync(_0x1c53ff)[_0x208929(0xeb)]()){let _0x456599;try{_0x456599=findTdxConfig(_0x1c53ff);}catch{return console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xf6)](_0x208929(0xcb)+_0x1c53ff)),console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xf2)](_0x208929(0xe9))),0x1;}const _0x2dbf58=_0x456599[_0x208929(0xed)][_0x208929(0xd6)];return saveSessionContext({'segment_path':_0x2dbf58,'parent_segment':_0x2dbf58},_0xa60065),console[_0x208929(0xc8)](a31_0x162a24['green'](_0x208929(0xee)+a31_0x162a24['cyan'](_0x2dbf58))),0x0;}const _0x7ba3c3=_0x1c42fb[_0x208929(0xc6)];let _0x28c60e=_0x1c53ff;const _0x5172bd=parsePath(_0x1c53ff);if(!_0x5172bd[_0x208929(0xe7)]){if(!_0x7ba3c3)return console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xf6)](_0x208929(0xe2))),console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xf2)](_0x208929(0xc1))),0x1;if(_0x1c53ff==='..'){const _0x5da158=_0x7ba3c3[_0x208929(0xea)]('/')['slice'](0x0,-0x1)[_0x208929(0xf8)]('/');_0x28c60e=_0x5da158||'/';}else _0x1c53ff==='.'?_0x28c60e=_0x7ba3c3:_0x28c60e=_0x7ba3c3+'/'+_0x1c53ff;_0x1c42fb[_0x208929(0xd5)]&&console[_0x208929(0xde)](_0x208929(0xf7)+_0x28c60e);}if(_0x28c60e==='/'||_0x28c60e==='')return saveSessionContext({'segment_path':undefined},_0xa60065),console[_0x208929(0xc8)](a31_0x162a24['green'](_0x208929(0xc4))),0x0;_0x28c60e=normalizePath(_0x28c60e);const _0x4acc8c=parsePath(_0x28c60e)[_0x208929(0xc9)];if(_0x4acc8c[_0x208929(0xcc)]===0x0)return saveSessionContext({'segment_path':undefined},_0xa60065),console[_0x208929(0xc8)](a31_0x162a24[_0x208929(0xf5)](_0x208929(0xc4))),0x0;_0x1c42fb[_0x208929(0xd5)]&&(console['error'](_0x208929(0xd8)+_0x1c42fb['site']),console[_0x208929(0xde)](_0x208929(0xdd)+_0x28c60e));const _0x1063c7=await withSpinner(_0x208929(0xef)+_0x28c60e+_0x208929(0xce),()=>_0x165d26['segment']['resolvePathToResource'](_0x28c60e),{'verbose':_0x1c42fb[_0x208929(0xd5)]}),_0x3a8d0c=_0x1063c7[_0x208929(0xdf)];_0x1c42fb[_0x208929(0xd5)]&&(console[_0x208929(0xde)](_0x208929(0xe1)+_0x3a8d0c[_0x208929(0xc2)]),console[_0x208929(0xde)](_0x208929(0xdb)+_0x3a8d0c['parentId']),_0x3a8d0c[_0x208929(0xec)]&&console[_0x208929(0xde)](_0x208929(0xc3)+_0x3a8d0c['folderId']));if(_0x3a8d0c[_0x208929(0xc2)]==='segment')return console['error'](a31_0x162a24[_0x208929(0xf6)](_0x208929(0xe5))),console['error'](_0x208929(0xd3)),console['error'](a31_0x162a24[_0x208929(0xf2)](_0x208929(0xd4)+_0x3a8d0c[_0x208929(0xf1)]+(_0x3a8d0c['folderPath']?'/'+_0x3a8d0c[_0x208929(0xf4)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3a8d0c[_0x208929(0xe6)],'parent_segment':_0x3a8d0c[_0x208929(0xf1)]},_0xa60065),console[_0x208929(0xc8)](a31_0x162a24[_0x208929(0xf5)]('✔\x20Context\x20set\x20to:\x20'+a31_0x162a24['cyan'](_0x3a8d0c[_0x208929(0xe6)]))),_0x1c42fb[_0x208929(0xd5)]&&(console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xe4)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x208929(0xde)](a31_0x162a24[_0x208929(0xe4)](_0x208929(0xf3)))),0x0;}catch(_0x13f813){throw _0x13f813;}}}