@treasuredata/tdx 2026.4.22 → 2026.4.23

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 (224) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.d.ts +7 -0
  81. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/passthrough-server.js.map +1 -1
  84. package/dist/proxy/sse-usage-parser.js +1 -1
  85. package/dist/sdk/agent/agent-config.js +1 -1
  86. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/tool-target-registry.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/cas/cas-api-client.js +1 -1
  96. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  97. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  98. package/dist/sdk/cas/index.js +1 -1
  99. package/dist/sdk/cas/pull-workflow.js +1 -1
  100. package/dist/sdk/cas/push-workflow.js +1 -1
  101. package/dist/sdk/client/cdp-api-client.js +1 -1
  102. package/dist/sdk/client/delivery-api-client.js +1 -1
  103. package/dist/sdk/client/endpoints.js +1 -1
  104. package/dist/sdk/client/engage-api-client.js +1 -1
  105. package/dist/sdk/client/http-client.js +1 -1
  106. package/dist/sdk/client/llm-api-client.js +1 -1
  107. package/dist/sdk/client/oauth-refresh.js +1 -1
  108. package/dist/sdk/client/rate-limiter.js +1 -1
  109. package/dist/sdk/client/td-api-client.js +1 -1
  110. package/dist/sdk/client/trino-api-client.js +1 -1
  111. package/dist/sdk/client/workflow-client.js +1 -1
  112. package/dist/sdk/connection-validator.js +1 -1
  113. package/dist/sdk/connection.js +1 -1
  114. package/dist/sdk/delivery.js +1 -1
  115. package/dist/sdk/engage/campaign-pull.js +1 -1
  116. package/dist/sdk/engage/campaign-push.js +1 -1
  117. package/dist/sdk/engage/campaign-validator.js +1 -1
  118. package/dist/sdk/engage/campaign-yaml.js +1 -1
  119. package/dist/sdk/engage/template-pull.js +1 -1
  120. package/dist/sdk/engage/template-push.js +1 -1
  121. package/dist/sdk/engage/template-validator.js +1 -1
  122. package/dist/sdk/engage/template-yaml.js +1 -1
  123. package/dist/sdk/engage/types/campaign-def.js +1 -1
  124. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  125. package/dist/sdk/engage/types/template-schema.js +1 -1
  126. package/dist/sdk/engage.js +1 -1
  127. package/dist/sdk/errors.js +1 -1
  128. package/dist/sdk/index.js +1 -1
  129. package/dist/sdk/io/index.js +1 -1
  130. package/dist/sdk/io/node-filesystem.js +1 -1
  131. package/dist/sdk/job.js +1 -1
  132. package/dist/sdk/journey.js +1 -1
  133. package/dist/sdk/llm/chat-cache.js +1 -1
  134. package/dist/sdk/llm/index.js +1 -1
  135. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  136. package/dist/sdk/llm/model-factors.js +1 -1
  137. package/dist/sdk/personalization.js +1 -1
  138. package/dist/sdk/policy.js +1 -1
  139. package/dist/sdk/query/index.js +1 -1
  140. package/dist/sdk/query/sql-parser.js +1 -1
  141. package/dist/sdk/realtime.js +1 -1
  142. package/dist/sdk/schedule.js +1 -1
  143. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  144. package/dist/sdk/segment/fields-display.js +1 -1
  145. package/dist/sdk/segment/file-discovery.js +1 -1
  146. package/dist/sdk/segment/journey-utils.js +1 -1
  147. package/dist/sdk/segment/journey-validator.js +1 -1
  148. package/dist/sdk/segment/journey-yaml.js +1 -1
  149. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  150. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  151. package/dist/sdk/segment/pull-workflow.js +1 -1
  152. package/dist/sdk/segment/push-recovery.js +1 -1
  153. package/dist/sdk/segment/push-workflow.js +1 -1
  154. package/dist/sdk/segment/resolution-context.js +1 -1
  155. package/dist/sdk/segment/segment-path-parser.js +1 -1
  156. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  157. package/dist/sdk/segment/segment-validator.js +1 -1
  158. package/dist/sdk/segment/target-resolution.js +1 -1
  159. package/dist/sdk/segment/tdx-config.js +1 -1
  160. package/dist/sdk/segment/types/activation-schema.js +1 -1
  161. package/dist/sdk/segment/types/journey-def.js +1 -1
  162. package/dist/sdk/segment/types/journey-schema.js +1 -1
  163. package/dist/sdk/segment/types/segment-def.js +1 -1
  164. package/dist/sdk/segment/types/segment-schema.js +1 -1
  165. package/dist/sdk/segment/validate-files.js +1 -1
  166. package/dist/sdk/segment/yaml-validator.js +1 -1
  167. package/dist/sdk/segment.js +1 -1
  168. package/dist/sdk/types/index.js +1 -1
  169. package/dist/sdk/types/progress.js +1 -1
  170. package/dist/sdk/types/workspace.js +1 -1
  171. package/dist/sdk/user.js +1 -1
  172. package/dist/sdk/util/format-detector.js +1 -1
  173. package/dist/sdk/util/formatters.js +1 -1
  174. package/dist/sdk/util/index.js +1 -1
  175. package/dist/sdk/util/paginate.js +1 -1
  176. package/dist/sdk/util/tree-formatter.js +1 -1
  177. package/dist/sdk/workflow/archive-validation.js +1 -1
  178. package/dist/sdk/workflow/clone-workflow.js +1 -1
  179. package/dist/sdk/workflow/index.js +1 -1
  180. package/dist/sdk/workflow/pull-workflow.js +1 -1
  181. package/dist/sdk/workflow/push-workflow.js +1 -1
  182. package/dist/sdk/workflow/task-graph.js +1 -1
  183. package/dist/sdk/workflow/tdx-config.js +1 -1
  184. package/dist/sdk/workflow/workflow-utils.js +1 -1
  185. package/dist/sdk/workspace/access-tracker.js +1 -1
  186. package/dist/sdk/workspace/frontmatter.js +1 -1
  187. package/dist/sdk/workspace/git.js +1 -1
  188. package/dist/sdk/workspace/index.js +1 -1
  189. package/dist/sdk/workspace/templates.js +1 -1
  190. package/dist/sdk/workspace/weekly.js +1 -1
  191. package/dist/sdk/workspace/wikilinks.js +1 -1
  192. package/dist/test-utils/command-runner.js +1 -1
  193. package/dist/test-utils/factories.js +1 -1
  194. package/dist/test-utils/fixtures.js +1 -1
  195. package/dist/test-utils/http-mock.js +1 -1
  196. package/dist/test-utils/index.js +1 -1
  197. package/dist/utils/async.js +1 -1
  198. package/dist/utils/colors.js +1 -1
  199. package/dist/utils/diff.js +1 -1
  200. package/dist/utils/file-permissions.js +1 -1
  201. package/dist/utils/file-reader.js +1 -1
  202. package/dist/utils/github-releases.js +1 -1
  203. package/dist/utils/global-cache.js +1 -1
  204. package/dist/utils/json-loader.js +1 -1
  205. package/dist/utils/local-cache.js +1 -1
  206. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  207. package/dist/utils/logger/formatters/index.js +1 -1
  208. package/dist/utils/logger/handlers/console-handler.js +1 -1
  209. package/dist/utils/logger/handlers/file-handler.js +1 -1
  210. package/dist/utils/logger/handlers/index.js +1 -1
  211. package/dist/utils/logger/handlers/null-handler.js +1 -1
  212. package/dist/utils/logger/index.js +1 -1
  213. package/dist/utils/logger/logger.js +1 -1
  214. package/dist/utils/logger/types.js +1 -1
  215. package/dist/utils/option-validation.js +1 -1
  216. package/dist/utils/process.js +1 -1
  217. package/dist/utils/prompt.js +1 -1
  218. package/dist/utils/spinner.js +1 -1
  219. package/dist/utils/sse-parser.js +1 -1
  220. package/dist/utils/string-utils.js +1 -1
  221. package/dist/utils/table-ref-parser.js +1 -1
  222. package/dist/utils/tdx-logger.js +1 -1
  223. package/dist/utils/version-check.js +1 -1
  224. package/package.json +1 -1
@@ -1 +1 @@
1
- const a40_0x166adf=a40_0xd00e;function a40_0x1239(){const _0x21ec7f=['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)','description','3085722XxjQBg','isNew','helpText','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20=\x20','\x20new\x20files','\x20files?','4cGwPzf','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','7149785NiJkGU','Aborted.','files','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','relativePath','activations','segments','red','repeat','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','verbose','message','\x20changed\x20files','Write\x20','80mLhDpP','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','✔\x20Context\x20set:\x20','hasChanges','yellow','parentName','site','filter','errorCode','\x0aError:','dryRun','file','targetDir','40jOAUxO','\x20\x20🗺️\x20\x20','data','counts','\x0aPull\x20summary\x20for\x20\x27','content','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20with\x20','journeyVersions','2442492pCDvjV','\x20\x20🎯\x20','\x20unchanged\x20files','Target\x20resource:\x20','105159eusMFC','green','4754708FSxWmP','✔\x20Pulled\x20','parent_segment','absolutePath','cyan','dim','journeys','\x20segments','Parent\x20segment:\x20','dirname','execute','Site:\x20','40485400VIcvpm','✔\x20All\x20files\x20are\x20up\x20to\x20date','yes','\x20files\x20to\x20','665426kTOmFd','error','segment:pull','parentSegment','length','session'];a40_0x1239=function(){return _0x21ec7f;};return a40_0x1239();}(function(_0x1d4bd6,_0x5dcdd3){const _0x3962f3=a40_0xd00e,_0x3a78d2=_0x1d4bd6();while(!![]){try{const _0xf0c97e=-parseInt(_0x3962f3(0x168))/0x1+-parseInt(_0x3962f3(0x13c))/0x2*(-parseInt(_0x3962f3(0x156))/0x3)+-parseInt(_0x3962f3(0x12c))/0x4*(parseInt(_0x3962f3(0x12e))/0x5)+-parseInt(_0x3962f3(0x125))/0x6+-parseInt(_0x3962f3(0x158))/0x7+parseInt(_0x3962f3(0x149))/0x8*(-parseInt(_0x3962f3(0x152))/0x9)+parseInt(_0x3962f3(0x164))/0xa;if(_0xf0c97e===_0x5dcdd3)break;else _0x3a78d2['push'](_0x3a78d2['shift']());}catch(_0x4e6a10){_0x3a78d2['push'](_0x3a78d2['shift']());}}}(a40_0x1239,0xc47c6));function a40_0xd00e(_0x54e8e9,_0x5a76d9){_0x54e8e9=_0x54e8e9-0x124;const _0x1239b3=a40_0x1239();let _0xd00e28=_0x1239b3[_0x54e8e9];return _0xd00e28;}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_0x47ec77 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x24a184 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a40_0x166adf(0x16a);[a40_0x166adf(0x124)]=a40_0x166adf(0x12d);async[a40_0x166adf(0x162)](_0x3b9d6d){const _0x1bbf46=a40_0x166adf,{options:_0x5cbcaf,args:_0x1def02,tdx:_0xf72d98}=_0x3b9d6d,_0x5629dc=_0x5cbcaf,_0x22bef6=await resolveTarget({'arg':_0x1def02[0x0],'contextParent':_0x5cbcaf[_0x1bbf46(0x16b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x22bef6))return _0x22bef6[_0x1bbf46(0x144)]==='no_parent'?(console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x140)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x1bbf46(0x16e)),console[_0x1bbf46(0x169)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x1bbf46(0x169)](_0x1bbf46(0x13d))):(console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x135)]('Error:\x20'+_0x22bef6[_0x1bbf46(0x139)]+'\x0a')),_0x22bef6[_0x1bbf46(0x127)]&&console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x15c)](_0x22bef6[_0x1bbf46(0x127)]))),0x1;const _0x4d40b6=_0x22bef6[_0x1bbf46(0x141)],_0x498f00=_0x22bef6[_0x1bbf46(0x148)],_0x44f8c4=_0x22bef6['type']===_0x1bbf46(0x147)?_0x22bef6['resourceName']:undefined;_0x5629dc['verbose']&&(console[_0x1bbf46(0x169)](_0x1bbf46(0x163)+_0x5629dc[_0x1bbf46(0x142)]),console[_0x1bbf46(0x169)](_0x1bbf46(0x160)+_0x4d40b6),_0x44f8c4&&console[_0x1bbf46(0x169)](_0x1bbf46(0x155)+_0x44f8c4));const _0x4f9f97=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4d40b6+'\x27...',_0x1c6b00=>_0xf72d98['segment']['pullSegments'](_0x4d40b6,{'targetDir':_0x498f00,'targetResourceName':_0x44f8c4,'verbose':_0x5629dc[_0x1bbf46(0x138)],'progress':{'update':_0x372cf4=>{const _0x132e00=_0x1bbf46;_0x1c6b00['setPhase'](_0x372cf4),_0x5629dc[_0x132e00(0x138)]&&console['error']('\x20\x20'+_0x372cf4);}}}),{'verbose':_0x5629dc['verbose']}),_0x262f31=_0x4f9f97[_0x1bbf46(0x14b)];if(_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x134)]===0x0&&_0x262f31[_0x1bbf46(0x14c)]['journeys']===0x0)return console['error'](a40_0x47ec77[_0x1bbf46(0x140)](_0x1bbf46(0x131)+_0x262f31[_0x1bbf46(0x141)]+'\x27')),0x0;const _0x3714a2=_0x262f31['files'][_0x1bbf46(0x143)](_0xfbe879=>_0xfbe879[_0x1bbf46(0x126)]),_0x27ad11=_0x262f31['files']['filter'](_0x4ce01f=>!_0x4ce01f[_0x1bbf46(0x126)]&&_0x4ce01f[_0x1bbf46(0x13f)]),_0x2191c0=_0x262f31['files'][_0x1bbf46(0x143)](_0x2cf6f7=>!_0x2cf6f7[_0x1bbf46(0x126)]&&!_0x2cf6f7[_0x1bbf46(0x13f)]);console[_0x1bbf46(0x169)](_0x1bbf46(0x14d)+_0x262f31[_0x1bbf46(0x141)]+'\x27:'),console['error'](_0x1bbf46(0x153)+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x134)]+_0x1bbf46(0x15f))+_0x1bbf46(0x150)+a40_0x47ec77['cyan'](_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x133)]+'\x20activations'));if(_0x262f31['counts'][_0x1bbf46(0x15e)]>0x0){const _0xfd8aa3=_0x262f31['counts'][_0x1bbf46(0x151)]>_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x15e)]?'\x20('+_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x151)]+'\x20versions)':'';console['error'](_0x1bbf46(0x14a)+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31['counts'][_0x1bbf46(0x15e)]+'\x20journeys')+a40_0x47ec77[_0x1bbf46(0x15d)](_0xfd8aa3));}console[_0x1bbf46(0x169)]('\x20\x20'+a40_0x47ec77[_0x1bbf46(0x157)]('+\x20'+_0x3714a2[_0x1bbf46(0x16c)]+_0x1bbf46(0x12a))),console[_0x1bbf46(0x169)]('\x20\x20'+a40_0x47ec77[_0x1bbf46(0x140)]('~\x20'+_0x27ad11[_0x1bbf46(0x16c)]+_0x1bbf46(0x13a))),console['error']('\x20\x20'+a40_0x47ec77[_0x1bbf46(0x15d)]('=\x20'+_0x2191c0['length']+_0x1bbf46(0x154))),console[_0x1bbf46(0x169)]('\x20\x20Target:\x20'+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31[_0x1bbf46(0x148)])+'\x0a');if(_0x27ad11[_0x1bbf46(0x16c)]>0x0)for(const _0x500df6 of _0x27ad11){console['error']('\x0aChanges\x20to\x20\x27'+_0x500df6[_0x1bbf46(0x132)]+'\x27:'),console[_0x1bbf46(0x169)]('─'[_0x1bbf46(0x136)](0x3c)),console[_0x1bbf46(0x169)](_0x500df6['diff']),console['error']('─'[_0x1bbf46(0x136)](0x3c));}if(_0x5629dc[_0x1bbf46(0x146)])return console[_0x1bbf46(0x169)](a40_0x47ec77['yellow'](_0x1bbf46(0x128))),0x0;if(_0x3714a2[_0x1bbf46(0x16c)]===0x0&&_0x27ad11['length']===0x0)return console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x157)](_0x1bbf46(0x165))),saveSessionContext({'parent_segment':_0x262f31[_0x1bbf46(0x141)]},_0x5629dc[_0x1bbf46(0x16d)]),console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x157)]('✔\x20Context\x20set:\x20'+a40_0x47ec77[_0x1bbf46(0x15d)](_0x1bbf46(0x15a))+_0x1bbf46(0x129)+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31[_0x1bbf46(0x141)]))),0x0;if(!_0x5629dc[_0x1bbf46(0x166)]){if(!isInteractive())return console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x135)](_0x1bbf46(0x145)),_0x1bbf46(0x137)),console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x15d)](_0x1bbf46(0x14f))),0x1;const _0x5dc3ac=await confirmKey(_0x1bbf46(0x13b)+(_0x3714a2['length']+_0x27ad11[_0x1bbf46(0x16c)])+_0x1bbf46(0x12b));if(!_0x5dc3ac)return console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x140)](_0x1bbf46(0x12f)),'-\x20no\x20files\x20written'),0x1;}for(const _0x26c7a0 of _0x262f31[_0x1bbf46(0x130)]){if(_0x26c7a0['isNew']||_0x26c7a0['hasChanges']){const _0x4768eb=a40_0x24a184[_0x1bbf46(0x161)](_0x26c7a0[_0x1bbf46(0x15b)]);!existsSync(_0x4768eb)&&mkdirSync(_0x4768eb,{'recursive':!![]}),writeFileSync(_0x26c7a0['absolutePath'],_0x26c7a0[_0x1bbf46(0x14e)],'utf-8');}}return console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x157)](_0x1bbf46(0x159)+(_0x3714a2[_0x1bbf46(0x16c)]+_0x27ad11[_0x1bbf46(0x16c)])+_0x1bbf46(0x167)+_0x262f31['targetDir'])),saveSessionContext({'parent_segment':_0x262f31[_0x1bbf46(0x141)]},_0x5629dc[_0x1bbf46(0x16d)]),console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x157)](_0x1bbf46(0x13e)+a40_0x47ec77[_0x1bbf46(0x15d)](_0x1bbf46(0x15a))+_0x1bbf46(0x129)+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31[_0x1bbf46(0x141)]))),0x0;}}
1
+ const a40_0x4606a0=a40_0x3d36;(function(_0x855481,_0x339b32){const _0x4915f8=a40_0x3d36,_0x2106c7=_0x855481();while(!![]){try{const _0x240843=parseInt(_0x4915f8(0xe6))/0x1*(-parseInt(_0x4915f8(0x102))/0x2)+parseInt(_0x4915f8(0xec))/0x3*(parseInt(_0x4915f8(0x115))/0x4)+parseInt(_0x4915f8(0x11d))/0x5*(parseInt(_0x4915f8(0xf0))/0x6)+parseInt(_0x4915f8(0xfc))/0x7*(parseInt(_0x4915f8(0xff))/0x8)+-parseInt(_0x4915f8(0xfd))/0x9*(-parseInt(_0x4915f8(0xfe))/0xa)+-parseInt(_0x4915f8(0xe8))/0xb*(parseInt(_0x4915f8(0x105))/0xc)+parseInt(_0x4915f8(0x10b))/0xd;if(_0x240843===_0x339b32)break;else _0x2106c7['push'](_0x2106c7['shift']());}catch(_0x263c0d){_0x2106c7['push'](_0x2106c7['shift']());}}}(a40_0xd4e9,0x5764b));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a40_0xd4e9(){const _0x1d7606=['journeyVersions','\x20journeys','repeat','site','segment:pull','Aborted.','119wFYIKk','91269OHXdmV','180NQzhBS','107704cvNxeo','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Site:\x20','8NmdcVb','Error:\x20','file','7625292BMTehq','Target\x20resource:\x20','hasChanges','\x20files?','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','filter','1344187ddlyJH','✔\x20All\x20files\x20are\x20up\x20to\x20date','-\x20no\x20files\x20written','✔\x20Pulled\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','targetDir','\x20unchanged\x20files','\x20\x20🎯\x20','absolutePath','yes','1999708ZSaeRL','errorCode','\x20files\x20to\x20','cyan','parentName','\x20=\x20','session','content','5pLFjBk','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)','segment','error','helpText','resourceName','journeys','length','\x0aChanges\x20to\x20\x27','\x27...','\x20changed\x20files','dim','\x20new\x20files','files','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','relativePath','activations','type','\x20activations','isNew','yellow','message','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','verbose','✔\x20Context\x20set:\x20','segments','34706JoFuzc','red','11uqxmbZ','name','\x0aError:','counts','3IiInUW','parent_segment','\x20\x20🗺️\x20\x20','dirname','704958DNFklu','green','\x20segments','description','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'];a40_0xd4e9=function(){return _0x1d7606;};return a40_0xd4e9();}import a40_0x565e9c from'chalk';function a40_0x3d36(_0x35e4d2,_0x338ef9){_0x35e4d2=_0x35e4d2-0xcc;const _0xd4e984=a40_0xd4e9();let _0x3d3631=_0xd4e984[_0x35e4d2];return _0x3d3631;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x5827c8 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_0x4606a0(0xe9)]=a40_0x4606a0(0xfa);[a40_0x4606a0(0xf3)]=a40_0x4606a0(0x109);async['execute'](_0x4b241c){const _0xca49b7=a40_0x4606a0,{options:_0x3bc6d5,args:_0xef6fd1,tdx:_0x3df31e}=_0x4b241c,_0x438d97=_0x3bc6d5,_0x5bce12=await resolveTarget({'arg':_0xef6fd1[0x0],'contextParent':_0x3bc6d5['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5bce12))return _0x5bce12[_0xca49b7(0x116)]==='no_parent'?(console[_0xca49b7(0xce)](a40_0x565e9c[_0xca49b7(0xdf)](_0xca49b7(0xe2))),console[_0xca49b7(0xce)](_0xca49b7(0xcc)),console[_0xca49b7(0xce)](_0xca49b7(0xf5)),console[_0xca49b7(0xce)](_0xca49b7(0x10f))):(console[_0xca49b7(0xce)](a40_0x565e9c['red'](_0xca49b7(0x103)+_0x5bce12[_0xca49b7(0xe0)]+'\x0a')),_0x5bce12[_0xca49b7(0xcf)]&&console[_0xca49b7(0xce)](a40_0x565e9c[_0xca49b7(0x118)](_0x5bce12['helpText']))),0x1;const _0x4709c3=_0x5bce12[_0xca49b7(0x119)],_0x13d49b=_0x5bce12[_0xca49b7(0x110)],_0x1e8a9a=_0x5bce12[_0xca49b7(0xdc)]===_0xca49b7(0x104)?_0x5bce12[_0xca49b7(0xd0)]:undefined;_0x438d97[_0xca49b7(0xe3)]&&(console[_0xca49b7(0xce)](_0xca49b7(0x101)+_0x438d97[_0xca49b7(0xf9)]),console[_0xca49b7(0xce)](_0xca49b7(0xf4)+_0x4709c3),_0x1e8a9a&&console['error'](_0xca49b7(0x106)+_0x1e8a9a));const _0x5e3423=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4709c3+_0xca49b7(0xd4),_0x477d87=>_0x3df31e[_0xca49b7(0xcd)]['pullSegments'](_0x4709c3,{'targetDir':_0x13d49b,'targetResourceName':_0x1e8a9a,'verbose':_0x438d97[_0xca49b7(0xe3)],'progress':{'update':_0x4111d9=>{const _0x5b5216=_0xca49b7;_0x477d87['setPhase'](_0x4111d9),_0x438d97[_0x5b5216(0xe3)]&&console[_0x5b5216(0xce)]('\x20\x20'+_0x4111d9);}}}),{'verbose':_0x438d97[_0xca49b7(0xe3)]}),_0x353826=_0x5e3423['data'];if(_0x353826['counts'][_0xca49b7(0xe5)]===0x0&&_0x353826[_0xca49b7(0xeb)][_0xca49b7(0xd1)]===0x0)return console[_0xca49b7(0xce)](a40_0x565e9c[_0xca49b7(0xdf)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x353826[_0xca49b7(0x119)]+'\x27')),0x0;const _0x577cca=_0x353826[_0xca49b7(0xd8)][_0xca49b7(0x10a)](_0x54a5b7=>_0x54a5b7['isNew']),_0x5d75e8=_0x353826['files'][_0xca49b7(0x10a)](_0x1fc970=>!_0x1fc970['isNew']&&_0x1fc970[_0xca49b7(0x107)]),_0x19f899=_0x353826[_0xca49b7(0xd8)]['filter'](_0x344420=>!_0x344420[_0xca49b7(0xde)]&&!_0x344420['hasChanges']);console[_0xca49b7(0xce)]('\x0aPull\x20summary\x20for\x20\x27'+_0x353826[_0xca49b7(0x119)]+'\x27:'),console[_0xca49b7(0xce)](_0xca49b7(0x112)+a40_0x565e9c[_0xca49b7(0x118)](_0x353826[_0xca49b7(0xeb)][_0xca49b7(0xe5)]+_0xca49b7(0xf2))+'\x20with\x20'+a40_0x565e9c[_0xca49b7(0x118)](_0x353826['counts'][_0xca49b7(0xdb)]+_0xca49b7(0xdd)));if(_0x353826['counts'][_0xca49b7(0xd1)]>0x0){const _0x34a826=_0x353826[_0xca49b7(0xeb)][_0xca49b7(0xf6)]>_0x353826[_0xca49b7(0xeb)]['journeys']?'\x20('+_0x353826[_0xca49b7(0xeb)][_0xca49b7(0xf6)]+'\x20versions)':'';console[_0xca49b7(0xce)](_0xca49b7(0xee)+a40_0x565e9c['cyan'](_0x353826[_0xca49b7(0xeb)][_0xca49b7(0xd1)]+_0xca49b7(0xf7))+a40_0x565e9c[_0xca49b7(0xd6)](_0x34a826));}console[_0xca49b7(0xce)]('\x20\x20'+a40_0x565e9c['green']('+\x20'+_0x577cca[_0xca49b7(0xd2)]+_0xca49b7(0xd7))),console[_0xca49b7(0xce)]('\x20\x20'+a40_0x565e9c[_0xca49b7(0xdf)]('~\x20'+_0x5d75e8[_0xca49b7(0xd2)]+_0xca49b7(0xd5))),console[_0xca49b7(0xce)]('\x20\x20'+a40_0x565e9c[_0xca49b7(0xd6)]('=\x20'+_0x19f899[_0xca49b7(0xd2)]+_0xca49b7(0x111))),console[_0xca49b7(0xce)]('\x20\x20Target:\x20'+a40_0x565e9c[_0xca49b7(0x118)](_0x353826[_0xca49b7(0x110)])+'\x0a');if(_0x5d75e8[_0xca49b7(0xd2)]>0x0)for(const _0x3b7271 of _0x5d75e8){console[_0xca49b7(0xce)](_0xca49b7(0xd3)+_0x3b7271[_0xca49b7(0xda)]+'\x27:'),console['error']('─'[_0xca49b7(0xf8)](0x3c)),console['error'](_0x3b7271['diff']),console[_0xca49b7(0xce)]('─'[_0xca49b7(0xf8)](0x3c));}if(_0x438d97['dryRun'])return console['error'](a40_0x565e9c['yellow'](_0xca49b7(0xd9))),0x0;if(_0x577cca[_0xca49b7(0xd2)]===0x0&&_0x5d75e8[_0xca49b7(0xd2)]===0x0)return console['error'](a40_0x565e9c[_0xca49b7(0xf1)](_0xca49b7(0x10c))),saveSessionContext({'parent_segment':_0x353826[_0xca49b7(0x119)]},_0x438d97[_0xca49b7(0x11b)]),console[_0xca49b7(0xce)](a40_0x565e9c[_0xca49b7(0xf1)](_0xca49b7(0xe4)+a40_0x565e9c[_0xca49b7(0xd6)](_0xca49b7(0xed))+'\x20=\x20'+a40_0x565e9c[_0xca49b7(0x118)](_0x353826[_0xca49b7(0x119)]))),0x0;if(!_0x438d97[_0xca49b7(0x114)]){if(!isInteractive())return console[_0xca49b7(0xce)](a40_0x565e9c[_0xca49b7(0xe7)](_0xca49b7(0xea)),_0xca49b7(0xe1)),console[_0xca49b7(0xce)](a40_0x565e9c[_0xca49b7(0xd6)](_0xca49b7(0x100))),0x1;const _0x565b19=await confirmKey('Write\x20'+(_0x577cca[_0xca49b7(0xd2)]+_0x5d75e8[_0xca49b7(0xd2)])+_0xca49b7(0x108));if(!_0x565b19)return console['error'](a40_0x565e9c[_0xca49b7(0xdf)](_0xca49b7(0xfb)),_0xca49b7(0x10d)),0x1;}for(const _0xcbc4ad of _0x353826[_0xca49b7(0xd8)]){if(_0xcbc4ad[_0xca49b7(0xde)]||_0xcbc4ad[_0xca49b7(0x107)]){const _0x2ff180=a40_0x5827c8[_0xca49b7(0xef)](_0xcbc4ad[_0xca49b7(0x113)]);!existsSync(_0x2ff180)&&mkdirSync(_0x2ff180,{'recursive':!![]}),writeFileSync(_0xcbc4ad[_0xca49b7(0x113)],_0xcbc4ad[_0xca49b7(0x11c)],'utf-8');}}return console['error'](a40_0x565e9c[_0xca49b7(0xf1)](_0xca49b7(0x10e)+(_0x577cca[_0xca49b7(0xd2)]+_0x5d75e8[_0xca49b7(0xd2)])+_0xca49b7(0x117)+_0x353826[_0xca49b7(0x110)])),saveSessionContext({'parent_segment':_0x353826[_0xca49b7(0x119)]},_0x438d97['session']),console[_0xca49b7(0xce)](a40_0x565e9c[_0xca49b7(0xf1)]('✔\x20Context\x20set:\x20'+a40_0x565e9c['dim'](_0xca49b7(0xed))+_0xca49b7(0x11a)+a40_0x565e9c['cyan'](_0x353826['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x1ac2f4=a41_0xf44c;(function(_0x574ae1,_0x13e60a){const _0x331c46=a41_0xf44c,_0x3ccc00=_0x574ae1();while(!![]){try{const _0x39679c=parseInt(_0x331c46(0x1f5))/0x1*(-parseInt(_0x331c46(0x1de))/0x2)+-parseInt(_0x331c46(0x221))/0x3+parseInt(_0x331c46(0x1b3))/0x4*(parseInt(_0x331c46(0x23b))/0x5)+parseInt(_0x331c46(0x21b))/0x6+-parseInt(_0x331c46(0x249))/0x7+-parseInt(_0x331c46(0x210))/0x8*(parseInt(_0x331c46(0x213))/0x9)+parseInt(_0x331c46(0x20f))/0xa;if(_0x39679c===_0x13e60a)break;else _0x3ccc00['push'](_0x3ccc00['shift']());}catch(_0x4854ab){_0x3ccc00['push'](_0x3ccc00['shift']());}}}(a41_0x4b0f,0xb6f30));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_0x4c8e7e 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';function a41_0xf44c(_0x5e707d,_0x47ec67){_0x5e707d=_0x5e707d-0x1af;const _0x4b0ff8=a41_0x4b0f();let _0xf44cfd=_0x4b0ff8[_0x5e707d];return _0xf44cfd;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a41_0x4b0f(){const _0x819188=['journey','cyan','parentFolder','/e/','folderId','idToName','(Journey\x20will\x20be\x20deleted)','updated','Delete\x20segment:','map','\x20to\x20create','Source\x20directory:\x20','unchanged','95385LfDsET','verbose','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','join','push','Preparing\x20journeys...','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','toUpdate','\x27...','Fetching\x20existing\x20data...','Error:\x20Directory\x20not\x20found:\x20','Scoped\x20to\x20folder:\x20','red','Site:\x20','7546770HMiaLe','nameToId','file','nameToType','Fetching\x20existing\x20activations...','toCreate','createdSegmentIds','108xBCBYf','filter','length','cwd','diff','yes','Parent\x20segment:\x20','listJourneysWithDetailsFromParentSegment','yellow','isNew','helpText','set','\x20\x20Activations:\x20','journeyBundleName','created','.yml','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aValidation\x20failed:','\x20unchanged','blue','endsWith','targetDir','scopedFolderPath','audienceId','Fetching\x20connections\x20for\x20name\x20resolution...','message','getParent','\x20changed','journeyId','segments','/app/ps/','folders','data','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)','\x20updated','\x20to\x20delete','description','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','segment','\x20created','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','attributes','46186YXgFBl','existingJourney','name','Push\x20','\x20\x20\x20\x20','errorCode','\x0aError:','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toDelete','listSegments','\x20\x20Journeys:\x20','createdAt','error','delete','repeat','paused','\x20YAML\x20files\x20found','deleted','all','yamlConfig','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','10VHGABt','\x20activations]','dryRun','existingSegment','versionNumber','New\x20journey:','Aborted.','parentSegment','no_parent','parent_name','getJourney','results','folderPath','\x20changes?','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Error:\x20','state','/j/da/je','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','filePath','activations','journeys','journeyBundleId','site','isScoped','list','9307650EJpiRk','91496umvrkm','\x20\x20🗺️\x20\x20Journeys:','\x20deleted','450EPHLpU','then','getOutputSchemaWithCache','/sb/da/esr','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','segment\x20or\x20journey','\x20\x20Source:\x20','journeysOnly','8864568xdaYdq','\x20new','Delete\x20journey:','changed','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','user','879066ETPktL','type','new','green','listActivations','get','\x0a✔\x20Push\x20complete','dim','connection','segmentFolderId','No\x20','Resolving\x20parent\x20segment\x20\x27','buildUserMaps'];a41_0x4b0f=function(){return _0x819188;};return a41_0x4b0f();}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_0x1ac2f4(0x1e0)]='segment:push';[a41_0x1ac2f4(0x1d7)]=a41_0x1ac2f4(0x207);async['execute'](_0x281283){const _0x15a334=a41_0x1ac2f4,{options:_0x187b16,args:_0xc6d2f6,tdx:_0x1fb905}=_0x281283,_0x2a6127=_0x187b16,_0x163d9b=await resolveTarget({'arg':_0xc6d2f6[0x0],'contextParent':_0x187b16[_0x15a334(0x1fc)],'cwd':process[_0x15a334(0x1b6)]()});if(!isSuccessfulResolution(_0x163d9b))return _0x163d9b[_0x15a334(0x1e3)]===_0x15a334(0x1fd)?(console['error'](a41_0x4c8e7e['yellow'](_0x15a334(0x23d))),console['error'](_0x15a334(0x1d4)),console['error'](_0x15a334(0x1f4)),console['error'](_0x15a334(0x1e6))):(console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x204)+_0x163d9b['message']+'\x0a')),_0x163d9b['helpText']&&console[_0x15a334(0x1ec)](a41_0x4c8e7e['cyan'](_0x163d9b[_0x15a334(0x1bd)]))),0x1;if(_0x163d9b['type']===_0x15a334(0x1fe))return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x245)+_0x163d9b['targetDir']+'\x0a')),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x22f)](_0x15a334(0x1d8))),0x1;const _0x481b0a=_0x163d9b['parentName'],_0x27c1e5=_0x163d9b[_0x15a334(0x1c8)],_0x23b3d0=_0x163d9b[_0x15a334(0x222)]===_0x15a334(0x24b)?_0x163d9b[_0x15a334(0x208)]:undefined,_0x7e38b3=getScopedDetails(_0x163d9b),_0x2ed217=_0x7e38b3?.[_0x15a334(0x20d)]??![],_0x5e4ae1=_0x7e38b3?.[_0x15a334(0x1c9)]??'';if(!existsSync(_0x27c1e5))return console['error'](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x245)+_0x27c1e5+'\x0a')),console['error'](a41_0x4c8e7e[_0x15a334(0x22f)](_0x15a334(0x1d8))),0x1;_0x2a6127[_0x15a334(0x23c)]&&(console[_0x15a334(0x1ec)](_0x15a334(0x248)+_0x2a6127[_0x15a334(0x20c)]),console[_0x15a334(0x1ec)](_0x15a334(0x1b9)+_0x481b0a),console[_0x15a334(0x1ec)](_0x15a334(0x239)+_0x27c1e5),_0x2ed217&&console[_0x15a334(0x1ec)](_0x15a334(0x246)+_0x5e4ae1));const _0x163258=await withSpinner(_0x15a334(0x22c)+_0x481b0a+_0x15a334(0x243),()=>_0x1fb905[_0x15a334(0x1da)][_0x15a334(0x1e5)](_0x481b0a),{'verbose':_0x2a6127['verbose']}),_0x486cee=_0x163258[_0x15a334(0x1d3)],{parentSegmentResult:_0x55b01e,segmentsResult:_0x5a8167,foldersResult:_0x31c1dd,journeysWithDetailsResult:_0x552b57,userMaps:_0x9746d3}=await withSpinner(_0x15a334(0x244),async()=>{const _0xa0714=_0x15a334,[_0x48a53c,_0x344b2c,_0x221238,_0x45c0a6,_0x5bde12]=await Promise[_0xa0714(0x1f2)]([_0x1fb905['segment'][_0xa0714(0x1cd)](_0x486cee),_0x1fb905[_0xa0714(0x1da)][_0xa0714(0x1e9)](_0x486cee),_0x1fb905['segment']['listFolders'](_0x486cee),_0x1fb905['journey'][_0xa0714(0x1ba)](_0x486cee,{'includeAllVersions':!![]}),_0x1fb905[_0xa0714(0x220)][_0xa0714(0x22d)]()]);return{'parentSegmentResult':_0x48a53c,'segmentsResult':_0x344b2c,'foldersResult':_0x221238,'journeysWithDetailsResult':_0x45c0a6,'userMaps':_0x5bde12};},{'verbose':_0x2a6127[_0x15a334(0x23c)]})[_0x15a334(0x214)](_0x49ca96=>_0x49ca96[_0x15a334(0x1d3)]),_0x32d4cb=_0x55b01e,_0x1c5d48=extractRootFolderId(_0x32d4cb),_0x251903=_0x5a8167,_0x2fcbdc=_0x31c1dd,{journeys:_0x2e820c,activationStepsById:_0x480837}=_0x552b57,_0x5107a9=new Map(_0x2e820c['map'](_0x2a580e=>[_0x2a580e['id'],_0x2a580e])),_0x17be51=_0x2e820c['map'](_0x3db85f=>({'id':_0x3db85f['id'],'name':_0x3db85f['attributes']['name'],'journeyBundleName':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x1c0)]||'','journeyBundleId':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x20b)]||'','versionNumber':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x1f9)],'description':_0x3db85f['attributes'][_0x15a334(0x1d7)],'state':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x205)],'paused':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x1ef)],'audienceId':_0x3db85f['attributes'][_0x15a334(0x1ca)],'folderId':_0x3db85f['relationships']?.[_0x15a334(0x230)]?.['data']?.['id'],'createdAt':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x1eb)],'updatedAt':_0x3db85f[_0x15a334(0x1dd)]['updatedAt']})),{emailToId:_0x621521,idToEmail:_0x263f9e}=_0x9746d3,_0x3d4dba=await withSpinner(_0x15a334(0x1cb),async()=>{const _0x192892=_0x15a334,_0x25b4b7=await _0x1fb905['connection'][_0x192892(0x20e)]();return buildConnectionMaps(_0x25b4b7);},{'verbose':_0x2a6127[_0x15a334(0x23c)]})['then'](_0x12a549=>_0x12a549[_0x15a334(0x1d3)]),_0x4d19bf=_0x3d4dba[_0x15a334(0x24a)],_0x523453=_0x3d4dba[_0x15a334(0x233)],_0x18cc7e=_0x3d4dba[_0x15a334(0x1af)],_0x821952={'emailToIdMap':_0x621521,'connectionNameToIdMap':_0x4d19bf,'connectionNameToTypeMap':_0x18cc7e,'getSchema':_0xabb423=>_0x1fb905[_0x15a334(0x229)][_0x15a334(0x215)](_0xabb423)};let {pathToId:_0x2266e4,idToPath:_0x4e139f}=buildFolderMaps(_0x2fcbdc);const _0x4ef127=buildSegmentLookupMap(_0x251903,_0x4e139f),_0x4e67a6=buildSegmentNameToIdMap(_0x251903),_0x233906=buildJourneyBundleLookupMap(_0x17be51,_0x4e139f);let _0x373339;if(_0x23b3d0){if(!_0x23b3d0[_0x15a334(0x1c7)](_0x15a334(0x1c2))&&!_0x23b3d0[_0x15a334(0x1c7)]('.yaml'))return console[_0x15a334(0x1ec)](a41_0x4c8e7e['red'](_0x15a334(0x217)+_0x23b3d0+'\x0a')),0x1;_0x373339=[_0x23b3d0];}else _0x373339=findYamlFiles(_0x27c1e5);if(_0x373339[_0x15a334(0x1b5)]===0x0)return console[_0x15a334(0x1ec)](a41_0x4c8e7e['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x27c1e5+'\x0a')),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x22f)](_0x15a334(0x1d9))),0x1;let _0x183886,_0x3ce7f3;try{const _0x5dbee8=parseAndClassifyYamlFiles(_0x373339,_0x27c1e5,{'skipSegments':_0x2a6127[_0x15a334(0x21a)]});_0x183886=_0x5dbee8[_0x15a334(0x1d0)],_0x3ce7f3=_0x5dbee8[_0x15a334(0x20a)];const _0x4bf6db=validateParsedFiles(_0x5dbee8,_0x27c1e5);if(_0x4bf6db[_0x15a334(0x1b5)]>0x0)return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x1c4))),console[_0x15a334(0x1ec)](formatValidationErrors(_0x4bf6db)),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)](_0x15a334(0x21f))),0x1;}catch(_0x5ef29b){return console[_0x15a334(0x1ec)](a41_0x4c8e7e['red']('Error\x20parsing\x20YAML:\x20'+(_0x5ef29b instanceof Error?_0x5ef29b[_0x15a334(0x1cc)]:_0x5ef29b))),0x1;}if(_0x183886[_0x15a334(0x1b5)]===0x0&&_0x3ce7f3[_0x15a334(0x1b5)]===0x0){const _0x2ce46a=_0x2a6127['journeysOnly']?_0x15a334(0x22e):_0x15a334(0x218);return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)](_0x15a334(0x22b)+_0x2ce46a+_0x15a334(0x1f0))),0x0;}const _0x1872d2=new Map();_0x251903[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)]&&await withSpinner(_0x15a334(0x1b0),async()=>{await batchAsync(_0x251903,async _0x2b6daa=>{const _0x1d7907=a41_0xf44c,_0x3497d3=await _0x1fb905[_0x1d7907(0x1da)][_0x1d7907(0x225)](_0x486cee,_0x2b6daa['id']);_0x1872d2[_0x1d7907(0x1be)](_0x2b6daa['id'],_0x3497d3);});},{'verbose':_0x2a6127[_0x15a334(0x23c)]});const {segmentFiles:_0x246a9a,foldersToCreate:_0x26d5e0}=await prepareSegmentFiles(_0x183886,{'segmentByFolderAndName':_0x4ef127,'activationsBySegmentId':_0x1872d2,'folderPathToId':_0x2266e4,'idToEmailMap':_0x263f9e,'connectionIdToNameMap':_0x523453},_0x821952,_0x2ed217,_0x5e4ae1),_0xcf2ffd=_0x23b3d0?[]:findSegmentsToDelete(_0x251903,_0x183886[_0x15a334(0x237)](({yamlConfig:_0x58cd21,folderPath:_0x2ee089})=>({'yamlConfig':_0x58cd21,'folderPath':resolveTDFolderPath(_0x2ee089,_0x2ed217,_0x5e4ae1)})),_0x4e139f,_0x5e4ae1,_0x2ed217),{journeyFiles:_0x30c621,foldersToCreate:_0x2fe715}=await withProgressSpinner(_0x15a334(0x240),async _0x242dd4=>prepareJourneyFiles(_0x3ce7f3,{'fetchJourney':async _0x1a4106=>_0x1fb905[_0x15a334(0x22e)][_0x15a334(0x1ff)](_0x1a4106[_0x15a334(0x1cf)]),'journeyBundlesByFolderAndName':_0x233906,'folderPathToId':_0x2266e4,'idToEmailMap':_0x263f9e,'connectionIdToNameMap':_0x523453,'existingSegments':_0x251903,'parentId':_0x486cee,'deps':_0x1fb905,'progress':{'update':_0x1e0c89=>{const _0x3a0110=_0x15a334;_0x242dd4['setPhase'](_0x1e0c89),_0x2a6127['verbose']&&console[_0x3a0110(0x1ec)]('\x20\x20'+_0x1e0c89);}},'journeyById':_0x5107a9,'activationStepsById':_0x480837},_0x2ed217,_0x5e4ae1),{'verbose':_0x2a6127[_0x15a334(0x23c)]})[_0x15a334(0x214)](_0x1df697=>_0x1df697[_0x15a334(0x1d3)]);for(const _0x10effb of _0x2fe715){_0x26d5e0['add'](_0x10effb);}const _0x4ab460=_0x23b3d0?[]:findJourneysToDelete(_0x17be51,_0x3ce7f3[_0x15a334(0x237)](({yamlConfig:_0x5ef4f4,folderPath:_0x319a94})=>({'yamlConfig':_0x5ef4f4,'folderPath':resolveTDFolderPath(_0x319a94,_0x2ed217,_0x5e4ae1)})),_0x4e139f,_0x5e4ae1,_0x2ed217),_0x39a81f=calculatePushStats(_0x246a9a,_0x30c621,_0x26d5e0,_0xcf2ffd,_0x4ab460,!!_0x2a6127[_0x15a334(0x1ed)],!!_0x2a6127[_0x15a334(0x21a)]),_0x27bd7d=_0x39a81f['segments'][_0x15a334(0x223)],_0x53e98f=_0x39a81f[_0x15a334(0x1d0)][_0x15a334(0x21e)],_0x629bb0=_0x39a81f[_0x15a334(0x1d0)][_0x15a334(0x23a)],_0x487237=_0x39a81f['segments'][_0x15a334(0x1e8)],_0x4163ee=_0x39a81f[_0x15a334(0x1d2)][_0x15a334(0x1b1)],_0x4e1f72=_0x39a81f['journeys']['new'],_0x1d6e52=_0x39a81f['journeys'][_0x15a334(0x21e)],_0x42ae4b=_0x39a81f[_0x15a334(0x20a)]['unchanged'],_0x790d6e=_0x39a81f[_0x15a334(0x20a)][_0x15a334(0x1e8)],_0x171f21=_0x39a81f['activations'][_0x15a334(0x1f2)],_0x230b61=_0x39a81f['activations'][_0x15a334(0x1b1)],_0x10a2fd=_0x39a81f['activations'][_0x15a334(0x242)],_0x2f606a=_0x39a81f[_0x15a334(0x209)][_0x15a334(0x1e8)];console[_0x15a334(0x1ec)]('\x0aPush\x20summary\x20for\x20\x27'+_0x481b0a+'\x27:');_0x4163ee['length']>0x0&&console[_0x15a334(0x1ec)]('\x20\x20'+a41_0x4c8e7e[_0x15a334(0x1c6)]('📁\x20'+_0x4163ee['length']+'\x20folders\x20to\x20create'));if(!_0x2a6127[_0x15a334(0x21a)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x224)]('+\x20'+_0x27bd7d[_0x15a334(0x1b5)]+_0x15a334(0x21c))),console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x1bb)]('~\x20'+_0x53e98f[_0x15a334(0x1b5)]+_0x15a334(0x1ce)));if(_0x487237[_0x15a334(0x1b5)]>0x0)console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x247)]('-\x20'+_0x487237[_0x15a334(0x1b5)]+'\x20to\x20delete'));else _0xcf2ffd[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x1ed)]&&console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x228)](_0xcf2ffd['length']+_0x15a334(0x1e7)));console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x228)]('=\x20'+_0x629bb0['length']+_0x15a334(0x1c5)));}if(_0x30c621[_0x15a334(0x1b5)]>0x0||_0x4ab460[_0x15a334(0x1b5)]>0x0){console[_0x15a334(0x1ec)](_0x15a334(0x211)),console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e['green']('+\x20'+_0x4e1f72[_0x15a334(0x1b5)]+'\x20new')),console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x1bb)]('~\x20'+_0x1d6e52[_0x15a334(0x1b5)]+_0x15a334(0x1ce)));if(_0x790d6e[_0x15a334(0x1b5)]>0x0)console['error']('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x247)]('-\x20'+_0x790d6e[_0x15a334(0x1b5)]+_0x15a334(0x1d6)));else _0x4ab460[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x1ed)]&&console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x228)](_0x4ab460[_0x15a334(0x1b5)]+_0x15a334(0x1e7)));console['error'](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x228)]('=\x20'+_0x42ae4b[_0x15a334(0x1b5)]+_0x15a334(0x1c5)));}_0x171f21[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)]&&(console['error'](''),console[_0x15a334(0x1ec)]('\x20\x20Activations:'),_0x230b61['length']>0x0&&console['error'](_0x15a334(0x1e2)+a41_0x4c8e7e['green']('+\x20'+_0x230b61[_0x15a334(0x1b5)]+_0x15a334(0x238))),_0x10a2fd[_0x15a334(0x1b5)]>0x0&&console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x1bb)]('~\x20'+_0x10a2fd[_0x15a334(0x1b5)]+'\x20to\x20update')),_0x2f606a[_0x15a334(0x1b5)]>0x0&&console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x247)]('-\x20'+_0x2f606a['length']+_0x15a334(0x1d6))));console[_0x15a334(0x1ec)](_0x15a334(0x219)+a41_0x4c8e7e['cyan'](_0x27c1e5)+'\x0a');if(_0x4163ee['length']>0x0){console[_0x15a334(0x1ec)]('Folders\x20to\x20create:');for(const _0x2b456b of _0x4163ee){console[_0x15a334(0x1ec)]('\x20\x20'+a41_0x4c8e7e[_0x15a334(0x1c6)]('+')+'\x20'+_0x2b456b);}console[_0x15a334(0x1ec)]('');}if(_0x27bd7d[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)])for(const _0x4ec2a7 of _0x27bd7d){const _0x2d1a95=_0x4ec2a7[_0x15a334(0x201)]?_0x4ec2a7['folderPath']+'/'+_0x4ec2a7[_0x15a334(0x1f3)][_0x15a334(0x1e0)]:_0x4ec2a7['yamlConfig'][_0x15a334(0x1e0)],_0x535faa=_0x4ec2a7[_0x15a334(0x1f3)]['activations']?.['length']||0x0,_0x58a9cb=_0x535faa>0x0?a41_0x4c8e7e['dim']('\x20['+_0x535faa+_0x15a334(0x1f6)):'';console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e[_0x15a334(0x224)]('New\x20segment:')+'\x20'+_0x2d1a95+_0x58a9cb),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c)),_0x4ec2a7[_0x15a334(0x1b7)]&&console[_0x15a334(0x1ec)](_0x4ec2a7['diff']),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c));}if(_0x487237[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)])for(const _0x157b7b of _0x487237){const _0x55406c=_0x157b7b[_0x15a334(0x22a)]?_0x4e139f[_0x15a334(0x226)](_0x157b7b[_0x15a334(0x22a)]['toString']())||'':'',_0x2be5a7=_0x55406c?_0x55406c+'/'+_0x157b7b[_0x15a334(0x1e0)]:_0x157b7b[_0x15a334(0x1e0)],_0x46639c=_0x1872d2[_0x15a334(0x226)](_0x157b7b['id'])||[],_0xa4e700=_0x46639c[_0x15a334(0x1b5)]>0x0?a41_0x4c8e7e[_0x15a334(0x228)]('\x20['+_0x46639c[_0x15a334(0x1b5)]+_0x15a334(0x1f6)):'';console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e['red'](_0x15a334(0x236))+'\x20'+_0x2be5a7+_0xa4e700),console['error']('─'[_0x15a334(0x1ee)](0x3c));const _0x1e4bfc=segmentWithActivationsToYaml(_0x157b7b,_0x46639c,undefined,_0x263f9e,_0x523453),_0x4c4f19=segmentToYamlString(_0x1e4bfc),_0x7e829c=generateDiff(_0x4c4f19,'');console[_0x15a334(0x1ec)](formatDiffWithColors(_0x7e829c)),console[_0x15a334(0x1ec)]('─'['repeat'](0x3c));}const _0x9564f8=_0x246a9a[_0x15a334(0x1b4)](_0x3712b5=>!_0x3712b5[_0x15a334(0x1bc)]&&_0x3712b5[_0x15a334(0x1b7)]);if(_0x9564f8[_0x15a334(0x1b5)]>0x0&&!_0x2a6127['journeysOnly'])for(const _0xa306ce of _0x9564f8){const _0x50e48e=_0xa306ce[_0x15a334(0x201)]?_0xa306ce[_0x15a334(0x201)]+'/'+_0xa306ce[_0x15a334(0x1f3)][_0x15a334(0x1e0)]:_0xa306ce[_0x15a334(0x1f3)][_0x15a334(0x1e0)];console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e['yellow']('Changes\x20to:')+'\x20'+_0x50e48e),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c)),console[_0x15a334(0x1ec)](_0xa306ce[_0x15a334(0x1b7)]),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c));}if(_0x4e1f72['length']>0x0)for(const _0x10ffe3 of _0x4e1f72){const _0x54830b=_0x10ffe3[_0x15a334(0x201)]?_0x10ffe3[_0x15a334(0x201)]+'/'+_0x10ffe3[_0x15a334(0x1f3)]['name']:_0x10ffe3[_0x15a334(0x1f3)]['name'];console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e[_0x15a334(0x224)](_0x15a334(0x1fa))+'\x20'+_0x54830b),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c)),_0x10ffe3['diff']&&console[_0x15a334(0x1ec)](_0x10ffe3[_0x15a334(0x1b7)]),console['error']('─'['repeat'](0x3c));}const _0x86599f=_0x30c621[_0x15a334(0x1b4)](_0xf79972=>!_0xf79972['isNew']&&_0xf79972[_0x15a334(0x1b7)]);if(_0x86599f[_0x15a334(0x1b5)]>0x0)for(const _0x4e2897 of _0x86599f){const _0x4d14a9=_0x4e2897[_0x15a334(0x201)]?_0x4e2897[_0x15a334(0x201)]+'/'+_0x4e2897[_0x15a334(0x1f3)][_0x15a334(0x1e0)]:_0x4e2897[_0x15a334(0x1f3)][_0x15a334(0x1e0)];console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e[_0x15a334(0x1bb)]('Changes\x20to\x20journey:')+'\x20'+_0x4d14a9),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c)),console[_0x15a334(0x1ec)](_0x4e2897['diff']),console[_0x15a334(0x1ec)]('─'['repeat'](0x3c));}if(_0x790d6e[_0x15a334(0x1b5)]>0x0)for(const _0x270739 of _0x790d6e){const _0x316a31=_0x270739[_0x15a334(0x232)]?_0x4e139f[_0x15a334(0x226)](_0x270739[_0x15a334(0x232)])||'':'',_0x5c9c3d=_0x316a31?_0x316a31+'/'+_0x270739['journeyBundleName']:_0x270739[_0x15a334(0x1c0)];console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x21d))+'\x20'+_0x5c9c3d),console['error']('─'['repeat'](0x3c)),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x234))),console[_0x15a334(0x1ec)]('─'['repeat'](0x3c));}if(_0x2a6127[_0x15a334(0x1f7)])return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x16f8b5=_0x2a6127[_0x15a334(0x21a)]?![]:_0x27bd7d[_0x15a334(0x1b5)]>0x0||_0x53e98f[_0x15a334(0x1b5)]>0x0||_0x487237[_0x15a334(0x1b5)]>0x0,_0x41c6b0=_0x4e1f72[_0x15a334(0x1b5)]>0x0||_0x1d6e52['length']>0x0||_0x790d6e[_0x15a334(0x1b5)]>0x0,_0x53b83c=_0x2a6127[_0x15a334(0x21a)]?![]:_0x171f21['length']>0x0,_0x25eb70=_0x4163ee[_0x15a334(0x1b5)]>0x0;if(!_0x16f8b5&&!_0x41c6b0&&!_0x53b83c&&!_0x25eb70){const _0x26eba5=_0x2a6127[_0x15a334(0x21a)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x15a334(0x241);console['error'](a41_0x4c8e7e[_0x15a334(0x224)](_0x26eba5));if(_0x23b3d0&&_0x629bb0['length']===0x1){const _0x270d21=_0x629bb0[0x0];if(_0x270d21['existingSegment']?.['id']){const _0xbd47db=getConsoleNextUrl(_0x2a6127['site'],_0x15a334(0x1d1)+_0x486cee+_0x15a334(0x231)+_0x270d21[_0x15a334(0x1f8)]['id']+_0x15a334(0x216));console[_0x15a334(0x1ec)](_0x15a334(0x203)+a41_0x4c8e7e[_0x15a334(0x22f)](_0xbd47db));}}if(_0x23b3d0&&_0x42ae4b[_0x15a334(0x1b5)]===0x1){const _0x38352f=_0x42ae4b[0x0];if(_0x38352f[_0x15a334(0x1df)]?.['id']){const _0x541f79=getConsoleNextUrl(_0x2a6127[_0x15a334(0x20c)],_0x15a334(0x1d1)+_0x486cee+'/e/'+_0x38352f[_0x15a334(0x1df)]['id']+'/j/da/je');console['error']('\x20\x20'+a41_0x4c8e7e['cyan'](_0x541f79));}}return 0x0;}const _0x5ad6c8=_0x2a6127[_0x15a334(0x21a)]?_0x4e1f72[_0x15a334(0x1b5)]+_0x1d6e52['length']+_0x790d6e['length']+_0x4163ee['length']:_0x27bd7d['length']+_0x53e98f['length']+_0x487237[_0x15a334(0x1b5)]+_0x4e1f72[_0x15a334(0x1b5)]+_0x1d6e52[_0x15a334(0x1b5)]+_0x790d6e[_0x15a334(0x1b5)]+_0x4163ee[_0x15a334(0x1b5)]+_0x171f21[_0x15a334(0x1b5)];if(!_0x2a6127[_0x15a334(0x1b8)]&&_0x5ad6c8>0x0){if(!isInteractive())return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x1e4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x228)](_0x15a334(0x1c3))),0x1;const _0x52208d=await confirmKey(_0x15a334(0x1e1)+_0x5ad6c8+_0x15a334(0x202));if(!_0x52208d)return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)](_0x15a334(0x1fb))),0x1;}const _0x5c731e={'withProgress':async(_0x200c9c,_0x37ea06)=>{const _0x6d4978=_0x15a334,_0x5a022a=await withSpinner(_0x200c9c,_0x37ea06,{'verbose':_0x2a6127[_0x6d4978(0x23c)]});return{'data':_0x5a022a[_0x6d4978(0x1d3)]};},'logInfo':_0x3fb34a=>console['error'](a41_0x4c8e7e[_0x15a334(0x1c6)]('✔\x20'+_0x3fb34a)),'logSuccess':_0x29f39f=>console['error'](a41_0x4c8e7e['green']('✔\x20'+_0x29f39f)),'logWarning':_0x1478cb=>console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)]('⚠\x20'+_0x1478cb)),'logDeleted':_0xe5b91f=>console['error'](a41_0x4c8e7e[_0x15a334(0x247)]('✔\x20'+_0xe5b91f))},_0x23e5d5={'segment':_0x1fb905[_0x15a334(0x1da)],'journey':_0x1fb905[_0x15a334(0x22e)],'user':_0x1fb905['user'],'connection':_0x1fb905[_0x15a334(0x229)]};_0x4163ee['length']>0x0&&(_0x2266e4=await executePushFolders(_0x23e5d5,_0x4163ee,_0x2266e4,{'parentId':_0x486cee},_0x5c731e));const _0x24a02a={'rootFolderId':_0x1c5d48,'folderPathToId':_0x2266e4,'folderIdToPath':_0x4e139f,'segmentNameToId':_0x4e67a6,'activationsBySegmentId':_0x1872d2,'emailToIdMap':_0x621521,'idToEmailMap':_0x263f9e,'connectionNameToIdMap':_0x3d4dba[_0x15a334(0x24a)],'connectionIdToNameMap':_0x3d4dba['idToName'],'connectionNameToTypeMap':_0x18cc7e},_0x20b191=await executePushSegments(_0x23e5d5,_0x2a6127[_0x15a334(0x21a)]?[]:_0x246a9a,_0x24a02a,{'parentId':_0x486cee},_0x5c731e),_0x30a363=_0x20b191[_0x15a334(0x1c1)],_0x170c78=_0x20b191[_0x15a334(0x235)],_0x5bfadc=_0x20b191[_0x15a334(0x209)]['created'],_0x3ed3af=_0x20b191['activations'][_0x15a334(0x235)],_0x19fb08=_0x20b191[_0x15a334(0x209)][_0x15a334(0x1f1)];let _0x291782;if(_0x23b3d0&&_0x246a9a[_0x15a334(0x1b5)]===0x1){const _0x3de7d9=_0x246a9a[0x0];_0x291782=_0x3de7d9['existingSegment']?.['id']??_0x20b191[_0x15a334(0x1b2)][_0x15a334(0x226)](_0x3de7d9[_0x15a334(0x1f3)][_0x15a334(0x1e0)]);}const _0x370e0f=await executePushSegmentDeletions(_0x23e5d5,_0x2a6127[_0x15a334(0x21a)]?[]:_0x487237,_0x5c731e);let _0xc081f4=0x0,_0x47666c=0x0,_0xee1858=0x0;const _0x20dcef=new Map(_0x4e67a6);for(const [_0x2d4807,_0x2b192e]of _0x20b191[_0x15a334(0x1b2)]){_0x20dcef[_0x15a334(0x1be)](_0x2d4807,_0x2b192e);}if(_0x30c621[_0x15a334(0x1b5)]>0x0){const _0x43257a={..._0x24a02a,'segmentNameToId':_0x20dcef,'existingSegments':_0x251903,'activationContext':_0x821952},_0x137955=await executePushJourneys(_0x23e5d5,_0x30c621,_0x43257a,{'parentId':_0x486cee,'rootFolderId':_0x1c5d48,'verbose':_0x2a6127[_0x15a334(0x23c)]},_0x5c731e);_0xc081f4=_0x137955[_0x15a334(0x1c1)],_0x47666c=_0x137955[_0x15a334(0x235)];if(_0x23b3d0&&_0x137955[_0x15a334(0x200)][_0x15a334(0x1b5)]===0x1){const _0x1debd2=_0x137955[_0x15a334(0x200)][0x0];if(_0x1debd2[_0x15a334(0x1cf)]){const _0xa907f4=getConsoleNextUrl(_0x2a6127[_0x15a334(0x20c)],_0x15a334(0x1d1)+_0x486cee+'/e/'+_0x1debd2[_0x15a334(0x1cf)]+_0x15a334(0x206));console['error']('\x20\x20'+a41_0x4c8e7e['cyan'](_0xa907f4));}}}for(const _0x47ac00 of _0x790d6e){console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)](_0x15a334(0x1dc)+_0x47ac00[_0x15a334(0x1c0)])),_0xee1858++;}const _0x53fb8d=[];if(_0x30a363>0x0)_0x53fb8d[_0x15a334(0x23f)](_0x30a363+'\x20created');if(_0x170c78>0x0)_0x53fb8d['push'](_0x170c78+_0x15a334(0x1d5));if(_0x370e0f>0x0)_0x53fb8d['push'](_0x370e0f+'\x20deleted');const _0x47ce37=[];if(_0xc081f4>0x0)_0x47ce37['push'](_0xc081f4+_0x15a334(0x1db));if(_0x47666c>0x0)_0x47ce37[_0x15a334(0x23f)](_0x47666c+_0x15a334(0x1d5));if(_0xee1858>0x0)_0x47ce37[_0x15a334(0x23f)](_0xee1858+'\x20deleted');const _0x3394f3=[];if(_0x5bfadc>0x0)_0x3394f3[_0x15a334(0x23f)](_0x5bfadc+_0x15a334(0x1db));if(_0x3ed3af>0x0)_0x3394f3['push'](_0x3ed3af+_0x15a334(0x1d5));if(_0x19fb08>0x0)_0x3394f3['push'](_0x19fb08+_0x15a334(0x212));console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x224)](_0x15a334(0x227)));_0x53fb8d['length']>0x0&&!_0x2a6127[_0x15a334(0x21a)]&&console[_0x15a334(0x1ec)]('\x20\x20Segments:\x20'+_0x53fb8d[_0x15a334(0x23e)](',\x20'));_0x47ce37[_0x15a334(0x1b5)]>0x0&&console[_0x15a334(0x1ec)](_0x15a334(0x1ea)+_0x47ce37[_0x15a334(0x23e)](',\x20'));_0x3394f3[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)]&&console['error'](_0x15a334(0x1bf)+_0x3394f3[_0x15a334(0x23e)](',\x20'));if(_0x291782){const _0x239b17=getConsoleNextUrl(_0x2a6127[_0x15a334(0x20c)],'/app/ps/'+_0x486cee+_0x15a334(0x231)+_0x291782+_0x15a334(0x216));console[_0x15a334(0x1ec)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x4c8e7e[_0x15a334(0x22f)](_0x239b17));}return 0x0;}}
1
+ const a41_0x4e521b=a41_0x237e;(function(_0x57d195,_0xadb7f){const _0x3f758c=a41_0x237e,_0x5f4439=_0x57d195();while(!![]){try{const _0x58acc1=-parseInt(_0x3f758c(0x157))/0x1+parseInt(_0x3f758c(0x167))/0x2+parseInt(_0x3f758c(0x1b7))/0x3*(-parseInt(_0x3f758c(0x15f))/0x4)+parseInt(_0x3f758c(0x17f))/0x5+parseInt(_0x3f758c(0x172))/0x6*(parseInt(_0x3f758c(0x1b4))/0x7)+parseInt(_0x3f758c(0x18a))/0x8+-parseInt(_0x3f758c(0x1be))/0x9*(parseInt(_0x3f758c(0x190))/0xa);if(_0x58acc1===_0xadb7f)break;else _0x5f4439['push'](_0x5f4439['shift']());}catch(_0x127986){_0x5f4439['push'](_0x5f4439['shift']());}}}(a41_0x56cb,0xd06c8));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a41_0x237e(_0x1f3737,_0x50c8ba){_0x1f3737=_0x1f3737-0x12b;const _0x56cb76=a41_0x56cb();let _0x237e96=_0x56cb76[_0x1f3737];return _0x237e96;}import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a41_0x56cb(){const _0x295b44=['No\x20','3339350ITWEAF','\x20\x20Activations:\x20','folders','journeysOnly','get','blue','filter','/j/da/je','dim','isScoped','Delete\x20journey:','1585528cBQEXz','no_parent','\x20\x20\x20\x20','toString','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','updatedAt','1110JwGFer','resolveParentId','paused','\x0aPush\x20summary\x20for\x20\x27','Error:\x20Directory\x20not\x20found:\x20','map','endsWith','dryRun','list','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','getJourney','user','Site:\x20','file','existingJourney','\x20to\x20delete','\x0a✔\x20Push\x20complete','new','toCreate','\x20\x20🗺️\x20\x20Journeys:','all','listJourneysWithDetailsFromParentSegment','message','attributes','setPhase','execute','add','join','data','segments','description','verbose','nameToType','Push\x20','isNew','Error\x20parsing\x20YAML:\x20','7AXgiUT','Source\x20directory:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','6XEoYKH','\x20updated','.yml','Changes\x20to\x20journey:','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)','set','Delete\x20segment:','72243ZDqFrt','toUpdate','/app/ps/','idToName','\x20YAML\x20files\x20found','length','results','error','yellow','folderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','📁\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Aborted.','\x20\x20Journeys:\x20','Error:\x20','\x20activations]','\x20to\x20create','updated','\x20created','deleted','Fetching\x20connections\x20for\x20name\x20resolution...','created','Fetching\x20existing\x20data...','red','errorCode','audienceId','site','journeyBundleId','existingSegment','Fetching\x20existing\x20activations...','green','delete','segment\x20or\x20journey','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','segment:push','push','toDelete','changed','diff','journeyBundleName','\x20new','nameToId','journeys','getParent','Scoped\x20to\x20folder:\x20','journey','.yaml','relationships','/sb/da/esr','parentSegment','830187EdiqQW','segmentFolderId','activations','\x20\x20Source:\x20','journeyId','folderPath','New\x20journey:','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','2300420lRujTG','\x20deleted','cyan','\x20\x20Activations:','Folders\x20to\x20create:','filePath','\x20folders\x20to\x20create','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','3293200Mfdhgr','segment','helpText','\x20\x20📊\x20Segments:','connection','createdSegmentIds','getOutputSchemaWithCache','repeat','/e/','targetDir','\x20unchanged','7274622NvIPpf','versionNumber','name','then','state','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','scopedFolderPath','yes','yamlConfig','\x20changed','listFolders','unchanged'];a41_0x56cb=function(){return _0x295b44;};return a41_0x56cb();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x3ce785 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_0x4e521b(0x174)]=a41_0x4e521b(0x147);[a41_0x4e521b(0x1ae)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0x4e521b(0x1a9)](_0x35c42e){const _0x242f1a=a41_0x4e521b,{options:_0x435c04,args:_0x32f18c,tdx:_0x55715f}=_0x35c42e,_0x233da0=_0x435c04,_0x39a53a=await resolveTarget({'arg':_0x32f18c[0x0],'contextParent':_0x435c04[_0x242f1a(0x156)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x39a53a))return _0x39a53a[_0x242f1a(0x13d)]===_0x242f1a(0x18b)?(console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x12c)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x242f1a(0x12b)](_0x242f1a(0x1bb)),console[_0x242f1a(0x12b)](_0x242f1a(0x12e)),console[_0x242f1a(0x12b)](_0x242f1a(0x18e))):(console['error'](a41_0x3ce785[_0x242f1a(0x13c)](_0x242f1a(0x133)+_0x39a53a['message']+'\x0a')),_0x39a53a[_0x242f1a(0x169)]&&console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x161)](_0x39a53a[_0x242f1a(0x169)]))),0x1;if(_0x39a53a['type']==='parent_name')return console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x13c)](_0x242f1a(0x194)+_0x39a53a[_0x242f1a(0x170)]+'\x0a')),console['error'](a41_0x3ce785[_0x242f1a(0x161)](_0x242f1a(0x15e))),0x1;const _0x1e6986=_0x39a53a['parentName'],_0x15eb81=_0x39a53a['targetDir'],_0x2468cf=_0x39a53a['type']===_0x242f1a(0x19d)?_0x39a53a[_0x242f1a(0x164)]:undefined,_0xb46055=getScopedDetails(_0x39a53a),_0x3ebb73=_0xb46055?.[_0x242f1a(0x188)]??![],_0x41cf58=_0xb46055?.[_0x242f1a(0x178)]??'';if(!existsSync(_0x15eb81))return console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x13c)]('Error:\x20Directory\x20not\x20found:\x20'+_0x15eb81+'\x0a')),console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x161)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x233da0['verbose']&&(console[_0x242f1a(0x12b)](_0x242f1a(0x19c)+_0x233da0[_0x242f1a(0x13f)]),console['error']('Parent\x20segment:\x20'+_0x1e6986),console[_0x242f1a(0x12b)](_0x242f1a(0x1b5)+_0x15eb81),_0x3ebb73&&console[_0x242f1a(0x12b)](_0x242f1a(0x151)+_0x41cf58));const _0x27fdfc=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1e6986+'\x27...',()=>_0x55715f[_0x242f1a(0x168)][_0x242f1a(0x191)](_0x1e6986),{'verbose':_0x233da0[_0x242f1a(0x1af)]}),_0x5e9bf6=_0x27fdfc[_0x242f1a(0x1ac)],{parentSegmentResult:_0x4b76bd,segmentsResult:_0x22a8fa,foldersResult:_0x2a0bd9,journeysWithDetailsResult:_0x667fad,userMaps:_0x6f1c12}=await withSpinner(_0x242f1a(0x13b),async()=>{const _0x3a5c32=_0x242f1a,[_0xb3b29e,_0x3ab377,_0x4b55dc,_0x2c5c08,_0x2d23e2]=await Promise[_0x3a5c32(0x1a4)]([_0x55715f[_0x3a5c32(0x168)][_0x3a5c32(0x150)](_0x5e9bf6),_0x55715f[_0x3a5c32(0x168)]['listSegments'](_0x5e9bf6),_0x55715f[_0x3a5c32(0x168)][_0x3a5c32(0x17c)](_0x5e9bf6),_0x55715f['journey'][_0x3a5c32(0x1a5)](_0x5e9bf6,{'includeAllVersions':!![]}),_0x55715f['user']['buildUserMaps']()]);return{'parentSegmentResult':_0xb3b29e,'segmentsResult':_0x3ab377,'foldersResult':_0x4b55dc,'journeysWithDetailsResult':_0x2c5c08,'userMaps':_0x2d23e2};},{'verbose':_0x233da0[_0x242f1a(0x1af)]})['then'](_0x44925a=>_0x44925a[_0x242f1a(0x1ac)]),_0x19d706=_0x4b76bd,_0x8b99a2=extractRootFolderId(_0x19d706),_0x4947a5=_0x22a8fa,_0x254395=_0x2a0bd9,{journeys:_0x4e475a,activationStepsById:_0x1d0a5b}=_0x667fad,_0x3edc0f=new Map(_0x4e475a[_0x242f1a(0x195)](_0x27e5b5=>[_0x27e5b5['id'],_0x27e5b5])),_0x2fe057=_0x4e475a[_0x242f1a(0x195)](_0x635cd2=>({'id':_0x635cd2['id'],'name':_0x635cd2[_0x242f1a(0x1a7)]['name'],'journeyBundleName':_0x635cd2['attributes'][_0x242f1a(0x14c)]||'','journeyBundleId':_0x635cd2['attributes'][_0x242f1a(0x140)]||'','versionNumber':_0x635cd2[_0x242f1a(0x1a7)][_0x242f1a(0x173)],'description':_0x635cd2['attributes'][_0x242f1a(0x1ae)],'state':_0x635cd2['attributes'][_0x242f1a(0x176)],'paused':_0x635cd2[_0x242f1a(0x1a7)][_0x242f1a(0x192)],'audienceId':_0x635cd2[_0x242f1a(0x1a7)][_0x242f1a(0x13e)],'folderId':_0x635cd2[_0x242f1a(0x154)]?.['parentFolder']?.[_0x242f1a(0x1ac)]?.['id'],'createdAt':_0x635cd2[_0x242f1a(0x1a7)]['createdAt'],'updatedAt':_0x635cd2[_0x242f1a(0x1a7)][_0x242f1a(0x18f)]})),{emailToId:_0x26c9d3,idToEmail:_0x1f9d9c}=_0x6f1c12,_0x2d162d=await withSpinner(_0x242f1a(0x139),async()=>{const _0x52d294=_0x242f1a,_0x3ec4ca=await _0x55715f[_0x52d294(0x16b)][_0x52d294(0x198)]();return buildConnectionMaps(_0x3ec4ca);},{'verbose':_0x233da0[_0x242f1a(0x1af)]})['then'](_0x3b8e0b=>_0x3b8e0b[_0x242f1a(0x1ac)]),_0x541b49=_0x2d162d[_0x242f1a(0x14e)],_0x2aa6a4=_0x2d162d[_0x242f1a(0x1c1)],_0x4adeba=_0x2d162d[_0x242f1a(0x1b0)],_0x37d057={'emailToIdMap':_0x26c9d3,'connectionNameToIdMap':_0x541b49,'connectionNameToTypeMap':_0x4adeba,'getSchema':_0x3e2123=>_0x55715f['connection'][_0x242f1a(0x16d)](_0x3e2123)};let {pathToId:_0x2d60cf,idToPath:_0x3f0f74}=buildFolderMaps(_0x254395);const _0x3fc4b2=buildSegmentLookupMap(_0x4947a5,_0x3f0f74),_0x4604a5=buildSegmentNameToIdMap(_0x4947a5),_0x3aec3e=buildJourneyBundleLookupMap(_0x2fe057,_0x3f0f74);let _0x45f3dd;if(_0x2468cf){if(!_0x2468cf[_0x242f1a(0x196)](_0x242f1a(0x1b9))&&!_0x2468cf[_0x242f1a(0x196)](_0x242f1a(0x153)))return console['error'](a41_0x3ce785[_0x242f1a(0x13c)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x2468cf+'\x0a')),0x1;_0x45f3dd=[_0x2468cf];}else _0x45f3dd=findYamlFiles(_0x15eb81);if(_0x45f3dd[_0x242f1a(0x1c3)]===0x0)return console[_0x242f1a(0x12b)](a41_0x3ce785['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x15eb81+'\x0a')),console['error'](a41_0x3ce785[_0x242f1a(0x161)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x5ad1e1,_0x1920d;try{const _0x5f4750=parseAndClassifyYamlFiles(_0x45f3dd,_0x15eb81,{'skipSegments':_0x233da0[_0x242f1a(0x182)]});_0x5ad1e1=_0x5f4750['segments'],_0x1920d=_0x5f4750[_0x242f1a(0x14f)];const _0x2c1185=validateParsedFiles(_0x5f4750,_0x15eb81);if(_0x2c1185['length']>0x0)return console['error'](a41_0x3ce785[_0x242f1a(0x13c)]('\x0aValidation\x20failed:')),console[_0x242f1a(0x12b)](formatValidationErrors(_0x2c1185)),console['error'](a41_0x3ce785[_0x242f1a(0x12c)](_0x242f1a(0x177))),0x1;}catch(_0x33b7de){return console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x13c)](_0x242f1a(0x1b3)+(_0x33b7de instanceof Error?_0x33b7de[_0x242f1a(0x1a6)]:_0x33b7de))),0x1;}if(_0x5ad1e1[_0x242f1a(0x1c3)]===0x0&&_0x1920d[_0x242f1a(0x1c3)]===0x0){const _0xb4450d=_0x233da0['journeysOnly']?_0x242f1a(0x152):_0x242f1a(0x145);return console[_0x242f1a(0x12b)](a41_0x3ce785['yellow'](_0x242f1a(0x17e)+_0xb4450d+_0x242f1a(0x1c2))),0x0;}const _0x191ffb=new Map();_0x4947a5['length']>0x0&&!_0x233da0[_0x242f1a(0x182)]&&await withSpinner(_0x242f1a(0x142),async()=>{await batchAsync(_0x4947a5,async _0x323a2e=>{const _0x11f99c=a41_0x237e,_0x5b41a9=await _0x55715f[_0x11f99c(0x168)]['listActivations'](_0x5e9bf6,_0x323a2e['id']);_0x191ffb[_0x11f99c(0x1bc)](_0x323a2e['id'],_0x5b41a9);});},{'verbose':_0x233da0[_0x242f1a(0x1af)]});const {segmentFiles:_0x5c0a11,foldersToCreate:_0x4970ed}=await prepareSegmentFiles(_0x5ad1e1,{'segmentByFolderAndName':_0x3fc4b2,'activationsBySegmentId':_0x191ffb,'folderPathToId':_0x2d60cf,'idToEmailMap':_0x1f9d9c,'connectionIdToNameMap':_0x2aa6a4},_0x37d057,_0x3ebb73,_0x41cf58),_0x56beb7=_0x2468cf?[]:findSegmentsToDelete(_0x4947a5,_0x5ad1e1['map'](({yamlConfig:_0x22034e,folderPath:_0xd70ac5})=>({'yamlConfig':_0x22034e,'folderPath':resolveTDFolderPath(_0xd70ac5,_0x3ebb73,_0x41cf58)})),_0x3f0f74,_0x41cf58,_0x3ebb73),{journeyFiles:_0x59cec2,foldersToCreate:_0x59b6d4}=await withProgressSpinner('Preparing\x20journeys...',async _0x781381=>prepareJourneyFiles(_0x1920d,{'fetchJourney':async _0x666801=>_0x55715f['journey'][_0x242f1a(0x19a)](_0x666801['journeyId']),'journeyBundlesByFolderAndName':_0x3aec3e,'folderPathToId':_0x2d60cf,'idToEmailMap':_0x1f9d9c,'connectionIdToNameMap':_0x2aa6a4,'existingSegments':_0x4947a5,'parentId':_0x5e9bf6,'deps':_0x55715f,'progress':{'update':_0x2cd946=>{const _0x220d44=_0x242f1a;_0x781381[_0x220d44(0x1a8)](_0x2cd946),_0x233da0['verbose']&&console[_0x220d44(0x12b)]('\x20\x20'+_0x2cd946);}},'journeyById':_0x3edc0f,'activationStepsById':_0x1d0a5b},_0x3ebb73,_0x41cf58),{'verbose':_0x233da0[_0x242f1a(0x1af)]})[_0x242f1a(0x175)](_0x10fc91=>_0x10fc91[_0x242f1a(0x1ac)]);for(const _0x468c62 of _0x59b6d4){_0x4970ed[_0x242f1a(0x1aa)](_0x468c62);}const _0x25b806=_0x2468cf?[]:findJourneysToDelete(_0x2fe057,_0x1920d['map'](({yamlConfig:_0x3c8bd5,folderPath:_0x35ca97})=>({'yamlConfig':_0x3c8bd5,'folderPath':resolveTDFolderPath(_0x35ca97,_0x3ebb73,_0x41cf58)})),_0x3f0f74,_0x41cf58,_0x3ebb73),_0x9438de=calculatePushStats(_0x5c0a11,_0x59cec2,_0x4970ed,_0x56beb7,_0x25b806,!!_0x233da0[_0x242f1a(0x144)],!!_0x233da0[_0x242f1a(0x182)]),_0x516569=_0x9438de[_0x242f1a(0x1ad)]['new'],_0x2a3aef=_0x9438de[_0x242f1a(0x1ad)]['changed'],_0x30807e=_0x9438de[_0x242f1a(0x1ad)][_0x242f1a(0x17d)],_0x3ff8da=_0x9438de[_0x242f1a(0x1ad)]['toDelete'],_0x1277bc=_0x9438de[_0x242f1a(0x181)][_0x242f1a(0x1a2)],_0x321217=_0x9438de['journeys'][_0x242f1a(0x1a1)],_0x24e7e1=_0x9438de[_0x242f1a(0x14f)][_0x242f1a(0x14a)],_0x22bed8=_0x9438de[_0x242f1a(0x14f)][_0x242f1a(0x17d)],_0x4e0dfd=_0x9438de['journeys'][_0x242f1a(0x149)],_0x52c0d1=_0x9438de[_0x242f1a(0x159)][_0x242f1a(0x1a4)],_0x4c8c86=_0x9438de['activations']['toCreate'],_0x80b704=_0x9438de['activations'][_0x242f1a(0x1bf)],_0x896dc1=_0x9438de['activations'][_0x242f1a(0x149)];console[_0x242f1a(0x12b)](_0x242f1a(0x193)+_0x1e6986+'\x27:');_0x1277bc[_0x242f1a(0x1c3)]>0x0&&console[_0x242f1a(0x12b)]('\x20\x20'+a41_0x3ce785[_0x242f1a(0x184)](_0x242f1a(0x12f)+_0x1277bc[_0x242f1a(0x1c3)]+_0x242f1a(0x165)));if(!_0x233da0[_0x242f1a(0x182)]){console[_0x242f1a(0x12b)](_0x242f1a(0x16a)),console[_0x242f1a(0x12b)](_0x242f1a(0x18c)+a41_0x3ce785[_0x242f1a(0x143)]('+\x20'+_0x516569[_0x242f1a(0x1c3)]+_0x242f1a(0x14d))),console['error'](_0x242f1a(0x18c)+a41_0x3ce785['yellow']('~\x20'+_0x2a3aef[_0x242f1a(0x1c3)]+_0x242f1a(0x17b)));if(_0x3ff8da[_0x242f1a(0x1c3)]>0x0)console[_0x242f1a(0x12b)](_0x242f1a(0x18c)+a41_0x3ce785['red']('-\x20'+_0x3ff8da[_0x242f1a(0x1c3)]+_0x242f1a(0x19f)));else _0x56beb7['length']>0x0&&!_0x233da0[_0x242f1a(0x144)]&&console[_0x242f1a(0x12b)](_0x242f1a(0x18c)+a41_0x3ce785[_0x242f1a(0x187)](_0x56beb7[_0x242f1a(0x1c3)]+_0x242f1a(0x199)));console[_0x242f1a(0x12b)](_0x242f1a(0x18c)+a41_0x3ce785['dim']('=\x20'+_0x30807e[_0x242f1a(0x1c3)]+_0x242f1a(0x171)));}if(_0x59cec2[_0x242f1a(0x1c3)]>0x0||_0x25b806[_0x242f1a(0x1c3)]>0x0){console[_0x242f1a(0x12b)](_0x242f1a(0x1a3)),console[_0x242f1a(0x12b)](_0x242f1a(0x18c)+a41_0x3ce785[_0x242f1a(0x143)]('+\x20'+_0x321217[_0x242f1a(0x1c3)]+_0x242f1a(0x14d))),console['error'](_0x242f1a(0x18c)+a41_0x3ce785[_0x242f1a(0x12c)]('~\x20'+_0x24e7e1[_0x242f1a(0x1c3)]+_0x242f1a(0x17b)));if(_0x4e0dfd[_0x242f1a(0x1c3)]>0x0)console[_0x242f1a(0x12b)](_0x242f1a(0x18c)+a41_0x3ce785[_0x242f1a(0x13c)]('-\x20'+_0x4e0dfd[_0x242f1a(0x1c3)]+'\x20to\x20delete'));else _0x25b806[_0x242f1a(0x1c3)]>0x0&&!_0x233da0['delete']&&console[_0x242f1a(0x12b)](_0x242f1a(0x18c)+a41_0x3ce785[_0x242f1a(0x187)](_0x25b806['length']+_0x242f1a(0x199)));console[_0x242f1a(0x12b)]('\x20\x20\x20\x20'+a41_0x3ce785[_0x242f1a(0x187)]('=\x20'+_0x22bed8['length']+_0x242f1a(0x171)));}_0x52c0d1[_0x242f1a(0x1c3)]>0x0&&!_0x233da0[_0x242f1a(0x182)]&&(console[_0x242f1a(0x12b)](''),console['error'](_0x242f1a(0x162)),_0x4c8c86[_0x242f1a(0x1c3)]>0x0&&console['error']('\x20\x20\x20\x20'+a41_0x3ce785['green']('+\x20'+_0x4c8c86[_0x242f1a(0x1c3)]+_0x242f1a(0x135))),_0x80b704[_0x242f1a(0x1c3)]>0x0&&console[_0x242f1a(0x12b)](_0x242f1a(0x18c)+a41_0x3ce785[_0x242f1a(0x12c)]('~\x20'+_0x80b704[_0x242f1a(0x1c3)]+'\x20to\x20update')),_0x896dc1[_0x242f1a(0x1c3)]>0x0&&console[_0x242f1a(0x12b)](_0x242f1a(0x18c)+a41_0x3ce785[_0x242f1a(0x13c)]('-\x20'+_0x896dc1['length']+_0x242f1a(0x19f))));console[_0x242f1a(0x12b)](_0x242f1a(0x15a)+a41_0x3ce785[_0x242f1a(0x161)](_0x15eb81)+'\x0a');if(_0x1277bc[_0x242f1a(0x1c3)]>0x0){console[_0x242f1a(0x12b)](_0x242f1a(0x163));for(const _0x557d92 of _0x1277bc){console['error']('\x20\x20'+a41_0x3ce785[_0x242f1a(0x184)]('+')+'\x20'+_0x557d92);}console[_0x242f1a(0x12b)]('');}if(_0x516569['length']>0x0&&!_0x233da0[_0x242f1a(0x182)])for(const _0x38637b of _0x516569){const _0x155de3=_0x38637b['folderPath']?_0x38637b[_0x242f1a(0x15c)]+'/'+_0x38637b[_0x242f1a(0x17a)][_0x242f1a(0x174)]:_0x38637b[_0x242f1a(0x17a)][_0x242f1a(0x174)],_0x43e164=_0x38637b['yamlConfig'][_0x242f1a(0x159)]?.['length']||0x0,_0x377531=_0x43e164>0x0?a41_0x3ce785[_0x242f1a(0x187)]('\x20['+_0x43e164+_0x242f1a(0x134)):'';console['error']('\x0a'+a41_0x3ce785[_0x242f1a(0x143)]('New\x20segment:')+'\x20'+_0x155de3+_0x377531),console['error']('─'['repeat'](0x3c)),_0x38637b[_0x242f1a(0x14b)]&&console[_0x242f1a(0x12b)](_0x38637b[_0x242f1a(0x14b)]),console[_0x242f1a(0x12b)]('─'[_0x242f1a(0x16e)](0x3c));}if(_0x3ff8da[_0x242f1a(0x1c3)]>0x0&&!_0x233da0[_0x242f1a(0x182)])for(const _0x5a96d0 of _0x3ff8da){const _0x2b2292=_0x5a96d0[_0x242f1a(0x158)]?_0x3f0f74[_0x242f1a(0x183)](_0x5a96d0[_0x242f1a(0x158)][_0x242f1a(0x18d)]())||'':'',_0x31fda5=_0x2b2292?_0x2b2292+'/'+_0x5a96d0[_0x242f1a(0x174)]:_0x5a96d0['name'],_0x3c5a69=_0x191ffb[_0x242f1a(0x183)](_0x5a96d0['id'])||[],_0x18b375=_0x3c5a69['length']>0x0?a41_0x3ce785['dim']('\x20['+_0x3c5a69[_0x242f1a(0x1c3)]+_0x242f1a(0x134)):'';console['error']('\x0a'+a41_0x3ce785[_0x242f1a(0x13c)](_0x242f1a(0x1bd))+'\x20'+_0x31fda5+_0x18b375),console[_0x242f1a(0x12b)]('─'['repeat'](0x3c));const _0x591e61=segmentWithActivationsToYaml(_0x5a96d0,_0x3c5a69,undefined,_0x1f9d9c,_0x2aa6a4),_0x276239=segmentToYamlString(_0x591e61),_0x427b88=generateDiff(_0x276239,'');console[_0x242f1a(0x12b)](formatDiffWithColors(_0x427b88)),console[_0x242f1a(0x12b)]('─'[_0x242f1a(0x16e)](0x3c));}const _0x25f25b=_0x5c0a11[_0x242f1a(0x185)](_0x3eed52=>!_0x3eed52['isNew']&&_0x3eed52[_0x242f1a(0x14b)]);if(_0x25f25b[_0x242f1a(0x1c3)]>0x0&&!_0x233da0[_0x242f1a(0x182)])for(const _0x248c64 of _0x25f25b){const _0x33db31=_0x248c64[_0x242f1a(0x15c)]?_0x248c64[_0x242f1a(0x15c)]+'/'+_0x248c64['yamlConfig'][_0x242f1a(0x174)]:_0x248c64[_0x242f1a(0x17a)]['name'];console[_0x242f1a(0x12b)]('\x0a'+a41_0x3ce785[_0x242f1a(0x12c)]('Changes\x20to:')+'\x20'+_0x33db31),console[_0x242f1a(0x12b)]('─'[_0x242f1a(0x16e)](0x3c)),console[_0x242f1a(0x12b)](_0x248c64[_0x242f1a(0x14b)]),console[_0x242f1a(0x12b)]('─'['repeat'](0x3c));}if(_0x321217[_0x242f1a(0x1c3)]>0x0)for(const _0x408566 of _0x321217){const _0x31de02=_0x408566[_0x242f1a(0x15c)]?_0x408566[_0x242f1a(0x15c)]+'/'+_0x408566[_0x242f1a(0x17a)][_0x242f1a(0x174)]:_0x408566[_0x242f1a(0x17a)][_0x242f1a(0x174)];console['error']('\x0a'+a41_0x3ce785[_0x242f1a(0x143)](_0x242f1a(0x15d))+'\x20'+_0x31de02),console[_0x242f1a(0x12b)]('─'[_0x242f1a(0x16e)](0x3c)),_0x408566[_0x242f1a(0x14b)]&&console[_0x242f1a(0x12b)](_0x408566[_0x242f1a(0x14b)]),console['error']('─'[_0x242f1a(0x16e)](0x3c));}const _0x57c404=_0x59cec2[_0x242f1a(0x185)](_0x45aa46=>!_0x45aa46[_0x242f1a(0x1b2)]&&_0x45aa46[_0x242f1a(0x14b)]);if(_0x57c404[_0x242f1a(0x1c3)]>0x0)for(const _0x48dac8 of _0x57c404){const _0x3cfb0c=_0x48dac8[_0x242f1a(0x15c)]?_0x48dac8[_0x242f1a(0x15c)]+'/'+_0x48dac8[_0x242f1a(0x17a)]['name']:_0x48dac8[_0x242f1a(0x17a)][_0x242f1a(0x174)];console['error']('\x0a'+a41_0x3ce785['yellow'](_0x242f1a(0x1ba))+'\x20'+_0x3cfb0c),console[_0x242f1a(0x12b)]('─'[_0x242f1a(0x16e)](0x3c)),console['error'](_0x48dac8['diff']),console[_0x242f1a(0x12b)]('─'['repeat'](0x3c));}if(_0x4e0dfd[_0x242f1a(0x1c3)]>0x0)for(const _0x4a2fe4 of _0x4e0dfd){const _0x3261d8=_0x4a2fe4[_0x242f1a(0x12d)]?_0x3f0f74[_0x242f1a(0x183)](_0x4a2fe4[_0x242f1a(0x12d)])||'':'',_0x5e593b=_0x3261d8?_0x3261d8+'/'+_0x4a2fe4[_0x242f1a(0x14c)]:_0x4a2fe4[_0x242f1a(0x14c)];console[_0x242f1a(0x12b)]('\x0a'+a41_0x3ce785[_0x242f1a(0x13c)](_0x242f1a(0x189))+'\x20'+_0x5e593b),console['error']('─'[_0x242f1a(0x16e)](0x3c)),console['error'](a41_0x3ce785['red']('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x242f1a(0x16e)](0x3c));}if(_0x233da0[_0x242f1a(0x197)])return console['error'](a41_0x3ce785[_0x242f1a(0x12c)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x319200=_0x233da0[_0x242f1a(0x182)]?![]:_0x516569[_0x242f1a(0x1c3)]>0x0||_0x2a3aef[_0x242f1a(0x1c3)]>0x0||_0x3ff8da['length']>0x0,_0x7b57c2=_0x321217[_0x242f1a(0x1c3)]>0x0||_0x24e7e1[_0x242f1a(0x1c3)]>0x0||_0x4e0dfd['length']>0x0,_0x179ef0=_0x233da0[_0x242f1a(0x182)]?![]:_0x52c0d1['length']>0x0,_0x51d0c3=_0x1277bc['length']>0x0;if(!_0x319200&&!_0x7b57c2&&!_0x179ef0&&!_0x51d0c3){const _0x163392=_0x233da0[_0x242f1a(0x182)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x242f1a(0x146);console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x143)](_0x163392));if(_0x2468cf&&_0x30807e[_0x242f1a(0x1c3)]===0x1){const _0x5af7fe=_0x30807e[0x0];if(_0x5af7fe[_0x242f1a(0x141)]?.['id']){const _0x1a0391=getConsoleNextUrl(_0x233da0[_0x242f1a(0x13f)],'/app/ps/'+_0x5e9bf6+'/e/'+_0x5af7fe[_0x242f1a(0x141)]['id']+_0x242f1a(0x155));console[_0x242f1a(0x12b)](_0x242f1a(0x166)+a41_0x3ce785['cyan'](_0x1a0391));}}if(_0x2468cf&&_0x22bed8[_0x242f1a(0x1c3)]===0x1){const _0x4e0ff6=_0x22bed8[0x0];if(_0x4e0ff6[_0x242f1a(0x19e)]?.['id']){const _0x4bc2a5=getConsoleNextUrl(_0x233da0[_0x242f1a(0x13f)],'/app/ps/'+_0x5e9bf6+'/e/'+_0x4e0ff6['existingJourney']['id']+_0x242f1a(0x186));console[_0x242f1a(0x12b)]('\x20\x20'+a41_0x3ce785[_0x242f1a(0x161)](_0x4bc2a5));}}return 0x0;}const _0x356b48=_0x233da0[_0x242f1a(0x182)]?_0x321217['length']+_0x24e7e1[_0x242f1a(0x1c3)]+_0x4e0dfd['length']+_0x1277bc['length']:_0x516569['length']+_0x2a3aef['length']+_0x3ff8da[_0x242f1a(0x1c3)]+_0x321217[_0x242f1a(0x1c3)]+_0x24e7e1['length']+_0x4e0dfd[_0x242f1a(0x1c3)]+_0x1277bc[_0x242f1a(0x1c3)]+_0x52c0d1['length'];if(!_0x233da0[_0x242f1a(0x179)]&&_0x356b48>0x0){if(!isInteractive())return console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x13c)]('\x0aError:'),_0x242f1a(0x1b6)),console['error'](a41_0x3ce785[_0x242f1a(0x187)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xfcc3e4=await confirmKey(_0x242f1a(0x1b1)+_0x356b48+'\x20changes?');if(!_0xfcc3e4)return console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x12c)](_0x242f1a(0x131))),0x1;}const _0x3370eb={'withProgress':async(_0x51656a,_0x3763c2)=>{const _0xd782b5=_0x242f1a,_0x3af181=await withSpinner(_0x51656a,_0x3763c2,{'verbose':_0x233da0[_0xd782b5(0x1af)]});return{'data':_0x3af181[_0xd782b5(0x1ac)]};},'logInfo':_0x952aba=>console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x184)]('✔\x20'+_0x952aba)),'logSuccess':_0x548c8e=>console['error'](a41_0x3ce785[_0x242f1a(0x143)]('✔\x20'+_0x548c8e)),'logWarning':_0x39df44=>console[_0x242f1a(0x12b)](a41_0x3ce785['yellow']('⚠\x20'+_0x39df44)),'logDeleted':_0x3174f6=>console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x13c)]('✔\x20'+_0x3174f6))},_0x31e6f8={'segment':_0x55715f['segment'],'journey':_0x55715f[_0x242f1a(0x152)],'user':_0x55715f[_0x242f1a(0x19b)],'connection':_0x55715f[_0x242f1a(0x16b)]};_0x1277bc[_0x242f1a(0x1c3)]>0x0&&(_0x2d60cf=await executePushFolders(_0x31e6f8,_0x1277bc,_0x2d60cf,{'parentId':_0x5e9bf6},_0x3370eb));const _0x5d5a92={'rootFolderId':_0x8b99a2,'folderPathToId':_0x2d60cf,'folderIdToPath':_0x3f0f74,'segmentNameToId':_0x4604a5,'activationsBySegmentId':_0x191ffb,'emailToIdMap':_0x26c9d3,'idToEmailMap':_0x1f9d9c,'connectionNameToIdMap':_0x2d162d[_0x242f1a(0x14e)],'connectionIdToNameMap':_0x2d162d[_0x242f1a(0x1c1)],'connectionNameToTypeMap':_0x4adeba},_0x2b1922=await executePushSegments(_0x31e6f8,_0x233da0[_0x242f1a(0x182)]?[]:_0x5c0a11,_0x5d5a92,{'parentId':_0x5e9bf6},_0x3370eb),_0x200724=_0x2b1922[_0x242f1a(0x13a)],_0x3683ba=_0x2b1922[_0x242f1a(0x136)],_0x236d7a=_0x2b1922['activations'][_0x242f1a(0x13a)],_0x31a6f0=_0x2b1922[_0x242f1a(0x159)]['updated'],_0x52b69a=_0x2b1922[_0x242f1a(0x159)][_0x242f1a(0x138)];let _0x6e2202;if(_0x2468cf&&_0x5c0a11[_0x242f1a(0x1c3)]===0x1){const _0x169a28=_0x5c0a11[0x0];_0x6e2202=_0x169a28[_0x242f1a(0x141)]?.['id']??_0x2b1922[_0x242f1a(0x16c)][_0x242f1a(0x183)](_0x169a28[_0x242f1a(0x17a)][_0x242f1a(0x174)]);}const _0x226e97=await executePushSegmentDeletions(_0x31e6f8,_0x233da0[_0x242f1a(0x182)]?[]:_0x3ff8da,_0x3370eb);let _0x599018=0x0,_0x3b7551=0x0,_0x2e9f7c=0x0;const _0x4b2ebc=new Map(_0x4604a5);for(const [_0x2ebb3d,_0x4d241d]of _0x2b1922[_0x242f1a(0x16c)]){_0x4b2ebc[_0x242f1a(0x1bc)](_0x2ebb3d,_0x4d241d);}if(_0x59cec2['length']>0x0){const _0x19f47d={..._0x5d5a92,'segmentNameToId':_0x4b2ebc,'existingSegments':_0x4947a5,'activationContext':_0x37d057},_0x170f8f=await executePushJourneys(_0x31e6f8,_0x59cec2,_0x19f47d,{'parentId':_0x5e9bf6,'rootFolderId':_0x8b99a2,'verbose':_0x233da0[_0x242f1a(0x1af)]},_0x3370eb);_0x599018=_0x170f8f['created'],_0x3b7551=_0x170f8f[_0x242f1a(0x136)];if(_0x2468cf&&_0x170f8f['results']['length']===0x1){const _0x4005a1=_0x170f8f[_0x242f1a(0x1c4)][0x0];if(_0x4005a1[_0x242f1a(0x15b)]){const _0xa8db09=getConsoleNextUrl(_0x233da0['site'],_0x242f1a(0x1c0)+_0x5e9bf6+_0x242f1a(0x16f)+_0x4005a1['journeyId']+_0x242f1a(0x186));console[_0x242f1a(0x12b)]('\x20\x20'+a41_0x3ce785[_0x242f1a(0x161)](_0xa8db09));}}}for(const _0x50dfaa of _0x4e0dfd){console['error'](a41_0x3ce785['yellow'](_0x242f1a(0x130)+_0x50dfaa[_0x242f1a(0x14c)])),_0x2e9f7c++;}const _0x583cf9=[];if(_0x200724>0x0)_0x583cf9[_0x242f1a(0x148)](_0x200724+'\x20created');if(_0x3683ba>0x0)_0x583cf9[_0x242f1a(0x148)](_0x3683ba+_0x242f1a(0x1b8));if(_0x226e97>0x0)_0x583cf9[_0x242f1a(0x148)](_0x226e97+'\x20deleted');const _0x2735cd=[];if(_0x599018>0x0)_0x2735cd['push'](_0x599018+'\x20created');if(_0x3b7551>0x0)_0x2735cd[_0x242f1a(0x148)](_0x3b7551+'\x20updated');if(_0x2e9f7c>0x0)_0x2735cd[_0x242f1a(0x148)](_0x2e9f7c+'\x20deleted');const _0x4778d3=[];if(_0x236d7a>0x0)_0x4778d3['push'](_0x236d7a+_0x242f1a(0x137));if(_0x31a6f0>0x0)_0x4778d3[_0x242f1a(0x148)](_0x31a6f0+'\x20updated');if(_0x52b69a>0x0)_0x4778d3[_0x242f1a(0x148)](_0x52b69a+_0x242f1a(0x160));console[_0x242f1a(0x12b)](a41_0x3ce785[_0x242f1a(0x143)](_0x242f1a(0x1a0)));_0x583cf9[_0x242f1a(0x1c3)]>0x0&&!_0x233da0['journeysOnly']&&console[_0x242f1a(0x12b)]('\x20\x20Segments:\x20'+_0x583cf9['join'](',\x20'));_0x2735cd['length']>0x0&&console[_0x242f1a(0x12b)](_0x242f1a(0x132)+_0x2735cd[_0x242f1a(0x1ab)](',\x20'));_0x4778d3[_0x242f1a(0x1c3)]>0x0&&!_0x233da0[_0x242f1a(0x182)]&&console[_0x242f1a(0x12b)](_0x242f1a(0x180)+_0x4778d3['join'](',\x20'));if(_0x6e2202){const _0x57934d=getConsoleNextUrl(_0x233da0[_0x242f1a(0x13f)],'/app/ps/'+_0x5e9bf6+_0x242f1a(0x16f)+_0x6e2202+_0x242f1a(0x155));console[_0x242f1a(0x12b)](_0x242f1a(0x166)+a41_0x3ce785[_0x242f1a(0x161)](_0x57934d));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x5b2ee7=a42_0x2a91;function a42_0x2a91(_0x2caf9d,_0x15d540){_0x2caf9d=_0x2caf9d-0x18c;const _0x46898b=a42_0x4689();let _0x2a910f=_0x46898b[_0x2caf9d];return _0x2a910f;}(function(_0x248712,_0x3c7d67){const _0x188159=a42_0x2a91,_0x2f7a06=_0x248712();while(!![]){try{const _0x430156=-parseInt(_0x188159(0x1b1))/0x1*(-parseInt(_0x188159(0x18d))/0x2)+parseInt(_0x188159(0x191))/0x3+-parseInt(_0x188159(0x19d))/0x4*(-parseInt(_0x188159(0x19a))/0x5)+-parseInt(_0x188159(0x1a8))/0x6*(-parseInt(_0x188159(0x195))/0x7)+-parseInt(_0x188159(0x1ad))/0x8*(parseInt(_0x188159(0x1ab))/0x9)+-parseInt(_0x188159(0x18e))/0xa*(-parseInt(_0x188159(0x19e))/0xb)+parseInt(_0x188159(0x18c))/0xc*(-parseInt(_0x188159(0x1b0))/0xd);if(_0x430156===_0x3c7d67)break;else _0x2f7a06['push'](_0x2f7a06['shift']());}catch(_0x49ae86){_0x2f7a06['push'](_0x2f7a06['shift']());}}}(a42_0x4689,0x4ae82));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x4689(){const _0x769fd1=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','execute','type','1673778GmoLhn','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentPath','963LqyQtE','rule','26504ojYAvc','Resolving\x20path\x20\x27','Resolved\x20type:\x20','286KmTndt','35873vIhPaO','Examples:','\x27...','Resolved\x20relative\x20path\x20to:\x20','segmentId','Error:\x20Cannot\x20update\x20','resolvePathToResource','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','verbose','segment:update','Resolved\x20folder\x20ID:\x20','\x20\x20\x20Path:\x20','includes','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','650028WFHtbL','18wuFNKl','130gFzvjr','segment','Parent\x20ID:\x20','219204DlzYNW','length','INTERNAL','Segment\x20ID:\x20','14NExsBu','resolveFolderId','kind','name','ruleFile','85VmEyeu','Updating\x20segment\x20\x27','error','126404BodOzU','306273BAyHDT','Update\x20existing\x20child\x20segment','data','description','parentId','yellow','folder'];a42_0x4689=function(){return _0x769fd1;};return a42_0x4689();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x11931c from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x5b2ee7(0x198)]=a42_0x5b2ee7(0x1ba);[a42_0x5b2ee7(0x1a1)]=a42_0x5b2ee7(0x19f);async[a42_0x5b2ee7(0x1a6)](_0x1cc7b6){const _0x4e518e=a42_0x5b2ee7;console[_0x4e518e(0x19c)](a42_0x11931c[_0x4e518e(0x1a3)](_0x4e518e(0x1b8))),console['error'](a42_0x11931c[_0x4e518e(0x1a3)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x12ec15,args:_0x35ea5a,tdx:_0x22cf8f}=_0x1cc7b6,_0x7e7a7=_0x12ec15;if(_0x35ea5a[_0x4e518e(0x192)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x4e518e(0x19c)](_0x4e518e(0x1a9)),console['error'](_0x4e518e(0x1b2)),console[_0x4e518e(0x19c)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x4e518e(0x19c)](_0x4e518e(0x1a5)),0x1;const _0x365370=_0x35ea5a[0x0],_0x17e237=_0x12ec15[_0x4e518e(0x1aa)];let _0x115cd8=_0x365370;_0x17e237&&!_0x365370[_0x4e518e(0x1bd)]('/')&&(_0x115cd8=_0x17e237+'/'+_0x365370,_0x7e7a7[_0x4e518e(0x1b9)]&&console[_0x4e518e(0x19c)](_0x4e518e(0x1b4)+_0x115cd8));const _0x16b1f3=await withSpinner(_0x4e518e(0x1ae)+_0x115cd8+_0x4e518e(0x1b3),()=>_0x22cf8f['segment'][_0x4e518e(0x1b7)](_0x115cd8),{'verbose':_0x7e7a7[_0x4e518e(0x1b9)]}),_0x5238d7=_0x16b1f3['data'];_0x7e7a7['verbose']&&console[_0x4e518e(0x19c)](_0x4e518e(0x1af)+_0x5238d7[_0x4e518e(0x1a7)]);if(_0x5238d7[_0x4e518e(0x1a7)]!==_0x4e518e(0x18f))return console[_0x4e518e(0x19c)](_0x4e518e(0x1b6)+_0x5238d7[_0x4e518e(0x1a7)]+_0x4e518e(0x1bf)),console[_0x4e518e(0x19c)](_0x4e518e(0x1be)),0x1;if(!_0x5238d7['segmentId'])throw new SDKError(ErrorCode[_0x4e518e(0x193)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2e1490=_0x5238d7[_0x4e518e(0x1a2)],_0x32e5da=_0x5238d7[_0x4e518e(0x1b5)];_0x7e7a7['verbose']&&(console[_0x4e518e(0x19c)](_0x4e518e(0x190)+_0x2e1490),console[_0x4e518e(0x19c)](_0x4e518e(0x194)+_0x32e5da));let _0x32cabb;if(_0x7e7a7['folder']){const _0x396590=_0x7e7a7[_0x4e518e(0x1a4)],_0x37a73f=await withSpinner('Resolving\x20folder\x20\x27'+_0x396590+_0x4e518e(0x1b3),()=>_0x22cf8f[_0x4e518e(0x18f)][_0x4e518e(0x196)](_0x2e1490,_0x396590),{'verbose':_0x7e7a7[_0x4e518e(0x1b9)]});_0x32cabb=parseInt(_0x37a73f[_0x4e518e(0x1a0)],0xa),_0x7e7a7[_0x4e518e(0x1b9)]&&console[_0x4e518e(0x19c)](_0x4e518e(0x1bb)+_0x32cabb);}const _0xdd5051=await loadJSONFromOptions(_0x7e7a7[_0x4e518e(0x1ac)],_0x7e7a7[_0x4e518e(0x199)]),_0xb9b1cf={'name':_0x7e7a7[_0x4e518e(0x198)],'description':_0x7e7a7[_0x4e518e(0x1a1)],'rule':_0xdd5051,'kind':_0x7e7a7[_0x4e518e(0x197)]!==undefined?parseInt(_0x7e7a7[_0x4e518e(0x197)],0xa):undefined,'segmentFolderId':_0x32cabb},_0x131952=await withSpinner(_0x4e518e(0x19b)+_0x5238d7['segmentName']+_0x4e518e(0x1b3),()=>_0x22cf8f[_0x4e518e(0x18f)]['updateSegmentById'](_0x2e1490,_0x32e5da,_0xb9b1cf),{'verbose':_0x7e7a7[_0x4e518e(0x1b9)]}),_0x1cfb8c=_0x131952['data'];return console[_0x4e518e(0x19c)]('✔\x20Updated\x20segment\x20\x27'+_0x1cfb8c[_0x4e518e(0x198)]+'\x27'),_0x115cd8!==_0x365370&&console[_0x4e518e(0x19c)](_0x4e518e(0x1bc)+_0x115cd8),await handleSDKOutput([_0x1cfb8c],_0x7e7a7),0x0;}}
1
+ const a42_0x460e60=a42_0x9d81;(function(_0x52a166,_0x52aee3){const _0x5e960c=a42_0x9d81,_0x3817e4=_0x52a166();while(!![]){try{const _0x31fc01=-parseInt(_0x5e960c(0x15f))/0x1+parseInt(_0x5e960c(0x173))/0x2+-parseInt(_0x5e960c(0x185))/0x3+parseInt(_0x5e960c(0x171))/0x4+parseInt(_0x5e960c(0x182))/0x5+-parseInt(_0x5e960c(0x177))/0x6+-parseInt(_0x5e960c(0x181))/0x7*(-parseInt(_0x5e960c(0x15b))/0x8);if(_0x31fc01===_0x52aee3)break;else _0x3817e4['push'](_0x3817e4['shift']());}catch(_0x2ef6dd){_0x3817e4['push'](_0x3817e4['shift']());}}}(a42_0x401f,0x977ef));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';function a42_0x401f(){const _0x3d8094=['description','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','8iZRmhp','name','resolvePathToResource','✔\x20Updated\x20segment\x20\x27','288821qIBVir','Error:\x20Cannot\x20update\x20','Update\x20existing\x20child\x20segment','Resolving\x20path\x20\x27','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Resolved\x20folder\x20ID:\x20','parentId','Updating\x20segment\x20\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Examples:','type','error','Segment\x20ID:\x20','rule','\x27...','Resolving\x20folder\x20\x27','includes','INTERNAL','2095012MgCKvt','kind','693556LDPVbL','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','yellow','segmentId','6578322CyHVwP','segment:update','\x20\x20\x20Path:\x20','segmentPath','data','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20relative\x20path\x20to:\x20','segment','Resolved\x20type:\x20','resolveFolderId','11727702ovYxYm','99675ltGApm','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','length','1680351ueItGw','updateSegmentById','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','segmentName','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','verbose'];a42_0x401f=function(){return _0x3d8094;};return a42_0x401f();}import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x328df6 from'chalk';function a42_0x9d81(_0x32d43d,_0x226229){_0x32d43d=_0x32d43d-0x153;const _0x401f6b=a42_0x401f();let _0x9d813d=_0x401f6b[_0x32d43d];return _0x9d813d;}export class SegmentUpdateCommand extends BaseCommand{[a42_0x460e60(0x15c)]=a42_0x460e60(0x178);['description']=a42_0x460e60(0x161);async['execute'](_0x2874ef){const _0x34dd89=a42_0x460e60;console[_0x34dd89(0x16a)](a42_0x328df6[_0x34dd89(0x175)](_0x34dd89(0x167))),console[_0x34dd89(0x16a)](a42_0x328df6['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x5eb840,args:_0xb6fa21,tdx:_0x52cbd4}=_0x2874ef,_0x5f44ee=_0x5eb840;if(_0xb6fa21[_0x34dd89(0x184)]===0x0)return console[_0x34dd89(0x16a)](_0x34dd89(0x183)),console['error'](_0x34dd89(0x174)),console[_0x34dd89(0x16a)](_0x34dd89(0x168)),console[_0x34dd89(0x16a)](_0x34dd89(0x15a)),console[_0x34dd89(0x16a)](_0x34dd89(0x154)),0x1;const _0x202040=_0xb6fa21[0x0],_0x4e7b41=_0x5eb840[_0x34dd89(0x17a)];let _0x35976f=_0x202040;_0x4e7b41&&!_0x202040[_0x34dd89(0x16f)]('/')&&(_0x35976f=_0x4e7b41+'/'+_0x202040,_0x5f44ee['verbose']&&console[_0x34dd89(0x16a)](_0x34dd89(0x17d)+_0x35976f));const _0x3173be=await withSpinner(_0x34dd89(0x162)+_0x35976f+_0x34dd89(0x16d),()=>_0x52cbd4[_0x34dd89(0x17e)][_0x34dd89(0x15d)](_0x35976f),{'verbose':_0x5f44ee[_0x34dd89(0x158)]}),_0x103673=_0x3173be['data'];_0x5f44ee[_0x34dd89(0x158)]&&console[_0x34dd89(0x16a)](_0x34dd89(0x17f)+_0x103673[_0x34dd89(0x169)]);if(_0x103673[_0x34dd89(0x169)]!==_0x34dd89(0x17e))return console[_0x34dd89(0x16a)](_0x34dd89(0x160)+_0x103673[_0x34dd89(0x169)]+_0x34dd89(0x163)),console[_0x34dd89(0x16a)](_0x34dd89(0x157)),0x1;if(!_0x103673[_0x34dd89(0x176)])throw new SDKError(ErrorCode[_0x34dd89(0x170)],_0x34dd89(0x17c));const _0x3895e1=_0x103673[_0x34dd89(0x165)],_0x5865dc=_0x103673[_0x34dd89(0x176)];_0x5f44ee[_0x34dd89(0x158)]&&(console[_0x34dd89(0x16a)]('Parent\x20ID:\x20'+_0x3895e1),console['error'](_0x34dd89(0x16b)+_0x5865dc));let _0x1c4565;if(_0x5f44ee[_0x34dd89(0x155)]){const _0x1a346d=_0x5f44ee[_0x34dd89(0x155)],_0x218631=await withSpinner(_0x34dd89(0x16e)+_0x1a346d+_0x34dd89(0x16d),()=>_0x52cbd4[_0x34dd89(0x17e)][_0x34dd89(0x180)](_0x3895e1,_0x1a346d),{'verbose':_0x5f44ee[_0x34dd89(0x158)]});_0x1c4565=parseInt(_0x218631[_0x34dd89(0x17b)],0xa),_0x5f44ee[_0x34dd89(0x158)]&&console[_0x34dd89(0x16a)](_0x34dd89(0x164)+_0x1c4565);}const _0x436bca=await loadJSONFromOptions(_0x5f44ee[_0x34dd89(0x16c)],_0x5f44ee['ruleFile']),_0x7aba0b={'name':_0x5f44ee[_0x34dd89(0x15c)],'description':_0x5f44ee[_0x34dd89(0x159)],'rule':_0x436bca,'kind':_0x5f44ee[_0x34dd89(0x172)]!==undefined?parseInt(_0x5f44ee['kind'],0xa):undefined,'segmentFolderId':_0x1c4565},_0x5794ed=await withSpinner(_0x34dd89(0x166)+_0x103673[_0x34dd89(0x156)]+_0x34dd89(0x16d),()=>_0x52cbd4[_0x34dd89(0x17e)][_0x34dd89(0x153)](_0x3895e1,_0x5865dc,_0x7aba0b),{'verbose':_0x5f44ee[_0x34dd89(0x158)]}),_0x5c96b4=_0x5794ed[_0x34dd89(0x17b)];return console[_0x34dd89(0x16a)](_0x34dd89(0x15e)+_0x5c96b4[_0x34dd89(0x15c)]+'\x27'),_0x35976f!==_0x202040&&console[_0x34dd89(0x16a)](_0x34dd89(0x179)+_0x35976f),await handleSDKOutput([_0x5c96b4],_0x5f44ee),0x0;}}
@@ -1 +1 @@
1
- const a43_0x20f723=a43_0x5534;(function(_0x55aaaa,_0x45f985){const _0x5b5449=a43_0x5534,_0x7b325e=_0x55aaaa();while(!![]){try{const _0x31e4b6=parseInt(_0x5b5449(0xdc))/0x1+parseInt(_0x5b5449(0x100))/0x2*(parseInt(_0x5b5449(0xfe))/0x3)+-parseInt(_0x5b5449(0xca))/0x4*(-parseInt(_0x5b5449(0xd5))/0x5)+parseInt(_0x5b5449(0xde))/0x6*(parseInt(_0x5b5449(0xd9))/0x7)+parseInt(_0x5b5449(0x101))/0x8+-parseInt(_0x5b5449(0xf7))/0x9*(parseInt(_0x5b5449(0xcd))/0xa)+-parseInt(_0x5b5449(0xd6))/0xb;if(_0x31e4b6===_0x45f985)break;else _0x7b325e['push'](_0x7b325e['shift']());}catch(_0x68019e){_0x7b325e['push'](_0x7b325e['shift']());}}}(a43_0x5da5,0xbc713));import{existsSync,statSync}from'fs';function a43_0x5534(_0x302cba,_0x1b6393){_0x302cba=_0x302cba-0xc6;const _0x5da5f4=a43_0x5da5();let _0x553497=_0x5da5f4[_0x302cba];return _0x553497;}function a43_0x5da5(){const _0x434190=['parentId','name','502392lVfZuQ','parentName','4xYbmPB','11841184yTugwU','Resolved\x20path\x20type:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Examples:','Target\x20path:\x20','isDirectory','1711948NeRKvm','segmentPath','site','77590TeGbBS','data','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Folder\x20ID:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','folderPath','5CnalQq','30476666WgBBYA','segment:use','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','14TGChJg','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','join','843429wUQrJD','✔\x20Context\x20set\x20to:\x20','3020586tuCbFq','error','cyan','log','split','config','execute','Error:\x20Path\x20is\x20required\x0a','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','slice','green','dim','segment','length','folderId','resolvePathToResource','Site:\x20','segments','parent_segment','type','verbose','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Resolving\x20path\x20\x27','639NlPviT','\x27...','fullPath','red','Parent\x20ID:\x20'];a43_0x5da5=function(){return _0x434190;};return a43_0x5da5();}import a43_0x2f13e4 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x20f723(0xfd)]=a43_0x20f723(0xd7);['description']=a43_0x20f723(0xe6);async[a43_0x20f723(0xe4)](_0x56ea44){const _0x428e2b=a43_0x20f723,{options:_0x4f28e9,args:_0x552d75,tdx:_0x311c80}=_0x56ea44;if(_0x552d75[_0x428e2b(0xeb)]===0x0)return console['error'](a43_0x2f13e4[_0x428e2b(0xfa)](_0x428e2b(0xe5))),console[_0x428e2b(0xdf)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0x428e2b(0xc7)),console[_0x428e2b(0xdf)](_0x428e2b(0xd0)),console['error'](_0x428e2b(0xda)),console['error'](_0x428e2b(0xcf)),console['error'](_0x428e2b(0xf3)),0x1;const _0x394d3e=_0x552d75[0x0],_0x5699ad=_0x4f28e9['session'];try{if(_0x394d3e==='/')return saveSessionContext({'segment_path':undefined},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4[_0x428e2b(0xe8)](_0x428e2b(0xf5))),0x0;if(existsSync(_0x394d3e)&&statSync(_0x394d3e)[_0x428e2b(0xc9)]()){let _0x36c8a3;try{_0x36c8a3=findTdxConfig(_0x394d3e);}catch{return console['error'](a43_0x2f13e4[_0x428e2b(0xfa)](_0x428e2b(0xd3)+_0x394d3e)),console[_0x428e2b(0xdf)](a43_0x2f13e4[_0x428e2b(0xe0)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x2255ee=_0x36c8a3[_0x428e2b(0xe3)][_0x428e2b(0xf0)];return saveSessionContext({'segment_path':_0x2255ee,'parent_segment':_0x2255ee},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4['green'](_0x428e2b(0xdd)+a43_0x2f13e4['cyan'](_0x2255ee))),0x0;}const _0x259092=_0x4f28e9[_0x428e2b(0xcb)];let _0x5248d4=_0x394d3e;const _0x5c7d13=parsePath(_0x394d3e);if(!_0x5c7d13['isAbsolute']){if(!_0x259092)return console[_0x428e2b(0xdf)](a43_0x2f13e4['red'](_0x428e2b(0xc6))),console['error'](a43_0x2f13e4[_0x428e2b(0xe0)](_0x428e2b(0xf4))),0x1;if(_0x394d3e==='..'){const _0x12aa62=_0x259092[_0x428e2b(0xe2)]('/')[_0x428e2b(0xe7)](0x0,-0x1)[_0x428e2b(0xdb)]('/');_0x5248d4=_0x12aa62||'/';}else _0x394d3e==='.'?_0x5248d4=_0x259092:_0x5248d4=_0x259092+'/'+_0x394d3e;_0x4f28e9[_0x428e2b(0xf2)]&&console[_0x428e2b(0xdf)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5248d4);}if(_0x5248d4==='/'||_0x5248d4==='')return saveSessionContext({'segment_path':undefined},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4[_0x428e2b(0xe8)](_0x428e2b(0xf5))),0x0;_0x5248d4=normalizePath(_0x5248d4);const _0x539d5a=parsePath(_0x5248d4)[_0x428e2b(0xef)];if(_0x539d5a[_0x428e2b(0xeb)]===0x0)return saveSessionContext({'segment_path':undefined},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4[_0x428e2b(0xe8)](_0x428e2b(0xf5))),0x0;_0x4f28e9[_0x428e2b(0xf2)]&&(console['error'](_0x428e2b(0xee)+_0x4f28e9[_0x428e2b(0xcc)]),console[_0x428e2b(0xdf)](_0x428e2b(0xc8)+_0x5248d4));const _0x469394=await withSpinner(_0x428e2b(0xf6)+_0x5248d4+_0x428e2b(0xf8),()=>_0x311c80['segment'][_0x428e2b(0xed)](_0x5248d4),{'verbose':_0x4f28e9['verbose']}),_0x4302f2=_0x469394[_0x428e2b(0xce)];_0x4f28e9['verbose']&&(console[_0x428e2b(0xdf)](_0x428e2b(0x102)+_0x4302f2['type']),console[_0x428e2b(0xdf)](_0x428e2b(0xfb)+_0x4302f2[_0x428e2b(0xfc)]),_0x4302f2['folderId']&&console[_0x428e2b(0xdf)](_0x428e2b(0xd2)+_0x4302f2[_0x428e2b(0xec)]));if(_0x4302f2[_0x428e2b(0xf1)]===_0x428e2b(0xea))return console[_0x428e2b(0xdf)](a43_0x2f13e4[_0x428e2b(0xfa)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x428e2b(0xdf)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x428e2b(0xdf)](a43_0x2f13e4[_0x428e2b(0xe0)]('Use:\x20tdx\x20segment\x20use\x20'+_0x4302f2['parentName']+(_0x4302f2[_0x428e2b(0xd4)]?'/'+_0x4302f2[_0x428e2b(0xd4)][_0x428e2b(0xdb)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x4302f2[_0x428e2b(0xf9)],'parent_segment':_0x4302f2[_0x428e2b(0xff)]},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4[_0x428e2b(0xe8)]('✔\x20Context\x20set\x20to:\x20'+a43_0x2f13e4[_0x428e2b(0xe0)](_0x4302f2[_0x428e2b(0xf9)]))),_0x4f28e9[_0x428e2b(0xf2)]&&(console['error'](a43_0x2f13e4[_0x428e2b(0xe9)](_0x428e2b(0xd8))),console[_0x428e2b(0xdf)](a43_0x2f13e4[_0x428e2b(0xe9)](_0x428e2b(0xd1)))),0x0;}catch(_0x43107d){throw _0x43107d;}}}
1
+ const a43_0x7e6bac=a43_0x52a9;(function(_0x50a78c,_0x35471e){const _0x4c067f=a43_0x52a9,_0x149404=_0x50a78c();while(!![]){try{const _0x1ce831=parseInt(_0x4c067f(0x127))/0x1+parseInt(_0x4c067f(0x12a))/0x2*(-parseInt(_0x4c067f(0x122))/0x3)+-parseInt(_0x4c067f(0x12d))/0x4+parseInt(_0x4c067f(0x141))/0x5+-parseInt(_0x4c067f(0x158))/0x6*(parseInt(_0x4c067f(0x12f))/0x7)+parseInt(_0x4c067f(0x153))/0x8+parseInt(_0x4c067f(0x12c))/0x9*(-parseInt(_0x4c067f(0x124))/0xa);if(_0x1ce831===_0x35471e)break;else _0x149404['push'](_0x149404['shift']());}catch(_0x3fec4d){_0x149404['push'](_0x149404['shift']());}}}(a43_0x109b,0x2b69b));function a43_0x109b(){const _0x231696=['green','458637aJUMeJ','Site:\x20','10ImdITm','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','fullPath','293510szyEMt','Resolved\x20path\x20type:\x20','segment:use','4qEHcFA','Folder\x20ID:\x20','697077AhrIgS','302200kFQbog','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','361522EfNfHr','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','\x27...','red','log','cyan','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','error','description','dim','Target\x20path:\x20','type','parentId','Parent\x20ID:\x20','✔\x20Context\x20set\x20to:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','1662260tLmKAL','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Error:\x20Path\x20is\x20required\x0a','segment','Resolving\x20path\x20\x27','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','site','segmentPath','segments','Use:\x20tdx\x20segment\x20use\x20','Resolved\x20relative\x20path\x20to:\x20','join','length','parent_segment','resolvePathToResource','parentName','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','folderId','498112HAgyUp','data','folderPath','verbose','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','6inAtZR','split'];a43_0x109b=function(){return _0x231696;};return a43_0x109b();}import{existsSync,statSync}from'fs';import a43_0x49a515 from'chalk';import{BaseCommand}from'./command.js';function a43_0x52a9(_0x1f31f1,_0x16a28c){_0x1f31f1=_0x1f31f1-0x121;const _0x109bf3=a43_0x109b();let _0x52a96f=_0x109bf3[_0x1f31f1];return _0x52a96f;}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a43_0x7e6bac(0x129);[a43_0x7e6bac(0x139)]=a43_0x7e6bac(0x125);async['execute'](_0x529045){const _0x347516=a43_0x7e6bac,{options:_0x4a8d32,args:_0x38ec4e,tdx:_0x5a5e4d}=_0x529045;if(_0x38ec4e[_0x347516(0x14d)]===0x0)return console[_0x347516(0x138)](a43_0x49a515['red'](_0x347516(0x143))),console[_0x347516(0x138)](_0x347516(0x140)),console['error']('Examples:'),console[_0x347516(0x138)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x347516(0x138)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22'),console['error'](_0x347516(0x142)),console[_0x347516(0x138)](_0x347516(0x146)),0x1;const _0x4ebf34=_0x38ec4e[0x0],_0xac586c=_0x4a8d32['session'];try{if(_0x4ebf34==='/')return saveSessionContext({'segment_path':undefined},_0xac586c),console[_0x347516(0x133)](a43_0x49a515[_0x347516(0x121)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x4ebf34)&&statSync(_0x4ebf34)['isDirectory']()){let _0x158935;try{_0x158935=findTdxConfig(_0x4ebf34);}catch{return console[_0x347516(0x138)](a43_0x49a515['red'](_0x347516(0x151)+_0x4ebf34)),console[_0x347516(0x138)](a43_0x49a515[_0x347516(0x134)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x1f7f27=_0x158935['config'][_0x347516(0x14e)];return saveSessionContext({'segment_path':_0x1f7f27,'parent_segment':_0x1f7f27},_0xac586c),console[_0x347516(0x133)](a43_0x49a515[_0x347516(0x121)](_0x347516(0x13f)+a43_0x49a515[_0x347516(0x134)](_0x1f7f27))),0x0;}const _0x369f79=_0x4a8d32[_0x347516(0x148)];let _0x4b8f31=_0x4ebf34;const _0xbd1582=parsePath(_0x4ebf34);if(!_0xbd1582['isAbsolute']){if(!_0x369f79)return console[_0x347516(0x138)](a43_0x49a515['red'](_0x347516(0x157))),console['error'](a43_0x49a515['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x4ebf34==='..'){const _0x52e714=_0x369f79[_0x347516(0x159)]('/')['slice'](0x0,-0x1)[_0x347516(0x14c)]('/');_0x4b8f31=_0x52e714||'/';}else _0x4ebf34==='.'?_0x4b8f31=_0x369f79:_0x4b8f31=_0x369f79+'/'+_0x4ebf34;_0x4a8d32[_0x347516(0x156)]&&console[_0x347516(0x138)](_0x347516(0x14b)+_0x4b8f31);}if(_0x4b8f31==='/'||_0x4b8f31==='')return saveSessionContext({'segment_path':undefined},_0xac586c),console[_0x347516(0x133)](a43_0x49a515[_0x347516(0x121)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x4b8f31=normalizePath(_0x4b8f31);const _0x28d677=parsePath(_0x4b8f31)[_0x347516(0x149)];if(_0x28d677[_0x347516(0x14d)]===0x0)return saveSessionContext({'segment_path':undefined},_0xac586c),console['log'](a43_0x49a515[_0x347516(0x121)](_0x347516(0x137))),0x0;_0x4a8d32[_0x347516(0x156)]&&(console[_0x347516(0x138)](_0x347516(0x123)+_0x4a8d32[_0x347516(0x147)]),console['error'](_0x347516(0x13b)+_0x4b8f31));const _0x3ae524=await withSpinner(_0x347516(0x145)+_0x4b8f31+_0x347516(0x131),()=>_0x5a5e4d[_0x347516(0x144)][_0x347516(0x14f)](_0x4b8f31),{'verbose':_0x4a8d32[_0x347516(0x156)]}),_0xadf6fa=_0x3ae524[_0x347516(0x154)];_0x4a8d32['verbose']&&(console['error'](_0x347516(0x128)+_0xadf6fa[_0x347516(0x13c)]),console[_0x347516(0x138)](_0x347516(0x13e)+_0xadf6fa[_0x347516(0x13d)]),_0xadf6fa[_0x347516(0x152)]&&console['error'](_0x347516(0x12b)+_0xadf6fa[_0x347516(0x152)]));if(_0xadf6fa[_0x347516(0x13c)]==='segment')return console[_0x347516(0x138)](a43_0x49a515[_0x347516(0x132)](_0x347516(0x130))),console['error'](_0x347516(0x135)),console[_0x347516(0x138)](a43_0x49a515[_0x347516(0x134)](_0x347516(0x14a)+_0xadf6fa['parentName']+(_0xadf6fa[_0x347516(0x155)]?'/'+_0xadf6fa[_0x347516(0x155)][_0x347516(0x14c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0xadf6fa[_0x347516(0x126)],'parent_segment':_0xadf6fa[_0x347516(0x150)]},_0xac586c),console[_0x347516(0x133)](a43_0x49a515[_0x347516(0x121)](_0x347516(0x13f)+a43_0x49a515[_0x347516(0x134)](_0xadf6fa['fullPath']))),_0x4a8d32['verbose']&&(console[_0x347516(0x138)](a43_0x49a515[_0x347516(0x13a)](_0x347516(0x136))),console['error'](a43_0x49a515[_0x347516(0x13a)](_0x347516(0x12e)))),0x0;}catch(_0x437f1b){throw _0x437f1b;}}}
@@ -1 +1 @@
1
- const a44_0x785397=a44_0x5dd0;function a44_0x43cb(){const _0x41451d=['validCount','parentSegment','filePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','green','8028296CZsqEX','endsWith','errorCode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','warnings','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','log','.yaml','893360xBfNiD','no_parent','yellow','helpText','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20file(s)\x20with\x20errors,\x20','6snemTZ','293817IEcZXp','Error:\x20Directory\x20not\x20found:\x20','error','):\x20','\x20warning(s)\x20found','.yml','invalidCount','cyan','5600756GGwzso','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','message','description','20258910mLciBn','valid','cwd','verbose','errors','length','1753800KJbHHN','warningCount','targetDir','name','\x20valid','547945ThogiQ','red','Validation\x20failed:\x20','14lTdiUn','Error:\x20','hasErrors','segment:validate','dim','\x20error(s)'];a44_0x43cb=function(){return _0x41451d;};return a44_0x43cb();}(function(_0x3f9fb4,_0x102ebb){const _0x260b79=a44_0x5dd0,_0x2db3b6=_0x3f9fb4();while(!![]){try{const _0x41fff8=-parseInt(_0x260b79(0xb9))/0x1+parseInt(_0x260b79(0xbc))/0x2*(-parseInt(_0x260b79(0xd6))/0x3)+-parseInt(_0x260b79(0xb4))/0x4+parseInt(_0x260b79(0xcf))/0x5+parseInt(_0x260b79(0xd5))/0x6*(parseInt(_0x260b79(0xaa))/0x7)+-parseInt(_0x260b79(0xc7))/0x8+parseInt(_0x260b79(0xae))/0x9;if(_0x41fff8===_0x102ebb)break;else _0x2db3b6['push'](_0x2db3b6['shift']());}catch(_0x2c9759){_0x2db3b6['push'](_0x2db3b6['shift']());}}}(a44_0x43cb,0x87519));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_0x2332e5 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a44_0x5dd0(_0x55fdba,_0x57978e){_0x55fdba=_0x55fdba-0xa6;const _0x43cb8d=a44_0x43cb();let _0x5dd0e4=_0x43cb8d[_0x55fdba];return _0x5dd0e4;}export class SegmentValidateCommand extends BaseCommand{[a44_0x785397(0xb7)]=a44_0x785397(0xbf);[a44_0x785397(0xad)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async['execute'](_0x17407a){const _0x59b23f=a44_0x785397,{options:_0x2c3553,args:_0x14ac13}=_0x17407a,_0x3392e9=_0x2c3553,_0x5d82ae=await resolveTarget({'arg':_0x14ac13[0x0],'contextParent':_0x2c3553[_0x59b23f(0xc3)],'cwd':process[_0x59b23f(0xb0)]()});if(!isSuccessfulResolution(_0x5d82ae))return _0x5d82ae[_0x59b23f(0xc9)]===_0x59b23f(0xd0)?(console[_0x59b23f(0xd8)](a44_0x2332e5[_0x59b23f(0xd1)](_0x59b23f(0xc5))),console['error'](_0x59b23f(0xab)),console[_0x59b23f(0xd8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x59b23f(0xd8)](_0x59b23f(0xca))):(console[_0x59b23f(0xd8)](a44_0x2332e5[_0x59b23f(0xba)](_0x59b23f(0xbd)+_0x5d82ae[_0x59b23f(0xac)]+'\x0a')),_0x5d82ae['helpText']&&console['error'](a44_0x2332e5[_0x59b23f(0xa9)](_0x5d82ae[_0x59b23f(0xd2)]))),0x1;const _0x21d579=_0x5d82ae[_0x59b23f(0xb6)],_0x2979a3=_0x5d82ae['type']==='file'?_0x5d82ae[_0x59b23f(0xc4)]:undefined;if(!_0x2979a3&&!existsSync(_0x21d579))return console['error'](a44_0x2332e5[_0x59b23f(0xba)](_0x59b23f(0xd7)+_0x21d579+'\x0a')),0x1;let _0x42867c;if(_0x2979a3){if(!_0x2979a3[_0x59b23f(0xc8)](_0x59b23f(0xa7))&&!_0x2979a3[_0x59b23f(0xc8)](_0x59b23f(0xce)))return console[_0x59b23f(0xd8)](a44_0x2332e5['red'](_0x59b23f(0xd3)+_0x2979a3+'\x0a')),0x1;_0x42867c=[_0x2979a3];}else _0x42867c=findYamlFiles(_0x21d579);if(_0x42867c[_0x59b23f(0xb3)]===0x0)return console[_0x59b23f(0xd8)](a44_0x2332e5[_0x59b23f(0xba)](_0x59b23f(0xcc)+_0x21d579+'\x0a')),0x1;const _0x4e2dba=validateYamlFiles(_0x42867c,_0x21d579),_0xc61d48=calculateSummary(_0x4e2dba);for(const _0x19c3c7 of _0x4e2dba){if(!isValidationResult(_0x19c3c7))continue;const {relativePath:_0x58f692,source:_0x39e368,result:_0x3c1c20,fileType:_0x211cb8}=_0x19c3c7,_0xb61c9b=_0x211cb8;if(_0x3c1c20['valid']&&_0x3c1c20[_0x59b23f(0xcb)][_0x59b23f(0xb3)]===0x0)_0x3392e9[_0x59b23f(0xb1)]&&console[_0x59b23f(0xcd)](a44_0x2332e5[_0x59b23f(0xc6)]('✔\x20'+_0x58f692)+a44_0x2332e5['dim']('\x20('+_0xb61c9b+')'));else _0x3c1c20[_0x59b23f(0xaf)]?(console[_0x59b23f(0xcd)](a44_0x2332e5['yellow']('⚠\x20'+_0x58f692)+a44_0x2332e5[_0x59b23f(0xc0)]('\x20('+_0xb61c9b+_0x59b23f(0xd9)+_0x3c1c20[_0x59b23f(0xcb)][_0x59b23f(0xb3)]+'\x20warning(s)')),console[_0x59b23f(0xcd)](formatValidationResult(_0x3c1c20,_0x39e368,_0x58f692))):(console['log'](a44_0x2332e5[_0x59b23f(0xba)]('✖\x20'+_0x58f692)+a44_0x2332e5[_0x59b23f(0xc0)]('\x20('+_0xb61c9b+_0x59b23f(0xd9)+_0x3c1c20[_0x59b23f(0xb2)][_0x59b23f(0xb3)]+_0x59b23f(0xc1))),console[_0x59b23f(0xcd)](formatValidationResult(_0x3c1c20,_0x39e368,_0x58f692)));}return console[_0x59b23f(0xcd)](''),_0xc61d48[_0x59b23f(0xbe)]?(console['log'](a44_0x2332e5[_0x59b23f(0xba)](_0x59b23f(0xbb)+_0xc61d48[_0x59b23f(0xa8)]+_0x59b23f(0xd4)+_0xc61d48[_0x59b23f(0xc2)]+_0x59b23f(0xb8))),_0xc61d48[_0x59b23f(0xb5)]>0x0&&console[_0x59b23f(0xcd)](a44_0x2332e5[_0x59b23f(0xd1)](_0xc61d48['warningCount']+_0x59b23f(0xa6))),0x1):(console[_0x59b23f(0xcd)](a44_0x2332e5[_0x59b23f(0xc6)]('✔\x20All\x20'+_0xc61d48[_0x59b23f(0xc2)]+'\x20file(s)\x20valid')),_0xc61d48[_0x59b23f(0xb5)]>0x0&&console[_0x59b23f(0xcd)](a44_0x2332e5[_0x59b23f(0xd1)](_0xc61d48[_0x59b23f(0xb5)]+_0x59b23f(0xa6))),0x0);}}
1
+ const a44_0x5d294a=a44_0x5d06;function a44_0x25cb(){const _0x3dac2b=['description','targetDir','2ECwBHW','):\x20','3247350LzdVxn','endsWith','9776333QVLHRB','36bFVqhb','no_parent','1853228tyGLvB','errors','✔\x20All\x20','errorCode','file','log','116380ikBmhc','execute','Error:\x20Directory\x20not\x20found:\x20','\x20warning(s)\x20found','.yaml','warningCount','warnings','verbose','\x20file(s)\x20with\x20errors,\x20','\x20warning(s)','1085576vbDWeE','length','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20valid','segment:validate','parentSegment','helpText','dim','hasErrors','name','3dmbaBr','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20error(s)','Validate\x20segment\x20and\x20journey\x20YAML\x20files','yellow','green','error','message','cyan','valid','24471645yNosZc','validCount','red','438TcVWEe','type','282312gIEBcq'];a44_0x25cb=function(){return _0x3dac2b;};return a44_0x25cb();}(function(_0x1318ed,_0x1eb8d3){const _0x33354d=a44_0x5d06,_0x493276=_0x1318ed();while(!![]){try{const _0x8af091=parseInt(_0x33354d(0xb3))/0x1*(parseInt(_0x33354d(0xca))/0x2)+-parseInt(_0x33354d(0xd5))/0x3*(-parseInt(_0x33354d(0xba))/0x4)+parseInt(_0x33354d(0xc0))/0x5*(parseInt(_0x33354d(0xe2))/0x6)+-parseInt(_0x33354d(0xb7))/0x7+-parseInt(_0x33354d(0xe4))/0x8+-parseInt(_0x33354d(0xb8))/0x9*(-parseInt(_0x33354d(0xb5))/0xa)+-parseInt(_0x33354d(0xdf))/0xb;if(_0x8af091===_0x1eb8d3)break;else _0x493276['push'](_0x493276['shift']());}catch(_0xfc053){_0x493276['push'](_0x493276['shift']());}}}(a44_0x25cb,0xd9600));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_0x13736e from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a44_0x5d06(_0xf149ff,_0x4c7bf1){_0xf149ff=_0xf149ff-0xb2;const _0x25cb2d=a44_0x25cb();let _0x5d0644=_0x25cb2d[_0xf149ff];return _0x5d0644;}export class SegmentValidateCommand extends BaseCommand{[a44_0x5d294a(0xd4)]=a44_0x5d294a(0xcf);[a44_0x5d294a(0xe5)]=a44_0x5d294a(0xd8);async[a44_0x5d294a(0xc1)](_0x358357){const _0x3f2d92=a44_0x5d294a,{options:_0x4e4531,args:_0x1ae156}=_0x358357,_0x53f5c0=_0x4e4531,_0x386181=await resolveTarget({'arg':_0x1ae156[0x0],'contextParent':_0x4e4531[_0x3f2d92(0xd0)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x386181))return _0x386181[_0x3f2d92(0xbd)]===_0x3f2d92(0xb9)?(console[_0x3f2d92(0xdb)](a44_0x13736e['yellow'](_0x3f2d92(0xcc))),console[_0x3f2d92(0xdb)](_0x3f2d92(0xcd)),console[_0x3f2d92(0xdb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x3f2d92(0xdb)](_0x3f2d92(0xd6))):(console[_0x3f2d92(0xdb)](a44_0x13736e[_0x3f2d92(0xe1)]('Error:\x20'+_0x386181[_0x3f2d92(0xdc)]+'\x0a')),_0x386181[_0x3f2d92(0xd1)]&&console['error'](a44_0x13736e[_0x3f2d92(0xdd)](_0x386181[_0x3f2d92(0xd1)]))),0x1;const _0x23bf0c=_0x386181[_0x3f2d92(0xb2)],_0x129994=_0x386181[_0x3f2d92(0xe3)]===_0x3f2d92(0xbe)?_0x386181['filePath']:undefined;if(!_0x129994&&!existsSync(_0x23bf0c))return console[_0x3f2d92(0xdb)](a44_0x13736e['red'](_0x3f2d92(0xc2)+_0x23bf0c+'\x0a')),0x1;let _0x1a8e66;if(_0x129994){if(!_0x129994[_0x3f2d92(0xb6)]('.yml')&&!_0x129994[_0x3f2d92(0xb6)](_0x3f2d92(0xc4)))return console['error'](a44_0x13736e['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x129994+'\x0a')),0x1;_0x1a8e66=[_0x129994];}else _0x1a8e66=findYamlFiles(_0x23bf0c);if(_0x1a8e66[_0x3f2d92(0xcb)]===0x0)return console[_0x3f2d92(0xdb)](a44_0x13736e[_0x3f2d92(0xe1)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x23bf0c+'\x0a')),0x1;const _0x9890a3=validateYamlFiles(_0x1a8e66,_0x23bf0c),_0x44ae83=calculateSummary(_0x9890a3);for(const _0x1aba50 of _0x9890a3){if(!isValidationResult(_0x1aba50))continue;const {relativePath:_0x4694af,source:_0x3e4b25,result:_0x33b5d2,fileType:_0x4fc50f}=_0x1aba50,_0x1d50e8=_0x4fc50f;if(_0x33b5d2[_0x3f2d92(0xde)]&&_0x33b5d2[_0x3f2d92(0xc6)][_0x3f2d92(0xcb)]===0x0)_0x53f5c0[_0x3f2d92(0xc7)]&&console[_0x3f2d92(0xbf)](a44_0x13736e[_0x3f2d92(0xda)]('✔\x20'+_0x4694af)+a44_0x13736e[_0x3f2d92(0xd2)]('\x20('+_0x1d50e8+')'));else _0x33b5d2['valid']?(console[_0x3f2d92(0xbf)](a44_0x13736e['yellow']('⚠\x20'+_0x4694af)+a44_0x13736e[_0x3f2d92(0xd2)]('\x20('+_0x1d50e8+_0x3f2d92(0xb4)+_0x33b5d2['warnings'][_0x3f2d92(0xcb)]+_0x3f2d92(0xc9))),console[_0x3f2d92(0xbf)](formatValidationResult(_0x33b5d2,_0x3e4b25,_0x4694af))):(console[_0x3f2d92(0xbf)](a44_0x13736e[_0x3f2d92(0xe1)]('✖\x20'+_0x4694af)+a44_0x13736e[_0x3f2d92(0xd2)]('\x20('+_0x1d50e8+_0x3f2d92(0xb4)+_0x33b5d2[_0x3f2d92(0xbb)][_0x3f2d92(0xcb)]+_0x3f2d92(0xd7))),console[_0x3f2d92(0xbf)](formatValidationResult(_0x33b5d2,_0x3e4b25,_0x4694af)));}return console[_0x3f2d92(0xbf)](''),_0x44ae83[_0x3f2d92(0xd3)]?(console[_0x3f2d92(0xbf)](a44_0x13736e[_0x3f2d92(0xe1)]('Validation\x20failed:\x20'+_0x44ae83['invalidCount']+_0x3f2d92(0xc8)+_0x44ae83['validCount']+_0x3f2d92(0xce))),_0x44ae83[_0x3f2d92(0xc5)]>0x0&&console[_0x3f2d92(0xbf)](a44_0x13736e[_0x3f2d92(0xd9)](_0x44ae83['warningCount']+_0x3f2d92(0xc3))),0x1):(console[_0x3f2d92(0xbf)](a44_0x13736e[_0x3f2d92(0xda)](_0x3f2d92(0xbc)+_0x44ae83[_0x3f2d92(0xe0)]+'\x20file(s)\x20valid')),_0x44ae83[_0x3f2d92(0xc5)]>0x0&&console['log'](a44_0x13736e[_0x3f2d92(0xd9)](_0x44ae83[_0x3f2d92(0xc5)]+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- const a45_0x37dd92=a45_0x2ab5;(function(_0x2bee12,_0x21c1fa){const _0x362f45=a45_0x2ab5,_0x2af69d=_0x2bee12();while(!![]){try{const _0x3c6d4c=parseInt(_0x362f45(0x145))/0x1+parseInt(_0x362f45(0x13b))/0x2+-parseInt(_0x362f45(0x149))/0x3+-parseInt(_0x362f45(0x159))/0x4+parseInt(_0x362f45(0x153))/0x5*(parseInt(_0x362f45(0x160))/0x6)+parseInt(_0x362f45(0x132))/0x7+-parseInt(_0x362f45(0x14f))/0x8*(parseInt(_0x362f45(0x13f))/0x9);if(_0x3c6d4c===_0x21c1fa)break;else _0x2af69d['push'](_0x2af69d['shift']());}catch(_0x24cf42){_0x2af69d['push'](_0x2af69d['shift']());}}}(a45_0x4777,0x242aa));import{BaseCommand}from'./command.js';function a45_0x4777(){const _0x2e29c9=['1977458lJSwtl','verbose','journey','/e/','filter','segments','folders','No\x20items\x20match\x20pattern:\x20','✔\x20Found\x20','495800ZgtotC','Site:\x20','data','✔\x20Built\x20tree\x20with\x20','237078ucdhAv','includes','json','parentId','sort','maxDepth','92982SNYUZs','/app/ps/','journeyBundleName','localeCompare','871515ejbYuP','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','folderId','children','\x20folder','\x20journey','112hruqmo','map','journeys','(empty)','105pHOMUc','recursive','\x5c$&',',\x20and\x20','\x20segment','site','139312rpdJTi','type','description','length','name','format','test','62538KXOMhQ','parentSegment','/j/da','listUnifiedWithJourneys','Parent\x20ID:\x20','jsonl','cause','segment','listWithPattern','\x27...','replace','List\x20folders\x20and\x20child\x20segments','\x20matching\x20\x27','log','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','(not\x20set)','error','Set\x20a\x20parent\x20segment\x20context\x20first:','Listing\x20folders,\x20segments,\x20and\x20journeys...','folder','listRecursive','Folder/pattern\x20arg:\x20','Parent\x20segment\x20context:\x20','resolvePathToResource','listUnified','Resolving\x20path\x20\x27','Resolving\x20parent\x20segment\x20\x27'];a45_0x4777=function(){return _0x2e29c9;};return a45_0x4777();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a45_0x2ab5(_0x942f6d,_0x5e206a){_0x942f6d=_0x942f6d-0x127;const _0x4777ff=a45_0x4777();let _0x2ab5f1=_0x4777ff[_0x942f6d];return _0x2ab5f1;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x1c9c2d from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x37dd92(0x15d)]=a45_0x37dd92(0x137);[a45_0x37dd92(0x15b)]=a45_0x37dd92(0x16b);async['execute'](_0x272f34){const _0x50e831=a45_0x37dd92,{options:_0x4a95bb,args:_0x4e7c0d}=_0x272f34,_0x59d3fe=_0x4a95bb[_0x50e831(0x154)],_0x142090=_0x4e7c0d[0x0];try{const _0x2d3ea3=_0x4a95bb[_0x50e831(0x161)];_0x4a95bb[_0x50e831(0x133)]&&(console[_0x50e831(0x127)](_0x50e831(0x13c)+_0x4a95bb[_0x50e831(0x158)]),console['error'](_0x50e831(0x12d)+(_0x2d3ea3||_0x50e831(0x16f))),_0x142090&&console[_0x50e831(0x127)](_0x50e831(0x12c)+_0x142090),_0x59d3fe&&console[_0x50e831(0x127)]('Recursive\x20mode:\x20enabled'));if(!_0x2d3ea3)return console[_0x50e831(0x127)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x50e831(0x127)](''),console[_0x50e831(0x127)](_0x50e831(0x128)),console[_0x50e831(0x127)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console['error'](_0x50e831(0x16e)),console[_0x50e831(0x127)](''),console[_0x50e831(0x127)](_0x50e831(0x14a)),0x1;const _0x256094=_0x142090&&(_0x142090[_0x50e831(0x140)]('*')||_0x142090[_0x50e831(0x140)]('?'));if(_0x256094)return await this[_0x50e831(0x168)](_0x272f34,_0x2d3ea3,_0x142090);const _0x29837a=_0x142090?_0x2d3ea3+'/'+_0x142090:_0x2d3ea3;return _0x59d3fe?await this[_0x50e831(0x12b)](_0x272f34,_0x29837a):await this[_0x50e831(0x12f)](_0x272f34,_0x29837a);}catch(_0x5e60e6){if(_0x5e60e6 instanceof SDKError)return console[_0x50e831(0x127)]('Error:\x20'+_0x5e60e6['message']),_0x5e60e6[_0x50e831(0x166)]&&console['error']('\x20\x20Cause:\x20'+_0x5e60e6[_0x50e831(0x166)]),0x1;throw _0x5e60e6;}}async[a45_0x37dd92(0x168)](_0x3eb563,_0x2e60c6,_0xa0488a){const _0x55da99=a45_0x37dd92,{options:_0x8e34b1,tdx:_0x4f550b}=_0x3eb563,_0x3d5587=await withSpinner(_0x55da99(0x131)+_0x2e60c6+_0x55da99(0x169),()=>_0x4f550b[_0x55da99(0x167)][_0x55da99(0x12e)](_0x2e60c6),{'verbose':_0x8e34b1['verbose']}),_0x59a27e=_0x3d5587['data'],_0x32a8a1=await withSpinner(_0x55da99(0x129),()=>_0x4f550b[_0x55da99(0x167)][_0x55da99(0x163)](_0x59a27e['parentId'],_0x59a27e[_0x55da99(0x14b)]),{'verbose':_0x8e34b1[_0x55da99(0x133)]}),{folders:_0x31096e,segments:_0x34dbe0,journeys:_0x5a081b}=_0x32a8a1[_0x55da99(0x13d)],_0x4939e5=_0xa0488a['replace'](/[.+^${}()|[\]\\]/g,_0x55da99(0x155))[_0x55da99(0x16a)](/\*/g,'.*')[_0x55da99(0x16a)](/\?/g,'.'),_0x56aa33=new RegExp('^'+_0x4939e5+'$','i'),_0x6a62d=_0x31096e[_0x55da99(0x136)](_0x37a916=>_0x56aa33[_0x55da99(0x15f)](_0x37a916[_0x55da99(0x15d)])),_0x595ed6=_0x34dbe0[_0x55da99(0x136)](_0x3ff36b=>_0x56aa33['test'](_0x3ff36b[_0x55da99(0x15d)])),_0x1d522b=_0x5a081b[_0x55da99(0x136)](_0x1cf459=>_0x56aa33['test'](_0x1cf459[_0x55da99(0x147)])),_0x13b3b9=_0x6a62d[_0x55da99(0x15c)]+_0x595ed6[_0x55da99(0x15c)]+_0x1d522b[_0x55da99(0x15c)];console[_0x55da99(0x127)]('✔\x20Found\x20'+_0x6a62d['length']+_0x55da99(0x14d)+(_0x6a62d[_0x55da99(0x15c)]!==0x1?'s':'')+',\x20'+_0x595ed6[_0x55da99(0x15c)]+_0x55da99(0x157)+(_0x595ed6[_0x55da99(0x15c)]!==0x1?'s':'')+_0x55da99(0x156)+_0x1d522b[_0x55da99(0x15c)]+'\x20journey'+(_0x1d522b[_0x55da99(0x15c)]!==0x1?'s':'')+_0x55da99(0x16c)+_0xa0488a+'\x27');const _0x40e2fd=_0x32b8c8=>{const _0x260266=_0x55da99;return getConsoleNextUrl(_0x8e34b1['site'],_0x260266(0x146)+_0x59a27e[_0x260266(0x142)]+_0x260266(0x135)+_0x32b8c8);},_0x2dc1d5=_0x8e34b1[_0x55da99(0x15e)]==='json'||_0x8e34b1[_0x55da99(0x15e)]===_0x55da99(0x165);if(_0x2dc1d5){const _0x35bc4d=[..._0x6a62d[_0x55da99(0x150)](_0x59c97a=>({..._0x59c97a,'type':'folder'})),..._0x595ed6[_0x55da99(0x150)](_0x111333=>({..._0x111333,'type':_0x55da99(0x167),'url':_0x40e2fd(_0x111333['id'])})),..._0x1d522b[_0x55da99(0x150)](_0x178feb=>({..._0x178feb,'name':_0x178feb[_0x55da99(0x147)],'type':_0x55da99(0x134)}))][_0x55da99(0x143)]((_0x139b92,_0x474cb6)=>_0x139b92['name'][_0x55da99(0x148)](_0x474cb6[_0x55da99(0x15d)]));await handleSDKOutput(_0x35bc4d,_0x8e34b1);}else{if(_0x13b3b9===0x0)console['log'](_0x55da99(0x139)+_0xa0488a);else{console[_0x55da99(0x16d)](a45_0x1c9c2d['dim']('['+_0x2e60c6+']\x20matching\x20\x27'+_0xa0488a+'\x27'));const _0x12a09e=formatFlatList(_0x6a62d,_0x595ed6,{'showMetadata':!![],'getSegmentUrl':_0x40e2fd},_0x1d522b);console[_0x55da99(0x16d)](_0x12a09e);}}return 0x0;}async[a45_0x37dd92(0x12f)](_0x598f81,_0x1aded9){const _0x8f9bcd=a45_0x37dd92,{options:_0x316473,tdx:_0xe94b66}=_0x598f81,_0x537790=await withSpinner(_0x8f9bcd(0x130)+_0x1aded9+'\x27...',()=>_0xe94b66[_0x8f9bcd(0x167)][_0x8f9bcd(0x12e)](_0x1aded9),{'verbose':_0x316473[_0x8f9bcd(0x133)]}),_0xc716ad=_0x537790[_0x8f9bcd(0x13d)];_0x316473[_0x8f9bcd(0x133)]&&(console[_0x8f9bcd(0x127)](_0x8f9bcd(0x164)+_0xc716ad[_0x8f9bcd(0x142)]),_0xc716ad['folderId']&&console[_0x8f9bcd(0x127)]('Folder\x20ID:\x20'+_0xc716ad[_0x8f9bcd(0x14b)]));const _0x2c5543=await withSpinner(_0x8f9bcd(0x129),()=>_0xe94b66[_0x8f9bcd(0x167)][_0x8f9bcd(0x163)](_0xc716ad[_0x8f9bcd(0x142)],_0xc716ad[_0x8f9bcd(0x14b)]),{'verbose':_0x316473[_0x8f9bcd(0x133)]}),{folders:_0x3cc3da,segments:_0xab477c,journeys:_0x4e2bf2}=_0x2c5543['data'],_0x27c35c=_0x3cc3da[_0x8f9bcd(0x15c)]+_0xab477c[_0x8f9bcd(0x15c)]+_0x4e2bf2[_0x8f9bcd(0x15c)];console[_0x8f9bcd(0x127)](_0x8f9bcd(0x13a)+_0x3cc3da[_0x8f9bcd(0x15c)]+_0x8f9bcd(0x14d)+(_0x3cc3da['length']!==0x1?'s':'')+',\x20'+_0xab477c[_0x8f9bcd(0x15c)]+_0x8f9bcd(0x157)+(_0xab477c[_0x8f9bcd(0x15c)]!==0x1?'s':'')+_0x8f9bcd(0x156)+_0x4e2bf2[_0x8f9bcd(0x15c)]+_0x8f9bcd(0x14e)+(_0x4e2bf2[_0x8f9bcd(0x15c)]!==0x1?'s':''));const _0x349e03=_0x46bb19=>{const _0x48e8e9=_0x8f9bcd;return getConsoleNextUrl(_0x316473[_0x48e8e9(0x158)],_0x48e8e9(0x146)+_0xc716ad[_0x48e8e9(0x142)]+_0x48e8e9(0x135)+_0x46bb19);},_0x9b31fd=_0x159f21=>{const _0x520c6d=_0x8f9bcd;return getConsoleNextUrl(_0x316473['site'],'/app/ps/'+_0xc716ad[_0x520c6d(0x142)]+_0x520c6d(0x135)+_0x159f21+'/j/da');},_0x3c52d1=_0x316473['format']===_0x8f9bcd(0x141)||_0x316473[_0x8f9bcd(0x15e)]==='jsonl';if(_0x3c52d1){const _0x1a90d6=[..._0x3cc3da[_0x8f9bcd(0x150)](_0x1a8bff=>({..._0x1a8bff,'type':_0x8f9bcd(0x12a)})),..._0xab477c['map'](_0x55ff73=>({..._0x55ff73,'type':'segment','url':_0x349e03(_0x55ff73['id'])})),..._0x4e2bf2[_0x8f9bcd(0x150)](_0x4c821d=>({..._0x4c821d,'name':_0x4c821d[_0x8f9bcd(0x147)],'type':_0x8f9bcd(0x134),'url':_0x9b31fd(_0x4c821d['id'])}))][_0x8f9bcd(0x143)]((_0x49c58a,_0x360e7f)=>_0x49c58a[_0x8f9bcd(0x15d)][_0x8f9bcd(0x148)](_0x360e7f[_0x8f9bcd(0x15d)]));await handleSDKOutput(_0x1a90d6,_0x316473);}else{if(_0x27c35c===0x0)console[_0x8f9bcd(0x16d)](a45_0x1c9c2d['dim']('['+_0x1aded9+']')),console['log'](_0x8f9bcd(0x152));else{console[_0x8f9bcd(0x16d)](a45_0x1c9c2d['dim']('['+_0x1aded9+']'));const _0x21a8e6=formatFlatList(_0x3cc3da,_0xab477c,{'showMetadata':!![],'getSegmentUrl':_0x349e03,'getJourneyUrl':_0x9b31fd},_0x4e2bf2);console['log'](_0x21a8e6);}}return 0x0;}async[a45_0x37dd92(0x12b)](_0x4c538b,_0x194cbe){const _0x33bf30=a45_0x37dd92,{options:_0x3ec630,tdx:_0x464d19}=_0x4c538b,_0xf7008d=await withSpinner(_0x33bf30(0x130)+_0x194cbe+_0x33bf30(0x169),()=>_0x464d19[_0x33bf30(0x167)]['resolvePathToResource'](_0x194cbe),{'verbose':_0x3ec630[_0x33bf30(0x133)]}),_0x2c314b=_0xf7008d['data'];_0x3ec630[_0x33bf30(0x133)]&&(console[_0x33bf30(0x127)](_0x33bf30(0x164)+_0x2c314b[_0x33bf30(0x142)]),_0x2c314b[_0x33bf30(0x14b)]&&console[_0x33bf30(0x127)]('Folder\x20ID:\x20'+_0x2c314b[_0x33bf30(0x14b)]));const _0x1fc63f=_0x3ec630[_0x33bf30(0x144)]||0xa,_0x3e8909=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x464d19[_0x33bf30(0x167)][_0x33bf30(0x12b)](_0x2c314b['parentId'],_0x2c314b[_0x33bf30(0x14b)],0x0,_0x1fc63f),{'verbose':_0x3ec630['verbose']}),_0x1271a0=_0x3e8909[_0x33bf30(0x13d)],_0x525444=_0x49a8d4=>{const _0xc64ecf=_0x33bf30;let _0x496683=0x0,_0x1828e0=0x0,_0x127214=0x0;for(const _0x27818d of _0x49a8d4){if(_0x27818d['type']==='folder')_0x496683++;else{if(_0x27818d['type']===_0xc64ecf(0x167))_0x1828e0++;else{if(_0x27818d[_0xc64ecf(0x15a)]===_0xc64ecf(0x134))_0x127214++;}}if(_0x27818d[_0xc64ecf(0x14c)]){const _0x5c0358=_0x525444(_0x27818d[_0xc64ecf(0x14c)]);_0x496683+=_0x5c0358['folders'],_0x1828e0+=_0x5c0358[_0xc64ecf(0x137)],_0x127214+=_0x5c0358[_0xc64ecf(0x151)];}}return{'folders':_0x496683,'segments':_0x1828e0,'journeys':_0x127214};},_0xf5b930=_0x525444(_0x1271a0);console[_0x33bf30(0x127)](_0x33bf30(0x13e)+_0xf5b930[_0x33bf30(0x138)]+_0x33bf30(0x14d)+(_0xf5b930[_0x33bf30(0x138)]!==0x1?'s':'')+',\x20'+_0xf5b930[_0x33bf30(0x137)]+_0x33bf30(0x157)+(_0xf5b930['segments']!==0x1?'s':'')+_0x33bf30(0x156)+_0xf5b930[_0x33bf30(0x151)]+_0x33bf30(0x14e)+(_0xf5b930['journeys']!==0x1?'s':''));const _0x31a4ba=_0x3ed482=>{const _0x1001f5=_0x33bf30;return getConsoleNextUrl(_0x3ec630[_0x1001f5(0x158)],_0x1001f5(0x146)+_0x2c314b[_0x1001f5(0x142)]+_0x1001f5(0x135)+_0x3ed482);},_0x4f9977=_0x2575f6=>{const _0x44c9cb=_0x33bf30;return getConsoleNextUrl(_0x3ec630[_0x44c9cb(0x158)],_0x44c9cb(0x146)+_0x2c314b[_0x44c9cb(0x142)]+_0x44c9cb(0x135)+_0x2575f6+_0x44c9cb(0x162));};if(_0x3ec630['format']===_0x33bf30(0x141)||_0x3ec630['format']===_0x33bf30(0x165))await handleSDKOutput(_0x1271a0,_0x3ec630);else{console['log'](a45_0x1c9c2d['dim']('['+_0x194cbe+']'));const _0x2254c3=formatTree(_0x1271a0,{'showMetadata':!![],'getSegmentUrl':_0x31a4ba,'getJourneyUrl':_0x4f9977});console['log'](_0x2254c3);}return 0x0;}}
1
+ const a45_0x218694=a45_0x1bc3;(function(_0x42ff52,_0xca87ce){const _0x2dec05=a45_0x1bc3,_0x557d19=_0x42ff52();while(!![]){try{const _0x41a22a=-parseInt(_0x2dec05(0xc9))/0x1*(parseInt(_0x2dec05(0xff))/0x2)+-parseInt(_0x2dec05(0xd2))/0x3*(-parseInt(_0x2dec05(0x102))/0x4)+-parseInt(_0x2dec05(0x116))/0x5*(-parseInt(_0x2dec05(0x10e))/0x6)+-parseInt(_0x2dec05(0xfe))/0x7*(-parseInt(_0x2dec05(0xf7))/0x8)+parseInt(_0x2dec05(0x10d))/0x9+parseInt(_0x2dec05(0x115))/0xa*(parseInt(_0x2dec05(0xde))/0xb)+parseInt(_0x2dec05(0x100))/0xc*(-parseInt(_0x2dec05(0x112))/0xd);if(_0x41a22a===_0xca87ce)break;else _0x557d19['push'](_0x557d19['shift']());}catch(_0x3a4e9a){_0x557d19['push'](_0x557d19['shift']());}}}(a45_0x5ee7,0xc9a2c));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';function a45_0x1bc3(_0x149c7a,_0x8ef1ff){_0x149c7a=_0x149c7a-0xc6;const _0x5ee747=a45_0x5ee7();let _0x1bc395=_0x5ee747[_0x149c7a];return _0x1bc395;}import a45_0x1e3920 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x218694(0xed)]='segments';[a45_0x218694(0xdb)]=a45_0x218694(0xdd);async['execute'](_0x232fc7){const _0x3eeee6=a45_0x218694,{options:_0x28678f,args:_0x31a4d7}=_0x232fc7,_0x524f04=_0x28678f[_0x3eeee6(0xf0)],_0x3545d8=_0x31a4d7[0x0];try{const _0xe8b82e=_0x28678f[_0x3eeee6(0x114)];_0x28678f[_0x3eeee6(0xef)]&&(console[_0x3eeee6(0xd8)]('Site:\x20'+_0x28678f['site']),console[_0x3eeee6(0xd8)](_0x3eeee6(0xe4)+(_0xe8b82e||_0x3eeee6(0x10b))),_0x3545d8&&console[_0x3eeee6(0xd8)]('Folder/pattern\x20arg:\x20'+_0x3545d8),_0x524f04&&console[_0x3eeee6(0xd8)]('Recursive\x20mode:\x20enabled'));if(!_0xe8b82e)return console[_0x3eeee6(0xd8)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x3eeee6(0xd8)](''),console['error'](_0x3eeee6(0xcf)),console['error'](_0x3eeee6(0x106)),console[_0x3eeee6(0xd8)](_0x3eeee6(0xe2)),console[_0x3eeee6(0xd8)](''),console[_0x3eeee6(0xd8)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x3b831f=_0x3545d8&&(_0x3545d8[_0x3eeee6(0xf8)]('*')||_0x3545d8[_0x3eeee6(0xf8)]('?'));if(_0x3b831f)return await this['listWithPattern'](_0x232fc7,_0xe8b82e,_0x3545d8);const _0x52ba11=_0x3545d8?_0xe8b82e+'/'+_0x3545d8:_0xe8b82e;return _0x524f04?await this[_0x3eeee6(0xe6)](_0x232fc7,_0x52ba11):await this['listUnified'](_0x232fc7,_0x52ba11);}catch(_0x27cb0c){if(_0x27cb0c instanceof SDKError)return console[_0x3eeee6(0xd8)](_0x3eeee6(0xfb)+_0x27cb0c[_0x3eeee6(0xf2)]),_0x27cb0c[_0x3eeee6(0xfc)]&&console[_0x3eeee6(0xd8)]('\x20\x20Cause:\x20'+_0x27cb0c[_0x3eeee6(0xfc)]),0x1;throw _0x27cb0c;}}async[a45_0x218694(0xf4)](_0x12baff,_0x96c865,_0x35600c){const _0x5d735c=a45_0x218694,{options:_0x5c7ac4,tdx:_0x415f63}=_0x12baff,_0xfefdab=await withSpinner(_0x5d735c(0xe1)+_0x96c865+_0x5d735c(0xfd),()=>_0x415f63[_0x5d735c(0xd7)][_0x5d735c(0x110)](_0x96c865),{'verbose':_0x5c7ac4[_0x5d735c(0xef)]}),_0x3bf955=_0xfefdab[_0x5d735c(0xcb)],_0x35f5dc=await withSpinner(_0x5d735c(0xd3),()=>_0x415f63[_0x5d735c(0xd7)][_0x5d735c(0xf9)](_0x3bf955[_0x5d735c(0xd6)],_0x3bf955[_0x5d735c(0xea)]),{'verbose':_0x5c7ac4[_0x5d735c(0xef)]}),{folders:_0x23e648,segments:_0x5aee8d,journeys:_0xa7fc0f}=_0x35f5dc['data'],_0x30dbf5=_0x35600c[_0x5d735c(0x108)](/[.+^${}()|[\]\\]/g,_0x5d735c(0xc8))[_0x5d735c(0x108)](/\*/g,'.*')[_0x5d735c(0x108)](/\?/g,'.'),_0x4e71a6=new RegExp('^'+_0x30dbf5+'$','i'),_0x4a085d=_0x23e648['filter'](_0x52c9c9=>_0x4e71a6['test'](_0x52c9c9[_0x5d735c(0xed)])),_0x3382e3=_0x5aee8d[_0x5d735c(0xe9)](_0x872516=>_0x4e71a6['test'](_0x872516[_0x5d735c(0xed)])),_0x5114f9=_0xa7fc0f[_0x5d735c(0xe9)](_0x2ec2ec=>_0x4e71a6[_0x5d735c(0x10c)](_0x2ec2ec[_0x5d735c(0x10f)])),_0x517f1a=_0x4a085d['length']+_0x3382e3['length']+_0x5114f9[_0x5d735c(0xce)];console[_0x5d735c(0xd8)](_0x5d735c(0x101)+_0x4a085d[_0x5d735c(0xce)]+_0x5d735c(0xeb)+(_0x4a085d[_0x5d735c(0xce)]!==0x1?'s':'')+',\x20'+_0x3382e3[_0x5d735c(0xce)]+'\x20segment'+(_0x3382e3['length']!==0x1?'s':'')+',\x20and\x20'+_0x5114f9[_0x5d735c(0xce)]+'\x20journey'+(_0x5114f9[_0x5d735c(0xce)]!==0x1?'s':'')+_0x5d735c(0xee)+_0x35600c+'\x27');const _0x4dd019=_0x43d230=>{const _0x43e255=_0x5d735c;return getConsoleNextUrl(_0x5c7ac4[_0x43e255(0xe7)],_0x43e255(0xc7)+_0x3bf955[_0x43e255(0xd6)]+_0x43e255(0xd4)+_0x43d230);},_0x150908=_0x5c7ac4[_0x5d735c(0xf6)]===_0x5d735c(0x103)||_0x5c7ac4[_0x5d735c(0xf6)]==='jsonl';if(_0x150908){const _0x34c39f=[..._0x4a085d[_0x5d735c(0xdf)](_0x5a6c81=>({..._0x5a6c81,'type':_0x5d735c(0xc6)})),..._0x3382e3['map'](_0x28d8eb=>({..._0x28d8eb,'type':_0x5d735c(0xd7),'url':_0x4dd019(_0x28d8eb['id'])})),..._0x5114f9[_0x5d735c(0xdf)](_0x11f01c=>({..._0x11f01c,'name':_0x11f01c[_0x5d735c(0x10f)],'type':'journey'}))][_0x5d735c(0xe5)]((_0x1def69,_0x4b6581)=>_0x1def69['name']['localeCompare'](_0x4b6581['name']));await handleSDKOutput(_0x34c39f,_0x5c7ac4);}else{if(_0x517f1a===0x0)console[_0x5d735c(0xd1)](_0x5d735c(0x105)+_0x35600c);else{console[_0x5d735c(0xd1)](a45_0x1e3920[_0x5d735c(0xf3)]('['+_0x96c865+_0x5d735c(0x109)+_0x35600c+'\x27'));const _0x2c5156=formatFlatList(_0x4a085d,_0x3382e3,{'showMetadata':!![],'getSegmentUrl':_0x4dd019},_0x5114f9);console['log'](_0x2c5156);}}return 0x0;}async[a45_0x218694(0x111)](_0x3c2450,_0x10b53){const _0x1fc437=a45_0x218694,{options:_0x5d1e59,tdx:_0x3963da}=_0x3c2450,_0x10d8fa=await withSpinner(_0x1fc437(0xe0)+_0x10b53+_0x1fc437(0xfd),()=>_0x3963da[_0x1fc437(0xd7)][_0x1fc437(0x110)](_0x10b53),{'verbose':_0x5d1e59[_0x1fc437(0xef)]}),_0x4746da=_0x10d8fa[_0x1fc437(0xcb)];_0x5d1e59[_0x1fc437(0xef)]&&(console[_0x1fc437(0xd8)]('Parent\x20ID:\x20'+_0x4746da[_0x1fc437(0xd6)]),_0x4746da[_0x1fc437(0xea)]&&console[_0x1fc437(0xd8)](_0x1fc437(0xe3)+_0x4746da[_0x1fc437(0xea)]));const _0x272a51=await withSpinner(_0x1fc437(0xd3),()=>_0x3963da[_0x1fc437(0xd7)][_0x1fc437(0xf9)](_0x4746da[_0x1fc437(0xd6)],_0x4746da[_0x1fc437(0xea)]),{'verbose':_0x5d1e59['verbose']}),{folders:_0x3cdd07,segments:_0x2168cf,journeys:_0x56c3b5}=_0x272a51['data'],_0x198120=_0x3cdd07['length']+_0x2168cf[_0x1fc437(0xce)]+_0x56c3b5['length'];console[_0x1fc437(0xd8)](_0x1fc437(0x101)+_0x3cdd07['length']+_0x1fc437(0xeb)+(_0x3cdd07['length']!==0x1?'s':'')+',\x20'+_0x2168cf['length']+_0x1fc437(0xec)+(_0x2168cf[_0x1fc437(0xce)]!==0x1?'s':'')+_0x1fc437(0xf1)+_0x56c3b5[_0x1fc437(0xce)]+_0x1fc437(0xda)+(_0x56c3b5['length']!==0x1?'s':''));const _0x4c8b0f=_0x569373=>{const _0x2b695c=_0x1fc437;return getConsoleNextUrl(_0x5d1e59[_0x2b695c(0xe7)],_0x2b695c(0xc7)+_0x4746da[_0x2b695c(0xd6)]+'/e/'+_0x569373);},_0x45c3ac=_0x577d14=>{const _0x5c63a3=_0x1fc437;return getConsoleNextUrl(_0x5d1e59[_0x5c63a3(0xe7)],_0x5c63a3(0xc7)+_0x4746da['parentId']+_0x5c63a3(0xd4)+_0x577d14+'/j/da');},_0x2147e6=_0x5d1e59[_0x1fc437(0xf6)]===_0x1fc437(0x103)||_0x5d1e59[_0x1fc437(0xf6)]==='jsonl';if(_0x2147e6){const _0x10cc51=[..._0x3cdd07[_0x1fc437(0xdf)](_0x1d5dd3=>({..._0x1d5dd3,'type':_0x1fc437(0xc6)})),..._0x2168cf['map'](_0x3579d5=>({..._0x3579d5,'type':'segment','url':_0x4c8b0f(_0x3579d5['id'])})),..._0x56c3b5[_0x1fc437(0xdf)](_0x595901=>({..._0x595901,'name':_0x595901['journeyBundleName'],'type':_0x1fc437(0xd0),'url':_0x45c3ac(_0x595901['id'])}))][_0x1fc437(0xe5)]((_0x50cfe5,_0x2afa41)=>_0x50cfe5[_0x1fc437(0xed)][_0x1fc437(0xd9)](_0x2afa41['name']));await handleSDKOutput(_0x10cc51,_0x5d1e59);}else{if(_0x198120===0x0)console[_0x1fc437(0xd1)](a45_0x1e3920[_0x1fc437(0xf3)]('['+_0x10b53+']')),console[_0x1fc437(0xd1)](_0x1fc437(0xe8));else{console[_0x1fc437(0xd1)](a45_0x1e3920['dim']('['+_0x10b53+']'));const _0x5c8be8=formatFlatList(_0x3cdd07,_0x2168cf,{'showMetadata':!![],'getSegmentUrl':_0x4c8b0f,'getJourneyUrl':_0x45c3ac},_0x56c3b5);console[_0x1fc437(0xd1)](_0x5c8be8);}}return 0x0;}async[a45_0x218694(0xe6)](_0xe91f1e,_0x33f254){const _0x46e011=a45_0x218694,{options:_0x34fdff,tdx:_0x553c33}=_0xe91f1e,_0x2e4f36=await withSpinner('Resolving\x20path\x20\x27'+_0x33f254+_0x46e011(0xfd),()=>_0x553c33[_0x46e011(0xd7)][_0x46e011(0x110)](_0x33f254),{'verbose':_0x34fdff[_0x46e011(0xef)]}),_0x4792e9=_0x2e4f36['data'];_0x34fdff[_0x46e011(0xef)]&&(console[_0x46e011(0xd8)](_0x46e011(0xf5)+_0x4792e9[_0x46e011(0xd6)]),_0x4792e9[_0x46e011(0xea)]&&console[_0x46e011(0xd8)](_0x46e011(0xe3)+_0x4792e9[_0x46e011(0xea)]));const _0x4ef951=_0x34fdff[_0x46e011(0xfa)]||0xa,_0x2f3b83=await withSpinner(_0x46e011(0x107),()=>_0x553c33[_0x46e011(0xd7)][_0x46e011(0xe6)](_0x4792e9[_0x46e011(0xd6)],_0x4792e9[_0x46e011(0xea)],0x0,_0x4ef951),{'verbose':_0x34fdff[_0x46e011(0xef)]}),_0x5d1646=_0x2f3b83[_0x46e011(0xcb)],_0x15ecae=_0x2185ea=>{const _0x3ffa3c=_0x46e011;let _0x9cbcca=0x0,_0x2337a4=0x0,_0x5c9393=0x0;for(const _0x3dfe3b of _0x2185ea){if(_0x3dfe3b[_0x3ffa3c(0xcc)]===_0x3ffa3c(0xc6))_0x9cbcca++;else{if(_0x3dfe3b[_0x3ffa3c(0xcc)]===_0x3ffa3c(0xd7))_0x2337a4++;else{if(_0x3dfe3b[_0x3ffa3c(0xcc)]===_0x3ffa3c(0xd0))_0x5c9393++;}}if(_0x3dfe3b[_0x3ffa3c(0xca)]){const _0x160e43=_0x15ecae(_0x3dfe3b[_0x3ffa3c(0xca)]);_0x9cbcca+=_0x160e43['folders'],_0x2337a4+=_0x160e43['segments'],_0x5c9393+=_0x160e43['journeys'];}}return{'folders':_0x9cbcca,'segments':_0x2337a4,'journeys':_0x5c9393};},_0x553177=_0x15ecae(_0x5d1646);console[_0x46e011(0xd8)](_0x46e011(0x104)+_0x553177[_0x46e011(0x10a)]+_0x46e011(0xeb)+(_0x553177['folders']!==0x1?'s':'')+',\x20'+_0x553177[_0x46e011(0xcd)]+_0x46e011(0xec)+(_0x553177[_0x46e011(0xcd)]!==0x1?'s':'')+_0x46e011(0xf1)+_0x553177[_0x46e011(0x113)]+_0x46e011(0xda)+(_0x553177[_0x46e011(0x113)]!==0x1?'s':''));const _0x7bb3ab=_0x486a93=>{const _0x50553b=_0x46e011;return getConsoleNextUrl(_0x34fdff[_0x50553b(0xe7)],'/app/ps/'+_0x4792e9[_0x50553b(0xd6)]+'/e/'+_0x486a93);},_0x57f5cb=_0x5385da=>{const _0x33ff9b=_0x46e011;return getConsoleNextUrl(_0x34fdff['site'],_0x33ff9b(0xc7)+_0x4792e9[_0x33ff9b(0xd6)]+_0x33ff9b(0xd4)+_0x5385da+_0x33ff9b(0xdc));};if(_0x34fdff[_0x46e011(0xf6)]===_0x46e011(0x103)||_0x34fdff[_0x46e011(0xf6)]===_0x46e011(0xd5))await handleSDKOutput(_0x5d1646,_0x34fdff);else{console[_0x46e011(0xd1)](a45_0x1e3920['dim']('['+_0x33f254+']'));const _0x5ae64c=formatTree(_0x5d1646,{'showMetadata':!![],'getSegmentUrl':_0x7bb3ab,'getJourneyUrl':_0x57f5cb});console[_0x46e011(0xd1)](_0x5ae64c);}return 0x0;}}function a45_0x5ee7(){const _0x2697fc=['test','6579963fwmtKY','6RMDJYx','journeyBundleName','resolvePathToResource','listUnified','26PZNkBj','journeys','parentSegment','3980370veqOTn','433645cVhyeN','folder','/app/ps/','\x5c$&','682738hMFurA','children','data','type','segments','length','Set\x20a\x20parent\x20segment\x20context\x20first:','journey','log','6VPPWOk','Listing\x20folders,\x20segments,\x20and\x20journeys...','/e/','jsonl','parentId','segment','error','localeCompare','\x20journey','description','/j/da','List\x20folders\x20and\x20child\x20segments','11BkAmtX','map','Resolving\x20path\x20\x27','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Folder\x20ID:\x20','Parent\x20segment\x20context:\x20','sort','listRecursive','site','(empty)','filter','folderId','\x20folder','\x20segment','name','\x20matching\x20\x27','verbose','recursive',',\x20and\x20','message','dim','listWithPattern','Parent\x20ID:\x20','format','108904hXvjXK','includes','listUnifiedWithJourneys','maxDepth','Error:\x20','cause','\x27...','301PePCcH','2WjayzK','2037744zGfNsR','✔\x20Found\x20','94060SGlnhC','json','✔\x20Built\x20tree\x20with\x20','No\x20items\x20match\x20pattern:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Building\x20hierarchy\x20tree...','replace',']\x20matching\x20\x27','folders','(not\x20set)'];a45_0x5ee7=function(){return _0x2697fc;};return a45_0x5ee7();}
@@ -1 +1 @@
1
- const a46_0x3943e0=a46_0x13b6;function a46_0x779e(){const _0x349252=['Catalog:\x20','table','Site:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','10427394xMsfsD','10014697WXUfsJ','28007712aLBhTR','site','description','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','database','length','3EEgKqn','Limit:\x20','235llcvgH','11639728kxahTy','query','args','1759045cvRQSc','Database:\x20','name','error','showTable','59094funDfd','\x20from\x20','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','data','execute','Querying\x20','catalog','message','cause','Table:\x20','39344pUNimw','show','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','Error:\x20'];a46_0x779e=function(){return _0x349252;};return a46_0x779e();}(function(_0x3b629c,_0x40c3b9){const _0xa9782a=a46_0x13b6,_0x4974b8=_0x3b629c();while(!![]){try{const _0xaba4fd=parseInt(_0xa9782a(0x144))/0x1+-parseInt(_0xa9782a(0x149))/0x2*(-parseInt(_0xa9782a(0x13e))/0x3)+-parseInt(_0xa9782a(0x12d))/0x4*(-parseInt(_0xa9782a(0x140))/0x5)+parseInt(_0xa9782a(0x136))/0x6+-parseInt(_0xa9782a(0x137))/0x7+parseInt(_0xa9782a(0x141))/0x8+-parseInt(_0xa9782a(0x138))/0x9;if(_0xaba4fd===_0x40c3b9)break;else _0x4974b8['push'](_0x4974b8['shift']());}catch(_0x5b3ec9){_0x4974b8['push'](_0x4974b8['shift']());}}}(a46_0x779e,0xdbff6));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_0x13b6(_0x495893,_0x4f2532){_0x495893=_0x495893-0x125;const _0x779e47=a46_0x779e();let _0x13b664=_0x779e47[_0x495893];return _0x13b664;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x3943e0(0x146)]=a46_0x3943e0(0x12e);[a46_0x3943e0(0x13a)]='Show\x20table\x20contents';async[a46_0x3943e0(0x127)](_0x3755d7){return this['showTable'](_0x3755d7);}async[a46_0x3943e0(0x148)](_0x5e5088){const _0x84a550=a46_0x3943e0,{options:_0x5c60eb,args:_0x4ec4d6,tdx:_0x1aefe7}=_0x5e5088;let _0x1ecb88;try{_0x1ecb88=parseTableReference(_0x4ec4d6[0x0]);const _0x22e206=_0x5c60eb['database'];!_0x1ecb88['database']&&_0x22e206&&(_0x1ecb88['database']=_0x22e206);const _0x50a433=validateTableDescribeReference(_0x1ecb88);if(_0x50a433)return console[_0x84a550(0x147)]('Error:\x20'+_0x50a433),console[_0x84a550(0x147)](_0x84a550(0x14b)),console[_0x84a550(0x147)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x84a550(0x147)](_0x84a550(0x125)),0x1;}catch(_0x50ee5e){return console[_0x84a550(0x147)](_0x84a550(0x131)+_0x50ee5e['message']),console[_0x84a550(0x147)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x84a550(0x147)](_0x84a550(0x12f)),console[_0x84a550(0x147)](_0x84a550(0x125)),0x1;}const _0x5f175f=_0x1ecb88[_0x84a550(0x129)],_0x27b71f=_0x1ecb88[_0x84a550(0x13c)],_0x30fce4=_0x1ecb88[_0x84a550(0x133)],_0x503c35=resolveLimit(_0x5c60eb['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x5c60eb['verbose']&&(console[_0x84a550(0x147)](_0x84a550(0x134)+_0x5c60eb[_0x84a550(0x139)]),_0x5f175f&&console[_0x84a550(0x147)](_0x84a550(0x132)+_0x5f175f),console[_0x84a550(0x147)](_0x84a550(0x145)+_0x27b71f),console['error'](_0x84a550(0x12c)+_0x30fce4),console['error'](_0x84a550(0x13f)+_0x503c35));const _0xf4bb7a=_0x5f175f?_0x5f175f+'.'+_0x27b71f+'.'+_0x30fce4:_0x27b71f+'.'+_0x30fce4,_0x3b25e9=await withSpinner(_0x84a550(0x128)+_0xf4bb7a+'...',()=>_0x1aefe7[_0x84a550(0x142)]['showTable'](_0x27b71f,_0x30fce4,_0x503c35,_0x5f175f),{'verbose':_0x5c60eb[_0x84a550(0x130)]}),_0x3abe12=_0x3b25e9[_0x84a550(0x126)],_0x52000a=_0x3abe12[_0x84a550(0x126)];return _0x52000a[_0x84a550(0x13d)]===0x0?console['error'](_0x84a550(0x135)):console[_0x84a550(0x147)]('✔\x20Retrieved\x20'+_0x52000a[_0x84a550(0x13d)]+'\x20row'+(_0x52000a['length']!==0x1?'s':'')+_0x84a550(0x14a)+_0xf4bb7a),await handleSDKOutput(_0x52000a,_0x5c60eb),0x0;}catch(_0x249b8d){if(_0x249b8d instanceof SDKError)return console[_0x84a550(0x147)](_0x84a550(0x131)+_0x249b8d[_0x84a550(0x12a)]),_0x249b8d['cause']&&console[_0x84a550(0x147)]('\x20\x20Cause:\x20'+_0x249b8d[_0x84a550(0x12b)]),0x1;throw _0x249b8d;}}['validate'](_0x2ec778){const _0x5d7e4b=a46_0x3943e0;if(_0x2ec778[_0x5d7e4b(0x143)][_0x5d7e4b(0x13d)]===0x0)return _0x5d7e4b(0x13b);if(_0x2ec778[_0x5d7e4b(0x143)][_0x5d7e4b(0x13d)]>0x1)return'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';return undefined;}}
1
+ const a46_0x4d6c79=a46_0x35ac;(function(_0x546adc,_0x4ba572){const _0xe4f39d=a46_0x35ac,_0x229355=_0x546adc();while(!![]){try{const _0x338eec=-parseInt(_0xe4f39d(0x1b8))/0x1*(-parseInt(_0xe4f39d(0x1ad))/0x2)+parseInt(_0xe4f39d(0x1b6))/0x3+parseInt(_0xe4f39d(0x1c8))/0x4*(parseInt(_0xe4f39d(0x1b2))/0x5)+parseInt(_0xe4f39d(0x1b4))/0x6*(parseInt(_0xe4f39d(0x1af))/0x7)+parseInt(_0xe4f39d(0x1bc))/0x8*(-parseInt(_0xe4f39d(0x1c0))/0x9)+-parseInt(_0xe4f39d(0x1ce))/0xa*(-parseInt(_0xe4f39d(0x1c1))/0xb)+-parseInt(_0xe4f39d(0x1cf))/0xc*(parseInt(_0xe4f39d(0x1c7))/0xd);if(_0x338eec===_0x4ba572)break;else _0x229355['push'](_0x229355['shift']());}catch(_0x4ee061){_0x229355['push'](_0x229355['shift']());}}}(a46_0x45c5,0xe9f02));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a46_0x35ac(_0xf89939,_0x471a07){_0xf89939=_0xf89939-0x1ab;const _0x45c50b=a46_0x45c5();let _0x35acaa=_0x45c50b[_0xf89939];return _0x35acaa;}import{handleSDKOutput}from'../core/command-output.js';function a46_0x45c5(){const _0x19153a=['Querying\x20','430yYxBli','4003380LgmfOu','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','...','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','name','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','args','\x20\x20Cause:\x20','2WjRuPC','Limit:\x20','6254031eJUbWO','catalog','database','95mgILpa','cause','12InEHhD','Site:\x20','4207548KGsuyQ','site','193433GQteWw','error','showTable','description','1226248WfIiQv','show','execute','verbose','45cBDUFs','33PNFjyO','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','table','length','data','validate','104rVKIfJ','212756stMpRL','✔\x20Retrieved\x20','\x20row','Error:\x20','Show\x20table\x20contents'];a46_0x45c5=function(){return _0x19153a;};return a46_0x45c5();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x4d6c79(0x1d3)]=a46_0x4d6c79(0x1bd);[a46_0x4d6c79(0x1bb)]=a46_0x4d6c79(0x1cc);async[a46_0x4d6c79(0x1be)](_0x3defb3){return this['showTable'](_0x3defb3);}async[a46_0x4d6c79(0x1ba)](_0x4ecba1){const _0x3546fc=a46_0x4d6c79,{options:_0x4e6b01,args:_0x3f28d3,tdx:_0x4c1c51}=_0x4ecba1;let _0x4b4533;try{_0x4b4533=parseTableReference(_0x3f28d3[0x0]);const _0x5d1ed2=_0x4e6b01[_0x3546fc(0x1b1)];!_0x4b4533[_0x3546fc(0x1b1)]&&_0x5d1ed2&&(_0x4b4533[_0x3546fc(0x1b1)]=_0x5d1ed2);const _0xab54ae=validateTableDescribeReference(_0x4b4533);if(_0xab54ae)return console[_0x3546fc(0x1b9)](_0x3546fc(0x1cb)+_0xab54ae),console[_0x3546fc(0x1b9)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x3546fc(0x1b9)](_0x3546fc(0x1d0)),console['error']('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x577f02){return console['error'](_0x3546fc(0x1cb)+_0x577f02['message']),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x3546fc(0x1b9)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x3546fc(0x1b9)](_0x3546fc(0x1d4)),0x1;}const _0x147750=_0x4b4533[_0x3546fc(0x1b0)],_0x7e56a4=_0x4b4533['database'],_0xd56159=_0x4b4533[_0x3546fc(0x1c3)],_0x5540d4=resolveLimit(_0x4e6b01['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x4e6b01[_0x3546fc(0x1bf)]&&(console['error'](_0x3546fc(0x1b5)+_0x4e6b01[_0x3546fc(0x1b7)]),_0x147750&&console[_0x3546fc(0x1b9)]('Catalog:\x20'+_0x147750),console['error']('Database:\x20'+_0x7e56a4),console[_0x3546fc(0x1b9)]('Table:\x20'+_0xd56159),console[_0x3546fc(0x1b9)](_0x3546fc(0x1ae)+_0x5540d4));const _0x33e829=_0x147750?_0x147750+'.'+_0x7e56a4+'.'+_0xd56159:_0x7e56a4+'.'+_0xd56159,_0x33a630=await withSpinner(_0x3546fc(0x1cd)+_0x33e829+_0x3546fc(0x1d1),()=>_0x4c1c51['query'][_0x3546fc(0x1ba)](_0x7e56a4,_0xd56159,_0x5540d4,_0x147750),{'verbose':_0x4e6b01[_0x3546fc(0x1bf)]}),_0x58b1e9=_0x33a630['data'],_0x5b0523=_0x58b1e9[_0x3546fc(0x1c5)];return _0x5b0523[_0x3546fc(0x1c4)]===0x0?console['error'](_0x3546fc(0x1d2)):console[_0x3546fc(0x1b9)](_0x3546fc(0x1c9)+_0x5b0523[_0x3546fc(0x1c4)]+_0x3546fc(0x1ca)+(_0x5b0523[_0x3546fc(0x1c4)]!==0x1?'s':'')+'\x20from\x20'+_0x33e829),await handleSDKOutput(_0x5b0523,_0x4e6b01),0x0;}catch(_0xb726cc){if(_0xb726cc instanceof SDKError)return console[_0x3546fc(0x1b9)](_0x3546fc(0x1cb)+_0xb726cc['message']),_0xb726cc[_0x3546fc(0x1b3)]&&console[_0x3546fc(0x1b9)](_0x3546fc(0x1ac)+_0xb726cc[_0x3546fc(0x1b3)]),0x1;throw _0xb726cc;}}[a46_0x4d6c79(0x1c6)](_0x16b625){const _0x2d5336=a46_0x4d6c79;if(_0x16b625['args'][_0x2d5336(0x1c4)]===0x0)return _0x2d5336(0x1c2);if(_0x16b625[_0x2d5336(0x1ab)][_0x2d5336(0x1c4)]>0x1)return'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';return undefined;}}
@@ -1 +1 @@
1
- const a47_0x1c674f=a47_0xeddf;(function(_0x29f15a,_0x249ea5){const _0x30d6bd=a47_0xeddf,_0x55e0ea=_0x29f15a();while(!![]){try{const _0x1c8d45=parseInt(_0x30d6bd(0x1ac))/0x1*(-parseInt(_0x30d6bd(0x193))/0x2)+parseInt(_0x30d6bd(0x1ab))/0x3*(-parseInt(_0x30d6bd(0x1a2))/0x4)+-parseInt(_0x30d6bd(0x1b2))/0x5+parseInt(_0x30d6bd(0x189))/0x6+parseInt(_0x30d6bd(0x198))/0x7+-parseInt(_0x30d6bd(0x18c))/0x8*(-parseInt(_0x30d6bd(0x1a8))/0x9)+parseInt(_0x30d6bd(0x19b))/0xa*(parseInt(_0x30d6bd(0x18d))/0xb);if(_0x1c8d45===_0x249ea5)break;else _0x55e0ea['push'](_0x55e0ea['shift']());}catch(_0x1fbe94){_0x55e0ea['push'](_0x55e0ea['shift']());}}}(a47_0x3c02,0x5052f));import{BaseCommand,printAuthError}from'./command.js';function a47_0x3c02(){const _0x531eaa=['TDX_PROFILE\x20env','(from\x20','jobs','1081590BCjQIl','Account\x20ID:','getUserInfo','name','filter','764058GAhxhV','message','✗\x20Validation\x20failed:\x20','344DCbiTP','5434iBJLtD','No\x20credential\x20found','description','env','N/A','config','14QnERvt','Credential\x20type:\x20','execute','last_name','CLI\x20flag','2001328dVLxtM','status','red','11240THosCE','site','log','bold','\x20profile:\x20','Name:','error','4WNqsab','account_id','session','cyan','dim','Show\x20authentication\x20status\x20and\x20current\x20context','24525AOpVKE','join','Read\x20credential\x20from\x20','1559487sCSIPe','2932HdsvFP','tdx','yellow'];a47_0x3c02=function(){return _0x531eaa;};return a47_0x3c02();}import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0xeddf(_0xdf4c85,_0x1e5c57){_0xdf4c85=_0xdf4c85-0x186;const _0x3c0216=a47_0x3c02();let _0xeddfba=_0x3c0216[_0xdf4c85];return _0xeddfba;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x19f4db from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1c674f(0x187)]='status';[a47_0x1c674f(0x18f)]=a47_0x1c674f(0x1a7);async[a47_0x1c674f(0x195)](_0x1f2b55){const _0xb4daea=a47_0x1c674f,{options:_0x36af6b,tdx:_0x18b965}=_0x1f2b55,_0x28f5e3=_0x36af6b[_0xb4daea(0x19c)],_0x113b7a=new GlobalContext(_0x36af6b),_0x3a5366=_0x113b7a['profile'],_0xbe41b6=_0x113b7a['profileSource'],_0x27a386=_0xbe41b6==='cli'?_0xb4daea(0x197):_0xbe41b6===_0xb4daea(0x1a4)?_0xb4daea(0x1a4):_0xbe41b6===_0xb4daea(0x190)?_0xb4daea(0x1af):_0xbe41b6==='config'?_0xb4daea(0x192):null,_0x398f1d=_0x3a5366?a47_0x19f4db[_0xb4daea(0x1a5)](_0x3a5366):a47_0x19f4db[_0xb4daea(0x1a6)](_0xb4daea(0x191)),_0x1cb33b=_0x27a386?'\x20'+a47_0x19f4db[_0xb4daea(0x1a6)](_0xb4daea(0x1b0)+_0x27a386+')'):'';console[_0xb4daea(0x19d)](a47_0x19f4db[_0xb4daea(0x19e)](_0xb4daea(0x1ad))+_0xb4daea(0x19f)+_0x398f1d+_0x1cb33b+'\x20'+a47_0x19f4db['dim']('(')+'site:\x20'+a47_0x19f4db[_0xb4daea(0x1a5)](_0x28f5e3)+a47_0x19f4db[_0xb4daea(0x1a6)](')'));const _0xafef9d=await getOAuthTokens(_0x3a5366);if(_0xafef9d)console[_0xb4daea(0x19d)](_0xb4daea(0x194)+a47_0x19f4db['cyan']('OAuth'));else{const _0x50faaa=await resolveAPIKeyAsync(_0x28f5e3,_0x3a5366);if(_0x50faaa){const {source:_0xfaf8d7,isDeprecated:_0x2e7954}=_0x50faaa,_0x217fca=_0xb4daea(0x1aa)+a47_0x19f4db[_0xb4daea(0x1a5)](_0xfaf8d7);console[_0xb4daea(0x19d)](_0x2e7954?a47_0x19f4db[_0xb4daea(0x1ae)](_0x217fca):_0x217fca);}else console[_0xb4daea(0x19d)](a47_0x19f4db['yellow'](_0xb4daea(0x18e)));}let _0xe76d0b=![];try{const _0x28d89f=await _0x18b965[_0xb4daea(0x1b1)][_0xb4daea(0x186)]();console[_0xb4daea(0x19d)](a47_0x19f4db['green']('✓\x20Authentication\x20successful\x0a')),console[_0xb4daea(0x19d)](a47_0x19f4db[_0xb4daea(0x19e)]('User:')+'\x20'+a47_0x19f4db[_0xb4daea(0x1a5)](_0x28d89f['email']));if(_0x28d89f['first_name']||_0x28d89f[_0xb4daea(0x196)]){const _0x4e74ac=[_0x28d89f['first_name'],_0x28d89f['last_name']][_0xb4daea(0x188)](Boolean)[_0xb4daea(0x1a9)]('\x20');console[_0xb4daea(0x19d)](a47_0x19f4db['bold'](_0xb4daea(0x1a0))+'\x20'+_0x4e74ac);}_0x28d89f[_0xb4daea(0x1a3)]&&console[_0xb4daea(0x19d)](a47_0x19f4db[_0xb4daea(0x19e)](_0xb4daea(0x1b3))+'\x20'+a47_0x19f4db[_0xb4daea(0x1ae)](_0x28d89f['account_id'])),_0xe76d0b=!![];}catch(_0x5a3a6d){_0x5a3a6d instanceof HTTPClientError&&_0x5a3a6d[_0xb4daea(0x199)]===0x191?printAuthError(_0x5a3a6d,!![],_0x3a5366):console[_0xb4daea(0x1a1)](a47_0x19f4db[_0xb4daea(0x19a)](_0xb4daea(0x18b)+(_0x5a3a6d instanceof Error?_0x5a3a6d[_0xb4daea(0x18a)]:String(_0x5a3a6d))));}return console[_0xb4daea(0x19d)](),_0x113b7a['displayWithSources'](),_0xe76d0b?0x0:0x1;}}
1
+ const a47_0x1f4a61=a47_0x17c4;(function(_0xf55d3a,_0x1be812){const _0x27aeda=a47_0x17c4,_0x4195af=_0xf55d3a();while(!![]){try{const _0x480090=-parseInt(_0x27aeda(0x132))/0x1+parseInt(_0x27aeda(0x10a))/0x2+parseInt(_0x27aeda(0x112))/0x3*(-parseInt(_0x27aeda(0x135))/0x4)+parseInt(_0x27aeda(0x10c))/0x5*(parseInt(_0x27aeda(0x10d))/0x6)+-parseInt(_0x27aeda(0x136))/0x7*(-parseInt(_0x27aeda(0x12b))/0x8)+parseInt(_0x27aeda(0x11c))/0x9+parseInt(_0x27aeda(0x116))/0xa*(-parseInt(_0x27aeda(0x123))/0xb);if(_0x480090===_0x1be812)break;else _0x4195af['push'](_0x4195af['shift']());}catch(_0x462691){_0x4195af['push'](_0x4195af['shift']());}}}(a47_0x2b90,0x32de7));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0x2b90(){const _0x47576b=['22ltmrmH','config','profileSource','log','Credential\x20type:\x20','cyan','N/A','message','183944ohsavu','email','last_name','profile','first_name','status','description','347696ZvDomZ','\x20profile:\x20','TDX_PROFILE\x20env','402124PXiuuj','126GKXlRQ','OAuth','env','join','bold','dim','execute','112178ZmfnBA','No\x20credential\x20found','1858030KMcsAo','6hteYAI','account_id','yellow','Read\x20credential\x20from\x20','tdx','6PaWifF','✓\x20Authentication\x20successful\x0a','site','displayWithSources','698450KtxlHE','Name:','site:\x20','CLI\x20flag','name','session','497142NhlMGO','jobs','cli','getUserInfo','✗\x20Validation\x20failed:\x20','Account\x20ID:','green'];a47_0x2b90=function(){return _0x47576b;};return a47_0x2b90();}function a47_0x17c4(_0x3e92ac,_0x58dfcb){_0x3e92ac=_0x3e92ac-0x108;const _0x2b9044=a47_0x2b90();let _0x17c4b2=_0x2b9044[_0x3e92ac];return _0x17c4b2;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x271dd9 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1f4a61(0x11a)]=a47_0x1f4a61(0x130);[a47_0x1f4a61(0x131)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a47_0x1f4a61(0x109)](_0x1c815c){const _0x5c2e24=a47_0x1f4a61,{options:_0x4fd0ef,tdx:_0x39b866}=_0x1c815c,_0x32c8e8=_0x4fd0ef[_0x5c2e24(0x114)],_0x15d694=new GlobalContext(_0x4fd0ef),_0xc94f5e=_0x15d694[_0x5c2e24(0x12e)],_0x293355=_0x15d694[_0x5c2e24(0x125)],_0x26f4e5=_0x293355===_0x5c2e24(0x11e)?_0x5c2e24(0x119):_0x293355==='session'?_0x5c2e24(0x11b):_0x293355===_0x5c2e24(0x138)?_0x5c2e24(0x134):_0x293355==='config'?_0x5c2e24(0x124):null,_0x1b95db=_0xc94f5e?a47_0x271dd9[_0x5c2e24(0x128)](_0xc94f5e):a47_0x271dd9[_0x5c2e24(0x108)](_0x5c2e24(0x129)),_0x15f95c=_0x26f4e5?'\x20'+a47_0x271dd9[_0x5c2e24(0x108)]('(from\x20'+_0x26f4e5+')'):'';console['log'](a47_0x271dd9[_0x5c2e24(0x13a)](_0x5c2e24(0x111))+_0x5c2e24(0x133)+_0x1b95db+_0x15f95c+'\x20'+a47_0x271dd9['dim']('(')+_0x5c2e24(0x118)+a47_0x271dd9['cyan'](_0x32c8e8)+a47_0x271dd9['dim'](')'));const _0x166695=await getOAuthTokens(_0xc94f5e);if(_0x166695)console['log'](_0x5c2e24(0x127)+a47_0x271dd9[_0x5c2e24(0x128)](_0x5c2e24(0x137)));else{const _0x54921d=await resolveAPIKeyAsync(_0x32c8e8,_0xc94f5e);if(_0x54921d){const {source:_0x16a4c3,isDeprecated:_0x4c7cb3}=_0x54921d,_0x3ed083=_0x5c2e24(0x110)+a47_0x271dd9[_0x5c2e24(0x128)](_0x16a4c3);console['log'](_0x4c7cb3?a47_0x271dd9[_0x5c2e24(0x10f)](_0x3ed083):_0x3ed083);}else console[_0x5c2e24(0x126)](a47_0x271dd9[_0x5c2e24(0x10f)](_0x5c2e24(0x10b)));}let _0x2a4f0f=![];try{const _0x422d41=await _0x39b866[_0x5c2e24(0x11d)][_0x5c2e24(0x11f)]();console['log'](a47_0x271dd9[_0x5c2e24(0x122)](_0x5c2e24(0x113))),console[_0x5c2e24(0x126)](a47_0x271dd9[_0x5c2e24(0x13a)]('User:')+'\x20'+a47_0x271dd9[_0x5c2e24(0x128)](_0x422d41[_0x5c2e24(0x12c)]));if(_0x422d41[_0x5c2e24(0x12f)]||_0x422d41[_0x5c2e24(0x12d)]){const _0x38cd29=[_0x422d41[_0x5c2e24(0x12f)],_0x422d41[_0x5c2e24(0x12d)]]['filter'](Boolean)[_0x5c2e24(0x139)]('\x20');console[_0x5c2e24(0x126)](a47_0x271dd9['bold'](_0x5c2e24(0x117))+'\x20'+_0x38cd29);}_0x422d41['account_id']&&console[_0x5c2e24(0x126)](a47_0x271dd9[_0x5c2e24(0x13a)](_0x5c2e24(0x121))+'\x20'+a47_0x271dd9[_0x5c2e24(0x10f)](_0x422d41[_0x5c2e24(0x10e)])),_0x2a4f0f=!![];}catch(_0x81e400){_0x81e400 instanceof HTTPClientError&&_0x81e400['status']===0x191?printAuthError(_0x81e400,!![],_0xc94f5e):console['error'](a47_0x271dd9['red'](_0x5c2e24(0x120)+(_0x81e400 instanceof Error?_0x81e400[_0x5c2e24(0x12a)]:String(_0x81e400))));}return console[_0x5c2e24(0x126)](),_0x15d694[_0x5c2e24(0x115)](),_0x2a4f0f?0x0:0x1;}}