@treasuredata/tdx 2026.3.53 → 2026.3.55

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 (254) 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.d.ts.map +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-command.js.map +1 -1
  11. package/dist/commands/agent-test-command.js +1 -1
  12. package/dist/commands/api-command.js +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/cas-command.js +1 -1
  15. package/dist/commands/cas-segment-command.js +1 -1
  16. package/dist/commands/chat-command.js +1 -1
  17. package/dist/commands/claude-command.js +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/delivery-command.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-campaign-pull-command.js +1 -1
  26. package/dist/commands/engage-campaign-push-command.js +1 -1
  27. package/dist/commands/engage-campaign-validate-command.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-template-pull-command.js +1 -1
  30. package/dist/commands/engage-template-push-command.js +1 -1
  31. package/dist/commands/engage-template-validate-command.js +1 -1
  32. package/dist/commands/job-command.js +1 -1
  33. package/dist/commands/journey-command.js +1 -1
  34. package/dist/commands/journey-validate-command.js +1 -1
  35. package/dist/commands/llm-command.js +1 -1
  36. package/dist/commands/mcp-command.js +1 -1
  37. package/dist/commands/parent-segment-command.js +1 -1
  38. package/dist/commands/policy-command.js +1 -1
  39. package/dist/commands/profile-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/schedule-command.js +1 -1
  43. package/dist/commands/segment-command.js +1 -1
  44. package/dist/commands/segment-create-command.js +1 -1
  45. package/dist/commands/segment-fields-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.d.ts +27 -0
  61. package/dist/commands/workflow-command.d.ts.map +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/commands/workflow-command.js.map +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.js +1 -1
  87. package/dist/proxy/passthrough-server.js +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.d.ts +10 -0
  90. package/dist/sdk/agent/agent-config.d.ts.map +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-config.js.map +1 -1
  93. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  94. package/dist/sdk/agent/agent-yaml.d.ts +61 -3
  95. package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/agent-yaml.js.map +1 -1
  98. package/dist/sdk/agent/test/evaluator.js +1 -1
  99. package/dist/sdk/agent/test/executor.js +1 -1
  100. package/dist/sdk/agent/test/index.js +1 -1
  101. package/dist/sdk/agent/test/output.js +1 -1
  102. package/dist/sdk/agent/test/parser.js +1 -1
  103. package/dist/sdk/agent/tool-target-registry.js +1 -1
  104. package/dist/sdk/agent/types/agent-def.d.ts +43 -0
  105. package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
  106. package/dist/sdk/api.js +1 -1
  107. package/dist/sdk/cas/cas-api-client.js +1 -1
  108. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  109. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  110. package/dist/sdk/cas/index.js +1 -1
  111. package/dist/sdk/cas/pull-workflow.js +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/client/cdp-api-client.js +1 -1
  114. package/dist/sdk/client/delivery-api-client.js +1 -1
  115. package/dist/sdk/client/endpoints.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.d.ts +73 -1
  119. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  120. package/dist/sdk/client/llm-api-client.js +1 -1
  121. package/dist/sdk/client/llm-api-client.js.map +1 -1
  122. package/dist/sdk/client/oauth-refresh.js +1 -1
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.d.ts +28 -1
  127. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  128. package/dist/sdk/client/workflow-client.js +1 -1
  129. package/dist/sdk/client/workflow-client.js.map +1 -1
  130. package/dist/sdk/connection-validator.js +1 -1
  131. package/dist/sdk/connection.js +1 -1
  132. package/dist/sdk/delivery.js +1 -1
  133. package/dist/sdk/engage/campaign-pull.js +1 -1
  134. package/dist/sdk/engage/campaign-push.js +1 -1
  135. package/dist/sdk/engage/campaign-validator.js +1 -1
  136. package/dist/sdk/engage/campaign-yaml.js +1 -1
  137. package/dist/sdk/engage/template-pull.js +1 -1
  138. package/dist/sdk/engage/template-push.js +1 -1
  139. package/dist/sdk/engage/template-validator.js +1 -1
  140. package/dist/sdk/engage/template-yaml.js +1 -1
  141. package/dist/sdk/engage/types/campaign-def.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.js +1 -1
  145. package/dist/sdk/errors.js +1 -1
  146. package/dist/sdk/index.js +1 -1
  147. package/dist/sdk/io/index.js +1 -1
  148. package/dist/sdk/io/node-filesystem.js +1 -1
  149. package/dist/sdk/job.js +1 -1
  150. package/dist/sdk/journey.js +1 -1
  151. package/dist/sdk/llm/chat-cache.js +1 -1
  152. package/dist/sdk/llm/index.d.ts.map +1 -1
  153. package/dist/sdk/llm/index.js +1 -1
  154. package/dist/sdk/llm/index.js.map +1 -1
  155. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  156. package/dist/sdk/llm/model-factors.js +1 -1
  157. package/dist/sdk/personalization.js +1 -1
  158. package/dist/sdk/policy.js +1 -1
  159. package/dist/sdk/query/index.js +1 -1
  160. package/dist/sdk/query/sql-parser.js +1 -1
  161. package/dist/sdk/realtime.js +1 -1
  162. package/dist/sdk/schedule.js +1 -1
  163. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  164. package/dist/sdk/segment/fields-display.js +1 -1
  165. package/dist/sdk/segment/file-discovery.js +1 -1
  166. package/dist/sdk/segment/journey-utils.js +1 -1
  167. package/dist/sdk/segment/journey-validator.js +1 -1
  168. package/dist/sdk/segment/journey-yaml.js +1 -1
  169. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  170. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  171. package/dist/sdk/segment/pull-workflow.js +1 -1
  172. package/dist/sdk/segment/push-recovery.js +1 -1
  173. package/dist/sdk/segment/push-workflow.js +1 -1
  174. package/dist/sdk/segment/resolution-context.js +1 -1
  175. package/dist/sdk/segment/segment-path-parser.js +1 -1
  176. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  177. package/dist/sdk/segment/segment-validator.js +1 -1
  178. package/dist/sdk/segment/target-resolution.js +1 -1
  179. package/dist/sdk/segment/tdx-config.js +1 -1
  180. package/dist/sdk/segment/types/activation-schema.js +1 -1
  181. package/dist/sdk/segment/types/journey-def.js +1 -1
  182. package/dist/sdk/segment/types/journey-schema.js +1 -1
  183. package/dist/sdk/segment/types/segment-def.js +1 -1
  184. package/dist/sdk/segment/types/segment-schema.js +1 -1
  185. package/dist/sdk/segment/validate-files.js +1 -1
  186. package/dist/sdk/segment/yaml-validator.js +1 -1
  187. package/dist/sdk/segment.js +1 -1
  188. package/dist/sdk/types/index.d.ts +2 -2
  189. package/dist/sdk/types/index.d.ts.map +1 -1
  190. package/dist/sdk/types/index.js +1 -1
  191. package/dist/sdk/types/index.js.map +1 -1
  192. package/dist/sdk/types/llm.d.ts +158 -0
  193. package/dist/sdk/types/llm.d.ts.map +1 -1
  194. package/dist/sdk/types/progress.js +1 -1
  195. package/dist/sdk/types/workflow.d.ts +26 -0
  196. package/dist/sdk/types/workflow.d.ts.map +1 -1
  197. package/dist/sdk/types/workspace.js +1 -1
  198. package/dist/sdk/user.js +1 -1
  199. package/dist/sdk/util/format-detector.js +1 -1
  200. package/dist/sdk/util/formatters.js +1 -1
  201. package/dist/sdk/util/index.js +1 -1
  202. package/dist/sdk/util/paginate.js +1 -1
  203. package/dist/sdk/util/tree-formatter.js +1 -1
  204. package/dist/sdk/workflow/archive-validation.js +1 -1
  205. package/dist/sdk/workflow/clone-workflow.js +1 -1
  206. package/dist/sdk/workflow/index.d.ts +22 -0
  207. package/dist/sdk/workflow/index.d.ts.map +1 -1
  208. package/dist/sdk/workflow/index.js +1 -1
  209. package/dist/sdk/workflow/index.js.map +1 -1
  210. package/dist/sdk/workflow/pull-workflow.js +1 -1
  211. package/dist/sdk/workflow/push-workflow.js +1 -1
  212. package/dist/sdk/workflow/tdx-config.js +1 -1
  213. package/dist/sdk/workflow/workflow-utils.js +1 -1
  214. package/dist/sdk/workspace/frontmatter.js +1 -1
  215. package/dist/sdk/workspace/git.js +1 -1
  216. package/dist/sdk/workspace/index.js +1 -1
  217. package/dist/sdk/workspace/templates.js +1 -1
  218. package/dist/sdk/workspace/weekly.js +1 -1
  219. package/dist/sdk/workspace/wikilinks.js +1 -1
  220. package/dist/test-utils/command-runner.js +1 -1
  221. package/dist/test-utils/factories.js +1 -1
  222. package/dist/test-utils/fixtures.js +1 -1
  223. package/dist/test-utils/http-mock.js +1 -1
  224. package/dist/test-utils/index.js +1 -1
  225. package/dist/utils/async.js +1 -1
  226. package/dist/utils/colors.js +1 -1
  227. package/dist/utils/diff.js +1 -1
  228. package/dist/utils/file-permissions.js +1 -1
  229. package/dist/utils/file-reader.js +1 -1
  230. package/dist/utils/github-releases.js +1 -1
  231. package/dist/utils/global-cache.js +1 -1
  232. package/dist/utils/json-loader.js +1 -1
  233. package/dist/utils/local-cache.js +1 -1
  234. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  235. package/dist/utils/logger/formatters/index.js +1 -1
  236. package/dist/utils/logger/handlers/console-handler.js +1 -1
  237. package/dist/utils/logger/handlers/file-handler.js +1 -1
  238. package/dist/utils/logger/handlers/index.js +1 -1
  239. package/dist/utils/logger/handlers/null-handler.js +1 -1
  240. package/dist/utils/logger/index.js +1 -1
  241. package/dist/utils/logger/logger.js +1 -1
  242. package/dist/utils/logger/types.js +1 -1
  243. package/dist/utils/option-validation.js +1 -1
  244. package/dist/utils/process.d.ts.map +1 -1
  245. package/dist/utils/process.js +1 -1
  246. package/dist/utils/process.js.map +1 -1
  247. package/dist/utils/prompt.js +1 -1
  248. package/dist/utils/spinner.js +1 -1
  249. package/dist/utils/sse-parser.js +1 -1
  250. package/dist/utils/string-utils.js +1 -1
  251. package/dist/utils/table-ref-parser.js +1 -1
  252. package/dist/utils/tdx-logger.js +1 -1
  253. package/dist/utils/version-check.js +1 -1
  254. package/package.json +2 -2
@@ -1 +1 @@
1
- function a40_0x8060(_0x499393,_0x215edd){_0x499393=_0x499393-0x88;const _0x17b30a=a40_0x17b3();let _0x806065=_0x17b30a[_0x499393];return _0x806065;}const a40_0x530ffa=a40_0x8060;(function(_0x358727,_0x5658de){const _0x3ffdbc=a40_0x8060,_0x262241=_0x358727();while(!![]){try{const _0x113871=parseInt(_0x3ffdbc(0xa9))/0x1+parseInt(_0x3ffdbc(0x97))/0x2*(parseInt(_0x3ffdbc(0xc9))/0x3)+-parseInt(_0x3ffdbc(0x89))/0x4+parseInt(_0x3ffdbc(0xa8))/0x5*(-parseInt(_0x3ffdbc(0xc8))/0x6)+-parseInt(_0x3ffdbc(0xbc))/0x7*(-parseInt(_0x3ffdbc(0xda))/0x8)+-parseInt(_0x3ffdbc(0x92))/0x9+-parseInt(_0x3ffdbc(0xcb))/0xa*(-parseInt(_0x3ffdbc(0xbe))/0xb);if(_0x113871===_0x5658de)break;else _0x262241['push'](_0x262241['shift']());}catch(_0x36bf30){_0x262241['push'](_0x262241['shift']());}}}(a40_0x17b3,0xce621));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_0x44cd55 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x1da32a 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_0x530ffa(0x8b)]=a40_0x530ffa(0xb5);[a40_0x530ffa(0x9a)]=a40_0x530ffa(0xc1);async[a40_0x530ffa(0xd6)](_0x49b342){const _0x265448=a40_0x530ffa,{options:_0x559a28,args:_0x3e40a1,tdx:_0x2fd7ee}=_0x49b342,_0x50577a=_0x559a28,_0x342328=await resolveTarget({'arg':_0x3e40a1[0x0],'contextParent':_0x559a28[_0x265448(0xc4)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x342328))return _0x342328[_0x265448(0xa6)]==='no_parent'?(console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xae)](_0x265448(0xc7))),console['error'](_0x265448(0xa2)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x265448(0x9b)](_0x265448(0xb0))):(console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xca)](_0x265448(0xb6)+_0x342328[_0x265448(0x93)]+'\x0a')),_0x342328[_0x265448(0xa7)]&&console[_0x265448(0x9b)](a40_0x44cd55['cyan'](_0x342328[_0x265448(0xa7)]))),0x1;const _0x80468e=_0x342328[_0x265448(0xab)],_0x12064f=_0x342328[_0x265448(0xbb)],_0x1c0ba0=_0x342328[_0x265448(0x94)]==='file'?_0x342328[_0x265448(0xc5)]:undefined;_0x50577a['verbose']&&(console[_0x265448(0x9b)](_0x265448(0xb2)+_0x50577a[_0x265448(0x8a)]),console['error'](_0x265448(0xc2)+_0x80468e),_0x1c0ba0&&console['error'](_0x265448(0xb1)+_0x1c0ba0));const _0xca285e=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x80468e+_0x265448(0xa3),_0x1aa760=>_0x2fd7ee[_0x265448(0xd8)]['pullSegments'](_0x80468e,{'targetDir':_0x12064f,'targetResourceName':_0x1c0ba0,'verbose':_0x50577a[_0x265448(0xcf)],'progress':{'update':_0x3ed3ab=>{const _0x54d3e5=_0x265448;_0x1aa760[_0x54d3e5(0xa0)](_0x3ed3ab),_0x50577a[_0x54d3e5(0xcf)]&&console[_0x54d3e5(0x9b)]('\x20\x20'+_0x3ed3ab);}}}),{'verbose':_0x50577a[_0x265448(0xcf)]}),_0xfcb2c4=_0xca285e['data'];if(_0xfcb2c4[_0x265448(0xd1)][_0x265448(0xa4)]===0x0&&_0xfcb2c4[_0x265448(0xd1)][_0x265448(0x8f)]===0x0)return console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xae)](_0x265448(0xa5)+_0xfcb2c4[_0x265448(0xab)]+'\x27')),0x0;const _0x14858b=_0xfcb2c4['files']['filter'](_0x39596f=>_0x39596f[_0x265448(0xaf)]),_0x2397fd=_0xfcb2c4[_0x265448(0x9c)][_0x265448(0xd9)](_0x3f46a1=>!_0x3f46a1[_0x265448(0xaf)]&&_0x3f46a1[_0x265448(0x9e)]),_0x21c57=_0xfcb2c4[_0x265448(0x9c)][_0x265448(0xd9)](_0x22e079=>!_0x22e079[_0x265448(0xaf)]&&!_0x22e079[_0x265448(0x9e)]);console[_0x265448(0x9b)](_0x265448(0xce)+_0xfcb2c4[_0x265448(0xab)]+'\x27:'),console['error'](_0x265448(0xb3)+a40_0x44cd55['cyan'](_0xfcb2c4['counts'][_0x265448(0xa4)]+_0x265448(0xcc))+_0x265448(0xcd)+a40_0x44cd55['cyan'](_0xfcb2c4[_0x265448(0xd1)]['activations']+_0x265448(0xaa)));if(_0xfcb2c4[_0x265448(0xd1)]['journeys']>0x0){const _0x15c086=_0xfcb2c4[_0x265448(0xd1)]['journeyVersions']>_0xfcb2c4['counts']['journeys']?'\x20('+_0xfcb2c4[_0x265448(0xd1)][_0x265448(0x98)]+_0x265448(0xbd):'';console['error']('\x20\x20🗺️\x20\x20'+a40_0x44cd55[_0x265448(0x96)](_0xfcb2c4['counts'][_0x265448(0x8f)]+_0x265448(0xb4))+a40_0x44cd55[_0x265448(0x8c)](_0x15c086));}console[_0x265448(0x9b)]('\x20\x20'+a40_0x44cd55[_0x265448(0xac)]('+\x20'+_0x14858b['length']+_0x265448(0xd2))),console['error']('\x20\x20'+a40_0x44cd55[_0x265448(0xae)]('~\x20'+_0x2397fd[_0x265448(0x8d)]+'\x20changed\x20files')),console[_0x265448(0x9b)]('\x20\x20'+a40_0x44cd55[_0x265448(0x8c)]('=\x20'+_0x21c57[_0x265448(0x8d)]+_0x265448(0x9f))),console['error'](_0x265448(0xc3)+a40_0x44cd55[_0x265448(0x96)](_0xfcb2c4['targetDir'])+'\x0a');if(_0x2397fd[_0x265448(0x8d)]>0x0)for(const _0x3c0946 of _0x2397fd){console['error'](_0x265448(0x88)+_0x3c0946[_0x265448(0xd5)]+'\x27:'),console[_0x265448(0x9b)]('─'['repeat'](0x3c)),console['error'](_0x3c0946[_0x265448(0xa1)]),console[_0x265448(0x9b)]('─'[_0x265448(0x95)](0x3c));}if(_0x50577a[_0x265448(0xba)])return console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xae)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x14858b['length']===0x0&&_0x2397fd[_0x265448(0x8d)]===0x0)return console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xac)](_0x265448(0x99))),saveSessionContext({'parent_segment':_0xfcb2c4[_0x265448(0xab)]},_0x50577a[_0x265448(0x8e)]),console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xac)](_0x265448(0xc6)+a40_0x44cd55[_0x265448(0x8c)](_0x265448(0xd7))+'\x20=\x20'+a40_0x44cd55[_0x265448(0x96)](_0xfcb2c4[_0x265448(0xab)]))),0x0;if(!_0x50577a[_0x265448(0xbf)]){if(!isInteractive())return console['error'](a40_0x44cd55[_0x265448(0xca)](_0x265448(0xc0)),_0x265448(0x90)),console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0x8c)](_0x265448(0x9d))),0x1;const _0x5e7564=await confirmKey(_0x265448(0xd0)+(_0x14858b['length']+_0x2397fd[_0x265448(0x8d)])+_0x265448(0xd3));if(!_0x5e7564)return console[_0x265448(0x9b)](a40_0x44cd55[_0x265448(0xae)](_0x265448(0xdb)),_0x265448(0xad)),0x1;}for(const _0x29fc5b of _0xfcb2c4[_0x265448(0x9c)]){if(_0x29fc5b[_0x265448(0xaf)]||_0x29fc5b[_0x265448(0x9e)]){const _0x3360f1=a40_0x1da32a[_0x265448(0xd4)](_0x29fc5b[_0x265448(0xb9)]);!existsSync(_0x3360f1)&&mkdirSync(_0x3360f1,{'recursive':!![]}),writeFileSync(_0x29fc5b[_0x265448(0xb9)],_0x29fc5b[_0x265448(0x91)],_0x265448(0xb7));}}return console['error'](a40_0x44cd55[_0x265448(0xac)]('✔\x20Pulled\x20'+(_0x14858b[_0x265448(0x8d)]+_0x2397fd[_0x265448(0x8d)])+_0x265448(0xb8)+_0xfcb2c4[_0x265448(0xbb)])),saveSessionContext({'parent_segment':_0xfcb2c4[_0x265448(0xab)]},_0x50577a[_0x265448(0x8e)]),console[_0x265448(0x9b)](a40_0x44cd55['green'](_0x265448(0xc6)+a40_0x44cd55[_0x265448(0x8c)](_0x265448(0xd7))+'\x20=\x20'+a40_0x44cd55['cyan'](_0xfcb2c4['parentName']))),0x0;}}function a40_0x17b3(){const _0x2936a2=['Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasChanges','\x20unchanged\x20files','setPhase','diff','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x27...','segments','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','errorCode','helpText','5ezWXtn','1596452HkUvLM','\x20activations','parentName','green','-\x20no\x20files\x20written','yellow','isNew','\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','Site:\x20','\x20\x20🎯\x20','\x20journeys','segment:pull','Error:\x20','utf-8','\x20files\x20to\x20','absolutePath','dryRun','targetDir','7366212FsWoJY','\x20versions)','99847pnJnHQ','yes','\x0aError:','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Parent\x20segment:\x20','\x20\x20Target:\x20','parentSegment','resourceName','✔\x20Context\x20set:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','4157346jzJsjD','3732qqmUZX','red','30PlCvIB','\x20segments','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','verbose','Write\x20','counts','\x20new\x20files','\x20files?','dirname','relativePath','execute','parent_segment','segment','filter','8BRWOsg','Aborted.','\x0aChanges\x20to\x20\x27','5973384oEpQBp','site','name','dim','length','session','journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','content','8074125VDjEft','message','type','repeat','cyan','2014SkkVhc','journeyVersions','✔\x20All\x20files\x20are\x20up\x20to\x20date','description','error','files'];a40_0x17b3=function(){return _0x2936a2;};return a40_0x17b3();}
1
+ const a40_0xb8f167=a40_0xd2c7;function a40_0x4255(){const _0x4c7f05=['hasChanges','site','1036124aWEhfn','✔\x20Context\x20set:\x20','\x0aPull\x20summary\x20for\x20\x27','repeat','\x20unchanged\x20files','filter','\x20\x20Target:\x20','absolutePath','30QjBpft','targetDir','dim','counts','\x20segments','length','journeys','helpText','session','245825cwgEjr','\x27...','setPhase','Aborted.','Pulling\x20segments\x20from\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','Write\x20','cyan','\x20with\x20','diff','green','Error:\x20','42277390bDOIXI','584vNGdYt','files','journeyVersions','isNew','errorCode','Target\x20resource:\x20','\x20\x20🗺️\x20\x20','\x20changed\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','content','\x20versions)','parentName','segment','102105GjPrRc','name','yellow','pullSegments','\x20journeys','activations','534839SWkorO','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20new\x20files','relativePath','\x20files?','red','error','file','parent_segment','data','\x0aChanges\x20to\x20\x27','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Site:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','3oSMmVH','segments','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment:pull','verbose','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','5348804CohTyM','11VVixxo','1358910tAnxXK'];a40_0x4255=function(){return _0x4c7f05;};return a40_0x4255();}(function(_0x4da52f,_0xb8ebe8){const _0x5c9317=a40_0xd2c7,_0x5ed224=_0x4da52f();while(!![]){try{const _0x2ed85a=-parseInt(_0x5c9317(0x124))/0x1+-parseInt(_0x5c9317(0x13e))/0x2+-parseInt(_0x5c9317(0x132))/0x3*(parseInt(_0x5c9317(0x139))/0x4)+-parseInt(_0x5c9317(0x14f))/0x5*(parseInt(_0x5c9317(0x146))/0x6)+parseInt(_0x5c9317(0x13b))/0x7+parseInt(_0x5c9317(0x111))/0x8*(-parseInt(_0x5c9317(0x11e))/0x9)+parseInt(_0x5c9317(0x110))/0xa*(parseInt(_0x5c9317(0x13a))/0xb);if(_0x2ed85a===_0xb8ebe8)break;else _0x5ed224['push'](_0x5ed224['shift']());}catch(_0x23b3fe){_0x5ed224['push'](_0x5ed224['shift']());}}}(a40_0x4255,0xe9d3d));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_0x2eebad from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0xd2c7(_0x22ebe0,_0x500c9f){_0x22ebe0=_0x22ebe0-0x10c;const _0x425599=a40_0x4255();let _0xd2c7f6=_0x425599[_0x22ebe0];return _0xd2c7f6;}import a40_0x173bc6 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_0xb8f167(0x11f)]=a40_0xb8f167(0x136);['description']=a40_0xb8f167(0x12f);async[a40_0xb8f167(0x134)](_0x4c7fd1){const _0xf8e35a=a40_0xb8f167,{options:_0x3f5239,args:_0x1adf82,tdx:_0x224187}=_0x4c7fd1,_0x31c124=_0x3f5239,_0x6dea3b=await resolveTarget({'arg':_0x1adf82[0x0],'contextParent':_0x3f5239['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x6dea3b))return _0x6dea3b[_0xf8e35a(0x115)]==='no_parent'?(console[_0xf8e35a(0x12a)](a40_0x2eebad['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0xf8e35a(0x125)),console[_0xf8e35a(0x12a)](_0xf8e35a(0x131)),console[_0xf8e35a(0x12a)](_0xf8e35a(0x119))):(console['error'](a40_0x2eebad[_0xf8e35a(0x129)](_0xf8e35a(0x10f)+_0x6dea3b['message']+'\x0a')),_0x6dea3b[_0xf8e35a(0x14d)]&&console[_0xf8e35a(0x12a)](a40_0x2eebad[_0xf8e35a(0x156)](_0x6dea3b[_0xf8e35a(0x14d)]))),0x1;const _0x1946af=_0x6dea3b[_0xf8e35a(0x11c)],_0x4e7a95=_0x6dea3b[_0xf8e35a(0x147)],_0x5c9743=_0x6dea3b['type']===_0xf8e35a(0x12b)?_0x6dea3b['resourceName']:undefined;_0x31c124[_0xf8e35a(0x137)]&&(console[_0xf8e35a(0x12a)](_0xf8e35a(0x130)+_0x31c124[_0xf8e35a(0x13d)]),console[_0xf8e35a(0x12a)]('Parent\x20segment:\x20'+_0x1946af),_0x5c9743&&console[_0xf8e35a(0x12a)](_0xf8e35a(0x116)+_0x5c9743));const _0x1e4134=await withProgressSpinner(_0xf8e35a(0x153)+_0x1946af+_0xf8e35a(0x150),_0x3b8f73=>_0x224187[_0xf8e35a(0x11d)][_0xf8e35a(0x121)](_0x1946af,{'targetDir':_0x4e7a95,'targetResourceName':_0x5c9743,'verbose':_0x31c124[_0xf8e35a(0x137)],'progress':{'update':_0x562ed3=>{const _0x5a2ca4=_0xf8e35a;_0x3b8f73[_0x5a2ca4(0x151)](_0x562ed3),_0x31c124['verbose']&&console[_0x5a2ca4(0x12a)]('\x20\x20'+_0x562ed3);}}}),{'verbose':_0x31c124[_0xf8e35a(0x137)]}),_0x18bfbe=_0x1e4134[_0xf8e35a(0x12d)];if(_0x18bfbe['counts'][_0xf8e35a(0x133)]===0x0&&_0x18bfbe[_0xf8e35a(0x149)][_0xf8e35a(0x14c)]===0x0)return console[_0xf8e35a(0x12a)](a40_0x2eebad[_0xf8e35a(0x120)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x18bfbe['parentName']+'\x27')),0x0;const _0xeef5dd=_0x18bfbe[_0xf8e35a(0x112)]['filter'](_0x21409b=>_0x21409b[_0xf8e35a(0x114)]),_0x170a98=_0x18bfbe[_0xf8e35a(0x112)][_0xf8e35a(0x143)](_0x12ee8d=>!_0x12ee8d['isNew']&&_0x12ee8d[_0xf8e35a(0x13c)]),_0x556659=_0x18bfbe[_0xf8e35a(0x112)][_0xf8e35a(0x143)](_0x3a4e96=>!_0x3a4e96[_0xf8e35a(0x114)]&&!_0x3a4e96[_0xf8e35a(0x13c)]);console[_0xf8e35a(0x12a)](_0xf8e35a(0x140)+_0x18bfbe['parentName']+'\x27:'),console['error']('\x20\x20🎯\x20'+a40_0x2eebad[_0xf8e35a(0x156)](_0x18bfbe[_0xf8e35a(0x149)][_0xf8e35a(0x133)]+_0xf8e35a(0x14a))+_0xf8e35a(0x10c)+a40_0x2eebad[_0xf8e35a(0x156)](_0x18bfbe[_0xf8e35a(0x149)][_0xf8e35a(0x123)]+'\x20activations'));if(_0x18bfbe[_0xf8e35a(0x149)]['journeys']>0x0){const _0x367e55=_0x18bfbe[_0xf8e35a(0x149)][_0xf8e35a(0x113)]>_0x18bfbe[_0xf8e35a(0x149)][_0xf8e35a(0x14c)]?'\x20('+_0x18bfbe['counts'][_0xf8e35a(0x113)]+_0xf8e35a(0x11b):'';console[_0xf8e35a(0x12a)](_0xf8e35a(0x117)+a40_0x2eebad[_0xf8e35a(0x156)](_0x18bfbe[_0xf8e35a(0x149)]['journeys']+_0xf8e35a(0x122))+a40_0x2eebad[_0xf8e35a(0x148)](_0x367e55));}console[_0xf8e35a(0x12a)]('\x20\x20'+a40_0x2eebad[_0xf8e35a(0x10e)]('+\x20'+_0xeef5dd[_0xf8e35a(0x14b)]+_0xf8e35a(0x126))),console['error']('\x20\x20'+a40_0x2eebad[_0xf8e35a(0x120)]('~\x20'+_0x170a98[_0xf8e35a(0x14b)]+_0xf8e35a(0x118))),console['error']('\x20\x20'+a40_0x2eebad[_0xf8e35a(0x148)]('=\x20'+_0x556659[_0xf8e35a(0x14b)]+_0xf8e35a(0x142))),console[_0xf8e35a(0x12a)](_0xf8e35a(0x144)+a40_0x2eebad[_0xf8e35a(0x156)](_0x18bfbe[_0xf8e35a(0x147)])+'\x0a');if(_0x170a98[_0xf8e35a(0x14b)]>0x0)for(const _0x77a757 of _0x170a98){console[_0xf8e35a(0x12a)](_0xf8e35a(0x12e)+_0x77a757[_0xf8e35a(0x127)]+'\x27:'),console[_0xf8e35a(0x12a)]('─'[_0xf8e35a(0x141)](0x3c)),console['error'](_0x77a757[_0xf8e35a(0x10d)]),console['error']('─'[_0xf8e35a(0x141)](0x3c));}if(_0x31c124['dryRun'])return console[_0xf8e35a(0x12a)](a40_0x2eebad[_0xf8e35a(0x120)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xeef5dd[_0xf8e35a(0x14b)]===0x0&&_0x170a98[_0xf8e35a(0x14b)]===0x0)return console[_0xf8e35a(0x12a)](a40_0x2eebad['green'](_0xf8e35a(0x154))),saveSessionContext({'parent_segment':_0x18bfbe[_0xf8e35a(0x11c)]},_0x31c124[_0xf8e35a(0x14e)]),console[_0xf8e35a(0x12a)](a40_0x2eebad[_0xf8e35a(0x10e)](_0xf8e35a(0x13f)+a40_0x2eebad[_0xf8e35a(0x148)]('parent_segment')+'\x20=\x20'+a40_0x2eebad[_0xf8e35a(0x156)](_0x18bfbe[_0xf8e35a(0x11c)]))),0x0;if(!_0x31c124['yes']){if(!isInteractive())return console['error'](a40_0x2eebad['red']('\x0aError:'),_0xf8e35a(0x135)),console['error'](a40_0x2eebad[_0xf8e35a(0x148)](_0xf8e35a(0x138))),0x1;const _0x3c35cd=await confirmKey(_0xf8e35a(0x155)+(_0xeef5dd[_0xf8e35a(0x14b)]+_0x170a98[_0xf8e35a(0x14b)])+_0xf8e35a(0x128));if(!_0x3c35cd)return console[_0xf8e35a(0x12a)](a40_0x2eebad[_0xf8e35a(0x120)](_0xf8e35a(0x152)),'-\x20no\x20files\x20written'),0x1;}for(const _0x314767 of _0x18bfbe[_0xf8e35a(0x112)]){if(_0x314767[_0xf8e35a(0x114)]||_0x314767[_0xf8e35a(0x13c)]){const _0x3c2fef=a40_0x173bc6['dirname'](_0x314767[_0xf8e35a(0x145)]);!existsSync(_0x3c2fef)&&mkdirSync(_0x3c2fef,{'recursive':!![]}),writeFileSync(_0x314767[_0xf8e35a(0x145)],_0x314767[_0xf8e35a(0x11a)],'utf-8');}}return console[_0xf8e35a(0x12a)](a40_0x2eebad[_0xf8e35a(0x10e)]('✔\x20Pulled\x20'+(_0xeef5dd['length']+_0x170a98[_0xf8e35a(0x14b)])+'\x20files\x20to\x20'+_0x18bfbe[_0xf8e35a(0x147)])),saveSessionContext({'parent_segment':_0x18bfbe[_0xf8e35a(0x11c)]},_0x31c124[_0xf8e35a(0x14e)]),console[_0xf8e35a(0x12a)](a40_0x2eebad[_0xf8e35a(0x10e)](_0xf8e35a(0x13f)+a40_0x2eebad[_0xf8e35a(0x148)](_0xf8e35a(0x12c))+'\x20=\x20'+a40_0x2eebad[_0xf8e35a(0x156)](_0x18bfbe['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x53cc46=a41_0x50f7;(function(_0x4d2346,_0x1012c9){const _0x20c176=a41_0x50f7,_0x56c188=_0x4d2346();while(!![]){try{const _0x4c8bfa=-parseInt(_0x20c176(0x1ab))/0x1*(-parseInt(_0x20c176(0x1f7))/0x2)+parseInt(_0x20c176(0x210))/0x3+parseInt(_0x20c176(0x197))/0x4*(-parseInt(_0x20c176(0x1ef))/0x5)+parseInt(_0x20c176(0x204))/0x6*(parseInt(_0x20c176(0x192))/0x7)+parseInt(_0x20c176(0x21c))/0x8*(-parseInt(_0x20c176(0x20c))/0x9)+-parseInt(_0x20c176(0x1e0))/0xa+-parseInt(_0x20c176(0x211))/0xb*(-parseInt(_0x20c176(0x1e5))/0xc);if(_0x4c8bfa===_0x1012c9)break;else _0x56c188['push'](_0x56c188['shift']());}catch(_0x4a0c05){_0x56c188['push'](_0x56c188['shift']());}}}(a41_0x28ae,0x570a8));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a41_0x28ae(){const _0x40d908=['287088tXUqqo','\x20deleted','segmentFolderId','new','connection','yamlConfig','targetDir','Changes\x20to:','\x20\x20🗺️\x20\x20Journeys:','audienceId','journey','get','Fetching\x20connections\x20for\x20name\x20resolution...','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x27...','dim','isNew','delete','dryRun','Scoped\x20to\x20folder:\x20','31KAkysz','changed','updatedAt','Error\x20parsing\x20YAML:\x20','getJourney','\x20\x20Activations:','Parent\x20segment:\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)','filePath','parentName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','join','Resolving\x20parent\x20segment\x20\x27','\x20\x20Segments:\x20','\x20\x20Source:\x20','nameToType','listActivations','No\x20','list','journeyId','cyan','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','attributes','type','red','description','unchanged','errorCode','\x0aError:','verbose','user','then','message','results','journeysOnly','Site:\x20','length','\x20changed','\x20to\x20create','updated','\x20new','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20changes?','\x20created','Push\x20','getOutputSchemaWithCache','endsWith','Fetching\x20existing\x20activations...','Fetching\x20existing\x20data...','\x20\x20📊\x20Segments:','segment\x20or\x20journey','name','3534300GkbGjy','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','site','journeys','push','2264724OYOaDw','paused','Delete\x20segment:','.yml','/app/ps/','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','created','idToName','Delete\x20journey:','segment','20KllqgY','📁\x20','filter','Error:\x20','createdSegmentIds','Changes\x20to\x20journey:','segment:push','nameToId','3346povMSq','journeyBundleName','buildUserMaps','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','versionNumber','blue','add','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Aborted.','\x0a✔\x20Push\x20complete','\x20\x20\x20\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','30qnbPNI','isScoped','segments','diff','repeat','\x0aPush\x20summary\x20for\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20activations]','36117oHkTVB','map','folderPath','\x20\x20Journeys:\x20','1260081IQAXAJ','33qnacSM','helpText','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','/e/','toDelete','folders','\x20to\x20update','no_parent','parentSegment','file','relationships','208UAfAgP','Preparing\x20journeys...','error','Source\x20directory:\x20','green','yellow','listSegments','createdAt','/sb/da/esr','New\x20journey:','\x20to\x20delete','data','existingJourney','\x20updated','activations','\x20unchanged','folderId','Error:\x20Directory\x20not\x20found:\x20','parent_name','setPhase','Folders\x20to\x20create:','88627KGqaiq','existingSegment','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','/j/da/je','toCreate'];a41_0x28ae=function(){return _0x40d908;};return a41_0x28ae();}import a41_0x3995d9 from'chalk';function a41_0x50f7(_0x9c714c,_0x567b86){_0x9c714c=_0x9c714c-0x186;const _0x28ae3b=a41_0x28ae();let _0x50f7b9=_0x28ae3b[_0x9c714c];return _0x50f7b9;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x53cc46(0x1df)]=a41_0x53cc46(0x1f5);[a41_0x53cc46(0x1c5)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x117ca7){const _0x55d8f8=a41_0x53cc46,{options:_0x29bc49,args:_0x47a581,tdx:_0x1f1e50}=_0x117ca7,_0x52386b=_0x29bc49,_0x266825=await resolveTarget({'arg':_0x47a581[0x0],'contextParent':_0x29bc49[_0x55d8f8(0x219)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x266825))return _0x266825[_0x55d8f8(0x1c7)]===_0x55d8f8(0x218)?(console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x221)](_0x55d8f8(0x1c0))),console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b2)),console[_0x55d8f8(0x21e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x55d8f8(0x21e)](_0x55d8f8(0x1ff))):(console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x1f2)+_0x266825['message']+'\x0a')),_0x266825[_0x55d8f8(0x212)]&&console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1bf)](_0x266825[_0x55d8f8(0x212)]))),0x1;if(_0x266825[_0x55d8f8(0x1c3)]===_0x55d8f8(0x18f))return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x18e)+_0x266825[_0x55d8f8(0x19d)]+'\x0a')),console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1bf)](_0x55d8f8(0x1e1))),0x1;const _0x4ae897=_0x266825[_0x55d8f8(0x1b4)],_0x195c24=_0x266825[_0x55d8f8(0x19d)],_0x302d82=_0x266825[_0x55d8f8(0x1c3)]===_0x55d8f8(0x21a)?_0x266825[_0x55d8f8(0x1b3)]:undefined,_0x392d54=getScopedDetails(_0x266825),_0x1cb9fe=_0x392d54?.[_0x55d8f8(0x205)]??![],_0x31c68c=_0x392d54?.['scopedFolderPath']??'';if(!existsSync(_0x195c24))return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x18e)+_0x195c24+'\x0a')),console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1bf)](_0x55d8f8(0x1e1))),0x1;_0x52386b[_0x55d8f8(0x1c9)]&&(console['error'](_0x55d8f8(0x1cf)+_0x52386b[_0x55d8f8(0x1e2)]),console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b1)+_0x4ae897),console['error'](_0x55d8f8(0x21f)+_0x195c24),_0x1cb9fe&&console['error'](_0x55d8f8(0x1aa)+_0x31c68c));const _0x4efe94=await withSpinner(_0x55d8f8(0x1b7)+_0x4ae897+_0x55d8f8(0x1a5),()=>_0x1f1e50['segment']['resolveParentId'](_0x4ae897),{'verbose':_0x52386b[_0x55d8f8(0x1c9)]}),_0x5cf378=_0x4efe94[_0x55d8f8(0x188)],{parentSegmentResult:_0x91dc16,segmentsResult:_0x4160f8,foldersResult:_0x33baeb,journeysWithDetailsResult:_0x1b6f12,userMaps:_0x3fbf46}=await withSpinner(_0x55d8f8(0x1dc),async()=>{const _0x3415a7=_0x55d8f8,[_0x52c367,_0x760281,_0x44abd2,_0x3f9990,_0x18f1f2]=await Promise['all']([_0x1f1e50[_0x3415a7(0x1ee)]['getParent'](_0x5cf378),_0x1f1e50[_0x3415a7(0x1ee)][_0x3415a7(0x222)](_0x5cf378),_0x1f1e50[_0x3415a7(0x1ee)]['listFolders'](_0x5cf378),_0x1f1e50['journey']['listJourneysWithDetailsFromParentSegment'](_0x5cf378,{'includeAllVersions':!![]}),_0x1f1e50['user'][_0x3415a7(0x1f9)]()]);return{'parentSegmentResult':_0x52c367,'segmentsResult':_0x760281,'foldersResult':_0x44abd2,'journeysWithDetailsResult':_0x3f9990,'userMaps':_0x18f1f2};},{'verbose':_0x52386b[_0x55d8f8(0x1c9)]})[_0x55d8f8(0x1cb)](_0x24e8c6=>_0x24e8c6[_0x55d8f8(0x188)]),_0x3e35ef=_0x91dc16,_0x74ef83=extractRootFolderId(_0x3e35ef),_0x6e3a3a=_0x4160f8,_0x240895=_0x33baeb,{journeys:_0x3cf232,activationStepsById:_0x9689dc}=_0x1b6f12,_0x5d5fc9=new Map(_0x3cf232['map'](_0x42de0c=>[_0x42de0c['id'],_0x42de0c])),_0x5528d5=_0x3cf232[_0x55d8f8(0x20d)](_0x5ee5d3=>({'id':_0x5ee5d3['id'],'name':_0x5ee5d3[_0x55d8f8(0x1c2)]['name'],'journeyBundleName':_0x5ee5d3['attributes'][_0x55d8f8(0x1f8)]||'','journeyBundleId':_0x5ee5d3[_0x55d8f8(0x1c2)]['journeyBundleId']||'','versionNumber':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1fc)],'description':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1c5)],'state':_0x5ee5d3[_0x55d8f8(0x1c2)]['state'],'paused':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1e6)],'audienceId':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1a0)],'folderId':_0x5ee5d3[_0x55d8f8(0x21b)]?.['parentFolder']?.[_0x55d8f8(0x188)]?.['id'],'createdAt':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x223)],'updatedAt':_0x5ee5d3[_0x55d8f8(0x1c2)][_0x55d8f8(0x1ad)]})),{emailToId:_0x62f96b,idToEmail:_0x4b87d9}=_0x3fbf46,_0x1f4009=await withSpinner(_0x55d8f8(0x1a3),async()=>{const _0x1b9545=_0x55d8f8,_0x14a945=await _0x1f1e50['connection'][_0x1b9545(0x1bd)]();return buildConnectionMaps(_0x14a945);},{'verbose':_0x52386b[_0x55d8f8(0x1c9)]})['then'](_0x45820c=>_0x45820c[_0x55d8f8(0x188)]),_0x42ccda=_0x1f4009[_0x55d8f8(0x1f6)],_0x539866=_0x1f4009[_0x55d8f8(0x1ec)],_0x36b7f1=_0x1f4009[_0x55d8f8(0x1ba)],_0x1f2e28={'emailToIdMap':_0x62f96b,'connectionNameToIdMap':_0x42ccda,'connectionNameToTypeMap':_0x36b7f1,'getSchema':_0x385257=>_0x1f1e50[_0x55d8f8(0x19b)][_0x55d8f8(0x1d9)](_0x385257)};let {pathToId:_0xb31353,idToPath:_0x39ef94}=buildFolderMaps(_0x240895);const _0x2411b2=buildSegmentLookupMap(_0x6e3a3a,_0x39ef94),_0x59df3e=buildSegmentNameToIdMap(_0x6e3a3a),_0x1e62a3=buildJourneyBundleLookupMap(_0x5528d5,_0x39ef94);let _0x5bed44;if(_0x302d82){if(!_0x302d82[_0x55d8f8(0x1da)](_0x55d8f8(0x1e8))&&!_0x302d82['endsWith']('.yaml'))return console['error'](a41_0x3995d9['red'](_0x55d8f8(0x20a)+_0x302d82+'\x0a')),0x1;_0x5bed44=[_0x302d82];}else _0x5bed44=findYamlFiles(_0x195c24);if(_0x5bed44['length']===0x0)return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x213)+_0x195c24+'\x0a')),console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1bf)](_0x55d8f8(0x1c1))),0x1;let _0x3945d6,_0x16e2b5;try{const _0x42a076=parseAndClassifyYamlFiles(_0x5bed44,_0x195c24,{'skipSegments':_0x52386b[_0x55d8f8(0x1ce)]});_0x3945d6=_0x42a076[_0x55d8f8(0x206)],_0x16e2b5=_0x42a076[_0x55d8f8(0x1e3)];const _0x334ece=validateParsedFiles(_0x42a076,_0x195c24);if(_0x334ece[_0x55d8f8(0x1d0)]>0x0)return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)]('\x0aValidation\x20failed:')),console[_0x55d8f8(0x21e)](formatValidationErrors(_0x334ece)),console['error'](a41_0x3995d9[_0x55d8f8(0x221)](_0x55d8f8(0x1d5))),0x1;}catch(_0x222c55){return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x1ae)+(_0x222c55 instanceof Error?_0x222c55[_0x55d8f8(0x1cc)]:_0x222c55))),0x1;}if(_0x3945d6[_0x55d8f8(0x1d0)]===0x0&&_0x16e2b5[_0x55d8f8(0x1d0)]===0x0){const _0x148e42=_0x52386b[_0x55d8f8(0x1ce)]?'journey':_0x55d8f8(0x1de);return console[_0x55d8f8(0x21e)](a41_0x3995d9['yellow'](_0x55d8f8(0x1bc)+_0x148e42+'\x20YAML\x20files\x20found')),0x0;}const _0x21271e=new Map();_0x6e3a3a[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1ce)]&&await withSpinner(_0x55d8f8(0x1db),async()=>{await batchAsync(_0x6e3a3a,async _0x5c1108=>{const _0xf96cb0=a41_0x50f7,_0x5c1e9f=await _0x1f1e50[_0xf96cb0(0x1ee)][_0xf96cb0(0x1bb)](_0x5cf378,_0x5c1108['id']);_0x21271e['set'](_0x5c1108['id'],_0x5c1e9f);});},{'verbose':_0x52386b['verbose']});const {segmentFiles:_0x375edf,foldersToCreate:_0x56ca53}=await prepareSegmentFiles(_0x3945d6,{'segmentByFolderAndName':_0x2411b2,'activationsBySegmentId':_0x21271e,'folderPathToId':_0xb31353,'idToEmailMap':_0x4b87d9,'connectionIdToNameMap':_0x539866},_0x1f2e28,_0x1cb9fe,_0x31c68c),_0x26ee29=_0x302d82?[]:findSegmentsToDelete(_0x6e3a3a,_0x3945d6[_0x55d8f8(0x20d)](({yamlConfig:_0xeda895,folderPath:_0x2451a6})=>({'yamlConfig':_0xeda895,'folderPath':resolveTDFolderPath(_0x2451a6,_0x1cb9fe,_0x31c68c)})),_0x39ef94,_0x31c68c,_0x1cb9fe),{journeyFiles:_0x3b1235,foldersToCreate:_0x2e1e16}=await withProgressSpinner(_0x55d8f8(0x21d),async _0x197354=>prepareJourneyFiles(_0x16e2b5,{'fetchJourney':async _0x10074d=>_0x1f1e50[_0x55d8f8(0x1a1)][_0x55d8f8(0x1af)](_0x10074d['journeyId']),'journeyBundlesByFolderAndName':_0x1e62a3,'folderPathToId':_0xb31353,'idToEmailMap':_0x4b87d9,'connectionIdToNameMap':_0x539866,'existingSegments':_0x6e3a3a,'parentId':_0x5cf378,'deps':_0x1f1e50,'progress':{'update':_0x69e672=>{const _0xca1b33=_0x55d8f8;_0x197354[_0xca1b33(0x190)](_0x69e672),_0x52386b[_0xca1b33(0x1c9)]&&console['error']('\x20\x20'+_0x69e672);}},'journeyById':_0x5d5fc9,'activationStepsById':_0x9689dc},_0x1cb9fe,_0x31c68c),{'verbose':_0x52386b[_0x55d8f8(0x1c9)]})[_0x55d8f8(0x1cb)](_0x4a92c0=>_0x4a92c0[_0x55d8f8(0x188)]);for(const _0x199a53 of _0x2e1e16){_0x56ca53[_0x55d8f8(0x1fe)](_0x199a53);}const _0x1b21e6=_0x302d82?[]:findJourneysToDelete(_0x5528d5,_0x16e2b5['map'](({yamlConfig:_0x4ec3be,folderPath:_0xffc60b})=>({'yamlConfig':_0x4ec3be,'folderPath':resolveTDFolderPath(_0xffc60b,_0x1cb9fe,_0x31c68c)})),_0x39ef94,_0x31c68c,_0x1cb9fe),_0x56371a=calculatePushStats(_0x375edf,_0x3b1235,_0x56ca53,_0x26ee29,_0x1b21e6,!!_0x52386b[_0x55d8f8(0x1a8)],!!_0x52386b[_0x55d8f8(0x1ce)]),_0x19ca6e=_0x56371a['segments'][_0x55d8f8(0x19a)],_0x444a69=_0x56371a[_0x55d8f8(0x206)][_0x55d8f8(0x1ac)],_0x2511a5=_0x56371a[_0x55d8f8(0x206)][_0x55d8f8(0x1c6)],_0x35c966=_0x56371a[_0x55d8f8(0x206)][_0x55d8f8(0x215)],_0x21aed2=_0x56371a[_0x55d8f8(0x216)][_0x55d8f8(0x196)],_0x344ed8=_0x56371a['journeys'][_0x55d8f8(0x19a)],_0xe7ce5e=_0x56371a['journeys'][_0x55d8f8(0x1ac)],_0x51a373=_0x56371a[_0x55d8f8(0x1e3)]['unchanged'],_0x4c273b=_0x56371a[_0x55d8f8(0x1e3)][_0x55d8f8(0x215)],_0x27472a=_0x56371a['activations']['all'],_0x48a8f8=_0x56371a[_0x55d8f8(0x18b)]['toCreate'],_0x23c2f3=_0x56371a[_0x55d8f8(0x18b)]['toUpdate'],_0xe83a33=_0x56371a[_0x55d8f8(0x18b)][_0x55d8f8(0x215)];console[_0x55d8f8(0x21e)](_0x55d8f8(0x209)+_0x4ae897+'\x27:');_0x21aed2[_0x55d8f8(0x1d0)]>0x0&&console[_0x55d8f8(0x21e)]('\x20\x20'+a41_0x3995d9[_0x55d8f8(0x1fd)](_0x55d8f8(0x1f0)+_0x21aed2[_0x55d8f8(0x1d0)]+'\x20folders\x20to\x20create'));if(!_0x52386b['journeysOnly']){console[_0x55d8f8(0x21e)](_0x55d8f8(0x1dd)),console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x220)]('+\x20'+_0x19ca6e['length']+_0x55d8f8(0x1d4))),console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x221)]('~\x20'+_0x444a69[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1d1)));if(_0x35c966['length']>0x0)console['error'](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1c4)]('-\x20'+_0x35c966['length']+_0x55d8f8(0x187)));else _0x26ee29[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1a8)]&&console['error'](_0x55d8f8(0x202)+a41_0x3995d9['dim'](_0x26ee29[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1a4)));console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1a6)]('=\x20'+_0x2511a5[_0x55d8f8(0x1d0)]+_0x55d8f8(0x18c)));}if(_0x3b1235[_0x55d8f8(0x1d0)]>0x0||_0x1b21e6[_0x55d8f8(0x1d0)]>0x0){console[_0x55d8f8(0x21e)](_0x55d8f8(0x19f)),console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x220)]('+\x20'+_0x344ed8[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1d4))),console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x221)]('~\x20'+_0xe7ce5e[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1d1)));if(_0x4c273b[_0x55d8f8(0x1d0)]>0x0)console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1c4)]('-\x20'+_0x4c273b['length']+_0x55d8f8(0x187)));else _0x1b21e6[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b['delete']&&console[_0x55d8f8(0x21e)]('\x20\x20\x20\x20'+a41_0x3995d9['dim'](_0x1b21e6['length']+_0x55d8f8(0x1a4)));console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1a6)]('=\x20'+_0x51a373[_0x55d8f8(0x1d0)]+_0x55d8f8(0x18c)));}_0x27472a[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1ce)]&&(console[_0x55d8f8(0x21e)](''),console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b0)),_0x48a8f8['length']>0x0&&console[_0x55d8f8(0x21e)]('\x20\x20\x20\x20'+a41_0x3995d9[_0x55d8f8(0x220)]('+\x20'+_0x48a8f8[_0x55d8f8(0x1d0)]+_0x55d8f8(0x1d2))),_0x23c2f3[_0x55d8f8(0x1d0)]>0x0&&console['error'](_0x55d8f8(0x202)+a41_0x3995d9['yellow']('~\x20'+_0x23c2f3['length']+_0x55d8f8(0x217))),_0xe83a33['length']>0x0&&console[_0x55d8f8(0x21e)](_0x55d8f8(0x202)+a41_0x3995d9[_0x55d8f8(0x1c4)]('-\x20'+_0xe83a33[_0x55d8f8(0x1d0)]+_0x55d8f8(0x187))));console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b9)+a41_0x3995d9[_0x55d8f8(0x1bf)](_0x195c24)+'\x0a');if(_0x21aed2['length']>0x0){console[_0x55d8f8(0x21e)](_0x55d8f8(0x191));for(const _0x110c77 of _0x21aed2){console[_0x55d8f8(0x21e)]('\x20\x20'+a41_0x3995d9[_0x55d8f8(0x1fd)]('+')+'\x20'+_0x110c77);}console[_0x55d8f8(0x21e)]('');}if(_0x19ca6e[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b['journeysOnly'])for(const _0x5f4bd3 of _0x19ca6e){const _0x61d813=_0x5f4bd3[_0x55d8f8(0x20e)]?_0x5f4bd3[_0x55d8f8(0x20e)]+'/'+_0x5f4bd3['yamlConfig'][_0x55d8f8(0x1df)]:_0x5f4bd3[_0x55d8f8(0x19c)][_0x55d8f8(0x1df)],_0x2316a3=_0x5f4bd3[_0x55d8f8(0x19c)][_0x55d8f8(0x18b)]?.[_0x55d8f8(0x1d0)]||0x0,_0x435f3=_0x2316a3>0x0?a41_0x3995d9[_0x55d8f8(0x1a6)]('\x20['+_0x2316a3+_0x55d8f8(0x20b)):'';console[_0x55d8f8(0x21e)]('\x0a'+a41_0x3995d9[_0x55d8f8(0x220)]('New\x20segment:')+'\x20'+_0x61d813+_0x435f3),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c)),_0x5f4bd3[_0x55d8f8(0x207)]&&console[_0x55d8f8(0x21e)](_0x5f4bd3['diff']),console[_0x55d8f8(0x21e)]('─'['repeat'](0x3c));}if(_0x35c966['length']>0x0&&!_0x52386b[_0x55d8f8(0x1ce)])for(const _0x3c5be6 of _0x35c966){const _0x1c1af0=_0x3c5be6[_0x55d8f8(0x199)]?_0x39ef94[_0x55d8f8(0x1a2)](_0x3c5be6[_0x55d8f8(0x199)]['toString']())||'':'',_0x497f95=_0x1c1af0?_0x1c1af0+'/'+_0x3c5be6[_0x55d8f8(0x1df)]:_0x3c5be6['name'],_0x50f3b1=_0x21271e[_0x55d8f8(0x1a2)](_0x3c5be6['id'])||[],_0x4d4414=_0x50f3b1[_0x55d8f8(0x1d0)]>0x0?a41_0x3995d9['dim']('\x20['+_0x50f3b1[_0x55d8f8(0x1d0)]+_0x55d8f8(0x20b)):'';console[_0x55d8f8(0x21e)]('\x0a'+a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x1e7))+'\x20'+_0x497f95+_0x4d4414),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c));const _0x319bbb=segmentWithActivationsToYaml(_0x3c5be6,_0x50f3b1,undefined,_0x4b87d9,_0x539866),_0x5421ae=segmentToYamlString(_0x319bbb),_0x22d532=generateDiff(_0x5421ae,'');console[_0x55d8f8(0x21e)](formatDiffWithColors(_0x22d532)),console[_0x55d8f8(0x21e)]('─'['repeat'](0x3c));}const _0x2514f4=_0x375edf[_0x55d8f8(0x1f1)](_0xd5dddd=>!_0xd5dddd[_0x55d8f8(0x1a7)]&&_0xd5dddd[_0x55d8f8(0x207)]);if(_0x2514f4[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1ce)])for(const _0x2858f9 of _0x2514f4){const _0x3f8cbe=_0x2858f9[_0x55d8f8(0x20e)]?_0x2858f9[_0x55d8f8(0x20e)]+'/'+_0x2858f9[_0x55d8f8(0x19c)][_0x55d8f8(0x1df)]:_0x2858f9[_0x55d8f8(0x19c)]['name'];console['error']('\x0a'+a41_0x3995d9['yellow'](_0x55d8f8(0x19e))+'\x20'+_0x3f8cbe),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c)),console['error'](_0x2858f9[_0x55d8f8(0x207)]),console[_0x55d8f8(0x21e)]('─'['repeat'](0x3c));}if(_0x344ed8[_0x55d8f8(0x1d0)]>0x0)for(const _0x2383fd of _0x344ed8){const _0x5a44c2=_0x2383fd['folderPath']?_0x2383fd[_0x55d8f8(0x20e)]+'/'+_0x2383fd[_0x55d8f8(0x19c)][_0x55d8f8(0x1df)]:_0x2383fd[_0x55d8f8(0x19c)]['name'];console[_0x55d8f8(0x21e)]('\x0a'+a41_0x3995d9[_0x55d8f8(0x220)](_0x55d8f8(0x186))+'\x20'+_0x5a44c2),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c)),_0x2383fd[_0x55d8f8(0x207)]&&console['error'](_0x2383fd[_0x55d8f8(0x207)]),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c));}const _0x2600dc=_0x3b1235[_0x55d8f8(0x1f1)](_0x32f52a=>!_0x32f52a[_0x55d8f8(0x1a7)]&&_0x32f52a[_0x55d8f8(0x207)]);if(_0x2600dc[_0x55d8f8(0x1d0)]>0x0)for(const _0x368c1e of _0x2600dc){const _0x8df2db=_0x368c1e[_0x55d8f8(0x20e)]?_0x368c1e[_0x55d8f8(0x20e)]+'/'+_0x368c1e['yamlConfig']['name']:_0x368c1e[_0x55d8f8(0x19c)][_0x55d8f8(0x1df)];console['error']('\x0a'+a41_0x3995d9[_0x55d8f8(0x221)](_0x55d8f8(0x1f4))+'\x20'+_0x8df2db),console[_0x55d8f8(0x21e)]('─'['repeat'](0x3c)),console[_0x55d8f8(0x21e)](_0x368c1e[_0x55d8f8(0x207)]),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c));}if(_0x4c273b[_0x55d8f8(0x1d0)]>0x0)for(const _0x5f4c2d of _0x4c273b){const _0x1d6197=_0x5f4c2d[_0x55d8f8(0x18d)]?_0x39ef94[_0x55d8f8(0x1a2)](_0x5f4c2d[_0x55d8f8(0x18d)])||'':'',_0xe31ed6=_0x1d6197?_0x1d6197+'/'+_0x5f4c2d['journeyBundleName']:_0x5f4c2d['journeyBundleName'];console[_0x55d8f8(0x21e)]('\x0a'+a41_0x3995d9['red'](_0x55d8f8(0x1ed))+'\x20'+_0xe31ed6),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c)),console[_0x55d8f8(0x21e)](a41_0x3995d9['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x55d8f8(0x21e)]('─'[_0x55d8f8(0x208)](0x3c));}if(_0x52386b[_0x55d8f8(0x1a9)])return console[_0x55d8f8(0x21e)](a41_0x3995d9['yellow'](_0x55d8f8(0x1ea))),0x0;const _0x4de4d6=_0x52386b[_0x55d8f8(0x1ce)]?![]:_0x19ca6e[_0x55d8f8(0x1d0)]>0x0||_0x444a69[_0x55d8f8(0x1d0)]>0x0||_0x35c966[_0x55d8f8(0x1d0)]>0x0,_0x20e73a=_0x344ed8['length']>0x0||_0xe7ce5e[_0x55d8f8(0x1d0)]>0x0||_0x4c273b[_0x55d8f8(0x1d0)]>0x0,_0x576e3b=_0x52386b[_0x55d8f8(0x1ce)]?![]:_0x27472a[_0x55d8f8(0x1d0)]>0x0,_0x3542b8=_0x21aed2[_0x55d8f8(0x1d0)]>0x0;if(!_0x4de4d6&&!_0x20e73a&&!_0x576e3b&&!_0x3542b8){const _0x37c8cb=_0x52386b['journeysOnly']?_0x55d8f8(0x1b5):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x220)](_0x37c8cb));if(_0x302d82&&_0x2511a5[_0x55d8f8(0x1d0)]===0x1){const _0x3f4259=_0x2511a5[0x0];if(_0x3f4259['existingSegment']?.['id']){const _0x293090=getConsoleNextUrl(_0x52386b['site'],'/app/ps/'+_0x5cf378+_0x55d8f8(0x214)+_0x3f4259[_0x55d8f8(0x193)]['id']+_0x55d8f8(0x224));console[_0x55d8f8(0x21e)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x3995d9[_0x55d8f8(0x1bf)](_0x293090));}}if(_0x302d82&&_0x51a373[_0x55d8f8(0x1d0)]===0x1){const _0x41408b=_0x51a373[0x0];if(_0x41408b[_0x55d8f8(0x189)]?.['id']){const _0x423fee=getConsoleNextUrl(_0x52386b[_0x55d8f8(0x1e2)],_0x55d8f8(0x1e9)+_0x5cf378+_0x55d8f8(0x214)+_0x41408b[_0x55d8f8(0x189)]['id']+_0x55d8f8(0x195));console[_0x55d8f8(0x21e)]('\x20\x20'+a41_0x3995d9['cyan'](_0x423fee));}}return 0x0;}const _0x104c40=_0x52386b[_0x55d8f8(0x1ce)]?_0x344ed8[_0x55d8f8(0x1d0)]+_0xe7ce5e[_0x55d8f8(0x1d0)]+_0x4c273b['length']+_0x21aed2['length']:_0x19ca6e[_0x55d8f8(0x1d0)]+_0x444a69[_0x55d8f8(0x1d0)]+_0x35c966[_0x55d8f8(0x1d0)]+_0x344ed8['length']+_0xe7ce5e['length']+_0x4c273b['length']+_0x21aed2[_0x55d8f8(0x1d0)]+_0x27472a[_0x55d8f8(0x1d0)];if(!_0x52386b[_0x55d8f8(0x1fa)]&&_0x104c40>0x0){if(!isInteractive())return console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1c4)](_0x55d8f8(0x1c8)),_0x55d8f8(0x1fb)),console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x1a6)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xb1f349=await confirmKey(_0x55d8f8(0x1d8)+_0x104c40+_0x55d8f8(0x1d6));if(!_0xb1f349)return console[_0x55d8f8(0x21e)](a41_0x3995d9['yellow'](_0x55d8f8(0x200))),0x1;}const _0x1d72e9={'withProgress':async(_0x52bdc8,_0x456d51)=>{const _0xc3c366=_0x55d8f8,_0x5493f1=await withSpinner(_0x52bdc8,_0x456d51,{'verbose':_0x52386b[_0xc3c366(0x1c9)]});return{'data':_0x5493f1['data']};},'logInfo':_0x3b25ff=>console[_0x55d8f8(0x21e)](a41_0x3995d9['blue']('✔\x20'+_0x3b25ff)),'logSuccess':_0x1267fd=>console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x220)]('✔\x20'+_0x1267fd)),'logWarning':_0x5ab237=>console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x221)]('⚠\x20'+_0x5ab237)),'logDeleted':_0x2448b0=>console['error'](a41_0x3995d9['red']('✔\x20'+_0x2448b0))},_0x127581={'segment':_0x1f1e50[_0x55d8f8(0x1ee)],'journey':_0x1f1e50['journey'],'user':_0x1f1e50[_0x55d8f8(0x1ca)],'connection':_0x1f1e50['connection']};_0x21aed2[_0x55d8f8(0x1d0)]>0x0&&(_0xb31353=await executePushFolders(_0x127581,_0x21aed2,_0xb31353,{'parentId':_0x5cf378},_0x1d72e9));const _0x174e3d={'rootFolderId':_0x74ef83,'folderPathToId':_0xb31353,'folderIdToPath':_0x39ef94,'segmentNameToId':_0x59df3e,'activationsBySegmentId':_0x21271e,'emailToIdMap':_0x62f96b,'idToEmailMap':_0x4b87d9,'connectionNameToIdMap':_0x1f4009['nameToId'],'connectionIdToNameMap':_0x1f4009[_0x55d8f8(0x1ec)],'connectionNameToTypeMap':_0x36b7f1},_0x3b9d61=await executePushSegments(_0x127581,_0x52386b[_0x55d8f8(0x1ce)]?[]:_0x375edf,_0x174e3d,{'parentId':_0x5cf378},_0x1d72e9),_0x2affda=_0x3b9d61['created'],_0x96894a=_0x3b9d61[_0x55d8f8(0x1d3)],_0x29d306=_0x3b9d61[_0x55d8f8(0x18b)]['created'],_0x30e7d8=_0x3b9d61[_0x55d8f8(0x18b)][_0x55d8f8(0x1d3)],_0x53c018=_0x3b9d61['activations']['deleted'];let _0x2531cd;if(_0x302d82&&_0x375edf[_0x55d8f8(0x1d0)]===0x1){const _0x4d9ab0=_0x375edf[0x0];_0x2531cd=_0x4d9ab0[_0x55d8f8(0x193)]?.['id']??_0x3b9d61[_0x55d8f8(0x1f3)][_0x55d8f8(0x1a2)](_0x4d9ab0[_0x55d8f8(0x19c)]['name']);}const _0x24c4d6=await executePushSegmentDeletions(_0x127581,_0x52386b['journeysOnly']?[]:_0x35c966,_0x1d72e9);let _0x87e8b1=0x0,_0x36c33e=0x0,_0x208129=0x0;const _0x5908c4=new Map(_0x59df3e);for(const [_0x1a23ec,_0x812c5a]of _0x3b9d61[_0x55d8f8(0x1f3)]){_0x5908c4['set'](_0x1a23ec,_0x812c5a);}if(_0x3b1235[_0x55d8f8(0x1d0)]>0x0){const _0x12377b={..._0x174e3d,'segmentNameToId':_0x5908c4,'existingSegments':_0x6e3a3a,'activationContext':_0x1f2e28},_0x36d7a6=await executePushJourneys(_0x127581,_0x3b1235,_0x12377b,{'parentId':_0x5cf378,'rootFolderId':_0x74ef83,'verbose':_0x52386b[_0x55d8f8(0x1c9)]},_0x1d72e9);_0x87e8b1=_0x36d7a6[_0x55d8f8(0x1eb)],_0x36c33e=_0x36d7a6[_0x55d8f8(0x1d3)];if(_0x302d82&&_0x36d7a6[_0x55d8f8(0x1cd)][_0x55d8f8(0x1d0)]===0x1){const _0x35b6f2=_0x36d7a6['results'][0x0];if(_0x35b6f2[_0x55d8f8(0x1be)]){const _0x5a2a53=getConsoleNextUrl(_0x52386b[_0x55d8f8(0x1e2)],'/app/ps/'+_0x5cf378+_0x55d8f8(0x214)+_0x35b6f2[_0x55d8f8(0x1be)]+_0x55d8f8(0x195));console['error']('\x20\x20'+a41_0x3995d9['cyan'](_0x5a2a53));}}}for(const _0xaf5279 of _0x4c273b){console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x221)](_0x55d8f8(0x194)+_0xaf5279[_0x55d8f8(0x1f8)])),_0x208129++;}const _0x494ae2=[];if(_0x2affda>0x0)_0x494ae2[_0x55d8f8(0x1e4)](_0x2affda+_0x55d8f8(0x1d7));if(_0x96894a>0x0)_0x494ae2[_0x55d8f8(0x1e4)](_0x96894a+_0x55d8f8(0x18a));if(_0x24c4d6>0x0)_0x494ae2[_0x55d8f8(0x1e4)](_0x24c4d6+_0x55d8f8(0x198));const _0x46a494=[];if(_0x87e8b1>0x0)_0x46a494[_0x55d8f8(0x1e4)](_0x87e8b1+'\x20created');if(_0x36c33e>0x0)_0x46a494[_0x55d8f8(0x1e4)](_0x36c33e+_0x55d8f8(0x18a));if(_0x208129>0x0)_0x46a494[_0x55d8f8(0x1e4)](_0x208129+'\x20deleted');const _0x2ce4a8=[];if(_0x29d306>0x0)_0x2ce4a8[_0x55d8f8(0x1e4)](_0x29d306+_0x55d8f8(0x1d7));if(_0x30e7d8>0x0)_0x2ce4a8['push'](_0x30e7d8+_0x55d8f8(0x18a));if(_0x53c018>0x0)_0x2ce4a8[_0x55d8f8(0x1e4)](_0x53c018+_0x55d8f8(0x198));console[_0x55d8f8(0x21e)](a41_0x3995d9[_0x55d8f8(0x220)](_0x55d8f8(0x201)));_0x494ae2['length']>0x0&&!_0x52386b[_0x55d8f8(0x1ce)]&&console[_0x55d8f8(0x21e)](_0x55d8f8(0x1b8)+_0x494ae2[_0x55d8f8(0x1b6)](',\x20'));_0x46a494['length']>0x0&&console[_0x55d8f8(0x21e)](_0x55d8f8(0x20f)+_0x46a494[_0x55d8f8(0x1b6)](',\x20'));_0x2ce4a8[_0x55d8f8(0x1d0)]>0x0&&!_0x52386b[_0x55d8f8(0x1ce)]&&console[_0x55d8f8(0x21e)]('\x20\x20Activations:\x20'+_0x2ce4a8[_0x55d8f8(0x1b6)](',\x20'));if(_0x2531cd){const _0x851fba=getConsoleNextUrl(_0x52386b[_0x55d8f8(0x1e2)],_0x55d8f8(0x1e9)+_0x5cf378+_0x55d8f8(0x214)+_0x2531cd+_0x55d8f8(0x224));console['error'](_0x55d8f8(0x203)+a41_0x3995d9['cyan'](_0x851fba));}return 0x0;}}
1
+ const a41_0x33b8d2=a41_0x9cc3;(function(_0x4ecd3b,_0x5b0015){const _0x2bb8e0=a41_0x9cc3,_0x177fdf=_0x4ecd3b();while(!![]){try{const _0x5906a3=-parseInt(_0x2bb8e0(0xd5))/0x1*(-parseInt(_0x2bb8e0(0x149))/0x2)+parseInt(_0x2bb8e0(0x117))/0x3*(parseInt(_0x2bb8e0(0x10a))/0x4)+-parseInt(_0x2bb8e0(0xf5))/0x5+parseInt(_0x2bb8e0(0xe9))/0x6*(parseInt(_0x2bb8e0(0x10b))/0x7)+-parseInt(_0x2bb8e0(0x106))/0x8+parseInt(_0x2bb8e0(0x156))/0x9+-parseInt(_0x2bb8e0(0x122))/0xa*(-parseInt(_0x2bb8e0(0x130))/0xb);if(_0x5906a3===_0x5b0015)break;else _0x177fdf['push'](_0x177fdf['shift']());}catch(_0x594d89){_0x177fdf['push'](_0x177fdf['shift']());}}}(a41_0x23dc,0x85f2f));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_0x3f5bdb from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a41_0x23dc(){const _0x2af5a6=['new','Error\x20parsing\x20YAML:\x20','folderId','parent_name','parentFolder','\x20created','31wqetFz','get','state','\x20\x20Segments:\x20','journey','createdSegmentIds','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','green','listFolders','paused','Error:\x20','add','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20\x20Activations:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','segmentFolderId','data','listSegments','results','segments','66weqdZb','\x20\x20📊\x20Segments:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20updated','Preparing\x20journeys...','journeys','map','Resolving\x20parent\x20segment\x20\x27','yes','\x0aPush\x20summary\x20for\x20\x27','message','changed','2423290DCKhOH','connection','\x20to\x20create','\x20\x20Activations:\x20','\x20changes?','isScoped','Delete\x20segment:','journeyId','updatedAt','yellow','file','/j/da/je','\x20\x20🗺️\x20\x20Journeys:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20unchanged','/sb/da/esr','created','7158672XyTWEX','name','Aborted.','audienceId','1303172ubjYXL','170282MGkzHQ','toUpdate','verbose','journeyBundleName','\x20\x20\x20\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','join','No\x20','dim','site','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20to\x20delete','3qYceww','Fetching\x20existing\x20activations...','push','blue','\x20to\x20update','attributes','Error:\x20Directory\x20not\x20found:\x20','Changes\x20to\x20journey:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','repeat','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)','10dhGmoL','journeyBundleId','(Journey\x20will\x20be\x20deleted)','buildUserMaps','\x27...','Site:\x20','activations','\x20\x20Journeys:\x20','isNew','existingJourney','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','deleted','error','3528701TDfgkz','Changes\x20to:','Parent\x20segment:\x20','\x0a✔\x20Push\x20complete','toCreate','Push\x20','resolveParentId','delete','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','description','\x20activations]','helpText','\x20new','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','segment:push','Folders\x20to\x20create:','versionNumber','segment\x20or\x20journey','cyan','/e/','yamlConfig','.yml','list','red','10696CyBwho','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x0aError:','user','filePath','filter','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getParent','unchanged','\x0aValidation\x20failed:','\x20changed','getOutputSchemaWithCache','all','7633701RLmyLk','/app/ps/','targetDir','Fetching\x20connections\x20for\x20name\x20resolution...','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20Source:\x20','nameToId','execute','toDelete','segment','.yaml','New\x20segment:','type','journeysOnly','folderPath','\x20deleted','cwd','Scoped\x20to\x20folder:\x20','existingSegment','set','errorCode','parentName','diff','scopedFolderPath','no_parent','createdAt','updated'];a41_0x23dc=function(){return _0x2af5a6;};return a41_0x23dc();}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_0x9cc3(_0x50f73f,_0x143911){_0x50f73f=_0x50f73f-0xc8;const _0x23dc43=a41_0x23dc();let _0x9cc382=_0x23dc43[_0x50f73f];return _0x9cc382;}export class SegmentPushCommand extends BaseCommand{[a41_0x33b8d2(0x107)]=a41_0x33b8d2(0x13f);['description']=a41_0x33b8d2(0xe1);async[a41_0x33b8d2(0x15d)](_0x64dcbe){const _0x3dd05e=a41_0x33b8d2,{options:_0x1056ff,args:_0x14967e,tdx:_0x3fd66d}=_0x64dcbe,_0x3fd4c4=_0x1056ff,_0x8292f6=await resolveTarget({'arg':_0x14967e[0x0],'contextParent':_0x1056ff['parentSegment'],'cwd':process[_0x3dd05e(0x166)]()});if(!isSuccessfulResolution(_0x8292f6))return _0x8292f6[_0x3dd05e(0xc8)]===_0x3dd05e(0xcc)?(console['error'](a41_0x3f5bdb[_0x3dd05e(0xfe)](_0x3dd05e(0x11f))),console['error'](_0x3dd05e(0x121)),console['error'](_0x3dd05e(0x12d)),console[_0x3dd05e(0x12f)](_0x3dd05e(0x13e))):(console[_0x3dd05e(0x12f)](a41_0x3f5bdb['red'](_0x3dd05e(0xdf)+_0x8292f6[_0x3dd05e(0xf3)]+'\x0a')),_0x8292f6[_0x3dd05e(0x13b)]&&console[_0x3dd05e(0x12f)](a41_0x3f5bdb['cyan'](_0x8292f6[_0x3dd05e(0x13b)]))),0x1;if(_0x8292f6[_0x3dd05e(0x162)]===_0x3dd05e(0xd2))return console['error'](a41_0x3f5bdb[_0x3dd05e(0x148)]('Error:\x20Directory\x20not\x20found:\x20'+_0x8292f6[_0x3dd05e(0x158)]+'\x0a')),console['error'](a41_0x3f5bdb[_0x3dd05e(0x143)](_0x3dd05e(0x15a))),0x1;const _0x295d8b=_0x8292f6[_0x3dd05e(0xc9)],_0x5d1d93=_0x8292f6['targetDir'],_0x26f798=_0x8292f6['type']===_0x3dd05e(0xff)?_0x8292f6[_0x3dd05e(0x14d)]:undefined,_0x1f277f=getScopedDetails(_0x8292f6),_0x406bf6=_0x1f277f?.[_0x3dd05e(0xfa)]??![],_0x47e966=_0x1f277f?.[_0x3dd05e(0xcb)]??'';if(!existsSync(_0x5d1d93))return console['error'](a41_0x3f5bdb[_0x3dd05e(0x148)](_0x3dd05e(0x11d)+_0x5d1d93+'\x0a')),console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0x143)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3fd4c4[_0x3dd05e(0x10d)]&&(console[_0x3dd05e(0x12f)](_0x3dd05e(0x127)+_0x3fd4c4['site']),console[_0x3dd05e(0x12f)](_0x3dd05e(0x132)+_0x295d8b),console[_0x3dd05e(0x12f)]('Source\x20directory:\x20'+_0x5d1d93),_0x406bf6&&console['error'](_0x3dd05e(0x167)+_0x47e966));const _0x12e81a=await withSpinner(_0x3dd05e(0xf0)+_0x295d8b+_0x3dd05e(0x126),()=>_0x3fd66d[_0x3dd05e(0x15f)][_0x3dd05e(0x136)](_0x295d8b),{'verbose':_0x3fd4c4['verbose']}),_0x23a147=_0x12e81a[_0x3dd05e(0xe5)],{parentSegmentResult:_0x240577,segmentsResult:_0xeca106,foldersResult:_0x31790d,journeysWithDetailsResult:_0x159ee7,userMaps:_0x58a9f5}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x5dfc79=_0x3dd05e,[_0x28fbaf,_0x40372b,_0x34407b,_0x2a95f6,_0x39658f]=await Promise['all']([_0x3fd66d[_0x5dfc79(0x15f)][_0x5dfc79(0x150)](_0x23a147),_0x3fd66d[_0x5dfc79(0x15f)][_0x5dfc79(0xe6)](_0x23a147),_0x3fd66d[_0x5dfc79(0x15f)][_0x5dfc79(0xdd)](_0x23a147),_0x3fd66d['journey']['listJourneysWithDetailsFromParentSegment'](_0x23a147,{'includeAllVersions':!![]}),_0x3fd66d[_0x5dfc79(0x14c)][_0x5dfc79(0x125)]()]);return{'parentSegmentResult':_0x28fbaf,'segmentsResult':_0x40372b,'foldersResult':_0x34407b,'journeysWithDetailsResult':_0x2a95f6,'userMaps':_0x39658f};},{'verbose':_0x3fd4c4[_0x3dd05e(0x10d)]})['then'](_0x3d20dc=>_0x3d20dc[_0x3dd05e(0xe5)]),_0x27e126=_0x240577,_0x1a98b2=extractRootFolderId(_0x27e126),_0x52539e=_0xeca106,_0x42d039=_0x31790d,{journeys:_0x411491,activationStepsById:_0x5e0881}=_0x159ee7,_0x83f1a9=new Map(_0x411491[_0x3dd05e(0xef)](_0x1e9ab0=>[_0x1e9ab0['id'],_0x1e9ab0])),_0x12a4a9=_0x411491[_0x3dd05e(0xef)](_0x48e384=>({'id':_0x48e384['id'],'name':_0x48e384[_0x3dd05e(0x11c)][_0x3dd05e(0x107)],'journeyBundleName':_0x48e384['attributes'][_0x3dd05e(0x10e)]||'','journeyBundleId':_0x48e384[_0x3dd05e(0x11c)][_0x3dd05e(0x123)]||'','versionNumber':_0x48e384[_0x3dd05e(0x11c)][_0x3dd05e(0x141)],'description':_0x48e384[_0x3dd05e(0x11c)][_0x3dd05e(0x139)],'state':_0x48e384['attributes'][_0x3dd05e(0xd7)],'paused':_0x48e384[_0x3dd05e(0x11c)][_0x3dd05e(0xde)],'audienceId':_0x48e384[_0x3dd05e(0x11c)][_0x3dd05e(0x109)],'folderId':_0x48e384['relationships']?.[_0x3dd05e(0xd3)]?.[_0x3dd05e(0xe5)]?.['id'],'createdAt':_0x48e384[_0x3dd05e(0x11c)][_0x3dd05e(0xcd)],'updatedAt':_0x48e384['attributes'][_0x3dd05e(0xfd)]})),{emailToId:_0x1b9ea0,idToEmail:_0x5e9a46}=_0x58a9f5,_0x5e0d69=await withSpinner(_0x3dd05e(0x159),async()=>{const _0x3b888c=_0x3dd05e,_0x3b4c01=await _0x3fd66d['connection'][_0x3b888c(0x147)]();return buildConnectionMaps(_0x3b4c01);},{'verbose':_0x3fd4c4[_0x3dd05e(0x10d)]})['then'](_0x58198b=>_0x58198b['data']),_0x2ae614=_0x5e0d69['nameToId'],_0x51e235=_0x5e0d69['idToName'],_0x5f3981=_0x5e0d69['nameToType'],_0x15e82b={'emailToIdMap':_0x1b9ea0,'connectionNameToIdMap':_0x2ae614,'connectionNameToTypeMap':_0x5f3981,'getSchema':_0x50cc5b=>_0x3fd66d[_0x3dd05e(0xf6)][_0x3dd05e(0x154)](_0x50cc5b)};let {pathToId:_0x39ff4a,idToPath:_0x28e362}=buildFolderMaps(_0x42d039);const _0x864539=buildSegmentLookupMap(_0x52539e,_0x28e362),_0x3cb2c9=buildSegmentNameToIdMap(_0x52539e),_0x528f6d=buildJourneyBundleLookupMap(_0x12a4a9,_0x28e362);let _0x5be19d;if(_0x26f798){if(!_0x26f798['endsWith'](_0x3dd05e(0x146))&&!_0x26f798['endsWith'](_0x3dd05e(0x160)))return console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0x148)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x26f798+'\x0a')),0x1;_0x5be19d=[_0x26f798];}else _0x5be19d=findYamlFiles(_0x5d1d93);if(_0x5be19d[_0x3dd05e(0x13d)]===0x0)return console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0x148)](_0x3dd05e(0x14a)+_0x5d1d93+'\x0a')),console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0x143)](_0x3dd05e(0x115))),0x1;let _0x203e43,_0x243738;try{const _0x48a148=parseAndClassifyYamlFiles(_0x5be19d,_0x5d1d93,{'skipSegments':_0x3fd4c4['journeysOnly']});_0x203e43=_0x48a148[_0x3dd05e(0xe8)],_0x243738=_0x48a148['journeys'];const _0x6dfdb7=validateParsedFiles(_0x48a148,_0x5d1d93);if(_0x6dfdb7[_0x3dd05e(0x13d)]>0x0)return console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0x148)](_0x3dd05e(0x152))),console[_0x3dd05e(0x12f)](formatValidationErrors(_0x6dfdb7)),console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0xfe)](_0x3dd05e(0xe3))),0x1;}catch(_0x542027){return console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0x148)](_0x3dd05e(0xd0)+(_0x542027 instanceof Error?_0x542027['message']:_0x542027))),0x1;}if(_0x203e43[_0x3dd05e(0x13d)]===0x0&&_0x243738[_0x3dd05e(0x13d)]===0x0){const _0x3a076f=_0x3fd4c4[_0x3dd05e(0x163)]?'journey':_0x3dd05e(0x142);return console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0xfe)](_0x3dd05e(0x112)+_0x3a076f+'\x20YAML\x20files\x20found')),0x0;}const _0x153bae=new Map();_0x52539e[_0x3dd05e(0x13d)]>0x0&&!_0x3fd4c4['journeysOnly']&&await withSpinner(_0x3dd05e(0x118),async()=>{await batchAsync(_0x52539e,async _0xca11bf=>{const _0x21e1df=a41_0x9cc3,_0x43551d=await _0x3fd66d[_0x21e1df(0x15f)]['listActivations'](_0x23a147,_0xca11bf['id']);_0x153bae[_0x21e1df(0x169)](_0xca11bf['id'],_0x43551d);});},{'verbose':_0x3fd4c4[_0x3dd05e(0x10d)]});const {segmentFiles:_0x3e1a6b,foldersToCreate:_0x686fd8}=await prepareSegmentFiles(_0x203e43,{'segmentByFolderAndName':_0x864539,'activationsBySegmentId':_0x153bae,'folderPathToId':_0x39ff4a,'idToEmailMap':_0x5e9a46,'connectionIdToNameMap':_0x51e235},_0x15e82b,_0x406bf6,_0x47e966),_0x5c60a0=_0x26f798?[]:findSegmentsToDelete(_0x52539e,_0x203e43[_0x3dd05e(0xef)](({yamlConfig:_0x8f843,folderPath:_0x5243bf})=>({'yamlConfig':_0x8f843,'folderPath':resolveTDFolderPath(_0x5243bf,_0x406bf6,_0x47e966)})),_0x28e362,_0x47e966,_0x406bf6),{journeyFiles:_0x550247,foldersToCreate:_0x22a2ef}=await withProgressSpinner(_0x3dd05e(0xed),async _0x69697e=>prepareJourneyFiles(_0x243738,{'fetchJourney':async _0x14fdf8=>_0x3fd66d[_0x3dd05e(0xd9)]['getJourney'](_0x14fdf8[_0x3dd05e(0xfc)]),'journeyBundlesByFolderAndName':_0x528f6d,'folderPathToId':_0x39ff4a,'idToEmailMap':_0x5e9a46,'connectionIdToNameMap':_0x51e235,'existingSegments':_0x52539e,'parentId':_0x23a147,'deps':_0x3fd66d,'progress':{'update':_0x277ec7=>{_0x69697e['setPhase'](_0x277ec7),_0x3fd4c4['verbose']&&console['error']('\x20\x20'+_0x277ec7);}},'journeyById':_0x83f1a9,'activationStepsById':_0x5e0881},_0x406bf6,_0x47e966),{'verbose':_0x3fd4c4[_0x3dd05e(0x10d)]})['then'](_0x273553=>_0x273553[_0x3dd05e(0xe5)]);for(const _0xbd51a2 of _0x22a2ef){_0x686fd8[_0x3dd05e(0xe0)](_0xbd51a2);}const _0x14878b=_0x26f798?[]:findJourneysToDelete(_0x12a4a9,_0x243738[_0x3dd05e(0xef)](({yamlConfig:_0x1a4c20,folderPath:_0xc6317c})=>({'yamlConfig':_0x1a4c20,'folderPath':resolveTDFolderPath(_0xc6317c,_0x406bf6,_0x47e966)})),_0x28e362,_0x47e966,_0x406bf6),_0x13341d=calculatePushStats(_0x3e1a6b,_0x550247,_0x686fd8,_0x5c60a0,_0x14878b,!!_0x3fd4c4[_0x3dd05e(0x137)],!!_0x3fd4c4[_0x3dd05e(0x163)]),_0x2e28dd=_0x13341d[_0x3dd05e(0xe8)][_0x3dd05e(0xcf)],_0x465d89=_0x13341d[_0x3dd05e(0xe8)][_0x3dd05e(0xf4)],_0x285e03=_0x13341d[_0x3dd05e(0xe8)][_0x3dd05e(0x151)],_0x120a3d=_0x13341d[_0x3dd05e(0xe8)]['toDelete'],_0x33c6e5=_0x13341d['folders'][_0x3dd05e(0x134)],_0x5bae6d=_0x13341d['journeys'][_0x3dd05e(0xcf)],_0x6320c=_0x13341d[_0x3dd05e(0xee)][_0x3dd05e(0xf4)],_0x5a0998=_0x13341d['journeys'][_0x3dd05e(0x151)],_0x254771=_0x13341d['journeys']['toDelete'],_0x545001=_0x13341d[_0x3dd05e(0x128)][_0x3dd05e(0x155)],_0x4cae5f=_0x13341d[_0x3dd05e(0x128)][_0x3dd05e(0x134)],_0x25e4e3=_0x13341d[_0x3dd05e(0x128)][_0x3dd05e(0x10c)],_0xb83f75=_0x13341d['activations'][_0x3dd05e(0x15e)];console['error'](_0x3dd05e(0xf2)+_0x295d8b+'\x27:');_0x33c6e5[_0x3dd05e(0x13d)]>0x0&&console['error']('\x20\x20'+a41_0x3f5bdb[_0x3dd05e(0x11a)]('📁\x20'+_0x33c6e5[_0x3dd05e(0x13d)]+'\x20folders\x20to\x20create'));if(!_0x3fd4c4['journeysOnly']){console[_0x3dd05e(0x12f)](_0x3dd05e(0xea)),console['error'](_0x3dd05e(0x10f)+a41_0x3f5bdb['green']('+\x20'+_0x2e28dd[_0x3dd05e(0x13d)]+'\x20new')),console[_0x3dd05e(0x12f)]('\x20\x20\x20\x20'+a41_0x3f5bdb[_0x3dd05e(0xfe)]('~\x20'+_0x465d89[_0x3dd05e(0x13d)]+_0x3dd05e(0x153)));if(_0x120a3d[_0x3dd05e(0x13d)]>0x0)console['error'](_0x3dd05e(0x10f)+a41_0x3f5bdb[_0x3dd05e(0x148)]('-\x20'+_0x120a3d[_0x3dd05e(0x13d)]+_0x3dd05e(0x116)));else _0x5c60a0[_0x3dd05e(0x13d)]>0x0&&!_0x3fd4c4[_0x3dd05e(0x137)]&&console['error'](_0x3dd05e(0x10f)+a41_0x3f5bdb['dim'](_0x5c60a0[_0x3dd05e(0x13d)]+_0x3dd05e(0xdb)));console['error']('\x20\x20\x20\x20'+a41_0x3f5bdb[_0x3dd05e(0x113)]('=\x20'+_0x285e03[_0x3dd05e(0x13d)]+_0x3dd05e(0x103)));}if(_0x550247[_0x3dd05e(0x13d)]>0x0||_0x14878b[_0x3dd05e(0x13d)]>0x0){console[_0x3dd05e(0x12f)](_0x3dd05e(0x101)),console['error'](_0x3dd05e(0x10f)+a41_0x3f5bdb[_0x3dd05e(0xdc)]('+\x20'+_0x5bae6d['length']+_0x3dd05e(0x13c))),console['error'](_0x3dd05e(0x10f)+a41_0x3f5bdb[_0x3dd05e(0xfe)]('~\x20'+_0x6320c[_0x3dd05e(0x13d)]+_0x3dd05e(0x153)));if(_0x254771[_0x3dd05e(0x13d)]>0x0)console[_0x3dd05e(0x12f)](_0x3dd05e(0x10f)+a41_0x3f5bdb['red']('-\x20'+_0x254771['length']+_0x3dd05e(0x116)));else _0x14878b['length']>0x0&&!_0x3fd4c4[_0x3dd05e(0x137)]&&console[_0x3dd05e(0x12f)](_0x3dd05e(0x10f)+a41_0x3f5bdb[_0x3dd05e(0x113)](_0x14878b['length']+_0x3dd05e(0xdb)));console[_0x3dd05e(0x12f)](_0x3dd05e(0x10f)+a41_0x3f5bdb['dim']('=\x20'+_0x5a0998[_0x3dd05e(0x13d)]+'\x20unchanged'));}_0x545001['length']>0x0&&!_0x3fd4c4['journeysOnly']&&(console['error'](''),console[_0x3dd05e(0x12f)](_0x3dd05e(0xe2)),_0x4cae5f[_0x3dd05e(0x13d)]>0x0&&console[_0x3dd05e(0x12f)](_0x3dd05e(0x10f)+a41_0x3f5bdb[_0x3dd05e(0xdc)]('+\x20'+_0x4cae5f[_0x3dd05e(0x13d)]+_0x3dd05e(0xf7))),_0x25e4e3[_0x3dd05e(0x13d)]>0x0&&console[_0x3dd05e(0x12f)](_0x3dd05e(0x10f)+a41_0x3f5bdb[_0x3dd05e(0xfe)]('~\x20'+_0x25e4e3[_0x3dd05e(0x13d)]+_0x3dd05e(0x11b))),_0xb83f75[_0x3dd05e(0x13d)]>0x0&&console['error'](_0x3dd05e(0x10f)+a41_0x3f5bdb[_0x3dd05e(0x148)]('-\x20'+_0xb83f75[_0x3dd05e(0x13d)]+_0x3dd05e(0x116))));console[_0x3dd05e(0x12f)](_0x3dd05e(0x15b)+a41_0x3f5bdb[_0x3dd05e(0x143)](_0x5d1d93)+'\x0a');if(_0x33c6e5[_0x3dd05e(0x13d)]>0x0){console[_0x3dd05e(0x12f)](_0x3dd05e(0x140));for(const _0x1d29ab of _0x33c6e5){console[_0x3dd05e(0x12f)]('\x20\x20'+a41_0x3f5bdb[_0x3dd05e(0x11a)]('+')+'\x20'+_0x1d29ab);}console['error']('');}if(_0x2e28dd['length']>0x0&&!_0x3fd4c4['journeysOnly'])for(const _0x3a28a9 of _0x2e28dd){const _0x3371c4=_0x3a28a9[_0x3dd05e(0x164)]?_0x3a28a9['folderPath']+'/'+_0x3a28a9[_0x3dd05e(0x145)]['name']:_0x3a28a9['yamlConfig'][_0x3dd05e(0x107)],_0x2ee909=_0x3a28a9[_0x3dd05e(0x145)][_0x3dd05e(0x128)]?.[_0x3dd05e(0x13d)]||0x0,_0x39297a=_0x2ee909>0x0?a41_0x3f5bdb['dim']('\x20['+_0x2ee909+'\x20activations]'):'';console['error']('\x0a'+a41_0x3f5bdb[_0x3dd05e(0xdc)](_0x3dd05e(0x161))+'\x20'+_0x3371c4+_0x39297a),console[_0x3dd05e(0x12f)]('─'[_0x3dd05e(0x120)](0x3c)),_0x3a28a9[_0x3dd05e(0xca)]&&console[_0x3dd05e(0x12f)](_0x3a28a9['diff']),console[_0x3dd05e(0x12f)]('─'['repeat'](0x3c));}if(_0x120a3d[_0x3dd05e(0x13d)]>0x0&&!_0x3fd4c4[_0x3dd05e(0x163)])for(const _0x5caddc of _0x120a3d){const _0x47f4e9=_0x5caddc['segmentFolderId']?_0x28e362[_0x3dd05e(0xd6)](_0x5caddc[_0x3dd05e(0xe4)]['toString']())||'':'',_0x1f22c2=_0x47f4e9?_0x47f4e9+'/'+_0x5caddc['name']:_0x5caddc[_0x3dd05e(0x107)],_0x5d1f13=_0x153bae[_0x3dd05e(0xd6)](_0x5caddc['id'])||[],_0x3a22ea=_0x5d1f13[_0x3dd05e(0x13d)]>0x0?a41_0x3f5bdb[_0x3dd05e(0x113)]('\x20['+_0x5d1f13[_0x3dd05e(0x13d)]+_0x3dd05e(0x13a)):'';console['error']('\x0a'+a41_0x3f5bdb['red'](_0x3dd05e(0xfb))+'\x20'+_0x1f22c2+_0x3a22ea),console[_0x3dd05e(0x12f)]('─'['repeat'](0x3c));const _0x3e059e=segmentWithActivationsToYaml(_0x5caddc,_0x5d1f13,undefined,_0x5e9a46,_0x51e235),_0x5c766=segmentToYamlString(_0x3e059e),_0xc449a0=generateDiff(_0x5c766,'');console[_0x3dd05e(0x12f)](formatDiffWithColors(_0xc449a0)),console['error']('─'[_0x3dd05e(0x120)](0x3c));}const _0x216d3d=_0x3e1a6b[_0x3dd05e(0x14e)](_0x28d162=>!_0x28d162['isNew']&&_0x28d162[_0x3dd05e(0xca)]);if(_0x216d3d[_0x3dd05e(0x13d)]>0x0&&!_0x3fd4c4[_0x3dd05e(0x163)])for(const _0x363728 of _0x216d3d){const _0x45f5c8=_0x363728[_0x3dd05e(0x164)]?_0x363728[_0x3dd05e(0x164)]+'/'+_0x363728[_0x3dd05e(0x145)][_0x3dd05e(0x107)]:_0x363728['yamlConfig'][_0x3dd05e(0x107)];console[_0x3dd05e(0x12f)]('\x0a'+a41_0x3f5bdb[_0x3dd05e(0xfe)](_0x3dd05e(0x131))+'\x20'+_0x45f5c8),console[_0x3dd05e(0x12f)]('─'['repeat'](0x3c)),console[_0x3dd05e(0x12f)](_0x363728[_0x3dd05e(0xca)]),console[_0x3dd05e(0x12f)]('─'[_0x3dd05e(0x120)](0x3c));}if(_0x5bae6d[_0x3dd05e(0x13d)]>0x0)for(const _0x470898 of _0x5bae6d){const _0x56444a=_0x470898[_0x3dd05e(0x164)]?_0x470898[_0x3dd05e(0x164)]+'/'+_0x470898[_0x3dd05e(0x145)]['name']:_0x470898[_0x3dd05e(0x145)][_0x3dd05e(0x107)];console[_0x3dd05e(0x12f)]('\x0a'+a41_0x3f5bdb['green']('New\x20journey:')+'\x20'+_0x56444a),console['error']('─'[_0x3dd05e(0x120)](0x3c)),_0x470898[_0x3dd05e(0xca)]&&console[_0x3dd05e(0x12f)](_0x470898[_0x3dd05e(0xca)]),console['error']('─'[_0x3dd05e(0x120)](0x3c));}const _0x3192fd=_0x550247[_0x3dd05e(0x14e)](_0x15d139=>!_0x15d139[_0x3dd05e(0x12a)]&&_0x15d139[_0x3dd05e(0xca)]);if(_0x3192fd['length']>0x0)for(const _0x5cd114 of _0x3192fd){const _0x491b98=_0x5cd114[_0x3dd05e(0x164)]?_0x5cd114[_0x3dd05e(0x164)]+'/'+_0x5cd114[_0x3dd05e(0x145)]['name']:_0x5cd114[_0x3dd05e(0x145)][_0x3dd05e(0x107)];console[_0x3dd05e(0x12f)]('\x0a'+a41_0x3f5bdb[_0x3dd05e(0xfe)](_0x3dd05e(0x11e))+'\x20'+_0x491b98),console[_0x3dd05e(0x12f)]('─'['repeat'](0x3c)),console[_0x3dd05e(0x12f)](_0x5cd114['diff']),console[_0x3dd05e(0x12f)]('─'['repeat'](0x3c));}if(_0x254771[_0x3dd05e(0x13d)]>0x0)for(const _0xae00e of _0x254771){const _0x1912bc=_0xae00e[_0x3dd05e(0xd1)]?_0x28e362['get'](_0xae00e['folderId'])||'':'',_0x5879c9=_0x1912bc?_0x1912bc+'/'+_0xae00e[_0x3dd05e(0x10e)]:_0xae00e[_0x3dd05e(0x10e)];console[_0x3dd05e(0x12f)]('\x0a'+a41_0x3f5bdb['red']('Delete\x20journey:')+'\x20'+_0x5879c9),console['error']('─'[_0x3dd05e(0x120)](0x3c)),console['error'](a41_0x3f5bdb[_0x3dd05e(0x148)](_0x3dd05e(0x124))),console[_0x3dd05e(0x12f)]('─'['repeat'](0x3c));}if(_0x3fd4c4[_0x3dd05e(0x12c)])return console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0xfe)](_0x3dd05e(0xeb))),0x0;const _0x25c5c7=_0x3fd4c4[_0x3dd05e(0x163)]?![]:_0x2e28dd['length']>0x0||_0x465d89[_0x3dd05e(0x13d)]>0x0||_0x120a3d[_0x3dd05e(0x13d)]>0x0,_0x1ca587=_0x5bae6d[_0x3dd05e(0x13d)]>0x0||_0x6320c[_0x3dd05e(0x13d)]>0x0||_0x254771[_0x3dd05e(0x13d)]>0x0,_0x54766f=_0x3fd4c4[_0x3dd05e(0x163)]?![]:_0x545001['length']>0x0,_0x290862=_0x33c6e5[_0x3dd05e(0x13d)]>0x0;if(!_0x25c5c7&&!_0x1ca587&&!_0x54766f&&!_0x290862){const _0x5147d4=_0x3fd4c4[_0x3dd05e(0x163)]?_0x3dd05e(0x138):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0xdc)](_0x5147d4));if(_0x26f798&&_0x285e03['length']===0x1){const _0x7be35f=_0x285e03[0x0];if(_0x7be35f[_0x3dd05e(0x168)]?.['id']){const _0x102c7=getConsoleNextUrl(_0x3fd4c4[_0x3dd05e(0x114)],_0x3dd05e(0x157)+_0x23a147+_0x3dd05e(0x144)+_0x7be35f['existingSegment']['id']+_0x3dd05e(0x104));console[_0x3dd05e(0x12f)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x3f5bdb['cyan'](_0x102c7));}}if(_0x26f798&&_0x5a0998[_0x3dd05e(0x13d)]===0x1){const _0x2d471d=_0x5a0998[0x0];if(_0x2d471d[_0x3dd05e(0x12b)]?.['id']){const _0x2e24b3=getConsoleNextUrl(_0x3fd4c4[_0x3dd05e(0x114)],_0x3dd05e(0x157)+_0x23a147+'/e/'+_0x2d471d['existingJourney']['id']+_0x3dd05e(0x100));console['error']('\x20\x20'+a41_0x3f5bdb[_0x3dd05e(0x143)](_0x2e24b3));}}return 0x0;}const _0x52ced3=_0x3fd4c4[_0x3dd05e(0x163)]?_0x5bae6d[_0x3dd05e(0x13d)]+_0x6320c[_0x3dd05e(0x13d)]+_0x254771[_0x3dd05e(0x13d)]+_0x33c6e5[_0x3dd05e(0x13d)]:_0x2e28dd['length']+_0x465d89[_0x3dd05e(0x13d)]+_0x120a3d[_0x3dd05e(0x13d)]+_0x5bae6d[_0x3dd05e(0x13d)]+_0x6320c[_0x3dd05e(0x13d)]+_0x254771[_0x3dd05e(0x13d)]+_0x33c6e5[_0x3dd05e(0x13d)]+_0x545001[_0x3dd05e(0x13d)];if(!_0x3fd4c4[_0x3dd05e(0xf1)]&&_0x52ced3>0x0){if(!isInteractive())return console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0x148)](_0x3dd05e(0x14b)),_0x3dd05e(0x110)),console[_0x3dd05e(0x12f)](a41_0x3f5bdb['dim'](_0x3dd05e(0x14f))),0x1;const _0x35a083=await confirmKey(_0x3dd05e(0x135)+_0x52ced3+_0x3dd05e(0xf9));if(!_0x35a083)return console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0xfe)](_0x3dd05e(0x108))),0x1;}const _0x3d80e1={'withProgress':async(_0x381928,_0x26fbed)=>{const _0x525e73=_0x3dd05e,_0x231f27=await withSpinner(_0x381928,_0x26fbed,{'verbose':_0x3fd4c4['verbose']});return{'data':_0x231f27[_0x525e73(0xe5)]};},'logInfo':_0x1b6fda=>console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0x11a)]('✔\x20'+_0x1b6fda)),'logSuccess':_0x1c299f=>console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0xdc)]('✔\x20'+_0x1c299f)),'logWarning':_0x1179a8=>console[_0x3dd05e(0x12f)](a41_0x3f5bdb['yellow']('⚠\x20'+_0x1179a8)),'logDeleted':_0x411e28=>console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0x148)]('✔\x20'+_0x411e28))},_0x2c5267={'segment':_0x3fd66d['segment'],'journey':_0x3fd66d[_0x3dd05e(0xd9)],'user':_0x3fd66d[_0x3dd05e(0x14c)],'connection':_0x3fd66d[_0x3dd05e(0xf6)]};_0x33c6e5[_0x3dd05e(0x13d)]>0x0&&(_0x39ff4a=await executePushFolders(_0x2c5267,_0x33c6e5,_0x39ff4a,{'parentId':_0x23a147},_0x3d80e1));const _0x2f751b={'rootFolderId':_0x1a98b2,'folderPathToId':_0x39ff4a,'folderIdToPath':_0x28e362,'segmentNameToId':_0x3cb2c9,'activationsBySegmentId':_0x153bae,'emailToIdMap':_0x1b9ea0,'idToEmailMap':_0x5e9a46,'connectionNameToIdMap':_0x5e0d69[_0x3dd05e(0x15c)],'connectionIdToNameMap':_0x5e0d69['idToName'],'connectionNameToTypeMap':_0x5f3981},_0x6a4741=await executePushSegments(_0x2c5267,_0x3fd4c4[_0x3dd05e(0x163)]?[]:_0x3e1a6b,_0x2f751b,{'parentId':_0x23a147},_0x3d80e1),_0x4a16d1=_0x6a4741[_0x3dd05e(0x105)],_0x30bf63=_0x6a4741[_0x3dd05e(0xce)],_0x3bac17=_0x6a4741[_0x3dd05e(0x128)][_0x3dd05e(0x105)],_0x492762=_0x6a4741[_0x3dd05e(0x128)][_0x3dd05e(0xce)],_0x31c553=_0x6a4741['activations'][_0x3dd05e(0x12e)];let _0x2157f3;if(_0x26f798&&_0x3e1a6b['length']===0x1){const _0x5d8621=_0x3e1a6b[0x0];_0x2157f3=_0x5d8621[_0x3dd05e(0x168)]?.['id']??_0x6a4741[_0x3dd05e(0xda)]['get'](_0x5d8621[_0x3dd05e(0x145)][_0x3dd05e(0x107)]);}const _0x364b2b=await executePushSegmentDeletions(_0x2c5267,_0x3fd4c4[_0x3dd05e(0x163)]?[]:_0x120a3d,_0x3d80e1);let _0x5d1bba=0x0,_0x52053d=0x0,_0x138594=0x0;const _0x479b0b=new Map(_0x3cb2c9);for(const [_0x6a5aff,_0x30b1f7]of _0x6a4741['createdSegmentIds']){_0x479b0b[_0x3dd05e(0x169)](_0x6a5aff,_0x30b1f7);}if(_0x550247['length']>0x0){const _0x21c6e2={..._0x2f751b,'segmentNameToId':_0x479b0b,'existingSegments':_0x52539e,'activationContext':_0x15e82b},_0x1dacc5=await executePushJourneys(_0x2c5267,_0x550247,_0x21c6e2,{'parentId':_0x23a147,'rootFolderId':_0x1a98b2,'verbose':_0x3fd4c4['verbose']},_0x3d80e1);_0x5d1bba=_0x1dacc5[_0x3dd05e(0x105)],_0x52053d=_0x1dacc5['updated'];if(_0x26f798&&_0x1dacc5[_0x3dd05e(0xe7)][_0x3dd05e(0x13d)]===0x1){const _0x3a4fc5=_0x1dacc5[_0x3dd05e(0xe7)][0x0];if(_0x3a4fc5['journeyId']){const _0x200f65=getConsoleNextUrl(_0x3fd4c4[_0x3dd05e(0x114)],'/app/ps/'+_0x23a147+'/e/'+_0x3a4fc5[_0x3dd05e(0xfc)]+_0x3dd05e(0x100));console[_0x3dd05e(0x12f)]('\x20\x20'+a41_0x3f5bdb[_0x3dd05e(0x143)](_0x200f65));}}}for(const _0xb244eb of _0x254771){console['error'](a41_0x3f5bdb[_0x3dd05e(0xfe)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0xb244eb[_0x3dd05e(0x10e)])),_0x138594++;}const _0x4fad23=[];if(_0x4a16d1>0x0)_0x4fad23[_0x3dd05e(0x119)](_0x4a16d1+_0x3dd05e(0xd4));if(_0x30bf63>0x0)_0x4fad23[_0x3dd05e(0x119)](_0x30bf63+'\x20updated');if(_0x364b2b>0x0)_0x4fad23['push'](_0x364b2b+_0x3dd05e(0x165));const _0x25d4c3=[];if(_0x5d1bba>0x0)_0x25d4c3['push'](_0x5d1bba+'\x20created');if(_0x52053d>0x0)_0x25d4c3['push'](_0x52053d+_0x3dd05e(0xec));if(_0x138594>0x0)_0x25d4c3[_0x3dd05e(0x119)](_0x138594+_0x3dd05e(0x165));const _0x28fa1e=[];if(_0x3bac17>0x0)_0x28fa1e[_0x3dd05e(0x119)](_0x3bac17+_0x3dd05e(0xd4));if(_0x492762>0x0)_0x28fa1e['push'](_0x492762+'\x20updated');if(_0x31c553>0x0)_0x28fa1e['push'](_0x31c553+'\x20deleted');console[_0x3dd05e(0x12f)](a41_0x3f5bdb[_0x3dd05e(0xdc)](_0x3dd05e(0x133)));_0x4fad23['length']>0x0&&!_0x3fd4c4[_0x3dd05e(0x163)]&&console[_0x3dd05e(0x12f)](_0x3dd05e(0xd8)+_0x4fad23[_0x3dd05e(0x111)](',\x20'));_0x25d4c3[_0x3dd05e(0x13d)]>0x0&&console[_0x3dd05e(0x12f)](_0x3dd05e(0x129)+_0x25d4c3[_0x3dd05e(0x111)](',\x20'));_0x28fa1e[_0x3dd05e(0x13d)]>0x0&&!_0x3fd4c4[_0x3dd05e(0x163)]&&console[_0x3dd05e(0x12f)](_0x3dd05e(0xf8)+_0x28fa1e[_0x3dd05e(0x111)](',\x20'));if(_0x2157f3){const _0xcce24c=getConsoleNextUrl(_0x3fd4c4['site'],'/app/ps/'+_0x23a147+_0x3dd05e(0x144)+_0x2157f3+_0x3dd05e(0x104));console[_0x3dd05e(0x12f)](_0x3dd05e(0x102)+a41_0x3f5bdb[_0x3dd05e(0x143)](_0xcce24c));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x7abfbd=a42_0xd831;function a42_0x14ac(){const _0x7c902=['rule','12GFIacG','674359ufuNov','updateSegmentById','length','531SfmTsb','59399SVeuHQ','segmentId','segmentPath','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','verbose','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Segment\x20ID:\x20','parentId','name','error','449232pkucqW','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','includes','10mCIdbK','segment','resolveFolderId','segment:update','\x20\x20\x20Path:\x20','folder','\x27...','690385zEHcZW','data','Resolving\x20folder\x20\x27','4nVMTeE','type','✔\x20Updated\x20segment\x20\x27','118811yXwmjz','INTERNAL','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Updating\x20segment\x20\x27','Update\x20existing\x20child\x20segment','execute','Segment\x20ID\x20missing\x20from\x20resolved\x20path','1984fWgmor','description','154004JwVdWl','Error:\x20Cannot\x20update\x20','yellow','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','ruleFile','Resolved\x20folder\x20ID:\x20'];a42_0x14ac=function(){return _0x7c902;};return a42_0x14ac();}(function(_0x18b560,_0x33828c){const _0x277047=a42_0xd831,_0xfcd896=_0x18b560();while(!![]){try{const _0x6ca63=-parseInt(_0x277047(0x75))/0x1*(parseInt(_0x277047(0x8c))/0x2)+parseInt(_0x277047(0x7f))/0x3+parseInt(_0x277047(0x99))/0x4+-parseInt(_0x277047(0x89))/0x5+parseInt(_0x277047(0xa1))/0x6*(parseInt(_0x277047(0xa2))/0x7)+parseInt(_0x277047(0x97))/0x8*(-parseInt(_0x277047(0x74))/0x9)+-parseInt(_0x277047(0x82))/0xa*(-parseInt(_0x277047(0x8f))/0xb);if(_0x6ca63===_0x33828c)break;else _0xfcd896['push'](_0xfcd896['shift']());}catch(_0x36a7af){_0xfcd896['push'](_0xfcd896['shift']());}}}(a42_0x14ac,0x1d595));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a42_0xd831(_0x38e1e5,_0x2333a6){_0x38e1e5=_0x38e1e5-0x73;const _0x14acfb=a42_0x14ac();let _0xd83138=_0x14acfb[_0x38e1e5];return _0xd83138;}import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x47276b from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x7abfbd(0x7d)]=a42_0x7abfbd(0x85);[a42_0x7abfbd(0x98)]=a42_0x7abfbd(0x94);async[a42_0x7abfbd(0x95)](_0x40f2c3){const _0x3cde38=a42_0x7abfbd;console['error'](a42_0x47276b['yellow'](_0x3cde38(0x78))),console[_0x3cde38(0x7e)](a42_0x47276b[_0x3cde38(0x9b)](_0x3cde38(0x92)));const {options:_0x4218be,args:_0x3f1de7,tdx:_0x1db81d}=_0x40f2c3,_0x547099=_0x4218be;if(_0x3f1de7[_0x3cde38(0x73)]===0x0)return console[_0x3cde38(0x7e)](_0x3cde38(0x80)),console['error']('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x3cde38(0x7e)]('Examples:'),console[_0x3cde38(0x7e)](_0x3cde38(0x7a)),console[_0x3cde38(0x7e)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1f8f41=_0x3f1de7[0x0],_0xe36c60=_0x4218be[_0x3cde38(0x77)];let _0x3a8e1b=_0x1f8f41;_0xe36c60&&!_0x1f8f41[_0x3cde38(0x81)]('/')&&(_0x3a8e1b=_0xe36c60+'/'+_0x1f8f41,_0x547099['verbose']&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x3a8e1b));const _0x4bc500=await withSpinner('Resolving\x20path\x20\x27'+_0x3a8e1b+_0x3cde38(0x88),()=>_0x1db81d['segment']['resolvePathToResource'](_0x3a8e1b),{'verbose':_0x547099[_0x3cde38(0x79)]}),_0x3a714f=_0x4bc500['data'];_0x547099[_0x3cde38(0x79)]&&console[_0x3cde38(0x7e)]('Resolved\x20type:\x20'+_0x3a714f[_0x3cde38(0x8d)]);if(_0x3a714f[_0x3cde38(0x8d)]!==_0x3cde38(0x83))return console[_0x3cde38(0x7e)](_0x3cde38(0x9a)+_0x3a714f[_0x3cde38(0x8d)]+_0x3cde38(0x9d)),console[_0x3cde38(0x7e)](_0x3cde38(0x91)),0x1;if(!_0x3a714f[_0x3cde38(0x76)])throw new SDKError(ErrorCode[_0x3cde38(0x90)],_0x3cde38(0x96));const _0x2af4e7=_0x3a714f[_0x3cde38(0x7c)],_0xeb6a6=_0x3a714f['segmentId'];_0x547099[_0x3cde38(0x79)]&&(console[_0x3cde38(0x7e)]('Parent\x20ID:\x20'+_0x2af4e7),console[_0x3cde38(0x7e)](_0x3cde38(0x7b)+_0xeb6a6));let _0x164550;if(_0x547099[_0x3cde38(0x87)]){const _0xdb6949=_0x547099[_0x3cde38(0x87)],_0x1d7f7c=await withSpinner(_0x3cde38(0x8b)+_0xdb6949+_0x3cde38(0x88),()=>_0x1db81d[_0x3cde38(0x83)][_0x3cde38(0x84)](_0x2af4e7,_0xdb6949),{'verbose':_0x547099[_0x3cde38(0x79)]});_0x164550=parseInt(_0x1d7f7c['data'],0xa),_0x547099[_0x3cde38(0x79)]&&console[_0x3cde38(0x7e)](_0x3cde38(0x9f)+_0x164550);}const _0x26acc5=await loadJSONFromOptions(_0x547099[_0x3cde38(0xa0)],_0x547099[_0x3cde38(0x9e)]),_0x1a10bd={'name':_0x547099[_0x3cde38(0x7d)],'description':_0x547099[_0x3cde38(0x98)],'rule':_0x26acc5,'kind':_0x547099['kind']!==undefined?parseInt(_0x547099[_0x3cde38(0x9c)],0xa):undefined,'segmentFolderId':_0x164550},_0x1a1373=await withSpinner(_0x3cde38(0x93)+_0x3a714f['segmentName']+_0x3cde38(0x88),()=>_0x1db81d['segment'][_0x3cde38(0xa3)](_0x2af4e7,_0xeb6a6,_0x1a10bd),{'verbose':_0x547099['verbose']}),_0x2f4a40=_0x1a1373[_0x3cde38(0x8a)];return console[_0x3cde38(0x7e)](_0x3cde38(0x8e)+_0x2f4a40[_0x3cde38(0x7d)]+'\x27'),_0x3a8e1b!==_0x1f8f41&&console[_0x3cde38(0x7e)](_0x3cde38(0x86)+_0x3a8e1b),await handleSDKOutput([_0x2f4a40],_0x547099),0x0;}}
1
+ const a42_0x5dc51c=a42_0x464b;(function(_0x5bb3f8,_0x323733){const _0x1d6674=a42_0x464b,_0x4943e4=_0x5bb3f8();while(!![]){try{const _0x2b3c31=parseInt(_0x1d6674(0x14b))/0x1*(parseInt(_0x1d6674(0x15c))/0x2)+parseInt(_0x1d6674(0x172))/0x3*(-parseInt(_0x1d6674(0x164))/0x4)+-parseInt(_0x1d6674(0x15e))/0x5+parseInt(_0x1d6674(0x14e))/0x6+-parseInt(_0x1d6674(0x14c))/0x7+-parseInt(_0x1d6674(0x153))/0x8*(-parseInt(_0x1d6674(0x157))/0x9)+parseInt(_0x1d6674(0x161))/0xa;if(_0x2b3c31===_0x323733)break;else _0x4943e4['push'](_0x4943e4['shift']());}catch(_0x17628d){_0x4943e4['push'](_0x4943e4['shift']());}}}(a42_0x41cf,0x3c3d0));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a42_0x41cf(){const _0xb726ac=['resolveFolderId','Examples:','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','segmentPath','57nFOOKr','INTERNAL','yellow','updateSegmentById','error','segment:update','5zVXlmJ','1519847umNUuT','name','676812epdndd','Resolved\x20relative\x20path\x20to:\x20','execute','Segment\x20ID:\x20','type','3656RjAfju','Resolved\x20type:\x20','description','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','3006ezgNZG','segmentName','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','\x20\x20\x20Path:\x20','Resolving\x20folder\x20\x27','121820vqwrzQ','verbose','333080hCQxiG','Parent\x20ID:\x20','segmentId','3728020qFbAPN','Updating\x20segment\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','86804KrsFYv','segment','folder','Error:\x20Cannot\x20update\x20','✔\x20Updated\x20segment\x20\x27','includes','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','kind','data','\x27...'];a42_0x41cf=function(){return _0xb726ac;};return a42_0x41cf();}import{SDKError,ErrorCode}from'../sdk/index.js';function a42_0x464b(_0x2f17e4,_0x3fecaf){_0x2f17e4=_0x2f17e4-0x148;const _0x41cf53=a42_0x41cf();let _0x464b8b=_0x41cf53[_0x2f17e4];return _0x464b8b;}import a42_0xb82177 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x5dc51c(0x14d)]=a42_0x5dc51c(0x14a);[a42_0x5dc51c(0x155)]='Update\x20existing\x20child\x20segment';async[a42_0x5dc51c(0x150)](_0x4c236d){const _0x274b25=a42_0x5dc51c;console[_0x274b25(0x149)](a42_0xb82177['yellow'](_0x274b25(0x16a))),console['error'](a42_0xb82177[_0x274b25(0x174)](_0x274b25(0x170)));const {options:_0x19a269,args:_0x28d96e,tdx:_0x17e370}=_0x4c236d,_0x3ef19f=_0x19a269;if(_0x28d96e['length']===0x0)return console[_0x274b25(0x149)](_0x274b25(0x156)),console['error']('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x274b25(0x149)](_0x274b25(0x16f)),console[_0x274b25(0x149)](_0x274b25(0x159)),console[_0x274b25(0x149)](_0x274b25(0x163)),0x1;const _0x21368f=_0x28d96e[0x0],_0x549639=_0x19a269[_0x274b25(0x171)];let _0x429354=_0x21368f;_0x549639&&!_0x21368f[_0x274b25(0x169)]('/')&&(_0x429354=_0x549639+'/'+_0x21368f,_0x3ef19f[_0x274b25(0x15d)]&&console['error'](_0x274b25(0x14f)+_0x429354));const _0x3156d0=await withSpinner('Resolving\x20path\x20\x27'+_0x429354+_0x274b25(0x16d),()=>_0x17e370[_0x274b25(0x165)]['resolvePathToResource'](_0x429354),{'verbose':_0x3ef19f[_0x274b25(0x15d)]}),_0x3d2a09=_0x3156d0['data'];_0x3ef19f[_0x274b25(0x15d)]&&console[_0x274b25(0x149)](_0x274b25(0x154)+_0x3d2a09[_0x274b25(0x152)]);if(_0x3d2a09[_0x274b25(0x152)]!=='segment')return console[_0x274b25(0x149)](_0x274b25(0x167)+_0x3d2a09[_0x274b25(0x152)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x274b25(0x149)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x3d2a09[_0x274b25(0x160)])throw new SDKError(ErrorCode[_0x274b25(0x173)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4ce927=_0x3d2a09['parentId'],_0x56891b=_0x3d2a09['segmentId'];_0x3ef19f['verbose']&&(console[_0x274b25(0x149)](_0x274b25(0x15f)+_0x4ce927),console[_0x274b25(0x149)](_0x274b25(0x151)+_0x56891b));let _0x40fccd;if(_0x3ef19f[_0x274b25(0x166)]){const _0x2db376=_0x3ef19f['folder'],_0x5d2930=await withSpinner(_0x274b25(0x15b)+_0x2db376+'\x27...',()=>_0x17e370[_0x274b25(0x165)][_0x274b25(0x16e)](_0x4ce927,_0x2db376),{'verbose':_0x3ef19f[_0x274b25(0x15d)]});_0x40fccd=parseInt(_0x5d2930['data'],0xa),_0x3ef19f[_0x274b25(0x15d)]&&console[_0x274b25(0x149)]('Resolved\x20folder\x20ID:\x20'+_0x40fccd);}const _0x2d1565=await loadJSONFromOptions(_0x3ef19f['rule'],_0x3ef19f['ruleFile']),_0x5abfeb={'name':_0x3ef19f[_0x274b25(0x14d)],'description':_0x3ef19f[_0x274b25(0x155)],'rule':_0x2d1565,'kind':_0x3ef19f[_0x274b25(0x16b)]!==undefined?parseInt(_0x3ef19f['kind'],0xa):undefined,'segmentFolderId':_0x40fccd},_0x189c32=await withSpinner(_0x274b25(0x162)+_0x3d2a09[_0x274b25(0x158)]+'\x27...',()=>_0x17e370[_0x274b25(0x165)][_0x274b25(0x148)](_0x4ce927,_0x56891b,_0x5abfeb),{'verbose':_0x3ef19f[_0x274b25(0x15d)]}),_0x35d705=_0x189c32[_0x274b25(0x16c)];return console[_0x274b25(0x149)](_0x274b25(0x168)+_0x35d705['name']+'\x27'),_0x429354!==_0x21368f&&console[_0x274b25(0x149)](_0x274b25(0x15a)+_0x429354),await handleSDKOutput([_0x35d705],_0x3ef19f),0x0;}}
@@ -1 +1 @@
1
- const a43_0x3e6c52=a43_0x9bd9;(function(_0x8603e9,_0x58033d){const _0x1a7749=a43_0x9bd9,_0x4528ee=_0x8603e9();while(!![]){try{const _0x548c0d=-parseInt(_0x1a7749(0x165))/0x1+parseInt(_0x1a7749(0x150))/0x2*(-parseInt(_0x1a7749(0x13e))/0x3)+parseInt(_0x1a7749(0x148))/0x4+-parseInt(_0x1a7749(0x157))/0x5+-parseInt(_0x1a7749(0x14a))/0x6*(-parseInt(_0x1a7749(0x141))/0x7)+parseInt(_0x1a7749(0x158))/0x8*(parseInt(_0x1a7749(0x134))/0x9)+parseInt(_0x1a7749(0x13a))/0xa*(parseInt(_0x1a7749(0x153))/0xb);if(_0x548c0d===_0x58033d)break;else _0x4528ee['push'](_0x4528ee['shift']());}catch(_0x1c894a){_0x4528ee['push'](_0x4528ee['shift']());}}}(a43_0x55d0,0x890ee));import{existsSync,statSync}from'fs';import a43_0x5e6920 from'chalk';function a43_0x55d0(){const _0xd336c5=['isDirectory','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','44PpKcrV','✔\x20Context\x20set\x20to:\x20','join','Target\x20path:\x20','2977390wLaVga','1548952dGpYae','type','Site:\x20','verbose','folderPath','Error:\x20Path\x20is\x20required\x0a','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','execute','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Examples:','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','site','Resolved\x20path\x20type:\x20','895532vGwNte','cyan','\x27...','45puJwHg','Usage:\x20tdx\x20segment\x20use\x20<path>','segment:use','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parentName','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','871330LQINJZ','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segment','name','3345915fsGOnG','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Folder\x20ID:\x20','6944903PVOdOM','session','slice','log','red','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','error','3435796rBaYvr','fullPath','6PXxgut','length','segments','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','split','green','2hIfuhy'];a43_0x55d0=function(){return _0xd336c5;};return a43_0x55d0();}import{BaseCommand}from'./command.js';function a43_0x9bd9(_0x3f4801,_0x2dc634){_0x3f4801=_0x3f4801-0x133;const _0x55d072=a43_0x55d0();let _0x9bd9e3=_0x55d072[_0x3f4801];return _0x9bd9e3;}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x3e6c52(0x13d)]=a43_0x3e6c52(0x136);['description']='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a43_0x3e6c52(0x15f)](_0x341cd6){const _0x4762a9=a43_0x3e6c52,{options:_0x3e575a,args:_0x4eb0c4,tdx:_0x3debc6}=_0x341cd6;if(_0x4eb0c4[_0x4762a9(0x14b)]===0x0)return console['error'](a43_0x5e6920['red'](_0x4762a9(0x15d))),console[_0x4762a9(0x147)](_0x4762a9(0x135)),console[_0x4762a9(0x147)](_0x4762a9(0x161)),console[_0x4762a9(0x147)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x4762a9(0x147)](_0x4762a9(0x152)),console[_0x4762a9(0x147)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x4762a9(0x160)),0x1;const _0x427aeb=_0x4eb0c4[0x0],_0x15cf73=_0x3e575a[_0x4762a9(0x142)];try{if(_0x427aeb==='/')return saveSessionContext({'segment_path':undefined},_0x15cf73),console['log'](a43_0x5e6920[_0x4762a9(0x14f)](_0x4762a9(0x162))),0x0;if(existsSync(_0x427aeb)&&statSync(_0x427aeb)[_0x4762a9(0x151)]()){let _0x1aff40;try{_0x1aff40=findTdxConfig(_0x427aeb);}catch{return console[_0x4762a9(0x147)](a43_0x5e6920[_0x4762a9(0x145)](_0x4762a9(0x137)+_0x427aeb)),console[_0x4762a9(0x147)](a43_0x5e6920['cyan'](_0x4762a9(0x13b))),0x1;}const _0x124a93=_0x1aff40['config']['parent_segment'];return saveSessionContext({'segment_path':_0x124a93,'parent_segment':_0x124a93},_0x15cf73),console[_0x4762a9(0x144)](a43_0x5e6920[_0x4762a9(0x14f)](_0x4762a9(0x154)+a43_0x5e6920[_0x4762a9(0x166)](_0x124a93))),0x0;}const _0x53b2d9=_0x3e575a['segmentPath'];let _0x45c6f7=_0x427aeb;const _0x46eb3e=parsePath(_0x427aeb);if(!_0x46eb3e['isAbsolute']){if(!_0x53b2d9)return console[_0x4762a9(0x147)](a43_0x5e6920['red']('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x4762a9(0x147)](a43_0x5e6920[_0x4762a9(0x166)](_0x4762a9(0x15e))),0x1;if(_0x427aeb==='..'){const _0x4f21ce=_0x53b2d9[_0x4762a9(0x14e)]('/')[_0x4762a9(0x143)](0x0,-0x1)[_0x4762a9(0x155)]('/');_0x45c6f7=_0x4f21ce||'/';}else _0x427aeb==='.'?_0x45c6f7=_0x53b2d9:_0x45c6f7=_0x53b2d9+'/'+_0x427aeb;_0x3e575a[_0x4762a9(0x15b)]&&console[_0x4762a9(0x147)]('Resolved\x20relative\x20path\x20to:\x20'+_0x45c6f7);}if(_0x45c6f7==='/'||_0x45c6f7==='')return saveSessionContext({'segment_path':undefined},_0x15cf73),console['log'](a43_0x5e6920['green'](_0x4762a9(0x162))),0x0;_0x45c6f7=normalizePath(_0x45c6f7);const _0x1bd250=parsePath(_0x45c6f7)[_0x4762a9(0x14c)];if(_0x1bd250[_0x4762a9(0x14b)]===0x0)return saveSessionContext({'segment_path':undefined},_0x15cf73),console['log'](a43_0x5e6920[_0x4762a9(0x14f)](_0x4762a9(0x162))),0x0;_0x3e575a[_0x4762a9(0x15b)]&&(console[_0x4762a9(0x147)](_0x4762a9(0x15a)+_0x3e575a[_0x4762a9(0x163)]),console['error'](_0x4762a9(0x156)+_0x45c6f7));const _0x517179=await withSpinner('Resolving\x20path\x20\x27'+_0x45c6f7+_0x4762a9(0x133),()=>_0x3debc6[_0x4762a9(0x13c)]['resolvePathToResource'](_0x45c6f7),{'verbose':_0x3e575a[_0x4762a9(0x15b)]}),_0x10d96e=_0x517179['data'];_0x3e575a[_0x4762a9(0x15b)]&&(console[_0x4762a9(0x147)](_0x4762a9(0x164)+_0x10d96e[_0x4762a9(0x159)]),console[_0x4762a9(0x147)]('Parent\x20ID:\x20'+_0x10d96e['parentId']),_0x10d96e['folderId']&&console[_0x4762a9(0x147)](_0x4762a9(0x140)+_0x10d96e['folderId']));if(_0x10d96e[_0x4762a9(0x159)]===_0x4762a9(0x13c))return console['error'](a43_0x5e6920[_0x4762a9(0x145)](_0x4762a9(0x14d))),console[_0x4762a9(0x147)](_0x4762a9(0x13f)),console[_0x4762a9(0x147)](a43_0x5e6920[_0x4762a9(0x166)]('Use:\x20tdx\x20segment\x20use\x20'+_0x10d96e[_0x4762a9(0x138)]+(_0x10d96e[_0x4762a9(0x15c)]?'/'+_0x10d96e['folderPath'][_0x4762a9(0x155)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x10d96e[_0x4762a9(0x149)],'parent_segment':_0x10d96e['parentName']},_0x15cf73),console[_0x4762a9(0x144)](a43_0x5e6920[_0x4762a9(0x14f)](_0x4762a9(0x154)+a43_0x5e6920[_0x4762a9(0x166)](_0x10d96e[_0x4762a9(0x149)]))),_0x3e575a[_0x4762a9(0x15b)]&&(console[_0x4762a9(0x147)](a43_0x5e6920['dim'](_0x4762a9(0x139))),console[_0x4762a9(0x147)](a43_0x5e6920['dim'](_0x4762a9(0x146)))),0x0;}catch(_0x51a401){throw _0x51a401;}}}
1
+ const a43_0x4d6f45=a43_0x1508;(function(_0x390cd5,_0x4f1d26){const _0x27aeee=a43_0x1508,_0x2d3f04=_0x390cd5();while(!![]){try{const _0x200876=-parseInt(_0x27aeee(0x1ba))/0x1*(-parseInt(_0x27aeee(0x1de))/0x2)+-parseInt(_0x27aeee(0x1b0))/0x3+parseInt(_0x27aeee(0x1b4))/0x4+parseInt(_0x27aeee(0x1b3))/0x5+-parseInt(_0x27aeee(0x1dc))/0x6+-parseInt(_0x27aeee(0x1dd))/0x7+parseInt(_0x27aeee(0x1d7))/0x8;if(_0x200876===_0x4f1d26)break;else _0x2d3f04['push'](_0x2d3f04['shift']());}catch(_0x2e1f06){_0x2d3f04['push'](_0x2d3f04['shift']());}}}(a43_0x5e25,0x586e4));import{existsSync,statSync}from'fs';import a43_0x5dd0a0 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x1508(_0x3d961a,_0x23abc1){_0x3d961a=_0x3d961a-0x1ac;const _0x5e25a3=a43_0x5e25();let _0x15088f=_0x5e25a3[_0x3d961a];return _0x15088f;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x4d6f45(0x1b5)]=a43_0x4d6f45(0x1b9);['description']=a43_0x4d6f45(0x1da);async[a43_0x4d6f45(0x1ce)](_0x49dbdf){const _0x436637=a43_0x4d6f45,{options:_0x5cb55a,args:_0x3449c5,tdx:_0x34e940}=_0x49dbdf;if(_0x3449c5[_0x436637(0x1d5)]===0x0)return console[_0x436637(0x1c9)](a43_0x5dd0a0['red'](_0x436637(0x1b8))),console[_0x436637(0x1c9)](_0x436637(0x1e2)),console[_0x436637(0x1c9)]('Examples:'),console[_0x436637(0x1c9)](_0x436637(0x1c0)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x436637(0x1c9)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x436637(0x1be)),0x1;const _0x26cdaf=_0x3449c5[0x0],_0x2d98f=_0x5cb55a[_0x436637(0x1ca)];try{if(_0x26cdaf==='/')return saveSessionContext({'segment_path':undefined},_0x2d98f),console[_0x436637(0x1d6)](a43_0x5dd0a0['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x26cdaf)&&statSync(_0x26cdaf)[_0x436637(0x1d9)]()){let _0x4f2d7c;try{_0x4f2d7c=findTdxConfig(_0x26cdaf);}catch{return console[_0x436637(0x1c9)](a43_0x5dd0a0[_0x436637(0x1c5)](_0x436637(0x1af)+_0x26cdaf)),console[_0x436637(0x1c9)](a43_0x5dd0a0[_0x436637(0x1c3)](_0x436637(0x1d8))),0x1;}const _0x1176df=_0x4f2d7c[_0x436637(0x1bc)][_0x436637(0x1cf)];return saveSessionContext({'segment_path':_0x1176df,'parent_segment':_0x1176df},_0x2d98f),console[_0x436637(0x1d6)](a43_0x5dd0a0[_0x436637(0x1cd)](_0x436637(0x1e0)+a43_0x5dd0a0['cyan'](_0x1176df))),0x0;}const _0x52c410=_0x5cb55a[_0x436637(0x1bb)];let _0xadc11f=_0x26cdaf;const _0x3d07af=parsePath(_0x26cdaf);if(!_0x3d07af['isAbsolute']){if(!_0x52c410)return console[_0x436637(0x1c9)](a43_0x5dd0a0[_0x436637(0x1c5)](_0x436637(0x1b1))),console[_0x436637(0x1c9)](a43_0x5dd0a0[_0x436637(0x1c3)](_0x436637(0x1d1))),0x1;if(_0x26cdaf==='..'){const _0xb26fe6=_0x52c410[_0x436637(0x1cb)]('/')[_0x436637(0x1bf)](0x0,-0x1)[_0x436637(0x1db)]('/');_0xadc11f=_0xb26fe6||'/';}else _0x26cdaf==='.'?_0xadc11f=_0x52c410:_0xadc11f=_0x52c410+'/'+_0x26cdaf;_0x5cb55a['verbose']&&console[_0x436637(0x1c9)](_0x436637(0x1b2)+_0xadc11f);}if(_0xadc11f==='/'||_0xadc11f==='')return saveSessionContext({'segment_path':undefined},_0x2d98f),console['log'](a43_0x5dd0a0[_0x436637(0x1cd)](_0x436637(0x1ae))),0x0;_0xadc11f=normalizePath(_0xadc11f);const _0x36824f=parsePath(_0xadc11f)['segments'];if(_0x36824f[_0x436637(0x1d5)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2d98f),console['log'](a43_0x5dd0a0[_0x436637(0x1cd)](_0x436637(0x1ae))),0x0;_0x5cb55a[_0x436637(0x1c4)]&&(console[_0x436637(0x1c9)](_0x436637(0x1e1)+_0x5cb55a[_0x436637(0x1cc)]),console['error'](_0x436637(0x1df)+_0xadc11f));const _0x25b32f=await withSpinner(_0x436637(0x1d2)+_0xadc11f+_0x436637(0x1b6),()=>_0x34e940['segment'][_0x436637(0x1c2)](_0xadc11f),{'verbose':_0x5cb55a['verbose']}),_0x127bd7=_0x25b32f['data'];_0x5cb55a['verbose']&&(console['error'](_0x436637(0x1bd)+_0x127bd7[_0x436637(0x1c8)]),console['error'](_0x436637(0x1e3)+_0x127bd7[_0x436637(0x1b7)]),_0x127bd7['folderId']&&console[_0x436637(0x1c9)](_0x436637(0x1d0)+_0x127bd7[_0x436637(0x1e4)]));if(_0x127bd7[_0x436637(0x1c8)]===_0x436637(0x1ad))return console['error'](a43_0x5dd0a0['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x436637(0x1c9)](_0x436637(0x1c7)),console[_0x436637(0x1c9)](a43_0x5dd0a0[_0x436637(0x1c3)]('Use:\x20tdx\x20segment\x20use\x20'+_0x127bd7[_0x436637(0x1d3)]+(_0x127bd7[_0x436637(0x1c6)]?'/'+_0x127bd7[_0x436637(0x1c6)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x127bd7[_0x436637(0x1c1)],'parent_segment':_0x127bd7['parentName']},_0x2d98f),console[_0x436637(0x1d6)](a43_0x5dd0a0['green'](_0x436637(0x1e0)+a43_0x5dd0a0['cyan'](_0x127bd7[_0x436637(0x1c1)]))),_0x5cb55a[_0x436637(0x1c4)]&&(console['error'](a43_0x5dd0a0[_0x436637(0x1ac)](_0x436637(0x1d4))),console['error'](a43_0x5dd0a0[_0x436637(0x1ac)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x4347a1){throw _0x4347a1;}}}function a43_0x5e25(){const _0x150fdf=['Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Resolving\x20path\x20\x27','parentName','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','length','log','2782960MBzewe','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','isDirectory','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','join','523416ulPDog','4466735VUchtH','24982MXbbXm','Target\x20path:\x20','✔\x20Context\x20set\x20to:\x20','Site:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','Parent\x20ID:\x20','folderId','dim','segment','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','128886xvgvSq','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Resolved\x20relative\x20path\x20to:\x20','8340pKcqOp','1425132enxuEq','name','\x27...','parentId','Error:\x20Path\x20is\x20required\x0a','segment:use','34eUjUag','segmentPath','config','Resolved\x20path\x20type:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','slice','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','fullPath','resolvePathToResource','cyan','verbose','red','folderPath','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','type','error','session','split','site','green','execute','parent_segment','Folder\x20ID:\x20'];a43_0x5e25=function(){return _0x150fdf;};return a43_0x5e25();}
@@ -1 +1 @@
1
- const a44_0x572956=a44_0x297d;(function(_0x1c5392,_0x2a1ed3){const _0x4618c4=a44_0x297d,_0x2b053a=_0x1c5392();while(!![]){try{const _0x27e39d=-parseInt(_0x4618c4(0x1a0))/0x1*(-parseInt(_0x4618c4(0x1a3))/0x2)+-parseInt(_0x4618c4(0x1b0))/0x3+parseInt(_0x4618c4(0x1ad))/0x4+parseInt(_0x4618c4(0x196))/0x5*(-parseInt(_0x4618c4(0x197))/0x6)+parseInt(_0x4618c4(0x1b7))/0x7+parseInt(_0x4618c4(0x1c0))/0x8+-parseInt(_0x4618c4(0x1ae))/0x9;if(_0x27e39d===_0x2a1ed3)break;else _0x2b053a['push'](_0x2b053a['shift']());}catch(_0x57c977){_0x2b053a['push'](_0x2b053a['shift']());}}}(a44_0x1799,0x98688));import{BaseCommand}from'./command.js';function a44_0x297d(_0x5c6d0f,_0x569f92){_0x5c6d0f=_0x5c6d0f-0x194;const _0x1799dc=a44_0x1799();let _0x297d45=_0x1799dc[_0x5c6d0f];return _0x297d45;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x7a817f from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x1799(){const _0x5da35a=['438yBLiBl','Error:\x20Directory\x20not\x20found:\x20','errors','endsWith','red','dim','valid','file','\x20warning(s)\x20found','11121cIyUpf','.yaml','yellow','112NVfney','helpText','verbose','filePath','message','invalidCount','):\x20','description','parentSegment','error','3533100cWOGja','7253001nJAoaa','Error:\x20','3558447HwiKvk','warnings','Validation\x20failed:\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','warningCount','\x20error(s)','targetDir','7801052ctslzg','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20file(s)\x20valid','validCount','\x20warning(s)','\x20file(s)\x20with\x20errors,\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','log','no_parent','7066208BXwFAc','errorCode','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','name','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','green','length','cwd','60785qqRfSU'];a44_0x1799=function(){return _0x5da35a;};return a44_0x1799();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x572956(0x1c3)]='segment:validate';[a44_0x572956(0x1aa)]=a44_0x572956(0x1b3);async['execute'](_0x1c8c75){const _0xa8fbda=a44_0x572956,{options:_0x492783,args:_0x25c1e2}=_0x1c8c75,_0x1e3868=_0x492783,_0x4f4101=await resolveTarget({'arg':_0x25c1e2[0x0],'contextParent':_0x492783[_0xa8fbda(0x1ab)],'cwd':process[_0xa8fbda(0x195)]()});if(!isSuccessfulResolution(_0x4f4101))return _0x4f4101[_0xa8fbda(0x1c1)]===_0xa8fbda(0x1bf)?(console[_0xa8fbda(0x1ac)](a44_0x7a817f['yellow'](_0xa8fbda(0x1c2))),console[_0xa8fbda(0x1ac)](_0xa8fbda(0x1c4)),console[_0xa8fbda(0x1ac)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0xa8fbda(0x1ac)](a44_0x7a817f[_0xa8fbda(0x19b)](_0xa8fbda(0x1af)+_0x4f4101[_0xa8fbda(0x1a7)]+'\x0a')),_0x4f4101[_0xa8fbda(0x1a4)]&&console['error'](a44_0x7a817f['cyan'](_0x4f4101[_0xa8fbda(0x1a4)]))),0x1;const _0x588aef=_0x4f4101[_0xa8fbda(0x1b6)],_0x30f2e7=_0x4f4101['type']===_0xa8fbda(0x19e)?_0x4f4101[_0xa8fbda(0x1a6)]:undefined;if(!_0x30f2e7&&!existsSync(_0x588aef))return console['error'](a44_0x7a817f[_0xa8fbda(0x19b)](_0xa8fbda(0x198)+_0x588aef+'\x0a')),0x1;let _0x2767e3;if(_0x30f2e7){if(!_0x30f2e7[_0xa8fbda(0x19a)]('.yml')&&!_0x30f2e7['endsWith'](_0xa8fbda(0x1a1)))return console[_0xa8fbda(0x1ac)](a44_0x7a817f[_0xa8fbda(0x19b)](_0xa8fbda(0x1bd)+_0x30f2e7+'\x0a')),0x1;_0x2767e3=[_0x30f2e7];}else _0x2767e3=findYamlFiles(_0x588aef);if(_0x2767e3[_0xa8fbda(0x194)]===0x0)return console[_0xa8fbda(0x1ac)](a44_0x7a817f[_0xa8fbda(0x19b)](_0xa8fbda(0x1b8)+_0x588aef+'\x0a')),0x1;const _0x5e0d2b=validateYamlFiles(_0x2767e3,_0x588aef),_0x2cb2c5=calculateSummary(_0x5e0d2b);for(const _0x3d00ac of _0x5e0d2b){if(!isValidationResult(_0x3d00ac))continue;const {relativePath:_0x42d05a,source:_0x3720bf,result:_0xf6d2c3,fileType:_0x33a8aa}=_0x3d00ac,_0x1c5e6e=_0x33a8aa;if(_0xf6d2c3[_0xa8fbda(0x19d)]&&_0xf6d2c3[_0xa8fbda(0x1b1)][_0xa8fbda(0x194)]===0x0)_0x1e3868[_0xa8fbda(0x1a5)]&&console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x1c5)]('✔\x20'+_0x42d05a)+a44_0x7a817f[_0xa8fbda(0x19c)]('\x20('+_0x1c5e6e+')'));else _0xf6d2c3[_0xa8fbda(0x19d)]?(console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x1a2)]('⚠\x20'+_0x42d05a)+a44_0x7a817f[_0xa8fbda(0x19c)]('\x20('+_0x1c5e6e+_0xa8fbda(0x1a9)+_0xf6d2c3[_0xa8fbda(0x1b1)][_0xa8fbda(0x194)]+_0xa8fbda(0x1bb))),console['log'](formatValidationResult(_0xf6d2c3,_0x3720bf,_0x42d05a))):(console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x19b)]('✖\x20'+_0x42d05a)+a44_0x7a817f['dim']('\x20('+_0x1c5e6e+_0xa8fbda(0x1a9)+_0xf6d2c3[_0xa8fbda(0x199)][_0xa8fbda(0x194)]+_0xa8fbda(0x1b5))),console[_0xa8fbda(0x1be)](formatValidationResult(_0xf6d2c3,_0x3720bf,_0x42d05a)));}return console['log'](''),_0x2cb2c5['hasErrors']?(console[_0xa8fbda(0x1be)](a44_0x7a817f['red'](_0xa8fbda(0x1b2)+_0x2cb2c5[_0xa8fbda(0x1a8)]+_0xa8fbda(0x1bc)+_0x2cb2c5[_0xa8fbda(0x1ba)]+'\x20valid')),_0x2cb2c5[_0xa8fbda(0x1b4)]>0x0&&console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x1a2)](_0x2cb2c5['warningCount']+_0xa8fbda(0x19f))),0x1):(console[_0xa8fbda(0x1be)](a44_0x7a817f[_0xa8fbda(0x1c5)]('✔\x20All\x20'+_0x2cb2c5['validCount']+_0xa8fbda(0x1b9))),_0x2cb2c5[_0xa8fbda(0x1b4)]>0x0&&console['log'](a44_0x7a817f['yellow'](_0x2cb2c5[_0xa8fbda(0x1b4)]+_0xa8fbda(0x19f))),0x0);}}
1
+ const a44_0x16d6da=a44_0x581d;(function(_0x26ca62,_0x3bd224){const _0x316ee5=a44_0x581d,_0x1c1c8e=_0x26ca62();while(!![]){try{const _0x57a5b0=parseInt(_0x316ee5(0x196))/0x1+parseInt(_0x316ee5(0x1ad))/0x2+parseInt(_0x316ee5(0x184))/0x3*(parseInt(_0x316ee5(0x198))/0x4)+-parseInt(_0x316ee5(0x1a8))/0x5+-parseInt(_0x316ee5(0x18f))/0x6+parseInt(_0x316ee5(0x1a6))/0x7+-parseInt(_0x316ee5(0x1a3))/0x8;if(_0x57a5b0===_0x3bd224)break;else _0x1c1c8e['push'](_0x1c1c8e['shift']());}catch(_0x1d2643){_0x1c1c8e['push'](_0x1c1c8e['shift']());}}}(a44_0x2cc1,0xd97dd));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0x581d(_0x2fb3f9,_0x247cfb){_0x2fb3f9=_0x2fb3f9-0x17d;const _0x2cc141=a44_0x2cc1();let _0x581df2=_0x2cc141[_0x2fb3f9];return _0x581df2;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a44_0x2cc1(){const _0x3c3ec5=['warningCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','errors','1452680XTjwAl','targetDir','execute','3658942bKcbgY','cyan','606380yWzgNo','\x20file(s)\x20valid','type','parentSegment','yellow','536956ASrbRV','Validation\x20failed:\x20','dim','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','description','no_parent','\x20warning(s)\x20found','✔\x20All\x20','cwd','invalidCount','log','3YgBspw','.yaml','hasErrors','valid','green','\x20error(s)','length','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20valid','endsWith','Validate\x20segment\x20and\x20journey\x20YAML\x20files','9609378ZnOwJb','errorCode','segment:validate','file','.yml','warnings','red','1686594zPRgWV','validCount','1269964acludS','\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','\x20warning(s)','error','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','):\x20','verbose','helpText'];a44_0x2cc1=function(){return _0x3c3ec5;};return a44_0x2cc1();}import a44_0x1a935c 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{['name']=a44_0x16d6da(0x191);[a44_0x16d6da(0x17d)]=a44_0x16d6da(0x18e);async[a44_0x16d6da(0x1a5)](_0x331796){const _0xd8b2f2=a44_0x16d6da,{options:_0x259cc0,args:_0x110be1}=_0x331796,_0x62f593=_0x259cc0,_0x15dd7c=await resolveTarget({'arg':_0x110be1[0x0],'contextParent':_0x259cc0[_0xd8b2f2(0x1ab)],'cwd':process[_0xd8b2f2(0x181)]()});if(!isSuccessfulResolution(_0x15dd7c))return _0x15dd7c[_0xd8b2f2(0x190)]===_0xd8b2f2(0x17e)?(console['error'](a44_0x1a935c[_0xd8b2f2(0x1ac)](_0xd8b2f2(0x18b))),console[_0xd8b2f2(0x19b)](_0xd8b2f2(0x19c)),console[_0xd8b2f2(0x19b)](_0xd8b2f2(0x199)),console[_0xd8b2f2(0x19b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a44_0x1a935c['red']('Error:\x20'+_0x15dd7c['message']+'\x0a')),_0x15dd7c[_0xd8b2f2(0x19f)]&&console[_0xd8b2f2(0x19b)](a44_0x1a935c[_0xd8b2f2(0x1a7)](_0x15dd7c[_0xd8b2f2(0x19f)]))),0x1;const _0x36ad2b=_0x15dd7c[_0xd8b2f2(0x1a4)],_0x1dd5f3=_0x15dd7c[_0xd8b2f2(0x1aa)]===_0xd8b2f2(0x192)?_0x15dd7c['filePath']:undefined;if(!_0x1dd5f3&&!existsSync(_0x36ad2b))return console[_0xd8b2f2(0x19b)](a44_0x1a935c[_0xd8b2f2(0x195)]('Error:\x20Directory\x20not\x20found:\x20'+_0x36ad2b+'\x0a')),0x1;let _0x155645;if(_0x1dd5f3){if(!_0x1dd5f3[_0xd8b2f2(0x18d)](_0xd8b2f2(0x193))&&!_0x1dd5f3[_0xd8b2f2(0x18d)](_0xd8b2f2(0x185)))return console['error'](a44_0x1a935c[_0xd8b2f2(0x195)](_0xd8b2f2(0x1b0)+_0x1dd5f3+'\x0a')),0x1;_0x155645=[_0x1dd5f3];}else _0x155645=findYamlFiles(_0x36ad2b);if(_0x155645[_0xd8b2f2(0x18a)]===0x0)return console[_0xd8b2f2(0x19b)](a44_0x1a935c[_0xd8b2f2(0x195)](_0xd8b2f2(0x1a1)+_0x36ad2b+'\x0a')),0x1;const _0x9bffe6=validateYamlFiles(_0x155645,_0x36ad2b),_0xe24ef0=calculateSummary(_0x9bffe6);for(const _0x1aebfb of _0x9bffe6){if(!isValidationResult(_0x1aebfb))continue;const {relativePath:_0x34057d,source:_0x359240,result:_0x28d9ae,fileType:_0x3f75f3}=_0x1aebfb,_0x124b14=_0x3f75f3;if(_0x28d9ae[_0xd8b2f2(0x187)]&&_0x28d9ae[_0xd8b2f2(0x194)]['length']===0x0)_0x62f593[_0xd8b2f2(0x19e)]&&console[_0xd8b2f2(0x183)](a44_0x1a935c[_0xd8b2f2(0x188)]('✔\x20'+_0x34057d)+a44_0x1a935c[_0xd8b2f2(0x1af)]('\x20('+_0x124b14+')'));else _0x28d9ae[_0xd8b2f2(0x187)]?(console[_0xd8b2f2(0x183)](a44_0x1a935c['yellow']('⚠\x20'+_0x34057d)+a44_0x1a935c[_0xd8b2f2(0x1af)]('\x20('+_0x124b14+_0xd8b2f2(0x19d)+_0x28d9ae[_0xd8b2f2(0x194)][_0xd8b2f2(0x18a)]+_0xd8b2f2(0x19a))),console[_0xd8b2f2(0x183)](formatValidationResult(_0x28d9ae,_0x359240,_0x34057d))):(console[_0xd8b2f2(0x183)](a44_0x1a935c[_0xd8b2f2(0x195)]('✖\x20'+_0x34057d)+a44_0x1a935c[_0xd8b2f2(0x1af)]('\x20('+_0x124b14+'):\x20'+_0x28d9ae[_0xd8b2f2(0x1a2)][_0xd8b2f2(0x18a)]+_0xd8b2f2(0x189))),console[_0xd8b2f2(0x183)](formatValidationResult(_0x28d9ae,_0x359240,_0x34057d)));}return console[_0xd8b2f2(0x183)](''),_0xe24ef0[_0xd8b2f2(0x186)]?(console[_0xd8b2f2(0x183)](a44_0x1a935c['red'](_0xd8b2f2(0x1ae)+_0xe24ef0[_0xd8b2f2(0x182)]+'\x20file(s)\x20with\x20errors,\x20'+_0xe24ef0['validCount']+_0xd8b2f2(0x18c))),_0xe24ef0['warningCount']>0x0&&console[_0xd8b2f2(0x183)](a44_0x1a935c[_0xd8b2f2(0x1ac)](_0xe24ef0[_0xd8b2f2(0x1a0)]+_0xd8b2f2(0x17f))),0x1):(console[_0xd8b2f2(0x183)](a44_0x1a935c['green'](_0xd8b2f2(0x180)+_0xe24ef0[_0xd8b2f2(0x197)]+_0xd8b2f2(0x1a9))),_0xe24ef0['warningCount']>0x0&&console[_0xd8b2f2(0x183)](a44_0x1a935c[_0xd8b2f2(0x1ac)](_0xe24ef0[_0xd8b2f2(0x1a0)]+_0xd8b2f2(0x17f))),0x0);}}
@@ -1 +1 @@
1
- function a45_0xfbb4(_0x4d1d49,_0x2ac2ac){_0x4d1d49=_0x4d1d49-0x117;const _0x39c075=a45_0x39c0();let _0xfbb4f2=_0x39c075[_0x4d1d49];return _0xfbb4f2;}const a45_0x5f14a8=a45_0xfbb4;(function(_0x8a7598,_0xb65b82){const _0x4e1812=a45_0xfbb4,_0x4ec2df=_0x8a7598();while(!![]){try{const _0x3b3600=-parseInt(_0x4e1812(0x129))/0x1*(-parseInt(_0x4e1812(0x12a))/0x2)+parseInt(_0x4e1812(0x153))/0x3*(parseInt(_0x4e1812(0x11f))/0x4)+parseInt(_0x4e1812(0x13d))/0x5+-parseInt(_0x4e1812(0x13e))/0x6*(-parseInt(_0x4e1812(0x130))/0x7)+parseInt(_0x4e1812(0x160))/0x8*(-parseInt(_0x4e1812(0x155))/0x9)+-parseInt(_0x4e1812(0x152))/0xa*(parseInt(_0x4e1812(0x117))/0xb)+-parseInt(_0x4e1812(0x146))/0xc*(parseInt(_0x4e1812(0x11a))/0xd);if(_0x3b3600===_0xb65b82)break;else _0x4ec2df['push'](_0x4ec2df['shift']());}catch(_0x3c4e58){_0x4ec2df['push'](_0x4ec2df['shift']());}}}(a45_0x39c0,0xbdc3d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x493241 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x5f14a8(0x149)]='segments';[a45_0x5f14a8(0x14f)]='List\x20folders\x20and\x20child\x20segments';async[a45_0x5f14a8(0x11b)](_0x396528){const _0x20814a=a45_0x5f14a8,{options:_0x59d498,args:_0x3e9260}=_0x396528,_0x48b3cd=_0x59d498['recursive'],_0x283bae=_0x3e9260[0x0];try{const _0x500c9f=_0x59d498[_0x20814a(0x141)];_0x59d498[_0x20814a(0x136)]&&(console['error'](_0x20814a(0x132)+_0x59d498[_0x20814a(0x162)]),console[_0x20814a(0x15b)](_0x20814a(0x126)+(_0x500c9f||_0x20814a(0x15d))),_0x283bae&&console['error'](_0x20814a(0x134)+_0x283bae),_0x48b3cd&&console[_0x20814a(0x15b)]('Recursive\x20mode:\x20enabled'));if(!_0x500c9f)return console[_0x20814a(0x15b)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x20814a(0x15b)](''),console['error']('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x20814a(0x15b)](_0x20814a(0x13a)),console[_0x20814a(0x15b)](_0x20814a(0x145)),console[_0x20814a(0x15b)](''),console['error'](_0x20814a(0x12d)),0x1;const _0x4b9701=_0x283bae&&(_0x283bae[_0x20814a(0x133)]('*')||_0x283bae[_0x20814a(0x133)]('?'));if(_0x4b9701)return await this['listWithPattern'](_0x396528,_0x500c9f,_0x283bae);const _0x3aeccb=_0x283bae?_0x500c9f+'/'+_0x283bae:_0x500c9f;return _0x48b3cd?await this[_0x20814a(0x11d)](_0x396528,_0x3aeccb):await this['listUnified'](_0x396528,_0x3aeccb);}catch(_0xd63e1){if(_0xd63e1 instanceof SDKError)return console[_0x20814a(0x15b)](_0x20814a(0x118)+_0xd63e1[_0x20814a(0x159)]),_0xd63e1[_0x20814a(0x135)]&&console[_0x20814a(0x15b)]('\x20\x20Cause:\x20'+_0xd63e1['cause']),0x1;throw _0xd63e1;}}async[a45_0x5f14a8(0x120)](_0x9386e9,_0x1e95b5,_0x3375d0){const _0x4c6d3f=a45_0x5f14a8,{options:_0x3d893f,tdx:_0x198035}=_0x9386e9,_0x14f108=await withSpinner(_0x4c6d3f(0x119)+_0x1e95b5+_0x4c6d3f(0x12c),()=>_0x198035[_0x4c6d3f(0x14b)][_0x4c6d3f(0x15f)](_0x1e95b5),{'verbose':_0x3d893f[_0x4c6d3f(0x136)]}),_0x52391e=_0x14f108[_0x4c6d3f(0x138)],_0x46bc4d=await withSpinner(_0x4c6d3f(0x15a),()=>_0x198035[_0x4c6d3f(0x14b)]['listUnifiedWithJourneys'](_0x52391e[_0x4c6d3f(0x156)],_0x52391e[_0x4c6d3f(0x151)]),{'verbose':_0x3d893f[_0x4c6d3f(0x136)]}),{folders:_0x545598,segments:_0x1fb24a,journeys:_0x1b3887}=_0x46bc4d[_0x4c6d3f(0x138)],_0x580b0c=_0x3375d0['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x4c6d3f(0x12f)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x51e3a6=new RegExp('^'+_0x580b0c+'$','i'),_0x3f7ce1=_0x545598[_0x4c6d3f(0x12e)](_0x487d9e=>_0x51e3a6['test'](_0x487d9e[_0x4c6d3f(0x149)])),_0x114dd3=_0x1fb24a['filter'](_0xfbf8ab=>_0x51e3a6[_0x4c6d3f(0x158)](_0xfbf8ab[_0x4c6d3f(0x149)])),_0xd35a5f=_0x1b3887[_0x4c6d3f(0x12e)](_0x4bf410=>_0x51e3a6[_0x4c6d3f(0x158)](_0x4bf410[_0x4c6d3f(0x11e)])),_0x99861=_0x3f7ce1[_0x4c6d3f(0x13f)]+_0x114dd3['length']+_0xd35a5f[_0x4c6d3f(0x13f)];console['error']('✔\x20Found\x20'+_0x3f7ce1[_0x4c6d3f(0x13f)]+'\x20folder'+(_0x3f7ce1[_0x4c6d3f(0x13f)]!==0x1?'s':'')+',\x20'+_0x114dd3['length']+_0x4c6d3f(0x137)+(_0x114dd3['length']!==0x1?'s':'')+_0x4c6d3f(0x14d)+_0xd35a5f[_0x4c6d3f(0x13f)]+_0x4c6d3f(0x139)+(_0xd35a5f[_0x4c6d3f(0x13f)]!==0x1?'s':'')+_0x4c6d3f(0x161)+_0x3375d0+'\x27');const _0x1343f6=_0x19628d=>{const _0x33740e=_0x4c6d3f;return getConsoleNextUrl(_0x3d893f['site'],_0x33740e(0x14a)+_0x52391e[_0x33740e(0x156)]+_0x33740e(0x142)+_0x19628d);},_0x2b4df5=_0x3d893f[_0x4c6d3f(0x140)]==='json'||_0x3d893f['format']==='jsonl';if(_0x2b4df5){const _0xcb1268=[..._0x3f7ce1[_0x4c6d3f(0x15c)](_0x3c7593=>({..._0x3c7593,'type':'folder'})),..._0x114dd3[_0x4c6d3f(0x15c)](_0xd8b133=>({..._0xd8b133,'type':_0x4c6d3f(0x14b),'url':_0x1343f6(_0xd8b133['id'])})),..._0xd35a5f['map'](_0x2bc576=>({..._0x2bc576,'name':_0x2bc576['journeyBundleName'],'type':'journey'}))][_0x4c6d3f(0x122)]((_0x3b5660,_0x61ff90)=>_0x3b5660['name'][_0x4c6d3f(0x128)](_0x61ff90['name']));await handleSDKOutput(_0xcb1268,_0x3d893f);}else{if(_0x99861===0x0)console['log']('No\x20items\x20match\x20pattern:\x20'+_0x3375d0);else{console[_0x4c6d3f(0x148)](a45_0x493241[_0x4c6d3f(0x124)]('['+_0x1e95b5+_0x4c6d3f(0x163)+_0x3375d0+'\x27'));const _0x158a83=formatFlatList(_0x3f7ce1,_0x114dd3,{'showMetadata':!![],'getSegmentUrl':_0x1343f6},_0xd35a5f);console[_0x4c6d3f(0x148)](_0x158a83);}}return 0x0;}async['listUnified'](_0x5f998f,_0x56f303){const _0x1366e1=a45_0x5f14a8,{options:_0x12062e,tdx:_0x134b7a}=_0x5f998f,_0x49e567=await withSpinner(_0x1366e1(0x123)+_0x56f303+'\x27...',()=>_0x134b7a[_0x1366e1(0x14b)][_0x1366e1(0x15f)](_0x56f303),{'verbose':_0x12062e[_0x1366e1(0x136)]}),_0x38460d=_0x49e567['data'];_0x12062e[_0x1366e1(0x136)]&&(console['error'](_0x1366e1(0x143)+_0x38460d['parentId']),_0x38460d[_0x1366e1(0x151)]&&console[_0x1366e1(0x15b)]('Folder\x20ID:\x20'+_0x38460d[_0x1366e1(0x151)]));const _0x406950=await withSpinner(_0x1366e1(0x15a),()=>_0x134b7a[_0x1366e1(0x14b)][_0x1366e1(0x14c)](_0x38460d[_0x1366e1(0x156)],_0x38460d['folderId']),{'verbose':_0x12062e[_0x1366e1(0x136)]}),{folders:_0x344c20,segments:_0x524875,journeys:_0x50b4f6}=_0x406950[_0x1366e1(0x138)],_0x4463c9=_0x344c20[_0x1366e1(0x13f)]+_0x524875[_0x1366e1(0x13f)]+_0x50b4f6['length'];console[_0x1366e1(0x15b)](_0x1366e1(0x14e)+_0x344c20['length']+'\x20folder'+(_0x344c20[_0x1366e1(0x13f)]!==0x1?'s':'')+',\x20'+_0x524875[_0x1366e1(0x13f)]+_0x1366e1(0x137)+(_0x524875[_0x1366e1(0x13f)]!==0x1?'s':'')+_0x1366e1(0x14d)+_0x50b4f6[_0x1366e1(0x13f)]+'\x20journey'+(_0x50b4f6['length']!==0x1?'s':''));const _0x1c2d08=_0x5624ab=>{const _0x5eab66=_0x1366e1;return getConsoleNextUrl(_0x12062e['site'],'/app/ps/'+_0x38460d[_0x5eab66(0x156)]+_0x5eab66(0x142)+_0x5624ab);},_0x19c54a=_0x30f13b=>{const _0x57e173=_0x1366e1;return getConsoleNextUrl(_0x12062e[_0x57e173(0x162)],_0x57e173(0x14a)+_0x38460d[_0x57e173(0x156)]+_0x57e173(0x142)+_0x30f13b+_0x57e173(0x131));},_0x2a20eb=_0x12062e[_0x1366e1(0x140)]==='json'||_0x12062e[_0x1366e1(0x140)]===_0x1366e1(0x12b);if(_0x2a20eb){const _0x321e4c=[..._0x344c20[_0x1366e1(0x15c)](_0x3988a6=>({..._0x3988a6,'type':_0x1366e1(0x127)})),..._0x524875[_0x1366e1(0x15c)](_0x53c644=>({..._0x53c644,'type':_0x1366e1(0x14b),'url':_0x1c2d08(_0x53c644['id'])})),..._0x50b4f6[_0x1366e1(0x15c)](_0x180801=>({..._0x180801,'name':_0x180801[_0x1366e1(0x11e)],'type':'journey','url':_0x19c54a(_0x180801['id'])}))][_0x1366e1(0x122)]((_0xf36f5f,_0x3f0021)=>_0xf36f5f['name']['localeCompare'](_0x3f0021[_0x1366e1(0x149)]));await handleSDKOutput(_0x321e4c,_0x12062e);}else{if(_0x4463c9===0x0)console[_0x1366e1(0x148)](a45_0x493241[_0x1366e1(0x124)]('['+_0x56f303+']')),console[_0x1366e1(0x148)](_0x1366e1(0x164));else{console[_0x1366e1(0x148)](a45_0x493241[_0x1366e1(0x124)]('['+_0x56f303+']'));const _0x4b23f9=formatFlatList(_0x344c20,_0x524875,{'showMetadata':!![],'getSegmentUrl':_0x1c2d08,'getJourneyUrl':_0x19c54a},_0x50b4f6);console['log'](_0x4b23f9);}}return 0x0;}async[a45_0x5f14a8(0x11d)](_0x55dced,_0x573d3f){const _0x11eb38=a45_0x5f14a8,{options:_0x3d2308,tdx:_0x11c7be}=_0x55dced,_0x4127de=await withSpinner(_0x11eb38(0x123)+_0x573d3f+_0x11eb38(0x12c),()=>_0x11c7be[_0x11eb38(0x14b)][_0x11eb38(0x15f)](_0x573d3f),{'verbose':_0x3d2308[_0x11eb38(0x136)]}),_0x52b1eb=_0x4127de['data'];_0x3d2308[_0x11eb38(0x136)]&&(console['error'](_0x11eb38(0x143)+_0x52b1eb[_0x11eb38(0x156)]),_0x52b1eb[_0x11eb38(0x151)]&&console[_0x11eb38(0x15b)](_0x11eb38(0x11c)+_0x52b1eb['folderId']));const _0x34cc60=_0x3d2308[_0x11eb38(0x121)]||0xa,_0x4968c4=await withSpinner(_0x11eb38(0x150),()=>_0x11c7be[_0x11eb38(0x14b)][_0x11eb38(0x11d)](_0x52b1eb[_0x11eb38(0x156)],_0x52b1eb[_0x11eb38(0x151)],0x0,_0x34cc60),{'verbose':_0x3d2308[_0x11eb38(0x136)]}),_0x3875c0=_0x4968c4[_0x11eb38(0x138)],_0x31e6c4=_0x4de07d=>{const _0x32eac4=_0x11eb38;let _0x3569d4=0x0,_0x263fda=0x0,_0x139699=0x0;for(const _0x4e595c of _0x4de07d){if(_0x4e595c[_0x32eac4(0x147)]===_0x32eac4(0x127))_0x3569d4++;else{if(_0x4e595c[_0x32eac4(0x147)]===_0x32eac4(0x14b))_0x263fda++;else{if(_0x4e595c['type']===_0x32eac4(0x157))_0x139699++;}}if(_0x4e595c[_0x32eac4(0x13c)]){const _0x25e0e2=_0x31e6c4(_0x4e595c[_0x32eac4(0x13c)]);_0x3569d4+=_0x25e0e2['folders'],_0x263fda+=_0x25e0e2[_0x32eac4(0x154)],_0x139699+=_0x25e0e2['journeys'];}}return{'folders':_0x3569d4,'segments':_0x263fda,'journeys':_0x139699};},_0x4d1a0f=_0x31e6c4(_0x3875c0);console['error'](_0x11eb38(0x125)+_0x4d1a0f[_0x11eb38(0x15e)]+'\x20folder'+(_0x4d1a0f['folders']!==0x1?'s':'')+',\x20'+_0x4d1a0f[_0x11eb38(0x154)]+_0x11eb38(0x137)+(_0x4d1a0f[_0x11eb38(0x154)]!==0x1?'s':'')+_0x11eb38(0x14d)+_0x4d1a0f['journeys']+_0x11eb38(0x139)+(_0x4d1a0f[_0x11eb38(0x13b)]!==0x1?'s':''));const _0xb21db=_0x54270d=>{const _0x50fdf4=_0x11eb38;return getConsoleNextUrl(_0x3d2308['site'],_0x50fdf4(0x14a)+_0x52b1eb[_0x50fdf4(0x156)]+_0x50fdf4(0x142)+_0x54270d);},_0x186672=_0x4d1555=>{const _0x10bc7a=_0x11eb38;return getConsoleNextUrl(_0x3d2308[_0x10bc7a(0x162)],_0x10bc7a(0x14a)+_0x52b1eb[_0x10bc7a(0x156)]+_0x10bc7a(0x142)+_0x4d1555+_0x10bc7a(0x131));};if(_0x3d2308[_0x11eb38(0x140)]===_0x11eb38(0x144)||_0x3d2308[_0x11eb38(0x140)]===_0x11eb38(0x12b))await handleSDKOutput(_0x3875c0,_0x3d2308);else{console[_0x11eb38(0x148)](a45_0x493241[_0x11eb38(0x124)]('['+_0x573d3f+']'));const _0x367e98=formatTree(_0x3875c0,{'showMetadata':!![],'getSegmentUrl':_0xb21db,'getJourneyUrl':_0x186672});console[_0x11eb38(0x148)](_0x367e98);}return 0x0;}}function a45_0x39c0(){const _0x57a0ab=[']\x20matching\x20\x27','(empty)','1674926pIFKDU','Error:\x20','Resolving\x20parent\x20segment\x20\x27','546UrtOBp','execute','Folder\x20ID:\x20','listRecursive','journeyBundleName','964rglSEU','listWithPattern','maxDepth','sort','Resolving\x20path\x20\x27','dim','✔\x20Built\x20tree\x20with\x20','Parent\x20segment\x20context:\x20','folder','localeCompare','7xENdVF','352346NzlNIw','jsonl','\x27...','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','filter','replace','46697hEtBtW','/j/da','Site:\x20','includes','Folder/pattern\x20arg:\x20','cause','verbose','\x20segment','data','\x20journey','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','journeys','children','6495470lZtNlK','1338zBmIHa','length','format','parentSegment','/e/','Parent\x20ID:\x20','json','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','789000cuYZJN','type','log','name','/app/ps/','segment','listUnifiedWithJourneys',',\x20and\x20','✔\x20Found\x20','description','Building\x20hierarchy\x20tree...','folderId','80aVmCut','16335tVialV','segments','15642HNRhEE','parentId','journey','test','message','Listing\x20folders,\x20segments,\x20and\x20journeys...','error','map','(not\x20set)','folders','resolvePathToResource','2648nEveeN','\x20matching\x20\x27','site'];a45_0x39c0=function(){return _0x57a0ab;};return a45_0x39c0();}
1
+ function a45_0x32ec(){const _0x1c2a10=['8886MuvIPQ','listUnifiedWithJourneys','message','json','/app/ps/','5531022pETzWw','folderId','localeCompare','137331qBzxBs','/e/','748sTPCah','resolvePathToResource','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','journeyBundleName','List\x20folders\x20and\x20child\x20segments','replace','Set\x20a\x20parent\x20segment\x20context\x20first:','Recursive\x20mode:\x20enabled','Parent\x20segment\x20context:\x20',']\x20matching\x20\x27','map','Listing\x20folders,\x20segments,\x20and\x20journeys...','listWithPattern','journeys','children','test','Resolving\x20parent\x20segment\x20\x27',',\x20and\x20','\x20segment','description','log','9639270rdQsRD','error','✔\x20Found\x20','Error:\x20','6jduqvS','2720855JbzldT','\x27...','4741704TWARZd','format','sort','dim','length','cause','parentSegment','jsonl','site','Folder/pattern\x20arg:\x20','segment','\x20matching\x20\x27','Resolving\x20path\x20\x27','data','Error:\x20No\x20parent\x20segment\x20context\x20set.','execute','segments','recursive','maxDepth','listRecursive','verbose','filter','type','462RDUyEd','\x20journey','3442UkxvOr','journey','Parent\x20ID:\x20','\x20folder','folders','includes','folder','name','Site:\x20','parentId','\x20\x20Cause:\x20'];a45_0x32ec=function(){return _0x1c2a10;};return a45_0x32ec();}const a45_0x374e91=a45_0x1b71;(function(_0x34a3d2,_0x2ab3db){const _0x58450f=a45_0x1b71,_0x228e86=_0x34a3d2();while(!![]){try{const _0x5da10f=parseInt(_0x58450f(0x10b))/0x1*(parseInt(_0x58450f(0x109))/0x2)+-parseInt(_0x58450f(0xcc))/0x3*(-parseInt(_0x58450f(0xd6))/0x4)+parseInt(_0x58450f(0xf0))/0x5*(-parseInt(_0x58450f(0xef))/0x6)+-parseInt(_0x58450f(0xd1))/0x7+-parseInt(_0x58450f(0xf2))/0x8+parseInt(_0x58450f(0xd4))/0x9+parseInt(_0x58450f(0xeb))/0xa;if(_0x5da10f===_0x2ab3db)break;else _0x228e86['push'](_0x228e86['shift']());}catch(_0x5cb1fa){_0x228e86['push'](_0x228e86['shift']());}}}(a45_0x32ec,0x61f00));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a45_0x1b71(_0x10edf4,_0x184ad9){_0x10edf4=_0x10edf4-0xc4;const _0x32eca0=a45_0x32ec();let _0x1b7107=_0x32eca0[_0x10edf4];return _0x1b7107;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x1d873d from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x374e91(0xc8)]=a45_0x374e91(0x102);[a45_0x374e91(0xe9)]=a45_0x374e91(0xda);async[a45_0x374e91(0x101)](_0xc37159){const _0x4e7658=a45_0x374e91,{options:_0x55e8d9,args:_0x544c36}=_0xc37159,_0x19a776=_0x55e8d9[_0x4e7658(0x103)],_0x44421c=_0x544c36[0x0];try{const _0x338966=_0x55e8d9[_0x4e7658(0xf8)];_0x55e8d9[_0x4e7658(0x106)]&&(console[_0x4e7658(0xec)](_0x4e7658(0xc9)+_0x55e8d9[_0x4e7658(0xfa)]),console[_0x4e7658(0xec)](_0x4e7658(0xde)+(_0x338966||'(not\x20set)')),_0x44421c&&console['error'](_0x4e7658(0xfb)+_0x44421c),_0x19a776&&console[_0x4e7658(0xec)](_0x4e7658(0xdd)));if(!_0x338966)return console[_0x4e7658(0xec)](_0x4e7658(0x100)),console[_0x4e7658(0xec)](''),console[_0x4e7658(0xec)](_0x4e7658(0xdc)),console[_0x4e7658(0xec)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x4e7658(0xec)](_0x4e7658(0xd8)),console[_0x4e7658(0xec)](''),console['error']('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x22c396=_0x44421c&&(_0x44421c['includes']('*')||_0x44421c[_0x4e7658(0xc6)]('?'));if(_0x22c396)return await this[_0x4e7658(0xe2)](_0xc37159,_0x338966,_0x44421c);const _0x1e8091=_0x44421c?_0x338966+'/'+_0x44421c:_0x338966;return _0x19a776?await this[_0x4e7658(0x105)](_0xc37159,_0x1e8091):await this['listUnified'](_0xc37159,_0x1e8091);}catch(_0x5d87ea){if(_0x5d87ea instanceof SDKError)return console[_0x4e7658(0xec)](_0x4e7658(0xee)+_0x5d87ea[_0x4e7658(0xce)]),_0x5d87ea[_0x4e7658(0xf7)]&&console[_0x4e7658(0xec)](_0x4e7658(0xcb)+_0x5d87ea[_0x4e7658(0xf7)]),0x1;throw _0x5d87ea;}}async[a45_0x374e91(0xe2)](_0x5bfe4e,_0x6360b2,_0xd81ddb){const _0x5ac7ff=a45_0x374e91,{options:_0x315763,tdx:_0x33cad5}=_0x5bfe4e,_0x1ccac7=await withSpinner(_0x5ac7ff(0xe6)+_0x6360b2+_0x5ac7ff(0xf1),()=>_0x33cad5[_0x5ac7ff(0xfc)]['resolvePathToResource'](_0x6360b2),{'verbose':_0x315763[_0x5ac7ff(0x106)]}),_0x56f18e=_0x1ccac7[_0x5ac7ff(0xff)],_0x3d1d94=await withSpinner(_0x5ac7ff(0xe1),()=>_0x33cad5['segment']['listUnifiedWithJourneys'](_0x56f18e['parentId'],_0x56f18e['folderId']),{'verbose':_0x315763[_0x5ac7ff(0x106)]}),{folders:_0x55aab8,segments:_0x343ed9,journeys:_0x49adf4}=_0x3d1d94[_0x5ac7ff(0xff)],_0x45e440=_0xd81ddb['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x5ac7ff(0xdb)](/\*/g,'.*')[_0x5ac7ff(0xdb)](/\?/g,'.'),_0x33512b=new RegExp('^'+_0x45e440+'$','i'),_0x2d6840=_0x55aab8[_0x5ac7ff(0x107)](_0xb62c=>_0x33512b[_0x5ac7ff(0xe5)](_0xb62c[_0x5ac7ff(0xc8)])),_0x4cb760=_0x343ed9[_0x5ac7ff(0x107)](_0x161d69=>_0x33512b[_0x5ac7ff(0xe5)](_0x161d69[_0x5ac7ff(0xc8)])),_0x1a9b73=_0x49adf4['filter'](_0x195e11=>_0x33512b[_0x5ac7ff(0xe5)](_0x195e11[_0x5ac7ff(0xd9)])),_0x275795=_0x2d6840[_0x5ac7ff(0xf6)]+_0x4cb760[_0x5ac7ff(0xf6)]+_0x1a9b73[_0x5ac7ff(0xf6)];console[_0x5ac7ff(0xec)](_0x5ac7ff(0xed)+_0x2d6840[_0x5ac7ff(0xf6)]+'\x20folder'+(_0x2d6840[_0x5ac7ff(0xf6)]!==0x1?'s':'')+',\x20'+_0x4cb760[_0x5ac7ff(0xf6)]+_0x5ac7ff(0xe8)+(_0x4cb760[_0x5ac7ff(0xf6)]!==0x1?'s':'')+_0x5ac7ff(0xe7)+_0x1a9b73['length']+'\x20journey'+(_0x1a9b73[_0x5ac7ff(0xf6)]!==0x1?'s':'')+_0x5ac7ff(0xfd)+_0xd81ddb+'\x27');const _0x438e25=_0xf8a768=>{const _0x37e8d5=_0x5ac7ff;return getConsoleNextUrl(_0x315763['site'],_0x37e8d5(0xd0)+_0x56f18e['parentId']+_0x37e8d5(0xd5)+_0xf8a768);},_0x22cbf5=_0x315763['format']==='json'||_0x315763[_0x5ac7ff(0xf3)]===_0x5ac7ff(0xf9);if(_0x22cbf5){const _0x363fb7=[..._0x2d6840['map'](_0x5ecefa=>({..._0x5ecefa,'type':_0x5ac7ff(0xc7)})),..._0x4cb760[_0x5ac7ff(0xe0)](_0x26f044=>({..._0x26f044,'type':_0x5ac7ff(0xfc),'url':_0x438e25(_0x26f044['id'])})),..._0x1a9b73[_0x5ac7ff(0xe0)](_0x2fec1b=>({..._0x2fec1b,'name':_0x2fec1b[_0x5ac7ff(0xd9)],'type':_0x5ac7ff(0x10c)}))][_0x5ac7ff(0xf4)]((_0x34bce0,_0xe86227)=>_0x34bce0[_0x5ac7ff(0xc8)][_0x5ac7ff(0xd3)](_0xe86227[_0x5ac7ff(0xc8)]));await handleSDKOutput(_0x363fb7,_0x315763);}else{if(_0x275795===0x0)console[_0x5ac7ff(0xea)]('No\x20items\x20match\x20pattern:\x20'+_0xd81ddb);else{console[_0x5ac7ff(0xea)](a45_0x1d873d['dim']('['+_0x6360b2+_0x5ac7ff(0xdf)+_0xd81ddb+'\x27'));const _0x499b18=formatFlatList(_0x2d6840,_0x4cb760,{'showMetadata':!![],'getSegmentUrl':_0x438e25},_0x1a9b73);console[_0x5ac7ff(0xea)](_0x499b18);}}return 0x0;}async['listUnified'](_0x42df08,_0x1cebeb){const _0x4a2c57=a45_0x374e91,{options:_0x54600e,tdx:_0x38674c}=_0x42df08,_0x5ee1c5=await withSpinner(_0x4a2c57(0xfe)+_0x1cebeb+_0x4a2c57(0xf1),()=>_0x38674c[_0x4a2c57(0xfc)]['resolvePathToResource'](_0x1cebeb),{'verbose':_0x54600e[_0x4a2c57(0x106)]}),_0x52e22b=_0x5ee1c5[_0x4a2c57(0xff)];_0x54600e['verbose']&&(console['error'](_0x4a2c57(0x10d)+_0x52e22b[_0x4a2c57(0xca)]),_0x52e22b[_0x4a2c57(0xd2)]&&console[_0x4a2c57(0xec)]('Folder\x20ID:\x20'+_0x52e22b['folderId']));const _0x20f46f=await withSpinner(_0x4a2c57(0xe1),()=>_0x38674c['segment'][_0x4a2c57(0xcd)](_0x52e22b['parentId'],_0x52e22b[_0x4a2c57(0xd2)]),{'verbose':_0x54600e[_0x4a2c57(0x106)]}),{folders:_0x371c45,segments:_0x1e1032,journeys:_0x274958}=_0x20f46f[_0x4a2c57(0xff)],_0x134823=_0x371c45['length']+_0x1e1032['length']+_0x274958[_0x4a2c57(0xf6)];console[_0x4a2c57(0xec)](_0x4a2c57(0xed)+_0x371c45[_0x4a2c57(0xf6)]+_0x4a2c57(0xc4)+(_0x371c45[_0x4a2c57(0xf6)]!==0x1?'s':'')+',\x20'+_0x1e1032[_0x4a2c57(0xf6)]+_0x4a2c57(0xe8)+(_0x1e1032[_0x4a2c57(0xf6)]!==0x1?'s':'')+_0x4a2c57(0xe7)+_0x274958[_0x4a2c57(0xf6)]+_0x4a2c57(0x10a)+(_0x274958[_0x4a2c57(0xf6)]!==0x1?'s':''));const _0x676cab=_0x17c395=>{const _0x58fefc=_0x4a2c57;return getConsoleNextUrl(_0x54600e[_0x58fefc(0xfa)],_0x58fefc(0xd0)+_0x52e22b[_0x58fefc(0xca)]+_0x58fefc(0xd5)+_0x17c395);},_0x2f49c1=_0x242f55=>{const _0x36d327=_0x4a2c57;return getConsoleNextUrl(_0x54600e[_0x36d327(0xfa)],_0x36d327(0xd0)+_0x52e22b[_0x36d327(0xca)]+_0x36d327(0xd5)+_0x242f55+'/j/da');},_0x4966b9=_0x54600e['format']==='json'||_0x54600e[_0x4a2c57(0xf3)]==='jsonl';if(_0x4966b9){const _0x4c8e0e=[..._0x371c45[_0x4a2c57(0xe0)](_0x3ca5b6=>({..._0x3ca5b6,'type':_0x4a2c57(0xc7)})),..._0x1e1032[_0x4a2c57(0xe0)](_0x1720ea=>({..._0x1720ea,'type':'segment','url':_0x676cab(_0x1720ea['id'])})),..._0x274958[_0x4a2c57(0xe0)](_0x2805d9=>({..._0x2805d9,'name':_0x2805d9[_0x4a2c57(0xd9)],'type':_0x4a2c57(0x10c),'url':_0x2f49c1(_0x2805d9['id'])}))]['sort']((_0x508b0e,_0x3a05bd)=>_0x508b0e[_0x4a2c57(0xc8)]['localeCompare'](_0x3a05bd[_0x4a2c57(0xc8)]));await handleSDKOutput(_0x4c8e0e,_0x54600e);}else{if(_0x134823===0x0)console[_0x4a2c57(0xea)](a45_0x1d873d[_0x4a2c57(0xf5)]('['+_0x1cebeb+']')),console['log']('(empty)');else{console[_0x4a2c57(0xea)](a45_0x1d873d['dim']('['+_0x1cebeb+']'));const _0x4826e6=formatFlatList(_0x371c45,_0x1e1032,{'showMetadata':!![],'getSegmentUrl':_0x676cab,'getJourneyUrl':_0x2f49c1},_0x274958);console[_0x4a2c57(0xea)](_0x4826e6);}}return 0x0;}async[a45_0x374e91(0x105)](_0x688731,_0x2a27d4){const _0x8aca81=a45_0x374e91,{options:_0x5f4cf8,tdx:_0x447cc3}=_0x688731,_0x3f5c99=await withSpinner(_0x8aca81(0xfe)+_0x2a27d4+'\x27...',()=>_0x447cc3[_0x8aca81(0xfc)][_0x8aca81(0xd7)](_0x2a27d4),{'verbose':_0x5f4cf8[_0x8aca81(0x106)]}),_0x53b1af=_0x3f5c99['data'];_0x5f4cf8[_0x8aca81(0x106)]&&(console[_0x8aca81(0xec)](_0x8aca81(0x10d)+_0x53b1af[_0x8aca81(0xca)]),_0x53b1af[_0x8aca81(0xd2)]&&console['error']('Folder\x20ID:\x20'+_0x53b1af[_0x8aca81(0xd2)]));const _0x3df623=_0x5f4cf8[_0x8aca81(0x104)]||0xa,_0x482976=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x447cc3[_0x8aca81(0xfc)][_0x8aca81(0x105)](_0x53b1af['parentId'],_0x53b1af['folderId'],0x0,_0x3df623),{'verbose':_0x5f4cf8[_0x8aca81(0x106)]}),_0x569f65=_0x482976['data'],_0x124e81=_0x1e4e8a=>{const _0x4f1f94=_0x8aca81;let _0x5c0f5c=0x0,_0xec8c34=0x0,_0xdccc2b=0x0;for(const _0x5b22f7 of _0x1e4e8a){if(_0x5b22f7[_0x4f1f94(0x108)]===_0x4f1f94(0xc7))_0x5c0f5c++;else{if(_0x5b22f7[_0x4f1f94(0x108)]===_0x4f1f94(0xfc))_0xec8c34++;else{if(_0x5b22f7[_0x4f1f94(0x108)]===_0x4f1f94(0x10c))_0xdccc2b++;}}if(_0x5b22f7['children']){const _0x591f88=_0x124e81(_0x5b22f7[_0x4f1f94(0xe4)]);_0x5c0f5c+=_0x591f88[_0x4f1f94(0xc5)],_0xec8c34+=_0x591f88[_0x4f1f94(0x102)],_0xdccc2b+=_0x591f88['journeys'];}}return{'folders':_0x5c0f5c,'segments':_0xec8c34,'journeys':_0xdccc2b};},_0x15c6f9=_0x124e81(_0x569f65);console[_0x8aca81(0xec)]('✔\x20Built\x20tree\x20with\x20'+_0x15c6f9[_0x8aca81(0xc5)]+'\x20folder'+(_0x15c6f9[_0x8aca81(0xc5)]!==0x1?'s':'')+',\x20'+_0x15c6f9[_0x8aca81(0x102)]+_0x8aca81(0xe8)+(_0x15c6f9[_0x8aca81(0x102)]!==0x1?'s':'')+_0x8aca81(0xe7)+_0x15c6f9[_0x8aca81(0xe3)]+_0x8aca81(0x10a)+(_0x15c6f9[_0x8aca81(0xe3)]!==0x1?'s':''));const _0xfd6016=_0x2455f0=>{const _0x5a7d33=_0x8aca81;return getConsoleNextUrl(_0x5f4cf8[_0x5a7d33(0xfa)],'/app/ps/'+_0x53b1af[_0x5a7d33(0xca)]+_0x5a7d33(0xd5)+_0x2455f0);},_0x2ffde8=_0x55866d=>{const _0x245591=_0x8aca81;return getConsoleNextUrl(_0x5f4cf8[_0x245591(0xfa)],_0x245591(0xd0)+_0x53b1af['parentId']+_0x245591(0xd5)+_0x55866d+'/j/da');};if(_0x5f4cf8[_0x8aca81(0xf3)]===_0x8aca81(0xcf)||_0x5f4cf8[_0x8aca81(0xf3)]===_0x8aca81(0xf9))await handleSDKOutput(_0x569f65,_0x5f4cf8);else{console[_0x8aca81(0xea)](a45_0x1d873d[_0x8aca81(0xf5)]('['+_0x2a27d4+']'));const _0x2d26a5=formatTree(_0x569f65,{'showMetadata':!![],'getSegmentUrl':_0xfd6016,'getJourneyUrl':_0x2ffde8});console['log'](_0x2d26a5);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x29eafe=a46_0x8a53;(function(_0x2a619b,_0x32317d){const _0x2dbf9c=a46_0x8a53,_0x25f0d1=_0x2a619b();while(!![]){try{const _0x76441b=parseInt(_0x2dbf9c(0x1fe))/0x1*(-parseInt(_0x2dbf9c(0x1f5))/0x2)+-parseInt(_0x2dbf9c(0x208))/0x3+-parseInt(_0x2dbf9c(0x212))/0x4*(parseInt(_0x2dbf9c(0x209))/0x5)+-parseInt(_0x2dbf9c(0x206))/0x6+parseInt(_0x2dbf9c(0x1ea))/0x7*(parseInt(_0x2dbf9c(0x1f9))/0x8)+-parseInt(_0x2dbf9c(0x20f))/0x9*(-parseInt(_0x2dbf9c(0x1f6))/0xa)+-parseInt(_0x2dbf9c(0x1ed))/0xb*(-parseInt(_0x2dbf9c(0x20c))/0xc);if(_0x76441b===_0x32317d)break;else _0x25f0d1['push'](_0x25f0d1['shift']());}catch(_0x250844){_0x25f0d1['push'](_0x25f0d1['shift']());}}}(a46_0x15dc,0x27946));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';import{withSpinner}from'../utils/spinner.js';function a46_0x8a53(_0x3ff8bd,_0x1c3372){_0x3ff8bd=_0x3ff8bd-0x1e5;const _0x15dcd3=a46_0x15dc();let _0x8a5334=_0x15dcd3[_0x3ff8bd];return _0x8a5334;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a46_0x15dc(){const _0x4d2108=['Error:\x20','853530nTwBLg','Database:\x20','540330NBHvaU','55355zgEFsk','Limit:\x20','name','156CyUyLx','verbose','Catalog:\x20','212661uZrtMK','cause','site','4hBzPEY','Site:\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','\x20\x20Cause:\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Table:\x20','84euwdDi','showTable','length','533093EZwJJx','data','...','catalog','Show\x20table\x20contents','database','error','query','18770ElMTvT','20kQgQsd','table','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','72808yEXufu','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Usage:\x20tdx\x20show\x20<database.table>','message','args','31qEHyIY','execute','\x20row','limit','Querying\x20','description','validate'];a46_0x15dc=function(){return _0x4d2108;};return a46_0x15dc();}export class ShowCommand extends BaseCommand{[a46_0x29eafe(0x20b)]='show';[a46_0x29eafe(0x203)]=a46_0x29eafe(0x1f1);async[a46_0x29eafe(0x1ff)](_0x2b5906){const _0x2dfdff=a46_0x29eafe;return this[_0x2dfdff(0x1eb)](_0x2b5906);}async['showTable'](_0x77b0ba){const _0xe42f26=a46_0x29eafe,{options:_0x211d5b,args:_0x19b8cb,tdx:_0x53c96f}=_0x77b0ba;let _0x4c3479;try{_0x4c3479=parseTableReference(_0x19b8cb[0x0]);const _0x5ae6af=_0x211d5b[_0xe42f26(0x1f2)];!_0x4c3479[_0xe42f26(0x1f2)]&&_0x5ae6af&&(_0x4c3479[_0xe42f26(0x1f2)]=_0x5ae6af);const _0x2e4ae0=validateTableDescribeReference(_0x4c3479);if(_0x2e4ae0)return console['error']('Error:\x20'+_0x2e4ae0),console[_0xe42f26(0x1f3)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xe42f26(0x1f3)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0xe42f26(0x1f3)](_0xe42f26(0x1fa)),0x1;}catch(_0x3e07ff){return console['error'](_0xe42f26(0x205)+_0x3e07ff[_0xe42f26(0x1fc)]),console['error'](_0xe42f26(0x1fb)),console[_0xe42f26(0x1f3)](_0xe42f26(0x1f8)),console['error'](_0xe42f26(0x1fa)),0x1;}const _0x12149b=_0x4c3479[_0xe42f26(0x1f0)],_0x16528c=_0x4c3479[_0xe42f26(0x1f2)],_0x5f00de=_0x4c3479[_0xe42f26(0x1f7)],_0x28d4f4=resolveLimit(_0x211d5b[_0xe42f26(0x201)],DEFAULT_DISPLAY_LIMIT);try{_0x211d5b[_0xe42f26(0x20d)]&&(console[_0xe42f26(0x1f3)](_0xe42f26(0x1e5)+_0x211d5b[_0xe42f26(0x211)]),_0x12149b&&console[_0xe42f26(0x1f3)](_0xe42f26(0x20e)+_0x12149b),console[_0xe42f26(0x1f3)](_0xe42f26(0x207)+_0x16528c),console[_0xe42f26(0x1f3)](_0xe42f26(0x1e9)+_0x5f00de),console['error'](_0xe42f26(0x20a)+_0x28d4f4));const _0x2ece19=_0x12149b?_0x12149b+'.'+_0x16528c+'.'+_0x5f00de:_0x16528c+'.'+_0x5f00de,_0xbc8a6c=await withSpinner(_0xe42f26(0x202)+_0x2ece19+_0xe42f26(0x1ef),()=>_0x53c96f[_0xe42f26(0x1f4)][_0xe42f26(0x1eb)](_0x16528c,_0x5f00de,_0x28d4f4,_0x12149b),{'verbose':_0x211d5b['verbose']}),_0xcd603a=_0xbc8a6c[_0xe42f26(0x1ee)],_0x5eeea3=_0xcd603a[_0xe42f26(0x1ee)];return _0x5eeea3[_0xe42f26(0x1ec)]===0x0?console[_0xe42f26(0x1f3)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console['error']('✔\x20Retrieved\x20'+_0x5eeea3['length']+_0xe42f26(0x200)+(_0x5eeea3[_0xe42f26(0x1ec)]!==0x1?'s':'')+'\x20from\x20'+_0x2ece19),await handleSDKOutput(_0x5eeea3,_0x211d5b),0x0;}catch(_0x39cf1e){if(_0x39cf1e instanceof SDKError)return console[_0xe42f26(0x1f3)](_0xe42f26(0x205)+_0x39cf1e[_0xe42f26(0x1fc)]),_0x39cf1e[_0xe42f26(0x210)]&&console[_0xe42f26(0x1f3)](_0xe42f26(0x1e7)+_0x39cf1e[_0xe42f26(0x210)]),0x1;throw _0x39cf1e;}}[a46_0x29eafe(0x204)](_0x3fc607){const _0x169548=a46_0x29eafe;if(_0x3fc607[_0x169548(0x1fd)][_0x169548(0x1ec)]===0x0)return _0x169548(0x1e6);if(_0x3fc607['args'][_0x169548(0x1ec)]>0x1)return _0x169548(0x1e8);return undefined;}}
1
+ const a46_0x410e6c=a46_0x3e71;(function(_0x306d87,_0x28de7f){const _0x4e0478=a46_0x3e71,_0x1091c9=_0x306d87();while(!![]){try{const _0x3efba5=parseInt(_0x4e0478(0xbd))/0x1*(-parseInt(_0x4e0478(0xb9))/0x2)+parseInt(_0x4e0478(0xc1))/0x3*(-parseInt(_0x4e0478(0xa8))/0x4)+-parseInt(_0x4e0478(0xc5))/0x5+parseInt(_0x4e0478(0xad))/0x6*(parseInt(_0x4e0478(0xc7))/0x7)+-parseInt(_0x4e0478(0xbe))/0x8+-parseInt(_0x4e0478(0xba))/0x9*(-parseInt(_0x4e0478(0xb4))/0xa)+parseInt(_0x4e0478(0xcd))/0xb*(parseInt(_0x4e0478(0xae))/0xc);if(_0x3efba5===_0x28de7f)break;else _0x1091c9['push'](_0x1091c9['shift']());}catch(_0x20a2ee){_0x1091c9['push'](_0x1091c9['shift']());}}}(a46_0x2ca5,0xdf263));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x3e71(_0x1f7280,_0x1252da){_0x1f7280=_0x1f7280-0xa8;const _0x2ca5b3=a46_0x2ca5();let _0x3e7101=_0x2ca5b3[_0x1f7280];return _0x3e7101;}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a46_0x2ca5(){const _0x4bc8fe=['description','Site:\x20','10nGiLlm','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','name','\x20\x20Cause:\x20','...','5108bJUJDw','3214017LeUcHb','query','length','26dHIsBA','1395616oZlaSY','execute','Error:\x20','2362047ogiKDl','\x20row','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','5254105Akqzje','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','10297TChagw','showTable','args','data','Database:\x20','✔\x20Retrieved\x20','473SLIDsh','error','validate','cause','Querying\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','4VoqRti','site','verbose','\x20from\x20','show','2802tZxApE','543900raWSEB','database','message','catalog'];a46_0x2ca5=function(){return _0x4bc8fe;};return a46_0x2ca5();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x410e6c(0xb6)]=a46_0x410e6c(0xac);[a46_0x410e6c(0xb2)]='Show\x20table\x20contents';async[a46_0x410e6c(0xbf)](_0x5d4595){const _0x3936a0=a46_0x410e6c;return this[_0x3936a0(0xc8)](_0x5d4595);}async[a46_0x410e6c(0xc8)](_0x57df78){const _0x3ff717=a46_0x410e6c,{options:_0x48b509,args:_0x5c4d09,tdx:_0x476a49}=_0x57df78;let _0x5735cd;try{_0x5735cd=parseTableReference(_0x5c4d09[0x0]);const _0x1aa0da=_0x48b509[_0x3ff717(0xaf)];!_0x5735cd[_0x3ff717(0xaf)]&&_0x1aa0da&&(_0x5735cd['database']=_0x1aa0da);const _0x3b8428=validateTableDescribeReference(_0x5735cd);if(_0x3b8428)return console[_0x3ff717(0xce)]('Error:\x20'+_0x3b8428),console[_0x3ff717(0xce)](_0x3ff717(0xc3)),console[_0x3ff717(0xce)](_0x3ff717(0xc4)),console[_0x3ff717(0xce)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0xa3e906){return console[_0x3ff717(0xce)](_0x3ff717(0xc0)+_0xa3e906['message']),console['error'](_0x3ff717(0xc3)),console['error'](_0x3ff717(0xc4)),console['error'](_0x3ff717(0xb5)),0x1;}const _0x5755a2=_0x5735cd[_0x3ff717(0xb1)],_0x940d99=_0x5735cd[_0x3ff717(0xaf)],_0x15d3aa=_0x5735cd['table'],_0x4f008c=resolveLimit(_0x48b509['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x48b509[_0x3ff717(0xaa)]&&(console['error'](_0x3ff717(0xb3)+_0x48b509[_0x3ff717(0xa9)]),_0x5755a2&&console[_0x3ff717(0xce)]('Catalog:\x20'+_0x5755a2),console['error'](_0x3ff717(0xcb)+_0x940d99),console[_0x3ff717(0xce)]('Table:\x20'+_0x15d3aa),console[_0x3ff717(0xce)]('Limit:\x20'+_0x4f008c));const _0x3946b6=_0x5755a2?_0x5755a2+'.'+_0x940d99+'.'+_0x15d3aa:_0x940d99+'.'+_0x15d3aa,_0x2b3415=await withSpinner(_0x3ff717(0xd1)+_0x3946b6+_0x3ff717(0xb8),()=>_0x476a49[_0x3ff717(0xbb)]['showTable'](_0x940d99,_0x15d3aa,_0x4f008c,_0x5755a2),{'verbose':_0x48b509[_0x3ff717(0xaa)]}),_0x2159a2=_0x2b3415['data'],_0x16e5cb=_0x2159a2[_0x3ff717(0xca)];return _0x16e5cb[_0x3ff717(0xbc)]===0x0?console[_0x3ff717(0xce)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console['error'](_0x3ff717(0xcc)+_0x16e5cb['length']+_0x3ff717(0xc2)+(_0x16e5cb[_0x3ff717(0xbc)]!==0x1?'s':'')+_0x3ff717(0xab)+_0x3946b6),await handleSDKOutput(_0x16e5cb,_0x48b509),0x0;}catch(_0x81a937){if(_0x81a937 instanceof SDKError)return console[_0x3ff717(0xce)](_0x3ff717(0xc0)+_0x81a937[_0x3ff717(0xb0)]),_0x81a937[_0x3ff717(0xd0)]&&console[_0x3ff717(0xce)](_0x3ff717(0xb7)+_0x81a937['cause']),0x1;throw _0x81a937;}}[a46_0x410e6c(0xcf)](_0x1cd7b1){const _0x5694c5=a46_0x410e6c;if(_0x1cd7b1['args'][_0x5694c5(0xbc)]===0x0)return _0x5694c5(0xc6);if(_0x1cd7b1[_0x5694c5(0xc9)][_0x5694c5(0xbc)]>0x1)return _0x5694c5(0xd2);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x1ea7fa=a47_0x27d3;(function(_0xd9bc1d,_0x39c873){const _0x3ef412=a47_0x27d3,_0x2a91c3=_0xd9bc1d();while(!![]){try{const _0x11aee3=-parseInt(_0x3ef412(0xf8))/0x1+-parseInt(_0x3ef412(0x115))/0x2+parseInt(_0x3ef412(0x102))/0x3+parseInt(_0x3ef412(0x110))/0x4+parseInt(_0x3ef412(0xfa))/0x5+-parseInt(_0x3ef412(0x101))/0x6*(parseInt(_0x3ef412(0x123))/0x7)+parseInt(_0x3ef412(0x116))/0x8;if(_0x11aee3===_0x39c873)break;else _0x2a91c3['push'](_0x2a91c3['shift']());}catch(_0x5c05fc){_0x2a91c3['push'](_0x2a91c3['shift']());}}}(a47_0x5660,0x6d7c6));import{BaseCommand,printAuthError}from'./command.js';function a47_0x5660(){const _0x2d36b6=['displayWithSources','700656JoItXK','green','1574870txJjve','jobs','Read\x20credential\x20from\x20','last_name','tdx','first_name','yellow','12xmvBdu','1883514SAZIrb','profile','\x20profile:\x20','User:','config','log','N/A','account_id','session','✓\x20Authentication\x20successful\x0a','Name:','site:\x20','getUserInfo','execute','3566488atjAcA','Show\x20authentication\x20status\x20and\x20current\x20context','cyan','No\x20credential\x20found','email','612010xlwgNz','1525304WldZFh','name','profileSource','cli','Credential\x20type:\x20','env','red','message','description','✗\x20Validation\x20failed:\x20','OAuth','dim','join','1994937bPLdul','bold','Account\x20ID:'];a47_0x5660=function(){return _0x2d36b6;};return a47_0x5660();}function a47_0x27d3(_0x40815e,_0xe65e23){_0x40815e=_0x40815e-0xf5;const _0x56606f=a47_0x5660();let _0x27d370=_0x56606f[_0x40815e];return _0x27d370;}import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x51c7e1 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1ea7fa(0x117)]='status';[a47_0x1ea7fa(0x11e)]=a47_0x1ea7fa(0x111);async[a47_0x1ea7fa(0x10f)](_0x2433f2){const _0xcf2b52=a47_0x1ea7fa,{options:_0xe10298,tdx:_0x10d844}=_0x2433f2,_0x48802f=_0xe10298['site'],_0xa3b7b6=new GlobalContext(_0xe10298),_0x2d9a73=_0xa3b7b6[_0xcf2b52(0x103)],_0x406635=_0xa3b7b6[_0xcf2b52(0x118)],_0x324df2=_0x406635===_0xcf2b52(0x119)?'CLI\x20flag':_0x406635==='session'?_0xcf2b52(0x10a):_0x406635===_0xcf2b52(0x11b)?'TDX_PROFILE\x20env':_0x406635===_0xcf2b52(0x106)?_0xcf2b52(0x106):null,_0x59b9b0=_0x2d9a73?a47_0x51c7e1['cyan'](_0x2d9a73):a47_0x51c7e1[_0xcf2b52(0x121)](_0xcf2b52(0x108)),_0x3f3a47=_0x324df2?'\x20'+a47_0x51c7e1[_0xcf2b52(0x121)]('(from\x20'+_0x324df2+')'):'';console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0xf5)](_0xcf2b52(0xfe))+_0xcf2b52(0x104)+_0x59b9b0+_0x3f3a47+'\x20'+a47_0x51c7e1['dim']('(')+_0xcf2b52(0x10d)+a47_0x51c7e1[_0xcf2b52(0x112)](_0x48802f)+a47_0x51c7e1[_0xcf2b52(0x121)](')'));const _0x462210=await getOAuthTokens(_0x2d9a73);if(_0x462210)console[_0xcf2b52(0x107)](_0xcf2b52(0x11a)+a47_0x51c7e1[_0xcf2b52(0x112)](_0xcf2b52(0x120)));else{const _0x246ea6=await resolveAPIKeyAsync(_0x48802f,_0x2d9a73);if(_0x246ea6){const {source:_0x39a9d4,isDeprecated:_0x18bb63}=_0x246ea6,_0x3a7f5e=_0xcf2b52(0xfc)+a47_0x51c7e1[_0xcf2b52(0x112)](_0x39a9d4);console['log'](_0x18bb63?a47_0x51c7e1[_0xcf2b52(0x100)](_0x3a7f5e):_0x3a7f5e);}else console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0x100)](_0xcf2b52(0x113)));}let _0x4ff258=![];try{const _0x35777d=await _0x10d844[_0xcf2b52(0xfb)][_0xcf2b52(0x10e)]();console['log'](a47_0x51c7e1[_0xcf2b52(0xf9)](_0xcf2b52(0x10b))),console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0xf5)](_0xcf2b52(0x105))+'\x20'+a47_0x51c7e1[_0xcf2b52(0x112)](_0x35777d[_0xcf2b52(0x114)]));if(_0x35777d[_0xcf2b52(0xff)]||_0x35777d[_0xcf2b52(0xfd)]){const _0x3a1ee3=[_0x35777d['first_name'],_0x35777d[_0xcf2b52(0xfd)]]['filter'](Boolean)[_0xcf2b52(0x122)]('\x20');console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0xf5)](_0xcf2b52(0x10c))+'\x20'+_0x3a1ee3);}_0x35777d[_0xcf2b52(0x109)]&&console[_0xcf2b52(0x107)](a47_0x51c7e1[_0xcf2b52(0xf5)](_0xcf2b52(0xf6))+'\x20'+a47_0x51c7e1[_0xcf2b52(0x100)](_0x35777d['account_id'])),_0x4ff258=!![];}catch(_0x1ac55f){_0x1ac55f instanceof HTTPClientError&&_0x1ac55f['status']===0x191?printAuthError(_0x1ac55f,!![],_0x2d9a73):console['error'](a47_0x51c7e1[_0xcf2b52(0x11c)](_0xcf2b52(0x11f)+(_0x1ac55f instanceof Error?_0x1ac55f[_0xcf2b52(0x11d)]:String(_0x1ac55f))));}return console[_0xcf2b52(0x107)](),_0xa3b7b6[_0xcf2b52(0xf7)](),_0x4ff258?0x0:0x1;}}
1
+ const a47_0x2bc8d7=a47_0x11d4;function a47_0x9d93(){const _0x1fc29d=['Credential\x20type:\x20','cli','site','green','log','session','tdx','env','yellow','message','bold','107274WpeNUP','Account\x20ID:','dim','filter','execute','cyan','700014ORxbkg','1213084KboWuP','(from\x20','14265666XGRhhf','144006EfKaVi','red','2721320MJzTOL','No\x20credential\x20found','error','status','displayWithSources','config','CLI\x20flag','742905sMpGwY','last_name','jobs','2SScmVA','User:','account_id','profile','description','Show\x20authentication\x20status\x20and\x20current\x20context','first_name','TDX_PROFILE\x20env','77usvAPK','Read\x20credential\x20from\x20','name','\x20profile:\x20'];a47_0x9d93=function(){return _0x1fc29d;};return a47_0x9d93();}function a47_0x11d4(_0x1c61a6,_0x58d3e){_0x1c61a6=_0x1c61a6-0x1c9;const _0x9d930c=a47_0x9d93();let _0x11d403=_0x9d930c[_0x1c61a6];return _0x11d403;}(function(_0x5ecb7f,_0x1dc25d){const _0x1365d5=a47_0x11d4,_0x5b3da4=_0x5ecb7f();while(!![]){try{const _0x3957d4=parseInt(_0x1365d5(0x1ce))/0x1*(-parseInt(_0x1365d5(0x1e5))/0x2)+-parseInt(_0x1365d5(0x1eb))/0x3+-parseInt(_0x1365d5(0x1ec))/0x4+-parseInt(_0x1365d5(0x1cb))/0x5+-parseInt(_0x1365d5(0x1ef))/0x6*(parseInt(_0x1365d5(0x1d6))/0x7)+-parseInt(_0x1365d5(0x1f1))/0x8+parseInt(_0x1365d5(0x1ee))/0x9;if(_0x3957d4===_0x1dc25d)break;else _0x5b3da4['push'](_0x5b3da4['shift']());}catch(_0x4680a2){_0x5b3da4['push'](_0x5b3da4['shift']());}}}(a47_0x9d93,0x2e012));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0xdba7f5 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x2bc8d7(0x1d8)]=a47_0x2bc8d7(0x1f4);[a47_0x2bc8d7(0x1d2)]=a47_0x2bc8d7(0x1d3);async[a47_0x2bc8d7(0x1e9)](_0x251498){const _0x2ea4cc=a47_0x2bc8d7,{options:_0xdbf336,tdx:_0x1dcef8}=_0x251498,_0x3c5f89=_0xdbf336[_0x2ea4cc(0x1dc)],_0x11d20c=new GlobalContext(_0xdbf336),_0x5bc574=_0x11d20c[_0x2ea4cc(0x1d1)],_0x5d905a=_0x11d20c['profileSource'],_0x3d5831=_0x5d905a===_0x2ea4cc(0x1db)?_0x2ea4cc(0x1ca):_0x5d905a===_0x2ea4cc(0x1df)?_0x2ea4cc(0x1df):_0x5d905a===_0x2ea4cc(0x1e1)?_0x2ea4cc(0x1d5):_0x5d905a===_0x2ea4cc(0x1c9)?_0x2ea4cc(0x1c9):null,_0xdd8242=_0x5bc574?a47_0xdba7f5[_0x2ea4cc(0x1ea)](_0x5bc574):a47_0xdba7f5[_0x2ea4cc(0x1e7)]('N/A'),_0x4e64de=_0x3d5831?'\x20'+a47_0xdba7f5['dim'](_0x2ea4cc(0x1ed)+_0x3d5831+')'):'';console[_0x2ea4cc(0x1de)](a47_0xdba7f5[_0x2ea4cc(0x1e4)](_0x2ea4cc(0x1e0))+_0x2ea4cc(0x1d9)+_0xdd8242+_0x4e64de+'\x20'+a47_0xdba7f5[_0x2ea4cc(0x1e7)]('(')+'site:\x20'+a47_0xdba7f5[_0x2ea4cc(0x1ea)](_0x3c5f89)+a47_0xdba7f5['dim'](')'));const _0x41c25f=await getOAuthTokens(_0x5bc574);if(_0x41c25f)console[_0x2ea4cc(0x1de)](_0x2ea4cc(0x1da)+a47_0xdba7f5[_0x2ea4cc(0x1ea)]('OAuth'));else{const _0x5128e4=await resolveAPIKeyAsync(_0x3c5f89,_0x5bc574);if(_0x5128e4){const {source:_0x57179d,isDeprecated:_0x2a1f11}=_0x5128e4,_0x3e9794=_0x2ea4cc(0x1d7)+a47_0xdba7f5[_0x2ea4cc(0x1ea)](_0x57179d);console['log'](_0x2a1f11?a47_0xdba7f5['yellow'](_0x3e9794):_0x3e9794);}else console['log'](a47_0xdba7f5[_0x2ea4cc(0x1e2)](_0x2ea4cc(0x1f2)));}let _0x411f24=![];try{const _0x5d1a0b=await _0x1dcef8[_0x2ea4cc(0x1cd)]['getUserInfo']();console[_0x2ea4cc(0x1de)](a47_0xdba7f5[_0x2ea4cc(0x1dd)]('✓\x20Authentication\x20successful\x0a')),console[_0x2ea4cc(0x1de)](a47_0xdba7f5['bold'](_0x2ea4cc(0x1cf))+'\x20'+a47_0xdba7f5[_0x2ea4cc(0x1ea)](_0x5d1a0b['email']));if(_0x5d1a0b['first_name']||_0x5d1a0b['last_name']){const _0x140cf3=[_0x5d1a0b[_0x2ea4cc(0x1d4)],_0x5d1a0b[_0x2ea4cc(0x1cc)]][_0x2ea4cc(0x1e8)](Boolean)['join']('\x20');console[_0x2ea4cc(0x1de)](a47_0xdba7f5[_0x2ea4cc(0x1e4)]('Name:')+'\x20'+_0x140cf3);}_0x5d1a0b[_0x2ea4cc(0x1d0)]&&console[_0x2ea4cc(0x1de)](a47_0xdba7f5[_0x2ea4cc(0x1e4)](_0x2ea4cc(0x1e6))+'\x20'+a47_0xdba7f5['yellow'](_0x5d1a0b[_0x2ea4cc(0x1d0)])),_0x411f24=!![];}catch(_0x3010ff){_0x3010ff instanceof HTTPClientError&&_0x3010ff[_0x2ea4cc(0x1f4)]===0x191?printAuthError(_0x3010ff,!![],_0x5bc574):console[_0x2ea4cc(0x1f3)](a47_0xdba7f5[_0x2ea4cc(0x1f0)]('✗\x20Validation\x20failed:\x20'+(_0x3010ff instanceof Error?_0x3010ff[_0x2ea4cc(0x1e3)]:String(_0x3010ff))));}return console[_0x2ea4cc(0x1de)](),_0x11d20c[_0x2ea4cc(0x1f5)](),_0x411f24?0x0:0x1;}}