@treasuredata/tdx 2026.4.17 → 2026.4.18

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 (220) 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/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +17 -2
@@ -1 +1 @@
1
- const a40_0x298a92=a40_0x834f;(function(_0x5c95c9,_0x47edaa){const _0x2aa645=a40_0x834f,_0x2c3f79=_0x5c95c9();while(!![]){try{const _0xf98aa7=parseInt(_0x2aa645(0x13d))/0x1+-parseInt(_0x2aa645(0x140))/0x2+parseInt(_0x2aa645(0x185))/0x3*(-parseInt(_0x2aa645(0x149))/0x4)+parseInt(_0x2aa645(0x144))/0x5+-parseInt(_0x2aa645(0x165))/0x6+-parseInt(_0x2aa645(0x141))/0x7+parseInt(_0x2aa645(0x143))/0x8*(parseInt(_0x2aa645(0x14c))/0x9);if(_0xf98aa7===_0x47edaa)break;else _0x2c3f79['push'](_0x2c3f79['shift']());}catch(_0x3e1dce){_0x2c3f79['push'](_0x2c3f79['shift']());}}}(a40_0x229d,0x8cfe6));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x834f(_0x2775e9,_0x20c353){_0x2775e9=_0x2775e9-0x139;const _0x229d21=a40_0x229d();let _0x834f35=_0x229d21[_0x2775e9];return _0x834f35;}import{saveSessionContext}from'../core/session.js';import a40_0x1bc70b from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x356c40 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x229d(){const _0x4ff55f=['944376gTIGES','parent_segment','Error:\x20','\x20\x20🗺️\x20\x20','site','pullSegments','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','587378JoOila','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','-\x20no\x20files\x20written','607162OqpCTq','2234988ZWFASM','\x0aChanges\x20to\x20\x27','4170352xGpfeh','4292175ptHFuq','\x20changed\x20files','diff','cyan','verbose','12vlNatP','green','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','18TzDZGL','activations','\x20=\x20','length','\x20\x20🎯\x20','helpText','filter','dirname','relativePath','error','red','\x20activations','✔\x20All\x20files\x20are\x20up\x20to\x20date','segment:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parentName','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','journeys','dryRun','repeat','message','name','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','utf-8','file','2061900thwyon','\x20files\x20to\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20versions)','\x0aError:','\x20journeys','journeyVersions','\x20with\x20','counts','\x20\x20Target:\x20','segments','targetDir','\x20files?','files','\x20new\x20files','\x20unchanged\x20files','absolutePath','parentSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','setPhase','hasChanges','✔\x20Context\x20set:\x20','yellow','yes','\x27...','content','Target\x20resource:\x20','Parent\x20segment:\x20','execute','isNew','session','dim'];a40_0x229d=function(){return _0x4ff55f;};return a40_0x229d();}export class SegmentPullCommand extends BaseCommand{[a40_0x298a92(0x161)]=a40_0x298a92(0x159);['description']=a40_0x298a92(0x15c);async[a40_0x298a92(0x181)](_0x9648e6){const _0x5c274f=a40_0x298a92,{options:_0x2c7dc6,args:_0x3aaef2,tdx:_0x2278b1}=_0x9648e6,_0x30ad03=_0x2c7dc6,_0x2e7537=await resolveTarget({'arg':_0x3aaef2[0x0],'contextParent':_0x2c7dc6[_0x5c274f(0x176)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2e7537))return _0x2e7537['errorCode']==='no_parent'?(console[_0x5c274f(0x155)](a40_0x1bc70b['yellow'](_0x5c274f(0x13e))),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x5c274f(0x155)](_0x5c274f(0x177)),console[_0x5c274f(0x155)](_0x5c274f(0x15a))):(console['error'](a40_0x1bc70b['red'](_0x5c274f(0x187)+_0x2e7537[_0x5c274f(0x160)]+'\x0a')),_0x2e7537[_0x5c274f(0x151)]&&console[_0x5c274f(0x155)](a40_0x1bc70b[_0x5c274f(0x147)](_0x2e7537[_0x5c274f(0x151)]))),0x1;const _0x3636fd=_0x2e7537[_0x5c274f(0x15b)],_0x5c78b1=_0x2e7537['targetDir'],_0x55bca3=_0x2e7537['type']===_0x5c274f(0x164)?_0x2e7537['resourceName']:undefined;_0x30ad03[_0x5c274f(0x148)]&&(console['error']('Site:\x20'+_0x30ad03[_0x5c274f(0x13a)]),console['error'](_0x5c274f(0x180)+_0x3636fd),_0x55bca3&&console[_0x5c274f(0x155)](_0x5c274f(0x17f)+_0x55bca3));const _0x483d12=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x3636fd+_0x5c274f(0x17d),_0x4271d4=>_0x2278b1['segment'][_0x5c274f(0x13b)](_0x3636fd,{'targetDir':_0x5c78b1,'targetResourceName':_0x55bca3,'verbose':_0x30ad03['verbose'],'progress':{'update':_0x2a921b=>{const _0x501fa8=_0x5c274f;_0x4271d4[_0x501fa8(0x178)](_0x2a921b),_0x30ad03['verbose']&&console['error']('\x20\x20'+_0x2a921b);}}}),{'verbose':_0x30ad03[_0x5c274f(0x148)]}),_0x389406=_0x483d12['data'];if(_0x389406[_0x5c274f(0x16d)][_0x5c274f(0x16f)]===0x0&&_0x389406['counts'][_0x5c274f(0x15d)]===0x0)return console['error'](a40_0x1bc70b[_0x5c274f(0x17b)](_0x5c274f(0x162)+_0x389406[_0x5c274f(0x15b)]+'\x27')),0x0;const _0x369126=_0x389406['files'][_0x5c274f(0x152)](_0x21a544=>_0x21a544[_0x5c274f(0x182)]),_0x389eba=_0x389406[_0x5c274f(0x172)][_0x5c274f(0x152)](_0x3df9ef=>!_0x3df9ef['isNew']&&_0x3df9ef[_0x5c274f(0x179)]),_0x431a14=_0x389406[_0x5c274f(0x172)]['filter'](_0x440927=>!_0x440927['isNew']&&!_0x440927['hasChanges']);console[_0x5c274f(0x155)]('\x0aPull\x20summary\x20for\x20\x27'+_0x389406['parentName']+'\x27:'),console[_0x5c274f(0x155)](_0x5c274f(0x150)+a40_0x1bc70b[_0x5c274f(0x147)](_0x389406[_0x5c274f(0x16d)][_0x5c274f(0x16f)]+'\x20segments')+_0x5c274f(0x16c)+a40_0x1bc70b[_0x5c274f(0x147)](_0x389406[_0x5c274f(0x16d)][_0x5c274f(0x14d)]+_0x5c274f(0x157)));if(_0x389406[_0x5c274f(0x16d)][_0x5c274f(0x15d)]>0x0){const _0x2f9705=_0x389406[_0x5c274f(0x16d)][_0x5c274f(0x16b)]>_0x389406[_0x5c274f(0x16d)][_0x5c274f(0x15d)]?'\x20('+_0x389406[_0x5c274f(0x16d)]['journeyVersions']+_0x5c274f(0x168):'';console[_0x5c274f(0x155)](_0x5c274f(0x139)+a40_0x1bc70b[_0x5c274f(0x147)](_0x389406[_0x5c274f(0x16d)][_0x5c274f(0x15d)]+_0x5c274f(0x16a))+a40_0x1bc70b[_0x5c274f(0x184)](_0x2f9705));}console[_0x5c274f(0x155)]('\x20\x20'+a40_0x1bc70b[_0x5c274f(0x14a)]('+\x20'+_0x369126[_0x5c274f(0x14f)]+_0x5c274f(0x173))),console[_0x5c274f(0x155)]('\x20\x20'+a40_0x1bc70b[_0x5c274f(0x17b)]('~\x20'+_0x389eba[_0x5c274f(0x14f)]+_0x5c274f(0x145))),console[_0x5c274f(0x155)]('\x20\x20'+a40_0x1bc70b['dim']('=\x20'+_0x431a14[_0x5c274f(0x14f)]+_0x5c274f(0x174))),console[_0x5c274f(0x155)](_0x5c274f(0x16e)+a40_0x1bc70b[_0x5c274f(0x147)](_0x389406[_0x5c274f(0x170)])+'\x0a');if(_0x389eba[_0x5c274f(0x14f)]>0x0)for(const _0x578afa of _0x389eba){console[_0x5c274f(0x155)](_0x5c274f(0x142)+_0x578afa[_0x5c274f(0x154)]+'\x27:'),console[_0x5c274f(0x155)]('─'[_0x5c274f(0x15f)](0x3c)),console['error'](_0x578afa[_0x5c274f(0x146)]),console[_0x5c274f(0x155)]('─'[_0x5c274f(0x15f)](0x3c));}if(_0x30ad03[_0x5c274f(0x15e)])return console[_0x5c274f(0x155)](a40_0x1bc70b['yellow'](_0x5c274f(0x13c))),0x0;if(_0x369126['length']===0x0&&_0x389eba[_0x5c274f(0x14f)]===0x0)return console[_0x5c274f(0x155)](a40_0x1bc70b['green'](_0x5c274f(0x158))),saveSessionContext({'parent_segment':_0x389406[_0x5c274f(0x15b)]},_0x30ad03[_0x5c274f(0x183)]),console[_0x5c274f(0x155)](a40_0x1bc70b['green']('✔\x20Context\x20set:\x20'+a40_0x1bc70b['dim']('parent_segment')+_0x5c274f(0x14e)+a40_0x1bc70b['cyan'](_0x389406[_0x5c274f(0x15b)]))),0x0;if(!_0x30ad03[_0x5c274f(0x17c)]){if(!isInteractive())return console[_0x5c274f(0x155)](a40_0x1bc70b[_0x5c274f(0x156)](_0x5c274f(0x169)),_0x5c274f(0x167)),console[_0x5c274f(0x155)](a40_0x1bc70b[_0x5c274f(0x184)](_0x5c274f(0x14b))),0x1;const _0x332fc6=await confirmKey('Write\x20'+(_0x369126[_0x5c274f(0x14f)]+_0x389eba[_0x5c274f(0x14f)])+_0x5c274f(0x171));if(!_0x332fc6)return console['error'](a40_0x1bc70b[_0x5c274f(0x17b)]('Aborted.'),_0x5c274f(0x13f)),0x1;}for(const _0x2815b3 of _0x389406['files']){if(_0x2815b3[_0x5c274f(0x182)]||_0x2815b3[_0x5c274f(0x179)]){const _0x3b986a=a40_0x356c40[_0x5c274f(0x153)](_0x2815b3['absolutePath']);!existsSync(_0x3b986a)&&mkdirSync(_0x3b986a,{'recursive':!![]}),writeFileSync(_0x2815b3[_0x5c274f(0x175)],_0x2815b3[_0x5c274f(0x17e)],_0x5c274f(0x163));}}return console['error'](a40_0x1bc70b[_0x5c274f(0x14a)]('✔\x20Pulled\x20'+(_0x369126['length']+_0x389eba[_0x5c274f(0x14f)])+_0x5c274f(0x166)+_0x389406[_0x5c274f(0x170)])),saveSessionContext({'parent_segment':_0x389406[_0x5c274f(0x15b)]},_0x30ad03[_0x5c274f(0x183)]),console[_0x5c274f(0x155)](a40_0x1bc70b[_0x5c274f(0x14a)](_0x5c274f(0x17a)+a40_0x1bc70b[_0x5c274f(0x184)](_0x5c274f(0x186))+'\x20=\x20'+a40_0x1bc70b[_0x5c274f(0x147)](_0x389406[_0x5c274f(0x15b)]))),0x0;}}
1
+ const a40_0x54fc86=a40_0x1d0e;(function(_0x2e76cb,_0x1c99a3){const _0x3ba57e=a40_0x1d0e,_0x4fff26=_0x2e76cb();while(!![]){try{const _0x992d5a=parseInt(_0x3ba57e(0x6d))/0x1+parseInt(_0x3ba57e(0x76))/0x2+-parseInt(_0x3ba57e(0xbb))/0x3*(-parseInt(_0x3ba57e(0x9c))/0x4)+parseInt(_0x3ba57e(0x6e))/0x5+-parseInt(_0x3ba57e(0x9e))/0x6*(parseInt(_0x3ba57e(0xb6))/0x7)+-parseInt(_0x3ba57e(0x78))/0x8+-parseInt(_0x3ba57e(0x80))/0x9;if(_0x992d5a===_0x1c99a3)break;else _0x4fff26['push'](_0x4fff26['shift']());}catch(_0x1f8dc9){_0x4fff26['push'](_0x4fff26['shift']());}}}(a40_0x2064,0x414af));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_0x416441 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x235494 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a40_0x2064(){const _0x487ebd=['no_parent','1052114bLGrcg','dirname','1219752gWqJIT','filter','yes','counts','hasChanges','files','description','parentName','1172475Dqwndv','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dryRun','journeys','\x20with\x20','\x20\x20🎯\x20','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)','\x20new\x20files','dim','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Aborted.','targetDir','\x20=\x20','\x27...','data','red','absolutePath','length','activations','\x20unchanged\x20files','Site:\x20','content','message','pullSegments','name','\x20files?','diff','file','96332ERHoYW','type','222mVTrsy','parentSegment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','yellow','cwd','\x20\x20Target:\x20','Pulling\x20segments\x20from\x20\x27','\x0aChanges\x20to\x20\x27','\x20changed\x20files','errorCode','resourceName','✔\x20Pulled\x20','isNew','cyan','repeat','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segments','execute','utf-8','verbose','parent_segment','segment:pull','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','setPhase','85393wUliwN','journeyVersions','✔\x20All\x20files\x20are\x20up\x20to\x20date','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','45uWhgrL','\x20segments','segment','✔\x20Context\x20set:\x20','110454WTSEnO','18950iTCKQY','session','error','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','helpText','\x20files\x20to\x20','relativePath'];a40_0x2064=function(){return _0x487ebd;};return a40_0x2064();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x1d0e(_0x438ecf,_0x1e2dfa){_0x438ecf=_0x438ecf-0x6a;const _0x2064bf=a40_0x2064();let _0x1d0e41=_0x2064bf[_0x438ecf];return _0x1d0e41;}export class SegmentPullCommand extends BaseCommand{[a40_0x54fc86(0x98)]=a40_0x54fc86(0xb3);[a40_0x54fc86(0x7e)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x54fc86(0xaf)](_0xa7564a){const _0x1b3c9f=a40_0x54fc86,{options:_0x3aeadf,args:_0xd441,tdx:_0x3c07b6}=_0xa7564a,_0x2faea1=_0x3aeadf,_0xa08df3=await resolveTarget({'arg':_0xd441[0x0],'contextParent':_0x3aeadf[_0x1b3c9f(0x9f)],'cwd':process[_0x1b3c9f(0xa2)]()});if(!isSuccessfulResolution(_0xa08df3))return _0xa08df3[_0x1b3c9f(0xa7)]===_0x1b3c9f(0x75)?(console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xa1)](_0x1b3c9f(0xb4))),console[_0x1b3c9f(0x70)](_0x1b3c9f(0x86)),console[_0x1b3c9f(0x70)](_0x1b3c9f(0xba)),console[_0x1b3c9f(0x70)](_0x1b3c9f(0xad))):(console['error'](a40_0x416441[_0x1b3c9f(0x8f)]('Error:\x20'+_0xa08df3[_0x1b3c9f(0x96)]+'\x0a')),_0xa08df3[_0x1b3c9f(0x72)]&&console[_0x1b3c9f(0x70)](a40_0x416441['cyan'](_0xa08df3[_0x1b3c9f(0x72)]))),0x1;const _0xa6b8ae=_0xa08df3[_0x1b3c9f(0x7f)],_0x23bbc8=_0xa08df3[_0x1b3c9f(0x8b)],_0x1bf450=_0xa08df3[_0x1b3c9f(0x9d)]===_0x1b3c9f(0x9b)?_0xa08df3[_0x1b3c9f(0xa8)]:undefined;_0x2faea1[_0x1b3c9f(0xb1)]&&(console[_0x1b3c9f(0x70)](_0x1b3c9f(0x94)+_0x2faea1['site']),console[_0x1b3c9f(0x70)]('Parent\x20segment:\x20'+_0xa6b8ae),_0x1bf450&&console[_0x1b3c9f(0x70)]('Target\x20resource:\x20'+_0x1bf450));const _0x1f0d76=await withProgressSpinner(_0x1b3c9f(0xa4)+_0xa6b8ae+_0x1b3c9f(0x8d),_0x266852=>_0x3c07b6[_0x1b3c9f(0x6b)][_0x1b3c9f(0x97)](_0xa6b8ae,{'targetDir':_0x23bbc8,'targetResourceName':_0x1bf450,'verbose':_0x2faea1[_0x1b3c9f(0xb1)],'progress':{'update':_0x413164=>{const _0x275735=_0x1b3c9f;_0x266852[_0x275735(0xb5)](_0x413164),_0x2faea1[_0x275735(0xb1)]&&console['error']('\x20\x20'+_0x413164);}}}),{'verbose':_0x2faea1[_0x1b3c9f(0xb1)]}),_0x4a8e7e=_0x1f0d76[_0x1b3c9f(0x8e)];if(_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0xae)]===0x0&&_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0x83)]===0x0)return console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xa1)](_0x1b3c9f(0x89)+_0x4a8e7e[_0x1b3c9f(0x7f)]+'\x27')),0x0;const _0x1d202a=_0x4a8e7e[_0x1b3c9f(0x7d)][_0x1b3c9f(0x79)](_0x3570bc=>_0x3570bc[_0x1b3c9f(0xaa)]),_0xef6256=_0x4a8e7e[_0x1b3c9f(0x7d)]['filter'](_0x529555=>!_0x529555[_0x1b3c9f(0xaa)]&&_0x529555[_0x1b3c9f(0x7c)]),_0x15b9d4=_0x4a8e7e[_0x1b3c9f(0x7d)][_0x1b3c9f(0x79)](_0x51f556=>!_0x51f556[_0x1b3c9f(0xaa)]&&!_0x51f556[_0x1b3c9f(0x7c)]);console[_0x1b3c9f(0x70)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4a8e7e['parentName']+'\x27:'),console['error'](_0x1b3c9f(0x85)+a40_0x416441['cyan'](_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0xae)]+_0x1b3c9f(0x6a))+_0x1b3c9f(0x84)+a40_0x416441[_0x1b3c9f(0xab)](_0x4a8e7e['counts'][_0x1b3c9f(0x92)]+'\x20activations'));if(_0x4a8e7e['counts'][_0x1b3c9f(0x83)]>0x0){const _0x3743ae=_0x4a8e7e[_0x1b3c9f(0x7b)]['journeyVersions']>_0x4a8e7e[_0x1b3c9f(0x7b)]['journeys']?'\x20('+_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0xb7)]+'\x20versions)':'';console[_0x1b3c9f(0x70)]('\x20\x20🗺️\x20\x20'+a40_0x416441['cyan'](_0x4a8e7e['counts'][_0x1b3c9f(0x83)]+'\x20journeys')+a40_0x416441[_0x1b3c9f(0x88)](_0x3743ae));}console[_0x1b3c9f(0x70)]('\x20\x20'+a40_0x416441[_0x1b3c9f(0xb9)]('+\x20'+_0x1d202a[_0x1b3c9f(0x91)]+_0x1b3c9f(0x87))),console[_0x1b3c9f(0x70)]('\x20\x20'+a40_0x416441[_0x1b3c9f(0xa1)]('~\x20'+_0xef6256['length']+_0x1b3c9f(0xa6))),console['error']('\x20\x20'+a40_0x416441[_0x1b3c9f(0x88)]('=\x20'+_0x15b9d4[_0x1b3c9f(0x91)]+_0x1b3c9f(0x93))),console[_0x1b3c9f(0x70)](_0x1b3c9f(0xa3)+a40_0x416441['cyan'](_0x4a8e7e[_0x1b3c9f(0x8b)])+'\x0a');if(_0xef6256[_0x1b3c9f(0x91)]>0x0)for(const _0x58fbe1 of _0xef6256){console[_0x1b3c9f(0x70)](_0x1b3c9f(0xa5)+_0x58fbe1[_0x1b3c9f(0x74)]+'\x27:'),console['error']('─'[_0x1b3c9f(0xac)](0x3c)),console[_0x1b3c9f(0x70)](_0x58fbe1[_0x1b3c9f(0x9a)]),console[_0x1b3c9f(0x70)]('─'[_0x1b3c9f(0xac)](0x3c));}if(_0x2faea1[_0x1b3c9f(0x82)])return console['error'](a40_0x416441['yellow'](_0x1b3c9f(0x71))),0x0;if(_0x1d202a[_0x1b3c9f(0x91)]===0x0&&_0xef6256[_0x1b3c9f(0x91)]===0x0)return console['error'](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0xb8))),saveSessionContext({'parent_segment':_0x4a8e7e[_0x1b3c9f(0x7f)]},_0x2faea1[_0x1b3c9f(0x6f)]),console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0x6c)+a40_0x416441[_0x1b3c9f(0x88)]('parent_segment')+_0x1b3c9f(0x8c)+a40_0x416441['cyan'](_0x4a8e7e[_0x1b3c9f(0x7f)]))),0x0;if(!_0x2faea1[_0x1b3c9f(0x7a)]){if(!isInteractive())return console['error'](a40_0x416441['red']('\x0aError:'),_0x1b3c9f(0xa0)),console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0x88)](_0x1b3c9f(0x81))),0x1;const _0x3203a3=await confirmKey('Write\x20'+(_0x1d202a[_0x1b3c9f(0x91)]+_0xef6256[_0x1b3c9f(0x91)])+_0x1b3c9f(0x99));if(!_0x3203a3)return console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xa1)](_0x1b3c9f(0x8a)),'-\x20no\x20files\x20written'),0x1;}for(const _0x4d2572 of _0x4a8e7e[_0x1b3c9f(0x7d)]){if(_0x4d2572[_0x1b3c9f(0xaa)]||_0x4d2572['hasChanges']){const _0xb368ed=a40_0x235494[_0x1b3c9f(0x77)](_0x4d2572['absolutePath']);!existsSync(_0xb368ed)&&mkdirSync(_0xb368ed,{'recursive':!![]}),writeFileSync(_0x4d2572[_0x1b3c9f(0x90)],_0x4d2572[_0x1b3c9f(0x95)],_0x1b3c9f(0xb0));}}return console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0xa9)+(_0x1d202a[_0x1b3c9f(0x91)]+_0xef6256[_0x1b3c9f(0x91)])+_0x1b3c9f(0x73)+_0x4a8e7e[_0x1b3c9f(0x8b)])),saveSessionContext({'parent_segment':_0x4a8e7e[_0x1b3c9f(0x7f)]},_0x2faea1[_0x1b3c9f(0x6f)]),console['error'](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0x6c)+a40_0x416441[_0x1b3c9f(0x88)](_0x1b3c9f(0xb2))+_0x1b3c9f(0x8c)+a40_0x416441[_0x1b3c9f(0xab)](_0x4a8e7e[_0x1b3c9f(0x7f)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x3fab19=a41_0x5722;(function(_0x3cf9ec,_0x3e366a){const _0x9f2705=a41_0x5722,_0x512e55=_0x3cf9ec();while(!![]){try{const _0x58330f=-parseInt(_0x9f2705(0x22f))/0x1+parseInt(_0x9f2705(0x22e))/0x2*(parseInt(_0x9f2705(0x220))/0x3)+parseInt(_0x9f2705(0x24d))/0x4*(-parseInt(_0x9f2705(0x250))/0x5)+parseInt(_0x9f2705(0x1f7))/0x6+parseInt(_0x9f2705(0x280))/0x7+parseInt(_0x9f2705(0x207))/0x8*(-parseInt(_0x9f2705(0x27b))/0x9)+parseInt(_0x9f2705(0x211))/0xa;if(_0x58330f===_0x3e366a)break;else _0x512e55['push'](_0x512e55['shift']());}catch(_0x5c3dd3){_0x512e55['push'](_0x512e55['shift']());}}}(a41_0xd3bc,0x41da4));import{BaseCommand}from'./command.js';function a41_0xd3bc(){const _0x82a438=['\x20deleted','\x20folders\x20to\x20create','\x20new','cyan','\x20\x20Segments:\x20','updated','\x20activations]','\x20\x20Activations:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20changes?','segments','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','nameToId','attributes','toDelete','segmentFolderId','user','360caCWMM','isNew','\x20created','Fetching\x20existing\x20activations...','no_parent','1995392hAjVGr','length','createdSegmentIds','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','yamlConfig','existingSegment','parentSegment','\x20\x20🗺️\x20\x20Journeys:','/j/da/je','Changes\x20to\x20journey:','📁\x20','journeyBundleId','Error\x20parsing\x20YAML:\x20','endsWith','get','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','cwd','Delete\x20segment:','relationships','resolveParentId','map','373728cXFBPa','green','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','execute','diff','toUpdate','join','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Site:\x20','Folders\x20to\x20create:','red','scopedFolderPath','\x20\x20Source:\x20','type','push','73144sSRFbr','journey','\x20changed','site','description','listFolders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','data','journeys','setPhase','4177860chHfQu','\x20\x20📊\x20Segments:','filter','Fetching\x20existing\x20data...','results','unchanged','verbose','file','segment','updatedAt','buildUserMaps','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','error','versionNumber','6qhNsZA','add','audienceId','activations','then','repeat','getOutputSchemaWithCache','listSegments','folders','parentFolder','delete','Changes\x20to:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20updated','443514ozFBem','363572SuUoyG','blue','New\x20segment:','idToName','\x20to\x20delete','Delete\x20journey:','set','paused','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','new','state','\x20to\x20create','message','\x20to\x20update','Push\x20','Resolving\x20parent\x20segment\x20\x27','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','changed','toCreate','Parent\x20segment:\x20','targetDir','helpText','Error:\x20Directory\x20not\x20found:\x20','connection','/e/','all','.yml','getJourney','createdAt','\x20\x20\x20\x20','1880scQNGE','yellow','\x20unchanged','2230FtJltJ','isScoped','.yaml','journeyId','name','created','\x27...','Scoped\x20to\x20folder:\x20','journeysOnly','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)','folderPath','\x0aValidation\x20failed:','existingJourney','segment\x20or\x20journey','New\x20journey:','Aborted.','parentName','Fetching\x20connections\x20for\x20name\x20resolution...','/app/ps/','listActivations','folderId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','/sb/da/esr','errorCode','dryRun','dim'];a41_0xd3bc=function(){return _0x82a438;};return a41_0xd3bc();}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_0x3e617e from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a41_0x5722(_0x623509,_0x896711){_0x623509=_0x623509-0x1f1;const _0xd3bcbe=a41_0xd3bc();let _0x572220=_0xd3bcbe[_0x623509];return _0x572220;}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{['name']='segment:push';[a41_0x3fab19(0x20b)]=a41_0x3fab19(0x1f1);async[a41_0x3fab19(0x1fa)](_0x3128fe){const _0x39adbf=a41_0x3fab19,{options:_0x1f2727,args:_0x1ae693,tdx:_0x1fdc2c}=_0x3128fe,_0x32e703=_0x1f2727,_0x34d80b=await resolveTarget({'arg':_0x1ae693[0x0],'contextParent':_0x1f2727[_0x39adbf(0x286)],'cwd':process[_0x39adbf(0x1f2)]()});if(!isSuccessfulResolution(_0x34d80b))return _0x34d80b[_0x39adbf(0x267)]===_0x39adbf(0x27f)?(console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x24e)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x39adbf(0x21e)](_0x39adbf(0x259)),console[_0x39adbf(0x21e)](_0x39adbf(0x20d)),console[_0x39adbf(0x21e)](_0x39adbf(0x283))):(console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x202)]('Error:\x20'+_0x34d80b[_0x39adbf(0x23b)]+'\x0a')),_0x34d80b['helpText']&&console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x26d)](_0x34d80b[_0x39adbf(0x244)]))),0x1;if(_0x34d80b['type']==='parent_name')return console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x202)]('Error:\x20Directory\x20not\x20found:\x20'+_0x34d80b[_0x39adbf(0x243)]+'\x0a')),console[_0x39adbf(0x21e)](a41_0x3e617e['cyan'](_0x39adbf(0x23f))),0x1;const _0x51a450=_0x34d80b[_0x39adbf(0x260)],_0x3d69d3=_0x34d80b[_0x39adbf(0x243)],_0x151363=_0x34d80b[_0x39adbf(0x205)]===_0x39adbf(0x218)?_0x34d80b['filePath']:undefined,_0x2b23a9=getScopedDetails(_0x34d80b),_0x5d334f=_0x2b23a9?.[_0x39adbf(0x251)]??![],_0x341a93=_0x2b23a9?.[_0x39adbf(0x203)]??'';if(!existsSync(_0x3d69d3))return console['error'](a41_0x3e617e[_0x39adbf(0x202)](_0x39adbf(0x245)+_0x3d69d3+'\x0a')),console[_0x39adbf(0x21e)](a41_0x3e617e['cyan'](_0x39adbf(0x23f))),0x1;_0x32e703[_0x39adbf(0x217)]&&(console[_0x39adbf(0x21e)](_0x39adbf(0x200)+_0x32e703[_0x39adbf(0x20a)]),console[_0x39adbf(0x21e)](_0x39adbf(0x242)+_0x51a450),console[_0x39adbf(0x21e)]('Source\x20directory:\x20'+_0x3d69d3),_0x5d334f&&console[_0x39adbf(0x21e)](_0x39adbf(0x257)+_0x341a93));const _0x4b8822=await withSpinner(_0x39adbf(0x23e)+_0x51a450+_0x39adbf(0x256),()=>_0x1fdc2c['segment'][_0x39adbf(0x1f5)](_0x51a450),{'verbose':_0x32e703[_0x39adbf(0x217)]}),_0xdd081=_0x4b8822[_0x39adbf(0x20e)],{parentSegmentResult:_0x3d74ce,segmentsResult:_0x556f3e,foldersResult:_0x301268,journeysWithDetailsResult:_0x134e75,userMaps:_0x23c7f6}=await withSpinner(_0x39adbf(0x214),async()=>{const _0x548af5=_0x39adbf,[_0x16405c,_0x2be183,_0x5bbf2c,_0x2a00b0,_0xe29d7c]=await Promise[_0x548af5(0x248)]([_0x1fdc2c[_0x548af5(0x219)]['getParent'](_0xdd081),_0x1fdc2c[_0x548af5(0x219)][_0x548af5(0x227)](_0xdd081),_0x1fdc2c[_0x548af5(0x219)][_0x548af5(0x20c)](_0xdd081),_0x1fdc2c[_0x548af5(0x208)]['listJourneysWithDetailsFromParentSegment'](_0xdd081,{'includeAllVersions':!![]}),_0x1fdc2c['user'][_0x548af5(0x21b)]()]);return{'parentSegmentResult':_0x16405c,'segmentsResult':_0x2be183,'foldersResult':_0x5bbf2c,'journeysWithDetailsResult':_0x2a00b0,'userMaps':_0xe29d7c};},{'verbose':_0x32e703['verbose']})[_0x39adbf(0x224)](_0x423bc7=>_0x423bc7[_0x39adbf(0x20e)]),_0x18f03a=_0x3d74ce,_0x2bdf3f=extractRootFolderId(_0x18f03a),_0x10f4ae=_0x556f3e,_0x58fd0d=_0x301268,{journeys:_0x197cd4,activationStepsById:_0x5f4fff}=_0x134e75,_0x1d5ca8=new Map(_0x197cd4[_0x39adbf(0x1f6)](_0x616878=>[_0x616878['id'],_0x616878])),_0x5d36c5=_0x197cd4[_0x39adbf(0x1f6)](_0x246b9b=>({'id':_0x246b9b['id'],'name':_0x246b9b[_0x39adbf(0x277)][_0x39adbf(0x254)],'journeyBundleName':_0x246b9b[_0x39adbf(0x277)]['journeyBundleName']||'','journeyBundleId':_0x246b9b[_0x39adbf(0x277)][_0x39adbf(0x28b)]||'','versionNumber':_0x246b9b[_0x39adbf(0x277)][_0x39adbf(0x21f)],'description':_0x246b9b[_0x39adbf(0x277)][_0x39adbf(0x20b)],'state':_0x246b9b['attributes'][_0x39adbf(0x239)],'paused':_0x246b9b[_0x39adbf(0x277)][_0x39adbf(0x236)],'audienceId':_0x246b9b['attributes'][_0x39adbf(0x222)],'folderId':_0x246b9b[_0x39adbf(0x1f4)]?.[_0x39adbf(0x229)]?.['data']?.['id'],'createdAt':_0x246b9b[_0x39adbf(0x277)][_0x39adbf(0x24b)],'updatedAt':_0x246b9b[_0x39adbf(0x277)][_0x39adbf(0x21a)]})),{emailToId:_0x325131,idToEmail:_0x5746a1}=_0x23c7f6,_0x4b3ed=await withSpinner(_0x39adbf(0x261),async()=>{const _0x235d77=_0x39adbf,_0x5dd0f5=await _0x1fdc2c[_0x235d77(0x246)]['list']();return buildConnectionMaps(_0x5dd0f5);},{'verbose':_0x32e703[_0x39adbf(0x217)]})[_0x39adbf(0x224)](_0x3339f1=>_0x3339f1[_0x39adbf(0x20e)]),_0x2da41e=_0x4b3ed[_0x39adbf(0x276)],_0x48d918=_0x4b3ed['idToName'],_0x84fa61=_0x4b3ed['nameToType'],_0x4d8052={'emailToIdMap':_0x325131,'connectionNameToIdMap':_0x2da41e,'connectionNameToTypeMap':_0x84fa61,'getSchema':_0x3ad04d=>_0x1fdc2c[_0x39adbf(0x246)][_0x39adbf(0x226)](_0x3ad04d)};let {pathToId:_0x2bdb2d,idToPath:_0x53cb21}=buildFolderMaps(_0x58fd0d);const _0x39e410=buildSegmentLookupMap(_0x10f4ae,_0x53cb21),_0x37b03e=buildSegmentNameToIdMap(_0x10f4ae),_0x46fb60=buildJourneyBundleLookupMap(_0x5d36c5,_0x53cb21);let _0x19b4b4;if(_0x151363){if(!_0x151363[_0x39adbf(0x28d)](_0x39adbf(0x249))&&!_0x151363['endsWith'](_0x39adbf(0x252)))return console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x202)](_0x39adbf(0x272)+_0x151363+'\x0a')),0x1;_0x19b4b4=[_0x151363];}else _0x19b4b4=findYamlFiles(_0x3d69d3);if(_0x19b4b4[_0x39adbf(0x281)]===0x0)return console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x202)](_0x39adbf(0x265)+_0x3d69d3+'\x0a')),console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x26d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x2b884b,_0x7b4a82;try{const _0x5bc042=parseAndClassifyYamlFiles(_0x19b4b4,_0x3d69d3,{'skipSegments':_0x32e703['journeysOnly']});_0x2b884b=_0x5bc042[_0x39adbf(0x274)],_0x7b4a82=_0x5bc042[_0x39adbf(0x20f)];const _0x4ca78b=validateParsedFiles(_0x5bc042,_0x3d69d3);if(_0x4ca78b['length']>0x0)return console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x202)](_0x39adbf(0x25b))),console[_0x39adbf(0x21e)](formatValidationErrors(_0x4ca78b)),console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x24e)](_0x39adbf(0x275))),0x1;}catch(_0xee8704){return console[_0x39adbf(0x21e)](a41_0x3e617e['red'](_0x39adbf(0x28c)+(_0xee8704 instanceof Error?_0xee8704[_0x39adbf(0x23b)]:_0xee8704))),0x1;}if(_0x2b884b[_0x39adbf(0x281)]===0x0&&_0x7b4a82['length']===0x0){const _0x1ca1fb=_0x32e703[_0x39adbf(0x258)]?_0x39adbf(0x208):_0x39adbf(0x25d);return console[_0x39adbf(0x21e)](a41_0x3e617e['yellow']('No\x20'+_0x1ca1fb+'\x20YAML\x20files\x20found')),0x0;}const _0x26de3b=new Map();_0x10f4ae[_0x39adbf(0x281)]>0x0&&!_0x32e703[_0x39adbf(0x258)]&&await withSpinner(_0x39adbf(0x27e),async()=>{await batchAsync(_0x10f4ae,async _0x243815=>{const _0x5322fa=a41_0x5722,_0x491325=await _0x1fdc2c[_0x5322fa(0x219)][_0x5322fa(0x263)](_0xdd081,_0x243815['id']);_0x26de3b[_0x5322fa(0x235)](_0x243815['id'],_0x491325);});},{'verbose':_0x32e703[_0x39adbf(0x217)]});const {segmentFiles:_0x3f58db,foldersToCreate:_0x206d80}=await prepareSegmentFiles(_0x2b884b,{'segmentByFolderAndName':_0x39e410,'activationsBySegmentId':_0x26de3b,'folderPathToId':_0x2bdb2d,'idToEmailMap':_0x5746a1,'connectionIdToNameMap':_0x48d918},_0x4d8052,_0x5d334f,_0x341a93),_0x511a6d=_0x151363?[]:findSegmentsToDelete(_0x10f4ae,_0x2b884b[_0x39adbf(0x1f6)](({yamlConfig:_0x2e6d55,folderPath:_0x5be655})=>({'yamlConfig':_0x2e6d55,'folderPath':resolveTDFolderPath(_0x5be655,_0x5d334f,_0x341a93)})),_0x53cb21,_0x341a93,_0x5d334f),{journeyFiles:_0x246a12,foldersToCreate:_0x64e022}=await withProgressSpinner('Preparing\x20journeys...',async _0x432423=>prepareJourneyFiles(_0x7b4a82,{'fetchJourney':async _0x31e6b3=>_0x1fdc2c[_0x39adbf(0x208)][_0x39adbf(0x24a)](_0x31e6b3[_0x39adbf(0x253)]),'journeyBundlesByFolderAndName':_0x46fb60,'folderPathToId':_0x2bdb2d,'idToEmailMap':_0x5746a1,'connectionIdToNameMap':_0x48d918,'existingSegments':_0x10f4ae,'parentId':_0xdd081,'deps':_0x1fdc2c,'progress':{'update':_0x1a153f=>{const _0x484308=_0x39adbf;_0x432423[_0x484308(0x210)](_0x1a153f),_0x32e703[_0x484308(0x217)]&&console['error']('\x20\x20'+_0x1a153f);}},'journeyById':_0x1d5ca8,'activationStepsById':_0x5f4fff},_0x5d334f,_0x341a93),{'verbose':_0x32e703[_0x39adbf(0x217)]})[_0x39adbf(0x224)](_0x8028f2=>_0x8028f2[_0x39adbf(0x20e)]);for(const _0x3cb685 of _0x64e022){_0x206d80[_0x39adbf(0x221)](_0x3cb685);}const _0x2a426b=_0x151363?[]:findJourneysToDelete(_0x5d36c5,_0x7b4a82['map'](({yamlConfig:_0x10739e,folderPath:_0x145d81})=>({'yamlConfig':_0x10739e,'folderPath':resolveTDFolderPath(_0x145d81,_0x5d334f,_0x341a93)})),_0x53cb21,_0x341a93,_0x5d334f),_0x400c17=calculatePushStats(_0x3f58db,_0x246a12,_0x206d80,_0x511a6d,_0x2a426b,!!_0x32e703[_0x39adbf(0x22a)],!!_0x32e703[_0x39adbf(0x258)]),_0x1c6c08=_0x400c17[_0x39adbf(0x274)][_0x39adbf(0x238)],_0x13528c=_0x400c17[_0x39adbf(0x274)][_0x39adbf(0x240)],_0x52a743=_0x400c17['segments'][_0x39adbf(0x216)],_0x2c5662=_0x400c17[_0x39adbf(0x274)][_0x39adbf(0x278)],_0x20b26a=_0x400c17[_0x39adbf(0x228)][_0x39adbf(0x241)],_0x2ee511=_0x400c17[_0x39adbf(0x20f)][_0x39adbf(0x238)],_0x38355f=_0x400c17[_0x39adbf(0x20f)][_0x39adbf(0x240)],_0x36e7f3=_0x400c17[_0x39adbf(0x20f)][_0x39adbf(0x216)],_0x49364c=_0x400c17[_0x39adbf(0x20f)][_0x39adbf(0x278)],_0x3f36b0=_0x400c17['activations'][_0x39adbf(0x248)],_0xcf6088=_0x400c17['activations'][_0x39adbf(0x241)],_0x2843b1=_0x400c17[_0x39adbf(0x223)][_0x39adbf(0x1fc)],_0x8e5fe5=_0x400c17[_0x39adbf(0x223)]['toDelete'];console[_0x39adbf(0x21e)]('\x0aPush\x20summary\x20for\x20\x27'+_0x51a450+'\x27:');_0x20b26a[_0x39adbf(0x281)]>0x0&&console[_0x39adbf(0x21e)]('\x20\x20'+a41_0x3e617e['blue'](_0x39adbf(0x28a)+_0x20b26a['length']+_0x39adbf(0x26b)));if(!_0x32e703['journeysOnly']){console[_0x39adbf(0x21e)](_0x39adbf(0x212)),console['error'](_0x39adbf(0x24c)+a41_0x3e617e[_0x39adbf(0x1f8)]('+\x20'+_0x1c6c08[_0x39adbf(0x281)]+_0x39adbf(0x26c))),console[_0x39adbf(0x21e)](_0x39adbf(0x24c)+a41_0x3e617e['yellow']('~\x20'+_0x13528c[_0x39adbf(0x281)]+_0x39adbf(0x209)));if(_0x2c5662[_0x39adbf(0x281)]>0x0)console['error'](_0x39adbf(0x24c)+a41_0x3e617e['red']('-\x20'+_0x2c5662[_0x39adbf(0x281)]+'\x20to\x20delete'));else _0x511a6d['length']>0x0&&!_0x32e703[_0x39adbf(0x22a)]&&console['error'](_0x39adbf(0x24c)+a41_0x3e617e[_0x39adbf(0x269)](_0x511a6d[_0x39adbf(0x281)]+_0x39adbf(0x21d)));console[_0x39adbf(0x21e)]('\x20\x20\x20\x20'+a41_0x3e617e[_0x39adbf(0x269)]('=\x20'+_0x52a743[_0x39adbf(0x281)]+_0x39adbf(0x24f)));}if(_0x246a12['length']>0x0||_0x2a426b[_0x39adbf(0x281)]>0x0){console[_0x39adbf(0x21e)](_0x39adbf(0x287)),console[_0x39adbf(0x21e)](_0x39adbf(0x24c)+a41_0x3e617e[_0x39adbf(0x1f8)]('+\x20'+_0x2ee511[_0x39adbf(0x281)]+_0x39adbf(0x26c))),console[_0x39adbf(0x21e)]('\x20\x20\x20\x20'+a41_0x3e617e[_0x39adbf(0x24e)]('~\x20'+_0x38355f['length']+_0x39adbf(0x209)));if(_0x49364c[_0x39adbf(0x281)]>0x0)console['error'](_0x39adbf(0x24c)+a41_0x3e617e[_0x39adbf(0x202)]('-\x20'+_0x49364c[_0x39adbf(0x281)]+_0x39adbf(0x233)));else _0x2a426b['length']>0x0&&!_0x32e703[_0x39adbf(0x22a)]&&console['error'](_0x39adbf(0x24c)+a41_0x3e617e[_0x39adbf(0x269)](_0x2a426b['length']+_0x39adbf(0x21d)));console['error'](_0x39adbf(0x24c)+a41_0x3e617e['dim']('=\x20'+_0x36e7f3[_0x39adbf(0x281)]+_0x39adbf(0x24f)));}_0x3f36b0['length']>0x0&&!_0x32e703[_0x39adbf(0x258)]&&(console[_0x39adbf(0x21e)](''),console[_0x39adbf(0x21e)]('\x20\x20Activations:'),_0xcf6088['length']>0x0&&console[_0x39adbf(0x21e)]('\x20\x20\x20\x20'+a41_0x3e617e[_0x39adbf(0x1f8)]('+\x20'+_0xcf6088[_0x39adbf(0x281)]+_0x39adbf(0x23a))),_0x2843b1[_0x39adbf(0x281)]>0x0&&console[_0x39adbf(0x21e)]('\x20\x20\x20\x20'+a41_0x3e617e[_0x39adbf(0x24e)]('~\x20'+_0x2843b1[_0x39adbf(0x281)]+_0x39adbf(0x23c))),_0x8e5fe5['length']>0x0&&console[_0x39adbf(0x21e)]('\x20\x20\x20\x20'+a41_0x3e617e[_0x39adbf(0x202)]('-\x20'+_0x8e5fe5[_0x39adbf(0x281)]+'\x20to\x20delete')));console[_0x39adbf(0x21e)](_0x39adbf(0x204)+a41_0x3e617e[_0x39adbf(0x26d)](_0x3d69d3)+'\x0a');if(_0x20b26a[_0x39adbf(0x281)]>0x0){console[_0x39adbf(0x21e)](_0x39adbf(0x201));for(const _0x278c34 of _0x20b26a){console[_0x39adbf(0x21e)]('\x20\x20'+a41_0x3e617e[_0x39adbf(0x230)]('+')+'\x20'+_0x278c34);}console['error']('');}if(_0x1c6c08[_0x39adbf(0x281)]>0x0&&!_0x32e703['journeysOnly'])for(const _0x2d95d7 of _0x1c6c08){const _0x54181d=_0x2d95d7[_0x39adbf(0x25a)]?_0x2d95d7['folderPath']+'/'+_0x2d95d7['yamlConfig'][_0x39adbf(0x254)]:_0x2d95d7['yamlConfig'][_0x39adbf(0x254)],_0xab4795=_0x2d95d7['yamlConfig']['activations']?.[_0x39adbf(0x281)]||0x0,_0xf55d25=_0xab4795>0x0?a41_0x3e617e[_0x39adbf(0x269)]('\x20['+_0xab4795+_0x39adbf(0x270)):'';console[_0x39adbf(0x21e)]('\x0a'+a41_0x3e617e['green'](_0x39adbf(0x231))+'\x20'+_0x54181d+_0xf55d25),console[_0x39adbf(0x21e)]('─'[_0x39adbf(0x225)](0x3c)),_0x2d95d7[_0x39adbf(0x1fb)]&&console['error'](_0x2d95d7[_0x39adbf(0x1fb)]),console[_0x39adbf(0x21e)]('─'['repeat'](0x3c));}if(_0x2c5662[_0x39adbf(0x281)]>0x0&&!_0x32e703[_0x39adbf(0x258)])for(const _0xe9ca38 of _0x2c5662){const _0x2027f8=_0xe9ca38[_0x39adbf(0x279)]?_0x53cb21['get'](_0xe9ca38[_0x39adbf(0x279)]['toString']())||'':'',_0x13d40f=_0x2027f8?_0x2027f8+'/'+_0xe9ca38[_0x39adbf(0x254)]:_0xe9ca38['name'],_0x55f101=_0x26de3b['get'](_0xe9ca38['id'])||[],_0x1108d0=_0x55f101[_0x39adbf(0x281)]>0x0?a41_0x3e617e[_0x39adbf(0x269)]('\x20['+_0x55f101[_0x39adbf(0x281)]+_0x39adbf(0x270)):'';console[_0x39adbf(0x21e)]('\x0a'+a41_0x3e617e[_0x39adbf(0x202)](_0x39adbf(0x1f3))+'\x20'+_0x13d40f+_0x1108d0),console[_0x39adbf(0x21e)]('─'['repeat'](0x3c));const _0x4d8ff7=segmentWithActivationsToYaml(_0xe9ca38,_0x55f101,undefined,_0x5746a1,_0x48d918),_0x412768=segmentToYamlString(_0x4d8ff7),_0x594a51=generateDiff(_0x412768,'');console[_0x39adbf(0x21e)](formatDiffWithColors(_0x594a51)),console[_0x39adbf(0x21e)]('─'[_0x39adbf(0x225)](0x3c));}const _0x141902=_0x3f58db[_0x39adbf(0x213)](_0x45a641=>!_0x45a641[_0x39adbf(0x27c)]&&_0x45a641['diff']);if(_0x141902[_0x39adbf(0x281)]>0x0&&!_0x32e703[_0x39adbf(0x258)])for(const _0x39ab49 of _0x141902){const _0x31c2a2=_0x39ab49[_0x39adbf(0x25a)]?_0x39ab49[_0x39adbf(0x25a)]+'/'+_0x39ab49['yamlConfig']['name']:_0x39ab49['yamlConfig']['name'];console[_0x39adbf(0x21e)]('\x0a'+a41_0x3e617e[_0x39adbf(0x24e)](_0x39adbf(0x22b))+'\x20'+_0x31c2a2),console[_0x39adbf(0x21e)]('─'['repeat'](0x3c)),console[_0x39adbf(0x21e)](_0x39ab49['diff']),console[_0x39adbf(0x21e)]('─'[_0x39adbf(0x225)](0x3c));}if(_0x2ee511['length']>0x0)for(const _0x2359d1 of _0x2ee511){const _0x305727=_0x2359d1[_0x39adbf(0x25a)]?_0x2359d1[_0x39adbf(0x25a)]+'/'+_0x2359d1['yamlConfig'][_0x39adbf(0x254)]:_0x2359d1[_0x39adbf(0x284)][_0x39adbf(0x254)];console[_0x39adbf(0x21e)]('\x0a'+a41_0x3e617e['green'](_0x39adbf(0x25e))+'\x20'+_0x305727),console['error']('─'[_0x39adbf(0x225)](0x3c)),_0x2359d1[_0x39adbf(0x1fb)]&&console['error'](_0x2359d1[_0x39adbf(0x1fb)]),console[_0x39adbf(0x21e)]('─'[_0x39adbf(0x225)](0x3c));}const _0x3666b0=_0x246a12[_0x39adbf(0x213)](_0x385be8=>!_0x385be8[_0x39adbf(0x27c)]&&_0x385be8[_0x39adbf(0x1fb)]);if(_0x3666b0[_0x39adbf(0x281)]>0x0)for(const _0x178c32 of _0x3666b0){const _0x59f369=_0x178c32['folderPath']?_0x178c32['folderPath']+'/'+_0x178c32[_0x39adbf(0x284)][_0x39adbf(0x254)]:_0x178c32[_0x39adbf(0x284)][_0x39adbf(0x254)];console[_0x39adbf(0x21e)]('\x0a'+a41_0x3e617e['yellow'](_0x39adbf(0x289))+'\x20'+_0x59f369),console['error']('─'['repeat'](0x3c)),console[_0x39adbf(0x21e)](_0x178c32[_0x39adbf(0x1fb)]),console[_0x39adbf(0x21e)]('─'[_0x39adbf(0x225)](0x3c));}if(_0x49364c[_0x39adbf(0x281)]>0x0)for(const _0x478061 of _0x49364c){const _0x3fcbb6=_0x478061[_0x39adbf(0x264)]?_0x53cb21[_0x39adbf(0x28e)](_0x478061[_0x39adbf(0x264)])||'':'',_0x45b2f6=_0x3fcbb6?_0x3fcbb6+'/'+_0x478061['journeyBundleName']:_0x478061['journeyBundleName'];console['error']('\x0a'+a41_0x3e617e['red'](_0x39adbf(0x234))+'\x20'+_0x45b2f6),console['error']('─'['repeat'](0x3c)),console[_0x39adbf(0x21e)](a41_0x3e617e['red']('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x39adbf(0x225)](0x3c));}if(_0x32e703[_0x39adbf(0x268)])return console['error'](a41_0x3e617e[_0x39adbf(0x24e)](_0x39adbf(0x21c))),0x0;const _0x135b92=_0x32e703[_0x39adbf(0x258)]?![]:_0x1c6c08[_0x39adbf(0x281)]>0x0||_0x13528c['length']>0x0||_0x2c5662['length']>0x0,_0x4e0a61=_0x2ee511[_0x39adbf(0x281)]>0x0||_0x38355f['length']>0x0||_0x49364c['length']>0x0,_0x32a57a=_0x32e703[_0x39adbf(0x258)]?![]:_0x3f36b0['length']>0x0,_0x47a3b6=_0x20b26a[_0x39adbf(0x281)]>0x0;if(!_0x135b92&&!_0x4e0a61&&!_0x32a57a&&!_0x47a3b6){const _0x436350=_0x32e703[_0x39adbf(0x258)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x39adbf(0x1f9);console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x1f8)](_0x436350));if(_0x151363&&_0x52a743['length']===0x1){const _0x107edb=_0x52a743[0x0];if(_0x107edb['existingSegment']?.['id']){const _0xdba2ff=getConsoleNextUrl(_0x32e703[_0x39adbf(0x20a)],_0x39adbf(0x262)+_0xdd081+_0x39adbf(0x247)+_0x107edb['existingSegment']['id']+_0x39adbf(0x266));console['error'](_0x39adbf(0x1ff)+a41_0x3e617e[_0x39adbf(0x26d)](_0xdba2ff));}}if(_0x151363&&_0x36e7f3[_0x39adbf(0x281)]===0x1){const _0x41cf04=_0x36e7f3[0x0];if(_0x41cf04[_0x39adbf(0x25c)]?.['id']){const _0x263820=getConsoleNextUrl(_0x32e703['site'],_0x39adbf(0x262)+_0xdd081+_0x39adbf(0x247)+_0x41cf04[_0x39adbf(0x25c)]['id']+_0x39adbf(0x288));console[_0x39adbf(0x21e)]('\x20\x20'+a41_0x3e617e['cyan'](_0x263820));}}return 0x0;}const _0x225ef0=_0x32e703[_0x39adbf(0x258)]?_0x2ee511[_0x39adbf(0x281)]+_0x38355f[_0x39adbf(0x281)]+_0x49364c['length']+_0x20b26a[_0x39adbf(0x281)]:_0x1c6c08['length']+_0x13528c[_0x39adbf(0x281)]+_0x2c5662[_0x39adbf(0x281)]+_0x2ee511[_0x39adbf(0x281)]+_0x38355f['length']+_0x49364c[_0x39adbf(0x281)]+_0x20b26a[_0x39adbf(0x281)]+_0x3f36b0[_0x39adbf(0x281)];if(!_0x32e703['yes']&&_0x225ef0>0x0){if(!isInteractive())return console['error'](a41_0x3e617e[_0x39adbf(0x202)]('\x0aError:'),_0x39adbf(0x237)),console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x269)](_0x39adbf(0x1fe))),0x1;const _0x308a8c=await confirmKey(_0x39adbf(0x23d)+_0x225ef0+_0x39adbf(0x273));if(!_0x308a8c)return console[_0x39adbf(0x21e)](a41_0x3e617e['yellow'](_0x39adbf(0x25f))),0x1;}const _0x5acfe2={'withProgress':async(_0x8970d1,_0x123e59)=>{const _0x407230=_0x39adbf,_0x25a41b=await withSpinner(_0x8970d1,_0x123e59,{'verbose':_0x32e703[_0x407230(0x217)]});return{'data':_0x25a41b[_0x407230(0x20e)]};},'logInfo':_0x432c7a=>console[_0x39adbf(0x21e)](a41_0x3e617e['blue']('✔\x20'+_0x432c7a)),'logSuccess':_0x4c19b3=>console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x1f8)]('✔\x20'+_0x4c19b3)),'logWarning':_0x2f9d71=>console['error'](a41_0x3e617e[_0x39adbf(0x24e)]('⚠\x20'+_0x2f9d71)),'logDeleted':_0x14579f=>console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x202)]('✔\x20'+_0x14579f))},_0x4b3136={'segment':_0x1fdc2c[_0x39adbf(0x219)],'journey':_0x1fdc2c[_0x39adbf(0x208)],'user':_0x1fdc2c[_0x39adbf(0x27a)],'connection':_0x1fdc2c[_0x39adbf(0x246)]};_0x20b26a[_0x39adbf(0x281)]>0x0&&(_0x2bdb2d=await executePushFolders(_0x4b3136,_0x20b26a,_0x2bdb2d,{'parentId':_0xdd081},_0x5acfe2));const _0x3529c9={'rootFolderId':_0x2bdf3f,'folderPathToId':_0x2bdb2d,'folderIdToPath':_0x53cb21,'segmentNameToId':_0x37b03e,'activationsBySegmentId':_0x26de3b,'emailToIdMap':_0x325131,'idToEmailMap':_0x5746a1,'connectionNameToIdMap':_0x4b3ed['nameToId'],'connectionIdToNameMap':_0x4b3ed[_0x39adbf(0x232)],'connectionNameToTypeMap':_0x84fa61},_0xfb8858=await executePushSegments(_0x4b3136,_0x32e703[_0x39adbf(0x258)]?[]:_0x3f58db,_0x3529c9,{'parentId':_0xdd081},_0x5acfe2),_0xef166a=_0xfb8858[_0x39adbf(0x255)],_0x1eae5d=_0xfb8858[_0x39adbf(0x26f)],_0x154886=_0xfb8858[_0x39adbf(0x223)][_0x39adbf(0x255)],_0x560cea=_0xfb8858['activations'][_0x39adbf(0x26f)],_0x54f5f7=_0xfb8858['activations']['deleted'];let _0x45a877;if(_0x151363&&_0x3f58db[_0x39adbf(0x281)]===0x1){const _0x30fad3=_0x3f58db[0x0];_0x45a877=_0x30fad3[_0x39adbf(0x285)]?.['id']??_0xfb8858[_0x39adbf(0x282)][_0x39adbf(0x28e)](_0x30fad3['yamlConfig'][_0x39adbf(0x254)]);}const _0xeea2ba=await executePushSegmentDeletions(_0x4b3136,_0x32e703['journeysOnly']?[]:_0x2c5662,_0x5acfe2);let _0x3a0672=0x0,_0x57fd09=0x0,_0x1fc1fa=0x0;const _0x14e5e1=new Map(_0x37b03e);for(const [_0x48b59d,_0x246d4b]of _0xfb8858[_0x39adbf(0x282)]){_0x14e5e1['set'](_0x48b59d,_0x246d4b);}if(_0x246a12['length']>0x0){const _0x2c1193={..._0x3529c9,'segmentNameToId':_0x14e5e1,'existingSegments':_0x10f4ae,'activationContext':_0x4d8052},_0x48f48a=await executePushJourneys(_0x4b3136,_0x246a12,_0x2c1193,{'parentId':_0xdd081,'rootFolderId':_0x2bdf3f,'verbose':_0x32e703[_0x39adbf(0x217)]},_0x5acfe2);_0x3a0672=_0x48f48a[_0x39adbf(0x255)],_0x57fd09=_0x48f48a[_0x39adbf(0x26f)];if(_0x151363&&_0x48f48a[_0x39adbf(0x215)]['length']===0x1){const _0x3fafa8=_0x48f48a[_0x39adbf(0x215)][0x0];if(_0x3fafa8[_0x39adbf(0x253)]){const _0x587f9b=getConsoleNextUrl(_0x32e703[_0x39adbf(0x20a)],_0x39adbf(0x262)+_0xdd081+_0x39adbf(0x247)+_0x3fafa8[_0x39adbf(0x253)]+_0x39adbf(0x288));console[_0x39adbf(0x21e)]('\x20\x20'+a41_0x3e617e[_0x39adbf(0x26d)](_0x587f9b));}}}for(const _0x5534cd of _0x49364c){console[_0x39adbf(0x21e)](a41_0x3e617e[_0x39adbf(0x24e)](_0x39adbf(0x22c)+_0x5534cd['journeyBundleName'])),_0x1fc1fa++;}const _0x1bf8df=[];if(_0xef166a>0x0)_0x1bf8df[_0x39adbf(0x206)](_0xef166a+_0x39adbf(0x27d));if(_0x1eae5d>0x0)_0x1bf8df[_0x39adbf(0x206)](_0x1eae5d+_0x39adbf(0x22d));if(_0xeea2ba>0x0)_0x1bf8df[_0x39adbf(0x206)](_0xeea2ba+_0x39adbf(0x26a));const _0x3e783b=[];if(_0x3a0672>0x0)_0x3e783b[_0x39adbf(0x206)](_0x3a0672+_0x39adbf(0x27d));if(_0x57fd09>0x0)_0x3e783b[_0x39adbf(0x206)](_0x57fd09+_0x39adbf(0x22d));if(_0x1fc1fa>0x0)_0x3e783b[_0x39adbf(0x206)](_0x1fc1fa+_0x39adbf(0x26a));const _0x47aeb4=[];if(_0x154886>0x0)_0x47aeb4[_0x39adbf(0x206)](_0x154886+_0x39adbf(0x27d));if(_0x560cea>0x0)_0x47aeb4[_0x39adbf(0x206)](_0x560cea+_0x39adbf(0x22d));if(_0x54f5f7>0x0)_0x47aeb4['push'](_0x54f5f7+_0x39adbf(0x26a));console['error'](a41_0x3e617e[_0x39adbf(0x1f8)]('\x0a✔\x20Push\x20complete'));_0x1bf8df[_0x39adbf(0x281)]>0x0&&!_0x32e703[_0x39adbf(0x258)]&&console[_0x39adbf(0x21e)](_0x39adbf(0x26e)+_0x1bf8df['join'](',\x20'));_0x3e783b[_0x39adbf(0x281)]>0x0&&console[_0x39adbf(0x21e)]('\x20\x20Journeys:\x20'+_0x3e783b[_0x39adbf(0x1fd)](',\x20'));_0x47aeb4[_0x39adbf(0x281)]>0x0&&!_0x32e703['journeysOnly']&&console[_0x39adbf(0x21e)](_0x39adbf(0x271)+_0x47aeb4['join'](',\x20'));if(_0x45a877){const _0x10c83d=getConsoleNextUrl(_0x32e703[_0x39adbf(0x20a)],'/app/ps/'+_0xdd081+_0x39adbf(0x247)+_0x45a877+_0x39adbf(0x266));console[_0x39adbf(0x21e)](_0x39adbf(0x1ff)+a41_0x3e617e[_0x39adbf(0x26d)](_0x10c83d));}return 0x0;}}
1
+ const a41_0x448629=a41_0xf4ce;(function(_0x568d4f,_0x1beaa8){const _0x2c3bae=a41_0xf4ce,_0x3649ad=_0x568d4f();while(!![]){try{const _0x37999a=parseInt(_0x2c3bae(0x211))/0x1*(parseInt(_0x2c3bae(0x251))/0x2)+-parseInt(_0x2c3bae(0x247))/0x3*(parseInt(_0x2c3bae(0x24f))/0x4)+parseInt(_0x2c3bae(0x231))/0x5*(-parseInt(_0x2c3bae(0x263))/0x6)+parseInt(_0x2c3bae(0x1f5))/0x7*(-parseInt(_0x2c3bae(0x284))/0x8)+-parseInt(_0x2c3bae(0x257))/0x9*(parseInt(_0x2c3bae(0x269))/0xa)+-parseInt(_0x2c3bae(0x23d))/0xb*(-parseInt(_0x2c3bae(0x259))/0xc)+parseInt(_0x2c3bae(0x21a))/0xd;if(_0x37999a===_0x1beaa8)break;else _0x3649ad['push'](_0x3649ad['shift']());}catch(_0x323106){_0x3649ad['push'](_0x3649ad['shift']());}}}(a41_0x5b0b,0xbcf0d));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';function a41_0x5b0b(){const _0x905760=['Preparing\x20journeys...','.yml','Error:\x20','changed','\x20\x20\x20\x20','delete','helpText','toCreate','state','existingJourney','journey','scopedFolderPath','\x0aPush\x20summary\x20for\x20\x27','8710232SZMUbB','isNew','listFolders','\x20\x20Activations:','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','created','activations','paused','\x20\x20Source:\x20','\x20to\x20update','Source\x20directory:\x20','listSegments','existingSegment','dim','journeyBundleName','createdSegmentIds','7mGxcnn','New\x20segment:','Scoped\x20to\x20folder:\x20','cyan','toUpdate','getJourney','createdAt','\x20deleted','New\x20journey:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20new','unchanged','description','targetDir','No\x20','segments','length','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','get','Parent\x20segment:\x20','green','Changes\x20to\x20journey:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','/sb/da/esr','attributes','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','54PGXToT','\x20to\x20create','\x20changed','(Journey\x20will\x20be\x20deleted)','nameToType','diff','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/app/ps/','\x20\x20Activations:\x20','43726748ccHEHC','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','new','push','yes','journeyId','parentName','\x27...','\x20\x20🗺️\x20\x20Journeys:','join','\x20updated','errorCode','then','resolveParentId','listJourneysWithDetailsFromParentSegment','user','yamlConfig','\x20\x20Journeys:\x20','red','data','/e/','Delete\x20segment:','nameToId','4091540nlorRS','verbose','set','\x20activations]','📁\x20','dryRun','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','endsWith','\x20\x20Segments:\x20','idToName','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','626747soxpxK','folderId','all','\x20to\x20delete','getParent','segment','Delete\x20journey:','execute','yellow','type','31881qXnUms','journeysOnly','folders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','segment:push','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','484ojgbsI','message','48696YdOUWu','filePath','toDelete','\x20unchanged','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','blue','10089kPlNtq','repeat','120YbIpEi','Resolving\x20parent\x20segment\x20\x27','filter','map','parent_name','updated','connection','Fetching\x20connections\x20for\x20name\x20resolution...','/j/da/je','Aborted.','6oPDeOe','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','results','add','\x20\x20📊\x20Segments:','file','11430tTSkkh','journeyBundleId','toString','list','journeys','listActivations','versionNumber','isScoped','\x0a✔\x20Push\x20complete','parentFolder','folderPath','.yaml','error','site'];a41_0x5b0b=function(){return _0x905760;};return a41_0x5b0b();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x3987b6 from'chalk';function a41_0xf4ce(_0x4f41b3,_0x388cb2){_0x4f41b3=_0x4f41b3-0x1ea;const _0x5b0bc5=a41_0x5b0b();let _0xf4ce16=_0x5b0bc5[_0x4f41b3];return _0xf4ce16;}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{['name']=a41_0x448629(0x24b);[a41_0x448629(0x201)]=a41_0x448629(0x23c);async[a41_0x448629(0x244)](_0x1a56a9){const _0x3c94bc=a41_0x448629,{options:_0x342174,args:_0x205784,tdx:_0x2a0e6e}=_0x1a56a9,_0x15bfcf=_0x342174,_0x37a25b=await resolveTarget({'arg':_0x205784[0x0],'contextParent':_0x342174['parentSegment'],'cwd':process[_0x3c94bc(0x24c)]()});if(!isSuccessfulResolution(_0x37a25b))return _0x37a25b[_0x3c94bc(0x225)]==='no_parent'?(console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x255))),console['error'](_0x3c94bc(0x288)),console[_0x3c94bc(0x275)](_0x3c94bc(0x24a)),console[_0x3c94bc(0x275)](_0x3c94bc(0x24d))):(console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x279)+_0x37a25b[_0x3c94bc(0x250)]+'\x0a')),_0x37a25b[_0x3c94bc(0x27d)]&&console['error'](a41_0x3987b6[_0x3c94bc(0x1f8)](_0x37a25b[_0x3c94bc(0x27d)]))),0x1;if(_0x37a25b[_0x3c94bc(0x246)]===_0x3c94bc(0x25d))return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)]('Error:\x20Directory\x20not\x20found:\x20'+_0x37a25b['targetDir']+'\x0a')),console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x1f8)](_0x3c94bc(0x217))),0x1;const _0x1c5f2e=_0x37a25b[_0x3c94bc(0x220)],_0x168548=_0x37a25b[_0x3c94bc(0x202)],_0x354afb=_0x37a25b[_0x3c94bc(0x246)]===_0x3c94bc(0x268)?_0x37a25b[_0x3c94bc(0x252)]:undefined,_0x24afb6=getScopedDetails(_0x37a25b),_0x47e976=_0x24afb6?.[_0x3c94bc(0x270)]??![],_0x1c1aff=_0x24afb6?.[_0x3c94bc(0x282)]??'';if(!existsSync(_0x168548))return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x20e)+_0x168548+'\x0a')),console[_0x3c94bc(0x275)](a41_0x3987b6['cyan'](_0x3c94bc(0x217))),0x1;_0x15bfcf[_0x3c94bc(0x232)]&&(console[_0x3c94bc(0x275)]('Site:\x20'+_0x15bfcf[_0x3c94bc(0x276)]),console[_0x3c94bc(0x275)](_0x3c94bc(0x208)+_0x1c5f2e),console['error'](_0x3c94bc(0x1ef)+_0x168548),_0x47e976&&console[_0x3c94bc(0x275)](_0x3c94bc(0x1f7)+_0x1c1aff));const _0x2fe6da=await withSpinner(_0x3c94bc(0x25a)+_0x1c5f2e+_0x3c94bc(0x221),()=>_0x2a0e6e[_0x3c94bc(0x242)][_0x3c94bc(0x227)](_0x1c5f2e),{'verbose':_0x15bfcf[_0x3c94bc(0x232)]}),_0x314481=_0x2fe6da['data'],{parentSegmentResult:_0x304b2e,segmentsResult:_0x323306,foldersResult:_0x1646da,journeysWithDetailsResult:_0x17d081,userMaps:_0xf69fd1}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0xe47184=_0x3c94bc,[_0x477fea,_0x43ddc1,_0x342a7c,_0x5d10c8,_0x4d5c2b]=await Promise[_0xe47184(0x23f)]([_0x2a0e6e[_0xe47184(0x242)][_0xe47184(0x241)](_0x314481),_0x2a0e6e['segment'][_0xe47184(0x1f0)](_0x314481),_0x2a0e6e[_0xe47184(0x242)][_0xe47184(0x286)](_0x314481),_0x2a0e6e[_0xe47184(0x281)][_0xe47184(0x228)](_0x314481,{'includeAllVersions':!![]}),_0x2a0e6e[_0xe47184(0x229)]['buildUserMaps']()]);return{'parentSegmentResult':_0x477fea,'segmentsResult':_0x43ddc1,'foldersResult':_0x342a7c,'journeysWithDetailsResult':_0x5d10c8,'userMaps':_0x4d5c2b};},{'verbose':_0x15bfcf[_0x3c94bc(0x232)]})['then'](_0x44a655=>_0x44a655[_0x3c94bc(0x22d)]),_0x2632da=_0x304b2e,_0x291903=extractRootFolderId(_0x2632da),_0x2b0c7a=_0x323306,_0x5d78b8=_0x1646da,{journeys:_0x16b065,activationStepsById:_0x5e00f1}=_0x17d081,_0x5a1473=new Map(_0x16b065[_0x3c94bc(0x25c)](_0x5e5a1c=>[_0x5e5a1c['id'],_0x5e5a1c])),_0x177656=_0x16b065[_0x3c94bc(0x25c)](_0x358327=>({'id':_0x358327['id'],'name':_0x358327['attributes']['name'],'journeyBundleName':_0x358327['attributes']['journeyBundleName']||'','journeyBundleId':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x26a)]||'','versionNumber':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x26f)],'description':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x201)],'state':_0x358327['attributes'][_0x3c94bc(0x27f)],'paused':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x1ec)],'audienceId':_0x358327[_0x3c94bc(0x20d)]['audienceId'],'folderId':_0x358327['relationships']?.[_0x3c94bc(0x272)]?.[_0x3c94bc(0x22d)]?.['id'],'createdAt':_0x358327['attributes'][_0x3c94bc(0x1fb)],'updatedAt':_0x358327['attributes']['updatedAt']})),{emailToId:_0x130ce2,idToEmail:_0x575f61}=_0xf69fd1,_0x1e8aaa=await withSpinner(_0x3c94bc(0x260),async()=>{const _0x1dd740=_0x3c94bc,_0x1ae817=await _0x2a0e6e[_0x1dd740(0x25f)][_0x1dd740(0x26c)]();return buildConnectionMaps(_0x1ae817);},{'verbose':_0x15bfcf[_0x3c94bc(0x232)]})[_0x3c94bc(0x226)](_0x45c244=>_0x45c244[_0x3c94bc(0x22d)]),_0x393dce=_0x1e8aaa[_0x3c94bc(0x230)],_0x3a3951=_0x1e8aaa[_0x3c94bc(0x23a)],_0x490b46=_0x1e8aaa[_0x3c94bc(0x215)],_0x17372={'emailToIdMap':_0x130ce2,'connectionNameToIdMap':_0x393dce,'connectionNameToTypeMap':_0x490b46,'getSchema':_0x339395=>_0x2a0e6e[_0x3c94bc(0x25f)]['getOutputSchemaWithCache'](_0x339395)};let {pathToId:_0x223973,idToPath:_0x2cf7f6}=buildFolderMaps(_0x5d78b8);const _0xc98928=buildSegmentLookupMap(_0x2b0c7a,_0x2cf7f6),_0x50086f=buildSegmentNameToIdMap(_0x2b0c7a),_0x2856ea=buildJourneyBundleLookupMap(_0x177656,_0x2cf7f6);let _0x4f8ee9;if(_0x354afb){if(!_0x354afb[_0x3c94bc(0x238)](_0x3c94bc(0x278))&&!_0x354afb['endsWith'](_0x3c94bc(0x274)))return console[_0x3c94bc(0x275)](a41_0x3987b6['red'](_0x3c94bc(0x20f)+_0x354afb+'\x0a')),0x1;_0x4f8ee9=[_0x354afb];}else _0x4f8ee9=findYamlFiles(_0x168548);if(_0x4f8ee9[_0x3c94bc(0x205)]===0x0)return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x237)+_0x168548+'\x0a')),console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x1f8)](_0x3c94bc(0x21b))),0x1;let _0x2b1e9b,_0x39401e;try{const _0xa809b1=parseAndClassifyYamlFiles(_0x4f8ee9,_0x168548,{'skipSegments':_0x15bfcf[_0x3c94bc(0x248)]});_0x2b1e9b=_0xa809b1[_0x3c94bc(0x204)],_0x39401e=_0xa809b1[_0x3c94bc(0x26d)];const _0x25990a=validateParsedFiles(_0xa809b1,_0x168548);if(_0x25990a[_0x3c94bc(0x205)]>0x0)return console['error'](a41_0x3987b6[_0x3c94bc(0x22c)]('\x0aValidation\x20failed:')),console[_0x3c94bc(0x275)](formatValidationErrors(_0x25990a)),console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x212bcb){return console['error'](a41_0x3987b6['red']('Error\x20parsing\x20YAML:\x20'+(_0x212bcb instanceof Error?_0x212bcb[_0x3c94bc(0x250)]:_0x212bcb))),0x1;}if(_0x2b1e9b[_0x3c94bc(0x205)]===0x0&&_0x39401e[_0x3c94bc(0x205)]===0x0){const _0x1f03c3=_0x15bfcf[_0x3c94bc(0x248)]?'journey':'segment\x20or\x20journey';return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x203)+_0x1f03c3+'\x20YAML\x20files\x20found')),0x0;}const _0x23a43a=new Map();_0x2b0c7a['length']>0x0&&!_0x15bfcf['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x2b0c7a,async _0x189684=>{const _0x155de4=a41_0xf4ce,_0x2e7c72=await _0x2a0e6e[_0x155de4(0x242)][_0x155de4(0x26e)](_0x314481,_0x189684['id']);_0x23a43a[_0x155de4(0x233)](_0x189684['id'],_0x2e7c72);});},{'verbose':_0x15bfcf[_0x3c94bc(0x232)]});const {segmentFiles:_0x1ab88c,foldersToCreate:_0x2d008e}=await prepareSegmentFiles(_0x2b1e9b,{'segmentByFolderAndName':_0xc98928,'activationsBySegmentId':_0x23a43a,'folderPathToId':_0x223973,'idToEmailMap':_0x575f61,'connectionIdToNameMap':_0x3a3951},_0x17372,_0x47e976,_0x1c1aff),_0x2f4259=_0x354afb?[]:findSegmentsToDelete(_0x2b0c7a,_0x2b1e9b[_0x3c94bc(0x25c)](({yamlConfig:_0x37fb97,folderPath:_0x3b2b5c})=>({'yamlConfig':_0x37fb97,'folderPath':resolveTDFolderPath(_0x3b2b5c,_0x47e976,_0x1c1aff)})),_0x2cf7f6,_0x1c1aff,_0x47e976),{journeyFiles:_0x5367f0,foldersToCreate:_0x532cb7}=await withProgressSpinner(_0x3c94bc(0x277),async _0x3db147=>prepareJourneyFiles(_0x39401e,{'fetchJourney':async _0x229a51=>_0x2a0e6e[_0x3c94bc(0x281)][_0x3c94bc(0x1fa)](_0x229a51[_0x3c94bc(0x21f)]),'journeyBundlesByFolderAndName':_0x2856ea,'folderPathToId':_0x223973,'idToEmailMap':_0x575f61,'connectionIdToNameMap':_0x3a3951,'existingSegments':_0x2b0c7a,'parentId':_0x314481,'deps':_0x2a0e6e,'progress':{'update':_0x452a56=>{const _0x499c94=_0x3c94bc;_0x3db147['setPhase'](_0x452a56),_0x15bfcf[_0x499c94(0x232)]&&console[_0x499c94(0x275)]('\x20\x20'+_0x452a56);}},'journeyById':_0x5a1473,'activationStepsById':_0x5e00f1},_0x47e976,_0x1c1aff),{'verbose':_0x15bfcf[_0x3c94bc(0x232)]})[_0x3c94bc(0x226)](_0x399126=>_0x399126[_0x3c94bc(0x22d)]);for(const _0x3e4d25 of _0x532cb7){_0x2d008e[_0x3c94bc(0x266)](_0x3e4d25);}const _0x28d632=_0x354afb?[]:findJourneysToDelete(_0x177656,_0x39401e[_0x3c94bc(0x25c)](({yamlConfig:_0x3eedd4,folderPath:_0x4e0346})=>({'yamlConfig':_0x3eedd4,'folderPath':resolveTDFolderPath(_0x4e0346,_0x47e976,_0x1c1aff)})),_0x2cf7f6,_0x1c1aff,_0x47e976),_0x10afff=calculatePushStats(_0x1ab88c,_0x5367f0,_0x2d008e,_0x2f4259,_0x28d632,!!_0x15bfcf[_0x3c94bc(0x27c)],!!_0x15bfcf[_0x3c94bc(0x248)]),_0x1b0e43=_0x10afff[_0x3c94bc(0x204)][_0x3c94bc(0x21c)],_0x1a727a=_0x10afff[_0x3c94bc(0x204)]['changed'],_0x1a877c=_0x10afff[_0x3c94bc(0x204)][_0x3c94bc(0x200)],_0x2e814f=_0x10afff[_0x3c94bc(0x204)]['toDelete'],_0x99625e=_0x10afff[_0x3c94bc(0x249)][_0x3c94bc(0x27e)],_0x2bdd5a=_0x10afff['journeys'][_0x3c94bc(0x21c)],_0x47d8be=_0x10afff['journeys'][_0x3c94bc(0x27a)],_0x1e6e67=_0x10afff[_0x3c94bc(0x26d)]['unchanged'],_0x48ac05=_0x10afff[_0x3c94bc(0x26d)][_0x3c94bc(0x253)],_0x1d1d7a=_0x10afff[_0x3c94bc(0x1eb)][_0x3c94bc(0x23f)],_0x4f2086=_0x10afff[_0x3c94bc(0x1eb)][_0x3c94bc(0x27e)],_0x2c44bc=_0x10afff[_0x3c94bc(0x1eb)][_0x3c94bc(0x1f9)],_0x31ff9f=_0x10afff[_0x3c94bc(0x1eb)]['toDelete'];console[_0x3c94bc(0x275)](_0x3c94bc(0x283)+_0x1c5f2e+'\x27:');_0x99625e[_0x3c94bc(0x205)]>0x0&&console[_0x3c94bc(0x275)]('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x256)](_0x3c94bc(0x235)+_0x99625e[_0x3c94bc(0x205)]+'\x20folders\x20to\x20create'));if(!_0x15bfcf[_0x3c94bc(0x248)]){console['error'](_0x3c94bc(0x267)),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x209)]('+\x20'+_0x1b0e43['length']+'\x20new')),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x245)]('~\x20'+_0x1a727a[_0x3c94bc(0x205)]+_0x3c94bc(0x213)));if(_0x2e814f['length']>0x0)console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x22c)]('-\x20'+_0x2e814f[_0x3c94bc(0x205)]+_0x3c94bc(0x240)));else _0x2f4259[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x27c)]&&console['error'](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x1f2)](_0x2f4259['length']+_0x3c94bc(0x23b)));console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x1f2)]('=\x20'+_0x1a877c[_0x3c94bc(0x205)]+_0x3c94bc(0x254)));}if(_0x5367f0[_0x3c94bc(0x205)]>0x0||_0x28d632['length']>0x0){console[_0x3c94bc(0x275)](_0x3c94bc(0x222)),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x209)]('+\x20'+_0x2bdd5a[_0x3c94bc(0x205)]+_0x3c94bc(0x1ff))),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x245)]('~\x20'+_0x47d8be[_0x3c94bc(0x205)]+_0x3c94bc(0x213)));if(_0x48ac05[_0x3c94bc(0x205)]>0x0)console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x22c)]('-\x20'+_0x48ac05[_0x3c94bc(0x205)]+_0x3c94bc(0x240)));else _0x28d632['length']>0x0&&!_0x15bfcf['delete']&&console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x1f2)](_0x28d632[_0x3c94bc(0x205)]+_0x3c94bc(0x23b)));console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x1f2)]('=\x20'+_0x1e6e67[_0x3c94bc(0x205)]+'\x20unchanged'));}_0x1d1d7a[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)]&&(console[_0x3c94bc(0x275)](''),console[_0x3c94bc(0x275)](_0x3c94bc(0x287)),_0x4f2086[_0x3c94bc(0x205)]>0x0&&console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x209)]('+\x20'+_0x4f2086[_0x3c94bc(0x205)]+_0x3c94bc(0x212))),_0x2c44bc['length']>0x0&&console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x245)]('~\x20'+_0x2c44bc[_0x3c94bc(0x205)]+_0x3c94bc(0x1ee))),_0x31ff9f[_0x3c94bc(0x205)]>0x0&&console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x22c)]('-\x20'+_0x31ff9f['length']+'\x20to\x20delete')));console[_0x3c94bc(0x275)](_0x3c94bc(0x1ed)+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x168548)+'\x0a');if(_0x99625e[_0x3c94bc(0x205)]>0x0){console[_0x3c94bc(0x275)]('Folders\x20to\x20create:');for(const _0x244f3e of _0x99625e){console['error']('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x256)]('+')+'\x20'+_0x244f3e);}console[_0x3c94bc(0x275)]('');}if(_0x1b0e43['length']>0x0&&!_0x15bfcf[_0x3c94bc(0x248)])for(const _0x493a3c of _0x1b0e43){const _0x4d4a8f=_0x493a3c[_0x3c94bc(0x273)]?_0x493a3c[_0x3c94bc(0x273)]+'/'+_0x493a3c[_0x3c94bc(0x22a)]['name']:_0x493a3c[_0x3c94bc(0x22a)][_0x3c94bc(0x210)],_0x101677=_0x493a3c['yamlConfig'][_0x3c94bc(0x1eb)]?.['length']||0x0,_0x319ae0=_0x101677>0x0?a41_0x3987b6[_0x3c94bc(0x1f2)]('\x20['+_0x101677+_0x3c94bc(0x234)):'';console['error']('\x0a'+a41_0x3987b6[_0x3c94bc(0x209)](_0x3c94bc(0x1f6))+'\x20'+_0x4d4a8f+_0x319ae0),console['error']('─'[_0x3c94bc(0x258)](0x3c)),_0x493a3c[_0x3c94bc(0x216)]&&console[_0x3c94bc(0x275)](_0x493a3c[_0x3c94bc(0x216)]),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}if(_0x2e814f[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)])for(const _0x1998fa of _0x2e814f){const _0xe4d0fc=_0x1998fa['segmentFolderId']?_0x2cf7f6[_0x3c94bc(0x207)](_0x1998fa['segmentFolderId'][_0x3c94bc(0x26b)]())||'':'',_0x5f59f5=_0xe4d0fc?_0xe4d0fc+'/'+_0x1998fa['name']:_0x1998fa['name'],_0x3fb703=_0x23a43a[_0x3c94bc(0x207)](_0x1998fa['id'])||[],_0x353d8c=_0x3fb703['length']>0x0?a41_0x3987b6[_0x3c94bc(0x1f2)]('\x20['+_0x3fb703['length']+_0x3c94bc(0x234)):'';console['error']('\x0a'+a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x22f))+'\x20'+_0x5f59f5+_0x353d8c),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));const _0x1b02ff=segmentWithActivationsToYaml(_0x1998fa,_0x3fb703,undefined,_0x575f61,_0x3a3951),_0x28040a=segmentToYamlString(_0x1b02ff),_0x475bd8=generateDiff(_0x28040a,'');console[_0x3c94bc(0x275)](formatDiffWithColors(_0x475bd8)),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}const _0x548305=_0x1ab88c[_0x3c94bc(0x25b)](_0x205333=>!_0x205333[_0x3c94bc(0x285)]&&_0x205333[_0x3c94bc(0x216)]);if(_0x548305[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)])for(const _0x29ba55 of _0x548305){const _0x26b4b5=_0x29ba55['folderPath']?_0x29ba55['folderPath']+'/'+_0x29ba55['yamlConfig'][_0x3c94bc(0x210)]:_0x29ba55['yamlConfig'][_0x3c94bc(0x210)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6['yellow']('Changes\x20to:')+'\x20'+_0x26b4b5),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c)),console[_0x3c94bc(0x275)](_0x29ba55[_0x3c94bc(0x216)]),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}if(_0x2bdd5a[_0x3c94bc(0x205)]>0x0)for(const _0x38265f of _0x2bdd5a){const _0x1be554=_0x38265f[_0x3c94bc(0x273)]?_0x38265f[_0x3c94bc(0x273)]+'/'+_0x38265f['yamlConfig'][_0x3c94bc(0x210)]:_0x38265f[_0x3c94bc(0x22a)][_0x3c94bc(0x210)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6[_0x3c94bc(0x209)](_0x3c94bc(0x1fd))+'\x20'+_0x1be554),console['error']('─'[_0x3c94bc(0x258)](0x3c)),_0x38265f[_0x3c94bc(0x216)]&&console[_0x3c94bc(0x275)](_0x38265f[_0x3c94bc(0x216)]),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}const _0x59df6d=_0x5367f0[_0x3c94bc(0x25b)](_0x4addda=>!_0x4addda[_0x3c94bc(0x285)]&&_0x4addda[_0x3c94bc(0x216)]);if(_0x59df6d['length']>0x0)for(const _0x1ebf18 of _0x59df6d){const _0x50bf59=_0x1ebf18[_0x3c94bc(0x273)]?_0x1ebf18[_0x3c94bc(0x273)]+'/'+_0x1ebf18['yamlConfig']['name']:_0x1ebf18[_0x3c94bc(0x22a)][_0x3c94bc(0x210)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x20a))+'\x20'+_0x50bf59),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c)),console['error'](_0x1ebf18[_0x3c94bc(0x216)]),console['error']('─'[_0x3c94bc(0x258)](0x3c));}if(_0x48ac05['length']>0x0)for(const _0x3cd264 of _0x48ac05){const _0x31f424=_0x3cd264[_0x3c94bc(0x23e)]?_0x2cf7f6[_0x3c94bc(0x207)](_0x3cd264[_0x3c94bc(0x23e)])||'':'',_0x53559c=_0x31f424?_0x31f424+'/'+_0x3cd264[_0x3c94bc(0x1f3)]:_0x3cd264[_0x3c94bc(0x1f3)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x243))+'\x20'+_0x53559c),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c)),console['error'](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x214))),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}if(_0x15bfcf[_0x3c94bc(0x236)])return console['error'](a41_0x3987b6['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x25ada4=_0x15bfcf[_0x3c94bc(0x248)]?![]:_0x1b0e43['length']>0x0||_0x1a727a['length']>0x0||_0x2e814f[_0x3c94bc(0x205)]>0x0,_0x39657b=_0x2bdd5a[_0x3c94bc(0x205)]>0x0||_0x47d8be['length']>0x0||_0x48ac05[_0x3c94bc(0x205)]>0x0,_0x663f34=_0x15bfcf[_0x3c94bc(0x248)]?![]:_0x1d1d7a[_0x3c94bc(0x205)]>0x0,_0x1e5ef8=_0x99625e[_0x3c94bc(0x205)]>0x0;if(!_0x25ada4&&!_0x39657b&&!_0x663f34&&!_0x1e5ef8){const _0xb5508c=_0x15bfcf[_0x3c94bc(0x248)]?_0x3c94bc(0x264):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x209)](_0xb5508c));if(_0x354afb&&_0x1a877c[_0x3c94bc(0x205)]===0x1){const _0x3799c3=_0x1a877c[0x0];if(_0x3799c3['existingSegment']?.['id']){const _0x38cdee=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+_0x3c94bc(0x22e)+_0x3799c3[_0x3c94bc(0x1f1)]['id']+_0x3c94bc(0x20c));console[_0x3c94bc(0x275)](_0x3c94bc(0x24e)+a41_0x3987b6['cyan'](_0x38cdee));}}if(_0x354afb&&_0x1e6e67[_0x3c94bc(0x205)]===0x1){const _0x44c5b4=_0x1e6e67[0x0];if(_0x44c5b4[_0x3c94bc(0x280)]?.['id']){const _0x5684db=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+_0x3c94bc(0x22e)+_0x44c5b4[_0x3c94bc(0x280)]['id']+_0x3c94bc(0x261));console['error']('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x5684db));}}return 0x0;}const _0x33fb9d=_0x15bfcf['journeysOnly']?_0x2bdd5a[_0x3c94bc(0x205)]+_0x47d8be[_0x3c94bc(0x205)]+_0x48ac05[_0x3c94bc(0x205)]+_0x99625e[_0x3c94bc(0x205)]:_0x1b0e43['length']+_0x1a727a[_0x3c94bc(0x205)]+_0x2e814f[_0x3c94bc(0x205)]+_0x2bdd5a[_0x3c94bc(0x205)]+_0x47d8be[_0x3c94bc(0x205)]+_0x48ac05[_0x3c94bc(0x205)]+_0x99625e[_0x3c94bc(0x205)]+_0x1d1d7a['length'];if(!_0x15bfcf[_0x3c94bc(0x21e)]&&_0x33fb9d>0x0){if(!isInteractive())return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)]('\x0aError:'),_0x3c94bc(0x20b)),console['error'](a41_0x3987b6[_0x3c94bc(0x1f2)](_0x3c94bc(0x1fe))),0x1;const _0x31293d=await confirmKey('Push\x20'+_0x33fb9d+'\x20changes?');if(!_0x31293d)return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x262))),0x1;}const _0x209872={'withProgress':async(_0x3ffa08,_0x42e793)=>{const _0xf7c837=_0x3c94bc,_0x43bb94=await withSpinner(_0x3ffa08,_0x42e793,{'verbose':_0x15bfcf[_0xf7c837(0x232)]});return{'data':_0x43bb94[_0xf7c837(0x22d)]};},'logInfo':_0x371322=>console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x256)]('✔\x20'+_0x371322)),'logSuccess':_0x1888b5=>console['error'](a41_0x3987b6[_0x3c94bc(0x209)]('✔\x20'+_0x1888b5)),'logWarning':_0x4c4e14=>console[_0x3c94bc(0x275)](a41_0x3987b6['yellow']('⚠\x20'+_0x4c4e14)),'logDeleted':_0x132c28=>console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)]('✔\x20'+_0x132c28))},_0x4a333e={'segment':_0x2a0e6e[_0x3c94bc(0x242)],'journey':_0x2a0e6e['journey'],'user':_0x2a0e6e[_0x3c94bc(0x229)],'connection':_0x2a0e6e['connection']};_0x99625e[_0x3c94bc(0x205)]>0x0&&(_0x223973=await executePushFolders(_0x4a333e,_0x99625e,_0x223973,{'parentId':_0x314481},_0x209872));const _0x4c16b1={'rootFolderId':_0x291903,'folderPathToId':_0x223973,'folderIdToPath':_0x2cf7f6,'segmentNameToId':_0x50086f,'activationsBySegmentId':_0x23a43a,'emailToIdMap':_0x130ce2,'idToEmailMap':_0x575f61,'connectionNameToIdMap':_0x1e8aaa[_0x3c94bc(0x230)],'connectionIdToNameMap':_0x1e8aaa[_0x3c94bc(0x23a)],'connectionNameToTypeMap':_0x490b46},_0x217a41=await executePushSegments(_0x4a333e,_0x15bfcf['journeysOnly']?[]:_0x1ab88c,_0x4c16b1,{'parentId':_0x314481},_0x209872),_0x5e1fca=_0x217a41[_0x3c94bc(0x1ea)],_0x4f069f=_0x217a41[_0x3c94bc(0x25e)],_0x11051c=_0x217a41[_0x3c94bc(0x1eb)][_0x3c94bc(0x1ea)],_0x30d080=_0x217a41[_0x3c94bc(0x1eb)][_0x3c94bc(0x25e)],_0x562b6b=_0x217a41[_0x3c94bc(0x1eb)]['deleted'];let _0x351a81;if(_0x354afb&&_0x1ab88c[_0x3c94bc(0x205)]===0x1){const _0x427a1e=_0x1ab88c[0x0];_0x351a81=_0x427a1e[_0x3c94bc(0x1f1)]?.['id']??_0x217a41[_0x3c94bc(0x1f4)][_0x3c94bc(0x207)](_0x427a1e[_0x3c94bc(0x22a)][_0x3c94bc(0x210)]);}const _0x5e731b=await executePushSegmentDeletions(_0x4a333e,_0x15bfcf[_0x3c94bc(0x248)]?[]:_0x2e814f,_0x209872);let _0x8c15e0=0x0,_0x31f42e=0x0,_0x49c08e=0x0;const _0x14dc9e=new Map(_0x50086f);for(const [_0x267249,_0x2e05f7]of _0x217a41[_0x3c94bc(0x1f4)]){_0x14dc9e[_0x3c94bc(0x233)](_0x267249,_0x2e05f7);}if(_0x5367f0['length']>0x0){const _0x333ae3={..._0x4c16b1,'segmentNameToId':_0x14dc9e,'existingSegments':_0x2b0c7a,'activationContext':_0x17372},_0x594f41=await executePushJourneys(_0x4a333e,_0x5367f0,_0x333ae3,{'parentId':_0x314481,'rootFolderId':_0x291903,'verbose':_0x15bfcf[_0x3c94bc(0x232)]},_0x209872);_0x8c15e0=_0x594f41['created'],_0x31f42e=_0x594f41['updated'];if(_0x354afb&&_0x594f41[_0x3c94bc(0x265)][_0x3c94bc(0x205)]===0x1){const _0x49c5b9=_0x594f41[_0x3c94bc(0x265)][0x0];if(_0x49c5b9[_0x3c94bc(0x21f)]){const _0x18392e=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+'/e/'+_0x49c5b9[_0x3c94bc(0x21f)]+_0x3c94bc(0x261));console[_0x3c94bc(0x275)]('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x18392e));}}}for(const _0x28ae50 of _0x48ac05){console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x206)+_0x28ae50[_0x3c94bc(0x1f3)])),_0x49c08e++;}const _0x5be11d=[];if(_0x5e1fca>0x0)_0x5be11d['push'](_0x5e1fca+'\x20created');if(_0x4f069f>0x0)_0x5be11d[_0x3c94bc(0x21d)](_0x4f069f+_0x3c94bc(0x224));if(_0x5e731b>0x0)_0x5be11d[_0x3c94bc(0x21d)](_0x5e731b+'\x20deleted');const _0x11301b=[];if(_0x8c15e0>0x0)_0x11301b[_0x3c94bc(0x21d)](_0x8c15e0+'\x20created');if(_0x31f42e>0x0)_0x11301b[_0x3c94bc(0x21d)](_0x31f42e+_0x3c94bc(0x224));if(_0x49c08e>0x0)_0x11301b[_0x3c94bc(0x21d)](_0x49c08e+_0x3c94bc(0x1fc));const _0x1f5914=[];if(_0x11051c>0x0)_0x1f5914[_0x3c94bc(0x21d)](_0x11051c+'\x20created');if(_0x30d080>0x0)_0x1f5914['push'](_0x30d080+'\x20updated');if(_0x562b6b>0x0)_0x1f5914[_0x3c94bc(0x21d)](_0x562b6b+'\x20deleted');console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x209)](_0x3c94bc(0x271)));_0x5be11d[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf['journeysOnly']&&console[_0x3c94bc(0x275)](_0x3c94bc(0x239)+_0x5be11d['join'](',\x20'));_0x11301b['length']>0x0&&console[_0x3c94bc(0x275)](_0x3c94bc(0x22b)+_0x11301b[_0x3c94bc(0x223)](',\x20'));_0x1f5914[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)]&&console[_0x3c94bc(0x275)](_0x3c94bc(0x219)+_0x1f5914[_0x3c94bc(0x223)](',\x20'));if(_0x351a81){const _0x5d1cb1=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+_0x3c94bc(0x22e)+_0x351a81+_0x3c94bc(0x20c));console[_0x3c94bc(0x275)](_0x3c94bc(0x24e)+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x5d1cb1));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x9ccce=a42_0x4abe;(function(_0x3efd95,_0x3cad5e){const _0x1ca79b=a42_0x4abe,_0x59064d=_0x3efd95();while(!![]){try{const _0x4874b6=parseInt(_0x1ca79b(0x1c9))/0x1+parseInt(_0x1ca79b(0x1f4))/0x2*(parseInt(_0x1ca79b(0x1f2))/0x3)+-parseInt(_0x1ca79b(0x1f7))/0x4+-parseInt(_0x1ca79b(0x1cb))/0x5+-parseInt(_0x1ca79b(0x1e4))/0x6+parseInt(_0x1ca79b(0x1cd))/0x7*(-parseInt(_0x1ca79b(0x1e7))/0x8)+parseInt(_0x1ca79b(0x1ea))/0x9;if(_0x4874b6===_0x3cad5e)break;else _0x59064d['push'](_0x59064d['shift']());}catch(_0x2a5dcd){_0x59064d['push'](_0x59064d['shift']());}}}(a42_0x3122,0x7013f));function a42_0x4abe(_0x4ee338,_0x79fab2){_0x4ee338=_0x4ee338-0x1c8;const _0x3122c9=a42_0x3122();let _0x4abe21=_0x3122c9[_0x4ee338];return _0x4abe21;}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_0x5de66f from'chalk';function a42_0x3122(){const _0x11d750=['7131555tAnvfl','rule','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','parentId','length','ruleFile','segmentPath','78DwLAjM','segment:update','47858UfCBpO','error','Updating\x20segment\x20\x27','3643624TlvhSi','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','294155pTMtlE','Resolved\x20folder\x20ID:\x20','1094555ubNBJy','type','21vlYQzE','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Resolving\x20path\x20\x27','name','Resolved\x20type:\x20','\x27...','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','data','resolveFolderId','resolvePathToResource','\x20\x20\x20Path:\x20','Segment\x20ID:\x20','segment','Resolving\x20folder\x20\x27','includes','segmentId','yellow','INTERNAL','Update\x20existing\x20child\x20segment','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','verbose','segmentName','updateSegmentById','573942IJWzQA','description','Parent\x20ID:\x20','64424TAXkRJ','kind','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'];a42_0x3122=function(){return _0x11d750;};return a42_0x3122();}export class SegmentUpdateCommand extends BaseCommand{[a42_0x9ccce(0x1d0)]=a42_0x9ccce(0x1f3);[a42_0x9ccce(0x1e5)]=a42_0x9ccce(0x1df);async['execute'](_0x5d3b37){const _0x33a69b=a42_0x9ccce;console['error'](a42_0x5de66f[_0x33a69b(0x1dd)](_0x33a69b(0x1ce))),console['error'](a42_0x5de66f['yellow'](_0x33a69b(0x1e9)));const {options:_0x3482f2,args:_0x47410d,tdx:_0x407243}=_0x5d3b37,_0x12953d=_0x3482f2;if(_0x47410d[_0x33a69b(0x1ef)]===0x0)return console[_0x33a69b(0x1f5)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x33a69b(0x1f5)](_0x33a69b(0x1e0)),console[_0x33a69b(0x1f5)]('Examples:'),console[_0x33a69b(0x1f5)](_0x33a69b(0x1c8)),console[_0x33a69b(0x1f5)](_0x33a69b(0x1ec)),0x1;const _0x579a10=_0x47410d[0x0],_0x21b967=_0x3482f2[_0x33a69b(0x1f1)];let _0x1af079=_0x579a10;_0x21b967&&!_0x579a10[_0x33a69b(0x1db)]('/')&&(_0x1af079=_0x21b967+'/'+_0x579a10,_0x12953d[_0x33a69b(0x1e1)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x1af079));const _0x1813df=await withSpinner(_0x33a69b(0x1cf)+_0x1af079+_0x33a69b(0x1d2),()=>_0x407243[_0x33a69b(0x1d9)][_0x33a69b(0x1d6)](_0x1af079),{'verbose':_0x12953d['verbose']}),_0x45ee2c=_0x1813df[_0x33a69b(0x1d4)];_0x12953d[_0x33a69b(0x1e1)]&&console[_0x33a69b(0x1f5)](_0x33a69b(0x1d1)+_0x45ee2c[_0x33a69b(0x1cc)]);if(_0x45ee2c[_0x33a69b(0x1cc)]!=='segment')return console[_0x33a69b(0x1f5)]('Error:\x20Cannot\x20update\x20'+_0x45ee2c[_0x33a69b(0x1cc)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x33a69b(0x1f5)](_0x33a69b(0x1d3)),0x1;if(!_0x45ee2c[_0x33a69b(0x1dc)])throw new SDKError(ErrorCode[_0x33a69b(0x1de)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3bf4d0=_0x45ee2c[_0x33a69b(0x1ee)],_0x46759d=_0x45ee2c[_0x33a69b(0x1dc)];_0x12953d[_0x33a69b(0x1e1)]&&(console['error'](_0x33a69b(0x1e6)+_0x3bf4d0),console['error'](_0x33a69b(0x1d8)+_0x46759d));let _0x173bf9;if(_0x12953d[_0x33a69b(0x1ed)]){const _0x520ca8=_0x12953d[_0x33a69b(0x1ed)],_0xd32640=await withSpinner(_0x33a69b(0x1da)+_0x520ca8+_0x33a69b(0x1d2),()=>_0x407243['segment'][_0x33a69b(0x1d5)](_0x3bf4d0,_0x520ca8),{'verbose':_0x12953d[_0x33a69b(0x1e1)]});_0x173bf9=parseInt(_0xd32640[_0x33a69b(0x1d4)],0xa),_0x12953d[_0x33a69b(0x1e1)]&&console[_0x33a69b(0x1f5)](_0x33a69b(0x1ca)+_0x173bf9);}const _0x2766e4=await loadJSONFromOptions(_0x12953d[_0x33a69b(0x1eb)],_0x12953d[_0x33a69b(0x1f0)]),_0x2b02da={'name':_0x12953d[_0x33a69b(0x1d0)],'description':_0x12953d[_0x33a69b(0x1e5)],'rule':_0x2766e4,'kind':_0x12953d['kind']!==undefined?parseInt(_0x12953d[_0x33a69b(0x1e8)],0xa):undefined,'segmentFolderId':_0x173bf9},_0x2beced=await withSpinner(_0x33a69b(0x1f6)+_0x45ee2c[_0x33a69b(0x1e2)]+_0x33a69b(0x1d2),()=>_0x407243[_0x33a69b(0x1d9)][_0x33a69b(0x1e3)](_0x3bf4d0,_0x46759d,_0x2b02da),{'verbose':_0x12953d[_0x33a69b(0x1e1)]}),_0x13f7e0=_0x2beced[_0x33a69b(0x1d4)];return console[_0x33a69b(0x1f5)]('✔\x20Updated\x20segment\x20\x27'+_0x13f7e0[_0x33a69b(0x1d0)]+'\x27'),_0x1af079!==_0x579a10&&console['error'](_0x33a69b(0x1d7)+_0x1af079),await handleSDKOutput([_0x13f7e0],_0x12953d),0x0;}}
1
+ function a42_0x1f21(_0x5cac36,_0x304442){_0x5cac36=_0x5cac36-0x128;const _0x791044=a42_0x7910();let _0x1f2138=_0x791044[_0x5cac36];return _0x1f2138;}const a42_0xf0f947=a42_0x1f21;(function(_0x156e01,_0x4915dd){const _0x19f9cf=a42_0x1f21,_0x413040=_0x156e01();while(!![]){try{const _0x38388f=parseInt(_0x19f9cf(0x144))/0x1+parseInt(_0x19f9cf(0x154))/0x2+-parseInt(_0x19f9cf(0x14c))/0x3*(-parseInt(_0x19f9cf(0x138))/0x4)+parseInt(_0x19f9cf(0x13c))/0x5*(-parseInt(_0x19f9cf(0x142))/0x6)+-parseInt(_0x19f9cf(0x128))/0x7+-parseInt(_0x19f9cf(0x12d))/0x8+parseInt(_0x19f9cf(0x132))/0x9*(-parseInt(_0x19f9cf(0x131))/0xa);if(_0x38388f===_0x4915dd)break;else _0x413040['push'](_0x413040['shift']());}catch(_0x922ece){_0x413040['push'](_0x413040['shift']());}}}(a42_0x7910,0xb3a41));import{BaseCommand}from'./command.js';function a42_0x7910(){const _0x41725e=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','kind','verbose','Updating\x20segment\x20\x27','2474296kOCLVI','rule','Examples:','Parent\x20ID:\x20','103159TUqBvV','description','parentId','type','includes','5664568UdnhQn','Resolving\x20folder\x20\x27','yellow','Resolved\x20type:\x20','910QFZLpu','8847khJNLX','INTERNAL','updateSegmentById','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentId','error','908nhEcst','\x27...','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentName','5EHUasf','resolveFolderId','segmentPath','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','length','ruleFile','6727620eRIFUE','Resolving\x20path\x20\x27','168029sOjQTF','resolvePathToResource','name','Error:\x20Cannot\x20update\x20','data','Resolved\x20folder\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segment','16707VIAJgC','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folder'];a42_0x7910=function(){return _0x41725e;};return a42_0x7910();}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_0x414890 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0xf0f947(0x146)]='segment:update';[a42_0xf0f947(0x129)]='Update\x20existing\x20child\x20segment';async['execute'](_0x1d0e6f){const _0x3822ac=a42_0xf0f947;console[_0x3822ac(0x137)](a42_0x414890[_0x3822ac(0x12f)](_0x3822ac(0x13f))),console['error'](a42_0x414890[_0x3822ac(0x12f)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x4f2bd8,args:_0x5c1437,tdx:_0x4ee64f}=_0x1d0e6f,_0x130fe5=_0x4f2bd8;if(_0x5c1437[_0x3822ac(0x140)]===0x0)return console[_0x3822ac(0x137)](_0x3822ac(0x14e)),console[_0x3822ac(0x137)](_0x3822ac(0x135)),console[_0x3822ac(0x137)](_0x3822ac(0x156)),console[_0x3822ac(0x137)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x3822ac(0x137)](_0x3822ac(0x150)),0x1;const _0x10f493=_0x5c1437[0x0],_0x5b33aa=_0x4f2bd8[_0x3822ac(0x13e)];let _0x61bef7=_0x10f493;_0x5b33aa&&!_0x10f493[_0x3822ac(0x12c)]('/')&&(_0x61bef7=_0x5b33aa+'/'+_0x10f493,_0x130fe5['verbose']&&console['error'](_0x3822ac(0x14d)+_0x61bef7));const _0x183e83=await withSpinner(_0x3822ac(0x143)+_0x61bef7+_0x3822ac(0x139),()=>_0x4ee64f[_0x3822ac(0x14b)][_0x3822ac(0x145)](_0x61bef7),{'verbose':_0x130fe5['verbose']}),_0xa04780=_0x183e83[_0x3822ac(0x148)];_0x130fe5[_0x3822ac(0x152)]&&console[_0x3822ac(0x137)](_0x3822ac(0x130)+_0xa04780[_0x3822ac(0x12b)]);if(_0xa04780['type']!==_0x3822ac(0x14b))return console[_0x3822ac(0x137)](_0x3822ac(0x147)+_0xa04780[_0x3822ac(0x12b)]+_0x3822ac(0x13a)),console[_0x3822ac(0x137)](_0x3822ac(0x14a)),0x1;if(!_0xa04780[_0x3822ac(0x136)])throw new SDKError(ErrorCode[_0x3822ac(0x133)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x48fc41=_0xa04780[_0x3822ac(0x12a)],_0x4d653b=_0xa04780[_0x3822ac(0x136)];_0x130fe5['verbose']&&(console[_0x3822ac(0x137)](_0x3822ac(0x157)+_0x48fc41),console[_0x3822ac(0x137)]('Segment\x20ID:\x20'+_0x4d653b));let _0x3b1e6d;if(_0x130fe5['folder']){const _0x24188f=_0x130fe5[_0x3822ac(0x14f)],_0x38cec4=await withSpinner(_0x3822ac(0x12e)+_0x24188f+'\x27...',()=>_0x4ee64f[_0x3822ac(0x14b)][_0x3822ac(0x13d)](_0x48fc41,_0x24188f),{'verbose':_0x130fe5[_0x3822ac(0x152)]});_0x3b1e6d=parseInt(_0x38cec4[_0x3822ac(0x148)],0xa),_0x130fe5[_0x3822ac(0x152)]&&console[_0x3822ac(0x137)](_0x3822ac(0x149)+_0x3b1e6d);}const _0x1c6e55=await loadJSONFromOptions(_0x130fe5[_0x3822ac(0x155)],_0x130fe5[_0x3822ac(0x141)]),_0x4018e9={'name':_0x130fe5['name'],'description':_0x130fe5[_0x3822ac(0x129)],'rule':_0x1c6e55,'kind':_0x130fe5[_0x3822ac(0x151)]!==undefined?parseInt(_0x130fe5['kind'],0xa):undefined,'segmentFolderId':_0x3b1e6d},_0x211185=await withSpinner(_0x3822ac(0x153)+_0xa04780[_0x3822ac(0x13b)]+'\x27...',()=>_0x4ee64f[_0x3822ac(0x14b)][_0x3822ac(0x134)](_0x48fc41,_0x4d653b,_0x4018e9),{'verbose':_0x130fe5[_0x3822ac(0x152)]}),_0x17d163=_0x211185[_0x3822ac(0x148)];return console[_0x3822ac(0x137)]('✔\x20Updated\x20segment\x20\x27'+_0x17d163[_0x3822ac(0x146)]+'\x27'),_0x61bef7!==_0x10f493&&console[_0x3822ac(0x137)]('\x20\x20\x20Path:\x20'+_0x61bef7),await handleSDKOutput([_0x17d163],_0x130fe5),0x0;}}
@@ -1 +1 @@
1
- const a43_0x3dde44=a43_0x38fa;(function(_0x487d98,_0x21ccf6){const _0x5282d5=a43_0x38fa,_0x4349e9=_0x487d98();while(!![]){try{const _0x139c58=parseInt(_0x5282d5(0x155))/0x1*(parseInt(_0x5282d5(0x158))/0x2)+-parseInt(_0x5282d5(0x161))/0x3+-parseInt(_0x5282d5(0x152))/0x4+parseInt(_0x5282d5(0x148))/0x5+-parseInt(_0x5282d5(0x154))/0x6*(-parseInt(_0x5282d5(0x151))/0x7)+parseInt(_0x5282d5(0x14f))/0x8*(parseInt(_0x5282d5(0x13e))/0x9)+-parseInt(_0x5282d5(0x13f))/0xa*(-parseInt(_0x5282d5(0x140))/0xb);if(_0x139c58===_0x21ccf6)break;else _0x4349e9['push'](_0x4349e9['shift']());}catch(_0x37df2d){_0x4349e9['push'](_0x4349e9['shift']());}}}(a43_0x37d9,0xbbd89));function a43_0x38fa(_0x23b8d5,_0x3dd8a0){_0x23b8d5=_0x23b8d5-0x134;const _0x37d924=a43_0x37d9();let _0x38fa59=_0x37d924[_0x23b8d5];return _0x38fa59;}import{existsSync,statSync}from'fs';function a43_0x37d9(){const _0x4bc3e0=['\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','segment','red','Examples:','error','execute','folderId','Error:\x20Path\x20is\x20required\x0a','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','fullPath','Use:\x20tdx\x20segment\x20use\x20','Resolving\x20path\x20\x27','isAbsolute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','27zDsoNt','30gzlnWJ','3530087AgvuSB','parentName','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','log','verbose','folderPath','session','description','3516115CPZIRF','Usage:\x20tdx\x20segment\x20use\x20<path>','dim','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','parent_segment','name','parentId','97976GuXmKw','Site:\x20','26887nTsDYM','3182064aJJDaQ','slice','1032QBlhKc','12apIepK','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Parent\x20ID:\x20','102764MqivOp','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','data','Target\x20path:\x20','isDirectory','\x27...','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Resolved\x20relative\x20path\x20to:\x20','4245054dkFymN','length','join','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','green','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','✔\x20Context\x20set\x20to:\x20','site','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','cyan','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segments'];a43_0x37d9=function(){return _0x4bc3e0;};return a43_0x37d9();}import a43_0x4be4da from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x3dde44(0x14d)]='segment:use';[a43_0x3dde44(0x147)]=a43_0x3dde44(0x13d);async[a43_0x3dde44(0x135)](_0x4c5984){const _0x3584f1=a43_0x3dde44,{options:_0x2d2072,args:_0x3c1605,tdx:_0x39b57d}=_0x4c5984;if(_0x3c1605[_0x3584f1(0x162)]===0x0)return console[_0x3584f1(0x134)](a43_0x4be4da[_0x3584f1(0x16f)](_0x3584f1(0x137))),console[_0x3584f1(0x134)](_0x3584f1(0x149)),console[_0x3584f1(0x134)](_0x3584f1(0x170)),console[_0x3584f1(0x134)](_0x3584f1(0x138)),console[_0x3584f1(0x134)](_0x3584f1(0x16d)),console[_0x3584f1(0x134)](_0x3584f1(0x14b)),console[_0x3584f1(0x134)](_0x3584f1(0x169)),0x1;const _0x1ccf4f=_0x3c1605[0x0],_0x5a1449=_0x2d2072[_0x3584f1(0x146)];try{if(_0x1ccf4f==='/')return saveSessionContext({'segment_path':undefined},_0x5a1449),console[_0x3584f1(0x143)](a43_0x4be4da[_0x3584f1(0x165)](_0x3584f1(0x159))),0x0;if(existsSync(_0x1ccf4f)&&statSync(_0x1ccf4f)[_0x3584f1(0x15c)]()){let _0x43a7b5;try{_0x43a7b5=findTdxConfig(_0x1ccf4f);}catch{return console[_0x3584f1(0x134)](a43_0x4be4da['red'](_0x3584f1(0x16b)+_0x1ccf4f)),console[_0x3584f1(0x134)](a43_0x4be4da[_0x3584f1(0x16a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0xe73ec4=_0x43a7b5['config'][_0x3584f1(0x14c)];return saveSessionContext({'segment_path':_0xe73ec4,'parent_segment':_0xe73ec4},_0x5a1449),console['log'](a43_0x4be4da[_0x3584f1(0x165)]('✔\x20Context\x20set\x20to:\x20'+a43_0x4be4da[_0x3584f1(0x16a)](_0xe73ec4))),0x0;}const _0x9414c8=_0x2d2072['segmentPath'];let _0x759a8b=_0x1ccf4f;const _0x12ce7b=parsePath(_0x1ccf4f);if(!_0x12ce7b[_0x3584f1(0x13c)]){if(!_0x9414c8)return console[_0x3584f1(0x134)](a43_0x4be4da[_0x3584f1(0x16f)](_0x3584f1(0x15e))),console[_0x3584f1(0x134)](a43_0x4be4da[_0x3584f1(0x16a)](_0x3584f1(0x156))),0x1;if(_0x1ccf4f==='..'){const _0x4a04aa=_0x9414c8['split']('/')[_0x3584f1(0x153)](0x0,-0x1)[_0x3584f1(0x163)]('/');_0x759a8b=_0x4a04aa||'/';}else _0x1ccf4f==='.'?_0x759a8b=_0x9414c8:_0x759a8b=_0x9414c8+'/'+_0x1ccf4f;_0x2d2072[_0x3584f1(0x144)]&&console[_0x3584f1(0x134)](_0x3584f1(0x160)+_0x759a8b);}if(_0x759a8b==='/'||_0x759a8b==='')return saveSessionContext({'segment_path':undefined},_0x5a1449),console[_0x3584f1(0x143)](a43_0x4be4da['green'](_0x3584f1(0x159))),0x0;_0x759a8b=normalizePath(_0x759a8b);const _0x463213=parsePath(_0x759a8b)[_0x3584f1(0x16c)];if(_0x463213[_0x3584f1(0x162)]===0x0)return saveSessionContext({'segment_path':undefined},_0x5a1449),console[_0x3584f1(0x143)](a43_0x4be4da[_0x3584f1(0x165)](_0x3584f1(0x159))),0x0;_0x2d2072['verbose']&&(console[_0x3584f1(0x134)](_0x3584f1(0x150)+_0x2d2072[_0x3584f1(0x168)]),console[_0x3584f1(0x134)](_0x3584f1(0x15b)+_0x759a8b));const _0x3aa6ed=await withSpinner(_0x3584f1(0x13b)+_0x759a8b+_0x3584f1(0x15d),()=>_0x39b57d[_0x3584f1(0x16e)]['resolvePathToResource'](_0x759a8b),{'verbose':_0x2d2072[_0x3584f1(0x144)]}),_0x39a606=_0x3aa6ed[_0x3584f1(0x15a)];_0x2d2072['verbose']&&(console[_0x3584f1(0x134)]('Resolved\x20path\x20type:\x20'+_0x39a606['type']),console[_0x3584f1(0x134)](_0x3584f1(0x157)+_0x39a606[_0x3584f1(0x14e)]),_0x39a606[_0x3584f1(0x136)]&&console[_0x3584f1(0x134)]('Folder\x20ID:\x20'+_0x39a606[_0x3584f1(0x136)]));if(_0x39a606['type']===_0x3584f1(0x16e))return console[_0x3584f1(0x134)](a43_0x4be4da[_0x3584f1(0x16f)](_0x3584f1(0x142))),console[_0x3584f1(0x134)](_0x3584f1(0x15f)),console[_0x3584f1(0x134)](a43_0x4be4da[_0x3584f1(0x16a)](_0x3584f1(0x13a)+_0x39a606['parentName']+(_0x39a606[_0x3584f1(0x145)]?'/'+_0x39a606[_0x3584f1(0x145)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x39a606[_0x3584f1(0x139)],'parent_segment':_0x39a606[_0x3584f1(0x141)]},_0x5a1449),console[_0x3584f1(0x143)](a43_0x4be4da[_0x3584f1(0x165)](_0x3584f1(0x167)+a43_0x4be4da[_0x3584f1(0x16a)](_0x39a606[_0x3584f1(0x139)]))),_0x2d2072[_0x3584f1(0x144)]&&(console[_0x3584f1(0x134)](a43_0x4be4da[_0x3584f1(0x14a)](_0x3584f1(0x164))),console['error'](a43_0x4be4da[_0x3584f1(0x14a)](_0x3584f1(0x166)))),0x0;}catch(_0x13b730){throw _0x13b730;}}}
1
+ const a43_0x99ae47=a43_0xaabc;(function(_0x2724f0,_0x2e7ad6){const _0x245f76=a43_0xaabc,_0x5d125e=_0x2724f0();while(!![]){try{const _0x3fcbfd=parseInt(_0x245f76(0x114))/0x1+parseInt(_0x245f76(0x111))/0x2+-parseInt(_0x245f76(0x110))/0x3*(-parseInt(_0x245f76(0xfd))/0x4)+-parseInt(_0x245f76(0x102))/0x5+-parseInt(_0x245f76(0xfc))/0x6+-parseInt(_0x245f76(0xf6))/0x7*(-parseInt(_0x245f76(0xf5))/0x8)+parseInt(_0x245f76(0xf3))/0x9*(-parseInt(_0x245f76(0xf8))/0xa);if(_0x3fcbfd===_0x2e7ad6)break;else _0x5d125e['push'](_0x5d125e['shift']());}catch(_0x4734ba){_0x5d125e['push'](_0x5d125e['shift']());}}}(a43_0x19b0,0x47fb0));import{existsSync,statSync}from'fs';import a43_0x3bb1f2 from'chalk';function a43_0x19b0(){const _0x317266=['parentName','✔\x20Context\x20set\x20to:\x20','dim','join','log','name','873LnCDcf','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','16hfNXXP','1522570iEIAhp','type','94090guRTUU','segmentPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','error','1004004mTyKYb','52908PbvIkP','resolvePathToResource','split','cyan','Usage:\x20tdx\x20segment\x20use\x20<path>','265175UMcPff','red','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Target\x20path:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','slice','Error:\x20Path\x20is\x20required\x0a','verbose','parent_segment','Examples:','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','segment','3HJUaEP','1009550eipwLo','Resolved\x20path\x20type:\x20','config','474852DpAmSn','segments','folderId','data','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','fullPath','Resolving\x20path\x20\x27','\x27...','Resolved\x20relative\x20path\x20to:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','length','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','parentId','session'];a43_0x19b0=function(){return _0x317266;};return a43_0x19b0();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0xaabc(_0xd02d9b,_0x1c1196){_0xd02d9b=_0xd02d9b-0xf1;const _0x19b05c=a43_0x19b0();let _0xaabc15=_0x19b05c[_0xd02d9b];return _0xaabc15;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x99ae47(0xf2)]='segment:use';['description']=a43_0x99ae47(0xfa);async['execute'](_0x403a82){const _0x49287b=a43_0x99ae47,{options:_0x3d83bf,args:_0x42ca5c,tdx:_0x3b7b53}=_0x403a82;if(_0x42ca5c['length']===0x0)return console[_0x49287b(0xfb)](a43_0x3bb1f2['red'](_0x49287b(0x109))),console[_0x49287b(0xfb)](_0x49287b(0x101)),console[_0x49287b(0xfb)](_0x49287b(0x10c)),console['error'](_0x49287b(0x10e)),console[_0x49287b(0xfb)](_0x49287b(0x119)),console[_0x49287b(0xfb)](_0x49287b(0x104)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x127f1c=_0x42ca5c[0x0],_0x9dc680=_0x3d83bf[_0x49287b(0x123)];try{if(_0x127f1c==='/')return saveSessionContext({'segment_path':undefined},_0x9dc680),console['log'](a43_0x3bb1f2['green'](_0x49287b(0x105))),0x0;if(existsSync(_0x127f1c)&&statSync(_0x127f1c)['isDirectory']()){let _0x594678;try{_0x594678=findTdxConfig(_0x127f1c);}catch{return console[_0x49287b(0xfb)](a43_0x3bb1f2['red'](_0x49287b(0x120)+_0x127f1c)),console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x100)](_0x49287b(0x11e))),0x1;}const _0x78ad8c=_0x594678[_0x49287b(0x113)][_0x49287b(0x10b)];return saveSessionContext({'segment_path':_0x78ad8c,'parent_segment':_0x78ad8c},_0x9dc680),console['log'](a43_0x3bb1f2[_0x49287b(0x10d)](_0x49287b(0x125)+a43_0x3bb1f2['cyan'](_0x78ad8c))),0x0;}const _0x4a1337=_0x3d83bf[_0x49287b(0xf9)];let _0x4bd35c=_0x127f1c;const _0x31cb9c=parsePath(_0x127f1c);if(!_0x31cb9c['isAbsolute']){if(!_0x4a1337)return console[_0x49287b(0xfb)](a43_0x3bb1f2['red'](_0x49287b(0x107))),console[_0x49287b(0xfb)](a43_0x3bb1f2['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x127f1c==='..'){const _0x1222a4=_0x4a1337[_0x49287b(0xff)]('/')[_0x49287b(0x108)](0x0,-0x1)['join']('/');_0x4bd35c=_0x1222a4||'/';}else _0x127f1c==='.'?_0x4bd35c=_0x4a1337:_0x4bd35c=_0x4a1337+'/'+_0x127f1c;_0x3d83bf[_0x49287b(0x10a)]&&console[_0x49287b(0xfb)](_0x49287b(0x11d)+_0x4bd35c);}if(_0x4bd35c==='/'||_0x4bd35c==='')return saveSessionContext({'segment_path':undefined},_0x9dc680),console[_0x49287b(0xf1)](a43_0x3bb1f2[_0x49287b(0x10d)](_0x49287b(0x105))),0x0;_0x4bd35c=normalizePath(_0x4bd35c);const _0x3b1ae5=parsePath(_0x4bd35c)[_0x49287b(0x115)];if(_0x3b1ae5[_0x49287b(0x11f)]===0x0)return saveSessionContext({'segment_path':undefined},_0x9dc680),console['log'](a43_0x3bb1f2[_0x49287b(0x10d)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3d83bf['verbose']&&(console['error']('Site:\x20'+_0x3d83bf['site']),console[_0x49287b(0xfb)](_0x49287b(0x106)+_0x4bd35c));const _0x3a500d=await withSpinner(_0x49287b(0x11b)+_0x4bd35c+_0x49287b(0x11c),()=>_0x3b7b53[_0x49287b(0x10f)][_0x49287b(0xfe)](_0x4bd35c),{'verbose':_0x3d83bf[_0x49287b(0x10a)]}),_0x2b8673=_0x3a500d[_0x49287b(0x117)];_0x3d83bf[_0x49287b(0x10a)]&&(console['error'](_0x49287b(0x112)+_0x2b8673[_0x49287b(0xf7)]),console['error']('Parent\x20ID:\x20'+_0x2b8673[_0x49287b(0x122)]),_0x2b8673['folderId']&&console[_0x49287b(0xfb)]('Folder\x20ID:\x20'+_0x2b8673[_0x49287b(0x116)]));if(_0x2b8673['type']==='segment')return console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x103)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x49287b(0xfb)](_0x49287b(0x118)),console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x100)]('Use:\x20tdx\x20segment\x20use\x20'+_0x2b8673[_0x49287b(0x124)]+(_0x2b8673['folderPath']?'/'+_0x2b8673['folderPath'][_0x49287b(0x127)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2b8673['fullPath'],'parent_segment':_0x2b8673[_0x49287b(0x124)]},_0x9dc680),console[_0x49287b(0xf1)](a43_0x3bb1f2[_0x49287b(0x10d)](_0x49287b(0x125)+a43_0x3bb1f2[_0x49287b(0x100)](_0x2b8673[_0x49287b(0x11a)]))),_0x3d83bf[_0x49287b(0x10a)]&&(console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x126)](_0x49287b(0xf4))),console['error'](a43_0x3bb1f2['dim'](_0x49287b(0x121)))),0x0;}catch(_0x508c7e){throw _0x508c7e;}}}
@@ -1 +1 @@
1
- function a44_0x4db6(){const _0x45df46=['helpText','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20error(s)','segment:validate','red','\x20valid','warnings','✔\x20All\x20','164542aMaZkT','description','1010814jNQjgE','name','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','verbose','\x20file(s)\x20valid','error','Error:\x20Directory\x20not\x20found:\x20','1828100SQQtzP','):\x20','validCount','4QdgaAx','.yaml','yellow','message','.yml','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','type','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\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','warningCount','8XuvqAo','1394403csYVOM','1512081FYBQXK','\x20file(s)\x20with\x20errors,\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','hasErrors','errors','endsWith','green','Error:\x20','\x20warning(s)','valid','invalidCount','targetDir','\x20warning(s)\x20found','errorCode','parentSegment','dim','log','5xasthQ','execute','526862fvJbOF','2914080miRfsI'];a44_0x4db6=function(){return _0x45df46;};return a44_0x4db6();}const a44_0x5f2692=a44_0x40c7;(function(_0x42364d,_0x1b667e){const _0x105f68=a44_0x40c7,_0x1ffe64=_0x42364d();while(!![]){try{const _0x3d3862=-parseInt(_0x105f68(0x7c))/0x1*(parseInt(_0x105f68(0x88))/0x2)+parseInt(_0x105f68(0xa0))/0x3+parseInt(_0x105f68(0x94))/0x4*(-parseInt(_0x105f68(0x91))/0x5)+parseInt(_0x105f68(0x8a))/0x6+-parseInt(_0x105f68(0x7e))/0x7*(parseInt(_0x105f68(0x9f))/0x8)+parseInt(_0x105f68(0xa1))/0x9+parseInt(_0x105f68(0x7f))/0xa;if(_0x3d3862===_0x1b667e)break;else _0x1ffe64['push'](_0x1ffe64['shift']());}catch(_0x339c5d){_0x1ffe64['push'](_0x1ffe64['shift']());}}}(a44_0x4db6,0x3ab3e));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0x40c7(_0x21b027,_0x297307){_0x21b027=_0x21b027-0x6c;const _0x4db658=a44_0x4db6();let _0x40c7ad=_0x4db658[_0x21b027];return _0x40c7ad;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x3eae91 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x5f2692(0x8b)]=a44_0x5f2692(0x83);[a44_0x5f2692(0x89)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a44_0x5f2692(0x7d)](_0x2b45aa){const _0x2460b8=a44_0x5f2692,{options:_0x2b2d8d,args:_0x46758e}=_0x2b45aa,_0x1d3494=_0x2b2d8d,_0x352e2d=await resolveTarget({'arg':_0x46758e[0x0],'contextParent':_0x2b2d8d[_0x2460b8(0x79)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x352e2d))return _0x352e2d[_0x2460b8(0x78)]==='no_parent'?(console[_0x2460b8(0x8f)](a44_0x3eae91[_0x2460b8(0x96)](_0x2460b8(0x99))),console[_0x2460b8(0x8f)](_0x2460b8(0x8c)),console[_0x2460b8(0x8f)](_0x2460b8(0x9d)),console[_0x2460b8(0x8f)](_0x2460b8(0x9c))):(console[_0x2460b8(0x8f)](a44_0x3eae91['red'](_0x2460b8(0x72)+_0x352e2d[_0x2460b8(0x97)]+'\x0a')),_0x352e2d[_0x2460b8(0x80)]&&console[_0x2460b8(0x8f)](a44_0x3eae91['cyan'](_0x352e2d['helpText']))),0x1;const _0x30dc46=_0x352e2d[_0x2460b8(0x76)],_0x1746d5=_0x352e2d[_0x2460b8(0x9a)]==='file'?_0x352e2d['filePath']:undefined;if(!_0x1746d5&&!existsSync(_0x30dc46))return console[_0x2460b8(0x8f)](a44_0x3eae91[_0x2460b8(0x84)](_0x2460b8(0x90)+_0x30dc46+'\x0a')),0x1;let _0x336b2a;if(_0x1746d5){if(!_0x1746d5[_0x2460b8(0x70)](_0x2460b8(0x98))&&!_0x1746d5[_0x2460b8(0x70)](_0x2460b8(0x95)))return console[_0x2460b8(0x8f)](a44_0x3eae91[_0x2460b8(0x84)](_0x2460b8(0x6d)+_0x1746d5+'\x0a')),0x1;_0x336b2a=[_0x1746d5];}else _0x336b2a=findYamlFiles(_0x30dc46);if(_0x336b2a[_0x2460b8(0x9b)]===0x0)return console[_0x2460b8(0x8f)](a44_0x3eae91['red'](_0x2460b8(0x81)+_0x30dc46+'\x0a')),0x1;const _0x357872=validateYamlFiles(_0x336b2a,_0x30dc46),_0x20cc1b=calculateSummary(_0x357872);for(const _0x5099da of _0x357872){if(!isValidationResult(_0x5099da))continue;const {relativePath:_0x3e22d0,source:_0x4842e5,result:_0x4c105b,fileType:_0x54da32}=_0x5099da,_0x234ce6=_0x54da32;if(_0x4c105b[_0x2460b8(0x74)]&&_0x4c105b[_0x2460b8(0x86)][_0x2460b8(0x9b)]===0x0)_0x1d3494[_0x2460b8(0x8d)]&&console[_0x2460b8(0x7b)](a44_0x3eae91[_0x2460b8(0x71)]('✔\x20'+_0x3e22d0)+a44_0x3eae91[_0x2460b8(0x7a)]('\x20('+_0x234ce6+')'));else _0x4c105b[_0x2460b8(0x74)]?(console['log'](a44_0x3eae91[_0x2460b8(0x96)]('⚠\x20'+_0x3e22d0)+a44_0x3eae91['dim']('\x20('+_0x234ce6+_0x2460b8(0x92)+_0x4c105b['warnings'][_0x2460b8(0x9b)]+_0x2460b8(0x73))),console[_0x2460b8(0x7b)](formatValidationResult(_0x4c105b,_0x4842e5,_0x3e22d0))):(console[_0x2460b8(0x7b)](a44_0x3eae91[_0x2460b8(0x84)]('✖\x20'+_0x3e22d0)+a44_0x3eae91[_0x2460b8(0x7a)]('\x20('+_0x234ce6+_0x2460b8(0x92)+_0x4c105b[_0x2460b8(0x6f)][_0x2460b8(0x9b)]+_0x2460b8(0x82))),console[_0x2460b8(0x7b)](formatValidationResult(_0x4c105b,_0x4842e5,_0x3e22d0)));}return console[_0x2460b8(0x7b)](''),_0x20cc1b[_0x2460b8(0x6e)]?(console[_0x2460b8(0x7b)](a44_0x3eae91[_0x2460b8(0x84)]('Validation\x20failed:\x20'+_0x20cc1b[_0x2460b8(0x75)]+_0x2460b8(0x6c)+_0x20cc1b[_0x2460b8(0x93)]+_0x2460b8(0x85))),_0x20cc1b[_0x2460b8(0x9e)]>0x0&&console[_0x2460b8(0x7b)](a44_0x3eae91[_0x2460b8(0x96)](_0x20cc1b['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x2460b8(0x7b)](a44_0x3eae91[_0x2460b8(0x71)](_0x2460b8(0x87)+_0x20cc1b[_0x2460b8(0x93)]+_0x2460b8(0x8e))),_0x20cc1b[_0x2460b8(0x9e)]>0x0&&console['log'](a44_0x3eae91[_0x2460b8(0x96)](_0x20cc1b[_0x2460b8(0x9e)]+_0x2460b8(0x77))),0x0);}}
1
+ const a44_0x2cbb89=a44_0x100a;(function(_0x3af6b6,_0x1188ca){const _0xf9ae0e=a44_0x100a,_0x2f61c1=_0x3af6b6();while(!![]){try{const _0x354cb6=parseInt(_0xf9ae0e(0x11a))/0x1*(-parseInt(_0xf9ae0e(0x129))/0x2)+-parseInt(_0xf9ae0e(0x120))/0x3*(parseInt(_0xf9ae0e(0x121))/0x4)+-parseInt(_0xf9ae0e(0xf3))/0x5*(parseInt(_0xf9ae0e(0xf5))/0x6)+-parseInt(_0xf9ae0e(0x119))/0x7+parseInt(_0xf9ae0e(0x10c))/0x8*(parseInt(_0xf9ae0e(0xf7))/0x9)+-parseInt(_0xf9ae0e(0x110))/0xa*(parseInt(_0xf9ae0e(0x114))/0xb)+parseInt(_0xf9ae0e(0x118))/0xc;if(_0x354cb6===_0x1188ca)break;else _0x2f61c1['push'](_0x2f61c1['shift']());}catch(_0x10093c){_0x2f61c1['push'](_0x2f61c1['shift']());}}}(a44_0x5d37,0xb680b));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';function a44_0x100a(_0x404070,_0x16505e){_0x404070=_0x404070-0xf3;const _0x5d378d=a44_0x5d37();let _0x100a2f=_0x5d378d[_0x404070];return _0x100a2f;}function a44_0x5d37(){const _0x26d412=['red','validCount','\x20file(s)\x20with\x20errors,\x20','):\x20','dim','error','\x20warning(s)','9276112CSesUa','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','valid','file','10AYMkfV','\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','Validate\x20segment\x20and\x20journey\x20YAML\x20files','Validation\x20failed:\x20','7061164XOyGeC','name','warningCount','execute','60846444fNiZcL','8791314cNeHfh','869YkMRmV','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filePath','.yaml','hasErrors','\x20file(s)\x20valid','3280368Ejrgku','4WCuFmM','log','\x20warning(s)\x20found','errorCode','✔\x20All\x20','length','Error:\x20Directory\x20not\x20found:\x20','description','2726fdPfWU','message','284085SRsrmq','yellow','138mZtxNx','green','9lXxVyo','warnings','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','errors','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','no_parent','type','cyan','parentSegment','\x20valid','helpText','segment:validate','.yml','endsWith'];a44_0x5d37=function(){return _0x26d412;};return a44_0x5d37();}import a44_0x5aa63f from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x2cbb89(0x115)]=a44_0x2cbb89(0x102);[a44_0x2cbb89(0x128)]=a44_0x2cbb89(0x112);async[a44_0x2cbb89(0x117)](_0x583b58){const _0x59a91c=a44_0x2cbb89,{options:_0x529f3a,args:_0x5831a3}=_0x583b58,_0x31a3e6=_0x529f3a,_0x3e49ad=await resolveTarget({'arg':_0x5831a3[0x0],'contextParent':_0x529f3a[_0x59a91c(0xff)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3e49ad))return _0x3e49ad[_0x59a91c(0x124)]===_0x59a91c(0xfc)?(console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0xf4)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x59a91c(0x10a)](_0x59a91c(0xfb)),console[_0x59a91c(0x10a)](_0x59a91c(0x111)),console[_0x59a91c(0x10a)](_0x59a91c(0x11b))):(console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0x105)]('Error:\x20'+_0x3e49ad[_0x59a91c(0x12a)]+'\x0a')),_0x3e49ad[_0x59a91c(0x101)]&&console['error'](a44_0x5aa63f[_0x59a91c(0xfe)](_0x3e49ad[_0x59a91c(0x101)]))),0x1;const _0x491e77=_0x3e49ad['targetDir'],_0x42e532=_0x3e49ad[_0x59a91c(0xfd)]===_0x59a91c(0x10f)?_0x3e49ad[_0x59a91c(0x11c)]:undefined;if(!_0x42e532&&!existsSync(_0x491e77))return console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0x105)](_0x59a91c(0x127)+_0x491e77+'\x0a')),0x1;let _0x3b5257;if(_0x42e532){if(!_0x42e532[_0x59a91c(0x104)](_0x59a91c(0x103))&&!_0x42e532[_0x59a91c(0x104)](_0x59a91c(0x11d)))return console[_0x59a91c(0x10a)](a44_0x5aa63f['red'](_0x59a91c(0x10d)+_0x42e532+'\x0a')),0x1;_0x3b5257=[_0x42e532];}else _0x3b5257=findYamlFiles(_0x491e77);if(_0x3b5257[_0x59a91c(0x126)]===0x0)return console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0x105)](_0x59a91c(0xf9)+_0x491e77+'\x0a')),0x1;const _0x52dc0e=validateYamlFiles(_0x3b5257,_0x491e77),_0x5d938e=calculateSummary(_0x52dc0e);for(const _0x11acfc of _0x52dc0e){if(!isValidationResult(_0x11acfc))continue;const {relativePath:_0x417f24,source:_0x882b16,result:_0x141b28,fileType:_0x4b7068}=_0x11acfc,_0x57270c=_0x4b7068;if(_0x141b28[_0x59a91c(0x10e)]&&_0x141b28[_0x59a91c(0xf8)][_0x59a91c(0x126)]===0x0)_0x31a3e6['verbose']&&console['log'](a44_0x5aa63f[_0x59a91c(0xf6)]('✔\x20'+_0x417f24)+a44_0x5aa63f[_0x59a91c(0x109)]('\x20('+_0x57270c+')'));else _0x141b28[_0x59a91c(0x10e)]?(console['log'](a44_0x5aa63f[_0x59a91c(0xf4)]('⚠\x20'+_0x417f24)+a44_0x5aa63f[_0x59a91c(0x109)]('\x20('+_0x57270c+_0x59a91c(0x108)+_0x141b28[_0x59a91c(0xf8)]['length']+_0x59a91c(0x10b))),console['log'](formatValidationResult(_0x141b28,_0x882b16,_0x417f24))):(console['log'](a44_0x5aa63f[_0x59a91c(0x105)]('✖\x20'+_0x417f24)+a44_0x5aa63f['dim']('\x20('+_0x57270c+_0x59a91c(0x108)+_0x141b28[_0x59a91c(0xfa)][_0x59a91c(0x126)]+'\x20error(s)')),console[_0x59a91c(0x122)](formatValidationResult(_0x141b28,_0x882b16,_0x417f24)));}return console[_0x59a91c(0x122)](''),_0x5d938e[_0x59a91c(0x11e)]?(console[_0x59a91c(0x122)](a44_0x5aa63f['red'](_0x59a91c(0x113)+_0x5d938e['invalidCount']+_0x59a91c(0x107)+_0x5d938e['validCount']+_0x59a91c(0x100))),_0x5d938e[_0x59a91c(0x116)]>0x0&&console[_0x59a91c(0x122)](a44_0x5aa63f['yellow'](_0x5d938e['warningCount']+_0x59a91c(0x123))),0x1):(console['log'](a44_0x5aa63f[_0x59a91c(0xf6)](_0x59a91c(0x125)+_0x5d938e[_0x59a91c(0x106)]+_0x59a91c(0x11f))),_0x5d938e[_0x59a91c(0x116)]>0x0&&console[_0x59a91c(0x122)](a44_0x5aa63f[_0x59a91c(0xf4)](_0x5d938e['warningCount']+_0x59a91c(0x123))),0x0);}}
@@ -1 +1 @@
1
- function a45_0x7ea0(_0x9744f5,_0x395e9e){_0x9744f5=_0x9744f5-0x139;const _0x249492=a45_0x2494();let _0x7ea032=_0x249492[_0x9744f5];return _0x7ea032;}const a45_0x164e50=a45_0x7ea0;(function(_0x2f9186,_0x19ce1f){const _0x5c738b=a45_0x7ea0,_0x27d228=_0x2f9186();while(!![]){try{const _0x94ee30=-parseInt(_0x5c738b(0x17a))/0x1*(parseInt(_0x5c738b(0x172))/0x2)+parseInt(_0x5c738b(0x16b))/0x3+parseInt(_0x5c738b(0x16f))/0x4+-parseInt(_0x5c738b(0x16c))/0x5+-parseInt(_0x5c738b(0x160))/0x6*(-parseInt(_0x5c738b(0x15a))/0x7)+parseInt(_0x5c738b(0x16a))/0x8+-parseInt(_0x5c738b(0x15e))/0x9;if(_0x94ee30===_0x19ce1f)break;else _0x27d228['push'](_0x27d228['shift']());}catch(_0x51ca42){_0x27d228['push'](_0x27d228['shift']());}}}(a45_0x2494,0x3f147));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_0x21d6da from'chalk';function a45_0x2494(){const _0x924778=['message','Parent\x20segment\x20context:\x20','Error:\x20No\x20parent\x20segment\x20context\x20set.','listUnifiedWithJourneys','3021736rzPDPH','626574qLeAsr','1429965mGsYBY','✔\x20Built\x20tree\x20with\x20','log','1678348hrkpTF','folders','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','15772ipivCz','\x20folder','includes','\x5c$&','journeyBundleName','map','segments','journeys','13QNdaDd','site','✔\x20Found\x20','/app/ps/','name','Resolving\x20path\x20\x27','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Set\x20a\x20parent\x20segment\x20context\x20first:','children','segment','(not\x20set)','\x20segment','Folder/pattern\x20arg:\x20','filter','jsonl','\x20matching\x20\x27','length','/j/da','resolvePathToResource','Listing\x20folders,\x20segments,\x20and\x20journeys...','error','\x20\x20Cause:\x20','\x20journey','folderId','/e/','dim','json','localeCompare','maxDepth','(empty)','cause','Building\x20hierarchy\x20tree...','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','parentId','test','listWithPattern','listRecursive','Error:\x20','format','description','journey','Folder\x20ID:\x20',',\x20and\x20','data','9765LfStZb','No\x20items\x20match\x20pattern:\x20','sort','Recursive\x20mode:\x20enabled','3798459KQupqu','folder','270tXLSTl','Parent\x20ID:\x20','listUnified','verbose','parentSegment','\x27...'];a45_0x2494=function(){return _0x924778;};return a45_0x2494();}export class SegmentsCommand extends BaseCommand{[a45_0x164e50(0x17e)]=a45_0x164e50(0x178);[a45_0x164e50(0x155)]='List\x20folders\x20and\x20child\x20segments';async['execute'](_0x486040){const _0xd233a4=a45_0x164e50,{options:_0x4be191,args:_0x323d32}=_0x486040,_0x5b53ce=_0x4be191['recursive'],_0x432116=_0x323d32[0x0];try{const _0x513248=_0x4be191[_0xd233a4(0x164)];_0x4be191[_0xd233a4(0x163)]&&(console[_0xd233a4(0x142)]('Site:\x20'+_0x4be191[_0xd233a4(0x17b)]),console[_0xd233a4(0x142)](_0xd233a4(0x167)+(_0x513248||_0xd233a4(0x184))),_0x432116&&console[_0xd233a4(0x142)](_0xd233a4(0x13a)+_0x432116),_0x5b53ce&&console[_0xd233a4(0x142)](_0xd233a4(0x15d)));if(!_0x513248)return console[_0xd233a4(0x142)](_0xd233a4(0x168)),console['error'](''),console[_0xd233a4(0x142)](_0xd233a4(0x181)),console[_0xd233a4(0x142)](_0xd233a4(0x180)),console[_0xd233a4(0x142)](_0xd233a4(0x14e)),console[_0xd233a4(0x142)](''),console[_0xd233a4(0x142)](_0xd233a4(0x171)),0x1;const _0xa9a291=_0x432116&&(_0x432116[_0xd233a4(0x174)]('*')||_0x432116[_0xd233a4(0x174)]('?'));if(_0xa9a291)return await this[_0xd233a4(0x151)](_0x486040,_0x513248,_0x432116);const _0x738fb9=_0x432116?_0x513248+'/'+_0x432116:_0x513248;return _0x5b53ce?await this[_0xd233a4(0x152)](_0x486040,_0x738fb9):await this['listUnified'](_0x486040,_0x738fb9);}catch(_0x2eda57){if(_0x2eda57 instanceof SDKError)return console[_0xd233a4(0x142)](_0xd233a4(0x153)+_0x2eda57[_0xd233a4(0x166)]),_0x2eda57[_0xd233a4(0x14c)]&&console['error'](_0xd233a4(0x143)+_0x2eda57[_0xd233a4(0x14c)]),0x1;throw _0x2eda57;}}async[a45_0x164e50(0x151)](_0x14e78f,_0x17fe12,_0x64bad6){const _0x5d7619=a45_0x164e50,{options:_0x4ba472,tdx:_0x1dfcc4}=_0x14e78f,_0x3dee11=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x17fe12+_0x5d7619(0x165),()=>_0x1dfcc4[_0x5d7619(0x183)][_0x5d7619(0x140)](_0x17fe12),{'verbose':_0x4ba472[_0x5d7619(0x163)]}),_0x491ba2=_0x3dee11[_0x5d7619(0x159)],_0x11a93b=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x1dfcc4[_0x5d7619(0x183)][_0x5d7619(0x169)](_0x491ba2[_0x5d7619(0x14f)],_0x491ba2[_0x5d7619(0x145)]),{'verbose':_0x4ba472[_0x5d7619(0x163)]}),{folders:_0xf3b3cf,segments:_0x453c3a,journeys:_0x4b3020}=_0x11a93b[_0x5d7619(0x159)],_0x15e0c8=_0x64bad6['replace'](/[.+^${}()|[\]\\]/g,_0x5d7619(0x175))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x33fac0=new RegExp('^'+_0x15e0c8+'$','i'),_0x2d2bc1=_0xf3b3cf[_0x5d7619(0x13b)](_0x567bb3=>_0x33fac0[_0x5d7619(0x150)](_0x567bb3[_0x5d7619(0x17e)])),_0x1a8c0e=_0x453c3a[_0x5d7619(0x13b)](_0x3c99ef=>_0x33fac0[_0x5d7619(0x150)](_0x3c99ef[_0x5d7619(0x17e)])),_0x1316e3=_0x4b3020[_0x5d7619(0x13b)](_0xab816=>_0x33fac0[_0x5d7619(0x150)](_0xab816[_0x5d7619(0x176)])),_0x24d148=_0x2d2bc1['length']+_0x1a8c0e['length']+_0x1316e3[_0x5d7619(0x13e)];console['error'](_0x5d7619(0x17c)+_0x2d2bc1[_0x5d7619(0x13e)]+_0x5d7619(0x173)+(_0x2d2bc1[_0x5d7619(0x13e)]!==0x1?'s':'')+',\x20'+_0x1a8c0e[_0x5d7619(0x13e)]+'\x20segment'+(_0x1a8c0e[_0x5d7619(0x13e)]!==0x1?'s':'')+_0x5d7619(0x158)+_0x1316e3[_0x5d7619(0x13e)]+_0x5d7619(0x144)+(_0x1316e3[_0x5d7619(0x13e)]!==0x1?'s':'')+_0x5d7619(0x13d)+_0x64bad6+'\x27');const _0x3912f4=_0x22cea4=>{const _0x4165a2=_0x5d7619;return getConsoleNextUrl(_0x4ba472[_0x4165a2(0x17b)],_0x4165a2(0x17d)+_0x491ba2[_0x4165a2(0x14f)]+'/e/'+_0x22cea4);},_0x2ef091=_0x4ba472['format']===_0x5d7619(0x148)||_0x4ba472[_0x5d7619(0x154)]===_0x5d7619(0x13c);if(_0x2ef091){const _0x21f3c7=[..._0x2d2bc1[_0x5d7619(0x177)](_0x1de248=>({..._0x1de248,'type':_0x5d7619(0x15f)})),..._0x1a8c0e['map'](_0x51f690=>({..._0x51f690,'type':'segment','url':_0x3912f4(_0x51f690['id'])})),..._0x1316e3[_0x5d7619(0x177)](_0x170650=>({..._0x170650,'name':_0x170650[_0x5d7619(0x176)],'type':_0x5d7619(0x156)}))][_0x5d7619(0x15c)]((_0x4d784a,_0x1b0d6d)=>_0x4d784a[_0x5d7619(0x17e)][_0x5d7619(0x149)](_0x1b0d6d[_0x5d7619(0x17e)]));await handleSDKOutput(_0x21f3c7,_0x4ba472);}else{if(_0x24d148===0x0)console[_0x5d7619(0x16e)](_0x5d7619(0x15b)+_0x64bad6);else{console[_0x5d7619(0x16e)](a45_0x21d6da[_0x5d7619(0x147)]('['+_0x17fe12+']\x20matching\x20\x27'+_0x64bad6+'\x27'));const _0x136783=formatFlatList(_0x2d2bc1,_0x1a8c0e,{'showMetadata':!![],'getSegmentUrl':_0x3912f4},_0x1316e3);console[_0x5d7619(0x16e)](_0x136783);}}return 0x0;}async[a45_0x164e50(0x162)](_0x176902,_0x216d97){const _0x301b77=a45_0x164e50,{options:_0x2f7934,tdx:_0x9739cf}=_0x176902,_0x350d67=await withSpinner(_0x301b77(0x17f)+_0x216d97+_0x301b77(0x165),()=>_0x9739cf[_0x301b77(0x183)]['resolvePathToResource'](_0x216d97),{'verbose':_0x2f7934[_0x301b77(0x163)]}),_0x14940f=_0x350d67['data'];_0x2f7934[_0x301b77(0x163)]&&(console[_0x301b77(0x142)]('Parent\x20ID:\x20'+_0x14940f[_0x301b77(0x14f)]),_0x14940f[_0x301b77(0x145)]&&console['error']('Folder\x20ID:\x20'+_0x14940f[_0x301b77(0x145)]));const _0x51f667=await withSpinner(_0x301b77(0x141),()=>_0x9739cf['segment'][_0x301b77(0x169)](_0x14940f[_0x301b77(0x14f)],_0x14940f[_0x301b77(0x145)]),{'verbose':_0x2f7934['verbose']}),{folders:_0x959ee,segments:_0x1f4add,journeys:_0x348ace}=_0x51f667[_0x301b77(0x159)],_0x497b3e=_0x959ee[_0x301b77(0x13e)]+_0x1f4add[_0x301b77(0x13e)]+_0x348ace[_0x301b77(0x13e)];console[_0x301b77(0x142)](_0x301b77(0x17c)+_0x959ee[_0x301b77(0x13e)]+'\x20folder'+(_0x959ee['length']!==0x1?'s':'')+',\x20'+_0x1f4add['length']+_0x301b77(0x139)+(_0x1f4add[_0x301b77(0x13e)]!==0x1?'s':'')+_0x301b77(0x158)+_0x348ace['length']+_0x301b77(0x144)+(_0x348ace[_0x301b77(0x13e)]!==0x1?'s':''));const _0x4d027c=_0x2f6491=>{const _0x12baab=_0x301b77;return getConsoleNextUrl(_0x2f7934[_0x12baab(0x17b)],'/app/ps/'+_0x14940f['parentId']+_0x12baab(0x146)+_0x2f6491);},_0x1a2624=_0x78b7c9=>{const _0x41b622=_0x301b77;return getConsoleNextUrl(_0x2f7934[_0x41b622(0x17b)],_0x41b622(0x17d)+_0x14940f[_0x41b622(0x14f)]+_0x41b622(0x146)+_0x78b7c9+_0x41b622(0x13f));},_0x23c1e4=_0x2f7934[_0x301b77(0x154)]==='json'||_0x2f7934[_0x301b77(0x154)]===_0x301b77(0x13c);if(_0x23c1e4){const _0x9f4e36=[..._0x959ee['map'](_0x43afe6=>({..._0x43afe6,'type':'folder'})),..._0x1f4add['map'](_0x7d39b6=>({..._0x7d39b6,'type':_0x301b77(0x183),'url':_0x4d027c(_0x7d39b6['id'])})),..._0x348ace[_0x301b77(0x177)](_0x457632=>({..._0x457632,'name':_0x457632[_0x301b77(0x176)],'type':_0x301b77(0x156),'url':_0x1a2624(_0x457632['id'])}))][_0x301b77(0x15c)]((_0x2c3ec1,_0x4e1ed2)=>_0x2c3ec1[_0x301b77(0x17e)][_0x301b77(0x149)](_0x4e1ed2[_0x301b77(0x17e)]));await handleSDKOutput(_0x9f4e36,_0x2f7934);}else{if(_0x497b3e===0x0)console[_0x301b77(0x16e)](a45_0x21d6da['dim']('['+_0x216d97+']')),console[_0x301b77(0x16e)](_0x301b77(0x14b));else{console[_0x301b77(0x16e)](a45_0x21d6da[_0x301b77(0x147)]('['+_0x216d97+']'));const _0x4f7433=formatFlatList(_0x959ee,_0x1f4add,{'showMetadata':!![],'getSegmentUrl':_0x4d027c,'getJourneyUrl':_0x1a2624},_0x348ace);console[_0x301b77(0x16e)](_0x4f7433);}}return 0x0;}async[a45_0x164e50(0x152)](_0x40bc28,_0x2a94e9){const _0x264d96=a45_0x164e50,{options:_0x48ed23,tdx:_0xf0a91c}=_0x40bc28,_0x215b70=await withSpinner(_0x264d96(0x17f)+_0x2a94e9+'\x27...',()=>_0xf0a91c[_0x264d96(0x183)]['resolvePathToResource'](_0x2a94e9),{'verbose':_0x48ed23[_0x264d96(0x163)]}),_0x287098=_0x215b70[_0x264d96(0x159)];_0x48ed23[_0x264d96(0x163)]&&(console[_0x264d96(0x142)](_0x264d96(0x161)+_0x287098[_0x264d96(0x14f)]),_0x287098['folderId']&&console[_0x264d96(0x142)](_0x264d96(0x157)+_0x287098['folderId']));const _0x2b4fc0=_0x48ed23[_0x264d96(0x14a)]||0xa,_0x2905f4=await withSpinner(_0x264d96(0x14d),()=>_0xf0a91c[_0x264d96(0x183)]['listRecursive'](_0x287098[_0x264d96(0x14f)],_0x287098[_0x264d96(0x145)],0x0,_0x2b4fc0),{'verbose':_0x48ed23[_0x264d96(0x163)]}),_0x5240bd=_0x2905f4[_0x264d96(0x159)],_0x3b453f=_0x114dae=>{const _0x1cb586=_0x264d96;let _0x5a5532=0x0,_0x16a519=0x0,_0x3ddc29=0x0;for(const _0x41f0af of _0x114dae){if(_0x41f0af['type']===_0x1cb586(0x15f))_0x5a5532++;else{if(_0x41f0af['type']===_0x1cb586(0x183))_0x16a519++;else{if(_0x41f0af['type']==='journey')_0x3ddc29++;}}if(_0x41f0af[_0x1cb586(0x182)]){const _0x587dc9=_0x3b453f(_0x41f0af['children']);_0x5a5532+=_0x587dc9[_0x1cb586(0x170)],_0x16a519+=_0x587dc9[_0x1cb586(0x178)],_0x3ddc29+=_0x587dc9[_0x1cb586(0x179)];}}return{'folders':_0x5a5532,'segments':_0x16a519,'journeys':_0x3ddc29};},_0x52a626=_0x3b453f(_0x5240bd);console[_0x264d96(0x142)](_0x264d96(0x16d)+_0x52a626['folders']+_0x264d96(0x173)+(_0x52a626[_0x264d96(0x170)]!==0x1?'s':'')+',\x20'+_0x52a626['segments']+_0x264d96(0x139)+(_0x52a626[_0x264d96(0x178)]!==0x1?'s':'')+_0x264d96(0x158)+_0x52a626['journeys']+_0x264d96(0x144)+(_0x52a626[_0x264d96(0x179)]!==0x1?'s':''));const _0x40b567=_0x187139=>{const _0x129829=_0x264d96;return getConsoleNextUrl(_0x48ed23['site'],_0x129829(0x17d)+_0x287098['parentId']+_0x129829(0x146)+_0x187139);},_0x1150a1=_0x5d3045=>{const _0x82709a=_0x264d96;return getConsoleNextUrl(_0x48ed23['site'],_0x82709a(0x17d)+_0x287098[_0x82709a(0x14f)]+_0x82709a(0x146)+_0x5d3045+_0x82709a(0x13f));};if(_0x48ed23[_0x264d96(0x154)]==='json'||_0x48ed23['format']===_0x264d96(0x13c))await handleSDKOutput(_0x5240bd,_0x48ed23);else{console[_0x264d96(0x16e)](a45_0x21d6da[_0x264d96(0x147)]('['+_0x2a94e9+']'));const _0x15bee7=formatTree(_0x5240bd,{'showMetadata':!![],'getSegmentUrl':_0x40b567,'getJourneyUrl':_0x1150a1});console['log'](_0x15bee7);}return 0x0;}}
1
+ const a45_0x69e3b4=a45_0x4536;(function(_0xd45e49,_0xbd40f0){const _0x3d1788=a45_0x4536,_0x58abe3=_0xd45e49();while(!![]){try{const _0x228767=-parseInt(_0x3d1788(0x177))/0x1*(parseInt(_0x3d1788(0x13f))/0x2)+parseInt(_0x3d1788(0x16b))/0x3*(parseInt(_0x3d1788(0x15c))/0x4)+-parseInt(_0x3d1788(0x140))/0x5*(-parseInt(_0x3d1788(0x13b))/0x6)+-parseInt(_0x3d1788(0x154))/0x7+parseInt(_0x3d1788(0x14c))/0x8*(parseInt(_0x3d1788(0x150))/0x9)+-parseInt(_0x3d1788(0x15a))/0xa+parseInt(_0x3d1788(0x168))/0xb;if(_0x228767===_0xbd40f0)break;else _0x58abe3['push'](_0x58abe3['shift']());}catch(_0x210515){_0x58abe3['push'](_0x58abe3['shift']());}}}(a45_0x17ef,0xe958c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x4536(_0x114f6a,_0x1940b1){_0x114f6a=_0x114f6a-0x131;const _0x17ef57=a45_0x17ef();let _0x4536c8=_0x17ef57[_0x114f6a];return _0x4536c8;}import{withSpinner}from'../utils/spinner.js';function a45_0x17ef(){const _0x4633ba=['format','Parent\x20segment\x20context:\x20','filter','/j/da','recursive','(not\x20set)',',\x20and\x20','38864MDsDGj','(empty)','Folder\x20ID:\x20','type','3528WrbmCM','jsonl','map','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','10985786quPKLP','sort','Recursive\x20mode:\x20enabled','data','name','listRecursive','2763630cPFpIV','Site:\x20','588804pogpKX','\x5c$&','\x20matching\x20\x27','\x20\x20Cause:\x20','listWithPattern','error','folders','segments','resolvePathToResource','Resolving\x20parent\x20segment\x20\x27','length','localeCompare','11815738ePcuVm','parentSegment','verbose','6AzZCCv','\x20journey','/e/','No\x20items\x20match\x20pattern:\x20','\x20segment','segment','Building\x20hierarchy\x20tree...','journeys','Parent\x20ID:\x20','\x27...','journeyBundleName','json','1280289zwnGbC','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x20folder','site','maxDepth','description','folder','replace','Error:\x20','listUnifiedWithJourneys','✔\x20Built\x20tree\x20with\x20','includes','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId','children','/app/ps/','✔\x20Found\x20','dim','Folder/pattern\x20arg:\x20','2426826RigeSw','log','cause','Listing\x20folders,\x20segments,\x20and\x20journeys...','2sjnmbo','10RQtiJR','parentId','journey','listUnified','test'];a45_0x17ef=function(){return _0x4633ba;};return a45_0x17ef();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x1b0a38 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x69e3b4(0x158)]=a45_0x69e3b4(0x163);[a45_0x69e3b4(0x17d)]='List\x20folders\x20and\x20child\x20segments';async['execute'](_0x36083b){const _0x514abc=a45_0x69e3b4,{options:_0x179bfc,args:_0x492206}=_0x36083b,_0x2ec69c=_0x179bfc[_0x514abc(0x149)],_0x25847e=_0x492206[0x0];try{const _0x372741=_0x179bfc[_0x514abc(0x169)];_0x179bfc['verbose']&&(console[_0x514abc(0x161)](_0x514abc(0x15b)+_0x179bfc[_0x514abc(0x17b)]),console['error'](_0x514abc(0x146)+(_0x372741||_0x514abc(0x14a))),_0x25847e&&console[_0x514abc(0x161)](_0x514abc(0x13a)+_0x25847e),_0x2ec69c&&console[_0x514abc(0x161)](_0x514abc(0x156)));if(!_0x372741)return console['error'](_0x514abc(0x179)),console['error'](''),console[_0x514abc(0x161)](_0x514abc(0x134)),console['error'](_0x514abc(0x178)),console[_0x514abc(0x161)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x514abc(0x161)](''),console[_0x514abc(0x161)](_0x514abc(0x153)),0x1;const _0x664863=_0x25847e&&(_0x25847e[_0x514abc(0x133)]('*')||_0x25847e['includes']('?'));if(_0x664863)return await this[_0x514abc(0x160)](_0x36083b,_0x372741,_0x25847e);const _0x21ad1a=_0x25847e?_0x372741+'/'+_0x25847e:_0x372741;return _0x2ec69c?await this[_0x514abc(0x159)](_0x36083b,_0x21ad1a):await this[_0x514abc(0x143)](_0x36083b,_0x21ad1a);}catch(_0xb09eda){if(_0xb09eda instanceof SDKError)return console[_0x514abc(0x161)](_0x514abc(0x180)+_0xb09eda['message']),_0xb09eda[_0x514abc(0x13d)]&&console[_0x514abc(0x161)](_0x514abc(0x15f)+_0xb09eda[_0x514abc(0x13d)]),0x1;throw _0xb09eda;}}async[a45_0x69e3b4(0x160)](_0x4f5096,_0xf4d4af,_0x50e15e){const _0x3d7dd8=a45_0x69e3b4,{options:_0x18c11d,tdx:_0x586120}=_0x4f5096,_0x471a03=await withSpinner(_0x3d7dd8(0x165)+_0xf4d4af+_0x3d7dd8(0x174),()=>_0x586120['segment'][_0x3d7dd8(0x164)](_0xf4d4af),{'verbose':_0x18c11d[_0x3d7dd8(0x16a)]}),_0x220025=_0x471a03['data'],_0x3ce4a9=await withSpinner(_0x3d7dd8(0x13e),()=>_0x586120[_0x3d7dd8(0x170)][_0x3d7dd8(0x131)](_0x220025['parentId'],_0x220025[_0x3d7dd8(0x135)]),{'verbose':_0x18c11d[_0x3d7dd8(0x16a)]}),{folders:_0x20bea4,segments:_0x1822a3,journeys:_0x4c396f}=_0x3ce4a9[_0x3d7dd8(0x157)],_0x8bd07d=_0x50e15e['replace'](/[.+^${}()|[\]\\]/g,_0x3d7dd8(0x15d))[_0x3d7dd8(0x17f)](/\*/g,'.*')[_0x3d7dd8(0x17f)](/\?/g,'.'),_0x37e266=new RegExp('^'+_0x8bd07d+'$','i'),_0xfe48c0=_0x20bea4[_0x3d7dd8(0x147)](_0x56eb2c=>_0x37e266[_0x3d7dd8(0x144)](_0x56eb2c[_0x3d7dd8(0x158)])),_0x2b4e13=_0x1822a3[_0x3d7dd8(0x147)](_0xf4d5be=>_0x37e266[_0x3d7dd8(0x144)](_0xf4d5be[_0x3d7dd8(0x158)])),_0x3f909c=_0x4c396f['filter'](_0x306d96=>_0x37e266['test'](_0x306d96[_0x3d7dd8(0x175)])),_0x65d920=_0xfe48c0[_0x3d7dd8(0x166)]+_0x2b4e13[_0x3d7dd8(0x166)]+_0x3f909c[_0x3d7dd8(0x166)];console[_0x3d7dd8(0x161)](_0x3d7dd8(0x138)+_0xfe48c0['length']+'\x20folder'+(_0xfe48c0[_0x3d7dd8(0x166)]!==0x1?'s':'')+',\x20'+_0x2b4e13[_0x3d7dd8(0x166)]+_0x3d7dd8(0x16f)+(_0x2b4e13['length']!==0x1?'s':'')+_0x3d7dd8(0x14b)+_0x3f909c['length']+'\x20journey'+(_0x3f909c[_0x3d7dd8(0x166)]!==0x1?'s':'')+_0x3d7dd8(0x15e)+_0x50e15e+'\x27');const _0x55d599=_0x3b379e=>{const _0x19f723=_0x3d7dd8;return getConsoleNextUrl(_0x18c11d[_0x19f723(0x17b)],_0x19f723(0x137)+_0x220025[_0x19f723(0x141)]+_0x19f723(0x16d)+_0x3b379e);},_0x2495a0=_0x18c11d[_0x3d7dd8(0x145)]===_0x3d7dd8(0x176)||_0x18c11d[_0x3d7dd8(0x145)]===_0x3d7dd8(0x151);if(_0x2495a0){const _0x8dd17e=[..._0xfe48c0['map'](_0x536ade=>({..._0x536ade,'type':_0x3d7dd8(0x17e)})),..._0x2b4e13['map'](_0x4dc4e7=>({..._0x4dc4e7,'type':'segment','url':_0x55d599(_0x4dc4e7['id'])})),..._0x3f909c[_0x3d7dd8(0x152)](_0x5c3560=>({..._0x5c3560,'name':_0x5c3560['journeyBundleName'],'type':_0x3d7dd8(0x142)}))][_0x3d7dd8(0x155)]((_0x5908e5,_0x1cdffe)=>_0x5908e5[_0x3d7dd8(0x158)]['localeCompare'](_0x1cdffe[_0x3d7dd8(0x158)]));await handleSDKOutput(_0x8dd17e,_0x18c11d);}else{if(_0x65d920===0x0)console[_0x3d7dd8(0x13c)](_0x3d7dd8(0x16e)+_0x50e15e);else{console['log'](a45_0x1b0a38[_0x3d7dd8(0x139)]('['+_0xf4d4af+']\x20matching\x20\x27'+_0x50e15e+'\x27'));const _0x1532ea=formatFlatList(_0xfe48c0,_0x2b4e13,{'showMetadata':!![],'getSegmentUrl':_0x55d599},_0x3f909c);console[_0x3d7dd8(0x13c)](_0x1532ea);}}return 0x0;}async[a45_0x69e3b4(0x143)](_0x2b275a,_0x3d06d8){const _0x4df490=a45_0x69e3b4,{options:_0x32c1f4,tdx:_0x27166f}=_0x2b275a,_0x158f2a=await withSpinner('Resolving\x20path\x20\x27'+_0x3d06d8+_0x4df490(0x174),()=>_0x27166f[_0x4df490(0x170)][_0x4df490(0x164)](_0x3d06d8),{'verbose':_0x32c1f4['verbose']}),_0x280744=_0x158f2a[_0x4df490(0x157)];_0x32c1f4[_0x4df490(0x16a)]&&(console[_0x4df490(0x161)]('Parent\x20ID:\x20'+_0x280744[_0x4df490(0x141)]),_0x280744['folderId']&&console[_0x4df490(0x161)]('Folder\x20ID:\x20'+_0x280744[_0x4df490(0x135)]));const _0x481660=await withSpinner(_0x4df490(0x13e),()=>_0x27166f[_0x4df490(0x170)][_0x4df490(0x131)](_0x280744['parentId'],_0x280744['folderId']),{'verbose':_0x32c1f4[_0x4df490(0x16a)]}),{folders:_0x4b0f77,segments:_0x4b8181,journeys:_0x2f91d0}=_0x481660[_0x4df490(0x157)],_0x2b0724=_0x4b0f77[_0x4df490(0x166)]+_0x4b8181[_0x4df490(0x166)]+_0x2f91d0['length'];console[_0x4df490(0x161)]('✔\x20Found\x20'+_0x4b0f77[_0x4df490(0x166)]+_0x4df490(0x17a)+(_0x4b0f77['length']!==0x1?'s':'')+',\x20'+_0x4b8181[_0x4df490(0x166)]+'\x20segment'+(_0x4b8181[_0x4df490(0x166)]!==0x1?'s':'')+',\x20and\x20'+_0x2f91d0[_0x4df490(0x166)]+_0x4df490(0x16c)+(_0x2f91d0[_0x4df490(0x166)]!==0x1?'s':''));const _0xc60b0=_0x5ec23b=>{const _0x24469c=_0x4df490;return getConsoleNextUrl(_0x32c1f4['site'],'/app/ps/'+_0x280744[_0x24469c(0x141)]+_0x24469c(0x16d)+_0x5ec23b);},_0x44d945=_0x155bad=>{const _0xd04951=_0x4df490;return getConsoleNextUrl(_0x32c1f4[_0xd04951(0x17b)],_0xd04951(0x137)+_0x280744[_0xd04951(0x141)]+_0xd04951(0x16d)+_0x155bad+_0xd04951(0x148));},_0x2dacff=_0x32c1f4[_0x4df490(0x145)]===_0x4df490(0x176)||_0x32c1f4['format']===_0x4df490(0x151);if(_0x2dacff){const _0x24e774=[..._0x4b0f77[_0x4df490(0x152)](_0x1f39ba=>({..._0x1f39ba,'type':_0x4df490(0x17e)})),..._0x4b8181[_0x4df490(0x152)](_0x5cd3f1=>({..._0x5cd3f1,'type':_0x4df490(0x170),'url':_0xc60b0(_0x5cd3f1['id'])})),..._0x2f91d0[_0x4df490(0x152)](_0x5d90c9=>({..._0x5d90c9,'name':_0x5d90c9[_0x4df490(0x175)],'type':'journey','url':_0x44d945(_0x5d90c9['id'])}))]['sort']((_0x234ef5,_0x20984c)=>_0x234ef5['name'][_0x4df490(0x167)](_0x20984c[_0x4df490(0x158)]));await handleSDKOutput(_0x24e774,_0x32c1f4);}else{if(_0x2b0724===0x0)console[_0x4df490(0x13c)](a45_0x1b0a38['dim']('['+_0x3d06d8+']')),console[_0x4df490(0x13c)](_0x4df490(0x14d));else{console[_0x4df490(0x13c)](a45_0x1b0a38[_0x4df490(0x139)]('['+_0x3d06d8+']'));const _0x5abded=formatFlatList(_0x4b0f77,_0x4b8181,{'showMetadata':!![],'getSegmentUrl':_0xc60b0,'getJourneyUrl':_0x44d945},_0x2f91d0);console[_0x4df490(0x13c)](_0x5abded);}}return 0x0;}async['listRecursive'](_0x57ed52,_0x15f7c9){const _0x31a1f1=a45_0x69e3b4,{options:_0x11ab1d,tdx:_0x2b3055}=_0x57ed52,_0x5a4739=await withSpinner('Resolving\x20path\x20\x27'+_0x15f7c9+_0x31a1f1(0x174),()=>_0x2b3055[_0x31a1f1(0x170)][_0x31a1f1(0x164)](_0x15f7c9),{'verbose':_0x11ab1d['verbose']}),_0x4d13ae=_0x5a4739[_0x31a1f1(0x157)];_0x11ab1d[_0x31a1f1(0x16a)]&&(console[_0x31a1f1(0x161)](_0x31a1f1(0x173)+_0x4d13ae['parentId']),_0x4d13ae[_0x31a1f1(0x135)]&&console[_0x31a1f1(0x161)](_0x31a1f1(0x14e)+_0x4d13ae[_0x31a1f1(0x135)]));const _0xbc545d=_0x11ab1d[_0x31a1f1(0x17c)]||0xa,_0x431b2f=await withSpinner(_0x31a1f1(0x171),()=>_0x2b3055[_0x31a1f1(0x170)][_0x31a1f1(0x159)](_0x4d13ae['parentId'],_0x4d13ae[_0x31a1f1(0x135)],0x0,_0xbc545d),{'verbose':_0x11ab1d['verbose']}),_0x7e21c6=_0x431b2f[_0x31a1f1(0x157)],_0x5aa7fd=_0x5e7172=>{const _0x46921c=_0x31a1f1;let _0x4c2883=0x0,_0x37a145=0x0,_0x33dae7=0x0;for(const _0xafa425 of _0x5e7172){if(_0xafa425[_0x46921c(0x14f)]===_0x46921c(0x17e))_0x4c2883++;else{if(_0xafa425['type']===_0x46921c(0x170))_0x37a145++;else{if(_0xafa425[_0x46921c(0x14f)]===_0x46921c(0x142))_0x33dae7++;}}if(_0xafa425[_0x46921c(0x136)]){const _0x16dff7=_0x5aa7fd(_0xafa425['children']);_0x4c2883+=_0x16dff7[_0x46921c(0x162)],_0x37a145+=_0x16dff7[_0x46921c(0x163)],_0x33dae7+=_0x16dff7[_0x46921c(0x172)];}}return{'folders':_0x4c2883,'segments':_0x37a145,'journeys':_0x33dae7};},_0x499d59=_0x5aa7fd(_0x7e21c6);console[_0x31a1f1(0x161)](_0x31a1f1(0x132)+_0x499d59[_0x31a1f1(0x162)]+'\x20folder'+(_0x499d59[_0x31a1f1(0x162)]!==0x1?'s':'')+',\x20'+_0x499d59['segments']+_0x31a1f1(0x16f)+(_0x499d59[_0x31a1f1(0x163)]!==0x1?'s':'')+_0x31a1f1(0x14b)+_0x499d59[_0x31a1f1(0x172)]+_0x31a1f1(0x16c)+(_0x499d59[_0x31a1f1(0x172)]!==0x1?'s':''));const _0x12c3f0=_0x31dc6a=>{const _0xbd79b8=_0x31a1f1;return getConsoleNextUrl(_0x11ab1d['site'],_0xbd79b8(0x137)+_0x4d13ae[_0xbd79b8(0x141)]+_0xbd79b8(0x16d)+_0x31dc6a);},_0x1d5baa=_0x157eab=>{const _0x5b1161=_0x31a1f1;return getConsoleNextUrl(_0x11ab1d[_0x5b1161(0x17b)],_0x5b1161(0x137)+_0x4d13ae[_0x5b1161(0x141)]+'/e/'+_0x157eab+_0x5b1161(0x148));};if(_0x11ab1d[_0x31a1f1(0x145)]===_0x31a1f1(0x176)||_0x11ab1d[_0x31a1f1(0x145)]==='jsonl')await handleSDKOutput(_0x7e21c6,_0x11ab1d);else{console['log'](a45_0x1b0a38['dim']('['+_0x15f7c9+']'));const _0x191219=formatTree(_0x7e21c6,{'showMetadata':!![],'getSegmentUrl':_0x12c3f0,'getJourneyUrl':_0x1d5baa});console[_0x31a1f1(0x13c)](_0x191219);}return 0x0;}}
@@ -1 +1 @@
1
- function a46_0x503e(_0x3cf2d5,_0x1cbc37){_0x3cf2d5=_0x3cf2d5-0x1ee;const _0x2cfcc4=a46_0x2cfc();let _0x503eb9=_0x2cfcc4[_0x3cf2d5];return _0x503eb9;}const a46_0x346b47=a46_0x503e;(function(_0x2b64db,_0x170090){const _0x174178=a46_0x503e,_0x2af47b=_0x2b64db();while(!![]){try{const _0x1754f6=parseInt(_0x174178(0x20a))/0x1*(parseInt(_0x174178(0x214))/0x2)+parseInt(_0x174178(0x213))/0x3*(-parseInt(_0x174178(0x21c))/0x4)+parseInt(_0x174178(0x206))/0x5+-parseInt(_0x174178(0x207))/0x6+-parseInt(_0x174178(0x212))/0x7*(-parseInt(_0x174178(0x205))/0x8)+-parseInt(_0x174178(0x219))/0x9*(parseInt(_0x174178(0x215))/0xa)+parseInt(_0x174178(0x1fd))/0xb;if(_0x1754f6===_0x170090)break;else _0x2af47b['push'](_0x2af47b['shift']());}catch(_0xbafc04){_0x2af47b['push'](_0x2af47b['shift']());}}}(a46_0x2cfc,0xe5535));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a46_0x2cfc(){const _0x464128=['...','showTable','Usage:\x20tdx\x20show\x20<database.table>','Database:\x20','Table:\x20','site','execute','validate','613987ANnopt','Catalog:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','\x20\x20Cause:\x20','description','Querying\x20','database','102672dAvpql','4553500jJzhHC','3169146dUCiJw','error','Show\x20table\x20contents','68654kvwgAh','\x20row','name','table','✔\x20Retrieved\x20','Site:\x20','show','message','371pQjqYE','4426113xWFaqt','46rwhlNm','471470weSrhy','catalog','limit','Limit:\x20','54RFKqla','Error:\x20','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','4jZvbRx','data','length','args','\x20from\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','query','cause'];a46_0x2cfc=function(){return _0x464128;};return a46_0x2cfc();}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_0x346b47(0x20c)]=a46_0x346b47(0x210);[a46_0x346b47(0x202)]=a46_0x346b47(0x209);async[a46_0x346b47(0x1fb)](_0x4146d9){const _0x90e03e=a46_0x346b47;return this[_0x90e03e(0x1f6)](_0x4146d9);}async[a46_0x346b47(0x1f6)](_0x115bcf){const _0x32bf18=a46_0x346b47,{options:_0x42fd3c,args:_0x108bfa,tdx:_0x1cd733}=_0x115bcf;let _0x49969b;try{_0x49969b=parseTableReference(_0x108bfa[0x0]);const _0x3f8f26=_0x42fd3c[_0x32bf18(0x204)];!_0x49969b[_0x32bf18(0x204)]&&_0x3f8f26&&(_0x49969b[_0x32bf18(0x204)]=_0x3f8f26);const _0x3d90fa=validateTableDescribeReference(_0x49969b);if(_0x3d90fa)return console[_0x32bf18(0x208)](_0x32bf18(0x21a)+_0x3d90fa),console[_0x32bf18(0x208)](_0x32bf18(0x1f7)),console[_0x32bf18(0x208)](_0x32bf18(0x1ff)),console[_0x32bf18(0x208)](_0x32bf18(0x1f2)),0x1;}catch(_0x2e18b6){return console['error'](_0x32bf18(0x21a)+_0x2e18b6['message']),console[_0x32bf18(0x208)](_0x32bf18(0x1f7)),console[_0x32bf18(0x208)](_0x32bf18(0x1ff)),console[_0x32bf18(0x208)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x543b16=_0x49969b[_0x32bf18(0x216)],_0x14ca7b=_0x49969b[_0x32bf18(0x204)],_0x3ec5d5=_0x49969b[_0x32bf18(0x20d)],_0x578f10=resolveLimit(_0x42fd3c[_0x32bf18(0x217)],DEFAULT_DISPLAY_LIMIT);try{_0x42fd3c[_0x32bf18(0x200)]&&(console[_0x32bf18(0x208)](_0x32bf18(0x20f)+_0x42fd3c[_0x32bf18(0x1fa)]),_0x543b16&&console[_0x32bf18(0x208)](_0x32bf18(0x1fe)+_0x543b16),console[_0x32bf18(0x208)](_0x32bf18(0x1f8)+_0x14ca7b),console[_0x32bf18(0x208)](_0x32bf18(0x1f9)+_0x3ec5d5),console[_0x32bf18(0x208)](_0x32bf18(0x218)+_0x578f10));const _0x7e4e71=_0x543b16?_0x543b16+'.'+_0x14ca7b+'.'+_0x3ec5d5:_0x14ca7b+'.'+_0x3ec5d5,_0x1cdb1b=await withSpinner(_0x32bf18(0x203)+_0x7e4e71+_0x32bf18(0x1f5),()=>_0x1cd733[_0x32bf18(0x1f3)][_0x32bf18(0x1f6)](_0x14ca7b,_0x3ec5d5,_0x578f10,_0x543b16),{'verbose':_0x42fd3c['verbose']}),_0x1d4103=_0x1cdb1b['data'],_0x149c50=_0x1d4103[_0x32bf18(0x1ee)];return _0x149c50['length']===0x0?console[_0x32bf18(0x208)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x32bf18(0x208)](_0x32bf18(0x20e)+_0x149c50['length']+_0x32bf18(0x20b)+(_0x149c50[_0x32bf18(0x1ef)]!==0x1?'s':'')+_0x32bf18(0x1f1)+_0x7e4e71),await handleSDKOutput(_0x149c50,_0x42fd3c),0x0;}catch(_0x3efd71){if(_0x3efd71 instanceof SDKError)return console[_0x32bf18(0x208)](_0x32bf18(0x21a)+_0x3efd71[_0x32bf18(0x211)]),_0x3efd71[_0x32bf18(0x1f4)]&&console['error'](_0x32bf18(0x201)+_0x3efd71['cause']),0x1;throw _0x3efd71;}}[a46_0x346b47(0x1fc)](_0x286fd7){const _0x511389=a46_0x346b47;if(_0x286fd7[_0x511389(0x1f0)]['length']===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(_0x286fd7[_0x511389(0x1f0)][_0x511389(0x1ef)]>0x1)return _0x511389(0x21b);return undefined;}}
1
+ const a46_0x5b101a=a46_0x4e9d;(function(_0x337eb1,_0x22f3f8){const _0xe02b2=a46_0x4e9d,_0x46e1e1=_0x337eb1();while(!![]){try{const _0x8d9804=-parseInt(_0xe02b2(0x128))/0x1*(-parseInt(_0xe02b2(0x11a))/0x2)+-parseInt(_0xe02b2(0x11d))/0x3+-parseInt(_0xe02b2(0x10b))/0x4*(-parseInt(_0xe02b2(0x108))/0x5)+-parseInt(_0xe02b2(0x123))/0x6+-parseInt(_0xe02b2(0x10e))/0x7+-parseInt(_0xe02b2(0x117))/0x8+-parseInt(_0xe02b2(0x10f))/0x9*(-parseInt(_0xe02b2(0x104))/0xa);if(_0x8d9804===_0x22f3f8)break;else _0x46e1e1['push'](_0x46e1e1['shift']());}catch(_0x25a230){_0x46e1e1['push'](_0x46e1e1['shift']());}}}(a46_0x57d2,0x7c9b0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a46_0x4e9d(_0x4d7aa4,_0x422ca0){_0x4d7aa4=_0x4d7aa4-0x101;const _0x57d25b=a46_0x57d2();let _0x4e9d37=_0x57d25b[_0x4d7aa4];return _0x4e9d37;}function a46_0x57d2(){const _0x4bc51c=['\x20row','limit','4868040xIzzKD','validate','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','cause','verbose','9EJRwAc','Database:\x20','query','catalog','344780PXlMNq','database','showTable','Site:\x20','125155zUwCLp','site','Error:\x20','28YdoUKL','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','Catalog:\x20','4268936dAcxLz','405GOsnMl','length','message','args','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','\x20from\x20','error','1249488oqeRuT','...','execute','226816DOtECa','data','show','1978923wINcrr','Show\x20table\x20contents','table','Querying\x20'];a46_0x57d2=function(){return _0x4bc51c;};return a46_0x57d2();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x5b101a(0x11c);['description']=a46_0x5b101a(0x11e);async[a46_0x5b101a(0x119)](_0x4e2680){const _0x3d58f2=a46_0x5b101a;return this[_0x3d58f2(0x106)](_0x4e2680);}async[a46_0x5b101a(0x106)](_0x59699e){const _0xaa50c6=a46_0x5b101a,{options:_0x36be49,args:_0x353ab4,tdx:_0x35c710}=_0x59699e;let _0xb09064;try{_0xb09064=parseTableReference(_0x353ab4[0x0]);const _0x55c680=_0x36be49[_0xaa50c6(0x105)];!_0xb09064[_0xaa50c6(0x105)]&&_0x55c680&&(_0xb09064[_0xaa50c6(0x105)]=_0x55c680);const _0x3b3e8f=validateTableDescribeReference(_0xb09064);if(_0x3b3e8f)return console[_0xaa50c6(0x116)](_0xaa50c6(0x10a)+_0x3b3e8f),console[_0xaa50c6(0x116)](_0xaa50c6(0x113)),console[_0xaa50c6(0x116)](_0xaa50c6(0x125)),console[_0xaa50c6(0x116)](_0xaa50c6(0x114)),0x1;}catch(_0x68d403){return console['error']('Error:\x20'+_0x68d403[_0xaa50c6(0x111)]),console[_0xaa50c6(0x116)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xaa50c6(0x116)](_0xaa50c6(0x125)),console[_0xaa50c6(0x116)](_0xaa50c6(0x114)),0x1;}const _0x49e3a1=_0xb09064[_0xaa50c6(0x103)],_0x2af513=_0xb09064['database'],_0x131f63=_0xb09064[_0xaa50c6(0x11f)],_0x2dd036=resolveLimit(_0x36be49[_0xaa50c6(0x122)],DEFAULT_DISPLAY_LIMIT);try{_0x36be49[_0xaa50c6(0x127)]&&(console[_0xaa50c6(0x116)](_0xaa50c6(0x107)+_0x36be49[_0xaa50c6(0x109)]),_0x49e3a1&&console[_0xaa50c6(0x116)](_0xaa50c6(0x10d)+_0x49e3a1),console[_0xaa50c6(0x116)](_0xaa50c6(0x101)+_0x2af513),console['error']('Table:\x20'+_0x131f63),console[_0xaa50c6(0x116)]('Limit:\x20'+_0x2dd036));const _0x4cbb26=_0x49e3a1?_0x49e3a1+'.'+_0x2af513+'.'+_0x131f63:_0x2af513+'.'+_0x131f63,_0x3fe3ee=await withSpinner(_0xaa50c6(0x120)+_0x4cbb26+_0xaa50c6(0x118),()=>_0x35c710[_0xaa50c6(0x102)][_0xaa50c6(0x106)](_0x2af513,_0x131f63,_0x2dd036,_0x49e3a1),{'verbose':_0x36be49[_0xaa50c6(0x127)]}),_0x38b9a6=_0x3fe3ee[_0xaa50c6(0x11b)],_0x439b8a=_0x38b9a6[_0xaa50c6(0x11b)];return _0x439b8a[_0xaa50c6(0x110)]===0x0?console[_0xaa50c6(0x116)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0xaa50c6(0x116)]('✔\x20Retrieved\x20'+_0x439b8a['length']+_0xaa50c6(0x121)+(_0x439b8a[_0xaa50c6(0x110)]!==0x1?'s':'')+_0xaa50c6(0x115)+_0x4cbb26),await handleSDKOutput(_0x439b8a,_0x36be49),0x0;}catch(_0x5a4673){if(_0x5a4673 instanceof SDKError)return console[_0xaa50c6(0x116)]('Error:\x20'+_0x5a4673[_0xaa50c6(0x111)]),_0x5a4673[_0xaa50c6(0x126)]&&console[_0xaa50c6(0x116)]('\x20\x20Cause:\x20'+_0x5a4673[_0xaa50c6(0x126)]),0x1;throw _0x5a4673;}}[a46_0x5b101a(0x124)](_0x3d0dbf){const _0x122863=a46_0x5b101a;if(_0x3d0dbf[_0x122863(0x112)][_0x122863(0x110)]===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(_0x3d0dbf[_0x122863(0x112)]['length']>0x1)return _0x122863(0x10c);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x5ca1de=a47_0x5602;(function(_0x3ebd9e,_0x499150){const _0xca26f4=a47_0x5602,_0x1e4654=_0x3ebd9e();while(!![]){try{const _0x37e2bc=parseInt(_0xca26f4(0xa8))/0x1*(-parseInt(_0xca26f4(0xb4))/0x2)+parseInt(_0xca26f4(0xd0))/0x3*(-parseInt(_0xca26f4(0xab))/0x4)+-parseInt(_0xca26f4(0xd2))/0x5+-parseInt(_0xca26f4(0xb7))/0x6+parseInt(_0xca26f4(0xaa))/0x7+-parseInt(_0xca26f4(0xb8))/0x8*(-parseInt(_0xca26f4(0xbc))/0x9)+-parseInt(_0xca26f4(0xd1))/0xa*(-parseInt(_0xca26f4(0xc7))/0xb);if(_0x37e2bc===_0x499150)break;else _0x1e4654['push'](_0x1e4654['shift']());}catch(_0x140cf8){_0x1e4654['push'](_0x1e4654['shift']());}}}(a47_0x34c2,0x4cac3));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x34c2(){const _0x5d9832=['tdx','join','285734wNlyKZ','profile','Account\x20ID:','2160204xXNDkq','200AMJJYQ','green','jobs','bold','87975vwASvs','getUserInfo','User:','status','config','\x20profile:\x20','session','✗\x20Validation\x20failed:\x20','description','displayWithSources','dim','16423QuLPIn','log','account_id','Read\x20credential\x20from\x20','first_name','site:\x20','error','Show\x20authentication\x20status\x20and\x20current\x20context','N/A','45801pMJyPj','3120rakgIq','306050nBNGQb','env','name','last_name','CLI\x20flag','filter','yellow','1BRXfQV','cyan','1496404jvwsxq','12fbRpyq','Name:','No\x20credential\x20found','OAuth','profileSource','site','message'];a47_0x34c2=function(){return _0x5d9832;};return a47_0x34c2();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x1dcfb2 from'chalk';function a47_0x5602(_0x53667e,_0x216d81){_0x53667e=_0x53667e-0xa6;const _0x34c254=a47_0x34c2();let _0x560226=_0x34c254[_0x53667e];return _0x560226;}export class StatusCommand extends BaseCommand{[a47_0x5ca1de(0xd4)]=a47_0x5ca1de(0xbf);[a47_0x5ca1de(0xc4)]=a47_0x5ca1de(0xce);async['execute'](_0x599c11){const _0x1ff931=a47_0x5ca1de,{options:_0x133049,tdx:_0x4e0451}=_0x599c11,_0x4b6526=_0x133049[_0x1ff931(0xb0)],_0x7d031c=new GlobalContext(_0x133049),_0x389d4b=_0x7d031c[_0x1ff931(0xb5)],_0x148084=_0x7d031c[_0x1ff931(0xaf)],_0x56152f=_0x148084==='cli'?_0x1ff931(0xd6):_0x148084===_0x1ff931(0xc2)?'session':_0x148084===_0x1ff931(0xd3)?'TDX_PROFILE\x20env':_0x148084===_0x1ff931(0xc0)?'config':null,_0x35e621=_0x389d4b?a47_0x1dcfb2[_0x1ff931(0xa9)](_0x389d4b):a47_0x1dcfb2[_0x1ff931(0xc6)](_0x1ff931(0xcf)),_0x384933=_0x56152f?'\x20'+a47_0x1dcfb2['dim']('(from\x20'+_0x56152f+')'):'';console[_0x1ff931(0xc8)](a47_0x1dcfb2[_0x1ff931(0xbb)](_0x1ff931(0xb2))+_0x1ff931(0xc1)+_0x35e621+_0x384933+'\x20'+a47_0x1dcfb2[_0x1ff931(0xc6)]('(')+_0x1ff931(0xcc)+a47_0x1dcfb2[_0x1ff931(0xa9)](_0x4b6526)+a47_0x1dcfb2[_0x1ff931(0xc6)](')'));const _0x313a69=await getOAuthTokens(_0x389d4b);if(_0x313a69)console[_0x1ff931(0xc8)]('Credential\x20type:\x20'+a47_0x1dcfb2[_0x1ff931(0xa9)](_0x1ff931(0xae)));else{const _0x13b161=await resolveAPIKeyAsync(_0x4b6526,_0x389d4b);if(_0x13b161){const {source:_0x31fdf1,isDeprecated:_0x451ecb}=_0x13b161,_0x32a044=_0x1ff931(0xca)+a47_0x1dcfb2['cyan'](_0x31fdf1);console[_0x1ff931(0xc8)](_0x451ecb?a47_0x1dcfb2[_0x1ff931(0xa7)](_0x32a044):_0x32a044);}else console['log'](a47_0x1dcfb2[_0x1ff931(0xa7)](_0x1ff931(0xad)));}let _0x467c5f=![];try{const _0x42c19c=await _0x4e0451[_0x1ff931(0xba)][_0x1ff931(0xbd)]();console[_0x1ff931(0xc8)](a47_0x1dcfb2[_0x1ff931(0xb9)]('✓\x20Authentication\x20successful\x0a')),console['log'](a47_0x1dcfb2[_0x1ff931(0xbb)](_0x1ff931(0xbe))+'\x20'+a47_0x1dcfb2[_0x1ff931(0xa9)](_0x42c19c['email']));if(_0x42c19c['first_name']||_0x42c19c[_0x1ff931(0xd5)]){const _0x3f8f1c=[_0x42c19c[_0x1ff931(0xcb)],_0x42c19c[_0x1ff931(0xd5)]][_0x1ff931(0xa6)](Boolean)[_0x1ff931(0xb3)]('\x20');console[_0x1ff931(0xc8)](a47_0x1dcfb2['bold'](_0x1ff931(0xac))+'\x20'+_0x3f8f1c);}_0x42c19c[_0x1ff931(0xc9)]&&console[_0x1ff931(0xc8)](a47_0x1dcfb2[_0x1ff931(0xbb)](_0x1ff931(0xb6))+'\x20'+a47_0x1dcfb2[_0x1ff931(0xa7)](_0x42c19c[_0x1ff931(0xc9)])),_0x467c5f=!![];}catch(_0x4ee2aa){_0x4ee2aa instanceof HTTPClientError&&_0x4ee2aa[_0x1ff931(0xbf)]===0x191?printAuthError(_0x4ee2aa,!![],_0x389d4b):console[_0x1ff931(0xcd)](a47_0x1dcfb2['red'](_0x1ff931(0xc3)+(_0x4ee2aa instanceof Error?_0x4ee2aa[_0x1ff931(0xb1)]:String(_0x4ee2aa))));}return console['log'](),_0x7d031c[_0x1ff931(0xc5)](),_0x467c5f?0x0:0x1;}}
1
+ const a47_0x163640=a47_0x2006;(function(_0x296be2,_0x155b42){const _0x50c3df=a47_0x2006,_0x33611c=_0x296be2();while(!![]){try{const _0x431d0b=-parseInt(_0x50c3df(0x1b3))/0x1*(-parseInt(_0x50c3df(0x1b8))/0x2)+parseInt(_0x50c3df(0x1be))/0x3*(-parseInt(_0x50c3df(0x1b7))/0x4)+-parseInt(_0x50c3df(0x1ca))/0x5*(-parseInt(_0x50c3df(0x1c2))/0x6)+parseInt(_0x50c3df(0x1c9))/0x7+-parseInt(_0x50c3df(0x1c6))/0x8+parseInt(_0x50c3df(0x1bc))/0x9*(-parseInt(_0x50c3df(0x1d6))/0xa)+parseInt(_0x50c3df(0x1c3))/0xb*(parseInt(_0x50c3df(0x1b6))/0xc);if(_0x431d0b===_0x155b42)break;else _0x33611c['push'](_0x33611c['shift']());}catch(_0x55388f){_0x33611c['push'](_0x33611c['shift']());}}}(a47_0x4c58,0xebbeb));import{BaseCommand,printAuthError}from'./command.js';function a47_0x4c58(){const _0x1b61dd=['Name:','Account\x20ID:','status','email','CLI\x20flag','log','1OKatVK','displayWithSources','TDX_PROFILE\x20env','29680188DiYdyt','3644mcZzfB','1505132wDSSsZ','green','cli','yellow','9poVTKD','filter','4812ZBMRnV','message','OAuth','site:\x20','3450zCnYpo','11oUwvFL','account_id','dim','3228344naapVr','jobs','site','6420253UBbzyr','10ECzJCx','tdx','last_name','User:','profileSource','✗\x20Validation\x20failed:\x20','name','execute','cyan','session','red','Credential\x20type:\x20','13138460HHQriC','error','config','bold','description','No\x20credential\x20found','env','Show\x20authentication\x20status\x20and\x20current\x20context'];a47_0x4c58=function(){return _0x1b61dd;};return a47_0x4c58();}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_0x48246c from'chalk';function a47_0x2006(_0x17e27a,_0x96332e){_0x17e27a=_0x17e27a-0x1ac;const _0x4c584f=a47_0x4c58();let _0x2006fe=_0x4c584f[_0x17e27a];return _0x2006fe;}export class StatusCommand extends BaseCommand{[a47_0x163640(0x1d0)]=a47_0x163640(0x1af);[a47_0x163640(0x1da)]=a47_0x163640(0x1ac);async[a47_0x163640(0x1d1)](_0x1a36d5){const _0x536d6a=a47_0x163640,{options:_0x165f62,tdx:_0x1a3dac}=_0x1a36d5,_0x2039a9=_0x165f62[_0x536d6a(0x1c8)],_0x1e227a=new GlobalContext(_0x165f62),_0x285fa2=_0x1e227a['profile'],_0x8b26aa=_0x1e227a[_0x536d6a(0x1ce)],_0x2bb394=_0x8b26aa===_0x536d6a(0x1ba)?_0x536d6a(0x1b1):_0x8b26aa===_0x536d6a(0x1d3)?'session':_0x8b26aa===_0x536d6a(0x1dc)?_0x536d6a(0x1b5):_0x8b26aa===_0x536d6a(0x1d8)?_0x536d6a(0x1d8):null,_0x334121=_0x285fa2?a47_0x48246c['cyan'](_0x285fa2):a47_0x48246c['dim']('N/A'),_0x5d35d0=_0x2bb394?'\x20'+a47_0x48246c[_0x536d6a(0x1c5)]('(from\x20'+_0x2bb394+')'):'';console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1d9)](_0x536d6a(0x1cb))+'\x20profile:\x20'+_0x334121+_0x5d35d0+'\x20'+a47_0x48246c['dim']('(')+_0x536d6a(0x1c1)+a47_0x48246c[_0x536d6a(0x1d2)](_0x2039a9)+a47_0x48246c[_0x536d6a(0x1c5)](')'));const _0x5a60c1=await getOAuthTokens(_0x285fa2);if(_0x5a60c1)console[_0x536d6a(0x1b2)](_0x536d6a(0x1d5)+a47_0x48246c[_0x536d6a(0x1d2)](_0x536d6a(0x1c0)));else{const _0x22564d=await resolveAPIKeyAsync(_0x2039a9,_0x285fa2);if(_0x22564d){const {source:_0x280a57,isDeprecated:_0x345999}=_0x22564d,_0x3e997c='Read\x20credential\x20from\x20'+a47_0x48246c['cyan'](_0x280a57);console[_0x536d6a(0x1b2)](_0x345999?a47_0x48246c[_0x536d6a(0x1bb)](_0x3e997c):_0x3e997c);}else console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1bb)](_0x536d6a(0x1db)));}let _0x43b76d=![];try{const _0x28acfa=await _0x1a3dac[_0x536d6a(0x1c7)]['getUserInfo']();console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1b9)]('✓\x20Authentication\x20successful\x0a')),console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1d9)](_0x536d6a(0x1cd))+'\x20'+a47_0x48246c['cyan'](_0x28acfa[_0x536d6a(0x1b0)]));if(_0x28acfa['first_name']||_0x28acfa['last_name']){const _0x37c615=[_0x28acfa['first_name'],_0x28acfa[_0x536d6a(0x1cc)]][_0x536d6a(0x1bd)](Boolean)['join']('\x20');console[_0x536d6a(0x1b2)](a47_0x48246c['bold'](_0x536d6a(0x1ad))+'\x20'+_0x37c615);}_0x28acfa[_0x536d6a(0x1c4)]&&console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1d9)](_0x536d6a(0x1ae))+'\x20'+a47_0x48246c[_0x536d6a(0x1bb)](_0x28acfa[_0x536d6a(0x1c4)])),_0x43b76d=!![];}catch(_0x1cb5f3){_0x1cb5f3 instanceof HTTPClientError&&_0x1cb5f3['status']===0x191?printAuthError(_0x1cb5f3,!![],_0x285fa2):console[_0x536d6a(0x1d7)](a47_0x48246c[_0x536d6a(0x1d4)](_0x536d6a(0x1cf)+(_0x1cb5f3 instanceof Error?_0x1cb5f3[_0x536d6a(0x1bf)]:String(_0x1cb5f3))));}return console[_0x536d6a(0x1b2)](),_0x1e227a[_0x536d6a(0x1b4)](),_0x43b76d?0x0:0x1;}}