@treasuredata/tdx 0.13.2 → 0.14.0

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 (143) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +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.d.ts +37 -0
  43. package/dist/commands/workflow-command.d.ts.map +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/commands/workflow-command.js.map +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/command-output.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/constants.js +1 -1
  51. package/dist/core/credential-cache.js +1 -1
  52. package/dist/core/global-context.js +1 -1
  53. package/dist/core/keychain.js +1 -1
  54. package/dist/core/profile.js +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/server.js +1 -1
  65. package/dist/proxy/session-cache.js +1 -1
  66. package/dist/sdk/agent/agent-config.js +1 -1
  67. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  68. package/dist/sdk/agent/agent-yaml.js +1 -1
  69. package/dist/sdk/api.js +1 -1
  70. package/dist/sdk/client/cdp-api-client.js +1 -1
  71. package/dist/sdk/client/endpoints.js +1 -1
  72. package/dist/sdk/client/engage-api-client.js +1 -1
  73. package/dist/sdk/client/http-client.js +1 -1
  74. package/dist/sdk/client/llm-api-client.js +1 -1
  75. package/dist/sdk/client/rate-limiter.js +1 -1
  76. package/dist/sdk/client/td-api-client.js +1 -1
  77. package/dist/sdk/client/trino-api-client.js +1 -1
  78. package/dist/sdk/client/workflow-client.js +1 -1
  79. package/dist/sdk/connection-validator.js +1 -1
  80. package/dist/sdk/connection.js +1 -1
  81. package/dist/sdk/engage.js +1 -1
  82. package/dist/sdk/errors.js +1 -1
  83. package/dist/sdk/index.js +1 -1
  84. package/dist/sdk/io/index.js +1 -1
  85. package/dist/sdk/io/node-filesystem.js +1 -1
  86. package/dist/sdk/job.js +1 -1
  87. package/dist/sdk/journey.js +1 -1
  88. package/dist/sdk/llm/chat-cache.js +1 -1
  89. package/dist/sdk/llm/index.js +1 -1
  90. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  91. package/dist/sdk/llm/model-aliases.js +1 -1
  92. package/dist/sdk/llm/model-factors.js +1 -1
  93. package/dist/sdk/query/index.js +1 -1
  94. package/dist/sdk/query/sql-parser.js +1 -1
  95. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  96. package/dist/sdk/segment/fields-display.js +1 -1
  97. package/dist/sdk/segment/file-discovery.js +1 -1
  98. package/dist/sdk/segment/journey-utils.js +1 -1
  99. package/dist/sdk/segment/journey-yaml.js +1 -1
  100. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  101. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/pull-workflow.js +1 -1
  103. package/dist/sdk/segment/push-workflow.js +1 -1
  104. package/dist/sdk/segment/resolution-context.js +1 -1
  105. package/dist/sdk/segment/segment-path-parser.js +1 -1
  106. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  107. package/dist/sdk/segment/target-resolution.js +1 -1
  108. package/dist/sdk/segment/tdx-config.js +1 -1
  109. package/dist/sdk/segment/validate-files.js +1 -1
  110. package/dist/sdk/segment/yaml-validator.js +1 -1
  111. package/dist/sdk/segment.js +1 -1
  112. package/dist/sdk/types/index.js +1 -1
  113. package/dist/sdk/types/progress.js +1 -1
  114. package/dist/sdk/user.js +1 -1
  115. package/dist/sdk/util/format-detector.js +1 -1
  116. package/dist/sdk/util/formatters.js +1 -1
  117. package/dist/sdk/util/index.js +1 -1
  118. package/dist/sdk/util/tree-formatter.js +1 -1
  119. package/dist/sdk/workflow/clone-workflow.js +1 -1
  120. package/dist/sdk/workflow/index.d.ts +1 -1
  121. package/dist/sdk/workflow/index.d.ts.map +1 -1
  122. package/dist/sdk/workflow/index.js +1 -1
  123. package/dist/sdk/workflow/index.js.map +1 -1
  124. package/dist/sdk/workflow/pull-workflow.js +1 -1
  125. package/dist/sdk/workflow/push-workflow.js +1 -1
  126. package/dist/sdk/workflow/tdx-config.js +1 -1
  127. package/dist/sdk/workflow/workflow-utils.js +1 -1
  128. package/dist/utils/async.js +1 -1
  129. package/dist/utils/colors.js +1 -1
  130. package/dist/utils/diff.js +1 -1
  131. package/dist/utils/file-permissions.js +1 -1
  132. package/dist/utils/json-loader.js +1 -1
  133. package/dist/utils/option-validation.js +1 -1
  134. package/dist/utils/port.js +1 -1
  135. package/dist/utils/process.js +1 -1
  136. package/dist/utils/prompt.js +1 -1
  137. package/dist/utils/spinner.js +1 -1
  138. package/dist/utils/sse-parser.js +1 -1
  139. package/dist/utils/string-utils.js +1 -1
  140. package/dist/utils/table-ref-parser.js +1 -1
  141. package/dist/utils/tdx-logger.js +1 -1
  142. package/dist/utils/version-check.js +1 -1
  143. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0x92b6e0=a25_0x57da;(function(_0x1e318a,_0x1e8838){const _0x15b409=a25_0x57da,_0x33a4ff=_0x1e318a();while(!![]){try{const _0x3c2305=parseInt(_0x15b409(0xd7))/0x1+parseInt(_0x15b409(0xd9))/0x2+parseInt(_0x15b409(0xf6))/0x3*(parseInt(_0x15b409(0x12e))/0x4)+parseInt(_0x15b409(0xdb))/0x5*(-parseInt(_0x15b409(0x10d))/0x6)+parseInt(_0x15b409(0x119))/0x7+-parseInt(_0x15b409(0xcd))/0x8*(-parseInt(_0x15b409(0x113))/0x9)+-parseInt(_0x15b409(0xcb))/0xa;if(_0x3c2305===_0x1e8838)break;else _0x33a4ff['push'](_0x33a4ff['shift']());}catch(_0x47f35f){_0x33a4ff['push'](_0x33a4ff['shift']());}}}(a25_0x44ae,0x4c000));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_0x162192 from'chalk';async function resolveSegmentTarget(_0x5790c4,_0x4212db,_0x276d82){const _0x18151a=a25_0x57da;if(isYamlFilePath(_0x5790c4))try{const _0x2c7d8b=await resolveYamlFilePath(_0x5790c4);return _0x276d82&&(console[_0x18151a(0xec)]('Resolved\x20YAML\x20file:\x20'+_0x5790c4),console[_0x18151a(0xec)](_0x18151a(0x156)+_0x2c7d8b[_0x18151a(0xde)]),console[_0x18151a(0xec)]('\x20\x20Segment\x20name:\x20'+_0x2c7d8b[_0x18151a(0xf1)]),console[_0x18151a(0xec)](_0x18151a(0x13d)+(_0x2c7d8b[_0x18151a(0x139)]||_0x18151a(0x13b))),console[_0x18151a(0xec)](_0x18151a(0x149)+_0x2c7d8b[_0x18151a(0x12a)])),_0x2c7d8b[_0x18151a(0x12a)];}catch(_0xa1012){throw new SDKError(ErrorCode[_0x18151a(0xe0)],_0x18151a(0x13a)+_0xa1012['message']);}if(!_0x4212db)throw new SDKError(ErrorCode[_0x18151a(0xe0)],_0x18151a(0xda));return _0x4212db+'/'+_0x5790c4;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0x92b6e0(0x153);['description']=a25_0x92b6e0(0x127);async[a25_0x92b6e0(0x12d)](_0x105d0b){const _0x4275f1=a25_0x92b6e0,{options:_0x350776,args:_0x4aa6c4,tdx:_0x29f5e7}=_0x105d0b,_0xf5d5cf=_0x4aa6c4[0x0],_0x263791=!_0xf5d5cf&&!!_0x350776[_0x4275f1(0xde)],_0x369d27=_0xf5d5cf||_0x350776['parentSegment'];if(!_0x369d27)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x4275f1(0xe4)),console[_0x4275f1(0xec)](_0x4275f1(0x158)),console[_0x4275f1(0xec)](_0x4275f1(0x11c)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x4275f1(0xec)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x4275f1(0xec)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x184047=_0x350776[_0x4275f1(0x13e)];let _0x4fcb45=_0x369d27;!_0x263791&&_0x184047&&!_0x369d27[_0x4275f1(0x11d)]('/')&&(_0x4fcb45=_0x184047+'/'+_0x369d27,_0x350776[_0x4275f1(0x136)]&&console[_0x4275f1(0xec)](_0x4275f1(0x152)+_0x4fcb45));const _0x2b612e=await withSpinner('Resolving\x20path\x20\x27'+_0x4fcb45+'\x27...',()=>_0x29f5e7[_0x4275f1(0xce)][_0x4275f1(0x161)](_0x4fcb45),{'verbose':_0x350776[_0x4275f1(0x136)]}),_0x34d2bd=_0x2b612e[_0x4275f1(0x142)];_0x350776['verbose']&&(console[_0x4275f1(0xec)](_0x4275f1(0xfb)+_0x34d2bd[_0x4275f1(0xdd)]),console[_0x4275f1(0xec)](_0x4275f1(0xf8)+_0x34d2bd[_0x4275f1(0xf3)]),_0x34d2bd[_0x4275f1(0xd2)]&&console[_0x4275f1(0xec)](_0x4275f1(0xf5)+_0x34d2bd['folderId']),_0x34d2bd[_0x4275f1(0xd5)]&&console[_0x4275f1(0xec)](_0x4275f1(0x11f)+_0x34d2bd[_0x4275f1(0xd5)]));if(_0x34d2bd['type']===_0x4275f1(0xe5)){const _0x165581=await withSpinner(_0x4275f1(0x128),()=>_0x29f5e7[_0x4275f1(0xce)][_0x4275f1(0x125)](_0x34d2bd[_0x4275f1(0xf3)]),{'verbose':_0x350776[_0x4275f1(0x136)]});await handleSingleObjectOutput(_0x165581[_0x4275f1(0x142)],_0x350776);}else{if(_0x34d2bd[_0x4275f1(0xdd)]==='folder'){if(!_0x34d2bd[_0x4275f1(0xd2)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x4275f1(0xf9));const _0x1f279=await withSpinner('Fetching\x20folder\x20details...',()=>_0x29f5e7[_0x4275f1(0xce)][_0x4275f1(0xed)](_0x34d2bd[_0x4275f1(0xd2)]),{'verbose':_0x350776[_0x4275f1(0x136)]});await handleSingleObjectOutput(_0x1f279[_0x4275f1(0x142)],_0x350776);}else{if(_0x34d2bd[_0x4275f1(0xdd)]===_0x4275f1(0xce)){if(!_0x34d2bd['segmentId'])throw new SDKError(ErrorCode[_0x4275f1(0x107)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x27c37b=await withSpinner(_0x4275f1(0x11a),()=>_0x29f5e7[_0x4275f1(0xce)][_0x4275f1(0x140)](_0x34d2bd[_0x4275f1(0xf3)],_0x34d2bd[_0x4275f1(0xd5)]),{'verbose':_0x350776['verbose']});await handleSingleObjectOutput(_0x27c37b[_0x4275f1(0x142)],_0x350776);}}}return 0x0;}catch(_0x15d44c){if(_0x15d44c instanceof SDKError)return console[_0x4275f1(0xec)](_0x4275f1(0xd3)+_0x15d44c[_0x4275f1(0x133)]),_0x15d44c[_0x4275f1(0x121)]&&console['error'](_0x4275f1(0x13c)+_0x15d44c[_0x4275f1(0x121)]),0x1;throw _0x15d44c;}}}export class SegmentShowCommand extends BaseCommand{['name']=a25_0x92b6e0(0xe8);[a25_0x92b6e0(0x14a)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a25_0x92b6e0(0x12d)](_0x500256){const _0x401635=a25_0x92b6e0,{options:_0x32b244,args:_0x296cbc,tdx:_0x454a1b}=_0x500256,_0x3be064=_0x296cbc[0x0];if(!_0x3be064)return console[_0x401635(0xec)](_0x401635(0xe1)),console[_0x401635(0xec)](_0x401635(0x14b)),console[_0x401635(0xec)](_0x401635(0x100)),console['error']('Examples:'),console[_0x401635(0xec)](_0x401635(0x14c)),console[_0x401635(0xec)](_0x401635(0x160)),0x1;try{const _0x4fe32a=_0x32b244['parentSegment'],_0x1df9fd=await resolveSegmentTarget(_0x3be064,_0x4fe32a,_0x32b244['verbose']);_0x32b244[_0x401635(0x136)]&&console[_0x401635(0xec)]('Target\x20path:\x20'+_0x1df9fd);const _0x320cc5=await withSpinner('Resolving\x20\x27'+_0x3be064+_0x401635(0xef),()=>_0x454a1b[_0x401635(0xce)]['resolvePathToResource'](_0x1df9fd),{'verbose':_0x32b244[_0x401635(0x136)]}),_0x5ce9fc=_0x320cc5[_0x401635(0x142)];_0x32b244[_0x401635(0x136)]&&(console[_0x401635(0xec)](_0x401635(0xfb)+_0x5ce9fc[_0x401635(0xdd)]),console[_0x401635(0xec)](_0x401635(0xf8)+_0x5ce9fc[_0x401635(0xf3)]));if(_0x5ce9fc[_0x401635(0xdd)]==='folder')return console[_0x401635(0xec)](_0x401635(0x106)),console[_0x401635(0xec)](_0x401635(0x11b)),0x1;if(_0x5ce9fc['type']===_0x401635(0xe5))return console[_0x401635(0xec)](_0x401635(0x143)),console[_0x401635(0xec)](_0x401635(0x115)),0x1;if(!_0x5ce9fc['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x401635(0x15c));const _0x47bbca=await withSpinner(_0x401635(0xc8),()=>_0x454a1b[_0x401635(0xce)][_0x401635(0x157)](_0x5ce9fc[_0x401635(0xf3)],_0x5ce9fc['segmentId']),{'verbose':_0x32b244[_0x401635(0x136)]});let _0x43cab8=_0x47bbca['data'];const _0x1564a4=resolveLimit(_0x32b244[_0x401635(0x10f)],DEFAULT_DISPLAY_LIMIT),_0x281dcb=/\bLIMIT\s+\d+/i[_0x401635(0x132)](_0x43cab8);!_0x281dcb&&(_0x43cab8=_0x43cab8[_0x401635(0x122)]()['replace'](/;+$/,''),_0x43cab8=_0x401635(0x15b)+_0x43cab8+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1564a4);_0x32b244[_0x401635(0x136)]&&console['error']('SQL\x20query:\x0a'+_0x43cab8);const _0x25789a=await withProgressSpinner(_0x401635(0x126),async _0x2b8f0b=>{const _0x1b6eef=_0x401635,_0x39c181=await _0x454a1b[_0x1b6eef(0xdc)]['execute'](_0x43cab8,{'catalog':'td','schema':_0x1b6eef(0x159),'onJobId':_0x3987cf=>{const _0x16fb6c=_0x1b6eef;_0x2b8f0b[_0x16fb6c(0xc9)](_0x3987cf);}});return _0x39c181;},{'verbose':_0x32b244['verbose']}),_0x28b1ef=_0x25789a[_0x401635(0x142)],_0x29d1e0=_0x28b1ef[_0x401635(0x14f)]?_0x401635(0xf0)+_0x28b1ef[_0x401635(0x14f)]+']':'';return console[_0x401635(0xec)](_0x401635(0x10b)+_0x28b1ef[_0x401635(0xd0)][_0x401635(0x155)][_0x401635(0x15e)]()+_0x401635(0x11e)+(_0x401635(0x148)+formatElapsed(_0x28b1ef[_0x401635(0xd0)][_0x401635(0xfa)])+_0x29d1e0)),await handleQueryOutput(_0x28b1ef,_0x32b244),0x0;}catch(_0x1a4316){if(_0x1a4316 instanceof SDKError)return console[_0x401635(0xec)](_0x401635(0x14e)+_0x1a4316[_0x401635(0xcf)]+']'),console[_0x401635(0xec)]('\x0a'+_0x1a4316[_0x401635(0x133)]),0x1;throw _0x1a4316;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x92b6e0(0xd1);[a25_0x92b6e0(0x14a)]=a25_0x92b6e0(0xc7);async['execute'](_0x545c0f){const _0x150c33=a25_0x92b6e0,{options:_0x2d039d,args:_0x4014c2,tdx:_0x357751}=_0x545c0f;if(_0x4014c2[_0x150c33(0x12c)]===0x0)return console['error'](_0x150c33(0x13f)),console[_0x150c33(0xec)](_0x150c33(0x135)),0x1;const _0x1e5caa=_0x4014c2[0x0];try{_0x2d039d[_0x150c33(0x136)]&&(console['error'](_0x150c33(0xcc)+_0x2d039d[_0x150c33(0xe3)]),console[_0x150c33(0xec)](_0x150c33(0x14d)+_0x1e5caa));const _0x194c83=await withSpinner(_0x150c33(0x112)+_0x1e5caa+_0x150c33(0xef),()=>_0x357751[_0x150c33(0xce)]['resolveParentId'](_0x1e5caa),{'verbose':_0x2d039d[_0x150c33(0x136)]}),_0xddc9e1=_0x194c83[_0x150c33(0x142)];_0x2d039d[_0x150c33(0x136)]&&console[_0x150c33(0xec)](_0x150c33(0x146)+_0xddc9e1);const _0x41787b=await withSpinner(_0x150c33(0x10a)+_0x1e5caa+'\x27...',()=>_0x357751[_0x150c33(0xce)][_0x150c33(0x147)](_0xddc9e1),{'verbose':_0x2d039d['verbose']}),_0x49dfe4=_0x41787b[_0x150c33(0x142)];return console[_0x150c33(0xec)](_0x150c33(0x129)+_0x49dfe4[_0x150c33(0x12c)]+'\x20folder'+(_0x49dfe4[_0x150c33(0x12c)]!==0x1?'s':'')),await handleSDKOutput(_0x49dfe4,_0x2d039d),0x0;}catch(_0x29d1df){if(_0x29d1df instanceof SDKError)return console[_0x150c33(0xec)](_0x150c33(0xd3)+_0x29d1df[_0x150c33(0x133)]),_0x29d1df['cause']&&console[_0x150c33(0xec)](_0x150c33(0x13c)+_0x29d1df['cause']),0x1;throw _0x29d1df;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x92b6e0(0xf2)]=a25_0x92b6e0(0x108);[a25_0x92b6e0(0x14a)]=a25_0x92b6e0(0xf4);async['execute'](_0x263837){const _0x3e1248=a25_0x92b6e0,{options:_0x388e0c,args:_0x15fb48,tdx:_0x22a085}=_0x263837;if(_0x15fb48[_0x3e1248(0x12c)]===0x0)return console[_0x3e1248(0xec)](_0x3e1248(0xeb)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x5558fd,childId:_0x113fcb}=parseSegmentRef(_0x15fb48[0x0]);_0x388e0c[_0x3e1248(0x136)]&&(console['error'](_0x3e1248(0xcc)+_0x388e0c[_0x3e1248(0xe3)]),console[_0x3e1248(0xec)](_0x3e1248(0x14d)+_0x5558fd),_0x113fcb&&console[_0x3e1248(0xec)]('Folder\x20name:\x20'+_0x113fcb));if(!_0x113fcb)return console[_0x3e1248(0xec)](_0x3e1248(0x138)),0x1;const _0x2df206=await withSpinner(_0x3e1248(0x112)+_0x5558fd+'\x27...',()=>_0x22a085[_0x3e1248(0xce)][_0x3e1248(0x15a)](_0x5558fd),{'verbose':_0x388e0c[_0x3e1248(0x136)]}),_0x24833c=_0x2df206['data'];_0x388e0c[_0x3e1248(0x136)]&&console[_0x3e1248(0xec)]('Resolved\x20parent\x20ID:\x20'+_0x24833c);const _0x1e145b=await withSpinner(_0x3e1248(0x114)+_0x113fcb+_0x3e1248(0xef),()=>_0x22a085[_0x3e1248(0xce)][_0x3e1248(0x151)](_0x24833c,_0x113fcb),{'verbose':_0x388e0c['verbose']}),_0x2eb054=_0x1e145b[_0x3e1248(0x142)];_0x388e0c[_0x3e1248(0x136)]&&console[_0x3e1248(0xec)](_0x3e1248(0xca)+_0x2eb054);const _0xd4ecfa=await withSpinner(_0x3e1248(0x103)+_0x113fcb+_0x3e1248(0xef),()=>_0x22a085[_0x3e1248(0xce)][_0x3e1248(0xed)](_0x2eb054),{'verbose':_0x388e0c['verbose']});return await handleSDKOutput([_0xd4ecfa[_0x3e1248(0x142)]],_0x388e0c),0x0;}catch(_0x5db435){if(_0x5db435 instanceof SDKError)return console['error'](_0x3e1248(0xd3)+_0x5db435[_0x3e1248(0x133)]),_0x5db435[_0x3e1248(0x121)]&&console[_0x3e1248(0xec)](_0x3e1248(0x13c)+_0x5db435[_0x3e1248(0x121)]),0x1;throw _0x5db435;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x92b6e0(0xf2)]='segment:sql';[a25_0x92b6e0(0x14a)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a25_0x92b6e0(0x12d)](_0x4e9e78){const _0x2471e8=a25_0x92b6e0,{options:_0x5b4a88,args:_0xbd55ff,tdx:_0x4e9d44}=_0x4e9e78,_0x56505c=_0xbd55ff[0x0];if(!_0x56505c)return console['error'](_0x2471e8(0xe1)),console[_0x2471e8(0xec)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x2471e8(0xec)]('Examples:'),console[_0x2471e8(0xec)](_0x2471e8(0xfe)),console[_0x2471e8(0xec)](_0x2471e8(0xfd)),0x1;try{const _0x38d3a7=_0x5b4a88[_0x2471e8(0xde)],_0x2bca37=await resolveSegmentTarget(_0x56505c,_0x38d3a7,_0x5b4a88[_0x2471e8(0x136)]);_0x5b4a88[_0x2471e8(0x136)]&&console[_0x2471e8(0xec)](_0x2471e8(0x131)+_0x2bca37);const _0x1b5af2=await withSpinner(_0x2471e8(0x141)+_0x56505c+'\x27...',()=>_0x4e9d44[_0x2471e8(0xce)][_0x2471e8(0x161)](_0x2bca37),{'verbose':_0x5b4a88[_0x2471e8(0x136)]}),_0x4c604c=_0x1b5af2['data'];_0x5b4a88[_0x2471e8(0x136)]&&(console[_0x2471e8(0xec)](_0x2471e8(0xfb)+_0x4c604c[_0x2471e8(0xdd)]),console[_0x2471e8(0xec)](_0x2471e8(0xf8)+_0x4c604c['parentId']));if(_0x4c604c[_0x2471e8(0xdd)]===_0x2471e8(0x134))return console[_0x2471e8(0xec)](_0x2471e8(0x104)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x4c604c[_0x2471e8(0xdd)]===_0x2471e8(0xe5))return console[_0x2471e8(0xec)](_0x2471e8(0xea)),console[_0x2471e8(0xec)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x4c604c[_0x2471e8(0xd5)])throw new SDKError(ErrorCode[_0x2471e8(0x107)],_0x2471e8(0x15c));const _0x2aa413=await withSpinner(_0x2471e8(0xc8),()=>_0x4e9d44[_0x2471e8(0xce)][_0x2471e8(0x157)](_0x4c604c['parentId'],_0x4c604c[_0x2471e8(0xd5)]),{'verbose':_0x5b4a88[_0x2471e8(0x136)]}),_0x20badf=_0x2aa413[_0x2471e8(0x142)];return _0x5b4a88[_0x2471e8(0x109)]===_0x2471e8(0x130)||_0x5b4a88['format']===_0x2471e8(0xf7)?await handleSDKOutput([{'sql':_0x20badf}],_0x5b4a88):console[_0x2471e8(0x110)](_0x20badf),0x0;}catch(_0x5bc34d){if(_0x5bc34d instanceof SDKError)return console[_0x2471e8(0xec)](_0x2471e8(0xd3)+_0x5bc34d[_0x2471e8(0x133)]),_0x5bc34d[_0x2471e8(0x121)]&&console[_0x2471e8(0xec)](_0x2471e8(0x13c)+_0x5bc34d[_0x2471e8(0x121)]),0x1;throw _0x5bc34d;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x92b6e0(0xf2)]='segment:folder:create';[a25_0x92b6e0(0x14a)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x469d4b){const _0x1f9269=a25_0x92b6e0,{options:_0x1e83bb,args:_0x532dff,tdx:_0x5a56c9}=_0x469d4b,_0x3e0a17=_0x1e83bb;if(_0x532dff[_0x1f9269(0x12c)]<0x2)return console[_0x1f9269(0xec)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x1f9269(0x120)),0x1;const _0x3fbe54=_0x532dff[0x0],_0x523065=_0x532dff[0x1];_0x3e0a17[_0x1f9269(0x136)]&&(console[_0x1f9269(0xec)](_0x1f9269(0xcc)+_0x3e0a17['site']),console[_0x1f9269(0xec)]('Parent\x20segment:\x20'+_0x3fbe54),console[_0x1f9269(0xec)](_0x1f9269(0x137)+_0x523065));let _0x1a34c6;if(_0x3e0a17[_0x1f9269(0x15f)]){const _0x2faa8e=_0x3e0a17[_0x1f9269(0x15f)],_0x35a256=await withSpinner(_0x1f9269(0x112)+_0x3fbe54+_0x1f9269(0xef),()=>_0x5a56c9[_0x1f9269(0xce)][_0x1f9269(0x15a)](_0x3fbe54),{'verbose':_0x3e0a17[_0x1f9269(0x136)]}),_0x4e4ce9=_0x35a256['data'],_0x123cc2=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x2faa8e+_0x1f9269(0xef),()=>_0x5a56c9[_0x1f9269(0xce)][_0x1f9269(0x151)](_0x4e4ce9,_0x2faa8e),{'verbose':_0x3e0a17[_0x1f9269(0x136)]});_0x1a34c6=_0x123cc2[_0x1f9269(0x142)],_0x3e0a17[_0x1f9269(0x136)]&&console[_0x1f9269(0xec)](_0x1f9269(0x117)+_0x1a34c6);}const _0x9ff41f={'name':_0x523065,'description':_0x3e0a17[_0x1f9269(0x14a)],'parentFolderId':_0x1a34c6},_0x12d042=await withSpinner(_0x1f9269(0x118)+_0x523065+_0x1f9269(0xef),()=>_0x5a56c9[_0x1f9269(0xce)]['createFolder'](_0x3fbe54,_0x9ff41f),{'verbose':_0x3e0a17[_0x1f9269(0x136)]}),_0xac43b0=_0x12d042['data'];return console[_0x1f9269(0xec)](_0x1f9269(0x105)+_0xac43b0[_0x1f9269(0xf2)]+_0x1f9269(0x116)+_0xac43b0['id']),await handleSDKOutput([_0xac43b0],_0x3e0a17),0x0;}}function a25_0x44ae(){const _0xbe4b1=['error','getFolder','Use:\x20tdx\x20ps\x20view\x20-w','\x27...','\x20[Job\x20ID:\x20','segmentName','name','parentId','Show\x20segment\x20folder\x20details','Folder\x20ID:\x20','3PZduTO','jsonl','Parent\x20ID:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','elapsedTimeMillis','Resolved\x20type:\x20','/app/ps/','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Fetching\x20folder\x20details...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20desc\x20<name>','Use:\x20tdx\x20ps\x20view','Fetching\x20folder\x20\x27','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','✔\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','SEGMENT_NOT_FOUND','segment:folder:show','format','Listing\x20folders\x20for\x20parent\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','Options:','6AkDGMY','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','limit','log','SEGMENT_FOLDER_NOT_FOUND','Resolving\x20parent\x20segment\x20\x27','9bgRFZF','Resolving\x20folder\x20\x27','Use:\x20tdx\x20ps\x20show','\x27\x20with\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','Creating\x20folder\x20\x27','679126sJWycN','Fetching\x20segment\x20details...','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','includes','\x20rows\x20','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','cause','trim','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','getParent','Executing\x20segment\x20query...','Show\x20segment\x20or\x20folder\x20details','Fetching\x20parent\x20segment\x20details...','✔\x20Found\x20','fullPath','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','length','execute','2192412uVcRdK','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','json','Target\x20path:\x20','test','message','folder','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','verbose','Folder\x20name:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','folderPath','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','(root)','\x20\x20Cause:\x20','\x20\x20Folder\x20path:\x20','segmentPath','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSegment','Resolving\x20\x27','data','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','cyan','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Resolved\x20parent\x20ID:\x20','listFolders','in\x20','\x20\x20Full\x20path:\x20','description','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Parent\x20name:\x20','✖\x20Query\x20failed\x20[','jobId','green','resolveFolderId','Resolved\x20relative\x20path\x20to:\x20','segment:describe','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','processedRows','\x20\x20Parent\x20segment:\x20','getSegmentSQL','Examples:','information_schema','resolveParentId','SELECT\x20*\x20FROM\x20(\x0a','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','toLocaleString','parentFolder','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','resolvePathToResource','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Fetching\x20SQL\x20for\x20segment...','setJobId','Resolved\x20folder\x20ID:\x20','14546630qLyinm','Site:\x20','4535736oHbLUV','segment','code','stats','segment:folder:list','folderId','Error:\x20','segment:view','segmentId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','153216LAVpLb','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','1040708ZQTDam','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','598495qOcZAy','query','type','parentSegment','Show\x20child\x20segment\x20schema\x20(column\x20types)','INVALID_ARGUMENT','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','/e/','site','Usage:\x20tdx\x20segment\x20describe\x20<path>','parent','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','web','segment:show','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Folder\x20reference\x20is\x20required'];a25_0x44ae=function(){return _0xbe4b1;};return a25_0x44ae();}function a25_0x57da(_0x2f8de9,_0x340ce7){_0x2f8de9=_0x2f8de9-0xc7;const _0x44ae92=a25_0x44ae();let _0x57dae3=_0x44ae92[_0x2f8de9];return _0x57dae3;}export class SegmentViewCommand extends BaseCommand{[a25_0x92b6e0(0xf2)]=a25_0x92b6e0(0xd4);[a25_0x92b6e0(0x14a)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a25_0x92b6e0(0x12d)](_0x35cf00){const _0x3f61d4=a25_0x92b6e0,{options:_0x4af666,args:_0x3456ea,tdx:_0xe7cca3}=_0x35cf00,_0x24509c=_0x3456ea[0x0];if(!_0x24509c)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3f61d4(0xec)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0x3f61d4(0x124)),console[_0x3f61d4(0xec)](_0x3f61d4(0x10c)),console[_0x3f61d4(0xec)](_0x3f61d4(0x154)),console[_0x3f61d4(0xec)](_0x3f61d4(0x158)),console[_0x3f61d4(0xec)](_0x3f61d4(0x12f)),console[_0x3f61d4(0xec)](_0x3f61d4(0xe9)),console['error'](_0x3f61d4(0x12b)),console[_0x3f61d4(0xec)](_0x3f61d4(0x123)),0x1;try{const _0x5c9ea1=_0x4af666['parentSegment'],_0x44a715=await resolveSegmentTarget(_0x24509c,_0x5c9ea1,_0x4af666['verbose']);_0x4af666[_0x3f61d4(0x136)]&&console['error']('Target\x20path:\x20'+_0x44a715);const _0x3e2faa=await withSpinner(_0x3f61d4(0x141)+_0x24509c+_0x3f61d4(0xef),()=>_0xe7cca3[_0x3f61d4(0xce)][_0x3f61d4(0x161)](_0x44a715),{'verbose':_0x4af666[_0x3f61d4(0x136)]}),_0x2feb8b=_0x3e2faa['data'];_0x4af666[_0x3f61d4(0x136)]&&(console['error']('Resolved\x20type:\x20'+_0x2feb8b[_0x3f61d4(0xdd)]),console[_0x3f61d4(0xec)](_0x3f61d4(0xf8)+_0x2feb8b[_0x3f61d4(0xf3)]),_0x2feb8b[_0x3f61d4(0xd2)]&&console[_0x3f61d4(0xec)]('Folder\x20ID:\x20'+_0x2feb8b[_0x3f61d4(0xd2)]),_0x2feb8b['segmentId']&&console['error'](_0x3f61d4(0x11f)+_0x2feb8b['segmentId']));if(_0x4af666[_0x3f61d4(0xe7)]){if(_0x2feb8b['type']==='folder')return console[_0x3f61d4(0xec)](_0x3f61d4(0xe6)),0x1;if(_0x2feb8b[_0x3f61d4(0xdd)]===_0x3f61d4(0xe5))return console[_0x3f61d4(0xec)](_0x3f61d4(0x10e)),console['error'](_0x3f61d4(0xee)),0x1;if(!_0x2feb8b['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3f61d4(0x15c));const _0x5b073e=getConsoleNextUrl(_0x4af666[_0x3f61d4(0xe3)],'/app/ps/'+_0x2feb8b[_0x3f61d4(0xf3)]+'/e/'+_0x2feb8b[_0x3f61d4(0xd5)]);return console[_0x3f61d4(0xec)](a25_0x162192[_0x3f61d4(0x150)]('✔')+'\x20Opening\x20'+a25_0x162192[_0x3f61d4(0x144)](_0x5b073e)),openBrowser(_0x5b073e),0x0;}if(_0x2feb8b['type']===_0x3f61d4(0x134)){if(!_0x2feb8b['folderId'])throw new SDKError(ErrorCode[_0x3f61d4(0x111)],_0x3f61d4(0xf9));const _0x33beab=await withSpinner(_0x3f61d4(0xff),()=>_0xe7cca3[_0x3f61d4(0xce)]['getFolder'](_0x2feb8b[_0x3f61d4(0xd2)]),{'verbose':_0x4af666[_0x3f61d4(0x136)]});await handleSingleObjectOutput(_0x33beab[_0x3f61d4(0x142)],_0x4af666);}else{if(_0x2feb8b[_0x3f61d4(0xdd)]===_0x3f61d4(0xce)){if(!_0x2feb8b['segmentId'])throw new SDKError(ErrorCode[_0x3f61d4(0x107)],_0x3f61d4(0x15c));const _0x4e431f=await withSpinner(_0x3f61d4(0x11a),()=>_0xe7cca3[_0x3f61d4(0xce)]['getSegment'](_0x2feb8b[_0x3f61d4(0xf3)],_0x2feb8b[_0x3f61d4(0xd5)]),{'verbose':_0x4af666['verbose']}),_0x4c80f1=getConsoleNextUrl(_0x4af666[_0x3f61d4(0xe3)],_0x3f61d4(0xfc)+_0x2feb8b[_0x3f61d4(0xf3)]+_0x3f61d4(0xe2)+_0x2feb8b[_0x3f61d4(0xd5)]),_0x1af423=_0x4e431f[_0x3f61d4(0x142)];_0x1af423['url']=_0x4c80f1,await handleSingleObjectOutput(_0x1af423,_0x4af666);}else return console[_0x3f61d4(0xec)](_0x3f61d4(0x145)),console[_0x3f61d4(0xec)](_0x3f61d4(0x102)),0x1;}return 0x0;}catch(_0x3a927f){if(_0x3a927f instanceof SDKError)return console[_0x3f61d4(0xec)](_0x3f61d4(0xd3)+_0x3a927f[_0x3f61d4(0x133)]),_0x3a927f[_0x3f61d4(0x121)]&&console[_0x3f61d4(0xec)](_0x3f61d4(0x13c)+_0x3a927f[_0x3f61d4(0x121)]),0x1;throw _0x3a927f;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x92b6e0(0xf2)]='segment:desc';['description']=a25_0x92b6e0(0xdf);async[a25_0x92b6e0(0x12d)](_0x2363e6){const _0x5f077e=a25_0x92b6e0,{options:_0x48d88e,args:_0x42a89c,tdx:_0x166cf1}=_0x2363e6,_0x3aeded=_0x42a89c[0x0];if(!_0x3aeded)return console[_0x5f077e(0xec)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x5f077e(0xec)](_0x5f077e(0x101)),console[_0x5f077e(0xec)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x5f077e(0xec)](_0x5f077e(0x158)),console[_0x5f077e(0xec)](_0x5f077e(0xd8)),console[_0x5f077e(0xec)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x295e54=_0x48d88e[_0x5f077e(0xde)],_0x28d027=await resolveSegmentTarget(_0x3aeded,_0x295e54,_0x48d88e[_0x5f077e(0x136)]);_0x48d88e[_0x5f077e(0x136)]&&console['error'](_0x5f077e(0x131)+_0x28d027);const _0xff8784=await withSpinner(_0x5f077e(0x141)+_0x3aeded+_0x5f077e(0xef),()=>_0x166cf1[_0x5f077e(0xce)][_0x5f077e(0x161)](_0x28d027),{'verbose':_0x48d88e[_0x5f077e(0x136)]}),_0x2d782a=_0xff8784[_0x5f077e(0x142)];_0x48d88e['verbose']&&(console[_0x5f077e(0xec)]('Resolved\x20type:\x20'+_0x2d782a[_0x5f077e(0xdd)]),console[_0x5f077e(0xec)](_0x5f077e(0xf8)+_0x2d782a[_0x5f077e(0xf3)]));if(_0x2d782a[_0x5f077e(0xdd)]===_0x5f077e(0x134))return console[_0x5f077e(0xec)](_0x5f077e(0x15d)),console[_0x5f077e(0xec)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x2d782a[_0x5f077e(0xdd)]===_0x5f077e(0xe5))return console['error'](_0x5f077e(0xd6)),console[_0x5f077e(0xec)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x2d782a[_0x5f077e(0xd5)])throw new SDKError(ErrorCode[_0x5f077e(0x107)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x353fac=await withSpinner(_0x5f077e(0xc8),()=>_0x166cf1[_0x5f077e(0xce)][_0x5f077e(0x157)](_0x2d782a[_0x5f077e(0xf3)],_0x2d782a['segmentId']),{'verbose':_0x48d88e[_0x5f077e(0x136)]}),_0x264500=_0x353fac[_0x5f077e(0x142)],_0x53e277=await executeSchemaQuery(_0x264500,_0x166cf1,_0x48d88e);return await handleQueryOutput(_0x53e277,_0x48d88e),0x0;}catch(_0x339ab0){if(_0x339ab0 instanceof SDKError)return console[_0x5f077e(0xec)]('Error:\x20'+_0x339ab0[_0x5f077e(0x133)]),_0x339ab0[_0x5f077e(0x121)]&&console[_0x5f077e(0xec)](_0x5f077e(0x13c)+_0x339ab0[_0x5f077e(0x121)]),0x1;throw _0x339ab0;}}}
1
+ const a25_0x51372c=a25_0x576d;(function(_0x5e13ef,_0x3d0335){const _0x2cebe0=a25_0x576d,_0x5d9921=_0x5e13ef();while(!![]){try{const _0x354abb=parseInt(_0x2cebe0(0x1e2))/0x1+parseInt(_0x2cebe0(0x1fa))/0x2+-parseInt(_0x2cebe0(0x1ad))/0x3*(parseInt(_0x2cebe0(0x1f8))/0x4)+parseInt(_0x2cebe0(0x18a))/0x5*(-parseInt(_0x2cebe0(0x195))/0x6)+-parseInt(_0x2cebe0(0x1ff))/0x7*(parseInt(_0x2cebe0(0x1ca))/0x8)+parseInt(_0x2cebe0(0x189))/0x9*(-parseInt(_0x2cebe0(0x17f))/0xa)+parseInt(_0x2cebe0(0x187))/0xb*(parseInt(_0x2cebe0(0x184))/0xc);if(_0x354abb===_0x3d0335)break;else _0x5d9921['push'](_0x5d9921['shift']());}catch(_0xa47837){_0x5d9921['push'](_0x5d9921['shift']());}}}(a25_0x2d9a,0x27d12));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';function a25_0x576d(_0x237b90,_0x5c1121){_0x237b90=_0x237b90-0x164;const _0x2d9a15=a25_0x2d9a();let _0x576d1e=_0x2d9a15[_0x237b90];return _0x576d1e;}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_0x4b6697 from'chalk';function a25_0x2d9a(){const _0xcc5c28=['format','/e/','416770mcOFyh','execute','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','getParent','3926616TQCzqf','replace','Get\x20SQL\x20query\x20for\x20child\x20segment','11OlLPhb','includes','45VcCPrG','70FIjUIT','Resolved\x20type:\x20','SEGMENT_FOLDER_NOT_FOUND','segment:desc','Fetching\x20folder\x20details...','Show\x20segment\x20folder\x20details','Resolved\x20relative\x20path\x20to:\x20','Creating\x20folder\x20\x27','Show\x20segment\x20or\x20folder\x20details','folder','stats','14868TKaTQA','Resolved\x20YAML\x20file:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20sql\x20<name>','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','SQL\x20query:\x0a','✖\x20Query\x20failed\x20[','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','getFolder','resolvePathToResource','setJobId','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Fetching\x20segment\x20details...','getSegmentSQL','Usage:\x20tdx\x20sg\x20desc\x20<name>','message','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Target\x20path:\x20','segment:view','686439tgNLEN','\x20\x20Folder\x20path:\x20','SEGMENT_NOT_FOUND','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Show\x20folder\x20or\x20child\x20segment\x20details','Site:\x20','fullPath','Fetching\x20folder\x20\x27','Create\x20segment\x20folder\x20for\x20organization','listFolders','trim','createFolder','Examples:','segmentName','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20','\x27...','getSegment','type','Folder\x20ID:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','✔\x20Found\x20','log','Folder\x20name:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','SELECT\x20*\x20FROM\x20(\x0a','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','18704PIGUuN','segment:show','(root)','\x20Opening\x20','segmentPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','segment:folder:list','Error:\x20Folder\x20reference\x20is\x20required','segment:folder:show','code','Usage:\x20tdx\x20segment\x20describe\x20<path>','segment:describe','Parent\x20name:\x20','segmentId','jobId','\x20[Job\x20ID:\x20','url','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20view','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','limit','folderId','parent','291632xhMfzn','verbose','resolveFolderId','site','segment','parentId','Resolving\x20\x27','length','processedRows','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x27\x20with\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Fetching\x20SQL\x20for\x20segment...','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20Parent\x20segment:\x20','Parent\x20segment:\x20','segment:folder:create','data','INVALID_ARGUMENT','/app/ps/','\x20\x20Full\x20path:\x20','4KGOSQh','cause','509212hnvdSj','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','in\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','714fftFzR','web','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x20\x20Cause:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolving\x20parent\x20segment\x20\x27','jsonl','Usage:\x20tdx\x20sg\x20show\x20<name>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','description','parentSegment','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Options:','Resolving\x20path\x20\x27','error','Resolving\x20folder\x20\x27','query','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','resolveParentId','name','toLocaleString','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Use:\x20tdx\x20ps\x20show'];a25_0x2d9a=function(){return _0xcc5c28;};return a25_0x2d9a();}async function resolveSegmentTarget(_0x91e1ce,_0x19b93d,_0x83f668){const _0xa78e39=a25_0x576d;if(isYamlFilePath(_0x91e1ce))try{const _0x2da7cc=await resolveYamlFilePath(_0x91e1ce);return _0x83f668&&(console[_0xa78e39(0x171)](_0xa78e39(0x196)+_0x91e1ce),console['error'](_0xa78e39(0x1f1)+_0x2da7cc[_0xa78e39(0x16d)]),console[_0xa78e39(0x171)]('\x20\x20Segment\x20name:\x20'+_0x2da7cc[_0xa78e39(0x1ba)]),console[_0xa78e39(0x171)](_0xa78e39(0x1ae)+(_0x2da7cc['folderPath']||_0xa78e39(0x1cc))),console[_0xa78e39(0x171)](_0xa78e39(0x1f7)+_0x2da7cc[_0xa78e39(0x1b3)])),_0x2da7cc[_0xa78e39(0x1b3)];}catch(_0xfebbe5){throw new SDKError(ErrorCode[_0xa78e39(0x1f5)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xfebbe5[_0xa78e39(0x1a9)]);}if(!_0x19b93d)throw new SDKError(ErrorCode[_0xa78e39(0x1f5)],_0xa78e39(0x1c9));return _0x19b93d+'/'+_0x91e1ce;}export class SegmentDescribeCommand extends BaseCommand{['name']=a25_0x51372c(0x1d5);[a25_0x51372c(0x16c)]=a25_0x51372c(0x192);async[a25_0x51372c(0x180)](_0x45a417){const _0x128010=a25_0x51372c,{options:_0x2f2152,args:_0x3b8222,tdx:_0x42b344}=_0x45a417,_0x29aab5=_0x3b8222[0x0],_0x20f6ef=!_0x29aab5&&!!_0x2f2152['parentSegment'],_0x16a6d6=_0x29aab5||_0x2f2152[_0x128010(0x16d)];if(!_0x16a6d6)return console[_0x128010(0x171)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x128010(0x171)](_0x128010(0x1d4)),console[_0x128010(0x171)](_0x128010(0x1b9)),console[_0x128010(0x171)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x128010(0x171)](_0x128010(0x1bb)),console[_0x128010(0x171)](_0x128010(0x174)),console[_0x128010(0x171)](_0x128010(0x1dd)),0x1;try{const _0x3b438c=_0x2f2152[_0x128010(0x1ce)];let _0x3906ef=_0x16a6d6;!_0x20f6ef&&_0x3b438c&&!_0x16a6d6[_0x128010(0x188)]('/')&&(_0x3906ef=_0x3b438c+'/'+_0x16a6d6,_0x2f2152[_0x128010(0x1e3)]&&console[_0x128010(0x171)](_0x128010(0x190)+_0x3906ef));const _0x1d7656=await withSpinner(_0x128010(0x170)+_0x3906ef+_0x128010(0x1be),()=>_0x42b344[_0x128010(0x1e6)][_0x128010(0x1a2)](_0x3906ef),{'verbose':_0x2f2152[_0x128010(0x1e3)]}),_0x1de92f=_0x1d7656[_0x128010(0x1f4)];_0x2f2152[_0x128010(0x1e3)]&&(console['error'](_0x128010(0x18b)+_0x1de92f[_0x128010(0x1c0)]),console[_0x128010(0x171)](_0x128010(0x1a4)+_0x1de92f[_0x128010(0x1e7)]),_0x1de92f[_0x128010(0x1e0)]&&console[_0x128010(0x171)](_0x128010(0x1c1)+_0x1de92f['folderId']),_0x1de92f[_0x128010(0x1d7)]&&console['error'](_0x128010(0x19e)+_0x1de92f[_0x128010(0x1d7)]));if(_0x1de92f['type']===_0x128010(0x1e1)){const _0x5d0834=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x42b344[_0x128010(0x1e6)][_0x128010(0x183)](_0x1de92f[_0x128010(0x1e7)]),{'verbose':_0x2f2152[_0x128010(0x1e3)]});await handleSingleObjectOutput(_0x5d0834[_0x128010(0x1f4)],_0x2f2152);}else{if(_0x1de92f[_0x128010(0x1c0)]===_0x128010(0x193)){if(!_0x1de92f[_0x128010(0x1e0)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x6b6f1=await withSpinner(_0x128010(0x18e),()=>_0x42b344[_0x128010(0x1e6)][_0x128010(0x1a1)](_0x1de92f[_0x128010(0x1e0)]),{'verbose':_0x2f2152[_0x128010(0x1e3)]});await handleSingleObjectOutput(_0x6b6f1[_0x128010(0x1f4)],_0x2f2152);}else{if(_0x1de92f[_0x128010(0x1c0)]===_0x128010(0x1e6)){if(!_0x1de92f['segmentId'])throw new SDKError(ErrorCode[_0x128010(0x1af)],_0x128010(0x1b0));const _0x58a185=await withSpinner(_0x128010(0x1a6),()=>_0x42b344['segment'][_0x128010(0x1bf)](_0x1de92f[_0x128010(0x1e7)],_0x1de92f[_0x128010(0x1d7)]),{'verbose':_0x2f2152['verbose']});await handleSingleObjectOutput(_0x58a185[_0x128010(0x1f4)],_0x2f2152);}}}return 0x0;}catch(_0x2b9e1){if(_0x2b9e1 instanceof SDKError)return console['error']('Error:\x20'+_0x2b9e1['message']),_0x2b9e1[_0x128010(0x1f9)]&&console[_0x128010(0x171)](_0x128010(0x165)+_0x2b9e1[_0x128010(0x1f9)]),0x1;throw _0x2b9e1;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x51372c(0x178)]=a25_0x51372c(0x1cb);[a25_0x51372c(0x16c)]=a25_0x51372c(0x16e);async['execute'](_0x2abea1){const _0x49c208=a25_0x51372c,{options:_0xbabf09,args:_0x434686,tdx:_0x5b12ba}=_0x2abea1,_0xc7dcb0=_0x434686[0x0];if(!_0xc7dcb0)return console[_0x49c208(0x171)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x49c208(0x16a)),console['error'](_0x49c208(0x1ed)),console[_0x49c208(0x171)](_0x49c208(0x1b9)),console[_0x49c208(0x171)](_0x49c208(0x182)),console[_0x49c208(0x171)](_0x49c208(0x197)),0x1;try{const _0x478098=_0xbabf09[_0x49c208(0x16d)],_0xfc3e4c=await resolveSegmentTarget(_0xc7dcb0,_0x478098,_0xbabf09[_0x49c208(0x1e3)]);_0xbabf09[_0x49c208(0x1e3)]&&console[_0x49c208(0x171)](_0x49c208(0x1ab)+_0xfc3e4c);const _0x2365cb=await withSpinner(_0x49c208(0x1e8)+_0xc7dcb0+_0x49c208(0x1be),()=>_0x5b12ba[_0x49c208(0x1e6)][_0x49c208(0x1a2)](_0xfc3e4c),{'verbose':_0xbabf09[_0x49c208(0x1e3)]}),_0x730793=_0x2365cb[_0x49c208(0x1f4)];_0xbabf09['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x730793['type']),console['error'](_0x49c208(0x1a4)+_0x730793['parentId']));if(_0x730793['type']==='folder')return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x49c208(0x171)](_0x49c208(0x1eb)),0x1;if(_0x730793[_0x49c208(0x1c0)]==='parent')return console[_0x49c208(0x171)](_0x49c208(0x1ef)),console['error'](_0x49c208(0x17c)),0x1;if(!_0x730793[_0x49c208(0x1d7)])throw new SDKError(ErrorCode[_0x49c208(0x1af)],_0x49c208(0x1b0));const _0x2f7bd6=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5b12ba[_0x49c208(0x1e6)][_0x49c208(0x1a7)](_0x730793['parentId'],_0x730793[_0x49c208(0x1d7)]),{'verbose':_0xbabf09[_0x49c208(0x1e3)]});let _0xf919ab=_0x2f7bd6['data'];const _0x1cb878=resolveLimit(_0xbabf09[_0x49c208(0x1df)],DEFAULT_DISPLAY_LIMIT),_0x1916e7=/\bLIMIT\s+\d+/i['test'](_0xf919ab);!_0x1916e7&&(_0xf919ab=_0xf919ab[_0x49c208(0x1b7)]()[_0x49c208(0x185)](/;+$/,''),_0xf919ab=_0x49c208(0x1c8)+_0xf919ab+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1cb878);_0xbabf09[_0x49c208(0x1e3)]&&console[_0x49c208(0x171)](_0x49c208(0x19c)+_0xf919ab);const _0x5503ca=await withProgressSpinner('Executing\x20segment\x20query...',async _0x1ccb1c=>{const _0x2a47ba=_0x49c208,_0x416909=await _0x5b12ba[_0x2a47ba(0x173)][_0x2a47ba(0x180)](_0xf919ab,{'catalog':'td','schema':'information_schema','onJobId':_0x76434c=>{const _0x1456d5=_0x2a47ba;_0x1ccb1c[_0x1456d5(0x1a3)](_0x76434c);}});return _0x416909;},{'verbose':_0xbabf09[_0x49c208(0x1e3)]}),_0x461cbc=_0x5503ca[_0x49c208(0x1f4)],_0x4f8042=_0x461cbc['jobId']?_0x49c208(0x1d9)+_0x461cbc[_0x49c208(0x1d8)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x461cbc[_0x49c208(0x194)][_0x49c208(0x1ea)][_0x49c208(0x179)]()+'\x20rows\x20'+(_0x49c208(0x1fd)+formatElapsed(_0x461cbc[_0x49c208(0x194)]['elapsedTimeMillis'])+_0x4f8042)),await handleQueryOutput(_0x461cbc,_0xbabf09),0x0;}catch(_0xfe09b1){if(_0xfe09b1 instanceof SDKError)return console[_0x49c208(0x171)](_0x49c208(0x19d)+_0xfe09b1[_0x49c208(0x1d3)]+']'),console['error']('\x0a'+_0xfe09b1[_0x49c208(0x1a9)]),0x1;throw _0xfe09b1;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a25_0x51372c(0x1d0);['description']=a25_0x51372c(0x17a);async['execute'](_0x3009e8){const _0x1809b8=a25_0x51372c,{options:_0x88bb51,args:_0x271e35,tdx:_0x169329}=_0x3009e8;if(_0x271e35[_0x1809b8(0x1e9)]===0x0)return console[_0x1809b8(0x171)](_0x1809b8(0x198)),console[_0x1809b8(0x171)](_0x1809b8(0x1fc)),0x1;const _0x5d2791=_0x271e35[0x0];try{_0x88bb51[_0x1809b8(0x1e3)]&&(console[_0x1809b8(0x171)]('Site:\x20'+_0x88bb51['site']),console[_0x1809b8(0x171)](_0x1809b8(0x1d6)+_0x5d2791));const _0xb3b14f=await withSpinner(_0x1809b8(0x168)+_0x5d2791+_0x1809b8(0x1be),()=>_0x169329[_0x1809b8(0x1e6)][_0x1809b8(0x177)](_0x5d2791),{'verbose':_0x88bb51[_0x1809b8(0x1e3)]}),_0x2415f3=_0xb3b14f['data'];_0x88bb51[_0x1809b8(0x1e3)]&&console[_0x1809b8(0x171)]('Resolved\x20parent\x20ID:\x20'+_0x2415f3);const _0x1683f6=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x5d2791+_0x1809b8(0x1be),()=>_0x169329[_0x1809b8(0x1e6)][_0x1809b8(0x1b6)](_0x2415f3),{'verbose':_0x88bb51['verbose']}),_0x4ac7a2=_0x1683f6[_0x1809b8(0x1f4)];return console[_0x1809b8(0x171)](_0x1809b8(0x1c4)+_0x4ac7a2[_0x1809b8(0x1e9)]+'\x20folder'+(_0x4ac7a2[_0x1809b8(0x1e9)]!==0x1?'s':'')),await handleSDKOutput(_0x4ac7a2,_0x88bb51),0x0;}catch(_0x17fcf4){if(_0x17fcf4 instanceof SDKError)return console[_0x1809b8(0x171)](_0x1809b8(0x1bd)+_0x17fcf4[_0x1809b8(0x1a9)]),_0x17fcf4[_0x1809b8(0x1f9)]&&console[_0x1809b8(0x171)](_0x1809b8(0x165)+_0x17fcf4['cause']),0x1;throw _0x17fcf4;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a25_0x51372c(0x1d2);[a25_0x51372c(0x16c)]=a25_0x51372c(0x18f);async[a25_0x51372c(0x180)](_0x235af6){const _0x223079=a25_0x51372c,{options:_0x152d6c,args:_0xb10d00,tdx:_0x97f7ed}=_0x235af6;if(_0xb10d00[_0x223079(0x1e9)]===0x0)return console[_0x223079(0x171)](_0x223079(0x1d1)),console[_0x223079(0x171)](_0x223079(0x1a5)),0x1;try{const {parentId:_0x25d5a0,childId:_0x3df6a7}=parseSegmentRef(_0xb10d00[0x0]);_0x152d6c[_0x223079(0x1e3)]&&(console[_0x223079(0x171)]('Site:\x20'+_0x152d6c[_0x223079(0x1e5)]),console['error'](_0x223079(0x1d6)+_0x25d5a0),_0x3df6a7&&console[_0x223079(0x171)](_0x223079(0x1c6)+_0x3df6a7));if(!_0x3df6a7)return console[_0x223079(0x171)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0xf6507e=await withSpinner(_0x223079(0x168)+_0x25d5a0+_0x223079(0x1be),()=>_0x97f7ed[_0x223079(0x1e6)][_0x223079(0x177)](_0x25d5a0),{'verbose':_0x152d6c['verbose']}),_0x58996f=_0xf6507e['data'];_0x152d6c[_0x223079(0x1e3)]&&console[_0x223079(0x171)]('Resolved\x20parent\x20ID:\x20'+_0x58996f);const _0x33ab5c=await withSpinner(_0x223079(0x172)+_0x3df6a7+_0x223079(0x1be),()=>_0x97f7ed[_0x223079(0x1e6)]['resolveFolderId'](_0x58996f,_0x3df6a7),{'verbose':_0x152d6c['verbose']}),_0x5175b3=_0x33ab5c['data'];_0x152d6c[_0x223079(0x1e3)]&&console['error'](_0x223079(0x175)+_0x5175b3);const _0x201fb8=await withSpinner(_0x223079(0x1b4)+_0x3df6a7+_0x223079(0x1be),()=>_0x97f7ed[_0x223079(0x1e6)][_0x223079(0x1a1)](_0x5175b3),{'verbose':_0x152d6c[_0x223079(0x1e3)]});return await handleSDKOutput([_0x201fb8[_0x223079(0x1f4)]],_0x152d6c),0x0;}catch(_0x239ccd){if(_0x239ccd instanceof SDKError)return console[_0x223079(0x171)](_0x223079(0x1bd)+_0x239ccd['message']),_0x239ccd['cause']&&console['error'](_0x223079(0x165)+_0x239ccd[_0x223079(0x1f9)]),0x1;throw _0x239ccd;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';['description']=a25_0x51372c(0x186);async['execute'](_0x280cb8){const _0x541c38=a25_0x51372c,{options:_0x2d69e9,args:_0x477149,tdx:_0x7b13d2}=_0x280cb8,_0x58ca52=_0x477149[0x0];if(!_0x58ca52)return console[_0x541c38(0x171)](_0x541c38(0x1fe)),console[_0x541c38(0x171)](_0x541c38(0x199)),console['error'](_0x541c38(0x164)),console[_0x541c38(0x171)](_0x541c38(0x1b9)),console['error'](_0x541c38(0x1a0)),console[_0x541c38(0x171)](_0x541c38(0x19a)),0x1;try{const _0x5316e4=_0x2d69e9[_0x541c38(0x16d)],_0x3abd4b=await resolveSegmentTarget(_0x58ca52,_0x5316e4,_0x2d69e9[_0x541c38(0x1e3)]);_0x2d69e9[_0x541c38(0x1e3)]&&console[_0x541c38(0x171)](_0x541c38(0x1ab)+_0x3abd4b);const _0x166eaf=await withSpinner('Resolving\x20\x27'+_0x58ca52+'\x27...',()=>_0x7b13d2[_0x541c38(0x1e6)][_0x541c38(0x1a2)](_0x3abd4b),{'verbose':_0x2d69e9[_0x541c38(0x1e3)]}),_0x592f2c=_0x166eaf[_0x541c38(0x1f4)];_0x2d69e9[_0x541c38(0x1e3)]&&(console[_0x541c38(0x171)]('Resolved\x20type:\x20'+_0x592f2c['type']),console['error']('Parent\x20ID:\x20'+_0x592f2c[_0x541c38(0x1e7)]));if(_0x592f2c[_0x541c38(0x1c0)]===_0x541c38(0x193))return console[_0x541c38(0x171)](_0x541c38(0x1c3)),console[_0x541c38(0x171)](_0x541c38(0x1bc)),0x1;if(_0x592f2c['type']===_0x541c38(0x1e1))return console[_0x541c38(0x171)](_0x541c38(0x1f0)),console[_0x541c38(0x171)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x592f2c[_0x541c38(0x1d7)])throw new SDKError(ErrorCode[_0x541c38(0x1af)],_0x541c38(0x1b0));const _0x1d3ad3=await withSpinner(_0x541c38(0x1ee),()=>_0x7b13d2[_0x541c38(0x1e6)][_0x541c38(0x1a7)](_0x592f2c[_0x541c38(0x1e7)],_0x592f2c['segmentId']),{'verbose':_0x2d69e9[_0x541c38(0x1e3)]}),_0x3c295b=_0x1d3ad3['data'];return _0x2d69e9[_0x541c38(0x17d)]==='json'||_0x2d69e9[_0x541c38(0x17d)]===_0x541c38(0x169)?await handleSDKOutput([{'sql':_0x3c295b}],_0x2d69e9):console[_0x541c38(0x1c5)](_0x3c295b),0x0;}catch(_0xeadd7b){if(_0xeadd7b instanceof SDKError)return console['error'](_0x541c38(0x1bd)+_0xeadd7b[_0x541c38(0x1a9)]),_0xeadd7b[_0x541c38(0x1f9)]&&console[_0x541c38(0x171)]('\x20\x20Cause:\x20'+_0xeadd7b['cause']),0x1;throw _0xeadd7b;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x51372c(0x178)]=a25_0x51372c(0x1f3);[a25_0x51372c(0x16c)]=a25_0x51372c(0x1b5);async['execute'](_0x1a7971){const _0x14b041=a25_0x51372c,{options:_0x1581c6,args:_0x18d405,tdx:_0x2c1b2c}=_0x1a7971,_0xe34fe1=_0x1581c6;if(_0x18d405[_0x14b041(0x1e9)]<0x2)return console[_0x14b041(0x171)](_0x14b041(0x17b)),console[_0x14b041(0x171)](_0x14b041(0x176)),0x1;const _0x5e4328=_0x18d405[0x0],_0x41ce2f=_0x18d405[0x1];_0xe34fe1[_0x14b041(0x1e3)]&&(console[_0x14b041(0x171)](_0x14b041(0x1b2)+_0xe34fe1['site']),console['error'](_0x14b041(0x1f2)+_0x5e4328),console['error'](_0x14b041(0x1c6)+_0x41ce2f));let _0x40ef8a;if(_0xe34fe1['parentFolder']){const _0xba671=_0xe34fe1['parentFolder'],_0x3a99e9=await withSpinner(_0x14b041(0x168)+_0x5e4328+'\x27...',()=>_0x2c1b2c['segment'][_0x14b041(0x177)](_0x5e4328),{'verbose':_0xe34fe1[_0x14b041(0x1e3)]}),_0x14f66a=_0x3a99e9[_0x14b041(0x1f4)],_0x4920ba=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0xba671+_0x14b041(0x1be),()=>_0x2c1b2c[_0x14b041(0x1e6)][_0x14b041(0x1e4)](_0x14f66a,_0xba671),{'verbose':_0xe34fe1[_0x14b041(0x1e3)]});_0x40ef8a=_0x4920ba[_0x14b041(0x1f4)],_0xe34fe1[_0x14b041(0x1e3)]&&console[_0x14b041(0x171)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x40ef8a);}const _0x22d62f={'name':_0x41ce2f,'description':_0xe34fe1[_0x14b041(0x16c)],'parentFolderId':_0x40ef8a},_0x27264d=await withSpinner(_0x14b041(0x191)+_0x41ce2f+_0x14b041(0x1be),()=>_0x2c1b2c[_0x14b041(0x1e6)][_0x14b041(0x1b8)](_0x5e4328,_0x22d62f),{'verbose':_0xe34fe1[_0x14b041(0x1e3)]}),_0x3baaf3=_0x27264d[_0x14b041(0x1f4)];return console[_0x14b041(0x171)]('✔\x20Created\x20folder\x20\x27'+_0x3baaf3['name']+_0x14b041(0x1ec)+_0x3baaf3['id']),await handleSDKOutput([_0x3baaf3],_0xe34fe1),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x51372c(0x178)]=a25_0x51372c(0x1ac);[a25_0x51372c(0x16c)]=a25_0x51372c(0x1b1);async['execute'](_0xbe412e){const _0x9f26c2=a25_0x51372c,{options:_0x38af00,args:_0x40a739,tdx:_0x304b6d}=_0xbe412e,_0x31ce19=_0x40a739[0x0];if(!_0x31ce19)return console['error'](_0x9f26c2(0x1de)),console[_0x9f26c2(0x171)](_0x9f26c2(0x1fb)),console[_0x9f26c2(0x171)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console['error'](_0x9f26c2(0x16f)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x9f26c2(0x1b9)),console[_0x9f26c2(0x171)](_0x9f26c2(0x1aa)),console[_0x9f26c2(0x171)](_0x9f26c2(0x19f)),console[_0x9f26c2(0x171)](_0x9f26c2(0x19b)),console[_0x9f26c2(0x171)](_0x9f26c2(0x166)),0x1;try{const _0x454ccb=_0x38af00[_0x9f26c2(0x16d)],_0x21e1bf=await resolveSegmentTarget(_0x31ce19,_0x454ccb,_0x38af00['verbose']);_0x38af00[_0x9f26c2(0x1e3)]&&console[_0x9f26c2(0x171)](_0x9f26c2(0x1ab)+_0x21e1bf);const _0x3d3307=await withSpinner(_0x9f26c2(0x1e8)+_0x31ce19+_0x9f26c2(0x1be),()=>_0x304b6d[_0x9f26c2(0x1e6)][_0x9f26c2(0x1a2)](_0x21e1bf),{'verbose':_0x38af00[_0x9f26c2(0x1e3)]}),_0x220e42=_0x3d3307[_0x9f26c2(0x1f4)];_0x38af00[_0x9f26c2(0x1e3)]&&(console[_0x9f26c2(0x171)](_0x9f26c2(0x18b)+_0x220e42[_0x9f26c2(0x1c0)]),console[_0x9f26c2(0x171)](_0x9f26c2(0x1a4)+_0x220e42[_0x9f26c2(0x1e7)]),_0x220e42[_0x9f26c2(0x1e0)]&&console[_0x9f26c2(0x171)](_0x9f26c2(0x1c1)+_0x220e42['folderId']),_0x220e42[_0x9f26c2(0x1d7)]&&console[_0x9f26c2(0x171)]('Segment\x20ID:\x20'+_0x220e42[_0x9f26c2(0x1d7)]));if(_0x38af00[_0x9f26c2(0x200)]){if(_0x220e42[_0x9f26c2(0x1c0)]===_0x9f26c2(0x193))return console[_0x9f26c2(0x171)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x220e42[_0x9f26c2(0x1c0)]==='parent')return console[_0x9f26c2(0x171)](_0x9f26c2(0x1c2)),console[_0x9f26c2(0x171)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x220e42[_0x9f26c2(0x1d7)])throw new SDKError(ErrorCode[_0x9f26c2(0x1af)],_0x9f26c2(0x1b0));const _0x1978bd=getConsoleNextUrl(_0x38af00['site'],_0x9f26c2(0x1f6)+_0x220e42[_0x9f26c2(0x1e7)]+_0x9f26c2(0x17e)+_0x220e42['segmentId']);return console[_0x9f26c2(0x171)](a25_0x4b6697['green']('✔')+_0x9f26c2(0x1cd)+a25_0x4b6697['cyan'](_0x1978bd)),openBrowser(_0x1978bd),0x0;}if(_0x220e42[_0x9f26c2(0x1c0)]===_0x9f26c2(0x193)){if(!_0x220e42[_0x9f26c2(0x1e0)])throw new SDKError(ErrorCode[_0x9f26c2(0x18c)],_0x9f26c2(0x16b));const _0x47015c=await withSpinner(_0x9f26c2(0x18e),()=>_0x304b6d[_0x9f26c2(0x1e6)][_0x9f26c2(0x1a1)](_0x220e42[_0x9f26c2(0x1e0)]),{'verbose':_0x38af00['verbose']});await handleSingleObjectOutput(_0x47015c[_0x9f26c2(0x1f4)],_0x38af00);}else{if(_0x220e42[_0x9f26c2(0x1c0)]===_0x9f26c2(0x1e6)){if(!_0x220e42[_0x9f26c2(0x1d7)])throw new SDKError(ErrorCode[_0x9f26c2(0x1af)],_0x9f26c2(0x1b0));const _0x103063=await withSpinner(_0x9f26c2(0x1a6),()=>_0x304b6d['segment'][_0x9f26c2(0x1bf)](_0x220e42['parentId'],_0x220e42[_0x9f26c2(0x1d7)]),{'verbose':_0x38af00[_0x9f26c2(0x1e3)]}),_0x48f555=getConsoleNextUrl(_0x38af00['site'],'/app/ps/'+_0x220e42[_0x9f26c2(0x1e7)]+_0x9f26c2(0x17e)+_0x220e42[_0x9f26c2(0x1d7)]),_0x3422e6=_0x103063[_0x9f26c2(0x1f4)];_0x3422e6[_0x9f26c2(0x1da)]=_0x48f555,await handleSingleObjectOutput(_0x3422e6,_0x38af00);}else return console[_0x9f26c2(0x171)](_0x9f26c2(0x1c7)),console[_0x9f26c2(0x171)](_0x9f26c2(0x1dc)),0x1;}return 0x0;}catch(_0x44971a){if(_0x44971a instanceof SDKError)return console[_0x9f26c2(0x171)](_0x9f26c2(0x1bd)+_0x44971a[_0x9f26c2(0x1a9)]),_0x44971a[_0x9f26c2(0x1f9)]&&console['error'](_0x9f26c2(0x165)+_0x44971a[_0x9f26c2(0x1f9)]),0x1;throw _0x44971a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a25_0x51372c(0x18d);[a25_0x51372c(0x16c)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x335266){const _0x127268=a25_0x51372c,{options:_0x2a3546,args:_0x2adf5a,tdx:_0x32e3a0}=_0x335266,_0x1655a2=_0x2adf5a[0x0];if(!_0x1655a2)return console[_0x127268(0x171)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x127268(0x171)](_0x127268(0x1a8)),console[_0x127268(0x171)](_0x127268(0x1cf)),console[_0x127268(0x171)]('Examples:'),console[_0x127268(0x171)](_0x127268(0x1db)),console[_0x127268(0x171)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x32fd53=_0x2a3546[_0x127268(0x16d)],_0x46a856=await resolveSegmentTarget(_0x1655a2,_0x32fd53,_0x2a3546[_0x127268(0x1e3)]);_0x2a3546[_0x127268(0x1e3)]&&console[_0x127268(0x171)]('Target\x20path:\x20'+_0x46a856);const _0x2069d0=await withSpinner(_0x127268(0x1e8)+_0x1655a2+_0x127268(0x1be),()=>_0x32e3a0[_0x127268(0x1e6)][_0x127268(0x1a2)](_0x46a856),{'verbose':_0x2a3546['verbose']}),_0x40a4b1=_0x2069d0[_0x127268(0x1f4)];_0x2a3546[_0x127268(0x1e3)]&&(console['error'](_0x127268(0x18b)+_0x40a4b1['type']),console['error']('Parent\x20ID:\x20'+_0x40a4b1[_0x127268(0x1e7)]));if(_0x40a4b1['type']==='folder')return console[_0x127268(0x171)](_0x127268(0x167)),console['error'](_0x127268(0x1bc)),0x1;if(_0x40a4b1['type']===_0x127268(0x1e1))return console[_0x127268(0x171)](_0x127268(0x181)),console[_0x127268(0x171)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x40a4b1[_0x127268(0x1d7)])throw new SDKError(ErrorCode[_0x127268(0x1af)],_0x127268(0x1b0));const _0x31e51=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x32e3a0[_0x127268(0x1e6)][_0x127268(0x1a7)](_0x40a4b1[_0x127268(0x1e7)],_0x40a4b1[_0x127268(0x1d7)]),{'verbose':_0x2a3546[_0x127268(0x1e3)]}),_0x2b979b=_0x31e51[_0x127268(0x1f4)],_0x165c99=await executeSchemaQuery(_0x2b979b,_0x32e3a0,_0x2a3546);return await handleQueryOutput(_0x165c99,_0x2a3546),0x0;}catch(_0x29a757){if(_0x29a757 instanceof SDKError)return console[_0x127268(0x171)](_0x127268(0x1bd)+_0x29a757[_0x127268(0x1a9)]),_0x29a757[_0x127268(0x1f9)]&&console['error'](_0x127268(0x165)+_0x29a757[_0x127268(0x1f9)]),0x1;throw _0x29a757;}}}
@@ -1 +1 @@
1
- const a26_0x2707b3=a26_0x5aec;(function(_0x48bcf9,_0x20df06){const _0x172feb=a26_0x5aec,_0x29f3a6=_0x48bcf9();while(!![]){try{const _0xdcfbff=parseInt(_0x172feb(0xba))/0x1*(-parseInt(_0x172feb(0xa4))/0x2)+parseInt(_0x172feb(0xa1))/0x3+-parseInt(_0x172feb(0xa5))/0x4+-parseInt(_0x172feb(0x99))/0x5+parseInt(_0x172feb(0xbe))/0x6+parseInt(_0x172feb(0x8b))/0x7*(-parseInt(_0x172feb(0x90))/0x8)+parseInt(_0x172feb(0xb3))/0x9;if(_0xdcfbff===_0x20df06)break;else _0x29f3a6['push'](_0x29f3a6['shift']());}catch(_0x3706a3){_0x29f3a6['push'](_0x29f3a6['shift']());}}}(a26_0x4d47,0xb7f9d));import{BaseCommand}from'./command.js';function a26_0x5aec(_0x5d38c4,_0x5680c7){_0x5d38c4=_0x5d38c4-0x88;const _0x4d476f=a26_0x4d47();let _0x5aeced=_0x4d476f[_0x5d38c4];return _0x5aeced;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x4d47(){const _0x47a182=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Examples:','Resolved\x20folder\x20ID:\x20','invisible','20085444BgpLfJ','Site:\x20','noCountPopulation','segment','length','\x27...','includes','74101mRQAVc','Parent\x20path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Creating\x20segment\x20\x27','7042374CuLZca','segments','error','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','10509016Yqerlt','rule','\x27\x20with\x20ID:\x20','yellow','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','8NpKpzR','verbose','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','resolveFolderId','Target\x20path:\x20','description','segmentPath','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','type','1068815ERfePs','Resolving\x20folder\x20path\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','site','segment:create','Segment\x20name:\x20','parent','✔\x20Created\x20segment\x20\x27','294372rRCWEE','name','\x20\x20\x20Path:\x20','4eSJDDr','3547004fAqSAd','folder','createSegment','resolveParentId','Parent:\x20','Resolved\x20relative\x20path\x20to:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','ruleFile','data','execute'];a26_0x4d47=function(){return _0x47a182;};return a26_0x4d47();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x117633 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x2707b3(0xa2)]=a26_0x2707b3(0x9d);[a26_0x2707b3(0x95)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a26_0x2707b3(0xae)](_0x26edfa){const _0x364b57=a26_0x2707b3;console['error'](a26_0x117633[_0x364b57(0x8e)](_0x364b57(0xab))),console[_0x364b57(0x88)](a26_0x117633['yellow'](_0x364b57(0x8a)));const {options:_0x4d5fc0,args:_0x5e21b6,tdx:_0x1f1f75}=_0x26edfa,_0x3788bd=_0x4d5fc0;if(_0x5e21b6['length']===0x0)return console['error'](_0x364b57(0x97)),console[_0x364b57(0x88)](_0x364b57(0x92)),console[_0x364b57(0x88)](_0x364b57(0xb0)),console['error'](_0x364b57(0xaf)),console[_0x364b57(0x88)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x364b57(0x89)),0x1;const _0x51b6d3=_0x5e21b6[0x0],_0x49776a=_0x4d5fc0[_0x364b57(0x96)];let _0x455b7f=_0x51b6d3;_0x49776a&&!_0x51b6d3[_0x364b57(0xb9)]('/')&&(_0x455b7f=_0x49776a+'/'+_0x51b6d3,_0x3788bd[_0x364b57(0x91)]&&console[_0x364b57(0x88)](_0x364b57(0xaa)+_0x455b7f));const _0x46672f=parsePath(_0x455b7f);if(_0x46672f[_0x364b57(0xbf)][_0x364b57(0xb7)]<0x2)return console[_0x364b57(0x88)](_0x364b57(0x8f)),console[_0x364b57(0x88)](_0x364b57(0x9b)),0x1;const _0x34ae45=_0x46672f[_0x364b57(0xbf)][0x0],_0x262fd2=getBaseName(_0x455b7f),_0x320480=getParentPath(_0x455b7f);_0x3788bd[_0x364b57(0x91)]&&(console[_0x364b57(0x88)](_0x364b57(0xb4)+_0x3788bd[_0x364b57(0x9c)]),console[_0x364b57(0x88)](_0x364b57(0x94)+_0x455b7f),console[_0x364b57(0x88)](_0x364b57(0xa9)+_0x34ae45),console[_0x364b57(0x88)](_0x364b57(0x9e)+_0x262fd2),console[_0x364b57(0x88)](_0x364b57(0xbb)+_0x320480));const _0x351598=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x34ae45+'\x27...',()=>_0x1f1f75['segment'][_0x364b57(0xa8)](_0x34ae45),{'verbose':_0x3788bd[_0x364b57(0x91)]}),_0x218df1=_0x351598['data'];let _0x2f00db;if(_0x46672f[_0x364b57(0xbf)]['length']>0x2){const _0x28ecf2=await withSpinner(_0x364b57(0x9a)+_0x320480+_0x364b57(0xb8),()=>_0x1f1f75[_0x364b57(0xb6)]['resolvePathToResource'](_0x320480),{'verbose':_0x3788bd['verbose']}),_0x2b8838=_0x28ecf2['data'];if(_0x2b8838[_0x364b57(0x98)]!=='folder'&&_0x2b8838['type']!==_0x364b57(0x9f))return console['error'](_0x364b57(0xbc)),0x1;_0x2f00db=_0x2b8838['folderId'];}else{if(_0x3788bd[_0x364b57(0xa6)]){const _0x26a75f=await withSpinner('Resolving\x20folder\x20\x27'+_0x3788bd[_0x364b57(0xa6)]+_0x364b57(0xb8),()=>_0x1f1f75[_0x364b57(0xb6)][_0x364b57(0x93)](_0x218df1,_0x3788bd[_0x364b57(0xa6)]),{'verbose':_0x3788bd[_0x364b57(0x91)]});_0x2f00db=_0x26a75f['data'];}}_0x3788bd[_0x364b57(0x91)]&&_0x2f00db&&console['error'](_0x364b57(0xb1)+_0x2f00db);const _0xc6b261=await loadJSONFromOptions(_0x3788bd[_0x364b57(0x8c)],_0x3788bd[_0x364b57(0xac)]),_0x2e29cf={'name':_0x262fd2,'description':_0x3788bd[_0x364b57(0x95)],'rule':_0xc6b261,'kind':_0x3788bd['kind']!==undefined?parseInt(_0x3788bd['kind'],0xa):undefined,'isVisible':_0x3788bd[_0x364b57(0xb2)]?![]:undefined,'segmentFolderId':_0x2f00db,'countPopulation':_0x3788bd[_0x364b57(0xb5)]?![]:undefined},_0x241fdf=await withSpinner(_0x364b57(0xbd)+_0x262fd2+_0x364b57(0xb8),()=>_0x1f1f75[_0x364b57(0xb6)][_0x364b57(0xa7)](_0x218df1,_0x2e29cf),{'verbose':_0x3788bd[_0x364b57(0x91)]}),_0x3d2d44=_0x241fdf[_0x364b57(0xad)];return console[_0x364b57(0x88)](_0x364b57(0xa0)+_0x3d2d44[_0x364b57(0xa2)]+_0x364b57(0x8d)+_0x3d2d44['id']),_0x455b7f!==_0x51b6d3&&console['error'](_0x364b57(0xa3)+_0x455b7f),await handleSDKOutput([_0x3d2d44],_0x3788bd),0x0;}}
1
+ const a26_0x4b463d=a26_0x2392;(function(_0x527860,_0x2e9c4e){const _0x4cc1b9=a26_0x2392,_0x3f9c94=_0x527860();while(!![]){try{const _0x4b0b90=-parseInt(_0x4cc1b9(0x159))/0x1*(-parseInt(_0x4cc1b9(0x16c))/0x2)+-parseInt(_0x4cc1b9(0x164))/0x3+-parseInt(_0x4cc1b9(0x14d))/0x4*(parseInt(_0x4cc1b9(0x17b))/0x5)+-parseInt(_0x4cc1b9(0x165))/0x6*(parseInt(_0x4cc1b9(0x162))/0x7)+parseInt(_0x4cc1b9(0x171))/0x8*(parseInt(_0x4cc1b9(0x17a))/0x9)+-parseInt(_0x4cc1b9(0x14c))/0xa+-parseInt(_0x4cc1b9(0x16e))/0xb*(-parseInt(_0x4cc1b9(0x16b))/0xc);if(_0x4b0b90===_0x2e9c4e)break;else _0x3f9c94['push'](_0x3f9c94['shift']());}catch(_0x27b458){_0x3f9c94['push'](_0x3f9c94['shift']());}}}(a26_0x15c2,0x40864));import{BaseCommand}from'./command.js';function a26_0x2392(_0x50c507,_0x11d16f){_0x50c507=_0x50c507-0x14c;const _0x15c268=a26_0x15c2();let _0x23927b=_0x15c268[_0x50c507];return _0x23927b;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a26_0x15c2(){const _0x500085=['includes','264QdRJwf','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','✔\x20Created\x20segment\x20\x27','8BlxZPC','Examples:','segmentPath','noCountPopulation','yellow','kind','Resolving\x20folder\x20\x27','\x27...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','4094343GgiFzX','1243235SvGlCS','Creating\x20segment\x20\x27','2830810ywtUAC','8ZcUzEn','name','Parent\x20path:\x20','resolveFolderId','\x20\x20\x20Path:\x20','segments','segment:create','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','type','invisible','folderId','folder','17933emNhCV','Create\x20child\x20segment\x20with\x20filtering\x20rules','Parent:\x20','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','length','\x27\x20with\x20ID:\x20','Site:\x20','verbose','98IgGNhL','segment','79563OtBvvy','89202KPqeyi','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolvePathToResource','data','Resolved\x20folder\x20ID:\x20','error','241836QeecRz','38FDKtRa'];a26_0x15c2=function(){return _0x500085;};return a26_0x15c2();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x4cbbb8 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x4b463d(0x14e)]=a26_0x4b463d(0x153);['description']=a26_0x4b463d(0x15a);async['execute'](_0x597c7e){const _0x1971b7=a26_0x4b463d;console[_0x1971b7(0x16a)](a26_0x4cbbb8[_0x1971b7(0x175)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x1971b7(0x16a)](a26_0x4cbbb8[_0x1971b7(0x175)](_0x1971b7(0x166)));const {options:_0x324fac,args:_0x5ad8d2,tdx:_0x1c198e}=_0x597c7e,_0xde7798=_0x324fac;if(_0x5ad8d2[_0x1971b7(0x15e)]===0x0)return console[_0x1971b7(0x16a)](_0x1971b7(0x179)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error'](_0x1971b7(0x172)),console['error'](_0x1971b7(0x16f)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x1971b7(0x16a)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x38eecb=_0x5ad8d2[0x0],_0x3d1798=_0x324fac[_0x1971b7(0x173)];let _0x2aac24=_0x38eecb;_0x3d1798&&!_0x38eecb[_0x1971b7(0x16d)]('/')&&(_0x2aac24=_0x3d1798+'/'+_0x38eecb,_0xde7798['verbose']&&console[_0x1971b7(0x16a)](_0x1971b7(0x15c)+_0x2aac24));const _0xc614c3=parsePath(_0x2aac24);if(_0xc614c3[_0x1971b7(0x152)]['length']<0x2)return console[_0x1971b7(0x16a)](_0x1971b7(0x15d)),console['error'](_0x1971b7(0x154)),0x1;const _0x5f0165=_0xc614c3[_0x1971b7(0x152)][0x0],_0x43167c=getBaseName(_0x2aac24),_0x2efb7b=getParentPath(_0x2aac24);_0xde7798[_0x1971b7(0x161)]&&(console[_0x1971b7(0x16a)](_0x1971b7(0x160)+_0xde7798['site']),console[_0x1971b7(0x16a)]('Target\x20path:\x20'+_0x2aac24),console[_0x1971b7(0x16a)](_0x1971b7(0x15b)+_0x5f0165),console['error']('Segment\x20name:\x20'+_0x43167c),console[_0x1971b7(0x16a)](_0x1971b7(0x14f)+_0x2efb7b));const _0x253055=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5f0165+_0x1971b7(0x178),()=>_0x1c198e['segment']['resolveParentId'](_0x5f0165),{'verbose':_0xde7798[_0x1971b7(0x161)]}),_0x318587=_0x253055[_0x1971b7(0x168)];let _0x583d7e;if(_0xc614c3[_0x1971b7(0x152)][_0x1971b7(0x15e)]>0x2){const _0x32d955=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x2efb7b+_0x1971b7(0x178),()=>_0x1c198e['segment'][_0x1971b7(0x167)](_0x2efb7b),{'verbose':_0xde7798['verbose']}),_0x30eb01=_0x32d955[_0x1971b7(0x168)];if(_0x30eb01[_0x1971b7(0x155)]!==_0x1971b7(0x158)&&_0x30eb01[_0x1971b7(0x155)]!=='parent')return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x583d7e=_0x30eb01[_0x1971b7(0x157)];}else{if(_0xde7798[_0x1971b7(0x158)]){const _0x40d90b=await withSpinner(_0x1971b7(0x177)+_0xde7798[_0x1971b7(0x158)]+_0x1971b7(0x178),()=>_0x1c198e[_0x1971b7(0x163)][_0x1971b7(0x150)](_0x318587,_0xde7798['folder']),{'verbose':_0xde7798[_0x1971b7(0x161)]});_0x583d7e=_0x40d90b[_0x1971b7(0x168)];}}_0xde7798[_0x1971b7(0x161)]&&_0x583d7e&&console[_0x1971b7(0x16a)](_0x1971b7(0x169)+_0x583d7e);const _0x40f835=await loadJSONFromOptions(_0xde7798['rule'],_0xde7798['ruleFile']),_0xd165d6={'name':_0x43167c,'description':_0xde7798['description'],'rule':_0x40f835,'kind':_0xde7798['kind']!==undefined?parseInt(_0xde7798[_0x1971b7(0x176)],0xa):undefined,'isVisible':_0xde7798[_0x1971b7(0x156)]?![]:undefined,'segmentFolderId':_0x583d7e,'countPopulation':_0xde7798[_0x1971b7(0x174)]?![]:undefined},_0x543619=await withSpinner(_0x1971b7(0x17c)+_0x43167c+_0x1971b7(0x178),()=>_0x1c198e[_0x1971b7(0x163)]['createSegment'](_0x318587,_0xd165d6),{'verbose':_0xde7798['verbose']}),_0x1ba238=_0x543619[_0x1971b7(0x168)];return console['error'](_0x1971b7(0x170)+_0x1ba238[_0x1971b7(0x14e)]+_0x1971b7(0x15f)+_0x1ba238['id']),_0x2aac24!==_0x38eecb&&console['error'](_0x1971b7(0x151)+_0x2aac24),await handleSDKOutput([_0x1ba238],_0xde7798),0x0;}}
@@ -1 +1 @@
1
- function a27_0x44ba(){const _0x2d52ed=['1664856eqfNIn','1681810pkZRpP','14aLXNCS','Error:\x20Parent\x20segment\x20name\x20is\x20required','1017eDiCVc','\x27...','parentSegment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','error','json','248bPObdV','19470WsuRco','data','verbose','segment','Listing\x20fields\x20for\x20\x27','name','List\x20available\x20fields\x20for\x20segmentation','segment:fields','listFields','7204mzcNyj','length','Site:\x20','description','jsonl','\x20field','Parent\x20segment:\x20','3153786VDkNOz','11444JPnTUi','22852511NmshlH','1908MUrCCM'];a27_0x44ba=function(){return _0x2d52ed;};return a27_0x44ba();}const a27_0x137f86=a27_0x32c5;(function(_0x1a68d4,_0x1c7354){const _0x3ee54c=a27_0x32c5,_0x5acd69=_0x1a68d4();while(!![]){try{const _0x171e87=-parseInt(_0x3ee54c(0x140))/0x1*(-parseInt(_0x3ee54c(0x14a))/0x2)+parseInt(_0x3ee54c(0x13a))/0x3*(parseInt(_0x3ee54c(0x133))/0x4)+parseInt(_0x3ee54c(0x137))/0x5+-parseInt(_0x3ee54c(0x132))/0x6*(-parseInt(_0x3ee54c(0x138))/0x7)+-parseInt(_0x3ee54c(0x136))/0x8+-parseInt(_0x3ee54c(0x135))/0x9*(parseInt(_0x3ee54c(0x141))/0xa)+-parseInt(_0x3ee54c(0x134))/0xb;if(_0x171e87===_0x1c7354)break;else _0x5acd69['push'](_0x5acd69['shift']());}catch(_0x55a32b){_0x5acd69['push'](_0x5acd69['shift']());}}}(a27_0x44ba,0x86deb));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a27_0x32c5(_0x5e4123,_0x4d1ec4){_0x5e4123=_0x5e4123-0x12c;const _0x44bae1=a27_0x44ba();let _0x32c59b=_0x44bae1[_0x5e4123];return _0x32c59b;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x137f86(0x146)]=a27_0x137f86(0x148);[a27_0x137f86(0x12e)]=a27_0x137f86(0x147);async['execute'](_0x167f07){const _0x7a13e7=a27_0x137f86,{options:_0x10168d,args:_0x304f5a,tdx:_0x566fe5}=_0x167f07,_0x46d95f=_0x304f5a[0x0]||_0x10168d[_0x7a13e7(0x13c)];if(!_0x46d95f)return console[_0x7a13e7(0x13e)](_0x7a13e7(0x139)),console[_0x7a13e7(0x13e)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x7a13e7(0x13e)](_0x7a13e7(0x13d)),0x1;_0x10168d['verbose']&&(console[_0x7a13e7(0x13e)](_0x7a13e7(0x12d)+_0x10168d['site']),console[_0x7a13e7(0x13e)](_0x7a13e7(0x131)+_0x46d95f));const _0x8dee0f=await withSpinner(_0x7a13e7(0x145)+_0x46d95f+_0x7a13e7(0x13b),()=>_0x566fe5[_0x7a13e7(0x144)][_0x7a13e7(0x149)](_0x46d95f),{'verbose':_0x10168d[_0x7a13e7(0x143)]}),_0x529921=_0x8dee0f[_0x7a13e7(0x142)];console[_0x7a13e7(0x13e)]('✔\x20Found\x20'+_0x529921[_0x7a13e7(0x12c)]+_0x7a13e7(0x130)+(_0x529921['length']!==0x1?'s':''));if(_0x10168d[_0x7a13e7(0x13f)]||_0x10168d[_0x7a13e7(0x12f)])return await handleSDKOutput(_0x529921,_0x10168d),0x0;return displayFieldsHumanReadable(_0x529921,_0x46d95f),0x0;}}
1
+ const a27_0x3a9cf0=a27_0x3a44;(function(_0x57779f,_0x36d96b){const _0x53c33d=a27_0x3a44,_0x38bd45=_0x57779f();while(!![]){try{const _0x4dd21f=-parseInt(_0x53c33d(0xc2))/0x1*(parseInt(_0x53c33d(0xb5))/0x2)+-parseInt(_0x53c33d(0xb3))/0x3+-parseInt(_0x53c33d(0xc4))/0x4*(parseInt(_0x53c33d(0xbc))/0x5)+parseInt(_0x53c33d(0xb6))/0x6*(parseInt(_0x53c33d(0xc0))/0x7)+parseInt(_0x53c33d(0xb4))/0x8+parseInt(_0x53c33d(0xc1))/0x9+-parseInt(_0x53c33d(0xc7))/0xa*(-parseInt(_0x53c33d(0xc6))/0xb);if(_0x4dd21f===_0x36d96b)break;else _0x38bd45['push'](_0x38bd45['shift']());}catch(_0x258e0c){_0x38bd45['push'](_0x38bd45['shift']());}}}(a27_0x42f0,0x6fefc));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a27_0x42f0(){const _0x300db1=['7195600eZSrhp','2IKbtCt','70458pRcJUb','\x27...','✔\x20Found\x20','\x20field','segment','length','10bkqEhS','data','execute','jsonl','329MBrMZn','1045242cxjFIg','417938odzcSQ','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1372576lYoRZD','Listing\x20fields\x20for\x20\x27','174911sedxaA','380znipnY','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','parentSegment','error','Parent\x20segment:\x20','site','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','listFields','1827087cNHGCv'];a27_0x42f0=function(){return _0x300db1;};return a27_0x42f0();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a27_0x3a44(_0x4644c6,_0x48de83){_0x4644c6=_0x4644c6-0xb3;const _0x42f0e6=a27_0x42f0();let _0x3a443f=_0x42f0e6[_0x4644c6];return _0x3a443f;}export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';['description']='List\x20available\x20fields\x20for\x20segmentation';async[a27_0x3a9cf0(0xbe)](_0x1ec4d1){const _0x91c8be=a27_0x3a9cf0,{options:_0x24cebb,args:_0x261bea,tdx:_0x1fde2a}=_0x1ec4d1,_0x188359=_0x261bea[0x0]||_0x24cebb[_0x91c8be(0xca)];if(!_0x188359)return console[_0x91c8be(0xcb)](_0x91c8be(0xc8)),console[_0x91c8be(0xcb)](_0x91c8be(0xce)),console[_0x91c8be(0xcb)](_0x91c8be(0xc3)),0x1;_0x24cebb[_0x91c8be(0xc9)]&&(console[_0x91c8be(0xcb)]('Site:\x20'+_0x24cebb[_0x91c8be(0xcd)]),console[_0x91c8be(0xcb)](_0x91c8be(0xcc)+_0x188359));const _0x3f5dae=await withSpinner(_0x91c8be(0xc5)+_0x188359+_0x91c8be(0xb7),()=>_0x1fde2a[_0x91c8be(0xba)][_0x91c8be(0xcf)](_0x188359),{'verbose':_0x24cebb['verbose']}),_0x24ed1d=_0x3f5dae[_0x91c8be(0xbd)];console[_0x91c8be(0xcb)](_0x91c8be(0xb8)+_0x24ed1d[_0x91c8be(0xbb)]+_0x91c8be(0xb9)+(_0x24ed1d['length']!==0x1?'s':''));if(_0x24cebb['json']||_0x24cebb[_0x91c8be(0xbf)])return await handleSDKOutput(_0x24ed1d,_0x24cebb),0x0;return displayFieldsHumanReadable(_0x24ed1d,_0x188359),0x0;}}
@@ -1 +1 @@
1
- const a28_0xad2d9e=a28_0x10ab;function a28_0x3289(){const _0x2990e2=['33sgdoUO','file','message','✔\x20Context\x20set:\x20','setPhase','parentName','execute','yellow','\x27...','filter','targetDir','\x20journeys','✔\x20All\x20files\x20are\x20up\x20to\x20date','data','segments','3653382qyqqYz','\x20activations','3552252XGHSgY','\x0aChanges\x20to\x20\x27','parent_segment','counts','files','\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)','201870VskMyl','\x20\x20🗺️\x20\x20','resourceName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parentSegment','session','4773Zilcuq','312038eWrRqi','14VAtaPY','1919296sjAiWo','helpText','Write\x20','cyan','content','\x20unchanged\x20files','relativePath','length','isNew','dim','green','\x20new\x20files','\x20files\x20to\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20Pulled\x20','segment','utf-8','journeyVersions','hasChanges','Parent\x20segment:\x20','\x20segments','journeys','10Ehtmzs','2800854TKPgjM','Pulling\x20segments\x20from\x20\x27','description','activations','cwd','red','\x20\x20🎯\x20','30vHsHBm','errorCode','absolutePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20files?','\x20\x20Target:\x20','repeat','\x20=\x20','name','error','1084roWspr','\x20changed\x20files','site','dirname','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'];a28_0x3289=function(){return _0x2990e2;};return a28_0x3289();}(function(_0x2c578b,_0x10f9f0){const _0x4825c5=a28_0x10ab,_0x502354=_0x2c578b();while(!![]){try{const _0x2964da=-parseInt(_0x4825c5(0x232))/0x1+parseInt(_0x4825c5(0x1fd))/0x2+-parseInt(_0x4825c5(0x231))/0x3*(parseInt(_0x4825c5(0x20e))/0x4)+-parseInt(_0x4825c5(0x1fc))/0x5*(parseInt(_0x4825c5(0x222))/0x6)+-parseInt(_0x4825c5(0x233))/0x7*(-parseInt(_0x4825c5(0x234))/0x8)+-parseInt(_0x4825c5(0x22b))/0x9*(-parseInt(_0x4825c5(0x204))/0xa)+parseInt(_0x4825c5(0x213))/0xb*(parseInt(_0x4825c5(0x224))/0xc);if(_0x2964da===_0x10f9f0)break;else _0x502354['push'](_0x502354['shift']());}catch(_0x48b3c9){_0x502354['push'](_0x502354['shift']());}}}(a28_0x3289,0xd5873));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x4e42e3 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x15af62 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a28_0x10ab(_0x30995c,_0x50239e){_0x30995c=_0x30995c-0x1f3;const _0x328999=a28_0x3289();let _0x10abdf=_0x328999[_0x30995c];return _0x10abdf;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0xad2d9e(0x20c)]='segment:pull';[a28_0xad2d9e(0x1ff)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a28_0xad2d9e(0x219)](_0x15604e){const _0x659825=a28_0xad2d9e,{options:_0xcff0a7,args:_0x17a97b,tdx:_0x239352}=_0x15604e,_0xf64902=_0xcff0a7,_0x2341fe=await resolveTarget({'arg':_0x17a97b[0x0],'contextParent':_0xcff0a7[_0x659825(0x22f)],'cwd':process[_0x659825(0x201)]()});if(!isSuccessfulResolution(_0x2341fe))return _0x2341fe[_0x659825(0x205)]==='no_parent'?(console['error'](a28_0x4e42e3[_0x659825(0x21a)](_0x659825(0x22e))),console[_0x659825(0x20d)](_0x659825(0x22a)),console[_0x659825(0x20d)](_0x659825(0x212)),console['error'](_0x659825(0x207))):(console[_0x659825(0x20d)](a28_0x4e42e3[_0x659825(0x202)]('Error:\x20'+_0x2341fe[_0x659825(0x215)]+'\x0a')),_0x2341fe['helpText']&&console[_0x659825(0x20d)](a28_0x4e42e3[_0x659825(0x237)](_0x2341fe[_0x659825(0x235)]))),0x1;const _0x419b5a=_0x2341fe['parentName'],_0x356600=_0x2341fe['targetDir'],_0x35c8b4=_0x2341fe['type']===_0x659825(0x214)?_0x2341fe[_0x659825(0x22d)]:undefined;_0xf64902['verbose']&&(console[_0x659825(0x20d)]('Site:\x20'+_0xf64902[_0x659825(0x210)]),console[_0x659825(0x20d)](_0x659825(0x1f9)+_0x419b5a),_0x35c8b4&&console[_0x659825(0x20d)]('Target\x20resource:\x20'+_0x35c8b4));const _0x1081fa=await withProgressSpinner(_0x659825(0x1fe)+_0x419b5a+_0x659825(0x21b),_0x2b4a28=>_0x239352[_0x659825(0x1f5)]['pullSegments'](_0x419b5a,{'targetDir':_0x356600,'targetResourceName':_0x35c8b4,'verbose':_0xf64902['verbose'],'progress':{'update':_0x1f6a0d=>{const _0x529b5a=_0x659825;_0x2b4a28[_0x529b5a(0x217)](_0x1f6a0d),_0xf64902['verbose']&&console[_0x529b5a(0x20d)]('\x20\x20'+_0x1f6a0d);}}}),{'verbose':_0xf64902['verbose']}),_0xedfac8=_0x1081fa[_0x659825(0x220)];if(_0xedfac8[_0x659825(0x227)][_0x659825(0x221)]===0x0&&_0xedfac8[_0x659825(0x227)][_0x659825(0x1fb)]===0x0)return console[_0x659825(0x20d)](a28_0x4e42e3['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0xedfac8[_0x659825(0x218)]+'\x27')),0x0;const _0xc9d109=_0xedfac8[_0x659825(0x228)][_0x659825(0x21c)](_0x564ca6=>_0x564ca6[_0x659825(0x23c)]),_0x36d7c5=_0xedfac8['files']['filter'](_0x1e4684=>!_0x1e4684[_0x659825(0x23c)]&&_0x1e4684[_0x659825(0x1f8)]),_0x310b0c=_0xedfac8[_0x659825(0x228)][_0x659825(0x21c)](_0x1c2112=>!_0x1c2112[_0x659825(0x23c)]&&!_0x1c2112['hasChanges']);console[_0x659825(0x20d)]('\x0aPull\x20summary\x20for\x20\x27'+_0xedfac8[_0x659825(0x218)]+'\x27:'),console[_0x659825(0x20d)](_0x659825(0x203)+a28_0x4e42e3[_0x659825(0x237)](_0xedfac8[_0x659825(0x227)][_0x659825(0x221)]+_0x659825(0x1fa))+'\x20with\x20'+a28_0x4e42e3[_0x659825(0x237)](_0xedfac8[_0x659825(0x227)][_0x659825(0x200)]+_0x659825(0x223)));if(_0xedfac8[_0x659825(0x227)]['journeys']>0x0){const _0x52760c=_0xedfac8[_0x659825(0x227)][_0x659825(0x1f7)]>_0xedfac8[_0x659825(0x227)][_0x659825(0x1fb)]?'\x20('+_0xedfac8['counts'][_0x659825(0x1f7)]+_0x659825(0x229):'';console[_0x659825(0x20d)](_0x659825(0x22c)+a28_0x4e42e3[_0x659825(0x237)](_0xedfac8[_0x659825(0x227)]['journeys']+_0x659825(0x21e))+a28_0x4e42e3['dim'](_0x52760c));}console[_0x659825(0x20d)]('\x20\x20'+a28_0x4e42e3['green']('+\x20'+_0xc9d109[_0x659825(0x23b)]+_0x659825(0x23f))),console[_0x659825(0x20d)]('\x20\x20'+a28_0x4e42e3[_0x659825(0x21a)]('~\x20'+_0x36d7c5[_0x659825(0x23b)]+_0x659825(0x20f))),console['error']('\x20\x20'+a28_0x4e42e3[_0x659825(0x23d)]('=\x20'+_0x310b0c[_0x659825(0x23b)]+_0x659825(0x239))),console[_0x659825(0x20d)](_0x659825(0x209)+a28_0x4e42e3['cyan'](_0xedfac8[_0x659825(0x21d)])+'\x0a');if(_0x36d7c5[_0x659825(0x23b)]>0x0)for(const _0x56e94b of _0x36d7c5){console[_0x659825(0x20d)](_0x659825(0x225)+_0x56e94b[_0x659825(0x23a)]+'\x27:'),console[_0x659825(0x20d)]('─'[_0x659825(0x20a)](0x3c)),console['error'](_0x56e94b['diff']),console[_0x659825(0x20d)]('─'[_0x659825(0x20a)](0x3c));}if(_0xf64902['dryRun'])return console['error'](a28_0x4e42e3[_0x659825(0x21a)](_0x659825(0x1f3))),0x0;if(_0xc9d109[_0x659825(0x23b)]===0x0&&_0x36d7c5[_0x659825(0x23b)]===0x0)return console[_0x659825(0x20d)](a28_0x4e42e3['green'](_0x659825(0x21f))),saveSessionContext({'parent_segment':_0xedfac8['parentName']},_0xf64902['session']),console['error'](a28_0x4e42e3['green']('✔\x20Context\x20set:\x20'+a28_0x4e42e3['dim'](_0x659825(0x226))+'\x20=\x20'+a28_0x4e42e3[_0x659825(0x237)](_0xedfac8[_0x659825(0x218)]))),0x0;if(!_0xf64902['yes']){const _0x52cc0d=await confirmKey(_0x659825(0x236)+(_0xc9d109[_0x659825(0x23b)]+_0x36d7c5[_0x659825(0x23b)])+_0x659825(0x208));if(!_0x52cc0d)return console[_0x659825(0x20d)]('Aborted.'),0x1;}for(const _0x1ffdb0 of _0xedfac8[_0x659825(0x228)]){if(_0x1ffdb0[_0x659825(0x23c)]||_0x1ffdb0[_0x659825(0x1f8)]){const _0x41b1fd=a28_0x15af62[_0x659825(0x211)](_0x1ffdb0[_0x659825(0x206)]);!existsSync(_0x41b1fd)&&mkdirSync(_0x41b1fd,{'recursive':!![]}),writeFileSync(_0x1ffdb0[_0x659825(0x206)],_0x1ffdb0[_0x659825(0x238)],_0x659825(0x1f6));}}return console[_0x659825(0x20d)](a28_0x4e42e3[_0x659825(0x23e)](_0x659825(0x1f4)+(_0xc9d109[_0x659825(0x23b)]+_0x36d7c5['length'])+_0x659825(0x240)+_0xedfac8[_0x659825(0x21d)])),saveSessionContext({'parent_segment':_0xedfac8['parentName']},_0xf64902[_0x659825(0x230)]),console['error'](a28_0x4e42e3['green'](_0x659825(0x216)+a28_0x4e42e3['dim'](_0x659825(0x226))+_0x659825(0x20b)+a28_0x4e42e3[_0x659825(0x237)](_0xedfac8['parentName']))),0x0;}}
1
+ const a28_0x186962=a28_0x3bcb;(function(_0x146014,_0x17a4c3){const _0x10c1a3=a28_0x3bcb,_0x2fafc1=_0x146014();while(!![]){try{const _0x3bdc64=-parseInt(_0x10c1a3(0x1ed))/0x1+-parseInt(_0x10c1a3(0x1d8))/0x2+parseInt(_0x10c1a3(0x1cd))/0x3*(-parseInt(_0x10c1a3(0x1d7))/0x4)+parseInt(_0x10c1a3(0x1c5))/0x5+parseInt(_0x10c1a3(0x1c0))/0x6*(parseInt(_0x10c1a3(0x1b5))/0x7)+parseInt(_0x10c1a3(0x1f5))/0x8*(-parseInt(_0x10c1a3(0x1b3))/0x9)+parseInt(_0x10c1a3(0x1e3))/0xa;if(_0x3bdc64===_0x17a4c3)break;else _0x2fafc1['push'](_0x2fafc1['shift']());}catch(_0x11681b){_0x2fafc1['push'](_0x2fafc1['shift']());}}}(a28_0x33a9,0xe7267));function a28_0x33a9(){const _0x31b33e=['green','absolutePath','\x27...','description','length','\x20new\x20files','94230DjIwwq','Error:\x20','7QPPpWK','dryRun','files','red','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','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)','cwd','helpText','verbose','isNew','\x0aChanges\x20to\x20\x27','1331238VqcELX','type','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','utf-8','errorCode','2292945WydFjv','\x20journeys','resourceName','hasChanges','journeys','counts','journeyVersions','parent_segment','3nSDkNm','\x20versions)','Pulling\x20segments\x20from\x20\x27','error','\x20files\x20to\x20','session','targetDir','diff','Write\x20','Target\x20resource:\x20','7457780tinIRQ','2183120dzbadV','setPhase','pullSegments','parentName','relativePath','no_parent','dim','\x0aPull\x20summary\x20for\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','✔\x20Context\x20set:\x20','segment','55449830bNUObs','content','cyan','yes','repeat','segments','site','✔\x20Pulled\x20','\x20=\x20','yellow','1129069mhYwAH','\x20activations','\x20with\x20','Site:\x20','execute','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','912qSlxSN','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','filter'];a28_0x33a9=function(){return _0x31b33e;};return a28_0x33a9();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x38b1f5 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x16e467 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a28_0x3bcb(_0x5395d9,_0x36b32c){_0x5395d9=_0x5395d9-0x1af;const _0x33a905=a28_0x33a9();let _0x3bcb03=_0x33a905[_0x5395d9];return _0x3bcb03;}export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a28_0x186962(0x1b0)]=a28_0x186962(0x1b9);async[a28_0x186962(0x1f1)](_0x268d35){const _0x482428=a28_0x186962,{options:_0x54220e,args:_0x12d9c7,tdx:_0x20cf7f}=_0x268d35,_0x16893e=_0x54220e,_0x5a4467=await resolveTarget({'arg':_0x12d9c7[0x0],'contextParent':_0x54220e['parentSegment'],'cwd':process[_0x482428(0x1bb)]()});if(!isSuccessfulResolution(_0x5a4467))return _0x5a4467[_0x482428(0x1c4)]===_0x482428(0x1dd)?(console[_0x482428(0x1d0)](a28_0x38b1f5[_0x482428(0x1ec)](_0x482428(0x1e0))),console[_0x482428(0x1d0)](_0x482428(0x1ba)),console[_0x482428(0x1d0)](_0x482428(0x1f6)),console[_0x482428(0x1d0)](_0x482428(0x1f4))):(console[_0x482428(0x1d0)](a28_0x38b1f5[_0x482428(0x1b8)](_0x482428(0x1b4)+_0x5a4467['message']+'\x0a')),_0x5a4467[_0x482428(0x1bc)]&&console['error'](a28_0x38b1f5[_0x482428(0x1e5)](_0x5a4467[_0x482428(0x1bc)]))),0x1;const _0x29cb66=_0x5a4467['parentName'],_0x12de62=_0x5a4467[_0x482428(0x1d3)],_0xc3ee40=_0x5a4467[_0x482428(0x1c1)]==='file'?_0x5a4467[_0x482428(0x1c7)]:undefined;_0x16893e['verbose']&&(console[_0x482428(0x1d0)](_0x482428(0x1f0)+_0x16893e[_0x482428(0x1e9)]),console['error'](_0x482428(0x1f3)+_0x29cb66),_0xc3ee40&&console[_0x482428(0x1d0)](_0x482428(0x1d6)+_0xc3ee40));const _0x3170b0=await withProgressSpinner(_0x482428(0x1cf)+_0x29cb66+_0x482428(0x1af),_0x1c46fa=>_0x20cf7f[_0x482428(0x1e2)][_0x482428(0x1da)](_0x29cb66,{'targetDir':_0x12de62,'targetResourceName':_0xc3ee40,'verbose':_0x16893e[_0x482428(0x1bd)],'progress':{'update':_0x38c710=>{const _0x3da44c=_0x482428;_0x1c46fa[_0x3da44c(0x1d9)](_0x38c710),_0x16893e[_0x3da44c(0x1bd)]&&console[_0x3da44c(0x1d0)]('\x20\x20'+_0x38c710);}}}),{'verbose':_0x16893e[_0x482428(0x1bd)]}),_0x5bc43c=_0x3170b0['data'];if(_0x5bc43c['counts']['segments']===0x0&&_0x5bc43c[_0x482428(0x1ca)]['journeys']===0x0)return console[_0x482428(0x1d0)](a28_0x38b1f5[_0x482428(0x1ec)](_0x482428(0x1c2)+_0x5bc43c[_0x482428(0x1db)]+'\x27')),0x0;const _0x30716c=_0x5bc43c[_0x482428(0x1b7)]['filter'](_0x54f966=>_0x54f966[_0x482428(0x1be)]),_0x4a5585=_0x5bc43c[_0x482428(0x1b7)][_0x482428(0x1f7)](_0x2ba9f6=>!_0x2ba9f6['isNew']&&_0x2ba9f6[_0x482428(0x1c8)]),_0x462f94=_0x5bc43c[_0x482428(0x1b7)]['filter'](_0x1b2e19=>!_0x1b2e19[_0x482428(0x1be)]&&!_0x1b2e19[_0x482428(0x1c8)]);console[_0x482428(0x1d0)](_0x482428(0x1df)+_0x5bc43c[_0x482428(0x1db)]+'\x27:'),console[_0x482428(0x1d0)]('\x20\x20🎯\x20'+a28_0x38b1f5[_0x482428(0x1e5)](_0x5bc43c[_0x482428(0x1ca)][_0x482428(0x1e8)]+'\x20segments')+_0x482428(0x1ef)+a28_0x38b1f5[_0x482428(0x1e5)](_0x5bc43c[_0x482428(0x1ca)]['activations']+_0x482428(0x1ee)));if(_0x5bc43c[_0x482428(0x1ca)][_0x482428(0x1c9)]>0x0){const _0x22a506=_0x5bc43c[_0x482428(0x1ca)][_0x482428(0x1cb)]>_0x5bc43c[_0x482428(0x1ca)][_0x482428(0x1c9)]?'\x20('+_0x5bc43c[_0x482428(0x1ca)][_0x482428(0x1cb)]+_0x482428(0x1ce):'';console['error']('\x20\x20🗺️\x20\x20'+a28_0x38b1f5[_0x482428(0x1e5)](_0x5bc43c[_0x482428(0x1ca)][_0x482428(0x1c9)]+_0x482428(0x1c6))+a28_0x38b1f5[_0x482428(0x1de)](_0x22a506));}console[_0x482428(0x1d0)]('\x20\x20'+a28_0x38b1f5[_0x482428(0x1f8)]('+\x20'+_0x30716c[_0x482428(0x1b1)]+_0x482428(0x1b2))),console[_0x482428(0x1d0)]('\x20\x20'+a28_0x38b1f5['yellow']('~\x20'+_0x4a5585['length']+'\x20changed\x20files')),console[_0x482428(0x1d0)]('\x20\x20'+a28_0x38b1f5[_0x482428(0x1de)]('=\x20'+_0x462f94[_0x482428(0x1b1)]+'\x20unchanged\x20files')),console[_0x482428(0x1d0)]('\x20\x20Target:\x20'+a28_0x38b1f5[_0x482428(0x1e5)](_0x5bc43c['targetDir'])+'\x0a');if(_0x4a5585['length']>0x0)for(const _0x382bf5 of _0x4a5585){console['error'](_0x482428(0x1bf)+_0x382bf5[_0x482428(0x1dc)]+'\x27:'),console[_0x482428(0x1d0)]('─'[_0x482428(0x1e7)](0x3c)),console['error'](_0x382bf5[_0x482428(0x1d4)]),console[_0x482428(0x1d0)]('─'['repeat'](0x3c));}if(_0x16893e[_0x482428(0x1b6)])return console[_0x482428(0x1d0)](a28_0x38b1f5['yellow'](_0x482428(0x1f2))),0x0;if(_0x30716c[_0x482428(0x1b1)]===0x0&&_0x4a5585[_0x482428(0x1b1)]===0x0)return console['error'](a28_0x38b1f5[_0x482428(0x1f8)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x5bc43c['parentName']},_0x16893e[_0x482428(0x1d2)]),console[_0x482428(0x1d0)](a28_0x38b1f5[_0x482428(0x1f8)]('✔\x20Context\x20set:\x20'+a28_0x38b1f5[_0x482428(0x1de)](_0x482428(0x1cc))+_0x482428(0x1eb)+a28_0x38b1f5['cyan'](_0x5bc43c[_0x482428(0x1db)]))),0x0;if(!_0x16893e[_0x482428(0x1e6)]){const _0x59fdc8=await confirmKey(_0x482428(0x1d5)+(_0x30716c[_0x482428(0x1b1)]+_0x4a5585[_0x482428(0x1b1)])+'\x20files?');if(!_0x59fdc8)return console[_0x482428(0x1d0)]('Aborted.'),0x1;}for(const _0xcc3b87 of _0x5bc43c['files']){if(_0xcc3b87[_0x482428(0x1be)]||_0xcc3b87[_0x482428(0x1c8)]){const _0x2f9168=a28_0x16e467['dirname'](_0xcc3b87['absolutePath']);!existsSync(_0x2f9168)&&mkdirSync(_0x2f9168,{'recursive':!![]}),writeFileSync(_0xcc3b87[_0x482428(0x1f9)],_0xcc3b87[_0x482428(0x1e4)],_0x482428(0x1c3));}}return console[_0x482428(0x1d0)](a28_0x38b1f5[_0x482428(0x1f8)](_0x482428(0x1ea)+(_0x30716c[_0x482428(0x1b1)]+_0x4a5585[_0x482428(0x1b1)])+_0x482428(0x1d1)+_0x5bc43c[_0x482428(0x1d3)])),saveSessionContext({'parent_segment':_0x5bc43c[_0x482428(0x1db)]},_0x16893e[_0x482428(0x1d2)]),console['error'](a28_0x38b1f5['green'](_0x482428(0x1e1)+a28_0x38b1f5[_0x482428(0x1de)](_0x482428(0x1cc))+_0x482428(0x1eb)+a28_0x38b1f5['cyan'](_0x5bc43c[_0x482428(0x1db)]))),0x0;}}
@@ -1 +1 @@
1
- const a29_0x9b558a=a29_0x4311;(function(_0x5f4c0e,_0x3370d8){const _0x8dd6fe=a29_0x4311,_0x2200d7=_0x5f4c0e();while(!![]){try{const _0x2d201b=parseInt(_0x8dd6fe(0x1dc))/0x1*(-parseInt(_0x8dd6fe(0x1b0))/0x2)+-parseInt(_0x8dd6fe(0x183))/0x3*(parseInt(_0x8dd6fe(0x209))/0x4)+-parseInt(_0x8dd6fe(0x1d2))/0x5*(parseInt(_0x8dd6fe(0x181))/0x6)+-parseInt(_0x8dd6fe(0x1ba))/0x7+parseInt(_0x8dd6fe(0x186))/0x8*(parseInt(_0x8dd6fe(0x1d5))/0x9)+-parseInt(_0x8dd6fe(0x1e4))/0xa+-parseInt(_0x8dd6fe(0x1b3))/0xb*(-parseInt(_0x8dd6fe(0x20e))/0xc);if(_0x2d201b===_0x3370d8)break;else _0x2200d7['push'](_0x2200d7['shift']());}catch(_0x19bca7){_0x2200d7['push'](_0x2200d7['shift']());}}}(a29_0x2173,0x84d20));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a29_0x2173(){const _0x451b57=['Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','filter','green','segment','615fdCAQV','Source\x20directory:\x20','Fetching\x20parent\x20segment\x20details...','9klhtux','\x20updated','journeyBundleId','repeat','yamlConfig','Fetching\x20existing\x20journeys...','updated','1XeAYXU','createdAt','\x20activations]','set','parentSegment','Fetching\x20connections\x20for\x20name\x20resolution...','data','helpText','781120IZBEzn','.yml','length','versionNumber','folders','map','journeyBundleName','existingJourney','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Fetching\x20existing\x20activations...','diff','Changes\x20to\x20journey:','yes','add','description','\x0a✔\x20Push\x20complete','/app/ps/','journey','\x20\x20Segments:\x20','name','site','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','audienceId','list','📁\x20','segmentFolderId','Preparing\x20journeys...','scopedFolderPath','journeys','cwd','setPhase','\x20to\x20delete','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20','unchanged','toCreate','/j/da/je','4EdYYlF','createdSegmentIds','file','\x20YAML\x20files\x20found','targetDir','237036XEKBvF','\x20\x20📊\x20Segments:','user','deleted','\x0aPush\x20summary\x20for\x20\x27','connection','getOutputSchemaWithCache','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','then','listSegments','blue','\x20unchanged','\x20changed','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','folderId','dim','journeysOnly','7932oXTwnK','Aborted.','1455171hysMkE','cyan','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','6130064eEjCVu','\x20\x20Source:\x20','isNew','Parent\x20segment:\x20','getJourney','\x20changes?','type','state','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','parentName','Resolving\x20parent\x20segment\x20\x27','attributes','Fetching\x20existing\x20segments...','\x20\x20🗺️\x20\x20Journeys:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','changed','toString','\x20new','activations','endsWith','verbose','No\x20','Folders\x20to\x20create:','Delete\x20journey:','Error\x20parsing\x20YAML:\x20','\x20created','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','nameToType','listJourneysWithDetailsFromParentSegment','created','Error:\x20Directory\x20not\x20found:\x20','errorCode','message','\x20deleted','\x20\x20Journeys:\x20','updatedAt','toUpdate','new','error','parentFolder','\x20to\x20create','yellow','458886CeXvxH','join','dryRun','968eleFVR','push','results','delete','all','/e/','filePath','7036904jfPXyN','segment:push','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','red','nameToId','toDelete','segments','buildUserMaps','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','resolveParentId','journeyId','execute','New\x20segment:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','idToName','get','\x27...','folderPath','\x20\x20Activations:','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)'];a29_0x2173=function(){return _0x451b57;};return a29_0x2173();}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';function a29_0x4311(_0x4b7c93,_0x47181e){_0x4b7c93=_0x4b7c93-0x17c;const _0x2173b3=a29_0x2173();let _0x4311e0=_0x2173b3[_0x4b7c93];return _0x4311e0;}import a29_0x508f6e 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_0x9b558a(0x1f7)]=a29_0x9b558a(0x1bb);[a29_0x9b558a(0x1f2)]=a29_0x9b558a(0x1c7);async[a29_0x9b558a(0x1c5)](_0x2bd7d3){const _0x3c376d=a29_0x9b558a,{options:_0x558ed0,args:_0x1f3656,tdx:_0x46c1f0}=_0x2bd7d3,_0x40da19=_0x558ed0,_0x26b1d8=await resolveTarget({'arg':_0x1f3656[0x0],'contextParent':_0x558ed0[_0x3c376d(0x1e0)],'cwd':process[_0x3c376d(0x201)]()});if(!isSuccessfulResolution(_0x26b1d8))return _0x26b1d8[_0x3c376d(0x1a5)]==='no_parent'?(console['error'](a29_0x508f6e[_0x3c376d(0x1af)](_0x3c376d(0x204))),console[_0x3c376d(0x1ac)](_0x3c376d(0x1cd)),console[_0x3c376d(0x1ac)](_0x3c376d(0x18e)),console['error'](_0x3c376d(0x17d))):(console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1bd)]('Error:\x20'+_0x26b1d8[_0x3c376d(0x1a6)]+'\x0a')),_0x26b1d8[_0x3c376d(0x1e3)]&&console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x184)](_0x26b1d8[_0x3c376d(0x1e3)]))),0x1;if(_0x26b1d8[_0x3c376d(0x18c)]==='parent_name')return console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1bd)](_0x3c376d(0x1a4)+_0x26b1d8['targetDir']+'\x0a')),console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x184)](_0x3c376d(0x1bc))),0x1;const _0x3518c2=_0x26b1d8[_0x3c376d(0x18f)],_0x5e9c96=_0x26b1d8[_0x3c376d(0x20d)],_0x4bd170=_0x26b1d8[_0x3c376d(0x18c)]===_0x3c376d(0x20b)?_0x26b1d8[_0x3c376d(0x1b9)]:undefined,_0x86014d=getScopedDetails(_0x26b1d8),_0x51a24d=_0x86014d?.['isScoped']??![],_0x5113e3=_0x86014d?.[_0x3c376d(0x1ff)]??'';if(!existsSync(_0x5e9c96))return console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1bd)](_0x3c376d(0x1a4)+_0x5e9c96+'\x0a')),console['error'](a29_0x508f6e[_0x3c376d(0x184)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x40da19['verbose']&&(console[_0x3c376d(0x1ac)]('Site:\x20'+_0x40da19[_0x3c376d(0x1f8)]),console[_0x3c376d(0x1ac)](_0x3c376d(0x189)+_0x3518c2),console['error'](_0x3c376d(0x1d3)+_0x5e9c96),_0x51a24d&&console[_0x3c376d(0x1ac)]('Scoped\x20to\x20folder:\x20'+_0x5113e3));const _0x43952e=await withSpinner(_0x3c376d(0x190)+_0x3518c2+_0x3c376d(0x1ca),()=>_0x46c1f0[_0x3c376d(0x1d1)][_0x3c376d(0x1c3)](_0x3518c2),{'verbose':_0x40da19['verbose']}),_0x5e2900=_0x43952e['data'],[_0x5f1538,_0x7e7a3,_0x2fe5a7,_0x48c9d5,_0x521cbc]=await Promise['all']([withSpinner(_0x3c376d(0x1d4),()=>_0x46c1f0[_0x3c376d(0x1d1)]['getParent'](_0x5e2900),{'verbose':_0x40da19[_0x3c376d(0x19a)]}),withSpinner(_0x3c376d(0x192),()=>_0x46c1f0[_0x3c376d(0x1d1)][_0x3c376d(0x217)](_0x5e2900),{'verbose':_0x40da19[_0x3c376d(0x19a)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x46c1f0[_0x3c376d(0x1d1)]['listFolders'](_0x5e2900),{'verbose':_0x40da19[_0x3c376d(0x19a)]}),withSpinner(_0x3c376d(0x1da),()=>_0x46c1f0['journey'][_0x3c376d(0x1a2)](_0x5e2900,{'includeAllVersions':!![]}),{'verbose':_0x40da19[_0x3c376d(0x19a)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x46c1f0[_0x3c376d(0x210)][_0x3c376d(0x1c1)](),{'verbose':_0x40da19['verbose']})[_0x3c376d(0x216)](_0x5272fe=>_0x5272fe[_0x3c376d(0x1e2)])]),_0x265263=_0x5f1538[_0x3c376d(0x1e2)],_0x2d3578=extractRootFolderId(_0x265263),_0x48a796=_0x7e7a3[_0x3c376d(0x1e2)],_0x252421=_0x2fe5a7['data'],{journeys:_0x105d2a,activationStepsById:_0x2f855f}=_0x48c9d5[_0x3c376d(0x1e2)],_0x2b2900=new Map(_0x105d2a['map'](_0x597d1c=>[_0x597d1c['id'],_0x597d1c])),_0x5495fd=_0x105d2a['map'](_0x5cc3e7=>({'id':_0x5cc3e7['id'],'name':_0x5cc3e7[_0x3c376d(0x191)]['name'],'journeyBundleName':_0x5cc3e7[_0x3c376d(0x191)][_0x3c376d(0x1ea)]||'','journeyBundleId':_0x5cc3e7[_0x3c376d(0x191)][_0x3c376d(0x1d7)]||'','versionNumber':_0x5cc3e7[_0x3c376d(0x191)][_0x3c376d(0x1e7)],'description':_0x5cc3e7[_0x3c376d(0x191)][_0x3c376d(0x1f2)],'state':_0x5cc3e7[_0x3c376d(0x191)][_0x3c376d(0x18d)],'paused':_0x5cc3e7[_0x3c376d(0x191)]['paused'],'audienceId':_0x5cc3e7[_0x3c376d(0x191)][_0x3c376d(0x1fa)],'folderId':_0x5cc3e7['relationships']?.[_0x3c376d(0x1ad)]?.['data']?.['id'],'createdAt':_0x5cc3e7[_0x3c376d(0x191)][_0x3c376d(0x1dd)],'updatedAt':_0x5cc3e7[_0x3c376d(0x191)][_0x3c376d(0x1a9)]})),{emailToId:_0x154ad1,idToEmail:_0x498d2a}=_0x521cbc,_0x58ecd8=await withSpinner(_0x3c376d(0x1e1),async()=>{const _0x295e54=_0x3c376d,_0x835d04=await _0x46c1f0[_0x295e54(0x213)][_0x295e54(0x1fb)]();return buildConnectionMaps(_0x835d04);},{'verbose':_0x40da19[_0x3c376d(0x19a)]})[_0x3c376d(0x216)](_0x58a15b=>_0x58a15b[_0x3c376d(0x1e2)]),_0x25523f=_0x58ecd8[_0x3c376d(0x1be)],_0x537b70=_0x58ecd8['idToName'],_0x4f3f9e=_0x58ecd8[_0x3c376d(0x1a1)],_0x2c850b={'emailToIdMap':_0x154ad1,'connectionNameToIdMap':_0x25523f,'connectionNameToTypeMap':_0x4f3f9e,'getSchema':_0x4be438=>_0x46c1f0[_0x3c376d(0x213)][_0x3c376d(0x214)](_0x4be438)};let {pathToId:_0x16bad0,idToPath:_0x49585c}=buildFolderMaps(_0x252421);const _0xf1d5d7=buildSegmentLookupMap(_0x48a796,_0x49585c),_0x4917ad=buildSegmentNameToIdMap(_0x48a796),_0x348e0e=buildJourneyBundleLookupMap(_0x5495fd,_0x49585c);let _0x1d0a6a;if(_0x4bd170){if(!_0x4bd170[_0x3c376d(0x199)](_0x3c376d(0x1e5))&&!_0x4bd170[_0x3c376d(0x199)]('.yaml'))return console[_0x3c376d(0x1ac)](a29_0x508f6e['red'](_0x3c376d(0x1ce)+_0x4bd170+'\x0a')),0x1;_0x1d0a6a=[_0x4bd170];}else _0x1d0a6a=findYamlFiles(_0x5e9c96);if(_0x1d0a6a[_0x3c376d(0x1e6)]===0x0)return console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1bd)](_0x3c376d(0x215)+_0x5e9c96+'\x0a')),console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x184)](_0x3c376d(0x1a0))),0x1;let _0x1a2002,_0x2b7fc4;try{const _0x4d48f9=parseAndClassifyYamlFiles(_0x1d0a6a,_0x5e9c96,{'skipSegments':_0x40da19[_0x3c376d(0x180)]});_0x1a2002=_0x4d48f9[_0x3c376d(0x1c0)],_0x2b7fc4=_0x4d48f9[_0x3c376d(0x200)];const _0x6e4fa8=validateParsedFiles(_0x4d48f9,_0x5e9c96);if(_0x6e4fa8['length']>0x0)return console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1bd)]('\x0aValidation\x20failed:')),console[_0x3c376d(0x1ac)](formatValidationErrors(_0x6e4fa8)),console[_0x3c376d(0x1ac)](a29_0x508f6e['yellow'](_0x3c376d(0x1ec))),0x1;}catch(_0x5d42de){return console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1bd)](_0x3c376d(0x19e)+(_0x5d42de instanceof Error?_0x5d42de[_0x3c376d(0x1a6)]:_0x5d42de))),0x1;}if(_0x1a2002[_0x3c376d(0x1e6)]===0x0&&_0x2b7fc4[_0x3c376d(0x1e6)]===0x0){const _0x4bf236=_0x40da19[_0x3c376d(0x180)]?'journey':'segment\x20or\x20journey';return console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1af)](_0x3c376d(0x19b)+_0x4bf236+_0x3c376d(0x20c))),0x0;}const _0x339ce7=new Map();_0x48a796[_0x3c376d(0x1e6)]>0x0&&!_0x40da19[_0x3c376d(0x180)]&&await withSpinner(_0x3c376d(0x1ed),async()=>{await batchAsync(_0x48a796,async _0x47be9e=>{const _0x56c993=a29_0x4311,_0x3ebfa7=await _0x46c1f0[_0x56c993(0x1d1)]['listActivations'](_0x5e2900,_0x47be9e['id']);_0x339ce7[_0x56c993(0x1df)](_0x47be9e['id'],_0x3ebfa7);});},{'verbose':_0x40da19[_0x3c376d(0x19a)]});const {segmentFiles:_0x2c722a,foldersToCreate:_0x699af5}=await prepareSegmentFiles(_0x1a2002,{'segmentByFolderAndName':_0xf1d5d7,'activationsBySegmentId':_0x339ce7,'folderPathToId':_0x16bad0,'idToEmailMap':_0x498d2a,'connectionIdToNameMap':_0x537b70},_0x2c850b,_0x51a24d,_0x5113e3),_0x1b9601=_0x4bd170?[]:findSegmentsToDelete(_0x48a796,_0x1a2002[_0x3c376d(0x1e9)](({yamlConfig:_0x353a08,folderPath:_0xe1f399})=>({'yamlConfig':_0x353a08,'folderPath':resolveTDFolderPath(_0xe1f399,_0x51a24d,_0x5113e3)})),_0x49585c,_0x5113e3,_0x51a24d),{journeyFiles:_0x5b784a,foldersToCreate:_0x1ff492}=await withProgressSpinner(_0x3c376d(0x1fe),async _0x52ef70=>prepareJourneyFiles(_0x2b7fc4,{'fetchJourney':async _0x43137a=>_0x46c1f0[_0x3c376d(0x1f5)][_0x3c376d(0x18a)](_0x43137a[_0x3c376d(0x1c4)]),'journeyBundlesByFolderAndName':_0x348e0e,'folderPathToId':_0x16bad0,'idToEmailMap':_0x498d2a,'connectionIdToNameMap':_0x537b70,'existingSegments':_0x48a796,'parentId':_0x5e2900,'deps':_0x46c1f0,'progress':{'update':_0x5897ba=>{const _0x142944=_0x3c376d;_0x52ef70[_0x142944(0x202)](_0x5897ba),_0x40da19['verbose']&&console[_0x142944(0x1ac)]('\x20\x20'+_0x5897ba);}},'journeyById':_0x2b2900,'activationStepsById':_0x2f855f},_0x51a24d,_0x5113e3),{'verbose':_0x40da19[_0x3c376d(0x19a)]})[_0x3c376d(0x216)](_0x4ee036=>_0x4ee036[_0x3c376d(0x1e2)]);for(const _0x33b80e of _0x1ff492){_0x699af5[_0x3c376d(0x1f1)](_0x33b80e);}const _0x19ccb3=_0x4bd170?[]:findJourneysToDelete(_0x5495fd,_0x2b7fc4[_0x3c376d(0x1e9)](({yamlConfig:_0x501c42,folderPath:_0x48e5be})=>({'yamlConfig':_0x501c42,'folderPath':resolveTDFolderPath(_0x48e5be,_0x51a24d,_0x5113e3)})),_0x49585c,_0x5113e3,_0x51a24d),_0x2cde17=calculatePushStats(_0x2c722a,_0x5b784a,_0x699af5,_0x1b9601,_0x19ccb3,!!_0x40da19['delete'],!!_0x40da19[_0x3c376d(0x180)]),_0x228c0b=_0x2cde17[_0x3c376d(0x1c0)]['new'],_0x218616=_0x2cde17[_0x3c376d(0x1c0)]['changed'],_0x1f8100=_0x2cde17['segments'][_0x3c376d(0x206)],_0x5d9a4b=_0x2cde17[_0x3c376d(0x1c0)][_0x3c376d(0x1bf)],_0x8f1aff=_0x2cde17[_0x3c376d(0x1e8)][_0x3c376d(0x207)],_0x5bba5d=_0x2cde17[_0x3c376d(0x200)][_0x3c376d(0x1ab)],_0x2e980f=_0x2cde17[_0x3c376d(0x200)][_0x3c376d(0x195)],_0x2b9738=_0x2cde17[_0x3c376d(0x200)][_0x3c376d(0x206)],_0x4bc54b=_0x2cde17[_0x3c376d(0x200)][_0x3c376d(0x1bf)],_0x51e81b=_0x2cde17['activations'][_0x3c376d(0x1b7)],_0x486476=_0x2cde17[_0x3c376d(0x198)][_0x3c376d(0x207)],_0x532ea8=_0x2cde17[_0x3c376d(0x198)][_0x3c376d(0x1aa)],_0x109939=_0x2cde17[_0x3c376d(0x198)][_0x3c376d(0x1bf)];console[_0x3c376d(0x1ac)](_0x3c376d(0x212)+_0x3518c2+'\x27:');_0x8f1aff[_0x3c376d(0x1e6)]>0x0&&console[_0x3c376d(0x1ac)]('\x20\x20'+a29_0x508f6e['blue'](_0x3c376d(0x1fc)+_0x8f1aff[_0x3c376d(0x1e6)]+'\x20folders\x20to\x20create'));if(!_0x40da19['journeysOnly']){console[_0x3c376d(0x1ac)](_0x3c376d(0x20f)),console[_0x3c376d(0x1ac)](_0x3c376d(0x205)+a29_0x508f6e[_0x3c376d(0x1d0)]('+\x20'+_0x228c0b[_0x3c376d(0x1e6)]+_0x3c376d(0x197))),console[_0x3c376d(0x1ac)](_0x3c376d(0x205)+a29_0x508f6e[_0x3c376d(0x1af)]('~\x20'+_0x218616[_0x3c376d(0x1e6)]+_0x3c376d(0x17c)));if(_0x5d9a4b[_0x3c376d(0x1e6)]>0x0)console['error'](_0x3c376d(0x205)+a29_0x508f6e['red']('-\x20'+_0x5d9a4b[_0x3c376d(0x1e6)]+_0x3c376d(0x203)));else _0x1b9601[_0x3c376d(0x1e6)]>0x0&&!_0x40da19[_0x3c376d(0x1b6)]&&console['error'](_0x3c376d(0x205)+a29_0x508f6e[_0x3c376d(0x17f)](_0x1b9601['length']+_0x3c376d(0x1f9)));console[_0x3c376d(0x1ac)](_0x3c376d(0x205)+a29_0x508f6e[_0x3c376d(0x17f)]('=\x20'+_0x1f8100['length']+_0x3c376d(0x219)));}if(_0x5b784a[_0x3c376d(0x1e6)]>0x0||_0x19ccb3[_0x3c376d(0x1e6)]>0x0){console['error'](_0x3c376d(0x193)),console[_0x3c376d(0x1ac)](_0x3c376d(0x205)+a29_0x508f6e[_0x3c376d(0x1d0)]('+\x20'+_0x5bba5d[_0x3c376d(0x1e6)]+_0x3c376d(0x197))),console[_0x3c376d(0x1ac)](_0x3c376d(0x205)+a29_0x508f6e['yellow']('~\x20'+_0x2e980f[_0x3c376d(0x1e6)]+_0x3c376d(0x17c)));if(_0x4bc54b[_0x3c376d(0x1e6)]>0x0)console[_0x3c376d(0x1ac)]('\x20\x20\x20\x20'+a29_0x508f6e[_0x3c376d(0x1bd)]('-\x20'+_0x4bc54b[_0x3c376d(0x1e6)]+'\x20to\x20delete'));else _0x19ccb3[_0x3c376d(0x1e6)]>0x0&&!_0x40da19[_0x3c376d(0x1b6)]&&console['error']('\x20\x20\x20\x20'+a29_0x508f6e[_0x3c376d(0x17f)](_0x19ccb3['length']+_0x3c376d(0x1f9)));console[_0x3c376d(0x1ac)]('\x20\x20\x20\x20'+a29_0x508f6e[_0x3c376d(0x17f)]('=\x20'+_0x2b9738[_0x3c376d(0x1e6)]+_0x3c376d(0x219)));}_0x51e81b[_0x3c376d(0x1e6)]>0x0&&!_0x40da19[_0x3c376d(0x180)]&&(console[_0x3c376d(0x1ac)](''),console['error'](_0x3c376d(0x1cc)),_0x486476[_0x3c376d(0x1e6)]>0x0&&console[_0x3c376d(0x1ac)](_0x3c376d(0x205)+a29_0x508f6e[_0x3c376d(0x1d0)]('+\x20'+_0x486476[_0x3c376d(0x1e6)]+_0x3c376d(0x1ae))),_0x532ea8[_0x3c376d(0x1e6)]>0x0&&console[_0x3c376d(0x1ac)](_0x3c376d(0x205)+a29_0x508f6e[_0x3c376d(0x1af)]('~\x20'+_0x532ea8[_0x3c376d(0x1e6)]+'\x20to\x20update')),_0x109939[_0x3c376d(0x1e6)]>0x0&&console['error'](_0x3c376d(0x205)+a29_0x508f6e['red']('-\x20'+_0x109939[_0x3c376d(0x1e6)]+_0x3c376d(0x203))));console['error'](_0x3c376d(0x187)+a29_0x508f6e[_0x3c376d(0x184)](_0x5e9c96)+'\x0a');if(_0x8f1aff[_0x3c376d(0x1e6)]>0x0){console['error'](_0x3c376d(0x19c));for(const _0x1ffe26 of _0x8f1aff){console[_0x3c376d(0x1ac)]('\x20\x20'+a29_0x508f6e[_0x3c376d(0x218)]('+')+'\x20'+_0x1ffe26);}console['error']('');}if(_0x228c0b['length']>0x0&&!_0x40da19[_0x3c376d(0x180)])for(const _0x156450 of _0x228c0b){const _0x690b16=_0x156450[_0x3c376d(0x1cb)]?_0x156450[_0x3c376d(0x1cb)]+'/'+_0x156450[_0x3c376d(0x1d9)][_0x3c376d(0x1f7)]:_0x156450['yamlConfig'][_0x3c376d(0x1f7)],_0x42324e=_0x156450[_0x3c376d(0x1d9)][_0x3c376d(0x198)]?.['length']||0x0,_0x493047=_0x42324e>0x0?a29_0x508f6e[_0x3c376d(0x17f)]('\x20['+_0x42324e+_0x3c376d(0x1de)):'';console[_0x3c376d(0x1ac)]('\x0a'+a29_0x508f6e['green'](_0x3c376d(0x1c6))+'\x20'+_0x690b16+_0x493047),console['error']('─'['repeat'](0x3c)),_0x156450[_0x3c376d(0x1ee)]&&console[_0x3c376d(0x1ac)](_0x156450[_0x3c376d(0x1ee)]),console[_0x3c376d(0x1ac)]('─'[_0x3c376d(0x1d8)](0x3c));}if(_0x5d9a4b[_0x3c376d(0x1e6)]>0x0&&!_0x40da19[_0x3c376d(0x180)])for(const _0x5f0e89 of _0x5d9a4b){const _0x170bd3=_0x5f0e89[_0x3c376d(0x1fd)]?_0x49585c[_0x3c376d(0x1c9)](_0x5f0e89[_0x3c376d(0x1fd)][_0x3c376d(0x196)]())||'':'',_0x303756=_0x170bd3?_0x170bd3+'/'+_0x5f0e89[_0x3c376d(0x1f7)]:_0x5f0e89[_0x3c376d(0x1f7)],_0x393bea=_0x339ce7[_0x3c376d(0x1c9)](_0x5f0e89['id'])||[],_0xefbf3c=_0x393bea[_0x3c376d(0x1e6)]>0x0?a29_0x508f6e[_0x3c376d(0x17f)]('\x20['+_0x393bea[_0x3c376d(0x1e6)]+_0x3c376d(0x1de)):'';console[_0x3c376d(0x1ac)]('\x0a'+a29_0x508f6e[_0x3c376d(0x1bd)]('Delete\x20segment:')+'\x20'+_0x303756+_0xefbf3c),console[_0x3c376d(0x1ac)]('─'[_0x3c376d(0x1d8)](0x3c));const _0x351245=segmentWithActivationsToYaml(_0x5f0e89,_0x393bea,undefined,_0x498d2a,_0x537b70),_0x422151=segmentToYamlString(_0x351245),_0x34c18c=generateDiff(_0x422151,'');console[_0x3c376d(0x1ac)](formatDiffWithColors(_0x34c18c)),console[_0x3c376d(0x1ac)]('─'['repeat'](0x3c));}const _0x1fb81f=_0x2c722a[_0x3c376d(0x1cf)](_0xb11111=>!_0xb11111['isNew']&&_0xb11111['diff']);if(_0x1fb81f[_0x3c376d(0x1e6)]>0x0&&!_0x40da19[_0x3c376d(0x180)])for(const _0x5576b0 of _0x1fb81f){const _0x33e3b2=_0x5576b0[_0x3c376d(0x1cb)]?_0x5576b0[_0x3c376d(0x1cb)]+'/'+_0x5576b0['yamlConfig'][_0x3c376d(0x1f7)]:_0x5576b0[_0x3c376d(0x1d9)]['name'];console[_0x3c376d(0x1ac)]('\x0a'+a29_0x508f6e[_0x3c376d(0x1af)]('Changes\x20to:')+'\x20'+_0x33e3b2),console[_0x3c376d(0x1ac)]('─'['repeat'](0x3c)),console[_0x3c376d(0x1ac)](_0x5576b0[_0x3c376d(0x1ee)]),console[_0x3c376d(0x1ac)]('─'['repeat'](0x3c));}if(_0x5bba5d['length']>0x0)for(const _0x42afd1 of _0x5bba5d){const _0x534ca1=_0x42afd1[_0x3c376d(0x1cb)]?_0x42afd1['folderPath']+'/'+_0x42afd1['yamlConfig'][_0x3c376d(0x1f7)]:_0x42afd1[_0x3c376d(0x1d9)][_0x3c376d(0x1f7)];console[_0x3c376d(0x1ac)]('\x0a'+a29_0x508f6e[_0x3c376d(0x1d0)]('New\x20journey:')+'\x20'+_0x534ca1),console[_0x3c376d(0x1ac)]('─'[_0x3c376d(0x1d8)](0x3c)),_0x42afd1['diff']&&console[_0x3c376d(0x1ac)](_0x42afd1[_0x3c376d(0x1ee)]),console['error']('─'['repeat'](0x3c));}const _0x52b17e=_0x5b784a[_0x3c376d(0x1cf)](_0x4dad7f=>!_0x4dad7f[_0x3c376d(0x188)]&&_0x4dad7f['diff']);if(_0x52b17e[_0x3c376d(0x1e6)]>0x0)for(const _0x246a88 of _0x52b17e){const _0x36210a=_0x246a88[_0x3c376d(0x1cb)]?_0x246a88[_0x3c376d(0x1cb)]+'/'+_0x246a88['yamlConfig']['name']:_0x246a88[_0x3c376d(0x1d9)]['name'];console['error']('\x0a'+a29_0x508f6e[_0x3c376d(0x1af)](_0x3c376d(0x1ef))+'\x20'+_0x36210a),console['error']('─'[_0x3c376d(0x1d8)](0x3c)),console[_0x3c376d(0x1ac)](_0x246a88[_0x3c376d(0x1ee)]),console[_0x3c376d(0x1ac)]('─'[_0x3c376d(0x1d8)](0x3c));}if(_0x4bc54b['length']>0x0)for(const _0x3b1a39 of _0x4bc54b){const _0x58310b=_0x3b1a39[_0x3c376d(0x17e)]?_0x49585c[_0x3c376d(0x1c9)](_0x3b1a39[_0x3c376d(0x17e)])||'':'',_0x3d774a=_0x58310b?_0x58310b+'/'+_0x3b1a39[_0x3c376d(0x1ea)]:_0x3b1a39[_0x3c376d(0x1ea)];console['error']('\x0a'+a29_0x508f6e['red'](_0x3c376d(0x19d))+'\x20'+_0x3d774a),console['error']('─'[_0x3c376d(0x1d8)](0x3c)),console[_0x3c376d(0x1ac)](a29_0x508f6e['red']('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x3c376d(0x1d8)](0x3c));}if(_0x40da19[_0x3c376d(0x1b2)])return console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1af)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x5229c9=_0x40da19[_0x3c376d(0x180)]?![]:_0x228c0b['length']>0x0||_0x218616[_0x3c376d(0x1e6)]>0x0||_0x5d9a4b[_0x3c376d(0x1e6)]>0x0,_0x2346c3=_0x5bba5d['length']>0x0||_0x2e980f['length']>0x0||_0x4bc54b[_0x3c376d(0x1e6)]>0x0,_0x1f0359=_0x40da19[_0x3c376d(0x180)]?![]:_0x51e81b[_0x3c376d(0x1e6)]>0x0,_0x56bbf2=_0x8f1aff['length']>0x0;if(!_0x5229c9&&!_0x2346c3&&!_0x1f0359&&!_0x56bbf2){const _0x1712e4=_0x40da19[_0x3c376d(0x180)]?_0x3c376d(0x185):_0x3c376d(0x1c2);console['error'](a29_0x508f6e[_0x3c376d(0x1d0)](_0x1712e4));if(_0x4bd170&&_0x2b9738[_0x3c376d(0x1e6)]===0x1){const _0x60fecd=_0x2b9738[0x0];if(_0x60fecd[_0x3c376d(0x1eb)]?.['id']){const _0x3b1ff6=getConsoleNextUrl(_0x40da19[_0x3c376d(0x1f8)],_0x3c376d(0x1f4)+_0x5e2900+_0x3c376d(0x1b8)+_0x60fecd[_0x3c376d(0x1eb)]['id']+'/j/da/je');console['error']('\x20\x20'+a29_0x508f6e[_0x3c376d(0x184)](_0x3b1ff6));}}return 0x0;}const _0x53439c=_0x40da19[_0x3c376d(0x180)]?_0x5bba5d[_0x3c376d(0x1e6)]+_0x2e980f['length']+_0x4bc54b[_0x3c376d(0x1e6)]+_0x8f1aff[_0x3c376d(0x1e6)]:_0x228c0b[_0x3c376d(0x1e6)]+_0x218616['length']+_0x5d9a4b[_0x3c376d(0x1e6)]+_0x5bba5d[_0x3c376d(0x1e6)]+_0x2e980f[_0x3c376d(0x1e6)]+_0x4bc54b[_0x3c376d(0x1e6)]+_0x8f1aff['length']+_0x51e81b[_0x3c376d(0x1e6)];if(!_0x40da19[_0x3c376d(0x1f0)]&&_0x53439c>0x0){const _0x575b90=await confirmKey('Push\x20'+_0x53439c+_0x3c376d(0x18b));if(!_0x575b90)return console[_0x3c376d(0x1ac)](_0x3c376d(0x182)),0x1;}const _0x27b763={'withProgress':async(_0x76ba74,_0x6bd932)=>{const _0x2c6916=_0x3c376d,_0x54a022=await withSpinner(_0x76ba74,_0x6bd932,{'verbose':_0x40da19[_0x2c6916(0x19a)]});return{'data':_0x54a022[_0x2c6916(0x1e2)]};},'logInfo':_0x2af017=>console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x218)]('✔\x20'+_0x2af017)),'logSuccess':_0x751031=>console['error'](a29_0x508f6e[_0x3c376d(0x1d0)]('✔\x20'+_0x751031)),'logWarning':_0x3eec42=>console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1af)]('⚠\x20'+_0x3eec42)),'logDeleted':_0x482760=>console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1bd)]('✔\x20'+_0x482760))},_0x3a220e={'segment':_0x46c1f0['segment'],'journey':_0x46c1f0[_0x3c376d(0x1f5)],'user':_0x46c1f0[_0x3c376d(0x210)],'connection':_0x46c1f0[_0x3c376d(0x213)]};_0x8f1aff[_0x3c376d(0x1e6)]>0x0&&(_0x16bad0=await executePushFolders(_0x3a220e,_0x8f1aff,_0x16bad0,{'parentId':_0x5e2900},_0x27b763));const _0x5f57c8={'rootFolderId':_0x2d3578,'folderPathToId':_0x16bad0,'folderIdToPath':_0x49585c,'segmentNameToId':_0x4917ad,'activationsBySegmentId':_0x339ce7,'emailToIdMap':_0x154ad1,'idToEmailMap':_0x498d2a,'connectionNameToIdMap':_0x58ecd8[_0x3c376d(0x1be)],'connectionIdToNameMap':_0x58ecd8[_0x3c376d(0x1c8)],'connectionNameToTypeMap':_0x4f3f9e},_0x2b462b=await executePushSegments(_0x3a220e,_0x40da19[_0x3c376d(0x180)]?[]:_0x2c722a,_0x5f57c8,{'parentId':_0x5e2900},_0x27b763),_0xdaa94b=_0x2b462b[_0x3c376d(0x1a3)],_0x27d8ff=_0x2b462b[_0x3c376d(0x1db)],_0x5a6c44=_0x2b462b[_0x3c376d(0x198)]['created'],_0x1ca424=_0x2b462b[_0x3c376d(0x198)][_0x3c376d(0x1db)],_0x507958=_0x2b462b[_0x3c376d(0x198)][_0x3c376d(0x211)],_0x420b9c=await executePushSegmentDeletions(_0x3a220e,_0x40da19[_0x3c376d(0x180)]?[]:_0x5d9a4b,_0x27b763);let _0x2a376=0x0,_0x24f533=0x0,_0x5c32fe=0x0;const _0x87b456=new Map(_0x4917ad);for(const [_0x502b55,_0x26032b]of _0x2b462b[_0x3c376d(0x20a)]){_0x87b456[_0x3c376d(0x1df)](_0x502b55,_0x26032b);}if(_0x5b784a[_0x3c376d(0x1e6)]>0x0){const _0x66eb94={..._0x5f57c8,'segmentNameToId':_0x87b456,'existingSegments':_0x48a796,'activationContext':_0x2c850b},_0x358dcb=await executePushJourneys(_0x3a220e,_0x5b784a,_0x66eb94,{'parentId':_0x5e2900,'rootFolderId':_0x2d3578,'verbose':_0x40da19[_0x3c376d(0x19a)]},_0x27b763);_0x2a376=_0x358dcb[_0x3c376d(0x1a3)],_0x24f533=_0x358dcb[_0x3c376d(0x1db)];if(_0x4bd170&&_0x358dcb['results'][_0x3c376d(0x1e6)]===0x1){const _0x11d008=_0x358dcb[_0x3c376d(0x1b5)][0x0];if(_0x11d008[_0x3c376d(0x1c4)]){const _0x5a6f07=getConsoleNextUrl(_0x40da19[_0x3c376d(0x1f8)],_0x3c376d(0x1f4)+_0x5e2900+_0x3c376d(0x1b8)+_0x11d008[_0x3c376d(0x1c4)]+_0x3c376d(0x208));console[_0x3c376d(0x1ac)]('\x20\x20'+a29_0x508f6e[_0x3c376d(0x184)](_0x5a6f07));}}}for(const _0x2652c9 of _0x4bc54b){console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1af)](_0x3c376d(0x194)+_0x2652c9[_0x3c376d(0x1ea)])),_0x5c32fe++;}const _0x5e88fe=[];if(_0xdaa94b>0x0)_0x5e88fe[_0x3c376d(0x1b4)](_0xdaa94b+_0x3c376d(0x19f));if(_0x27d8ff>0x0)_0x5e88fe[_0x3c376d(0x1b4)](_0x27d8ff+_0x3c376d(0x1d6));if(_0x420b9c>0x0)_0x5e88fe[_0x3c376d(0x1b4)](_0x420b9c+_0x3c376d(0x1a7));const _0x118b66=[];if(_0x2a376>0x0)_0x118b66['push'](_0x2a376+_0x3c376d(0x19f));if(_0x24f533>0x0)_0x118b66[_0x3c376d(0x1b4)](_0x24f533+_0x3c376d(0x1d6));if(_0x5c32fe>0x0)_0x118b66[_0x3c376d(0x1b4)](_0x5c32fe+_0x3c376d(0x1a7));const _0x598454=[];if(_0x5a6c44>0x0)_0x598454['push'](_0x5a6c44+_0x3c376d(0x19f));if(_0x1ca424>0x0)_0x598454[_0x3c376d(0x1b4)](_0x1ca424+_0x3c376d(0x1d6));if(_0x507958>0x0)_0x598454['push'](_0x507958+'\x20deleted');return console[_0x3c376d(0x1ac)](a29_0x508f6e[_0x3c376d(0x1d0)](_0x3c376d(0x1f3))),_0x5e88fe['length']>0x0&&!_0x40da19[_0x3c376d(0x180)]&&console[_0x3c376d(0x1ac)](_0x3c376d(0x1f6)+_0x5e88fe[_0x3c376d(0x1b1)](',\x20')),_0x118b66[_0x3c376d(0x1e6)]>0x0&&console[_0x3c376d(0x1ac)](_0x3c376d(0x1a8)+_0x118b66[_0x3c376d(0x1b1)](',\x20')),_0x598454[_0x3c376d(0x1e6)]>0x0&&!_0x40da19['journeysOnly']&&console[_0x3c376d(0x1ac)]('\x20\x20Activations:\x20'+_0x598454['join'](',\x20')),0x0;}}
1
+ const a29_0x59cde6=a29_0x229b;(function(_0x20bf58,_0x46f8c3){const _0x1c4689=a29_0x229b,_0x23aef4=_0x20bf58();while(!![]){try{const _0x1288ee=parseInt(_0x1c4689(0x15b))/0x1+-parseInt(_0x1c4689(0x129))/0x2+-parseInt(_0x1c4689(0x109))/0x3+parseInt(_0x1c4689(0x15e))/0x4+-parseInt(_0x1c4689(0x137))/0x5*(parseInt(_0x1c4689(0x136))/0x6)+parseInt(_0x1c4689(0xdd))/0x7+parseInt(_0x1c4689(0x110))/0x8*(parseInt(_0x1c4689(0x152))/0x9);if(_0x1288ee===_0x46f8c3)break;else _0x23aef4['push'](_0x23aef4['shift']());}catch(_0x414fbd){_0x23aef4['push'](_0x23aef4['shift']());}}}(a29_0x1cbb,0xc7449));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_0x3d1326 from'chalk';import{existsSync}from'fs';function a29_0x1cbb(){const _0x2347d3=['\x0aPush\x20summary\x20for\x20\x27','\x20to\x20update','600XfXPIr','12665xlsFkF','Error:\x20','getOutputSchemaWithCache','\x20\x20Activations:','verbose','delete','activations','toDelete','get','new','journeyId','\x20deleted','nameToType','error','results','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','audienceId','createdSegmentIds','listActivations','unchanged','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parentFolder','folderPath','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','all','join','file','8361ccilpy','getParent','No\x20','length','\x20new','connection','Scoped\x20to\x20folder:\x20','user','add','1587296eICXBC','Changes\x20to\x20journey:','no_parent','4860040wpMQMd','(Journey\x20will\x20be\x20deleted)','then','\x20to\x20create','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','buildUserMaps','getJourney','idToName','createdAt','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','repeat','Fetching\x20existing\x20folders...','\x0a✔\x20Push\x20complete','.yaml','toCreate','red','\x20changed','yamlConfig','\x20\x20\x20\x20','journeyBundleId','map','\x20\x20Journeys:\x20','site','resolveParentId','filter','scopedFolderPath','3112830aNWQfv','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x0aValidation\x20failed:','message','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','dryRun','New\x20segment:','existingJourney','deleted','Parent\x20segment:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','list','endsWith','isNew','Fetching\x20existing\x20segments...','listSegments','Fetching\x20connections\x20for\x20name\x20resolution...','Resolving\x20parent\x20segment\x20\x27','updated','nameToId','\x20folders\x20to\x20create','\x20\x20Source:\x20','\x27...','state','type','filePath','helpText','journey','setPhase','data','journeysOnly','push','journeys','Push\x20','blue','attributes','Delete\x20segment:','\x20activations]','green','segments','errorCode','\x20created','updatedAt','segmentFolderId','4774680qsqtsD','\x20to\x20delete','cyan','/j/da/je','execute','\x20\x20📊\x20Segments:','yellow','7376CUsLYh','name','changed','Source\x20directory:\x20','description','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Error:\x20Directory\x20not\x20found:\x20','Folders\x20to\x20create:','Site:\x20','dim','isScoped','segment\x20or\x20journey','segment:push','Fetching\x20existing\x20journeys...','created','Fetching\x20users\x20for\x20email\x20resolution...','Fetching\x20existing\x20activations...','.yml','parentSegment','\x20unchanged','folders','\x20changes?','\x20\x20Activations:\x20','targetDir','2884946gaRmtJ','journeyBundleName','relationships','diff','\x20YAML\x20files\x20found','set','toUpdate','\x20updated','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','paused','/e/'];a29_0x1cbb=function(){return _0x2347d3;};return a29_0x1cbb();}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';function a29_0x229b(_0x5257ff,_0x325ee2){_0x5257ff=_0x5257ff-0xcd;const _0x1cbb75=a29_0x1cbb();let _0x229b27=_0x1cbb75[_0x5257ff];return _0x229b27;}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_0x59cde6(0x111)]=a29_0x59cde6(0x11d);[a29_0x59cde6(0x114)]=a29_0x59cde6(0x115);async[a29_0x59cde6(0x10d)](_0x14ae8a){const _0x4249f8=a29_0x59cde6,{options:_0x43530b,args:_0x4c7cd1,tdx:_0x6c92c5}=_0x14ae8a,_0x29e51d=_0x43530b,_0x96c6e1=await resolveTarget({'arg':_0x4c7cd1[0x0],'contextParent':_0x43530b[_0x4249f8(0x123)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x96c6e1))return _0x96c6e1[_0x4249f8(0x105)]===_0x4249f8(0x15d)?(console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x14b))),console[_0x4249f8(0x144)]('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[_0x4249f8(0x144)](_0x4249f8(0x168)),console[_0x4249f8(0x144)](_0x4249f8(0x116))):(console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xd2)](_0x4249f8(0x138)+_0x96c6e1[_0x4249f8(0xe0)]+'\x0a')),_0x96c6e1[_0x4249f8(0xf7)]&&console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10b)](_0x96c6e1['helpText']))),0x1;if(_0x96c6e1[_0x4249f8(0xf5)]==='parent_name')return console[_0x4249f8(0x144)](a29_0x3d1326['red'](_0x4249f8(0x117)+_0x96c6e1[_0x4249f8(0x128)]+'\x0a')),console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10b)](_0x4249f8(0x146))),0x1;const _0x9fe777=_0x96c6e1['parentName'],_0x5d9a03=_0x96c6e1[_0x4249f8(0x128)],_0x2596ca=_0x96c6e1[_0x4249f8(0xf5)]===_0x4249f8(0x151)?_0x96c6e1[_0x4249f8(0xf6)]:undefined,_0x2faa3e=getScopedDetails(_0x96c6e1),_0x46b05e=_0x2faa3e?.[_0x4249f8(0x11b)]??![],_0x5cad96=_0x2faa3e?.[_0x4249f8(0xdc)]??'';if(!existsSync(_0x5d9a03))return console['error'](a29_0x3d1326['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x5d9a03+'\x0a')),console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10b)](_0x4249f8(0x146))),0x1;_0x29e51d[_0x4249f8(0x13b)]&&(console[_0x4249f8(0x144)](_0x4249f8(0x119)+_0x29e51d[_0x4249f8(0xd9)]),console[_0x4249f8(0x144)](_0x4249f8(0xe6)+_0x9fe777),console['error'](_0x4249f8(0x113)+_0x5d9a03),_0x46b05e&&console[_0x4249f8(0x144)](_0x4249f8(0x158)+_0x5cad96));const _0x5d9085=await withSpinner(_0x4249f8(0xee)+_0x9fe777+_0x4249f8(0xf3),()=>_0x6c92c5[_0x4249f8(0x167)][_0x4249f8(0xda)](_0x9fe777),{'verbose':_0x29e51d[_0x4249f8(0x13b)]}),_0x4fd2bf=_0x5d9085[_0x4249f8(0xfa)],[_0x526739,_0xa94930,_0x5ef1bc,_0x59dda0,_0x5e2e1d]=await Promise[_0x4249f8(0x14f)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x6c92c5[_0x4249f8(0x167)][_0x4249f8(0x153)](_0x4fd2bf),{'verbose':_0x29e51d['verbose']}),withSpinner(_0x4249f8(0xeb),()=>_0x6c92c5[_0x4249f8(0x167)][_0x4249f8(0xec)](_0x4fd2bf),{'verbose':_0x29e51d[_0x4249f8(0x13b)]}),withSpinner(_0x4249f8(0xce),()=>_0x6c92c5[_0x4249f8(0x167)]['listFolders'](_0x4fd2bf),{'verbose':_0x29e51d['verbose']}),withSpinner(_0x4249f8(0x11e),()=>_0x6c92c5[_0x4249f8(0xf8)]['listJourneysWithDetailsFromParentSegment'](_0x4fd2bf,{'includeAllVersions':!![]}),{'verbose':_0x29e51d[_0x4249f8(0x13b)]}),withSpinner(_0x4249f8(0x120),()=>_0x6c92c5[_0x4249f8(0x159)][_0x4249f8(0x163)](),{'verbose':_0x29e51d[_0x4249f8(0x13b)]})['then'](_0x2dc2cf=>_0x2dc2cf[_0x4249f8(0xfa)])]),_0x812c45=_0x526739[_0x4249f8(0xfa)],_0x55f0b5=extractRootFolderId(_0x812c45),_0x4b6408=_0xa94930[_0x4249f8(0xfa)],_0xbf3c9d=_0x5ef1bc['data'],{journeys:_0x3c245e,activationStepsById:_0x271470}=_0x59dda0[_0x4249f8(0xfa)],_0x13b423=new Map(_0x3c245e['map'](_0x1808f1=>[_0x1808f1['id'],_0x1808f1])),_0x4d7a85=_0x3c245e['map'](_0x245cc1=>({'id':_0x245cc1['id'],'name':_0x245cc1['attributes']['name'],'journeyBundleName':_0x245cc1[_0x4249f8(0x100)]['journeyBundleName']||'','journeyBundleId':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0xd6)]||'','versionNumber':_0x245cc1[_0x4249f8(0x100)]['versionNumber'],'description':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0x114)],'state':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0xf4)],'paused':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0x132)],'audienceId':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0x147)],'folderId':_0x245cc1[_0x4249f8(0x12b)]?.[_0x4249f8(0x14c)]?.[_0x4249f8(0xfa)]?.['id'],'createdAt':_0x245cc1[_0x4249f8(0x100)][_0x4249f8(0x166)],'updatedAt':_0x245cc1['attributes'][_0x4249f8(0x107)]})),{emailToId:_0x1f0df2,idToEmail:_0x531083}=_0x5e2e1d,_0xa43306=await withSpinner(_0x4249f8(0xed),async()=>{const _0x52bf8a=_0x4249f8,_0x4939f0=await _0x6c92c5['connection'][_0x52bf8a(0xe8)]();return buildConnectionMaps(_0x4939f0);},{'verbose':_0x29e51d['verbose']})[_0x4249f8(0x160)](_0x4adcab=>_0x4adcab['data']),_0x34f46f=_0xa43306['nameToId'],_0x4d3f32=_0xa43306[_0x4249f8(0x165)],_0x42b4a6=_0xa43306[_0x4249f8(0x143)],_0x44c6a9={'emailToIdMap':_0x1f0df2,'connectionNameToIdMap':_0x34f46f,'connectionNameToTypeMap':_0x42b4a6,'getSchema':_0x4b47eb=>_0x6c92c5[_0x4249f8(0x157)][_0x4249f8(0x139)](_0x4b47eb)};let {pathToId:_0x46af59,idToPath:_0x31a015}=buildFolderMaps(_0xbf3c9d);const _0x39bf37=buildSegmentLookupMap(_0x4b6408,_0x31a015),_0x287e03=buildSegmentNameToIdMap(_0x4b6408),_0x2c50b2=buildJourneyBundleLookupMap(_0x4d7a85,_0x31a015);let _0x1a6863;if(_0x2596ca){if(!_0x2596ca[_0x4249f8(0xe9)](_0x4249f8(0x122))&&!_0x2596ca[_0x4249f8(0xe9)](_0x4249f8(0xd0)))return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xd2)](_0x4249f8(0xe7)+_0x2596ca+'\x0a')),0x1;_0x1a6863=[_0x2596ca];}else _0x1a6863=findYamlFiles(_0x5d9a03);if(_0x1a6863[_0x4249f8(0x155)]===0x0)return console[_0x4249f8(0x144)](a29_0x3d1326['red'](_0x4249f8(0x162)+_0x5d9a03+'\x0a')),console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10b)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x1fd2f1,_0x3db54b;try{const _0x41aab9=parseAndClassifyYamlFiles(_0x1a6863,_0x5d9a03,{'skipSegments':_0x29e51d['journeysOnly']});_0x1fd2f1=_0x41aab9[_0x4249f8(0x104)],_0x3db54b=_0x41aab9['journeys'];const _0x25798d=validateParsedFiles(_0x41aab9,_0x5d9a03);if(_0x25798d[_0x4249f8(0x155)]>0x0)return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xd2)](_0x4249f8(0xdf))),console[_0x4249f8(0x144)](formatValidationErrors(_0x25798d)),console['error'](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x131))),0x1;}catch(_0x51301f){return console['error'](a29_0x3d1326[_0x4249f8(0xd2)]('Error\x20parsing\x20YAML:\x20'+(_0x51301f instanceof Error?_0x51301f[_0x4249f8(0xe0)]:_0x51301f))),0x1;}if(_0x1fd2f1['length']===0x0&&_0x3db54b[_0x4249f8(0x155)]===0x0){const _0xb78615=_0x29e51d[_0x4249f8(0xfb)]?'journey':_0x4249f8(0x11c);return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x154)+_0xb78615+_0x4249f8(0x12d))),0x0;}const _0x5c1e54=new Map();_0x4b6408[_0x4249f8(0x155)]>0x0&&!_0x29e51d['journeysOnly']&&await withSpinner(_0x4249f8(0x121),async()=>{await batchAsync(_0x4b6408,async _0x1d1b83=>{const _0x4f6c88=a29_0x229b,_0x35b565=await _0x6c92c5[_0x4f6c88(0x167)][_0x4f6c88(0x149)](_0x4fd2bf,_0x1d1b83['id']);_0x5c1e54[_0x4f6c88(0x12e)](_0x1d1b83['id'],_0x35b565);});},{'verbose':_0x29e51d['verbose']});const {segmentFiles:_0x4af029,foldersToCreate:_0xdfa388}=await prepareSegmentFiles(_0x1fd2f1,{'segmentByFolderAndName':_0x39bf37,'activationsBySegmentId':_0x5c1e54,'folderPathToId':_0x46af59,'idToEmailMap':_0x531083,'connectionIdToNameMap':_0x4d3f32},_0x44c6a9,_0x46b05e,_0x5cad96),_0x4da3b2=_0x2596ca?[]:findSegmentsToDelete(_0x4b6408,_0x1fd2f1[_0x4249f8(0xd7)](({yamlConfig:_0x2dbaa5,folderPath:_0x300f97})=>({'yamlConfig':_0x2dbaa5,'folderPath':resolveTDFolderPath(_0x300f97,_0x46b05e,_0x5cad96)})),_0x31a015,_0x5cad96,_0x46b05e),{journeyFiles:_0x125f28,foldersToCreate:_0x3dcef7}=await withProgressSpinner('Preparing\x20journeys...',async _0x5073ec=>prepareJourneyFiles(_0x3db54b,{'fetchJourney':async _0x3eaa33=>_0x6c92c5[_0x4249f8(0xf8)][_0x4249f8(0x164)](_0x3eaa33[_0x4249f8(0x141)]),'journeyBundlesByFolderAndName':_0x2c50b2,'folderPathToId':_0x46af59,'idToEmailMap':_0x531083,'connectionIdToNameMap':_0x4d3f32,'existingSegments':_0x4b6408,'parentId':_0x4fd2bf,'deps':_0x6c92c5,'progress':{'update':_0x215d8d=>{const _0x45ae69=_0x4249f8;_0x5073ec[_0x45ae69(0xf9)](_0x215d8d),_0x29e51d[_0x45ae69(0x13b)]&&console[_0x45ae69(0x144)]('\x20\x20'+_0x215d8d);}},'journeyById':_0x13b423,'activationStepsById':_0x271470},_0x46b05e,_0x5cad96),{'verbose':_0x29e51d[_0x4249f8(0x13b)]})[_0x4249f8(0x160)](_0x310ace=>_0x310ace['data']);for(const _0xf374a9 of _0x3dcef7){_0xdfa388[_0x4249f8(0x15a)](_0xf374a9);}const _0x30ae41=_0x2596ca?[]:findJourneysToDelete(_0x4d7a85,_0x3db54b[_0x4249f8(0xd7)](({yamlConfig:_0x563b03,folderPath:_0x3f21c7})=>({'yamlConfig':_0x563b03,'folderPath':resolveTDFolderPath(_0x3f21c7,_0x46b05e,_0x5cad96)})),_0x31a015,_0x5cad96,_0x46b05e),_0x2d8190=calculatePushStats(_0x4af029,_0x125f28,_0xdfa388,_0x4da3b2,_0x30ae41,!!_0x29e51d[_0x4249f8(0x13c)],!!_0x29e51d['journeysOnly']),_0x756bc1=_0x2d8190[_0x4249f8(0x104)][_0x4249f8(0x140)],_0x5df296=_0x2d8190[_0x4249f8(0x104)][_0x4249f8(0x112)],_0x12175e=_0x2d8190['segments'][_0x4249f8(0x14a)],_0x648382=_0x2d8190[_0x4249f8(0x104)][_0x4249f8(0x13e)],_0x3464b9=_0x2d8190[_0x4249f8(0x125)]['toCreate'],_0x130db1=_0x2d8190[_0x4249f8(0xfd)][_0x4249f8(0x140)],_0x584fc3=_0x2d8190[_0x4249f8(0xfd)][_0x4249f8(0x112)],_0x408b51=_0x2d8190[_0x4249f8(0xfd)][_0x4249f8(0x14a)],_0x2a954b=_0x2d8190['journeys'][_0x4249f8(0x13e)],_0x5e94e9=_0x2d8190[_0x4249f8(0x13d)][_0x4249f8(0x14f)],_0x5c6afd=_0x2d8190[_0x4249f8(0x13d)][_0x4249f8(0xd1)],_0x2a574c=_0x2d8190['activations'][_0x4249f8(0x12f)],_0x21f6c0=_0x2d8190[_0x4249f8(0x13d)]['toDelete'];console[_0x4249f8(0x144)](_0x4249f8(0x134)+_0x9fe777+'\x27:');_0x3464b9[_0x4249f8(0x155)]>0x0&&console[_0x4249f8(0x144)]('\x20\x20'+a29_0x3d1326[_0x4249f8(0xff)]('📁\x20'+_0x3464b9[_0x4249f8(0x155)]+_0x4249f8(0xf1)));if(!_0x29e51d[_0x4249f8(0xfb)]){console[_0x4249f8(0x144)](_0x4249f8(0x10e)),console['error'](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x103)]('+\x20'+_0x756bc1[_0x4249f8(0x155)]+_0x4249f8(0x156))),console['error'](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x10f)]('~\x20'+_0x5df296[_0x4249f8(0x155)]+_0x4249f8(0xd3)));if(_0x648382['length']>0x0)console[_0x4249f8(0x144)]('\x20\x20\x20\x20'+a29_0x3d1326['red']('-\x20'+_0x648382[_0x4249f8(0x155)]+_0x4249f8(0x10a)));else _0x4da3b2[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0x13c)]&&console['error'](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x11a)](_0x4da3b2[_0x4249f8(0x155)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326['dim']('=\x20'+_0x12175e[_0x4249f8(0x155)]+_0x4249f8(0x124)));}if(_0x125f28[_0x4249f8(0x155)]>0x0||_0x30ae41[_0x4249f8(0x155)]>0x0){console[_0x4249f8(0x144)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x103)]('+\x20'+_0x130db1[_0x4249f8(0x155)]+_0x4249f8(0x156))),console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x10f)]('~\x20'+_0x584fc3[_0x4249f8(0x155)]+_0x4249f8(0xd3)));if(_0x2a954b[_0x4249f8(0x155)]>0x0)console[_0x4249f8(0x144)]('\x20\x20\x20\x20'+a29_0x3d1326[_0x4249f8(0xd2)]('-\x20'+_0x2a954b[_0x4249f8(0x155)]+_0x4249f8(0x10a)));else _0x30ae41[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0x13c)]&&console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x11a)](_0x30ae41[_0x4249f8(0x155)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x11a)]('=\x20'+_0x408b51[_0x4249f8(0x155)]+_0x4249f8(0x124)));}_0x5e94e9[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)]&&(console[_0x4249f8(0x144)](''),console[_0x4249f8(0x144)](_0x4249f8(0x13a)),_0x5c6afd[_0x4249f8(0x155)]>0x0&&console[_0x4249f8(0x144)]('\x20\x20\x20\x20'+a29_0x3d1326[_0x4249f8(0x103)]('+\x20'+_0x5c6afd[_0x4249f8(0x155)]+_0x4249f8(0x161))),_0x2a574c['length']>0x0&&console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0x10f)]('~\x20'+_0x2a574c['length']+_0x4249f8(0x135))),_0x21f6c0['length']>0x0&&console[_0x4249f8(0x144)](_0x4249f8(0xd5)+a29_0x3d1326[_0x4249f8(0xd2)]('-\x20'+_0x21f6c0[_0x4249f8(0x155)]+_0x4249f8(0x10a))));console['error'](_0x4249f8(0xf2)+a29_0x3d1326[_0x4249f8(0x10b)](_0x5d9a03)+'\x0a');if(_0x3464b9[_0x4249f8(0x155)]>0x0){console[_0x4249f8(0x144)](_0x4249f8(0x118));for(const _0x5a5f75 of _0x3464b9){console[_0x4249f8(0x144)]('\x20\x20'+a29_0x3d1326[_0x4249f8(0xff)]('+')+'\x20'+_0x5a5f75);}console[_0x4249f8(0x144)]('');}if(_0x756bc1[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)])for(const _0x15aa80 of _0x756bc1){const _0x46e0f0=_0x15aa80[_0x4249f8(0x14d)]?_0x15aa80['folderPath']+'/'+_0x15aa80[_0x4249f8(0xd4)][_0x4249f8(0x111)]:_0x15aa80[_0x4249f8(0xd4)][_0x4249f8(0x111)],_0x5d0219=_0x15aa80[_0x4249f8(0xd4)]['activations']?.['length']||0x0,_0x2881c9=_0x5d0219>0x0?a29_0x3d1326[_0x4249f8(0x11a)]('\x20['+_0x5d0219+_0x4249f8(0x102)):'';console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0x103)](_0x4249f8(0xe3))+'\x20'+_0x46e0f0+_0x2881c9),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c)),_0x15aa80[_0x4249f8(0x12c)]&&console[_0x4249f8(0x144)](_0x15aa80[_0x4249f8(0x12c)]),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c));}if(_0x648382[_0x4249f8(0x155)]>0x0&&!_0x29e51d['journeysOnly'])for(const _0x2eea5f of _0x648382){const _0xd496b3=_0x2eea5f[_0x4249f8(0x108)]?_0x31a015[_0x4249f8(0x13f)](_0x2eea5f['segmentFolderId']['toString']())||'':'',_0x5c6754=_0xd496b3?_0xd496b3+'/'+_0x2eea5f[_0x4249f8(0x111)]:_0x2eea5f['name'],_0x2aa466=_0x5c1e54[_0x4249f8(0x13f)](_0x2eea5f['id'])||[],_0x4886aa=_0x2aa466[_0x4249f8(0x155)]>0x0?a29_0x3d1326[_0x4249f8(0x11a)]('\x20['+_0x2aa466[_0x4249f8(0x155)]+_0x4249f8(0x102)):'';console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0xd2)](_0x4249f8(0x101))+'\x20'+_0x5c6754+_0x4886aa),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c));const _0x56356b=segmentWithActivationsToYaml(_0x2eea5f,_0x2aa466,undefined,_0x531083,_0x4d3f32),_0xb0061d=segmentToYamlString(_0x56356b),_0x51aaf4=generateDiff(_0xb0061d,'');console[_0x4249f8(0x144)](formatDiffWithColors(_0x51aaf4)),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c));}const _0x38f5b5=_0x4af029['filter'](_0x43f8f1=>!_0x43f8f1['isNew']&&_0x43f8f1[_0x4249f8(0x12c)]);if(_0x38f5b5[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)])for(const _0x360e01 of _0x38f5b5){const _0x4b5f30=_0x360e01[_0x4249f8(0x14d)]?_0x360e01[_0x4249f8(0x14d)]+'/'+_0x360e01[_0x4249f8(0xd4)][_0x4249f8(0x111)]:_0x360e01[_0x4249f8(0xd4)][_0x4249f8(0x111)];console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326['yellow']('Changes\x20to:')+'\x20'+_0x4b5f30),console['error']('─'['repeat'](0x3c)),console[_0x4249f8(0x144)](_0x360e01[_0x4249f8(0x12c)]),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c));}if(_0x130db1[_0x4249f8(0x155)]>0x0)for(const _0x40dbfb of _0x130db1){const _0x477f2a=_0x40dbfb[_0x4249f8(0x14d)]?_0x40dbfb[_0x4249f8(0x14d)]+'/'+_0x40dbfb[_0x4249f8(0xd4)]['name']:_0x40dbfb['yamlConfig']['name'];console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0x103)]('New\x20journey:')+'\x20'+_0x477f2a),console[_0x4249f8(0x144)]('─'['repeat'](0x3c)),_0x40dbfb[_0x4249f8(0x12c)]&&console[_0x4249f8(0x144)](_0x40dbfb[_0x4249f8(0x12c)]),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c));}const _0x41b962=_0x125f28[_0x4249f8(0xdb)](_0x22d0c0=>!_0x22d0c0[_0x4249f8(0xea)]&&_0x22d0c0[_0x4249f8(0x12c)]);if(_0x41b962[_0x4249f8(0x155)]>0x0)for(const _0x38bed0 of _0x41b962){const _0x35b289=_0x38bed0['folderPath']?_0x38bed0[_0x4249f8(0x14d)]+'/'+_0x38bed0[_0x4249f8(0xd4)][_0x4249f8(0x111)]:_0x38bed0['yamlConfig'][_0x4249f8(0x111)];console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x15c))+'\x20'+_0x35b289),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c)),console[_0x4249f8(0x144)](_0x38bed0[_0x4249f8(0x12c)]),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c));}if(_0x2a954b[_0x4249f8(0x155)]>0x0)for(const _0x4cbbfc of _0x2a954b){const _0x10c037=_0x4cbbfc['folderId']?_0x31a015[_0x4249f8(0x13f)](_0x4cbbfc['folderId'])||'':'',_0x39d3dd=_0x10c037?_0x10c037+'/'+_0x4cbbfc['journeyBundleName']:_0x4cbbfc[_0x4249f8(0x12a)];console[_0x4249f8(0x144)]('\x0a'+a29_0x3d1326[_0x4249f8(0xd2)]('Delete\x20journey:')+'\x20'+_0x39d3dd),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c)),console[_0x4249f8(0x144)](a29_0x3d1326['red'](_0x4249f8(0x15f))),console[_0x4249f8(0x144)]('─'[_0x4249f8(0xcd)](0x3c));}if(_0x29e51d[_0x4249f8(0xe2)])return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0x14e))),0x0;const _0x23b840=_0x29e51d[_0x4249f8(0xfb)]?![]:_0x756bc1['length']>0x0||_0x5df296[_0x4249f8(0x155)]>0x0||_0x648382[_0x4249f8(0x155)]>0x0,_0x15fe25=_0x130db1['length']>0x0||_0x584fc3['length']>0x0||_0x2a954b[_0x4249f8(0x155)]>0x0,_0xbfc707=_0x29e51d[_0x4249f8(0xfb)]?![]:_0x5e94e9[_0x4249f8(0x155)]>0x0,_0x258f68=_0x3464b9[_0x4249f8(0x155)]>0x0;if(!_0x23b840&&!_0x15fe25&&!_0xbfc707&&!_0x258f68){const _0x59efd6=_0x29e51d[_0x4249f8(0xfb)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x4249f8(0xde);console[_0x4249f8(0x144)](a29_0x3d1326['green'](_0x59efd6));if(_0x2596ca&&_0x408b51[_0x4249f8(0x155)]===0x1){const _0x262c43=_0x408b51[0x0];if(_0x262c43[_0x4249f8(0xe4)]?.['id']){const _0x55001a=getConsoleNextUrl(_0x29e51d[_0x4249f8(0xd9)],'/app/ps/'+_0x4fd2bf+_0x4249f8(0x133)+_0x262c43[_0x4249f8(0xe4)]['id']+_0x4249f8(0x10c));console[_0x4249f8(0x144)]('\x20\x20'+a29_0x3d1326['cyan'](_0x55001a));}}return 0x0;}const _0x4fe248=_0x29e51d['journeysOnly']?_0x130db1['length']+_0x584fc3[_0x4249f8(0x155)]+_0x2a954b['length']+_0x3464b9[_0x4249f8(0x155)]:_0x756bc1[_0x4249f8(0x155)]+_0x5df296[_0x4249f8(0x155)]+_0x648382[_0x4249f8(0x155)]+_0x130db1[_0x4249f8(0x155)]+_0x584fc3[_0x4249f8(0x155)]+_0x2a954b[_0x4249f8(0x155)]+_0x3464b9[_0x4249f8(0x155)]+_0x5e94e9['length'];if(!_0x29e51d['yes']&&_0x4fe248>0x0){const _0x517fc4=await confirmKey(_0x4249f8(0xfe)+_0x4fe248+_0x4249f8(0x126));if(!_0x517fc4)return console[_0x4249f8(0x144)]('Aborted.'),0x1;}const _0x2c893c={'withProgress':async(_0x2f125b,_0x3b714c)=>{const _0x245377=_0x4249f8,_0x463ec1=await withSpinner(_0x2f125b,_0x3b714c,{'verbose':_0x29e51d[_0x245377(0x13b)]});return{'data':_0x463ec1['data']};},'logInfo':_0x531d7d=>console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xff)]('✔\x20'+_0x531d7d)),'logSuccess':_0x42b709=>console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x103)]('✔\x20'+_0x42b709)),'logWarning':_0x204930=>console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)]('⚠\x20'+_0x204930)),'logDeleted':_0x53398c=>console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0xd2)]('✔\x20'+_0x53398c))},_0x53fd17={'segment':_0x6c92c5[_0x4249f8(0x167)],'journey':_0x6c92c5[_0x4249f8(0xf8)],'user':_0x6c92c5[_0x4249f8(0x159)],'connection':_0x6c92c5[_0x4249f8(0x157)]};_0x3464b9[_0x4249f8(0x155)]>0x0&&(_0x46af59=await executePushFolders(_0x53fd17,_0x3464b9,_0x46af59,{'parentId':_0x4fd2bf},_0x2c893c));const _0x49de39={'rootFolderId':_0x55f0b5,'folderPathToId':_0x46af59,'folderIdToPath':_0x31a015,'segmentNameToId':_0x287e03,'activationsBySegmentId':_0x5c1e54,'emailToIdMap':_0x1f0df2,'idToEmailMap':_0x531083,'connectionNameToIdMap':_0xa43306[_0x4249f8(0xf0)],'connectionIdToNameMap':_0xa43306[_0x4249f8(0x165)],'connectionNameToTypeMap':_0x42b4a6},_0x1a94db=await executePushSegments(_0x53fd17,_0x29e51d[_0x4249f8(0xfb)]?[]:_0x4af029,_0x49de39,{'parentId':_0x4fd2bf},_0x2c893c),_0x4e1309=_0x1a94db[_0x4249f8(0x11f)],_0xfd4487=_0x1a94db[_0x4249f8(0xef)],_0x5095ce=_0x1a94db[_0x4249f8(0x13d)]['created'],_0x5896c1=_0x1a94db['activations']['updated'],_0x4c6e72=_0x1a94db['activations'][_0x4249f8(0xe5)],_0x5cc45b=await executePushSegmentDeletions(_0x53fd17,_0x29e51d[_0x4249f8(0xfb)]?[]:_0x648382,_0x2c893c);let _0x36eab3=0x0,_0x3cd094=0x0,_0x315d23=0x0;const _0xaa150a=new Map(_0x287e03);for(const [_0x193721,_0x331651]of _0x1a94db[_0x4249f8(0x148)]){_0xaa150a[_0x4249f8(0x12e)](_0x193721,_0x331651);}if(_0x125f28[_0x4249f8(0x155)]>0x0){const _0x4fda71={..._0x49de39,'segmentNameToId':_0xaa150a,'existingSegments':_0x4b6408,'activationContext':_0x44c6a9},_0x1d8153=await executePushJourneys(_0x53fd17,_0x125f28,_0x4fda71,{'parentId':_0x4fd2bf,'rootFolderId':_0x55f0b5,'verbose':_0x29e51d[_0x4249f8(0x13b)]},_0x2c893c);_0x36eab3=_0x1d8153[_0x4249f8(0x11f)],_0x3cd094=_0x1d8153[_0x4249f8(0xef)];if(_0x2596ca&&_0x1d8153['results'][_0x4249f8(0x155)]===0x1){const _0x3b5dab=_0x1d8153[_0x4249f8(0x145)][0x0];if(_0x3b5dab[_0x4249f8(0x141)]){const _0x269f31=getConsoleNextUrl(_0x29e51d[_0x4249f8(0xd9)],'/app/ps/'+_0x4fd2bf+_0x4249f8(0x133)+_0x3b5dab[_0x4249f8(0x141)]+_0x4249f8(0x10c));console['error']('\x20\x20'+a29_0x3d1326[_0x4249f8(0x10b)](_0x269f31));}}}for(const _0x3b037a of _0x2a954b){console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x10f)](_0x4249f8(0xe1)+_0x3b037a[_0x4249f8(0x12a)])),_0x315d23++;}const _0x5627b9=[];if(_0x4e1309>0x0)_0x5627b9[_0x4249f8(0xfc)](_0x4e1309+_0x4249f8(0x106));if(_0xfd4487>0x0)_0x5627b9[_0x4249f8(0xfc)](_0xfd4487+_0x4249f8(0x130));if(_0x5cc45b>0x0)_0x5627b9[_0x4249f8(0xfc)](_0x5cc45b+'\x20deleted');const _0x1ba87e=[];if(_0x36eab3>0x0)_0x1ba87e[_0x4249f8(0xfc)](_0x36eab3+_0x4249f8(0x106));if(_0x3cd094>0x0)_0x1ba87e['push'](_0x3cd094+'\x20updated');if(_0x315d23>0x0)_0x1ba87e[_0x4249f8(0xfc)](_0x315d23+_0x4249f8(0x142));const _0x40ab2a=[];if(_0x5095ce>0x0)_0x40ab2a[_0x4249f8(0xfc)](_0x5095ce+_0x4249f8(0x106));if(_0x5896c1>0x0)_0x40ab2a['push'](_0x5896c1+_0x4249f8(0x130));if(_0x4c6e72>0x0)_0x40ab2a[_0x4249f8(0xfc)](_0x4c6e72+_0x4249f8(0x142));return console[_0x4249f8(0x144)](a29_0x3d1326[_0x4249f8(0x103)](_0x4249f8(0xcf))),_0x5627b9[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)]&&console[_0x4249f8(0x144)]('\x20\x20Segments:\x20'+_0x5627b9[_0x4249f8(0x150)](',\x20')),_0x1ba87e[_0x4249f8(0x155)]>0x0&&console[_0x4249f8(0x144)](_0x4249f8(0xd8)+_0x1ba87e[_0x4249f8(0x150)](',\x20')),_0x40ab2a[_0x4249f8(0x155)]>0x0&&!_0x29e51d[_0x4249f8(0xfb)]&&console[_0x4249f8(0x144)](_0x4249f8(0x127)+_0x40ab2a[_0x4249f8(0x150)](',\x20')),0x0;}}
@@ -1 +1 @@
1
- const a30_0x48ea6a=a30_0x26eb;(function(_0x47dfee,_0x4fca68){const _0x52821e=a30_0x26eb,_0x30d0c9=_0x47dfee();while(!![]){try{const _0x1f1f2e=parseInt(_0x52821e(0x1fa))/0x1*(parseInt(_0x52821e(0x205))/0x2)+parseInt(_0x52821e(0x1f8))/0x3*(parseInt(_0x52821e(0x1f6))/0x4)+parseInt(_0x52821e(0x1f3))/0x5+parseInt(_0x52821e(0x204))/0x6*(parseInt(_0x52821e(0x20d))/0x7)+-parseInt(_0x52821e(0x1ee))/0x8*(-parseInt(_0x52821e(0x213))/0x9)+parseInt(_0x52821e(0x1fe))/0xa*(-parseInt(_0x52821e(0x1ed))/0xb)+-parseInt(_0x52821e(0x20e))/0xc;if(_0x1f1f2e===_0x4fca68)break;else _0x30d0c9['push'](_0x30d0c9['shift']());}catch(_0x27cc85){_0x30d0c9['push'](_0x30d0c9['shift']());}}}(a30_0x4cd0,0x7a444));import{BaseCommand}from'./command.js';function a30_0x4cd0(){const _0x386253=['Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','verbose','✔\x20Updated\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Updating\x20segment\x20\x27','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','50505eixNEp','19167984umHWpV','segmentPath','name','segmentName','\x20\x20\x20Path:\x20','9KvGRUT','yellow','Resolved\x20relative\x20path\x20to:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','\x27...','ruleFile','folder','resolvePathToResource','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentId','143Pelnne','2439912ZIGgHN','Update\x20existing\x20child\x20segment','type','rule','Resolving\x20path\x20\x27','4723130wfiWQG','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','updateSegmentById','32OfZKbq','resolveFolderId','136128ozQPVF','parentId','145867ZoCICx','description','error','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','547100lElZZz','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Error:\x20Cannot\x20update\x20','includes','data','segment','510KSPdFZ','8PvdZTD'];a30_0x4cd0=function(){return _0x386253;};return a30_0x4cd0();}function a30_0x26eb(_0x58fa77,_0x1ab482){_0x58fa77=_0x58fa77-0x1e4;const _0x4cd0d8=a30_0x4cd0();let _0x26eb3b=_0x4cd0d8[_0x58fa77];return _0x26eb3b;}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';import a30_0x4b311c from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x48ea6a(0x210)]='segment:update';['description']=a30_0x48ea6a(0x1ef);async['execute'](_0x374e66){const _0x122e77=a30_0x48ea6a;console[_0x122e77(0x1fc)](a30_0x4b311c[_0x122e77(0x1e4)](_0x122e77(0x1e6))),console[_0x122e77(0x1fc)](a30_0x4b311c[_0x122e77(0x1e4)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0xf911ef,args:_0x287130,tdx:_0x43c7e1}=_0x374e66,_0x44766b=_0xf911ef;if(_0x287130['length']===0x0)return console['error'](_0x122e77(0x1fd)),console[_0x122e77(0x1fc)](_0x122e77(0x209)),console['error']('Examples:'),console['error'](_0x122e77(0x1ff)),console[_0x122e77(0x1fc)](_0x122e77(0x1f4)),0x1;const _0x29e70b=_0x287130[0x0],_0x5ee6d7=_0xf911ef[_0x122e77(0x20f)];let _0x3a0a53=_0x29e70b;_0x5ee6d7&&!_0x29e70b[_0x122e77(0x201)]('/')&&(_0x3a0a53=_0x5ee6d7+'/'+_0x29e70b,_0x44766b[_0x122e77(0x207)]&&console[_0x122e77(0x1fc)](_0x122e77(0x1e5)+_0x3a0a53));const _0x3bb8f4=await withSpinner(_0x122e77(0x1f2)+_0x3a0a53+_0x122e77(0x1e7),()=>_0x43c7e1[_0x122e77(0x203)][_0x122e77(0x1ea)](_0x3a0a53),{'verbose':_0x44766b['verbose']}),_0x5adb4f=_0x3bb8f4[_0x122e77(0x202)];_0x44766b[_0x122e77(0x207)]&&console[_0x122e77(0x1fc)]('Resolved\x20type:\x20'+_0x5adb4f[_0x122e77(0x1f0)]);if(_0x5adb4f[_0x122e77(0x1f0)]!==_0x122e77(0x203))return console[_0x122e77(0x1fc)](_0x122e77(0x200)+_0x5adb4f[_0x122e77(0x1f0)]+_0x122e77(0x1eb)),console[_0x122e77(0x1fc)](_0x122e77(0x206)),0x1;if(!_0x5adb4f[_0x122e77(0x1ec)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2210a5=_0x5adb4f[_0x122e77(0x1f9)],_0xf5eb84=_0x5adb4f[_0x122e77(0x1ec)];_0x44766b[_0x122e77(0x207)]&&(console[_0x122e77(0x1fc)](_0x122e77(0x20c)+_0x2210a5),console['error']('Segment\x20ID:\x20'+_0xf5eb84));let _0x1294ca;if(_0x44766b[_0x122e77(0x1e9)]){const _0x5ad9b4=_0x44766b[_0x122e77(0x1e9)],_0x5430d6=await withSpinner(_0x122e77(0x20b)+_0x5ad9b4+_0x122e77(0x1e7),()=>_0x43c7e1[_0x122e77(0x203)][_0x122e77(0x1f7)](_0x2210a5,_0x5ad9b4),{'verbose':_0x44766b['verbose']});_0x1294ca=parseInt(_0x5430d6[_0x122e77(0x202)],0xa),_0x44766b['verbose']&&console[_0x122e77(0x1fc)]('Resolved\x20folder\x20ID:\x20'+_0x1294ca);}const _0x3ff5c6=await loadJSONFromOptions(_0x44766b[_0x122e77(0x1f1)],_0x44766b[_0x122e77(0x1e8)]),_0x3801e7={'name':_0x44766b[_0x122e77(0x210)],'description':_0x44766b[_0x122e77(0x1fb)],'rule':_0x3ff5c6,'kind':_0x44766b['kind']!==undefined?parseInt(_0x44766b['kind'],0xa):undefined,'segmentFolderId':_0x1294ca},_0x33cf7a=await withSpinner(_0x122e77(0x20a)+_0x5adb4f[_0x122e77(0x211)]+'\x27...',()=>_0x43c7e1[_0x122e77(0x203)][_0x122e77(0x1f5)](_0x2210a5,_0xf5eb84,_0x3801e7),{'verbose':_0x44766b[_0x122e77(0x207)]}),_0x227b2f=_0x33cf7a[_0x122e77(0x202)];return console[_0x122e77(0x1fc)](_0x122e77(0x208)+_0x227b2f['name']+'\x27'),_0x3a0a53!==_0x29e70b&&console['error'](_0x122e77(0x212)+_0x3a0a53),await handleSDKOutput([_0x227b2f],_0x44766b),0x0;}}
1
+ const a30_0x1050e6=a30_0x286c;(function(_0x389d2f,_0x27a0d2){const _0x2e0ad9=a30_0x286c,_0x2f914c=_0x389d2f();while(!![]){try{const _0x20a946=-parseInt(_0x2e0ad9(0x118))/0x1*(-parseInt(_0x2e0ad9(0x124))/0x2)+-parseInt(_0x2e0ad9(0x107))/0x3+-parseInt(_0x2e0ad9(0x10a))/0x4+-parseInt(_0x2e0ad9(0x111))/0x5+parseInt(_0x2e0ad9(0x112))/0x6*(-parseInt(_0x2e0ad9(0x104))/0x7)+parseInt(_0x2e0ad9(0x11e))/0x8*(-parseInt(_0x2e0ad9(0xfe))/0x9)+-parseInt(_0x2e0ad9(0x10d))/0xa*(-parseInt(_0x2e0ad9(0x122))/0xb);if(_0x20a946===_0x27a0d2)break;else _0x2f914c['push'](_0x2f914c['shift']());}catch(_0x2cc4f1){_0x2f914c['push'](_0x2f914c['shift']());}}}(a30_0x33db,0x5dfdf));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';function a30_0x286c(_0x7d7f6d,_0xaa8351){_0x7d7f6d=_0x7d7f6d-0xfc;const _0x33db1d=a30_0x33db();let _0x286c06=_0x33db1d[_0x7d7f6d];return _0x286c06;}import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x585224 from'chalk';function a30_0x33db(){const _0x298409=['description','resolveFolderId','547692RatoBa','includes','verbose','30NlHMXD','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','rule','ruleFile','1951425iUWufq','318468wxDHOP','Update\x20existing\x20child\x20segment','Resolved\x20relative\x20path\x20to:\x20','segmentId','segmentPath','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','359048wdsLpf','Updating\x20segment\x20\x27','segment','type','data','✔\x20Updated\x20segment\x20\x27','8rlmdcV','Segment\x20ID\x20missing\x20from\x20resolved\x20path','INTERNAL','name','3570787OwYcaQ','\x27...','4guBUav','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20\x20Path:\x20','Error:\x20Cannot\x20update\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','segmentName','folder','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','parentId','error','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','yellow','1017261UbRBDX','Resolving\x20folder\x20\x27','Resolved\x20folder\x20ID:\x20','kind','updateSegmentById','segment:update','28lxUSPc','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','1363221EasXOX'];a30_0x33db=function(){return _0x298409;};return a30_0x33db();}export class SegmentUpdateCommand extends BaseCommand{[a30_0x1050e6(0x121)]=a30_0x1050e6(0x103);[a30_0x1050e6(0x108)]=a30_0x1050e6(0x113);async['execute'](_0x53fcdc){const _0x311e6d=a30_0x1050e6;console[_0x311e6d(0x12e)](a30_0x585224[_0x311e6d(0xfd)](_0x311e6d(0xfc))),console[_0x311e6d(0x12e)](a30_0x585224['yellow'](_0x311e6d(0x128)));const {options:_0x4b459c,args:_0x5bb266,tdx:_0x4bf459}=_0x53fcdc,_0x21eb5e=_0x4b459c;if(_0x5bb266['length']===0x0)return console[_0x311e6d(0x12e)](_0x311e6d(0x125)),console[_0x311e6d(0x12e)](_0x311e6d(0x10e)),console['error']('Examples:'),console[_0x311e6d(0x12e)](_0x311e6d(0x12c)),console[_0x311e6d(0x12e)](_0x311e6d(0x117)),0x1;const _0x30610b=_0x5bb266[0x0],_0x2bf2a0=_0x4b459c[_0x311e6d(0x116)];let _0x3836ef=_0x30610b;_0x2bf2a0&&!_0x30610b[_0x311e6d(0x10b)]('/')&&(_0x3836ef=_0x2bf2a0+'/'+_0x30610b,_0x21eb5e['verbose']&&console[_0x311e6d(0x12e)](_0x311e6d(0x114)+_0x3836ef));const _0x96c83d=await withSpinner(_0x311e6d(0x106)+_0x3836ef+'\x27...',()=>_0x4bf459[_0x311e6d(0x11a)]['resolvePathToResource'](_0x3836ef),{'verbose':_0x21eb5e[_0x311e6d(0x10c)]}),_0x1f89aa=_0x96c83d[_0x311e6d(0x11c)];_0x21eb5e[_0x311e6d(0x10c)]&&console[_0x311e6d(0x12e)]('Resolved\x20type:\x20'+_0x1f89aa[_0x311e6d(0x11b)]);if(_0x1f89aa['type']!==_0x311e6d(0x11a))return console[_0x311e6d(0x12e)](_0x311e6d(0x127)+_0x1f89aa[_0x311e6d(0x11b)]+_0x311e6d(0x12b)),console[_0x311e6d(0x12e)](_0x311e6d(0x105)),0x1;if(!_0x1f89aa[_0x311e6d(0x115)])throw new SDKError(ErrorCode[_0x311e6d(0x120)],_0x311e6d(0x11f));const _0x41e303=_0x1f89aa[_0x311e6d(0x12d)],_0x37f917=_0x1f89aa[_0x311e6d(0x115)];_0x21eb5e['verbose']&&(console[_0x311e6d(0x12e)]('Parent\x20ID:\x20'+_0x41e303),console[_0x311e6d(0x12e)]('Segment\x20ID:\x20'+_0x37f917));let _0x53e99b;if(_0x21eb5e[_0x311e6d(0x12a)]){const _0x1c9a74=_0x21eb5e[_0x311e6d(0x12a)],_0x2c6aec=await withSpinner(_0x311e6d(0xff)+_0x1c9a74+_0x311e6d(0x123),()=>_0x4bf459[_0x311e6d(0x11a)][_0x311e6d(0x109)](_0x41e303,_0x1c9a74),{'verbose':_0x21eb5e[_0x311e6d(0x10c)]});_0x53e99b=parseInt(_0x2c6aec[_0x311e6d(0x11c)],0xa),_0x21eb5e['verbose']&&console[_0x311e6d(0x12e)](_0x311e6d(0x100)+_0x53e99b);}const _0x479f17=await loadJSONFromOptions(_0x21eb5e[_0x311e6d(0x10f)],_0x21eb5e[_0x311e6d(0x110)]),_0x1036fc={'name':_0x21eb5e['name'],'description':_0x21eb5e['description'],'rule':_0x479f17,'kind':_0x21eb5e[_0x311e6d(0x101)]!==undefined?parseInt(_0x21eb5e[_0x311e6d(0x101)],0xa):undefined,'segmentFolderId':_0x53e99b},_0x14d9cf=await withSpinner(_0x311e6d(0x119)+_0x1f89aa[_0x311e6d(0x129)]+_0x311e6d(0x123),()=>_0x4bf459[_0x311e6d(0x11a)][_0x311e6d(0x102)](_0x41e303,_0x37f917,_0x1036fc),{'verbose':_0x21eb5e[_0x311e6d(0x10c)]}),_0x316044=_0x14d9cf[_0x311e6d(0x11c)];return console[_0x311e6d(0x12e)](_0x311e6d(0x11d)+_0x316044[_0x311e6d(0x121)]+'\x27'),_0x3836ef!==_0x30610b&&console[_0x311e6d(0x12e)](_0x311e6d(0x126)+_0x3836ef),await handleSDKOutput([_0x316044],_0x21eb5e),0x0;}}
@@ -1 +1 @@
1
- const a31_0x3db5de=a31_0x16f8;(function(_0x401504,_0x376e1d){const _0x314903=a31_0x16f8,_0x54a8af=_0x401504();while(!![]){try{const _0x516ad2=-parseInt(_0x314903(0x1f4))/0x1+parseInt(_0x314903(0x1e9))/0x2*(parseInt(_0x314903(0x206))/0x3)+-parseInt(_0x314903(0x209))/0x4+-parseInt(_0x314903(0x208))/0x5+parseInt(_0x314903(0x219))/0x6*(parseInt(_0x314903(0x20f))/0x7)+-parseInt(_0x314903(0x1ef))/0x8+parseInt(_0x314903(0x1f3))/0x9;if(_0x516ad2===_0x376e1d)break;else _0x54a8af['push'](_0x54a8af['shift']());}catch(_0x875994){_0x54a8af['push'](_0x54a8af['shift']());}}}(a31_0x4f16,0x5691f));import{existsSync,statSync}from'fs';function a31_0x16f8(_0x54fdd8,_0x4dd328){_0x54fdd8=_0x54fdd8-0x1e8;const _0x4f16a5=a31_0x4f16();let _0x16f8a1=_0x4f16a5[_0x54fdd8];return _0x16f8a1;}import a31_0x1b79c0 from'chalk';function a31_0x4f16(){const _0x9df8ba=['error','red','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','folderPath','segmentPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','isDirectory','cyan','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Site:\x20','resolvePathToResource','parentName','Folder\x20ID:\x20','9gzgmwb','Resolved\x20relative\x20path\x20to:\x20','1551360KlkzLH','2298152ArOXvY','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segments','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','length','Resolving\x20path\x20\x27','882JYjLJu','parent_segment','Error:\x20Path\x20is\x20required\x0a','type','green','description','execute','join','segment','log','2262gzdKTC','fullPath','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parentId','✔\x20Context\x20set\x20to:\x20','verbose','session','Examples:','234028cQpiUv','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x27...','segment:use','folderId','split','401264IBZnZF','config','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','10161405zlhOFI','238030zJjlHl','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','dim'];a31_0x4f16=function(){return _0x9df8ba;};return a31_0x4f16();}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_0x3db5de(0x1ec);[a31_0x3db5de(0x214)]=a31_0x3db5de(0x200);async[a31_0x3db5de(0x215)](_0x52afc3){const _0xc71c68=a31_0x3db5de,{options:_0x97d2fe,args:_0xc3f0d2,tdx:_0x238f56}=_0x52afc3;if(_0xc3f0d2['length']===0x0)return console[_0xc71c68(0x1f8)](a31_0x1b79c0[_0xc71c68(0x1f9)](_0xc71c68(0x211))),console[_0xc71c68(0x1f8)](_0xc71c68(0x1f6)),console[_0xc71c68(0x1f8)](_0xc71c68(0x1e8)),console[_0xc71c68(0x1f8)](_0xc71c68(0x20c)),console[_0xc71c68(0x1f8)](_0xc71c68(0x20a)),console[_0xc71c68(0x1f8)](_0xc71c68(0x1f1)),console[_0xc71c68(0x1f8)](_0xc71c68(0x201)),0x1;const _0x2cec0a=_0xc3f0d2[0x0],_0x4d2d82=_0x97d2fe[_0xc71c68(0x21f)];try{if(_0x2cec0a==='/')return saveSessionContext({'segment_path':undefined},_0x4d2d82),console[_0xc71c68(0x218)](a31_0x1b79c0[_0xc71c68(0x213)](_0xc71c68(0x1f2))),0x0;if(existsSync(_0x2cec0a)&&statSync(_0x2cec0a)[_0xc71c68(0x1fe)]()){let _0x3a7126;try{_0x3a7126=findTdxConfig(_0x2cec0a);}catch{return console['error'](a31_0x1b79c0[_0xc71c68(0x1f9)](_0xc71c68(0x21b)+_0x2cec0a)),console[_0xc71c68(0x1f8)](a31_0x1b79c0['cyan'](_0xc71c68(0x1fd))),0x1;}const _0x19177f=_0x3a7126[_0xc71c68(0x1f0)][_0xc71c68(0x210)];return saveSessionContext({'segment_path':_0x19177f,'parent_segment':_0x19177f},_0x4d2d82),console['log'](a31_0x1b79c0[_0xc71c68(0x213)](_0xc71c68(0x21d)+a31_0x1b79c0[_0xc71c68(0x1ff)](_0x19177f))),0x0;}const _0x23851a=_0x97d2fe[_0xc71c68(0x1fc)];let _0xbb4e9=_0x2cec0a;const _0x11766b=parsePath(_0x2cec0a);if(!_0x11766b['isAbsolute']){if(!_0x23851a)return console[_0xc71c68(0x1f8)](a31_0x1b79c0[_0xc71c68(0x1f9)](_0xc71c68(0x1fa))),console[_0xc71c68(0x1f8)](a31_0x1b79c0[_0xc71c68(0x1ff)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x2cec0a==='..'){const _0x12af3f=_0x23851a[_0xc71c68(0x1ee)]('/')['slice'](0x0,-0x1)[_0xc71c68(0x216)]('/');_0xbb4e9=_0x12af3f||'/';}else _0x2cec0a==='.'?_0xbb4e9=_0x23851a:_0xbb4e9=_0x23851a+'/'+_0x2cec0a;_0x97d2fe[_0xc71c68(0x21e)]&&console[_0xc71c68(0x1f8)](_0xc71c68(0x207)+_0xbb4e9);}if(_0xbb4e9==='/'||_0xbb4e9==='')return saveSessionContext({'segment_path':undefined},_0x4d2d82),console[_0xc71c68(0x218)](a31_0x1b79c0['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0xbb4e9=normalizePath(_0xbb4e9);const _0x209dc1=parsePath(_0xbb4e9)[_0xc71c68(0x20b)];if(_0x209dc1[_0xc71c68(0x20d)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4d2d82),console[_0xc71c68(0x218)](a31_0x1b79c0['green'](_0xc71c68(0x1f2))),0x0;_0x97d2fe['verbose']&&(console[_0xc71c68(0x1f8)](_0xc71c68(0x202)+_0x97d2fe['site']),console[_0xc71c68(0x1f8)]('Target\x20path:\x20'+_0xbb4e9));const _0x6ca5f8=await withSpinner(_0xc71c68(0x20e)+_0xbb4e9+_0xc71c68(0x1eb),()=>_0x238f56[_0xc71c68(0x217)][_0xc71c68(0x203)](_0xbb4e9),{'verbose':_0x97d2fe[_0xc71c68(0x21e)]}),_0x4a6d85=_0x6ca5f8['data'];_0x97d2fe[_0xc71c68(0x21e)]&&(console[_0xc71c68(0x1f8)]('Resolved\x20path\x20type:\x20'+_0x4a6d85[_0xc71c68(0x212)]),console['error'](_0xc71c68(0x1f5)+_0x4a6d85[_0xc71c68(0x21c)]),_0x4a6d85[_0xc71c68(0x1ed)]&&console[_0xc71c68(0x1f8)](_0xc71c68(0x205)+_0x4a6d85[_0xc71c68(0x1ed)]));if(_0x4a6d85['type']==='segment')return console[_0xc71c68(0x1f8)](a31_0x1b79c0[_0xc71c68(0x1f9)](_0xc71c68(0x1ea))),console[_0xc71c68(0x1f8)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0xc71c68(0x1f8)](a31_0x1b79c0[_0xc71c68(0x1ff)]('Use:\x20tdx\x20segment\x20use\x20'+_0x4a6d85[_0xc71c68(0x204)]+(_0x4a6d85[_0xc71c68(0x1fb)]?'/'+_0x4a6d85['folderPath'][_0xc71c68(0x216)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x4a6d85[_0xc71c68(0x21a)],'parent_segment':_0x4a6d85[_0xc71c68(0x204)]},_0x4d2d82),console[_0xc71c68(0x218)](a31_0x1b79c0[_0xc71c68(0x213)](_0xc71c68(0x21d)+a31_0x1b79c0[_0xc71c68(0x1ff)](_0x4a6d85['fullPath']))),_0x97d2fe['verbose']&&(console['error'](a31_0x1b79c0[_0xc71c68(0x1f7)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0xc71c68(0x1f8)](a31_0x1b79c0['dim']('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x4db425){throw _0x4db425;}}}
1
+ const a31_0x399110=a31_0x4a18;(function(_0x45e577,_0x8c36f4){const _0x2e2a24=a31_0x4a18,_0x49cc9b=_0x45e577();while(!![]){try{const _0xb193f=-parseInt(_0x2e2a24(0x181))/0x1*(parseInt(_0x2e2a24(0x174))/0x2)+-parseInt(_0x2e2a24(0x17a))/0x3+parseInt(_0x2e2a24(0x176))/0x4+-parseInt(_0x2e2a24(0x16d))/0x5+parseInt(_0x2e2a24(0x18d))/0x6*(-parseInt(_0x2e2a24(0x192))/0x7)+parseInt(_0x2e2a24(0x172))/0x8+-parseInt(_0x2e2a24(0x16c))/0x9*(-parseInt(_0x2e2a24(0x19c))/0xa);if(_0xb193f===_0x8c36f4)break;else _0x49cc9b['push'](_0x49cc9b['shift']());}catch(_0x2a3b2b){_0x49cc9b['push'](_0x49cc9b['shift']());}}}(a31_0x5532,0x2a898));function a31_0x4a18(_0x36166c,_0xd46e55){_0x36166c=_0x36166c-0x166;const _0x55329f=a31_0x5532();let _0x4a183e=_0x55329f[_0x36166c];return _0x4a183e;}import{existsSync,statSync}from'fs';import a31_0xa183de 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';function a31_0x5532(){const _0x47d71=['type','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','description','red','green','folderPath','parent_segment','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','6660sFVIml','segment','Resolved\x20path\x20type:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','error','fullPath','Resolving\x20path\x20\x27','Examples:','verbose','3447CYLKZB','1282290QacRYh','segments','resolvePathToResource','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','1710456vZqdUQ','Site:\x20','4bFRFan','\x27...','1134828EuNmpp','Parent\x20ID:\x20','Use:\x20tdx\x20segment\x20use\x20','cyan','367173RXKfHL','parentId','config','log','✔\x20Context\x20set\x20to:\x20','site','Target\x20path:\x20','86962GlqFpy','isAbsolute','session','data','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','join','dim','length','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','segmentPath','segment:use','Resolved\x20relative\x20path\x20to:\x20','17058PZivwE','execute','split','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','63TyvWna'];a31_0x5532=function(){return _0x47d71;};return a31_0x5532();}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a31_0x399110(0x18b);[a31_0x399110(0x196)]=a31_0x399110(0x195);async[a31_0x399110(0x18e)](_0x4daaec){const _0xd619d3=a31_0x399110,{options:_0x395223,args:_0x309cb8,tdx:_0x4df1c7}=_0x4daaec;if(_0x309cb8[_0xd619d3(0x188)]===0x0)return console[_0xd619d3(0x167)](a31_0xa183de['red']('Error:\x20Path\x20is\x20required\x0a')),console[_0xd619d3(0x167)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0xd619d3(0x16a)),console[_0xd619d3(0x167)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0xd619d3(0x167)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0xd619d3(0x167)](_0xd619d3(0x190)),console[_0xd619d3(0x167)]('\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 _0x35fdf5=_0x309cb8[0x0],_0x22a3a8=_0x395223[_0xd619d3(0x183)];try{if(_0x35fdf5==='/')return saveSessionContext({'segment_path':undefined},_0x22a3a8),console[_0xd619d3(0x17d)](a31_0xa183de[_0xd619d3(0x198)](_0xd619d3(0x170))),0x0;if(existsSync(_0x35fdf5)&&statSync(_0x35fdf5)['isDirectory']()){let _0x49a732;try{_0x49a732=findTdxConfig(_0x35fdf5);}catch{return console[_0xd619d3(0x167)](a31_0xa183de[_0xd619d3(0x197)](_0xd619d3(0x166)+_0x35fdf5)),console[_0xd619d3(0x167)](a31_0xa183de['cyan'](_0xd619d3(0x19b))),0x1;}const _0x283bdf=_0x49a732[_0xd619d3(0x17c)][_0xd619d3(0x19a)];return saveSessionContext({'segment_path':_0x283bdf,'parent_segment':_0x283bdf},_0x22a3a8),console['log'](a31_0xa183de[_0xd619d3(0x198)]('✔\x20Context\x20set\x20to:\x20'+a31_0xa183de[_0xd619d3(0x179)](_0x283bdf))),0x0;}const _0x581954=_0x395223[_0xd619d3(0x18a)];let _0x447dea=_0x35fdf5;const _0x34ca85=parsePath(_0x35fdf5);if(!_0x34ca85[_0xd619d3(0x182)]){if(!_0x581954)return console['error'](a31_0xa183de[_0xd619d3(0x197)](_0xd619d3(0x185))),console['error'](a31_0xa183de[_0xd619d3(0x179)](_0xd619d3(0x171))),0x1;if(_0x35fdf5==='..'){const _0x3a927d=_0x581954[_0xd619d3(0x18f)]('/')['slice'](0x0,-0x1)['join']('/');_0x447dea=_0x3a927d||'/';}else _0x35fdf5==='.'?_0x447dea=_0x581954:_0x447dea=_0x581954+'/'+_0x35fdf5;_0x395223[_0xd619d3(0x16b)]&&console[_0xd619d3(0x167)](_0xd619d3(0x18c)+_0x447dea);}if(_0x447dea==='/'||_0x447dea==='')return saveSessionContext({'segment_path':undefined},_0x22a3a8),console[_0xd619d3(0x17d)](a31_0xa183de[_0xd619d3(0x198)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x447dea=normalizePath(_0x447dea);const _0x3cdcbc=parsePath(_0x447dea)[_0xd619d3(0x16e)];if(_0x3cdcbc['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x22a3a8),console[_0xd619d3(0x17d)](a31_0xa183de[_0xd619d3(0x198)](_0xd619d3(0x170))),0x0;_0x395223[_0xd619d3(0x16b)]&&(console[_0xd619d3(0x167)](_0xd619d3(0x173)+_0x395223[_0xd619d3(0x17f)]),console[_0xd619d3(0x167)](_0xd619d3(0x180)+_0x447dea));const _0x4fe6e7=await withSpinner(_0xd619d3(0x169)+_0x447dea+_0xd619d3(0x175),()=>_0x4df1c7[_0xd619d3(0x19d)][_0xd619d3(0x16f)](_0x447dea),{'verbose':_0x395223[_0xd619d3(0x16b)]}),_0xe93ab3=_0x4fe6e7[_0xd619d3(0x184)];_0x395223[_0xd619d3(0x16b)]&&(console[_0xd619d3(0x167)](_0xd619d3(0x19e)+_0xe93ab3[_0xd619d3(0x193)]),console[_0xd619d3(0x167)](_0xd619d3(0x177)+_0xe93ab3[_0xd619d3(0x17b)]),_0xe93ab3['folderId']&&console[_0xd619d3(0x167)]('Folder\x20ID:\x20'+_0xe93ab3['folderId']));if(_0xe93ab3[_0xd619d3(0x193)]==='segment')return console['error'](a31_0xa183de[_0xd619d3(0x197)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0xd619d3(0x167)](_0xd619d3(0x194)),console[_0xd619d3(0x167)](a31_0xa183de[_0xd619d3(0x179)](_0xd619d3(0x178)+_0xe93ab3['parentName']+(_0xe93ab3[_0xd619d3(0x199)]?'/'+_0xe93ab3['folderPath'][_0xd619d3(0x186)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0xe93ab3[_0xd619d3(0x168)],'parent_segment':_0xe93ab3['parentName']},_0x22a3a8),console[_0xd619d3(0x17d)](a31_0xa183de[_0xd619d3(0x198)](_0xd619d3(0x17e)+a31_0xa183de[_0xd619d3(0x179)](_0xe93ab3[_0xd619d3(0x168)]))),_0x395223[_0xd619d3(0x16b)]&&(console['error'](a31_0xa183de['dim'](_0xd619d3(0x189))),console[_0xd619d3(0x167)](a31_0xa183de[_0xd619d3(0x187)](_0xd619d3(0x191)))),0x0;}catch(_0x31f574){throw _0x31f574;}}}