@treasuredata/tdx 2026.4.2 → 2026.4.4

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 (219) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x1b8539=a40_0x3d7e;(function(_0xc20989,_0x95619d){const _0x3d8c18=a40_0x3d7e,_0x4cc2c7=_0xc20989();while(!![]){try{const _0x3cb614=-parseInt(_0x3d8c18(0xb7))/0x1+parseInt(_0x3d8c18(0x85))/0x2*(-parseInt(_0x3d8c18(0xb8))/0x3)+parseInt(_0x3d8c18(0x9c))/0x4*(parseInt(_0x3d8c18(0x98))/0x5)+-parseInt(_0x3d8c18(0x7e))/0x6+parseInt(_0x3d8c18(0x9d))/0x7+-parseInt(_0x3d8c18(0x9e))/0x8*(-parseInt(_0x3d8c18(0x72))/0x9)+parseInt(_0x3d8c18(0x99))/0xa;if(_0x3cb614===_0x95619d)break;else _0x4cc2c7['push'](_0x4cc2c7['shift']());}catch(_0x4e0d69){_0x4cc2c7['push'](_0x4cc2c7['shift']());}}}(a40_0x6f10,0x2dcc4));function a40_0x3d7e(_0x49c827,_0x246e5a){_0x49c827=_0x49c827-0x70;const _0x6f1036=a40_0x6f10();let _0x3d7e26=_0x6f1036[_0x49c827];return _0x3d7e26;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x6f10(){const _0x33b91b=['session','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x0aPull\x20summary\x20for\x20\x27','repeat','dryRun','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','data','helpText','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20files?','179590GZMgmf','111NFTVMm','\x20\x20🗺️\x20\x20','\x27...','journeys','\x20files\x20to\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','verbose','Site:\x20','execute','\x20changed\x20files','✔\x20Pulled\x20','relativePath','isNew','content','36iYMCeJ','files','\x20activations','segment:pull','\x20\x20Target:\x20','cyan','\x20segments','parentSegment','name','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parent_segment','1783446VLLjXy','\x0aError:','\x20new\x20files','diff','pullSegments','absolutePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','1058oGBxqz','\x20=\x20','Write\x20','segments','setPhase','filter','cwd','journeyVersions','counts','✔\x20Context\x20set:\x20','\x20\x20🎯\x20','parentName','\x0aChanges\x20to\x20\x27','\x20journeys','green','dim','yellow','✔\x20All\x20files\x20are\x20up\x20to\x20date','Pulling\x20segments\x20from\x20\x27','55IXDVpT','766090tRSbAk','Error:\x20','length','60072xYnDJv','2604147rTPkki','140328zSRDvp','Aborted.','resourceName','activations','targetDir','Parent\x20segment:\x20','\x20versions)','\x20unchanged\x20files','\x20with\x20','error','errorCode','message','-\x20no\x20files\x20written','site','hasChanges'];a40_0x6f10=function(){return _0x33b91b;};return a40_0x6f10();}import{saveSessionContext}from'../core/session.js';import a40_0xb47af2 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x1ad97f from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x1b8539(0x7a)]=a40_0x1b8539(0x75);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x1b8539(0xc0)](_0x427a2b){const _0x245dc1=a40_0x1b8539,{options:_0x28c024,args:_0x460cd0,tdx:_0x4e291e}=_0x427a2b,_0xca70eb=_0x28c024,_0x549019=await resolveTarget({'arg':_0x460cd0[0x0],'contextParent':_0x28c024[_0x245dc1(0x79)],'cwd':process[_0x245dc1(0x8b)]()});if(!isSuccessfulResolution(_0x549019))return _0x549019[_0x245dc1(0xa8)]==='no_parent'?(console['error'](a40_0xb47af2[_0x245dc1(0x95)](_0x245dc1(0xb2))),console[_0x245dc1(0xa7)]('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)'),console[_0x245dc1(0xa7)]('\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'](_0x245dc1(0x84))):(console[_0x245dc1(0xa7)](a40_0xb47af2['red'](_0x245dc1(0x9a)+_0x549019[_0x245dc1(0xa9)]+'\x0a')),_0x549019[_0x245dc1(0xb4)]&&console[_0x245dc1(0xa7)](a40_0xb47af2['cyan'](_0x549019[_0x245dc1(0xb4)]))),0x1;const _0x199125=_0x549019['parentName'],_0x2a364c=_0x549019[_0x245dc1(0xa2)],_0x218fc4=_0x549019['type']==='file'?_0x549019[_0x245dc1(0xa0)]:undefined;_0xca70eb['verbose']&&(console['error'](_0x245dc1(0xbf)+_0xca70eb[_0x245dc1(0xab)]),console[_0x245dc1(0xa7)](_0x245dc1(0xa3)+_0x199125),_0x218fc4&&console[_0x245dc1(0xa7)]('Target\x20resource:\x20'+_0x218fc4));const _0x5c1ea8=await withProgressSpinner(_0x245dc1(0x97)+_0x199125+_0x245dc1(0xba),_0x141a24=>_0x4e291e['segment'][_0x245dc1(0x82)](_0x199125,{'targetDir':_0x2a364c,'targetResourceName':_0x218fc4,'verbose':_0xca70eb[_0x245dc1(0xbe)],'progress':{'update':_0x3df35a=>{const _0x32b2ae=_0x245dc1;_0x141a24[_0x32b2ae(0x89)](_0x3df35a),_0xca70eb[_0x32b2ae(0xbe)]&&console[_0x32b2ae(0xa7)]('\x20\x20'+_0x3df35a);}}}),{'verbose':_0xca70eb[_0x245dc1(0xbe)]}),_0x38bf58=_0x5c1ea8[_0x245dc1(0xb3)];if(_0x38bf58['counts'][_0x245dc1(0x88)]===0x0&&_0x38bf58[_0x245dc1(0x8d)][_0x245dc1(0xbb)]===0x0)return console[_0x245dc1(0xa7)](a40_0xb47af2['yellow'](_0x245dc1(0xae)+_0x38bf58[_0x245dc1(0x90)]+'\x27')),0x0;const _0x2238cd=_0x38bf58['files'][_0x245dc1(0x8a)](_0x36eb5c=>_0x36eb5c[_0x245dc1(0x70)]),_0x20d834=_0x38bf58[_0x245dc1(0x73)][_0x245dc1(0x8a)](_0xd6fb9e=>!_0xd6fb9e[_0x245dc1(0x70)]&&_0xd6fb9e['hasChanges']),_0x4daf44=_0x38bf58[_0x245dc1(0x73)][_0x245dc1(0x8a)](_0x3a8332=>!_0x3a8332['isNew']&&!_0x3a8332[_0x245dc1(0xac)]);console[_0x245dc1(0xa7)](_0x245dc1(0xaf)+_0x38bf58['parentName']+'\x27:'),console[_0x245dc1(0xa7)](_0x245dc1(0x8f)+a40_0xb47af2[_0x245dc1(0x77)](_0x38bf58[_0x245dc1(0x8d)][_0x245dc1(0x88)]+_0x245dc1(0x78))+_0x245dc1(0xa6)+a40_0xb47af2[_0x245dc1(0x77)](_0x38bf58['counts'][_0x245dc1(0xa1)]+_0x245dc1(0x74)));if(_0x38bf58['counts'][_0x245dc1(0xbb)]>0x0){const _0x48067d=_0x38bf58['counts'][_0x245dc1(0x8c)]>_0x38bf58[_0x245dc1(0x8d)][_0x245dc1(0xbb)]?'\x20('+_0x38bf58[_0x245dc1(0x8d)][_0x245dc1(0x8c)]+_0x245dc1(0xa4):'';console['error'](_0x245dc1(0xb9)+a40_0xb47af2['cyan'](_0x38bf58[_0x245dc1(0x8d)][_0x245dc1(0xbb)]+_0x245dc1(0x92))+a40_0xb47af2[_0x245dc1(0x94)](_0x48067d));}console['error']('\x20\x20'+a40_0xb47af2[_0x245dc1(0x93)]('+\x20'+_0x2238cd[_0x245dc1(0x9b)]+_0x245dc1(0x80))),console[_0x245dc1(0xa7)]('\x20\x20'+a40_0xb47af2[_0x245dc1(0x95)]('~\x20'+_0x20d834[_0x245dc1(0x9b)]+_0x245dc1(0xc1))),console[_0x245dc1(0xa7)]('\x20\x20'+a40_0xb47af2['dim']('=\x20'+_0x4daf44[_0x245dc1(0x9b)]+_0x245dc1(0xa5))),console['error'](_0x245dc1(0x76)+a40_0xb47af2['cyan'](_0x38bf58[_0x245dc1(0xa2)])+'\x0a');if(_0x20d834[_0x245dc1(0x9b)]>0x0)for(const _0x1c8618 of _0x20d834){console['error'](_0x245dc1(0x91)+_0x1c8618[_0x245dc1(0xc3)]+'\x27:'),console[_0x245dc1(0xa7)]('─'['repeat'](0x3c)),console[_0x245dc1(0xa7)](_0x1c8618[_0x245dc1(0x81)]),console[_0x245dc1(0xa7)]('─'[_0x245dc1(0xb0)](0x3c));}if(_0xca70eb[_0x245dc1(0xb1)])return console['error'](a40_0xb47af2[_0x245dc1(0x95)](_0x245dc1(0xbd))),0x0;if(_0x2238cd[_0x245dc1(0x9b)]===0x0&&_0x20d834[_0x245dc1(0x9b)]===0x0)return console['error'](a40_0xb47af2[_0x245dc1(0x93)](_0x245dc1(0x96))),saveSessionContext({'parent_segment':_0x38bf58[_0x245dc1(0x90)]},_0xca70eb[_0x245dc1(0xad)]),console[_0x245dc1(0xa7)](a40_0xb47af2['green'](_0x245dc1(0x8e)+a40_0xb47af2[_0x245dc1(0x94)]('parent_segment')+_0x245dc1(0x86)+a40_0xb47af2['cyan'](_0x38bf58[_0x245dc1(0x90)]))),0x0;if(!_0xca70eb[_0x245dc1(0x7b)]){if(!isInteractive())return console[_0x245dc1(0xa7)](a40_0xb47af2['red'](_0x245dc1(0x7f)),_0x245dc1(0x7c)),console[_0x245dc1(0xa7)](a40_0xb47af2[_0x245dc1(0x94)](_0x245dc1(0xb5))),0x1;const _0x150b3d=await confirmKey(_0x245dc1(0x87)+(_0x2238cd[_0x245dc1(0x9b)]+_0x20d834[_0x245dc1(0x9b)])+_0x245dc1(0xb6));if(!_0x150b3d)return console[_0x245dc1(0xa7)](a40_0xb47af2['yellow'](_0x245dc1(0x9f)),_0x245dc1(0xaa)),0x1;}for(const _0xc166e6 of _0x38bf58['files']){if(_0xc166e6[_0x245dc1(0x70)]||_0xc166e6[_0x245dc1(0xac)]){const _0x22b22f=a40_0x1ad97f['dirname'](_0xc166e6[_0x245dc1(0x83)]);!existsSync(_0x22b22f)&&mkdirSync(_0x22b22f,{'recursive':!![]}),writeFileSync(_0xc166e6[_0x245dc1(0x83)],_0xc166e6[_0x245dc1(0x71)],'utf-8');}}return console['error'](a40_0xb47af2[_0x245dc1(0x93)](_0x245dc1(0xc2)+(_0x2238cd[_0x245dc1(0x9b)]+_0x20d834[_0x245dc1(0x9b)])+_0x245dc1(0xbc)+_0x38bf58['targetDir'])),saveSessionContext({'parent_segment':_0x38bf58[_0x245dc1(0x90)]},_0xca70eb[_0x245dc1(0xad)]),console['error'](a40_0xb47af2[_0x245dc1(0x93)](_0x245dc1(0x8e)+a40_0xb47af2[_0x245dc1(0x94)](_0x245dc1(0x7d))+'\x20=\x20'+a40_0xb47af2[_0x245dc1(0x77)](_0x38bf58[_0x245dc1(0x90)]))),0x0;}}
1
+ const a40_0x42779b=a40_0x4b98;(function(_0x5caa72,_0x4c6e79){const _0x1bdefe=a40_0x4b98,_0x4e8a0c=_0x5caa72();while(!![]){try{const _0x2beb06=-parseInt(_0x1bdefe(0x1e1))/0x1+parseInt(_0x1bdefe(0x207))/0x2+-parseInt(_0x1bdefe(0x219))/0x3+-parseInt(_0x1bdefe(0x1e8))/0x4*(parseInt(_0x1bdefe(0x222))/0x5)+parseInt(_0x1bdefe(0x1fd))/0x6+-parseInt(_0x1bdefe(0x20b))/0x7*(-parseInt(_0x1bdefe(0x204))/0x8)+parseInt(_0x1bdefe(0x209))/0x9;if(_0x2beb06===_0x4c6e79)break;else _0x4e8a0c['push'](_0x4e8a0c['shift']());}catch(_0x185d88){_0x4e8a0c['push'](_0x4e8a0c['shift']());}}}(a40_0x5b09,0x914ad));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x2f071c from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x5b09(){const _0x3a83a=['\x20segments','name','pullSegments','isNew','red','no_parent','diff','\x20=\x20','Aborted.','yellow','\x20unchanged\x20files','utf-8','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','content','\x20journeys','\x20\x20🗺️\x20\x20','journeyVersions','yes','Error:\x20','5843340tAbLZN','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20files?','relativePath','dim','\x20with\x20','segment','989256RlJvLg','session','parent_segment','31438ekQyii','execute','11421846NPVEBO','✔\x20Pulled\x20','21KCqfrS','error','repeat','\x20versions)','Site:\x20','helpText','message','counts','\x0aError:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','description','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','hasChanges','\x20changed\x20files','2594994XijuuB','parentName','targetDir','dryRun','verbose','activations','segments','\x0aChanges\x20to\x20\x27','length','3695wzapPw','site','setPhase','green','resourceName','-\x20no\x20files\x20written','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)','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20new\x20files','cyan','journeys','parentSegment','\x20\x20🎯\x20','Target\x20resource:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','files','data','632306rNuiXx','absolutePath','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','✔\x20Context\x20set:\x20','cwd','filter','\x20files\x20to\x20','2908lqedPu','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation'];a40_0x5b09=function(){return _0x3a83a;};return a40_0x5b09();}import a40_0x18cfd0 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x4b98(_0x3f4d8c,_0x565c9f){_0x3f4d8c=_0x3f4d8c-0x1d8;const _0x5b0908=a40_0x5b09();let _0x4b988f=_0x5b0908[_0x3f4d8c];return _0x4b988f;}export class SegmentPullCommand extends BaseCommand{[a40_0x42779b(0x1eb)]='segment:pull';[a40_0x42779b(0x215)]=a40_0x42779b(0x1f6);async[a40_0x42779b(0x208)](_0x376330){const _0x3d1dc8=a40_0x42779b,{options:_0xed70be,args:_0xffa492,tdx:_0x45fa9e}=_0x376330,_0x369d1b=_0xed70be,_0xf7fbf2=await resolveTarget({'arg':_0xffa492[0x0],'contextParent':_0xed70be[_0x3d1dc8(0x1db)],'cwd':process[_0x3d1dc8(0x1e5)]()});if(!isSuccessfulResolution(_0xf7fbf2))return _0xf7fbf2['errorCode']===_0x3d1dc8(0x1ef)?(console['error'](a40_0x2f071c[_0x3d1dc8(0x1f3)](_0x3d1dc8(0x216))),console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x228)),console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x1fe)),console['error'](_0x3d1dc8(0x22a))):(console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x1ee)](_0x3d1dc8(0x1fc)+_0xf7fbf2[_0x3d1dc8(0x211)]+'\x0a')),_0xf7fbf2[_0x3d1dc8(0x210)]&&console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x1d9)](_0xf7fbf2[_0x3d1dc8(0x210)]))),0x1;const _0x4508ee=_0xf7fbf2[_0x3d1dc8(0x21a)],_0x7d5a5e=_0xf7fbf2[_0x3d1dc8(0x21b)],_0x167510=_0xf7fbf2['type']==='file'?_0xf7fbf2[_0x3d1dc8(0x226)]:undefined;_0x369d1b[_0x3d1dc8(0x21d)]&&(console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x20f)+_0x369d1b[_0x3d1dc8(0x223)]),console['error']('Parent\x20segment:\x20'+_0x4508ee),_0x167510&&console['error'](_0x3d1dc8(0x1dd)+_0x167510));const _0x1cf5e9=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4508ee+'\x27...',_0x35dc94=>_0x45fa9e[_0x3d1dc8(0x203)][_0x3d1dc8(0x1ec)](_0x4508ee,{'targetDir':_0x7d5a5e,'targetResourceName':_0x167510,'verbose':_0x369d1b[_0x3d1dc8(0x21d)],'progress':{'update':_0x487e66=>{const _0x4c9ac3=_0x3d1dc8;_0x35dc94[_0x4c9ac3(0x224)](_0x487e66),_0x369d1b[_0x4c9ac3(0x21d)]&&console[_0x4c9ac3(0x20c)]('\x20\x20'+_0x487e66);}}}),{'verbose':_0x369d1b[_0x3d1dc8(0x21d)]}),_0x4f2e69=_0x1cf5e9[_0x3d1dc8(0x1e0)];if(_0x4f2e69[_0x3d1dc8(0x212)][_0x3d1dc8(0x21f)]===0x0&&_0x4f2e69[_0x3d1dc8(0x212)][_0x3d1dc8(0x1da)]===0x0)return console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x1f3)](_0x3d1dc8(0x1e3)+_0x4f2e69[_0x3d1dc8(0x21a)]+'\x27')),0x0;const _0x290ca8=_0x4f2e69[_0x3d1dc8(0x1df)][_0x3d1dc8(0x1e6)](_0x339aac=>_0x339aac[_0x3d1dc8(0x1ed)]),_0x3441f3=_0x4f2e69['files'][_0x3d1dc8(0x1e6)](_0x4f0245=>!_0x4f0245[_0x3d1dc8(0x1ed)]&&_0x4f0245[_0x3d1dc8(0x217)]),_0x2c107d=_0x4f2e69[_0x3d1dc8(0x1df)][_0x3d1dc8(0x1e6)](_0x4fc41a=>!_0x4fc41a['isNew']&&!_0x4fc41a['hasChanges']);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0x4f2e69[_0x3d1dc8(0x21a)]+'\x27:'),console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x1dc)+a40_0x2f071c[_0x3d1dc8(0x1d9)](_0x4f2e69[_0x3d1dc8(0x212)]['segments']+_0x3d1dc8(0x1ea))+_0x3d1dc8(0x202)+a40_0x2f071c[_0x3d1dc8(0x1d9)](_0x4f2e69['counts'][_0x3d1dc8(0x21e)]+'\x20activations'));if(_0x4f2e69[_0x3d1dc8(0x212)][_0x3d1dc8(0x1da)]>0x0){const _0x14eb11=_0x4f2e69['counts'][_0x3d1dc8(0x1fa)]>_0x4f2e69[_0x3d1dc8(0x212)]['journeys']?'\x20('+_0x4f2e69['counts'][_0x3d1dc8(0x1fa)]+_0x3d1dc8(0x20e):'';console[_0x3d1dc8(0x20c)](_0x3d1dc8(0x1f9)+a40_0x2f071c[_0x3d1dc8(0x1d9)](_0x4f2e69[_0x3d1dc8(0x212)][_0x3d1dc8(0x1da)]+_0x3d1dc8(0x1f8))+a40_0x2f071c[_0x3d1dc8(0x201)](_0x14eb11));}console[_0x3d1dc8(0x20c)]('\x20\x20'+a40_0x2f071c['green']('+\x20'+_0x290ca8['length']+_0x3d1dc8(0x1d8))),console[_0x3d1dc8(0x20c)]('\x20\x20'+a40_0x2f071c[_0x3d1dc8(0x1f3)]('~\x20'+_0x3441f3[_0x3d1dc8(0x221)]+_0x3d1dc8(0x218))),console[_0x3d1dc8(0x20c)]('\x20\x20'+a40_0x2f071c[_0x3d1dc8(0x201)]('=\x20'+_0x2c107d['length']+_0x3d1dc8(0x1f4))),console[_0x3d1dc8(0x20c)]('\x20\x20Target:\x20'+a40_0x2f071c['cyan'](_0x4f2e69[_0x3d1dc8(0x21b)])+'\x0a');if(_0x3441f3['length']>0x0)for(const _0x33206b of _0x3441f3){console['error'](_0x3d1dc8(0x220)+_0x33206b[_0x3d1dc8(0x200)]+'\x27:'),console[_0x3d1dc8(0x20c)]('─'['repeat'](0x3c)),console[_0x3d1dc8(0x20c)](_0x33206b[_0x3d1dc8(0x1f0)]),console['error']('─'[_0x3d1dc8(0x20d)](0x3c));}if(_0x369d1b[_0x3d1dc8(0x21c)])return console[_0x3d1dc8(0x20c)](a40_0x2f071c['yellow'](_0x3d1dc8(0x229))),0x0;if(_0x290ca8[_0x3d1dc8(0x221)]===0x0&&_0x3441f3[_0x3d1dc8(0x221)]===0x0)return console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x225)](_0x3d1dc8(0x1de))),saveSessionContext({'parent_segment':_0x4f2e69[_0x3d1dc8(0x21a)]},_0x369d1b[_0x3d1dc8(0x205)]),console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x225)](_0x3d1dc8(0x1e4)+a40_0x2f071c[_0x3d1dc8(0x201)](_0x3d1dc8(0x206))+_0x3d1dc8(0x1f1)+a40_0x2f071c['cyan'](_0x4f2e69['parentName']))),0x0;if(!_0x369d1b[_0x3d1dc8(0x1fb)]){if(!isInteractive())return console['error'](a40_0x2f071c[_0x3d1dc8(0x1ee)](_0x3d1dc8(0x213)),_0x3d1dc8(0x214)),console['error'](a40_0x2f071c['dim'](_0x3d1dc8(0x1e9))),0x1;const _0x32372a=await confirmKey('Write\x20'+(_0x290ca8[_0x3d1dc8(0x221)]+_0x3441f3[_0x3d1dc8(0x221)])+_0x3d1dc8(0x1ff));if(!_0x32372a)return console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x1f3)](_0x3d1dc8(0x1f2)),_0x3d1dc8(0x227)),0x1;}for(const _0x1aa6f4 of _0x4f2e69['files']){if(_0x1aa6f4[_0x3d1dc8(0x1ed)]||_0x1aa6f4[_0x3d1dc8(0x217)]){const _0x512bbe=a40_0x18cfd0['dirname'](_0x1aa6f4[_0x3d1dc8(0x1e2)]);!existsSync(_0x512bbe)&&mkdirSync(_0x512bbe,{'recursive':!![]}),writeFileSync(_0x1aa6f4[_0x3d1dc8(0x1e2)],_0x1aa6f4[_0x3d1dc8(0x1f7)],_0x3d1dc8(0x1f5));}}return console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x225)](_0x3d1dc8(0x20a)+(_0x290ca8[_0x3d1dc8(0x221)]+_0x3441f3[_0x3d1dc8(0x221)])+_0x3d1dc8(0x1e7)+_0x4f2e69['targetDir'])),saveSessionContext({'parent_segment':_0x4f2e69[_0x3d1dc8(0x21a)]},_0x369d1b[_0x3d1dc8(0x205)]),console[_0x3d1dc8(0x20c)](a40_0x2f071c[_0x3d1dc8(0x225)](_0x3d1dc8(0x1e4)+a40_0x2f071c[_0x3d1dc8(0x201)]('parent_segment')+'\x20=\x20'+a40_0x2f071c[_0x3d1dc8(0x1d9)](_0x4f2e69['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x49f7f6=a41_0x11ea;(function(_0xe29e23,_0x12980f){const _0x17ebc7=a41_0x11ea,_0x40a277=_0xe29e23();while(!![]){try{const _0x1fa324=parseInt(_0x17ebc7(0x19d))/0x1+-parseInt(_0x17ebc7(0x1cb))/0x2+-parseInt(_0x17ebc7(0x1df))/0x3+parseInt(_0x17ebc7(0x1e0))/0x4+parseInt(_0x17ebc7(0x182))/0x5*(parseInt(_0x17ebc7(0x1ca))/0x6)+-parseInt(_0x17ebc7(0x1bf))/0x7*(parseInt(_0x17ebc7(0x1f4))/0x8)+-parseInt(_0x17ebc7(0x1d3))/0x9*(-parseInt(_0x17ebc7(0x1f2))/0xa);if(_0x1fa324===_0x12980f)break;else _0x40a277['push'](_0x40a277['shift']());}catch(_0x2aa6f3){_0x40a277['push'](_0x40a277['shift']());}}}(a41_0x3254,0x8358b));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x2088dd from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x49f7f6(0x1e7)]=a41_0x49f7f6(0x20e);[a41_0x49f7f6(0x1ad)]=a41_0x49f7f6(0x193);async['execute'](_0x115b79){const _0x97ffc3=a41_0x49f7f6,{options:_0xc4f82b,args:_0x2c564a,tdx:_0x20e9be}=_0x115b79,_0x45ef98=_0xc4f82b,_0x411084=await resolveTarget({'arg':_0x2c564a[0x0],'contextParent':_0xc4f82b[_0x97ffc3(0x1f3)],'cwd':process[_0x97ffc3(0x1b7)]()});if(!isSuccessfulResolution(_0x411084))return _0x411084[_0x97ffc3(0x204)]===_0x97ffc3(0x206)?(console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x188)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x97ffc3(0x1ab)]('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[_0x97ffc3(0x1ab)](_0x97ffc3(0x1db))):(console['error'](a41_0x2088dd[_0x97ffc3(0x1c2)](_0x97ffc3(0x19a)+_0x411084[_0x97ffc3(0x18b)]+'\x0a')),_0x411084[_0x97ffc3(0x1a6)]&&console[_0x97ffc3(0x1ab)](a41_0x2088dd['cyan'](_0x411084[_0x97ffc3(0x1a6)]))),0x1;if(_0x411084[_0x97ffc3(0x177)]==='parent_name')return console['error'](a41_0x2088dd[_0x97ffc3(0x1c2)](_0x97ffc3(0x201)+_0x411084['targetDir']+'\x0a')),console['error'](a41_0x2088dd[_0x97ffc3(0x1cc)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x2c4ac3=_0x411084[_0x97ffc3(0x18c)],_0x3420e8=_0x411084[_0x97ffc3(0x1a9)],_0x5b97ae=_0x411084[_0x97ffc3(0x177)]===_0x97ffc3(0x1a0)?_0x411084[_0x97ffc3(0x1da)]:undefined,_0x4497e2=getScopedDetails(_0x411084),_0x84b6e3=_0x4497e2?.[_0x97ffc3(0x186)]??![],_0x1b5a09=_0x4497e2?.[_0x97ffc3(0x1b0)]??'';if(!existsSync(_0x3420e8))return console['error'](a41_0x2088dd['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x3420e8+'\x0a')),console['error'](a41_0x2088dd[_0x97ffc3(0x1cc)](_0x97ffc3(0x1e8))),0x1;_0x45ef98[_0x97ffc3(0x19e)]&&(console[_0x97ffc3(0x1ab)]('Site:\x20'+_0x45ef98[_0x97ffc3(0x187)]),console[_0x97ffc3(0x1ab)]('Parent\x20segment:\x20'+_0x2c4ac3),console[_0x97ffc3(0x1ab)](_0x97ffc3(0x209)+_0x3420e8),_0x84b6e3&&console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1dd)+_0x1b5a09));const _0x1ffbb0=await withSpinner(_0x97ffc3(0x17b)+_0x2c4ac3+'\x27...',()=>_0x20e9be[_0x97ffc3(0x17a)]['resolveParentId'](_0x2c4ac3),{'verbose':_0x45ef98[_0x97ffc3(0x19e)]}),_0x3ba3a5=_0x1ffbb0[_0x97ffc3(0x20b)],{parentSegmentResult:_0x45bdf1,segmentsResult:_0x2230b8,foldersResult:_0x493746,journeysWithDetailsResult:_0x8f9b39,userMaps:_0x1bae96}=await withSpinner(_0x97ffc3(0x189),async()=>{const _0x33b315=_0x97ffc3,[_0x17c503,_0x499d75,_0x474eca,_0x95c24f,_0x5ea029]=await Promise[_0x33b315(0x1a8)]([_0x20e9be[_0x33b315(0x17a)]['getParent'](_0x3ba3a5),_0x20e9be[_0x33b315(0x17a)][_0x33b315(0x196)](_0x3ba3a5),_0x20e9be[_0x33b315(0x17a)][_0x33b315(0x1d0)](_0x3ba3a5),_0x20e9be[_0x33b315(0x1e6)][_0x33b315(0x1d8)](_0x3ba3a5,{'includeAllVersions':!![]}),_0x20e9be[_0x33b315(0x1e2)][_0x33b315(0x1e1)]()]);return{'parentSegmentResult':_0x17c503,'segmentsResult':_0x499d75,'foldersResult':_0x474eca,'journeysWithDetailsResult':_0x95c24f,'userMaps':_0x5ea029};},{'verbose':_0x45ef98['verbose']})['then'](_0x692ca8=>_0x692ca8[_0x97ffc3(0x20b)]),_0x5d57b7=_0x45bdf1,_0xae9002=extractRootFolderId(_0x5d57b7),_0x39c3e6=_0x2230b8,_0x34a0b4=_0x493746,{journeys:_0x288e98,activationStepsById:_0x118dc9}=_0x8f9b39,_0x12d209=new Map(_0x288e98[_0x97ffc3(0x1f6)](_0x1c3250=>[_0x1c3250['id'],_0x1c3250])),_0x4e15a8=_0x288e98['map'](_0x40c01f=>({'id':_0x40c01f['id'],'name':_0x40c01f['attributes']['name'],'journeyBundleName':_0x40c01f[_0x97ffc3(0x1e3)]['journeyBundleName']||'','journeyBundleId':_0x40c01f[_0x97ffc3(0x1e3)][_0x97ffc3(0x1dc)]||'','versionNumber':_0x40c01f[_0x97ffc3(0x1e3)]['versionNumber'],'description':_0x40c01f[_0x97ffc3(0x1e3)][_0x97ffc3(0x1ad)],'state':_0x40c01f[_0x97ffc3(0x1e3)]['state'],'paused':_0x40c01f['attributes'][_0x97ffc3(0x1fc)],'audienceId':_0x40c01f['attributes'][_0x97ffc3(0x199)],'folderId':_0x40c01f[_0x97ffc3(0x1f1)]?.['parentFolder']?.[_0x97ffc3(0x20b)]?.['id'],'createdAt':_0x40c01f[_0x97ffc3(0x1e3)][_0x97ffc3(0x1fd)],'updatedAt':_0x40c01f[_0x97ffc3(0x1e3)]['updatedAt']})),{emailToId:_0x468f5c,idToEmail:_0x1da551}=_0x1bae96,_0x53b1fb=await withSpinner(_0x97ffc3(0x1e9),async()=>{const _0x48cbd6=await _0x20e9be['connection']['list']();return buildConnectionMaps(_0x48cbd6);},{'verbose':_0x45ef98[_0x97ffc3(0x19e)]})[_0x97ffc3(0x1b3)](_0x2ad840=>_0x2ad840[_0x97ffc3(0x20b)]),_0x313f92=_0x53b1fb[_0x97ffc3(0x1a5)],_0x328436=_0x53b1fb[_0x97ffc3(0x185)],_0x2e3703=_0x53b1fb[_0x97ffc3(0x17c)],_0x32592d={'emailToIdMap':_0x468f5c,'connectionNameToIdMap':_0x313f92,'connectionNameToTypeMap':_0x2e3703,'getSchema':_0x53ea7b=>_0x20e9be[_0x97ffc3(0x197)]['getOutputSchemaWithCache'](_0x53ea7b)};let {pathToId:_0xacb42,idToPath:_0x2eae26}=buildFolderMaps(_0x34a0b4);const _0x58af20=buildSegmentLookupMap(_0x39c3e6,_0x2eae26),_0x807d4e=buildSegmentNameToIdMap(_0x39c3e6),_0xe74082=buildJourneyBundleLookupMap(_0x4e15a8,_0x2eae26);let _0x5fca25;if(_0x5b97ae){if(!_0x5b97ae[_0x97ffc3(0x18d)](_0x97ffc3(0x198))&&!_0x5b97ae[_0x97ffc3(0x18d)](_0x97ffc3(0x1ce)))return console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x1c2)](_0x97ffc3(0x191)+_0x5b97ae+'\x0a')),0x1;_0x5fca25=[_0x5b97ae];}else _0x5fca25=findYamlFiles(_0x3420e8);if(_0x5fca25[_0x97ffc3(0x1af)]===0x0)return console['error'](a41_0x2088dd[_0x97ffc3(0x1c2)](_0x97ffc3(0x1b6)+_0x3420e8+'\x0a')),console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x1cc)](_0x97ffc3(0x208))),0x1;let _0x1f98e4,_0x32a8cd;try{const _0x2d8bc0=parseAndClassifyYamlFiles(_0x5fca25,_0x3420e8,{'skipSegments':_0x45ef98[_0x97ffc3(0x1cd)]});_0x1f98e4=_0x2d8bc0['segments'],_0x32a8cd=_0x2d8bc0[_0x97ffc3(0x1a4)];const _0x15faea=validateParsedFiles(_0x2d8bc0,_0x3420e8);if(_0x15faea[_0x97ffc3(0x1af)]>0x0)return console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x1c2)](_0x97ffc3(0x1fb))),console[_0x97ffc3(0x1ab)](formatValidationErrors(_0x15faea)),console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x188)](_0x97ffc3(0x1c9))),0x1;}catch(_0x17cbae){return console[_0x97ffc3(0x1ab)](a41_0x2088dd['red'](_0x97ffc3(0x1c3)+(_0x17cbae instanceof Error?_0x17cbae[_0x97ffc3(0x18b)]:_0x17cbae))),0x1;}if(_0x1f98e4[_0x97ffc3(0x1af)]===0x0&&_0x32a8cd[_0x97ffc3(0x1af)]===0x0){const _0x3d9d48=_0x45ef98['journeysOnly']?_0x97ffc3(0x1e6):_0x97ffc3(0x1d5);return console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x188)]('No\x20'+_0x3d9d48+_0x97ffc3(0x1f9))),0x0;}const _0x509d79=new Map();_0x39c3e6[_0x97ffc3(0x1af)]>0x0&&!_0x45ef98[_0x97ffc3(0x1cd)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x39c3e6,async _0x172932=>{const _0x5e4390=a41_0x11ea,_0x2d10d1=await _0x20e9be[_0x5e4390(0x17a)][_0x5e4390(0x1be)](_0x3ba3a5,_0x172932['id']);_0x509d79['set'](_0x172932['id'],_0x2d10d1);});},{'verbose':_0x45ef98[_0x97ffc3(0x19e)]});const {segmentFiles:_0x5cf722,foldersToCreate:_0x26408a}=await prepareSegmentFiles(_0x1f98e4,{'segmentByFolderAndName':_0x58af20,'activationsBySegmentId':_0x509d79,'folderPathToId':_0xacb42,'idToEmailMap':_0x1da551,'connectionIdToNameMap':_0x328436},_0x32592d,_0x84b6e3,_0x1b5a09),_0x2dd0c8=_0x5b97ae?[]:findSegmentsToDelete(_0x39c3e6,_0x1f98e4[_0x97ffc3(0x1f6)](({yamlConfig:_0x351e8a,folderPath:_0x51bf54})=>({'yamlConfig':_0x351e8a,'folderPath':resolveTDFolderPath(_0x51bf54,_0x84b6e3,_0x1b5a09)})),_0x2eae26,_0x1b5a09,_0x84b6e3),{journeyFiles:_0xcaf597,foldersToCreate:_0x57b0fc}=await withProgressSpinner(_0x97ffc3(0x192),async _0x34dded=>prepareJourneyFiles(_0x32a8cd,{'fetchJourney':async _0x4e6d35=>_0x20e9be['journey']['getJourney'](_0x4e6d35[_0x97ffc3(0x1b4)]),'journeyBundlesByFolderAndName':_0xe74082,'folderPathToId':_0xacb42,'idToEmailMap':_0x1da551,'connectionIdToNameMap':_0x328436,'existingSegments':_0x39c3e6,'parentId':_0x3ba3a5,'deps':_0x20e9be,'progress':{'update':_0x2faca8=>{const _0x44f985=_0x97ffc3;_0x34dded[_0x44f985(0x1ea)](_0x2faca8),_0x45ef98[_0x44f985(0x19e)]&&console[_0x44f985(0x1ab)]('\x20\x20'+_0x2faca8);}},'journeyById':_0x12d209,'activationStepsById':_0x118dc9},_0x84b6e3,_0x1b5a09),{'verbose':_0x45ef98['verbose']})['then'](_0xfa8911=>_0xfa8911['data']);for(const _0xd7cec7 of _0x57b0fc){_0x26408a[_0x97ffc3(0x202)](_0xd7cec7);}const _0x4df503=_0x5b97ae?[]:findJourneysToDelete(_0x4e15a8,_0x32a8cd[_0x97ffc3(0x1f6)](({yamlConfig:_0x49166a,folderPath:_0xd97cf5})=>({'yamlConfig':_0x49166a,'folderPath':resolveTDFolderPath(_0xd97cf5,_0x84b6e3,_0x1b5a09)})),_0x2eae26,_0x1b5a09,_0x84b6e3),_0xfc7e86=calculatePushStats(_0x5cf722,_0xcaf597,_0x26408a,_0x2dd0c8,_0x4df503,!!_0x45ef98[_0x97ffc3(0x178)],!!_0x45ef98[_0x97ffc3(0x1cd)]),_0x375526=_0xfc7e86[_0x97ffc3(0x1f7)][_0x97ffc3(0x19f)],_0xc88e71=_0xfc7e86['segments']['changed'],_0x5118ab=_0xfc7e86[_0x97ffc3(0x1f7)]['unchanged'],_0x58d21e=_0xfc7e86['segments']['toDelete'],_0x2673c8=_0xfc7e86[_0x97ffc3(0x1ff)][_0x97ffc3(0x1d1)],_0x535d6d=_0xfc7e86[_0x97ffc3(0x1a4)][_0x97ffc3(0x19f)],_0x40efef=_0xfc7e86[_0x97ffc3(0x1a4)][_0x97ffc3(0x1ac)],_0x37e493=_0xfc7e86['journeys'][_0x97ffc3(0x1a2)],_0x295d28=_0xfc7e86['journeys']['toDelete'],_0x205284=_0xfc7e86[_0x97ffc3(0x1ee)][_0x97ffc3(0x1a8)],_0x30a977=_0xfc7e86[_0x97ffc3(0x1ee)][_0x97ffc3(0x1d1)],_0x1b1582=_0xfc7e86[_0x97ffc3(0x1ee)][_0x97ffc3(0x1b5)],_0x5852d1=_0xfc7e86[_0x97ffc3(0x1ee)]['toDelete'];console[_0x97ffc3(0x1ab)](_0x97ffc3(0x179)+_0x2c4ac3+'\x27:');_0x2673c8['length']>0x0&&console['error']('\x20\x20'+a41_0x2088dd[_0x97ffc3(0x200)]('📁\x20'+_0x2673c8[_0x97ffc3(0x1af)]+'\x20folders\x20to\x20create'));if(!_0x45ef98[_0x97ffc3(0x1cd)]){console[_0x97ffc3(0x1ab)]('\x20\x20📊\x20Segments:'),console[_0x97ffc3(0x1ab)]('\x20\x20\x20\x20'+a41_0x2088dd['green']('+\x20'+_0x375526['length']+_0x97ffc3(0x1ed))),console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1eb)+a41_0x2088dd[_0x97ffc3(0x188)]('~\x20'+_0xc88e71[_0x97ffc3(0x1af)]+_0x97ffc3(0x1a7)));if(_0x58d21e['length']>0x0)console['error'](_0x97ffc3(0x1eb)+a41_0x2088dd[_0x97ffc3(0x1c2)]('-\x20'+_0x58d21e[_0x97ffc3(0x1af)]+'\x20to\x20delete'));else _0x2dd0c8[_0x97ffc3(0x1af)]>0x0&&!_0x45ef98[_0x97ffc3(0x178)]&&console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1eb)+a41_0x2088dd[_0x97ffc3(0x1bc)](_0x2dd0c8['length']+_0x97ffc3(0x183)));console[_0x97ffc3(0x1ab)]('\x20\x20\x20\x20'+a41_0x2088dd['dim']('=\x20'+_0x5118ab[_0x97ffc3(0x1af)]+_0x97ffc3(0x1f8)));}if(_0xcaf597[_0x97ffc3(0x1af)]>0x0||_0x4df503[_0x97ffc3(0x1af)]>0x0){console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1fa)),console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1eb)+a41_0x2088dd[_0x97ffc3(0x19c)]('+\x20'+_0x535d6d['length']+_0x97ffc3(0x1ed))),console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1eb)+a41_0x2088dd[_0x97ffc3(0x188)]('~\x20'+_0x40efef[_0x97ffc3(0x1af)]+'\x20changed'));if(_0x295d28[_0x97ffc3(0x1af)]>0x0)console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1eb)+a41_0x2088dd[_0x97ffc3(0x1c2)]('-\x20'+_0x295d28[_0x97ffc3(0x1af)]+_0x97ffc3(0x1b1)));else _0x4df503['length']>0x0&&!_0x45ef98['delete']&&console['error']('\x20\x20\x20\x20'+a41_0x2088dd[_0x97ffc3(0x1bc)](_0x4df503[_0x97ffc3(0x1af)]+_0x97ffc3(0x183)));console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1eb)+a41_0x2088dd[_0x97ffc3(0x1bc)]('=\x20'+_0x37e493[_0x97ffc3(0x1af)]+'\x20unchanged'));}_0x205284[_0x97ffc3(0x1af)]>0x0&&!_0x45ef98[_0x97ffc3(0x1cd)]&&(console[_0x97ffc3(0x1ab)](''),console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1b8)),_0x30a977[_0x97ffc3(0x1af)]>0x0&&console['error']('\x20\x20\x20\x20'+a41_0x2088dd[_0x97ffc3(0x19c)]('+\x20'+_0x30a977[_0x97ffc3(0x1af)]+'\x20to\x20create')),_0x1b1582[_0x97ffc3(0x1af)]>0x0&&console[_0x97ffc3(0x1ab)]('\x20\x20\x20\x20'+a41_0x2088dd[_0x97ffc3(0x188)]('~\x20'+_0x1b1582[_0x97ffc3(0x1af)]+_0x97ffc3(0x1d9))),_0x5852d1[_0x97ffc3(0x1af)]>0x0&&console[_0x97ffc3(0x1ab)](_0x97ffc3(0x1eb)+a41_0x2088dd[_0x97ffc3(0x1c2)]('-\x20'+_0x5852d1['length']+'\x20to\x20delete')));console['error'](_0x97ffc3(0x17e)+a41_0x2088dd['cyan'](_0x3420e8)+'\x0a');if(_0x2673c8[_0x97ffc3(0x1af)]>0x0){console['error'](_0x97ffc3(0x1de));for(const _0x338e63 of _0x2673c8){console[_0x97ffc3(0x1ab)]('\x20\x20'+a41_0x2088dd[_0x97ffc3(0x200)]('+')+'\x20'+_0x338e63);}console[_0x97ffc3(0x1ab)]('');}if(_0x375526['length']>0x0&&!_0x45ef98['journeysOnly'])for(const _0x580d1e of _0x375526){const _0x488f1b=_0x580d1e[_0x97ffc3(0x20c)]?_0x580d1e[_0x97ffc3(0x20c)]+'/'+_0x580d1e[_0x97ffc3(0x195)]['name']:_0x580d1e['yamlConfig'][_0x97ffc3(0x1e7)],_0x9b4e7f=_0x580d1e[_0x97ffc3(0x195)]['activations']?.[_0x97ffc3(0x1af)]||0x0,_0x518db1=_0x9b4e7f>0x0?a41_0x2088dd[_0x97ffc3(0x1bc)]('\x20['+_0x9b4e7f+_0x97ffc3(0x180)):'';console['error']('\x0a'+a41_0x2088dd['green'](_0x97ffc3(0x1bb))+'\x20'+_0x488f1b+_0x518db1),console[_0x97ffc3(0x1ab)]('─'['repeat'](0x3c)),_0x580d1e[_0x97ffc3(0x1c5)]&&console[_0x97ffc3(0x1ab)](_0x580d1e[_0x97ffc3(0x1c5)]),console[_0x97ffc3(0x1ab)]('─'[_0x97ffc3(0x1b2)](0x3c));}if(_0x58d21e[_0x97ffc3(0x1af)]>0x0&&!_0x45ef98[_0x97ffc3(0x1cd)])for(const _0x16fa28 of _0x58d21e){const _0x16aafd=_0x16fa28[_0x97ffc3(0x1d6)]?_0x2eae26['get'](_0x16fa28[_0x97ffc3(0x1d6)][_0x97ffc3(0x19b)]())||'':'',_0x2428ef=_0x16aafd?_0x16aafd+'/'+_0x16fa28[_0x97ffc3(0x1e7)]:_0x16fa28[_0x97ffc3(0x1e7)],_0x2bd948=_0x509d79[_0x97ffc3(0x1c0)](_0x16fa28['id'])||[],_0x459f02=_0x2bd948[_0x97ffc3(0x1af)]>0x0?a41_0x2088dd[_0x97ffc3(0x1bc)]('\x20['+_0x2bd948[_0x97ffc3(0x1af)]+_0x97ffc3(0x180)):'';console['error']('\x0a'+a41_0x2088dd[_0x97ffc3(0x1c2)](_0x97ffc3(0x1ec))+'\x20'+_0x2428ef+_0x459f02),console[_0x97ffc3(0x1ab)]('─'[_0x97ffc3(0x1b2)](0x3c));const _0x514b93=segmentWithActivationsToYaml(_0x16fa28,_0x2bd948,undefined,_0x1da551,_0x328436),_0x1cd51e=segmentToYamlString(_0x514b93),_0x4b05d8=generateDiff(_0x1cd51e,'');console[_0x97ffc3(0x1ab)](formatDiffWithColors(_0x4b05d8)),console[_0x97ffc3(0x1ab)]('─'['repeat'](0x3c));}const _0x8c60de=_0x5cf722[_0x97ffc3(0x18e)](_0x15b747=>!_0x15b747[_0x97ffc3(0x18a)]&&_0x15b747['diff']);if(_0x8c60de['length']>0x0&&!_0x45ef98[_0x97ffc3(0x1cd)])for(const _0x2362a6 of _0x8c60de){const _0x2fccef=_0x2362a6['folderPath']?_0x2362a6[_0x97ffc3(0x20c)]+'/'+_0x2362a6[_0x97ffc3(0x195)][_0x97ffc3(0x1e7)]:_0x2362a6['yamlConfig']['name'];console[_0x97ffc3(0x1ab)]('\x0a'+a41_0x2088dd['yellow'](_0x97ffc3(0x1b9))+'\x20'+_0x2fccef),console[_0x97ffc3(0x1ab)]('─'[_0x97ffc3(0x1b2)](0x3c)),console[_0x97ffc3(0x1ab)](_0x2362a6[_0x97ffc3(0x1c5)]),console[_0x97ffc3(0x1ab)]('─'[_0x97ffc3(0x1b2)](0x3c));}if(_0x535d6d[_0x97ffc3(0x1af)]>0x0)for(const _0x3dbd34 of _0x535d6d){const _0x22deaf=_0x3dbd34['folderPath']?_0x3dbd34[_0x97ffc3(0x20c)]+'/'+_0x3dbd34[_0x97ffc3(0x195)]['name']:_0x3dbd34[_0x97ffc3(0x195)][_0x97ffc3(0x1e7)];console[_0x97ffc3(0x1ab)]('\x0a'+a41_0x2088dd[_0x97ffc3(0x19c)](_0x97ffc3(0x1c4))+'\x20'+_0x22deaf),console[_0x97ffc3(0x1ab)]('─'['repeat'](0x3c)),_0x3dbd34['diff']&&console[_0x97ffc3(0x1ab)](_0x3dbd34['diff']),console[_0x97ffc3(0x1ab)]('─'['repeat'](0x3c));}const _0x2eee67=_0xcaf597[_0x97ffc3(0x18e)](_0x4d3d4d=>!_0x4d3d4d[_0x97ffc3(0x18a)]&&_0x4d3d4d[_0x97ffc3(0x1c5)]);if(_0x2eee67[_0x97ffc3(0x1af)]>0x0)for(const _0x2d1133 of _0x2eee67){const _0x1c6f39=_0x2d1133[_0x97ffc3(0x20c)]?_0x2d1133['folderPath']+'/'+_0x2d1133[_0x97ffc3(0x195)][_0x97ffc3(0x1e7)]:_0x2d1133[_0x97ffc3(0x195)][_0x97ffc3(0x1e7)];console[_0x97ffc3(0x1ab)]('\x0a'+a41_0x2088dd['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x1c6f39),console[_0x97ffc3(0x1ab)]('─'[_0x97ffc3(0x1b2)](0x3c)),console[_0x97ffc3(0x1ab)](_0x2d1133['diff']),console[_0x97ffc3(0x1ab)]('─'['repeat'](0x3c));}if(_0x295d28[_0x97ffc3(0x1af)]>0x0)for(const _0x847ee2 of _0x295d28){const _0x4bb156=_0x847ee2['folderId']?_0x2eae26[_0x97ffc3(0x1c0)](_0x847ee2[_0x97ffc3(0x1c8)])||'':'',_0xcd9596=_0x4bb156?_0x4bb156+'/'+_0x847ee2[_0x97ffc3(0x1d7)]:_0x847ee2[_0x97ffc3(0x1d7)];console['error']('\x0a'+a41_0x2088dd[_0x97ffc3(0x1c2)]('Delete\x20journey:')+'\x20'+_0xcd9596),console['error']('─'[_0x97ffc3(0x1b2)](0x3c)),console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x1c2)](_0x97ffc3(0x20a))),console[_0x97ffc3(0x1ab)]('─'[_0x97ffc3(0x1b2)](0x3c));}if(_0x45ef98['dryRun'])return console['error'](a41_0x2088dd[_0x97ffc3(0x188)](_0x97ffc3(0x1bd))),0x0;const _0x1596bb=_0x45ef98['journeysOnly']?![]:_0x375526[_0x97ffc3(0x1af)]>0x0||_0xc88e71[_0x97ffc3(0x1af)]>0x0||_0x58d21e[_0x97ffc3(0x1af)]>0x0,_0x2102c5=_0x535d6d[_0x97ffc3(0x1af)]>0x0||_0x40efef[_0x97ffc3(0x1af)]>0x0||_0x295d28[_0x97ffc3(0x1af)]>0x0,_0x352979=_0x45ef98[_0x97ffc3(0x1cd)]?![]:_0x205284[_0x97ffc3(0x1af)]>0x0,_0x1a9b84=_0x2673c8['length']>0x0;if(!_0x1596bb&&!_0x2102c5&&!_0x352979&&!_0x1a9b84){const _0xddf943=_0x45ef98[_0x97ffc3(0x1cd)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x97ffc3(0x1cf);console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x19c)](_0xddf943));if(_0x5b97ae&&_0x5118ab[_0x97ffc3(0x1af)]===0x1){const _0x423c71=_0x5118ab[0x0];if(_0x423c71[_0x97ffc3(0x205)]?.['id']){const _0x1ae8d3=getConsoleNextUrl(_0x45ef98['site'],_0x97ffc3(0x1fe)+_0x3ba3a5+'/e/'+_0x423c71[_0x97ffc3(0x205)]['id']+_0x97ffc3(0x194));console[_0x97ffc3(0x1ab)](_0x97ffc3(0x17f)+a41_0x2088dd['cyan'](_0x1ae8d3));}}if(_0x5b97ae&&_0x37e493[_0x97ffc3(0x1af)]===0x1){const _0x417936=_0x37e493[0x0];if(_0x417936[_0x97ffc3(0x1aa)]?.['id']){const _0x3c0006=getConsoleNextUrl(_0x45ef98[_0x97ffc3(0x187)],_0x97ffc3(0x1fe)+_0x3ba3a5+_0x97ffc3(0x1ae)+_0x417936[_0x97ffc3(0x1aa)]['id']+'/j/da/je');console[_0x97ffc3(0x1ab)]('\x20\x20'+a41_0x2088dd['cyan'](_0x3c0006));}}return 0x0;}const _0x582f88=_0x45ef98[_0x97ffc3(0x1cd)]?_0x535d6d[_0x97ffc3(0x1af)]+_0x40efef[_0x97ffc3(0x1af)]+_0x295d28['length']+_0x2673c8['length']:_0x375526[_0x97ffc3(0x1af)]+_0xc88e71['length']+_0x58d21e[_0x97ffc3(0x1af)]+_0x535d6d[_0x97ffc3(0x1af)]+_0x40efef[_0x97ffc3(0x1af)]+_0x295d28[_0x97ffc3(0x1af)]+_0x2673c8['length']+_0x205284[_0x97ffc3(0x1af)];if(!_0x45ef98[_0x97ffc3(0x1f5)]&&_0x582f88>0x0){if(!isInteractive())return console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x1c2)](_0x97ffc3(0x20d)),_0x97ffc3(0x181)),console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x1bc)](_0x97ffc3(0x1c7))),0x1;const _0xb45cbc=await confirmKey('Push\x20'+_0x582f88+_0x97ffc3(0x1e5));if(!_0xb45cbc)return console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x188)](_0x97ffc3(0x1a1))),0x1;}const _0x805e95={'withProgress':async(_0x313276,_0x204c29)=>{const _0x3b5e12=_0x97ffc3,_0x242500=await withSpinner(_0x313276,_0x204c29,{'verbose':_0x45ef98[_0x3b5e12(0x19e)]});return{'data':_0x242500['data']};},'logInfo':_0xe23fcb=>console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x200)]('✔\x20'+_0xe23fcb)),'logSuccess':_0x5b26dd=>console[_0x97ffc3(0x1ab)](a41_0x2088dd[_0x97ffc3(0x19c)]('✔\x20'+_0x5b26dd)),'logWarning':_0x525851=>console['error'](a41_0x2088dd[_0x97ffc3(0x188)]('⚠\x20'+_0x525851)),'logDeleted':_0x13b1c3=>console[_0x97ffc3(0x1ab)](a41_0x2088dd['red']('✔\x20'+_0x13b1c3))},_0xeab380={'segment':_0x20e9be[_0x97ffc3(0x17a)],'journey':_0x20e9be[_0x97ffc3(0x1e6)],'user':_0x20e9be[_0x97ffc3(0x1e2)],'connection':_0x20e9be[_0x97ffc3(0x197)]};_0x2673c8[_0x97ffc3(0x1af)]>0x0&&(_0xacb42=await executePushFolders(_0xeab380,_0x2673c8,_0xacb42,{'parentId':_0x3ba3a5},_0x805e95));const _0x531ee={'rootFolderId':_0xae9002,'folderPathToId':_0xacb42,'folderIdToPath':_0x2eae26,'segmentNameToId':_0x807d4e,'activationsBySegmentId':_0x509d79,'emailToIdMap':_0x468f5c,'idToEmailMap':_0x1da551,'connectionNameToIdMap':_0x53b1fb[_0x97ffc3(0x1a5)],'connectionIdToNameMap':_0x53b1fb[_0x97ffc3(0x185)],'connectionNameToTypeMap':_0x2e3703},_0x592109=await executePushSegments(_0xeab380,_0x45ef98[_0x97ffc3(0x1cd)]?[]:_0x5cf722,_0x531ee,{'parentId':_0x3ba3a5},_0x805e95),_0x20c3c1=_0x592109['created'],_0x1eface=_0x592109[_0x97ffc3(0x190)],_0x30d09b=_0x592109[_0x97ffc3(0x1ee)]['created'],_0x3e6335=_0x592109[_0x97ffc3(0x1ee)][_0x97ffc3(0x190)],_0x26fc8c=_0x592109[_0x97ffc3(0x1ee)][_0x97ffc3(0x1a3)];let _0x3527ce;if(_0x5b97ae&&_0x5cf722[_0x97ffc3(0x1af)]===0x1){const _0x5d0c52=_0x5cf722[0x0];_0x3527ce=_0x5d0c52[_0x97ffc3(0x205)]?.['id']??_0x592109[_0x97ffc3(0x203)][_0x97ffc3(0x1c0)](_0x5d0c52['yamlConfig'][_0x97ffc3(0x1e7)]);}const _0x3125c2=await executePushSegmentDeletions(_0xeab380,_0x45ef98[_0x97ffc3(0x1cd)]?[]:_0x58d21e,_0x805e95);let _0x5547f7=0x0,_0x586d29=0x0,_0x231455=0x0;const _0x2246be=new Map(_0x807d4e);for(const [_0x55df04,_0x5e258a]of _0x592109[_0x97ffc3(0x203)]){_0x2246be[_0x97ffc3(0x18f)](_0x55df04,_0x5e258a);}if(_0xcaf597[_0x97ffc3(0x1af)]>0x0){const _0x21b2b9={..._0x531ee,'segmentNameToId':_0x2246be,'existingSegments':_0x39c3e6,'activationContext':_0x32592d},_0x5cb05e=await executePushJourneys(_0xeab380,_0xcaf597,_0x21b2b9,{'parentId':_0x3ba3a5,'rootFolderId':_0xae9002,'verbose':_0x45ef98[_0x97ffc3(0x19e)]},_0x805e95);_0x5547f7=_0x5cb05e[_0x97ffc3(0x1ef)],_0x586d29=_0x5cb05e[_0x97ffc3(0x190)];if(_0x5b97ae&&_0x5cb05e['results'][_0x97ffc3(0x1af)]===0x1){const _0x214886=_0x5cb05e['results'][0x0];if(_0x214886[_0x97ffc3(0x1b4)]){const _0x42d7d1=getConsoleNextUrl(_0x45ef98[_0x97ffc3(0x187)],_0x97ffc3(0x1fe)+_0x3ba3a5+'/e/'+_0x214886[_0x97ffc3(0x1b4)]+_0x97ffc3(0x1ba));console['error']('\x20\x20'+a41_0x2088dd['cyan'](_0x42d7d1));}}}for(const _0x4c586b of _0x295d28){console['error'](a41_0x2088dd[_0x97ffc3(0x188)](_0x97ffc3(0x207)+_0x4c586b[_0x97ffc3(0x1d7)])),_0x231455++;}const _0x3ad7dd=[];if(_0x20c3c1>0x0)_0x3ad7dd[_0x97ffc3(0x1d2)](_0x20c3c1+_0x97ffc3(0x1c1));if(_0x1eface>0x0)_0x3ad7dd['push'](_0x1eface+_0x97ffc3(0x1c6));if(_0x3125c2>0x0)_0x3ad7dd[_0x97ffc3(0x1d2)](_0x3125c2+_0x97ffc3(0x17d));const _0x44e880=[];if(_0x5547f7>0x0)_0x44e880[_0x97ffc3(0x1d2)](_0x5547f7+'\x20created');if(_0x586d29>0x0)_0x44e880[_0x97ffc3(0x1d2)](_0x586d29+_0x97ffc3(0x1c6));if(_0x231455>0x0)_0x44e880[_0x97ffc3(0x1d2)](_0x231455+_0x97ffc3(0x17d));const _0x18d224=[];if(_0x30d09b>0x0)_0x18d224[_0x97ffc3(0x1d2)](_0x30d09b+'\x20created');if(_0x3e6335>0x0)_0x18d224[_0x97ffc3(0x1d2)](_0x3e6335+'\x20updated');if(_0x26fc8c>0x0)_0x18d224['push'](_0x26fc8c+_0x97ffc3(0x17d));console['error'](a41_0x2088dd['green'](_0x97ffc3(0x1f0)));_0x3ad7dd[_0x97ffc3(0x1af)]>0x0&&!_0x45ef98['journeysOnly']&&console[_0x97ffc3(0x1ab)](_0x97ffc3(0x184)+_0x3ad7dd[_0x97ffc3(0x1d4)](',\x20'));_0x44e880[_0x97ffc3(0x1af)]>0x0&&console[_0x97ffc3(0x1ab)]('\x20\x20Journeys:\x20'+_0x44e880[_0x97ffc3(0x1d4)](',\x20'));_0x18d224[_0x97ffc3(0x1af)]>0x0&&!_0x45ef98[_0x97ffc3(0x1cd)]&&console['error'](_0x97ffc3(0x1e4)+_0x18d224[_0x97ffc3(0x1d4)](',\x20'));if(_0x3527ce){const _0x513e09=getConsoleNextUrl(_0x45ef98[_0x97ffc3(0x187)],'/app/ps/'+_0x3ba3a5+'/e/'+_0x3527ce+'/sb/da/esr');console[_0x97ffc3(0x1ab)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x2088dd['cyan'](_0x513e09));}return 0x0;}}function a41_0x11ea(_0x5480c3,_0x87ed1e){_0x5480c3=_0x5480c3-0x177;const _0x32540c=a41_0x3254();let _0x11ea1d=_0x32540c[_0x5480c3];return _0x11ea1d;}function a41_0x3254(){const _0x3d1bb1=['2051742wXcQnO','cyan','journeysOnly','.yaml','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','listFolders','toCreate','push','9qIQAxK','join','segment\x20or\x20journey','segmentFolderId','journeyBundleName','listJourneysWithDetailsFromParentSegment','\x20to\x20update','filePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','journeyBundleId','Scoped\x20to\x20folder:\x20','Folders\x20to\x20create:','231873YkBfXG','1067056eEcGRT','buildUserMaps','user','attributes','\x20\x20Activations:\x20','\x20changes?','journey','name','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Fetching\x20connections\x20for\x20name\x20resolution...','setPhase','\x20\x20\x20\x20','Delete\x20segment:','\x20new','activations','created','\x0a✔\x20Push\x20complete','relationships','7519260dspTty','parentSegment','334792qgHhCk','yes','map','segments','\x20unchanged','\x20YAML\x20files\x20found','\x20\x20🗺️\x20\x20Journeys:','\x0aValidation\x20failed:','paused','createdAt','/app/ps/','folders','blue','Error:\x20Directory\x20not\x20found:\x20','add','createdSegmentIds','errorCode','existingSegment','no_parent','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Source\x20directory:\x20','(Journey\x20will\x20be\x20deleted)','data','folderPath','\x0aError:','segment:push','type','delete','\x0aPush\x20summary\x20for\x20\x27','segment','Resolving\x20parent\x20segment\x20\x27','nameToType','\x20deleted','\x20\x20Source:\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20activations]','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','91765xiKImn','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Segments:\x20','idToName','isScoped','site','yellow','Fetching\x20existing\x20data...','isNew','message','parentName','endsWith','filter','set','updated','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Preparing\x20journeys...','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/sb/da/esr','yamlConfig','listSegments','connection','.yml','audienceId','Error:\x20','toString','green','157089zuHPcF','verbose','new','file','Aborted.','unchanged','deleted','journeys','nameToId','helpText','\x20changed','all','targetDir','existingJourney','error','changed','description','/e/','length','scopedFolderPath','\x20to\x20delete','repeat','then','journeyId','toUpdate','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','cwd','\x20\x20Activations:','Changes\x20to:','/j/da/je','New\x20segment:','dim','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','listActivations','91ENlenU','get','\x20created','red','Error\x20parsing\x20YAML:\x20','New\x20journey:','diff','\x20updated','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','folderId','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','330SsgKWF'];a41_0x3254=function(){return _0x3d1bb1;};return a41_0x3254();}
1
+ const a41_0xd7865d=a41_0x5566;(function(_0x15b817,_0x16eef4){const _0x480be9=a41_0x5566,_0x2717d6=_0x15b817();while(!![]){try{const _0x1e853a=-parseInt(_0x480be9(0x1b1))/0x1*(-parseInt(_0x480be9(0x178))/0x2)+-parseInt(_0x480be9(0x18c))/0x3+-parseInt(_0x480be9(0x16f))/0x4+parseInt(_0x480be9(0x1df))/0x5+parseInt(_0x480be9(0x18d))/0x6+-parseInt(_0x480be9(0x1af))/0x7+parseInt(_0x480be9(0x171))/0x8;if(_0x1e853a===_0x16eef4)break;else _0x2717d6['push'](_0x2717d6['shift']());}catch(_0x26a330){_0x2717d6['push'](_0x2717d6['shift']());}}}(a41_0x4688,0x689b8));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a41_0x4688(){const _0x30726e=['listSegments','2963093rXNMrW','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','226121vFBmxL','isNew','error','endsWith','listJourneysWithDetailsFromParentSegment','map','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','\x20\x20Source:\x20','nameToType','listFolders','Folders\x20to\x20create:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','site','get','cyan','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','No\x20','filter','getJourney','segmentFolderId','parentSegment','parent_name','message','type','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Delete\x20journey:','join','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','execute','segment','set','\x20updated','attributes','length','existingJourney','\x20\x20🗺️\x20\x20Journeys:','blue','journeys','journeyId','\x0a✔\x20Push\x20complete','yamlConfig','\x20to\x20delete','listActivations','329860hUHTMP','/app/ps/','red','Parent\x20segment:\x20','New\x20journey:','journey','unchanged','\x27...','dryRun','\x20\x20Segments:\x20','Resolving\x20parent\x20segment\x20\x27','push','filePath','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','green','resolveParentId','\x20created','Error:\x20','cwd','(Journey\x20will\x20be\x20deleted)','\x0aValidation\x20failed:','\x20\x20Activations:\x20','segment\x20or\x20journey','toCreate','/e/','toString','.yaml','new','\x20folders\x20to\x20create','\x20activations]','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','diff','versionNumber','\x0aError:','folders','Fetching\x20existing\x20data...','.yml','nameToId','journeyBundleName','📁\x20','connection','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20deleted','targetDir','Push\x20','Site:\x20','1402996YEzGmA','\x20YAML\x20files\x20found','7069896LEKTwJ','then','parentFolder','changed','toDelete','existingSegment','name','2npTXvv','journeysOnly','all','\x20\x20Journeys:\x20','segments','\x0aPush\x20summary\x20for\x20\x27','yellow','updated','folderId','Changes\x20to\x20journey:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20new','audienceId','Preparing\x20journeys...','no_parent','description','repeat','helpText','createdAt','created','674502jJXGxe','1509144GXNKFp','\x20changes?','errorCode','\x20\x20📊\x20Segments:','New\x20segment:','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','results','data','folderPath','/j/da/je','file','Changes\x20to:','activations','isScoped','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20unchanged','dim','createdSegmentIds','relationships','toUpdate','verbose','/sb/da/esr','\x20\x20\x20\x20','state','delete','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20existing\x20activations...','add','\x20changed','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','buildUserMaps','\x20\x20Activations:','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a41_0x4688=function(){return _0x30726e;};return a41_0x4688();}import a41_0x1166f8 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a41_0x5566(_0x476f36,_0x5cf0fe){_0x476f36=_0x476f36-0x14b;const _0x4688f9=a41_0x4688();let _0x55663d=_0x4688f9[_0x476f36];return _0x55663d;}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{[a41_0xd7865d(0x177)]='segment:push';['description']=a41_0xd7865d(0x15f);async[a41_0xd7865d(0x1d0)](_0x398a32){const _0x48062a=a41_0xd7865d,{options:_0x57b848,args:_0x2d0f2e,tdx:_0x3e083f}=_0x398a32,_0x27fd8d=_0x57b848,_0x5bbf09=await resolveTarget({'arg':_0x2d0f2e[0x0],'contextParent':_0x57b848[_0x48062a(0x1c7)],'cwd':process[_0x48062a(0x153)]()});if(!isSuccessfulResolution(_0x5bbf09))return _0x5bbf09[_0x48062a(0x18f)]===_0x48062a(0x186)?(console['error'](a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x1bd))),console[_0x48062a(0x1b3)](_0x48062a(0x1b7)),console[_0x48062a(0x1b3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x48062a(0x1b3)](_0x48062a(0x1cc))):(console['error'](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x152)+_0x5bbf09[_0x48062a(0x1c9)]+'\x0a')),_0x5bbf09[_0x48062a(0x189)]&&console['error'](a41_0x1166f8[_0x48062a(0x1c0)](_0x5bbf09[_0x48062a(0x189)]))),0x1;if(_0x5bbf09[_0x48062a(0x1ca)]===_0x48062a(0x1c8))return console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x1a6)+_0x5bbf09[_0x48062a(0x16c)]+'\x0a')),console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1c0)](_0x48062a(0x1c1))),0x1;const _0x386efd=_0x5bbf09[_0x48062a(0x1cb)],_0x953c20=_0x5bbf09[_0x48062a(0x16c)],_0x2561be=_0x5bbf09[_0x48062a(0x1ca)]===_0x48062a(0x197)?_0x5bbf09[_0x48062a(0x14d)]:undefined,_0x35d127=getScopedDetails(_0x5bbf09),_0x7d4a6c=_0x35d127?.[_0x48062a(0x19a)]??![],_0x32b939=_0x35d127?.['scopedFolderPath']??'';if(!existsSync(_0x953c20))return console['error'](a41_0x1166f8[_0x48062a(0x1e1)]('Error:\x20Directory\x20not\x20found:\x20'+_0x953c20+'\x0a')),console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1c0)](_0x48062a(0x1c1))),0x1;_0x27fd8d['verbose']&&(console[_0x48062a(0x1b3)](_0x48062a(0x16e)+_0x27fd8d[_0x48062a(0x1be)]),console[_0x48062a(0x1b3)](_0x48062a(0x1e2)+_0x386efd),console[_0x48062a(0x1b3)]('Source\x20directory:\x20'+_0x953c20),_0x7d4a6c&&console[_0x48062a(0x1b3)]('Scoped\x20to\x20folder:\x20'+_0x32b939));const _0x4412bf=await withSpinner(_0x48062a(0x14b)+_0x386efd+_0x48062a(0x1e6),()=>_0x3e083f[_0x48062a(0x1d1)][_0x48062a(0x150)](_0x386efd),{'verbose':_0x27fd8d[_0x48062a(0x1a1)]}),_0x47c6d9=_0x4412bf['data'],{parentSegmentResult:_0x1ae2ae,segmentsResult:_0x3e883a,foldersResult:_0xedf463,journeysWithDetailsResult:_0x1ccb2b,userMaps:_0x3deed7}=await withSpinner(_0x48062a(0x164),async()=>{const _0x181058=_0x48062a,[_0x1c4ad9,_0x72605a,_0x350b5c,_0x29bf99,_0xeb0210]=await Promise['all']([_0x3e083f[_0x181058(0x1d1)]['getParent'](_0x47c6d9),_0x3e083f['segment'][_0x181058(0x1ae)](_0x47c6d9),_0x3e083f[_0x181058(0x1d1)][_0x181058(0x1bb)](_0x47c6d9),_0x3e083f[_0x181058(0x1e4)][_0x181058(0x1b5)](_0x47c6d9,{'includeAllVersions':!![]}),_0x3e083f['user'][_0x181058(0x1ab)]()]);return{'parentSegmentResult':_0x1c4ad9,'segmentsResult':_0x72605a,'foldersResult':_0x350b5c,'journeysWithDetailsResult':_0x29bf99,'userMaps':_0xeb0210};},{'verbose':_0x27fd8d['verbose']})[_0x48062a(0x172)](_0xd0b4bb=>_0xd0b4bb['data']),_0x49c17d=_0x1ae2ae,_0x408201=extractRootFolderId(_0x49c17d),_0xb985c9=_0x3e883a,_0x1f65dc=_0xedf463,{journeys:_0x479dcf,activationStepsById:_0x127b78}=_0x1ccb2b,_0x5d7d27=new Map(_0x479dcf[_0x48062a(0x1b6)](_0x2cef0f=>[_0x2cef0f['id'],_0x2cef0f])),_0x3b30c5=_0x479dcf[_0x48062a(0x1b6)](_0x54e0a5=>({'id':_0x54e0a5['id'],'name':_0x54e0a5[_0x48062a(0x1d4)]['name'],'journeyBundleName':_0x54e0a5[_0x48062a(0x1d4)][_0x48062a(0x167)]||'','journeyBundleId':_0x54e0a5[_0x48062a(0x1d4)]['journeyBundleId']||'','versionNumber':_0x54e0a5['attributes'][_0x48062a(0x161)],'description':_0x54e0a5[_0x48062a(0x1d4)][_0x48062a(0x187)],'state':_0x54e0a5[_0x48062a(0x1d4)][_0x48062a(0x1a4)],'paused':_0x54e0a5['attributes']['paused'],'audienceId':_0x54e0a5[_0x48062a(0x1d4)][_0x48062a(0x184)],'folderId':_0x54e0a5[_0x48062a(0x19f)]?.[_0x48062a(0x173)]?.[_0x48062a(0x194)]?.['id'],'createdAt':_0x54e0a5['attributes'][_0x48062a(0x18a)],'updatedAt':_0x54e0a5['attributes']['updatedAt']})),{emailToId:_0x1ad832,idToEmail:_0x85eed3}=_0x3deed7,_0x3fac77=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x109ea7=_0x48062a,_0x5cf921=await _0x3e083f[_0x109ea7(0x169)]['list']();return buildConnectionMaps(_0x5cf921);},{'verbose':_0x27fd8d[_0x48062a(0x1a1)]})[_0x48062a(0x172)](_0x3902e7=>_0x3902e7['data']),_0x18336b=_0x3fac77[_0x48062a(0x166)],_0x4259fa=_0x3fac77[_0x48062a(0x1b8)],_0x402ad8=_0x3fac77[_0x48062a(0x1ba)],_0x49715a={'emailToIdMap':_0x1ad832,'connectionNameToIdMap':_0x18336b,'connectionNameToTypeMap':_0x402ad8,'getSchema':_0x2437c8=>_0x3e083f['connection']['getOutputSchemaWithCache'](_0x2437c8)};let {pathToId:_0xecbe09,idToPath:_0xe30381}=buildFolderMaps(_0x1f65dc);const _0x2abb70=buildSegmentLookupMap(_0xb985c9,_0xe30381),_0x55f76c=buildSegmentNameToIdMap(_0xb985c9),_0x5bb728=buildJourneyBundleLookupMap(_0x3b30c5,_0xe30381);let _0x53e389;if(_0x2561be){if(!_0x2561be[_0x48062a(0x1b4)](_0x48062a(0x165))&&!_0x2561be[_0x48062a(0x1b4)](_0x48062a(0x15b)))return console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x14e)+_0x2561be+'\x0a')),0x1;_0x53e389=[_0x2561be];}else _0x53e389=findYamlFiles(_0x953c20);if(_0x53e389[_0x48062a(0x1d5)]===0x0)return console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x1ad)+_0x953c20+'\x0a')),console['error'](a41_0x1166f8[_0x48062a(0x1c0)](_0x48062a(0x192))),0x1;let _0xe41cad,_0x45a363;try{const _0xffb259=parseAndClassifyYamlFiles(_0x53e389,_0x953c20,{'skipSegments':_0x27fd8d['journeysOnly']});_0xe41cad=_0xffb259[_0x48062a(0x17c)],_0x45a363=_0xffb259[_0x48062a(0x1d9)];const _0x4b8028=validateParsedFiles(_0xffb259,_0x953c20);if(_0x4b8028[_0x48062a(0x1d5)]>0x0)return console[_0x48062a(0x1b3)](a41_0x1166f8['red'](_0x48062a(0x155))),console['error'](formatValidationErrors(_0x4b8028)),console['error'](a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x1cf))),0x1;}catch(_0x39e899){return console['error'](a41_0x1166f8[_0x48062a(0x1e1)]('Error\x20parsing\x20YAML:\x20'+(_0x39e899 instanceof Error?_0x39e899[_0x48062a(0x1c9)]:_0x39e899))),0x1;}if(_0xe41cad[_0x48062a(0x1d5)]===0x0&&_0x45a363[_0x48062a(0x1d5)]===0x0){const _0x2b0904=_0x27fd8d[_0x48062a(0x179)]?_0x48062a(0x1e4):_0x48062a(0x157);return console[_0x48062a(0x1b3)](a41_0x1166f8['yellow'](_0x48062a(0x1c3)+_0x2b0904+_0x48062a(0x170))),0x0;}const _0x121fa7=new Map();_0xb985c9[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)]&&await withSpinner(_0x48062a(0x1a7),async()=>{await batchAsync(_0xb985c9,async _0x112766=>{const _0x29bc27=a41_0x5566,_0x42b3a9=await _0x3e083f['segment'][_0x29bc27(0x1de)](_0x47c6d9,_0x112766['id']);_0x121fa7[_0x29bc27(0x1d2)](_0x112766['id'],_0x42b3a9);});},{'verbose':_0x27fd8d[_0x48062a(0x1a1)]});const {segmentFiles:_0x8e3ad5,foldersToCreate:_0x1afa44}=await prepareSegmentFiles(_0xe41cad,{'segmentByFolderAndName':_0x2abb70,'activationsBySegmentId':_0x121fa7,'folderPathToId':_0xecbe09,'idToEmailMap':_0x85eed3,'connectionIdToNameMap':_0x4259fa},_0x49715a,_0x7d4a6c,_0x32b939),_0x1360bf=_0x2561be?[]:findSegmentsToDelete(_0xb985c9,_0xe41cad[_0x48062a(0x1b6)](({yamlConfig:_0x2c9dda,folderPath:_0x14b28e})=>({'yamlConfig':_0x2c9dda,'folderPath':resolveTDFolderPath(_0x14b28e,_0x7d4a6c,_0x32b939)})),_0xe30381,_0x32b939,_0x7d4a6c),{journeyFiles:_0x3bef82,foldersToCreate:_0xf349b7}=await withProgressSpinner(_0x48062a(0x185),async _0x55fc4b=>prepareJourneyFiles(_0x45a363,{'fetchJourney':async _0x185214=>_0x3e083f['journey'][_0x48062a(0x1c5)](_0x185214[_0x48062a(0x1da)]),'journeyBundlesByFolderAndName':_0x5bb728,'folderPathToId':_0xecbe09,'idToEmailMap':_0x85eed3,'connectionIdToNameMap':_0x4259fa,'existingSegments':_0xb985c9,'parentId':_0x47c6d9,'deps':_0x3e083f,'progress':{'update':_0x3c59a8=>{const _0x4e9d5c=_0x48062a;_0x55fc4b['setPhase'](_0x3c59a8),_0x27fd8d[_0x4e9d5c(0x1a1)]&&console['error']('\x20\x20'+_0x3c59a8);}},'journeyById':_0x5d7d27,'activationStepsById':_0x127b78},_0x7d4a6c,_0x32b939),{'verbose':_0x27fd8d[_0x48062a(0x1a1)]})[_0x48062a(0x172)](_0x214336=>_0x214336[_0x48062a(0x194)]);for(const _0x379575 of _0xf349b7){_0x1afa44[_0x48062a(0x1a8)](_0x379575);}const _0x5155bc=_0x2561be?[]:findJourneysToDelete(_0x3b30c5,_0x45a363[_0x48062a(0x1b6)](({yamlConfig:_0xd26123,folderPath:_0x50b7c5})=>({'yamlConfig':_0xd26123,'folderPath':resolveTDFolderPath(_0x50b7c5,_0x7d4a6c,_0x32b939)})),_0xe30381,_0x32b939,_0x7d4a6c),_0x5e2d07=calculatePushStats(_0x8e3ad5,_0x3bef82,_0x1afa44,_0x1360bf,_0x5155bc,!!_0x27fd8d[_0x48062a(0x1a5)],!!_0x27fd8d['journeysOnly']),_0x2430b6=_0x5e2d07[_0x48062a(0x17c)][_0x48062a(0x15c)],_0x1944c2=_0x5e2d07[_0x48062a(0x17c)][_0x48062a(0x174)],_0x29d699=_0x5e2d07[_0x48062a(0x17c)][_0x48062a(0x1e5)],_0x9979c4=_0x5e2d07[_0x48062a(0x17c)][_0x48062a(0x175)],_0x407833=_0x5e2d07[_0x48062a(0x163)][_0x48062a(0x158)],_0x241618=_0x5e2d07[_0x48062a(0x1d9)][_0x48062a(0x15c)],_0x2e84fe=_0x5e2d07[_0x48062a(0x1d9)]['changed'],_0x122cbc=_0x5e2d07[_0x48062a(0x1d9)][_0x48062a(0x1e5)],_0xd8e16d=_0x5e2d07[_0x48062a(0x1d9)]['toDelete'],_0x261a26=_0x5e2d07['activations'][_0x48062a(0x17a)],_0x374036=_0x5e2d07['activations'][_0x48062a(0x158)],_0x179933=_0x5e2d07[_0x48062a(0x199)][_0x48062a(0x1a0)],_0x13d298=_0x5e2d07[_0x48062a(0x199)][_0x48062a(0x175)];console[_0x48062a(0x1b3)](_0x48062a(0x17d)+_0x386efd+'\x27:');_0x407833[_0x48062a(0x1d5)]>0x0&&console[_0x48062a(0x1b3)]('\x20\x20'+a41_0x1166f8[_0x48062a(0x1d8)](_0x48062a(0x168)+_0x407833[_0x48062a(0x1d5)]+_0x48062a(0x15d)));if(!_0x27fd8d[_0x48062a(0x179)]){console['error'](_0x48062a(0x190)),console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x14f)]('+\x20'+_0x2430b6[_0x48062a(0x1d5)]+'\x20new')),console['error'](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x17e)]('~\x20'+_0x1944c2[_0x48062a(0x1d5)]+_0x48062a(0x1a9)));if(_0x9979c4[_0x48062a(0x1d5)]>0x0)console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x1e1)]('-\x20'+_0x9979c4[_0x48062a(0x1d5)]+_0x48062a(0x1dd)));else _0x1360bf['length']>0x0&&!_0x27fd8d[_0x48062a(0x1a5)]&&console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8['dim'](_0x1360bf[_0x48062a(0x1d5)]+_0x48062a(0x1aa)));console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x19d)]('=\x20'+_0x29d699['length']+'\x20unchanged'));}if(_0x3bef82[_0x48062a(0x1d5)]>0x0||_0x5155bc[_0x48062a(0x1d5)]>0x0){console[_0x48062a(0x1b3)](_0x48062a(0x1d7)),console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8['green']('+\x20'+_0x241618['length']+_0x48062a(0x183))),console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x17e)]('~\x20'+_0x2e84fe['length']+_0x48062a(0x1a9)));if(_0xd8e16d[_0x48062a(0x1d5)]>0x0)console[_0x48062a(0x1b3)]('\x20\x20\x20\x20'+a41_0x1166f8[_0x48062a(0x1e1)]('-\x20'+_0xd8e16d[_0x48062a(0x1d5)]+_0x48062a(0x1dd)));else _0x5155bc[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x1a5)]&&console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x19d)](_0x5155bc[_0x48062a(0x1d5)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x19d)]('=\x20'+_0x122cbc[_0x48062a(0x1d5)]+_0x48062a(0x19c)));}_0x261a26[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)]&&(console[_0x48062a(0x1b3)](''),console[_0x48062a(0x1b3)](_0x48062a(0x1ac)),_0x374036['length']>0x0&&console[_0x48062a(0x1b3)]('\x20\x20\x20\x20'+a41_0x1166f8[_0x48062a(0x14f)]('+\x20'+_0x374036['length']+'\x20to\x20create')),_0x179933[_0x48062a(0x1d5)]>0x0&&console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x17e)]('~\x20'+_0x179933[_0x48062a(0x1d5)]+'\x20to\x20update')),_0x13d298[_0x48062a(0x1d5)]>0x0&&console[_0x48062a(0x1b3)](_0x48062a(0x1a3)+a41_0x1166f8[_0x48062a(0x1e1)]('-\x20'+_0x13d298[_0x48062a(0x1d5)]+_0x48062a(0x1dd))));console[_0x48062a(0x1b3)](_0x48062a(0x1b9)+a41_0x1166f8[_0x48062a(0x1c0)](_0x953c20)+'\x0a');if(_0x407833[_0x48062a(0x1d5)]>0x0){console[_0x48062a(0x1b3)](_0x48062a(0x1bc));for(const _0x4b40db of _0x407833){console[_0x48062a(0x1b3)]('\x20\x20'+a41_0x1166f8[_0x48062a(0x1d8)]('+')+'\x20'+_0x4b40db);}console[_0x48062a(0x1b3)]('');}if(_0x2430b6[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)])for(const _0x2a4456 of _0x2430b6){const _0x4f9d63=_0x2a4456[_0x48062a(0x195)]?_0x2a4456[_0x48062a(0x195)]+'/'+_0x2a4456[_0x48062a(0x1dc)][_0x48062a(0x177)]:_0x2a4456[_0x48062a(0x1dc)][_0x48062a(0x177)],_0xc6d42f=_0x2a4456[_0x48062a(0x1dc)][_0x48062a(0x199)]?.['length']||0x0,_0x5d5006=_0xc6d42f>0x0?a41_0x1166f8[_0x48062a(0x19d)]('\x20['+_0xc6d42f+_0x48062a(0x15e)):'';console[_0x48062a(0x1b3)]('\x0a'+a41_0x1166f8['green'](_0x48062a(0x191))+'\x20'+_0x4f9d63+_0x5d5006),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c)),_0x2a4456[_0x48062a(0x160)]&&console[_0x48062a(0x1b3)](_0x2a4456['diff']),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));}if(_0x9979c4[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)])for(const _0x56cecb of _0x9979c4){const _0x33c2f8=_0x56cecb[_0x48062a(0x1c6)]?_0xe30381[_0x48062a(0x1bf)](_0x56cecb[_0x48062a(0x1c6)][_0x48062a(0x15a)]())||'':'',_0x5e4d2f=_0x33c2f8?_0x33c2f8+'/'+_0x56cecb[_0x48062a(0x177)]:_0x56cecb[_0x48062a(0x177)],_0x2d5c99=_0x121fa7['get'](_0x56cecb['id'])||[],_0x296d53=_0x2d5c99[_0x48062a(0x1d5)]>0x0?a41_0x1166f8['dim']('\x20['+_0x2d5c99[_0x48062a(0x1d5)]+'\x20activations]'):'';console[_0x48062a(0x1b3)]('\x0a'+a41_0x1166f8['red']('Delete\x20segment:')+'\x20'+_0x5e4d2f+_0x296d53),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));const _0xdd744=segmentWithActivationsToYaml(_0x56cecb,_0x2d5c99,undefined,_0x85eed3,_0x4259fa),_0x11ba5f=segmentToYamlString(_0xdd744),_0x4bbf09=generateDiff(_0x11ba5f,'');console[_0x48062a(0x1b3)](formatDiffWithColors(_0x4bbf09)),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));}const _0x1a8611=_0x8e3ad5[_0x48062a(0x1c4)](_0x36cd89=>!_0x36cd89[_0x48062a(0x1b2)]&&_0x36cd89[_0x48062a(0x160)]);if(_0x1a8611[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)])for(const _0x2bac07 of _0x1a8611){const _0x54cddd=_0x2bac07[_0x48062a(0x195)]?_0x2bac07[_0x48062a(0x195)]+'/'+_0x2bac07[_0x48062a(0x1dc)]['name']:_0x2bac07[_0x48062a(0x1dc)][_0x48062a(0x177)];console[_0x48062a(0x1b3)]('\x0a'+a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x198))+'\x20'+_0x54cddd),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c)),console[_0x48062a(0x1b3)](_0x2bac07['diff']),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));}if(_0x241618[_0x48062a(0x1d5)]>0x0)for(const _0x879fb of _0x241618){const _0x4c3d5b=_0x879fb[_0x48062a(0x195)]?_0x879fb[_0x48062a(0x195)]+'/'+_0x879fb[_0x48062a(0x1dc)][_0x48062a(0x177)]:_0x879fb['yamlConfig'][_0x48062a(0x177)];console['error']('\x0a'+a41_0x1166f8['green'](_0x48062a(0x1e3))+'\x20'+_0x4c3d5b),console['error']('─'[_0x48062a(0x188)](0x3c)),_0x879fb['diff']&&console[_0x48062a(0x1b3)](_0x879fb['diff']),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c));}const _0x1cfe1b=_0x3bef82[_0x48062a(0x1c4)](_0x17ffb4=>!_0x17ffb4['isNew']&&_0x17ffb4[_0x48062a(0x160)]);if(_0x1cfe1b['length']>0x0)for(const _0xf66301 of _0x1cfe1b){const _0x3d5e00=_0xf66301[_0x48062a(0x195)]?_0xf66301[_0x48062a(0x195)]+'/'+_0xf66301['yamlConfig'][_0x48062a(0x177)]:_0xf66301[_0x48062a(0x1dc)][_0x48062a(0x177)];console['error']('\x0a'+a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x181))+'\x20'+_0x3d5e00),console[_0x48062a(0x1b3)]('─'[_0x48062a(0x188)](0x3c)),console['error'](_0xf66301['diff']),console[_0x48062a(0x1b3)]('─'['repeat'](0x3c));}if(_0xd8e16d[_0x48062a(0x1d5)]>0x0)for(const _0x5c7d46 of _0xd8e16d){const _0x2d4489=_0x5c7d46['folderId']?_0xe30381[_0x48062a(0x1bf)](_0x5c7d46[_0x48062a(0x180)])||'':'',_0x48c8ab=_0x2d4489?_0x2d4489+'/'+_0x5c7d46[_0x48062a(0x167)]:_0x5c7d46[_0x48062a(0x167)];console['error']('\x0a'+a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x1cd))+'\x20'+_0x48c8ab),console[_0x48062a(0x1b3)]('─'['repeat'](0x3c)),console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x154))),console[_0x48062a(0x1b3)]('─'['repeat'](0x3c));}if(_0x27fd8d[_0x48062a(0x1e7)])return console['error'](a41_0x1166f8['yellow'](_0x48062a(0x182))),0x0;const _0x1d0e76=_0x27fd8d[_0x48062a(0x179)]?![]:_0x2430b6['length']>0x0||_0x1944c2[_0x48062a(0x1d5)]>0x0||_0x9979c4['length']>0x0,_0x5a6957=_0x241618[_0x48062a(0x1d5)]>0x0||_0x2e84fe[_0x48062a(0x1d5)]>0x0||_0xd8e16d[_0x48062a(0x1d5)]>0x0,_0x33f4b1=_0x27fd8d[_0x48062a(0x179)]?![]:_0x261a26[_0x48062a(0x1d5)]>0x0,_0x474b85=_0x407833['length']>0x0;if(!_0x1d0e76&&!_0x5a6957&&!_0x33f4b1&&!_0x474b85){const _0xf0bcac=_0x27fd8d[_0x48062a(0x179)]?_0x48062a(0x19b):_0x48062a(0x1c2);console[_0x48062a(0x1b3)](a41_0x1166f8['green'](_0xf0bcac));if(_0x2561be&&_0x29d699['length']===0x1){const _0x5ccbd6=_0x29d699[0x0];if(_0x5ccbd6[_0x48062a(0x176)]?.['id']){const _0x50fe66=getConsoleNextUrl(_0x27fd8d[_0x48062a(0x1be)],_0x48062a(0x1e0)+_0x47c6d9+_0x48062a(0x159)+_0x5ccbd6['existingSegment']['id']+'/sb/da/esr');console[_0x48062a(0x1b3)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x1166f8[_0x48062a(0x1c0)](_0x50fe66));}}if(_0x2561be&&_0x122cbc['length']===0x1){const _0x1b86cc=_0x122cbc[0x0];if(_0x1b86cc[_0x48062a(0x1d6)]?.['id']){const _0x52dbc8=getConsoleNextUrl(_0x27fd8d[_0x48062a(0x1be)],_0x48062a(0x1e0)+_0x47c6d9+_0x48062a(0x159)+_0x1b86cc[_0x48062a(0x1d6)]['id']+'/j/da/je');console['error']('\x20\x20'+a41_0x1166f8[_0x48062a(0x1c0)](_0x52dbc8));}}return 0x0;}const _0x2b848d=_0x27fd8d[_0x48062a(0x179)]?_0x241618[_0x48062a(0x1d5)]+_0x2e84fe[_0x48062a(0x1d5)]+_0xd8e16d['length']+_0x407833[_0x48062a(0x1d5)]:_0x2430b6[_0x48062a(0x1d5)]+_0x1944c2[_0x48062a(0x1d5)]+_0x9979c4['length']+_0x241618[_0x48062a(0x1d5)]+_0x2e84fe[_0x48062a(0x1d5)]+_0xd8e16d['length']+_0x407833[_0x48062a(0x1d5)]+_0x261a26['length'];if(!_0x27fd8d['yes']&&_0x2b848d>0x0){if(!isInteractive())return console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1e1)](_0x48062a(0x162)),_0x48062a(0x16a)),console['error'](a41_0x1166f8[_0x48062a(0x19d)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x119f9d=await confirmKey(_0x48062a(0x16d)+_0x2b848d+_0x48062a(0x18e));if(!_0x119f9d)return console[_0x48062a(0x1b3)](a41_0x1166f8['yellow']('Aborted.')),0x1;}const _0x2a4cf7={'withProgress':async(_0x2a8118,_0x4b21dd)=>{const _0x3a4a50=_0x48062a,_0x10164c=await withSpinner(_0x2a8118,_0x4b21dd,{'verbose':_0x27fd8d[_0x3a4a50(0x1a1)]});return{'data':_0x10164c[_0x3a4a50(0x194)]};},'logInfo':_0x3ad5c8=>console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x1d8)]('✔\x20'+_0x3ad5c8)),'logSuccess':_0x96a02f=>console['error'](a41_0x1166f8[_0x48062a(0x14f)]('✔\x20'+_0x96a02f)),'logWarning':_0x2e4d33=>console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x17e)]('⚠\x20'+_0x2e4d33)),'logDeleted':_0x51e738=>console['error'](a41_0x1166f8[_0x48062a(0x1e1)]('✔\x20'+_0x51e738))},_0x3cb865={'segment':_0x3e083f[_0x48062a(0x1d1)],'journey':_0x3e083f[_0x48062a(0x1e4)],'user':_0x3e083f['user'],'connection':_0x3e083f['connection']};_0x407833[_0x48062a(0x1d5)]>0x0&&(_0xecbe09=await executePushFolders(_0x3cb865,_0x407833,_0xecbe09,{'parentId':_0x47c6d9},_0x2a4cf7));const _0x360659={'rootFolderId':_0x408201,'folderPathToId':_0xecbe09,'folderIdToPath':_0xe30381,'segmentNameToId':_0x55f76c,'activationsBySegmentId':_0x121fa7,'emailToIdMap':_0x1ad832,'idToEmailMap':_0x85eed3,'connectionNameToIdMap':_0x3fac77['nameToId'],'connectionIdToNameMap':_0x3fac77[_0x48062a(0x1b8)],'connectionNameToTypeMap':_0x402ad8},_0x2543ff=await executePushSegments(_0x3cb865,_0x27fd8d[_0x48062a(0x179)]?[]:_0x8e3ad5,_0x360659,{'parentId':_0x47c6d9},_0x2a4cf7),_0x19e345=_0x2543ff[_0x48062a(0x18b)],_0x457de2=_0x2543ff['updated'],_0x47e980=_0x2543ff[_0x48062a(0x199)][_0x48062a(0x18b)],_0x1d8162=_0x2543ff[_0x48062a(0x199)][_0x48062a(0x17f)],_0x397974=_0x2543ff[_0x48062a(0x199)]['deleted'];let _0x2f416f;if(_0x2561be&&_0x8e3ad5[_0x48062a(0x1d5)]===0x1){const _0x143b44=_0x8e3ad5[0x0];_0x2f416f=_0x143b44[_0x48062a(0x176)]?.['id']??_0x2543ff[_0x48062a(0x19e)]['get'](_0x143b44[_0x48062a(0x1dc)]['name']);}const _0x30f4c1=await executePushSegmentDeletions(_0x3cb865,_0x27fd8d[_0x48062a(0x179)]?[]:_0x9979c4,_0x2a4cf7);let _0x3c4223=0x0,_0x4272a4=0x0,_0x543684=0x0;const _0x11dd3d=new Map(_0x55f76c);for(const [_0x43133e,_0x4f93b8]of _0x2543ff[_0x48062a(0x19e)]){_0x11dd3d['set'](_0x43133e,_0x4f93b8);}if(_0x3bef82[_0x48062a(0x1d5)]>0x0){const _0x4225d0={..._0x360659,'segmentNameToId':_0x11dd3d,'existingSegments':_0xb985c9,'activationContext':_0x49715a},_0x148f03=await executePushJourneys(_0x3cb865,_0x3bef82,_0x4225d0,{'parentId':_0x47c6d9,'rootFolderId':_0x408201,'verbose':_0x27fd8d[_0x48062a(0x1a1)]},_0x2a4cf7);_0x3c4223=_0x148f03[_0x48062a(0x18b)],_0x4272a4=_0x148f03[_0x48062a(0x17f)];if(_0x2561be&&_0x148f03[_0x48062a(0x193)][_0x48062a(0x1d5)]===0x1){const _0x28064d=_0x148f03[_0x48062a(0x193)][0x0];if(_0x28064d['journeyId']){const _0x4f68db=getConsoleNextUrl(_0x27fd8d[_0x48062a(0x1be)],'/app/ps/'+_0x47c6d9+'/e/'+_0x28064d[_0x48062a(0x1da)]+_0x48062a(0x196));console[_0x48062a(0x1b3)]('\x20\x20'+a41_0x1166f8[_0x48062a(0x1c0)](_0x4f68db));}}}for(const _0x187eaf of _0xd8e16d){console[_0x48062a(0x1b3)](a41_0x1166f8[_0x48062a(0x17e)](_0x48062a(0x1b0)+_0x187eaf['journeyBundleName'])),_0x543684++;}const _0x30518f=[];if(_0x19e345>0x0)_0x30518f[_0x48062a(0x14c)](_0x19e345+_0x48062a(0x151));if(_0x457de2>0x0)_0x30518f['push'](_0x457de2+_0x48062a(0x1d3));if(_0x30f4c1>0x0)_0x30518f[_0x48062a(0x14c)](_0x30f4c1+'\x20deleted');const _0x3312ef=[];if(_0x3c4223>0x0)_0x3312ef['push'](_0x3c4223+'\x20created');if(_0x4272a4>0x0)_0x3312ef[_0x48062a(0x14c)](_0x4272a4+_0x48062a(0x1d3));if(_0x543684>0x0)_0x3312ef[_0x48062a(0x14c)](_0x543684+_0x48062a(0x16b));const _0x45e98b=[];if(_0x47e980>0x0)_0x45e98b[_0x48062a(0x14c)](_0x47e980+'\x20created');if(_0x1d8162>0x0)_0x45e98b[_0x48062a(0x14c)](_0x1d8162+_0x48062a(0x1d3));if(_0x397974>0x0)_0x45e98b[_0x48062a(0x14c)](_0x397974+'\x20deleted');console[_0x48062a(0x1b3)](a41_0x1166f8['green'](_0x48062a(0x1db)));_0x30518f[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)]&&console[_0x48062a(0x1b3)](_0x48062a(0x1e8)+_0x30518f['join'](',\x20'));_0x3312ef[_0x48062a(0x1d5)]>0x0&&console[_0x48062a(0x1b3)](_0x48062a(0x17b)+_0x3312ef[_0x48062a(0x1ce)](',\x20'));_0x45e98b[_0x48062a(0x1d5)]>0x0&&!_0x27fd8d[_0x48062a(0x179)]&&console[_0x48062a(0x1b3)](_0x48062a(0x156)+_0x45e98b[_0x48062a(0x1ce)](',\x20'));if(_0x2f416f){const _0xf23326=getConsoleNextUrl(_0x27fd8d[_0x48062a(0x1be)],'/app/ps/'+_0x47c6d9+'/e/'+_0x2f416f+_0x48062a(0x1a2));console[_0x48062a(0x1b3)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x1166f8[_0x48062a(0x1c0)](_0xf23326));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x39a254=a42_0x253e;(function(_0x1950e3,_0x4932e3){const _0x3b0979=a42_0x253e,_0x40d20a=_0x1950e3();while(!![]){try{const _0x37cb44=parseInt(_0x3b0979(0x199))/0x1+-parseInt(_0x3b0979(0x174))/0x2+parseInt(_0x3b0979(0x188))/0x3*(-parseInt(_0x3b0979(0x183))/0x4)+parseInt(_0x3b0979(0x171))/0x5+-parseInt(_0x3b0979(0x17a))/0x6*(parseInt(_0x3b0979(0x192))/0x7)+parseInt(_0x3b0979(0x191))/0x8+parseInt(_0x3b0979(0x198))/0x9;if(_0x37cb44===_0x4932e3)break;else _0x40d20a['push'](_0x40d20a['shift']());}catch(_0x5893b2){_0x40d20a['push'](_0x40d20a['shift']());}}}(a42_0x5349,0x2d213));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a42_0x5349(){const _0x3dd480=['execute','Parent\x20ID:\x20','213984yVTmLJ','7cIBZzI','Resolving\x20path\x20\x27','Resolved\x20relative\x20path\x20to:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','updateSegmentById','kind','4286790fwtXxz','27534SydyiP','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','INTERNAL','\x27...','segmentPath','Segment\x20ID:\x20','1517710nNPCKz','data','resolveFolderId','509122tQvSpZ','folder','segmentId','Updating\x20segment\x20\x27','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segment:update','998418iqmrjB','parentId','type','Examples:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','error','segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','rule','676QdXRHO','name','segmentName','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','includes','4053VOzMjx','ruleFile','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Resolved\x20type:\x20','verbose','yellow','length'];a42_0x5349=function(){return _0x3dd480;};return a42_0x5349();}import{SDKError,ErrorCode}from'../sdk/index.js';function a42_0x253e(_0x3502dc,_0xfa42ec){_0x3502dc=_0x3502dc-0x171;const _0x53499a=a42_0x5349();let _0x253e1b=_0x53499a[_0x3502dc];return _0x253e1b;}import a42_0x2f8258 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x39a254(0x184)]=a42_0x39a254(0x179);['description']='Update\x20existing\x20child\x20segment';async[a42_0x39a254(0x18f)](_0x460b82){const _0x26e56b=a42_0x39a254;console['error'](a42_0x2f8258[_0x26e56b(0x18d)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a42_0x2f8258[_0x26e56b(0x18d)](_0x26e56b(0x195)));const {options:_0x1ea47c,args:_0x81cb4c,tdx:_0x1cffd3}=_0x460b82,_0x40b5c7=_0x1ea47c;if(_0x81cb4c[_0x26e56b(0x18e)]===0x0)return console[_0x26e56b(0x17f)](_0x26e56b(0x186)),console[_0x26e56b(0x17f)](_0x26e56b(0x19b)),console['error'](_0x26e56b(0x17d)),console['error'](_0x26e56b(0x18a)),console[_0x26e56b(0x17f)](_0x26e56b(0x181)),0x1;const _0x2c8494=_0x81cb4c[0x0],_0x3c4858=_0x1ea47c[_0x26e56b(0x19e)];let _0x504036=_0x2c8494;_0x3c4858&&!_0x2c8494[_0x26e56b(0x187)]('/')&&(_0x504036=_0x3c4858+'/'+_0x2c8494,_0x40b5c7[_0x26e56b(0x18c)]&&console[_0x26e56b(0x17f)](_0x26e56b(0x194)+_0x504036));const _0x19686e=await withSpinner(_0x26e56b(0x193)+_0x504036+_0x26e56b(0x19d),()=>_0x1cffd3[_0x26e56b(0x180)]['resolvePathToResource'](_0x504036),{'verbose':_0x40b5c7['verbose']}),_0x3318c4=_0x19686e[_0x26e56b(0x172)];_0x40b5c7['verbose']&&console[_0x26e56b(0x17f)](_0x26e56b(0x18b)+_0x3318c4[_0x26e56b(0x17c)]);if(_0x3318c4[_0x26e56b(0x17c)]!==_0x26e56b(0x180))return console[_0x26e56b(0x17f)]('Error:\x20Cannot\x20update\x20'+_0x3318c4[_0x26e56b(0x17c)]+_0x26e56b(0x178)),console[_0x26e56b(0x17f)](_0x26e56b(0x19a)),0x1;if(!_0x3318c4[_0x26e56b(0x176)])throw new SDKError(ErrorCode[_0x26e56b(0x19c)],_0x26e56b(0x17e));const _0x3dfcd2=_0x3318c4[_0x26e56b(0x17b)],_0x5520f3=_0x3318c4[_0x26e56b(0x176)];_0x40b5c7[_0x26e56b(0x18c)]&&(console[_0x26e56b(0x17f)](_0x26e56b(0x190)+_0x3dfcd2),console['error'](_0x26e56b(0x19f)+_0x5520f3));let _0x545ada;if(_0x40b5c7[_0x26e56b(0x175)]){const _0xbd538d=_0x40b5c7['folder'],_0xaf3f83=await withSpinner('Resolving\x20folder\x20\x27'+_0xbd538d+'\x27...',()=>_0x1cffd3['segment'][_0x26e56b(0x173)](_0x3dfcd2,_0xbd538d),{'verbose':_0x40b5c7[_0x26e56b(0x18c)]});_0x545ada=parseInt(_0xaf3f83[_0x26e56b(0x172)],0xa),_0x40b5c7['verbose']&&console[_0x26e56b(0x17f)]('Resolved\x20folder\x20ID:\x20'+_0x545ada);}const _0x5ce8ab=await loadJSONFromOptions(_0x40b5c7[_0x26e56b(0x182)],_0x40b5c7[_0x26e56b(0x189)]),_0x4cfec5={'name':_0x40b5c7[_0x26e56b(0x184)],'description':_0x40b5c7['description'],'rule':_0x5ce8ab,'kind':_0x40b5c7['kind']!==undefined?parseInt(_0x40b5c7[_0x26e56b(0x197)],0xa):undefined,'segmentFolderId':_0x545ada},_0xe298c1=await withSpinner(_0x26e56b(0x177)+_0x3318c4[_0x26e56b(0x185)]+_0x26e56b(0x19d),()=>_0x1cffd3[_0x26e56b(0x180)][_0x26e56b(0x196)](_0x3dfcd2,_0x5520f3,_0x4cfec5),{'verbose':_0x40b5c7[_0x26e56b(0x18c)]}),_0x2a7c91=_0xe298c1['data'];return console[_0x26e56b(0x17f)]('✔\x20Updated\x20segment\x20\x27'+_0x2a7c91[_0x26e56b(0x184)]+'\x27'),_0x504036!==_0x2c8494&&console[_0x26e56b(0x17f)]('\x20\x20\x20Path:\x20'+_0x504036),await handleSDKOutput([_0x2a7c91],_0x40b5c7),0x0;}}
1
+ function a42_0xced4(){const _0x26c95f=['description','segment','Resolved\x20folder\x20ID:\x20','Resolved\x20type:\x20','72AxZJUw','228676PqVwhD','segment:update','1602762guLDZK','kind','verbose','folder','Resolving\x20path\x20\x27','6FOGPkD','5930712VmYzjM','segmentId','length','parentId','Parent\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','type','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','565433Aedaoq','error','segmentPath','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','✔\x20Updated\x20segment\x20\x27','yellow','resolvePathToResource','INTERNAL','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','328710pGqIme','name','\x27...','includes','588yeMImW','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20Path:\x20','95TkzWvH','execute','data','6526SRLABJ','Error:\x20Cannot\x20update\x20','8262499pBPhOj','Updating\x20segment\x20\x27','1ZAjeav','Segment\x20ID:\x20','resolveFolderId'];a42_0xced4=function(){return _0x26c95f;};return a42_0xced4();}const a42_0x38cb81=a42_0x2390;(function(_0xda3255,_0xb47c12){const _0x4a1a97=a42_0x2390,_0x49111c=_0xda3255();while(!![]){try{const _0x1b07bf=-parseInt(_0x4a1a97(0xa5))/0x1*(-parseInt(_0x4a1a97(0xa1))/0x2)+-parseInt(_0x4a1a97(0xaf))/0x3+parseInt(_0x4a1a97(0xad))/0x4*(-parseInt(_0x4a1a97(0x9e))/0x5)+-parseInt(_0x4a1a97(0xb4))/0x6*(parseInt(_0x4a1a97(0xa3))/0x7)+parseInt(_0x4a1a97(0xb5))/0x8+-parseInt(_0x4a1a97(0xac))/0x9*(-parseInt(_0x4a1a97(0xc6))/0xa)+parseInt(_0x4a1a97(0xbd))/0xb*(parseInt(_0x4a1a97(0xca))/0xc);if(_0x1b07bf===_0xb47c12)break;else _0x49111c['push'](_0x49111c['shift']());}catch(_0x489bde){_0x49111c['push'](_0x49111c['shift']());}}}(a42_0xced4,0xb11f7));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';import a42_0x2849d3 from'chalk';function a42_0x2390(_0x28496f,_0x51511c){_0x28496f=_0x28496f-0x9c;const _0xced4dc=a42_0xced4();let _0x239053=_0xced4dc[_0x28496f];return _0x239053;}export class SegmentUpdateCommand extends BaseCommand{[a42_0x38cb81(0xc7)]=a42_0x38cb81(0xae);['description']='Update\x20existing\x20child\x20segment';async[a42_0x38cb81(0x9f)](_0x108c74){const _0x3c7add=a42_0x38cb81;console['error'](a42_0x2849d3[_0x3c7add(0xc2)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x3c7add(0xbe)](a42_0x2849d3[_0x3c7add(0xc2)](_0x3c7add(0xba)));const {options:_0x434919,args:_0x264999,tdx:_0x37882f}=_0x108c74,_0x353a18=_0x434919;if(_0x264999[_0x3c7add(0xb7)]===0x0)return console[_0x3c7add(0xbe)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x3c7add(0xbc)),console[_0x3c7add(0xbe)]('Examples:'),console[_0x3c7add(0xbe)](_0x3c7add(0xc0)),console[_0x3c7add(0xbe)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x279e50=_0x264999[0x0],_0x2dcbe4=_0x434919[_0x3c7add(0xbf)];let _0x515e46=_0x279e50;_0x2dcbe4&&!_0x279e50[_0x3c7add(0xc9)]('/')&&(_0x515e46=_0x2dcbe4+'/'+_0x279e50,_0x353a18[_0x3c7add(0xb1)]&&console[_0x3c7add(0xbe)]('Resolved\x20relative\x20path\x20to:\x20'+_0x515e46));const _0x5b6252=await withSpinner(_0x3c7add(0xb3)+_0x515e46+_0x3c7add(0xc8),()=>_0x37882f[_0x3c7add(0xa9)][_0x3c7add(0xc3)](_0x515e46),{'verbose':_0x353a18[_0x3c7add(0xb1)]}),_0xf6fd37=_0x5b6252[_0x3c7add(0xa0)];_0x353a18[_0x3c7add(0xb1)]&&console['error'](_0x3c7add(0xab)+_0xf6fd37[_0x3c7add(0xbb)]);if(_0xf6fd37[_0x3c7add(0xbb)]!==_0x3c7add(0xa9))return console[_0x3c7add(0xbe)](_0x3c7add(0xa2)+_0xf6fd37[_0x3c7add(0xbb)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x3c7add(0xbe)](_0x3c7add(0xc5)),0x1;if(!_0xf6fd37[_0x3c7add(0xb6)])throw new SDKError(ErrorCode[_0x3c7add(0xc4)],_0x3c7add(0x9c));const _0x3fdaca=_0xf6fd37[_0x3c7add(0xb8)],_0x3328c1=_0xf6fd37[_0x3c7add(0xb6)];_0x353a18[_0x3c7add(0xb1)]&&(console[_0x3c7add(0xbe)](_0x3c7add(0xb9)+_0x3fdaca),console['error'](_0x3c7add(0xa6)+_0x3328c1));let _0x253844;if(_0x353a18[_0x3c7add(0xb2)]){const _0x4edd91=_0x353a18[_0x3c7add(0xb2)],_0x31d5b1=await withSpinner('Resolving\x20folder\x20\x27'+_0x4edd91+_0x3c7add(0xc8),()=>_0x37882f['segment'][_0x3c7add(0xa7)](_0x3fdaca,_0x4edd91),{'verbose':_0x353a18[_0x3c7add(0xb1)]});_0x253844=parseInt(_0x31d5b1[_0x3c7add(0xa0)],0xa),_0x353a18[_0x3c7add(0xb1)]&&console[_0x3c7add(0xbe)](_0x3c7add(0xaa)+_0x253844);}const _0x1dad22=await loadJSONFromOptions(_0x353a18['rule'],_0x353a18['ruleFile']),_0x8ab9c6={'name':_0x353a18[_0x3c7add(0xc7)],'description':_0x353a18[_0x3c7add(0xa8)],'rule':_0x1dad22,'kind':_0x353a18[_0x3c7add(0xb0)]!==undefined?parseInt(_0x353a18[_0x3c7add(0xb0)],0xa):undefined,'segmentFolderId':_0x253844},_0x47cc9c=await withSpinner(_0x3c7add(0xa4)+_0xf6fd37['segmentName']+_0x3c7add(0xc8),()=>_0x37882f[_0x3c7add(0xa9)]['updateSegmentById'](_0x3fdaca,_0x3328c1,_0x8ab9c6),{'verbose':_0x353a18[_0x3c7add(0xb1)]}),_0x58fbde=_0x47cc9c[_0x3c7add(0xa0)];return console[_0x3c7add(0xbe)](_0x3c7add(0xc1)+_0x58fbde[_0x3c7add(0xc7)]+'\x27'),_0x515e46!==_0x279e50&&console[_0x3c7add(0xbe)](_0x3c7add(0x9d)+_0x515e46),await handleSDKOutput([_0x58fbde],_0x353a18),0x0;}}
@@ -1 +1 @@
1
- const a43_0x37da33=a43_0xa95f;function a43_0xa95f(_0x311612,_0x147f8d){_0x311612=_0x311612-0x120;const _0x551b54=a43_0x551b();let _0xa95fba=_0x551b54[_0x311612];return _0xa95fba;}(function(_0x4380d4,_0x2eaeef){const _0x4555dd=a43_0xa95f,_0xa7d1bb=_0x4380d4();while(!![]){try{const _0x58347e=parseInt(_0x4555dd(0x12f))/0x1+-parseInt(_0x4555dd(0x155))/0x2+parseInt(_0x4555dd(0x14d))/0x3*(-parseInt(_0x4555dd(0x132))/0x4)+-parseInt(_0x4555dd(0x12d))/0x5*(-parseInt(_0x4555dd(0x130))/0x6)+parseInt(_0x4555dd(0x135))/0x7*(parseInt(_0x4555dd(0x13d))/0x8)+-parseInt(_0x4555dd(0x15d))/0x9*(-parseInt(_0x4555dd(0x126))/0xa)+-parseInt(_0x4555dd(0x124))/0xb*(-parseInt(_0x4555dd(0x157))/0xc);if(_0x58347e===_0x2eaeef)break;else _0xa7d1bb['push'](_0xa7d1bb['shift']());}catch(_0x24e67b){_0xa7d1bb['push'](_0xa7d1bb['shift']());}}}(a43_0x551b,0x1d8ab));import{existsSync,statSync}from'fs';import a43_0x16e0c6 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a43_0x551b(){const _0x45ded5=['Resolving\x20path\x20\x27','config','site','9edjJjH','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Resolved\x20path\x20type:\x20','folderPath','parentName','1667897mecawz','description','875890joJPuU','data','fullPath','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Usage:\x20tdx\x20segment\x20use\x20<path>','\x27...','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','17090HCwzNt','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','775iUngHT','12OILjmQ','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','86148qwPUKk','isAbsolute','dim','119YToBKh','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','segment','Folder\x20ID:\x20','✔\x20Context\x20set\x20to:\x20','segmentPath','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','name','15656htDqiJ','isDirectory','Examples:','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','green','log','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','cyan','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','length','type','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','verbose','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Target\x20path:\x20','6oypuhO','session','resolvePathToResource','Error:\x20Path\x20is\x20required\x0a','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Resolved\x20relative\x20path\x20to:\x20','error','folderId','232038jmesuk','join','12dvZbPY','slice','red'];a43_0x551b=function(){return _0x45ded5;};return a43_0x551b();}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x37da33(0x13c)]='segment:use';[a43_0x37da33(0x125)]=a43_0x37da33(0x12c);async['execute'](_0x138a9c){const _0x5e4948=a43_0x37da33,{options:_0x390e71,args:_0x5e42e0,tdx:_0x2e18e3}=_0x138a9c;if(_0x5e42e0['length']===0x0)return console[_0x5e4948(0x153)](a43_0x16e0c6['red'](_0x5e4948(0x150))),console[_0x5e4948(0x153)](_0x5e4948(0x12a)),console['error'](_0x5e4948(0x13f)),console['error'](_0x5e4948(0x149)),console[_0x5e4948(0x153)](_0x5e4948(0x151)),console[_0x5e4948(0x153)](_0x5e4948(0x131)),console[_0x5e4948(0x153)](_0x5e4948(0x13b)),0x1;const _0x1c8c72=_0x5e42e0[0x0],_0x27df83=_0x390e71[_0x5e4948(0x14e)];try{if(_0x1c8c72==='/')return saveSessionContext({'segment_path':undefined},_0x27df83),console[_0x5e4948(0x142)](a43_0x16e0c6[_0x5e4948(0x141)](_0x5e4948(0x144))),0x0;if(existsSync(_0x1c8c72)&&statSync(_0x1c8c72)[_0x5e4948(0x13e)]()){let _0x3c676d;try{_0x3c676d=findTdxConfig(_0x1c8c72);}catch{return console[_0x5e4948(0x153)](a43_0x16e0c6[_0x5e4948(0x159)](_0x5e4948(0x12e)+_0x1c8c72)),console['error'](a43_0x16e0c6[_0x5e4948(0x145)](_0x5e4948(0x143))),0x1;}const _0x514d78=_0x3c676d[_0x5e4948(0x15b)]['parent_segment'];return saveSessionContext({'segment_path':_0x514d78,'parent_segment':_0x514d78},_0x27df83),console[_0x5e4948(0x142)](a43_0x16e0c6['green']('✔\x20Context\x20set\x20to:\x20'+a43_0x16e0c6[_0x5e4948(0x145)](_0x514d78))),0x0;}const _0x2657c5=_0x390e71[_0x5e4948(0x13a)];let _0x283c33=_0x1c8c72;const _0x44bbf9=parsePath(_0x1c8c72);if(!_0x44bbf9[_0x5e4948(0x133)]){if(!_0x2657c5)return console['error'](a43_0x16e0c6[_0x5e4948(0x159)](_0x5e4948(0x14b))),console['error'](a43_0x16e0c6[_0x5e4948(0x145)](_0x5e4948(0x140))),0x1;if(_0x1c8c72==='..'){const _0x311855=_0x2657c5['split']('/')[_0x5e4948(0x158)](0x0,-0x1)[_0x5e4948(0x156)]('/');_0x283c33=_0x311855||'/';}else _0x1c8c72==='.'?_0x283c33=_0x2657c5:_0x283c33=_0x2657c5+'/'+_0x1c8c72;_0x390e71['verbose']&&console[_0x5e4948(0x153)](_0x5e4948(0x152)+_0x283c33);}if(_0x283c33==='/'||_0x283c33==='')return saveSessionContext({'segment_path':undefined},_0x27df83),console[_0x5e4948(0x142)](a43_0x16e0c6[_0x5e4948(0x141)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x283c33=normalizePath(_0x283c33);const _0x3cd3ea=parsePath(_0x283c33)['segments'];if(_0x3cd3ea[_0x5e4948(0x147)]===0x0)return saveSessionContext({'segment_path':undefined},_0x27df83),console[_0x5e4948(0x142)](a43_0x16e0c6[_0x5e4948(0x141)](_0x5e4948(0x144))),0x0;_0x390e71[_0x5e4948(0x14a)]&&(console[_0x5e4948(0x153)]('Site:\x20'+_0x390e71[_0x5e4948(0x15c)]),console[_0x5e4948(0x153)](_0x5e4948(0x14c)+_0x283c33));const _0x210531=await withSpinner(_0x5e4948(0x15a)+_0x283c33+_0x5e4948(0x12b),()=>_0x2e18e3['segment'][_0x5e4948(0x14f)](_0x283c33),{'verbose':_0x390e71[_0x5e4948(0x14a)]}),_0x531c4e=_0x210531[_0x5e4948(0x127)];_0x390e71['verbose']&&(console[_0x5e4948(0x153)](_0x5e4948(0x121)+_0x531c4e[_0x5e4948(0x148)]),console[_0x5e4948(0x153)]('Parent\x20ID:\x20'+_0x531c4e['parentId']),_0x531c4e[_0x5e4948(0x154)]&&console[_0x5e4948(0x153)](_0x5e4948(0x138)+_0x531c4e[_0x5e4948(0x154)]));if(_0x531c4e[_0x5e4948(0x148)]===_0x5e4948(0x137))return console[_0x5e4948(0x153)](a43_0x16e0c6[_0x5e4948(0x159)](_0x5e4948(0x129))),console[_0x5e4948(0x153)](_0x5e4948(0x146)),console[_0x5e4948(0x153)](a43_0x16e0c6[_0x5e4948(0x145)]('Use:\x20tdx\x20segment\x20use\x20'+_0x531c4e[_0x5e4948(0x123)]+(_0x531c4e[_0x5e4948(0x122)]?'/'+_0x531c4e[_0x5e4948(0x122)][_0x5e4948(0x156)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x531c4e['fullPath'],'parent_segment':_0x531c4e[_0x5e4948(0x123)]},_0x27df83),console['log'](a43_0x16e0c6[_0x5e4948(0x141)](_0x5e4948(0x139)+a43_0x16e0c6[_0x5e4948(0x145)](_0x531c4e[_0x5e4948(0x128)]))),_0x390e71['verbose']&&(console[_0x5e4948(0x153)](a43_0x16e0c6[_0x5e4948(0x134)](_0x5e4948(0x120))),console[_0x5e4948(0x153)](a43_0x16e0c6[_0x5e4948(0x134)](_0x5e4948(0x136)))),0x0;}catch(_0x17d254){throw _0x17d254;}}}
1
+ const a43_0x1edf78=a43_0x2173;(function(_0x1881f4,_0x2157a9){const _0x200b0f=a43_0x2173,_0x42995a=_0x1881f4();while(!![]){try{const _0x4d2cc3=parseInt(_0x200b0f(0x1ff))/0x1+parseInt(_0x200b0f(0x205))/0x2+-parseInt(_0x200b0f(0x1fb))/0x3+-parseInt(_0x200b0f(0x21a))/0x4*(parseInt(_0x200b0f(0x216))/0x5)+parseInt(_0x200b0f(0x1fc))/0x6*(parseInt(_0x200b0f(0x212))/0x7)+-parseInt(_0x200b0f(0x1f1))/0x8*(-parseInt(_0x200b0f(0x20f))/0x9)+parseInt(_0x200b0f(0x208))/0xa*(parseInt(_0x200b0f(0x222))/0xb);if(_0x4d2cc3===_0x2157a9)break;else _0x42995a['push'](_0x42995a['shift']());}catch(_0x103d69){_0x42995a['push'](_0x42995a['shift']());}}}(a43_0x1bbc,0xd7c4f));import{existsSync,statSync}from'fs';import a43_0x5d0b9e from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0x2173(_0x10ae4a,_0x1f17e1){_0x10ae4a=_0x10ae4a-0x1ef;const _0x1bbc55=a43_0x1bbc();let _0x21732f=_0x1bbc55[_0x10ae4a];return _0x21732f;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a43_0x1bbc(){const _0x443da9=['Folder\x20ID:\x20','length','join','\x27...','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','4483959NBtkxq','1380kXGiej','name','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','1002807ZACPas','segment','isAbsolute','type','split','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','1950954ZVkcVU','segmentPath','folderId','173100mEuuTG','red','session','Error:\x20Path\x20is\x20required\x0a','parentName','cyan','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','9MIHpuT','green','isDirectory','16177tHcBQM','✔\x20Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','fullPath','8783205AdvVtW','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Usage:\x20tdx\x20segment\x20use\x20<path>','parentId','4twmvkM','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','log','config','folderPath','verbose','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Examples:','22yWYpri','segment:use','slice','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','error','execute','12725208frJaFj','dim','description','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'];a43_0x1bbc=function(){return _0x443da9;};return a43_0x1bbc();}export class SegmentUseCommand extends BaseCommand{[a43_0x1edf78(0x1fd)]=a43_0x1edf78(0x223);[a43_0x1edf78(0x1f3)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a43_0x1edf78(0x1f0)](_0xb6443a){const _0x574005=a43_0x1edf78,{options:_0x45f105,args:_0x4f6365,tdx:_0x1d1edf}=_0xb6443a;if(_0x4f6365[_0x574005(0x1f6)]===0x0)return console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x209)](_0x574005(0x20b))),console['error'](_0x574005(0x218)),console[_0x574005(0x1ef)](_0x574005(0x221)),console[_0x574005(0x1ef)](_0x574005(0x1f9)),console[_0x574005(0x1ef)](_0x574005(0x1fe)),console[_0x574005(0x1ef)](_0x574005(0x214)),console[_0x574005(0x1ef)](_0x574005(0x217)),0x1;const _0x5e8fc9=_0x4f6365[0x0],_0x427c95=_0x45f105[_0x574005(0x20a)];try{if(_0x5e8fc9==='/')return saveSessionContext({'segment_path':undefined},_0x427c95),console[_0x574005(0x21c)](a43_0x5d0b9e['green'](_0x574005(0x20e))),0x0;if(existsSync(_0x5e8fc9)&&statSync(_0x5e8fc9)[_0x574005(0x211)]()){let _0x528274;try{_0x528274=findTdxConfig(_0x5e8fc9);}catch{return console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x209)](_0x574005(0x21b)+_0x5e8fc9)),console[_0x574005(0x1ef)](a43_0x5d0b9e['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x5ba7d0=_0x528274[_0x574005(0x21d)]['parent_segment'];return saveSessionContext({'segment_path':_0x5ba7d0,'parent_segment':_0x5ba7d0},_0x427c95),console['log'](a43_0x5d0b9e['green'](_0x574005(0x213)+a43_0x5d0b9e[_0x574005(0x20d)](_0x5ba7d0))),0x0;}const _0x3f7925=_0x45f105[_0x574005(0x206)];let _0x3ad885=_0x5e8fc9;const _0xe7f909=parsePath(_0x5e8fc9);if(!_0xe7f909[_0x574005(0x201)]){if(!_0x3f7925)return console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x209)](_0x574005(0x1fa))),console['error'](a43_0x5d0b9e['cyan'](_0x574005(0x220))),0x1;if(_0x5e8fc9==='..'){const _0x536474=_0x3f7925[_0x574005(0x203)]('/')[_0x574005(0x224)](0x0,-0x1)[_0x574005(0x1f7)]('/');_0x3ad885=_0x536474||'/';}else _0x5e8fc9==='.'?_0x3ad885=_0x3f7925:_0x3ad885=_0x3f7925+'/'+_0x5e8fc9;_0x45f105[_0x574005(0x21f)]&&console['error'](_0x574005(0x226)+_0x3ad885);}if(_0x3ad885==='/'||_0x3ad885==='')return saveSessionContext({'segment_path':undefined},_0x427c95),console[_0x574005(0x21c)](a43_0x5d0b9e[_0x574005(0x210)](_0x574005(0x20e))),0x0;_0x3ad885=normalizePath(_0x3ad885);const _0x25d3b2=parsePath(_0x3ad885)['segments'];if(_0x25d3b2[_0x574005(0x1f6)]===0x0)return saveSessionContext({'segment_path':undefined},_0x427c95),console['log'](a43_0x5d0b9e[_0x574005(0x210)](_0x574005(0x20e))),0x0;_0x45f105[_0x574005(0x21f)]&&(console[_0x574005(0x1ef)]('Site:\x20'+_0x45f105['site']),console[_0x574005(0x1ef)]('Target\x20path:\x20'+_0x3ad885));const _0x45f180=await withSpinner('Resolving\x20path\x20\x27'+_0x3ad885+_0x574005(0x1f8),()=>_0x1d1edf[_0x574005(0x200)][_0x574005(0x225)](_0x3ad885),{'verbose':_0x45f105[_0x574005(0x21f)]}),_0x1e9157=_0x45f180['data'];_0x45f105[_0x574005(0x21f)]&&(console[_0x574005(0x1ef)]('Resolved\x20path\x20type:\x20'+_0x1e9157[_0x574005(0x202)]),console[_0x574005(0x1ef)]('Parent\x20ID:\x20'+_0x1e9157[_0x574005(0x219)]),_0x1e9157[_0x574005(0x207)]&&console[_0x574005(0x1ef)](_0x574005(0x1f5)+_0x1e9157[_0x574005(0x207)]));if(_0x1e9157[_0x574005(0x202)]===_0x574005(0x200))return console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x209)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x574005(0x1ef)](_0x574005(0x204)),console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x20d)]('Use:\x20tdx\x20segment\x20use\x20'+_0x1e9157['parentName']+(_0x1e9157[_0x574005(0x21e)]?'/'+_0x1e9157['folderPath'][_0x574005(0x1f7)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1e9157['fullPath'],'parent_segment':_0x1e9157[_0x574005(0x20c)]},_0x427c95),console[_0x574005(0x21c)](a43_0x5d0b9e['green'](_0x574005(0x213)+a43_0x5d0b9e[_0x574005(0x20d)](_0x1e9157[_0x574005(0x215)]))),_0x45f105['verbose']&&(console[_0x574005(0x1ef)](a43_0x5d0b9e[_0x574005(0x1f2)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console['error'](a43_0x5d0b9e[_0x574005(0x1f2)](_0x574005(0x1f4)))),0x0;}catch(_0x3df6d2){throw _0x3df6d2;}}}
@@ -1 +1 @@
1
- const a44_0xb51e7=a44_0x60c5;(function(_0x5829dc,_0x169859){const _0x1376ae=a44_0x60c5,_0x2caa35=_0x5829dc();while(!![]){try{const _0x56ddff=-parseInt(_0x1376ae(0x1b3))/0x1+-parseInt(_0x1376ae(0x1cc))/0x2*(parseInt(_0x1376ae(0x1d6))/0x3)+-parseInt(_0x1376ae(0x1e0))/0x4+-parseInt(_0x1376ae(0x1c6))/0x5+-parseInt(_0x1376ae(0x1c3))/0x6*(-parseInt(_0x1376ae(0x1d3))/0x7)+-parseInt(_0x1376ae(0x1bb))/0x8*(parseInt(_0x1376ae(0x1b6))/0x9)+-parseInt(_0x1376ae(0x1c5))/0xa*(-parseInt(_0x1376ae(0x1c9))/0xb);if(_0x56ddff===_0x169859)break;else _0x2caa35['push'](_0x2caa35['shift']());}catch(_0x34a769){_0x2caa35['push'](_0x2caa35['shift']());}}}(a44_0x4ddc,0xd60d3));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a44_0x60c5(_0x236a85,_0x4a2da7){_0x236a85=_0x236a85-0x1b1;const _0x4ddc32=a44_0x4ddc();let _0x60c53f=_0x4ddc32[_0x236a85];return _0x60c53f;}import{existsSync}from'fs';import a44_0x30d512 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a44_0x4ddc(){const _0x4b9757=['\x20warning(s)\x20found','targetDir','9qboDek','\x20file(s)\x20with\x20errors,\x20','\x20error(s)','file','execute','4096048jEjtHD','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','yellow','valid','red','\x20valid','length','\x20warning(s)','66IKIxXJ','endsWith','39690700cKNQJl','6022505mSmKCh','log','warnings','11eqlCaR','type','validCount','4jZEwsl','error','dim','helpText','cyan','filePath','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','783930VIcDgi','message','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','1341303gpNrQw','warningCount','.yml','invalidCount','segment:validate','\x20file(s)\x20valid','errors','green','description','.yaml','5828672mCYdvE','Error:\x20Directory\x20not\x20found:\x20','):\x20','no_parent','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','256328mVAldF'];a44_0x4ddc=function(){return _0x4b9757;};return a44_0x4ddc();}export class SegmentValidateCommand extends BaseCommand{['name']=a44_0xb51e7(0x1da);[a44_0xb51e7(0x1de)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a44_0xb51e7(0x1ba)](_0x212832){const _0x3bb27c=a44_0xb51e7,{options:_0x3430d0,args:_0x182fec}=_0x212832,_0x2f10c2=_0x3430d0,_0x3f0b25=await resolveTarget({'arg':_0x182fec[0x0],'contextParent':_0x3430d0['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3f0b25))return _0x3f0b25['errorCode']===_0x3bb27c(0x1b1)?(console['error'](a44_0x30d512[_0x3bb27c(0x1bd)](_0x3bb27c(0x1d5))),console[_0x3bb27c(0x1cd)](_0x3bb27c(0x1d2)),console[_0x3bb27c(0x1cd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console['error'](_0x3bb27c(0x1bc))):(console['error'](a44_0x30d512[_0x3bb27c(0x1bf)]('Error:\x20'+_0x3f0b25[_0x3bb27c(0x1d4)]+'\x0a')),_0x3f0b25[_0x3bb27c(0x1cf)]&&console['error'](a44_0x30d512[_0x3bb27c(0x1d0)](_0x3f0b25[_0x3bb27c(0x1cf)]))),0x1;const _0x356e36=_0x3f0b25[_0x3bb27c(0x1b5)],_0x1a159c=_0x3f0b25[_0x3bb27c(0x1ca)]===_0x3bb27c(0x1b9)?_0x3f0b25[_0x3bb27c(0x1d1)]:undefined;if(!_0x1a159c&&!existsSync(_0x356e36))return console[_0x3bb27c(0x1cd)](a44_0x30d512[_0x3bb27c(0x1bf)](_0x3bb27c(0x1e1)+_0x356e36+'\x0a')),0x1;let _0x970cdb;if(_0x1a159c){if(!_0x1a159c[_0x3bb27c(0x1c4)](_0x3bb27c(0x1d8))&&!_0x1a159c[_0x3bb27c(0x1c4)](_0x3bb27c(0x1df)))return console[_0x3bb27c(0x1cd)](a44_0x30d512[_0x3bb27c(0x1bf)](_0x3bb27c(0x1b2)+_0x1a159c+'\x0a')),0x1;_0x970cdb=[_0x1a159c];}else _0x970cdb=findYamlFiles(_0x356e36);if(_0x970cdb['length']===0x0)return console[_0x3bb27c(0x1cd)](a44_0x30d512[_0x3bb27c(0x1bf)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x356e36+'\x0a')),0x1;const _0x4bb0b0=validateYamlFiles(_0x970cdb,_0x356e36),_0x283928=calculateSummary(_0x4bb0b0);for(const _0x3d2333 of _0x4bb0b0){if(!isValidationResult(_0x3d2333))continue;const {relativePath:_0x427655,source:_0x5470ea,result:_0x28776f,fileType:_0x5b0265}=_0x3d2333,_0xbcd008=_0x5b0265;if(_0x28776f[_0x3bb27c(0x1be)]&&_0x28776f[_0x3bb27c(0x1c8)]['length']===0x0)_0x2f10c2['verbose']&&console[_0x3bb27c(0x1c7)](a44_0x30d512['green']('✔\x20'+_0x427655)+a44_0x30d512[_0x3bb27c(0x1ce)]('\x20('+_0xbcd008+')'));else _0x28776f[_0x3bb27c(0x1be)]?(console[_0x3bb27c(0x1c7)](a44_0x30d512[_0x3bb27c(0x1bd)]('⚠\x20'+_0x427655)+a44_0x30d512['dim']('\x20('+_0xbcd008+_0x3bb27c(0x1e2)+_0x28776f['warnings'][_0x3bb27c(0x1c1)]+_0x3bb27c(0x1c2))),console[_0x3bb27c(0x1c7)](formatValidationResult(_0x28776f,_0x5470ea,_0x427655))):(console[_0x3bb27c(0x1c7)](a44_0x30d512[_0x3bb27c(0x1bf)]('✖\x20'+_0x427655)+a44_0x30d512[_0x3bb27c(0x1ce)]('\x20('+_0xbcd008+'):\x20'+_0x28776f[_0x3bb27c(0x1dc)][_0x3bb27c(0x1c1)]+_0x3bb27c(0x1b8))),console[_0x3bb27c(0x1c7)](formatValidationResult(_0x28776f,_0x5470ea,_0x427655)));}return console[_0x3bb27c(0x1c7)](''),_0x283928['hasErrors']?(console[_0x3bb27c(0x1c7)](a44_0x30d512[_0x3bb27c(0x1bf)]('Validation\x20failed:\x20'+_0x283928[_0x3bb27c(0x1d9)]+_0x3bb27c(0x1b7)+_0x283928[_0x3bb27c(0x1cb)]+_0x3bb27c(0x1c0))),_0x283928[_0x3bb27c(0x1d7)]>0x0&&console[_0x3bb27c(0x1c7)](a44_0x30d512[_0x3bb27c(0x1bd)](_0x283928[_0x3bb27c(0x1d7)]+'\x20warning(s)\x20found')),0x1):(console[_0x3bb27c(0x1c7)](a44_0x30d512[_0x3bb27c(0x1dd)]('✔\x20All\x20'+_0x283928['validCount']+_0x3bb27c(0x1db))),_0x283928[_0x3bb27c(0x1d7)]>0x0&&console[_0x3bb27c(0x1c7)](a44_0x30d512[_0x3bb27c(0x1bd)](_0x283928[_0x3bb27c(0x1d7)]+_0x3bb27c(0x1b4))),0x0);}}
1
+ const a44_0x4a8205=a44_0x4f88;(function(_0x5de3a0,_0x7bcde5){const _0x2f2064=a44_0x4f88,_0x264087=_0x5de3a0();while(!![]){try{const _0x2b5a24=parseInt(_0x2f2064(0xde))/0x1*(parseInt(_0x2f2064(0xd7))/0x2)+-parseInt(_0x2f2064(0xe2))/0x3+parseInt(_0x2f2064(0xfb))/0x4*(-parseInt(_0x2f2064(0xf4))/0x5)+-parseInt(_0x2f2064(0xfd))/0x6+parseInt(_0x2f2064(0x100))/0x7*(-parseInt(_0x2f2064(0xe8))/0x8)+-parseInt(_0x2f2064(0xda))/0x9+parseInt(_0x2f2064(0xd4))/0xa*(parseInt(_0x2f2064(0x103))/0xb);if(_0x2b5a24===_0x7bcde5)break;else _0x264087['push'](_0x264087['shift']());}catch(_0x38c7cc){_0x264087['push'](_0x264087['shift']());}}}(a44_0x3da6,0x51de7));function a44_0x4f88(_0x297655,_0x47fdba){_0x297655=_0x297655-0xd4;const _0x3da6db=a44_0x3da6();let _0x4f888b=_0x3da6db[_0x297655];return _0x4f888b;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x480bc4 from'chalk';function a44_0x3da6(){const _0x397a1a=['Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','2264nNxFQI','message','yellow','log','invalidCount','segment:validate','helpText','parentSegment','\x20file(s)\x20with\x20errors,\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','Validation\x20failed:\x20','green','408190UfsBbE','endsWith','):\x20','errorCode','cyan','validCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','8dwqRBg','warnings','2273100PZLsJv','warningCount','✔\x20All\x20','9478yunSNo','cwd','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','15719374qtyubY','\x20file(s)\x20valid','Validate\x20segment\x20and\x20journey\x20YAML\x20files','hasErrors','10oBigKY','verbose','file','2MWrZgx','red','no_parent','1714941dTLrzy','\x20warning(s)\x20found','error','Error:\x20Directory\x20not\x20found:\x20','51713vYKlZs','execute','type','description','88665ptpjxP','targetDir','dim','.yml','length'];a44_0x3da6=function(){return _0x397a1a;};return a44_0x3da6();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x4a8205(0xed);[a44_0x4a8205(0xe1)]=a44_0x4a8205(0x105);async[a44_0x4a8205(0xdf)](_0x110171){const _0x3691a8=a44_0x4a8205,{options:_0x45721d,args:_0x109320}=_0x110171,_0x250c6d=_0x45721d,_0x4ff6ef=await resolveTarget({'arg':_0x109320[0x0],'contextParent':_0x45721d[_0x3691a8(0xef)],'cwd':process[_0x3691a8(0x101)]()});if(!isSuccessfulResolution(_0x4ff6ef))return _0x4ff6ef[_0x3691a8(0xf7)]===_0x3691a8(0xd9)?(console['error'](a44_0x480bc4['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3691a8(0xdc)](_0x3691a8(0xe7)),console[_0x3691a8(0xdc)](_0x3691a8(0xf1)),console[_0x3691a8(0xdc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x3691a8(0xdc)](a44_0x480bc4[_0x3691a8(0xd8)]('Error:\x20'+_0x4ff6ef[_0x3691a8(0xe9)]+'\x0a')),_0x4ff6ef[_0x3691a8(0xee)]&&console[_0x3691a8(0xdc)](a44_0x480bc4[_0x3691a8(0xf8)](_0x4ff6ef['helpText']))),0x1;const _0x158113=_0x4ff6ef[_0x3691a8(0xe3)],_0x5fc5ff=_0x4ff6ef[_0x3691a8(0xe0)]===_0x3691a8(0xd6)?_0x4ff6ef['filePath']:undefined;if(!_0x5fc5ff&&!existsSync(_0x158113))return console[_0x3691a8(0xdc)](a44_0x480bc4[_0x3691a8(0xd8)](_0x3691a8(0xdd)+_0x158113+'\x0a')),0x1;let _0x442f9f;if(_0x5fc5ff){if(!_0x5fc5ff['endsWith'](_0x3691a8(0xe5))&&!_0x5fc5ff[_0x3691a8(0xf5)]('.yaml'))return console[_0x3691a8(0xdc)](a44_0x480bc4[_0x3691a8(0xd8)](_0x3691a8(0x102)+_0x5fc5ff+'\x0a')),0x1;_0x442f9f=[_0x5fc5ff];}else _0x442f9f=findYamlFiles(_0x158113);if(_0x442f9f[_0x3691a8(0xe6)]===0x0)return console[_0x3691a8(0xdc)](a44_0x480bc4['red'](_0x3691a8(0xfa)+_0x158113+'\x0a')),0x1;const _0x2a237e=validateYamlFiles(_0x442f9f,_0x158113),_0x526c3d=calculateSummary(_0x2a237e);for(const _0xbb76c8 of _0x2a237e){if(!isValidationResult(_0xbb76c8))continue;const {relativePath:_0x58f0d3,source:_0x301d2c,result:_0x295e8a,fileType:_0x1e2906}=_0xbb76c8,_0x947429=_0x1e2906;if(_0x295e8a['valid']&&_0x295e8a[_0x3691a8(0xfc)][_0x3691a8(0xe6)]===0x0)_0x250c6d[_0x3691a8(0xd5)]&&console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xf3)]('✔\x20'+_0x58f0d3)+a44_0x480bc4['dim']('\x20('+_0x947429+')'));else _0x295e8a['valid']?(console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xea)]('⚠\x20'+_0x58f0d3)+a44_0x480bc4[_0x3691a8(0xe4)]('\x20('+_0x947429+'):\x20'+_0x295e8a[_0x3691a8(0xfc)][_0x3691a8(0xe6)]+'\x20warning(s)')),console[_0x3691a8(0xeb)](formatValidationResult(_0x295e8a,_0x301d2c,_0x58f0d3))):(console['log'](a44_0x480bc4['red']('✖\x20'+_0x58f0d3)+a44_0x480bc4[_0x3691a8(0xe4)]('\x20('+_0x947429+_0x3691a8(0xf6)+_0x295e8a['errors'][_0x3691a8(0xe6)]+'\x20error(s)')),console[_0x3691a8(0xeb)](formatValidationResult(_0x295e8a,_0x301d2c,_0x58f0d3)));}return console[_0x3691a8(0xeb)](''),_0x526c3d[_0x3691a8(0x106)]?(console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xd8)](_0x3691a8(0xf2)+_0x526c3d[_0x3691a8(0xec)]+_0x3691a8(0xf0)+_0x526c3d[_0x3691a8(0xf9)]+'\x20valid')),_0x526c3d[_0x3691a8(0xfe)]>0x0&&console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xea)](_0x526c3d[_0x3691a8(0xfe)]+_0x3691a8(0xdb))),0x1):(console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xf3)](_0x3691a8(0xff)+_0x526c3d[_0x3691a8(0xf9)]+_0x3691a8(0x104))),_0x526c3d[_0x3691a8(0xfe)]>0x0&&console[_0x3691a8(0xeb)](a44_0x480bc4[_0x3691a8(0xea)](_0x526c3d[_0x3691a8(0xfe)]+_0x3691a8(0xdb))),0x0);}}
@@ -1 +1 @@
1
- function a45_0x1913(_0x23526d,_0x7c1637){_0x23526d=_0x23526d-0x6d;const _0x50e92d=a45_0x50e9();let _0x191330=_0x50e92d[_0x23526d];return _0x191330;}const a45_0x48df88=a45_0x1913;(function(_0x582cb4,_0x18387b){const _0x473617=a45_0x1913,_0x38dc5c=_0x582cb4();while(!![]){try{const _0x4de33a=parseInt(_0x473617(0x97))/0x1+parseInt(_0x473617(0xaa))/0x2+parseInt(_0x473617(0x79))/0x3*(parseInt(_0x473617(0xa3))/0x4)+parseInt(_0x473617(0xb2))/0x5+parseInt(_0x473617(0xac))/0x6+parseInt(_0x473617(0x92))/0x7+-parseInt(_0x473617(0xaf))/0x8;if(_0x4de33a===_0x18387b)break;else _0x38dc5c['push'](_0x38dc5c['shift']());}catch(_0x46fb74){_0x38dc5c['push'](_0x38dc5c['shift']());}}}(a45_0x50e9,0x3210b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x50e9(){const _0x45f4a6=['dim','listUnifiedWithJourneys','verbose','error','Building\x20hierarchy\x20tree...','\x20folder','No\x20items\x20match\x20pattern:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','listWithPattern','\x20\x20Cause:\x20','segment','filter','name','39DQjSvO','/e/','Folder\x20ID:\x20','resolvePathToResource','(not\x20set)','jsonl','localeCompare','message','✔\x20Found\x20','/j/da','Recursive\x20mode:\x20enabled','cause','journeys','format','/app/ps/',',\x20and\x20','includes','data','type','Set\x20a\x20parent\x20segment\x20context\x20first:','Resolving\x20parent\x20segment\x20\x27','Error:\x20','length','log','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','1232490CFDfBu','json','\x27...','test','listRecursive','362861CjNrhl','site','segments','\x20matching\x20\x27','listUnified','\x20segment','maxDepth','map','journey','execute','folderId','sort','580oscRip','children','Listing\x20folders,\x20segments,\x20and\x20journeys...','Parent\x20ID:\x20','journeyBundleName','folder','(empty)','384554ohUFBe','description','2459070LElkPV','\x20journey',']\x20matching\x20\x27','9522320fjtWpd','parentId','Resolving\x20path\x20\x27','1262095TZkQXZ','folders','replace'];a45_0x50e9=function(){return _0x45f4a6;};return a45_0x50e9();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x22f336 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x48df88(0x78)]=a45_0x48df88(0x99);[a45_0x48df88(0xab)]='List\x20folders\x20and\x20child\x20segments';async[a45_0x48df88(0xa0)](_0x54edf8){const _0x3a17e9=a45_0x48df88,{options:_0x427e24,args:_0x283dac}=_0x54edf8,_0x4bddd5=_0x427e24['recursive'],_0x3f9a28=_0x283dac[0x0];try{const _0x2cca88=_0x427e24['parentSegment'];_0x427e24[_0x3a17e9(0x6e)]&&(console['error']('Site:\x20'+_0x427e24['site']),console[_0x3a17e9(0x6f)]('Parent\x20segment\x20context:\x20'+(_0x2cca88||_0x3a17e9(0x7d))),_0x3f9a28&&console[_0x3a17e9(0x6f)]('Folder/pattern\x20arg:\x20'+_0x3f9a28),_0x4bddd5&&console['error'](_0x3a17e9(0x83)));if(!_0x2cca88)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x3a17e9(0x6f)](''),console['error'](_0x3a17e9(0x8c)),console['error'](_0x3a17e9(0x73)),console[_0x3a17e9(0x6f)](_0x3a17e9(0x91)),console[_0x3a17e9(0x6f)](''),console[_0x3a17e9(0x6f)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x265cd4=_0x3f9a28&&(_0x3f9a28[_0x3a17e9(0x89)]('*')||_0x3f9a28[_0x3a17e9(0x89)]('?'));if(_0x265cd4)return await this[_0x3a17e9(0x74)](_0x54edf8,_0x2cca88,_0x3f9a28);const _0x1f172c=_0x3f9a28?_0x2cca88+'/'+_0x3f9a28:_0x2cca88;return _0x4bddd5?await this[_0x3a17e9(0x96)](_0x54edf8,_0x1f172c):await this[_0x3a17e9(0x9b)](_0x54edf8,_0x1f172c);}catch(_0x5b9cc9){if(_0x5b9cc9 instanceof SDKError)return console[_0x3a17e9(0x6f)](_0x3a17e9(0x8e)+_0x5b9cc9[_0x3a17e9(0x80)]),_0x5b9cc9[_0x3a17e9(0x84)]&&console['error'](_0x3a17e9(0x75)+_0x5b9cc9[_0x3a17e9(0x84)]),0x1;throw _0x5b9cc9;}}async[a45_0x48df88(0x74)](_0x34949d,_0x2a6e13,_0x155feb){const _0x9cc8bb=a45_0x48df88,{options:_0x3fe041,tdx:_0x2e261e}=_0x34949d,_0x4f91a0=await withSpinner(_0x9cc8bb(0x8d)+_0x2a6e13+'\x27...',()=>_0x2e261e[_0x9cc8bb(0x76)][_0x9cc8bb(0x7c)](_0x2a6e13),{'verbose':_0x3fe041[_0x9cc8bb(0x6e)]}),_0x4f18a5=_0x4f91a0[_0x9cc8bb(0x8a)],_0x103298=await withSpinner(_0x9cc8bb(0xa5),()=>_0x2e261e['segment'][_0x9cc8bb(0x6d)](_0x4f18a5[_0x9cc8bb(0xb0)],_0x4f18a5[_0x9cc8bb(0xa1)]),{'verbose':_0x3fe041['verbose']}),{folders:_0xbc48d,segments:_0x4ef53f,journeys:_0x285f80}=_0x103298[_0x9cc8bb(0x8a)],_0x55dbfd=_0x155feb[_0x9cc8bb(0xb4)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x9cc8bb(0xb4)](/\?/g,'.'),_0x2901f8=new RegExp('^'+_0x55dbfd+'$','i'),_0x2ffbf8=_0xbc48d[_0x9cc8bb(0x77)](_0x13bc8d=>_0x2901f8['test'](_0x13bc8d[_0x9cc8bb(0x78)])),_0x34962a=_0x4ef53f[_0x9cc8bb(0x77)](_0x1d320d=>_0x2901f8[_0x9cc8bb(0x95)](_0x1d320d[_0x9cc8bb(0x78)])),_0x39214f=_0x285f80[_0x9cc8bb(0x77)](_0x2941ba=>_0x2901f8['test'](_0x2941ba[_0x9cc8bb(0xa7)])),_0x5cb4ea=_0x2ffbf8['length']+_0x34962a['length']+_0x39214f[_0x9cc8bb(0x8f)];console[_0x9cc8bb(0x6f)](_0x9cc8bb(0x81)+_0x2ffbf8[_0x9cc8bb(0x8f)]+_0x9cc8bb(0x71)+(_0x2ffbf8['length']!==0x1?'s':'')+',\x20'+_0x34962a[_0x9cc8bb(0x8f)]+_0x9cc8bb(0x9c)+(_0x34962a[_0x9cc8bb(0x8f)]!==0x1?'s':'')+_0x9cc8bb(0x88)+_0x39214f['length']+_0x9cc8bb(0xad)+(_0x39214f[_0x9cc8bb(0x8f)]!==0x1?'s':'')+_0x9cc8bb(0x9a)+_0x155feb+'\x27');const _0x488cdd=_0x4a9327=>{const _0x21f5d4=_0x9cc8bb;return getConsoleNextUrl(_0x3fe041[_0x21f5d4(0x98)],'/app/ps/'+_0x4f18a5[_0x21f5d4(0xb0)]+_0x21f5d4(0x7a)+_0x4a9327);},_0x40fb94=_0x3fe041[_0x9cc8bb(0x86)]===_0x9cc8bb(0x93)||_0x3fe041[_0x9cc8bb(0x86)]==='jsonl';if(_0x40fb94){const _0x3cedf3=[..._0x2ffbf8['map'](_0x79f52c=>({..._0x79f52c,'type':_0x9cc8bb(0xa8)})),..._0x34962a['map'](_0x17d2fe=>({..._0x17d2fe,'type':_0x9cc8bb(0x76),'url':_0x488cdd(_0x17d2fe['id'])})),..._0x39214f['map'](_0x55f32a=>({..._0x55f32a,'name':_0x55f32a[_0x9cc8bb(0xa7)],'type':'journey'}))][_0x9cc8bb(0xa2)]((_0x1e90a7,_0x2dc3ce)=>_0x1e90a7[_0x9cc8bb(0x78)][_0x9cc8bb(0x7f)](_0x2dc3ce[_0x9cc8bb(0x78)]));await handleSDKOutput(_0x3cedf3,_0x3fe041);}else{if(_0x5cb4ea===0x0)console[_0x9cc8bb(0x90)](_0x9cc8bb(0x72)+_0x155feb);else{console['log'](a45_0x22f336[_0x9cc8bb(0xb5)]('['+_0x2a6e13+_0x9cc8bb(0xae)+_0x155feb+'\x27'));const _0x16e988=formatFlatList(_0x2ffbf8,_0x34962a,{'showMetadata':!![],'getSegmentUrl':_0x488cdd},_0x39214f);console['log'](_0x16e988);}}return 0x0;}async[a45_0x48df88(0x9b)](_0x218ad8,_0x555098){const _0x43e45b=a45_0x48df88,{options:_0x2fbc9e,tdx:_0x4a1be6}=_0x218ad8,_0x9be404=await withSpinner(_0x43e45b(0xb1)+_0x555098+_0x43e45b(0x94),()=>_0x4a1be6[_0x43e45b(0x76)][_0x43e45b(0x7c)](_0x555098),{'verbose':_0x2fbc9e['verbose']}),_0x1f446e=_0x9be404[_0x43e45b(0x8a)];_0x2fbc9e['verbose']&&(console[_0x43e45b(0x6f)]('Parent\x20ID:\x20'+_0x1f446e[_0x43e45b(0xb0)]),_0x1f446e[_0x43e45b(0xa1)]&&console[_0x43e45b(0x6f)](_0x43e45b(0x7b)+_0x1f446e[_0x43e45b(0xa1)]));const _0x4ca6e0=await withSpinner(_0x43e45b(0xa5),()=>_0x4a1be6[_0x43e45b(0x76)][_0x43e45b(0x6d)](_0x1f446e[_0x43e45b(0xb0)],_0x1f446e['folderId']),{'verbose':_0x2fbc9e[_0x43e45b(0x6e)]}),{folders:_0x495012,segments:_0x2648f9,journeys:_0x15b833}=_0x4ca6e0[_0x43e45b(0x8a)],_0x5414dc=_0x495012['length']+_0x2648f9['length']+_0x15b833[_0x43e45b(0x8f)];console[_0x43e45b(0x6f)](_0x43e45b(0x81)+_0x495012[_0x43e45b(0x8f)]+_0x43e45b(0x71)+(_0x495012[_0x43e45b(0x8f)]!==0x1?'s':'')+',\x20'+_0x2648f9[_0x43e45b(0x8f)]+_0x43e45b(0x9c)+(_0x2648f9[_0x43e45b(0x8f)]!==0x1?'s':'')+',\x20and\x20'+_0x15b833[_0x43e45b(0x8f)]+'\x20journey'+(_0x15b833[_0x43e45b(0x8f)]!==0x1?'s':''));const _0x1bd241=_0x5ed37f=>{const _0x278b89=_0x43e45b;return getConsoleNextUrl(_0x2fbc9e['site'],_0x278b89(0x87)+_0x1f446e[_0x278b89(0xb0)]+_0x278b89(0x7a)+_0x5ed37f);},_0x9f701b=_0x1307e1=>{const _0x543442=_0x43e45b;return getConsoleNextUrl(_0x2fbc9e[_0x543442(0x98)],_0x543442(0x87)+_0x1f446e[_0x543442(0xb0)]+_0x543442(0x7a)+_0x1307e1+_0x543442(0x82));},_0x515b49=_0x2fbc9e['format']==='json'||_0x2fbc9e[_0x43e45b(0x86)]===_0x43e45b(0x7e);if(_0x515b49){const _0x4cd2aa=[..._0x495012[_0x43e45b(0x9e)](_0x44436d=>({..._0x44436d,'type':'folder'})),..._0x2648f9[_0x43e45b(0x9e)](_0x2e8474=>({..._0x2e8474,'type':_0x43e45b(0x76),'url':_0x1bd241(_0x2e8474['id'])})),..._0x15b833['map'](_0x5442b0=>({..._0x5442b0,'name':_0x5442b0[_0x43e45b(0xa7)],'type':_0x43e45b(0x9f),'url':_0x9f701b(_0x5442b0['id'])}))][_0x43e45b(0xa2)]((_0x434801,_0x505905)=>_0x434801[_0x43e45b(0x78)]['localeCompare'](_0x505905[_0x43e45b(0x78)]));await handleSDKOutput(_0x4cd2aa,_0x2fbc9e);}else{if(_0x5414dc===0x0)console[_0x43e45b(0x90)](a45_0x22f336['dim']('['+_0x555098+']')),console[_0x43e45b(0x90)](_0x43e45b(0xa9));else{console[_0x43e45b(0x90)](a45_0x22f336[_0x43e45b(0xb5)]('['+_0x555098+']'));const _0x3c0b31=formatFlatList(_0x495012,_0x2648f9,{'showMetadata':!![],'getSegmentUrl':_0x1bd241,'getJourneyUrl':_0x9f701b},_0x15b833);console['log'](_0x3c0b31);}}return 0x0;}async[a45_0x48df88(0x96)](_0x542d9c,_0x5abf5a){const _0x477b75=a45_0x48df88,{options:_0x3f7041,tdx:_0x2fe37b}=_0x542d9c,_0x2e1d8a=await withSpinner(_0x477b75(0xb1)+_0x5abf5a+_0x477b75(0x94),()=>_0x2fe37b[_0x477b75(0x76)][_0x477b75(0x7c)](_0x5abf5a),{'verbose':_0x3f7041['verbose']}),_0x2730a0=_0x2e1d8a[_0x477b75(0x8a)];_0x3f7041['verbose']&&(console[_0x477b75(0x6f)](_0x477b75(0xa6)+_0x2730a0['parentId']),_0x2730a0[_0x477b75(0xa1)]&&console[_0x477b75(0x6f)](_0x477b75(0x7b)+_0x2730a0[_0x477b75(0xa1)]));const _0x8b1c7f=_0x3f7041[_0x477b75(0x9d)]||0xa,_0x2ea7e7=await withSpinner(_0x477b75(0x70),()=>_0x2fe37b[_0x477b75(0x76)][_0x477b75(0x96)](_0x2730a0[_0x477b75(0xb0)],_0x2730a0[_0x477b75(0xa1)],0x0,_0x8b1c7f),{'verbose':_0x3f7041[_0x477b75(0x6e)]}),_0x1f5ce5=_0x2ea7e7[_0x477b75(0x8a)],_0x1f3436=_0x213004=>{const _0x20c2fc=_0x477b75;let _0x16732f=0x0,_0x4603fa=0x0,_0x175a7a=0x0;for(const _0x43956e of _0x213004){if(_0x43956e['type']===_0x20c2fc(0xa8))_0x16732f++;else{if(_0x43956e['type']===_0x20c2fc(0x76))_0x4603fa++;else{if(_0x43956e[_0x20c2fc(0x8b)]===_0x20c2fc(0x9f))_0x175a7a++;}}if(_0x43956e[_0x20c2fc(0xa4)]){const _0x3585b0=_0x1f3436(_0x43956e[_0x20c2fc(0xa4)]);_0x16732f+=_0x3585b0[_0x20c2fc(0xb3)],_0x4603fa+=_0x3585b0[_0x20c2fc(0x99)],_0x175a7a+=_0x3585b0['journeys'];}}return{'folders':_0x16732f,'segments':_0x4603fa,'journeys':_0x175a7a};},_0x2bc36d=_0x1f3436(_0x1f5ce5);console[_0x477b75(0x6f)]('✔\x20Built\x20tree\x20with\x20'+_0x2bc36d[_0x477b75(0xb3)]+_0x477b75(0x71)+(_0x2bc36d[_0x477b75(0xb3)]!==0x1?'s':'')+',\x20'+_0x2bc36d[_0x477b75(0x99)]+'\x20segment'+(_0x2bc36d[_0x477b75(0x99)]!==0x1?'s':'')+',\x20and\x20'+_0x2bc36d[_0x477b75(0x85)]+'\x20journey'+(_0x2bc36d[_0x477b75(0x85)]!==0x1?'s':''));const _0x45e351=_0x4aa567=>{const _0x1e3904=_0x477b75;return getConsoleNextUrl(_0x3f7041['site'],_0x1e3904(0x87)+_0x2730a0[_0x1e3904(0xb0)]+_0x1e3904(0x7a)+_0x4aa567);},_0x26d480=_0x93e17b=>{const _0x5810ed=_0x477b75;return getConsoleNextUrl(_0x3f7041['site'],_0x5810ed(0x87)+_0x2730a0[_0x5810ed(0xb0)]+_0x5810ed(0x7a)+_0x93e17b+_0x5810ed(0x82));};if(_0x3f7041[_0x477b75(0x86)]===_0x477b75(0x93)||_0x3f7041[_0x477b75(0x86)]===_0x477b75(0x7e))await handleSDKOutput(_0x1f5ce5,_0x3f7041);else{console[_0x477b75(0x90)](a45_0x22f336[_0x477b75(0xb5)]('['+_0x5abf5a+']'));const _0x5505c3=formatTree(_0x1f5ce5,{'showMetadata':!![],'getSegmentUrl':_0x45e351,'getJourneyUrl':_0x26d480});console[_0x477b75(0x90)](_0x5505c3);}return 0x0;}}
1
+ const a45_0x28e287=a45_0x1d64;(function(_0x43eead,_0x52a20d){const _0x4d792f=a45_0x1d64,_0x48d81e=_0x43eead();while(!![]){try{const _0x3cc39c=parseInt(_0x4d792f(0x194))/0x1+parseInt(_0x4d792f(0x190))/0x2*(parseInt(_0x4d792f(0x172))/0x3)+parseInt(_0x4d792f(0x1a4))/0x4+parseInt(_0x4d792f(0x184))/0x5+-parseInt(_0x4d792f(0x18d))/0x6+-parseInt(_0x4d792f(0x18f))/0x7+-parseInt(_0x4d792f(0x1b2))/0x8;if(_0x3cc39c===_0x52a20d)break;else _0x48d81e['push'](_0x48d81e['shift']());}catch(_0x584724){_0x48d81e['push'](_0x48d81e['shift']());}}}(a45_0x3c99,0xd2151));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x5d103e from'chalk';function a45_0x1d64(_0x1e6eb2,_0x9218b9){_0x1e6eb2=_0x1e6eb2-0x166;const _0x3c9967=a45_0x3c99();let _0x1d64a9=_0x3c9967[_0x1e6eb2];return _0x1d64a9;}function a45_0x3c99(){const _0x16f4df=['format','resolvePathToResource','Parent\x20ID:\x20','dim','type','execute','parentId','listUnifiedWithJourneys','7062840HRLUwl','Recursive\x20mode:\x20enabled','✔\x20Found\x20','replace','Folder/pattern\x20arg:\x20','List\x20folders\x20and\x20child\x20segments','folder','journeyBundleName',',\x20and\x20','Folder\x20ID:\x20','✔\x20Built\x20tree\x20with\x20','maxDepth','log','Parent\x20segment\x20context:\x20','12GBgdiu','Resolving\x20parent\x20segment\x20\x27','error','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20segment','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','map','\x20journey','listRecursive','journeys','includes','(not\x20set)','Set\x20a\x20parent\x20segment\x20context\x20first:','/j/da','(empty)','journey','length','/app/ps/','6769815fYJkOq','listUnified','localeCompare','jsonl','cause','\x20matching\x20\x27','site','\x27...','recursive','4190148PAoOvq','folderId','11528818ydXXOj','768992XKZmWu','test','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x20\x20Cause:\x20','48079ZXcdei','\x5c$&','Resolving\x20path\x20\x27','json','Site:\x20','verbose','segment','segments','Error:\x20','/e/','children','\x20folder','No\x20items\x20match\x20pattern:\x20','name','data','folders','4594632UDopIQ','sort','parentSegment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22',']\x20matching\x20\x27','filter'];a45_0x3c99=function(){return _0x16f4df;};return a45_0x3c99();}export class SegmentsCommand extends BaseCommand{[a45_0x28e287(0x1a1)]='segments';['description']=a45_0x28e287(0x169);async[a45_0x28e287(0x1af)](_0x534638){const _0x3573d5=a45_0x28e287,{options:_0x3cb5a8,args:_0x2e7b7f}=_0x534638,_0x1768c6=_0x3cb5a8[_0x3573d5(0x18c)],_0x39b362=_0x2e7b7f[0x0];try{const _0x464922=_0x3cb5a8[_0x3573d5(0x1a6)];_0x3cb5a8[_0x3573d5(0x199)]&&(console[_0x3573d5(0x174)](_0x3573d5(0x198)+_0x3cb5a8['site']),console[_0x3573d5(0x174)](_0x3573d5(0x171)+(_0x464922||_0x3573d5(0x17d))),_0x39b362&&console[_0x3573d5(0x174)](_0x3573d5(0x168)+_0x39b362),_0x1768c6&&console[_0x3573d5(0x174)](_0x3573d5(0x1b3)));if(!_0x464922)return console[_0x3573d5(0x174)](_0x3573d5(0x192)),console['error'](''),console[_0x3573d5(0x174)](_0x3573d5(0x17e)),console[_0x3573d5(0x174)](_0x3573d5(0x1a7)),console['error'](_0x3573d5(0x177)),console['error'](''),console[_0x3573d5(0x174)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x37da11=_0x39b362&&(_0x39b362[_0x3573d5(0x17c)]('*')||_0x39b362[_0x3573d5(0x17c)]('?'));if(_0x37da11)return await this['listWithPattern'](_0x534638,_0x464922,_0x39b362);const _0x155dac=_0x39b362?_0x464922+'/'+_0x39b362:_0x464922;return _0x1768c6?await this[_0x3573d5(0x17a)](_0x534638,_0x155dac):await this['listUnified'](_0x534638,_0x155dac);}catch(_0x2e3c2f){if(_0x2e3c2f instanceof SDKError)return console[_0x3573d5(0x174)](_0x3573d5(0x19c)+_0x2e3c2f['message']),_0x2e3c2f[_0x3573d5(0x188)]&&console[_0x3573d5(0x174)](_0x3573d5(0x193)+_0x2e3c2f[_0x3573d5(0x188)]),0x1;throw _0x2e3c2f;}}async['listWithPattern'](_0x3abf24,_0x34038f,_0x24dcf8){const _0x10e8bb=a45_0x28e287,{options:_0x18bfd4,tdx:_0x27bc7d}=_0x3abf24,_0x53c24a=await withSpinner(_0x10e8bb(0x173)+_0x34038f+'\x27...',()=>_0x27bc7d[_0x10e8bb(0x19a)][_0x10e8bb(0x1ab)](_0x34038f),{'verbose':_0x18bfd4[_0x10e8bb(0x199)]}),_0x4de152=_0x53c24a[_0x10e8bb(0x1a2)],_0x2e6d5e=await withSpinner(_0x10e8bb(0x175),()=>_0x27bc7d['segment'][_0x10e8bb(0x1b1)](_0x4de152[_0x10e8bb(0x1b0)],_0x4de152[_0x10e8bb(0x18e)]),{'verbose':_0x18bfd4[_0x10e8bb(0x199)]}),{folders:_0x2e643f,segments:_0xe9fed0,journeys:_0x51ea51}=_0x2e6d5e['data'],_0x40543d=_0x24dcf8['replace'](/[.+^${}()|[\]\\]/g,_0x10e8bb(0x195))[_0x10e8bb(0x167)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x15a150=new RegExp('^'+_0x40543d+'$','i'),_0x28341b=_0x2e643f[_0x10e8bb(0x1a9)](_0x503fdf=>_0x15a150[_0x10e8bb(0x191)](_0x503fdf[_0x10e8bb(0x1a1)])),_0x380ad8=_0xe9fed0[_0x10e8bb(0x1a9)](_0x25d55d=>_0x15a150[_0x10e8bb(0x191)](_0x25d55d[_0x10e8bb(0x1a1)])),_0x58cf58=_0x51ea51[_0x10e8bb(0x1a9)](_0x5df918=>_0x15a150[_0x10e8bb(0x191)](_0x5df918[_0x10e8bb(0x16b)])),_0x2f57b3=_0x28341b['length']+_0x380ad8[_0x10e8bb(0x182)]+_0x58cf58[_0x10e8bb(0x182)];console[_0x10e8bb(0x174)](_0x10e8bb(0x166)+_0x28341b[_0x10e8bb(0x182)]+_0x10e8bb(0x19f)+(_0x28341b[_0x10e8bb(0x182)]!==0x1?'s':'')+',\x20'+_0x380ad8[_0x10e8bb(0x182)]+'\x20segment'+(_0x380ad8[_0x10e8bb(0x182)]!==0x1?'s':'')+_0x10e8bb(0x16c)+_0x58cf58['length']+_0x10e8bb(0x179)+(_0x58cf58['length']!==0x1?'s':'')+_0x10e8bb(0x189)+_0x24dcf8+'\x27');const _0x158ea0=_0x363ef3=>{const _0x164b8d=_0x10e8bb;return getConsoleNextUrl(_0x18bfd4[_0x164b8d(0x18a)],'/app/ps/'+_0x4de152[_0x164b8d(0x1b0)]+'/e/'+_0x363ef3);},_0x5664cf=_0x18bfd4[_0x10e8bb(0x1aa)]==='json'||_0x18bfd4[_0x10e8bb(0x1aa)]===_0x10e8bb(0x187);if(_0x5664cf){const _0x35b95e=[..._0x28341b[_0x10e8bb(0x178)](_0x331400=>({..._0x331400,'type':_0x10e8bb(0x16a)})),..._0x380ad8[_0x10e8bb(0x178)](_0x463d60=>({..._0x463d60,'type':_0x10e8bb(0x19a),'url':_0x158ea0(_0x463d60['id'])})),..._0x58cf58['map'](_0xe104b4=>({..._0xe104b4,'name':_0xe104b4['journeyBundleName'],'type':_0x10e8bb(0x181)}))][_0x10e8bb(0x1a5)]((_0x23b994,_0x4ebcf9)=>_0x23b994[_0x10e8bb(0x1a1)][_0x10e8bb(0x186)](_0x4ebcf9[_0x10e8bb(0x1a1)]));await handleSDKOutput(_0x35b95e,_0x18bfd4);}else{if(_0x2f57b3===0x0)console[_0x10e8bb(0x170)](_0x10e8bb(0x1a0)+_0x24dcf8);else{console['log'](a45_0x5d103e[_0x10e8bb(0x1ad)]('['+_0x34038f+_0x10e8bb(0x1a8)+_0x24dcf8+'\x27'));const _0x266532=formatFlatList(_0x28341b,_0x380ad8,{'showMetadata':!![],'getSegmentUrl':_0x158ea0},_0x58cf58);console[_0x10e8bb(0x170)](_0x266532);}}return 0x0;}async[a45_0x28e287(0x185)](_0x5df54f,_0x388e40){const _0x3bb38=a45_0x28e287,{options:_0x12effa,tdx:_0x38f4aa}=_0x5df54f,_0xf04b5b=await withSpinner(_0x3bb38(0x196)+_0x388e40+_0x3bb38(0x18b),()=>_0x38f4aa['segment'][_0x3bb38(0x1ab)](_0x388e40),{'verbose':_0x12effa['verbose']}),_0x3e223e=_0xf04b5b[_0x3bb38(0x1a2)];_0x12effa[_0x3bb38(0x199)]&&(console[_0x3bb38(0x174)]('Parent\x20ID:\x20'+_0x3e223e[_0x3bb38(0x1b0)]),_0x3e223e[_0x3bb38(0x18e)]&&console[_0x3bb38(0x174)](_0x3bb38(0x16d)+_0x3e223e[_0x3bb38(0x18e)]));const _0x52f1f3=await withSpinner(_0x3bb38(0x175),()=>_0x38f4aa[_0x3bb38(0x19a)][_0x3bb38(0x1b1)](_0x3e223e[_0x3bb38(0x1b0)],_0x3e223e['folderId']),{'verbose':_0x12effa[_0x3bb38(0x199)]}),{folders:_0x4b1287,segments:_0x17c512,journeys:_0x3b5f6c}=_0x52f1f3['data'],_0x51dffb=_0x4b1287[_0x3bb38(0x182)]+_0x17c512[_0x3bb38(0x182)]+_0x3b5f6c['length'];console[_0x3bb38(0x174)](_0x3bb38(0x166)+_0x4b1287[_0x3bb38(0x182)]+_0x3bb38(0x19f)+(_0x4b1287['length']!==0x1?'s':'')+',\x20'+_0x17c512['length']+_0x3bb38(0x176)+(_0x17c512[_0x3bb38(0x182)]!==0x1?'s':'')+_0x3bb38(0x16c)+_0x3b5f6c[_0x3bb38(0x182)]+_0x3bb38(0x179)+(_0x3b5f6c[_0x3bb38(0x182)]!==0x1?'s':''));const _0x142cdd=_0xc9e7b=>{const _0x4de448=_0x3bb38;return getConsoleNextUrl(_0x12effa[_0x4de448(0x18a)],_0x4de448(0x183)+_0x3e223e[_0x4de448(0x1b0)]+'/e/'+_0xc9e7b);},_0x160dac=_0x5cc018=>{const _0x11b61c=_0x3bb38;return getConsoleNextUrl(_0x12effa['site'],_0x11b61c(0x183)+_0x3e223e[_0x11b61c(0x1b0)]+'/e/'+_0x5cc018+'/j/da');},_0x4546a2=_0x12effa['format']==='json'||_0x12effa[_0x3bb38(0x1aa)]==='jsonl';if(_0x4546a2){const _0xda6ac8=[..._0x4b1287['map'](_0x5cb4a0=>({..._0x5cb4a0,'type':'folder'})),..._0x17c512[_0x3bb38(0x178)](_0x4258dc=>({..._0x4258dc,'type':_0x3bb38(0x19a),'url':_0x142cdd(_0x4258dc['id'])})),..._0x3b5f6c[_0x3bb38(0x178)](_0x1b57b0=>({..._0x1b57b0,'name':_0x1b57b0[_0x3bb38(0x16b)],'type':_0x3bb38(0x181),'url':_0x160dac(_0x1b57b0['id'])}))]['sort']((_0x19afd8,_0xe0ca27)=>_0x19afd8['name'][_0x3bb38(0x186)](_0xe0ca27[_0x3bb38(0x1a1)]));await handleSDKOutput(_0xda6ac8,_0x12effa);}else{if(_0x51dffb===0x0)console[_0x3bb38(0x170)](a45_0x5d103e[_0x3bb38(0x1ad)]('['+_0x388e40+']')),console[_0x3bb38(0x170)](_0x3bb38(0x180));else{console['log'](a45_0x5d103e['dim']('['+_0x388e40+']'));const _0x106483=formatFlatList(_0x4b1287,_0x17c512,{'showMetadata':!![],'getSegmentUrl':_0x142cdd,'getJourneyUrl':_0x160dac},_0x3b5f6c);console[_0x3bb38(0x170)](_0x106483);}}return 0x0;}async['listRecursive'](_0x1a4daf,_0x35285e){const _0x912074=a45_0x28e287,{options:_0x457356,tdx:_0xd07ac4}=_0x1a4daf,_0x26b3f0=await withSpinner(_0x912074(0x196)+_0x35285e+_0x912074(0x18b),()=>_0xd07ac4[_0x912074(0x19a)][_0x912074(0x1ab)](_0x35285e),{'verbose':_0x457356[_0x912074(0x199)]}),_0xcb977e=_0x26b3f0['data'];_0x457356['verbose']&&(console[_0x912074(0x174)](_0x912074(0x1ac)+_0xcb977e[_0x912074(0x1b0)]),_0xcb977e['folderId']&&console['error'](_0x912074(0x16d)+_0xcb977e[_0x912074(0x18e)]));const _0x52a585=_0x457356[_0x912074(0x16f)]||0xa,_0x2858e2=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0xd07ac4[_0x912074(0x19a)][_0x912074(0x17a)](_0xcb977e[_0x912074(0x1b0)],_0xcb977e[_0x912074(0x18e)],0x0,_0x52a585),{'verbose':_0x457356[_0x912074(0x199)]}),_0x11e1bb=_0x2858e2[_0x912074(0x1a2)],_0x2e3625=_0x1eb6db=>{const _0x4248bb=_0x912074;let _0x18be34=0x0,_0x41be51=0x0,_0xb7d255=0x0;for(const _0x4d7eb0 of _0x1eb6db){if(_0x4d7eb0[_0x4248bb(0x1ae)]===_0x4248bb(0x16a))_0x18be34++;else{if(_0x4d7eb0[_0x4248bb(0x1ae)]==='segment')_0x41be51++;else{if(_0x4d7eb0[_0x4248bb(0x1ae)]===_0x4248bb(0x181))_0xb7d255++;}}if(_0x4d7eb0['children']){const _0x5c4095=_0x2e3625(_0x4d7eb0[_0x4248bb(0x19e)]);_0x18be34+=_0x5c4095[_0x4248bb(0x1a3)],_0x41be51+=_0x5c4095[_0x4248bb(0x19b)],_0xb7d255+=_0x5c4095[_0x4248bb(0x17b)];}}return{'folders':_0x18be34,'segments':_0x41be51,'journeys':_0xb7d255};},_0x2d90f3=_0x2e3625(_0x11e1bb);console[_0x912074(0x174)](_0x912074(0x16e)+_0x2d90f3[_0x912074(0x1a3)]+_0x912074(0x19f)+(_0x2d90f3[_0x912074(0x1a3)]!==0x1?'s':'')+',\x20'+_0x2d90f3[_0x912074(0x19b)]+'\x20segment'+(_0x2d90f3[_0x912074(0x19b)]!==0x1?'s':'')+_0x912074(0x16c)+_0x2d90f3[_0x912074(0x17b)]+_0x912074(0x179)+(_0x2d90f3[_0x912074(0x17b)]!==0x1?'s':''));const _0x500ad5=_0x128486=>{const _0x28fbd8=_0x912074;return getConsoleNextUrl(_0x457356[_0x28fbd8(0x18a)],_0x28fbd8(0x183)+_0xcb977e[_0x28fbd8(0x1b0)]+_0x28fbd8(0x19d)+_0x128486);},_0x2301d1=_0x73d048=>{const _0x46e01f=_0x912074;return getConsoleNextUrl(_0x457356[_0x46e01f(0x18a)],'/app/ps/'+_0xcb977e[_0x46e01f(0x1b0)]+_0x46e01f(0x19d)+_0x73d048+_0x46e01f(0x17f));};if(_0x457356[_0x912074(0x1aa)]===_0x912074(0x197)||_0x457356[_0x912074(0x1aa)]===_0x912074(0x187))await handleSDKOutput(_0x11e1bb,_0x457356);else{console['log'](a45_0x5d103e[_0x912074(0x1ad)]('['+_0x35285e+']'));const _0xa1c201=formatTree(_0x11e1bb,{'showMetadata':!![],'getSegmentUrl':_0x500ad5,'getJourneyUrl':_0x2301d1});console[_0x912074(0x170)](_0xa1c201);}return 0x0;}}
@@ -1 +1 @@
1
- function a46_0x2f07(_0x5af874,_0x96b579){_0x5af874=_0x5af874-0x7f;const _0x9b14da=a46_0x9b14();let _0x2f0733=_0x9b14da[_0x5af874];return _0x2f0733;}const a46_0x2e8c47=a46_0x2f07;(function(_0x542368,_0x5dcf44){const _0x1e7b5e=a46_0x2f07,_0x31f0c5=_0x542368();while(!![]){try{const _0x5358d9=parseInt(_0x1e7b5e(0xa3))/0x1+parseInt(_0x1e7b5e(0x97))/0x2+-parseInt(_0x1e7b5e(0x80))/0x3*(-parseInt(_0x1e7b5e(0x81))/0x4)+parseInt(_0x1e7b5e(0x9a))/0x5+-parseInt(_0x1e7b5e(0x9e))/0x6*(-parseInt(_0x1e7b5e(0x89))/0x7)+parseInt(_0x1e7b5e(0xa2))/0x8+-parseInt(_0x1e7b5e(0x8b))/0x9;if(_0x5358d9===_0x5dcf44)break;else _0x31f0c5['push'](_0x31f0c5['shift']());}catch(_0x4740c6){_0x31f0c5['push'](_0x31f0c5['shift']());}}}(a46_0x9b14,0x77c7c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a46_0x9b14(){const _0x3ebf0b=['\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','...','description','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','391758DURwGk','8hRZKOU','database','Database:\x20','args','error','✔\x20Retrieved\x20','validate','verbose','7BgxOiV','Querying\x20','16079598jAhSJH','table','limit','name','Limit:\x20','showTable','data','length','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Show\x20table\x20contents','catalog','\x20from\x20','1207064ZOhLSY','Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','2233180IUlXgW','Site:\x20','message','Error:\x20','1938522PBXOCp','\x20\x20Cause:\x20','Usage:\x20tdx\x20show\x20<database.table>','\x20row','1998056EQLSxk','393058rlrMqW','query'];a46_0x9b14=function(){return _0x3ebf0b;};return a46_0x9b14();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x2e8c47(0x8e)]='show';[a46_0x2e8c47(0xa7)]=a46_0x2e8c47(0x94);async['execute'](_0x541b62){const _0x707fab=a46_0x2e8c47;return this[_0x707fab(0x90)](_0x541b62);}async[a46_0x2e8c47(0x90)](_0x3fd8f9){const _0x524918=a46_0x2e8c47,{options:_0x41c36a,args:_0x4015c9,tdx:_0x879a99}=_0x3fd8f9;let _0x31f826;try{_0x31f826=parseTableReference(_0x4015c9[0x0]);const _0x12ea79=_0x41c36a[_0x524918(0x82)];!_0x31f826[_0x524918(0x82)]&&_0x12ea79&&(_0x31f826['database']=_0x12ea79);const _0x2585e6=validateTableDescribeReference(_0x31f826);if(_0x2585e6)return console[_0x524918(0x85)](_0x524918(0x9d)+_0x2585e6),console['error'](_0x524918(0xa0)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x524918(0x99)),0x1;}catch(_0x3b0cc0){return console[_0x524918(0x85)](_0x524918(0x9d)+_0x3b0cc0[_0x524918(0x9c)]),console[_0x524918(0x85)](_0x524918(0xa0)),console['error'](_0x524918(0xa5)),console[_0x524918(0x85)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x42637a=_0x31f826[_0x524918(0x95)],_0x4d3d5a=_0x31f826[_0x524918(0x82)],_0x4504a1=_0x31f826[_0x524918(0x8c)],_0x1cd65e=resolveLimit(_0x41c36a[_0x524918(0x8d)],DEFAULT_DISPLAY_LIMIT);try{_0x41c36a[_0x524918(0x88)]&&(console['error'](_0x524918(0x9b)+_0x41c36a['site']),_0x42637a&&console['error'](_0x524918(0x98)+_0x42637a),console['error'](_0x524918(0x83)+_0x4d3d5a),console[_0x524918(0x85)]('Table:\x20'+_0x4504a1),console[_0x524918(0x85)](_0x524918(0x8f)+_0x1cd65e));const _0x2c631e=_0x42637a?_0x42637a+'.'+_0x4d3d5a+'.'+_0x4504a1:_0x4d3d5a+'.'+_0x4504a1,_0x239564=await withSpinner(_0x524918(0x8a)+_0x2c631e+_0x524918(0xa6),()=>_0x879a99[_0x524918(0xa4)]['showTable'](_0x4d3d5a,_0x4504a1,_0x1cd65e,_0x42637a),{'verbose':_0x41c36a[_0x524918(0x88)]}),_0x149d2a=_0x239564['data'],_0x35ba5e=_0x149d2a[_0x524918(0x91)];return _0x35ba5e['length']===0x0?console['error']('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console['error'](_0x524918(0x86)+_0x35ba5e['length']+_0x524918(0xa1)+(_0x35ba5e[_0x524918(0x92)]!==0x1?'s':'')+_0x524918(0x96)+_0x2c631e),await handleSDKOutput(_0x35ba5e,_0x41c36a),0x0;}catch(_0x4277fd){if(_0x4277fd instanceof SDKError)return console['error'](_0x524918(0x9d)+_0x4277fd[_0x524918(0x9c)]),_0x4277fd['cause']&&console[_0x524918(0x85)](_0x524918(0x9f)+_0x4277fd['cause']),0x1;throw _0x4277fd;}}[a46_0x2e8c47(0x87)](_0x3dc996){const _0x4a5202=a46_0x2e8c47;if(_0x3dc996['args'][_0x4a5202(0x92)]===0x0)return _0x4a5202(0x93);if(_0x3dc996[_0x4a5202(0x84)]['length']>0x1)return _0x4a5202(0x7f);return undefined;}}
1
+ const a46_0x2fcb5=a46_0x73b7;(function(_0x335ac9,_0x4b36c9){const _0x3d1187=a46_0x73b7,_0x511029=_0x335ac9();while(!![]){try{const _0x49856e=-parseInt(_0x3d1187(0xd8))/0x1+parseInt(_0x3d1187(0xe4))/0x2*(-parseInt(_0x3d1187(0xf3))/0x3)+parseInt(_0x3d1187(0xdf))/0x4+-parseInt(_0x3d1187(0xf1))/0x5+parseInt(_0x3d1187(0xf9))/0x6+-parseInt(_0x3d1187(0xea))/0x7*(parseInt(_0x3d1187(0xd4))/0x8)+parseInt(_0x3d1187(0xe0))/0x9*(parseInt(_0x3d1187(0xe6))/0xa);if(_0x49856e===_0x4b36c9)break;else _0x511029['push'](_0x511029['shift']());}catch(_0x12c723){_0x511029['push'](_0x511029['shift']());}}}(a46_0x1ec3,0x8493e));function a46_0x1ec3(){const _0x14c412=['171811IXGUDL','✔\x20Retrieved\x20','\x20\x20Cause:\x20','Querying\x20','Site:\x20','error','showTable','1269656EvHYzf','17714466weEfto','database','show','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','10406LYYHvt','message','10xHZlPs','table','args','...','14wdigwk','query','Catalog:\x20','execute','\x20row','Limit:\x20','verbose','4120970urYfCT','Database:\x20','312ODhXjN','catalog','site','limit','Table:\x20','description','267114pmIBDp','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','data','Error:\x20','1000208kqXQqH','length','Usage:\x20tdx\x20show\x20<database.table>','Show\x20table\x20contents'];a46_0x1ec3=function(){return _0x14c412;};return a46_0x1ec3();}import{BaseCommand}from'./command.js';function a46_0x73b7(_0x2980db,_0x2a4bd7){_0x2980db=_0x2980db-0xd2;const _0x1ec3cf=a46_0x1ec3();let _0x73b7b4=_0x1ec3cf[_0x2980db];return _0x73b7b4;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x2fcb5(0xe2);[a46_0x2fcb5(0xf8)]=a46_0x2fcb5(0xd7);async[a46_0x2fcb5(0xed)](_0x39ae3c){const _0x5cafce=a46_0x2fcb5;return this[_0x5cafce(0xde)](_0x39ae3c);}async[a46_0x2fcb5(0xde)](_0x280421){const _0x95b623=a46_0x2fcb5,{options:_0x276e25,args:_0x18e1e2,tdx:_0x156a1d}=_0x280421;let _0x4f2793;try{_0x4f2793=parseTableReference(_0x18e1e2[0x0]);const _0x2e17a8=_0x276e25[_0x95b623(0xe1)];!_0x4f2793[_0x95b623(0xe1)]&&_0x2e17a8&&(_0x4f2793['database']=_0x2e17a8);const _0x7da5f9=validateTableDescribeReference(_0x4f2793);if(_0x7da5f9)return console[_0x95b623(0xdd)](_0x95b623(0xd3)+_0x7da5f9),console[_0x95b623(0xdd)](_0x95b623(0xd6)),console[_0x95b623(0xdd)](_0x95b623(0xfa)),console[_0x95b623(0xdd)](_0x95b623(0xe3)),0x1;}catch(_0x16d228){return console[_0x95b623(0xdd)](_0x95b623(0xd3)+_0x16d228[_0x95b623(0xe5)]),console[_0x95b623(0xdd)]('Usage:\x20tdx\x20show\x20<database.table>'),console['error'](_0x95b623(0xfa)),console[_0x95b623(0xdd)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x5a080e=_0x4f2793[_0x95b623(0xf4)],_0x766cc9=_0x4f2793['database'],_0xe0c224=_0x4f2793[_0x95b623(0xe7)],_0x34160b=resolveLimit(_0x276e25[_0x95b623(0xf6)],DEFAULT_DISPLAY_LIMIT);try{_0x276e25['verbose']&&(console['error'](_0x95b623(0xdc)+_0x276e25[_0x95b623(0xf5)]),_0x5a080e&&console[_0x95b623(0xdd)](_0x95b623(0xec)+_0x5a080e),console[_0x95b623(0xdd)](_0x95b623(0xf2)+_0x766cc9),console[_0x95b623(0xdd)](_0x95b623(0xf7)+_0xe0c224),console[_0x95b623(0xdd)](_0x95b623(0xef)+_0x34160b));const _0x207c2c=_0x5a080e?_0x5a080e+'.'+_0x766cc9+'.'+_0xe0c224:_0x766cc9+'.'+_0xe0c224,_0x5a72ae=await withSpinner(_0x95b623(0xdb)+_0x207c2c+_0x95b623(0xe9),()=>_0x156a1d[_0x95b623(0xeb)][_0x95b623(0xde)](_0x766cc9,_0xe0c224,_0x34160b,_0x5a080e),{'verbose':_0x276e25[_0x95b623(0xf0)]}),_0x23231d=_0x5a72ae[_0x95b623(0xd2)],_0x408e1f=_0x23231d[_0x95b623(0xd2)];return _0x408e1f[_0x95b623(0xd5)]===0x0?console[_0x95b623(0xdd)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x95b623(0xdd)](_0x95b623(0xd9)+_0x408e1f[_0x95b623(0xd5)]+_0x95b623(0xee)+(_0x408e1f[_0x95b623(0xd5)]!==0x1?'s':'')+'\x20from\x20'+_0x207c2c),await handleSDKOutput(_0x408e1f,_0x276e25),0x0;}catch(_0x174022){if(_0x174022 instanceof SDKError)return console[_0x95b623(0xdd)](_0x95b623(0xd3)+_0x174022[_0x95b623(0xe5)]),_0x174022['cause']&&console['error'](_0x95b623(0xda)+_0x174022['cause']),0x1;throw _0x174022;}}['validate'](_0x1a1d1e){const _0x472268=a46_0x2fcb5;if(_0x1a1d1e[_0x472268(0xe8)][_0x472268(0xd5)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x1a1d1e[_0x472268(0xe8)][_0x472268(0xd5)]>0x1)return _0x472268(0xfb);return undefined;}}
@@ -1 +1 @@
1
- function a47_0x1b14(){const _0x384236=['session','description','config','Name:','TDX_PROFILE\x20env','User:','(from\x20','yellow','5362576GkkBFR','bold','CLI\x20flag','N/A','name','profileSource','last_name','site','✓\x20Authentication\x20successful\x0a','55223wriGvj','log','1410014zCrmzE','1176LjTdzq','9782274ixiXRe','account_id','red','2024091mNyIXO','message','error','site:\x20','Show\x20authentication\x20status\x20and\x20current\x20context','596682dfBWgv','cyan','first_name','green','OAuth','status','displayWithSources','Account\x20ID:','filter','dim','5aqppCk','2919970nSwKVd','profile','9EphJgg','jobs','Credential\x20type:\x20','tdx'];a47_0x1b14=function(){return _0x384236;};return a47_0x1b14();}const a47_0x1ed769=a47_0x540e;function a47_0x540e(_0x47ff57,_0x50d6de){_0x47ff57=_0x47ff57-0xd1;const _0x1b1496=a47_0x1b14();let _0x540e90=_0x1b1496[_0x47ff57];return _0x540e90;}(function(_0x46663c,_0x18c96b){const _0x246ccd=a47_0x540e,_0x12269e=_0x46663c();while(!![]){try{const _0x408bf6=parseInt(_0x246ccd(0xd6))/0x1+parseInt(_0x246ccd(0xfa))/0x2+parseInt(_0x246ccd(0xd1))/0x3+parseInt(_0x246ccd(0xef))/0x4+-parseInt(_0x246ccd(0xe0))/0x5*(parseInt(_0x246ccd(0xfc))/0x6)+parseInt(_0x246ccd(0xf8))/0x7*(-parseInt(_0x246ccd(0xfb))/0x8)+parseInt(_0x246ccd(0xe3))/0x9*(parseInt(_0x246ccd(0xe1))/0xa);if(_0x408bf6===_0x18c96b)break;else _0x12269e['push'](_0x12269e['shift']());}catch(_0x36c703){_0x12269e['push'](_0x12269e['shift']());}}}(a47_0x1b14,0xc7f15));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x309315 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1ed769(0xf3)]=a47_0x1ed769(0xdb);[a47_0x1ed769(0xe8)]=a47_0x1ed769(0xd5);async['execute'](_0x3d9c15){const _0x57a978=a47_0x1ed769,{options:_0x3a9fbc,tdx:_0x5ccb31}=_0x3d9c15,_0x55b983=_0x3a9fbc[_0x57a978(0xf6)],_0x268410=new GlobalContext(_0x3a9fbc),_0x7d2e29=_0x268410[_0x57a978(0xe2)],_0xd9407d=_0x268410[_0x57a978(0xf4)],_0x3eddfe=_0xd9407d==='cli'?_0x57a978(0xf1):_0xd9407d==='session'?_0x57a978(0xe7):_0xd9407d==='env'?_0x57a978(0xeb):_0xd9407d==='config'?_0x57a978(0xe9):null,_0x21c80e=_0x7d2e29?a47_0x309315['cyan'](_0x7d2e29):a47_0x309315[_0x57a978(0xdf)](_0x57a978(0xf2)),_0x32f988=_0x3eddfe?'\x20'+a47_0x309315[_0x57a978(0xdf)](_0x57a978(0xed)+_0x3eddfe+')'):'';console[_0x57a978(0xf9)](a47_0x309315[_0x57a978(0xf0)](_0x57a978(0xe6))+'\x20profile:\x20'+_0x21c80e+_0x32f988+'\x20'+a47_0x309315[_0x57a978(0xdf)]('(')+_0x57a978(0xd4)+a47_0x309315[_0x57a978(0xd7)](_0x55b983)+a47_0x309315[_0x57a978(0xdf)](')'));const _0x7795cc=await getOAuthTokens(_0x7d2e29);if(_0x7795cc)console[_0x57a978(0xf9)](_0x57a978(0xe5)+a47_0x309315[_0x57a978(0xd7)](_0x57a978(0xda)));else{const _0x3d5df8=await resolveAPIKeyAsync(_0x55b983,_0x7d2e29);if(_0x3d5df8){const {source:_0x573f50,isDeprecated:_0x55b960}=_0x3d5df8,_0x14fdd9='Read\x20credential\x20from\x20'+a47_0x309315[_0x57a978(0xd7)](_0x573f50);console[_0x57a978(0xf9)](_0x55b960?a47_0x309315[_0x57a978(0xee)](_0x14fdd9):_0x14fdd9);}else console[_0x57a978(0xf9)](a47_0x309315['yellow']('No\x20credential\x20found'));}let _0x4159b7=![];try{const _0x4c5643=await _0x5ccb31[_0x57a978(0xe4)]['getUserInfo']();console[_0x57a978(0xf9)](a47_0x309315[_0x57a978(0xd9)](_0x57a978(0xf7))),console[_0x57a978(0xf9)](a47_0x309315['bold'](_0x57a978(0xec))+'\x20'+a47_0x309315['cyan'](_0x4c5643['email']));if(_0x4c5643[_0x57a978(0xd8)]||_0x4c5643[_0x57a978(0xf5)]){const _0x311d77=[_0x4c5643[_0x57a978(0xd8)],_0x4c5643[_0x57a978(0xf5)]][_0x57a978(0xde)](Boolean)['join']('\x20');console['log'](a47_0x309315[_0x57a978(0xf0)](_0x57a978(0xea))+'\x20'+_0x311d77);}_0x4c5643[_0x57a978(0xfd)]&&console[_0x57a978(0xf9)](a47_0x309315['bold'](_0x57a978(0xdd))+'\x20'+a47_0x309315[_0x57a978(0xee)](_0x4c5643[_0x57a978(0xfd)])),_0x4159b7=!![];}catch(_0x1c1c8e){_0x1c1c8e instanceof HTTPClientError&&_0x1c1c8e[_0x57a978(0xdb)]===0x191?printAuthError(_0x1c1c8e,!![],_0x7d2e29):console[_0x57a978(0xd3)](a47_0x309315[_0x57a978(0xfe)]('✗\x20Validation\x20failed:\x20'+(_0x1c1c8e instanceof Error?_0x1c1c8e[_0x57a978(0xd2)]:String(_0x1c1c8e))));}return console[_0x57a978(0xf9)](),_0x268410[_0x57a978(0xdc)](),_0x4159b7?0x0:0x1;}}
1
+ const a47_0x589762=a47_0x4702;function a47_0x4702(_0x2dd39f,_0x31cfe6){_0x2dd39f=_0x2dd39f-0xc3;const _0x51759f=a47_0x5175();let _0x4702b6=_0x51759f[_0x2dd39f];return _0x4702b6;}(function(_0x358937,_0x5ec5c2){const _0x14d058=a47_0x4702,_0x354aa6=_0x358937();while(!![]){try{const _0x2bc41f=-parseInt(_0x14d058(0xd1))/0x1*(parseInt(_0x14d058(0xc4))/0x2)+-parseInt(_0x14d058(0xcc))/0x3*(-parseInt(_0x14d058(0xca))/0x4)+parseInt(_0x14d058(0xdb))/0x5*(parseInt(_0x14d058(0xed))/0x6)+-parseInt(_0x14d058(0xc9))/0x7+-parseInt(_0x14d058(0xdc))/0x8*(-parseInt(_0x14d058(0xde))/0x9)+parseInt(_0x14d058(0xf0))/0xa*(-parseInt(_0x14d058(0xcf))/0xb)+parseInt(_0x14d058(0xcb))/0xc*(parseInt(_0x14d058(0xc5))/0xd);if(_0x2bc41f===_0x5ec5c2)break;else _0x354aa6['push'](_0x354aa6['shift']());}catch(_0x264ba5){_0x354aa6['push'](_0x354aa6['shift']());}}}(a47_0x5175,0xedc83));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x3527d4 from'chalk';function a47_0x5175(){const _0x10642a=['name','displayWithSources','session','getUserInfo','log','Show\x20authentication\x20status\x20and\x20current\x20context','bold','status','dim','last_name','email','description','\x20profile:\x20','213348SAdKdP','profile','message','79930fOryBH','CLI\x20flag','yellow','✗\x20Validation\x20failed:\x20','92qevoiH','255632lAVyUc','(from\x20','Account\x20ID:','jobs','15456uxuauK','3396356dzcVgP','876kHUOSp','3KijaIQ','tdx','env','1419RyrkbA','site','33787qXXBuq','filter','cyan','profileSource','first_name','account_id','site:\x20','execute','cli','join','45ISYWbQ','952aaQdsg','No\x20credential\x20found','72369DhqLaP','N/A'];a47_0x5175=function(){return _0x10642a;};return a47_0x5175();}export class StatusCommand extends BaseCommand{[a47_0x589762(0xe0)]=a47_0x589762(0xe7);[a47_0x589762(0xeb)]=a47_0x589762(0xe5);async[a47_0x589762(0xd8)](_0x5aba07){const _0x45018c=a47_0x589762,{options:_0x55050c,tdx:_0x119abd}=_0x5aba07,_0x21af5b=_0x55050c[_0x45018c(0xd0)],_0x3699b8=new GlobalContext(_0x55050c),_0x3b02f9=_0x3699b8[_0x45018c(0xee)],_0x48a3f2=_0x3699b8[_0x45018c(0xd4)],_0x1de4b6=_0x48a3f2===_0x45018c(0xd9)?_0x45018c(0xf1):_0x48a3f2==='session'?_0x45018c(0xe2):_0x48a3f2===_0x45018c(0xce)?'TDX_PROFILE\x20env':_0x48a3f2==='config'?'config':null,_0x4678ba=_0x3b02f9?a47_0x3527d4['cyan'](_0x3b02f9):a47_0x3527d4[_0x45018c(0xe8)](_0x45018c(0xdf)),_0x3892e6=_0x1de4b6?'\x20'+a47_0x3527d4[_0x45018c(0xe8)](_0x45018c(0xc6)+_0x1de4b6+')'):'';console[_0x45018c(0xe4)](a47_0x3527d4[_0x45018c(0xe6)](_0x45018c(0xcd))+_0x45018c(0xec)+_0x4678ba+_0x3892e6+'\x20'+a47_0x3527d4[_0x45018c(0xe8)]('(')+_0x45018c(0xd7)+a47_0x3527d4[_0x45018c(0xd3)](_0x21af5b)+a47_0x3527d4[_0x45018c(0xe8)](')'));const _0x6eaf81=await getOAuthTokens(_0x3b02f9);if(_0x6eaf81)console['log']('Credential\x20type:\x20'+a47_0x3527d4[_0x45018c(0xd3)]('OAuth'));else{const _0x4c3479=await resolveAPIKeyAsync(_0x21af5b,_0x3b02f9);if(_0x4c3479){const {source:_0x3d50c1,isDeprecated:_0x3592be}=_0x4c3479,_0x21667d='Read\x20credential\x20from\x20'+a47_0x3527d4[_0x45018c(0xd3)](_0x3d50c1);console[_0x45018c(0xe4)](_0x3592be?a47_0x3527d4[_0x45018c(0xf2)](_0x21667d):_0x21667d);}else console[_0x45018c(0xe4)](a47_0x3527d4['yellow'](_0x45018c(0xdd)));}let _0x52a99e=![];try{const _0x363cee=await _0x119abd[_0x45018c(0xc8)][_0x45018c(0xe3)]();console[_0x45018c(0xe4)](a47_0x3527d4['green']('✓\x20Authentication\x20successful\x0a')),console[_0x45018c(0xe4)](a47_0x3527d4[_0x45018c(0xe6)]('User:')+'\x20'+a47_0x3527d4['cyan'](_0x363cee[_0x45018c(0xea)]));if(_0x363cee[_0x45018c(0xd5)]||_0x363cee[_0x45018c(0xe9)]){const _0x20c66b=[_0x363cee[_0x45018c(0xd5)],_0x363cee['last_name']][_0x45018c(0xd2)](Boolean)[_0x45018c(0xda)]('\x20');console[_0x45018c(0xe4)](a47_0x3527d4[_0x45018c(0xe6)]('Name:')+'\x20'+_0x20c66b);}_0x363cee[_0x45018c(0xd6)]&&console[_0x45018c(0xe4)](a47_0x3527d4[_0x45018c(0xe6)](_0x45018c(0xc7))+'\x20'+a47_0x3527d4[_0x45018c(0xf2)](_0x363cee[_0x45018c(0xd6)])),_0x52a99e=!![];}catch(_0x38b013){_0x38b013 instanceof HTTPClientError&&_0x38b013[_0x45018c(0xe7)]===0x191?printAuthError(_0x38b013,!![],_0x3b02f9):console['error'](a47_0x3527d4['red'](_0x45018c(0xc3)+(_0x38b013 instanceof Error?_0x38b013[_0x45018c(0xef)]:String(_0x38b013))));}return console[_0x45018c(0xe4)](),_0x3699b8[_0x45018c(0xe1)](),_0x52a99e?0x0:0x1;}}