@treasuredata/tdx 2026.4.18 → 2026.4.20

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 (268) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.d.ts +38 -0
  27. package/dist/commands/engage-command.d.ts.map +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/engage-command.js.map +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.d.ts +1 -0
  35. package/dist/commands/journey-command.d.ts.map +1 -1
  36. package/dist/commands/journey-command.js +1 -1
  37. package/dist/commands/journey-command.js.map +1 -1
  38. package/dist/commands/journey-validate-command.js +1 -1
  39. package/dist/commands/llm-command.js +1 -1
  40. package/dist/commands/mcp-command.js +1 -1
  41. package/dist/commands/parent-segment-command.js +1 -1
  42. package/dist/commands/policy-command.js +1 -1
  43. package/dist/commands/profile-command.js +1 -1
  44. package/dist/commands/profiles-command.js +1 -1
  45. package/dist/commands/query-command.js +1 -1
  46. package/dist/commands/schedule-command.js +1 -1
  47. package/dist/commands/segment-command.js +1 -1
  48. package/dist/commands/segment-create-command.js +1 -1
  49. package/dist/commands/segment-fields-command.js +1 -1
  50. package/dist/commands/segment-pull-command.js +1 -1
  51. package/dist/commands/segment-push-command.js +1 -1
  52. package/dist/commands/segment-update-command.js +1 -1
  53. package/dist/commands/segment-use-command.js +1 -1
  54. package/dist/commands/segment-validate-command.js +1 -1
  55. package/dist/commands/segments.js +1 -1
  56. package/dist/commands/show.js +1 -1
  57. package/dist/commands/status-command.js +1 -1
  58. package/dist/commands/tables.js +1 -1
  59. package/dist/commands/unset-command.js +1 -1
  60. package/dist/commands/upgrade-command.js +1 -1
  61. package/dist/commands/use-command.js +1 -1
  62. package/dist/commands/user-command.js +1 -1
  63. package/dist/commands/work-command.js +1 -1
  64. package/dist/commands/workflow-command.d.ts +1 -0
  65. package/dist/commands/workflow-command.d.ts.map +1 -1
  66. package/dist/commands/workflow-command.js +1 -1
  67. package/dist/commands/workflow-command.js.map +1 -1
  68. package/dist/core/auth.js +1 -1
  69. package/dist/core/command-output.js +1 -1
  70. package/dist/core/config.js +1 -1
  71. package/dist/core/connection-cache.js +1 -1
  72. package/dist/core/constants.js +1 -1
  73. package/dist/core/credential-cache.js +1 -1
  74. package/dist/core/global-context.js +1 -1
  75. package/dist/core/keychain.js +1 -1
  76. package/dist/core/oauth-keychain.js +1 -1
  77. package/dist/core/oauth.js +1 -1
  78. package/dist/core/profile.js +1 -1
  79. package/dist/core/project-config.js +1 -1
  80. package/dist/core/session.js +1 -1
  81. package/dist/core/user-cache.js +1 -1
  82. package/dist/core/version.js +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/mcp/server.js +1 -1
  85. package/dist/mcp/tools/index.js +1 -1
  86. package/dist/mcp/tools/tdx-run.js +1 -1
  87. package/dist/mcp/tools/tdx-search.js +1 -1
  88. package/dist/mcp/tools/work-create-item.js +1 -1
  89. package/dist/mcp/utils.js +1 -1
  90. package/dist/proxy/claude-usage-tracker.js +1 -1
  91. package/dist/proxy/passthrough-server.js +1 -1
  92. package/dist/proxy/sse-usage-parser.js +1 -1
  93. package/dist/sdk/agent/agent-config.js +1 -1
  94. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  95. package/dist/sdk/agent/agent-yaml.js +1 -1
  96. package/dist/sdk/agent/test/evaluator.js +1 -1
  97. package/dist/sdk/agent/test/executor.js +1 -1
  98. package/dist/sdk/agent/test/index.js +1 -1
  99. package/dist/sdk/agent/test/output.js +1 -1
  100. package/dist/sdk/agent/test/parser.js +1 -1
  101. package/dist/sdk/agent/tool-target-registry.js +1 -1
  102. package/dist/sdk/api.js +1 -1
  103. package/dist/sdk/cas/cas-api-client.js +1 -1
  104. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  105. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  106. package/dist/sdk/cas/index.js +1 -1
  107. package/dist/sdk/cas/pull-workflow.js +1 -1
  108. package/dist/sdk/cas/push-workflow.js +1 -1
  109. package/dist/sdk/client/cdp-api-client.js +1 -1
  110. package/dist/sdk/client/delivery-api-client.js +1 -1
  111. package/dist/sdk/client/endpoints.js +1 -1
  112. package/dist/sdk/client/engage-api-client.d.ts +26 -1
  113. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  114. package/dist/sdk/client/engage-api-client.js +1 -1
  115. package/dist/sdk/client/engage-api-client.js.map +1 -1
  116. package/dist/sdk/client/http-client.d.ts +1 -1
  117. package/dist/sdk/client/http-client.d.ts.map +1 -1
  118. package/dist/sdk/client/http-client.js +1 -1
  119. package/dist/sdk/client/http-client.js.map +1 -1
  120. package/dist/sdk/client/llm-api-client.js +1 -1
  121. package/dist/sdk/client/oauth-refresh.js +1 -1
  122. package/dist/sdk/client/rate-limiter.js +1 -1
  123. package/dist/sdk/client/td-api-client.js +1 -1
  124. package/dist/sdk/client/trino-api-client.js +1 -1
  125. package/dist/sdk/client/workflow-client.d.ts +7 -0
  126. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  127. package/dist/sdk/client/workflow-client.js +1 -1
  128. package/dist/sdk/client/workflow-client.js.map +1 -1
  129. package/dist/sdk/connection-validator.js +1 -1
  130. package/dist/sdk/connection.js +1 -1
  131. package/dist/sdk/delivery.js +1 -1
  132. package/dist/sdk/engage/campaign-pull.js +1 -1
  133. package/dist/sdk/engage/campaign-push.js +1 -1
  134. package/dist/sdk/engage/campaign-validator.js +1 -1
  135. package/dist/sdk/engage/campaign-validator.js.map +1 -1
  136. package/dist/sdk/engage/campaign-yaml.d.ts +1 -1
  137. package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
  138. package/dist/sdk/engage/campaign-yaml.js +1 -1
  139. package/dist/sdk/engage/campaign-yaml.js.map +1 -1
  140. package/dist/sdk/engage/template-pull.js +1 -1
  141. package/dist/sdk/engage/template-push.js +1 -1
  142. package/dist/sdk/engage/template-validator.js +1 -1
  143. package/dist/sdk/engage/template-yaml.js +1 -1
  144. package/dist/sdk/engage/types/campaign-def.d.ts +2 -2
  145. package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -1
  146. package/dist/sdk/engage/types/campaign-def.js +1 -1
  147. package/dist/sdk/engage/types/campaign-def.js.map +1 -1
  148. package/dist/sdk/engage/types/campaign-schema.d.ts +256 -8
  149. package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
  150. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  151. package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
  152. package/dist/sdk/engage/types/template-schema.js +1 -1
  153. package/dist/sdk/engage.d.ts +28 -1
  154. package/dist/sdk/engage.d.ts.map +1 -1
  155. package/dist/sdk/engage.js +1 -1
  156. package/dist/sdk/engage.js.map +1 -1
  157. package/dist/sdk/errors.js +1 -1
  158. package/dist/sdk/index.d.ts +1 -1
  159. package/dist/sdk/index.d.ts.map +1 -1
  160. package/dist/sdk/index.js +1 -1
  161. package/dist/sdk/index.js.map +1 -1
  162. package/dist/sdk/io/index.js +1 -1
  163. package/dist/sdk/io/node-filesystem.js +1 -1
  164. package/dist/sdk/job.js +1 -1
  165. package/dist/sdk/journey.js +1 -1
  166. package/dist/sdk/llm/chat-cache.js +1 -1
  167. package/dist/sdk/llm/index.js +1 -1
  168. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  169. package/dist/sdk/llm/model-factors.js +1 -1
  170. package/dist/sdk/personalization.js +1 -1
  171. package/dist/sdk/policy.js +1 -1
  172. package/dist/sdk/query/index.js +1 -1
  173. package/dist/sdk/query/sql-parser.js +1 -1
  174. package/dist/sdk/realtime.js +1 -1
  175. package/dist/sdk/schedule.js +1 -1
  176. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  177. package/dist/sdk/segment/fields-display.js +1 -1
  178. package/dist/sdk/segment/file-discovery.js +1 -1
  179. package/dist/sdk/segment/journey-utils.js +1 -1
  180. package/dist/sdk/segment/journey-validator.js +1 -1
  181. package/dist/sdk/segment/journey-yaml.js +1 -1
  182. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  183. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  184. package/dist/sdk/segment/pull-workflow.js +1 -1
  185. package/dist/sdk/segment/push-recovery.js +1 -1
  186. package/dist/sdk/segment/push-workflow.js +1 -1
  187. package/dist/sdk/segment/resolution-context.js +1 -1
  188. package/dist/sdk/segment/segment-path-parser.js +1 -1
  189. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  190. package/dist/sdk/segment/segment-validator.js +1 -1
  191. package/dist/sdk/segment/target-resolution.js +1 -1
  192. package/dist/sdk/segment/tdx-config.js +1 -1
  193. package/dist/sdk/segment/types/activation-schema.js +1 -1
  194. package/dist/sdk/segment/types/journey-def.js +1 -1
  195. package/dist/sdk/segment/types/journey-schema.js +1 -1
  196. package/dist/sdk/segment/types/segment-def.js +1 -1
  197. package/dist/sdk/segment/types/segment-schema.js +1 -1
  198. package/dist/sdk/segment/validate-files.js +1 -1
  199. package/dist/sdk/segment/yaml-validator.js +1 -1
  200. package/dist/sdk/segment.js +1 -1
  201. package/dist/sdk/types/engage.d.ts +125 -1
  202. package/dist/sdk/types/engage.d.ts.map +1 -1
  203. package/dist/sdk/types/index.d.ts +1 -1
  204. package/dist/sdk/types/index.d.ts.map +1 -1
  205. package/dist/sdk/types/index.js +1 -1
  206. package/dist/sdk/types/index.js.map +1 -1
  207. package/dist/sdk/types/progress.js +1 -1
  208. package/dist/sdk/types/workspace.js +1 -1
  209. package/dist/sdk/user.js +1 -1
  210. package/dist/sdk/util/format-detector.js +1 -1
  211. package/dist/sdk/util/formatters.js +1 -1
  212. package/dist/sdk/util/index.js +1 -1
  213. package/dist/sdk/util/paginate.js +1 -1
  214. package/dist/sdk/util/tree-formatter.js +1 -1
  215. package/dist/sdk/workflow/archive-validation.js +1 -1
  216. package/dist/sdk/workflow/clone-workflow.js +1 -1
  217. package/dist/sdk/workflow/index.d.ts +14 -1
  218. package/dist/sdk/workflow/index.d.ts.map +1 -1
  219. package/dist/sdk/workflow/index.js +1 -1
  220. package/dist/sdk/workflow/index.js.map +1 -1
  221. package/dist/sdk/workflow/pull-workflow.js +1 -1
  222. package/dist/sdk/workflow/push-workflow.js +1 -1
  223. package/dist/sdk/workflow/task-graph.d.ts +65 -0
  224. package/dist/sdk/workflow/task-graph.d.ts.map +1 -0
  225. package/dist/sdk/workflow/task-graph.js +1 -0
  226. package/dist/sdk/workflow/task-graph.js.map +1 -0
  227. package/dist/sdk/workflow/tdx-config.js +1 -1
  228. package/dist/sdk/workflow/workflow-utils.js +1 -1
  229. package/dist/sdk/workspace/access-tracker.js +1 -1
  230. package/dist/sdk/workspace/frontmatter.js +1 -1
  231. package/dist/sdk/workspace/git.js +1 -1
  232. package/dist/sdk/workspace/index.js +1 -1
  233. package/dist/sdk/workspace/templates.js +1 -1
  234. package/dist/sdk/workspace/weekly.js +1 -1
  235. package/dist/sdk/workspace/wikilinks.js +1 -1
  236. package/dist/test-utils/command-runner.js +1 -1
  237. package/dist/test-utils/factories.js +1 -1
  238. package/dist/test-utils/fixtures.js +1 -1
  239. package/dist/test-utils/http-mock.js +1 -1
  240. package/dist/test-utils/index.js +1 -1
  241. package/dist/utils/async.js +1 -1
  242. package/dist/utils/colors.js +1 -1
  243. package/dist/utils/diff.js +1 -1
  244. package/dist/utils/file-permissions.js +1 -1
  245. package/dist/utils/file-reader.js +1 -1
  246. package/dist/utils/github-releases.js +1 -1
  247. package/dist/utils/global-cache.js +1 -1
  248. package/dist/utils/json-loader.js +1 -1
  249. package/dist/utils/local-cache.js +1 -1
  250. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  251. package/dist/utils/logger/formatters/index.js +1 -1
  252. package/dist/utils/logger/handlers/console-handler.js +1 -1
  253. package/dist/utils/logger/handlers/file-handler.js +1 -1
  254. package/dist/utils/logger/handlers/index.js +1 -1
  255. package/dist/utils/logger/handlers/null-handler.js +1 -1
  256. package/dist/utils/logger/index.js +1 -1
  257. package/dist/utils/logger/logger.js +1 -1
  258. package/dist/utils/logger/types.js +1 -1
  259. package/dist/utils/option-validation.js +1 -1
  260. package/dist/utils/process.js +1 -1
  261. package/dist/utils/prompt.js +1 -1
  262. package/dist/utils/spinner.js +1 -1
  263. package/dist/utils/sse-parser.js +1 -1
  264. package/dist/utils/string-utils.js +1 -1
  265. package/dist/utils/table-ref-parser.js +1 -1
  266. package/dist/utils/tdx-logger.js +1 -1
  267. package/dist/utils/version-check.js +1 -1
  268. package/package.json +1 -1
@@ -1 +1 @@
1
- const a39_0x5286b3=a39_0x3e7f;(function(_0x2c68d3,_0x56e90b){const _0x2182fb=a39_0x3e7f,_0x143509=_0x2c68d3();while(!![]){try{const _0x230fe5=-parseInt(_0x2182fb(0x1bf))/0x1+parseInt(_0x2182fb(0x1d1))/0x2+-parseInt(_0x2182fb(0x1cd))/0x3*(-parseInt(_0x2182fb(0x1c5))/0x4)+-parseInt(_0x2182fb(0x1d3))/0x5+-parseInt(_0x2182fb(0x1c3))/0x6+parseInt(_0x2182fb(0x1c7))/0x7+parseInt(_0x2182fb(0x1c0))/0x8;if(_0x230fe5===_0x56e90b)break;else _0x143509['push'](_0x143509['shift']());}catch(_0x51efc8){_0x143509['push'](_0x143509['shift']());}}}(a39_0x2729,0xabd62));function a39_0x2729(){const _0x29fd8f=['1110560eVVrBy','2798792AIqfVy','Listing\x20fields\x20for\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','3424950mnXtfG','data','524VZqAUG','verbose','4941510AhoXGn','name','error','\x27...','✔\x20Found\x20','Site:\x20','9519dRixkn','parentSegment','Parent\x20segment:\x20','segment','2666284TBYTec','execute','2096785GUDThc','json'];a39_0x2729=function(){return _0x29fd8f;};return a39_0x2729();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a39_0x3e7f(_0x1f72f6,_0x4447bf){_0x1f72f6=_0x1f72f6-0x1bf;const _0x27291e=a39_0x2729();let _0x3e7fd3=_0x27291e[_0x1f72f6];return _0x3e7fd3;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x5286b3(0x1c8)]='segment:fields';['description']='List\x20available\x20fields\x20for\x20segmentation';async[a39_0x5286b3(0x1d2)](_0x5b17f3){const _0x185cd4=a39_0x5286b3,{options:_0x5ea28b,args:_0x4276a9,tdx:_0x1a988e}=_0x5b17f3,_0x29998a=_0x4276a9[0x0]||_0x5ea28b[_0x185cd4(0x1ce)];if(!_0x29998a)return console[_0x185cd4(0x1c9)](_0x185cd4(0x1c2)),console[_0x185cd4(0x1c9)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x5ea28b[_0x185cd4(0x1c6)]&&(console['error'](_0x185cd4(0x1cc)+_0x5ea28b['site']),console[_0x185cd4(0x1c9)](_0x185cd4(0x1cf)+_0x29998a));const _0x12ada3=await withSpinner(_0x185cd4(0x1c1)+_0x29998a+_0x185cd4(0x1ca),()=>_0x1a988e[_0x185cd4(0x1d0)]['listFields'](_0x29998a),{'verbose':_0x5ea28b[_0x185cd4(0x1c6)]}),_0x54d845=_0x12ada3[_0x185cd4(0x1c4)];console[_0x185cd4(0x1c9)](_0x185cd4(0x1cb)+_0x54d845['length']+'\x20field'+(_0x54d845['length']!==0x1?'s':''));if(_0x5ea28b[_0x185cd4(0x1d4)]||_0x5ea28b['jsonl'])return await handleSDKOutput(_0x54d845,_0x5ea28b),0x0;return displayFieldsHumanReadable(_0x54d845,_0x29998a),0x0;}}
1
+ const a39_0x499f8d=a39_0xf3da;(function(_0x5db0fb,_0x20466c){const _0xb7a642=a39_0xf3da,_0x1d2c92=_0x5db0fb();while(!![]){try{const _0x286bb6=parseInt(_0xb7a642(0x115))/0x1*(parseInt(_0xb7a642(0x112))/0x2)+-parseInt(_0xb7a642(0x10e))/0x3*(-parseInt(_0xb7a642(0x101))/0x4)+-parseInt(_0xb7a642(0x113))/0x5*(parseInt(_0xb7a642(0x11c))/0x6)+parseInt(_0xb7a642(0x11a))/0x7*(parseInt(_0xb7a642(0x117))/0x8)+-parseInt(_0xb7a642(0x109))/0x9*(-parseInt(_0xb7a642(0x111))/0xa)+-parseInt(_0xb7a642(0xfd))/0xb+-parseInt(_0xb7a642(0x116))/0xc*(parseInt(_0xb7a642(0x110))/0xd);if(_0x286bb6===_0x20466c)break;else _0x1d2c92['push'](_0x1d2c92['shift']());}catch(_0x189add){_0x1d2c92['push'](_0x1d2c92['shift']());}}}(a39_0x1262,0xa8f38));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a39_0xf3da(_0x3ef365,_0x20eae4){_0x3ef365=_0x3ef365-0xfd;const _0x12622f=a39_0x1262();let _0xf3dae3=_0x12622f[_0x3ef365];return _0xf3dae3;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x499f8d(0x10c)]=a39_0x499f8d(0xff);[a39_0x499f8d(0x105)]=a39_0x499f8d(0x100);async['execute'](_0x2cc786){const _0xcb18a1=a39_0x499f8d,{options:_0x1a59c8,args:_0x22c313,tdx:_0x144697}=_0x2cc786,_0x20242a=_0x22c313[0x0]||_0x1a59c8[_0xcb18a1(0x11b)];if(!_0x20242a)return console[_0xcb18a1(0xfe)](_0xcb18a1(0x106)),console[_0xcb18a1(0xfe)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0xcb18a1(0xfe)](_0xcb18a1(0x10d)),0x1;_0x1a59c8[_0xcb18a1(0x102)]&&(console[_0xcb18a1(0xfe)](_0xcb18a1(0x103)+_0x1a59c8['site']),console['error'](_0xcb18a1(0x108)+_0x20242a));const _0x4bcec1=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x20242a+_0xcb18a1(0x10a),()=>_0x144697[_0xcb18a1(0x119)][_0xcb18a1(0x114)](_0x20242a),{'verbose':_0x1a59c8[_0xcb18a1(0x102)]}),_0x462c34=_0x4bcec1[_0xcb18a1(0x118)];console[_0xcb18a1(0xfe)]('✔\x20Found\x20'+_0x462c34['length']+_0xcb18a1(0x10f)+(_0x462c34[_0xcb18a1(0x107)]!==0x1?'s':''));if(_0x1a59c8[_0xcb18a1(0x104)]||_0x1a59c8[_0xcb18a1(0x10b)])return await handleSDKOutput(_0x462c34,_0x1a59c8),0x0;return displayFieldsHumanReadable(_0x462c34,_0x20242a),0x0;}}function a39_0x1262(){const _0x535fd7=['listFields','1tCDJbT','20393004tpaSJw','8cAZFaz','data','segment','6742701zjAZDV','parentSegment','315516VzEOWs','10182370KyPQgR','error','segment:fields','List\x20available\x20fields\x20for\x20segmentation','2638628qXEKch','verbose','Site:\x20','json','description','Error:\x20Parent\x20segment\x20name\x20is\x20required','length','Parent\x20segment:\x20','9156582aYEbPu','\x27...','jsonl','name','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','3UWeQUh','\x20field','13bvjKBL','10YrvZHe','2195002sZXlXn','40tNwvVY'];a39_0x1262=function(){return _0x535fd7;};return a39_0x1262();}
@@ -1 +1 @@
1
- const a40_0x54fc86=a40_0x1d0e;(function(_0x2e76cb,_0x1c99a3){const _0x3ba57e=a40_0x1d0e,_0x4fff26=_0x2e76cb();while(!![]){try{const _0x992d5a=parseInt(_0x3ba57e(0x6d))/0x1+parseInt(_0x3ba57e(0x76))/0x2+-parseInt(_0x3ba57e(0xbb))/0x3*(-parseInt(_0x3ba57e(0x9c))/0x4)+parseInt(_0x3ba57e(0x6e))/0x5+-parseInt(_0x3ba57e(0x9e))/0x6*(parseInt(_0x3ba57e(0xb6))/0x7)+-parseInt(_0x3ba57e(0x78))/0x8+-parseInt(_0x3ba57e(0x80))/0x9;if(_0x992d5a===_0x1c99a3)break;else _0x4fff26['push'](_0x4fff26['shift']());}catch(_0x1f8dc9){_0x4fff26['push'](_0x4fff26['shift']());}}}(a40_0x2064,0x414af));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x416441 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x235494 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a40_0x2064(){const _0x487ebd=['no_parent','1052114bLGrcg','dirname','1219752gWqJIT','filter','yes','counts','hasChanges','files','description','parentName','1172475Dqwndv','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dryRun','journeys','\x20with\x20','\x20\x20🎯\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20new\x20files','dim','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Aborted.','targetDir','\x20=\x20','\x27...','data','red','absolutePath','length','activations','\x20unchanged\x20files','Site:\x20','content','message','pullSegments','name','\x20files?','diff','file','96332ERHoYW','type','222mVTrsy','parentSegment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','yellow','cwd','\x20\x20Target:\x20','Pulling\x20segments\x20from\x20\x27','\x0aChanges\x20to\x20\x27','\x20changed\x20files','errorCode','resourceName','✔\x20Pulled\x20','isNew','cyan','repeat','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segments','execute','utf-8','verbose','parent_segment','segment:pull','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','setPhase','85393wUliwN','journeyVersions','✔\x20All\x20files\x20are\x20up\x20to\x20date','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','45uWhgrL','\x20segments','segment','✔\x20Context\x20set:\x20','110454WTSEnO','18950iTCKQY','session','error','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','helpText','\x20files\x20to\x20','relativePath'];a40_0x2064=function(){return _0x487ebd;};return a40_0x2064();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x1d0e(_0x438ecf,_0x1e2dfa){_0x438ecf=_0x438ecf-0x6a;const _0x2064bf=a40_0x2064();let _0x1d0e41=_0x2064bf[_0x438ecf];return _0x1d0e41;}export class SegmentPullCommand extends BaseCommand{[a40_0x54fc86(0x98)]=a40_0x54fc86(0xb3);[a40_0x54fc86(0x7e)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x54fc86(0xaf)](_0xa7564a){const _0x1b3c9f=a40_0x54fc86,{options:_0x3aeadf,args:_0xd441,tdx:_0x3c07b6}=_0xa7564a,_0x2faea1=_0x3aeadf,_0xa08df3=await resolveTarget({'arg':_0xd441[0x0],'contextParent':_0x3aeadf[_0x1b3c9f(0x9f)],'cwd':process[_0x1b3c9f(0xa2)]()});if(!isSuccessfulResolution(_0xa08df3))return _0xa08df3[_0x1b3c9f(0xa7)]===_0x1b3c9f(0x75)?(console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xa1)](_0x1b3c9f(0xb4))),console[_0x1b3c9f(0x70)](_0x1b3c9f(0x86)),console[_0x1b3c9f(0x70)](_0x1b3c9f(0xba)),console[_0x1b3c9f(0x70)](_0x1b3c9f(0xad))):(console['error'](a40_0x416441[_0x1b3c9f(0x8f)]('Error:\x20'+_0xa08df3[_0x1b3c9f(0x96)]+'\x0a')),_0xa08df3[_0x1b3c9f(0x72)]&&console[_0x1b3c9f(0x70)](a40_0x416441['cyan'](_0xa08df3[_0x1b3c9f(0x72)]))),0x1;const _0xa6b8ae=_0xa08df3[_0x1b3c9f(0x7f)],_0x23bbc8=_0xa08df3[_0x1b3c9f(0x8b)],_0x1bf450=_0xa08df3[_0x1b3c9f(0x9d)]===_0x1b3c9f(0x9b)?_0xa08df3[_0x1b3c9f(0xa8)]:undefined;_0x2faea1[_0x1b3c9f(0xb1)]&&(console[_0x1b3c9f(0x70)](_0x1b3c9f(0x94)+_0x2faea1['site']),console[_0x1b3c9f(0x70)]('Parent\x20segment:\x20'+_0xa6b8ae),_0x1bf450&&console[_0x1b3c9f(0x70)]('Target\x20resource:\x20'+_0x1bf450));const _0x1f0d76=await withProgressSpinner(_0x1b3c9f(0xa4)+_0xa6b8ae+_0x1b3c9f(0x8d),_0x266852=>_0x3c07b6[_0x1b3c9f(0x6b)][_0x1b3c9f(0x97)](_0xa6b8ae,{'targetDir':_0x23bbc8,'targetResourceName':_0x1bf450,'verbose':_0x2faea1[_0x1b3c9f(0xb1)],'progress':{'update':_0x413164=>{const _0x275735=_0x1b3c9f;_0x266852[_0x275735(0xb5)](_0x413164),_0x2faea1[_0x275735(0xb1)]&&console['error']('\x20\x20'+_0x413164);}}}),{'verbose':_0x2faea1[_0x1b3c9f(0xb1)]}),_0x4a8e7e=_0x1f0d76[_0x1b3c9f(0x8e)];if(_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0xae)]===0x0&&_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0x83)]===0x0)return console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xa1)](_0x1b3c9f(0x89)+_0x4a8e7e[_0x1b3c9f(0x7f)]+'\x27')),0x0;const _0x1d202a=_0x4a8e7e[_0x1b3c9f(0x7d)][_0x1b3c9f(0x79)](_0x3570bc=>_0x3570bc[_0x1b3c9f(0xaa)]),_0xef6256=_0x4a8e7e[_0x1b3c9f(0x7d)]['filter'](_0x529555=>!_0x529555[_0x1b3c9f(0xaa)]&&_0x529555[_0x1b3c9f(0x7c)]),_0x15b9d4=_0x4a8e7e[_0x1b3c9f(0x7d)][_0x1b3c9f(0x79)](_0x51f556=>!_0x51f556[_0x1b3c9f(0xaa)]&&!_0x51f556[_0x1b3c9f(0x7c)]);console[_0x1b3c9f(0x70)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4a8e7e['parentName']+'\x27:'),console['error'](_0x1b3c9f(0x85)+a40_0x416441['cyan'](_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0xae)]+_0x1b3c9f(0x6a))+_0x1b3c9f(0x84)+a40_0x416441[_0x1b3c9f(0xab)](_0x4a8e7e['counts'][_0x1b3c9f(0x92)]+'\x20activations'));if(_0x4a8e7e['counts'][_0x1b3c9f(0x83)]>0x0){const _0x3743ae=_0x4a8e7e[_0x1b3c9f(0x7b)]['journeyVersions']>_0x4a8e7e[_0x1b3c9f(0x7b)]['journeys']?'\x20('+_0x4a8e7e[_0x1b3c9f(0x7b)][_0x1b3c9f(0xb7)]+'\x20versions)':'';console[_0x1b3c9f(0x70)]('\x20\x20🗺️\x20\x20'+a40_0x416441['cyan'](_0x4a8e7e['counts'][_0x1b3c9f(0x83)]+'\x20journeys')+a40_0x416441[_0x1b3c9f(0x88)](_0x3743ae));}console[_0x1b3c9f(0x70)]('\x20\x20'+a40_0x416441[_0x1b3c9f(0xb9)]('+\x20'+_0x1d202a[_0x1b3c9f(0x91)]+_0x1b3c9f(0x87))),console[_0x1b3c9f(0x70)]('\x20\x20'+a40_0x416441[_0x1b3c9f(0xa1)]('~\x20'+_0xef6256['length']+_0x1b3c9f(0xa6))),console['error']('\x20\x20'+a40_0x416441[_0x1b3c9f(0x88)]('=\x20'+_0x15b9d4[_0x1b3c9f(0x91)]+_0x1b3c9f(0x93))),console[_0x1b3c9f(0x70)](_0x1b3c9f(0xa3)+a40_0x416441['cyan'](_0x4a8e7e[_0x1b3c9f(0x8b)])+'\x0a');if(_0xef6256[_0x1b3c9f(0x91)]>0x0)for(const _0x58fbe1 of _0xef6256){console[_0x1b3c9f(0x70)](_0x1b3c9f(0xa5)+_0x58fbe1[_0x1b3c9f(0x74)]+'\x27:'),console['error']('─'[_0x1b3c9f(0xac)](0x3c)),console[_0x1b3c9f(0x70)](_0x58fbe1[_0x1b3c9f(0x9a)]),console[_0x1b3c9f(0x70)]('─'[_0x1b3c9f(0xac)](0x3c));}if(_0x2faea1[_0x1b3c9f(0x82)])return console['error'](a40_0x416441['yellow'](_0x1b3c9f(0x71))),0x0;if(_0x1d202a[_0x1b3c9f(0x91)]===0x0&&_0xef6256[_0x1b3c9f(0x91)]===0x0)return console['error'](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0xb8))),saveSessionContext({'parent_segment':_0x4a8e7e[_0x1b3c9f(0x7f)]},_0x2faea1[_0x1b3c9f(0x6f)]),console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0x6c)+a40_0x416441[_0x1b3c9f(0x88)]('parent_segment')+_0x1b3c9f(0x8c)+a40_0x416441['cyan'](_0x4a8e7e[_0x1b3c9f(0x7f)]))),0x0;if(!_0x2faea1[_0x1b3c9f(0x7a)]){if(!isInteractive())return console['error'](a40_0x416441['red']('\x0aError:'),_0x1b3c9f(0xa0)),console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0x88)](_0x1b3c9f(0x81))),0x1;const _0x3203a3=await confirmKey('Write\x20'+(_0x1d202a[_0x1b3c9f(0x91)]+_0xef6256[_0x1b3c9f(0x91)])+_0x1b3c9f(0x99));if(!_0x3203a3)return console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xa1)](_0x1b3c9f(0x8a)),'-\x20no\x20files\x20written'),0x1;}for(const _0x4d2572 of _0x4a8e7e[_0x1b3c9f(0x7d)]){if(_0x4d2572[_0x1b3c9f(0xaa)]||_0x4d2572['hasChanges']){const _0xb368ed=a40_0x235494[_0x1b3c9f(0x77)](_0x4d2572['absolutePath']);!existsSync(_0xb368ed)&&mkdirSync(_0xb368ed,{'recursive':!![]}),writeFileSync(_0x4d2572[_0x1b3c9f(0x90)],_0x4d2572[_0x1b3c9f(0x95)],_0x1b3c9f(0xb0));}}return console[_0x1b3c9f(0x70)](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0xa9)+(_0x1d202a[_0x1b3c9f(0x91)]+_0xef6256[_0x1b3c9f(0x91)])+_0x1b3c9f(0x73)+_0x4a8e7e[_0x1b3c9f(0x8b)])),saveSessionContext({'parent_segment':_0x4a8e7e[_0x1b3c9f(0x7f)]},_0x2faea1[_0x1b3c9f(0x6f)]),console['error'](a40_0x416441[_0x1b3c9f(0xb9)](_0x1b3c9f(0x6c)+a40_0x416441[_0x1b3c9f(0x88)](_0x1b3c9f(0xb2))+_0x1b3c9f(0x8c)+a40_0x416441[_0x1b3c9f(0xab)](_0x4a8e7e[_0x1b3c9f(0x7f)]))),0x0;}}
1
+ const a40_0x117a46=a40_0x429d;(function(_0x52f906,_0x28a6e0){const _0x59127c=a40_0x429d,_0x53e8dc=_0x52f906();while(!![]){try{const _0x3d10de=-parseInt(_0x59127c(0x1d3))/0x1*(parseInt(_0x59127c(0x197))/0x2)+parseInt(_0x59127c(0x1bb))/0x3*(-parseInt(_0x59127c(0x198))/0x4)+-parseInt(_0x59127c(0x1c1))/0x5+parseInt(_0x59127c(0x19f))/0x6+-parseInt(_0x59127c(0x19c))/0x7+-parseInt(_0x59127c(0x1d6))/0x8+parseInt(_0x59127c(0x196))/0x9;if(_0x3d10de===_0x28a6e0)break;else _0x53e8dc['push'](_0x53e8dc['shift']());}catch(_0x296ec5){_0x53e8dc['push'](_0x53e8dc['shift']());}}}(a40_0x586b,0x4a094));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x4747fd from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x586b(){const _0x14de5b=['targetDir','activations','23xmQpYS','journeyVersions','\x20files\x20to\x20','3486824DcRuUC','\x0aChanges\x20to\x20\x27','name','\x20=\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','data','green','repeat','verbose','\x20versions)','dim','content','message','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aError:','cyan','filter','18239742NNTHyL','49190cXyNnf','462764DGPafY','segments','yellow','resourceName','3166513IeNNqS','files','✔\x20All\x20files\x20are\x20up\x20to\x20date','1391832PxnKqv','execute','Write\x20','session','error','absolutePath','isNew','length','Error:\x20','\x20files?','\x0aPull\x20summary\x20for\x20\x27','\x20changed\x20files','\x27...','errorCode','\x20\x20Target:\x20','Site:\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)','\x20segments','segment:pull','utf-8','journeys','red','✔\x20Pulled\x20','\x20new\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','hasChanges','\x20unchanged\x20files','Aborted.','9qZFhYL','parentName','site','helpText','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','771940NktJzl','\x20\x20🗺️\x20\x20','pullSegments','counts','file','setPhase','segment','no_parent','Pulling\x20segments\x20from\x20\x27','\x20journeys','\x20with\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Target\x20resource:\x20','dirname','Parent\x20segment:\x20','✔\x20Context\x20set:\x20'];a40_0x586b=function(){return _0x14de5b;};return a40_0x586b();}import a40_0x39d397 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x429d(_0x4d615e,_0x42da2b){_0x4d615e=_0x4d615e-0x188;const _0x586bf8=a40_0x586b();let _0x429d0c=_0x586bf8[_0x4d615e];return _0x429d0c;}export class SegmentPullCommand extends BaseCommand{[a40_0x117a46(0x1d8)]=a40_0x117a46(0x1b1);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a40_0x117a46(0x1a0)](_0x2a761a){const _0xd69eed=a40_0x117a46,{options:_0x2e5f2f,args:_0x28d015,tdx:_0x2283bb}=_0x2a761a,_0xba23b4=_0x2e5f2f,_0x26dea3=await resolveTarget({'arg':_0x28d015[0x0],'contextParent':_0x2e5f2f['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x26dea3))return _0x26dea3[_0xd69eed(0x1ac)]===_0xd69eed(0x1c8)?(console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x19a)](_0xd69eed(0x1bf))),console['error'](_0xd69eed(0x1af)),console[_0xd69eed(0x1a3)](_0xd69eed(0x1b7)),console[_0xd69eed(0x1a3)](_0xd69eed(0x1cc))):(console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x1b4)](_0xd69eed(0x1a7)+_0x26dea3[_0xd69eed(0x191)]+'\x0a')),_0x26dea3['helpText']&&console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x194)](_0x26dea3[_0xd69eed(0x1be)]))),0x1;const _0x15ccc2=_0x26dea3['parentName'],_0x50aaf0=_0x26dea3[_0xd69eed(0x1d1)],_0xc9ec78=_0x26dea3['type']===_0xd69eed(0x1c5)?_0x26dea3[_0xd69eed(0x19b)]:undefined;_0xba23b4[_0xd69eed(0x18d)]&&(console[_0xd69eed(0x1a3)](_0xd69eed(0x1ae)+_0xba23b4[_0xd69eed(0x1bd)]),console[_0xd69eed(0x1a3)](_0xd69eed(0x1cf)+_0x15ccc2),_0xc9ec78&&console[_0xd69eed(0x1a3)](_0xd69eed(0x1cd)+_0xc9ec78));const _0x30dc05=await withProgressSpinner(_0xd69eed(0x1c9)+_0x15ccc2+_0xd69eed(0x1ab),_0xa767b7=>_0x2283bb[_0xd69eed(0x1c7)][_0xd69eed(0x1c3)](_0x15ccc2,{'targetDir':_0x50aaf0,'targetResourceName':_0xc9ec78,'verbose':_0xba23b4[_0xd69eed(0x18d)],'progress':{'update':_0x11558e=>{const _0x5eb43b=_0xd69eed;_0xa767b7[_0x5eb43b(0x1c6)](_0x11558e),_0xba23b4['verbose']&&console[_0x5eb43b(0x1a3)]('\x20\x20'+_0x11558e);}}}),{'verbose':_0xba23b4[_0xd69eed(0x18d)]}),_0x239bd4=_0x30dc05[_0xd69eed(0x18a)];if(_0x239bd4[_0xd69eed(0x1c4)]['segments']===0x0&&_0x239bd4['counts'][_0xd69eed(0x1b3)]===0x0)return console['error'](a40_0x4747fd[_0xd69eed(0x19a)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x239bd4['parentName']+'\x27')),0x0;const _0x50e508=_0x239bd4[_0xd69eed(0x19d)][_0xd69eed(0x195)](_0x5e1520=>_0x5e1520['isNew']),_0xc69de8=_0x239bd4[_0xd69eed(0x19d)][_0xd69eed(0x195)](_0x4f37b0=>!_0x4f37b0[_0xd69eed(0x1a5)]&&_0x4f37b0[_0xd69eed(0x1b8)]),_0x3d7f54=_0x239bd4['files'][_0xd69eed(0x195)](_0x44b79c=>!_0x44b79c[_0xd69eed(0x1a5)]&&!_0x44b79c[_0xd69eed(0x1b8)]);console['error'](_0xd69eed(0x1a9)+_0x239bd4[_0xd69eed(0x1bc)]+'\x27:'),console[_0xd69eed(0x1a3)]('\x20\x20🎯\x20'+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x199)]+_0xd69eed(0x1b0))+_0xd69eed(0x1cb)+a40_0x4747fd['cyan'](_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x1d2)]+'\x20activations'));if(_0x239bd4[_0xd69eed(0x1c4)]['journeys']>0x0){const _0x550935=_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x1d4)]>_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x1b3)]?'\x20('+_0x239bd4[_0xd69eed(0x1c4)]['journeyVersions']+_0xd69eed(0x18e):'';console['error'](_0xd69eed(0x1c2)+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4[_0xd69eed(0x1c4)][_0xd69eed(0x1b3)]+_0xd69eed(0x1ca))+a40_0x4747fd[_0xd69eed(0x18f)](_0x550935));}console['error']('\x20\x20'+a40_0x4747fd[_0xd69eed(0x18b)]('+\x20'+_0x50e508[_0xd69eed(0x1a6)]+_0xd69eed(0x1b6))),console['error']('\x20\x20'+a40_0x4747fd['yellow']('~\x20'+_0xc69de8[_0xd69eed(0x1a6)]+_0xd69eed(0x1aa))),console['error']('\x20\x20'+a40_0x4747fd[_0xd69eed(0x18f)]('=\x20'+_0x3d7f54[_0xd69eed(0x1a6)]+_0xd69eed(0x1b9))),console[_0xd69eed(0x1a3)](_0xd69eed(0x1ad)+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4['targetDir'])+'\x0a');if(_0xc69de8[_0xd69eed(0x1a6)]>0x0)for(const _0x28a029 of _0xc69de8){console['error'](_0xd69eed(0x1d7)+_0x28a029['relativePath']+'\x27:'),console[_0xd69eed(0x1a3)]('─'[_0xd69eed(0x18c)](0x3c)),console[_0xd69eed(0x1a3)](_0x28a029['diff']),console[_0xd69eed(0x1a3)]('─'[_0xd69eed(0x18c)](0x3c));}if(_0xba23b4['dryRun'])return console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x19a)](_0xd69eed(0x1c0))),0x0;if(_0x50e508[_0xd69eed(0x1a6)]===0x0&&_0xc69de8[_0xd69eed(0x1a6)]===0x0)return console[_0xd69eed(0x1a3)](a40_0x4747fd['green'](_0xd69eed(0x19e))),saveSessionContext({'parent_segment':_0x239bd4['parentName']},_0xba23b4['session']),console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x18b)]('✔\x20Context\x20set:\x20'+a40_0x4747fd[_0xd69eed(0x18f)]('parent_segment')+_0xd69eed(0x188)+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4[_0xd69eed(0x1bc)]))),0x0;if(!_0xba23b4['yes']){if(!isInteractive())return console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x1b4)](_0xd69eed(0x193)),_0xd69eed(0x192)),console['error'](a40_0x4747fd[_0xd69eed(0x18f)](_0xd69eed(0x189))),0x1;const _0x3f1268=await confirmKey(_0xd69eed(0x1a1)+(_0x50e508[_0xd69eed(0x1a6)]+_0xc69de8[_0xd69eed(0x1a6)])+_0xd69eed(0x1a8));if(!_0x3f1268)return console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x19a)](_0xd69eed(0x1ba)),'-\x20no\x20files\x20written'),0x1;}for(const _0x458446 of _0x239bd4[_0xd69eed(0x19d)]){if(_0x458446[_0xd69eed(0x1a5)]||_0x458446['hasChanges']){const _0x1578da=a40_0x39d397[_0xd69eed(0x1ce)](_0x458446[_0xd69eed(0x1a4)]);!existsSync(_0x1578da)&&mkdirSync(_0x1578da,{'recursive':!![]}),writeFileSync(_0x458446[_0xd69eed(0x1a4)],_0x458446[_0xd69eed(0x190)],_0xd69eed(0x1b2));}}return console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x18b)](_0xd69eed(0x1b5)+(_0x50e508[_0xd69eed(0x1a6)]+_0xc69de8[_0xd69eed(0x1a6)])+_0xd69eed(0x1d5)+_0x239bd4[_0xd69eed(0x1d1)])),saveSessionContext({'parent_segment':_0x239bd4[_0xd69eed(0x1bc)]},_0xba23b4[_0xd69eed(0x1a2)]),console[_0xd69eed(0x1a3)](a40_0x4747fd[_0xd69eed(0x18b)](_0xd69eed(0x1d0)+a40_0x4747fd[_0xd69eed(0x18f)]('parent_segment')+'\x20=\x20'+a40_0x4747fd[_0xd69eed(0x194)](_0x239bd4['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x448629=a41_0xf4ce;(function(_0x568d4f,_0x1beaa8){const _0x2c3bae=a41_0xf4ce,_0x3649ad=_0x568d4f();while(!![]){try{const _0x37999a=parseInt(_0x2c3bae(0x211))/0x1*(parseInt(_0x2c3bae(0x251))/0x2)+-parseInt(_0x2c3bae(0x247))/0x3*(parseInt(_0x2c3bae(0x24f))/0x4)+parseInt(_0x2c3bae(0x231))/0x5*(-parseInt(_0x2c3bae(0x263))/0x6)+parseInt(_0x2c3bae(0x1f5))/0x7*(-parseInt(_0x2c3bae(0x284))/0x8)+-parseInt(_0x2c3bae(0x257))/0x9*(parseInt(_0x2c3bae(0x269))/0xa)+-parseInt(_0x2c3bae(0x23d))/0xb*(-parseInt(_0x2c3bae(0x259))/0xc)+parseInt(_0x2c3bae(0x21a))/0xd;if(_0x37999a===_0x1beaa8)break;else _0x3649ad['push'](_0x3649ad['shift']());}catch(_0x323106){_0x3649ad['push'](_0x3649ad['shift']());}}}(a41_0x5b0b,0xbcf0d));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a41_0x5b0b(){const _0x905760=['Preparing\x20journeys...','.yml','Error:\x20','changed','\x20\x20\x20\x20','delete','helpText','toCreate','state','existingJourney','journey','scopedFolderPath','\x0aPush\x20summary\x20for\x20\x27','8710232SZMUbB','isNew','listFolders','\x20\x20Activations:','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','created','activations','paused','\x20\x20Source:\x20','\x20to\x20update','Source\x20directory:\x20','listSegments','existingSegment','dim','journeyBundleName','createdSegmentIds','7mGxcnn','New\x20segment:','Scoped\x20to\x20folder:\x20','cyan','toUpdate','getJourney','createdAt','\x20deleted','New\x20journey:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20new','unchanged','description','targetDir','No\x20','segments','length','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','get','Parent\x20segment:\x20','green','Changes\x20to\x20journey:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','/sb/da/esr','attributes','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','54PGXToT','\x20to\x20create','\x20changed','(Journey\x20will\x20be\x20deleted)','nameToType','diff','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/app/ps/','\x20\x20Activations:\x20','43726748ccHEHC','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','new','push','yes','journeyId','parentName','\x27...','\x20\x20🗺️\x20\x20Journeys:','join','\x20updated','errorCode','then','resolveParentId','listJourneysWithDetailsFromParentSegment','user','yamlConfig','\x20\x20Journeys:\x20','red','data','/e/','Delete\x20segment:','nameToId','4091540nlorRS','verbose','set','\x20activations]','📁\x20','dryRun','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','endsWith','\x20\x20Segments:\x20','idToName','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','626747soxpxK','folderId','all','\x20to\x20delete','getParent','segment','Delete\x20journey:','execute','yellow','type','31881qXnUms','journeysOnly','folders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','segment:push','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','484ojgbsI','message','48696YdOUWu','filePath','toDelete','\x20unchanged','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','blue','10089kPlNtq','repeat','120YbIpEi','Resolving\x20parent\x20segment\x20\x27','filter','map','parent_name','updated','connection','Fetching\x20connections\x20for\x20name\x20resolution...','/j/da/je','Aborted.','6oPDeOe','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','results','add','\x20\x20📊\x20Segments:','file','11430tTSkkh','journeyBundleId','toString','list','journeys','listActivations','versionNumber','isScoped','\x0a✔\x20Push\x20complete','parentFolder','folderPath','.yaml','error','site'];a41_0x5b0b=function(){return _0x905760;};return a41_0x5b0b();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x3987b6 from'chalk';function a41_0xf4ce(_0x4f41b3,_0x388cb2){_0x4f41b3=_0x4f41b3-0x1ea;const _0x5b0bc5=a41_0x5b0b();let _0xf4ce16=_0x5b0bc5[_0x4f41b3];return _0xf4ce16;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a41_0x448629(0x24b);[a41_0x448629(0x201)]=a41_0x448629(0x23c);async[a41_0x448629(0x244)](_0x1a56a9){const _0x3c94bc=a41_0x448629,{options:_0x342174,args:_0x205784,tdx:_0x2a0e6e}=_0x1a56a9,_0x15bfcf=_0x342174,_0x37a25b=await resolveTarget({'arg':_0x205784[0x0],'contextParent':_0x342174['parentSegment'],'cwd':process[_0x3c94bc(0x24c)]()});if(!isSuccessfulResolution(_0x37a25b))return _0x37a25b[_0x3c94bc(0x225)]==='no_parent'?(console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x255))),console['error'](_0x3c94bc(0x288)),console[_0x3c94bc(0x275)](_0x3c94bc(0x24a)),console[_0x3c94bc(0x275)](_0x3c94bc(0x24d))):(console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x279)+_0x37a25b[_0x3c94bc(0x250)]+'\x0a')),_0x37a25b[_0x3c94bc(0x27d)]&&console['error'](a41_0x3987b6[_0x3c94bc(0x1f8)](_0x37a25b[_0x3c94bc(0x27d)]))),0x1;if(_0x37a25b[_0x3c94bc(0x246)]===_0x3c94bc(0x25d))return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)]('Error:\x20Directory\x20not\x20found:\x20'+_0x37a25b['targetDir']+'\x0a')),console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x1f8)](_0x3c94bc(0x217))),0x1;const _0x1c5f2e=_0x37a25b[_0x3c94bc(0x220)],_0x168548=_0x37a25b[_0x3c94bc(0x202)],_0x354afb=_0x37a25b[_0x3c94bc(0x246)]===_0x3c94bc(0x268)?_0x37a25b[_0x3c94bc(0x252)]:undefined,_0x24afb6=getScopedDetails(_0x37a25b),_0x47e976=_0x24afb6?.[_0x3c94bc(0x270)]??![],_0x1c1aff=_0x24afb6?.[_0x3c94bc(0x282)]??'';if(!existsSync(_0x168548))return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x20e)+_0x168548+'\x0a')),console[_0x3c94bc(0x275)](a41_0x3987b6['cyan'](_0x3c94bc(0x217))),0x1;_0x15bfcf[_0x3c94bc(0x232)]&&(console[_0x3c94bc(0x275)]('Site:\x20'+_0x15bfcf[_0x3c94bc(0x276)]),console[_0x3c94bc(0x275)](_0x3c94bc(0x208)+_0x1c5f2e),console['error'](_0x3c94bc(0x1ef)+_0x168548),_0x47e976&&console[_0x3c94bc(0x275)](_0x3c94bc(0x1f7)+_0x1c1aff));const _0x2fe6da=await withSpinner(_0x3c94bc(0x25a)+_0x1c5f2e+_0x3c94bc(0x221),()=>_0x2a0e6e[_0x3c94bc(0x242)][_0x3c94bc(0x227)](_0x1c5f2e),{'verbose':_0x15bfcf[_0x3c94bc(0x232)]}),_0x314481=_0x2fe6da['data'],{parentSegmentResult:_0x304b2e,segmentsResult:_0x323306,foldersResult:_0x1646da,journeysWithDetailsResult:_0x17d081,userMaps:_0xf69fd1}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0xe47184=_0x3c94bc,[_0x477fea,_0x43ddc1,_0x342a7c,_0x5d10c8,_0x4d5c2b]=await Promise[_0xe47184(0x23f)]([_0x2a0e6e[_0xe47184(0x242)][_0xe47184(0x241)](_0x314481),_0x2a0e6e['segment'][_0xe47184(0x1f0)](_0x314481),_0x2a0e6e[_0xe47184(0x242)][_0xe47184(0x286)](_0x314481),_0x2a0e6e[_0xe47184(0x281)][_0xe47184(0x228)](_0x314481,{'includeAllVersions':!![]}),_0x2a0e6e[_0xe47184(0x229)]['buildUserMaps']()]);return{'parentSegmentResult':_0x477fea,'segmentsResult':_0x43ddc1,'foldersResult':_0x342a7c,'journeysWithDetailsResult':_0x5d10c8,'userMaps':_0x4d5c2b};},{'verbose':_0x15bfcf[_0x3c94bc(0x232)]})['then'](_0x44a655=>_0x44a655[_0x3c94bc(0x22d)]),_0x2632da=_0x304b2e,_0x291903=extractRootFolderId(_0x2632da),_0x2b0c7a=_0x323306,_0x5d78b8=_0x1646da,{journeys:_0x16b065,activationStepsById:_0x5e00f1}=_0x17d081,_0x5a1473=new Map(_0x16b065[_0x3c94bc(0x25c)](_0x5e5a1c=>[_0x5e5a1c['id'],_0x5e5a1c])),_0x177656=_0x16b065[_0x3c94bc(0x25c)](_0x358327=>({'id':_0x358327['id'],'name':_0x358327['attributes']['name'],'journeyBundleName':_0x358327['attributes']['journeyBundleName']||'','journeyBundleId':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x26a)]||'','versionNumber':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x26f)],'description':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x201)],'state':_0x358327['attributes'][_0x3c94bc(0x27f)],'paused':_0x358327[_0x3c94bc(0x20d)][_0x3c94bc(0x1ec)],'audienceId':_0x358327[_0x3c94bc(0x20d)]['audienceId'],'folderId':_0x358327['relationships']?.[_0x3c94bc(0x272)]?.[_0x3c94bc(0x22d)]?.['id'],'createdAt':_0x358327['attributes'][_0x3c94bc(0x1fb)],'updatedAt':_0x358327['attributes']['updatedAt']})),{emailToId:_0x130ce2,idToEmail:_0x575f61}=_0xf69fd1,_0x1e8aaa=await withSpinner(_0x3c94bc(0x260),async()=>{const _0x1dd740=_0x3c94bc,_0x1ae817=await _0x2a0e6e[_0x1dd740(0x25f)][_0x1dd740(0x26c)]();return buildConnectionMaps(_0x1ae817);},{'verbose':_0x15bfcf[_0x3c94bc(0x232)]})[_0x3c94bc(0x226)](_0x45c244=>_0x45c244[_0x3c94bc(0x22d)]),_0x393dce=_0x1e8aaa[_0x3c94bc(0x230)],_0x3a3951=_0x1e8aaa[_0x3c94bc(0x23a)],_0x490b46=_0x1e8aaa[_0x3c94bc(0x215)],_0x17372={'emailToIdMap':_0x130ce2,'connectionNameToIdMap':_0x393dce,'connectionNameToTypeMap':_0x490b46,'getSchema':_0x339395=>_0x2a0e6e[_0x3c94bc(0x25f)]['getOutputSchemaWithCache'](_0x339395)};let {pathToId:_0x223973,idToPath:_0x2cf7f6}=buildFolderMaps(_0x5d78b8);const _0xc98928=buildSegmentLookupMap(_0x2b0c7a,_0x2cf7f6),_0x50086f=buildSegmentNameToIdMap(_0x2b0c7a),_0x2856ea=buildJourneyBundleLookupMap(_0x177656,_0x2cf7f6);let _0x4f8ee9;if(_0x354afb){if(!_0x354afb[_0x3c94bc(0x238)](_0x3c94bc(0x278))&&!_0x354afb['endsWith'](_0x3c94bc(0x274)))return console[_0x3c94bc(0x275)](a41_0x3987b6['red'](_0x3c94bc(0x20f)+_0x354afb+'\x0a')),0x1;_0x4f8ee9=[_0x354afb];}else _0x4f8ee9=findYamlFiles(_0x168548);if(_0x4f8ee9[_0x3c94bc(0x205)]===0x0)return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x237)+_0x168548+'\x0a')),console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x1f8)](_0x3c94bc(0x21b))),0x1;let _0x2b1e9b,_0x39401e;try{const _0xa809b1=parseAndClassifyYamlFiles(_0x4f8ee9,_0x168548,{'skipSegments':_0x15bfcf[_0x3c94bc(0x248)]});_0x2b1e9b=_0xa809b1[_0x3c94bc(0x204)],_0x39401e=_0xa809b1[_0x3c94bc(0x26d)];const _0x25990a=validateParsedFiles(_0xa809b1,_0x168548);if(_0x25990a[_0x3c94bc(0x205)]>0x0)return console['error'](a41_0x3987b6[_0x3c94bc(0x22c)]('\x0aValidation\x20failed:')),console[_0x3c94bc(0x275)](formatValidationErrors(_0x25990a)),console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x212bcb){return console['error'](a41_0x3987b6['red']('Error\x20parsing\x20YAML:\x20'+(_0x212bcb instanceof Error?_0x212bcb[_0x3c94bc(0x250)]:_0x212bcb))),0x1;}if(_0x2b1e9b[_0x3c94bc(0x205)]===0x0&&_0x39401e[_0x3c94bc(0x205)]===0x0){const _0x1f03c3=_0x15bfcf[_0x3c94bc(0x248)]?'journey':'segment\x20or\x20journey';return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x203)+_0x1f03c3+'\x20YAML\x20files\x20found')),0x0;}const _0x23a43a=new Map();_0x2b0c7a['length']>0x0&&!_0x15bfcf['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x2b0c7a,async _0x189684=>{const _0x155de4=a41_0xf4ce,_0x2e7c72=await _0x2a0e6e[_0x155de4(0x242)][_0x155de4(0x26e)](_0x314481,_0x189684['id']);_0x23a43a[_0x155de4(0x233)](_0x189684['id'],_0x2e7c72);});},{'verbose':_0x15bfcf[_0x3c94bc(0x232)]});const {segmentFiles:_0x1ab88c,foldersToCreate:_0x2d008e}=await prepareSegmentFiles(_0x2b1e9b,{'segmentByFolderAndName':_0xc98928,'activationsBySegmentId':_0x23a43a,'folderPathToId':_0x223973,'idToEmailMap':_0x575f61,'connectionIdToNameMap':_0x3a3951},_0x17372,_0x47e976,_0x1c1aff),_0x2f4259=_0x354afb?[]:findSegmentsToDelete(_0x2b0c7a,_0x2b1e9b[_0x3c94bc(0x25c)](({yamlConfig:_0x37fb97,folderPath:_0x3b2b5c})=>({'yamlConfig':_0x37fb97,'folderPath':resolveTDFolderPath(_0x3b2b5c,_0x47e976,_0x1c1aff)})),_0x2cf7f6,_0x1c1aff,_0x47e976),{journeyFiles:_0x5367f0,foldersToCreate:_0x532cb7}=await withProgressSpinner(_0x3c94bc(0x277),async _0x3db147=>prepareJourneyFiles(_0x39401e,{'fetchJourney':async _0x229a51=>_0x2a0e6e[_0x3c94bc(0x281)][_0x3c94bc(0x1fa)](_0x229a51[_0x3c94bc(0x21f)]),'journeyBundlesByFolderAndName':_0x2856ea,'folderPathToId':_0x223973,'idToEmailMap':_0x575f61,'connectionIdToNameMap':_0x3a3951,'existingSegments':_0x2b0c7a,'parentId':_0x314481,'deps':_0x2a0e6e,'progress':{'update':_0x452a56=>{const _0x499c94=_0x3c94bc;_0x3db147['setPhase'](_0x452a56),_0x15bfcf[_0x499c94(0x232)]&&console[_0x499c94(0x275)]('\x20\x20'+_0x452a56);}},'journeyById':_0x5a1473,'activationStepsById':_0x5e00f1},_0x47e976,_0x1c1aff),{'verbose':_0x15bfcf[_0x3c94bc(0x232)]})[_0x3c94bc(0x226)](_0x399126=>_0x399126[_0x3c94bc(0x22d)]);for(const _0x3e4d25 of _0x532cb7){_0x2d008e[_0x3c94bc(0x266)](_0x3e4d25);}const _0x28d632=_0x354afb?[]:findJourneysToDelete(_0x177656,_0x39401e[_0x3c94bc(0x25c)](({yamlConfig:_0x3eedd4,folderPath:_0x4e0346})=>({'yamlConfig':_0x3eedd4,'folderPath':resolveTDFolderPath(_0x4e0346,_0x47e976,_0x1c1aff)})),_0x2cf7f6,_0x1c1aff,_0x47e976),_0x10afff=calculatePushStats(_0x1ab88c,_0x5367f0,_0x2d008e,_0x2f4259,_0x28d632,!!_0x15bfcf[_0x3c94bc(0x27c)],!!_0x15bfcf[_0x3c94bc(0x248)]),_0x1b0e43=_0x10afff[_0x3c94bc(0x204)][_0x3c94bc(0x21c)],_0x1a727a=_0x10afff[_0x3c94bc(0x204)]['changed'],_0x1a877c=_0x10afff[_0x3c94bc(0x204)][_0x3c94bc(0x200)],_0x2e814f=_0x10afff[_0x3c94bc(0x204)]['toDelete'],_0x99625e=_0x10afff[_0x3c94bc(0x249)][_0x3c94bc(0x27e)],_0x2bdd5a=_0x10afff['journeys'][_0x3c94bc(0x21c)],_0x47d8be=_0x10afff['journeys'][_0x3c94bc(0x27a)],_0x1e6e67=_0x10afff[_0x3c94bc(0x26d)]['unchanged'],_0x48ac05=_0x10afff[_0x3c94bc(0x26d)][_0x3c94bc(0x253)],_0x1d1d7a=_0x10afff[_0x3c94bc(0x1eb)][_0x3c94bc(0x23f)],_0x4f2086=_0x10afff[_0x3c94bc(0x1eb)][_0x3c94bc(0x27e)],_0x2c44bc=_0x10afff[_0x3c94bc(0x1eb)][_0x3c94bc(0x1f9)],_0x31ff9f=_0x10afff[_0x3c94bc(0x1eb)]['toDelete'];console[_0x3c94bc(0x275)](_0x3c94bc(0x283)+_0x1c5f2e+'\x27:');_0x99625e[_0x3c94bc(0x205)]>0x0&&console[_0x3c94bc(0x275)]('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x256)](_0x3c94bc(0x235)+_0x99625e[_0x3c94bc(0x205)]+'\x20folders\x20to\x20create'));if(!_0x15bfcf[_0x3c94bc(0x248)]){console['error'](_0x3c94bc(0x267)),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x209)]('+\x20'+_0x1b0e43['length']+'\x20new')),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x245)]('~\x20'+_0x1a727a[_0x3c94bc(0x205)]+_0x3c94bc(0x213)));if(_0x2e814f['length']>0x0)console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x22c)]('-\x20'+_0x2e814f[_0x3c94bc(0x205)]+_0x3c94bc(0x240)));else _0x2f4259[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x27c)]&&console['error'](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x1f2)](_0x2f4259['length']+_0x3c94bc(0x23b)));console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x1f2)]('=\x20'+_0x1a877c[_0x3c94bc(0x205)]+_0x3c94bc(0x254)));}if(_0x5367f0[_0x3c94bc(0x205)]>0x0||_0x28d632['length']>0x0){console[_0x3c94bc(0x275)](_0x3c94bc(0x222)),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x209)]('+\x20'+_0x2bdd5a[_0x3c94bc(0x205)]+_0x3c94bc(0x1ff))),console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x245)]('~\x20'+_0x47d8be[_0x3c94bc(0x205)]+_0x3c94bc(0x213)));if(_0x48ac05[_0x3c94bc(0x205)]>0x0)console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x22c)]('-\x20'+_0x48ac05[_0x3c94bc(0x205)]+_0x3c94bc(0x240)));else _0x28d632['length']>0x0&&!_0x15bfcf['delete']&&console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x1f2)](_0x28d632[_0x3c94bc(0x205)]+_0x3c94bc(0x23b)));console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x1f2)]('=\x20'+_0x1e6e67[_0x3c94bc(0x205)]+'\x20unchanged'));}_0x1d1d7a[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)]&&(console[_0x3c94bc(0x275)](''),console[_0x3c94bc(0x275)](_0x3c94bc(0x287)),_0x4f2086[_0x3c94bc(0x205)]>0x0&&console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x209)]('+\x20'+_0x4f2086[_0x3c94bc(0x205)]+_0x3c94bc(0x212))),_0x2c44bc['length']>0x0&&console[_0x3c94bc(0x275)](_0x3c94bc(0x27b)+a41_0x3987b6[_0x3c94bc(0x245)]('~\x20'+_0x2c44bc[_0x3c94bc(0x205)]+_0x3c94bc(0x1ee))),_0x31ff9f[_0x3c94bc(0x205)]>0x0&&console[_0x3c94bc(0x275)]('\x20\x20\x20\x20'+a41_0x3987b6[_0x3c94bc(0x22c)]('-\x20'+_0x31ff9f['length']+'\x20to\x20delete')));console[_0x3c94bc(0x275)](_0x3c94bc(0x1ed)+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x168548)+'\x0a');if(_0x99625e[_0x3c94bc(0x205)]>0x0){console[_0x3c94bc(0x275)]('Folders\x20to\x20create:');for(const _0x244f3e of _0x99625e){console['error']('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x256)]('+')+'\x20'+_0x244f3e);}console[_0x3c94bc(0x275)]('');}if(_0x1b0e43['length']>0x0&&!_0x15bfcf[_0x3c94bc(0x248)])for(const _0x493a3c of _0x1b0e43){const _0x4d4a8f=_0x493a3c[_0x3c94bc(0x273)]?_0x493a3c[_0x3c94bc(0x273)]+'/'+_0x493a3c[_0x3c94bc(0x22a)]['name']:_0x493a3c[_0x3c94bc(0x22a)][_0x3c94bc(0x210)],_0x101677=_0x493a3c['yamlConfig'][_0x3c94bc(0x1eb)]?.['length']||0x0,_0x319ae0=_0x101677>0x0?a41_0x3987b6[_0x3c94bc(0x1f2)]('\x20['+_0x101677+_0x3c94bc(0x234)):'';console['error']('\x0a'+a41_0x3987b6[_0x3c94bc(0x209)](_0x3c94bc(0x1f6))+'\x20'+_0x4d4a8f+_0x319ae0),console['error']('─'[_0x3c94bc(0x258)](0x3c)),_0x493a3c[_0x3c94bc(0x216)]&&console[_0x3c94bc(0x275)](_0x493a3c[_0x3c94bc(0x216)]),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}if(_0x2e814f[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)])for(const _0x1998fa of _0x2e814f){const _0xe4d0fc=_0x1998fa['segmentFolderId']?_0x2cf7f6[_0x3c94bc(0x207)](_0x1998fa['segmentFolderId'][_0x3c94bc(0x26b)]())||'':'',_0x5f59f5=_0xe4d0fc?_0xe4d0fc+'/'+_0x1998fa['name']:_0x1998fa['name'],_0x3fb703=_0x23a43a[_0x3c94bc(0x207)](_0x1998fa['id'])||[],_0x353d8c=_0x3fb703['length']>0x0?a41_0x3987b6[_0x3c94bc(0x1f2)]('\x20['+_0x3fb703['length']+_0x3c94bc(0x234)):'';console['error']('\x0a'+a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x22f))+'\x20'+_0x5f59f5+_0x353d8c),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));const _0x1b02ff=segmentWithActivationsToYaml(_0x1998fa,_0x3fb703,undefined,_0x575f61,_0x3a3951),_0x28040a=segmentToYamlString(_0x1b02ff),_0x475bd8=generateDiff(_0x28040a,'');console[_0x3c94bc(0x275)](formatDiffWithColors(_0x475bd8)),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}const _0x548305=_0x1ab88c[_0x3c94bc(0x25b)](_0x205333=>!_0x205333[_0x3c94bc(0x285)]&&_0x205333[_0x3c94bc(0x216)]);if(_0x548305[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)])for(const _0x29ba55 of _0x548305){const _0x26b4b5=_0x29ba55['folderPath']?_0x29ba55['folderPath']+'/'+_0x29ba55['yamlConfig'][_0x3c94bc(0x210)]:_0x29ba55['yamlConfig'][_0x3c94bc(0x210)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6['yellow']('Changes\x20to:')+'\x20'+_0x26b4b5),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c)),console[_0x3c94bc(0x275)](_0x29ba55[_0x3c94bc(0x216)]),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}if(_0x2bdd5a[_0x3c94bc(0x205)]>0x0)for(const _0x38265f of _0x2bdd5a){const _0x1be554=_0x38265f[_0x3c94bc(0x273)]?_0x38265f[_0x3c94bc(0x273)]+'/'+_0x38265f['yamlConfig'][_0x3c94bc(0x210)]:_0x38265f[_0x3c94bc(0x22a)][_0x3c94bc(0x210)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6[_0x3c94bc(0x209)](_0x3c94bc(0x1fd))+'\x20'+_0x1be554),console['error']('─'[_0x3c94bc(0x258)](0x3c)),_0x38265f[_0x3c94bc(0x216)]&&console[_0x3c94bc(0x275)](_0x38265f[_0x3c94bc(0x216)]),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}const _0x59df6d=_0x5367f0[_0x3c94bc(0x25b)](_0x4addda=>!_0x4addda[_0x3c94bc(0x285)]&&_0x4addda[_0x3c94bc(0x216)]);if(_0x59df6d['length']>0x0)for(const _0x1ebf18 of _0x59df6d){const _0x50bf59=_0x1ebf18[_0x3c94bc(0x273)]?_0x1ebf18[_0x3c94bc(0x273)]+'/'+_0x1ebf18['yamlConfig']['name']:_0x1ebf18[_0x3c94bc(0x22a)][_0x3c94bc(0x210)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x20a))+'\x20'+_0x50bf59),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c)),console['error'](_0x1ebf18[_0x3c94bc(0x216)]),console['error']('─'[_0x3c94bc(0x258)](0x3c));}if(_0x48ac05['length']>0x0)for(const _0x3cd264 of _0x48ac05){const _0x31f424=_0x3cd264[_0x3c94bc(0x23e)]?_0x2cf7f6[_0x3c94bc(0x207)](_0x3cd264[_0x3c94bc(0x23e)])||'':'',_0x53559c=_0x31f424?_0x31f424+'/'+_0x3cd264[_0x3c94bc(0x1f3)]:_0x3cd264[_0x3c94bc(0x1f3)];console[_0x3c94bc(0x275)]('\x0a'+a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x243))+'\x20'+_0x53559c),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c)),console['error'](a41_0x3987b6[_0x3c94bc(0x22c)](_0x3c94bc(0x214))),console[_0x3c94bc(0x275)]('─'[_0x3c94bc(0x258)](0x3c));}if(_0x15bfcf[_0x3c94bc(0x236)])return console['error'](a41_0x3987b6['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x25ada4=_0x15bfcf[_0x3c94bc(0x248)]?![]:_0x1b0e43['length']>0x0||_0x1a727a['length']>0x0||_0x2e814f[_0x3c94bc(0x205)]>0x0,_0x39657b=_0x2bdd5a[_0x3c94bc(0x205)]>0x0||_0x47d8be['length']>0x0||_0x48ac05[_0x3c94bc(0x205)]>0x0,_0x663f34=_0x15bfcf[_0x3c94bc(0x248)]?![]:_0x1d1d7a[_0x3c94bc(0x205)]>0x0,_0x1e5ef8=_0x99625e[_0x3c94bc(0x205)]>0x0;if(!_0x25ada4&&!_0x39657b&&!_0x663f34&&!_0x1e5ef8){const _0xb5508c=_0x15bfcf[_0x3c94bc(0x248)]?_0x3c94bc(0x264):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x209)](_0xb5508c));if(_0x354afb&&_0x1a877c[_0x3c94bc(0x205)]===0x1){const _0x3799c3=_0x1a877c[0x0];if(_0x3799c3['existingSegment']?.['id']){const _0x38cdee=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+_0x3c94bc(0x22e)+_0x3799c3[_0x3c94bc(0x1f1)]['id']+_0x3c94bc(0x20c));console[_0x3c94bc(0x275)](_0x3c94bc(0x24e)+a41_0x3987b6['cyan'](_0x38cdee));}}if(_0x354afb&&_0x1e6e67[_0x3c94bc(0x205)]===0x1){const _0x44c5b4=_0x1e6e67[0x0];if(_0x44c5b4[_0x3c94bc(0x280)]?.['id']){const _0x5684db=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+_0x3c94bc(0x22e)+_0x44c5b4[_0x3c94bc(0x280)]['id']+_0x3c94bc(0x261));console['error']('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x5684db));}}return 0x0;}const _0x33fb9d=_0x15bfcf['journeysOnly']?_0x2bdd5a[_0x3c94bc(0x205)]+_0x47d8be[_0x3c94bc(0x205)]+_0x48ac05[_0x3c94bc(0x205)]+_0x99625e[_0x3c94bc(0x205)]:_0x1b0e43['length']+_0x1a727a[_0x3c94bc(0x205)]+_0x2e814f[_0x3c94bc(0x205)]+_0x2bdd5a[_0x3c94bc(0x205)]+_0x47d8be[_0x3c94bc(0x205)]+_0x48ac05[_0x3c94bc(0x205)]+_0x99625e[_0x3c94bc(0x205)]+_0x1d1d7a['length'];if(!_0x15bfcf[_0x3c94bc(0x21e)]&&_0x33fb9d>0x0){if(!isInteractive())return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)]('\x0aError:'),_0x3c94bc(0x20b)),console['error'](a41_0x3987b6[_0x3c94bc(0x1f2)](_0x3c94bc(0x1fe))),0x1;const _0x31293d=await confirmKey('Push\x20'+_0x33fb9d+'\x20changes?');if(!_0x31293d)return console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x262))),0x1;}const _0x209872={'withProgress':async(_0x3ffa08,_0x42e793)=>{const _0xf7c837=_0x3c94bc,_0x43bb94=await withSpinner(_0x3ffa08,_0x42e793,{'verbose':_0x15bfcf[_0xf7c837(0x232)]});return{'data':_0x43bb94[_0xf7c837(0x22d)]};},'logInfo':_0x371322=>console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x256)]('✔\x20'+_0x371322)),'logSuccess':_0x1888b5=>console['error'](a41_0x3987b6[_0x3c94bc(0x209)]('✔\x20'+_0x1888b5)),'logWarning':_0x4c4e14=>console[_0x3c94bc(0x275)](a41_0x3987b6['yellow']('⚠\x20'+_0x4c4e14)),'logDeleted':_0x132c28=>console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x22c)]('✔\x20'+_0x132c28))},_0x4a333e={'segment':_0x2a0e6e[_0x3c94bc(0x242)],'journey':_0x2a0e6e['journey'],'user':_0x2a0e6e[_0x3c94bc(0x229)],'connection':_0x2a0e6e['connection']};_0x99625e[_0x3c94bc(0x205)]>0x0&&(_0x223973=await executePushFolders(_0x4a333e,_0x99625e,_0x223973,{'parentId':_0x314481},_0x209872));const _0x4c16b1={'rootFolderId':_0x291903,'folderPathToId':_0x223973,'folderIdToPath':_0x2cf7f6,'segmentNameToId':_0x50086f,'activationsBySegmentId':_0x23a43a,'emailToIdMap':_0x130ce2,'idToEmailMap':_0x575f61,'connectionNameToIdMap':_0x1e8aaa[_0x3c94bc(0x230)],'connectionIdToNameMap':_0x1e8aaa[_0x3c94bc(0x23a)],'connectionNameToTypeMap':_0x490b46},_0x217a41=await executePushSegments(_0x4a333e,_0x15bfcf['journeysOnly']?[]:_0x1ab88c,_0x4c16b1,{'parentId':_0x314481},_0x209872),_0x5e1fca=_0x217a41[_0x3c94bc(0x1ea)],_0x4f069f=_0x217a41[_0x3c94bc(0x25e)],_0x11051c=_0x217a41[_0x3c94bc(0x1eb)][_0x3c94bc(0x1ea)],_0x30d080=_0x217a41[_0x3c94bc(0x1eb)][_0x3c94bc(0x25e)],_0x562b6b=_0x217a41[_0x3c94bc(0x1eb)]['deleted'];let _0x351a81;if(_0x354afb&&_0x1ab88c[_0x3c94bc(0x205)]===0x1){const _0x427a1e=_0x1ab88c[0x0];_0x351a81=_0x427a1e[_0x3c94bc(0x1f1)]?.['id']??_0x217a41[_0x3c94bc(0x1f4)][_0x3c94bc(0x207)](_0x427a1e[_0x3c94bc(0x22a)][_0x3c94bc(0x210)]);}const _0x5e731b=await executePushSegmentDeletions(_0x4a333e,_0x15bfcf[_0x3c94bc(0x248)]?[]:_0x2e814f,_0x209872);let _0x8c15e0=0x0,_0x31f42e=0x0,_0x49c08e=0x0;const _0x14dc9e=new Map(_0x50086f);for(const [_0x267249,_0x2e05f7]of _0x217a41[_0x3c94bc(0x1f4)]){_0x14dc9e[_0x3c94bc(0x233)](_0x267249,_0x2e05f7);}if(_0x5367f0['length']>0x0){const _0x333ae3={..._0x4c16b1,'segmentNameToId':_0x14dc9e,'existingSegments':_0x2b0c7a,'activationContext':_0x17372},_0x594f41=await executePushJourneys(_0x4a333e,_0x5367f0,_0x333ae3,{'parentId':_0x314481,'rootFolderId':_0x291903,'verbose':_0x15bfcf[_0x3c94bc(0x232)]},_0x209872);_0x8c15e0=_0x594f41['created'],_0x31f42e=_0x594f41['updated'];if(_0x354afb&&_0x594f41[_0x3c94bc(0x265)][_0x3c94bc(0x205)]===0x1){const _0x49c5b9=_0x594f41[_0x3c94bc(0x265)][0x0];if(_0x49c5b9[_0x3c94bc(0x21f)]){const _0x18392e=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+'/e/'+_0x49c5b9[_0x3c94bc(0x21f)]+_0x3c94bc(0x261));console[_0x3c94bc(0x275)]('\x20\x20'+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x18392e));}}}for(const _0x28ae50 of _0x48ac05){console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x245)](_0x3c94bc(0x206)+_0x28ae50[_0x3c94bc(0x1f3)])),_0x49c08e++;}const _0x5be11d=[];if(_0x5e1fca>0x0)_0x5be11d['push'](_0x5e1fca+'\x20created');if(_0x4f069f>0x0)_0x5be11d[_0x3c94bc(0x21d)](_0x4f069f+_0x3c94bc(0x224));if(_0x5e731b>0x0)_0x5be11d[_0x3c94bc(0x21d)](_0x5e731b+'\x20deleted');const _0x11301b=[];if(_0x8c15e0>0x0)_0x11301b[_0x3c94bc(0x21d)](_0x8c15e0+'\x20created');if(_0x31f42e>0x0)_0x11301b[_0x3c94bc(0x21d)](_0x31f42e+_0x3c94bc(0x224));if(_0x49c08e>0x0)_0x11301b[_0x3c94bc(0x21d)](_0x49c08e+_0x3c94bc(0x1fc));const _0x1f5914=[];if(_0x11051c>0x0)_0x1f5914[_0x3c94bc(0x21d)](_0x11051c+'\x20created');if(_0x30d080>0x0)_0x1f5914['push'](_0x30d080+'\x20updated');if(_0x562b6b>0x0)_0x1f5914[_0x3c94bc(0x21d)](_0x562b6b+'\x20deleted');console[_0x3c94bc(0x275)](a41_0x3987b6[_0x3c94bc(0x209)](_0x3c94bc(0x271)));_0x5be11d[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf['journeysOnly']&&console[_0x3c94bc(0x275)](_0x3c94bc(0x239)+_0x5be11d['join'](',\x20'));_0x11301b['length']>0x0&&console[_0x3c94bc(0x275)](_0x3c94bc(0x22b)+_0x11301b[_0x3c94bc(0x223)](',\x20'));_0x1f5914[_0x3c94bc(0x205)]>0x0&&!_0x15bfcf[_0x3c94bc(0x248)]&&console[_0x3c94bc(0x275)](_0x3c94bc(0x219)+_0x1f5914[_0x3c94bc(0x223)](',\x20'));if(_0x351a81){const _0x5d1cb1=getConsoleNextUrl(_0x15bfcf[_0x3c94bc(0x276)],_0x3c94bc(0x218)+_0x314481+_0x3c94bc(0x22e)+_0x351a81+_0x3c94bc(0x20c));console[_0x3c94bc(0x275)](_0x3c94bc(0x24e)+a41_0x3987b6[_0x3c94bc(0x1f8)](_0x5d1cb1));}return 0x0;}}
1
+ const a41_0x2f254e=a41_0x24bb;(function(_0x29ff30,_0x1e5f32){const _0x2ed2aa=a41_0x24bb,_0x578359=_0x29ff30();while(!![]){try{const _0xf01ca=-parseInt(_0x2ed2aa(0x11b))/0x1+parseInt(_0x2ed2aa(0x12d))/0x2+-parseInt(_0x2ed2aa(0x13f))/0x3+-parseInt(_0x2ed2aa(0x140))/0x4*(-parseInt(_0x2ed2aa(0xdf))/0x5)+parseInt(_0x2ed2aa(0x122))/0x6+parseInt(_0x2ed2aa(0x157))/0x7+-parseInt(_0x2ed2aa(0xf2))/0x8*(parseInt(_0x2ed2aa(0x151))/0x9);if(_0xf01ca===_0x1e5f32)break;else _0x578359['push'](_0x578359['shift']());}catch(_0x5d839f){_0x578359['push'](_0x578359['shift']());}}}(a41_0x30e5,0xecc90));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x539f4a from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a41_0x24bb(_0x38cc45,_0x4e4325){_0x38cc45=_0x38cc45-0xd9;const _0x30e55c=a41_0x30e5();let _0x24bb69=_0x30e55c[_0x38cc45];return _0x24bb69;}export class SegmentPushCommand extends BaseCommand{[a41_0x2f254e(0x147)]=a41_0x2f254e(0xf4);[a41_0x2f254e(0xdd)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0x2f254e(0x119)](_0x5a3c2c){const _0x196c5b=a41_0x2f254e,{options:_0x1d5b5a,args:_0x4d64c8,tdx:_0x5d06c6}=_0x5a3c2c,_0x10c6f9=_0x1d5b5a,_0x5ac8dd=await resolveTarget({'arg':_0x4d64c8[0x0],'contextParent':_0x1d5b5a['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5ac8dd))return _0x5ac8dd[_0x196c5b(0xf0)]===_0x196c5b(0x10b)?(console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0xd9))),console['error'](_0x196c5b(0xed)),console[_0x196c5b(0x143)](_0x196c5b(0x134)),console[_0x196c5b(0x143)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x196c5b(0x143)](a41_0x539f4a['red']('Error:\x20'+_0x5ac8dd['message']+'\x0a')),_0x5ac8dd[_0x196c5b(0x153)]&&console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xfb)](_0x5ac8dd[_0x196c5b(0x153)]))),0x1;if(_0x5ac8dd[_0x196c5b(0x156)]==='parent_name')return console['error'](a41_0x539f4a[_0x196c5b(0xe5)]('Error:\x20Directory\x20not\x20found:\x20'+_0x5ac8dd[_0x196c5b(0xf5)]+'\x0a')),console[_0x196c5b(0x143)](a41_0x539f4a['cyan'](_0x196c5b(0x126))),0x1;const _0x2b2394=_0x5ac8dd['parentName'],_0x66bf0a=_0x5ac8dd[_0x196c5b(0xf5)],_0x30541f=_0x5ac8dd[_0x196c5b(0x156)]===_0x196c5b(0xf7)?_0x5ac8dd['filePath']:undefined,_0x16b322=getScopedDetails(_0x5ac8dd),_0x40342b=_0x16b322?.[_0x196c5b(0x11e)]??![],_0x1a4932=_0x16b322?.[_0x196c5b(0x15e)]??'';if(!existsSync(_0x66bf0a))return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x107)+_0x66bf0a+'\x0a')),console['error'](a41_0x539f4a[_0x196c5b(0xfb)](_0x196c5b(0x126))),0x1;_0x10c6f9['verbose']&&(console[_0x196c5b(0x143)]('Site:\x20'+_0x10c6f9[_0x196c5b(0xea)]),console[_0x196c5b(0x143)](_0x196c5b(0xfd)+_0x2b2394),console[_0x196c5b(0x143)](_0x196c5b(0x155)+_0x66bf0a),_0x40342b&&console[_0x196c5b(0x143)](_0x196c5b(0x133)+_0x1a4932));const _0x614b58=await withSpinner(_0x196c5b(0x142)+_0x2b2394+_0x196c5b(0x11d),()=>_0x5d06c6[_0x196c5b(0x159)]['resolveParentId'](_0x2b2394),{'verbose':_0x10c6f9[_0x196c5b(0x158)]}),_0x4a45b6=_0x614b58['data'],{parentSegmentResult:_0x106a36,segmentsResult:_0x3a487f,foldersResult:_0x31c566,journeysWithDetailsResult:_0x1a0c45,userMaps:_0x5e221f}=await withSpinner(_0x196c5b(0xf8),async()=>{const _0x2b4bcd=_0x196c5b,[_0x2a4395,_0x1effd8,_0x2594b6,_0x1322a2,_0x3a465a]=await Promise[_0x2b4bcd(0x13e)]([_0x5d06c6[_0x2b4bcd(0x159)][_0x2b4bcd(0x15b)](_0x4a45b6),_0x5d06c6[_0x2b4bcd(0x159)][_0x2b4bcd(0x15f)](_0x4a45b6),_0x5d06c6['segment']['listFolders'](_0x4a45b6),_0x5d06c6[_0x2b4bcd(0x12e)][_0x2b4bcd(0x103)](_0x4a45b6,{'includeAllVersions':!![]}),_0x5d06c6[_0x2b4bcd(0x11f)]['buildUserMaps']()]);return{'parentSegmentResult':_0x2a4395,'segmentsResult':_0x1effd8,'foldersResult':_0x2594b6,'journeysWithDetailsResult':_0x1322a2,'userMaps':_0x3a465a};},{'verbose':_0x10c6f9['verbose']})['then'](_0x28618a=>_0x28618a['data']),_0x230676=_0x106a36,_0x536095=extractRootFolderId(_0x230676),_0x5b3d27=_0x3a487f,_0x195727=_0x31c566,{journeys:_0x2d16ad,activationStepsById:_0x55021f}=_0x1a0c45,_0x3f0d04=new Map(_0x2d16ad[_0x196c5b(0xee)](_0x1e263a=>[_0x1e263a['id'],_0x1e263a])),_0x3c32ec=_0x2d16ad['map'](_0x55484f=>({'id':_0x55484f['id'],'name':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0x147)],'journeyBundleName':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0x14b)]||'','journeyBundleId':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0xdb)]||'','versionNumber':_0x55484f[_0x196c5b(0x14e)]['versionNumber'],'description':_0x55484f['attributes']['description'],'state':_0x55484f['attributes'][_0x196c5b(0x115)],'paused':_0x55484f['attributes']['paused'],'audienceId':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0x13a)],'folderId':_0x55484f['relationships']?.[_0x196c5b(0x112)]?.[_0x196c5b(0x129)]?.['id'],'createdAt':_0x55484f[_0x196c5b(0x14e)][_0x196c5b(0x14d)],'updatedAt':_0x55484f[_0x196c5b(0x14e)]['updatedAt']})),{emailToId:_0x46d96c,idToEmail:_0x4061c7}=_0x5e221f,_0xec8959=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x4258d8=_0x196c5b,_0x296d2c=await _0x5d06c6[_0x4258d8(0x137)][_0x4258d8(0x12c)]();return buildConnectionMaps(_0x296d2c);},{'verbose':_0x10c6f9[_0x196c5b(0x158)]})[_0x196c5b(0x117)](_0xf5679f=>_0xf5679f['data']),_0x527885=_0xec8959[_0x196c5b(0x104)],_0x3f0316=_0xec8959[_0x196c5b(0x12b)],_0x3de0e5=_0xec8959['nameToType'],_0x499e85={'emailToIdMap':_0x46d96c,'connectionNameToIdMap':_0x527885,'connectionNameToTypeMap':_0x3de0e5,'getSchema':_0x2a0b07=>_0x5d06c6['connection']['getOutputSchemaWithCache'](_0x2a0b07)};let {pathToId:_0x275497,idToPath:_0xa58093}=buildFolderMaps(_0x195727);const _0x6d2ffa=buildSegmentLookupMap(_0x5b3d27,_0xa58093),_0x2871fb=buildSegmentNameToIdMap(_0x5b3d27),_0x395c33=buildJourneyBundleLookupMap(_0x3c32ec,_0xa58093);let _0x45157a;if(_0x30541f){if(!_0x30541f[_0x196c5b(0xf3)]('.yml')&&!_0x30541f[_0x196c5b(0xf3)](_0x196c5b(0xf6)))return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x13c)+_0x30541f+'\x0a')),0x1;_0x45157a=[_0x30541f];}else _0x45157a=findYamlFiles(_0x66bf0a);if(_0x45157a['length']===0x0)return console['error'](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x161)+_0x66bf0a+'\x0a')),console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xfb)](_0x196c5b(0x128))),0x1;let _0xe0cf34,_0x3bcb18;try{const _0x41a131=parseAndClassifyYamlFiles(_0x45157a,_0x66bf0a,{'skipSegments':_0x10c6f9[_0x196c5b(0x108)]});_0xe0cf34=_0x41a131[_0x196c5b(0x130)],_0x3bcb18=_0x41a131[_0x196c5b(0x164)];const _0xae0768=validateParsedFiles(_0x41a131,_0x66bf0a);if(_0xae0768[_0x196c5b(0x136)]>0x0)return console['error'](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x12f))),console[_0x196c5b(0x143)](formatValidationErrors(_0xae0768)),console['error'](a41_0x539f4a[_0x196c5b(0xdc)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x2cb14b){return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe5)]('Error\x20parsing\x20YAML:\x20'+(_0x2cb14b instanceof Error?_0x2cb14b['message']:_0x2cb14b))),0x1;}if(_0xe0cf34[_0x196c5b(0x136)]===0x0&&_0x3bcb18[_0x196c5b(0x136)]===0x0){const _0x212c51=_0x10c6f9[_0x196c5b(0x108)]?'journey':'segment\x20or\x20journey';return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0xe4)+_0x212c51+_0x196c5b(0xda))),0x0;}const _0xccbb0c=new Map();_0x5b3d27[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x108)]&&await withSpinner(_0x196c5b(0x12a),async()=>{await batchAsync(_0x5b3d27,async _0x25c7c4=>{const _0x3e1bc5=a41_0x24bb,_0x58cdcb=await _0x5d06c6['segment'][_0x3e1bc5(0xe2)](_0x4a45b6,_0x25c7c4['id']);_0xccbb0c[_0x3e1bc5(0xeb)](_0x25c7c4['id'],_0x58cdcb);});},{'verbose':_0x10c6f9[_0x196c5b(0x158)]});const {segmentFiles:_0x4ec0c1,foldersToCreate:_0x519e89}=await prepareSegmentFiles(_0xe0cf34,{'segmentByFolderAndName':_0x6d2ffa,'activationsBySegmentId':_0xccbb0c,'folderPathToId':_0x275497,'idToEmailMap':_0x4061c7,'connectionIdToNameMap':_0x3f0316},_0x499e85,_0x40342b,_0x1a4932),_0x35afab=_0x30541f?[]:findSegmentsToDelete(_0x5b3d27,_0xe0cf34['map'](({yamlConfig:_0x33c0a9,folderPath:_0x170013})=>({'yamlConfig':_0x33c0a9,'folderPath':resolveTDFolderPath(_0x170013,_0x40342b,_0x1a4932)})),_0xa58093,_0x1a4932,_0x40342b),{journeyFiles:_0x599e30,foldersToCreate:_0xfec809}=await withProgressSpinner(_0x196c5b(0x132),async _0x1a3022=>prepareJourneyFiles(_0x3bcb18,{'fetchJourney':async _0x634f40=>_0x5d06c6['journey']['getJourney'](_0x634f40[_0x196c5b(0x11a)]),'journeyBundlesByFolderAndName':_0x395c33,'folderPathToId':_0x275497,'idToEmailMap':_0x4061c7,'connectionIdToNameMap':_0x3f0316,'existingSegments':_0x5b3d27,'parentId':_0x4a45b6,'deps':_0x5d06c6,'progress':{'update':_0x3d479b=>{const _0x8eaf6b=_0x196c5b;_0x1a3022[_0x8eaf6b(0xde)](_0x3d479b),_0x10c6f9['verbose']&&console[_0x8eaf6b(0x143)]('\x20\x20'+_0x3d479b);}},'journeyById':_0x3f0d04,'activationStepsById':_0x55021f},_0x40342b,_0x1a4932),{'verbose':_0x10c6f9[_0x196c5b(0x158)]})['then'](_0x3e4d13=>_0x3e4d13[_0x196c5b(0x129)]);for(const _0x97d74a of _0xfec809){_0x519e89['add'](_0x97d74a);}const _0x1fec7e=_0x30541f?[]:findJourneysToDelete(_0x3c32ec,_0x3bcb18['map'](({yamlConfig:_0x162253,folderPath:_0x14b5fd})=>({'yamlConfig':_0x162253,'folderPath':resolveTDFolderPath(_0x14b5fd,_0x40342b,_0x1a4932)})),_0xa58093,_0x1a4932,_0x40342b),_0x1cf8c5=calculatePushStats(_0x4ec0c1,_0x599e30,_0x519e89,_0x35afab,_0x1fec7e,!!_0x10c6f9['delete'],!!_0x10c6f9[_0x196c5b(0x108)]),_0x5c5539=_0x1cf8c5[_0x196c5b(0x130)][_0x196c5b(0xe9)],_0x4e637d=_0x1cf8c5['segments'][_0x196c5b(0xe3)],_0xc4001c=_0x1cf8c5[_0x196c5b(0x130)][_0x196c5b(0x13b)],_0x1bf8b0=_0x1cf8c5[_0x196c5b(0x130)][_0x196c5b(0x10c)],_0x3f7198=_0x1cf8c5[_0x196c5b(0x152)]['toCreate'],_0x13dc8f=_0x1cf8c5[_0x196c5b(0x164)][_0x196c5b(0xe9)],_0x2872d5=_0x1cf8c5[_0x196c5b(0x164)][_0x196c5b(0xe3)],_0x5a3b08=_0x1cf8c5[_0x196c5b(0x164)]['unchanged'],_0x52a3f5=_0x1cf8c5['journeys'][_0x196c5b(0x10c)],_0xc5a832=_0x1cf8c5[_0x196c5b(0xf9)]['all'],_0x188dbb=_0x1cf8c5[_0x196c5b(0xf9)]['toCreate'],_0x42b5b7=_0x1cf8c5['activations'][_0x196c5b(0x144)],_0x448485=_0x1cf8c5['activations']['toDelete'];console[_0x196c5b(0x143)](_0x196c5b(0x101)+_0x2b2394+'\x27:');_0x3f7198[_0x196c5b(0x136)]>0x0&&console[_0x196c5b(0x143)]('\x20\x20'+a41_0x539f4a[_0x196c5b(0xe7)](_0x196c5b(0xec)+_0x3f7198[_0x196c5b(0x136)]+_0x196c5b(0x110)));if(!_0x10c6f9[_0x196c5b(0x108)]){console[_0x196c5b(0x143)](_0x196c5b(0x100)),console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0x127)]('+\x20'+_0x5c5539[_0x196c5b(0x136)]+_0x196c5b(0x163))),console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a['yellow']('~\x20'+_0x4e637d[_0x196c5b(0x136)]+_0x196c5b(0x11c)));if(_0x1bf8b0[_0x196c5b(0x136)]>0x0)console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a['red']('-\x20'+_0x1bf8b0[_0x196c5b(0x136)]+_0x196c5b(0xf1)));else _0x35afab[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x10e)]&&console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a['dim'](_0x35afab[_0x196c5b(0x136)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x196c5b(0x143)]('\x20\x20\x20\x20'+a41_0x539f4a[_0x196c5b(0x149)]('=\x20'+_0xc4001c[_0x196c5b(0x136)]+_0x196c5b(0x116)));}if(_0x599e30['length']>0x0||_0x1fec7e['length']>0x0){console[_0x196c5b(0x143)](_0x196c5b(0x10f)),console['error'](_0x196c5b(0x114)+a41_0x539f4a['green']('+\x20'+_0x13dc8f[_0x196c5b(0x136)]+'\x20new')),console['error'](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0xdc)]('~\x20'+_0x2872d5['length']+_0x196c5b(0x11c)));if(_0x52a3f5['length']>0x0)console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a['red']('-\x20'+_0x52a3f5[_0x196c5b(0x136)]+_0x196c5b(0xf1)));else _0x1fec7e[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x10e)]&&console[_0x196c5b(0x143)]('\x20\x20\x20\x20'+a41_0x539f4a['dim'](_0x1fec7e[_0x196c5b(0x136)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0x149)]('=\x20'+_0x5a3b08['length']+_0x196c5b(0x116)));}_0xc5a832['length']>0x0&&!_0x10c6f9[_0x196c5b(0x108)]&&(console[_0x196c5b(0x143)](''),console[_0x196c5b(0x143)](_0x196c5b(0x106)),_0x188dbb[_0x196c5b(0x136)]>0x0&&console['error'](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0x127)]('+\x20'+_0x188dbb[_0x196c5b(0x136)]+'\x20to\x20create')),_0x42b5b7[_0x196c5b(0x136)]>0x0&&console['error'](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0xdc)]('~\x20'+_0x42b5b7[_0x196c5b(0x136)]+'\x20to\x20update')),_0x448485[_0x196c5b(0x136)]>0x0&&console[_0x196c5b(0x143)](_0x196c5b(0x114)+a41_0x539f4a[_0x196c5b(0xe5)]('-\x20'+_0x448485['length']+_0x196c5b(0xf1))));console[_0x196c5b(0x143)](_0x196c5b(0x102)+a41_0x539f4a[_0x196c5b(0xfb)](_0x66bf0a)+'\x0a');if(_0x3f7198[_0x196c5b(0x136)]>0x0){console[_0x196c5b(0x143)](_0x196c5b(0x150));for(const _0x352e01 of _0x3f7198){console['error']('\x20\x20'+a41_0x539f4a[_0x196c5b(0xe7)]('+')+'\x20'+_0x352e01);}console['error']('');}if(_0x5c5539[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x108)])for(const _0x597b09 of _0x5c5539){const _0xb42ab3=_0x597b09[_0x196c5b(0x120)]?_0x597b09[_0x196c5b(0x120)]+'/'+_0x597b09[_0x196c5b(0x167)][_0x196c5b(0x147)]:_0x597b09[_0x196c5b(0x167)]['name'],_0x24a700=_0x597b09[_0x196c5b(0x167)][_0x196c5b(0xf9)]?.[_0x196c5b(0x136)]||0x0,_0x531c1a=_0x24a700>0x0?a41_0x539f4a[_0x196c5b(0x149)]('\x20['+_0x24a700+_0x196c5b(0xff)):'';console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0x127)]('New\x20segment:')+'\x20'+_0xb42ab3+_0x531c1a),console['error']('─'['repeat'](0x3c)),_0x597b09[_0x196c5b(0x14a)]&&console[_0x196c5b(0x143)](_0x597b09[_0x196c5b(0x14a)]),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c));}if(_0x1bf8b0[_0x196c5b(0x136)]>0x0&&!_0x10c6f9['journeysOnly'])for(const _0x1529f1 of _0x1bf8b0){const _0x45bd66=_0x1529f1[_0x196c5b(0x118)]?_0xa58093[_0x196c5b(0x13d)](_0x1529f1[_0x196c5b(0x118)][_0x196c5b(0xfe)]())||'':'',_0xd3106=_0x45bd66?_0x45bd66+'/'+_0x1529f1[_0x196c5b(0x147)]:_0x1529f1[_0x196c5b(0x147)],_0x6dc038=_0xccbb0c[_0x196c5b(0x13d)](_0x1529f1['id'])||[],_0xf48e4=_0x6dc038['length']>0x0?a41_0x539f4a[_0x196c5b(0x149)]('\x20['+_0x6dc038[_0x196c5b(0x136)]+_0x196c5b(0xff)):'';console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x138))+'\x20'+_0xd3106+_0xf48e4),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c));const _0x1e60bc=segmentWithActivationsToYaml(_0x1529f1,_0x6dc038,undefined,_0x4061c7,_0x3f0316),_0x425a5b=segmentToYamlString(_0x1e60bc),_0x2736cb=generateDiff(_0x425a5b,'');console['error'](formatDiffWithColors(_0x2736cb)),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c));}const _0x4837cf=_0x4ec0c1['filter'](_0xb9f27c=>!_0xb9f27c[_0x196c5b(0x121)]&&_0xb9f27c[_0x196c5b(0x14a)]);if(_0x4837cf['length']>0x0&&!_0x10c6f9[_0x196c5b(0x108)])for(const _0x4a7a7d of _0x4837cf){const _0xb9e1ef=_0x4a7a7d[_0x196c5b(0x120)]?_0x4a7a7d[_0x196c5b(0x120)]+'/'+_0x4a7a7d['yamlConfig']['name']:_0x4a7a7d[_0x196c5b(0x167)][_0x196c5b(0x147)];console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a['yellow'](_0x196c5b(0x123))+'\x20'+_0xb9e1ef),console['error']('─'[_0x196c5b(0xef)](0x3c)),console['error'](_0x4a7a7d['diff']),console['error']('─'['repeat'](0x3c));}if(_0x13dc8f[_0x196c5b(0x136)]>0x0)for(const _0x26a6a9 of _0x13dc8f){const _0x438c27=_0x26a6a9[_0x196c5b(0x120)]?_0x26a6a9[_0x196c5b(0x120)]+'/'+_0x26a6a9['yamlConfig'][_0x196c5b(0x147)]:_0x26a6a9[_0x196c5b(0x167)][_0x196c5b(0x147)];console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0x127)](_0x196c5b(0x141))+'\x20'+_0x438c27),console['error']('─'['repeat'](0x3c)),_0x26a6a9[_0x196c5b(0x14a)]&&console[_0x196c5b(0x143)](_0x26a6a9[_0x196c5b(0x14a)]),console[_0x196c5b(0x143)]('─'['repeat'](0x3c));}const _0x573b2f=_0x599e30[_0x196c5b(0x145)](_0x28bd8a=>!_0x28bd8a[_0x196c5b(0x121)]&&_0x28bd8a[_0x196c5b(0x14a)]);if(_0x573b2f[_0x196c5b(0x136)]>0x0)for(const _0x5a18e6 of _0x573b2f){const _0x3db0e6=_0x5a18e6[_0x196c5b(0x120)]?_0x5a18e6[_0x196c5b(0x120)]+'/'+_0x5a18e6[_0x196c5b(0x167)][_0x196c5b(0x147)]:_0x5a18e6[_0x196c5b(0x167)][_0x196c5b(0x147)];console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0xdc)]('Changes\x20to\x20journey:')+'\x20'+_0x3db0e6),console['error']('─'['repeat'](0x3c)),console[_0x196c5b(0x143)](_0x5a18e6[_0x196c5b(0x14a)]),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c));}if(_0x52a3f5[_0x196c5b(0x136)]>0x0)for(const _0x2f40de of _0x52a3f5){const _0x2c4926=_0x2f40de[_0x196c5b(0x125)]?_0xa58093[_0x196c5b(0x13d)](_0x2f40de['folderId'])||'':'',_0x5224d9=_0x2c4926?_0x2c4926+'/'+_0x2f40de['journeyBundleName']:_0x2f40de['journeyBundleName'];console[_0x196c5b(0x143)]('\x0a'+a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x146))+'\x20'+_0x5224d9),console[_0x196c5b(0x143)]('─'[_0x196c5b(0xef)](0x3c)),console['error'](a41_0x539f4a[_0x196c5b(0xe5)](_0x196c5b(0x148))),console['error']('─'[_0x196c5b(0xef)](0x3c));}if(_0x10c6f9[_0x196c5b(0x14f)])return console['error'](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0x10d))),0x0;const _0x322727=_0x10c6f9[_0x196c5b(0x108)]?![]:_0x5c5539[_0x196c5b(0x136)]>0x0||_0x4e637d[_0x196c5b(0x136)]>0x0||_0x1bf8b0[_0x196c5b(0x136)]>0x0,_0x12d4ee=_0x13dc8f[_0x196c5b(0x136)]>0x0||_0x2872d5[_0x196c5b(0x136)]>0x0||_0x52a3f5[_0x196c5b(0x136)]>0x0,_0x35b042=_0x10c6f9[_0x196c5b(0x108)]?![]:_0xc5a832[_0x196c5b(0x136)]>0x0,_0xa1363d=_0x3f7198[_0x196c5b(0x136)]>0x0;if(!_0x322727&&!_0x12d4ee&&!_0x35b042&&!_0xa1363d){const _0x4d60bd=_0x10c6f9['journeysOnly']?_0x196c5b(0x139):_0x196c5b(0x154);console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0x127)](_0x4d60bd));if(_0x30541f&&_0xc4001c['length']===0x1){const _0x104fd9=_0xc4001c[0x0];if(_0x104fd9['existingSegment']?.['id']){const _0x496b01=getConsoleNextUrl(_0x10c6f9[_0x196c5b(0xea)],_0x196c5b(0x165)+_0x4a45b6+_0x196c5b(0xe0)+_0x104fd9['existingSegment']['id']+_0x196c5b(0x131));console[_0x196c5b(0x143)](_0x196c5b(0x15a)+a41_0x539f4a[_0x196c5b(0xfb)](_0x496b01));}}if(_0x30541f&&_0x5a3b08[_0x196c5b(0x136)]===0x1){const _0xede0cf=_0x5a3b08[0x0];if(_0xede0cf[_0x196c5b(0x113)]?.['id']){const _0x55644b=getConsoleNextUrl(_0x10c6f9[_0x196c5b(0xea)],_0x196c5b(0x165)+_0x4a45b6+_0x196c5b(0xe0)+_0xede0cf[_0x196c5b(0x113)]['id']+'/j/da/je');console[_0x196c5b(0x143)]('\x20\x20'+a41_0x539f4a[_0x196c5b(0xfb)](_0x55644b));}}return 0x0;}const _0x25901d=_0x10c6f9[_0x196c5b(0x108)]?_0x13dc8f[_0x196c5b(0x136)]+_0x2872d5[_0x196c5b(0x136)]+_0x52a3f5['length']+_0x3f7198[_0x196c5b(0x136)]:_0x5c5539[_0x196c5b(0x136)]+_0x4e637d[_0x196c5b(0x136)]+_0x1bf8b0['length']+_0x13dc8f[_0x196c5b(0x136)]+_0x2872d5[_0x196c5b(0x136)]+_0x52a3f5['length']+_0x3f7198[_0x196c5b(0x136)]+_0xc5a832['length'];if(!_0x10c6f9['yes']&&_0x25901d>0x0){if(!isInteractive())return console[_0x196c5b(0x143)](a41_0x539f4a['red']('\x0aError:'),_0x196c5b(0xfc)),console['error'](a41_0x539f4a[_0x196c5b(0x149)](_0x196c5b(0xe1))),0x1;const _0x423b99=await confirmKey(_0x196c5b(0xe6)+_0x25901d+_0x196c5b(0xfa));if(!_0x423b99)return console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0x162))),0x1;}const _0x2a237e={'withProgress':async(_0x2cd1d6,_0x481fe2)=>{const _0x2337a5=_0x196c5b,_0x3d8e44=await withSpinner(_0x2cd1d6,_0x481fe2,{'verbose':_0x10c6f9[_0x2337a5(0x158)]});return{'data':_0x3d8e44['data']};},'logInfo':_0x114992=>console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe7)]('✔\x20'+_0x114992)),'logSuccess':_0x3ac21d=>console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0x127)]('✔\x20'+_0x3ac21d)),'logWarning':_0x127d7d=>console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xdc)]('⚠\x20'+_0x127d7d)),'logDeleted':_0x55d0e0=>console[_0x196c5b(0x143)](a41_0x539f4a[_0x196c5b(0xe5)]('✔\x20'+_0x55d0e0))},_0x145085={'segment':_0x5d06c6['segment'],'journey':_0x5d06c6[_0x196c5b(0x12e)],'user':_0x5d06c6[_0x196c5b(0x11f)],'connection':_0x5d06c6[_0x196c5b(0x137)]};_0x3f7198[_0x196c5b(0x136)]>0x0&&(_0x275497=await executePushFolders(_0x145085,_0x3f7198,_0x275497,{'parentId':_0x4a45b6},_0x2a237e));const _0x2545d3={'rootFolderId':_0x536095,'folderPathToId':_0x275497,'folderIdToPath':_0xa58093,'segmentNameToId':_0x2871fb,'activationsBySegmentId':_0xccbb0c,'emailToIdMap':_0x46d96c,'idToEmailMap':_0x4061c7,'connectionNameToIdMap':_0xec8959['nameToId'],'connectionIdToNameMap':_0xec8959[_0x196c5b(0x12b)],'connectionNameToTypeMap':_0x3de0e5},_0x46edcd=await executePushSegments(_0x145085,_0x10c6f9[_0x196c5b(0x108)]?[]:_0x4ec0c1,_0x2545d3,{'parentId':_0x4a45b6},_0x2a237e),_0x18be16=_0x46edcd[_0x196c5b(0x124)],_0x2142c4=_0x46edcd[_0x196c5b(0x111)],_0x620927=_0x46edcd[_0x196c5b(0xf9)][_0x196c5b(0x124)],_0x1d055f=_0x46edcd[_0x196c5b(0xf9)][_0x196c5b(0x111)],_0x45b286=_0x46edcd[_0x196c5b(0xf9)][_0x196c5b(0xe8)];let _0x1b8dce;if(_0x30541f&&_0x4ec0c1[_0x196c5b(0x136)]===0x1){const _0x25041f=_0x4ec0c1[0x0];_0x1b8dce=_0x25041f['existingSegment']?.['id']??_0x46edcd[_0x196c5b(0x135)][_0x196c5b(0x13d)](_0x25041f['yamlConfig'][_0x196c5b(0x147)]);}const _0xf7ad8c=await executePushSegmentDeletions(_0x145085,_0x10c6f9[_0x196c5b(0x108)]?[]:_0x1bf8b0,_0x2a237e);let _0x6228ea=0x0,_0x553371=0x0,_0x103789=0x0;const _0x15f572=new Map(_0x2871fb);for(const [_0x1c957d,_0x2658ad]of _0x46edcd[_0x196c5b(0x135)]){_0x15f572[_0x196c5b(0xeb)](_0x1c957d,_0x2658ad);}if(_0x599e30['length']>0x0){const _0x206ce5={..._0x2545d3,'segmentNameToId':_0x15f572,'existingSegments':_0x5b3d27,'activationContext':_0x499e85},_0x291b1d=await executePushJourneys(_0x145085,_0x599e30,_0x206ce5,{'parentId':_0x4a45b6,'rootFolderId':_0x536095,'verbose':_0x10c6f9[_0x196c5b(0x158)]},_0x2a237e);_0x6228ea=_0x291b1d[_0x196c5b(0x124)],_0x553371=_0x291b1d[_0x196c5b(0x111)];if(_0x30541f&&_0x291b1d[_0x196c5b(0x14c)]['length']===0x1){const _0x304d7c=_0x291b1d['results'][0x0];if(_0x304d7c[_0x196c5b(0x11a)]){const _0x41c3bb=getConsoleNextUrl(_0x10c6f9[_0x196c5b(0xea)],_0x196c5b(0x165)+_0x4a45b6+_0x196c5b(0xe0)+_0x304d7c['journeyId']+'/j/da/je');console['error']('\x20\x20'+a41_0x539f4a[_0x196c5b(0xfb)](_0x41c3bb));}}}for(const _0x414691 of _0x52a3f5){console['error'](a41_0x539f4a[_0x196c5b(0xdc)](_0x196c5b(0x15c)+_0x414691[_0x196c5b(0x14b)])),_0x103789++;}const _0x32ff7f=[];if(_0x18be16>0x0)_0x32ff7f[_0x196c5b(0x109)](_0x18be16+'\x20created');if(_0x2142c4>0x0)_0x32ff7f[_0x196c5b(0x109)](_0x2142c4+_0x196c5b(0x166));if(_0xf7ad8c>0x0)_0x32ff7f[_0x196c5b(0x109)](_0xf7ad8c+_0x196c5b(0x105));const _0x5a22d4=[];if(_0x6228ea>0x0)_0x5a22d4[_0x196c5b(0x109)](_0x6228ea+_0x196c5b(0x10a));if(_0x553371>0x0)_0x5a22d4[_0x196c5b(0x109)](_0x553371+_0x196c5b(0x166));if(_0x103789>0x0)_0x5a22d4[_0x196c5b(0x109)](_0x103789+_0x196c5b(0x105));const _0x283be8=[];if(_0x620927>0x0)_0x283be8[_0x196c5b(0x109)](_0x620927+_0x196c5b(0x10a));if(_0x1d055f>0x0)_0x283be8[_0x196c5b(0x109)](_0x1d055f+'\x20updated');if(_0x45b286>0x0)_0x283be8[_0x196c5b(0x109)](_0x45b286+_0x196c5b(0x105));console[_0x196c5b(0x143)](a41_0x539f4a['green']('\x0a✔\x20Push\x20complete'));_0x32ff7f['length']>0x0&&!_0x10c6f9[_0x196c5b(0x108)]&&console[_0x196c5b(0x143)]('\x20\x20Segments:\x20'+_0x32ff7f[_0x196c5b(0x160)](',\x20'));_0x5a22d4[_0x196c5b(0x136)]>0x0&&console[_0x196c5b(0x143)](_0x196c5b(0x15d)+_0x5a22d4[_0x196c5b(0x160)](',\x20'));_0x283be8[_0x196c5b(0x136)]>0x0&&!_0x10c6f9[_0x196c5b(0x108)]&&console[_0x196c5b(0x143)]('\x20\x20Activations:\x20'+_0x283be8[_0x196c5b(0x160)](',\x20'));if(_0x1b8dce){const _0x5220a8=getConsoleNextUrl(_0x10c6f9['site'],_0x196c5b(0x165)+_0x4a45b6+_0x196c5b(0xe0)+_0x1b8dce+'/sb/da/esr');console[_0x196c5b(0x143)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x539f4a[_0x196c5b(0xfb)](_0x5220a8));}return 0x0;}}function a41_0x30e5(){const _0x81e83b=['journeysOnly','push','\x20created','no_parent','toDelete','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','delete','\x20\x20🗺️\x20\x20Journeys:','\x20folders\x20to\x20create','updated','parentFolder','existingJourney','\x20\x20\x20\x20','state','\x20unchanged','then','segmentFolderId','execute','journeyId','1052785FKWAyy','\x20changed','\x27...','isScoped','user','folderPath','isNew','4995570GLJrte','Changes\x20to:','created','folderId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','green','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','data','Fetching\x20existing\x20activations...','idToName','list','620864ywmNfY','journey','\x0aValidation\x20failed:','segments','/sb/da/esr','Preparing\x20journeys...','Scoped\x20to\x20folder:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','createdSegmentIds','length','connection','Delete\x20segment:','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','audienceId','unchanged','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','get','all','3428412suPEHn','4424024NKkVYW','New\x20journey:','Resolving\x20parent\x20segment\x20\x27','error','toUpdate','filter','Delete\x20journey:','name','(Journey\x20will\x20be\x20deleted)','dim','diff','journeyBundleName','results','createdAt','attributes','dryRun','Folders\x20to\x20create:','7188273hmHpoL','folders','helpText','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Source\x20directory:\x20','type','12005875GUzuOG','verbose','segment','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','getParent','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20\x20Journeys:\x20','scopedFolderPath','listSegments','join','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Aborted.','\x20new','journeys','/app/ps/','\x20updated','yamlConfig','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20YAML\x20files\x20found','journeyBundleId','yellow','description','setPhase','5PInYgX','/e/','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','listActivations','changed','No\x20','red','Push\x20','blue','deleted','new','site','set','📁\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','map','repeat','errorCode','\x20to\x20delete','8HdzmYN','endsWith','segment:push','targetDir','.yaml','file','Fetching\x20existing\x20data...','activations','\x20changes?','cyan','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Parent\x20segment:\x20','toString','\x20activations]','\x20\x20📊\x20Segments:','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Source:\x20','listJourneysWithDetailsFromParentSegment','nameToId','\x20deleted','\x20\x20Activations:','Error:\x20Directory\x20not\x20found:\x20'];a41_0x30e5=function(){return _0x81e83b;};return a41_0x30e5();}
@@ -1 +1 @@
1
- function a42_0x1f21(_0x5cac36,_0x304442){_0x5cac36=_0x5cac36-0x128;const _0x791044=a42_0x7910();let _0x1f2138=_0x791044[_0x5cac36];return _0x1f2138;}const a42_0xf0f947=a42_0x1f21;(function(_0x156e01,_0x4915dd){const _0x19f9cf=a42_0x1f21,_0x413040=_0x156e01();while(!![]){try{const _0x38388f=parseInt(_0x19f9cf(0x144))/0x1+parseInt(_0x19f9cf(0x154))/0x2+-parseInt(_0x19f9cf(0x14c))/0x3*(-parseInt(_0x19f9cf(0x138))/0x4)+parseInt(_0x19f9cf(0x13c))/0x5*(-parseInt(_0x19f9cf(0x142))/0x6)+-parseInt(_0x19f9cf(0x128))/0x7+-parseInt(_0x19f9cf(0x12d))/0x8+parseInt(_0x19f9cf(0x132))/0x9*(-parseInt(_0x19f9cf(0x131))/0xa);if(_0x38388f===_0x4915dd)break;else _0x413040['push'](_0x413040['shift']());}catch(_0x922ece){_0x413040['push'](_0x413040['shift']());}}}(a42_0x7910,0xb3a41));import{BaseCommand}from'./command.js';function a42_0x7910(){const _0x41725e=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','kind','verbose','Updating\x20segment\x20\x27','2474296kOCLVI','rule','Examples:','Parent\x20ID:\x20','103159TUqBvV','description','parentId','type','includes','5664568UdnhQn','Resolving\x20folder\x20\x27','yellow','Resolved\x20type:\x20','910QFZLpu','8847khJNLX','INTERNAL','updateSegmentById','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentId','error','908nhEcst','\x27...','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','segmentName','5EHUasf','resolveFolderId','segmentPath','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','length','ruleFile','6727620eRIFUE','Resolving\x20path\x20\x27','168029sOjQTF','resolvePathToResource','name','Error:\x20Cannot\x20update\x20','data','Resolved\x20folder\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segment','16707VIAJgC','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folder'];a42_0x7910=function(){return _0x41725e;};return a42_0x7910();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x414890 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0xf0f947(0x146)]='segment:update';[a42_0xf0f947(0x129)]='Update\x20existing\x20child\x20segment';async['execute'](_0x1d0e6f){const _0x3822ac=a42_0xf0f947;console[_0x3822ac(0x137)](a42_0x414890[_0x3822ac(0x12f)](_0x3822ac(0x13f))),console['error'](a42_0x414890[_0x3822ac(0x12f)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x4f2bd8,args:_0x5c1437,tdx:_0x4ee64f}=_0x1d0e6f,_0x130fe5=_0x4f2bd8;if(_0x5c1437[_0x3822ac(0x140)]===0x0)return console[_0x3822ac(0x137)](_0x3822ac(0x14e)),console[_0x3822ac(0x137)](_0x3822ac(0x135)),console[_0x3822ac(0x137)](_0x3822ac(0x156)),console[_0x3822ac(0x137)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x3822ac(0x137)](_0x3822ac(0x150)),0x1;const _0x10f493=_0x5c1437[0x0],_0x5b33aa=_0x4f2bd8[_0x3822ac(0x13e)];let _0x61bef7=_0x10f493;_0x5b33aa&&!_0x10f493[_0x3822ac(0x12c)]('/')&&(_0x61bef7=_0x5b33aa+'/'+_0x10f493,_0x130fe5['verbose']&&console['error'](_0x3822ac(0x14d)+_0x61bef7));const _0x183e83=await withSpinner(_0x3822ac(0x143)+_0x61bef7+_0x3822ac(0x139),()=>_0x4ee64f[_0x3822ac(0x14b)][_0x3822ac(0x145)](_0x61bef7),{'verbose':_0x130fe5['verbose']}),_0xa04780=_0x183e83[_0x3822ac(0x148)];_0x130fe5[_0x3822ac(0x152)]&&console[_0x3822ac(0x137)](_0x3822ac(0x130)+_0xa04780[_0x3822ac(0x12b)]);if(_0xa04780['type']!==_0x3822ac(0x14b))return console[_0x3822ac(0x137)](_0x3822ac(0x147)+_0xa04780[_0x3822ac(0x12b)]+_0x3822ac(0x13a)),console[_0x3822ac(0x137)](_0x3822ac(0x14a)),0x1;if(!_0xa04780[_0x3822ac(0x136)])throw new SDKError(ErrorCode[_0x3822ac(0x133)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x48fc41=_0xa04780[_0x3822ac(0x12a)],_0x4d653b=_0xa04780[_0x3822ac(0x136)];_0x130fe5['verbose']&&(console[_0x3822ac(0x137)](_0x3822ac(0x157)+_0x48fc41),console[_0x3822ac(0x137)]('Segment\x20ID:\x20'+_0x4d653b));let _0x3b1e6d;if(_0x130fe5['folder']){const _0x24188f=_0x130fe5[_0x3822ac(0x14f)],_0x38cec4=await withSpinner(_0x3822ac(0x12e)+_0x24188f+'\x27...',()=>_0x4ee64f[_0x3822ac(0x14b)][_0x3822ac(0x13d)](_0x48fc41,_0x24188f),{'verbose':_0x130fe5[_0x3822ac(0x152)]});_0x3b1e6d=parseInt(_0x38cec4[_0x3822ac(0x148)],0xa),_0x130fe5[_0x3822ac(0x152)]&&console[_0x3822ac(0x137)](_0x3822ac(0x149)+_0x3b1e6d);}const _0x1c6e55=await loadJSONFromOptions(_0x130fe5[_0x3822ac(0x155)],_0x130fe5[_0x3822ac(0x141)]),_0x4018e9={'name':_0x130fe5['name'],'description':_0x130fe5[_0x3822ac(0x129)],'rule':_0x1c6e55,'kind':_0x130fe5[_0x3822ac(0x151)]!==undefined?parseInt(_0x130fe5['kind'],0xa):undefined,'segmentFolderId':_0x3b1e6d},_0x211185=await withSpinner(_0x3822ac(0x153)+_0xa04780[_0x3822ac(0x13b)]+'\x27...',()=>_0x4ee64f[_0x3822ac(0x14b)][_0x3822ac(0x134)](_0x48fc41,_0x4d653b,_0x4018e9),{'verbose':_0x130fe5[_0x3822ac(0x152)]}),_0x17d163=_0x211185[_0x3822ac(0x148)];return console[_0x3822ac(0x137)]('✔\x20Updated\x20segment\x20\x27'+_0x17d163[_0x3822ac(0x146)]+'\x27'),_0x61bef7!==_0x10f493&&console[_0x3822ac(0x137)]('\x20\x20\x20Path:\x20'+_0x61bef7),await handleSDKOutput([_0x17d163],_0x130fe5),0x0;}}
1
+ const a42_0x49faf0=a42_0x40d9;(function(_0x34057e,_0x318ead){const _0x4bd97e=a42_0x40d9,_0x3858bb=_0x34057e();while(!![]){try{const _0x326da1=-parseInt(_0x4bd97e(0x106))/0x1+parseInt(_0x4bd97e(0xf7))/0x2+-parseInt(_0x4bd97e(0x122))/0x3*(parseInt(_0x4bd97e(0x11f))/0x4)+-parseInt(_0x4bd97e(0x125))/0x5*(-parseInt(_0x4bd97e(0x105))/0x6)+parseInt(_0x4bd97e(0x11d))/0x7+-parseInt(_0x4bd97e(0x112))/0x8*(-parseInt(_0x4bd97e(0xf6))/0x9)+-parseInt(_0x4bd97e(0x113))/0xa*(parseInt(_0x4bd97e(0x102))/0xb);if(_0x326da1===_0x318ead)break;else _0x3858bb['push'](_0x3858bb['shift']());}catch(_0x4d93b5){_0x3858bb['push'](_0x3858bb['shift']());}}}(a42_0x25d5,0x3d294));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x40d9(_0x17fc36,_0x1ab00c){_0x17fc36=_0x17fc36-0xf5;const _0x25d53f=a42_0x25d5();let _0x40d956=_0x25d53f[_0x17fc36];return _0x40d956;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x559671 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x49faf0(0x119)]=a42_0x49faf0(0x11a);[a42_0x49faf0(0x101)]=a42_0x49faf0(0x10c);async[a42_0x49faf0(0x100)](_0xd9b1f7){const _0x247649=a42_0x49faf0;console[_0x247649(0x11e)](a42_0x559671[_0x247649(0x10f)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x247649(0x11e)](a42_0x559671[_0x247649(0x10f)](_0x247649(0xfd)));const {options:_0x575398,args:_0x1c7b47,tdx:_0x2d71c7}=_0xd9b1f7,_0x53b594=_0x575398;if(_0x1c7b47[_0x247649(0x117)]===0x0)return console[_0x247649(0x11e)](_0x247649(0x107)),console[_0x247649(0x11e)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x247649(0x11e)](_0x247649(0x110)),console[_0x247649(0x11e)](_0x247649(0x124)),console[_0x247649(0x11e)](_0x247649(0x126)),0x1;const _0x480562=_0x1c7b47[0x0],_0x35b9a3=_0x575398[_0x247649(0xff)];let _0x4941d=_0x480562;_0x35b9a3&&!_0x480562[_0x247649(0xfc)]('/')&&(_0x4941d=_0x35b9a3+'/'+_0x480562,_0x53b594['verbose']&&console[_0x247649(0x11e)](_0x247649(0x118)+_0x4941d));const _0x3645e5=await withSpinner(_0x247649(0xfb)+_0x4941d+'\x27...',()=>_0x2d71c7[_0x247649(0x123)][_0x247649(0x103)](_0x4941d),{'verbose':_0x53b594['verbose']}),_0x260350=_0x3645e5['data'];_0x53b594[_0x247649(0x10b)]&&console[_0x247649(0x11e)](_0x247649(0x10e)+_0x260350[_0x247649(0x10a)]);if(_0x260350[_0x247649(0x10a)]!=='segment')return console[_0x247649(0x11e)](_0x247649(0xfa)+_0x260350[_0x247649(0x10a)]+_0x247649(0x114)),console['error'](_0x247649(0x127)),0x1;if(!_0x260350[_0x247649(0x116)])throw new SDKError(ErrorCode['INTERNAL'],_0x247649(0x120));const _0x4758fe=_0x260350[_0x247649(0x111)],_0x437261=_0x260350[_0x247649(0x116)];_0x53b594[_0x247649(0x10b)]&&(console['error']('Parent\x20ID:\x20'+_0x4758fe),console['error'](_0x247649(0x11b)+_0x437261));let _0x52117c;if(_0x53b594[_0x247649(0x109)]){const _0x43637f=_0x53b594['folder'],_0x127f27=await withSpinner('Resolving\x20folder\x20\x27'+_0x43637f+_0x247649(0xf9),()=>_0x2d71c7[_0x247649(0x123)][_0x247649(0xfe)](_0x4758fe,_0x43637f),{'verbose':_0x53b594[_0x247649(0x10b)]});_0x52117c=parseInt(_0x127f27[_0x247649(0xf5)],0xa),_0x53b594['verbose']&&console['error'](_0x247649(0x108)+_0x52117c);}const _0x43c369=await loadJSONFromOptions(_0x53b594[_0x247649(0x11c)],_0x53b594[_0x247649(0x121)]),_0x320dd9={'name':_0x53b594[_0x247649(0x119)],'description':_0x53b594[_0x247649(0x101)],'rule':_0x43c369,'kind':_0x53b594[_0x247649(0x115)]!==undefined?parseInt(_0x53b594[_0x247649(0x115)],0xa):undefined,'segmentFolderId':_0x52117c},_0x461929=await withSpinner('Updating\x20segment\x20\x27'+_0x260350['segmentName']+_0x247649(0xf9),()=>_0x2d71c7[_0x247649(0x123)][_0x247649(0xf8)](_0x4758fe,_0x437261,_0x320dd9),{'verbose':_0x53b594['verbose']}),_0x36a1a6=_0x461929['data'];return console['error'](_0x247649(0x10d)+_0x36a1a6[_0x247649(0x119)]+'\x27'),_0x4941d!==_0x480562&&console['error'](_0x247649(0x104)+_0x4941d),await handleSDKOutput([_0x36a1a6],_0x53b594),0x0;}}function a42_0x25d5(){const _0x4e3c52=['\x27...','Error:\x20Cannot\x20update\x20','Resolving\x20path\x20\x27','includes','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolveFolderId','segmentPath','execute','description','413358iWFquN','resolvePathToResource','\x20\x20\x20Path:\x20','12qmxGiI','56031dFCLAq','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolved\x20folder\x20ID:\x20','folder','type','verbose','Update\x20existing\x20child\x20segment','✔\x20Updated\x20segment\x20\x27','Resolved\x20type:\x20','yellow','Examples:','parentId','8sQodrU','240TNnGte','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','kind','segmentId','length','Resolved\x20relative\x20path\x20to:\x20','name','segment:update','Segment\x20ID:\x20','rule','945238uKDRCC','error','32LkrpsN','Segment\x20ID\x20missing\x20from\x20resolved\x20path','ruleFile','6654GnwNQS','segment','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','860245Tfmxcu','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','data','3660057cxaRnC','680716XbRXQy','updateSegmentById'];a42_0x25d5=function(){return _0x4e3c52;};return a42_0x25d5();}
@@ -1 +1 @@
1
- const a43_0x99ae47=a43_0xaabc;(function(_0x2724f0,_0x2e7ad6){const _0x245f76=a43_0xaabc,_0x5d125e=_0x2724f0();while(!![]){try{const _0x3fcbfd=parseInt(_0x245f76(0x114))/0x1+parseInt(_0x245f76(0x111))/0x2+-parseInt(_0x245f76(0x110))/0x3*(-parseInt(_0x245f76(0xfd))/0x4)+-parseInt(_0x245f76(0x102))/0x5+-parseInt(_0x245f76(0xfc))/0x6+-parseInt(_0x245f76(0xf6))/0x7*(-parseInt(_0x245f76(0xf5))/0x8)+parseInt(_0x245f76(0xf3))/0x9*(-parseInt(_0x245f76(0xf8))/0xa);if(_0x3fcbfd===_0x2e7ad6)break;else _0x5d125e['push'](_0x5d125e['shift']());}catch(_0x4734ba){_0x5d125e['push'](_0x5d125e['shift']());}}}(a43_0x19b0,0x47fb0));import{existsSync,statSync}from'fs';import a43_0x3bb1f2 from'chalk';function a43_0x19b0(){const _0x317266=['parentName','✔\x20Context\x20set\x20to:\x20','dim','join','log','name','873LnCDcf','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','16hfNXXP','1522570iEIAhp','type','94090guRTUU','segmentPath','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','error','1004004mTyKYb','52908PbvIkP','resolvePathToResource','split','cyan','Usage:\x20tdx\x20segment\x20use\x20<path>','265175UMcPff','red','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Target\x20path:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','slice','Error:\x20Path\x20is\x20required\x0a','verbose','parent_segment','Examples:','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','segment','3HJUaEP','1009550eipwLo','Resolved\x20path\x20type:\x20','config','474852DpAmSn','segments','folderId','data','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','fullPath','Resolving\x20path\x20\x27','\x27...','Resolved\x20relative\x20path\x20to:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','length','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','parentId','session'];a43_0x19b0=function(){return _0x317266;};return a43_0x19b0();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0xaabc(_0xd02d9b,_0x1c1196){_0xd02d9b=_0xd02d9b-0xf1;const _0x19b05c=a43_0x19b0();let _0xaabc15=_0x19b05c[_0xd02d9b];return _0xaabc15;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x99ae47(0xf2)]='segment:use';['description']=a43_0x99ae47(0xfa);async['execute'](_0x403a82){const _0x49287b=a43_0x99ae47,{options:_0x3d83bf,args:_0x42ca5c,tdx:_0x3b7b53}=_0x403a82;if(_0x42ca5c['length']===0x0)return console[_0x49287b(0xfb)](a43_0x3bb1f2['red'](_0x49287b(0x109))),console[_0x49287b(0xfb)](_0x49287b(0x101)),console[_0x49287b(0xfb)](_0x49287b(0x10c)),console['error'](_0x49287b(0x10e)),console[_0x49287b(0xfb)](_0x49287b(0x119)),console[_0x49287b(0xfb)](_0x49287b(0x104)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x127f1c=_0x42ca5c[0x0],_0x9dc680=_0x3d83bf[_0x49287b(0x123)];try{if(_0x127f1c==='/')return saveSessionContext({'segment_path':undefined},_0x9dc680),console['log'](a43_0x3bb1f2['green'](_0x49287b(0x105))),0x0;if(existsSync(_0x127f1c)&&statSync(_0x127f1c)['isDirectory']()){let _0x594678;try{_0x594678=findTdxConfig(_0x127f1c);}catch{return console[_0x49287b(0xfb)](a43_0x3bb1f2['red'](_0x49287b(0x120)+_0x127f1c)),console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x100)](_0x49287b(0x11e))),0x1;}const _0x78ad8c=_0x594678[_0x49287b(0x113)][_0x49287b(0x10b)];return saveSessionContext({'segment_path':_0x78ad8c,'parent_segment':_0x78ad8c},_0x9dc680),console['log'](a43_0x3bb1f2[_0x49287b(0x10d)](_0x49287b(0x125)+a43_0x3bb1f2['cyan'](_0x78ad8c))),0x0;}const _0x4a1337=_0x3d83bf[_0x49287b(0xf9)];let _0x4bd35c=_0x127f1c;const _0x31cb9c=parsePath(_0x127f1c);if(!_0x31cb9c['isAbsolute']){if(!_0x4a1337)return console[_0x49287b(0xfb)](a43_0x3bb1f2['red'](_0x49287b(0x107))),console[_0x49287b(0xfb)](a43_0x3bb1f2['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x127f1c==='..'){const _0x1222a4=_0x4a1337[_0x49287b(0xff)]('/')[_0x49287b(0x108)](0x0,-0x1)['join']('/');_0x4bd35c=_0x1222a4||'/';}else _0x127f1c==='.'?_0x4bd35c=_0x4a1337:_0x4bd35c=_0x4a1337+'/'+_0x127f1c;_0x3d83bf[_0x49287b(0x10a)]&&console[_0x49287b(0xfb)](_0x49287b(0x11d)+_0x4bd35c);}if(_0x4bd35c==='/'||_0x4bd35c==='')return saveSessionContext({'segment_path':undefined},_0x9dc680),console[_0x49287b(0xf1)](a43_0x3bb1f2[_0x49287b(0x10d)](_0x49287b(0x105))),0x0;_0x4bd35c=normalizePath(_0x4bd35c);const _0x3b1ae5=parsePath(_0x4bd35c)[_0x49287b(0x115)];if(_0x3b1ae5[_0x49287b(0x11f)]===0x0)return saveSessionContext({'segment_path':undefined},_0x9dc680),console['log'](a43_0x3bb1f2[_0x49287b(0x10d)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x3d83bf['verbose']&&(console['error']('Site:\x20'+_0x3d83bf['site']),console[_0x49287b(0xfb)](_0x49287b(0x106)+_0x4bd35c));const _0x3a500d=await withSpinner(_0x49287b(0x11b)+_0x4bd35c+_0x49287b(0x11c),()=>_0x3b7b53[_0x49287b(0x10f)][_0x49287b(0xfe)](_0x4bd35c),{'verbose':_0x3d83bf[_0x49287b(0x10a)]}),_0x2b8673=_0x3a500d[_0x49287b(0x117)];_0x3d83bf[_0x49287b(0x10a)]&&(console['error'](_0x49287b(0x112)+_0x2b8673[_0x49287b(0xf7)]),console['error']('Parent\x20ID:\x20'+_0x2b8673[_0x49287b(0x122)]),_0x2b8673['folderId']&&console[_0x49287b(0xfb)]('Folder\x20ID:\x20'+_0x2b8673[_0x49287b(0x116)]));if(_0x2b8673['type']==='segment')return console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x103)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x49287b(0xfb)](_0x49287b(0x118)),console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x100)]('Use:\x20tdx\x20segment\x20use\x20'+_0x2b8673[_0x49287b(0x124)]+(_0x2b8673['folderPath']?'/'+_0x2b8673['folderPath'][_0x49287b(0x127)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2b8673['fullPath'],'parent_segment':_0x2b8673[_0x49287b(0x124)]},_0x9dc680),console[_0x49287b(0xf1)](a43_0x3bb1f2[_0x49287b(0x10d)](_0x49287b(0x125)+a43_0x3bb1f2[_0x49287b(0x100)](_0x2b8673[_0x49287b(0x11a)]))),_0x3d83bf[_0x49287b(0x10a)]&&(console[_0x49287b(0xfb)](a43_0x3bb1f2[_0x49287b(0x126)](_0x49287b(0xf4))),console['error'](a43_0x3bb1f2['dim'](_0x49287b(0x121)))),0x0;}catch(_0x508c7e){throw _0x508c7e;}}}
1
+ const a43_0x1b40e1=a43_0x2e73;function a43_0x1222(){const _0x33a080=['error','isAbsolute','Parent\x20ID:\x20','\x27...','115032IpkXGC','log','138KsqZlN','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','parentId','description','site','verbose','9pbgHCA','✔\x20Context\x20set\x20to:\x20','slice','parent_segment','green','isDirectory','dim','segments','folderId','cyan','resolvePathToResource','990160pgbOgb','split','Examples:','name','9226080yOfnUj','237013EsLAOW','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','segment:use','parentName','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','session','Site:\x20','length','red','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','join','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','24byLwpH','Resolved\x20path\x20type:\x20','Resolving\x20path\x20\x27','data','8256248vpZOvB','type','fullPath','Folder\x20ID:\x20','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','segment','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Error:\x20Path\x20is\x20required\x0a','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segmentPath','14629IauIKK','Use:\x20tdx\x20segment\x20use\x20','Target\x20path:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','config','361960hGSwXc','folderPath','78DDpTXZ'];a43_0x1222=function(){return _0x33a080;};return a43_0x1222();}(function(_0x4a6a7b,_0x34edf0){const _0x1b4f16=a43_0x2e73,_0x4e0295=_0x4a6a7b();while(!![]){try{const _0x35ad0a=-parseInt(_0x1b4f16(0x1df))/0x1*(parseInt(_0x1b4f16(0x1e6))/0x2)+-parseInt(_0x1b4f16(0x1eb))/0x3*(-parseInt(_0x1b4f16(0x1ce))/0x4)+parseInt(_0x1b4f16(0x1bc))/0x5+parseInt(_0x1b4f16(0x1ed))/0x6*(parseInt(_0x1b4f16(0x1c1))/0x7)+-parseInt(_0x1b4f16(0x1e4))/0x8*(-parseInt(_0x1b4f16(0x1b1))/0x9)+-parseInt(_0x1b4f16(0x1c0))/0xa+parseInt(_0x1b4f16(0x1d2))/0xb;if(_0x35ad0a===_0x34edf0)break;else _0x4e0295['push'](_0x4e0295['shift']());}catch(_0x3ef970){_0x4e0295['push'](_0x4e0295['shift']());}}}(a43_0x1222,0x7c657));import{existsSync,statSync}from'fs';import a43_0x454e93 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0x2e73(_0x5a0c16,_0x58f345){_0x5a0c16=_0x5a0c16-0x1ac;const _0x122261=a43_0x1222();let _0x2e7307=_0x122261[_0x5a0c16];return _0x2e7307;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x1b40e1(0x1bf)]=a43_0x1b40e1(0x1c3);[a43_0x1b40e1(0x1ae)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async['execute'](_0x418cb5){const _0x159acd=a43_0x1b40e1,{options:_0x5f5ab8,args:_0x4e6c21,tdx:_0x11c334}=_0x418cb5;if(_0x4e6c21[_0x159acd(0x1c9)]===0x0)return console['error'](a43_0x454e93[_0x159acd(0x1ca)](_0x159acd(0x1d9))),console[_0x159acd(0x1e7)](_0x159acd(0x1dc)),console[_0x159acd(0x1e7)](_0x159acd(0x1be)),console[_0x159acd(0x1e7)](_0x159acd(0x1c5)),console['error'](_0x159acd(0x1e2)),console[_0x159acd(0x1e7)](_0x159acd(0x1c2)),console[_0x159acd(0x1e7)](_0x159acd(0x1d8)),0x1;const _0x1650b7=_0x4e6c21[0x0],_0x4d1e92=_0x5f5ab8[_0x159acd(0x1c7)];try{if(_0x1650b7==='/')return saveSessionContext({'segment_path':undefined},_0x4d1e92),console['log'](a43_0x454e93[_0x159acd(0x1b5)](_0x159acd(0x1ac))),0x0;if(existsSync(_0x1650b7)&&statSync(_0x1650b7)[_0x159acd(0x1b6)]()){let _0x142e88;try{_0x142e88=findTdxConfig(_0x1650b7);}catch{return console[_0x159acd(0x1e7)](a43_0x454e93['red'](_0x159acd(0x1dd)+_0x1650b7)),console[_0x159acd(0x1e7)](a43_0x454e93['cyan'](_0x159acd(0x1da))),0x1;}const _0x3e4220=_0x142e88[_0x159acd(0x1e3)][_0x159acd(0x1b4)];return saveSessionContext({'segment_path':_0x3e4220,'parent_segment':_0x3e4220},_0x4d1e92),console[_0x159acd(0x1ec)](a43_0x454e93[_0x159acd(0x1b5)](_0x159acd(0x1b2)+a43_0x454e93[_0x159acd(0x1ba)](_0x3e4220))),0x0;}const _0x2bb19d=_0x5f5ab8[_0x159acd(0x1de)];let _0x2b934d=_0x1650b7;const _0x1f2e85=parsePath(_0x1650b7);if(!_0x1f2e85[_0x159acd(0x1e8)]){if(!_0x2bb19d)return console[_0x159acd(0x1e7)](a43_0x454e93[_0x159acd(0x1ca)](_0x159acd(0x1c6))),console['error'](a43_0x454e93[_0x159acd(0x1ba)](_0x159acd(0x1d6))),0x1;if(_0x1650b7==='..'){const _0xfe6f67=_0x2bb19d[_0x159acd(0x1bd)]('/')[_0x159acd(0x1b3)](0x0,-0x1)[_0x159acd(0x1cc)]('/');_0x2b934d=_0xfe6f67||'/';}else _0x1650b7==='.'?_0x2b934d=_0x2bb19d:_0x2b934d=_0x2bb19d+'/'+_0x1650b7;_0x5f5ab8[_0x159acd(0x1b0)]&&console[_0x159acd(0x1e7)](_0x159acd(0x1db)+_0x2b934d);}if(_0x2b934d==='/'||_0x2b934d==='')return saveSessionContext({'segment_path':undefined},_0x4d1e92),console[_0x159acd(0x1ec)](a43_0x454e93[_0x159acd(0x1b5)](_0x159acd(0x1ac))),0x0;_0x2b934d=normalizePath(_0x2b934d);const _0x2e8e32=parsePath(_0x2b934d)[_0x159acd(0x1b8)];if(_0x2e8e32[_0x159acd(0x1c9)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4d1e92),console[_0x159acd(0x1ec)](a43_0x454e93['green'](_0x159acd(0x1ac))),0x0;_0x5f5ab8[_0x159acd(0x1b0)]&&(console[_0x159acd(0x1e7)](_0x159acd(0x1c8)+_0x5f5ab8[_0x159acd(0x1af)]),console[_0x159acd(0x1e7)](_0x159acd(0x1e1)+_0x2b934d));const _0x5483dc=await withSpinner(_0x159acd(0x1d0)+_0x2b934d+_0x159acd(0x1ea),()=>_0x11c334[_0x159acd(0x1d7)][_0x159acd(0x1bb)](_0x2b934d),{'verbose':_0x5f5ab8[_0x159acd(0x1b0)]}),_0x3168b1=_0x5483dc[_0x159acd(0x1d1)];_0x5f5ab8[_0x159acd(0x1b0)]&&(console[_0x159acd(0x1e7)](_0x159acd(0x1cf)+_0x3168b1[_0x159acd(0x1d3)]),console[_0x159acd(0x1e7)](_0x159acd(0x1e9)+_0x3168b1[_0x159acd(0x1ad)]),_0x3168b1['folderId']&&console[_0x159acd(0x1e7)](_0x159acd(0x1d5)+_0x3168b1[_0x159acd(0x1b9)]));if(_0x3168b1[_0x159acd(0x1d3)]==='segment')return console['error'](a43_0x454e93[_0x159acd(0x1ca)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x159acd(0x1e7)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x159acd(0x1e7)](a43_0x454e93[_0x159acd(0x1ba)](_0x159acd(0x1e0)+_0x3168b1[_0x159acd(0x1c4)]+(_0x3168b1['folderPath']?'/'+_0x3168b1[_0x159acd(0x1e5)][_0x159acd(0x1cc)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x3168b1[_0x159acd(0x1d4)],'parent_segment':_0x3168b1[_0x159acd(0x1c4)]},_0x4d1e92),console[_0x159acd(0x1ec)](a43_0x454e93[_0x159acd(0x1b5)]('✔\x20Context\x20set\x20to:\x20'+a43_0x454e93[_0x159acd(0x1ba)](_0x3168b1[_0x159acd(0x1d4)]))),_0x5f5ab8['verbose']&&(console['error'](a43_0x454e93[_0x159acd(0x1b7)](_0x159acd(0x1cd))),console['error'](a43_0x454e93[_0x159acd(0x1b7)](_0x159acd(0x1cb)))),0x0;}catch(_0x57c1ec){throw _0x57c1ec;}}}
@@ -1 +1 @@
1
- const a44_0x2cbb89=a44_0x100a;(function(_0x3af6b6,_0x1188ca){const _0xf9ae0e=a44_0x100a,_0x2f61c1=_0x3af6b6();while(!![]){try{const _0x354cb6=parseInt(_0xf9ae0e(0x11a))/0x1*(-parseInt(_0xf9ae0e(0x129))/0x2)+-parseInt(_0xf9ae0e(0x120))/0x3*(parseInt(_0xf9ae0e(0x121))/0x4)+-parseInt(_0xf9ae0e(0xf3))/0x5*(parseInt(_0xf9ae0e(0xf5))/0x6)+-parseInt(_0xf9ae0e(0x119))/0x7+parseInt(_0xf9ae0e(0x10c))/0x8*(parseInt(_0xf9ae0e(0xf7))/0x9)+-parseInt(_0xf9ae0e(0x110))/0xa*(parseInt(_0xf9ae0e(0x114))/0xb)+parseInt(_0xf9ae0e(0x118))/0xc;if(_0x354cb6===_0x1188ca)break;else _0x2f61c1['push'](_0x2f61c1['shift']());}catch(_0x10093c){_0x2f61c1['push'](_0x2f61c1['shift']());}}}(a44_0x5d37,0xb680b));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a44_0x100a(_0x404070,_0x16505e){_0x404070=_0x404070-0xf3;const _0x5d378d=a44_0x5d37();let _0x100a2f=_0x5d378d[_0x404070];return _0x100a2f;}function a44_0x5d37(){const _0x26d412=['red','validCount','\x20file(s)\x20with\x20errors,\x20','):\x20','dim','error','\x20warning(s)','9276112CSesUa','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','valid','file','10AYMkfV','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','Validate\x20segment\x20and\x20journey\x20YAML\x20files','Validation\x20failed:\x20','7061164XOyGeC','name','warningCount','execute','60846444fNiZcL','8791314cNeHfh','869YkMRmV','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','filePath','.yaml','hasErrors','\x20file(s)\x20valid','3280368Ejrgku','4WCuFmM','log','\x20warning(s)\x20found','errorCode','✔\x20All\x20','length','Error:\x20Directory\x20not\x20found:\x20','description','2726fdPfWU','message','284085SRsrmq','yellow','138mZtxNx','green','9lXxVyo','warnings','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','errors','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','no_parent','type','cyan','parentSegment','\x20valid','helpText','segment:validate','.yml','endsWith'];a44_0x5d37=function(){return _0x26d412;};return a44_0x5d37();}import a44_0x5aa63f from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x2cbb89(0x115)]=a44_0x2cbb89(0x102);[a44_0x2cbb89(0x128)]=a44_0x2cbb89(0x112);async[a44_0x2cbb89(0x117)](_0x583b58){const _0x59a91c=a44_0x2cbb89,{options:_0x529f3a,args:_0x5831a3}=_0x583b58,_0x31a3e6=_0x529f3a,_0x3e49ad=await resolveTarget({'arg':_0x5831a3[0x0],'contextParent':_0x529f3a[_0x59a91c(0xff)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3e49ad))return _0x3e49ad[_0x59a91c(0x124)]===_0x59a91c(0xfc)?(console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0xf4)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x59a91c(0x10a)](_0x59a91c(0xfb)),console[_0x59a91c(0x10a)](_0x59a91c(0x111)),console[_0x59a91c(0x10a)](_0x59a91c(0x11b))):(console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0x105)]('Error:\x20'+_0x3e49ad[_0x59a91c(0x12a)]+'\x0a')),_0x3e49ad[_0x59a91c(0x101)]&&console['error'](a44_0x5aa63f[_0x59a91c(0xfe)](_0x3e49ad[_0x59a91c(0x101)]))),0x1;const _0x491e77=_0x3e49ad['targetDir'],_0x42e532=_0x3e49ad[_0x59a91c(0xfd)]===_0x59a91c(0x10f)?_0x3e49ad[_0x59a91c(0x11c)]:undefined;if(!_0x42e532&&!existsSync(_0x491e77))return console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0x105)](_0x59a91c(0x127)+_0x491e77+'\x0a')),0x1;let _0x3b5257;if(_0x42e532){if(!_0x42e532[_0x59a91c(0x104)](_0x59a91c(0x103))&&!_0x42e532[_0x59a91c(0x104)](_0x59a91c(0x11d)))return console[_0x59a91c(0x10a)](a44_0x5aa63f['red'](_0x59a91c(0x10d)+_0x42e532+'\x0a')),0x1;_0x3b5257=[_0x42e532];}else _0x3b5257=findYamlFiles(_0x491e77);if(_0x3b5257[_0x59a91c(0x126)]===0x0)return console[_0x59a91c(0x10a)](a44_0x5aa63f[_0x59a91c(0x105)](_0x59a91c(0xf9)+_0x491e77+'\x0a')),0x1;const _0x52dc0e=validateYamlFiles(_0x3b5257,_0x491e77),_0x5d938e=calculateSummary(_0x52dc0e);for(const _0x11acfc of _0x52dc0e){if(!isValidationResult(_0x11acfc))continue;const {relativePath:_0x417f24,source:_0x882b16,result:_0x141b28,fileType:_0x4b7068}=_0x11acfc,_0x57270c=_0x4b7068;if(_0x141b28[_0x59a91c(0x10e)]&&_0x141b28[_0x59a91c(0xf8)][_0x59a91c(0x126)]===0x0)_0x31a3e6['verbose']&&console['log'](a44_0x5aa63f[_0x59a91c(0xf6)]('✔\x20'+_0x417f24)+a44_0x5aa63f[_0x59a91c(0x109)]('\x20('+_0x57270c+')'));else _0x141b28[_0x59a91c(0x10e)]?(console['log'](a44_0x5aa63f[_0x59a91c(0xf4)]('⚠\x20'+_0x417f24)+a44_0x5aa63f[_0x59a91c(0x109)]('\x20('+_0x57270c+_0x59a91c(0x108)+_0x141b28[_0x59a91c(0xf8)]['length']+_0x59a91c(0x10b))),console['log'](formatValidationResult(_0x141b28,_0x882b16,_0x417f24))):(console['log'](a44_0x5aa63f[_0x59a91c(0x105)]('✖\x20'+_0x417f24)+a44_0x5aa63f['dim']('\x20('+_0x57270c+_0x59a91c(0x108)+_0x141b28[_0x59a91c(0xfa)][_0x59a91c(0x126)]+'\x20error(s)')),console[_0x59a91c(0x122)](formatValidationResult(_0x141b28,_0x882b16,_0x417f24)));}return console[_0x59a91c(0x122)](''),_0x5d938e[_0x59a91c(0x11e)]?(console[_0x59a91c(0x122)](a44_0x5aa63f['red'](_0x59a91c(0x113)+_0x5d938e['invalidCount']+_0x59a91c(0x107)+_0x5d938e['validCount']+_0x59a91c(0x100))),_0x5d938e[_0x59a91c(0x116)]>0x0&&console[_0x59a91c(0x122)](a44_0x5aa63f['yellow'](_0x5d938e['warningCount']+_0x59a91c(0x123))),0x1):(console['log'](a44_0x5aa63f[_0x59a91c(0xf6)](_0x59a91c(0x125)+_0x5d938e[_0x59a91c(0x106)]+_0x59a91c(0x11f))),_0x5d938e[_0x59a91c(0x116)]>0x0&&console[_0x59a91c(0x122)](a44_0x5aa63f[_0x59a91c(0xf4)](_0x5d938e['warningCount']+_0x59a91c(0x123))),0x0);}}
1
+ const a44_0x40c175=a44_0x59da;(function(_0x4c135a,_0x3fa213){const _0x215a4f=a44_0x59da,_0x1e3d25=_0x4c135a();while(!![]){try{const _0x57f92b=parseInt(_0x215a4f(0x194))/0x1+parseInt(_0x215a4f(0x17e))/0x2+parseInt(_0x215a4f(0x18d))/0x3*(-parseInt(_0x215a4f(0x17c))/0x4)+-parseInt(_0x215a4f(0x187))/0x5+parseInt(_0x215a4f(0x19c))/0x6*(-parseInt(_0x215a4f(0x17d))/0x7)+-parseInt(_0x215a4f(0x171))/0x8*(-parseInt(_0x215a4f(0x178))/0x9)+parseInt(_0x215a4f(0x176))/0xa;if(_0x57f92b===_0x3fa213)break;else _0x1e3d25['push'](_0x1e3d25['shift']());}catch(_0x15b40c){_0x1e3d25['push'](_0x1e3d25['shift']());}}}(a44_0x4bf6,0x98973));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x3c63e1 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a44_0x4bf6(){const _0x33bfaa=['11568760KjIUeW','\x20file(s)\x20with\x20errors,\x20','83862SeMcxo','errorCode','dim','length','4mOhrYz','14441gKFpap','1319296RueLeC','targetDir','validCount','\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','green','warningCount','file','filePath','Error:\x20Directory\x20not\x20found:\x20','6084825jlZenT','):\x20','valid','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','error','helpText','941037FvFtsf','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','.yaml','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20file(s)\x20valid','Validation\x20failed:\x20','813790tUxXbp','Error:\x20','type','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','verbose','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','cwd','\x20valid','2058isKPCL','\x20warning(s)\x20found','cyan','endsWith','yellow','parentSegment','\x20error(s)','log','200XJUzOQ','warnings','description','✔\x20All\x20','red'];a44_0x4bf6=function(){return _0x33bfaa;};return a44_0x4bf6();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a44_0x59da(_0x4b0e52,_0x331aad){_0x4b0e52=_0x4b0e52-0x16d;const _0x4bf678=a44_0x4bf6();let _0x59daf7=_0x4bf678[_0x4b0e52];return _0x59daf7;}export class SegmentValidateCommand extends BaseCommand{['name']='segment:validate';[a44_0x40c175(0x173)]=a44_0x40c175(0x18f);async['execute'](_0x2d7122){const _0xf9aad6=a44_0x40c175,{options:_0x129c11,args:_0x4a9868}=_0x2d7122,_0x4ef074=_0x129c11,_0x3b2548=await resolveTarget({'arg':_0x4a9868[0x0],'contextParent':_0x129c11[_0xf9aad6(0x16e)],'cwd':process[_0xf9aad6(0x19a)]()});if(!isSuccessfulResolution(_0x3b2548))return _0x3b2548[_0xf9aad6(0x179)]==='no_parent'?(console['error'](a44_0x3c63e1[_0xf9aad6(0x16d)](_0xf9aad6(0x199))),console[_0xf9aad6(0x18b)](_0xf9aad6(0x197)),console[_0xf9aad6(0x18b)](_0xf9aad6(0x181)),console[_0xf9aad6(0x18b)](_0xf9aad6(0x18a))):(console[_0xf9aad6(0x18b)](a44_0x3c63e1[_0xf9aad6(0x175)](_0xf9aad6(0x195)+_0x3b2548['message']+'\x0a')),_0x3b2548[_0xf9aad6(0x18c)]&&console[_0xf9aad6(0x18b)](a44_0x3c63e1[_0xf9aad6(0x19e)](_0x3b2548['helpText']))),0x1;const _0x322aa8=_0x3b2548[_0xf9aad6(0x17f)],_0x1ee50b=_0x3b2548[_0xf9aad6(0x196)]===_0xf9aad6(0x184)?_0x3b2548[_0xf9aad6(0x185)]:undefined;if(!_0x1ee50b&&!existsSync(_0x322aa8))return console[_0xf9aad6(0x18b)](a44_0x3c63e1['red'](_0xf9aad6(0x186)+_0x322aa8+'\x0a')),0x1;let _0x95a391;if(_0x1ee50b){if(!_0x1ee50b[_0xf9aad6(0x19f)]('.yml')&&!_0x1ee50b[_0xf9aad6(0x19f)](_0xf9aad6(0x190)))return console[_0xf9aad6(0x18b)](a44_0x3c63e1[_0xf9aad6(0x175)](_0xf9aad6(0x191)+_0x1ee50b+'\x0a')),0x1;_0x95a391=[_0x1ee50b];}else _0x95a391=findYamlFiles(_0x322aa8);if(_0x95a391[_0xf9aad6(0x17b)]===0x0)return console[_0xf9aad6(0x18b)](a44_0x3c63e1[_0xf9aad6(0x175)](_0xf9aad6(0x18e)+_0x322aa8+'\x0a')),0x1;const _0x58120b=validateYamlFiles(_0x95a391,_0x322aa8),_0x2714ff=calculateSummary(_0x58120b);for(const _0x1dfd68 of _0x58120b){if(!isValidationResult(_0x1dfd68))continue;const {relativePath:_0x7be4ef,source:_0x45585a,result:_0x50966c,fileType:_0x52640e}=_0x1dfd68,_0x1ed69b=_0x52640e;if(_0x50966c['valid']&&_0x50966c['warnings']['length']===0x0)_0x4ef074[_0xf9aad6(0x198)]&&console[_0xf9aad6(0x170)](a44_0x3c63e1[_0xf9aad6(0x182)]('✔\x20'+_0x7be4ef)+a44_0x3c63e1[_0xf9aad6(0x17a)]('\x20('+_0x1ed69b+')'));else _0x50966c[_0xf9aad6(0x189)]?(console['log'](a44_0x3c63e1[_0xf9aad6(0x16d)]('⚠\x20'+_0x7be4ef)+a44_0x3c63e1[_0xf9aad6(0x17a)]('\x20('+_0x1ed69b+_0xf9aad6(0x188)+_0x50966c[_0xf9aad6(0x172)][_0xf9aad6(0x17b)]+'\x20warning(s)')),console[_0xf9aad6(0x170)](formatValidationResult(_0x50966c,_0x45585a,_0x7be4ef))):(console[_0xf9aad6(0x170)](a44_0x3c63e1[_0xf9aad6(0x175)]('✖\x20'+_0x7be4ef)+a44_0x3c63e1[_0xf9aad6(0x17a)]('\x20('+_0x1ed69b+_0xf9aad6(0x188)+_0x50966c['errors']['length']+_0xf9aad6(0x16f))),console['log'](formatValidationResult(_0x50966c,_0x45585a,_0x7be4ef)));}return console[_0xf9aad6(0x170)](''),_0x2714ff['hasErrors']?(console[_0xf9aad6(0x170)](a44_0x3c63e1[_0xf9aad6(0x175)](_0xf9aad6(0x193)+_0x2714ff['invalidCount']+_0xf9aad6(0x177)+_0x2714ff[_0xf9aad6(0x180)]+_0xf9aad6(0x19b))),_0x2714ff[_0xf9aad6(0x183)]>0x0&&console['log'](a44_0x3c63e1['yellow'](_0x2714ff[_0xf9aad6(0x183)]+'\x20warning(s)\x20found')),0x1):(console[_0xf9aad6(0x170)](a44_0x3c63e1[_0xf9aad6(0x182)](_0xf9aad6(0x174)+_0x2714ff[_0xf9aad6(0x180)]+_0xf9aad6(0x192))),_0x2714ff[_0xf9aad6(0x183)]>0x0&&console[_0xf9aad6(0x170)](a44_0x3c63e1['yellow'](_0x2714ff[_0xf9aad6(0x183)]+_0xf9aad6(0x19d))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x69e3b4=a45_0x4536;(function(_0xd45e49,_0xbd40f0){const _0x3d1788=a45_0x4536,_0x58abe3=_0xd45e49();while(!![]){try{const _0x228767=-parseInt(_0x3d1788(0x177))/0x1*(parseInt(_0x3d1788(0x13f))/0x2)+parseInt(_0x3d1788(0x16b))/0x3*(parseInt(_0x3d1788(0x15c))/0x4)+-parseInt(_0x3d1788(0x140))/0x5*(-parseInt(_0x3d1788(0x13b))/0x6)+-parseInt(_0x3d1788(0x154))/0x7+parseInt(_0x3d1788(0x14c))/0x8*(parseInt(_0x3d1788(0x150))/0x9)+-parseInt(_0x3d1788(0x15a))/0xa+parseInt(_0x3d1788(0x168))/0xb;if(_0x228767===_0xbd40f0)break;else _0x58abe3['push'](_0x58abe3['shift']());}catch(_0x210515){_0x58abe3['push'](_0x58abe3['shift']());}}}(a45_0x17ef,0xe958c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a45_0x4536(_0x114f6a,_0x1940b1){_0x114f6a=_0x114f6a-0x131;const _0x17ef57=a45_0x17ef();let _0x4536c8=_0x17ef57[_0x114f6a];return _0x4536c8;}import{withSpinner}from'../utils/spinner.js';function a45_0x17ef(){const _0x4633ba=['format','Parent\x20segment\x20context:\x20','filter','/j/da','recursive','(not\x20set)',',\x20and\x20','38864MDsDGj','(empty)','Folder\x20ID:\x20','type','3528WrbmCM','jsonl','map','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','10985786quPKLP','sort','Recursive\x20mode:\x20enabled','data','name','listRecursive','2763630cPFpIV','Site:\x20','588804pogpKX','\x5c$&','\x20matching\x20\x27','\x20\x20Cause:\x20','listWithPattern','error','folders','segments','resolvePathToResource','Resolving\x20parent\x20segment\x20\x27','length','localeCompare','11815738ePcuVm','parentSegment','verbose','6AzZCCv','\x20journey','/e/','No\x20items\x20match\x20pattern:\x20','\x20segment','segment','Building\x20hierarchy\x20tree...','journeys','Parent\x20ID:\x20','\x27...','journeyBundleName','json','1280289zwnGbC','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x20folder','site','maxDepth','description','folder','replace','Error:\x20','listUnifiedWithJourneys','✔\x20Built\x20tree\x20with\x20','includes','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId','children','/app/ps/','✔\x20Found\x20','dim','Folder/pattern\x20arg:\x20','2426826RigeSw','log','cause','Listing\x20folders,\x20segments,\x20and\x20journeys...','2sjnmbo','10RQtiJR','parentId','journey','listUnified','test'];a45_0x17ef=function(){return _0x4633ba;};return a45_0x17ef();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x1b0a38 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x69e3b4(0x158)]=a45_0x69e3b4(0x163);[a45_0x69e3b4(0x17d)]='List\x20folders\x20and\x20child\x20segments';async['execute'](_0x36083b){const _0x514abc=a45_0x69e3b4,{options:_0x179bfc,args:_0x492206}=_0x36083b,_0x2ec69c=_0x179bfc[_0x514abc(0x149)],_0x25847e=_0x492206[0x0];try{const _0x372741=_0x179bfc[_0x514abc(0x169)];_0x179bfc['verbose']&&(console[_0x514abc(0x161)](_0x514abc(0x15b)+_0x179bfc[_0x514abc(0x17b)]),console['error'](_0x514abc(0x146)+(_0x372741||_0x514abc(0x14a))),_0x25847e&&console[_0x514abc(0x161)](_0x514abc(0x13a)+_0x25847e),_0x2ec69c&&console[_0x514abc(0x161)](_0x514abc(0x156)));if(!_0x372741)return console['error'](_0x514abc(0x179)),console['error'](''),console[_0x514abc(0x161)](_0x514abc(0x134)),console['error'](_0x514abc(0x178)),console[_0x514abc(0x161)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x514abc(0x161)](''),console[_0x514abc(0x161)](_0x514abc(0x153)),0x1;const _0x664863=_0x25847e&&(_0x25847e[_0x514abc(0x133)]('*')||_0x25847e['includes']('?'));if(_0x664863)return await this[_0x514abc(0x160)](_0x36083b,_0x372741,_0x25847e);const _0x21ad1a=_0x25847e?_0x372741+'/'+_0x25847e:_0x372741;return _0x2ec69c?await this[_0x514abc(0x159)](_0x36083b,_0x21ad1a):await this[_0x514abc(0x143)](_0x36083b,_0x21ad1a);}catch(_0xb09eda){if(_0xb09eda instanceof SDKError)return console[_0x514abc(0x161)](_0x514abc(0x180)+_0xb09eda['message']),_0xb09eda[_0x514abc(0x13d)]&&console[_0x514abc(0x161)](_0x514abc(0x15f)+_0xb09eda[_0x514abc(0x13d)]),0x1;throw _0xb09eda;}}async[a45_0x69e3b4(0x160)](_0x4f5096,_0xf4d4af,_0x50e15e){const _0x3d7dd8=a45_0x69e3b4,{options:_0x18c11d,tdx:_0x586120}=_0x4f5096,_0x471a03=await withSpinner(_0x3d7dd8(0x165)+_0xf4d4af+_0x3d7dd8(0x174),()=>_0x586120['segment'][_0x3d7dd8(0x164)](_0xf4d4af),{'verbose':_0x18c11d[_0x3d7dd8(0x16a)]}),_0x220025=_0x471a03['data'],_0x3ce4a9=await withSpinner(_0x3d7dd8(0x13e),()=>_0x586120[_0x3d7dd8(0x170)][_0x3d7dd8(0x131)](_0x220025['parentId'],_0x220025[_0x3d7dd8(0x135)]),{'verbose':_0x18c11d[_0x3d7dd8(0x16a)]}),{folders:_0x20bea4,segments:_0x1822a3,journeys:_0x4c396f}=_0x3ce4a9[_0x3d7dd8(0x157)],_0x8bd07d=_0x50e15e['replace'](/[.+^${}()|[\]\\]/g,_0x3d7dd8(0x15d))[_0x3d7dd8(0x17f)](/\*/g,'.*')[_0x3d7dd8(0x17f)](/\?/g,'.'),_0x37e266=new RegExp('^'+_0x8bd07d+'$','i'),_0xfe48c0=_0x20bea4[_0x3d7dd8(0x147)](_0x56eb2c=>_0x37e266[_0x3d7dd8(0x144)](_0x56eb2c[_0x3d7dd8(0x158)])),_0x2b4e13=_0x1822a3[_0x3d7dd8(0x147)](_0xf4d5be=>_0x37e266[_0x3d7dd8(0x144)](_0xf4d5be[_0x3d7dd8(0x158)])),_0x3f909c=_0x4c396f['filter'](_0x306d96=>_0x37e266['test'](_0x306d96[_0x3d7dd8(0x175)])),_0x65d920=_0xfe48c0[_0x3d7dd8(0x166)]+_0x2b4e13[_0x3d7dd8(0x166)]+_0x3f909c[_0x3d7dd8(0x166)];console[_0x3d7dd8(0x161)](_0x3d7dd8(0x138)+_0xfe48c0['length']+'\x20folder'+(_0xfe48c0[_0x3d7dd8(0x166)]!==0x1?'s':'')+',\x20'+_0x2b4e13[_0x3d7dd8(0x166)]+_0x3d7dd8(0x16f)+(_0x2b4e13['length']!==0x1?'s':'')+_0x3d7dd8(0x14b)+_0x3f909c['length']+'\x20journey'+(_0x3f909c[_0x3d7dd8(0x166)]!==0x1?'s':'')+_0x3d7dd8(0x15e)+_0x50e15e+'\x27');const _0x55d599=_0x3b379e=>{const _0x19f723=_0x3d7dd8;return getConsoleNextUrl(_0x18c11d[_0x19f723(0x17b)],_0x19f723(0x137)+_0x220025[_0x19f723(0x141)]+_0x19f723(0x16d)+_0x3b379e);},_0x2495a0=_0x18c11d[_0x3d7dd8(0x145)]===_0x3d7dd8(0x176)||_0x18c11d[_0x3d7dd8(0x145)]===_0x3d7dd8(0x151);if(_0x2495a0){const _0x8dd17e=[..._0xfe48c0['map'](_0x536ade=>({..._0x536ade,'type':_0x3d7dd8(0x17e)})),..._0x2b4e13['map'](_0x4dc4e7=>({..._0x4dc4e7,'type':'segment','url':_0x55d599(_0x4dc4e7['id'])})),..._0x3f909c[_0x3d7dd8(0x152)](_0x5c3560=>({..._0x5c3560,'name':_0x5c3560['journeyBundleName'],'type':_0x3d7dd8(0x142)}))][_0x3d7dd8(0x155)]((_0x5908e5,_0x1cdffe)=>_0x5908e5[_0x3d7dd8(0x158)]['localeCompare'](_0x1cdffe[_0x3d7dd8(0x158)]));await handleSDKOutput(_0x8dd17e,_0x18c11d);}else{if(_0x65d920===0x0)console[_0x3d7dd8(0x13c)](_0x3d7dd8(0x16e)+_0x50e15e);else{console['log'](a45_0x1b0a38[_0x3d7dd8(0x139)]('['+_0xf4d4af+']\x20matching\x20\x27'+_0x50e15e+'\x27'));const _0x1532ea=formatFlatList(_0xfe48c0,_0x2b4e13,{'showMetadata':!![],'getSegmentUrl':_0x55d599},_0x3f909c);console[_0x3d7dd8(0x13c)](_0x1532ea);}}return 0x0;}async[a45_0x69e3b4(0x143)](_0x2b275a,_0x3d06d8){const _0x4df490=a45_0x69e3b4,{options:_0x32c1f4,tdx:_0x27166f}=_0x2b275a,_0x158f2a=await withSpinner('Resolving\x20path\x20\x27'+_0x3d06d8+_0x4df490(0x174),()=>_0x27166f[_0x4df490(0x170)][_0x4df490(0x164)](_0x3d06d8),{'verbose':_0x32c1f4['verbose']}),_0x280744=_0x158f2a[_0x4df490(0x157)];_0x32c1f4[_0x4df490(0x16a)]&&(console[_0x4df490(0x161)]('Parent\x20ID:\x20'+_0x280744[_0x4df490(0x141)]),_0x280744['folderId']&&console[_0x4df490(0x161)]('Folder\x20ID:\x20'+_0x280744[_0x4df490(0x135)]));const _0x481660=await withSpinner(_0x4df490(0x13e),()=>_0x27166f[_0x4df490(0x170)][_0x4df490(0x131)](_0x280744['parentId'],_0x280744['folderId']),{'verbose':_0x32c1f4[_0x4df490(0x16a)]}),{folders:_0x4b0f77,segments:_0x4b8181,journeys:_0x2f91d0}=_0x481660[_0x4df490(0x157)],_0x2b0724=_0x4b0f77[_0x4df490(0x166)]+_0x4b8181[_0x4df490(0x166)]+_0x2f91d0['length'];console[_0x4df490(0x161)]('✔\x20Found\x20'+_0x4b0f77[_0x4df490(0x166)]+_0x4df490(0x17a)+(_0x4b0f77['length']!==0x1?'s':'')+',\x20'+_0x4b8181[_0x4df490(0x166)]+'\x20segment'+(_0x4b8181[_0x4df490(0x166)]!==0x1?'s':'')+',\x20and\x20'+_0x2f91d0[_0x4df490(0x166)]+_0x4df490(0x16c)+(_0x2f91d0[_0x4df490(0x166)]!==0x1?'s':''));const _0xc60b0=_0x5ec23b=>{const _0x24469c=_0x4df490;return getConsoleNextUrl(_0x32c1f4['site'],'/app/ps/'+_0x280744[_0x24469c(0x141)]+_0x24469c(0x16d)+_0x5ec23b);},_0x44d945=_0x155bad=>{const _0xd04951=_0x4df490;return getConsoleNextUrl(_0x32c1f4[_0xd04951(0x17b)],_0xd04951(0x137)+_0x280744[_0xd04951(0x141)]+_0xd04951(0x16d)+_0x155bad+_0xd04951(0x148));},_0x2dacff=_0x32c1f4[_0x4df490(0x145)]===_0x4df490(0x176)||_0x32c1f4['format']===_0x4df490(0x151);if(_0x2dacff){const _0x24e774=[..._0x4b0f77[_0x4df490(0x152)](_0x1f39ba=>({..._0x1f39ba,'type':_0x4df490(0x17e)})),..._0x4b8181[_0x4df490(0x152)](_0x5cd3f1=>({..._0x5cd3f1,'type':_0x4df490(0x170),'url':_0xc60b0(_0x5cd3f1['id'])})),..._0x2f91d0[_0x4df490(0x152)](_0x5d90c9=>({..._0x5d90c9,'name':_0x5d90c9[_0x4df490(0x175)],'type':'journey','url':_0x44d945(_0x5d90c9['id'])}))]['sort']((_0x234ef5,_0x20984c)=>_0x234ef5['name'][_0x4df490(0x167)](_0x20984c[_0x4df490(0x158)]));await handleSDKOutput(_0x24e774,_0x32c1f4);}else{if(_0x2b0724===0x0)console[_0x4df490(0x13c)](a45_0x1b0a38['dim']('['+_0x3d06d8+']')),console[_0x4df490(0x13c)](_0x4df490(0x14d));else{console[_0x4df490(0x13c)](a45_0x1b0a38[_0x4df490(0x139)]('['+_0x3d06d8+']'));const _0x5abded=formatFlatList(_0x4b0f77,_0x4b8181,{'showMetadata':!![],'getSegmentUrl':_0xc60b0,'getJourneyUrl':_0x44d945},_0x2f91d0);console[_0x4df490(0x13c)](_0x5abded);}}return 0x0;}async['listRecursive'](_0x57ed52,_0x15f7c9){const _0x31a1f1=a45_0x69e3b4,{options:_0x11ab1d,tdx:_0x2b3055}=_0x57ed52,_0x5a4739=await withSpinner('Resolving\x20path\x20\x27'+_0x15f7c9+_0x31a1f1(0x174),()=>_0x2b3055[_0x31a1f1(0x170)][_0x31a1f1(0x164)](_0x15f7c9),{'verbose':_0x11ab1d['verbose']}),_0x4d13ae=_0x5a4739[_0x31a1f1(0x157)];_0x11ab1d[_0x31a1f1(0x16a)]&&(console[_0x31a1f1(0x161)](_0x31a1f1(0x173)+_0x4d13ae['parentId']),_0x4d13ae[_0x31a1f1(0x135)]&&console[_0x31a1f1(0x161)](_0x31a1f1(0x14e)+_0x4d13ae[_0x31a1f1(0x135)]));const _0xbc545d=_0x11ab1d[_0x31a1f1(0x17c)]||0xa,_0x431b2f=await withSpinner(_0x31a1f1(0x171),()=>_0x2b3055[_0x31a1f1(0x170)][_0x31a1f1(0x159)](_0x4d13ae['parentId'],_0x4d13ae[_0x31a1f1(0x135)],0x0,_0xbc545d),{'verbose':_0x11ab1d['verbose']}),_0x7e21c6=_0x431b2f[_0x31a1f1(0x157)],_0x5aa7fd=_0x5e7172=>{const _0x46921c=_0x31a1f1;let _0x4c2883=0x0,_0x37a145=0x0,_0x33dae7=0x0;for(const _0xafa425 of _0x5e7172){if(_0xafa425[_0x46921c(0x14f)]===_0x46921c(0x17e))_0x4c2883++;else{if(_0xafa425['type']===_0x46921c(0x170))_0x37a145++;else{if(_0xafa425[_0x46921c(0x14f)]===_0x46921c(0x142))_0x33dae7++;}}if(_0xafa425[_0x46921c(0x136)]){const _0x16dff7=_0x5aa7fd(_0xafa425['children']);_0x4c2883+=_0x16dff7[_0x46921c(0x162)],_0x37a145+=_0x16dff7[_0x46921c(0x163)],_0x33dae7+=_0x16dff7[_0x46921c(0x172)];}}return{'folders':_0x4c2883,'segments':_0x37a145,'journeys':_0x33dae7};},_0x499d59=_0x5aa7fd(_0x7e21c6);console[_0x31a1f1(0x161)](_0x31a1f1(0x132)+_0x499d59[_0x31a1f1(0x162)]+'\x20folder'+(_0x499d59[_0x31a1f1(0x162)]!==0x1?'s':'')+',\x20'+_0x499d59['segments']+_0x31a1f1(0x16f)+(_0x499d59[_0x31a1f1(0x163)]!==0x1?'s':'')+_0x31a1f1(0x14b)+_0x499d59[_0x31a1f1(0x172)]+_0x31a1f1(0x16c)+(_0x499d59[_0x31a1f1(0x172)]!==0x1?'s':''));const _0x12c3f0=_0x31dc6a=>{const _0xbd79b8=_0x31a1f1;return getConsoleNextUrl(_0x11ab1d['site'],_0xbd79b8(0x137)+_0x4d13ae[_0xbd79b8(0x141)]+_0xbd79b8(0x16d)+_0x31dc6a);},_0x1d5baa=_0x157eab=>{const _0x5b1161=_0x31a1f1;return getConsoleNextUrl(_0x11ab1d[_0x5b1161(0x17b)],_0x5b1161(0x137)+_0x4d13ae[_0x5b1161(0x141)]+'/e/'+_0x157eab+_0x5b1161(0x148));};if(_0x11ab1d[_0x31a1f1(0x145)]===_0x31a1f1(0x176)||_0x11ab1d[_0x31a1f1(0x145)]==='jsonl')await handleSDKOutput(_0x7e21c6,_0x11ab1d);else{console['log'](a45_0x1b0a38['dim']('['+_0x15f7c9+']'));const _0x191219=formatTree(_0x7e21c6,{'showMetadata':!![],'getSegmentUrl':_0x12c3f0,'getJourneyUrl':_0x1d5baa});console[_0x31a1f1(0x13c)](_0x191219);}return 0x0;}}
1
+ const a45_0x4eb677=a45_0x4135;(function(_0x57edb2,_0x2e8882){const _0x31ec4f=a45_0x4135,_0x30811e=_0x57edb2();while(!![]){try{const _0x464670=parseInt(_0x31ec4f(0x113))/0x1+parseInt(_0x31ec4f(0x117))/0x2+parseInt(_0x31ec4f(0x10f))/0x3*(parseInt(_0x31ec4f(0x112))/0x4)+-parseInt(_0x31ec4f(0x116))/0x5+-parseInt(_0x31ec4f(0x145))/0x6*(-parseInt(_0x31ec4f(0x14d))/0x7)+-parseInt(_0x31ec4f(0x134))/0x8+-parseInt(_0x31ec4f(0x12a))/0x9;if(_0x464670===_0x2e8882)break;else _0x30811e['push'](_0x30811e['shift']());}catch(_0x52b9da){_0x30811e['push'](_0x30811e['shift']());}}}(a45_0x4b1d,0x23aad));function a45_0x4b1d(){const _0x1737ad=['recursive','Parent\x20ID:\x20','Error:\x20','24siAOXn','listUnifiedWithJourneys','test','\x20folder','folderId','Resolving\x20parent\x20segment\x20\x27','cause','jsonl','357567LrUtHY','maxDepth','type','site','data','map','✔\x20Found\x20','\x20journey','segment','parentSegment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','(empty)','(not\x20set)','dim','journeys','/app/ps/','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','sort','27309clDkcU','\x20segment','✔\x20Built\x20tree\x20with\x20','116mDtedX','209223SwFgWr','Set\x20a\x20parent\x20segment\x20context\x20first:','verbose','650560vJzQiC','497260WBnQhu','No\x20items\x20match\x20pattern:\x20','Resolving\x20path\x20\x27','parentId','log','listUnified','length','filter','/j/da','folders','format','Parent\x20segment\x20context:\x20','json','replace','Recursive\x20mode:\x20enabled','Folder/pattern\x20arg:\x20','Folder\x20ID:\x20','journey','\x20matching\x20\x27','3427173HNUHeZ','List\x20folders\x20and\x20child\x20segments',',\x20and\x20','Building\x20hierarchy\x20tree...','description','segments','message','folder','includes','\x20\x20Cause:\x20','2153296tKoHbN','\x5c$&','listWithPattern','children','resolvePathToResource','error','name','\x27...','Error:\x20No\x20parent\x20segment\x20context\x20set.','journeyBundleName','Listing\x20folders,\x20segments,\x20and\x20journeys...','localeCompare','listRecursive','/e/'];a45_0x4b1d=function(){return _0x1737ad;};return a45_0x4b1d();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a45_0x4135(_0x3bcaf5,_0x5eec2b){_0x3bcaf5=_0x3bcaf5-0xfd;const _0x4b1d12=a45_0x4b1d();let _0x4135db=_0x4b1d12[_0x3bcaf5];return _0x4135db;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x2b40a0 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a45_0x4eb677(0x12f);[a45_0x4eb677(0x12e)]=a45_0x4eb677(0x12b);async['execute'](_0x4cd8ac){const _0x414419=a45_0x4eb677,{options:_0x5b38cd,args:_0x58db98}=_0x4cd8ac,_0x135348=_0x5b38cd[_0x414419(0x142)],_0x2bc246=_0x58db98[0x0];try{const _0x3278de=_0x5b38cd[_0x414419(0x105)];_0x5b38cd[_0x414419(0x115)]&&(console[_0x414419(0x139)]('Site:\x20'+_0x5b38cd[_0x414419(0xff)]),console['error'](_0x414419(0x122)+(_0x3278de||_0x414419(0x109))),_0x2bc246&&console[_0x414419(0x139)](_0x414419(0x126)+_0x2bc246),_0x135348&&console['error'](_0x414419(0x125)));if(!_0x3278de)return console['error'](_0x414419(0x13c)),console[_0x414419(0x139)](''),console[_0x414419(0x139)](_0x414419(0x114)),console['error'](_0x414419(0x106)),console['error'](_0x414419(0x107)),console[_0x414419(0x139)](''),console[_0x414419(0x139)](_0x414419(0x10d)),0x1;const _0x4fccde=_0x2bc246&&(_0x2bc246[_0x414419(0x132)]('*')||_0x2bc246['includes']('?'));if(_0x4fccde)return await this['listWithPattern'](_0x4cd8ac,_0x3278de,_0x2bc246);const _0x3598ca=_0x2bc246?_0x3278de+'/'+_0x2bc246:_0x3278de;return _0x135348?await this[_0x414419(0x140)](_0x4cd8ac,_0x3598ca):await this['listUnified'](_0x4cd8ac,_0x3598ca);}catch(_0xf280e1){if(_0xf280e1 instanceof SDKError)return console[_0x414419(0x139)](_0x414419(0x144)+_0xf280e1[_0x414419(0x130)]),_0xf280e1[_0x414419(0x14b)]&&console[_0x414419(0x139)](_0x414419(0x133)+_0xf280e1[_0x414419(0x14b)]),0x1;throw _0xf280e1;}}async[a45_0x4eb677(0x136)](_0x51f540,_0x47ea54,_0x2920d9){const _0x14ef1f=a45_0x4eb677,{options:_0x29f91c,tdx:_0x59282d}=_0x51f540,_0x45440c=await withSpinner(_0x14ef1f(0x14a)+_0x47ea54+_0x14ef1f(0x13b),()=>_0x59282d[_0x14ef1f(0x104)][_0x14ef1f(0x138)](_0x47ea54),{'verbose':_0x29f91c[_0x14ef1f(0x115)]}),_0x49eeb5=_0x45440c['data'],_0x466a66=await withSpinner(_0x14ef1f(0x13e),()=>_0x59282d[_0x14ef1f(0x104)][_0x14ef1f(0x146)](_0x49eeb5[_0x14ef1f(0x11a)],_0x49eeb5[_0x14ef1f(0x149)]),{'verbose':_0x29f91c[_0x14ef1f(0x115)]}),{folders:_0x2007fe,segments:_0x1f4669,journeys:_0x36db5b}=_0x466a66[_0x14ef1f(0x100)],_0x1427d9=_0x2920d9[_0x14ef1f(0x124)](/[.+^${}()|[\]\\]/g,_0x14ef1f(0x135))[_0x14ef1f(0x124)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x50956e=new RegExp('^'+_0x1427d9+'$','i'),_0x4f57fd=_0x2007fe[_0x14ef1f(0x11e)](_0xff3f51=>_0x50956e['test'](_0xff3f51[_0x14ef1f(0x13a)])),_0x4ce2ce=_0x1f4669['filter'](_0xc68ef9=>_0x50956e[_0x14ef1f(0x147)](_0xc68ef9[_0x14ef1f(0x13a)])),_0x2edf70=_0x36db5b['filter'](_0x14cdd2=>_0x50956e['test'](_0x14cdd2['journeyBundleName'])),_0x375c4a=_0x4f57fd['length']+_0x4ce2ce['length']+_0x2edf70[_0x14ef1f(0x11d)];console['error']('✔\x20Found\x20'+_0x4f57fd[_0x14ef1f(0x11d)]+_0x14ef1f(0x148)+(_0x4f57fd[_0x14ef1f(0x11d)]!==0x1?'s':'')+',\x20'+_0x4ce2ce['length']+_0x14ef1f(0x110)+(_0x4ce2ce[_0x14ef1f(0x11d)]!==0x1?'s':'')+_0x14ef1f(0x12c)+_0x2edf70['length']+_0x14ef1f(0x103)+(_0x2edf70[_0x14ef1f(0x11d)]!==0x1?'s':'')+_0x14ef1f(0x129)+_0x2920d9+'\x27');const _0x5a9ea0=_0x465b6e=>{const _0x19abd7=_0x14ef1f;return getConsoleNextUrl(_0x29f91c[_0x19abd7(0xff)],'/app/ps/'+_0x49eeb5[_0x19abd7(0x11a)]+'/e/'+_0x465b6e);},_0x2d5140=_0x29f91c[_0x14ef1f(0x121)]===_0x14ef1f(0x123)||_0x29f91c[_0x14ef1f(0x121)]==='jsonl';if(_0x2d5140){const _0x52d0a7=[..._0x4f57fd[_0x14ef1f(0x101)](_0x4147eb=>({..._0x4147eb,'type':_0x14ef1f(0x131)})),..._0x4ce2ce[_0x14ef1f(0x101)](_0x488e98=>({..._0x488e98,'type':_0x14ef1f(0x104),'url':_0x5a9ea0(_0x488e98['id'])})),..._0x2edf70[_0x14ef1f(0x101)](_0x326ff6=>({..._0x326ff6,'name':_0x326ff6[_0x14ef1f(0x13d)],'type':_0x14ef1f(0x128)}))][_0x14ef1f(0x10e)]((_0xd24f64,_0x1c279c)=>_0xd24f64[_0x14ef1f(0x13a)][_0x14ef1f(0x13f)](_0x1c279c[_0x14ef1f(0x13a)]));await handleSDKOutput(_0x52d0a7,_0x29f91c);}else{if(_0x375c4a===0x0)console[_0x14ef1f(0x11b)](_0x14ef1f(0x118)+_0x2920d9);else{console['log'](a45_0x2b40a0[_0x14ef1f(0x10a)]('['+_0x47ea54+']\x20matching\x20\x27'+_0x2920d9+'\x27'));const _0x1832f6=formatFlatList(_0x4f57fd,_0x4ce2ce,{'showMetadata':!![],'getSegmentUrl':_0x5a9ea0},_0x2edf70);console[_0x14ef1f(0x11b)](_0x1832f6);}}return 0x0;}async[a45_0x4eb677(0x11c)](_0x25aeb1,_0x5aa547){const _0x19d45d=a45_0x4eb677,{options:_0x4cb019,tdx:_0x5f1c8b}=_0x25aeb1,_0x51e9b9=await withSpinner('Resolving\x20path\x20\x27'+_0x5aa547+_0x19d45d(0x13b),()=>_0x5f1c8b[_0x19d45d(0x104)][_0x19d45d(0x138)](_0x5aa547),{'verbose':_0x4cb019[_0x19d45d(0x115)]}),_0x30194e=_0x51e9b9[_0x19d45d(0x100)];_0x4cb019['verbose']&&(console[_0x19d45d(0x139)](_0x19d45d(0x143)+_0x30194e[_0x19d45d(0x11a)]),_0x30194e[_0x19d45d(0x149)]&&console[_0x19d45d(0x139)]('Folder\x20ID:\x20'+_0x30194e[_0x19d45d(0x149)]));const _0x1043ae=await withSpinner(_0x19d45d(0x13e),()=>_0x5f1c8b[_0x19d45d(0x104)][_0x19d45d(0x146)](_0x30194e[_0x19d45d(0x11a)],_0x30194e['folderId']),{'verbose':_0x4cb019[_0x19d45d(0x115)]}),{folders:_0x349f20,segments:_0x4aefce,journeys:_0x1e5791}=_0x1043ae[_0x19d45d(0x100)],_0x182a45=_0x349f20[_0x19d45d(0x11d)]+_0x4aefce[_0x19d45d(0x11d)]+_0x1e5791[_0x19d45d(0x11d)];console[_0x19d45d(0x139)](_0x19d45d(0x102)+_0x349f20[_0x19d45d(0x11d)]+'\x20folder'+(_0x349f20[_0x19d45d(0x11d)]!==0x1?'s':'')+',\x20'+_0x4aefce[_0x19d45d(0x11d)]+_0x19d45d(0x110)+(_0x4aefce[_0x19d45d(0x11d)]!==0x1?'s':'')+',\x20and\x20'+_0x1e5791['length']+_0x19d45d(0x103)+(_0x1e5791[_0x19d45d(0x11d)]!==0x1?'s':''));const _0x2e0acd=_0x173bfa=>{const _0x5d8519=_0x19d45d;return getConsoleNextUrl(_0x4cb019[_0x5d8519(0xff)],_0x5d8519(0x10c)+_0x30194e[_0x5d8519(0x11a)]+_0x5d8519(0x141)+_0x173bfa);},_0x4af852=_0xc9718b=>{const _0x1ab7b0=_0x19d45d;return getConsoleNextUrl(_0x4cb019[_0x1ab7b0(0xff)],_0x1ab7b0(0x10c)+_0x30194e[_0x1ab7b0(0x11a)]+'/e/'+_0xc9718b+'/j/da');},_0x469188=_0x4cb019[_0x19d45d(0x121)]==='json'||_0x4cb019[_0x19d45d(0x121)]==='jsonl';if(_0x469188){const _0x2e771b=[..._0x349f20['map'](_0x512f77=>({..._0x512f77,'type':_0x19d45d(0x131)})),..._0x4aefce[_0x19d45d(0x101)](_0x5e8e28=>({..._0x5e8e28,'type':_0x19d45d(0x104),'url':_0x2e0acd(_0x5e8e28['id'])})),..._0x1e5791['map'](_0x299356=>({..._0x299356,'name':_0x299356['journeyBundleName'],'type':_0x19d45d(0x128),'url':_0x4af852(_0x299356['id'])}))][_0x19d45d(0x10e)]((_0xcfdf9f,_0x58c4a0)=>_0xcfdf9f[_0x19d45d(0x13a)]['localeCompare'](_0x58c4a0[_0x19d45d(0x13a)]));await handleSDKOutput(_0x2e771b,_0x4cb019);}else{if(_0x182a45===0x0)console['log'](a45_0x2b40a0[_0x19d45d(0x10a)]('['+_0x5aa547+']')),console[_0x19d45d(0x11b)](_0x19d45d(0x108));else{console[_0x19d45d(0x11b)](a45_0x2b40a0['dim']('['+_0x5aa547+']'));const _0x3751de=formatFlatList(_0x349f20,_0x4aefce,{'showMetadata':!![],'getSegmentUrl':_0x2e0acd,'getJourneyUrl':_0x4af852},_0x1e5791);console[_0x19d45d(0x11b)](_0x3751de);}}return 0x0;}async[a45_0x4eb677(0x140)](_0x55b685,_0x2c9658){const _0x5ec979=a45_0x4eb677,{options:_0x138009,tdx:_0x422578}=_0x55b685,_0x513447=await withSpinner(_0x5ec979(0x119)+_0x2c9658+'\x27...',()=>_0x422578[_0x5ec979(0x104)][_0x5ec979(0x138)](_0x2c9658),{'verbose':_0x138009[_0x5ec979(0x115)]}),_0xd6bba=_0x513447['data'];_0x138009['verbose']&&(console[_0x5ec979(0x139)](_0x5ec979(0x143)+_0xd6bba[_0x5ec979(0x11a)]),_0xd6bba['folderId']&&console[_0x5ec979(0x139)](_0x5ec979(0x127)+_0xd6bba[_0x5ec979(0x149)]));const _0x575992=_0x138009[_0x5ec979(0xfd)]||0xa,_0x20dc4c=await withSpinner(_0x5ec979(0x12d),()=>_0x422578[_0x5ec979(0x104)][_0x5ec979(0x140)](_0xd6bba[_0x5ec979(0x11a)],_0xd6bba[_0x5ec979(0x149)],0x0,_0x575992),{'verbose':_0x138009['verbose']}),_0x434836=_0x20dc4c[_0x5ec979(0x100)],_0x259db6=_0x5cea53=>{const _0x51c533=_0x5ec979;let _0x1647c1=0x0,_0x5a6fe0=0x0,_0x4667be=0x0;for(const _0xa2ba39 of _0x5cea53){if(_0xa2ba39[_0x51c533(0xfe)]==='folder')_0x1647c1++;else{if(_0xa2ba39['type']==='segment')_0x5a6fe0++;else{if(_0xa2ba39[_0x51c533(0xfe)]===_0x51c533(0x128))_0x4667be++;}}if(_0xa2ba39[_0x51c533(0x137)]){const _0x54f5c7=_0x259db6(_0xa2ba39[_0x51c533(0x137)]);_0x1647c1+=_0x54f5c7[_0x51c533(0x120)],_0x5a6fe0+=_0x54f5c7[_0x51c533(0x12f)],_0x4667be+=_0x54f5c7[_0x51c533(0x10b)];}}return{'folders':_0x1647c1,'segments':_0x5a6fe0,'journeys':_0x4667be};},_0x27d6d0=_0x259db6(_0x434836);console['error'](_0x5ec979(0x111)+_0x27d6d0[_0x5ec979(0x120)]+_0x5ec979(0x148)+(_0x27d6d0[_0x5ec979(0x120)]!==0x1?'s':'')+',\x20'+_0x27d6d0[_0x5ec979(0x12f)]+_0x5ec979(0x110)+(_0x27d6d0['segments']!==0x1?'s':'')+_0x5ec979(0x12c)+_0x27d6d0[_0x5ec979(0x10b)]+'\x20journey'+(_0x27d6d0[_0x5ec979(0x10b)]!==0x1?'s':''));const _0x1c11a1=_0x505874=>{const _0x28a332=_0x5ec979;return getConsoleNextUrl(_0x138009['site'],'/app/ps/'+_0xd6bba[_0x28a332(0x11a)]+_0x28a332(0x141)+_0x505874);},_0x1b1ff4=_0x5ebc27=>{const _0x1986ef=_0x5ec979;return getConsoleNextUrl(_0x138009[_0x1986ef(0xff)],_0x1986ef(0x10c)+_0xd6bba[_0x1986ef(0x11a)]+_0x1986ef(0x141)+_0x5ebc27+_0x1986ef(0x11f));};if(_0x138009[_0x5ec979(0x121)]===_0x5ec979(0x123)||_0x138009['format']===_0x5ec979(0x14c))await handleSDKOutput(_0x434836,_0x138009);else{console[_0x5ec979(0x11b)](a45_0x2b40a0[_0x5ec979(0x10a)]('['+_0x2c9658+']'));const _0x575862=formatTree(_0x434836,{'showMetadata':!![],'getSegmentUrl':_0x1c11a1,'getJourneyUrl':_0x1b1ff4});console[_0x5ec979(0x11b)](_0x575862);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x5b101a=a46_0x4e9d;(function(_0x337eb1,_0x22f3f8){const _0xe02b2=a46_0x4e9d,_0x46e1e1=_0x337eb1();while(!![]){try{const _0x8d9804=-parseInt(_0xe02b2(0x128))/0x1*(-parseInt(_0xe02b2(0x11a))/0x2)+-parseInt(_0xe02b2(0x11d))/0x3+-parseInt(_0xe02b2(0x10b))/0x4*(-parseInt(_0xe02b2(0x108))/0x5)+-parseInt(_0xe02b2(0x123))/0x6+-parseInt(_0xe02b2(0x10e))/0x7+-parseInt(_0xe02b2(0x117))/0x8+-parseInt(_0xe02b2(0x10f))/0x9*(-parseInt(_0xe02b2(0x104))/0xa);if(_0x8d9804===_0x22f3f8)break;else _0x46e1e1['push'](_0x46e1e1['shift']());}catch(_0x25a230){_0x46e1e1['push'](_0x46e1e1['shift']());}}}(a46_0x57d2,0x7c9b0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a46_0x4e9d(_0x4d7aa4,_0x422ca0){_0x4d7aa4=_0x4d7aa4-0x101;const _0x57d25b=a46_0x57d2();let _0x4e9d37=_0x57d25b[_0x4d7aa4];return _0x4e9d37;}function a46_0x57d2(){const _0x4bc51c=['\x20row','limit','4868040xIzzKD','validate','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','cause','verbose','9EJRwAc','Database:\x20','query','catalog','344780PXlMNq','database','showTable','Site:\x20','125155zUwCLp','site','Error:\x20','28YdoUKL','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Catalog:\x20','4268936dAcxLz','405GOsnMl','length','message','args','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','\x20from\x20','error','1249488oqeRuT','...','execute','226816DOtECa','data','show','1978923wINcrr','Show\x20table\x20contents','table','Querying\x20'];a46_0x57d2=function(){return _0x4bc51c;};return a46_0x57d2();}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x5b101a(0x11c);['description']=a46_0x5b101a(0x11e);async[a46_0x5b101a(0x119)](_0x4e2680){const _0x3d58f2=a46_0x5b101a;return this[_0x3d58f2(0x106)](_0x4e2680);}async[a46_0x5b101a(0x106)](_0x59699e){const _0xaa50c6=a46_0x5b101a,{options:_0x36be49,args:_0x353ab4,tdx:_0x35c710}=_0x59699e;let _0xb09064;try{_0xb09064=parseTableReference(_0x353ab4[0x0]);const _0x55c680=_0x36be49[_0xaa50c6(0x105)];!_0xb09064[_0xaa50c6(0x105)]&&_0x55c680&&(_0xb09064[_0xaa50c6(0x105)]=_0x55c680);const _0x3b3e8f=validateTableDescribeReference(_0xb09064);if(_0x3b3e8f)return console[_0xaa50c6(0x116)](_0xaa50c6(0x10a)+_0x3b3e8f),console[_0xaa50c6(0x116)](_0xaa50c6(0x113)),console[_0xaa50c6(0x116)](_0xaa50c6(0x125)),console[_0xaa50c6(0x116)](_0xaa50c6(0x114)),0x1;}catch(_0x68d403){return console['error']('Error:\x20'+_0x68d403[_0xaa50c6(0x111)]),console[_0xaa50c6(0x116)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xaa50c6(0x116)](_0xaa50c6(0x125)),console[_0xaa50c6(0x116)](_0xaa50c6(0x114)),0x1;}const _0x49e3a1=_0xb09064[_0xaa50c6(0x103)],_0x2af513=_0xb09064['database'],_0x131f63=_0xb09064[_0xaa50c6(0x11f)],_0x2dd036=resolveLimit(_0x36be49[_0xaa50c6(0x122)],DEFAULT_DISPLAY_LIMIT);try{_0x36be49[_0xaa50c6(0x127)]&&(console[_0xaa50c6(0x116)](_0xaa50c6(0x107)+_0x36be49[_0xaa50c6(0x109)]),_0x49e3a1&&console[_0xaa50c6(0x116)](_0xaa50c6(0x10d)+_0x49e3a1),console[_0xaa50c6(0x116)](_0xaa50c6(0x101)+_0x2af513),console['error']('Table:\x20'+_0x131f63),console[_0xaa50c6(0x116)]('Limit:\x20'+_0x2dd036));const _0x4cbb26=_0x49e3a1?_0x49e3a1+'.'+_0x2af513+'.'+_0x131f63:_0x2af513+'.'+_0x131f63,_0x3fe3ee=await withSpinner(_0xaa50c6(0x120)+_0x4cbb26+_0xaa50c6(0x118),()=>_0x35c710[_0xaa50c6(0x102)][_0xaa50c6(0x106)](_0x2af513,_0x131f63,_0x2dd036,_0x49e3a1),{'verbose':_0x36be49[_0xaa50c6(0x127)]}),_0x38b9a6=_0x3fe3ee[_0xaa50c6(0x11b)],_0x439b8a=_0x38b9a6[_0xaa50c6(0x11b)];return _0x439b8a[_0xaa50c6(0x110)]===0x0?console[_0xaa50c6(0x116)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0xaa50c6(0x116)]('✔\x20Retrieved\x20'+_0x439b8a['length']+_0xaa50c6(0x121)+(_0x439b8a[_0xaa50c6(0x110)]!==0x1?'s':'')+_0xaa50c6(0x115)+_0x4cbb26),await handleSDKOutput(_0x439b8a,_0x36be49),0x0;}catch(_0x5a4673){if(_0x5a4673 instanceof SDKError)return console[_0xaa50c6(0x116)]('Error:\x20'+_0x5a4673[_0xaa50c6(0x111)]),_0x5a4673[_0xaa50c6(0x126)]&&console[_0xaa50c6(0x116)]('\x20\x20Cause:\x20'+_0x5a4673[_0xaa50c6(0x126)]),0x1;throw _0x5a4673;}}[a46_0x5b101a(0x124)](_0x3d0dbf){const _0x122863=a46_0x5b101a;if(_0x3d0dbf[_0x122863(0x112)][_0x122863(0x110)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x3d0dbf[_0x122863(0x112)]['length']>0x1)return _0x122863(0x10c);return undefined;}}
1
+ const a46_0x5b54c6=a46_0x1739;(function(_0x1c0d43,_0x13dd98){const _0x18950f=a46_0x1739,_0x2cc6b6=_0x1c0d43();while(!![]){try{const _0x5d739a=parseInt(_0x18950f(0xbe))/0x1+-parseInt(_0x18950f(0xc1))/0x2*(parseInt(_0x18950f(0xba))/0x3)+-parseInt(_0x18950f(0xce))/0x4+-parseInt(_0x18950f(0xc9))/0x5*(parseInt(_0x18950f(0xaf))/0x6)+parseInt(_0x18950f(0xc7))/0x7*(-parseInt(_0x18950f(0xc0))/0x8)+parseInt(_0x18950f(0xa9))/0x9*(parseInt(_0x18950f(0xb3))/0xa)+parseInt(_0x18950f(0xb1))/0xb;if(_0x5d739a===_0x13dd98)break;else _0x2cc6b6['push'](_0x2cc6b6['shift']());}catch(_0x1462fc){_0x2cc6b6['push'](_0x2cc6b6['shift']());}}}(a46_0x251e,0x82fa4));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a46_0x1739(_0x2e1a43,_0x226244){_0x2e1a43=_0x2e1a43-0xa6;const _0x251e2f=a46_0x251e();let _0x1739a6=_0x251e2f[_0x2e1a43];return _0x1739a6;}function a46_0x251e(){const _0x4ce85b=['1040082DUqThT','...','72fKllmW','1641742IQDJlA','✔\x20Retrieved\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','show','showTable','execute','204211SVjmcv','validate','5bqvaUO','verbose','cause','Usage:\x20tdx\x20show\x20<database.table>','data','654552TTCJxe','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','site','30483FmnwjA','\x20from\x20','message','Catalog:\x20','catalog','Error:\x20','2733078MmDCqb','limit','12592679tUxecO','length','160fUdypR','database','description','error','Limit:\x20','Table:\x20','Site:\x20','3hlUZyp','args','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','name'];a46_0x251e=function(){return _0x4ce85b;};return a46_0x251e();}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x5b54c6(0xbd)]=a46_0x5b54c6(0xc4);[a46_0x5b54c6(0xb5)]='Show\x20table\x20contents';async[a46_0x5b54c6(0xc6)](_0x591503){const _0x104baa=a46_0x5b54c6;return this[_0x104baa(0xc5)](_0x591503);}async[a46_0x5b54c6(0xc5)](_0x9f0c40){const _0x134552=a46_0x5b54c6,{options:_0x46cea9,args:_0x290f10,tdx:_0x4c9921}=_0x9f0c40;let _0x6ac4ce;try{_0x6ac4ce=parseTableReference(_0x290f10[0x0]);const _0x3da007=_0x46cea9['database'];!_0x6ac4ce[_0x134552(0xb4)]&&_0x3da007&&(_0x6ac4ce[_0x134552(0xb4)]=_0x3da007);const _0x10edda=validateTableDescribeReference(_0x6ac4ce);if(_0x10edda)return console[_0x134552(0xb6)]('Error:\x20'+_0x10edda),console[_0x134552(0xb6)](_0x134552(0xcc)),console['error'](_0x134552(0xa7)),console[_0x134552(0xb6)](_0x134552(0xa6)),0x1;}catch(_0x10634c){return console[_0x134552(0xb6)]('Error:\x20'+_0x10634c[_0x134552(0xab)]),console[_0x134552(0xb6)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x134552(0xb6)](_0x134552(0xa7)),console[_0x134552(0xb6)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x34865c=_0x6ac4ce[_0x134552(0xad)],_0x25837c=_0x6ac4ce[_0x134552(0xb4)],_0x431793=_0x6ac4ce['table'],_0x16cf68=resolveLimit(_0x46cea9[_0x134552(0xb0)],DEFAULT_DISPLAY_LIMIT);try{_0x46cea9[_0x134552(0xca)]&&(console[_0x134552(0xb6)](_0x134552(0xb9)+_0x46cea9[_0x134552(0xa8)]),_0x34865c&&console[_0x134552(0xb6)](_0x134552(0xac)+_0x34865c),console[_0x134552(0xb6)]('Database:\x20'+_0x25837c),console[_0x134552(0xb6)](_0x134552(0xb8)+_0x431793),console[_0x134552(0xb6)](_0x134552(0xb7)+_0x16cf68));const _0x4ef98f=_0x34865c?_0x34865c+'.'+_0x25837c+'.'+_0x431793:_0x25837c+'.'+_0x431793,_0x2b472e=await withSpinner('Querying\x20'+_0x4ef98f+_0x134552(0xbf),()=>_0x4c9921['query'][_0x134552(0xc5)](_0x25837c,_0x431793,_0x16cf68,_0x34865c),{'verbose':_0x46cea9[_0x134552(0xca)]}),_0x2f9cad=_0x2b472e['data'],_0x15796b=_0x2f9cad[_0x134552(0xcd)];return _0x15796b[_0x134552(0xb2)]===0x0?console[_0x134552(0xb6)](_0x134552(0xbc)):console[_0x134552(0xb6)](_0x134552(0xc2)+_0x15796b['length']+'\x20row'+(_0x15796b[_0x134552(0xb2)]!==0x1?'s':'')+_0x134552(0xaa)+_0x4ef98f),await handleSDKOutput(_0x15796b,_0x46cea9),0x0;}catch(_0x4cde85){if(_0x4cde85 instanceof SDKError)return console[_0x134552(0xb6)](_0x134552(0xae)+_0x4cde85[_0x134552(0xab)]),_0x4cde85[_0x134552(0xcb)]&&console[_0x134552(0xb6)]('\x20\x20Cause:\x20'+_0x4cde85[_0x134552(0xcb)]),0x1;throw _0x4cde85;}}[a46_0x5b54c6(0xc8)](_0x5e1302){const _0x48656a=a46_0x5b54c6;if(_0x5e1302[_0x48656a(0xbb)][_0x48656a(0xb2)]===0x0)return _0x48656a(0xc3);if(_0x5e1302[_0x48656a(0xbb)][_0x48656a(0xb2)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}
@@ -1 +1 @@
1
- const a47_0x163640=a47_0x2006;(function(_0x296be2,_0x155b42){const _0x50c3df=a47_0x2006,_0x33611c=_0x296be2();while(!![]){try{const _0x431d0b=-parseInt(_0x50c3df(0x1b3))/0x1*(-parseInt(_0x50c3df(0x1b8))/0x2)+parseInt(_0x50c3df(0x1be))/0x3*(-parseInt(_0x50c3df(0x1b7))/0x4)+-parseInt(_0x50c3df(0x1ca))/0x5*(-parseInt(_0x50c3df(0x1c2))/0x6)+parseInt(_0x50c3df(0x1c9))/0x7+-parseInt(_0x50c3df(0x1c6))/0x8+parseInt(_0x50c3df(0x1bc))/0x9*(-parseInt(_0x50c3df(0x1d6))/0xa)+parseInt(_0x50c3df(0x1c3))/0xb*(parseInt(_0x50c3df(0x1b6))/0xc);if(_0x431d0b===_0x155b42)break;else _0x33611c['push'](_0x33611c['shift']());}catch(_0x55388f){_0x33611c['push'](_0x33611c['shift']());}}}(a47_0x4c58,0xebbeb));import{BaseCommand,printAuthError}from'./command.js';function a47_0x4c58(){const _0x1b61dd=['Name:','Account\x20ID:','status','email','CLI\x20flag','log','1OKatVK','displayWithSources','TDX_PROFILE\x20env','29680188DiYdyt','3644mcZzfB','1505132wDSSsZ','green','cli','yellow','9poVTKD','filter','4812ZBMRnV','message','OAuth','site:\x20','3450zCnYpo','11oUwvFL','account_id','dim','3228344naapVr','jobs','site','6420253UBbzyr','10ECzJCx','tdx','last_name','User:','profileSource','✗\x20Validation\x20failed:\x20','name','execute','cyan','session','red','Credential\x20type:\x20','13138460HHQriC','error','config','bold','description','No\x20credential\x20found','env','Show\x20authentication\x20status\x20and\x20current\x20context'];a47_0x4c58=function(){return _0x1b61dd;};return a47_0x4c58();}import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x48246c from'chalk';function a47_0x2006(_0x17e27a,_0x96332e){_0x17e27a=_0x17e27a-0x1ac;const _0x4c584f=a47_0x4c58();let _0x2006fe=_0x4c584f[_0x17e27a];return _0x2006fe;}export class StatusCommand extends BaseCommand{[a47_0x163640(0x1d0)]=a47_0x163640(0x1af);[a47_0x163640(0x1da)]=a47_0x163640(0x1ac);async[a47_0x163640(0x1d1)](_0x1a36d5){const _0x536d6a=a47_0x163640,{options:_0x165f62,tdx:_0x1a3dac}=_0x1a36d5,_0x2039a9=_0x165f62[_0x536d6a(0x1c8)],_0x1e227a=new GlobalContext(_0x165f62),_0x285fa2=_0x1e227a['profile'],_0x8b26aa=_0x1e227a[_0x536d6a(0x1ce)],_0x2bb394=_0x8b26aa===_0x536d6a(0x1ba)?_0x536d6a(0x1b1):_0x8b26aa===_0x536d6a(0x1d3)?'session':_0x8b26aa===_0x536d6a(0x1dc)?_0x536d6a(0x1b5):_0x8b26aa===_0x536d6a(0x1d8)?_0x536d6a(0x1d8):null,_0x334121=_0x285fa2?a47_0x48246c['cyan'](_0x285fa2):a47_0x48246c['dim']('N/A'),_0x5d35d0=_0x2bb394?'\x20'+a47_0x48246c[_0x536d6a(0x1c5)]('(from\x20'+_0x2bb394+')'):'';console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1d9)](_0x536d6a(0x1cb))+'\x20profile:\x20'+_0x334121+_0x5d35d0+'\x20'+a47_0x48246c['dim']('(')+_0x536d6a(0x1c1)+a47_0x48246c[_0x536d6a(0x1d2)](_0x2039a9)+a47_0x48246c[_0x536d6a(0x1c5)](')'));const _0x5a60c1=await getOAuthTokens(_0x285fa2);if(_0x5a60c1)console[_0x536d6a(0x1b2)](_0x536d6a(0x1d5)+a47_0x48246c[_0x536d6a(0x1d2)](_0x536d6a(0x1c0)));else{const _0x22564d=await resolveAPIKeyAsync(_0x2039a9,_0x285fa2);if(_0x22564d){const {source:_0x280a57,isDeprecated:_0x345999}=_0x22564d,_0x3e997c='Read\x20credential\x20from\x20'+a47_0x48246c['cyan'](_0x280a57);console[_0x536d6a(0x1b2)](_0x345999?a47_0x48246c[_0x536d6a(0x1bb)](_0x3e997c):_0x3e997c);}else console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1bb)](_0x536d6a(0x1db)));}let _0x43b76d=![];try{const _0x28acfa=await _0x1a3dac[_0x536d6a(0x1c7)]['getUserInfo']();console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1b9)]('✓\x20Authentication\x20successful\x0a')),console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1d9)](_0x536d6a(0x1cd))+'\x20'+a47_0x48246c['cyan'](_0x28acfa[_0x536d6a(0x1b0)]));if(_0x28acfa['first_name']||_0x28acfa['last_name']){const _0x37c615=[_0x28acfa['first_name'],_0x28acfa[_0x536d6a(0x1cc)]][_0x536d6a(0x1bd)](Boolean)['join']('\x20');console[_0x536d6a(0x1b2)](a47_0x48246c['bold'](_0x536d6a(0x1ad))+'\x20'+_0x37c615);}_0x28acfa[_0x536d6a(0x1c4)]&&console[_0x536d6a(0x1b2)](a47_0x48246c[_0x536d6a(0x1d9)](_0x536d6a(0x1ae))+'\x20'+a47_0x48246c[_0x536d6a(0x1bb)](_0x28acfa[_0x536d6a(0x1c4)])),_0x43b76d=!![];}catch(_0x1cb5f3){_0x1cb5f3 instanceof HTTPClientError&&_0x1cb5f3['status']===0x191?printAuthError(_0x1cb5f3,!![],_0x285fa2):console[_0x536d6a(0x1d7)](a47_0x48246c[_0x536d6a(0x1d4)](_0x536d6a(0x1cf)+(_0x1cb5f3 instanceof Error?_0x1cb5f3[_0x536d6a(0x1bf)]:String(_0x1cb5f3))));}return console[_0x536d6a(0x1b2)](),_0x1e227a[_0x536d6a(0x1b4)](),_0x43b76d?0x0:0x1;}}
1
+ const a47_0x6eabb6=a47_0x28b1;(function(_0x2e6a3d,_0x915105){const _0x4945ab=a47_0x28b1,_0x1ff33d=_0x2e6a3d();while(!![]){try{const _0x3acc9c=-parseInt(_0x4945ab(0x191))/0x1*(-parseInt(_0x4945ab(0x1ad))/0x2)+-parseInt(_0x4945ab(0x194))/0x3+parseInt(_0x4945ab(0x1a5))/0x4*(-parseInt(_0x4945ab(0x1ab))/0x5)+parseInt(_0x4945ab(0x193))/0x6+-parseInt(_0x4945ab(0x195))/0x7+-parseInt(_0x4945ab(0x188))/0x8*(parseInt(_0x4945ab(0x19f))/0x9)+parseInt(_0x4945ab(0x19c))/0xa*(parseInt(_0x4945ab(0x1a7))/0xb);if(_0x3acc9c===_0x915105)break;else _0x1ff33d['push'](_0x1ff33d['shift']());}catch(_0x2a43fb){_0x1ff33d['push'](_0x1ff33d['shift']());}}}(a47_0x3ecc,0xa6988));function a47_0x3ecc(){const _0x20811b=['Name:','2797zUtNdJ','profile','4859154QRNyHS','1412181jPibZk','500325wRwhuY','Credential\x20type:\x20','getUserInfo','account_id','site','email','cyan','20rRZfIl','cli','tdx','189mhTWvc','Show\x20authentication\x20status\x20and\x20current\x20context','last_name','filter','profileSource','name','64MALxqg','dim','8924707rbHeGa','join','green','\x20profile:\x20','101415aYklAf','message','32OnOYrk','N/A','jobs','displayWithSources','error','(from\x20','Read\x20credential\x20from\x20','env','red','OAuth','execute','353592alikWa','✓\x20Authentication\x20successful\x0a','bold','first_name','log','config','No\x20credential\x20found','yellow'];a47_0x3ecc=function(){return _0x20811b;};return a47_0x3ecc();}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';function a47_0x28b1(_0x577d96,_0x2a5dc0){_0x577d96=_0x577d96-0x182;const _0x3ecc17=a47_0x3ecc();let _0x28b1f0=_0x3ecc17[_0x577d96];return _0x28b1f0;}import{GlobalContext}from'../core/global-context.js';import a47_0x88dde6 from'chalk';export class StatusCommand extends BaseCommand{[a47_0x6eabb6(0x1a4)]='status';['description']=a47_0x6eabb6(0x1a0);async[a47_0x6eabb6(0x187)](_0x461308){const _0x171596=a47_0x6eabb6,{options:_0x11d838,tdx:_0x4120a5}=_0x461308,_0x267e0c=_0x11d838[_0x171596(0x199)],_0x262479=new GlobalContext(_0x11d838),_0xf21d40=_0x262479[_0x171596(0x192)],_0x1e9427=_0x262479[_0x171596(0x1a3)],_0x1c58df=_0x1e9427===_0x171596(0x19d)?'CLI\x20flag':_0x1e9427==='session'?'session':_0x1e9427===_0x171596(0x184)?'TDX_PROFILE\x20env':_0x1e9427===_0x171596(0x18d)?_0x171596(0x18d):null,_0x9f7180=_0xf21d40?a47_0x88dde6['cyan'](_0xf21d40):a47_0x88dde6[_0x171596(0x1a6)](_0x171596(0x1ae)),_0x4694ed=_0x1c58df?'\x20'+a47_0x88dde6[_0x171596(0x1a6)](_0x171596(0x182)+_0x1c58df+')'):'';console['log'](a47_0x88dde6[_0x171596(0x18a)](_0x171596(0x19e))+_0x171596(0x1aa)+_0x9f7180+_0x4694ed+'\x20'+a47_0x88dde6['dim']('(')+'site:\x20'+a47_0x88dde6['cyan'](_0x267e0c)+a47_0x88dde6[_0x171596(0x1a6)](')'));const _0x3cc821=await getOAuthTokens(_0xf21d40);if(_0x3cc821)console['log'](_0x171596(0x196)+a47_0x88dde6[_0x171596(0x19b)](_0x171596(0x186)));else{const _0xe2ca4b=await resolveAPIKeyAsync(_0x267e0c,_0xf21d40);if(_0xe2ca4b){const {source:_0x3ac5cb,isDeprecated:_0x58b874}=_0xe2ca4b,_0x49bdbd=_0x171596(0x183)+a47_0x88dde6[_0x171596(0x19b)](_0x3ac5cb);console[_0x171596(0x18c)](_0x58b874?a47_0x88dde6['yellow'](_0x49bdbd):_0x49bdbd);}else console['log'](a47_0x88dde6[_0x171596(0x18f)](_0x171596(0x18e)));}let _0x3466ee=![];try{const _0x2eb75a=await _0x4120a5[_0x171596(0x1af)][_0x171596(0x197)]();console[_0x171596(0x18c)](a47_0x88dde6[_0x171596(0x1a9)](_0x171596(0x189))),console[_0x171596(0x18c)](a47_0x88dde6['bold']('User:')+'\x20'+a47_0x88dde6['cyan'](_0x2eb75a[_0x171596(0x19a)]));if(_0x2eb75a['first_name']||_0x2eb75a[_0x171596(0x1a1)]){const _0x513719=[_0x2eb75a[_0x171596(0x18b)],_0x2eb75a[_0x171596(0x1a1)]][_0x171596(0x1a2)](Boolean)[_0x171596(0x1a8)]('\x20');console[_0x171596(0x18c)](a47_0x88dde6[_0x171596(0x18a)](_0x171596(0x190))+'\x20'+_0x513719);}_0x2eb75a[_0x171596(0x198)]&&console[_0x171596(0x18c)](a47_0x88dde6[_0x171596(0x18a)]('Account\x20ID:')+'\x20'+a47_0x88dde6['yellow'](_0x2eb75a[_0x171596(0x198)])),_0x3466ee=!![];}catch(_0x209cea){_0x209cea instanceof HTTPClientError&&_0x209cea['status']===0x191?printAuthError(_0x209cea,!![],_0xf21d40):console[_0x171596(0x1b1)](a47_0x88dde6[_0x171596(0x185)]('✗\x20Validation\x20failed:\x20'+(_0x209cea instanceof Error?_0x209cea[_0x171596(0x1ac)]:String(_0x209cea))));}return console[_0x171596(0x18c)](),_0x262479[_0x171596(0x1b0)](),_0x3466ee?0x0:0x1;}}