@treasuredata/tdx 2026.4.9 → 2026.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  96. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  97. package/dist/sdk/cas/index.js +1 -1
  98. package/dist/sdk/cas/pull-workflow.js +1 -1
  99. package/dist/sdk/cas/push-workflow.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.js +1 -1
  105. package/dist/sdk/client/llm-api-client.js +1 -1
  106. package/dist/sdk/client/oauth-refresh.js +1 -1
  107. package/dist/sdk/client/rate-limiter.js +1 -1
  108. package/dist/sdk/client/td-api-client.js +1 -1
  109. package/dist/sdk/client/trino-api-client.js +1 -1
  110. package/dist/sdk/client/workflow-client.js +1 -1
  111. package/dist/sdk/connection-validator.js +1 -1
  112. package/dist/sdk/connection.js +1 -1
  113. package/dist/sdk/delivery.js +1 -1
  114. package/dist/sdk/engage/campaign-pull.js +1 -1
  115. package/dist/sdk/engage/campaign-push.js +1 -1
  116. package/dist/sdk/engage/campaign-validator.js +1 -1
  117. package/dist/sdk/engage/campaign-yaml.js +1 -1
  118. package/dist/sdk/engage/template-pull.js +1 -1
  119. package/dist/sdk/engage/template-push.js +1 -1
  120. package/dist/sdk/engage/template-validator.js +1 -1
  121. package/dist/sdk/engage/template-yaml.js +1 -1
  122. package/dist/sdk/engage/types/campaign-def.js +1 -1
  123. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  124. package/dist/sdk/engage/types/template-schema.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.js +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/io/index.js +1 -1
  129. package/dist/sdk/io/node-filesystem.js +1 -1
  130. package/dist/sdk/job.js +1 -1
  131. package/dist/sdk/journey.js +1 -1
  132. package/dist/sdk/llm/chat-cache.js +1 -1
  133. package/dist/sdk/llm/index.js +1 -1
  134. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  135. package/dist/sdk/llm/model-factors.js +1 -1
  136. package/dist/sdk/personalization.js +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/index.js +1 -1
  139. package/dist/sdk/query/sql-parser.js +1 -1
  140. package/dist/sdk/realtime.js +1 -1
  141. package/dist/sdk/schedule.js +1 -1
  142. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  143. package/dist/sdk/segment/fields-display.js +1 -1
  144. package/dist/sdk/segment/file-discovery.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  149. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/pull-workflow.js +1 -1
  151. package/dist/sdk/segment/push-recovery.js +1 -1
  152. package/dist/sdk/segment/push-workflow.js +1 -1
  153. package/dist/sdk/segment/resolution-context.js +1 -1
  154. package/dist/sdk/segment/segment-path-parser.js +1 -1
  155. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  156. package/dist/sdk/segment/segment-validator.js +1 -1
  157. package/dist/sdk/segment/target-resolution.js +1 -1
  158. package/dist/sdk/segment/tdx-config.js +1 -1
  159. package/dist/sdk/segment/types/activation-schema.js +1 -1
  160. package/dist/sdk/segment/types/journey-def.js +1 -1
  161. package/dist/sdk/segment/types/journey-schema.js +1 -1
  162. package/dist/sdk/segment/types/segment-def.js +1 -1
  163. package/dist/sdk/segment/types/segment-schema.js +1 -1
  164. package/dist/sdk/segment/validate-files.js +1 -1
  165. package/dist/sdk/segment/yaml-validator.js +1 -1
  166. package/dist/sdk/segment.js +1 -1
  167. package/dist/sdk/types/index.js +1 -1
  168. package/dist/sdk/types/progress.js +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/sdk/workspace/access-tracker.js +1 -1
  184. package/dist/sdk/workspace/frontmatter.js +1 -1
  185. package/dist/sdk/workspace/git.d.ts +52 -0
  186. package/dist/sdk/workspace/git.d.ts.map +1 -1
  187. package/dist/sdk/workspace/git.js +1 -1
  188. package/dist/sdk/workspace/git.js.map +1 -1
  189. package/dist/sdk/workspace/index.d.ts +14 -0
  190. package/dist/sdk/workspace/index.d.ts.map +1 -1
  191. package/dist/sdk/workspace/index.js +1 -1
  192. package/dist/sdk/workspace/index.js.map +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +2 -1
@@ -1 +1 @@
1
- const a39_0x4d4f68=a39_0x173f;(function(_0xf5788,_0x895dc0){const _0x276c68=a39_0x173f,_0x2e6270=_0xf5788();while(!![]){try{const _0x279f36=parseInt(_0x276c68(0x1c9))/0x1+-parseInt(_0x276c68(0x1b6))/0x2+-parseInt(_0x276c68(0x1ca))/0x3*(-parseInt(_0x276c68(0x1bd))/0x4)+-parseInt(_0x276c68(0x1c5))/0x5+parseInt(_0x276c68(0x1c6))/0x6*(-parseInt(_0x276c68(0x1ce))/0x7)+-parseInt(_0x276c68(0x1c1))/0x8+parseInt(_0x276c68(0x1bf))/0x9*(parseInt(_0x276c68(0x1cf))/0xa);if(_0x279f36===_0x895dc0)break;else _0x2e6270['push'](_0x2e6270['shift']());}catch(_0x5e4d19){_0x2e6270['push'](_0x2e6270['shift']());}}}(a39_0x39bc,0x8dbad));import{BaseCommand}from'./command.js';function a39_0x39bc(){const _0x3dca66=['List\x20available\x20fields\x20for\x20segmentation','582626UHccvl','650892wnCbJP','✔\x20Found\x20','Listing\x20fields\x20for\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','14MQGfwV','502760xoiLVv','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment','json','execute','verbose','250706JtISiA','length','site','data','error','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','12CTrdcJ','listFields','333nZkDzk','\x27...','7147104GHthRt','parentSegment','Site:\x20','jsonl','2005970omJzty','3279810BfGiOI','description'];a39_0x39bc=function(){return _0x3dca66;};return a39_0x39bc();}function a39_0x173f(_0x37dd3b,_0x896568){_0x37dd3b=_0x37dd3b-0x1b1;const _0x39bce7=a39_0x39bc();let _0x173f08=_0x39bce7[_0x37dd3b];return _0x173f08;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a39_0x4d4f68(0x1c7)]=a39_0x4d4f68(0x1c8);async[a39_0x4d4f68(0x1b4)](_0x527477){const _0x4071e4=a39_0x4d4f68,{options:_0x3352d9,args:_0x3a4c0b,tdx:_0x5267ab}=_0x527477,_0x4a611e=_0x3a4c0b[0x0]||_0x3352d9[_0x4071e4(0x1c2)];if(!_0x4a611e)return console['error'](_0x4071e4(0x1b1)),console[_0x4071e4(0x1ba)](_0x4071e4(0x1bc)),console[_0x4071e4(0x1ba)](_0x4071e4(0x1cd)),0x1;_0x3352d9[_0x4071e4(0x1b5)]&&(console[_0x4071e4(0x1ba)](_0x4071e4(0x1c3)+_0x3352d9[_0x4071e4(0x1b8)]),console[_0x4071e4(0x1ba)](_0x4071e4(0x1bb)+_0x4a611e));const _0x272d04=await withSpinner(_0x4071e4(0x1cc)+_0x4a611e+_0x4071e4(0x1c0),()=>_0x5267ab[_0x4071e4(0x1b2)][_0x4071e4(0x1be)](_0x4a611e),{'verbose':_0x3352d9[_0x4071e4(0x1b5)]}),_0x1c42fc=_0x272d04[_0x4071e4(0x1b9)];console[_0x4071e4(0x1ba)](_0x4071e4(0x1cb)+_0x1c42fc['length']+'\x20field'+(_0x1c42fc[_0x4071e4(0x1b7)]!==0x1?'s':''));if(_0x3352d9[_0x4071e4(0x1b3)]||_0x3352d9[_0x4071e4(0x1c4)])return await handleSDKOutput(_0x1c42fc,_0x3352d9),0x0;return displayFieldsHumanReadable(_0x1c42fc,_0x4a611e),0x0;}}
1
+ const a39_0x13f59a=a39_0x135c;(function(_0x237c3e,_0x3757bb){const _0x1f5166=a39_0x135c,_0x16ce1b=_0x237c3e();while(!![]){try{const _0x2a594f=parseInt(_0x1f5166(0x10b))/0x1*(parseInt(_0x1f5166(0x116))/0x2)+parseInt(_0x1f5166(0x123))/0x3*(-parseInt(_0x1f5166(0x108))/0x4)+parseInt(_0x1f5166(0x106))/0x5+parseInt(_0x1f5166(0x10d))/0x6*(parseInt(_0x1f5166(0x118))/0x7)+-parseInt(_0x1f5166(0x117))/0x8*(parseInt(_0x1f5166(0x107))/0x9)+parseInt(_0x1f5166(0x11d))/0xa*(-parseInt(_0x1f5166(0x11e))/0xb)+parseInt(_0x1f5166(0x114))/0xc;if(_0x2a594f===_0x3757bb)break;else _0x16ce1b['push'](_0x16ce1b['shift']());}catch(_0x9006a9){_0x16ce1b['push'](_0x16ce1b['shift']());}}}(a39_0x5bd6,0x2e6ab));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a39_0x135c(_0x58bfbe,_0x2714e3){_0x58bfbe=_0x58bfbe-0x106;const _0x5bd6c9=a39_0x5bd6();let _0x135cbe=_0x5bd6c9[_0x58bfbe];return _0x135cbe;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x13f59a(0x119)]=a39_0x13f59a(0x11a);[a39_0x13f59a(0x120)]=a39_0x13f59a(0x10e);async[a39_0x13f59a(0x122)](_0x28bd78){const _0x145560=a39_0x13f59a,{options:_0x18f811,args:_0x3d5df5,tdx:_0x3dacdf}=_0x28bd78,_0x11203b=_0x3d5df5[0x0]||_0x18f811[_0x145560(0x111)];if(!_0x11203b)return console[_0x145560(0x112)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x145560(0x112)](_0x145560(0x10a)),0x1;_0x18f811[_0x145560(0x110)]&&(console[_0x145560(0x112)](_0x145560(0x10c)+_0x18f811[_0x145560(0x109)]),console[_0x145560(0x112)]('Parent\x20segment:\x20'+_0x11203b));const _0x54d92=await withSpinner(_0x145560(0x121)+_0x11203b+_0x145560(0x10f),()=>_0x3dacdf['segment']['listFields'](_0x11203b),{'verbose':_0x18f811['verbose']}),_0x591ee9=_0x54d92[_0x145560(0x11b)];console[_0x145560(0x112)](_0x145560(0x115)+_0x591ee9[_0x145560(0x11c)]+'\x20field'+(_0x591ee9['length']!==0x1?'s':''));if(_0x18f811[_0x145560(0x11f)]||_0x18f811[_0x145560(0x113)])return await handleSDKOutput(_0x591ee9,_0x18f811),0x0;return displayFieldsHumanReadable(_0x591ee9,_0x11203b),0x0;}}function a39_0x5bd6(){const _0x1b4972=['segment:fields','data','length','688310QDBtJU','44qZBYyH','json','description','Listing\x20fields\x20for\x20\x27','execute','3wyRTDS','321400gkUfel','8892KlWhre','1016188oAdZrv','site','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','111113vbYdFQ','Site:\x20','6dKJbIF','List\x20available\x20fields\x20for\x20segmentation','\x27...','verbose','parentSegment','error','jsonl','6250404NXkvIL','✔\x20Found\x20','4uuMfcX','1912tLOxyE','1037771xZLmvE','name'];a39_0x5bd6=function(){return _0x1b4972;};return a39_0x5bd6();}
@@ -1 +1 @@
1
- const a40_0x38d806=a40_0x3fb7;(function(_0x1c764c,_0x297d4f){const _0x376df9=a40_0x3fb7,_0x1111b6=_0x1c764c();while(!![]){try{const _0x1be1c9=-parseInt(_0x376df9(0x126))/0x1+parseInt(_0x376df9(0xff))/0x2+parseInt(_0x376df9(0x105))/0x3*(parseInt(_0x376df9(0x112))/0x4)+-parseInt(_0x376df9(0x109))/0x5+parseInt(_0x376df9(0x106))/0x6*(-parseInt(_0x376df9(0x10c))/0x7)+-parseInt(_0x376df9(0x13a))/0x8*(parseInt(_0x376df9(0x115))/0x9)+parseInt(_0x376df9(0x11d))/0xa*(parseInt(_0x376df9(0x138))/0xb);if(_0x1be1c9===_0x297d4f)break;else _0x1111b6['push'](_0x1111b6['shift']());}catch(_0x39cea6){_0x1111b6['push'](_0x1111b6['shift']());}}}(a40_0x4017,0x9d820));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a40_0x3fb7(_0x32e715,_0x3c5b8d){_0x32e715=_0x32e715-0xf7;const _0x4017e9=a40_0x4017();let _0x3fb798=_0x4017e9[_0x32e715];return _0x3fb798;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x251a7a from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x872660 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a40_0x4017(){const _0x3244fa=['\x20with\x20','segments','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','red','\x20segments','dim','length','1714876WkTFIX','execute','helpText','Parent\x20segment:\x20','file','Target\x20resource:\x20','252951FMGRoJ','1333374sKeuSB','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','filter','602400gBtEoa','verbose','targetDir','28vbtGwK','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','isNew','type','site','absolutePath','4QEjTNv','segment:pull','green','131913etBayX','parent_segment','files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parentSegment','\x20\x20🗺️\x20\x20','\x0aError:','parentName','19882300oyZaGJ','cyan','journeyVersions','relativePath','Error:\x20','diff','Write\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','utf-8','542587vzNiaL','hasChanges','\x27...','\x20=\x20','\x20files?','\x20new\x20files','pullSegments','segment','no_parent','yellow','dryRun','✔\x20Context\x20set:\x20','message','\x20journeys','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aPull\x20summary\x20for\x20\x27','journeys','error','11RlrEdD','\x20files\x20to\x20','400JKVNEG','data','activations','yes','dirname','\x20\x20Target:\x20','session','counts','\x20\x20🎯\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errorCode'];a40_0x4017=function(){return _0x3244fa;};return a40_0x4017();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a40_0x38d806(0x113);['description']=a40_0x38d806(0xfa);async[a40_0x38d806(0x100)](_0xfda771){const _0x32487a=a40_0x38d806,{options:_0x216476,args:_0x1149c4,tdx:_0x5cba4f}=_0xfda771,_0x55db5e=_0x216476,_0x193446=await resolveTarget({'arg':_0x1149c4[0x0],'contextParent':_0x216476[_0x32487a(0x119)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x193446))return _0x193446[_0x32487a(0xf7)]===_0x32487a(0x12e)?(console['error'](a40_0x251a7a[_0x32487a(0x12f)](_0x32487a(0x143))),console[_0x32487a(0x137)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x32487a(0x137)](_0x32487a(0x10d)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x32487a(0x137)](a40_0x251a7a['red'](_0x32487a(0x121)+_0x193446[_0x32487a(0x132)]+'\x0a')),_0x193446[_0x32487a(0x101)]&&console[_0x32487a(0x137)](a40_0x251a7a['cyan'](_0x193446[_0x32487a(0x101)]))),0x1;const _0x3989d0=_0x193446['parentName'],_0xb1ebee=_0x193446[_0x32487a(0x10b)],_0x295e7e=_0x193446[_0x32487a(0x10f)]===_0x32487a(0x103)?_0x193446['resourceName']:undefined;_0x55db5e['verbose']&&(console['error']('Site:\x20'+_0x55db5e[_0x32487a(0x110)]),console[_0x32487a(0x137)](_0x32487a(0x102)+_0x3989d0),_0x295e7e&&console[_0x32487a(0x137)](_0x32487a(0x104)+_0x295e7e));const _0x435ead=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x3989d0+_0x32487a(0x128),_0x4ffb1b=>_0x5cba4f[_0x32487a(0x12d)][_0x32487a(0x12c)](_0x3989d0,{'targetDir':_0xb1ebee,'targetResourceName':_0x295e7e,'verbose':_0x55db5e[_0x32487a(0x10a)],'progress':{'update':_0x498803=>{const _0x11d38a=_0x32487a;_0x4ffb1b['setPhase'](_0x498803),_0x55db5e[_0x11d38a(0x10a)]&&console[_0x11d38a(0x137)]('\x20\x20'+_0x498803);}}}),{'verbose':_0x55db5e['verbose']}),_0x3031d7=_0x435ead[_0x32487a(0x13b)];if(_0x3031d7[_0x32487a(0x141)][_0x32487a(0xf9)]===0x0&&_0x3031d7['counts']['journeys']===0x0)return console[_0x32487a(0x137)](a40_0x251a7a[_0x32487a(0x12f)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x3031d7[_0x32487a(0x11c)]+'\x27')),0x0;const _0x109a9f=_0x3031d7[_0x32487a(0x117)]['filter'](_0x11fe23=>_0x11fe23[_0x32487a(0x10e)]),_0x415c5f=_0x3031d7['files'][_0x32487a(0x108)](_0x3ca013=>!_0x3ca013[_0x32487a(0x10e)]&&_0x3ca013[_0x32487a(0x127)]),_0x11ba04=_0x3031d7[_0x32487a(0x117)][_0x32487a(0x108)](_0x192ebe=>!_0x192ebe['isNew']&&!_0x192ebe[_0x32487a(0x127)]);console[_0x32487a(0x137)](_0x32487a(0x135)+_0x3031d7[_0x32487a(0x11c)]+'\x27:'),console['error'](_0x32487a(0x142)+a40_0x251a7a['cyan'](_0x3031d7['counts']['segments']+_0x32487a(0xfc))+_0x32487a(0xf8)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7[_0x32487a(0x141)][_0x32487a(0x13c)]+'\x20activations'));if(_0x3031d7[_0x32487a(0x141)][_0x32487a(0x136)]>0x0){const _0xfd8673=_0x3031d7['counts'][_0x32487a(0x11f)]>_0x3031d7[_0x32487a(0x141)]['journeys']?'\x20('+_0x3031d7['counts'][_0x32487a(0x11f)]+'\x20versions)':'';console[_0x32487a(0x137)](_0x32487a(0x11a)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7['counts'][_0x32487a(0x136)]+_0x32487a(0x133))+a40_0x251a7a[_0x32487a(0xfd)](_0xfd8673));}console[_0x32487a(0x137)]('\x20\x20'+a40_0x251a7a[_0x32487a(0x114)]('+\x20'+_0x109a9f[_0x32487a(0xfe)]+_0x32487a(0x12b))),console[_0x32487a(0x137)]('\x20\x20'+a40_0x251a7a[_0x32487a(0x12f)]('~\x20'+_0x415c5f[_0x32487a(0xfe)]+'\x20changed\x20files')),console[_0x32487a(0x137)]('\x20\x20'+a40_0x251a7a['dim']('=\x20'+_0x11ba04[_0x32487a(0xfe)]+'\x20unchanged\x20files')),console[_0x32487a(0x137)](_0x32487a(0x13f)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7[_0x32487a(0x10b)])+'\x0a');if(_0x415c5f[_0x32487a(0xfe)]>0x0)for(const _0xb1ab9e of _0x415c5f){console[_0x32487a(0x137)]('\x0aChanges\x20to\x20\x27'+_0xb1ab9e[_0x32487a(0x120)]+'\x27:'),console[_0x32487a(0x137)]('─'['repeat'](0x3c)),console[_0x32487a(0x137)](_0xb1ab9e[_0x32487a(0x122)]),console[_0x32487a(0x137)]('─'['repeat'](0x3c));}if(_0x55db5e[_0x32487a(0x130)])return console[_0x32487a(0x137)](a40_0x251a7a['yellow'](_0x32487a(0x107))),0x0;if(_0x109a9f[_0x32487a(0xfe)]===0x0&&_0x415c5f[_0x32487a(0xfe)]===0x0)return console[_0x32487a(0x137)](a40_0x251a7a['green'](_0x32487a(0x134))),saveSessionContext({'parent_segment':_0x3031d7['parentName']},_0x55db5e[_0x32487a(0x140)]),console[_0x32487a(0x137)](a40_0x251a7a[_0x32487a(0x114)](_0x32487a(0x131)+a40_0x251a7a[_0x32487a(0xfd)](_0x32487a(0x116))+_0x32487a(0x129)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7['parentName']))),0x0;if(!_0x55db5e[_0x32487a(0x13d)]){if(!isInteractive())return console[_0x32487a(0x137)](a40_0x251a7a[_0x32487a(0xfb)](_0x32487a(0x11b)),_0x32487a(0x118)),console['error'](a40_0x251a7a[_0x32487a(0xfd)](_0x32487a(0x124))),0x1;const _0x2cc294=await confirmKey(_0x32487a(0x123)+(_0x109a9f['length']+_0x415c5f[_0x32487a(0xfe)])+_0x32487a(0x12a));if(!_0x2cc294)return console[_0x32487a(0x137)](a40_0x251a7a['yellow']('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x3ab778 of _0x3031d7[_0x32487a(0x117)]){if(_0x3ab778[_0x32487a(0x10e)]||_0x3ab778[_0x32487a(0x127)]){const _0x5b8ad2=a40_0x872660[_0x32487a(0x13e)](_0x3ab778[_0x32487a(0x111)]);!existsSync(_0x5b8ad2)&&mkdirSync(_0x5b8ad2,{'recursive':!![]}),writeFileSync(_0x3ab778[_0x32487a(0x111)],_0x3ab778['content'],_0x32487a(0x125));}}return console[_0x32487a(0x137)](a40_0x251a7a[_0x32487a(0x114)]('✔\x20Pulled\x20'+(_0x109a9f[_0x32487a(0xfe)]+_0x415c5f[_0x32487a(0xfe)])+_0x32487a(0x139)+_0x3031d7['targetDir'])),saveSessionContext({'parent_segment':_0x3031d7[_0x32487a(0x11c)]},_0x55db5e[_0x32487a(0x140)]),console[_0x32487a(0x137)](a40_0x251a7a['green'](_0x32487a(0x131)+a40_0x251a7a[_0x32487a(0xfd)](_0x32487a(0x116))+_0x32487a(0x129)+a40_0x251a7a[_0x32487a(0x11e)](_0x3031d7[_0x32487a(0x11c)]))),0x0;}}
1
+ const a40_0x35e323=a40_0x567a;(function(_0x28a86c,_0x43178f){const _0x3344b0=a40_0x567a,_0x9f279d=_0x28a86c();while(!![]){try{const _0x2386d3=-parseInt(_0x3344b0(0x98))/0x1+parseInt(_0x3344b0(0x83))/0x2*(parseInt(_0x3344b0(0xb5))/0x3)+-parseInt(_0x3344b0(0x8a))/0x4+-parseInt(_0x3344b0(0xcb))/0x5*(parseInt(_0x3344b0(0xc8))/0x6)+-parseInt(_0x3344b0(0x99))/0x7+parseInt(_0x3344b0(0x82))/0x8+parseInt(_0x3344b0(0x93))/0x9;if(_0x2386d3===_0x43178f)break;else _0x9f279d['push'](_0x9f279d['shift']());}catch(_0x287016){_0x9f279d['push'](_0x9f279d['shift']());}}}(a40_0x9614,0x85daf));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_0x567a(_0x34d9d3,_0x29b8e8){_0x34d9d3=_0x34d9d3-0x80;const _0x96140f=a40_0x9614();let _0x567ac5=_0x96140f[_0x34d9d3];return _0x567ac5;}function a40_0x9614(){const _0x1c3c67=['description','diff','helpText','execute','no_parent','setPhase','6ITLoqZ','dim','content','\x20\x20Target:\x20','resourceName','journeyVersions','data','errorCode','Pulling\x20segments\x20from\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','hasChanges','error','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parentName','segment:pull','\x20\x20🗺️\x20\x20','yellow','Aborted.','30DDGtaU','length','✔\x20Context\x20set:\x20','627620cSWyQd','\x0aChanges\x20to\x20\x27','files','3812296dwPANS','1003804onaDfD','\x20files\x20to\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Site:\x20','session','dryRun','Error:\x20','2061624RIveQT','verbose','counts','\x20with\x20','\x0aError:','✔\x20Pulled\x20','segment','segments','repeat','8651754gVHWDz','name','isNew','Write\x20','\x20\x20🎯\x20','251052tDxALX','3495086pRgywb','\x27...','red','utf-8','targetDir','cyan','dirname','\x20journeys','parentSegment','relativePath','journeys','yes','absolutePath','Parent\x20segment:\x20','-\x20no\x20files\x20written','parent_segment','\x0aPull\x20summary\x20for\x20\x27','\x20versions)','\x20=\x20','activations','filter','green'];a40_0x9614=function(){return _0x1c3c67;};return a40_0x9614();}import a40_0x3c4656 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x1cab3d 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_0x35e323(0x94)]=a40_0x35e323(0xc4);[a40_0x35e323(0xaf)]=a40_0x35e323(0x85);async[a40_0x35e323(0xb2)](_0x3d0417){const _0x101aac=a40_0x35e323,{options:_0x157a76,args:_0xee46ba,tdx:_0x38ff67}=_0x3d0417,_0x497ab6=_0x157a76,_0xc2f810=await resolveTarget({'arg':_0xee46ba[0x0],'contextParent':_0x157a76[_0x101aac(0xa1)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xc2f810))return _0xc2f810[_0x101aac(0xbc)]===_0x101aac(0xb3)?(console['error'](a40_0x3c4656[_0x101aac(0xc6)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x101aac(0xc0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x101aac(0xc0)](_0x101aac(0xc2))):(console['error'](a40_0x3c4656[_0x101aac(0x9b)](_0x101aac(0x89)+_0xc2f810['message']+'\x0a')),_0xc2f810[_0x101aac(0xb1)]&&console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0x9e)](_0xc2f810[_0x101aac(0xb1)]))),0x1;const _0x303d5c=_0xc2f810[_0x101aac(0xc3)],_0xe096b9=_0xc2f810[_0x101aac(0x9d)],_0x2c215a=_0xc2f810['type']==='file'?_0xc2f810[_0x101aac(0xb9)]:undefined;_0x497ab6[_0x101aac(0x8b)]&&(console[_0x101aac(0xc0)](_0x101aac(0x86)+_0x497ab6['site']),console[_0x101aac(0xc0)](_0x101aac(0xa6)+_0x303d5c),_0x2c215a&&console[_0x101aac(0xc0)]('Target\x20resource:\x20'+_0x2c215a));const _0x496553=await withProgressSpinner(_0x101aac(0xbd)+_0x303d5c+_0x101aac(0x9a),_0x5cf7aa=>_0x38ff67[_0x101aac(0x90)]['pullSegments'](_0x303d5c,{'targetDir':_0xe096b9,'targetResourceName':_0x2c215a,'verbose':_0x497ab6[_0x101aac(0x8b)],'progress':{'update':_0x1e69fb=>{const _0x45f7f6=_0x101aac;_0x5cf7aa[_0x45f7f6(0xb4)](_0x1e69fb),_0x497ab6[_0x45f7f6(0x8b)]&&console[_0x45f7f6(0xc0)]('\x20\x20'+_0x1e69fb);}}}),{'verbose':_0x497ab6[_0x101aac(0x8b)]}),_0x994607=_0x496553[_0x101aac(0xbb)];if(_0x994607['counts'][_0x101aac(0x91)]===0x0&&_0x994607[_0x101aac(0x8c)][_0x101aac(0xa3)]===0x0)return console[_0x101aac(0xc0)](a40_0x3c4656['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x994607['parentName']+'\x27')),0x0;const _0x24b72b=_0x994607[_0x101aac(0x81)][_0x101aac(0xad)](_0x4b73ad=>_0x4b73ad[_0x101aac(0x95)]),_0x30b389=_0x994607[_0x101aac(0x81)][_0x101aac(0xad)](_0x409b62=>!_0x409b62[_0x101aac(0x95)]&&_0x409b62[_0x101aac(0xbf)]),_0x37b0e9=_0x994607[_0x101aac(0x81)][_0x101aac(0xad)](_0x5d04c6=>!_0x5d04c6[_0x101aac(0x95)]&&!_0x5d04c6[_0x101aac(0xbf)]);console[_0x101aac(0xc0)](_0x101aac(0xa9)+_0x994607[_0x101aac(0xc3)]+'\x27:'),console[_0x101aac(0xc0)](_0x101aac(0x97)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607[_0x101aac(0x8c)]['segments']+'\x20segments')+_0x101aac(0x8d)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607['counts'][_0x101aac(0xac)]+'\x20activations'));if(_0x994607[_0x101aac(0x8c)][_0x101aac(0xa3)]>0x0){const _0xa48857=_0x994607[_0x101aac(0x8c)]['journeyVersions']>_0x994607[_0x101aac(0x8c)]['journeys']?'\x20('+_0x994607['counts'][_0x101aac(0xba)]+_0x101aac(0xaa):'';console[_0x101aac(0xc0)](_0x101aac(0xc5)+a40_0x3c4656['cyan'](_0x994607['counts'][_0x101aac(0xa3)]+_0x101aac(0xa0))+a40_0x3c4656[_0x101aac(0xb6)](_0xa48857));}console[_0x101aac(0xc0)]('\x20\x20'+a40_0x3c4656[_0x101aac(0xae)]('+\x20'+_0x24b72b[_0x101aac(0xc9)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x3c4656[_0x101aac(0xc6)]('~\x20'+_0x30b389[_0x101aac(0xc9)]+'\x20changed\x20files')),console[_0x101aac(0xc0)]('\x20\x20'+a40_0x3c4656['dim']('=\x20'+_0x37b0e9[_0x101aac(0xc9)]+'\x20unchanged\x20files')),console[_0x101aac(0xc0)](_0x101aac(0xb8)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607['targetDir'])+'\x0a');if(_0x30b389[_0x101aac(0xc9)]>0x0)for(const _0x1fef37 of _0x30b389){console['error'](_0x101aac(0x80)+_0x1fef37[_0x101aac(0xa2)]+'\x27:'),console[_0x101aac(0xc0)]('─'[_0x101aac(0x92)](0x3c)),console[_0x101aac(0xc0)](_0x1fef37[_0x101aac(0xb0)]),console[_0x101aac(0xc0)]('─'['repeat'](0x3c));}if(_0x497ab6[_0x101aac(0x88)])return console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xc6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x24b72b[_0x101aac(0xc9)]===0x0&&_0x30b389[_0x101aac(0xc9)]===0x0)return console[_0x101aac(0xc0)](a40_0x3c4656['green'](_0x101aac(0xbe))),saveSessionContext({'parent_segment':_0x994607[_0x101aac(0xc3)]},_0x497ab6[_0x101aac(0x87)]),console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xae)](_0x101aac(0xca)+a40_0x3c4656[_0x101aac(0xb6)](_0x101aac(0xa8))+_0x101aac(0xab)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607[_0x101aac(0xc3)]))),0x0;if(!_0x497ab6[_0x101aac(0xa4)]){if(!isInteractive())return console[_0x101aac(0xc0)](a40_0x3c4656['red'](_0x101aac(0x8e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xb6)](_0x101aac(0xc1))),0x1;const _0xb48a04=await confirmKey(_0x101aac(0x96)+(_0x24b72b[_0x101aac(0xc9)]+_0x30b389[_0x101aac(0xc9)])+'\x20files?');if(!_0xb48a04)return console['error'](a40_0x3c4656[_0x101aac(0xc6)](_0x101aac(0xc7)),_0x101aac(0xa7)),0x1;}for(const _0x447807 of _0x994607[_0x101aac(0x81)]){if(_0x447807['isNew']||_0x447807[_0x101aac(0xbf)]){const _0x406df8=a40_0x1cab3d[_0x101aac(0x9f)](_0x447807[_0x101aac(0xa5)]);!existsSync(_0x406df8)&&mkdirSync(_0x406df8,{'recursive':!![]}),writeFileSync(_0x447807[_0x101aac(0xa5)],_0x447807[_0x101aac(0xb7)],_0x101aac(0x9c));}}return console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xae)](_0x101aac(0x8f)+(_0x24b72b['length']+_0x30b389[_0x101aac(0xc9)])+_0x101aac(0x84)+_0x994607[_0x101aac(0x9d)])),saveSessionContext({'parent_segment':_0x994607[_0x101aac(0xc3)]},_0x497ab6[_0x101aac(0x87)]),console[_0x101aac(0xc0)](a40_0x3c4656[_0x101aac(0xae)]('✔\x20Context\x20set:\x20'+a40_0x3c4656[_0x101aac(0xb6)](_0x101aac(0xa8))+_0x101aac(0xab)+a40_0x3c4656[_0x101aac(0x9e)](_0x994607[_0x101aac(0xc3)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x4101b7=a41_0x32dc;(function(_0x402cba,_0x1e92fe){const _0x1bffcd=a41_0x32dc,_0x4474bf=_0x402cba();while(!![]){try{const _0x6ba306=-parseInt(_0x1bffcd(0x11d))/0x1+parseInt(_0x1bffcd(0x123))/0x2+parseInt(_0x1bffcd(0x18c))/0x3*(parseInt(_0x1bffcd(0x177))/0x4)+-parseInt(_0x1bffcd(0x111))/0x5*(-parseInt(_0x1bffcd(0x18b))/0x6)+-parseInt(_0x1bffcd(0x1a6))/0x7*(-parseInt(_0x1bffcd(0x131))/0x8)+parseInt(_0x1bffcd(0x1a5))/0x9*(-parseInt(_0x1bffcd(0x194))/0xa)+-parseInt(_0x1bffcd(0x12f))/0xb;if(_0x6ba306===_0x1e92fe)break;else _0x4474bf['push'](_0x4474bf['shift']());}catch(_0x4cd7eb){_0x4474bf['push'](_0x4474bf['shift']());}}}(a41_0x37a5,0x73e4b));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x16032b from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a41_0x32dc(_0x14db0e,_0x1faa15){_0x14db0e=_0x14db0e-0x10d;const _0x37a525=a41_0x37a5();let _0x32dc25=_0x37a525[_0x14db0e];return _0x32dc25;}function a41_0x37a5(){const _0x2078d5=['40bewibA','\x20\x20Journeys:\x20','dim','list','\x20to\x20delete','Delete\x20journey:','then','journeyBundleName','user','\x20to\x20update','/j/da/je','cwd','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','deleted','no_parent','parent_name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','1431648lOeLit','63483JMDyWN','filePath','listSegments','repeat','listFolders','execute','623275RqETsh','journeys','endsWith','Site:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','red','\x20\x20Source:\x20','cyan','getJourney','toCreate','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','folderId','172289Hdgejm','activations','type','dryRun','toString','\x20new','789596OGLgAG','yamlConfig','Changes\x20to:','/sb/da/esr','\x20\x20\x20\x20','targetDir','results','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','New\x20journey:','Fetching\x20existing\x20data...','📁\x20','paused','3329414rJBjvA','updated','216amEidT','listActivations','\x20\x20Activations:','isScoped','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','getOutputSchemaWithCache','createdSegmentIds','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','resolveParentId','helpText','data','Folders\x20to\x20create:','\x20to\x20create','Parent\x20segment:\x20','.yml','unchanged','parentSegment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Delete\x20segment:','Error\x20parsing\x20YAML:\x20','\x20changes?','errorCode','\x0aValidation\x20failed:','relationships','description','Error:\x20Directory\x20not\x20found:\x20','Changes\x20to\x20journey:','\x20activations]','segment','attributes','audienceId','/e/','Error:\x20','\x20folders\x20to\x20create','created','\x20updated','segments','journeyId','\x20changed','journeysOnly','folderPath','delete','changed','state','\x0aPush\x20summary\x20for\x20\x27','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','buildUserMaps','filter','site','join','length','diff','nameToType','/app/ps/','idToName','get','listJourneysWithDetailsFromParentSegment','\x20created','folders','verbose','existingSegment','yellow','green','name','connection','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x0a✔\x20Push\x20complete','16YYGxqs','map','blue','Source\x20directory:\x20','Fetching\x20existing\x20activations...','journeyBundleId','\x27...','isNew','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Aborted.','journey','message','push','toDelete','error','nameToId','segmentFolderId','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','parentFolder','set','18FkAwfl','429243cHnWPT','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment\x20or\x20journey','new','updatedAt','toUpdate','all','\x20deleted'];a41_0x37a5=function(){return _0x2078d5;};return a41_0x37a5();}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']='segment:push';[a41_0x4101b7(0x14a)]=a41_0x4101b7(0x17f);async[a41_0x4101b7(0x110)](_0x400bc9){const _0x3912b4=a41_0x4101b7,{options:_0x3a5d00,args:_0x260acb,tdx:_0x4c25a0}=_0x400bc9,_0x5c4470=_0x3a5d00,_0x54b18f=await resolveTarget({'arg':_0x260acb[0x0],'contextParent':_0x3a5d00[_0x3912b4(0x142)],'cwd':process[_0x3912b4(0x19f)]()});if(!isSuccessfulResolution(_0x54b18f))return _0x54b18f[_0x3912b4(0x147)]===_0x3912b4(0x1a2)?(console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x171)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3912b4(0x185)](_0x3912b4(0x175)),console[_0x3912b4(0x185)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x3912b4(0x185)](_0x3912b4(0x1a4))):(console['error'](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x152)+_0x54b18f[_0x3912b4(0x182)]+'\x0a')),_0x54b18f['helpText']&&console['error'](a41_0x16032b['cyan'](_0x54b18f[_0x3912b4(0x13b)]))),0x1;if(_0x54b18f['type']===_0x3912b4(0x1a3))return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)]('Error:\x20Directory\x20not\x20found:\x20'+_0x54b18f['targetDir']+'\x0a')),console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x118)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x546694=_0x54b18f['parentName'],_0x3d5af1=_0x54b18f[_0x3912b4(0x128)],_0xc5930c=_0x54b18f[_0x3912b4(0x11f)]==='file'?_0x54b18f[_0x3912b4(0x1a7)]:undefined,_0x320626=getScopedDetails(_0x54b18f),_0xee0fdd=_0x320626?.[_0x3912b4(0x134)]??![],_0xe097c8=_0x320626?.['scopedFolderPath']??'';if(!existsSync(_0x3d5af1))return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x14b)+_0x3d5af1+'\x0a')),console[_0x3912b4(0x185)](a41_0x16032b['cyan'](_0x3912b4(0x115))),0x1;_0x5c4470[_0x3912b4(0x16f)]&&(console[_0x3912b4(0x185)](_0x3912b4(0x114)+_0x5c4470['site']),console[_0x3912b4(0x185)](_0x3912b4(0x13f)+_0x546694),console[_0x3912b4(0x185)](_0x3912b4(0x17a)+_0x3d5af1),_0xee0fdd&&console[_0x3912b4(0x185)]('Scoped\x20to\x20folder:\x20'+_0xe097c8));const _0xb7c92=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x546694+_0x3912b4(0x17d),()=>_0x4c25a0['segment'][_0x3912b4(0x13a)](_0x546694),{'verbose':_0x5c4470[_0x3912b4(0x16f)]}),_0x59e07f=_0xb7c92[_0x3912b4(0x13c)],{parentSegmentResult:_0x3151e2,segmentsResult:_0x5a3154,foldersResult:_0x1abfb9,journeysWithDetailsResult:_0x5eb72c,userMaps:_0x14a8b5}=await withSpinner(_0x3912b4(0x12c),async()=>{const _0x53f183=_0x3912b4,[_0x2b3c05,_0x447a33,_0x435ddf,_0x34a2cd,_0x29f788]=await Promise[_0x53f183(0x192)]([_0x4c25a0['segment']['getParent'](_0x59e07f),_0x4c25a0[_0x53f183(0x14e)][_0x53f183(0x10d)](_0x59e07f),_0x4c25a0[_0x53f183(0x14e)][_0x53f183(0x10f)](_0x59e07f),_0x4c25a0[_0x53f183(0x181)][_0x53f183(0x16c)](_0x59e07f,{'includeAllVersions':!![]}),_0x4c25a0[_0x53f183(0x19c)][_0x53f183(0x162)]()]);return{'parentSegmentResult':_0x2b3c05,'segmentsResult':_0x447a33,'foldersResult':_0x435ddf,'journeysWithDetailsResult':_0x34a2cd,'userMaps':_0x29f788};},{'verbose':_0x5c4470[_0x3912b4(0x16f)]})[_0x3912b4(0x19a)](_0x140a58=>_0x140a58[_0x3912b4(0x13c)]),_0x4ccc34=_0x3151e2,_0x542566=extractRootFolderId(_0x4ccc34),_0x205488=_0x5a3154,_0x6843d3=_0x1abfb9,{journeys:_0x481253,activationStepsById:_0x35f7ef}=_0x5eb72c,_0xcd39d4=new Map(_0x481253[_0x3912b4(0x178)](_0x5ec839=>[_0x5ec839['id'],_0x5ec839])),_0xbe747f=_0x481253['map'](_0x3f32ea=>({'id':_0x3f32ea['id'],'name':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x173)],'journeyBundleName':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x19b)]||'','journeyBundleId':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x17c)]||'','versionNumber':_0x3f32ea[_0x3912b4(0x14f)]['versionNumber'],'description':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x14a)],'state':_0x3f32ea['attributes'][_0x3912b4(0x15d)],'paused':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x12e)],'audienceId':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x150)],'folderId':_0x3f32ea[_0x3912b4(0x149)]?.[_0x3912b4(0x189)]?.[_0x3912b4(0x13c)]?.['id'],'createdAt':_0x3f32ea[_0x3912b4(0x14f)]['createdAt'],'updatedAt':_0x3f32ea[_0x3912b4(0x14f)][_0x3912b4(0x190)]})),{emailToId:_0xc3e4e6,idToEmail:_0x40e2b7}=_0x14a8b5,_0x6d5454=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x38ab82=_0x3912b4,_0x366c96=await _0x4c25a0[_0x38ab82(0x174)][_0x38ab82(0x197)]();return buildConnectionMaps(_0x366c96);},{'verbose':_0x5c4470[_0x3912b4(0x16f)]})[_0x3912b4(0x19a)](_0x411997=>_0x411997[_0x3912b4(0x13c)]),_0x4196cb=_0x6d5454[_0x3912b4(0x186)],_0x46bfc0=_0x6d5454[_0x3912b4(0x16a)],_0x4b0c3d=_0x6d5454[_0x3912b4(0x168)],_0x4cb52e={'emailToIdMap':_0xc3e4e6,'connectionNameToIdMap':_0x4196cb,'connectionNameToTypeMap':_0x4b0c3d,'getSchema':_0x344742=>_0x4c25a0[_0x3912b4(0x174)][_0x3912b4(0x136)](_0x344742)};let {pathToId:_0x238705,idToPath:_0x5643e1}=buildFolderMaps(_0x6843d3);const _0x49737f=buildSegmentLookupMap(_0x205488,_0x5643e1),_0x100ee1=buildSegmentNameToIdMap(_0x205488),_0x525879=buildJourneyBundleLookupMap(_0xbe747f,_0x5643e1);let _0x309b58;if(_0xc5930c){if(!_0xc5930c[_0x3912b4(0x113)](_0x3912b4(0x140))&&!_0xc5930c[_0x3912b4(0x113)]('.yaml'))return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x188)+_0xc5930c+'\x0a')),0x1;_0x309b58=[_0xc5930c];}else _0x309b58=findYamlFiles(_0x3d5af1);if(_0x309b58['length']===0x0)return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x3d5af1+'\x0a')),console[_0x3912b4(0x185)](a41_0x16032b['cyan'](_0x3912b4(0x139))),0x1;let _0x2af00c,_0x2d4a6b;try{const _0x467be0=parseAndClassifyYamlFiles(_0x309b58,_0x3d5af1,{'skipSegments':_0x5c4470[_0x3912b4(0x159)]});_0x2af00c=_0x467be0['segments'],_0x2d4a6b=_0x467be0[_0x3912b4(0x112)];const _0xba3ab5=validateParsedFiles(_0x467be0,_0x3d5af1);if(_0xba3ab5[_0x3912b4(0x166)]>0x0)return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x148))),console[_0x3912b4(0x185)](formatValidationErrors(_0xba3ab5)),console[_0x3912b4(0x185)](a41_0x16032b['yellow'](_0x3912b4(0x135))),0x1;}catch(_0x33305a){return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)](_0x3912b4(0x145)+(_0x33305a instanceof Error?_0x33305a[_0x3912b4(0x182)]:_0x33305a))),0x1;}if(_0x2af00c[_0x3912b4(0x166)]===0x0&&_0x2d4a6b[_0x3912b4(0x166)]===0x0){const _0x4f2afc=_0x5c4470['journeysOnly']?_0x3912b4(0x181):_0x3912b4(0x18e);return console[_0x3912b4(0x185)](a41_0x16032b['yellow']('No\x20'+_0x4f2afc+'\x20YAML\x20files\x20found')),0x0;}const _0xf7fde=new Map();_0x205488['length']>0x0&&!_0x5c4470['journeysOnly']&&await withSpinner(_0x3912b4(0x17b),async()=>{await batchAsync(_0x205488,async _0x160046=>{const _0x89ee65=a41_0x32dc,_0x57d11e=await _0x4c25a0[_0x89ee65(0x14e)][_0x89ee65(0x132)](_0x59e07f,_0x160046['id']);_0xf7fde[_0x89ee65(0x18a)](_0x160046['id'],_0x57d11e);});},{'verbose':_0x5c4470[_0x3912b4(0x16f)]});const {segmentFiles:_0x19906e,foldersToCreate:_0x15be37}=await prepareSegmentFiles(_0x2af00c,{'segmentByFolderAndName':_0x49737f,'activationsBySegmentId':_0xf7fde,'folderPathToId':_0x238705,'idToEmailMap':_0x40e2b7,'connectionIdToNameMap':_0x46bfc0},_0x4cb52e,_0xee0fdd,_0xe097c8),_0x3d4d47=_0xc5930c?[]:findSegmentsToDelete(_0x205488,_0x2af00c['map'](({yamlConfig:_0x5d2138,folderPath:_0xc4cf2d})=>({'yamlConfig':_0x5d2138,'folderPath':resolveTDFolderPath(_0xc4cf2d,_0xee0fdd,_0xe097c8)})),_0x5643e1,_0xe097c8,_0xee0fdd),{journeyFiles:_0x5f14a4,foldersToCreate:_0x2ceb27}=await withProgressSpinner('Preparing\x20journeys...',async _0x1aa84e=>prepareJourneyFiles(_0x2d4a6b,{'fetchJourney':async _0x278227=>_0x4c25a0[_0x3912b4(0x181)][_0x3912b4(0x119)](_0x278227[_0x3912b4(0x157)]),'journeyBundlesByFolderAndName':_0x525879,'folderPathToId':_0x238705,'idToEmailMap':_0x40e2b7,'connectionIdToNameMap':_0x46bfc0,'existingSegments':_0x205488,'parentId':_0x59e07f,'deps':_0x4c25a0,'progress':{'update':_0x13ffdf=>{const _0x429f2a=_0x3912b4;_0x1aa84e['setPhase'](_0x13ffdf),_0x5c4470[_0x429f2a(0x16f)]&&console[_0x429f2a(0x185)]('\x20\x20'+_0x13ffdf);}},'journeyById':_0xcd39d4,'activationStepsById':_0x35f7ef},_0xee0fdd,_0xe097c8),{'verbose':_0x5c4470['verbose']})[_0x3912b4(0x19a)](_0x16314c=>_0x16314c[_0x3912b4(0x13c)]);for(const _0x1102c7 of _0x2ceb27){_0x15be37['add'](_0x1102c7);}const _0x429fe9=_0xc5930c?[]:findJourneysToDelete(_0xbe747f,_0x2d4a6b[_0x3912b4(0x178)](({yamlConfig:_0x1df5e4,folderPath:_0x34524f})=>({'yamlConfig':_0x1df5e4,'folderPath':resolveTDFolderPath(_0x34524f,_0xee0fdd,_0xe097c8)})),_0x5643e1,_0xe097c8,_0xee0fdd),_0x4d415c=calculatePushStats(_0x19906e,_0x5f14a4,_0x15be37,_0x3d4d47,_0x429fe9,!!_0x5c4470[_0x3912b4(0x15b)],!!_0x5c4470[_0x3912b4(0x159)]),_0x5284a6=_0x4d415c['segments'][_0x3912b4(0x18f)],_0x2fb3ac=_0x4d415c[_0x3912b4(0x156)][_0x3912b4(0x15c)],_0xe9f5d=_0x4d415c['segments']['unchanged'],_0x24985f=_0x4d415c[_0x3912b4(0x156)]['toDelete'],_0x6098e8=_0x4d415c[_0x3912b4(0x16e)][_0x3912b4(0x11a)],_0x4eb5ba=_0x4d415c[_0x3912b4(0x112)][_0x3912b4(0x18f)],_0x47395a=_0x4d415c['journeys'][_0x3912b4(0x15c)],_0x79b1ca=_0x4d415c[_0x3912b4(0x112)][_0x3912b4(0x141)],_0x26f8b5=_0x4d415c['journeys'][_0x3912b4(0x184)],_0x3e4c52=_0x4d415c[_0x3912b4(0x11e)][_0x3912b4(0x192)],_0x48f7da=_0x4d415c[_0x3912b4(0x11e)][_0x3912b4(0x11a)],_0xfcbcc4=_0x4d415c[_0x3912b4(0x11e)][_0x3912b4(0x191)],_0x3c9e7d=_0x4d415c[_0x3912b4(0x11e)][_0x3912b4(0x184)];console[_0x3912b4(0x185)](_0x3912b4(0x15e)+_0x546694+'\x27:');_0x6098e8[_0x3912b4(0x166)]>0x0&&console[_0x3912b4(0x185)]('\x20\x20'+a41_0x16032b[_0x3912b4(0x179)](_0x3912b4(0x12d)+_0x6098e8['length']+_0x3912b4(0x153)));if(!_0x5c4470[_0x3912b4(0x159)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b['green']('+\x20'+_0x5284a6[_0x3912b4(0x166)]+_0x3912b4(0x122))),console['error'](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x171)]('~\x20'+_0x2fb3ac['length']+_0x3912b4(0x158)));if(_0x24985f[_0x3912b4(0x166)]>0x0)console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x116)]('-\x20'+_0x24985f['length']+_0x3912b4(0x198)));else _0x3d4d47[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x15b)]&&console['error'](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x196)](_0x3d4d47['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x196)]('=\x20'+_0xe9f5d[_0x3912b4(0x166)]+'\x20unchanged'));}if(_0x5f14a4[_0x3912b4(0x166)]>0x0||_0x429fe9[_0x3912b4(0x166)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b['green']('+\x20'+_0x4eb5ba[_0x3912b4(0x166)]+_0x3912b4(0x122))),console['error']('\x20\x20\x20\x20'+a41_0x16032b[_0x3912b4(0x171)]('~\x20'+_0x47395a[_0x3912b4(0x166)]+_0x3912b4(0x158)));if(_0x26f8b5[_0x3912b4(0x166)]>0x0)console[_0x3912b4(0x185)]('\x20\x20\x20\x20'+a41_0x16032b[_0x3912b4(0x116)]('-\x20'+_0x26f8b5[_0x3912b4(0x166)]+'\x20to\x20delete'));else _0x429fe9[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x15b)]&&console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x196)](_0x429fe9['length']+_0x3912b4(0x18d)));console['error'](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x196)]('=\x20'+_0x79b1ca[_0x3912b4(0x166)]+'\x20unchanged'));}_0x3e4c52['length']>0x0&&!_0x5c4470[_0x3912b4(0x159)]&&(console[_0x3912b4(0x185)](''),console[_0x3912b4(0x185)](_0x3912b4(0x133)),_0x48f7da[_0x3912b4(0x166)]>0x0&&console[_0x3912b4(0x185)](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x172)]('+\x20'+_0x48f7da[_0x3912b4(0x166)]+_0x3912b4(0x13e))),_0xfcbcc4['length']>0x0&&console[_0x3912b4(0x185)]('\x20\x20\x20\x20'+a41_0x16032b['yellow']('~\x20'+_0xfcbcc4[_0x3912b4(0x166)]+_0x3912b4(0x19d))),_0x3c9e7d[_0x3912b4(0x166)]>0x0&&console['error'](_0x3912b4(0x127)+a41_0x16032b[_0x3912b4(0x116)]('-\x20'+_0x3c9e7d['length']+_0x3912b4(0x198))));console['error'](_0x3912b4(0x117)+a41_0x16032b[_0x3912b4(0x118)](_0x3d5af1)+'\x0a');if(_0x6098e8['length']>0x0){console[_0x3912b4(0x185)](_0x3912b4(0x13d));for(const _0x2a9a99 of _0x6098e8){console[_0x3912b4(0x185)]('\x20\x20'+a41_0x16032b[_0x3912b4(0x179)]('+')+'\x20'+_0x2a9a99);}console['error']('');}if(_0x5284a6[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x159)])for(const _0x4112aa of _0x5284a6){const _0x310819=_0x4112aa[_0x3912b4(0x15a)]?_0x4112aa[_0x3912b4(0x15a)]+'/'+_0x4112aa[_0x3912b4(0x124)][_0x3912b4(0x173)]:_0x4112aa[_0x3912b4(0x124)][_0x3912b4(0x173)],_0x1eae33=_0x4112aa['yamlConfig'][_0x3912b4(0x11e)]?.[_0x3912b4(0x166)]||0x0,_0x461865=_0x1eae33>0x0?a41_0x16032b[_0x3912b4(0x196)]('\x20['+_0x1eae33+_0x3912b4(0x14d)):'';console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b[_0x3912b4(0x172)]('New\x20segment:')+'\x20'+_0x310819+_0x461865),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c)),_0x4112aa[_0x3912b4(0x167)]&&console[_0x3912b4(0x185)](_0x4112aa[_0x3912b4(0x167)]),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}if(_0x24985f[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x159)])for(const _0x4a9b25 of _0x24985f){const _0x5597c2=_0x4a9b25['segmentFolderId']?_0x5643e1[_0x3912b4(0x16b)](_0x4a9b25[_0x3912b4(0x187)][_0x3912b4(0x121)]())||'':'',_0x35c752=_0x5597c2?_0x5597c2+'/'+_0x4a9b25[_0x3912b4(0x173)]:_0x4a9b25[_0x3912b4(0x173)],_0x3d5b33=_0xf7fde[_0x3912b4(0x16b)](_0x4a9b25['id'])||[],_0x239b10=_0x3d5b33[_0x3912b4(0x166)]>0x0?a41_0x16032b['dim']('\x20['+_0x3d5b33[_0x3912b4(0x166)]+_0x3912b4(0x14d)):'';console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b['red'](_0x3912b4(0x144))+'\x20'+_0x35c752+_0x239b10),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));const _0x1cc559=segmentWithActivationsToYaml(_0x4a9b25,_0x3d5b33,undefined,_0x40e2b7,_0x46bfc0),_0x59b7b0=segmentToYamlString(_0x1cc559),_0x349add=generateDiff(_0x59b7b0,'');console[_0x3912b4(0x185)](formatDiffWithColors(_0x349add)),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}const _0x9f3f11=_0x19906e[_0x3912b4(0x163)](_0x5ac26c=>!_0x5ac26c[_0x3912b4(0x17e)]&&_0x5ac26c[_0x3912b4(0x167)]);if(_0x9f3f11[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x159)])for(const _0x392068 of _0x9f3f11){const _0x1a4edc=_0x392068[_0x3912b4(0x15a)]?_0x392068['folderPath']+'/'+_0x392068[_0x3912b4(0x124)][_0x3912b4(0x173)]:_0x392068[_0x3912b4(0x124)][_0x3912b4(0x173)];console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b[_0x3912b4(0x171)](_0x3912b4(0x125))+'\x20'+_0x1a4edc),console['error']('─'[_0x3912b4(0x10e)](0x3c)),console[_0x3912b4(0x185)](_0x392068['diff']),console['error']('─'['repeat'](0x3c));}if(_0x4eb5ba[_0x3912b4(0x166)]>0x0)for(const _0xaf81fa of _0x4eb5ba){const _0x3c6147=_0xaf81fa[_0x3912b4(0x15a)]?_0xaf81fa['folderPath']+'/'+_0xaf81fa[_0x3912b4(0x124)][_0x3912b4(0x173)]:_0xaf81fa[_0x3912b4(0x124)]['name'];console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b[_0x3912b4(0x172)](_0x3912b4(0x12b))+'\x20'+_0x3c6147),console['error']('─'[_0x3912b4(0x10e)](0x3c)),_0xaf81fa[_0x3912b4(0x167)]&&console[_0x3912b4(0x185)](_0xaf81fa[_0x3912b4(0x167)]),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}const _0x4039d8=_0x5f14a4[_0x3912b4(0x163)](_0x3e3e3a=>!_0x3e3e3a[_0x3912b4(0x17e)]&&_0x3e3e3a['diff']);if(_0x4039d8['length']>0x0)for(const _0x1eedb5 of _0x4039d8){const _0x36036b=_0x1eedb5[_0x3912b4(0x15a)]?_0x1eedb5[_0x3912b4(0x15a)]+'/'+_0x1eedb5['yamlConfig'][_0x3912b4(0x173)]:_0x1eedb5[_0x3912b4(0x124)][_0x3912b4(0x173)];console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b[_0x3912b4(0x171)](_0x3912b4(0x14c))+'\x20'+_0x36036b),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c)),console[_0x3912b4(0x185)](_0x1eedb5[_0x3912b4(0x167)]),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}if(_0x26f8b5[_0x3912b4(0x166)]>0x0)for(const _0x2ee7b4 of _0x26f8b5){const _0x5ed9c4=_0x2ee7b4[_0x3912b4(0x11c)]?_0x5643e1[_0x3912b4(0x16b)](_0x2ee7b4[_0x3912b4(0x11c)])||'':'',_0x3783de=_0x5ed9c4?_0x5ed9c4+'/'+_0x2ee7b4[_0x3912b4(0x19b)]:_0x2ee7b4['journeyBundleName'];console[_0x3912b4(0x185)]('\x0a'+a41_0x16032b['red'](_0x3912b4(0x199))+'\x20'+_0x3783de),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c)),console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)]('(Journey\x20will\x20be\x20deleted)')),console[_0x3912b4(0x185)]('─'[_0x3912b4(0x10e)](0x3c));}if(_0x5c4470[_0x3912b4(0x120)])return console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x171)](_0x3912b4(0x1a0))),0x0;const _0x22b2e6=_0x5c4470['journeysOnly']?![]:_0x5284a6[_0x3912b4(0x166)]>0x0||_0x2fb3ac['length']>0x0||_0x24985f[_0x3912b4(0x166)]>0x0,_0x117b80=_0x4eb5ba['length']>0x0||_0x47395a[_0x3912b4(0x166)]>0x0||_0x26f8b5[_0x3912b4(0x166)]>0x0,_0x4b5b95=_0x5c4470[_0x3912b4(0x159)]?![]:_0x3e4c52[_0x3912b4(0x166)]>0x0,_0x1e0abf=_0x6098e8[_0x3912b4(0x166)]>0x0;if(!_0x22b2e6&&!_0x117b80&&!_0x4b5b95&&!_0x1e0abf){const _0x2059f2=_0x5c4470[_0x3912b4(0x159)]?_0x3912b4(0x161):_0x3912b4(0x11b);console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x172)](_0x2059f2));if(_0xc5930c&&_0xe9f5d['length']===0x1){const _0x3c6ac8=_0xe9f5d[0x0];if(_0x3c6ac8[_0x3912b4(0x170)]?.['id']){const _0x369fd2=getConsoleNextUrl(_0x5c4470[_0x3912b4(0x164)],'/app/ps/'+_0x59e07f+'/e/'+_0x3c6ac8['existingSegment']['id']+_0x3912b4(0x126));console['error'](_0x3912b4(0x12a)+a41_0x16032b[_0x3912b4(0x118)](_0x369fd2));}}if(_0xc5930c&&_0x79b1ca['length']===0x1){const _0x279f1e=_0x79b1ca[0x0];if(_0x279f1e['existingJourney']?.['id']){const _0xa20022=getConsoleNextUrl(_0x5c4470[_0x3912b4(0x164)],'/app/ps/'+_0x59e07f+'/e/'+_0x279f1e['existingJourney']['id']+_0x3912b4(0x19e));console[_0x3912b4(0x185)]('\x20\x20'+a41_0x16032b['cyan'](_0xa20022));}}return 0x0;}const _0x30cf6d=_0x5c4470['journeysOnly']?_0x4eb5ba[_0x3912b4(0x166)]+_0x47395a[_0x3912b4(0x166)]+_0x26f8b5[_0x3912b4(0x166)]+_0x6098e8['length']:_0x5284a6[_0x3912b4(0x166)]+_0x2fb3ac[_0x3912b4(0x166)]+_0x24985f['length']+_0x4eb5ba['length']+_0x47395a['length']+_0x26f8b5[_0x3912b4(0x166)]+_0x6098e8[_0x3912b4(0x166)]+_0x3e4c52[_0x3912b4(0x166)];if(!_0x5c4470[_0x3912b4(0x15f)]&&_0x30cf6d>0x0){if(!isInteractive())return console['error'](a41_0x16032b['red']('\x0aError:'),_0x3912b4(0x160)),console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x196)](_0x3912b4(0x143))),0x1;const _0x9d587c=await confirmKey('Push\x20'+_0x30cf6d+_0x3912b4(0x146));if(!_0x9d587c)return console[_0x3912b4(0x185)](a41_0x16032b['yellow'](_0x3912b4(0x180))),0x1;}const _0x2e8ff9={'withProgress':async(_0x29d9cb,_0x311650)=>{const _0x4114e1=_0x3912b4,_0x22e497=await withSpinner(_0x29d9cb,_0x311650,{'verbose':_0x5c4470[_0x4114e1(0x16f)]});return{'data':_0x22e497[_0x4114e1(0x13c)]};},'logInfo':_0x5b3b34=>console['error'](a41_0x16032b[_0x3912b4(0x179)]('✔\x20'+_0x5b3b34)),'logSuccess':_0x70beb9=>console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x172)]('✔\x20'+_0x70beb9)),'logWarning':_0x4ec15e=>console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x171)]('⚠\x20'+_0x4ec15e)),'logDeleted':_0x3a6946=>console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x116)]('✔\x20'+_0x3a6946))},_0x1ea448={'segment':_0x4c25a0[_0x3912b4(0x14e)],'journey':_0x4c25a0[_0x3912b4(0x181)],'user':_0x4c25a0[_0x3912b4(0x19c)],'connection':_0x4c25a0[_0x3912b4(0x174)]};_0x6098e8[_0x3912b4(0x166)]>0x0&&(_0x238705=await executePushFolders(_0x1ea448,_0x6098e8,_0x238705,{'parentId':_0x59e07f},_0x2e8ff9));const _0x3776b8={'rootFolderId':_0x542566,'folderPathToId':_0x238705,'folderIdToPath':_0x5643e1,'segmentNameToId':_0x100ee1,'activationsBySegmentId':_0xf7fde,'emailToIdMap':_0xc3e4e6,'idToEmailMap':_0x40e2b7,'connectionNameToIdMap':_0x6d5454[_0x3912b4(0x186)],'connectionIdToNameMap':_0x6d5454[_0x3912b4(0x16a)],'connectionNameToTypeMap':_0x4b0c3d},_0x517735=await executePushSegments(_0x1ea448,_0x5c4470[_0x3912b4(0x159)]?[]:_0x19906e,_0x3776b8,{'parentId':_0x59e07f},_0x2e8ff9),_0x5dcb7d=_0x517735[_0x3912b4(0x154)],_0x446900=_0x517735[_0x3912b4(0x130)],_0x23a8f3=_0x517735[_0x3912b4(0x11e)][_0x3912b4(0x154)],_0x2a1da4=_0x517735[_0x3912b4(0x11e)]['updated'],_0x1fa8d4=_0x517735[_0x3912b4(0x11e)][_0x3912b4(0x1a1)];let _0x2f7cfe;if(_0xc5930c&&_0x19906e[_0x3912b4(0x166)]===0x1){const _0x2070d6=_0x19906e[0x0];_0x2f7cfe=_0x2070d6[_0x3912b4(0x170)]?.['id']??_0x517735[_0x3912b4(0x137)][_0x3912b4(0x16b)](_0x2070d6[_0x3912b4(0x124)]['name']);}const _0x20f408=await executePushSegmentDeletions(_0x1ea448,_0x5c4470[_0x3912b4(0x159)]?[]:_0x24985f,_0x2e8ff9);let _0x30597a=0x0,_0x23e246=0x0,_0x5ef106=0x0;const _0x142cf7=new Map(_0x100ee1);for(const [_0x4a349b,_0x54bd71]of _0x517735[_0x3912b4(0x137)]){_0x142cf7[_0x3912b4(0x18a)](_0x4a349b,_0x54bd71);}if(_0x5f14a4[_0x3912b4(0x166)]>0x0){const _0x302885={..._0x3776b8,'segmentNameToId':_0x142cf7,'existingSegments':_0x205488,'activationContext':_0x4cb52e},_0x3bdee4=await executePushJourneys(_0x1ea448,_0x5f14a4,_0x302885,{'parentId':_0x59e07f,'rootFolderId':_0x542566,'verbose':_0x5c4470[_0x3912b4(0x16f)]},_0x2e8ff9);_0x30597a=_0x3bdee4['created'],_0x23e246=_0x3bdee4[_0x3912b4(0x130)];if(_0xc5930c&&_0x3bdee4[_0x3912b4(0x129)]['length']===0x1){const _0x18aa63=_0x3bdee4[_0x3912b4(0x129)][0x0];if(_0x18aa63[_0x3912b4(0x157)]){const _0x24663f=getConsoleNextUrl(_0x5c4470['site'],_0x3912b4(0x169)+_0x59e07f+_0x3912b4(0x151)+_0x18aa63[_0x3912b4(0x157)]+_0x3912b4(0x19e));console[_0x3912b4(0x185)]('\x20\x20'+a41_0x16032b['cyan'](_0x24663f));}}}for(const _0x334b0b of _0x26f8b5){console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x171)](_0x3912b4(0x138)+_0x334b0b[_0x3912b4(0x19b)])),_0x5ef106++;}const _0x8a11a1=[];if(_0x5dcb7d>0x0)_0x8a11a1[_0x3912b4(0x183)](_0x5dcb7d+_0x3912b4(0x16d));if(_0x446900>0x0)_0x8a11a1[_0x3912b4(0x183)](_0x446900+_0x3912b4(0x155));if(_0x20f408>0x0)_0x8a11a1[_0x3912b4(0x183)](_0x20f408+_0x3912b4(0x193));const _0x16c7aa=[];if(_0x30597a>0x0)_0x16c7aa['push'](_0x30597a+_0x3912b4(0x16d));if(_0x23e246>0x0)_0x16c7aa[_0x3912b4(0x183)](_0x23e246+'\x20updated');if(_0x5ef106>0x0)_0x16c7aa[_0x3912b4(0x183)](_0x5ef106+'\x20deleted');const _0x3cc167=[];if(_0x23a8f3>0x0)_0x3cc167[_0x3912b4(0x183)](_0x23a8f3+_0x3912b4(0x16d));if(_0x2a1da4>0x0)_0x3cc167[_0x3912b4(0x183)](_0x2a1da4+_0x3912b4(0x155));if(_0x1fa8d4>0x0)_0x3cc167[_0x3912b4(0x183)](_0x1fa8d4+_0x3912b4(0x193));console[_0x3912b4(0x185)](a41_0x16032b[_0x3912b4(0x172)](_0x3912b4(0x176)));_0x8a11a1[_0x3912b4(0x166)]>0x0&&!_0x5c4470[_0x3912b4(0x159)]&&console[_0x3912b4(0x185)]('\x20\x20Segments:\x20'+_0x8a11a1['join'](',\x20'));_0x16c7aa[_0x3912b4(0x166)]>0x0&&console[_0x3912b4(0x185)](_0x3912b4(0x195)+_0x16c7aa[_0x3912b4(0x165)](',\x20'));_0x3cc167[_0x3912b4(0x166)]>0x0&&!_0x5c4470['journeysOnly']&&console[_0x3912b4(0x185)]('\x20\x20Activations:\x20'+_0x3cc167[_0x3912b4(0x165)](',\x20'));if(_0x2f7cfe){const _0x3a0fd1=getConsoleNextUrl(_0x5c4470['site'],_0x3912b4(0x169)+_0x59e07f+_0x3912b4(0x151)+_0x2f7cfe+_0x3912b4(0x126));console['error'](_0x3912b4(0x12a)+a41_0x16032b[_0x3912b4(0x118)](_0x3a0fd1));}return 0x0;}}
1
+ const a41_0x11c750=a41_0x1604;(function(_0x4d7958,_0xf117d4){const _0x51aaf5=a41_0x1604,_0x3c0337=_0x4d7958();while(!![]){try{const _0x43a514=-parseInt(_0x51aaf5(0xd2))/0x1*(-parseInt(_0x51aaf5(0xef))/0x2)+parseInt(_0x51aaf5(0xb8))/0x3+parseInt(_0x51aaf5(0x10d))/0x4*(parseInt(_0x51aaf5(0xf8))/0x5)+-parseInt(_0x51aaf5(0xcf))/0x6*(-parseInt(_0x51aaf5(0xdc))/0x7)+parseInt(_0x51aaf5(0x77))/0x8*(-parseInt(_0x51aaf5(0xed))/0x9)+parseInt(_0x51aaf5(0xc4))/0xa+-parseInt(_0x51aaf5(0xce))/0xb*(parseInt(_0x51aaf5(0x7c))/0xc);if(_0x43a514===_0xf117d4)break;else _0x3c0337['push'](_0x3c0337['shift']());}catch(_0x13288a){_0x3c0337['push'](_0x3c0337['shift']());}}}(a41_0x3e10,0xb0dfb));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_0x409a3b 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_0x3e10(){const _0xc9067d=['⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Resolving\x20parent\x20segment\x20\x27','scopedFolderPath','/e/','\x20activations]','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Activations:','\x20updated','1375JcPlsZ','6gJqhzz','type','yellow','6VsfWyE','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','add','folders','push','cyan','Error\x20parsing\x20YAML:\x20','user','Delete\x20journey:','\x20\x20Segments:\x20','269871cKGYRC','\x20\x20📊\x20Segments:','results','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','delete','folderPath','dryRun','\x0aError:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/j/da/je','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Journeys:\x20','segment','updatedAt','setPhase','Scoped\x20to\x20folder:\x20','Fetching\x20existing\x20data...','18ffsnHu','Changes\x20to\x20journey:','397238eslgId','blue','name','/app/ps/','list','red','verbose','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','parent_name','20fwjMiV','\x20\x20Source:\x20','\x20YAML\x20files\x20found','\x20to\x20create','data','green','getJourney','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','diff','\x20unchanged','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','journeys','Fetching\x20connections\x20for\x20name\x20resolution...','createdSegmentIds','message','Parent\x20segment:\x20','existingSegment','Error:\x20','yamlConfig','targetDir','file','1142828Quqgpy','\x20created','Push\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','helpText','journeysOnly','no_parent','parentName','set','660184fhtZAB','connection','getOutputSchemaWithCache','activations','description','281772FueUNw','Source\x20directory:\x20','\x20deleted','paused','.yaml','dim','map','segmentFolderId','createdAt','isNew','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','listJourneysWithDetailsFromParentSegment','📁\x20','Delete\x20segment:','listActivations','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20folders\x20to\x20create','(Journey\x20will\x20be\x20deleted)','segment:push','toDelete','relationships','new','Folders\x20to\x20create:','journeyBundleName','toUpdate','updated','existingJourney','journeyId','nameToType','filePath','Error:\x20Directory\x20not\x20found:\x20','parentSegment','filter','\x20\x20\x20\x20','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','toString','changed','\x20new','deleted','parentFolder','get','then','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Changes\x20to:','repeat','join','No\x20','.yml','site','\x0aValidation\x20failed:','cwd','\x20changed','created','\x0aPush\x20summary\x20for\x20\x27','\x20to\x20delete','isScoped','length','segments','New\x20segment:','3934227TzIaKD','attributes','unchanged','error','journey','\x20\x20🗺️\x20\x20Journeys:','nameToId','endsWith','resolveParentId','versionNumber','Aborted.','Preparing\x20journeys...','1401420ZLYGbR','Fetching\x20existing\x20activations...'];a41_0x3e10=function(){return _0xc9067d;};return a41_0x3e10();}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';function a41_0x1604(_0x2db875,_0x5890d8){_0x2db875=_0x2db875-0x75;const _0x3e10d0=a41_0x3e10();let _0x1604cd=_0x3e10d0[_0x2db875];return _0x1604cd;}export class SegmentPushCommand extends BaseCommand{[a41_0x11c750(0xf1)]=a41_0x11c750(0x8e);[a41_0x11c750(0x7b)]=a41_0x11c750(0xe4);async[a41_0x11c750(0x9e)](_0xd1d369){const _0x21f187=a41_0x11c750,{options:_0x2b0f43,args:_0x49ec45,tdx:_0x1fcfd8}=_0xd1d369,_0x3e8406=_0x2b0f43,_0x45e230=await resolveTarget({'arg':_0x49ec45[0x0],'contextParent':_0x2b0f43[_0x21f187(0x9b)],'cwd':process[_0x21f187(0xaf)]()});if(!isSuccessfulResolution(_0x45e230))return _0x45e230['errorCode']===_0x21f187(0x113)?(console['error'](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xcb))),console[_0x21f187(0xbb)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error'](_0x21f187(0x8b)),console[_0x21f187(0xbb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0x109)+_0x45e230[_0x21f187(0x106)]+'\x0a')),_0x45e230[_0x21f187(0x111)]&&console[_0x21f187(0xbb)](a41_0x409a3b['cyan'](_0x45e230[_0x21f187(0x111)]))),0x1;if(_0x45e230[_0x21f187(0xd0)]===_0x21f187(0xf7))return console[_0x21f187(0xbb)](a41_0x409a3b['red'](_0x21f187(0x9a)+_0x45e230[_0x21f187(0x10b)]+'\x0a')),console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd7)](_0x21f187(0xa7))),0x1;const _0x50e828=_0x45e230[_0x21f187(0x75)],_0x1d274c=_0x45e230[_0x21f187(0x10b)],_0x6f8809=_0x45e230[_0x21f187(0xd0)]===_0x21f187(0x10c)?_0x45e230[_0x21f187(0x99)]:undefined,_0xe28f78=getScopedDetails(_0x45e230),_0x32c5b8=_0xe28f78?.[_0x21f187(0xb4)]??![],_0x413d1b=_0xe28f78?.[_0x21f187(0xc8)]??'';if(!existsSync(_0x1d274c))return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0x9a)+_0x1d274c+'\x0a')),console['error'](a41_0x409a3b[_0x21f187(0xd7)](_0x21f187(0xa7))),0x1;_0x3e8406[_0x21f187(0xf5)]&&(console[_0x21f187(0xbb)]('Site:\x20'+_0x3e8406[_0x21f187(0xad)]),console[_0x21f187(0xbb)](_0x21f187(0x107)+_0x50e828),console['error'](_0x21f187(0x7d)+_0x1d274c),_0x32c5b8&&console[_0x21f187(0xbb)](_0x21f187(0xeb)+_0x413d1b));const _0x4e9782=await withSpinner(_0x21f187(0xc7)+_0x50e828+'\x27...',()=>_0x1fcfd8[_0x21f187(0xe8)][_0x21f187(0xc0)](_0x50e828),{'verbose':_0x3e8406[_0x21f187(0xf5)]}),_0x552421=_0x4e9782['data'],{parentSegmentResult:_0x261228,segmentsResult:_0x909c84,foldersResult:_0x3bde4d,journeysWithDetailsResult:_0x2a6a67,userMaps:_0x401aca}=await withSpinner(_0x21f187(0xec),async()=>{const _0x6820d9=_0x21f187,[_0x2adb3b,_0x5ad769,_0x3069ca,_0x4626c0,_0x40e7f3]=await Promise['all']([_0x1fcfd8[_0x6820d9(0xe8)]['getParent'](_0x552421),_0x1fcfd8[_0x6820d9(0xe8)]['listSegments'](_0x552421),_0x1fcfd8[_0x6820d9(0xe8)]['listFolders'](_0x552421),_0x1fcfd8[_0x6820d9(0xbc)][_0x6820d9(0x87)](_0x552421,{'includeAllVersions':!![]}),_0x1fcfd8[_0x6820d9(0xd9)]['buildUserMaps']()]);return{'parentSegmentResult':_0x2adb3b,'segmentsResult':_0x5ad769,'foldersResult':_0x3069ca,'journeysWithDetailsResult':_0x4626c0,'userMaps':_0x40e7f3};},{'verbose':_0x3e8406[_0x21f187(0xf5)]})[_0x21f187(0xa6)](_0x1bca52=>_0x1bca52['data']),_0x5acc68=_0x261228,_0x63f345=extractRootFolderId(_0x5acc68),_0x50c0e5=_0x909c84,_0x461481=_0x3bde4d,{journeys:_0x1644a6,activationStepsById:_0x264605}=_0x2a6a67,_0x508802=new Map(_0x1644a6[_0x21f187(0x82)](_0x326d1f=>[_0x326d1f['id'],_0x326d1f])),_0x49391f=_0x1644a6[_0x21f187(0x82)](_0x552521=>({'id':_0x552521['id'],'name':_0x552521[_0x21f187(0xb9)][_0x21f187(0xf1)],'journeyBundleName':_0x552521['attributes'][_0x21f187(0x93)]||'','journeyBundleId':_0x552521[_0x21f187(0xb9)]['journeyBundleId']||'','versionNumber':_0x552521[_0x21f187(0xb9)][_0x21f187(0xc1)],'description':_0x552521[_0x21f187(0xb9)][_0x21f187(0x7b)],'state':_0x552521[_0x21f187(0xb9)]['state'],'paused':_0x552521[_0x21f187(0xb9)][_0x21f187(0x7f)],'audienceId':_0x552521[_0x21f187(0xb9)]['audienceId'],'folderId':_0x552521[_0x21f187(0x90)]?.[_0x21f187(0xa4)]?.['data']?.['id'],'createdAt':_0x552521[_0x21f187(0xb9)][_0x21f187(0x84)],'updatedAt':_0x552521[_0x21f187(0xb9)][_0x21f187(0xe9)]})),{emailToId:_0x37f1b9,idToEmail:_0x3b2e50}=_0x401aca,_0x1097e5=await withSpinner(_0x21f187(0x104),async()=>{const _0x5e8dd8=_0x21f187,_0x1c3804=await _0x1fcfd8[_0x5e8dd8(0x78)][_0x5e8dd8(0xf3)]();return buildConnectionMaps(_0x1c3804);},{'verbose':_0x3e8406['verbose']})[_0x21f187(0xa6)](_0x3ebd92=>_0x3ebd92['data']),_0x4392b2=_0x1097e5[_0x21f187(0xbe)],_0x1361e8=_0x1097e5['idToName'],_0x3888fa=_0x1097e5[_0x21f187(0x98)],_0x259121={'emailToIdMap':_0x37f1b9,'connectionNameToIdMap':_0x4392b2,'connectionNameToTypeMap':_0x3888fa,'getSchema':_0x58fa36=>_0x1fcfd8[_0x21f187(0x78)][_0x21f187(0x79)](_0x58fa36)};let {pathToId:_0x3936d7,idToPath:_0x37fcc2}=buildFolderMaps(_0x461481);const _0x76623f=buildSegmentLookupMap(_0x50c0e5,_0x37fcc2),_0xd0080a=buildSegmentNameToIdMap(_0x50c0e5),_0xcdde04=buildJourneyBundleLookupMap(_0x49391f,_0x37fcc2);let _0x2017fc;if(_0x6f8809){if(!_0x6f8809['endsWith'](_0x21f187(0xac))&&!_0x6f8809[_0x21f187(0xbf)](_0x21f187(0x80)))return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x6f8809+'\x0a')),0x1;_0x2017fc=[_0x6f8809];}else _0x2017fc=findYamlFiles(_0x1d274c);if(_0x2017fc[_0x21f187(0xb5)]===0x0)return console['error'](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0xff)+_0x1d274c+'\x0a')),console[_0x21f187(0xbb)](a41_0x409a3b['cyan'](_0x21f187(0xf6))),0x1;let _0xbf8fac,_0x450dda;try{const _0x42d30b=parseAndClassifyYamlFiles(_0x2017fc,_0x1d274c,{'skipSegments':_0x3e8406[_0x21f187(0x112)]});_0xbf8fac=_0x42d30b[_0x21f187(0xb6)],_0x450dda=_0x42d30b[_0x21f187(0x103)];const _0x295bb5=validateParsedFiles(_0x42d30b,_0x1d274c);if(_0x295bb5[_0x21f187(0xb5)]>0x0)return console[_0x21f187(0xbb)](a41_0x409a3b['red'](_0x21f187(0xae))),console[_0x21f187(0xbb)](formatValidationErrors(_0x295bb5)),console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xd3))),0x1;}catch(_0x5488b1){return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0xd8)+(_0x5488b1 instanceof Error?_0x5488b1[_0x21f187(0x106)]:_0x5488b1))),0x1;}if(_0xbf8fac[_0x21f187(0xb5)]===0x0&&_0x450dda[_0x21f187(0xb5)]===0x0){const _0x5ac3c9=_0x3e8406[_0x21f187(0x112)]?_0x21f187(0xbc):'segment\x20or\x20journey';return console[_0x21f187(0xbb)](a41_0x409a3b['yellow'](_0x21f187(0xab)+_0x5ac3c9+_0x21f187(0xfa))),0x0;}const _0x8b9ab7=new Map();_0x50c0e5[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)]&&await withSpinner(_0x21f187(0xc5),async()=>{await batchAsync(_0x50c0e5,async _0x17f4ef=>{const _0x3c2278=a41_0x1604,_0x5df7fa=await _0x1fcfd8[_0x3c2278(0xe8)][_0x3c2278(0x8a)](_0x552421,_0x17f4ef['id']);_0x8b9ab7[_0x3c2278(0x76)](_0x17f4ef['id'],_0x5df7fa);});},{'verbose':_0x3e8406[_0x21f187(0xf5)]});const {segmentFiles:_0xcf4a08,foldersToCreate:_0x2870a6}=await prepareSegmentFiles(_0xbf8fac,{'segmentByFolderAndName':_0x76623f,'activationsBySegmentId':_0x8b9ab7,'folderPathToId':_0x3936d7,'idToEmailMap':_0x3b2e50,'connectionIdToNameMap':_0x1361e8},_0x259121,_0x32c5b8,_0x413d1b),_0x555acf=_0x6f8809?[]:findSegmentsToDelete(_0x50c0e5,_0xbf8fac[_0x21f187(0x82)](({yamlConfig:_0x3f1503,folderPath:_0x3b4aa3})=>({'yamlConfig':_0x3f1503,'folderPath':resolveTDFolderPath(_0x3b4aa3,_0x32c5b8,_0x413d1b)})),_0x37fcc2,_0x413d1b,_0x32c5b8),{journeyFiles:_0x1d2a39,foldersToCreate:_0x524ae9}=await withProgressSpinner(_0x21f187(0xc3),async _0x3c6635=>prepareJourneyFiles(_0x450dda,{'fetchJourney':async _0x50e5f9=>_0x1fcfd8[_0x21f187(0xbc)][_0x21f187(0xfe)](_0x50e5f9[_0x21f187(0x97)]),'journeyBundlesByFolderAndName':_0xcdde04,'folderPathToId':_0x3936d7,'idToEmailMap':_0x3b2e50,'connectionIdToNameMap':_0x1361e8,'existingSegments':_0x50c0e5,'parentId':_0x552421,'deps':_0x1fcfd8,'progress':{'update':_0x2851e6=>{const _0x151020=_0x21f187;_0x3c6635[_0x151020(0xea)](_0x2851e6),_0x3e8406[_0x151020(0xf5)]&&console[_0x151020(0xbb)]('\x20\x20'+_0x2851e6);}},'journeyById':_0x508802,'activationStepsById':_0x264605},_0x32c5b8,_0x413d1b),{'verbose':_0x3e8406[_0x21f187(0xf5)]})[_0x21f187(0xa6)](_0x9b9018=>_0x9b9018[_0x21f187(0xfc)]);for(const _0x1c71ef of _0x524ae9){_0x2870a6[_0x21f187(0xd4)](_0x1c71ef);}const _0x4bf4dd=_0x6f8809?[]:findJourneysToDelete(_0x49391f,_0x450dda['map'](({yamlConfig:_0x5240aa,folderPath:_0x6e91c8})=>({'yamlConfig':_0x5240aa,'folderPath':resolveTDFolderPath(_0x6e91c8,_0x32c5b8,_0x413d1b)})),_0x37fcc2,_0x413d1b,_0x32c5b8),_0x14c039=calculatePushStats(_0xcf4a08,_0x1d2a39,_0x2870a6,_0x555acf,_0x4bf4dd,!!_0x3e8406[_0x21f187(0xe0)],!!_0x3e8406[_0x21f187(0x112)]),_0x3985f9=_0x14c039[_0x21f187(0xb6)]['new'],_0x12fbd7=_0x14c039[_0x21f187(0xb6)][_0x21f187(0xa1)],_0x4b0e6f=_0x14c039[_0x21f187(0xb6)][_0x21f187(0xba)],_0x3a72bc=_0x14c039[_0x21f187(0xb6)]['toDelete'],_0x3b94a2=_0x14c039[_0x21f187(0xd5)]['toCreate'],_0x3d9c77=_0x14c039[_0x21f187(0x103)][_0x21f187(0x91)],_0x428a9a=_0x14c039[_0x21f187(0x103)]['changed'],_0x3b4339=_0x14c039[_0x21f187(0x103)][_0x21f187(0xba)],_0xe6058=_0x14c039[_0x21f187(0x103)][_0x21f187(0x8f)],_0x529914=_0x14c039[_0x21f187(0x7a)]['all'],_0x18f996=_0x14c039[_0x21f187(0x7a)]['toCreate'],_0x123b65=_0x14c039['activations'][_0x21f187(0x94)],_0x5c3e04=_0x14c039[_0x21f187(0x7a)][_0x21f187(0x8f)];console[_0x21f187(0xbb)](_0x21f187(0xb2)+_0x50e828+'\x27:');_0x3b94a2[_0x21f187(0xb5)]>0x0&&console['error']('\x20\x20'+a41_0x409a3b['blue'](_0x21f187(0x88)+_0x3b94a2['length']+_0x21f187(0x8c)));if(!_0x3e8406[_0x21f187(0x112)]){console[_0x21f187(0xbb)](_0x21f187(0xdd)),console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xfd)]('+\x20'+_0x3985f9[_0x21f187(0xb5)]+_0x21f187(0xa2))),console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xd1)]('~\x20'+_0x12fbd7['length']+_0x21f187(0xb0)));if(_0x3a72bc[_0x21f187(0xb5)]>0x0)console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0xf4)]('-\x20'+_0x3a72bc[_0x21f187(0xb5)]+'\x20to\x20delete'));else _0x555acf['length']>0x0&&!_0x3e8406[_0x21f187(0xe0)]&&console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b['dim'](_0x555acf['length']+_0x21f187(0xe6)));console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0x81)]('=\x20'+_0x4b0e6f[_0x21f187(0xb5)]+_0x21f187(0x101)));}if(_0x1d2a39['length']>0x0||_0x4bf4dd[_0x21f187(0xb5)]>0x0){console['error'](_0x21f187(0xbd)),console['error'](_0x21f187(0x9d)+a41_0x409a3b['green']('+\x20'+_0x3d9c77[_0x21f187(0xb5)]+'\x20new')),console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0xd1)]('~\x20'+_0x428a9a['length']+'\x20changed'));if(_0xe6058[_0x21f187(0xb5)]>0x0)console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xf4)]('-\x20'+_0xe6058[_0x21f187(0xb5)]+_0x21f187(0xb3)));else _0x4bf4dd[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0xe0)]&&console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0x81)](_0x4bf4dd[_0x21f187(0xb5)]+_0x21f187(0xe6)));console['error'](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0x81)]('=\x20'+_0x3b4339[_0x21f187(0xb5)]+_0x21f187(0x101)));}_0x529914[_0x21f187(0xb5)]>0x0&&!_0x3e8406['journeysOnly']&&(console[_0x21f187(0xbb)](''),console['error'](_0x21f187(0xcc)),_0x18f996[_0x21f187(0xb5)]>0x0&&console['error'](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xfd)]('+\x20'+_0x18f996['length']+_0x21f187(0xfb))),_0x123b65['length']>0x0&&console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xd1)]('~\x20'+_0x123b65[_0x21f187(0xb5)]+'\x20to\x20update')),_0x5c3e04[_0x21f187(0xb5)]>0x0&&console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0xf4)]('-\x20'+_0x5c3e04[_0x21f187(0xb5)]+_0x21f187(0xb3))));console[_0x21f187(0xbb)](_0x21f187(0xf9)+a41_0x409a3b[_0x21f187(0xd7)](_0x1d274c)+'\x0a');if(_0x3b94a2[_0x21f187(0xb5)]>0x0){console[_0x21f187(0xbb)](_0x21f187(0x92));for(const _0x232d7c of _0x3b94a2){console['error']('\x20\x20'+a41_0x409a3b['blue']('+')+'\x20'+_0x232d7c);}console[_0x21f187(0xbb)]('');}if(_0x3985f9[_0x21f187(0xb5)]>0x0&&!_0x3e8406['journeysOnly'])for(const _0x3c74f6 of _0x3985f9){const _0x44b2d6=_0x3c74f6[_0x21f187(0xe1)]?_0x3c74f6[_0x21f187(0xe1)]+'/'+_0x3c74f6[_0x21f187(0x10a)][_0x21f187(0xf1)]:_0x3c74f6[_0x21f187(0x10a)][_0x21f187(0xf1)],_0x3b218a=_0x3c74f6[_0x21f187(0x10a)][_0x21f187(0x7a)]?.[_0x21f187(0xb5)]||0x0,_0x1a9d7b=_0x3b218a>0x0?a41_0x409a3b['dim']('\x20['+_0x3b218a+_0x21f187(0xca)):'';console['error']('\x0a'+a41_0x409a3b[_0x21f187(0xfd)](_0x21f187(0xb7))+'\x20'+_0x44b2d6+_0x1a9d7b),console[_0x21f187(0xbb)]('─'['repeat'](0x3c)),_0x3c74f6['diff']&&console['error'](_0x3c74f6[_0x21f187(0x100)]),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));}if(_0x3a72bc[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)])for(const _0x584ace of _0x3a72bc){const _0x1089a6=_0x584ace[_0x21f187(0x83)]?_0x37fcc2['get'](_0x584ace[_0x21f187(0x83)][_0x21f187(0xa0)]())||'':'',_0x32040b=_0x1089a6?_0x1089a6+'/'+_0x584ace['name']:_0x584ace[_0x21f187(0xf1)],_0x732ae4=_0x8b9ab7[_0x21f187(0xa5)](_0x584ace['id'])||[],_0x1749f1=_0x732ae4[_0x21f187(0xb5)]>0x0?a41_0x409a3b['dim']('\x20['+_0x732ae4[_0x21f187(0xb5)]+_0x21f187(0xca)):'';console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b['red'](_0x21f187(0x89))+'\x20'+_0x32040b+_0x1749f1),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));const _0x15b789=segmentWithActivationsToYaml(_0x584ace,_0x732ae4,undefined,_0x3b2e50,_0x1361e8),_0x3587f7=segmentToYamlString(_0x15b789),_0x470269=generateDiff(_0x3587f7,'');console[_0x21f187(0xbb)](formatDiffWithColors(_0x470269)),console['error']('─'[_0x21f187(0xa9)](0x3c));}const _0x2c710e=_0xcf4a08[_0x21f187(0x9c)](_0x35538e=>!_0x35538e[_0x21f187(0x85)]&&_0x35538e[_0x21f187(0x100)]);if(_0x2c710e[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)])for(const _0x5cc286 of _0x2c710e){const _0x3d9803=_0x5cc286[_0x21f187(0xe1)]?_0x5cc286['folderPath']+'/'+_0x5cc286[_0x21f187(0x10a)][_0x21f187(0xf1)]:_0x5cc286[_0x21f187(0x10a)][_0x21f187(0xf1)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xa8))+'\x20'+_0x3d9803),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c)),console[_0x21f187(0xbb)](_0x5cc286[_0x21f187(0x100)]),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));}if(_0x3d9c77['length']>0x0)for(const _0x299420 of _0x3d9c77){const _0x3b725c=_0x299420[_0x21f187(0xe1)]?_0x299420[_0x21f187(0xe1)]+'/'+_0x299420['yamlConfig'][_0x21f187(0xf1)]:_0x299420['yamlConfig'][_0x21f187(0xf1)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xfd)]('New\x20journey:')+'\x20'+_0x3b725c),console['error']('─'[_0x21f187(0xa9)](0x3c)),_0x299420[_0x21f187(0x100)]&&console[_0x21f187(0xbb)](_0x299420[_0x21f187(0x100)]),console['error']('─'[_0x21f187(0xa9)](0x3c));}const _0x32a8ea=_0x1d2a39[_0x21f187(0x9c)](_0x255b3c=>!_0x255b3c[_0x21f187(0x85)]&&_0x255b3c[_0x21f187(0x100)]);if(_0x32a8ea[_0x21f187(0xb5)]>0x0)for(const _0x338300 of _0x32a8ea){const _0x37077f=_0x338300[_0x21f187(0xe1)]?_0x338300[_0x21f187(0xe1)]+'/'+_0x338300[_0x21f187(0x10a)][_0x21f187(0xf1)]:_0x338300['yamlConfig'][_0x21f187(0xf1)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xee))+'\x20'+_0x37077f),console[_0x21f187(0xbb)]('─'['repeat'](0x3c)),console[_0x21f187(0xbb)](_0x338300['diff']),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));}if(_0xe6058[_0x21f187(0xb5)]>0x0)for(const _0x3befb4 of _0xe6058){const _0x598233=_0x3befb4['folderId']?_0x37fcc2[_0x21f187(0xa5)](_0x3befb4['folderId'])||'':'',_0x2f196a=_0x598233?_0x598233+'/'+_0x3befb4[_0x21f187(0x93)]:_0x3befb4[_0x21f187(0x93)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0xda))+'\x20'+_0x2f196a),console['error']('─'[_0x21f187(0xa9)](0x3c)),console[_0x21f187(0xbb)](a41_0x409a3b['red'](_0x21f187(0x8d))),console[_0x21f187(0xbb)]('─'['repeat'](0x3c));}if(_0x3e8406[_0x21f187(0xe2)])return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0x102))),0x0;const _0x28ecc4=_0x3e8406[_0x21f187(0x112)]?![]:_0x3985f9['length']>0x0||_0x12fbd7[_0x21f187(0xb5)]>0x0||_0x3a72bc[_0x21f187(0xb5)]>0x0,_0x178886=_0x3d9c77[_0x21f187(0xb5)]>0x0||_0x428a9a['length']>0x0||_0xe6058['length']>0x0,_0x28a50b=_0x3e8406[_0x21f187(0x112)]?![]:_0x529914['length']>0x0,_0x473ba3=_0x3b94a2[_0x21f187(0xb5)]>0x0;if(!_0x28ecc4&&!_0x178886&&!_0x28a50b&&!_0x473ba3){const _0x5a7c1e=_0x3e8406[_0x21f187(0x112)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x21f187(0x110);console['error'](a41_0x409a3b[_0x21f187(0xfd)](_0x5a7c1e));if(_0x6f8809&&_0x4b0e6f['length']===0x1){const _0x1eb594=_0x4b0e6f[0x0];if(_0x1eb594[_0x21f187(0x108)]?.['id']){const _0x477415=getConsoleNextUrl(_0x3e8406['site'],_0x21f187(0xf2)+_0x552421+'/e/'+_0x1eb594[_0x21f187(0x108)]['id']+'/sb/da/esr');console['error'](_0x21f187(0x86)+a41_0x409a3b['cyan'](_0x477415));}}if(_0x6f8809&&_0x3b4339['length']===0x1){const _0x164926=_0x3b4339[0x0];if(_0x164926[_0x21f187(0x96)]?.['id']){const _0x27fda4=getConsoleNextUrl(_0x3e8406['site'],'/app/ps/'+_0x552421+_0x21f187(0xc9)+_0x164926[_0x21f187(0x96)]['id']+_0x21f187(0xe5));console[_0x21f187(0xbb)]('\x20\x20'+a41_0x409a3b['cyan'](_0x27fda4));}}return 0x0;}const _0x5c741a=_0x3e8406['journeysOnly']?_0x3d9c77[_0x21f187(0xb5)]+_0x428a9a[_0x21f187(0xb5)]+_0xe6058[_0x21f187(0xb5)]+_0x3b94a2[_0x21f187(0xb5)]:_0x3985f9[_0x21f187(0xb5)]+_0x12fbd7['length']+_0x3a72bc['length']+_0x3d9c77[_0x21f187(0xb5)]+_0x428a9a[_0x21f187(0xb5)]+_0xe6058['length']+_0x3b94a2[_0x21f187(0xb5)]+_0x529914['length'];if(!_0x3e8406['yes']&&_0x5c741a>0x0){if(!isInteractive())return console['error'](a41_0x409a3b['red'](_0x21f187(0xe3)),_0x21f187(0x9f)),console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0x81)](_0x21f187(0xdf))),0x1;const _0x1c1ea2=await confirmKey(_0x21f187(0x10f)+_0x5c741a+'\x20changes?');if(!_0x1c1ea2)return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xc2))),0x1;}const _0x54af5b={'withProgress':async(_0x1c0916,_0x37a470)=>{const _0x40c91a=_0x21f187,_0x4051ed=await withSpinner(_0x1c0916,_0x37a470,{'verbose':_0x3e8406[_0x40c91a(0xf5)]});return{'data':_0x4051ed['data']};},'logInfo':_0x322a09=>console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf0)]('✔\x20'+_0x322a09)),'logSuccess':_0x5109a8=>console['error'](a41_0x409a3b[_0x21f187(0xfd)]('✔\x20'+_0x5109a8)),'logWarning':_0x514d0e=>console[_0x21f187(0xbb)](a41_0x409a3b['yellow']('⚠\x20'+_0x514d0e)),'logDeleted':_0x1539cb=>console[_0x21f187(0xbb)](a41_0x409a3b['red']('✔\x20'+_0x1539cb))},_0x45b0aa={'segment':_0x1fcfd8['segment'],'journey':_0x1fcfd8['journey'],'user':_0x1fcfd8['user'],'connection':_0x1fcfd8[_0x21f187(0x78)]};_0x3b94a2[_0x21f187(0xb5)]>0x0&&(_0x3936d7=await executePushFolders(_0x45b0aa,_0x3b94a2,_0x3936d7,{'parentId':_0x552421},_0x54af5b));const _0x1259d7={'rootFolderId':_0x63f345,'folderPathToId':_0x3936d7,'folderIdToPath':_0x37fcc2,'segmentNameToId':_0xd0080a,'activationsBySegmentId':_0x8b9ab7,'emailToIdMap':_0x37f1b9,'idToEmailMap':_0x3b2e50,'connectionNameToIdMap':_0x1097e5[_0x21f187(0xbe)],'connectionIdToNameMap':_0x1097e5['idToName'],'connectionNameToTypeMap':_0x3888fa},_0x35a3fb=await executePushSegments(_0x45b0aa,_0x3e8406['journeysOnly']?[]:_0xcf4a08,_0x1259d7,{'parentId':_0x552421},_0x54af5b),_0x22a77f=_0x35a3fb[_0x21f187(0xb1)],_0x21fbaf=_0x35a3fb[_0x21f187(0x95)],_0x24968a=_0x35a3fb[_0x21f187(0x7a)][_0x21f187(0xb1)],_0x46dd96=_0x35a3fb[_0x21f187(0x7a)][_0x21f187(0x95)],_0x1cd1b5=_0x35a3fb[_0x21f187(0x7a)][_0x21f187(0xa3)];let _0x1f1ab3;if(_0x6f8809&&_0xcf4a08[_0x21f187(0xb5)]===0x1){const _0x3d7cc5=_0xcf4a08[0x0];_0x1f1ab3=_0x3d7cc5[_0x21f187(0x108)]?.['id']??_0x35a3fb[_0x21f187(0x105)][_0x21f187(0xa5)](_0x3d7cc5[_0x21f187(0x10a)][_0x21f187(0xf1)]);}const _0x2d03f2=await executePushSegmentDeletions(_0x45b0aa,_0x3e8406[_0x21f187(0x112)]?[]:_0x3a72bc,_0x54af5b);let _0x4d4b5d=0x0,_0x37561c=0x0,_0x42937c=0x0;const _0x1e223e=new Map(_0xd0080a);for(const [_0x546d5f,_0x28b1e8]of _0x35a3fb[_0x21f187(0x105)]){_0x1e223e[_0x21f187(0x76)](_0x546d5f,_0x28b1e8);}if(_0x1d2a39[_0x21f187(0xb5)]>0x0){const _0x27ec5f={..._0x1259d7,'segmentNameToId':_0x1e223e,'existingSegments':_0x50c0e5,'activationContext':_0x259121},_0x5d0b54=await executePushJourneys(_0x45b0aa,_0x1d2a39,_0x27ec5f,{'parentId':_0x552421,'rootFolderId':_0x63f345,'verbose':_0x3e8406[_0x21f187(0xf5)]},_0x54af5b);_0x4d4b5d=_0x5d0b54[_0x21f187(0xb1)],_0x37561c=_0x5d0b54[_0x21f187(0x95)];if(_0x6f8809&&_0x5d0b54['results']['length']===0x1){const _0x4b2c96=_0x5d0b54[_0x21f187(0xde)][0x0];if(_0x4b2c96[_0x21f187(0x97)]){const _0x2d911a=getConsoleNextUrl(_0x3e8406[_0x21f187(0xad)],_0x21f187(0xf2)+_0x552421+_0x21f187(0xc9)+_0x4b2c96['journeyId']+_0x21f187(0xe5));console[_0x21f187(0xbb)]('\x20\x20'+a41_0x409a3b[_0x21f187(0xd7)](_0x2d911a));}}}for(const _0x41db65 of _0xe6058){console[_0x21f187(0xbb)](a41_0x409a3b['yellow'](_0x21f187(0xc6)+_0x41db65[_0x21f187(0x93)])),_0x42937c++;}const _0x239f2b=[];if(_0x22a77f>0x0)_0x239f2b[_0x21f187(0xd6)](_0x22a77f+_0x21f187(0x10e));if(_0x21fbaf>0x0)_0x239f2b[_0x21f187(0xd6)](_0x21fbaf+_0x21f187(0xcd));if(_0x2d03f2>0x0)_0x239f2b[_0x21f187(0xd6)](_0x2d03f2+_0x21f187(0x7e));const _0x686006=[];if(_0x4d4b5d>0x0)_0x686006[_0x21f187(0xd6)](_0x4d4b5d+_0x21f187(0x10e));if(_0x37561c>0x0)_0x686006[_0x21f187(0xd6)](_0x37561c+_0x21f187(0xcd));if(_0x42937c>0x0)_0x686006[_0x21f187(0xd6)](_0x42937c+'\x20deleted');const _0x50f46b=[];if(_0x24968a>0x0)_0x50f46b[_0x21f187(0xd6)](_0x24968a+'\x20created');if(_0x46dd96>0x0)_0x50f46b[_0x21f187(0xd6)](_0x46dd96+_0x21f187(0xcd));if(_0x1cd1b5>0x0)_0x50f46b['push'](_0x1cd1b5+'\x20deleted');console[_0x21f187(0xbb)](a41_0x409a3b['green']('\x0a✔\x20Push\x20complete'));_0x239f2b[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)]&&console[_0x21f187(0xbb)](_0x21f187(0xdb)+_0x239f2b['join'](',\x20'));_0x686006[_0x21f187(0xb5)]>0x0&&console['error'](_0x21f187(0xe7)+_0x686006['join'](',\x20'));_0x50f46b['length']>0x0&&!_0x3e8406[_0x21f187(0x112)]&&console[_0x21f187(0xbb)]('\x20\x20Activations:\x20'+_0x50f46b[_0x21f187(0xaa)](',\x20'));if(_0x1f1ab3){const _0x2fd692=getConsoleNextUrl(_0x3e8406[_0x21f187(0xad)],'/app/ps/'+_0x552421+'/e/'+_0x1f1ab3+'/sb/da/esr');console[_0x21f187(0xbb)](_0x21f187(0x86)+a41_0x409a3b[_0x21f187(0xd7)](_0x2fd692));}return 0x0;}}
@@ -1 +1 @@
1
- const a42_0x50dec0=a42_0x58eb;(function(_0x2ee7da,_0x189463){const _0x212a86=a42_0x58eb,_0x599fcc=_0x2ee7da();while(!![]){try{const _0x375d88=parseInt(_0x212a86(0x1cc))/0x1+-parseInt(_0x212a86(0x1a8))/0x2*(parseInt(_0x212a86(0x1ba))/0x3)+-parseInt(_0x212a86(0x1ca))/0x4*(parseInt(_0x212a86(0x1b4))/0x5)+parseInt(_0x212a86(0x1bb))/0x6*(parseInt(_0x212a86(0x1d1))/0x7)+-parseInt(_0x212a86(0x1be))/0x8*(parseInt(_0x212a86(0x1a1))/0x9)+-parseInt(_0x212a86(0x1a6))/0xa*(-parseInt(_0x212a86(0x1d0))/0xb)+-parseInt(_0x212a86(0x1a9))/0xc*(parseInt(_0x212a86(0x1af))/0xd);if(_0x375d88===_0x189463)break;else _0x599fcc['push'](_0x599fcc['shift']());}catch(_0x252f4e){_0x599fcc['push'](_0x599fcc['shift']());}}}(a42_0x2720,0xde009));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a42_0x58eb(_0x52a762,_0x370cb0){_0x52a762=_0x52a762-0x1a0;const _0x272020=a42_0x2720();let _0x58ebf2=_0x272020[_0x52a762];return _0x58ebf2;}import a42_0x59231b from'chalk';function a42_0x2720(){const _0x593b98=['Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','parentId','yellow','data','Parent\x20ID:\x20','1859772IrjxWk','237792ayDOog','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','232SHQyyt','type','verbose','✔\x20Updated\x20segment\x20\x27','includes','resolvePathToResource','Segment\x20ID:\x20','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','kind','segmentId','Error:\x20Cannot\x20update\x20','\x27...','1852wAmADY','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','1723612iGMKco','Examples:','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','description','244123hYCHZR','168fxoQSo','Segment\x20ID\x20missing\x20from\x20resolved\x20path','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','name','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','314307SsbSbE','Resolved\x20folder\x20ID:\x20','resolveFolderId','\x20\x20\x20Path:\x20','error','770klIgoE','folder','2bHGGlt','48PjGgBg','Update\x20existing\x20child\x20segment','INTERNAL','updateSegmentById','Resolved\x20type:\x20','segmentPath','1954069wgkXgz','segment','execute','segment:update','Updating\x20segment\x20\x27','13395vbtLHv'];a42_0x2720=function(){return _0x593b98;};return a42_0x2720();}export class SegmentUpdateCommand extends BaseCommand{['name']=a42_0x50dec0(0x1b2);[a42_0x50dec0(0x1cf)]=a42_0x50dec0(0x1aa);async[a42_0x50dec0(0x1b1)](_0x122aec){const _0x17c7b0=a42_0x50dec0;console[_0x17c7b0(0x1a5)](a42_0x59231b[_0x17c7b0(0x1b7)](_0x17c7b0(0x1ce))),console['error'](a42_0x59231b['yellow'](_0x17c7b0(0x1a0)));const {options:_0x188c32,args:_0xd74a04,tdx:_0x3572c0}=_0x122aec,_0xd10ab=_0x188c32;if(_0xd74a04['length']===0x0)return console['error'](_0x17c7b0(0x1b5)),console['error'](_0x17c7b0(0x1c5)),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1cd)),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1cb)),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1bc)),0x1;const _0x19ab55=_0xd74a04[0x0],_0x408fd7=_0x188c32[_0x17c7b0(0x1ae)];let _0x29acf1=_0x19ab55;_0x408fd7&&!_0x19ab55[_0x17c7b0(0x1c2)]('/')&&(_0x29acf1=_0x408fd7+'/'+_0x19ab55,_0xd10ab[_0x17c7b0(0x1c0)]&&console[_0x17c7b0(0x1a5)]('Resolved\x20relative\x20path\x20to:\x20'+_0x29acf1));const _0x28eb7f=await withSpinner('Resolving\x20path\x20\x27'+_0x29acf1+_0x17c7b0(0x1c9),()=>_0x3572c0[_0x17c7b0(0x1b0)][_0x17c7b0(0x1c3)](_0x29acf1),{'verbose':_0xd10ab[_0x17c7b0(0x1c0)]}),_0x292621=_0x28eb7f[_0x17c7b0(0x1b8)];_0xd10ab[_0x17c7b0(0x1c0)]&&console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1ad)+_0x292621['type']);if(_0x292621[_0x17c7b0(0x1bf)]!==_0x17c7b0(0x1b0))return console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1c8)+_0x292621[_0x17c7b0(0x1bf)]+_0x17c7b0(0x1d3)),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1bd)),0x1;if(!_0x292621[_0x17c7b0(0x1c7)])throw new SDKError(ErrorCode[_0x17c7b0(0x1ab)],_0x17c7b0(0x1d2));const _0x21c4a3=_0x292621[_0x17c7b0(0x1b6)],_0x38b183=_0x292621[_0x17c7b0(0x1c7)];_0xd10ab[_0x17c7b0(0x1c0)]&&(console['error'](_0x17c7b0(0x1b9)+_0x21c4a3),console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1c4)+_0x38b183));let _0x2c65d1;if(_0xd10ab[_0x17c7b0(0x1a7)]){const _0xb95544=_0xd10ab[_0x17c7b0(0x1a7)],_0x2fe81d=await withSpinner('Resolving\x20folder\x20\x27'+_0xb95544+_0x17c7b0(0x1c9),()=>_0x3572c0[_0x17c7b0(0x1b0)][_0x17c7b0(0x1a3)](_0x21c4a3,_0xb95544),{'verbose':_0xd10ab[_0x17c7b0(0x1c0)]});_0x2c65d1=parseInt(_0x2fe81d[_0x17c7b0(0x1b8)],0xa),_0xd10ab[_0x17c7b0(0x1c0)]&&console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1a2)+_0x2c65d1);}const _0x25bf63=await loadJSONFromOptions(_0xd10ab['rule'],_0xd10ab['ruleFile']),_0x360b6c={'name':_0xd10ab[_0x17c7b0(0x1d4)],'description':_0xd10ab[_0x17c7b0(0x1cf)],'rule':_0x25bf63,'kind':_0xd10ab[_0x17c7b0(0x1c6)]!==undefined?parseInt(_0xd10ab['kind'],0xa):undefined,'segmentFolderId':_0x2c65d1},_0x427f53=await withSpinner(_0x17c7b0(0x1b3)+_0x292621['segmentName']+_0x17c7b0(0x1c9),()=>_0x3572c0[_0x17c7b0(0x1b0)][_0x17c7b0(0x1ac)](_0x21c4a3,_0x38b183,_0x360b6c),{'verbose':_0xd10ab[_0x17c7b0(0x1c0)]}),_0x5916fa=_0x427f53[_0x17c7b0(0x1b8)];return console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1c1)+_0x5916fa['name']+'\x27'),_0x29acf1!==_0x19ab55&&console[_0x17c7b0(0x1a5)](_0x17c7b0(0x1a4)+_0x29acf1),await handleSDKOutput([_0x5916fa],_0xd10ab),0x0;}}
1
+ const a42_0x1b0ab3=a42_0x1127;(function(_0x5386a5,_0x396891){const _0x2f43d0=a42_0x1127,_0x55df4b=_0x5386a5();while(!![]){try{const _0xbb52a9=-parseInt(_0x2f43d0(0x1bc))/0x1*(-parseInt(_0x2f43d0(0x1d3))/0x2)+-parseInt(_0x2f43d0(0x1e4))/0x3*(-parseInt(_0x2f43d0(0x1bb))/0x4)+parseInt(_0x2f43d0(0x1d4))/0x5+parseInt(_0x2f43d0(0x1bf))/0x6*(parseInt(_0x2f43d0(0x1d5))/0x7)+parseInt(_0x2f43d0(0x1dc))/0x8*(-parseInt(_0x2f43d0(0x1c7))/0x9)+parseInt(_0x2f43d0(0x1d1))/0xa*(-parseInt(_0x2f43d0(0x1c1))/0xb)+-parseInt(_0x2f43d0(0x1dd))/0xc;if(_0xbb52a9===_0x396891)break;else _0x55df4b['push'](_0x55df4b['shift']());}catch(_0x28295c){_0x55df4b['push'](_0x55df4b['shift']());}}}(a42_0x11ad,0xd01cb));import{BaseCommand}from'./command.js';function a42_0x11ad(){const _0x1bcdc9=['Error:\x20Cannot\x20update\x20','Examples:','✔\x20Updated\x20segment\x20\x27','18xUXWbg','description','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentId','segment:update','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','INTERNAL','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','type','Segment\x20ID:\x20','4470eRUvLk','\x27...','10wPesvx','3787755IpPzaI','35cZBlqu','ruleFile','Resolved\x20relative\x20path\x20to:\x20','\x20\x20\x20Path:\x20','updateSegmentById','includes','resolvePathToResource','4853864llVtgD','23741076eBtJgp','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','resolveFolderId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segmentPath','folder','name','1472301gHzvaj','Resolved\x20type:\x20','segment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Updating\x20segment\x20\x27','execute','length','error','Update\x20existing\x20child\x20segment','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','yellow','data','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','verbose','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','12sFjGzz','291372FHnBIu','rule','Resolving\x20path\x20\x27','2013114FaJnjV','segmentName','32483qudoJe','parentId','Resolving\x20folder\x20\x27'];a42_0x11ad=function(){return _0x1bcdc9;};return a42_0x11ad();}import{handleSDKOutput}from'../core/command-output.js';function a42_0x1127(_0x4bb16e,_0x1552c8){_0x4bb16e=_0x4bb16e-0x1ae;const _0x11ad42=a42_0x11ad();let _0x11275f=_0x11ad42[_0x4bb16e];return _0x11275f;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x4925d7 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x1b0ab3(0x1e3)]=a42_0x1b0ab3(0x1cb);[a42_0x1b0ab3(0x1c8)]=a42_0x1b0ab3(0x1b3);async[a42_0x1b0ab3(0x1b0)](_0x9da67a){const _0x5c5675=a42_0x1b0ab3;console[_0x5c5675(0x1b2)](a42_0x4925d7[_0x5c5675(0x1b5)](_0x5c5675(0x1cc))),console[_0x5c5675(0x1b2)](a42_0x4925d7[_0x5c5675(0x1b5)](_0x5c5675(0x1ba)));const {options:_0x440d55,args:_0x24c8de,tdx:_0x5c31b0}=_0x9da67a,_0x2378cc=_0x440d55;if(_0x24c8de[_0x5c5675(0x1b1)]===0x0)return console['error'](_0x5c5675(0x1ae)),console['error'](_0x5c5675(0x1c9)),console[_0x5c5675(0x1b2)](_0x5c5675(0x1c5)),console[_0x5c5675(0x1b2)](_0x5c5675(0x1ce)),console[_0x5c5675(0x1b2)](_0x5c5675(0x1b4)),0x1;const _0x4c4ec1=_0x24c8de[0x0],_0x3bbb20=_0x440d55[_0x5c5675(0x1e1)];let _0x1cce89=_0x4c4ec1;_0x3bbb20&&!_0x4c4ec1[_0x5c5675(0x1da)]('/')&&(_0x1cce89=_0x3bbb20+'/'+_0x4c4ec1,_0x2378cc[_0x5c5675(0x1b9)]&&console[_0x5c5675(0x1b2)](_0x5c5675(0x1d7)+_0x1cce89));const _0x782712=await withSpinner(_0x5c5675(0x1be)+_0x1cce89+_0x5c5675(0x1d2),()=>_0x5c31b0[_0x5c5675(0x1e6)][_0x5c5675(0x1db)](_0x1cce89),{'verbose':_0x2378cc['verbose']}),_0x1143f7=_0x782712[_0x5c5675(0x1b6)];_0x2378cc[_0x5c5675(0x1b9)]&&console[_0x5c5675(0x1b2)](_0x5c5675(0x1e5)+_0x1143f7['type']);if(_0x1143f7[_0x5c5675(0x1cf)]!=='segment')return console[_0x5c5675(0x1b2)](_0x5c5675(0x1c4)+_0x1143f7[_0x5c5675(0x1cf)]+_0x5c5675(0x1b8)),console[_0x5c5675(0x1b2)](_0x5c5675(0x1de)),0x1;if(!_0x1143f7[_0x5c5675(0x1ca)])throw new SDKError(ErrorCode[_0x5c5675(0x1cd)],_0x5c5675(0x1e0));const _0x35236d=_0x1143f7[_0x5c5675(0x1c2)],_0x787692=_0x1143f7[_0x5c5675(0x1ca)];_0x2378cc[_0x5c5675(0x1b9)]&&(console[_0x5c5675(0x1b2)]('Parent\x20ID:\x20'+_0x35236d),console[_0x5c5675(0x1b2)](_0x5c5675(0x1d0)+_0x787692));let _0x5b61e5;if(_0x2378cc[_0x5c5675(0x1e2)]){const _0x617604=_0x2378cc[_0x5c5675(0x1e2)],_0x28b5f3=await withSpinner(_0x5c5675(0x1c3)+_0x617604+_0x5c5675(0x1d2),()=>_0x5c31b0['segment'][_0x5c5675(0x1df)](_0x35236d,_0x617604),{'verbose':_0x2378cc[_0x5c5675(0x1b9)]});_0x5b61e5=parseInt(_0x28b5f3[_0x5c5675(0x1b6)],0xa),_0x2378cc[_0x5c5675(0x1b9)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x5b61e5);}const _0x430319=await loadJSONFromOptions(_0x2378cc[_0x5c5675(0x1bd)],_0x2378cc[_0x5c5675(0x1d6)]),_0x42f96e={'name':_0x2378cc[_0x5c5675(0x1e3)],'description':_0x2378cc[_0x5c5675(0x1c8)],'rule':_0x430319,'kind':_0x2378cc[_0x5c5675(0x1b7)]!==undefined?parseInt(_0x2378cc[_0x5c5675(0x1b7)],0xa):undefined,'segmentFolderId':_0x5b61e5},_0x5768a5=await withSpinner(_0x5c5675(0x1af)+_0x1143f7[_0x5c5675(0x1c0)]+_0x5c5675(0x1d2),()=>_0x5c31b0['segment'][_0x5c5675(0x1d9)](_0x35236d,_0x787692,_0x42f96e),{'verbose':_0x2378cc[_0x5c5675(0x1b9)]}),_0x1ae080=_0x5768a5[_0x5c5675(0x1b6)];return console[_0x5c5675(0x1b2)](_0x5c5675(0x1c6)+_0x1ae080[_0x5c5675(0x1e3)]+'\x27'),_0x1cce89!==_0x4c4ec1&&console['error'](_0x5c5675(0x1d8)+_0x1cce89),await handleSDKOutput([_0x1ae080],_0x2378cc),0x0;}}
@@ -1 +1 @@
1
- const a43_0x3f9ac0=a43_0x29e2;(function(_0x51029f,_0x2346a9){const _0x36c1e8=a43_0x29e2,_0x163730=_0x51029f();while(!![]){try{const _0x11867a=parseInt(_0x36c1e8(0x9c))/0x1+-parseInt(_0x36c1e8(0xb0))/0x2+parseInt(_0x36c1e8(0xbf))/0x3+-parseInt(_0x36c1e8(0xa3))/0x4*(-parseInt(_0x36c1e8(0x91))/0x5)+-parseInt(_0x36c1e8(0x8c))/0x6*(-parseInt(_0x36c1e8(0x96))/0x7)+-parseInt(_0x36c1e8(0xba))/0x8*(parseInt(_0x36c1e8(0xa4))/0x9)+parseInt(_0x36c1e8(0xa5))/0xa*(-parseInt(_0x36c1e8(0x99))/0xb);if(_0x11867a===_0x2346a9)break;else _0x163730['push'](_0x163730['shift']());}catch(_0x3594cf){_0x163730['push'](_0x163730['shift']());}}}(a43_0x6d97,0x57bc3));import{existsSync,statSync}from'fs';import a43_0x45d99a from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x29e2(_0x1643b2,_0x8176dd){_0x1643b2=_0x1643b2-0x8a;const _0x6d97d4=a43_0x6d97();let _0x29e2e0=_0x6d97d4[_0x1643b2];return _0x29e2e0;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x3f9ac0(0xa2)]=a43_0x3f9ac0(0x92);[a43_0x3f9ac0(0x90)]=a43_0x3f9ac0(0xc2);async[a43_0x3f9ac0(0xa1)](_0x135566){const _0x2325ae=a43_0x3f9ac0,{options:_0x3f1bfe,args:_0x58653,tdx:_0xa27a6b}=_0x135566;if(_0x58653[_0x2325ae(0x8a)]===0x0)return console['error'](a43_0x45d99a['red'](_0x2325ae(0xb4))),console[_0x2325ae(0xb3)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x2325ae(0xb3)](_0x2325ae(0xa9)),console[_0x2325ae(0xb3)](_0x2325ae(0x93)),console['error'](_0x2325ae(0x9f)),console[_0x2325ae(0xb3)](_0x2325ae(0xb1)),console['error'](_0x2325ae(0x8b)),0x1;const _0x1ebdb2=_0x58653[0x0],_0x5899f7=_0x3f1bfe[_0x2325ae(0xa6)];try{if(_0x1ebdb2==='/')return saveSessionContext({'segment_path':undefined},_0x5899f7),console[_0x2325ae(0xa7)](a43_0x45d99a[_0x2325ae(0x98)](_0x2325ae(0xb9))),0x0;if(existsSync(_0x1ebdb2)&&statSync(_0x1ebdb2)['isDirectory']()){let _0x5d0acb;try{_0x5d0acb=findTdxConfig(_0x1ebdb2);}catch{return console[_0x2325ae(0xb3)](a43_0x45d99a[_0x2325ae(0xbb)](_0x2325ae(0xaf)+_0x1ebdb2)),console[_0x2325ae(0xb3)](a43_0x45d99a[_0x2325ae(0x9e)](_0x2325ae(0xae))),0x1;}const _0x467562=_0x5d0acb[_0x2325ae(0x97)][_0x2325ae(0xb8)];return saveSessionContext({'segment_path':_0x467562,'parent_segment':_0x467562},_0x5899f7),console[_0x2325ae(0xa7)](a43_0x45d99a['green'](_0x2325ae(0xac)+a43_0x45d99a['cyan'](_0x467562))),0x0;}const _0x4a4054=_0x3f1bfe[_0x2325ae(0xa8)];let _0x2837ca=_0x1ebdb2;const _0x471064=parsePath(_0x1ebdb2);if(!_0x471064[_0x2325ae(0xbc)]){if(!_0x4a4054)return console[_0x2325ae(0xb3)](a43_0x45d99a['red'](_0x2325ae(0xab))),console['error'](a43_0x45d99a['cyan'](_0x2325ae(0xb2))),0x1;if(_0x1ebdb2==='..'){const _0x32a23f=_0x4a4054['split']('/')[_0x2325ae(0xc0)](0x0,-0x1)[_0x2325ae(0xc4)]('/');_0x2837ca=_0x32a23f||'/';}else _0x1ebdb2==='.'?_0x2837ca=_0x4a4054:_0x2837ca=_0x4a4054+'/'+_0x1ebdb2;_0x3f1bfe[_0x2325ae(0xc1)]&&console[_0x2325ae(0xb3)](_0x2325ae(0xad)+_0x2837ca);}if(_0x2837ca==='/'||_0x2837ca==='')return saveSessionContext({'segment_path':undefined},_0x5899f7),console['log'](a43_0x45d99a['green'](_0x2325ae(0xb9))),0x0;_0x2837ca=normalizePath(_0x2837ca);const _0x1748a8=parsePath(_0x2837ca)[_0x2325ae(0x8e)];if(_0x1748a8[_0x2325ae(0x8a)]===0x0)return saveSessionContext({'segment_path':undefined},_0x5899f7),console['log'](a43_0x45d99a[_0x2325ae(0x98)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3f1bfe[_0x2325ae(0xc1)]&&(console[_0x2325ae(0xb3)]('Site:\x20'+_0x3f1bfe[_0x2325ae(0x94)]),console[_0x2325ae(0xb3)]('Target\x20path:\x20'+_0x2837ca));const _0x4a53a6=await withSpinner(_0x2325ae(0xc3)+_0x2837ca+_0x2325ae(0x9a),()=>_0xa27a6b[_0x2325ae(0x9b)]['resolvePathToResource'](_0x2837ca),{'verbose':_0x3f1bfe[_0x2325ae(0xc1)]}),_0x13756c=_0x4a53a6[_0x2325ae(0x8f)];_0x3f1bfe['verbose']&&(console[_0x2325ae(0xb3)]('Resolved\x20path\x20type:\x20'+_0x13756c[_0x2325ae(0xbe)]),console['error'](_0x2325ae(0xbd)+_0x13756c['parentId']),_0x13756c[_0x2325ae(0xb7)]&&console[_0x2325ae(0xb3)]('Folder\x20ID:\x20'+_0x13756c['folderId']));if(_0x13756c[_0x2325ae(0xbe)]===_0x2325ae(0x9b))return console[_0x2325ae(0xb3)](a43_0x45d99a[_0x2325ae(0xbb)](_0x2325ae(0x95))),console['error']('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a43_0x45d99a[_0x2325ae(0x9e)](_0x2325ae(0xb6)+_0x13756c[_0x2325ae(0xa0)]+(_0x13756c[_0x2325ae(0x8d)]?'/'+_0x13756c['folderPath'][_0x2325ae(0xc4)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x13756c['fullPath'],'parent_segment':_0x13756c[_0x2325ae(0xa0)]},_0x5899f7),console['log'](a43_0x45d99a['green'](_0x2325ae(0xac)+a43_0x45d99a[_0x2325ae(0x9e)](_0x13756c[_0x2325ae(0xaa)]))),_0x3f1bfe[_0x2325ae(0xc1)]&&(console[_0x2325ae(0xb3)](a43_0x45d99a['dim']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x2325ae(0xb3)](a43_0x45d99a[_0x2325ae(0xb5)](_0x2325ae(0x9d)))),0x0;}catch(_0x476418){throw _0x476418;}}}function a43_0x6d97(){const _0x41895e=['session','log','segmentPath','Examples:','fullPath','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','✔\x20Context\x20set\x20to:\x20','Resolved\x20relative\x20path\x20to:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','85060IyzLTW','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','error','Error:\x20Path\x20is\x20required\x0a','dim','Use:\x20tdx\x20segment\x20use\x20','folderId','parent_segment','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','4936VlgkiF','red','isAbsolute','Parent\x20ID:\x20','type','741438hVVOkM','slice','verbose','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Resolving\x20path\x20\x27','join','length','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','102sSkyEU','folderPath','segments','data','description','10155pEXOxt','segment:use','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','site','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','50183jbQRPM','config','green','176EgPwxJ','\x27...','segment','590054tvhQkx','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','cyan','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','parentName','execute','name','848fMbDcK','8856WNXeoy','237890OMtpty'];a43_0x6d97=function(){return _0x41895e;};return a43_0x6d97();}
1
+ const a43_0x1eb773=a43_0x4fc4;(function(_0x3f2abf,_0x2454b9){const _0x27ed6e=a43_0x4fc4,_0x5bdffe=_0x3f2abf();while(!![]){try{const _0x363026=parseInt(_0x27ed6e(0x121))/0x1*(parseInt(_0x27ed6e(0x134))/0x2)+parseInt(_0x27ed6e(0x138))/0x3*(parseInt(_0x27ed6e(0x107))/0x4)+-parseInt(_0x27ed6e(0x12e))/0x5*(parseInt(_0x27ed6e(0x12c))/0x6)+parseInt(_0x27ed6e(0x108))/0x7*(-parseInt(_0x27ed6e(0x118))/0x8)+parseInt(_0x27ed6e(0x12a))/0x9*(-parseInt(_0x27ed6e(0x11b))/0xa)+-parseInt(_0x27ed6e(0x119))/0xb*(parseInt(_0x27ed6e(0x102))/0xc)+parseInt(_0x27ed6e(0x110))/0xd;if(_0x363026===_0x2454b9)break;else _0x5bdffe['push'](_0x5bdffe['shift']());}catch(_0x58e7ca){_0x5bdffe['push'](_0x5bdffe['shift']());}}}(a43_0x2543,0x5e487));import{existsSync,statSync}from'fs';import a43_0x17eaa4 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a43_0x2543(){const _0x23a8ba=['2082311OgFtKG','isAbsolute','589010YkPoef','folderId','data','segment','fullPath','log','1XsoVfV','verbose','Target\x20path:\x20','Site:\x20','segments','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','length','folderPath','config','54XSMfKp','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','12iCzghX','Folder\x20ID:\x20','130415lUExdw','Resolved\x20path\x20type:\x20','Resolved\x20relative\x20path\x20to:\x20','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','parentName','1006524mCJLVQ','green','dim','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','2631iMBGew','parent_segment','resolvePathToResource','48jhdehk','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','isDirectory','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Parent\x20ID:\x20','2728kWcmpw','3843EtRJaC','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','segmentPath','error','name','site','✔\x20Context\x20set\x20to:\x20','Examples:','8894626uXRMJG','execute','split','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','slice','join','cyan','red','3448ctJLGB'];a43_0x2543=function(){return _0x23a8ba;};return a43_0x2543();}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a43_0x4fc4(_0x2cc35b,_0x262ed3){_0x2cc35b=_0x2cc35b-0x101;const _0x2543e9=a43_0x2543();let _0x4fc485=_0x2543e9[_0x2cc35b];return _0x4fc485;}export class SegmentUseCommand extends BaseCommand{[a43_0x1eb773(0x10c)]='segment:use';['description']=a43_0x1eb773(0x137);async[a43_0x1eb773(0x111)](_0x1e2992){const _0x3a7f23=a43_0x1eb773,{options:_0x50e946,args:_0x11eb7d,tdx:_0x1ef584}=_0x1e2992;if(_0x11eb7d[_0x3a7f23(0x127)]===0x0)return console[_0x3a7f23(0x10b)](a43_0x17eaa4['red']('Error:\x20Path\x20is\x20required\x0a')),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x3a7f23(0x10b)](_0x3a7f23(0x10f)),console[_0x3a7f23(0x10b)](_0x3a7f23(0x126)),console[_0x3a7f23(0x10b)](_0x3a7f23(0x103)),console[_0x3a7f23(0x10b)](_0x3a7f23(0x113)),console[_0x3a7f23(0x10b)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x4e7972=_0x11eb7d[0x0],_0x208b02=_0x50e946['session'];try{if(_0x4e7972==='/')return saveSessionContext({'segment_path':undefined},_0x208b02),console[_0x3a7f23(0x120)](a43_0x17eaa4[_0x3a7f23(0x135)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x4e7972)&&statSync(_0x4e7972)[_0x3a7f23(0x104)]()){let _0x5a22b5;try{_0x5a22b5=findTdxConfig(_0x4e7972);}catch{return console[_0x3a7f23(0x10b)](a43_0x17eaa4[_0x3a7f23(0x117)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x4e7972)),console[_0x3a7f23(0x10b)](a43_0x17eaa4['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x17312d=_0x5a22b5[_0x3a7f23(0x129)][_0x3a7f23(0x139)];return saveSessionContext({'segment_path':_0x17312d,'parent_segment':_0x17312d},_0x208b02),console['log'](a43_0x17eaa4[_0x3a7f23(0x135)](_0x3a7f23(0x10e)+a43_0x17eaa4['cyan'](_0x17312d))),0x0;}const _0x4066d3=_0x50e946[_0x3a7f23(0x10a)];let _0x5c0dc9=_0x4e7972;const _0x22008d=parsePath(_0x4e7972);if(!_0x22008d[_0x3a7f23(0x11a)]){if(!_0x4066d3)return console[_0x3a7f23(0x10b)](a43_0x17eaa4[_0x3a7f23(0x117)](_0x3a7f23(0x12b))),console['error'](a43_0x17eaa4[_0x3a7f23(0x116)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x4e7972==='..'){const _0x2797f2=_0x4066d3[_0x3a7f23(0x112)]('/')[_0x3a7f23(0x114)](0x0,-0x1)[_0x3a7f23(0x115)]('/');_0x5c0dc9=_0x2797f2||'/';}else _0x4e7972==='.'?_0x5c0dc9=_0x4066d3:_0x5c0dc9=_0x4066d3+'/'+_0x4e7972;_0x50e946[_0x3a7f23(0x122)]&&console[_0x3a7f23(0x10b)](_0x3a7f23(0x130)+_0x5c0dc9);}if(_0x5c0dc9==='/'||_0x5c0dc9==='')return saveSessionContext({'segment_path':undefined},_0x208b02),console[_0x3a7f23(0x120)](a43_0x17eaa4['green'](_0x3a7f23(0x109))),0x0;_0x5c0dc9=normalizePath(_0x5c0dc9);const _0x3622e3=parsePath(_0x5c0dc9)[_0x3a7f23(0x125)];if(_0x3622e3[_0x3a7f23(0x127)]===0x0)return saveSessionContext({'segment_path':undefined},_0x208b02),console[_0x3a7f23(0x120)](a43_0x17eaa4[_0x3a7f23(0x135)](_0x3a7f23(0x109))),0x0;_0x50e946['verbose']&&(console[_0x3a7f23(0x10b)](_0x3a7f23(0x124)+_0x50e946[_0x3a7f23(0x10d)]),console[_0x3a7f23(0x10b)](_0x3a7f23(0x123)+_0x5c0dc9));const _0x1396b9=await withSpinner('Resolving\x20path\x20\x27'+_0x5c0dc9+'\x27...',()=>_0x1ef584['segment'][_0x3a7f23(0x101)](_0x5c0dc9),{'verbose':_0x50e946[_0x3a7f23(0x122)]}),_0x298497=_0x1396b9[_0x3a7f23(0x11d)];_0x50e946[_0x3a7f23(0x122)]&&(console[_0x3a7f23(0x10b)](_0x3a7f23(0x12f)+_0x298497['type']),console['error'](_0x3a7f23(0x106)+_0x298497['parentId']),_0x298497[_0x3a7f23(0x11c)]&&console[_0x3a7f23(0x10b)](_0x3a7f23(0x12d)+_0x298497['folderId']));if(_0x298497['type']===_0x3a7f23(0x11e))return console['error'](a43_0x17eaa4[_0x3a7f23(0x117)](_0x3a7f23(0x105))),console[_0x3a7f23(0x10b)](_0x3a7f23(0x131)),console[_0x3a7f23(0x10b)](a43_0x17eaa4[_0x3a7f23(0x116)]('Use:\x20tdx\x20segment\x20use\x20'+_0x298497['parentName']+(_0x298497['folderPath']?'/'+_0x298497[_0x3a7f23(0x128)][_0x3a7f23(0x115)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x298497[_0x3a7f23(0x11f)],'parent_segment':_0x298497[_0x3a7f23(0x133)]},_0x208b02),console[_0x3a7f23(0x120)](a43_0x17eaa4[_0x3a7f23(0x135)](_0x3a7f23(0x10e)+a43_0x17eaa4[_0x3a7f23(0x116)](_0x298497[_0x3a7f23(0x11f)]))),_0x50e946[_0x3a7f23(0x122)]&&(console[_0x3a7f23(0x10b)](a43_0x17eaa4[_0x3a7f23(0x136)](_0x3a7f23(0x132))),console[_0x3a7f23(0x10b)](a43_0x17eaa4['dim']('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x1cbd4e){throw _0x1cbd4e;}}}
@@ -1 +1 @@
1
- const a44_0x429531=a44_0x549d;(function(_0x14f2e6,_0x477ff3){const _0x42133b=a44_0x549d,_0x26674d=_0x14f2e6();while(!![]){try{const _0x1991ac=parseInt(_0x42133b(0x20f))/0x1+parseInt(_0x42133b(0x20b))/0x2+-parseInt(_0x42133b(0x212))/0x3+-parseInt(_0x42133b(0x1f9))/0x4+-parseInt(_0x42133b(0x20c))/0x5+parseInt(_0x42133b(0x1f2))/0x6*(parseInt(_0x42133b(0x1f7))/0x7)+parseInt(_0x42133b(0x1f4))/0x8*(parseInt(_0x42133b(0x20e))/0x9);if(_0x1991ac===_0x477ff3)break;else _0x26674d['push'](_0x26674d['shift']());}catch(_0x2b1610){_0x26674d['push'](_0x26674d['shift']());}}}(a44_0x4e0d,0x3fc2a));import{BaseCommand}from'./command.js';function a44_0x549d(_0x18a42e,_0x32e21c){_0x18a42e=_0x18a42e-0x1eb;const _0x4e0d95=a44_0x4e0d();let _0x549d5f=_0x4e0d95[_0x18a42e];return _0x549d5f;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0x4e0d(){const _0x564057=['execute','errors','green','cwd','validCount','297884yiGzdJ','1034405GXMDEi','yellow','1035549JvzfYj','493156NeLdQo','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filePath','1449591LohhyX','type','\x20warning(s)\x20found','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','parentSegment','Error:\x20','):\x20','.yml','valid','✔\x20All\x20','red','error','cyan','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','targetDir','282708MVLwXe','warningCount','40zkIUcT','log','helpText','7oPcYJa','.yaml','1253124IBNzNK','Error:\x20Directory\x20not\x20found:\x20','\x20file(s)\x20with\x20errors,\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','invalidCount','message','segment:validate','length','description','verbose','dim','warnings','\x20valid'];a44_0x4e0d=function(){return _0x564057;};return a44_0x4e0d();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0xe64494 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{['name']=a44_0x429531(0x1ff);[a44_0x429531(0x201)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a44_0x429531(0x206)](_0x2028fb){const _0x159c2b=a44_0x429531,{options:_0x5ed34c,args:_0x20764b}=_0x2028fb,_0x5d6d01=_0x5ed34c,_0x155a1f=await resolveTarget({'arg':_0x20764b[0x0],'contextParent':_0x5ed34c[_0x159c2b(0x216)],'cwd':process[_0x159c2b(0x209)]()});if(!isSuccessfulResolution(_0x155a1f))return _0x155a1f['errorCode']==='no_parent'?(console['error'](a44_0xe64494[_0x159c2b(0x20d)](_0x159c2b(0x1f0))),console[_0x159c2b(0x1ee)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x159c2b(0x1ee)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x159c2b(0x1ee)](_0x159c2b(0x210))):(console[_0x159c2b(0x1ee)](a44_0xe64494['red'](_0x159c2b(0x217)+_0x155a1f[_0x159c2b(0x1fe)]+'\x0a')),_0x155a1f[_0x159c2b(0x1f6)]&&console[_0x159c2b(0x1ee)](a44_0xe64494[_0x159c2b(0x1ef)](_0x155a1f['helpText']))),0x1;const _0xd889da=_0x155a1f[_0x159c2b(0x1f1)],_0x5e6ff0=_0x155a1f[_0x159c2b(0x213)]==='file'?_0x155a1f[_0x159c2b(0x211)]:undefined;if(!_0x5e6ff0&&!existsSync(_0xd889da))return console[_0x159c2b(0x1ee)](a44_0xe64494['red'](_0x159c2b(0x1fa)+_0xd889da+'\x0a')),0x1;let _0x224c7e;if(_0x5e6ff0){if(!_0x5e6ff0['endsWith'](_0x159c2b(0x219))&&!_0x5e6ff0['endsWith'](_0x159c2b(0x1f8)))return console['error'](a44_0xe64494[_0x159c2b(0x1ed)](_0x159c2b(0x215)+_0x5e6ff0+'\x0a')),0x1;_0x224c7e=[_0x5e6ff0];}else _0x224c7e=findYamlFiles(_0xd889da);if(_0x224c7e[_0x159c2b(0x200)]===0x0)return console[_0x159c2b(0x1ee)](a44_0xe64494[_0x159c2b(0x1ed)](_0x159c2b(0x1fc)+_0xd889da+'\x0a')),0x1;const _0x1e27fa=validateYamlFiles(_0x224c7e,_0xd889da),_0x1a4e09=calculateSummary(_0x1e27fa);for(const _0x1d6d0e of _0x1e27fa){if(!isValidationResult(_0x1d6d0e))continue;const {relativePath:_0x1b4073,source:_0x36328a,result:_0x25f89b,fileType:_0x2e98b0}=_0x1d6d0e,_0x1ef986=_0x2e98b0;if(_0x25f89b[_0x159c2b(0x1eb)]&&_0x25f89b[_0x159c2b(0x204)][_0x159c2b(0x200)]===0x0)_0x5d6d01[_0x159c2b(0x202)]&&console['log'](a44_0xe64494[_0x159c2b(0x208)]('✔\x20'+_0x1b4073)+a44_0xe64494[_0x159c2b(0x203)]('\x20('+_0x1ef986+')'));else _0x25f89b[_0x159c2b(0x1eb)]?(console['log'](a44_0xe64494[_0x159c2b(0x20d)]('⚠\x20'+_0x1b4073)+a44_0xe64494[_0x159c2b(0x203)]('\x20('+_0x1ef986+'):\x20'+_0x25f89b[_0x159c2b(0x204)]['length']+'\x20warning(s)')),console[_0x159c2b(0x1f5)](formatValidationResult(_0x25f89b,_0x36328a,_0x1b4073))):(console[_0x159c2b(0x1f5)](a44_0xe64494[_0x159c2b(0x1ed)]('✖\x20'+_0x1b4073)+a44_0xe64494[_0x159c2b(0x203)]('\x20('+_0x1ef986+_0x159c2b(0x218)+_0x25f89b[_0x159c2b(0x207)][_0x159c2b(0x200)]+'\x20error(s)')),console[_0x159c2b(0x1f5)](formatValidationResult(_0x25f89b,_0x36328a,_0x1b4073)));}return console[_0x159c2b(0x1f5)](''),_0x1a4e09['hasErrors']?(console[_0x159c2b(0x1f5)](a44_0xe64494[_0x159c2b(0x1ed)]('Validation\x20failed:\x20'+_0x1a4e09[_0x159c2b(0x1fd)]+_0x159c2b(0x1fb)+_0x1a4e09[_0x159c2b(0x20a)]+_0x159c2b(0x205))),_0x1a4e09[_0x159c2b(0x1f3)]>0x0&&console[_0x159c2b(0x1f5)](a44_0xe64494[_0x159c2b(0x20d)](_0x1a4e09['warningCount']+_0x159c2b(0x214))),0x1):(console['log'](a44_0xe64494['green'](_0x159c2b(0x1ec)+_0x1a4e09[_0x159c2b(0x20a)]+'\x20file(s)\x20valid')),_0x1a4e09['warningCount']>0x0&&console['log'](a44_0xe64494[_0x159c2b(0x20d)](_0x1a4e09['warningCount']+_0x159c2b(0x214))),0x0);}}
1
+ const a44_0x1997dc=a44_0x46b8;(function(_0x1a287c,_0x485df3){const _0x49a5d4=a44_0x46b8,_0x3b391d=_0x1a287c();while(!![]){try{const _0x50858f=-parseInt(_0x49a5d4(0x10f))/0x1+parseInt(_0x49a5d4(0x118))/0x2*(-parseInt(_0x49a5d4(0x112))/0x3)+parseInt(_0x49a5d4(0x110))/0x4+parseInt(_0x49a5d4(0x10e))/0x5*(-parseInt(_0x49a5d4(0x121))/0x6)+parseInt(_0x49a5d4(0x12d))/0x7+-parseInt(_0x49a5d4(0x122))/0x8*(-parseInt(_0x49a5d4(0x125))/0x9)+-parseInt(_0x49a5d4(0x11d))/0xa;if(_0x50858f===_0x485df3)break;else _0x3b391d['push'](_0x3b391d['shift']());}catch(_0x5c0e13){_0x3b391d['push'](_0x3b391d['shift']());}}}(a44_0x33ab,0x576fb));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_0x5211c7 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x33ab(){const _0x306717=['\x20error(s)','2797753xxKvMM','dim','\x20valid','\x20file(s)\x20with\x20errors,\x20','yellow','cyan','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20warning(s)','✔\x20All\x20','hasErrors','message','red','name','filePath','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','warningCount','no_parent','length','20UuDpEm','58557coBIhj','1784960LMviwo','\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','11277Pvidzo','valid','log','endsWith','file','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','76zOwExV','error','description','Validate\x20segment\x20and\x20journey\x20YAML\x20files','errorCode','2378770qVbJKw','execute','green','\x20warning(s)\x20found','409914jQqlcU','24WzOXFG','):\x20','warnings','674316MrcVUe','validCount','cwd','helpText','Validation\x20failed:\x20','parentSegment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a44_0x33ab=function(){return _0x306717;};return a44_0x33ab();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a44_0x46b8(_0x554ca5,_0x5c1977){_0x554ca5=_0x554ca5-0x101;const _0x33ab20=a44_0x33ab();let _0x46b822=_0x33ab20[_0x554ca5];return _0x46b822;}export class SegmentValidateCommand extends BaseCommand{[a44_0x1997dc(0x108)]='segment:validate';[a44_0x1997dc(0x11a)]=a44_0x1997dc(0x11b);async[a44_0x1997dc(0x11e)](_0x275d8c){const _0x26f86f=a44_0x1997dc,{options:_0x3e1518,args:_0x137eb5}=_0x275d8c,_0x3c0e92=_0x3e1518,_0xf3175c=await resolveTarget({'arg':_0x137eb5[0x0],'contextParent':_0x3e1518[_0x26f86f(0x12a)],'cwd':process[_0x26f86f(0x127)]()});if(!isSuccessfulResolution(_0xf3175c))return _0xf3175c[_0x26f86f(0x11c)]===_0x26f86f(0x10c)?(console[_0x26f86f(0x119)](a44_0x5211c7['yellow'](_0x26f86f(0x12b))),console[_0x26f86f(0x119)](_0x26f86f(0x10a)),console['error'](_0x26f86f(0x111)),console['error'](_0x26f86f(0x117))):(console[_0x26f86f(0x119)](a44_0x5211c7[_0x26f86f(0x107)]('Error:\x20'+_0xf3175c[_0x26f86f(0x106)]+'\x0a')),_0xf3175c[_0x26f86f(0x128)]&&console[_0x26f86f(0x119)](a44_0x5211c7[_0x26f86f(0x101)](_0xf3175c[_0x26f86f(0x128)]))),0x1;const _0x190f4b=_0xf3175c['targetDir'],_0x25d3cb=_0xf3175c['type']===_0x26f86f(0x116)?_0xf3175c[_0x26f86f(0x109)]:undefined;if(!_0x25d3cb&&!existsSync(_0x190f4b))return console[_0x26f86f(0x119)](a44_0x5211c7[_0x26f86f(0x107)]('Error:\x20Directory\x20not\x20found:\x20'+_0x190f4b+'\x0a')),0x1;let _0x2b9392;if(_0x25d3cb){if(!_0x25d3cb['endsWith']('.yml')&&!_0x25d3cb[_0x26f86f(0x115)]('.yaml'))return console['error'](a44_0x5211c7[_0x26f86f(0x107)](_0x26f86f(0x102)+_0x25d3cb+'\x0a')),0x1;_0x2b9392=[_0x25d3cb];}else _0x2b9392=findYamlFiles(_0x190f4b);if(_0x2b9392[_0x26f86f(0x10d)]===0x0)return console['error'](a44_0x5211c7[_0x26f86f(0x107)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x190f4b+'\x0a')),0x1;const _0x5db7d8=validateYamlFiles(_0x2b9392,_0x190f4b),_0x3293de=calculateSummary(_0x5db7d8);for(const _0x4c5fea of _0x5db7d8){if(!isValidationResult(_0x4c5fea))continue;const {relativePath:_0x4193b8,source:_0x38cbfd,result:_0x3d827a,fileType:_0x14441d}=_0x4c5fea,_0x30099f=_0x14441d;if(_0x3d827a[_0x26f86f(0x113)]&&_0x3d827a[_0x26f86f(0x124)][_0x26f86f(0x10d)]===0x0)_0x3c0e92['verbose']&&console[_0x26f86f(0x114)](a44_0x5211c7[_0x26f86f(0x11f)]('✔\x20'+_0x4193b8)+a44_0x5211c7[_0x26f86f(0x12e)]('\x20('+_0x30099f+')'));else _0x3d827a[_0x26f86f(0x113)]?(console[_0x26f86f(0x114)](a44_0x5211c7[_0x26f86f(0x131)]('⚠\x20'+_0x4193b8)+a44_0x5211c7[_0x26f86f(0x12e)]('\x20('+_0x30099f+_0x26f86f(0x123)+_0x3d827a[_0x26f86f(0x124)]['length']+_0x26f86f(0x103))),console[_0x26f86f(0x114)](formatValidationResult(_0x3d827a,_0x38cbfd,_0x4193b8))):(console[_0x26f86f(0x114)](a44_0x5211c7[_0x26f86f(0x107)]('✖\x20'+_0x4193b8)+a44_0x5211c7[_0x26f86f(0x12e)]('\x20('+_0x30099f+_0x26f86f(0x123)+_0x3d827a['errors'][_0x26f86f(0x10d)]+_0x26f86f(0x12c))),console[_0x26f86f(0x114)](formatValidationResult(_0x3d827a,_0x38cbfd,_0x4193b8)));}return console[_0x26f86f(0x114)](''),_0x3293de[_0x26f86f(0x105)]?(console[_0x26f86f(0x114)](a44_0x5211c7['red'](_0x26f86f(0x129)+_0x3293de['invalidCount']+_0x26f86f(0x130)+_0x3293de[_0x26f86f(0x126)]+_0x26f86f(0x12f))),_0x3293de[_0x26f86f(0x10b)]>0x0&&console['log'](a44_0x5211c7['yellow'](_0x3293de['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x26f86f(0x114)](a44_0x5211c7['green'](_0x26f86f(0x104)+_0x3293de['validCount']+'\x20file(s)\x20valid')),_0x3293de[_0x26f86f(0x10b)]>0x0&&console[_0x26f86f(0x114)](a44_0x5211c7['yellow'](_0x3293de[_0x26f86f(0x10b)]+_0x26f86f(0x120))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x432079=a45_0x32b4;(function(_0x2a340b,_0x94cb67){const _0x5e4ba1=a45_0x32b4,_0x33807b=_0x2a340b();while(!![]){try{const _0x32bd0b=-parseInt(_0x5e4ba1(0x94))/0x1*(-parseInt(_0x5e4ba1(0x8e))/0x2)+parseInt(_0x5e4ba1(0x97))/0x3*(-parseInt(_0x5e4ba1(0xbd))/0x4)+parseInt(_0x5e4ba1(0xa6))/0x5*(parseInt(_0x5e4ba1(0xa3))/0x6)+-parseInt(_0x5e4ba1(0xc8))/0x7+-parseInt(_0x5e4ba1(0x9e))/0x8+-parseInt(_0x5e4ba1(0xb4))/0x9+-parseInt(_0x5e4ba1(0xcb))/0xa*(-parseInt(_0x5e4ba1(0xb2))/0xb);if(_0x32bd0b===_0x94cb67)break;else _0x33807b['push'](_0x33807b['shift']());}catch(_0x5f114a){_0x33807b['push'](_0x33807b['shift']());}}}(a45_0x5cc9,0xf40c7));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x82ab3b from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x432079(0xb8)]=a45_0x432079(0xd1);[a45_0x432079(0xb3)]=a45_0x432079(0xce);async[a45_0x432079(0xc4)](_0x47f8a9){const _0x5a1aa6=a45_0x432079,{options:_0x571afd,args:_0x8c4111}=_0x47f8a9,_0x179495=_0x571afd[_0x5a1aa6(0x90)],_0x4389c9=_0x8c4111[0x0];try{const _0x2ca806=_0x571afd[_0x5a1aa6(0x8f)];_0x571afd[_0x5a1aa6(0x8b)]&&(console['error'](_0x5a1aa6(0xb0)+_0x571afd['site']),console[_0x5a1aa6(0xbc)](_0x5a1aa6(0xd4)+(_0x2ca806||_0x5a1aa6(0xb6))),_0x4389c9&&console[_0x5a1aa6(0xbc)](_0x5a1aa6(0xd3)+_0x4389c9),_0x179495&&console['error']('Recursive\x20mode:\x20enabled'));if(!_0x2ca806)return console[_0x5a1aa6(0xbc)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x5a1aa6(0xbc)](''),console['error'](_0x5a1aa6(0xc3)),console['error'](_0x5a1aa6(0xba)),console['error'](_0x5a1aa6(0xb1)),console['error'](''),console[_0x5a1aa6(0xbc)](_0x5a1aa6(0xa7)),0x1;const _0x26244b=_0x4389c9&&(_0x4389c9[_0x5a1aa6(0x9f)]('*')||_0x4389c9[_0x5a1aa6(0x9f)]('?'));if(_0x26244b)return await this['listWithPattern'](_0x47f8a9,_0x2ca806,_0x4389c9);const _0x31414a=_0x4389c9?_0x2ca806+'/'+_0x4389c9:_0x2ca806;return _0x179495?await this['listRecursive'](_0x47f8a9,_0x31414a):await this[_0x5a1aa6(0x95)](_0x47f8a9,_0x31414a);}catch(_0x53f31f){if(_0x53f31f instanceof SDKError)return console[_0x5a1aa6(0xbc)](_0x5a1aa6(0xb5)+_0x53f31f[_0x5a1aa6(0xc1)]),_0x53f31f['cause']&&console['error'](_0x5a1aa6(0xa8)+_0x53f31f[_0x5a1aa6(0xbe)]),0x1;throw _0x53f31f;}}async['listWithPattern'](_0x52cff0,_0x4e0d12,_0x10984c){const _0x175257=a45_0x432079,{options:_0x5588a7,tdx:_0x4faadc}=_0x52cff0,_0x5285f1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4e0d12+'\x27...',()=>_0x4faadc[_0x175257(0x89)]['resolvePathToResource'](_0x4e0d12),{'verbose':_0x5588a7['verbose']}),_0x17dd0c=_0x5285f1['data'],_0x496662=await withSpinner(_0x175257(0x91),()=>_0x4faadc[_0x175257(0x89)][_0x175257(0xbf)](_0x17dd0c[_0x175257(0x9b)],_0x17dd0c[_0x175257(0xa4)]),{'verbose':_0x5588a7[_0x175257(0x8b)]}),{folders:_0x1cab7b,segments:_0x446c00,journeys:_0x4ea79b}=_0x496662[_0x175257(0xca)],_0x28069a=_0x10984c[_0x175257(0xd2)](/[.+^${}()|[\]\\]/g,_0x175257(0x99))['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x50b064=new RegExp('^'+_0x28069a+'$','i'),_0x33f224=_0x1cab7b[_0x175257(0xd0)](_0x5c8fa8=>_0x50b064[_0x175257(0xc0)](_0x5c8fa8[_0x175257(0xb8)])),_0x518851=_0x446c00['filter'](_0x250107=>_0x50b064[_0x175257(0xc0)](_0x250107[_0x175257(0xb8)])),_0x3fff7b=_0x4ea79b[_0x175257(0xd0)](_0x540af3=>_0x50b064[_0x175257(0xc0)](_0x540af3['journeyBundleName'])),_0x3e3606=_0x33f224[_0x175257(0xd6)]+_0x518851[_0x175257(0xd6)]+_0x3fff7b[_0x175257(0xd6)];console['error'](_0x175257(0xc7)+_0x33f224[_0x175257(0xd6)]+_0x175257(0xc5)+(_0x33f224[_0x175257(0xd6)]!==0x1?'s':'')+',\x20'+_0x518851[_0x175257(0xd6)]+_0x175257(0xd7)+(_0x518851['length']!==0x1?'s':'')+_0x175257(0xd5)+_0x3fff7b[_0x175257(0xd6)]+_0x175257(0x8a)+(_0x3fff7b['length']!==0x1?'s':'')+_0x175257(0xab)+_0x10984c+'\x27');const _0x1d5ce1=_0x462dde=>{const _0x319120=_0x175257;return getConsoleNextUrl(_0x5588a7['site'],_0x319120(0xcc)+_0x17dd0c[_0x319120(0x9b)]+_0x319120(0xae)+_0x462dde);},_0x2536d3=_0x5588a7[_0x175257(0x8c)]===_0x175257(0x9a)||_0x5588a7[_0x175257(0x8c)]===_0x175257(0xc2);if(_0x2536d3){const _0x303522=[..._0x33f224['map'](_0x55b70a=>({..._0x55b70a,'type':'folder'})),..._0x518851[_0x175257(0x93)](_0xa70c7e=>({..._0xa70c7e,'type':_0x175257(0x89),'url':_0x1d5ce1(_0xa70c7e['id'])})),..._0x3fff7b[_0x175257(0x93)](_0x371ca9=>({..._0x371ca9,'name':_0x371ca9[_0x175257(0x9d)],'type':_0x175257(0x8d)}))][_0x175257(0xa5)]((_0x506a85,_0x1c370d)=>_0x506a85[_0x175257(0xb8)]['localeCompare'](_0x1c370d[_0x175257(0xb8)]));await handleSDKOutput(_0x303522,_0x5588a7);}else{if(_0x3e3606===0x0)console[_0x175257(0xb9)](_0x175257(0x96)+_0x10984c);else{console[_0x175257(0xb9)](a45_0x82ab3b[_0x175257(0xc6)]('['+_0x4e0d12+_0x175257(0xa1)+_0x10984c+'\x27'));const _0x255a32=formatFlatList(_0x33f224,_0x518851,{'showMetadata':!![],'getSegmentUrl':_0x1d5ce1},_0x3fff7b);console[_0x175257(0xb9)](_0x255a32);}}return 0x0;}async[a45_0x432079(0x95)](_0xaf76d9,_0x56559){const _0xa5ef97=a45_0x432079,{options:_0x3df3fc,tdx:_0x1108e5}=_0xaf76d9,_0x597258=await withSpinner(_0xa5ef97(0xad)+_0x56559+_0xa5ef97(0xa9),()=>_0x1108e5['segment'][_0xa5ef97(0x88)](_0x56559),{'verbose':_0x3df3fc[_0xa5ef97(0x8b)]}),_0x1219e4=_0x597258['data'];_0x3df3fc[_0xa5ef97(0x8b)]&&(console[_0xa5ef97(0xbc)](_0xa5ef97(0xc9)+_0x1219e4['parentId']),_0x1219e4[_0xa5ef97(0xa4)]&&console['error'](_0xa5ef97(0xa0)+_0x1219e4['folderId']));const _0x5986c6=await withSpinner(_0xa5ef97(0x91),()=>_0x1108e5[_0xa5ef97(0x89)][_0xa5ef97(0xbf)](_0x1219e4[_0xa5ef97(0x9b)],_0x1219e4[_0xa5ef97(0xa4)]),{'verbose':_0x3df3fc['verbose']}),{folders:_0xbfc629,segments:_0x53e3e2,journeys:_0x58903c}=_0x5986c6[_0xa5ef97(0xca)],_0xce2c6c=_0xbfc629['length']+_0x53e3e2['length']+_0x58903c['length'];console[_0xa5ef97(0xbc)](_0xa5ef97(0xc7)+_0xbfc629['length']+'\x20folder'+(_0xbfc629[_0xa5ef97(0xd6)]!==0x1?'s':'')+',\x20'+_0x53e3e2['length']+'\x20segment'+(_0x53e3e2[_0xa5ef97(0xd6)]!==0x1?'s':'')+_0xa5ef97(0xd5)+_0x58903c[_0xa5ef97(0xd6)]+_0xa5ef97(0x8a)+(_0x58903c[_0xa5ef97(0xd6)]!==0x1?'s':''));const _0x22e260=_0x3f1826=>{const _0x42a2aa=_0xa5ef97;return getConsoleNextUrl(_0x3df3fc[_0x42a2aa(0xb7)],_0x42a2aa(0xcc)+_0x1219e4['parentId']+'/e/'+_0x3f1826);},_0x40857d=_0x155604=>{const _0x2e6c94=_0xa5ef97;return getConsoleNextUrl(_0x3df3fc[_0x2e6c94(0xb7)],_0x2e6c94(0xcc)+_0x1219e4[_0x2e6c94(0x9b)]+_0x2e6c94(0xae)+_0x155604+_0x2e6c94(0x92));},_0x45157d=_0x3df3fc['format']==='json'||_0x3df3fc['format']===_0xa5ef97(0xc2);if(_0x45157d){const _0x4a5ba6=[..._0xbfc629[_0xa5ef97(0x93)](_0x58ebbc=>({..._0x58ebbc,'type':'folder'})),..._0x53e3e2[_0xa5ef97(0x93)](_0x2eae31=>({..._0x2eae31,'type':_0xa5ef97(0x89),'url':_0x22e260(_0x2eae31['id'])})),..._0x58903c[_0xa5ef97(0x93)](_0x4ca583=>({..._0x4ca583,'name':_0x4ca583[_0xa5ef97(0x9d)],'type':_0xa5ef97(0x8d),'url':_0x40857d(_0x4ca583['id'])}))]['sort']((_0x3079da,_0x106a51)=>_0x3079da[_0xa5ef97(0xb8)]['localeCompare'](_0x106a51[_0xa5ef97(0xb8)]));await handleSDKOutput(_0x4a5ba6,_0x3df3fc);}else{if(_0xce2c6c===0x0)console[_0xa5ef97(0xb9)](a45_0x82ab3b[_0xa5ef97(0xc6)]('['+_0x56559+']')),console[_0xa5ef97(0xb9)](_0xa5ef97(0x98));else{console['log'](a45_0x82ab3b[_0xa5ef97(0xc6)]('['+_0x56559+']'));const _0x21d258=formatFlatList(_0xbfc629,_0x53e3e2,{'showMetadata':!![],'getSegmentUrl':_0x22e260,'getJourneyUrl':_0x40857d},_0x58903c);console[_0xa5ef97(0xb9)](_0x21d258);}}return 0x0;}async[a45_0x432079(0xaf)](_0x1a2061,_0x28f176){const _0x228e7a=a45_0x432079,{options:_0x48fa30,tdx:_0x2f3364}=_0x1a2061,_0x2d6f3e=await withSpinner(_0x228e7a(0xad)+_0x28f176+_0x228e7a(0xa9),()=>_0x2f3364['segment']['resolvePathToResource'](_0x28f176),{'verbose':_0x48fa30[_0x228e7a(0x8b)]}),_0x759a67=_0x2d6f3e[_0x228e7a(0xca)];_0x48fa30['verbose']&&(console[_0x228e7a(0xbc)](_0x228e7a(0xc9)+_0x759a67['parentId']),_0x759a67[_0x228e7a(0xa4)]&&console[_0x228e7a(0xbc)](_0x228e7a(0xa0)+_0x759a67[_0x228e7a(0xa4)]));const _0x4a2c10=_0x48fa30[_0x228e7a(0xa2)]||0xa,_0x42accd=await withSpinner(_0x228e7a(0xbb),()=>_0x2f3364['segment'][_0x228e7a(0xaf)](_0x759a67[_0x228e7a(0x9b)],_0x759a67[_0x228e7a(0xa4)],0x0,_0x4a2c10),{'verbose':_0x48fa30[_0x228e7a(0x8b)]}),_0x973d55=_0x42accd['data'],_0x23ca6d=_0x201164=>{const _0x468f4e=_0x228e7a;let _0x17ef62=0x0,_0x37d628=0x0,_0x1af8b7=0x0;for(const _0x29b822 of _0x201164){if(_0x29b822[_0x468f4e(0xcd)]==='folder')_0x17ef62++;else{if(_0x29b822[_0x468f4e(0xcd)]===_0x468f4e(0x89))_0x37d628++;else{if(_0x29b822[_0x468f4e(0xcd)]===_0x468f4e(0x8d))_0x1af8b7++;}}if(_0x29b822['children']){const _0x1dc50d=_0x23ca6d(_0x29b822[_0x468f4e(0xac)]);_0x17ef62+=_0x1dc50d['folders'],_0x37d628+=_0x1dc50d[_0x468f4e(0xd1)],_0x1af8b7+=_0x1dc50d[_0x468f4e(0xcf)];}}return{'folders':_0x17ef62,'segments':_0x37d628,'journeys':_0x1af8b7};},_0x3d16cd=_0x23ca6d(_0x973d55);console[_0x228e7a(0xbc)](_0x228e7a(0xaa)+_0x3d16cd[_0x228e7a(0x9c)]+_0x228e7a(0xc5)+(_0x3d16cd[_0x228e7a(0x9c)]!==0x1?'s':'')+',\x20'+_0x3d16cd[_0x228e7a(0xd1)]+_0x228e7a(0xd7)+(_0x3d16cd[_0x228e7a(0xd1)]!==0x1?'s':'')+_0x228e7a(0xd5)+_0x3d16cd[_0x228e7a(0xcf)]+_0x228e7a(0x8a)+(_0x3d16cd[_0x228e7a(0xcf)]!==0x1?'s':''));const _0x48c899=_0x4534d4=>{const _0x54a682=_0x228e7a;return getConsoleNextUrl(_0x48fa30[_0x54a682(0xb7)],_0x54a682(0xcc)+_0x759a67[_0x54a682(0x9b)]+_0x54a682(0xae)+_0x4534d4);},_0x32528e=_0x35e3e9=>{const _0x358911=_0x228e7a;return getConsoleNextUrl(_0x48fa30['site'],_0x358911(0xcc)+_0x759a67[_0x358911(0x9b)]+'/e/'+_0x35e3e9+_0x358911(0x92));};if(_0x48fa30[_0x228e7a(0x8c)]==='json'||_0x48fa30[_0x228e7a(0x8c)]===_0x228e7a(0xc2))await handleSDKOutput(_0x973d55,_0x48fa30);else{console[_0x228e7a(0xb9)](a45_0x82ab3b['dim']('['+_0x28f176+']'));const _0xacd7ba=formatTree(_0x973d55,{'showMetadata':!![],'getSegmentUrl':_0x48c899,'getJourneyUrl':_0x32528e});console[_0x228e7a(0xb9)](_0xacd7ba);}return 0x0;}}function a45_0x32b4(_0x46b74d,_0x2b773d){_0x46b74d=_0x46b74d-0x88;const _0x5cc947=a45_0x5cc9();let _0x32b454=_0x5cc947[_0x46b74d];return _0x32b454;}function a45_0x5cc9(){const _0x4be5e9=['description','16317036xmGEDC','Error:\x20','(not\x20set)','site','name','log','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Building\x20hierarchy\x20tree...','error','74444KCTNPp','cause','listUnifiedWithJourneys','test','message','jsonl','Set\x20a\x20parent\x20segment\x20context\x20first:','execute','\x20folder','dim','✔\x20Found\x20','6836914maAaMI','Parent\x20ID:\x20','data','1430ralNQN','/app/ps/','type','List\x20folders\x20and\x20child\x20segments','journeys','filter','segments','replace','Folder/pattern\x20arg:\x20','Parent\x20segment\x20context:\x20',',\x20and\x20','length','\x20segment','resolvePathToResource','segment','\x20journey','verbose','format','journey','134xQZaZh','parentSegment','recursive','Listing\x20folders,\x20segments,\x20and\x20journeys...','/j/da','map','11991gYjVjh','listUnified','No\x20items\x20match\x20pattern:\x20','21zgxgrr','(empty)','\x5c$&','json','parentId','folders','journeyBundleName','651048sUQptS','includes','Folder\x20ID:\x20',']\x20matching\x20\x27','maxDepth','264DCfeOq','folderId','sort','153185qCXCKc','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20\x20Cause:\x20','\x27...','✔\x20Built\x20tree\x20with\x20','\x20matching\x20\x27','children','Resolving\x20path\x20\x27','/e/','listRecursive','Site:\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','142274eWVtYa'];a45_0x5cc9=function(){return _0x4be5e9;};return a45_0x5cc9();}
1
+ const a45_0x140fa6=a45_0x3bb7;(function(_0x2b8bd8,_0x54e066){const _0x31d734=a45_0x3bb7,_0x51d144=_0x2b8bd8();while(!![]){try{const _0x3bafbb=-parseInt(_0x31d734(0x168))/0x1+parseInt(_0x31d734(0x151))/0x2*(-parseInt(_0x31d734(0x16d))/0x3)+-parseInt(_0x31d734(0x166))/0x4+parseInt(_0x31d734(0x152))/0x5+parseInt(_0x31d734(0x146))/0x6*(parseInt(_0x31d734(0x17f))/0x7)+parseInt(_0x31d734(0x14e))/0x8+-parseInt(_0x31d734(0x16f))/0x9*(-parseInt(_0x31d734(0x174))/0xa);if(_0x3bafbb===_0x54e066)break;else _0x51d144['push'](_0x51d144['shift']());}catch(_0x590422){_0x51d144['push'](_0x51d144['shift']());}}}(a45_0x17f0,0x28f81));function a45_0x3bb7(_0x131ca0,_0x46642a){_0x131ca0=_0x131ca0-0x138;const _0x17f0d1=a45_0x17f0();let _0x3bb720=_0x17f0d1[_0x131ca0];return _0x3bb720;}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';function a45_0x17f0(){const _0x134768=['folderId','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','execute','\x20journey','✔\x20Found\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','cause','message','maxDepth','description','children','Building\x20hierarchy\x20tree...','1029424dJjkcv','\x20segment','78960RsPbSs','name','segment','listUnified','replace','3GuuMEM','Parent\x20ID:\x20','30879ybpjRH','Site:\x20','Recursive\x20mode:\x20enabled','Resolving\x20path\x20\x27','sort','290zbFlOi','Error:\x20No\x20parent\x20segment\x20context\x20set.','(not\x20set)','includes','listUnifiedWithJourneys','(empty)','log','folders','Listing\x20folders,\x20segments,\x20and\x20journeys...','map','Folder\x20ID:\x20','847nKekqZ','resolvePathToResource','\x20folder','journeys','format','site','json','segments','/e/','/app/ps/','length','filter','✔\x20Built\x20tree\x20with\x20','/j/da','verbose','dim','listRecursive','Parent\x20segment\x20context:\x20','9582bkzTAd','\x27...','Folder/pattern\x20arg:\x20','parentId','type','data','No\x20items\x20match\x20pattern:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','1763776AFDoLZ','folder',',\x20and\x20','624458RuvdYf','1515730eCfqSN','recursive','Set\x20a\x20parent\x20segment\x20context\x20first:','journey','test','listWithPattern','journeyBundleName','error'];a45_0x17f0=function(){return _0x134768;};return a45_0x17f0();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x256012 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x140fa6(0x169)]=a45_0x140fa6(0x13b);[a45_0x140fa6(0x163)]='List\x20folders\x20and\x20child\x20segments';async[a45_0x140fa6(0x15c)](_0x25cfe2){const _0x15b3a1=a45_0x140fa6,{options:_0x3437fe,args:_0x4f7e05}=_0x25cfe2,_0x41519c=_0x3437fe[_0x15b3a1(0x153)],_0x1f91fa=_0x4f7e05[0x0];try{const _0x224955=_0x3437fe['parentSegment'];_0x3437fe[_0x15b3a1(0x142)]&&(console[_0x15b3a1(0x159)](_0x15b3a1(0x170)+_0x3437fe[_0x15b3a1(0x139)]),console[_0x15b3a1(0x159)](_0x15b3a1(0x145)+(_0x224955||_0x15b3a1(0x176))),_0x1f91fa&&console[_0x15b3a1(0x159)](_0x15b3a1(0x148)+_0x1f91fa),_0x41519c&&console['error'](_0x15b3a1(0x171)));if(!_0x224955)return console[_0x15b3a1(0x159)](_0x15b3a1(0x175)),console['error'](''),console[_0x15b3a1(0x159)](_0x15b3a1(0x154)),console[_0x15b3a1(0x159)](_0x15b3a1(0x14d)),console[_0x15b3a1(0x159)](_0x15b3a1(0x15f)),console['error'](''),console[_0x15b3a1(0x159)](_0x15b3a1(0x15b)),0x1;const _0x340338=_0x1f91fa&&(_0x1f91fa[_0x15b3a1(0x177)]('*')||_0x1f91fa['includes']('?'));if(_0x340338)return await this[_0x15b3a1(0x157)](_0x25cfe2,_0x224955,_0x1f91fa);const _0x40382a=_0x1f91fa?_0x224955+'/'+_0x1f91fa:_0x224955;return _0x41519c?await this[_0x15b3a1(0x144)](_0x25cfe2,_0x40382a):await this[_0x15b3a1(0x16b)](_0x25cfe2,_0x40382a);}catch(_0x379763){if(_0x379763 instanceof SDKError)return console['error']('Error:\x20'+_0x379763[_0x15b3a1(0x161)]),_0x379763[_0x15b3a1(0x160)]&&console['error']('\x20\x20Cause:\x20'+_0x379763[_0x15b3a1(0x160)]),0x1;throw _0x379763;}}async['listWithPattern'](_0x8daf79,_0x515064,_0x4f5dbf){const _0x1d3c66=a45_0x140fa6,{options:_0x1c0553,tdx:_0x3062da}=_0x8daf79,_0xa1aabd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x515064+_0x1d3c66(0x147),()=>_0x3062da[_0x1d3c66(0x16a)][_0x1d3c66(0x180)](_0x515064),{'verbose':_0x1c0553[_0x1d3c66(0x142)]}),_0x431c3d=_0xa1aabd[_0x1d3c66(0x14b)],_0x2e031f=await withSpinner(_0x1d3c66(0x17c),()=>_0x3062da[_0x1d3c66(0x16a)][_0x1d3c66(0x178)](_0x431c3d['parentId'],_0x431c3d['folderId']),{'verbose':_0x1c0553['verbose']}),{folders:_0x2a3d97,segments:_0x2c88ff,journeys:_0x4d4ea1}=_0x2e031f[_0x1d3c66(0x14b)],_0x2897bb=_0x4f5dbf[_0x1d3c66(0x16c)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1d3c66(0x16c)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3aa96d=new RegExp('^'+_0x2897bb+'$','i'),_0x1fab05=_0x2a3d97[_0x1d3c66(0x13f)](_0x219fc7=>_0x3aa96d[_0x1d3c66(0x156)](_0x219fc7[_0x1d3c66(0x169)])),_0x375565=_0x2c88ff[_0x1d3c66(0x13f)](_0x1d6dcc=>_0x3aa96d[_0x1d3c66(0x156)](_0x1d6dcc[_0x1d3c66(0x169)])),_0x17ffa9=_0x4d4ea1[_0x1d3c66(0x13f)](_0x24110f=>_0x3aa96d[_0x1d3c66(0x156)](_0x24110f['journeyBundleName'])),_0x731867=_0x1fab05[_0x1d3c66(0x13e)]+_0x375565[_0x1d3c66(0x13e)]+_0x17ffa9[_0x1d3c66(0x13e)];console[_0x1d3c66(0x159)]('✔\x20Found\x20'+_0x1fab05[_0x1d3c66(0x13e)]+_0x1d3c66(0x181)+(_0x1fab05[_0x1d3c66(0x13e)]!==0x1?'s':'')+',\x20'+_0x375565[_0x1d3c66(0x13e)]+'\x20segment'+(_0x375565[_0x1d3c66(0x13e)]!==0x1?'s':'')+_0x1d3c66(0x150)+_0x17ffa9[_0x1d3c66(0x13e)]+_0x1d3c66(0x15d)+(_0x17ffa9[_0x1d3c66(0x13e)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x4f5dbf+'\x27');const _0x1b1637=_0xd03c9c=>{const _0x1c61a1=_0x1d3c66;return getConsoleNextUrl(_0x1c0553['site'],_0x1c61a1(0x13d)+_0x431c3d[_0x1c61a1(0x149)]+'/e/'+_0xd03c9c);},_0x41ac91=_0x1c0553[_0x1d3c66(0x138)]===_0x1d3c66(0x13a)||_0x1c0553['format']==='jsonl';if(_0x41ac91){const _0x11075b=[..._0x1fab05[_0x1d3c66(0x17d)](_0x5627ec=>({..._0x5627ec,'type':_0x1d3c66(0x14f)})),..._0x375565[_0x1d3c66(0x17d)](_0x1340d7=>({..._0x1340d7,'type':'segment','url':_0x1b1637(_0x1340d7['id'])})),..._0x17ffa9[_0x1d3c66(0x17d)](_0x324592=>({..._0x324592,'name':_0x324592[_0x1d3c66(0x158)],'type':_0x1d3c66(0x155)}))][_0x1d3c66(0x173)]((_0x3872d4,_0x5f1673)=>_0x3872d4[_0x1d3c66(0x169)]['localeCompare'](_0x5f1673[_0x1d3c66(0x169)]));await handleSDKOutput(_0x11075b,_0x1c0553);}else{if(_0x731867===0x0)console[_0x1d3c66(0x17a)](_0x1d3c66(0x14c)+_0x4f5dbf);else{console[_0x1d3c66(0x17a)](a45_0x256012[_0x1d3c66(0x143)]('['+_0x515064+']\x20matching\x20\x27'+_0x4f5dbf+'\x27'));const _0x25ce89=formatFlatList(_0x1fab05,_0x375565,{'showMetadata':!![],'getSegmentUrl':_0x1b1637},_0x17ffa9);console[_0x1d3c66(0x17a)](_0x25ce89);}}return 0x0;}async['listUnified'](_0x51b493,_0x13dc1e){const _0x27e8f4=a45_0x140fa6,{options:_0x457a59,tdx:_0x220550}=_0x51b493,_0x2c3070=await withSpinner(_0x27e8f4(0x172)+_0x13dc1e+_0x27e8f4(0x147),()=>_0x220550[_0x27e8f4(0x16a)][_0x27e8f4(0x180)](_0x13dc1e),{'verbose':_0x457a59['verbose']}),_0x52b10a=_0x2c3070[_0x27e8f4(0x14b)];_0x457a59[_0x27e8f4(0x142)]&&(console[_0x27e8f4(0x159)](_0x27e8f4(0x16e)+_0x52b10a[_0x27e8f4(0x149)]),_0x52b10a[_0x27e8f4(0x15a)]&&console[_0x27e8f4(0x159)](_0x27e8f4(0x17e)+_0x52b10a[_0x27e8f4(0x15a)]));const _0x292b97=await withSpinner(_0x27e8f4(0x17c),()=>_0x220550[_0x27e8f4(0x16a)]['listUnifiedWithJourneys'](_0x52b10a['parentId'],_0x52b10a['folderId']),{'verbose':_0x457a59[_0x27e8f4(0x142)]}),{folders:_0x29bccf,segments:_0x2d679b,journeys:_0x147273}=_0x292b97['data'],_0x1fcaa5=_0x29bccf[_0x27e8f4(0x13e)]+_0x2d679b[_0x27e8f4(0x13e)]+_0x147273[_0x27e8f4(0x13e)];console['error'](_0x27e8f4(0x15e)+_0x29bccf[_0x27e8f4(0x13e)]+_0x27e8f4(0x181)+(_0x29bccf[_0x27e8f4(0x13e)]!==0x1?'s':'')+',\x20'+_0x2d679b[_0x27e8f4(0x13e)]+_0x27e8f4(0x167)+(_0x2d679b['length']!==0x1?'s':'')+',\x20and\x20'+_0x147273[_0x27e8f4(0x13e)]+_0x27e8f4(0x15d)+(_0x147273['length']!==0x1?'s':''));const _0x5ce1cf=_0x364e47=>{const _0x3d3692=_0x27e8f4;return getConsoleNextUrl(_0x457a59[_0x3d3692(0x139)],'/app/ps/'+_0x52b10a[_0x3d3692(0x149)]+_0x3d3692(0x13c)+_0x364e47);},_0x3c82a3=_0x59f84b=>{const _0xe8db0d=_0x27e8f4;return getConsoleNextUrl(_0x457a59['site'],'/app/ps/'+_0x52b10a[_0xe8db0d(0x149)]+_0xe8db0d(0x13c)+_0x59f84b+'/j/da');},_0x2fdb93=_0x457a59['format']==='json'||_0x457a59[_0x27e8f4(0x138)]==='jsonl';if(_0x2fdb93){const _0x4eb76b=[..._0x29bccf[_0x27e8f4(0x17d)](_0x1011d7=>({..._0x1011d7,'type':_0x27e8f4(0x14f)})),..._0x2d679b['map'](_0x1abefe=>({..._0x1abefe,'type':_0x27e8f4(0x16a),'url':_0x5ce1cf(_0x1abefe['id'])})),..._0x147273['map'](_0x2873f5=>({..._0x2873f5,'name':_0x2873f5[_0x27e8f4(0x158)],'type':_0x27e8f4(0x155),'url':_0x3c82a3(_0x2873f5['id'])}))]['sort']((_0x4ee8dc,_0x489886)=>_0x4ee8dc['name']['localeCompare'](_0x489886['name']));await handleSDKOutput(_0x4eb76b,_0x457a59);}else{if(_0x1fcaa5===0x0)console[_0x27e8f4(0x17a)](a45_0x256012[_0x27e8f4(0x143)]('['+_0x13dc1e+']')),console[_0x27e8f4(0x17a)](_0x27e8f4(0x179));else{console[_0x27e8f4(0x17a)](a45_0x256012[_0x27e8f4(0x143)]('['+_0x13dc1e+']'));const _0x70b032=formatFlatList(_0x29bccf,_0x2d679b,{'showMetadata':!![],'getSegmentUrl':_0x5ce1cf,'getJourneyUrl':_0x3c82a3},_0x147273);console[_0x27e8f4(0x17a)](_0x70b032);}}return 0x0;}async['listRecursive'](_0x24f932,_0x1a2231){const _0x144461=a45_0x140fa6,{options:_0x542479,tdx:_0x2857c8}=_0x24f932,_0x1633da=await withSpinner(_0x144461(0x172)+_0x1a2231+_0x144461(0x147),()=>_0x2857c8['segment'][_0x144461(0x180)](_0x1a2231),{'verbose':_0x542479[_0x144461(0x142)]}),_0x2d12eb=_0x1633da[_0x144461(0x14b)];_0x542479[_0x144461(0x142)]&&(console[_0x144461(0x159)](_0x144461(0x16e)+_0x2d12eb[_0x144461(0x149)]),_0x2d12eb[_0x144461(0x15a)]&&console[_0x144461(0x159)](_0x144461(0x17e)+_0x2d12eb[_0x144461(0x15a)]));const _0x13aa3b=_0x542479[_0x144461(0x162)]||0xa,_0x4787af=await withSpinner(_0x144461(0x165),()=>_0x2857c8[_0x144461(0x16a)][_0x144461(0x144)](_0x2d12eb['parentId'],_0x2d12eb[_0x144461(0x15a)],0x0,_0x13aa3b),{'verbose':_0x542479[_0x144461(0x142)]}),_0x4db16a=_0x4787af[_0x144461(0x14b)],_0x511d58=_0x88f2a1=>{const _0x1e47f3=_0x144461;let _0xe04818=0x0,_0x38a609=0x0,_0x5600f5=0x0;for(const _0x4071c7 of _0x88f2a1){if(_0x4071c7[_0x1e47f3(0x14a)]===_0x1e47f3(0x14f))_0xe04818++;else{if(_0x4071c7[_0x1e47f3(0x14a)]===_0x1e47f3(0x16a))_0x38a609++;else{if(_0x4071c7[_0x1e47f3(0x14a)]==='journey')_0x5600f5++;}}if(_0x4071c7[_0x1e47f3(0x164)]){const _0x405746=_0x511d58(_0x4071c7[_0x1e47f3(0x164)]);_0xe04818+=_0x405746[_0x1e47f3(0x17b)],_0x38a609+=_0x405746['segments'],_0x5600f5+=_0x405746[_0x1e47f3(0x182)];}}return{'folders':_0xe04818,'segments':_0x38a609,'journeys':_0x5600f5};},_0x55c2a9=_0x511d58(_0x4db16a);console[_0x144461(0x159)](_0x144461(0x140)+_0x55c2a9[_0x144461(0x17b)]+_0x144461(0x181)+(_0x55c2a9[_0x144461(0x17b)]!==0x1?'s':'')+',\x20'+_0x55c2a9[_0x144461(0x13b)]+'\x20segment'+(_0x55c2a9[_0x144461(0x13b)]!==0x1?'s':'')+_0x144461(0x150)+_0x55c2a9['journeys']+_0x144461(0x15d)+(_0x55c2a9['journeys']!==0x1?'s':''));const _0x5f14ea=_0x34217c=>{const _0x39422e=_0x144461;return getConsoleNextUrl(_0x542479[_0x39422e(0x139)],'/app/ps/'+_0x2d12eb[_0x39422e(0x149)]+_0x39422e(0x13c)+_0x34217c);},_0x55e46f=_0x18b20e=>{const _0x3b1891=_0x144461;return getConsoleNextUrl(_0x542479[_0x3b1891(0x139)],'/app/ps/'+_0x2d12eb['parentId']+_0x3b1891(0x13c)+_0x18b20e+_0x3b1891(0x141));};if(_0x542479[_0x144461(0x138)]==='json'||_0x542479[_0x144461(0x138)]==='jsonl')await handleSDKOutput(_0x4db16a,_0x542479);else{console['log'](a45_0x256012[_0x144461(0x143)]('['+_0x1a2231+']'));const _0xf4192d=formatTree(_0x4db16a,{'showMetadata':!![],'getSegmentUrl':_0x5f14ea,'getJourneyUrl':_0x55e46f});console[_0x144461(0x17a)](_0xf4192d);}return 0x0;}}
@@ -1 +1 @@
1
- function a46_0x4a6f(_0x34070d,_0x5588d4){_0x34070d=_0x34070d-0xce;const _0x12af65=a46_0x12af();let _0x4a6ffc=_0x12af65[_0x34070d];return _0x4a6ffc;}const a46_0x246d28=a46_0x4a6f;(function(_0x489950,_0x4f5d92){const _0x2251c4=a46_0x4a6f,_0x258b1c=_0x489950();while(!![]){try{const _0x31a8ac=-parseInt(_0x2251c4(0xf1))/0x1*(-parseInt(_0x2251c4(0xf0))/0x2)+-parseInt(_0x2251c4(0xe6))/0x3+-parseInt(_0x2251c4(0xe7))/0x4+parseInt(_0x2251c4(0xe2))/0x5*(-parseInt(_0x2251c4(0xda))/0x6)+parseInt(_0x2251c4(0xdd))/0x7+parseInt(_0x2251c4(0xcf))/0x8+-parseInt(_0x2251c4(0xd6))/0x9;if(_0x31a8ac===_0x4f5d92)break;else _0x258b1c['push'](_0x258b1c['shift']());}catch(_0x1cde73){_0x258b1c['push'](_0x258b1c['shift']());}}}(a46_0x12af,0x87954));import{BaseCommand}from'./command.js';function a46_0x12af(){const _0x4fa5f4=['\x20row','Table:\x20','cause','6imCPmt','Catalog:\x20','\x20\x20Cause:\x20','5681459MnSrAg','execute','query','Site:\x20','name','1034005WKZrzg','verbose','showTable','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','1497672FXucjr','640968syBCZd','...','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Show\x20table\x20contents','data','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','table','description','show','2KZNMrT','504461bKparW','Error:\x20','Limit:\x20','catalog','\x20from\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','length','Usage:\x20tdx\x20show\x20<database.table>','3864248IraUXP','message','Querying\x20','validate','error','args','database','3397626gBnEBW'];a46_0x12af=function(){return _0x4fa5f4;};return a46_0x12af();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x246d28(0xe1)]=a46_0x246d28(0xef);[a46_0x246d28(0xee)]=a46_0x246d28(0xea);async[a46_0x246d28(0xde)](_0x195bc6){const _0x24be90=a46_0x246d28;return this[_0x24be90(0xe4)](_0x195bc6);}async[a46_0x246d28(0xe4)](_0x2ae317){const _0x23985d=a46_0x246d28,{options:_0x14ac9,args:_0x2faa1d,tdx:_0xc29dde}=_0x2ae317;let _0x4c4e76;try{_0x4c4e76=parseTableReference(_0x2faa1d[0x0]);const _0x385f02=_0x14ac9[_0x23985d(0xd5)];!_0x4c4e76[_0x23985d(0xd5)]&&_0x385f02&&(_0x4c4e76[_0x23985d(0xd5)]=_0x385f02);const _0x5733d4=validateTableDescribeReference(_0x4c4e76);if(_0x5733d4)return console[_0x23985d(0xd3)](_0x23985d(0xf2)+_0x5733d4),console[_0x23985d(0xd3)](_0x23985d(0xce)),console['error'](_0x23985d(0xe9)),console[_0x23985d(0xd3)](_0x23985d(0xec)),0x1;}catch(_0x3014a1){return console[_0x23985d(0xd3)](_0x23985d(0xf2)+_0x3014a1[_0x23985d(0xd0)]),console[_0x23985d(0xd3)](_0x23985d(0xce)),console[_0x23985d(0xd3)](_0x23985d(0xe9)),console[_0x23985d(0xd3)](_0x23985d(0xec)),0x1;}const _0x51d206=_0x4c4e76[_0x23985d(0xf4)],_0x7b1228=_0x4c4e76[_0x23985d(0xd5)],_0x113fe8=_0x4c4e76[_0x23985d(0xed)],_0x2179a8=resolveLimit(_0x14ac9['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x14ac9[_0x23985d(0xe3)]&&(console['error'](_0x23985d(0xe0)+_0x14ac9['site']),_0x51d206&&console[_0x23985d(0xd3)](_0x23985d(0xdb)+_0x51d206),console['error']('Database:\x20'+_0x7b1228),console[_0x23985d(0xd3)](_0x23985d(0xd8)+_0x113fe8),console['error'](_0x23985d(0xf3)+_0x2179a8));const _0x26721e=_0x51d206?_0x51d206+'.'+_0x7b1228+'.'+_0x113fe8:_0x7b1228+'.'+_0x113fe8,_0x35d273=await withSpinner(_0x23985d(0xd1)+_0x26721e+_0x23985d(0xe8),()=>_0xc29dde[_0x23985d(0xdf)][_0x23985d(0xe4)](_0x7b1228,_0x113fe8,_0x2179a8,_0x51d206),{'verbose':_0x14ac9['verbose']}),_0x5a715e=_0x35d273['data'],_0x476fc3=_0x5a715e[_0x23985d(0xeb)];return _0x476fc3['length']===0x0?console[_0x23985d(0xd3)](_0x23985d(0xe5)):console['error']('✔\x20Retrieved\x20'+_0x476fc3['length']+_0x23985d(0xd7)+(_0x476fc3[_0x23985d(0xf7)]!==0x1?'s':'')+_0x23985d(0xf5)+_0x26721e),await handleSDKOutput(_0x476fc3,_0x14ac9),0x0;}catch(_0x2c58f2){if(_0x2c58f2 instanceof SDKError)return console[_0x23985d(0xd3)](_0x23985d(0xf2)+_0x2c58f2[_0x23985d(0xd0)]),_0x2c58f2[_0x23985d(0xd9)]&&console[_0x23985d(0xd3)](_0x23985d(0xdc)+_0x2c58f2['cause']),0x1;throw _0x2c58f2;}}[a46_0x246d28(0xd2)](_0x3d9da8){const _0x16d2c4=a46_0x246d28;if(_0x3d9da8[_0x16d2c4(0xd4)][_0x16d2c4(0xf7)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x3d9da8[_0x16d2c4(0xd4)]['length']>0x1)return _0x16d2c4(0xf6);return undefined;}}
1
+ const a46_0xe76c57=a46_0x3b54;function a46_0x3b54(_0x18ff50,_0x7277e5){_0x18ff50=_0x18ff50-0x17f;const _0xfee99=a46_0xfee9();let _0x3b5449=_0xfee99[_0x18ff50];return _0x3b5449;}(function(_0x3a617f,_0x471c39){const _0x2f2410=a46_0x3b54,_0x3ad4b2=_0x3a617f();while(!![]){try{const _0x55273a=parseInt(_0x2f2410(0x18b))/0x1*(parseInt(_0x2f2410(0x19f))/0x2)+parseInt(_0x2f2410(0x1a9))/0x3+parseInt(_0x2f2410(0x1a5))/0x4+-parseInt(_0x2f2410(0x189))/0x5*(parseInt(_0x2f2410(0x194))/0x6)+-parseInt(_0x2f2410(0x185))/0x7*(parseInt(_0x2f2410(0x1a4))/0x8)+parseInt(_0x2f2410(0x192))/0x9+parseInt(_0x2f2410(0x18a))/0xa*(-parseInt(_0x2f2410(0x19d))/0xb);if(_0x55273a===_0x471c39)break;else _0x3ad4b2['push'](_0x3ad4b2['shift']());}catch(_0x4a4658){_0x3ad4b2['push'](_0x3ad4b2['shift']());}}}(a46_0xfee9,0x821f2));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_0xfee9(){const _0x25f970=['length','232055sxiGDz','80TihdDp','73651dJoKVb','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','cause','Querying\x20','execute','site','Limit:\x20','2178000cIJvCp','table','66YixJAK','Site:\x20','limit','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','Error:\x20','data','\x20from\x20','query','1055208QEZtCM','catalog','18TvVBBg','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Catalog:\x20','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','...','59528HSvKwL','2034164cThabq','verbose','\x20row','args','2844471olfnGC','error','message','Database:\x20','validate','✔\x20Retrieved\x20','database','showTable','518mHnZdS','Show\x20table\x20contents','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'];a46_0xfee9=function(){return _0x25f970;};return a46_0xfee9();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']='show';['description']=a46_0xe76c57(0x186);async[a46_0xe76c57(0x18f)](_0x55f542){const _0x511829=a46_0xe76c57;return this[_0x511829(0x184)](_0x55f542);}async[a46_0xe76c57(0x184)](_0xb82357){const _0x2d2fe0=a46_0xe76c57,{options:_0x526ce5,args:_0x817f42,tdx:_0xc25c7f}=_0xb82357;let _0x20d40a;try{_0x20d40a=parseTableReference(_0x817f42[0x0]);const _0x44001c=_0x526ce5[_0x2d2fe0(0x183)];!_0x20d40a[_0x2d2fe0(0x183)]&&_0x44001c&&(_0x20d40a[_0x2d2fe0(0x183)]=_0x44001c);const _0x2bc329=validateTableDescribeReference(_0x20d40a);if(_0x2bc329)return console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x199)+_0x2bc329),console[_0x2d2fe0(0x1aa)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x198)),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x18c)),0x1;}catch(_0x1da6da){return console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x199)+_0x1da6da[_0x2d2fe0(0x17f)]),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x197)),console['error'](_0x2d2fe0(0x198)),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x18c)),0x1;}const _0x2f4e4c=_0x20d40a[_0x2d2fe0(0x19e)],_0x8c8131=_0x20d40a[_0x2d2fe0(0x183)],_0x4abfe4=_0x20d40a[_0x2d2fe0(0x193)],_0x2b6b1b=resolveLimit(_0x526ce5[_0x2d2fe0(0x196)],DEFAULT_DISPLAY_LIMIT);try{_0x526ce5[_0x2d2fe0(0x1a6)]&&(console['error'](_0x2d2fe0(0x195)+_0x526ce5[_0x2d2fe0(0x190)]),_0x2f4e4c&&console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x1a1)+_0x2f4e4c),console['error'](_0x2d2fe0(0x180)+_0x8c8131),console['error']('Table:\x20'+_0x4abfe4),console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x191)+_0x2b6b1b));const _0x1cde05=_0x2f4e4c?_0x2f4e4c+'.'+_0x8c8131+'.'+_0x4abfe4:_0x8c8131+'.'+_0x4abfe4,_0x3e7c42=await withSpinner(_0x2d2fe0(0x18e)+_0x1cde05+_0x2d2fe0(0x1a3),()=>_0xc25c7f[_0x2d2fe0(0x19c)][_0x2d2fe0(0x184)](_0x8c8131,_0x4abfe4,_0x2b6b1b,_0x2f4e4c),{'verbose':_0x526ce5['verbose']}),_0x594199=_0x3e7c42[_0x2d2fe0(0x19a)],_0x2fbc51=_0x594199[_0x2d2fe0(0x19a)];return _0x2fbc51[_0x2d2fe0(0x188)]===0x0?console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x1a0)):console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x182)+_0x2fbc51['length']+_0x2d2fe0(0x1a7)+(_0x2fbc51[_0x2d2fe0(0x188)]!==0x1?'s':'')+_0x2d2fe0(0x19b)+_0x1cde05),await handleSDKOutput(_0x2fbc51,_0x526ce5),0x0;}catch(_0x3ee88d){if(_0x3ee88d instanceof SDKError)return console[_0x2d2fe0(0x1aa)](_0x2d2fe0(0x199)+_0x3ee88d[_0x2d2fe0(0x17f)]),_0x3ee88d[_0x2d2fe0(0x18d)]&&console[_0x2d2fe0(0x1aa)]('\x20\x20Cause:\x20'+_0x3ee88d[_0x2d2fe0(0x18d)]),0x1;throw _0x3ee88d;}}[a46_0xe76c57(0x181)](_0x5bbedb){const _0x39be51=a46_0xe76c57;if(_0x5bbedb[_0x39be51(0x1a8)][_0x39be51(0x188)]===0x0)return _0x39be51(0x1a2);if(_0x5bbedb['args'][_0x39be51(0x188)]>0x1)return _0x39be51(0x187);return undefined;}}
@@ -1 +1 @@
1
- const a47_0x5f05f2=a47_0x4071;(function(_0x19830d,_0x50ff4f){const _0x87f3d0=a47_0x4071,_0x48d8ab=_0x19830d();while(!![]){try{const _0x3b83d0=-parseInt(_0x87f3d0(0xac))/0x1*(parseInt(_0x87f3d0(0x99))/0x2)+-parseInt(_0x87f3d0(0xb2))/0x3*(parseInt(_0x87f3d0(0x85))/0x4)+parseInt(_0x87f3d0(0xa4))/0x5+-parseInt(_0x87f3d0(0x95))/0x6*(parseInt(_0x87f3d0(0x8c))/0x7)+parseInt(_0x87f3d0(0x88))/0x8*(parseInt(_0x87f3d0(0xaa))/0x9)+parseInt(_0x87f3d0(0x81))/0xa*(parseInt(_0x87f3d0(0x94))/0xb)+-parseInt(_0x87f3d0(0x83))/0xc;if(_0x3b83d0===_0x50ff4f)break;else _0x48d8ab['push'](_0x48d8ab['shift']());}catch(_0x18afe3){_0x48d8ab['push'](_0x48d8ab['shift']());}}}(a47_0x48bf,0xd7b73));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0x4071(_0xbef5d3,_0x46344c){_0xbef5d3=_0xbef5d3-0x80;const _0x48bf8a=a47_0x48bf();let _0x40713b=_0x48bf8a[_0xbef5d3];return _0x40713b;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x48bf(){const _0x1dfc35=['4138665EykdFN','error','config','cyan','jobs','No\x20credential\x20found','117RyArLJ','execute','109hxenKR','message','email','env','Read\x20credential\x20from\x20','last_name','82785IVpqEi','TDX_PROFILE\x20env','site:\x20','3991490aQAjnU','session','10051200djFsFJ','displayWithSources','12BDjFiO','account_id','getUserInfo','429304wDeiFj','first_name','(from\x20','N/A','104503ZCqfEw','User:','join','bold','filter','\x20profile:\x20','log','name','33bzwTDL','204CNvTes','profileSource','profile','Name:','7546ySnmCw','✓\x20Authentication\x20successful\x0a','dim','description','✗\x20Validation\x20failed:\x20','status','OAuth','yellow','Account\x20ID:','tdx','red'];a47_0x48bf=function(){return _0x1dfc35;};return a47_0x48bf();}import a47_0x46408d from'chalk';export class StatusCommand extends BaseCommand{[a47_0x5f05f2(0x93)]=a47_0x5f05f2(0x9e);[a47_0x5f05f2(0x9c)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a47_0x5f05f2(0xab)](_0x349a1a){const _0x1270f8=a47_0x5f05f2,{options:_0x372000,tdx:_0x52645c}=_0x349a1a,_0x32d121=_0x372000['site'],_0x4e7029=new GlobalContext(_0x372000),_0x1168e0=_0x4e7029[_0x1270f8(0x97)],_0x4540fa=_0x4e7029[_0x1270f8(0x96)],_0x1e4f89=_0x4540fa==='cli'?'CLI\x20flag':_0x4540fa===_0x1270f8(0x82)?_0x1270f8(0x82):_0x4540fa===_0x1270f8(0xaf)?_0x1270f8(0xb3):_0x4540fa==='config'?_0x1270f8(0xa6):null,_0x59ccf2=_0x1168e0?a47_0x46408d['cyan'](_0x1168e0):a47_0x46408d['dim'](_0x1270f8(0x8b)),_0x294db4=_0x1e4f89?'\x20'+a47_0x46408d['dim'](_0x1270f8(0x8a)+_0x1e4f89+')'):'';console[_0x1270f8(0x92)](a47_0x46408d[_0x1270f8(0x8f)](_0x1270f8(0xa2))+_0x1270f8(0x91)+_0x59ccf2+_0x294db4+'\x20'+a47_0x46408d['dim']('(')+_0x1270f8(0x80)+a47_0x46408d[_0x1270f8(0xa7)](_0x32d121)+a47_0x46408d[_0x1270f8(0x9b)](')'));const _0x32b2ee=await getOAuthTokens(_0x1168e0);if(_0x32b2ee)console[_0x1270f8(0x92)]('Credential\x20type:\x20'+a47_0x46408d[_0x1270f8(0xa7)](_0x1270f8(0x9f)));else{const _0x2a23ca=await resolveAPIKeyAsync(_0x32d121,_0x1168e0);if(_0x2a23ca){const {source:_0x1468b8,isDeprecated:_0x50b08a}=_0x2a23ca,_0x32c994=_0x1270f8(0xb0)+a47_0x46408d['cyan'](_0x1468b8);console[_0x1270f8(0x92)](_0x50b08a?a47_0x46408d['yellow'](_0x32c994):_0x32c994);}else console[_0x1270f8(0x92)](a47_0x46408d[_0x1270f8(0xa0)](_0x1270f8(0xa9)));}let _0x3be891=![];try{const _0x39f055=await _0x52645c[_0x1270f8(0xa8)][_0x1270f8(0x87)]();console['log'](a47_0x46408d['green'](_0x1270f8(0x9a))),console[_0x1270f8(0x92)](a47_0x46408d['bold'](_0x1270f8(0x8d))+'\x20'+a47_0x46408d[_0x1270f8(0xa7)](_0x39f055[_0x1270f8(0xae)]));if(_0x39f055['first_name']||_0x39f055[_0x1270f8(0xb1)]){const _0x5042e8=[_0x39f055[_0x1270f8(0x89)],_0x39f055[_0x1270f8(0xb1)]][_0x1270f8(0x90)](Boolean)[_0x1270f8(0x8e)]('\x20');console[_0x1270f8(0x92)](a47_0x46408d['bold'](_0x1270f8(0x98))+'\x20'+_0x5042e8);}_0x39f055[_0x1270f8(0x86)]&&console[_0x1270f8(0x92)](a47_0x46408d[_0x1270f8(0x8f)](_0x1270f8(0xa1))+'\x20'+a47_0x46408d[_0x1270f8(0xa0)](_0x39f055['account_id'])),_0x3be891=!![];}catch(_0x467557){_0x467557 instanceof HTTPClientError&&_0x467557[_0x1270f8(0x9e)]===0x191?printAuthError(_0x467557,!![],_0x1168e0):console[_0x1270f8(0xa5)](a47_0x46408d[_0x1270f8(0xa3)](_0x1270f8(0x9d)+(_0x467557 instanceof Error?_0x467557[_0x1270f8(0xad)]:String(_0x467557))));}return console['log'](),_0x4e7029[_0x1270f8(0x84)](),_0x3be891?0x0:0x1;}}
1
+ const a47_0x2d37ce=a47_0x21c9;function a47_0x21c9(_0x4adfa2,_0x47732e){_0x4adfa2=_0x4adfa2-0x96;const _0x2c906b=a47_0x2c90();let _0x21c91a=_0x2c906b[_0x4adfa2];return _0x21c91a;}(function(_0x16a8be,_0x51333e){const _0x517eec=a47_0x21c9,_0x1f30c2=_0x16a8be();while(!![]){try{const _0x540c5d=parseInt(_0x517eec(0x9e))/0x1+parseInt(_0x517eec(0xad))/0x2*(parseInt(_0x517eec(0xa0))/0x3)+-parseInt(_0x517eec(0xa7))/0x4*(-parseInt(_0x517eec(0xbc))/0x5)+parseInt(_0x517eec(0xa3))/0x6+parseInt(_0x517eec(0xba))/0x7+parseInt(_0x517eec(0x9d))/0x8*(parseInt(_0x517eec(0xbd))/0x9)+-parseInt(_0x517eec(0xaa))/0xa;if(_0x540c5d===_0x51333e)break;else _0x1f30c2['push'](_0x1f30c2['shift']());}catch(_0x1374e4){_0x1f30c2['push'](_0x1f30c2['shift']());}}}(a47_0x2c90,0xe602e));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x242580 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x2d37ce(0xb3)]=a47_0x2d37ce(0x98);['description']=a47_0x2d37ce(0xa9);async[a47_0x2d37ce(0xbe)](_0x10f34f){const _0x38966d=a47_0x2d37ce,{options:_0x12eb20,tdx:_0x1e0397}=_0x10f34f,_0x1fe7c7=_0x12eb20[_0x38966d(0xc3)],_0x12edc1=new GlobalContext(_0x12eb20),_0x26ca05=_0x12edc1[_0x38966d(0xb6)],_0x3fa51f=_0x12edc1[_0x38966d(0x9b)],_0x37c798=_0x3fa51f===_0x38966d(0xb7)?_0x38966d(0xa2):_0x3fa51f==='session'?_0x38966d(0xbb):_0x3fa51f==='env'?_0x38966d(0x9c):_0x3fa51f===_0x38966d(0xac)?_0x38966d(0xac):null,_0x453627=_0x26ca05?a47_0x242580[_0x38966d(0xb9)](_0x26ca05):a47_0x242580[_0x38966d(0xb1)](_0x38966d(0xc2)),_0x37f71a=_0x37c798?'\x20'+a47_0x242580[_0x38966d(0xb1)](_0x38966d(0x9a)+_0x37c798+')'):'';console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0x99)](_0x38966d(0xc5))+_0x38966d(0xc6)+_0x453627+_0x37f71a+'\x20'+a47_0x242580[_0x38966d(0xb1)]('(')+'site:\x20'+a47_0x242580['cyan'](_0x1fe7c7)+a47_0x242580[_0x38966d(0xb1)](')'));const _0x128e09=await getOAuthTokens(_0x26ca05);if(_0x128e09)console[_0x38966d(0x9f)](_0x38966d(0xb4)+a47_0x242580[_0x38966d(0xb9)](_0x38966d(0xb0)));else{const _0x1523c4=await resolveAPIKeyAsync(_0x1fe7c7,_0x26ca05);if(_0x1523c4){const {source:_0x34b373,isDeprecated:_0x119af5}=_0x1523c4,_0x44945d=_0x38966d(0xa6)+a47_0x242580[_0x38966d(0xb9)](_0x34b373);console['log'](_0x119af5?a47_0x242580['yellow'](_0x44945d):_0x44945d);}else console[_0x38966d(0x9f)](a47_0x242580['yellow'](_0x38966d(0xa1)));}let _0x5d0565=![];try{const _0x26712c=await _0x1e0397['jobs'][_0x38966d(0xc1)]();console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0xc0)](_0x38966d(0xa8))),console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0x99)](_0x38966d(0xaf))+'\x20'+a47_0x242580['cyan'](_0x26712c[_0x38966d(0xab)]));if(_0x26712c[_0x38966d(0xb5)]||_0x26712c[_0x38966d(0xa5)]){const _0xb429fd=[_0x26712c['first_name'],_0x26712c[_0x38966d(0xa5)]][_0x38966d(0xc7)](Boolean)[_0x38966d(0xb2)]('\x20');console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0x99)](_0x38966d(0xc8))+'\x20'+_0xb429fd);}_0x26712c[_0x38966d(0xbf)]&&console[_0x38966d(0x9f)](a47_0x242580[_0x38966d(0x99)](_0x38966d(0x96))+'\x20'+a47_0x242580[_0x38966d(0xb8)](_0x26712c['account_id'])),_0x5d0565=!![];}catch(_0x4fd31c){_0x4fd31c instanceof HTTPClientError&&_0x4fd31c[_0x38966d(0x98)]===0x191?printAuthError(_0x4fd31c,!![],_0x26ca05):console[_0x38966d(0x97)](a47_0x242580[_0x38966d(0xae)](_0x38966d(0xa4)+(_0x4fd31c instanceof Error?_0x4fd31c['message']:String(_0x4fd31c))));}return console['log'](),_0x12edc1[_0x38966d(0xc4)](),_0x5d0565?0x0:0x1;}}function a47_0x2c90(){const _0x3a02bc=['red','User:','OAuth','dim','join','name','Credential\x20type:\x20','first_name','profile','cli','yellow','cyan','7375242NmiPdy','session','2907145qlmFii','18mXsZaJ','execute','account_id','green','getUserInfo','N/A','site','displayWithSources','tdx','\x20profile:\x20','filter','Name:','Account\x20ID:','error','status','bold','(from\x20','profileSource','TDX_PROFILE\x20env','7038664ExKngl','677375otCpKP','log','51tMqDjB','No\x20credential\x20found','CLI\x20flag','3792192faVkPl','✗\x20Validation\x20failed:\x20','last_name','Read\x20credential\x20from\x20','4WyZLCl','✓\x20Authentication\x20successful\x0a','Show\x20authentication\x20status\x20and\x20current\x20context','41039030EExQOY','email','config','40226OVPxNT'];a47_0x2c90=function(){return _0x3a02bc;};return a47_0x2c90();}