@treasuredata/tdx 2026.3.46 → 2026.3.48

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 (242) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/execute-items/TASK.md +62 -0
  182. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/execute-items/schedule.yaml +20 -0
  183. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/item-triage/TASK.md +106 -0
  184. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/item-triage/schedule.yaml +18 -0
  185. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/stale-item-cleanup/TASK.md +26 -0
  186. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/stale-item-cleanup/schedule.yaml +15 -0
  187. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/synthesize-knowledge/TASK.md +26 -0
  188. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/synthesize-knowledge/schedule.yaml +16 -0
  189. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/weekly-review/TASK.md +21 -0
  190. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/weekly-review/schedule.yaml +14 -0
  191. package/dist/sdk/workspace/builtin-schedules/execute-items/TASK.md +62 -0
  192. package/dist/sdk/workspace/builtin-schedules/execute-items/schedule.yaml +20 -0
  193. package/dist/sdk/workspace/builtin-schedules/item-triage/TASK.md +106 -0
  194. package/dist/sdk/workspace/builtin-schedules/item-triage/schedule.yaml +18 -0
  195. package/dist/sdk/workspace/builtin-schedules/stale-item-cleanup/TASK.md +26 -0
  196. package/dist/sdk/workspace/builtin-schedules/stale-item-cleanup/schedule.yaml +15 -0
  197. package/dist/sdk/workspace/builtin-schedules/synthesize-knowledge/TASK.md +26 -0
  198. package/dist/sdk/workspace/builtin-schedules/synthesize-knowledge/schedule.yaml +16 -0
  199. package/dist/sdk/workspace/builtin-schedules/weekly-review/TASK.md +21 -0
  200. package/dist/sdk/workspace/builtin-schedules/weekly-review/schedule.yaml +14 -0
  201. package/dist/sdk/workspace/frontmatter.js +1 -1
  202. package/dist/sdk/workspace/git.js +1 -1
  203. package/dist/sdk/workspace/index.d.ts +5 -1
  204. package/dist/sdk/workspace/index.d.ts.map +1 -1
  205. package/dist/sdk/workspace/index.js +1 -1
  206. package/dist/sdk/workspace/index.js.map +1 -1
  207. package/dist/sdk/workspace/templates.js +1 -1
  208. package/dist/sdk/workspace/weekly.js +1 -1
  209. package/dist/sdk/workspace/wikilinks.js +1 -1
  210. package/dist/test-utils/command-runner.js +1 -1
  211. package/dist/test-utils/factories.js +1 -1
  212. package/dist/test-utils/fixtures.js +1 -1
  213. package/dist/test-utils/http-mock.js +1 -1
  214. package/dist/test-utils/index.js +1 -1
  215. package/dist/utils/async.js +1 -1
  216. package/dist/utils/colors.js +1 -1
  217. package/dist/utils/diff.js +1 -1
  218. package/dist/utils/file-permissions.js +1 -1
  219. package/dist/utils/file-reader.js +1 -1
  220. package/dist/utils/github-releases.js +1 -1
  221. package/dist/utils/global-cache.js +1 -1
  222. package/dist/utils/json-loader.js +1 -1
  223. package/dist/utils/local-cache.js +1 -1
  224. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  225. package/dist/utils/logger/formatters/index.js +1 -1
  226. package/dist/utils/logger/handlers/console-handler.js +1 -1
  227. package/dist/utils/logger/handlers/file-handler.js +1 -1
  228. package/dist/utils/logger/handlers/index.js +1 -1
  229. package/dist/utils/logger/handlers/null-handler.js +1 -1
  230. package/dist/utils/logger/index.js +1 -1
  231. package/dist/utils/logger/logger.js +1 -1
  232. package/dist/utils/logger/types.js +1 -1
  233. package/dist/utils/option-validation.js +1 -1
  234. package/dist/utils/process.js +1 -1
  235. package/dist/utils/prompt.js +1 -1
  236. package/dist/utils/spinner.js +1 -1
  237. package/dist/utils/sse-parser.js +1 -1
  238. package/dist/utils/string-utils.js +1 -1
  239. package/dist/utils/table-ref-parser.js +1 -1
  240. package/dist/utils/tdx-logger.js +1 -1
  241. package/dist/utils/version-check.js +1 -1
  242. package/package.json +2 -2
@@ -1 +1 @@
1
- const a40_0x52e1c2=a40_0x5253;function a40_0x5253(_0x102884,_0x36b7ab){_0x102884=_0x102884-0xbd;const _0x4630fe=a40_0x4630();let _0x52539c=_0x4630fe[_0x102884];return _0x52539c;}(function(_0x2e2db9,_0x26a9fc){const _0x36a320=a40_0x5253,_0x323e8e=_0x2e2db9();while(!![]){try{const _0x2f0b11=parseInt(_0x36a320(0xd1))/0x1+parseInt(_0x36a320(0xc3))/0x2*(parseInt(_0x36a320(0xcc))/0x3)+parseInt(_0x36a320(0xd3))/0x4+-parseInt(_0x36a320(0xd5))/0x5+parseInt(_0x36a320(0xc6))/0x6+parseInt(_0x36a320(0xc7))/0x7*(parseInt(_0x36a320(0xcb))/0x8)+-parseInt(_0x36a320(0xc1))/0x9*(parseInt(_0x36a320(0xbf))/0xa);if(_0x2f0b11===_0x26a9fc)break;else _0x323e8e['push'](_0x323e8e['shift']());}catch(_0xe6eb7c){_0x323e8e['push'](_0x323e8e['shift']());}}}(a40_0x4630,0x4a88f));function a40_0x4630(){const _0x150ecb=['\x27...','description','1304934QNmxCq','2003701bgsVIn','json','name','parentSegment','16xQdkaM','18kceMDv','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Listing\x20fields\x20for\x20\x27','verbose','70455gomuFh','jsonl','1713184ltFmOq','execute','2225190LDkneI','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','data','segment','site','Site:\x20','7020190jeXSIA','error','9ImAeCM','length','54542cDLEEp'];a40_0x4630=function(){return _0x150ecb;};return a40_0x4630();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a40_0x52e1c2(0xc9)]='segment:fields';[a40_0x52e1c2(0xc5)]='List\x20available\x20fields\x20for\x20segmentation';async[a40_0x52e1c2(0xd4)](_0x1d33e1){const _0x59982d=a40_0x52e1c2,{options:_0x3af8be,args:_0x29830b,tdx:_0x3aecba}=_0x1d33e1,_0x275270=_0x29830b[0x0]||_0x3af8be[_0x59982d(0xca)];if(!_0x275270)return console['error'](_0x59982d(0xcd)),console[_0x59982d(0xc0)](_0x59982d(0xd7)),console[_0x59982d(0xc0)](_0x59982d(0xce)),0x1;_0x3af8be[_0x59982d(0xd0)]&&(console[_0x59982d(0xc0)](_0x59982d(0xbe)+_0x3af8be[_0x59982d(0xbd)]),console[_0x59982d(0xc0)](_0x59982d(0xd6)+_0x275270));const _0x34cc3d=await withSpinner(_0x59982d(0xcf)+_0x275270+_0x59982d(0xc4),()=>_0x3aecba[_0x59982d(0xd9)]['listFields'](_0x275270),{'verbose':_0x3af8be[_0x59982d(0xd0)]}),_0x41353b=_0x34cc3d[_0x59982d(0xd8)];console[_0x59982d(0xc0)]('✔\x20Found\x20'+_0x41353b[_0x59982d(0xc2)]+'\x20field'+(_0x41353b['length']!==0x1?'s':''));if(_0x3af8be[_0x59982d(0xc8)]||_0x3af8be[_0x59982d(0xd2)])return await handleSDKOutput(_0x41353b,_0x3af8be),0x0;return displayFieldsHumanReadable(_0x41353b,_0x275270),0x0;}}
1
+ const a40_0x3b7b38=a40_0x8205;(function(_0x58a9f4,_0x506788){const _0x3bb68e=a40_0x8205,_0x1b3841=_0x58a9f4();while(!![]){try{const _0x2b18dd=parseInt(_0x3bb68e(0xbd))/0x1+parseInt(_0x3bb68e(0xb9))/0x2+-parseInt(_0x3bb68e(0xb8))/0x3+-parseInt(_0x3bb68e(0xc4))/0x4*(parseInt(_0x3bb68e(0xba))/0x5)+parseInt(_0x3bb68e(0xaa))/0x6+-parseInt(_0x3bb68e(0xae))/0x7+parseInt(_0x3bb68e(0xc2))/0x8;if(_0x2b18dd===_0x506788)break;else _0x1b3841['push'](_0x1b3841['shift']());}catch(_0x576664){_0x1b3841['push'](_0x1b3841['shift']());}}}(a40_0x5313,0xa766c));function a40_0x5313(){const _0x2226a9=['site','Site:\x20','listFields','error','14956864dOSQVq','length','8pvQSrB','237732RIqIba','\x27...','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','segment','1484028ivpjek','parentSegment','Parent\x20segment:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Parent\x20segment\x20name\x20is\x20required','description','List\x20available\x20fields\x20for\x20segmentation','\x20field','verbose','json','3646293dfSTwC','396858zDSCON','2071995lhsNEc','jsonl','segment:fields','834250SYqWsS'];a40_0x5313=function(){return _0x2226a9;};return a40_0x5313();}import{BaseCommand}from'./command.js';function a40_0x8205(_0x40d56a,_0x14c83d){_0x40d56a=_0x40d56a-0xaa;const _0x53137f=a40_0x5313();let _0x820524=_0x53137f[_0x40d56a];return _0x820524;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a40_0x3b7b38(0xbc);[a40_0x3b7b38(0xb3)]=a40_0x3b7b38(0xb4);async['execute'](_0x3fe889){const _0xc0f42c=a40_0x3b7b38,{options:_0x5c146a,args:_0x1f69fe,tdx:_0x4ff51f}=_0x3fe889,_0x58365d=_0x1f69fe[0x0]||_0x5c146a[_0xc0f42c(0xaf)];if(!_0x58365d)return console[_0xc0f42c(0xc1)](_0xc0f42c(0xb2)),console[_0xc0f42c(0xc1)](_0xc0f42c(0xac)),console[_0xc0f42c(0xc1)](_0xc0f42c(0xb1)),0x1;_0x5c146a[_0xc0f42c(0xb6)]&&(console[_0xc0f42c(0xc1)](_0xc0f42c(0xbf)+_0x5c146a[_0xc0f42c(0xbe)]),console['error'](_0xc0f42c(0xb0)+_0x58365d));const _0x5e7188=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x58365d+_0xc0f42c(0xab),()=>_0x4ff51f[_0xc0f42c(0xad)][_0xc0f42c(0xc0)](_0x58365d),{'verbose':_0x5c146a[_0xc0f42c(0xb6)]}),_0x11753a=_0x5e7188['data'];console[_0xc0f42c(0xc1)]('✔\x20Found\x20'+_0x11753a[_0xc0f42c(0xc3)]+_0xc0f42c(0xb5)+(_0x11753a[_0xc0f42c(0xc3)]!==0x1?'s':''));if(_0x5c146a[_0xc0f42c(0xb7)]||_0x5c146a[_0xc0f42c(0xbb)])return await handleSDKOutput(_0x11753a,_0x5c146a),0x0;return displayFieldsHumanReadable(_0x11753a,_0x58365d),0x0;}}
@@ -1 +1 @@
1
- const a41_0x5a417b=a41_0x154b;(function(_0x4e1dc3,_0x254d79){const _0x666080=a41_0x154b,_0x5dc7db=_0x4e1dc3();while(!![]){try{const _0x4f4c6c=-parseInt(_0x666080(0x1ca))/0x1+parseInt(_0x666080(0x1d2))/0x2+-parseInt(_0x666080(0x1c7))/0x3*(-parseInt(_0x666080(0x1bd))/0x4)+-parseInt(_0x666080(0x1b5))/0x5+parseInt(_0x666080(0x19c))/0x6*(-parseInt(_0x666080(0x1b8))/0x7)+parseInt(_0x666080(0x1ab))/0x8+parseInt(_0x666080(0x1ac))/0x9;if(_0x4f4c6c===_0x254d79)break;else _0x5dc7db['push'](_0x5dc7db['shift']());}catch(_0x1c33c0){_0x5dc7db['push'](_0x5dc7db['shift']());}}}(a41_0x1ddb,0xaee6c));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 a41_0x3921dc from'chalk';function a41_0x1ddb(){const _0x3884bb=['8273754JxapZj','setPhase','message','\x20files\x20to\x20','yes','name','filter','journeyVersions','dirname','3477580cdyawi','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','red','7OdazsK','pullSegments','relativePath','\x20versions)','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','28yJMiHJ','isNew','Pulling\x20segments\x20from\x20\x27','segments','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)','\x20journeys','targetDir','\x20new\x20files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','error','328470zORstO','✔\x20Context\x20set:\x20','diff','453495tYoNCM','\x0aPull\x20summary\x20for\x20\x27','green','yellow','\x20activations','journeys','utf-8','\x20\x20🎯\x20','1977442mepjus','counts','session','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','no_parent','\x20\x20Target:\x20','cyan','parent_segment','Target\x20resource:\x20','execute','site','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20=\x20','\x20changed\x20files','activations','files','length','5003916qtTjrw','\x27...','\x20segments','verbose','\x0aChanges\x20to\x20\x27','hasChanges','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parentName','Aborted.','absolutePath','\x0aError:','dim','Error:\x20','repeat','Site:\x20','199488fnHUYE'];a41_0x1ddb=function(){return _0x3884bb;};return a41_0x1ddb();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a41_0x69502c from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a41_0x154b(_0x58367a,_0x17efc8){_0x58367a=_0x58367a-0x191;const _0x1ddb8b=a41_0x1ddb();let _0x154bb8=_0x1ddb8b[_0x58367a];return _0x154bb8;}export class SegmentPullCommand extends BaseCommand{[a41_0x5a417b(0x1b1)]='segment:pull';['description']=a41_0x5a417b(0x1bc);async[a41_0x5a417b(0x194)](_0x362755){const _0x1ec219=a41_0x5a417b,{options:_0x52b3fe,args:_0x570dc3,tdx:_0x3a4aea}=_0x362755,_0x85bdb7=_0x52b3fe,_0x7bbb0e=await resolveTarget({'arg':_0x570dc3[0x0],'contextParent':_0x52b3fe['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x7bbb0e))return _0x7bbb0e['errorCode']===_0x1ec219(0x1d7)?(console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1cd)](_0x1ec219(0x1c5))),console[_0x1ec219(0x1c6)](_0x1ec219(0x1c1)),console[_0x1ec219(0x1c6)](_0x1ec219(0x1b6)),console[_0x1ec219(0x1c6)](_0x1ec219(0x1d6))):(console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1b7)](_0x1ec219(0x1a8)+_0x7bbb0e[_0x1ec219(0x1ae)]+'\x0a')),_0x7bbb0e['helpText']&&console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x191)](_0x7bbb0e['helpText']))),0x1;const _0x38d78b=_0x7bbb0e['parentName'],_0x15d81f=_0x7bbb0e[_0x1ec219(0x1c3)],_0x3ef96b=_0x7bbb0e['type']==='file'?_0x7bbb0e['resourceName']:undefined;_0x85bdb7[_0x1ec219(0x19f)]&&(console[_0x1ec219(0x1c6)](_0x1ec219(0x1aa)+_0x85bdb7[_0x1ec219(0x195)]),console[_0x1ec219(0x1c6)]('Parent\x20segment:\x20'+_0x38d78b),_0x3ef96b&&console[_0x1ec219(0x1c6)](_0x1ec219(0x193)+_0x3ef96b));const _0x5164d3=await withProgressSpinner(_0x1ec219(0x1bf)+_0x38d78b+_0x1ec219(0x19d),_0x2ce23f=>_0x3a4aea['segment'][_0x1ec219(0x1b9)](_0x38d78b,{'targetDir':_0x15d81f,'targetResourceName':_0x3ef96b,'verbose':_0x85bdb7[_0x1ec219(0x19f)],'progress':{'update':_0x15d3e1=>{const _0x326a3e=_0x1ec219;_0x2ce23f[_0x326a3e(0x1ad)](_0x15d3e1),_0x85bdb7[_0x326a3e(0x19f)]&&console[_0x326a3e(0x1c6)]('\x20\x20'+_0x15d3e1);}}}),{'verbose':_0x85bdb7['verbose']}),_0x9df786=_0x5164d3['data'];if(_0x9df786[_0x1ec219(0x1d3)]['segments']===0x0&&_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1cf)]===0x0)return console['error'](a41_0x3921dc['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x9df786['parentName']+'\x27')),0x0;const _0x158b4c=_0x9df786['files']['filter'](_0x3541ae=>_0x3541ae[_0x1ec219(0x1be)]),_0x403d36=_0x9df786['files'][_0x1ec219(0x1b2)](_0x2c0ae9=>!_0x2c0ae9[_0x1ec219(0x1be)]&&_0x2c0ae9[_0x1ec219(0x1a1)]),_0x10f9d0=_0x9df786[_0x1ec219(0x19a)][_0x1ec219(0x1b2)](_0x714736=>!_0x714736['isNew']&&!_0x714736[_0x1ec219(0x1a1)]);console[_0x1ec219(0x1c6)](_0x1ec219(0x1cb)+_0x9df786[_0x1ec219(0x1a3)]+'\x27:'),console[_0x1ec219(0x1c6)](_0x1ec219(0x1d1)+a41_0x3921dc[_0x1ec219(0x191)](_0x9df786['counts'][_0x1ec219(0x1c0)]+_0x1ec219(0x19e))+'\x20with\x20'+a41_0x3921dc[_0x1ec219(0x191)](_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x199)]+_0x1ec219(0x1ce)));if(_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1cf)]>0x0){const _0x39a148=_0x9df786['counts'][_0x1ec219(0x1b3)]>_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1cf)]?'\x20('+_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1b3)]+_0x1ec219(0x1bb):'';console[_0x1ec219(0x1c6)]('\x20\x20🗺️\x20\x20'+a41_0x3921dc[_0x1ec219(0x191)](_0x9df786[_0x1ec219(0x1d3)][_0x1ec219(0x1cf)]+_0x1ec219(0x1c2))+a41_0x3921dc['dim'](_0x39a148));}console[_0x1ec219(0x1c6)]('\x20\x20'+a41_0x3921dc[_0x1ec219(0x1cc)]('+\x20'+_0x158b4c[_0x1ec219(0x19b)]+_0x1ec219(0x1c4))),console[_0x1ec219(0x1c6)]('\x20\x20'+a41_0x3921dc[_0x1ec219(0x1cd)]('~\x20'+_0x403d36['length']+_0x1ec219(0x198))),console['error']('\x20\x20'+a41_0x3921dc[_0x1ec219(0x1a7)]('=\x20'+_0x10f9d0[_0x1ec219(0x19b)]+'\x20unchanged\x20files')),console[_0x1ec219(0x1c6)](_0x1ec219(0x1d8)+a41_0x3921dc['cyan'](_0x9df786['targetDir'])+'\x0a');if(_0x403d36['length']>0x0)for(const _0x48a646 of _0x403d36){console[_0x1ec219(0x1c6)](_0x1ec219(0x1a0)+_0x48a646[_0x1ec219(0x1ba)]+'\x27:'),console['error']('─'[_0x1ec219(0x1a9)](0x3c)),console['error'](_0x48a646[_0x1ec219(0x1c9)]),console[_0x1ec219(0x1c6)]('─'[_0x1ec219(0x1a9)](0x3c));}if(_0x85bdb7[_0x1ec219(0x1d5)])return console[_0x1ec219(0x1c6)](a41_0x3921dc['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x158b4c[_0x1ec219(0x19b)]===0x0&&_0x403d36[_0x1ec219(0x19b)]===0x0)return console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1cc)](_0x1ec219(0x196))),saveSessionContext({'parent_segment':_0x9df786[_0x1ec219(0x1a3)]},_0x85bdb7[_0x1ec219(0x1d4)]),console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1cc)]('✔\x20Context\x20set:\x20'+a41_0x3921dc[_0x1ec219(0x1a7)](_0x1ec219(0x192))+_0x1ec219(0x197)+a41_0x3921dc['cyan'](_0x9df786[_0x1ec219(0x1a3)]))),0x0;if(!_0x85bdb7[_0x1ec219(0x1b0)]){if(!isInteractive())return console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1b7)](_0x1ec219(0x1a6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a41_0x3921dc[_0x1ec219(0x1a7)](_0x1ec219(0x1a2))),0x1;const _0x4a7b29=await confirmKey('Write\x20'+(_0x158b4c[_0x1ec219(0x19b)]+_0x403d36['length'])+'\x20files?');if(!_0x4a7b29)return console[_0x1ec219(0x1c6)](a41_0x3921dc['yellow'](_0x1ec219(0x1a4)),'-\x20no\x20files\x20written'),0x1;}for(const _0x315c1b of _0x9df786[_0x1ec219(0x19a)]){if(_0x315c1b[_0x1ec219(0x1be)]||_0x315c1b[_0x1ec219(0x1a1)]){const _0x28c2d1=a41_0x69502c[_0x1ec219(0x1b4)](_0x315c1b['absolutePath']);!existsSync(_0x28c2d1)&&mkdirSync(_0x28c2d1,{'recursive':!![]}),writeFileSync(_0x315c1b[_0x1ec219(0x1a5)],_0x315c1b['content'],_0x1ec219(0x1d0));}}return console[_0x1ec219(0x1c6)](a41_0x3921dc['green']('✔\x20Pulled\x20'+(_0x158b4c['length']+_0x403d36[_0x1ec219(0x19b)])+_0x1ec219(0x1af)+_0x9df786[_0x1ec219(0x1c3)])),saveSessionContext({'parent_segment':_0x9df786[_0x1ec219(0x1a3)]},_0x85bdb7[_0x1ec219(0x1d4)]),console[_0x1ec219(0x1c6)](a41_0x3921dc[_0x1ec219(0x1cc)](_0x1ec219(0x1c8)+a41_0x3921dc['dim']('parent_segment')+_0x1ec219(0x197)+a41_0x3921dc['cyan'](_0x9df786[_0x1ec219(0x1a3)]))),0x0;}}
1
+ const a41_0x118d29=a41_0x2b78;(function(_0x56f07c,_0x1866d1){const _0x3378b8=a41_0x2b78,_0x2a0ea3=_0x56f07c();while(!![]){try{const _0x22c3f1=parseInt(_0x3378b8(0x18c))/0x1*(-parseInt(_0x3378b8(0x16d))/0x2)+-parseInt(_0x3378b8(0x17c))/0x3+parseInt(_0x3378b8(0x161))/0x4+-parseInt(_0x3378b8(0x15a))/0x5+-parseInt(_0x3378b8(0x15f))/0x6*(parseInt(_0x3378b8(0x17d))/0x7)+parseInt(_0x3378b8(0x15d))/0x8*(-parseInt(_0x3378b8(0x16a))/0x9)+parseInt(_0x3378b8(0x16c))/0xa;if(_0x22c3f1===_0x1866d1)break;else _0x2a0ea3['push'](_0x2a0ea3['shift']());}catch(_0x55906){_0x2a0ea3['push'](_0x2a0ea3['shift']());}}}(a41_0x4319,0x7f0b8));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 a41_0x196d17 from'chalk';function a41_0x2b78(_0x3df16a,_0x4ba1a5){_0x3df16a=_0x3df16a-0x151;const _0x43194c=a41_0x4319();let _0x2b78a6=_0x43194c[_0x3df16a];return _0x2b78a6;}function a41_0x4319(){const _0x907343=['\x20unchanged\x20files','targetDir','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','repeat','helpText','Target\x20resource:\x20','activations','error','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','length','parent_segment','679689cnUZDg','7fGskQv','journeyVersions','isNew','cwd','dryRun','description','✔\x20Pulled\x20','\x0aPull\x20summary\x20for\x20\x27','no_parent','\x20files\x20to\x20','\x20with\x20','segment','utf-8','journeys','parentName','2Dvkofb','Write\x20','type','\x20\x20Target:\x20','setPhase','files','-\x20no\x20files\x20written','segments','\x20\x20🎯\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','cyan','counts','filter','name','\x20versions)','content','dim','\x0aChanges\x20to\x20\x27','segment:pull','Error:\x20','✔\x20Context\x20set:\x20','parentSegment','\x20=\x20','hasChanges','red','site','pullSegments','yellow','green','472680MckCyI','Site:\x20','yes','8552SOTupz','\x0aError:','5273508eRZcXQ','\x27...','3264620qEaNYh','verbose','file','absolutePath','\x20files?','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)','\x20changed\x20files','Pulling\x20segments\x20from\x20\x27','\x20segments','6543XYYXVZ','✔\x20All\x20files\x20are\x20up\x20to\x20date','23703250PWJKAp','688924DGyVSa','execute'];a41_0x4319=function(){return _0x907343;};return a41_0x4319();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a41_0x5f5477 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a41_0x118d29(0x199)]=a41_0x118d29(0x19e);[a41_0x118d29(0x182)]=a41_0x118d29(0x179);async[a41_0x118d29(0x16e)](_0xd07548){const _0x31cc8b=a41_0x118d29,{options:_0xf99365,args:_0xc100a8,tdx:_0x3bfac4}=_0xd07548,_0x3cf71e=_0xf99365,_0x4da234=await resolveTarget({'arg':_0xc100a8[0x0],'contextParent':_0xf99365[_0x31cc8b(0x152)],'cwd':process[_0x31cc8b(0x180)]()});if(!isSuccessfulResolution(_0x4da234))return _0x4da234['errorCode']===_0x31cc8b(0x185)?(console[_0x31cc8b(0x177)](a41_0x196d17[_0x31cc8b(0x158)](_0x31cc8b(0x195))),console[_0x31cc8b(0x177)](_0x31cc8b(0x166)),console[_0x31cc8b(0x177)](_0x31cc8b(0x172)),console[_0x31cc8b(0x177)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x31cc8b(0x177)](a41_0x196d17['red'](_0x31cc8b(0x19f)+_0x4da234['message']+'\x0a')),_0x4da234['helpText']&&console['error'](a41_0x196d17['cyan'](_0x4da234[_0x31cc8b(0x174)]))),0x1;const _0x415c34=_0x4da234[_0x31cc8b(0x18b)],_0x9efd8c=_0x4da234[_0x31cc8b(0x170)],_0x376dd0=_0x4da234[_0x31cc8b(0x18e)]===_0x31cc8b(0x163)?_0x4da234['resourceName']:undefined;_0x3cf71e[_0x31cc8b(0x162)]&&(console[_0x31cc8b(0x177)](_0x31cc8b(0x15b)+_0x3cf71e[_0x31cc8b(0x156)]),console[_0x31cc8b(0x177)]('Parent\x20segment:\x20'+_0x415c34),_0x376dd0&&console[_0x31cc8b(0x177)](_0x31cc8b(0x175)+_0x376dd0));const _0x24bf2d=await withProgressSpinner(_0x31cc8b(0x168)+_0x415c34+_0x31cc8b(0x160),_0x4ebbea=>_0x3bfac4[_0x31cc8b(0x188)][_0x31cc8b(0x157)](_0x415c34,{'targetDir':_0x9efd8c,'targetResourceName':_0x376dd0,'verbose':_0x3cf71e[_0x31cc8b(0x162)],'progress':{'update':_0x5be463=>{const _0x4383a0=_0x31cc8b;_0x4ebbea[_0x4383a0(0x190)](_0x5be463),_0x3cf71e[_0x4383a0(0x162)]&&console[_0x4383a0(0x177)]('\x20\x20'+_0x5be463);}}}),{'verbose':_0x3cf71e[_0x31cc8b(0x162)]}),_0x19f0f3=_0x24bf2d['data'];if(_0x19f0f3[_0x31cc8b(0x197)][_0x31cc8b(0x193)]===0x0&&_0x19f0f3[_0x31cc8b(0x197)]['journeys']===0x0)return console[_0x31cc8b(0x177)](a41_0x196d17[_0x31cc8b(0x158)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x19f0f3[_0x31cc8b(0x18b)]+'\x27')),0x0;const _0x494a16=_0x19f0f3[_0x31cc8b(0x191)][_0x31cc8b(0x198)](_0x31de29=>_0x31de29[_0x31cc8b(0x17f)]),_0x1b55b7=_0x19f0f3[_0x31cc8b(0x191)][_0x31cc8b(0x198)](_0x179440=>!_0x179440[_0x31cc8b(0x17f)]&&_0x179440['hasChanges']),_0x25d647=_0x19f0f3[_0x31cc8b(0x191)]['filter'](_0x5bcd4d=>!_0x5bcd4d[_0x31cc8b(0x17f)]&&!_0x5bcd4d['hasChanges']);console[_0x31cc8b(0x177)](_0x31cc8b(0x184)+_0x19f0f3[_0x31cc8b(0x18b)]+'\x27:'),console[_0x31cc8b(0x177)](_0x31cc8b(0x194)+a41_0x196d17[_0x31cc8b(0x196)](_0x19f0f3[_0x31cc8b(0x197)]['segments']+_0x31cc8b(0x169))+_0x31cc8b(0x187)+a41_0x196d17[_0x31cc8b(0x196)](_0x19f0f3[_0x31cc8b(0x197)][_0x31cc8b(0x176)]+'\x20activations'));if(_0x19f0f3[_0x31cc8b(0x197)]['journeys']>0x0){const _0x1c89e2=_0x19f0f3[_0x31cc8b(0x197)][_0x31cc8b(0x17e)]>_0x19f0f3['counts'][_0x31cc8b(0x18a)]?'\x20('+_0x19f0f3[_0x31cc8b(0x197)][_0x31cc8b(0x17e)]+_0x31cc8b(0x19a):'';console[_0x31cc8b(0x177)]('\x20\x20🗺️\x20\x20'+a41_0x196d17[_0x31cc8b(0x196)](_0x19f0f3[_0x31cc8b(0x197)]['journeys']+'\x20journeys')+a41_0x196d17[_0x31cc8b(0x19c)](_0x1c89e2));}console['error']('\x20\x20'+a41_0x196d17[_0x31cc8b(0x159)]('+\x20'+_0x494a16[_0x31cc8b(0x17a)]+'\x20new\x20files')),console[_0x31cc8b(0x177)]('\x20\x20'+a41_0x196d17[_0x31cc8b(0x158)]('~\x20'+_0x1b55b7['length']+_0x31cc8b(0x167))),console[_0x31cc8b(0x177)]('\x20\x20'+a41_0x196d17[_0x31cc8b(0x19c)]('=\x20'+_0x25d647[_0x31cc8b(0x17a)]+_0x31cc8b(0x16f))),console[_0x31cc8b(0x177)](_0x31cc8b(0x18f)+a41_0x196d17[_0x31cc8b(0x196)](_0x19f0f3['targetDir'])+'\x0a');if(_0x1b55b7[_0x31cc8b(0x17a)]>0x0)for(const _0x3a3308 of _0x1b55b7){console[_0x31cc8b(0x177)](_0x31cc8b(0x19d)+_0x3a3308['relativePath']+'\x27:'),console[_0x31cc8b(0x177)]('─'[_0x31cc8b(0x173)](0x3c)),console[_0x31cc8b(0x177)](_0x3a3308['diff']),console[_0x31cc8b(0x177)]('─'[_0x31cc8b(0x173)](0x3c));}if(_0x3cf71e[_0x31cc8b(0x181)])return console['error'](a41_0x196d17[_0x31cc8b(0x158)](_0x31cc8b(0x178))),0x0;if(_0x494a16['length']===0x0&&_0x1b55b7['length']===0x0)return console['error'](a41_0x196d17[_0x31cc8b(0x159)](_0x31cc8b(0x16b))),saveSessionContext({'parent_segment':_0x19f0f3[_0x31cc8b(0x18b)]},_0x3cf71e['session']),console[_0x31cc8b(0x177)](a41_0x196d17['green'](_0x31cc8b(0x151)+a41_0x196d17[_0x31cc8b(0x19c)](_0x31cc8b(0x17b))+_0x31cc8b(0x153)+a41_0x196d17[_0x31cc8b(0x196)](_0x19f0f3[_0x31cc8b(0x18b)]))),0x0;if(!_0x3cf71e[_0x31cc8b(0x15c)]){if(!isInteractive())return console[_0x31cc8b(0x177)](a41_0x196d17[_0x31cc8b(0x155)](_0x31cc8b(0x15e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a41_0x196d17[_0x31cc8b(0x19c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xee6afa=await confirmKey(_0x31cc8b(0x18d)+(_0x494a16[_0x31cc8b(0x17a)]+_0x1b55b7[_0x31cc8b(0x17a)])+_0x31cc8b(0x165));if(!_0xee6afa)return console[_0x31cc8b(0x177)](a41_0x196d17[_0x31cc8b(0x158)]('Aborted.'),_0x31cc8b(0x192)),0x1;}for(const _0x34a94f of _0x19f0f3['files']){if(_0x34a94f[_0x31cc8b(0x17f)]||_0x34a94f[_0x31cc8b(0x154)]){const _0x53d255=a41_0x5f5477['dirname'](_0x34a94f[_0x31cc8b(0x164)]);!existsSync(_0x53d255)&&mkdirSync(_0x53d255,{'recursive':!![]}),writeFileSync(_0x34a94f['absolutePath'],_0x34a94f[_0x31cc8b(0x19b)],_0x31cc8b(0x189));}}return console[_0x31cc8b(0x177)](a41_0x196d17['green'](_0x31cc8b(0x183)+(_0x494a16[_0x31cc8b(0x17a)]+_0x1b55b7[_0x31cc8b(0x17a)])+_0x31cc8b(0x186)+_0x19f0f3[_0x31cc8b(0x170)])),saveSessionContext({'parent_segment':_0x19f0f3['parentName']},_0x3cf71e[_0x31cc8b(0x171)]),console[_0x31cc8b(0x177)](a41_0x196d17['green'](_0x31cc8b(0x151)+a41_0x196d17[_0x31cc8b(0x19c)](_0x31cc8b(0x17b))+'\x20=\x20'+a41_0x196d17[_0x31cc8b(0x196)](_0x19f0f3[_0x31cc8b(0x18b)]))),0x0;}}
@@ -1 +1 @@
1
- function a42_0x446a(_0xc67a0a,_0x13717c){_0xc67a0a=_0xc67a0a-0x1b4;const _0x1ecd92=a42_0x1ecd();let _0x446a11=_0x1ecd92[_0xc67a0a];return _0x446a11;}const a42_0x15f989=a42_0x446a;(function(_0xbc95e5,_0x30d43d){const _0xa97beb=a42_0x446a,_0x33ce39=_0xbc95e5();while(!![]){try{const _0x2da6f4=-parseInt(_0xa97beb(0x1f1))/0x1+-parseInt(_0xa97beb(0x244))/0x2*(parseInt(_0xa97beb(0x246))/0x3)+-parseInt(_0xa97beb(0x21c))/0x4+parseInt(_0xa97beb(0x1dd))/0x5*(-parseInt(_0xa97beb(0x21a))/0x6)+-parseInt(_0xa97beb(0x231))/0x7*(parseInt(_0xa97beb(0x211))/0x8)+parseInt(_0xa97beb(0x241))/0x9+parseInt(_0xa97beb(0x1d6))/0xa;if(_0x2da6f4===_0x30d43d)break;else _0x33ce39['push'](_0x33ce39['shift']());}catch(_0x30eba1){_0x33ce39['push'](_0x33ce39['shift']());}}}(a42_0x1ecd,0xcaca9));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 a42_0x361cc0 from'chalk';import{existsSync}from'fs';function a42_0x1ecd(){const _0x1cf825=['/sb/da/esr','\x20\x20\x20\x20','Scoped\x20to\x20folder:\x20','map','Fetching\x20existing\x20activations...','Push\x20','results','journeysOnly','unchanged','changed','\x20created','\x0a✔\x20Push\x20complete','folderPath','filter','cyan','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segments','endsWith','deleted','add','createdAt','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','segmentFolderId','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','site','45784570IKfgTF','error','Changes\x20to\x20journey:','paused','\x20\x20Activations:\x20','isNew','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2025xbGyvh','toCreate','createdSegmentIds','isScoped','folders','green','idToName','parent_name','push','\x20changes?','\x27...','existingSegment','type','listSegments','\x20\x20🗺️\x20\x20Journeys:','toDelete','\x20to\x20create','yellow','\x20activations]','existingJourney','998851ADStdx','listActivations','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','repeat','yamlConfig','Resolving\x20parent\x20segment\x20\x27','.yml','\x20to\x20delete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','join','execute','attributes','No\x20','/app/ps/','audienceId','\x20updated','red','get','Changes\x20to:','connection','getOutputSchemaWithCache','activations','verbose','Source\x20directory:\x20','journey','data','Fetching\x20existing\x20data...','scopedFolderPath','journeys','targetDir','Site:\x20','35624CdyWiV','Error:\x20Directory\x20not\x20found:\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)','\x20\x20Journeys:\x20','diff','segment:push','description','all','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','3594aDtzGF','file','5576252eRRpLx','blue','name','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','relationships','buildUserMaps','getJourney','\x20changed','parentName','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20📊\x20Segments:','/j/da/je','updated','/e/','user','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','dim','then','\x0aPush\x20summary\x20for\x20\x27','Preparing\x20journeys...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','2135UyXSLs','segment\x20or\x20journey','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20YAML\x20files\x20found','journeyBundleName','nameToType','message','created','\x20new','listJourneysWithDetailsFromParentSegment','getParent','helpText','New\x20segment:','nameToId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','12447108rJzaiy','updatedAt','Aborted.','379054gsWafa','\x20unchanged','18RDRalN','length','folderId','no_parent','yes','parentSegment','\x20\x20Activations:','\x20deleted','Error:\x20','listFolders','delete','journeyId','Error\x20parsing\x20YAML:\x20','New\x20journey:','\x0aValidation\x20failed:','filePath','resolveParentId','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Parent\x20segment:\x20','.yaml','dryRun','versionNumber'];a42_0x1ecd=function(){return _0x1cf825;};return a42_0x1ecd();}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{[a42_0x15f989(0x21e)]=a42_0x15f989(0x216);[a42_0x15f989(0x217)]=a42_0x15f989(0x22b);async[a42_0x15f989(0x1fc)](_0x41f780){const _0x47f837=a42_0x15f989,{options:_0x5872eb,args:_0x150b7a,tdx:_0x2f0a23}=_0x41f780,_0x1d1f1f=_0x5872eb,_0x49ed23=await resolveTarget({'arg':_0x150b7a[0x0],'contextParent':_0x5872eb[_0x47f837(0x24b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x49ed23))return _0x49ed23['errorCode']===_0x47f837(0x249)?(console[_0x47f837(0x1d7)](a42_0x361cc0['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x47f837(0x213)),console[_0x47f837(0x1d7)](_0x47f837(0x234)),console['error'](_0x47f837(0x219))):(console['error'](a42_0x361cc0[_0x47f837(0x202)](_0x47f837(0x24e)+_0x49ed23[_0x47f837(0x238)]+'\x0a')),_0x49ed23[_0x47f837(0x23d)]&&console['error'](a42_0x361cc0[_0x47f837(0x1cb)](_0x49ed23[_0x47f837(0x23d)]))),0x1;if(_0x49ed23[_0x47f837(0x1e9)]===_0x47f837(0x1e4))return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x202)](_0x47f837(0x212)+_0x49ed23[_0x47f837(0x20f)]+'\x0a')),console['error'](a42_0x361cc0['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0xfc58b0=_0x49ed23[_0x47f837(0x224)],_0x5f0f01=_0x49ed23['targetDir'],_0x40bc04=_0x49ed23[_0x47f837(0x1e9)]===_0x47f837(0x21b)?_0x49ed23[_0x47f837(0x1b6)]:undefined,_0x4d3733=getScopedDetails(_0x49ed23),_0x3b93f9=_0x4d3733?.[_0x47f837(0x1e0)]??![],_0x377ce6=_0x4d3733?.[_0x47f837(0x20d)]??'';if(!existsSync(_0x5f0f01))return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x202)](_0x47f837(0x212)+_0x5f0f01+'\x0a')),console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1cb)](_0x47f837(0x1d2))),0x1;_0x1d1f1f[_0x47f837(0x208)]&&(console[_0x47f837(0x1d7)](_0x47f837(0x210)+_0x1d1f1f['site']),console[_0x47f837(0x1d7)](_0x47f837(0x1b9)+_0xfc58b0),console[_0x47f837(0x1d7)](_0x47f837(0x209)+_0x5f0f01),_0x3b93f9&&console[_0x47f837(0x1d7)](_0x47f837(0x1bf)+_0x377ce6));const _0x5d39c1=await withSpinner(_0x47f837(0x1f6)+_0xfc58b0+_0x47f837(0x1e7),()=>_0x2f0a23['segment'][_0x47f837(0x1b7)](_0xfc58b0),{'verbose':_0x1d1f1f[_0x47f837(0x208)]}),_0x316186=_0x5d39c1['data'],{parentSegmentResult:_0x4cc89f,segmentsResult:_0x3379d9,foldersResult:_0x41b777,journeysWithDetailsResult:_0xe5f942,userMaps:_0x49bebc}=await withSpinner(_0x47f837(0x20c),async()=>{const _0x377fc0=_0x47f837,[_0x549ac9,_0x2cb8be,_0x3d793e,_0x2fa397,_0x366b9d]=await Promise['all']([_0x2f0a23[_0x377fc0(0x233)][_0x377fc0(0x23c)](_0x316186),_0x2f0a23['segment'][_0x377fc0(0x1ea)](_0x316186),_0x2f0a23[_0x377fc0(0x233)][_0x377fc0(0x24f)](_0x316186),_0x2f0a23[_0x377fc0(0x20a)][_0x377fc0(0x23b)](_0x316186,{'includeAllVersions':!![]}),_0x2f0a23[_0x377fc0(0x22a)][_0x377fc0(0x221)]()]);return{'parentSegmentResult':_0x549ac9,'segmentsResult':_0x2cb8be,'foldersResult':_0x3d793e,'journeysWithDetailsResult':_0x2fa397,'userMaps':_0x366b9d};},{'verbose':_0x1d1f1f[_0x47f837(0x208)]})[_0x47f837(0x22d)](_0x5782cc=>_0x5782cc[_0x47f837(0x20b)]),_0x20689f=_0x4cc89f,_0x28a3af=extractRootFolderId(_0x20689f),_0x154d8e=_0x3379d9,_0x487728=_0x41b777,{journeys:_0xec766a,activationStepsById:_0x487a90}=_0xe5f942,_0x1b65c4=new Map(_0xec766a['map'](_0x27935d=>[_0x27935d['id'],_0x27935d])),_0x2c15a2=_0xec766a[_0x47f837(0x1c0)](_0x14a192=>({'id':_0x14a192['id'],'name':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x21e)],'journeyBundleName':_0x14a192['attributes']['journeyBundleName']||'','journeyBundleId':_0x14a192[_0x47f837(0x1fd)]['journeyBundleId']||'','versionNumber':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x1bc)],'description':_0x14a192[_0x47f837(0x1fd)]['description'],'state':_0x14a192[_0x47f837(0x1fd)]['state'],'paused':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x1d9)],'audienceId':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x200)],'folderId':_0x14a192[_0x47f837(0x220)]?.['parentFolder']?.[_0x47f837(0x20b)]?.['id'],'createdAt':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x1d1)],'updatedAt':_0x14a192[_0x47f837(0x1fd)][_0x47f837(0x242)]})),{emailToId:_0x2a817b,idToEmail:_0x55763f}=_0x49bebc,_0x48041e=await withSpinner(_0x47f837(0x225),async()=>{const _0x2c9d0c=_0x47f837,_0x2f4e43=await _0x2f0a23[_0x2c9d0c(0x205)]['list']();return buildConnectionMaps(_0x2f4e43);},{'verbose':_0x1d1f1f[_0x47f837(0x208)]})[_0x47f837(0x22d)](_0x464a62=>_0x464a62[_0x47f837(0x20b)]),_0x35359d=_0x48041e[_0x47f837(0x23f)],_0x920b7d=_0x48041e[_0x47f837(0x1e3)],_0x15562e=_0x48041e[_0x47f837(0x237)],_0x539d20={'emailToIdMap':_0x2a817b,'connectionNameToIdMap':_0x35359d,'connectionNameToTypeMap':_0x15562e,'getSchema':_0x172cef=>_0x2f0a23[_0x47f837(0x205)][_0x47f837(0x206)](_0x172cef)};let {pathToId:_0x21e939,idToPath:_0x2a99bf}=buildFolderMaps(_0x487728);const _0x2d5bb8=buildSegmentLookupMap(_0x154d8e,_0x2a99bf),_0x182273=buildSegmentNameToIdMap(_0x154d8e),_0x32443a=buildJourneyBundleLookupMap(_0x2c15a2,_0x2a99bf);let _0x398218;if(_0x40bc04){if(!_0x40bc04['endsWith'](_0x47f837(0x1f7))&&!_0x40bc04[_0x47f837(0x1ce)](_0x47f837(0x1ba)))return console['error'](a42_0x361cc0['red'](_0x47f837(0x1f9)+_0x40bc04+'\x0a')),0x1;_0x398218=[_0x40bc04];}else _0x398218=findYamlFiles(_0x5f0f01);if(_0x398218[_0x47f837(0x247)]===0x0)return console[_0x47f837(0x1d7)](a42_0x361cc0['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5f0f01+'\x0a')),console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1cb)](_0x47f837(0x1d4))),0x1;let _0x886180,_0x1d227d;try{const _0x456da5=parseAndClassifyYamlFiles(_0x398218,_0x5f0f01,{'skipSegments':_0x1d1f1f[_0x47f837(0x1c4)]});_0x886180=_0x456da5['segments'],_0x1d227d=_0x456da5[_0x47f837(0x20e)];const _0x44d3d4=validateParsedFiles(_0x456da5,_0x5f0f01);if(_0x44d3d4[_0x47f837(0x247)]>0x0)return console[_0x47f837(0x1d7)](a42_0x361cc0['red'](_0x47f837(0x1b5))),console[_0x47f837(0x1d7)](formatValidationErrors(_0x44d3d4)),console['error'](a42_0x361cc0['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x2566dc){return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x202)](_0x47f837(0x252)+(_0x2566dc instanceof Error?_0x2566dc['message']:_0x2566dc))),0x1;}if(_0x886180['length']===0x0&&_0x1d227d[_0x47f837(0x247)]===0x0){const _0x5cc231=_0x1d1f1f[_0x47f837(0x1c4)]?'journey':_0x47f837(0x232);return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x1fe)+_0x5cc231+_0x47f837(0x235))),0x0;}const _0x5efdac=new Map();_0x154d8e[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)]&&await withSpinner(_0x47f837(0x1c1),async()=>{await batchAsync(_0x154d8e,async _0x45412c=>{const _0x5f1a73=a42_0x446a,_0xc556e0=await _0x2f0a23[_0x5f1a73(0x233)][_0x5f1a73(0x1f2)](_0x316186,_0x45412c['id']);_0x5efdac['set'](_0x45412c['id'],_0xc556e0);});},{'verbose':_0x1d1f1f[_0x47f837(0x208)]});const {segmentFiles:_0x155f81,foldersToCreate:_0x383ed6}=await prepareSegmentFiles(_0x886180,{'segmentByFolderAndName':_0x2d5bb8,'activationsBySegmentId':_0x5efdac,'folderPathToId':_0x21e939,'idToEmailMap':_0x55763f,'connectionIdToNameMap':_0x920b7d},_0x539d20,_0x3b93f9,_0x377ce6),_0x5be760=_0x40bc04?[]:findSegmentsToDelete(_0x154d8e,_0x886180[_0x47f837(0x1c0)](({yamlConfig:_0xe0b082,folderPath:_0x17bb3c})=>({'yamlConfig':_0xe0b082,'folderPath':resolveTDFolderPath(_0x17bb3c,_0x3b93f9,_0x377ce6)})),_0x2a99bf,_0x377ce6,_0x3b93f9),{journeyFiles:_0x1c72a3,foldersToCreate:_0x44d021}=await withProgressSpinner(_0x47f837(0x22f),async _0x156380=>prepareJourneyFiles(_0x1d227d,{'fetchJourney':async _0x1c637b=>_0x2f0a23[_0x47f837(0x20a)][_0x47f837(0x222)](_0x1c637b[_0x47f837(0x251)]),'journeyBundlesByFolderAndName':_0x32443a,'folderPathToId':_0x21e939,'idToEmailMap':_0x55763f,'connectionIdToNameMap':_0x920b7d,'existingSegments':_0x154d8e,'parentId':_0x316186,'deps':_0x2f0a23,'progress':{'update':_0x211c70=>{const _0x1c73d6=_0x47f837;_0x156380['setPhase'](_0x211c70),_0x1d1f1f[_0x1c73d6(0x208)]&&console[_0x1c73d6(0x1d7)]('\x20\x20'+_0x211c70);}},'journeyById':_0x1b65c4,'activationStepsById':_0x487a90},_0x3b93f9,_0x377ce6),{'verbose':_0x1d1f1f['verbose']})[_0x47f837(0x22d)](_0x48a247=>_0x48a247['data']);for(const _0x2f2593 of _0x44d021){_0x383ed6[_0x47f837(0x1d0)](_0x2f2593);}const _0x4d4cf5=_0x40bc04?[]:findJourneysToDelete(_0x2c15a2,_0x1d227d[_0x47f837(0x1c0)](({yamlConfig:_0x287df4,folderPath:_0x2a93bf})=>({'yamlConfig':_0x287df4,'folderPath':resolveTDFolderPath(_0x2a93bf,_0x3b93f9,_0x377ce6)})),_0x2a99bf,_0x377ce6,_0x3b93f9),_0x55a509=calculatePushStats(_0x155f81,_0x1c72a3,_0x383ed6,_0x5be760,_0x4d4cf5,!!_0x1d1f1f[_0x47f837(0x250)],!!_0x1d1f1f['journeysOnly']),_0x58a932=_0x55a509[_0x47f837(0x1cd)]['new'],_0x1fd732=_0x55a509[_0x47f837(0x1cd)]['changed'],_0x49eb65=_0x55a509[_0x47f837(0x1cd)]['unchanged'],_0x108905=_0x55a509[_0x47f837(0x1cd)]['toDelete'],_0x258c5b=_0x55a509[_0x47f837(0x1e1)][_0x47f837(0x1de)],_0x4549d8=_0x55a509[_0x47f837(0x20e)]['new'],_0x3101eb=_0x55a509['journeys'][_0x47f837(0x1c6)],_0x4cfead=_0x55a509[_0x47f837(0x20e)][_0x47f837(0x1c5)],_0x264354=_0x55a509[_0x47f837(0x20e)][_0x47f837(0x1ec)],_0x32ae8d=_0x55a509['activations'][_0x47f837(0x218)],_0x2dd248=_0x55a509['activations'][_0x47f837(0x1de)],_0x11f436=_0x55a509[_0x47f837(0x207)]['toUpdate'],_0x2d06c4=_0x55a509[_0x47f837(0x207)][_0x47f837(0x1ec)];console['error'](_0x47f837(0x22e)+_0xfc58b0+'\x27:');_0x258c5b['length']>0x0&&console['error']('\x20\x20'+a42_0x361cc0[_0x47f837(0x21d)]('📁\x20'+_0x258c5b[_0x47f837(0x247)]+'\x20folders\x20to\x20create'));if(!_0x1d1f1f['journeysOnly']){console[_0x47f837(0x1d7)](_0x47f837(0x226)),console[_0x47f837(0x1d7)](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1e2)]('+\x20'+_0x58a932[_0x47f837(0x247)]+_0x47f837(0x23a))),console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1ee)]('~\x20'+_0x1fd732[_0x47f837(0x247)]+'\x20changed'));if(_0x108905[_0x47f837(0x247)]>0x0)console['error'](_0x47f837(0x1be)+a42_0x361cc0['red']('-\x20'+_0x108905[_0x47f837(0x247)]+_0x47f837(0x1f8)));else _0x5be760[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x250)]&&console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x22c)](_0x5be760[_0x47f837(0x247)]+_0x47f837(0x240)));console['error']('\x20\x20\x20\x20'+a42_0x361cc0[_0x47f837(0x22c)]('=\x20'+_0x49eb65[_0x47f837(0x247)]+_0x47f837(0x245)));}if(_0x1c72a3[_0x47f837(0x247)]>0x0||_0x4d4cf5[_0x47f837(0x247)]>0x0){console[_0x47f837(0x1d7)](_0x47f837(0x1eb)),console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1e2)]('+\x20'+_0x4549d8['length']+_0x47f837(0x23a))),console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1ee)]('~\x20'+_0x3101eb['length']+_0x47f837(0x223)));if(_0x264354[_0x47f837(0x247)]>0x0)console[_0x47f837(0x1d7)]('\x20\x20\x20\x20'+a42_0x361cc0[_0x47f837(0x202)]('-\x20'+_0x264354[_0x47f837(0x247)]+_0x47f837(0x1f8)));else _0x4d4cf5['length']>0x0&&!_0x1d1f1f[_0x47f837(0x250)]&&console['error']('\x20\x20\x20\x20'+a42_0x361cc0[_0x47f837(0x22c)](_0x4d4cf5[_0x47f837(0x247)]+_0x47f837(0x240)));console[_0x47f837(0x1d7)](_0x47f837(0x1be)+a42_0x361cc0['dim']('=\x20'+_0x4cfead['length']+_0x47f837(0x245)));}_0x32ae8d[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)]&&(console[_0x47f837(0x1d7)](''),console[_0x47f837(0x1d7)](_0x47f837(0x24c)),_0x2dd248[_0x47f837(0x247)]>0x0&&console[_0x47f837(0x1d7)](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1e2)]('+\x20'+_0x2dd248[_0x47f837(0x247)]+_0x47f837(0x1ed))),_0x11f436['length']>0x0&&console['error'](_0x47f837(0x1be)+a42_0x361cc0[_0x47f837(0x1ee)]('~\x20'+_0x11f436[_0x47f837(0x247)]+'\x20to\x20update')),_0x2d06c4[_0x47f837(0x247)]>0x0&&console[_0x47f837(0x1d7)]('\x20\x20\x20\x20'+a42_0x361cc0[_0x47f837(0x202)]('-\x20'+_0x2d06c4['length']+'\x20to\x20delete')));console[_0x47f837(0x1d7)]('\x20\x20Source:\x20'+a42_0x361cc0[_0x47f837(0x1cb)](_0x5f0f01)+'\x0a');if(_0x258c5b[_0x47f837(0x247)]>0x0){console[_0x47f837(0x1d7)]('Folders\x20to\x20create:');for(const _0x3cdb78 of _0x258c5b){console['error']('\x20\x20'+a42_0x361cc0[_0x47f837(0x21d)]('+')+'\x20'+_0x3cdb78);}console['error']('');}if(_0x58a932[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)])for(const _0x412a9a of _0x58a932){const _0x1e1f70=_0x412a9a[_0x47f837(0x1c9)]?_0x412a9a[_0x47f837(0x1c9)]+'/'+_0x412a9a[_0x47f837(0x1f5)][_0x47f837(0x21e)]:_0x412a9a[_0x47f837(0x1f5)][_0x47f837(0x21e)],_0x3adc21=_0x412a9a[_0x47f837(0x1f5)][_0x47f837(0x207)]?.['length']||0x0,_0x57540f=_0x3adc21>0x0?a42_0x361cc0[_0x47f837(0x22c)]('\x20['+_0x3adc21+_0x47f837(0x1ef)):'';console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0[_0x47f837(0x1e2)](_0x47f837(0x23e))+'\x20'+_0x1e1f70+_0x57540f),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c)),_0x412a9a['diff']&&console[_0x47f837(0x1d7)](_0x412a9a[_0x47f837(0x215)]),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));}if(_0x108905[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)])for(const _0x5b4384 of _0x108905){const _0x59a242=_0x5b4384['segmentFolderId']?_0x2a99bf[_0x47f837(0x203)](_0x5b4384[_0x47f837(0x1d3)]['toString']())||'':'',_0x52493c=_0x59a242?_0x59a242+'/'+_0x5b4384['name']:_0x5b4384['name'],_0x1cf29c=_0x5efdac[_0x47f837(0x203)](_0x5b4384['id'])||[],_0x1cea8c=_0x1cf29c[_0x47f837(0x247)]>0x0?a42_0x361cc0[_0x47f837(0x22c)]('\x20['+_0x1cf29c[_0x47f837(0x247)]+_0x47f837(0x1ef)):'';console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0['red']('Delete\x20segment:')+'\x20'+_0x52493c+_0x1cea8c),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));const _0x505659=segmentWithActivationsToYaml(_0x5b4384,_0x1cf29c,undefined,_0x55763f,_0x920b7d),_0x52a640=segmentToYamlString(_0x505659),_0x3f0d75=generateDiff(_0x52a640,'');console['error'](formatDiffWithColors(_0x3f0d75)),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));}const _0x27b4f6=_0x155f81[_0x47f837(0x1ca)](_0x11c566=>!_0x11c566[_0x47f837(0x1db)]&&_0x11c566[_0x47f837(0x215)]);if(_0x27b4f6[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)])for(const _0x385af6 of _0x27b4f6){const _0x22895d=_0x385af6[_0x47f837(0x1c9)]?_0x385af6[_0x47f837(0x1c9)]+'/'+_0x385af6[_0x47f837(0x1f5)]['name']:_0x385af6[_0x47f837(0x1f5)][_0x47f837(0x21e)];console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x204))+'\x20'+_0x22895d),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c)),console[_0x47f837(0x1d7)](_0x385af6[_0x47f837(0x215)]),console['error']('─'[_0x47f837(0x1f4)](0x3c));}if(_0x4549d8[_0x47f837(0x247)]>0x0)for(const _0x28646d of _0x4549d8){const _0x216273=_0x28646d[_0x47f837(0x1c9)]?_0x28646d[_0x47f837(0x1c9)]+'/'+_0x28646d[_0x47f837(0x1f5)][_0x47f837(0x21e)]:_0x28646d[_0x47f837(0x1f5)][_0x47f837(0x21e)];console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0[_0x47f837(0x1e2)](_0x47f837(0x1b4))+'\x20'+_0x216273),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c)),_0x28646d[_0x47f837(0x215)]&&console[_0x47f837(0x1d7)](_0x28646d['diff']),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));}const _0x1d374d=_0x1c72a3[_0x47f837(0x1ca)](_0x45cd9f=>!_0x45cd9f['isNew']&&_0x45cd9f['diff']);if(_0x1d374d[_0x47f837(0x247)]>0x0)for(const _0x8ef016 of _0x1d374d){const _0x547c90=_0x8ef016['folderPath']?_0x8ef016[_0x47f837(0x1c9)]+'/'+_0x8ef016['yamlConfig'][_0x47f837(0x21e)]:_0x8ef016[_0x47f837(0x1f5)]['name'];console[_0x47f837(0x1d7)]('\x0a'+a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x1d8))+'\x20'+_0x547c90),console['error']('─'[_0x47f837(0x1f4)](0x3c)),console['error'](_0x8ef016[_0x47f837(0x215)]),console[_0x47f837(0x1d7)]('─'[_0x47f837(0x1f4)](0x3c));}if(_0x264354[_0x47f837(0x247)]>0x0)for(const _0x2bb2ee of _0x264354){const _0x119498=_0x2bb2ee[_0x47f837(0x248)]?_0x2a99bf[_0x47f837(0x203)](_0x2bb2ee[_0x47f837(0x248)])||'':'',_0x3f127c=_0x119498?_0x119498+'/'+_0x2bb2ee[_0x47f837(0x236)]:_0x2bb2ee[_0x47f837(0x236)];console['error']('\x0a'+a42_0x361cc0[_0x47f837(0x202)]('Delete\x20journey:')+'\x20'+_0x3f127c),console['error']('─'[_0x47f837(0x1f4)](0x3c)),console[_0x47f837(0x1d7)](a42_0x361cc0['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x47f837(0x1d7)]('─'['repeat'](0x3c));}if(_0x1d1f1f[_0x47f837(0x1bb)])return console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x1fa))),0x0;const _0x377086=_0x1d1f1f['journeysOnly']?![]:_0x58a932[_0x47f837(0x247)]>0x0||_0x1fd732['length']>0x0||_0x108905['length']>0x0,_0x13e06f=_0x4549d8[_0x47f837(0x247)]>0x0||_0x3101eb[_0x47f837(0x247)]>0x0||_0x264354[_0x47f837(0x247)]>0x0,_0x26ad91=_0x1d1f1f['journeysOnly']?![]:_0x32ae8d[_0x47f837(0x247)]>0x0,_0x42b149=_0x258c5b[_0x47f837(0x247)]>0x0;if(!_0x377086&&!_0x13e06f&&!_0x26ad91&&!_0x42b149){const _0x465560=_0x1d1f1f[_0x47f837(0x1c4)]?_0x47f837(0x21f):_0x47f837(0x1b8);console[_0x47f837(0x1d7)](a42_0x361cc0['green'](_0x465560));if(_0x40bc04&&_0x49eb65[_0x47f837(0x247)]===0x1){const _0x2fab14=_0x49eb65[0x0];if(_0x2fab14[_0x47f837(0x1e8)]?.['id']){const _0xd613ce=getConsoleNextUrl(_0x1d1f1f['site'],'/app/ps/'+_0x316186+_0x47f837(0x229)+_0x2fab14['existingSegment']['id']+_0x47f837(0x1bd));console[_0x47f837(0x1d7)](_0x47f837(0x1f3)+a42_0x361cc0[_0x47f837(0x1cb)](_0xd613ce));}}if(_0x40bc04&&_0x4cfead[_0x47f837(0x247)]===0x1){const _0x4832aa=_0x4cfead[0x0];if(_0x4832aa[_0x47f837(0x1f0)]?.['id']){const _0x17bd2a=getConsoleNextUrl(_0x1d1f1f['site'],_0x47f837(0x1ff)+_0x316186+_0x47f837(0x229)+_0x4832aa[_0x47f837(0x1f0)]['id']+_0x47f837(0x227));console[_0x47f837(0x1d7)]('\x20\x20'+a42_0x361cc0[_0x47f837(0x1cb)](_0x17bd2a));}}return 0x0;}const _0x43afe9=_0x1d1f1f['journeysOnly']?_0x4549d8[_0x47f837(0x247)]+_0x3101eb['length']+_0x264354['length']+_0x258c5b[_0x47f837(0x247)]:_0x58a932[_0x47f837(0x247)]+_0x1fd732[_0x47f837(0x247)]+_0x108905['length']+_0x4549d8[_0x47f837(0x247)]+_0x3101eb[_0x47f837(0x247)]+_0x264354[_0x47f837(0x247)]+_0x258c5b[_0x47f837(0x247)]+_0x32ae8d[_0x47f837(0x247)];if(!_0x1d1f1f[_0x47f837(0x24a)]&&_0x43afe9>0x0){if(!isInteractive())return console['error'](a42_0x361cc0[_0x47f837(0x202)]('\x0aError:'),_0x47f837(0x1cc)),console['error'](a42_0x361cc0['dim'](_0x47f837(0x1dc))),0x1;const _0x3e3467=await confirmKey(_0x47f837(0x1c2)+_0x43afe9+_0x47f837(0x1e6));if(!_0x3e3467)return console['error'](a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x243))),0x1;}const _0x4abb6a={'withProgress':async(_0x237613,_0x47757e)=>{const _0x27ce2a=_0x47f837,_0x233548=await withSpinner(_0x237613,_0x47757e,{'verbose':_0x1d1f1f[_0x27ce2a(0x208)]});return{'data':_0x233548[_0x27ce2a(0x20b)]};},'logInfo':_0x185b5a=>console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x21d)]('✔\x20'+_0x185b5a)),'logSuccess':_0x46d166=>console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1e2)]('✔\x20'+_0x46d166)),'logWarning':_0x373beb=>console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1ee)]('⚠\x20'+_0x373beb)),'logDeleted':_0x66e282=>console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x202)]('✔\x20'+_0x66e282))},_0x3ba1df={'segment':_0x2f0a23[_0x47f837(0x233)],'journey':_0x2f0a23[_0x47f837(0x20a)],'user':_0x2f0a23['user'],'connection':_0x2f0a23[_0x47f837(0x205)]};_0x258c5b[_0x47f837(0x247)]>0x0&&(_0x21e939=await executePushFolders(_0x3ba1df,_0x258c5b,_0x21e939,{'parentId':_0x316186},_0x4abb6a));const _0x1f6c31={'rootFolderId':_0x28a3af,'folderPathToId':_0x21e939,'folderIdToPath':_0x2a99bf,'segmentNameToId':_0x182273,'activationsBySegmentId':_0x5efdac,'emailToIdMap':_0x2a817b,'idToEmailMap':_0x55763f,'connectionNameToIdMap':_0x48041e[_0x47f837(0x23f)],'connectionIdToNameMap':_0x48041e[_0x47f837(0x1e3)],'connectionNameToTypeMap':_0x15562e},_0x313c56=await executePushSegments(_0x3ba1df,_0x1d1f1f['journeysOnly']?[]:_0x155f81,_0x1f6c31,{'parentId':_0x316186},_0x4abb6a),_0x3da7d0=_0x313c56[_0x47f837(0x239)],_0x3f9a2e=_0x313c56['updated'],_0x18c399=_0x313c56[_0x47f837(0x207)][_0x47f837(0x239)],_0x348514=_0x313c56[_0x47f837(0x207)][_0x47f837(0x228)],_0x4a87f4=_0x313c56[_0x47f837(0x207)][_0x47f837(0x1cf)];let _0x342918;if(_0x40bc04&&_0x155f81[_0x47f837(0x247)]===0x1){const _0x3f6991=_0x155f81[0x0];_0x342918=_0x3f6991[_0x47f837(0x1e8)]?.['id']??_0x313c56[_0x47f837(0x1df)][_0x47f837(0x203)](_0x3f6991[_0x47f837(0x1f5)][_0x47f837(0x21e)]);}const _0x1f174a=await executePushSegmentDeletions(_0x3ba1df,_0x1d1f1f[_0x47f837(0x1c4)]?[]:_0x108905,_0x4abb6a);let _0x448170=0x0,_0x15ba45=0x0,_0x10bd3a=0x0;const _0x18dae5=new Map(_0x182273);for(const [_0x25aa5d,_0x20ff30]of _0x313c56[_0x47f837(0x1df)]){_0x18dae5['set'](_0x25aa5d,_0x20ff30);}if(_0x1c72a3[_0x47f837(0x247)]>0x0){const _0x361536={..._0x1f6c31,'segmentNameToId':_0x18dae5,'existingSegments':_0x154d8e,'activationContext':_0x539d20},_0x5de1f6=await executePushJourneys(_0x3ba1df,_0x1c72a3,_0x361536,{'parentId':_0x316186,'rootFolderId':_0x28a3af,'verbose':_0x1d1f1f[_0x47f837(0x208)]},_0x4abb6a);_0x448170=_0x5de1f6['created'],_0x15ba45=_0x5de1f6['updated'];if(_0x40bc04&&_0x5de1f6[_0x47f837(0x1c3)][_0x47f837(0x247)]===0x1){const _0x29a78b=_0x5de1f6[_0x47f837(0x1c3)][0x0];if(_0x29a78b[_0x47f837(0x251)]){const _0x1dec71=getConsoleNextUrl(_0x1d1f1f[_0x47f837(0x1d5)],_0x47f837(0x1ff)+_0x316186+_0x47f837(0x229)+_0x29a78b[_0x47f837(0x251)]+'/j/da/je');console[_0x47f837(0x1d7)]('\x20\x20'+a42_0x361cc0['cyan'](_0x1dec71));}}}for(const _0x5478b8 of _0x264354){console[_0x47f837(0x1d7)](a42_0x361cc0[_0x47f837(0x1ee)](_0x47f837(0x230)+_0x5478b8[_0x47f837(0x236)])),_0x10bd3a++;}const _0x247a78=[];if(_0x3da7d0>0x0)_0x247a78[_0x47f837(0x1e5)](_0x3da7d0+_0x47f837(0x1c7));if(_0x3f9a2e>0x0)_0x247a78[_0x47f837(0x1e5)](_0x3f9a2e+_0x47f837(0x201));if(_0x1f174a>0x0)_0x247a78['push'](_0x1f174a+_0x47f837(0x24d));const _0xc5188a=[];if(_0x448170>0x0)_0xc5188a[_0x47f837(0x1e5)](_0x448170+_0x47f837(0x1c7));if(_0x15ba45>0x0)_0xc5188a[_0x47f837(0x1e5)](_0x15ba45+_0x47f837(0x201));if(_0x10bd3a>0x0)_0xc5188a[_0x47f837(0x1e5)](_0x10bd3a+_0x47f837(0x24d));const _0x924feb=[];if(_0x18c399>0x0)_0x924feb[_0x47f837(0x1e5)](_0x18c399+_0x47f837(0x1c7));if(_0x348514>0x0)_0x924feb[_0x47f837(0x1e5)](_0x348514+_0x47f837(0x201));if(_0x4a87f4>0x0)_0x924feb[_0x47f837(0x1e5)](_0x4a87f4+_0x47f837(0x24d));console['error'](a42_0x361cc0[_0x47f837(0x1e2)](_0x47f837(0x1c8)));_0x247a78[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)]&&console[_0x47f837(0x1d7)]('\x20\x20Segments:\x20'+_0x247a78[_0x47f837(0x1fb)](',\x20'));_0xc5188a[_0x47f837(0x247)]>0x0&&console[_0x47f837(0x1d7)](_0x47f837(0x214)+_0xc5188a[_0x47f837(0x1fb)](',\x20'));_0x924feb[_0x47f837(0x247)]>0x0&&!_0x1d1f1f[_0x47f837(0x1c4)]&&console[_0x47f837(0x1d7)](_0x47f837(0x1da)+_0x924feb[_0x47f837(0x1fb)](',\x20'));if(_0x342918){const _0x15f18c=getConsoleNextUrl(_0x1d1f1f[_0x47f837(0x1d5)],'/app/ps/'+_0x316186+_0x47f837(0x229)+_0x342918+_0x47f837(0x1bd));console[_0x47f837(0x1d7)](_0x47f837(0x1f3)+a42_0x361cc0[_0x47f837(0x1cb)](_0x15f18c));}return 0x0;}}
1
+ const a42_0x42edcb=a42_0x1bb8;(function(_0x81850b,_0x470c38){const _0x43e058=a42_0x1bb8,_0x37962b=_0x81850b();while(!![]){try{const _0x5c389e=-parseInt(_0x43e058(0xb1))/0x1+parseInt(_0x43e058(0xf9))/0x2*(-parseInt(_0x43e058(0xa1))/0x3)+-parseInt(_0x43e058(0x8e))/0x4*(-parseInt(_0x43e058(0xf7))/0x5)+-parseInt(_0x43e058(0xa2))/0x6+-parseInt(_0x43e058(0xe0))/0x7*(parseInt(_0x43e058(0xb7))/0x8)+-parseInt(_0x43e058(0x96))/0x9+parseInt(_0x43e058(0xad))/0xa*(parseInt(_0x43e058(0x78))/0xb);if(_0x5c389e===_0x470c38)break;else _0x37962b['push'](_0x37962b['shift']());}catch(_0x3ec8d7){_0x37962b['push'](_0x37962b['shift']());}}}(a42_0x2af0,0xc3d2d));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 a42_0x1bb8(_0xe494ba,_0x289324){_0xe494ba=_0xe494ba-0x73;const _0x2af097=a42_0x2af0();let _0x1bb821=_0x2af097[_0xe494ba];return _0x1bb821;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a42_0x1078c6 from'chalk';function a42_0x2af0(){const _0x42cdbd=['dim','state','\x0a✔\x20Push\x20complete','dryRun','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Parent\x20segment:\x20','segment','segments','\x0aValidation\x20failed:','\x20unchanged','paused','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','isScoped','toString','parentSegment','toCreate','parentName','\x20\x20Segments:\x20','length','10vLWbBR','\x20to\x20delete','73686HoRAsj','isNew','segmentFolderId','audienceId','getParent','all','\x20folders\x20to\x20create','/app/ps/','/e/','deleted','\x20\x20📊\x20Segments:','Fetching\x20existing\x20activations...','folderId','\x20\x20Source:\x20','\x20created','no_parent','get','Resolving\x20parent\x20segment\x20\x27','.yaml','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','yes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20🗺️\x20\x20Journeys:','.yml','attributes','user','activations','cwd','resolveParentId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','existingJourney','\x20\x20Journeys:\x20','execute','11icAZmL','\x20new','\x0aPush\x20summary\x20for\x20\x27','/j/da/je','journey','diff','targetDir','existingSegment','join','Error\x20parsing\x20YAML:\x20','\x20to\x20create','created','helpText','createdSegmentIds','blue','listActivations','setPhase','journeysOnly','idToName','toUpdate','push','cyan','1340668eFnQYh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','delete','journeyId','\x20to\x20update','toDelete','journeys','Scoped\x20to\x20folder:\x20','12051000hvuNub','\x20deleted','set','Delete\x20segment:','segment\x20or\x20journey','folders','No\x20','relationships','yellow','\x20activations]','parentFolder','129WrXYtB','3168690afNOQZ','Source\x20directory:\x20','listFolders','buildUserMaps','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','new','/sb/da/esr','connection','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','filter','errorCode','59783170muBdpL','journeyBundleName','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','red','911694prWYKh','\x20\x20\x20\x20','changed','map','data','message','32ARsYiG','\x20changed','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segment:push','\x27...','Error:\x20','then','repeat','listSegments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','green','📁\x20','Preparing\x20journeys...','journeyBundleId','\x20updated','getOutputSchemaWithCache','scopedFolderPath','endsWith','createdAt','(Journey\x20will\x20be\x20deleted)','name','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','New\x20segment:','verbose','site','Push\x20','results','description','\x20\x20Activations:','\x20changes?','type','file','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Site:\x20','folderPath','unchanged','versionNumber','yamlConfig','nameToId','\x20YAML\x20files\x20found','2596125EOSvRm','error','updated'];a42_0x2af0=function(){return _0x42cdbd;};return a42_0x2af0();}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{[a42_0x42edcb(0xcb)]=a42_0x42edcb(0xba);[a42_0x42edcb(0xd2)]=a42_0x42edcb(0x10c);async[a42_0x42edcb(0x77)](_0x4ba1d6){const _0x5c8567=a42_0x42edcb,{options:_0x1c9e1b,args:_0x46f4a6,tdx:_0x2c886d}=_0x4ba1d6,_0xd8a378=_0x1c9e1b,_0x3cc64d=await resolveTarget({'arg':_0x46f4a6[0x0],'contextParent':_0x1c9e1b[_0x5c8567(0xf2)],'cwd':process[_0x5c8567(0x115)]()});if(!isSuccessfulResolution(_0x3cc64d))return _0x3cc64d[_0x5c8567(0xac)]===_0x5c8567(0x108)?(console['error'](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0xb9))),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x5c8567(0xe1)](_0x5c8567(0x8f))):(console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0xbc)+_0x3cc64d[_0x5c8567(0xb6)]+'\x0a')),_0x3cc64d[_0x5c8567(0x84)]&&console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x8d)](_0x3cc64d[_0x5c8567(0x84)]))),0x1;if(_0x3cc64d['type']==='parent_name')return console['error'](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0xee)+_0x3cc64d[_0x5c8567(0x7e)]+'\x0a')),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x8d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x5393e1=_0x3cc64d[_0x5c8567(0xf4)],_0x32e4a4=_0x3cc64d[_0x5c8567(0x7e)],_0x51b910=_0x3cc64d[_0x5c8567(0xd5)]===_0x5c8567(0xd6)?_0x3cc64d['filePath']:undefined,_0xeab36c=getScopedDetails(_0x3cc64d),_0x2ca4a4=_0xeab36c?.[_0x5c8567(0xf0)]??![],_0x4ead63=_0xeab36c?.[_0x5c8567(0xc7)]??'';if(!existsSync(_0x32e4a4))return console['error'](a42_0x1078c6['red'](_0x5c8567(0xee)+_0x32e4a4+'\x0a')),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x8d)](_0x5c8567(0xd7))),0x1;_0xd8a378[_0x5c8567(0xce)]&&(console['error'](_0x5c8567(0xd9)+_0xd8a378['site']),console[_0x5c8567(0xe1)](_0x5c8567(0xe8)+_0x5393e1),console['error'](_0x5c8567(0xa3)+_0x32e4a4),_0x2ca4a4&&console[_0x5c8567(0xe1)](_0x5c8567(0x95)+_0x4ead63));const _0x49b6d8=await withSpinner(_0x5c8567(0x10a)+_0x5393e1+_0x5c8567(0xbb),()=>_0x2c886d[_0x5c8567(0xe9)][_0x5c8567(0x73)](_0x5393e1),{'verbose':_0xd8a378[_0x5c8567(0xce)]}),_0x29e129=_0x49b6d8[_0x5c8567(0xb5)],{parentSegmentResult:_0xe2b584,segmentsResult:_0x4f457e,foldersResult:_0x27e49d,journeysWithDetailsResult:_0x49003d,userMaps:_0x2234a3}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x47920d=_0x5c8567,[_0x1ef050,_0x673cbf,_0x1d0198,_0x8650ce,_0x53df08]=await Promise[_0x47920d(0xfe)]([_0x2c886d['segment'][_0x47920d(0xfd)](_0x29e129),_0x2c886d[_0x47920d(0xe9)][_0x47920d(0xbf)](_0x29e129),_0x2c886d[_0x47920d(0xe9)][_0x47920d(0xa4)](_0x29e129),_0x2c886d['journey']['listJourneysWithDetailsFromParentSegment'](_0x29e129,{'includeAllVersions':!![]}),_0x2c886d[_0x47920d(0x113)][_0x47920d(0xa5)]()]);return{'parentSegmentResult':_0x1ef050,'segmentsResult':_0x673cbf,'foldersResult':_0x1d0198,'journeysWithDetailsResult':_0x8650ce,'userMaps':_0x53df08};},{'verbose':_0xd8a378['verbose']})[_0x5c8567(0xbd)](_0xa036f2=>_0xa036f2['data']),_0x53c57a=_0xe2b584,_0x2b4e18=extractRootFolderId(_0x53c57a),_0x4388e8=_0x4f457e,_0x546f9b=_0x27e49d,{journeys:_0x4f25f9,activationStepsById:_0x46031b}=_0x49003d,_0x20a080=new Map(_0x4f25f9[_0x5c8567(0xb4)](_0x4642f9=>[_0x4642f9['id'],_0x4642f9])),_0x2c7b41=_0x4f25f9[_0x5c8567(0xb4)](_0x456fc2=>({'id':_0x456fc2['id'],'name':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xcb)],'journeyBundleName':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xae)]||'','journeyBundleId':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xc4)]||'','versionNumber':_0x456fc2['attributes'][_0x5c8567(0xdc)],'description':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xd2)],'state':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xe4)],'paused':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xed)],'audienceId':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xfc)],'folderId':_0x456fc2[_0x5c8567(0x9d)]?.[_0x5c8567(0xa0)]?.['data']?.['id'],'createdAt':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xc9)],'updatedAt':_0x456fc2[_0x5c8567(0x112)]['updatedAt']})),{emailToId:_0x35ddff,idToEmail:_0x1eb3bf}=_0x2234a3,_0x32dcf3=await withSpinner(_0x5c8567(0xef),async()=>{const _0x19ed7a=_0x5c8567,_0x4184d8=await _0x2c886d[_0x19ed7a(0xa9)]['list']();return buildConnectionMaps(_0x4184d8);},{'verbose':_0xd8a378[_0x5c8567(0xce)]})[_0x5c8567(0xbd)](_0x434baa=>_0x434baa[_0x5c8567(0xb5)]),_0x59fe61=_0x32dcf3[_0x5c8567(0xde)],_0x137609=_0x32dcf3[_0x5c8567(0x8a)],_0x7dd3ba=_0x32dcf3['nameToType'],_0x59ea95={'emailToIdMap':_0x35ddff,'connectionNameToIdMap':_0x59fe61,'connectionNameToTypeMap':_0x7dd3ba,'getSchema':_0x970f76=>_0x2c886d['connection'][_0x5c8567(0xc6)](_0x970f76)};let {pathToId:_0x39efd9,idToPath:_0x1d3e85}=buildFolderMaps(_0x546f9b);const _0x13d80c=buildSegmentLookupMap(_0x4388e8,_0x1d3e85),_0x4058fc=buildSegmentNameToIdMap(_0x4388e8),_0x4fc950=buildJourneyBundleLookupMap(_0x2c7b41,_0x1d3e85);let _0x5fecde;if(_0x51b910){if(!_0x51b910[_0x5c8567(0xc8)](_0x5c8567(0x111))&&!_0x51b910[_0x5c8567(0xc8)](_0x5c8567(0x10b)))return console['error'](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0xe7)+_0x51b910+'\x0a')),0x1;_0x5fecde=[_0x51b910];}else _0x5fecde=findYamlFiles(_0x32e4a4);if(_0x5fecde['length']===0x0)return console[_0x5c8567(0xe1)](a42_0x1078c6['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x32e4a4+'\x0a')),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x8d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0xfcedab,_0x3be35b;try{const _0x42e7d9=parseAndClassifyYamlFiles(_0x5fecde,_0x32e4a4,{'skipSegments':_0xd8a378[_0x5c8567(0x89)]});_0xfcedab=_0x42e7d9[_0x5c8567(0xea)],_0x3be35b=_0x42e7d9['journeys'];const _0x532b52=validateParsedFiles(_0x42e7d9,_0x32e4a4);if(_0x532b52[_0x5c8567(0xf6)]>0x0)return console['error'](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0xeb))),console[_0x5c8567(0xe1)](formatValidationErrors(_0x532b52)),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0xa6))),0x1;}catch(_0xb868cc){return console['error'](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0x81)+(_0xb868cc instanceof Error?_0xb868cc[_0x5c8567(0xb6)]:_0xb868cc))),0x1;}if(_0xfcedab[_0x5c8567(0xf6)]===0x0&&_0x3be35b[_0x5c8567(0xf6)]===0x0){const _0x18588f=_0xd8a378[_0x5c8567(0x89)]?'journey':_0x5c8567(0x9a);return console['error'](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0x9c)+_0x18588f+_0x5c8567(0xdf))),0x0;}const _0x411979=new Map();_0x4388e8[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)]&&await withSpinner(_0x5c8567(0x104),async()=>{await batchAsync(_0x4388e8,async _0x4940e8=>{const _0x3d8dd3=a42_0x1bb8,_0xf0eb29=await _0x2c886d[_0x3d8dd3(0xe9)][_0x3d8dd3(0x87)](_0x29e129,_0x4940e8['id']);_0x411979[_0x3d8dd3(0x98)](_0x4940e8['id'],_0xf0eb29);});},{'verbose':_0xd8a378[_0x5c8567(0xce)]});const {segmentFiles:_0x4c3580,foldersToCreate:_0x2ccea4}=await prepareSegmentFiles(_0xfcedab,{'segmentByFolderAndName':_0x13d80c,'activationsBySegmentId':_0x411979,'folderPathToId':_0x39efd9,'idToEmailMap':_0x1eb3bf,'connectionIdToNameMap':_0x137609},_0x59ea95,_0x2ca4a4,_0x4ead63),_0x1727ab=_0x51b910?[]:findSegmentsToDelete(_0x4388e8,_0xfcedab['map'](({yamlConfig:_0x208b70,folderPath:_0x46b1d9})=>({'yamlConfig':_0x208b70,'folderPath':resolveTDFolderPath(_0x46b1d9,_0x2ca4a4,_0x4ead63)})),_0x1d3e85,_0x4ead63,_0x2ca4a4),{journeyFiles:_0x1e83b1,foldersToCreate:_0x3f9062}=await withProgressSpinner(_0x5c8567(0xc3),async _0x36e8a2=>prepareJourneyFiles(_0x3be35b,{'fetchJourney':async _0x224860=>_0x2c886d[_0x5c8567(0x7c)]['getJourney'](_0x224860[_0x5c8567(0x91)]),'journeyBundlesByFolderAndName':_0x4fc950,'folderPathToId':_0x39efd9,'idToEmailMap':_0x1eb3bf,'connectionIdToNameMap':_0x137609,'existingSegments':_0x4388e8,'parentId':_0x29e129,'deps':_0x2c886d,'progress':{'update':_0x237944=>{const _0x2b3c81=_0x5c8567;_0x36e8a2[_0x2b3c81(0x88)](_0x237944),_0xd8a378[_0x2b3c81(0xce)]&&console[_0x2b3c81(0xe1)]('\x20\x20'+_0x237944);}},'journeyById':_0x20a080,'activationStepsById':_0x46031b},_0x2ca4a4,_0x4ead63),{'verbose':_0xd8a378[_0x5c8567(0xce)]})[_0x5c8567(0xbd)](_0x3311c=>_0x3311c[_0x5c8567(0xb5)]);for(const _0x2dfc98 of _0x3f9062){_0x2ccea4['add'](_0x2dfc98);}const _0x1ed413=_0x51b910?[]:findJourneysToDelete(_0x2c7b41,_0x3be35b[_0x5c8567(0xb4)](({yamlConfig:_0x2f451a,folderPath:_0x2868b1})=>({'yamlConfig':_0x2f451a,'folderPath':resolveTDFolderPath(_0x2868b1,_0x2ca4a4,_0x4ead63)})),_0x1d3e85,_0x4ead63,_0x2ca4a4),_0x58ae3d=calculatePushStats(_0x4c3580,_0x1e83b1,_0x2ccea4,_0x1727ab,_0x1ed413,!!_0xd8a378[_0x5c8567(0x90)],!!_0xd8a378[_0x5c8567(0x89)]),_0x4c5d6f=_0x58ae3d['segments'][_0x5c8567(0xa7)],_0xc33e17=_0x58ae3d[_0x5c8567(0xea)][_0x5c8567(0xb3)],_0x332161=_0x58ae3d[_0x5c8567(0xea)]['unchanged'],_0x24d237=_0x58ae3d['segments'][_0x5c8567(0x93)],_0x1998a6=_0x58ae3d[_0x5c8567(0x9b)][_0x5c8567(0xf3)],_0x48ad9e=_0x58ae3d[_0x5c8567(0x94)]['new'],_0x2dac7a=_0x58ae3d[_0x5c8567(0x94)][_0x5c8567(0xb3)],_0x347121=_0x58ae3d[_0x5c8567(0x94)][_0x5c8567(0xdb)],_0x5a1c68=_0x58ae3d[_0x5c8567(0x94)][_0x5c8567(0x93)],_0x4a6a28=_0x58ae3d[_0x5c8567(0x114)][_0x5c8567(0xfe)],_0x14438d=_0x58ae3d[_0x5c8567(0x114)][_0x5c8567(0xf3)],_0x5d38df=_0x58ae3d[_0x5c8567(0x114)][_0x5c8567(0x8b)],_0x2bcb5e=_0x58ae3d[_0x5c8567(0x114)][_0x5c8567(0x93)];console[_0x5c8567(0xe1)](_0x5c8567(0x7a)+_0x5393e1+'\x27:');_0x1998a6[_0x5c8567(0xf6)]>0x0&&console[_0x5c8567(0xe1)]('\x20\x20'+a42_0x1078c6[_0x5c8567(0x86)](_0x5c8567(0xc2)+_0x1998a6[_0x5c8567(0xf6)]+_0x5c8567(0xff)));if(!_0xd8a378[_0x5c8567(0x89)]){console[_0x5c8567(0xe1)](_0x5c8567(0x103)),console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xc1)]('+\x20'+_0x4c5d6f[_0x5c8567(0xf6)]+_0x5c8567(0x79))),console['error'](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0x9e)]('~\x20'+_0xc33e17['length']+_0x5c8567(0xb8)));if(_0x24d237['length']>0x0)console['error'](_0x5c8567(0xb2)+a42_0x1078c6['red']('-\x20'+_0x24d237[_0x5c8567(0xf6)]+'\x20to\x20delete'));else _0x1727ab[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x90)]&&console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xe3)](_0x1727ab['length']+_0x5c8567(0x74)));console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6['dim']('=\x20'+_0x332161[_0x5c8567(0xf6)]+_0x5c8567(0xec)));}if(_0x1e83b1[_0x5c8567(0xf6)]>0x0||_0x1ed413[_0x5c8567(0xf6)]>0x0){console[_0x5c8567(0xe1)](_0x5c8567(0x110)),console[_0x5c8567(0xe1)]('\x20\x20\x20\x20'+a42_0x1078c6['green']('+\x20'+_0x48ad9e['length']+_0x5c8567(0x79))),console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0x9e)]('~\x20'+_0x2dac7a[_0x5c8567(0xf6)]+_0x5c8567(0xb8)));if(_0x5a1c68[_0x5c8567(0xf6)]>0x0)console['error'](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xb0)]('-\x20'+_0x5a1c68['length']+'\x20to\x20delete'));else _0x1ed413[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x90)]&&console['error'](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xe3)](_0x1ed413[_0x5c8567(0xf6)]+_0x5c8567(0x74)));console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xe3)]('=\x20'+_0x347121[_0x5c8567(0xf6)]+_0x5c8567(0xec)));}_0x4a6a28['length']>0x0&&!_0xd8a378[_0x5c8567(0x89)]&&(console[_0x5c8567(0xe1)](''),console[_0x5c8567(0xe1)](_0x5c8567(0xd3)),_0x14438d[_0x5c8567(0xf6)]>0x0&&console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6['green']('+\x20'+_0x14438d[_0x5c8567(0xf6)]+_0x5c8567(0x82))),_0x5d38df[_0x5c8567(0xf6)]>0x0&&console['error'](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0x9e)]('~\x20'+_0x5d38df[_0x5c8567(0xf6)]+_0x5c8567(0x92))),_0x2bcb5e[_0x5c8567(0xf6)]>0x0&&console['error'](_0x5c8567(0xb2)+a42_0x1078c6['red']('-\x20'+_0x2bcb5e['length']+_0x5c8567(0xf8))));console[_0x5c8567(0xe1)](_0x5c8567(0x106)+a42_0x1078c6[_0x5c8567(0x8d)](_0x32e4a4)+'\x0a');if(_0x1998a6['length']>0x0){console[_0x5c8567(0xe1)]('Folders\x20to\x20create:');for(const _0x4bd7cf of _0x1998a6){console[_0x5c8567(0xe1)]('\x20\x20'+a42_0x1078c6[_0x5c8567(0x86)]('+')+'\x20'+_0x4bd7cf);}console[_0x5c8567(0xe1)]('');}if(_0x4c5d6f[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)])for(const _0x1548aa of _0x4c5d6f){const _0x3741c4=_0x1548aa[_0x5c8567(0xda)]?_0x1548aa[_0x5c8567(0xda)]+'/'+_0x1548aa['yamlConfig']['name']:_0x1548aa['yamlConfig'][_0x5c8567(0xcb)],_0x1921a5=_0x1548aa['yamlConfig'][_0x5c8567(0x114)]?.['length']||0x0,_0x1b6f24=_0x1921a5>0x0?a42_0x1078c6['dim']('\x20['+_0x1921a5+_0x5c8567(0x9f)):'';console[_0x5c8567(0xe1)]('\x0a'+a42_0x1078c6[_0x5c8567(0xc1)](_0x5c8567(0xcd))+'\x20'+_0x3741c4+_0x1b6f24),console['error']('─'[_0x5c8567(0xbe)](0x3c)),_0x1548aa[_0x5c8567(0x7d)]&&console[_0x5c8567(0xe1)](_0x1548aa['diff']),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c));}if(_0x24d237[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)])for(const _0x197418 of _0x24d237){const _0x5e9d31=_0x197418['segmentFolderId']?_0x1d3e85[_0x5c8567(0x109)](_0x197418[_0x5c8567(0xfb)][_0x5c8567(0xf1)]())||'':'',_0x59fb08=_0x5e9d31?_0x5e9d31+'/'+_0x197418[_0x5c8567(0xcb)]:_0x197418[_0x5c8567(0xcb)],_0xe2ad5b=_0x411979[_0x5c8567(0x109)](_0x197418['id'])||[],_0x3146d4=_0xe2ad5b[_0x5c8567(0xf6)]>0x0?a42_0x1078c6['dim']('\x20['+_0xe2ad5b[_0x5c8567(0xf6)]+_0x5c8567(0x9f)):'';console['error']('\x0a'+a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0x99))+'\x20'+_0x59fb08+_0x3146d4),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c));const _0x21aba7=segmentWithActivationsToYaml(_0x197418,_0xe2ad5b,undefined,_0x1eb3bf,_0x137609),_0x9c97e1=segmentToYamlString(_0x21aba7),_0x5eafcc=generateDiff(_0x9c97e1,'');console[_0x5c8567(0xe1)](formatDiffWithColors(_0x5eafcc)),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c));}const _0x40c614=_0x4c3580['filter'](_0x413e6b=>!_0x413e6b[_0x5c8567(0xfa)]&&_0x413e6b['diff']);if(_0x40c614[_0x5c8567(0xf6)]>0x0&&!_0xd8a378['journeysOnly'])for(const _0x5b8462 of _0x40c614){const _0x4cf4ce=_0x5b8462[_0x5c8567(0xda)]?_0x5b8462[_0x5c8567(0xda)]+'/'+_0x5b8462[_0x5c8567(0xdd)]['name']:_0x5b8462[_0x5c8567(0xdd)][_0x5c8567(0xcb)];console['error']('\x0a'+a42_0x1078c6['yellow']('Changes\x20to:')+'\x20'+_0x4cf4ce),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c)),console[_0x5c8567(0xe1)](_0x5b8462[_0x5c8567(0x7d)]),console['error']('─'[_0x5c8567(0xbe)](0x3c));}if(_0x48ad9e['length']>0x0)for(const _0x56d7fd of _0x48ad9e){const _0x5d0dd7=_0x56d7fd['folderPath']?_0x56d7fd[_0x5c8567(0xda)]+'/'+_0x56d7fd[_0x5c8567(0xdd)][_0x5c8567(0xcb)]:_0x56d7fd[_0x5c8567(0xdd)][_0x5c8567(0xcb)];console['error']('\x0a'+a42_0x1078c6[_0x5c8567(0xc1)]('New\x20journey:')+'\x20'+_0x5d0dd7),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c)),_0x56d7fd[_0x5c8567(0x7d)]&&console[_0x5c8567(0xe1)](_0x56d7fd[_0x5c8567(0x7d)]),console[_0x5c8567(0xe1)]('─'['repeat'](0x3c));}const _0x177b71=_0x1e83b1[_0x5c8567(0xab)](_0x16b340=>!_0x16b340[_0x5c8567(0xfa)]&&_0x16b340[_0x5c8567(0x7d)]);if(_0x177b71[_0x5c8567(0xf6)]>0x0)for(const _0x586cc9 of _0x177b71){const _0x56cb4b=_0x586cc9[_0x5c8567(0xda)]?_0x586cc9['folderPath']+'/'+_0x586cc9[_0x5c8567(0xdd)]['name']:_0x586cc9[_0x5c8567(0xdd)]['name'];console[_0x5c8567(0xe1)]('\x0a'+a42_0x1078c6[_0x5c8567(0x9e)]('Changes\x20to\x20journey:')+'\x20'+_0x56cb4b),console['error']('─'['repeat'](0x3c)),console[_0x5c8567(0xe1)](_0x586cc9[_0x5c8567(0x7d)]),console[_0x5c8567(0xe1)]('─'['repeat'](0x3c));}if(_0x5a1c68[_0x5c8567(0xf6)]>0x0)for(const _0x982030 of _0x5a1c68){const _0x1623ee=_0x982030['folderId']?_0x1d3e85['get'](_0x982030[_0x5c8567(0x105)])||'':'',_0x4cd5eb=_0x1623ee?_0x1623ee+'/'+_0x982030['journeyBundleName']:_0x982030[_0x5c8567(0xae)];console[_0x5c8567(0xe1)]('\x0a'+a42_0x1078c6['red']('Delete\x20journey:')+'\x20'+_0x4cd5eb),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c)),console[_0x5c8567(0xe1)](a42_0x1078c6['red'](_0x5c8567(0xca))),console[_0x5c8567(0xe1)]('─'['repeat'](0x3c));}if(_0xd8a378[_0x5c8567(0xe6)])return console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0xd8))),0x0;const _0x129be6=_0xd8a378['journeysOnly']?![]:_0x4c5d6f[_0x5c8567(0xf6)]>0x0||_0xc33e17[_0x5c8567(0xf6)]>0x0||_0x24d237[_0x5c8567(0xf6)]>0x0,_0x4adc41=_0x48ad9e['length']>0x0||_0x2dac7a[_0x5c8567(0xf6)]>0x0||_0x5a1c68[_0x5c8567(0xf6)]>0x0,_0x78605=_0xd8a378[_0x5c8567(0x89)]?![]:_0x4a6a28[_0x5c8567(0xf6)]>0x0,_0x17b482=_0x1998a6[_0x5c8567(0xf6)]>0x0;if(!_0x129be6&&!_0x4adc41&&!_0x78605&&!_0x17b482){const _0x12cb98=_0xd8a378['journeysOnly']?_0x5c8567(0xcc):_0x5c8567(0xaf);console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xc1)](_0x12cb98));if(_0x51b910&&_0x332161[_0x5c8567(0xf6)]===0x1){const _0x2e979f=_0x332161[0x0];if(_0x2e979f[_0x5c8567(0x7f)]?.['id']){const _0x1402fd=getConsoleNextUrl(_0xd8a378['site'],'/app/ps/'+_0x29e129+_0x5c8567(0x101)+_0x2e979f[_0x5c8567(0x7f)]['id']+_0x5c8567(0xa8));console[_0x5c8567(0xe1)](_0x5c8567(0xaa)+a42_0x1078c6['cyan'](_0x1402fd));}}if(_0x51b910&&_0x347121['length']===0x1){const _0x4da5db=_0x347121[0x0];if(_0x4da5db[_0x5c8567(0x75)]?.['id']){const _0x436309=getConsoleNextUrl(_0xd8a378[_0x5c8567(0xcf)],_0x5c8567(0x100)+_0x29e129+_0x5c8567(0x101)+_0x4da5db[_0x5c8567(0x75)]['id']+'/j/da/je');console['error']('\x20\x20'+a42_0x1078c6[_0x5c8567(0x8d)](_0x436309));}}return 0x0;}const _0x564b26=_0xd8a378[_0x5c8567(0x89)]?_0x48ad9e[_0x5c8567(0xf6)]+_0x2dac7a['length']+_0x5a1c68['length']+_0x1998a6[_0x5c8567(0xf6)]:_0x4c5d6f[_0x5c8567(0xf6)]+_0xc33e17['length']+_0x24d237[_0x5c8567(0xf6)]+_0x48ad9e[_0x5c8567(0xf6)]+_0x2dac7a[_0x5c8567(0xf6)]+_0x5a1c68['length']+_0x1998a6[_0x5c8567(0xf6)]+_0x4a6a28[_0x5c8567(0xf6)];if(!_0xd8a378[_0x5c8567(0x10e)]&&_0x564b26>0x0){if(!isInteractive())return console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xb0)]('\x0aError:'),_0x5c8567(0x10d)),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xe3)](_0x5c8567(0x10f))),0x1;const _0xcf5854=await confirmKey(_0x5c8567(0xd0)+_0x564b26+_0x5c8567(0xd4));if(!_0xcf5854)return console[_0x5c8567(0xe1)](a42_0x1078c6['yellow']('Aborted.')),0x1;}const _0x1f10b6={'withProgress':async(_0xedf095,_0x3244ac)=>{const _0x4a4456=_0x5c8567,_0x14bc06=await withSpinner(_0xedf095,_0x3244ac,{'verbose':_0xd8a378[_0x4a4456(0xce)]});return{'data':_0x14bc06[_0x4a4456(0xb5)]};},'logInfo':_0x53b701=>console['error'](a42_0x1078c6[_0x5c8567(0x86)]('✔\x20'+_0x53b701)),'logSuccess':_0x17f60c=>console[_0x5c8567(0xe1)](a42_0x1078c6['green']('✔\x20'+_0x17f60c)),'logWarning':_0x4e402d=>console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x9e)]('⚠\x20'+_0x4e402d)),'logDeleted':_0x410a5d=>console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xb0)]('✔\x20'+_0x410a5d))},_0x1fc7d5={'segment':_0x2c886d[_0x5c8567(0xe9)],'journey':_0x2c886d['journey'],'user':_0x2c886d[_0x5c8567(0x113)],'connection':_0x2c886d[_0x5c8567(0xa9)]};_0x1998a6[_0x5c8567(0xf6)]>0x0&&(_0x39efd9=await executePushFolders(_0x1fc7d5,_0x1998a6,_0x39efd9,{'parentId':_0x29e129},_0x1f10b6));const _0x23a5df={'rootFolderId':_0x2b4e18,'folderPathToId':_0x39efd9,'folderIdToPath':_0x1d3e85,'segmentNameToId':_0x4058fc,'activationsBySegmentId':_0x411979,'emailToIdMap':_0x35ddff,'idToEmailMap':_0x1eb3bf,'connectionNameToIdMap':_0x32dcf3[_0x5c8567(0xde)],'connectionIdToNameMap':_0x32dcf3[_0x5c8567(0x8a)],'connectionNameToTypeMap':_0x7dd3ba},_0x3a574a=await executePushSegments(_0x1fc7d5,_0xd8a378[_0x5c8567(0x89)]?[]:_0x4c3580,_0x23a5df,{'parentId':_0x29e129},_0x1f10b6),_0x5ded5d=_0x3a574a[_0x5c8567(0x83)],_0x3745cf=_0x3a574a[_0x5c8567(0xe2)],_0x42e31f=_0x3a574a[_0x5c8567(0x114)][_0x5c8567(0x83)],_0x14bed2=_0x3a574a[_0x5c8567(0x114)][_0x5c8567(0xe2)],_0x4ccf65=_0x3a574a['activations'][_0x5c8567(0x102)];let _0x58188a;if(_0x51b910&&_0x4c3580[_0x5c8567(0xf6)]===0x1){const _0x31ea91=_0x4c3580[0x0];_0x58188a=_0x31ea91[_0x5c8567(0x7f)]?.['id']??_0x3a574a[_0x5c8567(0x85)][_0x5c8567(0x109)](_0x31ea91['yamlConfig'][_0x5c8567(0xcb)]);}const _0xe0b9b4=await executePushSegmentDeletions(_0x1fc7d5,_0xd8a378['journeysOnly']?[]:_0x24d237,_0x1f10b6);let _0x499f2c=0x0,_0x4573d2=0x0,_0x4a3ee2=0x0;const _0x239266=new Map(_0x4058fc);for(const [_0x49fe0a,_0x8708d3]of _0x3a574a['createdSegmentIds']){_0x239266['set'](_0x49fe0a,_0x8708d3);}if(_0x1e83b1[_0x5c8567(0xf6)]>0x0){const _0x5482be={..._0x23a5df,'segmentNameToId':_0x239266,'existingSegments':_0x4388e8,'activationContext':_0x59ea95},_0x41a8b6=await executePushJourneys(_0x1fc7d5,_0x1e83b1,_0x5482be,{'parentId':_0x29e129,'rootFolderId':_0x2b4e18,'verbose':_0xd8a378['verbose']},_0x1f10b6);_0x499f2c=_0x41a8b6[_0x5c8567(0x83)],_0x4573d2=_0x41a8b6[_0x5c8567(0xe2)];if(_0x51b910&&_0x41a8b6[_0x5c8567(0xd1)][_0x5c8567(0xf6)]===0x1){const _0x1c8d51=_0x41a8b6['results'][0x0];if(_0x1c8d51['journeyId']){const _0x141cfe=getConsoleNextUrl(_0xd8a378[_0x5c8567(0xcf)],_0x5c8567(0x100)+_0x29e129+'/e/'+_0x1c8d51[_0x5c8567(0x91)]+_0x5c8567(0x7b));console[_0x5c8567(0xe1)]('\x20\x20'+a42_0x1078c6[_0x5c8567(0x8d)](_0x141cfe));}}}for(const _0x521216 of _0x5a1c68){console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0xc0)+_0x521216['journeyBundleName'])),_0x4a3ee2++;}const _0x18970d=[];if(_0x5ded5d>0x0)_0x18970d[_0x5c8567(0x8c)](_0x5ded5d+_0x5c8567(0x107));if(_0x3745cf>0x0)_0x18970d['push'](_0x3745cf+_0x5c8567(0xc5));if(_0xe0b9b4>0x0)_0x18970d['push'](_0xe0b9b4+'\x20deleted');const _0x25a570=[];if(_0x499f2c>0x0)_0x25a570[_0x5c8567(0x8c)](_0x499f2c+_0x5c8567(0x107));if(_0x4573d2>0x0)_0x25a570[_0x5c8567(0x8c)](_0x4573d2+_0x5c8567(0xc5));if(_0x4a3ee2>0x0)_0x25a570[_0x5c8567(0x8c)](_0x4a3ee2+_0x5c8567(0x97));const _0x43085d=[];if(_0x42e31f>0x0)_0x43085d[_0x5c8567(0x8c)](_0x42e31f+_0x5c8567(0x107));if(_0x14bed2>0x0)_0x43085d[_0x5c8567(0x8c)](_0x14bed2+_0x5c8567(0xc5));if(_0x4ccf65>0x0)_0x43085d[_0x5c8567(0x8c)](_0x4ccf65+_0x5c8567(0x97));console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xc1)](_0x5c8567(0xe5)));_0x18970d[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)]&&console[_0x5c8567(0xe1)](_0x5c8567(0xf5)+_0x18970d[_0x5c8567(0x80)](',\x20'));_0x25a570[_0x5c8567(0xf6)]>0x0&&console[_0x5c8567(0xe1)](_0x5c8567(0x76)+_0x25a570['join'](',\x20'));_0x43085d[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)]&&console[_0x5c8567(0xe1)]('\x20\x20Activations:\x20'+_0x43085d['join'](',\x20'));if(_0x58188a){const _0x51ab9a=getConsoleNextUrl(_0xd8a378[_0x5c8567(0xcf)],_0x5c8567(0x100)+_0x29e129+_0x5c8567(0x101)+_0x58188a+'/sb/da/esr');console[_0x5c8567(0xe1)](_0x5c8567(0xaa)+a42_0x1078c6['cyan'](_0x51ab9a));}return 0x0;}}
@@ -1 +1 @@
1
- const a43_0x419d31=a43_0x2c52;function a43_0x2c6c(){const _0x2aaaa3=['name','execute','description','Resolving\x20folder\x20\x27','parentId','Segment\x20ID:\x20','Updating\x20segment\x20\x27','segmentId','verbose','type','152TpPwMW','Resolving\x20path\x20\x27','683724dZOJNz','65OVaewQ','segment:update','11210760HRFZKv','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Segment\x20ID\x20missing\x20from\x20resolved\x20path','1478tpXBIc','resolveFolderId','4aqPxFP','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','577377HBZUkp','folder','data','error','Error:\x20Cannot\x20update\x20','162234pCxHFB','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x27...','Resolved\x20type:\x20','Examples:','segment','yellow','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','✔\x20Updated\x20segment\x20\x27','\x20\x20\x20Path:\x20','601573tQfasW','kind','1095425JARtvw','Update\x20existing\x20child\x20segment','updateSegmentById','includes','segmentName'];a43_0x2c6c=function(){return _0x2aaaa3;};return a43_0x2c6c();}(function(_0x17a22e,_0x2bf170){const _0x2a3b64=a43_0x2c52,_0x2907cd=_0x17a22e();while(!![]){try{const _0x391922=parseInt(_0x2a3b64(0x152))/0x1*(parseInt(_0x2a3b64(0x157))/0x2)+-parseInt(_0x2a3b64(0x15b))/0x3+parseInt(_0x2a3b64(0x159))/0x4*(-parseInt(_0x2a3b64(0x16c))/0x5)+-parseInt(_0x2a3b64(0x151))/0x6+-parseInt(_0x2a3b64(0x16a))/0x7+parseInt(_0x2a3b64(0x14f))/0x8*(-parseInt(_0x2a3b64(0x160))/0x9)+parseInt(_0x2a3b64(0x154))/0xa;if(_0x391922===_0x2bf170)break;else _0x2907cd['push'](_0x2907cd['shift']());}catch(_0x1d3966){_0x2907cd['push'](_0x2907cd['shift']());}}}(a43_0x2c6c,0x3488c));function a43_0x2c52(_0x1249d3,_0x51f7aa){_0x1249d3=_0x1249d3-0x143;const _0x2c6cc4=a43_0x2c6c();let _0x2c5238=_0x2c6cc4[_0x1249d3];return _0x2c5238;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a43_0x465690 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x419d31(0x145)]=a43_0x419d31(0x153);[a43_0x419d31(0x147)]=a43_0x419d31(0x16d);async[a43_0x419d31(0x146)](_0x17b90b){const _0xb71875=a43_0x419d31;console[_0xb71875(0x15e)](a43_0x465690[_0xb71875(0x166)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0xb71875(0x15e)](a43_0x465690[_0xb71875(0x166)](_0xb71875(0x161)));const {options:_0x1121b3,args:_0x236642,tdx:_0x4614ff}=_0x17b90b,_0x5aa912=_0x1121b3;if(_0x236642['length']===0x0)return console[_0xb71875(0x15e)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0xb71875(0x155)),console[_0xb71875(0x15e)](_0xb71875(0x164)),console['error'](_0xb71875(0x15a)),console[_0xb71875(0x15e)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x40a2de=_0x236642[0x0],_0x20b1ae=_0x1121b3['segmentPath'];let _0x252c93=_0x40a2de;_0x20b1ae&&!_0x40a2de[_0xb71875(0x143)]('/')&&(_0x252c93=_0x20b1ae+'/'+_0x40a2de,_0x5aa912[_0xb71875(0x14d)]&&console[_0xb71875(0x15e)]('Resolved\x20relative\x20path\x20to:\x20'+_0x252c93));const _0x722a13=await withSpinner(_0xb71875(0x150)+_0x252c93+_0xb71875(0x162),()=>_0x4614ff[_0xb71875(0x165)]['resolvePathToResource'](_0x252c93),{'verbose':_0x5aa912[_0xb71875(0x14d)]}),_0x534ee7=_0x722a13[_0xb71875(0x15d)];_0x5aa912['verbose']&&console[_0xb71875(0x15e)](_0xb71875(0x163)+_0x534ee7[_0xb71875(0x14e)]);if(_0x534ee7[_0xb71875(0x14e)]!==_0xb71875(0x165))return console[_0xb71875(0x15e)](_0xb71875(0x15f)+_0x534ee7['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0xb71875(0x167)),0x1;if(!_0x534ee7[_0xb71875(0x14c)])throw new SDKError(ErrorCode['INTERNAL'],_0xb71875(0x156));const _0x5d0741=_0x534ee7[_0xb71875(0x149)],_0x424249=_0x534ee7[_0xb71875(0x14c)];_0x5aa912[_0xb71875(0x14d)]&&(console[_0xb71875(0x15e)]('Parent\x20ID:\x20'+_0x5d0741),console[_0xb71875(0x15e)](_0xb71875(0x14a)+_0x424249));let _0x439b8d;if(_0x5aa912['folder']){const _0x15f833=_0x5aa912[_0xb71875(0x15c)],_0x30a07b=await withSpinner(_0xb71875(0x148)+_0x15f833+_0xb71875(0x162),()=>_0x4614ff[_0xb71875(0x165)][_0xb71875(0x158)](_0x5d0741,_0x15f833),{'verbose':_0x5aa912[_0xb71875(0x14d)]});_0x439b8d=parseInt(_0x30a07b['data'],0xa),_0x5aa912[_0xb71875(0x14d)]&&console[_0xb71875(0x15e)]('Resolved\x20folder\x20ID:\x20'+_0x439b8d);}const _0x5825eb=await loadJSONFromOptions(_0x5aa912['rule'],_0x5aa912['ruleFile']),_0x211a32={'name':_0x5aa912[_0xb71875(0x145)],'description':_0x5aa912[_0xb71875(0x147)],'rule':_0x5825eb,'kind':_0x5aa912['kind']!==undefined?parseInt(_0x5aa912[_0xb71875(0x16b)],0xa):undefined,'segmentFolderId':_0x439b8d},_0x2af681=await withSpinner(_0xb71875(0x14b)+_0x534ee7[_0xb71875(0x144)]+_0xb71875(0x162),()=>_0x4614ff[_0xb71875(0x165)][_0xb71875(0x16e)](_0x5d0741,_0x424249,_0x211a32),{'verbose':_0x5aa912[_0xb71875(0x14d)]}),_0x37200d=_0x2af681[_0xb71875(0x15d)];return console[_0xb71875(0x15e)](_0xb71875(0x168)+_0x37200d[_0xb71875(0x145)]+'\x27'),_0x252c93!==_0x40a2de&&console['error'](_0xb71875(0x169)+_0x252c93),await handleSDKOutput([_0x37200d],_0x5aa912),0x0;}}
1
+ function a43_0x3d48(_0x70da27,_0x43b0c7){_0x70da27=_0x70da27-0xc7;const _0x2af4bd=a43_0x2af4();let _0x3d4875=_0x2af4bd[_0x70da27];return _0x3d4875;}const a43_0x54258b=a43_0x3d48;(function(_0xcc6348,_0x1fa787){const _0x1d8791=a43_0x3d48,_0x8b4ebb=_0xcc6348();while(!![]){try{const _0x51b899=-parseInt(_0x1d8791(0xf4))/0x1*(-parseInt(_0x1d8791(0xe4))/0x2)+parseInt(_0x1d8791(0xde))/0x3*(parseInt(_0x1d8791(0xd3))/0x4)+parseInt(_0x1d8791(0xc8))/0x5*(-parseInt(_0x1d8791(0xcf))/0x6)+parseInt(_0x1d8791(0xdd))/0x7+-parseInt(_0x1d8791(0xd4))/0x8*(-parseInt(_0x1d8791(0xf9))/0x9)+-parseInt(_0x1d8791(0xf5))/0xa*(parseInt(_0x1d8791(0xdc))/0xb)+-parseInt(_0x1d8791(0xed))/0xc*(-parseInt(_0x1d8791(0xe3))/0xd);if(_0x51b899===_0x1fa787)break;else _0x8b4ebb['push'](_0x8b4ebb['shift']());}catch(_0x229174){_0x8b4ebb['push'](_0x8b4ebb['shift']());}}}(a43_0x2af4,0x51198));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a43_0x2af4(){const _0x3575cc=['12ZHlKAp','1026790OlSmkc','resolveFolderId','includes','Update\x20existing\x20child\x20segment','5121HgHmum','Parent\x20ID:\x20','1890860RNQoAC','execute','segment','Segment\x20ID:\x20','data','Examples:','kind','6tjCcjI','yellow','segmentId','length','3868htRUyp','1272mZOAxI','error','\x27...','type','Resolved\x20folder\x20ID:\x20','resolvePathToResource','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','44DjkqjW','2387665UIqMJT','324xAulam','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20\x20Path:\x20','updateSegmentById','rule','533YEupVm','33866NPVkVl','✔\x20Updated\x20segment\x20\x27','verbose','parentId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','description','Resolving\x20path\x20\x27','Updating\x20segment\x20\x27','111768wRwllC','Error:\x20Cannot\x20update\x20','Resolved\x20relative\x20path\x20to:\x20','Resolved\x20type:\x20','name','folder','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'];a43_0x2af4=function(){return _0x3575cc;};return a43_0x2af4();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a43_0x458ef3 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x54258b(0xf1)]='segment:update';[a43_0x54258b(0xea)]=a43_0x54258b(0xf8);async[a43_0x54258b(0xc9)](_0x20709b){const _0x50116e=a43_0x54258b;console[_0x50116e(0xd5)](a43_0x458ef3[_0x50116e(0xd0)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x50116e(0xd5)](a43_0x458ef3['yellow'](_0x50116e(0xf3)));const {options:_0xffd631,args:_0x10f00d,tdx:_0x197529}=_0x20709b,_0x4fa92e=_0xffd631;if(_0x10f00d[_0x50116e(0xd2)]===0x0)return console[_0x50116e(0xd5)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x50116e(0xd5)](_0x50116e(0xdf)),console[_0x50116e(0xd5)](_0x50116e(0xcd)),console['error'](_0x50116e(0xdb)),console[_0x50116e(0xd5)](_0x50116e(0xe9)),0x1;const _0x3c81c4=_0x10f00d[0x0],_0x24d45b=_0xffd631['segmentPath'];let _0x21eb9a=_0x3c81c4;_0x24d45b&&!_0x3c81c4[_0x50116e(0xf7)]('/')&&(_0x21eb9a=_0x24d45b+'/'+_0x3c81c4,_0x4fa92e[_0x50116e(0xe6)]&&console[_0x50116e(0xd5)](_0x50116e(0xef)+_0x21eb9a));const _0x5d1c72=await withSpinner(_0x50116e(0xeb)+_0x21eb9a+'\x27...',()=>_0x197529[_0x50116e(0xca)][_0x50116e(0xd9)](_0x21eb9a),{'verbose':_0x4fa92e[_0x50116e(0xe6)]}),_0x4155f5=_0x5d1c72[_0x50116e(0xcc)];_0x4fa92e[_0x50116e(0xe6)]&&console['error'](_0x50116e(0xf0)+_0x4155f5[_0x50116e(0xd7)]);if(_0x4155f5[_0x50116e(0xd7)]!==_0x50116e(0xca))return console['error'](_0x50116e(0xee)+_0x4155f5[_0x50116e(0xd7)]+_0x50116e(0xda)),console['error']('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x4155f5[_0x50116e(0xd1)])throw new SDKError(ErrorCode['INTERNAL'],_0x50116e(0xe8));const _0xfd48f1=_0x4155f5[_0x50116e(0xe7)],_0x348907=_0x4155f5[_0x50116e(0xd1)];_0x4fa92e[_0x50116e(0xe6)]&&(console[_0x50116e(0xd5)](_0x50116e(0xc7)+_0xfd48f1),console[_0x50116e(0xd5)](_0x50116e(0xcb)+_0x348907));let _0x7b4a82;if(_0x4fa92e[_0x50116e(0xf2)]){const _0x1ac993=_0x4fa92e[_0x50116e(0xf2)],_0x431f3c=await withSpinner('Resolving\x20folder\x20\x27'+_0x1ac993+'\x27...',()=>_0x197529[_0x50116e(0xca)][_0x50116e(0xf6)](_0xfd48f1,_0x1ac993),{'verbose':_0x4fa92e[_0x50116e(0xe6)]});_0x7b4a82=parseInt(_0x431f3c[_0x50116e(0xcc)],0xa),_0x4fa92e['verbose']&&console[_0x50116e(0xd5)](_0x50116e(0xd8)+_0x7b4a82);}const _0x15cf06=await loadJSONFromOptions(_0x4fa92e[_0x50116e(0xe2)],_0x4fa92e['ruleFile']),_0x296104={'name':_0x4fa92e[_0x50116e(0xf1)],'description':_0x4fa92e[_0x50116e(0xea)],'rule':_0x15cf06,'kind':_0x4fa92e[_0x50116e(0xce)]!==undefined?parseInt(_0x4fa92e[_0x50116e(0xce)],0xa):undefined,'segmentFolderId':_0x7b4a82},_0xcbe035=await withSpinner(_0x50116e(0xec)+_0x4155f5['segmentName']+_0x50116e(0xd6),()=>_0x197529[_0x50116e(0xca)][_0x50116e(0xe1)](_0xfd48f1,_0x348907,_0x296104),{'verbose':_0x4fa92e[_0x50116e(0xe6)]}),_0x2fc4ba=_0xcbe035[_0x50116e(0xcc)];return console['error'](_0x50116e(0xe5)+_0x2fc4ba[_0x50116e(0xf1)]+'\x27'),_0x21eb9a!==_0x3c81c4&&console['error'](_0x50116e(0xe0)+_0x21eb9a),await handleSDKOutput([_0x2fc4ba],_0x4fa92e),0x0;}}
@@ -1 +1 @@
1
- const a44_0x2b370d=a44_0x1691;(function(_0x30ac27,_0x386079){const _0x414e13=a44_0x1691,_0x2f02fc=_0x30ac27();while(!![]){try{const _0x50b64d=parseInt(_0x414e13(0x194))/0x1*(-parseInt(_0x414e13(0x179))/0x2)+parseInt(_0x414e13(0x164))/0x3+parseInt(_0x414e13(0x18e))/0x4*(parseInt(_0x414e13(0x18d))/0x5)+parseInt(_0x414e13(0x18f))/0x6*(parseInt(_0x414e13(0x176))/0x7)+parseInt(_0x414e13(0x18b))/0x8+parseInt(_0x414e13(0x198))/0x9*(-parseInt(_0x414e13(0x178))/0xa)+parseInt(_0x414e13(0x17c))/0xb*(-parseInt(_0x414e13(0x163))/0xc);if(_0x50b64d===_0x386079)break;else _0x2f02fc['push'](_0x2f02fc['shift']());}catch(_0x45b72e){_0x2f02fc['push'](_0x2f02fc['shift']());}}}(a44_0x30b0,0x5bc7c));import{existsSync,statSync}from'fs';function a44_0x1691(_0xb6e61a,_0x43c4de){_0xb6e61a=_0xb6e61a-0x160;const _0x30b04f=a44_0x30b0();let _0x169182=_0x30b04f[_0xb6e61a];return _0x169182;}import a44_0x5b9e61 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a44_0x30b0(){const _0x313451=['red','4591912ogJyzH','✔\x20Context\x20set\x20to:\x20','5hDpkze','1832692okrYjQ','2456088XflJsW','segment:use','cyan','Use:\x20tdx\x20segment\x20use\x20','green','7tJVUsv','name','site','description','146061jEAIHd','isAbsolute','fullPath','\x27...','12KMBEXp','1183437LjKokW','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','folderId','Usage:\x20tdx\x20segment\x20use\x20<path>','parentId','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','error','dim','split','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Folder\x20ID:\x20','folderPath','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','segment','type','parentName','7KrrEBR','verbose','90hBSVRY','142370Wenioz','config','Error:\x20Path\x20is\x20required\x0a','8972711OnJvtp','log','data','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','session','parent_segment','execute','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','length','Site:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','join','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','segments'];a44_0x30b0=function(){return _0x313451;};return a44_0x30b0();}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{[a44_0x2b370d(0x195)]=a44_0x2b370d(0x190);[a44_0x2b370d(0x197)]=a44_0x2b370d(0x186);async[a44_0x2b370d(0x182)](_0x1ccde7){const _0x2402dd=a44_0x2b370d,{options:_0x5bee22,args:_0x128ea0,tdx:_0x648d63}=_0x1ccde7;if(_0x128ea0[_0x2402dd(0x184)]===0x0)return console[_0x2402dd(0x16b)](a44_0x5b9e61[_0x2402dd(0x18a)](_0x2402dd(0x17b))),console[_0x2402dd(0x16b)](_0x2402dd(0x168)),console[_0x2402dd(0x16b)]('Examples:'),console[_0x2402dd(0x16b)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x2402dd(0x16b)](_0x2402dd(0x16e)),console['error'](_0x2402dd(0x166)),console[_0x2402dd(0x16b)](_0x2402dd(0x16a)),0x1;const _0x5feda2=_0x128ea0[0x0],_0x28f32a=_0x5bee22[_0x2402dd(0x180)];try{if(_0x5feda2==='/')return saveSessionContext({'segment_path':undefined},_0x28f32a),console['log'](a44_0x5b9e61[_0x2402dd(0x193)](_0x2402dd(0x165))),0x0;if(existsSync(_0x5feda2)&&statSync(_0x5feda2)['isDirectory']()){let _0x115230;try{_0x115230=findTdxConfig(_0x5feda2);}catch{return console[_0x2402dd(0x16b)](a44_0x5b9e61[_0x2402dd(0x18a)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x5feda2)),console['error'](a44_0x5b9e61['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x3390e8=_0x115230[_0x2402dd(0x17a)][_0x2402dd(0x181)];return saveSessionContext({'segment_path':_0x3390e8,'parent_segment':_0x3390e8},_0x28f32a),console[_0x2402dd(0x17d)](a44_0x5b9e61[_0x2402dd(0x193)]('✔\x20Context\x20set\x20to:\x20'+a44_0x5b9e61[_0x2402dd(0x191)](_0x3390e8))),0x0;}const _0x7788d4=_0x5bee22['segmentPath'];let _0x9d8e75=_0x5feda2;const _0x5b9be5=parsePath(_0x5feda2);if(!_0x5b9be5[_0x2402dd(0x160)]){if(!_0x7788d4)return console['error'](a44_0x5b9e61[_0x2402dd(0x18a)](_0x2402dd(0x17f))),console[_0x2402dd(0x16b)](a44_0x5b9e61['cyan'](_0x2402dd(0x16f))),0x1;if(_0x5feda2==='..'){const _0x3835bb=_0x7788d4[_0x2402dd(0x16d)]('/')['slice'](0x0,-0x1)['join']('/');_0x9d8e75=_0x3835bb||'/';}else _0x5feda2==='.'?_0x9d8e75=_0x7788d4:_0x9d8e75=_0x7788d4+'/'+_0x5feda2;_0x5bee22[_0x2402dd(0x177)]&&console[_0x2402dd(0x16b)]('Resolved\x20relative\x20path\x20to:\x20'+_0x9d8e75);}if(_0x9d8e75==='/'||_0x9d8e75==='')return saveSessionContext({'segment_path':undefined},_0x28f32a),console[_0x2402dd(0x17d)](a44_0x5b9e61['green'](_0x2402dd(0x165))),0x0;_0x9d8e75=normalizePath(_0x9d8e75);const _0x65b352=parsePath(_0x9d8e75)[_0x2402dd(0x189)];if(_0x65b352[_0x2402dd(0x184)]===0x0)return saveSessionContext({'segment_path':undefined},_0x28f32a),console['log'](a44_0x5b9e61[_0x2402dd(0x193)](_0x2402dd(0x165))),0x0;_0x5bee22[_0x2402dd(0x177)]&&(console[_0x2402dd(0x16b)](_0x2402dd(0x185)+_0x5bee22[_0x2402dd(0x196)]),console[_0x2402dd(0x16b)]('Target\x20path:\x20'+_0x9d8e75));const _0x238956=await withSpinner('Resolving\x20path\x20\x27'+_0x9d8e75+_0x2402dd(0x162),()=>_0x648d63[_0x2402dd(0x173)]['resolvePathToResource'](_0x9d8e75),{'verbose':_0x5bee22[_0x2402dd(0x177)]}),_0x5c83e4=_0x238956[_0x2402dd(0x17e)];_0x5bee22[_0x2402dd(0x177)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x5c83e4[_0x2402dd(0x174)]),console[_0x2402dd(0x16b)]('Parent\x20ID:\x20'+_0x5c83e4[_0x2402dd(0x169)]),_0x5c83e4[_0x2402dd(0x167)]&&console[_0x2402dd(0x16b)](_0x2402dd(0x170)+_0x5c83e4[_0x2402dd(0x167)]));if(_0x5c83e4['type']==='segment')return console[_0x2402dd(0x16b)](a44_0x5b9e61[_0x2402dd(0x18a)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x2402dd(0x16b)](_0x2402dd(0x188)),console[_0x2402dd(0x16b)](a44_0x5b9e61[_0x2402dd(0x191)](_0x2402dd(0x192)+_0x5c83e4[_0x2402dd(0x175)]+(_0x5c83e4[_0x2402dd(0x171)]?'/'+_0x5c83e4['folderPath'][_0x2402dd(0x187)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5c83e4[_0x2402dd(0x161)],'parent_segment':_0x5c83e4[_0x2402dd(0x175)]},_0x28f32a),console[_0x2402dd(0x17d)](a44_0x5b9e61['green'](_0x2402dd(0x18c)+a44_0x5b9e61['cyan'](_0x5c83e4[_0x2402dd(0x161)]))),_0x5bee22[_0x2402dd(0x177)]&&(console[_0x2402dd(0x16b)](a44_0x5b9e61['dim'](_0x2402dd(0x183))),console['error'](a44_0x5b9e61[_0x2402dd(0x16c)](_0x2402dd(0x172)))),0x0;}catch(_0x520da6){throw _0x520da6;}}}
1
+ const a44_0x1f5084=a44_0x48e4;(function(_0x55f8da,_0x10f1fd){const _0x2859ea=a44_0x48e4,_0x2781c0=_0x55f8da();while(!![]){try{const _0x9a3d9e=parseInt(_0x2859ea(0x1e7))/0x1+parseInt(_0x2859ea(0x220))/0x2*(-parseInt(_0x2859ea(0x1ea))/0x3)+parseInt(_0x2859ea(0x20d))/0x4*(-parseInt(_0x2859ea(0x221))/0x5)+-parseInt(_0x2859ea(0x21f))/0x6*(-parseInt(_0x2859ea(0x1f0))/0x7)+parseInt(_0x2859ea(0x1f2))/0x8*(parseInt(_0x2859ea(0x1fa))/0x9)+-parseInt(_0x2859ea(0x210))/0xa*(-parseInt(_0x2859ea(0x207))/0xb)+-parseInt(_0x2859ea(0x1fd))/0xc;if(_0x9a3d9e===_0x10f1fd)break;else _0x2781c0['push'](_0x2781c0['shift']());}catch(_0x508129){_0x2781c0['push'](_0x2781c0['shift']());}}}(a44_0x5775,0xf0207));import{existsSync,statSync}from'fs';import a44_0x327064 from'chalk';function a44_0x48e4(_0x13c1ed,_0x3fba9c){_0x13c1ed=_0x13c1ed-0x1e7;const _0x5775e6=a44_0x5775();let _0x48e4ca=_0x5775e6[_0x13c1ed];return _0x48e4ca;}function a44_0x5775(){const _0x202228=['green','slice','fullPath','6762411EplArp','parent_segment','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','15172332VYXAMT','✔\x20Context\x20set\x20to:\x20','Error:\x20Path\x20is\x20required\x0a','folderId','isAbsolute','description','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','red','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','296131pFibQm','Resolved\x20path\x20type:\x20','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Resolving\x20path\x20\x27','Site:\x20','7301096IboIGG','Resolved\x20relative\x20path\x20to:\x20','type','40coFBpp','split','join','segment:use','config','folderPath','Target\x20path:\x20','cyan','Examples:','verbose','dim','data','\x27...','name','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','66tTozPK','34dNvBko','5EUGRGV','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','length','log','1732432upuYwT','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Parent\x20ID:\x20','71682upiYLA','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','error','segment','segmentPath','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','1201389HMyoWH','Usage:\x20tdx\x20segment\x20use\x20<path>','8gvPdNj','Use:\x20tdx\x20segment\x20use\x20','resolvePathToResource','Folder\x20ID:\x20','isDirectory'];a44_0x5775=function(){return _0x202228;};return a44_0x5775();}import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a44_0x1f5084(0x21d)]=a44_0x1f5084(0x213);[a44_0x1f5084(0x202)]=a44_0x1f5084(0x1eb);async['execute'](_0x323592){const _0x3b9279=a44_0x1f5084,{options:_0x503407,args:_0x2dd277,tdx:_0x4b31c6}=_0x323592;if(_0x2dd277['length']===0x0)return console[_0x3b9279(0x1ec)](a44_0x327064['red'](_0x3b9279(0x1ff))),console[_0x3b9279(0x1ec)](_0x3b9279(0x1f1)),console[_0x3b9279(0x1ec)](_0x3b9279(0x218)),console['error'](_0x3b9279(0x206)),console[_0x3b9279(0x1ec)](_0x3b9279(0x203)),console[_0x3b9279(0x1ec)](_0x3b9279(0x205)),console[_0x3b9279(0x1ec)](_0x3b9279(0x209)),0x1;const _0x3e98ba=_0x2dd277[0x0],_0x3dd067=_0x503407['session'];try{if(_0x3e98ba==='/')return saveSessionContext({'segment_path':undefined},_0x3dd067),console[_0x3b9279(0x225)](a44_0x327064['green'](_0x3b9279(0x222))),0x0;if(existsSync(_0x3e98ba)&&statSync(_0x3e98ba)[_0x3b9279(0x1f6)]()){let _0x55feb1;try{_0x55feb1=findTdxConfig(_0x3e98ba);}catch{return console[_0x3b9279(0x1ec)](a44_0x327064[_0x3b9279(0x204)](_0x3b9279(0x223)+_0x3e98ba)),console[_0x3b9279(0x1ec)](a44_0x327064[_0x3b9279(0x217)](_0x3b9279(0x21e))),0x1;}const _0x2b9820=_0x55feb1[_0x3b9279(0x214)][_0x3b9279(0x1fb)];return saveSessionContext({'segment_path':_0x2b9820,'parent_segment':_0x2b9820},_0x3dd067),console[_0x3b9279(0x225)](a44_0x327064[_0x3b9279(0x1f7)](_0x3b9279(0x1fe)+a44_0x327064[_0x3b9279(0x217)](_0x2b9820))),0x0;}const _0x1e99d3=_0x503407[_0x3b9279(0x1ee)];let _0x2e6d3d=_0x3e98ba;const _0x130155=parsePath(_0x3e98ba);if(!_0x130155[_0x3b9279(0x201)]){if(!_0x1e99d3)return console[_0x3b9279(0x1ec)](a44_0x327064[_0x3b9279(0x204)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console['error'](a44_0x327064['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x3e98ba==='..'){const _0x10bd9f=_0x1e99d3[_0x3b9279(0x211)]('/')[_0x3b9279(0x1f8)](0x0,-0x1)[_0x3b9279(0x212)]('/');_0x2e6d3d=_0x10bd9f||'/';}else _0x3e98ba==='.'?_0x2e6d3d=_0x1e99d3:_0x2e6d3d=_0x1e99d3+'/'+_0x3e98ba;_0x503407[_0x3b9279(0x219)]&&console[_0x3b9279(0x1ec)](_0x3b9279(0x20e)+_0x2e6d3d);}if(_0x2e6d3d==='/'||_0x2e6d3d==='')return saveSessionContext({'segment_path':undefined},_0x3dd067),console[_0x3b9279(0x225)](a44_0x327064[_0x3b9279(0x1f7)](_0x3b9279(0x222))),0x0;_0x2e6d3d=normalizePath(_0x2e6d3d);const _0x36c396=parsePath(_0x2e6d3d)['segments'];if(_0x36c396[_0x3b9279(0x224)]===0x0)return saveSessionContext({'segment_path':undefined},_0x3dd067),console[_0x3b9279(0x225)](a44_0x327064[_0x3b9279(0x1f7)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x503407[_0x3b9279(0x219)]&&(console[_0x3b9279(0x1ec)](_0x3b9279(0x20c)+_0x503407['site']),console[_0x3b9279(0x1ec)](_0x3b9279(0x216)+_0x2e6d3d));const _0x38de89=await withSpinner(_0x3b9279(0x20b)+_0x2e6d3d+_0x3b9279(0x21c),()=>_0x4b31c6[_0x3b9279(0x1ed)][_0x3b9279(0x1f4)](_0x2e6d3d),{'verbose':_0x503407[_0x3b9279(0x219)]}),_0x5dae58=_0x38de89[_0x3b9279(0x21b)];_0x503407['verbose']&&(console[_0x3b9279(0x1ec)](_0x3b9279(0x208)+_0x5dae58[_0x3b9279(0x20f)]),console[_0x3b9279(0x1ec)](_0x3b9279(0x1e9)+_0x5dae58['parentId']),_0x5dae58[_0x3b9279(0x200)]&&console[_0x3b9279(0x1ec)](_0x3b9279(0x1f5)+_0x5dae58[_0x3b9279(0x200)]));if(_0x5dae58[_0x3b9279(0x20f)]===_0x3b9279(0x1ed))return console[_0x3b9279(0x1ec)](a44_0x327064[_0x3b9279(0x204)](_0x3b9279(0x1ef))),console['error'](_0x3b9279(0x20a)),console[_0x3b9279(0x1ec)](a44_0x327064[_0x3b9279(0x217)](_0x3b9279(0x1f3)+_0x5dae58['parentName']+(_0x5dae58[_0x3b9279(0x215)]?'/'+_0x5dae58['folderPath'][_0x3b9279(0x212)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5dae58[_0x3b9279(0x1f9)],'parent_segment':_0x5dae58['parentName']},_0x3dd067),console[_0x3b9279(0x225)](a44_0x327064[_0x3b9279(0x1f7)]('✔\x20Context\x20set\x20to:\x20'+a44_0x327064['cyan'](_0x5dae58[_0x3b9279(0x1f9)]))),_0x503407['verbose']&&(console[_0x3b9279(0x1ec)](a44_0x327064[_0x3b9279(0x21a)](_0x3b9279(0x1e8))),console[_0x3b9279(0x1ec)](a44_0x327064[_0x3b9279(0x21a)](_0x3b9279(0x1fc)))),0x0;}catch(_0x120f42){throw _0x120f42;}}}
@@ -1 +1 @@
1
- const a45_0x17cf04=a45_0x21f1;(function(_0x30b632,_0x5934a8){const _0x57cd27=a45_0x21f1,_0x368cc7=_0x30b632();while(!![]){try{const _0x76b9b2=parseInt(_0x57cd27(0x206))/0x1+parseInt(_0x57cd27(0x1fc))/0x2*(parseInt(_0x57cd27(0x207))/0x3)+-parseInt(_0x57cd27(0x214))/0x4*(parseInt(_0x57cd27(0x20f))/0x5)+parseInt(_0x57cd27(0x1ff))/0x6+-parseInt(_0x57cd27(0x20a))/0x7*(parseInt(_0x57cd27(0x1f1))/0x8)+-parseInt(_0x57cd27(0x20d))/0x9+-parseInt(_0x57cd27(0x1f2))/0xa;if(_0x76b9b2===_0x5934a8)break;else _0x368cc7['push'](_0x368cc7['shift']());}catch(_0x5ca058){_0x368cc7['push'](_0x368cc7['shift']());}}}(a45_0x253c,0x70d41));import{BaseCommand}from'./command.js';function a45_0x253c(){const _0x287e0c=['error','log','Error:\x20','verbose','green','1489032xrGQwV','2823150sLyWwS','name','type','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','):\x20','description','targetDir','Error:\x20Directory\x20not\x20found:\x20','length','validCount','34862pgwbzH','warnings','\x20file(s)\x20with\x20errors,\x20','829704FPIDCZ','yellow','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Validate\x20segment\x20and\x20journey\x20YAML\x20files','cyan','325892fbHLrX','144eySEQZ','\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','.yml','7JXOjXR','red','helpText','2145069EPgRhv','\x20error(s)','10vbHeVH','errorCode','warningCount','message','endsWith','263868aIEESc','\x20warning(s)\x20found','file','errors','.yaml','valid','dim','invalidCount','cwd','parentSegment'];a45_0x253c=function(){return _0x287e0c;};return a45_0x253c();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a45_0x21f1(_0x31ffc6,_0x49cd89){_0x31ffc6=_0x31ffc6-0x1e8;const _0x253cec=a45_0x253c();let _0x21f182=_0x253cec[_0x31ffc6];return _0x21f182;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a45_0x300f5c 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{[a45_0x17cf04(0x1f3)]='segment:validate';[a45_0x17cf04(0x1f7)]=a45_0x17cf04(0x204);async['execute'](_0x1f5603){const _0x2d6d60=a45_0x17cf04,{options:_0x44fd0a,args:_0x326e71}=_0x1f5603,_0x174dec=_0x44fd0a,_0x1071a4=await resolveTarget({'arg':_0x326e71[0x0],'contextParent':_0x44fd0a[_0x2d6d60(0x1eb)],'cwd':process[_0x2d6d60(0x1ea)]()});if(!isSuccessfulResolution(_0x1071a4))return _0x1071a4[_0x2d6d60(0x210)]==='no_parent'?(console[_0x2d6d60(0x1ec)](a45_0x300f5c[_0x2d6d60(0x200)](_0x2d6d60(0x201))),console[_0x2d6d60(0x1ec)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x2d6d60(0x1ec)](_0x2d6d60(0x208)),console['error'](_0x2d6d60(0x203))):(console[_0x2d6d60(0x1ec)](a45_0x300f5c[_0x2d6d60(0x20b)](_0x2d6d60(0x1ee)+_0x1071a4[_0x2d6d60(0x212)]+'\x0a')),_0x1071a4[_0x2d6d60(0x20c)]&&console[_0x2d6d60(0x1ec)](a45_0x300f5c[_0x2d6d60(0x205)](_0x1071a4[_0x2d6d60(0x20c)]))),0x1;const _0x5b9034=_0x1071a4[_0x2d6d60(0x1f8)],_0x398154=_0x1071a4[_0x2d6d60(0x1f4)]===_0x2d6d60(0x216)?_0x1071a4['filePath']:undefined;if(!_0x398154&&!existsSync(_0x5b9034))return console['error'](a45_0x300f5c[_0x2d6d60(0x20b)](_0x2d6d60(0x1f9)+_0x5b9034+'\x0a')),0x1;let _0x2b1685;if(_0x398154){if(!_0x398154[_0x2d6d60(0x213)](_0x2d6d60(0x209))&&!_0x398154[_0x2d6d60(0x213)](_0x2d6d60(0x218)))return console[_0x2d6d60(0x1ec)](a45_0x300f5c['red'](_0x2d6d60(0x202)+_0x398154+'\x0a')),0x1;_0x2b1685=[_0x398154];}else _0x2b1685=findYamlFiles(_0x5b9034);if(_0x2b1685[_0x2d6d60(0x1fa)]===0x0)return console[_0x2d6d60(0x1ec)](a45_0x300f5c[_0x2d6d60(0x20b)](_0x2d6d60(0x1f5)+_0x5b9034+'\x0a')),0x1;const _0x536a96=validateYamlFiles(_0x2b1685,_0x5b9034),_0x4f29d5=calculateSummary(_0x536a96);for(const _0x5d9347 of _0x536a96){if(!isValidationResult(_0x5d9347))continue;const {relativePath:_0x195f52,source:_0x20373c,result:_0x5cb0ea,fileType:_0x2e4364}=_0x5d9347,_0x4e37eb=_0x2e4364;if(_0x5cb0ea[_0x2d6d60(0x219)]&&_0x5cb0ea[_0x2d6d60(0x1fd)][_0x2d6d60(0x1fa)]===0x0)_0x174dec[_0x2d6d60(0x1ef)]&&console[_0x2d6d60(0x1ed)](a45_0x300f5c['green']('✔\x20'+_0x195f52)+a45_0x300f5c[_0x2d6d60(0x1e8)]('\x20('+_0x4e37eb+')'));else _0x5cb0ea[_0x2d6d60(0x219)]?(console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x200)]('⚠\x20'+_0x195f52)+a45_0x300f5c[_0x2d6d60(0x1e8)]('\x20('+_0x4e37eb+_0x2d6d60(0x1f6)+_0x5cb0ea[_0x2d6d60(0x1fd)][_0x2d6d60(0x1fa)]+'\x20warning(s)')),console[_0x2d6d60(0x1ed)](formatValidationResult(_0x5cb0ea,_0x20373c,_0x195f52))):(console[_0x2d6d60(0x1ed)](a45_0x300f5c['red']('✖\x20'+_0x195f52)+a45_0x300f5c[_0x2d6d60(0x1e8)]('\x20('+_0x4e37eb+_0x2d6d60(0x1f6)+_0x5cb0ea[_0x2d6d60(0x217)][_0x2d6d60(0x1fa)]+_0x2d6d60(0x20e))),console[_0x2d6d60(0x1ed)](formatValidationResult(_0x5cb0ea,_0x20373c,_0x195f52)));}return console['log'](''),_0x4f29d5['hasErrors']?(console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x20b)]('Validation\x20failed:\x20'+_0x4f29d5[_0x2d6d60(0x1e9)]+_0x2d6d60(0x1fe)+_0x4f29d5['validCount']+'\x20valid')),_0x4f29d5['warningCount']>0x0&&console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x200)](_0x4f29d5[_0x2d6d60(0x211)]+_0x2d6d60(0x215))),0x1):(console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x1f0)]('✔\x20All\x20'+_0x4f29d5[_0x2d6d60(0x1fb)]+'\x20file(s)\x20valid')),_0x4f29d5[_0x2d6d60(0x211)]>0x0&&console[_0x2d6d60(0x1ed)](a45_0x300f5c[_0x2d6d60(0x200)](_0x4f29d5[_0x2d6d60(0x211)]+_0x2d6d60(0x215))),0x0);}}
1
+ const a45_0x7123c8=a45_0x429f;(function(_0x270330,_0x1a2059){const _0x5dce96=a45_0x429f,_0x1fdea5=_0x270330();while(!![]){try{const _0x293109=-parseInt(_0x5dce96(0x7f))/0x1*(parseInt(_0x5dce96(0x80))/0x2)+-parseInt(_0x5dce96(0x91))/0x3*(parseInt(_0x5dce96(0x79))/0x4)+-parseInt(_0x5dce96(0x84))/0x5*(parseInt(_0x5dce96(0x8e))/0x6)+parseInt(_0x5dce96(0x7a))/0x7+-parseInt(_0x5dce96(0x8f))/0x8*(parseInt(_0x5dce96(0x76))/0x9)+-parseInt(_0x5dce96(0x99))/0xa*(parseInt(_0x5dce96(0x71))/0xb)+parseInt(_0x5dce96(0x7d))/0xc*(parseInt(_0x5dce96(0x75))/0xd);if(_0x293109===_0x1a2059)break;else _0x1fdea5['push'](_0x1fdea5['shift']());}catch(_0x1ae1ca){_0x1fdea5['push'](_0x1fdea5['shift']());}}}(a45_0x6f04,0x88095));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a45_0x429f(_0x4c88a6,_0x8206c){_0x4c88a6=_0x4c88a6-0x6c;const _0x6f04d=a45_0x6f04();let _0x429f29=_0x6f04d[_0x4c88a6];return _0x429f29;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a45_0x354d65 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a45_0x6f04(){const _0xbc134b=['Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','no_parent','\x20error(s)','\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','error','name','invalidCount','.yaml','type','errors','cwd','log','\x20valid','5913226ShGyCl','warnings','targetDir','cyan','64688kTegTR','5618997cLeZLs','parentSegment','hasErrors','4lsXoET','4948818aoduoU','red','green','3432yFDZNx','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','11396flNIvE','4fEobLr','Validate\x20segment\x20and\x20journey\x20YAML\x20files','helpText','warningCount','1204805FmZnIV','):\x20','filePath','description','message','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','validCount','\x20warning(s)\x20found','yellow','\x20file(s)\x20with\x20errors,\x20','6LmJgiC','8ynEDzj','execute','441759KpdcQw','dim','valid','✔\x20All\x20','Error:\x20','.yml','Validation\x20failed:\x20','\x20file(s)\x20valid','10ifVEEo'];a45_0x6f04=function(){return _0xbc134b;};return a45_0x6f04();}export class SegmentValidateCommand extends BaseCommand{[a45_0x7123c8(0xa1)]='segment:validate';[a45_0x7123c8(0x87)]=a45_0x7123c8(0x81);async[a45_0x7123c8(0x90)](_0x33ee24){const _0x5c0716=a45_0x7123c8,{options:_0x4f2b85,args:_0x30978b}=_0x33ee24,_0x16a0de=_0x4f2b85,_0x2b6a12=await resolveTarget({'arg':_0x30978b[0x0],'contextParent':_0x4f2b85[_0x5c0716(0x77)],'cwd':process[_0x5c0716(0x6e)]()});if(!isSuccessfulResolution(_0x2b6a12))return _0x2b6a12['errorCode']===_0x5c0716(0x9d)?(console['error'](a45_0x354d65[_0x5c0716(0x8c)](_0x5c0716(0x89))),console[_0x5c0716(0xa0)](_0x5c0716(0x7e)),console[_0x5c0716(0xa0)](_0x5c0716(0x9f)),console[_0x5c0716(0xa0)](_0x5c0716(0x9c))):(console[_0x5c0716(0xa0)](a45_0x354d65['red'](_0x5c0716(0x95)+_0x2b6a12[_0x5c0716(0x88)]+'\x0a')),_0x2b6a12[_0x5c0716(0x82)]&&console[_0x5c0716(0xa0)](a45_0x354d65[_0x5c0716(0x74)](_0x2b6a12[_0x5c0716(0x82)]))),0x1;const _0x51c502=_0x2b6a12[_0x5c0716(0x73)],_0x22295f=_0x2b6a12[_0x5c0716(0x6c)]==='file'?_0x2b6a12[_0x5c0716(0x86)]:undefined;if(!_0x22295f&&!existsSync(_0x51c502))return console['error'](a45_0x354d65[_0x5c0716(0x7b)]('Error:\x20Directory\x20not\x20found:\x20'+_0x51c502+'\x0a')),0x1;let _0x76d6c8;if(_0x22295f){if(!_0x22295f['endsWith'](_0x5c0716(0x96))&&!_0x22295f['endsWith'](_0x5c0716(0xa3)))return console[_0x5c0716(0xa0)](a45_0x354d65[_0x5c0716(0x7b)](_0x5c0716(0x9a)+_0x22295f+'\x0a')),0x1;_0x76d6c8=[_0x22295f];}else _0x76d6c8=findYamlFiles(_0x51c502);if(_0x76d6c8['length']===0x0)return console[_0x5c0716(0xa0)](a45_0x354d65[_0x5c0716(0x7b)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x51c502+'\x0a')),0x1;const _0x9d218b=validateYamlFiles(_0x76d6c8,_0x51c502),_0x43225b=calculateSummary(_0x9d218b);for(const _0xf4d31e of _0x9d218b){if(!isValidationResult(_0xf4d31e))continue;const {relativePath:_0x31095e,source:_0x20baf8,result:_0x30ab79,fileType:_0x42353d}=_0xf4d31e,_0x3c7cab=_0x42353d;if(_0x30ab79[_0x5c0716(0x93)]&&_0x30ab79[_0x5c0716(0x72)][_0x5c0716(0x9b)]===0x0)_0x16a0de['verbose']&&console['log'](a45_0x354d65[_0x5c0716(0x7c)]('✔\x20'+_0x31095e)+a45_0x354d65[_0x5c0716(0x92)]('\x20('+_0x3c7cab+')'));else _0x30ab79[_0x5c0716(0x93)]?(console[_0x5c0716(0x6f)](a45_0x354d65[_0x5c0716(0x8c)]('⚠\x20'+_0x31095e)+a45_0x354d65[_0x5c0716(0x92)]('\x20('+_0x3c7cab+_0x5c0716(0x85)+_0x30ab79['warnings']['length']+'\x20warning(s)')),console[_0x5c0716(0x6f)](formatValidationResult(_0x30ab79,_0x20baf8,_0x31095e))):(console[_0x5c0716(0x6f)](a45_0x354d65[_0x5c0716(0x7b)]('✖\x20'+_0x31095e)+a45_0x354d65['dim']('\x20('+_0x3c7cab+_0x5c0716(0x85)+_0x30ab79[_0x5c0716(0x6d)][_0x5c0716(0x9b)]+_0x5c0716(0x9e))),console[_0x5c0716(0x6f)](formatValidationResult(_0x30ab79,_0x20baf8,_0x31095e)));}return console['log'](''),_0x43225b[_0x5c0716(0x78)]?(console[_0x5c0716(0x6f)](a45_0x354d65[_0x5c0716(0x7b)](_0x5c0716(0x97)+_0x43225b[_0x5c0716(0xa2)]+_0x5c0716(0x8d)+_0x43225b['validCount']+_0x5c0716(0x70))),_0x43225b[_0x5c0716(0x83)]>0x0&&console[_0x5c0716(0x6f)](a45_0x354d65[_0x5c0716(0x8c)](_0x43225b['warningCount']+_0x5c0716(0x8b))),0x1):(console[_0x5c0716(0x6f)](a45_0x354d65[_0x5c0716(0x7c)](_0x5c0716(0x94)+_0x43225b[_0x5c0716(0x8a)]+_0x5c0716(0x98))),_0x43225b['warningCount']>0x0&&console[_0x5c0716(0x6f)](a45_0x354d65['yellow'](_0x43225b[_0x5c0716(0x83)]+_0x5c0716(0x8b))),0x0);}}
@@ -1 +1 @@
1
- function a46_0x5f11(_0x2dc8dc,_0x18c7c6){_0x2dc8dc=_0x2dc8dc-0x1e8;const _0x4fc5a6=a46_0x4fc5();let _0x5f117c=_0x4fc5a6[_0x2dc8dc];return _0x5f117c;}const a46_0xac0d27=a46_0x5f11;(function(_0x2fbc21,_0x1e7981){const _0x1b23a3=a46_0x5f11,_0x38613a=_0x2fbc21();while(!![]){try{const _0x23a889=parseInt(_0x1b23a3(0x22f))/0x1+parseInt(_0x1b23a3(0x22d))/0x2+-parseInt(_0x1b23a3(0x215))/0x3*(-parseInt(_0x1b23a3(0x1f3))/0x4)+-parseInt(_0x1b23a3(0x1ea))/0x5*(-parseInt(_0x1b23a3(0x1ef))/0x6)+parseInt(_0x1b23a3(0x208))/0x7*(parseInt(_0x1b23a3(0x211))/0x8)+-parseInt(_0x1b23a3(0x214))/0x9*(parseInt(_0x1b23a3(0x21f))/0xa)+parseInt(_0x1b23a3(0x1f2))/0xb*(-parseInt(_0x1b23a3(0x228))/0xc);if(_0x23a889===_0x1e7981)break;else _0x38613a['push'](_0x38613a['shift']());}catch(_0x2778bb){_0x38613a['push'](_0x38613a['shift']());}}}(a46_0x4fc5,0x8302a));function a46_0x4fc5(){const _0x528951=['Folder\x20ID:\x20','/app/ps/','380008dtczrZ','test','jsonl','8078418BqMPqv','183KrQZFG','filter','includes','format','replace','children','cause','folder','folders','description','10BiJDsQ','\x20journey','(not\x20set)','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Parent\x20segment\x20context:\x20','journeyBundleName','segment','List\x20folders\x20and\x20child\x20segments','listWithPattern','6545712doogYl','parentId','Building\x20hierarchy\x20tree...','name','site','775804PZaKua','/e/','457083aSYnmm','journey','parentSegment','\x20segment','\x27...','resolvePathToResource','380500wICgqX','\x20matching\x20\x27','error','journeys','listUnified','60wKtNwt','Listing\x20folders,\x20segments,\x20and\x20journeys...','listUnifiedWithJourneys','11EmonQK','18276SIVDxo','Parent\x20ID:\x20','log',',\x20and\x20','Resolving\x20path\x20\x27','Resolving\x20parent\x20segment\x20\x27','folderId','listRecursive','Site:\x20','Recursive\x20mode:\x20enabled','✔\x20Found\x20','/j/da','verbose','dim','localeCompare','maxDepth','\x20folder','Set\x20a\x20parent\x20segment\x20context\x20first:','sort','json','data','14grkOok','✔\x20Built\x20tree\x20with\x20','recursive','map','length','type','segments'];a46_0x4fc5=function(){return _0x528951;};return a46_0x4fc5();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0x16a33d from'chalk';export class SegmentsCommand extends BaseCommand{[a46_0xac0d27(0x22b)]=a46_0xac0d27(0x20e);[a46_0xac0d27(0x21e)]=a46_0xac0d27(0x226);async['execute'](_0x369d7e){const _0x52766e=a46_0xac0d27,{options:_0x42427a,args:_0x55d9d5}=_0x369d7e,_0x40d508=_0x42427a[_0x52766e(0x20a)],_0x5ab38d=_0x55d9d5[0x0];try{const _0x52e539=_0x42427a[_0x52766e(0x231)];_0x42427a[_0x52766e(0x1ff)]&&(console['error'](_0x52766e(0x1fb)+_0x42427a[_0x52766e(0x22c)]),console[_0x52766e(0x1ec)](_0x52766e(0x223)+(_0x52e539||_0x52766e(0x221))),_0x5ab38d&&console[_0x52766e(0x1ec)]('Folder/pattern\x20arg:\x20'+_0x5ab38d),_0x40d508&&console[_0x52766e(0x1ec)](_0x52766e(0x1fc)));if(!_0x52e539)return console[_0x52766e(0x1ec)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x52766e(0x1ec)](''),console[_0x52766e(0x1ec)](_0x52766e(0x204)),console['error']('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x52766e(0x1ec)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x52766e(0x1ec)](''),console[_0x52766e(0x1ec)](_0x52766e(0x222)),0x1;const _0x542ee1=_0x5ab38d&&(_0x5ab38d[_0x52766e(0x217)]('*')||_0x5ab38d[_0x52766e(0x217)]('?'));if(_0x542ee1)return await this[_0x52766e(0x227)](_0x369d7e,_0x52e539,_0x5ab38d);const _0x5a8c06=_0x5ab38d?_0x52e539+'/'+_0x5ab38d:_0x52e539;return _0x40d508?await this[_0x52766e(0x1fa)](_0x369d7e,_0x5a8c06):await this[_0x52766e(0x1ee)](_0x369d7e,_0x5a8c06);}catch(_0x32f40f){if(_0x32f40f instanceof SDKError)return console[_0x52766e(0x1ec)]('Error:\x20'+_0x32f40f['message']),_0x32f40f[_0x52766e(0x21b)]&&console[_0x52766e(0x1ec)]('\x20\x20Cause:\x20'+_0x32f40f[_0x52766e(0x21b)]),0x1;throw _0x32f40f;}}async[a46_0xac0d27(0x227)](_0x49bfc5,_0x3b6c22,_0x6e0318){const _0x8e93e1=a46_0xac0d27,{options:_0x1378c8,tdx:_0x29f500}=_0x49bfc5,_0x174025=await withSpinner(_0x8e93e1(0x1f8)+_0x3b6c22+_0x8e93e1(0x1e8),()=>_0x29f500['segment'][_0x8e93e1(0x1e9)](_0x3b6c22),{'verbose':_0x1378c8[_0x8e93e1(0x1ff)]}),_0x185752=_0x174025['data'],_0x4ebf1f=await withSpinner(_0x8e93e1(0x1f0),()=>_0x29f500[_0x8e93e1(0x225)]['listUnifiedWithJourneys'](_0x185752[_0x8e93e1(0x229)],_0x185752[_0x8e93e1(0x1f9)]),{'verbose':_0x1378c8['verbose']}),{folders:_0x238478,segments:_0x52a1e1,journeys:_0x1911be}=_0x4ebf1f[_0x8e93e1(0x207)],_0x3d3fd8=_0x6e0318[_0x8e93e1(0x219)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x8e93e1(0x219)](/\*/g,'.*')[_0x8e93e1(0x219)](/\?/g,'.'),_0x20e424=new RegExp('^'+_0x3d3fd8+'$','i'),_0x3aee5a=_0x238478[_0x8e93e1(0x216)](_0x13a576=>_0x20e424[_0x8e93e1(0x212)](_0x13a576['name'])),_0x2f99cd=_0x52a1e1[_0x8e93e1(0x216)](_0x5302b2=>_0x20e424[_0x8e93e1(0x212)](_0x5302b2[_0x8e93e1(0x22b)])),_0x13075d=_0x1911be[_0x8e93e1(0x216)](_0x156168=>_0x20e424[_0x8e93e1(0x212)](_0x156168[_0x8e93e1(0x224)])),_0x2d50a9=_0x3aee5a['length']+_0x2f99cd[_0x8e93e1(0x20c)]+_0x13075d['length'];console['error'](_0x8e93e1(0x1fd)+_0x3aee5a[_0x8e93e1(0x20c)]+_0x8e93e1(0x203)+(_0x3aee5a[_0x8e93e1(0x20c)]!==0x1?'s':'')+',\x20'+_0x2f99cd[_0x8e93e1(0x20c)]+_0x8e93e1(0x232)+(_0x2f99cd[_0x8e93e1(0x20c)]!==0x1?'s':'')+_0x8e93e1(0x1f6)+_0x13075d[_0x8e93e1(0x20c)]+_0x8e93e1(0x220)+(_0x13075d[_0x8e93e1(0x20c)]!==0x1?'s':'')+_0x8e93e1(0x1eb)+_0x6e0318+'\x27');const _0xf4eccc=_0x2b247c=>{const _0x197110=_0x8e93e1;return getConsoleNextUrl(_0x1378c8[_0x197110(0x22c)],'/app/ps/'+_0x185752[_0x197110(0x229)]+'/e/'+_0x2b247c);},_0x11fcb4=_0x1378c8[_0x8e93e1(0x218)]==='json'||_0x1378c8[_0x8e93e1(0x218)]===_0x8e93e1(0x213);if(_0x11fcb4){const _0x2a887c=[..._0x3aee5a[_0x8e93e1(0x20b)](_0x5998e2=>({..._0x5998e2,'type':'folder'})),..._0x2f99cd[_0x8e93e1(0x20b)](_0x3848a8=>({..._0x3848a8,'type':_0x8e93e1(0x225),'url':_0xf4eccc(_0x3848a8['id'])})),..._0x13075d[_0x8e93e1(0x20b)](_0x50a854=>({..._0x50a854,'name':_0x50a854[_0x8e93e1(0x224)],'type':_0x8e93e1(0x230)}))][_0x8e93e1(0x205)]((_0x2e9287,_0x4325a5)=>_0x2e9287[_0x8e93e1(0x22b)]['localeCompare'](_0x4325a5['name']));await handleSDKOutput(_0x2a887c,_0x1378c8);}else{if(_0x2d50a9===0x0)console['log']('No\x20items\x20match\x20pattern:\x20'+_0x6e0318);else{console['log'](a46_0x16a33d[_0x8e93e1(0x200)]('['+_0x3b6c22+']\x20matching\x20\x27'+_0x6e0318+'\x27'));const _0x4cb03f=formatFlatList(_0x3aee5a,_0x2f99cd,{'showMetadata':!![],'getSegmentUrl':_0xf4eccc},_0x13075d);console[_0x8e93e1(0x1f5)](_0x4cb03f);}}return 0x0;}async['listUnified'](_0x1efad3,_0x3cd10e){const _0x121a0c=a46_0xac0d27,{options:_0x947cb4,tdx:_0x237279}=_0x1efad3,_0x448f0f=await withSpinner(_0x121a0c(0x1f7)+_0x3cd10e+_0x121a0c(0x1e8),()=>_0x237279['segment'][_0x121a0c(0x1e9)](_0x3cd10e),{'verbose':_0x947cb4[_0x121a0c(0x1ff)]}),_0x383442=_0x448f0f['data'];_0x947cb4['verbose']&&(console['error'](_0x121a0c(0x1f4)+_0x383442[_0x121a0c(0x229)]),_0x383442[_0x121a0c(0x1f9)]&&console[_0x121a0c(0x1ec)](_0x121a0c(0x20f)+_0x383442[_0x121a0c(0x1f9)]));const _0x2b0e86=await withSpinner(_0x121a0c(0x1f0),()=>_0x237279[_0x121a0c(0x225)][_0x121a0c(0x1f1)](_0x383442[_0x121a0c(0x229)],_0x383442['folderId']),{'verbose':_0x947cb4[_0x121a0c(0x1ff)]}),{folders:_0x1280a6,segments:_0x12416c,journeys:_0x23985c}=_0x2b0e86['data'],_0x201449=_0x1280a6[_0x121a0c(0x20c)]+_0x12416c['length']+_0x23985c[_0x121a0c(0x20c)];console[_0x121a0c(0x1ec)](_0x121a0c(0x1fd)+_0x1280a6['length']+_0x121a0c(0x203)+(_0x1280a6['length']!==0x1?'s':'')+',\x20'+_0x12416c['length']+_0x121a0c(0x232)+(_0x12416c[_0x121a0c(0x20c)]!==0x1?'s':'')+_0x121a0c(0x1f6)+_0x23985c[_0x121a0c(0x20c)]+_0x121a0c(0x220)+(_0x23985c['length']!==0x1?'s':''));const _0x49582c=_0x1b4eb0=>{const _0x37d83f=_0x121a0c;return getConsoleNextUrl(_0x947cb4['site'],_0x37d83f(0x210)+_0x383442['parentId']+_0x37d83f(0x22e)+_0x1b4eb0);},_0xf6cca4=_0x5c2a7e=>{const _0x9119ff=_0x121a0c;return getConsoleNextUrl(_0x947cb4[_0x9119ff(0x22c)],_0x9119ff(0x210)+_0x383442[_0x9119ff(0x229)]+'/e/'+_0x5c2a7e+'/j/da');},_0x41d006=_0x947cb4[_0x121a0c(0x218)]===_0x121a0c(0x206)||_0x947cb4[_0x121a0c(0x218)]==='jsonl';if(_0x41d006){const _0x548bf2=[..._0x1280a6['map'](_0x4d9f77=>({..._0x4d9f77,'type':_0x121a0c(0x21c)})),..._0x12416c[_0x121a0c(0x20b)](_0x5da3b5=>({..._0x5da3b5,'type':_0x121a0c(0x225),'url':_0x49582c(_0x5da3b5['id'])})),..._0x23985c[_0x121a0c(0x20b)](_0x1f31e7=>({..._0x1f31e7,'name':_0x1f31e7[_0x121a0c(0x224)],'type':_0x121a0c(0x230),'url':_0xf6cca4(_0x1f31e7['id'])}))][_0x121a0c(0x205)]((_0x1735fe,_0x385c45)=>_0x1735fe[_0x121a0c(0x22b)][_0x121a0c(0x201)](_0x385c45[_0x121a0c(0x22b)]));await handleSDKOutput(_0x548bf2,_0x947cb4);}else{if(_0x201449===0x0)console['log'](a46_0x16a33d[_0x121a0c(0x200)]('['+_0x3cd10e+']')),console[_0x121a0c(0x1f5)]('(empty)');else{console[_0x121a0c(0x1f5)](a46_0x16a33d[_0x121a0c(0x200)]('['+_0x3cd10e+']'));const _0x38a648=formatFlatList(_0x1280a6,_0x12416c,{'showMetadata':!![],'getSegmentUrl':_0x49582c,'getJourneyUrl':_0xf6cca4},_0x23985c);console[_0x121a0c(0x1f5)](_0x38a648);}}return 0x0;}async[a46_0xac0d27(0x1fa)](_0x4e2474,_0x2713b2){const _0x177b7d=a46_0xac0d27,{options:_0x4e4058,tdx:_0x49f9ed}=_0x4e2474,_0x38cd0a=await withSpinner(_0x177b7d(0x1f7)+_0x2713b2+_0x177b7d(0x1e8),()=>_0x49f9ed['segment'][_0x177b7d(0x1e9)](_0x2713b2),{'verbose':_0x4e4058[_0x177b7d(0x1ff)]}),_0x59c002=_0x38cd0a[_0x177b7d(0x207)];_0x4e4058[_0x177b7d(0x1ff)]&&(console[_0x177b7d(0x1ec)](_0x177b7d(0x1f4)+_0x59c002[_0x177b7d(0x229)]),_0x59c002[_0x177b7d(0x1f9)]&&console[_0x177b7d(0x1ec)](_0x177b7d(0x20f)+_0x59c002['folderId']));const _0x5ce242=_0x4e4058[_0x177b7d(0x202)]||0xa,_0x522ded=await withSpinner(_0x177b7d(0x22a),()=>_0x49f9ed[_0x177b7d(0x225)][_0x177b7d(0x1fa)](_0x59c002[_0x177b7d(0x229)],_0x59c002['folderId'],0x0,_0x5ce242),{'verbose':_0x4e4058['verbose']}),_0x5d6c2b=_0x522ded['data'],_0x4b2a9c=_0x880f01=>{const _0x37a6bd=_0x177b7d;let _0x6da368=0x0,_0x1fa1de=0x0,_0x1212d5=0x0;for(const _0x44f1e1 of _0x880f01){if(_0x44f1e1['type']==='folder')_0x6da368++;else{if(_0x44f1e1[_0x37a6bd(0x20d)]===_0x37a6bd(0x225))_0x1fa1de++;else{if(_0x44f1e1[_0x37a6bd(0x20d)]===_0x37a6bd(0x230))_0x1212d5++;}}if(_0x44f1e1['children']){const _0x154fa5=_0x4b2a9c(_0x44f1e1[_0x37a6bd(0x21a)]);_0x6da368+=_0x154fa5[_0x37a6bd(0x21d)],_0x1fa1de+=_0x154fa5[_0x37a6bd(0x20e)],_0x1212d5+=_0x154fa5[_0x37a6bd(0x1ed)];}}return{'folders':_0x6da368,'segments':_0x1fa1de,'journeys':_0x1212d5};},_0x425b36=_0x4b2a9c(_0x5d6c2b);console['error'](_0x177b7d(0x209)+_0x425b36[_0x177b7d(0x21d)]+_0x177b7d(0x203)+(_0x425b36[_0x177b7d(0x21d)]!==0x1?'s':'')+',\x20'+_0x425b36['segments']+_0x177b7d(0x232)+(_0x425b36[_0x177b7d(0x20e)]!==0x1?'s':'')+_0x177b7d(0x1f6)+_0x425b36[_0x177b7d(0x1ed)]+_0x177b7d(0x220)+(_0x425b36['journeys']!==0x1?'s':''));const _0x18425f=_0x321cad=>{const _0x3dff3f=_0x177b7d;return getConsoleNextUrl(_0x4e4058[_0x3dff3f(0x22c)],_0x3dff3f(0x210)+_0x59c002['parentId']+_0x3dff3f(0x22e)+_0x321cad);},_0x1ffe55=_0x460561=>{const _0x8811f9=_0x177b7d;return getConsoleNextUrl(_0x4e4058[_0x8811f9(0x22c)],_0x8811f9(0x210)+_0x59c002['parentId']+_0x8811f9(0x22e)+_0x460561+_0x8811f9(0x1fe));};if(_0x4e4058['format']===_0x177b7d(0x206)||_0x4e4058[_0x177b7d(0x218)]===_0x177b7d(0x213))await handleSDKOutput(_0x5d6c2b,_0x4e4058);else{console[_0x177b7d(0x1f5)](a46_0x16a33d['dim']('['+_0x2713b2+']'));const _0x4d8ac9=formatTree(_0x5d6c2b,{'showMetadata':!![],'getSegmentUrl':_0x18425f,'getJourneyUrl':_0x1ffe55});console[_0x177b7d(0x1f5)](_0x4d8ac9);}return 0x0;}}
1
+ const a46_0x2ea249=a46_0x3ce5;(function(_0x23e8d4,_0x1b5da8){const _0x521441=a46_0x3ce5,_0x1bc755=_0x23e8d4();while(!![]){try{const _0x16e506=parseInt(_0x521441(0x1d5))/0x1+-parseInt(_0x521441(0x1e7))/0x2+parseInt(_0x521441(0x1b7))/0x3+-parseInt(_0x521441(0x1c9))/0x4+-parseInt(_0x521441(0x1cc))/0x5+parseInt(_0x521441(0x1e1))/0x6+-parseInt(_0x521441(0x1cf))/0x7*(-parseInt(_0x521441(0x1da))/0x8);if(_0x16e506===_0x1b5da8)break;else _0x1bc755['push'](_0x1bc755['shift']());}catch(_0x2cb67e){_0x1bc755['push'](_0x1bc755['shift']());}}}(a46_0x1440,0xa24ae));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a46_0x1440(){const _0x51682d=['\x20\x20Cause:\x20','3297030iiuCGh','/j/da','children','includes','message','name','1693008AixvEJ','json','format','listUnified','Recursive\x20mode:\x20enabled','sort','filter','\x20journey','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','resolvePathToResource','dim','parentSegment','length','✔\x20Built\x20tree\x20with\x20','(not\x20set)','log','segment','\x27...','Resolving\x20parent\x20segment\x20\x27','error','jsonl','journey','List\x20folders\x20and\x20child\x20segments','replace','Resolving\x20path\x20\x27','segments','verbose','\x5c$&','site','2485614jyGPDB','recursive','Parent\x20segment\x20context:\x20','listRecursive','Set\x20a\x20parent\x20segment\x20context\x20first:','folderId','folders','/app/ps/',',\x20and\x20','cause','\x20matching\x20\x27','localeCompare','type','✔\x20Found\x20','listWithPattern','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','maxDepth','No\x20items\x20match\x20pattern:\x20','819004IsjjeU','parentId','Parent\x20ID:\x20','1213120IUVmkk','Error:\x20No\x20parent\x20segment\x20context\x20set.','journeyBundleName','1659ugVopy','Site:\x20','journeys','Building\x20hierarchy\x20tree...','\x20folder','\x20segment','537926WzrVDm','Folder\x20ID:\x20','listUnifiedWithJourneys','folder','map','1440xdebQi','Error:\x20','/e/','data','test','(empty)'];a46_0x1440=function(){return _0x51682d;};return a46_0x1440();}function a46_0x3ce5(_0x490b29,_0xb2d02a){_0x490b29=_0x490b29-0x1b6;const _0x1440cf=a46_0x1440();let _0x3ce579=_0x1440cf[_0x490b29];return _0x3ce579;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0xee07bb from'chalk';export class SegmentsCommand extends BaseCommand{[a46_0x2ea249(0x1e6)]='segments';['description']=a46_0x2ea249(0x1fd);async['execute'](_0x290828){const _0x28edf7=a46_0x2ea249,{options:_0x4d682a,args:_0x5861e3}=_0x290828,_0x41e6a3=_0x4d682a[_0x28edf7(0x1b8)],_0x1d0b14=_0x5861e3[0x0];try{const _0x5b5145=_0x4d682a[_0x28edf7(0x1f2)];_0x4d682a['verbose']&&(console[_0x28edf7(0x1fa)](_0x28edf7(0x1d0)+_0x4d682a['site']),console[_0x28edf7(0x1fa)](_0x28edf7(0x1b9)+(_0x5b5145||_0x28edf7(0x1f5))),_0x1d0b14&&console[_0x28edf7(0x1fa)]('Folder/pattern\x20arg:\x20'+_0x1d0b14),_0x41e6a3&&console[_0x28edf7(0x1fa)](_0x28edf7(0x1eb)));if(!_0x5b5145)return console[_0x28edf7(0x1fa)](_0x28edf7(0x1cd)),console['error'](''),console[_0x28edf7(0x1fa)](_0x28edf7(0x1bb)),console[_0x28edf7(0x1fa)](_0x28edf7(0x1c6)),console[_0x28edf7(0x1fa)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x28edf7(0x1fa)](''),console[_0x28edf7(0x1fa)](_0x28edf7(0x1ef)),0x1;const _0x29f2b5=_0x1d0b14&&(_0x1d0b14[_0x28edf7(0x1e4)]('*')||_0x1d0b14[_0x28edf7(0x1e4)]('?'));if(_0x29f2b5)return await this[_0x28edf7(0x1c5)](_0x290828,_0x5b5145,_0x1d0b14);const _0x1b29cb=_0x1d0b14?_0x5b5145+'/'+_0x1d0b14:_0x5b5145;return _0x41e6a3?await this[_0x28edf7(0x1ba)](_0x290828,_0x1b29cb):await this[_0x28edf7(0x1ea)](_0x290828,_0x1b29cb);}catch(_0x267506){if(_0x267506 instanceof SDKError)return console[_0x28edf7(0x1fa)](_0x28edf7(0x1db)+_0x267506[_0x28edf7(0x1e5)]),_0x267506[_0x28edf7(0x1c0)]&&console[_0x28edf7(0x1fa)](_0x28edf7(0x1e0)+_0x267506[_0x28edf7(0x1c0)]),0x1;throw _0x267506;}}async[a46_0x2ea249(0x1c5)](_0x38487b,_0x32c13c,_0x390672){const _0x8b345=a46_0x2ea249,{options:_0x46ef00,tdx:_0x49021c}=_0x38487b,_0x13377f=await withSpinner(_0x8b345(0x1f9)+_0x32c13c+_0x8b345(0x1f8),()=>_0x49021c['segment'][_0x8b345(0x1f0)](_0x32c13c),{'verbose':_0x46ef00[_0x8b345(0x201)]}),_0x6b6800=_0x13377f[_0x8b345(0x1dd)],_0x6c701a=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x49021c[_0x8b345(0x1f7)]['listUnifiedWithJourneys'](_0x6b6800[_0x8b345(0x1ca)],_0x6b6800['folderId']),{'verbose':_0x46ef00['verbose']}),{folders:_0x1b24ad,segments:_0x1ad43f,journeys:_0x2eb927}=_0x6c701a[_0x8b345(0x1dd)],_0x175706=_0x390672[_0x8b345(0x1fe)](/[.+^${}()|[\]\\]/g,_0x8b345(0x202))[_0x8b345(0x1fe)](/\*/g,'.*')[_0x8b345(0x1fe)](/\?/g,'.'),_0x337c0a=new RegExp('^'+_0x175706+'$','i'),_0x5b4efe=_0x1b24ad[_0x8b345(0x1ed)](_0x1101d2=>_0x337c0a[_0x8b345(0x1de)](_0x1101d2['name'])),_0x1b0b76=_0x1ad43f[_0x8b345(0x1ed)](_0x3ef59e=>_0x337c0a[_0x8b345(0x1de)](_0x3ef59e[_0x8b345(0x1e6)])),_0x5ab1db=_0x2eb927['filter'](_0x4175c8=>_0x337c0a[_0x8b345(0x1de)](_0x4175c8[_0x8b345(0x1ce)])),_0x2d2266=_0x5b4efe[_0x8b345(0x1f3)]+_0x1b0b76[_0x8b345(0x1f3)]+_0x5ab1db[_0x8b345(0x1f3)];console['error']('✔\x20Found\x20'+_0x5b4efe[_0x8b345(0x1f3)]+_0x8b345(0x1d3)+(_0x5b4efe[_0x8b345(0x1f3)]!==0x1?'s':'')+',\x20'+_0x1b0b76[_0x8b345(0x1f3)]+_0x8b345(0x1d4)+(_0x1b0b76[_0x8b345(0x1f3)]!==0x1?'s':'')+',\x20and\x20'+_0x5ab1db[_0x8b345(0x1f3)]+_0x8b345(0x1ee)+(_0x5ab1db[_0x8b345(0x1f3)]!==0x1?'s':'')+_0x8b345(0x1c1)+_0x390672+'\x27');const _0x3dc5b5=_0x1d78d1=>{const _0x3341f6=_0x8b345;return getConsoleNextUrl(_0x46ef00[_0x3341f6(0x1b6)],_0x3341f6(0x1be)+_0x6b6800[_0x3341f6(0x1ca)]+_0x3341f6(0x1dc)+_0x1d78d1);},_0x28afbb=_0x46ef00[_0x8b345(0x1e9)]===_0x8b345(0x1e8)||_0x46ef00[_0x8b345(0x1e9)]===_0x8b345(0x1fb);if(_0x28afbb){const _0x5b5111=[..._0x5b4efe['map'](_0x344b36=>({..._0x344b36,'type':_0x8b345(0x1d8)})),..._0x1b0b76['map'](_0x294117=>({..._0x294117,'type':'segment','url':_0x3dc5b5(_0x294117['id'])})),..._0x5ab1db[_0x8b345(0x1d9)](_0x21b8a6=>({..._0x21b8a6,'name':_0x21b8a6[_0x8b345(0x1ce)],'type':_0x8b345(0x1fc)}))][_0x8b345(0x1ec)]((_0x29cb2f,_0x283968)=>_0x29cb2f[_0x8b345(0x1e6)][_0x8b345(0x1c2)](_0x283968[_0x8b345(0x1e6)]));await handleSDKOutput(_0x5b5111,_0x46ef00);}else{if(_0x2d2266===0x0)console[_0x8b345(0x1f6)](_0x8b345(0x1c8)+_0x390672);else{console[_0x8b345(0x1f6)](a46_0xee07bb[_0x8b345(0x1f1)]('['+_0x32c13c+']\x20matching\x20\x27'+_0x390672+'\x27'));const _0x23b035=formatFlatList(_0x5b4efe,_0x1b0b76,{'showMetadata':!![],'getSegmentUrl':_0x3dc5b5},_0x5ab1db);console[_0x8b345(0x1f6)](_0x23b035);}}return 0x0;}async[a46_0x2ea249(0x1ea)](_0x547e89,_0x296396){const _0x41690a=a46_0x2ea249,{options:_0x32392c,tdx:_0xbb3afd}=_0x547e89,_0x5d582e=await withSpinner(_0x41690a(0x1ff)+_0x296396+_0x41690a(0x1f8),()=>_0xbb3afd[_0x41690a(0x1f7)][_0x41690a(0x1f0)](_0x296396),{'verbose':_0x32392c['verbose']}),_0x3181cd=_0x5d582e['data'];_0x32392c[_0x41690a(0x201)]&&(console[_0x41690a(0x1fa)](_0x41690a(0x1cb)+_0x3181cd[_0x41690a(0x1ca)]),_0x3181cd[_0x41690a(0x1bc)]&&console[_0x41690a(0x1fa)](_0x41690a(0x1d6)+_0x3181cd[_0x41690a(0x1bc)]));const _0x2aab08=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0xbb3afd[_0x41690a(0x1f7)][_0x41690a(0x1d7)](_0x3181cd[_0x41690a(0x1ca)],_0x3181cd[_0x41690a(0x1bc)]),{'verbose':_0x32392c[_0x41690a(0x201)]}),{folders:_0xb0904f,segments:_0xfc2041,journeys:_0x32e89e}=_0x2aab08[_0x41690a(0x1dd)],_0x1579ee=_0xb0904f[_0x41690a(0x1f3)]+_0xfc2041[_0x41690a(0x1f3)]+_0x32e89e['length'];console['error'](_0x41690a(0x1c4)+_0xb0904f['length']+_0x41690a(0x1d3)+(_0xb0904f[_0x41690a(0x1f3)]!==0x1?'s':'')+',\x20'+_0xfc2041[_0x41690a(0x1f3)]+_0x41690a(0x1d4)+(_0xfc2041[_0x41690a(0x1f3)]!==0x1?'s':'')+_0x41690a(0x1bf)+_0x32e89e[_0x41690a(0x1f3)]+_0x41690a(0x1ee)+(_0x32e89e[_0x41690a(0x1f3)]!==0x1?'s':''));const _0x273ce1=_0x146275=>{const _0xd3b27f=_0x41690a;return getConsoleNextUrl(_0x32392c['site'],'/app/ps/'+_0x3181cd[_0xd3b27f(0x1ca)]+_0xd3b27f(0x1dc)+_0x146275);},_0x51b93c=_0x5e3ebd=>{const _0xc8c34e=_0x41690a;return getConsoleNextUrl(_0x32392c[_0xc8c34e(0x1b6)],_0xc8c34e(0x1be)+_0x3181cd[_0xc8c34e(0x1ca)]+'/e/'+_0x5e3ebd+_0xc8c34e(0x1e2));},_0x8ef12c=_0x32392c['format']==='json'||_0x32392c[_0x41690a(0x1e9)]===_0x41690a(0x1fb);if(_0x8ef12c){const _0x3742f3=[..._0xb0904f[_0x41690a(0x1d9)](_0x3343a3=>({..._0x3343a3,'type':_0x41690a(0x1d8)})),..._0xfc2041[_0x41690a(0x1d9)](_0x571061=>({..._0x571061,'type':_0x41690a(0x1f7),'url':_0x273ce1(_0x571061['id'])})),..._0x32e89e[_0x41690a(0x1d9)](_0xc3aea=>({..._0xc3aea,'name':_0xc3aea[_0x41690a(0x1ce)],'type':_0x41690a(0x1fc),'url':_0x51b93c(_0xc3aea['id'])}))][_0x41690a(0x1ec)]((_0xa660f0,_0x3ebf07)=>_0xa660f0[_0x41690a(0x1e6)][_0x41690a(0x1c2)](_0x3ebf07['name']));await handleSDKOutput(_0x3742f3,_0x32392c);}else{if(_0x1579ee===0x0)console[_0x41690a(0x1f6)](a46_0xee07bb[_0x41690a(0x1f1)]('['+_0x296396+']')),console[_0x41690a(0x1f6)](_0x41690a(0x1df));else{console[_0x41690a(0x1f6)](a46_0xee07bb['dim']('['+_0x296396+']'));const _0x1476c1=formatFlatList(_0xb0904f,_0xfc2041,{'showMetadata':!![],'getSegmentUrl':_0x273ce1,'getJourneyUrl':_0x51b93c},_0x32e89e);console['log'](_0x1476c1);}}return 0x0;}async[a46_0x2ea249(0x1ba)](_0x195aed,_0x30508f){const _0x3326ae=a46_0x2ea249,{options:_0x379fb6,tdx:_0x2e13bb}=_0x195aed,_0x2b7f3e=await withSpinner(_0x3326ae(0x1ff)+_0x30508f+'\x27...',()=>_0x2e13bb[_0x3326ae(0x1f7)][_0x3326ae(0x1f0)](_0x30508f),{'verbose':_0x379fb6['verbose']}),_0x3b8963=_0x2b7f3e[_0x3326ae(0x1dd)];_0x379fb6[_0x3326ae(0x201)]&&(console['error']('Parent\x20ID:\x20'+_0x3b8963[_0x3326ae(0x1ca)]),_0x3b8963[_0x3326ae(0x1bc)]&&console[_0x3326ae(0x1fa)]('Folder\x20ID:\x20'+_0x3b8963['folderId']));const _0x3fa0cf=_0x379fb6[_0x3326ae(0x1c7)]||0xa,_0x53d9da=await withSpinner(_0x3326ae(0x1d2),()=>_0x2e13bb[_0x3326ae(0x1f7)][_0x3326ae(0x1ba)](_0x3b8963[_0x3326ae(0x1ca)],_0x3b8963[_0x3326ae(0x1bc)],0x0,_0x3fa0cf),{'verbose':_0x379fb6[_0x3326ae(0x201)]}),_0x134cdc=_0x53d9da['data'],_0xf10c5b=_0x2128ee=>{const _0x38fbe1=_0x3326ae;let _0xc2882d=0x0,_0x2884ab=0x0,_0x64a826=0x0;for(const _0x55f5f7 of _0x2128ee){if(_0x55f5f7[_0x38fbe1(0x1c3)]===_0x38fbe1(0x1d8))_0xc2882d++;else{if(_0x55f5f7[_0x38fbe1(0x1c3)]===_0x38fbe1(0x1f7))_0x2884ab++;else{if(_0x55f5f7[_0x38fbe1(0x1c3)]===_0x38fbe1(0x1fc))_0x64a826++;}}if(_0x55f5f7[_0x38fbe1(0x1e3)]){const _0x3380b6=_0xf10c5b(_0x55f5f7['children']);_0xc2882d+=_0x3380b6['folders'],_0x2884ab+=_0x3380b6[_0x38fbe1(0x200)],_0x64a826+=_0x3380b6[_0x38fbe1(0x1d1)];}}return{'folders':_0xc2882d,'segments':_0x2884ab,'journeys':_0x64a826};},_0x590d1d=_0xf10c5b(_0x134cdc);console['error'](_0x3326ae(0x1f4)+_0x590d1d[_0x3326ae(0x1bd)]+_0x3326ae(0x1d3)+(_0x590d1d[_0x3326ae(0x1bd)]!==0x1?'s':'')+',\x20'+_0x590d1d['segments']+_0x3326ae(0x1d4)+(_0x590d1d[_0x3326ae(0x200)]!==0x1?'s':'')+_0x3326ae(0x1bf)+_0x590d1d[_0x3326ae(0x1d1)]+_0x3326ae(0x1ee)+(_0x590d1d[_0x3326ae(0x1d1)]!==0x1?'s':''));const _0x421b5b=_0x2bf6d7=>{const _0x2bf015=_0x3326ae;return getConsoleNextUrl(_0x379fb6[_0x2bf015(0x1b6)],_0x2bf015(0x1be)+_0x3b8963[_0x2bf015(0x1ca)]+_0x2bf015(0x1dc)+_0x2bf6d7);},_0x47f88f=_0x3b2df7=>{const _0x2bca90=_0x3326ae;return getConsoleNextUrl(_0x379fb6[_0x2bca90(0x1b6)],'/app/ps/'+_0x3b8963[_0x2bca90(0x1ca)]+'/e/'+_0x3b2df7+_0x2bca90(0x1e2));};if(_0x379fb6[_0x3326ae(0x1e9)]==='json'||_0x379fb6[_0x3326ae(0x1e9)]==='jsonl')await handleSDKOutput(_0x134cdc,_0x379fb6);else{console[_0x3326ae(0x1f6)](a46_0xee07bb['dim']('['+_0x30508f+']'));const _0x2a1525=formatTree(_0x134cdc,{'showMetadata':!![],'getSegmentUrl':_0x421b5b,'getJourneyUrl':_0x47f88f});console['log'](_0x2a1525);}return 0x0;}}
@@ -1 +1 @@
1
- const a47_0x4e9408=a47_0xf397;function a47_0x1406(){const _0x127b11=['7864662UIUfOS','data','Database:\x20','description','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','3314995PVPAqj','Catalog:\x20','Table:\x20','3256974hSElRd','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','table','length','showTable','verbose','Querying\x20','catalog','execute','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','validate','message','Usage:\x20tdx\x20show\x20<database.table>','Show\x20table\x20contents','Limit:\x20','args','\x20\x20Cause:\x20','✔\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','11SPyEHE','337155CrwZMi','185034hGqrrf','Error:\x20','28281488cHClgG','show','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','5300276CkWDFN','database','\x20row','query','error','name'];a47_0x1406=function(){return _0x127b11;};return a47_0x1406();}(function(_0x58443e,_0x3b4550){const _0x1644f3=a47_0xf397,_0x4843ad=_0x58443e();while(!![]){try{const _0x486817=-parseInt(_0x1644f3(0x1e0))/0x1*(parseInt(_0x1644f3(0x1e2))/0x2)+-parseInt(_0x1644f3(0x1cd))/0x3+-parseInt(_0x1644f3(0x1e7))/0x4+-parseInt(_0x1644f3(0x1ca))/0x5+parseInt(_0x1644f3(0x1ed))/0x6+parseInt(_0x1644f3(0x1e1))/0x7+parseInt(_0x1644f3(0x1e4))/0x8;if(_0x486817===_0x3b4550)break;else _0x4843ad['push'](_0x4843ad['shift']());}catch(_0x5bbc0f){_0x4843ad['push'](_0x4843ad['shift']());}}}(a47_0x1406,0xc3f9b));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 a47_0xf397(_0x326b10,_0x22f229){_0x326b10=_0x326b10-0x1c9;const _0x1406bf=a47_0x1406();let _0xf397c8=_0x1406bf[_0x326b10];return _0xf397c8;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a47_0x4e9408(0x1ec)]=a47_0x4e9408(0x1e5);[a47_0x4e9408(0x1f0)]=a47_0x4e9408(0x1da);async[a47_0x4e9408(0x1d5)](_0x3e7249){const _0x486a50=a47_0x4e9408;return this[_0x486a50(0x1d1)](_0x3e7249);}async[a47_0x4e9408(0x1d1)](_0xffbbd8){const _0x5eb6cf=a47_0x4e9408,{options:_0xb4a54e,args:_0x368773,tdx:_0x13cec6}=_0xffbbd8;let _0x35e6ce;try{_0x35e6ce=parseTableReference(_0x368773[0x0]);const _0x503000=_0xb4a54e[_0x5eb6cf(0x1e8)];!_0x35e6ce[_0x5eb6cf(0x1e8)]&&_0x503000&&(_0x35e6ce[_0x5eb6cf(0x1e8)]=_0x503000);const _0xb7205b=validateTableDescribeReference(_0x35e6ce);if(_0xb7205b)return console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1e3)+_0xb7205b),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1d9)),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1e6)),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1ce)),0x1;}catch(_0x5a87e5){return console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1e3)+_0x5a87e5[_0x5eb6cf(0x1d8)]),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1d9)),console[_0x5eb6cf(0x1eb)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1ce)),0x1;}const _0xb19c7f=_0x35e6ce[_0x5eb6cf(0x1d4)],_0x4351fe=_0x35e6ce[_0x5eb6cf(0x1e8)],_0x4bb41=_0x35e6ce[_0x5eb6cf(0x1cf)],_0xc98267=resolveLimit(_0xb4a54e['limit'],DEFAULT_DISPLAY_LIMIT);try{_0xb4a54e[_0x5eb6cf(0x1d2)]&&(console['error']('Site:\x20'+_0xb4a54e['site']),_0xb19c7f&&console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1cb)+_0xb19c7f),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1ef)+_0x4351fe),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1cc)+_0x4bb41),console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1db)+_0xc98267));const _0x285019=_0xb19c7f?_0xb19c7f+'.'+_0x4351fe+'.'+_0x4bb41:_0x4351fe+'.'+_0x4bb41,_0x348bb2=await withSpinner(_0x5eb6cf(0x1d3)+_0x285019+'...',()=>_0x13cec6[_0x5eb6cf(0x1ea)]['showTable'](_0x4351fe,_0x4bb41,_0xc98267,_0xb19c7f),{'verbose':_0xb4a54e[_0x5eb6cf(0x1d2)]}),_0xc6212c=_0x348bb2['data'],_0x2f4546=_0xc6212c[_0x5eb6cf(0x1ee)];return _0x2f4546[_0x5eb6cf(0x1d0)]===0x0?console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1c9)):console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1de)+_0x2f4546[_0x5eb6cf(0x1d0)]+_0x5eb6cf(0x1e9)+(_0x2f4546[_0x5eb6cf(0x1d0)]!==0x1?'s':'')+'\x20from\x20'+_0x285019),await handleSDKOutput(_0x2f4546,_0xb4a54e),0x0;}catch(_0x42cbd5){if(_0x42cbd5 instanceof SDKError)return console[_0x5eb6cf(0x1eb)]('Error:\x20'+_0x42cbd5[_0x5eb6cf(0x1d8)]),_0x42cbd5['cause']&&console[_0x5eb6cf(0x1eb)](_0x5eb6cf(0x1dd)+_0x42cbd5['cause']),0x1;throw _0x42cbd5;}}[a47_0x4e9408(0x1d7)](_0x2eb5be){const _0x46c8a1=a47_0x4e9408;if(_0x2eb5be[_0x46c8a1(0x1dc)][_0x46c8a1(0x1d0)]===0x0)return _0x46c8a1(0x1df);if(_0x2eb5be['args'][_0x46c8a1(0x1d0)]>0x1)return _0x46c8a1(0x1d6);return undefined;}}
1
+ const a47_0x2cbcc4=a47_0x4bf2;(function(_0xf20652,_0x111e87){const _0x429311=a47_0x4bf2,_0x2b4620=_0xf20652();while(!![]){try{const _0x995401=parseInt(_0x429311(0x179))/0x1*(parseInt(_0x429311(0x16d))/0x2)+parseInt(_0x429311(0x16b))/0x3*(parseInt(_0x429311(0x168))/0x4)+-parseInt(_0x429311(0x177))/0x5+parseInt(_0x429311(0x180))/0x6*(-parseInt(_0x429311(0x163))/0x7)+-parseInt(_0x429311(0x164))/0x8*(parseInt(_0x429311(0x185))/0x9)+-parseInt(_0x429311(0x16c))/0xa+parseInt(_0x429311(0x16e))/0xb;if(_0x995401===_0x111e87)break;else _0x2b4620['push'](_0x2b4620['shift']());}catch(_0x33ccb0){_0x2b4620['push'](_0x2b4620['shift']());}}}(a47_0x2a62,0x45d93));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a47_0x4bf2(_0x4efc10,_0x427735){_0x4efc10=_0x4efc10-0x162;const _0x2a6283=a47_0x2a62();let _0x4bf2bd=_0x2a6283[_0x4efc10];return _0x4bf2bd;}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{['name']=a47_0x2cbcc4(0x175);[a47_0x2cbcc4(0x165)]=a47_0x2cbcc4(0x174);async[a47_0x2cbcc4(0x17f)](_0x4fab40){const _0x591991=a47_0x2cbcc4;return this[_0x591991(0x16f)](_0x4fab40);}async[a47_0x2cbcc4(0x16f)](_0x2e0666){const _0x11ed09=a47_0x2cbcc4,{options:_0x3036cc,args:_0x9cb539,tdx:_0x267c99}=_0x2e0666;let _0x4b44a7;try{_0x4b44a7=parseTableReference(_0x9cb539[0x0]);const _0x258718=_0x3036cc[_0x11ed09(0x162)];!_0x4b44a7[_0x11ed09(0x162)]&&_0x258718&&(_0x4b44a7[_0x11ed09(0x162)]=_0x258718);const _0x161102=validateTableDescribeReference(_0x4b44a7);if(_0x161102)return console['error'](_0x11ed09(0x178)+_0x161102),console[_0x11ed09(0x189)](_0x11ed09(0x183)),console[_0x11ed09(0x189)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x11ed09(0x189)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x178592){return console['error'](_0x11ed09(0x178)+_0x178592['message']),console[_0x11ed09(0x189)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x11ed09(0x189)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x11ed09(0x189)](_0x11ed09(0x176)),0x1;}const _0x227957=_0x4b44a7['catalog'],_0x10bf5a=_0x4b44a7[_0x11ed09(0x162)],_0x18cce8=_0x4b44a7[_0x11ed09(0x172)],_0x45ee3d=resolveLimit(_0x3036cc['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x3036cc['verbose']&&(console[_0x11ed09(0x189)](_0x11ed09(0x173)+_0x3036cc['site']),_0x227957&&console[_0x11ed09(0x189)](_0x11ed09(0x166)+_0x227957),console[_0x11ed09(0x189)](_0x11ed09(0x187)+_0x10bf5a),console[_0x11ed09(0x189)](_0x11ed09(0x184)+_0x18cce8),console[_0x11ed09(0x189)](_0x11ed09(0x186)+_0x45ee3d));const _0x13f247=_0x227957?_0x227957+'.'+_0x10bf5a+'.'+_0x18cce8:_0x10bf5a+'.'+_0x18cce8,_0x50fab4=await withSpinner(_0x11ed09(0x181)+_0x13f247+_0x11ed09(0x17c),()=>_0x267c99['query'][_0x11ed09(0x16f)](_0x10bf5a,_0x18cce8,_0x45ee3d,_0x227957),{'verbose':_0x3036cc[_0x11ed09(0x170)]}),_0x11f0f4=_0x50fab4[_0x11ed09(0x18a)],_0x522b87=_0x11f0f4[_0x11ed09(0x18a)];return _0x522b87[_0x11ed09(0x17b)]===0x0?console[_0x11ed09(0x189)](_0x11ed09(0x17e)):console[_0x11ed09(0x189)](_0x11ed09(0x171)+_0x522b87[_0x11ed09(0x17b)]+_0x11ed09(0x188)+(_0x522b87['length']!==0x1?'s':'')+_0x11ed09(0x16a)+_0x13f247),await handleSDKOutput(_0x522b87,_0x3036cc),0x0;}catch(_0x14a4c0){if(_0x14a4c0 instanceof SDKError)return console[_0x11ed09(0x189)](_0x11ed09(0x178)+_0x14a4c0[_0x11ed09(0x17d)]),_0x14a4c0['cause']&&console[_0x11ed09(0x189)](_0x11ed09(0x167)+_0x14a4c0[_0x11ed09(0x169)]),0x1;throw _0x14a4c0;}}['validate'](_0x402b1f){const _0x415077=a47_0x2cbcc4;if(_0x402b1f[_0x415077(0x17a)][_0x415077(0x17b)]===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(_0x402b1f[_0x415077(0x17a)][_0x415077(0x17b)]>0x1)return _0x415077(0x182);return undefined;}}function a47_0x2a62(){const _0x450d83=['\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','2494415TyZXwS','Error:\x20','46050btPRHn','args','length','...','message','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','execute','589566WONclA','Querying\x20','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Usage:\x20tdx\x20show\x20<database.table>','Table:\x20','261CwDetq','Limit:\x20','Database:\x20','\x20row','error','data','database','21ZfWzAA','101544RvdHKK','description','Catalog:\x20','\x20\x20Cause:\x20','788MTSxJs','cause','\x20from\x20','5607uyJbNn','2898330gNRhmg','12IwlZrp','12025222DOGmuR','showTable','verbose','✔\x20Retrieved\x20','table','Site:\x20','Show\x20table\x20contents','show'];a47_0x2a62=function(){return _0x450d83;};return a47_0x2a62();}
@@ -1 +1 @@
1
- const a48_0x4890c9=a48_0x24f1;(function(_0x3e0445,_0x188123){const _0x461ac1=a48_0x24f1,_0x107571=_0x3e0445();while(!![]){try{const _0xd6104a=parseInt(_0x461ac1(0x10d))/0x1*(-parseInt(_0x461ac1(0x12c))/0x2)+-parseInt(_0x461ac1(0x111))/0x3*(-parseInt(_0x461ac1(0x119))/0x4)+-parseInt(_0x461ac1(0x11f))/0x5+-parseInt(_0x461ac1(0x11b))/0x6*(-parseInt(_0x461ac1(0x117))/0x7)+parseInt(_0x461ac1(0x122))/0x8*(-parseInt(_0x461ac1(0x108))/0x9)+parseInt(_0x461ac1(0x126))/0xa*(-parseInt(_0x461ac1(0x115))/0xb)+-parseInt(_0x461ac1(0x125))/0xc;if(_0xd6104a===_0x188123)break;else _0x107571['push'](_0x107571['shift']());}catch(_0x38d30a){_0x107571['push'](_0x107571['shift']());}}}(a48_0x5097,0x801d2));import{BaseCommand,printAuthError}from'./command.js';function a48_0x5097(){const _0x25a006=['filter','join','yellow','3wONmeA','✗\x20Validation\x20failed:\x20','CLI\x20flag','cli','3564orrLqh','red','3215023pxzeIp','bold','3609652AmRCdu','(from\x20','12piFoDs','Name:','cyan','log','877935nImGDA','site','execute','1192qRTwcN','description','profile','9787248HtaZES','50FgwFnS','account_id','dim','User:','name','Credential\x20type:\x20','67174YWnPjN','getUserInfo','displayWithSources','jobs','email','site:\x20','No\x20credential\x20found','Account\x20ID:','error','green','first_name','env','\x20profile:\x20','Show\x20authentication\x20status\x20and\x20current\x20context','status','session','16299Ommalf','TDX_PROFILE\x20env','✓\x20Authentication\x20successful\x0a','last_name','config','1LGikbK'];a48_0x5097=function(){return _0x25a006;};return a48_0x5097();}import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a48_0x24f1(_0x1851e1,_0x50be57){_0x1851e1=_0x1851e1-0x103;const _0x5097c3=a48_0x5097();let _0x24f197=_0x5097c3[_0x1851e1];return _0x24f197;}import{GlobalContext}from'../core/global-context.js';import a48_0x1b2b7e from'chalk';export class StatusCommand extends BaseCommand{[a48_0x4890c9(0x12a)]=a48_0x4890c9(0x106);[a48_0x4890c9(0x123)]=a48_0x4890c9(0x105);async[a48_0x4890c9(0x121)](_0x572901){const _0x528238=a48_0x4890c9,{options:_0x36b8d6,tdx:_0x48ac71}=_0x572901,_0x346d01=_0x36b8d6[_0x528238(0x120)],_0x419c16=new GlobalContext(_0x36b8d6),_0xa511c0=_0x419c16[_0x528238(0x124)],_0x30280f=_0x419c16['profileSource'],_0x4ce7f6=_0x30280f===_0x528238(0x114)?_0x528238(0x113):_0x30280f===_0x528238(0x107)?_0x528238(0x107):_0x30280f===_0x528238(0x103)?_0x528238(0x109):_0x30280f===_0x528238(0x10c)?_0x528238(0x10c):null,_0x4fc38d=_0xa511c0?a48_0x1b2b7e[_0x528238(0x11d)](_0xa511c0):a48_0x1b2b7e['dim']('N/A'),_0xe45b06=_0x4ce7f6?'\x20'+a48_0x1b2b7e[_0x528238(0x128)](_0x528238(0x11a)+_0x4ce7f6+')'):'';console['log'](a48_0x1b2b7e[_0x528238(0x118)]('tdx')+_0x528238(0x104)+_0x4fc38d+_0xe45b06+'\x20'+a48_0x1b2b7e[_0x528238(0x128)]('(')+_0x528238(0x131)+a48_0x1b2b7e[_0x528238(0x11d)](_0x346d01)+a48_0x1b2b7e[_0x528238(0x128)](')'));const _0x4defbd=await getOAuthTokens(_0xa511c0);if(_0x4defbd)console[_0x528238(0x11e)](_0x528238(0x12b)+a48_0x1b2b7e[_0x528238(0x11d)]('OAuth'));else{const _0x24faf5=await resolveAPIKeyAsync(_0x346d01,_0xa511c0);if(_0x24faf5){const {source:_0xeea9a9,isDeprecated:_0x1edf4d}=_0x24faf5,_0x5025a1='Read\x20credential\x20from\x20'+a48_0x1b2b7e[_0x528238(0x11d)](_0xeea9a9);console[_0x528238(0x11e)](_0x1edf4d?a48_0x1b2b7e[_0x528238(0x110)](_0x5025a1):_0x5025a1);}else console[_0x528238(0x11e)](a48_0x1b2b7e[_0x528238(0x110)](_0x528238(0x132)));}let _0x4c3d61=![];try{const _0x2e0500=await _0x48ac71[_0x528238(0x12f)][_0x528238(0x12d)]();console['log'](a48_0x1b2b7e[_0x528238(0x135)](_0x528238(0x10a))),console[_0x528238(0x11e)](a48_0x1b2b7e['bold'](_0x528238(0x129))+'\x20'+a48_0x1b2b7e['cyan'](_0x2e0500[_0x528238(0x130)]));if(_0x2e0500[_0x528238(0x136)]||_0x2e0500['last_name']){const _0x5931a2=[_0x2e0500[_0x528238(0x136)],_0x2e0500[_0x528238(0x10b)]][_0x528238(0x10e)](Boolean)[_0x528238(0x10f)]('\x20');console[_0x528238(0x11e)](a48_0x1b2b7e['bold'](_0x528238(0x11c))+'\x20'+_0x5931a2);}_0x2e0500[_0x528238(0x127)]&&console['log'](a48_0x1b2b7e[_0x528238(0x118)](_0x528238(0x133))+'\x20'+a48_0x1b2b7e['yellow'](_0x2e0500['account_id'])),_0x4c3d61=!![];}catch(_0x43d612){_0x43d612 instanceof HTTPClientError&&_0x43d612[_0x528238(0x106)]===0x191?printAuthError(_0x43d612,!![],_0xa511c0):console[_0x528238(0x134)](a48_0x1b2b7e[_0x528238(0x116)](_0x528238(0x112)+(_0x43d612 instanceof Error?_0x43d612['message']:String(_0x43d612))));}return console[_0x528238(0x11e)](),_0x419c16[_0x528238(0x12e)](),_0x4c3d61?0x0:0x1;}}
1
+ const a48_0x52f0d8=a48_0x2890;function a48_0x5893(){const _0xfabec4=['message','profileSource','1064048qHWMJn','cyan','No\x20credential\x20found','env','red','profile','account_id','site','green','session','Show\x20authentication\x20status\x20and\x20current\x20context','execute','filter','tdx','description','Account\x20ID:','4440LkhmCn','97312SIdGVO','dim','yellow','config','OAuth','displayWithSources','N/A','Credential\x20type:\x20','User:','cli','✓\x20Authentication\x20successful\x0a','✗\x20Validation\x20failed:\x20','688634mTOPZq','Read\x20credential\x20from\x20','log','last_name','first_name','\x20profile:\x20','7698gXDJyB','4739qeCecQ','getUserInfo','352115dFxlVf','join','140NKHqsF','1397871ftqrAv','2016eRapHd','Name:','CLI\x20flag','TDX_PROFILE\x20env','jobs','bold','status'];a48_0x5893=function(){return _0xfabec4;};return a48_0x5893();}(function(_0x41b294,_0x315617){const _0x1e20ef=a48_0x2890,_0x16b013=_0x41b294();while(!![]){try{const _0x2389d9=parseInt(_0x1e20ef(0x17c))/0x1+parseInt(_0x1e20ef(0x192))/0x2+parseInt(_0x1e20ef(0x189))/0x3*(parseInt(_0x1e20ef(0x1a2))/0x4)+-parseInt(_0x1e20ef(0x185))/0x5+parseInt(_0x1e20ef(0x182))/0x6*(parseInt(_0x1e20ef(0x183))/0x7)+-parseInt(_0x1e20ef(0x1a3))/0x8+-parseInt(_0x1e20ef(0x188))/0x9*(parseInt(_0x1e20ef(0x187))/0xa);if(_0x2389d9===_0x315617)break;else _0x16b013['push'](_0x16b013['shift']());}catch(_0x26a72e){_0x16b013['push'](_0x16b013['shift']());}}}(a48_0x5893,0x8d244));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a48_0x2890(_0xeca511,_0x5315a4){_0xeca511=_0xeca511-0x17c;const _0x5893f6=a48_0x5893();let _0x2890ba=_0x5893f6[_0xeca511];return _0x2890ba;}import a48_0x27436f from'chalk';export class StatusCommand extends BaseCommand{['name']=a48_0x52f0d8(0x18f);[a48_0x52f0d8(0x1a0)]=a48_0x52f0d8(0x19c);async[a48_0x52f0d8(0x19d)](_0x51ba5d){const _0x47fb2d=a48_0x52f0d8,{options:_0x136e89,tdx:_0x42b924}=_0x51ba5d,_0x5678a4=_0x136e89[_0x47fb2d(0x199)],_0x4b5bf0=new GlobalContext(_0x136e89),_0x390807=_0x4b5bf0[_0x47fb2d(0x197)],_0x236903=_0x4b5bf0[_0x47fb2d(0x191)],_0x8e705e=_0x236903===_0x47fb2d(0x1ac)?_0x47fb2d(0x18b):_0x236903===_0x47fb2d(0x19b)?_0x47fb2d(0x19b):_0x236903===_0x47fb2d(0x195)?_0x47fb2d(0x18c):_0x236903===_0x47fb2d(0x1a6)?_0x47fb2d(0x1a6):null,_0x140e33=_0x390807?a48_0x27436f[_0x47fb2d(0x193)](_0x390807):a48_0x27436f[_0x47fb2d(0x1a4)](_0x47fb2d(0x1a9)),_0x565e62=_0x8e705e?'\x20'+a48_0x27436f[_0x47fb2d(0x1a4)]('(from\x20'+_0x8e705e+')'):'';console[_0x47fb2d(0x17e)](a48_0x27436f['bold'](_0x47fb2d(0x19f))+_0x47fb2d(0x181)+_0x140e33+_0x565e62+'\x20'+a48_0x27436f[_0x47fb2d(0x1a4)]('(')+'site:\x20'+a48_0x27436f['cyan'](_0x5678a4)+a48_0x27436f[_0x47fb2d(0x1a4)](')'));const _0x350c4b=await getOAuthTokens(_0x390807);if(_0x350c4b)console[_0x47fb2d(0x17e)](_0x47fb2d(0x1aa)+a48_0x27436f[_0x47fb2d(0x193)](_0x47fb2d(0x1a7)));else{const _0x382630=await resolveAPIKeyAsync(_0x5678a4,_0x390807);if(_0x382630){const {source:_0x792455,isDeprecated:_0x3f8db2}=_0x382630,_0x35c816=_0x47fb2d(0x17d)+a48_0x27436f[_0x47fb2d(0x193)](_0x792455);console[_0x47fb2d(0x17e)](_0x3f8db2?a48_0x27436f[_0x47fb2d(0x1a5)](_0x35c816):_0x35c816);}else console['log'](a48_0x27436f[_0x47fb2d(0x1a5)](_0x47fb2d(0x194)));}let _0x583379=![];try{const _0x59ef9f=await _0x42b924[_0x47fb2d(0x18d)][_0x47fb2d(0x184)]();console[_0x47fb2d(0x17e)](a48_0x27436f[_0x47fb2d(0x19a)](_0x47fb2d(0x1ad))),console[_0x47fb2d(0x17e)](a48_0x27436f[_0x47fb2d(0x18e)](_0x47fb2d(0x1ab))+'\x20'+a48_0x27436f['cyan'](_0x59ef9f['email']));if(_0x59ef9f[_0x47fb2d(0x180)]||_0x59ef9f[_0x47fb2d(0x17f)]){const _0x3bff66=[_0x59ef9f[_0x47fb2d(0x180)],_0x59ef9f[_0x47fb2d(0x17f)]][_0x47fb2d(0x19e)](Boolean)[_0x47fb2d(0x186)]('\x20');console[_0x47fb2d(0x17e)](a48_0x27436f['bold'](_0x47fb2d(0x18a))+'\x20'+_0x3bff66);}_0x59ef9f[_0x47fb2d(0x198)]&&console['log'](a48_0x27436f[_0x47fb2d(0x18e)](_0x47fb2d(0x1a1))+'\x20'+a48_0x27436f['yellow'](_0x59ef9f[_0x47fb2d(0x198)])),_0x583379=!![];}catch(_0x247940){_0x247940 instanceof HTTPClientError&&_0x247940[_0x47fb2d(0x18f)]===0x191?printAuthError(_0x247940,!![],_0x390807):console['error'](a48_0x27436f[_0x47fb2d(0x196)](_0x47fb2d(0x1ae)+(_0x247940 instanceof Error?_0x247940[_0x47fb2d(0x190)]:String(_0x247940))));}return console['log'](),_0x4b5bf0[_0x47fb2d(0x1a8)](),_0x583379?0x0:0x1;}}