@treasuredata/tdx 2026.3.33 → 2026.3.35

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 (253) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/auth-login-command.js +1 -1
  13. package/dist/commands/cas-command.js +1 -1
  14. package/dist/commands/cas-segment-command.js +1 -1
  15. package/dist/commands/chat-command.js +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-statusline-command.js +1 -1
  18. package/dist/commands/claude-usage-command.js +1 -1
  19. package/dist/commands/command.js +1 -1
  20. package/dist/commands/connection-command.js +1 -1
  21. package/dist/commands/databases.js +1 -1
  22. package/dist/commands/delivery-command.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-campaign-pull-command.js +1 -1
  25. package/dist/commands/engage-campaign-push-command.js +1 -1
  26. package/dist/commands/engage-campaign-validate-command.js +1 -1
  27. package/dist/commands/engage-command.js +1 -1
  28. package/dist/commands/engage-template-pull-command.js +1 -1
  29. package/dist/commands/engage-template-push-command.js +1 -1
  30. package/dist/commands/engage-template-validate-command.js +1 -1
  31. package/dist/commands/job-command.js +1 -1
  32. package/dist/commands/journey-command.js +1 -1
  33. package/dist/commands/journey-validate-command.js +1 -1
  34. package/dist/commands/llm-command.js +1 -1
  35. package/dist/commands/mcp-command.js +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/policy-command.js +1 -1
  38. package/dist/commands/profile-command.js +1 -1
  39. package/dist/commands/profiles-command.js +1 -1
  40. package/dist/commands/query-command.js +1 -1
  41. package/dist/commands/schedule-command.js +1 -1
  42. package/dist/commands/segment-command.js +1 -1
  43. package/dist/commands/segment-create-command.js +1 -1
  44. package/dist/commands/segment-fields-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segment-validate-command.js +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/show.js +1 -1
  52. package/dist/commands/status-command.js +1 -1
  53. package/dist/commands/tables.js +1 -1
  54. package/dist/commands/unset-command.js +1 -1
  55. package/dist/commands/upgrade-command.js +1 -1
  56. package/dist/commands/use-command.js +1 -1
  57. package/dist/commands/user-command.js +1 -1
  58. package/dist/commands/work-command.js +1 -1
  59. package/dist/commands/workflow-command.js +1 -1
  60. package/dist/core/auth.js +1 -1
  61. package/dist/core/command-output.js +1 -1
  62. package/dist/core/config.js +1 -1
  63. package/dist/core/connection-cache.js +1 -1
  64. package/dist/core/constants.js +1 -1
  65. package/dist/core/credential-cache.js +1 -1
  66. package/dist/core/global-context.js +1 -1
  67. package/dist/core/keychain.js +1 -1
  68. package/dist/core/oauth-keychain.js +1 -1
  69. package/dist/core/oauth.js +1 -1
  70. package/dist/core/profile.js +1 -1
  71. package/dist/core/project-config.js +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/user-cache.js +1 -1
  74. package/dist/core/version.js +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/mcp/server.js +1 -1
  77. package/dist/mcp/tools/index.js +1 -1
  78. package/dist/mcp/tools/tdx-run.js +1 -1
  79. package/dist/mcp/tools/tdx-search.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.d.ts.map +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/api.js.map +1 -1
  96. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  97. package/dist/sdk/cas/cas-api-client.js +1 -1
  98. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  99. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  100. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  101. package/dist/sdk/cas/index.js +1 -1
  102. package/dist/sdk/cas/pull-workflow.js +1 -1
  103. package/dist/sdk/cas/push-workflow.js +1 -1
  104. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  107. package/dist/sdk/client/delivery-api-client.d.ts.map +1 -1
  108. package/dist/sdk/client/delivery-api-client.js +1 -1
  109. package/dist/sdk/client/delivery-api-client.js.map +1 -1
  110. package/dist/sdk/client/endpoints.js +1 -1
  111. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  112. package/dist/sdk/client/engage-api-client.js +1 -1
  113. package/dist/sdk/client/engage-api-client.js.map +1 -1
  114. package/dist/sdk/client/http-client.d.ts +7 -0
  115. package/dist/sdk/client/http-client.d.ts.map +1 -1
  116. package/dist/sdk/client/http-client.js +1 -1
  117. package/dist/sdk/client/http-client.js.map +1 -1
  118. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  119. package/dist/sdk/client/llm-api-client.js +1 -1
  120. package/dist/sdk/client/llm-api-client.js.map +1 -1
  121. package/dist/sdk/client/oauth-refresh.js +1 -1
  122. package/dist/sdk/client/rate-limiter.js +1 -1
  123. package/dist/sdk/client/td-api-client.d.ts.map +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/td-api-client.js.map +1 -1
  126. package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
  127. package/dist/sdk/client/trino-api-client.js +1 -1
  128. package/dist/sdk/client/trino-api-client.js.map +1 -1
  129. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  130. package/dist/sdk/client/workflow-client.js +1 -1
  131. package/dist/sdk/client/workflow-client.js.map +1 -1
  132. package/dist/sdk/connection-validator.js +1 -1
  133. package/dist/sdk/connection.js +1 -1
  134. package/dist/sdk/delivery.js +1 -1
  135. package/dist/sdk/engage/campaign-pull.js +1 -1
  136. package/dist/sdk/engage/campaign-push.js +1 -1
  137. package/dist/sdk/engage/campaign-validator.js +1 -1
  138. package/dist/sdk/engage/campaign-yaml.js +1 -1
  139. package/dist/sdk/engage/template-pull.js +1 -1
  140. package/dist/sdk/engage/template-push.js +1 -1
  141. package/dist/sdk/engage/template-validator.js +1 -1
  142. package/dist/sdk/engage/template-yaml.js +1 -1
  143. package/dist/sdk/engage/types/campaign-def.js +1 -1
  144. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  145. package/dist/sdk/engage/types/template-schema.js +1 -1
  146. package/dist/sdk/engage.js +1 -1
  147. package/dist/sdk/errors.js +1 -1
  148. package/dist/sdk/index.d.ts +12 -0
  149. package/dist/sdk/index.d.ts.map +1 -1
  150. package/dist/sdk/index.js +1 -1
  151. package/dist/sdk/index.js.map +1 -1
  152. package/dist/sdk/io/index.js +1 -1
  153. package/dist/sdk/io/node-filesystem.js +1 -1
  154. package/dist/sdk/job.js +1 -1
  155. package/dist/sdk/journey.js +1 -1
  156. package/dist/sdk/llm/chat-cache.js +1 -1
  157. package/dist/sdk/llm/index.js +1 -1
  158. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  159. package/dist/sdk/llm/model-factors.js +1 -1
  160. package/dist/sdk/personalization.d.ts.map +1 -1
  161. package/dist/sdk/personalization.js +1 -1
  162. package/dist/sdk/personalization.js.map +1 -1
  163. package/dist/sdk/policy.d.ts.map +1 -1
  164. package/dist/sdk/policy.js +1 -1
  165. package/dist/sdk/policy.js.map +1 -1
  166. package/dist/sdk/query/index.js +1 -1
  167. package/dist/sdk/query/sql-parser.js +1 -1
  168. package/dist/sdk/realtime.d.ts.map +1 -1
  169. package/dist/sdk/realtime.js +1 -1
  170. package/dist/sdk/realtime.js.map +1 -1
  171. package/dist/sdk/schedule.js +1 -1
  172. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  173. package/dist/sdk/segment/fields-display.js +1 -1
  174. package/dist/sdk/segment/file-discovery.js +1 -1
  175. package/dist/sdk/segment/journey-utils.js +1 -1
  176. package/dist/sdk/segment/journey-validator.js +1 -1
  177. package/dist/sdk/segment/journey-yaml.js +1 -1
  178. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  179. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  180. package/dist/sdk/segment/pull-workflow.js +1 -1
  181. package/dist/sdk/segment/push-recovery.js +1 -1
  182. package/dist/sdk/segment/push-workflow.js +1 -1
  183. package/dist/sdk/segment/resolution-context.js +1 -1
  184. package/dist/sdk/segment/segment-path-parser.js +1 -1
  185. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  186. package/dist/sdk/segment/segment-validator.js +1 -1
  187. package/dist/sdk/segment/target-resolution.js +1 -1
  188. package/dist/sdk/segment/tdx-config.js +1 -1
  189. package/dist/sdk/segment/types/activation-schema.js +1 -1
  190. package/dist/sdk/segment/types/journey-def.js +1 -1
  191. package/dist/sdk/segment/types/journey-schema.js +1 -1
  192. package/dist/sdk/segment/types/segment-def.js +1 -1
  193. package/dist/sdk/segment/types/segment-schema.js +1 -1
  194. package/dist/sdk/segment/validate-files.js +1 -1
  195. package/dist/sdk/segment/yaml-validator.js +1 -1
  196. package/dist/sdk/segment.js +1 -1
  197. package/dist/sdk/types/index.js +1 -1
  198. package/dist/sdk/types/progress.js +1 -1
  199. package/dist/sdk/types/workspace.d.ts +1 -0
  200. package/dist/sdk/types/workspace.d.ts.map +1 -1
  201. package/dist/sdk/types/workspace.js +1 -1
  202. package/dist/sdk/user.js +1 -1
  203. package/dist/sdk/util/format-detector.js +1 -1
  204. package/dist/sdk/util/formatters.js +1 -1
  205. package/dist/sdk/util/index.js +1 -1
  206. package/dist/sdk/util/paginate.js +1 -1
  207. package/dist/sdk/util/tree-formatter.js +1 -1
  208. package/dist/sdk/workflow/archive-validation.js +1 -1
  209. package/dist/sdk/workflow/clone-workflow.js +1 -1
  210. package/dist/sdk/workflow/index.js +1 -1
  211. package/dist/sdk/workflow/pull-workflow.js +1 -1
  212. package/dist/sdk/workflow/push-workflow.js +1 -1
  213. package/dist/sdk/workflow/tdx-config.js +1 -1
  214. package/dist/sdk/workflow/workflow-utils.js +1 -1
  215. package/dist/sdk/workspace/frontmatter.js +1 -1
  216. package/dist/sdk/workspace/git.js +1 -1
  217. package/dist/sdk/workspace/index.js +1 -1
  218. package/dist/sdk/workspace/templates.js +1 -1
  219. package/dist/sdk/workspace/weekly.js +1 -1
  220. package/dist/sdk/workspace/wikilinks.js +1 -1
  221. package/dist/test-utils/command-runner.js +1 -1
  222. package/dist/test-utils/factories.js +1 -1
  223. package/dist/test-utils/fixtures.js +1 -1
  224. package/dist/test-utils/http-mock.js +1 -1
  225. package/dist/test-utils/index.js +1 -1
  226. package/dist/utils/async.js +1 -1
  227. package/dist/utils/colors.js +1 -1
  228. package/dist/utils/diff.js +1 -1
  229. package/dist/utils/file-permissions.js +1 -1
  230. package/dist/utils/file-reader.js +1 -1
  231. package/dist/utils/github-releases.js +1 -1
  232. package/dist/utils/global-cache.js +1 -1
  233. package/dist/utils/json-loader.js +1 -1
  234. package/dist/utils/local-cache.js +1 -1
  235. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  236. package/dist/utils/logger/formatters/index.js +1 -1
  237. package/dist/utils/logger/handlers/console-handler.js +1 -1
  238. package/dist/utils/logger/handlers/file-handler.js +1 -1
  239. package/dist/utils/logger/handlers/index.js +1 -1
  240. package/dist/utils/logger/handlers/null-handler.js +1 -1
  241. package/dist/utils/logger/index.js +1 -1
  242. package/dist/utils/logger/logger.js +1 -1
  243. package/dist/utils/logger/types.js +1 -1
  244. package/dist/utils/option-validation.js +1 -1
  245. package/dist/utils/process.js +1 -1
  246. package/dist/utils/prompt.js +1 -1
  247. package/dist/utils/spinner.js +1 -1
  248. package/dist/utils/sse-parser.js +1 -1
  249. package/dist/utils/string-utils.js +1 -1
  250. package/dist/utils/table-ref-parser.js +1 -1
  251. package/dist/utils/tdx-logger.js +1 -1
  252. package/dist/utils/version-check.js +1 -1
  253. package/package.json +1 -1
@@ -1 +1 @@
1
- const a41_0xf38745=a41_0x5c2d;(function(_0x565645,_0x56e1c6){const _0x128628=a41_0x5c2d,_0x25447b=_0x565645();while(!![]){try{const _0x16f6b8=parseInt(_0x128628(0x102))/0x1+parseInt(_0x128628(0xf5))/0x2+-parseInt(_0x128628(0x10f))/0x3*(-parseInt(_0x128628(0x103))/0x4)+parseInt(_0x128628(0xfb))/0x5*(parseInt(_0x128628(0xf3))/0x6)+-parseInt(_0x128628(0xfa))/0x7*(parseInt(_0x128628(0xf0))/0x8)+-parseInt(_0x128628(0x124))/0x9*(parseInt(_0x128628(0x121))/0xa)+parseInt(_0x128628(0x11b))/0xb*(-parseInt(_0x128628(0xd2))/0xc);if(_0x16f6b8===_0x56e1c6)break;else _0x25447b['push'](_0x25447b['shift']());}catch(_0x112202){_0x25447b['push'](_0x25447b['shift']());}}}(a41_0x2a7b,0x7beee));function a41_0x5c2d(_0x60aec,_0x6e9c90){_0x60aec=_0x60aec-0xd2;const _0x2a7b05=a41_0x2a7b();let _0x5c2d0f=_0x2a7b05[_0x60aec];return _0x5c2d0f;}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 a41_0x2bf9cf from'chalk';function a41_0x2a7b(){const _0x555cd0=['260Pcojuw','file','no_parent','304443WtFNrs','message','1524wSozFp','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','filter','errorCode','\x20\x20🎯\x20','session','type','dim','hasChanges','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segment:pull','diff','Parent\x20segment:\x20','segment','\x20\x20Target:\x20','parentName','dryRun','\x20new\x20files','journeys','\x20versions)','\x20segments','green','✔\x20All\x20files\x20are\x20up\x20to\x20date','files','repeat','Pulling\x20segments\x20from\x20\x27','error','description','counts','2152TxwuWU','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','site','18uuZRLz','utf-8','388906rJXtcy','-\x20no\x20files\x20written','activations','verbose','journeyVersions','476aSAOoM','1416495GuCUHK','cwd','setPhase','\x0aChanges\x20to\x20\x27','\x0aPull\x20summary\x20for\x20\x27','targetDir','\x20files\x20to\x20','65196nFXGCX','263128MeaJBf','Aborted.','data','Write\x20','helpText','length','parent_segment','\x20journeys','\x20activations','name','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','absolutePath','24ERKJvg','segments','pullSegments','parentSegment','isNew','\x20with\x20','✔\x20Context\x20set:\x20','cyan','\x20changed\x20files','Site:\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20=\x20','19954TYrvRs','\x20files?','execute','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','yellow','\x20\x20🗺️\x20\x20'];a41_0x2a7b=function(){return _0x555cd0;};return a41_0x2a7b();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a41_0x649668 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{[a41_0xf38745(0x10c)]=a41_0xf38745(0xdd);[a41_0xf38745(0xee)]=a41_0xf38745(0x119);async[a41_0xf38745(0x11d)](_0x47ace6){const _0x53234d=a41_0xf38745,{options:_0x2bd175,args:_0x31997e,tdx:_0x285f18}=_0x47ace6,_0x53ee96=_0x2bd175,_0x2501d3=await resolveTarget({'arg':_0x31997e[0x0],'contextParent':_0x2bd175[_0x53234d(0x112)],'cwd':process[_0x53234d(0xfc)]()});if(!isSuccessfulResolution(_0x2501d3))return _0x2501d3[_0x53234d(0xd5)]===_0x53234d(0x123)?(console[_0x53234d(0xed)](a41_0x2bf9cf['yellow'](_0x53234d(0xd3))),console[_0x53234d(0xed)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x53234d(0xed)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x53234d(0xed)](_0x53234d(0xdc))):(console[_0x53234d(0xed)](a41_0x2bf9cf[_0x53234d(0xdb)]('Error:\x20'+_0x2501d3[_0x53234d(0x125)]+'\x0a')),_0x2501d3[_0x53234d(0x107)]&&console[_0x53234d(0xed)](a41_0x2bf9cf['cyan'](_0x2501d3['helpText']))),0x1;const _0x2e6498=_0x2501d3[_0x53234d(0xe2)],_0x4ce3f9=_0x2501d3[_0x53234d(0x100)],_0x2bf959=_0x2501d3[_0x53234d(0xd8)]===_0x53234d(0x122)?_0x2501d3['resourceName']:undefined;_0x53ee96['verbose']&&(console[_0x53234d(0xed)](_0x53234d(0x118)+_0x53ee96[_0x53234d(0xf2)]),console['error'](_0x53234d(0xdf)+_0x2e6498),_0x2bf959&&console[_0x53234d(0xed)]('Target\x20resource:\x20'+_0x2bf959));const _0x48d46a=await withProgressSpinner(_0x53234d(0xec)+_0x2e6498+'\x27...',_0x25efca=>_0x285f18[_0x53234d(0xe0)][_0x53234d(0x111)](_0x2e6498,{'targetDir':_0x4ce3f9,'targetResourceName':_0x2bf959,'verbose':_0x53ee96[_0x53234d(0xf8)],'progress':{'update':_0x5218cf=>{const _0x5cf4cc=_0x53234d;_0x25efca[_0x5cf4cc(0xfd)](_0x5218cf),_0x53ee96[_0x5cf4cc(0xf8)]&&console[_0x5cf4cc(0xed)]('\x20\x20'+_0x5218cf);}}}),{'verbose':_0x53ee96[_0x53234d(0xf8)]}),_0x539cf5=_0x48d46a[_0x53234d(0x105)];if(_0x539cf5[_0x53234d(0xef)][_0x53234d(0x110)]===0x0&&_0x539cf5[_0x53234d(0xef)][_0x53234d(0xe5)]===0x0)return console[_0x53234d(0xed)](a41_0x2bf9cf[_0x53234d(0x11f)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x539cf5[_0x53234d(0xe2)]+'\x27')),0x0;const _0x1977a2=_0x539cf5[_0x53234d(0xea)][_0x53234d(0xd4)](_0x53769e=>_0x53769e[_0x53234d(0x113)]),_0x57c987=_0x539cf5[_0x53234d(0xea)][_0x53234d(0xd4)](_0xda3002=>!_0xda3002[_0x53234d(0x113)]&&_0xda3002[_0x53234d(0xda)]),_0x13e5e3=_0x539cf5[_0x53234d(0xea)][_0x53234d(0xd4)](_0x51338d=>!_0x51338d[_0x53234d(0x113)]&&!_0x51338d[_0x53234d(0xda)]);console[_0x53234d(0xed)](_0x53234d(0xff)+_0x539cf5['parentName']+'\x27:'),console['error'](_0x53234d(0xd6)+a41_0x2bf9cf[_0x53234d(0x116)](_0x539cf5[_0x53234d(0xef)]['segments']+_0x53234d(0xe7))+_0x53234d(0x114)+a41_0x2bf9cf[_0x53234d(0x116)](_0x539cf5['counts'][_0x53234d(0xf7)]+_0x53234d(0x10b)));if(_0x539cf5[_0x53234d(0xef)]['journeys']>0x0){const _0x19d627=_0x539cf5[_0x53234d(0xef)][_0x53234d(0xf9)]>_0x539cf5[_0x53234d(0xef)]['journeys']?'\x20('+_0x539cf5[_0x53234d(0xef)][_0x53234d(0xf9)]+_0x53234d(0xe6):'';console[_0x53234d(0xed)](_0x53234d(0x120)+a41_0x2bf9cf['cyan'](_0x539cf5[_0x53234d(0xef)][_0x53234d(0xe5)]+_0x53234d(0x10a))+a41_0x2bf9cf[_0x53234d(0xd9)](_0x19d627));}console[_0x53234d(0xed)]('\x20\x20'+a41_0x2bf9cf[_0x53234d(0xe8)]('+\x20'+_0x1977a2['length']+_0x53234d(0xe4))),console[_0x53234d(0xed)]('\x20\x20'+a41_0x2bf9cf[_0x53234d(0x11f)]('~\x20'+_0x57c987[_0x53234d(0x108)]+_0x53234d(0x117))),console['error']('\x20\x20'+a41_0x2bf9cf['dim']('=\x20'+_0x13e5e3['length']+'\x20unchanged\x20files')),console[_0x53234d(0xed)](_0x53234d(0xe1)+a41_0x2bf9cf[_0x53234d(0x116)](_0x539cf5[_0x53234d(0x100)])+'\x0a');if(_0x57c987[_0x53234d(0x108)]>0x0)for(const _0x5df113 of _0x57c987){console[_0x53234d(0xed)](_0x53234d(0xfe)+_0x5df113['relativePath']+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x53234d(0xed)](_0x5df113[_0x53234d(0xde)]),console[_0x53234d(0xed)]('─'[_0x53234d(0xeb)](0x3c));}if(_0x53ee96[_0x53234d(0xe3)])return console['error'](a41_0x2bf9cf[_0x53234d(0x11f)](_0x53234d(0x10d))),0x0;if(_0x1977a2[_0x53234d(0x108)]===0x0&&_0x57c987[_0x53234d(0x108)]===0x0)return console[_0x53234d(0xed)](a41_0x2bf9cf[_0x53234d(0xe8)](_0x53234d(0xe9))),saveSessionContext({'parent_segment':_0x539cf5[_0x53234d(0xe2)]},_0x53ee96[_0x53234d(0xd7)]),console[_0x53234d(0xed)](a41_0x2bf9cf[_0x53234d(0xe8)](_0x53234d(0x115)+a41_0x2bf9cf['dim'](_0x53234d(0x109))+_0x53234d(0x11a)+a41_0x2bf9cf[_0x53234d(0x116)](_0x539cf5[_0x53234d(0xe2)]))),0x0;if(!_0x53ee96['yes']){if(!isInteractive())return console['error'](a41_0x2bf9cf[_0x53234d(0xdb)]('\x0aError:'),_0x53234d(0xf1)),console[_0x53234d(0xed)](a41_0x2bf9cf[_0x53234d(0xd9)](_0x53234d(0x11e))),0x1;const _0x11a78d=await confirmKey(_0x53234d(0x106)+(_0x1977a2[_0x53234d(0x108)]+_0x57c987['length'])+_0x53234d(0x11c));if(!_0x11a78d)return console[_0x53234d(0xed)](a41_0x2bf9cf[_0x53234d(0x11f)](_0x53234d(0x104)),_0x53234d(0xf6)),0x1;}for(const _0x10c6e9 of _0x539cf5[_0x53234d(0xea)]){if(_0x10c6e9[_0x53234d(0x113)]||_0x10c6e9[_0x53234d(0xda)]){const _0x2f2e76=a41_0x649668['dirname'](_0x10c6e9[_0x53234d(0x10e)]);!existsSync(_0x2f2e76)&&mkdirSync(_0x2f2e76,{'recursive':!![]}),writeFileSync(_0x10c6e9['absolutePath'],_0x10c6e9['content'],_0x53234d(0xf4));}}return console[_0x53234d(0xed)](a41_0x2bf9cf[_0x53234d(0xe8)]('✔\x20Pulled\x20'+(_0x1977a2['length']+_0x57c987[_0x53234d(0x108)])+_0x53234d(0x101)+_0x539cf5[_0x53234d(0x100)])),saveSessionContext({'parent_segment':_0x539cf5[_0x53234d(0xe2)]},_0x53ee96['session']),console[_0x53234d(0xed)](a41_0x2bf9cf[_0x53234d(0xe8)]('✔\x20Context\x20set:\x20'+a41_0x2bf9cf['dim'](_0x53234d(0x109))+_0x53234d(0x11a)+a41_0x2bf9cf[_0x53234d(0x116)](_0x539cf5[_0x53234d(0xe2)]))),0x0;}}
1
+ function a41_0x1a1a(){const _0x219945=['files','segment','isNew','165OUidfJ','Parent\x20segment:\x20','8NbfdJj','2010OfEicO','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','repeat','no_parent','\x0aPull\x20summary\x20for\x20\x27','\x20with\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','8078TZRNGh','filter','helpText','\x20=\x20','relativePath','journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20files?','276624rqNMIX','hasChanges','\x20unchanged\x20files','\x0aError:','session','targetDir','447170hYcZiL','length','dim','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20new\x20files','utf-8','\x20changed\x20files','Aborted.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segments','Site:\x20','1212735vanmEx','errorCode','cwd','-\x20no\x20files\x20written','content','\x27...','parentSegment','Target\x20resource:\x20','\x20versions)','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20activations','cyan','counts','red','journeyVersions','site','parent_segment','resourceName','yes','\x20segments','green','execute','error','4218250GugPHE','Pulling\x20segments\x20from\x20\x27','\x20\x20🎯\x20','8tafIpY','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','absolutePath','✔\x20All\x20files\x20are\x20up\x20to\x20date','parentName','694540LbUnAU','name','700536FWmVqF','segment:pull','yellow','type','verbose','✔\x20Context\x20set:\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','file','message'];a41_0x1a1a=function(){return _0x219945;};return a41_0x1a1a();}const a41_0x467f75=a41_0x511e;(function(_0x42c912,_0x5a8fc2){const _0x4e1361=a41_0x511e,_0x5bbe32=_0x42c912();while(!![]){try{const _0x3825aa=parseInt(_0x4e1361(0x1c1))/0x1+-parseInt(_0x4e1361(0x1c3))/0x2+parseInt(_0x4e1361(0x1f2))/0x3*(parseInt(_0x4e1361(0x1d1))/0x4)+-parseInt(_0x4e1361(0x1b9))/0x5+parseInt(_0x4e1361(0x1d2))/0x6*(-parseInt(_0x4e1361(0x1d9))/0x7)+-parseInt(_0x4e1361(0x1bc))/0x8*(parseInt(_0x4e1361(0x1e1))/0x9)+parseInt(_0x4e1361(0x1e7))/0xa*(parseInt(_0x4e1361(0x1cf))/0xb);if(_0x3825aa===_0x5a8fc2)break;else _0x5bbe32['push'](_0x5bbe32['shift']());}catch(_0x523ee5){_0x5bbe32['push'](_0x5bbe32['shift']());}}}(a41_0x1a1a,0x8956d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a41_0x511e(_0x121a65,_0x4abd38){_0x121a65=_0x121a65-0x1a4;const _0x1a1ac2=a41_0x1a1a();let _0x511ee3=_0x1a1ac2[_0x121a65];return _0x511ee3;}import a41_0x56f11f from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a41_0xbdde81 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{[a41_0x467f75(0x1c2)]=a41_0x467f75(0x1c4);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a41_0x467f75(0x1b7)](_0x301465){const _0x55a109=a41_0x467f75,{options:_0x511526,args:_0x592fec,tdx:_0x454cf6}=_0x301465,_0xa37194=_0x511526,_0x16d34a=await resolveTarget({'arg':_0x592fec[0x0],'contextParent':_0x511526[_0x55a109(0x1a8)],'cwd':process[_0x55a109(0x1a4)]()});if(!isSuccessfulResolution(_0x16d34a))return _0x16d34a[_0x55a109(0x1f3)]===_0x55a109(0x1d5)?(console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1c5)](_0x55a109(0x1d8))),console[_0x55a109(0x1b8)](_0x55a109(0x1c9)),console[_0x55a109(0x1b8)](_0x55a109(0x1df)),console[_0x55a109(0x1b8)](_0x55a109(0x1ef))):(console['error'](a41_0x56f11f[_0x55a109(0x1af)]('Error:\x20'+_0x16d34a[_0x55a109(0x1cb)]+'\x0a')),_0x16d34a[_0x55a109(0x1db)]&&console['error'](a41_0x56f11f[_0x55a109(0x1ad)](_0x16d34a[_0x55a109(0x1db)]))),0x1;const _0x5cf737=_0x16d34a['parentName'],_0x539fc9=_0x16d34a['targetDir'],_0x33abff=_0x16d34a[_0x55a109(0x1c6)]===_0x55a109(0x1ca)?_0x16d34a[_0x55a109(0x1b3)]:undefined;_0xa37194[_0x55a109(0x1c7)]&&(console[_0x55a109(0x1b8)](_0x55a109(0x1f1)+_0xa37194[_0x55a109(0x1b1)]),console[_0x55a109(0x1b8)](_0x55a109(0x1d0)+_0x5cf737),_0x33abff&&console[_0x55a109(0x1b8)](_0x55a109(0x1a9)+_0x33abff));const _0x64ace9=await withProgressSpinner(_0x55a109(0x1ba)+_0x5cf737+_0x55a109(0x1a7),_0x23a155=>_0x454cf6[_0x55a109(0x1cd)]['pullSegments'](_0x5cf737,{'targetDir':_0x539fc9,'targetResourceName':_0x33abff,'verbose':_0xa37194[_0x55a109(0x1c7)],'progress':{'update':_0x3c4024=>{const _0x2fcc55=_0x55a109;_0x23a155['setPhase'](_0x3c4024),_0xa37194[_0x2fcc55(0x1c7)]&&console[_0x2fcc55(0x1b8)]('\x20\x20'+_0x3c4024);}}}),{'verbose':_0xa37194[_0x55a109(0x1c7)]}),_0x1dd0d9=_0x64ace9['data'];if(_0x1dd0d9['counts']['segments']===0x0&&_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1de)]===0x0)return console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1c5)](_0x55a109(0x1ab)+_0x1dd0d9[_0x55a109(0x1c0)]+'\x27')),0x0;const _0x1fefc9=_0x1dd0d9[_0x55a109(0x1cc)][_0x55a109(0x1da)](_0xe59ee6=>_0xe59ee6[_0x55a109(0x1ce)]),_0x87589e=_0x1dd0d9['files'][_0x55a109(0x1da)](_0x302959=>!_0x302959[_0x55a109(0x1ce)]&&_0x302959['hasChanges']),_0xb06c3=_0x1dd0d9[_0x55a109(0x1cc)][_0x55a109(0x1da)](_0x260dd0=>!_0x260dd0['isNew']&&!_0x260dd0[_0x55a109(0x1e2)]);console[_0x55a109(0x1b8)](_0x55a109(0x1d6)+_0x1dd0d9[_0x55a109(0x1c0)]+'\x27:'),console[_0x55a109(0x1b8)](_0x55a109(0x1bb)+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1f0)]+_0x55a109(0x1b5))+_0x55a109(0x1d7)+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9['counts']['activations']+_0x55a109(0x1ac)));if(_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1de)]>0x0){const _0x1382ac=_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1b0)]>_0x1dd0d9[_0x55a109(0x1ae)]['journeys']?'\x20('+_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1b0)]+_0x55a109(0x1aa):'';console['error']('\x20\x20🗺️\x20\x20'+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9[_0x55a109(0x1ae)][_0x55a109(0x1de)]+'\x20journeys')+a41_0x56f11f[_0x55a109(0x1e9)](_0x1382ac));}console['error']('\x20\x20'+a41_0x56f11f[_0x55a109(0x1b6)]('+\x20'+_0x1fefc9['length']+_0x55a109(0x1eb))),console[_0x55a109(0x1b8)]('\x20\x20'+a41_0x56f11f[_0x55a109(0x1c5)]('~\x20'+_0x87589e[_0x55a109(0x1e8)]+_0x55a109(0x1ed))),console[_0x55a109(0x1b8)]('\x20\x20'+a41_0x56f11f[_0x55a109(0x1e9)]('=\x20'+_0xb06c3['length']+_0x55a109(0x1e3))),console[_0x55a109(0x1b8)]('\x20\x20Target:\x20'+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9[_0x55a109(0x1e6)])+'\x0a');if(_0x87589e[_0x55a109(0x1e8)]>0x0)for(const _0x31e7cc of _0x87589e){console[_0x55a109(0x1b8)]('\x0aChanges\x20to\x20\x27'+_0x31e7cc[_0x55a109(0x1dd)]+'\x27:'),console[_0x55a109(0x1b8)]('─'[_0x55a109(0x1d4)](0x3c)),console['error'](_0x31e7cc['diff']),console[_0x55a109(0x1b8)]('─'[_0x55a109(0x1d4)](0x3c));}if(_0xa37194['dryRun'])return console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1c5)](_0x55a109(0x1d3))),0x0;if(_0x1fefc9[_0x55a109(0x1e8)]===0x0&&_0x87589e[_0x55a109(0x1e8)]===0x0)return console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1b6)](_0x55a109(0x1bf))),saveSessionContext({'parent_segment':_0x1dd0d9[_0x55a109(0x1c0)]},_0xa37194[_0x55a109(0x1e5)]),console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1b6)]('✔\x20Context\x20set:\x20'+a41_0x56f11f[_0x55a109(0x1e9)](_0x55a109(0x1b2))+_0x55a109(0x1dc)+a41_0x56f11f['cyan'](_0x1dd0d9['parentName']))),0x0;if(!_0xa37194[_0x55a109(0x1b4)]){if(!isInteractive())return console['error'](a41_0x56f11f[_0x55a109(0x1af)](_0x55a109(0x1e4)),_0x55a109(0x1bd)),console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1e9)](_0x55a109(0x1ea))),0x1;const _0xdae1b3=await confirmKey('Write\x20'+(_0x1fefc9[_0x55a109(0x1e8)]+_0x87589e['length'])+_0x55a109(0x1e0));if(!_0xdae1b3)return console[_0x55a109(0x1b8)](a41_0x56f11f['yellow'](_0x55a109(0x1ee)),_0x55a109(0x1a5)),0x1;}for(const _0xf238ea of _0x1dd0d9[_0x55a109(0x1cc)]){if(_0xf238ea[_0x55a109(0x1ce)]||_0xf238ea[_0x55a109(0x1e2)]){const _0x34551f=a41_0xbdde81['dirname'](_0xf238ea[_0x55a109(0x1be)]);!existsSync(_0x34551f)&&mkdirSync(_0x34551f,{'recursive':!![]}),writeFileSync(_0xf238ea[_0x55a109(0x1be)],_0xf238ea[_0x55a109(0x1a6)],_0x55a109(0x1ec));}}return console['error'](a41_0x56f11f[_0x55a109(0x1b6)]('✔\x20Pulled\x20'+(_0x1fefc9['length']+_0x87589e[_0x55a109(0x1e8)])+'\x20files\x20to\x20'+_0x1dd0d9['targetDir'])),saveSessionContext({'parent_segment':_0x1dd0d9[_0x55a109(0x1c0)]},_0xa37194[_0x55a109(0x1e5)]),console[_0x55a109(0x1b8)](a41_0x56f11f[_0x55a109(0x1b6)](_0x55a109(0x1c8)+a41_0x56f11f[_0x55a109(0x1e9)](_0x55a109(0x1b2))+_0x55a109(0x1dc)+a41_0x56f11f[_0x55a109(0x1ad)](_0x1dd0d9[_0x55a109(0x1c0)]))),0x0;}}
@@ -1 +1 @@
1
- const a42_0x2309e2=a42_0xee4e;(function(_0x1b61c1,_0x59319e){const _0x55702c=a42_0xee4e,_0xed5af4=_0x1b61c1();while(!![]){try{const _0x3995a4=-parseInt(_0x55702c(0xe8))/0x1*(-parseInt(_0x55702c(0xe1))/0x2)+-parseInt(_0x55702c(0xbd))/0x3+-parseInt(_0x55702c(0x118))/0x4*(-parseInt(_0x55702c(0x10d))/0x5)+parseInt(_0x55702c(0x113))/0x6*(-parseInt(_0x55702c(0xd9))/0x7)+parseInt(_0x55702c(0xd0))/0x8+-parseInt(_0x55702c(0xf7))/0x9*(parseInt(_0x55702c(0x10f))/0xa)+parseInt(_0x55702c(0x129))/0xb;if(_0x3995a4===_0x59319e)break;else _0xed5af4['push'](_0xed5af4['shift']());}catch(_0x44dadf){_0xed5af4['push'](_0xed5af4['shift']());}}}(a42_0xc84f,0xf35c5));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 a42_0x5c0c85 from'chalk';import{existsSync}from'fs';function a42_0xee4e(_0x24a36e,_0x53552f){_0x24a36e=_0x24a36e-0xb0;const _0xc84fad=a42_0xc84f();let _0xee4e6c=_0xc84fad[_0x24a36e];return _0xee4e6c;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a42_0xc84f(){const _0x999ef3=['createdAt','updated','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','no_parent','file','437090pIDVgg','\x20to\x20delete','980pqSTQV','journeyBundleId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','nameToType','246amguot','segments','\x0aPush\x20summary\x20for\x20\x27','relationships','cyan','24xQBShY','push','No\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20changed','type','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','New\x20journey:','segment:push','green','buildUserMaps','user','deleted','journeys','\x20updated','\x20to\x20create','.yml','18504662ZYAdOW','connection','attributes','map','\x20\x20Segments:\x20','folders','get','createdSegmentIds','segment\x20or\x20journey','versionNumber','existingSegment','\x20folders\x20to\x20create','yellow','Scoped\x20to\x20folder:\x20','\x20activations]','listSegments','message','getJourney','\x20to\x20update','\x20\x20Source:\x20','journeyId','changed','.yaml','getParent','all','filter','blue','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yamlConfig','Delete\x20journey:','nameToId','idToName','segment','length','dim','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','state','targetDir','journey','Fetching\x20existing\x20activations...','\x20created','name','\x20\x20Journeys:\x20','repeat','Resolving\x20parent\x20segment\x20\x27','created','2349297zCzDHd','listActivations','\x20deleted','setPhase','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Fetching\x20existing\x20data...','\x20unchanged','parentFolder','dryRun','unchanged','Changes\x20to:','Error:\x20Directory\x20not\x20found:\x20','then','\x0a✔\x20Push\x20complete','toCreate','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20\x20\x20','segmentFolderId','2414808ykOKnh','📁\x20','resolveParentId','\x20\x20📊\x20Segments:','verbose','\x20YAML\x20files\x20found','join','Fetching\x20connections\x20for\x20name\x20resolution...','\x0aError:','108374ROQpAI','journeyBundleName','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)','\x20\x20Activations:\x20','journeysOnly','diff','toDelete','Site:\x20','82IYgyyR','Error:\x20','error','parent_name','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','toString','add','17579lGMXVY','execute','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','(Journey\x20will\x20be\x20deleted)','/sb/da/esr','isNew','folderId','/e/','delete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','new','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','site','listJourneysWithDetailsFromParentSegment','errorCode','74817NTtHUS','results','toUpdate','Folders\x20to\x20create:','activations','Source\x20directory:\x20','set','parentName','\x20new','existingJourney','filePath','helpText','/app/ps/','getOutputSchemaWithCache','data','folderPath','red'];a42_0xc84f=function(){return _0x999ef3;};return a42_0xc84f();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a42_0x2309e2(0x120);['description']=a42_0x2309e2(0xe5);async[a42_0x2309e2(0xe9)](_0x5f4232){const _0x91518=a42_0x2309e2,{options:_0x5d44f0,args:_0x284224,tdx:_0x507830}=_0x5f4232,_0x252458=_0x5d44f0,_0xa90866=await resolveTarget({'arg':_0x284224[0x0],'contextParent':_0x5d44f0['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xa90866))return _0xa90866[_0x91518(0xf6)]===_0x91518(0x10b)?(console['error'](a42_0x5c0c85['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x91518(0xe3)](_0x91518(0xdb)),console[_0x91518(0xe3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x107)](_0x91518(0xe2)+_0xa90866[_0x91518(0x139)]+'\x0a')),_0xa90866['helpText']&&console[_0x91518(0xe3)](a42_0x5c0c85['cyan'](_0xa90866[_0x91518(0x102)]))),0x1;if(_0xa90866['type']===_0x91518(0xe4))return console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x107)](_0x91518(0xc8)+_0xa90866[_0x91518(0xb4)]+'\x0a')),console[_0x91518(0xe3)](a42_0x5c0c85['cyan'](_0x91518(0xf1))),0x1;const _0xed7448=_0xa90866[_0x91518(0xfe)],_0x4e81d7=_0xa90866[_0x91518(0xb4)],_0x488bda=_0xa90866[_0x91518(0x11d)]===_0x91518(0x10c)?_0xa90866[_0x91518(0x101)]:undefined,_0xf19c01=getScopedDetails(_0xa90866),_0x5e3203=_0xf19c01?.['isScoped']??![],_0x106ddf=_0xf19c01?.['scopedFolderPath']??'';if(!existsSync(_0x4e81d7))return console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x107)](_0x91518(0xc8)+_0x4e81d7+'\x0a')),console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x117)](_0x91518(0xf1))),0x1;_0x252458['verbose']&&(console[_0x91518(0xe3)](_0x91518(0xe0)+_0x252458['site']),console[_0x91518(0xe3)]('Parent\x20segment:\x20'+_0xed7448),console[_0x91518(0xe3)](_0x91518(0xfc)+_0x4e81d7),_0x5e3203&&console[_0x91518(0xe3)](_0x91518(0x136)+_0x106ddf));const _0x59b766=await withSpinner(_0x91518(0xbb)+_0xed7448+'\x27...',()=>_0x507830[_0x91518(0x149)][_0x91518(0xd2)](_0xed7448),{'verbose':_0x252458['verbose']}),_0x28933b=_0x59b766[_0x91518(0x105)],{parentSegmentResult:_0x3d4801,segmentsResult:_0x803e70,foldersResult:_0x38e35d,journeysWithDetailsResult:_0x58c0b4,userMaps:_0x2d790d}=await withSpinner(_0x91518(0xc2),async()=>{const _0x4369ab=_0x91518,[_0x1011a7,_0x1d16e9,_0x4b94ba,_0x165c32,_0x54032c]=await Promise[_0x4369ab(0x141)]([_0x507830[_0x4369ab(0x149)][_0x4369ab(0x140)](_0x28933b),_0x507830[_0x4369ab(0x149)][_0x4369ab(0x138)](_0x28933b),_0x507830['segment']['listFolders'](_0x28933b),_0x507830['journey'][_0x4369ab(0xf5)](_0x28933b,{'includeAllVersions':!![]}),_0x507830[_0x4369ab(0x123)][_0x4369ab(0x122)]()]);return{'parentSegmentResult':_0x1011a7,'segmentsResult':_0x1d16e9,'foldersResult':_0x4b94ba,'journeysWithDetailsResult':_0x165c32,'userMaps':_0x54032c};},{'verbose':_0x252458['verbose']})[_0x91518(0xc9)](_0x5afde3=>_0x5afde3['data']),_0x4288cb=_0x3d4801,_0x18fc6e=extractRootFolderId(_0x4288cb),_0x4279b6=_0x803e70,_0x5ac8f8=_0x38e35d,{journeys:_0x4fcb3f,activationStepsById:_0x165c9a}=_0x58c0b4,_0x53f298=new Map(_0x4fcb3f['map'](_0x3afb70=>[_0x3afb70['id'],_0x3afb70])),_0xe42671=_0x4fcb3f[_0x91518(0x12c)](_0x4fc7e3=>({'id':_0x4fc7e3['id'],'name':_0x4fc7e3[_0x91518(0x12b)][_0x91518(0xb8)],'journeyBundleName':_0x4fc7e3[_0x91518(0x12b)][_0x91518(0xda)]||'','journeyBundleId':_0x4fc7e3[_0x91518(0x12b)][_0x91518(0x110)]||'','versionNumber':_0x4fc7e3[_0x91518(0x12b)][_0x91518(0x132)],'description':_0x4fc7e3[_0x91518(0x12b)]['description'],'state':_0x4fc7e3[_0x91518(0x12b)][_0x91518(0xb3)],'paused':_0x4fc7e3[_0x91518(0x12b)]['paused'],'audienceId':_0x4fc7e3[_0x91518(0x12b)]['audienceId'],'folderId':_0x4fc7e3[_0x91518(0x116)]?.[_0x91518(0xc4)]?.[_0x91518(0x105)]?.['id'],'createdAt':_0x4fc7e3['attributes'][_0x91518(0x108)],'updatedAt':_0x4fc7e3['attributes']['updatedAt']})),{emailToId:_0x2f279a,idToEmail:_0x123660}=_0x2d790d,_0xfd2a8e=await withSpinner(_0x91518(0xd7),async()=>{const _0x4db24a=_0x91518,_0x41e09b=await _0x507830[_0x4db24a(0x12a)]['list']();return buildConnectionMaps(_0x41e09b);},{'verbose':_0x252458[_0x91518(0xd4)]})[_0x91518(0xc9)](_0x21826e=>_0x21826e[_0x91518(0x105)]),_0x4fdfae=_0xfd2a8e[_0x91518(0x147)],_0x4a3999=_0xfd2a8e[_0x91518(0x148)],_0x1fe588=_0xfd2a8e[_0x91518(0x112)],_0x2d629a={'emailToIdMap':_0x2f279a,'connectionNameToIdMap':_0x4fdfae,'connectionNameToTypeMap':_0x1fe588,'getSchema':_0x2ffa92=>_0x507830[_0x91518(0x12a)][_0x91518(0x104)](_0x2ffa92)};let {pathToId:_0x216b22,idToPath:_0x552cd7}=buildFolderMaps(_0x5ac8f8);const _0x15d355=buildSegmentLookupMap(_0x4279b6,_0x552cd7),_0x2bfd7c=buildSegmentNameToIdMap(_0x4279b6),_0x3eae83=buildJourneyBundleLookupMap(_0xe42671,_0x552cd7);let _0x251b7f;if(_0x488bda){if(!_0x488bda['endsWith'](_0x91518(0x128))&&!_0x488bda['endsWith'](_0x91518(0x13f)))return console[_0x91518(0xe3)](a42_0x5c0c85['red'](_0x91518(0x144)+_0x488bda+'\x0a')),0x1;_0x251b7f=[_0x488bda];}else _0x251b7f=findYamlFiles(_0x4e81d7);if(_0x251b7f[_0x91518(0xb0)]===0x0)return console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x107)](_0x91518(0x11b)+_0x4e81d7+'\x0a')),console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x117)](_0x91518(0xcd))),0x1;let _0x23e78e,_0x5afa54;try{const _0x584bb2=parseAndClassifyYamlFiles(_0x251b7f,_0x4e81d7,{'skipSegments':_0x252458[_0x91518(0xdd)]});_0x23e78e=_0x584bb2[_0x91518(0x114)],_0x5afa54=_0x584bb2[_0x91518(0x125)];const _0x171a4e=validateParsedFiles(_0x584bb2,_0x4e81d7);if(_0x171a4e[_0x91518(0xb0)]>0x0)return console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x107)]('\x0aValidation\x20failed:')),console[_0x91518(0xe3)](formatValidationErrors(_0x171a4e)),console[_0x91518(0xe3)](a42_0x5c0c85['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1e1e5d){return console[_0x91518(0xe3)](a42_0x5c0c85['red']('Error\x20parsing\x20YAML:\x20'+(_0x1e1e5d instanceof Error?_0x1e1e5d[_0x91518(0x139)]:_0x1e1e5d))),0x1;}if(_0x23e78e[_0x91518(0xb0)]===0x0&&_0x5afa54[_0x91518(0xb0)]===0x0){const _0x312162=_0x252458['journeysOnly']?'journey':_0x91518(0x131);return console['error'](a42_0x5c0c85[_0x91518(0x135)](_0x91518(0x11a)+_0x312162+_0x91518(0xd5))),0x0;}const _0x4397dd=new Map();_0x4279b6[_0x91518(0xb0)]>0x0&&!_0x252458[_0x91518(0xdd)]&&await withSpinner(_0x91518(0xb6),async()=>{await batchAsync(_0x4279b6,async _0x1705dc=>{const _0x46ff70=a42_0xee4e,_0x42fc67=await _0x507830[_0x46ff70(0x149)][_0x46ff70(0xbe)](_0x28933b,_0x1705dc['id']);_0x4397dd[_0x46ff70(0xfd)](_0x1705dc['id'],_0x42fc67);});},{'verbose':_0x252458[_0x91518(0xd4)]});const {segmentFiles:_0xfc4d0d,foldersToCreate:_0x225d99}=await prepareSegmentFiles(_0x23e78e,{'segmentByFolderAndName':_0x15d355,'activationsBySegmentId':_0x4397dd,'folderPathToId':_0x216b22,'idToEmailMap':_0x123660,'connectionIdToNameMap':_0x4a3999},_0x2d629a,_0x5e3203,_0x106ddf),_0x12a986=_0x488bda?[]:findSegmentsToDelete(_0x4279b6,_0x23e78e['map'](({yamlConfig:_0x1233a2,folderPath:_0x57ae0a})=>({'yamlConfig':_0x1233a2,'folderPath':resolveTDFolderPath(_0x57ae0a,_0x5e3203,_0x106ddf)})),_0x552cd7,_0x106ddf,_0x5e3203),{journeyFiles:_0x1291d9,foldersToCreate:_0x185214}=await withProgressSpinner('Preparing\x20journeys...',async _0x140e5b=>prepareJourneyFiles(_0x5afa54,{'fetchJourney':async _0x42ddff=>_0x507830['journey'][_0x91518(0x13a)](_0x42ddff[_0x91518(0x13d)]),'journeyBundlesByFolderAndName':_0x3eae83,'folderPathToId':_0x216b22,'idToEmailMap':_0x123660,'connectionIdToNameMap':_0x4a3999,'existingSegments':_0x4279b6,'parentId':_0x28933b,'deps':_0x507830,'progress':{'update':_0x438a05=>{const _0x255540=_0x91518;_0x140e5b[_0x255540(0xc0)](_0x438a05),_0x252458[_0x255540(0xd4)]&&console[_0x255540(0xe3)]('\x20\x20'+_0x438a05);}},'journeyById':_0x53f298,'activationStepsById':_0x165c9a},_0x5e3203,_0x106ddf),{'verbose':_0x252458['verbose']})[_0x91518(0xc9)](_0x9954e5=>_0x9954e5[_0x91518(0x105)]);for(const _0x21b864 of _0x185214){_0x225d99[_0x91518(0xe7)](_0x21b864);}const _0x2d20f6=_0x488bda?[]:findJourneysToDelete(_0xe42671,_0x5afa54[_0x91518(0x12c)](({yamlConfig:_0x5caf49,folderPath:_0x18581b})=>({'yamlConfig':_0x5caf49,'folderPath':resolveTDFolderPath(_0x18581b,_0x5e3203,_0x106ddf)})),_0x552cd7,_0x106ddf,_0x5e3203),_0x13744c=calculatePushStats(_0xfc4d0d,_0x1291d9,_0x225d99,_0x12a986,_0x2d20f6,!!_0x252458[_0x91518(0xf0)],!!_0x252458[_0x91518(0xdd)]),_0x2adef6=_0x13744c[_0x91518(0x114)][_0x91518(0xf2)],_0x15fcba=_0x13744c[_0x91518(0x114)]['changed'],_0x330108=_0x13744c['segments']['unchanged'],_0x1a7146=_0x13744c[_0x91518(0x114)][_0x91518(0xdf)],_0x2993be=_0x13744c[_0x91518(0x12e)][_0x91518(0xcb)],_0x4ad941=_0x13744c[_0x91518(0x125)][_0x91518(0xf2)],_0x10d292=_0x13744c[_0x91518(0x125)][_0x91518(0x13e)],_0x47fc98=_0x13744c[_0x91518(0x125)][_0x91518(0xc6)],_0x1de3eb=_0x13744c['journeys'][_0x91518(0xdf)],_0x1168ea=_0x13744c[_0x91518(0xfb)][_0x91518(0x141)],_0x1b57aa=_0x13744c[_0x91518(0xfb)]['toCreate'],_0x3a6375=_0x13744c[_0x91518(0xfb)][_0x91518(0xf9)],_0x108327=_0x13744c[_0x91518(0xfb)][_0x91518(0xdf)];console['error'](_0x91518(0x115)+_0xed7448+'\x27:');_0x2993be[_0x91518(0xb0)]>0x0&&console['error']('\x20\x20'+a42_0x5c0c85[_0x91518(0x143)](_0x91518(0xd1)+_0x2993be['length']+_0x91518(0x134)));if(!_0x252458[_0x91518(0xdd)]){console[_0x91518(0xe3)](_0x91518(0xd3)),console[_0x91518(0xe3)]('\x20\x20\x20\x20'+a42_0x5c0c85[_0x91518(0x121)]('+\x20'+_0x2adef6[_0x91518(0xb0)]+_0x91518(0xff))),console[_0x91518(0xe3)](_0x91518(0xce)+a42_0x5c0c85['yellow']('~\x20'+_0x15fcba[_0x91518(0xb0)]+'\x20changed'));if(_0x1a7146['length']>0x0)console[_0x91518(0xe3)](_0x91518(0xce)+a42_0x5c0c85[_0x91518(0x107)]('-\x20'+_0x1a7146[_0x91518(0xb0)]+_0x91518(0x10e)));else _0x12a986[_0x91518(0xb0)]>0x0&&!_0x252458[_0x91518(0xf0)]&&console['error'](_0x91518(0xce)+a42_0x5c0c85[_0x91518(0xb1)](_0x12a986[_0x91518(0xb0)]+_0x91518(0x111)));console[_0x91518(0xe3)]('\x20\x20\x20\x20'+a42_0x5c0c85[_0x91518(0xb1)]('=\x20'+_0x330108[_0x91518(0xb0)]+_0x91518(0xc3)));}if(_0x1291d9[_0x91518(0xb0)]>0x0||_0x2d20f6['length']>0x0){console[_0x91518(0xe3)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x91518(0xe3)]('\x20\x20\x20\x20'+a42_0x5c0c85['green']('+\x20'+_0x4ad941[_0x91518(0xb0)]+_0x91518(0xff))),console[_0x91518(0xe3)](_0x91518(0xce)+a42_0x5c0c85[_0x91518(0x135)]('~\x20'+_0x10d292['length']+_0x91518(0x11c)));if(_0x1de3eb[_0x91518(0xb0)]>0x0)console[_0x91518(0xe3)](_0x91518(0xce)+a42_0x5c0c85[_0x91518(0x107)]('-\x20'+_0x1de3eb['length']+'\x20to\x20delete'));else _0x2d20f6[_0x91518(0xb0)]>0x0&&!_0x252458['delete']&&console[_0x91518(0xe3)]('\x20\x20\x20\x20'+a42_0x5c0c85[_0x91518(0xb1)](_0x2d20f6['length']+_0x91518(0x111)));console[_0x91518(0xe3)]('\x20\x20\x20\x20'+a42_0x5c0c85[_0x91518(0xb1)]('=\x20'+_0x47fc98[_0x91518(0xb0)]+_0x91518(0xc3)));}_0x1168ea[_0x91518(0xb0)]>0x0&&!_0x252458[_0x91518(0xdd)]&&(console[_0x91518(0xe3)](''),console[_0x91518(0xe3)]('\x20\x20Activations:'),_0x1b57aa[_0x91518(0xb0)]>0x0&&console[_0x91518(0xe3)]('\x20\x20\x20\x20'+a42_0x5c0c85[_0x91518(0x121)]('+\x20'+_0x1b57aa['length']+_0x91518(0x127))),_0x3a6375[_0x91518(0xb0)]>0x0&&console['error'](_0x91518(0xce)+a42_0x5c0c85[_0x91518(0x135)]('~\x20'+_0x3a6375[_0x91518(0xb0)]+_0x91518(0x13b))),_0x108327[_0x91518(0xb0)]>0x0&&console[_0x91518(0xe3)](_0x91518(0xce)+a42_0x5c0c85[_0x91518(0x107)]('-\x20'+_0x108327['length']+'\x20to\x20delete')));console[_0x91518(0xe3)](_0x91518(0x13c)+a42_0x5c0c85[_0x91518(0x117)](_0x4e81d7)+'\x0a');if(_0x2993be[_0x91518(0xb0)]>0x0){console[_0x91518(0xe3)](_0x91518(0xfa));for(const _0x3fda67 of _0x2993be){console[_0x91518(0xe3)]('\x20\x20'+a42_0x5c0c85['blue']('+')+'\x20'+_0x3fda67);}console[_0x91518(0xe3)]('');}if(_0x2adef6[_0x91518(0xb0)]>0x0&&!_0x252458[_0x91518(0xdd)])for(const _0x505568 of _0x2adef6){const _0x1ac28b=_0x505568[_0x91518(0x106)]?_0x505568[_0x91518(0x106)]+'/'+_0x505568[_0x91518(0x145)]['name']:_0x505568[_0x91518(0x145)][_0x91518(0xb8)],_0x2121c7=_0x505568[_0x91518(0x145)][_0x91518(0xfb)]?.[_0x91518(0xb0)]||0x0,_0x22bcf2=_0x2121c7>0x0?a42_0x5c0c85[_0x91518(0xb1)]('\x20['+_0x2121c7+_0x91518(0x137)):'';console[_0x91518(0xe3)]('\x0a'+a42_0x5c0c85[_0x91518(0x121)]('New\x20segment:')+'\x20'+_0x1ac28b+_0x22bcf2),console['error']('─'['repeat'](0x3c)),_0x505568[_0x91518(0xde)]&&console[_0x91518(0xe3)](_0x505568[_0x91518(0xde)]),console[_0x91518(0xe3)]('─'[_0x91518(0xba)](0x3c));}if(_0x1a7146[_0x91518(0xb0)]>0x0&&!_0x252458[_0x91518(0xdd)])for(const _0x28293e of _0x1a7146){const _0x3fd2fc=_0x28293e['segmentFolderId']?_0x552cd7[_0x91518(0x12f)](_0x28293e[_0x91518(0xcf)][_0x91518(0xe6)]())||'':'',_0xee7835=_0x3fd2fc?_0x3fd2fc+'/'+_0x28293e['name']:_0x28293e[_0x91518(0xb8)],_0x5f3b4e=_0x4397dd[_0x91518(0x12f)](_0x28293e['id'])||[],_0x416707=_0x5f3b4e[_0x91518(0xb0)]>0x0?a42_0x5c0c85['dim']('\x20['+_0x5f3b4e[_0x91518(0xb0)]+_0x91518(0x137)):'';console['error']('\x0a'+a42_0x5c0c85['red']('Delete\x20segment:')+'\x20'+_0xee7835+_0x416707),console['error']('─'[_0x91518(0xba)](0x3c));const _0x3da24e=segmentWithActivationsToYaml(_0x28293e,_0x5f3b4e,undefined,_0x123660,_0x4a3999),_0x436d15=segmentToYamlString(_0x3da24e),_0x54faa0=generateDiff(_0x436d15,'');console[_0x91518(0xe3)](formatDiffWithColors(_0x54faa0)),console[_0x91518(0xe3)]('─'[_0x91518(0xba)](0x3c));}const _0x57f5c6=_0xfc4d0d[_0x91518(0x142)](_0x1c2d1f=>!_0x1c2d1f[_0x91518(0xed)]&&_0x1c2d1f[_0x91518(0xde)]);if(_0x57f5c6[_0x91518(0xb0)]>0x0&&!_0x252458[_0x91518(0xdd)])for(const _0x5157c3 of _0x57f5c6){const _0x205c6c=_0x5157c3[_0x91518(0x106)]?_0x5157c3[_0x91518(0x106)]+'/'+_0x5157c3['yamlConfig'][_0x91518(0xb8)]:_0x5157c3[_0x91518(0x145)][_0x91518(0xb8)];console['error']('\x0a'+a42_0x5c0c85['yellow'](_0x91518(0xc7))+'\x20'+_0x205c6c),console[_0x91518(0xe3)]('─'[_0x91518(0xba)](0x3c)),console[_0x91518(0xe3)](_0x5157c3[_0x91518(0xde)]),console[_0x91518(0xe3)]('─'[_0x91518(0xba)](0x3c));}if(_0x4ad941[_0x91518(0xb0)]>0x0)for(const _0x15dbfe of _0x4ad941){const _0x400725=_0x15dbfe[_0x91518(0x106)]?_0x15dbfe[_0x91518(0x106)]+'/'+_0x15dbfe[_0x91518(0x145)][_0x91518(0xb8)]:_0x15dbfe[_0x91518(0x145)][_0x91518(0xb8)];console[_0x91518(0xe3)]('\x0a'+a42_0x5c0c85[_0x91518(0x121)](_0x91518(0x11f))+'\x20'+_0x400725),console[_0x91518(0xe3)]('─'[_0x91518(0xba)](0x3c)),_0x15dbfe[_0x91518(0xde)]&&console[_0x91518(0xe3)](_0x15dbfe[_0x91518(0xde)]),console[_0x91518(0xe3)]('─'[_0x91518(0xba)](0x3c));}const _0x333bb0=_0x1291d9[_0x91518(0x142)](_0x375172=>!_0x375172[_0x91518(0xed)]&&_0x375172[_0x91518(0xde)]);if(_0x333bb0[_0x91518(0xb0)]>0x0)for(const _0x2046d0 of _0x333bb0){const _0x5198cb=_0x2046d0['folderPath']?_0x2046d0[_0x91518(0x106)]+'/'+_0x2046d0[_0x91518(0x145)][_0x91518(0xb8)]:_0x2046d0[_0x91518(0x145)][_0x91518(0xb8)];console['error']('\x0a'+a42_0x5c0c85[_0x91518(0x135)]('Changes\x20to\x20journey:')+'\x20'+_0x5198cb),console['error']('─'[_0x91518(0xba)](0x3c)),console[_0x91518(0xe3)](_0x2046d0[_0x91518(0xde)]),console[_0x91518(0xe3)]('─'[_0x91518(0xba)](0x3c));}if(_0x1de3eb[_0x91518(0xb0)]>0x0)for(const _0x46c686 of _0x1de3eb){const _0x3634da=_0x46c686['folderId']?_0x552cd7[_0x91518(0x12f)](_0x46c686[_0x91518(0xee)])||'':'',_0x1303ec=_0x3634da?_0x3634da+'/'+_0x46c686['journeyBundleName']:_0x46c686[_0x91518(0xda)];console['error']('\x0a'+a42_0x5c0c85['red'](_0x91518(0x146))+'\x20'+_0x1303ec),console[_0x91518(0xe3)]('─'[_0x91518(0xba)](0x3c)),console[_0x91518(0xe3)](a42_0x5c0c85['red'](_0x91518(0xeb))),console['error']('─'[_0x91518(0xba)](0x3c));}if(_0x252458[_0x91518(0xc5)])return console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x135)](_0x91518(0xf3))),0x0;const _0x194851=_0x252458['journeysOnly']?![]:_0x2adef6[_0x91518(0xb0)]>0x0||_0x15fcba[_0x91518(0xb0)]>0x0||_0x1a7146[_0x91518(0xb0)]>0x0,_0x5313a0=_0x4ad941['length']>0x0||_0x10d292[_0x91518(0xb0)]>0x0||_0x1de3eb['length']>0x0,_0x180044=_0x252458[_0x91518(0xdd)]?![]:_0x1168ea[_0x91518(0xb0)]>0x0,_0x2afb2c=_0x2993be[_0x91518(0xb0)]>0x0;if(!_0x194851&&!_0x5313a0&&!_0x180044&&!_0x2afb2c){const _0x53f735=_0x252458[_0x91518(0xdd)]?_0x91518(0xcc):_0x91518(0x10a);console[_0x91518(0xe3)](a42_0x5c0c85['green'](_0x53f735));if(_0x488bda&&_0x330108[_0x91518(0xb0)]===0x1){const _0x2672e8=_0x330108[0x0];if(_0x2672e8[_0x91518(0x133)]?.['id']){const _0xe04f20=getConsoleNextUrl(_0x252458[_0x91518(0xf4)],'/app/ps/'+_0x28933b+_0x91518(0xef)+_0x2672e8[_0x91518(0x133)]['id']+_0x91518(0xec));console[_0x91518(0xe3)](_0x91518(0x11e)+a42_0x5c0c85[_0x91518(0x117)](_0xe04f20));}}if(_0x488bda&&_0x47fc98[_0x91518(0xb0)]===0x1){const _0x343763=_0x47fc98[0x0];if(_0x343763[_0x91518(0x100)]?.['id']){const _0x3b1122=getConsoleNextUrl(_0x252458[_0x91518(0xf4)],_0x91518(0x103)+_0x28933b+_0x91518(0xef)+_0x343763[_0x91518(0x100)]['id']+'/j/da/je');console[_0x91518(0xe3)]('\x20\x20'+a42_0x5c0c85[_0x91518(0x117)](_0x3b1122));}}return 0x0;}const _0x342e6c=_0x252458['journeysOnly']?_0x4ad941[_0x91518(0xb0)]+_0x10d292[_0x91518(0xb0)]+_0x1de3eb[_0x91518(0xb0)]+_0x2993be[_0x91518(0xb0)]:_0x2adef6[_0x91518(0xb0)]+_0x15fcba[_0x91518(0xb0)]+_0x1a7146['length']+_0x4ad941[_0x91518(0xb0)]+_0x10d292[_0x91518(0xb0)]+_0x1de3eb['length']+_0x2993be['length']+_0x1168ea[_0x91518(0xb0)];if(!_0x252458['yes']&&_0x342e6c>0x0){if(!isInteractive())return console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x107)](_0x91518(0xd8)),_0x91518(0xc1)),console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0xb1)](_0x91518(0xb2))),0x1;const _0x3a7a38=await confirmKey('Push\x20'+_0x342e6c+'\x20changes?');if(!_0x3a7a38)return console[_0x91518(0xe3)](a42_0x5c0c85['yellow']('Aborted.')),0x1;}const _0x81bc41={'withProgress':async(_0x6e4e04,_0x1ed9bb)=>{const _0x387e65=_0x91518,_0x28cacf=await withSpinner(_0x6e4e04,_0x1ed9bb,{'verbose':_0x252458[_0x387e65(0xd4)]});return{'data':_0x28cacf['data']};},'logInfo':_0x5c76f7=>console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x143)]('✔\x20'+_0x5c76f7)),'logSuccess':_0x2fbc7b=>console['error'](a42_0x5c0c85[_0x91518(0x121)]('✔\x20'+_0x2fbc7b)),'logWarning':_0x3a92a1=>console[_0x91518(0xe3)](a42_0x5c0c85['yellow']('⚠\x20'+_0x3a92a1)),'logDeleted':_0xbbdba8=>console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x107)]('✔\x20'+_0xbbdba8))},_0x43139c={'segment':_0x507830['segment'],'journey':_0x507830[_0x91518(0xb5)],'user':_0x507830[_0x91518(0x123)],'connection':_0x507830[_0x91518(0x12a)]};_0x2993be[_0x91518(0xb0)]>0x0&&(_0x216b22=await executePushFolders(_0x43139c,_0x2993be,_0x216b22,{'parentId':_0x28933b},_0x81bc41));const _0xba50c8={'rootFolderId':_0x18fc6e,'folderPathToId':_0x216b22,'folderIdToPath':_0x552cd7,'segmentNameToId':_0x2bfd7c,'activationsBySegmentId':_0x4397dd,'emailToIdMap':_0x2f279a,'idToEmailMap':_0x123660,'connectionNameToIdMap':_0xfd2a8e[_0x91518(0x147)],'connectionIdToNameMap':_0xfd2a8e[_0x91518(0x148)],'connectionNameToTypeMap':_0x1fe588},_0x433e9d=await executePushSegments(_0x43139c,_0x252458[_0x91518(0xdd)]?[]:_0xfc4d0d,_0xba50c8,{'parentId':_0x28933b},_0x81bc41),_0x125f3e=_0x433e9d['created'],_0x3cc268=_0x433e9d['updated'],_0x5e7af5=_0x433e9d[_0x91518(0xfb)]['created'],_0xed0f93=_0x433e9d[_0x91518(0xfb)][_0x91518(0x109)],_0x3a5c7b=_0x433e9d[_0x91518(0xfb)][_0x91518(0x124)];let _0x53d02b;if(_0x488bda&&_0xfc4d0d[_0x91518(0xb0)]===0x1){const _0x205235=_0xfc4d0d[0x0];_0x53d02b=_0x205235[_0x91518(0x133)]?.['id']??_0x433e9d[_0x91518(0x130)][_0x91518(0x12f)](_0x205235['yamlConfig'][_0x91518(0xb8)]);}const _0x206ec0=await executePushSegmentDeletions(_0x43139c,_0x252458[_0x91518(0xdd)]?[]:_0x1a7146,_0x81bc41);let _0x3ab8ef=0x0,_0x22c25f=0x0,_0x381ec8=0x0;const _0x5a964b=new Map(_0x2bfd7c);for(const [_0x5a32cd,_0x215de6]of _0x433e9d[_0x91518(0x130)]){_0x5a964b['set'](_0x5a32cd,_0x215de6);}if(_0x1291d9[_0x91518(0xb0)]>0x0){const _0x333186={..._0xba50c8,'segmentNameToId':_0x5a964b,'existingSegments':_0x4279b6,'activationContext':_0x2d629a},_0x5a2e27=await executePushJourneys(_0x43139c,_0x1291d9,_0x333186,{'parentId':_0x28933b,'rootFolderId':_0x18fc6e,'verbose':_0x252458[_0x91518(0xd4)]},_0x81bc41);_0x3ab8ef=_0x5a2e27[_0x91518(0xbc)],_0x22c25f=_0x5a2e27[_0x91518(0x109)];if(_0x488bda&&_0x5a2e27[_0x91518(0xf8)][_0x91518(0xb0)]===0x1){const _0x260da5=_0x5a2e27[_0x91518(0xf8)][0x0];if(_0x260da5[_0x91518(0x13d)]){const _0x47a82f=getConsoleNextUrl(_0x252458[_0x91518(0xf4)],_0x91518(0x103)+_0x28933b+_0x91518(0xef)+_0x260da5[_0x91518(0x13d)]+'/j/da/je');console[_0x91518(0xe3)]('\x20\x20'+a42_0x5c0c85[_0x91518(0x117)](_0x47a82f));}}}for(const _0x35de3f of _0x1de3eb){console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x135)](_0x91518(0xea)+_0x35de3f[_0x91518(0xda)])),_0x381ec8++;}const _0x59a29f=[];if(_0x125f3e>0x0)_0x59a29f['push'](_0x125f3e+_0x91518(0xb7));if(_0x3cc268>0x0)_0x59a29f['push'](_0x3cc268+_0x91518(0x126));if(_0x206ec0>0x0)_0x59a29f[_0x91518(0x119)](_0x206ec0+'\x20deleted');const _0x11e52e=[];if(_0x3ab8ef>0x0)_0x11e52e[_0x91518(0x119)](_0x3ab8ef+_0x91518(0xb7));if(_0x22c25f>0x0)_0x11e52e[_0x91518(0x119)](_0x22c25f+_0x91518(0x126));if(_0x381ec8>0x0)_0x11e52e[_0x91518(0x119)](_0x381ec8+_0x91518(0xbf));const _0x44e56e=[];if(_0x5e7af5>0x0)_0x44e56e['push'](_0x5e7af5+'\x20created');if(_0xed0f93>0x0)_0x44e56e[_0x91518(0x119)](_0xed0f93+_0x91518(0x126));if(_0x3a5c7b>0x0)_0x44e56e[_0x91518(0x119)](_0x3a5c7b+_0x91518(0xbf));console[_0x91518(0xe3)](a42_0x5c0c85[_0x91518(0x121)](_0x91518(0xca)));_0x59a29f[_0x91518(0xb0)]>0x0&&!_0x252458[_0x91518(0xdd)]&&console[_0x91518(0xe3)](_0x91518(0x12d)+_0x59a29f['join'](',\x20'));_0x11e52e[_0x91518(0xb0)]>0x0&&console['error'](_0x91518(0xb9)+_0x11e52e[_0x91518(0xd6)](',\x20'));_0x44e56e['length']>0x0&&!_0x252458[_0x91518(0xdd)]&&console[_0x91518(0xe3)](_0x91518(0xdc)+_0x44e56e[_0x91518(0xd6)](',\x20'));if(_0x53d02b){const _0xda2d5a=getConsoleNextUrl(_0x252458['site'],_0x91518(0x103)+_0x28933b+_0x91518(0xef)+_0x53d02b+'/sb/da/esr');console[_0x91518(0xe3)](_0x91518(0x11e)+a42_0x5c0c85[_0x91518(0x117)](_0xda2d5a));}return 0x0;}}
1
+ const a42_0x4aa2d9=a42_0x25c6;(function(_0x530d06,_0x2b70cc){const _0x550b6f=a42_0x25c6,_0x43533d=_0x530d06();while(!![]){try{const _0x54f680=parseInt(_0x550b6f(0x1b1))/0x1+parseInt(_0x550b6f(0x164))/0x2*(-parseInt(_0x550b6f(0x142))/0x3)+parseInt(_0x550b6f(0x172))/0x4*(parseInt(_0x550b6f(0x1b7))/0x5)+parseInt(_0x550b6f(0x190))/0x6+parseInt(_0x550b6f(0x1be))/0x7+-parseInt(_0x550b6f(0x189))/0x8+-parseInt(_0x550b6f(0x18e))/0x9;if(_0x54f680===_0x2b70cc)break;else _0x43533d['push'](_0x43533d['shift']());}catch(_0x184429){_0x43533d['push'](_0x43533d['shift']());}}}(a42_0x5aaa,0x3f95c));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a42_0x25c6(_0x57c0eb,_0x8da767){_0x57c0eb=_0x57c0eb-0x138;const _0x5aaac7=a42_0x5aaa();let _0x25c68c=_0x5aaac7[_0x57c0eb];return _0x25c68c;}function a42_0x5aaa(){const _0x1610b9=['helpText','updated','\x20to\x20create','\x20activations]','site','connection','results','audienceId','folderPath','versionNumber','segment','folderId','journeysOnly','\x20\x20Segments:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','type','getOutputSchemaWithCache','red','Delete\x20journey:','\x20\x20Source:\x20','blue','\x20updated','Fetching\x20existing\x20data...','repeat','\x20YAML\x20files\x20found','dim','user','253446LFmvbD','Changes\x20to\x20journey:','all','\x27...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','📁\x20','Fetching\x20connections\x20for\x20name\x20resolution...','buildUserMaps','segmentFolderId','parent_name','(Journey\x20will\x20be\x20deleted)','/app/ps/','\x20\x20\x20\x20','resolveParentId','get','Preparing\x20journeys...','error','Fetching\x20existing\x20activations...','push','cwd','New\x20journey:','journeyBundleId','segment\x20or\x20journey','yellow','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','state','segments','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20\x20📊\x20Segments:','parentName','segment:push','folders','2IwbELj','listActivations','toString','dryRun','join','\x20\x20Journeys:\x20','paused','Error:\x20','\x20to\x20update','Aborted.','unchanged','activations','nameToId','journey','596AtKMjB','data','No\x20','journeyId','\x0aError:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','isScoped','listFolders','idToName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','delete','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','map','Site:\x20','length','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','parentFolder','createdSegmentIds','name','toCreate','\x20changed','journeyBundleName','isNew','3239480rMoVoo','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','existingJourney','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)','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','3543912Thfnmx','list','1259478WkaEtq','toDelete','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','yes','journeys','filter','New\x20segment:','yamlConfig','no_parent','targetDir','message','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20created','setPhase','then','/e/','Push\x20','existingSegment','\x20changes?','\x0aPush\x20summary\x20for\x20\x27','getJourney','\x0aValidation\x20failed:','diff','\x0a✔\x20Push\x20complete','new','\x20\x20Activations:','\x20new','verbose','\x20unchanged','parentSegment','green','created','relationships','177026DpUwtp','description','\x20to\x20delete','Source\x20directory:\x20','attributes','/sb/da/esr','11265xmkVat','set','listSegments','filePath','Delete\x20segment:','changed','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','2946951ezIIfv','cyan'];a42_0x5aaa=function(){return _0x1610b9;};return a42_0x5aaa();}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 a42_0x24aec8 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a42_0x4aa2d9(0x184)]=a42_0x4aa2d9(0x162);['description']=a42_0x4aa2d9(0x17d);async['execute'](_0x4a997d){const _0x46b65b=a42_0x4aa2d9,{options:_0x1ab175,args:_0x417c20,tdx:_0x319695}=_0x4a997d,_0x529a9c=_0x1ab175,_0x38907a=await resolveTarget({'arg':_0x417c20[0x0],'contextParent':_0x1ab175[_0x46b65b(0x1ad)],'cwd':process[_0x46b65b(0x156)]()});if(!isSuccessfulResolution(_0x38907a))return _0x38907a['errorCode']===_0x46b65b(0x198)?(console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x15e))),console[_0x46b65b(0x153)](_0x46b65b(0x18c)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x46b65b(0x153)](_0x46b65b(0x15f))):(console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x16b)+_0x38907a[_0x46b65b(0x19a)]+'\x0a')),_0x38907a[_0x46b65b(0x1c0)]&&console[_0x46b65b(0x153)](a42_0x24aec8['cyan'](_0x38907a[_0x46b65b(0x1c0)]))),0x1;if(_0x38907a[_0x46b65b(0x1cf)]===_0x46b65b(0x14c))return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)]('Error:\x20Directory\x20not\x20found:\x20'+_0x38907a[_0x46b65b(0x199)]+'\x0a')),console[_0x46b65b(0x153)](a42_0x24aec8['cyan'](_0x46b65b(0x181))),0x1;const _0x91d0cb=_0x38907a[_0x46b65b(0x161)],_0xf8eaa8=_0x38907a['targetDir'],_0xe7def0=_0x38907a[_0x46b65b(0x1cf)]==='file'?_0x38907a[_0x46b65b(0x1ba)]:undefined,_0x5ccec3=getScopedDetails(_0x38907a),_0x3e4eaf=_0x5ccec3?.[_0x46b65b(0x178)]??![],_0x496227=_0x5ccec3?.['scopedFolderPath']??'';if(!existsSync(_0xf8eaa8))return console[_0x46b65b(0x153)](a42_0x24aec8['red']('Error:\x20Directory\x20not\x20found:\x20'+_0xf8eaa8+'\x0a')),console['error'](a42_0x24aec8[_0x46b65b(0x1bf)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x529a9c[_0x46b65b(0x1ab)]&&(console['error'](_0x46b65b(0x17f)+_0x529a9c[_0x46b65b(0x1c4)]),console[_0x46b65b(0x153)]('Parent\x20segment:\x20'+_0x91d0cb),console['error'](_0x46b65b(0x1b4)+_0xf8eaa8),_0x3e4eaf&&console['error']('Scoped\x20to\x20folder:\x20'+_0x496227));const _0x7af75=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x91d0cb+_0x46b65b(0x145),()=>_0x319695['segment'][_0x46b65b(0x150)](_0x91d0cb),{'verbose':_0x529a9c[_0x46b65b(0x1ab)]}),_0x41d8fd=_0x7af75[_0x46b65b(0x173)],{parentSegmentResult:_0x5255b9,segmentsResult:_0x2875da,foldersResult:_0x471c2d,journeysWithDetailsResult:_0x2b3d8b,userMaps:_0x1f0ee3}=await withSpinner(_0x46b65b(0x13d),async()=>{const _0x5bc61d=_0x46b65b,[_0x312241,_0x226180,_0x19f65f,_0x57ff03,_0x4c1a72]=await Promise['all']([_0x319695[_0x5bc61d(0x1ca)]['getParent'](_0x41d8fd),_0x319695[_0x5bc61d(0x1ca)][_0x5bc61d(0x1b9)](_0x41d8fd),_0x319695['segment'][_0x5bc61d(0x179)](_0x41d8fd),_0x319695[_0x5bc61d(0x171)]['listJourneysWithDetailsFromParentSegment'](_0x41d8fd,{'includeAllVersions':!![]}),_0x319695[_0x5bc61d(0x141)][_0x5bc61d(0x14a)]()]);return{'parentSegmentResult':_0x312241,'segmentsResult':_0x226180,'foldersResult':_0x19f65f,'journeysWithDetailsResult':_0x57ff03,'userMaps':_0x4c1a72};},{'verbose':_0x529a9c[_0x46b65b(0x1ab)]})[_0x46b65b(0x19e)](_0x2f9719=>_0x2f9719[_0x46b65b(0x173)]),_0x11b67e=_0x5255b9,_0x357c56=extractRootFolderId(_0x11b67e),_0x1bb0d2=_0x2875da,_0x258c60=_0x471c2d,{journeys:_0xef5323,activationStepsById:_0x3f8b87}=_0x2b3d8b,_0x112442=new Map(_0xef5323['map'](_0x1f54a8=>[_0x1f54a8['id'],_0x1f54a8])),_0x81379f=_0xef5323['map'](_0x36f007=>({'id':_0x36f007['id'],'name':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x184)],'journeyBundleName':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x187)]||'','journeyBundleId':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x158)]||'','versionNumber':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x1c9)],'description':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x1b2)],'state':_0x36f007['attributes'][_0x46b65b(0x15c)],'paused':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x16a)],'audienceId':_0x36f007[_0x46b65b(0x1b5)][_0x46b65b(0x1c7)],'folderId':_0x36f007[_0x46b65b(0x1b0)]?.[_0x46b65b(0x182)]?.[_0x46b65b(0x173)]?.['id'],'createdAt':_0x36f007[_0x46b65b(0x1b5)]['createdAt'],'updatedAt':_0x36f007[_0x46b65b(0x1b5)]['updatedAt']})),{emailToId:_0x3efd99,idToEmail:_0x2e9478}=_0x1f0ee3,_0x21c847=await withSpinner(_0x46b65b(0x149),async()=>{const _0x3c6eb1=_0x46b65b,_0xdc658e=await _0x319695[_0x3c6eb1(0x1c5)][_0x3c6eb1(0x18f)]();return buildConnectionMaps(_0xdc658e);},{'verbose':_0x529a9c[_0x46b65b(0x1ab)]})[_0x46b65b(0x19e)](_0x27eec4=>_0x27eec4[_0x46b65b(0x173)]),_0x1a4fe1=_0x21c847[_0x46b65b(0x170)],_0x2d82ee=_0x21c847[_0x46b65b(0x17a)],_0x58a599=_0x21c847['nameToType'],_0x44b654={'emailToIdMap':_0x3efd99,'connectionNameToIdMap':_0x1a4fe1,'connectionNameToTypeMap':_0x58a599,'getSchema':_0x20841b=>_0x319695[_0x46b65b(0x1c5)][_0x46b65b(0x1d0)](_0x20841b)};let {pathToId:_0x28e9b4,idToPath:_0x24da81}=buildFolderMaps(_0x258c60);const _0x290c9c=buildSegmentLookupMap(_0x1bb0d2,_0x24da81),_0x259f9c=buildSegmentNameToIdMap(_0x1bb0d2),_0x5742e9=buildJourneyBundleLookupMap(_0x81379f,_0x24da81);let _0x5c0cdd;if(_0xe7def0){if(!_0xe7def0['endsWith']('.yml')&&!_0xe7def0['endsWith']('.yaml'))return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x147)+_0xe7def0+'\x0a')),0x1;_0x5c0cdd=[_0xe7def0];}else _0x5c0cdd=findYamlFiles(_0xf8eaa8);if(_0x5c0cdd[_0x46b65b(0x180)]===0x0)return console[_0x46b65b(0x153)](a42_0x24aec8['red'](_0x46b65b(0x18d)+_0xf8eaa8+'\x0a')),console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x1bf)](_0x46b65b(0x19b))),0x1;let _0x142fc0,_0x2511c0;try{const _0x575d70=parseAndClassifyYamlFiles(_0x5c0cdd,_0xf8eaa8,{'skipSegments':_0x529a9c[_0x46b65b(0x1cc)]});_0x142fc0=_0x575d70[_0x46b65b(0x15d)],_0x2511c0=_0x575d70[_0x46b65b(0x194)];const _0x3378ce=validateParsedFiles(_0x575d70,_0xf8eaa8);if(_0x3378ce[_0x46b65b(0x180)]>0x0)return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x1a5))),console['error'](formatValidationErrors(_0x3378ce)),console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x564131){return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)]('Error\x20parsing\x20YAML:\x20'+(_0x564131 instanceof Error?_0x564131[_0x46b65b(0x19a)]:_0x564131))),0x1;}if(_0x142fc0[_0x46b65b(0x180)]===0x0&&_0x2511c0[_0x46b65b(0x180)]===0x0){const _0x18e83f=_0x529a9c['journeysOnly']?_0x46b65b(0x171):_0x46b65b(0x159);return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x174)+_0x18e83f+_0x46b65b(0x13f))),0x0;}const _0x241e29=new Map();_0x1bb0d2[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)]&&await withSpinner(_0x46b65b(0x154),async()=>{await batchAsync(_0x1bb0d2,async _0x30578b=>{const _0x288f0d=a42_0x25c6,_0x2f173d=await _0x319695['segment'][_0x288f0d(0x165)](_0x41d8fd,_0x30578b['id']);_0x241e29[_0x288f0d(0x1b8)](_0x30578b['id'],_0x2f173d);});},{'verbose':_0x529a9c[_0x46b65b(0x1ab)]});const {segmentFiles:_0x5dbcdd,foldersToCreate:_0x423a41}=await prepareSegmentFiles(_0x142fc0,{'segmentByFolderAndName':_0x290c9c,'activationsBySegmentId':_0x241e29,'folderPathToId':_0x28e9b4,'idToEmailMap':_0x2e9478,'connectionIdToNameMap':_0x2d82ee},_0x44b654,_0x3e4eaf,_0x496227),_0x4891c8=_0xe7def0?[]:findSegmentsToDelete(_0x1bb0d2,_0x142fc0[_0x46b65b(0x17e)](({yamlConfig:_0xde9fbe,folderPath:_0x376ebc})=>({'yamlConfig':_0xde9fbe,'folderPath':resolveTDFolderPath(_0x376ebc,_0x3e4eaf,_0x496227)})),_0x24da81,_0x496227,_0x3e4eaf),{journeyFiles:_0x38460e,foldersToCreate:_0x55e17d}=await withProgressSpinner(_0x46b65b(0x152),async _0x291396=>prepareJourneyFiles(_0x2511c0,{'fetchJourney':async _0x7d8fc2=>_0x319695[_0x46b65b(0x171)][_0x46b65b(0x1a4)](_0x7d8fc2[_0x46b65b(0x175)]),'journeyBundlesByFolderAndName':_0x5742e9,'folderPathToId':_0x28e9b4,'idToEmailMap':_0x2e9478,'connectionIdToNameMap':_0x2d82ee,'existingSegments':_0x1bb0d2,'parentId':_0x41d8fd,'deps':_0x319695,'progress':{'update':_0x325531=>{const _0x14209c=_0x46b65b;_0x291396[_0x14209c(0x19d)](_0x325531),_0x529a9c['verbose']&&console[_0x14209c(0x153)]('\x20\x20'+_0x325531);}},'journeyById':_0x112442,'activationStepsById':_0x3f8b87},_0x3e4eaf,_0x496227),{'verbose':_0x529a9c[_0x46b65b(0x1ab)]})[_0x46b65b(0x19e)](_0x57df16=>_0x57df16[_0x46b65b(0x173)]);for(const _0x40f0f1 of _0x55e17d){_0x423a41['add'](_0x40f0f1);}const _0x5e7d66=_0xe7def0?[]:findJourneysToDelete(_0x81379f,_0x2511c0['map'](({yamlConfig:_0x44bfac,folderPath:_0xd1eee4})=>({'yamlConfig':_0x44bfac,'folderPath':resolveTDFolderPath(_0xd1eee4,_0x3e4eaf,_0x496227)})),_0x24da81,_0x496227,_0x3e4eaf),_0x55629f=calculatePushStats(_0x5dbcdd,_0x38460e,_0x423a41,_0x4891c8,_0x5e7d66,!!_0x529a9c[_0x46b65b(0x17c)],!!_0x529a9c['journeysOnly']),_0x1e856e=_0x55629f[_0x46b65b(0x15d)]['new'],_0x4bbab7=_0x55629f[_0x46b65b(0x15d)][_0x46b65b(0x1bc)],_0x489966=_0x55629f[_0x46b65b(0x15d)]['unchanged'],_0x3afcb3=_0x55629f[_0x46b65b(0x15d)][_0x46b65b(0x191)],_0x4f6aa1=_0x55629f[_0x46b65b(0x163)][_0x46b65b(0x185)],_0x4003fa=_0x55629f[_0x46b65b(0x194)][_0x46b65b(0x1a8)],_0x371b1d=_0x55629f[_0x46b65b(0x194)][_0x46b65b(0x1bc)],_0x28c67e=_0x55629f[_0x46b65b(0x194)][_0x46b65b(0x16e)],_0x4a1d71=_0x55629f[_0x46b65b(0x194)][_0x46b65b(0x191)],_0x3cf56a=_0x55629f[_0x46b65b(0x16f)][_0x46b65b(0x144)],_0x2378d9=_0x55629f[_0x46b65b(0x16f)][_0x46b65b(0x185)],_0x3c19e6=_0x55629f['activations']['toUpdate'],_0xbe84fb=_0x55629f['activations'][_0x46b65b(0x191)];console[_0x46b65b(0x153)](_0x46b65b(0x1a3)+_0x91d0cb+'\x27:');_0x4f6aa1[_0x46b65b(0x180)]>0x0&&console[_0x46b65b(0x153)]('\x20\x20'+a42_0x24aec8[_0x46b65b(0x13b)](_0x46b65b(0x148)+_0x4f6aa1[_0x46b65b(0x180)]+'\x20folders\x20to\x20create'));if(!_0x529a9c[_0x46b65b(0x1cc)]){console[_0x46b65b(0x153)](_0x46b65b(0x160)),console['error']('\x20\x20\x20\x20'+a42_0x24aec8[_0x46b65b(0x1ae)]('+\x20'+_0x1e856e['length']+_0x46b65b(0x1aa))),console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8['yellow']('~\x20'+_0x4bbab7[_0x46b65b(0x180)]+_0x46b65b(0x186)));if(_0x3afcb3['length']>0x0)console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x138)]('-\x20'+_0x3afcb3[_0x46b65b(0x180)]+_0x46b65b(0x1b3)));else _0x4891c8[_0x46b65b(0x180)]>0x0&&!_0x529a9c['delete']&&console['error'](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x140)](_0x4891c8[_0x46b65b(0x180)]+_0x46b65b(0x1bd)));console[_0x46b65b(0x153)]('\x20\x20\x20\x20'+a42_0x24aec8[_0x46b65b(0x140)]('=\x20'+_0x489966[_0x46b65b(0x180)]+_0x46b65b(0x1ac)));}if(_0x38460e['length']>0x0||_0x5e7d66[_0x46b65b(0x180)]>0x0){console[_0x46b65b(0x153)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x1ae)]('+\x20'+_0x4003fa['length']+_0x46b65b(0x1aa))),console[_0x46b65b(0x153)]('\x20\x20\x20\x20'+a42_0x24aec8['yellow']('~\x20'+_0x371b1d[_0x46b65b(0x180)]+_0x46b65b(0x186)));if(_0x4a1d71[_0x46b65b(0x180)]>0x0)console[_0x46b65b(0x153)]('\x20\x20\x20\x20'+a42_0x24aec8[_0x46b65b(0x138)]('-\x20'+_0x4a1d71[_0x46b65b(0x180)]+_0x46b65b(0x1b3)));else _0x5e7d66[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x17c)]&&console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x140)](_0x5e7d66[_0x46b65b(0x180)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x140)]('=\x20'+_0x28c67e[_0x46b65b(0x180)]+'\x20unchanged'));}_0x3cf56a['length']>0x0&&!_0x529a9c['journeysOnly']&&(console[_0x46b65b(0x153)](''),console[_0x46b65b(0x153)](_0x46b65b(0x1a9)),_0x2378d9[_0x46b65b(0x180)]>0x0&&console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x1ae)]('+\x20'+_0x2378d9[_0x46b65b(0x180)]+_0x46b65b(0x1c2))),_0x3c19e6[_0x46b65b(0x180)]>0x0&&console['error'](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x15a)]('~\x20'+_0x3c19e6[_0x46b65b(0x180)]+_0x46b65b(0x16c))),_0xbe84fb[_0x46b65b(0x180)]>0x0&&console[_0x46b65b(0x153)](_0x46b65b(0x14f)+a42_0x24aec8[_0x46b65b(0x138)]('-\x20'+_0xbe84fb['length']+'\x20to\x20delete')));console['error'](_0x46b65b(0x13a)+a42_0x24aec8[_0x46b65b(0x1bf)](_0xf8eaa8)+'\x0a');if(_0x4f6aa1['length']>0x0){console[_0x46b65b(0x153)]('Folders\x20to\x20create:');for(const _0xda1260 of _0x4f6aa1){console[_0x46b65b(0x153)]('\x20\x20'+a42_0x24aec8[_0x46b65b(0x13b)]('+')+'\x20'+_0xda1260);}console[_0x46b65b(0x153)]('');}if(_0x1e856e[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)])for(const _0x119b4b of _0x1e856e){const _0x2322f3=_0x119b4b['folderPath']?_0x119b4b[_0x46b65b(0x1c8)]+'/'+_0x119b4b[_0x46b65b(0x197)][_0x46b65b(0x184)]:_0x119b4b[_0x46b65b(0x197)][_0x46b65b(0x184)],_0x381021=_0x119b4b['yamlConfig']['activations']?.[_0x46b65b(0x180)]||0x0,_0x8c1eb3=_0x381021>0x0?a42_0x24aec8['dim']('\x20['+_0x381021+_0x46b65b(0x1c3)):'';console[_0x46b65b(0x153)]('\x0a'+a42_0x24aec8['green'](_0x46b65b(0x196))+'\x20'+_0x2322f3+_0x8c1eb3),console['error']('─'[_0x46b65b(0x13e)](0x3c)),_0x119b4b['diff']&&console['error'](_0x119b4b['diff']),console['error']('─'[_0x46b65b(0x13e)](0x3c));}if(_0x3afcb3[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)])for(const _0x4bfc5a of _0x3afcb3){const _0x12c054=_0x4bfc5a[_0x46b65b(0x14b)]?_0x24da81[_0x46b65b(0x151)](_0x4bfc5a['segmentFolderId'][_0x46b65b(0x166)]())||'':'',_0xa99815=_0x12c054?_0x12c054+'/'+_0x4bfc5a[_0x46b65b(0x184)]:_0x4bfc5a[_0x46b65b(0x184)],_0x8537e=_0x241e29[_0x46b65b(0x151)](_0x4bfc5a['id'])||[],_0x542358=_0x8537e[_0x46b65b(0x180)]>0x0?a42_0x24aec8[_0x46b65b(0x140)]('\x20['+_0x8537e[_0x46b65b(0x180)]+_0x46b65b(0x1c3)):'';console[_0x46b65b(0x153)]('\x0a'+a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x1bb))+'\x20'+_0xa99815+_0x542358),console[_0x46b65b(0x153)]('─'['repeat'](0x3c));const _0x1daa87=segmentWithActivationsToYaml(_0x4bfc5a,_0x8537e,undefined,_0x2e9478,_0x2d82ee),_0x22d5d6=segmentToYamlString(_0x1daa87),_0x5840b9=generateDiff(_0x22d5d6,'');console['error'](formatDiffWithColors(_0x5840b9)),console[_0x46b65b(0x153)]('─'['repeat'](0x3c));}const _0x30c9c5=_0x5dbcdd['filter'](_0x549006=>!_0x549006[_0x46b65b(0x188)]&&_0x549006[_0x46b65b(0x1a6)]);if(_0x30c9c5[_0x46b65b(0x180)]>0x0&&!_0x529a9c['journeysOnly'])for(const _0x543181 of _0x30c9c5){const _0x22513f=_0x543181['folderPath']?_0x543181[_0x46b65b(0x1c8)]+'/'+_0x543181[_0x46b65b(0x197)]['name']:_0x543181[_0x46b65b(0x197)][_0x46b65b(0x184)];console['error']('\x0a'+a42_0x24aec8['yellow']('Changes\x20to:')+'\x20'+_0x22513f),console['error']('─'['repeat'](0x3c)),console[_0x46b65b(0x153)](_0x543181[_0x46b65b(0x1a6)]),console[_0x46b65b(0x153)]('─'['repeat'](0x3c));}if(_0x4003fa[_0x46b65b(0x180)]>0x0)for(const _0x14082e of _0x4003fa){const _0x3d04e2=_0x14082e[_0x46b65b(0x1c8)]?_0x14082e[_0x46b65b(0x1c8)]+'/'+_0x14082e[_0x46b65b(0x197)]['name']:_0x14082e[_0x46b65b(0x197)][_0x46b65b(0x184)];console['error']('\x0a'+a42_0x24aec8[_0x46b65b(0x1ae)](_0x46b65b(0x157))+'\x20'+_0x3d04e2),console['error']('─'[_0x46b65b(0x13e)](0x3c)),_0x14082e[_0x46b65b(0x1a6)]&&console[_0x46b65b(0x153)](_0x14082e['diff']),console[_0x46b65b(0x153)]('─'[_0x46b65b(0x13e)](0x3c));}const _0x3920d0=_0x38460e[_0x46b65b(0x195)](_0x2b9ed9=>!_0x2b9ed9[_0x46b65b(0x188)]&&_0x2b9ed9[_0x46b65b(0x1a6)]);if(_0x3920d0['length']>0x0)for(const _0x5af95c of _0x3920d0){const _0x1fa91a=_0x5af95c[_0x46b65b(0x1c8)]?_0x5af95c[_0x46b65b(0x1c8)]+'/'+_0x5af95c[_0x46b65b(0x197)][_0x46b65b(0x184)]:_0x5af95c['yamlConfig']['name'];console[_0x46b65b(0x153)]('\x0a'+a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x143))+'\x20'+_0x1fa91a),console[_0x46b65b(0x153)]('─'['repeat'](0x3c)),console[_0x46b65b(0x153)](_0x5af95c['diff']),console[_0x46b65b(0x153)]('─'[_0x46b65b(0x13e)](0x3c));}if(_0x4a1d71[_0x46b65b(0x180)]>0x0)for(const _0x2736c7 of _0x4a1d71){const _0x361a78=_0x2736c7[_0x46b65b(0x1cb)]?_0x24da81['get'](_0x2736c7[_0x46b65b(0x1cb)])||'':'',_0x42a61b=_0x361a78?_0x361a78+'/'+_0x2736c7['journeyBundleName']:_0x2736c7['journeyBundleName'];console[_0x46b65b(0x153)]('\x0a'+a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x139))+'\x20'+_0x42a61b),console[_0x46b65b(0x153)]('─'[_0x46b65b(0x13e)](0x3c)),console['error'](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x14d))),console[_0x46b65b(0x153)]('─'[_0x46b65b(0x13e)](0x3c));}if(_0x529a9c[_0x46b65b(0x167)])return console[_0x46b65b(0x153)](a42_0x24aec8['yellow'](_0x46b65b(0x18a))),0x0;const _0x2402d5=_0x529a9c[_0x46b65b(0x1cc)]?![]:_0x1e856e['length']>0x0||_0x4bbab7[_0x46b65b(0x180)]>0x0||_0x3afcb3[_0x46b65b(0x180)]>0x0,_0x2317ae=_0x4003fa[_0x46b65b(0x180)]>0x0||_0x371b1d[_0x46b65b(0x180)]>0x0||_0x4a1d71[_0x46b65b(0x180)]>0x0,_0x149df0=_0x529a9c[_0x46b65b(0x1cc)]?![]:_0x3cf56a[_0x46b65b(0x180)]>0x0,_0x36bde1=_0x4f6aa1[_0x46b65b(0x180)]>0x0;if(!_0x2402d5&&!_0x2317ae&&!_0x149df0&&!_0x36bde1){const _0x3a5720=_0x529a9c[_0x46b65b(0x1cc)]?_0x46b65b(0x17b):_0x46b65b(0x1ce);console['error'](a42_0x24aec8[_0x46b65b(0x1ae)](_0x3a5720));if(_0xe7def0&&_0x489966[_0x46b65b(0x180)]===0x1){const _0x5e661b=_0x489966[0x0];if(_0x5e661b[_0x46b65b(0x1a1)]?.['id']){const _0x250cd0=getConsoleNextUrl(_0x529a9c[_0x46b65b(0x1c4)],_0x46b65b(0x14e)+_0x41d8fd+_0x46b65b(0x19f)+_0x5e661b[_0x46b65b(0x1a1)]['id']+'/sb/da/esr');console['error'](_0x46b65b(0x177)+a42_0x24aec8[_0x46b65b(0x1bf)](_0x250cd0));}}if(_0xe7def0&&_0x28c67e[_0x46b65b(0x180)]===0x1){const _0x554d6b=_0x28c67e[0x0];if(_0x554d6b[_0x46b65b(0x18b)]?.['id']){const _0x38ba5c=getConsoleNextUrl(_0x529a9c[_0x46b65b(0x1c4)],_0x46b65b(0x14e)+_0x41d8fd+_0x46b65b(0x19f)+_0x554d6b[_0x46b65b(0x18b)]['id']+'/j/da/je');console[_0x46b65b(0x153)]('\x20\x20'+a42_0x24aec8['cyan'](_0x38ba5c));}}return 0x0;}const _0x2a4023=_0x529a9c[_0x46b65b(0x1cc)]?_0x4003fa[_0x46b65b(0x180)]+_0x371b1d[_0x46b65b(0x180)]+_0x4a1d71[_0x46b65b(0x180)]+_0x4f6aa1['length']:_0x1e856e['length']+_0x4bbab7[_0x46b65b(0x180)]+_0x3afcb3[_0x46b65b(0x180)]+_0x4003fa[_0x46b65b(0x180)]+_0x371b1d[_0x46b65b(0x180)]+_0x4a1d71[_0x46b65b(0x180)]+_0x4f6aa1[_0x46b65b(0x180)]+_0x3cf56a[_0x46b65b(0x180)];if(!_0x529a9c[_0x46b65b(0x193)]&&_0x2a4023>0x0){if(!isInteractive())return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x138)](_0x46b65b(0x176)),_0x46b65b(0x15b)),console['error'](a42_0x24aec8['dim'](_0x46b65b(0x146))),0x1;const _0x361efd=await confirmKey(_0x46b65b(0x1a0)+_0x2a4023+_0x46b65b(0x1a2));if(!_0x361efd)return console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x16d))),0x1;}const _0x144c10={'withProgress':async(_0xc68c3,_0xd57562)=>{const _0x361286=_0x46b65b,_0x376b86=await withSpinner(_0xc68c3,_0xd57562,{'verbose':_0x529a9c[_0x361286(0x1ab)]});return{'data':_0x376b86['data']};},'logInfo':_0x360e42=>console['error'](a42_0x24aec8[_0x46b65b(0x13b)]('✔\x20'+_0x360e42)),'logSuccess':_0x561bc5=>console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x1ae)]('✔\x20'+_0x561bc5)),'logWarning':_0x16f59c=>console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)]('⚠\x20'+_0x16f59c)),'logDeleted':_0x3d07f0=>console['error'](a42_0x24aec8[_0x46b65b(0x138)]('✔\x20'+_0x3d07f0))},_0x4b8e32={'segment':_0x319695['segment'],'journey':_0x319695[_0x46b65b(0x171)],'user':_0x319695[_0x46b65b(0x141)],'connection':_0x319695[_0x46b65b(0x1c5)]};_0x4f6aa1[_0x46b65b(0x180)]>0x0&&(_0x28e9b4=await executePushFolders(_0x4b8e32,_0x4f6aa1,_0x28e9b4,{'parentId':_0x41d8fd},_0x144c10));const _0x8747db={'rootFolderId':_0x357c56,'folderPathToId':_0x28e9b4,'folderIdToPath':_0x24da81,'segmentNameToId':_0x259f9c,'activationsBySegmentId':_0x241e29,'emailToIdMap':_0x3efd99,'idToEmailMap':_0x2e9478,'connectionNameToIdMap':_0x21c847[_0x46b65b(0x170)],'connectionIdToNameMap':_0x21c847[_0x46b65b(0x17a)],'connectionNameToTypeMap':_0x58a599},_0x24ff67=await executePushSegments(_0x4b8e32,_0x529a9c[_0x46b65b(0x1cc)]?[]:_0x5dbcdd,_0x8747db,{'parentId':_0x41d8fd},_0x144c10),_0x3e3242=_0x24ff67[_0x46b65b(0x1af)],_0x5b9803=_0x24ff67['updated'],_0x1efefb=_0x24ff67[_0x46b65b(0x16f)][_0x46b65b(0x1af)],_0x3759d1=_0x24ff67[_0x46b65b(0x16f)][_0x46b65b(0x1c1)],_0x4901d9=_0x24ff67[_0x46b65b(0x16f)]['deleted'];let _0x4d2619;if(_0xe7def0&&_0x5dbcdd[_0x46b65b(0x180)]===0x1){const _0x29ee95=_0x5dbcdd[0x0];_0x4d2619=_0x29ee95[_0x46b65b(0x1a1)]?.['id']??_0x24ff67[_0x46b65b(0x183)][_0x46b65b(0x151)](_0x29ee95[_0x46b65b(0x197)][_0x46b65b(0x184)]);}const _0x161827=await executePushSegmentDeletions(_0x4b8e32,_0x529a9c['journeysOnly']?[]:_0x3afcb3,_0x144c10);let _0x1d816d=0x0,_0x3a7d7d=0x0,_0x169dfd=0x0;const _0x54baa9=new Map(_0x259f9c);for(const [_0x1ff584,_0x4faa49]of _0x24ff67[_0x46b65b(0x183)]){_0x54baa9[_0x46b65b(0x1b8)](_0x1ff584,_0x4faa49);}if(_0x38460e[_0x46b65b(0x180)]>0x0){const _0x421e4c={..._0x8747db,'segmentNameToId':_0x54baa9,'existingSegments':_0x1bb0d2,'activationContext':_0x44b654},_0x53a51a=await executePushJourneys(_0x4b8e32,_0x38460e,_0x421e4c,{'parentId':_0x41d8fd,'rootFolderId':_0x357c56,'verbose':_0x529a9c[_0x46b65b(0x1ab)]},_0x144c10);_0x1d816d=_0x53a51a['created'],_0x3a7d7d=_0x53a51a[_0x46b65b(0x1c1)];if(_0xe7def0&&_0x53a51a[_0x46b65b(0x1c6)][_0x46b65b(0x180)]===0x1){const _0x31f8fe=_0x53a51a[_0x46b65b(0x1c6)][0x0];if(_0x31f8fe['journeyId']){const _0x355c19=getConsoleNextUrl(_0x529a9c[_0x46b65b(0x1c4)],_0x46b65b(0x14e)+_0x41d8fd+_0x46b65b(0x19f)+_0x31f8fe['journeyId']+'/j/da/je');console['error']('\x20\x20'+a42_0x24aec8[_0x46b65b(0x1bf)](_0x355c19));}}}for(const _0x3e6c7a of _0x4a1d71){console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x15a)](_0x46b65b(0x192)+_0x3e6c7a[_0x46b65b(0x187)])),_0x169dfd++;}const _0x736dc4=[];if(_0x3e3242>0x0)_0x736dc4['push'](_0x3e3242+_0x46b65b(0x19c));if(_0x5b9803>0x0)_0x736dc4[_0x46b65b(0x155)](_0x5b9803+_0x46b65b(0x13c));if(_0x161827>0x0)_0x736dc4[_0x46b65b(0x155)](_0x161827+'\x20deleted');const _0x467e8a=[];if(_0x1d816d>0x0)_0x467e8a[_0x46b65b(0x155)](_0x1d816d+_0x46b65b(0x19c));if(_0x3a7d7d>0x0)_0x467e8a[_0x46b65b(0x155)](_0x3a7d7d+'\x20updated');if(_0x169dfd>0x0)_0x467e8a[_0x46b65b(0x155)](_0x169dfd+'\x20deleted');const _0x11d4fd=[];if(_0x1efefb>0x0)_0x11d4fd['push'](_0x1efefb+_0x46b65b(0x19c));if(_0x3759d1>0x0)_0x11d4fd[_0x46b65b(0x155)](_0x3759d1+_0x46b65b(0x13c));if(_0x4901d9>0x0)_0x11d4fd[_0x46b65b(0x155)](_0x4901d9+'\x20deleted');console[_0x46b65b(0x153)](a42_0x24aec8[_0x46b65b(0x1ae)](_0x46b65b(0x1a7)));_0x736dc4[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)]&&console['error'](_0x46b65b(0x1cd)+_0x736dc4[_0x46b65b(0x168)](',\x20'));_0x467e8a[_0x46b65b(0x180)]>0x0&&console[_0x46b65b(0x153)](_0x46b65b(0x169)+_0x467e8a['join'](',\x20'));_0x11d4fd[_0x46b65b(0x180)]>0x0&&!_0x529a9c[_0x46b65b(0x1cc)]&&console[_0x46b65b(0x153)]('\x20\x20Activations:\x20'+_0x11d4fd[_0x46b65b(0x168)](',\x20'));if(_0x4d2619){const _0x4054ab=getConsoleNextUrl(_0x529a9c[_0x46b65b(0x1c4)],'/app/ps/'+_0x41d8fd+'/e/'+_0x4d2619+_0x46b65b(0x1b6));console[_0x46b65b(0x153)](_0x46b65b(0x177)+a42_0x24aec8[_0x46b65b(0x1bf)](_0x4054ab));}return 0x0;}}
@@ -1 +1 @@
1
- function a43_0x4415(){const _0x551727=['Resolved\x20relative\x20path\x20to:\x20','190022PezLPm','70734OpfBJY','22904380wDdOJC','yellow','Parent\x20ID:\x20','\x20\x20\x20Path:\x20','segmentId','parentId','Resolving\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','execute','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','folder','length','504cMUMBP','Updating\x20segment\x20\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','name','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20folder\x20ID:\x20','Resolved\x20type:\x20','description','12OXLaEr','387516mGotQR','rule','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','segmentPath','resolveFolderId','✔\x20Updated\x20segment\x20\x27','verbose','\x27...','688895xUFoyK','segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','21QxrHqJ','data','879259SYHouf','type','segmentName','error','128745dunErT','Segment\x20ID\x20missing\x20from\x20resolved\x20path','includes','resolvePathToResource'];a43_0x4415=function(){return _0x551727;};return a43_0x4415();}const a43_0x2bd67a=a43_0x3afb;(function(_0x321875,_0x251cea){const _0x5e385f=a43_0x3afb,_0xafdcea=_0x321875();while(!![]){try{const _0x5b95bf=-parseInt(_0x5e385f(0x9a))/0x1+-parseInt(_0x5e385f(0xa4))/0x2*(parseInt(_0x5e385f(0x98))/0x3)+-parseInt(_0x5e385f(0x8b))/0x4+parseInt(_0x5e385f(0x94))/0x5*(parseInt(_0x5e385f(0x8a))/0x6)+parseInt(_0x5e385f(0xa3))/0x7+parseInt(_0x5e385f(0xb1))/0x8*(-parseInt(_0x5e385f(0x9e))/0x9)+parseInt(_0x5e385f(0xa5))/0xa;if(_0x5b95bf===_0x251cea)break;else _0xafdcea['push'](_0xafdcea['shift']());}catch(_0x4f47d7){_0xafdcea['push'](_0xafdcea['shift']());}}}(a43_0x4415,0x724fc));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a43_0x3afb(_0x21273f,_0x3b656d){_0x21273f=_0x21273f-0x86;const _0x44156f=a43_0x4415();let _0x3afbcc=_0x44156f[_0x21273f];return _0x3afbcc;}import a43_0x461b31 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x2bd67a(0xb4)]='segment:update';[a43_0x2bd67a(0x89)]='Update\x20existing\x20child\x20segment';async[a43_0x2bd67a(0xad)](_0x37ff21){const _0x8ce0a1=a43_0x2bd67a;console['error'](a43_0x461b31[_0x8ce0a1(0xa6)](_0x8ce0a1(0xae))),console[_0x8ce0a1(0x9d)](a43_0x461b31[_0x8ce0a1(0xa6)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x2955d8,args:_0x21419c,tdx:_0x2a76ad}=_0x37ff21,_0x587521=_0x2955d8;if(_0x21419c[_0x8ce0a1(0xb0)]===0x0)return console['error'](_0x8ce0a1(0xb3)),console['error'](_0x8ce0a1(0xac)),console[_0x8ce0a1(0x9d)]('Examples:'),console['error'](_0x8ce0a1(0x8e)),console['error'](_0x8ce0a1(0x96)),0x1;const _0x280a67=_0x21419c[0x0],_0x5ae7f1=_0x2955d8[_0x8ce0a1(0x8f)];let _0x2c253e=_0x280a67;_0x5ae7f1&&!_0x280a67[_0x8ce0a1(0xa0)]('/')&&(_0x2c253e=_0x5ae7f1+'/'+_0x280a67,_0x587521['verbose']&&console[_0x8ce0a1(0x9d)](_0x8ce0a1(0xa2)+_0x2c253e));const _0x166c88=await withSpinner(_0x8ce0a1(0x8d)+_0x2c253e+_0x8ce0a1(0x93),()=>_0x2a76ad[_0x8ce0a1(0x95)][_0x8ce0a1(0xa1)](_0x2c253e),{'verbose':_0x587521['verbose']}),_0x4970f4=_0x166c88[_0x8ce0a1(0x99)];_0x587521['verbose']&&console[_0x8ce0a1(0x9d)](_0x8ce0a1(0x88)+_0x4970f4[_0x8ce0a1(0x9b)]);if(_0x4970f4[_0x8ce0a1(0x9b)]!=='segment')return console[_0x8ce0a1(0x9d)]('Error:\x20Cannot\x20update\x20'+_0x4970f4[_0x8ce0a1(0x9b)]+_0x8ce0a1(0x86)),console[_0x8ce0a1(0x9d)](_0x8ce0a1(0x97)),0x1;if(!_0x4970f4[_0x8ce0a1(0xa9)])throw new SDKError(ErrorCode['INTERNAL'],_0x8ce0a1(0x9f));const _0x56c7dc=_0x4970f4[_0x8ce0a1(0xaa)],_0x1d40d5=_0x4970f4[_0x8ce0a1(0xa9)];_0x587521[_0x8ce0a1(0x92)]&&(console['error'](_0x8ce0a1(0xa7)+_0x56c7dc),console[_0x8ce0a1(0x9d)]('Segment\x20ID:\x20'+_0x1d40d5));let _0xb34ddf;if(_0x587521[_0x8ce0a1(0xaf)]){const _0x162420=_0x587521[_0x8ce0a1(0xaf)],_0x1228fb=await withSpinner(_0x8ce0a1(0xab)+_0x162420+_0x8ce0a1(0x93),()=>_0x2a76ad['segment'][_0x8ce0a1(0x90)](_0x56c7dc,_0x162420),{'verbose':_0x587521['verbose']});_0xb34ddf=parseInt(_0x1228fb[_0x8ce0a1(0x99)],0xa),_0x587521[_0x8ce0a1(0x92)]&&console['error'](_0x8ce0a1(0x87)+_0xb34ddf);}const _0x157906=await loadJSONFromOptions(_0x587521[_0x8ce0a1(0x8c)],_0x587521['ruleFile']),_0x48d1f1={'name':_0x587521[_0x8ce0a1(0xb4)],'description':_0x587521[_0x8ce0a1(0x89)],'rule':_0x157906,'kind':_0x587521[_0x8ce0a1(0xb5)]!==undefined?parseInt(_0x587521[_0x8ce0a1(0xb5)],0xa):undefined,'segmentFolderId':_0xb34ddf},_0x49d089=await withSpinner(_0x8ce0a1(0xb2)+_0x4970f4[_0x8ce0a1(0x9c)]+_0x8ce0a1(0x93),()=>_0x2a76ad[_0x8ce0a1(0x95)]['updateSegmentById'](_0x56c7dc,_0x1d40d5,_0x48d1f1),{'verbose':_0x587521[_0x8ce0a1(0x92)]}),_0x389f15=_0x49d089[_0x8ce0a1(0x99)];return console[_0x8ce0a1(0x9d)](_0x8ce0a1(0x91)+_0x389f15[_0x8ce0a1(0xb4)]+'\x27'),_0x2c253e!==_0x280a67&&console[_0x8ce0a1(0x9d)](_0x8ce0a1(0xa8)+_0x2c253e),await handleSDKOutput([_0x389f15],_0x587521),0x0;}}
1
+ function a43_0x5bae(){const _0x10becd=['resolvePathToResource','554729amkbCR','type','kind','yellow','segmentPath','16KFVPDe','Parent\x20ID:\x20','4067127pUwpcH','2839150rrHqar','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','11pnUbED','segment','rule','includes','Resolved\x20type:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Resolved\x20relative\x20path\x20to:\x20','length','Update\x20existing\x20child\x20segment','Resolving\x20path\x20\x27','data','3vUIxfY','parentId','232xnUhaK','execute','Error:\x20Cannot\x20update\x20','name','5948946mLTzwj','resolveFolderId','folder','segmentId','407300oZcIUW','description','INTERNAL','\x20\x20\x20Path:\x20','segment:update','Segment\x20ID:\x20','\x27...','Updating\x20segment\x20\x27','error','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','ruleFile','Examples:','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','updateSegmentById','532738SRSQiD','5850jCJQOt'];a43_0x5bae=function(){return _0x10becd;};return a43_0x5bae();}const a43_0x477905=a43_0x1771;(function(_0x1fa49e,_0x528419){const _0x29db2e=a43_0x1771,_0x509fea=_0x1fa49e();while(!![]){try{const _0x1738a0=-parseInt(_0x29db2e(0x1ee))/0x1*(parseInt(_0x29db2e(0x206))/0x2)+-parseInt(_0x29db2e(0x207))/0x3*(-parseInt(_0x29db2e(0x1f0))/0x4)+-parseInt(_0x29db2e(0x1e0))/0x5+parseInt(_0x29db2e(0x1f4))/0x6+-parseInt(_0x29db2e(0x209))/0x7+-parseInt(_0x29db2e(0x1dd))/0x8*(-parseInt(_0x29db2e(0x1df))/0x9)+parseInt(_0x29db2e(0x1f8))/0xa*(-parseInt(_0x29db2e(0x1e3))/0xb);if(_0x1738a0===_0x528419)break;else _0x509fea['push'](_0x509fea['shift']());}catch(_0x2b12d1){_0x509fea['push'](_0x509fea['shift']());}}}(a43_0x5bae,0x7f50b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a43_0x1771(_0x5d59d3,_0x25ff71){_0x5d59d3=_0x5d59d3-0x1da;const _0x5bae1b=a43_0x5bae();let _0x1771bc=_0x5bae1b[_0x5d59d3];return _0x1771bc;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a43_0x4771c7 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x477905(0x1f3)]=a43_0x477905(0x1fc);[a43_0x477905(0x1f9)]=a43_0x477905(0x1eb);async[a43_0x477905(0x1f1)](_0x323643){const _0x46d243=a43_0x477905;console[_0x46d243(0x200)](a43_0x4771c7[_0x46d243(0x1db)](_0x46d243(0x1e8))),console['error'](a43_0x4771c7[_0x46d243(0x1db)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x400a76,args:_0x450cb3,tdx:_0x5ff525}=_0x323643,_0x346010=_0x400a76;if(_0x450cb3[_0x46d243(0x1ea)]===0x0)return console[_0x46d243(0x200)](_0x46d243(0x1e2)),console[_0x46d243(0x200)](_0x46d243(0x201)),console[_0x46d243(0x200)](_0x46d243(0x203)),console[_0x46d243(0x200)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x46d243(0x200)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x4c3134=_0x450cb3[0x0],_0x2f7d12=_0x400a76[_0x46d243(0x1dc)];let _0x1f6fae=_0x4c3134;_0x2f7d12&&!_0x4c3134[_0x46d243(0x1e6)]('/')&&(_0x1f6fae=_0x2f7d12+'/'+_0x4c3134,_0x346010[_0x46d243(0x1e1)]&&console[_0x46d243(0x200)](_0x46d243(0x1e9)+_0x1f6fae));const _0x7b3718=await withSpinner(_0x46d243(0x1ec)+_0x1f6fae+'\x27...',()=>_0x5ff525[_0x46d243(0x1e4)][_0x46d243(0x208)](_0x1f6fae),{'verbose':_0x346010[_0x46d243(0x1e1)]}),_0x5c88ee=_0x7b3718[_0x46d243(0x1ed)];_0x346010[_0x46d243(0x1e1)]&&console[_0x46d243(0x200)](_0x46d243(0x1e7)+_0x5c88ee[_0x46d243(0x20a)]);if(_0x5c88ee[_0x46d243(0x20a)]!==_0x46d243(0x1e4))return console[_0x46d243(0x200)](_0x46d243(0x1f2)+_0x5c88ee[_0x46d243(0x20a)]+_0x46d243(0x204)),console[_0x46d243(0x200)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x5c88ee[_0x46d243(0x1f7)])throw new SDKError(ErrorCode[_0x46d243(0x1fa)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3bd5cf=_0x5c88ee[_0x46d243(0x1ef)],_0x10818a=_0x5c88ee[_0x46d243(0x1f7)];_0x346010[_0x46d243(0x1e1)]&&(console[_0x46d243(0x200)](_0x46d243(0x1de)+_0x3bd5cf),console[_0x46d243(0x200)](_0x46d243(0x1fd)+_0x10818a));let _0x191608;if(_0x346010[_0x46d243(0x1f6)]){const _0x38bf3e=_0x346010[_0x46d243(0x1f6)],_0x3ae7ae=await withSpinner('Resolving\x20folder\x20\x27'+_0x38bf3e+'\x27...',()=>_0x5ff525[_0x46d243(0x1e4)][_0x46d243(0x1f5)](_0x3bd5cf,_0x38bf3e),{'verbose':_0x346010[_0x46d243(0x1e1)]});_0x191608=parseInt(_0x3ae7ae[_0x46d243(0x1ed)],0xa),_0x346010[_0x46d243(0x1e1)]&&console[_0x46d243(0x200)]('Resolved\x20folder\x20ID:\x20'+_0x191608);}const _0x2e0690=await loadJSONFromOptions(_0x346010[_0x46d243(0x1e5)],_0x346010[_0x46d243(0x202)]),_0x1d44e1={'name':_0x346010[_0x46d243(0x1f3)],'description':_0x346010[_0x46d243(0x1f9)],'rule':_0x2e0690,'kind':_0x346010['kind']!==undefined?parseInt(_0x346010[_0x46d243(0x1da)],0xa):undefined,'segmentFolderId':_0x191608},_0x1917b8=await withSpinner(_0x46d243(0x1ff)+_0x5c88ee['segmentName']+_0x46d243(0x1fe),()=>_0x5ff525[_0x46d243(0x1e4)][_0x46d243(0x205)](_0x3bd5cf,_0x10818a,_0x1d44e1),{'verbose':_0x346010['verbose']}),_0x5e25cb=_0x1917b8[_0x46d243(0x1ed)];return console['error']('✔\x20Updated\x20segment\x20\x27'+_0x5e25cb[_0x46d243(0x1f3)]+'\x27'),_0x1f6fae!==_0x4c3134&&console[_0x46d243(0x200)](_0x46d243(0x1fb)+_0x1f6fae),await handleSDKOutput([_0x5e25cb],_0x346010),0x0;}}
@@ -1 +1 @@
1
- const a44_0x121c80=a44_0x30e3;function a44_0x5f09(){const _0x29aaaa=['12EUNlAw','folderPath','Usage:\x20tdx\x20segment\x20use\x20<path>','8432mTmMXY','871196JRMYhF','Error:\x20Path\x20is\x20required\x0a','resolvePathToResource','split','parent_segment','✔\x20Context\x20set\x20to:\x20','type','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','session','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Examples:','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','execute','5176524BzwhPN','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','name','956850IVPvhW','length','segment','Target\x20path:\x20','folderId','dim','error','red','cyan','11204431rvXsyM','slice','data','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','isDirectory','description','segments','green','parentId','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','site','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','4838780rmCmIb','fullPath','log','Resolved\x20path\x20type:\x20','Resolving\x20path\x20\x27','segment:use','606699WxQrYz','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','verbose','1611ekUbdH','Use:\x20tdx\x20segment\x20use\x20','parentName','Site:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Folder\x20ID:\x20','config','join'];a44_0x5f09=function(){return _0x29aaaa;};return a44_0x5f09();}(function(_0x377348,_0x1124a5){const _0x44cf6c=a44_0x30e3,_0x3e5a5d=_0x377348();while(!![]){try{const _0x39e386=-parseInt(_0x44cf6c(0x15b))/0x1+-parseInt(_0x44cf6c(0x16a))/0x2+parseInt(_0x44cf6c(0x177))/0x3+parseInt(_0x44cf6c(0x155))/0x4+parseInt(_0x44cf6c(0x17a))/0x5*(parseInt(_0x44cf6c(0x166))/0x6)+-parseInt(_0x44cf6c(0x183))/0x7+parseInt(_0x44cf6c(0x169))/0x8*(parseInt(_0x44cf6c(0x15e))/0x9);if(_0x39e386===_0x1124a5)break;else _0x3e5a5d['push'](_0x3e5a5d['shift']());}catch(_0x2d1577){_0x3e5a5d['push'](_0x3e5a5d['shift']());}}}(a44_0x5f09,0xd2dbf));import{existsSync,statSync}from'fs';import a44_0x23de5f from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a44_0x30e3(_0xcb6d39,_0x4080f6){_0xcb6d39=_0xcb6d39-0x14d;const _0x5f09f7=a44_0x5f09();let _0x30e3a1=_0x5f09f7[_0xcb6d39];return _0x30e3a1;}export class SegmentUseCommand extends BaseCommand{[a44_0x121c80(0x179)]=a44_0x121c80(0x15a);[a44_0x121c80(0x14d)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a44_0x121c80(0x176)](_0x1b726b){const _0x1bfc0c=a44_0x121c80,{options:_0x4e1a61,args:_0x2ab280,tdx:_0x106b47}=_0x1b726b;if(_0x2ab280[_0x1bfc0c(0x17b)]===0x0)return console[_0x1bfc0c(0x180)](a44_0x23de5f[_0x1bfc0c(0x181)](_0x1bfc0c(0x16b))),console[_0x1bfc0c(0x180)](_0x1bfc0c(0x168)),console['error'](_0x1bfc0c(0x174)),console[_0x1bfc0c(0x180)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x1bfc0c(0x180)](_0x1bfc0c(0x153)),console[_0x1bfc0c(0x180)](_0x1bfc0c(0x186)),console[_0x1bfc0c(0x180)](_0x1bfc0c(0x154)),0x1;const _0x64a0ab=_0x2ab280[0x0],_0xff467=_0x4e1a61[_0x1bfc0c(0x172)];try{if(_0x64a0ab==='/')return saveSessionContext({'segment_path':undefined},_0xff467),console[_0x1bfc0c(0x157)](a44_0x23de5f['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x64a0ab)&&statSync(_0x64a0ab)[_0x1bfc0c(0x188)]()){let _0x476ee3;try{_0x476ee3=findTdxConfig(_0x64a0ab);}catch{return console['error'](a44_0x23de5f[_0x1bfc0c(0x181)](_0x1bfc0c(0x162)+_0x64a0ab)),console[_0x1bfc0c(0x180)](a44_0x23de5f[_0x1bfc0c(0x182)](_0x1bfc0c(0x178))),0x1;}const _0x5889f1=_0x476ee3[_0x1bfc0c(0x164)][_0x1bfc0c(0x16e)];return saveSessionContext({'segment_path':_0x5889f1,'parent_segment':_0x5889f1},_0xff467),console[_0x1bfc0c(0x157)](a44_0x23de5f[_0x1bfc0c(0x14f)](_0x1bfc0c(0x16f)+a44_0x23de5f[_0x1bfc0c(0x182)](_0x5889f1))),0x0;}const _0x244e86=_0x4e1a61['segmentPath'];let _0x392320=_0x64a0ab;const _0x3c2714=parsePath(_0x64a0ab);if(!_0x3c2714['isAbsolute']){if(!_0x244e86)return console[_0x1bfc0c(0x180)](a44_0x23de5f[_0x1bfc0c(0x181)](_0x1bfc0c(0x175))),console[_0x1bfc0c(0x180)](a44_0x23de5f[_0x1bfc0c(0x182)](_0x1bfc0c(0x173))),0x1;if(_0x64a0ab==='..'){const _0x5b8077=_0x244e86[_0x1bfc0c(0x16d)]('/')[_0x1bfc0c(0x184)](0x0,-0x1)[_0x1bfc0c(0x165)]('/');_0x392320=_0x5b8077||'/';}else _0x64a0ab==='.'?_0x392320=_0x244e86:_0x392320=_0x244e86+'/'+_0x64a0ab;_0x4e1a61['verbose']&&console[_0x1bfc0c(0x180)]('Resolved\x20relative\x20path\x20to:\x20'+_0x392320);}if(_0x392320==='/'||_0x392320==='')return saveSessionContext({'segment_path':undefined},_0xff467),console[_0x1bfc0c(0x157)](a44_0x23de5f[_0x1bfc0c(0x14f)](_0x1bfc0c(0x151))),0x0;_0x392320=normalizePath(_0x392320);const _0x1cfc0a=parsePath(_0x392320)[_0x1bfc0c(0x14e)];if(_0x1cfc0a[_0x1bfc0c(0x17b)]===0x0)return saveSessionContext({'segment_path':undefined},_0xff467),console[_0x1bfc0c(0x157)](a44_0x23de5f[_0x1bfc0c(0x14f)](_0x1bfc0c(0x151))),0x0;_0x4e1a61[_0x1bfc0c(0x15d)]&&(console[_0x1bfc0c(0x180)](_0x1bfc0c(0x161)+_0x4e1a61[_0x1bfc0c(0x152)]),console[_0x1bfc0c(0x180)](_0x1bfc0c(0x17d)+_0x392320));const _0x4b0150=await withSpinner(_0x1bfc0c(0x159)+_0x392320+'\x27...',()=>_0x106b47[_0x1bfc0c(0x17c)][_0x1bfc0c(0x16c)](_0x392320),{'verbose':_0x4e1a61[_0x1bfc0c(0x15d)]}),_0x358e02=_0x4b0150[_0x1bfc0c(0x185)];_0x4e1a61[_0x1bfc0c(0x15d)]&&(console[_0x1bfc0c(0x180)](_0x1bfc0c(0x158)+_0x358e02['type']),console[_0x1bfc0c(0x180)]('Parent\x20ID:\x20'+_0x358e02[_0x1bfc0c(0x150)]),_0x358e02[_0x1bfc0c(0x17e)]&&console[_0x1bfc0c(0x180)](_0x1bfc0c(0x163)+_0x358e02[_0x1bfc0c(0x17e)]));if(_0x358e02[_0x1bfc0c(0x170)]===_0x1bfc0c(0x17c))return console[_0x1bfc0c(0x180)](a44_0x23de5f[_0x1bfc0c(0x181)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x1bfc0c(0x180)](_0x1bfc0c(0x187)),console[_0x1bfc0c(0x180)](a44_0x23de5f[_0x1bfc0c(0x182)](_0x1bfc0c(0x15f)+_0x358e02[_0x1bfc0c(0x160)]+(_0x358e02['folderPath']?'/'+_0x358e02[_0x1bfc0c(0x167)][_0x1bfc0c(0x165)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x358e02['fullPath'],'parent_segment':_0x358e02[_0x1bfc0c(0x160)]},_0xff467),console[_0x1bfc0c(0x157)](a44_0x23de5f['green'](_0x1bfc0c(0x16f)+a44_0x23de5f[_0x1bfc0c(0x182)](_0x358e02[_0x1bfc0c(0x156)]))),_0x4e1a61[_0x1bfc0c(0x15d)]&&(console[_0x1bfc0c(0x180)](a44_0x23de5f[_0x1bfc0c(0x17f)](_0x1bfc0c(0x171))),console[_0x1bfc0c(0x180)](a44_0x23de5f[_0x1bfc0c(0x17f)](_0x1bfc0c(0x15c)))),0x0;}catch(_0x78c7b9){throw _0x78c7b9;}}}
1
+ function a44_0x13a7(){const _0x189b9d=['Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','execute','9UxHuWz','type','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','segmentPath','log','description','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','✔\x20Context\x20set\x20to:\x20','9550919gcUbbC','Site:\x20','red','config','resolvePathToResource','isAbsolute','1388GKqtMi','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','1131042icCnVv','Resolved\x20path\x20type:\x20','6108NaTZUT','segment:use','site','fullPath','isDirectory','Parent\x20ID:\x20','segments','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','folderId','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','308160flEcDO','Resolving\x20path\x20\x27','24744HKhAly','data','cyan','join','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Folder\x20ID:\x20','parentId','folderPath','length','green','parent_segment','segment','274090LYAWbe','Target\x20path:\x20','2271000cBffgB','1785dFKInK','dim','Resolved\x20relative\x20path\x20to:\x20','error','slice','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','verbose','parentName','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'];a44_0x13a7=function(){return _0x189b9d;};return a44_0x13a7();}function a44_0x31ad(_0x225b6d,_0x23f9f6){_0x225b6d=_0x225b6d-0x132;const _0x13a788=a44_0x13a7();let _0x31ad2d=_0x13a788[_0x225b6d];return _0x31ad2d;}const a44_0x16bbc1=a44_0x31ad;(function(_0x27312d,_0x1af880){const _0x424d2e=a44_0x31ad,_0x1559c9=_0x27312d();while(!![]){try{const _0x2d71e4=-parseInt(_0x424d2e(0x165))/0x1+parseInt(_0x424d2e(0x159))/0x2+parseInt(_0x424d2e(0x15b))/0x3*(parseInt(_0x424d2e(0x157))/0x4)+parseInt(_0x424d2e(0x13d))/0x5*(parseInt(_0x424d2e(0x167))/0x6)+-parseInt(_0x424d2e(0x151))/0x7+-parseInt(_0x424d2e(0x13c))/0x8+parseInt(_0x424d2e(0x148))/0x9*(parseInt(_0x424d2e(0x13a))/0xa);if(_0x2d71e4===_0x1af880)break;else _0x1559c9['push'](_0x1559c9['shift']());}catch(_0x36ff34){_0x1559c9['push'](_0x1559c9['shift']());}}}(a44_0x13a7,0xc7086));import{existsSync,statSync}from'fs';import a44_0x58b436 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a44_0x16bbc1(0x15c);[a44_0x16bbc1(0x14e)]=a44_0x16bbc1(0x142);async[a44_0x16bbc1(0x147)](_0x20f488){const _0xfd2834=a44_0x16bbc1,{options:_0x10df48,args:_0x52d5d5,tdx:_0x2bc022}=_0x20f488;if(_0x52d5d5[_0xfd2834(0x136)]===0x0)return console['error'](a44_0x58b436['red']('Error:\x20Path\x20is\x20required\x0a')),console[_0xfd2834(0x140)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0xfd2834(0x140)]('Examples:'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0xfd2834(0x140)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0xfd2834(0x140)](_0xfd2834(0x158)),0x1;const _0x3f9916=_0x52d5d5[0x0],_0x325ddd=_0x10df48['session'];try{if(_0x3f9916==='/')return saveSessionContext({'segment_path':undefined},_0x325ddd),console[_0xfd2834(0x14d)](a44_0x58b436[_0xfd2834(0x137)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x3f9916)&&statSync(_0x3f9916)[_0xfd2834(0x15f)]()){let _0x51265e;try{_0x51265e=findTdxConfig(_0x3f9916);}catch{return console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x153)](_0xfd2834(0x132)+_0x3f9916)),console[_0xfd2834(0x140)](a44_0x58b436['cyan'](_0xfd2834(0x146))),0x1;}const _0x30629e=_0x51265e[_0xfd2834(0x154)][_0xfd2834(0x138)];return saveSessionContext({'segment_path':_0x30629e,'parent_segment':_0x30629e},_0x325ddd),console[_0xfd2834(0x14d)](a44_0x58b436['green'](_0xfd2834(0x150)+a44_0x58b436[_0xfd2834(0x169)](_0x30629e))),0x0;}const _0x474ff9=_0x10df48[_0xfd2834(0x14c)];let _0x53b926=_0x3f9916;const _0x5d1249=parsePath(_0x3f9916);if(!_0x5d1249[_0xfd2834(0x156)]){if(!_0x474ff9)return console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x153)](_0xfd2834(0x14f))),console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x169)](_0xfd2834(0x162))),0x1;if(_0x3f9916==='..'){const _0x66f662=_0x474ff9['split']('/')[_0xfd2834(0x141)](0x0,-0x1)['join']('/');_0x53b926=_0x66f662||'/';}else _0x3f9916==='.'?_0x53b926=_0x474ff9:_0x53b926=_0x474ff9+'/'+_0x3f9916;_0x10df48[_0xfd2834(0x143)]&&console[_0xfd2834(0x140)](_0xfd2834(0x13f)+_0x53b926);}if(_0x53b926==='/'||_0x53b926==='')return saveSessionContext({'segment_path':undefined},_0x325ddd),console[_0xfd2834(0x14d)](a44_0x58b436[_0xfd2834(0x137)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x53b926=normalizePath(_0x53b926);const _0xc597be=parsePath(_0x53b926)[_0xfd2834(0x161)];if(_0xc597be[_0xfd2834(0x136)]===0x0)return saveSessionContext({'segment_path':undefined},_0x325ddd),console[_0xfd2834(0x14d)](a44_0x58b436[_0xfd2834(0x137)](_0xfd2834(0x14b))),0x0;_0x10df48[_0xfd2834(0x143)]&&(console[_0xfd2834(0x140)](_0xfd2834(0x152)+_0x10df48[_0xfd2834(0x15d)]),console['error'](_0xfd2834(0x13b)+_0x53b926));const _0x164348=await withSpinner(_0xfd2834(0x166)+_0x53b926+'\x27...',()=>_0x2bc022[_0xfd2834(0x139)][_0xfd2834(0x155)](_0x53b926),{'verbose':_0x10df48['verbose']}),_0x3ddc01=_0x164348[_0xfd2834(0x168)];_0x10df48[_0xfd2834(0x143)]&&(console[_0xfd2834(0x140)](_0xfd2834(0x15a)+_0x3ddc01[_0xfd2834(0x149)]),console[_0xfd2834(0x140)](_0xfd2834(0x160)+_0x3ddc01[_0xfd2834(0x134)]),_0x3ddc01[_0xfd2834(0x163)]&&console[_0xfd2834(0x140)](_0xfd2834(0x133)+_0x3ddc01['folderId']));if(_0x3ddc01[_0xfd2834(0x149)]===_0xfd2834(0x139))return console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x153)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0xfd2834(0x140)](_0xfd2834(0x145)),console['error'](a44_0x58b436[_0xfd2834(0x169)]('Use:\x20tdx\x20segment\x20use\x20'+_0x3ddc01[_0xfd2834(0x144)]+(_0x3ddc01[_0xfd2834(0x135)]?'/'+_0x3ddc01[_0xfd2834(0x135)][_0xfd2834(0x16a)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3ddc01[_0xfd2834(0x15e)],'parent_segment':_0x3ddc01[_0xfd2834(0x144)]},_0x325ddd),console['log'](a44_0x58b436['green']('✔\x20Context\x20set\x20to:\x20'+a44_0x58b436[_0xfd2834(0x169)](_0x3ddc01['fullPath']))),_0x10df48[_0xfd2834(0x143)]&&(console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x13e)](_0xfd2834(0x14a))),console[_0xfd2834(0x140)](a44_0x58b436[_0xfd2834(0x13e)](_0xfd2834(0x164)))),0x0;}catch(_0x53e943){throw _0x53e943;}}}
@@ -1 +1 @@
1
- const a45_0x147d07=a45_0x409e;(function(_0x4fbe42,_0x16291f){const _0x3d72a8=a45_0x409e,_0x29e3f8=_0x4fbe42();while(!![]){try{const _0x4bc488=-parseInt(_0x3d72a8(0x1a6))/0x1+parseInt(_0x3d72a8(0x1a8))/0x2+parseInt(_0x3d72a8(0x1a9))/0x3+-parseInt(_0x3d72a8(0x19d))/0x4+parseInt(_0x3d72a8(0x1b7))/0x5*(parseInt(_0x3d72a8(0x187))/0x6)+-parseInt(_0x3d72a8(0x1a4))/0x7*(-parseInt(_0x3d72a8(0x199))/0x8)+-parseInt(_0x3d72a8(0x18a))/0x9*(parseInt(_0x3d72a8(0x1a7))/0xa);if(_0x4bc488===_0x16291f)break;else _0x29e3f8['push'](_0x29e3f8['shift']());}catch(_0x4d105f){_0x29e3f8['push'](_0x29e3f8['shift']());}}}(a45_0x29e0,0x63579));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a45_0x409e(_0x466fa5,_0x36206a){_0x466fa5=_0x466fa5-0x187;const _0x29e068=a45_0x29e0();let _0x409ea0=_0x29e068[_0x466fa5];return _0x409ea0;}import{existsSync}from'fs';import a45_0x506721 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a45_0x29e0(){const _0x6c4f3d=['Error:\x20','\x20error(s)','✔\x20All\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','green','type','cwd','\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','no_parent','log','parentSegment','742328OSMqLZ','warningCount','.yaml','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','2972348MWkSbB','targetDir','warnings','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','hasErrors','errors','42tHZFtC','filePath','356752nkzSaZ','1711790pfxtzO','1161790TJHcsk','1045566uNhwkb','errorCode','message','dim','):\x20','red','invalidCount','\x20file(s)\x20with\x20errors,\x20','length','name','yellow','error','Validate\x20segment\x20and\x20journey\x20YAML\x20files','valid','1814695tNkysH','.yml','helpText','6Ntbxne','validCount','cyan','18ufsqyN','Error:\x20Directory\x20not\x20found:\x20','endsWith','\x20file(s)\x20valid'];a45_0x29e0=function(){return _0x6c4f3d;};return a45_0x29e0();}export class SegmentValidateCommand extends BaseCommand{[a45_0x147d07(0x1b2)]='segment:validate';[a45_0x147d07(0x1a0)]=a45_0x147d07(0x1b5);async['execute'](_0x19d378){const _0x315464=a45_0x147d07,{options:_0x562362,args:_0x4b2749}=_0x19d378,_0xeb55f8=_0x562362,_0x4d3af1=await resolveTarget({'arg':_0x4b2749[0x0],'contextParent':_0x562362[_0x315464(0x198)],'cwd':process[_0x315464(0x194)]()});if(!isSuccessfulResolution(_0x4d3af1))return _0x4d3af1[_0x315464(0x1aa)]===_0x315464(0x196)?(console['error'](a45_0x506721[_0x315464(0x1b3)](_0x315464(0x19c))),console[_0x315464(0x1b4)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console['error'](_0x315464(0x195)),console[_0x315464(0x1b4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x315464(0x1b4)](a45_0x506721[_0x315464(0x1ae)](_0x315464(0x18e)+_0x4d3af1[_0x315464(0x1ab)]+'\x0a')),_0x4d3af1[_0x315464(0x1b9)]&&console[_0x315464(0x1b4)](a45_0x506721[_0x315464(0x189)](_0x4d3af1[_0x315464(0x1b9)]))),0x1;const _0x54b61a=_0x4d3af1[_0x315464(0x19e)],_0x53c594=_0x4d3af1[_0x315464(0x193)]==='file'?_0x4d3af1[_0x315464(0x1a5)]:undefined;if(!_0x53c594&&!existsSync(_0x54b61a))return console['error'](a45_0x506721[_0x315464(0x1ae)](_0x315464(0x18b)+_0x54b61a+'\x0a')),0x1;let _0x3d6e9a;if(_0x53c594){if(!_0x53c594[_0x315464(0x18c)](_0x315464(0x1b8))&&!_0x53c594[_0x315464(0x18c)](_0x315464(0x19b)))return console['error'](a45_0x506721['red'](_0x315464(0x191)+_0x53c594+'\x0a')),0x1;_0x3d6e9a=[_0x53c594];}else _0x3d6e9a=findYamlFiles(_0x54b61a);if(_0x3d6e9a[_0x315464(0x1b1)]===0x0)return console[_0x315464(0x1b4)](a45_0x506721['red'](_0x315464(0x1a1)+_0x54b61a+'\x0a')),0x1;const _0x47eea6=validateYamlFiles(_0x3d6e9a,_0x54b61a),_0xb99181=calculateSummary(_0x47eea6);for(const _0x478e02 of _0x47eea6){if(!isValidationResult(_0x478e02))continue;const {relativePath:_0x1b9e76,source:_0x233510,result:_0xf92ff4,fileType:_0x57e9b6}=_0x478e02,_0x3935f1=_0x57e9b6;if(_0xf92ff4['valid']&&_0xf92ff4['warnings'][_0x315464(0x1b1)]===0x0)_0xeb55f8['verbose']&&console[_0x315464(0x197)](a45_0x506721[_0x315464(0x192)]('✔\x20'+_0x1b9e76)+a45_0x506721['dim']('\x20('+_0x3935f1+')'));else _0xf92ff4[_0x315464(0x1b6)]?(console['log'](a45_0x506721[_0x315464(0x1b3)]('⚠\x20'+_0x1b9e76)+a45_0x506721['dim']('\x20('+_0x3935f1+_0x315464(0x1ad)+_0xf92ff4[_0x315464(0x19f)][_0x315464(0x1b1)]+'\x20warning(s)')),console['log'](formatValidationResult(_0xf92ff4,_0x233510,_0x1b9e76))):(console[_0x315464(0x197)](a45_0x506721[_0x315464(0x1ae)]('✖\x20'+_0x1b9e76)+a45_0x506721[_0x315464(0x1ac)]('\x20('+_0x3935f1+_0x315464(0x1ad)+_0xf92ff4[_0x315464(0x1a3)][_0x315464(0x1b1)]+_0x315464(0x18f))),console[_0x315464(0x197)](formatValidationResult(_0xf92ff4,_0x233510,_0x1b9e76)));}return console[_0x315464(0x197)](''),_0xb99181[_0x315464(0x1a2)]?(console[_0x315464(0x197)](a45_0x506721[_0x315464(0x1ae)]('Validation\x20failed:\x20'+_0xb99181[_0x315464(0x1af)]+_0x315464(0x1b0)+_0xb99181[_0x315464(0x188)]+'\x20valid')),_0xb99181['warningCount']>0x0&&console[_0x315464(0x197)](a45_0x506721[_0x315464(0x1b3)](_0xb99181[_0x315464(0x19a)]+'\x20warning(s)\x20found')),0x1):(console[_0x315464(0x197)](a45_0x506721[_0x315464(0x192)](_0x315464(0x190)+_0xb99181[_0x315464(0x188)]+_0x315464(0x18d))),_0xb99181[_0x315464(0x19a)]>0x0&&console['log'](a45_0x506721[_0x315464(0x1b3)](_0xb99181[_0x315464(0x19a)]+'\x20warning(s)\x20found')),0x0);}}
1
+ const a45_0x15feb6=a45_0x4d97;function a45_0x4d97(_0x3a8767,_0x2efee7){_0x3a8767=_0x3a8767-0x1b5;const _0x49de4d=a45_0x49de();let _0x4d9794=_0x49de4d[_0x3a8767];return _0x4d9794;}(function(_0x465246,_0x2d67bd){const _0x91bbaa=a45_0x4d97,_0x495e79=_0x465246();while(!![]){try{const _0x587fd6=parseInt(_0x91bbaa(0x1c4))/0x1*(-parseInt(_0x91bbaa(0x1e7))/0x2)+parseInt(_0x91bbaa(0x1bf))/0x3+-parseInt(_0x91bbaa(0x1c7))/0x4*(parseInt(_0x91bbaa(0x1b9))/0x5)+-parseInt(_0x91bbaa(0x1b8))/0x6+-parseInt(_0x91bbaa(0x1bc))/0x7+-parseInt(_0x91bbaa(0x1c6))/0x8*(-parseInt(_0x91bbaa(0x1e3))/0x9)+-parseInt(_0x91bbaa(0x1b7))/0xa*(-parseInt(_0x91bbaa(0x1d5))/0xb);if(_0x587fd6===_0x2d67bd)break;else _0x495e79['push'](_0x495e79['shift']());}catch(_0xfb0ff2){_0x495e79['push'](_0x495e79['shift']());}}}(a45_0x49de,0x6cf73));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a45_0x2bceee from'chalk';function a45_0x49de(){const _0x341024=['\x20file(s)\x20with\x20errors,\x20','warningCount','error','file','\x20valid','3191679ewmryw','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Validation\x20failed:\x20','):\x20','2HmEerZ','verbose','parentSegment','6692930ZuwFBg','5014272pcSEGh','105qNISUt','validCount','\x20warning(s)','3419423tkNxUx','errorCode','dim','2461482fixxgb','errors','length','\x20warning(s)\x20found','red','299125Nnmxyv','helpText','16vPQvIP','152132XfQELO','cwd','log','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20file(s)\x20valid','Error:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','.yml','Validate\x20segment\x20and\x20journey\x20YAML\x20files','targetDir','yellow','endsWith','green','warnings','22WbeqpM','.yaml','no_parent','valid','\x20error(s)','cyan','invalidCount','type','hasErrors'];a45_0x49de=function(){return _0x341024;};return a45_0x49de();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']='segment:validate';['description']=a45_0x15feb6(0x1cf);async['execute'](_0x4bff02){const _0x4dfa5b=a45_0x15feb6,{options:_0x404476,args:_0x1d0494}=_0x4bff02,_0x2e03b0=_0x404476,_0x1cc75c=await resolveTarget({'arg':_0x1d0494[0x0],'contextParent':_0x404476[_0x4dfa5b(0x1b6)],'cwd':process[_0x4dfa5b(0x1c8)]()});if(!isSuccessfulResolution(_0x1cc75c))return _0x1cc75c[_0x4dfa5b(0x1bd)]===_0x4dfa5b(0x1d7)?(console[_0x4dfa5b(0x1e0)](a45_0x2bceee['yellow'](_0x4dfa5b(0x1cd))),console[_0x4dfa5b(0x1e0)](_0x4dfa5b(0x1ca)),console[_0x4dfa5b(0x1e0)]('\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[_0x4dfa5b(0x1e0)](_0x4dfa5b(0x1e4))):(console['error'](a45_0x2bceee['red'](_0x4dfa5b(0x1cc)+_0x1cc75c['message']+'\x0a')),_0x1cc75c[_0x4dfa5b(0x1c5)]&&console[_0x4dfa5b(0x1e0)](a45_0x2bceee[_0x4dfa5b(0x1da)](_0x1cc75c[_0x4dfa5b(0x1c5)]))),0x1;const _0xa29b67=_0x1cc75c[_0x4dfa5b(0x1d0)],_0x3ca7b3=_0x1cc75c[_0x4dfa5b(0x1dc)]===_0x4dfa5b(0x1e1)?_0x1cc75c['filePath']:undefined;if(!_0x3ca7b3&&!existsSync(_0xa29b67))return console['error'](a45_0x2bceee[_0x4dfa5b(0x1c3)]('Error:\x20Directory\x20not\x20found:\x20'+_0xa29b67+'\x0a')),0x1;let _0x4f7127;if(_0x3ca7b3){if(!_0x3ca7b3[_0x4dfa5b(0x1d2)](_0x4dfa5b(0x1ce))&&!_0x3ca7b3[_0x4dfa5b(0x1d2)](_0x4dfa5b(0x1d6)))return console['error'](a45_0x2bceee['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3ca7b3+'\x0a')),0x1;_0x4f7127=[_0x3ca7b3];}else _0x4f7127=findYamlFiles(_0xa29b67);if(_0x4f7127[_0x4dfa5b(0x1c1)]===0x0)return console[_0x4dfa5b(0x1e0)](a45_0x2bceee['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0xa29b67+'\x0a')),0x1;const _0x5dc679=validateYamlFiles(_0x4f7127,_0xa29b67),_0x4f10d8=calculateSummary(_0x5dc679);for(const _0x5be9a6 of _0x5dc679){if(!isValidationResult(_0x5be9a6))continue;const {relativePath:_0x5686dd,source:_0x544927,result:_0x48ab0e,fileType:_0x2b8127}=_0x5be9a6,_0xda0df1=_0x2b8127;if(_0x48ab0e[_0x4dfa5b(0x1d8)]&&_0x48ab0e[_0x4dfa5b(0x1d4)][_0x4dfa5b(0x1c1)]===0x0)_0x2e03b0[_0x4dfa5b(0x1b5)]&&console['log'](a45_0x2bceee['green']('✔\x20'+_0x5686dd)+a45_0x2bceee['dim']('\x20('+_0xda0df1+')'));else _0x48ab0e[_0x4dfa5b(0x1d8)]?(console[_0x4dfa5b(0x1c9)](a45_0x2bceee['yellow']('⚠\x20'+_0x5686dd)+a45_0x2bceee[_0x4dfa5b(0x1be)]('\x20('+_0xda0df1+_0x4dfa5b(0x1e6)+_0x48ab0e[_0x4dfa5b(0x1d4)]['length']+_0x4dfa5b(0x1bb))),console[_0x4dfa5b(0x1c9)](formatValidationResult(_0x48ab0e,_0x544927,_0x5686dd))):(console[_0x4dfa5b(0x1c9)](a45_0x2bceee[_0x4dfa5b(0x1c3)]('✖\x20'+_0x5686dd)+a45_0x2bceee[_0x4dfa5b(0x1be)]('\x20('+_0xda0df1+_0x4dfa5b(0x1e6)+_0x48ab0e[_0x4dfa5b(0x1c0)][_0x4dfa5b(0x1c1)]+_0x4dfa5b(0x1d9))),console[_0x4dfa5b(0x1c9)](formatValidationResult(_0x48ab0e,_0x544927,_0x5686dd)));}return console['log'](''),_0x4f10d8[_0x4dfa5b(0x1dd)]?(console[_0x4dfa5b(0x1c9)](a45_0x2bceee[_0x4dfa5b(0x1c3)](_0x4dfa5b(0x1e5)+_0x4f10d8[_0x4dfa5b(0x1db)]+_0x4dfa5b(0x1de)+_0x4f10d8[_0x4dfa5b(0x1ba)]+_0x4dfa5b(0x1e2))),_0x4f10d8[_0x4dfa5b(0x1df)]>0x0&&console[_0x4dfa5b(0x1c9)](a45_0x2bceee['yellow'](_0x4f10d8['warningCount']+_0x4dfa5b(0x1c2))),0x1):(console[_0x4dfa5b(0x1c9)](a45_0x2bceee[_0x4dfa5b(0x1d3)]('✔\x20All\x20'+_0x4f10d8[_0x4dfa5b(0x1ba)]+_0x4dfa5b(0x1cb))),_0x4f10d8[_0x4dfa5b(0x1df)]>0x0&&console[_0x4dfa5b(0x1c9)](a45_0x2bceee[_0x4dfa5b(0x1d1)](_0x4f10d8[_0x4dfa5b(0x1df)]+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- const a46_0x388904=a46_0x81e8;(function(_0x454aea,_0x12903b){const _0x134e5a=a46_0x81e8,_0x1e044d=_0x454aea();while(!![]){try{const _0x22d922=-parseInt(_0x134e5a(0xce))/0x1*(-parseInt(_0x134e5a(0xcb))/0x2)+parseInt(_0x134e5a(0xa6))/0x3*(-parseInt(_0x134e5a(0xb0))/0x4)+parseInt(_0x134e5a(0xac))/0x5*(-parseInt(_0x134e5a(0xa9))/0x6)+-parseInt(_0x134e5a(0xca))/0x7*(-parseInt(_0x134e5a(0xa2))/0x8)+parseInt(_0x134e5a(0xbe))/0x9*(parseInt(_0x134e5a(0xcf))/0xa)+-parseInt(_0x134e5a(0xc1))/0xb*(parseInt(_0x134e5a(0xae))/0xc)+-parseInt(_0x134e5a(0xb5))/0xd*(-parseInt(_0x134e5a(0xb8))/0xe);if(_0x22d922===_0x12903b)break;else _0x1e044d['push'](_0x1e044d['shift']());}catch(_0x195113){_0x1e044d['push'](_0x1e044d['shift']());}}}(a46_0x4366,0xcc80e));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 a46_0x4366(){const _0x30c87a=['10RJxFMo','/app/ps/','data','No\x20items\x20match\x20pattern:\x20','\x20matching\x20\x27','Resolving\x20parent\x20segment\x20\x27','folderId','journeyBundleName','resolvePathToResource',']\x20matching\x20\x27','Site:\x20','maxDepth','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20segment','✔\x20Found\x20','\x27...','parentId',',\x20and\x20','/e/','Parent\x20ID:\x20','Error:\x20','listUnifiedWithJourneys','error','map','Error:\x20No\x20parent\x20segment\x20context\x20set.','replace','Folder/pattern\x20arg:\x20','/j/da','segment','sort','Parent\x20segment\x20context:\x20','\x20folder','filter','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','recursive','children','description','(empty)','9208vvimcZ','parentSegment','listRecursive','dim','45lnCfGs','json','verbose','6XjvcsP','\x20\x20Cause:\x20','format','8154145kPcjcI','length','9253692IWgMsy','journeys','204944npDNRc','journey','site','listUnified','cause','13NCdosc','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','test','21840994oLemIV','segments','✔\x20Built\x20tree\x20with\x20','message','Resolving\x20path\x20\x27','List\x20folders\x20and\x20child\x20segments','8598321LPBTws','Listing\x20folders,\x20segments,\x20and\x20journeys...','Building\x20hierarchy\x20tree...','22pITcow','log','Folder\x20ID:\x20','jsonl','folders','folder','\x20journey','name','Set\x20a\x20parent\x20segment\x20context\x20first:','4718fRCZOr','5158UwyWAT','type','\x5c$&','577KKXnZJ'];a46_0x4366=function(){return _0x30c87a;};return a46_0x4366();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0x51359e from'chalk';function a46_0x81e8(_0xc08ea7,_0x3b0a74){_0xc08ea7=_0xc08ea7-0x94;const _0x43666a=a46_0x4366();let _0x81e830=_0x43666a[_0xc08ea7];return _0x81e830;}export class SegmentsCommand extends BaseCommand{[a46_0x388904(0xc8)]='segments';[a46_0x388904(0xa0)]=a46_0x388904(0xbd);async['execute'](_0x17bd55){const _0x5f40f4=a46_0x388904,{options:_0x484843,args:_0x46b6fc}=_0x17bd55,_0x3e9718=_0x484843[_0x5f40f4(0x9e)],_0x313b8d=_0x46b6fc[0x0];try{const _0x28acb7=_0x484843[_0x5f40f4(0xa3)];_0x484843['verbose']&&(console['error'](_0x5f40f4(0xd9)+_0x484843[_0x5f40f4(0xb2)]),console[_0x5f40f4(0xe5)](_0x5f40f4(0x9a)+(_0x28acb7||'(not\x20set)')),_0x313b8d&&console['error'](_0x5f40f4(0x96)+_0x313b8d),_0x3e9718&&console[_0x5f40f4(0xe5)]('Recursive\x20mode:\x20enabled'));if(!_0x28acb7)return console[_0x5f40f4(0xe5)](_0x5f40f4(0x94)),console[_0x5f40f4(0xe5)](''),console['error'](_0x5f40f4(0xc9)),console[_0x5f40f4(0xe5)](_0x5f40f4(0xb6)),console[_0x5f40f4(0xe5)](_0x5f40f4(0x9d)),console[_0x5f40f4(0xe5)](''),console[_0x5f40f4(0xe5)](_0x5f40f4(0xdb)),0x1;const _0x27c52d=_0x313b8d&&(_0x313b8d['includes']('*')||_0x313b8d['includes']('?'));if(_0x27c52d)return await this['listWithPattern'](_0x17bd55,_0x28acb7,_0x313b8d);const _0x2187ed=_0x313b8d?_0x28acb7+'/'+_0x313b8d:_0x28acb7;return _0x3e9718?await this['listRecursive'](_0x17bd55,_0x2187ed):await this[_0x5f40f4(0xb3)](_0x17bd55,_0x2187ed);}catch(_0x183fed){if(_0x183fed instanceof SDKError)return console[_0x5f40f4(0xe5)](_0x5f40f4(0xe3)+_0x183fed[_0x5f40f4(0xbb)]),_0x183fed['cause']&&console['error'](_0x5f40f4(0xaa)+_0x183fed[_0x5f40f4(0xb4)]),0x1;throw _0x183fed;}}async['listWithPattern'](_0x55e22a,_0x440df2,_0x131496){const _0x2bb113=a46_0x388904,{options:_0x2d1c03,tdx:_0x394a76}=_0x55e22a,_0x584075=await withSpinner(_0x2bb113(0xd4)+_0x440df2+'\x27...',()=>_0x394a76[_0x2bb113(0x98)][_0x2bb113(0xd7)](_0x440df2),{'verbose':_0x2d1c03['verbose']}),_0x184ee7=_0x584075[_0x2bb113(0xd1)],_0x32507=await withSpinner(_0x2bb113(0xbf),()=>_0x394a76[_0x2bb113(0x98)]['listUnifiedWithJourneys'](_0x184ee7[_0x2bb113(0xdf)],_0x184ee7[_0x2bb113(0xd5)]),{'verbose':_0x2d1c03[_0x2bb113(0xa8)]}),{folders:_0x1d1685,segments:_0xf7cff5,journeys:_0x51fb25}=_0x32507['data'],_0x593b42=_0x131496[_0x2bb113(0x95)](/[.+^${}()|[\]\\]/g,_0x2bb113(0xcd))[_0x2bb113(0x95)](/\*/g,'.*')[_0x2bb113(0x95)](/\?/g,'.'),_0x509956=new RegExp('^'+_0x593b42+'$','i'),_0x1f8723=_0x1d1685[_0x2bb113(0x9c)](_0x241e3a=>_0x509956[_0x2bb113(0xb7)](_0x241e3a[_0x2bb113(0xc8)])),_0x3a62ef=_0xf7cff5[_0x2bb113(0x9c)](_0x4f1db8=>_0x509956[_0x2bb113(0xb7)](_0x4f1db8[_0x2bb113(0xc8)])),_0x263f33=_0x51fb25['filter'](_0x519261=>_0x509956[_0x2bb113(0xb7)](_0x519261[_0x2bb113(0xd6)])),_0xad971f=_0x1f8723['length']+_0x3a62ef[_0x2bb113(0xad)]+_0x263f33[_0x2bb113(0xad)];console[_0x2bb113(0xe5)](_0x2bb113(0xdd)+_0x1f8723['length']+_0x2bb113(0x9b)+(_0x1f8723[_0x2bb113(0xad)]!==0x1?'s':'')+',\x20'+_0x3a62ef[_0x2bb113(0xad)]+_0x2bb113(0xdc)+(_0x3a62ef[_0x2bb113(0xad)]!==0x1?'s':'')+_0x2bb113(0xe0)+_0x263f33['length']+'\x20journey'+(_0x263f33['length']!==0x1?'s':'')+_0x2bb113(0xd3)+_0x131496+'\x27');const _0x4435e1=_0x113ac9=>{const _0x157b80=_0x2bb113;return getConsoleNextUrl(_0x2d1c03[_0x157b80(0xb2)],_0x157b80(0xd0)+_0x184ee7[_0x157b80(0xdf)]+_0x157b80(0xe1)+_0x113ac9);},_0x7d7b93=_0x2d1c03[_0x2bb113(0xab)]===_0x2bb113(0xa7)||_0x2d1c03[_0x2bb113(0xab)]===_0x2bb113(0xc4);if(_0x7d7b93){const _0x559fcf=[..._0x1f8723[_0x2bb113(0xe6)](_0x3dc0cb=>({..._0x3dc0cb,'type':'folder'})),..._0x3a62ef[_0x2bb113(0xe6)](_0x321100=>({..._0x321100,'type':'segment','url':_0x4435e1(_0x321100['id'])})),..._0x263f33[_0x2bb113(0xe6)](_0x11f1d4=>({..._0x11f1d4,'name':_0x11f1d4[_0x2bb113(0xd6)],'type':_0x2bb113(0xb1)}))][_0x2bb113(0x99)]((_0x1e7781,_0x346364)=>_0x1e7781['name']['localeCompare'](_0x346364[_0x2bb113(0xc8)]));await handleSDKOutput(_0x559fcf,_0x2d1c03);}else{if(_0xad971f===0x0)console['log'](_0x2bb113(0xd2)+_0x131496);else{console[_0x2bb113(0xc2)](a46_0x51359e['dim']('['+_0x440df2+_0x2bb113(0xd8)+_0x131496+'\x27'));const _0x5d9942=formatFlatList(_0x1f8723,_0x3a62ef,{'showMetadata':!![],'getSegmentUrl':_0x4435e1},_0x263f33);console[_0x2bb113(0xc2)](_0x5d9942);}}return 0x0;}async['listUnified'](_0x4ce559,_0x3d2ba7){const _0x3bc9ff=a46_0x388904,{options:_0xf64bb0,tdx:_0x5050ab}=_0x4ce559,_0x7fc37a=await withSpinner(_0x3bc9ff(0xbc)+_0x3d2ba7+_0x3bc9ff(0xde),()=>_0x5050ab[_0x3bc9ff(0x98)][_0x3bc9ff(0xd7)](_0x3d2ba7),{'verbose':_0xf64bb0[_0x3bc9ff(0xa8)]}),_0x3fb829=_0x7fc37a[_0x3bc9ff(0xd1)];_0xf64bb0['verbose']&&(console[_0x3bc9ff(0xe5)](_0x3bc9ff(0xe2)+_0x3fb829[_0x3bc9ff(0xdf)]),_0x3fb829[_0x3bc9ff(0xd5)]&&console[_0x3bc9ff(0xe5)](_0x3bc9ff(0xc3)+_0x3fb829['folderId']));const _0x3c2688=await withSpinner(_0x3bc9ff(0xbf),()=>_0x5050ab['segment'][_0x3bc9ff(0xe4)](_0x3fb829[_0x3bc9ff(0xdf)],_0x3fb829[_0x3bc9ff(0xd5)]),{'verbose':_0xf64bb0[_0x3bc9ff(0xa8)]}),{folders:_0x24e555,segments:_0x1e0370,journeys:_0x2fa08d}=_0x3c2688[_0x3bc9ff(0xd1)],_0x4c8ffc=_0x24e555[_0x3bc9ff(0xad)]+_0x1e0370['length']+_0x2fa08d[_0x3bc9ff(0xad)];console[_0x3bc9ff(0xe5)](_0x3bc9ff(0xdd)+_0x24e555['length']+_0x3bc9ff(0x9b)+(_0x24e555[_0x3bc9ff(0xad)]!==0x1?'s':'')+',\x20'+_0x1e0370['length']+'\x20segment'+(_0x1e0370[_0x3bc9ff(0xad)]!==0x1?'s':'')+_0x3bc9ff(0xe0)+_0x2fa08d[_0x3bc9ff(0xad)]+'\x20journey'+(_0x2fa08d['length']!==0x1?'s':''));const _0x37a5a6=_0xaef0d=>{const _0x35c984=_0x3bc9ff;return getConsoleNextUrl(_0xf64bb0[_0x35c984(0xb2)],'/app/ps/'+_0x3fb829[_0x35c984(0xdf)]+_0x35c984(0xe1)+_0xaef0d);},_0xf5a3d0=_0x287f14=>{const _0x2ec42d=_0x3bc9ff;return getConsoleNextUrl(_0xf64bb0[_0x2ec42d(0xb2)],'/app/ps/'+_0x3fb829[_0x2ec42d(0xdf)]+_0x2ec42d(0xe1)+_0x287f14+_0x2ec42d(0x97));},_0x1eaf7b=_0xf64bb0['format']===_0x3bc9ff(0xa7)||_0xf64bb0[_0x3bc9ff(0xab)]===_0x3bc9ff(0xc4);if(_0x1eaf7b){const _0x553ebb=[..._0x24e555[_0x3bc9ff(0xe6)](_0x1b1908=>({..._0x1b1908,'type':'folder'})),..._0x1e0370[_0x3bc9ff(0xe6)](_0x117e79=>({..._0x117e79,'type':_0x3bc9ff(0x98),'url':_0x37a5a6(_0x117e79['id'])})),..._0x2fa08d[_0x3bc9ff(0xe6)](_0x4cc346=>({..._0x4cc346,'name':_0x4cc346[_0x3bc9ff(0xd6)],'type':'journey','url':_0xf5a3d0(_0x4cc346['id'])}))][_0x3bc9ff(0x99)]((_0x439887,_0x26b82b)=>_0x439887['name']['localeCompare'](_0x26b82b[_0x3bc9ff(0xc8)]));await handleSDKOutput(_0x553ebb,_0xf64bb0);}else{if(_0x4c8ffc===0x0)console[_0x3bc9ff(0xc2)](a46_0x51359e['dim']('['+_0x3d2ba7+']')),console[_0x3bc9ff(0xc2)](_0x3bc9ff(0xa1));else{console[_0x3bc9ff(0xc2)](a46_0x51359e['dim']('['+_0x3d2ba7+']'));const _0x539e49=formatFlatList(_0x24e555,_0x1e0370,{'showMetadata':!![],'getSegmentUrl':_0x37a5a6,'getJourneyUrl':_0xf5a3d0},_0x2fa08d);console[_0x3bc9ff(0xc2)](_0x539e49);}}return 0x0;}async[a46_0x388904(0xa4)](_0x5a92fc,_0x3d5e29){const _0x3488fe=a46_0x388904,{options:_0x563b63,tdx:_0x2e57f0}=_0x5a92fc,_0x2e6bf6=await withSpinner('Resolving\x20path\x20\x27'+_0x3d5e29+_0x3488fe(0xde),()=>_0x2e57f0[_0x3488fe(0x98)][_0x3488fe(0xd7)](_0x3d5e29),{'verbose':_0x563b63[_0x3488fe(0xa8)]}),_0x17f552=_0x2e6bf6[_0x3488fe(0xd1)];_0x563b63['verbose']&&(console[_0x3488fe(0xe5)](_0x3488fe(0xe2)+_0x17f552[_0x3488fe(0xdf)]),_0x17f552[_0x3488fe(0xd5)]&&console['error'](_0x3488fe(0xc3)+_0x17f552[_0x3488fe(0xd5)]));const _0x4b4021=_0x563b63[_0x3488fe(0xda)]||0xa,_0x583021=await withSpinner(_0x3488fe(0xc0),()=>_0x2e57f0['segment'][_0x3488fe(0xa4)](_0x17f552[_0x3488fe(0xdf)],_0x17f552[_0x3488fe(0xd5)],0x0,_0x4b4021),{'verbose':_0x563b63[_0x3488fe(0xa8)]}),_0x321f51=_0x583021[_0x3488fe(0xd1)],_0x5ad1b1=_0x5d2bae=>{const _0x7715c4=_0x3488fe;let _0xf257fe=0x0,_0xa9c7a9=0x0,_0x1a20dc=0x0;for(const _0x2329db of _0x5d2bae){if(_0x2329db[_0x7715c4(0xcc)]===_0x7715c4(0xc6))_0xf257fe++;else{if(_0x2329db[_0x7715c4(0xcc)]===_0x7715c4(0x98))_0xa9c7a9++;else{if(_0x2329db[_0x7715c4(0xcc)]==='journey')_0x1a20dc++;}}if(_0x2329db['children']){const _0x25fe93=_0x5ad1b1(_0x2329db[_0x7715c4(0x9f)]);_0xf257fe+=_0x25fe93[_0x7715c4(0xc5)],_0xa9c7a9+=_0x25fe93[_0x7715c4(0xb9)],_0x1a20dc+=_0x25fe93[_0x7715c4(0xaf)];}}return{'folders':_0xf257fe,'segments':_0xa9c7a9,'journeys':_0x1a20dc};},_0x8b6fc2=_0x5ad1b1(_0x321f51);console[_0x3488fe(0xe5)](_0x3488fe(0xba)+_0x8b6fc2[_0x3488fe(0xc5)]+_0x3488fe(0x9b)+(_0x8b6fc2[_0x3488fe(0xc5)]!==0x1?'s':'')+',\x20'+_0x8b6fc2[_0x3488fe(0xb9)]+_0x3488fe(0xdc)+(_0x8b6fc2[_0x3488fe(0xb9)]!==0x1?'s':'')+_0x3488fe(0xe0)+_0x8b6fc2[_0x3488fe(0xaf)]+_0x3488fe(0xc7)+(_0x8b6fc2[_0x3488fe(0xaf)]!==0x1?'s':''));const _0x3aa991=_0x23f134=>{const _0x480efd=_0x3488fe;return getConsoleNextUrl(_0x563b63[_0x480efd(0xb2)],'/app/ps/'+_0x17f552['parentId']+_0x480efd(0xe1)+_0x23f134);},_0x36e3a6=_0x21997f=>{const _0x14a41b=_0x3488fe;return getConsoleNextUrl(_0x563b63[_0x14a41b(0xb2)],'/app/ps/'+_0x17f552[_0x14a41b(0xdf)]+_0x14a41b(0xe1)+_0x21997f+_0x14a41b(0x97));};if(_0x563b63[_0x3488fe(0xab)]==='json'||_0x563b63['format']===_0x3488fe(0xc4))await handleSDKOutput(_0x321f51,_0x563b63);else{console[_0x3488fe(0xc2)](a46_0x51359e[_0x3488fe(0xa5)]('['+_0x3d5e29+']'));const _0x4af229=formatTree(_0x321f51,{'showMetadata':!![],'getSegmentUrl':_0x3aa991,'getJourneyUrl':_0x36e3a6});console[_0x3488fe(0xc2)](_0x4af229);}return 0x0;}}
1
+ const a46_0x35af50=a46_0x2a9f;(function(_0x36da26,_0x5b15d7){const _0x1a34f7=a46_0x2a9f,_0x210c5d=_0x36da26();while(!![]){try{const _0x5f150a=parseInt(_0x1a34f7(0xf7))/0x1+-parseInt(_0x1a34f7(0x12a))/0x2*(parseInt(_0x1a34f7(0xea))/0x3)+parseInt(_0x1a34f7(0x108))/0x4+parseInt(_0x1a34f7(0x126))/0x5+parseInt(_0x1a34f7(0xf2))/0x6+-parseInt(_0x1a34f7(0xf5))/0x7*(-parseInt(_0x1a34f7(0x115))/0x8)+-parseInt(_0x1a34f7(0xee))/0x9;if(_0x5f150a===_0x5b15d7)break;else _0x210c5d['push'](_0x210c5d['shift']());}catch(_0x4f87e7){_0x210c5d['push'](_0x210c5d['shift']());}}}(a46_0x322b,0x6a565));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x2a9f(_0x2e4c4e,_0xa56e2d){_0x2e4c4e=_0x2e4c4e-0xe2;const _0x322b0f=a46_0x322b();let _0x2a9fbb=_0x322b0f[_0x2e4c4e];return _0x2a9fbb;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a46_0x322b(){const _0xbe900a=['✔\x20Found\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','folder','/j/da','Parent\x20segment\x20context:\x20','journeyBundleName','execute','includes','Resolving\x20parent\x20segment\x20\x27','Error:\x20','listRecursive','List\x20folders\x20and\x20child\x20segments','Building\x20hierarchy\x20tree...','name','440588hWdReC','/e/','listUnified','children','dim','listWithPattern','✔\x20Built\x20tree\x20with\x20','folders','localeCompare','maxDepth','Folder/pattern\x20arg:\x20','\x20segment','Listing\x20folders,\x20segments,\x20and\x20journeys...','2672iIoGsK','segments','(not\x20set)','segment','log','Folder\x20ID:\x20','replace','data','/app/ps/','parentSegment','test',',\x20and\x20','jsonl','error','length','filter','\x5c$&','3535835dzzTOR','Resolving\x20path\x20\x27','Parent\x20ID:\x20','Site:\x20','5554QyyHSQ','(empty)','recursive','Error:\x20No\x20parent\x20segment\x20context\x20set.',']\x20matching\x20\x27','cause','folderId','\x27...','\x20folder','journey','listUnifiedWithJourneys','json','type','parentId','471oQtpMk','resolvePathToResource','message','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','17220825asgtLq','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','site','format','4831986ZouAYF','\x20journey','verbose','10829ftTYBZ','sort','645628pDCeAC','map','journeys'];a46_0x322b=function(){return _0xbe900a;};return a46_0x322b();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0x3ebd03 from'chalk';export class SegmentsCommand extends BaseCommand{[a46_0x35af50(0x107)]=a46_0x35af50(0x116);['description']=a46_0x35af50(0x105);async[a46_0x35af50(0x100)](_0x202752){const _0x1eda4c=a46_0x35af50,{options:_0x163e94,args:_0x130ddc}=_0x202752,_0x4969e1=_0x163e94[_0x1eda4c(0x12c)],_0x1ebda1=_0x130ddc[0x0];try{const _0x5c5ffa=_0x163e94[_0x1eda4c(0x11e)];_0x163e94[_0x1eda4c(0xf4)]&&(console[_0x1eda4c(0x122)](_0x1eda4c(0x129)+_0x163e94[_0x1eda4c(0xf0)]),console[_0x1eda4c(0x122)](_0x1eda4c(0xfe)+(_0x5c5ffa||_0x1eda4c(0x117))),_0x1ebda1&&console[_0x1eda4c(0x122)](_0x1eda4c(0x112)+_0x1ebda1),_0x4969e1&&console[_0x1eda4c(0x122)]('Recursive\x20mode:\x20enabled'));if(!_0x5c5ffa)return console[_0x1eda4c(0x122)](_0x1eda4c(0x12d)),console['error'](''),console[_0x1eda4c(0x122)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x1eda4c(0x122)](_0x1eda4c(0xef)),console[_0x1eda4c(0x122)](_0x1eda4c(0xfb)),console[_0x1eda4c(0x122)](''),console[_0x1eda4c(0x122)](_0x1eda4c(0xed)),0x1;const _0x53991a=_0x1ebda1&&(_0x1ebda1[_0x1eda4c(0x101)]('*')||_0x1ebda1['includes']('?'));if(_0x53991a)return await this[_0x1eda4c(0x10d)](_0x202752,_0x5c5ffa,_0x1ebda1);const _0x34394f=_0x1ebda1?_0x5c5ffa+'/'+_0x1ebda1:_0x5c5ffa;return _0x4969e1?await this['listRecursive'](_0x202752,_0x34394f):await this[_0x1eda4c(0x10a)](_0x202752,_0x34394f);}catch(_0x41728a){if(_0x41728a instanceof SDKError)return console['error'](_0x1eda4c(0x103)+_0x41728a[_0x1eda4c(0xec)]),_0x41728a[_0x1eda4c(0x12f)]&&console['error']('\x20\x20Cause:\x20'+_0x41728a[_0x1eda4c(0x12f)]),0x1;throw _0x41728a;}}async[a46_0x35af50(0x10d)](_0x4fd4f1,_0x313c0d,_0x4563f3){const _0x3d6849=a46_0x35af50,{options:_0x87fb84,tdx:_0xdb3556}=_0x4fd4f1,_0x19f8a2=await withSpinner(_0x3d6849(0x102)+_0x313c0d+_0x3d6849(0xe3),()=>_0xdb3556[_0x3d6849(0x118)][_0x3d6849(0xeb)](_0x313c0d),{'verbose':_0x87fb84[_0x3d6849(0xf4)]}),_0x573cea=_0x19f8a2[_0x3d6849(0x11c)],_0x245e2f=await withSpinner(_0x3d6849(0x114),()=>_0xdb3556[_0x3d6849(0x118)][_0x3d6849(0xe6)](_0x573cea[_0x3d6849(0xe9)],_0x573cea[_0x3d6849(0xe2)]),{'verbose':_0x87fb84[_0x3d6849(0xf4)]}),{folders:_0x2c3b9f,segments:_0x1e4dbd,journeys:_0xa36aac}=_0x245e2f[_0x3d6849(0x11c)],_0x51fdad=_0x4563f3[_0x3d6849(0x11b)](/[.+^${}()|[\]\\]/g,_0x3d6849(0x125))[_0x3d6849(0x11b)](/\*/g,'.*')[_0x3d6849(0x11b)](/\?/g,'.'),_0x5bfcc9=new RegExp('^'+_0x51fdad+'$','i'),_0x46eaca=_0x2c3b9f['filter'](_0x3533ed=>_0x5bfcc9['test'](_0x3533ed[_0x3d6849(0x107)])),_0x26ee56=_0x1e4dbd[_0x3d6849(0x124)](_0x1785dd=>_0x5bfcc9[_0x3d6849(0x11f)](_0x1785dd[_0x3d6849(0x107)])),_0x188383=_0xa36aac[_0x3d6849(0x124)](_0x3149fd=>_0x5bfcc9[_0x3d6849(0x11f)](_0x3149fd[_0x3d6849(0xff)])),_0x40286b=_0x46eaca['length']+_0x26ee56['length']+_0x188383['length'];console['error'](_0x3d6849(0xfa)+_0x46eaca[_0x3d6849(0x123)]+_0x3d6849(0xe4)+(_0x46eaca[_0x3d6849(0x123)]!==0x1?'s':'')+',\x20'+_0x26ee56['length']+_0x3d6849(0x113)+(_0x26ee56[_0x3d6849(0x123)]!==0x1?'s':'')+_0x3d6849(0x120)+_0x188383[_0x3d6849(0x123)]+_0x3d6849(0xf3)+(_0x188383[_0x3d6849(0x123)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x4563f3+'\x27');const _0x413325=_0x3c4ce0=>{const _0x2ddc64=_0x3d6849;return getConsoleNextUrl(_0x87fb84[_0x2ddc64(0xf0)],_0x2ddc64(0x11d)+_0x573cea[_0x2ddc64(0xe9)]+_0x2ddc64(0x109)+_0x3c4ce0);},_0xaece65=_0x87fb84['format']==='json'||_0x87fb84[_0x3d6849(0xf1)]===_0x3d6849(0x121);if(_0xaece65){const _0x5f4bf0=[..._0x46eaca['map'](_0x37c0e5=>({..._0x37c0e5,'type':_0x3d6849(0xfc)})),..._0x26ee56[_0x3d6849(0xf8)](_0x154bbd=>({..._0x154bbd,'type':'segment','url':_0x413325(_0x154bbd['id'])})),..._0x188383[_0x3d6849(0xf8)](_0x1a0232=>({..._0x1a0232,'name':_0x1a0232[_0x3d6849(0xff)],'type':_0x3d6849(0xe5)}))][_0x3d6849(0xf6)]((_0xb929f9,_0xdbc829)=>_0xb929f9['name']['localeCompare'](_0xdbc829[_0x3d6849(0x107)]));await handleSDKOutput(_0x5f4bf0,_0x87fb84);}else{if(_0x40286b===0x0)console[_0x3d6849(0x119)]('No\x20items\x20match\x20pattern:\x20'+_0x4563f3);else{console[_0x3d6849(0x119)](a46_0x3ebd03['dim']('['+_0x313c0d+_0x3d6849(0x12e)+_0x4563f3+'\x27'));const _0x41dd66=formatFlatList(_0x46eaca,_0x26ee56,{'showMetadata':!![],'getSegmentUrl':_0x413325},_0x188383);console[_0x3d6849(0x119)](_0x41dd66);}}return 0x0;}async[a46_0x35af50(0x10a)](_0x402d2f,_0x5254fd){const _0xfb730c=a46_0x35af50,{options:_0xb17d49,tdx:_0x3911d9}=_0x402d2f,_0x2769a3=await withSpinner(_0xfb730c(0x127)+_0x5254fd+'\x27...',()=>_0x3911d9[_0xfb730c(0x118)]['resolvePathToResource'](_0x5254fd),{'verbose':_0xb17d49[_0xfb730c(0xf4)]}),_0x555e11=_0x2769a3['data'];_0xb17d49[_0xfb730c(0xf4)]&&(console[_0xfb730c(0x122)](_0xfb730c(0x128)+_0x555e11[_0xfb730c(0xe9)]),_0x555e11[_0xfb730c(0xe2)]&&console['error'](_0xfb730c(0x11a)+_0x555e11['folderId']));const _0x44f13b=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x3911d9[_0xfb730c(0x118)][_0xfb730c(0xe6)](_0x555e11['parentId'],_0x555e11['folderId']),{'verbose':_0xb17d49[_0xfb730c(0xf4)]}),{folders:_0x51fd0e,segments:_0x416214,journeys:_0x31cb6b}=_0x44f13b[_0xfb730c(0x11c)],_0x4b7978=_0x51fd0e[_0xfb730c(0x123)]+_0x416214[_0xfb730c(0x123)]+_0x31cb6b[_0xfb730c(0x123)];console[_0xfb730c(0x122)](_0xfb730c(0xfa)+_0x51fd0e[_0xfb730c(0x123)]+_0xfb730c(0xe4)+(_0x51fd0e[_0xfb730c(0x123)]!==0x1?'s':'')+',\x20'+_0x416214[_0xfb730c(0x123)]+'\x20segment'+(_0x416214[_0xfb730c(0x123)]!==0x1?'s':'')+_0xfb730c(0x120)+_0x31cb6b[_0xfb730c(0x123)]+_0xfb730c(0xf3)+(_0x31cb6b[_0xfb730c(0x123)]!==0x1?'s':''));const _0x43128a=_0x2b24f0=>{const _0x46bd5b=_0xfb730c;return getConsoleNextUrl(_0xb17d49[_0x46bd5b(0xf0)],_0x46bd5b(0x11d)+_0x555e11['parentId']+'/e/'+_0x2b24f0);},_0x9cb04f=_0x3b4dca=>{const _0x3e9944=_0xfb730c;return getConsoleNextUrl(_0xb17d49[_0x3e9944(0xf0)],_0x3e9944(0x11d)+_0x555e11[_0x3e9944(0xe9)]+_0x3e9944(0x109)+_0x3b4dca+'/j/da');},_0x2d5225=_0xb17d49[_0xfb730c(0xf1)]===_0xfb730c(0xe7)||_0xb17d49[_0xfb730c(0xf1)]===_0xfb730c(0x121);if(_0x2d5225){const _0x2b5bb1=[..._0x51fd0e['map'](_0x49eb56=>({..._0x49eb56,'type':'folder'})),..._0x416214[_0xfb730c(0xf8)](_0x10e269=>({..._0x10e269,'type':_0xfb730c(0x118),'url':_0x43128a(_0x10e269['id'])})),..._0x31cb6b[_0xfb730c(0xf8)](_0x1be6a1=>({..._0x1be6a1,'name':_0x1be6a1[_0xfb730c(0xff)],'type':_0xfb730c(0xe5),'url':_0x9cb04f(_0x1be6a1['id'])}))][_0xfb730c(0xf6)]((_0x3724d9,_0x3c7afd)=>_0x3724d9[_0xfb730c(0x107)][_0xfb730c(0x110)](_0x3c7afd[_0xfb730c(0x107)]));await handleSDKOutput(_0x2b5bb1,_0xb17d49);}else{if(_0x4b7978===0x0)console['log'](a46_0x3ebd03[_0xfb730c(0x10c)]('['+_0x5254fd+']')),console[_0xfb730c(0x119)](_0xfb730c(0x12b));else{console[_0xfb730c(0x119)](a46_0x3ebd03[_0xfb730c(0x10c)]('['+_0x5254fd+']'));const _0x3a82c7=formatFlatList(_0x51fd0e,_0x416214,{'showMetadata':!![],'getSegmentUrl':_0x43128a,'getJourneyUrl':_0x9cb04f},_0x31cb6b);console[_0xfb730c(0x119)](_0x3a82c7);}}return 0x0;}async['listRecursive'](_0x12b780,_0x1399ac){const _0x8f5414=a46_0x35af50,{options:_0x2f61ad,tdx:_0x81ef06}=_0x12b780,_0x14e342=await withSpinner('Resolving\x20path\x20\x27'+_0x1399ac+'\x27...',()=>_0x81ef06[_0x8f5414(0x118)][_0x8f5414(0xeb)](_0x1399ac),{'verbose':_0x2f61ad['verbose']}),_0x4076b1=_0x14e342['data'];_0x2f61ad[_0x8f5414(0xf4)]&&(console[_0x8f5414(0x122)](_0x8f5414(0x128)+_0x4076b1['parentId']),_0x4076b1['folderId']&&console['error'](_0x8f5414(0x11a)+_0x4076b1[_0x8f5414(0xe2)]));const _0x5e59a8=_0x2f61ad[_0x8f5414(0x111)]||0xa,_0x3a8773=await withSpinner(_0x8f5414(0x106),()=>_0x81ef06[_0x8f5414(0x118)][_0x8f5414(0x104)](_0x4076b1[_0x8f5414(0xe9)],_0x4076b1[_0x8f5414(0xe2)],0x0,_0x5e59a8),{'verbose':_0x2f61ad['verbose']}),_0x4c8162=_0x3a8773[_0x8f5414(0x11c)],_0x430af2=_0x5035bf=>{const _0x9b0aca=_0x8f5414;let _0xab4dad=0x0,_0x10798f=0x0,_0x1cadd2=0x0;for(const _0x167474 of _0x5035bf){if(_0x167474[_0x9b0aca(0xe8)]===_0x9b0aca(0xfc))_0xab4dad++;else{if(_0x167474[_0x9b0aca(0xe8)]===_0x9b0aca(0x118))_0x10798f++;else{if(_0x167474[_0x9b0aca(0xe8)]===_0x9b0aca(0xe5))_0x1cadd2++;}}if(_0x167474[_0x9b0aca(0x10b)]){const _0x572193=_0x430af2(_0x167474['children']);_0xab4dad+=_0x572193[_0x9b0aca(0x10f)],_0x10798f+=_0x572193[_0x9b0aca(0x116)],_0x1cadd2+=_0x572193[_0x9b0aca(0xf9)];}}return{'folders':_0xab4dad,'segments':_0x10798f,'journeys':_0x1cadd2};},_0x3be3db=_0x430af2(_0x4c8162);console['error'](_0x8f5414(0x10e)+_0x3be3db[_0x8f5414(0x10f)]+_0x8f5414(0xe4)+(_0x3be3db[_0x8f5414(0x10f)]!==0x1?'s':'')+',\x20'+_0x3be3db[_0x8f5414(0x116)]+'\x20segment'+(_0x3be3db[_0x8f5414(0x116)]!==0x1?'s':'')+_0x8f5414(0x120)+_0x3be3db['journeys']+_0x8f5414(0xf3)+(_0x3be3db[_0x8f5414(0xf9)]!==0x1?'s':''));const _0xcb253d=_0x23c664=>{const _0xeb1f76=_0x8f5414;return getConsoleNextUrl(_0x2f61ad[_0xeb1f76(0xf0)],_0xeb1f76(0x11d)+_0x4076b1[_0xeb1f76(0xe9)]+'/e/'+_0x23c664);},_0x193713=_0x2a7814=>{const _0x3b819f=_0x8f5414;return getConsoleNextUrl(_0x2f61ad[_0x3b819f(0xf0)],_0x3b819f(0x11d)+_0x4076b1[_0x3b819f(0xe9)]+'/e/'+_0x2a7814+_0x3b819f(0xfd));};if(_0x2f61ad[_0x8f5414(0xf1)]===_0x8f5414(0xe7)||_0x2f61ad[_0x8f5414(0xf1)]===_0x8f5414(0x121))await handleSDKOutput(_0x4c8162,_0x2f61ad);else{console[_0x8f5414(0x119)](a46_0x3ebd03['dim']('['+_0x1399ac+']'));const _0x2e017b=formatTree(_0x4c8162,{'showMetadata':!![],'getSegmentUrl':_0xcb253d,'getJourneyUrl':_0x193713});console[_0x8f5414(0x119)](_0x2e017b);}return 0x0;}}
@@ -1 +1 @@
1
- function a47_0x51f7(_0x3b870d,_0x9aa556){_0x3b870d=_0x3b870d-0x195;const _0x240c8b=a47_0x240c();let _0x51f784=_0x240c8b[_0x3b870d];return _0x51f784;}const a47_0x10053a=a47_0x51f7;(function(_0x366f83,_0xe9f282){const _0x341fa4=a47_0x51f7,_0x473698=_0x366f83();while(!![]){try{const _0x3c2e30=-parseInt(_0x341fa4(0x1a6))/0x1*(parseInt(_0x341fa4(0x1a1))/0x2)+parseInt(_0x341fa4(0x1a4))/0x3*(parseInt(_0x341fa4(0x19e))/0x4)+-parseInt(_0x341fa4(0x1ac))/0x5*(-parseInt(_0x341fa4(0x1ba))/0x6)+-parseInt(_0x341fa4(0x1b0))/0x7+parseInt(_0x341fa4(0x199))/0x8*(parseInt(_0x341fa4(0x1b4))/0x9)+-parseInt(_0x341fa4(0x1a0))/0xa+parseInt(_0x341fa4(0x1a9))/0xb;if(_0x3c2e30===_0xe9f282)break;else _0x473698['push'](_0x473698['shift']());}catch(_0x1868fa){_0x473698['push'](_0x473698['shift']());}}}(a47_0x240c,0x3e44a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a47_0x240c(){const _0x13da6f=['Error:\x20','database','4479299WpRqIf','Catalog:\x20','name','24355FvGCXm','execute','showTable','limit','1272222kGzQDH','description','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','...','6588NzGXyc','Usage:\x20tdx\x20show\x20<database.table>','query','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','\x20row','\x20from\x20','132XdRlBV','Show\x20table\x20contents','table','Site:\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','args','error','verbose','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','616ZSWvaa','show','data','length','cause','1416EVYJqj','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','257130zRfoQc','25076FBlbdI','Database:\x20','catalog','3333olLFuw','message','40TWELEl'];a47_0x240c=function(){return _0x13da6f;};return a47_0x240c();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a47_0x10053a(0x1ab)]=a47_0x10053a(0x19a);[a47_0x10053a(0x1b1)]=a47_0x10053a(0x1bb);async[a47_0x10053a(0x1ad)](_0x42cfe8){return this['showTable'](_0x42cfe8);}async[a47_0x10053a(0x1ae)](_0x337d89){const _0x142118=a47_0x10053a,{options:_0x36a6c5,args:_0x4d29be,tdx:_0x1ce154}=_0x337d89;let _0x2b997d;try{_0x2b997d=parseTableReference(_0x4d29be[0x0]);const _0x1b9abc=_0x36a6c5[_0x142118(0x1a8)];!_0x2b997d[_0x142118(0x1a8)]&&_0x1b9abc&&(_0x2b997d[_0x142118(0x1a8)]=_0x1b9abc);const _0x34a3af=validateTableDescribeReference(_0x2b997d);if(_0x34a3af)return console[_0x142118(0x196)](_0x142118(0x1a7)+_0x34a3af),console[_0x142118(0x196)](_0x142118(0x1b5)),console[_0x142118(0x196)](_0x142118(0x198)),console[_0x142118(0x196)](_0x142118(0x1b2)),0x1;}catch(_0x4857ca){return console['error']('Error:\x20'+_0x4857ca[_0x142118(0x1a5)]),console[_0x142118(0x196)](_0x142118(0x1b5)),console[_0x142118(0x196)](_0x142118(0x198)),console[_0x142118(0x196)](_0x142118(0x1b2)),0x1;}const _0x5d02e8=_0x2b997d[_0x142118(0x1a3)],_0x3f314a=_0x2b997d[_0x142118(0x1a8)],_0xcb9392=_0x2b997d[_0x142118(0x1bc)],_0x4ee6b1=resolveLimit(_0x36a6c5[_0x142118(0x1af)],DEFAULT_DISPLAY_LIMIT);try{_0x36a6c5[_0x142118(0x197)]&&(console[_0x142118(0x196)](_0x142118(0x1bd)+_0x36a6c5['site']),_0x5d02e8&&console['error'](_0x142118(0x1aa)+_0x5d02e8),console[_0x142118(0x196)](_0x142118(0x1a2)+_0x3f314a),console[_0x142118(0x196)]('Table:\x20'+_0xcb9392),console[_0x142118(0x196)]('Limit:\x20'+_0x4ee6b1));const _0x1bde89=_0x5d02e8?_0x5d02e8+'.'+_0x3f314a+'.'+_0xcb9392:_0x3f314a+'.'+_0xcb9392,_0x1d764a=await withSpinner('Querying\x20'+_0x1bde89+_0x142118(0x1b3),()=>_0x1ce154[_0x142118(0x1b6)]['showTable'](_0x3f314a,_0xcb9392,_0x4ee6b1,_0x5d02e8),{'verbose':_0x36a6c5['verbose']}),_0x4fdac9=_0x1d764a['data'],_0x52791e=_0x4fdac9[_0x142118(0x19b)];return _0x52791e[_0x142118(0x19c)]===0x0?console[_0x142118(0x196)](_0x142118(0x19f)):console[_0x142118(0x196)]('✔\x20Retrieved\x20'+_0x52791e[_0x142118(0x19c)]+_0x142118(0x1b8)+(_0x52791e[_0x142118(0x19c)]!==0x1?'s':'')+_0x142118(0x1b9)+_0x1bde89),await handleSDKOutput(_0x52791e,_0x36a6c5),0x0;}catch(_0x616a9b){if(_0x616a9b instanceof SDKError)return console[_0x142118(0x196)](_0x142118(0x1a7)+_0x616a9b[_0x142118(0x1a5)]),_0x616a9b[_0x142118(0x19d)]&&console[_0x142118(0x196)]('\x20\x20Cause:\x20'+_0x616a9b[_0x142118(0x19d)]),0x1;throw _0x616a9b;}}['validate'](_0x195e57){const _0x1642d6=a47_0x10053a;if(_0x195e57['args'][_0x1642d6(0x19c)]===0x0)return _0x1642d6(0x1b7);if(_0x195e57[_0x1642d6(0x195)][_0x1642d6(0x19c)]>0x1)return _0x1642d6(0x1be);return undefined;}}
1
+ const a47_0x42ebc7=a47_0xcd84;(function(_0xaac560,_0x2f0a3f){const _0x4ebc6d=a47_0xcd84,_0x29d769=_0xaac560();while(!![]){try{const _0x4659ee=-parseInt(_0x4ebc6d(0x124))/0x1*(parseInt(_0x4ebc6d(0x100))/0x2)+parseInt(_0x4ebc6d(0x10b))/0x3+parseInt(_0x4ebc6d(0x104))/0x4*(-parseInt(_0x4ebc6d(0x103))/0x5)+parseInt(_0x4ebc6d(0x122))/0x6*(-parseInt(_0x4ebc6d(0x101))/0x7)+-parseInt(_0x4ebc6d(0x108))/0x8+parseInt(_0x4ebc6d(0x10f))/0x9+parseInt(_0x4ebc6d(0x119))/0xa;if(_0x4659ee===_0x2f0a3f)break;else _0x29d769['push'](_0x29d769['shift']());}catch(_0x1535fb){_0x29d769['push'](_0x29d769['shift']());}}}(a47_0x1015,0x1e1d9));import{BaseCommand}from'./command.js';function a47_0xcd84(_0x37b8f2,_0x13a227){_0x37b8f2=_0x37b8f2-0x100;const _0x1015db=a47_0x1015();let _0xcd84a2=_0x1015db[_0x37b8f2];return _0xcd84a2;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a47_0x1015(){const _0x591f7f=['showTable','\x20from\x20','database','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','Limit:\x20','3587100ZZEbir','args','table','site','error','limit','catalog','message','Usage:\x20tdx\x20show\x20<database.table>','760902CHvFlQ','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','1KijIWR','252164DmzroA','7fUOnJE','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','10HajzmS','29752WIcNBL','validate','data','verbose','1314488UIBKEJ','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Table:\x20','45858GCqeWC','show','...','length','1632987NFNCvd','\x20\x20Cause:\x20','Show\x20table\x20contents','Error:\x20','Querying\x20'];a47_0x1015=function(){return _0x591f7f;};return a47_0x1015();}export class ShowCommand extends BaseCommand{['name']=a47_0x42ebc7(0x10c);['description']=a47_0x42ebc7(0x111);async['execute'](_0x102aac){return this['showTable'](_0x102aac);}async[a47_0x42ebc7(0x114)](_0x291c26){const _0x3bd697=a47_0x42ebc7,{options:_0x528579,args:_0x17e508,tdx:_0x540275}=_0x291c26;let _0x472cbf;try{_0x472cbf=parseTableReference(_0x17e508[0x0]);const _0x3ef1de=_0x528579['database'];!_0x472cbf['database']&&_0x3ef1de&&(_0x472cbf[_0x3bd697(0x116)]=_0x3ef1de);const _0x5326a3=validateTableDescribeReference(_0x472cbf);if(_0x5326a3)return console['error']('Error:\x20'+_0x5326a3),console['error'](_0x3bd697(0x121)),console[_0x3bd697(0x11d)](_0x3bd697(0x102)),console[_0x3bd697(0x11d)](_0x3bd697(0x109)),0x1;}catch(_0x104b2f){return console[_0x3bd697(0x11d)](_0x3bd697(0x112)+_0x104b2f[_0x3bd697(0x120)]),console[_0x3bd697(0x11d)](_0x3bd697(0x121)),console['error'](_0x3bd697(0x102)),console[_0x3bd697(0x11d)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x1762e4=_0x472cbf[_0x3bd697(0x11f)],_0x4e6109=_0x472cbf[_0x3bd697(0x116)],_0x4a78ad=_0x472cbf[_0x3bd697(0x11b)],_0x2a2493=resolveLimit(_0x528579[_0x3bd697(0x11e)],DEFAULT_DISPLAY_LIMIT);try{_0x528579[_0x3bd697(0x107)]&&(console[_0x3bd697(0x11d)]('Site:\x20'+_0x528579[_0x3bd697(0x11c)]),_0x1762e4&&console['error']('Catalog:\x20'+_0x1762e4),console['error']('Database:\x20'+_0x4e6109),console[_0x3bd697(0x11d)](_0x3bd697(0x10a)+_0x4a78ad),console[_0x3bd697(0x11d)](_0x3bd697(0x118)+_0x2a2493));const _0x866ed5=_0x1762e4?_0x1762e4+'.'+_0x4e6109+'.'+_0x4a78ad:_0x4e6109+'.'+_0x4a78ad,_0x154e25=await withSpinner(_0x3bd697(0x113)+_0x866ed5+_0x3bd697(0x10d),()=>_0x540275['query']['showTable'](_0x4e6109,_0x4a78ad,_0x2a2493,_0x1762e4),{'verbose':_0x528579[_0x3bd697(0x107)]}),_0x37b4fc=_0x154e25['data'],_0x40f3e1=_0x37b4fc[_0x3bd697(0x106)];return _0x40f3e1['length']===0x0?console[_0x3bd697(0x11d)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x3bd697(0x11d)]('✔\x20Retrieved\x20'+_0x40f3e1[_0x3bd697(0x10e)]+'\x20row'+(_0x40f3e1[_0x3bd697(0x10e)]!==0x1?'s':'')+_0x3bd697(0x115)+_0x866ed5),await handleSDKOutput(_0x40f3e1,_0x528579),0x0;}catch(_0x10c316){if(_0x10c316 instanceof SDKError)return console[_0x3bd697(0x11d)](_0x3bd697(0x112)+_0x10c316[_0x3bd697(0x120)]),_0x10c316['cause']&&console[_0x3bd697(0x11d)](_0x3bd697(0x110)+_0x10c316['cause']),0x1;throw _0x10c316;}}[a47_0x42ebc7(0x105)](_0x1c90b2){const _0x49af56=a47_0x42ebc7;if(_0x1c90b2['args']['length']===0x0)return _0x49af56(0x123);if(_0x1c90b2[_0x49af56(0x11a)][_0x49af56(0x10e)]>0x1)return _0x49af56(0x117);return undefined;}}
@@ -1 +1 @@
1
- const a48_0x34835c=a48_0x4201;(function(_0x4cf847,_0x942ac6){const _0x24b2d6=a48_0x4201,_0x27c145=_0x4cf847();while(!![]){try{const _0x2df318=parseInt(_0x24b2d6(0x138))/0x1*(parseInt(_0x24b2d6(0x14b))/0x2)+parseInt(_0x24b2d6(0x131))/0x3+parseInt(_0x24b2d6(0x128))/0x4*(parseInt(_0x24b2d6(0x142))/0x5)+-parseInt(_0x24b2d6(0x122))/0x6+-parseInt(_0x24b2d6(0x141))/0x7*(-parseInt(_0x24b2d6(0x13d))/0x8)+parseInt(_0x24b2d6(0x14c))/0x9*(parseInt(_0x24b2d6(0x124))/0xa)+-parseInt(_0x24b2d6(0x133))/0xb;if(_0x2df318===_0x942ac6)break;else _0x27c145['push'](_0x27c145['shift']());}catch(_0x5dc060){_0x27c145['push'](_0x27c145['shift']());}}}(a48_0x21cc,0xc3423));function a48_0x4201(_0x3d2d98,_0x4d4730){_0x3d2d98=_0x3d2d98-0x11f;const _0x21cc88=a48_0x21cc();let _0x42015f=_0x21cc88[_0x3d2d98];return _0x42015f;}function a48_0x21cc(){const _0x3ab1d0=['1624BFRawz','44495OtEMmC','tdx','last_name','name','filter','getUserInfo','message','Name:','N/A','284018mthZky','99126bNCVwi','User:','yellow','✗\x20Validation\x20failed:\x20','Show\x20authentication\x20status\x20and\x20current\x20context','2015376KEoJMS','execute','830uUQqlL','session','(from\x20','first_name','52eQMpRj','status','displayWithSources','Account\x20ID:','site','cli','account_id','\x20profile:\x20','dim','1990209EmsjDl','bold','19209168wrXgvV','join','description','cyan','log','7kWPnqO','TDX_PROFILE\x20env','No\x20credential\x20found','jobs','profile','6712phQVdF','profileSource','config','Credential\x20type:\x20'];a48_0x21cc=function(){return _0x3ab1d0;};return a48_0x21cc();}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 a48_0x7f915f from'chalk';export class StatusCommand extends BaseCommand{[a48_0x34835c(0x145)]=a48_0x34835c(0x129);[a48_0x34835c(0x135)]=a48_0x34835c(0x121);async[a48_0x34835c(0x123)](_0x18f49b){const _0x5a21a0=a48_0x34835c,{options:_0x1a2384,tdx:_0xf12431}=_0x18f49b,_0x2c1a08=_0x1a2384[_0x5a21a0(0x12c)],_0xc8442c=new GlobalContext(_0x1a2384),_0xe195a=_0xc8442c[_0x5a21a0(0x13c)],_0x32079a=_0xc8442c[_0x5a21a0(0x13e)],_0x460011=_0x32079a===_0x5a21a0(0x12d)?'CLI\x20flag':_0x32079a===_0x5a21a0(0x125)?_0x5a21a0(0x125):_0x32079a==='env'?_0x5a21a0(0x139):_0x32079a===_0x5a21a0(0x13f)?_0x5a21a0(0x13f):null,_0x264bf9=_0xe195a?a48_0x7f915f[_0x5a21a0(0x136)](_0xe195a):a48_0x7f915f[_0x5a21a0(0x130)](_0x5a21a0(0x14a)),_0x4899dd=_0x460011?'\x20'+a48_0x7f915f['dim'](_0x5a21a0(0x126)+_0x460011+')'):'';console[_0x5a21a0(0x137)](a48_0x7f915f[_0x5a21a0(0x132)](_0x5a21a0(0x143))+_0x5a21a0(0x12f)+_0x264bf9+_0x4899dd+'\x20'+a48_0x7f915f['dim']('(')+'site:\x20'+a48_0x7f915f[_0x5a21a0(0x136)](_0x2c1a08)+a48_0x7f915f['dim'](')'));const _0x214c21=await getOAuthTokens(_0xe195a);if(_0x214c21)console[_0x5a21a0(0x137)](_0x5a21a0(0x140)+a48_0x7f915f[_0x5a21a0(0x136)]('OAuth'));else{const _0x4a1d05=await resolveAPIKeyAsync(_0x2c1a08,_0xe195a);if(_0x4a1d05){const {source:_0x2f161a,isDeprecated:_0x52e7f3}=_0x4a1d05,_0x3d7ca5='Read\x20credential\x20from\x20'+a48_0x7f915f[_0x5a21a0(0x136)](_0x2f161a);console[_0x5a21a0(0x137)](_0x52e7f3?a48_0x7f915f[_0x5a21a0(0x11f)](_0x3d7ca5):_0x3d7ca5);}else console[_0x5a21a0(0x137)](a48_0x7f915f[_0x5a21a0(0x11f)](_0x5a21a0(0x13a)));}let _0x3da1e4=![];try{const _0x323ec3=await _0xf12431[_0x5a21a0(0x13b)][_0x5a21a0(0x147)]();console[_0x5a21a0(0x137)](a48_0x7f915f['green']('✓\x20Authentication\x20successful\x0a')),console[_0x5a21a0(0x137)](a48_0x7f915f[_0x5a21a0(0x132)](_0x5a21a0(0x14d))+'\x20'+a48_0x7f915f[_0x5a21a0(0x136)](_0x323ec3['email']));if(_0x323ec3[_0x5a21a0(0x127)]||_0x323ec3[_0x5a21a0(0x144)]){const _0x16220b=[_0x323ec3[_0x5a21a0(0x127)],_0x323ec3['last_name']][_0x5a21a0(0x146)](Boolean)[_0x5a21a0(0x134)]('\x20');console[_0x5a21a0(0x137)](a48_0x7f915f[_0x5a21a0(0x132)](_0x5a21a0(0x149))+'\x20'+_0x16220b);}_0x323ec3[_0x5a21a0(0x12e)]&&console[_0x5a21a0(0x137)](a48_0x7f915f[_0x5a21a0(0x132)](_0x5a21a0(0x12b))+'\x20'+a48_0x7f915f[_0x5a21a0(0x11f)](_0x323ec3['account_id'])),_0x3da1e4=!![];}catch(_0x30d557){_0x30d557 instanceof HTTPClientError&&_0x30d557[_0x5a21a0(0x129)]===0x191?printAuthError(_0x30d557,!![],_0xe195a):console['error'](a48_0x7f915f['red'](_0x5a21a0(0x120)+(_0x30d557 instanceof Error?_0x30d557[_0x5a21a0(0x148)]:String(_0x30d557))));}return console['log'](),_0xc8442c[_0x5a21a0(0x12a)](),_0x3da1e4?0x0:0x1;}}
1
+ const a48_0x4f84f6=a48_0x3705;(function(_0x2eeff0,_0x4faaa4){const _0x399dbe=a48_0x3705,_0x3cbe64=_0x2eeff0();while(!![]){try{const _0x1b8ff6=-parseInt(_0x399dbe(0x1f8))/0x1*(-parseInt(_0x399dbe(0x1ee))/0x2)+-parseInt(_0x399dbe(0x205))/0x3+-parseInt(_0x399dbe(0x1f0))/0x4*(-parseInt(_0x399dbe(0x1e8))/0x5)+-parseInt(_0x399dbe(0x20e))/0x6+parseInt(_0x399dbe(0x219))/0x7*(-parseInt(_0x399dbe(0x1fd))/0x8)+-parseInt(_0x399dbe(0x1f1))/0x9+parseInt(_0x399dbe(0x202))/0xa;if(_0x1b8ff6===_0x4faaa4)break;else _0x3cbe64['push'](_0x3cbe64['shift']());}catch(_0x29af21){_0x3cbe64['push'](_0x3cbe64['shift']());}}}(a48_0x45f7,0xc4643));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 a48_0x587ab9 from'chalk';function a48_0x45f7(){const _0x62ed9c=['green','yellow','status','message','profile','CLI\x20flag','506962NviDJm','cyan','env','account_id','site:\x20','5350280yLiigu','Name:','User:','N/A','config','25416460opkbLQ','log','getUserInfo','600114euVEFA','email','session','profileSource','cli','description','Read\x20credential\x20from\x20','first_name','red','9250368QuAUwR','✗\x20Validation\x20failed:\x20','Account\x20ID:','Show\x20authentication\x20status\x20and\x20current\x20context','(from\x20','✓\x20Authentication\x20successful\x0a','join','TDX_PROFILE\x20env','site','bold','jobs','14JpwptB','name','2063810IrCChJ','displayWithSources','Credential\x20type:\x20','\x20profile:\x20','error','dim','4CYYPwN','tdx','8OYZpFf','4476051QxfpFP'];a48_0x45f7=function(){return _0x62ed9c;};return a48_0x45f7();}function a48_0x3705(_0x4506ed,_0x45965c){_0x4506ed=_0x4506ed-0x1e8;const _0x45f7e6=a48_0x45f7();let _0x3705da=_0x45f7e6[_0x4506ed];return _0x3705da;}export class StatusCommand extends BaseCommand{[a48_0x4f84f6(0x21a)]=a48_0x4f84f6(0x1f4);[a48_0x4f84f6(0x20a)]=a48_0x4f84f6(0x211);async['execute'](_0x1585b8){const _0x50a256=a48_0x4f84f6,{options:_0x315024,tdx:_0x4ea012}=_0x1585b8,_0x4b00aa=_0x315024[_0x50a256(0x216)],_0x4a59f2=new GlobalContext(_0x315024),_0x1b239e=_0x4a59f2[_0x50a256(0x1f6)],_0x17ecad=_0x4a59f2[_0x50a256(0x208)],_0x33a332=_0x17ecad===_0x50a256(0x209)?_0x50a256(0x1f7):_0x17ecad===_0x50a256(0x207)?_0x50a256(0x207):_0x17ecad===_0x50a256(0x1fa)?_0x50a256(0x215):_0x17ecad==='config'?_0x50a256(0x201):null,_0x2414db=_0x1b239e?a48_0x587ab9[_0x50a256(0x1f9)](_0x1b239e):a48_0x587ab9[_0x50a256(0x1ed)](_0x50a256(0x200)),_0x4c04f8=_0x33a332?'\x20'+a48_0x587ab9[_0x50a256(0x1ed)](_0x50a256(0x212)+_0x33a332+')'):'';console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x217)](_0x50a256(0x1ef))+_0x50a256(0x1eb)+_0x2414db+_0x4c04f8+'\x20'+a48_0x587ab9[_0x50a256(0x1ed)]('(')+_0x50a256(0x1fc)+a48_0x587ab9[_0x50a256(0x1f9)](_0x4b00aa)+a48_0x587ab9[_0x50a256(0x1ed)](')'));const _0x53a8a9=await getOAuthTokens(_0x1b239e);if(_0x53a8a9)console['log'](_0x50a256(0x1ea)+a48_0x587ab9[_0x50a256(0x1f9)]('OAuth'));else{const _0x182bc8=await resolveAPIKeyAsync(_0x4b00aa,_0x1b239e);if(_0x182bc8){const {source:_0x586475,isDeprecated:_0x3a2cc9}=_0x182bc8,_0x14ca47=_0x50a256(0x20b)+a48_0x587ab9[_0x50a256(0x1f9)](_0x586475);console['log'](_0x3a2cc9?a48_0x587ab9['yellow'](_0x14ca47):_0x14ca47);}else console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x1f3)]('No\x20credential\x20found'));}let _0x59daf9=![];try{const _0x39f272=await _0x4ea012[_0x50a256(0x218)][_0x50a256(0x204)]();console['log'](a48_0x587ab9[_0x50a256(0x1f2)](_0x50a256(0x213))),console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x217)](_0x50a256(0x1ff))+'\x20'+a48_0x587ab9[_0x50a256(0x1f9)](_0x39f272[_0x50a256(0x206)]));if(_0x39f272[_0x50a256(0x20c)]||_0x39f272['last_name']){const _0x2ba291=[_0x39f272[_0x50a256(0x20c)],_0x39f272['last_name']]['filter'](Boolean)[_0x50a256(0x214)]('\x20');console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x217)](_0x50a256(0x1fe))+'\x20'+_0x2ba291);}_0x39f272[_0x50a256(0x1fb)]&&console[_0x50a256(0x203)](a48_0x587ab9[_0x50a256(0x217)](_0x50a256(0x210))+'\x20'+a48_0x587ab9[_0x50a256(0x1f3)](_0x39f272['account_id'])),_0x59daf9=!![];}catch(_0x34211f){_0x34211f instanceof HTTPClientError&&_0x34211f[_0x50a256(0x1f4)]===0x191?printAuthError(_0x34211f,!![],_0x1b239e):console[_0x50a256(0x1ec)](a48_0x587ab9[_0x50a256(0x20d)](_0x50a256(0x20f)+(_0x34211f instanceof Error?_0x34211f[_0x50a256(0x1f5)]:String(_0x34211f))));}return console[_0x50a256(0x203)](),_0x4a59f2[_0x50a256(0x1e9)](),_0x59daf9?0x0:0x1;}}