@treasuredata/tdx 2026.4.18 → 2026.4.19

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 (252) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.d.ts +38 -0
  27. package/dist/commands/engage-command.d.ts.map +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-command.js.map +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.js +1 -1
  41. package/dist/commands/profiles-command.js +1 -1
  42. package/dist/commands/query-command.js +1 -1
  43. package/dist/commands/schedule-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.js +1 -1
  48. package/dist/commands/segment-push-command.js +1 -1
  49. package/dist/commands/segment-update-command.js +1 -1
  50. package/dist/commands/segment-use-command.js +1 -1
  51. package/dist/commands/segment-validate-command.js +1 -1
  52. package/dist/commands/segments.js +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/status-command.js +1 -1
  55. package/dist/commands/tables.js +1 -1
  56. package/dist/commands/unset-command.js +1 -1
  57. package/dist/commands/upgrade-command.js +1 -1
  58. package/dist/commands/use-command.js +1 -1
  59. package/dist/commands/user-command.js +1 -1
  60. package/dist/commands/work-command.js +1 -1
  61. package/dist/commands/workflow-command.js +1 -1
  62. package/dist/core/auth.js +1 -1
  63. package/dist/core/command-output.js +1 -1
  64. package/dist/core/config.js +1 -1
  65. package/dist/core/connection-cache.js +1 -1
  66. package/dist/core/constants.js +1 -1
  67. package/dist/core/credential-cache.js +1 -1
  68. package/dist/core/global-context.js +1 -1
  69. package/dist/core/keychain.js +1 -1
  70. package/dist/core/oauth-keychain.js +1 -1
  71. package/dist/core/oauth.js +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/project-config.js +1 -1
  74. package/dist/core/session.js +1 -1
  75. package/dist/core/user-cache.js +1 -1
  76. package/dist/core/version.js +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/mcp/server.js +1 -1
  79. package/dist/mcp/tools/index.js +1 -1
  80. package/dist/mcp/tools/tdx-run.js +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/tools/work-create-item.js +1 -1
  83. package/dist/mcp/utils.js +1 -1
  84. package/dist/proxy/claude-usage-tracker.js +1 -1
  85. package/dist/proxy/passthrough-server.js +1 -1
  86. package/dist/proxy/sse-usage-parser.js +1 -1
  87. package/dist/sdk/agent/agent-config.js +1 -1
  88. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  89. package/dist/sdk/agent/agent-yaml.js +1 -1
  90. package/dist/sdk/agent/test/evaluator.js +1 -1
  91. package/dist/sdk/agent/test/executor.js +1 -1
  92. package/dist/sdk/agent/test/index.js +1 -1
  93. package/dist/sdk/agent/test/output.js +1 -1
  94. package/dist/sdk/agent/test/parser.js +1 -1
  95. package/dist/sdk/agent/tool-target-registry.js +1 -1
  96. package/dist/sdk/api.js +1 -1
  97. package/dist/sdk/cas/cas-api-client.js +1 -1
  98. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  99. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  100. package/dist/sdk/cas/index.js +1 -1
  101. package/dist/sdk/cas/pull-workflow.js +1 -1
  102. package/dist/sdk/cas/push-workflow.js +1 -1
  103. package/dist/sdk/client/cdp-api-client.js +1 -1
  104. package/dist/sdk/client/delivery-api-client.js +1 -1
  105. package/dist/sdk/client/endpoints.js +1 -1
  106. package/dist/sdk/client/engage-api-client.d.ts +26 -1
  107. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/engage-api-client.js.map +1 -1
  110. package/dist/sdk/client/http-client.d.ts +1 -1
  111. package/dist/sdk/client/http-client.d.ts.map +1 -1
  112. package/dist/sdk/client/http-client.js +1 -1
  113. package/dist/sdk/client/http-client.js.map +1 -1
  114. package/dist/sdk/client/llm-api-client.js +1 -1
  115. package/dist/sdk/client/oauth-refresh.js +1 -1
  116. package/dist/sdk/client/rate-limiter.js +1 -1
  117. package/dist/sdk/client/td-api-client.js +1 -1
  118. package/dist/sdk/client/trino-api-client.js +1 -1
  119. package/dist/sdk/client/workflow-client.js +1 -1
  120. package/dist/sdk/connection-validator.js +1 -1
  121. package/dist/sdk/connection.js +1 -1
  122. package/dist/sdk/delivery.js +1 -1
  123. package/dist/sdk/engage/campaign-pull.js +1 -1
  124. package/dist/sdk/engage/campaign-push.js +1 -1
  125. package/dist/sdk/engage/campaign-validator.js +1 -1
  126. package/dist/sdk/engage/campaign-validator.js.map +1 -1
  127. package/dist/sdk/engage/campaign-yaml.d.ts +1 -1
  128. package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
  129. package/dist/sdk/engage/campaign-yaml.js +1 -1
  130. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  131. package/dist/sdk/engage/template-pull.js +1 -1
  132. package/dist/sdk/engage/template-push.js +1 -1
  133. package/dist/sdk/engage/template-validator.js +1 -1
  134. package/dist/sdk/engage/template-yaml.js +1 -1
  135. package/dist/sdk/engage/types/campaign-def.d.ts +2 -2
  136. package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -1
  137. package/dist/sdk/engage/types/campaign-def.js +1 -1
  138. package/dist/sdk/engage/types/campaign-def.js.map +1 -1
  139. package/dist/sdk/engage/types/campaign-schema.d.ts +256 -8
  140. package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
  141. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  142. package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
  143. package/dist/sdk/engage/types/template-schema.js +1 -1
  144. package/dist/sdk/engage.d.ts +28 -1
  145. package/dist/sdk/engage.d.ts.map +1 -1
  146. package/dist/sdk/engage.js +1 -1
  147. package/dist/sdk/engage.js.map +1 -1
  148. package/dist/sdk/errors.js +1 -1
  149. package/dist/sdk/index.d.ts +1 -1
  150. package/dist/sdk/index.d.ts.map +1 -1
  151. package/dist/sdk/index.js +1 -1
  152. package/dist/sdk/index.js.map +1 -1
  153. package/dist/sdk/io/index.js +1 -1
  154. package/dist/sdk/io/node-filesystem.js +1 -1
  155. package/dist/sdk/job.js +1 -1
  156. package/dist/sdk/journey.js +1 -1
  157. package/dist/sdk/llm/chat-cache.js +1 -1
  158. package/dist/sdk/llm/index.js +1 -1
  159. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  160. package/dist/sdk/llm/model-factors.js +1 -1
  161. package/dist/sdk/personalization.js +1 -1
  162. package/dist/sdk/policy.js +1 -1
  163. package/dist/sdk/query/index.js +1 -1
  164. package/dist/sdk/query/sql-parser.js +1 -1
  165. package/dist/sdk/realtime.js +1 -1
  166. package/dist/sdk/schedule.js +1 -1
  167. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  168. package/dist/sdk/segment/fields-display.js +1 -1
  169. package/dist/sdk/segment/file-discovery.js +1 -1
  170. package/dist/sdk/segment/journey-utils.js +1 -1
  171. package/dist/sdk/segment/journey-validator.js +1 -1
  172. package/dist/sdk/segment/journey-yaml.js +1 -1
  173. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  174. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  175. package/dist/sdk/segment/pull-workflow.js +1 -1
  176. package/dist/sdk/segment/push-recovery.js +1 -1
  177. package/dist/sdk/segment/push-workflow.js +1 -1
  178. package/dist/sdk/segment/resolution-context.js +1 -1
  179. package/dist/sdk/segment/segment-path-parser.js +1 -1
  180. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  181. package/dist/sdk/segment/segment-validator.js +1 -1
  182. package/dist/sdk/segment/target-resolution.js +1 -1
  183. package/dist/sdk/segment/tdx-config.js +1 -1
  184. package/dist/sdk/segment/types/activation-schema.js +1 -1
  185. package/dist/sdk/segment/types/journey-def.js +1 -1
  186. package/dist/sdk/segment/types/journey-schema.js +1 -1
  187. package/dist/sdk/segment/types/segment-def.js +1 -1
  188. package/dist/sdk/segment/types/segment-schema.js +1 -1
  189. package/dist/sdk/segment/validate-files.js +1 -1
  190. package/dist/sdk/segment/yaml-validator.js +1 -1
  191. package/dist/sdk/segment.js +1 -1
  192. package/dist/sdk/types/engage.d.ts +125 -1
  193. package/dist/sdk/types/engage.d.ts.map +1 -1
  194. package/dist/sdk/types/index.d.ts +1 -1
  195. package/dist/sdk/types/index.d.ts.map +1 -1
  196. package/dist/sdk/types/index.js +1 -1
  197. package/dist/sdk/types/index.js.map +1 -1
  198. package/dist/sdk/types/progress.js +1 -1
  199. package/dist/sdk/types/workspace.js +1 -1
  200. package/dist/sdk/user.js +1 -1
  201. package/dist/sdk/util/format-detector.js +1 -1
  202. package/dist/sdk/util/formatters.js +1 -1
  203. package/dist/sdk/util/index.js +1 -1
  204. package/dist/sdk/util/paginate.js +1 -1
  205. package/dist/sdk/util/tree-formatter.js +1 -1
  206. package/dist/sdk/workflow/archive-validation.js +1 -1
  207. package/dist/sdk/workflow/clone-workflow.js +1 -1
  208. package/dist/sdk/workflow/index.js +1 -1
  209. package/dist/sdk/workflow/pull-workflow.js +1 -1
  210. package/dist/sdk/workflow/push-workflow.js +1 -1
  211. package/dist/sdk/workflow/tdx-config.js +1 -1
  212. package/dist/sdk/workflow/workflow-utils.js +1 -1
  213. package/dist/sdk/workspace/access-tracker.js +1 -1
  214. package/dist/sdk/workspace/frontmatter.js +1 -1
  215. package/dist/sdk/workspace/git.js +1 -1
  216. package/dist/sdk/workspace/index.js +1 -1
  217. package/dist/sdk/workspace/templates.js +1 -1
  218. package/dist/sdk/workspace/weekly.js +1 -1
  219. package/dist/sdk/workspace/wikilinks.js +1 -1
  220. package/dist/test-utils/command-runner.js +1 -1
  221. package/dist/test-utils/factories.js +1 -1
  222. package/dist/test-utils/fixtures.js +1 -1
  223. package/dist/test-utils/http-mock.js +1 -1
  224. package/dist/test-utils/index.js +1 -1
  225. package/dist/utils/async.js +1 -1
  226. package/dist/utils/colors.js +1 -1
  227. package/dist/utils/diff.js +1 -1
  228. package/dist/utils/file-permissions.js +1 -1
  229. package/dist/utils/file-reader.js +1 -1
  230. package/dist/utils/github-releases.js +1 -1
  231. package/dist/utils/global-cache.js +1 -1
  232. package/dist/utils/json-loader.js +1 -1
  233. package/dist/utils/local-cache.js +1 -1
  234. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  235. package/dist/utils/logger/formatters/index.js +1 -1
  236. package/dist/utils/logger/handlers/console-handler.js +1 -1
  237. package/dist/utils/logger/handlers/file-handler.js +1 -1
  238. package/dist/utils/logger/handlers/index.js +1 -1
  239. package/dist/utils/logger/handlers/null-handler.js +1 -1
  240. package/dist/utils/logger/index.js +1 -1
  241. package/dist/utils/logger/logger.js +1 -1
  242. package/dist/utils/logger/types.js +1 -1
  243. package/dist/utils/option-validation.js +1 -1
  244. package/dist/utils/process.js +1 -1
  245. package/dist/utils/prompt.js +1 -1
  246. package/dist/utils/spinner.js +1 -1
  247. package/dist/utils/sse-parser.js +1 -1
  248. package/dist/utils/string-utils.js +1 -1
  249. package/dist/utils/table-ref-parser.js +1 -1
  250. package/dist/utils/tdx-logger.js +1 -1
  251. package/dist/utils/version-check.js +1 -1
  252. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x54fc86=a40_0x1d0e;(function(_0x2e76cb,_0x1c99a3){const _0x3ba57e=a40_0x1d0e,_0x4fff26=_0x2e76cb();while(!![]){try{const _0x992d5a=parseInt(_0x3ba57e(0x6d))/0x1+parseInt(_0x3ba57e(0x76))/0x2+-parseInt(_0x3ba57e(0xbb))/0x3*(-parseInt(_0x3ba57e(0x9c))/0x4)+parseInt(_0x3ba57e(0x6e))/0x5+-parseInt(_0x3ba57e(0x9e))/0x6*(parseInt(_0x3ba57e(0xb6))/0x7)+-parseInt(_0x3ba57e(0x78))/0x8+-parseInt(_0x3ba57e(0x80))/0x9;if(_0x992d5a===_0x1c99a3)break;else _0x4fff26['push'](_0x4fff26['shift']());}catch(_0x1f8dc9){_0x4fff26['push'](_0x4fff26['shift']());}}}(a40_0x2064,0x414af));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x416441 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x235494 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a40_0x2064(){const _0x487ebd=['no_parent','1052114bLGrcg','dirname','1219752gWqJIT','filter','yes','counts','hasChanges','files','description','parentName','1172475Dqwndv','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dryRun','journeys','\x20with\x20','\x20\x20🎯\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20new\x20files','dim','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Aborted.','targetDir','\x20=\x20','\x27...','data','red','absolutePath','length','activations','\x20unchanged\x20files','Site:\x20','content','message','pullSegments','name','\x20files?','diff','file','96332ERHoYW','type','222mVTrsy','parentSegment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','yellow','cwd','\x20\x20Target:\x20','Pulling\x20segments\x20from\x20\x27','\x0aChanges\x20to\x20\x27','\x20changed\x20files','errorCode','resourceName','✔\x20Pulled\x20','isNew','cyan','repeat','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segments','execute','utf-8','verbose','parent_segment','segment:pull','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','setPhase','85393wUliwN','journeyVersions','✔\x20All\x20files\x20are\x20up\x20to\x20date','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','45uWhgrL','\x20segments','segment','✔\x20Context\x20set:\x20','110454WTSEnO','18950iTCKQY','session','error','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','helpText','\x20files\x20to\x20','relativePath'];a40_0x2064=function(){return _0x487ebd;};return a40_0x2064();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x1d0e(_0x438ecf,_0x1e2dfa){_0x438ecf=_0x438ecf-0x6a;const _0x2064bf=a40_0x2064();let _0x1d0e41=_0x2064bf[_0x438ecf];return _0x1d0e41;}export class SegmentPullCommand extends BaseCommand{[a40_0x54fc86(0x98)]=a40_0x54fc86(0xb3);[a40_0x54fc86(0x7e)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x54fc86(0xaf)](_0xa7564a){const _0x1b3c9f=a40_0x54fc86,{options:_0x3aeadf,args:_0xd441,tdx:_0x3c07b6}=_0xa7564a,_0x2faea1=_0x3aeadf,_0xa08df3=await resolveTarget({'arg':_0xd441[0x0],'contextParent':_0x3aeadf[_0x1b3c9f(0x9f)],'cwd':process[_0x1b3c9f(0xa2)]()});if(!isSuccessfulResolution(_0xa08df3))return _0xa08df3[_0x1b3c9f(0xa7)]===_0x1b3c9f(0x75)?(console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xa1)](_0x1b3c9f(0xb4))),console[_0x1b3c9f(0x70)](_0x1b3c9f(0x86)),console[_0x1b3c9f(0x70)](_0x1b3c9f(0xba)),console[_0x1b3c9f(0x70)](_0x1b3c9f(0xad))):(console['error'](a40_0x416441[_0x1b3c9f(0x8f)]('Error:\x20'+_0xa08df3[_0x1b3c9f(0x96)]+'\x0a')),_0xa08df3[_0x1b3c9f(0x72)]&&console[_0x1b3c9f(0x70)](a40_0x416441['cyan'](_0xa08df3[_0x1b3c9f(0x72)]))),0x1;const _0xa6b8ae=_0xa08df3[_0x1b3c9f(0x7f)],_0x23bbc8=_0xa08df3[_0x1b3c9f(0x8b)],_0x1bf450=_0xa08df3[_0x1b3c9f(0x9d)]===_0x1b3c9f(0x9b)?_0xa08df3[_0x1b3c9f(0xa8)]:undefined;_0x2faea1[_0x1b3c9f(0xb1)]&&(console[_0x1b3c9f(0x70)](_0x1b3c9f(0x94)+_0x2faea1['site']),console[_0x1b3c9f(0x70)]('Parent\x20segment:\x20'+_0xa6b8ae),_0x1bf450&&console[_0x1b3c9f(0x70)]('Target\x20resource:\x20'+_0x1bf450));const _0x1f0d76=await withProgressSpinner(_0x1b3c9f(0xa4)+_0xa6b8ae+_0x1b3c9f(0x8d),_0x266852=>_0x3c07b6[_0x1b3c9f(0x6b)][_0x1b3c9f(0x97)](_0xa6b8ae,{'targetDir':_0x23bbc8,'targetResourceName':_0x1bf450,'verbose':_0x2faea1[_0x1b3c9f(0xb1)],'progress':{'update':_0x413164=>{const _0x275735=_0x1b3c9f;_0x266852[_0x275735(0xb5)](_0x413164),_0x2faea1[_0x275735(0xb1)]&&console['error']('\x20\x20'+_0x413164);}}}),{'verbose':_0x2faea1[_0x1b3c9f(0xb1)]}),_0x4a8e7e=_0x1f0d76[_0x1b3c9f(0x8e)];if(_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0xae)]===0x0&&_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0x83)]===0x0)return console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xa1)](_0x1b3c9f(0x89)+_0x4a8e7e[_0x1b3c9f(0x7f)]+'\x27')),0x0;const _0x1d202a=_0x4a8e7e[_0x1b3c9f(0x7d)][_0x1b3c9f(0x79)](_0x3570bc=>_0x3570bc[_0x1b3c9f(0xaa)]),_0xef6256=_0x4a8e7e[_0x1b3c9f(0x7d)]['filter'](_0x529555=>!_0x529555[_0x1b3c9f(0xaa)]&&_0x529555[_0x1b3c9f(0x7c)]),_0x15b9d4=_0x4a8e7e[_0x1b3c9f(0x7d)][_0x1b3c9f(0x79)](_0x51f556=>!_0x51f556[_0x1b3c9f(0xaa)]&&!_0x51f556[_0x1b3c9f(0x7c)]);console[_0x1b3c9f(0x70)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4a8e7e['parentName']+'\x27:'),console['error'](_0x1b3c9f(0x85)+a40_0x416441['cyan'](_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0xae)]+_0x1b3c9f(0x6a))+_0x1b3c9f(0x84)+a40_0x416441[_0x1b3c9f(0xab)](_0x4a8e7e['counts'][_0x1b3c9f(0x92)]+'\x20activations'));if(_0x4a8e7e['counts'][_0x1b3c9f(0x83)]>0x0){const _0x3743ae=_0x4a8e7e[_0x1b3c9f(0x7b)]['journeyVersions']>_0x4a8e7e[_0x1b3c9f(0x7b)]['journeys']?'\x20('+_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0xb7)]+'\x20versions)':'';console[_0x1b3c9f(0x70)]('\x20\x20🗺️\x20\x20'+a40_0x416441['cyan'](_0x4a8e7e['counts'][_0x1b3c9f(0x83)]+'\x20journeys')+a40_0x416441[_0x1b3c9f(0x88)](_0x3743ae));}console[_0x1b3c9f(0x70)]('\x20\x20'+a40_0x416441[_0x1b3c9f(0xb9)]('+\x20'+_0x1d202a[_0x1b3c9f(0x91)]+_0x1b3c9f(0x87))),console[_0x1b3c9f(0x70)]('\x20\x20'+a40_0x416441[_0x1b3c9f(0xa1)]('~\x20'+_0xef6256['length']+_0x1b3c9f(0xa6))),console['error']('\x20\x20'+a40_0x416441[_0x1b3c9f(0x88)]('=\x20'+_0x15b9d4[_0x1b3c9f(0x91)]+_0x1b3c9f(0x93))),console[_0x1b3c9f(0x70)](_0x1b3c9f(0xa3)+a40_0x416441['cyan'](_0x4a8e7e[_0x1b3c9f(0x8b)])+'\x0a');if(_0xef6256[_0x1b3c9f(0x91)]>0x0)for(const _0x58fbe1 of _0xef6256){console[_0x1b3c9f(0x70)](_0x1b3c9f(0xa5)+_0x58fbe1[_0x1b3c9f(0x74)]+'\x27:'),console['error']('─'[_0x1b3c9f(0xac)](0x3c)),console[_0x1b3c9f(0x70)](_0x58fbe1[_0x1b3c9f(0x9a)]),console[_0x1b3c9f(0x70)]('─'[_0x1b3c9f(0xac)](0x3c));}if(_0x2faea1[_0x1b3c9f(0x82)])return console['error'](a40_0x416441['yellow'](_0x1b3c9f(0x71))),0x0;if(_0x1d202a[_0x1b3c9f(0x91)]===0x0&&_0xef6256[_0x1b3c9f(0x91)]===0x0)return console['error'](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0xb8))),saveSessionContext({'parent_segment':_0x4a8e7e[_0x1b3c9f(0x7f)]},_0x2faea1[_0x1b3c9f(0x6f)]),console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0x6c)+a40_0x416441[_0x1b3c9f(0x88)]('parent_segment')+_0x1b3c9f(0x8c)+a40_0x416441['cyan'](_0x4a8e7e[_0x1b3c9f(0x7f)]))),0x0;if(!_0x2faea1[_0x1b3c9f(0x7a)]){if(!isInteractive())return console['error'](a40_0x416441['red']('\x0aError:'),_0x1b3c9f(0xa0)),console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0x88)](_0x1b3c9f(0x81))),0x1;const _0x3203a3=await confirmKey('Write\x20'+(_0x1d202a[_0x1b3c9f(0x91)]+_0xef6256[_0x1b3c9f(0x91)])+_0x1b3c9f(0x99));if(!_0x3203a3)return console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xa1)](_0x1b3c9f(0x8a)),'-\x20no\x20files\x20written'),0x1;}for(const _0x4d2572 of _0x4a8e7e[_0x1b3c9f(0x7d)]){if(_0x4d2572[_0x1b3c9f(0xaa)]||_0x4d2572['hasChanges']){const _0xb368ed=a40_0x235494[_0x1b3c9f(0x77)](_0x4d2572['absolutePath']);!existsSync(_0xb368ed)&&mkdirSync(_0xb368ed,{'recursive':!![]}),writeFileSync(_0x4d2572[_0x1b3c9f(0x90)],_0x4d2572[_0x1b3c9f(0x95)],_0x1b3c9f(0xb0));}}return console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0xa9)+(_0x1d202a[_0x1b3c9f(0x91)]+_0xef6256[_0x1b3c9f(0x91)])+_0x1b3c9f(0x73)+_0x4a8e7e[_0x1b3c9f(0x8b)])),saveSessionContext({'parent_segment':_0x4a8e7e[_0x1b3c9f(0x7f)]},_0x2faea1[_0x1b3c9f(0x6f)]),console['error'](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0x6c)+a40_0x416441[_0x1b3c9f(0x88)](_0x1b3c9f(0xb2))+_0x1b3c9f(0x8c)+a40_0x416441[_0x1b3c9f(0xab)](_0x4a8e7e[_0x1b3c9f(0x7f)]))),0x0;}}
1
+ const a40_0x559b2c=a40_0x5b04;(function(_0x1a014d,_0xaad5d9){const _0x2698db=a40_0x5b04,_0x3bed96=_0x1a014d();while(!![]){try{const _0x5a4201=parseInt(_0x2698db(0x150))/0x1+-parseInt(_0x2698db(0x134))/0x2+-parseInt(_0x2698db(0x11d))/0x3+parseInt(_0x2698db(0x135))/0x4+-parseInt(_0x2698db(0x119))/0x5+parseInt(_0x2698db(0x158))/0x6*(-parseInt(_0x2698db(0x136))/0x7)+parseInt(_0x2698db(0x144))/0x8*(parseInt(_0x2698db(0x14d))/0x9);if(_0x5a4201===_0xaad5d9)break;else _0x3bed96['push'](_0x3bed96['shift']());}catch(_0x248ec1){_0x3bed96['push'](_0x3bed96['shift']());}}}(a40_0x470c,0xa428f));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x50c070 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x470c(){const _0x1b1fa3=['16MwAHwW','✔\x20Pulled\x20','✔\x20Context\x20set:\x20','segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','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)','green','\x20\x20🗺️\x20\x20','9322389smSwUB','\x20segments','parentSegment','594623AUiiND','\x0aChanges\x20to\x20\x27','counts','\x27...','Target\x20resource:\x20','content','parentName','message','8064762WxVGBi','pullSegments','activations','data','name','dim','cyan','Site:\x20','session','dryRun','\x20with\x20','Aborted.','diff','journeyVersions','error','2013405KiixFs','\x20files?','\x0aPull\x20summary\x20for\x20\x27','\x20\x20🎯\x20','2800065tmBjGb','Error:\x20','type','helpText','targetDir','no_parent','Write\x20','length','files','segment:pull','repeat','file','hasChanges','yellow','journeys','resourceName','-\x20no\x20files\x20written','Pulling\x20segments\x20from\x20\x27','verbose','absolutePath','description','cwd','isNew','171108dOstuH','3087404whNgVC','7NScZiV','\x20=\x20','\x20\x20Target:\x20','parent_segment','yes','\x20activations','segments','execute','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','errorCode','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','red','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Parent\x20segment:\x20'];a40_0x470c=function(){return _0x1b1fa3;};return a40_0x470c();}import a40_0x379e81 from'path';function a40_0x5b04(_0x1df394,_0x284062){_0x1df394=_0x1df394-0x116;const _0x470c9e=a40_0x470c();let _0x5b0480=_0x470c9e[_0x1df394];return _0x5b0480;}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_0x559b2c(0x15c)]=a40_0x559b2c(0x126);[a40_0x559b2c(0x131)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x559b2c(0x13d)](_0x100c32){const _0x261d34=a40_0x559b2c,{options:_0x52f999,args:_0x247579,tdx:_0x445241}=_0x100c32,_0x305ceb=_0x52f999,_0x189ecb=await resolveTarget({'arg':_0x247579[0x0],'contextParent':_0x52f999[_0x261d34(0x14f)],'cwd':process[_0x261d34(0x132)]()});if(!isSuccessfulResolution(_0x189ecb))return _0x189ecb[_0x261d34(0x13f)]===_0x261d34(0x122)?(console['error'](a40_0x50c070['yellow'](_0x261d34(0x140))),console[_0x261d34(0x118)](_0x261d34(0x14a)),console['error'](_0x261d34(0x149)),console[_0x261d34(0x118)](_0x261d34(0x13e))):(console[_0x261d34(0x118)](a40_0x50c070[_0x261d34(0x141)](_0x261d34(0x11e)+_0x189ecb[_0x261d34(0x157)]+'\x0a')),_0x189ecb[_0x261d34(0x120)]&&console['error'](a40_0x50c070[_0x261d34(0x15e)](_0x189ecb[_0x261d34(0x120)]))),0x1;const _0xdf69f4=_0x189ecb[_0x261d34(0x156)],_0x208f80=_0x189ecb['targetDir'],_0x452841=_0x189ecb[_0x261d34(0x11f)]===_0x261d34(0x128)?_0x189ecb[_0x261d34(0x12c)]:undefined;_0x305ceb[_0x261d34(0x12f)]&&(console['error'](_0x261d34(0x15f)+_0x305ceb['site']),console['error'](_0x261d34(0x143)+_0xdf69f4),_0x452841&&console[_0x261d34(0x118)](_0x261d34(0x154)+_0x452841));const _0x1d5b8a=await withProgressSpinner(_0x261d34(0x12e)+_0xdf69f4+_0x261d34(0x153),_0x333369=>_0x445241[_0x261d34(0x147)][_0x261d34(0x159)](_0xdf69f4,{'targetDir':_0x208f80,'targetResourceName':_0x452841,'verbose':_0x305ceb[_0x261d34(0x12f)],'progress':{'update':_0x421b9b=>{const _0xf5ee56=_0x261d34;_0x333369['setPhase'](_0x421b9b),_0x305ceb[_0xf5ee56(0x12f)]&&console[_0xf5ee56(0x118)]('\x20\x20'+_0x421b9b);}}}),{'verbose':_0x305ceb[_0x261d34(0x12f)]}),_0x522064=_0x1d5b8a[_0x261d34(0x15b)];if(_0x522064[_0x261d34(0x152)][_0x261d34(0x13c)]===0x0&&_0x522064[_0x261d34(0x152)]['journeys']===0x0)return console[_0x261d34(0x118)](a40_0x50c070[_0x261d34(0x12a)](_0x261d34(0x142)+_0x522064['parentName']+'\x27')),0x0;const _0x1f4d97=_0x522064[_0x261d34(0x125)]['filter'](_0x3cb867=>_0x3cb867[_0x261d34(0x133)]),_0x1b84b2=_0x522064[_0x261d34(0x125)]['filter'](_0xfaea9f=>!_0xfaea9f[_0x261d34(0x133)]&&_0xfaea9f[_0x261d34(0x129)]),_0x45801e=_0x522064[_0x261d34(0x125)]['filter'](_0x4e0e01=>!_0x4e0e01[_0x261d34(0x133)]&&!_0x4e0e01[_0x261d34(0x129)]);console['error'](_0x261d34(0x11b)+_0x522064[_0x261d34(0x156)]+'\x27:'),console[_0x261d34(0x118)](_0x261d34(0x11c)+a40_0x50c070[_0x261d34(0x15e)](_0x522064['counts'][_0x261d34(0x13c)]+_0x261d34(0x14e))+_0x261d34(0x162)+a40_0x50c070[_0x261d34(0x15e)](_0x522064['counts'][_0x261d34(0x15a)]+_0x261d34(0x13b)));if(_0x522064['counts'][_0x261d34(0x12b)]>0x0){const _0x52df62=_0x522064[_0x261d34(0x152)][_0x261d34(0x117)]>_0x522064[_0x261d34(0x152)][_0x261d34(0x12b)]?'\x20('+_0x522064[_0x261d34(0x152)]['journeyVersions']+'\x20versions)':'';console['error'](_0x261d34(0x14c)+a40_0x50c070[_0x261d34(0x15e)](_0x522064[_0x261d34(0x152)]['journeys']+'\x20journeys')+a40_0x50c070[_0x261d34(0x15d)](_0x52df62));}console[_0x261d34(0x118)]('\x20\x20'+a40_0x50c070[_0x261d34(0x14b)]('+\x20'+_0x1f4d97['length']+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x50c070[_0x261d34(0x12a)]('~\x20'+_0x1b84b2[_0x261d34(0x124)]+'\x20changed\x20files')),console['error']('\x20\x20'+a40_0x50c070[_0x261d34(0x15d)]('=\x20'+_0x45801e[_0x261d34(0x124)]+'\x20unchanged\x20files')),console['error'](_0x261d34(0x138)+a40_0x50c070[_0x261d34(0x15e)](_0x522064[_0x261d34(0x121)])+'\x0a');if(_0x1b84b2[_0x261d34(0x124)]>0x0)for(const _0xcfa051 of _0x1b84b2){console[_0x261d34(0x118)](_0x261d34(0x151)+_0xcfa051['relativePath']+'\x27:'),console[_0x261d34(0x118)]('─'[_0x261d34(0x127)](0x3c)),console[_0x261d34(0x118)](_0xcfa051[_0x261d34(0x116)]),console[_0x261d34(0x118)]('─'['repeat'](0x3c));}if(_0x305ceb[_0x261d34(0x161)])return console[_0x261d34(0x118)](a40_0x50c070[_0x261d34(0x12a)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1f4d97[_0x261d34(0x124)]===0x0&&_0x1b84b2[_0x261d34(0x124)]===0x0)return console[_0x261d34(0x118)](a40_0x50c070[_0x261d34(0x14b)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x522064[_0x261d34(0x156)]},_0x305ceb[_0x261d34(0x160)]),console['error'](a40_0x50c070['green'](_0x261d34(0x146)+a40_0x50c070[_0x261d34(0x15d)](_0x261d34(0x139))+_0x261d34(0x137)+a40_0x50c070['cyan'](_0x522064['parentName']))),0x0;if(!_0x305ceb[_0x261d34(0x13a)]){if(!isInteractive())return console[_0x261d34(0x118)](a40_0x50c070['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x261d34(0x118)](a40_0x50c070[_0x261d34(0x15d)](_0x261d34(0x148))),0x1;const _0x1c31a3=await confirmKey(_0x261d34(0x123)+(_0x1f4d97['length']+_0x1b84b2[_0x261d34(0x124)])+_0x261d34(0x11a));if(!_0x1c31a3)return console['error'](a40_0x50c070[_0x261d34(0x12a)](_0x261d34(0x163)),_0x261d34(0x12d)),0x1;}for(const _0x43ad3e of _0x522064['files']){if(_0x43ad3e[_0x261d34(0x133)]||_0x43ad3e[_0x261d34(0x129)]){const _0x510856=a40_0x379e81['dirname'](_0x43ad3e[_0x261d34(0x130)]);!existsSync(_0x510856)&&mkdirSync(_0x510856,{'recursive':!![]}),writeFileSync(_0x43ad3e['absolutePath'],_0x43ad3e[_0x261d34(0x155)],'utf-8');}}return console[_0x261d34(0x118)](a40_0x50c070['green'](_0x261d34(0x145)+(_0x1f4d97[_0x261d34(0x124)]+_0x1b84b2['length'])+'\x20files\x20to\x20'+_0x522064[_0x261d34(0x121)])),saveSessionContext({'parent_segment':_0x522064['parentName']},_0x305ceb[_0x261d34(0x160)]),console[_0x261d34(0x118)](a40_0x50c070[_0x261d34(0x14b)](_0x261d34(0x146)+a40_0x50c070[_0x261d34(0x15d)](_0x261d34(0x139))+_0x261d34(0x137)+a40_0x50c070['cyan'](_0x522064[_0x261d34(0x156)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x448629=a41_0xf4ce;(function(_0x568d4f,_0x1beaa8){const _0x2c3bae=a41_0xf4ce,_0x3649ad=_0x568d4f();while(!![]){try{const _0x37999a=parseInt(_0x2c3bae(0x211))/0x1*(parseInt(_0x2c3bae(0x251))/0x2)+-parseInt(_0x2c3bae(0x247))/0x3*(parseInt(_0x2c3bae(0x24f))/0x4)+parseInt(_0x2c3bae(0x231))/0x5*(-parseInt(_0x2c3bae(0x263))/0x6)+parseInt(_0x2c3bae(0x1f5))/0x7*(-parseInt(_0x2c3bae(0x284))/0x8)+-parseInt(_0x2c3bae(0x257))/0x9*(parseInt(_0x2c3bae(0x269))/0xa)+-parseInt(_0x2c3bae(0x23d))/0xb*(-parseInt(_0x2c3bae(0x259))/0xc)+parseInt(_0x2c3bae(0x21a))/0xd;if(_0x37999a===_0x1beaa8)break;else _0x3649ad['push'](_0x3649ad['shift']());}catch(_0x323106){_0x3649ad['push'](_0x3649ad['shift']());}}}(a41_0x5b0b,0xbcf0d));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';function a41_0x5b0b(){const _0x905760=['Preparing\x20journeys...','.yml','Error:\x20','changed','\x20\x20\x20\x20','delete','helpText','toCreate','state','existingJourney','journey','scopedFolderPath','\x0aPush\x20summary\x20for\x20\x27','8710232SZMUbB','isNew','listFolders','\x20\x20Activations:','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)','created','activations','paused','\x20\x20Source:\x20','\x20to\x20update','Source\x20directory:\x20','listSegments','existingSegment','dim','journeyBundleName','createdSegmentIds','7mGxcnn','New\x20segment:','Scoped\x20to\x20folder:\x20','cyan','toUpdate','getJourney','createdAt','\x20deleted','New\x20journey:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20new','unchanged','description','targetDir','No\x20','segments','length','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','get','Parent\x20segment:\x20','green','Changes\x20to\x20journey:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','/sb/da/esr','attributes','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','54PGXToT','\x20to\x20create','\x20changed','(Journey\x20will\x20be\x20deleted)','nameToType','diff','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/app/ps/','\x20\x20Activations:\x20','43726748ccHEHC','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','new','push','yes','journeyId','parentName','\x27...','\x20\x20🗺️\x20\x20Journeys:','join','\x20updated','errorCode','then','resolveParentId','listJourneysWithDetailsFromParentSegment','user','yamlConfig','\x20\x20Journeys:\x20','red','data','/e/','Delete\x20segment:','nameToId','4091540nlorRS','verbose','set','\x20activations]','📁\x20','dryRun','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','endsWith','\x20\x20Segments:\x20','idToName','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','626747soxpxK','folderId','all','\x20to\x20delete','getParent','segment','Delete\x20journey:','execute','yellow','type','31881qXnUms','journeysOnly','folders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','segment:push','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','484ojgbsI','message','48696YdOUWu','filePath','toDelete','\x20unchanged','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','blue','10089kPlNtq','repeat','120YbIpEi','Resolving\x20parent\x20segment\x20\x27','filter','map','parent_name','updated','connection','Fetching\x20connections\x20for\x20name\x20resolution...','/j/da/je','Aborted.','6oPDeOe','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','results','add','\x20\x20📊\x20Segments:','file','11430tTSkkh','journeyBundleId','toString','list','journeys','listActivations','versionNumber','isScoped','\x0a✔\x20Push\x20complete','parentFolder','folderPath','.yaml','error','site'];a41_0x5b0b=function(){return _0x905760;};return a41_0x5b0b();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x3987b6 from'chalk';function a41_0xf4ce(_0x4f41b3,_0x388cb2){_0x4f41b3=_0x4f41b3-0x1ea;const _0x5b0bc5=a41_0x5b0b();let _0xf4ce16=_0x5b0bc5[_0x4f41b3];return _0xf4ce16;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a41_0x448629(0x24b);[a41_0x448629(0x201)]=a41_0x448629(0x23c);async[a41_0x448629(0x244)](_0x1a56a9){const _0x3c94bc=a41_0x448629,{options:_0x342174,args:_0x205784,tdx:_0x2a0e6e}=_0x1a56a9,_0x15bfcf=_0x342174,_0x37a25b=await resolveTarget({'arg':_0x205784[0x0],'contextParent':_0x342174['parentSegment'],'cwd':process[_0x3c94bc(0x24c)]()});if(!isSuccessfulResolution(_0x37a25b))return _0x37a25b[_0x3c94bc(0x225)]==='no_parent'?(console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x255))),console['error'](_0x3c94bc(0x288)),console[_0x3c94bc(0x275)](_0x3c94bc(0x24a)),console[_0x3c94bc(0x275)](_0x3c94bc(0x24d))):(console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x279)+_0x37a25b[_0x3c94bc(0x250)]+'\x0a')),_0x37a25b[_0x3c94bc(0x27d)]&&console['error'](a41_0x3987b6[_0x3c94bc(0x1f8)](_0x37a25b[_0x3c94bc(0x27d)]))),0x1;if(_0x37a25b[_0x3c94bc(0x246)]===_0x3c94bc(0x25d))return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)]('Error:\x20Directory\x20not\x20found:\x20'+_0x37a25b['targetDir']+'\x0a')),console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x1f8)](_0x3c94bc(0x217))),0x1;const _0x1c5f2e=_0x37a25b[_0x3c94bc(0x220)],_0x168548=_0x37a25b[_0x3c94bc(0x202)],_0x354afb=_0x37a25b[_0x3c94bc(0x246)]===_0x3c94bc(0x268)?_0x37a25b[_0x3c94bc(0x252)]:undefined,_0x24afb6=getScopedDetails(_0x37a25b),_0x47e976=_0x24afb6?.[_0x3c94bc(0x270)]??![],_0x1c1aff=_0x24afb6?.[_0x3c94bc(0x282)]??'';if(!existsSync(_0x168548))return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x20e)+_0x168548+'\x0a')),console[_0x3c94bc(0x275)](a41_0x3987b6['cyan'](_0x3c94bc(0x217))),0x1;_0x15bfcf[_0x3c94bc(0x232)]&&(console[_0x3c94bc(0x275)]('Site:\x20'+_0x15bfcf[_0x3c94bc(0x276)]),console[_0x3c94bc(0x275)](_0x3c94bc(0x208)+_0x1c5f2e),console['error'](_0x3c94bc(0x1ef)+_0x168548),_0x47e976&&console[_0x3c94bc(0x275)](_0x3c94bc(0x1f7)+_0x1c1aff));const _0x2fe6da=await withSpinner(_0x3c94bc(0x25a)+_0x1c5f2e+_0x3c94bc(0x221),()=>_0x2a0e6e[_0x3c94bc(0x242)][_0x3c94bc(0x227)](_0x1c5f2e),{'verbose':_0x15bfcf[_0x3c94bc(0x232)]}),_0x314481=_0x2fe6da['data'],{parentSegmentResult:_0x304b2e,segmentsResult:_0x323306,foldersResult:_0x1646da,journeysWithDetailsResult:_0x17d081,userMaps:_0xf69fd1}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0xe47184=_0x3c94bc,[_0x477fea,_0x43ddc1,_0x342a7c,_0x5d10c8,_0x4d5c2b]=await Promise[_0xe47184(0x23f)]([_0x2a0e6e[_0xe47184(0x242)][_0xe47184(0x241)](_0x314481),_0x2a0e6e['segment'][_0xe47184(0x1f0)](_0x314481),_0x2a0e6e[_0xe47184(0x242)][_0xe47184(0x286)](_0x314481),_0x2a0e6e[_0xe47184(0x281)][_0xe47184(0x228)](_0x314481,{'includeAllVersions':!![]}),_0x2a0e6e[_0xe47184(0x229)]['buildUserMaps']()]);return{'parentSegmentResult':_0x477fea,'segmentsResult':_0x43ddc1,'foldersResult':_0x342a7c,'journeysWithDetailsResult':_0x5d10c8,'userMaps':_0x4d5c2b};},{'verbose':_0x15bfcf[_0x3c94bc(0x232)]})['then'](_0x44a655=>_0x44a655[_0x3c94bc(0x22d)]),_0x2632da=_0x304b2e,_0x291903=extractRootFolderId(_0x2632da),_0x2b0c7a=_0x323306,_0x5d78b8=_0x1646da,{journeys:_0x16b065,activationStepsById:_0x5e00f1}=_0x17d081,_0x5a1473=new Map(_0x16b065[_0x3c94bc(0x25c)](_0x5e5a1c=>[_0x5e5a1c['id'],_0x5e5a1c])),_0x177656=_0x16b065[_0x3c94bc(0x25c)](_0x358327=>({'id':_0x358327['id'],'name':_0x358327['attributes']['name'],'journeyBundleName':_0x358327['attributes']['journeyBundleName']||'','journeyBundleId':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x26a)]||'','versionNumber':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x26f)],'description':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x201)],'state':_0x358327['attributes'][_0x3c94bc(0x27f)],'paused':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x1ec)],'audienceId':_0x358327[_0x3c94bc(0x20d)]['audienceId'],'folderId':_0x358327['relationships']?.[_0x3c94bc(0x272)]?.[_0x3c94bc(0x22d)]?.['id'],'createdAt':_0x358327['attributes'][_0x3c94bc(0x1fb)],'updatedAt':_0x358327['attributes']['updatedAt']})),{emailToId:_0x130ce2,idToEmail:_0x575f61}=_0xf69fd1,_0x1e8aaa=await withSpinner(_0x3c94bc(0x260),async()=>{const _0x1dd740=_0x3c94bc,_0x1ae817=await _0x2a0e6e[_0x1dd740(0x25f)][_0x1dd740(0x26c)]();return buildConnectionMaps(_0x1ae817);},{'verbose':_0x15bfcf[_0x3c94bc(0x232)]})[_0x3c94bc(0x226)](_0x45c244=>_0x45c244[_0x3c94bc(0x22d)]),_0x393dce=_0x1e8aaa[_0x3c94bc(0x230)],_0x3a3951=_0x1e8aaa[_0x3c94bc(0x23a)],_0x490b46=_0x1e8aaa[_0x3c94bc(0x215)],_0x17372={'emailToIdMap':_0x130ce2,'connectionNameToIdMap':_0x393dce,'connectionNameToTypeMap':_0x490b46,'getSchema':_0x339395=>_0x2a0e6e[_0x3c94bc(0x25f)]['getOutputSchemaWithCache'](_0x339395)};let {pathToId:_0x223973,idToPath:_0x2cf7f6}=buildFolderMaps(_0x5d78b8);const _0xc98928=buildSegmentLookupMap(_0x2b0c7a,_0x2cf7f6),_0x50086f=buildSegmentNameToIdMap(_0x2b0c7a),_0x2856ea=buildJourneyBundleLookupMap(_0x177656,_0x2cf7f6);let _0x4f8ee9;if(_0x354afb){if(!_0x354afb[_0x3c94bc(0x238)](_0x3c94bc(0x278))&&!_0x354afb['endsWith'](_0x3c94bc(0x274)))return console[_0x3c94bc(0x275)](a41_0x3987b6['red'](_0x3c94bc(0x20f)+_0x354afb+'\x0a')),0x1;_0x4f8ee9=[_0x354afb];}else _0x4f8ee9=findYamlFiles(_0x168548);if(_0x4f8ee9[_0x3c94bc(0x205)]===0x0)return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x237)+_0x168548+'\x0a')),console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x1f8)](_0x3c94bc(0x21b))),0x1;let _0x2b1e9b,_0x39401e;try{const _0xa809b1=parseAndClassifyYamlFiles(_0x4f8ee9,_0x168548,{'skipSegments':_0x15bfcf[_0x3c94bc(0x248)]});_0x2b1e9b=_0xa809b1[_0x3c94bc(0x204)],_0x39401e=_0xa809b1[_0x3c94bc(0x26d)];const _0x25990a=validateParsedFiles(_0xa809b1,_0x168548);if(_0x25990a[_0x3c94bc(0x205)]>0x0)return console['error'](a41_0x3987b6[_0x3c94bc(0x22c)]('\x0aValidation\x20failed:')),console[_0x3c94bc(0x275)](formatValidationErrors(_0x25990a)),console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x212bcb){return console['error'](a41_0x3987b6['red']('Error\x20parsing\x20YAML:\x20'+(_0x212bcb instanceof Error?_0x212bcb[_0x3c94bc(0x250)]:_0x212bcb))),0x1;}if(_0x2b1e9b[_0x3c94bc(0x205)]===0x0&&_0x39401e[_0x3c94bc(0x205)]===0x0){const _0x1f03c3=_0x15bfcf[_0x3c94bc(0x248)]?'journey':'segment\x20or\x20journey';return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x203)+_0x1f03c3+'\x20YAML\x20files\x20found')),0x0;}const _0x23a43a=new Map();_0x2b0c7a['length']>0x0&&!_0x15bfcf['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x2b0c7a,async _0x189684=>{const _0x155de4=a41_0xf4ce,_0x2e7c72=await _0x2a0e6e[_0x155de4(0x242)][_0x155de4(0x26e)](_0x314481,_0x189684['id']);_0x23a43a[_0x155de4(0x233)](_0x189684['id'],_0x2e7c72);});},{'verbose':_0x15bfcf[_0x3c94bc(0x232)]});const {segmentFiles:_0x1ab88c,foldersToCreate:_0x2d008e}=await prepareSegmentFiles(_0x2b1e9b,{'segmentByFolderAndName':_0xc98928,'activationsBySegmentId':_0x23a43a,'folderPathToId':_0x223973,'idToEmailMap':_0x575f61,'connectionIdToNameMap':_0x3a3951},_0x17372,_0x47e976,_0x1c1aff),_0x2f4259=_0x354afb?[]:findSegmentsToDelete(_0x2b0c7a,_0x2b1e9b[_0x3c94bc(0x25c)](({yamlConfig:_0x37fb97,folderPath:_0x3b2b5c})=>({'yamlConfig':_0x37fb97,'folderPath':resolveTDFolderPath(_0x3b2b5c,_0x47e976,_0x1c1aff)})),_0x2cf7f6,_0x1c1aff,_0x47e976),{journeyFiles:_0x5367f0,foldersToCreate:_0x532cb7}=await withProgressSpinner(_0x3c94bc(0x277),async _0x3db147=>prepareJourneyFiles(_0x39401e,{'fetchJourney':async _0x229a51=>_0x2a0e6e[_0x3c94bc(0x281)][_0x3c94bc(0x1fa)](_0x229a51[_0x3c94bc(0x21f)]),'journeyBundlesByFolderAndName':_0x2856ea,'folderPathToId':_0x223973,'idToEmailMap':_0x575f61,'connectionIdToNameMap':_0x3a3951,'existingSegments':_0x2b0c7a,'parentId':_0x314481,'deps':_0x2a0e6e,'progress':{'update':_0x452a56=>{const _0x499c94=_0x3c94bc;_0x3db147['setPhase'](_0x452a56),_0x15bfcf[_0x499c94(0x232)]&&console[_0x499c94(0x275)]('\x20\x20'+_0x452a56);}},'journeyById':_0x5a1473,'activationStepsById':_0x5e00f1},_0x47e976,_0x1c1aff),{'verbose':_0x15bfcf[_0x3c94bc(0x232)]})[_0x3c94bc(0x226)](_0x399126=>_0x399126[_0x3c94bc(0x22d)]);for(const _0x3e4d25 of _0x532cb7){_0x2d008e[_0x3c94bc(0x266)](_0x3e4d25);}const _0x28d632=_0x354afb?[]:findJourneysToDelete(_0x177656,_0x39401e[_0x3c94bc(0x25c)](({yamlConfig:_0x3eedd4,folderPath:_0x4e0346})=>({'yamlConfig':_0x3eedd4,'folderPath':resolveTDFolderPath(_0x4e0346,_0x47e976,_0x1c1aff)})),_0x2cf7f6,_0x1c1aff,_0x47e976),_0x10afff=calculatePushStats(_0x1ab88c,_0x5367f0,_0x2d008e,_0x2f4259,_0x28d632,!!_0x15bfcf[_0x3c94bc(0x27c)],!!_0x15bfcf[_0x3c94bc(0x248)]),_0x1b0e43=_0x10afff[_0x3c94bc(0x204)][_0x3c94bc(0x21c)],_0x1a727a=_0x10afff[_0x3c94bc(0x204)]['changed'],_0x1a877c=_0x10afff[_0x3c94bc(0x204)][_0x3c94bc(0x200)],_0x2e814f=_0x10afff[_0x3c94bc(0x204)]['toDelete'],_0x99625e=_0x10afff[_0x3c94bc(0x249)][_0x3c94bc(0x27e)],_0x2bdd5a=_0x10afff['journeys'][_0x3c94bc(0x21c)],_0x47d8be=_0x10afff['journeys'][_0x3c94bc(0x27a)],_0x1e6e67=_0x10afff[_0x3c94bc(0x26d)]['unchanged'],_0x48ac05=_0x10afff[_0x3c94bc(0x26d)][_0x3c94bc(0x253)],_0x1d1d7a=_0x10afff[_0x3c94bc(0x1eb)][_0x3c94bc(0x23f)],_0x4f2086=_0x10afff[_0x3c94bc(0x1eb)][_0x3c94bc(0x27e)],_0x2c44bc=_0x10afff[_0x3c94bc(0x1eb)][_0x3c94bc(0x1f9)],_0x31ff9f=_0x10afff[_0x3c94bc(0x1eb)]['toDelete'];console[_0x3c94bc(0x275)](_0x3c94bc(0x283)+_0x1c5f2e+'\x27:');_0x99625e[_0x3c94bc(0x205)]>0x0&&console[_0x3c94bc(0x275)]('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x256)](_0x3c94bc(0x235)+_0x99625e[_0x3c94bc(0x205)]+'\x20folders\x20to\x20create'));if(!_0x15bfcf[_0x3c94bc(0x248)]){console['error'](_0x3c94bc(0x267)),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x209)]('+\x20'+_0x1b0e43['length']+'\x20new')),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x245)]('~\x20'+_0x1a727a[_0x3c94bc(0x205)]+_0x3c94bc(0x213)));if(_0x2e814f['length']>0x0)console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x22c)]('-\x20'+_0x2e814f[_0x3c94bc(0x205)]+_0x3c94bc(0x240)));else _0x2f4259[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x27c)]&&console['error'](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x1f2)](_0x2f4259['length']+_0x3c94bc(0x23b)));console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x1f2)]('=\x20'+_0x1a877c[_0x3c94bc(0x205)]+_0x3c94bc(0x254)));}if(_0x5367f0[_0x3c94bc(0x205)]>0x0||_0x28d632['length']>0x0){console[_0x3c94bc(0x275)](_0x3c94bc(0x222)),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x209)]('+\x20'+_0x2bdd5a[_0x3c94bc(0x205)]+_0x3c94bc(0x1ff))),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x245)]('~\x20'+_0x47d8be[_0x3c94bc(0x205)]+_0x3c94bc(0x213)));if(_0x48ac05[_0x3c94bc(0x205)]>0x0)console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x22c)]('-\x20'+_0x48ac05[_0x3c94bc(0x205)]+_0x3c94bc(0x240)));else _0x28d632['length']>0x0&&!_0x15bfcf['delete']&&console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x1f2)](_0x28d632[_0x3c94bc(0x205)]+_0x3c94bc(0x23b)));console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x1f2)]('=\x20'+_0x1e6e67[_0x3c94bc(0x205)]+'\x20unchanged'));}_0x1d1d7a[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)]&&(console[_0x3c94bc(0x275)](''),console[_0x3c94bc(0x275)](_0x3c94bc(0x287)),_0x4f2086[_0x3c94bc(0x205)]>0x0&&console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x209)]('+\x20'+_0x4f2086[_0x3c94bc(0x205)]+_0x3c94bc(0x212))),_0x2c44bc['length']>0x0&&console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x245)]('~\x20'+_0x2c44bc[_0x3c94bc(0x205)]+_0x3c94bc(0x1ee))),_0x31ff9f[_0x3c94bc(0x205)]>0x0&&console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x22c)]('-\x20'+_0x31ff9f['length']+'\x20to\x20delete')));console[_0x3c94bc(0x275)](_0x3c94bc(0x1ed)+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x168548)+'\x0a');if(_0x99625e[_0x3c94bc(0x205)]>0x0){console[_0x3c94bc(0x275)]('Folders\x20to\x20create:');for(const _0x244f3e of _0x99625e){console['error']('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x256)]('+')+'\x20'+_0x244f3e);}console[_0x3c94bc(0x275)]('');}if(_0x1b0e43['length']>0x0&&!_0x15bfcf[_0x3c94bc(0x248)])for(const _0x493a3c of _0x1b0e43){const _0x4d4a8f=_0x493a3c[_0x3c94bc(0x273)]?_0x493a3c[_0x3c94bc(0x273)]+'/'+_0x493a3c[_0x3c94bc(0x22a)]['name']:_0x493a3c[_0x3c94bc(0x22a)][_0x3c94bc(0x210)],_0x101677=_0x493a3c['yamlConfig'][_0x3c94bc(0x1eb)]?.['length']||0x0,_0x319ae0=_0x101677>0x0?a41_0x3987b6[_0x3c94bc(0x1f2)]('\x20['+_0x101677+_0x3c94bc(0x234)):'';console['error']('\x0a'+a41_0x3987b6[_0x3c94bc(0x209)](_0x3c94bc(0x1f6))+'\x20'+_0x4d4a8f+_0x319ae0),console['error']('─'[_0x3c94bc(0x258)](0x3c)),_0x493a3c[_0x3c94bc(0x216)]&&console[_0x3c94bc(0x275)](_0x493a3c[_0x3c94bc(0x216)]),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}if(_0x2e814f[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)])for(const _0x1998fa of _0x2e814f){const _0xe4d0fc=_0x1998fa['segmentFolderId']?_0x2cf7f6[_0x3c94bc(0x207)](_0x1998fa['segmentFolderId'][_0x3c94bc(0x26b)]())||'':'',_0x5f59f5=_0xe4d0fc?_0xe4d0fc+'/'+_0x1998fa['name']:_0x1998fa['name'],_0x3fb703=_0x23a43a[_0x3c94bc(0x207)](_0x1998fa['id'])||[],_0x353d8c=_0x3fb703['length']>0x0?a41_0x3987b6[_0x3c94bc(0x1f2)]('\x20['+_0x3fb703['length']+_0x3c94bc(0x234)):'';console['error']('\x0a'+a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x22f))+'\x20'+_0x5f59f5+_0x353d8c),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));const _0x1b02ff=segmentWithActivationsToYaml(_0x1998fa,_0x3fb703,undefined,_0x575f61,_0x3a3951),_0x28040a=segmentToYamlString(_0x1b02ff),_0x475bd8=generateDiff(_0x28040a,'');console[_0x3c94bc(0x275)](formatDiffWithColors(_0x475bd8)),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}const _0x548305=_0x1ab88c[_0x3c94bc(0x25b)](_0x205333=>!_0x205333[_0x3c94bc(0x285)]&&_0x205333[_0x3c94bc(0x216)]);if(_0x548305[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)])for(const _0x29ba55 of _0x548305){const _0x26b4b5=_0x29ba55['folderPath']?_0x29ba55['folderPath']+'/'+_0x29ba55['yamlConfig'][_0x3c94bc(0x210)]:_0x29ba55['yamlConfig'][_0x3c94bc(0x210)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6['yellow']('Changes\x20to:')+'\x20'+_0x26b4b5),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c)),console[_0x3c94bc(0x275)](_0x29ba55[_0x3c94bc(0x216)]),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}if(_0x2bdd5a[_0x3c94bc(0x205)]>0x0)for(const _0x38265f of _0x2bdd5a){const _0x1be554=_0x38265f[_0x3c94bc(0x273)]?_0x38265f[_0x3c94bc(0x273)]+'/'+_0x38265f['yamlConfig'][_0x3c94bc(0x210)]:_0x38265f[_0x3c94bc(0x22a)][_0x3c94bc(0x210)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6[_0x3c94bc(0x209)](_0x3c94bc(0x1fd))+'\x20'+_0x1be554),console['error']('─'[_0x3c94bc(0x258)](0x3c)),_0x38265f[_0x3c94bc(0x216)]&&console[_0x3c94bc(0x275)](_0x38265f[_0x3c94bc(0x216)]),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}const _0x59df6d=_0x5367f0[_0x3c94bc(0x25b)](_0x4addda=>!_0x4addda[_0x3c94bc(0x285)]&&_0x4addda[_0x3c94bc(0x216)]);if(_0x59df6d['length']>0x0)for(const _0x1ebf18 of _0x59df6d){const _0x50bf59=_0x1ebf18[_0x3c94bc(0x273)]?_0x1ebf18[_0x3c94bc(0x273)]+'/'+_0x1ebf18['yamlConfig']['name']:_0x1ebf18[_0x3c94bc(0x22a)][_0x3c94bc(0x210)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x20a))+'\x20'+_0x50bf59),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c)),console['error'](_0x1ebf18[_0x3c94bc(0x216)]),console['error']('─'[_0x3c94bc(0x258)](0x3c));}if(_0x48ac05['length']>0x0)for(const _0x3cd264 of _0x48ac05){const _0x31f424=_0x3cd264[_0x3c94bc(0x23e)]?_0x2cf7f6[_0x3c94bc(0x207)](_0x3cd264[_0x3c94bc(0x23e)])||'':'',_0x53559c=_0x31f424?_0x31f424+'/'+_0x3cd264[_0x3c94bc(0x1f3)]:_0x3cd264[_0x3c94bc(0x1f3)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x243))+'\x20'+_0x53559c),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c)),console['error'](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x214))),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}if(_0x15bfcf[_0x3c94bc(0x236)])return console['error'](a41_0x3987b6['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x25ada4=_0x15bfcf[_0x3c94bc(0x248)]?![]:_0x1b0e43['length']>0x0||_0x1a727a['length']>0x0||_0x2e814f[_0x3c94bc(0x205)]>0x0,_0x39657b=_0x2bdd5a[_0x3c94bc(0x205)]>0x0||_0x47d8be['length']>0x0||_0x48ac05[_0x3c94bc(0x205)]>0x0,_0x663f34=_0x15bfcf[_0x3c94bc(0x248)]?![]:_0x1d1d7a[_0x3c94bc(0x205)]>0x0,_0x1e5ef8=_0x99625e[_0x3c94bc(0x205)]>0x0;if(!_0x25ada4&&!_0x39657b&&!_0x663f34&&!_0x1e5ef8){const _0xb5508c=_0x15bfcf[_0x3c94bc(0x248)]?_0x3c94bc(0x264):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x209)](_0xb5508c));if(_0x354afb&&_0x1a877c[_0x3c94bc(0x205)]===0x1){const _0x3799c3=_0x1a877c[0x0];if(_0x3799c3['existingSegment']?.['id']){const _0x38cdee=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+_0x3c94bc(0x22e)+_0x3799c3[_0x3c94bc(0x1f1)]['id']+_0x3c94bc(0x20c));console[_0x3c94bc(0x275)](_0x3c94bc(0x24e)+a41_0x3987b6['cyan'](_0x38cdee));}}if(_0x354afb&&_0x1e6e67[_0x3c94bc(0x205)]===0x1){const _0x44c5b4=_0x1e6e67[0x0];if(_0x44c5b4[_0x3c94bc(0x280)]?.['id']){const _0x5684db=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+_0x3c94bc(0x22e)+_0x44c5b4[_0x3c94bc(0x280)]['id']+_0x3c94bc(0x261));console['error']('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x5684db));}}return 0x0;}const _0x33fb9d=_0x15bfcf['journeysOnly']?_0x2bdd5a[_0x3c94bc(0x205)]+_0x47d8be[_0x3c94bc(0x205)]+_0x48ac05[_0x3c94bc(0x205)]+_0x99625e[_0x3c94bc(0x205)]:_0x1b0e43['length']+_0x1a727a[_0x3c94bc(0x205)]+_0x2e814f[_0x3c94bc(0x205)]+_0x2bdd5a[_0x3c94bc(0x205)]+_0x47d8be[_0x3c94bc(0x205)]+_0x48ac05[_0x3c94bc(0x205)]+_0x99625e[_0x3c94bc(0x205)]+_0x1d1d7a['length'];if(!_0x15bfcf[_0x3c94bc(0x21e)]&&_0x33fb9d>0x0){if(!isInteractive())return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)]('\x0aError:'),_0x3c94bc(0x20b)),console['error'](a41_0x3987b6[_0x3c94bc(0x1f2)](_0x3c94bc(0x1fe))),0x1;const _0x31293d=await confirmKey('Push\x20'+_0x33fb9d+'\x20changes?');if(!_0x31293d)return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x262))),0x1;}const _0x209872={'withProgress':async(_0x3ffa08,_0x42e793)=>{const _0xf7c837=_0x3c94bc,_0x43bb94=await withSpinner(_0x3ffa08,_0x42e793,{'verbose':_0x15bfcf[_0xf7c837(0x232)]});return{'data':_0x43bb94[_0xf7c837(0x22d)]};},'logInfo':_0x371322=>console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x256)]('✔\x20'+_0x371322)),'logSuccess':_0x1888b5=>console['error'](a41_0x3987b6[_0x3c94bc(0x209)]('✔\x20'+_0x1888b5)),'logWarning':_0x4c4e14=>console[_0x3c94bc(0x275)](a41_0x3987b6['yellow']('⚠\x20'+_0x4c4e14)),'logDeleted':_0x132c28=>console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)]('✔\x20'+_0x132c28))},_0x4a333e={'segment':_0x2a0e6e[_0x3c94bc(0x242)],'journey':_0x2a0e6e['journey'],'user':_0x2a0e6e[_0x3c94bc(0x229)],'connection':_0x2a0e6e['connection']};_0x99625e[_0x3c94bc(0x205)]>0x0&&(_0x223973=await executePushFolders(_0x4a333e,_0x99625e,_0x223973,{'parentId':_0x314481},_0x209872));const _0x4c16b1={'rootFolderId':_0x291903,'folderPathToId':_0x223973,'folderIdToPath':_0x2cf7f6,'segmentNameToId':_0x50086f,'activationsBySegmentId':_0x23a43a,'emailToIdMap':_0x130ce2,'idToEmailMap':_0x575f61,'connectionNameToIdMap':_0x1e8aaa[_0x3c94bc(0x230)],'connectionIdToNameMap':_0x1e8aaa[_0x3c94bc(0x23a)],'connectionNameToTypeMap':_0x490b46},_0x217a41=await executePushSegments(_0x4a333e,_0x15bfcf['journeysOnly']?[]:_0x1ab88c,_0x4c16b1,{'parentId':_0x314481},_0x209872),_0x5e1fca=_0x217a41[_0x3c94bc(0x1ea)],_0x4f069f=_0x217a41[_0x3c94bc(0x25e)],_0x11051c=_0x217a41[_0x3c94bc(0x1eb)][_0x3c94bc(0x1ea)],_0x30d080=_0x217a41[_0x3c94bc(0x1eb)][_0x3c94bc(0x25e)],_0x562b6b=_0x217a41[_0x3c94bc(0x1eb)]['deleted'];let _0x351a81;if(_0x354afb&&_0x1ab88c[_0x3c94bc(0x205)]===0x1){const _0x427a1e=_0x1ab88c[0x0];_0x351a81=_0x427a1e[_0x3c94bc(0x1f1)]?.['id']??_0x217a41[_0x3c94bc(0x1f4)][_0x3c94bc(0x207)](_0x427a1e[_0x3c94bc(0x22a)][_0x3c94bc(0x210)]);}const _0x5e731b=await executePushSegmentDeletions(_0x4a333e,_0x15bfcf[_0x3c94bc(0x248)]?[]:_0x2e814f,_0x209872);let _0x8c15e0=0x0,_0x31f42e=0x0,_0x49c08e=0x0;const _0x14dc9e=new Map(_0x50086f);for(const [_0x267249,_0x2e05f7]of _0x217a41[_0x3c94bc(0x1f4)]){_0x14dc9e[_0x3c94bc(0x233)](_0x267249,_0x2e05f7);}if(_0x5367f0['length']>0x0){const _0x333ae3={..._0x4c16b1,'segmentNameToId':_0x14dc9e,'existingSegments':_0x2b0c7a,'activationContext':_0x17372},_0x594f41=await executePushJourneys(_0x4a333e,_0x5367f0,_0x333ae3,{'parentId':_0x314481,'rootFolderId':_0x291903,'verbose':_0x15bfcf[_0x3c94bc(0x232)]},_0x209872);_0x8c15e0=_0x594f41['created'],_0x31f42e=_0x594f41['updated'];if(_0x354afb&&_0x594f41[_0x3c94bc(0x265)][_0x3c94bc(0x205)]===0x1){const _0x49c5b9=_0x594f41[_0x3c94bc(0x265)][0x0];if(_0x49c5b9[_0x3c94bc(0x21f)]){const _0x18392e=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+'/e/'+_0x49c5b9[_0x3c94bc(0x21f)]+_0x3c94bc(0x261));console[_0x3c94bc(0x275)]('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x18392e));}}}for(const _0x28ae50 of _0x48ac05){console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x206)+_0x28ae50[_0x3c94bc(0x1f3)])),_0x49c08e++;}const _0x5be11d=[];if(_0x5e1fca>0x0)_0x5be11d['push'](_0x5e1fca+'\x20created');if(_0x4f069f>0x0)_0x5be11d[_0x3c94bc(0x21d)](_0x4f069f+_0x3c94bc(0x224));if(_0x5e731b>0x0)_0x5be11d[_0x3c94bc(0x21d)](_0x5e731b+'\x20deleted');const _0x11301b=[];if(_0x8c15e0>0x0)_0x11301b[_0x3c94bc(0x21d)](_0x8c15e0+'\x20created');if(_0x31f42e>0x0)_0x11301b[_0x3c94bc(0x21d)](_0x31f42e+_0x3c94bc(0x224));if(_0x49c08e>0x0)_0x11301b[_0x3c94bc(0x21d)](_0x49c08e+_0x3c94bc(0x1fc));const _0x1f5914=[];if(_0x11051c>0x0)_0x1f5914[_0x3c94bc(0x21d)](_0x11051c+'\x20created');if(_0x30d080>0x0)_0x1f5914['push'](_0x30d080+'\x20updated');if(_0x562b6b>0x0)_0x1f5914[_0x3c94bc(0x21d)](_0x562b6b+'\x20deleted');console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x209)](_0x3c94bc(0x271)));_0x5be11d[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf['journeysOnly']&&console[_0x3c94bc(0x275)](_0x3c94bc(0x239)+_0x5be11d['join'](',\x20'));_0x11301b['length']>0x0&&console[_0x3c94bc(0x275)](_0x3c94bc(0x22b)+_0x11301b[_0x3c94bc(0x223)](',\x20'));_0x1f5914[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)]&&console[_0x3c94bc(0x275)](_0x3c94bc(0x219)+_0x1f5914[_0x3c94bc(0x223)](',\x20'));if(_0x351a81){const _0x5d1cb1=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+_0x3c94bc(0x22e)+_0x351a81+_0x3c94bc(0x20c));console[_0x3c94bc(0x275)](_0x3c94bc(0x24e)+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x5d1cb1));}return 0x0;}}
1
+ const a41_0x2b996c=a41_0x4cf5;(function(_0x55bc05,_0x3aa2f5){const _0x846c=a41_0x4cf5,_0x5dc190=_0x55bc05();while(!![]){try{const _0x348eac=-parseInt(_0x846c(0xcf))/0x1+parseInt(_0x846c(0xd6))/0x2+-parseInt(_0x846c(0xaf))/0x3+-parseInt(_0x846c(0x74))/0x4*(parseInt(_0x846c(0xf2))/0x5)+-parseInt(_0x846c(0xfc))/0x6*(parseInt(_0x846c(0x6a))/0x7)+-parseInt(_0x846c(0x84))/0x8*(parseInt(_0x846c(0x82))/0x9)+parseInt(_0x846c(0xc5))/0xa;if(_0x348eac===_0x3aa2f5)break;else _0x5dc190['push'](_0x5dc190['shift']());}catch(_0x18452d){_0x5dc190['push'](_0x5dc190['shift']());}}}(a41_0x15e7,0x1c369));function a41_0x4cf5(_0x21b6b8,_0x2f6363){_0x21b6b8=_0x21b6b8-0x68;const _0x15e759=a41_0x15e7();let _0x4cf561=_0x15e759[_0x21b6b8];return _0x4cf561;}import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0x15e7(){const _0x5c60e4=['map','diff','site','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeys','journeysOnly','endsWith','7IEHlWp','\x20changed','segments','nameToId','repeat','nameToType','length','verbose','blue','buildUserMaps','4DuBdPG','name','\x20\x20Source:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','changed','Fetching\x20existing\x20activations...','versionNumber','(Journey\x20will\x20be\x20deleted)','folders','listJourneysWithDetailsFromParentSegment','\x20\x20\x20\x20','push','user','Changes\x20to\x20journey:','1098RYvOrb','getOutputSchemaWithCache','9096yOfgTN','\x20\x20Segments:\x20','created','yamlConfig','dim','cyan','scopedFolderPath','\x0aError:','type','segment:push','journeyBundleName','list','Delete\x20segment:','toCreate','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yes','set','file','cwd','unchanged','attributes','Folders\x20to\x20create:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','delete','dryRun','\x20to\x20delete','description','createdSegmentIds','segment\x20or\x20journey','\x20folders\x20to\x20create','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','existingJourney','.yml','/sb/da/esr','New\x20journey:','isNew','\x20new','data','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','toDelete','listFolders','\x20updated','createdAt','531015JeMXry','/app/ps/','folderPath','error','listSegments','/j/da/je','Site:\x20','\x20\x20🗺️\x20\x20Journeys:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','results','helpText','/e/','\x20\x20📊\x20Segments:','\x20\x20Activations:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','join','folderId','Fetching\x20existing\x20data...','get','setPhase','Changes\x20to:','9956470bboKKa','Aborted.','updatedAt','📁\x20','existingSegment','add','audienceId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','updated','\x27...','131956VpEweu','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20created','connection','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20\x20Journeys:\x20','green','28198BEqtwl','\x20YAML\x20files\x20found','.yaml','Fetching\x20connections\x20for\x20name\x20resolution...','targetDir','Error\x20parsing\x20YAML:\x20','parentFolder','\x20to\x20update','segment','No\x20','all','\x20unchanged','then','segmentFolderId','execute','\x0aPush\x20summary\x20for\x20\x27','yellow','activations','journey','Error:\x20','new','toString','\x0a✔\x20Push\x20complete','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20deleted','journeyId','Parent\x20segment:\x20','relationships','1105730KPmfOn','filter','state','message','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20create','\x20\x20Activations:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','parentSegment','Push\x20','1352184QWPZic','\x20activations]','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Resolving\x20parent\x20segment\x20\x27','Scoped\x20to\x20folder:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getJourney','red','Error:\x20Directory\x20not\x20found:\x20'];a41_0x15e7=function(){return _0x5c60e4;};return a41_0x15e7();}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_0x25cc2a 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_0x2b996c(0x75)]=a41_0x2b996c(0x8d);[a41_0x2b996c(0x9e)]=a41_0x2b996c(0xbe);async[a41_0x2b996c(0xe4)](_0x591fc2){const _0x451126=a41_0x2b996c,{options:_0x415a26,args:_0xad8d49,tdx:_0x3a78eb}=_0x591fc2,_0x13a22f=_0x415a26,_0x48e184=await resolveTarget({'arg':_0xad8d49[0x0],'contextParent':_0x415a26[_0x451126(0xfa)],'cwd':process[_0x451126(0x96)]()});if(!isSuccessfulResolution(_0x48e184))return _0x48e184['errorCode']==='no_parent'?(console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0xe6)](_0x451126(0xed))),console[_0x451126(0xb2)](_0x451126(0xf9)),console['error'](_0x451126(0x9a)),console['error'](_0x451126(0xfe))):(console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x103)](_0x451126(0xe9)+_0x48e184[_0x451126(0xf5)]+'\x0a')),_0x48e184[_0x451126(0xb9)]&&console[_0x451126(0xb2)](a41_0x25cc2a['cyan'](_0x48e184[_0x451126(0xb9)]))),0x1;if(_0x48e184[_0x451126(0x8c)]==='parent_name')return console[_0x451126(0xb2)](a41_0x25cc2a['red'](_0x451126(0x104)+_0x48e184[_0x451126(0xda)]+'\x0a')),console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x89)](_0x451126(0x77))),0x1;const _0x53976c=_0x48e184['parentName'],_0x3a5924=_0x48e184[_0x451126(0xda)],_0x5c8843=_0x48e184['type']===_0x451126(0x95)?_0x48e184['filePath']:undefined,_0x255e31=getScopedDetails(_0x48e184),_0x47de8c=_0x255e31?.['isScoped']??![],_0x4d3763=_0x255e31?.[_0x451126(0x8a)]??'';if(!existsSync(_0x3a5924))return console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x103)](_0x451126(0x104)+_0x3a5924+'\x0a')),console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x89)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x13a22f[_0x451126(0x71)]&&(console[_0x451126(0xb2)](_0x451126(0xb5)+_0x13a22f[_0x451126(0x107)]),console[_0x451126(0xb2)](_0x451126(0xf0)+_0x53976c),console[_0x451126(0xb2)]('Source\x20directory:\x20'+_0x3a5924),_0x47de8c&&console['error'](_0x451126(0x100)+_0x4d3763));const _0x1f93b5=await withSpinner(_0x451126(0xff)+_0x53976c+_0x451126(0xce),()=>_0x3a78eb[_0x451126(0xde)]['resolveParentId'](_0x53976c),{'verbose':_0x13a22f[_0x451126(0x71)]}),_0x26ee3b=_0x1f93b5[_0x451126(0xa9)],{parentSegmentResult:_0x1304d2,segmentsResult:_0x3fcf78,foldersResult:_0x48f540,journeysWithDetailsResult:_0x1dc4ea,userMaps:_0x1163aa}=await withSpinner(_0x451126(0xc1),async()=>{const _0x4d4a11=_0x451126,[_0x22844e,_0x2b271b,_0xd7afc9,_0x3439b8,_0x31fe39]=await Promise['all']([_0x3a78eb[_0x4d4a11(0xde)]['getParent'](_0x26ee3b),_0x3a78eb[_0x4d4a11(0xde)][_0x4d4a11(0xb3)](_0x26ee3b),_0x3a78eb[_0x4d4a11(0xde)][_0x4d4a11(0xac)](_0x26ee3b),_0x3a78eb[_0x4d4a11(0xe8)][_0x4d4a11(0x7d)](_0x26ee3b,{'includeAllVersions':!![]}),_0x3a78eb['user'][_0x4d4a11(0x73)]()]);return{'parentSegmentResult':_0x22844e,'segmentsResult':_0x2b271b,'foldersResult':_0xd7afc9,'journeysWithDetailsResult':_0x3439b8,'userMaps':_0x31fe39};},{'verbose':_0x13a22f[_0x451126(0x71)]})[_0x451126(0xe2)](_0x326936=>_0x326936['data']),_0x5207d6=_0x1304d2,_0x34dcd3=extractRootFolderId(_0x5207d6),_0x158608=_0x3fcf78,_0x358a00=_0x48f540,{journeys:_0x1234ee,activationStepsById:_0x2b8fb4}=_0x1dc4ea,_0x55ed9f=new Map(_0x1234ee[_0x451126(0x105)](_0x2cd6c9=>[_0x2cd6c9['id'],_0x2cd6c9])),_0x19cf67=_0x1234ee[_0x451126(0x105)](_0x5263d3=>({'id':_0x5263d3['id'],'name':_0x5263d3[_0x451126(0x98)][_0x451126(0x75)],'journeyBundleName':_0x5263d3['attributes'][_0x451126(0x8e)]||'','journeyBundleId':_0x5263d3[_0x451126(0x98)]['journeyBundleId']||'','versionNumber':_0x5263d3[_0x451126(0x98)][_0x451126(0x7a)],'description':_0x5263d3[_0x451126(0x98)][_0x451126(0x9e)],'state':_0x5263d3['attributes'][_0x451126(0xf4)],'paused':_0x5263d3[_0x451126(0x98)]['paused'],'audienceId':_0x5263d3[_0x451126(0x98)][_0x451126(0xcb)],'folderId':_0x5263d3[_0x451126(0xf1)]?.[_0x451126(0xdc)]?.[_0x451126(0xa9)]?.['id'],'createdAt':_0x5263d3['attributes'][_0x451126(0xae)],'updatedAt':_0x5263d3[_0x451126(0x98)][_0x451126(0xc7)]})),{emailToId:_0x50d798,idToEmail:_0x1bd637}=_0x1163aa,_0x10e5d6=await withSpinner(_0x451126(0xd9),async()=>{const _0x3ea0ee=_0x451126,_0x473a99=await _0x3a78eb[_0x3ea0ee(0xd2)][_0x3ea0ee(0x8f)]();return buildConnectionMaps(_0x473a99);},{'verbose':_0x13a22f[_0x451126(0x71)]})[_0x451126(0xe2)](_0x23b7bb=>_0x23b7bb[_0x451126(0xa9)]),_0x4cd0af=_0x10e5d6[_0x451126(0x6d)],_0x54aa4d=_0x10e5d6['idToName'],_0x2ec15b=_0x10e5d6[_0x451126(0x6f)],_0x194740={'emailToIdMap':_0x50d798,'connectionNameToIdMap':_0x4cd0af,'connectionNameToTypeMap':_0x2ec15b,'getSchema':_0x42ccd2=>_0x3a78eb[_0x451126(0xd2)][_0x451126(0x83)](_0x42ccd2)};let {pathToId:_0x527593,idToPath:_0x35a985}=buildFolderMaps(_0x358a00);const _0x2f2d5=buildSegmentLookupMap(_0x158608,_0x35a985),_0x1f3836=buildSegmentNameToIdMap(_0x158608),_0x13ea36=buildJourneyBundleLookupMap(_0x19cf67,_0x35a985);let _0x4b84aa;if(_0x5c8843){if(!_0x5c8843[_0x451126(0x69)](_0x451126(0xa4))&&!_0x5c8843[_0x451126(0x69)](_0x451126(0xd8)))return console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x103)](_0x451126(0x92)+_0x5c8843+'\x0a')),0x1;_0x4b84aa=[_0x5c8843];}else _0x4b84aa=findYamlFiles(_0x3a5924);if(_0x4b84aa[_0x451126(0x70)]===0x0)return console['error'](a41_0x25cc2a[_0x451126(0x103)](_0x451126(0xcc)+_0x3a5924+'\x0a')),console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x89)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x1cbd25,_0x58e6ff;try{const _0x4972c4=parseAndClassifyYamlFiles(_0x4b84aa,_0x3a5924,{'skipSegments':_0x13a22f[_0x451126(0x68)]});_0x1cbd25=_0x4972c4[_0x451126(0x6c)],_0x58e6ff=_0x4972c4[_0x451126(0x109)];const _0x34f35c=validateParsedFiles(_0x4972c4,_0x3a5924);if(_0x34f35c[_0x451126(0x70)]>0x0)return console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x103)]('\x0aValidation\x20failed:')),console[_0x451126(0xb2)](formatValidationErrors(_0x34f35c)),console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0xe6)](_0x451126(0xbd))),0x1;}catch(_0x35b969){return console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x103)](_0x451126(0xdb)+(_0x35b969 instanceof Error?_0x35b969['message']:_0x35b969))),0x1;}if(_0x1cbd25[_0x451126(0x70)]===0x0&&_0x58e6ff[_0x451126(0x70)]===0x0){const _0x28fb85=_0x13a22f[_0x451126(0x68)]?_0x451126(0xe8):_0x451126(0xa0);return console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0xe6)](_0x451126(0xdf)+_0x28fb85+_0x451126(0xd7))),0x0;}const _0x15618c=new Map();_0x158608[_0x451126(0x70)]>0x0&&!_0x13a22f[_0x451126(0x68)]&&await withSpinner(_0x451126(0x79),async()=>{await batchAsync(_0x158608,async _0x4aa329=>{const _0x43142c=a41_0x4cf5,_0x33e6d6=await _0x3a78eb[_0x43142c(0xde)]['listActivations'](_0x26ee3b,_0x4aa329['id']);_0x15618c[_0x43142c(0x94)](_0x4aa329['id'],_0x33e6d6);});},{'verbose':_0x13a22f[_0x451126(0x71)]});const {segmentFiles:_0x13aae7,foldersToCreate:_0x2d511c}=await prepareSegmentFiles(_0x1cbd25,{'segmentByFolderAndName':_0x2f2d5,'activationsBySegmentId':_0x15618c,'folderPathToId':_0x527593,'idToEmailMap':_0x1bd637,'connectionIdToNameMap':_0x54aa4d},_0x194740,_0x47de8c,_0x4d3763),_0x4b3be7=_0x5c8843?[]:findSegmentsToDelete(_0x158608,_0x1cbd25[_0x451126(0x105)](({yamlConfig:_0x34e737,folderPath:_0x400f51})=>({'yamlConfig':_0x34e737,'folderPath':resolveTDFolderPath(_0x400f51,_0x47de8c,_0x4d3763)})),_0x35a985,_0x4d3763,_0x47de8c),{journeyFiles:_0x553253,foldersToCreate:_0x4d605d}=await withProgressSpinner('Preparing\x20journeys...',async _0x14b405=>prepareJourneyFiles(_0x58e6ff,{'fetchJourney':async _0x3fff67=>_0x3a78eb[_0x451126(0xe8)][_0x451126(0x102)](_0x3fff67[_0x451126(0xef)]),'journeyBundlesByFolderAndName':_0x13ea36,'folderPathToId':_0x527593,'idToEmailMap':_0x1bd637,'connectionIdToNameMap':_0x54aa4d,'existingSegments':_0x158608,'parentId':_0x26ee3b,'deps':_0x3a78eb,'progress':{'update':_0x250709=>{const _0x2c2ac6=_0x451126;_0x14b405[_0x2c2ac6(0xc3)](_0x250709),_0x13a22f['verbose']&&console[_0x2c2ac6(0xb2)]('\x20\x20'+_0x250709);}},'journeyById':_0x55ed9f,'activationStepsById':_0x2b8fb4},_0x47de8c,_0x4d3763),{'verbose':_0x13a22f[_0x451126(0x71)]})[_0x451126(0xe2)](_0x2187af=>_0x2187af[_0x451126(0xa9)]);for(const _0x53ddbb of _0x4d605d){_0x2d511c[_0x451126(0xca)](_0x53ddbb);}const _0x2c6413=_0x5c8843?[]:findJourneysToDelete(_0x19cf67,_0x58e6ff[_0x451126(0x105)](({yamlConfig:_0x334103,folderPath:_0x2a0ca3})=>({'yamlConfig':_0x334103,'folderPath':resolveTDFolderPath(_0x2a0ca3,_0x47de8c,_0x4d3763)})),_0x35a985,_0x4d3763,_0x47de8c),_0x1a3010=calculatePushStats(_0x13aae7,_0x553253,_0x2d511c,_0x4b3be7,_0x2c6413,!!_0x13a22f[_0x451126(0x9b)],!!_0x13a22f[_0x451126(0x68)]),_0x2f39af=_0x1a3010['segments'][_0x451126(0xea)],_0x4ec89c=_0x1a3010['segments'][_0x451126(0x78)],_0x245fc9=_0x1a3010['segments']['unchanged'],_0x5d2c79=_0x1a3010[_0x451126(0x6c)][_0x451126(0xab)],_0x4e3622=_0x1a3010[_0x451126(0x7c)][_0x451126(0x91)],_0x5d1bb2=_0x1a3010[_0x451126(0x109)][_0x451126(0xea)],_0x150053=_0x1a3010['journeys']['changed'],_0x3f0bfa=_0x1a3010[_0x451126(0x109)][_0x451126(0x97)],_0x21042b=_0x1a3010['journeys'][_0x451126(0xab)],_0x4f2987=_0x1a3010[_0x451126(0xe7)][_0x451126(0xe0)],_0x3d958b=_0x1a3010[_0x451126(0xe7)][_0x451126(0x91)],_0x129c88=_0x1a3010['activations']['toUpdate'],_0x336bc7=_0x1a3010[_0x451126(0xe7)]['toDelete'];console[_0x451126(0xb2)](_0x451126(0xe5)+_0x53976c+'\x27:');_0x4e3622[_0x451126(0x70)]>0x0&&console[_0x451126(0xb2)]('\x20\x20'+a41_0x25cc2a[_0x451126(0x72)](_0x451126(0xc8)+_0x4e3622[_0x451126(0x70)]+_0x451126(0xa1)));if(!_0x13a22f[_0x451126(0x68)]){console[_0x451126(0xb2)](_0x451126(0xbb)),console[_0x451126(0xb2)](_0x451126(0x7e)+a41_0x25cc2a['green']('+\x20'+_0x2f39af['length']+_0x451126(0xa8))),console[_0x451126(0xb2)](_0x451126(0x7e)+a41_0x25cc2a[_0x451126(0xe6)]('~\x20'+_0x4ec89c[_0x451126(0x70)]+_0x451126(0x6b)));if(_0x5d2c79['length']>0x0)console[_0x451126(0xb2)]('\x20\x20\x20\x20'+a41_0x25cc2a['red']('-\x20'+_0x5d2c79[_0x451126(0x70)]+_0x451126(0x9d)));else _0x4b3be7[_0x451126(0x70)]>0x0&&!_0x13a22f[_0x451126(0x9b)]&&console[_0x451126(0xb2)](_0x451126(0x7e)+a41_0x25cc2a[_0x451126(0x88)](_0x4b3be7['length']+_0x451126(0x108)));console['error'](_0x451126(0x7e)+a41_0x25cc2a[_0x451126(0x88)]('=\x20'+_0x245fc9[_0x451126(0x70)]+_0x451126(0xe1)));}if(_0x553253[_0x451126(0x70)]>0x0||_0x2c6413[_0x451126(0x70)]>0x0){console[_0x451126(0xb2)](_0x451126(0xb6)),console['error']('\x20\x20\x20\x20'+a41_0x25cc2a[_0x451126(0xd5)]('+\x20'+_0x5d1bb2[_0x451126(0x70)]+_0x451126(0xa8))),console[_0x451126(0xb2)](_0x451126(0x7e)+a41_0x25cc2a[_0x451126(0xe6)]('~\x20'+_0x150053[_0x451126(0x70)]+'\x20changed'));if(_0x21042b[_0x451126(0x70)]>0x0)console[_0x451126(0xb2)]('\x20\x20\x20\x20'+a41_0x25cc2a['red']('-\x20'+_0x21042b[_0x451126(0x70)]+_0x451126(0x9d)));else _0x2c6413[_0x451126(0x70)]>0x0&&!_0x13a22f[_0x451126(0x9b)]&&console['error'](_0x451126(0x7e)+a41_0x25cc2a[_0x451126(0x88)](_0x2c6413[_0x451126(0x70)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x451126(0xb2)]('\x20\x20\x20\x20'+a41_0x25cc2a[_0x451126(0x88)]('=\x20'+_0x3f0bfa['length']+'\x20unchanged'));}_0x4f2987['length']>0x0&&!_0x13a22f[_0x451126(0x68)]&&(console[_0x451126(0xb2)](''),console[_0x451126(0xb2)](_0x451126(0xbc)),_0x3d958b['length']>0x0&&console[_0x451126(0xb2)]('\x20\x20\x20\x20'+a41_0x25cc2a[_0x451126(0xd5)]('+\x20'+_0x3d958b['length']+_0x451126(0xf7))),_0x129c88['length']>0x0&&console[_0x451126(0xb2)](_0x451126(0x7e)+a41_0x25cc2a[_0x451126(0xe6)]('~\x20'+_0x129c88[_0x451126(0x70)]+_0x451126(0xdd))),_0x336bc7[_0x451126(0x70)]>0x0&&console['error'](_0x451126(0x7e)+a41_0x25cc2a[_0x451126(0x103)]('-\x20'+_0x336bc7[_0x451126(0x70)]+_0x451126(0x9d))));console[_0x451126(0xb2)](_0x451126(0x76)+a41_0x25cc2a['cyan'](_0x3a5924)+'\x0a');if(_0x4e3622[_0x451126(0x70)]>0x0){console[_0x451126(0xb2)](_0x451126(0x99));for(const _0x5f5899 of _0x4e3622){console[_0x451126(0xb2)]('\x20\x20'+a41_0x25cc2a[_0x451126(0x72)]('+')+'\x20'+_0x5f5899);}console[_0x451126(0xb2)]('');}if(_0x2f39af[_0x451126(0x70)]>0x0&&!_0x13a22f['journeysOnly'])for(const _0x2104b0 of _0x2f39af){const _0x3a4b24=_0x2104b0[_0x451126(0xb1)]?_0x2104b0[_0x451126(0xb1)]+'/'+_0x2104b0[_0x451126(0x87)][_0x451126(0x75)]:_0x2104b0[_0x451126(0x87)]['name'],_0x5c3c2e=_0x2104b0[_0x451126(0x87)]['activations']?.['length']||0x0,_0x7498b5=_0x5c3c2e>0x0?a41_0x25cc2a['dim']('\x20['+_0x5c3c2e+_0x451126(0xfd)):'';console[_0x451126(0xb2)]('\x0a'+a41_0x25cc2a[_0x451126(0xd5)]('New\x20segment:')+'\x20'+_0x3a4b24+_0x7498b5),console[_0x451126(0xb2)]('─'[_0x451126(0x6e)](0x3c)),_0x2104b0[_0x451126(0x106)]&&console[_0x451126(0xb2)](_0x2104b0[_0x451126(0x106)]),console['error']('─'[_0x451126(0x6e)](0x3c));}if(_0x5d2c79[_0x451126(0x70)]>0x0&&!_0x13a22f['journeysOnly'])for(const _0x5b2a30 of _0x5d2c79){const _0x31790f=_0x5b2a30[_0x451126(0xe3)]?_0x35a985[_0x451126(0xc2)](_0x5b2a30['segmentFolderId'][_0x451126(0xeb)]())||'':'',_0xcc511f=_0x31790f?_0x31790f+'/'+_0x5b2a30[_0x451126(0x75)]:_0x5b2a30['name'],_0x5b7251=_0x15618c[_0x451126(0xc2)](_0x5b2a30['id'])||[],_0x4e01ce=_0x5b7251[_0x451126(0x70)]>0x0?a41_0x25cc2a['dim']('\x20['+_0x5b7251[_0x451126(0x70)]+_0x451126(0xfd)):'';console[_0x451126(0xb2)]('\x0a'+a41_0x25cc2a[_0x451126(0x103)](_0x451126(0x90))+'\x20'+_0xcc511f+_0x4e01ce),console[_0x451126(0xb2)]('─'[_0x451126(0x6e)](0x3c));const _0x2bcf9c=segmentWithActivationsToYaml(_0x5b2a30,_0x5b7251,undefined,_0x1bd637,_0x54aa4d),_0x5dfb0f=segmentToYamlString(_0x2bcf9c),_0x3e65b6=generateDiff(_0x5dfb0f,'');console[_0x451126(0xb2)](formatDiffWithColors(_0x3e65b6)),console['error']('─'['repeat'](0x3c));}const _0x42854d=_0x13aae7[_0x451126(0xf3)](_0x761586=>!_0x761586['isNew']&&_0x761586[_0x451126(0x106)]);if(_0x42854d[_0x451126(0x70)]>0x0&&!_0x13a22f['journeysOnly'])for(const _0xd32af1 of _0x42854d){const _0x229f09=_0xd32af1[_0x451126(0xb1)]?_0xd32af1[_0x451126(0xb1)]+'/'+_0xd32af1[_0x451126(0x87)]['name']:_0xd32af1[_0x451126(0x87)][_0x451126(0x75)];console[_0x451126(0xb2)]('\x0a'+a41_0x25cc2a[_0x451126(0xe6)](_0x451126(0xc4))+'\x20'+_0x229f09),console[_0x451126(0xb2)]('─'[_0x451126(0x6e)](0x3c)),console['error'](_0xd32af1[_0x451126(0x106)]),console[_0x451126(0xb2)]('─'[_0x451126(0x6e)](0x3c));}if(_0x5d1bb2['length']>0x0)for(const _0x4de6fe of _0x5d1bb2){const _0x5af3eb=_0x4de6fe[_0x451126(0xb1)]?_0x4de6fe[_0x451126(0xb1)]+'/'+_0x4de6fe[_0x451126(0x87)][_0x451126(0x75)]:_0x4de6fe['yamlConfig'][_0x451126(0x75)];console['error']('\x0a'+a41_0x25cc2a[_0x451126(0xd5)](_0x451126(0xa6))+'\x20'+_0x5af3eb),console[_0x451126(0xb2)]('─'[_0x451126(0x6e)](0x3c)),_0x4de6fe['diff']&&console[_0x451126(0xb2)](_0x4de6fe[_0x451126(0x106)]),console[_0x451126(0xb2)]('─'[_0x451126(0x6e)](0x3c));}const _0x554507=_0x553253[_0x451126(0xf3)](_0x358c91=>!_0x358c91[_0x451126(0xa7)]&&_0x358c91[_0x451126(0x106)]);if(_0x554507[_0x451126(0x70)]>0x0)for(const _0x4b9bbf of _0x554507){const _0x2c06ea=_0x4b9bbf[_0x451126(0xb1)]?_0x4b9bbf[_0x451126(0xb1)]+'/'+_0x4b9bbf[_0x451126(0x87)][_0x451126(0x75)]:_0x4b9bbf[_0x451126(0x87)][_0x451126(0x75)];console[_0x451126(0xb2)]('\x0a'+a41_0x25cc2a[_0x451126(0xe6)](_0x451126(0x81))+'\x20'+_0x2c06ea),console['error']('─'['repeat'](0x3c)),console['error'](_0x4b9bbf['diff']),console['error']('─'['repeat'](0x3c));}if(_0x21042b[_0x451126(0x70)]>0x0)for(const _0x5bd6a6 of _0x21042b){const _0x5bdb7b=_0x5bd6a6[_0x451126(0xc0)]?_0x35a985[_0x451126(0xc2)](_0x5bd6a6['folderId'])||'':'',_0x24815a=_0x5bdb7b?_0x5bdb7b+'/'+_0x5bd6a6[_0x451126(0x8e)]:_0x5bd6a6[_0x451126(0x8e)];console[_0x451126(0xb2)]('\x0a'+a41_0x25cc2a[_0x451126(0x103)]('Delete\x20journey:')+'\x20'+_0x24815a),console[_0x451126(0xb2)]('─'[_0x451126(0x6e)](0x3c)),console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x103)](_0x451126(0x7b))),console['error']('─'['repeat'](0x3c));}if(_0x13a22f[_0x451126(0x9c)])return console[_0x451126(0xb2)](a41_0x25cc2a['yellow'](_0x451126(0xaa))),0x0;const _0x53e50e=_0x13a22f[_0x451126(0x68)]?![]:_0x2f39af[_0x451126(0x70)]>0x0||_0x4ec89c['length']>0x0||_0x5d2c79[_0x451126(0x70)]>0x0,_0x5b2d51=_0x5d1bb2[_0x451126(0x70)]>0x0||_0x150053[_0x451126(0x70)]>0x0||_0x21042b['length']>0x0,_0x5165c2=_0x13a22f[_0x451126(0x68)]?![]:_0x4f2987[_0x451126(0x70)]>0x0,_0x249303=_0x4e3622[_0x451126(0x70)]>0x0;if(!_0x53e50e&&!_0x5b2d51&&!_0x5165c2&&!_0x249303){const _0x345418=_0x13a22f[_0x451126(0x68)]?_0x451126(0xd3):_0x451126(0xd0);console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0xd5)](_0x345418));if(_0x5c8843&&_0x245fc9[_0x451126(0x70)]===0x1){const _0x20025b=_0x245fc9[0x0];if(_0x20025b[_0x451126(0xc9)]?.['id']){const _0x25b90d=getConsoleNextUrl(_0x13a22f['site'],_0x451126(0xb0)+_0x26ee3b+_0x451126(0xba)+_0x20025b[_0x451126(0xc9)]['id']+_0x451126(0xa5));console[_0x451126(0xb2)](_0x451126(0xf6)+a41_0x25cc2a[_0x451126(0x89)](_0x25b90d));}}if(_0x5c8843&&_0x3f0bfa[_0x451126(0x70)]===0x1){const _0x3c4ec7=_0x3f0bfa[0x0];if(_0x3c4ec7[_0x451126(0xa3)]?.['id']){const _0x565b45=getConsoleNextUrl(_0x13a22f[_0x451126(0x107)],'/app/ps/'+_0x26ee3b+_0x451126(0xba)+_0x3c4ec7[_0x451126(0xa3)]['id']+'/j/da/je');console[_0x451126(0xb2)]('\x20\x20'+a41_0x25cc2a['cyan'](_0x565b45));}}return 0x0;}const _0x5a90a5=_0x13a22f['journeysOnly']?_0x5d1bb2['length']+_0x150053['length']+_0x21042b[_0x451126(0x70)]+_0x4e3622[_0x451126(0x70)]:_0x2f39af[_0x451126(0x70)]+_0x4ec89c[_0x451126(0x70)]+_0x5d2c79[_0x451126(0x70)]+_0x5d1bb2[_0x451126(0x70)]+_0x150053[_0x451126(0x70)]+_0x21042b[_0x451126(0x70)]+_0x4e3622[_0x451126(0x70)]+_0x4f2987['length'];if(!_0x13a22f[_0x451126(0x93)]&&_0x5a90a5>0x0){if(!isInteractive())return console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x103)](_0x451126(0x8b)),_0x451126(0xa2)),console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0x88)](_0x451126(0x101))),0x1;const _0x26109a=await confirmKey(_0x451126(0xfb)+_0x5a90a5+'\x20changes?');if(!_0x26109a)return console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0xe6)](_0x451126(0xc6))),0x1;}const _0x4189cb={'withProgress':async(_0x10b4cb,_0x37e502)=>{const _0x5d4f31=_0x451126,_0x7598b0=await withSpinner(_0x10b4cb,_0x37e502,{'verbose':_0x13a22f[_0x5d4f31(0x71)]});return{'data':_0x7598b0['data']};},'logInfo':_0x455626=>console[_0x451126(0xb2)](a41_0x25cc2a['blue']('✔\x20'+_0x455626)),'logSuccess':_0x25ee1e=>console[_0x451126(0xb2)](a41_0x25cc2a[_0x451126(0xd5)]('✔\x20'+_0x25ee1e)),'logWarning':_0x3d552c=>console['error'](a41_0x25cc2a['yellow']('⚠\x20'+_0x3d552c)),'logDeleted':_0x2a96ae=>console['error'](a41_0x25cc2a[_0x451126(0x103)]('✔\x20'+_0x2a96ae))},_0x1b0cb6={'segment':_0x3a78eb['segment'],'journey':_0x3a78eb[_0x451126(0xe8)],'user':_0x3a78eb[_0x451126(0x80)],'connection':_0x3a78eb[_0x451126(0xd2)]};_0x4e3622[_0x451126(0x70)]>0x0&&(_0x527593=await executePushFolders(_0x1b0cb6,_0x4e3622,_0x527593,{'parentId':_0x26ee3b},_0x4189cb));const _0x1be256={'rootFolderId':_0x34dcd3,'folderPathToId':_0x527593,'folderIdToPath':_0x35a985,'segmentNameToId':_0x1f3836,'activationsBySegmentId':_0x15618c,'emailToIdMap':_0x50d798,'idToEmailMap':_0x1bd637,'connectionNameToIdMap':_0x10e5d6[_0x451126(0x6d)],'connectionIdToNameMap':_0x10e5d6['idToName'],'connectionNameToTypeMap':_0x2ec15b},_0x3864eb=await executePushSegments(_0x1b0cb6,_0x13a22f[_0x451126(0x68)]?[]:_0x13aae7,_0x1be256,{'parentId':_0x26ee3b},_0x4189cb),_0x13ba53=_0x3864eb[_0x451126(0x86)],_0x442c3e=_0x3864eb['updated'],_0x4fe481=_0x3864eb[_0x451126(0xe7)]['created'],_0x26c282=_0x3864eb['activations'][_0x451126(0xcd)],_0x389b07=_0x3864eb[_0x451126(0xe7)]['deleted'];let _0x54961a;if(_0x5c8843&&_0x13aae7[_0x451126(0x70)]===0x1){const _0x23c3bf=_0x13aae7[0x0];_0x54961a=_0x23c3bf[_0x451126(0xc9)]?.['id']??_0x3864eb['createdSegmentIds'][_0x451126(0xc2)](_0x23c3bf[_0x451126(0x87)][_0x451126(0x75)]);}const _0x1fce41=await executePushSegmentDeletions(_0x1b0cb6,_0x13a22f[_0x451126(0x68)]?[]:_0x5d2c79,_0x4189cb);let _0x47fa97=0x0,_0x42afb9=0x0,_0x4d63f4=0x0;const _0x49f069=new Map(_0x1f3836);for(const [_0x1e4f2b,_0x9b6a2c]of _0x3864eb[_0x451126(0x9f)]){_0x49f069['set'](_0x1e4f2b,_0x9b6a2c);}if(_0x553253[_0x451126(0x70)]>0x0){const _0x4b3b4e={..._0x1be256,'segmentNameToId':_0x49f069,'existingSegments':_0x158608,'activationContext':_0x194740},_0x3e0df2=await executePushJourneys(_0x1b0cb6,_0x553253,_0x4b3b4e,{'parentId':_0x26ee3b,'rootFolderId':_0x34dcd3,'verbose':_0x13a22f[_0x451126(0x71)]},_0x4189cb);_0x47fa97=_0x3e0df2[_0x451126(0x86)],_0x42afb9=_0x3e0df2[_0x451126(0xcd)];if(_0x5c8843&&_0x3e0df2[_0x451126(0xb8)][_0x451126(0x70)]===0x1){const _0x16455e=_0x3e0df2[_0x451126(0xb8)][0x0];if(_0x16455e['journeyId']){const _0x1ffc46=getConsoleNextUrl(_0x13a22f[_0x451126(0x107)],_0x451126(0xb0)+_0x26ee3b+_0x451126(0xba)+_0x16455e['journeyId']+_0x451126(0xb4));console['error']('\x20\x20'+a41_0x25cc2a[_0x451126(0x89)](_0x1ffc46));}}}for(const _0x411f2d of _0x21042b){console['error'](a41_0x25cc2a[_0x451126(0xe6)](_0x451126(0xb7)+_0x411f2d['journeyBundleName'])),_0x4d63f4++;}const _0x46cab1=[];if(_0x13ba53>0x0)_0x46cab1[_0x451126(0x7f)](_0x13ba53+_0x451126(0xd1));if(_0x442c3e>0x0)_0x46cab1[_0x451126(0x7f)](_0x442c3e+_0x451126(0xad));if(_0x1fce41>0x0)_0x46cab1['push'](_0x1fce41+_0x451126(0xee));const _0x12c0c4=[];if(_0x47fa97>0x0)_0x12c0c4[_0x451126(0x7f)](_0x47fa97+_0x451126(0xd1));if(_0x42afb9>0x0)_0x12c0c4['push'](_0x42afb9+_0x451126(0xad));if(_0x4d63f4>0x0)_0x12c0c4[_0x451126(0x7f)](_0x4d63f4+_0x451126(0xee));const _0x3caac6=[];if(_0x4fe481>0x0)_0x3caac6[_0x451126(0x7f)](_0x4fe481+_0x451126(0xd1));if(_0x26c282>0x0)_0x3caac6['push'](_0x26c282+_0x451126(0xad));if(_0x389b07>0x0)_0x3caac6[_0x451126(0x7f)](_0x389b07+'\x20deleted');console['error'](a41_0x25cc2a[_0x451126(0xd5)](_0x451126(0xec)));_0x46cab1[_0x451126(0x70)]>0x0&&!_0x13a22f['journeysOnly']&&console['error'](_0x451126(0x85)+_0x46cab1[_0x451126(0xbf)](',\x20'));_0x12c0c4[_0x451126(0x70)]>0x0&&console[_0x451126(0xb2)](_0x451126(0xd4)+_0x12c0c4[_0x451126(0xbf)](',\x20'));_0x3caac6[_0x451126(0x70)]>0x0&&!_0x13a22f[_0x451126(0x68)]&&console[_0x451126(0xb2)](_0x451126(0xf8)+_0x3caac6[_0x451126(0xbf)](',\x20'));if(_0x54961a){const _0x6bae2f=getConsoleNextUrl(_0x13a22f[_0x451126(0x107)],_0x451126(0xb0)+_0x26ee3b+_0x451126(0xba)+_0x54961a+'/sb/da/esr');console[_0x451126(0xb2)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x25cc2a['cyan'](_0x6bae2f));}return 0x0;}}
@@ -1 +1 @@
1
- function a42_0x1f21(_0x5cac36,_0x304442){_0x5cac36=_0x5cac36-0x128;const _0x791044=a42_0x7910();let _0x1f2138=_0x791044[_0x5cac36];return _0x1f2138;}const a42_0xf0f947=a42_0x1f21;(function(_0x156e01,_0x4915dd){const _0x19f9cf=a42_0x1f21,_0x413040=_0x156e01();while(!![]){try{const _0x38388f=parseInt(_0x19f9cf(0x144))/0x1+parseInt(_0x19f9cf(0x154))/0x2+-parseInt(_0x19f9cf(0x14c))/0x3*(-parseInt(_0x19f9cf(0x138))/0x4)+parseInt(_0x19f9cf(0x13c))/0x5*(-parseInt(_0x19f9cf(0x142))/0x6)+-parseInt(_0x19f9cf(0x128))/0x7+-parseInt(_0x19f9cf(0x12d))/0x8+parseInt(_0x19f9cf(0x132))/0x9*(-parseInt(_0x19f9cf(0x131))/0xa);if(_0x38388f===_0x4915dd)break;else _0x413040['push'](_0x413040['shift']());}catch(_0x922ece){_0x413040['push'](_0x413040['shift']());}}}(a42_0x7910,0xb3a41));import{BaseCommand}from'./command.js';function a42_0x7910(){const _0x41725e=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','kind','verbose','Updating\x20segment\x20\x27','2474296kOCLVI','rule','Examples:','Parent\x20ID:\x20','103159TUqBvV','description','parentId','type','includes','5664568UdnhQn','Resolving\x20folder\x20\x27','yellow','Resolved\x20type:\x20','910QFZLpu','8847khJNLX','INTERNAL','updateSegmentById','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentId','error','908nhEcst','\x27...','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentName','5EHUasf','resolveFolderId','segmentPath','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','length','ruleFile','6727620eRIFUE','Resolving\x20path\x20\x27','168029sOjQTF','resolvePathToResource','name','Error:\x20Cannot\x20update\x20','data','Resolved\x20folder\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segment','16707VIAJgC','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folder'];a42_0x7910=function(){return _0x41725e;};return a42_0x7910();}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_0x414890 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0xf0f947(0x146)]='segment:update';[a42_0xf0f947(0x129)]='Update\x20existing\x20child\x20segment';async['execute'](_0x1d0e6f){const _0x3822ac=a42_0xf0f947;console[_0x3822ac(0x137)](a42_0x414890[_0x3822ac(0x12f)](_0x3822ac(0x13f))),console['error'](a42_0x414890[_0x3822ac(0x12f)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x4f2bd8,args:_0x5c1437,tdx:_0x4ee64f}=_0x1d0e6f,_0x130fe5=_0x4f2bd8;if(_0x5c1437[_0x3822ac(0x140)]===0x0)return console[_0x3822ac(0x137)](_0x3822ac(0x14e)),console[_0x3822ac(0x137)](_0x3822ac(0x135)),console[_0x3822ac(0x137)](_0x3822ac(0x156)),console[_0x3822ac(0x137)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x3822ac(0x137)](_0x3822ac(0x150)),0x1;const _0x10f493=_0x5c1437[0x0],_0x5b33aa=_0x4f2bd8[_0x3822ac(0x13e)];let _0x61bef7=_0x10f493;_0x5b33aa&&!_0x10f493[_0x3822ac(0x12c)]('/')&&(_0x61bef7=_0x5b33aa+'/'+_0x10f493,_0x130fe5['verbose']&&console['error'](_0x3822ac(0x14d)+_0x61bef7));const _0x183e83=await withSpinner(_0x3822ac(0x143)+_0x61bef7+_0x3822ac(0x139),()=>_0x4ee64f[_0x3822ac(0x14b)][_0x3822ac(0x145)](_0x61bef7),{'verbose':_0x130fe5['verbose']}),_0xa04780=_0x183e83[_0x3822ac(0x148)];_0x130fe5[_0x3822ac(0x152)]&&console[_0x3822ac(0x137)](_0x3822ac(0x130)+_0xa04780[_0x3822ac(0x12b)]);if(_0xa04780['type']!==_0x3822ac(0x14b))return console[_0x3822ac(0x137)](_0x3822ac(0x147)+_0xa04780[_0x3822ac(0x12b)]+_0x3822ac(0x13a)),console[_0x3822ac(0x137)](_0x3822ac(0x14a)),0x1;if(!_0xa04780[_0x3822ac(0x136)])throw new SDKError(ErrorCode[_0x3822ac(0x133)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x48fc41=_0xa04780[_0x3822ac(0x12a)],_0x4d653b=_0xa04780[_0x3822ac(0x136)];_0x130fe5['verbose']&&(console[_0x3822ac(0x137)](_0x3822ac(0x157)+_0x48fc41),console[_0x3822ac(0x137)]('Segment\x20ID:\x20'+_0x4d653b));let _0x3b1e6d;if(_0x130fe5['folder']){const _0x24188f=_0x130fe5[_0x3822ac(0x14f)],_0x38cec4=await withSpinner(_0x3822ac(0x12e)+_0x24188f+'\x27...',()=>_0x4ee64f[_0x3822ac(0x14b)][_0x3822ac(0x13d)](_0x48fc41,_0x24188f),{'verbose':_0x130fe5[_0x3822ac(0x152)]});_0x3b1e6d=parseInt(_0x38cec4[_0x3822ac(0x148)],0xa),_0x130fe5[_0x3822ac(0x152)]&&console[_0x3822ac(0x137)](_0x3822ac(0x149)+_0x3b1e6d);}const _0x1c6e55=await loadJSONFromOptions(_0x130fe5[_0x3822ac(0x155)],_0x130fe5[_0x3822ac(0x141)]),_0x4018e9={'name':_0x130fe5['name'],'description':_0x130fe5[_0x3822ac(0x129)],'rule':_0x1c6e55,'kind':_0x130fe5[_0x3822ac(0x151)]!==undefined?parseInt(_0x130fe5['kind'],0xa):undefined,'segmentFolderId':_0x3b1e6d},_0x211185=await withSpinner(_0x3822ac(0x153)+_0xa04780[_0x3822ac(0x13b)]+'\x27...',()=>_0x4ee64f[_0x3822ac(0x14b)][_0x3822ac(0x134)](_0x48fc41,_0x4d653b,_0x4018e9),{'verbose':_0x130fe5[_0x3822ac(0x152)]}),_0x17d163=_0x211185[_0x3822ac(0x148)];return console[_0x3822ac(0x137)]('✔\x20Updated\x20segment\x20\x27'+_0x17d163[_0x3822ac(0x146)]+'\x27'),_0x61bef7!==_0x10f493&&console[_0x3822ac(0x137)]('\x20\x20\x20Path:\x20'+_0x61bef7),await handleSDKOutput([_0x17d163],_0x130fe5),0x0;}}
1
+ const a42_0x281785=a42_0x6bf5;(function(_0x368ad8,_0x27d963){const _0x3ef149=a42_0x6bf5,_0x5da53d=_0x368ad8();while(!![]){try{const _0xcf2a1=-parseInt(_0x3ef149(0xf1))/0x1*(parseInt(_0x3ef149(0xf5))/0x2)+-parseInt(_0x3ef149(0xed))/0x3+-parseInt(_0x3ef149(0x111))/0x4+parseInt(_0x3ef149(0x119))/0x5*(-parseInt(_0x3ef149(0xef))/0x6)+-parseInt(_0x3ef149(0x107))/0x7*(parseInt(_0x3ef149(0x102))/0x8)+parseInt(_0x3ef149(0x101))/0x9*(parseInt(_0x3ef149(0x10d))/0xa)+parseInt(_0x3ef149(0x104))/0xb;if(_0xcf2a1===_0x27d963)break;else _0x5da53d['push'](_0x5da53d['shift']());}catch(_0x5717e2){_0x5da53d['push'](_0x5da53d['shift']());}}}(a42_0x53c6,0xe4bc8));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_0x53c6(){const _0x163b3b=['rule','Resolved\x20type:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Segment\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Segment\x20ID\x20missing\x20from\x20resolved\x20path','ruleFile','8635mBGgLy','Error:\x20Cannot\x20update\x20','data','length','5084094jOJgGy','Resolving\x20folder\x20\x27','2826JgmetX','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1633ozthOz','✔\x20Updated\x20segment\x20\x27','segment','name','962TfjqnH','type','Update\x20existing\x20child\x20segment','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Resolving\x20path\x20\x27','includes','segment:update','Resolved\x20folder\x20ID:\x20','\x20\x20\x20Path:\x20','Resolved\x20relative\x20path\x20to:\x20','yellow','verbose','16101LImPie','666152ktwIah','segmentPath','51970743bSPTFj','\x27...','segmentName','49afMitF','folder','updateSegmentById','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','error','segmentId','5630vEzjxu','kind','execute','description','3673780WAGiLo'];a42_0x53c6=function(){return _0x163b3b;};return a42_0x53c6();}function a42_0x6bf5(_0xa66ed3,_0x16b7c1){_0xa66ed3=_0xa66ed3-0xea;const _0x53c628=a42_0x53c6();let _0x6bf51=_0x53c628[_0xa66ed3];return _0x6bf51;}import a42_0x33fffa from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x281785(0xf4)]=a42_0x281785(0xfb);[a42_0x281785(0x110)]=a42_0x281785(0xf7);async[a42_0x281785(0x10f)](_0x366fca){const _0x2ed761=a42_0x281785;console[_0x2ed761(0x10b)](a42_0x33fffa[_0x2ed761(0xff)](_0x2ed761(0xf8))),console[_0x2ed761(0x10b)](a42_0x33fffa[_0x2ed761(0xff)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x1e2b09,args:_0x416e22,tdx:_0x5f3056}=_0x366fca,_0x2795bf=_0x1e2b09;if(_0x416e22[_0x2ed761(0xec)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x2ed761(0x10b)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console['error']('Examples:'),console['error'](_0x2ed761(0x114)),console[_0x2ed761(0x10b)](_0x2ed761(0xf0)),0x1;const _0x359c95=_0x416e22[0x0],_0x259374=_0x1e2b09[_0x2ed761(0x103)];let _0x20dbd=_0x359c95;_0x259374&&!_0x359c95[_0x2ed761(0xfa)]('/')&&(_0x20dbd=_0x259374+'/'+_0x359c95,_0x2795bf[_0x2ed761(0x100)]&&console[_0x2ed761(0x10b)](_0x2ed761(0xfe)+_0x20dbd));const _0x1a4a26=await withSpinner(_0x2ed761(0xf9)+_0x20dbd+_0x2ed761(0x105),()=>_0x5f3056[_0x2ed761(0xf3)]['resolvePathToResource'](_0x20dbd),{'verbose':_0x2795bf[_0x2ed761(0x100)]}),_0x321a97=_0x1a4a26[_0x2ed761(0xeb)];_0x2795bf[_0x2ed761(0x100)]&&console[_0x2ed761(0x10b)](_0x2ed761(0x113)+_0x321a97[_0x2ed761(0xf6)]);if(_0x321a97[_0x2ed761(0xf6)]!=='segment')return console[_0x2ed761(0x10b)](_0x2ed761(0xea)+_0x321a97[_0x2ed761(0xf6)]+_0x2ed761(0x10a)),console[_0x2ed761(0x10b)](_0x2ed761(0x116)),0x1;if(!_0x321a97[_0x2ed761(0x10c)])throw new SDKError(ErrorCode['INTERNAL'],_0x2ed761(0x117));const _0x541ece=_0x321a97['parentId'],_0x470705=_0x321a97['segmentId'];_0x2795bf[_0x2ed761(0x100)]&&(console[_0x2ed761(0x10b)]('Parent\x20ID:\x20'+_0x541ece),console[_0x2ed761(0x10b)](_0x2ed761(0x115)+_0x470705));let _0x53db94;if(_0x2795bf['folder']){const _0xb21860=_0x2795bf[_0x2ed761(0x108)],_0x39e2f4=await withSpinner(_0x2ed761(0xee)+_0xb21860+_0x2ed761(0x105),()=>_0x5f3056[_0x2ed761(0xf3)]['resolveFolderId'](_0x541ece,_0xb21860),{'verbose':_0x2795bf['verbose']});_0x53db94=parseInt(_0x39e2f4[_0x2ed761(0xeb)],0xa),_0x2795bf[_0x2ed761(0x100)]&&console[_0x2ed761(0x10b)](_0x2ed761(0xfc)+_0x53db94);}const _0x1cb8aa=await loadJSONFromOptions(_0x2795bf[_0x2ed761(0x112)],_0x2795bf[_0x2ed761(0x118)]),_0x301f3b={'name':_0x2795bf[_0x2ed761(0xf4)],'description':_0x2795bf[_0x2ed761(0x110)],'rule':_0x1cb8aa,'kind':_0x2795bf[_0x2ed761(0x10e)]!==undefined?parseInt(_0x2795bf[_0x2ed761(0x10e)],0xa):undefined,'segmentFolderId':_0x53db94},_0x4a397d=await withSpinner('Updating\x20segment\x20\x27'+_0x321a97[_0x2ed761(0x106)]+'\x27...',()=>_0x5f3056['segment'][_0x2ed761(0x109)](_0x541ece,_0x470705,_0x301f3b),{'verbose':_0x2795bf[_0x2ed761(0x100)]}),_0x1a9cb2=_0x4a397d['data'];return console[_0x2ed761(0x10b)](_0x2ed761(0xf2)+_0x1a9cb2['name']+'\x27'),_0x20dbd!==_0x359c95&&console[_0x2ed761(0x10b)](_0x2ed761(0xfd)+_0x20dbd),await handleSDKOutput([_0x1a9cb2],_0x2795bf),0x0;}}
@@ -1 +1 @@
1
- const a43_0x99ae47=a43_0xaabc;(function(_0x2724f0,_0x2e7ad6){const _0x245f76=a43_0xaabc,_0x5d125e=_0x2724f0();while(!![]){try{const _0x3fcbfd=parseInt(_0x245f76(0x114))/0x1+parseInt(_0x245f76(0x111))/0x2+-parseInt(_0x245f76(0x110))/0x3*(-parseInt(_0x245f76(0xfd))/0x4)+-parseInt(_0x245f76(0x102))/0x5+-parseInt(_0x245f76(0xfc))/0x6+-parseInt(_0x245f76(0xf6))/0x7*(-parseInt(_0x245f76(0xf5))/0x8)+parseInt(_0x245f76(0xf3))/0x9*(-parseInt(_0x245f76(0xf8))/0xa);if(_0x3fcbfd===_0x2e7ad6)break;else _0x5d125e['push'](_0x5d125e['shift']());}catch(_0x4734ba){_0x5d125e['push'](_0x5d125e['shift']());}}}(a43_0x19b0,0x47fb0));import{existsSync,statSync}from'fs';import a43_0x3bb1f2 from'chalk';function a43_0x19b0(){const _0x317266=['parentName','✔\x20Context\x20set\x20to:\x20','dim','join','log','name','873LnCDcf','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','16hfNXXP','1522570iEIAhp','type','94090guRTUU','segmentPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','error','1004004mTyKYb','52908PbvIkP','resolvePathToResource','split','cyan','Usage:\x20tdx\x20segment\x20use\x20<path>','265175UMcPff','red','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Target\x20path:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','slice','Error:\x20Path\x20is\x20required\x0a','verbose','parent_segment','Examples:','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','segment','3HJUaEP','1009550eipwLo','Resolved\x20path\x20type:\x20','config','474852DpAmSn','segments','folderId','data','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','fullPath','Resolving\x20path\x20\x27','\x27...','Resolved\x20relative\x20path\x20to:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','length','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','parentId','session'];a43_0x19b0=function(){return _0x317266;};return a43_0x19b0();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0xaabc(_0xd02d9b,_0x1c1196){_0xd02d9b=_0xd02d9b-0xf1;const _0x19b05c=a43_0x19b0();let _0xaabc15=_0x19b05c[_0xd02d9b];return _0xaabc15;}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_0x99ae47(0xf2)]='segment:use';['description']=a43_0x99ae47(0xfa);async['execute'](_0x403a82){const _0x49287b=a43_0x99ae47,{options:_0x3d83bf,args:_0x42ca5c,tdx:_0x3b7b53}=_0x403a82;if(_0x42ca5c['length']===0x0)return console[_0x49287b(0xfb)](a43_0x3bb1f2['red'](_0x49287b(0x109))),console[_0x49287b(0xfb)](_0x49287b(0x101)),console[_0x49287b(0xfb)](_0x49287b(0x10c)),console['error'](_0x49287b(0x10e)),console[_0x49287b(0xfb)](_0x49287b(0x119)),console[_0x49287b(0xfb)](_0x49287b(0x104)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x127f1c=_0x42ca5c[0x0],_0x9dc680=_0x3d83bf[_0x49287b(0x123)];try{if(_0x127f1c==='/')return saveSessionContext({'segment_path':undefined},_0x9dc680),console['log'](a43_0x3bb1f2['green'](_0x49287b(0x105))),0x0;if(existsSync(_0x127f1c)&&statSync(_0x127f1c)['isDirectory']()){let _0x594678;try{_0x594678=findTdxConfig(_0x127f1c);}catch{return console[_0x49287b(0xfb)](a43_0x3bb1f2['red'](_0x49287b(0x120)+_0x127f1c)),console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x100)](_0x49287b(0x11e))),0x1;}const _0x78ad8c=_0x594678[_0x49287b(0x113)][_0x49287b(0x10b)];return saveSessionContext({'segment_path':_0x78ad8c,'parent_segment':_0x78ad8c},_0x9dc680),console['log'](a43_0x3bb1f2[_0x49287b(0x10d)](_0x49287b(0x125)+a43_0x3bb1f2['cyan'](_0x78ad8c))),0x0;}const _0x4a1337=_0x3d83bf[_0x49287b(0xf9)];let _0x4bd35c=_0x127f1c;const _0x31cb9c=parsePath(_0x127f1c);if(!_0x31cb9c['isAbsolute']){if(!_0x4a1337)return console[_0x49287b(0xfb)](a43_0x3bb1f2['red'](_0x49287b(0x107))),console[_0x49287b(0xfb)](a43_0x3bb1f2['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x127f1c==='..'){const _0x1222a4=_0x4a1337[_0x49287b(0xff)]('/')[_0x49287b(0x108)](0x0,-0x1)['join']('/');_0x4bd35c=_0x1222a4||'/';}else _0x127f1c==='.'?_0x4bd35c=_0x4a1337:_0x4bd35c=_0x4a1337+'/'+_0x127f1c;_0x3d83bf[_0x49287b(0x10a)]&&console[_0x49287b(0xfb)](_0x49287b(0x11d)+_0x4bd35c);}if(_0x4bd35c==='/'||_0x4bd35c==='')return saveSessionContext({'segment_path':undefined},_0x9dc680),console[_0x49287b(0xf1)](a43_0x3bb1f2[_0x49287b(0x10d)](_0x49287b(0x105))),0x0;_0x4bd35c=normalizePath(_0x4bd35c);const _0x3b1ae5=parsePath(_0x4bd35c)[_0x49287b(0x115)];if(_0x3b1ae5[_0x49287b(0x11f)]===0x0)return saveSessionContext({'segment_path':undefined},_0x9dc680),console['log'](a43_0x3bb1f2[_0x49287b(0x10d)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3d83bf['verbose']&&(console['error']('Site:\x20'+_0x3d83bf['site']),console[_0x49287b(0xfb)](_0x49287b(0x106)+_0x4bd35c));const _0x3a500d=await withSpinner(_0x49287b(0x11b)+_0x4bd35c+_0x49287b(0x11c),()=>_0x3b7b53[_0x49287b(0x10f)][_0x49287b(0xfe)](_0x4bd35c),{'verbose':_0x3d83bf[_0x49287b(0x10a)]}),_0x2b8673=_0x3a500d[_0x49287b(0x117)];_0x3d83bf[_0x49287b(0x10a)]&&(console['error'](_0x49287b(0x112)+_0x2b8673[_0x49287b(0xf7)]),console['error']('Parent\x20ID:\x20'+_0x2b8673[_0x49287b(0x122)]),_0x2b8673['folderId']&&console[_0x49287b(0xfb)]('Folder\x20ID:\x20'+_0x2b8673[_0x49287b(0x116)]));if(_0x2b8673['type']==='segment')return console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x103)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x49287b(0xfb)](_0x49287b(0x118)),console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x100)]('Use:\x20tdx\x20segment\x20use\x20'+_0x2b8673[_0x49287b(0x124)]+(_0x2b8673['folderPath']?'/'+_0x2b8673['folderPath'][_0x49287b(0x127)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2b8673['fullPath'],'parent_segment':_0x2b8673[_0x49287b(0x124)]},_0x9dc680),console[_0x49287b(0xf1)](a43_0x3bb1f2[_0x49287b(0x10d)](_0x49287b(0x125)+a43_0x3bb1f2[_0x49287b(0x100)](_0x2b8673[_0x49287b(0x11a)]))),_0x3d83bf[_0x49287b(0x10a)]&&(console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x126)](_0x49287b(0xf4))),console['error'](a43_0x3bb1f2['dim'](_0x49287b(0x121)))),0x0;}catch(_0x508c7e){throw _0x508c7e;}}}
1
+ const a43_0x39058b=a43_0x7153;(function(_0xfd2172,_0x36bd2b){const _0x3b7540=a43_0x7153,_0x5eeba9=_0xfd2172();while(!![]){try{const _0x49e8b5=parseInt(_0x3b7540(0x16a))/0x1*(parseInt(_0x3b7540(0x173))/0x2)+-parseInt(_0x3b7540(0x157))/0x3*(-parseInt(_0x3b7540(0x17d))/0x4)+-parseInt(_0x3b7540(0x14d))/0x5*(-parseInt(_0x3b7540(0x150))/0x6)+parseInt(_0x3b7540(0x16c))/0x7*(-parseInt(_0x3b7540(0x148))/0x8)+-parseInt(_0x3b7540(0x152))/0x9*(-parseInt(_0x3b7540(0x16e))/0xa)+-parseInt(_0x3b7540(0x14b))/0xb+-parseInt(_0x3b7540(0x154))/0xc;if(_0x49e8b5===_0x36bd2b)break;else _0x5eeba9['push'](_0x5eeba9['shift']());}catch(_0x59c72a){_0x5eeba9['push'](_0x5eeba9['shift']());}}}(a43_0xd069,0xb17d7));function a43_0xd069(){const _0x574e71=['Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','join','parentId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x27...','Error:\x20Path\x20is\x20required\x0a','16tIsXXJ','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','✔\x20Context\x20set\x20to:\x20','1301267RXxMvb','Target\x20path:\x20','1733275SxlEUW','resolvePathToResource','dim','18IWZxOP','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','2196vidHta','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','9450468UmWCys','segment','parent_segment','9fwBOmh','log','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','session','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','type','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Resolving\x20path\x20\x27','Site:\x20','isAbsolute','segmentPath','config','Parent\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','folderPath','execute','name','Use:\x20tdx\x20segment\x20use\x20','data','88982iCFutD','cyan','2267895jlrQZN','error','13830yhdrmB','isDirectory','Examples:','fullPath','green','16YuVzFV','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','red','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','verbose','parentName','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Resolved\x20path\x20type:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','length','255376MtUOKd','Set\x20current\x20segment/folder\x20context\x20for\x20navigation'];a43_0xd069=function(){return _0x574e71;};return a43_0xd069();}import{existsSync,statSync}from'fs';import a43_0x5ccd88 from'chalk';function a43_0x7153(_0x1a5c36,_0x1b77d9){_0x1a5c36=_0x1a5c36-0x143;const _0xd06923=a43_0xd069();let _0x7153e7=_0xd06923[_0x1a5c36];return _0x7153e7;}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_0x39058b(0x167)]='segment:use';['description']=a43_0x39058b(0x17e);async[a43_0x39058b(0x166)](_0x3e7b4e){const _0x5e47d5=a43_0x39058b,{options:_0x353654,args:_0x485ae4,tdx:_0x3f0fdf}=_0x3e7b4e;if(_0x485ae4[_0x5e47d5(0x17c)]===0x0)return console['error'](a43_0x5ccd88[_0x5e47d5(0x175)](_0x5e47d5(0x147))),console[_0x5e47d5(0x16d)](_0x5e47d5(0x17b)),console[_0x5e47d5(0x16d)](_0x5e47d5(0x170)),console[_0x5e47d5(0x16d)](_0x5e47d5(0x174)),console['error'](_0x5e47d5(0x145)),console[_0x5e47d5(0x16d)](_0x5e47d5(0x149)),console[_0x5e47d5(0x16d)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x4aa774=_0x485ae4[0x0],_0x200ec5=_0x353654[_0x5e47d5(0x15a)];try{if(_0x4aa774==='/')return saveSessionContext({'segment_path':undefined},_0x200ec5),console[_0x5e47d5(0x158)](a43_0x5ccd88[_0x5e47d5(0x172)](_0x5e47d5(0x176))),0x0;if(existsSync(_0x4aa774)&&statSync(_0x4aa774)[_0x5e47d5(0x16f)]()){let _0x33ad44;try{_0x33ad44=findTdxConfig(_0x4aa774);}catch{return console[_0x5e47d5(0x16d)](a43_0x5ccd88[_0x5e47d5(0x175)](_0x5e47d5(0x179)+_0x4aa774)),console[_0x5e47d5(0x16d)](a43_0x5ccd88[_0x5e47d5(0x16b)](_0x5e47d5(0x15b))),0x1;}const _0x3195bf=_0x33ad44[_0x5e47d5(0x162)][_0x5e47d5(0x156)];return saveSessionContext({'segment_path':_0x3195bf,'parent_segment':_0x3195bf},_0x200ec5),console[_0x5e47d5(0x158)](a43_0x5ccd88['green'](_0x5e47d5(0x14a)+a43_0x5ccd88[_0x5e47d5(0x16b)](_0x3195bf))),0x0;}const _0x3da827=_0x353654[_0x5e47d5(0x161)];let _0x4f3964=_0x4aa774;const _0x310567=parsePath(_0x4aa774);if(!_0x310567[_0x5e47d5(0x160)]){if(!_0x3da827)return console[_0x5e47d5(0x16d)](a43_0x5ccd88[_0x5e47d5(0x175)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x5e47d5(0x16d)](a43_0x5ccd88[_0x5e47d5(0x16b)](_0x5e47d5(0x159))),0x1;if(_0x4aa774==='..'){const _0x2d1328=_0x3da827['split']('/')['slice'](0x0,-0x1)['join']('/');_0x4f3964=_0x2d1328||'/';}else _0x4aa774==='.'?_0x4f3964=_0x3da827:_0x4f3964=_0x3da827+'/'+_0x4aa774;_0x353654[_0x5e47d5(0x177)]&&console['error'](_0x5e47d5(0x164)+_0x4f3964);}if(_0x4f3964==='/'||_0x4f3964==='')return saveSessionContext({'segment_path':undefined},_0x200ec5),console[_0x5e47d5(0x158)](a43_0x5ccd88['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x4f3964=normalizePath(_0x4f3964);const _0x4d5992=parsePath(_0x4f3964)['segments'];if(_0x4d5992[_0x5e47d5(0x17c)]===0x0)return saveSessionContext({'segment_path':undefined},_0x200ec5),console[_0x5e47d5(0x158)](a43_0x5ccd88[_0x5e47d5(0x172)](_0x5e47d5(0x176))),0x0;_0x353654[_0x5e47d5(0x177)]&&(console[_0x5e47d5(0x16d)](_0x5e47d5(0x15f)+_0x353654['site']),console[_0x5e47d5(0x16d)](_0x5e47d5(0x14c)+_0x4f3964));const _0x356fb0=await withSpinner(_0x5e47d5(0x15e)+_0x4f3964+_0x5e47d5(0x146),()=>_0x3f0fdf[_0x5e47d5(0x155)][_0x5e47d5(0x14e)](_0x4f3964),{'verbose':_0x353654[_0x5e47d5(0x177)]}),_0x279b5c=_0x356fb0[_0x5e47d5(0x169)];_0x353654[_0x5e47d5(0x177)]&&(console['error'](_0x5e47d5(0x17a)+_0x279b5c[_0x5e47d5(0x15c)]),console[_0x5e47d5(0x16d)](_0x5e47d5(0x163)+_0x279b5c[_0x5e47d5(0x144)]),_0x279b5c['folderId']&&console[_0x5e47d5(0x16d)]('Folder\x20ID:\x20'+_0x279b5c['folderId']));if(_0x279b5c[_0x5e47d5(0x15c)]===_0x5e47d5(0x155))return console[_0x5e47d5(0x16d)](a43_0x5ccd88[_0x5e47d5(0x175)](_0x5e47d5(0x15d))),console[_0x5e47d5(0x16d)](_0x5e47d5(0x151)),console[_0x5e47d5(0x16d)](a43_0x5ccd88[_0x5e47d5(0x16b)](_0x5e47d5(0x168)+_0x279b5c[_0x5e47d5(0x178)]+(_0x279b5c[_0x5e47d5(0x165)]?'/'+_0x279b5c['folderPath'][_0x5e47d5(0x143)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x279b5c[_0x5e47d5(0x171)],'parent_segment':_0x279b5c[_0x5e47d5(0x178)]},_0x200ec5),console['log'](a43_0x5ccd88[_0x5e47d5(0x172)](_0x5e47d5(0x14a)+a43_0x5ccd88[_0x5e47d5(0x16b)](_0x279b5c[_0x5e47d5(0x171)]))),_0x353654[_0x5e47d5(0x177)]&&(console[_0x5e47d5(0x16d)](a43_0x5ccd88[_0x5e47d5(0x14f)](_0x5e47d5(0x17f))),console['error'](a43_0x5ccd88[_0x5e47d5(0x14f)](_0x5e47d5(0x153)))),0x0;}catch(_0x3c1a31){throw _0x3c1a31;}}}
@@ -1 +1 @@
1
- const a44_0x2cbb89=a44_0x100a;(function(_0x3af6b6,_0x1188ca){const _0xf9ae0e=a44_0x100a,_0x2f61c1=_0x3af6b6();while(!![]){try{const _0x354cb6=parseInt(_0xf9ae0e(0x11a))/0x1*(-parseInt(_0xf9ae0e(0x129))/0x2)+-parseInt(_0xf9ae0e(0x120))/0x3*(parseInt(_0xf9ae0e(0x121))/0x4)+-parseInt(_0xf9ae0e(0xf3))/0x5*(parseInt(_0xf9ae0e(0xf5))/0x6)+-parseInt(_0xf9ae0e(0x119))/0x7+parseInt(_0xf9ae0e(0x10c))/0x8*(parseInt(_0xf9ae0e(0xf7))/0x9)+-parseInt(_0xf9ae0e(0x110))/0xa*(parseInt(_0xf9ae0e(0x114))/0xb)+parseInt(_0xf9ae0e(0x118))/0xc;if(_0x354cb6===_0x1188ca)break;else _0x2f61c1['push'](_0x2f61c1['shift']());}catch(_0x10093c){_0x2f61c1['push'](_0x2f61c1['shift']());}}}(a44_0x5d37,0xb680b));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';function a44_0x100a(_0x404070,_0x16505e){_0x404070=_0x404070-0xf3;const _0x5d378d=a44_0x5d37();let _0x100a2f=_0x5d378d[_0x404070];return _0x100a2f;}function a44_0x5d37(){const _0x26d412=['red','validCount','\x20file(s)\x20with\x20errors,\x20','):\x20','dim','error','\x20warning(s)','9276112CSesUa','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','valid','file','10AYMkfV','\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','Validate\x20segment\x20and\x20journey\x20YAML\x20files','Validation\x20failed:\x20','7061164XOyGeC','name','warningCount','execute','60846444fNiZcL','8791314cNeHfh','869YkMRmV','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filePath','.yaml','hasErrors','\x20file(s)\x20valid','3280368Ejrgku','4WCuFmM','log','\x20warning(s)\x20found','errorCode','✔\x20All\x20','length','Error:\x20Directory\x20not\x20found:\x20','description','2726fdPfWU','message','284085SRsrmq','yellow','138mZtxNx','green','9lXxVyo','warnings','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','errors','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','no_parent','type','cyan','parentSegment','\x20valid','helpText','segment:validate','.yml','endsWith'];a44_0x5d37=function(){return _0x26d412;};return a44_0x5d37();}import a44_0x5aa63f from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x2cbb89(0x115)]=a44_0x2cbb89(0x102);[a44_0x2cbb89(0x128)]=a44_0x2cbb89(0x112);async[a44_0x2cbb89(0x117)](_0x583b58){const _0x59a91c=a44_0x2cbb89,{options:_0x529f3a,args:_0x5831a3}=_0x583b58,_0x31a3e6=_0x529f3a,_0x3e49ad=await resolveTarget({'arg':_0x5831a3[0x0],'contextParent':_0x529f3a[_0x59a91c(0xff)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3e49ad))return _0x3e49ad[_0x59a91c(0x124)]===_0x59a91c(0xfc)?(console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0xf4)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x59a91c(0x10a)](_0x59a91c(0xfb)),console[_0x59a91c(0x10a)](_0x59a91c(0x111)),console[_0x59a91c(0x10a)](_0x59a91c(0x11b))):(console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0x105)]('Error:\x20'+_0x3e49ad[_0x59a91c(0x12a)]+'\x0a')),_0x3e49ad[_0x59a91c(0x101)]&&console['error'](a44_0x5aa63f[_0x59a91c(0xfe)](_0x3e49ad[_0x59a91c(0x101)]))),0x1;const _0x491e77=_0x3e49ad['targetDir'],_0x42e532=_0x3e49ad[_0x59a91c(0xfd)]===_0x59a91c(0x10f)?_0x3e49ad[_0x59a91c(0x11c)]:undefined;if(!_0x42e532&&!existsSync(_0x491e77))return console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0x105)](_0x59a91c(0x127)+_0x491e77+'\x0a')),0x1;let _0x3b5257;if(_0x42e532){if(!_0x42e532[_0x59a91c(0x104)](_0x59a91c(0x103))&&!_0x42e532[_0x59a91c(0x104)](_0x59a91c(0x11d)))return console[_0x59a91c(0x10a)](a44_0x5aa63f['red'](_0x59a91c(0x10d)+_0x42e532+'\x0a')),0x1;_0x3b5257=[_0x42e532];}else _0x3b5257=findYamlFiles(_0x491e77);if(_0x3b5257[_0x59a91c(0x126)]===0x0)return console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0x105)](_0x59a91c(0xf9)+_0x491e77+'\x0a')),0x1;const _0x52dc0e=validateYamlFiles(_0x3b5257,_0x491e77),_0x5d938e=calculateSummary(_0x52dc0e);for(const _0x11acfc of _0x52dc0e){if(!isValidationResult(_0x11acfc))continue;const {relativePath:_0x417f24,source:_0x882b16,result:_0x141b28,fileType:_0x4b7068}=_0x11acfc,_0x57270c=_0x4b7068;if(_0x141b28[_0x59a91c(0x10e)]&&_0x141b28[_0x59a91c(0xf8)][_0x59a91c(0x126)]===0x0)_0x31a3e6['verbose']&&console['log'](a44_0x5aa63f[_0x59a91c(0xf6)]('✔\x20'+_0x417f24)+a44_0x5aa63f[_0x59a91c(0x109)]('\x20('+_0x57270c+')'));else _0x141b28[_0x59a91c(0x10e)]?(console['log'](a44_0x5aa63f[_0x59a91c(0xf4)]('⚠\x20'+_0x417f24)+a44_0x5aa63f[_0x59a91c(0x109)]('\x20('+_0x57270c+_0x59a91c(0x108)+_0x141b28[_0x59a91c(0xf8)]['length']+_0x59a91c(0x10b))),console['log'](formatValidationResult(_0x141b28,_0x882b16,_0x417f24))):(console['log'](a44_0x5aa63f[_0x59a91c(0x105)]('✖\x20'+_0x417f24)+a44_0x5aa63f['dim']('\x20('+_0x57270c+_0x59a91c(0x108)+_0x141b28[_0x59a91c(0xfa)][_0x59a91c(0x126)]+'\x20error(s)')),console[_0x59a91c(0x122)](formatValidationResult(_0x141b28,_0x882b16,_0x417f24)));}return console[_0x59a91c(0x122)](''),_0x5d938e[_0x59a91c(0x11e)]?(console[_0x59a91c(0x122)](a44_0x5aa63f['red'](_0x59a91c(0x113)+_0x5d938e['invalidCount']+_0x59a91c(0x107)+_0x5d938e['validCount']+_0x59a91c(0x100))),_0x5d938e[_0x59a91c(0x116)]>0x0&&console[_0x59a91c(0x122)](a44_0x5aa63f['yellow'](_0x5d938e['warningCount']+_0x59a91c(0x123))),0x1):(console['log'](a44_0x5aa63f[_0x59a91c(0xf6)](_0x59a91c(0x125)+_0x5d938e[_0x59a91c(0x106)]+_0x59a91c(0x11f))),_0x5d938e[_0x59a91c(0x116)]>0x0&&console[_0x59a91c(0x122)](a44_0x5aa63f[_0x59a91c(0xf4)](_0x5d938e['warningCount']+_0x59a91c(0x123))),0x0);}}
1
+ const a44_0x33d2ed=a44_0x4f95;(function(_0x31f82f,_0x54c469){const _0x1457ab=a44_0x4f95,_0x55c411=_0x31f82f();while(!![]){try{const _0x58bb92=-parseInt(_0x1457ab(0x1c8))/0x1+parseInt(_0x1457ab(0x1db))/0x2*(parseInt(_0x1457ab(0x1c0))/0x3)+-parseInt(_0x1457ab(0x1b3))/0x4*(parseInt(_0x1457ab(0x1b5))/0x5)+-parseInt(_0x1457ab(0x1ad))/0x6*(parseInt(_0x1457ab(0x1b0))/0x7)+parseInt(_0x1457ab(0x1ac))/0x8+parseInt(_0x1457ab(0x1c9))/0x9+parseInt(_0x1457ab(0x1d2))/0xa*(parseInt(_0x1457ab(0x1cc))/0xb);if(_0x58bb92===_0x54c469)break;else _0x55c411['push'](_0x55c411['shift']());}catch(_0x58674f){_0x55c411['push'](_0x55c411['shift']());}}}(a44_0x131d,0xa22e4));import{BaseCommand}from'./command.js';function a44_0x131d(){const _0x541b5e=['24269wrucPP','segment:validate','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','1237968tlpdqL','warnings','5veBbup','name','):\x20','log','Validation\x20failed:\x20','validCount','description','verbose','yellow','dim','\x20warning(s)\x20found','6ejkajC','invalidCount','endsWith','helpText','Validate\x20segment\x20and\x20journey\x20YAML\x20files','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20file(s)\x20with\x20errors,\x20','targetDir','980362dbIdNu','2655819HwqkQL','errorCode','filePath','11bczwLz','parentSegment','file','type','message','no_parent','8710090FUGWJF','error','warningCount','red','\x20warning(s)','green','valid','length','Error:\x20Directory\x20not\x20found:\x20','943260YdbIES','✔\x20All\x20','\x20valid','.yaml','145088haHmkv','300wybDMr','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'];a44_0x131d=function(){return _0x541b5e;};return a44_0x131d();}function a44_0x4f95(_0x592277,_0x4439d8){_0x592277=_0x592277-0x1aa;const _0x131d1a=a44_0x131d();let _0x4f95f9=_0x131d1a[_0x592277];return _0x4f95f9;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0xf32135 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x33d2ed(0x1b6)]=a44_0x33d2ed(0x1b1);[a44_0x33d2ed(0x1bb)]=a44_0x33d2ed(0x1c4);async['execute'](_0x1eb1ca){const _0x7598a6=a44_0x33d2ed,{options:_0x349cd8,args:_0x13f3d2}=_0x1eb1ca,_0x16e3e4=_0x349cd8,_0x173dc6=await resolveTarget({'arg':_0x13f3d2[0x0],'contextParent':_0x349cd8[_0x7598a6(0x1cd)],'cwd':process[_0x7598a6(0x1ae)]()});if(!isSuccessfulResolution(_0x173dc6))return _0x173dc6[_0x7598a6(0x1ca)]===_0x7598a6(0x1d1)?(console[_0x7598a6(0x1d3)](a44_0xf32135[_0x7598a6(0x1bd)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x7598a6(0x1d3)](_0x7598a6(0x1c5)),console[_0x7598a6(0x1d3)](_0x7598a6(0x1af)),console[_0x7598a6(0x1d3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x7598a6(0x1d3)](a44_0xf32135['red']('Error:\x20'+_0x173dc6[_0x7598a6(0x1d0)]+'\x0a')),_0x173dc6[_0x7598a6(0x1c3)]&&console[_0x7598a6(0x1d3)](a44_0xf32135['cyan'](_0x173dc6[_0x7598a6(0x1c3)]))),0x1;const _0x5bee65=_0x173dc6[_0x7598a6(0x1c7)],_0x3982cb=_0x173dc6[_0x7598a6(0x1cf)]===_0x7598a6(0x1ce)?_0x173dc6[_0x7598a6(0x1cb)]:undefined;if(!_0x3982cb&&!existsSync(_0x5bee65))return console[_0x7598a6(0x1d3)](a44_0xf32135['red'](_0x7598a6(0x1da)+_0x5bee65+'\x0a')),0x1;let _0x421d7c;if(_0x3982cb){if(!_0x3982cb[_0x7598a6(0x1c2)]('.yml')&&!_0x3982cb[_0x7598a6(0x1c2)](_0x7598a6(0x1ab)))return console[_0x7598a6(0x1d3)](a44_0xf32135['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x3982cb+'\x0a')),0x1;_0x421d7c=[_0x3982cb];}else _0x421d7c=findYamlFiles(_0x5bee65);if(_0x421d7c[_0x7598a6(0x1d9)]===0x0)return console['error'](a44_0xf32135[_0x7598a6(0x1d5)](_0x7598a6(0x1b2)+_0x5bee65+'\x0a')),0x1;const _0x1ae0cc=validateYamlFiles(_0x421d7c,_0x5bee65),_0x164330=calculateSummary(_0x1ae0cc);for(const _0xceb8e8 of _0x1ae0cc){if(!isValidationResult(_0xceb8e8))continue;const {relativePath:_0x27a8f5,source:_0x2341a3,result:_0x8cb8f5,fileType:_0x11d723}=_0xceb8e8,_0x1c56af=_0x11d723;if(_0x8cb8f5[_0x7598a6(0x1d8)]&&_0x8cb8f5[_0x7598a6(0x1b4)][_0x7598a6(0x1d9)]===0x0)_0x16e3e4[_0x7598a6(0x1bc)]&&console['log'](a44_0xf32135[_0x7598a6(0x1d7)]('✔\x20'+_0x27a8f5)+a44_0xf32135[_0x7598a6(0x1be)]('\x20('+_0x1c56af+')'));else _0x8cb8f5[_0x7598a6(0x1d8)]?(console[_0x7598a6(0x1b8)](a44_0xf32135[_0x7598a6(0x1bd)]('⚠\x20'+_0x27a8f5)+a44_0xf32135[_0x7598a6(0x1be)]('\x20('+_0x1c56af+_0x7598a6(0x1b7)+_0x8cb8f5[_0x7598a6(0x1b4)][_0x7598a6(0x1d9)]+_0x7598a6(0x1d6))),console[_0x7598a6(0x1b8)](formatValidationResult(_0x8cb8f5,_0x2341a3,_0x27a8f5))):(console[_0x7598a6(0x1b8)](a44_0xf32135['red']('✖\x20'+_0x27a8f5)+a44_0xf32135[_0x7598a6(0x1be)]('\x20('+_0x1c56af+'):\x20'+_0x8cb8f5['errors'][_0x7598a6(0x1d9)]+'\x20error(s)')),console['log'](formatValidationResult(_0x8cb8f5,_0x2341a3,_0x27a8f5)));}return console[_0x7598a6(0x1b8)](''),_0x164330['hasErrors']?(console[_0x7598a6(0x1b8)](a44_0xf32135['red'](_0x7598a6(0x1b9)+_0x164330[_0x7598a6(0x1c1)]+_0x7598a6(0x1c6)+_0x164330[_0x7598a6(0x1ba)]+_0x7598a6(0x1aa))),_0x164330['warningCount']>0x0&&console[_0x7598a6(0x1b8)](a44_0xf32135[_0x7598a6(0x1bd)](_0x164330[_0x7598a6(0x1d4)]+_0x7598a6(0x1bf))),0x1):(console[_0x7598a6(0x1b8)](a44_0xf32135[_0x7598a6(0x1d7)](_0x7598a6(0x1dc)+_0x164330[_0x7598a6(0x1ba)]+'\x20file(s)\x20valid')),_0x164330['warningCount']>0x0&&console[_0x7598a6(0x1b8)](a44_0xf32135[_0x7598a6(0x1bd)](_0x164330[_0x7598a6(0x1d4)]+_0x7598a6(0x1bf))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x69e3b4=a45_0x4536;(function(_0xd45e49,_0xbd40f0){const _0x3d1788=a45_0x4536,_0x58abe3=_0xd45e49();while(!![]){try{const _0x228767=-parseInt(_0x3d1788(0x177))/0x1*(parseInt(_0x3d1788(0x13f))/0x2)+parseInt(_0x3d1788(0x16b))/0x3*(parseInt(_0x3d1788(0x15c))/0x4)+-parseInt(_0x3d1788(0x140))/0x5*(-parseInt(_0x3d1788(0x13b))/0x6)+-parseInt(_0x3d1788(0x154))/0x7+parseInt(_0x3d1788(0x14c))/0x8*(parseInt(_0x3d1788(0x150))/0x9)+-parseInt(_0x3d1788(0x15a))/0xa+parseInt(_0x3d1788(0x168))/0xb;if(_0x228767===_0xbd40f0)break;else _0x58abe3['push'](_0x58abe3['shift']());}catch(_0x210515){_0x58abe3['push'](_0x58abe3['shift']());}}}(a45_0x17ef,0xe958c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x4536(_0x114f6a,_0x1940b1){_0x114f6a=_0x114f6a-0x131;const _0x17ef57=a45_0x17ef();let _0x4536c8=_0x17ef57[_0x114f6a];return _0x4536c8;}import{withSpinner}from'../utils/spinner.js';function a45_0x17ef(){const _0x4633ba=['format','Parent\x20segment\x20context:\x20','filter','/j/da','recursive','(not\x20set)',',\x20and\x20','38864MDsDGj','(empty)','Folder\x20ID:\x20','type','3528WrbmCM','jsonl','map','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','10985786quPKLP','sort','Recursive\x20mode:\x20enabled','data','name','listRecursive','2763630cPFpIV','Site:\x20','588804pogpKX','\x5c$&','\x20matching\x20\x27','\x20\x20Cause:\x20','listWithPattern','error','folders','segments','resolvePathToResource','Resolving\x20parent\x20segment\x20\x27','length','localeCompare','11815738ePcuVm','parentSegment','verbose','6AzZCCv','\x20journey','/e/','No\x20items\x20match\x20pattern:\x20','\x20segment','segment','Building\x20hierarchy\x20tree...','journeys','Parent\x20ID:\x20','\x27...','journeyBundleName','json','1280289zwnGbC','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x20folder','site','maxDepth','description','folder','replace','Error:\x20','listUnifiedWithJourneys','✔\x20Built\x20tree\x20with\x20','includes','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId','children','/app/ps/','✔\x20Found\x20','dim','Folder/pattern\x20arg:\x20','2426826RigeSw','log','cause','Listing\x20folders,\x20segments,\x20and\x20journeys...','2sjnmbo','10RQtiJR','parentId','journey','listUnified','test'];a45_0x17ef=function(){return _0x4633ba;};return a45_0x17ef();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x1b0a38 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x69e3b4(0x158)]=a45_0x69e3b4(0x163);[a45_0x69e3b4(0x17d)]='List\x20folders\x20and\x20child\x20segments';async['execute'](_0x36083b){const _0x514abc=a45_0x69e3b4,{options:_0x179bfc,args:_0x492206}=_0x36083b,_0x2ec69c=_0x179bfc[_0x514abc(0x149)],_0x25847e=_0x492206[0x0];try{const _0x372741=_0x179bfc[_0x514abc(0x169)];_0x179bfc['verbose']&&(console[_0x514abc(0x161)](_0x514abc(0x15b)+_0x179bfc[_0x514abc(0x17b)]),console['error'](_0x514abc(0x146)+(_0x372741||_0x514abc(0x14a))),_0x25847e&&console[_0x514abc(0x161)](_0x514abc(0x13a)+_0x25847e),_0x2ec69c&&console[_0x514abc(0x161)](_0x514abc(0x156)));if(!_0x372741)return console['error'](_0x514abc(0x179)),console['error'](''),console[_0x514abc(0x161)](_0x514abc(0x134)),console['error'](_0x514abc(0x178)),console[_0x514abc(0x161)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x514abc(0x161)](''),console[_0x514abc(0x161)](_0x514abc(0x153)),0x1;const _0x664863=_0x25847e&&(_0x25847e[_0x514abc(0x133)]('*')||_0x25847e['includes']('?'));if(_0x664863)return await this[_0x514abc(0x160)](_0x36083b,_0x372741,_0x25847e);const _0x21ad1a=_0x25847e?_0x372741+'/'+_0x25847e:_0x372741;return _0x2ec69c?await this[_0x514abc(0x159)](_0x36083b,_0x21ad1a):await this[_0x514abc(0x143)](_0x36083b,_0x21ad1a);}catch(_0xb09eda){if(_0xb09eda instanceof SDKError)return console[_0x514abc(0x161)](_0x514abc(0x180)+_0xb09eda['message']),_0xb09eda[_0x514abc(0x13d)]&&console[_0x514abc(0x161)](_0x514abc(0x15f)+_0xb09eda[_0x514abc(0x13d)]),0x1;throw _0xb09eda;}}async[a45_0x69e3b4(0x160)](_0x4f5096,_0xf4d4af,_0x50e15e){const _0x3d7dd8=a45_0x69e3b4,{options:_0x18c11d,tdx:_0x586120}=_0x4f5096,_0x471a03=await withSpinner(_0x3d7dd8(0x165)+_0xf4d4af+_0x3d7dd8(0x174),()=>_0x586120['segment'][_0x3d7dd8(0x164)](_0xf4d4af),{'verbose':_0x18c11d[_0x3d7dd8(0x16a)]}),_0x220025=_0x471a03['data'],_0x3ce4a9=await withSpinner(_0x3d7dd8(0x13e),()=>_0x586120[_0x3d7dd8(0x170)][_0x3d7dd8(0x131)](_0x220025['parentId'],_0x220025[_0x3d7dd8(0x135)]),{'verbose':_0x18c11d[_0x3d7dd8(0x16a)]}),{folders:_0x20bea4,segments:_0x1822a3,journeys:_0x4c396f}=_0x3ce4a9[_0x3d7dd8(0x157)],_0x8bd07d=_0x50e15e['replace'](/[.+^${}()|[\]\\]/g,_0x3d7dd8(0x15d))[_0x3d7dd8(0x17f)](/\*/g,'.*')[_0x3d7dd8(0x17f)](/\?/g,'.'),_0x37e266=new RegExp('^'+_0x8bd07d+'$','i'),_0xfe48c0=_0x20bea4[_0x3d7dd8(0x147)](_0x56eb2c=>_0x37e266[_0x3d7dd8(0x144)](_0x56eb2c[_0x3d7dd8(0x158)])),_0x2b4e13=_0x1822a3[_0x3d7dd8(0x147)](_0xf4d5be=>_0x37e266[_0x3d7dd8(0x144)](_0xf4d5be[_0x3d7dd8(0x158)])),_0x3f909c=_0x4c396f['filter'](_0x306d96=>_0x37e266['test'](_0x306d96[_0x3d7dd8(0x175)])),_0x65d920=_0xfe48c0[_0x3d7dd8(0x166)]+_0x2b4e13[_0x3d7dd8(0x166)]+_0x3f909c[_0x3d7dd8(0x166)];console[_0x3d7dd8(0x161)](_0x3d7dd8(0x138)+_0xfe48c0['length']+'\x20folder'+(_0xfe48c0[_0x3d7dd8(0x166)]!==0x1?'s':'')+',\x20'+_0x2b4e13[_0x3d7dd8(0x166)]+_0x3d7dd8(0x16f)+(_0x2b4e13['length']!==0x1?'s':'')+_0x3d7dd8(0x14b)+_0x3f909c['length']+'\x20journey'+(_0x3f909c[_0x3d7dd8(0x166)]!==0x1?'s':'')+_0x3d7dd8(0x15e)+_0x50e15e+'\x27');const _0x55d599=_0x3b379e=>{const _0x19f723=_0x3d7dd8;return getConsoleNextUrl(_0x18c11d[_0x19f723(0x17b)],_0x19f723(0x137)+_0x220025[_0x19f723(0x141)]+_0x19f723(0x16d)+_0x3b379e);},_0x2495a0=_0x18c11d[_0x3d7dd8(0x145)]===_0x3d7dd8(0x176)||_0x18c11d[_0x3d7dd8(0x145)]===_0x3d7dd8(0x151);if(_0x2495a0){const _0x8dd17e=[..._0xfe48c0['map'](_0x536ade=>({..._0x536ade,'type':_0x3d7dd8(0x17e)})),..._0x2b4e13['map'](_0x4dc4e7=>({..._0x4dc4e7,'type':'segment','url':_0x55d599(_0x4dc4e7['id'])})),..._0x3f909c[_0x3d7dd8(0x152)](_0x5c3560=>({..._0x5c3560,'name':_0x5c3560['journeyBundleName'],'type':_0x3d7dd8(0x142)}))][_0x3d7dd8(0x155)]((_0x5908e5,_0x1cdffe)=>_0x5908e5[_0x3d7dd8(0x158)]['localeCompare'](_0x1cdffe[_0x3d7dd8(0x158)]));await handleSDKOutput(_0x8dd17e,_0x18c11d);}else{if(_0x65d920===0x0)console[_0x3d7dd8(0x13c)](_0x3d7dd8(0x16e)+_0x50e15e);else{console['log'](a45_0x1b0a38[_0x3d7dd8(0x139)]('['+_0xf4d4af+']\x20matching\x20\x27'+_0x50e15e+'\x27'));const _0x1532ea=formatFlatList(_0xfe48c0,_0x2b4e13,{'showMetadata':!![],'getSegmentUrl':_0x55d599},_0x3f909c);console[_0x3d7dd8(0x13c)](_0x1532ea);}}return 0x0;}async[a45_0x69e3b4(0x143)](_0x2b275a,_0x3d06d8){const _0x4df490=a45_0x69e3b4,{options:_0x32c1f4,tdx:_0x27166f}=_0x2b275a,_0x158f2a=await withSpinner('Resolving\x20path\x20\x27'+_0x3d06d8+_0x4df490(0x174),()=>_0x27166f[_0x4df490(0x170)][_0x4df490(0x164)](_0x3d06d8),{'verbose':_0x32c1f4['verbose']}),_0x280744=_0x158f2a[_0x4df490(0x157)];_0x32c1f4[_0x4df490(0x16a)]&&(console[_0x4df490(0x161)]('Parent\x20ID:\x20'+_0x280744[_0x4df490(0x141)]),_0x280744['folderId']&&console[_0x4df490(0x161)]('Folder\x20ID:\x20'+_0x280744[_0x4df490(0x135)]));const _0x481660=await withSpinner(_0x4df490(0x13e),()=>_0x27166f[_0x4df490(0x170)][_0x4df490(0x131)](_0x280744['parentId'],_0x280744['folderId']),{'verbose':_0x32c1f4[_0x4df490(0x16a)]}),{folders:_0x4b0f77,segments:_0x4b8181,journeys:_0x2f91d0}=_0x481660[_0x4df490(0x157)],_0x2b0724=_0x4b0f77[_0x4df490(0x166)]+_0x4b8181[_0x4df490(0x166)]+_0x2f91d0['length'];console[_0x4df490(0x161)]('✔\x20Found\x20'+_0x4b0f77[_0x4df490(0x166)]+_0x4df490(0x17a)+(_0x4b0f77['length']!==0x1?'s':'')+',\x20'+_0x4b8181[_0x4df490(0x166)]+'\x20segment'+(_0x4b8181[_0x4df490(0x166)]!==0x1?'s':'')+',\x20and\x20'+_0x2f91d0[_0x4df490(0x166)]+_0x4df490(0x16c)+(_0x2f91d0[_0x4df490(0x166)]!==0x1?'s':''));const _0xc60b0=_0x5ec23b=>{const _0x24469c=_0x4df490;return getConsoleNextUrl(_0x32c1f4['site'],'/app/ps/'+_0x280744[_0x24469c(0x141)]+_0x24469c(0x16d)+_0x5ec23b);},_0x44d945=_0x155bad=>{const _0xd04951=_0x4df490;return getConsoleNextUrl(_0x32c1f4[_0xd04951(0x17b)],_0xd04951(0x137)+_0x280744[_0xd04951(0x141)]+_0xd04951(0x16d)+_0x155bad+_0xd04951(0x148));},_0x2dacff=_0x32c1f4[_0x4df490(0x145)]===_0x4df490(0x176)||_0x32c1f4['format']===_0x4df490(0x151);if(_0x2dacff){const _0x24e774=[..._0x4b0f77[_0x4df490(0x152)](_0x1f39ba=>({..._0x1f39ba,'type':_0x4df490(0x17e)})),..._0x4b8181[_0x4df490(0x152)](_0x5cd3f1=>({..._0x5cd3f1,'type':_0x4df490(0x170),'url':_0xc60b0(_0x5cd3f1['id'])})),..._0x2f91d0[_0x4df490(0x152)](_0x5d90c9=>({..._0x5d90c9,'name':_0x5d90c9[_0x4df490(0x175)],'type':'journey','url':_0x44d945(_0x5d90c9['id'])}))]['sort']((_0x234ef5,_0x20984c)=>_0x234ef5['name'][_0x4df490(0x167)](_0x20984c[_0x4df490(0x158)]));await handleSDKOutput(_0x24e774,_0x32c1f4);}else{if(_0x2b0724===0x0)console[_0x4df490(0x13c)](a45_0x1b0a38['dim']('['+_0x3d06d8+']')),console[_0x4df490(0x13c)](_0x4df490(0x14d));else{console[_0x4df490(0x13c)](a45_0x1b0a38[_0x4df490(0x139)]('['+_0x3d06d8+']'));const _0x5abded=formatFlatList(_0x4b0f77,_0x4b8181,{'showMetadata':!![],'getSegmentUrl':_0xc60b0,'getJourneyUrl':_0x44d945},_0x2f91d0);console[_0x4df490(0x13c)](_0x5abded);}}return 0x0;}async['listRecursive'](_0x57ed52,_0x15f7c9){const _0x31a1f1=a45_0x69e3b4,{options:_0x11ab1d,tdx:_0x2b3055}=_0x57ed52,_0x5a4739=await withSpinner('Resolving\x20path\x20\x27'+_0x15f7c9+_0x31a1f1(0x174),()=>_0x2b3055[_0x31a1f1(0x170)][_0x31a1f1(0x164)](_0x15f7c9),{'verbose':_0x11ab1d['verbose']}),_0x4d13ae=_0x5a4739[_0x31a1f1(0x157)];_0x11ab1d[_0x31a1f1(0x16a)]&&(console[_0x31a1f1(0x161)](_0x31a1f1(0x173)+_0x4d13ae['parentId']),_0x4d13ae[_0x31a1f1(0x135)]&&console[_0x31a1f1(0x161)](_0x31a1f1(0x14e)+_0x4d13ae[_0x31a1f1(0x135)]));const _0xbc545d=_0x11ab1d[_0x31a1f1(0x17c)]||0xa,_0x431b2f=await withSpinner(_0x31a1f1(0x171),()=>_0x2b3055[_0x31a1f1(0x170)][_0x31a1f1(0x159)](_0x4d13ae['parentId'],_0x4d13ae[_0x31a1f1(0x135)],0x0,_0xbc545d),{'verbose':_0x11ab1d['verbose']}),_0x7e21c6=_0x431b2f[_0x31a1f1(0x157)],_0x5aa7fd=_0x5e7172=>{const _0x46921c=_0x31a1f1;let _0x4c2883=0x0,_0x37a145=0x0,_0x33dae7=0x0;for(const _0xafa425 of _0x5e7172){if(_0xafa425[_0x46921c(0x14f)]===_0x46921c(0x17e))_0x4c2883++;else{if(_0xafa425['type']===_0x46921c(0x170))_0x37a145++;else{if(_0xafa425[_0x46921c(0x14f)]===_0x46921c(0x142))_0x33dae7++;}}if(_0xafa425[_0x46921c(0x136)]){const _0x16dff7=_0x5aa7fd(_0xafa425['children']);_0x4c2883+=_0x16dff7[_0x46921c(0x162)],_0x37a145+=_0x16dff7[_0x46921c(0x163)],_0x33dae7+=_0x16dff7[_0x46921c(0x172)];}}return{'folders':_0x4c2883,'segments':_0x37a145,'journeys':_0x33dae7};},_0x499d59=_0x5aa7fd(_0x7e21c6);console[_0x31a1f1(0x161)](_0x31a1f1(0x132)+_0x499d59[_0x31a1f1(0x162)]+'\x20folder'+(_0x499d59[_0x31a1f1(0x162)]!==0x1?'s':'')+',\x20'+_0x499d59['segments']+_0x31a1f1(0x16f)+(_0x499d59[_0x31a1f1(0x163)]!==0x1?'s':'')+_0x31a1f1(0x14b)+_0x499d59[_0x31a1f1(0x172)]+_0x31a1f1(0x16c)+(_0x499d59[_0x31a1f1(0x172)]!==0x1?'s':''));const _0x12c3f0=_0x31dc6a=>{const _0xbd79b8=_0x31a1f1;return getConsoleNextUrl(_0x11ab1d['site'],_0xbd79b8(0x137)+_0x4d13ae[_0xbd79b8(0x141)]+_0xbd79b8(0x16d)+_0x31dc6a);},_0x1d5baa=_0x157eab=>{const _0x5b1161=_0x31a1f1;return getConsoleNextUrl(_0x11ab1d[_0x5b1161(0x17b)],_0x5b1161(0x137)+_0x4d13ae[_0x5b1161(0x141)]+'/e/'+_0x157eab+_0x5b1161(0x148));};if(_0x11ab1d[_0x31a1f1(0x145)]===_0x31a1f1(0x176)||_0x11ab1d[_0x31a1f1(0x145)]==='jsonl')await handleSDKOutput(_0x7e21c6,_0x11ab1d);else{console['log'](a45_0x1b0a38['dim']('['+_0x15f7c9+']'));const _0x191219=formatTree(_0x7e21c6,{'showMetadata':!![],'getSegmentUrl':_0x12c3f0,'getJourneyUrl':_0x1d5baa});console[_0x31a1f1(0x13c)](_0x191219);}return 0x0;}}
1
+ const a45_0x19b9a5=a45_0xc8cc;(function(_0xcd5ef,_0x38a22c){const _0x1856b0=a45_0xc8cc,_0x523f89=_0xcd5ef();while(!![]){try{const _0x1e2cac=parseInt(_0x1856b0(0x15a))/0x1*(parseInt(_0x1856b0(0x18a))/0x2)+parseInt(_0x1856b0(0x150))/0x3*(-parseInt(_0x1856b0(0x172))/0x4)+parseInt(_0x1856b0(0x159))/0x5*(-parseInt(_0x1856b0(0x184))/0x6)+parseInt(_0x1856b0(0x165))/0x7*(-parseInt(_0x1856b0(0x198))/0x8)+-parseInt(_0x1856b0(0x18f))/0x9+parseInt(_0x1856b0(0x196))/0xa*(parseInt(_0x1856b0(0x16b))/0xb)+parseInt(_0x1856b0(0x14f))/0xc*(parseInt(_0x1856b0(0x181))/0xd);if(_0x1e2cac===_0x38a22c)break;else _0x523f89['push'](_0x523f89['shift']());}catch(_0x18745c){_0x523f89['push'](_0x523f89['shift']());}}}(a45_0x2fce,0xf3c16));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0xc8cc(_0x21dd78,_0x74c4e0){_0x21dd78=_0x21dd78-0x149;const _0x2fce25=a45_0x2fce();let _0xc8cc5=_0x2fce25[_0x21dd78];return _0xc8cc5;}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x430221 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x19b9a5(0x166)]=a45_0x19b9a5(0x14c);[a45_0x19b9a5(0x162)]='List\x20folders\x20and\x20child\x20segments';async[a45_0x19b9a5(0x173)](_0x1abb99){const _0x5830bc=a45_0x19b9a5,{options:_0x2ba5f7,args:_0x3b674a}=_0x1abb99,_0x1e9cc5=_0x2ba5f7[_0x5830bc(0x15c)],_0x378d0a=_0x3b674a[0x0];try{const _0x3eb8db=_0x2ba5f7[_0x5830bc(0x14d)];_0x2ba5f7[_0x5830bc(0x176)]&&(console['error'](_0x5830bc(0x15f)+_0x2ba5f7['site']),console[_0x5830bc(0x168)](_0x5830bc(0x161)+(_0x3eb8db||_0x5830bc(0x167))),_0x378d0a&&console[_0x5830bc(0x168)]('Folder/pattern\x20arg:\x20'+_0x378d0a),_0x1e9cc5&&console[_0x5830bc(0x168)](_0x5830bc(0x194)));if(!_0x3eb8db)return console[_0x5830bc(0x168)](_0x5830bc(0x14e)),console[_0x5830bc(0x168)](''),console['error'](_0x5830bc(0x14a)),console[_0x5830bc(0x168)](_0x5830bc(0x17b)),console[_0x5830bc(0x168)](_0x5830bc(0x16a)),console[_0x5830bc(0x168)](''),console[_0x5830bc(0x168)](_0x5830bc(0x16e)),0x1;const _0x37beb5=_0x378d0a&&(_0x378d0a['includes']('*')||_0x378d0a[_0x5830bc(0x197)]('?'));if(_0x37beb5)return await this[_0x5830bc(0x188)](_0x1abb99,_0x3eb8db,_0x378d0a);const _0x5ea35f=_0x378d0a?_0x3eb8db+'/'+_0x378d0a:_0x3eb8db;return _0x1e9cc5?await this['listRecursive'](_0x1abb99,_0x5ea35f):await this['listUnified'](_0x1abb99,_0x5ea35f);}catch(_0x5816aa){if(_0x5816aa instanceof SDKError)return console[_0x5830bc(0x168)]('Error:\x20'+_0x5816aa[_0x5830bc(0x18e)]),_0x5816aa[_0x5830bc(0x190)]&&console['error']('\x20\x20Cause:\x20'+_0x5816aa[_0x5830bc(0x190)]),0x1;throw _0x5816aa;}}async[a45_0x19b9a5(0x188)](_0x248155,_0x3c62bf,_0xc4a418){const _0x1b6295=a45_0x19b9a5,{options:_0x1a167d,tdx:_0x77cc6d}=_0x248155,_0x2c90e5=await withSpinner(_0x1b6295(0x16d)+_0x3c62bf+'\x27...',()=>_0x77cc6d[_0x1b6295(0x18c)]['resolvePathToResource'](_0x3c62bf),{'verbose':_0x1a167d[_0x1b6295(0x176)]}),_0x3b3929=_0x2c90e5[_0x1b6295(0x158)],_0x326aa0=await withSpinner(_0x1b6295(0x16c),()=>_0x77cc6d['segment'][_0x1b6295(0x152)](_0x3b3929['parentId'],_0x3b3929[_0x1b6295(0x199)]),{'verbose':_0x1a167d[_0x1b6295(0x176)]}),{folders:_0x107e06,segments:_0x3c8ed5,journeys:_0x40bea8}=_0x326aa0['data'],_0x4542fa=_0xc4a418[_0x1b6295(0x16f)](/[.+^${}()|[\]\\]/g,_0x1b6295(0x170))[_0x1b6295(0x16f)](/\*/g,'.*')[_0x1b6295(0x16f)](/\?/g,'.'),_0x30c4ca=new RegExp('^'+_0x4542fa+'$','i'),_0x633897=_0x107e06[_0x1b6295(0x157)](_0x53fac7=>_0x30c4ca[_0x1b6295(0x183)](_0x53fac7[_0x1b6295(0x166)])),_0x52ab74=_0x3c8ed5[_0x1b6295(0x157)](_0x4d22fd=>_0x30c4ca[_0x1b6295(0x183)](_0x4d22fd['name'])),_0x30ac52=_0x40bea8['filter'](_0x5082cd=>_0x30c4ca[_0x1b6295(0x183)](_0x5082cd[_0x1b6295(0x164)])),_0x1b193a=_0x633897[_0x1b6295(0x18b)]+_0x52ab74[_0x1b6295(0x18b)]+_0x30ac52['length'];console['error'](_0x1b6295(0x15b)+_0x633897[_0x1b6295(0x18b)]+_0x1b6295(0x187)+(_0x633897['length']!==0x1?'s':'')+',\x20'+_0x52ab74['length']+_0x1b6295(0x17e)+(_0x52ab74[_0x1b6295(0x18b)]!==0x1?'s':'')+_0x1b6295(0x186)+_0x30ac52['length']+_0x1b6295(0x17c)+(_0x30ac52[_0x1b6295(0x18b)]!==0x1?'s':'')+_0x1b6295(0x156)+_0xc4a418+'\x27');const _0x34b002=_0x1be715=>{const _0x220976=_0x1b6295;return getConsoleNextUrl(_0x1a167d[_0x220976(0x189)],_0x220976(0x160)+_0x3b3929[_0x220976(0x153)]+_0x220976(0x17a)+_0x1be715);},_0x37aaf0=_0x1a167d['format']===_0x1b6295(0x14b)||_0x1a167d[_0x1b6295(0x169)]===_0x1b6295(0x175);if(_0x37aaf0){const _0x2da3ea=[..._0x633897[_0x1b6295(0x193)](_0x59508a=>({..._0x59508a,'type':_0x1b6295(0x185)})),..._0x52ab74[_0x1b6295(0x193)](_0x3f1a19=>({..._0x3f1a19,'type':_0x1b6295(0x18c),'url':_0x34b002(_0x3f1a19['id'])})),..._0x30ac52[_0x1b6295(0x193)](_0xab25b7=>({..._0xab25b7,'name':_0xab25b7[_0x1b6295(0x164)],'type':_0x1b6295(0x151)}))][_0x1b6295(0x182)]((_0x542e44,_0x519258)=>_0x542e44['name'][_0x1b6295(0x177)](_0x519258[_0x1b6295(0x166)]));await handleSDKOutput(_0x2da3ea,_0x1a167d);}else{if(_0x1b193a===0x0)console['log']('No\x20items\x20match\x20pattern:\x20'+_0xc4a418);else{console[_0x1b6295(0x17f)](a45_0x430221['dim']('['+_0x3c62bf+_0x1b6295(0x155)+_0xc4a418+'\x27'));const _0x393a25=formatFlatList(_0x633897,_0x52ab74,{'showMetadata':!![],'getSegmentUrl':_0x34b002},_0x30ac52);console[_0x1b6295(0x17f)](_0x393a25);}}return 0x0;}async[a45_0x19b9a5(0x179)](_0x49afbe,_0x416456){const _0x74cf2b=a45_0x19b9a5,{options:_0x36e6c8,tdx:_0x1bf602}=_0x49afbe,_0x1c755f=await withSpinner('Resolving\x20path\x20\x27'+_0x416456+_0x74cf2b(0x15d),()=>_0x1bf602['segment'][_0x74cf2b(0x178)](_0x416456),{'verbose':_0x36e6c8[_0x74cf2b(0x176)]}),_0x19d3dd=_0x1c755f['data'];_0x36e6c8[_0x74cf2b(0x176)]&&(console[_0x74cf2b(0x168)]('Parent\x20ID:\x20'+_0x19d3dd[_0x74cf2b(0x153)]),_0x19d3dd['folderId']&&console[_0x74cf2b(0x168)](_0x74cf2b(0x18d)+_0x19d3dd[_0x74cf2b(0x199)]));const _0xc64d10=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x1bf602[_0x74cf2b(0x18c)]['listUnifiedWithJourneys'](_0x19d3dd[_0x74cf2b(0x153)],_0x19d3dd['folderId']),{'verbose':_0x36e6c8[_0x74cf2b(0x176)]}),{folders:_0x100e68,segments:_0x42d6ff,journeys:_0x3c0f6b}=_0xc64d10[_0x74cf2b(0x158)],_0x30a03e=_0x100e68[_0x74cf2b(0x18b)]+_0x42d6ff[_0x74cf2b(0x18b)]+_0x3c0f6b[_0x74cf2b(0x18b)];console['error'](_0x74cf2b(0x15b)+_0x100e68[_0x74cf2b(0x18b)]+_0x74cf2b(0x187)+(_0x100e68[_0x74cf2b(0x18b)]!==0x1?'s':'')+',\x20'+_0x42d6ff[_0x74cf2b(0x18b)]+'\x20segment'+(_0x42d6ff[_0x74cf2b(0x18b)]!==0x1?'s':'')+_0x74cf2b(0x186)+_0x3c0f6b[_0x74cf2b(0x18b)]+_0x74cf2b(0x17c)+(_0x3c0f6b[_0x74cf2b(0x18b)]!==0x1?'s':''));const _0xad013c=_0x3079b8=>{const _0xc424ce=_0x74cf2b;return getConsoleNextUrl(_0x36e6c8[_0xc424ce(0x189)],'/app/ps/'+_0x19d3dd['parentId']+_0xc424ce(0x17a)+_0x3079b8);},_0x1885be=_0x225f33=>{const _0x312648=_0x74cf2b;return getConsoleNextUrl(_0x36e6c8[_0x312648(0x189)],_0x312648(0x160)+_0x19d3dd[_0x312648(0x153)]+_0x312648(0x17a)+_0x225f33+_0x312648(0x17d));},_0x8f8c9e=_0x36e6c8[_0x74cf2b(0x169)]===_0x74cf2b(0x14b)||_0x36e6c8[_0x74cf2b(0x169)]===_0x74cf2b(0x175);if(_0x8f8c9e){const _0x4375f5=[..._0x100e68[_0x74cf2b(0x193)](_0x4ac3f2=>({..._0x4ac3f2,'type':'folder'})),..._0x42d6ff[_0x74cf2b(0x193)](_0x5a3ce7=>({..._0x5a3ce7,'type':_0x74cf2b(0x18c),'url':_0xad013c(_0x5a3ce7['id'])})),..._0x3c0f6b['map'](_0x47a01f=>({..._0x47a01f,'name':_0x47a01f[_0x74cf2b(0x164)],'type':_0x74cf2b(0x151),'url':_0x1885be(_0x47a01f['id'])}))][_0x74cf2b(0x182)]((_0x535a7a,_0xa5ad89)=>_0x535a7a[_0x74cf2b(0x166)][_0x74cf2b(0x177)](_0xa5ad89[_0x74cf2b(0x166)]));await handleSDKOutput(_0x4375f5,_0x36e6c8);}else{if(_0x30a03e===0x0)console[_0x74cf2b(0x17f)](a45_0x430221[_0x74cf2b(0x154)]('['+_0x416456+']')),console[_0x74cf2b(0x17f)](_0x74cf2b(0x171));else{console[_0x74cf2b(0x17f)](a45_0x430221[_0x74cf2b(0x154)]('['+_0x416456+']'));const _0x1ed99d=formatFlatList(_0x100e68,_0x42d6ff,{'showMetadata':!![],'getSegmentUrl':_0xad013c,'getJourneyUrl':_0x1885be},_0x3c0f6b);console[_0x74cf2b(0x17f)](_0x1ed99d);}}return 0x0;}async[a45_0x19b9a5(0x180)](_0x529e14,_0x4bb2a9){const _0x276fdd=a45_0x19b9a5,{options:_0x2ddc0e,tdx:_0x371aed}=_0x529e14,_0x257c45=await withSpinner(_0x276fdd(0x191)+_0x4bb2a9+_0x276fdd(0x15d),()=>_0x371aed[_0x276fdd(0x18c)][_0x276fdd(0x178)](_0x4bb2a9),{'verbose':_0x2ddc0e[_0x276fdd(0x176)]}),_0x283be9=_0x257c45['data'];_0x2ddc0e['verbose']&&(console[_0x276fdd(0x168)](_0x276fdd(0x174)+_0x283be9[_0x276fdd(0x153)]),_0x283be9[_0x276fdd(0x199)]&&console[_0x276fdd(0x168)](_0x276fdd(0x18d)+_0x283be9[_0x276fdd(0x199)]));const _0x463689=_0x2ddc0e[_0x276fdd(0x163)]||0xa,_0x4f28f8=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x371aed[_0x276fdd(0x18c)][_0x276fdd(0x180)](_0x283be9[_0x276fdd(0x153)],_0x283be9[_0x276fdd(0x199)],0x0,_0x463689),{'verbose':_0x2ddc0e[_0x276fdd(0x176)]}),_0x39acd4=_0x4f28f8[_0x276fdd(0x158)],_0x4e51b0=_0x181f9c=>{const _0x3fbe02=_0x276fdd;let _0x13dc32=0x0,_0x3d0b34=0x0,_0x8da2bd=0x0;for(const _0x13d250 of _0x181f9c){if(_0x13d250[_0x3fbe02(0x149)]===_0x3fbe02(0x185))_0x13dc32++;else{if(_0x13d250[_0x3fbe02(0x149)]===_0x3fbe02(0x18c))_0x3d0b34++;else{if(_0x13d250[_0x3fbe02(0x149)]===_0x3fbe02(0x151))_0x8da2bd++;}}if(_0x13d250[_0x3fbe02(0x195)]){const _0x15649e=_0x4e51b0(_0x13d250[_0x3fbe02(0x195)]);_0x13dc32+=_0x15649e[_0x3fbe02(0x192)],_0x3d0b34+=_0x15649e[_0x3fbe02(0x14c)],_0x8da2bd+=_0x15649e[_0x3fbe02(0x15e)];}}return{'folders':_0x13dc32,'segments':_0x3d0b34,'journeys':_0x8da2bd};},_0x1d63b5=_0x4e51b0(_0x39acd4);console[_0x276fdd(0x168)]('✔\x20Built\x20tree\x20with\x20'+_0x1d63b5[_0x276fdd(0x192)]+_0x276fdd(0x187)+(_0x1d63b5[_0x276fdd(0x192)]!==0x1?'s':'')+',\x20'+_0x1d63b5[_0x276fdd(0x14c)]+_0x276fdd(0x17e)+(_0x1d63b5[_0x276fdd(0x14c)]!==0x1?'s':'')+',\x20and\x20'+_0x1d63b5[_0x276fdd(0x15e)]+_0x276fdd(0x17c)+(_0x1d63b5[_0x276fdd(0x15e)]!==0x1?'s':''));const _0x11e16e=_0x3d9037=>{const _0x161bcd=_0x276fdd;return getConsoleNextUrl(_0x2ddc0e[_0x161bcd(0x189)],_0x161bcd(0x160)+_0x283be9[_0x161bcd(0x153)]+'/e/'+_0x3d9037);},_0x3ea110=_0x35b377=>{const _0x4d9094=_0x276fdd;return getConsoleNextUrl(_0x2ddc0e[_0x4d9094(0x189)],_0x4d9094(0x160)+_0x283be9['parentId']+_0x4d9094(0x17a)+_0x35b377+'/j/da');};if(_0x2ddc0e[_0x276fdd(0x169)]===_0x276fdd(0x14b)||_0x2ddc0e['format']===_0x276fdd(0x175))await handleSDKOutput(_0x39acd4,_0x2ddc0e);else{console[_0x276fdd(0x17f)](a45_0x430221[_0x276fdd(0x154)]('['+_0x4bb2a9+']'));const _0x316043=formatTree(_0x39acd4,{'showMetadata':!![],'getSegmentUrl':_0x11e16e,'getJourneyUrl':_0x3ea110});console['log'](_0x316043);}return 0x0;}}function a45_0x2fce(){const _0x594646=['\x27...','journeys','Site:\x20','/app/ps/','Parent\x20segment\x20context:\x20','description','maxDepth','journeyBundleName','637NtrrWy','name','(not\x20set)','error','format','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','660XQoZEf','Listing\x20folders,\x20segments,\x20and\x20journeys...','Resolving\x20parent\x20segment\x20\x27','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','replace','\x5c$&','(empty)','648920TNYzkV','execute','Parent\x20ID:\x20','jsonl','verbose','localeCompare','resolvePathToResource','listUnified','/e/','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20journey','/j/da','\x20segment','log','listRecursive','56822155wclPpP','sort','test','12izMprG','folder',',\x20and\x20','\x20folder','listWithPattern','site','4FYCnYF','length','segment','Folder\x20ID:\x20','message','13284FFXrLQ','cause','Resolving\x20path\x20\x27','folders','map','Recursive\x20mode:\x20enabled','children','92270TwXCqp','includes','101512pabGdS','folderId','type','Set\x20a\x20parent\x20segment\x20context\x20first:','json','segments','parentSegment','Error:\x20No\x20parent\x20segment\x20context\x20set.','12AVbpCw','33eDNoaD','journey','listUnifiedWithJourneys','parentId','dim',']\x20matching\x20\x27','\x20matching\x20\x27','filter','data','3764235RARbOw','260133ZBkmti','✔\x20Found\x20','recursive'];a45_0x2fce=function(){return _0x594646;};return a45_0x2fce();}
@@ -1 +1 @@
1
- const a46_0x5b101a=a46_0x4e9d;(function(_0x337eb1,_0x22f3f8){const _0xe02b2=a46_0x4e9d,_0x46e1e1=_0x337eb1();while(!![]){try{const _0x8d9804=-parseInt(_0xe02b2(0x128))/0x1*(-parseInt(_0xe02b2(0x11a))/0x2)+-parseInt(_0xe02b2(0x11d))/0x3+-parseInt(_0xe02b2(0x10b))/0x4*(-parseInt(_0xe02b2(0x108))/0x5)+-parseInt(_0xe02b2(0x123))/0x6+-parseInt(_0xe02b2(0x10e))/0x7+-parseInt(_0xe02b2(0x117))/0x8+-parseInt(_0xe02b2(0x10f))/0x9*(-parseInt(_0xe02b2(0x104))/0xa);if(_0x8d9804===_0x22f3f8)break;else _0x46e1e1['push'](_0x46e1e1['shift']());}catch(_0x25a230){_0x46e1e1['push'](_0x46e1e1['shift']());}}}(a46_0x57d2,0x7c9b0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a46_0x4e9d(_0x4d7aa4,_0x422ca0){_0x4d7aa4=_0x4d7aa4-0x101;const _0x57d25b=a46_0x57d2();let _0x4e9d37=_0x57d25b[_0x4d7aa4];return _0x4e9d37;}function a46_0x57d2(){const _0x4bc51c=['\x20row','limit','4868040xIzzKD','validate','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','cause','verbose','9EJRwAc','Database:\x20','query','catalog','344780PXlMNq','database','showTable','Site:\x20','125155zUwCLp','site','Error:\x20','28YdoUKL','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:\x20','4268936dAcxLz','405GOsnMl','length','message','args','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','\x20from\x20','error','1249488oqeRuT','...','execute','226816DOtECa','data','show','1978923wINcrr','Show\x20table\x20contents','table','Querying\x20'];a46_0x57d2=function(){return _0x4bc51c;};return a46_0x57d2();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x5b101a(0x11c);['description']=a46_0x5b101a(0x11e);async[a46_0x5b101a(0x119)](_0x4e2680){const _0x3d58f2=a46_0x5b101a;return this[_0x3d58f2(0x106)](_0x4e2680);}async[a46_0x5b101a(0x106)](_0x59699e){const _0xaa50c6=a46_0x5b101a,{options:_0x36be49,args:_0x353ab4,tdx:_0x35c710}=_0x59699e;let _0xb09064;try{_0xb09064=parseTableReference(_0x353ab4[0x0]);const _0x55c680=_0x36be49[_0xaa50c6(0x105)];!_0xb09064[_0xaa50c6(0x105)]&&_0x55c680&&(_0xb09064[_0xaa50c6(0x105)]=_0x55c680);const _0x3b3e8f=validateTableDescribeReference(_0xb09064);if(_0x3b3e8f)return console[_0xaa50c6(0x116)](_0xaa50c6(0x10a)+_0x3b3e8f),console[_0xaa50c6(0x116)](_0xaa50c6(0x113)),console[_0xaa50c6(0x116)](_0xaa50c6(0x125)),console[_0xaa50c6(0x116)](_0xaa50c6(0x114)),0x1;}catch(_0x68d403){return console['error']('Error:\x20'+_0x68d403[_0xaa50c6(0x111)]),console[_0xaa50c6(0x116)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xaa50c6(0x116)](_0xaa50c6(0x125)),console[_0xaa50c6(0x116)](_0xaa50c6(0x114)),0x1;}const _0x49e3a1=_0xb09064[_0xaa50c6(0x103)],_0x2af513=_0xb09064['database'],_0x131f63=_0xb09064[_0xaa50c6(0x11f)],_0x2dd036=resolveLimit(_0x36be49[_0xaa50c6(0x122)],DEFAULT_DISPLAY_LIMIT);try{_0x36be49[_0xaa50c6(0x127)]&&(console[_0xaa50c6(0x116)](_0xaa50c6(0x107)+_0x36be49[_0xaa50c6(0x109)]),_0x49e3a1&&console[_0xaa50c6(0x116)](_0xaa50c6(0x10d)+_0x49e3a1),console[_0xaa50c6(0x116)](_0xaa50c6(0x101)+_0x2af513),console['error']('Table:\x20'+_0x131f63),console[_0xaa50c6(0x116)]('Limit:\x20'+_0x2dd036));const _0x4cbb26=_0x49e3a1?_0x49e3a1+'.'+_0x2af513+'.'+_0x131f63:_0x2af513+'.'+_0x131f63,_0x3fe3ee=await withSpinner(_0xaa50c6(0x120)+_0x4cbb26+_0xaa50c6(0x118),()=>_0x35c710[_0xaa50c6(0x102)][_0xaa50c6(0x106)](_0x2af513,_0x131f63,_0x2dd036,_0x49e3a1),{'verbose':_0x36be49[_0xaa50c6(0x127)]}),_0x38b9a6=_0x3fe3ee[_0xaa50c6(0x11b)],_0x439b8a=_0x38b9a6[_0xaa50c6(0x11b)];return _0x439b8a[_0xaa50c6(0x110)]===0x0?console[_0xaa50c6(0x116)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0xaa50c6(0x116)]('✔\x20Retrieved\x20'+_0x439b8a['length']+_0xaa50c6(0x121)+(_0x439b8a[_0xaa50c6(0x110)]!==0x1?'s':'')+_0xaa50c6(0x115)+_0x4cbb26),await handleSDKOutput(_0x439b8a,_0x36be49),0x0;}catch(_0x5a4673){if(_0x5a4673 instanceof SDKError)return console[_0xaa50c6(0x116)]('Error:\x20'+_0x5a4673[_0xaa50c6(0x111)]),_0x5a4673[_0xaa50c6(0x126)]&&console[_0xaa50c6(0x116)]('\x20\x20Cause:\x20'+_0x5a4673[_0xaa50c6(0x126)]),0x1;throw _0x5a4673;}}[a46_0x5b101a(0x124)](_0x3d0dbf){const _0x122863=a46_0x5b101a;if(_0x3d0dbf[_0x122863(0x112)][_0x122863(0x110)]===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(_0x3d0dbf[_0x122863(0x112)]['length']>0x1)return _0x122863(0x10c);return undefined;}}
1
+ const a46_0x4683e2=a46_0xab44;(function(_0x219c50,_0xebc656){const _0x3fe347=a46_0xab44,_0x52ae55=_0x219c50();while(!![]){try{const _0x1cbf12=-parseInt(_0x3fe347(0x1b6))/0x1+parseInt(_0x3fe347(0x1c6))/0x2+parseInt(_0x3fe347(0x1b8))/0x3*(-parseInt(_0x3fe347(0x1b1))/0x4)+parseInt(_0x3fe347(0x1b5))/0x5+-parseInt(_0x3fe347(0x1d0))/0x6+parseInt(_0x3fe347(0x1b7))/0x7+parseInt(_0x3fe347(0x1c0))/0x8*(parseInt(_0x3fe347(0x1cd))/0x9);if(_0x1cbf12===_0xebc656)break;else _0x52ae55['push'](_0x52ae55['shift']());}catch(_0xd05d4c){_0x52ae55['push'](_0x52ae55['shift']());}}}(a46_0x456d,0x87e96));import{BaseCommand}from'./command.js';function a46_0x456d(){const _0xa488c9=['validate','query','9hBrWdc','Error:\x20','\x20row','3944514mEAECY','Database:\x20','execute','data','Usage:\x20tdx\x20show\x20<database.table>','70396SffmQD','Site:\x20','verbose','table','3733630zUAzGw','692017lpRyqx','2346113SVJGUG','27oOBqeX','error','args','database','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Limit:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','✔\x20Retrieved\x20','6185392cadRXB','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','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Querying\x20','show','limit','418924tMaCuy','message','showTable','\x20from\x20','length'];a46_0x456d=function(){return _0xa488c9;};return a46_0x456d();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a46_0xab44(_0x2bdb12,_0x3f2917){_0x2bdb12=_0x2bdb12-0x1b1;const _0x456d97=a46_0x456d();let _0xab44df=_0x456d97[_0x2bdb12];return _0xab44df;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x4683e2(0x1c4);['description']='Show\x20table\x20contents';async[a46_0x4683e2(0x1d2)](_0x34375a){const _0x11cd3e=a46_0x4683e2;return this[_0x11cd3e(0x1c8)](_0x34375a);}async[a46_0x4683e2(0x1c8)](_0x4b3909){const _0xc17084=a46_0x4683e2,{options:_0x10006f,args:_0x3be172,tdx:_0x272144}=_0x4b3909;let _0x5de1c5;try{_0x5de1c5=parseTableReference(_0x3be172[0x0]);const _0x5bd12a=_0x10006f[_0xc17084(0x1bb)];!_0x5de1c5['database']&&_0x5bd12a&&(_0x5de1c5[_0xc17084(0x1bb)]=_0x5bd12a);const _0x599e7b=validateTableDescribeReference(_0x5de1c5);if(_0x599e7b)return console['error']('Error:\x20'+_0x599e7b),console['error'](_0xc17084(0x1d4)),console[_0xc17084(0x1b9)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0xc17084(0x1b9)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x3a3017){return console['error'](_0xc17084(0x1ce)+_0x3a3017['message']),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console['error'](_0xc17084(0x1be)),console[_0xc17084(0x1b9)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x18b1c1=_0x5de1c5['catalog'],_0x8941d7=_0x5de1c5['database'],_0x25f6b4=_0x5de1c5[_0xc17084(0x1b4)],_0x2069d2=resolveLimit(_0x10006f[_0xc17084(0x1c5)],DEFAULT_DISPLAY_LIMIT);try{_0x10006f['verbose']&&(console[_0xc17084(0x1b9)](_0xc17084(0x1b2)+_0x10006f['site']),_0x18b1c1&&console[_0xc17084(0x1b9)]('Catalog:\x20'+_0x18b1c1),console[_0xc17084(0x1b9)](_0xc17084(0x1d1)+_0x8941d7),console[_0xc17084(0x1b9)]('Table:\x20'+_0x25f6b4),console[_0xc17084(0x1b9)](_0xc17084(0x1bd)+_0x2069d2));const _0x35ed79=_0x18b1c1?_0x18b1c1+'.'+_0x8941d7+'.'+_0x25f6b4:_0x8941d7+'.'+_0x25f6b4,_0x3bd899=await withSpinner(_0xc17084(0x1c3)+_0x35ed79+'...',()=>_0x272144[_0xc17084(0x1cc)][_0xc17084(0x1c8)](_0x8941d7,_0x25f6b4,_0x2069d2,_0x18b1c1),{'verbose':_0x10006f[_0xc17084(0x1b3)]}),_0x2ca036=_0x3bd899[_0xc17084(0x1d3)],_0x327692=_0x2ca036[_0xc17084(0x1d3)];return _0x327692[_0xc17084(0x1ca)]===0x0?console[_0xc17084(0x1b9)](_0xc17084(0x1c2)):console[_0xc17084(0x1b9)](_0xc17084(0x1bf)+_0x327692[_0xc17084(0x1ca)]+_0xc17084(0x1cf)+(_0x327692['length']!==0x1?'s':'')+_0xc17084(0x1c9)+_0x35ed79),await handleSDKOutput(_0x327692,_0x10006f),0x0;}catch(_0x4905cc){if(_0x4905cc instanceof SDKError)return console['error']('Error:\x20'+_0x4905cc[_0xc17084(0x1c7)]),_0x4905cc['cause']&&console[_0xc17084(0x1b9)]('\x20\x20Cause:\x20'+_0x4905cc['cause']),0x1;throw _0x4905cc;}}[a46_0x4683e2(0x1cb)](_0x43dd53){const _0x1b3ece=a46_0x4683e2;if(_0x43dd53[_0x1b3ece(0x1ba)]['length']===0x0)return _0x1b3ece(0x1c1);if(_0x43dd53[_0x1b3ece(0x1ba)][_0x1b3ece(0x1ca)]>0x1)return _0x1b3ece(0x1bc);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x163640=a47_0x2006;(function(_0x296be2,_0x155b42){const _0x50c3df=a47_0x2006,_0x33611c=_0x296be2();while(!![]){try{const _0x431d0b=-parseInt(_0x50c3df(0x1b3))/0x1*(-parseInt(_0x50c3df(0x1b8))/0x2)+parseInt(_0x50c3df(0x1be))/0x3*(-parseInt(_0x50c3df(0x1b7))/0x4)+-parseInt(_0x50c3df(0x1ca))/0x5*(-parseInt(_0x50c3df(0x1c2))/0x6)+parseInt(_0x50c3df(0x1c9))/0x7+-parseInt(_0x50c3df(0x1c6))/0x8+parseInt(_0x50c3df(0x1bc))/0x9*(-parseInt(_0x50c3df(0x1d6))/0xa)+parseInt(_0x50c3df(0x1c3))/0xb*(parseInt(_0x50c3df(0x1b6))/0xc);if(_0x431d0b===_0x155b42)break;else _0x33611c['push'](_0x33611c['shift']());}catch(_0x55388f){_0x33611c['push'](_0x33611c['shift']());}}}(a47_0x4c58,0xebbeb));import{BaseCommand,printAuthError}from'./command.js';function a47_0x4c58(){const _0x1b61dd=['Name:','Account\x20ID:','status','email','CLI\x20flag','log','1OKatVK','displayWithSources','TDX_PROFILE\x20env','29680188DiYdyt','3644mcZzfB','1505132wDSSsZ','green','cli','yellow','9poVTKD','filter','4812ZBMRnV','message','OAuth','site:\x20','3450zCnYpo','11oUwvFL','account_id','dim','3228344naapVr','jobs','site','6420253UBbzyr','10ECzJCx','tdx','last_name','User:','profileSource','✗\x20Validation\x20failed:\x20','name','execute','cyan','session','red','Credential\x20type:\x20','13138460HHQriC','error','config','bold','description','No\x20credential\x20found','env','Show\x20authentication\x20status\x20and\x20current\x20context'];a47_0x4c58=function(){return _0x1b61dd;};return a47_0x4c58();}import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x48246c from'chalk';function a47_0x2006(_0x17e27a,_0x96332e){_0x17e27a=_0x17e27a-0x1ac;const _0x4c584f=a47_0x4c58();let _0x2006fe=_0x4c584f[_0x17e27a];return _0x2006fe;}export class StatusCommand extends BaseCommand{[a47_0x163640(0x1d0)]=a47_0x163640(0x1af);[a47_0x163640(0x1da)]=a47_0x163640(0x1ac);async[a47_0x163640(0x1d1)](_0x1a36d5){const _0x536d6a=a47_0x163640,{options:_0x165f62,tdx:_0x1a3dac}=_0x1a36d5,_0x2039a9=_0x165f62[_0x536d6a(0x1c8)],_0x1e227a=new GlobalContext(_0x165f62),_0x285fa2=_0x1e227a['profile'],_0x8b26aa=_0x1e227a[_0x536d6a(0x1ce)],_0x2bb394=_0x8b26aa===_0x536d6a(0x1ba)?_0x536d6a(0x1b1):_0x8b26aa===_0x536d6a(0x1d3)?'session':_0x8b26aa===_0x536d6a(0x1dc)?_0x536d6a(0x1b5):_0x8b26aa===_0x536d6a(0x1d8)?_0x536d6a(0x1d8):null,_0x334121=_0x285fa2?a47_0x48246c['cyan'](_0x285fa2):a47_0x48246c['dim']('N/A'),_0x5d35d0=_0x2bb394?'\x20'+a47_0x48246c[_0x536d6a(0x1c5)]('(from\x20'+_0x2bb394+')'):'';console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1d9)](_0x536d6a(0x1cb))+'\x20profile:\x20'+_0x334121+_0x5d35d0+'\x20'+a47_0x48246c['dim']('(')+_0x536d6a(0x1c1)+a47_0x48246c[_0x536d6a(0x1d2)](_0x2039a9)+a47_0x48246c[_0x536d6a(0x1c5)](')'));const _0x5a60c1=await getOAuthTokens(_0x285fa2);if(_0x5a60c1)console[_0x536d6a(0x1b2)](_0x536d6a(0x1d5)+a47_0x48246c[_0x536d6a(0x1d2)](_0x536d6a(0x1c0)));else{const _0x22564d=await resolveAPIKeyAsync(_0x2039a9,_0x285fa2);if(_0x22564d){const {source:_0x280a57,isDeprecated:_0x345999}=_0x22564d,_0x3e997c='Read\x20credential\x20from\x20'+a47_0x48246c['cyan'](_0x280a57);console[_0x536d6a(0x1b2)](_0x345999?a47_0x48246c[_0x536d6a(0x1bb)](_0x3e997c):_0x3e997c);}else console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1bb)](_0x536d6a(0x1db)));}let _0x43b76d=![];try{const _0x28acfa=await _0x1a3dac[_0x536d6a(0x1c7)]['getUserInfo']();console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1b9)]('✓\x20Authentication\x20successful\x0a')),console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1d9)](_0x536d6a(0x1cd))+'\x20'+a47_0x48246c['cyan'](_0x28acfa[_0x536d6a(0x1b0)]));if(_0x28acfa['first_name']||_0x28acfa['last_name']){const _0x37c615=[_0x28acfa['first_name'],_0x28acfa[_0x536d6a(0x1cc)]][_0x536d6a(0x1bd)](Boolean)['join']('\x20');console[_0x536d6a(0x1b2)](a47_0x48246c['bold'](_0x536d6a(0x1ad))+'\x20'+_0x37c615);}_0x28acfa[_0x536d6a(0x1c4)]&&console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1d9)](_0x536d6a(0x1ae))+'\x20'+a47_0x48246c[_0x536d6a(0x1bb)](_0x28acfa[_0x536d6a(0x1c4)])),_0x43b76d=!![];}catch(_0x1cb5f3){_0x1cb5f3 instanceof HTTPClientError&&_0x1cb5f3['status']===0x191?printAuthError(_0x1cb5f3,!![],_0x285fa2):console[_0x536d6a(0x1d7)](a47_0x48246c[_0x536d6a(0x1d4)](_0x536d6a(0x1cf)+(_0x1cb5f3 instanceof Error?_0x1cb5f3[_0x536d6a(0x1bf)]:String(_0x1cb5f3))));}return console[_0x536d6a(0x1b2)](),_0x1e227a[_0x536d6a(0x1b4)](),_0x43b76d?0x0:0x1;}}
1
+ const a47_0x6bccb1=a47_0x1ebc;(function(_0x4f5117,_0x4fcf9f){const _0x453df1=a47_0x1ebc,_0x25ae1d=_0x4f5117();while(!![]){try{const _0x4cc9db=parseInt(_0x453df1(0x1dd))/0x1+parseInt(_0x453df1(0x1b7))/0x2+parseInt(_0x453df1(0x1c4))/0x3*(-parseInt(_0x453df1(0x1e1))/0x4)+-parseInt(_0x453df1(0x1b3))/0x5*(parseInt(_0x453df1(0x1db))/0x6)+-parseInt(_0x453df1(0x1bf))/0x7*(-parseInt(_0x453df1(0x1c5))/0x8)+-parseInt(_0x453df1(0x1d5))/0x9*(parseInt(_0x453df1(0x1cf))/0xa)+parseInt(_0x453df1(0x1c9))/0xb;if(_0x4cc9db===_0x4fcf9f)break;else _0x25ae1d['push'](_0x25ae1d['shift']());}catch(_0x1d7024){_0x25ae1d['push'](_0x25ae1d['shift']());}}}(a47_0x4351,0xdfb56));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x1ebc(_0x4d018b,_0x16c686){_0x4d018b=_0x4d018b-0x1b3;const _0x435191=a47_0x4351();let _0x1ebccf=_0x435191[_0x4d018b];return _0x1ebccf;}function a47_0x4351(){const _0x4984a7=['105304chVmDd','bold','last_name','config','8703123xrqdeD','CLI\x20flag','OAuth','profile','✗\x20Validation\x20failed:\x20','N/A','360TPXjHw','(from\x20','status','TDX_PROFILE\x20env','dim','log','304398PmjHem','Credential\x20type:\x20','User:','cyan','red','Name:','2790942QjGJAR','jobs','1121541ONTzig','env','Account\x20ID:','green','12GcVKbm','getUserInfo','cli','site','10PJibfM','name','displayWithSources','site:\x20','931530vgOHXw','first_name','\x20profile:\x20','description','session','✓\x20Authentication\x20successful\x0a','profileSource','error','518MGiVLv','execute','tdx','Show\x20authentication\x20status\x20and\x20current\x20context','message','288345gUmHFv'];a47_0x4351=function(){return _0x4984a7;};return a47_0x4351();}import a47_0x305ae9 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x6bccb1(0x1b4)]=a47_0x6bccb1(0x1d1);[a47_0x6bccb1(0x1ba)]=a47_0x6bccb1(0x1c2);async[a47_0x6bccb1(0x1c0)](_0x36c0e4){const _0x440d22=a47_0x6bccb1,{options:_0x4229c0,tdx:_0x27870c}=_0x36c0e4,_0x3cd452=_0x4229c0[_0x440d22(0x1e4)],_0x4ef23e=new GlobalContext(_0x4229c0),_0x4ed0a4=_0x4ef23e[_0x440d22(0x1cc)],_0x26c9c2=_0x4ef23e[_0x440d22(0x1bd)],_0x2ecbca=_0x26c9c2===_0x440d22(0x1e3)?_0x440d22(0x1ca):_0x26c9c2===_0x440d22(0x1bb)?_0x440d22(0x1bb):_0x26c9c2===_0x440d22(0x1de)?_0x440d22(0x1d2):_0x26c9c2===_0x440d22(0x1c8)?_0x440d22(0x1c8):null,_0x56c523=_0x4ed0a4?a47_0x305ae9[_0x440d22(0x1d8)](_0x4ed0a4):a47_0x305ae9[_0x440d22(0x1d3)](_0x440d22(0x1ce)),_0x40dcc7=_0x2ecbca?'\x20'+a47_0x305ae9[_0x440d22(0x1d3)](_0x440d22(0x1d0)+_0x2ecbca+')'):'';console[_0x440d22(0x1d4)](a47_0x305ae9[_0x440d22(0x1c6)](_0x440d22(0x1c1))+_0x440d22(0x1b9)+_0x56c523+_0x40dcc7+'\x20'+a47_0x305ae9[_0x440d22(0x1d3)]('(')+_0x440d22(0x1b6)+a47_0x305ae9[_0x440d22(0x1d8)](_0x3cd452)+a47_0x305ae9[_0x440d22(0x1d3)](')'));const _0x12b3b5=await getOAuthTokens(_0x4ed0a4);if(_0x12b3b5)console['log'](_0x440d22(0x1d6)+a47_0x305ae9[_0x440d22(0x1d8)](_0x440d22(0x1cb)));else{const _0x1b59d7=await resolveAPIKeyAsync(_0x3cd452,_0x4ed0a4);if(_0x1b59d7){const {source:_0x5344af,isDeprecated:_0x14f661}=_0x1b59d7,_0x260103='Read\x20credential\x20from\x20'+a47_0x305ae9[_0x440d22(0x1d8)](_0x5344af);console[_0x440d22(0x1d4)](_0x14f661?a47_0x305ae9['yellow'](_0x260103):_0x260103);}else console[_0x440d22(0x1d4)](a47_0x305ae9['yellow']('No\x20credential\x20found'));}let _0x273e41=![];try{const _0x1b3868=await _0x27870c[_0x440d22(0x1dc)][_0x440d22(0x1e2)]();console['log'](a47_0x305ae9[_0x440d22(0x1e0)](_0x440d22(0x1bc))),console[_0x440d22(0x1d4)](a47_0x305ae9[_0x440d22(0x1c6)](_0x440d22(0x1d7))+'\x20'+a47_0x305ae9[_0x440d22(0x1d8)](_0x1b3868['email']));if(_0x1b3868[_0x440d22(0x1b8)]||_0x1b3868[_0x440d22(0x1c7)]){const _0x56ccd1=[_0x1b3868[_0x440d22(0x1b8)],_0x1b3868['last_name']]['filter'](Boolean)['join']('\x20');console[_0x440d22(0x1d4)](a47_0x305ae9[_0x440d22(0x1c6)](_0x440d22(0x1da))+'\x20'+_0x56ccd1);}_0x1b3868['account_id']&&console[_0x440d22(0x1d4)](a47_0x305ae9[_0x440d22(0x1c6)](_0x440d22(0x1df))+'\x20'+a47_0x305ae9['yellow'](_0x1b3868['account_id'])),_0x273e41=!![];}catch(_0xfc7a8){_0xfc7a8 instanceof HTTPClientError&&_0xfc7a8['status']===0x191?printAuthError(_0xfc7a8,!![],_0x4ed0a4):console[_0x440d22(0x1be)](a47_0x305ae9[_0x440d22(0x1d9)](_0x440d22(0x1cd)+(_0xfc7a8 instanceof Error?_0xfc7a8[_0x440d22(0x1c3)]:String(_0xfc7a8))));}return console[_0x440d22(0x1d4)](),_0x4ef23e[_0x440d22(0x1b5)](),_0x273e41?0x0:0x1;}}