@treasuredata/tdx 2026.3.50 → 2026.3.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.d.ts.map +1 -1
  66. package/dist/core/global-context.js +1 -1
  67. package/dist/core/global-context.js.map +1 -1
  68. package/dist/core/keychain.js +1 -1
  69. package/dist/core/oauth-keychain.js +1 -1
  70. package/dist/core/oauth.d.ts +1 -0
  71. package/dist/core/oauth.d.ts.map +1 -1
  72. package/dist/core/oauth.js +1 -1
  73. package/dist/core/oauth.js.map +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.d.ts +21 -4
  87. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  88. package/dist/proxy/passthrough-server.js +1 -1
  89. package/dist/proxy/passthrough-server.js.map +1 -1
  90. package/dist/proxy/sse-usage-parser.js +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  93. package/dist/sdk/agent/agent-yaml.js +1 -1
  94. package/dist/sdk/agent/test/evaluator.js +1 -1
  95. package/dist/sdk/agent/test/executor.js +1 -1
  96. package/dist/sdk/agent/test/index.js +1 -1
  97. package/dist/sdk/agent/test/output.js +1 -1
  98. package/dist/sdk/agent/test/parser.js +1 -1
  99. package/dist/sdk/agent/tool-target-registry.js +1 -1
  100. package/dist/sdk/api.js +1 -1
  101. package/dist/sdk/cas/cas-api-client.js +1 -1
  102. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  103. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  104. package/dist/sdk/cas/index.js +1 -1
  105. package/dist/sdk/cas/pull-workflow.js +1 -1
  106. package/dist/sdk/cas/push-workflow.js +1 -1
  107. package/dist/sdk/client/cdp-api-client.js +1 -1
  108. package/dist/sdk/client/delivery-api-client.js +1 -1
  109. package/dist/sdk/client/endpoints.js +1 -1
  110. package/dist/sdk/client/engage-api-client.js +1 -1
  111. package/dist/sdk/client/http-client.js +1 -1
  112. package/dist/sdk/client/llm-api-client.js +1 -1
  113. package/dist/sdk/client/oauth-refresh.js +1 -1
  114. package/dist/sdk/client/rate-limiter.js +1 -1
  115. package/dist/sdk/client/td-api-client.js +1 -1
  116. package/dist/sdk/client/trino-api-client.js +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/connection-validator.js +1 -1
  119. package/dist/sdk/connection.js +1 -1
  120. package/dist/sdk/delivery.js +1 -1
  121. package/dist/sdk/engage/campaign-pull.js +1 -1
  122. package/dist/sdk/engage/campaign-push.js +1 -1
  123. package/dist/sdk/engage/campaign-validator.js +1 -1
  124. package/dist/sdk/engage/campaign-yaml.js +1 -1
  125. package/dist/sdk/engage/template-pull.js +1 -1
  126. package/dist/sdk/engage/template-push.js +1 -1
  127. package/dist/sdk/engage/template-validator.js +1 -1
  128. package/dist/sdk/engage/template-yaml.js +1 -1
  129. package/dist/sdk/engage/types/campaign-def.js +1 -1
  130. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  131. package/dist/sdk/engage/types/template-schema.js +1 -1
  132. package/dist/sdk/engage.js +1 -1
  133. package/dist/sdk/errors.js +1 -1
  134. package/dist/sdk/index.js +1 -1
  135. package/dist/sdk/io/index.js +1 -1
  136. package/dist/sdk/io/node-filesystem.js +1 -1
  137. package/dist/sdk/job.js +1 -1
  138. package/dist/sdk/journey.js +1 -1
  139. package/dist/sdk/llm/chat-cache.js +1 -1
  140. package/dist/sdk/llm/index.js +1 -1
  141. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  142. package/dist/sdk/llm/model-factors.js +1 -1
  143. package/dist/sdk/personalization.js +1 -1
  144. package/dist/sdk/policy.js +1 -1
  145. package/dist/sdk/query/index.js +1 -1
  146. package/dist/sdk/query/sql-parser.js +1 -1
  147. package/dist/sdk/realtime.js +1 -1
  148. package/dist/sdk/schedule.js +1 -1
  149. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/fields-display.js +1 -1
  151. package/dist/sdk/segment/file-discovery.js +1 -1
  152. package/dist/sdk/segment/journey-utils.js +1 -1
  153. package/dist/sdk/segment/journey-validator.js +1 -1
  154. package/dist/sdk/segment/journey-yaml.js +1 -1
  155. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  156. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  157. package/dist/sdk/segment/pull-workflow.js +1 -1
  158. package/dist/sdk/segment/push-recovery.js +1 -1
  159. package/dist/sdk/segment/push-workflow.js +1 -1
  160. package/dist/sdk/segment/resolution-context.js +1 -1
  161. package/dist/sdk/segment/segment-path-parser.js +1 -1
  162. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  163. package/dist/sdk/segment/segment-validator.js +1 -1
  164. package/dist/sdk/segment/target-resolution.js +1 -1
  165. package/dist/sdk/segment/tdx-config.js +1 -1
  166. package/dist/sdk/segment/types/activation-schema.js +1 -1
  167. package/dist/sdk/segment/types/journey-def.js +1 -1
  168. package/dist/sdk/segment/types/journey-schema.js +1 -1
  169. package/dist/sdk/segment/types/segment-def.js +1 -1
  170. package/dist/sdk/segment/types/segment-schema.js +1 -1
  171. package/dist/sdk/segment/validate-files.js +1 -1
  172. package/dist/sdk/segment/yaml-validator.js +1 -1
  173. package/dist/sdk/segment.js +1 -1
  174. package/dist/sdk/types/index.js +1 -1
  175. package/dist/sdk/types/progress.js +1 -1
  176. package/dist/sdk/types/workspace.js +1 -1
  177. package/dist/sdk/user.js +1 -1
  178. package/dist/sdk/util/format-detector.js +1 -1
  179. package/dist/sdk/util/formatters.js +1 -1
  180. package/dist/sdk/util/index.js +1 -1
  181. package/dist/sdk/util/paginate.js +1 -1
  182. package/dist/sdk/util/tree-formatter.js +1 -1
  183. package/dist/sdk/workflow/archive-validation.js +1 -1
  184. package/dist/sdk/workflow/clone-workflow.js +1 -1
  185. package/dist/sdk/workflow/index.js +1 -1
  186. package/dist/sdk/workflow/pull-workflow.js +1 -1
  187. package/dist/sdk/workflow/push-workflow.js +1 -1
  188. package/dist/sdk/workflow/tdx-config.js +1 -1
  189. package/dist/sdk/workflow/workflow-utils.js +1 -1
  190. package/dist/sdk/workspace/frontmatter.js +1 -1
  191. package/dist/sdk/workspace/git.js +1 -1
  192. package/dist/sdk/workspace/index.js +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x1b3357=a40_0x3ae7;function a40_0x6b1f(){const _0x27fd92=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','name','\x20activations','activations','journeyVersions','dirname','utf-8','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','files','352176AuutIH','\x27...','\x20\x20🎯\x20','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','1961225UQJAxd','errorCode','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','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)','type','yes','relativePath','cyan','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','3nByobZ','\x20versions)','Error:\x20','message','-\x20no\x20files\x20written','targetDir','\x20with\x20','\x20changed\x20files','description','content','absolutePath','✔\x20Pulled\x20','error','data','parentName','1410903xRkUjR','192437ZpWVzA','segment','yellow','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','resourceName','filter','2771242lxzJBx','segments','\x20files\x20to\x20','hasChanges','\x20\x20🗺️\x20\x20','helpText','green','dryRun','repeat','Target\x20resource:\x20','\x20segments','segment:pull','Parent\x20segment:\x20','\x20journeys','verbose','7FrdeWQ','113608YiGLrg','site','\x0aError:','\x20=\x20','✔\x20Context\x20set:\x20','\x0aChanges\x20to\x20\x27','parent_segment','\x20files?','journeys','1024160WxlyiG','isNew','red','✔\x20All\x20files\x20are\x20up\x20to\x20date','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Pulling\x20segments\x20from\x20\x27','counts','\x0aPull\x20summary\x20for\x20\x27','Aborted.'];a40_0x6b1f=function(){return _0x27fd92;};return a40_0x6b1f();}(function(_0x5d239a,_0x56c357){const _0x258128=a40_0x3ae7,_0xac4ec4=_0x5d239a();while(!![]){try{const _0x103e1f=parseInt(_0x258128(0x138))/0x1+parseInt(_0x258128(0x13e))/0x2*(parseInt(_0x258128(0x128))/0x3)+-parseInt(_0x258128(0x157))/0x4+-parseInt(_0x258128(0x11f))/0x5+-parseInt(_0x258128(0x16a))/0x6+-parseInt(_0x258128(0x14d))/0x7*(parseInt(_0x258128(0x14e))/0x8)+-parseInt(_0x258128(0x137))/0x9;if(_0x103e1f===_0x56c357)break;else _0xac4ec4['push'](_0xac4ec4['shift']());}catch(_0xc37443){_0xac4ec4['push'](_0xac4ec4['shift']());}}}(a40_0x6b1f,0xaaecd));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_0x426727 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x3ae7(_0x467bcf,_0x473c30){_0x467bcf=_0x467bcf-0x11e;const _0x6b1f08=a40_0x6b1f();let _0x3ae795=_0x6b1f08[_0x467bcf];return _0x3ae795;}import a40_0x17f01d from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x1b3357(0x161)]=a40_0x1b3357(0x149);[a40_0x1b3357(0x130)]=a40_0x1b3357(0x13b);async['execute'](_0xed0cbe){const _0x4eb8bf=a40_0x1b3357,{options:_0xf0e94a,args:_0x4ff42b,tdx:_0x50e3fc}=_0xed0cbe,_0x3e4fcb=_0xf0e94a,_0x286396=await resolveTarget({'arg':_0x4ff42b[0x0],'contextParent':_0xf0e94a['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x286396))return _0x286396[_0x4eb8bf(0x120)]==='no_parent'?(console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x13a)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x122)),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x11e)),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x160))):(console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x159)](_0x4eb8bf(0x12a)+_0x286396[_0x4eb8bf(0x12b)]+'\x0a')),_0x286396[_0x4eb8bf(0x143)]&&console[_0x4eb8bf(0x134)](a40_0x426727['cyan'](_0x286396[_0x4eb8bf(0x143)]))),0x1;const _0x3e8f31=_0x286396['parentName'],_0x3f727f=_0x286396['targetDir'],_0x986512=_0x286396[_0x4eb8bf(0x123)]==='file'?_0x286396[_0x4eb8bf(0x13c)]:undefined;_0x3e4fcb[_0x4eb8bf(0x14c)]&&(console[_0x4eb8bf(0x134)]('Site:\x20'+_0x3e4fcb[_0x4eb8bf(0x14f)]),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x14a)+_0x3e8f31),_0x986512&&console[_0x4eb8bf(0x134)](_0x4eb8bf(0x147)+_0x986512));const _0x1a7261=await withProgressSpinner(_0x4eb8bf(0x15c)+_0x3e8f31+_0x4eb8bf(0x16b),_0x7e692f=>_0x50e3fc[_0x4eb8bf(0x139)]['pullSegments'](_0x3e8f31,{'targetDir':_0x3f727f,'targetResourceName':_0x986512,'verbose':_0x3e4fcb[_0x4eb8bf(0x14c)],'progress':{'update':_0xca2351=>{const _0x2292eb=_0x4eb8bf;_0x7e692f['setPhase'](_0xca2351),_0x3e4fcb[_0x2292eb(0x14c)]&&console[_0x2292eb(0x134)]('\x20\x20'+_0xca2351);}}}),{'verbose':_0x3e4fcb['verbose']}),_0x280c31=_0x1a7261[_0x4eb8bf(0x135)];if(_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x13f)]===0x0&&_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x156)]===0x0)return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x13a)](_0x4eb8bf(0x15b)+_0x280c31['parentName']+'\x27')),0x0;const _0x3fb67e=_0x280c31[_0x4eb8bf(0x169)][_0x4eb8bf(0x13d)](_0x198acd=>_0x198acd['isNew']),_0x43bbaa=_0x280c31['files'][_0x4eb8bf(0x13d)](_0x3cd07d=>!_0x3cd07d[_0x4eb8bf(0x158)]&&_0x3cd07d[_0x4eb8bf(0x141)]),_0x5910c3=_0x280c31[_0x4eb8bf(0x169)]['filter'](_0x142db1=>!_0x142db1[_0x4eb8bf(0x158)]&&!_0x142db1[_0x4eb8bf(0x141)]);console['error'](_0x4eb8bf(0x15e)+_0x280c31[_0x4eb8bf(0x136)]+'\x27:'),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x16c)+a40_0x426727['cyan'](_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x13f)]+_0x4eb8bf(0x148))+_0x4eb8bf(0x12e)+a40_0x426727['cyan'](_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x163)]+_0x4eb8bf(0x162)));if(_0x280c31['counts']['journeys']>0x0){const _0x5a041d=_0x280c31[_0x4eb8bf(0x15d)]['journeyVersions']>_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x156)]?'\x20('+_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x164)]+_0x4eb8bf(0x129):'';console[_0x4eb8bf(0x134)](_0x4eb8bf(0x142)+a40_0x426727['cyan'](_0x280c31[_0x4eb8bf(0x15d)]['journeys']+_0x4eb8bf(0x14b))+a40_0x426727[_0x4eb8bf(0x16d)](_0x5a041d));}console[_0x4eb8bf(0x134)]('\x20\x20'+a40_0x426727[_0x4eb8bf(0x144)]('+\x20'+_0x3fb67e[_0x4eb8bf(0x168)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x426727[_0x4eb8bf(0x13a)]('~\x20'+_0x43bbaa[_0x4eb8bf(0x168)]+_0x4eb8bf(0x12f))),console[_0x4eb8bf(0x134)]('\x20\x20'+a40_0x426727[_0x4eb8bf(0x16d)]('=\x20'+_0x5910c3['length']+'\x20unchanged\x20files')),console[_0x4eb8bf(0x134)]('\x20\x20Target:\x20'+a40_0x426727[_0x4eb8bf(0x126)](_0x280c31[_0x4eb8bf(0x12d)])+'\x0a');if(_0x43bbaa['length']>0x0)for(const _0x3a60a9 of _0x43bbaa){console['error'](_0x4eb8bf(0x153)+_0x3a60a9[_0x4eb8bf(0x125)]+'\x27:'),console[_0x4eb8bf(0x134)]('─'[_0x4eb8bf(0x146)](0x3c)),console[_0x4eb8bf(0x134)](_0x3a60a9['diff']),console['error']('─'[_0x4eb8bf(0x146)](0x3c));}if(_0x3e4fcb[_0x4eb8bf(0x145)])return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x13a)](_0x4eb8bf(0x127))),0x0;if(_0x3fb67e[_0x4eb8bf(0x168)]===0x0&&_0x43bbaa['length']===0x0)return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x144)](_0x4eb8bf(0x15a))),saveSessionContext({'parent_segment':_0x280c31[_0x4eb8bf(0x136)]},_0x3e4fcb['session']),console['error'](a40_0x426727[_0x4eb8bf(0x144)]('✔\x20Context\x20set:\x20'+a40_0x426727[_0x4eb8bf(0x16d)]('parent_segment')+_0x4eb8bf(0x151)+a40_0x426727[_0x4eb8bf(0x126)](_0x280c31['parentName']))),0x0;if(!_0x3e4fcb[_0x4eb8bf(0x124)]){if(!isInteractive())return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x159)](_0x4eb8bf(0x150)),_0x4eb8bf(0x167)),console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x16d)](_0x4eb8bf(0x121))),0x1;const _0x83bead=await confirmKey('Write\x20'+(_0x3fb67e[_0x4eb8bf(0x168)]+_0x43bbaa[_0x4eb8bf(0x168)])+_0x4eb8bf(0x155));if(!_0x83bead)return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x13a)](_0x4eb8bf(0x15f)),_0x4eb8bf(0x12c)),0x1;}for(const _0x43a395 of _0x280c31[_0x4eb8bf(0x169)]){if(_0x43a395[_0x4eb8bf(0x158)]||_0x43a395[_0x4eb8bf(0x141)]){const _0xddc272=a40_0x17f01d[_0x4eb8bf(0x165)](_0x43a395[_0x4eb8bf(0x132)]);!existsSync(_0xddc272)&&mkdirSync(_0xddc272,{'recursive':!![]}),writeFileSync(_0x43a395[_0x4eb8bf(0x132)],_0x43a395[_0x4eb8bf(0x131)],_0x4eb8bf(0x166));}}return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x144)](_0x4eb8bf(0x133)+(_0x3fb67e['length']+_0x43bbaa['length'])+_0x4eb8bf(0x140)+_0x280c31[_0x4eb8bf(0x12d)])),saveSessionContext({'parent_segment':_0x280c31[_0x4eb8bf(0x136)]},_0x3e4fcb['session']),console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x144)](_0x4eb8bf(0x152)+a40_0x426727[_0x4eb8bf(0x16d)](_0x4eb8bf(0x154))+_0x4eb8bf(0x151)+a40_0x426727[_0x4eb8bf(0x126)](_0x280c31['parentName']))),0x0;}}
1
+ const a40_0x5e007c=a40_0x50f9;(function(_0x27364c,_0xd1820e){const _0x2ce13e=a40_0x50f9,_0x43d77e=_0x27364c();while(!![]){try{const _0x497473=parseInt(_0x2ce13e(0xfe))/0x1+parseInt(_0x2ce13e(0xf7))/0x2*(parseInt(_0x2ce13e(0x113))/0x3)+parseInt(_0x2ce13e(0xed))/0x4+-parseInt(_0x2ce13e(0x122))/0x5*(-parseInt(_0x2ce13e(0x105))/0x6)+-parseInt(_0x2ce13e(0xf0))/0x7*(parseInt(_0x2ce13e(0x110))/0x8)+parseInt(_0x2ce13e(0x101))/0x9*(-parseInt(_0x2ce13e(0xdb))/0xa)+-parseInt(_0x2ce13e(0xe0))/0xb*(parseInt(_0x2ce13e(0xe7))/0xc);if(_0x497473===_0xd1820e)break;else _0x43d77e['push'](_0x43d77e['shift']());}catch(_0x240c54){_0x43d77e['push'](_0x43d77e['shift']());}}}(a40_0x31c2,0xd5431));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_0x15668c from'chalk';function a40_0x31c2(){const _0x4657a6=['journeyVersions','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Site:\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','pullSegments','142nlcKFY','no_parent','\x20activations','\x0aError:','diff','Pulling\x20segments\x20from\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','1440124jRJPCU','\x20\x20Target:\x20','dirname','45kmWKPg','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)','length','resourceName','68628RFAFVm','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','cwd','name','errorCode','files','session','\x20segments','setPhase','\x20files\x20to\x20','\x0aChanges\x20to\x20\x27','9912sinzdn','site','dim','31119yTDZUq','\x20new\x20files','parentName','\x20journeys','isNew','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','file','\x20\x20🗺️\x20\x20','type','targetDir','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','relativePath','cyan','red','35hUhPCD','-\x20no\x20files\x20written','activations','description','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','segment','yellow','Aborted.','counts','\x20files?','\x27...','✔\x20Context\x20set:\x20','2607720cBpLhI','dryRun','segments','Parent\x20segment:\x20','error','4230512znccuS','yes','journeys','Error:\x20','\x20unchanged\x20files','Write\x20','parent_segment','12yXlNmV','helpText','\x20\x20🎯\x20','\x20changed\x20files','execute','green','5835236oFXTzQ','absolutePath','verbose','6517XluTbC','filter'];a40_0x31c2=function(){return _0x4657a6;};return a40_0x31c2();}function a40_0x50f9(_0xdd624d,_0x13fe55){_0xdd624d=_0xdd624d-0xdb;const _0x31c24b=a40_0x31c2();let _0x50f962=_0x31c24b[_0xdd624d];return _0x50f962;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x5dcbbc from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x5e007c(0x108)]='segment:pull';[a40_0x5e007c(0x125)]=a40_0x5e007c(0xf5);async[a40_0x5e007c(0xeb)](_0x32099d){const _0x54cc22=a40_0x5e007c,{options:_0x4d5452,args:_0x55d0b2,tdx:_0x16ec9c}=_0x32099d,_0x33573d=_0x4d5452,_0x45093f=await resolveTarget({'arg':_0x55d0b2[0x0],'contextParent':_0x4d5452['parentSegment'],'cwd':process[_0x54cc22(0x107)]()});if(!isSuccessfulResolution(_0x45093f))return _0x45093f[_0x54cc22(0x109)]===_0x54cc22(0xf8)?(console[_0x54cc22(0xdf)](a40_0x15668c['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x54cc22(0x102)),console[_0x54cc22(0xdf)](_0x54cc22(0x119)),console[_0x54cc22(0xdf)](_0x54cc22(0x106))):(console[_0x54cc22(0xdf)](a40_0x15668c[_0x54cc22(0x121)](_0x54cc22(0xe3)+_0x45093f['message']+'\x0a')),_0x45093f[_0x54cc22(0xe8)]&&console[_0x54cc22(0xdf)](a40_0x15668c['cyan'](_0x45093f[_0x54cc22(0xe8)]))),0x1;const _0x175a75=_0x45093f[_0x54cc22(0x115)],_0x58f455=_0x45093f['targetDir'],_0x53830d=_0x45093f[_0x54cc22(0x11c)]===_0x54cc22(0x11a)?_0x45093f[_0x54cc22(0x104)]:undefined;_0x33573d[_0x54cc22(0xef)]&&(console['error'](_0x54cc22(0xf4)+_0x33573d[_0x54cc22(0x111)]),console[_0x54cc22(0xdf)](_0x54cc22(0xde)+_0x175a75),_0x53830d&&console['error']('Target\x20resource:\x20'+_0x53830d));const _0x1fb4b7=await withProgressSpinner(_0x54cc22(0xfc)+_0x175a75+_0x54cc22(0x12d),_0x308b11=>_0x16ec9c[_0x54cc22(0x128)][_0x54cc22(0xf6)](_0x175a75,{'targetDir':_0x58f455,'targetResourceName':_0x53830d,'verbose':_0x33573d[_0x54cc22(0xef)],'progress':{'update':_0x374a6b=>{const _0x3965ee=_0x54cc22;_0x308b11[_0x3965ee(0x10d)](_0x374a6b),_0x33573d['verbose']&&console['error']('\x20\x20'+_0x374a6b);}}}),{'verbose':_0x33573d[_0x54cc22(0xef)]}),_0x31167a=_0x1fb4b7['data'];if(_0x31167a[_0x54cc22(0x12b)][_0x54cc22(0xdd)]===0x0&&_0x31167a[_0x54cc22(0x12b)][_0x54cc22(0xe2)]===0x0)return console[_0x54cc22(0xdf)](a40_0x15668c[_0x54cc22(0x129)](_0x54cc22(0xf3)+_0x31167a[_0x54cc22(0x115)]+'\x27')),0x0;const _0x578ac1=_0x31167a[_0x54cc22(0x10a)]['filter'](_0x1d1f3a=>_0x1d1f3a['isNew']),_0x507c4b=_0x31167a[_0x54cc22(0x10a)][_0x54cc22(0xf1)](_0x3cf01d=>!_0x3cf01d[_0x54cc22(0x117)]&&_0x3cf01d['hasChanges']),_0x210452=_0x31167a[_0x54cc22(0x10a)][_0x54cc22(0xf1)](_0x257189=>!_0x257189[_0x54cc22(0x117)]&&!_0x257189[_0x54cc22(0x118)]);console['error'](_0x54cc22(0x127)+_0x31167a[_0x54cc22(0x115)]+'\x27:'),console[_0x54cc22(0xdf)](_0x54cc22(0xe9)+a40_0x15668c[_0x54cc22(0x120)](_0x31167a[_0x54cc22(0x12b)][_0x54cc22(0xdd)]+_0x54cc22(0x10c))+_0x54cc22(0x126)+a40_0x15668c[_0x54cc22(0x120)](_0x31167a[_0x54cc22(0x12b)][_0x54cc22(0x124)]+_0x54cc22(0xf9)));if(_0x31167a['counts'][_0x54cc22(0xe2)]>0x0){const _0x251271=_0x31167a['counts'][_0x54cc22(0xf2)]>_0x31167a['counts'][_0x54cc22(0xe2)]?'\x20('+_0x31167a['counts'][_0x54cc22(0xf2)]+'\x20versions)':'';console[_0x54cc22(0xdf)](_0x54cc22(0x11b)+a40_0x15668c[_0x54cc22(0x120)](_0x31167a['counts'][_0x54cc22(0xe2)]+_0x54cc22(0x116))+a40_0x15668c[_0x54cc22(0x112)](_0x251271));}console[_0x54cc22(0xdf)]('\x20\x20'+a40_0x15668c[_0x54cc22(0xec)]('+\x20'+_0x578ac1[_0x54cc22(0x103)]+_0x54cc22(0x114))),console['error']('\x20\x20'+a40_0x15668c[_0x54cc22(0x129)]('~\x20'+_0x507c4b[_0x54cc22(0x103)]+_0x54cc22(0xea))),console[_0x54cc22(0xdf)]('\x20\x20'+a40_0x15668c[_0x54cc22(0x112)]('=\x20'+_0x210452[_0x54cc22(0x103)]+_0x54cc22(0xe4))),console['error'](_0x54cc22(0xff)+a40_0x15668c[_0x54cc22(0x120)](_0x31167a[_0x54cc22(0x11d)])+'\x0a');if(_0x507c4b[_0x54cc22(0x103)]>0x0)for(const _0x4bc76b of _0x507c4b){console['error'](_0x54cc22(0x10f)+_0x4bc76b[_0x54cc22(0x11f)]+'\x27:'),console[_0x54cc22(0xdf)]('─'['repeat'](0x3c)),console[_0x54cc22(0xdf)](_0x4bc76b[_0x54cc22(0xfb)]),console[_0x54cc22(0xdf)]('─'['repeat'](0x3c));}if(_0x33573d[_0x54cc22(0xdc)])return console[_0x54cc22(0xdf)](a40_0x15668c['yellow'](_0x54cc22(0xfd))),0x0;if(_0x578ac1['length']===0x0&&_0x507c4b[_0x54cc22(0x103)]===0x0)return console[_0x54cc22(0xdf)](a40_0x15668c[_0x54cc22(0xec)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x31167a[_0x54cc22(0x115)]},_0x33573d[_0x54cc22(0x10b)]),console[_0x54cc22(0xdf)](a40_0x15668c[_0x54cc22(0xec)](_0x54cc22(0x12e)+a40_0x15668c[_0x54cc22(0x112)]('parent_segment')+'\x20=\x20'+a40_0x15668c['cyan'](_0x31167a['parentName']))),0x0;if(!_0x33573d[_0x54cc22(0xe1)]){if(!isInteractive())return console[_0x54cc22(0xdf)](a40_0x15668c['red'](_0x54cc22(0xfa)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a40_0x15668c[_0x54cc22(0x112)](_0x54cc22(0x11e))),0x1;const _0x279cbf=await confirmKey(_0x54cc22(0xe5)+(_0x578ac1[_0x54cc22(0x103)]+_0x507c4b[_0x54cc22(0x103)])+_0x54cc22(0x12c));if(!_0x279cbf)return console[_0x54cc22(0xdf)](a40_0x15668c[_0x54cc22(0x129)](_0x54cc22(0x12a)),_0x54cc22(0x123)),0x1;}for(const _0x372efb of _0x31167a['files']){if(_0x372efb[_0x54cc22(0x117)]||_0x372efb[_0x54cc22(0x118)]){const _0x5db419=a40_0x5dcbbc[_0x54cc22(0x100)](_0x372efb[_0x54cc22(0xee)]);!existsSync(_0x5db419)&&mkdirSync(_0x5db419,{'recursive':!![]}),writeFileSync(_0x372efb[_0x54cc22(0xee)],_0x372efb['content'],'utf-8');}}return console[_0x54cc22(0xdf)](a40_0x15668c[_0x54cc22(0xec)]('✔\x20Pulled\x20'+(_0x578ac1[_0x54cc22(0x103)]+_0x507c4b[_0x54cc22(0x103)])+_0x54cc22(0x10e)+_0x31167a['targetDir'])),saveSessionContext({'parent_segment':_0x31167a['parentName']},_0x33573d['session']),console[_0x54cc22(0xdf)](a40_0x15668c[_0x54cc22(0xec)]('✔\x20Context\x20set:\x20'+a40_0x15668c[_0x54cc22(0x112)](_0x54cc22(0xe6))+'\x20=\x20'+a40_0x15668c[_0x54cc22(0x120)](_0x31167a[_0x54cc22(0x115)]))),0x0;}}
@@ -1 +1 @@
1
- function a41_0x3194(){const _0x2a4bf9=['results','\x0aError:','then','journey','1107047zkdmrV','Push\x20','green','3529370iHdjvs','\x20created','description','/app/ps/','list','error','cyan','diff','Site:\x20','user','\x20to\x20delete','dim','folderId','relationships','listFolders','Parent\x20segment:\x20','Resolving\x20parent\x20segment\x20\x27','existingJourney','journeyId','/e/','toDelete','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20updated','.yaml','get','\x20\x20🗺️\x20\x20Journeys:','endsWith','8424768TVeiob','New\x20segment:','existingSegment','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','183tBmmKL','scopedFolderPath','paused','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yamlConfig','\x0aValidation\x20failed:','setPhase','journeyBundleName','8MGJQeT','\x20deleted','site','targetDir','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','segment\x20or\x20journey','Fetching\x20existing\x20activations...','Delete\x20journey:','\x20YAML\x20files\x20found','nameToType','\x20\x20Journeys:\x20','\x20\x20📊\x20Segments:','\x20\x20Source:\x20','9354yToGgH','Changes\x20to:','getParent','journeyBundleId','buildUserMaps','folders','createdAt','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','connection','audienceId','segment:push','length','Folders\x20to\x20create:','No\x20','Error\x20parsing\x20YAML:\x20','no_parent','New\x20journey:','add','repeat','toString','\x20new','state','journeysOnly','folderPath','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','errorCode','Aborted.','/sb/da/esr','\x20unchanged','created','yes','verbose','parentName','push','yellow','parentSegment','type','segment','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20changes?','name','attributes','segmentFolderId','isNew','\x20\x20Activations:\x20','message','\x20changed','isScoped','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','map','4VjepOr','Delete\x20segment:','filter','new','segments','set','data','Error:\x20Directory\x20not\x20found:\x20','\x20to\x20update','dryRun','Error:\x20','35385840dMmAkG','join','changed','delete','\x0aPush\x20summary\x20for\x20\x27','versionNumber','11518020VgwFDB','Changes\x20to\x20journey:','parentFolder','blue','all','parent_name','\x20\x20Segments:\x20','\x20to\x20create','(Journey\x20will\x20be\x20deleted)','\x0a✔\x20Push\x20complete','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','nameToId','activations','idToName','\x20\x20Activations:','deleted','toUpdate','\x20folders\x20to\x20create','journeys','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)','updated','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20activations]','execute','/j/da/je','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Fetching\x20existing\x20data...','createdSegmentIds','helpText','6431180jgnuIG','\x20\x20\x20\x20','getOutputSchemaWithCache'];a41_0x3194=function(){return _0x2a4bf9;};return a41_0x3194();}const a41_0x38a3d6=a41_0x323d;(function(_0x42e0a0,_0x177d5b){const _0x503975=a41_0x323d,_0x293320=_0x42e0a0();while(!![]){try{const _0x21a801=parseInt(_0x503975(0x111))/0x1+parseInt(_0x503975(0xa8))/0x2*(parseInt(_0x503975(0x93))/0x3)+-parseInt(_0x503975(0xdb))/0x4*(parseInt(_0x503975(0x114))/0x5)+parseInt(_0x503975(0x8f))/0x6+parseInt(_0x503975(0x10a))/0x7+parseInt(_0x503975(0x9b))/0x8*(parseInt(_0x503975(0xec))/0x9)+-parseInt(_0x503975(0xe6))/0xa;if(_0x21a801===_0x177d5b)break;else _0x293320['push'](_0x293320['shift']());}catch(_0x3ee77e){_0x293320['push'](_0x293320['shift']());}}}(a41_0x3194,0xb73c6));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';function a41_0x323d(_0x3567fb,_0x10fbae){_0x3567fb=_0x3567fb-0x7e;const _0x319430=a41_0x3194();let _0x323dc2=_0x319430[_0x3567fb];return _0x323dc2;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x492237 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_0x38a3d6(0xd1)]=a41_0x38a3d6(0xb2);[a41_0x38a3d6(0x116)]=a41_0x38a3d6(0xc1);async[a41_0x38a3d6(0x104)](_0x16e7c2){const _0x46782e=a41_0x38a3d6,{options:_0x41b856,args:_0x2aa4d9,tdx:_0x3fcacc}=_0x16e7c2,_0x419de6=_0x41b856,_0x46c569=await resolveTarget({'arg':_0x2aa4d9[0x0],'contextParent':_0x41b856[_0x46782e(0xcc)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x46c569))return _0x46c569[_0x46782e(0xc2)]===_0x46782e(0xb7)?(console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xcb)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x46782e(0x119)](_0x46782e(0x100)),console[_0x46782e(0x119)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x46782e(0x119)](_0x46782e(0xf7))):(console['error'](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xe5)+_0x46c569[_0x46782e(0xd6)]+'\x0a')),_0x46c569['helpText']&&console['error'](a41_0x492237[_0x46782e(0x11a)](_0x46c569[_0x46782e(0x109)]))),0x1;if(_0x46c569['type']===_0x46782e(0xf1))return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xe2)+_0x46c569['targetDir']+'\x0a')),console[_0x46782e(0x119)](a41_0x492237['cyan'](_0x46782e(0xd9))),0x1;const _0x5c0639=_0x46c569[_0x46782e(0xc9)],_0x34c122=_0x46c569[_0x46782e(0x9e)],_0x106583=_0x46c569[_0x46782e(0xcd)]==='file'?_0x46c569['filePath']:undefined,_0x2b255d=getScopedDetails(_0x46c569),_0x10a81c=_0x2b255d?.[_0x46782e(0xd8)]??![],_0x575cd0=_0x2b255d?.[_0x46782e(0x94)]??'';if(!existsSync(_0x34c122))return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xe2)+_0x34c122+'\x0a')),console['error'](a41_0x492237[_0x46782e(0x11a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x419de6[_0x46782e(0xc8)]&&(console[_0x46782e(0x119)](_0x46782e(0x11c)+_0x419de6['site']),console[_0x46782e(0x119)](_0x46782e(0x83)+_0x5c0639),console[_0x46782e(0x119)]('Source\x20directory:\x20'+_0x34c122),_0x10a81c&&console[_0x46782e(0x119)]('Scoped\x20to\x20folder:\x20'+_0x575cd0));const _0x30ff48=await withSpinner(_0x46782e(0x84)+_0x5c0639+'\x27...',()=>_0x3fcacc['segment']['resolveParentId'](_0x5c0639),{'verbose':_0x419de6['verbose']}),_0x41e08b=_0x30ff48[_0x46782e(0xe1)],{parentSegmentResult:_0x471212,segmentsResult:_0xa99167,foldersResult:_0x365edc,journeysWithDetailsResult:_0x34740e,userMaps:_0xb8864b}=await withSpinner(_0x46782e(0x107),async()=>{const _0x4e0423=_0x46782e,[_0xe9d1fb,_0x2562b2,_0x4de699,_0x5ae7eb,_0x8ff6af]=await Promise[_0x4e0423(0xf0)]([_0x3fcacc['segment'][_0x4e0423(0xaa)](_0x41e08b),_0x3fcacc[_0x4e0423(0xce)]['listSegments'](_0x41e08b),_0x3fcacc[_0x4e0423(0xce)][_0x4e0423(0x82)](_0x41e08b),_0x3fcacc[_0x4e0423(0x110)]['listJourneysWithDetailsFromParentSegment'](_0x41e08b,{'includeAllVersions':!![]}),_0x3fcacc[_0x4e0423(0x11d)][_0x4e0423(0xac)]()]);return{'parentSegmentResult':_0xe9d1fb,'segmentsResult':_0x2562b2,'foldersResult':_0x4de699,'journeysWithDetailsResult':_0x5ae7eb,'userMaps':_0x8ff6af};},{'verbose':_0x419de6[_0x46782e(0xc8)]})[_0x46782e(0x10f)](_0x49e403=>_0x49e403[_0x46782e(0xe1)]),_0x2d2bfe=_0x471212,_0x16dc91=extractRootFolderId(_0x2d2bfe),_0x427bcb=_0xa99167,_0x3975ed=_0x365edc,{journeys:_0x292b23,activationStepsById:_0x4fc8d5}=_0x34740e,_0x234b5f=new Map(_0x292b23[_0x46782e(0xda)](_0x1eedc3=>[_0x1eedc3['id'],_0x1eedc3])),_0x20a812=_0x292b23[_0x46782e(0xda)](_0x2d9f9e=>({'id':_0x2d9f9e['id'],'name':_0x2d9f9e['attributes'][_0x46782e(0xd1)],'journeyBundleName':_0x2d9f9e['attributes'][_0x46782e(0x9a)]||'','journeyBundleId':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xab)]||'','versionNumber':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xeb)],'description':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0x116)],'state':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xbd)],'paused':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0x95)],'audienceId':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xb1)],'folderId':_0x2d9f9e[_0x46782e(0x81)]?.[_0x46782e(0xee)]?.[_0x46782e(0xe1)]?.['id'],'createdAt':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xae)],'updatedAt':_0x2d9f9e[_0x46782e(0xd2)]['updatedAt']})),{emailToId:_0x58b3b9,idToEmail:_0x540ce7}=_0xb8864b,_0x35116a=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xb7b24c=_0x46782e,_0x156ec6=await _0x3fcacc[_0xb7b24c(0xb0)][_0xb7b24c(0x118)]();return buildConnectionMaps(_0x156ec6);},{'verbose':_0x419de6[_0x46782e(0xc8)]})[_0x46782e(0x10f)](_0x4429a2=>_0x4429a2[_0x46782e(0xe1)]),_0x1e89c6=_0x35116a[_0x46782e(0xf8)],_0x4df79a=_0x35116a[_0x46782e(0xfa)],_0x4cd2a3=_0x35116a[_0x46782e(0xa4)],_0x59baa4={'emailToIdMap':_0x58b3b9,'connectionNameToIdMap':_0x1e89c6,'connectionNameToTypeMap':_0x4cd2a3,'getSchema':_0x1f4f0a=>_0x3fcacc[_0x46782e(0xb0)][_0x46782e(0x10c)](_0x1f4f0a)};let {pathToId:_0x531a8f,idToPath:_0x2073f7}=buildFolderMaps(_0x3975ed);const _0x4fa505=buildSegmentLookupMap(_0x427bcb,_0x2073f7),_0x4ab3ae=buildSegmentNameToIdMap(_0x427bcb),_0x289ad3=buildJourneyBundleLookupMap(_0x20a812,_0x2073f7);let _0x414620;if(_0x106583){if(!_0x106583[_0x46782e(0x8e)]('.yml')&&!_0x106583[_0x46782e(0x8e)](_0x46782e(0x8b)))return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0x96)+_0x106583+'\x0a')),0x1;_0x414620=[_0x106583];}else _0x414620=findYamlFiles(_0x34c122);if(_0x414620[_0x46782e(0xb3)]===0x0)return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0x89)+_0x34c122+'\x0a')),console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0x11a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x228174,_0x26240c;try{const _0x2a1ce3=parseAndClassifyYamlFiles(_0x414620,_0x34c122,{'skipSegments':_0x419de6['journeysOnly']});_0x228174=_0x2a1ce3['segments'],_0x26240c=_0x2a1ce3[_0x46782e(0xff)];const _0x6e1581=validateParsedFiles(_0x2a1ce3,_0x34c122);if(_0x6e1581[_0x46782e(0xb3)]>0x0)return console[_0x46782e(0x119)](a41_0x492237['red'](_0x46782e(0x98))),console['error'](formatValidationErrors(_0x6e1581)),console['error'](a41_0x492237[_0x46782e(0xcb)](_0x46782e(0x9f))),0x1;}catch(_0x567a46){return console['error'](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xb6)+(_0x567a46 instanceof Error?_0x567a46[_0x46782e(0xd6)]:_0x567a46))),0x1;}if(_0x228174['length']===0x0&&_0x26240c[_0x46782e(0xb3)]===0x0){const _0x42e838=_0x419de6['journeysOnly']?_0x46782e(0x110):_0x46782e(0xa0);return console['error'](a41_0x492237[_0x46782e(0xcb)](_0x46782e(0xb5)+_0x42e838+_0x46782e(0xa3))),0x0;}const _0x23ed5b=new Map();_0x427bcb[_0x46782e(0xb3)]>0x0&&!_0x419de6['journeysOnly']&&await withSpinner(_0x46782e(0xa1),async()=>{await batchAsync(_0x427bcb,async _0x1f3885=>{const _0x267802=a41_0x323d,_0x58080f=await _0x3fcacc[_0x267802(0xce)]['listActivations'](_0x41e08b,_0x1f3885['id']);_0x23ed5b[_0x267802(0xe0)](_0x1f3885['id'],_0x58080f);});},{'verbose':_0x419de6[_0x46782e(0xc8)]});const {segmentFiles:_0x3251c0,foldersToCreate:_0xfee179}=await prepareSegmentFiles(_0x228174,{'segmentByFolderAndName':_0x4fa505,'activationsBySegmentId':_0x23ed5b,'folderPathToId':_0x531a8f,'idToEmailMap':_0x540ce7,'connectionIdToNameMap':_0x4df79a},_0x59baa4,_0x10a81c,_0x575cd0),_0x413921=_0x106583?[]:findSegmentsToDelete(_0x427bcb,_0x228174[_0x46782e(0xda)](({yamlConfig:_0x449d1e,folderPath:_0x1b7f06})=>({'yamlConfig':_0x449d1e,'folderPath':resolveTDFolderPath(_0x1b7f06,_0x10a81c,_0x575cd0)})),_0x2073f7,_0x575cd0,_0x10a81c),{journeyFiles:_0x195f4d,foldersToCreate:_0x24adeb}=await withProgressSpinner('Preparing\x20journeys...',async _0x39b6a6=>prepareJourneyFiles(_0x26240c,{'fetchJourney':async _0x3a7517=>_0x3fcacc[_0x46782e(0x110)]['getJourney'](_0x3a7517[_0x46782e(0x86)]),'journeyBundlesByFolderAndName':_0x289ad3,'folderPathToId':_0x531a8f,'idToEmailMap':_0x540ce7,'connectionIdToNameMap':_0x4df79a,'existingSegments':_0x427bcb,'parentId':_0x41e08b,'deps':_0x3fcacc,'progress':{'update':_0x4bdb67=>{const _0x655c2b=_0x46782e;_0x39b6a6[_0x655c2b(0x99)](_0x4bdb67),_0x419de6[_0x655c2b(0xc8)]&&console['error']('\x20\x20'+_0x4bdb67);}},'journeyById':_0x234b5f,'activationStepsById':_0x4fc8d5},_0x10a81c,_0x575cd0),{'verbose':_0x419de6[_0x46782e(0xc8)]})[_0x46782e(0x10f)](_0x344ad7=>_0x344ad7['data']);for(const _0x1a7820 of _0x24adeb){_0xfee179[_0x46782e(0xb9)](_0x1a7820);}const _0x415183=_0x106583?[]:findJourneysToDelete(_0x20a812,_0x26240c[_0x46782e(0xda)](({yamlConfig:_0x3df9e0,folderPath:_0x31806e})=>({'yamlConfig':_0x3df9e0,'folderPath':resolveTDFolderPath(_0x31806e,_0x10a81c,_0x575cd0)})),_0x2073f7,_0x575cd0,_0x10a81c),_0x2206d1=calculatePushStats(_0x3251c0,_0x195f4d,_0xfee179,_0x413921,_0x415183,!!_0x419de6['delete'],!!_0x419de6[_0x46782e(0xbe)]),_0x52227d=_0x2206d1[_0x46782e(0xdf)][_0x46782e(0xde)],_0x9a4be=_0x2206d1[_0x46782e(0xdf)][_0x46782e(0xe8)],_0x562537=_0x2206d1[_0x46782e(0xdf)]['unchanged'],_0xff0b23=_0x2206d1[_0x46782e(0xdf)][_0x46782e(0x88)],_0xb98995=_0x2206d1[_0x46782e(0xad)]['toCreate'],_0x2c9d95=_0x2206d1[_0x46782e(0xff)][_0x46782e(0xde)],_0x52e71c=_0x2206d1[_0x46782e(0xff)][_0x46782e(0xe8)],_0x2bb382=_0x2206d1[_0x46782e(0xff)]['unchanged'],_0x4e5456=_0x2206d1[_0x46782e(0xff)]['toDelete'],_0x28851b=_0x2206d1[_0x46782e(0xf9)][_0x46782e(0xf0)],_0x4f33ba=_0x2206d1[_0x46782e(0xf9)]['toCreate'],_0x5af0fd=_0x2206d1['activations'][_0x46782e(0xfd)],_0x4eae74=_0x2206d1[_0x46782e(0xf9)][_0x46782e(0x88)];console[_0x46782e(0x119)](_0x46782e(0xea)+_0x5c0639+'\x27:');_0xb98995[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)]('\x20\x20'+a41_0x492237[_0x46782e(0xef)]('📁\x20'+_0xb98995[_0x46782e(0xb3)]+_0x46782e(0xfe)));if(!_0x419de6['journeysOnly']){console[_0x46782e(0x119)](_0x46782e(0xa6)),console['error'](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0x113)]('+\x20'+_0x52227d['length']+_0x46782e(0xbc))),console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237['yellow']('~\x20'+_0x9a4be[_0x46782e(0xb3)]+_0x46782e(0xd7)));if(_0xff0b23[_0x46782e(0xb3)]>0x0)console['error']('\x20\x20\x20\x20'+a41_0x492237[_0x46782e(0xf6)]('-\x20'+_0xff0b23[_0x46782e(0xb3)]+_0x46782e(0x7e)));else _0x413921['length']>0x0&&!_0x419de6['delete']&&console[_0x46782e(0x119)]('\x20\x20\x20\x20'+a41_0x492237['dim'](_0x413921['length']+_0x46782e(0x92)));console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0x7f)]('=\x20'+_0x562537[_0x46782e(0xb3)]+_0x46782e(0xc5)));}if(_0x195f4d[_0x46782e(0xb3)]>0x0||_0x415183[_0x46782e(0xb3)]>0x0){console[_0x46782e(0x119)](_0x46782e(0x8d)),console['error'](_0x46782e(0x10b)+a41_0x492237['green']('+\x20'+_0x2c9d95[_0x46782e(0xb3)]+_0x46782e(0xbc))),console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237['yellow']('~\x20'+_0x52e71c[_0x46782e(0xb3)]+'\x20changed'));if(_0x4e5456[_0x46782e(0xb3)]>0x0)console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237['red']('-\x20'+_0x4e5456[_0x46782e(0xb3)]+_0x46782e(0x7e)));else _0x415183[_0x46782e(0xb3)]>0x0&&!_0x419de6[_0x46782e(0xe9)]&&console['error'](_0x46782e(0x10b)+a41_0x492237['dim'](_0x415183[_0x46782e(0xb3)]+_0x46782e(0x92)));console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0x7f)]('=\x20'+_0x2bb382[_0x46782e(0xb3)]+_0x46782e(0xc5)));}_0x28851b['length']>0x0&&!_0x419de6[_0x46782e(0xbe)]&&(console[_0x46782e(0x119)](''),console['error'](_0x46782e(0xfb)),_0x4f33ba[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237['green']('+\x20'+_0x4f33ba['length']+_0x46782e(0xf3))),_0x5af0fd[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0xcb)]('~\x20'+_0x5af0fd[_0x46782e(0xb3)]+_0x46782e(0xe3))),_0x4eae74[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0xf6)]('-\x20'+_0x4eae74[_0x46782e(0xb3)]+_0x46782e(0x7e))));console[_0x46782e(0x119)](_0x46782e(0xa7)+a41_0x492237[_0x46782e(0x11a)](_0x34c122)+'\x0a');if(_0xb98995[_0x46782e(0xb3)]>0x0){console[_0x46782e(0x119)](_0x46782e(0xb4));for(const _0x4aabf9 of _0xb98995){console[_0x46782e(0x119)]('\x20\x20'+a41_0x492237[_0x46782e(0xef)]('+')+'\x20'+_0x4aabf9);}console[_0x46782e(0x119)]('');}if(_0x52227d['length']>0x0&&!_0x419de6[_0x46782e(0xbe)])for(const _0x21bd78 of _0x52227d){const _0x115366=_0x21bd78[_0x46782e(0xbf)]?_0x21bd78[_0x46782e(0xbf)]+'/'+_0x21bd78['yamlConfig'][_0x46782e(0xd1)]:_0x21bd78['yamlConfig'][_0x46782e(0xd1)],_0x229f08=_0x21bd78[_0x46782e(0x97)][_0x46782e(0xf9)]?.['length']||0x0,_0x1a3814=_0x229f08>0x0?a41_0x492237[_0x46782e(0x7f)]('\x20['+_0x229f08+_0x46782e(0x103)):'';console[_0x46782e(0x119)]('\x0a'+a41_0x492237['green'](_0x46782e(0x90))+'\x20'+_0x115366+_0x1a3814),console['error']('─'[_0x46782e(0xba)](0x3c)),_0x21bd78['diff']&&console[_0x46782e(0x119)](_0x21bd78['diff']),console[_0x46782e(0x119)]('─'['repeat'](0x3c));}if(_0xff0b23[_0x46782e(0xb3)]>0x0&&!_0x419de6['journeysOnly'])for(const _0x359325 of _0xff0b23){const _0x2203ce=_0x359325[_0x46782e(0xd3)]?_0x2073f7[_0x46782e(0x8c)](_0x359325[_0x46782e(0xd3)][_0x46782e(0xbb)]())||'':'',_0x37f981=_0x2203ce?_0x2203ce+'/'+_0x359325['name']:_0x359325[_0x46782e(0xd1)],_0x4db476=_0x23ed5b[_0x46782e(0x8c)](_0x359325['id'])||[],_0x1bd876=_0x4db476['length']>0x0?a41_0x492237[_0x46782e(0x7f)]('\x20['+_0x4db476[_0x46782e(0xb3)]+'\x20activations]'):'';console['error']('\x0a'+a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xdc))+'\x20'+_0x37f981+_0x1bd876),console['error']('─'['repeat'](0x3c));const _0x5ab4f1=segmentWithActivationsToYaml(_0x359325,_0x4db476,undefined,_0x540ce7,_0x4df79a),_0x592217=segmentToYamlString(_0x5ab4f1),_0x1f27d5=generateDiff(_0x592217,'');console[_0x46782e(0x119)](formatDiffWithColors(_0x1f27d5)),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}const _0x33e4a0=_0x3251c0[_0x46782e(0xdd)](_0x46b315=>!_0x46b315['isNew']&&_0x46b315[_0x46782e(0x11b)]);if(_0x33e4a0['length']>0x0&&!_0x419de6[_0x46782e(0xbe)])for(const _0x32233e of _0x33e4a0){const _0x32b64a=_0x32233e[_0x46782e(0xbf)]?_0x32233e['folderPath']+'/'+_0x32233e[_0x46782e(0x97)]['name']:_0x32233e[_0x46782e(0x97)][_0x46782e(0xd1)];console[_0x46782e(0x119)]('\x0a'+a41_0x492237[_0x46782e(0xcb)](_0x46782e(0xa9))+'\x20'+_0x32b64a),console[_0x46782e(0x119)]('─'['repeat'](0x3c)),console[_0x46782e(0x119)](_0x32233e[_0x46782e(0x11b)]),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}if(_0x2c9d95['length']>0x0)for(const _0x3a8e70 of _0x2c9d95){const _0x8d2fa6=_0x3a8e70[_0x46782e(0xbf)]?_0x3a8e70[_0x46782e(0xbf)]+'/'+_0x3a8e70['yamlConfig'][_0x46782e(0xd1)]:_0x3a8e70['yamlConfig'][_0x46782e(0xd1)];console[_0x46782e(0x119)]('\x0a'+a41_0x492237['green'](_0x46782e(0xb8))+'\x20'+_0x8d2fa6),console[_0x46782e(0x119)]('─'['repeat'](0x3c)),_0x3a8e70[_0x46782e(0x11b)]&&console[_0x46782e(0x119)](_0x3a8e70[_0x46782e(0x11b)]),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}const _0x3f63d5=_0x195f4d[_0x46782e(0xdd)](_0x47dafe=>!_0x47dafe[_0x46782e(0xd4)]&&_0x47dafe['diff']);if(_0x3f63d5[_0x46782e(0xb3)]>0x0)for(const _0x564d8d of _0x3f63d5){const _0x3b0a7f=_0x564d8d[_0x46782e(0xbf)]?_0x564d8d[_0x46782e(0xbf)]+'/'+_0x564d8d['yamlConfig'][_0x46782e(0xd1)]:_0x564d8d[_0x46782e(0x97)][_0x46782e(0xd1)];console['error']('\x0a'+a41_0x492237[_0x46782e(0xcb)](_0x46782e(0xed))+'\x20'+_0x3b0a7f),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c)),console[_0x46782e(0x119)](_0x564d8d[_0x46782e(0x11b)]),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}if(_0x4e5456['length']>0x0)for(const _0x5636cc of _0x4e5456){const _0x1d78f2=_0x5636cc[_0x46782e(0x80)]?_0x2073f7[_0x46782e(0x8c)](_0x5636cc['folderId'])||'':'',_0x14c195=_0x1d78f2?_0x1d78f2+'/'+_0x5636cc['journeyBundleName']:_0x5636cc['journeyBundleName'];console[_0x46782e(0x119)]('\x0a'+a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xa2))+'\x20'+_0x14c195),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c)),console['error'](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xf4))),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}if(_0x419de6[_0x46782e(0xe4)])return console[_0x46782e(0x119)](a41_0x492237['yellow'](_0x46782e(0xc0))),0x0;const _0x4db75d=_0x419de6[_0x46782e(0xbe)]?![]:_0x52227d[_0x46782e(0xb3)]>0x0||_0x9a4be['length']>0x0||_0xff0b23['length']>0x0,_0x79657f=_0x2c9d95[_0x46782e(0xb3)]>0x0||_0x52e71c[_0x46782e(0xb3)]>0x0||_0x4e5456[_0x46782e(0xb3)]>0x0,_0x4f8eb4=_0x419de6[_0x46782e(0xbe)]?![]:_0x28851b[_0x46782e(0xb3)]>0x0,_0x2d9ff4=_0xb98995[_0x46782e(0xb3)]>0x0;if(!_0x4db75d&&!_0x79657f&&!_0x4f8eb4&&!_0x2d9ff4){const _0x5f4242=_0x419de6[_0x46782e(0xbe)]?_0x46782e(0x106):_0x46782e(0x102);console[_0x46782e(0x119)](a41_0x492237['green'](_0x5f4242));if(_0x106583&&_0x562537[_0x46782e(0xb3)]===0x1){const _0x4edfda=_0x562537[0x0];if(_0x4edfda[_0x46782e(0x91)]?.['id']){const _0x1df359=getConsoleNextUrl(_0x419de6[_0x46782e(0x9d)],_0x46782e(0x117)+_0x41e08b+'/e/'+_0x4edfda[_0x46782e(0x91)]['id']+_0x46782e(0xc4));console[_0x46782e(0x119)](_0x46782e(0xaf)+a41_0x492237[_0x46782e(0x11a)](_0x1df359));}}if(_0x106583&&_0x2bb382[_0x46782e(0xb3)]===0x1){const _0x4f284d=_0x2bb382[0x0];if(_0x4f284d[_0x46782e(0x85)]?.['id']){const _0x4dc94b=getConsoleNextUrl(_0x419de6[_0x46782e(0x9d)],_0x46782e(0x117)+_0x41e08b+_0x46782e(0x87)+_0x4f284d[_0x46782e(0x85)]['id']+_0x46782e(0x105));console['error']('\x20\x20'+a41_0x492237['cyan'](_0x4dc94b));}}return 0x0;}const _0x407d41=_0x419de6['journeysOnly']?_0x2c9d95[_0x46782e(0xb3)]+_0x52e71c['length']+_0x4e5456[_0x46782e(0xb3)]+_0xb98995[_0x46782e(0xb3)]:_0x52227d[_0x46782e(0xb3)]+_0x9a4be[_0x46782e(0xb3)]+_0xff0b23[_0x46782e(0xb3)]+_0x2c9d95['length']+_0x52e71c[_0x46782e(0xb3)]+_0x4e5456['length']+_0xb98995[_0x46782e(0xb3)]+_0x28851b[_0x46782e(0xb3)];if(!_0x419de6[_0x46782e(0xc7)]&&_0x407d41>0x0){if(!isInteractive())return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0x10e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a41_0x492237['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5b8706=await confirmKey(_0x46782e(0x112)+_0x407d41+_0x46782e(0xd0));if(!_0x5b8706)return console[_0x46782e(0x119)](a41_0x492237['yellow'](_0x46782e(0xc3))),0x1;}const _0x169816={'withProgress':async(_0x2d2359,_0x1d007d)=>{const _0x181a15=_0x46782e,_0x4aa91b=await withSpinner(_0x2d2359,_0x1d007d,{'verbose':_0x419de6[_0x181a15(0xc8)]});return{'data':_0x4aa91b['data']};},'logInfo':_0x41160f=>console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xef)]('✔\x20'+_0x41160f)),'logSuccess':_0x4067b5=>console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0x113)]('✔\x20'+_0x4067b5)),'logWarning':_0x4fadbc=>console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xcb)]('⚠\x20'+_0x4fadbc)),'logDeleted':_0x32709b=>console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)]('✔\x20'+_0x32709b))},_0x26453c={'segment':_0x3fcacc['segment'],'journey':_0x3fcacc[_0x46782e(0x110)],'user':_0x3fcacc[_0x46782e(0x11d)],'connection':_0x3fcacc['connection']};_0xb98995[_0x46782e(0xb3)]>0x0&&(_0x531a8f=await executePushFolders(_0x26453c,_0xb98995,_0x531a8f,{'parentId':_0x41e08b},_0x169816));const _0xbd35ae={'rootFolderId':_0x16dc91,'folderPathToId':_0x531a8f,'folderIdToPath':_0x2073f7,'segmentNameToId':_0x4ab3ae,'activationsBySegmentId':_0x23ed5b,'emailToIdMap':_0x58b3b9,'idToEmailMap':_0x540ce7,'connectionNameToIdMap':_0x35116a[_0x46782e(0xf8)],'connectionIdToNameMap':_0x35116a[_0x46782e(0xfa)],'connectionNameToTypeMap':_0x4cd2a3},_0x6588b3=await executePushSegments(_0x26453c,_0x419de6[_0x46782e(0xbe)]?[]:_0x3251c0,_0xbd35ae,{'parentId':_0x41e08b},_0x169816),_0x41cf38=_0x6588b3['created'],_0x5ada58=_0x6588b3[_0x46782e(0x101)],_0x4565db=_0x6588b3[_0x46782e(0xf9)][_0x46782e(0xc6)],_0x115ad2=_0x6588b3[_0x46782e(0xf9)][_0x46782e(0x101)],_0x338828=_0x6588b3['activations'][_0x46782e(0xfc)];let _0x46cb5b;if(_0x106583&&_0x3251c0[_0x46782e(0xb3)]===0x1){const _0xc3ae2c=_0x3251c0[0x0];_0x46cb5b=_0xc3ae2c[_0x46782e(0x91)]?.['id']??_0x6588b3[_0x46782e(0x108)][_0x46782e(0x8c)](_0xc3ae2c[_0x46782e(0x97)]['name']);}const _0x33cdea=await executePushSegmentDeletions(_0x26453c,_0x419de6[_0x46782e(0xbe)]?[]:_0xff0b23,_0x169816);let _0x1d49b0=0x0,_0x31f446=0x0,_0x3632d8=0x0;const _0x61f4c1=new Map(_0x4ab3ae);for(const [_0x40fd63,_0x213d27]of _0x6588b3[_0x46782e(0x108)]){_0x61f4c1['set'](_0x40fd63,_0x213d27);}if(_0x195f4d[_0x46782e(0xb3)]>0x0){const _0x5060f0={..._0xbd35ae,'segmentNameToId':_0x61f4c1,'existingSegments':_0x427bcb,'activationContext':_0x59baa4},_0x122936=await executePushJourneys(_0x26453c,_0x195f4d,_0x5060f0,{'parentId':_0x41e08b,'rootFolderId':_0x16dc91,'verbose':_0x419de6['verbose']},_0x169816);_0x1d49b0=_0x122936[_0x46782e(0xc6)],_0x31f446=_0x122936[_0x46782e(0x101)];if(_0x106583&&_0x122936[_0x46782e(0x10d)][_0x46782e(0xb3)]===0x1){const _0x2bc21a=_0x122936[_0x46782e(0x10d)][0x0];if(_0x2bc21a[_0x46782e(0x86)]){const _0x9c9111=getConsoleNextUrl(_0x419de6['site'],_0x46782e(0x117)+_0x41e08b+'/e/'+_0x2bc21a[_0x46782e(0x86)]+_0x46782e(0x105));console[_0x46782e(0x119)]('\x20\x20'+a41_0x492237[_0x46782e(0x11a)](_0x9c9111));}}}for(const _0x57ffe8 of _0x4e5456){console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xcb)](_0x46782e(0xcf)+_0x57ffe8['journeyBundleName'])),_0x3632d8++;}const _0x5e32b9=[];if(_0x41cf38>0x0)_0x5e32b9[_0x46782e(0xca)](_0x41cf38+_0x46782e(0x115));if(_0x5ada58>0x0)_0x5e32b9[_0x46782e(0xca)](_0x5ada58+_0x46782e(0x8a));if(_0x33cdea>0x0)_0x5e32b9[_0x46782e(0xca)](_0x33cdea+_0x46782e(0x9c));const _0x2fc841=[];if(_0x1d49b0>0x0)_0x2fc841['push'](_0x1d49b0+_0x46782e(0x115));if(_0x31f446>0x0)_0x2fc841[_0x46782e(0xca)](_0x31f446+_0x46782e(0x8a));if(_0x3632d8>0x0)_0x2fc841[_0x46782e(0xca)](_0x3632d8+'\x20deleted');const _0x165fe6=[];if(_0x4565db>0x0)_0x165fe6[_0x46782e(0xca)](_0x4565db+_0x46782e(0x115));if(_0x115ad2>0x0)_0x165fe6['push'](_0x115ad2+_0x46782e(0x8a));if(_0x338828>0x0)_0x165fe6[_0x46782e(0xca)](_0x338828+_0x46782e(0x9c));console['error'](a41_0x492237[_0x46782e(0x113)](_0x46782e(0xf5)));_0x5e32b9[_0x46782e(0xb3)]>0x0&&!_0x419de6['journeysOnly']&&console[_0x46782e(0x119)](_0x46782e(0xf2)+_0x5e32b9[_0x46782e(0xe7)](',\x20'));_0x2fc841[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)](_0x46782e(0xa5)+_0x2fc841[_0x46782e(0xe7)](',\x20'));_0x165fe6[_0x46782e(0xb3)]>0x0&&!_0x419de6[_0x46782e(0xbe)]&&console[_0x46782e(0x119)](_0x46782e(0xd5)+_0x165fe6[_0x46782e(0xe7)](',\x20'));if(_0x46cb5b){const _0x1ee497=getConsoleNextUrl(_0x419de6[_0x46782e(0x9d)],_0x46782e(0x117)+_0x41e08b+_0x46782e(0x87)+_0x46cb5b+_0x46782e(0xc4));console[_0x46782e(0x119)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x492237[_0x46782e(0x11a)](_0x1ee497));}return 0x0;}}
1
+ const a41_0x465aa7=a41_0x3b8f;(function(_0xf61859,_0x1d1297){const _0x3d110a=a41_0x3b8f,_0xee9707=_0xf61859();while(!![]){try{const _0x154b74=-parseInt(_0x3d110a(0x130))/0x1*(-parseInt(_0x3d110a(0x11e))/0x2)+parseInt(_0x3d110a(0x18f))/0x3+-parseInt(_0x3d110a(0x14a))/0x4*(-parseInt(_0x3d110a(0x106))/0x5)+-parseInt(_0x3d110a(0x17f))/0x6+-parseInt(_0x3d110a(0x14e))/0x7+-parseInt(_0x3d110a(0x15a))/0x8+parseInt(_0x3d110a(0x14c))/0x9*(-parseInt(_0x3d110a(0x174))/0xa);if(_0x154b74===_0x1d1297)break;else _0xee9707['push'](_0xee9707['shift']());}catch(_0x1996a4){_0xee9707['push'](_0xee9707['shift']());}}}(a41_0x992a,0x8eb51));function a41_0x3b8f(_0x2cdf20,_0x2c225c){_0x2cdf20=_0x2cdf20-0x102;const _0x992a26=a41_0x992a();let _0x3b8f9d=_0x992a26[_0x2cdf20];return _0x3b8f9d;}import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x38231d from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a41_0x992a(){const _0x5e9c40=['getJourney','existingSegment','New\x20journey:','scopedFolderPath','1965336DWiToD','state','journey','listFolders','\x0aError:','blue','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20\x20Activations:','\x20activations]','parentFolder','idToName','journeyId','data','segment','Resolving\x20parent\x20segment\x20\x27','filePath','72170tmVcSJ','join','length','helpText','attributes','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Preparing\x20journeys...','get','/app/ps/','Parent\x20segment:\x20','versionNumber','parentName','Scoped\x20to\x20folder:\x20','journeyBundleName','\x27...','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','buildUserMaps','error','site','Aborted.','map','(Journey\x20will\x20be\x20deleted)','segment:push','connection','11148uKwdAQ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','createdAt','toDelete','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20\x20Source:\x20','\x20\x20🗺️\x20\x20Journeys:','then','yellow','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getOutputSchemaWithCache','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Site:\x20','parent_name','delete','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','cwd','Error\x20parsing\x20YAML:\x20','197dcGJga','type','/e/','\x20\x20\x20\x20','listActivations','folderPath','journeyBundleId','isScoped','no_parent','\x0a✔\x20Push\x20complete','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20existing\x20data...','dim','\x20folders\x20to\x20create','changed','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Delete\x20journey:','errorCode','.yml','push','\x0aValidation\x20failed:','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)','all','existingJourney','deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','164FHUjnJ','nameToType','9TaYXTI','unchanged','5426029lPaBuA','journeysOnly','segment\x20or\x20journey','yamlConfig','\x20to\x20update','nameToId','created','updatedAt','toCreate','yes','Source\x20directory:\x20','user','3047824wkJeHX','parentSegment','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','verbose','repeat','diff','file','\x20updated','/sb/da/esr','paused','📁\x20','\x20\x20Segments:\x20','isNew','Delete\x20segment:','description','list','name','filter','results','segments','toUpdate','createdSegmentIds','\x20changed','folderId','cyan','1723010BHAodK','\x20created','targetDir','listSegments','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','new','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resolveParentId','\x20deleted','execute','/j/da/je','2592174Pwtsxy','Fetching\x20connections\x20for\x20name\x20resolution...','activations','\x20unchanged','\x20YAML\x20files\x20found','set','journeys','green','\x20to\x20delete','\x20new','folders','updated'];a41_0x992a=function(){return _0x5e9c40;};return a41_0x992a();}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_0x465aa7(0x11c);[a41_0x465aa7(0x169)]=a41_0x465aa7(0x10b);async[a41_0x465aa7(0x17d)](_0x1f8fca){const _0x3fd521=a41_0x465aa7,{options:_0x36f3cd,args:_0x46f68e,tdx:_0x552104}=_0x1f8fca,_0x3dbcb6=_0x36f3cd,_0x237218=await resolveTarget({'arg':_0x46f68e[0x0],'contextParent':_0x36f3cd[_0x3fd521(0x15b)],'cwd':process[_0x3fd521(0x12e)]()});if(!isSuccessfulResolution(_0x237218))return _0x237218[_0x3fd521(0x141)]===_0x3fd521(0x138)?(console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x115))),console[_0x3fd521(0x117)](_0x3fd521(0x145)),console[_0x3fd521(0x117)](_0x3fd521(0x15d)),console[_0x3fd521(0x117)](_0x3fd521(0x11f))):(console['error'](a41_0x38231d[_0x3fd521(0x15c)]('Error:\x20'+_0x237218['message']+'\x0a')),_0x237218[_0x3fd521(0x109)]&&console[_0x3fd521(0x117)](a41_0x38231d['cyan'](_0x237218[_0x3fd521(0x109)]))),0x1;if(_0x237218[_0x3fd521(0x131)]===_0x3fd521(0x12b))return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x13a)+_0x237218[_0x3fd521(0x176)]+'\x0a')),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x173)](_0x3fd521(0x17a))),0x1;const _0x502af3=_0x237218[_0x3fd521(0x111)],_0x4cc3a1=_0x237218[_0x3fd521(0x176)],_0xadd089=_0x237218[_0x3fd521(0x131)]===_0x3fd521(0x161)?_0x237218[_0x3fd521(0x105)]:undefined,_0x2802e9=getScopedDetails(_0x237218),_0x1cbbe0=_0x2802e9?.[_0x3fd521(0x137)]??![],_0xcccc74=_0x2802e9?.[_0x3fd521(0x18e)]??'';if(!existsSync(_0x4cc3a1))return console['error'](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x13a)+_0x4cc3a1+'\x0a')),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x173)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3dbcb6[_0x3fd521(0x15e)]&&(console[_0x3fd521(0x117)](_0x3fd521(0x12a)+_0x3dbcb6[_0x3fd521(0x118)]),console['error'](_0x3fd521(0x10f)+_0x502af3),console[_0x3fd521(0x117)](_0x3fd521(0x158)+_0x4cc3a1),_0x1cbbe0&&console['error'](_0x3fd521(0x112)+_0xcccc74));const _0x50e409=await withSpinner(_0x3fd521(0x104)+_0x502af3+_0x3fd521(0x114),()=>_0x552104[_0x3fd521(0x103)][_0x3fd521(0x17b)](_0x502af3),{'verbose':_0x3dbcb6['verbose']}),_0x1e754f=_0x50e409[_0x3fd521(0x102)],{parentSegmentResult:_0x1a62d9,segmentsResult:_0x5bcae2,foldersResult:_0x4c560b,journeysWithDetailsResult:_0x272a05,userMaps:_0x2de18b}=await withSpinner(_0x3fd521(0x13b),async()=>{const _0xcc3341=_0x3fd521,[_0x4b4139,_0x18260e,_0x2cddef,_0x15c78e,_0x435d45]=await Promise[_0xcc3341(0x146)]([_0x552104[_0xcc3341(0x103)]['getParent'](_0x1e754f),_0x552104[_0xcc3341(0x103)][_0xcc3341(0x177)](_0x1e754f),_0x552104[_0xcc3341(0x103)][_0xcc3341(0x192)](_0x1e754f),_0x552104[_0xcc3341(0x191)]['listJourneysWithDetailsFromParentSegment'](_0x1e754f,{'includeAllVersions':!![]}),_0x552104[_0xcc3341(0x159)][_0xcc3341(0x116)]()]);return{'parentSegmentResult':_0x4b4139,'segmentsResult':_0x18260e,'foldersResult':_0x2cddef,'journeysWithDetailsResult':_0x15c78e,'userMaps':_0x435d45};},{'verbose':_0x3dbcb6[_0x3fd521(0x15e)]})['then'](_0x1132b9=>_0x1132b9[_0x3fd521(0x102)]),_0x1e33d5=_0x1a62d9,_0x18e5eb=extractRootFolderId(_0x1e33d5),_0x5546cd=_0x5bcae2,_0x3be49f=_0x4c560b,{journeys:_0x55a1f4,activationStepsById:_0x5bbfd9}=_0x272a05,_0x887269=new Map(_0x55a1f4[_0x3fd521(0x11a)](_0x64da3f=>[_0x64da3f['id'],_0x64da3f])),_0x300c67=_0x55a1f4['map'](_0x50f124=>({'id':_0x50f124['id'],'name':_0x50f124[_0x3fd521(0x10a)]['name'],'journeyBundleName':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x113)]||'','journeyBundleId':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x136)]||'','versionNumber':_0x50f124['attributes'][_0x3fd521(0x110)],'description':_0x50f124[_0x3fd521(0x10a)]['description'],'state':_0x50f124['attributes'][_0x3fd521(0x190)],'paused':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x164)],'audienceId':_0x50f124[_0x3fd521(0x10a)]['audienceId'],'folderId':_0x50f124['relationships']?.[_0x3fd521(0x198)]?.[_0x3fd521(0x102)]?.['id'],'createdAt':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x120)],'updatedAt':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x155)]})),{emailToId:_0x9c44c1,idToEmail:_0x57358f}=_0x2de18b,_0x52ec0d=await withSpinner(_0x3fd521(0x180),async()=>{const _0x578e99=_0x3fd521,_0x4f3732=await _0x552104['connection'][_0x578e99(0x16a)]();return buildConnectionMaps(_0x4f3732);},{'verbose':_0x3dbcb6[_0x3fd521(0x15e)]})['then'](_0x3c4f7f=>_0x3c4f7f[_0x3fd521(0x102)]),_0x1baffa=_0x52ec0d[_0x3fd521(0x153)],_0x4c7a58=_0x52ec0d[_0x3fd521(0x199)],_0x54227a=_0x52ec0d[_0x3fd521(0x14b)],_0x3cb77d={'emailToIdMap':_0x9c44c1,'connectionNameToIdMap':_0x1baffa,'connectionNameToTypeMap':_0x54227a,'getSchema':_0x2a8a80=>_0x552104['connection'][_0x3fd521(0x128)](_0x2a8a80)};let {pathToId:_0x51b53e,idToPath:_0x882df4}=buildFolderMaps(_0x3be49f);const _0x1bfc26=buildSegmentLookupMap(_0x5546cd,_0x882df4),_0x26fbe9=buildSegmentNameToIdMap(_0x5546cd),_0x10cce2=buildJourneyBundleLookupMap(_0x300c67,_0x882df4);let _0x138bfc;if(_0xadd089){if(!_0xadd089['endsWith'](_0x3fd521(0x142))&&!_0xadd089['endsWith']('.yaml'))return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xadd089+'\x0a')),0x1;_0x138bfc=[_0xadd089];}else _0x138bfc=findYamlFiles(_0x4cc3a1);if(_0x138bfc[_0x3fd521(0x108)]===0x0)return console[_0x3fd521(0x117)](a41_0x38231d['red'](_0x3fd521(0x178)+_0x4cc3a1+'\x0a')),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x173)](_0x3fd521(0x149))),0x1;let _0x11a8df,_0xe9e400;try{const _0x5aa914=parseAndClassifyYamlFiles(_0x138bfc,_0x4cc3a1,{'skipSegments':_0x3dbcb6[_0x3fd521(0x14f)]});_0x11a8df=_0x5aa914[_0x3fd521(0x16e)],_0xe9e400=_0x5aa914['journeys'];const _0x250086=validateParsedFiles(_0x5aa914,_0x4cc3a1);if(_0x250086[_0x3fd521(0x108)]>0x0)return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x144))),console[_0x3fd521(0x117)](formatValidationErrors(_0x250086)),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x122))),0x1;}catch(_0x24eff3){return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x12f)+(_0x24eff3 instanceof Error?_0x24eff3['message']:_0x24eff3))),0x1;}if(_0x11a8df[_0x3fd521(0x108)]===0x0&&_0xe9e400[_0x3fd521(0x108)]===0x0){const _0x333697=_0x3dbcb6[_0x3fd521(0x14f)]?_0x3fd521(0x191):_0x3fd521(0x150);return console['error'](a41_0x38231d['yellow']('No\x20'+_0x333697+_0x3fd521(0x183))),0x0;}const _0x2eec62=new Map();_0x5546cd[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x5546cd,async _0x11d037=>{const _0x30a89b=a41_0x3b8f,_0x10ba08=await _0x552104[_0x30a89b(0x103)][_0x30a89b(0x134)](_0x1e754f,_0x11d037['id']);_0x2eec62[_0x30a89b(0x184)](_0x11d037['id'],_0x10ba08);});},{'verbose':_0x3dbcb6['verbose']});const {segmentFiles:_0x4d83cc,foldersToCreate:_0x573448}=await prepareSegmentFiles(_0x11a8df,{'segmentByFolderAndName':_0x1bfc26,'activationsBySegmentId':_0x2eec62,'folderPathToId':_0x51b53e,'idToEmailMap':_0x57358f,'connectionIdToNameMap':_0x4c7a58},_0x3cb77d,_0x1cbbe0,_0xcccc74),_0x5d1b64=_0xadd089?[]:findSegmentsToDelete(_0x5546cd,_0x11a8df[_0x3fd521(0x11a)](({yamlConfig:_0xfa3895,folderPath:_0x5a7b1d})=>({'yamlConfig':_0xfa3895,'folderPath':resolveTDFolderPath(_0x5a7b1d,_0x1cbbe0,_0xcccc74)})),_0x882df4,_0xcccc74,_0x1cbbe0),{journeyFiles:_0x3ac0ff,foldersToCreate:_0x32f6e9}=await withProgressSpinner(_0x3fd521(0x10c),async _0x5ed6fc=>prepareJourneyFiles(_0xe9e400,{'fetchJourney':async _0x1dfef3=>_0x552104[_0x3fd521(0x191)][_0x3fd521(0x18b)](_0x1dfef3['journeyId']),'journeyBundlesByFolderAndName':_0x10cce2,'folderPathToId':_0x51b53e,'idToEmailMap':_0x57358f,'connectionIdToNameMap':_0x4c7a58,'existingSegments':_0x5546cd,'parentId':_0x1e754f,'deps':_0x552104,'progress':{'update':_0xd053be=>{const _0x455602=_0x3fd521;_0x5ed6fc['setPhase'](_0xd053be),_0x3dbcb6[_0x455602(0x15e)]&&console['error']('\x20\x20'+_0xd053be);}},'journeyById':_0x887269,'activationStepsById':_0x5bbfd9},_0x1cbbe0,_0xcccc74),{'verbose':_0x3dbcb6[_0x3fd521(0x15e)]})[_0x3fd521(0x125)](_0x5e8996=>_0x5e8996[_0x3fd521(0x102)]);for(const _0x1e00c3 of _0x32f6e9){_0x573448['add'](_0x1e00c3);}const _0x1fa50e=_0xadd089?[]:findJourneysToDelete(_0x300c67,_0xe9e400[_0x3fd521(0x11a)](({yamlConfig:_0x56ba47,folderPath:_0x163257})=>({'yamlConfig':_0x56ba47,'folderPath':resolveTDFolderPath(_0x163257,_0x1cbbe0,_0xcccc74)})),_0x882df4,_0xcccc74,_0x1cbbe0),_0x23085a=calculatePushStats(_0x4d83cc,_0x3ac0ff,_0x573448,_0x5d1b64,_0x1fa50e,!!_0x3dbcb6[_0x3fd521(0x12c)],!!_0x3dbcb6[_0x3fd521(0x14f)]),_0x447431=_0x23085a['segments'][_0x3fd521(0x179)],_0x13d17d=_0x23085a[_0x3fd521(0x16e)][_0x3fd521(0x13e)],_0x292594=_0x23085a['segments']['unchanged'],_0x4d7ea5=_0x23085a[_0x3fd521(0x16e)][_0x3fd521(0x121)],_0x2f0ffb=_0x23085a[_0x3fd521(0x189)][_0x3fd521(0x156)],_0x460661=_0x23085a[_0x3fd521(0x185)][_0x3fd521(0x179)],_0x39a6a9=_0x23085a[_0x3fd521(0x185)][_0x3fd521(0x13e)],_0x14209d=_0x23085a[_0x3fd521(0x185)][_0x3fd521(0x14d)],_0x5947d8=_0x23085a[_0x3fd521(0x185)]['toDelete'],_0x1ba839=_0x23085a[_0x3fd521(0x181)][_0x3fd521(0x146)],_0x5646bc=_0x23085a[_0x3fd521(0x181)][_0x3fd521(0x156)],_0x4ab3f8=_0x23085a[_0x3fd521(0x181)][_0x3fd521(0x16f)],_0x2c61b2=_0x23085a['activations'][_0x3fd521(0x121)];console[_0x3fd521(0x117)]('\x0aPush\x20summary\x20for\x20\x27'+_0x502af3+'\x27:');_0x2f0ffb['length']>0x0&&console[_0x3fd521(0x117)]('\x20\x20'+a41_0x38231d[_0x3fd521(0x194)](_0x3fd521(0x165)+_0x2f0ffb[_0x3fd521(0x108)]+_0x3fd521(0x13d)));if(!_0x3dbcb6[_0x3fd521(0x14f)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d['green']('+\x20'+_0x447431[_0x3fd521(0x108)]+_0x3fd521(0x188))),console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x126)]('~\x20'+_0x13d17d[_0x3fd521(0x108)]+_0x3fd521(0x171)));if(_0x4d7ea5[_0x3fd521(0x108)]>0x0)console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x15c)]('-\x20'+_0x4d7ea5['length']+_0x3fd521(0x187)));else _0x5d1b64[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x12c)]&&console['error'](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x13c)](_0x5d1b64[_0x3fd521(0x108)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x3fd521(0x133)+a41_0x38231d['dim']('=\x20'+_0x292594['length']+'\x20unchanged'));}if(_0x3ac0ff[_0x3fd521(0x108)]>0x0||_0x1fa50e['length']>0x0){console[_0x3fd521(0x117)](_0x3fd521(0x124)),console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x186)]('+\x20'+_0x460661[_0x3fd521(0x108)]+_0x3fd521(0x188))),console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d['yellow']('~\x20'+_0x39a6a9[_0x3fd521(0x108)]+_0x3fd521(0x171)));if(_0x5947d8['length']>0x0)console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x15c)]('-\x20'+_0x5947d8['length']+_0x3fd521(0x187)));else _0x1fa50e[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x12c)]&&console['error'](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x13c)](_0x1fa50e[_0x3fd521(0x108)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x13c)]('=\x20'+_0x14209d['length']+_0x3fd521(0x182)));}_0x1ba839[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)]&&(console[_0x3fd521(0x117)](''),console[_0x3fd521(0x117)](_0x3fd521(0x196)),_0x5646bc[_0x3fd521(0x108)]>0x0&&console['error'](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x186)]('+\x20'+_0x5646bc[_0x3fd521(0x108)]+'\x20to\x20create')),_0x4ab3f8[_0x3fd521(0x108)]>0x0&&console[_0x3fd521(0x117)]('\x20\x20\x20\x20'+a41_0x38231d[_0x3fd521(0x126)]('~\x20'+_0x4ab3f8[_0x3fd521(0x108)]+_0x3fd521(0x152))),_0x2c61b2[_0x3fd521(0x108)]>0x0&&console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d['red']('-\x20'+_0x2c61b2[_0x3fd521(0x108)]+_0x3fd521(0x187))));console[_0x3fd521(0x117)](_0x3fd521(0x123)+a41_0x38231d[_0x3fd521(0x173)](_0x4cc3a1)+'\x0a');if(_0x2f0ffb[_0x3fd521(0x108)]>0x0){console[_0x3fd521(0x117)]('Folders\x20to\x20create:');for(const _0x53c4de of _0x2f0ffb){console[_0x3fd521(0x117)]('\x20\x20'+a41_0x38231d['blue']('+')+'\x20'+_0x53c4de);}console[_0x3fd521(0x117)]('');}if(_0x447431[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6['journeysOnly'])for(const _0x1ef66f of _0x447431){const _0x1d108d=_0x1ef66f[_0x3fd521(0x135)]?_0x1ef66f[_0x3fd521(0x135)]+'/'+_0x1ef66f['yamlConfig'][_0x3fd521(0x16b)]:_0x1ef66f['yamlConfig'][_0x3fd521(0x16b)],_0x269478=_0x1ef66f[_0x3fd521(0x151)][_0x3fd521(0x181)]?.[_0x3fd521(0x108)]||0x0,_0x3f79fe=_0x269478>0x0?a41_0x38231d[_0x3fd521(0x13c)]('\x20['+_0x269478+_0x3fd521(0x197)):'';console['error']('\x0a'+a41_0x38231d['green']('New\x20segment:')+'\x20'+_0x1d108d+_0x3f79fe),console['error']('─'[_0x3fd521(0x15f)](0x3c)),_0x1ef66f[_0x3fd521(0x160)]&&console['error'](_0x1ef66f['diff']),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));}if(_0x4d7ea5[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)])for(const _0x5c3dfb of _0x4d7ea5){const _0x405e00=_0x5c3dfb['segmentFolderId']?_0x882df4[_0x3fd521(0x10d)](_0x5c3dfb['segmentFolderId']['toString']())||'':'',_0x48b3aa=_0x405e00?_0x405e00+'/'+_0x5c3dfb[_0x3fd521(0x16b)]:_0x5c3dfb[_0x3fd521(0x16b)],_0x59ab05=_0x2eec62['get'](_0x5c3dfb['id'])||[],_0x2a950f=_0x59ab05[_0x3fd521(0x108)]>0x0?a41_0x38231d[_0x3fd521(0x13c)]('\x20['+_0x59ab05[_0x3fd521(0x108)]+_0x3fd521(0x197)):'';console[_0x3fd521(0x117)]('\x0a'+a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x168))+'\x20'+_0x48b3aa+_0x2a950f),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));const _0x4011db=segmentWithActivationsToYaml(_0x5c3dfb,_0x59ab05,undefined,_0x57358f,_0x4c7a58),_0x230318=segmentToYamlString(_0x4011db),_0x16e9f7=generateDiff(_0x230318,'');console[_0x3fd521(0x117)](formatDiffWithColors(_0x16e9f7)),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));}const _0x482ab3=_0x4d83cc['filter'](_0x3c2d65=>!_0x3c2d65[_0x3fd521(0x167)]&&_0x3c2d65['diff']);if(_0x482ab3['length']>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)])for(const _0x427a6e of _0x482ab3){const _0x2f0fa8=_0x427a6e[_0x3fd521(0x135)]?_0x427a6e[_0x3fd521(0x135)]+'/'+_0x427a6e[_0x3fd521(0x151)][_0x3fd521(0x16b)]:_0x427a6e[_0x3fd521(0x151)][_0x3fd521(0x16b)];console[_0x3fd521(0x117)]('\x0a'+a41_0x38231d[_0x3fd521(0x126)]('Changes\x20to:')+'\x20'+_0x2f0fa8),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c)),console[_0x3fd521(0x117)](_0x427a6e[_0x3fd521(0x160)]),console['error']('─'[_0x3fd521(0x15f)](0x3c));}if(_0x460661[_0x3fd521(0x108)]>0x0)for(const _0x110651 of _0x460661){const _0x21ba2d=_0x110651[_0x3fd521(0x135)]?_0x110651[_0x3fd521(0x135)]+'/'+_0x110651[_0x3fd521(0x151)]['name']:_0x110651[_0x3fd521(0x151)][_0x3fd521(0x16b)];console[_0x3fd521(0x117)]('\x0a'+a41_0x38231d[_0x3fd521(0x186)](_0x3fd521(0x18d))+'\x20'+_0x21ba2d),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c)),_0x110651[_0x3fd521(0x160)]&&console[_0x3fd521(0x117)](_0x110651['diff']),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));}const _0x169b31=_0x3ac0ff[_0x3fd521(0x16c)](_0x45a33c=>!_0x45a33c[_0x3fd521(0x167)]&&_0x45a33c[_0x3fd521(0x160)]);if(_0x169b31['length']>0x0)for(const _0xfafef7 of _0x169b31){const _0x51db0b=_0xfafef7[_0x3fd521(0x135)]?_0xfafef7['folderPath']+'/'+_0xfafef7['yamlConfig'][_0x3fd521(0x16b)]:_0xfafef7[_0x3fd521(0x151)][_0x3fd521(0x16b)];console[_0x3fd521(0x117)]('\x0a'+a41_0x38231d[_0x3fd521(0x126)]('Changes\x20to\x20journey:')+'\x20'+_0x51db0b),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c)),console[_0x3fd521(0x117)](_0xfafef7[_0x3fd521(0x160)]),console[_0x3fd521(0x117)]('─'['repeat'](0x3c));}if(_0x5947d8[_0x3fd521(0x108)]>0x0)for(const _0x29dbd3 of _0x5947d8){const _0x23a3b9=_0x29dbd3[_0x3fd521(0x172)]?_0x882df4[_0x3fd521(0x10d)](_0x29dbd3[_0x3fd521(0x172)])||'':'',_0x279add=_0x23a3b9?_0x23a3b9+'/'+_0x29dbd3[_0x3fd521(0x113)]:_0x29dbd3['journeyBundleName'];console['error']('\x0a'+a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x140))+'\x20'+_0x279add),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c)),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x11b))),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));}if(_0x3dbcb6['dryRun'])return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x13f))),0x0;const _0x152226=_0x3dbcb6['journeysOnly']?![]:_0x447431[_0x3fd521(0x108)]>0x0||_0x13d17d[_0x3fd521(0x108)]>0x0||_0x4d7ea5[_0x3fd521(0x108)]>0x0,_0x3b06b9=_0x460661[_0x3fd521(0x108)]>0x0||_0x39a6a9[_0x3fd521(0x108)]>0x0||_0x5947d8[_0x3fd521(0x108)]>0x0,_0x8f7f6=_0x3dbcb6[_0x3fd521(0x14f)]?![]:_0x1ba839[_0x3fd521(0x108)]>0x0,_0x4c0533=_0x2f0ffb[_0x3fd521(0x108)]>0x0;if(!_0x152226&&!_0x3b06b9&&!_0x8f7f6&&!_0x4c0533){const _0x50cf25=_0x3dbcb6[_0x3fd521(0x14f)]?_0x3fd521(0x195):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a41_0x38231d[_0x3fd521(0x186)](_0x50cf25));if(_0xadd089&&_0x292594['length']===0x1){const _0x2806fd=_0x292594[0x0];if(_0x2806fd[_0x3fd521(0x18c)]?.['id']){const _0x5396b6=getConsoleNextUrl(_0x3dbcb6[_0x3fd521(0x118)],_0x3fd521(0x10e)+_0x1e754f+_0x3fd521(0x132)+_0x2806fd[_0x3fd521(0x18c)]['id']+_0x3fd521(0x163));console['error'](_0x3fd521(0x129)+a41_0x38231d[_0x3fd521(0x173)](_0x5396b6));}}if(_0xadd089&&_0x14209d[_0x3fd521(0x108)]===0x1){const _0x201a1f=_0x14209d[0x0];if(_0x201a1f['existingJourney']?.['id']){const _0x5eb545=getConsoleNextUrl(_0x3dbcb6[_0x3fd521(0x118)],_0x3fd521(0x10e)+_0x1e754f+'/e/'+_0x201a1f[_0x3fd521(0x147)]['id']+_0x3fd521(0x17e));console[_0x3fd521(0x117)]('\x20\x20'+a41_0x38231d[_0x3fd521(0x173)](_0x5eb545));}}return 0x0;}const _0x43575b=_0x3dbcb6[_0x3fd521(0x14f)]?_0x460661[_0x3fd521(0x108)]+_0x39a6a9[_0x3fd521(0x108)]+_0x5947d8[_0x3fd521(0x108)]+_0x2f0ffb[_0x3fd521(0x108)]:_0x447431[_0x3fd521(0x108)]+_0x13d17d[_0x3fd521(0x108)]+_0x4d7ea5[_0x3fd521(0x108)]+_0x460661[_0x3fd521(0x108)]+_0x39a6a9[_0x3fd521(0x108)]+_0x5947d8[_0x3fd521(0x108)]+_0x2f0ffb[_0x3fd521(0x108)]+_0x1ba839[_0x3fd521(0x108)];if(!_0x3dbcb6[_0x3fd521(0x157)]&&_0x43575b>0x0){if(!isInteractive())return console[_0x3fd521(0x117)](a41_0x38231d['red'](_0x3fd521(0x193)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x13c)](_0x3fd521(0x127))),0x1;const _0x2c6843=await confirmKey('Push\x20'+_0x43575b+'\x20changes?');if(!_0x2c6843)return console['error'](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x119))),0x1;}const _0x4ec05e={'withProgress':async(_0x36056e,_0x23acbf)=>{const _0x22234b=_0x3fd521,_0x3e206a=await withSpinner(_0x36056e,_0x23acbf,{'verbose':_0x3dbcb6[_0x22234b(0x15e)]});return{'data':_0x3e206a[_0x22234b(0x102)]};},'logInfo':_0x2320c1=>console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x194)]('✔\x20'+_0x2320c1)),'logSuccess':_0x2d7f96=>console[_0x3fd521(0x117)](a41_0x38231d['green']('✔\x20'+_0x2d7f96)),'logWarning':_0x2c6c7c=>console[_0x3fd521(0x117)](a41_0x38231d['yellow']('⚠\x20'+_0x2c6c7c)),'logDeleted':_0x216caa=>console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)]('✔\x20'+_0x216caa))},_0x58f609={'segment':_0x552104[_0x3fd521(0x103)],'journey':_0x552104[_0x3fd521(0x191)],'user':_0x552104['user'],'connection':_0x552104[_0x3fd521(0x11d)]};_0x2f0ffb[_0x3fd521(0x108)]>0x0&&(_0x51b53e=await executePushFolders(_0x58f609,_0x2f0ffb,_0x51b53e,{'parentId':_0x1e754f},_0x4ec05e));const _0xa9598b={'rootFolderId':_0x18e5eb,'folderPathToId':_0x51b53e,'folderIdToPath':_0x882df4,'segmentNameToId':_0x26fbe9,'activationsBySegmentId':_0x2eec62,'emailToIdMap':_0x9c44c1,'idToEmailMap':_0x57358f,'connectionNameToIdMap':_0x52ec0d[_0x3fd521(0x153)],'connectionIdToNameMap':_0x52ec0d['idToName'],'connectionNameToTypeMap':_0x54227a},_0x27bacd=await executePushSegments(_0x58f609,_0x3dbcb6[_0x3fd521(0x14f)]?[]:_0x4d83cc,_0xa9598b,{'parentId':_0x1e754f},_0x4ec05e),_0x549367=_0x27bacd[_0x3fd521(0x154)],_0x2df2f4=_0x27bacd['updated'],_0x5e9b85=_0x27bacd['activations']['created'],_0x5835e9=_0x27bacd[_0x3fd521(0x181)][_0x3fd521(0x18a)],_0xfd990b=_0x27bacd['activations'][_0x3fd521(0x148)];let _0x5af3df;if(_0xadd089&&_0x4d83cc[_0x3fd521(0x108)]===0x1){const _0x530fff=_0x4d83cc[0x0];_0x5af3df=_0x530fff['existingSegment']?.['id']??_0x27bacd['createdSegmentIds'][_0x3fd521(0x10d)](_0x530fff['yamlConfig'][_0x3fd521(0x16b)]);}const _0x58ddd5=await executePushSegmentDeletions(_0x58f609,_0x3dbcb6[_0x3fd521(0x14f)]?[]:_0x4d7ea5,_0x4ec05e);let _0x12aede=0x0,_0x1c904e=0x0,_0x29ce53=0x0;const _0x27f84a=new Map(_0x26fbe9);for(const [_0x54d16e,_0x326549]of _0x27bacd[_0x3fd521(0x170)]){_0x27f84a[_0x3fd521(0x184)](_0x54d16e,_0x326549);}if(_0x3ac0ff['length']>0x0){const _0x93ae04={..._0xa9598b,'segmentNameToId':_0x27f84a,'existingSegments':_0x5546cd,'activationContext':_0x3cb77d},_0x5af1c8=await executePushJourneys(_0x58f609,_0x3ac0ff,_0x93ae04,{'parentId':_0x1e754f,'rootFolderId':_0x18e5eb,'verbose':_0x3dbcb6[_0x3fd521(0x15e)]},_0x4ec05e);_0x12aede=_0x5af1c8[_0x3fd521(0x154)],_0x1c904e=_0x5af1c8[_0x3fd521(0x18a)];if(_0xadd089&&_0x5af1c8['results']['length']===0x1){const _0x46dda9=_0x5af1c8[_0x3fd521(0x16d)][0x0];if(_0x46dda9[_0x3fd521(0x19a)]){const _0xb3d90a=getConsoleNextUrl(_0x3dbcb6[_0x3fd521(0x118)],'/app/ps/'+_0x1e754f+'/e/'+_0x46dda9[_0x3fd521(0x19a)]+'/j/da/je');console[_0x3fd521(0x117)]('\x20\x20'+a41_0x38231d['cyan'](_0xb3d90a));}}}for(const _0x13d909 of _0x5947d8){console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x12d)+_0x13d909[_0x3fd521(0x113)])),_0x29ce53++;}const _0x17869d=[];if(_0x549367>0x0)_0x17869d[_0x3fd521(0x143)](_0x549367+_0x3fd521(0x175));if(_0x2df2f4>0x0)_0x17869d[_0x3fd521(0x143)](_0x2df2f4+_0x3fd521(0x162));if(_0x58ddd5>0x0)_0x17869d[_0x3fd521(0x143)](_0x58ddd5+_0x3fd521(0x17c));const _0x2466ee=[];if(_0x12aede>0x0)_0x2466ee['push'](_0x12aede+'\x20created');if(_0x1c904e>0x0)_0x2466ee[_0x3fd521(0x143)](_0x1c904e+'\x20updated');if(_0x29ce53>0x0)_0x2466ee[_0x3fd521(0x143)](_0x29ce53+_0x3fd521(0x17c));const _0x26b00f=[];if(_0x5e9b85>0x0)_0x26b00f[_0x3fd521(0x143)](_0x5e9b85+_0x3fd521(0x175));if(_0x5835e9>0x0)_0x26b00f[_0x3fd521(0x143)](_0x5835e9+_0x3fd521(0x162));if(_0xfd990b>0x0)_0x26b00f[_0x3fd521(0x143)](_0xfd990b+'\x20deleted');console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x186)](_0x3fd521(0x139)));_0x17869d[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)]&&console[_0x3fd521(0x117)](_0x3fd521(0x166)+_0x17869d['join'](',\x20'));_0x2466ee[_0x3fd521(0x108)]>0x0&&console[_0x3fd521(0x117)]('\x20\x20Journeys:\x20'+_0x2466ee[_0x3fd521(0x107)](',\x20'));_0x26b00f[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6['journeysOnly']&&console[_0x3fd521(0x117)]('\x20\x20Activations:\x20'+_0x26b00f[_0x3fd521(0x107)](',\x20'));if(_0x5af3df){const _0x5f08e2=getConsoleNextUrl(_0x3dbcb6[_0x3fd521(0x118)],_0x3fd521(0x10e)+_0x1e754f+'/e/'+_0x5af3df+_0x3fd521(0x163));console[_0x3fd521(0x117)](_0x3fd521(0x129)+a41_0x38231d[_0x3fd521(0x173)](_0x5f08e2));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x1c1334=a42_0x4caa;(function(_0x510485,_0x58ff2c){const _0x5c94d4=a42_0x4caa,_0x43b8ad=_0x510485();while(!![]){try{const _0x1ffa55=parseInt(_0x5c94d4(0xcd))/0x1+-parseInt(_0x5c94d4(0xb9))/0x2*(parseInt(_0x5c94d4(0xc3))/0x3)+-parseInt(_0x5c94d4(0xc6))/0x4*(-parseInt(_0x5c94d4(0xe1))/0x5)+-parseInt(_0x5c94d4(0xb8))/0x6*(-parseInt(_0x5c94d4(0xbd))/0x7)+parseInt(_0x5c94d4(0xdf))/0x8*(-parseInt(_0x5c94d4(0xbc))/0x9)+-parseInt(_0x5c94d4(0xda))/0xa+-parseInt(_0x5c94d4(0xbe))/0xb*(-parseInt(_0x5c94d4(0xd4))/0xc);if(_0x1ffa55===_0x58ff2c)break;else _0x43b8ad['push'](_0x43b8ad['shift']());}catch(_0x3573e8){_0x43b8ad['push'](_0x43b8ad['shift']());}}}(a42_0x51e5,0xcaf4d));function a42_0x51e5(){const _0x2b437e=['Resolving\x20folder\x20\x27','10940950hrXFzg','Parent\x20ID:\x20','kind','INTERNAL','Segment\x20ID:\x20','7960rujBWe','Segment\x20ID\x20missing\x20from\x20resolved\x20path','144405IvIUuN','error','folder','segment','parentId','updateSegmentById','ruleFile','yellow','Error:\x20Cannot\x20update\x20','verbose','rule','includes','segmentId','18bGQgCJ','4fvtmUN','Resolved\x20folder\x20ID:\x20','resolvePathToResource','11511lhYByq','1451338wZlwSY','973148pEzmJx','Examples:','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','data','segmentPath','1702998pSaODt','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','execute','44uxGksL','\x27...','length','Resolved\x20type:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','name','\x20\x20\x20Path:\x20','1447352qUqGhw','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','type','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentName','resolveFolderId','✔\x20Updated\x20segment\x20\x27','264YEknFW','Resolved\x20relative\x20path\x20to:\x20','description','Updating\x20segment\x20\x27','Update\x20existing\x20child\x20segment'];a42_0x51e5=function(){return _0x2b437e;};return a42_0x51e5();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x4caa(_0xfd9141,_0x48c616){_0xfd9141=_0xfd9141-0xb3;const _0x51e5ad=a42_0x51e5();let _0x4caaf0=_0x51e5ad[_0xfd9141];return _0x4caaf0;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0xe463aa from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';[a42_0x1c1334(0xd6)]=a42_0x1c1334(0xd8);async[a42_0x1c1334(0xc5)](_0x56c5b0){const _0x1c6d08=a42_0x1c1334;console[_0x1c6d08(0xe2)](a42_0xe463aa[_0x1c6d08(0xe8)](_0x1c6d08(0xc4))),console['error'](a42_0xe463aa[_0x1c6d08(0xe8)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x571e4a,args:_0x30797d,tdx:_0x4492e3}=_0x56c5b0,_0x122fa9=_0x571e4a;if(_0x30797d[_0x1c6d08(0xc8)]===0x0)return console[_0x1c6d08(0xe2)](_0x1c6d08(0xce)),console[_0x1c6d08(0xe2)](_0x1c6d08(0xd0)),console['error'](_0x1c6d08(0xbf)),console['error'](_0x1c6d08(0xc0)),console[_0x1c6d08(0xe2)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x17700e=_0x30797d[0x0],_0x1b01b1=_0x571e4a[_0x1c6d08(0xc2)];let _0x231e59=_0x17700e;_0x1b01b1&&!_0x17700e[_0x1c6d08(0xb6)]('/')&&(_0x231e59=_0x1b01b1+'/'+_0x17700e,_0x122fa9[_0x1c6d08(0xb4)]&&console[_0x1c6d08(0xe2)](_0x1c6d08(0xd5)+_0x231e59));const _0x2f6bce=await withSpinner('Resolving\x20path\x20\x27'+_0x231e59+_0x1c6d08(0xc7),()=>_0x4492e3[_0x1c6d08(0xe4)][_0x1c6d08(0xbb)](_0x231e59),{'verbose':_0x122fa9[_0x1c6d08(0xb4)]}),_0x195fcb=_0x2f6bce[_0x1c6d08(0xc1)];_0x122fa9[_0x1c6d08(0xb4)]&&console['error'](_0x1c6d08(0xc9)+_0x195fcb['type']);if(_0x195fcb[_0x1c6d08(0xcf)]!==_0x1c6d08(0xe4))return console[_0x1c6d08(0xe2)](_0x1c6d08(0xb3)+_0x195fcb[_0x1c6d08(0xcf)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x1c6d08(0xca)),0x1;if(!_0x195fcb[_0x1c6d08(0xb7)])throw new SDKError(ErrorCode[_0x1c6d08(0xdd)],_0x1c6d08(0xe0));const _0x16f5e4=_0x195fcb[_0x1c6d08(0xe5)],_0x38c821=_0x195fcb['segmentId'];_0x122fa9[_0x1c6d08(0xb4)]&&(console['error'](_0x1c6d08(0xdb)+_0x16f5e4),console[_0x1c6d08(0xe2)](_0x1c6d08(0xde)+_0x38c821));let _0x1d5b95;if(_0x122fa9[_0x1c6d08(0xe3)]){const _0x2bda74=_0x122fa9[_0x1c6d08(0xe3)],_0x302986=await withSpinner(_0x1c6d08(0xd9)+_0x2bda74+'\x27...',()=>_0x4492e3[_0x1c6d08(0xe4)][_0x1c6d08(0xd2)](_0x16f5e4,_0x2bda74),{'verbose':_0x122fa9['verbose']});_0x1d5b95=parseInt(_0x302986[_0x1c6d08(0xc1)],0xa),_0x122fa9[_0x1c6d08(0xb4)]&&console[_0x1c6d08(0xe2)](_0x1c6d08(0xba)+_0x1d5b95);}const _0x301b3d=await loadJSONFromOptions(_0x122fa9[_0x1c6d08(0xb5)],_0x122fa9[_0x1c6d08(0xe7)]),_0xf32bae={'name':_0x122fa9[_0x1c6d08(0xcb)],'description':_0x122fa9['description'],'rule':_0x301b3d,'kind':_0x122fa9[_0x1c6d08(0xdc)]!==undefined?parseInt(_0x122fa9[_0x1c6d08(0xdc)],0xa):undefined,'segmentFolderId':_0x1d5b95},_0x29d22f=await withSpinner(_0x1c6d08(0xd7)+_0x195fcb[_0x1c6d08(0xd1)]+_0x1c6d08(0xc7),()=>_0x4492e3[_0x1c6d08(0xe4)][_0x1c6d08(0xe6)](_0x16f5e4,_0x38c821,_0xf32bae),{'verbose':_0x122fa9[_0x1c6d08(0xb4)]}),_0x3ab8b1=_0x29d22f[_0x1c6d08(0xc1)];return console[_0x1c6d08(0xe2)](_0x1c6d08(0xd3)+_0x3ab8b1[_0x1c6d08(0xcb)]+'\x27'),_0x231e59!==_0x17700e&&console[_0x1c6d08(0xe2)](_0x1c6d08(0xcc)+_0x231e59),await handleSDKOutput([_0x3ab8b1],_0x122fa9),0x0;}}
1
+ function a42_0x2d1a(){const _0x3b2ba9=['Update\x20existing\x20child\x20segment','1607665gDNtaf','INTERNAL','Error:\x20Cannot\x20update\x20','execute','segmentId','folder','Resolving\x20path\x20\x27','49372tfMgqp','name','verbose','Resolving\x20folder\x20\x27','parentId','length','segmentPath','Parent\x20ID:\x20','resolveFolderId','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','374VdFNWV','data','segmentName','Segment\x20ID\x20missing\x20from\x20resolved\x20path','yellow','Resolved\x20type:\x20','1IyYseO','\x27...','236301IlBlmI','ruleFile','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','5214PhSSPX','107240BEPByM','description','updateSegmentById','resolvePathToResource','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20\x20Path:\x20','type','4LUpfDP','3710WRCPYg','✔\x20Updated\x20segment\x20\x27','Examples:','error','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Updating\x20segment\x20\x27','912wWuAxc','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','rule','13LIctCZ','2399136rtuZgh','segment','6498ZECrSm'];a42_0x2d1a=function(){return _0x3b2ba9;};return a42_0x2d1a();}const a42_0x4d1d68=a42_0x3f92;(function(_0x236a91,_0x3d2966){const _0x1ddf92=a42_0x3f92,_0x424ec9=_0x236a91();while(!![]){try{const _0x43f323=-parseInt(_0x1ddf92(0x15f))/0x1*(-parseInt(_0x1ddf92(0x14f))/0x2)+parseInt(_0x1ddf92(0x161))/0x3+-parseInt(_0x1ddf92(0x138))/0x4*(-parseInt(_0x1ddf92(0x148))/0x5)+parseInt(_0x1ddf92(0x166))/0x6*(parseInt(_0x1ddf92(0x139))/0x7)+parseInt(_0x1ddf92(0x13f))/0x8*(-parseInt(_0x1ddf92(0x146))/0x9)+-parseInt(_0x1ddf92(0x167))/0xa*(parseInt(_0x1ddf92(0x159))/0xb)+-parseInt(_0x1ddf92(0x144))/0xc*(parseInt(_0x1ddf92(0x143))/0xd);if(_0x43f323===_0x3d2966)break;else _0x424ec9['push'](_0x424ec9['shift']());}catch(_0x128833){_0x424ec9['push'](_0x424ec9['shift']());}}}(a42_0x2d1a,0x3a470));function a42_0x3f92(_0x5be272,_0x56fa87){_0x5be272=_0x5be272-0x137;const _0x2d1aa=a42_0x2d1a();let _0x3f9203=_0x2d1aa[_0x5be272];return _0x3f9203;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x1891d0 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x4d1d68(0x150)]='segment:update';[a42_0x4d1d68(0x168)]=a42_0x4d1d68(0x147);async[a42_0x4d1d68(0x14b)](_0x41a8d9){const _0x54a8c8=a42_0x4d1d68;console[_0x54a8c8(0x13c)](a42_0x1891d0['yellow'](_0x54a8c8(0x165))),console[_0x54a8c8(0x13c)](a42_0x1891d0[_0x54a8c8(0x15d)](_0x54a8c8(0x141)));const {options:_0x59ae9f,args:_0x1b1520,tdx:_0x529320}=_0x41a8d9,_0x50578e=_0x59ae9f;if(_0x1b1520[_0x54a8c8(0x154)]===0x0)return console[_0x54a8c8(0x13c)](_0x54a8c8(0x164)),console[_0x54a8c8(0x13c)](_0x54a8c8(0x16b)),console[_0x54a8c8(0x13c)](_0x54a8c8(0x13b)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x54a8c8(0x13c)](_0x54a8c8(0x140)),0x1;const _0x264073=_0x1b1520[0x0],_0x1ed6d8=_0x59ae9f[_0x54a8c8(0x155)];let _0x3d4f55=_0x264073;_0x1ed6d8&&!_0x264073['includes']('/')&&(_0x3d4f55=_0x1ed6d8+'/'+_0x264073,_0x50578e[_0x54a8c8(0x151)]&&console[_0x54a8c8(0x13c)](_0x54a8c8(0x163)+_0x3d4f55));const _0x4118de=await withSpinner(_0x54a8c8(0x14e)+_0x3d4f55+_0x54a8c8(0x160),()=>_0x529320[_0x54a8c8(0x145)][_0x54a8c8(0x16a)](_0x3d4f55),{'verbose':_0x50578e[_0x54a8c8(0x151)]}),_0x311c3d=_0x4118de['data'];_0x50578e[_0x54a8c8(0x151)]&&console['error'](_0x54a8c8(0x15e)+_0x311c3d[_0x54a8c8(0x137)]);if(_0x311c3d[_0x54a8c8(0x137)]!=='segment')return console['error'](_0x54a8c8(0x14a)+_0x311c3d[_0x54a8c8(0x137)]+_0x54a8c8(0x13d)),console['error'](_0x54a8c8(0x158)),0x1;if(!_0x311c3d[_0x54a8c8(0x14c)])throw new SDKError(ErrorCode[_0x54a8c8(0x149)],_0x54a8c8(0x15c));const _0x4168d7=_0x311c3d[_0x54a8c8(0x153)],_0x583e5b=_0x311c3d[_0x54a8c8(0x14c)];_0x50578e['verbose']&&(console[_0x54a8c8(0x13c)](_0x54a8c8(0x156)+_0x4168d7),console[_0x54a8c8(0x13c)]('Segment\x20ID:\x20'+_0x583e5b));let _0x35aa25;if(_0x50578e[_0x54a8c8(0x14d)]){const _0x528dc8=_0x50578e['folder'],_0x4dfe4a=await withSpinner(_0x54a8c8(0x152)+_0x528dc8+'\x27...',()=>_0x529320[_0x54a8c8(0x145)][_0x54a8c8(0x157)](_0x4168d7,_0x528dc8),{'verbose':_0x50578e['verbose']});_0x35aa25=parseInt(_0x4dfe4a['data'],0xa),_0x50578e[_0x54a8c8(0x151)]&&console[_0x54a8c8(0x13c)]('Resolved\x20folder\x20ID:\x20'+_0x35aa25);}const _0x5624bf=await loadJSONFromOptions(_0x50578e[_0x54a8c8(0x142)],_0x50578e[_0x54a8c8(0x162)]),_0x31ee00={'name':_0x50578e[_0x54a8c8(0x150)],'description':_0x50578e[_0x54a8c8(0x168)],'rule':_0x5624bf,'kind':_0x50578e['kind']!==undefined?parseInt(_0x50578e['kind'],0xa):undefined,'segmentFolderId':_0x35aa25},_0x5ce969=await withSpinner(_0x54a8c8(0x13e)+_0x311c3d[_0x54a8c8(0x15b)]+_0x54a8c8(0x160),()=>_0x529320[_0x54a8c8(0x145)][_0x54a8c8(0x169)](_0x4168d7,_0x583e5b,_0x31ee00),{'verbose':_0x50578e['verbose']}),_0x15ef80=_0x5ce969[_0x54a8c8(0x15a)];return console[_0x54a8c8(0x13c)](_0x54a8c8(0x13a)+_0x15ef80[_0x54a8c8(0x150)]+'\x27'),_0x3d4f55!==_0x264073&&console[_0x54a8c8(0x13c)](_0x54a8c8(0x16c)+_0x3d4f55),await handleSDKOutput([_0x15ef80],_0x50578e),0x0;}}
@@ -1 +1 @@
1
- const a43_0x36ccb3=a43_0x4bcc;(function(_0x7abe2,_0xbb6c28){const _0x23d2a9=a43_0x4bcc,_0x3452b8=_0x7abe2();while(!![]){try{const _0x13547d=-parseInt(_0x23d2a9(0x1dc))/0x1+-parseInt(_0x23d2a9(0x201))/0x2*(-parseInt(_0x23d2a9(0x1f7))/0x3)+-parseInt(_0x23d2a9(0x1e6))/0x4+parseInt(_0x23d2a9(0x1d7))/0x5*(-parseInt(_0x23d2a9(0x1ef))/0x6)+-parseInt(_0x23d2a9(0x1d9))/0x7*(-parseInt(_0x23d2a9(0x206))/0x8)+-parseInt(_0x23d2a9(0x1d4))/0x9+parseInt(_0x23d2a9(0x1de))/0xa*(parseInt(_0x23d2a9(0x1e9))/0xb);if(_0x13547d===_0xbb6c28)break;else _0x3452b8['push'](_0x3452b8['shift']());}catch(_0x52de03){_0x3452b8['push'](_0x3452b8['shift']());}}}(a43_0x4c20,0x99675));import{existsSync,statSync}from'fs';import a43_0x282b99 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a43_0x4bcc(_0x414478,_0xd0cd38){_0x414478=_0x414478-0x1d4;const _0x4c2011=a43_0x4c20();let _0x4bccb2=_0x4c2011[_0x414478];return _0x4bccb2;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x36ccb3(0x1e7)]=a43_0x36ccb3(0x1fa);['description']=a43_0x36ccb3(0x1f2);async[a43_0x36ccb3(0x20d)](_0x410080){const _0x3a284d=a43_0x36ccb3,{options:_0x3b83d8,args:_0x38a8b4,tdx:_0x4ad983}=_0x410080;if(_0x38a8b4[_0x3a284d(0x1fe)]===0x0)return console[_0x3a284d(0x20f)](a43_0x282b99['red']('Error:\x20Path\x20is\x20required\x0a')),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x3a284d(0x20f)](_0x3a284d(0x1ec)),console[_0x3a284d(0x20f)](_0x3a284d(0x20c)),console['error'](_0x3a284d(0x1e8)),console[_0x3a284d(0x20f)](_0x3a284d(0x1dd)),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 _0x266a87=_0x38a8b4[0x0],_0x13e7a5=_0x3b83d8[_0x3a284d(0x1f0)];try{if(_0x266a87==='/')return saveSessionContext({'segment_path':undefined},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99[_0x3a284d(0x20b)](_0x3a284d(0x1e5))),0x0;if(existsSync(_0x266a87)&&statSync(_0x266a87)[_0x3a284d(0x1da)]()){let _0x3ec3eb;try{_0x3ec3eb=findTdxConfig(_0x266a87);}catch{return console[_0x3a284d(0x20f)](a43_0x282b99['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x266a87)),console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x209)](_0x3a284d(0x1f8))),0x1;}const _0x4dc255=_0x3ec3eb[_0x3a284d(0x1e1)][_0x3a284d(0x208)];return saveSessionContext({'segment_path':_0x4dc255,'parent_segment':_0x4dc255},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99[_0x3a284d(0x20b)]('✔\x20Context\x20set\x20to:\x20'+a43_0x282b99[_0x3a284d(0x209)](_0x4dc255))),0x0;}const _0x2fbcab=_0x3b83d8[_0x3a284d(0x205)];let _0x558834=_0x266a87;const _0x12328d=parsePath(_0x266a87);if(!_0x12328d['isAbsolute']){if(!_0x2fbcab)return console[_0x3a284d(0x20f)](a43_0x282b99['red'](_0x3a284d(0x200))),console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x209)](_0x3a284d(0x1d6))),0x1;if(_0x266a87==='..'){const _0x5b08e0=_0x2fbcab[_0x3a284d(0x1f4)]('/')[_0x3a284d(0x202)](0x0,-0x1)[_0x3a284d(0x1ff)]('/');_0x558834=_0x5b08e0||'/';}else _0x266a87==='.'?_0x558834=_0x2fbcab:_0x558834=_0x2fbcab+'/'+_0x266a87;_0x3b83d8[_0x3a284d(0x1f5)]&&console[_0x3a284d(0x20f)]('Resolved\x20relative\x20path\x20to:\x20'+_0x558834);}if(_0x558834==='/'||_0x558834==='')return saveSessionContext({'segment_path':undefined},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99[_0x3a284d(0x20b)](_0x3a284d(0x1e5))),0x0;_0x558834=normalizePath(_0x558834);const _0x1afcff=parsePath(_0x558834)[_0x3a284d(0x20a)];if(_0x1afcff[_0x3a284d(0x1fe)]===0x0)return saveSessionContext({'segment_path':undefined},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99[_0x3a284d(0x20b)](_0x3a284d(0x1e5))),0x0;_0x3b83d8['verbose']&&(console[_0x3a284d(0x20f)](_0x3a284d(0x1e4)+_0x3b83d8[_0x3a284d(0x1df)]),console[_0x3a284d(0x20f)](_0x3a284d(0x1fc)+_0x558834));const _0x1a92b4=await withSpinner(_0x3a284d(0x210)+_0x558834+_0x3a284d(0x1ed),()=>_0x4ad983[_0x3a284d(0x1e2)][_0x3a284d(0x1fd)](_0x558834),{'verbose':_0x3b83d8['verbose']}),_0x40dc6c=_0x1a92b4[_0x3a284d(0x1ea)];_0x3b83d8[_0x3a284d(0x1f5)]&&(console[_0x3a284d(0x20f)](_0x3a284d(0x20e)+_0x40dc6c[_0x3a284d(0x1eb)]),console[_0x3a284d(0x20f)](_0x3a284d(0x1ee)+_0x40dc6c[_0x3a284d(0x1e3)]),_0x40dc6c['folderId']&&console[_0x3a284d(0x20f)](_0x3a284d(0x212)+_0x40dc6c[_0x3a284d(0x1f9)]));if(_0x40dc6c[_0x3a284d(0x1eb)]===_0x3a284d(0x1e2))return console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x1fb)](_0x3a284d(0x211))),console[_0x3a284d(0x20f)](_0x3a284d(0x1d5)),console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x209)](_0x3a284d(0x1e0)+_0x40dc6c[_0x3a284d(0x1f6)]+(_0x40dc6c[_0x3a284d(0x1db)]?'/'+_0x40dc6c[_0x3a284d(0x1db)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x40dc6c[_0x3a284d(0x1f3)],'parent_segment':_0x40dc6c[_0x3a284d(0x1f6)]},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99['green'](_0x3a284d(0x1f1)+a43_0x282b99[_0x3a284d(0x209)](_0x40dc6c[_0x3a284d(0x1f3)]))),_0x3b83d8[_0x3a284d(0x1f5)]&&(console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x204)](_0x3a284d(0x1d8))),console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x204)](_0x3a284d(0x203)))),0x0;}catch(_0x146690){throw _0x146690;}}}function a43_0x4c20(){const _0xb61c46=['segments','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','execute','Resolved\x20path\x20type:\x20','error','Resolving\x20path\x20\x27','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Folder\x20ID:\x20','5553558yFIErG','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','105sOyHbQ','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','62349pzePWT','isDirectory','folderPath','478465qlqSAw','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','20HayKfG','site','Use:\x20tdx\x20segment\x20use\x20','config','segment','parentId','Site:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','1727740CjLgHC','name','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','5790257IbHZBH','data','type','Examples:','\x27...','Parent\x20ID:\x20','113070cJNKoG','session','✔\x20Context\x20set\x20to:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','fullPath','split','verbose','parentName','3qDDmzG','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','folderId','segment:use','red','Target\x20path:\x20','resolvePathToResource','length','join','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','1162706QzKuJG','slice','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','dim','segmentPath','824DiENVc','log','parent_segment','cyan'];a43_0x4c20=function(){return _0xb61c46;};return a43_0x4c20();}
1
+ const a43_0xcb7863=a43_0x3312;function a43_0x3312(_0x1fad26,_0x211eb1){_0x1fad26=_0x1fad26-0x151;const _0xcfb93d=a43_0xcfb9();let _0x331245=_0xcfb93d[_0x1fad26];return _0x331245;}(function(_0x32b838,_0x1c5231){const _0x53ca65=a43_0x3312,_0x445019=_0x32b838();while(!![]){try{const _0x4e4462=-parseInt(_0x53ca65(0x156))/0x1*(parseInt(_0x53ca65(0x16b))/0x2)+-parseInt(_0x53ca65(0x152))/0x3*(parseInt(_0x53ca65(0x181))/0x4)+parseInt(_0x53ca65(0x15a))/0x5+-parseInt(_0x53ca65(0x169))/0x6+-parseInt(_0x53ca65(0x175))/0x7*(parseInt(_0x53ca65(0x155))/0x8)+parseInt(_0x53ca65(0x16c))/0x9+parseInt(_0x53ca65(0x163))/0xa;if(_0x4e4462===_0x1c5231)break;else _0x445019['push'](_0x445019['shift']());}catch(_0x3d28a6){_0x445019['push'](_0x445019['shift']());}}}(a43_0xcfb9,0xab0dc));import{existsSync,statSync}from'fs';import a43_0x3d44a6 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0xcfb9(){const _0x3521f3=['segments','config','Resolved\x20path\x20type:\x20','parentName','error','Target\x20path:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','55323sFdiHD','execute','segmentPath','432GHKNpB','132367eSltjt','split','isDirectory','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','6917195iVcwKx','Resolved\x20relative\x20path\x20to:\x20','folderPath','log','length','✔\x20Context\x20set\x20to:\x20','name','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','green','30087020tLmkPQ','segment','join','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','description','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','7815810EUNnNZ','red','2sJDkJw','19395IYpUwk','Folder\x20ID:\x20','Examples:','resolvePathToResource','dim','type','verbose','cyan','fullPath','120673UQYOOR','isAbsolute','parent_segment','session','Use:\x20tdx\x20segment\x20use\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x27...','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','folderId','Site:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','288bqMWJX'];a43_0xcfb9=function(){return _0x3521f3;};return a43_0xcfb9();}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_0xcb7863(0x160)]='segment:use';[a43_0xcb7863(0x167)]=a43_0xcb7863(0x166);async[a43_0xcb7863(0x153)](_0x1e1656){const _0x5bf5cb=a43_0xcb7863,{options:_0x1a0349,args:_0x45a40b,tdx:_0x39fc85}=_0x1e1656;if(_0x45a40b[_0x5bf5cb(0x15e)]===0x0)return console[_0x5bf5cb(0x186)](a43_0x3d44a6[_0x5bf5cb(0x16a)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x5bf5cb(0x186)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x5bf5cb(0x186)](_0x5bf5cb(0x16e)),console['error'](_0x5bf5cb(0x159)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console[_0x5bf5cb(0x186)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x5bf5cb(0x151)),0x1;const _0x455435=_0x45a40b[0x0],_0x2d85c7=_0x1a0349[_0x5bf5cb(0x178)];try{if(_0x455435==='/')return saveSessionContext({'segment_path':undefined},_0x2d85c7),console[_0x5bf5cb(0x15d)](a43_0x3d44a6[_0x5bf5cb(0x162)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x455435)&&statSync(_0x455435)[_0x5bf5cb(0x158)]()){let _0x5ae8d7;try{_0x5ae8d7=findTdxConfig(_0x455435);}catch{return console[_0x5bf5cb(0x186)](a43_0x3d44a6['red'](_0x5bf5cb(0x17d)+_0x455435)),console[_0x5bf5cb(0x186)](a43_0x3d44a6[_0x5bf5cb(0x173)](_0x5bf5cb(0x17a))),0x1;}const _0x24fd7a=_0x5ae8d7[_0x5bf5cb(0x183)][_0x5bf5cb(0x177)];return saveSessionContext({'segment_path':_0x24fd7a,'parent_segment':_0x24fd7a},_0x2d85c7),console[_0x5bf5cb(0x15d)](a43_0x3d44a6['green'](_0x5bf5cb(0x15f)+a43_0x3d44a6[_0x5bf5cb(0x173)](_0x24fd7a))),0x0;}const _0x37a7b3=_0x1a0349[_0x5bf5cb(0x154)];let _0x1b160c=_0x455435;const _0x50a144=parsePath(_0x455435);if(!_0x50a144[_0x5bf5cb(0x176)]){if(!_0x37a7b3)return console[_0x5bf5cb(0x186)](a43_0x3d44a6[_0x5bf5cb(0x16a)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console['error'](a43_0x3d44a6[_0x5bf5cb(0x173)](_0x5bf5cb(0x180))),0x1;if(_0x455435==='..'){const _0x2900c4=_0x37a7b3[_0x5bf5cb(0x157)]('/')['slice'](0x0,-0x1)[_0x5bf5cb(0x165)]('/');_0x1b160c=_0x2900c4||'/';}else _0x455435==='.'?_0x1b160c=_0x37a7b3:_0x1b160c=_0x37a7b3+'/'+_0x455435;_0x1a0349[_0x5bf5cb(0x172)]&&console[_0x5bf5cb(0x186)](_0x5bf5cb(0x15b)+_0x1b160c);}if(_0x1b160c==='/'||_0x1b160c==='')return saveSessionContext({'segment_path':undefined},_0x2d85c7),console[_0x5bf5cb(0x15d)](a43_0x3d44a6['green'](_0x5bf5cb(0x168))),0x0;_0x1b160c=normalizePath(_0x1b160c);const _0x1d41d2=parsePath(_0x1b160c)[_0x5bf5cb(0x182)];if(_0x1d41d2[_0x5bf5cb(0x15e)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2d85c7),console[_0x5bf5cb(0x15d)](a43_0x3d44a6[_0x5bf5cb(0x162)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x1a0349[_0x5bf5cb(0x172)]&&(console[_0x5bf5cb(0x186)](_0x5bf5cb(0x17f)+_0x1a0349['site']),console[_0x5bf5cb(0x186)](_0x5bf5cb(0x187)+_0x1b160c));const _0x30dba8=await withSpinner('Resolving\x20path\x20\x27'+_0x1b160c+_0x5bf5cb(0x17c),()=>_0x39fc85[_0x5bf5cb(0x164)][_0x5bf5cb(0x16f)](_0x1b160c),{'verbose':_0x1a0349['verbose']}),_0x22582=_0x30dba8['data'];_0x1a0349[_0x5bf5cb(0x172)]&&(console[_0x5bf5cb(0x186)](_0x5bf5cb(0x184)+_0x22582['type']),console[_0x5bf5cb(0x186)]('Parent\x20ID:\x20'+_0x22582['parentId']),_0x22582[_0x5bf5cb(0x17e)]&&console['error'](_0x5bf5cb(0x16d)+_0x22582[_0x5bf5cb(0x17e)]));if(_0x22582[_0x5bf5cb(0x171)]===_0x5bf5cb(0x164))return console[_0x5bf5cb(0x186)](a43_0x3d44a6[_0x5bf5cb(0x16a)](_0x5bf5cb(0x17b))),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x5bf5cb(0x186)](a43_0x3d44a6[_0x5bf5cb(0x173)](_0x5bf5cb(0x179)+_0x22582[_0x5bf5cb(0x185)]+(_0x22582[_0x5bf5cb(0x15c)]?'/'+_0x22582[_0x5bf5cb(0x15c)][_0x5bf5cb(0x165)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x22582[_0x5bf5cb(0x174)],'parent_segment':_0x22582[_0x5bf5cb(0x185)]},_0x2d85c7),console[_0x5bf5cb(0x15d)](a43_0x3d44a6[_0x5bf5cb(0x162)](_0x5bf5cb(0x15f)+a43_0x3d44a6[_0x5bf5cb(0x173)](_0x22582[_0x5bf5cb(0x174)]))),_0x1a0349[_0x5bf5cb(0x172)]&&(console[_0x5bf5cb(0x186)](a43_0x3d44a6[_0x5bf5cb(0x170)](_0x5bf5cb(0x161))),console[_0x5bf5cb(0x186)](a43_0x3d44a6[_0x5bf5cb(0x170)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x33180d){throw _0x33180d;}}}
@@ -1 +1 @@
1
- function a44_0x54eb(){const _0x2b2a4f=['warningCount','hasErrors','filePath','red','warnings','4936041ymnrXG','file','cyan','endsWith','2DrUhCA','green','targetDir','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yml','error','message','Error:\x20','):\x20','7893486qZTFAg','no_parent','validCount','cwd','✔\x20All\x20','\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','description','Validation\x20failed:\x20','type','length','917997fcuZmh','helpText','33qaoFPR','\x20file(s)\x20valid','30wmcWrP','\x20file(s)\x20with\x20errors,\x20','parentSegment','invalidCount','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','valid','8NSAzCQ','\x20warning(s)\x20found','1888362FBhzsc','yellow','15395770wtaydy','11174212hwQhTQ','5320364gdtAzN','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','dim','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','.yaml','\x20error(s)','\x20valid','log','verbose'];a44_0x54eb=function(){return _0x2b2a4f;};return a44_0x54eb();}const a44_0x35941b=a44_0x33df;function a44_0x33df(_0x13ace9,_0x4f3ae9){_0x13ace9=_0x13ace9-0xed;const _0x54eb56=a44_0x54eb();let _0x33df3a=_0x54eb56[_0x13ace9];return _0x33df3a;}(function(_0xabf468,_0x5c36bc){const _0x59f17d=a44_0x33df,_0x404cbf=_0xabf468();while(!![]){try{const _0x2fc480=-parseInt(_0x59f17d(0x111))/0x1*(-parseInt(_0x59f17d(0xfe))/0x2)+parseInt(_0x59f17d(0xfa))/0x3+-parseInt(_0x59f17d(0x121))/0x4+parseInt(_0x59f17d(0x115))/0x5*(parseInt(_0x59f17d(0x11d))/0x6)+parseInt(_0x59f17d(0x120))/0x7+-parseInt(_0x59f17d(0x11b))/0x8*(-parseInt(_0x59f17d(0x107))/0x9)+parseInt(_0x59f17d(0x11f))/0xa*(-parseInt(_0x59f17d(0x113))/0xb);if(_0x2fc480===_0x5c36bc)break;else _0x404cbf['push'](_0x404cbf['shift']());}catch(_0x53edac){_0x404cbf['push'](_0x404cbf['shift']());}}}(a44_0x54eb,0xee57e));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x12c923 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']='segment:validate';[a44_0x35941b(0x10d)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async['execute'](_0x1d3013){const _0x2195e8=a44_0x35941b,{options:_0x1cf531,args:_0x14a088}=_0x1d3013,_0x268274=_0x1cf531,_0x33498b=await resolveTarget({'arg':_0x14a088[0x0],'contextParent':_0x1cf531[_0x2195e8(0x117)],'cwd':process[_0x2195e8(0x10a)]()});if(!isSuccessfulResolution(_0x33498b))return _0x33498b['errorCode']===_0x2195e8(0x108)?(console['error'](a44_0x12c923[_0x2195e8(0x11e)](_0x2195e8(0xef))),console[_0x2195e8(0x103)](_0x2195e8(0x119)),console['error'](_0x2195e8(0x10c)),console['error'](_0x2195e8(0xed))):(console[_0x2195e8(0x103)](a44_0x12c923[_0x2195e8(0xf8)](_0x2195e8(0x105)+_0x33498b[_0x2195e8(0x104)]+'\x0a')),_0x33498b[_0x2195e8(0x112)]&&console[_0x2195e8(0x103)](a44_0x12c923[_0x2195e8(0xfc)](_0x33498b[_0x2195e8(0x112)]))),0x1;const _0x19c8dc=_0x33498b[_0x2195e8(0x100)],_0x249d3c=_0x33498b[_0x2195e8(0x10f)]===_0x2195e8(0xfb)?_0x33498b[_0x2195e8(0xf7)]:undefined;if(!_0x249d3c&&!existsSync(_0x19c8dc))return console['error'](a44_0x12c923[_0x2195e8(0xf8)]('Error:\x20Directory\x20not\x20found:\x20'+_0x19c8dc+'\x0a')),0x1;let _0x57408f;if(_0x249d3c){if(!_0x249d3c[_0x2195e8(0xfd)](_0x2195e8(0x102))&&!_0x249d3c[_0x2195e8(0xfd)](_0x2195e8(0xf0)))return console[_0x2195e8(0x103)](a44_0x12c923['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x249d3c+'\x0a')),0x1;_0x57408f=[_0x249d3c];}else _0x57408f=findYamlFiles(_0x19c8dc);if(_0x57408f[_0x2195e8(0x110)]===0x0)return console[_0x2195e8(0x103)](a44_0x12c923['red'](_0x2195e8(0x101)+_0x19c8dc+'\x0a')),0x1;const _0x22e4e4=validateYamlFiles(_0x57408f,_0x19c8dc),_0x5d158d=calculateSummary(_0x22e4e4);for(const _0xae35f6 of _0x22e4e4){if(!isValidationResult(_0xae35f6))continue;const {relativePath:_0x325f91,source:_0x5453cf,result:_0x2a5506,fileType:_0x4d3551}=_0xae35f6,_0x1fc98a=_0x4d3551;if(_0x2a5506[_0x2195e8(0x11a)]&&_0x2a5506[_0x2195e8(0xf9)]['length']===0x0)_0x268274[_0x2195e8(0xf4)]&&console['log'](a44_0x12c923[_0x2195e8(0xff)]('✔\x20'+_0x325f91)+a44_0x12c923[_0x2195e8(0xee)]('\x20('+_0x1fc98a+')'));else _0x2a5506[_0x2195e8(0x11a)]?(console[_0x2195e8(0xf3)](a44_0x12c923[_0x2195e8(0x11e)]('⚠\x20'+_0x325f91)+a44_0x12c923[_0x2195e8(0xee)]('\x20('+_0x1fc98a+_0x2195e8(0x106)+_0x2a5506[_0x2195e8(0xf9)][_0x2195e8(0x110)]+'\x20warning(s)')),console[_0x2195e8(0xf3)](formatValidationResult(_0x2a5506,_0x5453cf,_0x325f91))):(console['log'](a44_0x12c923[_0x2195e8(0xf8)]('✖\x20'+_0x325f91)+a44_0x12c923[_0x2195e8(0xee)]('\x20('+_0x1fc98a+_0x2195e8(0x106)+_0x2a5506['errors'][_0x2195e8(0x110)]+_0x2195e8(0xf1))),console['log'](formatValidationResult(_0x2a5506,_0x5453cf,_0x325f91)));}return console[_0x2195e8(0xf3)](''),_0x5d158d[_0x2195e8(0xf6)]?(console[_0x2195e8(0xf3)](a44_0x12c923['red'](_0x2195e8(0x10e)+_0x5d158d[_0x2195e8(0x118)]+_0x2195e8(0x116)+_0x5d158d[_0x2195e8(0x109)]+_0x2195e8(0xf2))),_0x5d158d['warningCount']>0x0&&console['log'](a44_0x12c923[_0x2195e8(0x11e)](_0x5d158d[_0x2195e8(0xf5)]+_0x2195e8(0x11c))),0x1):(console['log'](a44_0x12c923[_0x2195e8(0xff)](_0x2195e8(0x10b)+_0x5d158d[_0x2195e8(0x109)]+_0x2195e8(0x114))),_0x5d158d[_0x2195e8(0xf5)]>0x0&&console['log'](a44_0x12c923[_0x2195e8(0x11e)](_0x5d158d[_0x2195e8(0xf5)]+'\x20warning(s)\x20found')),0x0);}}
1
+ const a44_0x1c19bd=a44_0x4b01;function a44_0x38dc(){const _0x17735c=['3047990PTAxQk','304326gbTOYG','Validation\x20failed:\x20','invalidCount','red','12TEgkqh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','hasErrors','Validate\x20segment\x20and\x20journey\x20YAML\x20files','✔\x20All\x20','\x20file(s)\x20with\x20errors,\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','cyan','2383032EctYOG','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','438990LHHgxv','Error:\x20','dim','valid','warnings','2552960ckgXyA','\x20valid','1048lFQXoY','log','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','validCount','yellow','filePath','green','type','parentSegment','endsWith','warningCount','\x20warning(s)\x20found','execute','verbose','errors','helpText','message','error','\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','description','\x20file(s)\x20valid','targetDir','):\x20','errorCode','2968ZGJnEG','Error:\x20Directory\x20not\x20found:\x20','length','no_parent','7035768TNbQis'];a44_0x38dc=function(){return _0x17735c;};return a44_0x38dc();}function a44_0x4b01(_0x5ef36a,_0x3b2e0c){_0x5ef36a=_0x5ef36a-0xdd;const _0x38dcbf=a44_0x38dc();let _0x4b01ce=_0x38dcbf[_0x5ef36a];return _0x4b01ce;}(function(_0x137cb6,_0x4420ad){const _0x1ca086=a44_0x4b01,_0xb60c66=_0x137cb6();while(!![]){try{const _0x4adbf1=-parseInt(_0x1ca086(0x107))/0x1+parseInt(_0x1ca086(0xe2))/0x2*(parseInt(_0x1ca086(0x10b))/0x3)+-parseInt(_0x1ca086(0xe7))/0x4+-parseInt(_0x1ca086(0x106))/0x5+parseInt(_0x1ca086(0xe0))/0x6+parseInt(_0x1ca086(0x101))/0x7*(-parseInt(_0x1ca086(0xe9))/0x8)+parseInt(_0x1ca086(0x105))/0x9;if(_0x4adbf1===_0x4420ad)break;else _0xb60c66['push'](_0xb60c66['shift']());}catch(_0x2fed99){_0xb60c66['push'](_0xb60c66['shift']());}}}(a44_0x38dc,0x6daac));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x153f81 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']='segment:validate';[a44_0x1c19bd(0xfc)]=a44_0x1c19bd(0x10e);async[a44_0x1c19bd(0xf5)](_0x458cb3){const _0x363ec3=a44_0x1c19bd,{options:_0x471bc6,args:_0x48af5b}=_0x458cb3,_0x189b29=_0x471bc6,_0xc0fc6d=await resolveTarget({'arg':_0x48af5b[0x0],'contextParent':_0x471bc6[_0x363ec3(0xf1)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xc0fc6d))return _0xc0fc6d[_0x363ec3(0x100)]===_0x363ec3(0x104)?(console[_0x363ec3(0xfa)](a44_0x153f81['yellow'](_0x363ec3(0xde))),console[_0x363ec3(0xfa)](_0x363ec3(0xe1)),console[_0x363ec3(0xfa)](_0x363ec3(0xfb)),console[_0x363ec3(0xfa)](_0x363ec3(0x10c))):(console[_0x363ec3(0xfa)](a44_0x153f81[_0x363ec3(0x10a)](_0x363ec3(0xe3)+_0xc0fc6d[_0x363ec3(0xf9)]+'\x0a')),_0xc0fc6d[_0x363ec3(0xf8)]&&console[_0x363ec3(0xfa)](a44_0x153f81[_0x363ec3(0xdf)](_0xc0fc6d[_0x363ec3(0xf8)]))),0x1;const _0x2f2ca6=_0xc0fc6d[_0x363ec3(0xfe)],_0x51138b=_0xc0fc6d[_0x363ec3(0xf0)]==='file'?_0xc0fc6d[_0x363ec3(0xee)]:undefined;if(!_0x51138b&&!existsSync(_0x2f2ca6))return console[_0x363ec3(0xfa)](a44_0x153f81[_0x363ec3(0x10a)](_0x363ec3(0x102)+_0x2f2ca6+'\x0a')),0x1;let _0x58ad01;if(_0x51138b){if(!_0x51138b[_0x363ec3(0xf2)]('.yml')&&!_0x51138b[_0x363ec3(0xf2)]('.yaml'))return console[_0x363ec3(0xfa)](a44_0x153f81[_0x363ec3(0x10a)](_0x363ec3(0xeb)+_0x51138b+'\x0a')),0x1;_0x58ad01=[_0x51138b];}else _0x58ad01=findYamlFiles(_0x2f2ca6);if(_0x58ad01[_0x363ec3(0x103)]===0x0)return console[_0x363ec3(0xfa)](a44_0x153f81['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x2f2ca6+'\x0a')),0x1;const _0x33dfcd=validateYamlFiles(_0x58ad01,_0x2f2ca6),_0x12ce8c=calculateSummary(_0x33dfcd);for(const _0x491ab1 of _0x33dfcd){if(!isValidationResult(_0x491ab1))continue;const {relativePath:_0x463325,source:_0xf3b60d,result:_0x3cc9a7,fileType:_0xb237e8}=_0x491ab1,_0x4daf21=_0xb237e8;if(_0x3cc9a7[_0x363ec3(0xe5)]&&_0x3cc9a7[_0x363ec3(0xe6)]['length']===0x0)_0x189b29[_0x363ec3(0xf6)]&&console[_0x363ec3(0xea)](a44_0x153f81[_0x363ec3(0xef)]('✔\x20'+_0x463325)+a44_0x153f81[_0x363ec3(0xe4)]('\x20('+_0x4daf21+')'));else _0x3cc9a7[_0x363ec3(0xe5)]?(console[_0x363ec3(0xea)](a44_0x153f81[_0x363ec3(0xed)]('⚠\x20'+_0x463325)+a44_0x153f81[_0x363ec3(0xe4)]('\x20('+_0x4daf21+_0x363ec3(0xff)+_0x3cc9a7[_0x363ec3(0xe6)][_0x363ec3(0x103)]+'\x20warning(s)')),console[_0x363ec3(0xea)](formatValidationResult(_0x3cc9a7,_0xf3b60d,_0x463325))):(console[_0x363ec3(0xea)](a44_0x153f81['red']('✖\x20'+_0x463325)+a44_0x153f81['dim']('\x20('+_0x4daf21+'):\x20'+_0x3cc9a7[_0x363ec3(0xf7)]['length']+'\x20error(s)')),console['log'](formatValidationResult(_0x3cc9a7,_0xf3b60d,_0x463325)));}return console[_0x363ec3(0xea)](''),_0x12ce8c[_0x363ec3(0x10d)]?(console[_0x363ec3(0xea)](a44_0x153f81['red'](_0x363ec3(0x108)+_0x12ce8c[_0x363ec3(0x109)]+_0x363ec3(0xdd)+_0x12ce8c['validCount']+_0x363ec3(0xe8))),_0x12ce8c[_0x363ec3(0xf3)]>0x0&&console[_0x363ec3(0xea)](a44_0x153f81['yellow'](_0x12ce8c[_0x363ec3(0xf3)]+_0x363ec3(0xf4))),0x1):(console[_0x363ec3(0xea)](a44_0x153f81[_0x363ec3(0xef)](_0x363ec3(0x10f)+_0x12ce8c[_0x363ec3(0xec)]+_0x363ec3(0xfd))),_0x12ce8c[_0x363ec3(0xf3)]>0x0&&console[_0x363ec3(0xea)](a44_0x153f81[_0x363ec3(0xed)](_0x12ce8c[_0x363ec3(0xf3)]+_0x363ec3(0xf4))),0x0);}}
@@ -1 +1 @@
1
- const a45_0xc66666=a45_0x526e;(function(_0x4347a7,_0x2aab50){const _0x3ad471=a45_0x526e,_0x1f3290=_0x4347a7();while(!![]){try{const _0x292270=parseInt(_0x3ad471(0x7f))/0x1*(-parseInt(_0x3ad471(0xba))/0x2)+-parseInt(_0x3ad471(0xa9))/0x3+parseInt(_0x3ad471(0x79))/0x4*(parseInt(_0x3ad471(0x83))/0x5)+-parseInt(_0x3ad471(0xb2))/0x6+-parseInt(_0x3ad471(0xb1))/0x7+parseInt(_0x3ad471(0xac))/0x8+parseInt(_0x3ad471(0x7e))/0x9*(parseInt(_0x3ad471(0x7b))/0xa);if(_0x292270===_0x2aab50)break;else _0x1f3290['push'](_0x1f3290['shift']());}catch(_0x1da290){_0x1f3290['push'](_0x1f3290['shift']());}}}(a45_0x2d1b,0x4a2fc));import{BaseCommand}from'./command.js';function a45_0x526e(_0x4359ff,_0x37c4a1){_0x4359ff=_0x4359ff-0x76;const _0x2d1b9b=a45_0x2d1b();let _0x526e33=_0x2d1b9b[_0x4359ff];return _0x526e33;}import{SDKError}from'../sdk/index.js';function a45_0x2d1b(){const _0x875954=['\x5c$&','Resolving\x20path\x20\x27','60266NFNUoJ','sort','✔\x20Found\x20','replace','✔\x20Built\x20tree\x20with\x20','json','Folder/pattern\x20arg:\x20','jsonl','12LIlMlz','children','50dvAxuM','localeCompare','listUnifiedWithJourneys','96417zwEPfc','3JCxYdZ','List\x20folders\x20and\x20child\x20segments','/e/','listRecursive','1002080UDZqNG','\x20matching\x20\x27','verbose','description','data','folders','map','Parent\x20ID:\x20','(empty)','Listing\x20folders,\x20segments,\x20and\x20journeys...','Resolving\x20parent\x20segment\x20\x27','parentId','Set\x20a\x20parent\x20segment\x20context\x20first:','segment','No\x20items\x20match\x20pattern:\x20','/app/ps/','name','Recursive\x20mode:\x20enabled','\x20folder','folderId','\x20journey','Folder\x20ID:\x20','listWithPattern','test','type','\x27...','/j/da','execute','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','journeys','\x20\x20Cause:\x20','format','recursive','dim','folder','error','length','\x20segment','31641vECSdi','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','site','810432yDZzdI','listUnified','filter','maxDepth','segments','398293blpfLL','1766424NAqSDf',',\x20and\x20','resolvePathToResource','log','includes','journey'];a45_0x2d1b=function(){return _0x875954;};return a45_0x2d1b();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x2fb124 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0xc66666(0x93)]=a45_0xc66666(0xb0);[a45_0xc66666(0x86)]=a45_0xc66666(0x80);async[a45_0xc66666(0x9e)](_0x4dc0b4){const _0x250c2d=a45_0xc66666,{options:_0x5a82dc,args:_0x409d2b}=_0x4dc0b4,_0x5923cc=_0x5a82dc[_0x250c2d(0xa3)],_0x1c4eab=_0x409d2b[0x0];try{const _0x549088=_0x5a82dc['parentSegment'];_0x5a82dc[_0x250c2d(0x85)]&&(console[_0x250c2d(0xa6)]('Site:\x20'+_0x5a82dc[_0x250c2d(0xab)]),console[_0x250c2d(0xa6)]('Parent\x20segment\x20context:\x20'+(_0x549088||'(not\x20set)')),_0x1c4eab&&console['error'](_0x250c2d(0x77)+_0x1c4eab),_0x5923cc&&console['error'](_0x250c2d(0x94)));if(!_0x549088)return console[_0x250c2d(0xa6)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x250c2d(0xa6)](''),console[_0x250c2d(0xa6)](_0x250c2d(0x8f)),console[_0x250c2d(0xa6)](_0x250c2d(0xaa)),console[_0x250c2d(0xa6)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x250c2d(0xa6)](''),console[_0x250c2d(0xa6)](_0x250c2d(0x9f)),0x1;const _0x34e1a2=_0x1c4eab&&(_0x1c4eab[_0x250c2d(0xb6)]('*')||_0x1c4eab[_0x250c2d(0xb6)]('?'));if(_0x34e1a2)return await this[_0x250c2d(0x99)](_0x4dc0b4,_0x549088,_0x1c4eab);const _0x1dcedb=_0x1c4eab?_0x549088+'/'+_0x1c4eab:_0x549088;return _0x5923cc?await this[_0x250c2d(0x82)](_0x4dc0b4,_0x1dcedb):await this[_0x250c2d(0xad)](_0x4dc0b4,_0x1dcedb);}catch(_0xfe4fd7){if(_0xfe4fd7 instanceof SDKError)return console[_0x250c2d(0xa6)]('Error:\x20'+_0xfe4fd7['message']),_0xfe4fd7['cause']&&console[_0x250c2d(0xa6)](_0x250c2d(0xa1)+_0xfe4fd7['cause']),0x1;throw _0xfe4fd7;}}async['listWithPattern'](_0x22065b,_0x110bde,_0x308218){const _0x56303c=a45_0xc66666,{options:_0x52fd6c,tdx:_0x41dfa3}=_0x22065b,_0x32e4b3=await withSpinner(_0x56303c(0x8d)+_0x110bde+'\x27...',()=>_0x41dfa3[_0x56303c(0x90)][_0x56303c(0xb4)](_0x110bde),{'verbose':_0x52fd6c[_0x56303c(0x85)]}),_0x291b22=_0x32e4b3['data'],_0x130d8d=await withSpinner(_0x56303c(0x8c),()=>_0x41dfa3[_0x56303c(0x90)][_0x56303c(0x7d)](_0x291b22['parentId'],_0x291b22[_0x56303c(0x96)]),{'verbose':_0x52fd6c[_0x56303c(0x85)]}),{folders:_0x37cb88,segments:_0x2d4877,journeys:_0x5c4482}=_0x130d8d[_0x56303c(0x87)],_0x32a124=_0x308218[_0x56303c(0xbd)](/[.+^${}()|[\]\\]/g,_0x56303c(0xb8))[_0x56303c(0xbd)](/\*/g,'.*')[_0x56303c(0xbd)](/\?/g,'.'),_0x53a53a=new RegExp('^'+_0x32a124+'$','i'),_0x182538=_0x37cb88[_0x56303c(0xae)](_0x498c32=>_0x53a53a[_0x56303c(0x9a)](_0x498c32[_0x56303c(0x93)])),_0x331dd7=_0x2d4877['filter'](_0x61a1b4=>_0x53a53a[_0x56303c(0x9a)](_0x61a1b4['name'])),_0x219efb=_0x5c4482['filter'](_0x29bfc8=>_0x53a53a[_0x56303c(0x9a)](_0x29bfc8['journeyBundleName'])),_0x29c40c=_0x182538[_0x56303c(0xa7)]+_0x331dd7[_0x56303c(0xa7)]+_0x219efb['length'];console[_0x56303c(0xa6)]('✔\x20Found\x20'+_0x182538[_0x56303c(0xa7)]+_0x56303c(0x95)+(_0x182538[_0x56303c(0xa7)]!==0x1?'s':'')+',\x20'+_0x331dd7[_0x56303c(0xa7)]+_0x56303c(0xa8)+(_0x331dd7[_0x56303c(0xa7)]!==0x1?'s':'')+_0x56303c(0xb3)+_0x219efb[_0x56303c(0xa7)]+_0x56303c(0x97)+(_0x219efb[_0x56303c(0xa7)]!==0x1?'s':'')+_0x56303c(0x84)+_0x308218+'\x27');const _0x4a3341=_0x1f0f96=>{const _0x43cf59=_0x56303c;return getConsoleNextUrl(_0x52fd6c[_0x43cf59(0xab)],'/app/ps/'+_0x291b22[_0x43cf59(0x8e)]+_0x43cf59(0x81)+_0x1f0f96);},_0x25b161=_0x52fd6c[_0x56303c(0xa2)]===_0x56303c(0x76)||_0x52fd6c[_0x56303c(0xa2)]===_0x56303c(0x78);if(_0x25b161){const _0x100982=[..._0x182538[_0x56303c(0x89)](_0x3342fc=>({..._0x3342fc,'type':_0x56303c(0xa5)})),..._0x331dd7[_0x56303c(0x89)](_0x5b55df=>({..._0x5b55df,'type':'segment','url':_0x4a3341(_0x5b55df['id'])})),..._0x219efb[_0x56303c(0x89)](_0x347301=>({..._0x347301,'name':_0x347301['journeyBundleName'],'type':_0x56303c(0xb7)}))][_0x56303c(0xbb)]((_0x46a08f,_0x323e1f)=>_0x46a08f[_0x56303c(0x93)][_0x56303c(0x7c)](_0x323e1f['name']));await handleSDKOutput(_0x100982,_0x52fd6c);}else{if(_0x29c40c===0x0)console[_0x56303c(0xb5)](_0x56303c(0x91)+_0x308218);else{console['log'](a45_0x2fb124[_0x56303c(0xa4)]('['+_0x110bde+']\x20matching\x20\x27'+_0x308218+'\x27'));const _0xc7ca28=formatFlatList(_0x182538,_0x331dd7,{'showMetadata':!![],'getSegmentUrl':_0x4a3341},_0x219efb);console[_0x56303c(0xb5)](_0xc7ca28);}}return 0x0;}async[a45_0xc66666(0xad)](_0x33b4e8,_0x18c594){const _0xfcbf0=a45_0xc66666,{options:_0x304175,tdx:_0x5e54df}=_0x33b4e8,_0x2aa1c8=await withSpinner('Resolving\x20path\x20\x27'+_0x18c594+_0xfcbf0(0x9c),()=>_0x5e54df[_0xfcbf0(0x90)]['resolvePathToResource'](_0x18c594),{'verbose':_0x304175[_0xfcbf0(0x85)]}),_0x215322=_0x2aa1c8['data'];_0x304175[_0xfcbf0(0x85)]&&(console['error'](_0xfcbf0(0x8a)+_0x215322[_0xfcbf0(0x8e)]),_0x215322[_0xfcbf0(0x96)]&&console[_0xfcbf0(0xa6)](_0xfcbf0(0x98)+_0x215322[_0xfcbf0(0x96)]));const _0x5832b4=await withSpinner(_0xfcbf0(0x8c),()=>_0x5e54df[_0xfcbf0(0x90)][_0xfcbf0(0x7d)](_0x215322[_0xfcbf0(0x8e)],_0x215322[_0xfcbf0(0x96)]),{'verbose':_0x304175[_0xfcbf0(0x85)]}),{folders:_0x4c74ed,segments:_0x37c3da,journeys:_0x17f776}=_0x5832b4[_0xfcbf0(0x87)],_0x5822c9=_0x4c74ed['length']+_0x37c3da[_0xfcbf0(0xa7)]+_0x17f776[_0xfcbf0(0xa7)];console[_0xfcbf0(0xa6)](_0xfcbf0(0xbc)+_0x4c74ed[_0xfcbf0(0xa7)]+_0xfcbf0(0x95)+(_0x4c74ed[_0xfcbf0(0xa7)]!==0x1?'s':'')+',\x20'+_0x37c3da[_0xfcbf0(0xa7)]+_0xfcbf0(0xa8)+(_0x37c3da[_0xfcbf0(0xa7)]!==0x1?'s':'')+_0xfcbf0(0xb3)+_0x17f776[_0xfcbf0(0xa7)]+_0xfcbf0(0x97)+(_0x17f776[_0xfcbf0(0xa7)]!==0x1?'s':''));const _0x5c3bf1=_0x13d245=>{const _0xb5a9a4=_0xfcbf0;return getConsoleNextUrl(_0x304175['site'],_0xb5a9a4(0x92)+_0x215322[_0xb5a9a4(0x8e)]+'/e/'+_0x13d245);},_0x2f9753=_0x5615cd=>{const _0x3ddc1f=_0xfcbf0;return getConsoleNextUrl(_0x304175[_0x3ddc1f(0xab)],_0x3ddc1f(0x92)+_0x215322['parentId']+_0x3ddc1f(0x81)+_0x5615cd+_0x3ddc1f(0x9d));},_0x12d3a7=_0x304175[_0xfcbf0(0xa2)]==='json'||_0x304175[_0xfcbf0(0xa2)]===_0xfcbf0(0x78);if(_0x12d3a7){const _0x29715c=[..._0x4c74ed[_0xfcbf0(0x89)](_0x3b28e8=>({..._0x3b28e8,'type':_0xfcbf0(0xa5)})),..._0x37c3da[_0xfcbf0(0x89)](_0xe3dd40=>({..._0xe3dd40,'type':_0xfcbf0(0x90),'url':_0x5c3bf1(_0xe3dd40['id'])})),..._0x17f776[_0xfcbf0(0x89)](_0xfb29fe=>({..._0xfb29fe,'name':_0xfb29fe['journeyBundleName'],'type':_0xfcbf0(0xb7),'url':_0x2f9753(_0xfb29fe['id'])}))][_0xfcbf0(0xbb)]((_0x253d4c,_0xd44097)=>_0x253d4c[_0xfcbf0(0x93)][_0xfcbf0(0x7c)](_0xd44097[_0xfcbf0(0x93)]));await handleSDKOutput(_0x29715c,_0x304175);}else{if(_0x5822c9===0x0)console[_0xfcbf0(0xb5)](a45_0x2fb124[_0xfcbf0(0xa4)]('['+_0x18c594+']')),console[_0xfcbf0(0xb5)](_0xfcbf0(0x8b));else{console[_0xfcbf0(0xb5)](a45_0x2fb124[_0xfcbf0(0xa4)]('['+_0x18c594+']'));const _0x1e81a3=formatFlatList(_0x4c74ed,_0x37c3da,{'showMetadata':!![],'getSegmentUrl':_0x5c3bf1,'getJourneyUrl':_0x2f9753},_0x17f776);console['log'](_0x1e81a3);}}return 0x0;}async[a45_0xc66666(0x82)](_0x1236c7,_0x4b8da7){const _0x1d87b2=a45_0xc66666,{options:_0x26ae97,tdx:_0x7c0ff3}=_0x1236c7,_0x4c44db=await withSpinner(_0x1d87b2(0xb9)+_0x4b8da7+_0x1d87b2(0x9c),()=>_0x7c0ff3[_0x1d87b2(0x90)][_0x1d87b2(0xb4)](_0x4b8da7),{'verbose':_0x26ae97[_0x1d87b2(0x85)]}),_0x5a011a=_0x4c44db[_0x1d87b2(0x87)];_0x26ae97[_0x1d87b2(0x85)]&&(console['error'](_0x1d87b2(0x8a)+_0x5a011a[_0x1d87b2(0x8e)]),_0x5a011a['folderId']&&console[_0x1d87b2(0xa6)](_0x1d87b2(0x98)+_0x5a011a[_0x1d87b2(0x96)]));const _0x8984c1=_0x26ae97[_0x1d87b2(0xaf)]||0xa,_0xf57052=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x7c0ff3['segment'][_0x1d87b2(0x82)](_0x5a011a[_0x1d87b2(0x8e)],_0x5a011a['folderId'],0x0,_0x8984c1),{'verbose':_0x26ae97[_0x1d87b2(0x85)]}),_0x2e6ff9=_0xf57052[_0x1d87b2(0x87)],_0xb6db4b=_0x258720=>{const _0x3035f6=_0x1d87b2;let _0x1f5479=0x0,_0x5230d7=0x0,_0x5375ab=0x0;for(const _0x4b0ac9 of _0x258720){if(_0x4b0ac9[_0x3035f6(0x9b)]===_0x3035f6(0xa5))_0x1f5479++;else{if(_0x4b0ac9[_0x3035f6(0x9b)]==='segment')_0x5230d7++;else{if(_0x4b0ac9[_0x3035f6(0x9b)]===_0x3035f6(0xb7))_0x5375ab++;}}if(_0x4b0ac9[_0x3035f6(0x7a)]){const _0x1dec15=_0xb6db4b(_0x4b0ac9['children']);_0x1f5479+=_0x1dec15[_0x3035f6(0x88)],_0x5230d7+=_0x1dec15[_0x3035f6(0xb0)],_0x5375ab+=_0x1dec15[_0x3035f6(0xa0)];}}return{'folders':_0x1f5479,'segments':_0x5230d7,'journeys':_0x5375ab};},_0x5443f7=_0xb6db4b(_0x2e6ff9);console[_0x1d87b2(0xa6)](_0x1d87b2(0xbe)+_0x5443f7[_0x1d87b2(0x88)]+_0x1d87b2(0x95)+(_0x5443f7[_0x1d87b2(0x88)]!==0x1?'s':'')+',\x20'+_0x5443f7[_0x1d87b2(0xb0)]+_0x1d87b2(0xa8)+(_0x5443f7[_0x1d87b2(0xb0)]!==0x1?'s':'')+_0x1d87b2(0xb3)+_0x5443f7[_0x1d87b2(0xa0)]+'\x20journey'+(_0x5443f7[_0x1d87b2(0xa0)]!==0x1?'s':''));const _0xf42417=_0x1f8066=>{const _0x73b74b=_0x1d87b2;return getConsoleNextUrl(_0x26ae97[_0x73b74b(0xab)],'/app/ps/'+_0x5a011a[_0x73b74b(0x8e)]+_0x73b74b(0x81)+_0x1f8066);},_0x31ae1b=_0x5e58d5=>{const _0x3aa9da=_0x1d87b2;return getConsoleNextUrl(_0x26ae97['site'],_0x3aa9da(0x92)+_0x5a011a['parentId']+_0x3aa9da(0x81)+_0x5e58d5+_0x3aa9da(0x9d));};if(_0x26ae97[_0x1d87b2(0xa2)]===_0x1d87b2(0x76)||_0x26ae97[_0x1d87b2(0xa2)]==='jsonl')await handleSDKOutput(_0x2e6ff9,_0x26ae97);else{console[_0x1d87b2(0xb5)](a45_0x2fb124[_0x1d87b2(0xa4)]('['+_0x4b8da7+']'));const _0x329650=formatTree(_0x2e6ff9,{'showMetadata':!![],'getSegmentUrl':_0xf42417,'getJourneyUrl':_0x31ae1b});console['log'](_0x329650);}return 0x0;}}
1
+ const a45_0x30c7cd=a45_0x3bea;function a45_0x3b0c(){const _0x29de29=['folderId','Site:\x20','journeys','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','name','log','error','resolvePathToResource','maxDepth','replace','(empty)','Recursive\x20mode:\x20enabled','localeCompare','sort','jsonl','\x20folder','4228287MLYniY','children','verbose','data','test','Error:\x20','205362Dygdgd','format',']\x20matching\x20\x27','Resolving\x20path\x20\x27','listUnified','/app/ps/','description','listRecursive','\x20segment','\x20journey','site','\x20matching\x20\x27','\x27...','map','parentId','listWithPattern','63sboYfj','7374864hPpIiS','✔\x20Found\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','6vgDKFD','journey','filter','includes','type','Resolving\x20parent\x20segment\x20\x27',',\x20and\x20','Folder/pattern\x20arg:\x20','dim','764696xPDAHt','\x5c$&','cause','3244vsWOlt','10343487ENCLRK','folder','folders','List\x20folders\x20and\x20child\x20segments','32461300zESxWK','message','Building\x20hierarchy\x20tree...','✔\x20Built\x20tree\x20with\x20','segments','recursive','segment','journeyBundleName','Listing\x20folders,\x20segments,\x20and\x20journeys...','(not\x20set)','No\x20items\x20match\x20pattern:\x20','/e/','execute','Folder\x20ID:\x20','Parent\x20ID:\x20','length','1060aesFYV','json'];a45_0x3b0c=function(){return _0x29de29;};return a45_0x3b0c();}(function(_0x1a5cc7,_0x3739be){const _0xde6790=a45_0x3bea,_0x515fd6=_0x1a5cc7();while(!![]){try{const _0x2d177d=parseInt(_0xde6790(0x211))/0x1*(-parseInt(_0xde6790(0x1fd))/0x2)+parseInt(_0xde6790(0x1f7))/0x3+parseInt(_0xde6790(0x21d))/0x4*(-parseInt(_0xde6790(0x1e5))/0x5)+parseInt(_0xde6790(0x20e))/0x6+parseInt(_0xde6790(0x21e))/0x7+-parseInt(_0xde6790(0x21a))/0x8*(-parseInt(_0xde6790(0x20d))/0x9)+-parseInt(_0xde6790(0x1d5))/0xa;if(_0x2d177d===_0x3739be)break;else _0x515fd6['push'](_0x515fd6['shift']());}catch(_0x29192c){_0x515fd6['push'](_0x515fd6['shift']());}}}(a45_0x3b0c,0xb7647));function a45_0x3bea(_0x450634,_0x41d7a3){_0x450634=_0x450634-0x1d5;const _0x3b0c4c=a45_0x3b0c();let _0x3bea01=_0x3b0c4c[_0x450634];return _0x3bea01;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0xe0926 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x30c7cd(0x1eb)]=a45_0x30c7cd(0x1d9);[a45_0x30c7cd(0x203)]=a45_0x30c7cd(0x221);async[a45_0x30c7cd(0x1e1)](_0x550317){const _0x580b99=a45_0x30c7cd,{options:_0x4a3e29,args:_0x197264}=_0x550317,_0x5a9367=_0x4a3e29[_0x580b99(0x1da)],_0x25fa56=_0x197264[0x0];try{const _0x195244=_0x4a3e29['parentSegment'];_0x4a3e29[_0x580b99(0x1f9)]&&(console[_0x580b99(0x1ed)](_0x580b99(0x1e8)+_0x4a3e29[_0x580b99(0x207)]),console[_0x580b99(0x1ed)]('Parent\x20segment\x20context:\x20'+(_0x195244||_0x580b99(0x1de))),_0x25fa56&&console[_0x580b99(0x1ed)](_0x580b99(0x218)+_0x25fa56),_0x5a9367&&console[_0x580b99(0x1ed)](_0x580b99(0x1f2)));if(!_0x195244)return console[_0x580b99(0x1ed)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x580b99(0x1ed)](''),console[_0x580b99(0x1ed)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x580b99(0x1ed)](_0x580b99(0x210)),console[_0x580b99(0x1ed)](_0x580b99(0x1ea)),console[_0x580b99(0x1ed)](''),console[_0x580b99(0x1ed)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x4c982f=_0x25fa56&&(_0x25fa56[_0x580b99(0x214)]('*')||_0x25fa56[_0x580b99(0x214)]('?'));if(_0x4c982f)return await this[_0x580b99(0x20c)](_0x550317,_0x195244,_0x25fa56);const _0xb16b19=_0x25fa56?_0x195244+'/'+_0x25fa56:_0x195244;return _0x5a9367?await this[_0x580b99(0x204)](_0x550317,_0xb16b19):await this[_0x580b99(0x201)](_0x550317,_0xb16b19);}catch(_0x161e7d){if(_0x161e7d instanceof SDKError)return console[_0x580b99(0x1ed)](_0x580b99(0x1fc)+_0x161e7d[_0x580b99(0x1d6)]),_0x161e7d[_0x580b99(0x21c)]&&console[_0x580b99(0x1ed)]('\x20\x20Cause:\x20'+_0x161e7d[_0x580b99(0x21c)]),0x1;throw _0x161e7d;}}async[a45_0x30c7cd(0x20c)](_0xf1a4ab,_0x5459f3,_0xadc71e){const _0x5e58b0=a45_0x30c7cd,{options:_0x46566c,tdx:_0x366513}=_0xf1a4ab,_0x232c34=await withSpinner(_0x5e58b0(0x216)+_0x5459f3+_0x5e58b0(0x209),()=>_0x366513['segment'][_0x5e58b0(0x1ee)](_0x5459f3),{'verbose':_0x46566c['verbose']}),_0x29650b=_0x232c34[_0x5e58b0(0x1fa)],_0x4dc74d=await withSpinner(_0x5e58b0(0x1dd),()=>_0x366513[_0x5e58b0(0x1db)]['listUnifiedWithJourneys'](_0x29650b[_0x5e58b0(0x20b)],_0x29650b[_0x5e58b0(0x1e7)]),{'verbose':_0x46566c[_0x5e58b0(0x1f9)]}),{folders:_0x123dbd,segments:_0x3ec8c3,journeys:_0x15f0c5}=_0x4dc74d[_0x5e58b0(0x1fa)],_0xa96693=_0xadc71e[_0x5e58b0(0x1f0)](/[.+^${}()|[\]\\]/g,_0x5e58b0(0x21b))[_0x5e58b0(0x1f0)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4cf95c=new RegExp('^'+_0xa96693+'$','i'),_0x13685b=_0x123dbd[_0x5e58b0(0x213)](_0x58c6ce=>_0x4cf95c[_0x5e58b0(0x1fb)](_0x58c6ce[_0x5e58b0(0x1eb)])),_0x14b7f3=_0x3ec8c3[_0x5e58b0(0x213)](_0x751e09=>_0x4cf95c['test'](_0x751e09[_0x5e58b0(0x1eb)])),_0x5308a7=_0x15f0c5[_0x5e58b0(0x213)](_0x591371=>_0x4cf95c[_0x5e58b0(0x1fb)](_0x591371[_0x5e58b0(0x1dc)])),_0x3919af=_0x13685b['length']+_0x14b7f3[_0x5e58b0(0x1e4)]+_0x5308a7[_0x5e58b0(0x1e4)];console[_0x5e58b0(0x1ed)](_0x5e58b0(0x20f)+_0x13685b['length']+_0x5e58b0(0x1f6)+(_0x13685b[_0x5e58b0(0x1e4)]!==0x1?'s':'')+',\x20'+_0x14b7f3[_0x5e58b0(0x1e4)]+_0x5e58b0(0x205)+(_0x14b7f3[_0x5e58b0(0x1e4)]!==0x1?'s':'')+_0x5e58b0(0x217)+_0x5308a7[_0x5e58b0(0x1e4)]+'\x20journey'+(_0x5308a7['length']!==0x1?'s':'')+_0x5e58b0(0x208)+_0xadc71e+'\x27');const _0x52a516=_0x217294=>{const _0x3de63d=_0x5e58b0;return getConsoleNextUrl(_0x46566c['site'],_0x3de63d(0x202)+_0x29650b[_0x3de63d(0x20b)]+_0x3de63d(0x1e0)+_0x217294);},_0x36c601=_0x46566c[_0x5e58b0(0x1fe)]===_0x5e58b0(0x1e6)||_0x46566c['format']===_0x5e58b0(0x1f5);if(_0x36c601){const _0x18f0c7=[..._0x13685b[_0x5e58b0(0x20a)](_0x4b43c7=>({..._0x4b43c7,'type':_0x5e58b0(0x21f)})),..._0x14b7f3[_0x5e58b0(0x20a)](_0x58d72f=>({..._0x58d72f,'type':'segment','url':_0x52a516(_0x58d72f['id'])})),..._0x5308a7['map'](_0x211ea9=>({..._0x211ea9,'name':_0x211ea9[_0x5e58b0(0x1dc)],'type':_0x5e58b0(0x212)}))]['sort']((_0x54f1e0,_0x54027f)=>_0x54f1e0[_0x5e58b0(0x1eb)][_0x5e58b0(0x1f3)](_0x54027f[_0x5e58b0(0x1eb)]));await handleSDKOutput(_0x18f0c7,_0x46566c);}else{if(_0x3919af===0x0)console[_0x5e58b0(0x1ec)](_0x5e58b0(0x1df)+_0xadc71e);else{console[_0x5e58b0(0x1ec)](a45_0xe0926[_0x5e58b0(0x219)]('['+_0x5459f3+_0x5e58b0(0x1ff)+_0xadc71e+'\x27'));const _0x4eac42=formatFlatList(_0x13685b,_0x14b7f3,{'showMetadata':!![],'getSegmentUrl':_0x52a516},_0x5308a7);console[_0x5e58b0(0x1ec)](_0x4eac42);}}return 0x0;}async[a45_0x30c7cd(0x201)](_0xaa8c59,_0x48f657){const _0x1c17bd=a45_0x30c7cd,{options:_0x5664ac,tdx:_0x5e72d7}=_0xaa8c59,_0x213710=await withSpinner(_0x1c17bd(0x200)+_0x48f657+_0x1c17bd(0x209),()=>_0x5e72d7[_0x1c17bd(0x1db)][_0x1c17bd(0x1ee)](_0x48f657),{'verbose':_0x5664ac[_0x1c17bd(0x1f9)]}),_0x4dc68b=_0x213710['data'];_0x5664ac['verbose']&&(console['error'](_0x1c17bd(0x1e3)+_0x4dc68b[_0x1c17bd(0x20b)]),_0x4dc68b[_0x1c17bd(0x1e7)]&&console[_0x1c17bd(0x1ed)](_0x1c17bd(0x1e2)+_0x4dc68b['folderId']));const _0x1b7f60=await withSpinner(_0x1c17bd(0x1dd),()=>_0x5e72d7['segment']['listUnifiedWithJourneys'](_0x4dc68b[_0x1c17bd(0x20b)],_0x4dc68b['folderId']),{'verbose':_0x5664ac['verbose']}),{folders:_0x524112,segments:_0x5b035e,journeys:_0x382f46}=_0x1b7f60[_0x1c17bd(0x1fa)],_0x4f23e4=_0x524112[_0x1c17bd(0x1e4)]+_0x5b035e[_0x1c17bd(0x1e4)]+_0x382f46[_0x1c17bd(0x1e4)];console[_0x1c17bd(0x1ed)](_0x1c17bd(0x20f)+_0x524112['length']+_0x1c17bd(0x1f6)+(_0x524112['length']!==0x1?'s':'')+',\x20'+_0x5b035e['length']+_0x1c17bd(0x205)+(_0x5b035e[_0x1c17bd(0x1e4)]!==0x1?'s':'')+_0x1c17bd(0x217)+_0x382f46[_0x1c17bd(0x1e4)]+_0x1c17bd(0x206)+(_0x382f46[_0x1c17bd(0x1e4)]!==0x1?'s':''));const _0x6e2cd7=_0x54225e=>{const _0x5b9bde=_0x1c17bd;return getConsoleNextUrl(_0x5664ac[_0x5b9bde(0x207)],_0x5b9bde(0x202)+_0x4dc68b[_0x5b9bde(0x20b)]+_0x5b9bde(0x1e0)+_0x54225e);},_0x5a045e=_0x590cf7=>{const _0x1fc988=_0x1c17bd;return getConsoleNextUrl(_0x5664ac[_0x1fc988(0x207)],_0x1fc988(0x202)+_0x4dc68b[_0x1fc988(0x20b)]+_0x1fc988(0x1e0)+_0x590cf7+'/j/da');},_0x4c1f6e=_0x5664ac[_0x1c17bd(0x1fe)]===_0x1c17bd(0x1e6)||_0x5664ac['format']==='jsonl';if(_0x4c1f6e){const _0xa3b532=[..._0x524112[_0x1c17bd(0x20a)](_0x39e522=>({..._0x39e522,'type':_0x1c17bd(0x21f)})),..._0x5b035e['map'](_0x2cde1d=>({..._0x2cde1d,'type':'segment','url':_0x6e2cd7(_0x2cde1d['id'])})),..._0x382f46[_0x1c17bd(0x20a)](_0x1945bd=>({..._0x1945bd,'name':_0x1945bd[_0x1c17bd(0x1dc)],'type':_0x1c17bd(0x212),'url':_0x5a045e(_0x1945bd['id'])}))][_0x1c17bd(0x1f4)]((_0x2612c7,_0x18e6e7)=>_0x2612c7['name']['localeCompare'](_0x18e6e7[_0x1c17bd(0x1eb)]));await handleSDKOutput(_0xa3b532,_0x5664ac);}else{if(_0x4f23e4===0x0)console[_0x1c17bd(0x1ec)](a45_0xe0926[_0x1c17bd(0x219)]('['+_0x48f657+']')),console['log'](_0x1c17bd(0x1f1));else{console['log'](a45_0xe0926[_0x1c17bd(0x219)]('['+_0x48f657+']'));const _0x821546=formatFlatList(_0x524112,_0x5b035e,{'showMetadata':!![],'getSegmentUrl':_0x6e2cd7,'getJourneyUrl':_0x5a045e},_0x382f46);console[_0x1c17bd(0x1ec)](_0x821546);}}return 0x0;}async['listRecursive'](_0x26336c,_0x112dfb){const _0x45fe5a=a45_0x30c7cd,{options:_0x4ef8cd,tdx:_0x5d7f7d}=_0x26336c,_0x4aae26=await withSpinner(_0x45fe5a(0x200)+_0x112dfb+'\x27...',()=>_0x5d7f7d[_0x45fe5a(0x1db)][_0x45fe5a(0x1ee)](_0x112dfb),{'verbose':_0x4ef8cd[_0x45fe5a(0x1f9)]}),_0x434b51=_0x4aae26['data'];_0x4ef8cd['verbose']&&(console[_0x45fe5a(0x1ed)](_0x45fe5a(0x1e3)+_0x434b51[_0x45fe5a(0x20b)]),_0x434b51[_0x45fe5a(0x1e7)]&&console[_0x45fe5a(0x1ed)]('Folder\x20ID:\x20'+_0x434b51[_0x45fe5a(0x1e7)]));const _0x1c5da8=_0x4ef8cd[_0x45fe5a(0x1ef)]||0xa,_0x44e3e7=await withSpinner(_0x45fe5a(0x1d7),()=>_0x5d7f7d[_0x45fe5a(0x1db)][_0x45fe5a(0x204)](_0x434b51['parentId'],_0x434b51['folderId'],0x0,_0x1c5da8),{'verbose':_0x4ef8cd[_0x45fe5a(0x1f9)]}),_0x499cbe=_0x44e3e7[_0x45fe5a(0x1fa)],_0x44819c=_0x167159=>{const _0xa3cf53=_0x45fe5a;let _0xca9b74=0x0,_0x3896ad=0x0,_0x2c1f5b=0x0;for(const _0x18258f of _0x167159){if(_0x18258f['type']===_0xa3cf53(0x21f))_0xca9b74++;else{if(_0x18258f[_0xa3cf53(0x215)]===_0xa3cf53(0x1db))_0x3896ad++;else{if(_0x18258f[_0xa3cf53(0x215)]===_0xa3cf53(0x212))_0x2c1f5b++;}}if(_0x18258f[_0xa3cf53(0x1f8)]){const _0x5f1e4f=_0x44819c(_0x18258f[_0xa3cf53(0x1f8)]);_0xca9b74+=_0x5f1e4f[_0xa3cf53(0x220)],_0x3896ad+=_0x5f1e4f[_0xa3cf53(0x1d9)],_0x2c1f5b+=_0x5f1e4f[_0xa3cf53(0x1e9)];}}return{'folders':_0xca9b74,'segments':_0x3896ad,'journeys':_0x2c1f5b};},_0x2ceabc=_0x44819c(_0x499cbe);console[_0x45fe5a(0x1ed)](_0x45fe5a(0x1d8)+_0x2ceabc[_0x45fe5a(0x220)]+_0x45fe5a(0x1f6)+(_0x2ceabc['folders']!==0x1?'s':'')+',\x20'+_0x2ceabc[_0x45fe5a(0x1d9)]+_0x45fe5a(0x205)+(_0x2ceabc['segments']!==0x1?'s':'')+_0x45fe5a(0x217)+_0x2ceabc['journeys']+_0x45fe5a(0x206)+(_0x2ceabc[_0x45fe5a(0x1e9)]!==0x1?'s':''));const _0x220849=_0x35ea61=>{const _0x4f6b3e=_0x45fe5a;return getConsoleNextUrl(_0x4ef8cd['site'],_0x4f6b3e(0x202)+_0x434b51[_0x4f6b3e(0x20b)]+_0x4f6b3e(0x1e0)+_0x35ea61);},_0x1283c1=_0x4985c8=>{const _0x42b4ec=_0x45fe5a;return getConsoleNextUrl(_0x4ef8cd['site'],_0x42b4ec(0x202)+_0x434b51[_0x42b4ec(0x20b)]+_0x42b4ec(0x1e0)+_0x4985c8+'/j/da');};if(_0x4ef8cd[_0x45fe5a(0x1fe)]===_0x45fe5a(0x1e6)||_0x4ef8cd[_0x45fe5a(0x1fe)]===_0x45fe5a(0x1f5))await handleSDKOutput(_0x499cbe,_0x4ef8cd);else{console[_0x45fe5a(0x1ec)](a45_0xe0926[_0x45fe5a(0x219)]('['+_0x112dfb+']'));const _0x2fa603=formatTree(_0x499cbe,{'showMetadata':!![],'getSegmentUrl':_0x220849,'getJourneyUrl':_0x1283c1});console[_0x45fe5a(0x1ec)](_0x2fa603);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x3e1376=a46_0x2972;(function(_0x5e60fb,_0x3c5dbc){const _0x43583e=a46_0x2972,_0x7c0eed=_0x5e60fb();while(!![]){try{const _0x33abd4=parseInt(_0x43583e(0x88))/0x1*(parseInt(_0x43583e(0x8f))/0x2)+parseInt(_0x43583e(0x99))/0x3*(-parseInt(_0x43583e(0x9b))/0x4)+parseInt(_0x43583e(0x85))/0x5+parseInt(_0x43583e(0x9e))/0x6*(parseInt(_0x43583e(0x87))/0x7)+parseInt(_0x43583e(0x8d))/0x8+-parseInt(_0x43583e(0x97))/0x9*(parseInt(_0x43583e(0x84))/0xa)+-parseInt(_0x43583e(0x8a))/0xb*(parseInt(_0x43583e(0xa2))/0xc);if(_0x33abd4===_0x3c5dbc)break;else _0x7c0eed['push'](_0x7c0eed['shift']());}catch(_0x3e6160){_0x7c0eed['push'](_0x7c0eed['shift']());}}}(a46_0x52bc,0xad29d));function a46_0x2972(_0x538ad7,_0x531096){_0x538ad7=_0x538ad7-0x7c;const _0x52bc8c=a46_0x52bc();let _0x2972e7=_0x52bc8c[_0x538ad7];return _0x2972e7;}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_0x52bc(){const _0x3f8cfe=['\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','validate','Usage:\x20tdx\x20show\x20<database.table>','showTable','Limit:\x20','catalog','table','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','description','verbose','length','\x20from\x20','Database:\x20','cause','database','2780EJhJFU','2971650gVYclc','error','39676GYEpEo','45CvkodE','message','11NMgbLE','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','query','4465272rCrRgp','execute','50422gJfLiW','...','limit','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','site','show','args','Show\x20table\x20contents','9081xDinvh','✔\x20Retrieved\x20','33CJAxxZ','\x20\x20Cause:\x20','277804twrcsv','\x20row','Querying\x20','654eEzTuP','data','Site:\x20','Error:\x20','13812672pGfeiO'];a46_0x52bc=function(){return _0x3f8cfe;};return a46_0x52bc();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x3e1376(0x94);[a46_0x3e1376(0x7d)]=a46_0x3e1376(0x96);async[a46_0x3e1376(0x8e)](_0x262498){const _0x3147cc=a46_0x3e1376;return this[_0x3147cc(0xa6)](_0x262498);}async[a46_0x3e1376(0xa6)](_0x1a61a7){const _0x43cfbf=a46_0x3e1376,{options:_0x43abca,args:_0x111708,tdx:_0x1a384a}=_0x1a61a7;let _0x471423;try{_0x471423=parseTableReference(_0x111708[0x0]);const _0x44eb80=_0x43abca[_0x43cfbf(0x83)];!_0x471423[_0x43cfbf(0x83)]&&_0x44eb80&&(_0x471423[_0x43cfbf(0x83)]=_0x44eb80);const _0x21e8ee=validateTableDescribeReference(_0x471423);if(_0x21e8ee)return console[_0x43cfbf(0x86)](_0x43cfbf(0xa1)+_0x21e8ee),console['error'](_0x43cfbf(0xa5)),console[_0x43cfbf(0x86)](_0x43cfbf(0x7c)),console[_0x43cfbf(0x86)](_0x43cfbf(0xa3)),0x1;}catch(_0x12aab5){return console['error'](_0x43cfbf(0xa1)+_0x12aab5[_0x43cfbf(0x89)]),console[_0x43cfbf(0x86)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x43cfbf(0x86)](_0x43cfbf(0x7c)),console[_0x43cfbf(0x86)](_0x43cfbf(0xa3)),0x1;}const _0x383987=_0x471423[_0x43cfbf(0xa8)],_0x79dca4=_0x471423[_0x43cfbf(0x83)],_0x33f3b0=_0x471423[_0x43cfbf(0xa9)],_0xdb310a=resolveLimit(_0x43abca[_0x43cfbf(0x91)],DEFAULT_DISPLAY_LIMIT);try{_0x43abca[_0x43cfbf(0x7e)]&&(console['error'](_0x43cfbf(0xa0)+_0x43abca[_0x43cfbf(0x93)]),_0x383987&&console[_0x43cfbf(0x86)]('Catalog:\x20'+_0x383987),console[_0x43cfbf(0x86)](_0x43cfbf(0x81)+_0x79dca4),console[_0x43cfbf(0x86)]('Table:\x20'+_0x33f3b0),console[_0x43cfbf(0x86)](_0x43cfbf(0xa7)+_0xdb310a));const _0x547bb1=_0x383987?_0x383987+'.'+_0x79dca4+'.'+_0x33f3b0:_0x79dca4+'.'+_0x33f3b0,_0x31612b=await withSpinner(_0x43cfbf(0x9d)+_0x547bb1+_0x43cfbf(0x90),()=>_0x1a384a[_0x43cfbf(0x8c)][_0x43cfbf(0xa6)](_0x79dca4,_0x33f3b0,_0xdb310a,_0x383987),{'verbose':_0x43abca[_0x43cfbf(0x7e)]}),_0x8f989f=_0x31612b[_0x43cfbf(0x9f)],_0x25464a=_0x8f989f[_0x43cfbf(0x9f)];return _0x25464a[_0x43cfbf(0x7f)]===0x0?console[_0x43cfbf(0x86)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console['error'](_0x43cfbf(0x98)+_0x25464a['length']+_0x43cfbf(0x9c)+(_0x25464a[_0x43cfbf(0x7f)]!==0x1?'s':'')+_0x43cfbf(0x80)+_0x547bb1),await handleSDKOutput(_0x25464a,_0x43abca),0x0;}catch(_0x567ca3){if(_0x567ca3 instanceof SDKError)return console[_0x43cfbf(0x86)](_0x43cfbf(0xa1)+_0x567ca3[_0x43cfbf(0x89)]),_0x567ca3['cause']&&console[_0x43cfbf(0x86)](_0x43cfbf(0x9a)+_0x567ca3[_0x43cfbf(0x82)]),0x1;throw _0x567ca3;}}[a46_0x3e1376(0xa4)](_0x1585c6){const _0x105d51=a46_0x3e1376;if(_0x1585c6['args'][_0x105d51(0x7f)]===0x0)return _0x105d51(0x8b);if(_0x1585c6[_0x105d51(0x95)][_0x105d51(0x7f)]>0x1)return _0x105d51(0x92);return undefined;}}
1
+ const a46_0xd891d1=a46_0x47a5;(function(_0x387c59,_0x316814){const _0x1355eb=a46_0x47a5,_0x57095e=_0x387c59();while(!![]){try{const _0x1fdfe6=parseInt(_0x1355eb(0x126))/0x1*(parseInt(_0x1355eb(0x11c))/0x2)+-parseInt(_0x1355eb(0x121))/0x3*(-parseInt(_0x1355eb(0x12d))/0x4)+parseInt(_0x1355eb(0x128))/0x5+-parseInt(_0x1355eb(0x110))/0x6*(-parseInt(_0x1355eb(0x111))/0x7)+parseInt(_0x1355eb(0x12c))/0x8+parseInt(_0x1355eb(0x109))/0x9*(parseInt(_0x1355eb(0x125))/0xa)+parseInt(_0x1355eb(0x112))/0xb*(-parseInt(_0x1355eb(0x11f))/0xc);if(_0x1fdfe6===_0x316814)break;else _0x57095e['push'](_0x57095e['shift']());}catch(_0x2588bc){_0x57095e['push'](_0x57095e['shift']());}}}(a46_0x1c29,0xa62a3));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_0x47a5(_0x2e5797,_0x2fc117){_0x2e5797=_0x2e5797-0x106;const _0x1c299a=a46_0x1c29();let _0x47a525=_0x1c299a[_0x2e5797];return _0x47a525;}import{withSpinner}from'../utils/spinner.js';function a46_0x1c29(){const _0x3fad51=['11ywZxgL','verbose','Site:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20\x20Cause:\x20','data','Table:\x20','Limit:\x20','execute','message','347206oeDqCh','error','\x20from\x20','44425548DzghPc','...','642zQtrgf','length','catalog','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','175530TUKYBM','4UAkwWl','✔\x20Retrieved\x20','3122025OdVvmq','Querying\x20','Error:\x20','Show\x20table\x20contents','10462112OxaqEb','19112PZkrJN','show','query','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20row','279IixaJX','cause','args','Usage:\x20tdx\x20show\x20<database.table>','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','showTable','database','24eWbWPB','331667hQopiU'];a46_0x1c29=function(){return _0x3fad51;};return a46_0x1c29();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0xd891d1(0x12e);['description']=a46_0xd891d1(0x12b);async[a46_0xd891d1(0x11a)](_0x3c2793){return this['showTable'](_0x3c2793);}async[a46_0xd891d1(0x10e)](_0x517980){const _0x456d8e=a46_0xd891d1,{options:_0x293c9f,args:_0x30fa0b,tdx:_0x1de935}=_0x517980;let _0x380801;try{_0x380801=parseTableReference(_0x30fa0b[0x0]);const _0xad54d9=_0x293c9f[_0x456d8e(0x10f)];!_0x380801[_0x456d8e(0x10f)]&&_0xad54d9&&(_0x380801['database']=_0xad54d9);const _0x982be2=validateTableDescribeReference(_0x380801);if(_0x982be2)return console[_0x456d8e(0x11d)](_0x456d8e(0x12a)+_0x982be2),console['error'](_0x456d8e(0x10c)),console['error'](_0x456d8e(0x115)),console['error'](_0x456d8e(0x124)),0x1;}catch(_0x9e6207){return console['error'](_0x456d8e(0x12a)+_0x9e6207[_0x456d8e(0x11b)]),console[_0x456d8e(0x11d)](_0x456d8e(0x10c)),console[_0x456d8e(0x11d)](_0x456d8e(0x115)),console[_0x456d8e(0x11d)](_0x456d8e(0x124)),0x1;}const _0x4595bf=_0x380801[_0x456d8e(0x123)],_0x244a3d=_0x380801[_0x456d8e(0x10f)],_0x5d032a=_0x380801['table'],_0x5bbb3c=resolveLimit(_0x293c9f['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x293c9f[_0x456d8e(0x113)]&&(console[_0x456d8e(0x11d)](_0x456d8e(0x114)+_0x293c9f['site']),_0x4595bf&&console[_0x456d8e(0x11d)]('Catalog:\x20'+_0x4595bf),console[_0x456d8e(0x11d)]('Database:\x20'+_0x244a3d),console[_0x456d8e(0x11d)](_0x456d8e(0x118)+_0x5d032a),console[_0x456d8e(0x11d)](_0x456d8e(0x119)+_0x5bbb3c));const _0x599eb0=_0x4595bf?_0x4595bf+'.'+_0x244a3d+'.'+_0x5d032a:_0x244a3d+'.'+_0x5d032a,_0x479242=await withSpinner(_0x456d8e(0x129)+_0x599eb0+_0x456d8e(0x120),()=>_0x1de935[_0x456d8e(0x106)][_0x456d8e(0x10e)](_0x244a3d,_0x5d032a,_0x5bbb3c,_0x4595bf),{'verbose':_0x293c9f[_0x456d8e(0x113)]}),_0x5c9daf=_0x479242[_0x456d8e(0x117)],_0x3aa38b=_0x5c9daf['data'];return _0x3aa38b[_0x456d8e(0x122)]===0x0?console['error'](_0x456d8e(0x107)):console[_0x456d8e(0x11d)](_0x456d8e(0x127)+_0x3aa38b[_0x456d8e(0x122)]+_0x456d8e(0x108)+(_0x3aa38b[_0x456d8e(0x122)]!==0x1?'s':'')+_0x456d8e(0x11e)+_0x599eb0),await handleSDKOutput(_0x3aa38b,_0x293c9f),0x0;}catch(_0x2917d8){if(_0x2917d8 instanceof SDKError)return console[_0x456d8e(0x11d)](_0x456d8e(0x12a)+_0x2917d8[_0x456d8e(0x11b)]),_0x2917d8['cause']&&console['error'](_0x456d8e(0x116)+_0x2917d8[_0x456d8e(0x10a)]),0x1;throw _0x2917d8;}}['validate'](_0x2ef3c2){const _0x137c4a=a46_0xd891d1;if(_0x2ef3c2[_0x137c4a(0x10b)][_0x137c4a(0x122)]===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(_0x2ef3c2[_0x137c4a(0x10b)]['length']>0x1)return _0x137c4a(0x10d);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x11c561=a47_0x4783;(function(_0x437982,_0x42545f){const _0x393ad5=a47_0x4783,_0x66531d=_0x437982();while(!![]){try{const _0x1a10d2=parseInt(_0x393ad5(0x176))/0x1*(-parseInt(_0x393ad5(0x18c))/0x2)+-parseInt(_0x393ad5(0x18d))/0x3+-parseInt(_0x393ad5(0x167))/0x4+parseInt(_0x393ad5(0x16f))/0x5+-parseInt(_0x393ad5(0x173))/0x6*(parseInt(_0x393ad5(0x189))/0x7)+-parseInt(_0x393ad5(0x164))/0x8+parseInt(_0x393ad5(0x17a))/0x9;if(_0x1a10d2===_0x42545f)break;else _0x66531d['push'](_0x66531d['shift']());}catch(_0xc3e9b6){_0x66531d['push'](_0x66531d['shift']());}}}(a47_0xfffc,0xd1be1));import{BaseCommand,printAuthError}from'./command.js';function a47_0x4783(_0x10a29e,_0x582b82){_0x10a29e=_0x10a29e-0x163;const _0xfffc69=a47_0xfffc();let _0x478362=_0xfffc69[_0x10a29e];return _0x478362;}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_0xfffc(){const _0x38cd7f=['site:\x20','Show\x20authentication\x20status\x20and\x20current\x20context','1580272MhvgmW','bold','message','117292WNEtbC','tdx','status','red','config','first_name','execute','CLI\x20flag','6265770QUKWln','profileSource','dim','No\x20credential\x20found','186qmkBQB','account_id','\x20profile:\x20','1zUxlWo','OAuth','Credential\x20type:\x20','site','31638852DECMuP','log','yellow','TDX_PROFILE\x20env','Read\x20credential\x20from\x20','description','cyan','(from\x20','last_name','profile','name','session','N/A','Name:','error','355621YcDoir','cli','join','1110612NDIJOq','4657263HaDdHy'];a47_0xfffc=function(){return _0x38cd7f;};return a47_0xfffc();}import a47_0x14ff0c from'chalk';export class StatusCommand extends BaseCommand{[a47_0x11c561(0x184)]=a47_0x11c561(0x169);[a47_0x11c561(0x17f)]=a47_0x11c561(0x163);async[a47_0x11c561(0x16d)](_0x1c0416){const _0x3231d0=a47_0x11c561,{options:_0x29ddd1,tdx:_0xff5060}=_0x1c0416,_0x537f10=_0x29ddd1[_0x3231d0(0x179)],_0x37c906=new GlobalContext(_0x29ddd1),_0x54098d=_0x37c906[_0x3231d0(0x183)],_0x16577b=_0x37c906[_0x3231d0(0x170)],_0x59eb8a=_0x16577b===_0x3231d0(0x18a)?_0x3231d0(0x16e):_0x16577b===_0x3231d0(0x185)?_0x3231d0(0x185):_0x16577b==='env'?_0x3231d0(0x17d):_0x16577b===_0x3231d0(0x16b)?_0x3231d0(0x16b):null,_0x196369=_0x54098d?a47_0x14ff0c[_0x3231d0(0x180)](_0x54098d):a47_0x14ff0c[_0x3231d0(0x171)](_0x3231d0(0x186)),_0xa90006=_0x59eb8a?'\x20'+a47_0x14ff0c[_0x3231d0(0x171)](_0x3231d0(0x181)+_0x59eb8a+')'):'';console[_0x3231d0(0x17b)](a47_0x14ff0c[_0x3231d0(0x165)](_0x3231d0(0x168))+_0x3231d0(0x175)+_0x196369+_0xa90006+'\x20'+a47_0x14ff0c['dim']('(')+_0x3231d0(0x18e)+a47_0x14ff0c[_0x3231d0(0x180)](_0x537f10)+a47_0x14ff0c[_0x3231d0(0x171)](')'));const _0x31a0bb=await getOAuthTokens(_0x54098d);if(_0x31a0bb)console['log'](_0x3231d0(0x178)+a47_0x14ff0c[_0x3231d0(0x180)](_0x3231d0(0x177)));else{const _0x2df688=await resolveAPIKeyAsync(_0x537f10,_0x54098d);if(_0x2df688){const {source:_0x1489a3,isDeprecated:_0x53fb46}=_0x2df688,_0xb05943=_0x3231d0(0x17e)+a47_0x14ff0c[_0x3231d0(0x180)](_0x1489a3);console['log'](_0x53fb46?a47_0x14ff0c[_0x3231d0(0x17c)](_0xb05943):_0xb05943);}else console['log'](a47_0x14ff0c[_0x3231d0(0x17c)](_0x3231d0(0x172)));}let _0x38702e=![];try{const _0x5a1ed0=await _0xff5060['jobs']['getUserInfo']();console[_0x3231d0(0x17b)](a47_0x14ff0c['green']('✓\x20Authentication\x20successful\x0a')),console[_0x3231d0(0x17b)](a47_0x14ff0c['bold']('User:')+'\x20'+a47_0x14ff0c[_0x3231d0(0x180)](_0x5a1ed0['email']));if(_0x5a1ed0['first_name']||_0x5a1ed0[_0x3231d0(0x182)]){const _0x5ed9ad=[_0x5a1ed0[_0x3231d0(0x16c)],_0x5a1ed0[_0x3231d0(0x182)]]['filter'](Boolean)[_0x3231d0(0x18b)]('\x20');console['log'](a47_0x14ff0c[_0x3231d0(0x165)](_0x3231d0(0x187))+'\x20'+_0x5ed9ad);}_0x5a1ed0[_0x3231d0(0x174)]&&console[_0x3231d0(0x17b)](a47_0x14ff0c[_0x3231d0(0x165)]('Account\x20ID:')+'\x20'+a47_0x14ff0c['yellow'](_0x5a1ed0[_0x3231d0(0x174)])),_0x38702e=!![];}catch(_0x11d175){_0x11d175 instanceof HTTPClientError&&_0x11d175[_0x3231d0(0x169)]===0x191?printAuthError(_0x11d175,!![],_0x54098d):console[_0x3231d0(0x188)](a47_0x14ff0c[_0x3231d0(0x16a)]('✗\x20Validation\x20failed:\x20'+(_0x11d175 instanceof Error?_0x11d175[_0x3231d0(0x166)]:String(_0x11d175))));}return console[_0x3231d0(0x17b)](),_0x37c906['displayWithSources'](),_0x38702e?0x0:0x1;}}
1
+ const a47_0x1327d8=a47_0x5b88;(function(_0x610b96,_0x56efe4){const _0x574fea=a47_0x5b88,_0x4cb347=_0x610b96();while(!![]){try{const _0x1aab3a=-parseInt(_0x574fea(0xdd))/0x1*(parseInt(_0x574fea(0xeb))/0x2)+-parseInt(_0x574fea(0xdb))/0x3*(parseInt(_0x574fea(0xe7))/0x4)+parseInt(_0x574fea(0xd5))/0x5*(parseInt(_0x574fea(0xe5))/0x6)+parseInt(_0x574fea(0xc5))/0x7*(-parseInt(_0x574fea(0xcb))/0x8)+parseInt(_0x574fea(0xed))/0x9+-parseInt(_0x574fea(0xc8))/0xa+parseInt(_0x574fea(0xca))/0xb;if(_0x1aab3a===_0x56efe4)break;else _0x4cb347['push'](_0x4cb347['shift']());}catch(_0x102200){_0x4cb347['push'](_0x4cb347['shift']());}}}(a47_0xb75d,0xcaf14));function a47_0xb75d(){const _0x58641e=['last_name','site','Show\x20authentication\x20status\x20and\x20current\x20context','36wkeYFX','execute','28136zXWhHC','env','red','User:','4418oHxPJC','account_id','7025418VGoeMx','jobs','tdx','TDX_PROFILE\x20env','green','Name:','first_name','description','OAuth','238fsQGnh','join','Read\x20credential\x20from\x20','8043030cGxQzS','yellow','3310626ONkCrt','26440UWwZvb','session','Account\x20ID:','No\x20credential\x20found','status','displayWithSources','cli','bold','profileSource','log','1172805DZrbaB','N/A','getUserInfo','dim','(from\x20','message','219ObxPET','filter','103BxjXeO','error','config','site:\x20','cyan'];a47_0xb75d=function(){return _0x58641e;};return a47_0xb75d();}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_0x5b88(_0x49588d,_0x1fd6b9){_0x49588d=_0x49588d-0xc0;const _0xb75d04=a47_0xb75d();let _0x5b8824=_0xb75d04[_0x49588d];return _0x5b8824;}import a47_0x5b01ad from'chalk';export class StatusCommand extends BaseCommand{['name']=a47_0x1327d8(0xcf);[a47_0x1327d8(0xc3)]=a47_0x1327d8(0xe4);async[a47_0x1327d8(0xe6)](_0x162858){const _0x302344=a47_0x1327d8,{options:_0x183add,tdx:_0x4b6169}=_0x162858,_0x28eca2=_0x183add[_0x302344(0xe3)],_0x8f134a=new GlobalContext(_0x183add),_0x822855=_0x8f134a['profile'],_0x824061=_0x8f134a[_0x302344(0xd3)],_0x354aff=_0x824061===_0x302344(0xd1)?'CLI\x20flag':_0x824061==='session'?_0x302344(0xcc):_0x824061===_0x302344(0xe8)?_0x302344(0xf0):_0x824061===_0x302344(0xdf)?'config':null,_0x497bda=_0x822855?a47_0x5b01ad[_0x302344(0xe1)](_0x822855):a47_0x5b01ad[_0x302344(0xd8)](_0x302344(0xd6)),_0x2e48ad=_0x354aff?'\x20'+a47_0x5b01ad[_0x302344(0xd8)](_0x302344(0xd9)+_0x354aff+')'):'';console[_0x302344(0xd4)](a47_0x5b01ad[_0x302344(0xd2)](_0x302344(0xef))+'\x20profile:\x20'+_0x497bda+_0x2e48ad+'\x20'+a47_0x5b01ad[_0x302344(0xd8)]('(')+_0x302344(0xe0)+a47_0x5b01ad[_0x302344(0xe1)](_0x28eca2)+a47_0x5b01ad[_0x302344(0xd8)](')'));const _0x210617=await getOAuthTokens(_0x822855);if(_0x210617)console[_0x302344(0xd4)]('Credential\x20type:\x20'+a47_0x5b01ad[_0x302344(0xe1)](_0x302344(0xc4)));else{const _0x17dbbf=await resolveAPIKeyAsync(_0x28eca2,_0x822855);if(_0x17dbbf){const {source:_0x50cb3b,isDeprecated:_0x24109e}=_0x17dbbf,_0x142a29=_0x302344(0xc7)+a47_0x5b01ad[_0x302344(0xe1)](_0x50cb3b);console[_0x302344(0xd4)](_0x24109e?a47_0x5b01ad['yellow'](_0x142a29):_0x142a29);}else console[_0x302344(0xd4)](a47_0x5b01ad[_0x302344(0xc9)](_0x302344(0xce)));}let _0x3e5af3=![];try{const _0x80fee5=await _0x4b6169[_0x302344(0xee)][_0x302344(0xd7)]();console[_0x302344(0xd4)](a47_0x5b01ad[_0x302344(0xc0)]('✓\x20Authentication\x20successful\x0a')),console[_0x302344(0xd4)](a47_0x5b01ad[_0x302344(0xd2)](_0x302344(0xea))+'\x20'+a47_0x5b01ad[_0x302344(0xe1)](_0x80fee5['email']));if(_0x80fee5[_0x302344(0xc2)]||_0x80fee5[_0x302344(0xe2)]){const _0x2301b3=[_0x80fee5[_0x302344(0xc2)],_0x80fee5[_0x302344(0xe2)]][_0x302344(0xdc)](Boolean)[_0x302344(0xc6)]('\x20');console[_0x302344(0xd4)](a47_0x5b01ad['bold'](_0x302344(0xc1))+'\x20'+_0x2301b3);}_0x80fee5[_0x302344(0xec)]&&console['log'](a47_0x5b01ad[_0x302344(0xd2)](_0x302344(0xcd))+'\x20'+a47_0x5b01ad[_0x302344(0xc9)](_0x80fee5['account_id'])),_0x3e5af3=!![];}catch(_0x2f35a5){_0x2f35a5 instanceof HTTPClientError&&_0x2f35a5[_0x302344(0xcf)]===0x191?printAuthError(_0x2f35a5,!![],_0x822855):console[_0x302344(0xde)](a47_0x5b01ad[_0x302344(0xe9)]('✗\x20Validation\x20failed:\x20'+(_0x2f35a5 instanceof Error?_0x2f35a5[_0x302344(0xda)]:String(_0x2f35a5))));}return console[_0x302344(0xd4)](),_0x8f134a[_0x302344(0xd0)](),_0x3e5af3?0x0:0x1;}}