@treasuredata/tdx 2026.4.9 → 2026.4.11

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 (228) 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.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  96. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  97. package/dist/sdk/cas/index.js +1 -1
  98. package/dist/sdk/cas/pull-workflow.js +1 -1
  99. package/dist/sdk/cas/push-workflow.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +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.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/index.js +1 -1
  139. package/dist/sdk/query/sql-parser.js +1 -1
  140. package/dist/sdk/realtime.js +1 -1
  141. package/dist/sdk/schedule.js +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/fields-display.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.js +1 -1
  184. package/dist/sdk/workspace/frontmatter.js +1 -1
  185. package/dist/sdk/workspace/git.d.ts +52 -0
  186. package/dist/sdk/workspace/git.d.ts.map +1 -1
  187. package/dist/sdk/workspace/git.js +1 -1
  188. package/dist/sdk/workspace/git.js.map +1 -1
  189. package/dist/sdk/workspace/index.d.ts +14 -0
  190. package/dist/sdk/workspace/index.d.ts.map +1 -1
  191. package/dist/sdk/workspace/index.js +1 -1
  192. package/dist/sdk/workspace/index.js.map +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +2 -1
@@ -1 +1 @@
1
- const a40_0x38d806=a40_0x3fb7;(function(_0x1c764c,_0x297d4f){const _0x376df9=a40_0x3fb7,_0x1111b6=_0x1c764c();while(!![]){try{const _0x1be1c9=-parseInt(_0x376df9(0x126))/0x1+parseInt(_0x376df9(0xff))/0x2+parseInt(_0x376df9(0x105))/0x3*(parseInt(_0x376df9(0x112))/0x4)+-parseInt(_0x376df9(0x109))/0x5+parseInt(_0x376df9(0x106))/0x6*(-parseInt(_0x376df9(0x10c))/0x7)+-parseInt(_0x376df9(0x13a))/0x8*(parseInt(_0x376df9(0x115))/0x9)+parseInt(_0x376df9(0x11d))/0xa*(parseInt(_0x376df9(0x138))/0xb);if(_0x1be1c9===_0x297d4f)break;else _0x1111b6['push'](_0x1111b6['shift']());}catch(_0x39cea6){_0x1111b6['push'](_0x1111b6['shift']());}}}(a40_0x4017,0x9d820));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a40_0x3fb7(_0x32e715,_0x3c5b8d){_0x32e715=_0x32e715-0xf7;const _0x4017e9=a40_0x4017();let _0x3fb798=_0x4017e9[_0x32e715];return _0x3fb798;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x251a7a from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x872660 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a40_0x4017(){const _0x3244fa=['\x20with\x20','segments','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','red','\x20segments','dim','length','1714876WkTFIX','execute','helpText','Parent\x20segment:\x20','file','Target\x20resource:\x20','252951FMGRoJ','1333374sKeuSB','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','filter','602400gBtEoa','verbose','targetDir','28vbtGwK','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','isNew','type','site','absolutePath','4QEjTNv','segment:pull','green','131913etBayX','parent_segment','files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parentSegment','\x20\x20🗺️\x20\x20','\x0aError:','parentName','19882300oyZaGJ','cyan','journeyVersions','relativePath','Error:\x20','diff','Write\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','utf-8','542587vzNiaL','hasChanges','\x27...','\x20=\x20','\x20files?','\x20new\x20files','pullSegments','segment','no_parent','yellow','dryRun','✔\x20Context\x20set:\x20','message','\x20journeys','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aPull\x20summary\x20for\x20\x27','journeys','error','11RlrEdD','\x20files\x20to\x20','400JKVNEG','data','activations','yes','dirname','\x20\x20Target:\x20','session','counts','\x20\x20🎯\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errorCode'];a40_0x4017=function(){return _0x3244fa;};return a40_0x4017();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a40_0x38d806(0x113);['description']=a40_0x38d806(0xfa);async[a40_0x38d806(0x100)](_0xfda771){const _0x32487a=a40_0x38d806,{options:_0x216476,args:_0x1149c4,tdx:_0x5cba4f}=_0xfda771,_0x55db5e=_0x216476,_0x193446=await resolveTarget({'arg':_0x1149c4[0x0],'contextParent':_0x216476[_0x32487a(0x119)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x193446))return _0x193446[_0x32487a(0xf7)]===_0x32487a(0x12e)?(console['error'](a40_0x251a7a[_0x32487a(0x12f)](_0x32487a(0x143))),console[_0x32487a(0x137)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x32487a(0x137)](_0x32487a(0x10d)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x32487a(0x137)](a40_0x251a7a['red'](_0x32487a(0x121)+_0x193446[_0x32487a(0x132)]+'\x0a')),_0x193446[_0x32487a(0x101)]&&console[_0x32487a(0x137)](a40_0x251a7a['cyan'](_0x193446[_0x32487a(0x101)]))),0x1;const _0x3989d0=_0x193446['parentName'],_0xb1ebee=_0x193446[_0x32487a(0x10b)],_0x295e7e=_0x193446[_0x32487a(0x10f)]===_0x32487a(0x103)?_0x193446['resourceName']:undefined;_0x55db5e['verbose']&&(console['error']('Site:\x20'+_0x55db5e[_0x32487a(0x110)]),console[_0x32487a(0x137)](_0x32487a(0x102)+_0x3989d0),_0x295e7e&&console[_0x32487a(0x137)](_0x32487a(0x104)+_0x295e7e));const _0x435ead=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x3989d0+_0x32487a(0x128),_0x4ffb1b=>_0x5cba4f[_0x32487a(0x12d)][_0x32487a(0x12c)](_0x3989d0,{'targetDir':_0xb1ebee,'targetResourceName':_0x295e7e,'verbose':_0x55db5e[_0x32487a(0x10a)],'progress':{'update':_0x498803=>{const _0x11d38a=_0x32487a;_0x4ffb1b['setPhase'](_0x498803),_0x55db5e[_0x11d38a(0x10a)]&&console[_0x11d38a(0x137)]('\x20\x20'+_0x498803);}}}),{'verbose':_0x55db5e['verbose']}),_0x3031d7=_0x435ead[_0x32487a(0x13b)];if(_0x3031d7[_0x32487a(0x141)][_0x32487a(0xf9)]===0x0&&_0x3031d7['counts']['journeys']===0x0)return console[_0x32487a(0x137)](a40_0x251a7a[_0x32487a(0x12f)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x3031d7[_0x32487a(0x11c)]+'\x27')),0x0;const _0x109a9f=_0x3031d7[_0x32487a(0x117)]['filter'](_0x11fe23=>_0x11fe23[_0x32487a(0x10e)]),_0x415c5f=_0x3031d7['files'][_0x32487a(0x108)](_0x3ca013=>!_0x3ca013[_0x32487a(0x10e)]&&_0x3ca013[_0x32487a(0x127)]),_0x11ba04=_0x3031d7[_0x32487a(0x117)][_0x32487a(0x108)](_0x192ebe=>!_0x192ebe['isNew']&&!_0x192ebe[_0x32487a(0x127)]);console[_0x32487a(0x137)](_0x32487a(0x135)+_0x3031d7[_0x32487a(0x11c)]+'\x27:'),console['error'](_0x32487a(0x142)+a40_0x251a7a['cyan'](_0x3031d7['counts']['segments']+_0x32487a(0xfc))+_0x32487a(0xf8)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7[_0x32487a(0x141)][_0x32487a(0x13c)]+'\x20activations'));if(_0x3031d7[_0x32487a(0x141)][_0x32487a(0x136)]>0x0){const _0xfd8673=_0x3031d7['counts'][_0x32487a(0x11f)]>_0x3031d7[_0x32487a(0x141)]['journeys']?'\x20('+_0x3031d7['counts'][_0x32487a(0x11f)]+'\x20versions)':'';console[_0x32487a(0x137)](_0x32487a(0x11a)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7['counts'][_0x32487a(0x136)]+_0x32487a(0x133))+a40_0x251a7a[_0x32487a(0xfd)](_0xfd8673));}console[_0x32487a(0x137)]('\x20\x20'+a40_0x251a7a[_0x32487a(0x114)]('+\x20'+_0x109a9f[_0x32487a(0xfe)]+_0x32487a(0x12b))),console[_0x32487a(0x137)]('\x20\x20'+a40_0x251a7a[_0x32487a(0x12f)]('~\x20'+_0x415c5f[_0x32487a(0xfe)]+'\x20changed\x20files')),console[_0x32487a(0x137)]('\x20\x20'+a40_0x251a7a['dim']('=\x20'+_0x11ba04[_0x32487a(0xfe)]+'\x20unchanged\x20files')),console[_0x32487a(0x137)](_0x32487a(0x13f)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7[_0x32487a(0x10b)])+'\x0a');if(_0x415c5f[_0x32487a(0xfe)]>0x0)for(const _0xb1ab9e of _0x415c5f){console[_0x32487a(0x137)]('\x0aChanges\x20to\x20\x27'+_0xb1ab9e[_0x32487a(0x120)]+'\x27:'),console[_0x32487a(0x137)]('─'['repeat'](0x3c)),console[_0x32487a(0x137)](_0xb1ab9e[_0x32487a(0x122)]),console[_0x32487a(0x137)]('─'['repeat'](0x3c));}if(_0x55db5e[_0x32487a(0x130)])return console[_0x32487a(0x137)](a40_0x251a7a['yellow'](_0x32487a(0x107))),0x0;if(_0x109a9f[_0x32487a(0xfe)]===0x0&&_0x415c5f[_0x32487a(0xfe)]===0x0)return console[_0x32487a(0x137)](a40_0x251a7a['green'](_0x32487a(0x134))),saveSessionContext({'parent_segment':_0x3031d7['parentName']},_0x55db5e[_0x32487a(0x140)]),console[_0x32487a(0x137)](a40_0x251a7a[_0x32487a(0x114)](_0x32487a(0x131)+a40_0x251a7a[_0x32487a(0xfd)](_0x32487a(0x116))+_0x32487a(0x129)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7['parentName']))),0x0;if(!_0x55db5e[_0x32487a(0x13d)]){if(!isInteractive())return console[_0x32487a(0x137)](a40_0x251a7a[_0x32487a(0xfb)](_0x32487a(0x11b)),_0x32487a(0x118)),console['error'](a40_0x251a7a[_0x32487a(0xfd)](_0x32487a(0x124))),0x1;const _0x2cc294=await confirmKey(_0x32487a(0x123)+(_0x109a9f['length']+_0x415c5f[_0x32487a(0xfe)])+_0x32487a(0x12a));if(!_0x2cc294)return console[_0x32487a(0x137)](a40_0x251a7a['yellow']('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x3ab778 of _0x3031d7[_0x32487a(0x117)]){if(_0x3ab778[_0x32487a(0x10e)]||_0x3ab778[_0x32487a(0x127)]){const _0x5b8ad2=a40_0x872660[_0x32487a(0x13e)](_0x3ab778[_0x32487a(0x111)]);!existsSync(_0x5b8ad2)&&mkdirSync(_0x5b8ad2,{'recursive':!![]}),writeFileSync(_0x3ab778[_0x32487a(0x111)],_0x3ab778['content'],_0x32487a(0x125));}}return console[_0x32487a(0x137)](a40_0x251a7a[_0x32487a(0x114)]('✔\x20Pulled\x20'+(_0x109a9f[_0x32487a(0xfe)]+_0x415c5f[_0x32487a(0xfe)])+_0x32487a(0x139)+_0x3031d7['targetDir'])),saveSessionContext({'parent_segment':_0x3031d7[_0x32487a(0x11c)]},_0x55db5e[_0x32487a(0x140)]),console[_0x32487a(0x137)](a40_0x251a7a['green'](_0x32487a(0x131)+a40_0x251a7a[_0x32487a(0xfd)](_0x32487a(0x116))+_0x32487a(0x129)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7[_0x32487a(0x11c)]))),0x0;}}
1
+ const a40_0x3d9a7e=a40_0x1e85;function a40_0xfc32(){const _0x450377=['segment:pull','red','dim','journeyVersions','478985KwfhDP','11484552EfZmFD','data','16aAVcJF','-\x20no\x20files\x20written','relativePath','cyan','name','content','absolutePath','isNew','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','counts','Aborted.','parent_segment','files','error','29015aPTXba','segments','\x20changed\x20files','302508Cvasbv','yellow','journeys','9NAkcvW','parentName','dryRun','dirname','\x20versions)','description','filter','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','resourceName','\x0aError:','✔\x20All\x20files\x20are\x20up\x20to\x20date','file','repeat','helpText','11uZYYRe','utf-8','\x20\x20🎯\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','type','Pulling\x20segments\x20from\x20\x27','\x20files\x20to\x20','parentSegment','6721030LbZZFN','verbose','286506lKpPkU','✔\x20Context\x20set:\x20','diff','Error:\x20','segment','errorCode','green','\x20segments','576714FOWlwL','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','setPhase','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)','\x20unchanged\x20files','length','cwd','no_parent','yes','\x20with\x20','✔\x20Pulled\x20','\x20journeys','targetDir','\x20files?','pullSegments','\x20\x20Target:\x20','Site:\x20','session','104LhnGVS','\x20=\x20','site','hasChanges','65LQCuhB'];a40_0xfc32=function(){return _0x450377;};return a40_0xfc32();}(function(_0xf4a518,_0x54f8b5){const _0x561b8c=a40_0x1e85,_0x6d3e08=_0xf4a518();while(!![]){try{const _0x49fed1=parseInt(_0x561b8c(0x1fc))/0x1+parseInt(_0x561b8c(0x1d9))/0x2+-parseInt(_0x561b8c(0x1e1))/0x3*(-parseInt(_0x561b8c(0x1ff))/0x4)+-parseInt(_0x561b8c(0x1f7))/0x5*(parseInt(_0x561b8c(0x210))/0x6)+-parseInt(_0x561b8c(0x20d))/0x7*(parseInt(_0x561b8c(0x1f3))/0x8)+parseInt(_0x561b8c(0x213))/0x9*(parseInt(_0x561b8c(0x1d7))/0xa)+parseInt(_0x561b8c(0x1cf))/0xb*(-parseInt(_0x561b8c(0x1fd))/0xc);if(_0x49fed1===_0x54f8b5)break;else _0x6d3e08['push'](_0x6d3e08['shift']());}catch(_0x13e8dc){_0x6d3e08['push'](_0x6d3e08['shift']());}}}(a40_0xfc32,0x60e80));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a40_0x1e85(_0x2ae6ef,_0x3d7391){_0x2ae6ef=_0x2ae6ef-0x1c5;const _0xfc3276=a40_0xfc32();let _0x1e8522=_0xfc3276[_0x2ae6ef];return _0x1e8522;}import a40_0x2e7528 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x52efa5 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_0x3d9a7e(0x203)]=a40_0x3d9a7e(0x1f8);[a40_0x3d9a7e(0x1c5)]=a40_0x3d9a7e(0x1e2);async['execute'](_0x1fdd92){const _0x23ee08=a40_0x3d9a7e,{options:_0x5af5cd,args:_0x58adee,tdx:_0x243af7}=_0x1fdd92,_0x43dbf8=_0x5af5cd,_0xb81fc9=await resolveTarget({'arg':_0x58adee[0x0],'contextParent':_0x5af5cd[_0x23ee08(0x1d6)],'cwd':process[_0x23ee08(0x1e7)]()});if(!isSuccessfulResolution(_0xb81fc9))return _0xb81fc9[_0x23ee08(0x1de)]===_0x23ee08(0x1e8)?(console[_0x23ee08(0x20c)](a40_0x2e7528['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x23ee08(0x1e4)),console['error'](_0x23ee08(0x1c7)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a40_0x2e7528['red'](_0x23ee08(0x1dc)+_0xb81fc9['message']+'\x0a')),_0xb81fc9[_0x23ee08(0x1ce)]&&console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x202)](_0xb81fc9[_0x23ee08(0x1ce)]))),0x1;const _0x392f19=_0xb81fc9[_0x23ee08(0x214)],_0x4fd702=_0xb81fc9['targetDir'],_0x15fa4b=_0xb81fc9[_0x23ee08(0x1d3)]===_0x23ee08(0x1cc)?_0xb81fc9[_0x23ee08(0x1c9)]:undefined;_0x43dbf8[_0x23ee08(0x1d8)]&&(console[_0x23ee08(0x20c)](_0x23ee08(0x1f1)+_0x43dbf8[_0x23ee08(0x1f5)]),console[_0x23ee08(0x20c)]('Parent\x20segment:\x20'+_0x392f19),_0x15fa4b&&console[_0x23ee08(0x20c)]('Target\x20resource:\x20'+_0x15fa4b));const _0x554a32=await withProgressSpinner(_0x23ee08(0x1d4)+_0x392f19+'\x27...',_0x24551a=>_0x243af7[_0x23ee08(0x1dd)][_0x23ee08(0x1ef)](_0x392f19,{'targetDir':_0x4fd702,'targetResourceName':_0x15fa4b,'verbose':_0x43dbf8[_0x23ee08(0x1d8)],'progress':{'update':_0xd47b56=>{const _0x473fb4=_0x23ee08;_0x24551a[_0x473fb4(0x1e3)](_0xd47b56),_0x43dbf8[_0x473fb4(0x1d8)]&&console['error']('\x20\x20'+_0xd47b56);}}}),{'verbose':_0x43dbf8[_0x23ee08(0x1d8)]}),_0x5f743b=_0x554a32[_0x23ee08(0x1fe)];if(_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x20e)]===0x0&&_0x5f743b['counts'][_0x23ee08(0x212)]===0x0)return console[_0x23ee08(0x20c)](a40_0x2e7528['yellow'](_0x23ee08(0x1c8)+_0x5f743b[_0x23ee08(0x214)]+'\x27')),0x0;const _0x4507a7=_0x5f743b[_0x23ee08(0x20b)]['filter'](_0x18d51d=>_0x18d51d[_0x23ee08(0x206)]),_0x52241b=_0x5f743b[_0x23ee08(0x20b)]['filter'](_0x740745=>!_0x740745[_0x23ee08(0x206)]&&_0x740745[_0x23ee08(0x1f6)]),_0x40634a=_0x5f743b[_0x23ee08(0x20b)][_0x23ee08(0x1c6)](_0x5cf3ff=>!_0x5cf3ff['isNew']&&!_0x5cf3ff[_0x23ee08(0x1f6)]);console[_0x23ee08(0x20c)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5f743b[_0x23ee08(0x214)]+'\x27:'),console[_0x23ee08(0x20c)](_0x23ee08(0x1d1)+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x20e)]+_0x23ee08(0x1e0))+_0x23ee08(0x1ea)+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b[_0x23ee08(0x208)]['activations']+'\x20activations'));if(_0x5f743b['counts']['journeys']>0x0){const _0x2b5546=_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x1fb)]>_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x212)]?'\x20('+_0x5f743b[_0x23ee08(0x208)][_0x23ee08(0x1fb)]+_0x23ee08(0x217):'';console[_0x23ee08(0x20c)]('\x20\x20🗺️\x20\x20'+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b['counts'][_0x23ee08(0x212)]+_0x23ee08(0x1ec))+a40_0x2e7528[_0x23ee08(0x1fa)](_0x2b5546));}console['error']('\x20\x20'+a40_0x2e7528[_0x23ee08(0x1df)]('+\x20'+_0x4507a7[_0x23ee08(0x1e6)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x2e7528['yellow']('~\x20'+_0x52241b[_0x23ee08(0x1e6)]+_0x23ee08(0x20f))),console[_0x23ee08(0x20c)]('\x20\x20'+a40_0x2e7528['dim']('=\x20'+_0x40634a['length']+_0x23ee08(0x1e5))),console['error'](_0x23ee08(0x1f0)+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b[_0x23ee08(0x1ed)])+'\x0a');if(_0x52241b[_0x23ee08(0x1e6)]>0x0)for(const _0x850f2f of _0x52241b){console[_0x23ee08(0x20c)]('\x0aChanges\x20to\x20\x27'+_0x850f2f[_0x23ee08(0x201)]+'\x27:'),console[_0x23ee08(0x20c)]('─'[_0x23ee08(0x1cd)](0x3c)),console['error'](_0x850f2f[_0x23ee08(0x1db)]),console['error']('─'[_0x23ee08(0x1cd)](0x3c));}if(_0x43dbf8[_0x23ee08(0x215)])return console[_0x23ee08(0x20c)](a40_0x2e7528['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4507a7[_0x23ee08(0x1e6)]===0x0&&_0x52241b[_0x23ee08(0x1e6)]===0x0)return console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1df)](_0x23ee08(0x1cb))),saveSessionContext({'parent_segment':_0x5f743b['parentName']},_0x43dbf8['session']),console['error'](a40_0x2e7528[_0x23ee08(0x1df)](_0x23ee08(0x1da)+a40_0x2e7528[_0x23ee08(0x1fa)](_0x23ee08(0x20a))+_0x23ee08(0x1f4)+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b[_0x23ee08(0x214)]))),0x0;if(!_0x43dbf8[_0x23ee08(0x1e9)]){if(!isInteractive())return console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1f9)](_0x23ee08(0x1ca)),_0x23ee08(0x1d2)),console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1fa)](_0x23ee08(0x207))),0x1;const _0x120bd2=await confirmKey('Write\x20'+(_0x4507a7[_0x23ee08(0x1e6)]+_0x52241b[_0x23ee08(0x1e6)])+_0x23ee08(0x1ee));if(!_0x120bd2)return console['error'](a40_0x2e7528[_0x23ee08(0x211)](_0x23ee08(0x209)),_0x23ee08(0x200)),0x1;}for(const _0x13ac17 of _0x5f743b['files']){if(_0x13ac17[_0x23ee08(0x206)]||_0x13ac17[_0x23ee08(0x1f6)]){const _0x258822=a40_0x52efa5[_0x23ee08(0x216)](_0x13ac17[_0x23ee08(0x205)]);!existsSync(_0x258822)&&mkdirSync(_0x258822,{'recursive':!![]}),writeFileSync(_0x13ac17[_0x23ee08(0x205)],_0x13ac17[_0x23ee08(0x204)],_0x23ee08(0x1d0));}}return console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1df)](_0x23ee08(0x1eb)+(_0x4507a7[_0x23ee08(0x1e6)]+_0x52241b[_0x23ee08(0x1e6)])+_0x23ee08(0x1d5)+_0x5f743b[_0x23ee08(0x1ed)])),saveSessionContext({'parent_segment':_0x5f743b['parentName']},_0x43dbf8[_0x23ee08(0x1f2)]),console[_0x23ee08(0x20c)](a40_0x2e7528[_0x23ee08(0x1df)](_0x23ee08(0x1da)+a40_0x2e7528[_0x23ee08(0x1fa)]('parent_segment')+'\x20=\x20'+a40_0x2e7528[_0x23ee08(0x202)](_0x5f743b['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x4101b7=a41_0x32dc;(function(_0x402cba,_0x1e92fe){const _0x1bffcd=a41_0x32dc,_0x4474bf=_0x402cba();while(!![]){try{const _0x6ba306=-parseInt(_0x1bffcd(0x11d))/0x1+parseInt(_0x1bffcd(0x123))/0x2+parseInt(_0x1bffcd(0x18c))/0x3*(parseInt(_0x1bffcd(0x177))/0x4)+-parseInt(_0x1bffcd(0x111))/0x5*(-parseInt(_0x1bffcd(0x18b))/0x6)+-parseInt(_0x1bffcd(0x1a6))/0x7*(-parseInt(_0x1bffcd(0x131))/0x8)+parseInt(_0x1bffcd(0x1a5))/0x9*(-parseInt(_0x1bffcd(0x194))/0xa)+-parseInt(_0x1bffcd(0x12f))/0xb;if(_0x6ba306===_0x1e92fe)break;else _0x4474bf['push'](_0x4474bf['shift']());}catch(_0x4cd7eb){_0x4474bf['push'](_0x4474bf['shift']());}}}(a41_0x37a5,0x73e4b));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_0x16032b 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_0x32dc(_0x14db0e,_0x1faa15){_0x14db0e=_0x14db0e-0x10d;const _0x37a525=a41_0x37a5();let _0x32dc25=_0x37a525[_0x14db0e];return _0x32dc25;}function a41_0x37a5(){const _0x2078d5=['40bewibA','\x20\x20Journeys:\x20','dim','list','\x20to\x20delete','Delete\x20journey:','then','journeyBundleName','user','\x20to\x20update','/j/da/je','cwd','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','deleted','no_parent','parent_name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','1431648lOeLit','63483JMDyWN','filePath','listSegments','repeat','listFolders','execute','623275RqETsh','journeys','endsWith','Site:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','red','\x20\x20Source:\x20','cyan','getJourney','toCreate','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','folderId','172289Hdgejm','activations','type','dryRun','toString','\x20new','789596OGLgAG','yamlConfig','Changes\x20to:','/sb/da/esr','\x20\x20\x20\x20','targetDir','results','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','New\x20journey:','Fetching\x20existing\x20data...','📁\x20','paused','3329414rJBjvA','updated','216amEidT','listActivations','\x20\x20Activations:','isScoped','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','getOutputSchemaWithCache','createdSegmentIds','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','resolveParentId','helpText','data','Folders\x20to\x20create:','\x20to\x20create','Parent\x20segment:\x20','.yml','unchanged','parentSegment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Delete\x20segment:','Error\x20parsing\x20YAML:\x20','\x20changes?','errorCode','\x0aValidation\x20failed:','relationships','description','Error:\x20Directory\x20not\x20found:\x20','Changes\x20to\x20journey:','\x20activations]','segment','attributes','audienceId','/e/','Error:\x20','\x20folders\x20to\x20create','created','\x20updated','segments','journeyId','\x20changed','journeysOnly','folderPath','delete','changed','state','\x0aPush\x20summary\x20for\x20\x27','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','buildUserMaps','filter','site','join','length','diff','nameToType','/app/ps/','idToName','get','listJourneysWithDetailsFromParentSegment','\x20created','folders','verbose','existingSegment','yellow','green','name','connection','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x0a✔\x20Push\x20complete','16YYGxqs','map','blue','Source\x20directory:\x20','Fetching\x20existing\x20activations...','journeyBundleId','\x27...','isNew','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Aborted.','journey','message','push','toDelete','error','nameToId','segmentFolderId','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','parentFolder','set','18FkAwfl','429243cHnWPT','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment\x20or\x20journey','new','updatedAt','toUpdate','all','\x20deleted'];a41_0x37a5=function(){return _0x2078d5;};return a41_0x37a5();}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_0x4101b7(0x14a)]=a41_0x4101b7(0x17f);async[a41_0x4101b7(0x110)](_0x400bc9){const _0x3912b4=a41_0x4101b7,{options:_0x3a5d00,args:_0x260acb,tdx:_0x4c25a0}=_0x400bc9,_0x5c4470=_0x3a5d00,_0x54b18f=await resolveTarget({'arg':_0x260acb[0x0],'contextParent':_0x3a5d00[_0x3912b4(0x142)],'cwd':process[_0x3912b4(0x19f)]()});if(!isSuccessfulResolution(_0x54b18f))return _0x54b18f[_0x3912b4(0x147)]===_0x3912b4(0x1a2)?(console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x171)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3912b4(0x185)](_0x3912b4(0x175)),console[_0x3912b4(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[_0x3912b4(0x185)](_0x3912b4(0x1a4))):(console['error'](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x152)+_0x54b18f[_0x3912b4(0x182)]+'\x0a')),_0x54b18f['helpText']&&console['error'](a41_0x16032b['cyan'](_0x54b18f[_0x3912b4(0x13b)]))),0x1;if(_0x54b18f['type']===_0x3912b4(0x1a3))return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)]('Error:\x20Directory\x20not\x20found:\x20'+_0x54b18f['targetDir']+'\x0a')),console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x118)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x546694=_0x54b18f['parentName'],_0x3d5af1=_0x54b18f[_0x3912b4(0x128)],_0xc5930c=_0x54b18f[_0x3912b4(0x11f)]==='file'?_0x54b18f[_0x3912b4(0x1a7)]:undefined,_0x320626=getScopedDetails(_0x54b18f),_0xee0fdd=_0x320626?.[_0x3912b4(0x134)]??![],_0xe097c8=_0x320626?.['scopedFolderPath']??'';if(!existsSync(_0x3d5af1))return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x14b)+_0x3d5af1+'\x0a')),console[_0x3912b4(0x185)](a41_0x16032b['cyan'](_0x3912b4(0x115))),0x1;_0x5c4470[_0x3912b4(0x16f)]&&(console[_0x3912b4(0x185)](_0x3912b4(0x114)+_0x5c4470['site']),console[_0x3912b4(0x185)](_0x3912b4(0x13f)+_0x546694),console[_0x3912b4(0x185)](_0x3912b4(0x17a)+_0x3d5af1),_0xee0fdd&&console[_0x3912b4(0x185)]('Scoped\x20to\x20folder:\x20'+_0xe097c8));const _0xb7c92=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x546694+_0x3912b4(0x17d),()=>_0x4c25a0['segment'][_0x3912b4(0x13a)](_0x546694),{'verbose':_0x5c4470[_0x3912b4(0x16f)]}),_0x59e07f=_0xb7c92[_0x3912b4(0x13c)],{parentSegmentResult:_0x3151e2,segmentsResult:_0x5a3154,foldersResult:_0x1abfb9,journeysWithDetailsResult:_0x5eb72c,userMaps:_0x14a8b5}=await withSpinner(_0x3912b4(0x12c),async()=>{const _0x53f183=_0x3912b4,[_0x2b3c05,_0x447a33,_0x435ddf,_0x34a2cd,_0x29f788]=await Promise[_0x53f183(0x192)]([_0x4c25a0['segment']['getParent'](_0x59e07f),_0x4c25a0[_0x53f183(0x14e)][_0x53f183(0x10d)](_0x59e07f),_0x4c25a0[_0x53f183(0x14e)][_0x53f183(0x10f)](_0x59e07f),_0x4c25a0[_0x53f183(0x181)][_0x53f183(0x16c)](_0x59e07f,{'includeAllVersions':!![]}),_0x4c25a0[_0x53f183(0x19c)][_0x53f183(0x162)]()]);return{'parentSegmentResult':_0x2b3c05,'segmentsResult':_0x447a33,'foldersResult':_0x435ddf,'journeysWithDetailsResult':_0x34a2cd,'userMaps':_0x29f788};},{'verbose':_0x5c4470[_0x3912b4(0x16f)]})[_0x3912b4(0x19a)](_0x140a58=>_0x140a58[_0x3912b4(0x13c)]),_0x4ccc34=_0x3151e2,_0x542566=extractRootFolderId(_0x4ccc34),_0x205488=_0x5a3154,_0x6843d3=_0x1abfb9,{journeys:_0x481253,activationStepsById:_0x35f7ef}=_0x5eb72c,_0xcd39d4=new Map(_0x481253[_0x3912b4(0x178)](_0x5ec839=>[_0x5ec839['id'],_0x5ec839])),_0xbe747f=_0x481253['map'](_0x3f32ea=>({'id':_0x3f32ea['id'],'name':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x173)],'journeyBundleName':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x19b)]||'','journeyBundleId':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x17c)]||'','versionNumber':_0x3f32ea[_0x3912b4(0x14f)]['versionNumber'],'description':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x14a)],'state':_0x3f32ea['attributes'][_0x3912b4(0x15d)],'paused':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x12e)],'audienceId':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x150)],'folderId':_0x3f32ea[_0x3912b4(0x149)]?.[_0x3912b4(0x189)]?.[_0x3912b4(0x13c)]?.['id'],'createdAt':_0x3f32ea[_0x3912b4(0x14f)]['createdAt'],'updatedAt':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x190)]})),{emailToId:_0xc3e4e6,idToEmail:_0x40e2b7}=_0x14a8b5,_0x6d5454=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x38ab82=_0x3912b4,_0x366c96=await _0x4c25a0[_0x38ab82(0x174)][_0x38ab82(0x197)]();return buildConnectionMaps(_0x366c96);},{'verbose':_0x5c4470[_0x3912b4(0x16f)]})[_0x3912b4(0x19a)](_0x411997=>_0x411997[_0x3912b4(0x13c)]),_0x4196cb=_0x6d5454[_0x3912b4(0x186)],_0x46bfc0=_0x6d5454[_0x3912b4(0x16a)],_0x4b0c3d=_0x6d5454[_0x3912b4(0x168)],_0x4cb52e={'emailToIdMap':_0xc3e4e6,'connectionNameToIdMap':_0x4196cb,'connectionNameToTypeMap':_0x4b0c3d,'getSchema':_0x344742=>_0x4c25a0[_0x3912b4(0x174)][_0x3912b4(0x136)](_0x344742)};let {pathToId:_0x238705,idToPath:_0x5643e1}=buildFolderMaps(_0x6843d3);const _0x49737f=buildSegmentLookupMap(_0x205488,_0x5643e1),_0x100ee1=buildSegmentNameToIdMap(_0x205488),_0x525879=buildJourneyBundleLookupMap(_0xbe747f,_0x5643e1);let _0x309b58;if(_0xc5930c){if(!_0xc5930c[_0x3912b4(0x113)](_0x3912b4(0x140))&&!_0xc5930c[_0x3912b4(0x113)]('.yaml'))return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x188)+_0xc5930c+'\x0a')),0x1;_0x309b58=[_0xc5930c];}else _0x309b58=findYamlFiles(_0x3d5af1);if(_0x309b58['length']===0x0)return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x3d5af1+'\x0a')),console[_0x3912b4(0x185)](a41_0x16032b['cyan'](_0x3912b4(0x139))),0x1;let _0x2af00c,_0x2d4a6b;try{const _0x467be0=parseAndClassifyYamlFiles(_0x309b58,_0x3d5af1,{'skipSegments':_0x5c4470[_0x3912b4(0x159)]});_0x2af00c=_0x467be0['segments'],_0x2d4a6b=_0x467be0[_0x3912b4(0x112)];const _0xba3ab5=validateParsedFiles(_0x467be0,_0x3d5af1);if(_0xba3ab5[_0x3912b4(0x166)]>0x0)return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x148))),console[_0x3912b4(0x185)](formatValidationErrors(_0xba3ab5)),console[_0x3912b4(0x185)](a41_0x16032b['yellow'](_0x3912b4(0x135))),0x1;}catch(_0x33305a){return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x145)+(_0x33305a instanceof Error?_0x33305a[_0x3912b4(0x182)]:_0x33305a))),0x1;}if(_0x2af00c[_0x3912b4(0x166)]===0x0&&_0x2d4a6b[_0x3912b4(0x166)]===0x0){const _0x4f2afc=_0x5c4470['journeysOnly']?_0x3912b4(0x181):_0x3912b4(0x18e);return console[_0x3912b4(0x185)](a41_0x16032b['yellow']('No\x20'+_0x4f2afc+'\x20YAML\x20files\x20found')),0x0;}const _0xf7fde=new Map();_0x205488['length']>0x0&&!_0x5c4470['journeysOnly']&&await withSpinner(_0x3912b4(0x17b),async()=>{await batchAsync(_0x205488,async _0x160046=>{const _0x89ee65=a41_0x32dc,_0x57d11e=await _0x4c25a0[_0x89ee65(0x14e)][_0x89ee65(0x132)](_0x59e07f,_0x160046['id']);_0xf7fde[_0x89ee65(0x18a)](_0x160046['id'],_0x57d11e);});},{'verbose':_0x5c4470[_0x3912b4(0x16f)]});const {segmentFiles:_0x19906e,foldersToCreate:_0x15be37}=await prepareSegmentFiles(_0x2af00c,{'segmentByFolderAndName':_0x49737f,'activationsBySegmentId':_0xf7fde,'folderPathToId':_0x238705,'idToEmailMap':_0x40e2b7,'connectionIdToNameMap':_0x46bfc0},_0x4cb52e,_0xee0fdd,_0xe097c8),_0x3d4d47=_0xc5930c?[]:findSegmentsToDelete(_0x205488,_0x2af00c['map'](({yamlConfig:_0x5d2138,folderPath:_0xc4cf2d})=>({'yamlConfig':_0x5d2138,'folderPath':resolveTDFolderPath(_0xc4cf2d,_0xee0fdd,_0xe097c8)})),_0x5643e1,_0xe097c8,_0xee0fdd),{journeyFiles:_0x5f14a4,foldersToCreate:_0x2ceb27}=await withProgressSpinner('Preparing\x20journeys...',async _0x1aa84e=>prepareJourneyFiles(_0x2d4a6b,{'fetchJourney':async _0x278227=>_0x4c25a0[_0x3912b4(0x181)][_0x3912b4(0x119)](_0x278227[_0x3912b4(0x157)]),'journeyBundlesByFolderAndName':_0x525879,'folderPathToId':_0x238705,'idToEmailMap':_0x40e2b7,'connectionIdToNameMap':_0x46bfc0,'existingSegments':_0x205488,'parentId':_0x59e07f,'deps':_0x4c25a0,'progress':{'update':_0x13ffdf=>{const _0x429f2a=_0x3912b4;_0x1aa84e['setPhase'](_0x13ffdf),_0x5c4470[_0x429f2a(0x16f)]&&console[_0x429f2a(0x185)]('\x20\x20'+_0x13ffdf);}},'journeyById':_0xcd39d4,'activationStepsById':_0x35f7ef},_0xee0fdd,_0xe097c8),{'verbose':_0x5c4470['verbose']})[_0x3912b4(0x19a)](_0x16314c=>_0x16314c[_0x3912b4(0x13c)]);for(const _0x1102c7 of _0x2ceb27){_0x15be37['add'](_0x1102c7);}const _0x429fe9=_0xc5930c?[]:findJourneysToDelete(_0xbe747f,_0x2d4a6b[_0x3912b4(0x178)](({yamlConfig:_0x1df5e4,folderPath:_0x34524f})=>({'yamlConfig':_0x1df5e4,'folderPath':resolveTDFolderPath(_0x34524f,_0xee0fdd,_0xe097c8)})),_0x5643e1,_0xe097c8,_0xee0fdd),_0x4d415c=calculatePushStats(_0x19906e,_0x5f14a4,_0x15be37,_0x3d4d47,_0x429fe9,!!_0x5c4470[_0x3912b4(0x15b)],!!_0x5c4470[_0x3912b4(0x159)]),_0x5284a6=_0x4d415c['segments'][_0x3912b4(0x18f)],_0x2fb3ac=_0x4d415c[_0x3912b4(0x156)][_0x3912b4(0x15c)],_0xe9f5d=_0x4d415c['segments']['unchanged'],_0x24985f=_0x4d415c[_0x3912b4(0x156)]['toDelete'],_0x6098e8=_0x4d415c[_0x3912b4(0x16e)][_0x3912b4(0x11a)],_0x4eb5ba=_0x4d415c[_0x3912b4(0x112)][_0x3912b4(0x18f)],_0x47395a=_0x4d415c['journeys'][_0x3912b4(0x15c)],_0x79b1ca=_0x4d415c[_0x3912b4(0x112)][_0x3912b4(0x141)],_0x26f8b5=_0x4d415c['journeys'][_0x3912b4(0x184)],_0x3e4c52=_0x4d415c[_0x3912b4(0x11e)][_0x3912b4(0x192)],_0x48f7da=_0x4d415c[_0x3912b4(0x11e)][_0x3912b4(0x11a)],_0xfcbcc4=_0x4d415c[_0x3912b4(0x11e)][_0x3912b4(0x191)],_0x3c9e7d=_0x4d415c[_0x3912b4(0x11e)][_0x3912b4(0x184)];console[_0x3912b4(0x185)](_0x3912b4(0x15e)+_0x546694+'\x27:');_0x6098e8[_0x3912b4(0x166)]>0x0&&console[_0x3912b4(0x185)]('\x20\x20'+a41_0x16032b[_0x3912b4(0x179)](_0x3912b4(0x12d)+_0x6098e8['length']+_0x3912b4(0x153)));if(!_0x5c4470[_0x3912b4(0x159)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b['green']('+\x20'+_0x5284a6[_0x3912b4(0x166)]+_0x3912b4(0x122))),console['error'](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x171)]('~\x20'+_0x2fb3ac['length']+_0x3912b4(0x158)));if(_0x24985f[_0x3912b4(0x166)]>0x0)console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x116)]('-\x20'+_0x24985f['length']+_0x3912b4(0x198)));else _0x3d4d47[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x15b)]&&console['error'](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x196)](_0x3d4d47['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x196)]('=\x20'+_0xe9f5d[_0x3912b4(0x166)]+'\x20unchanged'));}if(_0x5f14a4[_0x3912b4(0x166)]>0x0||_0x429fe9[_0x3912b4(0x166)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b['green']('+\x20'+_0x4eb5ba[_0x3912b4(0x166)]+_0x3912b4(0x122))),console['error']('\x20\x20\x20\x20'+a41_0x16032b[_0x3912b4(0x171)]('~\x20'+_0x47395a[_0x3912b4(0x166)]+_0x3912b4(0x158)));if(_0x26f8b5[_0x3912b4(0x166)]>0x0)console[_0x3912b4(0x185)]('\x20\x20\x20\x20'+a41_0x16032b[_0x3912b4(0x116)]('-\x20'+_0x26f8b5[_0x3912b4(0x166)]+'\x20to\x20delete'));else _0x429fe9[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x15b)]&&console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x196)](_0x429fe9['length']+_0x3912b4(0x18d)));console['error'](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x196)]('=\x20'+_0x79b1ca[_0x3912b4(0x166)]+'\x20unchanged'));}_0x3e4c52['length']>0x0&&!_0x5c4470[_0x3912b4(0x159)]&&(console[_0x3912b4(0x185)](''),console[_0x3912b4(0x185)](_0x3912b4(0x133)),_0x48f7da[_0x3912b4(0x166)]>0x0&&console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x172)]('+\x20'+_0x48f7da[_0x3912b4(0x166)]+_0x3912b4(0x13e))),_0xfcbcc4['length']>0x0&&console[_0x3912b4(0x185)]('\x20\x20\x20\x20'+a41_0x16032b['yellow']('~\x20'+_0xfcbcc4[_0x3912b4(0x166)]+_0x3912b4(0x19d))),_0x3c9e7d[_0x3912b4(0x166)]>0x0&&console['error'](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x116)]('-\x20'+_0x3c9e7d['length']+_0x3912b4(0x198))));console['error'](_0x3912b4(0x117)+a41_0x16032b[_0x3912b4(0x118)](_0x3d5af1)+'\x0a');if(_0x6098e8['length']>0x0){console[_0x3912b4(0x185)](_0x3912b4(0x13d));for(const _0x2a9a99 of _0x6098e8){console[_0x3912b4(0x185)]('\x20\x20'+a41_0x16032b[_0x3912b4(0x179)]('+')+'\x20'+_0x2a9a99);}console['error']('');}if(_0x5284a6[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x159)])for(const _0x4112aa of _0x5284a6){const _0x310819=_0x4112aa[_0x3912b4(0x15a)]?_0x4112aa[_0x3912b4(0x15a)]+'/'+_0x4112aa[_0x3912b4(0x124)][_0x3912b4(0x173)]:_0x4112aa[_0x3912b4(0x124)][_0x3912b4(0x173)],_0x1eae33=_0x4112aa['yamlConfig'][_0x3912b4(0x11e)]?.[_0x3912b4(0x166)]||0x0,_0x461865=_0x1eae33>0x0?a41_0x16032b[_0x3912b4(0x196)]('\x20['+_0x1eae33+_0x3912b4(0x14d)):'';console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b[_0x3912b4(0x172)]('New\x20segment:')+'\x20'+_0x310819+_0x461865),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c)),_0x4112aa[_0x3912b4(0x167)]&&console[_0x3912b4(0x185)](_0x4112aa[_0x3912b4(0x167)]),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}if(_0x24985f[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x159)])for(const _0x4a9b25 of _0x24985f){const _0x5597c2=_0x4a9b25['segmentFolderId']?_0x5643e1[_0x3912b4(0x16b)](_0x4a9b25[_0x3912b4(0x187)][_0x3912b4(0x121)]())||'':'',_0x35c752=_0x5597c2?_0x5597c2+'/'+_0x4a9b25[_0x3912b4(0x173)]:_0x4a9b25[_0x3912b4(0x173)],_0x3d5b33=_0xf7fde[_0x3912b4(0x16b)](_0x4a9b25['id'])||[],_0x239b10=_0x3d5b33[_0x3912b4(0x166)]>0x0?a41_0x16032b['dim']('\x20['+_0x3d5b33[_0x3912b4(0x166)]+_0x3912b4(0x14d)):'';console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b['red'](_0x3912b4(0x144))+'\x20'+_0x35c752+_0x239b10),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));const _0x1cc559=segmentWithActivationsToYaml(_0x4a9b25,_0x3d5b33,undefined,_0x40e2b7,_0x46bfc0),_0x59b7b0=segmentToYamlString(_0x1cc559),_0x349add=generateDiff(_0x59b7b0,'');console[_0x3912b4(0x185)](formatDiffWithColors(_0x349add)),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}const _0x9f3f11=_0x19906e[_0x3912b4(0x163)](_0x5ac26c=>!_0x5ac26c[_0x3912b4(0x17e)]&&_0x5ac26c[_0x3912b4(0x167)]);if(_0x9f3f11[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x159)])for(const _0x392068 of _0x9f3f11){const _0x1a4edc=_0x392068[_0x3912b4(0x15a)]?_0x392068['folderPath']+'/'+_0x392068[_0x3912b4(0x124)][_0x3912b4(0x173)]:_0x392068[_0x3912b4(0x124)][_0x3912b4(0x173)];console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b[_0x3912b4(0x171)](_0x3912b4(0x125))+'\x20'+_0x1a4edc),console['error']('─'[_0x3912b4(0x10e)](0x3c)),console[_0x3912b4(0x185)](_0x392068['diff']),console['error']('─'['repeat'](0x3c));}if(_0x4eb5ba[_0x3912b4(0x166)]>0x0)for(const _0xaf81fa of _0x4eb5ba){const _0x3c6147=_0xaf81fa[_0x3912b4(0x15a)]?_0xaf81fa['folderPath']+'/'+_0xaf81fa[_0x3912b4(0x124)][_0x3912b4(0x173)]:_0xaf81fa[_0x3912b4(0x124)]['name'];console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b[_0x3912b4(0x172)](_0x3912b4(0x12b))+'\x20'+_0x3c6147),console['error']('─'[_0x3912b4(0x10e)](0x3c)),_0xaf81fa[_0x3912b4(0x167)]&&console[_0x3912b4(0x185)](_0xaf81fa[_0x3912b4(0x167)]),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}const _0x4039d8=_0x5f14a4[_0x3912b4(0x163)](_0x3e3e3a=>!_0x3e3e3a[_0x3912b4(0x17e)]&&_0x3e3e3a['diff']);if(_0x4039d8['length']>0x0)for(const _0x1eedb5 of _0x4039d8){const _0x36036b=_0x1eedb5[_0x3912b4(0x15a)]?_0x1eedb5[_0x3912b4(0x15a)]+'/'+_0x1eedb5['yamlConfig'][_0x3912b4(0x173)]:_0x1eedb5[_0x3912b4(0x124)][_0x3912b4(0x173)];console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b[_0x3912b4(0x171)](_0x3912b4(0x14c))+'\x20'+_0x36036b),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c)),console[_0x3912b4(0x185)](_0x1eedb5[_0x3912b4(0x167)]),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}if(_0x26f8b5[_0x3912b4(0x166)]>0x0)for(const _0x2ee7b4 of _0x26f8b5){const _0x5ed9c4=_0x2ee7b4[_0x3912b4(0x11c)]?_0x5643e1[_0x3912b4(0x16b)](_0x2ee7b4[_0x3912b4(0x11c)])||'':'',_0x3783de=_0x5ed9c4?_0x5ed9c4+'/'+_0x2ee7b4[_0x3912b4(0x19b)]:_0x2ee7b4['journeyBundleName'];console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b['red'](_0x3912b4(0x199))+'\x20'+_0x3783de),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c)),console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)]('(Journey\x20will\x20be\x20deleted)')),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}if(_0x5c4470[_0x3912b4(0x120)])return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x171)](_0x3912b4(0x1a0))),0x0;const _0x22b2e6=_0x5c4470['journeysOnly']?![]:_0x5284a6[_0x3912b4(0x166)]>0x0||_0x2fb3ac['length']>0x0||_0x24985f[_0x3912b4(0x166)]>0x0,_0x117b80=_0x4eb5ba['length']>0x0||_0x47395a[_0x3912b4(0x166)]>0x0||_0x26f8b5[_0x3912b4(0x166)]>0x0,_0x4b5b95=_0x5c4470[_0x3912b4(0x159)]?![]:_0x3e4c52[_0x3912b4(0x166)]>0x0,_0x1e0abf=_0x6098e8[_0x3912b4(0x166)]>0x0;if(!_0x22b2e6&&!_0x117b80&&!_0x4b5b95&&!_0x1e0abf){const _0x2059f2=_0x5c4470[_0x3912b4(0x159)]?_0x3912b4(0x161):_0x3912b4(0x11b);console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x172)](_0x2059f2));if(_0xc5930c&&_0xe9f5d['length']===0x1){const _0x3c6ac8=_0xe9f5d[0x0];if(_0x3c6ac8[_0x3912b4(0x170)]?.['id']){const _0x369fd2=getConsoleNextUrl(_0x5c4470[_0x3912b4(0x164)],'/app/ps/'+_0x59e07f+'/e/'+_0x3c6ac8['existingSegment']['id']+_0x3912b4(0x126));console['error'](_0x3912b4(0x12a)+a41_0x16032b[_0x3912b4(0x118)](_0x369fd2));}}if(_0xc5930c&&_0x79b1ca['length']===0x1){const _0x279f1e=_0x79b1ca[0x0];if(_0x279f1e['existingJourney']?.['id']){const _0xa20022=getConsoleNextUrl(_0x5c4470[_0x3912b4(0x164)],'/app/ps/'+_0x59e07f+'/e/'+_0x279f1e['existingJourney']['id']+_0x3912b4(0x19e));console[_0x3912b4(0x185)]('\x20\x20'+a41_0x16032b['cyan'](_0xa20022));}}return 0x0;}const _0x30cf6d=_0x5c4470['journeysOnly']?_0x4eb5ba[_0x3912b4(0x166)]+_0x47395a[_0x3912b4(0x166)]+_0x26f8b5[_0x3912b4(0x166)]+_0x6098e8['length']:_0x5284a6[_0x3912b4(0x166)]+_0x2fb3ac[_0x3912b4(0x166)]+_0x24985f['length']+_0x4eb5ba['length']+_0x47395a['length']+_0x26f8b5[_0x3912b4(0x166)]+_0x6098e8[_0x3912b4(0x166)]+_0x3e4c52[_0x3912b4(0x166)];if(!_0x5c4470[_0x3912b4(0x15f)]&&_0x30cf6d>0x0){if(!isInteractive())return console['error'](a41_0x16032b['red']('\x0aError:'),_0x3912b4(0x160)),console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x196)](_0x3912b4(0x143))),0x1;const _0x9d587c=await confirmKey('Push\x20'+_0x30cf6d+_0x3912b4(0x146));if(!_0x9d587c)return console[_0x3912b4(0x185)](a41_0x16032b['yellow'](_0x3912b4(0x180))),0x1;}const _0x2e8ff9={'withProgress':async(_0x29d9cb,_0x311650)=>{const _0x4114e1=_0x3912b4,_0x22e497=await withSpinner(_0x29d9cb,_0x311650,{'verbose':_0x5c4470[_0x4114e1(0x16f)]});return{'data':_0x22e497[_0x4114e1(0x13c)]};},'logInfo':_0x5b3b34=>console['error'](a41_0x16032b[_0x3912b4(0x179)]('✔\x20'+_0x5b3b34)),'logSuccess':_0x70beb9=>console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x172)]('✔\x20'+_0x70beb9)),'logWarning':_0x4ec15e=>console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x171)]('⚠\x20'+_0x4ec15e)),'logDeleted':_0x3a6946=>console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)]('✔\x20'+_0x3a6946))},_0x1ea448={'segment':_0x4c25a0[_0x3912b4(0x14e)],'journey':_0x4c25a0[_0x3912b4(0x181)],'user':_0x4c25a0[_0x3912b4(0x19c)],'connection':_0x4c25a0[_0x3912b4(0x174)]};_0x6098e8[_0x3912b4(0x166)]>0x0&&(_0x238705=await executePushFolders(_0x1ea448,_0x6098e8,_0x238705,{'parentId':_0x59e07f},_0x2e8ff9));const _0x3776b8={'rootFolderId':_0x542566,'folderPathToId':_0x238705,'folderIdToPath':_0x5643e1,'segmentNameToId':_0x100ee1,'activationsBySegmentId':_0xf7fde,'emailToIdMap':_0xc3e4e6,'idToEmailMap':_0x40e2b7,'connectionNameToIdMap':_0x6d5454[_0x3912b4(0x186)],'connectionIdToNameMap':_0x6d5454[_0x3912b4(0x16a)],'connectionNameToTypeMap':_0x4b0c3d},_0x517735=await executePushSegments(_0x1ea448,_0x5c4470[_0x3912b4(0x159)]?[]:_0x19906e,_0x3776b8,{'parentId':_0x59e07f},_0x2e8ff9),_0x5dcb7d=_0x517735[_0x3912b4(0x154)],_0x446900=_0x517735[_0x3912b4(0x130)],_0x23a8f3=_0x517735[_0x3912b4(0x11e)][_0x3912b4(0x154)],_0x2a1da4=_0x517735[_0x3912b4(0x11e)]['updated'],_0x1fa8d4=_0x517735[_0x3912b4(0x11e)][_0x3912b4(0x1a1)];let _0x2f7cfe;if(_0xc5930c&&_0x19906e[_0x3912b4(0x166)]===0x1){const _0x2070d6=_0x19906e[0x0];_0x2f7cfe=_0x2070d6[_0x3912b4(0x170)]?.['id']??_0x517735[_0x3912b4(0x137)][_0x3912b4(0x16b)](_0x2070d6[_0x3912b4(0x124)]['name']);}const _0x20f408=await executePushSegmentDeletions(_0x1ea448,_0x5c4470[_0x3912b4(0x159)]?[]:_0x24985f,_0x2e8ff9);let _0x30597a=0x0,_0x23e246=0x0,_0x5ef106=0x0;const _0x142cf7=new Map(_0x100ee1);for(const [_0x4a349b,_0x54bd71]of _0x517735[_0x3912b4(0x137)]){_0x142cf7[_0x3912b4(0x18a)](_0x4a349b,_0x54bd71);}if(_0x5f14a4[_0x3912b4(0x166)]>0x0){const _0x302885={..._0x3776b8,'segmentNameToId':_0x142cf7,'existingSegments':_0x205488,'activationContext':_0x4cb52e},_0x3bdee4=await executePushJourneys(_0x1ea448,_0x5f14a4,_0x302885,{'parentId':_0x59e07f,'rootFolderId':_0x542566,'verbose':_0x5c4470[_0x3912b4(0x16f)]},_0x2e8ff9);_0x30597a=_0x3bdee4['created'],_0x23e246=_0x3bdee4[_0x3912b4(0x130)];if(_0xc5930c&&_0x3bdee4[_0x3912b4(0x129)]['length']===0x1){const _0x18aa63=_0x3bdee4[_0x3912b4(0x129)][0x0];if(_0x18aa63[_0x3912b4(0x157)]){const _0x24663f=getConsoleNextUrl(_0x5c4470['site'],_0x3912b4(0x169)+_0x59e07f+_0x3912b4(0x151)+_0x18aa63[_0x3912b4(0x157)]+_0x3912b4(0x19e));console[_0x3912b4(0x185)]('\x20\x20'+a41_0x16032b['cyan'](_0x24663f));}}}for(const _0x334b0b of _0x26f8b5){console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x171)](_0x3912b4(0x138)+_0x334b0b[_0x3912b4(0x19b)])),_0x5ef106++;}const _0x8a11a1=[];if(_0x5dcb7d>0x0)_0x8a11a1[_0x3912b4(0x183)](_0x5dcb7d+_0x3912b4(0x16d));if(_0x446900>0x0)_0x8a11a1[_0x3912b4(0x183)](_0x446900+_0x3912b4(0x155));if(_0x20f408>0x0)_0x8a11a1[_0x3912b4(0x183)](_0x20f408+_0x3912b4(0x193));const _0x16c7aa=[];if(_0x30597a>0x0)_0x16c7aa['push'](_0x30597a+_0x3912b4(0x16d));if(_0x23e246>0x0)_0x16c7aa[_0x3912b4(0x183)](_0x23e246+'\x20updated');if(_0x5ef106>0x0)_0x16c7aa[_0x3912b4(0x183)](_0x5ef106+'\x20deleted');const _0x3cc167=[];if(_0x23a8f3>0x0)_0x3cc167[_0x3912b4(0x183)](_0x23a8f3+_0x3912b4(0x16d));if(_0x2a1da4>0x0)_0x3cc167[_0x3912b4(0x183)](_0x2a1da4+_0x3912b4(0x155));if(_0x1fa8d4>0x0)_0x3cc167[_0x3912b4(0x183)](_0x1fa8d4+_0x3912b4(0x193));console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x172)](_0x3912b4(0x176)));_0x8a11a1[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x159)]&&console[_0x3912b4(0x185)]('\x20\x20Segments:\x20'+_0x8a11a1['join'](',\x20'));_0x16c7aa[_0x3912b4(0x166)]>0x0&&console[_0x3912b4(0x185)](_0x3912b4(0x195)+_0x16c7aa[_0x3912b4(0x165)](',\x20'));_0x3cc167[_0x3912b4(0x166)]>0x0&&!_0x5c4470['journeysOnly']&&console[_0x3912b4(0x185)]('\x20\x20Activations:\x20'+_0x3cc167[_0x3912b4(0x165)](',\x20'));if(_0x2f7cfe){const _0x3a0fd1=getConsoleNextUrl(_0x5c4470['site'],_0x3912b4(0x169)+_0x59e07f+_0x3912b4(0x151)+_0x2f7cfe+_0x3912b4(0x126));console['error'](_0x3912b4(0x12a)+a41_0x16032b[_0x3912b4(0x118)](_0x3a0fd1));}return 0x0;}}
1
+ const a41_0x440e00=a41_0x253b;(function(_0x1e8856,_0x215f51){const _0x38d19e=a41_0x253b,_0x4ad1e2=_0x1e8856();while(!![]){try{const _0x30ddc3=-parseInt(_0x38d19e(0x1c9))/0x1*(parseInt(_0x38d19e(0x18b))/0x2)+-parseInt(_0x38d19e(0x17e))/0x3+-parseInt(_0x38d19e(0x14a))/0x4*(parseInt(_0x38d19e(0x1c4))/0x5)+-parseInt(_0x38d19e(0x1de))/0x6+parseInt(_0x38d19e(0x1d2))/0x7+parseInt(_0x38d19e(0x196))/0x8+parseInt(_0x38d19e(0x1a6))/0x9*(parseInt(_0x38d19e(0x1c6))/0xa);if(_0x30ddc3===_0x215f51)break;else _0x4ad1e2['push'](_0x4ad1e2['shift']());}catch(_0x1f7e89){_0x4ad1e2['push'](_0x4ad1e2['shift']());}}}(a41_0x2167,0xdc21c));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_0x5ab31b 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_0x440e00(0x1c5)]=a41_0x440e00(0x1c2);[a41_0x440e00(0x19e)]=a41_0x440e00(0x19d);async['execute'](_0x1c69e0){const _0x5e5a87=a41_0x440e00,{options:_0x1d0c13,args:_0x105b2a,tdx:_0x489360}=_0x1c69e0,_0x5a5bb6=_0x1d0c13,_0x20fd04=await resolveTarget({'arg':_0x105b2a[0x0],'contextParent':_0x1d0c13[_0x5e5a87(0x187)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x20fd04))return _0x20fd04[_0x5e5a87(0x1d1)]===_0x5e5a87(0x1a4)?(console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x1d9)](_0x5e5a87(0x1a9))),console[_0x5e5a87(0x198)]('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)'),console[_0x5e5a87(0x198)](_0x5e5a87(0x1cd)),console[_0x5e5a87(0x198)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1cc)+_0x20fd04['message']+'\x0a')),_0x20fd04[_0x5e5a87(0x180)]&&console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x164)](_0x20fd04[_0x5e5a87(0x180)]))),0x1;if(_0x20fd04[_0x5e5a87(0x179)]===_0x5e5a87(0x176))return console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x18c)+_0x20fd04[_0x5e5a87(0x1c7)]+'\x0a')),console[_0x5e5a87(0x198)](a41_0x5ab31b['cyan'](_0x5e5a87(0x152))),0x1;const _0x477d3c=_0x20fd04[_0x5e5a87(0x1a0)],_0x3cc1b2=_0x20fd04[_0x5e5a87(0x1c7)],_0x4d0621=_0x20fd04[_0x5e5a87(0x179)]===_0x5e5a87(0x1e5)?_0x20fd04[_0x5e5a87(0x151)]:undefined,_0x245809=getScopedDetails(_0x20fd04),_0x2652f2=_0x245809?.[_0x5e5a87(0x15a)]??![],_0x1ffe0e=_0x245809?.[_0x5e5a87(0x170)]??'';if(!existsSync(_0x3cc1b2))return console[_0x5e5a87(0x198)](a41_0x5ab31b['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x3cc1b2+'\x0a')),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x164)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x5a5bb6[_0x5e5a87(0x1b4)]&&(console['error'](_0x5e5a87(0x18d)+_0x5a5bb6[_0x5e5a87(0x16b)]),console[_0x5e5a87(0x198)](_0x5e5a87(0x192)+_0x477d3c),console[_0x5e5a87(0x198)]('Source\x20directory:\x20'+_0x3cc1b2),_0x2652f2&&console['error'](_0x5e5a87(0x14c)+_0x1ffe0e));const _0x20c776=await withSpinner(_0x5e5a87(0x1e1)+_0x477d3c+_0x5e5a87(0x186),()=>_0x489360[_0x5e5a87(0x1d4)]['resolveParentId'](_0x477d3c),{'verbose':_0x5a5bb6[_0x5e5a87(0x1b4)]}),_0x39f0f6=_0x20c776[_0x5e5a87(0x14d)],{parentSegmentResult:_0x2455ab,segmentsResult:_0x597ab0,foldersResult:_0x5f3af5,journeysWithDetailsResult:_0x379ba6,userMaps:_0xf20d1c}=await withSpinner(_0x5e5a87(0x154),async()=>{const _0x427a3b=_0x5e5a87,[_0x48caca,_0x294078,_0x51a3be,_0x5461ef,_0x49298b]=await Promise['all']([_0x489360[_0x427a3b(0x1d4)][_0x427a3b(0x167)](_0x39f0f6),_0x489360[_0x427a3b(0x1d4)][_0x427a3b(0x194)](_0x39f0f6),_0x489360[_0x427a3b(0x1d4)][_0x427a3b(0x19c)](_0x39f0f6),_0x489360[_0x427a3b(0x157)][_0x427a3b(0x185)](_0x39f0f6,{'includeAllVersions':!![]}),_0x489360['user'][_0x427a3b(0x1bb)]()]);return{'parentSegmentResult':_0x48caca,'segmentsResult':_0x294078,'foldersResult':_0x51a3be,'journeysWithDetailsResult':_0x5461ef,'userMaps':_0x49298b};},{'verbose':_0x5a5bb6['verbose']})[_0x5e5a87(0x1bd)](_0x1eeef9=>_0x1eeef9[_0x5e5a87(0x14d)]),_0x3f6a4c=_0x2455ab,_0x45ef60=extractRootFolderId(_0x3f6a4c),_0x4f3e28=_0x597ab0,_0x2906f7=_0x5f3af5,{journeys:_0x2dc08e,activationStepsById:_0x4e4d3a}=_0x379ba6,_0x5a8d58=new Map(_0x2dc08e[_0x5e5a87(0x1d6)](_0x3974c2=>[_0x3974c2['id'],_0x3974c2])),_0x12261f=_0x2dc08e['map'](_0x33dc75=>({'id':_0x33dc75['id'],'name':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x1c5)],'journeyBundleName':_0x33dc75[_0x5e5a87(0x15e)]['journeyBundleName']||'','journeyBundleId':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x14e)]||'','versionNumber':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x17b)],'description':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x19e)],'state':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x18f)],'paused':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x1bf)],'audienceId':_0x33dc75[_0x5e5a87(0x15e)]['audienceId'],'folderId':_0x33dc75['relationships']?.[_0x5e5a87(0x168)]?.[_0x5e5a87(0x14d)]?.['id'],'createdAt':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x166)],'updatedAt':_0x33dc75[_0x5e5a87(0x15e)][_0x5e5a87(0x1b1)]})),{emailToId:_0x4f33f7,idToEmail:_0x4a0140}=_0xf20d1c,_0x408c89=await withSpinner(_0x5e5a87(0x1b6),async()=>{const _0x3aedc9=_0x5e5a87,_0x55cfa2=await _0x489360[_0x3aedc9(0x17c)]['list']();return buildConnectionMaps(_0x55cfa2);},{'verbose':_0x5a5bb6[_0x5e5a87(0x1b4)]})[_0x5e5a87(0x1bd)](_0x37f15e=>_0x37f15e['data']),_0x14a64c=_0x408c89[_0x5e5a87(0x15f)],_0x232454=_0x408c89[_0x5e5a87(0x1aa)],_0x1f508c=_0x408c89[_0x5e5a87(0x162)],_0x44e27a={'emailToIdMap':_0x4f33f7,'connectionNameToIdMap':_0x14a64c,'connectionNameToTypeMap':_0x1f508c,'getSchema':_0x508ec8=>_0x489360['connection'][_0x5e5a87(0x1af)](_0x508ec8)};let {pathToId:_0x2a3878,idToPath:_0x55aaf3}=buildFolderMaps(_0x2906f7);const _0xeb6686=buildSegmentLookupMap(_0x4f3e28,_0x55aaf3),_0x3cf204=buildSegmentNameToIdMap(_0x4f3e28),_0x472b52=buildJourneyBundleLookupMap(_0x12261f,_0x55aaf3);let _0x34aa75;if(_0x4d0621){if(!_0x4d0621['endsWith'](_0x5e5a87(0x1ad))&&!_0x4d0621[_0x5e5a87(0x1a2)](_0x5e5a87(0x197)))return console['error'](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x165)+_0x4d0621+'\x0a')),0x1;_0x34aa75=[_0x4d0621];}else _0x34aa75=findYamlFiles(_0x3cc1b2);if(_0x34aa75[_0x5e5a87(0x174)]===0x0)return console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1ae)+_0x3cc1b2+'\x0a')),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x164)](_0x5e5a87(0x1ab))),0x1;let _0x4e6cf7,_0x14420c;try{const _0x66a24c=parseAndClassifyYamlFiles(_0x34aa75,_0x3cc1b2,{'skipSegments':_0x5a5bb6[_0x5e5a87(0x199)]});_0x4e6cf7=_0x66a24c[_0x5e5a87(0x1a8)],_0x14420c=_0x66a24c['journeys'];const _0x56fb74=validateParsedFiles(_0x66a24c,_0x3cc1b2);if(_0x56fb74[_0x5e5a87(0x174)]>0x0)return console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1d5))),console[_0x5e5a87(0x198)](formatValidationErrors(_0x56fb74)),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x1d9)](_0x5e5a87(0x163))),0x1;}catch(_0x23e850){return console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x159)+(_0x23e850 instanceof Error?_0x23e850[_0x5e5a87(0x195)]:_0x23e850))),0x1;}if(_0x4e6cf7[_0x5e5a87(0x174)]===0x0&&_0x14420c[_0x5e5a87(0x174)]===0x0){const _0x1f4766=_0x5a5bb6[_0x5e5a87(0x199)]?_0x5e5a87(0x157):_0x5e5a87(0x1b7);return console['error'](a41_0x5ab31b[_0x5e5a87(0x1d9)]('No\x20'+_0x1f4766+_0x5e5a87(0x16a))),0x0;}const _0x2c441f=new Map();_0x4f3e28[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6['journeysOnly']&&await withSpinner(_0x5e5a87(0x1d8),async()=>{await batchAsync(_0x4f3e28,async _0x37918f=>{const _0x563144=a41_0x253b,_0x2b2db6=await _0x489360['segment'][_0x563144(0x183)](_0x39f0f6,_0x37918f['id']);_0x2c441f['set'](_0x37918f['id'],_0x2b2db6);});},{'verbose':_0x5a5bb6[_0x5e5a87(0x1b4)]});const {segmentFiles:_0x3fd98,foldersToCreate:_0x117201}=await prepareSegmentFiles(_0x4e6cf7,{'segmentByFolderAndName':_0xeb6686,'activationsBySegmentId':_0x2c441f,'folderPathToId':_0x2a3878,'idToEmailMap':_0x4a0140,'connectionIdToNameMap':_0x232454},_0x44e27a,_0x2652f2,_0x1ffe0e),_0x2c047e=_0x4d0621?[]:findSegmentsToDelete(_0x4f3e28,_0x4e6cf7[_0x5e5a87(0x1d6)](({yamlConfig:_0x3dd6bc,folderPath:_0x310d30})=>({'yamlConfig':_0x3dd6bc,'folderPath':resolveTDFolderPath(_0x310d30,_0x2652f2,_0x1ffe0e)})),_0x55aaf3,_0x1ffe0e,_0x2652f2),{journeyFiles:_0x1f59f6,foldersToCreate:_0x58859f}=await withProgressSpinner('Preparing\x20journeys...',async _0x13c904=>prepareJourneyFiles(_0x14420c,{'fetchJourney':async _0x158e5a=>_0x489360[_0x5e5a87(0x157)]['getJourney'](_0x158e5a[_0x5e5a87(0x1a7)]),'journeyBundlesByFolderAndName':_0x472b52,'folderPathToId':_0x2a3878,'idToEmailMap':_0x4a0140,'connectionIdToNameMap':_0x232454,'existingSegments':_0x4f3e28,'parentId':_0x39f0f6,'deps':_0x489360,'progress':{'update':_0x199563=>{const _0x49d2a4=_0x5e5a87;_0x13c904[_0x49d2a4(0x19f)](_0x199563),_0x5a5bb6[_0x49d2a4(0x1b4)]&&console[_0x49d2a4(0x198)]('\x20\x20'+_0x199563);}},'journeyById':_0x5a8d58,'activationStepsById':_0x4e4d3a},_0x2652f2,_0x1ffe0e),{'verbose':_0x5a5bb6['verbose']})[_0x5e5a87(0x1bd)](_0x4a65b7=>_0x4a65b7[_0x5e5a87(0x14d)]);for(const _0x41b31d of _0x58859f){_0x117201[_0x5e5a87(0x193)](_0x41b31d);}const _0x8ac13d=_0x4d0621?[]:findJourneysToDelete(_0x12261f,_0x14420c[_0x5e5a87(0x1d6)](({yamlConfig:_0x3fd55c,folderPath:_0x41ea11})=>({'yamlConfig':_0x3fd55c,'folderPath':resolveTDFolderPath(_0x41ea11,_0x2652f2,_0x1ffe0e)})),_0x55aaf3,_0x1ffe0e,_0x2652f2),_0x241571=calculatePushStats(_0x3fd98,_0x1f59f6,_0x117201,_0x2c047e,_0x8ac13d,!!_0x5a5bb6[_0x5e5a87(0x1d0)],!!_0x5a5bb6[_0x5e5a87(0x199)]),_0x7399e1=_0x241571[_0x5e5a87(0x1a8)]['new'],_0x2e6ec7=_0x241571[_0x5e5a87(0x1a8)][_0x5e5a87(0x1e4)],_0xe79137=_0x241571[_0x5e5a87(0x1a8)]['unchanged'],_0x556800=_0x241571[_0x5e5a87(0x1a8)]['toDelete'],_0x9ed557=_0x241571['folders'][_0x5e5a87(0x1b5)],_0x1b2480=_0x241571[_0x5e5a87(0x1e2)][_0x5e5a87(0x1b2)],_0x2f9d5b=_0x241571['journeys'][_0x5e5a87(0x1e4)],_0x2d0197=_0x241571[_0x5e5a87(0x1e2)][_0x5e5a87(0x171)],_0x26fd1e=_0x241571['journeys'][_0x5e5a87(0x16d)],_0x3712d5=_0x241571[_0x5e5a87(0x160)][_0x5e5a87(0x1cb)],_0x3a217f=_0x241571['activations'][_0x5e5a87(0x1b5)],_0x357286=_0x241571['activations'][_0x5e5a87(0x155)],_0x5407e0=_0x241571['activations']['toDelete'];console['error'](_0x5e5a87(0x18e)+_0x477d3c+'\x27:');_0x9ed557[_0x5e5a87(0x174)]>0x0&&console[_0x5e5a87(0x198)]('\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x172)]('📁\x20'+_0x9ed557['length']+_0x5e5a87(0x1da)));if(!_0x5a5bb6[_0x5e5a87(0x199)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x184)]('+\x20'+_0x7399e1['length']+_0x5e5a87(0x1d7))),console[_0x5e5a87(0x198)]('\x20\x20\x20\x20'+a41_0x5ab31b['yellow']('~\x20'+_0x2e6ec7[_0x5e5a87(0x174)]+'\x20changed'));if(_0x556800[_0x5e5a87(0x174)]>0x0)console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x161)]('-\x20'+_0x556800[_0x5e5a87(0x174)]+_0x5e5a87(0x153)));else _0x2c047e[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6['delete']&&console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b['dim'](_0x2c047e[_0x5e5a87(0x174)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b['dim']('=\x20'+_0xe79137['length']+_0x5e5a87(0x15c)));}if(_0x1f59f6['length']>0x0||_0x8ac13d[_0x5e5a87(0x174)]>0x0){console['error'](_0x5e5a87(0x1ce)),console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b['green']('+\x20'+_0x1b2480['length']+'\x20new')),console[_0x5e5a87(0x198)]('\x20\x20\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x1d9)]('~\x20'+_0x2f9d5b[_0x5e5a87(0x174)]+'\x20changed'));if(_0x26fd1e[_0x5e5a87(0x174)]>0x0)console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x161)]('-\x20'+_0x26fd1e[_0x5e5a87(0x174)]+'\x20to\x20delete'));else _0x8ac13d[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6['delete']&&console['error'](_0x5e5a87(0x1d3)+a41_0x5ab31b['dim'](_0x8ac13d['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x1b8)]('=\x20'+_0x2d0197[_0x5e5a87(0x174)]+_0x5e5a87(0x15c)));}_0x3712d5[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6['journeysOnly']&&(console[_0x5e5a87(0x198)](''),console['error'](_0x5e5a87(0x190)),_0x3a217f[_0x5e5a87(0x174)]>0x0&&console[_0x5e5a87(0x198)]('\x20\x20\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x184)]('+\x20'+_0x3a217f['length']+_0x5e5a87(0x18a))),_0x357286[_0x5e5a87(0x174)]>0x0&&console['error'](_0x5e5a87(0x1d3)+a41_0x5ab31b[_0x5e5a87(0x1d9)]('~\x20'+_0x357286[_0x5e5a87(0x174)]+'\x20to\x20update')),_0x5407e0['length']>0x0&&console[_0x5e5a87(0x198)](_0x5e5a87(0x1d3)+a41_0x5ab31b['red']('-\x20'+_0x5407e0[_0x5e5a87(0x174)]+_0x5e5a87(0x153))));console[_0x5e5a87(0x198)]('\x20\x20Source:\x20'+a41_0x5ab31b['cyan'](_0x3cc1b2)+'\x0a');if(_0x9ed557[_0x5e5a87(0x174)]>0x0){console['error'](_0x5e5a87(0x17a));for(const _0x507c56 of _0x9ed557){console['error']('\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x172)]('+')+'\x20'+_0x507c56);}console[_0x5e5a87(0x198)]('');}if(_0x7399e1[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)])for(const _0x246dc3 of _0x7399e1){const _0x356091=_0x246dc3[_0x5e5a87(0x16c)]?_0x246dc3[_0x5e5a87(0x16c)]+'/'+_0x246dc3[_0x5e5a87(0x1e0)]['name']:_0x246dc3[_0x5e5a87(0x1e0)][_0x5e5a87(0x1c5)],_0x45432b=_0x246dc3['yamlConfig'][_0x5e5a87(0x160)]?.[_0x5e5a87(0x174)]||0x0,_0x2d05c1=_0x45432b>0x0?a41_0x5ab31b[_0x5e5a87(0x1b8)]('\x20['+_0x45432b+_0x5e5a87(0x173)):'';console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b[_0x5e5a87(0x184)](_0x5e5a87(0x17d))+'\x20'+_0x356091+_0x2d05c1),console['error']('─'['repeat'](0x3c)),_0x246dc3[_0x5e5a87(0x182)]&&console['error'](_0x246dc3[_0x5e5a87(0x182)]),console['error']('─'[_0x5e5a87(0x1b9)](0x3c));}if(_0x556800[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)])for(const _0x394398 of _0x556800){const _0x27fcda=_0x394398['segmentFolderId']?_0x55aaf3[_0x5e5a87(0x1cf)](_0x394398[_0x5e5a87(0x14b)][_0x5e5a87(0x19a)]())||'':'',_0x3e184c=_0x27fcda?_0x27fcda+'/'+_0x394398[_0x5e5a87(0x1c5)]:_0x394398[_0x5e5a87(0x1c5)],_0x5a976c=_0x2c441f['get'](_0x394398['id'])||[],_0x3d6348=_0x5a976c[_0x5e5a87(0x174)]>0x0?a41_0x5ab31b[_0x5e5a87(0x1b8)]('\x20['+_0x5a976c[_0x5e5a87(0x174)]+_0x5e5a87(0x173)):'';console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1df))+'\x20'+_0x3e184c+_0x3d6348),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));const _0x61d97d=segmentWithActivationsToYaml(_0x394398,_0x5a976c,undefined,_0x4a0140,_0x232454),_0x5eb0db=segmentToYamlString(_0x61d97d),_0x42607a=generateDiff(_0x5eb0db,'');console[_0x5e5a87(0x198)](formatDiffWithColors(_0x42607a)),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));}const _0x27d41b=_0x3fd98[_0x5e5a87(0x17f)](_0x49cf03=>!_0x49cf03[_0x5e5a87(0x1dd)]&&_0x49cf03[_0x5e5a87(0x182)]);if(_0x27d41b[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)])for(const _0x4d976d of _0x27d41b){const _0xffa247=_0x4d976d[_0x5e5a87(0x16c)]?_0x4d976d[_0x5e5a87(0x16c)]+'/'+_0x4d976d[_0x5e5a87(0x1e0)][_0x5e5a87(0x1c5)]:_0x4d976d[_0x5e5a87(0x1e0)]['name'];console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b[_0x5e5a87(0x1d9)](_0x5e5a87(0x169))+'\x20'+_0xffa247),console[_0x5e5a87(0x198)]('─'['repeat'](0x3c)),console[_0x5e5a87(0x198)](_0x4d976d['diff']),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));}if(_0x1b2480[_0x5e5a87(0x174)]>0x0)for(const _0x304a82 of _0x1b2480){const _0x117bba=_0x304a82[_0x5e5a87(0x16c)]?_0x304a82[_0x5e5a87(0x16c)]+'/'+_0x304a82['yamlConfig'][_0x5e5a87(0x1c5)]:_0x304a82['yamlConfig'][_0x5e5a87(0x1c5)];console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b['green'](_0x5e5a87(0x181))+'\x20'+_0x117bba),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c)),_0x304a82[_0x5e5a87(0x182)]&&console[_0x5e5a87(0x198)](_0x304a82['diff']),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));}const _0xe5a8cc=_0x1f59f6[_0x5e5a87(0x17f)](_0x3e1dfb=>!_0x3e1dfb[_0x5e5a87(0x1dd)]&&_0x3e1dfb[_0x5e5a87(0x182)]);if(_0xe5a8cc['length']>0x0)for(const _0x44c6aa of _0xe5a8cc){const _0x41f2da=_0x44c6aa[_0x5e5a87(0x16c)]?_0x44c6aa[_0x5e5a87(0x16c)]+'/'+_0x44c6aa[_0x5e5a87(0x1e0)][_0x5e5a87(0x1c5)]:_0x44c6aa['yamlConfig'][_0x5e5a87(0x1c5)];console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b[_0x5e5a87(0x1d9)]('Changes\x20to\x20journey:')+'\x20'+_0x41f2da),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c)),console['error'](_0x44c6aa[_0x5e5a87(0x182)]),console['error']('─'[_0x5e5a87(0x1b9)](0x3c));}if(_0x26fd1e[_0x5e5a87(0x174)]>0x0)for(const _0x392995 of _0x26fd1e){const _0x1f8f0d=_0x392995[_0x5e5a87(0x189)]?_0x55aaf3[_0x5e5a87(0x1cf)](_0x392995[_0x5e5a87(0x189)])||'':'',_0x5a0dbd=_0x1f8f0d?_0x1f8f0d+'/'+_0x392995[_0x5e5a87(0x1c8)]:_0x392995[_0x5e5a87(0x1c8)];console[_0x5e5a87(0x198)]('\x0a'+a41_0x5ab31b['red']('Delete\x20journey:')+'\x20'+_0x5a0dbd),console[_0x5e5a87(0x198)]('─'['repeat'](0x3c)),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1c3))),console[_0x5e5a87(0x198)]('─'[_0x5e5a87(0x1b9)](0x3c));}if(_0x5a5bb6[_0x5e5a87(0x1a1)])return console['error'](a41_0x5ab31b['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x354898=_0x5a5bb6[_0x5e5a87(0x199)]?![]:_0x7399e1['length']>0x0||_0x2e6ec7[_0x5e5a87(0x174)]>0x0||_0x556800[_0x5e5a87(0x174)]>0x0,_0x12fbcc=_0x1b2480[_0x5e5a87(0x174)]>0x0||_0x2f9d5b[_0x5e5a87(0x174)]>0x0||_0x26fd1e[_0x5e5a87(0x174)]>0x0,_0x357b36=_0x5a5bb6[_0x5e5a87(0x199)]?![]:_0x3712d5[_0x5e5a87(0x174)]>0x0,_0x262a66=_0x9ed557['length']>0x0;if(!_0x354898&&!_0x12fbcc&&!_0x357b36&&!_0x262a66){const _0x1ec3d0=_0x5a5bb6[_0x5e5a87(0x199)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x5e5a87(0x178);console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x184)](_0x1ec3d0));if(_0x4d0621&&_0xe79137[_0x5e5a87(0x174)]===0x1){const _0xec9816=_0xe79137[0x0];if(_0xec9816[_0x5e5a87(0x156)]?.['id']){const _0x19aa10=getConsoleNextUrl(_0x5a5bb6[_0x5e5a87(0x16b)],_0x5e5a87(0x158)+_0x39f0f6+_0x5e5a87(0x1e3)+_0xec9816[_0x5e5a87(0x156)]['id']+'/sb/da/esr');console['error'](_0x5e5a87(0x191)+a41_0x5ab31b[_0x5e5a87(0x164)](_0x19aa10));}}if(_0x4d0621&&_0x2d0197[_0x5e5a87(0x174)]===0x1){const _0x833dec=_0x2d0197[0x0];if(_0x833dec[_0x5e5a87(0x1ca)]?.['id']){const _0x351e20=getConsoleNextUrl(_0x5a5bb6[_0x5e5a87(0x16b)],_0x5e5a87(0x158)+_0x39f0f6+_0x5e5a87(0x1e3)+_0x833dec['existingJourney']['id']+_0x5e5a87(0x14f));console['error']('\x20\x20'+a41_0x5ab31b[_0x5e5a87(0x164)](_0x351e20));}}return 0x0;}const _0x96f39f=_0x5a5bb6[_0x5e5a87(0x199)]?_0x1b2480[_0x5e5a87(0x174)]+_0x2f9d5b[_0x5e5a87(0x174)]+_0x26fd1e['length']+_0x9ed557[_0x5e5a87(0x174)]:_0x7399e1['length']+_0x2e6ec7['length']+_0x556800[_0x5e5a87(0x174)]+_0x1b2480[_0x5e5a87(0x174)]+_0x2f9d5b[_0x5e5a87(0x174)]+_0x26fd1e[_0x5e5a87(0x174)]+_0x9ed557[_0x5e5a87(0x174)]+_0x3712d5['length'];if(!_0x5a5bb6[_0x5e5a87(0x1a5)]&&_0x96f39f>0x0){if(!isInteractive())return console['error'](a41_0x5ab31b[_0x5e5a87(0x161)](_0x5e5a87(0x1c0)),_0x5e5a87(0x1ac)),console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x1b8)](_0x5e5a87(0x1a3))),0x1;const _0x4fb671=await confirmKey(_0x5e5a87(0x1b3)+_0x96f39f+_0x5e5a87(0x1b0));if(!_0x4fb671)return console['error'](a41_0x5ab31b[_0x5e5a87(0x1d9)](_0x5e5a87(0x15b))),0x1;}const _0x4a0bdb={'withProgress':async(_0x72fbf5,_0x5d7074)=>{const _0x27d358=_0x5e5a87,_0x322186=await withSpinner(_0x72fbf5,_0x5d7074,{'verbose':_0x5a5bb6['verbose']});return{'data':_0x322186[_0x27d358(0x14d)]};},'logInfo':_0x37e5a3=>console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x172)]('✔\x20'+_0x37e5a3)),'logSuccess':_0x1c20f9=>console[_0x5e5a87(0x198)](a41_0x5ab31b['green']('✔\x20'+_0x1c20f9)),'logWarning':_0x2d8257=>console[_0x5e5a87(0x198)](a41_0x5ab31b[_0x5e5a87(0x1d9)]('⚠\x20'+_0x2d8257)),'logDeleted':_0x1dc49c=>console['error'](a41_0x5ab31b['red']('✔\x20'+_0x1dc49c))},_0x38b465={'segment':_0x489360[_0x5e5a87(0x1d4)],'journey':_0x489360[_0x5e5a87(0x157)],'user':_0x489360[_0x5e5a87(0x175)],'connection':_0x489360[_0x5e5a87(0x17c)]};_0x9ed557[_0x5e5a87(0x174)]>0x0&&(_0x2a3878=await executePushFolders(_0x38b465,_0x9ed557,_0x2a3878,{'parentId':_0x39f0f6},_0x4a0bdb));const _0x29f299={'rootFolderId':_0x45ef60,'folderPathToId':_0x2a3878,'folderIdToPath':_0x55aaf3,'segmentNameToId':_0x3cf204,'activationsBySegmentId':_0x2c441f,'emailToIdMap':_0x4f33f7,'idToEmailMap':_0x4a0140,'connectionNameToIdMap':_0x408c89[_0x5e5a87(0x15f)],'connectionIdToNameMap':_0x408c89[_0x5e5a87(0x1aa)],'connectionNameToTypeMap':_0x1f508c},_0x21c671=await executePushSegments(_0x38b465,_0x5a5bb6['journeysOnly']?[]:_0x3fd98,_0x29f299,{'parentId':_0x39f0f6},_0x4a0bdb),_0x40ef92=_0x21c671['created'],_0x4e5e84=_0x21c671[_0x5e5a87(0x150)],_0x483e33=_0x21c671[_0x5e5a87(0x160)][_0x5e5a87(0x1c1)],_0x58c9c9=_0x21c671[_0x5e5a87(0x160)][_0x5e5a87(0x150)],_0x380707=_0x21c671[_0x5e5a87(0x160)][_0x5e5a87(0x16f)];let _0x5860d3;if(_0x4d0621&&_0x3fd98[_0x5e5a87(0x174)]===0x1){const _0x18b555=_0x3fd98[0x0];_0x5860d3=_0x18b555[_0x5e5a87(0x156)]?.['id']??_0x21c671[_0x5e5a87(0x1bc)]['get'](_0x18b555['yamlConfig'][_0x5e5a87(0x1c5)]);}const _0x557219=await executePushSegmentDeletions(_0x38b465,_0x5a5bb6[_0x5e5a87(0x199)]?[]:_0x556800,_0x4a0bdb);let _0x3111dc=0x0,_0x422f66=0x0,_0x29a234=0x0;const _0x45cb2c=new Map(_0x3cf204);for(const [_0x3cd7f9,_0x38f14b]of _0x21c671[_0x5e5a87(0x1bc)]){_0x45cb2c['set'](_0x3cd7f9,_0x38f14b);}if(_0x1f59f6[_0x5e5a87(0x174)]>0x0){const _0x3cec78={..._0x29f299,'segmentNameToId':_0x45cb2c,'existingSegments':_0x4f3e28,'activationContext':_0x44e27a},_0x4229af=await executePushJourneys(_0x38b465,_0x1f59f6,_0x3cec78,{'parentId':_0x39f0f6,'rootFolderId':_0x45ef60,'verbose':_0x5a5bb6['verbose']},_0x4a0bdb);_0x3111dc=_0x4229af[_0x5e5a87(0x1c1)],_0x422f66=_0x4229af['updated'];if(_0x4d0621&&_0x4229af[_0x5e5a87(0x19b)][_0x5e5a87(0x174)]===0x1){const _0x266515=_0x4229af['results'][0x0];if(_0x266515[_0x5e5a87(0x1a7)]){const _0x34efc8=getConsoleNextUrl(_0x5a5bb6[_0x5e5a87(0x16b)],_0x5e5a87(0x158)+_0x39f0f6+'/e/'+_0x266515[_0x5e5a87(0x1a7)]+_0x5e5a87(0x14f));console['error']('\x20\x20'+a41_0x5ab31b['cyan'](_0x34efc8));}}}for(const _0x2e1ff3 of _0x26fd1e){console[_0x5e5a87(0x198)](a41_0x5ab31b['yellow'](_0x5e5a87(0x188)+_0x2e1ff3['journeyBundleName'])),_0x29a234++;}const _0x89e5cf=[];if(_0x40ef92>0x0)_0x89e5cf[_0x5e5a87(0x1dc)](_0x40ef92+_0x5e5a87(0x15d));if(_0x4e5e84>0x0)_0x89e5cf['push'](_0x4e5e84+'\x20updated');if(_0x557219>0x0)_0x89e5cf['push'](_0x557219+_0x5e5a87(0x1be));const _0x5d5e80=[];if(_0x3111dc>0x0)_0x5d5e80['push'](_0x3111dc+_0x5e5a87(0x15d));if(_0x422f66>0x0)_0x5d5e80[_0x5e5a87(0x1dc)](_0x422f66+_0x5e5a87(0x1db));if(_0x29a234>0x0)_0x5d5e80[_0x5e5a87(0x1dc)](_0x29a234+_0x5e5a87(0x1be));const _0x559158=[];if(_0x483e33>0x0)_0x559158[_0x5e5a87(0x1dc)](_0x483e33+'\x20created');if(_0x58c9c9>0x0)_0x559158['push'](_0x58c9c9+'\x20updated');if(_0x380707>0x0)_0x559158[_0x5e5a87(0x1dc)](_0x380707+_0x5e5a87(0x1be));console['error'](a41_0x5ab31b[_0x5e5a87(0x184)]('\x0a✔\x20Push\x20complete'));_0x89e5cf[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)]&&console[_0x5e5a87(0x198)]('\x20\x20Segments:\x20'+_0x89e5cf['join'](',\x20'));_0x5d5e80[_0x5e5a87(0x174)]>0x0&&console[_0x5e5a87(0x198)](_0x5e5a87(0x16e)+_0x5d5e80[_0x5e5a87(0x177)](',\x20'));_0x559158[_0x5e5a87(0x174)]>0x0&&!_0x5a5bb6[_0x5e5a87(0x199)]&&console[_0x5e5a87(0x198)](_0x5e5a87(0x1ba)+_0x559158[_0x5e5a87(0x177)](',\x20'));if(_0x5860d3){const _0x2576bf=getConsoleNextUrl(_0x5a5bb6[_0x5e5a87(0x16b)],'/app/ps/'+_0x39f0f6+_0x5e5a87(0x1e3)+_0x5860d3+'/sb/da/esr');console['error'](_0x5e5a87(0x191)+a41_0x5ab31b['cyan'](_0x2576bf));}return 0x0;}}function a41_0x253b(_0x44e3bc,_0x16aa3d){_0x44e3bc=_0x44e3bc-0x14a;const _0x216753=a41_0x2167();let _0x253b96=_0x216753[_0x44e3bc];return _0x253b96;}function a41_0x2167(){const _0x4bfff7=['14343448rCZCZl','.yaml','error','journeysOnly','toString','results','listFolders','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','description','setPhase','parentName','dryRun','endsWith','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','no_parent','yes','18197325QSkLHj','journeyId','segments','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','idToName','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','.yml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','getOutputSchemaWithCache','\x20changes?','updatedAt','new','Push\x20','verbose','toCreate','Fetching\x20connections\x20for\x20name\x20resolution...','segment\x20or\x20journey','dim','repeat','\x20\x20Activations:\x20','buildUserMaps','createdSegmentIds','then','\x20deleted','paused','\x0aError:','created','segment:push','(Journey\x20will\x20be\x20deleted)','619210eCNjUr','name','10aDRTkc','targetDir','journeyBundleName','509699NyMFSj','existingJourney','all','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20🗺️\x20\x20Journeys:','get','delete','errorCode','5360236JTnPrj','\x20\x20\x20\x20','segment','\x0aValidation\x20failed:','map','\x20new','Fetching\x20existing\x20activations...','yellow','\x20folders\x20to\x20create','\x20updated','push','isNew','8547642FRYVGu','Delete\x20segment:','yamlConfig','Resolving\x20parent\x20segment\x20\x27','journeys','/e/','changed','file','4OFzDwv','segmentFolderId','Scoped\x20to\x20folder:\x20','data','journeyBundleId','/j/da/je','updated','filePath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20to\x20delete','Fetching\x20existing\x20data...','toUpdate','existingSegment','journey','/app/ps/','Error\x20parsing\x20YAML:\x20','isScoped','Aborted.','\x20unchanged','\x20created','attributes','nameToId','activations','red','nameToType','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','cyan','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','createdAt','getParent','parentFolder','Changes\x20to:','\x20YAML\x20files\x20found','site','folderPath','toDelete','\x20\x20Journeys:\x20','deleted','scopedFolderPath','unchanged','blue','\x20activations]','length','user','parent_name','join','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','type','Folders\x20to\x20create:','versionNumber','connection','New\x20segment:','1804194iXxzeX','filter','helpText','New\x20journey:','diff','listActivations','green','listJourneysWithDetailsFromParentSegment','\x27...','parentSegment','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','folderId','\x20to\x20create','6ehNYpy','Error:\x20Directory\x20not\x20found:\x20','Site:\x20','\x0aPush\x20summary\x20for\x20\x27','state','\x20\x20Activations:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Parent\x20segment:\x20','add','listSegments','message'];a41_0x2167=function(){return _0x4bfff7;};return a41_0x2167();}
@@ -1 +1 @@
1
- const a42_0x50dec0=a42_0x58eb;(function(_0x2ee7da,_0x189463){const _0x212a86=a42_0x58eb,_0x599fcc=_0x2ee7da();while(!![]){try{const _0x375d88=parseInt(_0x212a86(0x1cc))/0x1+-parseInt(_0x212a86(0x1a8))/0x2*(parseInt(_0x212a86(0x1ba))/0x3)+-parseInt(_0x212a86(0x1ca))/0x4*(parseInt(_0x212a86(0x1b4))/0x5)+parseInt(_0x212a86(0x1bb))/0x6*(parseInt(_0x212a86(0x1d1))/0x7)+-parseInt(_0x212a86(0x1be))/0x8*(parseInt(_0x212a86(0x1a1))/0x9)+-parseInt(_0x212a86(0x1a6))/0xa*(-parseInt(_0x212a86(0x1d0))/0xb)+-parseInt(_0x212a86(0x1a9))/0xc*(parseInt(_0x212a86(0x1af))/0xd);if(_0x375d88===_0x189463)break;else _0x599fcc['push'](_0x599fcc['shift']());}catch(_0x252f4e){_0x599fcc['push'](_0x599fcc['shift']());}}}(a42_0x2720,0xde009));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a42_0x58eb(_0x52a762,_0x370cb0){_0x52a762=_0x52a762-0x1a0;const _0x272020=a42_0x2720();let _0x58ebf2=_0x272020[_0x52a762];return _0x58ebf2;}import a42_0x59231b from'chalk';function a42_0x2720(){const _0x593b98=['Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','parentId','yellow','data','Parent\x20ID:\x20','1859772IrjxWk','237792ayDOog','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','232SHQyyt','type','verbose','✔\x20Updated\x20segment\x20\x27','includes','resolvePathToResource','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','kind','segmentId','Error:\x20Cannot\x20update\x20','\x27...','1852wAmADY','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','1723612iGMKco','Examples:','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','description','244123hYCHZR','168fxoQSo','Segment\x20ID\x20missing\x20from\x20resolved\x20path','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','name','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','314307SsbSbE','Resolved\x20folder\x20ID:\x20','resolveFolderId','\x20\x20\x20Path:\x20','error','770klIgoE','folder','2bHGGlt','48PjGgBg','Update\x20existing\x20child\x20segment','INTERNAL','updateSegmentById','Resolved\x20type:\x20','segmentPath','1954069wgkXgz','segment','execute','segment:update','Updating\x20segment\x20\x27','13395vbtLHv'];a42_0x2720=function(){return _0x593b98;};return a42_0x2720();}export class SegmentUpdateCommand extends BaseCommand{['name']=a42_0x50dec0(0x1b2);[a42_0x50dec0(0x1cf)]=a42_0x50dec0(0x1aa);async[a42_0x50dec0(0x1b1)](_0x122aec){const _0x17c7b0=a42_0x50dec0;console[_0x17c7b0(0x1a5)](a42_0x59231b[_0x17c7b0(0x1b7)](_0x17c7b0(0x1ce))),console['error'](a42_0x59231b['yellow'](_0x17c7b0(0x1a0)));const {options:_0x188c32,args:_0xd74a04,tdx:_0x3572c0}=_0x122aec,_0xd10ab=_0x188c32;if(_0xd74a04['length']===0x0)return console['error'](_0x17c7b0(0x1b5)),console['error'](_0x17c7b0(0x1c5)),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1cd)),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1cb)),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1bc)),0x1;const _0x19ab55=_0xd74a04[0x0],_0x408fd7=_0x188c32[_0x17c7b0(0x1ae)];let _0x29acf1=_0x19ab55;_0x408fd7&&!_0x19ab55[_0x17c7b0(0x1c2)]('/')&&(_0x29acf1=_0x408fd7+'/'+_0x19ab55,_0xd10ab[_0x17c7b0(0x1c0)]&&console[_0x17c7b0(0x1a5)]('Resolved\x20relative\x20path\x20to:\x20'+_0x29acf1));const _0x28eb7f=await withSpinner('Resolving\x20path\x20\x27'+_0x29acf1+_0x17c7b0(0x1c9),()=>_0x3572c0[_0x17c7b0(0x1b0)][_0x17c7b0(0x1c3)](_0x29acf1),{'verbose':_0xd10ab[_0x17c7b0(0x1c0)]}),_0x292621=_0x28eb7f[_0x17c7b0(0x1b8)];_0xd10ab[_0x17c7b0(0x1c0)]&&console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1ad)+_0x292621['type']);if(_0x292621[_0x17c7b0(0x1bf)]!==_0x17c7b0(0x1b0))return console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1c8)+_0x292621[_0x17c7b0(0x1bf)]+_0x17c7b0(0x1d3)),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1bd)),0x1;if(!_0x292621[_0x17c7b0(0x1c7)])throw new SDKError(ErrorCode[_0x17c7b0(0x1ab)],_0x17c7b0(0x1d2));const _0x21c4a3=_0x292621[_0x17c7b0(0x1b6)],_0x38b183=_0x292621[_0x17c7b0(0x1c7)];_0xd10ab[_0x17c7b0(0x1c0)]&&(console['error'](_0x17c7b0(0x1b9)+_0x21c4a3),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1c4)+_0x38b183));let _0x2c65d1;if(_0xd10ab[_0x17c7b0(0x1a7)]){const _0xb95544=_0xd10ab[_0x17c7b0(0x1a7)],_0x2fe81d=await withSpinner('Resolving\x20folder\x20\x27'+_0xb95544+_0x17c7b0(0x1c9),()=>_0x3572c0[_0x17c7b0(0x1b0)][_0x17c7b0(0x1a3)](_0x21c4a3,_0xb95544),{'verbose':_0xd10ab[_0x17c7b0(0x1c0)]});_0x2c65d1=parseInt(_0x2fe81d[_0x17c7b0(0x1b8)],0xa),_0xd10ab[_0x17c7b0(0x1c0)]&&console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1a2)+_0x2c65d1);}const _0x25bf63=await loadJSONFromOptions(_0xd10ab['rule'],_0xd10ab['ruleFile']),_0x360b6c={'name':_0xd10ab[_0x17c7b0(0x1d4)],'description':_0xd10ab[_0x17c7b0(0x1cf)],'rule':_0x25bf63,'kind':_0xd10ab[_0x17c7b0(0x1c6)]!==undefined?parseInt(_0xd10ab['kind'],0xa):undefined,'segmentFolderId':_0x2c65d1},_0x427f53=await withSpinner(_0x17c7b0(0x1b3)+_0x292621['segmentName']+_0x17c7b0(0x1c9),()=>_0x3572c0[_0x17c7b0(0x1b0)][_0x17c7b0(0x1ac)](_0x21c4a3,_0x38b183,_0x360b6c),{'verbose':_0xd10ab[_0x17c7b0(0x1c0)]}),_0x5916fa=_0x427f53[_0x17c7b0(0x1b8)];return console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1c1)+_0x5916fa['name']+'\x27'),_0x29acf1!==_0x19ab55&&console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1a4)+_0x29acf1),await handleSDKOutput([_0x5916fa],_0xd10ab),0x0;}}
1
+ const a42_0x4bf941=a42_0x2ead;function a42_0x2ead(_0x4d1faf,_0x58a07d){_0x4d1faf=_0x4d1faf-0xab;const _0x58b76c=a42_0x58b7();let _0x2ead19=_0x58b76c[_0x4d1faf];return _0x2ead19;}function a42_0x58b7(){const _0x37536b=['type','segment','updateSegmentById','yellow','62587QynrAG','name','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','error','segmentId','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','237127oNihAQ','963qXFnpr','verbose','2135010CLHerX','Error:\x20Cannot\x20update\x20','Examples:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','data','684krrzXj','\x27...','execute','resolveFolderId','1656024QtZszO','704oOEGhr','includes','ruleFile','44190OGwXui','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','kind','Update\x20existing\x20child\x20segment','segmentPath','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','3254180SYvHyN','Resolved\x20folder\x20ID:\x20','397109TpcluU','2aiKfAv','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','parentId','4DihEgk','Updating\x20segment\x20\x27','resolvePathToResource','rule','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Parent\x20ID:\x20','Resolving\x20folder\x20\x27','\x20\x20\x20Path:\x20'];a42_0x58b7=function(){return _0x37536b;};return a42_0x58b7();}(function(_0x1860ab,_0x1f954b){const _0x26654d=a42_0x2ead,_0x5b4a6c=_0x1860ab();while(!![]){try{const _0x44300a=-parseInt(_0x26654d(0xb6))/0x1*(-parseInt(_0x26654d(0xb7))/0x2)+-parseInt(_0x26654d(0xd0))/0x3+-parseInt(_0x26654d(0xbb))/0x4*(-parseInt(_0x26654d(0xb4))/0x5)+parseInt(_0x26654d(0xd9))/0x6+-parseInt(_0x26654d(0xc7))/0x7*(parseInt(_0x26654d(0xab))/0x8)+-parseInt(_0x26654d(0xce))/0x9*(parseInt(_0x26654d(0xae))/0xa)+parseInt(_0x26654d(0xcd))/0xb*(parseInt(_0x26654d(0xd5))/0xc);if(_0x44300a===_0x1f954b)break;else _0x5b4a6c['push'](_0x5b4a6c['shift']());}catch(_0x1052bd){_0x5b4a6c['push'](_0x5b4a6c['shift']());}}}(a42_0x58b7,0x8df0b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x5d0fcc from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x4bf941(0xc8)]='segment:update';['description']=a42_0x4bf941(0xb1);async[a42_0x4bf941(0xd7)](_0x148b37){const _0x34a054=a42_0x4bf941;console['error'](a42_0x5d0fcc[_0x34a054(0xc6)](_0x34a054(0xb3))),console[_0x34a054(0xca)](a42_0x5d0fcc[_0x34a054(0xc6)](_0x34a054(0xbf)));const {options:_0x33a545,args:_0x4134c5,tdx:_0x10a3a7}=_0x148b37,_0x2cbaaa=_0x33a545;if(_0x4134c5['length']===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x34a054(0xca)](_0x34a054(0xaf)),console[_0x34a054(0xca)](_0x34a054(0xd2)),console[_0x34a054(0xca)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x34a054(0xca)](_0x34a054(0xc9)),0x1;const _0x1c3d2d=_0x4134c5[0x0],_0x1056d4=_0x33a545[_0x34a054(0xb2)];let _0x37b520=_0x1c3d2d;_0x1056d4&&!_0x1c3d2d[_0x34a054(0xac)]('/')&&(_0x37b520=_0x1056d4+'/'+_0x1c3d2d,_0x2cbaaa['verbose']&&console[_0x34a054(0xca)]('Resolved\x20relative\x20path\x20to:\x20'+_0x37b520));const _0x15bc6e=await withSpinner(_0x34a054(0xb9)+_0x37b520+_0x34a054(0xd6),()=>_0x10a3a7[_0x34a054(0xc4)][_0x34a054(0xbd)](_0x37b520),{'verbose':_0x2cbaaa[_0x34a054(0xcf)]}),_0x5f41f3=_0x15bc6e[_0x34a054(0xd4)];_0x2cbaaa['verbose']&&console['error']('Resolved\x20type:\x20'+_0x5f41f3['type']);if(_0x5f41f3['type']!==_0x34a054(0xc4))return console[_0x34a054(0xca)](_0x34a054(0xd1)+_0x5f41f3[_0x34a054(0xc3)]+_0x34a054(0xcc)),console[_0x34a054(0xca)](_0x34a054(0xb8)),0x1;if(!_0x5f41f3[_0x34a054(0xcb)])throw new SDKError(ErrorCode['INTERNAL'],_0x34a054(0xd3));const _0x49e737=_0x5f41f3[_0x34a054(0xba)],_0x453ea4=_0x5f41f3[_0x34a054(0xcb)];_0x2cbaaa[_0x34a054(0xcf)]&&(console[_0x34a054(0xca)](_0x34a054(0xc0)+_0x49e737),console[_0x34a054(0xca)]('Segment\x20ID:\x20'+_0x453ea4));let _0x32ee19;if(_0x2cbaaa['folder']){const _0x49d4d8=_0x2cbaaa['folder'],_0x102c71=await withSpinner(_0x34a054(0xc1)+_0x49d4d8+_0x34a054(0xd6),()=>_0x10a3a7[_0x34a054(0xc4)][_0x34a054(0xd8)](_0x49e737,_0x49d4d8),{'verbose':_0x2cbaaa[_0x34a054(0xcf)]});_0x32ee19=parseInt(_0x102c71['data'],0xa),_0x2cbaaa['verbose']&&console['error'](_0x34a054(0xb5)+_0x32ee19);}const _0x220198=await loadJSONFromOptions(_0x2cbaaa[_0x34a054(0xbe)],_0x2cbaaa[_0x34a054(0xad)]),_0x1176ed={'name':_0x2cbaaa['name'],'description':_0x2cbaaa['description'],'rule':_0x220198,'kind':_0x2cbaaa[_0x34a054(0xb0)]!==undefined?parseInt(_0x2cbaaa[_0x34a054(0xb0)],0xa):undefined,'segmentFolderId':_0x32ee19},_0x36bccc=await withSpinner(_0x34a054(0xbc)+_0x5f41f3['segmentName']+_0x34a054(0xd6),()=>_0x10a3a7['segment'][_0x34a054(0xc5)](_0x49e737,_0x453ea4,_0x1176ed),{'verbose':_0x2cbaaa[_0x34a054(0xcf)]}),_0x34949c=_0x36bccc[_0x34a054(0xd4)];return console[_0x34a054(0xca)]('✔\x20Updated\x20segment\x20\x27'+_0x34949c[_0x34a054(0xc8)]+'\x27'),_0x37b520!==_0x1c3d2d&&console[_0x34a054(0xca)](_0x34a054(0xc2)+_0x37b520),await handleSDKOutput([_0x34949c],_0x2cbaaa),0x0;}}
@@ -1 +1 @@
1
- const a43_0x3f9ac0=a43_0x29e2;(function(_0x51029f,_0x2346a9){const _0x36c1e8=a43_0x29e2,_0x163730=_0x51029f();while(!![]){try{const _0x11867a=parseInt(_0x36c1e8(0x9c))/0x1+-parseInt(_0x36c1e8(0xb0))/0x2+parseInt(_0x36c1e8(0xbf))/0x3+-parseInt(_0x36c1e8(0xa3))/0x4*(-parseInt(_0x36c1e8(0x91))/0x5)+-parseInt(_0x36c1e8(0x8c))/0x6*(-parseInt(_0x36c1e8(0x96))/0x7)+-parseInt(_0x36c1e8(0xba))/0x8*(parseInt(_0x36c1e8(0xa4))/0x9)+parseInt(_0x36c1e8(0xa5))/0xa*(-parseInt(_0x36c1e8(0x99))/0xb);if(_0x11867a===_0x2346a9)break;else _0x163730['push'](_0x163730['shift']());}catch(_0x3594cf){_0x163730['push'](_0x163730['shift']());}}}(a43_0x6d97,0x57bc3));import{existsSync,statSync}from'fs';import a43_0x45d99a from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x29e2(_0x1643b2,_0x8176dd){_0x1643b2=_0x1643b2-0x8a;const _0x6d97d4=a43_0x6d97();let _0x29e2e0=_0x6d97d4[_0x1643b2];return _0x29e2e0;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x3f9ac0(0xa2)]=a43_0x3f9ac0(0x92);[a43_0x3f9ac0(0x90)]=a43_0x3f9ac0(0xc2);async[a43_0x3f9ac0(0xa1)](_0x135566){const _0x2325ae=a43_0x3f9ac0,{options:_0x3f1bfe,args:_0x58653,tdx:_0xa27a6b}=_0x135566;if(_0x58653[_0x2325ae(0x8a)]===0x0)return console['error'](a43_0x45d99a['red'](_0x2325ae(0xb4))),console[_0x2325ae(0xb3)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x2325ae(0xb3)](_0x2325ae(0xa9)),console[_0x2325ae(0xb3)](_0x2325ae(0x93)),console['error'](_0x2325ae(0x9f)),console[_0x2325ae(0xb3)](_0x2325ae(0xb1)),console['error'](_0x2325ae(0x8b)),0x1;const _0x1ebdb2=_0x58653[0x0],_0x5899f7=_0x3f1bfe[_0x2325ae(0xa6)];try{if(_0x1ebdb2==='/')return saveSessionContext({'segment_path':undefined},_0x5899f7),console[_0x2325ae(0xa7)](a43_0x45d99a[_0x2325ae(0x98)](_0x2325ae(0xb9))),0x0;if(existsSync(_0x1ebdb2)&&statSync(_0x1ebdb2)['isDirectory']()){let _0x5d0acb;try{_0x5d0acb=findTdxConfig(_0x1ebdb2);}catch{return console[_0x2325ae(0xb3)](a43_0x45d99a[_0x2325ae(0xbb)](_0x2325ae(0xaf)+_0x1ebdb2)),console[_0x2325ae(0xb3)](a43_0x45d99a[_0x2325ae(0x9e)](_0x2325ae(0xae))),0x1;}const _0x467562=_0x5d0acb[_0x2325ae(0x97)][_0x2325ae(0xb8)];return saveSessionContext({'segment_path':_0x467562,'parent_segment':_0x467562},_0x5899f7),console[_0x2325ae(0xa7)](a43_0x45d99a['green'](_0x2325ae(0xac)+a43_0x45d99a['cyan'](_0x467562))),0x0;}const _0x4a4054=_0x3f1bfe[_0x2325ae(0xa8)];let _0x2837ca=_0x1ebdb2;const _0x471064=parsePath(_0x1ebdb2);if(!_0x471064[_0x2325ae(0xbc)]){if(!_0x4a4054)return console[_0x2325ae(0xb3)](a43_0x45d99a['red'](_0x2325ae(0xab))),console['error'](a43_0x45d99a['cyan'](_0x2325ae(0xb2))),0x1;if(_0x1ebdb2==='..'){const _0x32a23f=_0x4a4054['split']('/')[_0x2325ae(0xc0)](0x0,-0x1)[_0x2325ae(0xc4)]('/');_0x2837ca=_0x32a23f||'/';}else _0x1ebdb2==='.'?_0x2837ca=_0x4a4054:_0x2837ca=_0x4a4054+'/'+_0x1ebdb2;_0x3f1bfe[_0x2325ae(0xc1)]&&console[_0x2325ae(0xb3)](_0x2325ae(0xad)+_0x2837ca);}if(_0x2837ca==='/'||_0x2837ca==='')return saveSessionContext({'segment_path':undefined},_0x5899f7),console['log'](a43_0x45d99a['green'](_0x2325ae(0xb9))),0x0;_0x2837ca=normalizePath(_0x2837ca);const _0x1748a8=parsePath(_0x2837ca)[_0x2325ae(0x8e)];if(_0x1748a8[_0x2325ae(0x8a)]===0x0)return saveSessionContext({'segment_path':undefined},_0x5899f7),console['log'](a43_0x45d99a[_0x2325ae(0x98)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3f1bfe[_0x2325ae(0xc1)]&&(console[_0x2325ae(0xb3)]('Site:\x20'+_0x3f1bfe[_0x2325ae(0x94)]),console[_0x2325ae(0xb3)]('Target\x20path:\x20'+_0x2837ca));const _0x4a53a6=await withSpinner(_0x2325ae(0xc3)+_0x2837ca+_0x2325ae(0x9a),()=>_0xa27a6b[_0x2325ae(0x9b)]['resolvePathToResource'](_0x2837ca),{'verbose':_0x3f1bfe[_0x2325ae(0xc1)]}),_0x13756c=_0x4a53a6[_0x2325ae(0x8f)];_0x3f1bfe['verbose']&&(console[_0x2325ae(0xb3)]('Resolved\x20path\x20type:\x20'+_0x13756c[_0x2325ae(0xbe)]),console['error'](_0x2325ae(0xbd)+_0x13756c['parentId']),_0x13756c[_0x2325ae(0xb7)]&&console[_0x2325ae(0xb3)]('Folder\x20ID:\x20'+_0x13756c['folderId']));if(_0x13756c[_0x2325ae(0xbe)]===_0x2325ae(0x9b))return console[_0x2325ae(0xb3)](a43_0x45d99a[_0x2325ae(0xbb)](_0x2325ae(0x95))),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a43_0x45d99a[_0x2325ae(0x9e)](_0x2325ae(0xb6)+_0x13756c[_0x2325ae(0xa0)]+(_0x13756c[_0x2325ae(0x8d)]?'/'+_0x13756c['folderPath'][_0x2325ae(0xc4)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x13756c['fullPath'],'parent_segment':_0x13756c[_0x2325ae(0xa0)]},_0x5899f7),console['log'](a43_0x45d99a['green'](_0x2325ae(0xac)+a43_0x45d99a[_0x2325ae(0x9e)](_0x13756c[_0x2325ae(0xaa)]))),_0x3f1bfe[_0x2325ae(0xc1)]&&(console[_0x2325ae(0xb3)](a43_0x45d99a['dim']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x2325ae(0xb3)](a43_0x45d99a[_0x2325ae(0xb5)](_0x2325ae(0x9d)))),0x0;}catch(_0x476418){throw _0x476418;}}}function a43_0x6d97(){const _0x41895e=['session','log','segmentPath','Examples:','fullPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','✔\x20Context\x20set\x20to:\x20','Resolved\x20relative\x20path\x20to:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','85060IyzLTW','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','error','Error:\x20Path\x20is\x20required\x0a','dim','Use:\x20tdx\x20segment\x20use\x20','folderId','parent_segment','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','4936VlgkiF','red','isAbsolute','Parent\x20ID:\x20','type','741438hVVOkM','slice','verbose','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Resolving\x20path\x20\x27','join','length','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','102sSkyEU','folderPath','segments','data','description','10155pEXOxt','segment:use','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','site','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','50183jbQRPM','config','green','176EgPwxJ','\x27...','segment','590054tvhQkx','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','cyan','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','parentName','execute','name','848fMbDcK','8856WNXeoy','237890OMtpty'];a43_0x6d97=function(){return _0x41895e;};return a43_0x6d97();}
1
+ const a43_0x494119=a43_0x29b6;function a43_0x29b6(_0x56bda0,_0x2aa151){_0x56bda0=_0x56bda0-0x192;const _0x2fb86d=a43_0x2fb8();let _0x29b637=_0x2fb86d[_0x56bda0];return _0x29b637;}(function(_0x13af76,_0x4328ff){const _0x5b7b90=a43_0x29b6,_0x4ec1a7=_0x13af76();while(!![]){try{const _0x13e945=-parseInt(_0x5b7b90(0x1b1))/0x1*(parseInt(_0x5b7b90(0x1b9))/0x2)+parseInt(_0x5b7b90(0x1bf))/0x3*(parseInt(_0x5b7b90(0x19b))/0x4)+-parseInt(_0x5b7b90(0x1ba))/0x5+-parseInt(_0x5b7b90(0x1ad))/0x6*(-parseInt(_0x5b7b90(0x199))/0x7)+parseInt(_0x5b7b90(0x1c5))/0x8*(parseInt(_0x5b7b90(0x1c7))/0x9)+-parseInt(_0x5b7b90(0x1bd))/0xa+-parseInt(_0x5b7b90(0x1a8))/0xb*(-parseInt(_0x5b7b90(0x1ab))/0xc);if(_0x13e945===_0x4328ff)break;else _0x4ec1a7['push'](_0x4ec1a7['shift']());}catch(_0x1f2af6){_0x4ec1a7['push'](_0x4ec1a7['shift']());}}}(a43_0x2fb8,0xe0162));import{existsSync,statSync}from'fs';function a43_0x2fb8(){const _0x17aec1=['error','type','folderPath','dim','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20set\x20to:\x20','isAbsolute','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','66QoAmPI','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Examples:','2665692sUbJvg','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','6jWqrHC','parentId','Error:\x20Path\x20is\x20required\x0a','Resolved\x20relative\x20path\x20to:\x20','759mcLoIt','session','Parent\x20ID:\x20','verbose','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','fullPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','1810ApABoq','3515510BViBty','folderId','cyan','8586320IOoCcK','green','2095473IwfQtI','resolvePathToResource','config','site','parentName','join','3299208lcoDfi','segment','9tefGpU','name','execute','description','\x27...','segmentPath','slice','segment:use','red','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','log','split','parent_segment','Resolving\x20path\x20\x27','5059243imEKjH','Resolved\x20path\x20type:\x20','4RXIvZv','Usage:\x20tdx\x20segment\x20use\x20<path>','length'];a43_0x2fb8=function(){return _0x17aec1;};return a43_0x2fb8();}import a43_0x2d0b15 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x494119(0x1c8)]=a43_0x494119(0x1ce);[a43_0x494119(0x1ca)]=a43_0x494119(0x1b8);async[a43_0x494119(0x1c9)](_0x380a4d){const _0xd2939f=a43_0x494119,{options:_0x12e000,args:_0x205da8,tdx:_0x2903e3}=_0x380a4d;if(_0x205da8[_0xd2939f(0x19d)]===0x0)return console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x192)](_0xd2939f(0x1af))),console['error'](_0xd2939f(0x19c)),console['error'](_0xd2939f(0x1aa)),console[_0xd2939f(0x19e)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error'](_0xd2939f(0x193)),console[_0xd2939f(0x19e)](_0xd2939f(0x1ac)),console['error'](_0xd2939f(0x1a2)),0x1;const _0x331927=_0x205da8[0x0],_0x759e0=_0x12e000[_0xd2939f(0x1b2)];try{if(_0x331927==='/')return saveSessionContext({'segment_path':undefined},_0x759e0),console[_0xd2939f(0x195)](a43_0x2d0b15[_0xd2939f(0x1be)](_0xd2939f(0x1b5))),0x0;if(existsSync(_0x331927)&&statSync(_0x331927)['isDirectory']()){let _0x46639e;try{_0x46639e=findTdxConfig(_0x331927);}catch{return console[_0xd2939f(0x19e)](a43_0x2d0b15['red'](_0xd2939f(0x1a6)+_0x331927)),console[_0xd2939f(0x19e)](a43_0x2d0b15['cyan'](_0xd2939f(0x1a3))),0x1;}const _0x7e31de=_0x46639e[_0xd2939f(0x1c1)][_0xd2939f(0x197)];return saveSessionContext({'segment_path':_0x7e31de,'parent_segment':_0x7e31de},_0x759e0),console[_0xd2939f(0x195)](a43_0x2d0b15['green']('✔\x20Context\x20set\x20to:\x20'+a43_0x2d0b15[_0xd2939f(0x1bc)](_0x7e31de))),0x0;}const _0x3ee307=_0x12e000[_0xd2939f(0x1cc)];let _0x4d8f51=_0x331927;const _0x1b32ef=parsePath(_0x331927);if(!_0x1b32ef[_0xd2939f(0x1a5)]){if(!_0x3ee307)return console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x192)](_0xd2939f(0x1b6))),console[_0xd2939f(0x19e)](a43_0x2d0b15['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x331927==='..'){const _0x37aef3=_0x3ee307[_0xd2939f(0x196)]('/')[_0xd2939f(0x1cd)](0x0,-0x1)[_0xd2939f(0x1c4)]('/');_0x4d8f51=_0x37aef3||'/';}else _0x331927==='.'?_0x4d8f51=_0x3ee307:_0x4d8f51=_0x3ee307+'/'+_0x331927;_0x12e000['verbose']&&console[_0xd2939f(0x19e)](_0xd2939f(0x1b0)+_0x4d8f51);}if(_0x4d8f51==='/'||_0x4d8f51==='')return saveSessionContext({'segment_path':undefined},_0x759e0),console['log'](a43_0x2d0b15['green'](_0xd2939f(0x1b5))),0x0;_0x4d8f51=normalizePath(_0x4d8f51);const _0x55b0b1=parsePath(_0x4d8f51)['segments'];if(_0x55b0b1['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x759e0),console[_0xd2939f(0x195)](a43_0x2d0b15[_0xd2939f(0x1be)](_0xd2939f(0x1b5))),0x0;_0x12e000[_0xd2939f(0x1b4)]&&(console[_0xd2939f(0x19e)]('Site:\x20'+_0x12e000[_0xd2939f(0x1c2)]),console['error']('Target\x20path:\x20'+_0x4d8f51));const _0x147928=await withSpinner(_0xd2939f(0x198)+_0x4d8f51+_0xd2939f(0x1cb),()=>_0x2903e3[_0xd2939f(0x1c6)][_0xd2939f(0x1c0)](_0x4d8f51),{'verbose':_0x12e000[_0xd2939f(0x1b4)]}),_0x586982=_0x147928['data'];_0x12e000[_0xd2939f(0x1b4)]&&(console[_0xd2939f(0x19e)](_0xd2939f(0x19a)+_0x586982[_0xd2939f(0x19f)]),console[_0xd2939f(0x19e)](_0xd2939f(0x1b3)+_0x586982[_0xd2939f(0x1ae)]),_0x586982[_0xd2939f(0x1bb)]&&console[_0xd2939f(0x19e)]('Folder\x20ID:\x20'+_0x586982['folderId']));if(_0x586982['type']===_0xd2939f(0x1c6))return console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x192)](_0xd2939f(0x194))),console[_0xd2939f(0x19e)](_0xd2939f(0x1a9)),console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x1bc)]('Use:\x20tdx\x20segment\x20use\x20'+_0x586982['parentName']+(_0x586982['folderPath']?'/'+_0x586982[_0xd2939f(0x1a0)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x586982[_0xd2939f(0x1b7)],'parent_segment':_0x586982[_0xd2939f(0x1c3)]},_0x759e0),console[_0xd2939f(0x195)](a43_0x2d0b15['green'](_0xd2939f(0x1a4)+a43_0x2d0b15[_0xd2939f(0x1bc)](_0x586982[_0xd2939f(0x1b7)]))),_0x12e000[_0xd2939f(0x1b4)]&&(console[_0xd2939f(0x19e)](a43_0x2d0b15['dim']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0xd2939f(0x19e)](a43_0x2d0b15[_0xd2939f(0x1a1)](_0xd2939f(0x1a7)))),0x0;}catch(_0x122537){throw _0x122537;}}}
@@ -1 +1 @@
1
- const a44_0x429531=a44_0x549d;(function(_0x14f2e6,_0x477ff3){const _0x42133b=a44_0x549d,_0x26674d=_0x14f2e6();while(!![]){try{const _0x1991ac=parseInt(_0x42133b(0x20f))/0x1+parseInt(_0x42133b(0x20b))/0x2+-parseInt(_0x42133b(0x212))/0x3+-parseInt(_0x42133b(0x1f9))/0x4+-parseInt(_0x42133b(0x20c))/0x5+parseInt(_0x42133b(0x1f2))/0x6*(parseInt(_0x42133b(0x1f7))/0x7)+parseInt(_0x42133b(0x1f4))/0x8*(parseInt(_0x42133b(0x20e))/0x9);if(_0x1991ac===_0x477ff3)break;else _0x26674d['push'](_0x26674d['shift']());}catch(_0x2b1610){_0x26674d['push'](_0x26674d['shift']());}}}(a44_0x4e0d,0x3fc2a));import{BaseCommand}from'./command.js';function a44_0x549d(_0x18a42e,_0x32e21c){_0x18a42e=_0x18a42e-0x1eb;const _0x4e0d95=a44_0x4e0d();let _0x549d5f=_0x4e0d95[_0x18a42e];return _0x549d5f;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0x4e0d(){const _0x564057=['execute','errors','green','cwd','validCount','297884yiGzdJ','1034405GXMDEi','yellow','1035549JvzfYj','493156NeLdQo','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filePath','1449591LohhyX','type','\x20warning(s)\x20found','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','parentSegment','Error:\x20','):\x20','.yml','valid','✔\x20All\x20','red','error','cyan','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','targetDir','282708MVLwXe','warningCount','40zkIUcT','log','helpText','7oPcYJa','.yaml','1253124IBNzNK','Error:\x20Directory\x20not\x20found:\x20','\x20file(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','invalidCount','message','segment:validate','length','description','verbose','dim','warnings','\x20valid'];a44_0x4e0d=function(){return _0x564057;};return a44_0x4e0d();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0xe64494 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x429531(0x1ff);[a44_0x429531(0x201)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a44_0x429531(0x206)](_0x2028fb){const _0x159c2b=a44_0x429531,{options:_0x5ed34c,args:_0x20764b}=_0x2028fb,_0x5d6d01=_0x5ed34c,_0x155a1f=await resolveTarget({'arg':_0x20764b[0x0],'contextParent':_0x5ed34c[_0x159c2b(0x216)],'cwd':process[_0x159c2b(0x209)]()});if(!isSuccessfulResolution(_0x155a1f))return _0x155a1f['errorCode']==='no_parent'?(console['error'](a44_0xe64494[_0x159c2b(0x20d)](_0x159c2b(0x1f0))),console[_0x159c2b(0x1ee)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x159c2b(0x1ee)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x159c2b(0x1ee)](_0x159c2b(0x210))):(console[_0x159c2b(0x1ee)](a44_0xe64494['red'](_0x159c2b(0x217)+_0x155a1f[_0x159c2b(0x1fe)]+'\x0a')),_0x155a1f[_0x159c2b(0x1f6)]&&console[_0x159c2b(0x1ee)](a44_0xe64494[_0x159c2b(0x1ef)](_0x155a1f['helpText']))),0x1;const _0xd889da=_0x155a1f[_0x159c2b(0x1f1)],_0x5e6ff0=_0x155a1f[_0x159c2b(0x213)]==='file'?_0x155a1f[_0x159c2b(0x211)]:undefined;if(!_0x5e6ff0&&!existsSync(_0xd889da))return console[_0x159c2b(0x1ee)](a44_0xe64494['red'](_0x159c2b(0x1fa)+_0xd889da+'\x0a')),0x1;let _0x224c7e;if(_0x5e6ff0){if(!_0x5e6ff0['endsWith'](_0x159c2b(0x219))&&!_0x5e6ff0['endsWith'](_0x159c2b(0x1f8)))return console['error'](a44_0xe64494[_0x159c2b(0x1ed)](_0x159c2b(0x215)+_0x5e6ff0+'\x0a')),0x1;_0x224c7e=[_0x5e6ff0];}else _0x224c7e=findYamlFiles(_0xd889da);if(_0x224c7e[_0x159c2b(0x200)]===0x0)return console[_0x159c2b(0x1ee)](a44_0xe64494[_0x159c2b(0x1ed)](_0x159c2b(0x1fc)+_0xd889da+'\x0a')),0x1;const _0x1e27fa=validateYamlFiles(_0x224c7e,_0xd889da),_0x1a4e09=calculateSummary(_0x1e27fa);for(const _0x1d6d0e of _0x1e27fa){if(!isValidationResult(_0x1d6d0e))continue;const {relativePath:_0x1b4073,source:_0x36328a,result:_0x25f89b,fileType:_0x2e98b0}=_0x1d6d0e,_0x1ef986=_0x2e98b0;if(_0x25f89b[_0x159c2b(0x1eb)]&&_0x25f89b[_0x159c2b(0x204)][_0x159c2b(0x200)]===0x0)_0x5d6d01[_0x159c2b(0x202)]&&console['log'](a44_0xe64494[_0x159c2b(0x208)]('✔\x20'+_0x1b4073)+a44_0xe64494[_0x159c2b(0x203)]('\x20('+_0x1ef986+')'));else _0x25f89b[_0x159c2b(0x1eb)]?(console['log'](a44_0xe64494[_0x159c2b(0x20d)]('⚠\x20'+_0x1b4073)+a44_0xe64494[_0x159c2b(0x203)]('\x20('+_0x1ef986+'):\x20'+_0x25f89b[_0x159c2b(0x204)]['length']+'\x20warning(s)')),console[_0x159c2b(0x1f5)](formatValidationResult(_0x25f89b,_0x36328a,_0x1b4073))):(console[_0x159c2b(0x1f5)](a44_0xe64494[_0x159c2b(0x1ed)]('✖\x20'+_0x1b4073)+a44_0xe64494[_0x159c2b(0x203)]('\x20('+_0x1ef986+_0x159c2b(0x218)+_0x25f89b[_0x159c2b(0x207)][_0x159c2b(0x200)]+'\x20error(s)')),console[_0x159c2b(0x1f5)](formatValidationResult(_0x25f89b,_0x36328a,_0x1b4073)));}return console[_0x159c2b(0x1f5)](''),_0x1a4e09['hasErrors']?(console[_0x159c2b(0x1f5)](a44_0xe64494[_0x159c2b(0x1ed)]('Validation\x20failed:\x20'+_0x1a4e09[_0x159c2b(0x1fd)]+_0x159c2b(0x1fb)+_0x1a4e09[_0x159c2b(0x20a)]+_0x159c2b(0x205))),_0x1a4e09[_0x159c2b(0x1f3)]>0x0&&console[_0x159c2b(0x1f5)](a44_0xe64494[_0x159c2b(0x20d)](_0x1a4e09['warningCount']+_0x159c2b(0x214))),0x1):(console['log'](a44_0xe64494['green'](_0x159c2b(0x1ec)+_0x1a4e09[_0x159c2b(0x20a)]+'\x20file(s)\x20valid')),_0x1a4e09['warningCount']>0x0&&console['log'](a44_0xe64494[_0x159c2b(0x20d)](_0x1a4e09['warningCount']+_0x159c2b(0x214))),0x0);}}
1
+ const a44_0x5313d0=a44_0x5696;function a44_0x5696(_0x1d0d46,_0x29eea9){_0x1d0d46=_0x1d0d46-0xcb;const _0xdb03eb=a44_0xdb03();let _0x5696b9=_0xdb03eb[_0x1d0d46];return _0x5696b9;}(function(_0xfdbba,_0x491ed8){const _0x1fe414=a44_0x5696,_0x7dcbab=_0xfdbba();while(!![]){try{const _0x54b1ea=parseInt(_0x1fe414(0xdb))/0x1*(parseInt(_0x1fe414(0xf5))/0x2)+parseInt(_0x1fe414(0xe6))/0x3+parseInt(_0x1fe414(0xf3))/0x4+parseInt(_0x1fe414(0xf6))/0x5+parseInt(_0x1fe414(0xd1))/0x6*(parseInt(_0x1fe414(0xe8))/0x7)+parseInt(_0x1fe414(0xd0))/0x8+-parseInt(_0x1fe414(0xcd))/0x9*(parseInt(_0x1fe414(0xcb))/0xa);if(_0x54b1ea===_0x491ed8)break;else _0x7dcbab['push'](_0x7dcbab['shift']());}catch(_0xe31f76){_0x7dcbab['push'](_0x7dcbab['shift']());}}}(a44_0xdb03,0xcb4db));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_0x361e49 from'chalk';function a44_0xdb03(){const _0x59dda0=['dim','valid','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','\x20warning(s)','invalidCount','targetDir','red','helpText','3242169REUcCR','log','13699UmlaNn','type','validCount','errors','\x20file(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','endsWith','description','\x20warning(s)\x20found','parentSegment','length','17644YQBVOG','Error:\x20Directory\x20not\x20found:\x20','224522CmWgmy','1364020MPcaqJ','Error:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','no_parent','cwd','):\x20','.yml','40423730parLjU','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','9gVuvOj','verbose','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','12479864FMLxRh','1182ZPJInZ','\x20file(s)\x20valid','execute','errorCode','yellow','\x20error(s)','hasErrors','✔\x20All\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','error','14eVtgAU','green','warningCount'];a44_0xdb03=function(){return _0x59dda0;};return a44_0xdb03();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']='segment:validate';[a44_0x5313d0(0xef)]=a44_0x5313d0(0xd9);async[a44_0x5313d0(0xd3)](_0x1a12bd){const _0x17a610=a44_0x5313d0,{options:_0x569ae1,args:_0x3cd317}=_0x1a12bd,_0x299564=_0x569ae1,_0x1822cb=await resolveTarget({'arg':_0x3cd317[0x0],'contextParent':_0x569ae1[_0x17a610(0xf1)],'cwd':process[_0x17a610(0xfa)]()});if(!isSuccessfulResolution(_0x1822cb))return _0x1822cb[_0x17a610(0xd4)]===_0x17a610(0xf9)?(console[_0x17a610(0xda)](a44_0x361e49['yellow'](_0x17a610(0xcc))),console[_0x17a610(0xda)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x17a610(0xda)](_0x17a610(0xe0)),console[_0x17a610(0xda)](_0x17a610(0xcf))):(console['error'](a44_0x361e49['red'](_0x17a610(0xf7)+_0x1822cb['message']+'\x0a')),_0x1822cb[_0x17a610(0xe5)]&&console['error'](a44_0x361e49['cyan'](_0x1822cb[_0x17a610(0xe5)]))),0x1;const _0x29d22d=_0x1822cb[_0x17a610(0xe3)],_0x3287be=_0x1822cb[_0x17a610(0xe9)]==='file'?_0x1822cb['filePath']:undefined;if(!_0x3287be&&!existsSync(_0x29d22d))return console[_0x17a610(0xda)](a44_0x361e49[_0x17a610(0xe4)](_0x17a610(0xf4)+_0x29d22d+'\x0a')),0x1;let _0x452d27;if(_0x3287be){if(!_0x3287be[_0x17a610(0xee)](_0x17a610(0xfc))&&!_0x3287be[_0x17a610(0xee)]('.yaml'))return console[_0x17a610(0xda)](a44_0x361e49[_0x17a610(0xe4)](_0x17a610(0xf8)+_0x3287be+'\x0a')),0x1;_0x452d27=[_0x3287be];}else _0x452d27=findYamlFiles(_0x29d22d);if(_0x452d27[_0x17a610(0xf2)]===0x0)return console['error'](a44_0x361e49['red'](_0x17a610(0xed)+_0x29d22d+'\x0a')),0x1;const _0x3ae51f=validateYamlFiles(_0x452d27,_0x29d22d),_0x4a7068=calculateSummary(_0x3ae51f);for(const _0x2f470d of _0x3ae51f){if(!isValidationResult(_0x2f470d))continue;const {relativePath:_0x37db14,source:_0x242867,result:_0x43bbcd,fileType:_0x14df74}=_0x2f470d,_0x925f1f=_0x14df74;if(_0x43bbcd['valid']&&_0x43bbcd['warnings'][_0x17a610(0xf2)]===0x0)_0x299564[_0x17a610(0xce)]&&console[_0x17a610(0xe7)](a44_0x361e49[_0x17a610(0xdc)]('✔\x20'+_0x37db14)+a44_0x361e49[_0x17a610(0xde)]('\x20('+_0x925f1f+')'));else _0x43bbcd[_0x17a610(0xdf)]?(console[_0x17a610(0xe7)](a44_0x361e49[_0x17a610(0xd5)]('⚠\x20'+_0x37db14)+a44_0x361e49['dim']('\x20('+_0x925f1f+_0x17a610(0xfb)+_0x43bbcd['warnings']['length']+_0x17a610(0xe1))),console[_0x17a610(0xe7)](formatValidationResult(_0x43bbcd,_0x242867,_0x37db14))):(console[_0x17a610(0xe7)](a44_0x361e49[_0x17a610(0xe4)]('✖\x20'+_0x37db14)+a44_0x361e49['dim']('\x20('+_0x925f1f+_0x17a610(0xfb)+_0x43bbcd[_0x17a610(0xeb)][_0x17a610(0xf2)]+_0x17a610(0xd6))),console[_0x17a610(0xe7)](formatValidationResult(_0x43bbcd,_0x242867,_0x37db14)));}return console[_0x17a610(0xe7)](''),_0x4a7068[_0x17a610(0xd7)]?(console['log'](a44_0x361e49[_0x17a610(0xe4)]('Validation\x20failed:\x20'+_0x4a7068[_0x17a610(0xe2)]+_0x17a610(0xec)+_0x4a7068[_0x17a610(0xea)]+'\x20valid')),_0x4a7068[_0x17a610(0xdd)]>0x0&&console[_0x17a610(0xe7)](a44_0x361e49[_0x17a610(0xd5)](_0x4a7068[_0x17a610(0xdd)]+_0x17a610(0xf0))),0x1):(console['log'](a44_0x361e49['green'](_0x17a610(0xd8)+_0x4a7068['validCount']+_0x17a610(0xd2))),_0x4a7068[_0x17a610(0xdd)]>0x0&&console['log'](a44_0x361e49[_0x17a610(0xd5)](_0x4a7068[_0x17a610(0xdd)]+_0x17a610(0xf0))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x432079=a45_0x32b4;(function(_0x2a340b,_0x94cb67){const _0x5e4ba1=a45_0x32b4,_0x33807b=_0x2a340b();while(!![]){try{const _0x32bd0b=-parseInt(_0x5e4ba1(0x94))/0x1*(-parseInt(_0x5e4ba1(0x8e))/0x2)+parseInt(_0x5e4ba1(0x97))/0x3*(-parseInt(_0x5e4ba1(0xbd))/0x4)+parseInt(_0x5e4ba1(0xa6))/0x5*(parseInt(_0x5e4ba1(0xa3))/0x6)+-parseInt(_0x5e4ba1(0xc8))/0x7+-parseInt(_0x5e4ba1(0x9e))/0x8+-parseInt(_0x5e4ba1(0xb4))/0x9+-parseInt(_0x5e4ba1(0xcb))/0xa*(-parseInt(_0x5e4ba1(0xb2))/0xb);if(_0x32bd0b===_0x94cb67)break;else _0x33807b['push'](_0x33807b['shift']());}catch(_0x5f114a){_0x33807b['push'](_0x33807b['shift']());}}}(a45_0x5cc9,0xf40c7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x82ab3b from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x432079(0xb8)]=a45_0x432079(0xd1);[a45_0x432079(0xb3)]=a45_0x432079(0xce);async[a45_0x432079(0xc4)](_0x47f8a9){const _0x5a1aa6=a45_0x432079,{options:_0x571afd,args:_0x8c4111}=_0x47f8a9,_0x179495=_0x571afd[_0x5a1aa6(0x90)],_0x4389c9=_0x8c4111[0x0];try{const _0x2ca806=_0x571afd[_0x5a1aa6(0x8f)];_0x571afd[_0x5a1aa6(0x8b)]&&(console['error'](_0x5a1aa6(0xb0)+_0x571afd['site']),console[_0x5a1aa6(0xbc)](_0x5a1aa6(0xd4)+(_0x2ca806||_0x5a1aa6(0xb6))),_0x4389c9&&console[_0x5a1aa6(0xbc)](_0x5a1aa6(0xd3)+_0x4389c9),_0x179495&&console['error']('Recursive\x20mode:\x20enabled'));if(!_0x2ca806)return console[_0x5a1aa6(0xbc)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x5a1aa6(0xbc)](''),console['error'](_0x5a1aa6(0xc3)),console['error'](_0x5a1aa6(0xba)),console['error'](_0x5a1aa6(0xb1)),console['error'](''),console[_0x5a1aa6(0xbc)](_0x5a1aa6(0xa7)),0x1;const _0x26244b=_0x4389c9&&(_0x4389c9[_0x5a1aa6(0x9f)]('*')||_0x4389c9[_0x5a1aa6(0x9f)]('?'));if(_0x26244b)return await this['listWithPattern'](_0x47f8a9,_0x2ca806,_0x4389c9);const _0x31414a=_0x4389c9?_0x2ca806+'/'+_0x4389c9:_0x2ca806;return _0x179495?await this['listRecursive'](_0x47f8a9,_0x31414a):await this[_0x5a1aa6(0x95)](_0x47f8a9,_0x31414a);}catch(_0x53f31f){if(_0x53f31f instanceof SDKError)return console[_0x5a1aa6(0xbc)](_0x5a1aa6(0xb5)+_0x53f31f[_0x5a1aa6(0xc1)]),_0x53f31f['cause']&&console['error'](_0x5a1aa6(0xa8)+_0x53f31f[_0x5a1aa6(0xbe)]),0x1;throw _0x53f31f;}}async['listWithPattern'](_0x52cff0,_0x4e0d12,_0x10984c){const _0x175257=a45_0x432079,{options:_0x5588a7,tdx:_0x4faadc}=_0x52cff0,_0x5285f1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4e0d12+'\x27...',()=>_0x4faadc[_0x175257(0x89)]['resolvePathToResource'](_0x4e0d12),{'verbose':_0x5588a7['verbose']}),_0x17dd0c=_0x5285f1['data'],_0x496662=await withSpinner(_0x175257(0x91),()=>_0x4faadc[_0x175257(0x89)][_0x175257(0xbf)](_0x17dd0c[_0x175257(0x9b)],_0x17dd0c[_0x175257(0xa4)]),{'verbose':_0x5588a7[_0x175257(0x8b)]}),{folders:_0x1cab7b,segments:_0x446c00,journeys:_0x4ea79b}=_0x496662[_0x175257(0xca)],_0x28069a=_0x10984c[_0x175257(0xd2)](/[.+^${}()|[\]\\]/g,_0x175257(0x99))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x50b064=new RegExp('^'+_0x28069a+'$','i'),_0x33f224=_0x1cab7b[_0x175257(0xd0)](_0x5c8fa8=>_0x50b064[_0x175257(0xc0)](_0x5c8fa8[_0x175257(0xb8)])),_0x518851=_0x446c00['filter'](_0x250107=>_0x50b064[_0x175257(0xc0)](_0x250107[_0x175257(0xb8)])),_0x3fff7b=_0x4ea79b[_0x175257(0xd0)](_0x540af3=>_0x50b064[_0x175257(0xc0)](_0x540af3['journeyBundleName'])),_0x3e3606=_0x33f224[_0x175257(0xd6)]+_0x518851[_0x175257(0xd6)]+_0x3fff7b[_0x175257(0xd6)];console['error'](_0x175257(0xc7)+_0x33f224[_0x175257(0xd6)]+_0x175257(0xc5)+(_0x33f224[_0x175257(0xd6)]!==0x1?'s':'')+',\x20'+_0x518851[_0x175257(0xd6)]+_0x175257(0xd7)+(_0x518851['length']!==0x1?'s':'')+_0x175257(0xd5)+_0x3fff7b[_0x175257(0xd6)]+_0x175257(0x8a)+(_0x3fff7b['length']!==0x1?'s':'')+_0x175257(0xab)+_0x10984c+'\x27');const _0x1d5ce1=_0x462dde=>{const _0x319120=_0x175257;return getConsoleNextUrl(_0x5588a7['site'],_0x319120(0xcc)+_0x17dd0c[_0x319120(0x9b)]+_0x319120(0xae)+_0x462dde);},_0x2536d3=_0x5588a7[_0x175257(0x8c)]===_0x175257(0x9a)||_0x5588a7[_0x175257(0x8c)]===_0x175257(0xc2);if(_0x2536d3){const _0x303522=[..._0x33f224['map'](_0x55b70a=>({..._0x55b70a,'type':'folder'})),..._0x518851[_0x175257(0x93)](_0xa70c7e=>({..._0xa70c7e,'type':_0x175257(0x89),'url':_0x1d5ce1(_0xa70c7e['id'])})),..._0x3fff7b[_0x175257(0x93)](_0x371ca9=>({..._0x371ca9,'name':_0x371ca9[_0x175257(0x9d)],'type':_0x175257(0x8d)}))][_0x175257(0xa5)]((_0x506a85,_0x1c370d)=>_0x506a85[_0x175257(0xb8)]['localeCompare'](_0x1c370d[_0x175257(0xb8)]));await handleSDKOutput(_0x303522,_0x5588a7);}else{if(_0x3e3606===0x0)console[_0x175257(0xb9)](_0x175257(0x96)+_0x10984c);else{console[_0x175257(0xb9)](a45_0x82ab3b[_0x175257(0xc6)]('['+_0x4e0d12+_0x175257(0xa1)+_0x10984c+'\x27'));const _0x255a32=formatFlatList(_0x33f224,_0x518851,{'showMetadata':!![],'getSegmentUrl':_0x1d5ce1},_0x3fff7b);console[_0x175257(0xb9)](_0x255a32);}}return 0x0;}async[a45_0x432079(0x95)](_0xaf76d9,_0x56559){const _0xa5ef97=a45_0x432079,{options:_0x3df3fc,tdx:_0x1108e5}=_0xaf76d9,_0x597258=await withSpinner(_0xa5ef97(0xad)+_0x56559+_0xa5ef97(0xa9),()=>_0x1108e5['segment'][_0xa5ef97(0x88)](_0x56559),{'verbose':_0x3df3fc[_0xa5ef97(0x8b)]}),_0x1219e4=_0x597258['data'];_0x3df3fc[_0xa5ef97(0x8b)]&&(console[_0xa5ef97(0xbc)](_0xa5ef97(0xc9)+_0x1219e4['parentId']),_0x1219e4[_0xa5ef97(0xa4)]&&console['error'](_0xa5ef97(0xa0)+_0x1219e4['folderId']));const _0x5986c6=await withSpinner(_0xa5ef97(0x91),()=>_0x1108e5[_0xa5ef97(0x89)][_0xa5ef97(0xbf)](_0x1219e4[_0xa5ef97(0x9b)],_0x1219e4[_0xa5ef97(0xa4)]),{'verbose':_0x3df3fc['verbose']}),{folders:_0xbfc629,segments:_0x53e3e2,journeys:_0x58903c}=_0x5986c6[_0xa5ef97(0xca)],_0xce2c6c=_0xbfc629['length']+_0x53e3e2['length']+_0x58903c['length'];console[_0xa5ef97(0xbc)](_0xa5ef97(0xc7)+_0xbfc629['length']+'\x20folder'+(_0xbfc629[_0xa5ef97(0xd6)]!==0x1?'s':'')+',\x20'+_0x53e3e2['length']+'\x20segment'+(_0x53e3e2[_0xa5ef97(0xd6)]!==0x1?'s':'')+_0xa5ef97(0xd5)+_0x58903c[_0xa5ef97(0xd6)]+_0xa5ef97(0x8a)+(_0x58903c[_0xa5ef97(0xd6)]!==0x1?'s':''));const _0x22e260=_0x3f1826=>{const _0x42a2aa=_0xa5ef97;return getConsoleNextUrl(_0x3df3fc[_0x42a2aa(0xb7)],_0x42a2aa(0xcc)+_0x1219e4['parentId']+'/e/'+_0x3f1826);},_0x40857d=_0x155604=>{const _0x2e6c94=_0xa5ef97;return getConsoleNextUrl(_0x3df3fc[_0x2e6c94(0xb7)],_0x2e6c94(0xcc)+_0x1219e4[_0x2e6c94(0x9b)]+_0x2e6c94(0xae)+_0x155604+_0x2e6c94(0x92));},_0x45157d=_0x3df3fc['format']==='json'||_0x3df3fc['format']===_0xa5ef97(0xc2);if(_0x45157d){const _0x4a5ba6=[..._0xbfc629[_0xa5ef97(0x93)](_0x58ebbc=>({..._0x58ebbc,'type':'folder'})),..._0x53e3e2[_0xa5ef97(0x93)](_0x2eae31=>({..._0x2eae31,'type':_0xa5ef97(0x89),'url':_0x22e260(_0x2eae31['id'])})),..._0x58903c[_0xa5ef97(0x93)](_0x4ca583=>({..._0x4ca583,'name':_0x4ca583[_0xa5ef97(0x9d)],'type':_0xa5ef97(0x8d),'url':_0x40857d(_0x4ca583['id'])}))]['sort']((_0x3079da,_0x106a51)=>_0x3079da[_0xa5ef97(0xb8)]['localeCompare'](_0x106a51[_0xa5ef97(0xb8)]));await handleSDKOutput(_0x4a5ba6,_0x3df3fc);}else{if(_0xce2c6c===0x0)console[_0xa5ef97(0xb9)](a45_0x82ab3b[_0xa5ef97(0xc6)]('['+_0x56559+']')),console[_0xa5ef97(0xb9)](_0xa5ef97(0x98));else{console['log'](a45_0x82ab3b[_0xa5ef97(0xc6)]('['+_0x56559+']'));const _0x21d258=formatFlatList(_0xbfc629,_0x53e3e2,{'showMetadata':!![],'getSegmentUrl':_0x22e260,'getJourneyUrl':_0x40857d},_0x58903c);console[_0xa5ef97(0xb9)](_0x21d258);}}return 0x0;}async[a45_0x432079(0xaf)](_0x1a2061,_0x28f176){const _0x228e7a=a45_0x432079,{options:_0x48fa30,tdx:_0x2f3364}=_0x1a2061,_0x2d6f3e=await withSpinner(_0x228e7a(0xad)+_0x28f176+_0x228e7a(0xa9),()=>_0x2f3364['segment']['resolvePathToResource'](_0x28f176),{'verbose':_0x48fa30[_0x228e7a(0x8b)]}),_0x759a67=_0x2d6f3e[_0x228e7a(0xca)];_0x48fa30['verbose']&&(console[_0x228e7a(0xbc)](_0x228e7a(0xc9)+_0x759a67['parentId']),_0x759a67[_0x228e7a(0xa4)]&&console[_0x228e7a(0xbc)](_0x228e7a(0xa0)+_0x759a67[_0x228e7a(0xa4)]));const _0x4a2c10=_0x48fa30[_0x228e7a(0xa2)]||0xa,_0x42accd=await withSpinner(_0x228e7a(0xbb),()=>_0x2f3364['segment'][_0x228e7a(0xaf)](_0x759a67[_0x228e7a(0x9b)],_0x759a67[_0x228e7a(0xa4)],0x0,_0x4a2c10),{'verbose':_0x48fa30[_0x228e7a(0x8b)]}),_0x973d55=_0x42accd['data'],_0x23ca6d=_0x201164=>{const _0x468f4e=_0x228e7a;let _0x17ef62=0x0,_0x37d628=0x0,_0x1af8b7=0x0;for(const _0x29b822 of _0x201164){if(_0x29b822[_0x468f4e(0xcd)]==='folder')_0x17ef62++;else{if(_0x29b822[_0x468f4e(0xcd)]===_0x468f4e(0x89))_0x37d628++;else{if(_0x29b822[_0x468f4e(0xcd)]===_0x468f4e(0x8d))_0x1af8b7++;}}if(_0x29b822['children']){const _0x1dc50d=_0x23ca6d(_0x29b822[_0x468f4e(0xac)]);_0x17ef62+=_0x1dc50d['folders'],_0x37d628+=_0x1dc50d[_0x468f4e(0xd1)],_0x1af8b7+=_0x1dc50d[_0x468f4e(0xcf)];}}return{'folders':_0x17ef62,'segments':_0x37d628,'journeys':_0x1af8b7};},_0x3d16cd=_0x23ca6d(_0x973d55);console[_0x228e7a(0xbc)](_0x228e7a(0xaa)+_0x3d16cd[_0x228e7a(0x9c)]+_0x228e7a(0xc5)+(_0x3d16cd[_0x228e7a(0x9c)]!==0x1?'s':'')+',\x20'+_0x3d16cd[_0x228e7a(0xd1)]+_0x228e7a(0xd7)+(_0x3d16cd[_0x228e7a(0xd1)]!==0x1?'s':'')+_0x228e7a(0xd5)+_0x3d16cd[_0x228e7a(0xcf)]+_0x228e7a(0x8a)+(_0x3d16cd[_0x228e7a(0xcf)]!==0x1?'s':''));const _0x48c899=_0x4534d4=>{const _0x54a682=_0x228e7a;return getConsoleNextUrl(_0x48fa30[_0x54a682(0xb7)],_0x54a682(0xcc)+_0x759a67[_0x54a682(0x9b)]+_0x54a682(0xae)+_0x4534d4);},_0x32528e=_0x35e3e9=>{const _0x358911=_0x228e7a;return getConsoleNextUrl(_0x48fa30['site'],_0x358911(0xcc)+_0x759a67[_0x358911(0x9b)]+'/e/'+_0x35e3e9+_0x358911(0x92));};if(_0x48fa30[_0x228e7a(0x8c)]==='json'||_0x48fa30[_0x228e7a(0x8c)]===_0x228e7a(0xc2))await handleSDKOutput(_0x973d55,_0x48fa30);else{console[_0x228e7a(0xb9)](a45_0x82ab3b['dim']('['+_0x28f176+']'));const _0xacd7ba=formatTree(_0x973d55,{'showMetadata':!![],'getSegmentUrl':_0x48c899,'getJourneyUrl':_0x32528e});console[_0x228e7a(0xb9)](_0xacd7ba);}return 0x0;}}function a45_0x32b4(_0x46b74d,_0x2b773d){_0x46b74d=_0x46b74d-0x88;const _0x5cc947=a45_0x5cc9();let _0x32b454=_0x5cc947[_0x46b74d];return _0x32b454;}function a45_0x5cc9(){const _0x4be5e9=['description','16317036xmGEDC','Error:\x20','(not\x20set)','site','name','log','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Building\x20hierarchy\x20tree...','error','74444KCTNPp','cause','listUnifiedWithJourneys','test','message','jsonl','Set\x20a\x20parent\x20segment\x20context\x20first:','execute','\x20folder','dim','✔\x20Found\x20','6836914maAaMI','Parent\x20ID:\x20','data','1430ralNQN','/app/ps/','type','List\x20folders\x20and\x20child\x20segments','journeys','filter','segments','replace','Folder/pattern\x20arg:\x20','Parent\x20segment\x20context:\x20',',\x20and\x20','length','\x20segment','resolvePathToResource','segment','\x20journey','verbose','format','journey','134xQZaZh','parentSegment','recursive','Listing\x20folders,\x20segments,\x20and\x20journeys...','/j/da','map','11991gYjVjh','listUnified','No\x20items\x20match\x20pattern:\x20','21zgxgrr','(empty)','\x5c$&','json','parentId','folders','journeyBundleName','651048sUQptS','includes','Folder\x20ID:\x20',']\x20matching\x20\x27','maxDepth','264DCfeOq','folderId','sort','153185qCXCKc','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20\x20Cause:\x20','\x27...','✔\x20Built\x20tree\x20with\x20','\x20matching\x20\x27','children','Resolving\x20path\x20\x27','/e/','listRecursive','Site:\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','142274eWVtYa'];a45_0x5cc9=function(){return _0x4be5e9;};return a45_0x5cc9();}
1
+ const a45_0x51bea9=a45_0x2bfd;(function(_0x1e088f,_0x427cce){const _0x269d3c=a45_0x2bfd,_0x1a074f=_0x1e088f();while(!![]){try{const _0x4234d6=-parseInt(_0x269d3c(0x167))/0x1*(-parseInt(_0x269d3c(0x1a2))/0x2)+-parseInt(_0x269d3c(0x189))/0x3+-parseInt(_0x269d3c(0x159))/0x4*(-parseInt(_0x269d3c(0x164))/0x5)+parseInt(_0x269d3c(0x17a))/0x6*(parseInt(_0x269d3c(0x19a))/0x7)+-parseInt(_0x269d3c(0x18c))/0x8+-parseInt(_0x269d3c(0x176))/0x9*(-parseInt(_0x269d3c(0x175))/0xa)+parseInt(_0x269d3c(0x19e))/0xb*(-parseInt(_0x269d3c(0x16d))/0xc);if(_0x4234d6===_0x427cce)break;else _0x1a074f['push'](_0x1a074f['shift']());}catch(_0x399148){_0x1a074f['push'](_0x1a074f['shift']());}}}(a45_0x59cb,0xa4bd0));function a45_0x59cb(){const _0x1fe61a=['\x5c$&','24AwALCr','parentId','\x20folder','log','journeyBundleName','Listing\x20folders,\x20segments,\x20and\x20journeys...','Parent\x20ID:\x20','name','46490kzjeoP','1773XbygOH','List\x20folders\x20and\x20child\x20segments','execute','✔\x20Built\x20tree\x20with\x20','2394888JQOIvr','\x20journey','Recursive\x20mode:\x20enabled','Folder/pattern\x20arg:\x20','listRecursive','folder','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22',']\x20matching\x20\x27','folderId','segments','journeys','cause','data','\x20segment','sort','4041186UUutGv','jsonl','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','10572456OcFLJW','type','folders','json','\x20\x20Cause:\x20','/e/','resolvePathToResource','listWithPattern','Resolving\x20path\x20\x27','/app/ps/','filter','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','format','\x20matching\x20\x27','21VPvBsK','map','\x27...','Set\x20a\x20parent\x20segment\x20context\x20first:','3562163kYRvBd','segment','listUnified','localeCompare','1307604KCJbDB','dim','listUnifiedWithJourneys','/j/da','2447908MAReqP','journey','recursive',',\x20and\x20','length','Error:\x20No\x20parent\x20segment\x20context\x20set.','Resolving\x20parent\x20segment\x20\x27','description','site','error','Building\x20hierarchy\x20tree...','10NTTpaR','replace','✔\x20Found\x20','1ocjqwJ','parentSegment','(empty)','children','verbose'];a45_0x59cb=function(){return _0x1fe61a;};return a45_0x59cb();}import{BaseCommand}from'./command.js';function a45_0x2bfd(_0x900ba2,_0x329407){_0x900ba2=_0x900ba2-0x157;const _0x59cb03=a45_0x59cb();let _0x2bfd72=_0x59cb03[_0x900ba2];return _0x2bfd72;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x3aaa93 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a45_0x51bea9(0x183);[a45_0x51bea9(0x160)]=a45_0x51bea9(0x177);async[a45_0x51bea9(0x178)](_0x2055c6){const _0x40f70f=a45_0x51bea9,{options:_0x198ac5,args:_0x2ff838}=_0x2055c6,_0x1be0e1=_0x198ac5[_0x40f70f(0x15b)],_0x34c20b=_0x2ff838[0x0];try{const _0x26d7cb=_0x198ac5[_0x40f70f(0x168)];_0x198ac5[_0x40f70f(0x16b)]&&(console[_0x40f70f(0x162)]('Site:\x20'+_0x198ac5[_0x40f70f(0x161)]),console[_0x40f70f(0x162)]('Parent\x20segment\x20context:\x20'+(_0x26d7cb||'(not\x20set)')),_0x34c20b&&console[_0x40f70f(0x162)](_0x40f70f(0x17d)+_0x34c20b),_0x1be0e1&&console['error'](_0x40f70f(0x17c)));if(!_0x26d7cb)return console[_0x40f70f(0x162)](_0x40f70f(0x15e)),console[_0x40f70f(0x162)](''),console['error'](_0x40f70f(0x19d)),console[_0x40f70f(0x162)](_0x40f70f(0x180)),console[_0x40f70f(0x162)](_0x40f70f(0x197)),console[_0x40f70f(0x162)](''),console[_0x40f70f(0x162)](_0x40f70f(0x18b)),0x1;const _0x45f123=_0x34c20b&&(_0x34c20b['includes']('*')||_0x34c20b['includes']('?'));if(_0x45f123)return await this['listWithPattern'](_0x2055c6,_0x26d7cb,_0x34c20b);const _0xaac500=_0x34c20b?_0x26d7cb+'/'+_0x34c20b:_0x26d7cb;return _0x1be0e1?await this['listRecursive'](_0x2055c6,_0xaac500):await this[_0x40f70f(0x1a0)](_0x2055c6,_0xaac500);}catch(_0x39828c){if(_0x39828c instanceof SDKError)return console[_0x40f70f(0x162)]('Error:\x20'+_0x39828c['message']),_0x39828c['cause']&&console['error'](_0x40f70f(0x190)+_0x39828c[_0x40f70f(0x185)]),0x1;throw _0x39828c;}}async[a45_0x51bea9(0x193)](_0x1c385a,_0x5d33af,_0x57429e){const _0x52d3a9=a45_0x51bea9,{options:_0x5122d2,tdx:_0x295a93}=_0x1c385a,_0x15a3e9=await withSpinner(_0x52d3a9(0x15f)+_0x5d33af+_0x52d3a9(0x19c),()=>_0x295a93[_0x52d3a9(0x19f)][_0x52d3a9(0x192)](_0x5d33af),{'verbose':_0x5122d2[_0x52d3a9(0x16b)]}),_0x17f0f1=_0x15a3e9[_0x52d3a9(0x186)],_0x16a21f=await withSpinner(_0x52d3a9(0x172),()=>_0x295a93[_0x52d3a9(0x19f)][_0x52d3a9(0x157)](_0x17f0f1[_0x52d3a9(0x16e)],_0x17f0f1['folderId']),{'verbose':_0x5122d2[_0x52d3a9(0x16b)]}),{folders:_0x4a5a59,segments:_0x5a7d19,journeys:_0x48f0a2}=_0x16a21f[_0x52d3a9(0x186)],_0x13fa60=_0x57429e[_0x52d3a9(0x165)](/[.+^${}()|[\]\\]/g,_0x52d3a9(0x16c))[_0x52d3a9(0x165)](/\*/g,'.*')[_0x52d3a9(0x165)](/\?/g,'.'),_0x1e4645=new RegExp('^'+_0x13fa60+'$','i'),_0x1dc50a=_0x4a5a59['filter'](_0x300621=>_0x1e4645['test'](_0x300621[_0x52d3a9(0x174)])),_0x57fd2a=_0x5a7d19[_0x52d3a9(0x196)](_0x4971d5=>_0x1e4645['test'](_0x4971d5['name'])),_0x589ae1=_0x48f0a2[_0x52d3a9(0x196)](_0x2e502c=>_0x1e4645['test'](_0x2e502c['journeyBundleName'])),_0x2597c3=_0x1dc50a[_0x52d3a9(0x15d)]+_0x57fd2a[_0x52d3a9(0x15d)]+_0x589ae1[_0x52d3a9(0x15d)];console['error'](_0x52d3a9(0x166)+_0x1dc50a[_0x52d3a9(0x15d)]+_0x52d3a9(0x16f)+(_0x1dc50a[_0x52d3a9(0x15d)]!==0x1?'s':'')+',\x20'+_0x57fd2a[_0x52d3a9(0x15d)]+_0x52d3a9(0x187)+(_0x57fd2a[_0x52d3a9(0x15d)]!==0x1?'s':'')+_0x52d3a9(0x15c)+_0x589ae1[_0x52d3a9(0x15d)]+'\x20journey'+(_0x589ae1[_0x52d3a9(0x15d)]!==0x1?'s':'')+_0x52d3a9(0x199)+_0x57429e+'\x27');const _0x569c05=_0x95525b=>{const _0x13d10c=_0x52d3a9;return getConsoleNextUrl(_0x5122d2[_0x13d10c(0x161)],_0x13d10c(0x195)+_0x17f0f1[_0x13d10c(0x16e)]+_0x13d10c(0x191)+_0x95525b);},_0x56f57e=_0x5122d2['format']===_0x52d3a9(0x18f)||_0x5122d2[_0x52d3a9(0x198)]===_0x52d3a9(0x18a);if(_0x56f57e){const _0x12db68=[..._0x1dc50a[_0x52d3a9(0x19b)](_0x25613c=>({..._0x25613c,'type':'folder'})),..._0x57fd2a['map'](_0x1b5cbb=>({..._0x1b5cbb,'type':_0x52d3a9(0x19f),'url':_0x569c05(_0x1b5cbb['id'])})),..._0x589ae1['map'](_0xd217a7=>({..._0xd217a7,'name':_0xd217a7[_0x52d3a9(0x171)],'type':_0x52d3a9(0x15a)}))]['sort']((_0x117670,_0x3c32f9)=>_0x117670[_0x52d3a9(0x174)][_0x52d3a9(0x1a1)](_0x3c32f9[_0x52d3a9(0x174)]));await handleSDKOutput(_0x12db68,_0x5122d2);}else{if(_0x2597c3===0x0)console[_0x52d3a9(0x170)]('No\x20items\x20match\x20pattern:\x20'+_0x57429e);else{console[_0x52d3a9(0x170)](a45_0x3aaa93[_0x52d3a9(0x1a3)]('['+_0x5d33af+_0x52d3a9(0x181)+_0x57429e+'\x27'));const _0x1bdec0=formatFlatList(_0x1dc50a,_0x57fd2a,{'showMetadata':!![],'getSegmentUrl':_0x569c05},_0x589ae1);console['log'](_0x1bdec0);}}return 0x0;}async['listUnified'](_0x50cf9b,_0x5d5cb3){const _0x52414d=a45_0x51bea9,{options:_0x54b47c,tdx:_0x1371da}=_0x50cf9b,_0x319c19=await withSpinner(_0x52414d(0x194)+_0x5d5cb3+_0x52414d(0x19c),()=>_0x1371da[_0x52414d(0x19f)]['resolvePathToResource'](_0x5d5cb3),{'verbose':_0x54b47c[_0x52414d(0x16b)]}),_0x16174a=_0x319c19[_0x52414d(0x186)];_0x54b47c['verbose']&&(console[_0x52414d(0x162)]('Parent\x20ID:\x20'+_0x16174a[_0x52414d(0x16e)]),_0x16174a[_0x52414d(0x182)]&&console[_0x52414d(0x162)]('Folder\x20ID:\x20'+_0x16174a['folderId']));const _0x53d0e8=await withSpinner(_0x52414d(0x172),()=>_0x1371da[_0x52414d(0x19f)][_0x52414d(0x157)](_0x16174a[_0x52414d(0x16e)],_0x16174a[_0x52414d(0x182)]),{'verbose':_0x54b47c['verbose']}),{folders:_0x1b1248,segments:_0x430137,journeys:_0xf3401f}=_0x53d0e8['data'],_0x3729a4=_0x1b1248['length']+_0x430137[_0x52414d(0x15d)]+_0xf3401f[_0x52414d(0x15d)];console[_0x52414d(0x162)](_0x52414d(0x166)+_0x1b1248['length']+_0x52414d(0x16f)+(_0x1b1248['length']!==0x1?'s':'')+',\x20'+_0x430137[_0x52414d(0x15d)]+_0x52414d(0x187)+(_0x430137[_0x52414d(0x15d)]!==0x1?'s':'')+',\x20and\x20'+_0xf3401f[_0x52414d(0x15d)]+_0x52414d(0x17b)+(_0xf3401f['length']!==0x1?'s':''));const _0x4ad104=_0x41ab3b=>{const _0x2f5988=_0x52414d;return getConsoleNextUrl(_0x54b47c[_0x2f5988(0x161)],_0x2f5988(0x195)+_0x16174a[_0x2f5988(0x16e)]+_0x2f5988(0x191)+_0x41ab3b);},_0x18d3ec=_0x5374d2=>{const _0x546073=_0x52414d;return getConsoleNextUrl(_0x54b47c[_0x546073(0x161)],_0x546073(0x195)+_0x16174a[_0x546073(0x16e)]+_0x546073(0x191)+_0x5374d2+_0x546073(0x158));},_0x1656af=_0x54b47c[_0x52414d(0x198)]===_0x52414d(0x18f)||_0x54b47c[_0x52414d(0x198)]==='jsonl';if(_0x1656af){const _0x10a95b=[..._0x1b1248[_0x52414d(0x19b)](_0xd54611=>({..._0xd54611,'type':_0x52414d(0x17f)})),..._0x430137[_0x52414d(0x19b)](_0x593c3a=>({..._0x593c3a,'type':_0x52414d(0x19f),'url':_0x4ad104(_0x593c3a['id'])})),..._0xf3401f[_0x52414d(0x19b)](_0x319ac0=>({..._0x319ac0,'name':_0x319ac0[_0x52414d(0x171)],'type':_0x52414d(0x15a),'url':_0x18d3ec(_0x319ac0['id'])}))][_0x52414d(0x188)]((_0x2a2c59,_0x2f33ee)=>_0x2a2c59['name'][_0x52414d(0x1a1)](_0x2f33ee[_0x52414d(0x174)]));await handleSDKOutput(_0x10a95b,_0x54b47c);}else{if(_0x3729a4===0x0)console[_0x52414d(0x170)](a45_0x3aaa93[_0x52414d(0x1a3)]('['+_0x5d5cb3+']')),console['log'](_0x52414d(0x169));else{console[_0x52414d(0x170)](a45_0x3aaa93[_0x52414d(0x1a3)]('['+_0x5d5cb3+']'));const _0x232451=formatFlatList(_0x1b1248,_0x430137,{'showMetadata':!![],'getSegmentUrl':_0x4ad104,'getJourneyUrl':_0x18d3ec},_0xf3401f);console['log'](_0x232451);}}return 0x0;}async[a45_0x51bea9(0x17e)](_0x23fcb5,_0x28f286){const _0x5bea99=a45_0x51bea9,{options:_0x177bc7,tdx:_0xf4289b}=_0x23fcb5,_0x5d1403=await withSpinner(_0x5bea99(0x194)+_0x28f286+_0x5bea99(0x19c),()=>_0xf4289b['segment'][_0x5bea99(0x192)](_0x28f286),{'verbose':_0x177bc7[_0x5bea99(0x16b)]}),_0x3a0653=_0x5d1403[_0x5bea99(0x186)];_0x177bc7[_0x5bea99(0x16b)]&&(console[_0x5bea99(0x162)](_0x5bea99(0x173)+_0x3a0653['parentId']),_0x3a0653['folderId']&&console[_0x5bea99(0x162)]('Folder\x20ID:\x20'+_0x3a0653[_0x5bea99(0x182)]));const _0x7cff63=_0x177bc7['maxDepth']||0xa,_0x36a29b=await withSpinner(_0x5bea99(0x163),()=>_0xf4289b[_0x5bea99(0x19f)][_0x5bea99(0x17e)](_0x3a0653[_0x5bea99(0x16e)],_0x3a0653[_0x5bea99(0x182)],0x0,_0x7cff63),{'verbose':_0x177bc7[_0x5bea99(0x16b)]}),_0x5a1fd0=_0x36a29b[_0x5bea99(0x186)],_0x29cda6=_0x5c3b48=>{const _0x3d671c=_0x5bea99;let _0x53fbd1=0x0,_0x164aae=0x0,_0x4b98eb=0x0;for(const _0x4780a5 of _0x5c3b48){if(_0x4780a5[_0x3d671c(0x18d)]===_0x3d671c(0x17f))_0x53fbd1++;else{if(_0x4780a5[_0x3d671c(0x18d)]==='segment')_0x164aae++;else{if(_0x4780a5[_0x3d671c(0x18d)]===_0x3d671c(0x15a))_0x4b98eb++;}}if(_0x4780a5[_0x3d671c(0x16a)]){const _0x3ab6cb=_0x29cda6(_0x4780a5[_0x3d671c(0x16a)]);_0x53fbd1+=_0x3ab6cb['folders'],_0x164aae+=_0x3ab6cb[_0x3d671c(0x183)],_0x4b98eb+=_0x3ab6cb[_0x3d671c(0x184)];}}return{'folders':_0x53fbd1,'segments':_0x164aae,'journeys':_0x4b98eb};},_0x283fc4=_0x29cda6(_0x5a1fd0);console[_0x5bea99(0x162)](_0x5bea99(0x179)+_0x283fc4['folders']+_0x5bea99(0x16f)+(_0x283fc4[_0x5bea99(0x18e)]!==0x1?'s':'')+',\x20'+_0x283fc4['segments']+_0x5bea99(0x187)+(_0x283fc4[_0x5bea99(0x183)]!==0x1?'s':'')+_0x5bea99(0x15c)+_0x283fc4[_0x5bea99(0x184)]+_0x5bea99(0x17b)+(_0x283fc4['journeys']!==0x1?'s':''));const _0x31175e=_0x48d44d=>{const _0x3aadaf=_0x5bea99;return getConsoleNextUrl(_0x177bc7['site'],_0x3aadaf(0x195)+_0x3a0653[_0x3aadaf(0x16e)]+_0x3aadaf(0x191)+_0x48d44d);},_0x1bfd4d=_0x33f56d=>{const _0x134233=_0x5bea99;return getConsoleNextUrl(_0x177bc7[_0x134233(0x161)],_0x134233(0x195)+_0x3a0653[_0x134233(0x16e)]+_0x134233(0x191)+_0x33f56d+'/j/da');};if(_0x177bc7[_0x5bea99(0x198)]===_0x5bea99(0x18f)||_0x177bc7['format']===_0x5bea99(0x18a))await handleSDKOutput(_0x5a1fd0,_0x177bc7);else{console[_0x5bea99(0x170)](a45_0x3aaa93[_0x5bea99(0x1a3)]('['+_0x28f286+']'));const _0x1700c6=formatTree(_0x5a1fd0,{'showMetadata':!![],'getSegmentUrl':_0x31175e,'getJourneyUrl':_0x1bfd4d});console['log'](_0x1700c6);}return 0x0;}}
@@ -1 +1 @@
1
- function a46_0x4a6f(_0x34070d,_0x5588d4){_0x34070d=_0x34070d-0xce;const _0x12af65=a46_0x12af();let _0x4a6ffc=_0x12af65[_0x34070d];return _0x4a6ffc;}const a46_0x246d28=a46_0x4a6f;(function(_0x489950,_0x4f5d92){const _0x2251c4=a46_0x4a6f,_0x258b1c=_0x489950();while(!![]){try{const _0x31a8ac=-parseInt(_0x2251c4(0xf1))/0x1*(-parseInt(_0x2251c4(0xf0))/0x2)+-parseInt(_0x2251c4(0xe6))/0x3+-parseInt(_0x2251c4(0xe7))/0x4+parseInt(_0x2251c4(0xe2))/0x5*(-parseInt(_0x2251c4(0xda))/0x6)+parseInt(_0x2251c4(0xdd))/0x7+parseInt(_0x2251c4(0xcf))/0x8+-parseInt(_0x2251c4(0xd6))/0x9;if(_0x31a8ac===_0x4f5d92)break;else _0x258b1c['push'](_0x258b1c['shift']());}catch(_0x1cde73){_0x258b1c['push'](_0x258b1c['shift']());}}}(a46_0x12af,0x87954));import{BaseCommand}from'./command.js';function a46_0x12af(){const _0x4fa5f4=['\x20row','Table:\x20','cause','6imCPmt','Catalog:\x20','\x20\x20Cause:\x20','5681459MnSrAg','execute','query','Site:\x20','name','1034005WKZrzg','verbose','showTable','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','1497672FXucjr','640968syBCZd','...','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Show\x20table\x20contents','data','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','table','description','show','2KZNMrT','504461bKparW','Error:\x20','Limit:\x20','catalog','\x20from\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','Usage:\x20tdx\x20show\x20<database.table>','3864248IraUXP','message','Querying\x20','validate','error','args','database','3397626gBnEBW'];a46_0x12af=function(){return _0x4fa5f4;};return a46_0x12af();}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_0x246d28(0xe1)]=a46_0x246d28(0xef);[a46_0x246d28(0xee)]=a46_0x246d28(0xea);async[a46_0x246d28(0xde)](_0x195bc6){const _0x24be90=a46_0x246d28;return this[_0x24be90(0xe4)](_0x195bc6);}async[a46_0x246d28(0xe4)](_0x2ae317){const _0x23985d=a46_0x246d28,{options:_0x14ac9,args:_0x2faa1d,tdx:_0xc29dde}=_0x2ae317;let _0x4c4e76;try{_0x4c4e76=parseTableReference(_0x2faa1d[0x0]);const _0x385f02=_0x14ac9[_0x23985d(0xd5)];!_0x4c4e76[_0x23985d(0xd5)]&&_0x385f02&&(_0x4c4e76[_0x23985d(0xd5)]=_0x385f02);const _0x5733d4=validateTableDescribeReference(_0x4c4e76);if(_0x5733d4)return console[_0x23985d(0xd3)](_0x23985d(0xf2)+_0x5733d4),console[_0x23985d(0xd3)](_0x23985d(0xce)),console['error'](_0x23985d(0xe9)),console[_0x23985d(0xd3)](_0x23985d(0xec)),0x1;}catch(_0x3014a1){return console[_0x23985d(0xd3)](_0x23985d(0xf2)+_0x3014a1[_0x23985d(0xd0)]),console[_0x23985d(0xd3)](_0x23985d(0xce)),console[_0x23985d(0xd3)](_0x23985d(0xe9)),console[_0x23985d(0xd3)](_0x23985d(0xec)),0x1;}const _0x51d206=_0x4c4e76[_0x23985d(0xf4)],_0x7b1228=_0x4c4e76[_0x23985d(0xd5)],_0x113fe8=_0x4c4e76[_0x23985d(0xed)],_0x2179a8=resolveLimit(_0x14ac9['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x14ac9[_0x23985d(0xe3)]&&(console['error'](_0x23985d(0xe0)+_0x14ac9['site']),_0x51d206&&console[_0x23985d(0xd3)](_0x23985d(0xdb)+_0x51d206),console['error']('Database:\x20'+_0x7b1228),console[_0x23985d(0xd3)](_0x23985d(0xd8)+_0x113fe8),console['error'](_0x23985d(0xf3)+_0x2179a8));const _0x26721e=_0x51d206?_0x51d206+'.'+_0x7b1228+'.'+_0x113fe8:_0x7b1228+'.'+_0x113fe8,_0x35d273=await withSpinner(_0x23985d(0xd1)+_0x26721e+_0x23985d(0xe8),()=>_0xc29dde[_0x23985d(0xdf)][_0x23985d(0xe4)](_0x7b1228,_0x113fe8,_0x2179a8,_0x51d206),{'verbose':_0x14ac9['verbose']}),_0x5a715e=_0x35d273['data'],_0x476fc3=_0x5a715e[_0x23985d(0xeb)];return _0x476fc3['length']===0x0?console[_0x23985d(0xd3)](_0x23985d(0xe5)):console['error']('✔\x20Retrieved\x20'+_0x476fc3['length']+_0x23985d(0xd7)+(_0x476fc3[_0x23985d(0xf7)]!==0x1?'s':'')+_0x23985d(0xf5)+_0x26721e),await handleSDKOutput(_0x476fc3,_0x14ac9),0x0;}catch(_0x2c58f2){if(_0x2c58f2 instanceof SDKError)return console[_0x23985d(0xd3)](_0x23985d(0xf2)+_0x2c58f2[_0x23985d(0xd0)]),_0x2c58f2[_0x23985d(0xd9)]&&console[_0x23985d(0xd3)](_0x23985d(0xdc)+_0x2c58f2['cause']),0x1;throw _0x2c58f2;}}[a46_0x246d28(0xd2)](_0x3d9da8){const _0x16d2c4=a46_0x246d28;if(_0x3d9da8[_0x16d2c4(0xd4)][_0x16d2c4(0xf7)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x3d9da8[_0x16d2c4(0xd4)]['length']>0x1)return _0x16d2c4(0xf6);return undefined;}}
1
+ function a46_0x5605(){const _0x503949=['cause','limit','Limit:\x20','10myyVYx','Usage:\x20tdx\x20show\x20<database.table>','query','Table:\x20','15BGSOkK','Error:\x20','831255ckyEsb','12tXoOjR','\x20from\x20','104388OXhZYw','length','1317452XrEYBW','error','Catalog:\x20','name','\x20row','436784bfEoUL','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','showTable','Site:\x20','args','table','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','catalog','8ZBUiMN','\x20\x20Cause:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','site','database','description','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','5681574KNcIkh','data','message','Querying\x20','782418LzKGsT','19776207fiGmgn'];a46_0x5605=function(){return _0x503949;};return a46_0x5605();}const a46_0x104d6f=a46_0x3fd3;(function(_0x4ef22f,_0x471e40){const _0x1dc7a1=a46_0x3fd3,_0x22084a=_0x4ef22f();while(!![]){try{const _0x40c199=parseInt(_0x1dc7a1(0x125))/0x1+-parseInt(_0x1dc7a1(0x127))/0x2+parseInt(_0x1dc7a1(0x122))/0x3+parseInt(_0x1dc7a1(0x103))/0x4*(-parseInt(_0x1dc7a1(0x120))/0x5)+-parseInt(_0x1dc7a1(0x123))/0x6*(parseInt(_0x1dc7a1(0x117))/0x7)+parseInt(_0x1dc7a1(0x10b))/0x8*(-parseInt(_0x1dc7a1(0x113))/0x9)+-parseInt(_0x1dc7a1(0x11c))/0xa*(-parseInt(_0x1dc7a1(0x118))/0xb);if(_0x40c199===_0x471e40)break;else _0x22084a['push'](_0x22084a['shift']());}catch(_0x5182ba){_0x22084a['push'](_0x22084a['shift']());}}}(a46_0x5605,0x528f2));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x3fd3(_0x14e2a8,_0x2c4dc0){_0x14e2a8=_0x14e2a8-0x103;const _0x560541=a46_0x5605();let _0x3fd3b1=_0x560541[_0x14e2a8];return _0x3fd3b1;}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_0x104d6f(0x12a)]='show';[a46_0x104d6f(0x111)]='Show\x20table\x20contents';async['execute'](_0x4fd272){const _0x323ed8=a46_0x104d6f;return this[_0x323ed8(0x105)](_0x4fd272);}async[a46_0x104d6f(0x105)](_0x57462a){const _0x36a1ac=a46_0x104d6f,{options:_0x59cd86,args:_0x337be6,tdx:_0x2d74d5}=_0x57462a;let _0x3c1803;try{_0x3c1803=parseTableReference(_0x337be6[0x0]);const _0x528c55=_0x59cd86[_0x36a1ac(0x110)];!_0x3c1803[_0x36a1ac(0x110)]&&_0x528c55&&(_0x3c1803['database']=_0x528c55);const _0x10cb5b=validateTableDescribeReference(_0x3c1803);if(_0x10cb5b)return console[_0x36a1ac(0x128)](_0x36a1ac(0x121)+_0x10cb5b),console['error'](_0x36a1ac(0x11d)),console[_0x36a1ac(0x128)](_0x36a1ac(0x10d)),console[_0x36a1ac(0x128)](_0x36a1ac(0x104)),0x1;}catch(_0x5e3d29){return console[_0x36a1ac(0x128)](_0x36a1ac(0x121)+_0x5e3d29[_0x36a1ac(0x115)]),console['error'](_0x36a1ac(0x11d)),console[_0x36a1ac(0x128)](_0x36a1ac(0x10d)),console[_0x36a1ac(0x128)](_0x36a1ac(0x104)),0x1;}const _0x42d120=_0x3c1803[_0x36a1ac(0x10a)],_0x568e02=_0x3c1803[_0x36a1ac(0x110)],_0x290a3e=_0x3c1803[_0x36a1ac(0x108)],_0x21be6a=resolveLimit(_0x59cd86[_0x36a1ac(0x11a)],DEFAULT_DISPLAY_LIMIT);try{_0x59cd86[_0x36a1ac(0x10e)]&&(console[_0x36a1ac(0x128)](_0x36a1ac(0x106)+_0x59cd86[_0x36a1ac(0x10f)]),_0x42d120&&console[_0x36a1ac(0x128)](_0x36a1ac(0x129)+_0x42d120),console[_0x36a1ac(0x128)]('Database:\x20'+_0x568e02),console[_0x36a1ac(0x128)](_0x36a1ac(0x11f)+_0x290a3e),console['error'](_0x36a1ac(0x11b)+_0x21be6a));const _0x154a6b=_0x42d120?_0x42d120+'.'+_0x568e02+'.'+_0x290a3e:_0x568e02+'.'+_0x290a3e,_0x209d85=await withSpinner(_0x36a1ac(0x116)+_0x154a6b+'...',()=>_0x2d74d5[_0x36a1ac(0x11e)]['showTable'](_0x568e02,_0x290a3e,_0x21be6a,_0x42d120),{'verbose':_0x59cd86[_0x36a1ac(0x10e)]}),_0x206ca0=_0x209d85['data'],_0x1985f6=_0x206ca0[_0x36a1ac(0x114)];return _0x1985f6[_0x36a1ac(0x126)]===0x0?console[_0x36a1ac(0x128)](_0x36a1ac(0x112)):console[_0x36a1ac(0x128)]('✔\x20Retrieved\x20'+_0x1985f6[_0x36a1ac(0x126)]+_0x36a1ac(0x12b)+(_0x1985f6[_0x36a1ac(0x126)]!==0x1?'s':'')+_0x36a1ac(0x124)+_0x154a6b),await handleSDKOutput(_0x1985f6,_0x59cd86),0x0;}catch(_0x535f35){if(_0x535f35 instanceof SDKError)return console[_0x36a1ac(0x128)](_0x36a1ac(0x121)+_0x535f35[_0x36a1ac(0x115)]),_0x535f35[_0x36a1ac(0x119)]&&console['error'](_0x36a1ac(0x10c)+_0x535f35[_0x36a1ac(0x119)]),0x1;throw _0x535f35;}}['validate'](_0x1467ba){const _0x1d8ddd=a46_0x104d6f;if(_0x1467ba[_0x1d8ddd(0x107)][_0x1d8ddd(0x126)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x1467ba[_0x1d8ddd(0x107)][_0x1d8ddd(0x126)]>0x1)return _0x1d8ddd(0x109);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x5f05f2=a47_0x4071;(function(_0x19830d,_0x50ff4f){const _0x87f3d0=a47_0x4071,_0x48d8ab=_0x19830d();while(!![]){try{const _0x3b83d0=-parseInt(_0x87f3d0(0xac))/0x1*(parseInt(_0x87f3d0(0x99))/0x2)+-parseInt(_0x87f3d0(0xb2))/0x3*(parseInt(_0x87f3d0(0x85))/0x4)+parseInt(_0x87f3d0(0xa4))/0x5+-parseInt(_0x87f3d0(0x95))/0x6*(parseInt(_0x87f3d0(0x8c))/0x7)+parseInt(_0x87f3d0(0x88))/0x8*(parseInt(_0x87f3d0(0xaa))/0x9)+parseInt(_0x87f3d0(0x81))/0xa*(parseInt(_0x87f3d0(0x94))/0xb)+-parseInt(_0x87f3d0(0x83))/0xc;if(_0x3b83d0===_0x50ff4f)break;else _0x48d8ab['push'](_0x48d8ab['shift']());}catch(_0x18afe3){_0x48d8ab['push'](_0x48d8ab['shift']());}}}(a47_0x48bf,0xd7b73));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0x4071(_0xbef5d3,_0x46344c){_0xbef5d3=_0xbef5d3-0x80;const _0x48bf8a=a47_0x48bf();let _0x40713b=_0x48bf8a[_0xbef5d3];return _0x40713b;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x48bf(){const _0x1dfc35=['4138665EykdFN','error','config','cyan','jobs','No\x20credential\x20found','117RyArLJ','execute','109hxenKR','message','email','env','Read\x20credential\x20from\x20','last_name','82785IVpqEi','TDX_PROFILE\x20env','site:\x20','3991490aQAjnU','session','10051200djFsFJ','displayWithSources','12BDjFiO','account_id','getUserInfo','429304wDeiFj','first_name','(from\x20','N/A','104503ZCqfEw','User:','join','bold','filter','\x20profile:\x20','log','name','33bzwTDL','204CNvTes','profileSource','profile','Name:','7546ySnmCw','✓\x20Authentication\x20successful\x0a','dim','description','✗\x20Validation\x20failed:\x20','status','OAuth','yellow','Account\x20ID:','tdx','red'];a47_0x48bf=function(){return _0x1dfc35;};return a47_0x48bf();}import a47_0x46408d from'chalk';export class StatusCommand extends BaseCommand{[a47_0x5f05f2(0x93)]=a47_0x5f05f2(0x9e);[a47_0x5f05f2(0x9c)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a47_0x5f05f2(0xab)](_0x349a1a){const _0x1270f8=a47_0x5f05f2,{options:_0x372000,tdx:_0x52645c}=_0x349a1a,_0x32d121=_0x372000['site'],_0x4e7029=new GlobalContext(_0x372000),_0x1168e0=_0x4e7029[_0x1270f8(0x97)],_0x4540fa=_0x4e7029[_0x1270f8(0x96)],_0x1e4f89=_0x4540fa==='cli'?'CLI\x20flag':_0x4540fa===_0x1270f8(0x82)?_0x1270f8(0x82):_0x4540fa===_0x1270f8(0xaf)?_0x1270f8(0xb3):_0x4540fa==='config'?_0x1270f8(0xa6):null,_0x59ccf2=_0x1168e0?a47_0x46408d['cyan'](_0x1168e0):a47_0x46408d['dim'](_0x1270f8(0x8b)),_0x294db4=_0x1e4f89?'\x20'+a47_0x46408d['dim'](_0x1270f8(0x8a)+_0x1e4f89+')'):'';console[_0x1270f8(0x92)](a47_0x46408d[_0x1270f8(0x8f)](_0x1270f8(0xa2))+_0x1270f8(0x91)+_0x59ccf2+_0x294db4+'\x20'+a47_0x46408d['dim']('(')+_0x1270f8(0x80)+a47_0x46408d[_0x1270f8(0xa7)](_0x32d121)+a47_0x46408d[_0x1270f8(0x9b)](')'));const _0x32b2ee=await getOAuthTokens(_0x1168e0);if(_0x32b2ee)console[_0x1270f8(0x92)]('Credential\x20type:\x20'+a47_0x46408d[_0x1270f8(0xa7)](_0x1270f8(0x9f)));else{const _0x2a23ca=await resolveAPIKeyAsync(_0x32d121,_0x1168e0);if(_0x2a23ca){const {source:_0x1468b8,isDeprecated:_0x50b08a}=_0x2a23ca,_0x32c994=_0x1270f8(0xb0)+a47_0x46408d['cyan'](_0x1468b8);console[_0x1270f8(0x92)](_0x50b08a?a47_0x46408d['yellow'](_0x32c994):_0x32c994);}else console[_0x1270f8(0x92)](a47_0x46408d[_0x1270f8(0xa0)](_0x1270f8(0xa9)));}let _0x3be891=![];try{const _0x39f055=await _0x52645c[_0x1270f8(0xa8)][_0x1270f8(0x87)]();console['log'](a47_0x46408d['green'](_0x1270f8(0x9a))),console[_0x1270f8(0x92)](a47_0x46408d['bold'](_0x1270f8(0x8d))+'\x20'+a47_0x46408d[_0x1270f8(0xa7)](_0x39f055[_0x1270f8(0xae)]));if(_0x39f055['first_name']||_0x39f055[_0x1270f8(0xb1)]){const _0x5042e8=[_0x39f055[_0x1270f8(0x89)],_0x39f055[_0x1270f8(0xb1)]][_0x1270f8(0x90)](Boolean)[_0x1270f8(0x8e)]('\x20');console[_0x1270f8(0x92)](a47_0x46408d['bold'](_0x1270f8(0x98))+'\x20'+_0x5042e8);}_0x39f055[_0x1270f8(0x86)]&&console[_0x1270f8(0x92)](a47_0x46408d[_0x1270f8(0x8f)](_0x1270f8(0xa1))+'\x20'+a47_0x46408d[_0x1270f8(0xa0)](_0x39f055['account_id'])),_0x3be891=!![];}catch(_0x467557){_0x467557 instanceof HTTPClientError&&_0x467557[_0x1270f8(0x9e)]===0x191?printAuthError(_0x467557,!![],_0x1168e0):console[_0x1270f8(0xa5)](a47_0x46408d[_0x1270f8(0xa3)](_0x1270f8(0x9d)+(_0x467557 instanceof Error?_0x467557[_0x1270f8(0xad)]:String(_0x467557))));}return console['log'](),_0x4e7029[_0x1270f8(0x84)](),_0x3be891?0x0:0x1;}}
1
+ function a47_0x2006(){const _0x41c1f9=['OAuth','env','red','737087BJmDJG','No\x20credential\x20found','email','tdx','execute','N/A','status','cli','error','session','first_name','account_id','config','2873044TVXPPy','cyan','filter','6oYpnph','site:\x20','5775360tjsfdf','CLI\x20flag','Name:','699640XSTUxV','yellow','bold','Read\x20credential\x20from\x20','✓\x20Authentication\x20successful\x0a','Show\x20authentication\x20status\x20and\x20current\x20context','name','User:','359679cwiSjA','log','1533850jnYWOb','jobs','(from\x20','✗\x20Validation\x20failed:\x20','last_name','green','profile','1985795AkMRPV','dim','join','displayWithSources','Account\x20ID:'];a47_0x2006=function(){return _0x41c1f9;};return a47_0x2006();}const a47_0x1867fa=a47_0xf300;(function(_0x36f7cc,_0x31f338){const _0x39d690=a47_0xf300,_0x3625fb=_0x36f7cc();while(!![]){try{const _0x15da8f=parseInt(_0x39d690(0x1da))/0x1+-parseInt(_0x39d690(0x1ea))/0x2*(parseInt(_0x39d690(0x1c9))/0x3)+-parseInt(_0x39d690(0x1e7))/0x4+-parseInt(_0x39d690(0x1cb))/0x5+parseInt(_0x39d690(0x1ec))/0x6+parseInt(_0x39d690(0x1d2))/0x7+-parseInt(_0x39d690(0x1c1))/0x8;if(_0x15da8f===_0x31f338)break;else _0x3625fb['push'](_0x3625fb['shift']());}catch(_0x816ca6){_0x3625fb['push'](_0x3625fb['shift']());}}}(a47_0x2006,0x7ccbf));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0xf300(_0x1876c7,_0x2c1a6b){_0x1876c7=_0x1876c7-0x1bf;const _0x200602=a47_0x2006();let _0xf3008f=_0x200602[_0x1876c7];return _0xf3008f;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x5b17df from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1867fa(0x1c7)]=a47_0x1867fa(0x1e0);['description']=a47_0x1867fa(0x1c6);async[a47_0x1867fa(0x1de)](_0x2a1c19){const _0x3d61c0=a47_0x1867fa,{options:_0x357513,tdx:_0x2d9638}=_0x2a1c19,_0x16b6ec=_0x357513['site'],_0x4991f9=new GlobalContext(_0x357513),_0x5bd165=_0x4991f9[_0x3d61c0(0x1d1)],_0x348372=_0x4991f9['profileSource'],_0x14314e=_0x348372===_0x3d61c0(0x1e1)?_0x3d61c0(0x1bf):_0x348372===_0x3d61c0(0x1e3)?'session':_0x348372===_0x3d61c0(0x1d8)?'TDX_PROFILE\x20env':_0x348372==='config'?_0x3d61c0(0x1e6):null,_0x2245c5=_0x5bd165?a47_0x5b17df[_0x3d61c0(0x1e8)](_0x5bd165):a47_0x5b17df[_0x3d61c0(0x1d3)](_0x3d61c0(0x1df)),_0x1849f5=_0x14314e?'\x20'+a47_0x5b17df['dim'](_0x3d61c0(0x1cd)+_0x14314e+')'):'';console['log'](a47_0x5b17df['bold'](_0x3d61c0(0x1dd))+'\x20profile:\x20'+_0x2245c5+_0x1849f5+'\x20'+a47_0x5b17df[_0x3d61c0(0x1d3)]('(')+_0x3d61c0(0x1eb)+a47_0x5b17df[_0x3d61c0(0x1e8)](_0x16b6ec)+a47_0x5b17df[_0x3d61c0(0x1d3)](')'));const _0x5a98c1=await getOAuthTokens(_0x5bd165);if(_0x5a98c1)console[_0x3d61c0(0x1ca)]('Credential\x20type:\x20'+a47_0x5b17df['cyan'](_0x3d61c0(0x1d7)));else{const _0x32e292=await resolveAPIKeyAsync(_0x16b6ec,_0x5bd165);if(_0x32e292){const {source:_0xc83337,isDeprecated:_0x45938a}=_0x32e292,_0x332513=_0x3d61c0(0x1c4)+a47_0x5b17df[_0x3d61c0(0x1e8)](_0xc83337);console[_0x3d61c0(0x1ca)](_0x45938a?a47_0x5b17df['yellow'](_0x332513):_0x332513);}else console[_0x3d61c0(0x1ca)](a47_0x5b17df[_0x3d61c0(0x1c2)](_0x3d61c0(0x1db)));}let _0xc41a25=![];try{const _0x4bb505=await _0x2d9638[_0x3d61c0(0x1cc)]['getUserInfo']();console[_0x3d61c0(0x1ca)](a47_0x5b17df[_0x3d61c0(0x1d0)](_0x3d61c0(0x1c5))),console['log'](a47_0x5b17df[_0x3d61c0(0x1c3)](_0x3d61c0(0x1c8))+'\x20'+a47_0x5b17df[_0x3d61c0(0x1e8)](_0x4bb505[_0x3d61c0(0x1dc)]));if(_0x4bb505[_0x3d61c0(0x1e4)]||_0x4bb505['last_name']){const _0x2ee6f5=[_0x4bb505['first_name'],_0x4bb505[_0x3d61c0(0x1cf)]][_0x3d61c0(0x1e9)](Boolean)[_0x3d61c0(0x1d4)]('\x20');console[_0x3d61c0(0x1ca)](a47_0x5b17df[_0x3d61c0(0x1c3)](_0x3d61c0(0x1c0))+'\x20'+_0x2ee6f5);}_0x4bb505[_0x3d61c0(0x1e5)]&&console[_0x3d61c0(0x1ca)](a47_0x5b17df[_0x3d61c0(0x1c3)](_0x3d61c0(0x1d6))+'\x20'+a47_0x5b17df[_0x3d61c0(0x1c2)](_0x4bb505[_0x3d61c0(0x1e5)])),_0xc41a25=!![];}catch(_0x330bfd){_0x330bfd instanceof HTTPClientError&&_0x330bfd[_0x3d61c0(0x1e0)]===0x191?printAuthError(_0x330bfd,!![],_0x5bd165):console[_0x3d61c0(0x1e2)](a47_0x5b17df[_0x3d61c0(0x1d9)](_0x3d61c0(0x1ce)+(_0x330bfd instanceof Error?_0x330bfd['message']:String(_0x330bfd))));}return console[_0x3d61c0(0x1ca)](),_0x4991f9[_0x3d61c0(0x1d5)](),_0xc41a25?0x0:0x1;}}