@treasuredata/tdx 2026.4.20 → 2026.4.21

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 (237) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.d.ts +47 -0
  27. package/dist/commands/engage-command.d.ts.map +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-command.js.map +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.js +1 -1
  41. package/dist/commands/profiles-command.js +1 -1
  42. package/dist/commands/query-command.js +1 -1
  43. package/dist/commands/schedule-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.js +1 -1
  48. package/dist/commands/segment-push-command.js +1 -1
  49. package/dist/commands/segment-update-command.js +1 -1
  50. package/dist/commands/segment-use-command.js +1 -1
  51. package/dist/commands/segment-validate-command.js +1 -1
  52. package/dist/commands/segments.js +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/status-command.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/user-cache.js +1 -1
  76. package/dist/core/version.js +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/mcp/server.js +1 -1
  79. package/dist/mcp/tools/index.js +1 -1
  80. package/dist/mcp/tools/tdx-run.js +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/tools/work-create-item.js +1 -1
  83. package/dist/mcp/utils.js +1 -1
  84. package/dist/proxy/claude-usage-tracker.js +1 -1
  85. package/dist/proxy/passthrough-server.js +1 -1
  86. package/dist/proxy/sse-usage-parser.js +1 -1
  87. package/dist/sdk/agent/agent-config.js +1 -1
  88. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  89. package/dist/sdk/agent/agent-yaml.js +1 -1
  90. package/dist/sdk/agent/test/evaluator.js +1 -1
  91. package/dist/sdk/agent/test/executor.js +1 -1
  92. package/dist/sdk/agent/test/index.js +1 -1
  93. package/dist/sdk/agent/test/output.js +1 -1
  94. package/dist/sdk/agent/test/parser.js +1 -1
  95. package/dist/sdk/agent/tool-target-registry.js +1 -1
  96. package/dist/sdk/api.js +1 -1
  97. package/dist/sdk/cas/cas-api-client.js +1 -1
  98. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  99. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  100. package/dist/sdk/cas/index.js +1 -1
  101. package/dist/sdk/cas/pull-workflow.js +1 -1
  102. package/dist/sdk/cas/push-workflow.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.js +1 -1
  104. package/dist/sdk/client/delivery-api-client.js +1 -1
  105. package/dist/sdk/client/endpoints.js +1 -1
  106. package/dist/sdk/client/engage-api-client.d.ts +50 -1
  107. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/engage-api-client.js.map +1 -1
  110. package/dist/sdk/client/http-client.js +1 -1
  111. package/dist/sdk/client/llm-api-client.js +1 -1
  112. package/dist/sdk/client/oauth-refresh.js +1 -1
  113. package/dist/sdk/client/rate-limiter.js +1 -1
  114. package/dist/sdk/client/td-api-client.js +1 -1
  115. package/dist/sdk/client/trino-api-client.js +1 -1
  116. package/dist/sdk/client/workflow-client.js +1 -1
  117. package/dist/sdk/connection-validator.js +1 -1
  118. package/dist/sdk/connection.js +1 -1
  119. package/dist/sdk/delivery.js +1 -1
  120. package/dist/sdk/engage/campaign-pull.js +1 -1
  121. package/dist/sdk/engage/campaign-push.js +1 -1
  122. package/dist/sdk/engage/campaign-validator.js +1 -1
  123. package/dist/sdk/engage/campaign-yaml.js +1 -1
  124. package/dist/sdk/engage/template-pull.js +1 -1
  125. package/dist/sdk/engage/template-push.js +1 -1
  126. package/dist/sdk/engage/template-validator.js +1 -1
  127. package/dist/sdk/engage/template-yaml.js +1 -1
  128. package/dist/sdk/engage/types/campaign-def.js +1 -1
  129. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  130. package/dist/sdk/engage/types/template-schema.js +1 -1
  131. package/dist/sdk/engage.d.ts +35 -1
  132. package/dist/sdk/engage.d.ts.map +1 -1
  133. package/dist/sdk/engage.js +1 -1
  134. package/dist/sdk/engage.js.map +1 -1
  135. package/dist/sdk/errors.js +1 -1
  136. package/dist/sdk/index.js +1 -1
  137. package/dist/sdk/io/index.js +1 -1
  138. package/dist/sdk/io/node-filesystem.js +1 -1
  139. package/dist/sdk/job.js +1 -1
  140. package/dist/sdk/journey.js +1 -1
  141. package/dist/sdk/llm/chat-cache.js +1 -1
  142. package/dist/sdk/llm/index.js +1 -1
  143. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  144. package/dist/sdk/llm/model-factors.js +1 -1
  145. package/dist/sdk/personalization.js +1 -1
  146. package/dist/sdk/policy.js +1 -1
  147. package/dist/sdk/query/index.js +1 -1
  148. package/dist/sdk/query/sql-parser.js +1 -1
  149. package/dist/sdk/realtime.js +1 -1
  150. package/dist/sdk/schedule.js +1 -1
  151. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  152. package/dist/sdk/segment/fields-display.js +1 -1
  153. package/dist/sdk/segment/file-discovery.js +1 -1
  154. package/dist/sdk/segment/journey-utils.js +1 -1
  155. package/dist/sdk/segment/journey-validator.js +1 -1
  156. package/dist/sdk/segment/journey-yaml.js +1 -1
  157. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  158. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  159. package/dist/sdk/segment/pull-workflow.js +1 -1
  160. package/dist/sdk/segment/push-recovery.js +1 -1
  161. package/dist/sdk/segment/push-workflow.js +1 -1
  162. package/dist/sdk/segment/resolution-context.js +1 -1
  163. package/dist/sdk/segment/segment-path-parser.js +1 -1
  164. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  165. package/dist/sdk/segment/segment-validator.js +1 -1
  166. package/dist/sdk/segment/target-resolution.js +1 -1
  167. package/dist/sdk/segment/tdx-config.js +1 -1
  168. package/dist/sdk/segment/types/activation-schema.js +1 -1
  169. package/dist/sdk/segment/types/journey-def.js +1 -1
  170. package/dist/sdk/segment/types/journey-schema.js +1 -1
  171. package/dist/sdk/segment/types/segment-def.js +1 -1
  172. package/dist/sdk/segment/types/segment-schema.js +1 -1
  173. package/dist/sdk/segment/validate-files.js +1 -1
  174. package/dist/sdk/segment/yaml-validator.js +1 -1
  175. package/dist/sdk/segment.js +1 -1
  176. package/dist/sdk/types/engage.d.ts +53 -0
  177. package/dist/sdk/types/engage.d.ts.map +1 -1
  178. package/dist/sdk/types/index.d.ts +1 -1
  179. package/dist/sdk/types/index.d.ts.map +1 -1
  180. package/dist/sdk/types/index.js +1 -1
  181. package/dist/sdk/types/index.js.map +1 -1
  182. package/dist/sdk/types/progress.js +1 -1
  183. package/dist/sdk/types/workspace.js +1 -1
  184. package/dist/sdk/user.js +1 -1
  185. package/dist/sdk/util/format-detector.js +1 -1
  186. package/dist/sdk/util/formatters.js +1 -1
  187. package/dist/sdk/util/index.js +1 -1
  188. package/dist/sdk/util/paginate.js +1 -1
  189. package/dist/sdk/util/tree-formatter.js +1 -1
  190. package/dist/sdk/workflow/archive-validation.js +1 -1
  191. package/dist/sdk/workflow/clone-workflow.js +1 -1
  192. package/dist/sdk/workflow/index.js +1 -1
  193. package/dist/sdk/workflow/pull-workflow.js +1 -1
  194. package/dist/sdk/workflow/push-workflow.js +1 -1
  195. package/dist/sdk/workflow/task-graph.js +1 -1
  196. package/dist/sdk/workflow/tdx-config.js +1 -1
  197. package/dist/sdk/workflow/workflow-utils.js +1 -1
  198. package/dist/sdk/workspace/access-tracker.js +1 -1
  199. package/dist/sdk/workspace/frontmatter.js +1 -1
  200. package/dist/sdk/workspace/git.js +1 -1
  201. package/dist/sdk/workspace/index.js +1 -1
  202. package/dist/sdk/workspace/templates.js +1 -1
  203. package/dist/sdk/workspace/weekly.js +1 -1
  204. package/dist/sdk/workspace/wikilinks.js +1 -1
  205. package/dist/test-utils/command-runner.js +1 -1
  206. package/dist/test-utils/factories.js +1 -1
  207. package/dist/test-utils/fixtures.js +1 -1
  208. package/dist/test-utils/http-mock.js +1 -1
  209. package/dist/test-utils/index.js +1 -1
  210. package/dist/utils/async.js +1 -1
  211. package/dist/utils/colors.js +1 -1
  212. package/dist/utils/diff.js +1 -1
  213. package/dist/utils/file-permissions.js +1 -1
  214. package/dist/utils/file-reader.js +1 -1
  215. package/dist/utils/github-releases.js +1 -1
  216. package/dist/utils/global-cache.js +1 -1
  217. package/dist/utils/json-loader.js +1 -1
  218. package/dist/utils/local-cache.js +1 -1
  219. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  220. package/dist/utils/logger/formatters/index.js +1 -1
  221. package/dist/utils/logger/handlers/console-handler.js +1 -1
  222. package/dist/utils/logger/handlers/file-handler.js +1 -1
  223. package/dist/utils/logger/handlers/index.js +1 -1
  224. package/dist/utils/logger/handlers/null-handler.js +1 -1
  225. package/dist/utils/logger/index.js +1 -1
  226. package/dist/utils/logger/logger.js +1 -1
  227. package/dist/utils/logger/types.js +1 -1
  228. package/dist/utils/option-validation.js +1 -1
  229. package/dist/utils/process.js +1 -1
  230. package/dist/utils/prompt.js +1 -1
  231. package/dist/utils/spinner.js +1 -1
  232. package/dist/utils/sse-parser.js +1 -1
  233. package/dist/utils/string-utils.js +1 -1
  234. package/dist/utils/table-ref-parser.js +1 -1
  235. package/dist/utils/tdx-logger.js +1 -1
  236. package/dist/utils/version-check.js +1 -1
  237. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x117a46=a40_0x429d;(function(_0x52f906,_0x28a6e0){const _0x59127c=a40_0x429d,_0x53e8dc=_0x52f906();while(!![]){try{const _0x3d10de=-parseInt(_0x59127c(0x1d3))/0x1*(parseInt(_0x59127c(0x197))/0x2)+parseInt(_0x59127c(0x1bb))/0x3*(-parseInt(_0x59127c(0x198))/0x4)+-parseInt(_0x59127c(0x1c1))/0x5+parseInt(_0x59127c(0x19f))/0x6+-parseInt(_0x59127c(0x19c))/0x7+-parseInt(_0x59127c(0x1d6))/0x8+parseInt(_0x59127c(0x196))/0x9;if(_0x3d10de===_0x28a6e0)break;else _0x53e8dc['push'](_0x53e8dc['shift']());}catch(_0x296ec5){_0x53e8dc['push'](_0x53e8dc['shift']());}}}(a40_0x586b,0x4a094));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_0x4747fd from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x586b(){const _0x14de5b=['targetDir','activations','23xmQpYS','journeyVersions','\x20files\x20to\x20','3486824DcRuUC','\x0aChanges\x20to\x20\x27','name','\x20=\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','data','green','repeat','verbose','\x20versions)','dim','content','message','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aError:','cyan','filter','18239742NNTHyL','49190cXyNnf','462764DGPafY','segments','yellow','resourceName','3166513IeNNqS','files','✔\x20All\x20files\x20are\x20up\x20to\x20date','1391832PxnKqv','execute','Write\x20','session','error','absolutePath','isNew','length','Error:\x20','\x20files?','\x0aPull\x20summary\x20for\x20\x27','\x20changed\x20files','\x27...','errorCode','\x20\x20Target:\x20','Site:\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)','\x20segments','segment:pull','utf-8','journeys','red','✔\x20Pulled\x20','\x20new\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','hasChanges','\x20unchanged\x20files','Aborted.','9qZFhYL','parentName','site','helpText','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','771940NktJzl','\x20\x20🗺️\x20\x20','pullSegments','counts','file','setPhase','segment','no_parent','Pulling\x20segments\x20from\x20\x27','\x20journeys','\x20with\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Target\x20resource:\x20','dirname','Parent\x20segment:\x20','✔\x20Context\x20set:\x20'];a40_0x586b=function(){return _0x14de5b;};return a40_0x586b();}import a40_0x39d397 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x429d(_0x4d615e,_0x42da2b){_0x4d615e=_0x4d615e-0x188;const _0x586bf8=a40_0x586b();let _0x429d0c=_0x586bf8[_0x4d615e];return _0x429d0c;}export class SegmentPullCommand extends BaseCommand{[a40_0x117a46(0x1d8)]=a40_0x117a46(0x1b1);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x117a46(0x1a0)](_0x2a761a){const _0xd69eed=a40_0x117a46,{options:_0x2e5f2f,args:_0x28d015,tdx:_0x2283bb}=_0x2a761a,_0xba23b4=_0x2e5f2f,_0x26dea3=await resolveTarget({'arg':_0x28d015[0x0],'contextParent':_0x2e5f2f['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x26dea3))return _0x26dea3[_0xd69eed(0x1ac)]===_0xd69eed(0x1c8)?(console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x19a)](_0xd69eed(0x1bf))),console['error'](_0xd69eed(0x1af)),console[_0xd69eed(0x1a3)](_0xd69eed(0x1b7)),console[_0xd69eed(0x1a3)](_0xd69eed(0x1cc))):(console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x1b4)](_0xd69eed(0x1a7)+_0x26dea3[_0xd69eed(0x191)]+'\x0a')),_0x26dea3['helpText']&&console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x194)](_0x26dea3[_0xd69eed(0x1be)]))),0x1;const _0x15ccc2=_0x26dea3['parentName'],_0x50aaf0=_0x26dea3[_0xd69eed(0x1d1)],_0xc9ec78=_0x26dea3['type']===_0xd69eed(0x1c5)?_0x26dea3[_0xd69eed(0x19b)]:undefined;_0xba23b4[_0xd69eed(0x18d)]&&(console[_0xd69eed(0x1a3)](_0xd69eed(0x1ae)+_0xba23b4[_0xd69eed(0x1bd)]),console[_0xd69eed(0x1a3)](_0xd69eed(0x1cf)+_0x15ccc2),_0xc9ec78&&console[_0xd69eed(0x1a3)](_0xd69eed(0x1cd)+_0xc9ec78));const _0x30dc05=await withProgressSpinner(_0xd69eed(0x1c9)+_0x15ccc2+_0xd69eed(0x1ab),_0xa767b7=>_0x2283bb[_0xd69eed(0x1c7)][_0xd69eed(0x1c3)](_0x15ccc2,{'targetDir':_0x50aaf0,'targetResourceName':_0xc9ec78,'verbose':_0xba23b4[_0xd69eed(0x18d)],'progress':{'update':_0x11558e=>{const _0x5eb43b=_0xd69eed;_0xa767b7[_0x5eb43b(0x1c6)](_0x11558e),_0xba23b4['verbose']&&console[_0x5eb43b(0x1a3)]('\x20\x20'+_0x11558e);}}}),{'verbose':_0xba23b4[_0xd69eed(0x18d)]}),_0x239bd4=_0x30dc05[_0xd69eed(0x18a)];if(_0x239bd4[_0xd69eed(0x1c4)]['segments']===0x0&&_0x239bd4['counts'][_0xd69eed(0x1b3)]===0x0)return console['error'](a40_0x4747fd[_0xd69eed(0x19a)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x239bd4['parentName']+'\x27')),0x0;const _0x50e508=_0x239bd4[_0xd69eed(0x19d)][_0xd69eed(0x195)](_0x5e1520=>_0x5e1520['isNew']),_0xc69de8=_0x239bd4[_0xd69eed(0x19d)][_0xd69eed(0x195)](_0x4f37b0=>!_0x4f37b0[_0xd69eed(0x1a5)]&&_0x4f37b0[_0xd69eed(0x1b8)]),_0x3d7f54=_0x239bd4['files'][_0xd69eed(0x195)](_0x44b79c=>!_0x44b79c[_0xd69eed(0x1a5)]&&!_0x44b79c[_0xd69eed(0x1b8)]);console['error'](_0xd69eed(0x1a9)+_0x239bd4[_0xd69eed(0x1bc)]+'\x27:'),console[_0xd69eed(0x1a3)]('\x20\x20🎯\x20'+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x199)]+_0xd69eed(0x1b0))+_0xd69eed(0x1cb)+a40_0x4747fd['cyan'](_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x1d2)]+'\x20activations'));if(_0x239bd4[_0xd69eed(0x1c4)]['journeys']>0x0){const _0x550935=_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x1d4)]>_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x1b3)]?'\x20('+_0x239bd4[_0xd69eed(0x1c4)]['journeyVersions']+_0xd69eed(0x18e):'';console['error'](_0xd69eed(0x1c2)+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x1b3)]+_0xd69eed(0x1ca))+a40_0x4747fd[_0xd69eed(0x18f)](_0x550935));}console['error']('\x20\x20'+a40_0x4747fd[_0xd69eed(0x18b)]('+\x20'+_0x50e508[_0xd69eed(0x1a6)]+_0xd69eed(0x1b6))),console['error']('\x20\x20'+a40_0x4747fd['yellow']('~\x20'+_0xc69de8[_0xd69eed(0x1a6)]+_0xd69eed(0x1aa))),console['error']('\x20\x20'+a40_0x4747fd[_0xd69eed(0x18f)]('=\x20'+_0x3d7f54[_0xd69eed(0x1a6)]+_0xd69eed(0x1b9))),console[_0xd69eed(0x1a3)](_0xd69eed(0x1ad)+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4['targetDir'])+'\x0a');if(_0xc69de8[_0xd69eed(0x1a6)]>0x0)for(const _0x28a029 of _0xc69de8){console['error'](_0xd69eed(0x1d7)+_0x28a029['relativePath']+'\x27:'),console[_0xd69eed(0x1a3)]('─'[_0xd69eed(0x18c)](0x3c)),console[_0xd69eed(0x1a3)](_0x28a029['diff']),console[_0xd69eed(0x1a3)]('─'[_0xd69eed(0x18c)](0x3c));}if(_0xba23b4['dryRun'])return console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x19a)](_0xd69eed(0x1c0))),0x0;if(_0x50e508[_0xd69eed(0x1a6)]===0x0&&_0xc69de8[_0xd69eed(0x1a6)]===0x0)return console[_0xd69eed(0x1a3)](a40_0x4747fd['green'](_0xd69eed(0x19e))),saveSessionContext({'parent_segment':_0x239bd4['parentName']},_0xba23b4['session']),console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x18b)]('✔\x20Context\x20set:\x20'+a40_0x4747fd[_0xd69eed(0x18f)]('parent_segment')+_0xd69eed(0x188)+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4[_0xd69eed(0x1bc)]))),0x0;if(!_0xba23b4['yes']){if(!isInteractive())return console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x1b4)](_0xd69eed(0x193)),_0xd69eed(0x192)),console['error'](a40_0x4747fd[_0xd69eed(0x18f)](_0xd69eed(0x189))),0x1;const _0x3f1268=await confirmKey(_0xd69eed(0x1a1)+(_0x50e508[_0xd69eed(0x1a6)]+_0xc69de8[_0xd69eed(0x1a6)])+_0xd69eed(0x1a8));if(!_0x3f1268)return console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x19a)](_0xd69eed(0x1ba)),'-\x20no\x20files\x20written'),0x1;}for(const _0x458446 of _0x239bd4[_0xd69eed(0x19d)]){if(_0x458446[_0xd69eed(0x1a5)]||_0x458446['hasChanges']){const _0x1578da=a40_0x39d397[_0xd69eed(0x1ce)](_0x458446[_0xd69eed(0x1a4)]);!existsSync(_0x1578da)&&mkdirSync(_0x1578da,{'recursive':!![]}),writeFileSync(_0x458446[_0xd69eed(0x1a4)],_0x458446[_0xd69eed(0x190)],_0xd69eed(0x1b2));}}return console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x18b)](_0xd69eed(0x1b5)+(_0x50e508[_0xd69eed(0x1a6)]+_0xc69de8[_0xd69eed(0x1a6)])+_0xd69eed(0x1d5)+_0x239bd4[_0xd69eed(0x1d1)])),saveSessionContext({'parent_segment':_0x239bd4[_0xd69eed(0x1bc)]},_0xba23b4[_0xd69eed(0x1a2)]),console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x18b)](_0xd69eed(0x1d0)+a40_0x4747fd[_0xd69eed(0x18f)]('parent_segment')+'\x20=\x20'+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4['parentName']))),0x0;}}
1
+ function a40_0x42b9(_0x34ae98,_0x7fab07){_0x34ae98=_0x34ae98-0x12a;const _0x241e9e=a40_0x241e();let _0x42b97a=_0x241e9e[_0x34ae98];return _0x42b97a;}function a40_0x241e(){const _0x3ac7e7=['journeys','\x20files\x20to\x20','47910910VvVIDV','message','counts','\x20=\x20','3536687vRuLSi','filter','179096LRltZp','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','4544712pZHnqM','parent_segment','Parent\x20segment:\x20','2311280qVdtLk','green','cyan','resourceName','pullSegments','type','5JoecbX','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)','\x27...','files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','no_parent','yes','description','\x20versions)','isNew','absolutePath','segment','dryRun','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20new\x20files','Write\x20','dim','16FZcOHK','✔\x20Pulled\x20','errorCode','parentName','session','\x20with\x20','yellow','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','verbose','setPhase','✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Context\x20set:\x20','utf-8','segments','Pulling\x20segments\x20from\x20\x27','length','Target\x20resource:\x20','\x20segments','data','targetDir','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20activations','content','3aSfolG','activations','\x20\x20🎯\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','Site:\x20','red','14233662evySDP','7866174YzjVYb','repeat','error','file','\x0aChanges\x20to\x20\x27','journeyVersions','hasChanges','segment:pull','\x0aError:','\x20journeys','helpText'];a40_0x241e=function(){return _0x3ac7e7;};return a40_0x241e();}const a40_0x2dc941=a40_0x42b9;(function(_0x5e866a,_0x3fe262){const _0x7812ad=a40_0x42b9,_0x14aeaa=_0x5e866a();while(!![]){try{const _0xb04e94=parseInt(_0x7812ad(0x154))/0x1*(-parseInt(_0x7812ad(0x138))/0x2)+-parseInt(_0x7812ad(0x16b))/0x3*(-parseInt(_0x7812ad(0x13d))/0x4)+-parseInt(_0x7812ad(0x143))/0x5*(parseInt(_0x7812ad(0x173))/0x6)+parseInt(_0x7812ad(0x136))/0x7+-parseInt(_0x7812ad(0x13a))/0x8+-parseInt(_0x7812ad(0x172))/0x9+parseInt(_0x7812ad(0x132))/0xa;if(_0xb04e94===_0x3fe262)break;else _0x14aeaa['push'](_0x14aeaa['shift']());}catch(_0x300f86){_0x14aeaa['push'](_0x14aeaa['shift']());}}}(a40_0x241e,0xef70c));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_0xd5a2f8 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x4981fc from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x2dc941(0x16f)]=a40_0x2dc941(0x12c);[a40_0x2dc941(0x14a)]=a40_0x2dc941(0x150);async['execute'](_0x52b00f){const _0x2d7302=a40_0x2dc941,{options:_0x1099e5,args:_0x4b47aa,tdx:_0x543be3}=_0x52b00f,_0xd64cd0=_0x1099e5,_0x6e6f71=await resolveTarget({'arg':_0x4b47aa[0x0],'contextParent':_0x1099e5['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x6e6f71))return _0x6e6f71[_0x2d7302(0x156)]===_0x2d7302(0x148)?(console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x15a)](_0x2d7302(0x147))),console[_0x2d7302(0x175)](_0x2d7302(0x144)),console[_0x2d7302(0x175)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x2d7302(0x175)](_0x2d7302(0x139))):(console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x171)]('Error:\x20'+_0x6e6f71[_0x2d7302(0x133)]+'\x0a')),_0x6e6f71[_0x2d7302(0x12f)]&&console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x13f)](_0x6e6f71[_0x2d7302(0x12f)]))),0x1;const _0x21ec89=_0x6e6f71[_0x2d7302(0x157)],_0xd7913b=_0x6e6f71[_0x2d7302(0x167)],_0x4ee48f=_0x6e6f71[_0x2d7302(0x142)]===_0x2d7302(0x176)?_0x6e6f71[_0x2d7302(0x140)]:undefined;_0xd64cd0['verbose']&&(console[_0x2d7302(0x175)](_0x2d7302(0x170)+_0xd64cd0['site']),console[_0x2d7302(0x175)](_0x2d7302(0x13c)+_0x21ec89),_0x4ee48f&&console['error'](_0x2d7302(0x164)+_0x4ee48f));const _0x2c1d9a=await withProgressSpinner(_0x2d7302(0x162)+_0x21ec89+_0x2d7302(0x145),_0x2c9189=>_0x543be3[_0x2d7302(0x14e)][_0x2d7302(0x141)](_0x21ec89,{'targetDir':_0xd7913b,'targetResourceName':_0x4ee48f,'verbose':_0xd64cd0[_0x2d7302(0x15c)],'progress':{'update':_0xc17731=>{const _0x4e7d40=_0x2d7302;_0x2c9189[_0x4e7d40(0x15d)](_0xc17731),_0xd64cd0[_0x4e7d40(0x15c)]&&console[_0x4e7d40(0x175)]('\x20\x20'+_0xc17731);}}}),{'verbose':_0xd64cd0[_0x2d7302(0x15c)]}),_0x1d3076=_0x2c1d9a[_0x2d7302(0x166)];if(_0x1d3076[_0x2d7302(0x134)]['segments']===0x0&&_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x130)]===0x0)return console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x15a)](_0x2d7302(0x15b)+_0x1d3076['parentName']+'\x27')),0x0;const _0x4983b6=_0x1d3076['files'][_0x2d7302(0x137)](_0x863bf5=>_0x863bf5[_0x2d7302(0x14c)]),_0x1e9cef=_0x1d3076[_0x2d7302(0x146)][_0x2d7302(0x137)](_0x9d0d6f=>!_0x9d0d6f[_0x2d7302(0x14c)]&&_0x9d0d6f['hasChanges']),_0x5d6d0c=_0x1d3076[_0x2d7302(0x146)][_0x2d7302(0x137)](_0x5727cf=>!_0x5727cf[_0x2d7302(0x14c)]&&!_0x5727cf[_0x2d7302(0x12b)]);console[_0x2d7302(0x175)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1d3076['parentName']+'\x27:'),console[_0x2d7302(0x175)](_0x2d7302(0x16d)+a40_0xd5a2f8['cyan'](_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x161)]+_0x2d7302(0x165))+_0x2d7302(0x159)+a40_0xd5a2f8[_0x2d7302(0x13f)](_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x16c)]+_0x2d7302(0x169)));if(_0x1d3076['counts']['journeys']>0x0){const _0x15be23=_0x1d3076['counts'][_0x2d7302(0x12a)]>_0x1d3076['counts'][_0x2d7302(0x130)]?'\x20('+_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x12a)]+_0x2d7302(0x14b):'';console[_0x2d7302(0x175)]('\x20\x20🗺️\x20\x20'+a40_0xd5a2f8[_0x2d7302(0x13f)](_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x130)]+_0x2d7302(0x12e))+a40_0xd5a2f8[_0x2d7302(0x153)](_0x15be23));}console[_0x2d7302(0x175)]('\x20\x20'+a40_0xd5a2f8[_0x2d7302(0x13e)]('+\x20'+_0x4983b6[_0x2d7302(0x163)]+_0x2d7302(0x151))),console['error']('\x20\x20'+a40_0xd5a2f8[_0x2d7302(0x15a)]('~\x20'+_0x1e9cef[_0x2d7302(0x163)]+'\x20changed\x20files')),console[_0x2d7302(0x175)]('\x20\x20'+a40_0xd5a2f8[_0x2d7302(0x153)]('=\x20'+_0x5d6d0c[_0x2d7302(0x163)]+'\x20unchanged\x20files')),console[_0x2d7302(0x175)]('\x20\x20Target:\x20'+a40_0xd5a2f8[_0x2d7302(0x13f)](_0x1d3076['targetDir'])+'\x0a');if(_0x1e9cef[_0x2d7302(0x163)]>0x0)for(const _0x350969 of _0x1e9cef){console['error'](_0x2d7302(0x177)+_0x350969['relativePath']+'\x27:'),console[_0x2d7302(0x175)]('─'[_0x2d7302(0x174)](0x3c)),console[_0x2d7302(0x175)](_0x350969['diff']),console[_0x2d7302(0x175)]('─'[_0x2d7302(0x174)](0x3c));}if(_0xd64cd0[_0x2d7302(0x14f)])return console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x15a)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4983b6['length']===0x0&&_0x1e9cef[_0x2d7302(0x163)]===0x0)return console[_0x2d7302(0x175)](a40_0xd5a2f8['green'](_0x2d7302(0x15e))),saveSessionContext({'parent_segment':_0x1d3076[_0x2d7302(0x157)]},_0xd64cd0[_0x2d7302(0x158)]),console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x13e)](_0x2d7302(0x15f)+a40_0xd5a2f8['dim'](_0x2d7302(0x13b))+_0x2d7302(0x135)+a40_0xd5a2f8['cyan'](_0x1d3076[_0x2d7302(0x157)]))),0x0;if(!_0xd64cd0[_0x2d7302(0x149)]){if(!isInteractive())return console['error'](a40_0xd5a2f8['red'](_0x2d7302(0x12d)),_0x2d7302(0x168)),console[_0x2d7302(0x175)](a40_0xd5a2f8['dim'](_0x2d7302(0x16e))),0x1;const _0x178bef=await confirmKey(_0x2d7302(0x152)+(_0x4983b6[_0x2d7302(0x163)]+_0x1e9cef[_0x2d7302(0x163)])+'\x20files?');if(!_0x178bef)return console['error'](a40_0xd5a2f8[_0x2d7302(0x15a)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x1a3538 of _0x1d3076['files']){if(_0x1a3538[_0x2d7302(0x14c)]||_0x1a3538[_0x2d7302(0x12b)]){const _0xfda52e=a40_0x4981fc['dirname'](_0x1a3538['absolutePath']);!existsSync(_0xfda52e)&&mkdirSync(_0xfda52e,{'recursive':!![]}),writeFileSync(_0x1a3538[_0x2d7302(0x14d)],_0x1a3538[_0x2d7302(0x16a)],_0x2d7302(0x160));}}return console[_0x2d7302(0x175)](a40_0xd5a2f8['green'](_0x2d7302(0x155)+(_0x4983b6[_0x2d7302(0x163)]+_0x1e9cef['length'])+_0x2d7302(0x131)+_0x1d3076[_0x2d7302(0x167)])),saveSessionContext({'parent_segment':_0x1d3076[_0x2d7302(0x157)]},_0xd64cd0[_0x2d7302(0x158)]),console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x13e)]('✔\x20Context\x20set:\x20'+a40_0xd5a2f8[_0x2d7302(0x153)](_0x2d7302(0x13b))+_0x2d7302(0x135)+a40_0xd5a2f8[_0x2d7302(0x13f)](_0x1d3076[_0x2d7302(0x157)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x2f254e=a41_0x24bb;(function(_0x29ff30,_0x1e5f32){const _0x2ed2aa=a41_0x24bb,_0x578359=_0x29ff30();while(!![]){try{const _0xf01ca=-parseInt(_0x2ed2aa(0x11b))/0x1+parseInt(_0x2ed2aa(0x12d))/0x2+-parseInt(_0x2ed2aa(0x13f))/0x3+-parseInt(_0x2ed2aa(0x140))/0x4*(-parseInt(_0x2ed2aa(0xdf))/0x5)+parseInt(_0x2ed2aa(0x122))/0x6+parseInt(_0x2ed2aa(0x157))/0x7+-parseInt(_0x2ed2aa(0xf2))/0x8*(parseInt(_0x2ed2aa(0x151))/0x9);if(_0xf01ca===_0x1e5f32)break;else _0x578359['push'](_0x578359['shift']());}catch(_0x5d839f){_0x578359['push'](_0x578359['shift']());}}}(a41_0x30e5,0xecc90));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x539f4a from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a41_0x24bb(_0x38cc45,_0x4e4325){_0x38cc45=_0x38cc45-0xd9;const _0x30e55c=a41_0x30e5();let _0x24bb69=_0x30e55c[_0x38cc45];return _0x24bb69;}export class SegmentPushCommand extends BaseCommand{[a41_0x2f254e(0x147)]=a41_0x2f254e(0xf4);[a41_0x2f254e(0xdd)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0x2f254e(0x119)](_0x5a3c2c){const _0x196c5b=a41_0x2f254e,{options:_0x1d5b5a,args:_0x4d64c8,tdx:_0x5d06c6}=_0x5a3c2c,_0x10c6f9=_0x1d5b5a,_0x5ac8dd=await resolveTarget({'arg':_0x4d64c8[0x0],'contextParent':_0x1d5b5a['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5ac8dd))return _0x5ac8dd[_0x196c5b(0xf0)]===_0x196c5b(0x10b)?(console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0xd9))),console['error'](_0x196c5b(0xed)),console[_0x196c5b(0x143)](_0x196c5b(0x134)),console[_0x196c5b(0x143)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x196c5b(0x143)](a41_0x539f4a['red']('Error:\x20'+_0x5ac8dd['message']+'\x0a')),_0x5ac8dd[_0x196c5b(0x153)]&&console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xfb)](_0x5ac8dd[_0x196c5b(0x153)]))),0x1;if(_0x5ac8dd[_0x196c5b(0x156)]==='parent_name')return console['error'](a41_0x539f4a[_0x196c5b(0xe5)]('Error:\x20Directory\x20not\x20found:\x20'+_0x5ac8dd[_0x196c5b(0xf5)]+'\x0a')),console[_0x196c5b(0x143)](a41_0x539f4a['cyan'](_0x196c5b(0x126))),0x1;const _0x2b2394=_0x5ac8dd['parentName'],_0x66bf0a=_0x5ac8dd[_0x196c5b(0xf5)],_0x30541f=_0x5ac8dd[_0x196c5b(0x156)]===_0x196c5b(0xf7)?_0x5ac8dd['filePath']:undefined,_0x16b322=getScopedDetails(_0x5ac8dd),_0x40342b=_0x16b322?.[_0x196c5b(0x11e)]??![],_0x1a4932=_0x16b322?.[_0x196c5b(0x15e)]??'';if(!existsSync(_0x66bf0a))return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x107)+_0x66bf0a+'\x0a')),console['error'](a41_0x539f4a[_0x196c5b(0xfb)](_0x196c5b(0x126))),0x1;_0x10c6f9['verbose']&&(console[_0x196c5b(0x143)]('Site:\x20'+_0x10c6f9[_0x196c5b(0xea)]),console[_0x196c5b(0x143)](_0x196c5b(0xfd)+_0x2b2394),console[_0x196c5b(0x143)](_0x196c5b(0x155)+_0x66bf0a),_0x40342b&&console[_0x196c5b(0x143)](_0x196c5b(0x133)+_0x1a4932));const _0x614b58=await withSpinner(_0x196c5b(0x142)+_0x2b2394+_0x196c5b(0x11d),()=>_0x5d06c6[_0x196c5b(0x159)]['resolveParentId'](_0x2b2394),{'verbose':_0x10c6f9[_0x196c5b(0x158)]}),_0x4a45b6=_0x614b58['data'],{parentSegmentResult:_0x106a36,segmentsResult:_0x3a487f,foldersResult:_0x31c566,journeysWithDetailsResult:_0x1a0c45,userMaps:_0x5e221f}=await withSpinner(_0x196c5b(0xf8),async()=>{const _0x2b4bcd=_0x196c5b,[_0x2a4395,_0x1effd8,_0x2594b6,_0x1322a2,_0x3a465a]=await Promise[_0x2b4bcd(0x13e)]([_0x5d06c6[_0x2b4bcd(0x159)][_0x2b4bcd(0x15b)](_0x4a45b6),_0x5d06c6[_0x2b4bcd(0x159)][_0x2b4bcd(0x15f)](_0x4a45b6),_0x5d06c6['segment']['listFolders'](_0x4a45b6),_0x5d06c6[_0x2b4bcd(0x12e)][_0x2b4bcd(0x103)](_0x4a45b6,{'includeAllVersions':!![]}),_0x5d06c6[_0x2b4bcd(0x11f)]['buildUserMaps']()]);return{'parentSegmentResult':_0x2a4395,'segmentsResult':_0x1effd8,'foldersResult':_0x2594b6,'journeysWithDetailsResult':_0x1322a2,'userMaps':_0x3a465a};},{'verbose':_0x10c6f9['verbose']})['then'](_0x28618a=>_0x28618a['data']),_0x230676=_0x106a36,_0x536095=extractRootFolderId(_0x230676),_0x5b3d27=_0x3a487f,_0x195727=_0x31c566,{journeys:_0x2d16ad,activationStepsById:_0x55021f}=_0x1a0c45,_0x3f0d04=new Map(_0x2d16ad[_0x196c5b(0xee)](_0x1e263a=>[_0x1e263a['id'],_0x1e263a])),_0x3c32ec=_0x2d16ad['map'](_0x55484f=>({'id':_0x55484f['id'],'name':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0x147)],'journeyBundleName':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0x14b)]||'','journeyBundleId':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0xdb)]||'','versionNumber':_0x55484f[_0x196c5b(0x14e)]['versionNumber'],'description':_0x55484f['attributes']['description'],'state':_0x55484f['attributes'][_0x196c5b(0x115)],'paused':_0x55484f['attributes']['paused'],'audienceId':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0x13a)],'folderId':_0x55484f['relationships']?.[_0x196c5b(0x112)]?.[_0x196c5b(0x129)]?.['id'],'createdAt':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0x14d)],'updatedAt':_0x55484f[_0x196c5b(0x14e)]['updatedAt']})),{emailToId:_0x46d96c,idToEmail:_0x4061c7}=_0x5e221f,_0xec8959=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x4258d8=_0x196c5b,_0x296d2c=await _0x5d06c6[_0x4258d8(0x137)][_0x4258d8(0x12c)]();return buildConnectionMaps(_0x296d2c);},{'verbose':_0x10c6f9[_0x196c5b(0x158)]})[_0x196c5b(0x117)](_0xf5679f=>_0xf5679f['data']),_0x527885=_0xec8959[_0x196c5b(0x104)],_0x3f0316=_0xec8959[_0x196c5b(0x12b)],_0x3de0e5=_0xec8959['nameToType'],_0x499e85={'emailToIdMap':_0x46d96c,'connectionNameToIdMap':_0x527885,'connectionNameToTypeMap':_0x3de0e5,'getSchema':_0x2a0b07=>_0x5d06c6['connection']['getOutputSchemaWithCache'](_0x2a0b07)};let {pathToId:_0x275497,idToPath:_0xa58093}=buildFolderMaps(_0x195727);const _0x6d2ffa=buildSegmentLookupMap(_0x5b3d27,_0xa58093),_0x2871fb=buildSegmentNameToIdMap(_0x5b3d27),_0x395c33=buildJourneyBundleLookupMap(_0x3c32ec,_0xa58093);let _0x45157a;if(_0x30541f){if(!_0x30541f[_0x196c5b(0xf3)]('.yml')&&!_0x30541f[_0x196c5b(0xf3)](_0x196c5b(0xf6)))return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x13c)+_0x30541f+'\x0a')),0x1;_0x45157a=[_0x30541f];}else _0x45157a=findYamlFiles(_0x66bf0a);if(_0x45157a['length']===0x0)return console['error'](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x161)+_0x66bf0a+'\x0a')),console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xfb)](_0x196c5b(0x128))),0x1;let _0xe0cf34,_0x3bcb18;try{const _0x41a131=parseAndClassifyYamlFiles(_0x45157a,_0x66bf0a,{'skipSegments':_0x10c6f9[_0x196c5b(0x108)]});_0xe0cf34=_0x41a131[_0x196c5b(0x130)],_0x3bcb18=_0x41a131[_0x196c5b(0x164)];const _0xae0768=validateParsedFiles(_0x41a131,_0x66bf0a);if(_0xae0768[_0x196c5b(0x136)]>0x0)return console['error'](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x12f))),console[_0x196c5b(0x143)](formatValidationErrors(_0xae0768)),console['error'](a41_0x539f4a[_0x196c5b(0xdc)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x2cb14b){return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe5)]('Error\x20parsing\x20YAML:\x20'+(_0x2cb14b instanceof Error?_0x2cb14b['message']:_0x2cb14b))),0x1;}if(_0xe0cf34[_0x196c5b(0x136)]===0x0&&_0x3bcb18[_0x196c5b(0x136)]===0x0){const _0x212c51=_0x10c6f9[_0x196c5b(0x108)]?'journey':'segment\x20or\x20journey';return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0xe4)+_0x212c51+_0x196c5b(0xda))),0x0;}const _0xccbb0c=new Map();_0x5b3d27[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x108)]&&await withSpinner(_0x196c5b(0x12a),async()=>{await batchAsync(_0x5b3d27,async _0x25c7c4=>{const _0x3e1bc5=a41_0x24bb,_0x58cdcb=await _0x5d06c6['segment'][_0x3e1bc5(0xe2)](_0x4a45b6,_0x25c7c4['id']);_0xccbb0c[_0x3e1bc5(0xeb)](_0x25c7c4['id'],_0x58cdcb);});},{'verbose':_0x10c6f9[_0x196c5b(0x158)]});const {segmentFiles:_0x4ec0c1,foldersToCreate:_0x519e89}=await prepareSegmentFiles(_0xe0cf34,{'segmentByFolderAndName':_0x6d2ffa,'activationsBySegmentId':_0xccbb0c,'folderPathToId':_0x275497,'idToEmailMap':_0x4061c7,'connectionIdToNameMap':_0x3f0316},_0x499e85,_0x40342b,_0x1a4932),_0x35afab=_0x30541f?[]:findSegmentsToDelete(_0x5b3d27,_0xe0cf34['map'](({yamlConfig:_0x33c0a9,folderPath:_0x170013})=>({'yamlConfig':_0x33c0a9,'folderPath':resolveTDFolderPath(_0x170013,_0x40342b,_0x1a4932)})),_0xa58093,_0x1a4932,_0x40342b),{journeyFiles:_0x599e30,foldersToCreate:_0xfec809}=await withProgressSpinner(_0x196c5b(0x132),async _0x1a3022=>prepareJourneyFiles(_0x3bcb18,{'fetchJourney':async _0x634f40=>_0x5d06c6['journey']['getJourney'](_0x634f40[_0x196c5b(0x11a)]),'journeyBundlesByFolderAndName':_0x395c33,'folderPathToId':_0x275497,'idToEmailMap':_0x4061c7,'connectionIdToNameMap':_0x3f0316,'existingSegments':_0x5b3d27,'parentId':_0x4a45b6,'deps':_0x5d06c6,'progress':{'update':_0x3d479b=>{const _0x8eaf6b=_0x196c5b;_0x1a3022[_0x8eaf6b(0xde)](_0x3d479b),_0x10c6f9['verbose']&&console[_0x8eaf6b(0x143)]('\x20\x20'+_0x3d479b);}},'journeyById':_0x3f0d04,'activationStepsById':_0x55021f},_0x40342b,_0x1a4932),{'verbose':_0x10c6f9[_0x196c5b(0x158)]})['then'](_0x3e4d13=>_0x3e4d13[_0x196c5b(0x129)]);for(const _0x97d74a of _0xfec809){_0x519e89['add'](_0x97d74a);}const _0x1fec7e=_0x30541f?[]:findJourneysToDelete(_0x3c32ec,_0x3bcb18['map'](({yamlConfig:_0x162253,folderPath:_0x14b5fd})=>({'yamlConfig':_0x162253,'folderPath':resolveTDFolderPath(_0x14b5fd,_0x40342b,_0x1a4932)})),_0xa58093,_0x1a4932,_0x40342b),_0x1cf8c5=calculatePushStats(_0x4ec0c1,_0x599e30,_0x519e89,_0x35afab,_0x1fec7e,!!_0x10c6f9['delete'],!!_0x10c6f9[_0x196c5b(0x108)]),_0x5c5539=_0x1cf8c5[_0x196c5b(0x130)][_0x196c5b(0xe9)],_0x4e637d=_0x1cf8c5['segments'][_0x196c5b(0xe3)],_0xc4001c=_0x1cf8c5[_0x196c5b(0x130)][_0x196c5b(0x13b)],_0x1bf8b0=_0x1cf8c5[_0x196c5b(0x130)][_0x196c5b(0x10c)],_0x3f7198=_0x1cf8c5[_0x196c5b(0x152)]['toCreate'],_0x13dc8f=_0x1cf8c5[_0x196c5b(0x164)][_0x196c5b(0xe9)],_0x2872d5=_0x1cf8c5[_0x196c5b(0x164)][_0x196c5b(0xe3)],_0x5a3b08=_0x1cf8c5[_0x196c5b(0x164)]['unchanged'],_0x52a3f5=_0x1cf8c5['journeys'][_0x196c5b(0x10c)],_0xc5a832=_0x1cf8c5[_0x196c5b(0xf9)]['all'],_0x188dbb=_0x1cf8c5[_0x196c5b(0xf9)]['toCreate'],_0x42b5b7=_0x1cf8c5['activations'][_0x196c5b(0x144)],_0x448485=_0x1cf8c5['activations']['toDelete'];console[_0x196c5b(0x143)](_0x196c5b(0x101)+_0x2b2394+'\x27:');_0x3f7198[_0x196c5b(0x136)]>0x0&&console[_0x196c5b(0x143)]('\x20\x20'+a41_0x539f4a[_0x196c5b(0xe7)](_0x196c5b(0xec)+_0x3f7198[_0x196c5b(0x136)]+_0x196c5b(0x110)));if(!_0x10c6f9[_0x196c5b(0x108)]){console[_0x196c5b(0x143)](_0x196c5b(0x100)),console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0x127)]('+\x20'+_0x5c5539[_0x196c5b(0x136)]+_0x196c5b(0x163))),console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a['yellow']('~\x20'+_0x4e637d[_0x196c5b(0x136)]+_0x196c5b(0x11c)));if(_0x1bf8b0[_0x196c5b(0x136)]>0x0)console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a['red']('-\x20'+_0x1bf8b0[_0x196c5b(0x136)]+_0x196c5b(0xf1)));else _0x35afab[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x10e)]&&console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a['dim'](_0x35afab[_0x196c5b(0x136)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x196c5b(0x143)]('\x20\x20\x20\x20'+a41_0x539f4a[_0x196c5b(0x149)]('=\x20'+_0xc4001c[_0x196c5b(0x136)]+_0x196c5b(0x116)));}if(_0x599e30['length']>0x0||_0x1fec7e['length']>0x0){console[_0x196c5b(0x143)](_0x196c5b(0x10f)),console['error'](_0x196c5b(0x114)+a41_0x539f4a['green']('+\x20'+_0x13dc8f[_0x196c5b(0x136)]+'\x20new')),console['error'](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0xdc)]('~\x20'+_0x2872d5['length']+_0x196c5b(0x11c)));if(_0x52a3f5['length']>0x0)console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a['red']('-\x20'+_0x52a3f5[_0x196c5b(0x136)]+_0x196c5b(0xf1)));else _0x1fec7e[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x10e)]&&console[_0x196c5b(0x143)]('\x20\x20\x20\x20'+a41_0x539f4a['dim'](_0x1fec7e[_0x196c5b(0x136)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0x149)]('=\x20'+_0x5a3b08['length']+_0x196c5b(0x116)));}_0xc5a832['length']>0x0&&!_0x10c6f9[_0x196c5b(0x108)]&&(console[_0x196c5b(0x143)](''),console[_0x196c5b(0x143)](_0x196c5b(0x106)),_0x188dbb[_0x196c5b(0x136)]>0x0&&console['error'](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0x127)]('+\x20'+_0x188dbb[_0x196c5b(0x136)]+'\x20to\x20create')),_0x42b5b7[_0x196c5b(0x136)]>0x0&&console['error'](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0xdc)]('~\x20'+_0x42b5b7[_0x196c5b(0x136)]+'\x20to\x20update')),_0x448485[_0x196c5b(0x136)]>0x0&&console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0xe5)]('-\x20'+_0x448485['length']+_0x196c5b(0xf1))));console[_0x196c5b(0x143)](_0x196c5b(0x102)+a41_0x539f4a[_0x196c5b(0xfb)](_0x66bf0a)+'\x0a');if(_0x3f7198[_0x196c5b(0x136)]>0x0){console[_0x196c5b(0x143)](_0x196c5b(0x150));for(const _0x352e01 of _0x3f7198){console['error']('\x20\x20'+a41_0x539f4a[_0x196c5b(0xe7)]('+')+'\x20'+_0x352e01);}console['error']('');}if(_0x5c5539[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x108)])for(const _0x597b09 of _0x5c5539){const _0xb42ab3=_0x597b09[_0x196c5b(0x120)]?_0x597b09[_0x196c5b(0x120)]+'/'+_0x597b09[_0x196c5b(0x167)][_0x196c5b(0x147)]:_0x597b09[_0x196c5b(0x167)]['name'],_0x24a700=_0x597b09[_0x196c5b(0x167)][_0x196c5b(0xf9)]?.[_0x196c5b(0x136)]||0x0,_0x531c1a=_0x24a700>0x0?a41_0x539f4a[_0x196c5b(0x149)]('\x20['+_0x24a700+_0x196c5b(0xff)):'';console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0x127)]('New\x20segment:')+'\x20'+_0xb42ab3+_0x531c1a),console['error']('─'['repeat'](0x3c)),_0x597b09[_0x196c5b(0x14a)]&&console[_0x196c5b(0x143)](_0x597b09[_0x196c5b(0x14a)]),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c));}if(_0x1bf8b0[_0x196c5b(0x136)]>0x0&&!_0x10c6f9['journeysOnly'])for(const _0x1529f1 of _0x1bf8b0){const _0x45bd66=_0x1529f1[_0x196c5b(0x118)]?_0xa58093[_0x196c5b(0x13d)](_0x1529f1[_0x196c5b(0x118)][_0x196c5b(0xfe)]())||'':'',_0xd3106=_0x45bd66?_0x45bd66+'/'+_0x1529f1[_0x196c5b(0x147)]:_0x1529f1[_0x196c5b(0x147)],_0x6dc038=_0xccbb0c[_0x196c5b(0x13d)](_0x1529f1['id'])||[],_0xf48e4=_0x6dc038['length']>0x0?a41_0x539f4a[_0x196c5b(0x149)]('\x20['+_0x6dc038[_0x196c5b(0x136)]+_0x196c5b(0xff)):'';console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x138))+'\x20'+_0xd3106+_0xf48e4),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c));const _0x1e60bc=segmentWithActivationsToYaml(_0x1529f1,_0x6dc038,undefined,_0x4061c7,_0x3f0316),_0x425a5b=segmentToYamlString(_0x1e60bc),_0x2736cb=generateDiff(_0x425a5b,'');console['error'](formatDiffWithColors(_0x2736cb)),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c));}const _0x4837cf=_0x4ec0c1['filter'](_0xb9f27c=>!_0xb9f27c[_0x196c5b(0x121)]&&_0xb9f27c[_0x196c5b(0x14a)]);if(_0x4837cf['length']>0x0&&!_0x10c6f9[_0x196c5b(0x108)])for(const _0x4a7a7d of _0x4837cf){const _0xb9e1ef=_0x4a7a7d[_0x196c5b(0x120)]?_0x4a7a7d[_0x196c5b(0x120)]+'/'+_0x4a7a7d['yamlConfig']['name']:_0x4a7a7d[_0x196c5b(0x167)][_0x196c5b(0x147)];console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a['yellow'](_0x196c5b(0x123))+'\x20'+_0xb9e1ef),console['error']('─'[_0x196c5b(0xef)](0x3c)),console['error'](_0x4a7a7d['diff']),console['error']('─'['repeat'](0x3c));}if(_0x13dc8f[_0x196c5b(0x136)]>0x0)for(const _0x26a6a9 of _0x13dc8f){const _0x438c27=_0x26a6a9[_0x196c5b(0x120)]?_0x26a6a9[_0x196c5b(0x120)]+'/'+_0x26a6a9['yamlConfig'][_0x196c5b(0x147)]:_0x26a6a9[_0x196c5b(0x167)][_0x196c5b(0x147)];console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0x127)](_0x196c5b(0x141))+'\x20'+_0x438c27),console['error']('─'['repeat'](0x3c)),_0x26a6a9[_0x196c5b(0x14a)]&&console[_0x196c5b(0x143)](_0x26a6a9[_0x196c5b(0x14a)]),console[_0x196c5b(0x143)]('─'['repeat'](0x3c));}const _0x573b2f=_0x599e30[_0x196c5b(0x145)](_0x28bd8a=>!_0x28bd8a[_0x196c5b(0x121)]&&_0x28bd8a[_0x196c5b(0x14a)]);if(_0x573b2f[_0x196c5b(0x136)]>0x0)for(const _0x5a18e6 of _0x573b2f){const _0x3db0e6=_0x5a18e6[_0x196c5b(0x120)]?_0x5a18e6[_0x196c5b(0x120)]+'/'+_0x5a18e6[_0x196c5b(0x167)][_0x196c5b(0x147)]:_0x5a18e6[_0x196c5b(0x167)][_0x196c5b(0x147)];console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0xdc)]('Changes\x20to\x20journey:')+'\x20'+_0x3db0e6),console['error']('─'['repeat'](0x3c)),console[_0x196c5b(0x143)](_0x5a18e6[_0x196c5b(0x14a)]),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c));}if(_0x52a3f5[_0x196c5b(0x136)]>0x0)for(const _0x2f40de of _0x52a3f5){const _0x2c4926=_0x2f40de[_0x196c5b(0x125)]?_0xa58093[_0x196c5b(0x13d)](_0x2f40de['folderId'])||'':'',_0x5224d9=_0x2c4926?_0x2c4926+'/'+_0x2f40de['journeyBundleName']:_0x2f40de['journeyBundleName'];console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x146))+'\x20'+_0x5224d9),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c)),console['error'](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x148))),console['error']('─'[_0x196c5b(0xef)](0x3c));}if(_0x10c6f9[_0x196c5b(0x14f)])return console['error'](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0x10d))),0x0;const _0x322727=_0x10c6f9[_0x196c5b(0x108)]?![]:_0x5c5539[_0x196c5b(0x136)]>0x0||_0x4e637d[_0x196c5b(0x136)]>0x0||_0x1bf8b0[_0x196c5b(0x136)]>0x0,_0x12d4ee=_0x13dc8f[_0x196c5b(0x136)]>0x0||_0x2872d5[_0x196c5b(0x136)]>0x0||_0x52a3f5[_0x196c5b(0x136)]>0x0,_0x35b042=_0x10c6f9[_0x196c5b(0x108)]?![]:_0xc5a832[_0x196c5b(0x136)]>0x0,_0xa1363d=_0x3f7198[_0x196c5b(0x136)]>0x0;if(!_0x322727&&!_0x12d4ee&&!_0x35b042&&!_0xa1363d){const _0x4d60bd=_0x10c6f9['journeysOnly']?_0x196c5b(0x139):_0x196c5b(0x154);console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0x127)](_0x4d60bd));if(_0x30541f&&_0xc4001c['length']===0x1){const _0x104fd9=_0xc4001c[0x0];if(_0x104fd9['existingSegment']?.['id']){const _0x496b01=getConsoleNextUrl(_0x10c6f9[_0x196c5b(0xea)],_0x196c5b(0x165)+_0x4a45b6+_0x196c5b(0xe0)+_0x104fd9['existingSegment']['id']+_0x196c5b(0x131));console[_0x196c5b(0x143)](_0x196c5b(0x15a)+a41_0x539f4a[_0x196c5b(0xfb)](_0x496b01));}}if(_0x30541f&&_0x5a3b08[_0x196c5b(0x136)]===0x1){const _0xede0cf=_0x5a3b08[0x0];if(_0xede0cf[_0x196c5b(0x113)]?.['id']){const _0x55644b=getConsoleNextUrl(_0x10c6f9[_0x196c5b(0xea)],_0x196c5b(0x165)+_0x4a45b6+_0x196c5b(0xe0)+_0xede0cf[_0x196c5b(0x113)]['id']+'/j/da/je');console[_0x196c5b(0x143)]('\x20\x20'+a41_0x539f4a[_0x196c5b(0xfb)](_0x55644b));}}return 0x0;}const _0x25901d=_0x10c6f9[_0x196c5b(0x108)]?_0x13dc8f[_0x196c5b(0x136)]+_0x2872d5[_0x196c5b(0x136)]+_0x52a3f5['length']+_0x3f7198[_0x196c5b(0x136)]:_0x5c5539[_0x196c5b(0x136)]+_0x4e637d[_0x196c5b(0x136)]+_0x1bf8b0['length']+_0x13dc8f[_0x196c5b(0x136)]+_0x2872d5[_0x196c5b(0x136)]+_0x52a3f5['length']+_0x3f7198[_0x196c5b(0x136)]+_0xc5a832['length'];if(!_0x10c6f9['yes']&&_0x25901d>0x0){if(!isInteractive())return console[_0x196c5b(0x143)](a41_0x539f4a['red']('\x0aError:'),_0x196c5b(0xfc)),console['error'](a41_0x539f4a[_0x196c5b(0x149)](_0x196c5b(0xe1))),0x1;const _0x423b99=await confirmKey(_0x196c5b(0xe6)+_0x25901d+_0x196c5b(0xfa));if(!_0x423b99)return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0x162))),0x1;}const _0x2a237e={'withProgress':async(_0x2cd1d6,_0x481fe2)=>{const _0x2337a5=_0x196c5b,_0x3d8e44=await withSpinner(_0x2cd1d6,_0x481fe2,{'verbose':_0x10c6f9[_0x2337a5(0x158)]});return{'data':_0x3d8e44['data']};},'logInfo':_0x114992=>console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe7)]('✔\x20'+_0x114992)),'logSuccess':_0x3ac21d=>console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0x127)]('✔\x20'+_0x3ac21d)),'logWarning':_0x127d7d=>console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xdc)]('⚠\x20'+_0x127d7d)),'logDeleted':_0x55d0e0=>console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe5)]('✔\x20'+_0x55d0e0))},_0x145085={'segment':_0x5d06c6['segment'],'journey':_0x5d06c6[_0x196c5b(0x12e)],'user':_0x5d06c6[_0x196c5b(0x11f)],'connection':_0x5d06c6[_0x196c5b(0x137)]};_0x3f7198[_0x196c5b(0x136)]>0x0&&(_0x275497=await executePushFolders(_0x145085,_0x3f7198,_0x275497,{'parentId':_0x4a45b6},_0x2a237e));const _0x2545d3={'rootFolderId':_0x536095,'folderPathToId':_0x275497,'folderIdToPath':_0xa58093,'segmentNameToId':_0x2871fb,'activationsBySegmentId':_0xccbb0c,'emailToIdMap':_0x46d96c,'idToEmailMap':_0x4061c7,'connectionNameToIdMap':_0xec8959['nameToId'],'connectionIdToNameMap':_0xec8959[_0x196c5b(0x12b)],'connectionNameToTypeMap':_0x3de0e5},_0x46edcd=await executePushSegments(_0x145085,_0x10c6f9[_0x196c5b(0x108)]?[]:_0x4ec0c1,_0x2545d3,{'parentId':_0x4a45b6},_0x2a237e),_0x18be16=_0x46edcd[_0x196c5b(0x124)],_0x2142c4=_0x46edcd[_0x196c5b(0x111)],_0x620927=_0x46edcd[_0x196c5b(0xf9)][_0x196c5b(0x124)],_0x1d055f=_0x46edcd[_0x196c5b(0xf9)][_0x196c5b(0x111)],_0x45b286=_0x46edcd[_0x196c5b(0xf9)][_0x196c5b(0xe8)];let _0x1b8dce;if(_0x30541f&&_0x4ec0c1[_0x196c5b(0x136)]===0x1){const _0x25041f=_0x4ec0c1[0x0];_0x1b8dce=_0x25041f['existingSegment']?.['id']??_0x46edcd[_0x196c5b(0x135)][_0x196c5b(0x13d)](_0x25041f['yamlConfig'][_0x196c5b(0x147)]);}const _0xf7ad8c=await executePushSegmentDeletions(_0x145085,_0x10c6f9[_0x196c5b(0x108)]?[]:_0x1bf8b0,_0x2a237e);let _0x6228ea=0x0,_0x553371=0x0,_0x103789=0x0;const _0x15f572=new Map(_0x2871fb);for(const [_0x1c957d,_0x2658ad]of _0x46edcd[_0x196c5b(0x135)]){_0x15f572[_0x196c5b(0xeb)](_0x1c957d,_0x2658ad);}if(_0x599e30['length']>0x0){const _0x206ce5={..._0x2545d3,'segmentNameToId':_0x15f572,'existingSegments':_0x5b3d27,'activationContext':_0x499e85},_0x291b1d=await executePushJourneys(_0x145085,_0x599e30,_0x206ce5,{'parentId':_0x4a45b6,'rootFolderId':_0x536095,'verbose':_0x10c6f9[_0x196c5b(0x158)]},_0x2a237e);_0x6228ea=_0x291b1d[_0x196c5b(0x124)],_0x553371=_0x291b1d[_0x196c5b(0x111)];if(_0x30541f&&_0x291b1d[_0x196c5b(0x14c)]['length']===0x1){const _0x304d7c=_0x291b1d['results'][0x0];if(_0x304d7c[_0x196c5b(0x11a)]){const _0x41c3bb=getConsoleNextUrl(_0x10c6f9[_0x196c5b(0xea)],_0x196c5b(0x165)+_0x4a45b6+_0x196c5b(0xe0)+_0x304d7c['journeyId']+'/j/da/je');console['error']('\x20\x20'+a41_0x539f4a[_0x196c5b(0xfb)](_0x41c3bb));}}}for(const _0x414691 of _0x52a3f5){console['error'](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0x15c)+_0x414691[_0x196c5b(0x14b)])),_0x103789++;}const _0x32ff7f=[];if(_0x18be16>0x0)_0x32ff7f[_0x196c5b(0x109)](_0x18be16+'\x20created');if(_0x2142c4>0x0)_0x32ff7f[_0x196c5b(0x109)](_0x2142c4+_0x196c5b(0x166));if(_0xf7ad8c>0x0)_0x32ff7f[_0x196c5b(0x109)](_0xf7ad8c+_0x196c5b(0x105));const _0x5a22d4=[];if(_0x6228ea>0x0)_0x5a22d4[_0x196c5b(0x109)](_0x6228ea+_0x196c5b(0x10a));if(_0x553371>0x0)_0x5a22d4[_0x196c5b(0x109)](_0x553371+_0x196c5b(0x166));if(_0x103789>0x0)_0x5a22d4[_0x196c5b(0x109)](_0x103789+_0x196c5b(0x105));const _0x283be8=[];if(_0x620927>0x0)_0x283be8[_0x196c5b(0x109)](_0x620927+_0x196c5b(0x10a));if(_0x1d055f>0x0)_0x283be8[_0x196c5b(0x109)](_0x1d055f+'\x20updated');if(_0x45b286>0x0)_0x283be8[_0x196c5b(0x109)](_0x45b286+_0x196c5b(0x105));console[_0x196c5b(0x143)](a41_0x539f4a['green']('\x0a✔\x20Push\x20complete'));_0x32ff7f['length']>0x0&&!_0x10c6f9[_0x196c5b(0x108)]&&console[_0x196c5b(0x143)]('\x20\x20Segments:\x20'+_0x32ff7f[_0x196c5b(0x160)](',\x20'));_0x5a22d4[_0x196c5b(0x136)]>0x0&&console[_0x196c5b(0x143)](_0x196c5b(0x15d)+_0x5a22d4[_0x196c5b(0x160)](',\x20'));_0x283be8[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x108)]&&console[_0x196c5b(0x143)]('\x20\x20Activations:\x20'+_0x283be8[_0x196c5b(0x160)](',\x20'));if(_0x1b8dce){const _0x5220a8=getConsoleNextUrl(_0x10c6f9['site'],_0x196c5b(0x165)+_0x4a45b6+_0x196c5b(0xe0)+_0x1b8dce+'/sb/da/esr');console[_0x196c5b(0x143)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x539f4a[_0x196c5b(0xfb)](_0x5220a8));}return 0x0;}}function a41_0x30e5(){const _0x81e83b=['journeysOnly','push','\x20created','no_parent','toDelete','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','delete','\x20\x20🗺️\x20\x20Journeys:','\x20folders\x20to\x20create','updated','parentFolder','existingJourney','\x20\x20\x20\x20','state','\x20unchanged','then','segmentFolderId','execute','journeyId','1052785FKWAyy','\x20changed','\x27...','isScoped','user','folderPath','isNew','4995570GLJrte','Changes\x20to:','created','folderId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','green','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','data','Fetching\x20existing\x20activations...','idToName','list','620864ywmNfY','journey','\x0aValidation\x20failed:','segments','/sb/da/esr','Preparing\x20journeys...','Scoped\x20to\x20folder:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','createdSegmentIds','length','connection','Delete\x20segment:','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','audienceId','unchanged','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','get','all','3428412suPEHn','4424024NKkVYW','New\x20journey:','Resolving\x20parent\x20segment\x20\x27','error','toUpdate','filter','Delete\x20journey:','name','(Journey\x20will\x20be\x20deleted)','dim','diff','journeyBundleName','results','createdAt','attributes','dryRun','Folders\x20to\x20create:','7188273hmHpoL','folders','helpText','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Source\x20directory:\x20','type','12005875GUzuOG','verbose','segment','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','getParent','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20\x20Journeys:\x20','scopedFolderPath','listSegments','join','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Aborted.','\x20new','journeys','/app/ps/','\x20updated','yamlConfig','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20YAML\x20files\x20found','journeyBundleId','yellow','description','setPhase','5PInYgX','/e/','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','listActivations','changed','No\x20','red','Push\x20','blue','deleted','new','site','set','📁\x20','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)','map','repeat','errorCode','\x20to\x20delete','8HdzmYN','endsWith','segment:push','targetDir','.yaml','file','Fetching\x20existing\x20data...','activations','\x20changes?','cyan','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Parent\x20segment:\x20','toString','\x20activations]','\x20\x20📊\x20Segments:','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Source:\x20','listJourneysWithDetailsFromParentSegment','nameToId','\x20deleted','\x20\x20Activations:','Error:\x20Directory\x20not\x20found:\x20'];a41_0x30e5=function(){return _0x81e83b;};return a41_0x30e5();}
1
+ const a41_0x79893=a41_0x340d;(function(_0x48b58f,_0x6326e2){const _0x30c834=a41_0x340d,_0x47f288=_0x48b58f();while(!![]){try{const _0x21295c=parseInt(_0x30c834(0xc7))/0x1*(-parseInt(_0x30c834(0x110))/0x2)+-parseInt(_0x30c834(0xd9))/0x3+-parseInt(_0x30c834(0x12c))/0x4+parseInt(_0x30c834(0xe5))/0x5*(-parseInt(_0x30c834(0x11e))/0x6)+parseInt(_0x30c834(0x12b))/0x7*(parseInt(_0x30c834(0xb7))/0x8)+-parseInt(_0x30c834(0xd8))/0x9+parseInt(_0x30c834(0x136))/0xa;if(_0x21295c===_0x6326e2)break;else _0x47f288['push'](_0x47f288['shift']());}catch(_0x278542){_0x47f288['push'](_0x47f288['shift']());}}}(a41_0xf5da,0x49ead));import{BaseCommand}from'./command.js';function a41_0x340d(_0x560fcb,_0x5cbb6b){_0x560fcb=_0x560fcb-0xaa;const _0xf5da4=a41_0xf5da();let _0x340d09=_0xf5da4[_0x560fcb];return _0x340d09;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0xf5da(){const _0x3248bc=['\x20activations]','folderId','\x20changes?','activations','\x20\x20Activations:','endsWith','new','\x20updated','Error:\x20Directory\x20not\x20found:\x20','\x20to\x20delete','name','\x20\x20🗺️\x20\x20Journeys:','121824csiOoq','site','Changes\x20to\x20journey:','journeyBundleName','red','paused','journey','Preparing\x20journeys...','folderPath','created','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','yamlConfig','parent_name','\x20\x20Activations:\x20','\x20to\x20update','\x20\x20Segments:\x20','285133bfnTzZ','getJourney','Push\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','journeyBundleId','error','Delete\x20segment:','updatedAt','listFolders','Folders\x20to\x20create:','/e/','Parent\x20segment:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20changed','results','3617622vkzRHE','352647ZipcqR','Delete\x20journey:','existingJourney','\x20\x20\x20\x20','setPhase','/j/da/je','\x20folders\x20to\x20create','deleted','unchanged','scopedFolderPath','journeyId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','965aiFzkD','parentName','segment\x20or\x20journey','createdSegmentIds','Aborted.','toString','journeysOnly','\x20deleted','Error\x20parsing\x20YAML:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','isNew','\x20created','repeat','.yml','isScoped','description','\x27...','/sb/da/esr','\x20\x20Journeys:\x20','parentFolder','\x20unchanged','Fetching\x20connections\x20for\x20name\x20resolution...','push','diff','New\x20segment:','getParent','dryRun','listJourneysWithDetailsFromParentSegment','\x0aValidation\x20failed:','toDelete','errorCode','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','segment:push','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','length','listSegments','execute','Error:\x20','\x0a✔\x20Push\x20complete','relationships','\x20YAML\x20files\x20found','yellow','journeys','4KZLGGk','Changes\x20to:','get','green','segment','toCreate','/app/ps/','nameToType','connection','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)','\x0aPush\x20summary\x20for\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','segmentFolderId','delete','8634DamhlS','filePath','\x20new','folders','data','type','existingSegment','segments','parentSegment','.yaml','then','verbose','📁\x20','245xQVroj','1975280vjqgPn','listActivations','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','(Journey\x20will\x20be\x20deleted)','cyan','helpText','filter','map','\x20\x20📊\x20Segments:','user','16311050HfgNDr','blue','attributes','all','idToName','dim','nameToId','no_parent','cwd','toUpdate','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','join','\x20to\x20create','updated','add'];a41_0xf5da=function(){return _0x3248bc;};return a41_0xf5da();}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_0x2f0101 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a41_0x79893(0x105);[a41_0x79893(0xf4)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0x79893(0x109)](_0x4e803d){const _0x22acb8=a41_0x79893,{options:_0x1a8143,args:_0x36db88,tdx:_0x1e52a1}=_0x4e803d,_0x1b9e3c=_0x1a8143,_0x4affcf=await resolveTarget({'arg':_0x36db88[0x0],'contextParent':_0x1a8143[_0x22acb8(0x126)],'cwd':process[_0x22acb8(0x13e)]()});if(!isSuccessfulResolution(_0x4affcf))return _0x4affcf[_0x22acb8(0x103)]===_0x22acb8(0x13d)?(console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xc1))),console[_0x22acb8(0xcc)](_0x22acb8(0x119)),console[_0x22acb8(0xcc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x22acb8(0xcc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0x10a)+_0x4affcf['message']+'\x0a')),_0x4affcf['helpText']&&console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x130)](_0x4affcf[_0x22acb8(0x131)]))),0x1;if(_0x4affcf[_0x22acb8(0x123)]===_0x22acb8(0xc3))return console['error'](a41_0x2f0101[_0x22acb8(0xbb)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4affcf['targetDir']+'\x0a')),console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x130)](_0x22acb8(0xe4))),0x1;const _0x132128=_0x4affcf[_0x22acb8(0xe6)],_0x21a5b5=_0x4affcf['targetDir'],_0x815ab4=_0x4affcf['type']==='file'?_0x4affcf[_0x22acb8(0x11f)]:undefined,_0x3874ae=getScopedDetails(_0x4affcf),_0x2279a7=_0x3874ae?.[_0x22acb8(0xf3)]??![],_0x326f80=_0x3874ae?.[_0x22acb8(0xe2)]??'';if(!existsSync(_0x21a5b5))return console[_0x22acb8(0xcc)](a41_0x2f0101['red'](_0x22acb8(0xb3)+_0x21a5b5+'\x0a')),console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x130)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x1b9e3c[_0x22acb8(0x129)]&&(console[_0x22acb8(0xcc)]('Site:\x20'+_0x1b9e3c[_0x22acb8(0xb8)]),console['error'](_0x22acb8(0xd2)+_0x132128),console[_0x22acb8(0xcc)]('Source\x20directory:\x20'+_0x21a5b5),_0x2279a7&&console[_0x22acb8(0xcc)]('Scoped\x20to\x20folder:\x20'+_0x326f80));const _0x2317a7=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x132128+_0x22acb8(0xf5),()=>_0x1e52a1[_0x22acb8(0x114)]['resolveParentId'](_0x132128),{'verbose':_0x1b9e3c[_0x22acb8(0x129)]}),_0x4f0c6f=_0x2317a7[_0x22acb8(0x122)],{parentSegmentResult:_0x3bb183,segmentsResult:_0x4b6c67,foldersResult:_0x12601b,journeysWithDetailsResult:_0x31acfc,userMaps:_0x4c2425}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x3f779e=_0x22acb8,[_0x14fbd7,_0x4822d4,_0x13a486,_0x47238b,_0xa59a62]=await Promise[_0x3f779e(0x139)]([_0x1e52a1['segment'][_0x3f779e(0xfe)](_0x4f0c6f),_0x1e52a1[_0x3f779e(0x114)][_0x3f779e(0x108)](_0x4f0c6f),_0x1e52a1[_0x3f779e(0x114)][_0x3f779e(0xcf)](_0x4f0c6f),_0x1e52a1['journey'][_0x3f779e(0x100)](_0x4f0c6f,{'includeAllVersions':!![]}),_0x1e52a1[_0x3f779e(0x135)]['buildUserMaps']()]);return{'parentSegmentResult':_0x14fbd7,'segmentsResult':_0x4822d4,'foldersResult':_0x13a486,'journeysWithDetailsResult':_0x47238b,'userMaps':_0xa59a62};},{'verbose':_0x1b9e3c[_0x22acb8(0x129)]})[_0x22acb8(0x128)](_0xe6f814=>_0xe6f814['data']),_0x10f0d3=_0x3bb183,_0x2e6077=extractRootFolderId(_0x10f0d3),_0x14b892=_0x4b6c67,_0x32733a=_0x12601b,{journeys:_0xff83d5,activationStepsById:_0x8feedb}=_0x31acfc,_0xa15b21=new Map(_0xff83d5['map'](_0x394a43=>[_0x394a43['id'],_0x394a43])),_0x1be8d3=_0xff83d5[_0x22acb8(0x133)](_0x713bc9=>({'id':_0x713bc9['id'],'name':_0x713bc9[_0x22acb8(0x138)]['name'],'journeyBundleName':_0x713bc9['attributes'][_0x22acb8(0xba)]||'','journeyBundleId':_0x713bc9['attributes'][_0x22acb8(0xcb)]||'','versionNumber':_0x713bc9[_0x22acb8(0x138)]['versionNumber'],'description':_0x713bc9[_0x22acb8(0x138)][_0x22acb8(0xf4)],'state':_0x713bc9['attributes']['state'],'paused':_0x713bc9[_0x22acb8(0x138)][_0x22acb8(0xbc)],'audienceId':_0x713bc9[_0x22acb8(0x138)]['audienceId'],'folderId':_0x713bc9[_0x22acb8(0x10c)]?.[_0x22acb8(0xf8)]?.[_0x22acb8(0x122)]?.['id'],'createdAt':_0x713bc9[_0x22acb8(0x138)]['createdAt'],'updatedAt':_0x713bc9[_0x22acb8(0x138)][_0x22acb8(0xce)]})),{emailToId:_0x189968,idToEmail:_0x4ac6b}=_0x4c2425,_0x4701ef=await withSpinner(_0x22acb8(0xfa),async()=>{const _0x45b7d0=_0x22acb8,_0x57f05f=await _0x1e52a1[_0x45b7d0(0x118)]['list']();return buildConnectionMaps(_0x57f05f);},{'verbose':_0x1b9e3c['verbose']})[_0x22acb8(0x128)](_0xcde134=>_0xcde134[_0x22acb8(0x122)]),_0x15d62f=_0x4701ef[_0x22acb8(0x13c)],_0x23db79=_0x4701ef[_0x22acb8(0x13a)],_0xa43f3c=_0x4701ef[_0x22acb8(0x117)],_0xddf6b3={'emailToIdMap':_0x189968,'connectionNameToIdMap':_0x15d62f,'connectionNameToTypeMap':_0xa43f3c,'getSchema':_0x45ab59=>_0x1e52a1[_0x22acb8(0x118)]['getOutputSchemaWithCache'](_0x45ab59)};let {pathToId:_0x5e69c9,idToPath:_0x3d6fb6}=buildFolderMaps(_0x32733a);const _0x1421a6=buildSegmentLookupMap(_0x14b892,_0x3d6fb6),_0x193102=buildSegmentNameToIdMap(_0x14b892),_0x30d30d=buildJourneyBundleLookupMap(_0x1be8d3,_0x3d6fb6);let _0x4494d3;if(_0x815ab4){if(!_0x815ab4['endsWith'](_0x22acb8(0xf2))&&!_0x815ab4[_0x22acb8(0xb0)](_0x22acb8(0x127)))return console['error'](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0x11b)+_0x815ab4+'\x0a')),0x1;_0x4494d3=[_0x815ab4];}else _0x4494d3=findYamlFiles(_0x21a5b5);if(_0x4494d3[_0x22acb8(0x107)]===0x0)return console['error'](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0x104)+_0x21a5b5+'\x0a')),console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x130)](_0x22acb8(0xd3))),0x1;let _0x1ca83c,_0x5c001b;try{const _0x3096ca=parseAndClassifyYamlFiles(_0x4494d3,_0x21a5b5,{'skipSegments':_0x1b9e3c['journeysOnly']});_0x1ca83c=_0x3096ca[_0x22acb8(0x125)],_0x5c001b=_0x3096ca[_0x22acb8(0x10f)];const _0x1e6fc4=validateParsedFiles(_0x3096ca,_0x21a5b5);if(_0x1e6fc4['length']>0x0)return console['error'](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0x101))),console['error'](formatValidationErrors(_0x1e6fc4)),console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xd4))),0x1;}catch(_0x582bfe){return console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0xed)+(_0x582bfe instanceof Error?_0x582bfe['message']:_0x582bfe))),0x1;}if(_0x1ca83c[_0x22acb8(0x107)]===0x0&&_0x5c001b[_0x22acb8(0x107)]===0x0){const _0x217c20=_0x1b9e3c['journeysOnly']?_0x22acb8(0xbd):_0x22acb8(0xe7);return console['error'](a41_0x2f0101[_0x22acb8(0x10e)]('No\x20'+_0x217c20+_0x22acb8(0x10d))),0x0;}const _0x38f6c5=new Map();_0x14b892[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x14b892,async _0x209b1a=>{const _0x4bbaf5=a41_0x340d,_0x54a424=await _0x1e52a1[_0x4bbaf5(0x114)][_0x4bbaf5(0x12d)](_0x4f0c6f,_0x209b1a['id']);_0x38f6c5['set'](_0x209b1a['id'],_0x54a424);});},{'verbose':_0x1b9e3c[_0x22acb8(0x129)]});const {segmentFiles:_0x589139,foldersToCreate:_0x1855f2}=await prepareSegmentFiles(_0x1ca83c,{'segmentByFolderAndName':_0x1421a6,'activationsBySegmentId':_0x38f6c5,'folderPathToId':_0x5e69c9,'idToEmailMap':_0x4ac6b,'connectionIdToNameMap':_0x23db79},_0xddf6b3,_0x2279a7,_0x326f80),_0x117c02=_0x815ab4?[]:findSegmentsToDelete(_0x14b892,_0x1ca83c[_0x22acb8(0x133)](({yamlConfig:_0x203a02,folderPath:_0x28fb63})=>({'yamlConfig':_0x203a02,'folderPath':resolveTDFolderPath(_0x28fb63,_0x2279a7,_0x326f80)})),_0x3d6fb6,_0x326f80,_0x2279a7),{journeyFiles:_0x19e079,foldersToCreate:_0x290b68}=await withProgressSpinner(_0x22acb8(0xbe),async _0x51e617=>prepareJourneyFiles(_0x5c001b,{'fetchJourney':async _0x4e756b=>_0x1e52a1[_0x22acb8(0xbd)][_0x22acb8(0xc8)](_0x4e756b[_0x22acb8(0xe3)]),'journeyBundlesByFolderAndName':_0x30d30d,'folderPathToId':_0x5e69c9,'idToEmailMap':_0x4ac6b,'connectionIdToNameMap':_0x23db79,'existingSegments':_0x14b892,'parentId':_0x4f0c6f,'deps':_0x1e52a1,'progress':{'update':_0x219863=>{const _0x48074f=_0x22acb8;_0x51e617[_0x48074f(0xdd)](_0x219863),_0x1b9e3c[_0x48074f(0x129)]&&console[_0x48074f(0xcc)]('\x20\x20'+_0x219863);}},'journeyById':_0xa15b21,'activationStepsById':_0x8feedb},_0x2279a7,_0x326f80),{'verbose':_0x1b9e3c['verbose']})[_0x22acb8(0x128)](_0x4bf370=>_0x4bf370[_0x22acb8(0x122)]);for(const _0x38468e of _0x290b68){_0x1855f2[_0x22acb8(0xaa)](_0x38468e);}const _0x45b9fa=_0x815ab4?[]:findJourneysToDelete(_0x1be8d3,_0x5c001b[_0x22acb8(0x133)](({yamlConfig:_0x2ed121,folderPath:_0x1bbf34})=>({'yamlConfig':_0x2ed121,'folderPath':resolveTDFolderPath(_0x1bbf34,_0x2279a7,_0x326f80)})),_0x3d6fb6,_0x326f80,_0x2279a7),_0x28de9b=calculatePushStats(_0x589139,_0x19e079,_0x1855f2,_0x117c02,_0x45b9fa,!!_0x1b9e3c['delete'],!!_0x1b9e3c[_0x22acb8(0xeb)]),_0x3eee29=_0x28de9b[_0x22acb8(0x125)]['new'],_0x5e12d7=_0x28de9b[_0x22acb8(0x125)]['changed'],_0x219fa0=_0x28de9b[_0x22acb8(0x125)]['unchanged'],_0x323e17=_0x28de9b['segments'][_0x22acb8(0x102)],_0x545702=_0x28de9b[_0x22acb8(0x121)][_0x22acb8(0x115)],_0x4d3292=_0x28de9b[_0x22acb8(0x10f)][_0x22acb8(0xb1)],_0x5d5768=_0x28de9b[_0x22acb8(0x10f)]['changed'],_0x289481=_0x28de9b[_0x22acb8(0x10f)][_0x22acb8(0xe1)],_0x38900e=_0x28de9b[_0x22acb8(0x10f)][_0x22acb8(0x102)],_0x2b28e1=_0x28de9b[_0x22acb8(0xae)]['all'],_0x360e8f=_0x28de9b[_0x22acb8(0xae)]['toCreate'],_0x177dba=_0x28de9b[_0x22acb8(0xae)][_0x22acb8(0x13f)],_0x2de805=_0x28de9b[_0x22acb8(0xae)]['toDelete'];console[_0x22acb8(0xcc)](_0x22acb8(0x11a)+_0x132128+'\x27:');_0x545702[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)]('\x20\x20'+a41_0x2f0101[_0x22acb8(0x137)](_0x22acb8(0x12a)+_0x545702[_0x22acb8(0x107)]+_0x22acb8(0xdf)));if(!_0x1b9e3c['journeysOnly']){console[_0x22acb8(0xcc)](_0x22acb8(0x134)),console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x113)]('+\x20'+_0x3eee29['length']+_0x22acb8(0x120))),console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x10e)]('~\x20'+_0x5e12d7[_0x22acb8(0x107)]+_0x22acb8(0xd6)));if(_0x323e17[_0x22acb8(0x107)]>0x0)console[_0x22acb8(0xcc)]('\x20\x20\x20\x20'+a41_0x2f0101[_0x22acb8(0xbb)]('-\x20'+_0x323e17[_0x22acb8(0x107)]+_0x22acb8(0xb4)));else _0x117c02[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0x11d)]&&console['error'](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x13b)](_0x117c02[_0x22acb8(0x107)]+_0x22acb8(0x106)));console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x13b)]('=\x20'+_0x219fa0[_0x22acb8(0x107)]+_0x22acb8(0xf9)));}if(_0x19e079[_0x22acb8(0x107)]>0x0||_0x45b9fa[_0x22acb8(0x107)]>0x0){console[_0x22acb8(0xcc)](_0x22acb8(0xb6)),console['error']('\x20\x20\x20\x20'+a41_0x2f0101[_0x22acb8(0x113)]('+\x20'+_0x4d3292['length']+_0x22acb8(0x120))),console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x10e)]('~\x20'+_0x5d5768[_0x22acb8(0x107)]+_0x22acb8(0xd6)));if(_0x38900e[_0x22acb8(0x107)]>0x0)console['error'](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0xbb)]('-\x20'+_0x38900e[_0x22acb8(0x107)]+'\x20to\x20delete'));else _0x45b9fa['length']>0x0&&!_0x1b9e3c[_0x22acb8(0x11d)]&&console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x13b)](_0x45b9fa[_0x22acb8(0x107)]+_0x22acb8(0x106)));console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x13b)]('=\x20'+_0x289481[_0x22acb8(0x107)]+'\x20unchanged'));}_0x2b28e1[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0xeb)]&&(console[_0x22acb8(0xcc)](''),console[_0x22acb8(0xcc)](_0x22acb8(0xaf)),_0x360e8f[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101['green']('+\x20'+_0x360e8f[_0x22acb8(0x107)]+_0x22acb8(0x142))),_0x177dba[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x10e)]('~\x20'+_0x177dba[_0x22acb8(0x107)]+_0x22acb8(0xc5))),_0x2de805[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0xbb)]('-\x20'+_0x2de805['length']+_0x22acb8(0xb4))));console[_0x22acb8(0xcc)]('\x20\x20Source:\x20'+a41_0x2f0101[_0x22acb8(0x130)](_0x21a5b5)+'\x0a');if(_0x545702['length']>0x0){console[_0x22acb8(0xcc)](_0x22acb8(0xd0));for(const _0x1c22f3 of _0x545702){console[_0x22acb8(0xcc)]('\x20\x20'+a41_0x2f0101[_0x22acb8(0x137)]('+')+'\x20'+_0x1c22f3);}console[_0x22acb8(0xcc)]('');}if(_0x3eee29[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0xeb)])for(const _0x51bd9b of _0x3eee29){const _0x265838=_0x51bd9b[_0x22acb8(0xbf)]?_0x51bd9b[_0x22acb8(0xbf)]+'/'+_0x51bd9b[_0x22acb8(0xc2)][_0x22acb8(0xb5)]:_0x51bd9b[_0x22acb8(0xc2)][_0x22acb8(0xb5)],_0x264502=_0x51bd9b[_0x22acb8(0xc2)][_0x22acb8(0xae)]?.['length']||0x0,_0x269843=_0x264502>0x0?a41_0x2f0101[_0x22acb8(0x13b)]('\x20['+_0x264502+_0x22acb8(0xab)):'';console['error']('\x0a'+a41_0x2f0101[_0x22acb8(0x113)](_0x22acb8(0xfd))+'\x20'+_0x265838+_0x269843),console['error']('─'[_0x22acb8(0xf1)](0x3c)),_0x51bd9b[_0x22acb8(0xfc)]&&console[_0x22acb8(0xcc)](_0x51bd9b[_0x22acb8(0xfc)]),console[_0x22acb8(0xcc)]('─'['repeat'](0x3c));}if(_0x323e17[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0xeb)])for(const _0x684a5e of _0x323e17){const _0x4bd6fb=_0x684a5e[_0x22acb8(0x11c)]?_0x3d6fb6[_0x22acb8(0x112)](_0x684a5e[_0x22acb8(0x11c)][_0x22acb8(0xea)]())||'':'',_0x5b334e=_0x4bd6fb?_0x4bd6fb+'/'+_0x684a5e['name']:_0x684a5e[_0x22acb8(0xb5)],_0x361b3f=_0x38f6c5[_0x22acb8(0x112)](_0x684a5e['id'])||[],_0x3c60ab=_0x361b3f[_0x22acb8(0x107)]>0x0?a41_0x2f0101[_0x22acb8(0x13b)]('\x20['+_0x361b3f[_0x22acb8(0x107)]+_0x22acb8(0xab)):'';console[_0x22acb8(0xcc)]('\x0a'+a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0xcd))+'\x20'+_0x5b334e+_0x3c60ab),console['error']('─'[_0x22acb8(0xf1)](0x3c));const _0x213862=segmentWithActivationsToYaml(_0x684a5e,_0x361b3f,undefined,_0x4ac6b,_0x23db79),_0x50a69e=segmentToYamlString(_0x213862),_0x5e4aea=generateDiff(_0x50a69e,'');console['error'](formatDiffWithColors(_0x5e4aea)),console[_0x22acb8(0xcc)]('─'[_0x22acb8(0xf1)](0x3c));}const _0x3521ad=_0x589139[_0x22acb8(0x132)](_0x2a0661=>!_0x2a0661[_0x22acb8(0xef)]&&_0x2a0661[_0x22acb8(0xfc)]);if(_0x3521ad[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c['journeysOnly'])for(const _0x470f13 of _0x3521ad){const _0x93d89f=_0x470f13['folderPath']?_0x470f13['folderPath']+'/'+_0x470f13[_0x22acb8(0xc2)][_0x22acb8(0xb5)]:_0x470f13[_0x22acb8(0xc2)][_0x22acb8(0xb5)];console[_0x22acb8(0xcc)]('\x0a'+a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0x111))+'\x20'+_0x93d89f),console[_0x22acb8(0xcc)]('─'[_0x22acb8(0xf1)](0x3c)),console[_0x22acb8(0xcc)](_0x470f13[_0x22acb8(0xfc)]),console[_0x22acb8(0xcc)]('─'[_0x22acb8(0xf1)](0x3c));}if(_0x4d3292[_0x22acb8(0x107)]>0x0)for(const _0x5d4e77 of _0x4d3292){const _0x211506=_0x5d4e77[_0x22acb8(0xbf)]?_0x5d4e77[_0x22acb8(0xbf)]+'/'+_0x5d4e77['yamlConfig'][_0x22acb8(0xb5)]:_0x5d4e77[_0x22acb8(0xc2)]['name'];console[_0x22acb8(0xcc)]('\x0a'+a41_0x2f0101[_0x22acb8(0x113)]('New\x20journey:')+'\x20'+_0x211506),console['error']('─'['repeat'](0x3c)),_0x5d4e77[_0x22acb8(0xfc)]&&console[_0x22acb8(0xcc)](_0x5d4e77[_0x22acb8(0xfc)]),console['error']('─'[_0x22acb8(0xf1)](0x3c));}const _0x27c855=_0x19e079[_0x22acb8(0x132)](_0x50b37f=>!_0x50b37f[_0x22acb8(0xef)]&&_0x50b37f[_0x22acb8(0xfc)]);if(_0x27c855[_0x22acb8(0x107)]>0x0)for(const _0x44acf4 of _0x27c855){const _0x44d51b=_0x44acf4[_0x22acb8(0xbf)]?_0x44acf4['folderPath']+'/'+_0x44acf4['yamlConfig']['name']:_0x44acf4[_0x22acb8(0xc2)][_0x22acb8(0xb5)];console[_0x22acb8(0xcc)]('\x0a'+a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xb9))+'\x20'+_0x44d51b),console['error']('─'[_0x22acb8(0xf1)](0x3c)),console['error'](_0x44acf4[_0x22acb8(0xfc)]),console['error']('─'[_0x22acb8(0xf1)](0x3c));}if(_0x38900e[_0x22acb8(0x107)]>0x0)for(const _0x4c1b47 of _0x38900e){const _0x159455=_0x4c1b47['folderId']?_0x3d6fb6[_0x22acb8(0x112)](_0x4c1b47[_0x22acb8(0xac)])||'':'',_0x44afcc=_0x159455?_0x159455+'/'+_0x4c1b47[_0x22acb8(0xba)]:_0x4c1b47[_0x22acb8(0xba)];console['error']('\x0a'+a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0xda))+'\x20'+_0x44afcc),console['error']('─'[_0x22acb8(0xf1)](0x3c)),console[_0x22acb8(0xcc)](a41_0x2f0101['red'](_0x22acb8(0x12f))),console[_0x22acb8(0xcc)]('─'[_0x22acb8(0xf1)](0x3c));}if(_0x1b9e3c[_0x22acb8(0xff)])return console[_0x22acb8(0xcc)](a41_0x2f0101['yellow'](_0x22acb8(0x140))),0x0;const _0x5e603b=_0x1b9e3c['journeysOnly']?![]:_0x3eee29[_0x22acb8(0x107)]>0x0||_0x5e12d7[_0x22acb8(0x107)]>0x0||_0x323e17['length']>0x0,_0x3debb7=_0x4d3292[_0x22acb8(0x107)]>0x0||_0x5d5768['length']>0x0||_0x38900e['length']>0x0,_0x2f5b63=_0x1b9e3c[_0x22acb8(0xeb)]?![]:_0x2b28e1['length']>0x0,_0x23dcd7=_0x545702[_0x22acb8(0x107)]>0x0;if(!_0x5e603b&&!_0x3debb7&&!_0x2f5b63&&!_0x23dcd7){const _0x2ae0eb=_0x1b9e3c[_0x22acb8(0xeb)]?_0x22acb8(0x12e):_0x22acb8(0xee);console['error'](a41_0x2f0101[_0x22acb8(0x113)](_0x2ae0eb));if(_0x815ab4&&_0x219fa0[_0x22acb8(0x107)]===0x1){const _0x55ed70=_0x219fa0[0x0];if(_0x55ed70['existingSegment']?.['id']){const _0x5e7c62=getConsoleNextUrl(_0x1b9e3c['site'],_0x22acb8(0x116)+_0x4f0c6f+_0x22acb8(0xd1)+_0x55ed70[_0x22acb8(0x124)]['id']+'/sb/da/esr');console[_0x22acb8(0xcc)](_0x22acb8(0xca)+a41_0x2f0101[_0x22acb8(0x130)](_0x5e7c62));}}if(_0x815ab4&&_0x289481[_0x22acb8(0x107)]===0x1){const _0x285bfc=_0x289481[0x0];if(_0x285bfc[_0x22acb8(0xdb)]?.['id']){const _0x3ef77a=getConsoleNextUrl(_0x1b9e3c[_0x22acb8(0xb8)],_0x22acb8(0x116)+_0x4f0c6f+_0x22acb8(0xd1)+_0x285bfc[_0x22acb8(0xdb)]['id']+'/j/da/je');console[_0x22acb8(0xcc)]('\x20\x20'+a41_0x2f0101[_0x22acb8(0x130)](_0x3ef77a));}}return 0x0;}const _0x511f89=_0x1b9e3c[_0x22acb8(0xeb)]?_0x4d3292[_0x22acb8(0x107)]+_0x5d5768['length']+_0x38900e[_0x22acb8(0x107)]+_0x545702[_0x22acb8(0x107)]:_0x3eee29[_0x22acb8(0x107)]+_0x5e12d7[_0x22acb8(0x107)]+_0x323e17[_0x22acb8(0x107)]+_0x4d3292[_0x22acb8(0x107)]+_0x5d5768[_0x22acb8(0x107)]+_0x38900e[_0x22acb8(0x107)]+_0x545702['length']+_0x2b28e1[_0x22acb8(0x107)];if(!_0x1b9e3c['yes']&&_0x511f89>0x0){if(!isInteractive())return console['error'](a41_0x2f0101[_0x22acb8(0xbb)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a41_0x2f0101[_0x22acb8(0x13b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5b9331=await confirmKey(_0x22acb8(0xc9)+_0x511f89+_0x22acb8(0xad));if(!_0x5b9331)return console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xe9))),0x1;}const _0x5ef15e={'withProgress':async(_0x44f0ed,_0xfa100d)=>{const _0x3dd36e=_0x22acb8,_0x2f0290=await withSpinner(_0x44f0ed,_0xfa100d,{'verbose':_0x1b9e3c[_0x3dd36e(0x129)]});return{'data':_0x2f0290[_0x3dd36e(0x122)]};},'logInfo':_0x43aea3=>console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x137)]('✔\x20'+_0x43aea3)),'logSuccess':_0x2054c6=>console['error'](a41_0x2f0101['green']('✔\x20'+_0x2054c6)),'logWarning':_0x7edd97=>console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)]('⚠\x20'+_0x7edd97)),'logDeleted':_0x5ef54c=>console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0xbb)]('✔\x20'+_0x5ef54c))},_0x48690b={'segment':_0x1e52a1[_0x22acb8(0x114)],'journey':_0x1e52a1['journey'],'user':_0x1e52a1['user'],'connection':_0x1e52a1[_0x22acb8(0x118)]};_0x545702[_0x22acb8(0x107)]>0x0&&(_0x5e69c9=await executePushFolders(_0x48690b,_0x545702,_0x5e69c9,{'parentId':_0x4f0c6f},_0x5ef15e));const _0xf9ee20={'rootFolderId':_0x2e6077,'folderPathToId':_0x5e69c9,'folderIdToPath':_0x3d6fb6,'segmentNameToId':_0x193102,'activationsBySegmentId':_0x38f6c5,'emailToIdMap':_0x189968,'idToEmailMap':_0x4ac6b,'connectionNameToIdMap':_0x4701ef[_0x22acb8(0x13c)],'connectionIdToNameMap':_0x4701ef['idToName'],'connectionNameToTypeMap':_0xa43f3c},_0x362f71=await executePushSegments(_0x48690b,_0x1b9e3c[_0x22acb8(0xeb)]?[]:_0x589139,_0xf9ee20,{'parentId':_0x4f0c6f},_0x5ef15e),_0x5c22a6=_0x362f71[_0x22acb8(0xc0)],_0x4e0555=_0x362f71['updated'],_0x5bd671=_0x362f71['activations']['created'],_0x19d94a=_0x362f71[_0x22acb8(0xae)][_0x22acb8(0x143)],_0x43f022=_0x362f71[_0x22acb8(0xae)][_0x22acb8(0xe0)];let _0x1451e9;if(_0x815ab4&&_0x589139[_0x22acb8(0x107)]===0x1){const _0x2cbd7f=_0x589139[0x0];_0x1451e9=_0x2cbd7f['existingSegment']?.['id']??_0x362f71[_0x22acb8(0xe8)]['get'](_0x2cbd7f[_0x22acb8(0xc2)]['name']);}const _0x59c141=await executePushSegmentDeletions(_0x48690b,_0x1b9e3c[_0x22acb8(0xeb)]?[]:_0x323e17,_0x5ef15e);let _0x7c480f=0x0,_0x15d027=0x0,_0x5fc87a=0x0;const _0x43d11e=new Map(_0x193102);for(const [_0x1d64af,_0x4c4494]of _0x362f71[_0x22acb8(0xe8)]){_0x43d11e['set'](_0x1d64af,_0x4c4494);}if(_0x19e079[_0x22acb8(0x107)]>0x0){const _0x2b5ee5={..._0xf9ee20,'segmentNameToId':_0x43d11e,'existingSegments':_0x14b892,'activationContext':_0xddf6b3},_0x12d0a9=await executePushJourneys(_0x48690b,_0x19e079,_0x2b5ee5,{'parentId':_0x4f0c6f,'rootFolderId':_0x2e6077,'verbose':_0x1b9e3c[_0x22acb8(0x129)]},_0x5ef15e);_0x7c480f=_0x12d0a9[_0x22acb8(0xc0)],_0x15d027=_0x12d0a9['updated'];if(_0x815ab4&&_0x12d0a9[_0x22acb8(0xd7)][_0x22acb8(0x107)]===0x1){const _0x56d364=_0x12d0a9[_0x22acb8(0xd7)][0x0];if(_0x56d364[_0x22acb8(0xe3)]){const _0x52f267=getConsoleNextUrl(_0x1b9e3c['site'],_0x22acb8(0x116)+_0x4f0c6f+_0x22acb8(0xd1)+_0x56d364[_0x22acb8(0xe3)]+_0x22acb8(0xde));console['error']('\x20\x20'+a41_0x2f0101[_0x22acb8(0x130)](_0x52f267));}}}for(const _0x5a11e6 of _0x38900e){console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xd5)+_0x5a11e6[_0x22acb8(0xba)])),_0x5fc87a++;}const _0x2f59c8=[];if(_0x5c22a6>0x0)_0x2f59c8[_0x22acb8(0xfb)](_0x5c22a6+_0x22acb8(0xf0));if(_0x4e0555>0x0)_0x2f59c8[_0x22acb8(0xfb)](_0x4e0555+'\x20updated');if(_0x59c141>0x0)_0x2f59c8['push'](_0x59c141+_0x22acb8(0xec));const _0x1b02e4=[];if(_0x7c480f>0x0)_0x1b02e4[_0x22acb8(0xfb)](_0x7c480f+'\x20created');if(_0x15d027>0x0)_0x1b02e4[_0x22acb8(0xfb)](_0x15d027+_0x22acb8(0xb2));if(_0x5fc87a>0x0)_0x1b02e4[_0x22acb8(0xfb)](_0x5fc87a+_0x22acb8(0xec));const _0x12691f=[];if(_0x5bd671>0x0)_0x12691f[_0x22acb8(0xfb)](_0x5bd671+_0x22acb8(0xf0));if(_0x19d94a>0x0)_0x12691f[_0x22acb8(0xfb)](_0x19d94a+'\x20updated');if(_0x43f022>0x0)_0x12691f[_0x22acb8(0xfb)](_0x43f022+'\x20deleted');console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x113)](_0x22acb8(0x10b)));_0x2f59c8[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0xeb)]&&console[_0x22acb8(0xcc)](_0x22acb8(0xc6)+_0x2f59c8[_0x22acb8(0x141)](',\x20'));_0x1b02e4[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)](_0x22acb8(0xf7)+_0x1b02e4[_0x22acb8(0x141)](',\x20'));_0x12691f[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c['journeysOnly']&&console[_0x22acb8(0xcc)](_0x22acb8(0xc4)+_0x12691f[_0x22acb8(0x141)](',\x20'));if(_0x1451e9){const _0x815979=getConsoleNextUrl(_0x1b9e3c[_0x22acb8(0xb8)],_0x22acb8(0x116)+_0x4f0c6f+_0x22acb8(0xd1)+_0x1451e9+_0x22acb8(0xf6));console[_0x22acb8(0xcc)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x2f0101['cyan'](_0x815979));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x49faf0=a42_0x40d9;(function(_0x34057e,_0x318ead){const _0x4bd97e=a42_0x40d9,_0x3858bb=_0x34057e();while(!![]){try{const _0x326da1=-parseInt(_0x4bd97e(0x106))/0x1+parseInt(_0x4bd97e(0xf7))/0x2+-parseInt(_0x4bd97e(0x122))/0x3*(parseInt(_0x4bd97e(0x11f))/0x4)+-parseInt(_0x4bd97e(0x125))/0x5*(-parseInt(_0x4bd97e(0x105))/0x6)+parseInt(_0x4bd97e(0x11d))/0x7+-parseInt(_0x4bd97e(0x112))/0x8*(-parseInt(_0x4bd97e(0xf6))/0x9)+-parseInt(_0x4bd97e(0x113))/0xa*(parseInt(_0x4bd97e(0x102))/0xb);if(_0x326da1===_0x318ead)break;else _0x3858bb['push'](_0x3858bb['shift']());}catch(_0x4d93b5){_0x3858bb['push'](_0x3858bb['shift']());}}}(a42_0x25d5,0x3d294));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x40d9(_0x17fc36,_0x1ab00c){_0x17fc36=_0x17fc36-0xf5;const _0x25d53f=a42_0x25d5();let _0x40d956=_0x25d53f[_0x17fc36];return _0x40d956;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x559671 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x49faf0(0x119)]=a42_0x49faf0(0x11a);[a42_0x49faf0(0x101)]=a42_0x49faf0(0x10c);async[a42_0x49faf0(0x100)](_0xd9b1f7){const _0x247649=a42_0x49faf0;console[_0x247649(0x11e)](a42_0x559671[_0x247649(0x10f)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x247649(0x11e)](a42_0x559671[_0x247649(0x10f)](_0x247649(0xfd)));const {options:_0x575398,args:_0x1c7b47,tdx:_0x2d71c7}=_0xd9b1f7,_0x53b594=_0x575398;if(_0x1c7b47[_0x247649(0x117)]===0x0)return console[_0x247649(0x11e)](_0x247649(0x107)),console[_0x247649(0x11e)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x247649(0x11e)](_0x247649(0x110)),console[_0x247649(0x11e)](_0x247649(0x124)),console[_0x247649(0x11e)](_0x247649(0x126)),0x1;const _0x480562=_0x1c7b47[0x0],_0x35b9a3=_0x575398[_0x247649(0xff)];let _0x4941d=_0x480562;_0x35b9a3&&!_0x480562[_0x247649(0xfc)]('/')&&(_0x4941d=_0x35b9a3+'/'+_0x480562,_0x53b594['verbose']&&console[_0x247649(0x11e)](_0x247649(0x118)+_0x4941d));const _0x3645e5=await withSpinner(_0x247649(0xfb)+_0x4941d+'\x27...',()=>_0x2d71c7[_0x247649(0x123)][_0x247649(0x103)](_0x4941d),{'verbose':_0x53b594['verbose']}),_0x260350=_0x3645e5['data'];_0x53b594[_0x247649(0x10b)]&&console[_0x247649(0x11e)](_0x247649(0x10e)+_0x260350[_0x247649(0x10a)]);if(_0x260350[_0x247649(0x10a)]!=='segment')return console[_0x247649(0x11e)](_0x247649(0xfa)+_0x260350[_0x247649(0x10a)]+_0x247649(0x114)),console['error'](_0x247649(0x127)),0x1;if(!_0x260350[_0x247649(0x116)])throw new SDKError(ErrorCode['INTERNAL'],_0x247649(0x120));const _0x4758fe=_0x260350[_0x247649(0x111)],_0x437261=_0x260350[_0x247649(0x116)];_0x53b594[_0x247649(0x10b)]&&(console['error']('Parent\x20ID:\x20'+_0x4758fe),console['error'](_0x247649(0x11b)+_0x437261));let _0x52117c;if(_0x53b594[_0x247649(0x109)]){const _0x43637f=_0x53b594['folder'],_0x127f27=await withSpinner('Resolving\x20folder\x20\x27'+_0x43637f+_0x247649(0xf9),()=>_0x2d71c7[_0x247649(0x123)][_0x247649(0xfe)](_0x4758fe,_0x43637f),{'verbose':_0x53b594[_0x247649(0x10b)]});_0x52117c=parseInt(_0x127f27[_0x247649(0xf5)],0xa),_0x53b594['verbose']&&console['error'](_0x247649(0x108)+_0x52117c);}const _0x43c369=await loadJSONFromOptions(_0x53b594[_0x247649(0x11c)],_0x53b594[_0x247649(0x121)]),_0x320dd9={'name':_0x53b594[_0x247649(0x119)],'description':_0x53b594[_0x247649(0x101)],'rule':_0x43c369,'kind':_0x53b594[_0x247649(0x115)]!==undefined?parseInt(_0x53b594[_0x247649(0x115)],0xa):undefined,'segmentFolderId':_0x52117c},_0x461929=await withSpinner('Updating\x20segment\x20\x27'+_0x260350['segmentName']+_0x247649(0xf9),()=>_0x2d71c7[_0x247649(0x123)][_0x247649(0xf8)](_0x4758fe,_0x437261,_0x320dd9),{'verbose':_0x53b594['verbose']}),_0x36a1a6=_0x461929['data'];return console['error'](_0x247649(0x10d)+_0x36a1a6[_0x247649(0x119)]+'\x27'),_0x4941d!==_0x480562&&console['error'](_0x247649(0x104)+_0x4941d),await handleSDKOutput([_0x36a1a6],_0x53b594),0x0;}}function a42_0x25d5(){const _0x4e3c52=['\x27...','Error:\x20Cannot\x20update\x20','Resolving\x20path\x20\x27','includes','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolveFolderId','segmentPath','execute','description','413358iWFquN','resolvePathToResource','\x20\x20\x20Path:\x20','12qmxGiI','56031dFCLAq','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','folder','type','verbose','Update\x20existing\x20child\x20segment','✔\x20Updated\x20segment\x20\x27','Resolved\x20type:\x20','yellow','Examples:','parentId','8sQodrU','240TNnGte','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','kind','segmentId','length','Resolved\x20relative\x20path\x20to:\x20','name','segment:update','Segment\x20ID:\x20','rule','945238uKDRCC','error','32LkrpsN','Segment\x20ID\x20missing\x20from\x20resolved\x20path','ruleFile','6654GnwNQS','segment','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','860245Tfmxcu','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','data','3660057cxaRnC','680716XbRXQy','updateSegmentById'];a42_0x25d5=function(){return _0x4e3c52;};return a42_0x25d5();}
1
+ function a42_0x9d47(){const _0x534906=['\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','385oFYMVn','Updating\x20segment\x20\x27','\x27...','data','Resolved\x20type:\x20','segment','name','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','12sHMLZa','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20path\x20\x27','3YZVlXz','1809GJeshi','323402xFdUqn','includes','1057952rxaVOA','yellow','107646cHWqcD','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','2536lGbDnP','type','segmentName','updateSegmentById','segment:update','verbose','error','segmentId','78110arDriE','Examples:','Segment\x20ID:\x20','42upwVAc','Error:\x20Cannot\x20update\x20','rule','518865Wtghaw','ruleFile','resolveFolderId','INTERNAL','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','4AKojMD','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','description','2755974CJibQw','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folder','✔\x20Updated\x20segment\x20\x27','parentId','resolvePathToResource','Update\x20existing\x20child\x20segment'];a42_0x9d47=function(){return _0x534906;};return a42_0x9d47();}const a42_0x5aacfe=a42_0x3c3e;(function(_0x59263d,_0x1a1cd4){const _0x802c12=a42_0x3c3e,_0x420057=_0x59263d();while(!![]){try{const _0x72a4be=parseInt(_0x802c12(0x12c))/0x1+-parseInt(_0x802c12(0x12a))/0x2*(-parseInt(_0x802c12(0x128))/0x3)+parseInt(_0x802c12(0x111))/0x4*(parseInt(_0x802c12(0x10c))/0x5)+parseInt(_0x802c12(0x12e))/0x6*(-parseInt(_0x802c12(0x109))/0x7)+-parseInt(_0x802c12(0x130))/0x8*(parseInt(_0x802c12(0x129))/0x9)+-parseInt(_0x802c12(0x106))/0xa*(parseInt(_0x802c12(0x11d))/0xb)+parseInt(_0x802c12(0x125))/0xc*(-parseInt(_0x802c12(0x114))/0xd);if(_0x72a4be===_0x1a1cd4)break;else _0x420057['push'](_0x420057['shift']());}catch(_0x16926f){_0x420057['push'](_0x420057['shift']());}}}(a42_0x9d47,0xa2c38));import{BaseCommand}from'./command.js';function a42_0x3c3e(_0x75291c,_0x5a9909){_0x75291c=_0x75291c-0x103;const _0x9d47a5=a42_0x9d47();let _0x3c3e07=_0x9d47a5[_0x75291c];return _0x3c3e07;}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_0x44cf5a from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x5aacfe(0x123)]=a42_0x5aacfe(0x134);[a42_0x5aacfe(0x113)]=a42_0x5aacfe(0x11a);async['execute'](_0x49d637){const _0x3570a2=a42_0x5aacfe;console[_0x3570a2(0x104)](a42_0x44cf5a[_0x3570a2(0x12d)](_0x3570a2(0x112))),console[_0x3570a2(0x104)](a42_0x44cf5a['yellow'](_0x3570a2(0x110)));const {options:_0x2caf61,args:_0x49c018,tdx:_0x48deda}=_0x49d637,_0x3ea67b=_0x2caf61;if(_0x49c018['length']===0x0)return console['error'](_0x3570a2(0x126)),console[_0x3570a2(0x104)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x3570a2(0x104)](_0x3570a2(0x107)),console['error'](_0x3570a2(0x11b)),console[_0x3570a2(0x104)](_0x3570a2(0x12f)),0x1;const _0x2339c7=_0x49c018[0x0],_0x27d883=_0x2caf61['segmentPath'];let _0x165e7d=_0x2339c7;_0x27d883&&!_0x2339c7[_0x3570a2(0x12b)]('/')&&(_0x165e7d=_0x27d883+'/'+_0x2339c7,_0x3ea67b['verbose']&&console[_0x3570a2(0x104)]('Resolved\x20relative\x20path\x20to:\x20'+_0x165e7d));const _0x52f905=await withSpinner(_0x3570a2(0x127)+_0x165e7d+_0x3570a2(0x11f),()=>_0x48deda[_0x3570a2(0x122)][_0x3570a2(0x119)](_0x165e7d),{'verbose':_0x3ea67b[_0x3570a2(0x103)]}),_0x21fd7a=_0x52f905['data'];_0x3ea67b[_0x3570a2(0x103)]&&console[_0x3570a2(0x104)](_0x3570a2(0x121)+_0x21fd7a[_0x3570a2(0x131)]);if(_0x21fd7a[_0x3570a2(0x131)]!==_0x3570a2(0x122))return console[_0x3570a2(0x104)](_0x3570a2(0x10a)+_0x21fd7a['type']+_0x3570a2(0x11c)),console[_0x3570a2(0x104)](_0x3570a2(0x124)),0x1;if(!_0x21fd7a[_0x3570a2(0x105)])throw new SDKError(ErrorCode[_0x3570a2(0x10f)],_0x3570a2(0x115));const _0x50a469=_0x21fd7a[_0x3570a2(0x118)],_0x131001=_0x21fd7a[_0x3570a2(0x105)];_0x3ea67b[_0x3570a2(0x103)]&&(console[_0x3570a2(0x104)]('Parent\x20ID:\x20'+_0x50a469),console[_0x3570a2(0x104)](_0x3570a2(0x108)+_0x131001));let _0x228587;if(_0x3ea67b['folder']){const _0x3e4b0c=_0x3ea67b[_0x3570a2(0x116)],_0x59700e=await withSpinner('Resolving\x20folder\x20\x27'+_0x3e4b0c+_0x3570a2(0x11f),()=>_0x48deda['segment'][_0x3570a2(0x10e)](_0x50a469,_0x3e4b0c),{'verbose':_0x3ea67b[_0x3570a2(0x103)]});_0x228587=parseInt(_0x59700e['data'],0xa),_0x3ea67b['verbose']&&console[_0x3570a2(0x104)]('Resolved\x20folder\x20ID:\x20'+_0x228587);}const _0x1c2cf1=await loadJSONFromOptions(_0x3ea67b[_0x3570a2(0x10b)],_0x3ea67b[_0x3570a2(0x10d)]),_0x71e96b={'name':_0x3ea67b[_0x3570a2(0x123)],'description':_0x3ea67b[_0x3570a2(0x113)],'rule':_0x1c2cf1,'kind':_0x3ea67b['kind']!==undefined?parseInt(_0x3ea67b['kind'],0xa):undefined,'segmentFolderId':_0x228587},_0xd03deb=await withSpinner(_0x3570a2(0x11e)+_0x21fd7a[_0x3570a2(0x132)]+'\x27...',()=>_0x48deda[_0x3570a2(0x122)][_0x3570a2(0x133)](_0x50a469,_0x131001,_0x71e96b),{'verbose':_0x3ea67b[_0x3570a2(0x103)]}),_0x28253b=_0xd03deb[_0x3570a2(0x120)];return console['error'](_0x3570a2(0x117)+_0x28253b['name']+'\x27'),_0x165e7d!==_0x2339c7&&console[_0x3570a2(0x104)]('\x20\x20\x20Path:\x20'+_0x165e7d),await handleSDKOutput([_0x28253b],_0x3ea67b),0x0;}}
@@ -1 +1 @@
1
- const a43_0x1b40e1=a43_0x2e73;function a43_0x1222(){const _0x33a080=['error','isAbsolute','Parent\x20ID:\x20','\x27...','115032IpkXGC','log','138KsqZlN','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','parentId','description','site','verbose','9pbgHCA','✔\x20Context\x20set\x20to:\x20','slice','parent_segment','green','isDirectory','dim','segments','folderId','cyan','resolvePathToResource','990160pgbOgb','split','Examples:','name','9226080yOfnUj','237013EsLAOW','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','segment:use','parentName','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','session','Site:\x20','length','red','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','join','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','24byLwpH','Resolved\x20path\x20type:\x20','Resolving\x20path\x20\x27','data','8256248vpZOvB','type','fullPath','Folder\x20ID:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Error:\x20Path\x20is\x20required\x0a','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segmentPath','14629IauIKK','Use:\x20tdx\x20segment\x20use\x20','Target\x20path:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','config','361960hGSwXc','folderPath','78DDpTXZ'];a43_0x1222=function(){return _0x33a080;};return a43_0x1222();}(function(_0x4a6a7b,_0x34edf0){const _0x1b4f16=a43_0x2e73,_0x4e0295=_0x4a6a7b();while(!![]){try{const _0x35ad0a=-parseInt(_0x1b4f16(0x1df))/0x1*(parseInt(_0x1b4f16(0x1e6))/0x2)+-parseInt(_0x1b4f16(0x1eb))/0x3*(-parseInt(_0x1b4f16(0x1ce))/0x4)+parseInt(_0x1b4f16(0x1bc))/0x5+parseInt(_0x1b4f16(0x1ed))/0x6*(parseInt(_0x1b4f16(0x1c1))/0x7)+-parseInt(_0x1b4f16(0x1e4))/0x8*(-parseInt(_0x1b4f16(0x1b1))/0x9)+-parseInt(_0x1b4f16(0x1c0))/0xa+parseInt(_0x1b4f16(0x1d2))/0xb;if(_0x35ad0a===_0x34edf0)break;else _0x4e0295['push'](_0x4e0295['shift']());}catch(_0x3ef970){_0x4e0295['push'](_0x4e0295['shift']());}}}(a43_0x1222,0x7c657));import{existsSync,statSync}from'fs';import a43_0x454e93 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0x2e73(_0x5a0c16,_0x58f345){_0x5a0c16=_0x5a0c16-0x1ac;const _0x122261=a43_0x1222();let _0x2e7307=_0x122261[_0x5a0c16];return _0x2e7307;}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_0x1b40e1(0x1bf)]=a43_0x1b40e1(0x1c3);[a43_0x1b40e1(0x1ae)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async['execute'](_0x418cb5){const _0x159acd=a43_0x1b40e1,{options:_0x5f5ab8,args:_0x4e6c21,tdx:_0x11c334}=_0x418cb5;if(_0x4e6c21[_0x159acd(0x1c9)]===0x0)return console['error'](a43_0x454e93[_0x159acd(0x1ca)](_0x159acd(0x1d9))),console[_0x159acd(0x1e7)](_0x159acd(0x1dc)),console[_0x159acd(0x1e7)](_0x159acd(0x1be)),console[_0x159acd(0x1e7)](_0x159acd(0x1c5)),console['error'](_0x159acd(0x1e2)),console[_0x159acd(0x1e7)](_0x159acd(0x1c2)),console[_0x159acd(0x1e7)](_0x159acd(0x1d8)),0x1;const _0x1650b7=_0x4e6c21[0x0],_0x4d1e92=_0x5f5ab8[_0x159acd(0x1c7)];try{if(_0x1650b7==='/')return saveSessionContext({'segment_path':undefined},_0x4d1e92),console['log'](a43_0x454e93[_0x159acd(0x1b5)](_0x159acd(0x1ac))),0x0;if(existsSync(_0x1650b7)&&statSync(_0x1650b7)[_0x159acd(0x1b6)]()){let _0x142e88;try{_0x142e88=findTdxConfig(_0x1650b7);}catch{return console[_0x159acd(0x1e7)](a43_0x454e93['red'](_0x159acd(0x1dd)+_0x1650b7)),console[_0x159acd(0x1e7)](a43_0x454e93['cyan'](_0x159acd(0x1da))),0x1;}const _0x3e4220=_0x142e88[_0x159acd(0x1e3)][_0x159acd(0x1b4)];return saveSessionContext({'segment_path':_0x3e4220,'parent_segment':_0x3e4220},_0x4d1e92),console[_0x159acd(0x1ec)](a43_0x454e93[_0x159acd(0x1b5)](_0x159acd(0x1b2)+a43_0x454e93[_0x159acd(0x1ba)](_0x3e4220))),0x0;}const _0x2bb19d=_0x5f5ab8[_0x159acd(0x1de)];let _0x2b934d=_0x1650b7;const _0x1f2e85=parsePath(_0x1650b7);if(!_0x1f2e85[_0x159acd(0x1e8)]){if(!_0x2bb19d)return console[_0x159acd(0x1e7)](a43_0x454e93[_0x159acd(0x1ca)](_0x159acd(0x1c6))),console['error'](a43_0x454e93[_0x159acd(0x1ba)](_0x159acd(0x1d6))),0x1;if(_0x1650b7==='..'){const _0xfe6f67=_0x2bb19d[_0x159acd(0x1bd)]('/')[_0x159acd(0x1b3)](0x0,-0x1)[_0x159acd(0x1cc)]('/');_0x2b934d=_0xfe6f67||'/';}else _0x1650b7==='.'?_0x2b934d=_0x2bb19d:_0x2b934d=_0x2bb19d+'/'+_0x1650b7;_0x5f5ab8[_0x159acd(0x1b0)]&&console[_0x159acd(0x1e7)](_0x159acd(0x1db)+_0x2b934d);}if(_0x2b934d==='/'||_0x2b934d==='')return saveSessionContext({'segment_path':undefined},_0x4d1e92),console[_0x159acd(0x1ec)](a43_0x454e93[_0x159acd(0x1b5)](_0x159acd(0x1ac))),0x0;_0x2b934d=normalizePath(_0x2b934d);const _0x2e8e32=parsePath(_0x2b934d)[_0x159acd(0x1b8)];if(_0x2e8e32[_0x159acd(0x1c9)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4d1e92),console[_0x159acd(0x1ec)](a43_0x454e93['green'](_0x159acd(0x1ac))),0x0;_0x5f5ab8[_0x159acd(0x1b0)]&&(console[_0x159acd(0x1e7)](_0x159acd(0x1c8)+_0x5f5ab8[_0x159acd(0x1af)]),console[_0x159acd(0x1e7)](_0x159acd(0x1e1)+_0x2b934d));const _0x5483dc=await withSpinner(_0x159acd(0x1d0)+_0x2b934d+_0x159acd(0x1ea),()=>_0x11c334[_0x159acd(0x1d7)][_0x159acd(0x1bb)](_0x2b934d),{'verbose':_0x5f5ab8[_0x159acd(0x1b0)]}),_0x3168b1=_0x5483dc[_0x159acd(0x1d1)];_0x5f5ab8[_0x159acd(0x1b0)]&&(console[_0x159acd(0x1e7)](_0x159acd(0x1cf)+_0x3168b1[_0x159acd(0x1d3)]),console[_0x159acd(0x1e7)](_0x159acd(0x1e9)+_0x3168b1[_0x159acd(0x1ad)]),_0x3168b1['folderId']&&console[_0x159acd(0x1e7)](_0x159acd(0x1d5)+_0x3168b1[_0x159acd(0x1b9)]));if(_0x3168b1[_0x159acd(0x1d3)]==='segment')return console['error'](a43_0x454e93[_0x159acd(0x1ca)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x159acd(0x1e7)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x159acd(0x1e7)](a43_0x454e93[_0x159acd(0x1ba)](_0x159acd(0x1e0)+_0x3168b1[_0x159acd(0x1c4)]+(_0x3168b1['folderPath']?'/'+_0x3168b1[_0x159acd(0x1e5)][_0x159acd(0x1cc)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3168b1[_0x159acd(0x1d4)],'parent_segment':_0x3168b1[_0x159acd(0x1c4)]},_0x4d1e92),console[_0x159acd(0x1ec)](a43_0x454e93[_0x159acd(0x1b5)]('✔\x20Context\x20set\x20to:\x20'+a43_0x454e93[_0x159acd(0x1ba)](_0x3168b1[_0x159acd(0x1d4)]))),_0x5f5ab8['verbose']&&(console['error'](a43_0x454e93[_0x159acd(0x1b7)](_0x159acd(0x1cd))),console['error'](a43_0x454e93[_0x159acd(0x1b7)](_0x159acd(0x1cb)))),0x0;}catch(_0x57c1ec){throw _0x57c1ec;}}}
1
+ function a43_0x324d(){const _0xebb753=['cyan','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','fullPath','parentName','folderPath','1718955lWYsCJ','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Folder\x20ID:\x20','2676pxxbFp','645688rJCqBO','description','site','log','error','name','segments','Parent\x20ID:\x20','parent_segment','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','15lrZcLY','86408vPsUGC','5590RWTYMN','Target\x20path:\x20','split','parentId','type','data','red','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','segment:use','config','Error:\x20Path\x20is\x20required\x0a','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','56177alHxnW','verbose','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','slice','402aTZwoW','225iJLEZf','green','115736JDDOsE','5878086YVPLBI','execute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','folderId','segment','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','join','dim','Resolved\x20path\x20type:\x20','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x27...','Site:\x20','✔\x20Context\x20set\x20to:\x20','Resolved\x20relative\x20path\x20to:\x20'];a43_0x324d=function(){return _0xebb753;};return a43_0x324d();}const a43_0x3e54e0=a43_0x1a53;(function(_0x23549d,_0x5c61cc){const _0x270560=a43_0x1a53,_0xcf623c=_0x23549d();while(!![]){try{const _0x55a2be=parseInt(_0x270560(0x1d7))/0x1*(-parseInt(_0x270560(0x1f4))/0x2)+-parseInt(_0x270560(0x1e2))/0x3*(parseInt(_0x270560(0x1d8))/0x4)+-parseInt(_0x270560(0x1d4))/0x5+-parseInt(_0x270560(0x1f8))/0x6+-parseInt(_0x270560(0x1e3))/0x7+parseInt(_0x270560(0x1f7))/0x8*(parseInt(_0x270560(0x1f5))/0x9)+parseInt(_0x270560(0x1e4))/0xa*(parseInt(_0x270560(0x1f0))/0xb);if(_0x55a2be===_0x5c61cc)break;else _0xcf623c['push'](_0xcf623c['shift']());}catch(_0x14c82c){_0xcf623c['push'](_0xcf623c['shift']());}}}(a43_0x324d,0x82c86));import{existsSync,statSync}from'fs';import a43_0x78ccca from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0x1a53(_0x205545,_0x1fe995){_0x205545=_0x205545-0x1cd;const _0x324d26=a43_0x324d();let _0x1a536e=_0x324d26[_0x205545];return _0x1a536e;}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_0x3e54e0(0x1dd)]=a43_0x3e54e0(0x1ec);[a43_0x3e54e0(0x1d9)]=a43_0x3e54e0(0x1fa);async[a43_0x3e54e0(0x1f9)](_0x3d4b2a){const _0x39712b=a43_0x3e54e0,{options:_0x8aad7f,args:_0x972e36,tdx:_0x5c0246}=_0x3d4b2a;if(_0x972e36['length']===0x0)return console['error'](a43_0x78ccca['red'](_0x39712b(0x1ee))),console[_0x39712b(0x1dc)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x39712b(0x1dc)]('Examples:'),console[_0x39712b(0x1dc)](_0x39712b(0x1fd)),console[_0x39712b(0x1dc)](_0x39712b(0x1ef)),console[_0x39712b(0x1dc)](_0x39712b(0x1e1)),console[_0x39712b(0x1dc)](_0x39712b(0x1d5)),0x1;const _0x1e94c2=_0x972e36[0x0],_0x4b84bb=_0x8aad7f['session'];try{if(_0x1e94c2==='/')return saveSessionContext({'segment_path':undefined},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca['green'](_0x39712b(0x1d0))),0x0;if(existsSync(_0x1e94c2)&&statSync(_0x1e94c2)['isDirectory']()){let _0x5d9cf1;try{_0x5d9cf1=findTdxConfig(_0x1e94c2);}catch{return console['error'](a43_0x78ccca[_0x39712b(0x1ea)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x1e94c2)),console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1cf)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x5accc0=_0x5d9cf1[_0x39712b(0x1ed)][_0x39712b(0x1e0)];return saveSessionContext({'segment_path':_0x5accc0,'parent_segment':_0x5accc0},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca[_0x39712b(0x1f6)](_0x39712b(0x1cd)+a43_0x78ccca[_0x39712b(0x1cf)](_0x5accc0))),0x0;}const _0x4a81cc=_0x8aad7f['segmentPath'];let _0x488119=_0x1e94c2;const _0x1a3200=parsePath(_0x1e94c2);if(!_0x1a3200['isAbsolute']){if(!_0x4a81cc)return console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1ea)](_0x39712b(0x1eb))),console['error'](a43_0x78ccca[_0x39712b(0x1cf)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x1e94c2==='..'){const _0x44b568=_0x4a81cc[_0x39712b(0x1e6)]('/')[_0x39712b(0x1f3)](0x0,-0x1)[_0x39712b(0x1fe)]('/');_0x488119=_0x44b568||'/';}else _0x1e94c2==='.'?_0x488119=_0x4a81cc:_0x488119=_0x4a81cc+'/'+_0x1e94c2;_0x8aad7f['verbose']&&console[_0x39712b(0x1dc)](_0x39712b(0x1ce)+_0x488119);}if(_0x488119==='/'||_0x488119==='')return saveSessionContext({'segment_path':undefined},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca[_0x39712b(0x1f6)](_0x39712b(0x1d0))),0x0;_0x488119=normalizePath(_0x488119);const _0x254eac=parsePath(_0x488119)[_0x39712b(0x1de)];if(_0x254eac['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca[_0x39712b(0x1f6)](_0x39712b(0x1d0))),0x0;_0x8aad7f[_0x39712b(0x1f1)]&&(console[_0x39712b(0x1dc)](_0x39712b(0x203)+_0x8aad7f[_0x39712b(0x1da)]),console[_0x39712b(0x1dc)](_0x39712b(0x1e5)+_0x488119));const _0x13371d=await withSpinner('Resolving\x20path\x20\x27'+_0x488119+_0x39712b(0x202),()=>_0x5c0246[_0x39712b(0x1fc)]['resolvePathToResource'](_0x488119),{'verbose':_0x8aad7f['verbose']}),_0x12b46a=_0x13371d[_0x39712b(0x1e9)];_0x8aad7f['verbose']&&(console[_0x39712b(0x1dc)](_0x39712b(0x200)+_0x12b46a[_0x39712b(0x1e8)]),console[_0x39712b(0x1dc)](_0x39712b(0x1df)+_0x12b46a[_0x39712b(0x1e7)]),_0x12b46a[_0x39712b(0x1fb)]&&console['error'](_0x39712b(0x1d6)+_0x12b46a[_0x39712b(0x1fb)]));if(_0x12b46a[_0x39712b(0x1e8)]===_0x39712b(0x1fc))return console[_0x39712b(0x1dc)](a43_0x78ccca['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error'](_0x39712b(0x201)),console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1cf)]('Use:\x20tdx\x20segment\x20use\x20'+_0x12b46a[_0x39712b(0x1d2)]+(_0x12b46a[_0x39712b(0x1d3)]?'/'+_0x12b46a[_0x39712b(0x1d3)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x12b46a['fullPath'],'parent_segment':_0x12b46a['parentName']},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca[_0x39712b(0x1f6)](_0x39712b(0x1cd)+a43_0x78ccca['cyan'](_0x12b46a[_0x39712b(0x1d1)]))),_0x8aad7f[_0x39712b(0x1f1)]&&(console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1ff)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1ff)](_0x39712b(0x1f2)))),0x0;}catch(_0x4ac026){throw _0x4ac026;}}}
@@ -1 +1 @@
1
- const a44_0x40c175=a44_0x59da;(function(_0x4c135a,_0x3fa213){const _0x215a4f=a44_0x59da,_0x1e3d25=_0x4c135a();while(!![]){try{const _0x57f92b=parseInt(_0x215a4f(0x194))/0x1+parseInt(_0x215a4f(0x17e))/0x2+parseInt(_0x215a4f(0x18d))/0x3*(-parseInt(_0x215a4f(0x17c))/0x4)+-parseInt(_0x215a4f(0x187))/0x5+parseInt(_0x215a4f(0x19c))/0x6*(-parseInt(_0x215a4f(0x17d))/0x7)+-parseInt(_0x215a4f(0x171))/0x8*(-parseInt(_0x215a4f(0x178))/0x9)+parseInt(_0x215a4f(0x176))/0xa;if(_0x57f92b===_0x3fa213)break;else _0x1e3d25['push'](_0x1e3d25['shift']());}catch(_0x15b40c){_0x1e3d25['push'](_0x1e3d25['shift']());}}}(a44_0x4bf6,0x98973));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x3c63e1 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x4bf6(){const _0x33bfaa=['11568760KjIUeW','\x20file(s)\x20with\x20errors,\x20','83862SeMcxo','errorCode','dim','length','4mOhrYz','14441gKFpap','1319296RueLeC','targetDir','validCount','\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','green','warningCount','file','filePath','Error:\x20Directory\x20not\x20found:\x20','6084825jlZenT','):\x20','valid','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','error','helpText','941037FvFtsf','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','.yaml','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20file(s)\x20valid','Validation\x20failed:\x20','813790tUxXbp','Error:\x20','type','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','verbose','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','cwd','\x20valid','2058isKPCL','\x20warning(s)\x20found','cyan','endsWith','yellow','parentSegment','\x20error(s)','log','200XJUzOQ','warnings','description','✔\x20All\x20','red'];a44_0x4bf6=function(){return _0x33bfaa;};return a44_0x4bf6();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a44_0x59da(_0x4b0e52,_0x331aad){_0x4b0e52=_0x4b0e52-0x16d;const _0x4bf678=a44_0x4bf6();let _0x59daf7=_0x4bf678[_0x4b0e52];return _0x59daf7;}export class SegmentValidateCommand extends BaseCommand{['name']='segment:validate';[a44_0x40c175(0x173)]=a44_0x40c175(0x18f);async['execute'](_0x2d7122){const _0xf9aad6=a44_0x40c175,{options:_0x129c11,args:_0x4a9868}=_0x2d7122,_0x4ef074=_0x129c11,_0x3b2548=await resolveTarget({'arg':_0x4a9868[0x0],'contextParent':_0x129c11[_0xf9aad6(0x16e)],'cwd':process[_0xf9aad6(0x19a)]()});if(!isSuccessfulResolution(_0x3b2548))return _0x3b2548[_0xf9aad6(0x179)]==='no_parent'?(console['error'](a44_0x3c63e1[_0xf9aad6(0x16d)](_0xf9aad6(0x199))),console[_0xf9aad6(0x18b)](_0xf9aad6(0x197)),console[_0xf9aad6(0x18b)](_0xf9aad6(0x181)),console[_0xf9aad6(0x18b)](_0xf9aad6(0x18a))):(console[_0xf9aad6(0x18b)](a44_0x3c63e1[_0xf9aad6(0x175)](_0xf9aad6(0x195)+_0x3b2548['message']+'\x0a')),_0x3b2548[_0xf9aad6(0x18c)]&&console[_0xf9aad6(0x18b)](a44_0x3c63e1[_0xf9aad6(0x19e)](_0x3b2548['helpText']))),0x1;const _0x322aa8=_0x3b2548[_0xf9aad6(0x17f)],_0x1ee50b=_0x3b2548[_0xf9aad6(0x196)]===_0xf9aad6(0x184)?_0x3b2548[_0xf9aad6(0x185)]:undefined;if(!_0x1ee50b&&!existsSync(_0x322aa8))return console[_0xf9aad6(0x18b)](a44_0x3c63e1['red'](_0xf9aad6(0x186)+_0x322aa8+'\x0a')),0x1;let _0x95a391;if(_0x1ee50b){if(!_0x1ee50b[_0xf9aad6(0x19f)]('.yml')&&!_0x1ee50b[_0xf9aad6(0x19f)](_0xf9aad6(0x190)))return console[_0xf9aad6(0x18b)](a44_0x3c63e1[_0xf9aad6(0x175)](_0xf9aad6(0x191)+_0x1ee50b+'\x0a')),0x1;_0x95a391=[_0x1ee50b];}else _0x95a391=findYamlFiles(_0x322aa8);if(_0x95a391[_0xf9aad6(0x17b)]===0x0)return console[_0xf9aad6(0x18b)](a44_0x3c63e1[_0xf9aad6(0x175)](_0xf9aad6(0x18e)+_0x322aa8+'\x0a')),0x1;const _0x58120b=validateYamlFiles(_0x95a391,_0x322aa8),_0x2714ff=calculateSummary(_0x58120b);for(const _0x1dfd68 of _0x58120b){if(!isValidationResult(_0x1dfd68))continue;const {relativePath:_0x7be4ef,source:_0x45585a,result:_0x50966c,fileType:_0x52640e}=_0x1dfd68,_0x1ed69b=_0x52640e;if(_0x50966c['valid']&&_0x50966c['warnings']['length']===0x0)_0x4ef074[_0xf9aad6(0x198)]&&console[_0xf9aad6(0x170)](a44_0x3c63e1[_0xf9aad6(0x182)]('✔\x20'+_0x7be4ef)+a44_0x3c63e1[_0xf9aad6(0x17a)]('\x20('+_0x1ed69b+')'));else _0x50966c[_0xf9aad6(0x189)]?(console['log'](a44_0x3c63e1[_0xf9aad6(0x16d)]('⚠\x20'+_0x7be4ef)+a44_0x3c63e1[_0xf9aad6(0x17a)]('\x20('+_0x1ed69b+_0xf9aad6(0x188)+_0x50966c[_0xf9aad6(0x172)][_0xf9aad6(0x17b)]+'\x20warning(s)')),console[_0xf9aad6(0x170)](formatValidationResult(_0x50966c,_0x45585a,_0x7be4ef))):(console[_0xf9aad6(0x170)](a44_0x3c63e1[_0xf9aad6(0x175)]('✖\x20'+_0x7be4ef)+a44_0x3c63e1[_0xf9aad6(0x17a)]('\x20('+_0x1ed69b+_0xf9aad6(0x188)+_0x50966c['errors']['length']+_0xf9aad6(0x16f))),console['log'](formatValidationResult(_0x50966c,_0x45585a,_0x7be4ef)));}return console[_0xf9aad6(0x170)](''),_0x2714ff['hasErrors']?(console[_0xf9aad6(0x170)](a44_0x3c63e1[_0xf9aad6(0x175)](_0xf9aad6(0x193)+_0x2714ff['invalidCount']+_0xf9aad6(0x177)+_0x2714ff[_0xf9aad6(0x180)]+_0xf9aad6(0x19b))),_0x2714ff[_0xf9aad6(0x183)]>0x0&&console['log'](a44_0x3c63e1['yellow'](_0x2714ff[_0xf9aad6(0x183)]+'\x20warning(s)\x20found')),0x1):(console[_0xf9aad6(0x170)](a44_0x3c63e1[_0xf9aad6(0x182)](_0xf9aad6(0x174)+_0x2714ff[_0xf9aad6(0x180)]+_0xf9aad6(0x192))),_0x2714ff[_0xf9aad6(0x183)]>0x0&&console[_0xf9aad6(0x170)](a44_0x3c63e1['yellow'](_0x2714ff[_0xf9aad6(0x183)]+_0xf9aad6(0x19d))),0x0);}}
1
+ const a44_0xcfb2c3=a44_0x5edb;(function(_0x3fc7ab,_0x5c1347){const _0x4c03cf=a44_0x5edb,_0x56ef46=_0x3fc7ab();while(!![]){try{const _0x3f47b9=parseInt(_0x4c03cf(0x13e))/0x1+parseInt(_0x4c03cf(0x140))/0x2+parseInt(_0x4c03cf(0x13a))/0x3+parseInt(_0x4c03cf(0x141))/0x4*(parseInt(_0x4c03cf(0x158))/0x5)+parseInt(_0x4c03cf(0x143))/0x6*(parseInt(_0x4c03cf(0x13f))/0x7)+-parseInt(_0x4c03cf(0x13c))/0x8*(-parseInt(_0x4c03cf(0x135))/0x9)+parseInt(_0x4c03cf(0x161))/0xa*(-parseInt(_0x4c03cf(0x162))/0xb);if(_0x3f47b9===_0x5c1347)break;else _0x56ef46['push'](_0x56ef46['shift']());}catch(_0x27c751){_0x56ef46['push'](_0x56ef46['shift']());}}}(a44_0x7c7b,0x95931));import{BaseCommand}from'./command.js';function a44_0x5edb(_0x2c4f6a,_0x86597a){_0x2c4f6a=_0x2c4f6a-0x135;const _0x7c7b27=a44_0x7c7b();let _0x5edbf2=_0x7c7b27[_0x2c4f6a];return _0x5edbf2;}function a44_0x7c7b(){const _0x2e1a98=['265wQasHb','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','file','\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','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','verbose','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','21520eNDxds','21219KWSuol','\x20file(s)\x20with\x20errors,\x20','length','errorCode','type','invalidCount','warnings','Error:\x20','252mMcRkc','):\x20','cyan','\x20warning(s)','valid','3095964WbqwDu','warningCount','279056pNUGgh','green','1126541yJNKvY','586964vypZWj','1362046pkIHnq','39876JQfoYe','yellow','30ZhwmMm','name','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20error(s)','filePath','red','error','.yml','\x20valid','log','helpText','segment:validate','parentSegment','hasErrors','targetDir','\x20warning(s)\x20found','✔\x20All\x20','dim','Validation\x20failed:\x20','.yaml','description'];a44_0x7c7b=function(){return _0x2e1a98;};return a44_0x7c7b();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x3fb3b4 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_0xcfb2c3(0x144)]=a44_0xcfb2c3(0x14e);[a44_0xcfb2c3(0x157)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async['execute'](_0x5e37b3){const _0x52dfc0=a44_0xcfb2c3,{options:_0x5109e4,args:_0x3db527}=_0x5e37b3,_0x406ad1=_0x5109e4,_0x5005e2=await resolveTarget({'arg':_0x3db527[0x0],'contextParent':_0x5109e4[_0x52dfc0(0x14f)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5005e2))return _0x5005e2[_0x52dfc0(0x165)]==='no_parent'?(console[_0x52dfc0(0x149)](a44_0x3fb3b4['yellow'](_0x52dfc0(0x145))),console[_0x52dfc0(0x149)](_0x52dfc0(0x15a)),console[_0x52dfc0(0x149)](_0x52dfc0(0x15c)),console[_0x52dfc0(0x149)](_0x52dfc0(0x15e))):(console[_0x52dfc0(0x149)](a44_0x3fb3b4['red'](_0x52dfc0(0x169)+_0x5005e2['message']+'\x0a')),_0x5005e2['helpText']&&console[_0x52dfc0(0x149)](a44_0x3fb3b4[_0x52dfc0(0x137)](_0x5005e2[_0x52dfc0(0x14d)]))),0x1;const _0x3bdccc=_0x5005e2[_0x52dfc0(0x151)],_0x35ab70=_0x5005e2[_0x52dfc0(0x166)]===_0x52dfc0(0x15b)?_0x5005e2[_0x52dfc0(0x147)]:undefined;if(!_0x35ab70&&!existsSync(_0x3bdccc))return console['error'](a44_0x3fb3b4[_0x52dfc0(0x148)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3bdccc+'\x0a')),0x1;let _0x10b03f;if(_0x35ab70){if(!_0x35ab70[_0x52dfc0(0x15d)](_0x52dfc0(0x14a))&&!_0x35ab70[_0x52dfc0(0x15d)](_0x52dfc0(0x156)))return console[_0x52dfc0(0x149)](a44_0x3fb3b4[_0x52dfc0(0x148)](_0x52dfc0(0x160)+_0x35ab70+'\x0a')),0x1;_0x10b03f=[_0x35ab70];}else _0x10b03f=findYamlFiles(_0x3bdccc);if(_0x10b03f[_0x52dfc0(0x164)]===0x0)return console[_0x52dfc0(0x149)](a44_0x3fb3b4[_0x52dfc0(0x148)](_0x52dfc0(0x159)+_0x3bdccc+'\x0a')),0x1;const _0x3806f6=validateYamlFiles(_0x10b03f,_0x3bdccc),_0x2bcad9=calculateSummary(_0x3806f6);for(const _0x184394 of _0x3806f6){if(!isValidationResult(_0x184394))continue;const {relativePath:_0x351b68,source:_0x5573f9,result:_0x536c48,fileType:_0x2fa9e6}=_0x184394,_0x4ce5cf=_0x2fa9e6;if(_0x536c48[_0x52dfc0(0x139)]&&_0x536c48[_0x52dfc0(0x168)][_0x52dfc0(0x164)]===0x0)_0x406ad1[_0x52dfc0(0x15f)]&&console['log'](a44_0x3fb3b4[_0x52dfc0(0x13d)]('✔\x20'+_0x351b68)+a44_0x3fb3b4[_0x52dfc0(0x154)]('\x20('+_0x4ce5cf+')'));else _0x536c48[_0x52dfc0(0x139)]?(console['log'](a44_0x3fb3b4[_0x52dfc0(0x142)]('⚠\x20'+_0x351b68)+a44_0x3fb3b4['dim']('\x20('+_0x4ce5cf+_0x52dfc0(0x136)+_0x536c48[_0x52dfc0(0x168)][_0x52dfc0(0x164)]+_0x52dfc0(0x138))),console[_0x52dfc0(0x14c)](formatValidationResult(_0x536c48,_0x5573f9,_0x351b68))):(console[_0x52dfc0(0x14c)](a44_0x3fb3b4[_0x52dfc0(0x148)]('✖\x20'+_0x351b68)+a44_0x3fb3b4[_0x52dfc0(0x154)]('\x20('+_0x4ce5cf+_0x52dfc0(0x136)+_0x536c48['errors'][_0x52dfc0(0x164)]+_0x52dfc0(0x146))),console[_0x52dfc0(0x14c)](formatValidationResult(_0x536c48,_0x5573f9,_0x351b68)));}return console[_0x52dfc0(0x14c)](''),_0x2bcad9[_0x52dfc0(0x150)]?(console[_0x52dfc0(0x14c)](a44_0x3fb3b4['red'](_0x52dfc0(0x155)+_0x2bcad9[_0x52dfc0(0x167)]+_0x52dfc0(0x163)+_0x2bcad9['validCount']+_0x52dfc0(0x14b))),_0x2bcad9[_0x52dfc0(0x13b)]>0x0&&console[_0x52dfc0(0x14c)](a44_0x3fb3b4[_0x52dfc0(0x142)](_0x2bcad9['warningCount']+_0x52dfc0(0x152))),0x1):(console['log'](a44_0x3fb3b4['green'](_0x52dfc0(0x153)+_0x2bcad9['validCount']+'\x20file(s)\x20valid')),_0x2bcad9[_0x52dfc0(0x13b)]>0x0&&console['log'](a44_0x3fb3b4[_0x52dfc0(0x142)](_0x2bcad9[_0x52dfc0(0x13b)]+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- const a45_0x4eb677=a45_0x4135;(function(_0x57edb2,_0x2e8882){const _0x31ec4f=a45_0x4135,_0x30811e=_0x57edb2();while(!![]){try{const _0x464670=parseInt(_0x31ec4f(0x113))/0x1+parseInt(_0x31ec4f(0x117))/0x2+parseInt(_0x31ec4f(0x10f))/0x3*(parseInt(_0x31ec4f(0x112))/0x4)+-parseInt(_0x31ec4f(0x116))/0x5+-parseInt(_0x31ec4f(0x145))/0x6*(-parseInt(_0x31ec4f(0x14d))/0x7)+-parseInt(_0x31ec4f(0x134))/0x8+-parseInt(_0x31ec4f(0x12a))/0x9;if(_0x464670===_0x2e8882)break;else _0x30811e['push'](_0x30811e['shift']());}catch(_0x52b9da){_0x30811e['push'](_0x30811e['shift']());}}}(a45_0x4b1d,0x23aad));function a45_0x4b1d(){const _0x1737ad=['recursive','Parent\x20ID:\x20','Error:\x20','24siAOXn','listUnifiedWithJourneys','test','\x20folder','folderId','Resolving\x20parent\x20segment\x20\x27','cause','jsonl','357567LrUtHY','maxDepth','type','site','data','map','✔\x20Found\x20','\x20journey','segment','parentSegment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','(empty)','(not\x20set)','dim','journeys','/app/ps/','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','sort','27309clDkcU','\x20segment','✔\x20Built\x20tree\x20with\x20','116mDtedX','209223SwFgWr','Set\x20a\x20parent\x20segment\x20context\x20first:','verbose','650560vJzQiC','497260WBnQhu','No\x20items\x20match\x20pattern:\x20','Resolving\x20path\x20\x27','parentId','log','listUnified','length','filter','/j/da','folders','format','Parent\x20segment\x20context:\x20','json','replace','Recursive\x20mode:\x20enabled','Folder/pattern\x20arg:\x20','Folder\x20ID:\x20','journey','\x20matching\x20\x27','3427173HNUHeZ','List\x20folders\x20and\x20child\x20segments',',\x20and\x20','Building\x20hierarchy\x20tree...','description','segments','message','folder','includes','\x20\x20Cause:\x20','2153296tKoHbN','\x5c$&','listWithPattern','children','resolvePathToResource','error','name','\x27...','Error:\x20No\x20parent\x20segment\x20context\x20set.','journeyBundleName','Listing\x20folders,\x20segments,\x20and\x20journeys...','localeCompare','listRecursive','/e/'];a45_0x4b1d=function(){return _0x1737ad;};return a45_0x4b1d();}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';function a45_0x4135(_0x3bcaf5,_0x5eec2b){_0x3bcaf5=_0x3bcaf5-0xfd;const _0x4b1d12=a45_0x4b1d();let _0x4135db=_0x4b1d12[_0x3bcaf5];return _0x4135db;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x2b40a0 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a45_0x4eb677(0x12f);[a45_0x4eb677(0x12e)]=a45_0x4eb677(0x12b);async['execute'](_0x4cd8ac){const _0x414419=a45_0x4eb677,{options:_0x5b38cd,args:_0x58db98}=_0x4cd8ac,_0x135348=_0x5b38cd[_0x414419(0x142)],_0x2bc246=_0x58db98[0x0];try{const _0x3278de=_0x5b38cd[_0x414419(0x105)];_0x5b38cd[_0x414419(0x115)]&&(console[_0x414419(0x139)]('Site:\x20'+_0x5b38cd[_0x414419(0xff)]),console['error'](_0x414419(0x122)+(_0x3278de||_0x414419(0x109))),_0x2bc246&&console[_0x414419(0x139)](_0x414419(0x126)+_0x2bc246),_0x135348&&console['error'](_0x414419(0x125)));if(!_0x3278de)return console['error'](_0x414419(0x13c)),console[_0x414419(0x139)](''),console[_0x414419(0x139)](_0x414419(0x114)),console['error'](_0x414419(0x106)),console['error'](_0x414419(0x107)),console[_0x414419(0x139)](''),console[_0x414419(0x139)](_0x414419(0x10d)),0x1;const _0x4fccde=_0x2bc246&&(_0x2bc246[_0x414419(0x132)]('*')||_0x2bc246['includes']('?'));if(_0x4fccde)return await this['listWithPattern'](_0x4cd8ac,_0x3278de,_0x2bc246);const _0x3598ca=_0x2bc246?_0x3278de+'/'+_0x2bc246:_0x3278de;return _0x135348?await this[_0x414419(0x140)](_0x4cd8ac,_0x3598ca):await this['listUnified'](_0x4cd8ac,_0x3598ca);}catch(_0xf280e1){if(_0xf280e1 instanceof SDKError)return console[_0x414419(0x139)](_0x414419(0x144)+_0xf280e1[_0x414419(0x130)]),_0xf280e1[_0x414419(0x14b)]&&console[_0x414419(0x139)](_0x414419(0x133)+_0xf280e1[_0x414419(0x14b)]),0x1;throw _0xf280e1;}}async[a45_0x4eb677(0x136)](_0x51f540,_0x47ea54,_0x2920d9){const _0x14ef1f=a45_0x4eb677,{options:_0x29f91c,tdx:_0x59282d}=_0x51f540,_0x45440c=await withSpinner(_0x14ef1f(0x14a)+_0x47ea54+_0x14ef1f(0x13b),()=>_0x59282d[_0x14ef1f(0x104)][_0x14ef1f(0x138)](_0x47ea54),{'verbose':_0x29f91c[_0x14ef1f(0x115)]}),_0x49eeb5=_0x45440c['data'],_0x466a66=await withSpinner(_0x14ef1f(0x13e),()=>_0x59282d[_0x14ef1f(0x104)][_0x14ef1f(0x146)](_0x49eeb5[_0x14ef1f(0x11a)],_0x49eeb5[_0x14ef1f(0x149)]),{'verbose':_0x29f91c[_0x14ef1f(0x115)]}),{folders:_0x2007fe,segments:_0x1f4669,journeys:_0x36db5b}=_0x466a66[_0x14ef1f(0x100)],_0x1427d9=_0x2920d9[_0x14ef1f(0x124)](/[.+^${}()|[\]\\]/g,_0x14ef1f(0x135))[_0x14ef1f(0x124)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x50956e=new RegExp('^'+_0x1427d9+'$','i'),_0x4f57fd=_0x2007fe[_0x14ef1f(0x11e)](_0xff3f51=>_0x50956e['test'](_0xff3f51[_0x14ef1f(0x13a)])),_0x4ce2ce=_0x1f4669['filter'](_0xc68ef9=>_0x50956e[_0x14ef1f(0x147)](_0xc68ef9[_0x14ef1f(0x13a)])),_0x2edf70=_0x36db5b['filter'](_0x14cdd2=>_0x50956e['test'](_0x14cdd2['journeyBundleName'])),_0x375c4a=_0x4f57fd['length']+_0x4ce2ce['length']+_0x2edf70[_0x14ef1f(0x11d)];console['error']('✔\x20Found\x20'+_0x4f57fd[_0x14ef1f(0x11d)]+_0x14ef1f(0x148)+(_0x4f57fd[_0x14ef1f(0x11d)]!==0x1?'s':'')+',\x20'+_0x4ce2ce['length']+_0x14ef1f(0x110)+(_0x4ce2ce[_0x14ef1f(0x11d)]!==0x1?'s':'')+_0x14ef1f(0x12c)+_0x2edf70['length']+_0x14ef1f(0x103)+(_0x2edf70[_0x14ef1f(0x11d)]!==0x1?'s':'')+_0x14ef1f(0x129)+_0x2920d9+'\x27');const _0x5a9ea0=_0x465b6e=>{const _0x19abd7=_0x14ef1f;return getConsoleNextUrl(_0x29f91c[_0x19abd7(0xff)],'/app/ps/'+_0x49eeb5[_0x19abd7(0x11a)]+'/e/'+_0x465b6e);},_0x2d5140=_0x29f91c[_0x14ef1f(0x121)]===_0x14ef1f(0x123)||_0x29f91c[_0x14ef1f(0x121)]==='jsonl';if(_0x2d5140){const _0x52d0a7=[..._0x4f57fd[_0x14ef1f(0x101)](_0x4147eb=>({..._0x4147eb,'type':_0x14ef1f(0x131)})),..._0x4ce2ce[_0x14ef1f(0x101)](_0x488e98=>({..._0x488e98,'type':_0x14ef1f(0x104),'url':_0x5a9ea0(_0x488e98['id'])})),..._0x2edf70[_0x14ef1f(0x101)](_0x326ff6=>({..._0x326ff6,'name':_0x326ff6[_0x14ef1f(0x13d)],'type':_0x14ef1f(0x128)}))][_0x14ef1f(0x10e)]((_0xd24f64,_0x1c279c)=>_0xd24f64[_0x14ef1f(0x13a)][_0x14ef1f(0x13f)](_0x1c279c[_0x14ef1f(0x13a)]));await handleSDKOutput(_0x52d0a7,_0x29f91c);}else{if(_0x375c4a===0x0)console[_0x14ef1f(0x11b)](_0x14ef1f(0x118)+_0x2920d9);else{console['log'](a45_0x2b40a0[_0x14ef1f(0x10a)]('['+_0x47ea54+']\x20matching\x20\x27'+_0x2920d9+'\x27'));const _0x1832f6=formatFlatList(_0x4f57fd,_0x4ce2ce,{'showMetadata':!![],'getSegmentUrl':_0x5a9ea0},_0x2edf70);console[_0x14ef1f(0x11b)](_0x1832f6);}}return 0x0;}async[a45_0x4eb677(0x11c)](_0x25aeb1,_0x5aa547){const _0x19d45d=a45_0x4eb677,{options:_0x4cb019,tdx:_0x5f1c8b}=_0x25aeb1,_0x51e9b9=await withSpinner('Resolving\x20path\x20\x27'+_0x5aa547+_0x19d45d(0x13b),()=>_0x5f1c8b[_0x19d45d(0x104)][_0x19d45d(0x138)](_0x5aa547),{'verbose':_0x4cb019[_0x19d45d(0x115)]}),_0x30194e=_0x51e9b9[_0x19d45d(0x100)];_0x4cb019['verbose']&&(console[_0x19d45d(0x139)](_0x19d45d(0x143)+_0x30194e[_0x19d45d(0x11a)]),_0x30194e[_0x19d45d(0x149)]&&console[_0x19d45d(0x139)]('Folder\x20ID:\x20'+_0x30194e[_0x19d45d(0x149)]));const _0x1043ae=await withSpinner(_0x19d45d(0x13e),()=>_0x5f1c8b[_0x19d45d(0x104)][_0x19d45d(0x146)](_0x30194e[_0x19d45d(0x11a)],_0x30194e['folderId']),{'verbose':_0x4cb019[_0x19d45d(0x115)]}),{folders:_0x349f20,segments:_0x4aefce,journeys:_0x1e5791}=_0x1043ae[_0x19d45d(0x100)],_0x182a45=_0x349f20[_0x19d45d(0x11d)]+_0x4aefce[_0x19d45d(0x11d)]+_0x1e5791[_0x19d45d(0x11d)];console[_0x19d45d(0x139)](_0x19d45d(0x102)+_0x349f20[_0x19d45d(0x11d)]+'\x20folder'+(_0x349f20[_0x19d45d(0x11d)]!==0x1?'s':'')+',\x20'+_0x4aefce[_0x19d45d(0x11d)]+_0x19d45d(0x110)+(_0x4aefce[_0x19d45d(0x11d)]!==0x1?'s':'')+',\x20and\x20'+_0x1e5791['length']+_0x19d45d(0x103)+(_0x1e5791[_0x19d45d(0x11d)]!==0x1?'s':''));const _0x2e0acd=_0x173bfa=>{const _0x5d8519=_0x19d45d;return getConsoleNextUrl(_0x4cb019[_0x5d8519(0xff)],_0x5d8519(0x10c)+_0x30194e[_0x5d8519(0x11a)]+_0x5d8519(0x141)+_0x173bfa);},_0x4af852=_0xc9718b=>{const _0x1ab7b0=_0x19d45d;return getConsoleNextUrl(_0x4cb019[_0x1ab7b0(0xff)],_0x1ab7b0(0x10c)+_0x30194e[_0x1ab7b0(0x11a)]+'/e/'+_0xc9718b+'/j/da');},_0x469188=_0x4cb019[_0x19d45d(0x121)]==='json'||_0x4cb019[_0x19d45d(0x121)]==='jsonl';if(_0x469188){const _0x2e771b=[..._0x349f20['map'](_0x512f77=>({..._0x512f77,'type':_0x19d45d(0x131)})),..._0x4aefce[_0x19d45d(0x101)](_0x5e8e28=>({..._0x5e8e28,'type':_0x19d45d(0x104),'url':_0x2e0acd(_0x5e8e28['id'])})),..._0x1e5791['map'](_0x299356=>({..._0x299356,'name':_0x299356['journeyBundleName'],'type':_0x19d45d(0x128),'url':_0x4af852(_0x299356['id'])}))][_0x19d45d(0x10e)]((_0xcfdf9f,_0x58c4a0)=>_0xcfdf9f[_0x19d45d(0x13a)]['localeCompare'](_0x58c4a0[_0x19d45d(0x13a)]));await handleSDKOutput(_0x2e771b,_0x4cb019);}else{if(_0x182a45===0x0)console['log'](a45_0x2b40a0[_0x19d45d(0x10a)]('['+_0x5aa547+']')),console[_0x19d45d(0x11b)](_0x19d45d(0x108));else{console[_0x19d45d(0x11b)](a45_0x2b40a0['dim']('['+_0x5aa547+']'));const _0x3751de=formatFlatList(_0x349f20,_0x4aefce,{'showMetadata':!![],'getSegmentUrl':_0x2e0acd,'getJourneyUrl':_0x4af852},_0x1e5791);console[_0x19d45d(0x11b)](_0x3751de);}}return 0x0;}async[a45_0x4eb677(0x140)](_0x55b685,_0x2c9658){const _0x5ec979=a45_0x4eb677,{options:_0x138009,tdx:_0x422578}=_0x55b685,_0x513447=await withSpinner(_0x5ec979(0x119)+_0x2c9658+'\x27...',()=>_0x422578[_0x5ec979(0x104)][_0x5ec979(0x138)](_0x2c9658),{'verbose':_0x138009[_0x5ec979(0x115)]}),_0xd6bba=_0x513447['data'];_0x138009['verbose']&&(console[_0x5ec979(0x139)](_0x5ec979(0x143)+_0xd6bba[_0x5ec979(0x11a)]),_0xd6bba['folderId']&&console[_0x5ec979(0x139)](_0x5ec979(0x127)+_0xd6bba[_0x5ec979(0x149)]));const _0x575992=_0x138009[_0x5ec979(0xfd)]||0xa,_0x20dc4c=await withSpinner(_0x5ec979(0x12d),()=>_0x422578[_0x5ec979(0x104)][_0x5ec979(0x140)](_0xd6bba[_0x5ec979(0x11a)],_0xd6bba[_0x5ec979(0x149)],0x0,_0x575992),{'verbose':_0x138009['verbose']}),_0x434836=_0x20dc4c[_0x5ec979(0x100)],_0x259db6=_0x5cea53=>{const _0x51c533=_0x5ec979;let _0x1647c1=0x0,_0x5a6fe0=0x0,_0x4667be=0x0;for(const _0xa2ba39 of _0x5cea53){if(_0xa2ba39[_0x51c533(0xfe)]==='folder')_0x1647c1++;else{if(_0xa2ba39['type']==='segment')_0x5a6fe0++;else{if(_0xa2ba39[_0x51c533(0xfe)]===_0x51c533(0x128))_0x4667be++;}}if(_0xa2ba39[_0x51c533(0x137)]){const _0x54f5c7=_0x259db6(_0xa2ba39[_0x51c533(0x137)]);_0x1647c1+=_0x54f5c7[_0x51c533(0x120)],_0x5a6fe0+=_0x54f5c7[_0x51c533(0x12f)],_0x4667be+=_0x54f5c7[_0x51c533(0x10b)];}}return{'folders':_0x1647c1,'segments':_0x5a6fe0,'journeys':_0x4667be};},_0x27d6d0=_0x259db6(_0x434836);console['error'](_0x5ec979(0x111)+_0x27d6d0[_0x5ec979(0x120)]+_0x5ec979(0x148)+(_0x27d6d0[_0x5ec979(0x120)]!==0x1?'s':'')+',\x20'+_0x27d6d0[_0x5ec979(0x12f)]+_0x5ec979(0x110)+(_0x27d6d0['segments']!==0x1?'s':'')+_0x5ec979(0x12c)+_0x27d6d0[_0x5ec979(0x10b)]+'\x20journey'+(_0x27d6d0[_0x5ec979(0x10b)]!==0x1?'s':''));const _0x1c11a1=_0x505874=>{const _0x28a332=_0x5ec979;return getConsoleNextUrl(_0x138009['site'],'/app/ps/'+_0xd6bba[_0x28a332(0x11a)]+_0x28a332(0x141)+_0x505874);},_0x1b1ff4=_0x5ebc27=>{const _0x1986ef=_0x5ec979;return getConsoleNextUrl(_0x138009[_0x1986ef(0xff)],_0x1986ef(0x10c)+_0xd6bba[_0x1986ef(0x11a)]+_0x1986ef(0x141)+_0x5ebc27+_0x1986ef(0x11f));};if(_0x138009[_0x5ec979(0x121)]===_0x5ec979(0x123)||_0x138009['format']===_0x5ec979(0x14c))await handleSDKOutput(_0x434836,_0x138009);else{console[_0x5ec979(0x11b)](a45_0x2b40a0[_0x5ec979(0x10a)]('['+_0x2c9658+']'));const _0x575862=formatTree(_0x434836,{'showMetadata':!![],'getSegmentUrl':_0x1c11a1,'getJourneyUrl':_0x1b1ff4});console[_0x5ec979(0x11b)](_0x575862);}return 0x0;}}
1
+ const a45_0x4b3174=a45_0x10fb;(function(_0x1f54bf,_0x14b7a2){const _0x48aa2a=a45_0x10fb,_0x2ee6c5=_0x1f54bf();while(!![]){try{const _0x230971=-parseInt(_0x48aa2a(0x1bb))/0x1+parseInt(_0x48aa2a(0x1a3))/0x2+parseInt(_0x48aa2a(0x1d7))/0x3+-parseInt(_0x48aa2a(0x1b3))/0x4+-parseInt(_0x48aa2a(0x1d2))/0x5*(parseInt(_0x48aa2a(0x1c3))/0x6)+-parseInt(_0x48aa2a(0x1c2))/0x7+parseInt(_0x48aa2a(0x1cf))/0x8*(parseInt(_0x48aa2a(0x1bc))/0x9);if(_0x230971===_0x14b7a2)break;else _0x2ee6c5['push'](_0x2ee6c5['shift']());}catch(_0x39f2f8){_0x2ee6c5['push'](_0x2ee6c5['shift']());}}}(a45_0x420a,0xb7338));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';function a45_0x10fb(_0x460fe2,_0x4339b2){_0x460fe2=_0x460fe2-0x196;const _0x420ac2=a45_0x420a();let _0x10fbdf=_0x420ac2[_0x460fe2];return _0x10fbdf;}import a45_0x7ee2b6 from'chalk';function a45_0x420a(){const _0x2dd981=['191700JpnGfM','5688063bNbniD','listUnifiedWithJourneys','length','/app/ps/','Folder\x20ID:\x20','Parent\x20ID:\x20','3291533Aayrsj','502206mZuZNB','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20folder','execute','maxDepth','folder','Error:\x20No\x20parent\x20segment\x20context\x20set.','replace','journeys','data','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x5c$&','8SXzTDN','sort','listWithPattern','35lvifJO','Resolving\x20path\x20\x27','/e/','verbose','localeCompare','4081128DvGHqf','/j/da','No\x20items\x20match\x20pattern:\x20','message','format','\x20matching\x20\x27','name','log','Recursive\x20mode:\x20enabled','dim','\x20journey','children','\x20\x20Cause:\x20','filter','map','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','(empty)','type','resolvePathToResource','cause','folderId','\x27...','error','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','journeyBundleName','2946282XggeJx','✔\x20Found\x20','site','test','folders','Parent\x20segment\x20context:\x20','jsonl','parentSegment','json','journey','Set\x20a\x20parent\x20segment\x20context\x20first:','listUnified','Folder/pattern\x20arg:\x20','\x20segment',',\x20and\x20','parentId','5869224uDzxov','Error:\x20','recursive','includes','listRecursive','segment','segments','List\x20folders\x20and\x20child\x20segments'];a45_0x420a=function(){return _0x2dd981;};return a45_0x420a();}export class SegmentsCommand extends BaseCommand{[a45_0x4b3174(0x1dd)]=a45_0x4b3174(0x1b9);['description']=a45_0x4b3174(0x1ba);async[a45_0x4b3174(0x1c6)](_0x4130df){const _0x503cf7=a45_0x4b3174,{options:_0x13efd6,args:_0x1d5cc6}=_0x4130df,_0x2e0de7=_0x13efd6[_0x503cf7(0x1b5)],_0x5b5201=_0x1d5cc6[0x0];try{const _0x2acb0a=_0x13efd6[_0x503cf7(0x1aa)];_0x13efd6['verbose']&&(console['error']('Site:\x20'+_0x13efd6[_0x503cf7(0x1a5)]),console[_0x503cf7(0x1a0)](_0x503cf7(0x1a8)+(_0x2acb0a||'(not\x20set)')),_0x5b5201&&console[_0x503cf7(0x1a0)](_0x503cf7(0x1af)+_0x5b5201),_0x2e0de7&&console['error'](_0x503cf7(0x1df)));if(!_0x2acb0a)return console[_0x503cf7(0x1a0)](_0x503cf7(0x1c9)),console[_0x503cf7(0x1a0)](''),console[_0x503cf7(0x1a0)](_0x503cf7(0x1ad)),console[_0x503cf7(0x1a0)](_0x503cf7(0x199)),console[_0x503cf7(0x1a0)](_0x503cf7(0x1cd)),console[_0x503cf7(0x1a0)](''),console[_0x503cf7(0x1a0)](_0x503cf7(0x1a1)),0x1;const _0x2d5e9c=_0x5b5201&&(_0x5b5201[_0x503cf7(0x1b6)]('*')||_0x5b5201[_0x503cf7(0x1b6)]('?'));if(_0x2d5e9c)return await this['listWithPattern'](_0x4130df,_0x2acb0a,_0x5b5201);const _0x147412=_0x5b5201?_0x2acb0a+'/'+_0x5b5201:_0x2acb0a;return _0x2e0de7?await this[_0x503cf7(0x1b7)](_0x4130df,_0x147412):await this[_0x503cf7(0x1ae)](_0x4130df,_0x147412);}catch(_0x476441){if(_0x476441 instanceof SDKError)return console[_0x503cf7(0x1a0)](_0x503cf7(0x1b4)+_0x476441[_0x503cf7(0x1da)]),_0x476441[_0x503cf7(0x19d)]&&console[_0x503cf7(0x1a0)](_0x503cf7(0x196)+_0x476441['cause']),0x1;throw _0x476441;}}async[a45_0x4b3174(0x1d1)](_0x11be9d,_0x53a10a,_0x33a757){const _0x1c3b9f=a45_0x4b3174,{options:_0x35dff8,tdx:_0x59c5a1}=_0x11be9d,_0x2a9bc2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x53a10a+_0x1c3b9f(0x19f),()=>_0x59c5a1['segment']['resolvePathToResource'](_0x53a10a),{'verbose':_0x35dff8[_0x1c3b9f(0x1d5)]}),_0x29de48=_0x2a9bc2['data'],_0x3871b6=await withSpinner(_0x1c3b9f(0x1c4),()=>_0x59c5a1['segment']['listUnifiedWithJourneys'](_0x29de48[_0x1c3b9f(0x1b2)],_0x29de48[_0x1c3b9f(0x19e)]),{'verbose':_0x35dff8[_0x1c3b9f(0x1d5)]}),{folders:_0x62c542,segments:_0x2957b4,journeys:_0x2c4bd1}=_0x3871b6[_0x1c3b9f(0x1cc)],_0x14fc8f=_0x33a757[_0x1c3b9f(0x1ca)](/[.+^${}()|[\]\\]/g,_0x1c3b9f(0x1ce))[_0x1c3b9f(0x1ca)](/\*/g,'.*')[_0x1c3b9f(0x1ca)](/\?/g,'.'),_0x605954=new RegExp('^'+_0x14fc8f+'$','i'),_0x46057d=_0x62c542[_0x1c3b9f(0x197)](_0x3ce07a=>_0x605954[_0x1c3b9f(0x1a6)](_0x3ce07a[_0x1c3b9f(0x1dd)])),_0x2db4b6=_0x2957b4['filter'](_0x7056b4=>_0x605954[_0x1c3b9f(0x1a6)](_0x7056b4[_0x1c3b9f(0x1dd)])),_0x119395=_0x2c4bd1[_0x1c3b9f(0x197)](_0x2af0c2=>_0x605954[_0x1c3b9f(0x1a6)](_0x2af0c2[_0x1c3b9f(0x1a2)])),_0x2471af=_0x46057d[_0x1c3b9f(0x1be)]+_0x2db4b6[_0x1c3b9f(0x1be)]+_0x119395[_0x1c3b9f(0x1be)];console['error']('✔\x20Found\x20'+_0x46057d['length']+_0x1c3b9f(0x1c5)+(_0x46057d[_0x1c3b9f(0x1be)]!==0x1?'s':'')+',\x20'+_0x2db4b6[_0x1c3b9f(0x1be)]+_0x1c3b9f(0x1b0)+(_0x2db4b6[_0x1c3b9f(0x1be)]!==0x1?'s':'')+',\x20and\x20'+_0x119395[_0x1c3b9f(0x1be)]+_0x1c3b9f(0x1e1)+(_0x119395[_0x1c3b9f(0x1be)]!==0x1?'s':'')+_0x1c3b9f(0x1dc)+_0x33a757+'\x27');const _0x5ad4bc=_0x129116=>{const _0x270fca=_0x1c3b9f;return getConsoleNextUrl(_0x35dff8['site'],_0x270fca(0x1bf)+_0x29de48['parentId']+_0x270fca(0x1d4)+_0x129116);},_0x3758b5=_0x35dff8[_0x1c3b9f(0x1db)]===_0x1c3b9f(0x1ab)||_0x35dff8['format']==='jsonl';if(_0x3758b5){const _0x2857b5=[..._0x46057d['map'](_0x274a78=>({..._0x274a78,'type':_0x1c3b9f(0x1c8)})),..._0x2db4b6[_0x1c3b9f(0x198)](_0xce9d4a=>({..._0xce9d4a,'type':_0x1c3b9f(0x1b8),'url':_0x5ad4bc(_0xce9d4a['id'])})),..._0x119395['map'](_0x571d01=>({..._0x571d01,'name':_0x571d01[_0x1c3b9f(0x1a2)],'type':_0x1c3b9f(0x1ac)}))][_0x1c3b9f(0x1d0)]((_0x2a997f,_0x10945c)=>_0x2a997f[_0x1c3b9f(0x1dd)]['localeCompare'](_0x10945c['name']));await handleSDKOutput(_0x2857b5,_0x35dff8);}else{if(_0x2471af===0x0)console[_0x1c3b9f(0x1de)](_0x1c3b9f(0x1d9)+_0x33a757);else{console[_0x1c3b9f(0x1de)](a45_0x7ee2b6[_0x1c3b9f(0x1e0)]('['+_0x53a10a+']\x20matching\x20\x27'+_0x33a757+'\x27'));const _0x7b4b75=formatFlatList(_0x46057d,_0x2db4b6,{'showMetadata':!![],'getSegmentUrl':_0x5ad4bc},_0x119395);console[_0x1c3b9f(0x1de)](_0x7b4b75);}}return 0x0;}async[a45_0x4b3174(0x1ae)](_0x43ff0a,_0x3d2703){const _0xe69205=a45_0x4b3174,{options:_0x2ebce3,tdx:_0x1a1c06}=_0x43ff0a,_0x2e53a1=await withSpinner(_0xe69205(0x1d3)+_0x3d2703+_0xe69205(0x19f),()=>_0x1a1c06[_0xe69205(0x1b8)][_0xe69205(0x19c)](_0x3d2703),{'verbose':_0x2ebce3[_0xe69205(0x1d5)]}),_0x29ce30=_0x2e53a1[_0xe69205(0x1cc)];_0x2ebce3[_0xe69205(0x1d5)]&&(console[_0xe69205(0x1a0)](_0xe69205(0x1c1)+_0x29ce30[_0xe69205(0x1b2)]),_0x29ce30[_0xe69205(0x19e)]&&console[_0xe69205(0x1a0)]('Folder\x20ID:\x20'+_0x29ce30[_0xe69205(0x19e)]));const _0x4dde39=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x1a1c06[_0xe69205(0x1b8)][_0xe69205(0x1bd)](_0x29ce30['parentId'],_0x29ce30[_0xe69205(0x19e)]),{'verbose':_0x2ebce3[_0xe69205(0x1d5)]}),{folders:_0x20ad9c,segments:_0x43fd5f,journeys:_0x41d03b}=_0x4dde39[_0xe69205(0x1cc)],_0x4418c0=_0x20ad9c['length']+_0x43fd5f[_0xe69205(0x1be)]+_0x41d03b[_0xe69205(0x1be)];console[_0xe69205(0x1a0)](_0xe69205(0x1a4)+_0x20ad9c[_0xe69205(0x1be)]+_0xe69205(0x1c5)+(_0x20ad9c[_0xe69205(0x1be)]!==0x1?'s':'')+',\x20'+_0x43fd5f[_0xe69205(0x1be)]+_0xe69205(0x1b0)+(_0x43fd5f[_0xe69205(0x1be)]!==0x1?'s':'')+',\x20and\x20'+_0x41d03b[_0xe69205(0x1be)]+_0xe69205(0x1e1)+(_0x41d03b[_0xe69205(0x1be)]!==0x1?'s':''));const _0x4d5988=_0x385fd8=>{const _0x5a02c9=_0xe69205;return getConsoleNextUrl(_0x2ebce3[_0x5a02c9(0x1a5)],_0x5a02c9(0x1bf)+_0x29ce30[_0x5a02c9(0x1b2)]+_0x5a02c9(0x1d4)+_0x385fd8);},_0x5d26af=_0x50fb6d=>{const _0x5521bd=_0xe69205;return getConsoleNextUrl(_0x2ebce3[_0x5521bd(0x1a5)],_0x5521bd(0x1bf)+_0x29ce30['parentId']+'/e/'+_0x50fb6d+'/j/da');},_0x452d97=_0x2ebce3[_0xe69205(0x1db)]===_0xe69205(0x1ab)||_0x2ebce3[_0xe69205(0x1db)]===_0xe69205(0x1a9);if(_0x452d97){const _0x4e8f3c=[..._0x20ad9c[_0xe69205(0x198)](_0x4417f6=>({..._0x4417f6,'type':_0xe69205(0x1c8)})),..._0x43fd5f['map'](_0x178685=>({..._0x178685,'type':_0xe69205(0x1b8),'url':_0x4d5988(_0x178685['id'])})),..._0x41d03b[_0xe69205(0x198)](_0x14080b=>({..._0x14080b,'name':_0x14080b['journeyBundleName'],'type':_0xe69205(0x1ac),'url':_0x5d26af(_0x14080b['id'])}))][_0xe69205(0x1d0)]((_0x5d50a0,_0xe3f61f)=>_0x5d50a0[_0xe69205(0x1dd)][_0xe69205(0x1d6)](_0xe3f61f[_0xe69205(0x1dd)]));await handleSDKOutput(_0x4e8f3c,_0x2ebce3);}else{if(_0x4418c0===0x0)console[_0xe69205(0x1de)](a45_0x7ee2b6['dim']('['+_0x3d2703+']')),console[_0xe69205(0x1de)](_0xe69205(0x19a));else{console[_0xe69205(0x1de)](a45_0x7ee2b6[_0xe69205(0x1e0)]('['+_0x3d2703+']'));const _0x3c76f1=formatFlatList(_0x20ad9c,_0x43fd5f,{'showMetadata':!![],'getSegmentUrl':_0x4d5988,'getJourneyUrl':_0x5d26af},_0x41d03b);console['log'](_0x3c76f1);}}return 0x0;}async[a45_0x4b3174(0x1b7)](_0x29b361,_0x50128c){const _0x363f18=a45_0x4b3174,{options:_0x640f40,tdx:_0x4e029}=_0x29b361,_0x3f8850=await withSpinner(_0x363f18(0x1d3)+_0x50128c+_0x363f18(0x19f),()=>_0x4e029['segment'][_0x363f18(0x19c)](_0x50128c),{'verbose':_0x640f40['verbose']}),_0x5e085a=_0x3f8850[_0x363f18(0x1cc)];_0x640f40[_0x363f18(0x1d5)]&&(console[_0x363f18(0x1a0)](_0x363f18(0x1c1)+_0x5e085a['parentId']),_0x5e085a[_0x363f18(0x19e)]&&console[_0x363f18(0x1a0)](_0x363f18(0x1c0)+_0x5e085a[_0x363f18(0x19e)]));const _0x46e9c1=_0x640f40[_0x363f18(0x1c7)]||0xa,_0x451436=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x4e029['segment'][_0x363f18(0x1b7)](_0x5e085a[_0x363f18(0x1b2)],_0x5e085a[_0x363f18(0x19e)],0x0,_0x46e9c1),{'verbose':_0x640f40[_0x363f18(0x1d5)]}),_0xbd49f2=_0x451436[_0x363f18(0x1cc)],_0x4f8f7a=_0x47f0a0=>{const _0x32c1e1=_0x363f18;let _0x2ad416=0x0,_0x5ad7d4=0x0,_0x25eedd=0x0;for(const _0x14eaee of _0x47f0a0){if(_0x14eaee[_0x32c1e1(0x19b)]===_0x32c1e1(0x1c8))_0x2ad416++;else{if(_0x14eaee[_0x32c1e1(0x19b)]===_0x32c1e1(0x1b8))_0x5ad7d4++;else{if(_0x14eaee[_0x32c1e1(0x19b)]===_0x32c1e1(0x1ac))_0x25eedd++;}}if(_0x14eaee['children']){const _0x337a2c=_0x4f8f7a(_0x14eaee[_0x32c1e1(0x1e2)]);_0x2ad416+=_0x337a2c['folders'],_0x5ad7d4+=_0x337a2c[_0x32c1e1(0x1b9)],_0x25eedd+=_0x337a2c['journeys'];}}return{'folders':_0x2ad416,'segments':_0x5ad7d4,'journeys':_0x25eedd};},_0x184054=_0x4f8f7a(_0xbd49f2);console[_0x363f18(0x1a0)]('✔\x20Built\x20tree\x20with\x20'+_0x184054[_0x363f18(0x1a7)]+_0x363f18(0x1c5)+(_0x184054[_0x363f18(0x1a7)]!==0x1?'s':'')+',\x20'+_0x184054[_0x363f18(0x1b9)]+_0x363f18(0x1b0)+(_0x184054['segments']!==0x1?'s':'')+_0x363f18(0x1b1)+_0x184054['journeys']+'\x20journey'+(_0x184054[_0x363f18(0x1cb)]!==0x1?'s':''));const _0x484594=_0x5260e2=>{const _0x313e9c=_0x363f18;return getConsoleNextUrl(_0x640f40['site'],_0x313e9c(0x1bf)+_0x5e085a[_0x313e9c(0x1b2)]+_0x313e9c(0x1d4)+_0x5260e2);},_0x38bd5d=_0x393c4b=>{const _0x329cec=_0x363f18;return getConsoleNextUrl(_0x640f40['site'],'/app/ps/'+_0x5e085a['parentId']+_0x329cec(0x1d4)+_0x393c4b+_0x329cec(0x1d8));};if(_0x640f40[_0x363f18(0x1db)]===_0x363f18(0x1ab)||_0x640f40[_0x363f18(0x1db)]===_0x363f18(0x1a9))await handleSDKOutput(_0xbd49f2,_0x640f40);else{console[_0x363f18(0x1de)](a45_0x7ee2b6[_0x363f18(0x1e0)]('['+_0x50128c+']'));const _0x3deef2=formatTree(_0xbd49f2,{'showMetadata':!![],'getSegmentUrl':_0x484594,'getJourneyUrl':_0x38bd5d});console[_0x363f18(0x1de)](_0x3deef2);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x5b54c6=a46_0x1739;(function(_0x1c0d43,_0x13dd98){const _0x18950f=a46_0x1739,_0x2cc6b6=_0x1c0d43();while(!![]){try{const _0x5d739a=parseInt(_0x18950f(0xbe))/0x1+-parseInt(_0x18950f(0xc1))/0x2*(parseInt(_0x18950f(0xba))/0x3)+-parseInt(_0x18950f(0xce))/0x4+-parseInt(_0x18950f(0xc9))/0x5*(parseInt(_0x18950f(0xaf))/0x6)+parseInt(_0x18950f(0xc7))/0x7*(-parseInt(_0x18950f(0xc0))/0x8)+parseInt(_0x18950f(0xa9))/0x9*(parseInt(_0x18950f(0xb3))/0xa)+parseInt(_0x18950f(0xb1))/0xb;if(_0x5d739a===_0x13dd98)break;else _0x2cc6b6['push'](_0x2cc6b6['shift']());}catch(_0x1462fc){_0x2cc6b6['push'](_0x2cc6b6['shift']());}}}(a46_0x251e,0x82fa4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a46_0x1739(_0x2e1a43,_0x226244){_0x2e1a43=_0x2e1a43-0xa6;const _0x251e2f=a46_0x251e();let _0x1739a6=_0x251e2f[_0x2e1a43];return _0x1739a6;}function a46_0x251e(){const _0x4ce85b=['1040082DUqThT','...','72fKllmW','1641742IQDJlA','✔\x20Retrieved\x20','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','show','showTable','execute','204211SVjmcv','validate','5bqvaUO','verbose','cause','Usage:\x20tdx\x20show\x20<database.table>','data','654552TTCJxe','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','site','30483FmnwjA','\x20from\x20','message','Catalog:\x20','catalog','Error:\x20','2733078MmDCqb','limit','12592679tUxecO','length','160fUdypR','database','description','error','Limit:\x20','Table:\x20','Site:\x20','3hlUZyp','args','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','name'];a46_0x251e=function(){return _0x4ce85b;};return a46_0x251e();}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_0x5b54c6(0xbd)]=a46_0x5b54c6(0xc4);[a46_0x5b54c6(0xb5)]='Show\x20table\x20contents';async[a46_0x5b54c6(0xc6)](_0x591503){const _0x104baa=a46_0x5b54c6;return this[_0x104baa(0xc5)](_0x591503);}async[a46_0x5b54c6(0xc5)](_0x9f0c40){const _0x134552=a46_0x5b54c6,{options:_0x46cea9,args:_0x290f10,tdx:_0x4c9921}=_0x9f0c40;let _0x6ac4ce;try{_0x6ac4ce=parseTableReference(_0x290f10[0x0]);const _0x3da007=_0x46cea9['database'];!_0x6ac4ce[_0x134552(0xb4)]&&_0x3da007&&(_0x6ac4ce[_0x134552(0xb4)]=_0x3da007);const _0x10edda=validateTableDescribeReference(_0x6ac4ce);if(_0x10edda)return console[_0x134552(0xb6)]('Error:\x20'+_0x10edda),console[_0x134552(0xb6)](_0x134552(0xcc)),console['error'](_0x134552(0xa7)),console[_0x134552(0xb6)](_0x134552(0xa6)),0x1;}catch(_0x10634c){return console[_0x134552(0xb6)]('Error:\x20'+_0x10634c[_0x134552(0xab)]),console[_0x134552(0xb6)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x134552(0xb6)](_0x134552(0xa7)),console[_0x134552(0xb6)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x34865c=_0x6ac4ce[_0x134552(0xad)],_0x25837c=_0x6ac4ce[_0x134552(0xb4)],_0x431793=_0x6ac4ce['table'],_0x16cf68=resolveLimit(_0x46cea9[_0x134552(0xb0)],DEFAULT_DISPLAY_LIMIT);try{_0x46cea9[_0x134552(0xca)]&&(console[_0x134552(0xb6)](_0x134552(0xb9)+_0x46cea9[_0x134552(0xa8)]),_0x34865c&&console[_0x134552(0xb6)](_0x134552(0xac)+_0x34865c),console[_0x134552(0xb6)]('Database:\x20'+_0x25837c),console[_0x134552(0xb6)](_0x134552(0xb8)+_0x431793),console[_0x134552(0xb6)](_0x134552(0xb7)+_0x16cf68));const _0x4ef98f=_0x34865c?_0x34865c+'.'+_0x25837c+'.'+_0x431793:_0x25837c+'.'+_0x431793,_0x2b472e=await withSpinner('Querying\x20'+_0x4ef98f+_0x134552(0xbf),()=>_0x4c9921['query'][_0x134552(0xc5)](_0x25837c,_0x431793,_0x16cf68,_0x34865c),{'verbose':_0x46cea9[_0x134552(0xca)]}),_0x2f9cad=_0x2b472e['data'],_0x15796b=_0x2f9cad[_0x134552(0xcd)];return _0x15796b[_0x134552(0xb2)]===0x0?console[_0x134552(0xb6)](_0x134552(0xbc)):console[_0x134552(0xb6)](_0x134552(0xc2)+_0x15796b['length']+'\x20row'+(_0x15796b[_0x134552(0xb2)]!==0x1?'s':'')+_0x134552(0xaa)+_0x4ef98f),await handleSDKOutput(_0x15796b,_0x46cea9),0x0;}catch(_0x4cde85){if(_0x4cde85 instanceof SDKError)return console[_0x134552(0xb6)](_0x134552(0xae)+_0x4cde85[_0x134552(0xab)]),_0x4cde85[_0x134552(0xcb)]&&console[_0x134552(0xb6)]('\x20\x20Cause:\x20'+_0x4cde85[_0x134552(0xcb)]),0x1;throw _0x4cde85;}}[a46_0x5b54c6(0xc8)](_0x5e1302){const _0x48656a=a46_0x5b54c6;if(_0x5e1302[_0x48656a(0xbb)][_0x48656a(0xb2)]===0x0)return _0x48656a(0xc3);if(_0x5e1302[_0x48656a(0xbb)][_0x48656a(0xb2)]>0x1)return'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';return undefined;}}
1
+ const a46_0x44f35b=a46_0x3ed8;(function(_0x3a77f5,_0x4a09a5){const _0x558c71=a46_0x3ed8,_0x1f60fd=_0x3a77f5();while(!![]){try{const _0x242e71=parseInt(_0x558c71(0x103))/0x1*(-parseInt(_0x558c71(0x10e))/0x2)+-parseInt(_0x558c71(0xf9))/0x3*(-parseInt(_0x558c71(0x10d))/0x4)+-parseInt(_0x558c71(0x104))/0x5+-parseInt(_0x558c71(0x11f))/0x6*(-parseInt(_0x558c71(0x110))/0x7)+-parseInt(_0x558c71(0x116))/0x8*(parseInt(_0x558c71(0x11c))/0x9)+-parseInt(_0x558c71(0x121))/0xa*(-parseInt(_0x558c71(0x10a))/0xb)+-parseInt(_0x558c71(0xf7))/0xc*(parseInt(_0x558c71(0x115))/0xd);if(_0x242e71===_0x4a09a5)break;else _0x1f60fd['push'](_0x1f60fd['shift']());}catch(_0x4e26e6){_0x1f60fd['push'](_0x1f60fd['shift']());}}}(a46_0x14b6,0x9688b));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_0x14b6(){const _0x20cf12=['table','5526348hTXNsR','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','3nQtoWi','\x20from\x20','Error:\x20','Querying\x20','catalog','Table:\x20','verbose','validate','length','showTable','35881tUoTrG','5288335UfcFoj','execute','database','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','name','✔\x20Retrieved\x20','176nmumFg','message','show','4718204XrPcYS','24FwysrG','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','14kWzLog','Usage:\x20tdx\x20show\x20<database.table>','...','cause','error','13jrrZqw','24tqewfq','Database:\x20','args','Limit:\x20','Site:\x20','Catalog:\x20','494262udUrRY','\x20row','data','3143466wcIJcs','limit','314210LAvJbM','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20\x20Cause:\x20'];a46_0x14b6=function(){return _0x20cf12;};return a46_0x14b6();}function a46_0x3ed8(_0x299e1a,_0x42877d){_0x299e1a=_0x299e1a-0xf4;const _0x14b693=a46_0x14b6();let _0x3ed8f3=_0x14b693[_0x299e1a];return _0x3ed8f3;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x44f35b(0x108)]=a46_0x44f35b(0x10c);['description']='Show\x20table\x20contents';async[a46_0x44f35b(0x105)](_0x545faa){const _0x5380a2=a46_0x44f35b;return this[_0x5380a2(0x102)](_0x545faa);}async['showTable'](_0x7c97cb){const _0xde1e3d=a46_0x44f35b,{options:_0x102679,args:_0x3d7b4d,tdx:_0x516a0c}=_0x7c97cb;let _0x24d3d4;try{_0x24d3d4=parseTableReference(_0x3d7b4d[0x0]);const _0x52d071=_0x102679[_0xde1e3d(0x106)];!_0x24d3d4[_0xde1e3d(0x106)]&&_0x52d071&&(_0x24d3d4[_0xde1e3d(0x106)]=_0x52d071);const _0x1373e2=validateTableDescribeReference(_0x24d3d4);if(_0x1373e2)return console['error'](_0xde1e3d(0xfb)+_0x1373e2),console['error'](_0xde1e3d(0x111)),console['error'](_0xde1e3d(0x107)),console[_0xde1e3d(0x114)](_0xde1e3d(0x122)),0x1;}catch(_0x1ef70a){return console[_0xde1e3d(0x114)](_0xde1e3d(0xfb)+_0x1ef70a[_0xde1e3d(0x10b)]),console[_0xde1e3d(0x114)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xde1e3d(0x114)](_0xde1e3d(0x107)),console[_0xde1e3d(0x114)](_0xde1e3d(0x122)),0x1;}const _0x400bdc=_0x24d3d4[_0xde1e3d(0xfd)],_0x121ef0=_0x24d3d4[_0xde1e3d(0x106)],_0x27e2af=_0x24d3d4[_0xde1e3d(0xf6)],_0x2a43d4=resolveLimit(_0x102679[_0xde1e3d(0x120)],DEFAULT_DISPLAY_LIMIT);try{_0x102679['verbose']&&(console[_0xde1e3d(0x114)](_0xde1e3d(0x11a)+_0x102679['site']),_0x400bdc&&console['error'](_0xde1e3d(0x11b)+_0x400bdc),console[_0xde1e3d(0x114)](_0xde1e3d(0x117)+_0x121ef0),console[_0xde1e3d(0x114)](_0xde1e3d(0xfe)+_0x27e2af),console['error'](_0xde1e3d(0x119)+_0x2a43d4));const _0x152715=_0x400bdc?_0x400bdc+'.'+_0x121ef0+'.'+_0x27e2af:_0x121ef0+'.'+_0x27e2af,_0x560fb4=await withSpinner(_0xde1e3d(0xfc)+_0x152715+_0xde1e3d(0x112),()=>_0x516a0c['query']['showTable'](_0x121ef0,_0x27e2af,_0x2a43d4,_0x400bdc),{'verbose':_0x102679[_0xde1e3d(0xff)]}),_0x1f1d41=_0x560fb4[_0xde1e3d(0x11e)],_0xd2f73c=_0x1f1d41[_0xde1e3d(0x11e)];return _0xd2f73c[_0xde1e3d(0x101)]===0x0?console[_0xde1e3d(0x114)](_0xde1e3d(0xf4)):console[_0xde1e3d(0x114)](_0xde1e3d(0x109)+_0xd2f73c[_0xde1e3d(0x101)]+_0xde1e3d(0x11d)+(_0xd2f73c[_0xde1e3d(0x101)]!==0x1?'s':'')+_0xde1e3d(0xfa)+_0x152715),await handleSDKOutput(_0xd2f73c,_0x102679),0x0;}catch(_0x3b66d5){if(_0x3b66d5 instanceof SDKError)return console[_0xde1e3d(0x114)]('Error:\x20'+_0x3b66d5[_0xde1e3d(0x10b)]),_0x3b66d5[_0xde1e3d(0x113)]&&console[_0xde1e3d(0x114)](_0xde1e3d(0xf5)+_0x3b66d5[_0xde1e3d(0x113)]),0x1;throw _0x3b66d5;}}[a46_0x44f35b(0x100)](_0x54d591){const _0x15a4df=a46_0x44f35b;if(_0x54d591[_0x15a4df(0x118)][_0x15a4df(0x101)]===0x0)return _0x15a4df(0x10f);if(_0x54d591[_0x15a4df(0x118)][_0x15a4df(0x101)]>0x1)return _0x15a4df(0xf8);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x6eabb6=a47_0x28b1;(function(_0x2e6a3d,_0x915105){const _0x4945ab=a47_0x28b1,_0x1ff33d=_0x2e6a3d();while(!![]){try{const _0x3acc9c=-parseInt(_0x4945ab(0x191))/0x1*(-parseInt(_0x4945ab(0x1ad))/0x2)+-parseInt(_0x4945ab(0x194))/0x3+parseInt(_0x4945ab(0x1a5))/0x4*(-parseInt(_0x4945ab(0x1ab))/0x5)+parseInt(_0x4945ab(0x193))/0x6+-parseInt(_0x4945ab(0x195))/0x7+-parseInt(_0x4945ab(0x188))/0x8*(parseInt(_0x4945ab(0x19f))/0x9)+parseInt(_0x4945ab(0x19c))/0xa*(parseInt(_0x4945ab(0x1a7))/0xb);if(_0x3acc9c===_0x915105)break;else _0x1ff33d['push'](_0x1ff33d['shift']());}catch(_0x2a43fb){_0x1ff33d['push'](_0x1ff33d['shift']());}}}(a47_0x3ecc,0xa6988));function a47_0x3ecc(){const _0x20811b=['Name:','2797zUtNdJ','profile','4859154QRNyHS','1412181jPibZk','500325wRwhuY','Credential\x20type:\x20','getUserInfo','account_id','site','email','cyan','20rRZfIl','cli','tdx','189mhTWvc','Show\x20authentication\x20status\x20and\x20current\x20context','last_name','filter','profileSource','name','64MALxqg','dim','8924707rbHeGa','join','green','\x20profile:\x20','101415aYklAf','message','32OnOYrk','N/A','jobs','displayWithSources','error','(from\x20','Read\x20credential\x20from\x20','env','red','OAuth','execute','353592alikWa','✓\x20Authentication\x20successful\x0a','bold','first_name','log','config','No\x20credential\x20found','yellow'];a47_0x3ecc=function(){return _0x20811b;};return a47_0x3ecc();}import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a47_0x28b1(_0x577d96,_0x2a5dc0){_0x577d96=_0x577d96-0x182;const _0x3ecc17=a47_0x3ecc();let _0x28b1f0=_0x3ecc17[_0x577d96];return _0x28b1f0;}import{GlobalContext}from'../core/global-context.js';import a47_0x88dde6 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x6eabb6(0x1a4)]='status';['description']=a47_0x6eabb6(0x1a0);async[a47_0x6eabb6(0x187)](_0x461308){const _0x171596=a47_0x6eabb6,{options:_0x11d838,tdx:_0x4120a5}=_0x461308,_0x267e0c=_0x11d838[_0x171596(0x199)],_0x262479=new GlobalContext(_0x11d838),_0xf21d40=_0x262479[_0x171596(0x192)],_0x1e9427=_0x262479[_0x171596(0x1a3)],_0x1c58df=_0x1e9427===_0x171596(0x19d)?'CLI\x20flag':_0x1e9427==='session'?'session':_0x1e9427===_0x171596(0x184)?'TDX_PROFILE\x20env':_0x1e9427===_0x171596(0x18d)?_0x171596(0x18d):null,_0x9f7180=_0xf21d40?a47_0x88dde6['cyan'](_0xf21d40):a47_0x88dde6[_0x171596(0x1a6)](_0x171596(0x1ae)),_0x4694ed=_0x1c58df?'\x20'+a47_0x88dde6[_0x171596(0x1a6)](_0x171596(0x182)+_0x1c58df+')'):'';console['log'](a47_0x88dde6[_0x171596(0x18a)](_0x171596(0x19e))+_0x171596(0x1aa)+_0x9f7180+_0x4694ed+'\x20'+a47_0x88dde6['dim']('(')+'site:\x20'+a47_0x88dde6['cyan'](_0x267e0c)+a47_0x88dde6[_0x171596(0x1a6)](')'));const _0x3cc821=await getOAuthTokens(_0xf21d40);if(_0x3cc821)console['log'](_0x171596(0x196)+a47_0x88dde6[_0x171596(0x19b)](_0x171596(0x186)));else{const _0xe2ca4b=await resolveAPIKeyAsync(_0x267e0c,_0xf21d40);if(_0xe2ca4b){const {source:_0x3ac5cb,isDeprecated:_0x58b874}=_0xe2ca4b,_0x49bdbd=_0x171596(0x183)+a47_0x88dde6[_0x171596(0x19b)](_0x3ac5cb);console[_0x171596(0x18c)](_0x58b874?a47_0x88dde6['yellow'](_0x49bdbd):_0x49bdbd);}else console['log'](a47_0x88dde6[_0x171596(0x18f)](_0x171596(0x18e)));}let _0x3466ee=![];try{const _0x2eb75a=await _0x4120a5[_0x171596(0x1af)][_0x171596(0x197)]();console[_0x171596(0x18c)](a47_0x88dde6[_0x171596(0x1a9)](_0x171596(0x189))),console[_0x171596(0x18c)](a47_0x88dde6['bold']('User:')+'\x20'+a47_0x88dde6['cyan'](_0x2eb75a[_0x171596(0x19a)]));if(_0x2eb75a['first_name']||_0x2eb75a[_0x171596(0x1a1)]){const _0x513719=[_0x2eb75a[_0x171596(0x18b)],_0x2eb75a[_0x171596(0x1a1)]][_0x171596(0x1a2)](Boolean)[_0x171596(0x1a8)]('\x20');console[_0x171596(0x18c)](a47_0x88dde6[_0x171596(0x18a)](_0x171596(0x190))+'\x20'+_0x513719);}_0x2eb75a[_0x171596(0x198)]&&console[_0x171596(0x18c)](a47_0x88dde6[_0x171596(0x18a)]('Account\x20ID:')+'\x20'+a47_0x88dde6['yellow'](_0x2eb75a[_0x171596(0x198)])),_0x3466ee=!![];}catch(_0x209cea){_0x209cea instanceof HTTPClientError&&_0x209cea['status']===0x191?printAuthError(_0x209cea,!![],_0xf21d40):console[_0x171596(0x1b1)](a47_0x88dde6[_0x171596(0x185)]('✗\x20Validation\x20failed:\x20'+(_0x209cea instanceof Error?_0x209cea[_0x171596(0x1ac)]:String(_0x209cea))));}return console[_0x171596(0x18c)](),_0x262479[_0x171596(0x1b0)](),_0x3466ee?0x0:0x1;}}
1
+ const a47_0x53b2f8=a47_0x3957;function a47_0x1567(){const _0x174648=['email','45TrwbbT','log','account_id','4131162ohquqb','status','getUserInfo','1572070tmPSmh','filter','Credential\x20type:\x20','dim','cyan','Read\x20credential\x20from\x20','Account\x20ID:','N/A','CLI\x20flag','join','site','config','profileSource','profile','env','description','7363736UKCtwM','5948opqdxE','Name:','message','execute','✓\x20Authentication\x20successful\x0a','name','last_name','tdx','cli','12kYnkQw','44bBwESz','site:\x20','Show\x20authentication\x20status\x20and\x20current\x20context','3599332qWDVeQ','jobs','5567044XabMQM','✗\x20Validation\x20failed:\x20','first_name','7tWOqBq','yellow','error','5NBBvOm','bold','displayWithSources','2393118noVmoN'];a47_0x1567=function(){return _0x174648;};return a47_0x1567();}(function(_0x13d932,_0x312b71){const _0x1c6325=a47_0x3957,_0x45c1e1=_0x13d932();while(!![]){try{const _0x7a4e41=-parseInt(_0x1c6325(0x133))/0x1*(parseInt(_0x1c6325(0x129))/0x2)+-parseInt(_0x1c6325(0x146))/0x3+-parseInt(_0x1c6325(0x138))/0x4*(-parseInt(_0x1c6325(0x13e))/0x5)+parseInt(_0x1c6325(0x141))/0x6+parseInt(_0x1c6325(0x13b))/0x7*(parseInt(_0x1c6325(0x128))/0x8)+-parseInt(_0x1c6325(0x143))/0x9*(parseInt(_0x1c6325(0x149))/0xa)+parseInt(_0x1c6325(0x136))/0xb*(parseInt(_0x1c6325(0x132))/0xc);if(_0x7a4e41===_0x312b71)break;else _0x45c1e1['push'](_0x45c1e1['shift']());}catch(_0x509738){_0x45c1e1['push'](_0x45c1e1['shift']());}}}(a47_0x1567,0xb5b9c));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a47_0x3957(_0x177eea,_0x2077e4){_0x177eea=_0x177eea-0x11e;const _0x15674b=a47_0x1567();let _0x395765=_0x15674b[_0x177eea];return _0x395765;}import{GlobalContext}from'../core/global-context.js';import a47_0x30d5ea from'chalk';export class StatusCommand extends BaseCommand{[a47_0x53b2f8(0x12e)]=a47_0x53b2f8(0x147);[a47_0x53b2f8(0x127)]=a47_0x53b2f8(0x135);async[a47_0x53b2f8(0x12c)](_0x51616c){const _0x47dbc2=a47_0x53b2f8,{options:_0x265de2,tdx:_0x57924b}=_0x51616c,_0x5c6110=_0x265de2[_0x47dbc2(0x122)],_0xe08b76=new GlobalContext(_0x265de2),_0x353452=_0xe08b76[_0x47dbc2(0x125)],_0x521cfd=_0xe08b76[_0x47dbc2(0x124)],_0x1bc191=_0x521cfd===_0x47dbc2(0x131)?_0x47dbc2(0x120):_0x521cfd==='session'?'session':_0x521cfd===_0x47dbc2(0x126)?'TDX_PROFILE\x20env':_0x521cfd===_0x47dbc2(0x123)?_0x47dbc2(0x123):null,_0x491d84=_0x353452?a47_0x30d5ea[_0x47dbc2(0x14d)](_0x353452):a47_0x30d5ea[_0x47dbc2(0x14c)](_0x47dbc2(0x11f)),_0x1b4841=_0x1bc191?'\x20'+a47_0x30d5ea['dim']('(from\x20'+_0x1bc191+')'):'';console['log'](a47_0x30d5ea[_0x47dbc2(0x13f)](_0x47dbc2(0x130))+'\x20profile:\x20'+_0x491d84+_0x1b4841+'\x20'+a47_0x30d5ea['dim']('(')+_0x47dbc2(0x134)+a47_0x30d5ea[_0x47dbc2(0x14d)](_0x5c6110)+a47_0x30d5ea[_0x47dbc2(0x14c)](')'));const _0x4b0a54=await getOAuthTokens(_0x353452);if(_0x4b0a54)console[_0x47dbc2(0x144)](_0x47dbc2(0x14b)+a47_0x30d5ea['cyan']('OAuth'));else{const _0x53243e=await resolveAPIKeyAsync(_0x5c6110,_0x353452);if(_0x53243e){const {source:_0x5f3be0,isDeprecated:_0x26eff0}=_0x53243e,_0x546304=_0x47dbc2(0x14e)+a47_0x30d5ea[_0x47dbc2(0x14d)](_0x5f3be0);console['log'](_0x26eff0?a47_0x30d5ea[_0x47dbc2(0x13c)](_0x546304):_0x546304);}else console['log'](a47_0x30d5ea['yellow']('No\x20credential\x20found'));}let _0x15f0c9=![];try{const _0x37648f=await _0x57924b[_0x47dbc2(0x137)][_0x47dbc2(0x148)]();console[_0x47dbc2(0x144)](a47_0x30d5ea['green'](_0x47dbc2(0x12d))),console[_0x47dbc2(0x144)](a47_0x30d5ea[_0x47dbc2(0x13f)]('User:')+'\x20'+a47_0x30d5ea[_0x47dbc2(0x14d)](_0x37648f[_0x47dbc2(0x142)]));if(_0x37648f[_0x47dbc2(0x13a)]||_0x37648f[_0x47dbc2(0x12f)]){const _0x1b6075=[_0x37648f[_0x47dbc2(0x13a)],_0x37648f['last_name']][_0x47dbc2(0x14a)](Boolean)[_0x47dbc2(0x121)]('\x20');console[_0x47dbc2(0x144)](a47_0x30d5ea[_0x47dbc2(0x13f)](_0x47dbc2(0x12a))+'\x20'+_0x1b6075);}_0x37648f[_0x47dbc2(0x145)]&&console['log'](a47_0x30d5ea['bold'](_0x47dbc2(0x11e))+'\x20'+a47_0x30d5ea['yellow'](_0x37648f[_0x47dbc2(0x145)])),_0x15f0c9=!![];}catch(_0x1ec5b7){_0x1ec5b7 instanceof HTTPClientError&&_0x1ec5b7['status']===0x191?printAuthError(_0x1ec5b7,!![],_0x353452):console[_0x47dbc2(0x13d)](a47_0x30d5ea['red'](_0x47dbc2(0x139)+(_0x1ec5b7 instanceof Error?_0x1ec5b7[_0x47dbc2(0x12b)]:String(_0x1ec5b7))));}return console[_0x47dbc2(0x144)](),_0xe08b76[_0x47dbc2(0x140)](),_0x15f0c9?0x0:0x1;}}