@treasuredata/tdx 2026.9.0 → 2026.9.2

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 (429) hide show
  1. package/README.md +3 -8
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.d.ts +1 -1
  5. package/dist/cli-categories.js +1 -1
  6. package/dist/cli-categories.js.map +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/activations.js +1 -1
  11. package/dist/commands/agent-command.js +1 -1
  12. package/dist/commands/agent-test-command.js +1 -1
  13. package/dist/commands/ai-usage-command-base.d.ts +26 -0
  14. package/dist/commands/ai-usage-command-base.d.ts.map +1 -0
  15. package/dist/commands/ai-usage-command-base.js +1 -0
  16. package/dist/commands/ai-usage-command-base.js.map +1 -0
  17. package/dist/commands/api-command.js +1 -1
  18. package/dist/commands/auth-command.js +1 -1
  19. package/dist/commands/cas-command.js +1 -1
  20. package/dist/commands/cas-segment-command.js +1 -1
  21. package/dist/commands/chat-command.js +1 -1
  22. package/dist/commands/claude-command.d.ts +60 -3
  23. package/dist/commands/claude-command.d.ts.map +1 -1
  24. package/dist/commands/claude-command.js +1 -1
  25. package/dist/commands/claude-command.js.map +1 -1
  26. package/dist/commands/claude-statusline-command.js +1 -1
  27. package/dist/commands/claude-usage-command.d.ts +4 -7
  28. package/dist/commands/claude-usage-command.d.ts.map +1 -1
  29. package/dist/commands/claude-usage-command.js +1 -1
  30. package/dist/commands/claude-usage-command.js.map +1 -1
  31. package/dist/commands/codex-command.js +1 -1
  32. package/dist/commands/command.js +1 -1
  33. package/dist/commands/connection-command.js +1 -1
  34. package/dist/commands/databases.js +1 -1
  35. package/dist/commands/delivery-command.js +1 -1
  36. package/dist/commands/describe.js +1 -1
  37. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  38. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  39. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  40. package/dist/commands/engage-campaign-pull-command.js +1 -1
  41. package/dist/commands/engage-campaign-push-command.d.ts +1 -0
  42. package/dist/commands/engage-campaign-push-command.d.ts.map +1 -1
  43. package/dist/commands/engage-campaign-push-command.js +1 -1
  44. package/dist/commands/engage-campaign-push-command.js.map +1 -1
  45. package/dist/commands/engage-campaign-readiness-command.d.ts +8 -0
  46. package/dist/commands/engage-campaign-readiness-command.d.ts.map +1 -0
  47. package/dist/commands/engage-campaign-readiness-command.js +1 -0
  48. package/dist/commands/engage-campaign-readiness-command.js.map +1 -0
  49. package/dist/commands/engage-campaign-validate-command.d.ts +1 -0
  50. package/dist/commands/engage-campaign-validate-command.d.ts.map +1 -1
  51. package/dist/commands/engage-campaign-validate-command.js +1 -1
  52. package/dist/commands/engage-campaign-validate-command.js.map +1 -1
  53. package/dist/commands/engage-command.d.ts +1 -0
  54. package/dist/commands/engage-command.d.ts.map +1 -1
  55. package/dist/commands/engage-command.js +1 -1
  56. package/dist/commands/engage-command.js.map +1 -1
  57. package/dist/commands/engage-in-browser-message-command.d.ts +33 -0
  58. package/dist/commands/engage-in-browser-message-command.d.ts.map +1 -0
  59. package/dist/commands/engage-in-browser-message-command.js +1 -0
  60. package/dist/commands/engage-in-browser-message-command.js.map +1 -0
  61. package/dist/commands/engage-landing-page-command.js +1 -1
  62. package/dist/commands/engage-template-pull-command.js +1 -1
  63. package/dist/commands/engage-template-push-command.js +1 -1
  64. package/dist/commands/engage-template-validate-command.js +1 -1
  65. package/dist/commands/engage-workspace-assignment-command.d.ts +55 -0
  66. package/dist/commands/engage-workspace-assignment-command.d.ts.map +1 -0
  67. package/dist/commands/engage-workspace-assignment-command.js +1 -0
  68. package/dist/commands/engage-workspace-assignment-command.js.map +1 -0
  69. package/dist/commands/job-command.js +1 -1
  70. package/dist/commands/journey-command.d.ts.map +1 -1
  71. package/dist/commands/journey-command.js +1 -1
  72. package/dist/commands/journey-command.js.map +1 -1
  73. package/dist/commands/journey-validate-command.js +1 -1
  74. package/dist/commands/llm-command.js +1 -1
  75. package/dist/commands/mcp-command.js +1 -1
  76. package/dist/commands/opencode-command.d.ts +18 -0
  77. package/dist/commands/opencode-command.d.ts.map +1 -0
  78. package/dist/commands/opencode-command.js +1 -0
  79. package/dist/commands/opencode-command.js.map +1 -0
  80. package/dist/commands/opencode-usage-command.d.ts +19 -0
  81. package/dist/commands/opencode-usage-command.d.ts.map +1 -0
  82. package/dist/commands/opencode-usage-command.js +1 -0
  83. package/dist/commands/opencode-usage-command.js.map +1 -0
  84. package/dist/commands/p13n-command.d.ts +72 -0
  85. package/dist/commands/p13n-command.d.ts.map +1 -1
  86. package/dist/commands/p13n-command.js +1 -1
  87. package/dist/commands/p13n-command.js.map +1 -1
  88. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  89. package/dist/commands/parent-segment-command.js +1 -1
  90. package/dist/commands/parent-segment-command.js.map +1 -1
  91. package/dist/commands/policy-command.js +1 -1
  92. package/dist/commands/profile-command.js +1 -1
  93. package/dist/commands/profiles-command.js +1 -1
  94. package/dist/commands/query-command.js +1 -1
  95. package/dist/commands/schedule-command.js +1 -1
  96. package/dist/commands/segment-command.js +1 -1
  97. package/dist/commands/segment-create-command.js +1 -1
  98. package/dist/commands/segment-fields-command.js +1 -1
  99. package/dist/commands/segment-move-command.js +1 -1
  100. package/dist/commands/segment-pull-command.js +1 -1
  101. package/dist/commands/segment-push-command.js +1 -1
  102. package/dist/commands/segment-update-command.js +1 -1
  103. package/dist/commands/segment-use-command.js +1 -1
  104. package/dist/commands/segment-validate-command.js +1 -1
  105. package/dist/commands/segments.js +1 -1
  106. package/dist/commands/show.js +1 -1
  107. package/dist/commands/status-command.js +1 -1
  108. package/dist/commands/table-deleted.js +1 -1
  109. package/dist/commands/tables.js +1 -1
  110. package/dist/commands/unset-command.js +1 -1
  111. package/dist/commands/upgrade-command.js +1 -1
  112. package/dist/commands/use-command.js +1 -1
  113. package/dist/commands/user-command.js +1 -1
  114. package/dist/commands/work-command.js +1 -1
  115. package/dist/commands/workflow-command.js +1 -1
  116. package/dist/core/auth.js +1 -1
  117. package/dist/core/command-output.js +1 -1
  118. package/dist/core/config.js +1 -1
  119. package/dist/core/connection-cache.js +1 -1
  120. package/dist/core/constants.js +1 -1
  121. package/dist/core/credential-cache.js +1 -1
  122. package/dist/core/global-context.js +1 -1
  123. package/dist/core/keychain.js +1 -1
  124. package/dist/core/oauth-keychain.js +1 -1
  125. package/dist/core/oauth.js +1 -1
  126. package/dist/core/profile.js +1 -1
  127. package/dist/core/project-config.js +1 -1
  128. package/dist/core/session.js +1 -1
  129. package/dist/core/site-mismatch.js +1 -1
  130. package/dist/core/user-cache.js +1 -1
  131. package/dist/core/version.js +1 -1
  132. package/dist/index.js +1 -1
  133. package/dist/mcp/server.js +1 -1
  134. package/dist/mcp/tools/index.js +1 -1
  135. package/dist/mcp/tools/tdx-run.js +1 -1
  136. package/dist/mcp/tools/tdx-search.js +1 -1
  137. package/dist/mcp/tools/work-create-item.js +1 -1
  138. package/dist/mcp/utils.js +1 -1
  139. package/dist/proxy/claude-usage-tracker.d.ts +1 -1
  140. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  141. package/dist/proxy/claude-usage-tracker.js +1 -1
  142. package/dist/proxy/passthrough-server.d.ts +33 -0
  143. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  144. package/dist/proxy/passthrough-server.js +1 -1
  145. package/dist/proxy/passthrough-server.js.map +1 -1
  146. package/dist/proxy/sse-usage-parser.js +1 -1
  147. package/dist/sdk/agent/agent-config.js +1 -1
  148. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  149. package/dist/sdk/agent/agent-yaml.js +1 -1
  150. package/dist/sdk/agent/test/evaluator.js +1 -1
  151. package/dist/sdk/agent/test/executor.js +1 -1
  152. package/dist/sdk/agent/test/index.js +1 -1
  153. package/dist/sdk/agent/test/output.js +1 -1
  154. package/dist/sdk/agent/test/parser.js +1 -1
  155. package/dist/sdk/agent/tool-target-registry.js +1 -1
  156. package/dist/sdk/api.js +1 -1
  157. package/dist/sdk/auth-token.js +1 -1
  158. package/dist/sdk/cas/cas-api-client.d.ts +27 -0
  159. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  160. package/dist/sdk/cas/cas-api-client.js +1 -1
  161. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  162. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  163. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  164. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  165. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  166. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  167. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  168. package/dist/sdk/cas/index.d.ts +51 -1
  169. package/dist/sdk/cas/index.d.ts.map +1 -1
  170. package/dist/sdk/cas/index.js +1 -1
  171. package/dist/sdk/cas/index.js.map +1 -1
  172. package/dist/sdk/cas/pull-workflow.js +1 -1
  173. package/dist/sdk/cas/push-workflow.js +1 -1
  174. package/dist/sdk/cas/validate-files.js +1 -1
  175. package/dist/sdk/client/cdp-api-client.js +1 -1
  176. package/dist/sdk/client/delivery-api-client.d.ts +6 -5
  177. package/dist/sdk/client/delivery-api-client.d.ts.map +1 -1
  178. package/dist/sdk/client/delivery-api-client.js +1 -1
  179. package/dist/sdk/client/delivery-api-client.js.map +1 -1
  180. package/dist/sdk/client/endpoints.d.ts +9 -0
  181. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  182. package/dist/sdk/client/endpoints.js +1 -1
  183. package/dist/sdk/client/endpoints.js.map +1 -1
  184. package/dist/sdk/client/engage-api-client.d.ts +28 -2
  185. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  186. package/dist/sdk/client/engage-api-client.js +1 -1
  187. package/dist/sdk/client/engage-api-client.js.map +1 -1
  188. package/dist/sdk/client/http-client.d.ts +25 -1
  189. package/dist/sdk/client/http-client.d.ts.map +1 -1
  190. package/dist/sdk/client/http-client.js +1 -1
  191. package/dist/sdk/client/http-client.js.map +1 -1
  192. package/dist/sdk/client/llm-api-client.js +1 -1
  193. package/dist/sdk/client/oauth-refresh.js +1 -1
  194. package/dist/sdk/client/p13n-studio-api-client.d.ts +114 -7
  195. package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -1
  196. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  197. package/dist/sdk/client/p13n-studio-api-client.js.map +1 -1
  198. package/dist/sdk/client/rate-limiter.js +1 -1
  199. package/dist/sdk/client/td-api-client.js +1 -1
  200. package/dist/sdk/client/trino-api-client.js +1 -1
  201. package/dist/sdk/client/workflow-client.js +1 -1
  202. package/dist/sdk/connection-validator.js +1 -1
  203. package/dist/sdk/connection.js +1 -1
  204. package/dist/sdk/delivery.d.ts +19 -22
  205. package/dist/sdk/delivery.d.ts.map +1 -1
  206. package/dist/sdk/delivery.js +1 -1
  207. package/dist/sdk/delivery.js.map +1 -1
  208. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  209. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  210. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  211. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  212. package/dist/sdk/engage/campaign-pull.js +1 -1
  213. package/dist/sdk/engage/campaign-push.js +1 -1
  214. package/dist/sdk/engage/campaign-readiness-workflow.d.ts +44 -0
  215. package/dist/sdk/engage/campaign-readiness-workflow.d.ts.map +1 -0
  216. package/dist/sdk/engage/campaign-readiness-workflow.js +1 -0
  217. package/dist/sdk/engage/campaign-readiness-workflow.js.map +1 -0
  218. package/dist/sdk/engage/campaign-readiness.d.ts +38 -0
  219. package/dist/sdk/engage/campaign-readiness.d.ts.map +1 -0
  220. package/dist/sdk/engage/campaign-readiness.js +1 -0
  221. package/dist/sdk/engage/campaign-readiness.js.map +1 -0
  222. package/dist/sdk/engage/campaign-validator.d.ts +8 -0
  223. package/dist/sdk/engage/campaign-validator.d.ts.map +1 -1
  224. package/dist/sdk/engage/campaign-validator.js +1 -1
  225. package/dist/sdk/engage/campaign-validator.js.map +1 -1
  226. package/dist/sdk/engage/campaign-yaml.js +1 -1
  227. package/dist/sdk/engage/in-browser-message-pull.d.ts +41 -0
  228. package/dist/sdk/engage/in-browser-message-pull.d.ts.map +1 -0
  229. package/dist/sdk/engage/in-browser-message-pull.js +1 -0
  230. package/dist/sdk/engage/in-browser-message-pull.js.map +1 -0
  231. package/dist/sdk/engage/in-browser-message-push.d.ts +59 -0
  232. package/dist/sdk/engage/in-browser-message-push.d.ts.map +1 -0
  233. package/dist/sdk/engage/in-browser-message-push.js +1 -0
  234. package/dist/sdk/engage/in-browser-message-push.js.map +1 -0
  235. package/dist/sdk/engage/in-browser-message-validator.d.ts +9 -0
  236. package/dist/sdk/engage/in-browser-message-validator.d.ts.map +1 -0
  237. package/dist/sdk/engage/in-browser-message-validator.js +1 -0
  238. package/dist/sdk/engage/in-browser-message-validator.js.map +1 -0
  239. package/dist/sdk/engage/in-browser-message-yaml.d.ts +36 -0
  240. package/dist/sdk/engage/in-browser-message-yaml.d.ts.map +1 -0
  241. package/dist/sdk/engage/in-browser-message-yaml.js +1 -0
  242. package/dist/sdk/engage/in-browser-message-yaml.js.map +1 -0
  243. package/dist/sdk/engage/landing-page-init.js +1 -1
  244. package/dist/sdk/engage/landing-page-public-asset.js +1 -1
  245. package/dist/sdk/engage/landing-page-pull.js +1 -1
  246. package/dist/sdk/engage/landing-page-push.js +1 -1
  247. package/dist/sdk/engage/landing-page-static-site.js +1 -1
  248. package/dist/sdk/engage/landing-page-validator.js +1 -1
  249. package/dist/sdk/engage/landing-page-workspace.js +1 -1
  250. package/dist/sdk/engage/landing-page-yaml.js +1 -1
  251. package/dist/sdk/engage/list-campaign-schema.d.ts +48 -0
  252. package/dist/sdk/engage/list-campaign-schema.d.ts.map +1 -0
  253. package/dist/sdk/engage/list-campaign-schema.js +1 -0
  254. package/dist/sdk/engage/list-campaign-schema.js.map +1 -0
  255. package/dist/sdk/engage/list-campaign-yaml.d.ts +31 -0
  256. package/dist/sdk/engage/list-campaign-yaml.d.ts.map +1 -0
  257. package/dist/sdk/engage/list-campaign-yaml.js +1 -0
  258. package/dist/sdk/engage/list-campaign-yaml.js.map +1 -0
  259. package/dist/sdk/engage/template-pull.js +1 -1
  260. package/dist/sdk/engage/template-push.js +1 -1
  261. package/dist/sdk/engage/template-validator.js +1 -1
  262. package/dist/sdk/engage/template-yaml.js +1 -1
  263. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  264. package/dist/sdk/engage/types/campaign-def.js +1 -1
  265. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  266. package/dist/sdk/engage/types/in-browser-message-schema.d.ts +32 -0
  267. package/dist/sdk/engage/types/in-browser-message-schema.d.ts.map +1 -0
  268. package/dist/sdk/engage/types/in-browser-message-schema.js +1 -0
  269. package/dist/sdk/engage/types/in-browser-message-schema.js.map +1 -0
  270. package/dist/sdk/engage/types/landing-page-schema.js +1 -1
  271. package/dist/sdk/engage/types/template-schema.js +1 -1
  272. package/dist/sdk/engage/workspace-assignments.d.ts +23 -0
  273. package/dist/sdk/engage/workspace-assignments.d.ts.map +1 -0
  274. package/dist/sdk/engage/workspace-assignments.js +1 -0
  275. package/dist/sdk/engage/workspace-assignments.js.map +1 -0
  276. package/dist/sdk/engage.d.ts +63 -3
  277. package/dist/sdk/engage.d.ts.map +1 -1
  278. package/dist/sdk/engage.js +1 -1
  279. package/dist/sdk/engage.js.map +1 -1
  280. package/dist/sdk/errors.d.ts +12 -0
  281. package/dist/sdk/errors.d.ts.map +1 -1
  282. package/dist/sdk/errors.js +1 -1
  283. package/dist/sdk/errors.js.map +1 -1
  284. package/dist/sdk/index.d.ts +3 -2
  285. package/dist/sdk/index.d.ts.map +1 -1
  286. package/dist/sdk/index.js +1 -1
  287. package/dist/sdk/index.js.map +1 -1
  288. package/dist/sdk/io/index.js +1 -1
  289. package/dist/sdk/io/node-filesystem.js +1 -1
  290. package/dist/sdk/job.js +1 -1
  291. package/dist/sdk/journey.d.ts +42 -1
  292. package/dist/sdk/journey.d.ts.map +1 -1
  293. package/dist/sdk/journey.js +1 -1
  294. package/dist/sdk/journey.js.map +1 -1
  295. package/dist/sdk/llm/chat-cache.js +1 -1
  296. package/dist/sdk/llm/index.js +1 -1
  297. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  298. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  299. package/dist/sdk/llm/model-factors.js +1 -1
  300. package/dist/sdk/llm/model-factors.js.map +1 -1
  301. package/dist/sdk/llm/user-settings.js +1 -1
  302. package/dist/sdk/p13n-studio-errors.d.ts +137 -0
  303. package/dist/sdk/p13n-studio-errors.d.ts.map +1 -0
  304. package/dist/sdk/p13n-studio-errors.js +1 -0
  305. package/dist/sdk/p13n-studio-errors.js.map +1 -0
  306. package/dist/sdk/p13n-studio.d.ts +260 -16
  307. package/dist/sdk/p13n-studio.d.ts.map +1 -1
  308. package/dist/sdk/p13n-studio.js +1 -1
  309. package/dist/sdk/p13n-studio.js.map +1 -1
  310. package/dist/sdk/personalization.js +1 -1
  311. package/dist/sdk/policy.js +1 -1
  312. package/dist/sdk/query/deleted-table-validation.js +1 -1
  313. package/dist/sdk/query/index.js +1 -1
  314. package/dist/sdk/query/sql-parser.js +1 -1
  315. package/dist/sdk/realtime.js +1 -1
  316. package/dist/sdk/schedule.js +1 -1
  317. package/dist/sdk/segment/audience-context.d.ts +133 -0
  318. package/dist/sdk/segment/audience-context.d.ts.map +1 -0
  319. package/dist/sdk/segment/audience-context.js +1 -0
  320. package/dist/sdk/segment/audience-context.js.map +1 -0
  321. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  322. package/dist/sdk/segment/fields-display.js +1 -1
  323. package/dist/sdk/segment/file-discovery.js +1 -1
  324. package/dist/sdk/segment/journey-utils.js +1 -1
  325. package/dist/sdk/segment/journey-validator.js +1 -1
  326. package/dist/sdk/segment/journey-yaml.js +1 -1
  327. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  328. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  329. package/dist/sdk/segment/pull-workflow.js +1 -1
  330. package/dist/sdk/segment/push-recovery.js +1 -1
  331. package/dist/sdk/segment/push-workflow.js +1 -1
  332. package/dist/sdk/segment/resolution-context.js +1 -1
  333. package/dist/sdk/segment/segment-path-parser.js +1 -1
  334. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  335. package/dist/sdk/segment/segment-validator.js +1 -1
  336. package/dist/sdk/segment/target-resolution.js +1 -1
  337. package/dist/sdk/segment/tdx-config.js +1 -1
  338. package/dist/sdk/segment/types/activation-schema.js +1 -1
  339. package/dist/sdk/segment/types/journey-def.js +1 -1
  340. package/dist/sdk/segment/types/journey-schema.d.ts +1 -1
  341. package/dist/sdk/segment/types/journey-schema.js +1 -1
  342. package/dist/sdk/segment/types/segment-def.js +1 -1
  343. package/dist/sdk/segment/types/segment-schema.js +1 -1
  344. package/dist/sdk/segment/validate-files.d.ts +5 -2
  345. package/dist/sdk/segment/validate-files.d.ts.map +1 -1
  346. package/dist/sdk/segment/validate-files.js +1 -1
  347. package/dist/sdk/segment/validate-files.js.map +1 -1
  348. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  349. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  350. package/dist/sdk/segment/yaml-validator.js +1 -1
  351. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  352. package/dist/sdk/segment.d.ts +61 -0
  353. package/dist/sdk/segment.d.ts.map +1 -1
  354. package/dist/sdk/segment.js +1 -1
  355. package/dist/sdk/segment.js.map +1 -1
  356. package/dist/sdk/types/cas.d.ts +12 -0
  357. package/dist/sdk/types/cas.d.ts.map +1 -1
  358. package/dist/sdk/types/engage.d.ts +184 -2
  359. package/dist/sdk/types/engage.d.ts.map +1 -1
  360. package/dist/sdk/types/index.d.ts +2 -2
  361. package/dist/sdk/types/index.d.ts.map +1 -1
  362. package/dist/sdk/types/index.js +1 -1
  363. package/dist/sdk/types/index.js.map +1 -1
  364. package/dist/sdk/types/p13n-studio.d.ts +133 -1
  365. package/dist/sdk/types/p13n-studio.d.ts.map +1 -1
  366. package/dist/sdk/types/progress.js +1 -1
  367. package/dist/sdk/types/workspace.js +1 -1
  368. package/dist/sdk/user.js +1 -1
  369. package/dist/sdk/util/format-detector.js +1 -1
  370. package/dist/sdk/util/formatters.js +1 -1
  371. package/dist/sdk/util/index.js +1 -1
  372. package/dist/sdk/util/paginate.js +1 -1
  373. package/dist/sdk/util/tree-formatter.js +1 -1
  374. package/dist/sdk/util/tree-search.js +1 -1
  375. package/dist/sdk/workflow/archive-validation.js +1 -1
  376. package/dist/sdk/workflow/clone-workflow.js +1 -1
  377. package/dist/sdk/workflow/index.js +1 -1
  378. package/dist/sdk/workflow/pull-workflow.js +1 -1
  379. package/dist/sdk/workflow/push-workflow.js +1 -1
  380. package/dist/sdk/workflow/task-graph.js +1 -1
  381. package/dist/sdk/workflow/tdx-config.js +1 -1
  382. package/dist/sdk/workflow/workflow-utils.js +1 -1
  383. package/dist/sdk/workspace/access-tracker.js +1 -1
  384. package/dist/sdk/workspace/frontmatter.js +1 -1
  385. package/dist/sdk/workspace/git.js +1 -1
  386. package/dist/sdk/workspace/index.js +1 -1
  387. package/dist/sdk/workspace/templates.js +1 -1
  388. package/dist/sdk/workspace/weekly.js +1 -1
  389. package/dist/sdk/workspace/wikilinks.js +1 -1
  390. package/dist/test-utils/command-runner.js +1 -1
  391. package/dist/test-utils/factories.js +1 -1
  392. package/dist/test-utils/fixtures.js +1 -1
  393. package/dist/test-utils/http-mock.d.ts +10 -0
  394. package/dist/test-utils/http-mock.d.ts.map +1 -1
  395. package/dist/test-utils/http-mock.js +1 -1
  396. package/dist/test-utils/http-mock.js.map +1 -1
  397. package/dist/test-utils/index.js +1 -1
  398. package/dist/utils/async.js +1 -1
  399. package/dist/utils/claude-code-state.js +1 -1
  400. package/dist/utils/colors.js +1 -1
  401. package/dist/utils/diff.js +1 -1
  402. package/dist/utils/file-permissions.js +1 -1
  403. package/dist/utils/file-reader.js +1 -1
  404. package/dist/utils/github-releases.js +1 -1
  405. package/dist/utils/global-cache.js +1 -1
  406. package/dist/utils/json-loader.js +1 -1
  407. package/dist/utils/local-cache.js +1 -1
  408. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  409. package/dist/utils/logger/formatters/index.js +1 -1
  410. package/dist/utils/logger/handlers/console-handler.js +1 -1
  411. package/dist/utils/logger/handlers/file-handler.js +1 -1
  412. package/dist/utils/logger/handlers/index.js +1 -1
  413. package/dist/utils/logger/handlers/null-handler.js +1 -1
  414. package/dist/utils/logger/index.js +1 -1
  415. package/dist/utils/logger/logger.js +1 -1
  416. package/dist/utils/logger/types.js +1 -1
  417. package/dist/utils/option-validation.js +1 -1
  418. package/dist/utils/process.d.ts.map +1 -1
  419. package/dist/utils/process.js +1 -1
  420. package/dist/utils/process.js.map +1 -1
  421. package/dist/utils/prompt.js +1 -1
  422. package/dist/utils/proxy-fetch.js +1 -1
  423. package/dist/utils/spinner.js +1 -1
  424. package/dist/utils/sse-parser.js +1 -1
  425. package/dist/utils/string-utils.js +1 -1
  426. package/dist/utils/table-ref-parser.js +1 -1
  427. package/dist/utils/tdx-logger.js +1 -1
  428. package/dist/utils/version-check.js +1 -1
  429. package/package.json +5 -9
@@ -1 +1 @@
1
- const a47_0x4f11c7=a47_0x1dce;function a47_0x1dce(_0x9c9ff2,_0xb7ec7d){_0x9c9ff2=_0x9c9ff2-0x13d;const _0x20017d=a47_0x2001();let _0x1dce44=_0x20017d[_0x9c9ff2];return _0x1dce44;}(function(_0x300a75,_0x5f30ca){const _0x1118c0=a47_0x1dce,_0x317a18=_0x300a75();while(!![]){try{const _0x59f93e=parseInt(_0x1118c0(0x153))/0x1+-parseInt(_0x1118c0(0x179))/0x2+parseInt(_0x1118c0(0x156))/0x3+-parseInt(_0x1118c0(0x180))/0x4+-parseInt(_0x1118c0(0x171))/0x5+-parseInt(_0x1118c0(0x155))/0x6+parseInt(_0x1118c0(0x16e))/0x7*(parseInt(_0x1118c0(0x184))/0x8);if(_0x59f93e===_0x5f30ca)break;else _0x317a18['push'](_0x317a18['shift']());}catch(_0x19ae9f){_0x317a18['push'](_0x317a18['shift']());}}}(a47_0x2001,0x8e988));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a47_0x2001(){const _0x38ca77=['description','5204766qufKlu','2688057lutsub','\x20changed\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20files\x20to\x20','\x20files?','✔\x20Context\x20set:\x20','verbose','message','error','Site:\x20','dryRun','filter','\x20=\x20','\x20\x20🎯\x20','diff','\x20\x20🗺️\x20\x20','setPhase','\x20segments','\x0aError:','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20\x20Target:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aPull\x20summary\x20for\x20\x27','repeat','5353481KgVKWK','helpText','\x20journeys','2870255uTtzbz','site','\x27...','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parent_segment','\x20new\x20files','\x20activations','1014382xCTlPV','Write\x20','journeys','execute','targetDir','session','cyan','851976LRPgmB','Pulling\x20segments\x20from\x20\x27','absolutePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','16olABeF','✔\x20Pulled\x20','parentSegment','dim','\x0aChanges\x20to\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','name','red','hasChanges','counts','journeyVersions','length','type','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dirname','files','green','segment:pull','cwd','activations','data','\x20with\x20','no_parent','content','isNew','yellow','pullSegments','file','\x20unchanged\x20files','320184FGvlZt'];a47_0x2001=function(){return _0x38ca77;};return a47_0x2001();}import{saveSessionContext}from'../core/session.js';import a47_0x22d307 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a47_0x256d74 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{[a47_0x4f11c7(0x18a)]=a47_0x4f11c7(0x147);[a47_0x4f11c7(0x154)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a47_0x4f11c7(0x17c)](_0x138af6){const _0x6e8cc9=a47_0x4f11c7,{options:_0x263341,args:_0x33a513,tdx:_0x475789}=_0x138af6,_0x5d6fe1=_0x263341,_0x457f93=await resolveTarget({'arg':_0x33a513[0x0],'contextParent':_0x263341[_0x6e8cc9(0x186)],'cwd':process[_0x6e8cc9(0x148)]()});if(!isSuccessfulResolution(_0x457f93))return _0x457f93['errorCode']===_0x6e8cc9(0x14c)?(console[_0x6e8cc9(0x15e)](a47_0x22d307[_0x6e8cc9(0x14f)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x6e8cc9(0x15e)]('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[_0x6e8cc9(0x15e)](_0x6e8cc9(0x158)),console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x175))):(console[_0x6e8cc9(0x15e)](a47_0x22d307['red']('Error:\x20'+_0x457f93[_0x6e8cc9(0x15d)]+'\x0a')),_0x457f93[_0x6e8cc9(0x16f)]&&console['error'](a47_0x22d307[_0x6e8cc9(0x17f)](_0x457f93[_0x6e8cc9(0x16f)]))),0x1;const _0x137ac9=_0x457f93[_0x6e8cc9(0x174)],_0xf66c0e=_0x457f93[_0x6e8cc9(0x17d)],_0x1e70b4=_0x457f93[_0x6e8cc9(0x142)]===_0x6e8cc9(0x151)?_0x457f93['resourceName']:undefined;_0x5d6fe1[_0x6e8cc9(0x15c)]&&(console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x15f)+_0x5d6fe1[_0x6e8cc9(0x172)]),console[_0x6e8cc9(0x15e)]('Parent\x20segment:\x20'+_0x137ac9),_0x1e70b4&&console[_0x6e8cc9(0x15e)]('Target\x20resource:\x20'+_0x1e70b4));const _0x248bd7=await withProgressSpinner(_0x6e8cc9(0x181)+_0x137ac9+_0x6e8cc9(0x173),_0x60a0cb=>_0x475789['segment'][_0x6e8cc9(0x150)](_0x137ac9,{'targetDir':_0xf66c0e,'targetResourceName':_0x1e70b4,'verbose':_0x5d6fe1['verbose'],'progress':{'update':_0x103864=>{const _0x4f9e8c=_0x6e8cc9;_0x60a0cb[_0x4f9e8c(0x166)](_0x103864),_0x5d6fe1[_0x4f9e8c(0x15c)]&&console['error']('\x20\x20'+_0x103864);}}}),{'verbose':_0x5d6fe1[_0x6e8cc9(0x15c)]}),_0x49f35c=_0x248bd7[_0x6e8cc9(0x14a)];if(_0x49f35c[_0x6e8cc9(0x13f)]['segments']===0x0&&_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x17b)]===0x0)return console[_0x6e8cc9(0x15e)](a47_0x22d307[_0x6e8cc9(0x14f)](_0x6e8cc9(0x169)+_0x49f35c[_0x6e8cc9(0x174)]+'\x27')),0x0;const _0x19f57f=_0x49f35c[_0x6e8cc9(0x145)][_0x6e8cc9(0x161)](_0x831000=>_0x831000[_0x6e8cc9(0x14e)]),_0x11212f=_0x49f35c[_0x6e8cc9(0x145)][_0x6e8cc9(0x161)](_0x105aa4=>!_0x105aa4['isNew']&&_0x105aa4['hasChanges']),_0x2110ac=_0x49f35c['files']['filter'](_0x1c6da9=>!_0x1c6da9[_0x6e8cc9(0x14e)]&&!_0x1c6da9[_0x6e8cc9(0x13e)]);console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x16c)+_0x49f35c['parentName']+'\x27:'),console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x163)+a47_0x22d307[_0x6e8cc9(0x17f)](_0x49f35c[_0x6e8cc9(0x13f)]['segments']+_0x6e8cc9(0x167))+_0x6e8cc9(0x14b)+a47_0x22d307[_0x6e8cc9(0x17f)](_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x149)]+_0x6e8cc9(0x178)));if(_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x17b)]>0x0){const _0x10ddf2=_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x140)]>_0x49f35c[_0x6e8cc9(0x13f)][_0x6e8cc9(0x17b)]?'\x20('+_0x49f35c['counts'][_0x6e8cc9(0x140)]+'\x20versions)':'';console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x165)+a47_0x22d307[_0x6e8cc9(0x17f)](_0x49f35c[_0x6e8cc9(0x13f)]['journeys']+_0x6e8cc9(0x170))+a47_0x22d307[_0x6e8cc9(0x187)](_0x10ddf2));}console[_0x6e8cc9(0x15e)]('\x20\x20'+a47_0x22d307[_0x6e8cc9(0x146)]('+\x20'+_0x19f57f[_0x6e8cc9(0x141)]+_0x6e8cc9(0x177))),console['error']('\x20\x20'+a47_0x22d307[_0x6e8cc9(0x14f)]('~\x20'+_0x11212f[_0x6e8cc9(0x141)]+_0x6e8cc9(0x157))),console['error']('\x20\x20'+a47_0x22d307[_0x6e8cc9(0x187)]('=\x20'+_0x2110ac[_0x6e8cc9(0x141)]+_0x6e8cc9(0x152))),console['error'](_0x6e8cc9(0x16a)+a47_0x22d307['cyan'](_0x49f35c[_0x6e8cc9(0x17d)])+'\x0a');if(_0x11212f[_0x6e8cc9(0x141)]>0x0)for(const _0xd4dbbf of _0x11212f){console[_0x6e8cc9(0x15e)](_0x6e8cc9(0x188)+_0xd4dbbf['relativePath']+'\x27:'),console[_0x6e8cc9(0x15e)]('─'[_0x6e8cc9(0x16d)](0x3c)),console[_0x6e8cc9(0x15e)](_0xd4dbbf[_0x6e8cc9(0x164)]),console[_0x6e8cc9(0x15e)]('─'['repeat'](0x3c));}if(_0x5d6fe1[_0x6e8cc9(0x160)])return console[_0x6e8cc9(0x15e)](a47_0x22d307['yellow'](_0x6e8cc9(0x183))),0x0;if(_0x19f57f[_0x6e8cc9(0x141)]===0x0&&_0x11212f[_0x6e8cc9(0x141)]===0x0)return console[_0x6e8cc9(0x15e)](a47_0x22d307[_0x6e8cc9(0x146)](_0x6e8cc9(0x189))),saveSessionContext({'parent_segment':_0x49f35c[_0x6e8cc9(0x174)]},_0x5d6fe1[_0x6e8cc9(0x17e)]),console['error'](a47_0x22d307['green'](_0x6e8cc9(0x15b)+a47_0x22d307[_0x6e8cc9(0x187)]('parent_segment')+_0x6e8cc9(0x162)+a47_0x22d307['cyan'](_0x49f35c[_0x6e8cc9(0x174)]))),0x0;if(!_0x5d6fe1['yes']){if(!isInteractive())return console[_0x6e8cc9(0x15e)](a47_0x22d307[_0x6e8cc9(0x13d)](_0x6e8cc9(0x168)),_0x6e8cc9(0x143)),console[_0x6e8cc9(0x15e)](a47_0x22d307['dim'](_0x6e8cc9(0x16b))),0x1;const _0x5f51f4=await confirmKey(_0x6e8cc9(0x17a)+(_0x19f57f['length']+_0x11212f['length'])+_0x6e8cc9(0x15a));if(!_0x5f51f4)return console['error'](a47_0x22d307[_0x6e8cc9(0x14f)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x41aa0f of _0x49f35c[_0x6e8cc9(0x145)]){if(_0x41aa0f['isNew']||_0x41aa0f[_0x6e8cc9(0x13e)]){const _0x79e110=a47_0x256d74[_0x6e8cc9(0x144)](_0x41aa0f['absolutePath']);!existsSync(_0x79e110)&&mkdirSync(_0x79e110,{'recursive':!![]}),writeFileSync(_0x41aa0f[_0x6e8cc9(0x182)],_0x41aa0f[_0x6e8cc9(0x14d)],'utf-8');}}return console['error'](a47_0x22d307[_0x6e8cc9(0x146)](_0x6e8cc9(0x185)+(_0x19f57f['length']+_0x11212f[_0x6e8cc9(0x141)])+_0x6e8cc9(0x159)+_0x49f35c['targetDir'])),saveSessionContext({'parent_segment':_0x49f35c[_0x6e8cc9(0x174)]},_0x5d6fe1[_0x6e8cc9(0x17e)]),console['error'](a47_0x22d307['green'](_0x6e8cc9(0x15b)+a47_0x22d307['dim'](_0x6e8cc9(0x176))+'\x20=\x20'+a47_0x22d307[_0x6e8cc9(0x17f)](_0x49f35c[_0x6e8cc9(0x174)]))),0x0;}}
1
+ const a53_0x270b0c=a53_0x55e5;(function(_0x2c2e04,_0x58f953){const _0x34071d=a53_0x55e5,_0x70a08d=_0x2c2e04();while(!![]){try{const _0x260079=-parseInt(_0x34071d(0xf9))/0x1*(-parseInt(_0x34071d(0xf2))/0x2)+-parseInt(_0x34071d(0x106))/0x3*(parseInt(_0x34071d(0xdb))/0x4)+parseInt(_0x34071d(0xf6))/0x5*(parseInt(_0x34071d(0x10f))/0x6)+parseInt(_0x34071d(0xca))/0x7*(-parseInt(_0x34071d(0xff))/0x8)+-parseInt(_0x34071d(0xcb))/0x9+parseInt(_0x34071d(0x11c))/0xa*(parseInt(_0x34071d(0x116))/0xb)+parseInt(_0x34071d(0xfc))/0xc*(parseInt(_0x34071d(0x11d))/0xd);if(_0x260079===_0x58f953)break;else _0x70a08d['push'](_0x70a08d['shift']());}catch(_0xda580b){_0x70a08d['push'](_0x70a08d['shift']());}}}(a53_0x7fd3,0x4d829));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a53_0x2872cb from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a53_0x7fd3(){const _0xc84f67=['no_parent','\x20changed\x20files','files','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cyan','56148brgESV','dryRun','error','\x20files\x20to\x20','5HIpGtO','\x20=\x20','\x20\x20🎯\x20','14BbhnZM','\x20unchanged\x20files','\x20activations','36BGodoE','Site:\x20','segment','136776NhZCCW','setPhase','parentName','\x0aPull\x20summary\x20for\x20\x27','journeyVersions','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','✔\x20Context\x20set:\x20','12ZQWcfV','yellow','Aborted.','\x20with\x20','\x20files?','-\x20no\x20files\x20written','parent_segment','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aError:','3707196hlcShi','errorCode','segments','Write\x20','parentSegment','\x27...','length','4059KzFChK','✔\x20Pulled\x20','\x20journeys','verbose','site','isNew','11910NGGoDC','1442818bRcYsu','journeys','content','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','238RNgScf','3841416OjEACM','filter','cwd','utf-8','message','file','\x20new\x20files','\x20segments','description','activations','hasChanges','targetDir','type','relativePath','session','data','457736CvMyDi','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','yes','repeat','\x20\x20🗺️\x20\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','red','diff','absolutePath','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','dim','Target\x20resource:\x20','Error:\x20','helpText','resourceName','counts'];a53_0x7fd3=function(){return _0xc84f67;};return a53_0x7fd3();}import a53_0x5f1507 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a53_0x55e5(_0x3ed260,_0x31b257){_0x3ed260=_0x3ed260-0xca;const _0x7fd322=a53_0x7fd3();let _0x55e54c=_0x7fd322[_0x3ed260];return _0x55e54c;}export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a53_0x270b0c(0xd3)]=a53_0x270b0c(0xe5);async['execute'](_0x247b8a){const _0x4edccb=a53_0x270b0c,{options:_0x4dd6fc,args:_0x548217,tdx:_0x3ab473}=_0x247b8a,_0x481387=_0x4dd6fc,_0x206981=await resolveTarget({'arg':_0x548217[0x0],'contextParent':_0x4dd6fc[_0x4edccb(0x113)],'cwd':process[_0x4edccb(0xcd)]()});if(!isSuccessfulResolution(_0x206981))return _0x206981[_0x4edccb(0x110)]===_0x4edccb(0xec)?(console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0x107)](_0x4edccb(0x121))),console[_0x4edccb(0xf4)](_0x4edccb(0xe1)),console[_0x4edccb(0xf4)](_0x4edccb(0xdd)),console[_0x4edccb(0xf4)]('\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[_0x4edccb(0xf4)](a53_0x2872cb['red'](_0x4edccb(0xe8)+_0x206981[_0x4edccb(0xcf)]+'\x0a')),_0x206981[_0x4edccb(0xe9)]&&console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0xf1)](_0x206981[_0x4edccb(0xe9)]))),0x1;const _0xd7736b=_0x206981[_0x4edccb(0x101)],_0x241dbc=_0x206981[_0x4edccb(0xd6)],_0xf1b9eb=_0x206981[_0x4edccb(0xd7)]===_0x4edccb(0xd0)?_0x206981[_0x4edccb(0xea)]:undefined;_0x481387[_0x4edccb(0x119)]&&(console[_0x4edccb(0xf4)](_0x4edccb(0xfd)+_0x481387[_0x4edccb(0x11a)]),console[_0x4edccb(0xf4)]('Parent\x20segment:\x20'+_0xd7736b),_0xf1b9eb&&console[_0x4edccb(0xf4)](_0x4edccb(0xe7)+_0xf1b9eb));const _0x66a3d6=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0xd7736b+_0x4edccb(0x114),_0x378eb7=>_0x3ab473[_0x4edccb(0xfe)]['pullSegments'](_0xd7736b,{'targetDir':_0x241dbc,'targetResourceName':_0xf1b9eb,'verbose':_0x481387[_0x4edccb(0x119)],'progress':{'update':_0x506c30=>{const _0xbf3c8e=_0x4edccb;_0x378eb7[_0xbf3c8e(0x100)](_0x506c30),_0x481387[_0xbf3c8e(0x119)]&&console[_0xbf3c8e(0xf4)]('\x20\x20'+_0x506c30);}}}),{'verbose':_0x481387[_0x4edccb(0x119)]}),_0x491cca=_0x66a3d6[_0x4edccb(0xda)];if(_0x491cca['counts'][_0x4edccb(0x111)]===0x0&&_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x11e)]===0x0)return console['error'](a53_0x2872cb[_0x4edccb(0x107)](_0x4edccb(0x104)+_0x491cca['parentName']+'\x27')),0x0;const _0x408ad8=_0x491cca['files'][_0x4edccb(0xcc)](_0x130108=>_0x130108['isNew']),_0x26c884=_0x491cca[_0x4edccb(0xee)][_0x4edccb(0xcc)](_0x18d562=>!_0x18d562[_0x4edccb(0x11b)]&&_0x18d562['hasChanges']),_0x21214e=_0x491cca['files'][_0x4edccb(0xcc)](_0xac6702=>!_0xac6702[_0x4edccb(0x11b)]&&!_0xac6702[_0x4edccb(0xd5)]);console[_0x4edccb(0xf4)](_0x4edccb(0x102)+_0x491cca[_0x4edccb(0x101)]+'\x27:'),console['error'](_0x4edccb(0xf8)+a53_0x2872cb[_0x4edccb(0xf1)](_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x111)]+_0x4edccb(0xd2))+_0x4edccb(0x109)+a53_0x2872cb[_0x4edccb(0xf1)](_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0xd4)]+_0x4edccb(0xfb)));if(_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x11e)]>0x0){const _0x2db8a1=_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x103)]>_0x491cca[_0x4edccb(0xeb)]['journeys']?'\x20('+_0x491cca['counts'][_0x4edccb(0x103)]+'\x20versions)':'';console[_0x4edccb(0xf4)](_0x4edccb(0xe0)+a53_0x2872cb[_0x4edccb(0xf1)](_0x491cca[_0x4edccb(0xeb)][_0x4edccb(0x11e)]+_0x4edccb(0x118))+a53_0x2872cb[_0x4edccb(0xe6)](_0x2db8a1));}console[_0x4edccb(0xf4)]('\x20\x20'+a53_0x2872cb['green']('+\x20'+_0x408ad8['length']+_0x4edccb(0xd1))),console[_0x4edccb(0xf4)]('\x20\x20'+a53_0x2872cb[_0x4edccb(0x107)]('~\x20'+_0x26c884[_0x4edccb(0x115)]+_0x4edccb(0xed))),console[_0x4edccb(0xf4)]('\x20\x20'+a53_0x2872cb[_0x4edccb(0xe6)]('=\x20'+_0x21214e[_0x4edccb(0x115)]+_0x4edccb(0xfa))),console[_0x4edccb(0xf4)]('\x20\x20Target:\x20'+a53_0x2872cb['cyan'](_0x491cca[_0x4edccb(0xd6)])+'\x0a');if(_0x26c884['length']>0x0)for(const _0x4a8198 of _0x26c884){console[_0x4edccb(0xf4)]('\x0aChanges\x20to\x20\x27'+_0x4a8198[_0x4edccb(0xd8)]+'\x27:'),console[_0x4edccb(0xf4)]('─'[_0x4edccb(0xdf)](0x3c)),console['error'](_0x4a8198[_0x4edccb(0xe3)]),console[_0x4edccb(0xf4)]('─'[_0x4edccb(0xdf)](0x3c));}if(_0x481387[_0x4edccb(0xf3)])return console[_0x4edccb(0xf4)](a53_0x2872cb['yellow'](_0x4edccb(0xf0))),0x0;if(_0x408ad8[_0x4edccb(0x115)]===0x0&&_0x26c884[_0x4edccb(0x115)]===0x0)return console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0x120)](_0x4edccb(0x10d))),saveSessionContext({'parent_segment':_0x491cca[_0x4edccb(0x101)]},_0x481387[_0x4edccb(0xd9)]),console['error'](a53_0x2872cb['green'](_0x4edccb(0x105)+a53_0x2872cb[_0x4edccb(0xe6)](_0x4edccb(0x10c))+_0x4edccb(0xf7)+a53_0x2872cb['cyan'](_0x491cca[_0x4edccb(0x101)]))),0x0;if(!_0x481387[_0x4edccb(0xde)]){if(!isInteractive())return console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0xe2)](_0x4edccb(0x10e)),_0x4edccb(0xdc)),console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0xe6)](_0x4edccb(0xef))),0x1;const _0x33559d=await confirmKey(_0x4edccb(0x112)+(_0x408ad8[_0x4edccb(0x115)]+_0x26c884[_0x4edccb(0x115)])+_0x4edccb(0x10a));if(!_0x33559d)return console[_0x4edccb(0xf4)](a53_0x2872cb['yellow'](_0x4edccb(0x108)),_0x4edccb(0x10b)),0x1;}for(const _0x154b81 of _0x491cca['files']){if(_0x154b81[_0x4edccb(0x11b)]||_0x154b81['hasChanges']){const _0x35fa89=a53_0x5f1507['dirname'](_0x154b81['absolutePath']);!existsSync(_0x35fa89)&&mkdirSync(_0x35fa89,{'recursive':!![]}),writeFileSync(_0x154b81[_0x4edccb(0xe4)],_0x154b81[_0x4edccb(0x11f)],_0x4edccb(0xce));}}return console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0x120)](_0x4edccb(0x117)+(_0x408ad8[_0x4edccb(0x115)]+_0x26c884[_0x4edccb(0x115)])+_0x4edccb(0xf5)+_0x491cca[_0x4edccb(0xd6)])),saveSessionContext({'parent_segment':_0x491cca[_0x4edccb(0x101)]},_0x481387[_0x4edccb(0xd9)]),console[_0x4edccb(0xf4)](a53_0x2872cb[_0x4edccb(0x120)](_0x4edccb(0x105)+a53_0x2872cb[_0x4edccb(0xe6)]('parent_segment')+'\x20=\x20'+a53_0x2872cb[_0x4edccb(0xf1)](_0x491cca[_0x4edccb(0x101)]))),0x0;}}
@@ -1 +1 @@
1
- const a48_0x1609ad=a48_0x5d87;function a48_0x5d87(_0x569cb8,_0x13dfd5){_0x569cb8=_0x569cb8-0x1f0;const _0x44fc61=a48_0x44fc();let _0x5d87e5=_0x44fc61[_0x569cb8];return _0x5d87e5;}(function(_0xb0024a,_0x108ea8){const _0x2cb1bb=a48_0x5d87,_0x4a0b72=_0xb0024a();while(!![]){try{const _0x488d09=parseInt(_0x2cb1bb(0x201))/0x1*(-parseInt(_0x2cb1bb(0x276))/0x2)+parseInt(_0x2cb1bb(0x218))/0x3*(-parseInt(_0x2cb1bb(0x226))/0x4)+-parseInt(_0x2cb1bb(0x28b))/0x5+-parseInt(_0x2cb1bb(0x268))/0x6+parseInt(_0x2cb1bb(0x1f7))/0x7+parseInt(_0x2cb1bb(0x283))/0x8+parseInt(_0x2cb1bb(0x224))/0x9;if(_0x488d09===_0x108ea8)break;else _0x4a0b72['push'](_0x4a0b72['shift']());}catch(_0xf57467){_0x4a0b72['push'](_0x4a0b72['shift']());}}}(a48_0x44fc,0x8f0b0));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 a48_0x38a609 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 a48_0x44fc(){const _0x8948da=['yellow','attributes','toUpdate','join','.yml','Error:\x20Directory\x20not\x20found:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','12351168hUSnyl','segment\x20or\x20journey','4433916lcFgdV','Delete\x20journey:','Scoped\x20to\x20folder:\x20','existingJourney','targetDir','\x20changes?','nameToType','helpText','/app/ps/','get','📁\x20','updatedAt','unchanged','green','/sb/da/esr','verbose','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','all','getOutputSchemaWithCache','\x20\x20Segments:\x20','red','journeys','scopedFolderPath','error','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20','connection','createdSegmentIds','/j/da/je','folderPath','segmentFolderId','.yaml','segment','\x20\x20Journeys:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','type','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Preparing\x20journeys...','execute','then','folders','listFolders','\x20\x20Activations:','getJourney','paused','\x20folders\x20to\x20create','journeysOnly','Aborted.','\x0a✔\x20Push\x20complete','journeyId','Resolving\x20parent\x20segment\x20\x27','audienceId','Folders\x20to\x20create:','Error\x20parsing\x20YAML:\x20','data','\x20\x20📊\x20Segments:','Parent\x20segment:\x20','/e/','\x20\x20🗺️\x20\x20Journeys:','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Fetching\x20connections\x20for\x20name\x20resolution...','diff','parent_name','journey','push','2727648aCXSGl','changed','results','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Delete\x20segment:','\x27...','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','Changes\x20to\x20journey:','listJourneysWithDetailsFromParentSegment','new','getMetadataWithCache','getParent','idToName','filter','262NeQoXy','\x20activations]','Fetching\x20existing\x20activations...','description','journeyBundleId','\x20to\x20create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','updated','site','segments','file','name','isNew','5211648ZfHeEk','journeyBundleName','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','deleted','yamlConfig','length','Fetching\x20existing\x20data...','errorCode','3077910iPEfVH','New\x20journey:','created','yes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','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)','New\x20segment:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','listActivations','resolveParentId','\x20updated','6198640EYZbNp','\x20YAML\x20files\x20found','add','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','dim','existingSegment','\x20new','parentSegment','\x0aPush\x20summary\x20for\x20\x27','parentName','1105qOnunG','list','message','\x20unchanged','toDelete','dryRun','set','user','isScoped','\x20to\x20delete','buildUserMaps','\x20\x20\x20\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','filePath','toString','\x0aValidation\x20failed:','\x20changed','toCreate','repeat','delete','blue','no_parent','map','3xGkwaP','No\x20','activations','\x20deleted','\x20\x20Activations:\x20'];a48_0x44fc=function(){return _0x8948da;};return a48_0x44fc();}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{[a48_0x1609ad(0x281)]='segment:push';[a48_0x1609ad(0x279)]=a48_0x1609ad(0x26e);async[a48_0x1609ad(0x24c)](_0x50ef36){const _0x3479f8=a48_0x1609ad,{options:_0xfa47b2,args:_0x554693,tdx:_0x2a6b6c}=_0x50ef36,_0x273058=_0xfa47b2,_0x2d5a44=await resolveTarget({'arg':_0x554693[0x0],'contextParent':_0xfa47b2[_0x3479f8(0x1fe)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2d5a44))return _0x2d5a44[_0x3479f8(0x28a)]===_0x3479f8(0x216)?(console['error'](a48_0x38a609['yellow'](_0x3479f8(0x1f0))),console[_0x3479f8(0x23d)](_0x3479f8(0x1f1)),console[_0x3479f8(0x23d)](_0x3479f8(0x27c)),console[_0x3479f8(0x23d)](_0x3479f8(0x262))):(console[_0x3479f8(0x23d)](a48_0x38a609['red'](_0x3479f8(0x23f)+_0x2d5a44['message']+'\x0a')),_0x2d5a44[_0x3479f8(0x22d)]&&console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x261)](_0x2d5a44[_0x3479f8(0x22d)]))),0x1;if(_0x2d5a44['type']===_0x3479f8(0x265))return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x222)+_0x2d5a44[_0x3479f8(0x22a)]+'\x0a')),console['error'](a48_0x38a609[_0x3479f8(0x261)](_0x3479f8(0x285))),0x1;const _0x320cfb=_0x2d5a44[_0x3479f8(0x200)],_0x5826a9=_0x2d5a44[_0x3479f8(0x22a)],_0x684343=_0x2d5a44[_0x3479f8(0x249)]===_0x3479f8(0x280)?_0x2d5a44[_0x3479f8(0x20e)]:undefined,_0x2be775=getScopedDetails(_0x2d5a44),_0x3071cd=_0x2be775?.[_0x3479f8(0x209)]??![],_0x49fbec=_0x2be775?.[_0x3479f8(0x23c)]??'';if(!existsSync(_0x5826a9))return console[_0x3479f8(0x23d)](a48_0x38a609['red'](_0x3479f8(0x222)+_0x5826a9+'\x0a')),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x261)](_0x3479f8(0x285))),0x1;_0x273058[_0x3479f8(0x235)]&&(console[_0x3479f8(0x23d)]('Site:\x20'+_0x273058[_0x3479f8(0x27e)]),console[_0x3479f8(0x23d)](_0x3479f8(0x25e)+_0x320cfb),console['error']('Source\x20directory:\x20'+_0x5826a9),_0x3071cd&&console[_0x3479f8(0x23d)](_0x3479f8(0x228)+_0x49fbec));const _0x14b2ae=await withSpinner(_0x3479f8(0x258)+_0x320cfb+_0x3479f8(0x26d),()=>_0x2a6b6c['segment'][_0x3479f8(0x1f5)](_0x320cfb),{'verbose':_0x273058[_0x3479f8(0x235)]}),_0x4282d6=_0x14b2ae[_0x3479f8(0x25c)],{parentSegmentResult:_0x38d6a1,segmentsResult:_0x416fac,foldersResult:_0x4ffa47,journeysWithDetailsResult:_0x15e9b1,userMaps:_0x5d4199}=await withSpinner(_0x3479f8(0x289),async()=>{const _0x709c8c=_0x3479f8,[_0x118ec6,_0x5cc0e2,_0x32c9a1,_0x371f9e,_0x15a2f0]=await Promise[_0x709c8c(0x237)]([_0x2a6b6c['segment'][_0x709c8c(0x273)](_0x4282d6),_0x2a6b6c['segment']['listSegments'](_0x4282d6),_0x2a6b6c[_0x709c8c(0x246)][_0x709c8c(0x24f)](_0x4282d6),_0x2a6b6c[_0x709c8c(0x266)][_0x709c8c(0x270)](_0x4282d6,{'includeAllVersions':!![]}),_0x2a6b6c[_0x709c8c(0x208)][_0x709c8c(0x20b)]()]);return{'parentSegmentResult':_0x118ec6,'segmentsResult':_0x5cc0e2,'foldersResult':_0x32c9a1,'journeysWithDetailsResult':_0x371f9e,'userMaps':_0x15a2f0};},{'verbose':_0x273058[_0x3479f8(0x235)]})[_0x3479f8(0x24d)](_0x3b91c2=>_0x3b91c2[_0x3479f8(0x25c)]),_0x4e60f0=_0x38d6a1,_0x59b1a3=extractRootFolderId(_0x4e60f0),_0x4db7d4=_0x416fac,_0xfa03d8=_0x4ffa47,{journeys:_0x1ea159,activationStepsById:_0x42d7c2}=_0x15e9b1,_0x276cc5=new Map(_0x1ea159[_0x3479f8(0x217)](_0x382d66=>[_0x382d66['id'],_0x382d66])),_0x9fd07=_0x1ea159[_0x3479f8(0x217)](_0x5cb629=>({'id':_0x5cb629['id'],'name':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x281)],'journeyBundleName':_0x5cb629['attributes']['journeyBundleName']||'','journeyBundleId':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x27a)]||'','versionNumber':_0x5cb629[_0x3479f8(0x21e)]['versionNumber'],'description':_0x5cb629['attributes']['description'],'state':_0x5cb629[_0x3479f8(0x21e)]['state'],'paused':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x252)],'audienceId':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x259)],'folderId':_0x5cb629['relationships']?.['parentFolder']?.[_0x3479f8(0x25c)]?.['id'],'createdAt':_0x5cb629['attributes']['createdAt'],'updatedAt':_0x5cb629[_0x3479f8(0x21e)][_0x3479f8(0x231)]})),{emailToId:_0x33e44d,idToEmail:_0x39245f}=_0x5d4199,_0xffa4e3=await withSpinner(_0x3479f8(0x263),async()=>{const _0x7f6b90=_0x3479f8,_0x2f07af=await _0x2a6b6c['connection'][_0x7f6b90(0x202)]();return buildConnectionMaps(_0x2f07af);},{'verbose':_0x273058[_0x3479f8(0x235)]})[_0x3479f8(0x24d)](_0x28b2b4=>_0x28b2b4[_0x3479f8(0x25c)]),_0x128dee=_0xffa4e3['nameToId'],_0x160cf2=_0xffa4e3[_0x3479f8(0x274)],_0x2e930b=_0xffa4e3[_0x3479f8(0x22c)],_0xeec34e={'emailToIdMap':_0x33e44d,'connectionNameToIdMap':_0x128dee,'connectionNameToTypeMap':_0x2e930b,'getSchema':_0x4a2169=>_0x2a6b6c['connection'][_0x3479f8(0x238)](_0x4a2169),'getMetadata':_0x5c9f76=>_0x2a6b6c[_0x3479f8(0x240)][_0x3479f8(0x272)](_0x5c9f76)};let {pathToId:_0x270ad0,idToPath:_0x31799f}=buildFolderMaps(_0xfa03d8);const _0x5a1495=buildSegmentLookupMap(_0x4db7d4,_0x31799f),_0x5b0b59=buildSegmentNameToIdMap(_0x4db7d4),_0x3a637c=buildJourneyBundleLookupMap(_0x9fd07,_0x31799f);let _0x31878d;if(_0x684343){if(!_0x684343['endsWith'](_0x3479f8(0x221))&&!_0x684343['endsWith'](_0x3479f8(0x245)))return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x236)+_0x684343+'\x0a')),0x1;_0x31878d=[_0x684343];}else _0x31878d=findYamlFiles(_0x5826a9);if(_0x31878d[_0x3479f8(0x288)]===0x0)return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x23a)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5826a9+'\x0a')),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x261)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x1653d4,_0x283eba;try{const _0x3fc0c4=parseAndClassifyYamlFiles(_0x31878d,_0x5826a9,{'skipSegments':_0x273058['journeysOnly']});_0x1653d4=_0x3fc0c4[_0x3479f8(0x27f)],_0x283eba=_0x3fc0c4[_0x3479f8(0x23b)];const _0x28f8e4=validateParsedFiles(_0x3fc0c4,_0x5826a9);if(_0x28f8e4[_0x3479f8(0x288)]>0x0)return console['error'](a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x210))),console[_0x3479f8(0x23d)](formatValidationErrors(_0x28f8e4)),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x248))),0x1;}catch(_0x3179a2){return console['error'](a48_0x38a609['red'](_0x3479f8(0x25b)+(_0x3179a2 instanceof Error?_0x3179a2[_0x3479f8(0x203)]:_0x3179a2))),0x1;}if(_0x1653d4[_0x3479f8(0x288)]===0x0&&_0x283eba[_0x3479f8(0x288)]===0x0){const _0x5d9880=_0x273058['journeysOnly']?_0x3479f8(0x266):_0x3479f8(0x225);return console[_0x3479f8(0x23d)](a48_0x38a609['yellow'](_0x3479f8(0x219)+_0x5d9880+_0x3479f8(0x1f8))),0x0;}const _0x256c3e=new Map();_0x4db7d4[_0x3479f8(0x288)]>0x0&&!_0x273058[_0x3479f8(0x254)]&&await withSpinner(_0x3479f8(0x278),async()=>{await batchAsync(_0x4db7d4,async _0xad8e19=>{const _0x54075e=a48_0x5d87,_0x1f2ef2=await _0x2a6b6c[_0x54075e(0x246)][_0x54075e(0x1f4)](_0x4282d6,_0xad8e19['id']);_0x256c3e[_0x54075e(0x207)](_0xad8e19['id'],_0x1f2ef2);});},{'verbose':_0x273058[_0x3479f8(0x235)]});const {segmentFiles:_0x1b21ed,foldersToCreate:_0x267bf8}=await prepareSegmentFiles(_0x1653d4,{'segmentByFolderAndName':_0x5a1495,'activationsBySegmentId':_0x256c3e,'folderPathToId':_0x270ad0,'idToEmailMap':_0x39245f,'connectionIdToNameMap':_0x160cf2},_0xeec34e,_0x3071cd,_0x49fbec),_0x4b16f2=_0x684343?[]:findSegmentsToDelete(_0x4db7d4,_0x1653d4[_0x3479f8(0x217)](({yamlConfig:_0x6f1b9d,folderPath:_0x307765})=>({'yamlConfig':_0x6f1b9d,'folderPath':resolveTDFolderPath(_0x307765,_0x3071cd,_0x49fbec)})),_0x31799f,_0x49fbec,_0x3071cd),{journeyFiles:_0x2c7499,foldersToCreate:_0x340eae}=await withProgressSpinner(_0x3479f8(0x24b),async _0x3150f4=>prepareJourneyFiles(_0x283eba,{'fetchJourney':async _0x1b193f=>_0x2a6b6c[_0x3479f8(0x266)][_0x3479f8(0x251)](_0x1b193f[_0x3479f8(0x257)]),'journeyBundlesByFolderAndName':_0x3a637c,'folderPathToId':_0x270ad0,'idToEmailMap':_0x39245f,'connectionIdToNameMap':_0x160cf2,'existingSegments':_0x4db7d4,'parentId':_0x4282d6,'deps':_0x2a6b6c,'progress':{'update':_0x5d6f3b=>{const _0x57fb08=_0x3479f8;_0x3150f4['setPhase'](_0x5d6f3b),_0x273058[_0x57fb08(0x235)]&&console['error']('\x20\x20'+_0x5d6f3b);}},'journeyById':_0x276cc5,'activationStepsById':_0x42d7c2},_0x3071cd,_0x49fbec),{'verbose':_0x273058[_0x3479f8(0x235)]})[_0x3479f8(0x24d)](_0x4fb7e2=>_0x4fb7e2['data']);for(const _0x59fb04 of _0x340eae){_0x267bf8[_0x3479f8(0x1f9)](_0x59fb04);}const _0x126960=_0x684343?[]:findJourneysToDelete(_0x9fd07,_0x283eba[_0x3479f8(0x217)](({yamlConfig:_0x1bf006,folderPath:_0x4f359b})=>({'yamlConfig':_0x1bf006,'folderPath':resolveTDFolderPath(_0x4f359b,_0x3071cd,_0x49fbec)})),_0x31799f,_0x49fbec,_0x3071cd),_0x238df1=calculatePushStats(_0x1b21ed,_0x2c7499,_0x267bf8,_0x4b16f2,_0x126960,!!_0x273058['delete'],!!_0x273058[_0x3479f8(0x254)]),_0x51a3d3=_0x238df1[_0x3479f8(0x27f)][_0x3479f8(0x271)],_0x3ea1e5=_0x238df1['segments'][_0x3479f8(0x269)],_0x2442a=_0x238df1[_0x3479f8(0x27f)][_0x3479f8(0x232)],_0x38e043=_0x238df1[_0x3479f8(0x27f)][_0x3479f8(0x205)],_0x1ebb4f=_0x238df1[_0x3479f8(0x24e)][_0x3479f8(0x212)],_0x290e4c=_0x238df1[_0x3479f8(0x23b)][_0x3479f8(0x271)],_0x182b08=_0x238df1[_0x3479f8(0x23b)][_0x3479f8(0x269)],_0xea6bb9=_0x238df1[_0x3479f8(0x23b)]['unchanged'],_0x49dbc1=_0x238df1[_0x3479f8(0x23b)][_0x3479f8(0x205)],_0x17d423=_0x238df1[_0x3479f8(0x21a)][_0x3479f8(0x237)],_0x372104=_0x238df1[_0x3479f8(0x21a)]['toCreate'],_0x360c24=_0x238df1['activations'][_0x3479f8(0x21f)],_0x229ab6=_0x238df1[_0x3479f8(0x21a)][_0x3479f8(0x205)];console[_0x3479f8(0x23d)](_0x3479f8(0x1ff)+_0x320cfb+'\x27:');_0x1ebb4f[_0x3479f8(0x288)]>0x0&&console['error']('\x20\x20'+a48_0x38a609[_0x3479f8(0x215)](_0x3479f8(0x230)+_0x1ebb4f[_0x3479f8(0x288)]+_0x3479f8(0x253)));if(!_0x273058[_0x3479f8(0x254)]){console[_0x3479f8(0x23d)](_0x3479f8(0x25d)),console['error'](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x233)]('+\x20'+_0x51a3d3[_0x3479f8(0x288)]+_0x3479f8(0x1fd))),console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x21d)]('~\x20'+_0x3ea1e5[_0x3479f8(0x288)]+_0x3479f8(0x211)));if(_0x38e043[_0x3479f8(0x288)]>0x0)console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x23a)]('-\x20'+_0x38e043[_0x3479f8(0x288)]+_0x3479f8(0x20a)));else _0x4b16f2[_0x3479f8(0x288)]>0x0&&!_0x273058[_0x3479f8(0x214)]&&console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x1fb)](_0x4b16f2[_0x3479f8(0x288)]+_0x3479f8(0x26b)));console['error'](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x1fb)]('=\x20'+_0x2442a[_0x3479f8(0x288)]+_0x3479f8(0x204)));}if(_0x2c7499[_0x3479f8(0x288)]>0x0||_0x126960[_0x3479f8(0x288)]>0x0){console['error'](_0x3479f8(0x260)),console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x233)]('+\x20'+_0x290e4c[_0x3479f8(0x288)]+_0x3479f8(0x1fd))),console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x21d)]('~\x20'+_0x182b08[_0x3479f8(0x288)]+_0x3479f8(0x211)));if(_0x49dbc1['length']>0x0)console[_0x3479f8(0x23d)]('\x20\x20\x20\x20'+a48_0x38a609['red']('-\x20'+_0x49dbc1[_0x3479f8(0x288)]+_0x3479f8(0x20a)));else _0x126960['length']>0x0&&!_0x273058[_0x3479f8(0x214)]&&console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x1fb)](_0x126960['length']+_0x3479f8(0x26b)));console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x1fb)]('=\x20'+_0xea6bb9[_0x3479f8(0x288)]+'\x20unchanged'));}_0x17d423[_0x3479f8(0x288)]>0x0&&!_0x273058['journeysOnly']&&(console[_0x3479f8(0x23d)](''),console['error'](_0x3479f8(0x250)),_0x372104[_0x3479f8(0x288)]>0x0&&console['error'](_0x3479f8(0x20c)+a48_0x38a609['green']('+\x20'+_0x372104[_0x3479f8(0x288)]+_0x3479f8(0x27b))),_0x360c24[_0x3479f8(0x288)]>0x0&&console[_0x3479f8(0x23d)](_0x3479f8(0x20c)+a48_0x38a609[_0x3479f8(0x21d)]('~\x20'+_0x360c24[_0x3479f8(0x288)]+'\x20to\x20update')),_0x229ab6[_0x3479f8(0x288)]>0x0&&console['error']('\x20\x20\x20\x20'+a48_0x38a609[_0x3479f8(0x23a)]('-\x20'+_0x229ab6[_0x3479f8(0x288)]+_0x3479f8(0x20a))));console[_0x3479f8(0x23d)]('\x20\x20Source:\x20'+a48_0x38a609[_0x3479f8(0x261)](_0x5826a9)+'\x0a');if(_0x1ebb4f[_0x3479f8(0x288)]>0x0){console[_0x3479f8(0x23d)](_0x3479f8(0x25a));for(const _0x394623 of _0x1ebb4f){console['error']('\x20\x20'+a48_0x38a609['blue']('+')+'\x20'+_0x394623);}console[_0x3479f8(0x23d)]('');}if(_0x51a3d3[_0x3479f8(0x288)]>0x0&&!_0x273058[_0x3479f8(0x254)])for(const _0x5dbaa8 of _0x51a3d3){const _0x24899e=_0x5dbaa8['folderPath']?_0x5dbaa8['folderPath']+'/'+_0x5dbaa8[_0x3479f8(0x287)][_0x3479f8(0x281)]:_0x5dbaa8['yamlConfig']['name'],_0xedbb9f=_0x5dbaa8[_0x3479f8(0x287)][_0x3479f8(0x21a)]?.[_0x3479f8(0x288)]||0x0,_0x24c0d9=_0xedbb9f>0x0?a48_0x38a609[_0x3479f8(0x1fb)]('\x20['+_0xedbb9f+_0x3479f8(0x277)):'';console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x233)](_0x3479f8(0x1f2))+'\x20'+_0x24899e+_0x24c0d9),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c)),_0x5dbaa8['diff']&&console[_0x3479f8(0x23d)](_0x5dbaa8[_0x3479f8(0x264)]),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}if(_0x38e043[_0x3479f8(0x288)]>0x0&&!_0x273058['journeysOnly'])for(const _0x102560 of _0x38e043){const _0x588534=_0x102560['segmentFolderId']?_0x31799f['get'](_0x102560[_0x3479f8(0x244)][_0x3479f8(0x20f)]())||'':'',_0x42c351=_0x588534?_0x588534+'/'+_0x102560[_0x3479f8(0x281)]:_0x102560[_0x3479f8(0x281)],_0x47c2ac=_0x256c3e[_0x3479f8(0x22f)](_0x102560['id'])||[],_0x99e051=_0x47c2ac[_0x3479f8(0x288)]>0x0?a48_0x38a609[_0x3479f8(0x1fb)]('\x20['+_0x47c2ac['length']+_0x3479f8(0x277)):'';console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x26c))+'\x20'+_0x42c351+_0x99e051),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));const _0x1c3666=segmentWithActivationsToYaml(_0x102560,_0x47c2ac,undefined,_0x39245f,_0x160cf2),_0xd6e730=segmentToYamlString(_0x1c3666),_0x42c34d=generateDiff(_0xd6e730,'');console[_0x3479f8(0x23d)](formatDiffWithColors(_0x42c34d)),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}const _0x19f9b3=_0x1b21ed[_0x3479f8(0x275)](_0x5ae17d=>!_0x5ae17d[_0x3479f8(0x282)]&&_0x5ae17d['diff']);if(_0x19f9b3[_0x3479f8(0x288)]>0x0&&!_0x273058['journeysOnly'])for(const _0x4e48e7 of _0x19f9b3){const _0x5beabf=_0x4e48e7[_0x3479f8(0x243)]?_0x4e48e7[_0x3479f8(0x243)]+'/'+_0x4e48e7[_0x3479f8(0x287)][_0x3479f8(0x281)]:_0x4e48e7[_0x3479f8(0x287)]['name'];console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x21d)]('Changes\x20to:')+'\x20'+_0x5beabf),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c)),console[_0x3479f8(0x23d)](_0x4e48e7[_0x3479f8(0x264)]),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}if(_0x290e4c[_0x3479f8(0x288)]>0x0)for(const _0x7452d7 of _0x290e4c){const _0x59a5de=_0x7452d7[_0x3479f8(0x243)]?_0x7452d7[_0x3479f8(0x243)]+'/'+_0x7452d7[_0x3479f8(0x287)][_0x3479f8(0x281)]:_0x7452d7['yamlConfig'][_0x3479f8(0x281)];console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x233)](_0x3479f8(0x28c))+'\x20'+_0x59a5de),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c)),_0x7452d7[_0x3479f8(0x264)]&&console[_0x3479f8(0x23d)](_0x7452d7[_0x3479f8(0x264)]),console[_0x3479f8(0x23d)]('─'['repeat'](0x3c));}const _0x2a08ad=_0x2c7499[_0x3479f8(0x275)](_0x2b9ae9=>!_0x2b9ae9['isNew']&&_0x2b9ae9[_0x3479f8(0x264)]);if(_0x2a08ad[_0x3479f8(0x288)]>0x0)for(const _0x1d8869 of _0x2a08ad){const _0x50e41d=_0x1d8869[_0x3479f8(0x243)]?_0x1d8869[_0x3479f8(0x243)]+'/'+_0x1d8869['yamlConfig']['name']:_0x1d8869['yamlConfig'][_0x3479f8(0x281)];console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x26f))+'\x20'+_0x50e41d),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c)),console['error'](_0x1d8869[_0x3479f8(0x264)]),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}if(_0x49dbc1[_0x3479f8(0x288)]>0x0)for(const _0x35c594 of _0x49dbc1){const _0x30c57e=_0x35c594['folderId']?_0x31799f['get'](_0x35c594['folderId'])||'':'',_0xb8cf46=_0x30c57e?_0x30c57e+'/'+_0x35c594['journeyBundleName']:_0x35c594[_0x3479f8(0x284)];console[_0x3479f8(0x23d)]('\x0a'+a48_0x38a609[_0x3479f8(0x23a)](_0x3479f8(0x227))+'\x20'+_0xb8cf46),console[_0x3479f8(0x23d)]('─'['repeat'](0x3c)),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x23a)]('(Journey\x20will\x20be\x20deleted)')),console[_0x3479f8(0x23d)]('─'[_0x3479f8(0x213)](0x3c));}if(_0x273058[_0x3479f8(0x206)])return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x223))),0x0;const _0x586c3b=_0x273058['journeysOnly']?![]:_0x51a3d3['length']>0x0||_0x3ea1e5[_0x3479f8(0x288)]>0x0||_0x38e043['length']>0x0,_0x2d74c3=_0x290e4c['length']>0x0||_0x182b08[_0x3479f8(0x288)]>0x0||_0x49dbc1[_0x3479f8(0x288)]>0x0,_0x4b2bf7=_0x273058[_0x3479f8(0x254)]?![]:_0x17d423[_0x3479f8(0x288)]>0x0,_0x4381e5=_0x1ebb4f['length']>0x0;if(!_0x586c3b&&!_0x2d74c3&&!_0x4b2bf7&&!_0x4381e5){const _0x1d8108=_0x273058['journeysOnly']?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x3479f8(0x20d);console[_0x3479f8(0x23d)](a48_0x38a609['green'](_0x1d8108));if(_0x684343&&_0x2442a[_0x3479f8(0x288)]===0x1){const _0x415955=_0x2442a[0x0];if(_0x415955['existingSegment']?.['id']){const _0x483cdb=getConsoleNextUrl(_0x273058[_0x3479f8(0x27e)],_0x3479f8(0x22e)+_0x4282d6+_0x3479f8(0x25f)+_0x415955[_0x3479f8(0x1fc)]['id']+_0x3479f8(0x234));console[_0x3479f8(0x23d)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a48_0x38a609[_0x3479f8(0x261)](_0x483cdb));}}if(_0x684343&&_0xea6bb9[_0x3479f8(0x288)]===0x1){const _0x172673=_0xea6bb9[0x0];if(_0x172673['existingJourney']?.['id']){const _0x31e0fc=getConsoleNextUrl(_0x273058[_0x3479f8(0x27e)],_0x3479f8(0x22e)+_0x4282d6+'/e/'+_0x172673[_0x3479f8(0x229)]['id']+_0x3479f8(0x242));console[_0x3479f8(0x23d)]('\x20\x20'+a48_0x38a609['cyan'](_0x31e0fc));}}return 0x0;}const _0x34b0e4=_0x273058[_0x3479f8(0x254)]?_0x290e4c[_0x3479f8(0x288)]+_0x182b08[_0x3479f8(0x288)]+_0x49dbc1[_0x3479f8(0x288)]+_0x1ebb4f['length']:_0x51a3d3[_0x3479f8(0x288)]+_0x3ea1e5[_0x3479f8(0x288)]+_0x38e043[_0x3479f8(0x288)]+_0x290e4c['length']+_0x182b08['length']+_0x49dbc1[_0x3479f8(0x288)]+_0x1ebb4f['length']+_0x17d423[_0x3479f8(0x288)];if(!_0x273058[_0x3479f8(0x28e)]&&_0x34b0e4>0x0){if(!isInteractive())return console['error'](a48_0x38a609[_0x3479f8(0x23a)]('\x0aError:'),_0x3479f8(0x24a)),console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x1fb)](_0x3479f8(0x23e))),0x1;const _0x157d88=await confirmKey('Push\x20'+_0x34b0e4+_0x3479f8(0x22b));if(!_0x157d88)return console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x255))),0x1;}const _0x2dfd1a={'withProgress':async(_0x23b260,_0x252f5e)=>{const _0xaf183f=_0x3479f8,_0x579e2a=await withSpinner(_0x23b260,_0x252f5e,{'verbose':_0x273058[_0xaf183f(0x235)]});return{'data':_0x579e2a[_0xaf183f(0x25c)]};},'logInfo':_0xb16edb=>console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x215)]('✔\x20'+_0xb16edb)),'logSuccess':_0x5b9028=>console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x233)]('✔\x20'+_0x5b9028)),'logWarning':_0x3ec0e4=>console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x21d)]('⚠\x20'+_0x3ec0e4)),'logDeleted':_0x17c923=>console[_0x3479f8(0x23d)](a48_0x38a609['red']('✔\x20'+_0x17c923))},_0x188c9d={'segment':_0x2a6b6c['segment'],'journey':_0x2a6b6c[_0x3479f8(0x266)],'user':_0x2a6b6c['user'],'connection':_0x2a6b6c['connection']};_0x1ebb4f[_0x3479f8(0x288)]>0x0&&(_0x270ad0=await executePushFolders(_0x188c9d,_0x1ebb4f,_0x270ad0,{'parentId':_0x4282d6},_0x2dfd1a));const _0xd72fa4={'rootFolderId':_0x59b1a3,'folderPathToId':_0x270ad0,'folderIdToPath':_0x31799f,'segmentNameToId':_0x5b0b59,'activationsBySegmentId':_0x256c3e,'emailToIdMap':_0x33e44d,'idToEmailMap':_0x39245f,'connectionNameToIdMap':_0xffa4e3['nameToId'],'connectionIdToNameMap':_0xffa4e3[_0x3479f8(0x274)],'connectionNameToTypeMap':_0x2e930b},_0x363256=await executePushSegments(_0x188c9d,_0x273058[_0x3479f8(0x254)]?[]:_0x1b21ed,_0xd72fa4,{'parentId':_0x4282d6},_0x2dfd1a),_0x4ec0fb=_0x363256[_0x3479f8(0x28d)],_0xb50079=_0x363256['updated'],_0x1cef4c=_0x363256[_0x3479f8(0x21a)][_0x3479f8(0x28d)],_0x376dab=_0x363256[_0x3479f8(0x21a)][_0x3479f8(0x27d)],_0x4a6945=_0x363256[_0x3479f8(0x21a)][_0x3479f8(0x286)];let _0xd9d9b3;if(_0x684343&&_0x1b21ed[_0x3479f8(0x288)]===0x1){const _0x181b19=_0x1b21ed[0x0];_0xd9d9b3=_0x181b19['existingSegment']?.['id']??_0x363256[_0x3479f8(0x241)][_0x3479f8(0x22f)](_0x181b19['yamlConfig']['name']);}const _0x2cae69=await executePushSegmentDeletions(_0x188c9d,_0x273058[_0x3479f8(0x254)]?[]:_0x38e043,_0x2dfd1a);let _0x413303=0x0,_0x10e349=0x0,_0x55ddfa=0x0;const _0x1d38b7=new Map(_0x5b0b59);for(const [_0x46fa3a,_0x3aa98d]of _0x363256['createdSegmentIds']){_0x1d38b7['set'](_0x46fa3a,_0x3aa98d);}if(_0x2c7499[_0x3479f8(0x288)]>0x0){const _0x4866b2={..._0xd72fa4,'segmentNameToId':_0x1d38b7,'existingSegments':_0x4db7d4,'activationContext':_0xeec34e},_0x102a54=await executePushJourneys(_0x188c9d,_0x2c7499,_0x4866b2,{'parentId':_0x4282d6,'rootFolderId':_0x59b1a3,'verbose':_0x273058[_0x3479f8(0x235)]},_0x2dfd1a);_0x413303=_0x102a54[_0x3479f8(0x28d)],_0x10e349=_0x102a54[_0x3479f8(0x27d)];if(_0x684343&&_0x102a54[_0x3479f8(0x26a)][_0x3479f8(0x288)]===0x1){const _0x10711f=_0x102a54[_0x3479f8(0x26a)][0x0];if(_0x10711f[_0x3479f8(0x257)]){const _0x596803=getConsoleNextUrl(_0x273058['site'],'/app/ps/'+_0x4282d6+_0x3479f8(0x25f)+_0x10711f[_0x3479f8(0x257)]+_0x3479f8(0x242));console[_0x3479f8(0x23d)]('\x20\x20'+a48_0x38a609[_0x3479f8(0x261)](_0x596803));}}}for(const _0x294cc6 of _0x49dbc1){console['error'](a48_0x38a609[_0x3479f8(0x21d)](_0x3479f8(0x1f3)+_0x294cc6[_0x3479f8(0x284)])),_0x55ddfa++;}const _0x257af9=[];if(_0x4ec0fb>0x0)_0x257af9[_0x3479f8(0x267)](_0x4ec0fb+'\x20created');if(_0xb50079>0x0)_0x257af9[_0x3479f8(0x267)](_0xb50079+_0x3479f8(0x1f6));if(_0x2cae69>0x0)_0x257af9[_0x3479f8(0x267)](_0x2cae69+_0x3479f8(0x21b));const _0xf0873=[];if(_0x413303>0x0)_0xf0873[_0x3479f8(0x267)](_0x413303+'\x20created');if(_0x10e349>0x0)_0xf0873[_0x3479f8(0x267)](_0x10e349+_0x3479f8(0x1f6));if(_0x55ddfa>0x0)_0xf0873[_0x3479f8(0x267)](_0x55ddfa+'\x20deleted');const _0x39b536=[];if(_0x1cef4c>0x0)_0x39b536[_0x3479f8(0x267)](_0x1cef4c+'\x20created');if(_0x376dab>0x0)_0x39b536[_0x3479f8(0x267)](_0x376dab+_0x3479f8(0x1f6));if(_0x4a6945>0x0)_0x39b536[_0x3479f8(0x267)](_0x4a6945+_0x3479f8(0x21b));console[_0x3479f8(0x23d)](a48_0x38a609[_0x3479f8(0x233)](_0x3479f8(0x256)));_0x257af9['length']>0x0&&!_0x273058[_0x3479f8(0x254)]&&console[_0x3479f8(0x23d)](_0x3479f8(0x239)+_0x257af9['join'](',\x20'));_0xf0873['length']>0x0&&console['error'](_0x3479f8(0x247)+_0xf0873[_0x3479f8(0x220)](',\x20'));_0x39b536[_0x3479f8(0x288)]>0x0&&!_0x273058['journeysOnly']&&console[_0x3479f8(0x23d)](_0x3479f8(0x21c)+_0x39b536[_0x3479f8(0x220)](',\x20'));if(_0xd9d9b3){const _0x380636=getConsoleNextUrl(_0x273058['site'],_0x3479f8(0x22e)+_0x4282d6+_0x3479f8(0x25f)+_0xd9d9b3+_0x3479f8(0x234));console['error'](_0x3479f8(0x1fa)+a48_0x38a609[_0x3479f8(0x261)](_0x380636));}return 0x0;}}
1
+ const a54_0x176b0d=a54_0x2f30;(function(_0x386f1c,_0x25095e){const _0x224aeb=a54_0x2f30,_0xeaaeee=_0x386f1c();while(!![]){try{const _0x3de886=parseInt(_0x224aeb(0x11d))/0x1+parseInt(_0x224aeb(0x1af))/0x2*(-parseInt(_0x224aeb(0x146))/0x3)+parseInt(_0x224aeb(0x18f))/0x4+-parseInt(_0x224aeb(0x125))/0x5*(parseInt(_0x224aeb(0x1a0))/0x6)+-parseInt(_0x224aeb(0x136))/0x7+parseInt(_0x224aeb(0x15a))/0x8+parseInt(_0x224aeb(0x135))/0x9;if(_0x3de886===_0x25095e)break;else _0xeaaeee['push'](_0xeaaeee['shift']());}catch(_0x232c2d){_0xeaaeee['push'](_0xeaaeee['shift']());}}}(a54_0x4e73,0x27b48));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 a54_0x259b91 from'chalk';function a54_0x2f30(_0x454c6e,_0x58e117){_0x454c6e=_0x454c6e-0x119;const _0x4e732d=a54_0x4e73();let _0x2f3049=_0x4e732d[_0x454c6e];return _0x2f3049;}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 a54_0x4e73(){const _0x5367c8=['\x20unchanged','Fetching\x20connections\x20for\x20name\x20resolution...','dryRun','join','No\x20','journeys','184522XbYFBX','\x20\x20Journeys:\x20','journeyBundleId','unchanged','dim','\x0aPush\x20summary\x20for\x20\x27','map','/j/da/je','10785PkaWpN','\x20YAML\x20files\x20found','add','no_parent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parentFolder','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20to\x20delete','changed','message','listFolders','existingSegment','createdSegmentIds','toString','getMetadataWithCache','\x20new','281340XydjER','1009764VuBPsm','parentSegment','\x20\x20\x20\x20','\x20\x20📊\x20Segments:','folderPath','delete','\x20to\x20update','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)','\x20deleted','length','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','description','get','yamlConfig','parent_name','attributes','12VmnzNW','error','setPhase','segment\x20or\x20journey','Scoped\x20to\x20folder:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','toDelete','idToName','type','\x0aValidation\x20failed:','\x20updated','journeyBundleName','(Journey\x20will\x20be\x20deleted)','journeyId','green','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Aborted.','site','Delete\x20journey:','Site:\x20','2305928UyyXRA','segmentFolderId','diff','all','toCreate','targetDir','Resolving\x20parent\x20segment\x20\x27','getJourney','execute','cyan','Delete\x20segment:','created','updatedAt','Parent\x20segment:\x20','listSegments','\x20\x20Activations:\x20','deleted','\x20changes?','isNew','then','resolveParentId','audienceId','Preparing\x20journeys...','Source\x20directory:\x20','connection','isScoped','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','/e/','getParent','buildUserMaps','.yml','\x0a✔\x20Push\x20complete','updated','journey','/app/ps/','New\x20segment:','Fetching\x20existing\x20data...','Push\x20','data','activations','\x0aError:','push','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','new','\x20to\x20create','filePath','yellow','journeysOnly','Error:\x20','\x20folders\x20to\x20create','Folders\x20to\x20create:','folderId','1223396AyeHAX','\x20created','red','relationships','\x20changed','\x20activations]','Error:\x20Directory\x20not\x20found:\x20','file','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','results','errorCode','segment','filter','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','verbose','792rsihOj','segments','\x20\x20Segments:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','existingJourney','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','folders','/sb/da/esr','repeat','nameToId','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','user','blue','name','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','109132CqMApB','Error\x20parsing\x20YAML:\x20'];a54_0x4e73=function(){return _0x5367c8;};return a54_0x4e73();}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{[a54_0x176b0d(0x1ad)]='segment:push';['description']=a54_0x176b0d(0x1aa);async[a54_0x176b0d(0x162)](_0x33d862){const _0x14523c=a54_0x176b0d,{options:_0x3424cb,args:_0x559594,tdx:_0x58bf16}=_0x33d862,_0x5cb7c0=_0x3424cb,_0x20b21c=await resolveTarget({'arg':_0x559594[0x0],'contextParent':_0x3424cb[_0x14523c(0x137)],'cwd':process[_0x14523c(0x19d)]()});if(!isSuccessfulResolution(_0x20b21c))return _0x20b21c[_0x14523c(0x19a)]===_0x14523c(0x128)?(console[_0x14523c(0x147)](a54_0x259b91['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x14523c(0x147)](_0x14523c(0x13d)),console['error'](_0x14523c(0x19e)),console['error'](_0x14523c(0x198))):(console['error'](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x18b)+_0x20b21c['message']+'\x0a')),_0x20b21c['helpText']&&console['error'](a54_0x259b91[_0x14523c(0x163)](_0x20b21c['helpText']))),0x1;if(_0x20b21c[_0x14523c(0x14e)]===_0x14523c(0x144))return console[_0x14523c(0x147)](a54_0x259b91['red'](_0x14523c(0x195)+_0x20b21c['targetDir']+'\x0a')),console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x163)](_0x14523c(0x1a5))),0x1;const _0xaff5ff=_0x20b21c['parentName'],_0x10735a=_0x20b21c[_0x14523c(0x15f)],_0x5b081b=_0x20b21c[_0x14523c(0x14e)]===_0x14523c(0x196)?_0x20b21c[_0x14523c(0x188)]:undefined,_0x5eb224=getScopedDetails(_0x20b21c),_0x37087c=_0x5eb224?.[_0x14523c(0x173)]??![],_0x2dd484=_0x5eb224?.['scopedFolderPath']??'';if(!existsSync(_0x10735a))return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)]('Error:\x20Directory\x20not\x20found:\x20'+_0x10735a+'\x0a')),console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x163)](_0x14523c(0x1a5))),0x1;_0x5cb7c0['verbose']&&(console[_0x14523c(0x147)](_0x14523c(0x159)+_0x5cb7c0['site']),console[_0x14523c(0x147)](_0x14523c(0x167)+_0xaff5ff),console[_0x14523c(0x147)](_0x14523c(0x171)+_0x10735a),_0x37087c&&console[_0x14523c(0x147)](_0x14523c(0x14a)+_0x2dd484));const _0x225942=await withSpinner(_0x14523c(0x160)+_0xaff5ff+'\x27...',()=>_0x58bf16['segment'][_0x14523c(0x16e)](_0xaff5ff),{'verbose':_0x5cb7c0['verbose']}),_0x400fee=_0x225942['data'],{parentSegmentResult:_0x30ed1b,segmentsResult:_0x102cdb,foldersResult:_0x5f077f,journeysWithDetailsResult:_0x37782b,userMaps:_0x2e50c4}=await withSpinner(_0x14523c(0x17f),async()=>{const _0x5cd979=_0x14523c,[_0x54e68e,_0x5c374e,_0x19b7f2,_0x2be1d3,_0x5bf84f]=await Promise[_0x5cd979(0x15d)]([_0x58bf16['segment'][_0x5cd979(0x177)](_0x400fee),_0x58bf16[_0x5cd979(0x19b)][_0x5cd979(0x168)](_0x400fee),_0x58bf16[_0x5cd979(0x19b)][_0x5cd979(0x12f)](_0x400fee),_0x58bf16[_0x5cd979(0x17c)]['listJourneysWithDetailsFromParentSegment'](_0x400fee,{'includeAllVersions':!![]}),_0x58bf16[_0x5cd979(0x1ab)][_0x5cd979(0x178)]()]);return{'parentSegmentResult':_0x54e68e,'segmentsResult':_0x5c374e,'foldersResult':_0x19b7f2,'journeysWithDetailsResult':_0x2be1d3,'userMaps':_0x5bf84f};},{'verbose':_0x5cb7c0[_0x14523c(0x19f)]})[_0x14523c(0x16d)](_0x734c25=>_0x734c25[_0x14523c(0x181)]),_0x4e85ee=_0x30ed1b,_0x480462=extractRootFolderId(_0x4e85ee),_0x1ce3fb=_0x102cdb,_0x144d4c=_0x5f077f,{journeys:_0x3244ec,activationStepsById:_0x1a2b82}=_0x37782b,_0x14cc0b=new Map(_0x3244ec[_0x14523c(0x123)](_0x32ca1e=>[_0x32ca1e['id'],_0x32ca1e])),_0x1ced94=_0x3244ec[_0x14523c(0x123)](_0x4b4fbe=>({'id':_0x4b4fbe['id'],'name':_0x4b4fbe['attributes'][_0x14523c(0x1ad)],'journeyBundleName':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x151)]||'','journeyBundleId':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x11f)]||'','versionNumber':_0x4b4fbe[_0x14523c(0x145)]['versionNumber'],'description':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x141)],'state':_0x4b4fbe[_0x14523c(0x145)]['state'],'paused':_0x4b4fbe['attributes']['paused'],'audienceId':_0x4b4fbe['attributes'][_0x14523c(0x16f)],'folderId':_0x4b4fbe[_0x14523c(0x192)]?.[_0x14523c(0x12a)]?.[_0x14523c(0x181)]?.['id'],'createdAt':_0x4b4fbe[_0x14523c(0x145)]['createdAt'],'updatedAt':_0x4b4fbe[_0x14523c(0x145)][_0x14523c(0x166)]})),{emailToId:_0x180459,idToEmail:_0x559a97}=_0x2e50c4,_0x237bed=await withSpinner(_0x14523c(0x1b2),async()=>{const _0x3a19a9=await _0x58bf16['connection']['list']();return buildConnectionMaps(_0x3a19a9);},{'verbose':_0x5cb7c0[_0x14523c(0x19f)]})[_0x14523c(0x16d)](_0xab439d=>_0xab439d[_0x14523c(0x181)]),_0x26cc27=_0x237bed[_0x14523c(0x1a9)],_0x1e07cb=_0x237bed[_0x14523c(0x14d)],_0x8f189f=_0x237bed['nameToType'],_0x5c3de8={'emailToIdMap':_0x180459,'connectionNameToIdMap':_0x26cc27,'connectionNameToTypeMap':_0x8f189f,'getSchema':_0x2c9add=>_0x58bf16[_0x14523c(0x172)]['getOutputSchemaWithCache'](_0x2c9add),'getMetadata':_0x37d9bf=>_0x58bf16[_0x14523c(0x172)][_0x14523c(0x133)](_0x37d9bf)};let {pathToId:_0x17bfe8,idToPath:_0x11aa74}=buildFolderMaps(_0x144d4c);const _0x174115=buildSegmentLookupMap(_0x1ce3fb,_0x11aa74),_0x4c2cd3=buildSegmentNameToIdMap(_0x1ce3fb),_0xfbdfdb=buildJourneyBundleLookupMap(_0x1ced94,_0x11aa74);let _0x4836f3;if(_0x5b081b){if(!_0x5b081b[_0x14523c(0x197)](_0x14523c(0x179))&&!_0x5b081b['endsWith']('.yaml'))return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x175)+_0x5b081b+'\x0a')),0x1;_0x4836f3=[_0x5b081b];}else _0x4836f3=findYamlFiles(_0x10735a);if(_0x4836f3[_0x14523c(0x13f)]===0x0)return console[_0x14523c(0x147)](a54_0x259b91['red'](_0x14523c(0x1ae)+_0x10735a+'\x0a')),console['error'](a54_0x259b91[_0x14523c(0x163)](_0x14523c(0x14b))),0x1;let _0x5b82fc,_0x4032b5;try{const _0x45a3fa=parseAndClassifyYamlFiles(_0x4836f3,_0x10735a,{'skipSegments':_0x5cb7c0[_0x14523c(0x18a)]});_0x5b82fc=_0x45a3fa[_0x14523c(0x1a1)],_0x4032b5=_0x45a3fa['journeys'];const _0x36f93e=validateParsedFiles(_0x45a3fa,_0x10735a);if(_0x36f93e[_0x14523c(0x13f)]>0x0)return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x14f))),console['error'](formatValidationErrors(_0x36f93e)),console['error'](a54_0x259b91[_0x14523c(0x189)](_0x14523c(0x185))),0x1;}catch(_0x42c368){return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x1b0)+(_0x42c368 instanceof Error?_0x42c368[_0x14523c(0x12e)]:_0x42c368))),0x1;}if(_0x5b82fc[_0x14523c(0x13f)]===0x0&&_0x4032b5[_0x14523c(0x13f)]===0x0){const _0x46a4dd=_0x5cb7c0[_0x14523c(0x18a)]?_0x14523c(0x17c):_0x14523c(0x149);return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)](_0x14523c(0x11b)+_0x46a4dd+_0x14523c(0x126))),0x0;}const _0x4473a4=new Map();_0x1ce3fb[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x1ce3fb,async _0x408d65=>{const _0x153cad=a54_0x2f30,_0x289a2e=await _0x58bf16[_0x153cad(0x19b)]['listActivations'](_0x400fee,_0x408d65['id']);_0x4473a4['set'](_0x408d65['id'],_0x289a2e);});},{'verbose':_0x5cb7c0[_0x14523c(0x19f)]});const {segmentFiles:_0x1acc32,foldersToCreate:_0x46a36e}=await prepareSegmentFiles(_0x5b82fc,{'segmentByFolderAndName':_0x174115,'activationsBySegmentId':_0x4473a4,'folderPathToId':_0x17bfe8,'idToEmailMap':_0x559a97,'connectionIdToNameMap':_0x1e07cb},_0x5c3de8,_0x37087c,_0x2dd484),_0x2ed6e7=_0x5b081b?[]:findSegmentsToDelete(_0x1ce3fb,_0x5b82fc[_0x14523c(0x123)](({yamlConfig:_0x285fb3,folderPath:_0x19c2c6})=>({'yamlConfig':_0x285fb3,'folderPath':resolveTDFolderPath(_0x19c2c6,_0x37087c,_0x2dd484)})),_0x11aa74,_0x2dd484,_0x37087c),{journeyFiles:_0x516161,foldersToCreate:_0x22f2cc}=await withProgressSpinner(_0x14523c(0x170),async _0x5dde6e=>prepareJourneyFiles(_0x4032b5,{'fetchJourney':async _0xd7f77b=>_0x58bf16['journey'][_0x14523c(0x161)](_0xd7f77b[_0x14523c(0x153)]),'journeyBundlesByFolderAndName':_0xfbdfdb,'folderPathToId':_0x17bfe8,'idToEmailMap':_0x559a97,'connectionIdToNameMap':_0x1e07cb,'existingSegments':_0x1ce3fb,'parentId':_0x400fee,'deps':_0x58bf16,'progress':{'update':_0x52a27b=>{const _0x3556db=_0x14523c;_0x5dde6e[_0x3556db(0x148)](_0x52a27b),_0x5cb7c0[_0x3556db(0x19f)]&&console[_0x3556db(0x147)]('\x20\x20'+_0x52a27b);}},'journeyById':_0x14cc0b,'activationStepsById':_0x1a2b82},_0x37087c,_0x2dd484),{'verbose':_0x5cb7c0[_0x14523c(0x19f)]})['then'](_0x213ae3=>_0x213ae3[_0x14523c(0x181)]);for(const _0x390567 of _0x22f2cc){_0x46a36e[_0x14523c(0x127)](_0x390567);}const _0x4d06c5=_0x5b081b?[]:findJourneysToDelete(_0x1ced94,_0x4032b5['map'](({yamlConfig:_0x3e6966,folderPath:_0x2a2457})=>({'yamlConfig':_0x3e6966,'folderPath':resolveTDFolderPath(_0x2a2457,_0x37087c,_0x2dd484)})),_0x11aa74,_0x2dd484,_0x37087c),_0x32a1e8=calculatePushStats(_0x1acc32,_0x516161,_0x46a36e,_0x2ed6e7,_0x4d06c5,!!_0x5cb7c0['delete'],!!_0x5cb7c0[_0x14523c(0x18a)]),_0x2d353c=_0x32a1e8[_0x14523c(0x1a1)][_0x14523c(0x186)],_0x54f7eb=_0x32a1e8[_0x14523c(0x1a1)][_0x14523c(0x12d)],_0x3cedbf=_0x32a1e8['segments'][_0x14523c(0x120)],_0x387ecd=_0x32a1e8[_0x14523c(0x1a1)][_0x14523c(0x14c)],_0xf94e11=_0x32a1e8[_0x14523c(0x1a6)][_0x14523c(0x15e)],_0x4859e8=_0x32a1e8[_0x14523c(0x11c)][_0x14523c(0x186)],_0x58aefc=_0x32a1e8['journeys'][_0x14523c(0x12d)],_0x2c5765=_0x32a1e8[_0x14523c(0x11c)][_0x14523c(0x120)],_0x575920=_0x32a1e8[_0x14523c(0x11c)][_0x14523c(0x14c)],_0x1ba904=_0x32a1e8[_0x14523c(0x182)][_0x14523c(0x15d)],_0x5690fe=_0x32a1e8[_0x14523c(0x182)][_0x14523c(0x15e)],_0x57a9d1=_0x32a1e8['activations']['toUpdate'],_0x12977=_0x32a1e8[_0x14523c(0x182)][_0x14523c(0x14c)];console[_0x14523c(0x147)](_0x14523c(0x122)+_0xaff5ff+'\x27:');_0xf94e11['length']>0x0&&console['error']('\x20\x20'+a54_0x259b91['blue']('📁\x20'+_0xf94e11['length']+_0x14523c(0x18c)));if(!_0x5cb7c0[_0x14523c(0x18a)]){console[_0x14523c(0x147)](_0x14523c(0x139)),console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91['green']('+\x20'+_0x2d353c[_0x14523c(0x13f)]+_0x14523c(0x134))),console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x189)]('~\x20'+_0x54f7eb[_0x14523c(0x13f)]+_0x14523c(0x193)));if(_0x387ecd[_0x14523c(0x13f)]>0x0)console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x191)]('-\x20'+_0x387ecd[_0x14523c(0x13f)]+_0x14523c(0x12c)));else _0x2ed6e7[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x13b)]&&console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x121)](_0x2ed6e7[_0x14523c(0x13f)]+_0x14523c(0x174)));console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91[_0x14523c(0x121)]('=\x20'+_0x3cedbf['length']+_0x14523c(0x1b1)));}if(_0x516161[_0x14523c(0x13f)]>0x0||_0x4d06c5[_0x14523c(0x13f)]>0x0){console[_0x14523c(0x147)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91['green']('+\x20'+_0x4859e8[_0x14523c(0x13f)]+_0x14523c(0x134))),console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91[_0x14523c(0x189)]('~\x20'+_0x58aefc[_0x14523c(0x13f)]+'\x20changed'));if(_0x575920['length']>0x0)console['error']('\x20\x20\x20\x20'+a54_0x259b91['red']('-\x20'+_0x575920['length']+_0x14523c(0x12c)));else _0x4d06c5[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x13b)]&&console[_0x14523c(0x147)]('\x20\x20\x20\x20'+a54_0x259b91[_0x14523c(0x121)](_0x4d06c5['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x121)]('=\x20'+_0x2c5765[_0x14523c(0x13f)]+_0x14523c(0x1b1)));}_0x1ba904['length']>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&(console[_0x14523c(0x147)](''),console['error']('\x20\x20Activations:'),_0x5690fe[_0x14523c(0x13f)]>0x0&&console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91['green']('+\x20'+_0x5690fe[_0x14523c(0x13f)]+_0x14523c(0x187))),_0x57a9d1['length']>0x0&&console[_0x14523c(0x147)](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x189)]('~\x20'+_0x57a9d1[_0x14523c(0x13f)]+_0x14523c(0x13c))),_0x12977[_0x14523c(0x13f)]>0x0&&console['error'](_0x14523c(0x138)+a54_0x259b91[_0x14523c(0x191)]('-\x20'+_0x12977[_0x14523c(0x13f)]+_0x14523c(0x12c))));console[_0x14523c(0x147)]('\x20\x20Source:\x20'+a54_0x259b91[_0x14523c(0x163)](_0x10735a)+'\x0a');if(_0xf94e11[_0x14523c(0x13f)]>0x0){console[_0x14523c(0x147)](_0x14523c(0x18d));for(const _0x4e6165 of _0xf94e11){console[_0x14523c(0x147)]('\x20\x20'+a54_0x259b91['blue']('+')+'\x20'+_0x4e6165);}console['error']('');}if(_0x2d353c['length']>0x0&&!_0x5cb7c0['journeysOnly'])for(const _0x808dd6 of _0x2d353c){const _0x1fd7f2=_0x808dd6['folderPath']?_0x808dd6[_0x14523c(0x13a)]+'/'+_0x808dd6[_0x14523c(0x143)][_0x14523c(0x1ad)]:_0x808dd6['yamlConfig'][_0x14523c(0x1ad)],_0x5edf97=_0x808dd6['yamlConfig']['activations']?.[_0x14523c(0x13f)]||0x0,_0x163bcc=_0x5edf97>0x0?a54_0x259b91[_0x14523c(0x121)]('\x20['+_0x5edf97+'\x20activations]'):'';console['error']('\x0a'+a54_0x259b91[_0x14523c(0x154)](_0x14523c(0x17e))+'\x20'+_0x1fd7f2+_0x163bcc),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c)),_0x808dd6['diff']&&console[_0x14523c(0x147)](_0x808dd6[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x387ecd[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x18a)])for(const _0x74bb7 of _0x387ecd){const _0x116574=_0x74bb7[_0x14523c(0x15b)]?_0x11aa74[_0x14523c(0x142)](_0x74bb7['segmentFolderId'][_0x14523c(0x132)]())||'':'',_0x5501eb=_0x116574?_0x116574+'/'+_0x74bb7[_0x14523c(0x1ad)]:_0x74bb7['name'],_0x38daf4=_0x4473a4[_0x14523c(0x142)](_0x74bb7['id'])||[],_0x2c7a02=_0x38daf4[_0x14523c(0x13f)]>0x0?a54_0x259b91['dim']('\x20['+_0x38daf4['length']+_0x14523c(0x194)):'';console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x164))+'\x20'+_0x5501eb+_0x2c7a02),console['error']('─'[_0x14523c(0x1a8)](0x3c));const _0x2f0c7c=segmentWithActivationsToYaml(_0x74bb7,_0x38daf4,undefined,_0x559a97,_0x1e07cb),_0x26392=segmentToYamlString(_0x2f0c7c),_0x3204da=generateDiff(_0x26392,'');console['error'](formatDiffWithColors(_0x3204da)),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}const _0x1d9d58=_0x1acc32[_0x14523c(0x19c)](_0x362cc6=>!_0x362cc6[_0x14523c(0x16c)]&&_0x362cc6[_0x14523c(0x15c)]);if(_0x1d9d58[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0['journeysOnly'])for(const _0x2eb2c2 of _0x1d9d58){const _0x4c58da=_0x2eb2c2[_0x14523c(0x13a)]?_0x2eb2c2[_0x14523c(0x13a)]+'/'+_0x2eb2c2[_0x14523c(0x143)][_0x14523c(0x1ad)]:_0x2eb2c2['yamlConfig'][_0x14523c(0x1ad)];console['error']('\x0a'+a54_0x259b91[_0x14523c(0x189)]('Changes\x20to:')+'\x20'+_0x4c58da),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c)),console[_0x14523c(0x147)](_0x2eb2c2[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x4859e8[_0x14523c(0x13f)]>0x0)for(const _0x5acc8e of _0x4859e8){const _0x2a184a=_0x5acc8e[_0x14523c(0x13a)]?_0x5acc8e[_0x14523c(0x13a)]+'/'+_0x5acc8e[_0x14523c(0x143)][_0x14523c(0x1ad)]:_0x5acc8e['yamlConfig']['name'];console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x154)]('New\x20journey:')+'\x20'+_0x2a184a),console[_0x14523c(0x147)]('─'['repeat'](0x3c)),_0x5acc8e[_0x14523c(0x15c)]&&console[_0x14523c(0x147)](_0x5acc8e[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}const _0x43767f=_0x516161[_0x14523c(0x19c)](_0x647519=>!_0x647519[_0x14523c(0x16c)]&&_0x647519[_0x14523c(0x15c)]);if(_0x43767f[_0x14523c(0x13f)]>0x0)for(const _0x1fba90 of _0x43767f){const _0x488a2e=_0x1fba90[_0x14523c(0x13a)]?_0x1fba90[_0x14523c(0x13a)]+'/'+_0x1fba90[_0x14523c(0x143)]['name']:_0x1fba90[_0x14523c(0x143)][_0x14523c(0x1ad)];console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x189)]('Changes\x20to\x20journey:')+'\x20'+_0x488a2e),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c)),console[_0x14523c(0x147)](_0x1fba90[_0x14523c(0x15c)]),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x575920[_0x14523c(0x13f)]>0x0)for(const _0x40c304 of _0x575920){const _0x45a842=_0x40c304[_0x14523c(0x18e)]?_0x11aa74['get'](_0x40c304[_0x14523c(0x18e)])||'':'',_0x250d9b=_0x45a842?_0x45a842+'/'+_0x40c304['journeyBundleName']:_0x40c304[_0x14523c(0x151)];console[_0x14523c(0x147)]('\x0a'+a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x158))+'\x20'+_0x250d9b),console[_0x14523c(0x147)]('─'['repeat'](0x3c)),console[_0x14523c(0x147)](a54_0x259b91['red'](_0x14523c(0x152))),console[_0x14523c(0x147)]('─'[_0x14523c(0x1a8)](0x3c));}if(_0x5cb7c0[_0x14523c(0x119)])return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x480d51=_0x5cb7c0[_0x14523c(0x18a)]?![]:_0x2d353c[_0x14523c(0x13f)]>0x0||_0x54f7eb[_0x14523c(0x13f)]>0x0||_0x387ecd[_0x14523c(0x13f)]>0x0,_0x57f2b3=_0x4859e8['length']>0x0||_0x58aefc['length']>0x0||_0x575920[_0x14523c(0x13f)]>0x0,_0x5a73ac=_0x5cb7c0[_0x14523c(0x18a)]?![]:_0x1ba904[_0x14523c(0x13f)]>0x0,_0x4205c4=_0xf94e11['length']>0x0;if(!_0x480d51&&!_0x57f2b3&&!_0x5a73ac&&!_0x4205c4){const _0x34cc40=_0x5cb7c0[_0x14523c(0x18a)]?_0x14523c(0x1a3):_0x14523c(0x12b);console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x154)](_0x34cc40));if(_0x5b081b&&_0x3cedbf[_0x14523c(0x13f)]===0x1){const _0x2f1181=_0x3cedbf[0x0];if(_0x2f1181['existingSegment']?.['id']){const _0x4c67e8=getConsoleNextUrl(_0x5cb7c0[_0x14523c(0x157)],_0x14523c(0x17d)+_0x400fee+_0x14523c(0x176)+_0x2f1181[_0x14523c(0x130)]['id']+'/sb/da/esr');console[_0x14523c(0x147)](_0x14523c(0x155)+a54_0x259b91[_0x14523c(0x163)](_0x4c67e8));}}if(_0x5b081b&&_0x2c5765[_0x14523c(0x13f)]===0x1){const _0x3b999d=_0x2c5765[0x0];if(_0x3b999d[_0x14523c(0x1a4)]?.['id']){const _0xfda6e1=getConsoleNextUrl(_0x5cb7c0['site'],_0x14523c(0x17d)+_0x400fee+'/e/'+_0x3b999d[_0x14523c(0x1a4)]['id']+_0x14523c(0x124));console[_0x14523c(0x147)]('\x20\x20'+a54_0x259b91[_0x14523c(0x163)](_0xfda6e1));}}return 0x0;}const _0x37b5a3=_0x5cb7c0[_0x14523c(0x18a)]?_0x4859e8[_0x14523c(0x13f)]+_0x58aefc['length']+_0x575920[_0x14523c(0x13f)]+_0xf94e11[_0x14523c(0x13f)]:_0x2d353c[_0x14523c(0x13f)]+_0x54f7eb[_0x14523c(0x13f)]+_0x387ecd[_0x14523c(0x13f)]+_0x4859e8[_0x14523c(0x13f)]+_0x58aefc[_0x14523c(0x13f)]+_0x575920[_0x14523c(0x13f)]+_0xf94e11[_0x14523c(0x13f)]+_0x1ba904[_0x14523c(0x13f)];if(!_0x5cb7c0['yes']&&_0x37b5a3>0x0){if(!isInteractive())return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)](_0x14523c(0x183)),_0x14523c(0x129)),console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x121)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x396bcd=await confirmKey(_0x14523c(0x180)+_0x37b5a3+_0x14523c(0x16b));if(!_0x396bcd)return console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)](_0x14523c(0x156))),0x1;}const _0x35e982={'withProgress':async(_0xa17b0,_0x489651)=>{const _0x245d7a=_0x14523c,_0x596f57=await withSpinner(_0xa17b0,_0x489651,{'verbose':_0x5cb7c0[_0x245d7a(0x19f)]});return{'data':_0x596f57[_0x245d7a(0x181)]};},'logInfo':_0x32acd2=>console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x1ac)]('✔\x20'+_0x32acd2)),'logSuccess':_0x23a75e=>console['error'](a54_0x259b91[_0x14523c(0x154)]('✔\x20'+_0x23a75e)),'logWarning':_0x1ac495=>console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x189)]('⚠\x20'+_0x1ac495)),'logDeleted':_0x5962b1=>console[_0x14523c(0x147)](a54_0x259b91[_0x14523c(0x191)]('✔\x20'+_0x5962b1))},_0x5d9d48={'segment':_0x58bf16[_0x14523c(0x19b)],'journey':_0x58bf16['journey'],'user':_0x58bf16[_0x14523c(0x1ab)],'connection':_0x58bf16[_0x14523c(0x172)]};_0xf94e11[_0x14523c(0x13f)]>0x0&&(_0x17bfe8=await executePushFolders(_0x5d9d48,_0xf94e11,_0x17bfe8,{'parentId':_0x400fee},_0x35e982));const _0x30168c={'rootFolderId':_0x480462,'folderPathToId':_0x17bfe8,'folderIdToPath':_0x11aa74,'segmentNameToId':_0x4c2cd3,'activationsBySegmentId':_0x4473a4,'emailToIdMap':_0x180459,'idToEmailMap':_0x559a97,'connectionNameToIdMap':_0x237bed[_0x14523c(0x1a9)],'connectionIdToNameMap':_0x237bed[_0x14523c(0x14d)],'connectionNameToTypeMap':_0x8f189f},_0x371605=await executePushSegments(_0x5d9d48,_0x5cb7c0[_0x14523c(0x18a)]?[]:_0x1acc32,_0x30168c,{'parentId':_0x400fee},_0x35e982),_0x295067=_0x371605[_0x14523c(0x165)],_0x17584c=_0x371605[_0x14523c(0x17b)],_0x745f6a=_0x371605[_0x14523c(0x182)][_0x14523c(0x165)],_0x272b31=_0x371605[_0x14523c(0x182)][_0x14523c(0x17b)],_0x373beb=_0x371605[_0x14523c(0x182)][_0x14523c(0x16a)];let _0x33fdb3;if(_0x5b081b&&_0x1acc32[_0x14523c(0x13f)]===0x1){const _0x407c5d=_0x1acc32[0x0];_0x33fdb3=_0x407c5d[_0x14523c(0x130)]?.['id']??_0x371605['createdSegmentIds']['get'](_0x407c5d['yamlConfig'][_0x14523c(0x1ad)]);}const _0x2458ef=await executePushSegmentDeletions(_0x5d9d48,_0x5cb7c0[_0x14523c(0x18a)]?[]:_0x387ecd,_0x35e982);let _0x59f520=0x0,_0x1b3439=0x0,_0x209754=0x0;const _0x1a6082=new Map(_0x4c2cd3);for(const [_0x254dc2,_0x24c1ed]of _0x371605[_0x14523c(0x131)]){_0x1a6082['set'](_0x254dc2,_0x24c1ed);}if(_0x516161[_0x14523c(0x13f)]>0x0){const _0x25f8ac={..._0x30168c,'segmentNameToId':_0x1a6082,'existingSegments':_0x1ce3fb,'activationContext':_0x5c3de8},_0x3f66dd=await executePushJourneys(_0x5d9d48,_0x516161,_0x25f8ac,{'parentId':_0x400fee,'rootFolderId':_0x480462,'verbose':_0x5cb7c0['verbose']},_0x35e982);_0x59f520=_0x3f66dd[_0x14523c(0x165)],_0x1b3439=_0x3f66dd[_0x14523c(0x17b)];if(_0x5b081b&&_0x3f66dd[_0x14523c(0x199)][_0x14523c(0x13f)]===0x1){const _0x2f8bd7=_0x3f66dd['results'][0x0];if(_0x2f8bd7[_0x14523c(0x153)]){const _0x1ee98e=getConsoleNextUrl(_0x5cb7c0['site'],_0x14523c(0x17d)+_0x400fee+'/e/'+_0x2f8bd7[_0x14523c(0x153)]+_0x14523c(0x124));console['error']('\x20\x20'+a54_0x259b91[_0x14523c(0x163)](_0x1ee98e));}}}for(const _0x7c5311 of _0x575920){console[_0x14523c(0x147)](a54_0x259b91['yellow'](_0x14523c(0x140)+_0x7c5311[_0x14523c(0x151)])),_0x209754++;}const _0x1c08c5=[];if(_0x295067>0x0)_0x1c08c5[_0x14523c(0x184)](_0x295067+_0x14523c(0x190));if(_0x17584c>0x0)_0x1c08c5['push'](_0x17584c+_0x14523c(0x150));if(_0x2458ef>0x0)_0x1c08c5['push'](_0x2458ef+_0x14523c(0x13e));const _0x2ce719=[];if(_0x59f520>0x0)_0x2ce719[_0x14523c(0x184)](_0x59f520+_0x14523c(0x190));if(_0x1b3439>0x0)_0x2ce719[_0x14523c(0x184)](_0x1b3439+_0x14523c(0x150));if(_0x209754>0x0)_0x2ce719[_0x14523c(0x184)](_0x209754+'\x20deleted');const _0x281a76=[];if(_0x745f6a>0x0)_0x281a76['push'](_0x745f6a+_0x14523c(0x190));if(_0x272b31>0x0)_0x281a76[_0x14523c(0x184)](_0x272b31+_0x14523c(0x150));if(_0x373beb>0x0)_0x281a76[_0x14523c(0x184)](_0x373beb+_0x14523c(0x13e));console['error'](a54_0x259b91[_0x14523c(0x154)](_0x14523c(0x17a)));_0x1c08c5[_0x14523c(0x13f)]>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&console[_0x14523c(0x147)](_0x14523c(0x1a2)+_0x1c08c5[_0x14523c(0x11a)](',\x20'));_0x2ce719[_0x14523c(0x13f)]>0x0&&console[_0x14523c(0x147)](_0x14523c(0x11e)+_0x2ce719[_0x14523c(0x11a)](',\x20'));_0x281a76['length']>0x0&&!_0x5cb7c0[_0x14523c(0x18a)]&&console[_0x14523c(0x147)](_0x14523c(0x169)+_0x281a76[_0x14523c(0x11a)](',\x20'));if(_0x33fdb3){const _0x3e0056=getConsoleNextUrl(_0x5cb7c0[_0x14523c(0x157)],_0x14523c(0x17d)+_0x400fee+_0x14523c(0x176)+_0x33fdb3+_0x14523c(0x1a7));console[_0x14523c(0x147)](_0x14523c(0x155)+a54_0x259b91[_0x14523c(0x163)](_0x3e0056));}return 0x0;}}
@@ -1 +1 @@
1
- const a49_0x41d85b=a49_0x5d46;(function(_0x4dbdeb,_0x5a911b){const _0x258962=a49_0x5d46,_0x122857=_0x4dbdeb();while(!![]){try{const _0xb179e8=-parseInt(_0x258962(0x8f))/0x1+-parseInt(_0x258962(0x8b))/0x2+parseInt(_0x258962(0x82))/0x3+parseInt(_0x258962(0x6a))/0x4+-parseInt(_0x258962(0x76))/0x5*(parseInt(_0x258962(0x87))/0x6)+-parseInt(_0x258962(0x95))/0x7*(parseInt(_0x258962(0x90))/0x8)+parseInt(_0x258962(0x6c))/0x9;if(_0xb179e8===_0x5a911b)break;else _0x122857['push'](_0x122857['shift']());}catch(_0x9fc7bd){_0x122857['push'](_0x122857['shift']());}}}(a49_0x47c0,0xbd341));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a49_0x5d46(_0x4e20e7,_0x52ebd1){_0x4e20e7=_0x4e20e7-0x6a;const _0x47c09b=a49_0x47c0();let _0x5d469a=_0x47c09b[_0x4e20e7];return _0x5d469a;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a49_0x47c0(){const _0x23a8b9=['segmentId','ruleFile','\x27...','1880772yZtlMe','Error:\x20Cannot\x20update\x20','Examples:','segment:update','95756xHomnc','1396640TKKjIe','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Segment\x20ID:\x20','execute','35VbKztY','Updating\x20segment\x20\x27','1326844fKWsqz','kind','15444144SIOphz','Resolved\x20relative\x20path\x20to:\x20','\x20\x20\x20Path:\x20','Resolving\x20path\x20\x27','includes','folder','parentId','length','description','rule','10qilxOI','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20folder\x20\x27','Update\x20existing\x20child\x20segment','segment','✔\x20Updated\x20segment\x20\x27','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','data','name','Resolved\x20type:\x20','error','verbose','4229748lTawNq','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','updateSegmentById','type','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','2320872iHIzJa'];a49_0x47c0=function(){return _0x23a8b9;};return a49_0x47c0();}import a49_0x5228d6 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a49_0x41d85b(0x7e)]=a49_0x41d85b(0x8e);[a49_0x41d85b(0x74)]=a49_0x41d85b(0x79);async[a49_0x41d85b(0x94)](_0x5a4d5d){const _0x53e0fd=a49_0x41d85b;console[_0x53e0fd(0x80)](a49_0x5228d6['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x53e0fd(0x80)](a49_0x5228d6['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x5e6972,args:_0x43a3e7,tdx:_0x3b958f}=_0x5a4d5d,_0x2181a1=_0x5e6972;if(_0x43a3e7[_0x53e0fd(0x73)]===0x0)return console[_0x53e0fd(0x80)](_0x53e0fd(0x83)),console[_0x53e0fd(0x80)](_0x53e0fd(0x91)),console[_0x53e0fd(0x80)](_0x53e0fd(0x8d)),console[_0x53e0fd(0x80)](_0x53e0fd(0x86)),console[_0x53e0fd(0x80)](_0x53e0fd(0x92)),0x1;const _0xa2a14a=_0x43a3e7[0x0],_0x304902=_0x5e6972['segmentPath'];let _0x186f0f=_0xa2a14a;_0x304902&&!_0xa2a14a[_0x53e0fd(0x70)]('/')&&(_0x186f0f=_0x304902+'/'+_0xa2a14a,_0x2181a1['verbose']&&console[_0x53e0fd(0x80)](_0x53e0fd(0x6d)+_0x186f0f));const _0x5a91fd=await withSpinner(_0x53e0fd(0x6f)+_0x186f0f+'\x27...',()=>_0x3b958f['segment']['resolvePathToResource'](_0x186f0f),{'verbose':_0x2181a1['verbose']}),_0x869fde=_0x5a91fd[_0x53e0fd(0x7d)];_0x2181a1[_0x53e0fd(0x81)]&&console[_0x53e0fd(0x80)](_0x53e0fd(0x7f)+_0x869fde[_0x53e0fd(0x85)]);if(_0x869fde['type']!=='segment')return console[_0x53e0fd(0x80)](_0x53e0fd(0x8c)+_0x869fde[_0x53e0fd(0x85)]+_0x53e0fd(0x7c)),console[_0x53e0fd(0x80)](_0x53e0fd(0x77)),0x1;if(!_0x869fde[_0x53e0fd(0x88)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x46cf7d=_0x869fde[_0x53e0fd(0x72)],_0x4aa143=_0x869fde[_0x53e0fd(0x88)];_0x2181a1[_0x53e0fd(0x81)]&&(console[_0x53e0fd(0x80)]('Parent\x20ID:\x20'+_0x46cf7d),console['error'](_0x53e0fd(0x93)+_0x4aa143));let _0xc340c0;if(_0x2181a1[_0x53e0fd(0x71)]){const _0x173fda=_0x2181a1[_0x53e0fd(0x71)],_0x863423=await withSpinner(_0x53e0fd(0x78)+_0x173fda+_0x53e0fd(0x8a),()=>_0x3b958f[_0x53e0fd(0x7a)]['resolveFolderId'](_0x46cf7d,_0x173fda),{'verbose':_0x2181a1[_0x53e0fd(0x81)]});_0xc340c0=parseInt(_0x863423[_0x53e0fd(0x7d)],0xa),_0x2181a1['verbose']&&console[_0x53e0fd(0x80)]('Resolved\x20folder\x20ID:\x20'+_0xc340c0);}const _0x162168=await loadJSONFromOptions(_0x2181a1[_0x53e0fd(0x75)],_0x2181a1[_0x53e0fd(0x89)]),_0x51ecca={'name':_0x2181a1['name'],'description':_0x2181a1[_0x53e0fd(0x74)],'rule':_0x162168,'kind':_0x2181a1[_0x53e0fd(0x6b)]!==undefined?parseInt(_0x2181a1[_0x53e0fd(0x6b)],0xa):undefined,'segmentFolderId':_0xc340c0},_0x4169b0=await withSpinner(_0x53e0fd(0x96)+_0x869fde['segmentName']+_0x53e0fd(0x8a),()=>_0x3b958f[_0x53e0fd(0x7a)][_0x53e0fd(0x84)](_0x46cf7d,_0x4aa143,_0x51ecca),{'verbose':_0x2181a1[_0x53e0fd(0x81)]}),_0x3a1adf=_0x4169b0['data'];return console[_0x53e0fd(0x80)](_0x53e0fd(0x7b)+_0x3a1adf[_0x53e0fd(0x7e)]+'\x27'),_0x186f0f!==_0xa2a14a&&console[_0x53e0fd(0x80)](_0x53e0fd(0x6e)+_0x186f0f),await handleSDKOutput([_0x3a1adf],_0x2181a1),0x0;}}
1
+ const a55_0x102b4c=a55_0x1a59;(function(_0x27a0f2,_0x1e2537){const _0x20a71b=a55_0x1a59,_0x461823=_0x27a0f2();while(!![]){try{const _0x1a1f4c=parseInt(_0x20a71b(0x85))/0x1+parseInt(_0x20a71b(0x8f))/0x2+parseInt(_0x20a71b(0x75))/0x3+-parseInt(_0x20a71b(0x70))/0x4*(parseInt(_0x20a71b(0x8e))/0x5)+-parseInt(_0x20a71b(0x82))/0x6*(parseInt(_0x20a71b(0x6e))/0x7)+-parseInt(_0x20a71b(0x92))/0x8+parseInt(_0x20a71b(0x90))/0x9;if(_0x1a1f4c===_0x1e2537)break;else _0x461823['push'](_0x461823['shift']());}catch(_0x19b421){_0x461823['push'](_0x461823['shift']());}}}(a55_0x4c17,0x2646b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a55_0x1a59(_0x5d47da,_0x56ba6b){_0x5d47da=_0x5d47da-0x6e;const _0x4c1781=a55_0x4c17();let _0x1a591f=_0x4c1781[_0x5d47da];return _0x1a591f;}import{withSpinner}from'../utils/spinner.js';function a55_0x4c17(){const _0x59ea8d=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','data','type','segmentPath','resolveFolderId','description','Resolving\x20folder\x20\x27','segment','25ZlHLvA','135014HwcFBB','3502449SHsIwC','resolvePathToResource','310632scHswt','Resolved\x20relative\x20path\x20to:\x20','Update\x20existing\x20child\x20segment','kind','yellow','updateSegmentById','Segment\x20ID\x20missing\x20from\x20resolved\x20path','includes','1743ronfIY','✔\x20Updated\x20segment\x20\x27','75468FscacP','Segment\x20ID:\x20','ruleFile','INTERNAL','segmentName','17028pxiZgc','segmentId','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolved\x20folder\x20ID:\x20','Parent\x20ID:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','error','Updating\x20segment\x20\x27','Examples:','name','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','rule','folder','4302Aucwwf','\x27...','verbose','6132lHkZor'];a55_0x4c17=function(){return _0x59ea8d;};return a55_0x4c17();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a55_0x4569d8 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a55_0x102b4c(0x7e)]='segment:update';['description']=a55_0x102b4c(0x94);async['execute'](_0x3b3ddc){const _0x1e3f72=a55_0x102b4c;console[_0x1e3f72(0x7b)](a55_0x4569d8['yellow'](_0x1e3f72(0x7a))),console[_0x1e3f72(0x7b)](a55_0x4569d8[_0x1e3f72(0x96)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x33e80e,args:_0x207f94,tdx:_0x53a0e9}=_0x3b3ddc,_0x4504bb=_0x33e80e;if(_0x207f94['length']===0x0)return console[_0x1e3f72(0x7b)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x1e3f72(0x7b)](_0x1e3f72(0x7f)),console[_0x1e3f72(0x7b)](_0x1e3f72(0x7d)),console[_0x1e3f72(0x7b)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console['error'](_0x1e3f72(0x86)),0x1;const _0x1dcc64=_0x207f94[0x0],_0x74f701=_0x33e80e[_0x1e3f72(0x89)];let _0x4fec8e=_0x1dcc64;_0x74f701&&!_0x1dcc64[_0x1e3f72(0x99)]('/')&&(_0x4fec8e=_0x74f701+'/'+_0x1dcc64,_0x4504bb['verbose']&&console[_0x1e3f72(0x7b)](_0x1e3f72(0x93)+_0x4fec8e));const _0x4171d0=await withSpinner('Resolving\x20path\x20\x27'+_0x4fec8e+_0x1e3f72(0x83),()=>_0x53a0e9['segment'][_0x1e3f72(0x91)](_0x4fec8e),{'verbose':_0x4504bb[_0x1e3f72(0x84)]}),_0x4a429a=_0x4171d0[_0x1e3f72(0x87)];_0x4504bb[_0x1e3f72(0x84)]&&console['error']('Resolved\x20type:\x20'+_0x4a429a[_0x1e3f72(0x88)]);if(_0x4a429a[_0x1e3f72(0x88)]!=='segment')return console[_0x1e3f72(0x7b)]('Error:\x20Cannot\x20update\x20'+_0x4a429a[_0x1e3f72(0x88)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x1e3f72(0x7b)](_0x1e3f72(0x77)),0x1;if(!_0x4a429a[_0x1e3f72(0x76)])throw new SDKError(ErrorCode[_0x1e3f72(0x73)],_0x1e3f72(0x98));const _0x218219=_0x4a429a['parentId'],_0x19d5de=_0x4a429a['segmentId'];_0x4504bb[_0x1e3f72(0x84)]&&(console['error'](_0x1e3f72(0x79)+_0x218219),console[_0x1e3f72(0x7b)](_0x1e3f72(0x71)+_0x19d5de));let _0x4d01e5;if(_0x4504bb[_0x1e3f72(0x81)]){const _0x528e9d=_0x4504bb[_0x1e3f72(0x81)],_0x45d3fb=await withSpinner(_0x1e3f72(0x8c)+_0x528e9d+_0x1e3f72(0x83),()=>_0x53a0e9[_0x1e3f72(0x8d)][_0x1e3f72(0x8a)](_0x218219,_0x528e9d),{'verbose':_0x4504bb['verbose']});_0x4d01e5=parseInt(_0x45d3fb[_0x1e3f72(0x87)],0xa),_0x4504bb[_0x1e3f72(0x84)]&&console[_0x1e3f72(0x7b)](_0x1e3f72(0x78)+_0x4d01e5);}const _0x2f7c2d=await loadJSONFromOptions(_0x4504bb[_0x1e3f72(0x80)],_0x4504bb[_0x1e3f72(0x72)]),_0x6c0288={'name':_0x4504bb['name'],'description':_0x4504bb[_0x1e3f72(0x8b)],'rule':_0x2f7c2d,'kind':_0x4504bb[_0x1e3f72(0x95)]!==undefined?parseInt(_0x4504bb[_0x1e3f72(0x95)],0xa):undefined,'segmentFolderId':_0x4d01e5},_0x3f7b51=await withSpinner(_0x1e3f72(0x7c)+_0x4a429a[_0x1e3f72(0x74)]+_0x1e3f72(0x83),()=>_0x53a0e9['segment'][_0x1e3f72(0x97)](_0x218219,_0x19d5de,_0x6c0288),{'verbose':_0x4504bb['verbose']}),_0x2407e7=_0x3f7b51[_0x1e3f72(0x87)];return console[_0x1e3f72(0x7b)](_0x1e3f72(0x6f)+_0x2407e7[_0x1e3f72(0x7e)]+'\x27'),_0x4fec8e!==_0x1dcc64&&console['error']('\x20\x20\x20Path:\x20'+_0x4fec8e),await handleSDKOutput([_0x2407e7],_0x4504bb),0x0;}}
@@ -1 +1 @@
1
- function a50_0x28be(_0x46a583,_0x5541e5){_0x46a583=_0x46a583-0x1d9;const _0x424fcf=a50_0x424f();let _0x28becb=_0x424fcf[_0x46a583];return _0x28becb;}function a50_0x424f(){const _0x1ff4fe=['parentId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','slice','Use:\x20tdx\x20segment\x20use\x20','error','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','349608rfojVQ','folderId','1205cygrmx','cyan','parentName','1532kKHLng','name','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','496888nqSQbc','18AikPiz','description','763968KFjrlu','Folder\x20ID:\x20','green','Site:\x20','Target\x20path:\x20','length','segmentPath','4xpmKat','join','segment','session','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','201612jkXTPr','segment:use','resolvePathToResource','folderPath','isDirectory','213554yWrozh','verbose','execute','\x27...','945140umqEKA','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','fullPath','log','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Usage:\x20tdx\x20segment\x20use\x20<path>','parent_segment','isAbsolute','type','Parent\x20ID:\x20','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','site','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','red','✔\x20Context\x20set\x20to:\x20','dim','config','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'];a50_0x424f=function(){return _0x1ff4fe;};return a50_0x424f();}const a50_0x2d07b8=a50_0x28be;(function(_0x4be880,_0x1bc9be){const _0xd7b01b=a50_0x28be,_0x4bcf01=_0x4be880();while(!![]){try{const _0x355b3e=-parseInt(_0xd7b01b(0x1e7))/0x1+-parseInt(_0xd7b01b(0x1dd))/0x2*(parseInt(_0xd7b01b(0x1e2))/0x3)+-parseInt(_0xd7b01b(0x20a))/0x4*(-parseInt(_0xd7b01b(0x207))/0x5)+parseInt(_0xd7b01b(0x210))/0x6+parseInt(_0xd7b01b(0x205))/0x7+-parseInt(_0xd7b01b(0x20d))/0x8*(-parseInt(_0xd7b01b(0x20e))/0x9)+parseInt(_0xd7b01b(0x1eb))/0xa;if(_0x355b3e===_0x1bc9be)break;else _0x4bcf01['push'](_0x4bcf01['shift']());}catch(_0x111072){_0x4bcf01['push'](_0x4bcf01['shift']());}}}(a50_0x424f,0x2243d));import{existsSync,statSync}from'fs';import a50_0x1f4af2 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a50_0x2d07b8(0x20b)]=a50_0x2d07b8(0x1e3);[a50_0x2d07b8(0x20f)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a50_0x2d07b8(0x1e9)](_0x398931){const _0x1c84b1=a50_0x2d07b8,{options:_0x1e5933,args:_0x96f8e2,tdx:_0x3498a3}=_0x398931;if(_0x96f8e2[_0x1c84b1(0x1db)]===0x0)return console['error'](a50_0x1f4af2[_0x1c84b1(0x1f9)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x1c84b1(0x202)](_0x1c84b1(0x1f1)),console[_0x1c84b1(0x202)]('Examples:'),console[_0x1c84b1(0x202)](_0x1c84b1(0x1f8)),console[_0x1c84b1(0x202)](_0x1c84b1(0x1f0)),console[_0x1c84b1(0x202)](_0x1c84b1(0x203)),console['error'](_0x1c84b1(0x1e1)),0x1;const _0x37c66c=_0x96f8e2[0x0],_0x27f4db=_0x1e5933[_0x1c84b1(0x1e0)];try{if(_0x37c66c==='/')return saveSessionContext({'segment_path':undefined},_0x27f4db),console[_0x1c84b1(0x1ee)](a50_0x1f4af2['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x37c66c)&&statSync(_0x37c66c)[_0x1c84b1(0x1e6)]()){let _0x269ec7;try{_0x269ec7=findTdxConfig(_0x37c66c);}catch{return console[_0x1c84b1(0x202)](a50_0x1f4af2['red'](_0x1c84b1(0x1ec)+_0x37c66c)),console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x208)](_0x1c84b1(0x1ff))),0x1;}const _0x1bd854=_0x269ec7[_0x1c84b1(0x1fc)][_0x1c84b1(0x1f2)];return saveSessionContext({'segment_path':_0x1bd854,'parent_segment':_0x1bd854},_0x27f4db),console['log'](a50_0x1f4af2[_0x1c84b1(0x212)](_0x1c84b1(0x1fa)+a50_0x1f4af2[_0x1c84b1(0x208)](_0x1bd854))),0x0;}const _0x442f5f=_0x1e5933[_0x1c84b1(0x1dc)];let _0x604ac9=_0x37c66c;const _0x4986a0=parsePath(_0x37c66c);if(!_0x4986a0[_0x1c84b1(0x1f3)]){if(!_0x442f5f)return console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x1f9)](_0x1c84b1(0x1ef))),console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x208)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x37c66c==='..'){const _0x1e0c77=_0x442f5f['split']('/')[_0x1c84b1(0x200)](0x0,-0x1)[_0x1c84b1(0x1de)]('/');_0x604ac9=_0x1e0c77||'/';}else _0x37c66c==='.'?_0x604ac9=_0x442f5f:_0x604ac9=_0x442f5f+'/'+_0x37c66c;_0x1e5933[_0x1c84b1(0x1e8)]&&console[_0x1c84b1(0x202)]('Resolved\x20relative\x20path\x20to:\x20'+_0x604ac9);}if(_0x604ac9==='/'||_0x604ac9==='')return saveSessionContext({'segment_path':undefined},_0x27f4db),console['log'](a50_0x1f4af2[_0x1c84b1(0x212)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x604ac9=normalizePath(_0x604ac9);const _0x25e6b7=parsePath(_0x604ac9)['segments'];if(_0x25e6b7[_0x1c84b1(0x1db)]===0x0)return saveSessionContext({'segment_path':undefined},_0x27f4db),console[_0x1c84b1(0x1ee)](a50_0x1f4af2[_0x1c84b1(0x212)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x1e5933['verbose']&&(console['error'](_0x1c84b1(0x1d9)+_0x1e5933[_0x1c84b1(0x1f7)]),console[_0x1c84b1(0x202)](_0x1c84b1(0x1da)+_0x604ac9));const _0x2d9f5e=await withSpinner('Resolving\x20path\x20\x27'+_0x604ac9+_0x1c84b1(0x1ea),()=>_0x3498a3[_0x1c84b1(0x1df)][_0x1c84b1(0x1e4)](_0x604ac9),{'verbose':_0x1e5933[_0x1c84b1(0x1e8)]}),_0x2ffb8f=_0x2d9f5e['data'];_0x1e5933['verbose']&&(console[_0x1c84b1(0x202)]('Resolved\x20path\x20type:\x20'+_0x2ffb8f[_0x1c84b1(0x1f4)]),console[_0x1c84b1(0x202)](_0x1c84b1(0x1f5)+_0x2ffb8f[_0x1c84b1(0x1fe)]),_0x2ffb8f[_0x1c84b1(0x206)]&&console[_0x1c84b1(0x202)](_0x1c84b1(0x211)+_0x2ffb8f['folderId']));if(_0x2ffb8f[_0x1c84b1(0x1f4)]===_0x1c84b1(0x1df))return console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x1f9)](_0x1c84b1(0x1f6))),console['error'](_0x1c84b1(0x1fd)),console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x208)](_0x1c84b1(0x201)+_0x2ffb8f[_0x1c84b1(0x209)]+(_0x2ffb8f['folderPath']?'/'+_0x2ffb8f[_0x1c84b1(0x1e5)][_0x1c84b1(0x1de)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2ffb8f[_0x1c84b1(0x1ed)],'parent_segment':_0x2ffb8f[_0x1c84b1(0x209)]},_0x27f4db),console[_0x1c84b1(0x1ee)](a50_0x1f4af2[_0x1c84b1(0x212)](_0x1c84b1(0x1fa)+a50_0x1f4af2['cyan'](_0x2ffb8f[_0x1c84b1(0x1ed)]))),_0x1e5933[_0x1c84b1(0x1e8)]&&(console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x1fb)](_0x1c84b1(0x20c))),console[_0x1c84b1(0x202)](a50_0x1f4af2[_0x1c84b1(0x1fb)](_0x1c84b1(0x204)))),0x0;}catch(_0x32b6eb){throw _0x32b6eb;}}}
1
+ const a56_0x5da207=a56_0x61f7;(function(_0x3fb80f,_0x51cb96){const _0x17fafe=a56_0x61f7,_0x20eece=_0x3fb80f();while(!![]){try{const _0x335537=parseInt(_0x17fafe(0x19d))/0x1+-parseInt(_0x17fafe(0x1a3))/0x2+-parseInt(_0x17fafe(0x185))/0x3*(parseInt(_0x17fafe(0x1a7))/0x4)+parseInt(_0x17fafe(0x17b))/0x5*(-parseInt(_0x17fafe(0x180))/0x6)+-parseInt(_0x17fafe(0x1ad))/0x7*(-parseInt(_0x17fafe(0x1b0))/0x8)+-parseInt(_0x17fafe(0x19e))/0x9*(-parseInt(_0x17fafe(0x17f))/0xa)+-parseInt(_0x17fafe(0x1a1))/0xb;if(_0x335537===_0x51cb96)break;else _0x20eece['push'](_0x20eece['shift']());}catch(_0x3df236){_0x20eece['push'](_0x20eece['shift']());}}}(a56_0x4b83,0xba51c));import{existsSync,statSync}from'fs';import a56_0x31cc40 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a56_0x4b83(){const _0x1f0590=['\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','folderId','data','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Examples:','split','slice','Use:\x20tdx\x20segment\x20use\x20','segment','parentName','\x27...','segmentPath','Folder\x20ID:\x20','segment:use','Usage:\x20tdx\x20segment\x20use\x20<path>','isDirectory','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','fullPath','1026596ZUUGJP','12710421LakmLo','Resolving\x20path\x20\x27','error','4264821xeIPiD','config','1651708FsOcWb','name','Resolved\x20path\x20type:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','3457068dhVRYO','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','type','cyan','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','14oKtgkK','verbose','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','3552304XopuKm','resolvePathToResource','site','length','description','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','execute','segments','log','dim','28585jSvCqG','Error:\x20Path\x20is\x20required\x0a','Site:\x20','session','10TrxCMf','510PaWKcT','isAbsolute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20Context\x20set\x20to:\x20','3rXPeqP','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','parentId','green','red','folderPath'];a56_0x4b83=function(){return _0x1f0590;};return a56_0x4b83();}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a56_0x61f7(_0x252656,_0x54626a){_0x252656=_0x252656-0x173;const _0x4b8310=a56_0x4b83();let _0x61f75f=_0x4b8310[_0x252656];return _0x61f75f;}export class SegmentUseCommand extends BaseCommand{[a56_0x5da207(0x1a4)]=a56_0x5da207(0x198);[a56_0x5da207(0x175)]=a56_0x5da207(0x182);async[a56_0x5da207(0x177)](_0x3845d7){const _0x567e8c=a56_0x5da207,{options:_0x5b7f7b,args:_0x5caf2d,tdx:_0x1e0253}=_0x3845d7;if(_0x5caf2d[_0x567e8c(0x174)]===0x0)return console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x189)](_0x567e8c(0x17c))),console[_0x567e8c(0x1a0)](_0x567e8c(0x199)),console[_0x567e8c(0x1a0)](_0x567e8c(0x18f)),console[_0x567e8c(0x1a0)](_0x567e8c(0x1ac)),console['error'](_0x567e8c(0x18b)),console[_0x567e8c(0x1a0)](_0x567e8c(0x1a6)),console['error'](_0x567e8c(0x176)),0x1;const _0x1d0456=_0x5caf2d[0x0],_0x50302c=_0x5b7f7b[_0x567e8c(0x17e)];try{if(_0x1d0456==='/')return saveSessionContext({'segment_path':undefined},_0x50302c),console[_0x567e8c(0x179)](a56_0x31cc40[_0x567e8c(0x188)](_0x567e8c(0x1ab))),0x0;if(existsSync(_0x1d0456)&&statSync(_0x1d0456)[_0x567e8c(0x19a)]()){let _0x48e5a4;try{_0x48e5a4=findTdxConfig(_0x1d0456);}catch{return console[_0x567e8c(0x1a0)](a56_0x31cc40['red'](_0x567e8c(0x1a8)+_0x1d0456)),console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x1aa)](_0x567e8c(0x183))),0x1;}const _0x4f9d1e=_0x48e5a4[_0x567e8c(0x1a2)]['parent_segment'];return saveSessionContext({'segment_path':_0x4f9d1e,'parent_segment':_0x4f9d1e},_0x50302c),console['log'](a56_0x31cc40[_0x567e8c(0x188)](_0x567e8c(0x184)+a56_0x31cc40[_0x567e8c(0x1aa)](_0x4f9d1e))),0x0;}const _0x4f0125=_0x5b7f7b[_0x567e8c(0x196)];let _0x2d3fc0=_0x1d0456;const _0x3ea6d3=parsePath(_0x1d0456);if(!_0x3ea6d3[_0x567e8c(0x181)]){if(!_0x4f0125)return console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x189)](_0x567e8c(0x186))),console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x1aa)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x1d0456==='..'){const _0x131cf0=_0x4f0125[_0x567e8c(0x190)]('/')[_0x567e8c(0x191)](0x0,-0x1)['join']('/');_0x2d3fc0=_0x131cf0||'/';}else _0x1d0456==='.'?_0x2d3fc0=_0x4f0125:_0x2d3fc0=_0x4f0125+'/'+_0x1d0456;_0x5b7f7b[_0x567e8c(0x1ae)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x2d3fc0);}if(_0x2d3fc0==='/'||_0x2d3fc0==='')return saveSessionContext({'segment_path':undefined},_0x50302c),console[_0x567e8c(0x179)](a56_0x31cc40[_0x567e8c(0x188)](_0x567e8c(0x1ab))),0x0;_0x2d3fc0=normalizePath(_0x2d3fc0);const _0x4468f0=parsePath(_0x2d3fc0)[_0x567e8c(0x178)];if(_0x4468f0['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x50302c),console['log'](a56_0x31cc40['green'](_0x567e8c(0x1ab))),0x0;_0x5b7f7b['verbose']&&(console[_0x567e8c(0x1a0)](_0x567e8c(0x17d)+_0x5b7f7b[_0x567e8c(0x173)]),console[_0x567e8c(0x1a0)]('Target\x20path:\x20'+_0x2d3fc0));const _0x1e2366=await withSpinner(_0x567e8c(0x19f)+_0x2d3fc0+_0x567e8c(0x195),()=>_0x1e0253[_0x567e8c(0x193)][_0x567e8c(0x1b1)](_0x2d3fc0),{'verbose':_0x5b7f7b[_0x567e8c(0x1ae)]}),_0x57ec4b=_0x1e2366[_0x567e8c(0x18d)];_0x5b7f7b[_0x567e8c(0x1ae)]&&(console['error'](_0x567e8c(0x1a5)+_0x57ec4b['type']),console[_0x567e8c(0x1a0)]('Parent\x20ID:\x20'+_0x57ec4b[_0x567e8c(0x187)]),_0x57ec4b[_0x567e8c(0x18c)]&&console['error'](_0x567e8c(0x197)+_0x57ec4b[_0x567e8c(0x18c)]));if(_0x57ec4b[_0x567e8c(0x1a9)]===_0x567e8c(0x193))return console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x189)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x567e8c(0x1a0)](_0x567e8c(0x1af)),console[_0x567e8c(0x1a0)](a56_0x31cc40[_0x567e8c(0x1aa)](_0x567e8c(0x192)+_0x57ec4b[_0x567e8c(0x194)]+(_0x57ec4b[_0x567e8c(0x18a)]?'/'+_0x57ec4b[_0x567e8c(0x18a)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x57ec4b[_0x567e8c(0x19c)],'parent_segment':_0x57ec4b['parentName']},_0x50302c),console[_0x567e8c(0x179)](a56_0x31cc40['green'](_0x567e8c(0x184)+a56_0x31cc40['cyan'](_0x57ec4b[_0x567e8c(0x19c)]))),_0x5b7f7b[_0x567e8c(0x1ae)]&&(console['error'](a56_0x31cc40[_0x567e8c(0x17a)](_0x567e8c(0x18e))),console[_0x567e8c(0x1a0)](a56_0x31cc40['dim'](_0x567e8c(0x19b)))),0x0;}catch(_0x4f92b8){throw _0x4f92b8;}}}
@@ -1 +1 @@
1
- const a51_0x4d5725=a51_0x4c27;(function(_0x3ead1f,_0x2c35f6){const _0x1dcec9=a51_0x4c27,_0x417767=_0x3ead1f();while(!![]){try{const _0x355236=parseInt(_0x1dcec9(0xe7))/0x1+parseInt(_0x1dcec9(0xf2))/0x2+-parseInt(_0x1dcec9(0xfc))/0x3+-parseInt(_0x1dcec9(0xf7))/0x4*(parseInt(_0x1dcec9(0xde))/0x5)+parseInt(_0x1dcec9(0xf5))/0x6*(parseInt(_0x1dcec9(0xcd))/0x7)+parseInt(_0x1dcec9(0xe3))/0x8*(parseInt(_0x1dcec9(0xea))/0x9)+-parseInt(_0x1dcec9(0xec))/0xa;if(_0x355236===_0x2c35f6)break;else _0x417767['push'](_0x417767['shift']());}catch(_0x4f9bf4){_0x417767['push'](_0x417767['shift']());}}}(a51_0x50cd,0x1a8b2));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a51_0x50cd(){const _0x2804c7=['no_parent','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','201078oFampw','\x20file(s)\x20with\x20errors,\x20','green','513LHQXbs','errors','4070490ddGKOV','targetDir','validCount','):\x20','\x20valid','red','375310RREbTf','valid','name','78iNDBSL','Validation\x20failed:\x20','268vozgNd','type','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','description','72564iNgpzT','dim','57631GrQGYJ','yellow','error','Validate\x20segment\x20and\x20journey\x20YAML\x20files','\x20file(s)\x20valid','Error:\x20Directory\x20not\x20found:\x20','segment:validate','invalidCount','\x20warning(s)\x20found','.yaml','cyan','\x20error(s)','helpText','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','verbose','warningCount','10990GqCzSX','endsWith','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','Error:\x20','hasErrors','26872VhBfZU','\x20warning(s)'];a51_0x50cd=function(){return _0x2804c7;};return a51_0x50cd();}import a51_0x3c8dc0 from'chalk';function a51_0x4c27(_0x5157a7,_0x3ac3a9){_0x5157a7=_0x5157a7-0xcd;const _0x50cd25=a51_0x50cd();let _0x4c27a4=_0x50cd25[_0x5157a7];return _0x4c27a4;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a51_0x4d5725(0xf4)]=a51_0x4d5725(0xd3);[a51_0x4d5725(0xfb)]=a51_0x4d5725(0xd0);async['execute'](_0x2210ac){const _0xf148e3=a51_0x4d5725,{options:_0x51ba70,args:_0x567d76}=_0x2210ac,_0x3fb8e8=_0x51ba70,_0x48774b=await resolveTarget({'arg':_0x567d76[0x0],'contextParent':_0x51ba70['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x48774b))return _0x48774b['errorCode']===_0xf148e3(0xe5)?(console[_0xf148e3(0xcf)](a51_0x3c8dc0[_0xf148e3(0xce)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0xf148e3(0xcf)](_0xf148e3(0xe0)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console['error'](_0xf148e3(0xfa))):(console['error'](a51_0x3c8dc0['red'](_0xf148e3(0xe1)+_0x48774b['message']+'\x0a')),_0x48774b[_0xf148e3(0xd9)]&&console[_0xf148e3(0xcf)](a51_0x3c8dc0[_0xf148e3(0xd7)](_0x48774b[_0xf148e3(0xd9)]))),0x1;const _0x38fbc0=_0x48774b[_0xf148e3(0xed)],_0x54bba5=_0x48774b[_0xf148e3(0xf8)]==='file'?_0x48774b['filePath']:undefined;if(!_0x54bba5&&!existsSync(_0x38fbc0))return console[_0xf148e3(0xcf)](a51_0x3c8dc0['red'](_0xf148e3(0xd2)+_0x38fbc0+'\x0a')),0x1;let _0x7761f9;if(_0x54bba5){if(!_0x54bba5[_0xf148e3(0xdf)]('.yml')&&!_0x54bba5[_0xf148e3(0xdf)](_0xf148e3(0xd6)))return console[_0xf148e3(0xcf)](a51_0x3c8dc0[_0xf148e3(0xf1)](_0xf148e3(0xe6)+_0x54bba5+'\x0a')),0x1;_0x7761f9=[_0x54bba5];}else _0x7761f9=findYamlFiles(_0x38fbc0);if(_0x7761f9[_0xf148e3(0xdb)]===0x0)return console['error'](a51_0x3c8dc0[_0xf148e3(0xf1)](_0xf148e3(0xda)+_0x38fbc0+'\x0a')),0x1;const _0x390fd3=validateYamlFiles(_0x7761f9,_0x38fbc0),_0x1f8ffd=calculateSummary(_0x390fd3);for(const _0x1f2cdb of _0x390fd3){if(!isValidationResult(_0x1f2cdb))continue;const {relativePath:_0x2a2db0,source:_0x33b740,result:_0x2c6916,fileType:_0x214f2f}=_0x1f2cdb,_0x508f37=_0x214f2f;if(_0x2c6916[_0xf148e3(0xf3)]&&_0x2c6916['warnings'][_0xf148e3(0xdb)]===0x0)_0x3fb8e8[_0xf148e3(0xdc)]&&console['log'](a51_0x3c8dc0[_0xf148e3(0xe9)]('✔\x20'+_0x2a2db0)+a51_0x3c8dc0[_0xf148e3(0xfd)]('\x20('+_0x508f37+')'));else _0x2c6916[_0xf148e3(0xf3)]?(console[_0xf148e3(0xf9)](a51_0x3c8dc0[_0xf148e3(0xce)]('⚠\x20'+_0x2a2db0)+a51_0x3c8dc0[_0xf148e3(0xfd)]('\x20('+_0x508f37+_0xf148e3(0xef)+_0x2c6916['warnings']['length']+_0xf148e3(0xe4))),console['log'](formatValidationResult(_0x2c6916,_0x33b740,_0x2a2db0))):(console[_0xf148e3(0xf9)](a51_0x3c8dc0[_0xf148e3(0xf1)]('✖\x20'+_0x2a2db0)+a51_0x3c8dc0[_0xf148e3(0xfd)]('\x20('+_0x508f37+_0xf148e3(0xef)+_0x2c6916[_0xf148e3(0xeb)]['length']+_0xf148e3(0xd8))),console['log'](formatValidationResult(_0x2c6916,_0x33b740,_0x2a2db0)));}return console[_0xf148e3(0xf9)](''),_0x1f8ffd[_0xf148e3(0xe2)]?(console[_0xf148e3(0xf9)](a51_0x3c8dc0[_0xf148e3(0xf1)](_0xf148e3(0xf6)+_0x1f8ffd[_0xf148e3(0xd4)]+_0xf148e3(0xe8)+_0x1f8ffd[_0xf148e3(0xee)]+_0xf148e3(0xf0))),_0x1f8ffd[_0xf148e3(0xdd)]>0x0&&console['log'](a51_0x3c8dc0[_0xf148e3(0xce)](_0x1f8ffd[_0xf148e3(0xdd)]+'\x20warning(s)\x20found')),0x1):(console['log'](a51_0x3c8dc0['green']('✔\x20All\x20'+_0x1f8ffd[_0xf148e3(0xee)]+_0xf148e3(0xd1))),_0x1f8ffd[_0xf148e3(0xdd)]>0x0&&console['log'](a51_0x3c8dc0[_0xf148e3(0xce)](_0x1f8ffd[_0xf148e3(0xdd)]+_0xf148e3(0xd5))),0x0);}}
1
+ const a57_0x54c468=a57_0x2506;(function(_0x62af1e,_0x2516ad){const _0x4a1fa6=a57_0x2506,_0x26d436=_0x62af1e();while(!![]){try{const _0x3f848c=-parseInt(_0x4a1fa6(0x1d7))/0x1+parseInt(_0x4a1fa6(0x1cf))/0x2+parseInt(_0x4a1fa6(0x1bb))/0x3+parseInt(_0x4a1fa6(0x1c5))/0x4+-parseInt(_0x4a1fa6(0x1b4))/0x5*(parseInt(_0x4a1fa6(0x1b5))/0x6)+-parseInt(_0x4a1fa6(0x1d9))/0x7*(parseInt(_0x4a1fa6(0x1b2))/0x8)+-parseInt(_0x4a1fa6(0x1d2))/0x9;if(_0x3f848c===_0x2516ad)break;else _0x26d436['push'](_0x26d436['shift']());}catch(_0xc0bb91){_0x26d436['push'](_0x26d436['shift']());}}}(a57_0x692f,0x20ea7));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a57_0x2506(_0x166fb4,_0x4ebf9d){_0x166fb4=_0x166fb4-0x1af;const _0x692f17=a57_0x692f();let _0x2506fb=_0x692f17[_0x166fb4];return _0x2506fb;}import{existsSync}from'fs';function a57_0x692f(){const _0x4bcbde=['dim','endsWith','\x20warning(s)\x20found','\x20file(s)\x20valid','✔\x20All\x20','valid','288602hJifow','invalidCount','log','954999ppCTsy','\x20file(s)\x20with\x20errors,\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','cwd','.yaml','112376puPcFa','red','7651vcwRZQ','type','length','Error:\x20','error','):\x20','description','136YRzngw','hasErrors','5JqYLvS','80436hZWFeQ','Validate\x20segment\x20and\x20journey\x20YAML\x20files','name','targetDir','execute','filePath','228378abPExn','verbose','\x20error(s)','validCount','\x20warning(s)','yellow','errors','no_parent','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','message','659480MXBckk','helpText','warningCount','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a57_0x692f=function(){return _0x4bcbde;};return a57_0x692f();}import a57_0x5f0f6c 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{[a57_0x54c468(0x1b7)]='segment:validate';[a57_0x54c468(0x1b1)]=a57_0x54c468(0x1b6);async[a57_0x54c468(0x1b9)](_0x22db99){const _0x27ff57=a57_0x54c468,{options:_0xc247df,args:_0x3e9db7}=_0x22db99,_0x412282=_0xc247df,_0x49af2b=await resolveTarget({'arg':_0x3e9db7[0x0],'contextParent':_0xc247df['parentSegment'],'cwd':process[_0x27ff57(0x1d5)]()});if(!isSuccessfulResolution(_0x49af2b))return _0x49af2b['errorCode']===_0x27ff57(0x1c2)?(console[_0x27ff57(0x1af)](a57_0x5f0f6c[_0x27ff57(0x1c0)](_0x27ff57(0x1c8))),console[_0x27ff57(0x1af)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x27ff57(0x1af)](_0x27ff57(0x1d4)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a57_0x5f0f6c[_0x27ff57(0x1d8)](_0x27ff57(0x1dc)+_0x49af2b[_0x27ff57(0x1c4)]+'\x0a')),_0x49af2b[_0x27ff57(0x1c6)]&&console[_0x27ff57(0x1af)](a57_0x5f0f6c['cyan'](_0x49af2b[_0x27ff57(0x1c6)]))),0x1;const _0x15fbee=_0x49af2b[_0x27ff57(0x1b8)],_0x1c2ccf=_0x49af2b[_0x27ff57(0x1da)]==='file'?_0x49af2b[_0x27ff57(0x1ba)]:undefined;if(!_0x1c2ccf&&!existsSync(_0x15fbee))return console[_0x27ff57(0x1af)](a57_0x5f0f6c[_0x27ff57(0x1d8)]('Error:\x20Directory\x20not\x20found:\x20'+_0x15fbee+'\x0a')),0x1;let _0x40a12e;if(_0x1c2ccf){if(!_0x1c2ccf[_0x27ff57(0x1ca)]('.yml')&&!_0x1c2ccf['endsWith'](_0x27ff57(0x1d6)))return console[_0x27ff57(0x1af)](a57_0x5f0f6c[_0x27ff57(0x1d8)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1c2ccf+'\x0a')),0x1;_0x40a12e=[_0x1c2ccf];}else _0x40a12e=findYamlFiles(_0x15fbee);if(_0x40a12e['length']===0x0)return console[_0x27ff57(0x1af)](a57_0x5f0f6c[_0x27ff57(0x1d8)](_0x27ff57(0x1c3)+_0x15fbee+'\x0a')),0x1;const _0x2a1972=validateYamlFiles(_0x40a12e,_0x15fbee),_0x25e5a8=calculateSummary(_0x2a1972);for(const _0x1630da of _0x2a1972){if(!isValidationResult(_0x1630da))continue;const {relativePath:_0x19141d,source:_0x403b68,result:_0x1cb2d6,fileType:_0x33b23c}=_0x1630da,_0x487082=_0x33b23c;if(_0x1cb2d6[_0x27ff57(0x1ce)]&&_0x1cb2d6['warnings'][_0x27ff57(0x1db)]===0x0)_0x412282[_0x27ff57(0x1bc)]&&console['log'](a57_0x5f0f6c['green']('✔\x20'+_0x19141d)+a57_0x5f0f6c[_0x27ff57(0x1c9)]('\x20('+_0x487082+')'));else _0x1cb2d6[_0x27ff57(0x1ce)]?(console['log'](a57_0x5f0f6c[_0x27ff57(0x1c0)]('⚠\x20'+_0x19141d)+a57_0x5f0f6c[_0x27ff57(0x1c9)]('\x20('+_0x487082+_0x27ff57(0x1b0)+_0x1cb2d6['warnings'][_0x27ff57(0x1db)]+_0x27ff57(0x1bf))),console['log'](formatValidationResult(_0x1cb2d6,_0x403b68,_0x19141d))):(console[_0x27ff57(0x1d1)](a57_0x5f0f6c['red']('✖\x20'+_0x19141d)+a57_0x5f0f6c[_0x27ff57(0x1c9)]('\x20('+_0x487082+'):\x20'+_0x1cb2d6[_0x27ff57(0x1c1)][_0x27ff57(0x1db)]+_0x27ff57(0x1bd))),console[_0x27ff57(0x1d1)](formatValidationResult(_0x1cb2d6,_0x403b68,_0x19141d)));}return console[_0x27ff57(0x1d1)](''),_0x25e5a8[_0x27ff57(0x1b3)]?(console[_0x27ff57(0x1d1)](a57_0x5f0f6c[_0x27ff57(0x1d8)]('Validation\x20failed:\x20'+_0x25e5a8[_0x27ff57(0x1d0)]+_0x27ff57(0x1d3)+_0x25e5a8[_0x27ff57(0x1be)]+'\x20valid')),_0x25e5a8[_0x27ff57(0x1c7)]>0x0&&console[_0x27ff57(0x1d1)](a57_0x5f0f6c[_0x27ff57(0x1c0)](_0x25e5a8[_0x27ff57(0x1c7)]+_0x27ff57(0x1cb))),0x1):(console[_0x27ff57(0x1d1)](a57_0x5f0f6c['green'](_0x27ff57(0x1cd)+_0x25e5a8[_0x27ff57(0x1be)]+_0x27ff57(0x1cc))),_0x25e5a8[_0x27ff57(0x1c7)]>0x0&&console[_0x27ff57(0x1d1)](a57_0x5f0f6c[_0x27ff57(0x1c0)](_0x25e5a8[_0x27ff57(0x1c7)]+'\x20warning(s)\x20found')),0x0);}}
@@ -1 +1 @@
1
- function a52_0x584a(_0x176968,_0x8beb8d){_0x176968=_0x176968-0x1b5;const _0x21a63e=a52_0x21a6();let _0x584a9b=_0x21a63e[_0x176968];return _0x584a9b;}const a52_0x4d558d=a52_0x584a;(function(_0x891351,_0x1603ef){const _0x5413a6=a52_0x584a,_0x5501d6=_0x891351();while(!![]){try{const _0x1d63ca=parseInt(_0x5413a6(0x1ce))/0x1+-parseInt(_0x5413a6(0x1ea))/0x2+-parseInt(_0x5413a6(0x1bd))/0x3*(parseInt(_0x5413a6(0x1fb))/0x4)+-parseInt(_0x5413a6(0x1e3))/0x5+parseInt(_0x5413a6(0x1d5))/0x6*(parseInt(_0x5413a6(0x1fa))/0x7)+parseInt(_0x5413a6(0x1c0))/0x8+parseInt(_0x5413a6(0x203))/0x9;if(_0x1d63ca===_0x1603ef)break;else _0x5501d6['push'](_0x5501d6['shift']());}catch(_0x20039b){_0x5501d6['push'](_0x5501d6['shift']());}}}(a52_0x21a6,0x7338b));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{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a52_0x3f0ca0 from'chalk';export class SegmentsCommand extends BaseCommand{[a52_0x4d558d(0x1c3)]=a52_0x4d558d(0x1d8);[a52_0x4d558d(0x1b7)]='List\x20folders\x20and\x20child\x20segments';async[a52_0x4d558d(0x1e0)](_0xfe132f){const _0xe82d97=a52_0x4d558d,{options:_0x50e56c,args:_0x462017}=_0xfe132f,_0x1cadeb=_0x50e56c[_0xe82d97(0x1b9)],_0x39a78a=_0x462017[0x0];try{const _0x54c646=_0x50e56c[_0xe82d97(0x1c4)];_0x50e56c[_0xe82d97(0x1b8)]&&(console['error'](_0xe82d97(0x1da)+_0x50e56c['site']),console[_0xe82d97(0x1f5)](_0xe82d97(0x1de)+(_0x54c646||_0xe82d97(0x1f6))),_0x39a78a&&console[_0xe82d97(0x1f5)]('Folder/pattern\x20arg:\x20'+_0x39a78a),_0x1cadeb&&console[_0xe82d97(0x1f5)](_0xe82d97(0x1d4)));if(!_0x54c646)return console[_0xe82d97(0x1f5)](_0xe82d97(0x1e8)),console['error'](''),console[_0xe82d97(0x1f5)](_0xe82d97(0x1d3)),console['error'](_0xe82d97(0x1be)),console[_0xe82d97(0x1f5)](_0xe82d97(0x1f3)),console[_0xe82d97(0x1f5)](''),console[_0xe82d97(0x1f5)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;if(_0x39a78a&&_0x1cadeb)return await this['searchByName'](_0xfe132f,_0x54c646,_0x39a78a);const _0x4fcdf9=_0x39a78a&&(_0x39a78a[_0xe82d97(0x20c)]('*')||_0x39a78a[_0xe82d97(0x20c)]('?'));if(_0x4fcdf9)return await this[_0xe82d97(0x1cd)](_0xfe132f,_0x54c646,_0x39a78a);const _0x5a6662=_0x39a78a?_0x54c646+'/'+_0x39a78a:_0x54c646;return _0x1cadeb?await this[_0xe82d97(0x1c2)](_0xfe132f,_0x5a6662):await this['listUnified'](_0xfe132f,_0x5a6662);}catch(_0x2a95c7){if(_0x2a95c7 instanceof SDKError)return console['error'](_0xe82d97(0x1d6)+_0x2a95c7[_0xe82d97(0x1b6)]),_0x2a95c7[_0xe82d97(0x1ec)]&&console[_0xe82d97(0x1f5)](_0xe82d97(0x200)+_0x2a95c7[_0xe82d97(0x1ec)]),0x1;throw _0x2a95c7;}}async[a52_0x4d558d(0x1d2)](_0x2c9852,_0x562679,_0x23db2d){const _0x577c9b=a52_0x4d558d,{options:_0x57f85c,tdx:_0x3dce4a}=_0x2c9852,_0x54922a='\x22'+_0x23db2d+'\x22',_0x3d7ce6=await withSpinner(_0x577c9b(0x1d9)+_0x562679+_0x577c9b(0x1bb),()=>_0x3dce4a[_0x577c9b(0x1f2)][_0x577c9b(0x1e6)](_0x562679),{'verbose':_0x57f85c['verbose']}),_0x28156b=_0x3d7ce6['data'],_0x36ac9b=_0x57f85c[_0x577c9b(0x1e5)]||0xa,_0x11bade=await withSpinner(_0x577c9b(0x1cc)+_0x54922a+_0x577c9b(0x1c6),()=>_0x3dce4a[_0x577c9b(0x1f2)][_0x577c9b(0x1c2)](_0x28156b[_0x577c9b(0x1f1)],_0x28156b[_0x577c9b(0x1e1)],0x0,_0x36ac9b),{'verbose':_0x57f85c['verbose']}),_0x4016d0=searchTreeByName(_0x11bade[_0x577c9b(0x1ff)],_0x23db2d),_0x53c6aa=_0x4bb9ef=>getConsoleNextUrl(_0x57f85c['site'],_0x577c9b(0x1f9)+_0x28156b['parentId']+_0x577c9b(0x206)+_0x4bb9ef),_0x282c57=[..._0x4016d0][_0x577c9b(0x20a)]((_0x3533a5,_0x74204f)=>_0x3533a5[_0x577c9b(0x1d0)][_0x577c9b(0x1c7)](_0x74204f[_0x577c9b(0x1d0)])),_0xf760e8=0x32,_0x51f7f5=_0x577c9b(0x1cb)+_0x4016d0['length']+_0x577c9b(0x1e9)+(_0x4016d0[_0x577c9b(0x209)]!==0x1?'es':'');console[_0x577c9b(0x1f5)](_0x4016d0[_0x577c9b(0x209)]>_0xf760e8?'✔\x20'+_0x51f7f5+_0x577c9b(0x1d7):'✔\x20'+_0x51f7f5);if(_0x57f85c[_0x577c9b(0x20d)]===_0x577c9b(0x1f4)||_0x57f85c[_0x577c9b(0x20d)]===_0x577c9b(0x1fc)){const _0x923f33=_0x282c57[_0x577c9b(0x202)](_0x475567=>({..._0x475567,..._0x475567[_0x577c9b(0x1c1)]===_0x577c9b(0x1f2)?{'url':_0x53c6aa(_0x475567['id'])}:{}}));return await handleSDKOutput(_0x923f33,_0x57f85c),0x0;}if(_0x4016d0['length']===0x0)return console[_0x577c9b(0x1e7)](_0x577c9b(0x1c9)+_0x54922a),0x0;for(const _0x342a03 of _0x282c57){console['log'](_0x342a03[_0x577c9b(0x1c1)][_0x577c9b(0x1dd)](0x8)+'\x20'+_0x342a03[_0x577c9b(0x1d0)]+'\x20\x20'+a52_0x3f0ca0['dim'](_0x577c9b(0x1eb)+_0x342a03['id']+')'));}const _0x151a0a=_0x4016d0[_0x577c9b(0x208)](_0x49db5b=>_0x49db5b[_0x577c9b(0x1c1)]===_0x577c9b(0x1f2)),_0x241fad=new Set(_0x151a0a[_0x577c9b(0x202)](_0x43b11c=>_0x43b11c['name'][_0x577c9b(0x20b)]()))[_0x577c9b(0x1e4)]===0x1;return _0x151a0a[_0x577c9b(0x209)]>0x1&&_0x241fad&&console[_0x577c9b(0x1e7)](a52_0x3f0ca0[_0x577c9b(0x1db)]('\x0a'+_0x151a0a['length']+'\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.')),0x0;}async['listWithPattern'](_0x1cd9a8,_0x390af1,_0x35f9fe){const _0x11cd8f=a52_0x4d558d,{options:_0x5815cb,tdx:_0x1b4398}=_0x1cd9a8,_0x3c0ba0=await withSpinner(_0x11cd8f(0x1f0)+_0x390af1+_0x11cd8f(0x1bb),()=>_0x1b4398['segment'][_0x11cd8f(0x1e6)](_0x390af1),{'verbose':_0x5815cb['verbose']}),_0xf4ac81=_0x3c0ba0[_0x11cd8f(0x1ff)],_0x285465=await withSpinner(_0x11cd8f(0x205),()=>_0x1b4398['segment']['listUnifiedWithJourneys'](_0xf4ac81[_0x11cd8f(0x1f1)],_0xf4ac81[_0x11cd8f(0x1e1)]),{'verbose':_0x5815cb[_0x11cd8f(0x1b8)]}),{folders:_0x5b6a17,segments:_0x31c319,journeys:_0xc12c61}=_0x285465[_0x11cd8f(0x1ff)],_0x422ab6=_0x35f9fe['replace'](/[.+^${}()|[\]\\]/g,_0x11cd8f(0x1bf))[_0x11cd8f(0x1f8)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x673797=new RegExp('^'+_0x422ab6+'$','i'),_0x53ae15=_0x5b6a17[_0x11cd8f(0x208)](_0x4bbbaa=>_0x673797[_0x11cd8f(0x1dc)](_0x4bbbaa[_0x11cd8f(0x1c3)])),_0x340c61=_0x31c319[_0x11cd8f(0x208)](_0x11b32b=>_0x673797[_0x11cd8f(0x1dc)](_0x11b32b[_0x11cd8f(0x1c3)])),_0xcb7454=_0xc12c61[_0x11cd8f(0x208)](_0x4390ef=>_0x673797[_0x11cd8f(0x1dc)](_0x4390ef[_0x11cd8f(0x1ef)])),_0x5f2cff=_0x53ae15['length']+_0x340c61[_0x11cd8f(0x209)]+_0xcb7454[_0x11cd8f(0x209)];console[_0x11cd8f(0x1f5)](_0x11cd8f(0x201)+_0x53ae15['length']+_0x11cd8f(0x1ca)+(_0x53ae15['length']!==0x1?'s':'')+',\x20'+_0x340c61[_0x11cd8f(0x209)]+_0x11cd8f(0x1b5)+(_0x340c61['length']!==0x1?'s':'')+_0x11cd8f(0x204)+_0xcb7454[_0x11cd8f(0x209)]+'\x20journey'+(_0xcb7454['length']!==0x1?'s':'')+_0x11cd8f(0x1ed)+_0x35f9fe+'\x27');const _0xa2b53d=_0x3fd957=>{const _0x308aee=_0x11cd8f;return getConsoleNextUrl(_0x5815cb['site'],_0x308aee(0x1f9)+_0xf4ac81[_0x308aee(0x1f1)]+'/e/'+_0x3fd957);},_0x5d96ad=_0x5815cb[_0x11cd8f(0x20d)]===_0x11cd8f(0x1f4)||_0x5815cb[_0x11cd8f(0x20d)]===_0x11cd8f(0x1fc);if(_0x5d96ad){const _0xfb5d5b=[..._0x53ae15[_0x11cd8f(0x202)](_0x1cb5d8=>({..._0x1cb5d8,'type':_0x11cd8f(0x20e)})),..._0x340c61['map'](_0x38e9cf=>({..._0x38e9cf,'type':_0x11cd8f(0x1f2),'url':_0xa2b53d(_0x38e9cf['id'])})),..._0xcb7454[_0x11cd8f(0x202)](_0x153fd4=>({..._0x153fd4,'name':_0x153fd4[_0x11cd8f(0x1ef)],'type':_0x11cd8f(0x1bc)}))][_0x11cd8f(0x20a)]((_0x149a58,_0x393a52)=>_0x149a58[_0x11cd8f(0x1c3)][_0x11cd8f(0x1c7)](_0x393a52[_0x11cd8f(0x1c3)]));await handleSDKOutput(_0xfb5d5b,_0x5815cb);}else{if(_0x5f2cff===0x0)console[_0x11cd8f(0x1e7)]('No\x20items\x20match\x20pattern:\x20'+_0x35f9fe);else{console[_0x11cd8f(0x1e7)](a52_0x3f0ca0['dim']('['+_0x390af1+_0x11cd8f(0x1df)+_0x35f9fe+'\x27'));const _0x56bad9=formatFlatList(_0x53ae15,_0x340c61,{'showMetadata':!![],'getSegmentUrl':_0xa2b53d},_0xcb7454);console[_0x11cd8f(0x1e7)](_0x56bad9);}}return 0x0;}async['listUnified'](_0x45bf98,_0x1cc3ab){const _0x30d6fc=a52_0x4d558d,{options:_0x3923cf,tdx:_0xf12caf}=_0x45bf98,_0x3c68b2=await withSpinner(_0x30d6fc(0x1d9)+_0x1cc3ab+'\x27...',()=>_0xf12caf[_0x30d6fc(0x1f2)][_0x30d6fc(0x1e6)](_0x1cc3ab),{'verbose':_0x3923cf[_0x30d6fc(0x1b8)]}),_0x5d4045=_0x3c68b2['data'];_0x3923cf[_0x30d6fc(0x1b8)]&&(console[_0x30d6fc(0x1f5)](_0x30d6fc(0x1f7)+_0x5d4045[_0x30d6fc(0x1f1)]),_0x5d4045[_0x30d6fc(0x1e1)]&&console[_0x30d6fc(0x1f5)](_0x30d6fc(0x1fd)+_0x5d4045[_0x30d6fc(0x1e1)]));const _0x22240a=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0xf12caf[_0x30d6fc(0x1f2)][_0x30d6fc(0x1fe)](_0x5d4045['parentId'],_0x5d4045[_0x30d6fc(0x1e1)]),{'verbose':_0x3923cf[_0x30d6fc(0x1b8)]}),{folders:_0x5089b6,segments:_0x217067,journeys:_0x1eda24}=_0x22240a['data'],_0x5bee65=_0x5089b6['length']+_0x217067[_0x30d6fc(0x209)]+_0x1eda24[_0x30d6fc(0x209)];console[_0x30d6fc(0x1f5)](_0x30d6fc(0x201)+_0x5089b6[_0x30d6fc(0x209)]+_0x30d6fc(0x1ca)+(_0x5089b6[_0x30d6fc(0x209)]!==0x1?'s':'')+',\x20'+_0x217067[_0x30d6fc(0x209)]+_0x30d6fc(0x1b5)+(_0x217067[_0x30d6fc(0x209)]!==0x1?'s':'')+_0x30d6fc(0x204)+_0x1eda24['length']+_0x30d6fc(0x1c8)+(_0x1eda24[_0x30d6fc(0x209)]!==0x1?'s':''));const _0x297ab6=_0x412c18=>{const _0x4fd5ca=_0x30d6fc;return getConsoleNextUrl(_0x3923cf[_0x4fd5ca(0x1c5)],_0x4fd5ca(0x1f9)+_0x5d4045[_0x4fd5ca(0x1f1)]+_0x4fd5ca(0x206)+_0x412c18);},_0x43f208=_0x1805df=>{const _0x412e47=_0x30d6fc;return getConsoleNextUrl(_0x3923cf[_0x412e47(0x1c5)],_0x412e47(0x1f9)+_0x5d4045[_0x412e47(0x1f1)]+_0x412e47(0x206)+_0x1805df+_0x412e47(0x1d1));},_0x298436=_0x3923cf['format']===_0x30d6fc(0x1f4)||_0x3923cf['format']===_0x30d6fc(0x1fc);if(_0x298436){const _0x4403f1=[..._0x5089b6[_0x30d6fc(0x202)](_0x3e139b=>({..._0x3e139b,'type':_0x30d6fc(0x20e)})),..._0x217067['map'](_0x3b87af=>({..._0x3b87af,'type':'segment','url':_0x297ab6(_0x3b87af['id'])})),..._0x1eda24[_0x30d6fc(0x202)](_0x2cb38d=>({..._0x2cb38d,'name':_0x2cb38d[_0x30d6fc(0x1ef)],'type':_0x30d6fc(0x1bc),'url':_0x43f208(_0x2cb38d['id'])}))]['sort']((_0xf543e2,_0x43d653)=>_0xf543e2[_0x30d6fc(0x1c3)][_0x30d6fc(0x1c7)](_0x43d653['name']));await handleSDKOutput(_0x4403f1,_0x3923cf);}else{if(_0x5bee65===0x0)console[_0x30d6fc(0x1e7)](a52_0x3f0ca0[_0x30d6fc(0x1db)]('['+_0x1cc3ab+']')),console[_0x30d6fc(0x1e7)](_0x30d6fc(0x1ba));else{console['log'](a52_0x3f0ca0[_0x30d6fc(0x1db)]('['+_0x1cc3ab+']'));const _0x3daa45=formatFlatList(_0x5089b6,_0x217067,{'showMetadata':!![],'getSegmentUrl':_0x297ab6,'getJourneyUrl':_0x43f208},_0x1eda24);console[_0x30d6fc(0x1e7)](_0x3daa45);}}return 0x0;}async[a52_0x4d558d(0x1c2)](_0x2b3ca6,_0x40ff39){const _0x32988b=a52_0x4d558d,{options:_0x237598,tdx:_0x10423e}=_0x2b3ca6,_0x27c131=await withSpinner(_0x32988b(0x1d9)+_0x40ff39+_0x32988b(0x1bb),()=>_0x10423e['segment'][_0x32988b(0x1e6)](_0x40ff39),{'verbose':_0x237598[_0x32988b(0x1b8)]}),_0x388989=_0x27c131['data'];_0x237598['verbose']&&(console[_0x32988b(0x1f5)](_0x32988b(0x1f7)+_0x388989[_0x32988b(0x1f1)]),_0x388989[_0x32988b(0x1e1)]&&console[_0x32988b(0x1f5)](_0x32988b(0x1fd)+_0x388989['folderId']));const _0x5755b0=_0x237598[_0x32988b(0x1e5)]||0xa,_0x43426a=await withSpinner(_0x32988b(0x1ee),()=>_0x10423e[_0x32988b(0x1f2)][_0x32988b(0x1c2)](_0x388989[_0x32988b(0x1f1)],_0x388989[_0x32988b(0x1e1)],0x0,_0x5755b0),{'verbose':_0x237598[_0x32988b(0x1b8)]}),_0x620045=_0x43426a[_0x32988b(0x1ff)],_0x223b46=_0x36c091=>{const _0xd855f4=_0x32988b;let _0x3ae58f=0x0,_0x1d15dc=0x0,_0x485098=0x0;for(const _0x55c01b of _0x36c091){if(_0x55c01b[_0xd855f4(0x1c1)]===_0xd855f4(0x20e))_0x3ae58f++;else{if(_0x55c01b[_0xd855f4(0x1c1)]===_0xd855f4(0x1f2))_0x1d15dc++;else{if(_0x55c01b[_0xd855f4(0x1c1)]==='journey')_0x485098++;}}if(_0x55c01b[_0xd855f4(0x1e2)]){const _0x1e35ed=_0x223b46(_0x55c01b[_0xd855f4(0x1e2)]);_0x3ae58f+=_0x1e35ed[_0xd855f4(0x207)],_0x1d15dc+=_0x1e35ed[_0xd855f4(0x1d8)],_0x485098+=_0x1e35ed[_0xd855f4(0x1cf)];}}return{'folders':_0x3ae58f,'segments':_0x1d15dc,'journeys':_0x485098};},_0x35dd22=_0x223b46(_0x620045);console['error']('✔\x20Built\x20tree\x20with\x20'+_0x35dd22['folders']+_0x32988b(0x1ca)+(_0x35dd22[_0x32988b(0x207)]!==0x1?'s':'')+',\x20'+_0x35dd22[_0x32988b(0x1d8)]+'\x20segment'+(_0x35dd22[_0x32988b(0x1d8)]!==0x1?'s':'')+_0x32988b(0x204)+_0x35dd22['journeys']+_0x32988b(0x1c8)+(_0x35dd22['journeys']!==0x1?'s':''));const _0x3fc2a7=_0x2fae23=>{const _0x17efd8=_0x32988b;return getConsoleNextUrl(_0x237598['site'],_0x17efd8(0x1f9)+_0x388989['parentId']+_0x17efd8(0x206)+_0x2fae23);},_0xf4866e=_0x3c3ffa=>{const _0x7a2f95=_0x32988b;return getConsoleNextUrl(_0x237598[_0x7a2f95(0x1c5)],_0x7a2f95(0x1f9)+_0x388989[_0x7a2f95(0x1f1)]+'/e/'+_0x3c3ffa+_0x7a2f95(0x1d1));};if(_0x237598[_0x32988b(0x20d)]==='json'||_0x237598[_0x32988b(0x20d)]===_0x32988b(0x1fc))await handleSDKOutput(_0x620045,_0x237598);else{console[_0x32988b(0x1e7)](a52_0x3f0ca0[_0x32988b(0x1db)]('['+_0x40ff39+']'));const _0x2d0556=formatTree(_0x620045,{'showMetadata':!![],'getSegmentUrl':_0x3fc2a7,'getJourneyUrl':_0xf4866e});console[_0x32988b(0x1e7)](_0x2d0556);}return 0x0;}}function a52_0x21a6(){const _0x38f041=['Found\x20','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','listWithPattern','906145oEBVxA','journeys','path','/j/da','searchByName','Set\x20a\x20parent\x20segment\x20context\x20first:','Recursive\x20mode:\x20enabled','2756604tBAYeu','Error:\x20','\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.','segments','Resolving\x20path\x20\x27','Site:\x20','dim','test','padEnd','Parent\x20segment\x20context:\x20',']\x20matching\x20\x27','execute','folderId','children','434595coUdSI','size','maxDepth','resolvePathToResource','log','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x20match','1857036VdAAZH','(id\x20','cause','\x20matching\x20\x27','Building\x20hierarchy\x20tree...','journeyBundleName','Resolving\x20parent\x20segment\x20\x27','parentId','segment','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','json','error','(not\x20set)','Parent\x20ID:\x20','replace','/app/ps/','7OcFipc','3577156rMDOIf','jsonl','Folder\x20ID:\x20','listUnifiedWithJourneys','data','\x20\x20Cause:\x20','✔\x20Found\x20','map','2242116AHUDOn',',\x20and\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','/e/','folders','filter','length','sort','toLowerCase','includes','format','folder','\x20segment','message','description','verbose','recursive','(empty)','\x27...','journey','3FIUUMI','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x5c$&','6135760tCBaiG','type','listRecursive','name','parentSegment','site','...','localeCompare','\x20journey','No\x20folders\x20or\x20segments\x20match\x20','\x20folder'];a52_0x21a6=function(){return _0x38f041;};return a52_0x21a6();}
1
+ const a58_0x1582a6=a58_0x1682;(function(_0x5337d5,_0x102525){const _0x26ea23=a58_0x1682,_0xa00ec4=_0x5337d5();while(!![]){try{const _0x6fc65e=-parseInt(_0x26ea23(0xca))/0x1+parseInt(_0x26ea23(0xfc))/0x2*(-parseInt(_0x26ea23(0xee))/0x3)+parseInt(_0x26ea23(0xc2))/0x4*(parseInt(_0x26ea23(0xda))/0x5)+-parseInt(_0x26ea23(0xd8))/0x6*(-parseInt(_0x26ea23(0xcb))/0x7)+-parseInt(_0x26ea23(0xe1))/0x8*(-parseInt(_0x26ea23(0xf7))/0x9)+parseInt(_0x26ea23(0x116))/0xa+parseInt(_0x26ea23(0xf5))/0xb*(parseInt(_0x26ea23(0x10c))/0xc);if(_0x6fc65e===_0x102525)break;else _0xa00ec4['push'](_0xa00ec4['shift']());}catch(_0x525e90){_0xa00ec4['push'](_0xa00ec4['shift']());}}}(a58_0x1248,0x75c8d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a58_0x1248(){const _0x5e8bbd=['name','listRecursive','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','listWithPattern','padEnd','Parent\x20segment\x20context:\x20','1226230uTmsuI','toLowerCase','/app/ps/','journey','/e/','error','maxDepth','Resolving\x20path\x20\x27','4eKoMpc','Error:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','✔\x20Built\x20tree\x20with\x20','format','map','path','\x27...','546851MusYpi','7rdCacX','parentId','Site:\x20','length','verbose','Parent\x20ID:\x20','parentSegment','dim','searchByName','Resolving\x20parent\x20segment\x20\x27',']\x20matching\x20\x27','description','\x20match','565350FyOwAm','Recursive\x20mode:\x20enabled','3515905XyhjBT','Listing\x20folders,\x20segments,\x20and\x20journeys...','Folder/pattern\x20arg:\x20','data','localeCompare','folder','sort','904yxFSYd','folders','(id\x20','filter','segment','No\x20folders\x20or\x20segments\x20match\x20','message','\x20journey','journeyBundleName','(empty)','type','Building\x20hierarchy\x20tree...','\x20segments\x20share\x20this\x20name\x20—\x20pass\x20the\x20full\x20path\x20(or\x20id)\x20to\x20`tdx\x20sg\x20move`;\x20do\x20not\x20assume\x20the\x20first.','1419LqMBMI','Set\x20a\x20parent\x20segment\x20context\x20first:','List\x20folders\x20and\x20child\x20segments','listUnifiedWithJourneys','journeys','resolvePathToResource','Folder\x20ID:\x20','54846oWEwoU','\x20\x20Cause:\x20','53127GEtLsS','✔\x20Found\x20','\x20segment','Error:\x20No\x20parent\x20segment\x20context\x20set.','/j/da','3012jxKKcH','...','\x20folder',',\x20and\x20','test','children','log','jsonl','folderId','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','recursive','No\x20items\x20match\x20pattern:\x20','site','segments','\x20matching\x20\x27','json','372esLqRr','listUnified','Searching\x20the\x20tree\x20for\x20names\x20matching\x20','Found\x20'];a58_0x1248=function(){return _0x5e8bbd;};return a58_0x1248();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a58_0x1682(_0x2d0036,_0x163298){_0x2d0036=_0x2d0036-0xbf;const _0x12480a=a58_0x1248();let _0x168287=_0x12480a[_0x2d0036];return _0x168287;}import a58_0x568502 from'chalk';export class SegmentsCommand extends BaseCommand{[a58_0x1582a6(0x110)]=a58_0x1582a6(0x109);[a58_0x1582a6(0xd6)]=a58_0x1582a6(0xf0);async['execute'](_0x4a7647){const _0x5b8b2d=a58_0x1582a6,{options:_0x5ee588,args:_0x5222be}=_0x4a7647,_0x26d581=_0x5ee588[_0x5b8b2d(0x106)],_0x360a6c=_0x5222be[0x0];try{const _0x41e737=_0x5ee588[_0x5b8b2d(0xd1)];_0x5ee588[_0x5b8b2d(0xcf)]&&(console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xcd)+_0x5ee588[_0x5b8b2d(0x108)]),console[_0x5b8b2d(0xbf)](_0x5b8b2d(0x115)+(_0x41e737||'(not\x20set)')),_0x360a6c&&console['error'](_0x5b8b2d(0xdc)+_0x360a6c),_0x26d581&&console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xd9)));if(!_0x41e737)return console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xfa)),console['error'](''),console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xef)),console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xc4)),console['error'](_0x5b8b2d(0x105)),console[_0x5b8b2d(0xbf)](''),console['error'](_0x5b8b2d(0x112)),0x1;if(_0x360a6c&&_0x26d581)return await this[_0x5b8b2d(0xd3)](_0x4a7647,_0x41e737,_0x360a6c);const _0x3be4cf=_0x360a6c&&(_0x360a6c['includes']('*')||_0x360a6c['includes']('?'));if(_0x3be4cf)return await this[_0x5b8b2d(0x113)](_0x4a7647,_0x41e737,_0x360a6c);const _0x587009=_0x360a6c?_0x41e737+'/'+_0x360a6c:_0x41e737;return _0x26d581?await this[_0x5b8b2d(0x111)](_0x4a7647,_0x587009):await this[_0x5b8b2d(0x10d)](_0x4a7647,_0x587009);}catch(_0x596dea){if(_0x596dea instanceof SDKError)return console['error'](_0x5b8b2d(0xc3)+_0x596dea[_0x5b8b2d(0xe7)]),_0x596dea['cause']&&console[_0x5b8b2d(0xbf)](_0x5b8b2d(0xf6)+_0x596dea['cause']),0x1;throw _0x596dea;}}async[a58_0x1582a6(0xd3)](_0x1ebd23,_0x31e893,_0x37e303){const _0xf8c8c4=a58_0x1582a6,{options:_0x36e804,tdx:_0x5584e9}=_0x1ebd23,_0x5dfa4f='\x22'+_0x37e303+'\x22',_0x169830=await withSpinner(_0xf8c8c4(0xc1)+_0x31e893+_0xf8c8c4(0xc9),()=>_0x5584e9[_0xf8c8c4(0xe5)]['resolvePathToResource'](_0x31e893),{'verbose':_0x36e804[_0xf8c8c4(0xcf)]}),_0x5aca56=_0x169830[_0xf8c8c4(0xdd)],_0x587a06=_0x36e804['maxDepth']||0xa,_0xa03f53=await withSpinner(_0xf8c8c4(0x10e)+_0x5dfa4f+_0xf8c8c4(0xfd),()=>_0x5584e9['segment']['listRecursive'](_0x5aca56[_0xf8c8c4(0xcc)],_0x5aca56[_0xf8c8c4(0x104)],0x0,_0x587a06),{'verbose':_0x36e804[_0xf8c8c4(0xcf)]}),_0x2a836a=searchTreeByName(_0xa03f53[_0xf8c8c4(0xdd)],_0x37e303),_0x1f541c=_0x6d1274=>getConsoleNextUrl(_0x36e804[_0xf8c8c4(0x108)],_0xf8c8c4(0x118)+_0x5aca56[_0xf8c8c4(0xcc)]+'/e/'+_0x6d1274),_0x39cfbd=[..._0x2a836a][_0xf8c8c4(0xe0)]((_0x544120,_0x5ec1ec)=>_0x544120[_0xf8c8c4(0xc8)][_0xf8c8c4(0xde)](_0x5ec1ec[_0xf8c8c4(0xc8)])),_0xa106a2=0x32,_0x42f7d4=_0xf8c8c4(0x10f)+_0x2a836a[_0xf8c8c4(0xce)]+_0xf8c8c4(0xd7)+(_0x2a836a['length']!==0x1?'es':'');console[_0xf8c8c4(0xbf)](_0x2a836a[_0xf8c8c4(0xce)]>_0xa106a2?'✔\x20'+_0x42f7d4+'\x20—\x20that\x27s\x20a\x20lot\x20to\x20eyeball.\x20Narrow\x20the\x20pattern\x20(add\x20more\x20of\x20the\x20name,\x20or\x20use\x20*\x20/\x20?),\x20or\x20use\x20--format\x20json\x20and\x20filter\x20with\x20jq/grep.':'✔\x20'+_0x42f7d4);if(_0x36e804[_0xf8c8c4(0xc6)]===_0xf8c8c4(0x10b)||_0x36e804[_0xf8c8c4(0xc6)]===_0xf8c8c4(0x103)){const _0x26f8e8=_0x39cfbd[_0xf8c8c4(0xc7)](_0x412182=>({..._0x412182,..._0x412182[_0xf8c8c4(0xeb)]===_0xf8c8c4(0xe5)?{'url':_0x1f541c(_0x412182['id'])}:{}}));return await handleSDKOutput(_0x26f8e8,_0x36e804),0x0;}if(_0x2a836a['length']===0x0)return console[_0xf8c8c4(0x102)](_0xf8c8c4(0xe6)+_0x5dfa4f),0x0;for(const _0x5dfd5a of _0x39cfbd){console['log'](_0x5dfd5a['type'][_0xf8c8c4(0x114)](0x8)+'\x20'+_0x5dfd5a[_0xf8c8c4(0xc8)]+'\x20\x20'+a58_0x568502[_0xf8c8c4(0xd2)](_0xf8c8c4(0xe3)+_0x5dfd5a['id']+')'));}const _0x4f02d4=_0x2a836a['filter'](_0x4e4d1f=>_0x4e4d1f[_0xf8c8c4(0xeb)]===_0xf8c8c4(0xe5)),_0x11f9a9=new Set(_0x4f02d4[_0xf8c8c4(0xc7)](_0x59df5e=>_0x59df5e[_0xf8c8c4(0x110)][_0xf8c8c4(0x117)]()))['size']===0x1;return _0x4f02d4[_0xf8c8c4(0xce)]>0x1&&_0x11f9a9&&console[_0xf8c8c4(0x102)](a58_0x568502['dim']('\x0a'+_0x4f02d4[_0xf8c8c4(0xce)]+_0xf8c8c4(0xed))),0x0;}async['listWithPattern'](_0x359ca4,_0x121fa9,_0x400ac9){const _0x46d477=a58_0x1582a6,{options:_0x22b50d,tdx:_0x38a428}=_0x359ca4,_0x45a4e6=await withSpinner(_0x46d477(0xd4)+_0x121fa9+_0x46d477(0xc9),()=>_0x38a428[_0x46d477(0xe5)][_0x46d477(0xf3)](_0x121fa9),{'verbose':_0x22b50d['verbose']}),_0x1b7aa3=_0x45a4e6['data'],_0x55b2ea=await withSpinner(_0x46d477(0xdb),()=>_0x38a428['segment'][_0x46d477(0xf1)](_0x1b7aa3['parentId'],_0x1b7aa3[_0x46d477(0x104)]),{'verbose':_0x22b50d[_0x46d477(0xcf)]}),{folders:_0x4ac0c9,segments:_0x53a7eb,journeys:_0x2926a0}=_0x55b2ea[_0x46d477(0xdd)],_0x32d6fe=_0x400ac9['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x49ac53=new RegExp('^'+_0x32d6fe+'$','i'),_0x3f9294=_0x4ac0c9[_0x46d477(0xe4)](_0x2dd289=>_0x49ac53[_0x46d477(0x100)](_0x2dd289[_0x46d477(0x110)])),_0x1dfede=_0x53a7eb['filter'](_0x5e4ae8=>_0x49ac53[_0x46d477(0x100)](_0x5e4ae8[_0x46d477(0x110)])),_0xae7370=_0x2926a0[_0x46d477(0xe4)](_0x4e851e=>_0x49ac53[_0x46d477(0x100)](_0x4e851e[_0x46d477(0xe9)])),_0x368053=_0x3f9294[_0x46d477(0xce)]+_0x1dfede[_0x46d477(0xce)]+_0xae7370[_0x46d477(0xce)];console['error'](_0x46d477(0xf8)+_0x3f9294[_0x46d477(0xce)]+_0x46d477(0xfe)+(_0x3f9294[_0x46d477(0xce)]!==0x1?'s':'')+',\x20'+_0x1dfede['length']+_0x46d477(0xf9)+(_0x1dfede[_0x46d477(0xce)]!==0x1?'s':'')+_0x46d477(0xff)+_0xae7370[_0x46d477(0xce)]+_0x46d477(0xe8)+(_0xae7370['length']!==0x1?'s':'')+_0x46d477(0x10a)+_0x400ac9+'\x27');const _0x4eda19=_0xea7cfd=>{return getConsoleNextUrl(_0x22b50d['site'],'/app/ps/'+_0x1b7aa3['parentId']+'/e/'+_0xea7cfd);},_0x138bb2=_0x22b50d[_0x46d477(0xc6)]==='json'||_0x22b50d[_0x46d477(0xc6)]===_0x46d477(0x103);if(_0x138bb2){const _0x11a05b=[..._0x3f9294['map'](_0x7ff07e=>({..._0x7ff07e,'type':_0x46d477(0xdf)})),..._0x1dfede[_0x46d477(0xc7)](_0x1dfd25=>({..._0x1dfd25,'type':_0x46d477(0xe5),'url':_0x4eda19(_0x1dfd25['id'])})),..._0xae7370[_0x46d477(0xc7)](_0xb1bc8=>({..._0xb1bc8,'name':_0xb1bc8[_0x46d477(0xe9)],'type':_0x46d477(0x119)}))]['sort']((_0x15e186,_0x2fe8d2)=>_0x15e186[_0x46d477(0x110)]['localeCompare'](_0x2fe8d2[_0x46d477(0x110)]));await handleSDKOutput(_0x11a05b,_0x22b50d);}else{if(_0x368053===0x0)console[_0x46d477(0x102)](_0x46d477(0x107)+_0x400ac9);else{console[_0x46d477(0x102)](a58_0x568502[_0x46d477(0xd2)]('['+_0x121fa9+_0x46d477(0xd5)+_0x400ac9+'\x27'));const _0x596872=formatFlatList(_0x3f9294,_0x1dfede,{'showMetadata':!![],'getSegmentUrl':_0x4eda19},_0xae7370);console[_0x46d477(0x102)](_0x596872);}}return 0x0;}async[a58_0x1582a6(0x10d)](_0x40a195,_0x2e2d30){const _0xfdf88a=a58_0x1582a6,{options:_0x45efe5,tdx:_0x2bad67}=_0x40a195,_0x25f026=await withSpinner(_0xfdf88a(0xc1)+_0x2e2d30+_0xfdf88a(0xc9),()=>_0x2bad67[_0xfdf88a(0xe5)][_0xfdf88a(0xf3)](_0x2e2d30),{'verbose':_0x45efe5[_0xfdf88a(0xcf)]}),_0x2a5fdd=_0x25f026[_0xfdf88a(0xdd)];_0x45efe5['verbose']&&(console['error'](_0xfdf88a(0xd0)+_0x2a5fdd[_0xfdf88a(0xcc)]),_0x2a5fdd[_0xfdf88a(0x104)]&&console[_0xfdf88a(0xbf)](_0xfdf88a(0xf4)+_0x2a5fdd[_0xfdf88a(0x104)]));const _0x49996e=await withSpinner(_0xfdf88a(0xdb),()=>_0x2bad67['segment'][_0xfdf88a(0xf1)](_0x2a5fdd[_0xfdf88a(0xcc)],_0x2a5fdd[_0xfdf88a(0x104)]),{'verbose':_0x45efe5['verbose']}),{folders:_0x17dd0c,segments:_0x300652,journeys:_0x118d50}=_0x49996e[_0xfdf88a(0xdd)],_0x413aaf=_0x17dd0c[_0xfdf88a(0xce)]+_0x300652[_0xfdf88a(0xce)]+_0x118d50[_0xfdf88a(0xce)];console[_0xfdf88a(0xbf)]('✔\x20Found\x20'+_0x17dd0c['length']+_0xfdf88a(0xfe)+(_0x17dd0c[_0xfdf88a(0xce)]!==0x1?'s':'')+',\x20'+_0x300652[_0xfdf88a(0xce)]+'\x20segment'+(_0x300652[_0xfdf88a(0xce)]!==0x1?'s':'')+_0xfdf88a(0xff)+_0x118d50[_0xfdf88a(0xce)]+_0xfdf88a(0xe8)+(_0x118d50[_0xfdf88a(0xce)]!==0x1?'s':''));const _0x52dc5c=_0x438272=>{const _0x4671dc=_0xfdf88a;return getConsoleNextUrl(_0x45efe5[_0x4671dc(0x108)],_0x4671dc(0x118)+_0x2a5fdd[_0x4671dc(0xcc)]+'/e/'+_0x438272);},_0x437896=_0x54f1e3=>{const _0x3aaa2e=_0xfdf88a;return getConsoleNextUrl(_0x45efe5['site'],'/app/ps/'+_0x2a5fdd[_0x3aaa2e(0xcc)]+_0x3aaa2e(0x11a)+_0x54f1e3+_0x3aaa2e(0xfb));},_0x1b3c81=_0x45efe5[_0xfdf88a(0xc6)]===_0xfdf88a(0x10b)||_0x45efe5[_0xfdf88a(0xc6)]===_0xfdf88a(0x103);if(_0x1b3c81){const _0x4f7fce=[..._0x17dd0c['map'](_0x209575=>({..._0x209575,'type':_0xfdf88a(0xdf)})),..._0x300652[_0xfdf88a(0xc7)](_0x496411=>({..._0x496411,'type':_0xfdf88a(0xe5),'url':_0x52dc5c(_0x496411['id'])})),..._0x118d50[_0xfdf88a(0xc7)](_0x4bfce8=>({..._0x4bfce8,'name':_0x4bfce8['journeyBundleName'],'type':'journey','url':_0x437896(_0x4bfce8['id'])}))][_0xfdf88a(0xe0)]((_0x3a28e7,_0xecd19d)=>_0x3a28e7[_0xfdf88a(0x110)][_0xfdf88a(0xde)](_0xecd19d[_0xfdf88a(0x110)]));await handleSDKOutput(_0x4f7fce,_0x45efe5);}else{if(_0x413aaf===0x0)console[_0xfdf88a(0x102)](a58_0x568502[_0xfdf88a(0xd2)]('['+_0x2e2d30+']')),console[_0xfdf88a(0x102)](_0xfdf88a(0xea));else{console['log'](a58_0x568502['dim']('['+_0x2e2d30+']'));const _0x5699be=formatFlatList(_0x17dd0c,_0x300652,{'showMetadata':!![],'getSegmentUrl':_0x52dc5c,'getJourneyUrl':_0x437896},_0x118d50);console['log'](_0x5699be);}}return 0x0;}async['listRecursive'](_0x8f9578,_0x1f50a5){const _0x440499=a58_0x1582a6,{options:_0x437c38,tdx:_0x55c442}=_0x8f9578,_0x429afa=await withSpinner('Resolving\x20path\x20\x27'+_0x1f50a5+_0x440499(0xc9),()=>_0x55c442[_0x440499(0xe5)][_0x440499(0xf3)](_0x1f50a5),{'verbose':_0x437c38[_0x440499(0xcf)]}),_0x44e5f6=_0x429afa[_0x440499(0xdd)];_0x437c38['verbose']&&(console[_0x440499(0xbf)](_0x440499(0xd0)+_0x44e5f6[_0x440499(0xcc)]),_0x44e5f6[_0x440499(0x104)]&&console[_0x440499(0xbf)](_0x440499(0xf4)+_0x44e5f6['folderId']));const _0x9e46e8=_0x437c38[_0x440499(0xc0)]||0xa,_0x6be93=await withSpinner(_0x440499(0xec),()=>_0x55c442[_0x440499(0xe5)][_0x440499(0x111)](_0x44e5f6['parentId'],_0x44e5f6[_0x440499(0x104)],0x0,_0x9e46e8),{'verbose':_0x437c38[_0x440499(0xcf)]}),_0x4af064=_0x6be93[_0x440499(0xdd)],_0x147f2c=_0x17773d=>{const _0x59d651=_0x440499;let _0x30e1aa=0x0,_0x4cc678=0x0,_0x1e9f4d=0x0;for(const _0x4a4fb4 of _0x17773d){if(_0x4a4fb4[_0x59d651(0xeb)]===_0x59d651(0xdf))_0x30e1aa++;else{if(_0x4a4fb4[_0x59d651(0xeb)]===_0x59d651(0xe5))_0x4cc678++;else{if(_0x4a4fb4[_0x59d651(0xeb)]===_0x59d651(0x119))_0x1e9f4d++;}}if(_0x4a4fb4['children']){const _0x3fe137=_0x147f2c(_0x4a4fb4[_0x59d651(0x101)]);_0x30e1aa+=_0x3fe137['folders'],_0x4cc678+=_0x3fe137[_0x59d651(0x109)],_0x1e9f4d+=_0x3fe137[_0x59d651(0xf2)];}}return{'folders':_0x30e1aa,'segments':_0x4cc678,'journeys':_0x1e9f4d};},_0x2602e9=_0x147f2c(_0x4af064);console['error'](_0x440499(0xc5)+_0x2602e9[_0x440499(0xe2)]+'\x20folder'+(_0x2602e9[_0x440499(0xe2)]!==0x1?'s':'')+',\x20'+_0x2602e9[_0x440499(0x109)]+_0x440499(0xf9)+(_0x2602e9[_0x440499(0x109)]!==0x1?'s':'')+_0x440499(0xff)+_0x2602e9[_0x440499(0xf2)]+'\x20journey'+(_0x2602e9[_0x440499(0xf2)]!==0x1?'s':''));const _0x597d32=_0x4b682f=>{const _0x2a7cf0=_0x440499;return getConsoleNextUrl(_0x437c38[_0x2a7cf0(0x108)],_0x2a7cf0(0x118)+_0x44e5f6[_0x2a7cf0(0xcc)]+'/e/'+_0x4b682f);},_0x54b164=_0x151898=>{const _0x36204f=_0x440499;return getConsoleNextUrl(_0x437c38[_0x36204f(0x108)],_0x36204f(0x118)+_0x44e5f6[_0x36204f(0xcc)]+_0x36204f(0x11a)+_0x151898+'/j/da');};if(_0x437c38['format']===_0x440499(0x10b)||_0x437c38[_0x440499(0xc6)]===_0x440499(0x103))await handleSDKOutput(_0x4af064,_0x437c38);else{console[_0x440499(0x102)](a58_0x568502[_0x440499(0xd2)]('['+_0x1f50a5+']'));const _0x2173e7=formatTree(_0x4af064,{'showMetadata':!![],'getSegmentUrl':_0x597d32,'getJourneyUrl':_0x54b164});console[_0x440499(0x102)](_0x2173e7);}return 0x0;}}
@@ -1 +1 @@
1
- function a53_0x27c2(_0x36b91c,_0x34db8a){_0x36b91c=_0x36b91c-0x151;const _0x438453=a53_0x4384();let _0x27c2e0=_0x438453[_0x36b91c];return _0x27c2e0;}const a53_0x1c076c=a53_0x27c2;(function(_0x5d3bf0,_0x2b9cc4){const _0x7ce34=a53_0x27c2,_0x428106=_0x5d3bf0();while(!![]){try{const _0x1d9a3e=-parseInt(_0x7ce34(0x16d))/0x1*(parseInt(_0x7ce34(0x154))/0x2)+-parseInt(_0x7ce34(0x15e))/0x3*(parseInt(_0x7ce34(0x178))/0x4)+parseInt(_0x7ce34(0x172))/0x5*(-parseInt(_0x7ce34(0x158))/0x6)+parseInt(_0x7ce34(0x171))/0x7*(-parseInt(_0x7ce34(0x167))/0x8)+parseInt(_0x7ce34(0x155))/0x9+parseInt(_0x7ce34(0x173))/0xa*(parseInt(_0x7ce34(0x165))/0xb)+parseInt(_0x7ce34(0x17a))/0xc;if(_0x1d9a3e===_0x2b9cc4)break;else _0x428106['push'](_0x428106['shift']());}catch(_0x1e89e0){_0x428106['push'](_0x428106['shift']());}}}(a53_0x4384,0xd2892));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';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a53_0x4384(){const _0x55258e=['validate','141LOnKcl','site','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','...','query','showTable','error','3971dRVEVB','description','384YNFYXM','message','Database:\x20','catalog','\x20row','cause','185443NaRyGp','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','table','\x20\x20Cause:\x20','170842lqsEJX','20fAzLBY','8630AsfTju','show','Usage:\x20tdx\x20show\x20<database.table>','execute','Error:\x20','74924fJgfPY','Site:\x20','27938616EbYIOR','verbose','name','data','Table:\x20','limit','args','2ZKiaZT','11961477osQurH','Querying\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','1303758pJgzFC','database','✔\x20Retrieved\x20','length','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'];a53_0x4384=function(){return _0x55258e;};return a53_0x4384();}export class ShowCommand extends BaseCommand{[a53_0x1c076c(0x17c)]=a53_0x1c076c(0x174);[a53_0x1c076c(0x166)]='Show\x20table\x20contents';async[a53_0x1c076c(0x176)](_0x3bc88b){const _0x11f295=a53_0x1c076c;return this[_0x11f295(0x163)](_0x3bc88b);}async[a53_0x1c076c(0x163)](_0x4e22b9){const _0x2c046d=a53_0x1c076c,{options:_0x4b4832,args:_0x4cf7f4,tdx:_0xf72775}=_0x4e22b9;let _0x2b2f57;try{_0x2b2f57=parseTableReference(_0x4cf7f4[0x0]);const _0x4f1d59=_0x4b4832['database'];!_0x2b2f57[_0x2c046d(0x159)]&&_0x4f1d59&&(_0x2b2f57[_0x2c046d(0x159)]=_0x4f1d59);const _0x3828b4=validateTableDescribeReference(_0x2b2f57);if(_0x3828b4)return console[_0x2c046d(0x164)](_0x2c046d(0x177)+_0x3828b4),console[_0x2c046d(0x164)](_0x2c046d(0x175)),console['error'](_0x2c046d(0x160)),console[_0x2c046d(0x164)](_0x2c046d(0x16e)),0x1;}catch(_0x269ac9){return console[_0x2c046d(0x164)](_0x2c046d(0x177)+_0x269ac9[_0x2c046d(0x168)]),console[_0x2c046d(0x164)](_0x2c046d(0x175)),console[_0x2c046d(0x164)](_0x2c046d(0x160)),console['error'](_0x2c046d(0x16e)),0x1;}const _0x1138a1=_0x2b2f57[_0x2c046d(0x16a)],_0x36a8de=_0x2b2f57[_0x2c046d(0x159)],_0x5086ce=_0x2b2f57[_0x2c046d(0x16f)],_0x16344e=resolveLimit(_0x4b4832[_0x2c046d(0x152)],DEFAULT_DISPLAY_LIMIT);try{_0x4b4832[_0x2c046d(0x17b)]&&(console['error'](_0x2c046d(0x179)+_0x4b4832[_0x2c046d(0x15f)]),_0x1138a1&&console['error']('Catalog:\x20'+_0x1138a1),console[_0x2c046d(0x164)](_0x2c046d(0x169)+_0x36a8de),console[_0x2c046d(0x164)](_0x2c046d(0x151)+_0x5086ce),console['error']('Limit:\x20'+_0x16344e));const _0x6dd126=_0x1138a1?_0x1138a1+'.'+_0x36a8de+'.'+_0x5086ce:_0x36a8de+'.'+_0x5086ce,_0x59ae5c=await withSpinner(_0x2c046d(0x156)+_0x6dd126+_0x2c046d(0x161),()=>_0xf72775[_0x2c046d(0x162)][_0x2c046d(0x163)](_0x36a8de,_0x5086ce,_0x16344e,_0x1138a1),{'verbose':_0x4b4832[_0x2c046d(0x17b)]}),_0x24255d=_0x59ae5c[_0x2c046d(0x17d)],_0x45feb6=_0x24255d['data'];return _0x45feb6['length']===0x0?console['error'](_0x2c046d(0x15c)):console[_0x2c046d(0x164)](_0x2c046d(0x15a)+_0x45feb6[_0x2c046d(0x15b)]+_0x2c046d(0x16b)+(_0x45feb6[_0x2c046d(0x15b)]!==0x1?'s':'')+'\x20from\x20'+_0x6dd126),await handleSDKOutput(_0x45feb6,_0x4b4832),0x0;}catch(_0x1ac552){if(_0x1ac552 instanceof SDKError)return console[_0x2c046d(0x164)](_0x2c046d(0x177)+_0x1ac552[_0x2c046d(0x168)]),_0x1ac552[_0x2c046d(0x16c)]&&console[_0x2c046d(0x164)](_0x2c046d(0x170)+_0x1ac552[_0x2c046d(0x16c)]),0x1;throw _0x1ac552;}}[a53_0x1c076c(0x15d)](_0x9dac9a){const _0xbd4ba9=a53_0x1c076c;if(_0x9dac9a[_0xbd4ba9(0x153)]['length']===0x0)return _0xbd4ba9(0x157);if(_0x9dac9a[_0xbd4ba9(0x153)][_0xbd4ba9(0x15b)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}
1
+ const a59_0x58b85f=a59_0x32b3;(function(_0x5d9fd2,_0x27cd05){const _0x55737f=a59_0x32b3,_0x3248d2=_0x5d9fd2();while(!![]){try{const _0xd9d616=parseInt(_0x55737f(0xde))/0x1+parseInt(_0x55737f(0xdf))/0x2*(parseInt(_0x55737f(0xbb))/0x3)+-parseInt(_0x55737f(0xe0))/0x4+-parseInt(_0x55737f(0xcb))/0x5*(-parseInt(_0x55737f(0xd2))/0x6)+-parseInt(_0x55737f(0xe3))/0x7+parseInt(_0x55737f(0xc8))/0x8*(-parseInt(_0x55737f(0xe4))/0x9)+-parseInt(_0x55737f(0xd4))/0xa*(parseInt(_0x55737f(0xbf))/0xb);if(_0xd9d616===_0x27cd05)break;else _0x3248d2['push'](_0x3248d2['shift']());}catch(_0x28f79e){_0x3248d2['push'](_0x3248d2['shift']());}}}(a59_0x173d,0x21ed9));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';import{withSpinner}from'../utils/spinner.js';function a59_0x173d(){const _0x4526ad=['execute','verbose','Querying\x20','Database:\x20','1635594fFAtFp','description','900170rigolo','validate','✔\x20Retrieved\x20','length','\x20\x20Cause:\x20','Limit:\x20','Show\x20table\x20contents','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','\x20row','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','96577FcupFf','2MMeepO','467324ajuhjs','site','...','1078476cuMIEe','77013GFDcVY','Catalog:\x20','catalog','message','limit','Site:\x20','443469WtGJWp','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','Error:\x20','query','11TFXpaA','Table:\x20','args','show','database','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','\x20from\x20','error','data','16ymeRaG','Usage:\x20tdx\x20show\x20<database.table>','cause','5jiSvwX','showTable','table'];a59_0x173d=function(){return _0x4526ad;};return a59_0x173d();}function a59_0x32b3(_0x271825,_0x36b90){_0x271825=_0x271825-0xb9;const _0x173d4f=a59_0x173d();let _0x32b3c7=_0x173d4f[_0x271825];return _0x32b3c7;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a59_0x58b85f(0xc2);[a59_0x58b85f(0xd3)]=a59_0x58b85f(0xda);async[a59_0x58b85f(0xce)](_0x588468){return this['showTable'](_0x588468);}async[a59_0x58b85f(0xcc)](_0x79e444){const _0x2095eb=a59_0x58b85f,{options:_0x2bd26e,args:_0x20a480,tdx:_0x5af5cb}=_0x79e444;let _0x478259;try{_0x478259=parseTableReference(_0x20a480[0x0]);const _0x48d22e=_0x2bd26e['database'];!_0x478259['database']&&_0x48d22e&&(_0x478259[_0x2095eb(0xc3)]=_0x48d22e);const _0x919642=validateTableDescribeReference(_0x478259);if(_0x919642)return console[_0x2095eb(0xc6)](_0x2095eb(0xbd)+_0x919642),console[_0x2095eb(0xc6)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x2095eb(0xc6)](_0x2095eb(0xdb)),console['error'](_0x2095eb(0xdd)),0x1;}catch(_0x2d6e59){return console[_0x2095eb(0xc6)]('Error:\x20'+_0x2d6e59[_0x2095eb(0xe7)]),console['error'](_0x2095eb(0xc9)),console[_0x2095eb(0xc6)](_0x2095eb(0xdb)),console['error'](_0x2095eb(0xdd)),0x1;}const _0x5c862d=_0x478259[_0x2095eb(0xe6)],_0x1e6bed=_0x478259['database'],_0x5d5ed4=_0x478259[_0x2095eb(0xcd)],_0x3f7f6c=resolveLimit(_0x2bd26e[_0x2095eb(0xb9)],DEFAULT_DISPLAY_LIMIT);try{_0x2bd26e[_0x2095eb(0xcf)]&&(console[_0x2095eb(0xc6)](_0x2095eb(0xba)+_0x2bd26e[_0x2095eb(0xe1)]),_0x5c862d&&console[_0x2095eb(0xc6)](_0x2095eb(0xe5)+_0x5c862d),console[_0x2095eb(0xc6)](_0x2095eb(0xd1)+_0x1e6bed),console['error'](_0x2095eb(0xc0)+_0x5d5ed4),console['error'](_0x2095eb(0xd9)+_0x3f7f6c));const _0x478cf5=_0x5c862d?_0x5c862d+'.'+_0x1e6bed+'.'+_0x5d5ed4:_0x1e6bed+'.'+_0x5d5ed4,_0x34a25c=await withSpinner(_0x2095eb(0xd0)+_0x478cf5+_0x2095eb(0xe2),()=>_0x5af5cb[_0x2095eb(0xbe)][_0x2095eb(0xcc)](_0x1e6bed,_0x5d5ed4,_0x3f7f6c,_0x5c862d),{'verbose':_0x2bd26e['verbose']}),_0x2905ac=_0x34a25c['data'],_0x592a8=_0x2905ac[_0x2095eb(0xc7)];return _0x592a8['length']===0x0?console[_0x2095eb(0xc6)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x2095eb(0xc6)](_0x2095eb(0xd6)+_0x592a8[_0x2095eb(0xd7)]+_0x2095eb(0xdc)+(_0x592a8['length']!==0x1?'s':'')+_0x2095eb(0xc5)+_0x478cf5),await handleSDKOutput(_0x592a8,_0x2bd26e),0x0;}catch(_0x2f7594){if(_0x2f7594 instanceof SDKError)return console['error']('Error:\x20'+_0x2f7594[_0x2095eb(0xe7)]),_0x2f7594[_0x2095eb(0xca)]&&console[_0x2095eb(0xc6)](_0x2095eb(0xd8)+_0x2f7594[_0x2095eb(0xca)]),0x1;throw _0x2f7594;}}[a59_0x58b85f(0xd5)](_0x357936){const _0x2aaa4b=a59_0x58b85f;if(_0x357936[_0x2aaa4b(0xc1)][_0x2aaa4b(0xd7)]===0x0)return _0x2aaa4b(0xc4);if(_0x357936[_0x2aaa4b(0xc1)][_0x2aaa4b(0xd7)]>0x1)return _0x2aaa4b(0xbc);return undefined;}}
@@ -1 +1 @@
1
- const a54_0x1e6bbd=a54_0x26b3;(function(_0x413366,_0x5f3918){const _0x211aa5=a54_0x26b3,_0x1c0ee9=_0x413366();while(!![]){try{const _0x345df0=-parseInt(_0x211aa5(0xbf))/0x1*(-parseInt(_0x211aa5(0xad))/0x2)+parseInt(_0x211aa5(0x95))/0x3+-parseInt(_0x211aa5(0xc0))/0x4*(-parseInt(_0x211aa5(0xa4))/0x5)+-parseInt(_0x211aa5(0xa0))/0x6+-parseInt(_0x211aa5(0xb0))/0x7+-parseInt(_0x211aa5(0xb4))/0x8+parseInt(_0x211aa5(0xbc))/0x9*(parseInt(_0x211aa5(0xa2))/0xa);if(_0x345df0===_0x5f3918)break;else _0x1c0ee9['push'](_0x1c0ee9['shift']());}catch(_0x552390){_0x1c0ee9['push'](_0x1c0ee9['shift']());}}}(a54_0x37cf,0x25e02));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a54_0x26b3(_0x15d793,_0x783956){_0x15d793=_0x15d793-0x94;const _0x37cf5c=a54_0x37cf();let _0x26b319=_0x37cf5c[_0x15d793];return _0x26b319;}function a54_0x37cf(){const _0x3f9fd5=['filter','TDX_PROFILE\x20env','43198tVoFzG','yellow','getUserInfo','1702071tdUeSN','No\x20credential\x20found','green','bold','1063664tpPrsf','execute','status','cli','User:','profile','account_id','session','531xgwsDN','dim','Read\x20credential\x20from\x20','3YPQbAC','58204sbQKiQ','red','site','message','email','N/A','Show\x20authentication\x20status\x20and\x20current\x20context','342150fnzHTl','log','Name:','CLI\x20flag','join','(from\x20','last_name','jobs','profileSource','\x20profile:\x20','✓\x20Authentication\x20successful\x0a','153096CYIBIe','name','46790avfwqf','first_name','35xlmqVM','cyan','✗\x20Validation\x20failed:\x20','OAuth','config','tdx','Account\x20ID:'];a54_0x37cf=function(){return _0x3f9fd5;};return a54_0x37cf();}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a54_0x22d016 from'chalk';export class StatusCommand extends BaseCommand{[a54_0x1e6bbd(0xa1)]='status';['description']=a54_0x1e6bbd(0x94);async[a54_0x1e6bbd(0xb5)](_0x1a4bae){const _0x22e9ec=a54_0x1e6bbd,{options:_0x4adcf2,tdx:_0x1a3e26}=_0x1a4bae,_0x2c0809=new GlobalContext(_0x4adcf2),_0x5590f0=_0x2c0809[_0x22e9ec(0xc2)],_0x59c3b7=_0x2c0809[_0x22e9ec(0xb9)],_0x2474df=_0x2c0809[_0x22e9ec(0x9d)],_0x44bb0b=_0x2474df===_0x22e9ec(0xb7)?_0x22e9ec(0x98):_0x2474df==='session'?_0x22e9ec(0xbb):_0x2474df==='env'?_0x22e9ec(0xac):_0x2474df===_0x22e9ec(0xa8)?_0x22e9ec(0xa8):null,_0x2f5e12=_0x59c3b7?a54_0x22d016[_0x22e9ec(0xa5)](_0x59c3b7):a54_0x22d016['dim'](_0x22e9ec(0xc5)),_0x471100=_0x44bb0b?'\x20'+a54_0x22d016[_0x22e9ec(0xbd)](_0x22e9ec(0x9a)+_0x44bb0b+')'):'';console[_0x22e9ec(0x96)](a54_0x22d016[_0x22e9ec(0xb3)](_0x22e9ec(0xa9))+_0x22e9ec(0x9e)+_0x2f5e12+_0x471100+'\x20'+a54_0x22d016[_0x22e9ec(0xbd)]('(')+'site:\x20'+a54_0x22d016[_0x22e9ec(0xa5)](_0x5590f0)+a54_0x22d016[_0x22e9ec(0xbd)](')'));const _0x170614=await getOAuthTokens(_0x59c3b7);if(_0x170614)console['log']('Credential\x20type:\x20'+a54_0x22d016[_0x22e9ec(0xa5)](_0x22e9ec(0xa7)));else{const _0x1a6cc1=await resolveAPIKeyAsync(_0x5590f0,_0x59c3b7);if(_0x1a6cc1){const {source:_0x445536,isDeprecated:_0x3ae7ac}=_0x1a6cc1,_0x4d9c72=_0x22e9ec(0xbe)+a54_0x22d016[_0x22e9ec(0xa5)](_0x445536);console['log'](_0x3ae7ac?a54_0x22d016[_0x22e9ec(0xae)](_0x4d9c72):_0x4d9c72);}else console[_0x22e9ec(0x96)](a54_0x22d016['yellow'](_0x22e9ec(0xb1)));}let _0x1ef6ca=![];try{const _0x2a9031=await _0x1a3e26[_0x22e9ec(0x9c)][_0x22e9ec(0xaf)]();console[_0x22e9ec(0x96)](a54_0x22d016[_0x22e9ec(0xb2)](_0x22e9ec(0x9f))),console['log'](a54_0x22d016['bold'](_0x22e9ec(0xb8))+'\x20'+a54_0x22d016[_0x22e9ec(0xa5)](_0x2a9031[_0x22e9ec(0xc4)]));if(_0x2a9031['first_name']||_0x2a9031[_0x22e9ec(0x9b)]){const _0x5db65c=[_0x2a9031[_0x22e9ec(0xa3)],_0x2a9031['last_name']][_0x22e9ec(0xab)](Boolean)[_0x22e9ec(0x99)]('\x20');console['log'](a54_0x22d016[_0x22e9ec(0xb3)](_0x22e9ec(0x97))+'\x20'+_0x5db65c);}_0x2a9031[_0x22e9ec(0xba)]&&console[_0x22e9ec(0x96)](a54_0x22d016[_0x22e9ec(0xb3)](_0x22e9ec(0xaa))+'\x20'+a54_0x22d016[_0x22e9ec(0xae)](_0x2a9031[_0x22e9ec(0xba)])),_0x1ef6ca=!![];}catch(_0x39ef72){_0x39ef72 instanceof HTTPClientError&&_0x39ef72[_0x22e9ec(0xb6)]===0x191?printAuthError(_0x39ef72,!![],_0x59c3b7):console['error'](a54_0x22d016[_0x22e9ec(0xc1)](_0x22e9ec(0xa6)+(_0x39ef72 instanceof Error?_0x39ef72[_0x22e9ec(0xc3)]:String(_0x39ef72))));}return console['log'](),_0x2c0809['displayWithSources'](),_0x1ef6ca?0x0:0x1;}}
1
+ function a60_0x5ed5(){const _0x3260ae=['log','jobs','3659490fUEMiB','displayWithSources','yellow','getUserInfo','red','cli','bold','Account\x20ID:','profileSource','4378563uTpRnA','6338264WKsLrZ','4388aZjSTM','No\x20credential\x20found','3458524DCafiL','profile','✓\x20Authentication\x20successful\x0a','Credential\x20type:\x20','User:','cyan','Show\x20authentication\x20status\x20and\x20current\x20context','env','N/A','email','Name:','description','dim','TDX_PROFILE\x20env','site','950630THfrkW','last_name','account_id','\x20profile:\x20','status','8264970AWofKz','config','Read\x20credential\x20from\x20','session','name','join','(from\x20','first_name','465ARzGgd'];a60_0x5ed5=function(){return _0x3260ae;};return a60_0x5ed5();}const a60_0x6b6cdf=a60_0x242c;(function(_0x2865ee,_0x37fe37){const _0x53f0ad=a60_0x242c,_0x35a601=_0x2865ee();while(!![]){try{const _0x48cd52=parseInt(_0x53f0ad(0x154))/0x1+-parseInt(_0x53f0ad(0x145))/0x2+parseInt(_0x53f0ad(0x135))/0x3*(-parseInt(_0x53f0ad(0x143))/0x4)+parseInt(_0x53f0ad(0x138))/0x5+parseInt(_0x53f0ad(0x159))/0x6+parseInt(_0x53f0ad(0x141))/0x7+-parseInt(_0x53f0ad(0x142))/0x8;if(_0x48cd52===_0x37fe37)break;else _0x35a601['push'](_0x35a601['shift']());}catch(_0x19e6a){_0x35a601['push'](_0x35a601['shift']());}}}(a60_0x5ed5,0xf2aa0));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a60_0x242c(_0x17f3f3,_0x547ee9){_0x17f3f3=_0x17f3f3-0x134;const _0x5ed513=a60_0x5ed5();let _0x242c0e=_0x5ed513[_0x17f3f3];return _0x242c0e;}import a60_0x3fa0fc from'chalk';export class StatusCommand extends BaseCommand{[a60_0x6b6cdf(0x15d)]=a60_0x6b6cdf(0x158);[a60_0x6b6cdf(0x150)]=a60_0x6b6cdf(0x14b);async['execute'](_0x309ce0){const _0x45b05f=a60_0x6b6cdf,{options:_0x42475f,tdx:_0x44373d}=_0x309ce0,_0x14d79c=new GlobalContext(_0x42475f),_0x5d98ae=_0x14d79c[_0x45b05f(0x153)],_0x57ee0e=_0x14d79c[_0x45b05f(0x146)],_0x40ee2e=_0x14d79c[_0x45b05f(0x140)],_0x3e936b=_0x40ee2e===_0x45b05f(0x13d)?'CLI\x20flag':_0x40ee2e===_0x45b05f(0x15c)?_0x45b05f(0x15c):_0x40ee2e===_0x45b05f(0x14c)?_0x45b05f(0x152):_0x40ee2e===_0x45b05f(0x15a)?'config':null,_0x251a5c=_0x57ee0e?a60_0x3fa0fc['cyan'](_0x57ee0e):a60_0x3fa0fc[_0x45b05f(0x151)](_0x45b05f(0x14d)),_0x18161c=_0x3e936b?'\x20'+a60_0x3fa0fc[_0x45b05f(0x151)](_0x45b05f(0x15f)+_0x3e936b+')'):'';console[_0x45b05f(0x136)](a60_0x3fa0fc[_0x45b05f(0x13e)]('tdx')+_0x45b05f(0x157)+_0x251a5c+_0x18161c+'\x20'+a60_0x3fa0fc[_0x45b05f(0x151)]('(')+'site:\x20'+a60_0x3fa0fc[_0x45b05f(0x14a)](_0x5d98ae)+a60_0x3fa0fc[_0x45b05f(0x151)](')'));const _0x56c533=await getOAuthTokens(_0x57ee0e);if(_0x56c533)console['log'](_0x45b05f(0x148)+a60_0x3fa0fc[_0x45b05f(0x14a)]('OAuth'));else{const _0xadec6e=await resolveAPIKeyAsync(_0x5d98ae,_0x57ee0e);if(_0xadec6e){const {source:_0x143659,isDeprecated:_0x434f2f}=_0xadec6e,_0x55a5b9=_0x45b05f(0x15b)+a60_0x3fa0fc['cyan'](_0x143659);console[_0x45b05f(0x136)](_0x434f2f?a60_0x3fa0fc[_0x45b05f(0x13a)](_0x55a5b9):_0x55a5b9);}else console['log'](a60_0x3fa0fc[_0x45b05f(0x13a)](_0x45b05f(0x144)));}let _0x3405b8=![];try{const _0x205172=await _0x44373d[_0x45b05f(0x137)][_0x45b05f(0x13b)]();console[_0x45b05f(0x136)](a60_0x3fa0fc['green'](_0x45b05f(0x147))),console['log'](a60_0x3fa0fc[_0x45b05f(0x13e)](_0x45b05f(0x149))+'\x20'+a60_0x3fa0fc[_0x45b05f(0x14a)](_0x205172[_0x45b05f(0x14e)]));if(_0x205172[_0x45b05f(0x134)]||_0x205172[_0x45b05f(0x155)]){const _0x24b11b=[_0x205172[_0x45b05f(0x134)],_0x205172[_0x45b05f(0x155)]]['filter'](Boolean)[_0x45b05f(0x15e)]('\x20');console['log'](a60_0x3fa0fc[_0x45b05f(0x13e)](_0x45b05f(0x14f))+'\x20'+_0x24b11b);}_0x205172[_0x45b05f(0x156)]&&console[_0x45b05f(0x136)](a60_0x3fa0fc['bold'](_0x45b05f(0x13f))+'\x20'+a60_0x3fa0fc[_0x45b05f(0x13a)](_0x205172['account_id'])),_0x3405b8=!![];}catch(_0x36b6e8){_0x36b6e8 instanceof HTTPClientError&&_0x36b6e8[_0x45b05f(0x158)]===0x191?printAuthError(_0x36b6e8,!![],_0x57ee0e):console['error'](a60_0x3fa0fc[_0x45b05f(0x13c)]('✗\x20Validation\x20failed:\x20'+(_0x36b6e8 instanceof Error?_0x36b6e8['message']:String(_0x36b6e8))));}return console[_0x45b05f(0x136)](),_0x14d79c[_0x45b05f(0x139)](),_0x3405b8?0x0:0x1;}}