@treasuredata/tdx 0.16.0 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.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/unset-command.js +1 -1
  41. package/dist/commands/use-command.js +1 -1
  42. package/dist/commands/user-command.js +1 -1
  43. package/dist/commands/workflow-command.js +1 -1
  44. package/dist/core/auth.js +1 -1
  45. package/dist/core/command-output.js +1 -1
  46. package/dist/core/config.js +1 -1
  47. package/dist/core/connection-cache.js +1 -1
  48. package/dist/core/constants.js +1 -1
  49. package/dist/core/credential-cache.js +1 -1
  50. package/dist/core/global-context.js +1 -1
  51. package/dist/core/keychain.js +1 -1
  52. package/dist/core/profile.js +1 -1
  53. package/dist/core/project-config.js +1 -1
  54. package/dist/core/session.js +1 -1
  55. package/dist/core/user-cache.js +1 -1
  56. package/dist/core/version.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/mcp/server.js +1 -1
  59. package/dist/mcp/tools/index.js +1 -1
  60. package/dist/mcp/tools/tdx-run.js +1 -1
  61. package/dist/mcp/tools/tdx-search.js +1 -1
  62. package/dist/mcp/utils.js +1 -1
  63. package/dist/proxy/anthropic-adapter.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/context-signature.js +1 -1
  66. package/dist/proxy/conversation-utils.js +1 -1
  67. package/dist/proxy/passthrough-server.js +1 -1
  68. package/dist/proxy/server.js +1 -1
  69. package/dist/proxy/session-cache.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/api.js +1 -1
  80. package/dist/sdk/claude-agent/claude-agent-client.d.ts +19 -1
  81. package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
  82. package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
  83. package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
  84. package/dist/sdk/claude-agent/environment.js +1 -1
  85. package/dist/sdk/claude-agent/index.js +1 -1
  86. package/dist/sdk/claude-agent/system-prompts.js +1 -1
  87. package/dist/sdk/claude-agent/types.d.ts +26 -0
  88. package/dist/sdk/claude-agent/types.d.ts.map +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/rate-limiter.js +1 -1
  95. package/dist/sdk/client/td-api-client.js +1 -1
  96. package/dist/sdk/client/trino-api-client.js +1 -1
  97. package/dist/sdk/client/workflow-client.js +1 -1
  98. package/dist/sdk/connection-validator.js +1 -1
  99. package/dist/sdk/connection.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-aliases.js +1 -1
  111. package/dist/sdk/llm/model-factors.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/fields-display.js +1 -1
  116. package/dist/sdk/segment/file-discovery.js +1 -1
  117. package/dist/sdk/segment/journey-utils.js +1 -1
  118. package/dist/sdk/segment/journey-yaml.js +1 -1
  119. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  120. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  121. package/dist/sdk/segment/pull-workflow.js +1 -1
  122. package/dist/sdk/segment/push-workflow.js +1 -1
  123. package/dist/sdk/segment/resolution-context.js +1 -1
  124. package/dist/sdk/segment/segment-path-parser.js +1 -1
  125. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  126. package/dist/sdk/segment/target-resolution.js +1 -1
  127. package/dist/sdk/segment/tdx-config.js +1 -1
  128. package/dist/sdk/segment/validate-files.js +1 -1
  129. package/dist/sdk/segment/yaml-validator.js +1 -1
  130. package/dist/sdk/segment.js +1 -1
  131. package/dist/sdk/types/index.js +1 -1
  132. package/dist/sdk/types/progress.js +1 -1
  133. package/dist/sdk/user.js +1 -1
  134. package/dist/sdk/util/format-detector.js +1 -1
  135. package/dist/sdk/util/formatters.js +1 -1
  136. package/dist/sdk/util/index.js +1 -1
  137. package/dist/sdk/util/tree-formatter.js +1 -1
  138. package/dist/sdk/workflow/clone-workflow.js +1 -1
  139. package/dist/sdk/workflow/index.js +1 -1
  140. package/dist/sdk/workflow/pull-workflow.js +1 -1
  141. package/dist/sdk/workflow/push-workflow.js +1 -1
  142. package/dist/sdk/workflow/tdx-config.js +1 -1
  143. package/dist/sdk/workflow/workflow-utils.js +1 -1
  144. package/dist/utils/async.js +1 -1
  145. package/dist/utils/colors.js +1 -1
  146. package/dist/utils/diff.js +1 -1
  147. package/dist/utils/file-permissions.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/option-validation.js +1 -1
  150. package/dist/utils/port.js +1 -1
  151. package/dist/utils/process.js +1 -1
  152. package/dist/utils/prompt.js +1 -1
  153. package/dist/utils/spinner.js +1 -1
  154. package/dist/utils/sse-parser.js +1 -1
  155. package/dist/utils/string-utils.js +1 -1
  156. package/dist/utils/table-ref-parser.js +1 -1
  157. package/dist/utils/tdx-logger.js +1 -1
  158. package/dist/utils/version-check.js +1 -1
  159. package/package.json +1 -1
@@ -1 +1 @@
1
- const a27_0x20032a=a27_0x4c46;(function(_0x298f50,_0x2c4439){const _0x3f6f8b=a27_0x4c46,_0x46cc70=_0x298f50();while(!![]){try{const _0x5d4151=parseInt(_0x3f6f8b(0x117))/0x1*(-parseInt(_0x3f6f8b(0x1a8))/0x2)+parseInt(_0x3f6f8b(0x185))/0x3*(-parseInt(_0x3f6f8b(0x198))/0x4)+parseInt(_0x3f6f8b(0x12f))/0x5+-parseInt(_0x3f6f8b(0x171))/0x6*(-parseInt(_0x3f6f8b(0x167))/0x7)+parseInt(_0x3f6f8b(0x134))/0x8+-parseInt(_0x3f6f8b(0x13d))/0x9*(-parseInt(_0x3f6f8b(0x15f))/0xa)+-parseInt(_0x3f6f8b(0x1a9))/0xb;if(_0x5d4151===_0x2c4439)break;else _0x46cc70['push'](_0x46cc70['shift']());}catch(_0x5e48c0){_0x46cc70['push'](_0x46cc70['shift']());}}}(a27_0x5a84,0x44058));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 a27_0x2b8c2b from'chalk';async function resolveSegmentTarget(_0x3a3940,_0x34858b,_0x4cd114){const _0x4bbe2f=a27_0x4c46;if(isYamlFilePath(_0x3a3940))try{const _0x6bc3f8=await resolveYamlFilePath(_0x3a3940);return _0x4cd114&&(console[_0x4bbe2f(0x128)](_0x4bbe2f(0x16a)+_0x3a3940),console[_0x4bbe2f(0x128)](_0x4bbe2f(0x1b1)+_0x6bc3f8[_0x4bbe2f(0x187)]),console[_0x4bbe2f(0x128)](_0x4bbe2f(0x10f)+_0x6bc3f8['segmentName']),console[_0x4bbe2f(0x128)](_0x4bbe2f(0x15b)+(_0x6bc3f8[_0x4bbe2f(0x180)]||_0x4bbe2f(0x178))),console[_0x4bbe2f(0x128)]('\x20\x20Full\x20path:\x20'+_0x6bc3f8['fullPath'])),_0x6bc3f8[_0x4bbe2f(0x118)];}catch(_0x431304){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x431304[_0x4bbe2f(0x12d)]);}if(!_0x34858b)throw new SDKError(ErrorCode[_0x4bbe2f(0x13a)],_0x4bbe2f(0x168));return _0x34858b+'/'+_0x3a3940;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x20032a(0x18a)]='segment:describe';[a27_0x20032a(0x142)]=a27_0x20032a(0x194);async[a27_0x20032a(0x152)](_0xd00cf8){const _0x3acd8f=a27_0x20032a,{options:_0x3b7add,args:_0x2a32c1,tdx:_0x1316fb}=_0xd00cf8,_0x5d61d9=_0x2a32c1[0x0],_0xfc8b92=!_0x5d61d9&&!!_0x3b7add[_0x3acd8f(0x187)],_0x52fcf1=_0x5d61d9||_0x3b7add['parentSegment'];if(!_0x52fcf1)return console[_0x3acd8f(0x128)](_0x3acd8f(0x197)),console['error'](_0x3acd8f(0x163)),console[_0x3acd8f(0x128)](_0x3acd8f(0x193)),console[_0x3acd8f(0x128)](_0x3acd8f(0x190)),console[_0x3acd8f(0x128)](_0x3acd8f(0x14f)),console['error'](_0x3acd8f(0x11e)),console[_0x3acd8f(0x128)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x13a81d=_0x3b7add['segmentPath'];let _0x38de79=_0x52fcf1;!_0xfc8b92&&_0x13a81d&&!_0x52fcf1[_0x3acd8f(0x1ac)]('/')&&(_0x38de79=_0x13a81d+'/'+_0x52fcf1,_0x3b7add['verbose']&&console[_0x3acd8f(0x128)]('Resolved\x20relative\x20path\x20to:\x20'+_0x38de79));const _0x5f2b32=await withSpinner('Resolving\x20path\x20\x27'+_0x38de79+'\x27...',()=>_0x1316fb[_0x3acd8f(0x19a)][_0x3acd8f(0x119)](_0x38de79),{'verbose':_0x3b7add['verbose']}),_0x19fe04=_0x5f2b32[_0x3acd8f(0x188)];_0x3b7add['verbose']&&(console[_0x3acd8f(0x128)](_0x3acd8f(0x16d)+_0x19fe04[_0x3acd8f(0x116)]),console['error'](_0x3acd8f(0x11a)+_0x19fe04['parentId']),_0x19fe04[_0x3acd8f(0x13f)]&&console[_0x3acd8f(0x128)]('Folder\x20ID:\x20'+_0x19fe04[_0x3acd8f(0x13f)]),_0x19fe04['segmentId']&&console['error'](_0x3acd8f(0x150)+_0x19fe04[_0x3acd8f(0x192)]));if(_0x19fe04[_0x3acd8f(0x116)]===_0x3acd8f(0x113)){const _0x336021=await withSpinner(_0x3acd8f(0x114),()=>_0x1316fb[_0x3acd8f(0x19a)][_0x3acd8f(0x15d)](_0x19fe04[_0x3acd8f(0x1a1)]),{'verbose':_0x3b7add[_0x3acd8f(0x149)]});await handleSingleObjectOutput(_0x336021['data'],_0x3b7add);}else{if(_0x19fe04[_0x3acd8f(0x116)]===_0x3acd8f(0x17e)){if(!_0x19fe04[_0x3acd8f(0x13f)])throw new SDKError(ErrorCode[_0x3acd8f(0x15c)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1dbc9c=await withSpinner(_0x3acd8f(0x1b2),()=>_0x1316fb[_0x3acd8f(0x19a)][_0x3acd8f(0x1a3)](_0x19fe04['folderId']),{'verbose':_0x3b7add[_0x3acd8f(0x149)]});await handleSingleObjectOutput(_0x1dbc9c[_0x3acd8f(0x188)],_0x3b7add);}else{if(_0x19fe04[_0x3acd8f(0x116)]===_0x3acd8f(0x19a)){if(!_0x19fe04[_0x3acd8f(0x192)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3acd8f(0x189));const _0x24125e=await withSpinner(_0x3acd8f(0x17d),()=>_0x1316fb[_0x3acd8f(0x19a)]['getSegment'](_0x19fe04['parentId'],_0x19fe04[_0x3acd8f(0x192)]),{'verbose':_0x3b7add['verbose']});await handleSingleObjectOutput(_0x24125e[_0x3acd8f(0x188)],_0x3b7add);}}}return 0x0;}catch(_0x310c6d){if(_0x310c6d instanceof SDKError)return console[_0x3acd8f(0x128)](_0x3acd8f(0x148)+_0x310c6d['message']),_0x310c6d[_0x3acd8f(0x160)]&&console['error'](_0x3acd8f(0x174)+_0x310c6d[_0x3acd8f(0x160)]),0x1;throw _0x310c6d;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x182);[a27_0x20032a(0x142)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x20032a(0x152)](_0x42e1f7){const _0x2b50bf=a27_0x20032a,{options:_0x586241,args:_0x53350c,tdx:_0x44e579}=_0x42e1f7,_0x440d28=_0x53350c[0x0];if(!_0x440d28)return console['error'](_0x2b50bf(0x144)),console[_0x2b50bf(0x128)](_0x2b50bf(0x18d)),console['error'](_0x2b50bf(0x14e)),console[_0x2b50bf(0x128)]('Examples:'),console[_0x2b50bf(0x128)](_0x2b50bf(0x136)),console[_0x2b50bf(0x128)](_0x2b50bf(0x19c)),0x1;try{const _0x39bda5=_0x586241['parentSegment'],_0x35a343=await resolveSegmentTarget(_0x440d28,_0x39bda5,_0x586241[_0x2b50bf(0x149)]);_0x586241[_0x2b50bf(0x149)]&&console[_0x2b50bf(0x128)](_0x2b50bf(0x184)+_0x35a343);const _0x102c1d=await withSpinner(_0x2b50bf(0x111)+_0x440d28+'\x27...',()=>_0x44e579[_0x2b50bf(0x19a)][_0x2b50bf(0x119)](_0x35a343),{'verbose':_0x586241[_0x2b50bf(0x149)]}),_0x5a53cd=_0x102c1d['data'];_0x586241[_0x2b50bf(0x149)]&&(console[_0x2b50bf(0x128)](_0x2b50bf(0x16d)+_0x5a53cd[_0x2b50bf(0x116)]),console[_0x2b50bf(0x128)](_0x2b50bf(0x11a)+_0x5a53cd[_0x2b50bf(0x1a1)]));if(_0x5a53cd[_0x2b50bf(0x116)]===_0x2b50bf(0x17e))return console[_0x2b50bf(0x128)](_0x2b50bf(0x19f)),console[_0x2b50bf(0x128)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x5a53cd[_0x2b50bf(0x116)]===_0x2b50bf(0x113))return console['error'](_0x2b50bf(0x17a)),console['error'](_0x2b50bf(0x161)),0x1;if(!_0x5a53cd[_0x2b50bf(0x192)])throw new SDKError(ErrorCode[_0x2b50bf(0x191)],_0x2b50bf(0x189));const _0x3bd532=await withSpinner(_0x2b50bf(0x131),()=>_0x44e579['segment']['getSegmentSQL'](_0x5a53cd[_0x2b50bf(0x1a1)],_0x5a53cd[_0x2b50bf(0x192)]),{'verbose':_0x586241[_0x2b50bf(0x149)]});let _0x2c2d34=_0x3bd532[_0x2b50bf(0x188)];const _0x339d72=resolveLimit(_0x586241[_0x2b50bf(0x173)],DEFAULT_DISPLAY_LIMIT),_0x436f1b=/\bLIMIT\s+\d+/i[_0x2b50bf(0x1ad)](_0x2c2d34);!_0x436f1b&&(_0x2c2d34=_0x2c2d34[_0x2b50bf(0x133)]()[_0x2b50bf(0x129)](/;+$/,''),_0x2c2d34='SELECT\x20*\x20FROM\x20(\x0a'+_0x2c2d34+_0x2b50bf(0x186)+_0x339d72);_0x586241['verbose']&&console[_0x2b50bf(0x128)](_0x2b50bf(0x13c)+_0x2c2d34);const _0x1155e1=await withProgressSpinner(_0x2b50bf(0x19b),async _0x342b68=>{const _0x2177f3=_0x2b50bf,_0x3bb2f4=await _0x44e579[_0x2177f3(0x14a)][_0x2177f3(0x152)](_0x2c2d34,{'catalog':'td','schema':_0x2177f3(0x175),'onJobId':_0x58302a=>{_0x342b68['setJobId'](_0x58302a);}});return _0x3bb2f4;},{'verbose':_0x586241['verbose']}),_0x2710e0=_0x1155e1[_0x2b50bf(0x188)],_0x171b08=_0x2710e0['jobId']?_0x2b50bf(0x132)+_0x2710e0[_0x2b50bf(0x12c)]+']':'';return console[_0x2b50bf(0x128)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x2710e0[_0x2b50bf(0x165)][_0x2b50bf(0x127)][_0x2b50bf(0x151)]()+'\x20rows\x20'+(_0x2b50bf(0x1af)+formatElapsed(_0x2710e0['stats']['elapsedTimeMillis'])+_0x171b08)),await handleQueryOutput(_0x2710e0,_0x586241),0x0;}catch(_0x4b4cff){if(_0x4b4cff instanceof SDKError)return console[_0x2b50bf(0x128)](_0x2b50bf(0x17c)+_0x4b4cff[_0x2b50bf(0x11c)]+']'),console[_0x2b50bf(0x128)]('\x0a'+_0x4b4cff['message']),0x1;throw _0x4b4cff;}}}function a27_0x4c46(_0x2108e9,_0xf0b27c){_0x2108e9=_0x2108e9-0x10f;const _0x5a844b=a27_0x5a84();let _0x4c460a=_0x5a844b[_0x2108e9];return _0x4c460a;}export class SegmentFolderListCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x120);[a27_0x20032a(0x142)]=a27_0x20032a(0x19d);async[a27_0x20032a(0x152)](_0x1ce214){const _0x25c8f7=a27_0x20032a,{options:_0x329dcd,args:_0x4b08a0,tdx:_0x4567a0}=_0x1ce214;if(_0x4b08a0[_0x25c8f7(0x157)]===0x0)return console[_0x25c8f7(0x128)](_0x25c8f7(0x110)),console[_0x25c8f7(0x128)](_0x25c8f7(0x115)),0x1;const _0x5ef3ce=_0x4b08a0[0x0];try{_0x329dcd[_0x25c8f7(0x149)]&&(console['error'](_0x25c8f7(0x1aa)+_0x329dcd[_0x25c8f7(0x181)]),console[_0x25c8f7(0x128)](_0x25c8f7(0x170)+_0x5ef3ce));const _0x48d345=await withSpinner(_0x25c8f7(0x16e)+_0x5ef3ce+_0x25c8f7(0x14c),()=>_0x4567a0['segment']['resolveParentId'](_0x5ef3ce),{'verbose':_0x329dcd['verbose']}),_0x13b54c=_0x48d345[_0x25c8f7(0x188)];_0x329dcd[_0x25c8f7(0x149)]&&console[_0x25c8f7(0x128)](_0x25c8f7(0x140)+_0x13b54c);const _0x32454c=await withSpinner(_0x25c8f7(0x12a)+_0x5ef3ce+_0x25c8f7(0x14c),()=>_0x4567a0[_0x25c8f7(0x19a)][_0x25c8f7(0x18c)](_0x13b54c),{'verbose':_0x329dcd[_0x25c8f7(0x149)]}),_0x1c182b=_0x32454c['data'];return console[_0x25c8f7(0x128)](_0x25c8f7(0x1a6)+_0x1c182b[_0x25c8f7(0x157)]+_0x25c8f7(0x123)+(_0x1c182b[_0x25c8f7(0x157)]!==0x1?'s':'')),await handleSDKOutput(_0x1c182b,_0x329dcd),0x0;}catch(_0x5dbd17){if(_0x5dbd17 instanceof SDKError)return console[_0x25c8f7(0x128)]('Error:\x20'+_0x5dbd17[_0x25c8f7(0x12d)]),_0x5dbd17[_0x25c8f7(0x160)]&&console[_0x25c8f7(0x128)]('\x20\x20Cause:\x20'+_0x5dbd17['cause']),0x1;throw _0x5dbd17;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x143);['description']=a27_0x20032a(0x138);async['execute'](_0x59d29c){const _0x1ab85d=a27_0x20032a,{options:_0x2f16d5,args:_0x56e909,tdx:_0x1a0867}=_0x59d29c;if(_0x56e909['length']===0x0)return console[_0x1ab85d(0x128)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x1ab85d(0x128)](_0x1ab85d(0x158)),0x1;try{const {parentId:_0x48bf28,childId:_0x587b2a}=parseSegmentRef(_0x56e909[0x0]);_0x2f16d5[_0x1ab85d(0x149)]&&(console['error']('Site:\x20'+_0x2f16d5['site']),console[_0x1ab85d(0x128)](_0x1ab85d(0x170)+_0x48bf28),_0x587b2a&&console[_0x1ab85d(0x128)](_0x1ab85d(0x141)+_0x587b2a));if(!_0x587b2a)return console[_0x1ab85d(0x128)](_0x1ab85d(0x1a5)),0x1;const _0x163f3f=await withSpinner(_0x1ab85d(0x16e)+_0x48bf28+_0x1ab85d(0x14c),()=>_0x1a0867[_0x1ab85d(0x19a)]['resolveParentId'](_0x48bf28),{'verbose':_0x2f16d5[_0x1ab85d(0x149)]}),_0x1afb48=_0x163f3f['data'];_0x2f16d5[_0x1ab85d(0x149)]&&console[_0x1ab85d(0x128)](_0x1ab85d(0x140)+_0x1afb48);const _0x3c3663=await withSpinner('Resolving\x20folder\x20\x27'+_0x587b2a+_0x1ab85d(0x14c),()=>_0x1a0867[_0x1ab85d(0x19a)][_0x1ab85d(0x155)](_0x1afb48,_0x587b2a),{'verbose':_0x2f16d5[_0x1ab85d(0x149)]}),_0x1da18c=_0x3c3663[_0x1ab85d(0x188)];_0x2f16d5[_0x1ab85d(0x149)]&&console[_0x1ab85d(0x128)](_0x1ab85d(0x1a4)+_0x1da18c);const _0x1e935e=await withSpinner('Fetching\x20folder\x20\x27'+_0x587b2a+'\x27...',()=>_0x1a0867[_0x1ab85d(0x19a)]['getFolder'](_0x1da18c),{'verbose':_0x2f16d5[_0x1ab85d(0x149)]});return await handleSDKOutput([_0x1e935e[_0x1ab85d(0x188)]],_0x2f16d5),0x0;}catch(_0x3afdb5){if(_0x3afdb5 instanceof SDKError)return console[_0x1ab85d(0x128)](_0x1ab85d(0x148)+_0x3afdb5[_0x1ab85d(0x12d)]),_0x3afdb5['cause']&&console[_0x1ab85d(0x128)](_0x1ab85d(0x174)+_0x3afdb5[_0x1ab85d(0x160)]),0x1;throw _0x3afdb5;}}}function a27_0x5a84(){const _0x14c0ba=['trim','2684472ZicYGk','✔\x20Created\x20folder\x20\x27','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Show\x20segment\x20folder\x20details','format','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','SQL\x20query:\x0a','513VjcrrP','createFolder','folderId','Resolved\x20parent\x20ID:\x20','Folder\x20name:\x20','description','segment:folder:show','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','web','Create\x20segment\x20folder\x20for\x20organization','Get\x20SQL\x20query\x20for\x20child\x20segment','Error:\x20','verbose','query','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x27...','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Segment\x20ID:\x20','toLocaleString','execute','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','resolveFolderId','segment:desc','length','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Use:\x20tdx\x20ps\x20view','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20Folder\x20path:\x20','SEGMENT_FOLDER_NOT_FOUND','getParent','Options:','15130YyiRtN','cause','Use:\x20tdx\x20ps\x20show','segment:folder:create','Usage:\x20tdx\x20segment\x20describe\x20<path>','Show\x20folder\x20or\x20child\x20segment\x20details','stats','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','14693zNaEIm','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','jsonl','Resolved\x20YAML\x20file:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','log','Resolved\x20type:\x20','Resolving\x20parent\x20segment\x20\x27','Use:\x20tdx\x20ps\x20view\x20-w','Parent\x20name:\x20','642uXSPWB','getSegmentSQL','limit','\x20\x20Cause:\x20','information_schema','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','(root)','Parent\x20segment:\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','✖\x20Query\x20failed\x20[','Fetching\x20segment\x20details...','folder','Folder\x20ID:\x20','folderPath','site','segment:show','Usage:\x20tdx\x20sg\x20desc\x20<name>','Target\x20path:\x20','3mmHcge','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','parentSegment','data','Segment\x20ID\x20missing\x20from\x20resolved\x20path','name','url','listFolders','Usage:\x20tdx\x20sg\x20show\x20<name>','segment:sql','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','SEGMENT_NOT_FOUND','segmentId','Examples:','Show\x20segment\x20or\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Error:\x20Path\x20or\x20name\x20is\x20required','1463108krVavu','segment:view','segment','Executing\x20segment\x20query...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','green','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Use:\x20tdx\x20ps\x20sql','parentId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','getFolder','Resolved\x20folder\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','✔\x20Found\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','21458cJaoWi','3572789qVaNfY','Site:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','includes','test','/e/','in\x20','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20Parent\x20segment:\x20','Fetching\x20folder\x20details...','\x20\x20Segment\x20name:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolving\x20\x27','getSegment','parent','Fetching\x20parent\x20segment\x20details...','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','type','3mwSgLT','fullPath','resolvePathToResource','Parent\x20ID:\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','code','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','segment:folder:list','parentFolder','\x20Opening\x20','\x20folder','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Creating\x20folder\x20\x27','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','processedRows','error','replace','Listing\x20folders\x20for\x20parent\x20\x27','/app/ps/','jobId','message','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','1774930fKwOLP','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Fetching\x20SQL\x20for\x20segment...','\x20[Job\x20ID:\x20'];a27_0x5a84=function(){return _0x14c0ba;};return a27_0x5a84();}export class SegmentSQLCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x18e);[a27_0x20032a(0x142)]=a27_0x20032a(0x147);async[a27_0x20032a(0x152)](_0x4c2fed){const _0x15cb29=a27_0x20032a,{options:_0x2728c4,args:_0x314284,tdx:_0x448938}=_0x4c2fed,_0x5dab37=_0x314284[0x0];if(!_0x5dab37)return console[_0x15cb29(0x128)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x15cb29(0x128)](_0x15cb29(0x11b)),console[_0x15cb29(0x128)](_0x15cb29(0x195)),console[_0x15cb29(0x128)](_0x15cb29(0x193)),console[_0x15cb29(0x128)](_0x15cb29(0x13b)),console[_0x15cb29(0x128)](_0x15cb29(0x14d)),0x1;try{const _0x2604a4=_0x2728c4['parentSegment'],_0x1a1f57=await resolveSegmentTarget(_0x5dab37,_0x2604a4,_0x2728c4[_0x15cb29(0x149)]);_0x2728c4['verbose']&&console[_0x15cb29(0x128)](_0x15cb29(0x184)+_0x1a1f57);const _0x3f1203=await withSpinner(_0x15cb29(0x111)+_0x5dab37+_0x15cb29(0x14c),()=>_0x448938[_0x15cb29(0x19a)]['resolvePathToResource'](_0x1a1f57),{'verbose':_0x2728c4[_0x15cb29(0x149)]}),_0x495cf6=_0x3f1203[_0x15cb29(0x188)];_0x2728c4[_0x15cb29(0x149)]&&(console[_0x15cb29(0x128)]('Resolved\x20type:\x20'+_0x495cf6[_0x15cb29(0x116)]),console[_0x15cb29(0x128)](_0x15cb29(0x11a)+_0x495cf6['parentId']));if(_0x495cf6[_0x15cb29(0x116)]===_0x15cb29(0x17e))return console[_0x15cb29(0x128)](_0x15cb29(0x1ab)),console[_0x15cb29(0x128)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x495cf6[_0x15cb29(0x116)]===_0x15cb29(0x113))return console[_0x15cb29(0x128)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x15cb29(0x128)](_0x15cb29(0x1a0)),0x1;if(!_0x495cf6[_0x15cb29(0x192)])throw new SDKError(ErrorCode[_0x15cb29(0x191)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x505d41=await withSpinner(_0x15cb29(0x131),()=>_0x448938[_0x15cb29(0x19a)][_0x15cb29(0x172)](_0x495cf6[_0x15cb29(0x1a1)],_0x495cf6[_0x15cb29(0x192)]),{'verbose':_0x2728c4['verbose']}),_0x1ff5da=_0x505d41[_0x15cb29(0x188)];return _0x2728c4[_0x15cb29(0x139)]==='json'||_0x2728c4[_0x15cb29(0x139)]===_0x15cb29(0x169)?await handleSDKOutput([{'sql':_0x1ff5da}],_0x2728c4):console[_0x15cb29(0x16c)](_0x1ff5da),0x0;}catch(_0x20dd3f){if(_0x20dd3f instanceof SDKError)return console[_0x15cb29(0x128)](_0x15cb29(0x148)+_0x20dd3f[_0x15cb29(0x12d)]),_0x20dd3f[_0x15cb29(0x160)]&&console[_0x15cb29(0x128)]('\x20\x20Cause:\x20'+_0x20dd3f[_0x15cb29(0x160)]),0x1;throw _0x20dd3f;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x162);['description']=a27_0x20032a(0x146);async[a27_0x20032a(0x152)](_0x25e30a){const _0x75a921=a27_0x20032a,{options:_0x128f05,args:_0x5db66a,tdx:_0x461d48}=_0x25e30a,_0x2c733d=_0x128f05;if(_0x5db66a[_0x75a921(0x157)]<0x2)return console[_0x75a921(0x128)](_0x75a921(0x176)),console[_0x75a921(0x128)](_0x75a921(0x177)),0x1;const _0x11877a=_0x5db66a[0x0],_0x5e76bf=_0x5db66a[0x1];_0x2c733d[_0x75a921(0x149)]&&(console[_0x75a921(0x128)](_0x75a921(0x1aa)+_0x2c733d['site']),console['error'](_0x75a921(0x179)+_0x11877a),console[_0x75a921(0x128)](_0x75a921(0x141)+_0x5e76bf));let _0x3b1bf5;if(_0x2c733d[_0x75a921(0x121)]){const _0x34af4d=_0x2c733d['parentFolder'],_0x34712d=await withSpinner(_0x75a921(0x16e)+_0x11877a+_0x75a921(0x14c),()=>_0x461d48[_0x75a921(0x19a)][_0x75a921(0x153)](_0x11877a),{'verbose':_0x2c733d[_0x75a921(0x149)]}),_0x592ba4=_0x34712d[_0x75a921(0x188)],_0x571a93=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x34af4d+_0x75a921(0x14c),()=>_0x461d48['segment'][_0x75a921(0x155)](_0x592ba4,_0x34af4d),{'verbose':_0x2c733d['verbose']});_0x3b1bf5=_0x571a93[_0x75a921(0x188)],_0x2c733d['verbose']&&console[_0x75a921(0x128)](_0x75a921(0x1b0)+_0x3b1bf5);}const _0x1bb29d={'name':_0x5e76bf,'description':_0x2c733d[_0x75a921(0x142)],'parentFolderId':_0x3b1bf5},_0xb4d302=await withSpinner(_0x75a921(0x125)+_0x5e76bf+'\x27...',()=>_0x461d48[_0x75a921(0x19a)][_0x75a921(0x13e)](_0x11877a,_0x1bb29d),{'verbose':_0x2c733d[_0x75a921(0x149)]}),_0x1224e0=_0xb4d302[_0x75a921(0x188)];return console[_0x75a921(0x128)](_0x75a921(0x135)+_0x1224e0[_0x75a921(0x18a)]+'\x27\x20with\x20ID:\x20'+_0x1224e0['id']),await handleSDKOutput([_0x1224e0],_0x2c733d),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x20032a(0x18a)]=a27_0x20032a(0x199);[a27_0x20032a(0x142)]=a27_0x20032a(0x164);async[a27_0x20032a(0x152)](_0x366d2c){const _0x165520=a27_0x20032a,{options:_0x1095c4,args:_0x6d64cd,tdx:_0x447e16}=_0x366d2c,_0x10427a=_0x6d64cd[0x0];if(!_0x10427a)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x165520(0x128)](_0x165520(0x137)),console[_0x165520(0x128)](_0x165520(0x11d)),console[_0x165520(0x128)](_0x165520(0x15e)),console[_0x165520(0x128)](_0x165520(0x16b)),console[_0x165520(0x128)](_0x165520(0x193)),console[_0x165520(0x128)](_0x165520(0x11f)),console[_0x165520(0x128)](_0x165520(0x14b)),console[_0x165520(0x128)](_0x165520(0x124)),console['error']('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x28140e=_0x1095c4[_0x165520(0x187)],_0x454725=await resolveSegmentTarget(_0x10427a,_0x28140e,_0x1095c4[_0x165520(0x149)]);_0x1095c4['verbose']&&console[_0x165520(0x128)](_0x165520(0x184)+_0x454725);const _0x510e54=await withSpinner(_0x165520(0x111)+_0x10427a+_0x165520(0x14c),()=>_0x447e16[_0x165520(0x19a)]['resolvePathToResource'](_0x454725),{'verbose':_0x1095c4[_0x165520(0x149)]}),_0x5092d1=_0x510e54[_0x165520(0x188)];_0x1095c4['verbose']&&(console[_0x165520(0x128)]('Resolved\x20type:\x20'+_0x5092d1['type']),console[_0x165520(0x128)](_0x165520(0x11a)+_0x5092d1[_0x165520(0x1a1)]),_0x5092d1[_0x165520(0x13f)]&&console[_0x165520(0x128)](_0x165520(0x17f)+_0x5092d1[_0x165520(0x13f)]),_0x5092d1[_0x165520(0x192)]&&console['error'](_0x165520(0x150)+_0x5092d1[_0x165520(0x192)]));if(_0x1095c4[_0x165520(0x145)]){if(_0x5092d1[_0x165520(0x116)]===_0x165520(0x17e))return console[_0x165520(0x128)](_0x165520(0x196)),0x1;if(_0x5092d1[_0x165520(0x116)]===_0x165520(0x113))return console[_0x165520(0x128)](_0x165520(0x17b)),console['error'](_0x165520(0x16f)),0x1;if(!_0x5092d1[_0x165520(0x192)])throw new SDKError(ErrorCode[_0x165520(0x191)],_0x165520(0x189));const _0x1741a8=getConsoleNextUrl(_0x1095c4[_0x165520(0x181)],_0x165520(0x12b)+_0x5092d1[_0x165520(0x1a1)]+_0x165520(0x1ae)+_0x5092d1[_0x165520(0x192)]);return console[_0x165520(0x128)](a27_0x2b8c2b[_0x165520(0x19e)]('✔')+_0x165520(0x122)+a27_0x2b8c2b['cyan'](_0x1741a8)),openBrowser(_0x1741a8),0x0;}if(_0x5092d1[_0x165520(0x116)]===_0x165520(0x17e)){if(!_0x5092d1[_0x165520(0x13f)])throw new SDKError(ErrorCode[_0x165520(0x15c)],_0x165520(0x1a7));const _0xa64f7f=await withSpinner(_0x165520(0x1b2),()=>_0x447e16[_0x165520(0x19a)][_0x165520(0x1a3)](_0x5092d1[_0x165520(0x13f)]),{'verbose':_0x1095c4[_0x165520(0x149)]});await handleSingleObjectOutput(_0xa64f7f[_0x165520(0x188)],_0x1095c4);}else{if(_0x5092d1[_0x165520(0x116)]===_0x165520(0x19a)){if(!_0x5092d1[_0x165520(0x192)])throw new SDKError(ErrorCode[_0x165520(0x191)],_0x165520(0x189));const _0x4e7df9=await withSpinner('Fetching\x20segment\x20details...',()=>_0x447e16[_0x165520(0x19a)][_0x165520(0x112)](_0x5092d1['parentId'],_0x5092d1['segmentId']),{'verbose':_0x1095c4[_0x165520(0x149)]}),_0x53ec71=getConsoleNextUrl(_0x1095c4['site'],_0x165520(0x12b)+_0x5092d1[_0x165520(0x1a1)]+'/e/'+_0x5092d1[_0x165520(0x192)]),_0x49afa2=_0x4e7df9[_0x165520(0x188)];_0x49afa2[_0x165520(0x18b)]=_0x53ec71,await handleSingleObjectOutput(_0x49afa2,_0x1095c4);}else return console[_0x165520(0x128)](_0x165520(0x126)),console[_0x165520(0x128)](_0x165520(0x159)),0x1;}return 0x0;}catch(_0x29b11a){if(_0x29b11a instanceof SDKError)return console[_0x165520(0x128)](_0x165520(0x148)+_0x29b11a[_0x165520(0x12d)]),_0x29b11a['cause']&&console[_0x165520(0x128)](_0x165520(0x174)+_0x29b11a[_0x165520(0x160)]),0x1;throw _0x29b11a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a27_0x20032a(0x156);[a27_0x20032a(0x142)]=a27_0x20032a(0x18f);async[a27_0x20032a(0x152)](_0x1ba060){const _0x51adf4=a27_0x20032a,{options:_0x2215e8,args:_0x42a291,tdx:_0x15221f}=_0x1ba060,_0x24ed86=_0x42a291[0x0];if(!_0x24ed86)return console['error'](_0x51adf4(0x144)),console['error'](_0x51adf4(0x183)),console[_0x51adf4(0x128)](_0x51adf4(0x154)),console[_0x51adf4(0x128)](_0x51adf4(0x193)),console[_0x51adf4(0x128)](_0x51adf4(0x15a)),console['error'](_0x51adf4(0x130)),0x1;try{const _0x19b460=_0x2215e8[_0x51adf4(0x187)],_0x27a710=await resolveSegmentTarget(_0x24ed86,_0x19b460,_0x2215e8['verbose']);_0x2215e8[_0x51adf4(0x149)]&&console[_0x51adf4(0x128)]('Target\x20path:\x20'+_0x27a710);const _0xbb9adb=await withSpinner('Resolving\x20\x27'+_0x24ed86+_0x51adf4(0x14c),()=>_0x15221f[_0x51adf4(0x19a)][_0x51adf4(0x119)](_0x27a710),{'verbose':_0x2215e8[_0x51adf4(0x149)]}),_0x28d337=_0xbb9adb[_0x51adf4(0x188)];_0x2215e8[_0x51adf4(0x149)]&&(console['error']('Resolved\x20type:\x20'+_0x28d337[_0x51adf4(0x116)]),console['error']('Parent\x20ID:\x20'+_0x28d337['parentId']));if(_0x28d337[_0x51adf4(0x116)]===_0x51adf4(0x17e))return console[_0x51adf4(0x128)](_0x51adf4(0x166)),console[_0x51adf4(0x128)](_0x51adf4(0x12e)),0x1;if(_0x28d337[_0x51adf4(0x116)]===_0x51adf4(0x113))return console['error'](_0x51adf4(0x1a2)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x28d337['segmentId'])throw new SDKError(ErrorCode[_0x51adf4(0x191)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1f389a=await withSpinner(_0x51adf4(0x131),()=>_0x15221f[_0x51adf4(0x19a)][_0x51adf4(0x172)](_0x28d337[_0x51adf4(0x1a1)],_0x28d337[_0x51adf4(0x192)]),{'verbose':_0x2215e8['verbose']}),_0x5b1b6b=_0x1f389a[_0x51adf4(0x188)],_0x17cf30=await executeSchemaQuery(_0x5b1b6b,_0x15221f,_0x2215e8);return await handleQueryOutput(_0x17cf30,_0x2215e8),0x0;}catch(_0x36dc9c){if(_0x36dc9c instanceof SDKError)return console[_0x51adf4(0x128)](_0x51adf4(0x148)+_0x36dc9c[_0x51adf4(0x12d)]),_0x36dc9c['cause']&&console[_0x51adf4(0x128)](_0x51adf4(0x174)+_0x36dc9c[_0x51adf4(0x160)]),0x1;throw _0x36dc9c;}}}
1
+ const a27_0x2197db=a27_0x4947;(function(_0x1b4cf9,_0x219106){const _0x530ef6=a27_0x4947,_0x1452bd=_0x1b4cf9();while(!![]){try{const _0x2c3325=-parseInt(_0x530ef6(0xbc))/0x1+-parseInt(_0x530ef6(0xe2))/0x2+-parseInt(_0x530ef6(0x96))/0x3*(parseInt(_0x530ef6(0xdc))/0x4)+parseInt(_0x530ef6(0xe1))/0x5*(parseInt(_0x530ef6(0xca))/0x6)+parseInt(_0x530ef6(0xfb))/0x7+-parseInt(_0x530ef6(0xfc))/0x8+-parseInt(_0x530ef6(0x91))/0x9*(-parseInt(_0x530ef6(0xcc))/0xa);if(_0x2c3325===_0x219106)break;else _0x1452bd['push'](_0x1452bd['shift']());}catch(_0x23172f){_0x1452bd['push'](_0x1452bd['shift']());}}}(a27_0x5e46,0xce395));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a27_0x5e46(){const _0x43ebaa=['parentId','Resolved\x20relative\x20path\x20to:\x20','\x27\x20with\x20ID:\x20','format','segment:describe','Target\x20path:\x20','Executing\x20segment\x20query...','Parent\x20ID:\x20','parentFolder','getSegmentSQL','resolvePathToResource','Error:\x20','\x20\x20Folder\x20path:\x20','includes','2604tTUVCX','resolveParentId','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','140zXmXVq','1782718PqpFlo','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','jsonl','Folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','parent','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Fetching\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','cause','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','(root)','Examples:','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','folder','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Parent\x20segment:\x20','parentSegment','jobId','Resolving\x20path\x20\x27','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','verbose','2190216DGifTh','1069168XTSbeb','INVALID_ARGUMENT','Listing\x20folders\x20for\x20parent\x20\x27','replace','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','processedRows','green','✔\x20Found\x20','name','\x27...','log','Error:\x20Folder\x20reference\x20is\x20required','url','Resolved\x20parent\x20folder\x20ID:\x20','Use:\x20tdx\x20ps\x20view','segmentName','Parent\x20name:\x20','Fetching\x20folder\x20details...','Usage:\x20tdx\x20sg\x20show\x20<name>','type','message','listFolders','Use:\x20tdx\x20ps\x20show','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Segment\x20ID:\x20','Show\x20segment\x20folder\x20details','toLocaleString','Resolving\x20\x27','limit','elapsedTimeMillis','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','✔\x20Created\x20folder\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','getFolder','\x20rows\x20','✖\x20Query\x20failed\x20[','in\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Resolving\x20folder\x20\x27','json','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','Use:\x20tdx\x20ps\x20view\x20-w','segment:show','/app/ps/','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Get\x20SQL\x20query\x20for\x20child\x20segment','11623554zEIEDh','data','resolveFolderId','Fetching\x20segment\x20details...','folderPath','3633fDUooP','Usage:\x20tdx\x20sg\x20sql\x20<name>','Resolving\x20parent\x20folder\x20\x27','SEGMENT_NOT_FOUND','Resolving\x20parent\x20segment\x20\x27','createFolder','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','description','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20Cause:\x20','getParent','Error:\x20Path\x20or\x20name\x20is\x20required','test','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20desc','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','folderId','SQL\x20query:\x0a','fullPath','information_schema','web','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','code','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','site','execute','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20sql','\x20[Job\x20ID:\x20','trim','query','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','segment:folder:create','Show\x20folder\x20or\x20child\x20segment\x20details','setJobId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segmentId','1047265SKhYNg','length','error','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Fetching\x20parent\x20segment\x20details...','Resolved\x20type:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Site:\x20','segment:sql','getSegment','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Segment\x20name:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','173448rWVQZQ','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','20OtHCmR','\x20\x20Full\x20path:\x20'];a27_0x5e46=function(){return _0x43ebaa;};return a27_0x5e46();}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';function a27_0x4947(_0x5d427c,_0x3851fc){_0x5d427c=_0x5d427c-0x6c;const _0x5e46b1=a27_0x5e46();let _0x494723=_0x5e46b1[_0x5d427c];return _0x494723;}import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x476a55 from'chalk';async function resolveSegmentTarget(_0x35530b,_0x4cf27b,_0x4666ad){const _0x1571ea=a27_0x4947;if(isYamlFilePath(_0x35530b))try{const _0x3b8992=await resolveYamlFilePath(_0x35530b);return _0x4666ad&&(console['error'](_0x1571ea(0x79)+_0x35530b),console['error']('\x20\x20Parent\x20segment:\x20'+_0x3b8992['parentSegment']),console[_0x1571ea(0xbe)](_0x1571ea(0xc8)+_0x3b8992[_0x1571ea(0x10b)]),console[_0x1571ea(0xbe)](_0x1571ea(0xda)+(_0x3b8992[_0x1571ea(0x95)]||_0x1571ea(0xf0))),console[_0x1571ea(0xbe)](_0x1571ea(0xcd)+_0x3b8992[_0x1571ea(0xa9)])),_0x3b8992[_0x1571ea(0xa9)];}catch(_0x938b66){throw new SDKError(ErrorCode[_0x1571ea(0xfd)],_0x1571ea(0xc3)+_0x938b66[_0x1571ea(0x6f)]);}if(!_0x4cf27b)throw new SDKError(ErrorCode[_0x1571ea(0xfd)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x4cf27b+'/'+_0x35530b;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x2197db(0x104)]=a27_0x2197db(0xd2);[a27_0x2197db(0x9d)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x2197db(0xb0)](_0x15015f){const _0x4dca11=a27_0x2197db,{options:_0x15fe73,args:_0x1c72e9,tdx:_0x33dfce}=_0x15015f,_0x5dd671=_0x1c72e9[0x0],_0x1fc3e9=!_0x5dd671&&!!_0x15fe73['parentSegment'],_0x25cfd2=_0x5dd671||_0x15fe73[_0x4dca11(0xf6)];if(!_0x25cfd2)return console[_0x4dca11(0xbe)](_0x4dca11(0xa2)),console[_0x4dca11(0xbe)](_0x4dca11(0x9f)),console[_0x4dca11(0xbe)](_0x4dca11(0xf1)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x4dca11(0xbe)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x4dca11(0xbe)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x4dca11(0x9c)),0x1;try{const _0x5e4ead=_0x15fe73['segmentPath'];let _0x2c059=_0x25cfd2;!_0x1fc3e9&&_0x5e4ead&&!_0x25cfd2[_0x4dca11(0xdb)]('/')&&(_0x2c059=_0x5e4ead+'/'+_0x25cfd2,_0x15fe73[_0x4dca11(0xfa)]&&console[_0x4dca11(0xbe)](_0x4dca11(0xcf)+_0x2c059));const _0x475ac9=await withSpinner(_0x4dca11(0xf8)+_0x2c059+_0x4dca11(0x105),()=>_0x33dfce[_0x4dca11(0x7c)]['resolvePathToResource'](_0x2c059),{'verbose':_0x15fe73[_0x4dca11(0xfa)]}),_0x419cef=_0x475ac9[_0x4dca11(0x92)];_0x15fe73['verbose']&&(console[_0x4dca11(0xbe)](_0x4dca11(0xc1)+_0x419cef['type']),console[_0x4dca11(0xbe)](_0x4dca11(0xd5)+_0x419cef[_0x4dca11(0xce)]),_0x419cef['folderId']&&console['error'](_0x4dca11(0xe5)+_0x419cef[_0x4dca11(0xa7)]),_0x419cef[_0x4dca11(0xbb)]&&console[_0x4dca11(0xbe)](_0x4dca11(0x73)+_0x419cef['segmentId']));if(_0x419cef['type']===_0x4dca11(0xe7)){const _0x4a6a78=await withSpinner(_0x4dca11(0xc0),()=>_0x33dfce['segment'][_0x4dca11(0xa1)](_0x419cef[_0x4dca11(0xce)]),{'verbose':_0x15fe73['verbose']});await handleSingleObjectOutput(_0x4a6a78['data'],_0x15fe73);}else{if(_0x419cef[_0x4dca11(0x6e)]===_0x4dca11(0xf3)){if(!_0x419cef[_0x4dca11(0xa7)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x14ed73=await withSpinner('Fetching\x20folder\x20details...',()=>_0x33dfce[_0x4dca11(0x7c)][_0x4dca11(0x81)](_0x419cef[_0x4dca11(0xa7)]),{'verbose':_0x15fe73['verbose']});await handleSingleObjectOutput(_0x14ed73[_0x4dca11(0x92)],_0x15fe73);}else{if(_0x419cef[_0x4dca11(0x6e)]===_0x4dca11(0x7c)){if(!_0x419cef[_0x4dca11(0xbb)])throw new SDKError(ErrorCode[_0x4dca11(0x99)],_0x4dca11(0x7f));const _0x29ace4=await withSpinner(_0x4dca11(0x94),()=>_0x33dfce['segment'][_0x4dca11(0xc6)](_0x419cef['parentId'],_0x419cef[_0x4dca11(0xbb)]),{'verbose':_0x15fe73[_0x4dca11(0xfa)]});await handleSingleObjectOutput(_0x29ace4[_0x4dca11(0x92)],_0x15fe73);}}}return 0x0;}catch(_0x21cf57){if(_0x21cf57 instanceof SDKError)return console['error'](_0x4dca11(0xd9)+_0x21cf57[_0x4dca11(0x6f)]),_0x21cf57[_0x4dca11(0xed)]&&console[_0x4dca11(0xbe)](_0x4dca11(0xa0)+_0x21cf57[_0x4dca11(0xed)]),0x1;throw _0x21cf57;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x2197db(0x104)]=a27_0x2197db(0x8d);['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x2197db(0xb0)](_0x16cff5){const _0x1552a9=a27_0x2197db,{options:_0x21c759,args:_0x3b7112,tdx:_0x2a6a02}=_0x16cff5,_0x4c568b=_0x3b7112[0x0];if(!_0x4c568b)return console[_0x1552a9(0xbe)](_0x1552a9(0xe8)),console[_0x1552a9(0xbe)](_0x1552a9(0x6d)),console[_0x1552a9(0xbe)](_0x1552a9(0xba)),console[_0x1552a9(0xbe)](_0x1552a9(0xf1)),console[_0x1552a9(0xbe)](_0x1552a9(0xef)),console[_0x1552a9(0xbe)](_0x1552a9(0xa4)),0x1;try{const _0x32dc15=_0x21c759[_0x1552a9(0xf6)],_0x2061ad=await resolveSegmentTarget(_0x4c568b,_0x32dc15,_0x21c759['verbose']);_0x21c759[_0x1552a9(0xfa)]&&console[_0x1552a9(0xbe)]('Target\x20path:\x20'+_0x2061ad);const _0x571603=await withSpinner(_0x1552a9(0x76)+_0x4c568b+_0x1552a9(0x105),()=>_0x2a6a02[_0x1552a9(0x7c)]['resolvePathToResource'](_0x2061ad),{'verbose':_0x21c759['verbose']}),_0x474d33=_0x571603[_0x1552a9(0x92)];_0x21c759['verbose']&&(console['error'](_0x1552a9(0xc1)+_0x474d33[_0x1552a9(0x6e)]),console[_0x1552a9(0xbe)](_0x1552a9(0xd5)+_0x474d33[_0x1552a9(0xce)]));if(_0x474d33['type']==='folder')return console[_0x1552a9(0xbe)](_0x1552a9(0xcb)),console[_0x1552a9(0xbe)](_0x1552a9(0xf9)),0x1;if(_0x474d33['type']===_0x1552a9(0xe7))return console[_0x1552a9(0xbe)](_0x1552a9(0xa6)),console[_0x1552a9(0xbe)](_0x1552a9(0x71)),0x1;if(!_0x474d33[_0x1552a9(0xbb)])throw new SDKError(ErrorCode[_0x1552a9(0x99)],_0x1552a9(0x7f));const _0xd895ae=await withSpinner(_0x1552a9(0x87),()=>_0x2a6a02['segment'][_0x1552a9(0xd7)](_0x474d33[_0x1552a9(0xce)],_0x474d33['segmentId']),{'verbose':_0x21c759[_0x1552a9(0xfa)]});let _0x49f8de=_0xd895ae[_0x1552a9(0x92)];const _0x578ec4=resolveLimit(_0x21c759[_0x1552a9(0x77)],DEFAULT_DISPLAY_LIMIT),_0x35eac5=/\bLIMIT\s+\d+/i[_0x1552a9(0xa3)](_0x49f8de);!_0x35eac5&&(_0x49f8de=_0x49f8de[_0x1552a9(0xb4)]()[_0x1552a9(0xff)](/;+$/,''),_0x49f8de='SELECT\x20*\x20FROM\x20(\x0a'+_0x49f8de+_0x1552a9(0xee)+_0x578ec4);_0x21c759['verbose']&&console['error'](_0x1552a9(0xa8)+_0x49f8de);const _0x29bccc=await withProgressSpinner(_0x1552a9(0xd4),async _0x2ace4e=>{const _0x291406=_0x1552a9,_0x3dc8ea=await _0x2a6a02[_0x291406(0xb5)]['execute'](_0x49f8de,{'catalog':'td','schema':_0x291406(0xaa),'onJobId':_0xa842d5=>{const _0x4c097e=_0x291406;_0x2ace4e[_0x4c097e(0xb9)](_0xa842d5);}});return _0x3dc8ea;},{'verbose':_0x21c759[_0x1552a9(0xfa)]}),_0x6b24e7=_0x29bccc[_0x1552a9(0x92)],_0x359681=_0x6b24e7[_0x1552a9(0xf7)]?_0x1552a9(0xb3)+_0x6b24e7[_0x1552a9(0xf7)]+']':'';return console[_0x1552a9(0xbe)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x6b24e7['stats'][_0x1552a9(0x101)][_0x1552a9(0x75)]()+_0x1552a9(0x82)+(_0x1552a9(0x84)+formatElapsed(_0x6b24e7['stats'][_0x1552a9(0x78)])+_0x359681)),await handleQueryOutput(_0x6b24e7,_0x21c759),0x0;}catch(_0xf62578){if(_0xf62578 instanceof SDKError)return console['error'](_0x1552a9(0x83)+_0xf62578[_0x1552a9(0xad)]+']'),console['error']('\x0a'+_0xf62578[_0x1552a9(0x6f)]),0x1;throw _0xf62578;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:folder:list';[a27_0x2197db(0x9d)]=a27_0x2197db(0x9e);async[a27_0x2197db(0xb0)](_0x10d283){const _0x48e6b9=a27_0x2197db,{options:_0x3180cc,args:_0xbbcee,tdx:_0x416021}=_0x10d283;if(_0xbbcee[_0x48e6b9(0xbd)]===0x0)return console[_0x48e6b9(0xbe)](_0x48e6b9(0x85)),console[_0x48e6b9(0xbe)](_0x48e6b9(0xdf)),0x1;const _0x3a318b=_0xbbcee[0x0];try{_0x3180cc[_0x48e6b9(0xfa)]&&(console['error'](_0x48e6b9(0xc4)+_0x3180cc[_0x48e6b9(0xaf)]),console[_0x48e6b9(0xbe)](_0x48e6b9(0x10c)+_0x3a318b));const _0x3ec682=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3a318b+_0x48e6b9(0x105),()=>_0x416021[_0x48e6b9(0x7c)][_0x48e6b9(0xdd)](_0x3a318b),{'verbose':_0x3180cc[_0x48e6b9(0xfa)]}),_0x321d96=_0x3ec682[_0x48e6b9(0x92)];_0x3180cc[_0x48e6b9(0xfa)]&&console[_0x48e6b9(0xbe)](_0x48e6b9(0xe6)+_0x321d96);const _0xd7fc6=await withSpinner(_0x48e6b9(0xfe)+_0x3a318b+_0x48e6b9(0x105),()=>_0x416021['segment'][_0x48e6b9(0x70)](_0x321d96),{'verbose':_0x3180cc[_0x48e6b9(0xfa)]}),_0x549662=_0xd7fc6[_0x48e6b9(0x92)];return console[_0x48e6b9(0xbe)](_0x48e6b9(0x103)+_0x549662['length']+'\x20folder'+(_0x549662['length']!==0x1?'s':'')),await handleSDKOutput(_0x549662,_0x3180cc),0x0;}catch(_0xced01b){if(_0xced01b instanceof SDKError)return console[_0x48e6b9(0xbe)]('Error:\x20'+_0xced01b[_0x48e6b9(0x6f)]),_0xced01b[_0x48e6b9(0xed)]&&console[_0x48e6b9(0xbe)]('\x20\x20Cause:\x20'+_0xced01b[_0x48e6b9(0xed)]),0x1;throw _0xced01b;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:folder:show';[a27_0x2197db(0x9d)]=a27_0x2197db(0x74);async['execute'](_0x9c84df){const _0x5086dc=a27_0x2197db,{options:_0x35b1b5,args:_0x3313cd,tdx:_0x66a397}=_0x9c84df;if(_0x3313cd[_0x5086dc(0xbd)]===0x0)return console[_0x5086dc(0xbe)](_0x5086dc(0x107)),console[_0x5086dc(0xbe)](_0x5086dc(0x7d)),0x1;try{const {parentId:_0x2b994c,childId:_0xab7273}=parseSegmentRef(_0x3313cd[0x0]);_0x35b1b5[_0x5086dc(0xfa)]&&(console[_0x5086dc(0xbe)](_0x5086dc(0xc4)+_0x35b1b5[_0x5086dc(0xaf)]),console[_0x5086dc(0xbe)](_0x5086dc(0x10c)+_0x2b994c),_0xab7273&&console[_0x5086dc(0xbe)]('Folder\x20name:\x20'+_0xab7273));if(!_0xab7273)return console['error'](_0x5086dc(0xe9)),0x1;const _0x2942a5=await withSpinner(_0x5086dc(0x9a)+_0x2b994c+_0x5086dc(0x105),()=>_0x66a397['segment']['resolveParentId'](_0x2b994c),{'verbose':_0x35b1b5[_0x5086dc(0xfa)]}),_0xa4c740=_0x2942a5['data'];_0x35b1b5[_0x5086dc(0xfa)]&&console['error'](_0x5086dc(0xe6)+_0xa4c740);const _0x338acd=await withSpinner(_0x5086dc(0x88)+_0xab7273+_0x5086dc(0x105),()=>_0x66a397[_0x5086dc(0x7c)][_0x5086dc(0x93)](_0xa4c740,_0xab7273),{'verbose':_0x35b1b5['verbose']}),_0x52323a=_0x338acd[_0x5086dc(0x92)];_0x35b1b5[_0x5086dc(0xfa)]&&console['error'](_0x5086dc(0x86)+_0x52323a);const _0x2062fa=await withSpinner(_0x5086dc(0xea)+_0xab7273+'\x27...',()=>_0x66a397['segment'][_0x5086dc(0x81)](_0x52323a),{'verbose':_0x35b1b5['verbose']});return await handleSDKOutput([_0x2062fa['data']],_0x35b1b5),0x0;}catch(_0x4cd9e0){if(_0x4cd9e0 instanceof SDKError)return console[_0x5086dc(0xbe)](_0x5086dc(0xd9)+_0x4cd9e0[_0x5086dc(0x6f)]),_0x4cd9e0[_0x5086dc(0xed)]&&console[_0x5086dc(0xbe)](_0x5086dc(0xa0)+_0x4cd9e0[_0x5086dc(0xed)]),0x1;throw _0x4cd9e0;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x2197db(0xc5);[a27_0x2197db(0x9d)]=a27_0x2197db(0x90);async[a27_0x2197db(0xb0)](_0x3510e2){const _0xda11c0=a27_0x2197db,{options:_0x9cb95b,args:_0x2b8646,tdx:_0x488912}=_0x3510e2,_0xc70c6c=_0x2b8646[0x0];if(!_0xc70c6c)return console['error'](_0xda11c0(0xe8)),console[_0xda11c0(0xbe)](_0xda11c0(0x97)),console[_0xda11c0(0xbe)](_0xda11c0(0xac)),console[_0xda11c0(0xbe)](_0xda11c0(0xf1)),console[_0xda11c0(0xbe)](_0xda11c0(0x8a)),console[_0xda11c0(0xbe)](_0xda11c0(0x8f)),0x1;try{const _0x33b2ab=_0x9cb95b[_0xda11c0(0xf6)],_0x376ca3=await resolveSegmentTarget(_0xc70c6c,_0x33b2ab,_0x9cb95b[_0xda11c0(0xfa)]);_0x9cb95b[_0xda11c0(0xfa)]&&console['error'](_0xda11c0(0xd3)+_0x376ca3);const _0x20454a=await withSpinner(_0xda11c0(0x76)+_0xc70c6c+'\x27...',()=>_0x488912[_0xda11c0(0x7c)][_0xda11c0(0xd8)](_0x376ca3),{'verbose':_0x9cb95b[_0xda11c0(0xfa)]}),_0x486f08=_0x20454a['data'];_0x9cb95b[_0xda11c0(0xfa)]&&(console[_0xda11c0(0xbe)](_0xda11c0(0xc1)+_0x486f08[_0xda11c0(0x6e)]),console[_0xda11c0(0xbe)](_0xda11c0(0xd5)+_0x486f08[_0xda11c0(0xce)]));if(_0x486f08[_0xda11c0(0x6e)]===_0xda11c0(0xf3))return console['error'](_0xda11c0(0xf4)),console[_0xda11c0(0xbe)](_0xda11c0(0x72)),0x1;if(_0x486f08[_0xda11c0(0x6e)]===_0xda11c0(0xe7))return console[_0xda11c0(0xbe)](_0xda11c0(0xe3)),console['error'](_0xda11c0(0xb2)),0x1;if(!_0x486f08[_0xda11c0(0xbb)])throw new SDKError(ErrorCode[_0xda11c0(0x99)],_0xda11c0(0x7f));const _0x2e2725=await withSpinner(_0xda11c0(0x87),()=>_0x488912[_0xda11c0(0x7c)][_0xda11c0(0xd7)](_0x486f08[_0xda11c0(0xce)],_0x486f08[_0xda11c0(0xbb)]),{'verbose':_0x9cb95b[_0xda11c0(0xfa)]}),_0x525ab2=_0x2e2725[_0xda11c0(0x92)];return _0x9cb95b['format']===_0xda11c0(0x89)||_0x9cb95b[_0xda11c0(0xd1)]===_0xda11c0(0xe4)?await handleSDKOutput([{'sql':_0x525ab2}],_0x9cb95b):console[_0xda11c0(0x106)](_0x525ab2),0x0;}catch(_0x136981){if(_0x136981 instanceof SDKError)return console[_0xda11c0(0xbe)](_0xda11c0(0xd9)+_0x136981[_0xda11c0(0x6f)]),_0x136981[_0xda11c0(0xed)]&&console['error'](_0xda11c0(0xa0)+_0x136981['cause']),0x1;throw _0x136981;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x2197db(0x104)]=a27_0x2197db(0xb7);[a27_0x2197db(0x9d)]='Create\x20segment\x20folder\x20for\x20organization';async[a27_0x2197db(0xb0)](_0x3f0283){const _0x258d4a=a27_0x2197db,{options:_0x359dd0,args:_0x3ad79a,tdx:_0x1660d1}=_0x3f0283,_0xb67f5a=_0x359dd0;if(_0x3ad79a[_0x258d4a(0xbd)]<0x2)return console[_0x258d4a(0xbe)](_0x258d4a(0xc2)),console['error'](_0x258d4a(0x100)),0x1;const _0x1819f9=_0x3ad79a[0x0],_0x29c9a7=_0x3ad79a[0x1];_0xb67f5a[_0x258d4a(0xfa)]&&(console['error'](_0x258d4a(0xc4)+_0xb67f5a[_0x258d4a(0xaf)]),console[_0x258d4a(0xbe)](_0x258d4a(0xf5)+_0x1819f9),console[_0x258d4a(0xbe)]('Folder\x20name:\x20'+_0x29c9a7));let _0x37b593;if(_0xb67f5a[_0x258d4a(0xd6)]){const _0x5311f7=_0xb67f5a['parentFolder'],_0x2c5900=await withSpinner(_0x258d4a(0x9a)+_0x1819f9+_0x258d4a(0x105),()=>_0x1660d1[_0x258d4a(0x7c)][_0x258d4a(0xdd)](_0x1819f9),{'verbose':_0xb67f5a[_0x258d4a(0xfa)]}),_0x381ae6=_0x2c5900[_0x258d4a(0x92)],_0x46e7d1=await withSpinner(_0x258d4a(0x98)+_0x5311f7+_0x258d4a(0x105),()=>_0x1660d1[_0x258d4a(0x7c)][_0x258d4a(0x93)](_0x381ae6,_0x5311f7),{'verbose':_0xb67f5a[_0x258d4a(0xfa)]});_0x37b593=_0x46e7d1[_0x258d4a(0x92)],_0xb67f5a['verbose']&&console[_0x258d4a(0xbe)](_0x258d4a(0x109)+_0x37b593);}const _0x37f961={'name':_0x29c9a7,'description':_0xb67f5a[_0x258d4a(0x9d)],'parentFolderId':_0x37b593},_0x453e8d=await withSpinner('Creating\x20folder\x20\x27'+_0x29c9a7+_0x258d4a(0x105),()=>_0x1660d1['segment'][_0x258d4a(0x9b)](_0x1819f9,_0x37f961),{'verbose':_0xb67f5a[_0x258d4a(0xfa)]}),_0x25c0b1=_0x453e8d['data'];return console[_0x258d4a(0xbe)](_0x258d4a(0x7e)+_0x25c0b1[_0x258d4a(0x104)]+_0x258d4a(0xd0)+_0x25c0b1['id']),await handleSDKOutput([_0x25c0b1],_0xb67f5a),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:view';[a27_0x2197db(0x9d)]=a27_0x2197db(0xb8);async['execute'](_0x1ed5ed){const _0x365588=a27_0x2197db,{options:_0x4e0c7d,args:_0x363da3,tdx:_0x309c23}=_0x1ed5ed,_0x3e4212=_0x363da3[0x0];if(!_0x3e4212)return console[_0x365588(0xbe)](_0x365588(0xc7)),console['error'](_0x365588(0xbf)),console[_0x365588(0xbe)](_0x365588(0xec)),console[_0x365588(0xbe)]('Options:'),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x365588(0xbe)](_0x365588(0xf1)),console[_0x365588(0xbe)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x365588(0xbe)](_0x365588(0xae)),console[_0x365588(0xbe)](_0x365588(0xb6)),console[_0x365588(0xbe)](_0x365588(0xb1)),0x1;try{const _0x4eeb48=_0x4e0c7d[_0x365588(0xf6)],_0x54bc23=await resolveSegmentTarget(_0x3e4212,_0x4eeb48,_0x4e0c7d[_0x365588(0xfa)]);_0x4e0c7d[_0x365588(0xfa)]&&console[_0x365588(0xbe)](_0x365588(0xd3)+_0x54bc23);const _0x5c4d4f=await withSpinner(_0x365588(0x76)+_0x3e4212+_0x365588(0x105),()=>_0x309c23['segment']['resolvePathToResource'](_0x54bc23),{'verbose':_0x4e0c7d[_0x365588(0xfa)]}),_0x22374a=_0x5c4d4f[_0x365588(0x92)];_0x4e0c7d[_0x365588(0xfa)]&&(console[_0x365588(0xbe)](_0x365588(0xc1)+_0x22374a[_0x365588(0x6e)]),console[_0x365588(0xbe)](_0x365588(0xd5)+_0x22374a['parentId']),_0x22374a['folderId']&&console[_0x365588(0xbe)](_0x365588(0xe5)+_0x22374a[_0x365588(0xa7)]),_0x22374a[_0x365588(0xbb)]&&console[_0x365588(0xbe)](_0x365588(0x73)+_0x22374a[_0x365588(0xbb)]));if(_0x4e0c7d[_0x365588(0xab)]){if(_0x22374a[_0x365588(0x6e)]===_0x365588(0xf3))return console['error']('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x22374a[_0x365588(0x6e)]===_0x365588(0xe7))return console[_0x365588(0xbe)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x365588(0xbe)](_0x365588(0x8c)),0x1;if(!_0x22374a[_0x365588(0xbb)])throw new SDKError(ErrorCode[_0x365588(0x99)],_0x365588(0x7f));const _0x58cc54=getConsoleNextUrl(_0x4e0c7d[_0x365588(0xaf)],_0x365588(0x8e)+_0x22374a[_0x365588(0xce)]+'/e/'+_0x22374a['segmentId']);return console[_0x365588(0xbe)](a27_0x476a55[_0x365588(0x102)]('✔')+'\x20Opening\x20'+a27_0x476a55['cyan'](_0x58cc54)),openBrowser(_0x58cc54),0x0;}if(_0x22374a[_0x365588(0x6e)]===_0x365588(0xf3)){if(!_0x22374a[_0x365588(0xa7)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x365588(0x7b));const _0xab0d6=await withSpinner(_0x365588(0x6c),()=>_0x309c23[_0x365588(0x7c)]['getFolder'](_0x22374a[_0x365588(0xa7)]),{'verbose':_0x4e0c7d[_0x365588(0xfa)]});await handleSingleObjectOutput(_0xab0d6[_0x365588(0x92)],_0x4e0c7d);}else{if(_0x22374a[_0x365588(0x6e)]==='segment'){if(!_0x22374a[_0x365588(0xbb)])throw new SDKError(ErrorCode[_0x365588(0x99)],_0x365588(0x7f));const _0x3d9b4c=await withSpinner('Fetching\x20segment\x20details...',()=>_0x309c23[_0x365588(0x7c)]['getSegment'](_0x22374a[_0x365588(0xce)],_0x22374a[_0x365588(0xbb)]),{'verbose':_0x4e0c7d[_0x365588(0xfa)]}),_0x52a4e7=getConsoleNextUrl(_0x4e0c7d['site'],_0x365588(0x8e)+_0x22374a['parentId']+'/e/'+_0x22374a['segmentId']),_0x257854=_0x3d9b4c[_0x365588(0x92)];_0x257854[_0x365588(0x108)]=_0x52a4e7,await handleSingleObjectOutput(_0x257854,_0x4e0c7d);}else return console[_0x365588(0xbe)](_0x365588(0x7a)),console['error'](_0x365588(0x10a)),0x1;}return 0x0;}catch(_0x5b059a){if(_0x5b059a instanceof SDKError)return console['error'](_0x365588(0xd9)+_0x5b059a[_0x365588(0x6f)]),_0x5b059a[_0x365588(0xed)]&&console[_0x365588(0xbe)](_0x365588(0xa0)+_0x5b059a['cause']),0x1;throw _0x5b059a;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x2197db(0x104)]='segment:desc';[a27_0x2197db(0x9d)]=a27_0x2197db(0xe0);async['execute'](_0x16525f){const _0xb5cc61=a27_0x2197db,{options:_0x3b103e,args:_0x5af98f,tdx:_0x25cc13}=_0x16525f,_0x2c9f4b=_0x5af98f[0x0];if(!_0x2c9f4b)return console['error'](_0xb5cc61(0xe8)),console[_0xb5cc61(0xbe)](_0xb5cc61(0x8b)),console[_0xb5cc61(0xbe)](_0xb5cc61(0xeb)),console['error'](_0xb5cc61(0xf1)),console[_0xb5cc61(0xbe)](_0xb5cc61(0xde)),console[_0xb5cc61(0xbe)](_0xb5cc61(0x80)),0x1;try{const _0x57a31a=_0x3b103e[_0xb5cc61(0xf6)],_0x58e8a4=await resolveSegmentTarget(_0x2c9f4b,_0x57a31a,_0x3b103e[_0xb5cc61(0xfa)]);_0x3b103e[_0xb5cc61(0xfa)]&&console['error'](_0xb5cc61(0xd3)+_0x58e8a4);const _0x2cd54f=await withSpinner(_0xb5cc61(0x76)+_0x2c9f4b+_0xb5cc61(0x105),()=>_0x25cc13['segment'][_0xb5cc61(0xd8)](_0x58e8a4),{'verbose':_0x3b103e[_0xb5cc61(0xfa)]}),_0x32f9ec=_0x2cd54f[_0xb5cc61(0x92)];_0x3b103e[_0xb5cc61(0xfa)]&&(console['error'](_0xb5cc61(0xc1)+_0x32f9ec[_0xb5cc61(0x6e)]),console['error'](_0xb5cc61(0xd5)+_0x32f9ec[_0xb5cc61(0xce)]));if(_0x32f9ec[_0xb5cc61(0x6e)]==='folder')return console['error'](_0xb5cc61(0xc9)),console[_0xb5cc61(0xbe)](_0xb5cc61(0x72)),0x1;if(_0x32f9ec[_0xb5cc61(0x6e)]===_0xb5cc61(0xe7))return console[_0xb5cc61(0xbe)](_0xb5cc61(0xf2)),console[_0xb5cc61(0xbe)](_0xb5cc61(0xa5)),0x1;if(!_0x32f9ec[_0xb5cc61(0xbb)])throw new SDKError(ErrorCode[_0xb5cc61(0x99)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2ab1a8=await withSpinner(_0xb5cc61(0x87),()=>_0x25cc13[_0xb5cc61(0x7c)][_0xb5cc61(0xd7)](_0x32f9ec['parentId'],_0x32f9ec[_0xb5cc61(0xbb)]),{'verbose':_0x3b103e['verbose']}),_0x1a8c64=_0x2ab1a8[_0xb5cc61(0x92)],_0x3a0dad=await executeSchemaQuery(_0x1a8c64,_0x25cc13,_0x3b103e);return await handleQueryOutput(_0x3a0dad,_0x3b103e),0x0;}catch(_0x1aaddb){if(_0x1aaddb instanceof SDKError)return console[_0xb5cc61(0xbe)](_0xb5cc61(0xd9)+_0x1aaddb[_0xb5cc61(0x6f)]),_0x1aaddb[_0xb5cc61(0xed)]&&console['error'](_0xb5cc61(0xa0)+_0x1aaddb[_0xb5cc61(0xed)]),0x1;throw _0x1aaddb;}}}
@@ -1 +1 @@
1
- function a28_0x1d43(_0x227582,_0x8601a){_0x227582=_0x227582-0x8a;const _0x4caf97=a28_0x4caf();let _0x1d43ea=_0x4caf97[_0x227582];return _0x1d43ea;}const a28_0x4eb7c8=a28_0x1d43;(function(_0xebb6ca,_0x29ca20){const _0x3f245a=a28_0x1d43,_0x4220a0=_0xebb6ca();while(!![]){try{const _0x6c521a=-parseInt(_0x3f245a(0x8e))/0x1*(parseInt(_0x3f245a(0xa8))/0x2)+parseInt(_0x3f245a(0xaa))/0x3*(parseInt(_0x3f245a(0x8a))/0x4)+parseInt(_0x3f245a(0x9c))/0x5*(-parseInt(_0x3f245a(0xaf))/0x6)+parseInt(_0x3f245a(0xc2))/0x7+parseInt(_0x3f245a(0x9d))/0x8*(-parseInt(_0x3f245a(0xbc))/0x9)+parseInt(_0x3f245a(0x8b))/0xa+parseInt(_0x3f245a(0x90))/0xb*(parseInt(_0x3f245a(0x97))/0xc);if(_0x6c521a===_0x29ca20)break;else _0x4220a0['push'](_0x4220a0['shift']());}catch(_0x1ce353){_0x4220a0['push'](_0x4220a0['shift']());}}}(a28_0x4caf,0x66e9b));function a28_0x4caf(){const _0x4e7351=['28239UMvZxD','invisible','\x27\x20with\x20ID:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Parent:\x20','4998Vjwofr','Segment\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','resolveFolderId','segmentPath','segment:create','Site:\x20','segments','Target\x20path:\x20','noCountPopulation','Resolving\x20folder\x20\x27','65907VWLhog','type','error','execute','Resolved\x20relative\x20path\x20to:\x20','description','1354955SPpfxt','64aciSRi','3283350PgzVnJ','name','rule','372325kBdUkO','\x20\x20\x20Path:\x20','141889kBbAdI','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','resolvePathToResource','site','Parent\x20path:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','createSegment','396NAtAzY','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','yellow','Resolved\x20folder\x20ID:\x20','ruleFile','1475HUJeQz','64GLoEAX','verbose','segment','data','folderId','Creating\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','includes','resolveParentId','Create\x20child\x20segment\x20with\x20filtering\x20rules','\x27...','2FlCGzr','folder'];a28_0x4caf=function(){return _0x4e7351;};return a28_0x4caf();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x19bf22 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x4eb7c8(0x8c)]=a28_0x4eb7c8(0xb6);[a28_0x4eb7c8(0xc1)]=a28_0x4eb7c8(0xa6);async[a28_0x4eb7c8(0xbf)](_0x5f2156){const _0x1e8dbb=a28_0x4eb7c8;console['error'](a28_0x19bf22['yellow'](_0x1e8dbb(0x95))),console[_0x1e8dbb(0xbe)](a28_0x19bf22[_0x1e8dbb(0x99)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x1d6ba3,args:_0x11e261,tdx:_0x3998f2}=_0x5f2156,_0x1e549c=_0x1d6ba3;if(_0x11e261['length']===0x0)return console[_0x1e8dbb(0xbe)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x1e8dbb(0xa3)),console['error']('Examples:'),console[_0x1e8dbb(0xbe)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x1e8dbb(0xbe)](_0x1e8dbb(0x91)),console[_0x1e8dbb(0xbe)](_0x1e8dbb(0xb2)),0x1;const _0x54be12=_0x11e261[0x0],_0x13120f=_0x1d6ba3[_0x1e8dbb(0xb5)];let _0x8ff533=_0x54be12;_0x13120f&&!_0x54be12[_0x1e8dbb(0xa4)]('/')&&(_0x8ff533=_0x13120f+'/'+_0x54be12,_0x1e549c[_0x1e8dbb(0x9e)]&&console[_0x1e8dbb(0xbe)](_0x1e8dbb(0xc0)+_0x8ff533));const _0x218f07=parsePath(_0x8ff533);if(_0x218f07[_0x1e8dbb(0xb8)]['length']<0x2)return console[_0x1e8dbb(0xbe)](_0x1e8dbb(0x98)),console[_0x1e8dbb(0xbe)](_0x1e8dbb(0xb3)),0x1;const _0x96ce67=_0x218f07['segments'][0x0],_0x2d176c=getBaseName(_0x8ff533),_0x4e9db4=getParentPath(_0x8ff533);_0x1e549c[_0x1e8dbb(0x9e)]&&(console['error'](_0x1e8dbb(0xb7)+_0x1e549c[_0x1e8dbb(0x93)]),console[_0x1e8dbb(0xbe)](_0x1e8dbb(0xb9)+_0x8ff533),console[_0x1e8dbb(0xbe)](_0x1e8dbb(0xae)+_0x96ce67),console[_0x1e8dbb(0xbe)](_0x1e8dbb(0xb0)+_0x2d176c),console[_0x1e8dbb(0xbe)](_0x1e8dbb(0x94)+_0x4e9db4));const _0x38cba7=await withSpinner(_0x1e8dbb(0xb1)+_0x96ce67+_0x1e8dbb(0xa7),()=>_0x3998f2[_0x1e8dbb(0x9f)][_0x1e8dbb(0xa5)](_0x96ce67),{'verbose':_0x1e549c['verbose']}),_0x1cfbc5=_0x38cba7['data'];let _0x26f533;if(_0x218f07[_0x1e8dbb(0xb8)]['length']>0x2){const _0x4cfb67=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x4e9db4+'\x27...',()=>_0x3998f2[_0x1e8dbb(0x9f)][_0x1e8dbb(0x92)](_0x4e9db4),{'verbose':_0x1e549c[_0x1e8dbb(0x9e)]}),_0x417205=_0x4cfb67['data'];if(_0x417205[_0x1e8dbb(0xbd)]!=='folder'&&_0x417205[_0x1e8dbb(0xbd)]!=='parent')return console['error'](_0x1e8dbb(0xad)),0x1;_0x26f533=_0x417205[_0x1e8dbb(0xa1)];}else{if(_0x1e549c[_0x1e8dbb(0xa9)]){const _0x3cb7bc=await withSpinner(_0x1e8dbb(0xbb)+_0x1e549c[_0x1e8dbb(0xa9)]+_0x1e8dbb(0xa7),()=>_0x3998f2[_0x1e8dbb(0x9f)][_0x1e8dbb(0xb4)](_0x1cfbc5,_0x1e549c[_0x1e8dbb(0xa9)]),{'verbose':_0x1e549c[_0x1e8dbb(0x9e)]});_0x26f533=_0x3cb7bc[_0x1e8dbb(0xa0)];}}_0x1e549c[_0x1e8dbb(0x9e)]&&_0x26f533&&console[_0x1e8dbb(0xbe)](_0x1e8dbb(0x9a)+_0x26f533);const _0x53ddc6=await loadJSONFromOptions(_0x1e549c[_0x1e8dbb(0x8d)],_0x1e549c[_0x1e8dbb(0x9b)]),_0x3d0481={'name':_0x2d176c,'description':_0x1e549c[_0x1e8dbb(0xc1)],'rule':_0x53ddc6,'kind':_0x1e549c['kind']!==undefined?parseInt(_0x1e549c['kind'],0xa):undefined,'isVisible':_0x1e549c[_0x1e8dbb(0xab)]?![]:undefined,'segmentFolderId':_0x26f533,'countPopulation':_0x1e549c[_0x1e8dbb(0xba)]?![]:undefined},_0x26227c=await withSpinner(_0x1e8dbb(0xa2)+_0x2d176c+_0x1e8dbb(0xa7),()=>_0x3998f2[_0x1e8dbb(0x9f)][_0x1e8dbb(0x96)](_0x1cfbc5,_0x3d0481),{'verbose':_0x1e549c['verbose']}),_0x576c1a=_0x26227c[_0x1e8dbb(0xa0)];return console[_0x1e8dbb(0xbe)]('✔\x20Created\x20segment\x20\x27'+_0x576c1a[_0x1e8dbb(0x8c)]+_0x1e8dbb(0xac)+_0x576c1a['id']),_0x8ff533!==_0x54be12&&console[_0x1e8dbb(0xbe)](_0x1e8dbb(0x8f)+_0x8ff533),await handleSDKOutput([_0x576c1a],_0x1e549c),0x0;}}
1
+ const a28_0x22317a=a28_0x3721;function a28_0x524a(){const _0x526474=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolved\x20folder\x20ID:\x20','execute','2430696pmeqnc','data','Resolving\x20parent\x20segment\x20\x27','folderId','resolveFolderId','Create\x20child\x20segment\x20with\x20filtering\x20rules','8999DlnSBQ','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folder','error','segment','resolveParentId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','name','Target\x20path:\x20','404570nuIBsO','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','includes','3675261HaVppF','verbose','type','1289796xKzvbw','21pRpfWs','invisible','segments','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','5000140EXaExX','length','createSegment','Resolving\x20folder\x20path\x20\x27','\x27...','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','yellow','segmentPath','kind','24472737WUnlPS','10xRjvqs','Parent\x20path:\x20','Resolved\x20relative\x20path\x20to:\x20','description','Site:\x20','Resolving\x20folder\x20\x27','rule','62hctSZK','parent','noCountPopulation'];a28_0x524a=function(){return _0x526474;};return a28_0x524a();}function a28_0x3721(_0x32cae5,_0xf15c51){_0x32cae5=_0x32cae5-0x99;const _0x524a49=a28_0x524a();let _0x3721b5=_0x524a49[_0x32cae5];return _0x3721b5;}(function(_0x1d4231,_0x896bfd){const _0x5fba5=a28_0x3721,_0x52ca3f=_0x1d4231();while(!![]){try{const _0x55f486=-parseInt(_0x5fba5(0xb8))/0x1*(-parseInt(_0x5fba5(0xac))/0x2)+parseInt(_0x5fba5(0xc6))/0x3+parseInt(_0x5fba5(0x9b))/0x4+parseInt(_0x5fba5(0xc3))/0x5+-parseInt(_0x5fba5(0xc9))/0x6+-parseInt(_0x5fba5(0xca))/0x7*(-parseInt(_0x5fba5(0xb2))/0x8)+parseInt(_0x5fba5(0xa4))/0x9*(-parseInt(_0x5fba5(0xa5))/0xa);if(_0x55f486===_0x896bfd)break;else _0x52ca3f['push'](_0x52ca3f['shift']());}catch(_0x8e269){_0x52ca3f['push'](_0x52ca3f['shift']());}}}(a28_0x524a,0xc6545));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x20e808 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x22317a(0xc1)]='segment:create';['description']=a28_0x22317a(0xb7);async[a28_0x22317a(0xb1)](_0x566f38){const _0x22456d=a28_0x22317a;console[_0x22456d(0xbb)](a28_0x20e808['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x22456d(0xbb)](a28_0x20e808[_0x22456d(0xa1)](_0x22456d(0xa0)));const {options:_0x30f7f1,args:_0x1f35ef,tdx:_0xfddde0}=_0x566f38,_0x51247b=_0x30f7f1;if(_0x1f35ef[_0x22456d(0x9c)]===0x0)return console[_0x22456d(0xbb)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x22456d(0xbb)](_0x22456d(0xc0)),console[_0x22456d(0xbb)]('Examples:'),console[_0x22456d(0xbb)](_0x22456d(0xbf)),console['error'](_0x22456d(0xaf)),console[_0x22456d(0xbb)](_0x22456d(0xc4)),0x1;const _0x4d2179=_0x1f35ef[0x0],_0x4e1ee0=_0x30f7f1[_0x22456d(0xa2)];let _0x244763=_0x4d2179;_0x4e1ee0&&!_0x4d2179[_0x22456d(0xc5)]('/')&&(_0x244763=_0x4e1ee0+'/'+_0x4d2179,_0x51247b[_0x22456d(0xc7)]&&console[_0x22456d(0xbb)](_0x22456d(0xa7)+_0x244763));const _0x3e686e=parsePath(_0x244763);if(_0x3e686e[_0x22456d(0x99)]['length']<0x2)return console[_0x22456d(0xbb)](_0x22456d(0x9a)),console[_0x22456d(0xbb)](_0x22456d(0xb9)),0x1;const _0x5bfb4f=_0x3e686e['segments'][0x0],_0x4efa71=getBaseName(_0x244763),_0x10c945=getParentPath(_0x244763);_0x51247b[_0x22456d(0xc7)]&&(console[_0x22456d(0xbb)](_0x22456d(0xa9)+_0x51247b['site']),console[_0x22456d(0xbb)](_0x22456d(0xc2)+_0x244763),console[_0x22456d(0xbb)]('Parent:\x20'+_0x5bfb4f),console[_0x22456d(0xbb)]('Segment\x20name:\x20'+_0x4efa71),console[_0x22456d(0xbb)](_0x22456d(0xa6)+_0x10c945));const _0x4c4aa7=await withSpinner(_0x22456d(0xb4)+_0x5bfb4f+_0x22456d(0x9f),()=>_0xfddde0[_0x22456d(0xbc)][_0x22456d(0xbd)](_0x5bfb4f),{'verbose':_0x51247b[_0x22456d(0xc7)]}),_0x2415e7=_0x4c4aa7[_0x22456d(0xb3)];let _0x3cdf54;if(_0x3e686e[_0x22456d(0x99)]['length']>0x2){const _0x3d2d23=await withSpinner(_0x22456d(0x9e)+_0x10c945+'\x27...',()=>_0xfddde0[_0x22456d(0xbc)]['resolvePathToResource'](_0x10c945),{'verbose':_0x51247b[_0x22456d(0xc7)]}),_0x5860f2=_0x3d2d23[_0x22456d(0xb3)];if(_0x5860f2[_0x22456d(0xc8)]!=='folder'&&_0x5860f2[_0x22456d(0xc8)]!==_0x22456d(0xad))return console[_0x22456d(0xbb)](_0x22456d(0xbe)),0x1;_0x3cdf54=_0x5860f2[_0x22456d(0xb5)];}else{if(_0x51247b['folder']){const _0x10b910=await withSpinner(_0x22456d(0xaa)+_0x51247b[_0x22456d(0xba)]+_0x22456d(0x9f),()=>_0xfddde0[_0x22456d(0xbc)][_0x22456d(0xb6)](_0x2415e7,_0x51247b[_0x22456d(0xba)]),{'verbose':_0x51247b['verbose']});_0x3cdf54=_0x10b910['data'];}}_0x51247b[_0x22456d(0xc7)]&&_0x3cdf54&&console[_0x22456d(0xbb)](_0x22456d(0xb0)+_0x3cdf54);const _0x1f40b2=await loadJSONFromOptions(_0x51247b[_0x22456d(0xab)],_0x51247b['ruleFile']),_0x182694={'name':_0x4efa71,'description':_0x51247b[_0x22456d(0xa8)],'rule':_0x1f40b2,'kind':_0x51247b[_0x22456d(0xa3)]!==undefined?parseInt(_0x51247b['kind'],0xa):undefined,'isVisible':_0x51247b[_0x22456d(0xcb)]?![]:undefined,'segmentFolderId':_0x3cdf54,'countPopulation':_0x51247b[_0x22456d(0xae)]?![]:undefined},_0x43331a=await withSpinner('Creating\x20segment\x20\x27'+_0x4efa71+_0x22456d(0x9f),()=>_0xfddde0[_0x22456d(0xbc)][_0x22456d(0x9d)](_0x2415e7,_0x182694),{'verbose':_0x51247b[_0x22456d(0xc7)]}),_0x356de0=_0x43331a['data'];return console[_0x22456d(0xbb)]('✔\x20Created\x20segment\x20\x27'+_0x356de0[_0x22456d(0xc1)]+'\x27\x20with\x20ID:\x20'+_0x356de0['id']),_0x244763!==_0x4d2179&&console['error']('\x20\x20\x20Path:\x20'+_0x244763),await handleSDKOutput([_0x356de0],_0x51247b),0x0;}}
@@ -1 +1 @@
1
- function a29_0x287b(_0x71364b,_0x4e8739){_0x71364b=_0x71364b-0x108;const _0x423969=a29_0x4239();let _0x287b48=_0x423969[_0x71364b];return _0x287b48;}const a29_0x34f0a8=a29_0x287b;(function(_0x15fda3,_0x28bfb7){const _0x4264e3=a29_0x287b,_0x59f366=_0x15fda3();while(!![]){try{const _0x5acb82=parseInt(_0x4264e3(0x112))/0x1+parseInt(_0x4264e3(0x10a))/0x2*(-parseInt(_0x4264e3(0x118))/0x3)+parseInt(_0x4264e3(0x119))/0x4*(parseInt(_0x4264e3(0x113))/0x5)+-parseInt(_0x4264e3(0x117))/0x6*(-parseInt(_0x4264e3(0x10b))/0x7)+parseInt(_0x4264e3(0x10e))/0x8+parseInt(_0x4264e3(0x11e))/0x9*(-parseInt(_0x4264e3(0x11d))/0xa)+-parseInt(_0x4264e3(0x122))/0xb;if(_0x5acb82===_0x28bfb7)break;else _0x59f366['push'](_0x59f366['shift']());}catch(_0x1ba923){_0x59f366['push'](_0x59f366['shift']());}}}(a29_0x4239,0x59844));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x4239(){const _0x1edb3f=['Listing\x20fields\x20for\x20\x27','data','574542QxlwUA','35NLXDEY','segment:fields','\x20field','Site:\x20','995430rFzMXF','20757xgpIss','182332winGoZ','description','\x27...','json','20ECWlfP','1120374QmeZmU','name','jsonl','List\x20available\x20fields\x20for\x20segmentation','12076042yTbcAG','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','error','✔\x20Found\x20','parentSegment','8KYazXY','28gxRfKP','length','site','1471096nkJquo','verbose'];a29_0x4239=function(){return _0x1edb3f;};return a29_0x4239();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x34f0a8(0x11f)]=a29_0x34f0a8(0x114);[a29_0x34f0a8(0x11a)]=a29_0x34f0a8(0x121);async['execute'](_0x41a92c){const _0x5ef4b5=a29_0x34f0a8,{options:_0x3bf258,args:_0x1c99f5,tdx:_0x2c344a}=_0x41a92c,_0x256617=_0x1c99f5[0x0]||_0x3bf258[_0x5ef4b5(0x109)];if(!_0x256617)return console[_0x5ef4b5(0x124)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x5ef4b5(0x124)](_0x5ef4b5(0x123)),console[_0x5ef4b5(0x124)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x3bf258[_0x5ef4b5(0x10f)]&&(console[_0x5ef4b5(0x124)](_0x5ef4b5(0x116)+_0x3bf258[_0x5ef4b5(0x10d)]),console[_0x5ef4b5(0x124)]('Parent\x20segment:\x20'+_0x256617));const _0x5be261=await withSpinner(_0x5ef4b5(0x110)+_0x256617+_0x5ef4b5(0x11b),()=>_0x2c344a['segment']['listFields'](_0x256617),{'verbose':_0x3bf258[_0x5ef4b5(0x10f)]}),_0x2b003b=_0x5be261[_0x5ef4b5(0x111)];console['error'](_0x5ef4b5(0x108)+_0x2b003b[_0x5ef4b5(0x10c)]+_0x5ef4b5(0x115)+(_0x2b003b['length']!==0x1?'s':''));if(_0x3bf258[_0x5ef4b5(0x11c)]||_0x3bf258[_0x5ef4b5(0x120)])return await handleSDKOutput(_0x2b003b,_0x3bf258),0x0;return displayFieldsHumanReadable(_0x2b003b,_0x256617),0x0;}}
1
+ const a29_0x3a8d8a=a29_0x1b74;(function(_0xc5867c,_0xd2fd1a){const _0x3be3f1=a29_0x1b74,_0x5d624a=_0xc5867c();while(!![]){try{const _0x6c7f72=-parseInt(_0x3be3f1(0x8a))/0x1+parseInt(_0x3be3f1(0x86))/0x2+parseInt(_0x3be3f1(0x71))/0x3+-parseInt(_0x3be3f1(0x80))/0x4+-parseInt(_0x3be3f1(0x7c))/0x5+-parseInt(_0x3be3f1(0x81))/0x6+parseInt(_0x3be3f1(0x7e))/0x7;if(_0x6c7f72===_0xd2fd1a)break;else _0x5d624a['push'](_0x5d624a['shift']());}catch(_0x2dad92){_0x5d624a['push'](_0x5d624a['shift']());}}}(a29_0x1e86,0x56f9a));function a29_0x1b74(_0x514ba7,_0xfa5cdd){_0x514ba7=_0x514ba7-0x71;const _0x1e86b1=a29_0x1e86();let _0x1b744f=_0x1e86b1[_0x514ba7];return _0x1b744f;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x1e86(){const _0x5d91c2=['1155044GxKQzm','description','\x20field','length','483139SPEvAj','645513KMCnzN','json','segment','verbose','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment:fields','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','listFields','jsonl','456795xngnGj','✔\x20Found\x20','2791635kxGwQc','error','40472UQLOYW','1503792qjUKJE','parentSegment','site','Site:\x20','Listing\x20fields\x20for\x20\x27'];a29_0x1e86=function(){return _0x5d91c2;};return a29_0x1e86();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a29_0x3a8d8a(0x77);[a29_0x3a8d8a(0x87)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x3595b8){const _0x562d76=a29_0x3a8d8a,{options:_0x16751c,args:_0x4cef08,tdx:_0x5e8543}=_0x3595b8,_0x234753=_0x4cef08[0x0]||_0x16751c[_0x562d76(0x82)];if(!_0x234753)return console[_0x562d76(0x7f)](_0x562d76(0x75)),console['error'](_0x562d76(0x79)),console[_0x562d76(0x7f)](_0x562d76(0x76)),0x1;_0x16751c[_0x562d76(0x74)]&&(console[_0x562d76(0x7f)](_0x562d76(0x84)+_0x16751c[_0x562d76(0x83)]),console[_0x562d76(0x7f)]('Parent\x20segment:\x20'+_0x234753));const _0x3ade0e=await withSpinner(_0x562d76(0x85)+_0x234753+'\x27...',()=>_0x5e8543[_0x562d76(0x73)][_0x562d76(0x7a)](_0x234753),{'verbose':_0x16751c[_0x562d76(0x74)]}),_0x26cce8=_0x3ade0e[_0x562d76(0x78)];console[_0x562d76(0x7f)](_0x562d76(0x7d)+_0x26cce8['length']+_0x562d76(0x88)+(_0x26cce8[_0x562d76(0x89)]!==0x1?'s':''));if(_0x16751c[_0x562d76(0x72)]||_0x16751c[_0x562d76(0x7b)])return await handleSDKOutput(_0x26cce8,_0x16751c),0x0;return displayFieldsHumanReadable(_0x26cce8,_0x234753),0x0;}}
@@ -1 +1 @@
1
- const a30_0x349ffc=a30_0x5f1c;function a30_0x5f1c(_0x4ff195,_0x3e25c2){_0x4ff195=_0x4ff195-0x7f;const _0x1fcbce=a30_0x1fcb();let _0x5f1c3f=_0x1fcbce[_0x4ff195];return _0x5f1c3f;}(function(_0x2b465b,_0x46239f){const _0xc7873d=a30_0x5f1c,_0x418935=_0x2b465b();while(!![]){try{const _0x1c8a69=-parseInt(_0xc7873d(0x85))/0x1+parseInt(_0xc7873d(0x83))/0x2+-parseInt(_0xc7873d(0x86))/0x3+-parseInt(_0xc7873d(0x9e))/0x4+-parseInt(_0xc7873d(0xa6))/0x5+parseInt(_0xc7873d(0xa1))/0x6*(-parseInt(_0xc7873d(0x9a))/0x7)+parseInt(_0xc7873d(0xb4))/0x8;if(_0x1c8a69===_0x46239f)break;else _0x418935['push'](_0x418935['shift']());}catch(_0x8e79d6){_0x418935['push'](_0x418935['shift']());}}}(a30_0x1fcb,0xe4ce9));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0xf0e96 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x4ca473 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a30_0x1fcb(){const _0x5722d2=['activations','dim','\x20\x20Target:\x20','no_parent','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','parentSegment','Error:\x20','41268768PUndjn','parentName','✔\x20Pulled\x20','targetDir','Aborted.','dryRun','\x20unchanged\x20files','verbose','\x20changed\x20files','session','data','red','journeyVersions','file','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20files\x20to\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','yes','\x0aPull\x20summary\x20for\x20\x27','\x20journeys','message','yellow','site','298968Mtmrdj','cwd','703297SQHTPu','1341744GMVGYK','errorCode','isNew','setPhase','parent_segment','cyan','resourceName','filter','\x20with\x20','absolutePath','Pulling\x20segments\x20from\x20\x27','execute','error','counts','\x20activations','hasChanges','\x20new\x20files','Target\x20resource:\x20','Write\x20','\x20\x20🎯\x20','161728Jjttqp','helpText','green','name','6589788SPYoqu','segment:pull','journeys','234pNzluS','✔\x20Context\x20set:\x20','length','description','\x20versions)','3359195GeoIBn','files','diff','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)','dirname','\x27...','\x20segments'];a30_0x1fcb=function(){return _0x5722d2;};return a30_0x1fcb();}export class SegmentPullCommand extends BaseCommand{[a30_0x349ffc(0x9d)]=a30_0x349ffc(0x9f);[a30_0x349ffc(0xa4)]=a30_0x349ffc(0xc2);async[a30_0x349ffc(0x91)](_0x1509ec){const _0x4856fb=a30_0x349ffc,{options:_0x588ec3,args:_0x251a62,tdx:_0x1a2c74}=_0x1509ec,_0x496876=_0x588ec3,_0x58b2d2=await resolveTarget({'arg':_0x251a62[0x0],'contextParent':_0x588ec3[_0x4856fb(0xb2)],'cwd':process[_0x4856fb(0x84)]()});if(!isSuccessfulResolution(_0x58b2d2))return _0x58b2d2[_0x4856fb(0x87)]===_0x4856fb(0xb0)?(console[_0x4856fb(0x92)](a30_0xf0e96[_0x4856fb(0x81)](_0x4856fb(0xc4))),console[_0x4856fb(0x92)](_0x4856fb(0xa9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x4856fb(0x92)](a30_0xf0e96[_0x4856fb(0xbf)](_0x4856fb(0xb3)+_0x58b2d2[_0x4856fb(0x80)]+'\x0a')),_0x58b2d2['helpText']&&console['error'](a30_0xf0e96[_0x4856fb(0x8b)](_0x58b2d2[_0x4856fb(0x9b)]))),0x1;const _0x28c3e0=_0x58b2d2[_0x4856fb(0xb5)],_0x2e720c=_0x58b2d2[_0x4856fb(0xb7)],_0x3b093c=_0x58b2d2['type']===_0x4856fb(0xc1)?_0x58b2d2[_0x4856fb(0x8c)]:undefined;_0x496876[_0x4856fb(0xbb)]&&(console[_0x4856fb(0x92)]('Site:\x20'+_0x496876[_0x4856fb(0x82)]),console[_0x4856fb(0x92)]('Parent\x20segment:\x20'+_0x28c3e0),_0x3b093c&&console[_0x4856fb(0x92)](_0x4856fb(0x97)+_0x3b093c));const _0x57ba2d=await withProgressSpinner(_0x4856fb(0x90)+_0x28c3e0+_0x4856fb(0xab),_0x1cf928=>_0x1a2c74['segment']['pullSegments'](_0x28c3e0,{'targetDir':_0x2e720c,'targetResourceName':_0x3b093c,'verbose':_0x496876[_0x4856fb(0xbb)],'progress':{'update':_0x172087=>{const _0x4a04ba=_0x4856fb;_0x1cf928[_0x4a04ba(0x89)](_0x172087),_0x496876[_0x4a04ba(0xbb)]&&console[_0x4a04ba(0x92)]('\x20\x20'+_0x172087);}}}),{'verbose':_0x496876[_0x4856fb(0xbb)]}),_0x51e6a0=_0x57ba2d[_0x4856fb(0xbe)];if(_0x51e6a0['counts']['segments']===0x0&&_0x51e6a0[_0x4856fb(0x93)][_0x4856fb(0xa0)]===0x0)return console[_0x4856fb(0x92)](a30_0xf0e96['yellow'](_0x4856fb(0xb1)+_0x51e6a0[_0x4856fb(0xb5)]+'\x27')),0x0;const _0x210c39=_0x51e6a0[_0x4856fb(0xa7)][_0x4856fb(0x8d)](_0x38d66a=>_0x38d66a[_0x4856fb(0x88)]),_0x32aadb=_0x51e6a0[_0x4856fb(0xa7)]['filter'](_0x48b504=>!_0x48b504[_0x4856fb(0x88)]&&_0x48b504[_0x4856fb(0x95)]),_0x330ac4=_0x51e6a0[_0x4856fb(0xa7)]['filter'](_0x341574=>!_0x341574[_0x4856fb(0x88)]&&!_0x341574['hasChanges']);console['error'](_0x4856fb(0xc6)+_0x51e6a0[_0x4856fb(0xb5)]+'\x27:'),console[_0x4856fb(0x92)](_0x4856fb(0x99)+a30_0xf0e96[_0x4856fb(0x8b)](_0x51e6a0[_0x4856fb(0x93)]['segments']+_0x4856fb(0xac))+_0x4856fb(0x8e)+a30_0xf0e96[_0x4856fb(0x8b)](_0x51e6a0['counts'][_0x4856fb(0xad)]+_0x4856fb(0x94)));if(_0x51e6a0['counts'][_0x4856fb(0xa0)]>0x0){const _0x117a93=_0x51e6a0[_0x4856fb(0x93)][_0x4856fb(0xc0)]>_0x51e6a0[_0x4856fb(0x93)][_0x4856fb(0xa0)]?'\x20('+_0x51e6a0[_0x4856fb(0x93)]['journeyVersions']+_0x4856fb(0xa5):'';console['error']('\x20\x20🗺️\x20\x20'+a30_0xf0e96[_0x4856fb(0x8b)](_0x51e6a0['counts']['journeys']+_0x4856fb(0x7f))+a30_0xf0e96[_0x4856fb(0xae)](_0x117a93));}console['error']('\x20\x20'+a30_0xf0e96[_0x4856fb(0x9c)]('+\x20'+_0x210c39[_0x4856fb(0xa3)]+_0x4856fb(0x96))),console['error']('\x20\x20'+a30_0xf0e96['yellow']('~\x20'+_0x32aadb[_0x4856fb(0xa3)]+_0x4856fb(0xbc))),console[_0x4856fb(0x92)]('\x20\x20'+a30_0xf0e96[_0x4856fb(0xae)]('=\x20'+_0x330ac4['length']+_0x4856fb(0xba))),console['error'](_0x4856fb(0xaf)+a30_0xf0e96[_0x4856fb(0x8b)](_0x51e6a0['targetDir'])+'\x0a');if(_0x32aadb[_0x4856fb(0xa3)]>0x0)for(const _0x5b3570 of _0x32aadb){console[_0x4856fb(0x92)]('\x0aChanges\x20to\x20\x27'+_0x5b3570['relativePath']+'\x27:'),console[_0x4856fb(0x92)]('─'['repeat'](0x3c)),console[_0x4856fb(0x92)](_0x5b3570[_0x4856fb(0xa8)]),console[_0x4856fb(0x92)]('─'['repeat'](0x3c));}if(_0x496876[_0x4856fb(0xb9)])return console['error'](a30_0xf0e96[_0x4856fb(0x81)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x210c39[_0x4856fb(0xa3)]===0x0&&_0x32aadb[_0x4856fb(0xa3)]===0x0)return console[_0x4856fb(0x92)](a30_0xf0e96[_0x4856fb(0x9c)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x51e6a0['parentName']},_0x496876['session']),console[_0x4856fb(0x92)](a30_0xf0e96['green'](_0x4856fb(0xa2)+a30_0xf0e96[_0x4856fb(0xae)](_0x4856fb(0x8a))+'\x20=\x20'+a30_0xf0e96[_0x4856fb(0x8b)](_0x51e6a0[_0x4856fb(0xb5)]))),0x0;if(!_0x496876[_0x4856fb(0xc5)]){const _0x54b759=await confirmKey(_0x4856fb(0x98)+(_0x210c39[_0x4856fb(0xa3)]+_0x32aadb[_0x4856fb(0xa3)])+'\x20files?');if(!_0x54b759)return console[_0x4856fb(0x92)](_0x4856fb(0xb8)),0x1;}for(const _0x2cbfb0 of _0x51e6a0[_0x4856fb(0xa7)]){if(_0x2cbfb0[_0x4856fb(0x88)]||_0x2cbfb0['hasChanges']){const _0x1a21fa=a30_0x4ca473[_0x4856fb(0xaa)](_0x2cbfb0[_0x4856fb(0x8f)]);!existsSync(_0x1a21fa)&&mkdirSync(_0x1a21fa,{'recursive':!![]}),writeFileSync(_0x2cbfb0[_0x4856fb(0x8f)],_0x2cbfb0['content'],'utf-8');}}return console[_0x4856fb(0x92)](a30_0xf0e96['green'](_0x4856fb(0xb6)+(_0x210c39[_0x4856fb(0xa3)]+_0x32aadb[_0x4856fb(0xa3)])+_0x4856fb(0xc3)+_0x51e6a0[_0x4856fb(0xb7)])),saveSessionContext({'parent_segment':_0x51e6a0[_0x4856fb(0xb5)]},_0x496876[_0x4856fb(0xbd)]),console[_0x4856fb(0x92)](a30_0xf0e96[_0x4856fb(0x9c)]('✔\x20Context\x20set:\x20'+a30_0xf0e96[_0x4856fb(0xae)](_0x4856fb(0x8a))+'\x20=\x20'+a30_0xf0e96[_0x4856fb(0x8b)](_0x51e6a0[_0x4856fb(0xb5)]))),0x0;}}
1
+ const a30_0x1eb9b3=a30_0x5d5a;(function(_0x3bfb99,_0x27304a){const _0x27cefb=a30_0x5d5a,_0x44dd34=_0x3bfb99();while(!![]){try{const _0x10bbde=parseInt(_0x27cefb(0x159))/0x1*(parseInt(_0x27cefb(0x175))/0x2)+parseInt(_0x27cefb(0x18e))/0x3+parseInt(_0x27cefb(0x17a))/0x4*(-parseInt(_0x27cefb(0x149))/0x5)+parseInt(_0x27cefb(0x167))/0x6*(-parseInt(_0x27cefb(0x168))/0x7)+parseInt(_0x27cefb(0x190))/0x8+-parseInt(_0x27cefb(0x193))/0x9+-parseInt(_0x27cefb(0x15e))/0xa*(-parseInt(_0x27cefb(0x18a))/0xb);if(_0x10bbde===_0x27304a)break;else _0x44dd34['push'](_0x44dd34['shift']());}catch(_0x322e5a){_0x44dd34['push'](_0x44dd34['shift']());}}}(a30_0x27b1,0xc1650));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a30_0x27b1(){const _0x42207d=['files','journeys','verbose','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)','execute','\x20versions)','\x20files\x20to\x20','Target\x20resource:\x20','absolutePath','length','\x20\x20🎯\x20','segments','yes','51689GLKxkn','Write\x20','site','\x20\x20Target:\x20','3063144gFLCSp','hasChanges','5755472SnkvlK','green','\x20journeys','7858269ySOMNe','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','dim','\x20segments','✔\x20Context\x20set:\x20','journeyVersions','pullSegments','isNew','5BdDNvc','parentSegment','\x20changed\x20files','\x20files?','Aborted.','targetDir','resourceName','✔\x20Pulled\x20','segment:pull','cwd','content','message','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','segment','Error:\x20','2JeZDcV','Site:\x20','\x20activations','cyan','relativePath','710PrIzln','dirname','error','filter','name','data','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parent_segment','parentName','102diBoOn','224462vgTrQL','\x20with\x20','red','\x20\x20🗺️\x20\x20','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','diff','session','repeat','Pulling\x20segments\x20from\x20\x27','errorCode','\x20unchanged\x20files','utf-8','778642rQFWiH','\x0aChanges\x20to\x20\x27','\x20new\x20files','counts','no_parent','2569384OPXkwU','✔\x20All\x20files\x20are\x20up\x20to\x20date','description'];a30_0x27b1=function(){return _0x42207d;};return a30_0x27b1();}import a30_0x2ca5a0 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x108ba8 from'path';function a30_0x5d5a(_0x194911,_0x511f87){_0x194911=_0x194911-0x144;const _0x27b1c7=a30_0x27b1();let _0x5d5ae9=_0x27b1c7[_0x194911];return _0x5d5ae9;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a30_0x1eb9b3(0x162)]=a30_0x1eb9b3(0x151);[a30_0x1eb9b3(0x17c)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a30_0x1eb9b3(0x181)](_0x311b2a){const _0xe60ce9=a30_0x1eb9b3,{options:_0xa6b3e7,args:_0x31cafe,tdx:_0x4073dd}=_0x311b2a,_0x4e0792=_0xa6b3e7,_0x2af95d=await resolveTarget({'arg':_0x31cafe[0x0],'contextParent':_0xa6b3e7[_0xe60ce9(0x14a)],'cwd':process[_0xe60ce9(0x152)]()});if(!isSuccessfulResolution(_0x2af95d))return _0x2af95d[_0xe60ce9(0x172)]===_0xe60ce9(0x179)?(console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16c)](_0xe60ce9(0x164))),console['error'](_0xe60ce9(0x180)),console[_0xe60ce9(0x160)](_0xe60ce9(0x194)),console['error'](_0xe60ce9(0x16d))):(console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16a)](_0xe60ce9(0x158)+_0x2af95d[_0xe60ce9(0x154)]+'\x0a')),_0x2af95d['helpText']&&console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x2af95d['helpText']))),0x1;const _0xe6dda3=_0x2af95d[_0xe60ce9(0x166)],_0x24b80b=_0x2af95d[_0xe60ce9(0x14e)],_0x306f97=_0x2af95d['type']==='file'?_0x2af95d[_0xe60ce9(0x14f)]:undefined;_0x4e0792[_0xe60ce9(0x17f)]&&(console[_0xe60ce9(0x160)](_0xe60ce9(0x15a)+_0x4e0792[_0xe60ce9(0x18c)]),console['error']('Parent\x20segment:\x20'+_0xe6dda3),_0x306f97&&console['error'](_0xe60ce9(0x184)+_0x306f97));const _0x37e50f=await withProgressSpinner(_0xe60ce9(0x171)+_0xe6dda3+'\x27...',_0x4d42cc=>_0x4073dd[_0xe60ce9(0x157)][_0xe60ce9(0x147)](_0xe6dda3,{'targetDir':_0x24b80b,'targetResourceName':_0x306f97,'verbose':_0x4e0792[_0xe60ce9(0x17f)],'progress':{'update':_0x5d4c4c=>{const _0x3e64da=_0xe60ce9;_0x4d42cc['setPhase'](_0x5d4c4c),_0x4e0792[_0x3e64da(0x17f)]&&console['error']('\x20\x20'+_0x5d4c4c);}}}),{'verbose':_0x4e0792[_0xe60ce9(0x17f)]}),_0x1eb3f3=_0x37e50f[_0xe60ce9(0x163)];if(_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x188)]===0x0&&_0x1eb3f3['counts'][_0xe60ce9(0x17e)]===0x0)return console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16c)](_0xe60ce9(0x155)+_0x1eb3f3[_0xe60ce9(0x166)]+'\x27')),0x0;const _0x2e54e9=_0x1eb3f3[_0xe60ce9(0x17d)][_0xe60ce9(0x161)](_0x3e3be0=>_0x3e3be0[_0xe60ce9(0x148)]),_0x2e5133=_0x1eb3f3[_0xe60ce9(0x17d)][_0xe60ce9(0x161)](_0x458b7d=>!_0x458b7d[_0xe60ce9(0x148)]&&_0x458b7d[_0xe60ce9(0x18f)]),_0x265409=_0x1eb3f3[_0xe60ce9(0x17d)][_0xe60ce9(0x161)](_0x21f4b7=>!_0x21f4b7[_0xe60ce9(0x148)]&&!_0x21f4b7[_0xe60ce9(0x18f)]);console[_0xe60ce9(0x160)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1eb3f3['parentName']+'\x27:'),console[_0xe60ce9(0x160)](_0xe60ce9(0x187)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x188)]+_0xe60ce9(0x144))+_0xe60ce9(0x169)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3[_0xe60ce9(0x178)]['activations']+_0xe60ce9(0x15b)));if(_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x17e)]>0x0){const _0x2bca4a=_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x146)]>_0x1eb3f3[_0xe60ce9(0x178)]['journeys']?'\x20('+_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x146)]+_0xe60ce9(0x182):'';console['error'](_0xe60ce9(0x16b)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3[_0xe60ce9(0x178)][_0xe60ce9(0x17e)]+_0xe60ce9(0x192))+a30_0x2ca5a0[_0xe60ce9(0x195)](_0x2bca4a));}console['error']('\x20\x20'+a30_0x2ca5a0[_0xe60ce9(0x191)]('+\x20'+_0x2e54e9[_0xe60ce9(0x186)]+_0xe60ce9(0x177))),console[_0xe60ce9(0x160)]('\x20\x20'+a30_0x2ca5a0[_0xe60ce9(0x16c)]('~\x20'+_0x2e5133[_0xe60ce9(0x186)]+_0xe60ce9(0x14b))),console['error']('\x20\x20'+a30_0x2ca5a0[_0xe60ce9(0x195)]('=\x20'+_0x265409[_0xe60ce9(0x186)]+_0xe60ce9(0x173))),console['error'](_0xe60ce9(0x18d)+a30_0x2ca5a0[_0xe60ce9(0x15c)](_0x1eb3f3['targetDir'])+'\x0a');if(_0x2e5133['length']>0x0)for(const _0x3302b7 of _0x2e5133){console['error'](_0xe60ce9(0x176)+_0x3302b7[_0xe60ce9(0x15d)]+'\x27:'),console['error']('─'[_0xe60ce9(0x170)](0x3c)),console[_0xe60ce9(0x160)](_0x3302b7[_0xe60ce9(0x16e)]),console[_0xe60ce9(0x160)]('─'[_0xe60ce9(0x170)](0x3c));}if(_0x4e0792['dryRun'])return console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x16c)](_0xe60ce9(0x156))),0x0;if(_0x2e54e9[_0xe60ce9(0x186)]===0x0&&_0x2e5133[_0xe60ce9(0x186)]===0x0)return console['error'](a30_0x2ca5a0[_0xe60ce9(0x191)](_0xe60ce9(0x17b))),saveSessionContext({'parent_segment':_0x1eb3f3[_0xe60ce9(0x166)]},_0x4e0792['session']),console[_0xe60ce9(0x160)](a30_0x2ca5a0['green'](_0xe60ce9(0x145)+a30_0x2ca5a0['dim'](_0xe60ce9(0x165))+'\x20=\x20'+a30_0x2ca5a0['cyan'](_0x1eb3f3[_0xe60ce9(0x166)]))),0x0;if(!_0x4e0792[_0xe60ce9(0x189)]){const _0x33f273=await confirmKey(_0xe60ce9(0x18b)+(_0x2e54e9[_0xe60ce9(0x186)]+_0x2e5133['length'])+_0xe60ce9(0x14c));if(!_0x33f273)return console[_0xe60ce9(0x160)](_0xe60ce9(0x14d)),0x1;}for(const _0x536de6 of _0x1eb3f3[_0xe60ce9(0x17d)]){if(_0x536de6[_0xe60ce9(0x148)]||_0x536de6['hasChanges']){const _0x36772a=a30_0x108ba8[_0xe60ce9(0x15f)](_0x536de6['absolutePath']);!existsSync(_0x36772a)&&mkdirSync(_0x36772a,{'recursive':!![]}),writeFileSync(_0x536de6[_0xe60ce9(0x185)],_0x536de6[_0xe60ce9(0x153)],_0xe60ce9(0x174));}}return console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x191)](_0xe60ce9(0x150)+(_0x2e54e9[_0xe60ce9(0x186)]+_0x2e5133['length'])+_0xe60ce9(0x183)+_0x1eb3f3[_0xe60ce9(0x14e)])),saveSessionContext({'parent_segment':_0x1eb3f3['parentName']},_0x4e0792[_0xe60ce9(0x16f)]),console[_0xe60ce9(0x160)](a30_0x2ca5a0[_0xe60ce9(0x191)](_0xe60ce9(0x145)+a30_0x2ca5a0[_0xe60ce9(0x195)]('parent_segment')+'\x20=\x20'+a30_0x2ca5a0['cyan'](_0x1eb3f3['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a31_0xd6e430=a31_0xe641;(function(_0x3fcf4e,_0x4430c6){const _0x48f756=a31_0xe641,_0x4636ef=_0x3fcf4e();while(!![]){try{const _0x2f1772=parseInt(_0x48f756(0x153))/0x1+-parseInt(_0x48f756(0x11a))/0x2*(-parseInt(_0x48f756(0x15f))/0x3)+parseInt(_0x48f756(0xfc))/0x4*(parseInt(_0x48f756(0x124))/0x5)+-parseInt(_0x48f756(0xf8))/0x6+-parseInt(_0x48f756(0xf0))/0x7+parseInt(_0x48f756(0xf9))/0x8+-parseInt(_0x48f756(0xf5))/0x9;if(_0x2f1772===_0x4430c6)break;else _0x4636ef['push'](_0x4636ef['shift']());}catch(_0x44561e){_0x4636ef['push'](_0x4636ef['shift']());}}}(a31_0x231e,0xbf2ab));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a31_0x231e(){const _0x1fbba8=['getOutputSchemaWithCache','getParent','file','no_parent','set','join','new','/e/','\x0aValidation\x20failed:','(Journey\x20will\x20be\x20deleted)','idToName','\x20to\x20create','segmentFolderId','\x20changed','scopedFolderPath','parentName','/j/da/je','diff','changed','name','dim','1364803yuOgzP','\x20activations]','relationships','journeyBundleName','Parent\x20segment:\x20','\x27...','map','\x20\x20Journeys:\x20','\x20to\x20update','helpText','red','\x20YAML\x20files\x20found','33jkhYKH','Changes\x20to:','Fetching\x20existing\x20segments...','data','toDelete','buildUserMaps','Aborted.','targetDir','add','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','green','attributes','repeat','Fetching\x20connections\x20for\x20name\x20resolution...','filePath','createdSegmentIds','Resolving\x20parent\x20segment\x20\x27','segments','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x0a✔\x20Push\x20complete','listSegments','\x20unchanged','Site:\x20','yes','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','audienceId','Fetching\x20existing\x20journeys...','Error:\x20Directory\x20not\x20found:\x20','push','createdAt','user','delete','\x20new','folders','8826594WkNFnh','blue','\x20\x20\x20\x20','.yaml','type','1427976RxMunb','Preparing\x20journeys...','\x20created','6886014nptHqy','652696WOfNMd','folderPath','unchanged','100244FHPJVv','list','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20\x20Activations:\x20','all','existingJourney','activations','created','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','endsWith','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','verbose','cyan','segment','Fetching\x20users\x20for\x20email\x20resolution...','updatedAt','then','Error:\x20','Error\x20parsing\x20YAML:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','/app/ps/','parent_name','\x20\x20Activations:','length','yamlConfig','yellow','journeys','\x20updated','error','209468vXmqXS','resolveParentId','site','isNew','dryRun','\x20changes?','\x20\x20🗺️\x20\x20Journeys:','Fetching\x20parent\x20segment\x20details...','toCreate','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','150ALMHiw','versionNumber','journey','paused','listFolders','message','toUpdate','\x20to\x20delete','No\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Folders\x20to\x20create:','journeyId','results','connection','description','folderId','updated','Delete\x20segment:','\x20deleted','execute','Push\x20','listActivations','state','Fetching\x20existing\x20folders...','journeysOnly','nameToId'];a31_0x231e=function(){return _0x1fbba8;};return a31_0x231e();}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x122508 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a31_0xe641(_0x25b6ba,_0x2c9ebc){_0x25b6ba=_0x25b6ba-0xec;const _0x231e47=a31_0x231e();let _0xe6411a=_0x231e47[_0x25b6ba];return _0xe6411a;}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{[a31_0xd6e430(0x151)]='segment:push';[a31_0xd6e430(0x132)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a31_0xd6e430(0x137)](_0x3297ce){const _0x3d8126=a31_0xd6e430,{options:_0x32caa5,args:_0x5d0d09,tdx:_0x37fd5f}=_0x3297ce,_0x1cf44e=_0x32caa5,_0x2d1ef1=await resolveTarget({'arg':_0x5d0d09[0x0],'contextParent':_0x32caa5['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2d1ef1))return _0x2d1ef1['errorCode']===_0x3d8126(0x141)?(console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x116)](_0x3d8126(0x105))),console[_0x3d8126(0x119)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x3d8126(0x119)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x10e)+_0x2d1ef1[_0x3d8126(0x129)]+'\x0a')),_0x2d1ef1[_0x3d8126(0x15c)]&&console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x109)](_0x2d1ef1[_0x3d8126(0x15c)]))),0x1;if(_0x2d1ef1[_0x3d8126(0xf4)]===_0x3d8126(0x112))return console['error'](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x17a)+_0x2d1ef1['targetDir']+'\x0a')),console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x109)](_0x3d8126(0x171))),0x1;const _0x295a8e=_0x2d1ef1[_0x3d8126(0x14d)],_0x1f827d=_0x2d1ef1[_0x3d8126(0x166)],_0x1aca53=_0x2d1ef1[_0x3d8126(0xf4)]===_0x3d8126(0x140)?_0x2d1ef1[_0x3d8126(0x16d)]:undefined,_0x4a5fa3=getScopedDetails(_0x2d1ef1),_0x41c5a5=_0x4a5fa3?.['isScoped']??![],_0xb420a6=_0x4a5fa3?.[_0x3d8126(0x14c)]??'';if(!existsSync(_0x1f827d))return console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x17a)+_0x1f827d+'\x0a')),console[_0x3d8126(0x119)](a31_0x122508['cyan'](_0x3d8126(0x171))),0x1;_0x1cf44e[_0x3d8126(0x108)]&&(console['error'](_0x3d8126(0x175)+_0x1cf44e['site']),console[_0x3d8126(0x119)](_0x3d8126(0x157)+_0x295a8e),console[_0x3d8126(0x119)]('Source\x20directory:\x20'+_0x1f827d),_0x41c5a5&&console[_0x3d8126(0x119)]('Scoped\x20to\x20folder:\x20'+_0xb420a6));const _0x535d92=await withSpinner(_0x3d8126(0x16f)+_0x295a8e+_0x3d8126(0x158),()=>_0x37fd5f[_0x3d8126(0x10a)][_0x3d8126(0x11b)](_0x295a8e),{'verbose':_0x1cf44e['verbose']}),_0x47fa64=_0x535d92['data'],[_0x4905b2,_0x3b4a68,_0x4d64a7,_0x2d40b4,_0xdc4e72]=await Promise[_0x3d8126(0x101)]([withSpinner(_0x3d8126(0x121),()=>_0x37fd5f[_0x3d8126(0x10a)][_0x3d8126(0x13f)](_0x47fa64),{'verbose':_0x1cf44e[_0x3d8126(0x108)]}),withSpinner(_0x3d8126(0x161),()=>_0x37fd5f[_0x3d8126(0x10a)][_0x3d8126(0x173)](_0x47fa64),{'verbose':_0x1cf44e[_0x3d8126(0x108)]}),withSpinner(_0x3d8126(0x13b),()=>_0x37fd5f[_0x3d8126(0x10a)][_0x3d8126(0x128)](_0x47fa64),{'verbose':_0x1cf44e['verbose']}),withSpinner(_0x3d8126(0x179),()=>_0x37fd5f[_0x3d8126(0x126)]['listJourneysWithDetailsFromParentSegment'](_0x47fa64,{'includeAllVersions':!![]}),{'verbose':_0x1cf44e[_0x3d8126(0x108)]}),withSpinner(_0x3d8126(0x10b),()=>_0x37fd5f[_0x3d8126(0xec)][_0x3d8126(0x164)](),{'verbose':_0x1cf44e[_0x3d8126(0x108)]})[_0x3d8126(0x10d)](_0xe6546a=>_0xe6546a[_0x3d8126(0x162)])]),_0x469a6f=_0x4905b2['data'],_0x102a86=extractRootFolderId(_0x469a6f),_0x1a2f98=_0x3b4a68[_0x3d8126(0x162)],_0x206908=_0x4d64a7[_0x3d8126(0x162)],{journeys:_0x588822,activationStepsById:_0xea6f95}=_0x2d40b4[_0x3d8126(0x162)],_0x40fc04=new Map(_0x588822[_0x3d8126(0x159)](_0x142724=>[_0x142724['id'],_0x142724])),_0x337a80=_0x588822['map'](_0x3a770a=>({'id':_0x3a770a['id'],'name':_0x3a770a[_0x3d8126(0x16a)]['name'],'journeyBundleName':_0x3a770a['attributes']['journeyBundleName']||'','journeyBundleId':_0x3a770a[_0x3d8126(0x16a)]['journeyBundleId']||'','versionNumber':_0x3a770a[_0x3d8126(0x16a)][_0x3d8126(0x125)],'description':_0x3a770a['attributes'][_0x3d8126(0x132)],'state':_0x3a770a['attributes'][_0x3d8126(0x13a)],'paused':_0x3a770a[_0x3d8126(0x16a)][_0x3d8126(0x127)],'audienceId':_0x3a770a[_0x3d8126(0x16a)][_0x3d8126(0x178)],'folderId':_0x3a770a[_0x3d8126(0x155)]?.['parentFolder']?.[_0x3d8126(0x162)]?.['id'],'createdAt':_0x3a770a['attributes'][_0x3d8126(0x17c)],'updatedAt':_0x3a770a[_0x3d8126(0x16a)][_0x3d8126(0x10c)]})),{emailToId:_0x3c1dbb,idToEmail:_0x12a8af}=_0xdc4e72,_0x584688=await withSpinner(_0x3d8126(0x16c),async()=>{const _0x332aeb=_0x3d8126,_0x4af7a3=await _0x37fd5f[_0x332aeb(0x131)][_0x332aeb(0xfd)]();return buildConnectionMaps(_0x4af7a3);},{'verbose':_0x1cf44e['verbose']})['then'](_0x8936d0=>_0x8936d0[_0x3d8126(0x162)]),_0x32f0bd=_0x584688[_0x3d8126(0x13d)],_0x1fe97b=_0x584688[_0x3d8126(0x148)],_0x16bfdf=_0x584688['nameToType'],_0x890e6e={'emailToIdMap':_0x3c1dbb,'connectionNameToIdMap':_0x32f0bd,'connectionNameToTypeMap':_0x16bfdf,'getSchema':_0x45b377=>_0x37fd5f[_0x3d8126(0x131)][_0x3d8126(0x13e)](_0x45b377)};let {pathToId:_0x314261,idToPath:_0x4d5151}=buildFolderMaps(_0x206908);const _0x4a6b4b=buildSegmentLookupMap(_0x1a2f98,_0x4d5151),_0x1b42cd=buildSegmentNameToIdMap(_0x1a2f98),_0x466606=buildJourneyBundleLookupMap(_0x337a80,_0x4d5151);let _0x46c939;if(_0x1aca53){if(!_0x1aca53[_0x3d8126(0x106)]('.yml')&&!_0x1aca53[_0x3d8126(0x106)](_0x3d8126(0xf3)))return console['error'](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0xfe)+_0x1aca53+'\x0a')),0x1;_0x46c939=[_0x1aca53];}else _0x46c939=findYamlFiles(_0x1f827d);if(_0x46c939['length']===0x0)return console['error'](a31_0x122508['red'](_0x3d8126(0x123)+_0x1f827d+'\x0a')),console['error'](a31_0x122508['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x4fe6ef,_0x2d56d1;try{const _0x49f79a=parseAndClassifyYamlFiles(_0x46c939,_0x1f827d,{'skipSegments':_0x1cf44e['journeysOnly']});_0x4fe6ef=_0x49f79a[_0x3d8126(0x170)],_0x2d56d1=_0x49f79a[_0x3d8126(0x117)];const _0x57f931=validateParsedFiles(_0x49f79a,_0x1f827d);if(_0x57f931[_0x3d8126(0x114)]>0x0)return console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x146))),console['error'](formatValidationErrors(_0x57f931)),console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x116)](_0x3d8126(0xff))),0x1;}catch(_0x52ecca){return console['error'](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x10f)+(_0x52ecca instanceof Error?_0x52ecca[_0x3d8126(0x129)]:_0x52ecca))),0x1;}if(_0x4fe6ef['length']===0x0&&_0x2d56d1['length']===0x0){const _0x1022fc=_0x1cf44e[_0x3d8126(0x13c)]?_0x3d8126(0x126):'segment\x20or\x20journey';return console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x116)](_0x3d8126(0x12c)+_0x1022fc+_0x3d8126(0x15e))),0x0;}const _0xe87194=new Map();_0x1a2f98[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x1a2f98,async _0x188201=>{const _0x1fc608=a31_0xe641,_0x35b3c7=await _0x37fd5f['segment'][_0x1fc608(0x139)](_0x47fa64,_0x188201['id']);_0xe87194[_0x1fc608(0x142)](_0x188201['id'],_0x35b3c7);});},{'verbose':_0x1cf44e[_0x3d8126(0x108)]});const {segmentFiles:_0x199ab8,foldersToCreate:_0x488439}=await prepareSegmentFiles(_0x4fe6ef,{'segmentByFolderAndName':_0x4a6b4b,'activationsBySegmentId':_0xe87194,'folderPathToId':_0x314261,'idToEmailMap':_0x12a8af,'connectionIdToNameMap':_0x1fe97b},_0x890e6e,_0x41c5a5,_0xb420a6),_0x585cfd=_0x1aca53?[]:findSegmentsToDelete(_0x1a2f98,_0x4fe6ef[_0x3d8126(0x159)](({yamlConfig:_0x530dfe,folderPath:_0x3aa869})=>({'yamlConfig':_0x530dfe,'folderPath':resolveTDFolderPath(_0x3aa869,_0x41c5a5,_0xb420a6)})),_0x4d5151,_0xb420a6,_0x41c5a5),{journeyFiles:_0x13fcc4,foldersToCreate:_0x19ca33}=await withProgressSpinner(_0x3d8126(0xf6),async _0x2ab9d0=>prepareJourneyFiles(_0x2d56d1,{'fetchJourney':async _0x570eeb=>_0x37fd5f[_0x3d8126(0x126)]['getJourney'](_0x570eeb['journeyId']),'journeyBundlesByFolderAndName':_0x466606,'folderPathToId':_0x314261,'idToEmailMap':_0x12a8af,'connectionIdToNameMap':_0x1fe97b,'existingSegments':_0x1a2f98,'parentId':_0x47fa64,'deps':_0x37fd5f,'progress':{'update':_0x50fd8a=>{const _0x2c447d=_0x3d8126;_0x2ab9d0['setPhase'](_0x50fd8a),_0x1cf44e['verbose']&&console[_0x2c447d(0x119)]('\x20\x20'+_0x50fd8a);}},'journeyById':_0x40fc04,'activationStepsById':_0xea6f95},_0x41c5a5,_0xb420a6),{'verbose':_0x1cf44e[_0x3d8126(0x108)]})[_0x3d8126(0x10d)](_0x49ec04=>_0x49ec04[_0x3d8126(0x162)]);for(const _0x5e9791 of _0x19ca33){_0x488439[_0x3d8126(0x167)](_0x5e9791);}const _0x5a4736=_0x1aca53?[]:findJourneysToDelete(_0x337a80,_0x2d56d1['map'](({yamlConfig:_0x204e97,folderPath:_0x1fe1d9})=>({'yamlConfig':_0x204e97,'folderPath':resolveTDFolderPath(_0x1fe1d9,_0x41c5a5,_0xb420a6)})),_0x4d5151,_0xb420a6,_0x41c5a5),_0x39ac10=calculatePushStats(_0x199ab8,_0x13fcc4,_0x488439,_0x585cfd,_0x5a4736,!!_0x1cf44e[_0x3d8126(0xed)],!!_0x1cf44e[_0x3d8126(0x13c)]),_0xfc486=_0x39ac10['segments'][_0x3d8126(0x144)],_0x1fb04c=_0x39ac10['segments'][_0x3d8126(0x150)],_0xd0144d=_0x39ac10['segments']['unchanged'],_0x53887f=_0x39ac10[_0x3d8126(0x170)]['toDelete'],_0x2ef8e7=_0x39ac10[_0x3d8126(0xef)][_0x3d8126(0x122)],_0x23b981=_0x39ac10[_0x3d8126(0x117)][_0x3d8126(0x144)],_0x2a51b8=_0x39ac10[_0x3d8126(0x117)][_0x3d8126(0x150)],_0xdc89ae=_0x39ac10[_0x3d8126(0x117)][_0x3d8126(0xfb)],_0x36fbe1=_0x39ac10[_0x3d8126(0x117)][_0x3d8126(0x163)],_0xfd2bf4=_0x39ac10['activations']['all'],_0x4451a7=_0x39ac10[_0x3d8126(0x103)][_0x3d8126(0x122)],_0x1fba6f=_0x39ac10['activations'][_0x3d8126(0x12a)],_0x4d50c0=_0x39ac10[_0x3d8126(0x103)][_0x3d8126(0x163)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x295a8e+'\x27:');_0x2ef8e7[_0x3d8126(0x114)]>0x0&&console[_0x3d8126(0x119)]('\x20\x20'+a31_0x122508['blue']('📁\x20'+_0x2ef8e7[_0x3d8126(0x114)]+'\x20folders\x20to\x20create'));if(!_0x1cf44e['journeysOnly']){console[_0x3d8126(0x119)]('\x20\x20📊\x20Segments:'),console[_0x3d8126(0x119)]('\x20\x20\x20\x20'+a31_0x122508['green']('+\x20'+_0xfc486[_0x3d8126(0x114)]+'\x20new')),console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['yellow']('~\x20'+_0x1fb04c[_0x3d8126(0x114)]+_0x3d8126(0x14b)));if(_0x53887f['length']>0x0)console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508[_0x3d8126(0x15d)]('-\x20'+_0x53887f[_0x3d8126(0x114)]+_0x3d8126(0x12b)));else _0x585cfd[_0x3d8126(0x114)]>0x0&&!_0x1cf44e['delete']&&console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508[_0x3d8126(0x152)](_0x585cfd[_0x3d8126(0x114)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['dim']('=\x20'+_0xd0144d[_0x3d8126(0x114)]+_0x3d8126(0x174)));}if(_0x13fcc4[_0x3d8126(0x114)]>0x0||_0x5a4736[_0x3d8126(0x114)]>0x0){console['error'](_0x3d8126(0x120)),console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['green']('+\x20'+_0x23b981[_0x3d8126(0x114)]+_0x3d8126(0xee))),console['error'](_0x3d8126(0xf2)+a31_0x122508[_0x3d8126(0x116)]('~\x20'+_0x2a51b8[_0x3d8126(0x114)]+_0x3d8126(0x14b)));if(_0x36fbe1['length']>0x0)console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['red']('-\x20'+_0x36fbe1[_0x3d8126(0x114)]+'\x20to\x20delete'));else _0x5a4736[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0xed)]&&console[_0x3d8126(0x119)]('\x20\x20\x20\x20'+a31_0x122508[_0x3d8126(0x152)](_0x5a4736[_0x3d8126(0x114)]+_0x3d8126(0x107)));console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508['dim']('=\x20'+_0xdc89ae[_0x3d8126(0x114)]+'\x20unchanged'));}_0xfd2bf4[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)]&&(console[_0x3d8126(0x119)](''),console['error'](_0x3d8126(0x113)),_0x4451a7[_0x3d8126(0x114)]>0x0&&console[_0x3d8126(0x119)]('\x20\x20\x20\x20'+a31_0x122508[_0x3d8126(0x169)]('+\x20'+_0x4451a7[_0x3d8126(0x114)]+_0x3d8126(0x149))),_0x1fba6f['length']>0x0&&console[_0x3d8126(0x119)]('\x20\x20\x20\x20'+a31_0x122508[_0x3d8126(0x116)]('~\x20'+_0x1fba6f[_0x3d8126(0x114)]+_0x3d8126(0x15b))),_0x4d50c0[_0x3d8126(0x114)]>0x0&&console[_0x3d8126(0x119)](_0x3d8126(0xf2)+a31_0x122508[_0x3d8126(0x15d)]('-\x20'+_0x4d50c0[_0x3d8126(0x114)]+'\x20to\x20delete')));console[_0x3d8126(0x119)]('\x20\x20Source:\x20'+a31_0x122508['cyan'](_0x1f827d)+'\x0a');if(_0x2ef8e7[_0x3d8126(0x114)]>0x0){console['error'](_0x3d8126(0x12e));for(const _0x206bf2 of _0x2ef8e7){console[_0x3d8126(0x119)]('\x20\x20'+a31_0x122508[_0x3d8126(0xf1)]('+')+'\x20'+_0x206bf2);}console[_0x3d8126(0x119)]('');}if(_0xfc486[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)])for(const _0x7a08e4 of _0xfc486){const _0x466f26=_0x7a08e4['folderPath']?_0x7a08e4[_0x3d8126(0xfa)]+'/'+_0x7a08e4[_0x3d8126(0x115)][_0x3d8126(0x151)]:_0x7a08e4[_0x3d8126(0x115)][_0x3d8126(0x151)],_0x1b53ca=_0x7a08e4[_0x3d8126(0x115)][_0x3d8126(0x103)]?.[_0x3d8126(0x114)]||0x0,_0x4e293a=_0x1b53ca>0x0?a31_0x122508[_0x3d8126(0x152)]('\x20['+_0x1b53ca+_0x3d8126(0x154)):'';console[_0x3d8126(0x119)]('\x0a'+a31_0x122508[_0x3d8126(0x169)]('New\x20segment:')+'\x20'+_0x466f26+_0x4e293a),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c)),_0x7a08e4[_0x3d8126(0x14f)]&&console['error'](_0x7a08e4[_0x3d8126(0x14f)]),console[_0x3d8126(0x119)]('─'['repeat'](0x3c));}if(_0x53887f[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)])for(const _0x3e57cd of _0x53887f){const _0x3a722e=_0x3e57cd[_0x3d8126(0x14a)]?_0x4d5151['get'](_0x3e57cd['segmentFolderId']['toString']())||'':'',_0x55edf9=_0x3a722e?_0x3a722e+'/'+_0x3e57cd[_0x3d8126(0x151)]:_0x3e57cd['name'],_0x429f4c=_0xe87194['get'](_0x3e57cd['id'])||[],_0x1bf2b6=_0x429f4c['length']>0x0?a31_0x122508['dim']('\x20['+_0x429f4c[_0x3d8126(0x114)]+'\x20activations]'):'';console['error']('\x0a'+a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x135))+'\x20'+_0x55edf9+_0x1bf2b6),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c));const _0x38d0a9=segmentWithActivationsToYaml(_0x3e57cd,_0x429f4c,undefined,_0x12a8af,_0x1fe97b),_0x2cfa4a=segmentToYamlString(_0x38d0a9),_0x3d34d1=generateDiff(_0x2cfa4a,'');console[_0x3d8126(0x119)](formatDiffWithColors(_0x3d34d1)),console[_0x3d8126(0x119)]('─'['repeat'](0x3c));}const _0x4343e5=_0x199ab8['filter'](_0x3149c9=>!_0x3149c9[_0x3d8126(0x11d)]&&_0x3149c9['diff']);if(_0x4343e5[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)])for(const _0x1c3057 of _0x4343e5){const _0x599a1b=_0x1c3057[_0x3d8126(0xfa)]?_0x1c3057['folderPath']+'/'+_0x1c3057[_0x3d8126(0x115)][_0x3d8126(0x151)]:_0x1c3057[_0x3d8126(0x115)]['name'];console[_0x3d8126(0x119)]('\x0a'+a31_0x122508[_0x3d8126(0x116)](_0x3d8126(0x160))+'\x20'+_0x599a1b),console[_0x3d8126(0x119)]('─'['repeat'](0x3c)),console[_0x3d8126(0x119)](_0x1c3057['diff']),console['error']('─'['repeat'](0x3c));}if(_0x23b981['length']>0x0)for(const _0x54dd66 of _0x23b981){const _0x184933=_0x54dd66[_0x3d8126(0xfa)]?_0x54dd66['folderPath']+'/'+_0x54dd66['yamlConfig']['name']:_0x54dd66['yamlConfig'][_0x3d8126(0x151)];console[_0x3d8126(0x119)]('\x0a'+a31_0x122508[_0x3d8126(0x169)]('New\x20journey:')+'\x20'+_0x184933),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c)),_0x54dd66['diff']&&console['error'](_0x54dd66[_0x3d8126(0x14f)]),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c));}const _0x1f48c5=_0x13fcc4['filter'](_0x22209d=>!_0x22209d[_0x3d8126(0x11d)]&&_0x22209d[_0x3d8126(0x14f)]);if(_0x1f48c5[_0x3d8126(0x114)]>0x0)for(const _0x3cfc54 of _0x1f48c5){const _0xafb620=_0x3cfc54[_0x3d8126(0xfa)]?_0x3cfc54[_0x3d8126(0xfa)]+'/'+_0x3cfc54[_0x3d8126(0x115)][_0x3d8126(0x151)]:_0x3cfc54[_0x3d8126(0x115)][_0x3d8126(0x151)];console[_0x3d8126(0x119)]('\x0a'+a31_0x122508[_0x3d8126(0x116)]('Changes\x20to\x20journey:')+'\x20'+_0xafb620),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c)),console[_0x3d8126(0x119)](_0x3cfc54[_0x3d8126(0x14f)]),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c));}if(_0x36fbe1[_0x3d8126(0x114)]>0x0)for(const _0x43834c of _0x36fbe1){const _0xee277a=_0x43834c[_0x3d8126(0x133)]?_0x4d5151['get'](_0x43834c[_0x3d8126(0x133)])||'':'',_0x1b8e77=_0xee277a?_0xee277a+'/'+_0x43834c[_0x3d8126(0x156)]:_0x43834c[_0x3d8126(0x156)];console[_0x3d8126(0x119)]('\x0a'+a31_0x122508['red']('Delete\x20journey:')+'\x20'+_0x1b8e77),console['error']('─'[_0x3d8126(0x16b)](0x3c)),console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)](_0x3d8126(0x147))),console[_0x3d8126(0x119)]('─'[_0x3d8126(0x16b)](0x3c));}if(_0x1cf44e[_0x3d8126(0x11e)])return console[_0x3d8126(0x119)](a31_0x122508['yellow'](_0x3d8126(0x177))),0x0;const _0x58e3bf=_0x1cf44e['journeysOnly']?![]:_0xfc486[_0x3d8126(0x114)]>0x0||_0x1fb04c[_0x3d8126(0x114)]>0x0||_0x53887f[_0x3d8126(0x114)]>0x0,_0x13253d=_0x23b981[_0x3d8126(0x114)]>0x0||_0x2a51b8[_0x3d8126(0x114)]>0x0||_0x36fbe1[_0x3d8126(0x114)]>0x0,_0x3034b6=_0x1cf44e['journeysOnly']?![]:_0xfd2bf4[_0x3d8126(0x114)]>0x0,_0x2efb20=_0x2ef8e7['length']>0x0;if(!_0x58e3bf&&!_0x13253d&&!_0x3034b6&&!_0x2efb20){const _0x114b42=_0x1cf44e[_0x3d8126(0x13c)]?_0x3d8126(0x12d):_0x3d8126(0x110);console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x169)](_0x114b42));if(_0x1aca53&&_0xdc89ae[_0x3d8126(0x114)]===0x1){const _0x4eb5d6=_0xdc89ae[0x0];if(_0x4eb5d6[_0x3d8126(0x102)]?.['id']){const _0x191f7a=getConsoleNextUrl(_0x1cf44e[_0x3d8126(0x11c)],_0x3d8126(0x111)+_0x47fa64+_0x3d8126(0x145)+_0x4eb5d6[_0x3d8126(0x102)]['id']+_0x3d8126(0x14e));console[_0x3d8126(0x119)]('\x20\x20'+a31_0x122508[_0x3d8126(0x109)](_0x191f7a));}}return 0x0;}const _0xeb377f=_0x1cf44e[_0x3d8126(0x13c)]?_0x23b981['length']+_0x2a51b8['length']+_0x36fbe1[_0x3d8126(0x114)]+_0x2ef8e7[_0x3d8126(0x114)]:_0xfc486[_0x3d8126(0x114)]+_0x1fb04c[_0x3d8126(0x114)]+_0x53887f['length']+_0x23b981['length']+_0x2a51b8[_0x3d8126(0x114)]+_0x36fbe1[_0x3d8126(0x114)]+_0x2ef8e7[_0x3d8126(0x114)]+_0xfd2bf4[_0x3d8126(0x114)];if(!_0x1cf44e[_0x3d8126(0x176)]&&_0xeb377f>0x0){const _0x1c1249=await confirmKey(_0x3d8126(0x138)+_0xeb377f+_0x3d8126(0x11f));if(!_0x1c1249)return console[_0x3d8126(0x119)](_0x3d8126(0x165)),0x1;}const _0x32d952={'withProgress':async(_0x4a6727,_0x59be0e)=>{const _0x1593b1=_0x3d8126,_0xdfb96f=await withSpinner(_0x4a6727,_0x59be0e,{'verbose':_0x1cf44e[_0x1593b1(0x108)]});return{'data':_0xdfb96f[_0x1593b1(0x162)]};},'logInfo':_0x1adda6=>console['error'](a31_0x122508[_0x3d8126(0xf1)]('✔\x20'+_0x1adda6)),'logSuccess':_0x6f1a3a=>console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x169)]('✔\x20'+_0x6f1a3a)),'logWarning':_0x5e2980=>console['error'](a31_0x122508[_0x3d8126(0x116)]('⚠\x20'+_0x5e2980)),'logDeleted':_0x3bba38=>console[_0x3d8126(0x119)](a31_0x122508[_0x3d8126(0x15d)]('✔\x20'+_0x3bba38))},_0x3c41f0={'segment':_0x37fd5f[_0x3d8126(0x10a)],'journey':_0x37fd5f[_0x3d8126(0x126)],'user':_0x37fd5f[_0x3d8126(0xec)],'connection':_0x37fd5f[_0x3d8126(0x131)]};_0x2ef8e7[_0x3d8126(0x114)]>0x0&&(_0x314261=await executePushFolders(_0x3c41f0,_0x2ef8e7,_0x314261,{'parentId':_0x47fa64},_0x32d952));const _0x28bf0a={'rootFolderId':_0x102a86,'folderPathToId':_0x314261,'folderIdToPath':_0x4d5151,'segmentNameToId':_0x1b42cd,'activationsBySegmentId':_0xe87194,'emailToIdMap':_0x3c1dbb,'idToEmailMap':_0x12a8af,'connectionNameToIdMap':_0x584688[_0x3d8126(0x13d)],'connectionIdToNameMap':_0x584688[_0x3d8126(0x148)],'connectionNameToTypeMap':_0x16bfdf},_0x395532=await executePushSegments(_0x3c41f0,_0x1cf44e[_0x3d8126(0x13c)]?[]:_0x199ab8,_0x28bf0a,{'parentId':_0x47fa64},_0x32d952),_0x417f7a=_0x395532[_0x3d8126(0x104)],_0x59c441=_0x395532[_0x3d8126(0x134)],_0x5f4bc5=_0x395532[_0x3d8126(0x103)]['created'],_0x570b38=_0x395532[_0x3d8126(0x103)][_0x3d8126(0x134)],_0x5ad9b9=_0x395532[_0x3d8126(0x103)]['deleted'],_0x5bc075=await executePushSegmentDeletions(_0x3c41f0,_0x1cf44e[_0x3d8126(0x13c)]?[]:_0x53887f,_0x32d952);let _0x4c6e4b=0x0,_0x227168=0x0,_0xca36a1=0x0;const _0x49f6c8=new Map(_0x1b42cd);for(const [_0x2234dc,_0x328ba0]of _0x395532[_0x3d8126(0x16e)]){_0x49f6c8[_0x3d8126(0x142)](_0x2234dc,_0x328ba0);}if(_0x13fcc4[_0x3d8126(0x114)]>0x0){const _0x4d0008={..._0x28bf0a,'segmentNameToId':_0x49f6c8,'existingSegments':_0x1a2f98,'activationContext':_0x890e6e},_0x374c13=await executePushJourneys(_0x3c41f0,_0x13fcc4,_0x4d0008,{'parentId':_0x47fa64,'rootFolderId':_0x102a86,'verbose':_0x1cf44e[_0x3d8126(0x108)]},_0x32d952);_0x4c6e4b=_0x374c13[_0x3d8126(0x104)],_0x227168=_0x374c13[_0x3d8126(0x134)];if(_0x1aca53&&_0x374c13[_0x3d8126(0x130)][_0x3d8126(0x114)]===0x1){const _0x57829c=_0x374c13['results'][0x0];if(_0x57829c[_0x3d8126(0x12f)]){const _0x168111=getConsoleNextUrl(_0x1cf44e['site'],_0x3d8126(0x111)+_0x47fa64+'/e/'+_0x57829c[_0x3d8126(0x12f)]+'/j/da/je');console['error']('\x20\x20'+a31_0x122508[_0x3d8126(0x109)](_0x168111));}}}for(const _0xa920b4 of _0x36fbe1){console[_0x3d8126(0x119)](a31_0x122508['yellow'](_0x3d8126(0x168)+_0xa920b4[_0x3d8126(0x156)])),_0xca36a1++;}const _0x482667=[];if(_0x417f7a>0x0)_0x482667[_0x3d8126(0x17b)](_0x417f7a+_0x3d8126(0xf7));if(_0x59c441>0x0)_0x482667[_0x3d8126(0x17b)](_0x59c441+'\x20updated');if(_0x5bc075>0x0)_0x482667[_0x3d8126(0x17b)](_0x5bc075+_0x3d8126(0x136));const _0x1e1fdb=[];if(_0x4c6e4b>0x0)_0x1e1fdb[_0x3d8126(0x17b)](_0x4c6e4b+_0x3d8126(0xf7));if(_0x227168>0x0)_0x1e1fdb[_0x3d8126(0x17b)](_0x227168+_0x3d8126(0x118));if(_0xca36a1>0x0)_0x1e1fdb[_0x3d8126(0x17b)](_0xca36a1+_0x3d8126(0x136));const _0x452e89=[];if(_0x5f4bc5>0x0)_0x452e89['push'](_0x5f4bc5+_0x3d8126(0xf7));if(_0x570b38>0x0)_0x452e89[_0x3d8126(0x17b)](_0x570b38+'\x20updated');if(_0x5ad9b9>0x0)_0x452e89['push'](_0x5ad9b9+'\x20deleted');return console[_0x3d8126(0x119)](a31_0x122508['green'](_0x3d8126(0x172))),_0x482667['length']>0x0&&!_0x1cf44e[_0x3d8126(0x13c)]&&console[_0x3d8126(0x119)]('\x20\x20Segments:\x20'+_0x482667['join'](',\x20')),_0x1e1fdb[_0x3d8126(0x114)]>0x0&&console[_0x3d8126(0x119)](_0x3d8126(0x15a)+_0x1e1fdb[_0x3d8126(0x143)](',\x20')),_0x452e89[_0x3d8126(0x114)]>0x0&&!_0x1cf44e[_0x3d8126(0x13c)]&&console[_0x3d8126(0x119)](_0x3d8126(0x100)+_0x452e89[_0x3d8126(0x143)](',\x20')),0x0;}}
1
+ const a31_0x625ab3=a31_0x1f3d;(function(_0x17070a,_0x15db42){const _0x167ea4=a31_0x1f3d,_0x18bd36=_0x17070a();while(!![]){try{const _0xca1da4=-parseInt(_0x167ea4(0x23c))/0x1+-parseInt(_0x167ea4(0x1eb))/0x2*(parseInt(_0x167ea4(0x23a))/0x3)+parseInt(_0x167ea4(0x21d))/0x4*(parseInt(_0x167ea4(0x1f4))/0x5)+-parseInt(_0x167ea4(0x1fa))/0x6+-parseInt(_0x167ea4(0x211))/0x7+parseInt(_0x167ea4(0x236))/0x8*(-parseInt(_0x167ea4(0x1c4))/0x9)+parseInt(_0x167ea4(0x21c))/0xa;if(_0xca1da4===_0x15db42)break;else _0x18bd36['push'](_0x18bd36['shift']());}catch(_0x1dcc85){_0x18bd36['push'](_0x18bd36['shift']());}}}(a31_0x214c,0xef342));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 a31_0x460526 from'chalk';function a31_0x214c(){const _0x4db2fa=['Resolving\x20parent\x20segment\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20Segments:\x20','nameToId','new','user','getJourney','data','push','\x20\x20Activations:','journeys','.yaml','createdSegmentIds','diff','results','\x20\x20\x20\x20','name','toUpdate','message','7905033sRVOrT','/j/da/je','green','\x20updated','journeyBundleId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Changes\x20to:','paused','Error:\x20','unchanged','\x20\x20🗺️\x20\x20Journeys:','dim','journeysOnly','add','\x20to\x20create','getParent','segmentFolderId','createdAt','parentName','file','New\x20journey:','toDelete','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20to\x20delete','no_parent','folderPath','errorCode','segment:push','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20created','parentSegment','Changes\x20to\x20journey:','join','isNew','type','blue','\x20new','\x20YAML\x20files\x20found','set','2HKjyJB','\x20changed','📁\x20','filter','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)','idToName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','red','error','90gdsuTz','execute','Fetching\x20existing\x20activations...','activations','setPhase','/app/ps/','9408990lBOclW','verbose','Delete\x20segment:','Fetching\x20users\x20for\x20email\x20resolution...','list','Site:\x20','folders','segments','journeyBundleName','(Journey\x20will\x20be\x20deleted)','\x0aValidation\x20failed:','\x20changes?','updated','toString','\x20deleted','parent_name','listFolders','/e/','filePath','all','changed','resolveParentId','segment\x20or\x20journey','5702753vPegOd','site','then','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','getOutputSchemaWithCache','audienceId','Scoped\x20to\x20folder:\x20','listSegments','yellow','repeat','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','53260930lZgNSM','323488UzoIMQ','\x20activations]','state','delete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','folderId','map','existingJourney','journeyId','\x20unchanged','Folders\x20to\x20create:','length','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x27...','dryRun','deleted','\x20to\x20update','Parent\x20segment:\x20','nameToType','segment','connection','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','8KrFtsL','description','\x0aPush\x20summary\x20for\x20\x27','\x20folders\x20to\x20create','2856369UsUDkK','New\x20segment:','1588707MzVkIF','\x20\x20Journeys:\x20','created','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20\x20Source:\x20','listJourneysWithDetailsFromParentSegment','cyan','Source\x20directory:\x20','Preparing\x20journeys...','attributes','Error:\x20Directory\x20not\x20found:\x20','yamlConfig','Push\x20','relationships','get','helpText','Fetching\x20existing\x20folders...'];a31_0x214c=function(){return _0x4db2fa;};return a31_0x214c();}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a31_0x1f3d(_0x3ed3bd,_0x2a6633){_0x3ed3bd=_0x3ed3bd-0x1bd;const _0x214c81=a31_0x214c();let _0x1f3d56=_0x214c81[_0x3ed3bd];return _0x1f3d56;}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{[a31_0x625ab3(0x1c1)]=a31_0x625ab3(0x1df);[a31_0x625ab3(0x237)]=a31_0x625ab3(0x1da);async[a31_0x625ab3(0x1f5)](_0x27af5d){const _0x442e75=a31_0x625ab3,{options:_0x6307bf,args:_0x15d764,tdx:_0x6ed082}=_0x27af5d,_0x3559f0=_0x6307bf,_0x39499c=await resolveTarget({'arg':_0x15d764[0x0],'contextParent':_0x6307bf[_0x442e75(0x1e2)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x39499c))return _0x39499c[_0x442e75(0x1de)]===_0x442e75(0x1dc)?(console['error'](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x1c9))),console['error'](_0x442e75(0x1ef)),console[_0x442e75(0x1f3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x442e75(0x1f3)](_0x442e75(0x214))):(console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x1cc)+_0x39499c[_0x442e75(0x1c3)]+'\x0a')),_0x39499c[_0x442e75(0x24b)]&&console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x242)](_0x39499c[_0x442e75(0x24b)]))),0x1;if(_0x39499c[_0x442e75(0x1e6)]===_0x442e75(0x209))return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x246)+_0x39499c['targetDir']+'\x0a')),console[_0x442e75(0x1f3)](a31_0x460526['cyan'](_0x442e75(0x22a))),0x1;const _0x25fa43=_0x39499c[_0x442e75(0x1d6)],_0x2c29ea=_0x39499c['targetDir'],_0x40056b=_0x39499c['type']===_0x442e75(0x1d7)?_0x39499c[_0x442e75(0x20c)]:undefined,_0xc6b29f=getScopedDetails(_0x39499c),_0x4e4612=_0xc6b29f?.['isScoped']??![],_0x3a704d=_0xc6b29f?.['scopedFolderPath']??'';if(!existsSync(_0x2c29ea))return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x246)+_0x2c29ea+'\x0a')),console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x242)](_0x442e75(0x22a))),0x1;_0x3559f0[_0x442e75(0x1fb)]&&(console['error'](_0x442e75(0x1ff)+_0x3559f0[_0x442e75(0x212)]),console['error'](_0x442e75(0x22f)+_0x25fa43),console[_0x442e75(0x1f3)](_0x442e75(0x243)+_0x2c29ea),_0x4e4612&&console['error'](_0x442e75(0x217)+_0x3a704d));const _0x2462b8=await withSpinner(_0x442e75(0x24d)+_0x25fa43+_0x442e75(0x22b),()=>_0x6ed082[_0x442e75(0x231)][_0x442e75(0x20f)](_0x25fa43),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),_0x4125d0=_0x2462b8[_0x442e75(0x254)],[_0x210c2d,_0x5b0fea,_0x1b1a2c,_0x232479,_0x2a3ee8]=await Promise[_0x442e75(0x20d)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x6ed082['segment'][_0x442e75(0x1d3)](_0x4125d0),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x6ed082[_0x442e75(0x231)][_0x442e75(0x218)](_0x4125d0),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),withSpinner(_0x442e75(0x24c),()=>_0x6ed082[_0x442e75(0x231)][_0x442e75(0x20a)](_0x4125d0),{'verbose':_0x3559f0[_0x442e75(0x1fb)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x6ed082['journey'][_0x442e75(0x241)](_0x4125d0,{'includeAllVersions':!![]}),{'verbose':_0x3559f0['verbose']}),withSpinner(_0x442e75(0x1fd),()=>_0x6ed082[_0x442e75(0x252)]['buildUserMaps'](),{'verbose':_0x3559f0[_0x442e75(0x1fb)]})['then'](_0x2a43b6=>_0x2a43b6[_0x442e75(0x254)])]),_0x324575=_0x210c2d[_0x442e75(0x254)],_0x2675be=extractRootFolderId(_0x324575),_0x3df0f4=_0x5b0fea['data'],_0x2ae49f=_0x1b1a2c[_0x442e75(0x254)],{journeys:_0x17a6f4,activationStepsById:_0x40be6f}=_0x232479['data'],_0x18bdcd=new Map(_0x17a6f4[_0x442e75(0x224)](_0x2891bb=>[_0x2891bb['id'],_0x2891bb])),_0x98fabf=_0x17a6f4['map'](_0xd1e852=>({'id':_0xd1e852['id'],'name':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x1c1)],'journeyBundleName':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x202)]||'','journeyBundleId':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x1c8)]||'','versionNumber':_0xd1e852[_0x442e75(0x245)]['versionNumber'],'description':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x237)],'state':_0xd1e852['attributes'][_0x442e75(0x21f)],'paused':_0xd1e852['attributes'][_0x442e75(0x1cb)],'audienceId':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x216)],'folderId':_0xd1e852[_0x442e75(0x249)]?.['parentFolder']?.[_0x442e75(0x254)]?.['id'],'createdAt':_0xd1e852[_0x442e75(0x245)][_0x442e75(0x1d5)],'updatedAt':_0xd1e852[_0x442e75(0x245)]['updatedAt']})),{emailToId:_0x1c071a,idToEmail:_0x2511fb}=_0x2a3ee8,_0xf99f15=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x4d4962=_0x442e75,_0x31de26=await _0x6ed082[_0x4d4962(0x232)][_0x4d4962(0x1fe)]();return buildConnectionMaps(_0x31de26);},{'verbose':_0x3559f0['verbose']})[_0x442e75(0x213)](_0x3fd3c0=>_0x3fd3c0[_0x442e75(0x254)]),_0x2aa561=_0xf99f15['nameToId'],_0x551e17=_0xf99f15[_0x442e75(0x1f0)],_0xf9bea7=_0xf99f15[_0x442e75(0x230)],_0x4f4722={'emailToIdMap':_0x1c071a,'connectionNameToIdMap':_0x2aa561,'connectionNameToTypeMap':_0xf9bea7,'getSchema':_0x199721=>_0x6ed082[_0x442e75(0x232)][_0x442e75(0x215)](_0x199721)};let {pathToId:_0x3ab026,idToPath:_0x164f3c}=buildFolderMaps(_0x2ae49f);const _0x429a9d=buildSegmentLookupMap(_0x3df0f4,_0x164f3c),_0x4c8fa9=buildSegmentNameToIdMap(_0x3df0f4),_0x541252=buildJourneyBundleLookupMap(_0x98fabf,_0x164f3c);let _0x137222;if(_0x40056b){if(!_0x40056b['endsWith']('.yml')&&!_0x40056b['endsWith'](_0x442e75(0x258)))return console['error'](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x221)+_0x40056b+'\x0a')),0x1;_0x137222=[_0x40056b];}else _0x137222=findYamlFiles(_0x2c29ea);if(_0x137222['length']===0x0)return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x235)+_0x2c29ea+'\x0a')),console['error'](a31_0x460526['cyan'](_0x442e75(0x1e0))),0x1;let _0x69fe46,_0x5a7250;try{const _0x4ddbfd=parseAndClassifyYamlFiles(_0x137222,_0x2c29ea,{'skipSegments':_0x3559f0[_0x442e75(0x1d0)]});_0x69fe46=_0x4ddbfd['segments'],_0x5a7250=_0x4ddbfd[_0x442e75(0x257)];const _0x2740dc=validateParsedFiles(_0x4ddbfd,_0x2c29ea);if(_0x2740dc[_0x442e75(0x229)]>0x0)return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x204))),console['error'](formatValidationErrors(_0x2740dc)),console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x233))),0x1;}catch(_0x1ad06e){return console['error'](a31_0x460526[_0x442e75(0x1f2)]('Error\x20parsing\x20YAML:\x20'+(_0x1ad06e instanceof Error?_0x1ad06e[_0x442e75(0x1c3)]:_0x1ad06e))),0x1;}if(_0x69fe46[_0x442e75(0x229)]===0x0&&_0x5a7250[_0x442e75(0x229)]===0x0){const _0xb93bf9=_0x3559f0['journeysOnly']?_0x442e75(0x234):_0x442e75(0x210);return console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x219)]('No\x20'+_0xb93bf9+_0x442e75(0x1e9))),0x0;}const _0x118a94=new Map();_0x3df0f4[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&await withSpinner(_0x442e75(0x1f6),async()=>{await batchAsync(_0x3df0f4,async _0x4adb04=>{const _0x5830e9=a31_0x1f3d,_0xb8bc1=await _0x6ed082[_0x5830e9(0x231)]['listActivations'](_0x4125d0,_0x4adb04['id']);_0x118a94[_0x5830e9(0x1ea)](_0x4adb04['id'],_0xb8bc1);});},{'verbose':_0x3559f0['verbose']});const {segmentFiles:_0x8f1aa1,foldersToCreate:_0x23cec8}=await prepareSegmentFiles(_0x69fe46,{'segmentByFolderAndName':_0x429a9d,'activationsBySegmentId':_0x118a94,'folderPathToId':_0x3ab026,'idToEmailMap':_0x2511fb,'connectionIdToNameMap':_0x551e17},_0x4f4722,_0x4e4612,_0x3a704d),_0xb4b40e=_0x40056b?[]:findSegmentsToDelete(_0x3df0f4,_0x69fe46[_0x442e75(0x224)](({yamlConfig:_0x435e53,folderPath:_0xcaa047})=>({'yamlConfig':_0x435e53,'folderPath':resolveTDFolderPath(_0xcaa047,_0x4e4612,_0x3a704d)})),_0x164f3c,_0x3a704d,_0x4e4612),{journeyFiles:_0xfc62b0,foldersToCreate:_0x775ebe}=await withProgressSpinner(_0x442e75(0x244),async _0x1df54e=>prepareJourneyFiles(_0x5a7250,{'fetchJourney':async _0x178e4d=>_0x6ed082[_0x442e75(0x234)][_0x442e75(0x253)](_0x178e4d['journeyId']),'journeyBundlesByFolderAndName':_0x541252,'folderPathToId':_0x3ab026,'idToEmailMap':_0x2511fb,'connectionIdToNameMap':_0x551e17,'existingSegments':_0x3df0f4,'parentId':_0x4125d0,'deps':_0x6ed082,'progress':{'update':_0x23f539=>{const _0x3ecc90=_0x442e75;_0x1df54e[_0x3ecc90(0x1f8)](_0x23f539),_0x3559f0[_0x3ecc90(0x1fb)]&&console[_0x3ecc90(0x1f3)]('\x20\x20'+_0x23f539);}},'journeyById':_0x18bdcd,'activationStepsById':_0x40be6f},_0x4e4612,_0x3a704d),{'verbose':_0x3559f0[_0x442e75(0x1fb)]})['then'](_0x5a0c1d=>_0x5a0c1d['data']);for(const _0x23097c of _0x775ebe){_0x23cec8[_0x442e75(0x1d1)](_0x23097c);}const _0x306724=_0x40056b?[]:findJourneysToDelete(_0x98fabf,_0x5a7250[_0x442e75(0x224)](({yamlConfig:_0x43aeed,folderPath:_0x21bb8b})=>({'yamlConfig':_0x43aeed,'folderPath':resolveTDFolderPath(_0x21bb8b,_0x4e4612,_0x3a704d)})),_0x164f3c,_0x3a704d,_0x4e4612),_0xd40c5=calculatePushStats(_0x8f1aa1,_0xfc62b0,_0x23cec8,_0xb4b40e,_0x306724,!!_0x3559f0[_0x442e75(0x220)],!!_0x3559f0[_0x442e75(0x1d0)]),_0x3b2ce7=_0xd40c5[_0x442e75(0x201)][_0x442e75(0x251)],_0x221901=_0xd40c5[_0x442e75(0x201)][_0x442e75(0x20e)],_0x371ec2=_0xd40c5[_0x442e75(0x201)][_0x442e75(0x1cd)],_0x2c1310=_0xd40c5['segments'][_0x442e75(0x1d9)],_0x56cb34=_0xd40c5[_0x442e75(0x200)]['toCreate'],_0x1cbb81=_0xd40c5[_0x442e75(0x257)][_0x442e75(0x251)],_0x272eb5=_0xd40c5['journeys'][_0x442e75(0x20e)],_0x44917d=_0xd40c5['journeys']['unchanged'],_0x2cd0f4=_0xd40c5['journeys']['toDelete'],_0x2e0acb=_0xd40c5[_0x442e75(0x1f7)][_0x442e75(0x20d)],_0x5d6aee=_0xd40c5[_0x442e75(0x1f7)]['toCreate'],_0x3e510a=_0xd40c5[_0x442e75(0x1f7)][_0x442e75(0x1c2)],_0x1b3316=_0xd40c5['activations'][_0x442e75(0x1d9)];console[_0x442e75(0x1f3)](_0x442e75(0x238)+_0x25fa43+'\x27:');_0x56cb34[_0x442e75(0x229)]>0x0&&console[_0x442e75(0x1f3)]('\x20\x20'+a31_0x460526[_0x442e75(0x1e7)](_0x442e75(0x1ed)+_0x56cb34[_0x442e75(0x229)]+_0x442e75(0x239)));if(!_0x3559f0[_0x442e75(0x1d0)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1c6)]('+\x20'+_0x3b2ce7[_0x442e75(0x229)]+_0x442e75(0x1e8))),console['error'](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x219)]('~\x20'+_0x221901['length']+_0x442e75(0x1ec)));if(_0x2c1310[_0x442e75(0x229)]>0x0)console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1f2)]('-\x20'+_0x2c1310[_0x442e75(0x229)]+_0x442e75(0x1db)));else _0xb4b40e['length']>0x0&&!_0x3559f0[_0x442e75(0x220)]&&console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1cf)](_0xb4b40e[_0x442e75(0x229)]+_0x442e75(0x222)));console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1cf)]('=\x20'+_0x371ec2[_0x442e75(0x229)]+_0x442e75(0x227)));}if(_0xfc62b0[_0x442e75(0x229)]>0x0||_0x306724[_0x442e75(0x229)]>0x0){console[_0x442e75(0x1f3)](_0x442e75(0x1ce)),console['error']('\x20\x20\x20\x20'+a31_0x460526[_0x442e75(0x1c6)]('+\x20'+_0x1cbb81[_0x442e75(0x229)]+_0x442e75(0x1e8))),console['error']('\x20\x20\x20\x20'+a31_0x460526[_0x442e75(0x219)]('~\x20'+_0x272eb5[_0x442e75(0x229)]+_0x442e75(0x1ec)));if(_0x2cd0f4[_0x442e75(0x229)]>0x0)console['error']('\x20\x20\x20\x20'+a31_0x460526[_0x442e75(0x1f2)]('-\x20'+_0x2cd0f4[_0x442e75(0x229)]+_0x442e75(0x1db)));else _0x306724[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x220)]&&console[_0x442e75(0x1f3)](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1cf)](_0x306724[_0x442e75(0x229)]+_0x442e75(0x222)));console['error']('\x20\x20\x20\x20'+a31_0x460526['dim']('=\x20'+_0x44917d[_0x442e75(0x229)]+'\x20unchanged'));}_0x2e0acb[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&(console['error'](''),console[_0x442e75(0x1f3)](_0x442e75(0x256)),_0x5d6aee[_0x442e75(0x229)]>0x0&&console['error'](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1c6)]('+\x20'+_0x5d6aee[_0x442e75(0x229)]+_0x442e75(0x1d2))),_0x3e510a[_0x442e75(0x229)]>0x0&&console['error'](_0x442e75(0x1c0)+a31_0x460526['yellow']('~\x20'+_0x3e510a['length']+_0x442e75(0x22e))),_0x1b3316[_0x442e75(0x229)]>0x0&&console['error'](_0x442e75(0x1c0)+a31_0x460526[_0x442e75(0x1f2)]('-\x20'+_0x1b3316['length']+_0x442e75(0x1db))));console['error'](_0x442e75(0x240)+a31_0x460526['cyan'](_0x2c29ea)+'\x0a');if(_0x56cb34[_0x442e75(0x229)]>0x0){console[_0x442e75(0x1f3)](_0x442e75(0x228));for(const _0x217bf6 of _0x56cb34){console[_0x442e75(0x1f3)]('\x20\x20'+a31_0x460526[_0x442e75(0x1e7)]('+')+'\x20'+_0x217bf6);}console[_0x442e75(0x1f3)]('');}if(_0x3b2ce7['length']>0x0&&!_0x3559f0[_0x442e75(0x1d0)])for(const _0x2d1ac3 of _0x3b2ce7){const _0x384f99=_0x2d1ac3[_0x442e75(0x1dd)]?_0x2d1ac3['folderPath']+'/'+_0x2d1ac3[_0x442e75(0x247)]['name']:_0x2d1ac3[_0x442e75(0x247)][_0x442e75(0x1c1)],_0x44a7b4=_0x2d1ac3['yamlConfig']['activations']?.[_0x442e75(0x229)]||0x0,_0x48b689=_0x44a7b4>0x0?a31_0x460526['dim']('\x20['+_0x44a7b4+_0x442e75(0x21e)):'';console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526[_0x442e75(0x1c6)](_0x442e75(0x23b))+'\x20'+_0x384f99+_0x48b689),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),_0x2d1ac3[_0x442e75(0x1be)]&&console[_0x442e75(0x1f3)](_0x2d1ac3[_0x442e75(0x1be)]),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));}if(_0x2c1310[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)])for(const _0x3e7a32 of _0x2c1310){const _0x28d7fd=_0x3e7a32['segmentFolderId']?_0x164f3c[_0x442e75(0x24a)](_0x3e7a32[_0x442e75(0x1d4)][_0x442e75(0x207)]())||'':'',_0x1e257b=_0x28d7fd?_0x28d7fd+'/'+_0x3e7a32[_0x442e75(0x1c1)]:_0x3e7a32[_0x442e75(0x1c1)],_0x407ed4=_0x118a94[_0x442e75(0x24a)](_0x3e7a32['id'])||[],_0x3417c5=_0x407ed4[_0x442e75(0x229)]>0x0?a31_0x460526[_0x442e75(0x1cf)]('\x20['+_0x407ed4[_0x442e75(0x229)]+_0x442e75(0x21e)):'';console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526['red'](_0x442e75(0x1fc))+'\x20'+_0x1e257b+_0x3417c5),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));const _0x2bd1e9=segmentWithActivationsToYaml(_0x3e7a32,_0x407ed4,undefined,_0x2511fb,_0x551e17),_0x3effb9=segmentToYamlString(_0x2bd1e9),_0x7e8839=generateDiff(_0x3effb9,'');console[_0x442e75(0x1f3)](formatDiffWithColors(_0x7e8839)),console[_0x442e75(0x1f3)]('─'['repeat'](0x3c));}const _0x4f64af=_0x8f1aa1[_0x442e75(0x1ee)](_0x2fd02e=>!_0x2fd02e[_0x442e75(0x1e5)]&&_0x2fd02e[_0x442e75(0x1be)]);if(_0x4f64af['length']>0x0&&!_0x3559f0[_0x442e75(0x1d0)])for(const _0x27a756 of _0x4f64af){const _0x569598=_0x27a756['folderPath']?_0x27a756[_0x442e75(0x1dd)]+'/'+_0x27a756['yamlConfig'][_0x442e75(0x1c1)]:_0x27a756[_0x442e75(0x247)][_0x442e75(0x1c1)];console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526['yellow'](_0x442e75(0x1ca))+'\x20'+_0x569598),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),console[_0x442e75(0x1f3)](_0x27a756[_0x442e75(0x1be)]),console['error']('─'[_0x442e75(0x21a)](0x3c));}if(_0x1cbb81[_0x442e75(0x229)]>0x0)for(const _0x2f4ba4 of _0x1cbb81){const _0x57ae3a=_0x2f4ba4[_0x442e75(0x1dd)]?_0x2f4ba4['folderPath']+'/'+_0x2f4ba4[_0x442e75(0x247)][_0x442e75(0x1c1)]:_0x2f4ba4[_0x442e75(0x247)][_0x442e75(0x1c1)];console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526[_0x442e75(0x1c6)](_0x442e75(0x1d8))+'\x20'+_0x57ae3a),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),_0x2f4ba4[_0x442e75(0x1be)]&&console[_0x442e75(0x1f3)](_0x2f4ba4[_0x442e75(0x1be)]),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));}const _0x48f748=_0xfc62b0[_0x442e75(0x1ee)](_0xb20d0d=>!_0xb20d0d[_0x442e75(0x1e5)]&&_0xb20d0d[_0x442e75(0x1be)]);if(_0x48f748[_0x442e75(0x229)]>0x0)for(const _0x44f9ab of _0x48f748){const _0x4497f6=_0x44f9ab['folderPath']?_0x44f9ab[_0x442e75(0x1dd)]+'/'+_0x44f9ab[_0x442e75(0x247)][_0x442e75(0x1c1)]:_0x44f9ab[_0x442e75(0x247)][_0x442e75(0x1c1)];console[_0x442e75(0x1f3)]('\x0a'+a31_0x460526[_0x442e75(0x219)](_0x442e75(0x1e3))+'\x20'+_0x4497f6),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c)),console[_0x442e75(0x1f3)](_0x44f9ab[_0x442e75(0x1be)]),console['error']('─'[_0x442e75(0x21a)](0x3c));}if(_0x2cd0f4[_0x442e75(0x229)]>0x0)for(const _0x571834 of _0x2cd0f4){const _0xb7302c=_0x571834[_0x442e75(0x223)]?_0x164f3c['get'](_0x571834['folderId'])||'':'',_0x3781b2=_0xb7302c?_0xb7302c+'/'+_0x571834[_0x442e75(0x202)]:_0x571834[_0x442e75(0x202)];console['error']('\x0a'+a31_0x460526[_0x442e75(0x1f2)]('Delete\x20journey:')+'\x20'+_0x3781b2),console['error']('─'[_0x442e75(0x21a)](0x3c)),console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)](_0x442e75(0x203))),console[_0x442e75(0x1f3)]('─'[_0x442e75(0x21a)](0x3c));}if(_0x3559f0[_0x442e75(0x22c)])return console['error'](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x24e))),0x0;const _0x4d2f72=_0x3559f0[_0x442e75(0x1d0)]?![]:_0x3b2ce7[_0x442e75(0x229)]>0x0||_0x221901['length']>0x0||_0x2c1310[_0x442e75(0x229)]>0x0,_0x1ea4f4=_0x1cbb81[_0x442e75(0x229)]>0x0||_0x272eb5[_0x442e75(0x229)]>0x0||_0x2cd0f4[_0x442e75(0x229)]>0x0,_0x2d2fa7=_0x3559f0['journeysOnly']?![]:_0x2e0acb[_0x442e75(0x229)]>0x0,_0xb4c0a9=_0x56cb34['length']>0x0;if(!_0x4d2f72&&!_0x1ea4f4&&!_0x2d2fa7&&!_0xb4c0a9){const _0x1d3a27=_0x3559f0[_0x442e75(0x1d0)]?_0x442e75(0x1f1):_0x442e75(0x23f);console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1c6)](_0x1d3a27));if(_0x40056b&&_0x44917d['length']===0x1){const _0x44c5d0=_0x44917d[0x0];if(_0x44c5d0[_0x442e75(0x225)]?.['id']){const _0x191e96=getConsoleNextUrl(_0x3559f0['site'],_0x442e75(0x1f9)+_0x4125d0+_0x442e75(0x20b)+_0x44c5d0[_0x442e75(0x225)]['id']+_0x442e75(0x1c5));console['error']('\x20\x20'+a31_0x460526[_0x442e75(0x242)](_0x191e96));}}return 0x0;}const _0x152b4c=_0x3559f0[_0x442e75(0x1d0)]?_0x1cbb81['length']+_0x272eb5[_0x442e75(0x229)]+_0x2cd0f4[_0x442e75(0x229)]+_0x56cb34['length']:_0x3b2ce7[_0x442e75(0x229)]+_0x221901['length']+_0x2c1310[_0x442e75(0x229)]+_0x1cbb81[_0x442e75(0x229)]+_0x272eb5[_0x442e75(0x229)]+_0x2cd0f4[_0x442e75(0x229)]+_0x56cb34['length']+_0x2e0acb[_0x442e75(0x229)];if(!_0x3559f0['yes']&&_0x152b4c>0x0){const _0x42dd88=await confirmKey(_0x442e75(0x248)+_0x152b4c+_0x442e75(0x205));if(!_0x42dd88)return console[_0x442e75(0x1f3)]('Aborted.'),0x1;}const _0x1bd359={'withProgress':async(_0x34d816,_0x41455d)=>{const _0x52520d=_0x442e75,_0x348d76=await withSpinner(_0x34d816,_0x41455d,{'verbose':_0x3559f0[_0x52520d(0x1fb)]});return{'data':_0x348d76[_0x52520d(0x254)]};},'logInfo':_0x3bdfa6=>console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1e7)]('✔\x20'+_0x3bdfa6)),'logSuccess':_0x26f254=>console['error'](a31_0x460526[_0x442e75(0x1c6)]('✔\x20'+_0x26f254)),'logWarning':_0x49e693=>console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x219)]('⚠\x20'+_0x49e693)),'logDeleted':_0x144b5c=>console[_0x442e75(0x1f3)](a31_0x460526[_0x442e75(0x1f2)]('✔\x20'+_0x144b5c))},_0x4fb15e={'segment':_0x6ed082[_0x442e75(0x231)],'journey':_0x6ed082[_0x442e75(0x234)],'user':_0x6ed082[_0x442e75(0x252)],'connection':_0x6ed082[_0x442e75(0x232)]};_0x56cb34[_0x442e75(0x229)]>0x0&&(_0x3ab026=await executePushFolders(_0x4fb15e,_0x56cb34,_0x3ab026,{'parentId':_0x4125d0},_0x1bd359));const _0x25bdbe={'rootFolderId':_0x2675be,'folderPathToId':_0x3ab026,'folderIdToPath':_0x164f3c,'segmentNameToId':_0x4c8fa9,'activationsBySegmentId':_0x118a94,'emailToIdMap':_0x1c071a,'idToEmailMap':_0x2511fb,'connectionNameToIdMap':_0xf99f15[_0x442e75(0x250)],'connectionIdToNameMap':_0xf99f15[_0x442e75(0x1f0)],'connectionNameToTypeMap':_0xf9bea7},_0x1e832f=await executePushSegments(_0x4fb15e,_0x3559f0['journeysOnly']?[]:_0x8f1aa1,_0x25bdbe,{'parentId':_0x4125d0},_0x1bd359),_0x2ce961=_0x1e832f[_0x442e75(0x23e)],_0x23cfdf=_0x1e832f[_0x442e75(0x206)],_0x29938d=_0x1e832f[_0x442e75(0x1f7)][_0x442e75(0x23e)],_0x41b1ee=_0x1e832f[_0x442e75(0x1f7)][_0x442e75(0x206)],_0x3ad44f=_0x1e832f[_0x442e75(0x1f7)][_0x442e75(0x22d)],_0x1873e4=await executePushSegmentDeletions(_0x4fb15e,_0x3559f0['journeysOnly']?[]:_0x2c1310,_0x1bd359);let _0x316c79=0x0,_0x404128=0x0,_0x477aec=0x0;const _0x2af236=new Map(_0x4c8fa9);for(const [_0x53796d,_0x5204d2]of _0x1e832f[_0x442e75(0x1bd)]){_0x2af236[_0x442e75(0x1ea)](_0x53796d,_0x5204d2);}if(_0xfc62b0[_0x442e75(0x229)]>0x0){const _0x14dacb={..._0x25bdbe,'segmentNameToId':_0x2af236,'existingSegments':_0x3df0f4,'activationContext':_0x4f4722},_0x189092=await executePushJourneys(_0x4fb15e,_0xfc62b0,_0x14dacb,{'parentId':_0x4125d0,'rootFolderId':_0x2675be,'verbose':_0x3559f0[_0x442e75(0x1fb)]},_0x1bd359);_0x316c79=_0x189092['created'],_0x404128=_0x189092['updated'];if(_0x40056b&&_0x189092[_0x442e75(0x1bf)][_0x442e75(0x229)]===0x1){const _0x1e46c3=_0x189092[_0x442e75(0x1bf)][0x0];if(_0x1e46c3[_0x442e75(0x226)]){const _0x38139a=getConsoleNextUrl(_0x3559f0[_0x442e75(0x212)],_0x442e75(0x1f9)+_0x4125d0+_0x442e75(0x20b)+_0x1e46c3['journeyId']+_0x442e75(0x1c5));console[_0x442e75(0x1f3)]('\x20\x20'+a31_0x460526[_0x442e75(0x242)](_0x38139a));}}}for(const _0x2e6a64 of _0x2cd0f4){console['error'](a31_0x460526[_0x442e75(0x219)](_0x442e75(0x21b)+_0x2e6a64['journeyBundleName'])),_0x477aec++;}const _0x15be24=[];if(_0x2ce961>0x0)_0x15be24['push'](_0x2ce961+_0x442e75(0x1e1));if(_0x23cfdf>0x0)_0x15be24['push'](_0x23cfdf+'\x20updated');if(_0x1873e4>0x0)_0x15be24[_0x442e75(0x255)](_0x1873e4+_0x442e75(0x208));const _0xefbbba=[];if(_0x316c79>0x0)_0xefbbba[_0x442e75(0x255)](_0x316c79+'\x20created');if(_0x404128>0x0)_0xefbbba[_0x442e75(0x255)](_0x404128+_0x442e75(0x1c7));if(_0x477aec>0x0)_0xefbbba[_0x442e75(0x255)](_0x477aec+_0x442e75(0x208));const _0x595a25=[];if(_0x29938d>0x0)_0x595a25[_0x442e75(0x255)](_0x29938d+_0x442e75(0x1e1));if(_0x41b1ee>0x0)_0x595a25[_0x442e75(0x255)](_0x41b1ee+_0x442e75(0x1c7));if(_0x3ad44f>0x0)_0x595a25['push'](_0x3ad44f+_0x442e75(0x208));return console['error'](a31_0x460526[_0x442e75(0x1c6)]('\x0a✔\x20Push\x20complete')),_0x15be24[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&console['error'](_0x442e75(0x24f)+_0x15be24[_0x442e75(0x1e4)](',\x20')),_0xefbbba[_0x442e75(0x229)]>0x0&&console[_0x442e75(0x1f3)](_0x442e75(0x23d)+_0xefbbba['join'](',\x20')),_0x595a25[_0x442e75(0x229)]>0x0&&!_0x3559f0[_0x442e75(0x1d0)]&&console[_0x442e75(0x1f3)]('\x20\x20Activations:\x20'+_0x595a25[_0x442e75(0x1e4)](',\x20')),0x0;}}
@@ -1 +1 @@
1
- const a32_0x3c031a=a32_0x4587;(function(_0x2124c6,_0x365256){const _0xaf6fc9=a32_0x4587,_0x1d8653=_0x2124c6();while(!![]){try{const _0x4c7594=-parseInt(_0xaf6fc9(0x153))/0x1*(-parseInt(_0xaf6fc9(0x137))/0x2)+parseInt(_0xaf6fc9(0x14e))/0x3+-parseInt(_0xaf6fc9(0x14b))/0x4*(-parseInt(_0xaf6fc9(0x132))/0x5)+parseInt(_0xaf6fc9(0x148))/0x6*(-parseInt(_0xaf6fc9(0x15f))/0x7)+-parseInt(_0xaf6fc9(0x140))/0x8*(-parseInt(_0xaf6fc9(0x155))/0x9)+parseInt(_0xaf6fc9(0x163))/0xa+parseInt(_0xaf6fc9(0x141))/0xb*(-parseInt(_0xaf6fc9(0x149))/0xc);if(_0x4c7594===_0x365256)break;else _0x1d8653['push'](_0x1d8653['shift']());}catch(_0x487dc9){_0x1d8653['push'](_0x1d8653['shift']());}}}(a32_0x19f2,0x4cb21));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a32_0x4587(_0x38e909,_0x47a634){_0x38e909=_0x38e909-0x12d;const _0x19f282=a32_0x19f2();let _0x45875e=_0x19f282[_0x38e909];return _0x45875e;}function a32_0x19f2(){const _0x3907f2=['Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','parentId','yellow','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Updating\x20segment\x20\x27','1465CVFnVL','error','Resolving\x20folder\x20\x27','segmentName','\x27...','2BjnwHC','length','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Error:\x20Cannot\x20update\x20','Resolved\x20folder\x20ID:\x20','type','data','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','ruleFile','8TPxjqu','10219WpkZRL','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20path\x20\x27','updateSegmentById','kind','Examples:','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','6TdKOXq','19572hLSQai','verbose','6276CmUmlc','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20\x20Path:\x20','592971tFGoml','segment:update','Parent\x20ID:\x20','rule','segmentId','465926nbvvgX','folder','5224239mHWWhv','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segmentPath','execute','name','description','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','1945713rYSmeI','✔\x20Updated\x20segment\x20\x27','Resolved\x20type:\x20','segment','4035320xJtqkz','resolvePathToResource'];a32_0x19f2=function(){return _0x3907f2;};return a32_0x19f2();}import a32_0x2c25d1 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a32_0x3c031a(0x159)]=a32_0x3c031a(0x14f);[a32_0x3c031a(0x15a)]='Update\x20existing\x20child\x20segment';async[a32_0x3c031a(0x158)](_0x176774){const _0x597911=a32_0x3c031a;console[_0x597911(0x133)](a32_0x2c25d1[_0x597911(0x12f)](_0x597911(0x13e))),console[_0x597911(0x133)](a32_0x2c25d1[_0x597911(0x12f)](_0x597911(0x139)));const {options:_0x497a21,args:_0x5e3b72,tdx:_0x28a4ef}=_0x176774,_0x15d6aa=_0x497a21;if(_0x5e3b72[_0x597911(0x138)]===0x0)return console['error'](_0x597911(0x12d)),console['error'](_0x597911(0x14c)),console[_0x597911(0x133)](_0x597911(0x146)),console[_0x597911(0x133)](_0x597911(0x15e)),console[_0x597911(0x133)](_0x597911(0x147)),0x1;const _0x2f256d=_0x5e3b72[0x0],_0x31b103=_0x497a21[_0x597911(0x157)];let _0x4916ec=_0x2f256d;_0x31b103&&!_0x2f256d['includes']('/')&&(_0x4916ec=_0x31b103+'/'+_0x2f256d,_0x15d6aa[_0x597911(0x14a)]&&console[_0x597911(0x133)](_0x597911(0x15c)+_0x4916ec));const _0xd29681=await withSpinner(_0x597911(0x143)+_0x4916ec+_0x597911(0x136),()=>_0x28a4ef[_0x597911(0x162)][_0x597911(0x164)](_0x4916ec),{'verbose':_0x15d6aa[_0x597911(0x14a)]}),_0x491c98=_0xd29681['data'];_0x15d6aa[_0x597911(0x14a)]&&console[_0x597911(0x133)](_0x597911(0x161)+_0x491c98[_0x597911(0x13c)]);if(_0x491c98['type']!=='segment')return console['error'](_0x597911(0x13a)+_0x491c98[_0x597911(0x13c)]+_0x597911(0x130)),console['error'](_0x597911(0x156)),0x1;if(!_0x491c98[_0x597911(0x152)])throw new SDKError(ErrorCode[_0x597911(0x15d)],_0x597911(0x142));const _0x8d991a=_0x491c98[_0x597911(0x12e)],_0xf927d8=_0x491c98[_0x597911(0x152)];_0x15d6aa['verbose']&&(console['error'](_0x597911(0x150)+_0x8d991a),console['error'](_0x597911(0x15b)+_0xf927d8));let _0x256619;if(_0x15d6aa[_0x597911(0x154)]){const _0x4222f7=_0x15d6aa[_0x597911(0x154)],_0x533de4=await withSpinner(_0x597911(0x134)+_0x4222f7+_0x597911(0x136),()=>_0x28a4ef['segment']['resolveFolderId'](_0x8d991a,_0x4222f7),{'verbose':_0x15d6aa[_0x597911(0x14a)]});_0x256619=parseInt(_0x533de4[_0x597911(0x13d)],0xa),_0x15d6aa[_0x597911(0x14a)]&&console[_0x597911(0x133)](_0x597911(0x13b)+_0x256619);}const _0x4c5acf=await loadJSONFromOptions(_0x15d6aa[_0x597911(0x151)],_0x15d6aa[_0x597911(0x13f)]),_0x58458e={'name':_0x15d6aa['name'],'description':_0x15d6aa['description'],'rule':_0x4c5acf,'kind':_0x15d6aa[_0x597911(0x145)]!==undefined?parseInt(_0x15d6aa[_0x597911(0x145)],0xa):undefined,'segmentFolderId':_0x256619},_0x31704e=await withSpinner(_0x597911(0x131)+_0x491c98[_0x597911(0x135)]+_0x597911(0x136),()=>_0x28a4ef[_0x597911(0x162)][_0x597911(0x144)](_0x8d991a,_0xf927d8,_0x58458e),{'verbose':_0x15d6aa[_0x597911(0x14a)]}),_0x251280=_0x31704e[_0x597911(0x13d)];return console[_0x597911(0x133)](_0x597911(0x160)+_0x251280['name']+'\x27'),_0x4916ec!==_0x2f256d&&console[_0x597911(0x133)](_0x597911(0x14d)+_0x4916ec),await handleSDKOutput([_0x251280],_0x15d6aa),0x0;}}
1
+ const a32_0x3a1a4e=a32_0x3364;(function(_0x220113,_0x1a882b){const _0x4d352b=a32_0x3364,_0x446456=_0x220113();while(!![]){try{const _0x211b7d=parseInt(_0x4d352b(0xb7))/0x1+-parseInt(_0x4d352b(0x94))/0x2*(-parseInt(_0x4d352b(0xb6))/0x3)+-parseInt(_0x4d352b(0x9f))/0x4+-parseInt(_0x4d352b(0x8d))/0x5+parseInt(_0x4d352b(0xb8))/0x6*(-parseInt(_0x4d352b(0x8b))/0x7)+parseInt(_0x4d352b(0x8c))/0x8+parseInt(_0x4d352b(0x95))/0x9;if(_0x211b7d===_0x1a882b)break;else _0x446456['push'](_0x446456['shift']());}catch(_0x187db1){_0x446456['push'](_0x446456['shift']());}}}(a32_0x352f,0x9532a));function a32_0x352f(){const _0x1719d5=['yellow','segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','execute','data','includes','Resolving\x20folder\x20\x27','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','verbose','531978MBFkLm','1085334ASOzyj','24NOWToF','updateSegmentById','1901872DSyvxo','4705896Ekwtjm','5836985EDqnzJ','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','length','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Error:\x20Cannot\x20update\x20','type','8HVxbYJ','12745341vmEdnt','kind','Resolving\x20path\x20\x27','rule','Parent\x20ID:\x20','resolveFolderId','segmentId','Resolved\x20type:\x20','parentId','\x27...','3734916NwZkvs','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','error','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment:update','resolvePathToResource','✔\x20Updated\x20segment\x20\x27','Update\x20existing\x20child\x20segment','ruleFile','folder','name','INTERNAL'];a32_0x352f=function(){return _0x1719d5;};return a32_0x352f();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a32_0x3364(_0xa507a0,_0x2324c9){_0xa507a0=_0xa507a0-0x8b;const _0x352fa6=a32_0x352f();let _0x3364b7=_0x352fa6[_0xa507a0];return _0x3364b7;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a32_0x3b0f77 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a32_0x3a1a4e(0xaa)]=a32_0x3a1a4e(0xa4);['description']=a32_0x3a1a4e(0xa7);async[a32_0x3a1a4e(0xaf)](_0x10eece){const _0x1e1867=a32_0x3a1a4e;console[_0x1e1867(0xa2)](a32_0x3b0f77[_0x1e1867(0xac)](_0x1e1867(0x8e))),console['error'](a32_0x3b0f77[_0x1e1867(0xac)](_0x1e1867(0x8f)));const {options:_0x56a71a,args:_0x4fa394,tdx:_0x1e1ff1}=_0x10eece,_0xf17b73=_0x56a71a;if(_0x4fa394[_0x1e1867(0x90)]===0x0)return console['error'](_0x1e1867(0xa3)),console['error'](_0x1e1867(0xa1)),console[_0x1e1867(0xa2)]('Examples:'),console[_0x1e1867(0xa2)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x1e1867(0xa2)](_0x1e1867(0xae)),0x1;const _0x1cf282=_0x4fa394[0x0],_0x520a2c=_0x56a71a['segmentPath'];let _0x518793=_0x1cf282;_0x520a2c&&!_0x1cf282[_0x1e1867(0xb1)]('/')&&(_0x518793=_0x520a2c+'/'+_0x1cf282,_0xf17b73[_0x1e1867(0xb5)]&&console[_0x1e1867(0xa2)](_0x1e1867(0xb4)+_0x518793));const _0x4c03b8=await withSpinner(_0x1e1867(0x97)+_0x518793+_0x1e1867(0x9e),()=>_0x1e1ff1[_0x1e1867(0xad)][_0x1e1867(0xa5)](_0x518793),{'verbose':_0xf17b73[_0x1e1867(0xb5)]}),_0x4ecbe3=_0x4c03b8['data'];_0xf17b73[_0x1e1867(0xb5)]&&console['error'](_0x1e1867(0x9c)+_0x4ecbe3[_0x1e1867(0x93)]);if(_0x4ecbe3[_0x1e1867(0x93)]!==_0x1e1867(0xad))return console[_0x1e1867(0xa2)](_0x1e1867(0x92)+_0x4ecbe3['type']+_0x1e1867(0x91)),console[_0x1e1867(0xa2)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x4ecbe3[_0x1e1867(0x9b)])throw new SDKError(ErrorCode[_0x1e1867(0xab)],_0x1e1867(0xa0));const _0x3b3c79=_0x4ecbe3[_0x1e1867(0x9d)],_0x32620a=_0x4ecbe3[_0x1e1867(0x9b)];_0xf17b73['verbose']&&(console[_0x1e1867(0xa2)](_0x1e1867(0x99)+_0x3b3c79),console['error'](_0x1e1867(0xb3)+_0x32620a));let _0xe867b;if(_0xf17b73[_0x1e1867(0xa9)]){const _0x55c92c=_0xf17b73[_0x1e1867(0xa9)],_0x3bc594=await withSpinner(_0x1e1867(0xb2)+_0x55c92c+_0x1e1867(0x9e),()=>_0x1e1ff1[_0x1e1867(0xad)][_0x1e1867(0x9a)](_0x3b3c79,_0x55c92c),{'verbose':_0xf17b73[_0x1e1867(0xb5)]});_0xe867b=parseInt(_0x3bc594['data'],0xa),_0xf17b73['verbose']&&console['error']('Resolved\x20folder\x20ID:\x20'+_0xe867b);}const _0x45d334=await loadJSONFromOptions(_0xf17b73[_0x1e1867(0x98)],_0xf17b73[_0x1e1867(0xa8)]),_0x33beae={'name':_0xf17b73[_0x1e1867(0xaa)],'description':_0xf17b73['description'],'rule':_0x45d334,'kind':_0xf17b73[_0x1e1867(0x96)]!==undefined?parseInt(_0xf17b73['kind'],0xa):undefined,'segmentFolderId':_0xe867b},_0xebf3f4=await withSpinner('Updating\x20segment\x20\x27'+_0x4ecbe3['segmentName']+'\x27...',()=>_0x1e1ff1['segment'][_0x1e1867(0xb9)](_0x3b3c79,_0x32620a,_0x33beae),{'verbose':_0xf17b73[_0x1e1867(0xb5)]}),_0x42c8f4=_0xebf3f4[_0x1e1867(0xb0)];return console[_0x1e1867(0xa2)](_0x1e1867(0xa6)+_0x42c8f4['name']+'\x27'),_0x518793!==_0x1cf282&&console[_0x1e1867(0xa2)]('\x20\x20\x20Path:\x20'+_0x518793),await handleSDKOutput([_0x42c8f4],_0xf17b73),0x0;}}
@@ -1 +1 @@
1
- function a33_0x4668(_0x2be775,_0x12fcb9){_0x2be775=_0x2be775-0x16d;const _0x197647=a33_0x1976();let _0x466809=_0x197647[_0x2be775];return _0x466809;}const a33_0x9582e7=a33_0x4668;(function(_0x14edb3,_0x5d1c9a){const _0x157752=a33_0x4668,_0x4694ca=_0x14edb3();while(!![]){try{const _0x545399=parseInt(_0x157752(0x18a))/0x1*(-parseInt(_0x157752(0x187))/0x2)+-parseInt(_0x157752(0x174))/0x3+-parseInt(_0x157752(0x19e))/0x4+parseInt(_0x157752(0x176))/0x5+-parseInt(_0x157752(0x17c))/0x6*(parseInt(_0x157752(0x175))/0x7)+parseInt(_0x157752(0x19b))/0x8+parseInt(_0x157752(0x1a0))/0x9;if(_0x545399===_0x5d1c9a)break;else _0x4694ca['push'](_0x4694ca['shift']());}catch(_0x420879){_0x4694ca['push'](_0x4694ca['shift']());}}}(a33_0x1976,0x6f61f));import{existsSync,statSync}from'fs';import a33_0x3d1c6f from'chalk';function a33_0x1976(){const _0x2c1442=['join','Usage:\x20tdx\x20segment\x20use\x20<path>','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','red','✔\x20Context\x20set\x20to:\x20','length','687624IIChcW','Parent\x20ID:\x20','Site:\x20','126696RPuAWQ','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','11507661AGZAGs','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Use:\x20tdx\x20segment\x20use\x20','error','cyan','dim','\x27...','verbose','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment','folderId','Resolved\x20path\x20type:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','parentName','327396ppbNPn','637SRXUZS','203385EGFaMZ','type','config','split','session','fullPath','18228qZiKTk','folderPath','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','slice','Examples:','Resolving\x20path\x20\x27','log','green','2IKLpAN','segment:use','resolvePathToResource','531772cbCnYK','name','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','data','segments','isDirectory','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','site','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Target\x20path:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'];a33_0x1976=function(){return _0x2c1442;};return a33_0x1976();}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{[a33_0x9582e7(0x18b)]=a33_0x9582e7(0x188);['description']=a33_0x9582e7(0x180);async['execute'](_0x443004){const _0x30bf2e=a33_0x9582e7,{options:_0x2b61a5,args:_0x2d3684,tdx:_0x511958}=_0x443004;if(_0x2d3684[_0x30bf2e(0x19a)]===0x0)return console[_0x30bf2e(0x1a3)](a33_0x3d1c6f['red']('Error:\x20Path\x20is\x20required\x0a')),console[_0x30bf2e(0x1a3)](_0x30bf2e(0x196)),console[_0x30bf2e(0x1a3)](_0x30bf2e(0x183)),console[_0x30bf2e(0x1a3)](_0x30bf2e(0x17e)),console[_0x30bf2e(0x1a3)](_0x30bf2e(0x19f)),console[_0x30bf2e(0x1a3)](_0x30bf2e(0x192)),console['error'](_0x30bf2e(0x197)),0x1;const _0x2de091=_0x2d3684[0x0],_0x369fd9=_0x2b61a5[_0x30bf2e(0x17a)];try{if(_0x2de091==='/')return saveSessionContext({'segment_path':undefined},_0x369fd9),console['log'](a33_0x3d1c6f['green'](_0x30bf2e(0x172))),0x0;if(existsSync(_0x2de091)&&statSync(_0x2de091)[_0x30bf2e(0x18f)]()){let _0x66eb76;try{_0x66eb76=findTdxConfig(_0x2de091);}catch{return console[_0x30bf2e(0x1a3)](a33_0x3d1c6f[_0x30bf2e(0x198)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x2de091)),console['error'](a33_0x3d1c6f['cyan'](_0x30bf2e(0x16e))),0x1;}const _0x232922=_0x66eb76[_0x30bf2e(0x178)]['parent_segment'];return saveSessionContext({'segment_path':_0x232922,'parent_segment':_0x232922},_0x369fd9),console[_0x30bf2e(0x185)](a33_0x3d1c6f[_0x30bf2e(0x186)](_0x30bf2e(0x199)+a33_0x3d1c6f[_0x30bf2e(0x1a4)](_0x232922))),0x0;}const _0x2df25e=_0x2b61a5['segmentPath'];let _0x3e20a2=_0x2de091;const _0x9b7466=parsePath(_0x2de091);if(!_0x9b7466['isAbsolute']){if(!_0x2df25e)return console[_0x30bf2e(0x1a3)](a33_0x3d1c6f[_0x30bf2e(0x198)](_0x30bf2e(0x181))),console[_0x30bf2e(0x1a3)](a33_0x3d1c6f['cyan'](_0x30bf2e(0x1a1))),0x1;if(_0x2de091==='..'){const _0x5f12b1=_0x2df25e[_0x30bf2e(0x179)]('/')[_0x30bf2e(0x182)](0x0,-0x1)[_0x30bf2e(0x195)]('/');_0x3e20a2=_0x5f12b1||'/';}else _0x2de091==='.'?_0x3e20a2=_0x2df25e:_0x3e20a2=_0x2df25e+'/'+_0x2de091;_0x2b61a5[_0x30bf2e(0x16d)]&&console[_0x30bf2e(0x1a3)]('Resolved\x20relative\x20path\x20to:\x20'+_0x3e20a2);}if(_0x3e20a2==='/'||_0x3e20a2==='')return saveSessionContext({'segment_path':undefined},_0x369fd9),console[_0x30bf2e(0x185)](a33_0x3d1c6f[_0x30bf2e(0x186)](_0x30bf2e(0x172))),0x0;_0x3e20a2=normalizePath(_0x3e20a2);const _0x2d6ae0=parsePath(_0x3e20a2)[_0x30bf2e(0x18e)];if(_0x2d6ae0[_0x30bf2e(0x19a)]===0x0)return saveSessionContext({'segment_path':undefined},_0x369fd9),console[_0x30bf2e(0x185)](a33_0x3d1c6f[_0x30bf2e(0x186)](_0x30bf2e(0x172))),0x0;_0x2b61a5[_0x30bf2e(0x16d)]&&(console['error'](_0x30bf2e(0x19d)+_0x2b61a5[_0x30bf2e(0x191)]),console[_0x30bf2e(0x1a3)](_0x30bf2e(0x193)+_0x3e20a2));const _0x522bd8=await withSpinner(_0x30bf2e(0x184)+_0x3e20a2+_0x30bf2e(0x1a6),()=>_0x511958[_0x30bf2e(0x16f)][_0x30bf2e(0x189)](_0x3e20a2),{'verbose':_0x2b61a5[_0x30bf2e(0x16d)]}),_0x3904a2=_0x522bd8[_0x30bf2e(0x18d)];_0x2b61a5[_0x30bf2e(0x16d)]&&(console[_0x30bf2e(0x1a3)](_0x30bf2e(0x171)+_0x3904a2[_0x30bf2e(0x177)]),console[_0x30bf2e(0x1a3)](_0x30bf2e(0x19c)+_0x3904a2['parentId']),_0x3904a2[_0x30bf2e(0x170)]&&console[_0x30bf2e(0x1a3)]('Folder\x20ID:\x20'+_0x3904a2[_0x30bf2e(0x170)]));if(_0x3904a2[_0x30bf2e(0x177)]===_0x30bf2e(0x16f))return console[_0x30bf2e(0x1a3)](a33_0x3d1c6f[_0x30bf2e(0x198)](_0x30bf2e(0x17f))),console[_0x30bf2e(0x1a3)](_0x30bf2e(0x18c)),console[_0x30bf2e(0x1a3)](a33_0x3d1c6f[_0x30bf2e(0x1a4)](_0x30bf2e(0x1a2)+_0x3904a2[_0x30bf2e(0x173)]+(_0x3904a2[_0x30bf2e(0x17d)]?'/'+_0x3904a2[_0x30bf2e(0x17d)][_0x30bf2e(0x195)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3904a2[_0x30bf2e(0x17b)],'parent_segment':_0x3904a2[_0x30bf2e(0x173)]},_0x369fd9),console[_0x30bf2e(0x185)](a33_0x3d1c6f[_0x30bf2e(0x186)](_0x30bf2e(0x199)+a33_0x3d1c6f['cyan'](_0x3904a2[_0x30bf2e(0x17b)]))),_0x2b61a5[_0x30bf2e(0x16d)]&&(console[_0x30bf2e(0x1a3)](a33_0x3d1c6f[_0x30bf2e(0x1a5)](_0x30bf2e(0x190))),console['error'](a33_0x3d1c6f['dim'](_0x30bf2e(0x194)))),0x0;}catch(_0x23814a){throw _0x23814a;}}}
1
+ const a33_0x46cf5b=a33_0x4a1c;(function(_0x3d08c5,_0xb663ae){const _0x2d15bc=a33_0x4a1c,_0x2c69ff=_0x3d08c5();while(!![]){try{const _0x6dcf=parseInt(_0x2d15bc(0x85))/0x1+-parseInt(_0x2d15bc(0x93))/0x2+parseInt(_0x2d15bc(0xb6))/0x3*(-parseInt(_0x2d15bc(0x86))/0x4)+-parseInt(_0x2d15bc(0x8d))/0x5*(-parseInt(_0x2d15bc(0x99))/0x6)+-parseInt(_0x2d15bc(0xaa))/0x7+parseInt(_0x2d15bc(0xa5))/0x8+-parseInt(_0x2d15bc(0xa4))/0x9*(-parseInt(_0x2d15bc(0x91))/0xa);if(_0x6dcf===_0xb663ae)break;else _0x2c69ff['push'](_0x2c69ff['shift']());}catch(_0x556231){_0x2c69ff['push'](_0x2c69ff['shift']());}}}(a33_0x3ed7,0xdec73));function a33_0x4a1c(_0xb66d27,_0x40d15d){_0xb66d27=_0xb66d27-0x7b;const _0x3ed781=a33_0x3ed7();let _0x4a1c79=_0x3ed781[_0xb66d27];return _0x4a1c79;}import{existsSync,statSync}from'fs';import a33_0x5d2d04 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a33_0x3ed7(){const _0x5169b8=['4707peDgQt','13671016mpWMNw','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','folderPath','7264096dnsJWV','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','segmentPath','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','join','segment','Use:\x20tdx\x20segment\x20use\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','name','green','9tTPvXY','error','site','session','data','cyan','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','isAbsolute','type','parentName','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','617811LgAjCm','827636lgrZzv','fullPath','Site:\x20','segments','\x27...','verbose','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','700FWaroG','segment:use','split','Resolving\x20path\x20\x27','35770YqIEBq','parentId','3538890iFqkQb','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Error:\x20Path\x20is\x20required\x0a','slice','red','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','6126rJbChQ','Examples:','✔\x20Context\x20set\x20to:\x20','config','description','dim','folderId','log','length','Resolved\x20path\x20type:\x20','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context'];a33_0x3ed7=function(){return _0x5169b8;};return a33_0x3ed7();}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{[a33_0x46cf5b(0xb4)]=a33_0x46cf5b(0x8e);[a33_0x46cf5b(0x9d)]=a33_0x46cf5b(0xad);async['execute'](_0x3ad962){const _0x397078=a33_0x46cf5b,{options:_0x5edc00,args:_0x19eca2,tdx:_0x4d4e67}=_0x3ad962;if(_0x19eca2[_0x397078(0xa1)]===0x0)return console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0x95))),console[_0x397078(0x7b)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x397078(0x7b)](_0x397078(0x9a)),console[_0x397078(0x7b)](_0x397078(0x80)),console['error'](_0x397078(0x94)),console[_0x397078(0x7b)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x397078(0x7b)](_0x397078(0xae)),0x1;const _0x5794f1=_0x19eca2[0x0],_0x3fc88f=_0x5edc00[_0x397078(0x7d)];try{if(_0x5794f1==='/')return saveSessionContext({'segment_path':undefined},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)](_0x397078(0xb3))),0x0;if(existsSync(_0x5794f1)&&statSync(_0x5794f1)['isDirectory']()){let _0x1666ba;try{_0x1666ba=findTdxConfig(_0x5794f1);}catch{return console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0x8c)+_0x5794f1)),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x7f)](_0x397078(0xb2))),0x1;}const _0xce6969=_0x1666ba[_0x397078(0x9c)]['parent_segment'];return saveSessionContext({'segment_path':_0xce6969,'parent_segment':_0xce6969},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04['green'](_0x397078(0x9b)+a33_0x5d2d04[_0x397078(0x7f)](_0xce6969))),0x0;}const _0x3e8a8e=_0x5edc00[_0x397078(0xac)];let _0x3af29e=_0x5794f1;const _0x359fb3=parsePath(_0x5794f1);if(!_0x359fb3[_0x397078(0x81)]){if(!_0x3e8a8e)return console['error'](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0xa6))),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x7f)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x5794f1==='..'){const _0xb34bb6=_0x3e8a8e[_0x397078(0x8f)]('/')[_0x397078(0x96)](0x0,-0x1)[_0x397078(0xaf)]('/');_0x3af29e=_0xb34bb6||'/';}else _0x5794f1==='.'?_0x3af29e=_0x3e8a8e:_0x3af29e=_0x3e8a8e+'/'+_0x5794f1;_0x5edc00['verbose']&&console['error'](_0x397078(0xa8)+_0x3af29e);}if(_0x3af29e==='/'||_0x3af29e==='')return saveSessionContext({'segment_path':undefined},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3af29e=normalizePath(_0x3af29e);const _0x29263b=parsePath(_0x3af29e)[_0x397078(0x89)];if(_0x29263b[_0x397078(0xa1)]===0x0)return saveSessionContext({'segment_path':undefined},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)](_0x397078(0xb3))),0x0;_0x5edc00[_0x397078(0x8b)]&&(console[_0x397078(0x7b)](_0x397078(0x88)+_0x5edc00[_0x397078(0x7c)]),console[_0x397078(0x7b)]('Target\x20path:\x20'+_0x3af29e));const _0x2f6ca3=await withSpinner(_0x397078(0x90)+_0x3af29e+_0x397078(0x8a),()=>_0x4d4e67['segment'][_0x397078(0xa7)](_0x3af29e),{'verbose':_0x5edc00['verbose']}),_0x174b87=_0x2f6ca3[_0x397078(0x7e)];_0x5edc00[_0x397078(0x8b)]&&(console[_0x397078(0x7b)](_0x397078(0xa2)+_0x174b87[_0x397078(0x82)]),console['error']('Parent\x20ID:\x20'+_0x174b87[_0x397078(0x92)]),_0x174b87[_0x397078(0x9f)]&&console['error']('Folder\x20ID:\x20'+_0x174b87['folderId']));if(_0x174b87[_0x397078(0x82)]===_0x397078(0xb0))return console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x97)](_0x397078(0x84))),console[_0x397078(0x7b)](_0x397078(0x98)),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x7f)](_0x397078(0xb1)+_0x174b87[_0x397078(0x83)]+(_0x174b87[_0x397078(0xa9)]?'/'+_0x174b87['folderPath'][_0x397078(0xaf)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x174b87[_0x397078(0x87)],'parent_segment':_0x174b87[_0x397078(0x83)]},_0x3fc88f),console[_0x397078(0xa0)](a33_0x5d2d04[_0x397078(0xb5)](_0x397078(0x9b)+a33_0x5d2d04['cyan'](_0x174b87[_0x397078(0x87)]))),_0x5edc00['verbose']&&(console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x9e)](_0x397078(0xa3))),console[_0x397078(0x7b)](a33_0x5d2d04[_0x397078(0x9e)](_0x397078(0xab)))),0x0;}catch(_0x53c9b6){throw _0x53c9b6;}}}