@treasuredata/tdx 2026.6.0 → 2026.6.1

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 (232) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/table-deleted.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/tools/work-create-item.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/cas/cas-api-client.js +1 -1
  94. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  95. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  96. package/dist/sdk/cas/index.js +1 -1
  97. package/dist/sdk/cas/pull-workflow.js +1 -1
  98. package/dist/sdk/cas/push-workflow.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.js +1 -1
  105. package/dist/sdk/client/llm-api-client.js +1 -1
  106. package/dist/sdk/client/oauth-refresh.js +1 -1
  107. package/dist/sdk/client/rate-limiter.js +1 -1
  108. package/dist/sdk/client/td-api-client.js +1 -1
  109. package/dist/sdk/client/trino-api-client.js +1 -1
  110. package/dist/sdk/client/workflow-client.js +1 -1
  111. package/dist/sdk/connection-validator.js +1 -1
  112. package/dist/sdk/connection.js +1 -1
  113. package/dist/sdk/delivery.js +1 -1
  114. package/dist/sdk/engage/campaign-pull.js +1 -1
  115. package/dist/sdk/engage/campaign-push.js +1 -1
  116. package/dist/sdk/engage/campaign-validator.js +1 -1
  117. package/dist/sdk/engage/campaign-yaml.js +1 -1
  118. package/dist/sdk/engage/template-pull.js +1 -1
  119. package/dist/sdk/engage/template-push.js +1 -1
  120. package/dist/sdk/engage/template-validator.js +1 -1
  121. package/dist/sdk/engage/template-yaml.js +1 -1
  122. package/dist/sdk/engage/types/campaign-def.js +1 -1
  123. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  124. package/dist/sdk/engage/types/template-schema.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.js +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/io/index.js +1 -1
  129. package/dist/sdk/io/node-filesystem.js +1 -1
  130. package/dist/sdk/job.js +1 -1
  131. package/dist/sdk/journey.js +1 -1
  132. package/dist/sdk/llm/chat-cache.js +1 -1
  133. package/dist/sdk/llm/index.js +1 -1
  134. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  135. package/dist/sdk/llm/model-factors.d.ts +8 -4
  136. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  137. package/dist/sdk/llm/model-factors.js +1 -1
  138. package/dist/sdk/llm/model-factors.js.map +1 -1
  139. package/dist/sdk/llm/user-settings.js +1 -1
  140. package/dist/sdk/personalization.js +1 -1
  141. package/dist/sdk/policy.js +1 -1
  142. package/dist/sdk/query/deleted-table-validation.js +1 -1
  143. package/dist/sdk/query/index.js +1 -1
  144. package/dist/sdk/query/sql-parser.js +1 -1
  145. package/dist/sdk/realtime.js +1 -1
  146. package/dist/sdk/schedule.js +1 -1
  147. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  148. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  149. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  150. package/dist/sdk/segment/fields-display.js +1 -1
  151. package/dist/sdk/segment/file-discovery.js +1 -1
  152. package/dist/sdk/segment/journey-utils.js +1 -1
  153. package/dist/sdk/segment/journey-validator.js +1 -1
  154. package/dist/sdk/segment/journey-yaml.js +1 -1
  155. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  156. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  157. package/dist/sdk/segment/pull-workflow.js +1 -1
  158. package/dist/sdk/segment/push-recovery.js +1 -1
  159. package/dist/sdk/segment/push-workflow.js +1 -1
  160. package/dist/sdk/segment/resolution-context.js +1 -1
  161. package/dist/sdk/segment/segment-path-parser.js +1 -1
  162. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  163. package/dist/sdk/segment/segment-validator.js +1 -1
  164. package/dist/sdk/segment/target-resolution.js +1 -1
  165. package/dist/sdk/segment/tdx-config.js +1 -1
  166. package/dist/sdk/segment/types/activation-schema.js +1 -1
  167. package/dist/sdk/segment/types/journey-def.js +1 -1
  168. package/dist/sdk/segment/types/journey-schema.js +1 -1
  169. package/dist/sdk/segment/types/segment-def.js +1 -1
  170. package/dist/sdk/segment/types/segment-schema.js +1 -1
  171. package/dist/sdk/segment/validate-files.js +1 -1
  172. package/dist/sdk/segment/yaml-validator.js +1 -1
  173. package/dist/sdk/segment.js +1 -1
  174. package/dist/sdk/types/cdp.d.ts +4 -3
  175. package/dist/sdk/types/cdp.d.ts.map +1 -1
  176. package/dist/sdk/types/index.js +1 -1
  177. package/dist/sdk/types/progress.js +1 -1
  178. package/dist/sdk/types/workspace.js +1 -1
  179. package/dist/sdk/user.js +1 -1
  180. package/dist/sdk/util/format-detector.js +1 -1
  181. package/dist/sdk/util/formatters.js +1 -1
  182. package/dist/sdk/util/index.js +1 -1
  183. package/dist/sdk/util/paginate.js +1 -1
  184. package/dist/sdk/util/tree-formatter.js +1 -1
  185. package/dist/sdk/workflow/archive-validation.js +1 -1
  186. package/dist/sdk/workflow/clone-workflow.js +1 -1
  187. package/dist/sdk/workflow/index.js +1 -1
  188. package/dist/sdk/workflow/pull-workflow.js +1 -1
  189. package/dist/sdk/workflow/push-workflow.js +1 -1
  190. package/dist/sdk/workflow/task-graph.js +1 -1
  191. package/dist/sdk/workflow/tdx-config.js +1 -1
  192. package/dist/sdk/workflow/workflow-utils.js +1 -1
  193. package/dist/sdk/workspace/access-tracker.js +1 -1
  194. package/dist/sdk/workspace/frontmatter.js +1 -1
  195. package/dist/sdk/workspace/git.js +1 -1
  196. package/dist/sdk/workspace/index.js +1 -1
  197. package/dist/sdk/workspace/templates.js +1 -1
  198. package/dist/sdk/workspace/weekly.js +1 -1
  199. package/dist/sdk/workspace/wikilinks.js +1 -1
  200. package/dist/test-utils/command-runner.js +1 -1
  201. package/dist/test-utils/factories.js +1 -1
  202. package/dist/test-utils/fixtures.js +1 -1
  203. package/dist/test-utils/http-mock.js +1 -1
  204. package/dist/test-utils/index.js +1 -1
  205. package/dist/utils/async.js +1 -1
  206. package/dist/utils/colors.js +1 -1
  207. package/dist/utils/diff.js +1 -1
  208. package/dist/utils/file-permissions.js +1 -1
  209. package/dist/utils/file-reader.js +1 -1
  210. package/dist/utils/github-releases.js +1 -1
  211. package/dist/utils/global-cache.js +1 -1
  212. package/dist/utils/json-loader.js +1 -1
  213. package/dist/utils/local-cache.js +1 -1
  214. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  215. package/dist/utils/logger/formatters/index.js +1 -1
  216. package/dist/utils/logger/handlers/console-handler.js +1 -1
  217. package/dist/utils/logger/handlers/file-handler.js +1 -1
  218. package/dist/utils/logger/handlers/index.js +1 -1
  219. package/dist/utils/logger/handlers/null-handler.js +1 -1
  220. package/dist/utils/logger/index.js +1 -1
  221. package/dist/utils/logger/logger.js +1 -1
  222. package/dist/utils/logger/types.js +1 -1
  223. package/dist/utils/option-validation.js +1 -1
  224. package/dist/utils/process.js +1 -1
  225. package/dist/utils/prompt.js +1 -1
  226. package/dist/utils/spinner.js +1 -1
  227. package/dist/utils/sse-parser.js +1 -1
  228. package/dist/utils/string-utils.js +1 -1
  229. package/dist/utils/table-ref-parser.js +1 -1
  230. package/dist/utils/tdx-logger.js +1 -1
  231. package/dist/utils/version-check.js +1 -1
  232. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x30486f=a40_0x5cdb;function a40_0x5cdb(_0x1dedd6,_0x426d81){_0x1dedd6=_0x1dedd6-0x194;const _0x8b970f=a40_0x8b97();let _0x5cdb16=_0x8b970f[_0x1dedd6];return _0x5cdb16;}(function(_0x1bdd6e,_0x3d0338){const _0x215157=a40_0x5cdb,_0x462c33=_0x1bdd6e();while(!![]){try{const _0x5e6b55=parseInt(_0x215157(0x1d9))/0x1+-parseInt(_0x215157(0x1e3))/0x2+parseInt(_0x215157(0x1a7))/0x3*(-parseInt(_0x215157(0x1c1))/0x4)+parseInt(_0x215157(0x1e0))/0x5+-parseInt(_0x215157(0x1cb))/0x6+-parseInt(_0x215157(0x1d0))/0x7+-parseInt(_0x215157(0x1d4))/0x8*(-parseInt(_0x215157(0x1dc))/0x9);if(_0x5e6b55===_0x3d0338)break;else _0x462c33['push'](_0x462c33['shift']());}catch(_0x2ef727){_0x462c33['push'](_0x462c33['shift']());}}}(a40_0x8b97,0x4bab9));function a40_0x8b97(){const _0x5c7bb7=['Target\x20resource:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20All\x20files\x20are\x20up\x20to\x20date','verbose','\x20journeys','754806LZXlFa','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','session','segment','isNew','\x20unchanged\x20files','segments','content','Site:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20=\x20','site','journeyVersions','utf-8','\x20\x20🗺️\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','activations','✔\x20Pulled\x20','resourceName','\x20files\x20to\x20','yellow','cwd','helpText','filter','-\x20no\x20files\x20written','name','8BZTIXF','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20versions)','Aborted.','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Target:\x20','counts','files','file','parent_segment','2009772lDDxfN','parentName','hasChanges','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','message','3348751jaNKsC','\x0aChanges\x20to\x20\x27','description','relativePath','12332536nWkGPk','no_parent','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','execute','data','445586aFCrfd','\x20\x20🎯\x20','length','9dQEUEy','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errorCode','parentSegment','980745aUfGMT','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)','absolutePath','1113596LLLyhp','Pulling\x20segments\x20from\x20\x27','\x20changed\x20files','targetDir','dim','Error:\x20','✔\x20Context\x20set:\x20','red','green','cyan','Parent\x20segment:\x20','repeat','segment:pull','dirname','\x20files?','journeys','error'];a40_0x8b97=function(){return _0x5c7bb7;};return a40_0x8b97();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x532333 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x4206c5 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x30486f(0x1c0)]=a40_0x30486f(0x19d);[a40_0x30486f(0x1d2)]=a40_0x30486f(0x1ce);async[a40_0x30486f(0x1d7)](_0x433943){const _0x23ba10=a40_0x30486f,{options:_0x24e440,args:_0xd6b5f2,tdx:_0x3fa019}=_0x433943,_0x1e9686=_0x24e440,_0x1c579b=await resolveTarget({'arg':_0xd6b5f2[0x0],'contextParent':_0x24e440[_0x23ba10(0x1df)],'cwd':process[_0x23ba10(0x1bc)]()});if(!isSuccessfulResolution(_0x1c579b))return _0x1c579b[_0x23ba10(0x1de)]===_0x23ba10(0x1d5)?(console[_0x23ba10(0x1a1)](a40_0x532333[_0x23ba10(0x1bb)](_0x23ba10(0x1dd))),console[_0x23ba10(0x1a1)](_0x23ba10(0x1e1)),console[_0x23ba10(0x1a1)](_0x23ba10(0x1b6)),console[_0x23ba10(0x1a1)](_0x23ba10(0x1b0))):(console[_0x23ba10(0x1a1)](a40_0x532333[_0x23ba10(0x198)](_0x23ba10(0x196)+_0x1c579b[_0x23ba10(0x1cf)]+'\x0a')),_0x1c579b[_0x23ba10(0x1bd)]&&console['error'](a40_0x532333[_0x23ba10(0x19a)](_0x1c579b[_0x23ba10(0x1bd)]))),0x1;const _0x4c3df5=_0x1c579b[_0x23ba10(0x1cc)],_0x74c5f0=_0x1c579b[_0x23ba10(0x194)],_0x16162a=_0x1c579b['type']===_0x23ba10(0x1c9)?_0x1c579b[_0x23ba10(0x1b9)]:undefined;_0x1e9686[_0x23ba10(0x1a5)]&&(console['error'](_0x23ba10(0x1af)+_0x1e9686[_0x23ba10(0x1b2)]),console['error'](_0x23ba10(0x19b)+_0x4c3df5),_0x16162a&&console['error'](_0x23ba10(0x1a2)+_0x16162a));const _0x46ebfa=await withProgressSpinner(_0x23ba10(0x1e4)+_0x4c3df5+'\x27...',_0x403dd6=>_0x3fa019[_0x23ba10(0x1aa)]['pullSegments'](_0x4c3df5,{'targetDir':_0x74c5f0,'targetResourceName':_0x16162a,'verbose':_0x1e9686['verbose'],'progress':{'update':_0x1725ab=>{const _0x53c2ab=_0x23ba10;_0x403dd6['setPhase'](_0x1725ab),_0x1e9686[_0x53c2ab(0x1a5)]&&console[_0x53c2ab(0x1a1)]('\x20\x20'+_0x1725ab);}}}),{'verbose':_0x1e9686['verbose']}),_0x1cc48a=_0x46ebfa[_0x23ba10(0x1d8)];if(_0x1cc48a[_0x23ba10(0x1c7)]['segments']===0x0&&_0x1cc48a[_0x23ba10(0x1c7)]['journeys']===0x0)return console[_0x23ba10(0x1a1)](a40_0x532333['yellow'](_0x23ba10(0x1d6)+_0x1cc48a[_0x23ba10(0x1cc)]+'\x27')),0x0;const _0x547b40=_0x1cc48a[_0x23ba10(0x1c8)]['filter'](_0x56d6c8=>_0x56d6c8[_0x23ba10(0x1ab)]),_0x36efce=_0x1cc48a[_0x23ba10(0x1c8)][_0x23ba10(0x1be)](_0xeb8126=>!_0xeb8126[_0x23ba10(0x1ab)]&&_0xeb8126[_0x23ba10(0x1cd)]),_0x443423=_0x1cc48a[_0x23ba10(0x1c8)][_0x23ba10(0x1be)](_0x3b9da1=>!_0x3b9da1['isNew']&&!_0x3b9da1[_0x23ba10(0x1cd)]);console[_0x23ba10(0x1a1)](_0x23ba10(0x1c5)+_0x1cc48a[_0x23ba10(0x1cc)]+'\x27:'),console['error'](_0x23ba10(0x1da)+a40_0x532333['cyan'](_0x1cc48a[_0x23ba10(0x1c7)][_0x23ba10(0x1ad)]+'\x20segments')+'\x20with\x20'+a40_0x532333[_0x23ba10(0x19a)](_0x1cc48a[_0x23ba10(0x1c7)][_0x23ba10(0x1b7)]+'\x20activations'));if(_0x1cc48a['counts'][_0x23ba10(0x1a0)]>0x0){const _0x42c67d=_0x1cc48a[_0x23ba10(0x1c7)][_0x23ba10(0x1b3)]>_0x1cc48a[_0x23ba10(0x1c7)][_0x23ba10(0x1a0)]?'\x20('+_0x1cc48a[_0x23ba10(0x1c7)][_0x23ba10(0x1b3)]+_0x23ba10(0x1c3):'';console['error'](_0x23ba10(0x1b5)+a40_0x532333[_0x23ba10(0x19a)](_0x1cc48a['counts']['journeys']+_0x23ba10(0x1a6))+a40_0x532333[_0x23ba10(0x195)](_0x42c67d));}console[_0x23ba10(0x1a1)]('\x20\x20'+a40_0x532333[_0x23ba10(0x199)]('+\x20'+_0x547b40[_0x23ba10(0x1db)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x532333[_0x23ba10(0x1bb)]('~\x20'+_0x36efce[_0x23ba10(0x1db)]+_0x23ba10(0x1e5))),console[_0x23ba10(0x1a1)]('\x20\x20'+a40_0x532333[_0x23ba10(0x195)]('=\x20'+_0x443423[_0x23ba10(0x1db)]+_0x23ba10(0x1ac))),console[_0x23ba10(0x1a1)](_0x23ba10(0x1c6)+a40_0x532333['cyan'](_0x1cc48a[_0x23ba10(0x194)])+'\x0a');if(_0x36efce[_0x23ba10(0x1db)]>0x0)for(const _0x1315c9 of _0x36efce){console['error'](_0x23ba10(0x1d1)+_0x1315c9[_0x23ba10(0x1d3)]+'\x27:'),console[_0x23ba10(0x1a1)]('─'[_0x23ba10(0x19c)](0x3c)),console['error'](_0x1315c9['diff']),console['error']('─'[_0x23ba10(0x19c)](0x3c));}if(_0x1e9686['dryRun'])return console['error'](a40_0x532333[_0x23ba10(0x1bb)](_0x23ba10(0x1a3))),0x0;if(_0x547b40[_0x23ba10(0x1db)]===0x0&&_0x36efce['length']===0x0)return console[_0x23ba10(0x1a1)](a40_0x532333[_0x23ba10(0x199)](_0x23ba10(0x1a4))),saveSessionContext({'parent_segment':_0x1cc48a[_0x23ba10(0x1cc)]},_0x1e9686[_0x23ba10(0x1a9)]),console[_0x23ba10(0x1a1)](a40_0x532333['green'](_0x23ba10(0x197)+a40_0x532333[_0x23ba10(0x195)](_0x23ba10(0x1ca))+'\x20=\x20'+a40_0x532333[_0x23ba10(0x19a)](_0x1cc48a['parentName']))),0x0;if(!_0x1e9686['yes']){if(!isInteractive())return console[_0x23ba10(0x1a1)](a40_0x532333[_0x23ba10(0x198)]('\x0aError:'),_0x23ba10(0x1a8)),console[_0x23ba10(0x1a1)](a40_0x532333[_0x23ba10(0x195)](_0x23ba10(0x1c2))),0x1;const _0x1e258c=await confirmKey('Write\x20'+(_0x547b40['length']+_0x36efce['length'])+_0x23ba10(0x19f));if(!_0x1e258c)return console[_0x23ba10(0x1a1)](a40_0x532333[_0x23ba10(0x1bb)](_0x23ba10(0x1c4)),_0x23ba10(0x1bf)),0x1;}for(const _0x403a87 of _0x1cc48a['files']){if(_0x403a87[_0x23ba10(0x1ab)]||_0x403a87[_0x23ba10(0x1cd)]){const _0x42b05b=a40_0x4206c5[_0x23ba10(0x19e)](_0x403a87[_0x23ba10(0x1e2)]);!existsSync(_0x42b05b)&&mkdirSync(_0x42b05b,{'recursive':!![]}),writeFileSync(_0x403a87[_0x23ba10(0x1e2)],_0x403a87[_0x23ba10(0x1ae)],_0x23ba10(0x1b4));}}return console['error'](a40_0x532333[_0x23ba10(0x199)](_0x23ba10(0x1b8)+(_0x547b40[_0x23ba10(0x1db)]+_0x36efce[_0x23ba10(0x1db)])+_0x23ba10(0x1ba)+_0x1cc48a['targetDir'])),saveSessionContext({'parent_segment':_0x1cc48a[_0x23ba10(0x1cc)]},_0x1e9686[_0x23ba10(0x1a9)]),console[_0x23ba10(0x1a1)](a40_0x532333[_0x23ba10(0x199)](_0x23ba10(0x197)+a40_0x532333[_0x23ba10(0x195)](_0x23ba10(0x1ca))+_0x23ba10(0x1b1)+a40_0x532333[_0x23ba10(0x19a)](_0x1cc48a[_0x23ba10(0x1cc)]))),0x0;}}
1
+ const a40_0x3b6a46=a40_0x2fd3;function a40_0x2fd3(_0x56f22b,_0x499d18){_0x56f22b=_0x56f22b-0xc4;const _0x23d122=a40_0x23d1();let _0x2fd312=_0x23d122[_0x56f22b];return _0x2fd312;}(function(_0x1262ae,_0x5865cc){const _0x5c7e81=a40_0x2fd3,_0x39d93c=_0x1262ae();while(!![]){try{const _0xdcef9b=-parseInt(_0x5c7e81(0xc5))/0x1*(-parseInt(_0x5c7e81(0x10e))/0x2)+parseInt(_0x5c7e81(0xd5))/0x3*(-parseInt(_0x5c7e81(0xc4))/0x4)+parseInt(_0x5c7e81(0xf2))/0x5+-parseInt(_0x5c7e81(0x10f))/0x6*(parseInt(_0x5c7e81(0x102))/0x7)+-parseInt(_0x5c7e81(0xca))/0x8+parseInt(_0x5c7e81(0xe9))/0x9+parseInt(_0x5c7e81(0xd6))/0xa;if(_0xdcef9b===_0x5865cc)break;else _0x39d93c['push'](_0x39d93c['shift']());}catch(_0xbe9a54){_0x39d93c['push'](_0x39d93c['shift']());}}}(a40_0x23d1,0x55eb7));import{BaseCommand}from'./command.js';function a40_0x23d1(){const _0x1039c1=['isNew','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20files\x20to\x20','Parent\x20segment:\x20','2221615kwREup','files','\x20=\x20','red','error','\x20changed\x20files','session','absolutePath','segments','\x20\x20🎯\x20','Target\x20resource:\x20','\x20\x20Target:\x20','Write\x20','yes','cyan','\x20new\x20files','42623BxgZLq','journeyVersions','\x20\x20🗺️\x20\x20','helpText','parent_segment','Error:\x20','segment','targetDir','type','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20All\x20files\x20are\x20up\x20to\x20date','pullSegments','26oyXovH','642uBDgSE','\x20with\x20','length','168332KuCzEM','5374gUAUZb','file','dryRun','utf-8','description','3291232KSclVv','execute','parentName','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x0aError:','resourceName','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)','\x20files?','segment:pull','\x20journeys','39PwizdU','9392690HxcknB','counts','\x20segments','cwd','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','no_parent','\x20unchanged\x20files','dim','\x20activations','hasChanges','✔\x20Context\x20set:\x20','activations','yellow','setPhase','filter','diff','errorCode','-\x20no\x20files\x20written','4576311vUbJVz','journeys','Site:\x20','verbose','green'];a40_0x23d1=function(){return _0x1039c1;};return a40_0x23d1();}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x202750 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x43e415 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{['name']=a40_0x3b6a46(0xd3);[a40_0x3b6a46(0xc9)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x3b6a46(0xcb)](_0x129d7e){const _0x3d56c5=a40_0x3b6a46,{options:_0x22bf27,args:_0xbe231b,tdx:_0x1077db}=_0x129d7e,_0xbc40ef=_0x22bf27,_0x535ade=await resolveTarget({'arg':_0xbe231b[0x0],'contextParent':_0x22bf27['parentSegment'],'cwd':process[_0x3d56c5(0xd9)]()});if(!isSuccessfulResolution(_0x535ade))return _0x535ade[_0x3d56c5(0xe7)]===_0x3d56c5(0xdc)?(console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xe3)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3d56c5(0xd1)),console[_0x3d56c5(0xf6)](_0x3d56c5(0xdb)),console[_0x3d56c5(0xf6)](_0x3d56c5(0xce))):(console[_0x3d56c5(0xf6)](a40_0x202750['red'](_0x3d56c5(0x107)+_0x535ade['message']+'\x0a')),_0x535ade['helpText']&&console['error'](a40_0x202750[_0x3d56c5(0x100)](_0x535ade[_0x3d56c5(0x105)]))),0x1;const _0x39adb2=_0x535ade[_0x3d56c5(0xcc)],_0x1d4ac1=_0x535ade[_0x3d56c5(0x109)],_0x2c5b02=_0x535ade[_0x3d56c5(0x10a)]===_0x3d56c5(0xc6)?_0x535ade[_0x3d56c5(0xd0)]:undefined;_0xbc40ef[_0x3d56c5(0xec)]&&(console['error'](_0x3d56c5(0xeb)+_0xbc40ef['site']),console[_0x3d56c5(0xf6)](_0x3d56c5(0xf1)+_0x39adb2),_0x2c5b02&&console['error'](_0x3d56c5(0xfc)+_0x2c5b02));const _0x4120fe=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x39adb2+'\x27...',_0x49465b=>_0x1077db[_0x3d56c5(0x108)][_0x3d56c5(0x10d)](_0x39adb2,{'targetDir':_0x1d4ac1,'targetResourceName':_0x2c5b02,'verbose':_0xbc40ef[_0x3d56c5(0xec)],'progress':{'update':_0x5045ee=>{const _0x592081=_0x3d56c5;_0x49465b[_0x592081(0xe4)](_0x5045ee),_0xbc40ef[_0x592081(0xec)]&&console[_0x592081(0xf6)]('\x20\x20'+_0x5045ee);}}}),{'verbose':_0xbc40ef[_0x3d56c5(0xec)]}),_0x1fc416=_0x4120fe[_0x3d56c5(0xda)];if(_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0xfa)]===0x0&&_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0xea)]===0x0)return console['error'](a40_0x202750['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x1fc416[_0x3d56c5(0xcc)]+'\x27')),0x0;const _0x4d5640=_0x1fc416[_0x3d56c5(0xf3)][_0x3d56c5(0xe5)](_0x4262c4=>_0x4262c4['isNew']),_0x595b34=_0x1fc416[_0x3d56c5(0xf3)][_0x3d56c5(0xe5)](_0x52a8d9=>!_0x52a8d9[_0x3d56c5(0xee)]&&_0x52a8d9[_0x3d56c5(0xe0)]),_0x27dbbb=_0x1fc416['files'][_0x3d56c5(0xe5)](_0x560c8d=>!_0x560c8d[_0x3d56c5(0xee)]&&!_0x560c8d[_0x3d56c5(0xe0)]);console[_0x3d56c5(0xf6)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1fc416[_0x3d56c5(0xcc)]+'\x27:'),console['error'](_0x3d56c5(0xfb)+a40_0x202750['cyan'](_0x1fc416['counts'][_0x3d56c5(0xfa)]+_0x3d56c5(0xd8))+_0x3d56c5(0x110)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0xe2)]+_0x3d56c5(0xdf)));if(_0x1fc416['counts'][_0x3d56c5(0xea)]>0x0){const _0x4bd90b=_0x1fc416[_0x3d56c5(0xd7)][_0x3d56c5(0x103)]>_0x1fc416['counts'][_0x3d56c5(0xea)]?'\x20('+_0x1fc416['counts'][_0x3d56c5(0x103)]+'\x20versions)':'';console[_0x3d56c5(0xf6)](_0x3d56c5(0x104)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416['counts'][_0x3d56c5(0xea)]+_0x3d56c5(0xd4))+a40_0x202750[_0x3d56c5(0xde)](_0x4bd90b));}console[_0x3d56c5(0xf6)]('\x20\x20'+a40_0x202750[_0x3d56c5(0xed)]('+\x20'+_0x4d5640[_0x3d56c5(0x111)]+_0x3d56c5(0x101))),console['error']('\x20\x20'+a40_0x202750['yellow']('~\x20'+_0x595b34[_0x3d56c5(0x111)]+_0x3d56c5(0xf7))),console['error']('\x20\x20'+a40_0x202750[_0x3d56c5(0xde)]('=\x20'+_0x27dbbb['length']+_0x3d56c5(0xdd))),console[_0x3d56c5(0xf6)](_0x3d56c5(0xfd)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416[_0x3d56c5(0x109)])+'\x0a');if(_0x595b34['length']>0x0)for(const _0x597136 of _0x595b34){console['error']('\x0aChanges\x20to\x20\x27'+_0x597136['relativePath']+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x3d56c5(0xf6)](_0x597136[_0x3d56c5(0xe6)]),console[_0x3d56c5(0xf6)]('─'['repeat'](0x3c));}if(_0xbc40ef[_0x3d56c5(0xc7)])return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xe3)](_0x3d56c5(0xef))),0x0;if(_0x4d5640[_0x3d56c5(0x111)]===0x0&&_0x595b34[_0x3d56c5(0x111)]===0x0)return console['error'](a40_0x202750[_0x3d56c5(0xed)](_0x3d56c5(0x10c))),saveSessionContext({'parent_segment':_0x1fc416[_0x3d56c5(0xcc)]},_0xbc40ef[_0x3d56c5(0xf8)]),console['error'](a40_0x202750[_0x3d56c5(0xed)](_0x3d56c5(0xe1)+a40_0x202750[_0x3d56c5(0xde)]('parent_segment')+_0x3d56c5(0xf4)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416['parentName']))),0x0;if(!_0xbc40ef[_0x3d56c5(0xff)]){if(!isInteractive())return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xf5)](_0x3d56c5(0xcf)),_0x3d56c5(0x10b)),console[_0x3d56c5(0xf6)](a40_0x202750['dim'](_0x3d56c5(0xcd))),0x1;const _0x58473f=await confirmKey(_0x3d56c5(0xfe)+(_0x4d5640['length']+_0x595b34['length'])+_0x3d56c5(0xd2));if(!_0x58473f)return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xe3)]('Aborted.'),_0x3d56c5(0xe8)),0x1;}for(const _0x57798e of _0x1fc416[_0x3d56c5(0xf3)]){if(_0x57798e[_0x3d56c5(0xee)]||_0x57798e[_0x3d56c5(0xe0)]){const _0x18b3c2=a40_0x43e415['dirname'](_0x57798e[_0x3d56c5(0xf9)]);!existsSync(_0x18b3c2)&&mkdirSync(_0x18b3c2,{'recursive':!![]}),writeFileSync(_0x57798e[_0x3d56c5(0xf9)],_0x57798e['content'],_0x3d56c5(0xc8));}}return console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xed)]('✔\x20Pulled\x20'+(_0x4d5640[_0x3d56c5(0x111)]+_0x595b34[_0x3d56c5(0x111)])+_0x3d56c5(0xf0)+_0x1fc416['targetDir'])),saveSessionContext({'parent_segment':_0x1fc416[_0x3d56c5(0xcc)]},_0xbc40ef[_0x3d56c5(0xf8)]),console[_0x3d56c5(0xf6)](a40_0x202750[_0x3d56c5(0xed)](_0x3d56c5(0xe1)+a40_0x202750['dim'](_0x3d56c5(0x106))+_0x3d56c5(0xf4)+a40_0x202750[_0x3d56c5(0x100)](_0x1fc416[_0x3d56c5(0xcc)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x31cbb5=a41_0x5c3b;function a41_0x5882(){const _0x497f26=['\x20folders\x20to\x20create','cwd','audienceId','Delete\x20journey:','created','push','verbose','.yml','Push\x20','Aborted.','dim','targetDir','\x20deleted','filter','deleted','red','\x20activations]','toDelete','journeyBundleName','📁\x20','delete','\x0aValidation\x20failed:','New\x20journey:','new','error','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error\x20parsing\x20YAML:\x20','\x20changed','.yaml','isScoped','set','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','errorCode','9396FmtKVD','\x20\x20📊\x20Segments:','createdAt','parentSegment','Fetching\x20existing\x20activations...','\x20\x20Source:\x20','getOutputSchemaWithCache','parent_name','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','No\x20','Fetching\x20existing\x20data...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Source\x20directory:\x20','file','diff','no_parent','length','Site:\x20','Delete\x20segment:','Error:\x20Directory\x20not\x20found:\x20','blue','changed','existingJourney','4045650RnolhS','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20unchanged','Error:\x20','yes','12qaiuMB','activations','nameToType','unchanged','green','map','segmentFolderId','\x0a✔\x20Push\x20complete','versionNumber','relationships','endsWith','folderId','Scoped\x20to\x20folder:\x20','updatedAt','updated','journey','1658986cEabCp','segment','Preparing\x20journeys...','createdSegmentIds','\x20new','execute','New\x20segment:','33HkpDQz','idToName','folderPath','\x20\x20Journeys:\x20','\x20\x20Activations:\x20','join','10vOuOcy','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20\x20\x20\x20','48796iIvbcA','/e/','toCreate','8177472XSxPoR','isNew','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','toUpdate','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','helpText','331384wHtZKy','\x20\x20Segments:\x20','listSegments','existingSegment','yamlConfig','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)','journeys','parentName','listActivations','cyan','site','filePath','setPhase','description','\x20\x20🗺️\x20\x20Journeys:','listFolders','/j/da/je','yellow','Parent\x20segment:\x20','add','attributes','Resolving\x20parent\x20segment\x20\x27','Fetching\x20connections\x20for\x20name\x20resolution...','then','repeat','connection','62869aATvjA','\x20created','folders','10zxqNWB','Changes\x20to:','/app/ps/','/sb/da/esr','\x20updated','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','\x20to\x20create','user','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','5094968YbcFQr','get','results','\x20to\x20delete','all','segments','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Changes\x20to\x20journey:','journeyId','journeysOnly','data','\x20YAML\x20files\x20found','message'];a41_0x5882=function(){return _0x497f26;};return a41_0x5882();}(function(_0x3b8bd6,_0x48fe0d){const _0x26de0b=a41_0x5c3b,_0x30e840=_0x3b8bd6();while(!![]){try{const _0x2a4515=-parseInt(_0x26de0b(0x1ee))/0x1*(-parseInt(_0x26de0b(0x1f1))/0x2)+parseInt(_0x26de0b(0x1c2))/0x3*(parseInt(_0x26de0b(0x1d4))/0x4)+parseInt(_0x26de0b(0x1a6))/0x5+parseInt(_0x26de0b(0x1ab))/0x6*(parseInt(_0x26de0b(0x1bb))/0x7)+parseInt(_0x26de0b(0x1fb))/0x8+parseInt(_0x26de0b(0x1ce))/0x9*(parseInt(_0x26de0b(0x1c8))/0xa)+parseInt(_0x26de0b(0x1cb))/0xb*(-parseInt(_0x26de0b(0x18f))/0xc);if(_0x2a4515===_0x48fe0d)break;else _0x30e840['push'](_0x30e840['shift']());}catch(_0xb58d1){_0x30e840['push'](_0x30e840['shift']());}}}(a41_0x5882,0x8dd04));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x1914cb from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a41_0x5c3b(_0x59bff2,_0x3fc57b){_0x59bff2=_0x59bff2-0x16a;const _0x58827a=a41_0x5882();let _0x5c3bae=_0x58827a[_0x59bff2];return _0x5c3bae;}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']='segment:push';[a41_0x31cbb5(0x1e1)]=a41_0x31cbb5(0x1f7);async[a41_0x31cbb5(0x1c0)](_0x59ffbe){const _0x22af02=a41_0x31cbb5,{options:_0x29443a,args:_0x21a2a8,tdx:_0x3377f2}=_0x59ffbe,_0x8d8ffc=_0x29443a,_0x85b7ee=await resolveTarget({'arg':_0x21a2a8[0x0],'contextParent':_0x29443a[_0x22af02(0x192)],'cwd':process[_0x22af02(0x16e)]()});if(!isSuccessfulResolution(_0x85b7ee))return _0x85b7ee[_0x22af02(0x18e)]===_0x22af02(0x19e)?(console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x1e5)](_0x22af02(0x1d2))),console[_0x22af02(0x185)](_0x22af02(0x1d9)),console[_0x22af02(0x185)]('\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'](_0x22af02(0x19a))):(console[_0x22af02(0x185)](a41_0x1914cb['red'](_0x22af02(0x1a9)+_0x85b7ee[_0x22af02(0x16c)]+'\x0a')),_0x85b7ee[_0x22af02(0x1d3)]&&console['error'](a41_0x1914cb[_0x22af02(0x1dd)](_0x85b7ee['helpText']))),0x1;if(_0x85b7ee['type']===_0x22af02(0x196))return console[_0x22af02(0x185)](a41_0x1914cb['red'](_0x22af02(0x1a2)+_0x85b7ee['targetDir']+'\x0a')),console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x1dd)](_0x22af02(0x197))),0x1;const _0x3200c3=_0x85b7ee[_0x22af02(0x1db)],_0x149c12=_0x85b7ee[_0x22af02(0x178)],_0xd7aa41=_0x85b7ee['type']===_0x22af02(0x19c)?_0x85b7ee[_0x22af02(0x1df)]:undefined,_0x3eeb79=getScopedDetails(_0x85b7ee),_0x3f563e=_0x3eeb79?.[_0x22af02(0x18b)]??![],_0xfc0967=_0x3eeb79?.['scopedFolderPath']??'';if(!existsSync(_0x149c12))return console[_0x22af02(0x185)](a41_0x1914cb['red'](_0x22af02(0x1a2)+_0x149c12+'\x0a')),console[_0x22af02(0x185)](a41_0x1914cb['cyan'](_0x22af02(0x197))),0x1;_0x8d8ffc['verbose']&&(console[_0x22af02(0x185)](_0x22af02(0x1a0)+_0x8d8ffc['site']),console[_0x22af02(0x185)](_0x22af02(0x1e6)+_0x3200c3),console[_0x22af02(0x185)](_0x22af02(0x19b)+_0x149c12),_0x3f563e&&console[_0x22af02(0x185)](_0x22af02(0x1b7)+_0xfc0967));const _0x3ceccb=await withSpinner(_0x22af02(0x1e9)+_0x3200c3+'\x27...',()=>_0x3377f2[_0x22af02(0x1bc)]['resolveParentId'](_0x3200c3),{'verbose':_0x8d8ffc['verbose']}),_0x3da51b=_0x3ceccb[_0x22af02(0x16a)],{parentSegmentResult:_0x351aea,segmentsResult:_0x1baca0,foldersResult:_0x45623e,journeysWithDetailsResult:_0x4cd9ec,userMaps:_0x5eb701}=await withSpinner(_0x22af02(0x199),async()=>{const _0x3b0ecc=_0x22af02,[_0x566647,_0xf613b1,_0x2fe104,_0x1b7f7a,_0x5620a5]=await Promise[_0x3b0ecc(0x1ff)]([_0x3377f2[_0x3b0ecc(0x1bc)]['getParent'](_0x3da51b),_0x3377f2[_0x3b0ecc(0x1bc)][_0x3b0ecc(0x1d6)](_0x3da51b),_0x3377f2[_0x3b0ecc(0x1bc)][_0x3b0ecc(0x1e3)](_0x3da51b),_0x3377f2[_0x3b0ecc(0x1ba)]['listJourneysWithDetailsFromParentSegment'](_0x3da51b,{'includeAllVersions':!![]}),_0x3377f2[_0x3b0ecc(0x1f9)]['buildUserMaps']()]);return{'parentSegmentResult':_0x566647,'segmentsResult':_0xf613b1,'foldersResult':_0x2fe104,'journeysWithDetailsResult':_0x1b7f7a,'userMaps':_0x5620a5};},{'verbose':_0x8d8ffc[_0x22af02(0x173)]})[_0x22af02(0x1eb)](_0x22784a=>_0x22784a[_0x22af02(0x16a)]),_0x5c7ddf=_0x351aea,_0x1976f0=extractRootFolderId(_0x5c7ddf),_0x691ef9=_0x1baca0,_0x33964f=_0x45623e,{journeys:_0xf27ae9,activationStepsById:_0x13d951}=_0x4cd9ec,_0x22eee0=new Map(_0xf27ae9['map'](_0x4d4816=>[_0x4d4816['id'],_0x4d4816])),_0x5a4936=_0xf27ae9[_0x22af02(0x1b0)](_0x4108c4=>({'id':_0x4108c4['id'],'name':_0x4108c4[_0x22af02(0x1e8)][_0x22af02(0x186)],'journeyBundleName':_0x4108c4[_0x22af02(0x1e8)][_0x22af02(0x17f)]||'','journeyBundleId':_0x4108c4[_0x22af02(0x1e8)]['journeyBundleId']||'','versionNumber':_0x4108c4[_0x22af02(0x1e8)][_0x22af02(0x1b3)],'description':_0x4108c4[_0x22af02(0x1e8)][_0x22af02(0x1e1)],'state':_0x4108c4[_0x22af02(0x1e8)]['state'],'paused':_0x4108c4[_0x22af02(0x1e8)]['paused'],'audienceId':_0x4108c4[_0x22af02(0x1e8)][_0x22af02(0x16f)],'folderId':_0x4108c4[_0x22af02(0x1b4)]?.['parentFolder']?.[_0x22af02(0x16a)]?.['id'],'createdAt':_0x4108c4[_0x22af02(0x1e8)][_0x22af02(0x191)],'updatedAt':_0x4108c4[_0x22af02(0x1e8)][_0x22af02(0x1b8)]})),{emailToId:_0x33580c,idToEmail:_0x2f4d2a}=_0x5eb701,_0x38aa6e=await withSpinner(_0x22af02(0x1ea),async()=>{const _0x2c79ad=_0x22af02,_0x2736df=await _0x3377f2[_0x2c79ad(0x1ed)]['list']();return buildConnectionMaps(_0x2736df);},{'verbose':_0x8d8ffc[_0x22af02(0x173)]})[_0x22af02(0x1eb)](_0x253caa=>_0x253caa[_0x22af02(0x16a)]),_0x3769a3=_0x38aa6e['nameToId'],_0x147447=_0x38aa6e[_0x22af02(0x1c3)],_0x548683=_0x38aa6e[_0x22af02(0x1ad)],_0x368d32={'emailToIdMap':_0x33580c,'connectionNameToIdMap':_0x3769a3,'connectionNameToTypeMap':_0x548683,'getSchema':_0x13d5d5=>_0x3377f2[_0x22af02(0x1ed)][_0x22af02(0x195)](_0x13d5d5)};let {pathToId:_0x4ab738,idToPath:_0x4787a3}=buildFolderMaps(_0x33964f);const _0x5e70f8=buildSegmentLookupMap(_0x691ef9,_0x4787a3),_0x1dd5e3=buildSegmentNameToIdMap(_0x691ef9),_0x576558=buildJourneyBundleLookupMap(_0x5a4936,_0x4787a3);let _0x49e69c;if(_0xd7aa41){if(!_0xd7aa41['endsWith'](_0x22af02(0x174))&&!_0xd7aa41[_0x22af02(0x1b5)](_0x22af02(0x18a)))return console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x17c)](_0x22af02(0x18d)+_0xd7aa41+'\x0a')),0x1;_0x49e69c=[_0xd7aa41];}else _0x49e69c=findYamlFiles(_0x149c12);if(_0x49e69c[_0x22af02(0x19f)]===0x0)return console['error'](a41_0x1914cb[_0x22af02(0x17c)](_0x22af02(0x201)+_0x149c12+'\x0a')),console[_0x22af02(0x185)](a41_0x1914cb['cyan'](_0x22af02(0x1fa))),0x1;let _0x9089e7,_0x142520;try{const _0x1230af=parseAndClassifyYamlFiles(_0x49e69c,_0x149c12,{'skipSegments':_0x8d8ffc[_0x22af02(0x204)]});_0x9089e7=_0x1230af[_0x22af02(0x200)],_0x142520=_0x1230af['journeys'];const _0xec1cef=validateParsedFiles(_0x1230af,_0x149c12);if(_0xec1cef[_0x22af02(0x19f)]>0x0)return console[_0x22af02(0x185)](a41_0x1914cb['red'](_0x22af02(0x182))),console['error'](formatValidationErrors(_0xec1cef)),console[_0x22af02(0x185)](a41_0x1914cb['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x395f4f){return console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x17c)](_0x22af02(0x188)+(_0x395f4f instanceof Error?_0x395f4f[_0x22af02(0x16c)]:_0x395f4f))),0x1;}if(_0x9089e7['length']===0x0&&_0x142520['length']===0x0){const _0x5620df=_0x8d8ffc['journeysOnly']?_0x22af02(0x1ba):'segment\x20or\x20journey';return console['error'](a41_0x1914cb[_0x22af02(0x1e5)](_0x22af02(0x198)+_0x5620df+_0x22af02(0x16b))),0x0;}const _0x199ae1=new Map();_0x691ef9['length']>0x0&&!_0x8d8ffc[_0x22af02(0x204)]&&await withSpinner(_0x22af02(0x193),async()=>{await batchAsync(_0x691ef9,async _0x17a10c=>{const _0x552ee1=a41_0x5c3b,_0x1d73e9=await _0x3377f2[_0x552ee1(0x1bc)][_0x552ee1(0x1dc)](_0x3da51b,_0x17a10c['id']);_0x199ae1['set'](_0x17a10c['id'],_0x1d73e9);});},{'verbose':_0x8d8ffc[_0x22af02(0x173)]});const {segmentFiles:_0x282d3d,foldersToCreate:_0x23a2e9}=await prepareSegmentFiles(_0x9089e7,{'segmentByFolderAndName':_0x5e70f8,'activationsBySegmentId':_0x199ae1,'folderPathToId':_0x4ab738,'idToEmailMap':_0x2f4d2a,'connectionIdToNameMap':_0x147447},_0x368d32,_0x3f563e,_0xfc0967),_0x279553=_0xd7aa41?[]:findSegmentsToDelete(_0x691ef9,_0x9089e7[_0x22af02(0x1b0)](({yamlConfig:_0x405044,folderPath:_0x5a3789})=>({'yamlConfig':_0x405044,'folderPath':resolveTDFolderPath(_0x5a3789,_0x3f563e,_0xfc0967)})),_0x4787a3,_0xfc0967,_0x3f563e),{journeyFiles:_0x4fa3a5,foldersToCreate:_0x593d8a}=await withProgressSpinner(_0x22af02(0x1bd),async _0x34f413=>prepareJourneyFiles(_0x142520,{'fetchJourney':async _0x3108d6=>_0x3377f2[_0x22af02(0x1ba)]['getJourney'](_0x3108d6[_0x22af02(0x203)]),'journeyBundlesByFolderAndName':_0x576558,'folderPathToId':_0x4ab738,'idToEmailMap':_0x2f4d2a,'connectionIdToNameMap':_0x147447,'existingSegments':_0x691ef9,'parentId':_0x3da51b,'deps':_0x3377f2,'progress':{'update':_0x1387d6=>{const _0x20cd85=_0x22af02;_0x34f413[_0x20cd85(0x1e0)](_0x1387d6),_0x8d8ffc[_0x20cd85(0x173)]&&console[_0x20cd85(0x185)]('\x20\x20'+_0x1387d6);}},'journeyById':_0x22eee0,'activationStepsById':_0x13d951},_0x3f563e,_0xfc0967),{'verbose':_0x8d8ffc[_0x22af02(0x173)]})[_0x22af02(0x1eb)](_0xef77c=>_0xef77c[_0x22af02(0x16a)]);for(const _0x3262eb of _0x593d8a){_0x23a2e9[_0x22af02(0x1e7)](_0x3262eb);}const _0x19be57=_0xd7aa41?[]:findJourneysToDelete(_0x5a4936,_0x142520[_0x22af02(0x1b0)](({yamlConfig:_0xe253fe,folderPath:_0x58f5cb})=>({'yamlConfig':_0xe253fe,'folderPath':resolveTDFolderPath(_0x58f5cb,_0x3f563e,_0xfc0967)})),_0x4787a3,_0xfc0967,_0x3f563e),_0x5f2722=calculatePushStats(_0x282d3d,_0x4fa3a5,_0x23a2e9,_0x279553,_0x19be57,!!_0x8d8ffc[_0x22af02(0x181)],!!_0x8d8ffc['journeysOnly']),_0xb5d475=_0x5f2722['segments'][_0x22af02(0x184)],_0x222c65=_0x5f2722['segments'][_0x22af02(0x1a4)],_0x2454eb=_0x5f2722[_0x22af02(0x200)]['unchanged'],_0x3ede41=_0x5f2722[_0x22af02(0x200)]['toDelete'],_0x41cf3c=_0x5f2722[_0x22af02(0x1f0)][_0x22af02(0x1cd)],_0x5c77b6=_0x5f2722[_0x22af02(0x1da)]['new'],_0x27d523=_0x5f2722[_0x22af02(0x1da)][_0x22af02(0x1a4)],_0x22ce9d=_0x5f2722[_0x22af02(0x1da)][_0x22af02(0x1ae)],_0x3f3614=_0x5f2722[_0x22af02(0x1da)][_0x22af02(0x17e)],_0x59c99f=_0x5f2722['activations'][_0x22af02(0x1ff)],_0x141295=_0x5f2722[_0x22af02(0x1ac)][_0x22af02(0x1cd)],_0x146d78=_0x5f2722[_0x22af02(0x1ac)][_0x22af02(0x1d1)],_0x3417cb=_0x5f2722[_0x22af02(0x1ac)][_0x22af02(0x17e)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x3200c3+'\x27:');_0x41cf3c['length']>0x0&&console[_0x22af02(0x185)]('\x20\x20'+a41_0x1914cb['blue'](_0x22af02(0x180)+_0x41cf3c[_0x22af02(0x19f)]+_0x22af02(0x16d)));if(!_0x8d8ffc['journeysOnly']){console['error'](_0x22af02(0x190)),console[_0x22af02(0x185)](_0x22af02(0x1ca)+a41_0x1914cb[_0x22af02(0x1af)]('+\x20'+_0xb5d475[_0x22af02(0x19f)]+_0x22af02(0x1bf))),console['error']('\x20\x20\x20\x20'+a41_0x1914cb[_0x22af02(0x1e5)]('~\x20'+_0x222c65[_0x22af02(0x19f)]+_0x22af02(0x189)));if(_0x3ede41[_0x22af02(0x19f)]>0x0)console[_0x22af02(0x185)]('\x20\x20\x20\x20'+a41_0x1914cb[_0x22af02(0x17c)]('-\x20'+_0x3ede41[_0x22af02(0x19f)]+_0x22af02(0x1fe)));else _0x279553[_0x22af02(0x19f)]>0x0&&!_0x8d8ffc[_0x22af02(0x181)]&&console[_0x22af02(0x185)](_0x22af02(0x1ca)+a41_0x1914cb[_0x22af02(0x177)](_0x279553[_0x22af02(0x19f)]+_0x22af02(0x1a7)));console['error'](_0x22af02(0x1ca)+a41_0x1914cb[_0x22af02(0x177)]('=\x20'+_0x2454eb['length']+_0x22af02(0x1a8)));}if(_0x4fa3a5[_0x22af02(0x19f)]>0x0||_0x19be57[_0x22af02(0x19f)]>0x0){console[_0x22af02(0x185)](_0x22af02(0x1e2)),console[_0x22af02(0x185)](_0x22af02(0x1ca)+a41_0x1914cb[_0x22af02(0x1af)]('+\x20'+_0x5c77b6[_0x22af02(0x19f)]+_0x22af02(0x1bf))),console[_0x22af02(0x185)](_0x22af02(0x1ca)+a41_0x1914cb['yellow']('~\x20'+_0x27d523[_0x22af02(0x19f)]+_0x22af02(0x189)));if(_0x3f3614[_0x22af02(0x19f)]>0x0)console[_0x22af02(0x185)]('\x20\x20\x20\x20'+a41_0x1914cb[_0x22af02(0x17c)]('-\x20'+_0x3f3614[_0x22af02(0x19f)]+_0x22af02(0x1fe)));else _0x19be57[_0x22af02(0x19f)]>0x0&&!_0x8d8ffc[_0x22af02(0x181)]&&console[_0x22af02(0x185)]('\x20\x20\x20\x20'+a41_0x1914cb[_0x22af02(0x177)](_0x19be57[_0x22af02(0x19f)]+_0x22af02(0x1a7)));console[_0x22af02(0x185)]('\x20\x20\x20\x20'+a41_0x1914cb[_0x22af02(0x177)]('=\x20'+_0x22ce9d['length']+_0x22af02(0x1a8)));}_0x59c99f[_0x22af02(0x19f)]>0x0&&!_0x8d8ffc['journeysOnly']&&(console[_0x22af02(0x185)](''),console[_0x22af02(0x185)]('\x20\x20Activations:'),_0x141295[_0x22af02(0x19f)]>0x0&&console[_0x22af02(0x185)](_0x22af02(0x1ca)+a41_0x1914cb[_0x22af02(0x1af)]('+\x20'+_0x141295[_0x22af02(0x19f)]+_0x22af02(0x1f8))),_0x146d78[_0x22af02(0x19f)]>0x0&&console[_0x22af02(0x185)](_0x22af02(0x1ca)+a41_0x1914cb[_0x22af02(0x1e5)]('~\x20'+_0x146d78[_0x22af02(0x19f)]+'\x20to\x20update')),_0x3417cb[_0x22af02(0x19f)]>0x0&&console[_0x22af02(0x185)](_0x22af02(0x1ca)+a41_0x1914cb['red']('-\x20'+_0x3417cb[_0x22af02(0x19f)]+_0x22af02(0x1fe))));console[_0x22af02(0x185)](_0x22af02(0x194)+a41_0x1914cb[_0x22af02(0x1dd)](_0x149c12)+'\x0a');if(_0x41cf3c[_0x22af02(0x19f)]>0x0){console[_0x22af02(0x185)]('Folders\x20to\x20create:');for(const _0x1c1992 of _0x41cf3c){console['error']('\x20\x20'+a41_0x1914cb[_0x22af02(0x1a3)]('+')+'\x20'+_0x1c1992);}console[_0x22af02(0x185)]('');}if(_0xb5d475[_0x22af02(0x19f)]>0x0&&!_0x8d8ffc[_0x22af02(0x204)])for(const _0x129c2f of _0xb5d475){const _0x35cc22=_0x129c2f[_0x22af02(0x1c4)]?_0x129c2f['folderPath']+'/'+_0x129c2f[_0x22af02(0x1d8)][_0x22af02(0x186)]:_0x129c2f[_0x22af02(0x1d8)][_0x22af02(0x186)],_0x27e063=_0x129c2f[_0x22af02(0x1d8)][_0x22af02(0x1ac)]?.[_0x22af02(0x19f)]||0x0,_0x28d4b9=_0x27e063>0x0?a41_0x1914cb[_0x22af02(0x177)]('\x20['+_0x27e063+_0x22af02(0x17d)):'';console['error']('\x0a'+a41_0x1914cb[_0x22af02(0x1af)](_0x22af02(0x1c1))+'\x20'+_0x35cc22+_0x28d4b9),console[_0x22af02(0x185)]('─'[_0x22af02(0x1ec)](0x3c)),_0x129c2f[_0x22af02(0x19d)]&&console[_0x22af02(0x185)](_0x129c2f[_0x22af02(0x19d)]),console[_0x22af02(0x185)]('─'[_0x22af02(0x1ec)](0x3c));}if(_0x3ede41[_0x22af02(0x19f)]>0x0&&!_0x8d8ffc[_0x22af02(0x204)])for(const _0x3618b6 of _0x3ede41){const _0x43c64f=_0x3618b6[_0x22af02(0x1b1)]?_0x4787a3[_0x22af02(0x1fc)](_0x3618b6[_0x22af02(0x1b1)]['toString']())||'':'',_0x1cb9c8=_0x43c64f?_0x43c64f+'/'+_0x3618b6[_0x22af02(0x186)]:_0x3618b6[_0x22af02(0x186)],_0x152ec9=_0x199ae1[_0x22af02(0x1fc)](_0x3618b6['id'])||[],_0x167f22=_0x152ec9['length']>0x0?a41_0x1914cb[_0x22af02(0x177)]('\x20['+_0x152ec9['length']+_0x22af02(0x17d)):'';console[_0x22af02(0x185)]('\x0a'+a41_0x1914cb[_0x22af02(0x17c)](_0x22af02(0x1a1))+'\x20'+_0x1cb9c8+_0x167f22),console[_0x22af02(0x185)]('─'[_0x22af02(0x1ec)](0x3c));const _0x2ab8c5=segmentWithActivationsToYaml(_0x3618b6,_0x152ec9,undefined,_0x2f4d2a,_0x147447),_0x240177=segmentToYamlString(_0x2ab8c5),_0x30e5fb=generateDiff(_0x240177,'');console['error'](formatDiffWithColors(_0x30e5fb)),console['error']('─'[_0x22af02(0x1ec)](0x3c));}const _0x519c62=_0x282d3d['filter'](_0x4aa49e=>!_0x4aa49e[_0x22af02(0x1cf)]&&_0x4aa49e['diff']);if(_0x519c62[_0x22af02(0x19f)]>0x0&&!_0x8d8ffc[_0x22af02(0x204)])for(const _0x450a06 of _0x519c62){const _0x6401e3=_0x450a06[_0x22af02(0x1c4)]?_0x450a06['folderPath']+'/'+_0x450a06[_0x22af02(0x1d8)][_0x22af02(0x186)]:_0x450a06[_0x22af02(0x1d8)][_0x22af02(0x186)];console[_0x22af02(0x185)]('\x0a'+a41_0x1914cb[_0x22af02(0x1e5)](_0x22af02(0x1f2))+'\x20'+_0x6401e3),console[_0x22af02(0x185)]('─'[_0x22af02(0x1ec)](0x3c)),console['error'](_0x450a06['diff']),console[_0x22af02(0x185)]('─'['repeat'](0x3c));}if(_0x5c77b6['length']>0x0)for(const _0xae905c of _0x5c77b6){const _0x190e0d=_0xae905c['folderPath']?_0xae905c['folderPath']+'/'+_0xae905c['yamlConfig'][_0x22af02(0x186)]:_0xae905c[_0x22af02(0x1d8)]['name'];console[_0x22af02(0x185)]('\x0a'+a41_0x1914cb[_0x22af02(0x1af)](_0x22af02(0x183))+'\x20'+_0x190e0d),console[_0x22af02(0x185)]('─'[_0x22af02(0x1ec)](0x3c)),_0xae905c['diff']&&console[_0x22af02(0x185)](_0xae905c['diff']),console['error']('─'['repeat'](0x3c));}const _0x17c32a=_0x4fa3a5[_0x22af02(0x17a)](_0x4c5615=>!_0x4c5615[_0x22af02(0x1cf)]&&_0x4c5615[_0x22af02(0x19d)]);if(_0x17c32a[_0x22af02(0x19f)]>0x0)for(const _0x1ee97a of _0x17c32a){const _0x38fab3=_0x1ee97a[_0x22af02(0x1c4)]?_0x1ee97a[_0x22af02(0x1c4)]+'/'+_0x1ee97a[_0x22af02(0x1d8)][_0x22af02(0x186)]:_0x1ee97a['yamlConfig']['name'];console['error']('\x0a'+a41_0x1914cb[_0x22af02(0x1e5)](_0x22af02(0x202))+'\x20'+_0x38fab3),console['error']('─'[_0x22af02(0x1ec)](0x3c)),console['error'](_0x1ee97a[_0x22af02(0x19d)]),console[_0x22af02(0x185)]('─'[_0x22af02(0x1ec)](0x3c));}if(_0x3f3614[_0x22af02(0x19f)]>0x0)for(const _0x568f93 of _0x3f3614){const _0x2623a7=_0x568f93[_0x22af02(0x1b6)]?_0x4787a3[_0x22af02(0x1fc)](_0x568f93[_0x22af02(0x1b6)])||'':'',_0xb6f488=_0x2623a7?_0x2623a7+'/'+_0x568f93[_0x22af02(0x17f)]:_0x568f93[_0x22af02(0x17f)];console[_0x22af02(0x185)]('\x0a'+a41_0x1914cb[_0x22af02(0x17c)](_0x22af02(0x170))+'\x20'+_0xb6f488),console['error']('─'['repeat'](0x3c)),console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x17c)]('(Journey\x20will\x20be\x20deleted)')),console[_0x22af02(0x185)]('─'[_0x22af02(0x1ec)](0x3c));}if(_0x8d8ffc['dryRun'])return console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x1e5)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x333b2c=_0x8d8ffc[_0x22af02(0x204)]?![]:_0xb5d475['length']>0x0||_0x222c65['length']>0x0||_0x3ede41[_0x22af02(0x19f)]>0x0,_0x1b45e1=_0x5c77b6[_0x22af02(0x19f)]>0x0||_0x27d523[_0x22af02(0x19f)]>0x0||_0x3f3614['length']>0x0,_0x4a0dc2=_0x8d8ffc[_0x22af02(0x204)]?![]:_0x59c99f[_0x22af02(0x19f)]>0x0,_0x2772c3=_0x41cf3c[_0x22af02(0x19f)]>0x0;if(!_0x333b2c&&!_0x1b45e1&&!_0x4a0dc2&&!_0x2772c3){const _0x5ce5a8=_0x8d8ffc[_0x22af02(0x204)]?_0x22af02(0x1c9):_0x22af02(0x1d0);console['error'](a41_0x1914cb[_0x22af02(0x1af)](_0x5ce5a8));if(_0xd7aa41&&_0x2454eb[_0x22af02(0x19f)]===0x1){const _0x58eff5=_0x2454eb[0x0];if(_0x58eff5[_0x22af02(0x1d7)]?.['id']){const _0x59a5c5=getConsoleNextUrl(_0x8d8ffc[_0x22af02(0x1de)],_0x22af02(0x1f3)+_0x3da51b+_0x22af02(0x1cc)+_0x58eff5[_0x22af02(0x1d7)]['id']+_0x22af02(0x1f4));console[_0x22af02(0x185)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x1914cb[_0x22af02(0x1dd)](_0x59a5c5));}}if(_0xd7aa41&&_0x22ce9d[_0x22af02(0x19f)]===0x1){const _0x398b58=_0x22ce9d[0x0];if(_0x398b58[_0x22af02(0x1a5)]?.['id']){const _0x1c3784=getConsoleNextUrl(_0x8d8ffc[_0x22af02(0x1de)],_0x22af02(0x1f3)+_0x3da51b+_0x22af02(0x1cc)+_0x398b58[_0x22af02(0x1a5)]['id']+_0x22af02(0x1e4));console[_0x22af02(0x185)]('\x20\x20'+a41_0x1914cb[_0x22af02(0x1dd)](_0x1c3784));}}return 0x0;}const _0x8fc874=_0x8d8ffc['journeysOnly']?_0x5c77b6[_0x22af02(0x19f)]+_0x27d523[_0x22af02(0x19f)]+_0x3f3614[_0x22af02(0x19f)]+_0x41cf3c[_0x22af02(0x19f)]:_0xb5d475['length']+_0x222c65[_0x22af02(0x19f)]+_0x3ede41[_0x22af02(0x19f)]+_0x5c77b6[_0x22af02(0x19f)]+_0x27d523[_0x22af02(0x19f)]+_0x3f3614[_0x22af02(0x19f)]+_0x41cf3c[_0x22af02(0x19f)]+_0x59c99f[_0x22af02(0x19f)];if(!_0x8d8ffc[_0x22af02(0x1aa)]&&_0x8fc874>0x0){if(!isInteractive())return console[_0x22af02(0x185)](a41_0x1914cb['red']('\x0aError:'),_0x22af02(0x1f6)),console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x177)](_0x22af02(0x187))),0x1;const _0x5f39b7=await confirmKey(_0x22af02(0x175)+_0x8fc874+'\x20changes?');if(!_0x5f39b7)return console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x1e5)](_0x22af02(0x176))),0x1;}const _0x46bb4a={'withProgress':async(_0x3a4651,_0x2ecd39)=>{const _0x4eb154=_0x22af02,_0x3e8693=await withSpinner(_0x3a4651,_0x2ecd39,{'verbose':_0x8d8ffc[_0x4eb154(0x173)]});return{'data':_0x3e8693[_0x4eb154(0x16a)]};},'logInfo':_0x1f9f79=>console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x1a3)]('✔\x20'+_0x1f9f79)),'logSuccess':_0x554e03=>console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x1af)]('✔\x20'+_0x554e03)),'logWarning':_0x3f51dd=>console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x1e5)]('⚠\x20'+_0x3f51dd)),'logDeleted':_0x5c6913=>console['error'](a41_0x1914cb['red']('✔\x20'+_0x5c6913))},_0x5bb0b3={'segment':_0x3377f2[_0x22af02(0x1bc)],'journey':_0x3377f2[_0x22af02(0x1ba)],'user':_0x3377f2[_0x22af02(0x1f9)],'connection':_0x3377f2['connection']};_0x41cf3c[_0x22af02(0x19f)]>0x0&&(_0x4ab738=await executePushFolders(_0x5bb0b3,_0x41cf3c,_0x4ab738,{'parentId':_0x3da51b},_0x46bb4a));const _0x3ca4a6={'rootFolderId':_0x1976f0,'folderPathToId':_0x4ab738,'folderIdToPath':_0x4787a3,'segmentNameToId':_0x1dd5e3,'activationsBySegmentId':_0x199ae1,'emailToIdMap':_0x33580c,'idToEmailMap':_0x2f4d2a,'connectionNameToIdMap':_0x38aa6e['nameToId'],'connectionIdToNameMap':_0x38aa6e['idToName'],'connectionNameToTypeMap':_0x548683},_0x51f65d=await executePushSegments(_0x5bb0b3,_0x8d8ffc[_0x22af02(0x204)]?[]:_0x282d3d,_0x3ca4a6,{'parentId':_0x3da51b},_0x46bb4a),_0x553ed9=_0x51f65d[_0x22af02(0x171)],_0x578aa7=_0x51f65d['updated'],_0x1782d3=_0x51f65d[_0x22af02(0x1ac)][_0x22af02(0x171)],_0x1864e0=_0x51f65d[_0x22af02(0x1ac)][_0x22af02(0x1b9)],_0x3b31a1=_0x51f65d[_0x22af02(0x1ac)][_0x22af02(0x17b)];let _0x57cf3f;if(_0xd7aa41&&_0x282d3d[_0x22af02(0x19f)]===0x1){const _0x4a5503=_0x282d3d[0x0];_0x57cf3f=_0x4a5503[_0x22af02(0x1d7)]?.['id']??_0x51f65d[_0x22af02(0x1be)][_0x22af02(0x1fc)](_0x4a5503['yamlConfig'][_0x22af02(0x186)]);}const _0x2e3632=await executePushSegmentDeletions(_0x5bb0b3,_0x8d8ffc[_0x22af02(0x204)]?[]:_0x3ede41,_0x46bb4a);let _0x12f40d=0x0,_0x253b2c=0x0,_0x55705a=0x0;const _0x1f0195=new Map(_0x1dd5e3);for(const [_0xd73fc8,_0x19ff59]of _0x51f65d[_0x22af02(0x1be)]){_0x1f0195[_0x22af02(0x18c)](_0xd73fc8,_0x19ff59);}if(_0x4fa3a5[_0x22af02(0x19f)]>0x0){const _0x592073={..._0x3ca4a6,'segmentNameToId':_0x1f0195,'existingSegments':_0x691ef9,'activationContext':_0x368d32},_0x9b0584=await executePushJourneys(_0x5bb0b3,_0x4fa3a5,_0x592073,{'parentId':_0x3da51b,'rootFolderId':_0x1976f0,'verbose':_0x8d8ffc['verbose']},_0x46bb4a);_0x12f40d=_0x9b0584[_0x22af02(0x171)],_0x253b2c=_0x9b0584[_0x22af02(0x1b9)];if(_0xd7aa41&&_0x9b0584[_0x22af02(0x1fd)][_0x22af02(0x19f)]===0x1){const _0xbdabb=_0x9b0584[_0x22af02(0x1fd)][0x0];if(_0xbdabb['journeyId']){const _0x3243c4=getConsoleNextUrl(_0x8d8ffc[_0x22af02(0x1de)],_0x22af02(0x1f3)+_0x3da51b+_0x22af02(0x1cc)+_0xbdabb['journeyId']+_0x22af02(0x1e4));console[_0x22af02(0x185)]('\x20\x20'+a41_0x1914cb[_0x22af02(0x1dd)](_0x3243c4));}}}for(const _0x79217 of _0x3f3614){console[_0x22af02(0x185)](a41_0x1914cb[_0x22af02(0x1e5)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x79217[_0x22af02(0x17f)])),_0x55705a++;}const _0x2ad2e4=[];if(_0x553ed9>0x0)_0x2ad2e4[_0x22af02(0x172)](_0x553ed9+_0x22af02(0x1ef));if(_0x578aa7>0x0)_0x2ad2e4['push'](_0x578aa7+_0x22af02(0x1f5));if(_0x2e3632>0x0)_0x2ad2e4[_0x22af02(0x172)](_0x2e3632+'\x20deleted');const _0x14cd0e=[];if(_0x12f40d>0x0)_0x14cd0e[_0x22af02(0x172)](_0x12f40d+_0x22af02(0x1ef));if(_0x253b2c>0x0)_0x14cd0e['push'](_0x253b2c+_0x22af02(0x1f5));if(_0x55705a>0x0)_0x14cd0e[_0x22af02(0x172)](_0x55705a+_0x22af02(0x179));const _0xc09a7=[];if(_0x1782d3>0x0)_0xc09a7[_0x22af02(0x172)](_0x1782d3+_0x22af02(0x1ef));if(_0x1864e0>0x0)_0xc09a7[_0x22af02(0x172)](_0x1864e0+_0x22af02(0x1f5));if(_0x3b31a1>0x0)_0xc09a7[_0x22af02(0x172)](_0x3b31a1+_0x22af02(0x179));console['error'](a41_0x1914cb[_0x22af02(0x1af)](_0x22af02(0x1b2)));_0x2ad2e4[_0x22af02(0x19f)]>0x0&&!_0x8d8ffc[_0x22af02(0x204)]&&console[_0x22af02(0x185)](_0x22af02(0x1d5)+_0x2ad2e4[_0x22af02(0x1c7)](',\x20'));_0x14cd0e[_0x22af02(0x19f)]>0x0&&console[_0x22af02(0x185)](_0x22af02(0x1c5)+_0x14cd0e[_0x22af02(0x1c7)](',\x20'));_0xc09a7[_0x22af02(0x19f)]>0x0&&!_0x8d8ffc[_0x22af02(0x204)]&&console['error'](_0x22af02(0x1c6)+_0xc09a7[_0x22af02(0x1c7)](',\x20'));if(_0x57cf3f){const _0x452732=getConsoleNextUrl(_0x8d8ffc['site'],_0x22af02(0x1f3)+_0x3da51b+_0x22af02(0x1cc)+_0x57cf3f+_0x22af02(0x1f4));console[_0x22af02(0x185)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x1914cb[_0x22af02(0x1dd)](_0x452732));}return 0x0;}}
1
+ const a41_0x14ca61=a41_0x5468;(function(_0x5d0c68,_0x5e788d){const _0x579c80=a41_0x5468,_0x52084b=_0x5d0c68();while(!![]){try{const _0x3aca70=parseInt(_0x579c80(0x119))/0x1+parseInt(_0x579c80(0xbc))/0x2*(-parseInt(_0x579c80(0x95))/0x3)+-parseInt(_0x579c80(0xc7))/0x4+-parseInt(_0x579c80(0xcb))/0x5*(-parseInt(_0x579c80(0xf2))/0x6)+parseInt(_0x579c80(0xe3))/0x7+parseInt(_0x579c80(0xe9))/0x8+parseInt(_0x579c80(0xf1))/0x9*(-parseInt(_0x579c80(0x82))/0xa);if(_0x3aca70===_0x5e788d)break;else _0x52084b['push'](_0x52084b['shift']());}catch(_0x457816){_0x52084b['push'](_0x52084b['shift']());}}}(a41_0x8ea5,0x8e7e4));import{BaseCommand}from'./command.js';function a41_0x5468(_0x290d2a,_0xfb1cfd){_0x290d2a=_0x290d2a-0x81;const _0x8ea5a9=a41_0x8ea5();let _0x54687c=_0x8ea5a9[_0x290d2a];return _0x54687c;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a41_0x8ea5(){const _0x3b774e=['380wcQFWe','\x20deleted','segment:push','existingSegment','data','results','existingJourney','filePath','buildUserMaps','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','error','idToName','\x20to\x20delete','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segments','map','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error\x20parsing\x20YAML:\x20','parentSegment','4842zIAMgr','execute','\x20\x20\x20\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Delete\x20journey:','isNew','toCreate','getJourney','push','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','updated','Parent\x20segment:\x20','user','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20to\x20create','segment','created','\x20unchanged','then','/j/da/je','list','attributes','errorCode','listFolders','delete','targetDir','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Source\x20directory:\x20','folderPath','Changes\x20to:','journeyBundleName','\x20\x20Activations:\x20','updatedAt','filter','parentFolder','Folders\x20to\x20create:','cwd','\x20new','/app/ps/','754AHHeJY','toDelete','Error:\x20Directory\x20not\x20found:\x20','journeysOnly','green','.yaml','Error:\x20','folders','Fetching\x20existing\x20activations...','red','activations','1809452UNnPWX','\x0aPush\x20summary\x20for\x20\x27','journey','Changes\x20to\x20journey:','1055vaxlmg','/sb/da/esr','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','parentName','(Journey\x20will\x20be\x20deleted)','getParent','versionNumber','cyan','listJourneysWithDetailsFromParentSegment','nameToId','description','name','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)','length','helpText','get','diff','No\x20','repeat','.yml','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','toUpdate','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','6397797iEiQDi','changed','\x20updated','\x0aError:','folderId','new','5756536QsjwFN','journeyBundleId','segmentFolderId','yes','\x20folders\x20to\x20create','Site:\x20','state','\x20\x20Segments:\x20','375183hbfasZ','25446BUVwik','yamlConfig','unchanged','join','Fetching\x20existing\x20data...','blue','verbose','journeys','audienceId','Preparing\x20journeys...','/e/','no_parent','relationships','Resolving\x20parent\x20segment\x20\x27','site','\x20created','set','endsWith','\x20\x20📊\x20Segments:','message','paused','\x20activations]','resolveParentId','connection','all','dim','\x20changed','\x0a✔\x20Push\x20complete','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','type','journeyId','add','toString','getOutputSchemaWithCache','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','isScoped','yellow','deleted','nameToType','700210WjdeWJ','Fetching\x20connections\x20for\x20name\x20resolution...','\x0aValidation\x20failed:'];a41_0x8ea5=function(){return _0x3b774e;};return a41_0x8ea5();}import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x403a54 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x14ca61(0xd6)]=a41_0x14ca61(0x84);[a41_0x14ca61(0xd5)]=a41_0x14ca61(0x9e);async[a41_0x14ca61(0x96)](_0x1cc975){const _0x338d19=a41_0x14ca61,{options:_0x58df5f,args:_0x2264b0,tdx:_0xcfaebb}=_0x1cc975,_0x3bf5f8=_0x58df5f,_0x2279c4=await resolveTarget({'arg':_0x2264b0[0x0],'contextParent':_0x58df5f[_0x338d19(0x94)],'cwd':process[_0x338d19(0xb9)]()});if(!isSuccessfulResolution(_0x2279c4))return _0x2279c4[_0x338d19(0xab)]===_0x338d19(0xfd)?(console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0x8f))),console[_0x338d19(0x8c)](_0x338d19(0xd7)),console[_0x338d19(0x8c)](_0x338d19(0xe0)),console[_0x338d19(0x8c)](_0x338d19(0x8b))):(console['error'](a41_0x403a54['red'](_0x338d19(0xc2)+_0x2279c4[_0x338d19(0x105)]+'\x0a')),_0x2279c4[_0x338d19(0xd9)]&&console['error'](a41_0x403a54['cyan'](_0x2279c4[_0x338d19(0xd9)]))),0x1;if(_0x2279c4[_0x338d19(0x10f)]==='parent_name')return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0xbe)+_0x2279c4[_0x338d19(0xae)]+'\x0a')),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xd2)](_0x338d19(0x92))),0x1;const _0x109c65=_0x2279c4[_0x338d19(0xce)],_0x56ceae=_0x2279c4[_0x338d19(0xae)],_0x3ba8ee=_0x2279c4[_0x338d19(0x10f)]==='file'?_0x2279c4[_0x338d19(0x89)]:undefined,_0xb1476a=getScopedDetails(_0x2279c4),_0x267418=_0xb1476a?.[_0x338d19(0x115)]??![],_0x48c578=_0xb1476a?.['scopedFolderPath']??'';if(!existsSync(_0x56ceae))return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0xbe)+_0x56ceae+'\x0a')),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xd2)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3bf5f8[_0x338d19(0xf8)]&&(console[_0x338d19(0x8c)](_0x338d19(0xee)+_0x3bf5f8[_0x338d19(0x100)]),console[_0x338d19(0x8c)](_0x338d19(0xa0)+_0x109c65),console['error'](_0x338d19(0xb0)+_0x56ceae),_0x267418&&console[_0x338d19(0x8c)]('Scoped\x20to\x20folder:\x20'+_0x48c578));const _0x46503d=await withSpinner(_0x338d19(0xff)+_0x109c65+'\x27...',()=>_0xcfaebb[_0x338d19(0xa4)][_0x338d19(0x108)](_0x109c65),{'verbose':_0x3bf5f8[_0x338d19(0xf8)]}),_0x60511c=_0x46503d[_0x338d19(0x86)],{parentSegmentResult:_0x795b52,segmentsResult:_0x4d04e0,foldersResult:_0x5d7c60,journeysWithDetailsResult:_0x2f23a0,userMaps:_0x198ee1}=await withSpinner(_0x338d19(0xf6),async()=>{const _0x293695=_0x338d19,[_0x5a5a62,_0x1e7988,_0x1c008e,_0xe1b2cd,_0x5af9f8]=await Promise[_0x293695(0x10a)]([_0xcfaebb[_0x293695(0xa4)][_0x293695(0xd0)](_0x60511c),_0xcfaebb[_0x293695(0xa4)]['listSegments'](_0x60511c),_0xcfaebb['segment'][_0x293695(0xac)](_0x60511c),_0xcfaebb[_0x293695(0xc9)][_0x293695(0xd3)](_0x60511c,{'includeAllVersions':!![]}),_0xcfaebb[_0x293695(0xa1)][_0x293695(0x8a)]()]);return{'parentSegmentResult':_0x5a5a62,'segmentsResult':_0x1e7988,'foldersResult':_0x1c008e,'journeysWithDetailsResult':_0xe1b2cd,'userMaps':_0x5af9f8};},{'verbose':_0x3bf5f8[_0x338d19(0xf8)]})['then'](_0x53efdd=>_0x53efdd[_0x338d19(0x86)]),_0xf31112=_0x795b52,_0x31e8d7=extractRootFolderId(_0xf31112),_0xf88703=_0x4d04e0,_0x36ac6a=_0x5d7c60,{journeys:_0x25f488,activationStepsById:_0x5d286d}=_0x2f23a0,_0x4b2199=new Map(_0x25f488[_0x338d19(0x91)](_0x1220b9=>[_0x1220b9['id'],_0x1220b9])),_0x2e8281=_0x25f488[_0x338d19(0x91)](_0x4f8c44=>({'id':_0x4f8c44['id'],'name':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xd6)],'journeyBundleName':_0x4f8c44['attributes']['journeyBundleName']||'','journeyBundleId':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xea)]||'','versionNumber':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xd1)],'description':_0x4f8c44[_0x338d19(0xaa)]['description'],'state':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xef)],'paused':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0x106)],'audienceId':_0x4f8c44['attributes'][_0x338d19(0xfa)],'folderId':_0x4f8c44[_0x338d19(0xfe)]?.[_0x338d19(0xb7)]?.[_0x338d19(0x86)]?.['id'],'createdAt':_0x4f8c44[_0x338d19(0xaa)]['createdAt'],'updatedAt':_0x4f8c44[_0x338d19(0xaa)][_0x338d19(0xb5)]})),{emailToId:_0x24965a,idToEmail:_0x4ecd49}=_0x198ee1,_0x22f074=await withSpinner(_0x338d19(0x11a),async()=>{const _0x5bca86=_0x338d19,_0x594c27=await _0xcfaebb[_0x5bca86(0x109)][_0x5bca86(0xa9)]();return buildConnectionMaps(_0x594c27);},{'verbose':_0x3bf5f8[_0x338d19(0xf8)]})[_0x338d19(0xa7)](_0x1b0c08=>_0x1b0c08[_0x338d19(0x86)]),_0xf8a484=_0x22f074[_0x338d19(0xd4)],_0x57f034=_0x22f074[_0x338d19(0x8d)],_0x2eb6be=_0x22f074[_0x338d19(0x118)],_0x33e173={'emailToIdMap':_0x24965a,'connectionNameToIdMap':_0xf8a484,'connectionNameToTypeMap':_0x2eb6be,'getSchema':_0x547750=>_0xcfaebb['connection'][_0x338d19(0x113)](_0x547750)};let {pathToId:_0x42a99e,idToPath:_0x35e68b}=buildFolderMaps(_0x36ac6a);const _0x15cbe2=buildSegmentLookupMap(_0xf88703,_0x35e68b),_0x46da74=buildSegmentNameToIdMap(_0xf88703),_0x417abe=buildJourneyBundleLookupMap(_0x2e8281,_0x35e68b);let _0x2644c6;if(_0x3ba8ee){if(!_0x3ba8ee[_0x338d19(0x103)](_0x338d19(0xde))&&!_0x3ba8ee['endsWith'](_0x338d19(0xc1)))return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3ba8ee+'\x0a')),0x1;_0x2644c6=[_0x3ba8ee];}else _0x2644c6=findYamlFiles(_0x56ceae);if(_0x2644c6['length']===0x0)return console['error'](a41_0x403a54['red'](_0x338d19(0xaf)+_0x56ceae+'\x0a')),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xd2)](_0x338d19(0x98))),0x1;let _0x37141a,_0x3c78e7;try{const _0x2d0a73=parseAndClassifyYamlFiles(_0x2644c6,_0x56ceae,{'skipSegments':_0x3bf5f8[_0x338d19(0xbf)]});_0x37141a=_0x2d0a73[_0x338d19(0x90)],_0x3c78e7=_0x2d0a73[_0x338d19(0xf9)];const _0x583013=validateParsedFiles(_0x2d0a73,_0x56ceae);if(_0x583013['length']>0x0)return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0x81))),console['error'](formatValidationErrors(_0x583013)),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xa2))),0x1;}catch(_0x454885){return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0x93)+(_0x454885 instanceof Error?_0x454885[_0x338d19(0x105)]:_0x454885))),0x1;}if(_0x37141a[_0x338d19(0xd8)]===0x0&&_0x3c78e7[_0x338d19(0xd8)]===0x0){const _0x1418e9=_0x3bf5f8['journeysOnly']?_0x338d19(0xc9):'segment\x20or\x20journey';return console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xdc)+_0x1418e9+'\x20YAML\x20files\x20found')),0x0;}const _0x37e5fd=new Map();_0xf88703['length']>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&await withSpinner(_0x338d19(0xc4),async()=>{await batchAsync(_0xf88703,async _0x5a8605=>{const _0x57168e=a41_0x5468,_0x8357f0=await _0xcfaebb[_0x57168e(0xa4)]['listActivations'](_0x60511c,_0x5a8605['id']);_0x37e5fd[_0x57168e(0x102)](_0x5a8605['id'],_0x8357f0);});},{'verbose':_0x3bf5f8['verbose']});const {segmentFiles:_0x57fd90,foldersToCreate:_0x44f61e}=await prepareSegmentFiles(_0x37141a,{'segmentByFolderAndName':_0x15cbe2,'activationsBySegmentId':_0x37e5fd,'folderPathToId':_0x42a99e,'idToEmailMap':_0x4ecd49,'connectionIdToNameMap':_0x57f034},_0x33e173,_0x267418,_0x48c578),_0x463058=_0x3ba8ee?[]:findSegmentsToDelete(_0xf88703,_0x37141a[_0x338d19(0x91)](({yamlConfig:_0x136dfd,folderPath:_0xd78b02})=>({'yamlConfig':_0x136dfd,'folderPath':resolveTDFolderPath(_0xd78b02,_0x267418,_0x48c578)})),_0x35e68b,_0x48c578,_0x267418),{journeyFiles:_0x47e664,foldersToCreate:_0x40da00}=await withProgressSpinner(_0x338d19(0xfb),async _0x6abad3=>prepareJourneyFiles(_0x3c78e7,{'fetchJourney':async _0x55454e=>_0xcfaebb['journey'][_0x338d19(0x9c)](_0x55454e[_0x338d19(0x110)]),'journeyBundlesByFolderAndName':_0x417abe,'folderPathToId':_0x42a99e,'idToEmailMap':_0x4ecd49,'connectionIdToNameMap':_0x57f034,'existingSegments':_0xf88703,'parentId':_0x60511c,'deps':_0xcfaebb,'progress':{'update':_0x1576d9=>{const _0xf6ce9d=_0x338d19;_0x6abad3['setPhase'](_0x1576d9),_0x3bf5f8['verbose']&&console[_0xf6ce9d(0x8c)]('\x20\x20'+_0x1576d9);}},'journeyById':_0x4b2199,'activationStepsById':_0x5d286d},_0x267418,_0x48c578),{'verbose':_0x3bf5f8[_0x338d19(0xf8)]})[_0x338d19(0xa7)](_0xa3b858=>_0xa3b858['data']);for(const _0x517f54 of _0x40da00){_0x44f61e[_0x338d19(0x111)](_0x517f54);}const _0x54e2a1=_0x3ba8ee?[]:findJourneysToDelete(_0x2e8281,_0x3c78e7[_0x338d19(0x91)](({yamlConfig:_0x16f5fd,folderPath:_0x388728})=>({'yamlConfig':_0x16f5fd,'folderPath':resolveTDFolderPath(_0x388728,_0x267418,_0x48c578)})),_0x35e68b,_0x48c578,_0x267418),_0x838f31=calculatePushStats(_0x57fd90,_0x47e664,_0x44f61e,_0x463058,_0x54e2a1,!!_0x3bf5f8[_0x338d19(0xad)],!!_0x3bf5f8[_0x338d19(0xbf)]),_0xa97ce8=_0x838f31[_0x338d19(0x90)]['new'],_0x71f2c3=_0x838f31['segments']['changed'],_0xaf855a=_0x838f31[_0x338d19(0x90)]['unchanged'],_0xa37a59=_0x838f31[_0x338d19(0x90)]['toDelete'],_0x323d9e=_0x838f31[_0x338d19(0xc3)]['toCreate'],_0x2deb78=_0x838f31[_0x338d19(0xf9)][_0x338d19(0xe8)],_0x24801d=_0x838f31[_0x338d19(0xf9)][_0x338d19(0xe4)],_0x4c1a3a=_0x838f31['journeys'][_0x338d19(0xf4)],_0x10fac7=_0x838f31[_0x338d19(0xf9)][_0x338d19(0xbd)],_0x372b24=_0x838f31[_0x338d19(0xc6)][_0x338d19(0x10a)],_0x4388f6=_0x838f31[_0x338d19(0xc6)][_0x338d19(0x9b)],_0x419292=_0x838f31['activations'][_0x338d19(0xe1)],_0x435056=_0x838f31[_0x338d19(0xc6)]['toDelete'];console[_0x338d19(0x8c)](_0x338d19(0xc8)+_0x109c65+'\x27:');_0x323d9e[_0x338d19(0xd8)]>0x0&&console[_0x338d19(0x8c)]('\x20\x20'+a41_0x403a54[_0x338d19(0xf7)]('📁\x20'+_0x323d9e[_0x338d19(0xd8)]+_0x338d19(0xed)));if(!_0x3bf5f8[_0x338d19(0xbf)]){console['error'](_0x338d19(0x104)),console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc0)]('+\x20'+_0xa97ce8[_0x338d19(0xd8)]+_0x338d19(0xba))),console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0x116)]('~\x20'+_0x71f2c3[_0x338d19(0xd8)]+_0x338d19(0x10c)));if(_0xa37a59[_0x338d19(0xd8)]>0x0)console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc5)]('-\x20'+_0xa37a59[_0x338d19(0xd8)]+_0x338d19(0x8e)));else _0x463058[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xad)]&&console['error'](_0x338d19(0x97)+a41_0x403a54['dim'](_0x463058[_0x338d19(0xd8)]+_0x338d19(0x10e)));console[_0x338d19(0x8c)]('\x20\x20\x20\x20'+a41_0x403a54[_0x338d19(0x10b)]('=\x20'+_0xaf855a[_0x338d19(0xd8)]+_0x338d19(0xa6)));}if(_0x47e664[_0x338d19(0xd8)]>0x0||_0x54e2a1[_0x338d19(0xd8)]>0x0){console[_0x338d19(0x8c)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc0)]('+\x20'+_0x2deb78['length']+'\x20new')),console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0x116)]('~\x20'+_0x24801d[_0x338d19(0xd8)]+_0x338d19(0x10c)));if(_0x10fac7[_0x338d19(0xd8)]>0x0)console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc5)]('-\x20'+_0x10fac7[_0x338d19(0xd8)]+_0x338d19(0x8e)));else _0x54e2a1[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8['delete']&&console[_0x338d19(0x8c)]('\x20\x20\x20\x20'+a41_0x403a54[_0x338d19(0x10b)](_0x54e2a1[_0x338d19(0xd8)]+_0x338d19(0x10e)));console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54['dim']('=\x20'+_0x4c1a3a['length']+'\x20unchanged'));}_0x372b24[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&(console[_0x338d19(0x8c)](''),console['error']('\x20\x20Activations:'),_0x4388f6['length']>0x0&&console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc0)]('+\x20'+_0x4388f6[_0x338d19(0xd8)]+_0x338d19(0xa3))),_0x419292['length']>0x0&&console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0x116)]('~\x20'+_0x419292[_0x338d19(0xd8)]+'\x20to\x20update')),_0x435056[_0x338d19(0xd8)]>0x0&&console[_0x338d19(0x8c)](_0x338d19(0x97)+a41_0x403a54[_0x338d19(0xc5)]('-\x20'+_0x435056['length']+_0x338d19(0x8e))));console[_0x338d19(0x8c)]('\x20\x20Source:\x20'+a41_0x403a54['cyan'](_0x56ceae)+'\x0a');if(_0x323d9e[_0x338d19(0xd8)]>0x0){console['error'](_0x338d19(0xb8));for(const _0x1acd13 of _0x323d9e){console['error']('\x20\x20'+a41_0x403a54['blue']('+')+'\x20'+_0x1acd13);}console[_0x338d19(0x8c)]('');}if(_0xa97ce8['length']>0x0&&!_0x3bf5f8[_0x338d19(0xbf)])for(const _0x5d734b of _0xa97ce8){const _0x14c36b=_0x5d734b[_0x338d19(0xb1)]?_0x5d734b[_0x338d19(0xb1)]+'/'+_0x5d734b[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x5d734b[_0x338d19(0xf3)][_0x338d19(0xd6)],_0x2bf307=_0x5d734b['yamlConfig']['activations']?.[_0x338d19(0xd8)]||0x0,_0x5177cf=_0x2bf307>0x0?a41_0x403a54[_0x338d19(0x10b)]('\x20['+_0x2bf307+_0x338d19(0x107)):'';console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0xc0)]('New\x20segment:')+'\x20'+_0x14c36b+_0x5177cf),console['error']('─'[_0x338d19(0xdd)](0x3c)),_0x5d734b[_0x338d19(0xdb)]&&console['error'](_0x5d734b['diff']),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));}if(_0xa37a59[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)])for(const _0x33b0db of _0xa37a59){const _0x33249e=_0x33b0db['segmentFolderId']?_0x35e68b['get'](_0x33b0db[_0x338d19(0xeb)][_0x338d19(0x112)]())||'':'',_0x16f38c=_0x33249e?_0x33249e+'/'+_0x33b0db[_0x338d19(0xd6)]:_0x33b0db[_0x338d19(0xd6)],_0x4c0651=_0x37e5fd[_0x338d19(0xda)](_0x33b0db['id'])||[],_0xaa7fcf=_0x4c0651['length']>0x0?a41_0x403a54[_0x338d19(0x10b)]('\x20['+_0x4c0651[_0x338d19(0xd8)]+_0x338d19(0x107)):'';console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0xc5)]('Delete\x20segment:')+'\x20'+_0x16f38c+_0xaa7fcf),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));const _0x27b568=segmentWithActivationsToYaml(_0x33b0db,_0x4c0651,undefined,_0x4ecd49,_0x57f034),_0x2f7b69=segmentToYamlString(_0x27b568),_0x3801bc=generateDiff(_0x2f7b69,'');console[_0x338d19(0x8c)](formatDiffWithColors(_0x3801bc)),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));}const _0x18d3f5=_0x57fd90[_0x338d19(0xb6)](_0x272a65=>!_0x272a65[_0x338d19(0x9a)]&&_0x272a65[_0x338d19(0xdb)]);if(_0x18d3f5[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)])for(const _0x5ca497 of _0x18d3f5){const _0x59a82e=_0x5ca497[_0x338d19(0xb1)]?_0x5ca497[_0x338d19(0xb1)]+'/'+_0x5ca497[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x5ca497[_0x338d19(0xf3)][_0x338d19(0xd6)];console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xb2))+'\x20'+_0x59a82e),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c)),console[_0x338d19(0x8c)](_0x5ca497[_0x338d19(0xdb)]),console['error']('─'[_0x338d19(0xdd)](0x3c));}if(_0x2deb78['length']>0x0)for(const _0x4d0c00 of _0x2deb78){const _0x53fb32=_0x4d0c00[_0x338d19(0xb1)]?_0x4d0c00[_0x338d19(0xb1)]+'/'+_0x4d0c00[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x4d0c00[_0x338d19(0xf3)][_0x338d19(0xd6)];console['error']('\x0a'+a41_0x403a54[_0x338d19(0xc0)]('New\x20journey:')+'\x20'+_0x53fb32),console[_0x338d19(0x8c)]('─'['repeat'](0x3c)),_0x4d0c00[_0x338d19(0xdb)]&&console['error'](_0x4d0c00['diff']),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c));}const _0x2b8725=_0x47e664[_0x338d19(0xb6)](_0x16ac38=>!_0x16ac38['isNew']&&_0x16ac38[_0x338d19(0xdb)]);if(_0x2b8725['length']>0x0)for(const _0x3730b3 of _0x2b8725){const _0x1c33ee=_0x3730b3[_0x338d19(0xb1)]?_0x3730b3[_0x338d19(0xb1)]+'/'+_0x3730b3[_0x338d19(0xf3)][_0x338d19(0xd6)]:_0x3730b3[_0x338d19(0xf3)]['name'];console['error']('\x0a'+a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xca))+'\x20'+_0x1c33ee),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c)),console[_0x338d19(0x8c)](_0x3730b3[_0x338d19(0xdb)]),console[_0x338d19(0x8c)]('─'['repeat'](0x3c));}if(_0x10fac7[_0x338d19(0xd8)]>0x0)for(const _0x56a160 of _0x10fac7){const _0x4e315b=_0x56a160[_0x338d19(0xe7)]?_0x35e68b['get'](_0x56a160[_0x338d19(0xe7)])||'':'',_0x46abce=_0x4e315b?_0x4e315b+'/'+_0x56a160[_0x338d19(0xb3)]:_0x56a160[_0x338d19(0xb3)];console[_0x338d19(0x8c)]('\x0a'+a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0x99))+'\x20'+_0x46abce),console[_0x338d19(0x8c)]('─'[_0x338d19(0xdd)](0x3c)),console['error'](a41_0x403a54[_0x338d19(0xc5)](_0x338d19(0xcf))),console[_0x338d19(0x8c)]('─'['repeat'](0x3c));}if(_0x3bf5f8[_0x338d19(0xdf)])return console['error'](a41_0x403a54['yellow'](_0x338d19(0xe2))),0x0;const _0x2adb42=_0x3bf5f8[_0x338d19(0xbf)]?![]:_0xa97ce8[_0x338d19(0xd8)]>0x0||_0x71f2c3[_0x338d19(0xd8)]>0x0||_0xa37a59[_0x338d19(0xd8)]>0x0,_0x256116=_0x2deb78[_0x338d19(0xd8)]>0x0||_0x24801d[_0x338d19(0xd8)]>0x0||_0x10fac7[_0x338d19(0xd8)]>0x0,_0x9a865b=_0x3bf5f8[_0x338d19(0xbf)]?![]:_0x372b24['length']>0x0,_0x29a387=_0x323d9e[_0x338d19(0xd8)]>0x0;if(!_0x2adb42&&!_0x256116&&!_0x9a865b&&!_0x29a387){const _0x1953e2=_0x3bf5f8[_0x338d19(0xbf)]?_0x338d19(0x114):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc0)](_0x1953e2));if(_0x3ba8ee&&_0xaf855a['length']===0x1){const _0x204638=_0xaf855a[0x0];if(_0x204638[_0x338d19(0x85)]?.['id']){const _0x2818de=getConsoleNextUrl(_0x3bf5f8[_0x338d19(0x100)],_0x338d19(0xbb)+_0x60511c+_0x338d19(0xfc)+_0x204638[_0x338d19(0x85)]['id']+_0x338d19(0xcc));console[_0x338d19(0x8c)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x2818de));}}if(_0x3ba8ee&&_0x4c1a3a[_0x338d19(0xd8)]===0x1){const _0x29584b=_0x4c1a3a[0x0];if(_0x29584b[_0x338d19(0x88)]?.['id']){const _0x1475d8=getConsoleNextUrl(_0x3bf5f8[_0x338d19(0x100)],_0x338d19(0xbb)+_0x60511c+'/e/'+_0x29584b[_0x338d19(0x88)]['id']+_0x338d19(0xa8));console[_0x338d19(0x8c)]('\x20\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x1475d8));}}return 0x0;}const _0x421232=_0x3bf5f8[_0x338d19(0xbf)]?_0x2deb78[_0x338d19(0xd8)]+_0x24801d[_0x338d19(0xd8)]+_0x10fac7['length']+_0x323d9e[_0x338d19(0xd8)]:_0xa97ce8[_0x338d19(0xd8)]+_0x71f2c3[_0x338d19(0xd8)]+_0xa37a59[_0x338d19(0xd8)]+_0x2deb78[_0x338d19(0xd8)]+_0x24801d['length']+_0x10fac7['length']+_0x323d9e[_0x338d19(0xd8)]+_0x372b24['length'];if(!_0x3bf5f8[_0x338d19(0xec)]&&_0x421232>0x0){if(!isInteractive())return console[_0x338d19(0x8c)](a41_0x403a54['red'](_0x338d19(0xe6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x10b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x16db10=await confirmKey('Push\x20'+_0x421232+'\x20changes?');if(!_0x16db10)return console['error'](a41_0x403a54[_0x338d19(0x116)]('Aborted.')),0x1;}const _0x33956b={'withProgress':async(_0x1b593a,_0x4bba5a)=>{const _0x53fe0e=_0x338d19,_0x2c631d=await withSpinner(_0x1b593a,_0x4bba5a,{'verbose':_0x3bf5f8[_0x53fe0e(0xf8)]});return{'data':_0x2c631d['data']};},'logInfo':_0xf92c74=>console[_0x338d19(0x8c)](a41_0x403a54['blue']('✔\x20'+_0xf92c74)),'logSuccess':_0x1b005d=>console['error'](a41_0x403a54[_0x338d19(0xc0)]('✔\x20'+_0x1b005d)),'logWarning':_0x3d2ec2=>console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0x116)]('⚠\x20'+_0x3d2ec2)),'logDeleted':_0x320bba=>console[_0x338d19(0x8c)](a41_0x403a54['red']('✔\x20'+_0x320bba))},_0x40473a={'segment':_0xcfaebb['segment'],'journey':_0xcfaebb[_0x338d19(0xc9)],'user':_0xcfaebb[_0x338d19(0xa1)],'connection':_0xcfaebb[_0x338d19(0x109)]};_0x323d9e[_0x338d19(0xd8)]>0x0&&(_0x42a99e=await executePushFolders(_0x40473a,_0x323d9e,_0x42a99e,{'parentId':_0x60511c},_0x33956b));const _0x11088b={'rootFolderId':_0x31e8d7,'folderPathToId':_0x42a99e,'folderIdToPath':_0x35e68b,'segmentNameToId':_0x46da74,'activationsBySegmentId':_0x37e5fd,'emailToIdMap':_0x24965a,'idToEmailMap':_0x4ecd49,'connectionNameToIdMap':_0x22f074['nameToId'],'connectionIdToNameMap':_0x22f074[_0x338d19(0x8d)],'connectionNameToTypeMap':_0x2eb6be},_0x1ee785=await executePushSegments(_0x40473a,_0x3bf5f8[_0x338d19(0xbf)]?[]:_0x57fd90,_0x11088b,{'parentId':_0x60511c},_0x33956b),_0x52b4ac=_0x1ee785[_0x338d19(0xa5)],_0x148e6c=_0x1ee785['updated'],_0x3a8a19=_0x1ee785[_0x338d19(0xc6)][_0x338d19(0xa5)],_0x11328c=_0x1ee785[_0x338d19(0xc6)][_0x338d19(0x9f)],_0x1c4682=_0x1ee785[_0x338d19(0xc6)][_0x338d19(0x117)];let _0x17571e;if(_0x3ba8ee&&_0x57fd90[_0x338d19(0xd8)]===0x1){const _0x39464a=_0x57fd90[0x0];_0x17571e=_0x39464a[_0x338d19(0x85)]?.['id']??_0x1ee785['createdSegmentIds'][_0x338d19(0xda)](_0x39464a[_0x338d19(0xf3)][_0x338d19(0xd6)]);}const _0x1fd65a=await executePushSegmentDeletions(_0x40473a,_0x3bf5f8[_0x338d19(0xbf)]?[]:_0xa37a59,_0x33956b);let _0x39e6f0=0x0,_0x127afd=0x0,_0x26e77a=0x0;const _0x215422=new Map(_0x46da74);for(const [_0xdc14c4,_0x3133f6]of _0x1ee785['createdSegmentIds']){_0x215422[_0x338d19(0x102)](_0xdc14c4,_0x3133f6);}if(_0x47e664[_0x338d19(0xd8)]>0x0){const _0x5e2c9e={..._0x11088b,'segmentNameToId':_0x215422,'existingSegments':_0xf88703,'activationContext':_0x33e173},_0x5fcb26=await executePushJourneys(_0x40473a,_0x47e664,_0x5e2c9e,{'parentId':_0x60511c,'rootFolderId':_0x31e8d7,'verbose':_0x3bf5f8['verbose']},_0x33956b);_0x39e6f0=_0x5fcb26[_0x338d19(0xa5)],_0x127afd=_0x5fcb26[_0x338d19(0x9f)];if(_0x3ba8ee&&_0x5fcb26[_0x338d19(0x87)][_0x338d19(0xd8)]===0x1){const _0x3ac777=_0x5fcb26[_0x338d19(0x87)][0x0];if(_0x3ac777[_0x338d19(0x110)]){const _0x441f15=getConsoleNextUrl(_0x3bf5f8['site'],_0x338d19(0xbb)+_0x60511c+_0x338d19(0xfc)+_0x3ac777[_0x338d19(0x110)]+'/j/da/je');console[_0x338d19(0x8c)]('\x20\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x441f15));}}}for(const _0x354fb3 of _0x10fac7){console['error'](a41_0x403a54[_0x338d19(0x116)](_0x338d19(0xcd)+_0x354fb3[_0x338d19(0xb3)])),_0x26e77a++;}const _0x31f1d6=[];if(_0x52b4ac>0x0)_0x31f1d6[_0x338d19(0x9d)](_0x52b4ac+_0x338d19(0x101));if(_0x148e6c>0x0)_0x31f1d6[_0x338d19(0x9d)](_0x148e6c+_0x338d19(0xe5));if(_0x1fd65a>0x0)_0x31f1d6[_0x338d19(0x9d)](_0x1fd65a+_0x338d19(0x83));const _0x5ac671=[];if(_0x39e6f0>0x0)_0x5ac671[_0x338d19(0x9d)](_0x39e6f0+'\x20created');if(_0x127afd>0x0)_0x5ac671['push'](_0x127afd+'\x20updated');if(_0x26e77a>0x0)_0x5ac671[_0x338d19(0x9d)](_0x26e77a+_0x338d19(0x83));const _0x1e2d49=[];if(_0x3a8a19>0x0)_0x1e2d49['push'](_0x3a8a19+'\x20created');if(_0x11328c>0x0)_0x1e2d49[_0x338d19(0x9d)](_0x11328c+_0x338d19(0xe5));if(_0x1c4682>0x0)_0x1e2d49[_0x338d19(0x9d)](_0x1c4682+_0x338d19(0x83));console[_0x338d19(0x8c)](a41_0x403a54[_0x338d19(0xc0)](_0x338d19(0x10d)));_0x31f1d6[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&console[_0x338d19(0x8c)](_0x338d19(0xf0)+_0x31f1d6[_0x338d19(0xf5)](',\x20'));_0x5ac671[_0x338d19(0xd8)]>0x0&&console[_0x338d19(0x8c)]('\x20\x20Journeys:\x20'+_0x5ac671[_0x338d19(0xf5)](',\x20'));_0x1e2d49[_0x338d19(0xd8)]>0x0&&!_0x3bf5f8[_0x338d19(0xbf)]&&console[_0x338d19(0x8c)](_0x338d19(0xb4)+_0x1e2d49['join'](',\x20'));if(_0x17571e){const _0x11a42=getConsoleNextUrl(_0x3bf5f8['site'],_0x338d19(0xbb)+_0x60511c+_0x338d19(0xfc)+_0x17571e+_0x338d19(0xcc));console[_0x338d19(0x8c)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x403a54[_0x338d19(0xd2)](_0x11a42));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x26b5eb=a42_0xb0fa;(function(_0x4574d1,_0x3114ae){const _0x4d33e2=a42_0xb0fa,_0x4e0f4f=_0x4574d1();while(!![]){try{const _0x10fa4f=parseInt(_0x4d33e2(0x1b9))/0x1+-parseInt(_0x4d33e2(0x1c1))/0x2*(parseInt(_0x4d33e2(0x1af))/0x3)+parseInt(_0x4d33e2(0x1d0))/0x4*(parseInt(_0x4d33e2(0x1ae))/0x5)+parseInt(_0x4d33e2(0x19e))/0x6*(-parseInt(_0x4d33e2(0x1bb))/0x7)+parseInt(_0x4d33e2(0x1ac))/0x8+-parseInt(_0x4d33e2(0x1b8))/0x9*(parseInt(_0x4d33e2(0x1b1))/0xa)+-parseInt(_0x4d33e2(0x1b0))/0xb;if(_0x10fa4f===_0x3114ae)break;else _0x4e0f4f['push'](_0x4e0f4f['shift']());}catch(_0xffd046){_0x4e0f4f['push'](_0x4e0f4f['shift']());}}}(a42_0x5d02,0x1a8b0));import{BaseCommand}from'./command.js';function a42_0x5d02(){const _0x10e819=['\x20\x20\x20Path:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Examples:','kind','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','✔\x20Updated\x20segment\x20\x27','name','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentPath','updateSegmentById','Update\x20existing\x20child\x20segment','verbose','256252BNKlyr','folder','segment:update','35538FDbIYn','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','type','execute','data','segmentId','INTERNAL','parentId','Error:\x20Cannot\x20update\x20','Resolved\x20relative\x20path\x20to:\x20','yellow','Updating\x20segment\x20\x27','length','rule','1196272bfNHFt','resolveFolderId','15oOLiSu','6123ECNTdQ','694892hsRMBV','10gSfXMz','\x27...','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','description','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','ruleFile','269388QKGHss','85734PLxSFo','segment','175eZsMxt','includes','resolvePathToResource','Parent\x20ID:\x20','error','Resolved\x20folder\x20ID:\x20','76npjiLI','Resolving\x20folder\x20\x27'];a42_0x5d02=function(){return _0x10e819;};return a42_0x5d02();}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 a42_0xb0fa(_0x1d9744,_0xa5d6e4){_0x1d9744=_0x1d9744-0x19c;const _0x5d0211=a42_0x5d02();let _0xb0fa45=_0x5d0211[_0x1d9744];return _0xb0fa45;}import a42_0x4d13c6 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x26b5eb(0x1ca)]=a42_0x26b5eb(0x19d);[a42_0x26b5eb(0x1b4)]=a42_0x26b5eb(0x1ce);async[a42_0x26b5eb(0x1a1)](_0x5572ea){const _0x155ffc=a42_0x26b5eb;console[_0x155ffc(0x1bf)](a42_0x4d13c6['yellow'](_0x155ffc(0x1b5))),console['error'](a42_0x4d13c6[_0x155ffc(0x1a8)](_0x155ffc(0x1b3)));const {options:_0x53a72f,args:_0x3f6056,tdx:_0x49a13c}=_0x5572ea,_0x21017d=_0x53a72f;if(_0x3f6056[_0x155ffc(0x1aa)]===0x0)return console['error'](_0x155ffc(0x1c8)),console[_0x155ffc(0x1bf)](_0x155ffc(0x1c4)),console['error'](_0x155ffc(0x1c6)),console[_0x155ffc(0x1bf)](_0x155ffc(0x1b6)),console[_0x155ffc(0x1bf)](_0x155ffc(0x1cb)),0x1;const _0xb51552=_0x3f6056[0x0],_0x498029=_0x53a72f[_0x155ffc(0x1cc)];let _0x43deea=_0xb51552;_0x498029&&!_0xb51552[_0x155ffc(0x1bc)]('/')&&(_0x43deea=_0x498029+'/'+_0xb51552,_0x21017d['verbose']&&console[_0x155ffc(0x1bf)](_0x155ffc(0x1a7)+_0x43deea));const _0x3b7592=await withSpinner('Resolving\x20path\x20\x27'+_0x43deea+_0x155ffc(0x1b2),()=>_0x49a13c[_0x155ffc(0x1ba)][_0x155ffc(0x1bd)](_0x43deea),{'verbose':_0x21017d[_0x155ffc(0x1cf)]}),_0x336c31=_0x3b7592[_0x155ffc(0x1a2)];_0x21017d[_0x155ffc(0x1cf)]&&console[_0x155ffc(0x1bf)]('Resolved\x20type:\x20'+_0x336c31[_0x155ffc(0x1a0)]);if(_0x336c31[_0x155ffc(0x1a0)]!==_0x155ffc(0x1ba))return console[_0x155ffc(0x1bf)](_0x155ffc(0x1a6)+_0x336c31['type']+_0x155ffc(0x19f)),console[_0x155ffc(0x1bf)](_0x155ffc(0x1c5)),0x1;if(!_0x336c31[_0x155ffc(0x1a3)])throw new SDKError(ErrorCode[_0x155ffc(0x1a4)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xef64af=_0x336c31[_0x155ffc(0x1a5)],_0x51b488=_0x336c31['segmentId'];_0x21017d[_0x155ffc(0x1cf)]&&(console[_0x155ffc(0x1bf)](_0x155ffc(0x1be)+_0xef64af),console[_0x155ffc(0x1bf)]('Segment\x20ID:\x20'+_0x51b488));let _0x480802;if(_0x21017d[_0x155ffc(0x19c)]){const _0xd50cc1=_0x21017d['folder'],_0x3dec61=await withSpinner(_0x155ffc(0x1c2)+_0xd50cc1+_0x155ffc(0x1b2),()=>_0x49a13c[_0x155ffc(0x1ba)][_0x155ffc(0x1ad)](_0xef64af,_0xd50cc1),{'verbose':_0x21017d[_0x155ffc(0x1cf)]});_0x480802=parseInt(_0x3dec61[_0x155ffc(0x1a2)],0xa),_0x21017d[_0x155ffc(0x1cf)]&&console[_0x155ffc(0x1bf)](_0x155ffc(0x1c0)+_0x480802);}const _0x1c40e1=await loadJSONFromOptions(_0x21017d[_0x155ffc(0x1ab)],_0x21017d[_0x155ffc(0x1b7)]),_0xe363de={'name':_0x21017d['name'],'description':_0x21017d[_0x155ffc(0x1b4)],'rule':_0x1c40e1,'kind':_0x21017d['kind']!==undefined?parseInt(_0x21017d[_0x155ffc(0x1c7)],0xa):undefined,'segmentFolderId':_0x480802},_0x2e8863=await withSpinner(_0x155ffc(0x1a9)+_0x336c31['segmentName']+_0x155ffc(0x1b2),()=>_0x49a13c['segment'][_0x155ffc(0x1cd)](_0xef64af,_0x51b488,_0xe363de),{'verbose':_0x21017d[_0x155ffc(0x1cf)]}),_0x520694=_0x2e8863[_0x155ffc(0x1a2)];return console[_0x155ffc(0x1bf)](_0x155ffc(0x1c9)+_0x520694[_0x155ffc(0x1ca)]+'\x27'),_0x43deea!==_0xb51552&&console['error'](_0x155ffc(0x1c3)+_0x43deea),await handleSDKOutput([_0x520694],_0x21017d),0x0;}}
1
+ const a42_0x438ec5=a42_0x2238;(function(_0x568438,_0x569d65){const _0x2026c3=a42_0x2238,_0x56f6fb=_0x568438();while(!![]){try{const _0x1f0d7d=-parseInt(_0x2026c3(0x1cd))/0x1+parseInt(_0x2026c3(0x1d6))/0x2+parseInt(_0x2026c3(0x1de))/0x3+parseInt(_0x2026c3(0x1dc))/0x4*(parseInt(_0x2026c3(0x1ed))/0x5)+-parseInt(_0x2026c3(0x1e2))/0x6*(parseInt(_0x2026c3(0x1d4))/0x7)+parseInt(_0x2026c3(0x1db))/0x8+parseInt(_0x2026c3(0x1ec))/0x9;if(_0x1f0d7d===_0x569d65)break;else _0x56f6fb['push'](_0x56f6fb['shift']());}catch(_0x1ea9a9){_0x56f6fb['push'](_0x56f6fb['shift']());}}}(a42_0x5359,0x37d0f));import{BaseCommand}from'./command.js';function a42_0x5359(){const _0x1d8222=['length','segment','folder','383490gRcHjl','Updating\x20segment\x20\x27','data','segmentName','ruleFile','name','parentId','\x27...','description','segment:update','1115307IuWaGG','45495hFmFXz','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','rule','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','updateSegmentById','Segment\x20ID:\x20','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segmentId','segmentPath','Resolving\x20path\x20\x27','223018vvTsfq','Examples:','kind','includes','yellow','✔\x20Updated\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','35IWMmlj','Update\x20existing\x20child\x20segment','562984sifaUe','type','error','verbose','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','1440480foTgTr','64ITfMCA','Resolved\x20folder\x20ID:\x20','120471GYlvPn'];a42_0x5359=function(){return _0x1d8222;};return a42_0x5359();}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 a42_0x2238(_0x5df1b3,_0x5dee8d){_0x5df1b3=_0x5df1b3-0x1ca;const _0x53592c=a42_0x5359();let _0x22386d=_0x53592c[_0x5df1b3];return _0x22386d;}import a42_0x3359d3 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x438ec5(0x1e7)]=a42_0x438ec5(0x1eb);[a42_0x438ec5(0x1ea)]=a42_0x438ec5(0x1d5);async['execute'](_0x24d347){const _0x45dec7=a42_0x438ec5;console['error'](a42_0x3359d3[_0x45dec7(0x1d1)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a42_0x3359d3['yellow'](_0x45dec7(0x1d3)));const {options:_0x299f17,args:_0x2fa068,tdx:_0x5e8023}=_0x24d347,_0x3b01cc=_0x299f17;if(_0x2fa068[_0x45dec7(0x1df)]===0x0)return console[_0x45dec7(0x1d8)](_0x45dec7(0x1f5)),console[_0x45dec7(0x1d8)](_0x45dec7(0x1f1)),console[_0x45dec7(0x1d8)](_0x45dec7(0x1ce)),console[_0x45dec7(0x1d8)](_0x45dec7(0x1ee)),console['error'](_0x45dec7(0x1f9)),0x1;const _0x4219f5=_0x2fa068[0x0],_0x15d364=_0x299f17[_0x45dec7(0x1cb)];let _0x4e6088=_0x4219f5;_0x15d364&&!_0x4219f5[_0x45dec7(0x1d0)]('/')&&(_0x4e6088=_0x15d364+'/'+_0x4219f5,_0x3b01cc[_0x45dec7(0x1d9)]&&console[_0x45dec7(0x1d8)](_0x45dec7(0x1f0)+_0x4e6088));const _0x499bd2=await withSpinner(_0x45dec7(0x1cc)+_0x4e6088+_0x45dec7(0x1e9),()=>_0x5e8023[_0x45dec7(0x1e0)][_0x45dec7(0x1ef)](_0x4e6088),{'verbose':_0x3b01cc[_0x45dec7(0x1d9)]}),_0x1c7707=_0x499bd2[_0x45dec7(0x1e4)];_0x3b01cc[_0x45dec7(0x1d9)]&&console[_0x45dec7(0x1d8)]('Resolved\x20type:\x20'+_0x1c7707[_0x45dec7(0x1d7)]);if(_0x1c7707[_0x45dec7(0x1d7)]!==_0x45dec7(0x1e0))return console[_0x45dec7(0x1d8)]('Error:\x20Cannot\x20update\x20'+_0x1c7707[_0x45dec7(0x1d7)]+_0x45dec7(0x1da)),console[_0x45dec7(0x1d8)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x1c7707[_0x45dec7(0x1ca)])throw new SDKError(ErrorCode[_0x45dec7(0x1f8)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5ac470=_0x1c7707[_0x45dec7(0x1e8)],_0xcbe376=_0x1c7707[_0x45dec7(0x1ca)];_0x3b01cc[_0x45dec7(0x1d9)]&&(console[_0x45dec7(0x1d8)](_0x45dec7(0x1f3)+_0x5ac470),console['error'](_0x45dec7(0x1f7)+_0xcbe376));let _0x1a795e;if(_0x3b01cc['folder']){const _0x82f74e=_0x3b01cc[_0x45dec7(0x1e1)],_0x2e73fb=await withSpinner(_0x45dec7(0x1f2)+_0x82f74e+_0x45dec7(0x1e9),()=>_0x5e8023[_0x45dec7(0x1e0)]['resolveFolderId'](_0x5ac470,_0x82f74e),{'verbose':_0x3b01cc['verbose']});_0x1a795e=parseInt(_0x2e73fb[_0x45dec7(0x1e4)],0xa),_0x3b01cc[_0x45dec7(0x1d9)]&&console[_0x45dec7(0x1d8)](_0x45dec7(0x1dd)+_0x1a795e);}const _0x4d98b7=await loadJSONFromOptions(_0x3b01cc[_0x45dec7(0x1f4)],_0x3b01cc[_0x45dec7(0x1e6)]),_0x2846e0={'name':_0x3b01cc[_0x45dec7(0x1e7)],'description':_0x3b01cc[_0x45dec7(0x1ea)],'rule':_0x4d98b7,'kind':_0x3b01cc['kind']!==undefined?parseInt(_0x3b01cc[_0x45dec7(0x1cf)],0xa):undefined,'segmentFolderId':_0x1a795e},_0x42fd8a=await withSpinner(_0x45dec7(0x1e3)+_0x1c7707[_0x45dec7(0x1e5)]+'\x27...',()=>_0x5e8023[_0x45dec7(0x1e0)][_0x45dec7(0x1f6)](_0x5ac470,_0xcbe376,_0x2846e0),{'verbose':_0x3b01cc['verbose']}),_0x30fa8d=_0x42fd8a[_0x45dec7(0x1e4)];return console[_0x45dec7(0x1d8)](_0x45dec7(0x1d2)+_0x30fa8d[_0x45dec7(0x1e7)]+'\x27'),_0x4e6088!==_0x4219f5&&console[_0x45dec7(0x1d8)]('\x20\x20\x20Path:\x20'+_0x4e6088),await handleSDKOutput([_0x30fa8d],_0x3b01cc),0x0;}}
@@ -1 +1 @@
1
- const a43_0x4cb35d=a43_0x2bb6;(function(_0x4b70d3,_0x1483ff){const _0x9447e5=a43_0x2bb6,_0x31e66a=_0x4b70d3();while(!![]){try{const _0x20497c=-parseInt(_0x9447e5(0x1e8))/0x1+-parseInt(_0x9447e5(0x1c8))/0x2+parseInt(_0x9447e5(0x1e7))/0x3*(-parseInt(_0x9447e5(0x1c9))/0x4)+-parseInt(_0x9447e5(0x1cb))/0x5*(parseInt(_0x9447e5(0x1b4))/0x6)+parseInt(_0x9447e5(0x1d2))/0x7+-parseInt(_0x9447e5(0x1c1))/0x8+parseInt(_0x9447e5(0x1b9))/0x9*(parseInt(_0x9447e5(0x1df))/0xa);if(_0x20497c===_0x1483ff)break;else _0x31e66a['push'](_0x31e66a['shift']());}catch(_0x1d3f79){_0x31e66a['push'](_0x31e66a['shift']());}}}(a43_0x12d2,0xde671));import{existsSync,statSync}from'fs';import a43_0x454f17 from'chalk';function a43_0x12d2(){const _0x28ae7=['execute','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','folderPath','site','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','5359928bcpTas','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Resolved\x20path\x20type:\x20','verbose','parentId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20Path\x20is\x20required\x0a','2389044slFlDo','58192cugMZF','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','35vQnhuo','red','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','segmentPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','segment','folderId','1098699eXFqXs','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Target\x20path:\x20','Examples:','config','log','session','Resolving\x20path\x20\x27','type','parent_segment','length','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','isDirectory','20QpafVd','parentName','name','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','description','resolvePathToResource','fullPath','join','24rzBkAr','872996XKXHnl','error','✔\x20Context\x20set\x20to:\x20','split','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','slice','segment:use','cyan','963546gqeqfQ','isAbsolute','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','dim','data','21294153sxluPq','Resolved\x20relative\x20path\x20to:\x20'];a43_0x12d2=function(){return _0x28ae7;};return a43_0x12d2();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a43_0x2bb6(_0x4467de,_0x3ad26a){_0x4467de=_0x4467de-0x1b2;const _0x12d2eb=a43_0x12d2();let _0x2bb6af=_0x12d2eb[_0x4467de];return _0x2bb6af;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x4cb35d(0x1e1)]=a43_0x4cb35d(0x1b2);[a43_0x4cb35d(0x1e3)]=a43_0x4cb35d(0x1e2);async[a43_0x4cb35d(0x1bb)](_0x2039e9){const _0x1aa083=a43_0x4cb35d,{options:_0x3841c9,args:_0x32acf0,tdx:_0x1865b6}=_0x2039e9;if(_0x32acf0['length']===0x0)return console[_0x1aa083(0x1e9)](a43_0x454f17[_0x1aa083(0x1cc)](_0x1aa083(0x1c7))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x1aa083(0x1e9)](_0x1aa083(0x1d5)),console[_0x1aa083(0x1e9)](_0x1aa083(0x1cd)),console[_0x1aa083(0x1e9)](_0x1aa083(0x1bd)),console[_0x1aa083(0x1e9)](_0x1aa083(0x1ca)),console[_0x1aa083(0x1e9)](_0x1aa083(0x1d3)),0x1;const _0x44a800=_0x32acf0[0x0],_0x1f4658=_0x3841c9[_0x1aa083(0x1d8)];try{if(_0x44a800==='/')return saveSessionContext({'segment_path':undefined},_0x1f4658),console['log'](a43_0x454f17[_0x1aa083(0x1bc)](_0x1aa083(0x1cf))),0x0;if(existsSync(_0x44a800)&&statSync(_0x44a800)[_0x1aa083(0x1de)]()){let _0x11f929;try{_0x11f929=findTdxConfig(_0x44a800);}catch{return console['error'](a43_0x454f17[_0x1aa083(0x1cc)](_0x1aa083(0x1ec)+_0x44a800)),console[_0x1aa083(0x1e9)](a43_0x454f17['cyan'](_0x1aa083(0x1c6))),0x1;}const _0x47213e=_0x11f929[_0x1aa083(0x1d6)][_0x1aa083(0x1db)];return saveSessionContext({'segment_path':_0x47213e,'parent_segment':_0x47213e},_0x1f4658),console[_0x1aa083(0x1d7)](a43_0x454f17[_0x1aa083(0x1bc)](_0x1aa083(0x1ea)+a43_0x454f17[_0x1aa083(0x1b3)](_0x47213e))),0x0;}const _0x2384fb=_0x3841c9[_0x1aa083(0x1ce)];let _0x541115=_0x44a800;const _0x4e3f12=parsePath(_0x44a800);if(!_0x4e3f12[_0x1aa083(0x1b5)]){if(!_0x2384fb)return console[_0x1aa083(0x1e9)](a43_0x454f17[_0x1aa083(0x1cc)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x1aa083(0x1e9)](a43_0x454f17[_0x1aa083(0x1b3)](_0x1aa083(0x1dd))),0x1;if(_0x44a800==='..'){const _0x218950=_0x2384fb[_0x1aa083(0x1eb)]('/')[_0x1aa083(0x1ed)](0x0,-0x1)[_0x1aa083(0x1e6)]('/');_0x541115=_0x218950||'/';}else _0x44a800==='.'?_0x541115=_0x2384fb:_0x541115=_0x2384fb+'/'+_0x44a800;_0x3841c9[_0x1aa083(0x1c4)]&&console[_0x1aa083(0x1e9)](_0x1aa083(0x1ba)+_0x541115);}if(_0x541115==='/'||_0x541115==='')return saveSessionContext({'segment_path':undefined},_0x1f4658),console[_0x1aa083(0x1d7)](a43_0x454f17[_0x1aa083(0x1bc)](_0x1aa083(0x1cf))),0x0;_0x541115=normalizePath(_0x541115);const _0x4353d1=parsePath(_0x541115)['segments'];if(_0x4353d1[_0x1aa083(0x1dc)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1f4658),console[_0x1aa083(0x1d7)](a43_0x454f17['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3841c9[_0x1aa083(0x1c4)]&&(console[_0x1aa083(0x1e9)]('Site:\x20'+_0x3841c9[_0x1aa083(0x1bf)]),console[_0x1aa083(0x1e9)](_0x1aa083(0x1d4)+_0x541115));const _0x2dc8d5=await withSpinner(_0x1aa083(0x1d9)+_0x541115+'\x27...',()=>_0x1865b6['segment'][_0x1aa083(0x1e4)](_0x541115),{'verbose':_0x3841c9[_0x1aa083(0x1c4)]}),_0x488c89=_0x2dc8d5[_0x1aa083(0x1b8)];_0x3841c9['verbose']&&(console[_0x1aa083(0x1e9)](_0x1aa083(0x1c3)+_0x488c89[_0x1aa083(0x1da)]),console[_0x1aa083(0x1e9)]('Parent\x20ID:\x20'+_0x488c89[_0x1aa083(0x1c5)]),_0x488c89[_0x1aa083(0x1d1)]&&console['error']('Folder\x20ID:\x20'+_0x488c89[_0x1aa083(0x1d1)]));if(_0x488c89[_0x1aa083(0x1da)]===_0x1aa083(0x1d0))return console[_0x1aa083(0x1e9)](a43_0x454f17[_0x1aa083(0x1cc)](_0x1aa083(0x1b6))),console[_0x1aa083(0x1e9)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x1aa083(0x1e9)](a43_0x454f17[_0x1aa083(0x1b3)]('Use:\x20tdx\x20segment\x20use\x20'+_0x488c89[_0x1aa083(0x1e0)]+(_0x488c89[_0x1aa083(0x1be)]?'/'+_0x488c89[_0x1aa083(0x1be)][_0x1aa083(0x1e6)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x488c89[_0x1aa083(0x1e5)],'parent_segment':_0x488c89[_0x1aa083(0x1e0)]},_0x1f4658),console[_0x1aa083(0x1d7)](a43_0x454f17[_0x1aa083(0x1bc)](_0x1aa083(0x1ea)+a43_0x454f17['cyan'](_0x488c89[_0x1aa083(0x1e5)]))),_0x3841c9[_0x1aa083(0x1c4)]&&(console[_0x1aa083(0x1e9)](a43_0x454f17[_0x1aa083(0x1b7)](_0x1aa083(0x1c2))),console[_0x1aa083(0x1e9)](a43_0x454f17[_0x1aa083(0x1b7)](_0x1aa083(0x1c0)))),0x0;}catch(_0x414264){throw _0x414264;}}}
1
+ const a43_0x1e5fe8=a43_0xc216;function a43_0xc216(_0x6d523d,_0x51f4c2){_0x6d523d=_0x6d523d-0x1b5;const _0x46c7b6=a43_0x46c7();let _0xc216cc=_0x46c7b6[_0x6d523d];return _0xc216cc;}(function(_0x4b7eb1,_0x15613a){const _0x4a6147=a43_0xc216,_0x373a41=_0x4b7eb1();while(!![]){try{const _0x37cbcc=parseInt(_0x4a6147(0x1c1))/0x1*(parseInt(_0x4a6147(0x1d7))/0x2)+parseInt(_0x4a6147(0x1ce))/0x3*(-parseInt(_0x4a6147(0x1b5))/0x4)+parseInt(_0x4a6147(0x1ed))/0x5+-parseInt(_0x4a6147(0x1e8))/0x6*(-parseInt(_0x4a6147(0x1b9))/0x7)+parseInt(_0x4a6147(0x1c7))/0x8+parseInt(_0x4a6147(0x1cb))/0x9*(parseInt(_0x4a6147(0x1eb))/0xa)+-parseInt(_0x4a6147(0x1ec))/0xb*(parseInt(_0x4a6147(0x1c4))/0xc);if(_0x37cbcc===_0x15613a)break;else _0x373a41['push'](_0x373a41['shift']());}catch(_0x5b260a){_0x373a41['push'](_0x373a41['shift']());}}}(a43_0x46c7,0x9f545));import{existsSync,statSync}from'fs';import a43_0x2f55a6 from'chalk';function a43_0x46c7(){const _0x12ffec=['Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Target\x20path:\x20','106776tVjWrO','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','slice','3479480ZUUxBV','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20set\x20to:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','109773SfiDCI','parentName','Usage:\x20tdx\x20segment\x20use\x20<path>','31599SshwSG','type','segment','session','\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','segmentPath','dim','execute','10214KjdyRF','log','cyan','segment:use','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','join','fullPath','isAbsolute','folderId','green','description','split','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','error','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Site:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','1333842YstPfE','segments','isDirectory','910FmCPKc','3124olxrKc','1701610DItbpO','folderPath','length','Folder\x20ID:\x20','config','Resolved\x20path\x20type:\x20','Resolved\x20relative\x20path\x20to:\x20','68DsrwiI','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','name','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','7pyIfob','red','parentId','resolvePathToResource','Examples:','Error:\x20Path\x20is\x20required\x0a','verbose','Resolving\x20path\x20\x27','245lcZsLq'];a43_0x46c7=function(){return _0x12ffec;};return a43_0x46c7();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x1e5fe8(0x1b7)]=a43_0x1e5fe8(0x1da);[a43_0x1e5fe8(0x1e1)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a43_0x1e5fe8(0x1d6)](_0x189a4c){const _0x3f98f2=a43_0x1e5fe8,{options:_0x1867e9,args:_0x1cbecc,tdx:_0x33704a}=_0x189a4c;if(_0x1cbecc['length']===0x0)return console[_0x3f98f2(0x1e4)](a43_0x2f55a6[_0x3f98f2(0x1ba)](_0x3f98f2(0x1be))),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1cd)),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1bd)),console['error'](_0x3f98f2(0x1ca)),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1d2)),console['error'](_0x3f98f2(0x1c5)),console['error'](_0x3f98f2(0x1d3)),0x1;const _0x117fba=_0x1cbecc[0x0],_0x1cd632=_0x1867e9[_0x3f98f2(0x1d1)];try{if(_0x117fba==='/')return saveSessionContext({'segment_path':undefined},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6['green'](_0x3f98f2(0x1e7))),0x0;if(existsSync(_0x117fba)&&statSync(_0x117fba)[_0x3f98f2(0x1ea)]()){let _0x11c2a7;try{_0x11c2a7=findTdxConfig(_0x117fba);}catch{return console['error'](a43_0x2f55a6[_0x3f98f2(0x1ba)](_0x3f98f2(0x1db)+_0x117fba)),console['error'](a43_0x2f55a6[_0x3f98f2(0x1d9)](_0x3f98f2(0x1b8))),0x1;}const _0x217199=_0x11c2a7[_0x3f98f2(0x1f1)]['parent_segment'];return saveSessionContext({'segment_path':_0x217199,'parent_segment':_0x217199},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6['green'](_0x3f98f2(0x1c9)+a43_0x2f55a6['cyan'](_0x217199))),0x0;}const _0x1a8431=_0x1867e9[_0x3f98f2(0x1d4)];let _0x2ec79d=_0x117fba;const _0x2f706b=parsePath(_0x117fba);if(!_0x2f706b[_0x3f98f2(0x1de)]){if(!_0x1a8431)return console['error'](a43_0x2f55a6['red'](_0x3f98f2(0x1b6))),console[_0x3f98f2(0x1e4)](a43_0x2f55a6[_0x3f98f2(0x1d9)](_0x3f98f2(0x1e5))),0x1;if(_0x117fba==='..'){const _0x5b7c38=_0x1a8431[_0x3f98f2(0x1e2)]('/')[_0x3f98f2(0x1c6)](0x0,-0x1)[_0x3f98f2(0x1dc)]('/');_0x2ec79d=_0x5b7c38||'/';}else _0x117fba==='.'?_0x2ec79d=_0x1a8431:_0x2ec79d=_0x1a8431+'/'+_0x117fba;_0x1867e9['verbose']&&console['error'](_0x3f98f2(0x1f3)+_0x2ec79d);}if(_0x2ec79d==='/'||_0x2ec79d==='')return saveSessionContext({'segment_path':undefined},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6[_0x3f98f2(0x1e0)](_0x3f98f2(0x1e7))),0x0;_0x2ec79d=normalizePath(_0x2ec79d);const _0x242dcf=parsePath(_0x2ec79d)[_0x3f98f2(0x1e9)];if(_0x242dcf[_0x3f98f2(0x1ef)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6[_0x3f98f2(0x1e0)](_0x3f98f2(0x1e7))),0x0;_0x1867e9[_0x3f98f2(0x1bf)]&&(console['error'](_0x3f98f2(0x1e6)+_0x1867e9['site']),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1c3)+_0x2ec79d));const _0x39e575=await withSpinner(_0x3f98f2(0x1c0)+_0x2ec79d+'\x27...',()=>_0x33704a[_0x3f98f2(0x1d0)][_0x3f98f2(0x1bc)](_0x2ec79d),{'verbose':_0x1867e9[_0x3f98f2(0x1bf)]}),_0x1e387e=_0x39e575['data'];_0x1867e9[_0x3f98f2(0x1bf)]&&(console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1f2)+_0x1e387e[_0x3f98f2(0x1cf)]),console[_0x3f98f2(0x1e4)]('Parent\x20ID:\x20'+_0x1e387e[_0x3f98f2(0x1bb)]),_0x1e387e[_0x3f98f2(0x1df)]&&console['error'](_0x3f98f2(0x1f0)+_0x1e387e[_0x3f98f2(0x1df)]));if(_0x1e387e[_0x3f98f2(0x1cf)]==='segment')return console[_0x3f98f2(0x1e4)](a43_0x2f55a6['red'](_0x3f98f2(0x1c8))),console[_0x3f98f2(0x1e4)](_0x3f98f2(0x1e3)),console['error'](a43_0x2f55a6['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x1e387e[_0x3f98f2(0x1cc)]+(_0x1e387e[_0x3f98f2(0x1ee)]?'/'+_0x1e387e[_0x3f98f2(0x1ee)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1e387e[_0x3f98f2(0x1dd)],'parent_segment':_0x1e387e[_0x3f98f2(0x1cc)]},_0x1cd632),console[_0x3f98f2(0x1d8)](a43_0x2f55a6[_0x3f98f2(0x1e0)](_0x3f98f2(0x1c9)+a43_0x2f55a6[_0x3f98f2(0x1d9)](_0x1e387e['fullPath']))),_0x1867e9[_0x3f98f2(0x1bf)]&&(console[_0x3f98f2(0x1e4)](a43_0x2f55a6[_0x3f98f2(0x1d5)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x3f98f2(0x1e4)](a43_0x2f55a6['dim'](_0x3f98f2(0x1c2)))),0x0;}catch(_0x41c86a){throw _0x41c86a;}}}
@@ -1 +1 @@
1
- const a44_0x51e9b3=a44_0x38dd;function a44_0x2130(){const _0x44946a=['errors','type','156OqpvVD','163625aZSVVG','4210EjxDuJ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','warnings','✔\x20All\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20file(s)\x20valid','dim','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)\x20with\x20errors,\x20','message','\x20valid','1155267NHvjgB','execute','errorCode','warningCount','Error:\x20','8LNHwNR','):\x20','181961tiwlPA','helpText','length','validCount','endsWith','10xSmDyw','name','parentSegment','\x20error(s)','segment:validate','no_parent','red','14ohztKj','log','.yml','targetDir','396iDZtGp','yellow','error','valid','1164jDkKzu','cyan','green','verbose','643WACJDb','513664NMlukM','.yaml','59622uwJvKi','Validate\x20segment\x20and\x20journey\x20YAML\x20files','\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'];a44_0x2130=function(){return _0x44946a;};return a44_0x2130();}(function(_0x43c47f,_0x3de90b){const _0x5ec8dc=a44_0x38dd,_0x4e4f73=_0x43c47f();while(!![]){try{const _0x5bef34=parseInt(_0x5ec8dc(0x145))/0x1*(parseInt(_0x5ec8dc(0x14d))/0x2)+-parseInt(_0x5ec8dc(0x148))/0x3*(-parseInt(_0x5ec8dc(0x12b))/0x4)+parseInt(_0x5ec8dc(0x14f))/0x5*(-parseInt(_0x5ec8dc(0x141))/0x6)+parseInt(_0x5ec8dc(0x139))/0x7*(-parseInt(_0x5ec8dc(0x146))/0x8)+-parseInt(_0x5ec8dc(0x126))/0x9*(parseInt(_0x5ec8dc(0x132))/0xa)+-parseInt(_0x5ec8dc(0x14e))/0xb+-parseInt(_0x5ec8dc(0x13d))/0xc*(-parseInt(_0x5ec8dc(0x12d))/0xd);if(_0x5bef34===_0x3de90b)break;else _0x4e4f73['push'](_0x4e4f73['shift']());}catch(_0x1b6f50){_0x4e4f73['push'](_0x4e4f73['shift']());}}}(a44_0x2130,0x1c841));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x185ee1 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x38dd(_0x2c57bf,_0x5be7f5){_0x2c57bf=_0x2c57bf-0x11f;const _0x21307e=a44_0x2130();let _0x38ddd8=_0x21307e[_0x2c57bf];return _0x38ddd8;}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x51e9b3(0x133)]=a44_0x51e9b3(0x136);['description']=a44_0x51e9b3(0x149);async[a44_0x51e9b3(0x127)](_0x4cc215){const _0x3b5555=a44_0x51e9b3,{options:_0x1b4108,args:_0x289127}=_0x4cc215,_0x5556fd=_0x1b4108,_0x254447=await resolveTarget({'arg':_0x289127[0x0],'contextParent':_0x1b4108[_0x3b5555(0x134)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x254447))return _0x254447[_0x3b5555(0x128)]===_0x3b5555(0x137)?(console[_0x3b5555(0x13f)](a44_0x185ee1[_0x3b5555(0x13e)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3b5555(0x122)),console[_0x3b5555(0x13f)](_0x3b5555(0x14a)),console[_0x3b5555(0x13f)](_0x3b5555(0x150))):(console[_0x3b5555(0x13f)](a44_0x185ee1[_0x3b5555(0x138)](_0x3b5555(0x12a)+_0x254447[_0x3b5555(0x124)]+'\x0a')),_0x254447['helpText']&&console['error'](a44_0x185ee1[_0x3b5555(0x142)](_0x254447[_0x3b5555(0x12e)]))),0x1;const _0xaf0325=_0x254447[_0x3b5555(0x13c)],_0x37184f=_0x254447[_0x3b5555(0x14c)]==='file'?_0x254447['filePath']:undefined;if(!_0x37184f&&!existsSync(_0xaf0325))return console[_0x3b5555(0x13f)](a44_0x185ee1['red']('Error:\x20Directory\x20not\x20found:\x20'+_0xaf0325+'\x0a')),0x1;let _0x386ebc;if(_0x37184f){if(!_0x37184f['endsWith'](_0x3b5555(0x13b))&&!_0x37184f[_0x3b5555(0x131)](_0x3b5555(0x147)))return console[_0x3b5555(0x13f)](a44_0x185ee1[_0x3b5555(0x138)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x37184f+'\x0a')),0x1;_0x386ebc=[_0x37184f];}else _0x386ebc=findYamlFiles(_0xaf0325);if(_0x386ebc[_0x3b5555(0x12f)]===0x0)return console['error'](a44_0x185ee1[_0x3b5555(0x138)](_0x3b5555(0x11f)+_0xaf0325+'\x0a')),0x1;const _0x4c48da=validateYamlFiles(_0x386ebc,_0xaf0325),_0x296f63=calculateSummary(_0x4c48da);for(const _0x1ef6c1 of _0x4c48da){if(!isValidationResult(_0x1ef6c1))continue;const {relativePath:_0x2f5a46,source:_0x99fcdd,result:_0x23c6d3,fileType:_0x4adc0f}=_0x1ef6c1,_0x35036a=_0x4adc0f;if(_0x23c6d3[_0x3b5555(0x140)]&&_0x23c6d3[_0x3b5555(0x151)][_0x3b5555(0x12f)]===0x0)_0x5556fd[_0x3b5555(0x144)]&&console[_0x3b5555(0x13a)](a44_0x185ee1['green']('✔\x20'+_0x2f5a46)+a44_0x185ee1[_0x3b5555(0x121)]('\x20('+_0x35036a+')'));else _0x23c6d3[_0x3b5555(0x140)]?(console[_0x3b5555(0x13a)](a44_0x185ee1[_0x3b5555(0x13e)]('⚠\x20'+_0x2f5a46)+a44_0x185ee1['dim']('\x20('+_0x35036a+_0x3b5555(0x12c)+_0x23c6d3[_0x3b5555(0x151)][_0x3b5555(0x12f)]+'\x20warning(s)')),console[_0x3b5555(0x13a)](formatValidationResult(_0x23c6d3,_0x99fcdd,_0x2f5a46))):(console[_0x3b5555(0x13a)](a44_0x185ee1[_0x3b5555(0x138)]('✖\x20'+_0x2f5a46)+a44_0x185ee1[_0x3b5555(0x121)]('\x20('+_0x35036a+_0x3b5555(0x12c)+_0x23c6d3[_0x3b5555(0x14b)][_0x3b5555(0x12f)]+_0x3b5555(0x135))),console[_0x3b5555(0x13a)](formatValidationResult(_0x23c6d3,_0x99fcdd,_0x2f5a46)));}return console['log'](''),_0x296f63['hasErrors']?(console[_0x3b5555(0x13a)](a44_0x185ee1['red']('Validation\x20failed:\x20'+_0x296f63['invalidCount']+_0x3b5555(0x123)+_0x296f63['validCount']+_0x3b5555(0x125))),_0x296f63[_0x3b5555(0x129)]>0x0&&console[_0x3b5555(0x13a)](a44_0x185ee1[_0x3b5555(0x13e)](_0x296f63[_0x3b5555(0x129)]+'\x20warning(s)\x20found')),0x1):(console[_0x3b5555(0x13a)](a44_0x185ee1[_0x3b5555(0x143)](_0x3b5555(0x152)+_0x296f63[_0x3b5555(0x130)]+_0x3b5555(0x120))),_0x296f63[_0x3b5555(0x129)]>0x0&&console['log'](a44_0x185ee1[_0x3b5555(0x13e)](_0x296f63[_0x3b5555(0x129)]+'\x20warning(s)\x20found')),0x0);}}
1
+ const a44_0x5e7e65=a44_0x3b35;(function(_0x356041,_0xe0b07b){const _0x1efc62=a44_0x3b35,_0x323110=_0x356041();while(!![]){try{const _0x3da0a6=parseInt(_0x1efc62(0x1cb))/0x1+parseInt(_0x1efc62(0x1aa))/0x2+-parseInt(_0x1efc62(0x1c8))/0x3+parseInt(_0x1efc62(0x1a8))/0x4+-parseInt(_0x1efc62(0x1d2))/0x5+parseInt(_0x1efc62(0x1b7))/0x6*(parseInt(_0x1efc62(0x1b5))/0x7)+parseInt(_0x1efc62(0x1ad))/0x8*(-parseInt(_0x1efc62(0x1c9))/0x9);if(_0x3da0a6===_0xe0b07b)break;else _0x323110['push'](_0x323110['shift']());}catch(_0x41b360){_0x323110['push'](_0x323110['shift']());}}}(a44_0x3386,0x8a5c8));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x4b1dcd from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x3b35(_0x5805a1,_0x440d8c){_0x5805a1=_0x5805a1-0x1a6;const _0x3386a0=a44_0x3386();let _0x3b35c5=_0x3386a0[_0x5805a1];return _0x3b35c5;}function a44_0x3386(){const _0x270253=['8nVYjyQ','.yaml','targetDir','Validate\x20segment\x20and\x20journey\x20YAML\x20files','verbose','cyan','\x20error(s)','\x20valid','131558baSBoC','\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','354pEwphC','):\x20','helpText','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20','red','filePath','valid','errorCode','message','Error:\x20Directory\x20not\x20found:\x20','green','dim','execute','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20file(s)\x20valid','length','1874319qQYBwW','9740511QmBkho','invalidCount','1080514NMeBtn','warningCount','log','.yml','hasErrors','Validation\x20failed:\x20','\x20warning(s)\x20found','4864030YXYLaL','segment:validate','\x20warning(s)','errors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','warnings','856844QHRZjB','error','1686030BubZhu','endsWith','validCount'];a44_0x3386=function(){return _0x270253;};return a44_0x3386();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x5e7e65(0x1d3);['description']=a44_0x5e7e65(0x1b0);async[a44_0x5e7e65(0x1c4)](_0x3ed5b1){const _0x1ba9dc=a44_0x5e7e65,{options:_0x15dea4,args:_0x1f4e27}=_0x3ed5b1,_0x29ba87=_0x15dea4,_0xefc5d7=await resolveTarget({'arg':_0x1f4e27[0x0],'contextParent':_0x15dea4['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xefc5d7))return _0xefc5d7[_0x1ba9dc(0x1bf)]==='no_parent'?(console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1a6)](_0x1ba9dc(0x1ba))),console[_0x1ba9dc(0x1a9)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x1ba9dc(0x1a9)](_0x1ba9dc(0x1b6)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1bb)+_0xefc5d7[_0x1ba9dc(0x1c0)]+'\x0a')),_0xefc5d7[_0x1ba9dc(0x1b9)]&&console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1b2)](_0xefc5d7[_0x1ba9dc(0x1b9)]))),0x1;const _0x4d994b=_0xefc5d7[_0x1ba9dc(0x1af)],_0x221a8b=_0xefc5d7['type']==='file'?_0xefc5d7[_0x1ba9dc(0x1bd)]:undefined;if(!_0x221a8b&&!existsSync(_0x4d994b))return console['error'](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1c1)+_0x4d994b+'\x0a')),0x1;let _0x3f5685;if(_0x221a8b){if(!_0x221a8b[_0x1ba9dc(0x1ab)](_0x1ba9dc(0x1ce))&&!_0x221a8b[_0x1ba9dc(0x1ab)](_0x1ba9dc(0x1ae)))return console['error'](a44_0x4b1dcd['red'](_0x1ba9dc(0x1c5)+_0x221a8b+'\x0a')),0x1;_0x3f5685=[_0x221a8b];}else _0x3f5685=findYamlFiles(_0x4d994b);if(_0x3f5685[_0x1ba9dc(0x1c7)]===0x0)return console[_0x1ba9dc(0x1a9)](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1d6)+_0x4d994b+'\x0a')),0x1;const _0x58f5b8=validateYamlFiles(_0x3f5685,_0x4d994b),_0x51f053=calculateSummary(_0x58f5b8);for(const _0x21b1b0 of _0x58f5b8){if(!isValidationResult(_0x21b1b0))continue;const {relativePath:_0x2923d9,source:_0x5e535f,result:_0x4aae20,fileType:_0x200631}=_0x21b1b0,_0x123994=_0x200631;if(_0x4aae20[_0x1ba9dc(0x1be)]&&_0x4aae20[_0x1ba9dc(0x1a7)]['length']===0x0)_0x29ba87[_0x1ba9dc(0x1b1)]&&console['log'](a44_0x4b1dcd['green']('✔\x20'+_0x2923d9)+a44_0x4b1dcd[_0x1ba9dc(0x1c3)]('\x20('+_0x123994+')'));else _0x4aae20[_0x1ba9dc(0x1be)]?(console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd[_0x1ba9dc(0x1a6)]('⚠\x20'+_0x2923d9)+a44_0x4b1dcd[_0x1ba9dc(0x1c3)]('\x20('+_0x123994+_0x1ba9dc(0x1b8)+_0x4aae20['warnings']['length']+_0x1ba9dc(0x1d4))),console[_0x1ba9dc(0x1cd)](formatValidationResult(_0x4aae20,_0x5e535f,_0x2923d9))):(console['log'](a44_0x4b1dcd[_0x1ba9dc(0x1bc)]('✖\x20'+_0x2923d9)+a44_0x4b1dcd[_0x1ba9dc(0x1c3)]('\x20('+_0x123994+_0x1ba9dc(0x1b8)+_0x4aae20[_0x1ba9dc(0x1d5)]['length']+_0x1ba9dc(0x1b3))),console[_0x1ba9dc(0x1cd)](formatValidationResult(_0x4aae20,_0x5e535f,_0x2923d9)));}return console[_0x1ba9dc(0x1cd)](''),_0x51f053[_0x1ba9dc(0x1cf)]?(console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd[_0x1ba9dc(0x1bc)](_0x1ba9dc(0x1d0)+_0x51f053[_0x1ba9dc(0x1ca)]+'\x20file(s)\x20with\x20errors,\x20'+_0x51f053[_0x1ba9dc(0x1ac)]+_0x1ba9dc(0x1b4))),_0x51f053[_0x1ba9dc(0x1cc)]>0x0&&console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd['yellow'](_0x51f053[_0x1ba9dc(0x1cc)]+_0x1ba9dc(0x1d1))),0x1):(console['log'](a44_0x4b1dcd[_0x1ba9dc(0x1c2)]('✔\x20All\x20'+_0x51f053[_0x1ba9dc(0x1ac)]+_0x1ba9dc(0x1c6))),_0x51f053[_0x1ba9dc(0x1cc)]>0x0&&console[_0x1ba9dc(0x1cd)](a44_0x4b1dcd[_0x1ba9dc(0x1a6)](_0x51f053['warningCount']+_0x1ba9dc(0x1d1))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x5b54e7=a45_0x1332;(function(_0x260e08,_0x78cff6){const _0x2800c0=a45_0x1332,_0x1a438f=_0x260e08();while(!![]){try{const _0x33b03d=-parseInt(_0x2800c0(0xd9))/0x1*(parseInt(_0x2800c0(0xc4))/0x2)+-parseInt(_0x2800c0(0xc3))/0x3+parseInt(_0x2800c0(0xdd))/0x4*(parseInt(_0x2800c0(0xfe))/0x5)+parseInt(_0x2800c0(0xcc))/0x6*(parseInt(_0x2800c0(0xd1))/0x7)+-parseInt(_0x2800c0(0xeb))/0x8+-parseInt(_0x2800c0(0xcf))/0x9*(-parseInt(_0x2800c0(0xbd))/0xa)+-parseInt(_0x2800c0(0xb4))/0xb*(-parseInt(_0x2800c0(0xc1))/0xc);if(_0x33b03d===_0x78cff6)break;else _0x1a438f['push'](_0x1a438f['shift']());}catch(_0x16cebd){_0x1a438f['push'](_0x1a438f['shift']());}}}(a45_0x2e7c,0x26e54));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a45_0x2e7c(){const _0x4e2361=['165bLOBMW','/e/','Resolving\x20parent\x20segment\x20\x27','listUnified','error','parentId','replace','listRecursive','cause','498150FyxBOi','\x20folder','type','name','100152ODdaFi','Parent\x20ID:\x20','365997FfHeil','5132BZdDio',',\x20and\x20','journeys','\x27...','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','/j/da','verbose',']\x20matching\x20\x27','358836KutOvE','localeCompare','folders','27JKWoHi','map','21rCVYgG','✔\x20Found\x20','folder','\x20\x20Cause:\x20','filter','Site:\x20','dim','includes','1qzMddo','\x20journey','Resolving\x20path\x20\x27','format','4808LDOJym','json','segments','description','children','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20matching\x20\x27','test','Folder\x20ID:\x20','folderId','Set\x20a\x20parent\x20segment\x20context\x20first:','journeyBundleName','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','recursive','2130656VbOzbD','site','log','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x5c$&','Folder/pattern\x20arg:\x20','length','jsonl','data','Error:\x20','/app/ps/','segment','\x20segment','resolvePathToResource','List\x20folders\x20and\x20child\x20segments','journey','sort','execute','Parent\x20segment\x20context:\x20','400ennKqu','listUnifiedWithJourneys'];a45_0x2e7c=function(){return _0x4e2361;};return a45_0x2e7c();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a45_0x1332(_0x449eb9,_0x34cf52){_0x449eb9=_0x449eb9-0xb4;const _0x2e7ca6=a45_0x2e7c();let _0x1332d8=_0x2e7ca6[_0x449eb9];return _0x1332d8;}import a45_0xfff94b from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x5b54e7(0xc0)]='segments';[a45_0x5b54e7(0xe0)]=a45_0x5b54e7(0xf9);async[a45_0x5b54e7(0xfc)](_0xbfb854){const _0xa0afa1=a45_0x5b54e7,{options:_0x2a3455,args:_0x4e4d71}=_0xbfb854,_0x32862d=_0x2a3455[_0xa0afa1(0xea)],_0x225558=_0x4e4d71[0x0];try{const _0x960cc1=_0x2a3455['parentSegment'];_0x2a3455[_0xa0afa1(0xca)]&&(console['error'](_0xa0afa1(0xd6)+_0x2a3455[_0xa0afa1(0xec)]),console['error'](_0xa0afa1(0xfd)+(_0x960cc1||'(not\x20set)')),_0x225558&&console[_0xa0afa1(0xb8)](_0xa0afa1(0xf0)+_0x225558),_0x32862d&&console[_0xa0afa1(0xb8)]('Recursive\x20mode:\x20enabled'));if(!_0x960cc1)return console[_0xa0afa1(0xb8)](_0xa0afa1(0xee)),console[_0xa0afa1(0xb8)](''),console[_0xa0afa1(0xb8)](_0xa0afa1(0xe7)),console[_0xa0afa1(0xb8)](_0xa0afa1(0xc8)),console[_0xa0afa1(0xb8)](_0xa0afa1(0xe9)),console['error'](''),console['error']('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x9562eb=_0x225558&&(_0x225558[_0xa0afa1(0xd8)]('*')||_0x225558['includes']('?'));if(_0x9562eb)return await this['listWithPattern'](_0xbfb854,_0x960cc1,_0x225558);const _0x2961bd=_0x225558?_0x960cc1+'/'+_0x225558:_0x960cc1;return _0x32862d?await this[_0xa0afa1(0xbb)](_0xbfb854,_0x2961bd):await this['listUnified'](_0xbfb854,_0x2961bd);}catch(_0x597326){if(_0x597326 instanceof SDKError)return console['error'](_0xa0afa1(0xf4)+_0x597326['message']),_0x597326['cause']&&console[_0xa0afa1(0xb8)](_0xa0afa1(0xd4)+_0x597326[_0xa0afa1(0xbc)]),0x1;throw _0x597326;}}async['listWithPattern'](_0x8239a5,_0x29423d,_0x2b43c0){const _0x1daba1=a45_0x5b54e7,{options:_0x5c1190,tdx:_0x3b0f73}=_0x8239a5,_0x3250cd=await withSpinner(_0x1daba1(0xb6)+_0x29423d+_0x1daba1(0xc7),()=>_0x3b0f73[_0x1daba1(0xf6)][_0x1daba1(0xf8)](_0x29423d),{'verbose':_0x5c1190[_0x1daba1(0xca)]}),_0x4c522e=_0x3250cd[_0x1daba1(0xf3)],_0x25a6ad=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x3b0f73['segment'][_0x1daba1(0xff)](_0x4c522e[_0x1daba1(0xb9)],_0x4c522e[_0x1daba1(0xe6)]),{'verbose':_0x5c1190[_0x1daba1(0xca)]}),{folders:_0x2e1d35,segments:_0x4be7c7,journeys:_0x3d26f1}=_0x25a6ad[_0x1daba1(0xf3)],_0x324256=_0x2b43c0[_0x1daba1(0xba)](/[.+^${}()|[\]\\]/g,_0x1daba1(0xef))['replace'](/\*/g,'.*')[_0x1daba1(0xba)](/\?/g,'.'),_0x3e78b2=new RegExp('^'+_0x324256+'$','i'),_0x18f513=_0x2e1d35[_0x1daba1(0xd5)](_0x522186=>_0x3e78b2[_0x1daba1(0xe4)](_0x522186[_0x1daba1(0xc0)])),_0x187398=_0x4be7c7[_0x1daba1(0xd5)](_0x352aea=>_0x3e78b2[_0x1daba1(0xe4)](_0x352aea[_0x1daba1(0xc0)])),_0xd54e55=_0x3d26f1[_0x1daba1(0xd5)](_0xf3e544=>_0x3e78b2['test'](_0xf3e544[_0x1daba1(0xe8)])),_0x3b37c9=_0x18f513['length']+_0x187398[_0x1daba1(0xf1)]+_0xd54e55['length'];console[_0x1daba1(0xb8)](_0x1daba1(0xd2)+_0x18f513['length']+_0x1daba1(0xbe)+(_0x18f513[_0x1daba1(0xf1)]!==0x1?'s':'')+',\x20'+_0x187398[_0x1daba1(0xf1)]+_0x1daba1(0xf7)+(_0x187398['length']!==0x1?'s':'')+_0x1daba1(0xc5)+_0xd54e55[_0x1daba1(0xf1)]+_0x1daba1(0xda)+(_0xd54e55[_0x1daba1(0xf1)]!==0x1?'s':'')+_0x1daba1(0xe3)+_0x2b43c0+'\x27');const _0x234fbe=_0x12e14e=>{const _0x4fdff7=_0x1daba1;return getConsoleNextUrl(_0x5c1190['site'],_0x4fdff7(0xf5)+_0x4c522e[_0x4fdff7(0xb9)]+'/e/'+_0x12e14e);},_0x1da6bc=_0x5c1190['format']===_0x1daba1(0xde)||_0x5c1190[_0x1daba1(0xdc)]===_0x1daba1(0xf2);if(_0x1da6bc){const _0x262f95=[..._0x18f513['map'](_0x37c007=>({..._0x37c007,'type':_0x1daba1(0xd3)})),..._0x187398[_0x1daba1(0xd0)](_0x1526aa=>({..._0x1526aa,'type':'segment','url':_0x234fbe(_0x1526aa['id'])})),..._0xd54e55[_0x1daba1(0xd0)](_0x365cab=>({..._0x365cab,'name':_0x365cab[_0x1daba1(0xe8)],'type':_0x1daba1(0xfa)}))][_0x1daba1(0xfb)]((_0x2f6a00,_0x406c4c)=>_0x2f6a00[_0x1daba1(0xc0)][_0x1daba1(0xcd)](_0x406c4c[_0x1daba1(0xc0)]));await handleSDKOutput(_0x262f95,_0x5c1190);}else{if(_0x3b37c9===0x0)console[_0x1daba1(0xed)]('No\x20items\x20match\x20pattern:\x20'+_0x2b43c0);else{console[_0x1daba1(0xed)](a45_0xfff94b['dim']('['+_0x29423d+_0x1daba1(0xcb)+_0x2b43c0+'\x27'));const _0x40da4b=formatFlatList(_0x18f513,_0x187398,{'showMetadata':!![],'getSegmentUrl':_0x234fbe},_0xd54e55);console['log'](_0x40da4b);}}return 0x0;}async[a45_0x5b54e7(0xb7)](_0xd2e1e2,_0x1c9083){const _0x5d1c7c=a45_0x5b54e7,{options:_0xe5c7ab,tdx:_0x21ffc2}=_0xd2e1e2,_0x2b215f=await withSpinner(_0x5d1c7c(0xdb)+_0x1c9083+'\x27...',()=>_0x21ffc2[_0x5d1c7c(0xf6)]['resolvePathToResource'](_0x1c9083),{'verbose':_0xe5c7ab[_0x5d1c7c(0xca)]}),_0x1ac5a1=_0x2b215f[_0x5d1c7c(0xf3)];_0xe5c7ab['verbose']&&(console['error'](_0x5d1c7c(0xc2)+_0x1ac5a1[_0x5d1c7c(0xb9)]),_0x1ac5a1['folderId']&&console['error'](_0x5d1c7c(0xe5)+_0x1ac5a1[_0x5d1c7c(0xe6)]));const _0x925275=await withSpinner(_0x5d1c7c(0xe2),()=>_0x21ffc2['segment'][_0x5d1c7c(0xff)](_0x1ac5a1['parentId'],_0x1ac5a1['folderId']),{'verbose':_0xe5c7ab[_0x5d1c7c(0xca)]}),{folders:_0xc244c4,segments:_0x2c71e9,journeys:_0x262801}=_0x925275[_0x5d1c7c(0xf3)],_0xa17e89=_0xc244c4[_0x5d1c7c(0xf1)]+_0x2c71e9[_0x5d1c7c(0xf1)]+_0x262801[_0x5d1c7c(0xf1)];console[_0x5d1c7c(0xb8)](_0x5d1c7c(0xd2)+_0xc244c4[_0x5d1c7c(0xf1)]+'\x20folder'+(_0xc244c4[_0x5d1c7c(0xf1)]!==0x1?'s':'')+',\x20'+_0x2c71e9[_0x5d1c7c(0xf1)]+_0x5d1c7c(0xf7)+(_0x2c71e9[_0x5d1c7c(0xf1)]!==0x1?'s':'')+_0x5d1c7c(0xc5)+_0x262801[_0x5d1c7c(0xf1)]+_0x5d1c7c(0xda)+(_0x262801[_0x5d1c7c(0xf1)]!==0x1?'s':''));const _0x4155c1=_0xb69601=>{const _0xadf195=_0x5d1c7c;return getConsoleNextUrl(_0xe5c7ab[_0xadf195(0xec)],_0xadf195(0xf5)+_0x1ac5a1[_0xadf195(0xb9)]+'/e/'+_0xb69601);},_0xd18555=_0x4ce037=>{const _0x5cd7d3=_0x5d1c7c;return getConsoleNextUrl(_0xe5c7ab[_0x5cd7d3(0xec)],_0x5cd7d3(0xf5)+_0x1ac5a1['parentId']+_0x5cd7d3(0xb5)+_0x4ce037+_0x5cd7d3(0xc9));},_0x297d41=_0xe5c7ab['format']==='json'||_0xe5c7ab[_0x5d1c7c(0xdc)]===_0x5d1c7c(0xf2);if(_0x297d41){const _0x9be498=[..._0xc244c4[_0x5d1c7c(0xd0)](_0x40091d=>({..._0x40091d,'type':_0x5d1c7c(0xd3)})),..._0x2c71e9[_0x5d1c7c(0xd0)](_0x210ea1=>({..._0x210ea1,'type':_0x5d1c7c(0xf6),'url':_0x4155c1(_0x210ea1['id'])})),..._0x262801[_0x5d1c7c(0xd0)](_0x162bc8=>({..._0x162bc8,'name':_0x162bc8[_0x5d1c7c(0xe8)],'type':_0x5d1c7c(0xfa),'url':_0xd18555(_0x162bc8['id'])}))][_0x5d1c7c(0xfb)]((_0x59b4d7,_0x491239)=>_0x59b4d7[_0x5d1c7c(0xc0)]['localeCompare'](_0x491239[_0x5d1c7c(0xc0)]));await handleSDKOutput(_0x9be498,_0xe5c7ab);}else{if(_0xa17e89===0x0)console[_0x5d1c7c(0xed)](a45_0xfff94b[_0x5d1c7c(0xd7)]('['+_0x1c9083+']')),console[_0x5d1c7c(0xed)]('(empty)');else{console[_0x5d1c7c(0xed)](a45_0xfff94b[_0x5d1c7c(0xd7)]('['+_0x1c9083+']'));const _0x983753=formatFlatList(_0xc244c4,_0x2c71e9,{'showMetadata':!![],'getSegmentUrl':_0x4155c1,'getJourneyUrl':_0xd18555},_0x262801);console['log'](_0x983753);}}return 0x0;}async[a45_0x5b54e7(0xbb)](_0x242c15,_0x35c883){const _0x5f0ca8=a45_0x5b54e7,{options:_0x16141c,tdx:_0x15afc9}=_0x242c15,_0x36f8ed=await withSpinner(_0x5f0ca8(0xdb)+_0x35c883+_0x5f0ca8(0xc7),()=>_0x15afc9['segment'][_0x5f0ca8(0xf8)](_0x35c883),{'verbose':_0x16141c[_0x5f0ca8(0xca)]}),_0x5f3ee1=_0x36f8ed[_0x5f0ca8(0xf3)];_0x16141c[_0x5f0ca8(0xca)]&&(console[_0x5f0ca8(0xb8)](_0x5f0ca8(0xc2)+_0x5f3ee1[_0x5f0ca8(0xb9)]),_0x5f3ee1['folderId']&&console[_0x5f0ca8(0xb8)](_0x5f0ca8(0xe5)+_0x5f3ee1[_0x5f0ca8(0xe6)]));const _0xc4223b=_0x16141c['maxDepth']||0xa,_0x30ebc7=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x15afc9['segment'][_0x5f0ca8(0xbb)](_0x5f3ee1['parentId'],_0x5f3ee1['folderId'],0x0,_0xc4223b),{'verbose':_0x16141c[_0x5f0ca8(0xca)]}),_0xae8ca=_0x30ebc7[_0x5f0ca8(0xf3)],_0x1f29de=_0x50fec8=>{const _0x30014f=_0x5f0ca8;let _0x806190=0x0,_0x4d5331=0x0,_0x3ee10=0x0;for(const _0x5548de of _0x50fec8){if(_0x5548de['type']===_0x30014f(0xd3))_0x806190++;else{if(_0x5548de[_0x30014f(0xbf)]===_0x30014f(0xf6))_0x4d5331++;else{if(_0x5548de[_0x30014f(0xbf)]==='journey')_0x3ee10++;}}if(_0x5548de[_0x30014f(0xe1)]){const _0x126ced=_0x1f29de(_0x5548de[_0x30014f(0xe1)]);_0x806190+=_0x126ced[_0x30014f(0xce)],_0x4d5331+=_0x126ced[_0x30014f(0xdf)],_0x3ee10+=_0x126ced[_0x30014f(0xc6)];}}return{'folders':_0x806190,'segments':_0x4d5331,'journeys':_0x3ee10};},_0x3d6c0a=_0x1f29de(_0xae8ca);console[_0x5f0ca8(0xb8)]('✔\x20Built\x20tree\x20with\x20'+_0x3d6c0a[_0x5f0ca8(0xce)]+'\x20folder'+(_0x3d6c0a[_0x5f0ca8(0xce)]!==0x1?'s':'')+',\x20'+_0x3d6c0a[_0x5f0ca8(0xdf)]+_0x5f0ca8(0xf7)+(_0x3d6c0a[_0x5f0ca8(0xdf)]!==0x1?'s':'')+',\x20and\x20'+_0x3d6c0a['journeys']+_0x5f0ca8(0xda)+(_0x3d6c0a[_0x5f0ca8(0xc6)]!==0x1?'s':''));const _0x52ff9b=_0x18f578=>{const _0x2c9310=_0x5f0ca8;return getConsoleNextUrl(_0x16141c[_0x2c9310(0xec)],_0x2c9310(0xf5)+_0x5f3ee1[_0x2c9310(0xb9)]+_0x2c9310(0xb5)+_0x18f578);},_0x510ef5=_0x2d8bd2=>{const _0x2f36a5=_0x5f0ca8;return getConsoleNextUrl(_0x16141c[_0x2f36a5(0xec)],'/app/ps/'+_0x5f3ee1['parentId']+'/e/'+_0x2d8bd2+_0x2f36a5(0xc9));};if(_0x16141c[_0x5f0ca8(0xdc)]==='json'||_0x16141c['format']===_0x5f0ca8(0xf2))await handleSDKOutput(_0xae8ca,_0x16141c);else{console[_0x5f0ca8(0xed)](a45_0xfff94b['dim']('['+_0x35c883+']'));const _0x23cd89=formatTree(_0xae8ca,{'showMetadata':!![],'getSegmentUrl':_0x52ff9b,'getJourneyUrl':_0x510ef5});console[_0x5f0ca8(0xed)](_0x23cd89);}return 0x0;}}
1
+ const a45_0x374368=a45_0x3f88;(function(_0x557c85,_0x34fefc){const _0x37bdd7=a45_0x3f88,_0x2b9d1b=_0x557c85();while(!![]){try{const _0x3e1548=parseInt(_0x37bdd7(0xbb))/0x1+parseInt(_0x37bdd7(0xde))/0x2*(-parseInt(_0x37bdd7(0xe4))/0x3)+parseInt(_0x37bdd7(0xb1))/0x4+-parseInt(_0x37bdd7(0xf4))/0x5*(parseInt(_0x37bdd7(0xda))/0x6)+-parseInt(_0x37bdd7(0xeb))/0x7+-parseInt(_0x37bdd7(0xed))/0x8+parseInt(_0x37bdd7(0xb5))/0x9*(parseInt(_0x37bdd7(0xb7))/0xa);if(_0x3e1548===_0x34fefc)break;else _0x2b9d1b['push'](_0x2b9d1b['shift']());}catch(_0x3d8385){_0x2b9d1b['push'](_0x2b9d1b['shift']());}}}(a45_0x54b5,0x68deb));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x54b5(){const _0x4aa04e=['Folder\x20ID:\x20','2pUxaFH','replace','\x20folder','cause','journey','listRecursive','2122122MaVgtU','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','description','jsonl','folders','listWithPattern','folder','5979792efdEYi','length','3289432nmQCRt','localeCompare','verbose','List\x20folders\x20and\x20child\x20segments','log','site','journeys','10VCudkZ','includes',',\x20and\x20','dim','(not\x20set)','No\x20items\x20match\x20pattern:\x20','data','Building\x20hierarchy\x20tree...','359896Kyjlgp','segments','map','listUnifiedWithJourneys','19334043zxOXcQ','Set\x20a\x20parent\x20segment\x20context\x20first:','10nbHfeM',']\x20matching\x20\x27','\x5c$&','name','340959bRpHWj','maxDepth','Error:\x20No\x20parent\x20segment\x20context\x20set.','/app/ps/','\x20\x20Cause:\x20','Resolving\x20path\x20\x27','/e/','✔\x20Built\x20tree\x20with\x20','sort','Site:\x20','listUnified','parentId','json','Parent\x20segment\x20context:\x20','test','Error:\x20','\x20segment','\x20journey','type','segment','children','Folder/pattern\x20arg:\x20','\x27...','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Listing\x20folders,\x20segments,\x20and\x20journeys...','filter','resolvePathToResource','/j/da','journeyBundleName','format','✔\x20Found\x20','530412fwwVVk','error','folderId'];a45_0x54b5=function(){return _0x4aa04e;};return a45_0x54b5();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x39f889 from'chalk';function a45_0x3f88(_0x25f75f,_0x415558){_0x25f75f=_0x25f75f-0xaf;const _0x54b532=a45_0x54b5();let _0x3f8844=_0x54b532[_0x25f75f];return _0x3f8844;}export class SegmentsCommand extends BaseCommand{[a45_0x374368(0xba)]='segments';[a45_0x374368(0xe6)]=a45_0x374368(0xf0);async['execute'](_0x31176d){const _0x5b9c03=a45_0x374368,{options:_0x53c058,args:_0x1590b8}=_0x31176d,_0x447c65=_0x53c058['recursive'],_0x240b9a=_0x1590b8[0x0];try{const _0x17484f=_0x53c058['parentSegment'];_0x53c058[_0x5b9c03(0xef)]&&(console[_0x5b9c03(0xdb)](_0x5b9c03(0xc4)+_0x53c058[_0x5b9c03(0xf2)]),console[_0x5b9c03(0xdb)](_0x5b9c03(0xc8)+(_0x17484f||_0x5b9c03(0xf8))),_0x240b9a&&console['error'](_0x5b9c03(0xd0)+_0x240b9a),_0x447c65&&console[_0x5b9c03(0xdb)]('Recursive\x20mode:\x20enabled'));if(!_0x17484f)return console[_0x5b9c03(0xdb)](_0x5b9c03(0xbd)),console[_0x5b9c03(0xdb)](''),console[_0x5b9c03(0xdb)](_0x5b9c03(0xb6)),console[_0x5b9c03(0xdb)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x5b9c03(0xdb)](_0x5b9c03(0xd2)),console[_0x5b9c03(0xdb)](''),console[_0x5b9c03(0xdb)](_0x5b9c03(0xe5)),0x1;const _0x528df2=_0x240b9a&&(_0x240b9a[_0x5b9c03(0xf5)]('*')||_0x240b9a[_0x5b9c03(0xf5)]('?'));if(_0x528df2)return await this[_0x5b9c03(0xe9)](_0x31176d,_0x17484f,_0x240b9a);const _0x54b278=_0x240b9a?_0x17484f+'/'+_0x240b9a:_0x17484f;return _0x447c65?await this[_0x5b9c03(0xe3)](_0x31176d,_0x54b278):await this[_0x5b9c03(0xc5)](_0x31176d,_0x54b278);}catch(_0x1752e2){if(_0x1752e2 instanceof SDKError)return console['error'](_0x5b9c03(0xca)+_0x1752e2['message']),_0x1752e2[_0x5b9c03(0xe1)]&&console[_0x5b9c03(0xdb)](_0x5b9c03(0xbf)+_0x1752e2[_0x5b9c03(0xe1)]),0x1;throw _0x1752e2;}}async[a45_0x374368(0xe9)](_0x16b8ef,_0x38d716,_0xb4fbb2){const _0x3872d1=a45_0x374368,{options:_0x3dfb6b,tdx:_0x879183}=_0x16b8ef,_0x45b249=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x38d716+'\x27...',()=>_0x879183[_0x3872d1(0xce)][_0x3872d1(0xd5)](_0x38d716),{'verbose':_0x3dfb6b[_0x3872d1(0xef)]}),_0x4dc054=_0x45b249[_0x3872d1(0xaf)],_0x217c53=await withSpinner(_0x3872d1(0xd3),()=>_0x879183[_0x3872d1(0xce)]['listUnifiedWithJourneys'](_0x4dc054['parentId'],_0x4dc054[_0x3872d1(0xdc)]),{'verbose':_0x3dfb6b[_0x3872d1(0xef)]}),{folders:_0x109dd4,segments:_0x4063eb,journeys:_0x4c628c}=_0x217c53[_0x3872d1(0xaf)],_0x42f723=_0xb4fbb2['replace'](/[.+^${}()|[\]\\]/g,_0x3872d1(0xb9))[_0x3872d1(0xdf)](/\*/g,'.*')[_0x3872d1(0xdf)](/\?/g,'.'),_0x2c85a9=new RegExp('^'+_0x42f723+'$','i'),_0x16150a=_0x109dd4[_0x3872d1(0xd4)](_0x197098=>_0x2c85a9[_0x3872d1(0xc9)](_0x197098[_0x3872d1(0xba)])),_0x20366b=_0x4063eb[_0x3872d1(0xd4)](_0x9db5bf=>_0x2c85a9[_0x3872d1(0xc9)](_0x9db5bf[_0x3872d1(0xba)])),_0x41d808=_0x4c628c[_0x3872d1(0xd4)](_0x4583ed=>_0x2c85a9[_0x3872d1(0xc9)](_0x4583ed[_0x3872d1(0xd7)])),_0x3c4446=_0x16150a['length']+_0x20366b[_0x3872d1(0xec)]+_0x41d808[_0x3872d1(0xec)];console[_0x3872d1(0xdb)](_0x3872d1(0xd9)+_0x16150a['length']+_0x3872d1(0xe0)+(_0x16150a['length']!==0x1?'s':'')+',\x20'+_0x20366b[_0x3872d1(0xec)]+_0x3872d1(0xcb)+(_0x20366b[_0x3872d1(0xec)]!==0x1?'s':'')+_0x3872d1(0xf6)+_0x41d808[_0x3872d1(0xec)]+_0x3872d1(0xcc)+(_0x41d808[_0x3872d1(0xec)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0xb4fbb2+'\x27');const _0x5418ae=_0x53de74=>{const _0x2fa9f7=_0x3872d1;return getConsoleNextUrl(_0x3dfb6b[_0x2fa9f7(0xf2)],_0x2fa9f7(0xbe)+_0x4dc054['parentId']+_0x2fa9f7(0xc1)+_0x53de74);},_0xd7d9b5=_0x3dfb6b[_0x3872d1(0xd8)]===_0x3872d1(0xc7)||_0x3dfb6b[_0x3872d1(0xd8)]===_0x3872d1(0xe7);if(_0xd7d9b5){const _0x43bc0e=[..._0x16150a[_0x3872d1(0xb3)](_0x26058f=>({..._0x26058f,'type':'folder'})),..._0x20366b[_0x3872d1(0xb3)](_0x2afbaf=>({..._0x2afbaf,'type':_0x3872d1(0xce),'url':_0x5418ae(_0x2afbaf['id'])})),..._0x41d808[_0x3872d1(0xb3)](_0x792a77=>({..._0x792a77,'name':_0x792a77['journeyBundleName'],'type':_0x3872d1(0xe2)}))][_0x3872d1(0xc3)]((_0x569ee5,_0xe4bdb)=>_0x569ee5[_0x3872d1(0xba)][_0x3872d1(0xee)](_0xe4bdb['name']));await handleSDKOutput(_0x43bc0e,_0x3dfb6b);}else{if(_0x3c4446===0x0)console[_0x3872d1(0xf1)](_0x3872d1(0xf9)+_0xb4fbb2);else{console[_0x3872d1(0xf1)](a45_0x39f889[_0x3872d1(0xf7)]('['+_0x38d716+_0x3872d1(0xb8)+_0xb4fbb2+'\x27'));const _0x173abb=formatFlatList(_0x16150a,_0x20366b,{'showMetadata':!![],'getSegmentUrl':_0x5418ae},_0x41d808);console['log'](_0x173abb);}}return 0x0;}async[a45_0x374368(0xc5)](_0x4368e,_0x55959f){const _0x36cb43=a45_0x374368,{options:_0x1b5774,tdx:_0x2f0f8d}=_0x4368e,_0x4ccc70=await withSpinner('Resolving\x20path\x20\x27'+_0x55959f+_0x36cb43(0xd1),()=>_0x2f0f8d['segment'][_0x36cb43(0xd5)](_0x55959f),{'verbose':_0x1b5774['verbose']}),_0x5dbece=_0x4ccc70['data'];_0x1b5774[_0x36cb43(0xef)]&&(console['error']('Parent\x20ID:\x20'+_0x5dbece['parentId']),_0x5dbece[_0x36cb43(0xdc)]&&console[_0x36cb43(0xdb)](_0x36cb43(0xdd)+_0x5dbece[_0x36cb43(0xdc)]));const _0x1196df=await withSpinner(_0x36cb43(0xd3),()=>_0x2f0f8d[_0x36cb43(0xce)][_0x36cb43(0xb4)](_0x5dbece[_0x36cb43(0xc6)],_0x5dbece[_0x36cb43(0xdc)]),{'verbose':_0x1b5774[_0x36cb43(0xef)]}),{folders:_0x12dbdf,segments:_0xb4bbb,journeys:_0x1cfb90}=_0x1196df[_0x36cb43(0xaf)],_0x11346d=_0x12dbdf[_0x36cb43(0xec)]+_0xb4bbb[_0x36cb43(0xec)]+_0x1cfb90[_0x36cb43(0xec)];console['error'](_0x36cb43(0xd9)+_0x12dbdf[_0x36cb43(0xec)]+_0x36cb43(0xe0)+(_0x12dbdf['length']!==0x1?'s':'')+',\x20'+_0xb4bbb[_0x36cb43(0xec)]+_0x36cb43(0xcb)+(_0xb4bbb[_0x36cb43(0xec)]!==0x1?'s':'')+',\x20and\x20'+_0x1cfb90['length']+_0x36cb43(0xcc)+(_0x1cfb90[_0x36cb43(0xec)]!==0x1?'s':''));const _0x15e872=_0x3e51aa=>{const _0x5224b0=_0x36cb43;return getConsoleNextUrl(_0x1b5774[_0x5224b0(0xf2)],_0x5224b0(0xbe)+_0x5dbece[_0x5224b0(0xc6)]+_0x5224b0(0xc1)+_0x3e51aa);},_0x1b15cc=_0x88e6c8=>{const _0x18ed62=_0x36cb43;return getConsoleNextUrl(_0x1b5774[_0x18ed62(0xf2)],_0x18ed62(0xbe)+_0x5dbece[_0x18ed62(0xc6)]+_0x18ed62(0xc1)+_0x88e6c8+_0x18ed62(0xd6));},_0x6dca45=_0x1b5774['format']==='json'||_0x1b5774['format']===_0x36cb43(0xe7);if(_0x6dca45){const _0x2f667b=[..._0x12dbdf[_0x36cb43(0xb3)](_0x1ae7fb=>({..._0x1ae7fb,'type':_0x36cb43(0xea)})),..._0xb4bbb['map'](_0x11d3e9=>({..._0x11d3e9,'type':'segment','url':_0x15e872(_0x11d3e9['id'])})),..._0x1cfb90[_0x36cb43(0xb3)](_0x97e74b=>({..._0x97e74b,'name':_0x97e74b[_0x36cb43(0xd7)],'type':'journey','url':_0x1b15cc(_0x97e74b['id'])}))][_0x36cb43(0xc3)]((_0x443953,_0x5ee85a)=>_0x443953[_0x36cb43(0xba)][_0x36cb43(0xee)](_0x5ee85a[_0x36cb43(0xba)]));await handleSDKOutput(_0x2f667b,_0x1b5774);}else{if(_0x11346d===0x0)console[_0x36cb43(0xf1)](a45_0x39f889[_0x36cb43(0xf7)]('['+_0x55959f+']')),console[_0x36cb43(0xf1)]('(empty)');else{console[_0x36cb43(0xf1)](a45_0x39f889[_0x36cb43(0xf7)]('['+_0x55959f+']'));const _0x467ac4=formatFlatList(_0x12dbdf,_0xb4bbb,{'showMetadata':!![],'getSegmentUrl':_0x15e872,'getJourneyUrl':_0x1b15cc},_0x1cfb90);console[_0x36cb43(0xf1)](_0x467ac4);}}return 0x0;}async['listRecursive'](_0x204588,_0x2f3eb3){const _0xe3075c=a45_0x374368,{options:_0x177c0c,tdx:_0x2f8f45}=_0x204588,_0x2ad667=await withSpinner(_0xe3075c(0xc0)+_0x2f3eb3+_0xe3075c(0xd1),()=>_0x2f8f45['segment'][_0xe3075c(0xd5)](_0x2f3eb3),{'verbose':_0x177c0c[_0xe3075c(0xef)]}),_0x4861cb=_0x2ad667[_0xe3075c(0xaf)];_0x177c0c[_0xe3075c(0xef)]&&(console['error']('Parent\x20ID:\x20'+_0x4861cb[_0xe3075c(0xc6)]),_0x4861cb['folderId']&&console[_0xe3075c(0xdb)]('Folder\x20ID:\x20'+_0x4861cb['folderId']));const _0x4b4f99=_0x177c0c[_0xe3075c(0xbc)]||0xa,_0x29d683=await withSpinner(_0xe3075c(0xb0),()=>_0x2f8f45[_0xe3075c(0xce)][_0xe3075c(0xe3)](_0x4861cb[_0xe3075c(0xc6)],_0x4861cb['folderId'],0x0,_0x4b4f99),{'verbose':_0x177c0c[_0xe3075c(0xef)]}),_0x567e10=_0x29d683[_0xe3075c(0xaf)],_0x5b2e4d=_0x458723=>{const _0x98e747=_0xe3075c;let _0x2380f8=0x0,_0x4ceb09=0x0,_0x45aa38=0x0;for(const _0x483af0 of _0x458723){if(_0x483af0[_0x98e747(0xcd)]===_0x98e747(0xea))_0x2380f8++;else{if(_0x483af0[_0x98e747(0xcd)]===_0x98e747(0xce))_0x4ceb09++;else{if(_0x483af0[_0x98e747(0xcd)]===_0x98e747(0xe2))_0x45aa38++;}}if(_0x483af0[_0x98e747(0xcf)]){const _0x4ba37e=_0x5b2e4d(_0x483af0['children']);_0x2380f8+=_0x4ba37e[_0x98e747(0xe8)],_0x4ceb09+=_0x4ba37e['segments'],_0x45aa38+=_0x4ba37e['journeys'];}}return{'folders':_0x2380f8,'segments':_0x4ceb09,'journeys':_0x45aa38};},_0x113aad=_0x5b2e4d(_0x567e10);console[_0xe3075c(0xdb)](_0xe3075c(0xc2)+_0x113aad[_0xe3075c(0xe8)]+_0xe3075c(0xe0)+(_0x113aad[_0xe3075c(0xe8)]!==0x1?'s':'')+',\x20'+_0x113aad[_0xe3075c(0xb2)]+_0xe3075c(0xcb)+(_0x113aad[_0xe3075c(0xb2)]!==0x1?'s':'')+_0xe3075c(0xf6)+_0x113aad[_0xe3075c(0xf3)]+_0xe3075c(0xcc)+(_0x113aad[_0xe3075c(0xf3)]!==0x1?'s':''));const _0x584bc8=_0x3a5bbf=>{const _0x5c0b5b=_0xe3075c;return getConsoleNextUrl(_0x177c0c[_0x5c0b5b(0xf2)],_0x5c0b5b(0xbe)+_0x4861cb[_0x5c0b5b(0xc6)]+_0x5c0b5b(0xc1)+_0x3a5bbf);},_0x4f1f73=_0x5649d9=>{const _0x59337e=_0xe3075c;return getConsoleNextUrl(_0x177c0c[_0x59337e(0xf2)],_0x59337e(0xbe)+_0x4861cb[_0x59337e(0xc6)]+_0x59337e(0xc1)+_0x5649d9+_0x59337e(0xd6));};if(_0x177c0c['format']===_0xe3075c(0xc7)||_0x177c0c[_0xe3075c(0xd8)]===_0xe3075c(0xe7))await handleSDKOutput(_0x567e10,_0x177c0c);else{console[_0xe3075c(0xf1)](a45_0x39f889[_0xe3075c(0xf7)]('['+_0x2f3eb3+']'));const _0x502f99=formatTree(_0x567e10,{'showMetadata':!![],'getSegmentUrl':_0x584bc8,'getJourneyUrl':_0x4f1f73});console[_0xe3075c(0xf1)](_0x502f99);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x34ed5b=a46_0x21cf;(function(_0x3cc679,_0x9e6078){const _0x5da560=a46_0x21cf,_0x416be0=_0x3cc679();while(!![]){try{const _0x30f949=-parseInt(_0x5da560(0x19b))/0x1+-parseInt(_0x5da560(0x1b3))/0x2*(parseInt(_0x5da560(0x1a2))/0x3)+parseInt(_0x5da560(0x1a9))/0x4+parseInt(_0x5da560(0x19f))/0x5+-parseInt(_0x5da560(0x18d))/0x6+parseInt(_0x5da560(0x197))/0x7+-parseInt(_0x5da560(0x18b))/0x8*(parseInt(_0x5da560(0x1b1))/0x9);if(_0x30f949===_0x9e6078)break;else _0x416be0['push'](_0x416be0['shift']());}catch(_0x47ff9a){_0x416be0['push'](_0x416be0['shift']());}}}(a46_0x26db,0xacb5a));function a46_0x26db(){const _0x4f7a6c=['Usage:\x20tdx\x20show\x20<database.table>','catalog','show','4426525kUsuxP','\x20row','table','879KnisLL','message','verbose','query','...','cause','showTable','2685080GYnnUJ','args','execute','Database:\x20','database','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','data','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','10575uVMKEA','limit','4926lpvNXX','248kwWaGZ','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','8477700EEwADh','Error:\x20','error','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','length','Limit:\x20','Catalog:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','validate','✔\x20Retrieved\x20','9809569LTeYlq','Table:\x20','description','name','79490BaaoXx'];a46_0x26db=function(){return _0x4f7a6c;};return a46_0x26db();}function a46_0x21cf(_0xc819f0,_0x5f95d5){_0xc819f0=_0xc819f0-0x18b;const _0x26db0b=a46_0x26db();let _0x21cfef=_0x26db0b[_0xc819f0];return _0x21cfef;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x34ed5b(0x19a)]=a46_0x34ed5b(0x19e);[a46_0x34ed5b(0x199)]='Show\x20table\x20contents';async[a46_0x34ed5b(0x1ab)](_0x1e2a68){return this['showTable'](_0x1e2a68);}async[a46_0x34ed5b(0x1a8)](_0x9674d4){const _0x4c3af6=a46_0x34ed5b,{options:_0x335907,args:_0x4887fd,tdx:_0x182278}=_0x9674d4;let _0x51b221;try{_0x51b221=parseTableReference(_0x4887fd[0x0]);const _0x48baf5=_0x335907['database'];!_0x51b221[_0x4c3af6(0x1ad)]&&_0x48baf5&&(_0x51b221[_0x4c3af6(0x1ad)]=_0x48baf5);const _0x468d42=validateTableDescribeReference(_0x51b221);if(_0x468d42)return console[_0x4c3af6(0x18f)]('Error:\x20'+_0x468d42),console[_0x4c3af6(0x18f)](_0x4c3af6(0x19c)),console[_0x4c3af6(0x18f)](_0x4c3af6(0x1b0)),console[_0x4c3af6(0x18f)](_0x4c3af6(0x1ae)),0x1;}catch(_0x528b35){return console[_0x4c3af6(0x18f)](_0x4c3af6(0x18e)+_0x528b35['message']),console[_0x4c3af6(0x18f)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x4c3af6(0x18f)](_0x4c3af6(0x1b0)),console[_0x4c3af6(0x18f)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x33e53f=_0x51b221[_0x4c3af6(0x19d)],_0x278d1c=_0x51b221[_0x4c3af6(0x1ad)],_0x40bd3a=_0x51b221[_0x4c3af6(0x1a1)],_0x2a2b2d=resolveLimit(_0x335907[_0x4c3af6(0x1b2)],DEFAULT_DISPLAY_LIMIT);try{_0x335907[_0x4c3af6(0x1a4)]&&(console['error']('Site:\x20'+_0x335907['site']),_0x33e53f&&console[_0x4c3af6(0x18f)](_0x4c3af6(0x193)+_0x33e53f),console['error'](_0x4c3af6(0x1ac)+_0x278d1c),console[_0x4c3af6(0x18f)](_0x4c3af6(0x198)+_0x40bd3a),console[_0x4c3af6(0x18f)](_0x4c3af6(0x192)+_0x2a2b2d));const _0x20d2f7=_0x33e53f?_0x33e53f+'.'+_0x278d1c+'.'+_0x40bd3a:_0x278d1c+'.'+_0x40bd3a,_0x292063=await withSpinner('Querying\x20'+_0x20d2f7+_0x4c3af6(0x1a6),()=>_0x182278[_0x4c3af6(0x1a5)]['showTable'](_0x278d1c,_0x40bd3a,_0x2a2b2d,_0x33e53f),{'verbose':_0x335907[_0x4c3af6(0x1a4)]}),_0x4b0f0b=_0x292063[_0x4c3af6(0x1af)],_0x46bf2e=_0x4b0f0b['data'];return _0x46bf2e[_0x4c3af6(0x191)]===0x0?console[_0x4c3af6(0x18f)](_0x4c3af6(0x194)):console[_0x4c3af6(0x18f)](_0x4c3af6(0x196)+_0x46bf2e[_0x4c3af6(0x191)]+_0x4c3af6(0x1a0)+(_0x46bf2e[_0x4c3af6(0x191)]!==0x1?'s':'')+'\x20from\x20'+_0x20d2f7),await handleSDKOutput(_0x46bf2e,_0x335907),0x0;}catch(_0x11a8fe){if(_0x11a8fe instanceof SDKError)return console[_0x4c3af6(0x18f)](_0x4c3af6(0x18e)+_0x11a8fe[_0x4c3af6(0x1a3)]),_0x11a8fe[_0x4c3af6(0x1a7)]&&console[_0x4c3af6(0x18f)]('\x20\x20Cause:\x20'+_0x11a8fe['cause']),0x1;throw _0x11a8fe;}}[a46_0x34ed5b(0x195)](_0xb77027){const _0x128253=a46_0x34ed5b;if(_0xb77027['args'][_0x128253(0x191)]===0x0)return _0x128253(0x18c);if(_0xb77027[_0x128253(0x1aa)][_0x128253(0x191)]>0x1)return _0x128253(0x190);return undefined;}}
1
+ const a46_0x155ac3=a46_0x8b59;function a46_0x2254(){const _0x1e3b96=['Catalog:\x20','showTable','9433341oPznrr','verbose','site','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','length','3533202iYSHlu','✔\x20Retrieved\x20','671978KaeVbF','validate','args','5178685sDMJuc','\x20row','name','error','description','\x20from\x20','limit','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','show','message','20kVHxhI','2vzmLMw','Database:\x20','\x20\x20Cause:\x20','catalog','cause','Site:\x20','784923PLEDer','Error:\x20','Limit:\x20','query','database','2103983ExnuQl','8dvbmES','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','data','Querying\x20','965808OLeDYW'];a46_0x2254=function(){return _0x1e3b96;};return a46_0x2254();}function a46_0x8b59(_0x4c4598,_0x1467bb){_0x4c4598=_0x4c4598-0xcf;const _0x225459=a46_0x2254();let _0x8b59a4=_0x225459[_0x4c4598];return _0x8b59a4;}(function(_0x3baad0,_0xc9caf0){const _0xd7ae57=a46_0x8b59,_0x3763d3=_0x3baad0();while(!![]){try{const _0x37b758=-parseInt(_0xd7ae57(0xee))/0x1+-parseInt(_0xd7ae57(0xd3))/0x2*(-parseInt(_0xd7ae57(0xd9))/0x3)+parseInt(_0xd7ae57(0xe4))/0x4+-parseInt(_0xd7ae57(0xf1))/0x5+-parseInt(_0xd7ae57(0xec))/0x6+-parseInt(_0xd7ae57(0xde))/0x7*(-parseInt(_0xd7ae57(0xdf))/0x8)+parseInt(_0xd7ae57(0xe7))/0x9*(parseInt(_0xd7ae57(0xd2))/0xa);if(_0x37b758===_0xc9caf0)break;else _0x3763d3['push'](_0x3763d3['shift']());}catch(_0x3c7440){_0x3763d3['push'](_0x3763d3['shift']());}}}(a46_0x2254,0x934f2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x155ac3(0xf3)]=a46_0x155ac3(0xd0);[a46_0x155ac3(0xf5)]='Show\x20table\x20contents';async['execute'](_0x5d4892){const _0x162656=a46_0x155ac3;return this[_0x162656(0xe6)](_0x5d4892);}async[a46_0x155ac3(0xe6)](_0x1665aa){const _0x16f6cd=a46_0x155ac3,{options:_0x1c6c03,args:_0x501144,tdx:_0x4174a2}=_0x1665aa;let _0x4f02e8;try{_0x4f02e8=parseTableReference(_0x501144[0x0]);const _0x55d815=_0x1c6c03[_0x16f6cd(0xdd)];!_0x4f02e8['database']&&_0x55d815&&(_0x4f02e8['database']=_0x55d815);const _0x43ff6e=validateTableDescribeReference(_0x4f02e8);if(_0x43ff6e)return console[_0x16f6cd(0xf4)]('Error:\x20'+_0x43ff6e),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe0)),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe1)),console[_0x16f6cd(0xf4)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x6dad0a){return console[_0x16f6cd(0xf4)](_0x16f6cd(0xda)+_0x6dad0a[_0x16f6cd(0xd1)]),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe0)),console[_0x16f6cd(0xf4)](_0x16f6cd(0xe1)),console[_0x16f6cd(0xf4)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x55eb7d=_0x4f02e8[_0x16f6cd(0xd6)],_0x57b7e8=_0x4f02e8[_0x16f6cd(0xdd)],_0x6c9910=_0x4f02e8['table'],_0x5788d7=resolveLimit(_0x1c6c03[_0x16f6cd(0xf7)],DEFAULT_DISPLAY_LIMIT);try{_0x1c6c03['verbose']&&(console[_0x16f6cd(0xf4)](_0x16f6cd(0xd8)+_0x1c6c03[_0x16f6cd(0xe9)]),_0x55eb7d&&console[_0x16f6cd(0xf4)](_0x16f6cd(0xe5)+_0x55eb7d),console[_0x16f6cd(0xf4)](_0x16f6cd(0xd4)+_0x57b7e8),console[_0x16f6cd(0xf4)]('Table:\x20'+_0x6c9910),console[_0x16f6cd(0xf4)](_0x16f6cd(0xdb)+_0x5788d7));const _0x4dcd69=_0x55eb7d?_0x55eb7d+'.'+_0x57b7e8+'.'+_0x6c9910:_0x57b7e8+'.'+_0x6c9910,_0x4ff296=await withSpinner(_0x16f6cd(0xe3)+_0x4dcd69+'...',()=>_0x4174a2[_0x16f6cd(0xdc)][_0x16f6cd(0xe6)](_0x57b7e8,_0x6c9910,_0x5788d7,_0x55eb7d),{'verbose':_0x1c6c03[_0x16f6cd(0xe8)]}),_0x21ed21=_0x4ff296[_0x16f6cd(0xe2)],_0xfbb4b3=_0x21ed21[_0x16f6cd(0xe2)];return _0xfbb4b3[_0x16f6cd(0xeb)]===0x0?console[_0x16f6cd(0xf4)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x16f6cd(0xf4)](_0x16f6cd(0xed)+_0xfbb4b3[_0x16f6cd(0xeb)]+_0x16f6cd(0xf2)+(_0xfbb4b3['length']!==0x1?'s':'')+_0x16f6cd(0xf6)+_0x4dcd69),await handleSDKOutput(_0xfbb4b3,_0x1c6c03),0x0;}catch(_0x126549){if(_0x126549 instanceof SDKError)return console[_0x16f6cd(0xf4)](_0x16f6cd(0xda)+_0x126549[_0x16f6cd(0xd1)]),_0x126549[_0x16f6cd(0xd7)]&&console['error'](_0x16f6cd(0xd5)+_0x126549[_0x16f6cd(0xd7)]),0x1;throw _0x126549;}}[a46_0x155ac3(0xef)](_0x3e2853){const _0x8850c4=a46_0x155ac3;if(_0x3e2853['args'][_0x8850c4(0xeb)]===0x0)return _0x8850c4(0xcf);if(_0x3e2853[_0x8850c4(0xf0)][_0x8850c4(0xeb)]>0x1)return _0x8850c4(0xea);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x15cf58=a47_0x2f79;(function(_0xb32243,_0x51b5aa){const _0x571b57=a47_0x2f79,_0x24050b=_0xb32243();while(!![]){try{const _0x5aeaaa=parseInt(_0x571b57(0x9c))/0x1+parseInt(_0x571b57(0x98))/0x2*(parseInt(_0x571b57(0x84))/0x3)+parseInt(_0x571b57(0x9a))/0x4*(-parseInt(_0x571b57(0x87))/0x5)+-parseInt(_0x571b57(0x8c))/0x6*(-parseInt(_0x571b57(0x7e))/0x7)+parseInt(_0x571b57(0x7f))/0x8+parseInt(_0x571b57(0x82))/0x9+-parseInt(_0x571b57(0x7d))/0xa;if(_0x5aeaaa===_0x51b5aa)break;else _0x24050b['push'](_0x24050b['shift']());}catch(_0x578c5c){_0x24050b['push'](_0x24050b['shift']());}}}(a47_0x22fe,0xd4440));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0x22fe(){const _0x342efa=['CLI\x20flag','site','filter','OAuth','TDX_PROFILE\x20env','description','cyan','green','dim','278oConTB','cli','2276900MwBEBs','execute','897222AvRNrG','message','last_name','config','getUserInfo','error','Show\x20authentication\x20status\x20and\x20current\x20context','email','Read\x20credential\x20from\x20','first_name','User:','log','red','name','Credential\x20type:\x20','22456650ccNWuc','329nGClEu','7253424CpNYFL','session','\x20profile:\x20','1851984kovVgS','yellow','22482qUUXKf','env','profileSource','10DdCdpx','site:\x20','status','jobs','account_id','153474DelTNg','bold','✗\x20Validation\x20failed:\x20'];a47_0x22fe=function(){return _0x342efa;};return a47_0x22fe();}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x2f79(_0x1ed9a6,_0x507531){_0x1ed9a6=_0x1ed9a6-0x70;const _0x22fe62=a47_0x22fe();let _0x2f7961=_0x22fe62[_0x1ed9a6];return _0x2f7961;}import a47_0x3d67e4 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x15cf58(0x7b)]=a47_0x15cf58(0x89);[a47_0x15cf58(0x94)]=a47_0x15cf58(0x74);async[a47_0x15cf58(0x9b)](_0x271a79){const _0x3170c2=a47_0x15cf58,{options:_0x49c316,tdx:_0x4d4cfa}=_0x271a79,_0x22436b=_0x49c316[_0x3170c2(0x90)],_0x607230=new GlobalContext(_0x49c316),_0x481096=_0x607230['profile'],_0x1b36d7=_0x607230[_0x3170c2(0x86)],_0x35143c=_0x1b36d7===_0x3170c2(0x99)?_0x3170c2(0x8f):_0x1b36d7===_0x3170c2(0x80)?_0x3170c2(0x80):_0x1b36d7===_0x3170c2(0x85)?_0x3170c2(0x93):_0x1b36d7===_0x3170c2(0x71)?_0x3170c2(0x71):null,_0xcf36dd=_0x481096?a47_0x3d67e4[_0x3170c2(0x95)](_0x481096):a47_0x3d67e4[_0x3170c2(0x97)]('N/A'),_0x368843=_0x35143c?'\x20'+a47_0x3d67e4[_0x3170c2(0x97)]('(from\x20'+_0x35143c+')'):'';console[_0x3170c2(0x79)](a47_0x3d67e4[_0x3170c2(0x8d)]('tdx')+_0x3170c2(0x81)+_0xcf36dd+_0x368843+'\x20'+a47_0x3d67e4[_0x3170c2(0x97)]('(')+_0x3170c2(0x88)+a47_0x3d67e4['cyan'](_0x22436b)+a47_0x3d67e4[_0x3170c2(0x97)](')'));const _0x3e81e3=await getOAuthTokens(_0x481096);if(_0x3e81e3)console[_0x3170c2(0x79)](_0x3170c2(0x7c)+a47_0x3d67e4[_0x3170c2(0x95)](_0x3170c2(0x92)));else{const _0x29659c=await resolveAPIKeyAsync(_0x22436b,_0x481096);if(_0x29659c){const {source:_0x2d102f,isDeprecated:_0x16e195}=_0x29659c,_0x492ece=_0x3170c2(0x76)+a47_0x3d67e4[_0x3170c2(0x95)](_0x2d102f);console[_0x3170c2(0x79)](_0x16e195?a47_0x3d67e4[_0x3170c2(0x83)](_0x492ece):_0x492ece);}else console[_0x3170c2(0x79)](a47_0x3d67e4[_0x3170c2(0x83)]('No\x20credential\x20found'));}let _0x4d7d07=![];try{const _0x262454=await _0x4d4cfa[_0x3170c2(0x8a)][_0x3170c2(0x72)]();console[_0x3170c2(0x79)](a47_0x3d67e4[_0x3170c2(0x96)]('✓\x20Authentication\x20successful\x0a')),console[_0x3170c2(0x79)](a47_0x3d67e4[_0x3170c2(0x8d)](_0x3170c2(0x78))+'\x20'+a47_0x3d67e4['cyan'](_0x262454[_0x3170c2(0x75)]));if(_0x262454[_0x3170c2(0x77)]||_0x262454[_0x3170c2(0x70)]){const _0x18c343=[_0x262454['first_name'],_0x262454[_0x3170c2(0x70)]][_0x3170c2(0x91)](Boolean)['join']('\x20');console[_0x3170c2(0x79)](a47_0x3d67e4[_0x3170c2(0x8d)]('Name:')+'\x20'+_0x18c343);}_0x262454[_0x3170c2(0x8b)]&&console[_0x3170c2(0x79)](a47_0x3d67e4[_0x3170c2(0x8d)]('Account\x20ID:')+'\x20'+a47_0x3d67e4['yellow'](_0x262454['account_id'])),_0x4d7d07=!![];}catch(_0x1ed81e){_0x1ed81e instanceof HTTPClientError&&_0x1ed81e[_0x3170c2(0x89)]===0x191?printAuthError(_0x1ed81e,!![],_0x481096):console[_0x3170c2(0x73)](a47_0x3d67e4[_0x3170c2(0x7a)](_0x3170c2(0x8e)+(_0x1ed81e instanceof Error?_0x1ed81e[_0x3170c2(0x9d)]:String(_0x1ed81e))));}return console[_0x3170c2(0x79)](),_0x607230['displayWithSources'](),_0x4d7d07?0x0:0x1;}}
1
+ function a47_0x413c(_0x260386,_0x2c6561){_0x260386=_0x260386-0xf7;const _0x503aea=a47_0x503a();let _0x413cef=_0x503aea[_0x260386];return _0x413cef;}const a47_0x1f5950=a47_0x413c;(function(_0x4dc3fb,_0x48d836){const _0x243a2e=a47_0x413c,_0x4b3e50=_0x4dc3fb();while(!![]){try{const _0x180cc7=-parseInt(_0x243a2e(0x109))/0x1+parseInt(_0x243a2e(0xfc))/0x2+parseInt(_0x243a2e(0x114))/0x3+parseInt(_0x243a2e(0x103))/0x4*(-parseInt(_0x243a2e(0x11b))/0x5)+-parseInt(_0x243a2e(0x100))/0x6*(parseInt(_0x243a2e(0x111))/0x7)+parseInt(_0x243a2e(0x10c))/0x8+-parseInt(_0x243a2e(0x118))/0x9*(parseInt(_0x243a2e(0x112))/0xa);if(_0x180cc7===_0x48d836)break;else _0x4b3e50['push'](_0x4b3e50['shift']());}catch(_0x147627){_0x4b3e50['push'](_0x4b3e50['shift']());}}}(a47_0x503a,0x852f3));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';function a47_0x503a(){const _0x687a09=['profile','5ildObN','tdx','cyan','error','displayWithSources','session','bold','No\x20credential\x20found','Credential\x20type:\x20','red','N/A','1702534RfSOAO','TDX_PROFILE\x20env','status','log','24wDLnkG','Show\x20authentication\x20status\x20and\x20current\x20context','yellow','2069876SqAUfR','filter','OAuth','site:\x20','description','account_id','475421FyazQY','getUserInfo','dim','5525416gXofAI','cli','name','env','last_name','522718OIHggA','80WuYUnT','first_name','2955543RyaQCY','config','✓\x20Authentication\x20successful\x0a','green','776268sYexTl','User:'];a47_0x503a=function(){return _0x687a09;};return a47_0x503a();}import a47_0x1999ba from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1f5950(0x10e)]=a47_0x1f5950(0xfe);[a47_0x1f5950(0x107)]=a47_0x1f5950(0x101);async['execute'](_0x13426e){const _0x17f400=a47_0x1f5950,{options:_0x44a32,tdx:_0x12bd46}=_0x13426e,_0x27a751=_0x44a32['site'],_0x1b66f8=new GlobalContext(_0x44a32),_0x57301d=_0x1b66f8[_0x17f400(0x11a)],_0x532537=_0x1b66f8['profileSource'],_0x2fa5f8=_0x532537===_0x17f400(0x10d)?'CLI\x20flag':_0x532537===_0x17f400(0x120)?_0x17f400(0x120):_0x532537===_0x17f400(0x10f)?_0x17f400(0xfd):_0x532537==='config'?_0x17f400(0x115):null,_0x3d2f18=_0x57301d?a47_0x1999ba['cyan'](_0x57301d):a47_0x1999ba[_0x17f400(0x10b)](_0x17f400(0xfb)),_0x170ad5=_0x2fa5f8?'\x20'+a47_0x1999ba[_0x17f400(0x10b)]('(from\x20'+_0x2fa5f8+')'):'';console['log'](a47_0x1999ba[_0x17f400(0xf7)](_0x17f400(0x11c))+'\x20profile:\x20'+_0x3d2f18+_0x170ad5+'\x20'+a47_0x1999ba[_0x17f400(0x10b)]('(')+_0x17f400(0x106)+a47_0x1999ba[_0x17f400(0x11d)](_0x27a751)+a47_0x1999ba['dim'](')'));const _0x5184e8=await getOAuthTokens(_0x57301d);if(_0x5184e8)console[_0x17f400(0xff)](_0x17f400(0xf9)+a47_0x1999ba['cyan'](_0x17f400(0x105)));else{const _0x216e00=await resolveAPIKeyAsync(_0x27a751,_0x57301d);if(_0x216e00){const {source:_0x2007ba,isDeprecated:_0x1c34f6}=_0x216e00,_0x4608d2='Read\x20credential\x20from\x20'+a47_0x1999ba['cyan'](_0x2007ba);console[_0x17f400(0xff)](_0x1c34f6?a47_0x1999ba[_0x17f400(0x102)](_0x4608d2):_0x4608d2);}else console[_0x17f400(0xff)](a47_0x1999ba[_0x17f400(0x102)](_0x17f400(0xf8)));}let _0x9e01fe=![];try{const _0x268e1d=await _0x12bd46['jobs'][_0x17f400(0x10a)]();console[_0x17f400(0xff)](a47_0x1999ba[_0x17f400(0x117)](_0x17f400(0x116))),console['log'](a47_0x1999ba[_0x17f400(0xf7)](_0x17f400(0x119))+'\x20'+a47_0x1999ba[_0x17f400(0x11d)](_0x268e1d['email']));if(_0x268e1d[_0x17f400(0x113)]||_0x268e1d['last_name']){const _0x238b4b=[_0x268e1d[_0x17f400(0x113)],_0x268e1d[_0x17f400(0x110)]][_0x17f400(0x104)](Boolean)['join']('\x20');console[_0x17f400(0xff)](a47_0x1999ba[_0x17f400(0xf7)]('Name:')+'\x20'+_0x238b4b);}_0x268e1d[_0x17f400(0x108)]&&console[_0x17f400(0xff)](a47_0x1999ba['bold']('Account\x20ID:')+'\x20'+a47_0x1999ba[_0x17f400(0x102)](_0x268e1d[_0x17f400(0x108)])),_0x9e01fe=!![];}catch(_0xbc0ba0){_0xbc0ba0 instanceof HTTPClientError&&_0xbc0ba0['status']===0x191?printAuthError(_0xbc0ba0,!![],_0x57301d):console[_0x17f400(0x11e)](a47_0x1999ba[_0x17f400(0xfa)]('✗\x20Validation\x20failed:\x20'+(_0xbc0ba0 instanceof Error?_0xbc0ba0['message']:String(_0xbc0ba0))));}return console[_0x17f400(0xff)](),_0x1b66f8[_0x17f400(0x11f)](),_0x9e01fe?0x0:0x1;}}