@treasuredata/tdx 2026.4.21 → 2026.4.22

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 (231) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  82. package/dist/proxy/claude-usage-tracker.js +1 -1
  83. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  84. package/dist/proxy/passthrough-server.d.ts +10 -0
  85. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/passthrough-server.js.map +1 -1
  88. package/dist/proxy/sse-usage-parser.js +1 -1
  89. package/dist/sdk/agent/agent-config.js +1 -1
  90. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  91. package/dist/sdk/agent/agent-yaml.js +1 -1
  92. package/dist/sdk/agent/test/evaluator.js +1 -1
  93. package/dist/sdk/agent/test/executor.js +1 -1
  94. package/dist/sdk/agent/test/index.js +1 -1
  95. package/dist/sdk/agent/test/output.js +1 -1
  96. package/dist/sdk/agent/test/parser.js +1 -1
  97. package/dist/sdk/agent/tool-target-registry.js +1 -1
  98. package/dist/sdk/api.js +1 -1
  99. package/dist/sdk/cas/cas-api-client.js +1 -1
  100. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  101. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  102. package/dist/sdk/cas/index.js +1 -1
  103. package/dist/sdk/cas/pull-workflow.js +1 -1
  104. package/dist/sdk/cas/push-workflow.js +1 -1
  105. package/dist/sdk/client/cdp-api-client.js +1 -1
  106. package/dist/sdk/client/delivery-api-client.js +1 -1
  107. package/dist/sdk/client/endpoints.js +1 -1
  108. package/dist/sdk/client/engage-api-client.js +1 -1
  109. package/dist/sdk/client/http-client.js +1 -1
  110. package/dist/sdk/client/llm-api-client.js +1 -1
  111. package/dist/sdk/client/oauth-refresh.js +1 -1
  112. package/dist/sdk/client/rate-limiter.js +1 -1
  113. package/dist/sdk/client/td-api-client.js +1 -1
  114. package/dist/sdk/client/trino-api-client.js +1 -1
  115. package/dist/sdk/client/workflow-client.js +1 -1
  116. package/dist/sdk/connection-validator.js +1 -1
  117. package/dist/sdk/connection.js +1 -1
  118. package/dist/sdk/delivery.js +1 -1
  119. package/dist/sdk/engage/campaign-pull.js +1 -1
  120. package/dist/sdk/engage/campaign-push.js +1 -1
  121. package/dist/sdk/engage/campaign-validator.js +1 -1
  122. package/dist/sdk/engage/campaign-yaml.js +1 -1
  123. package/dist/sdk/engage/template-pull.js +1 -1
  124. package/dist/sdk/engage/template-push.js +1 -1
  125. package/dist/sdk/engage/template-validator.js +1 -1
  126. package/dist/sdk/engage/template-yaml.js +1 -1
  127. package/dist/sdk/engage/types/campaign-def.js +1 -1
  128. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  129. package/dist/sdk/engage/types/template-schema.js +1 -1
  130. package/dist/sdk/engage.js +1 -1
  131. package/dist/sdk/errors.js +1 -1
  132. package/dist/sdk/index.js +1 -1
  133. package/dist/sdk/io/index.js +1 -1
  134. package/dist/sdk/io/node-filesystem.js +1 -1
  135. package/dist/sdk/job.js +1 -1
  136. package/dist/sdk/journey.js +1 -1
  137. package/dist/sdk/llm/chat-cache.js +1 -1
  138. package/dist/sdk/llm/index.js +1 -1
  139. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  140. package/dist/sdk/llm/model-factors.d.ts +33 -9
  141. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  142. package/dist/sdk/llm/model-factors.js +1 -1
  143. package/dist/sdk/llm/model-factors.js.map +1 -1
  144. package/dist/sdk/personalization.js +1 -1
  145. package/dist/sdk/policy.js +1 -1
  146. package/dist/sdk/query/index.js +1 -1
  147. package/dist/sdk/query/sql-parser.js +1 -1
  148. package/dist/sdk/realtime.js +1 -1
  149. package/dist/sdk/schedule.js +1 -1
  150. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  151. package/dist/sdk/segment/fields-display.js +1 -1
  152. package/dist/sdk/segment/file-discovery.js +1 -1
  153. package/dist/sdk/segment/journey-utils.js +1 -1
  154. package/dist/sdk/segment/journey-validator.js +1 -1
  155. package/dist/sdk/segment/journey-yaml.js +1 -1
  156. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  157. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  158. package/dist/sdk/segment/pull-workflow.js +1 -1
  159. package/dist/sdk/segment/push-recovery.js +1 -1
  160. package/dist/sdk/segment/push-workflow.js +1 -1
  161. package/dist/sdk/segment/resolution-context.js +1 -1
  162. package/dist/sdk/segment/segment-path-parser.js +1 -1
  163. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  164. package/dist/sdk/segment/segment-validator.js +1 -1
  165. package/dist/sdk/segment/target-resolution.js +1 -1
  166. package/dist/sdk/segment/tdx-config.js +1 -1
  167. package/dist/sdk/segment/types/activation-schema.js +1 -1
  168. package/dist/sdk/segment/types/journey-def.js +1 -1
  169. package/dist/sdk/segment/types/journey-schema.js +1 -1
  170. package/dist/sdk/segment/types/segment-def.js +1 -1
  171. package/dist/sdk/segment/types/segment-schema.js +1 -1
  172. package/dist/sdk/segment/validate-files.js +1 -1
  173. package/dist/sdk/segment/yaml-validator.js +1 -1
  174. package/dist/sdk/segment.js +1 -1
  175. package/dist/sdk/types/index.js +1 -1
  176. package/dist/sdk/types/progress.js +1 -1
  177. package/dist/sdk/types/workspace.js +1 -1
  178. package/dist/sdk/user.js +1 -1
  179. package/dist/sdk/util/format-detector.js +1 -1
  180. package/dist/sdk/util/formatters.js +1 -1
  181. package/dist/sdk/util/index.js +1 -1
  182. package/dist/sdk/util/paginate.js +1 -1
  183. package/dist/sdk/util/tree-formatter.js +1 -1
  184. package/dist/sdk/workflow/archive-validation.js +1 -1
  185. package/dist/sdk/workflow/clone-workflow.js +1 -1
  186. package/dist/sdk/workflow/index.js +1 -1
  187. package/dist/sdk/workflow/pull-workflow.js +1 -1
  188. package/dist/sdk/workflow/push-workflow.js +1 -1
  189. package/dist/sdk/workflow/task-graph.js +1 -1
  190. package/dist/sdk/workflow/tdx-config.js +1 -1
  191. package/dist/sdk/workflow/workflow-utils.js +1 -1
  192. package/dist/sdk/workspace/access-tracker.js +1 -1
  193. package/dist/sdk/workspace/frontmatter.js +1 -1
  194. package/dist/sdk/workspace/git.js +1 -1
  195. package/dist/sdk/workspace/index.js +1 -1
  196. package/dist/sdk/workspace/templates.js +1 -1
  197. package/dist/sdk/workspace/weekly.js +1 -1
  198. package/dist/sdk/workspace/wikilinks.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a39_0x2097b7=a39_0x5a39;(function(_0x25129a,_0x80c6f6){const _0xf6b0cf=a39_0x5a39,_0x32c7d8=_0x25129a();while(!![]){try{const _0xc1f24a=-parseInt(_0xf6b0cf(0x10c))/0x1*(parseInt(_0xf6b0cf(0x110))/0x2)+parseInt(_0xf6b0cf(0x122))/0x3*(-parseInt(_0xf6b0cf(0x109))/0x4)+-parseInt(_0xf6b0cf(0x117))/0x5*(parseInt(_0xf6b0cf(0x114))/0x6)+-parseInt(_0xf6b0cf(0x106))/0x7*(parseInt(_0xf6b0cf(0x10b))/0x8)+-parseInt(_0xf6b0cf(0x108))/0x9+-parseInt(_0xf6b0cf(0x124))/0xa*(parseInt(_0xf6b0cf(0x11c))/0xb)+parseInt(_0xf6b0cf(0x11a))/0xc;if(_0xc1f24a===_0x80c6f6)break;else _0x32c7d8['push'](_0x32c7d8['shift']());}catch(_0x1e48d1){_0x32c7d8['push'](_0x32c7d8['shift']());}}}(a39_0x5513,0x23522));import{BaseCommand}from'./command.js';function a39_0x5513(){const _0x592778=['jsonl','segment','6aWUlma','Parent\x20segment:\x20','description','\x27...','77262vnAbcG','Listing\x20fields\x20for\x20\x27','listFields','50PSdMzw','error','name','12279420MbxTiq','verbose','2188439yHAcQY','✔\x20Found\x20','segment:fields','execute','Error:\x20Parent\x20segment\x20name\x20is\x20required','json','39KJkhPM','length','10wcOnQR','parentSegment','List\x20available\x20fields\x20for\x20segmentation','385bepHuk','data','1472391hxojne','29152rjWjuX','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','16904nFxnBA','58778pqSBeU','Site:\x20'];a39_0x5513=function(){return _0x592778;};return a39_0x5513();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a39_0x5a39(_0x39be5f,_0x30668d){_0x39be5f=_0x39be5f-0x106;const _0x55139d=a39_0x5513();let _0x5a39b9=_0x55139d[_0x39be5f];return _0x5a39b9;}export class SegmentFieldsCommand extends BaseCommand{[a39_0x2097b7(0x119)]=a39_0x2097b7(0x11e);[a39_0x2097b7(0x112)]=a39_0x2097b7(0x126);async[a39_0x2097b7(0x11f)](_0x5d01fb){const _0x94fabf=a39_0x2097b7,{options:_0x1ca33c,args:_0xbebd3f,tdx:_0x331832}=_0x5d01fb,_0x66502e=_0xbebd3f[0x0]||_0x1ca33c[_0x94fabf(0x125)];if(!_0x66502e)return console[_0x94fabf(0x118)](_0x94fabf(0x120)),console[_0x94fabf(0x118)](_0x94fabf(0x10a)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x1ca33c[_0x94fabf(0x11b)]&&(console[_0x94fabf(0x118)](_0x94fabf(0x10d)+_0x1ca33c['site']),console['error'](_0x94fabf(0x111)+_0x66502e));const _0x4023c3=await withSpinner(_0x94fabf(0x115)+_0x66502e+_0x94fabf(0x113),()=>_0x331832[_0x94fabf(0x10f)][_0x94fabf(0x116)](_0x66502e),{'verbose':_0x1ca33c[_0x94fabf(0x11b)]}),_0x5a1e19=_0x4023c3[_0x94fabf(0x107)];console[_0x94fabf(0x118)](_0x94fabf(0x11d)+_0x5a1e19[_0x94fabf(0x123)]+'\x20field'+(_0x5a1e19[_0x94fabf(0x123)]!==0x1?'s':''));if(_0x1ca33c[_0x94fabf(0x121)]||_0x1ca33c[_0x94fabf(0x10e)])return await handleSDKOutput(_0x5a1e19,_0x1ca33c),0x0;return displayFieldsHumanReadable(_0x5a1e19,_0x66502e),0x0;}}
1
+ const a39_0x4bfc92=a39_0x1afb;(function(_0x58f2b2,_0x517b81){const _0x51f70d=a39_0x1afb,_0x3c8f06=_0x58f2b2();while(!![]){try{const _0x403787=parseInt(_0x51f70d(0x1ef))/0x1+-parseInt(_0x51f70d(0x1ec))/0x2*(parseInt(_0x51f70d(0x1e1))/0x3)+-parseInt(_0x51f70d(0x1f9))/0x4+parseInt(_0x51f70d(0x1f0))/0x5*(-parseInt(_0x51f70d(0x1e3))/0x6)+parseInt(_0x51f70d(0x1ea))/0x7+-parseInt(_0x51f70d(0x1ed))/0x8*(parseInt(_0x51f70d(0x1e0))/0x9)+-parseInt(_0x51f70d(0x1eb))/0xa*(-parseInt(_0x51f70d(0x1e4))/0xb);if(_0x403787===_0x517b81)break;else _0x3c8f06['push'](_0x3c8f06['shift']());}catch(_0x2aab7a){_0x3c8f06['push'](_0x3c8f06['shift']());}}}(a39_0x41b7,0x5f5c3));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a39_0x41b7(){const _0x2d837f=['segment','\x20field','segment:fields','json','4723404mOdsOK','142320EZFcKW','109420etyYFN','8ePFZpf','execute','765678GLKtqC','759685yEipxO','data','parentSegment','List\x20available\x20fields\x20for\x20segmentation','Parent\x20segment:\x20','jsonl','name','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','✔\x20Found\x20','1623124jVspDA','Site:\x20','2479635mGaJNr','15SLoqKJ','verbose','6vkQxMI','44ptEKfi','error'];a39_0x41b7=function(){return _0x2d837f;};return a39_0x41b7();}import{withSpinner}from'../utils/spinner.js';function a39_0x1afb(_0x3f3719,_0x52d08a){_0x3f3719=_0x3f3719-0x1e0;const _0x41b716=a39_0x41b7();let _0x1afb86=_0x41b716[_0x3f3719];return _0x1afb86;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a39_0x4bfc92(0x1f6)]=a39_0x4bfc92(0x1e8);['description']=a39_0x4bfc92(0x1f3);async[a39_0x4bfc92(0x1ee)](_0xe72934){const _0xd92da=a39_0x4bfc92,{options:_0x18dc92,args:_0x1ba91b,tdx:_0x42976b}=_0xe72934,_0x7df27=_0x1ba91b[0x0]||_0x18dc92[_0xd92da(0x1f2)];if(!_0x7df27)return console[_0xd92da(0x1e5)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0xd92da(0x1e5)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console['error'](_0xd92da(0x1f7)),0x1;_0x18dc92[_0xd92da(0x1e2)]&&(console['error'](_0xd92da(0x1fa)+_0x18dc92['site']),console['error'](_0xd92da(0x1f4)+_0x7df27));const _0xd0034e=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x7df27+'\x27...',()=>_0x42976b[_0xd92da(0x1e6)]['listFields'](_0x7df27),{'verbose':_0x18dc92[_0xd92da(0x1e2)]}),_0x3a1d11=_0xd0034e[_0xd92da(0x1f1)];console['error'](_0xd92da(0x1f8)+_0x3a1d11['length']+_0xd92da(0x1e7)+(_0x3a1d11['length']!==0x1?'s':''));if(_0x18dc92[_0xd92da(0x1e9)]||_0x18dc92[_0xd92da(0x1f5)])return await handleSDKOutput(_0x3a1d11,_0x18dc92),0x0;return displayFieldsHumanReadable(_0x3a1d11,_0x7df27),0x0;}}
@@ -1 +1 @@
1
- function a40_0x42b9(_0x34ae98,_0x7fab07){_0x34ae98=_0x34ae98-0x12a;const _0x241e9e=a40_0x241e();let _0x42b97a=_0x241e9e[_0x34ae98];return _0x42b97a;}function a40_0x241e(){const _0x3ac7e7=['journeys','\x20files\x20to\x20','47910910VvVIDV','message','counts','\x20=\x20','3536687vRuLSi','filter','179096LRltZp','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','4544712pZHnqM','parent_segment','Parent\x20segment:\x20','2311280qVdtLk','green','cyan','resourceName','pullSegments','type','5JoecbX','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)','\x27...','files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','no_parent','yes','description','\x20versions)','isNew','absolutePath','segment','dryRun','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20new\x20files','Write\x20','dim','16FZcOHK','✔\x20Pulled\x20','errorCode','parentName','session','\x20with\x20','yellow','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','verbose','setPhase','✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Context\x20set:\x20','utf-8','segments','Pulling\x20segments\x20from\x20\x27','length','Target\x20resource:\x20','\x20segments','data','targetDir','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20activations','content','3aSfolG','activations','\x20\x20🎯\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','Site:\x20','red','14233662evySDP','7866174YzjVYb','repeat','error','file','\x0aChanges\x20to\x20\x27','journeyVersions','hasChanges','segment:pull','\x0aError:','\x20journeys','helpText'];a40_0x241e=function(){return _0x3ac7e7;};return a40_0x241e();}const a40_0x2dc941=a40_0x42b9;(function(_0x5e866a,_0x3fe262){const _0x7812ad=a40_0x42b9,_0x14aeaa=_0x5e866a();while(!![]){try{const _0xb04e94=parseInt(_0x7812ad(0x154))/0x1*(-parseInt(_0x7812ad(0x138))/0x2)+-parseInt(_0x7812ad(0x16b))/0x3*(-parseInt(_0x7812ad(0x13d))/0x4)+-parseInt(_0x7812ad(0x143))/0x5*(parseInt(_0x7812ad(0x173))/0x6)+parseInt(_0x7812ad(0x136))/0x7+-parseInt(_0x7812ad(0x13a))/0x8+-parseInt(_0x7812ad(0x172))/0x9+parseInt(_0x7812ad(0x132))/0xa;if(_0xb04e94===_0x3fe262)break;else _0x14aeaa['push'](_0x14aeaa['shift']());}catch(_0x300f86){_0x14aeaa['push'](_0x14aeaa['shift']());}}}(a40_0x241e,0xef70c));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0xd5a2f8 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x4981fc from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x2dc941(0x16f)]=a40_0x2dc941(0x12c);[a40_0x2dc941(0x14a)]=a40_0x2dc941(0x150);async['execute'](_0x52b00f){const _0x2d7302=a40_0x2dc941,{options:_0x1099e5,args:_0x4b47aa,tdx:_0x543be3}=_0x52b00f,_0xd64cd0=_0x1099e5,_0x6e6f71=await resolveTarget({'arg':_0x4b47aa[0x0],'contextParent':_0x1099e5['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x6e6f71))return _0x6e6f71[_0x2d7302(0x156)]===_0x2d7302(0x148)?(console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x15a)](_0x2d7302(0x147))),console[_0x2d7302(0x175)](_0x2d7302(0x144)),console[_0x2d7302(0x175)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x2d7302(0x175)](_0x2d7302(0x139))):(console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x171)]('Error:\x20'+_0x6e6f71[_0x2d7302(0x133)]+'\x0a')),_0x6e6f71[_0x2d7302(0x12f)]&&console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x13f)](_0x6e6f71[_0x2d7302(0x12f)]))),0x1;const _0x21ec89=_0x6e6f71[_0x2d7302(0x157)],_0xd7913b=_0x6e6f71[_0x2d7302(0x167)],_0x4ee48f=_0x6e6f71[_0x2d7302(0x142)]===_0x2d7302(0x176)?_0x6e6f71[_0x2d7302(0x140)]:undefined;_0xd64cd0['verbose']&&(console[_0x2d7302(0x175)](_0x2d7302(0x170)+_0xd64cd0['site']),console[_0x2d7302(0x175)](_0x2d7302(0x13c)+_0x21ec89),_0x4ee48f&&console['error'](_0x2d7302(0x164)+_0x4ee48f));const _0x2c1d9a=await withProgressSpinner(_0x2d7302(0x162)+_0x21ec89+_0x2d7302(0x145),_0x2c9189=>_0x543be3[_0x2d7302(0x14e)][_0x2d7302(0x141)](_0x21ec89,{'targetDir':_0xd7913b,'targetResourceName':_0x4ee48f,'verbose':_0xd64cd0[_0x2d7302(0x15c)],'progress':{'update':_0xc17731=>{const _0x4e7d40=_0x2d7302;_0x2c9189[_0x4e7d40(0x15d)](_0xc17731),_0xd64cd0[_0x4e7d40(0x15c)]&&console[_0x4e7d40(0x175)]('\x20\x20'+_0xc17731);}}}),{'verbose':_0xd64cd0[_0x2d7302(0x15c)]}),_0x1d3076=_0x2c1d9a[_0x2d7302(0x166)];if(_0x1d3076[_0x2d7302(0x134)]['segments']===0x0&&_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x130)]===0x0)return console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x15a)](_0x2d7302(0x15b)+_0x1d3076['parentName']+'\x27')),0x0;const _0x4983b6=_0x1d3076['files'][_0x2d7302(0x137)](_0x863bf5=>_0x863bf5[_0x2d7302(0x14c)]),_0x1e9cef=_0x1d3076[_0x2d7302(0x146)][_0x2d7302(0x137)](_0x9d0d6f=>!_0x9d0d6f[_0x2d7302(0x14c)]&&_0x9d0d6f['hasChanges']),_0x5d6d0c=_0x1d3076[_0x2d7302(0x146)][_0x2d7302(0x137)](_0x5727cf=>!_0x5727cf[_0x2d7302(0x14c)]&&!_0x5727cf[_0x2d7302(0x12b)]);console[_0x2d7302(0x175)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1d3076['parentName']+'\x27:'),console[_0x2d7302(0x175)](_0x2d7302(0x16d)+a40_0xd5a2f8['cyan'](_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x161)]+_0x2d7302(0x165))+_0x2d7302(0x159)+a40_0xd5a2f8[_0x2d7302(0x13f)](_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x16c)]+_0x2d7302(0x169)));if(_0x1d3076['counts']['journeys']>0x0){const _0x15be23=_0x1d3076['counts'][_0x2d7302(0x12a)]>_0x1d3076['counts'][_0x2d7302(0x130)]?'\x20('+_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x12a)]+_0x2d7302(0x14b):'';console[_0x2d7302(0x175)]('\x20\x20🗺️\x20\x20'+a40_0xd5a2f8[_0x2d7302(0x13f)](_0x1d3076[_0x2d7302(0x134)][_0x2d7302(0x130)]+_0x2d7302(0x12e))+a40_0xd5a2f8[_0x2d7302(0x153)](_0x15be23));}console[_0x2d7302(0x175)]('\x20\x20'+a40_0xd5a2f8[_0x2d7302(0x13e)]('+\x20'+_0x4983b6[_0x2d7302(0x163)]+_0x2d7302(0x151))),console['error']('\x20\x20'+a40_0xd5a2f8[_0x2d7302(0x15a)]('~\x20'+_0x1e9cef[_0x2d7302(0x163)]+'\x20changed\x20files')),console[_0x2d7302(0x175)]('\x20\x20'+a40_0xd5a2f8[_0x2d7302(0x153)]('=\x20'+_0x5d6d0c[_0x2d7302(0x163)]+'\x20unchanged\x20files')),console[_0x2d7302(0x175)]('\x20\x20Target:\x20'+a40_0xd5a2f8[_0x2d7302(0x13f)](_0x1d3076['targetDir'])+'\x0a');if(_0x1e9cef[_0x2d7302(0x163)]>0x0)for(const _0x350969 of _0x1e9cef){console['error'](_0x2d7302(0x177)+_0x350969['relativePath']+'\x27:'),console[_0x2d7302(0x175)]('─'[_0x2d7302(0x174)](0x3c)),console[_0x2d7302(0x175)](_0x350969['diff']),console[_0x2d7302(0x175)]('─'[_0x2d7302(0x174)](0x3c));}if(_0xd64cd0[_0x2d7302(0x14f)])return console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x15a)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4983b6['length']===0x0&&_0x1e9cef[_0x2d7302(0x163)]===0x0)return console[_0x2d7302(0x175)](a40_0xd5a2f8['green'](_0x2d7302(0x15e))),saveSessionContext({'parent_segment':_0x1d3076[_0x2d7302(0x157)]},_0xd64cd0[_0x2d7302(0x158)]),console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x13e)](_0x2d7302(0x15f)+a40_0xd5a2f8['dim'](_0x2d7302(0x13b))+_0x2d7302(0x135)+a40_0xd5a2f8['cyan'](_0x1d3076[_0x2d7302(0x157)]))),0x0;if(!_0xd64cd0[_0x2d7302(0x149)]){if(!isInteractive())return console['error'](a40_0xd5a2f8['red'](_0x2d7302(0x12d)),_0x2d7302(0x168)),console[_0x2d7302(0x175)](a40_0xd5a2f8['dim'](_0x2d7302(0x16e))),0x1;const _0x178bef=await confirmKey(_0x2d7302(0x152)+(_0x4983b6[_0x2d7302(0x163)]+_0x1e9cef[_0x2d7302(0x163)])+'\x20files?');if(!_0x178bef)return console['error'](a40_0xd5a2f8[_0x2d7302(0x15a)]('Aborted.'),'-\x20no\x20files\x20written'),0x1;}for(const _0x1a3538 of _0x1d3076['files']){if(_0x1a3538[_0x2d7302(0x14c)]||_0x1a3538[_0x2d7302(0x12b)]){const _0xfda52e=a40_0x4981fc['dirname'](_0x1a3538['absolutePath']);!existsSync(_0xfda52e)&&mkdirSync(_0xfda52e,{'recursive':!![]}),writeFileSync(_0x1a3538[_0x2d7302(0x14d)],_0x1a3538[_0x2d7302(0x16a)],_0x2d7302(0x160));}}return console[_0x2d7302(0x175)](a40_0xd5a2f8['green'](_0x2d7302(0x155)+(_0x4983b6[_0x2d7302(0x163)]+_0x1e9cef['length'])+_0x2d7302(0x131)+_0x1d3076[_0x2d7302(0x167)])),saveSessionContext({'parent_segment':_0x1d3076[_0x2d7302(0x157)]},_0xd64cd0[_0x2d7302(0x158)]),console[_0x2d7302(0x175)](a40_0xd5a2f8[_0x2d7302(0x13e)]('✔\x20Context\x20set:\x20'+a40_0xd5a2f8[_0x2d7302(0x153)](_0x2d7302(0x13b))+_0x2d7302(0x135)+a40_0xd5a2f8[_0x2d7302(0x13f)](_0x1d3076[_0x2d7302(0x157)]))),0x0;}}
1
+ const a40_0x166adf=a40_0xd00e;function a40_0x1239(){const _0x21ec7f=['Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','description','3085722XxjQBg','isNew','helpText','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20=\x20','\x20new\x20files','\x20files?','4cGwPzf','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','7149785NiJkGU','Aborted.','files','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','relativePath','activations','segments','red','repeat','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','verbose','message','\x20changed\x20files','Write\x20','80mLhDpP','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','✔\x20Context\x20set:\x20','hasChanges','yellow','parentName','site','filter','errorCode','\x0aError:','dryRun','file','targetDir','40jOAUxO','\x20\x20🗺️\x20\x20','data','counts','\x0aPull\x20summary\x20for\x20\x27','content','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20with\x20','journeyVersions','2442492pCDvjV','\x20\x20🎯\x20','\x20unchanged\x20files','Target\x20resource:\x20','105159eusMFC','green','4754708FSxWmP','✔\x20Pulled\x20','parent_segment','absolutePath','cyan','dim','journeys','\x20segments','Parent\x20segment:\x20','dirname','execute','Site:\x20','40485400VIcvpm','✔\x20All\x20files\x20are\x20up\x20to\x20date','yes','\x20files\x20to\x20','665426kTOmFd','error','segment:pull','parentSegment','length','session'];a40_0x1239=function(){return _0x21ec7f;};return a40_0x1239();}(function(_0x1d4bd6,_0x5dcdd3){const _0x3962f3=a40_0xd00e,_0x3a78d2=_0x1d4bd6();while(!![]){try{const _0xf0c97e=-parseInt(_0x3962f3(0x168))/0x1+-parseInt(_0x3962f3(0x13c))/0x2*(-parseInt(_0x3962f3(0x156))/0x3)+-parseInt(_0x3962f3(0x12c))/0x4*(parseInt(_0x3962f3(0x12e))/0x5)+-parseInt(_0x3962f3(0x125))/0x6+-parseInt(_0x3962f3(0x158))/0x7+parseInt(_0x3962f3(0x149))/0x8*(-parseInt(_0x3962f3(0x152))/0x9)+parseInt(_0x3962f3(0x164))/0xa;if(_0xf0c97e===_0x5dcdd3)break;else _0x3a78d2['push'](_0x3a78d2['shift']());}catch(_0x4e6a10){_0x3a78d2['push'](_0x3a78d2['shift']());}}}(a40_0x1239,0xc47c6));function a40_0xd00e(_0x54e8e9,_0x5a76d9){_0x54e8e9=_0x54e8e9-0x124;const _0x1239b3=a40_0x1239();let _0xd00e28=_0x1239b3[_0x54e8e9];return _0xd00e28;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x47ec77 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x24a184 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a40_0x166adf(0x16a);[a40_0x166adf(0x124)]=a40_0x166adf(0x12d);async[a40_0x166adf(0x162)](_0x3b9d6d){const _0x1bbf46=a40_0x166adf,{options:_0x5cbcaf,args:_0x1def02,tdx:_0xf72d98}=_0x3b9d6d,_0x5629dc=_0x5cbcaf,_0x22bef6=await resolveTarget({'arg':_0x1def02[0x0],'contextParent':_0x5cbcaf[_0x1bbf46(0x16b)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x22bef6))return _0x22bef6[_0x1bbf46(0x144)]==='no_parent'?(console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x140)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x1bbf46(0x16e)),console[_0x1bbf46(0x169)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x1bbf46(0x169)](_0x1bbf46(0x13d))):(console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x135)]('Error:\x20'+_0x22bef6[_0x1bbf46(0x139)]+'\x0a')),_0x22bef6[_0x1bbf46(0x127)]&&console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x15c)](_0x22bef6[_0x1bbf46(0x127)]))),0x1;const _0x4d40b6=_0x22bef6[_0x1bbf46(0x141)],_0x498f00=_0x22bef6[_0x1bbf46(0x148)],_0x44f8c4=_0x22bef6['type']===_0x1bbf46(0x147)?_0x22bef6['resourceName']:undefined;_0x5629dc['verbose']&&(console[_0x1bbf46(0x169)](_0x1bbf46(0x163)+_0x5629dc[_0x1bbf46(0x142)]),console[_0x1bbf46(0x169)](_0x1bbf46(0x160)+_0x4d40b6),_0x44f8c4&&console[_0x1bbf46(0x169)](_0x1bbf46(0x155)+_0x44f8c4));const _0x4f9f97=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4d40b6+'\x27...',_0x1c6b00=>_0xf72d98['segment']['pullSegments'](_0x4d40b6,{'targetDir':_0x498f00,'targetResourceName':_0x44f8c4,'verbose':_0x5629dc[_0x1bbf46(0x138)],'progress':{'update':_0x372cf4=>{const _0x132e00=_0x1bbf46;_0x1c6b00['setPhase'](_0x372cf4),_0x5629dc[_0x132e00(0x138)]&&console['error']('\x20\x20'+_0x372cf4);}}}),{'verbose':_0x5629dc['verbose']}),_0x262f31=_0x4f9f97[_0x1bbf46(0x14b)];if(_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x134)]===0x0&&_0x262f31[_0x1bbf46(0x14c)]['journeys']===0x0)return console['error'](a40_0x47ec77[_0x1bbf46(0x140)](_0x1bbf46(0x131)+_0x262f31[_0x1bbf46(0x141)]+'\x27')),0x0;const _0x3714a2=_0x262f31['files'][_0x1bbf46(0x143)](_0xfbe879=>_0xfbe879[_0x1bbf46(0x126)]),_0x27ad11=_0x262f31['files']['filter'](_0x4ce01f=>!_0x4ce01f[_0x1bbf46(0x126)]&&_0x4ce01f[_0x1bbf46(0x13f)]),_0x2191c0=_0x262f31['files'][_0x1bbf46(0x143)](_0x2cf6f7=>!_0x2cf6f7[_0x1bbf46(0x126)]&&!_0x2cf6f7[_0x1bbf46(0x13f)]);console[_0x1bbf46(0x169)](_0x1bbf46(0x14d)+_0x262f31[_0x1bbf46(0x141)]+'\x27:'),console['error'](_0x1bbf46(0x153)+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x134)]+_0x1bbf46(0x15f))+_0x1bbf46(0x150)+a40_0x47ec77['cyan'](_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x133)]+'\x20activations'));if(_0x262f31['counts'][_0x1bbf46(0x15e)]>0x0){const _0xfd8aa3=_0x262f31['counts'][_0x1bbf46(0x151)]>_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x15e)]?'\x20('+_0x262f31[_0x1bbf46(0x14c)][_0x1bbf46(0x151)]+'\x20versions)':'';console['error'](_0x1bbf46(0x14a)+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31['counts'][_0x1bbf46(0x15e)]+'\x20journeys')+a40_0x47ec77[_0x1bbf46(0x15d)](_0xfd8aa3));}console[_0x1bbf46(0x169)]('\x20\x20'+a40_0x47ec77[_0x1bbf46(0x157)]('+\x20'+_0x3714a2[_0x1bbf46(0x16c)]+_0x1bbf46(0x12a))),console[_0x1bbf46(0x169)]('\x20\x20'+a40_0x47ec77[_0x1bbf46(0x140)]('~\x20'+_0x27ad11[_0x1bbf46(0x16c)]+_0x1bbf46(0x13a))),console['error']('\x20\x20'+a40_0x47ec77[_0x1bbf46(0x15d)]('=\x20'+_0x2191c0['length']+_0x1bbf46(0x154))),console[_0x1bbf46(0x169)]('\x20\x20Target:\x20'+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31[_0x1bbf46(0x148)])+'\x0a');if(_0x27ad11[_0x1bbf46(0x16c)]>0x0)for(const _0x500df6 of _0x27ad11){console['error']('\x0aChanges\x20to\x20\x27'+_0x500df6[_0x1bbf46(0x132)]+'\x27:'),console[_0x1bbf46(0x169)]('─'[_0x1bbf46(0x136)](0x3c)),console[_0x1bbf46(0x169)](_0x500df6['diff']),console['error']('─'[_0x1bbf46(0x136)](0x3c));}if(_0x5629dc[_0x1bbf46(0x146)])return console[_0x1bbf46(0x169)](a40_0x47ec77['yellow'](_0x1bbf46(0x128))),0x0;if(_0x3714a2[_0x1bbf46(0x16c)]===0x0&&_0x27ad11['length']===0x0)return console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x157)](_0x1bbf46(0x165))),saveSessionContext({'parent_segment':_0x262f31[_0x1bbf46(0x141)]},_0x5629dc[_0x1bbf46(0x16d)]),console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x157)]('✔\x20Context\x20set:\x20'+a40_0x47ec77[_0x1bbf46(0x15d)](_0x1bbf46(0x15a))+_0x1bbf46(0x129)+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31[_0x1bbf46(0x141)]))),0x0;if(!_0x5629dc[_0x1bbf46(0x166)]){if(!isInteractive())return console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x135)](_0x1bbf46(0x145)),_0x1bbf46(0x137)),console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x15d)](_0x1bbf46(0x14f))),0x1;const _0x5dc3ac=await confirmKey(_0x1bbf46(0x13b)+(_0x3714a2['length']+_0x27ad11[_0x1bbf46(0x16c)])+_0x1bbf46(0x12b));if(!_0x5dc3ac)return console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x140)](_0x1bbf46(0x12f)),'-\x20no\x20files\x20written'),0x1;}for(const _0x26c7a0 of _0x262f31[_0x1bbf46(0x130)]){if(_0x26c7a0['isNew']||_0x26c7a0['hasChanges']){const _0x4768eb=a40_0x24a184[_0x1bbf46(0x161)](_0x26c7a0[_0x1bbf46(0x15b)]);!existsSync(_0x4768eb)&&mkdirSync(_0x4768eb,{'recursive':!![]}),writeFileSync(_0x26c7a0['absolutePath'],_0x26c7a0[_0x1bbf46(0x14e)],'utf-8');}}return console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x157)](_0x1bbf46(0x159)+(_0x3714a2[_0x1bbf46(0x16c)]+_0x27ad11[_0x1bbf46(0x16c)])+_0x1bbf46(0x167)+_0x262f31['targetDir'])),saveSessionContext({'parent_segment':_0x262f31[_0x1bbf46(0x141)]},_0x5629dc[_0x1bbf46(0x16d)]),console[_0x1bbf46(0x169)](a40_0x47ec77[_0x1bbf46(0x157)](_0x1bbf46(0x13e)+a40_0x47ec77[_0x1bbf46(0x15d)](_0x1bbf46(0x15a))+_0x1bbf46(0x129)+a40_0x47ec77[_0x1bbf46(0x15c)](_0x262f31[_0x1bbf46(0x141)]))),0x0;}}
@@ -1 +1 @@
1
- const a41_0x79893=a41_0x340d;(function(_0x48b58f,_0x6326e2){const _0x30c834=a41_0x340d,_0x47f288=_0x48b58f();while(!![]){try{const _0x21295c=parseInt(_0x30c834(0xc7))/0x1*(-parseInt(_0x30c834(0x110))/0x2)+-parseInt(_0x30c834(0xd9))/0x3+-parseInt(_0x30c834(0x12c))/0x4+parseInt(_0x30c834(0xe5))/0x5*(-parseInt(_0x30c834(0x11e))/0x6)+parseInt(_0x30c834(0x12b))/0x7*(parseInt(_0x30c834(0xb7))/0x8)+-parseInt(_0x30c834(0xd8))/0x9+parseInt(_0x30c834(0x136))/0xa;if(_0x21295c===_0x6326e2)break;else _0x47f288['push'](_0x47f288['shift']());}catch(_0x278542){_0x47f288['push'](_0x47f288['shift']());}}}(a41_0xf5da,0x49ead));import{BaseCommand}from'./command.js';function a41_0x340d(_0x560fcb,_0x5cbb6b){_0x560fcb=_0x560fcb-0xaa;const _0xf5da4=a41_0xf5da();let _0x340d09=_0xf5da4[_0x560fcb];return _0x340d09;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0xf5da(){const _0x3248bc=['\x20activations]','folderId','\x20changes?','activations','\x20\x20Activations:','endsWith','new','\x20updated','Error:\x20Directory\x20not\x20found:\x20','\x20to\x20delete','name','\x20\x20🗺️\x20\x20Journeys:','121824csiOoq','site','Changes\x20to\x20journey:','journeyBundleName','red','paused','journey','Preparing\x20journeys...','folderPath','created','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','yamlConfig','parent_name','\x20\x20Activations:\x20','\x20to\x20update','\x20\x20Segments:\x20','285133bfnTzZ','getJourney','Push\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','journeyBundleId','error','Delete\x20segment:','updatedAt','listFolders','Folders\x20to\x20create:','/e/','Parent\x20segment:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20changed','results','3617622vkzRHE','352647ZipcqR','Delete\x20journey:','existingJourney','\x20\x20\x20\x20','setPhase','/j/da/je','\x20folders\x20to\x20create','deleted','unchanged','scopedFolderPath','journeyId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','965aiFzkD','parentName','segment\x20or\x20journey','createdSegmentIds','Aborted.','toString','journeysOnly','\x20deleted','Error\x20parsing\x20YAML:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','isNew','\x20created','repeat','.yml','isScoped','description','\x27...','/sb/da/esr','\x20\x20Journeys:\x20','parentFolder','\x20unchanged','Fetching\x20connections\x20for\x20name\x20resolution...','push','diff','New\x20segment:','getParent','dryRun','listJourneysWithDetailsFromParentSegment','\x0aValidation\x20failed:','toDelete','errorCode','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','segment:push','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','length','listSegments','execute','Error:\x20','\x0a✔\x20Push\x20complete','relationships','\x20YAML\x20files\x20found','yellow','journeys','4KZLGGk','Changes\x20to:','get','green','segment','toCreate','/app/ps/','nameToType','connection','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x0aPush\x20summary\x20for\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','segmentFolderId','delete','8634DamhlS','filePath','\x20new','folders','data','type','existingSegment','segments','parentSegment','.yaml','then','verbose','📁\x20','245xQVroj','1975280vjqgPn','listActivations','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','(Journey\x20will\x20be\x20deleted)','cyan','helpText','filter','map','\x20\x20📊\x20Segments:','user','16311050HfgNDr','blue','attributes','all','idToName','dim','nameToId','no_parent','cwd','toUpdate','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','join','\x20to\x20create','updated','add'];a41_0xf5da=function(){return _0x3248bc;};return a41_0xf5da();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x2f0101 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a41_0x79893(0x105);[a41_0x79893(0xf4)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0x79893(0x109)](_0x4e803d){const _0x22acb8=a41_0x79893,{options:_0x1a8143,args:_0x36db88,tdx:_0x1e52a1}=_0x4e803d,_0x1b9e3c=_0x1a8143,_0x4affcf=await resolveTarget({'arg':_0x36db88[0x0],'contextParent':_0x1a8143[_0x22acb8(0x126)],'cwd':process[_0x22acb8(0x13e)]()});if(!isSuccessfulResolution(_0x4affcf))return _0x4affcf[_0x22acb8(0x103)]===_0x22acb8(0x13d)?(console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xc1))),console[_0x22acb8(0xcc)](_0x22acb8(0x119)),console[_0x22acb8(0xcc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x22acb8(0xcc)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0x10a)+_0x4affcf['message']+'\x0a')),_0x4affcf['helpText']&&console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x130)](_0x4affcf[_0x22acb8(0x131)]))),0x1;if(_0x4affcf[_0x22acb8(0x123)]===_0x22acb8(0xc3))return console['error'](a41_0x2f0101[_0x22acb8(0xbb)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4affcf['targetDir']+'\x0a')),console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x130)](_0x22acb8(0xe4))),0x1;const _0x132128=_0x4affcf[_0x22acb8(0xe6)],_0x21a5b5=_0x4affcf['targetDir'],_0x815ab4=_0x4affcf['type']==='file'?_0x4affcf[_0x22acb8(0x11f)]:undefined,_0x3874ae=getScopedDetails(_0x4affcf),_0x2279a7=_0x3874ae?.[_0x22acb8(0xf3)]??![],_0x326f80=_0x3874ae?.[_0x22acb8(0xe2)]??'';if(!existsSync(_0x21a5b5))return console[_0x22acb8(0xcc)](a41_0x2f0101['red'](_0x22acb8(0xb3)+_0x21a5b5+'\x0a')),console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x130)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x1b9e3c[_0x22acb8(0x129)]&&(console[_0x22acb8(0xcc)]('Site:\x20'+_0x1b9e3c[_0x22acb8(0xb8)]),console['error'](_0x22acb8(0xd2)+_0x132128),console[_0x22acb8(0xcc)]('Source\x20directory:\x20'+_0x21a5b5),_0x2279a7&&console[_0x22acb8(0xcc)]('Scoped\x20to\x20folder:\x20'+_0x326f80));const _0x2317a7=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x132128+_0x22acb8(0xf5),()=>_0x1e52a1[_0x22acb8(0x114)]['resolveParentId'](_0x132128),{'verbose':_0x1b9e3c[_0x22acb8(0x129)]}),_0x4f0c6f=_0x2317a7[_0x22acb8(0x122)],{parentSegmentResult:_0x3bb183,segmentsResult:_0x4b6c67,foldersResult:_0x12601b,journeysWithDetailsResult:_0x31acfc,userMaps:_0x4c2425}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x3f779e=_0x22acb8,[_0x14fbd7,_0x4822d4,_0x13a486,_0x47238b,_0xa59a62]=await Promise[_0x3f779e(0x139)]([_0x1e52a1['segment'][_0x3f779e(0xfe)](_0x4f0c6f),_0x1e52a1[_0x3f779e(0x114)][_0x3f779e(0x108)](_0x4f0c6f),_0x1e52a1[_0x3f779e(0x114)][_0x3f779e(0xcf)](_0x4f0c6f),_0x1e52a1['journey'][_0x3f779e(0x100)](_0x4f0c6f,{'includeAllVersions':!![]}),_0x1e52a1[_0x3f779e(0x135)]['buildUserMaps']()]);return{'parentSegmentResult':_0x14fbd7,'segmentsResult':_0x4822d4,'foldersResult':_0x13a486,'journeysWithDetailsResult':_0x47238b,'userMaps':_0xa59a62};},{'verbose':_0x1b9e3c[_0x22acb8(0x129)]})[_0x22acb8(0x128)](_0xe6f814=>_0xe6f814['data']),_0x10f0d3=_0x3bb183,_0x2e6077=extractRootFolderId(_0x10f0d3),_0x14b892=_0x4b6c67,_0x32733a=_0x12601b,{journeys:_0xff83d5,activationStepsById:_0x8feedb}=_0x31acfc,_0xa15b21=new Map(_0xff83d5['map'](_0x394a43=>[_0x394a43['id'],_0x394a43])),_0x1be8d3=_0xff83d5[_0x22acb8(0x133)](_0x713bc9=>({'id':_0x713bc9['id'],'name':_0x713bc9[_0x22acb8(0x138)]['name'],'journeyBundleName':_0x713bc9['attributes'][_0x22acb8(0xba)]||'','journeyBundleId':_0x713bc9['attributes'][_0x22acb8(0xcb)]||'','versionNumber':_0x713bc9[_0x22acb8(0x138)]['versionNumber'],'description':_0x713bc9[_0x22acb8(0x138)][_0x22acb8(0xf4)],'state':_0x713bc9['attributes']['state'],'paused':_0x713bc9[_0x22acb8(0x138)][_0x22acb8(0xbc)],'audienceId':_0x713bc9[_0x22acb8(0x138)]['audienceId'],'folderId':_0x713bc9[_0x22acb8(0x10c)]?.[_0x22acb8(0xf8)]?.[_0x22acb8(0x122)]?.['id'],'createdAt':_0x713bc9[_0x22acb8(0x138)]['createdAt'],'updatedAt':_0x713bc9[_0x22acb8(0x138)][_0x22acb8(0xce)]})),{emailToId:_0x189968,idToEmail:_0x4ac6b}=_0x4c2425,_0x4701ef=await withSpinner(_0x22acb8(0xfa),async()=>{const _0x45b7d0=_0x22acb8,_0x57f05f=await _0x1e52a1[_0x45b7d0(0x118)]['list']();return buildConnectionMaps(_0x57f05f);},{'verbose':_0x1b9e3c['verbose']})[_0x22acb8(0x128)](_0xcde134=>_0xcde134[_0x22acb8(0x122)]),_0x15d62f=_0x4701ef[_0x22acb8(0x13c)],_0x23db79=_0x4701ef[_0x22acb8(0x13a)],_0xa43f3c=_0x4701ef[_0x22acb8(0x117)],_0xddf6b3={'emailToIdMap':_0x189968,'connectionNameToIdMap':_0x15d62f,'connectionNameToTypeMap':_0xa43f3c,'getSchema':_0x45ab59=>_0x1e52a1[_0x22acb8(0x118)]['getOutputSchemaWithCache'](_0x45ab59)};let {pathToId:_0x5e69c9,idToPath:_0x3d6fb6}=buildFolderMaps(_0x32733a);const _0x1421a6=buildSegmentLookupMap(_0x14b892,_0x3d6fb6),_0x193102=buildSegmentNameToIdMap(_0x14b892),_0x30d30d=buildJourneyBundleLookupMap(_0x1be8d3,_0x3d6fb6);let _0x4494d3;if(_0x815ab4){if(!_0x815ab4['endsWith'](_0x22acb8(0xf2))&&!_0x815ab4[_0x22acb8(0xb0)](_0x22acb8(0x127)))return console['error'](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0x11b)+_0x815ab4+'\x0a')),0x1;_0x4494d3=[_0x815ab4];}else _0x4494d3=findYamlFiles(_0x21a5b5);if(_0x4494d3[_0x22acb8(0x107)]===0x0)return console['error'](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0x104)+_0x21a5b5+'\x0a')),console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x130)](_0x22acb8(0xd3))),0x1;let _0x1ca83c,_0x5c001b;try{const _0x3096ca=parseAndClassifyYamlFiles(_0x4494d3,_0x21a5b5,{'skipSegments':_0x1b9e3c['journeysOnly']});_0x1ca83c=_0x3096ca[_0x22acb8(0x125)],_0x5c001b=_0x3096ca[_0x22acb8(0x10f)];const _0x1e6fc4=validateParsedFiles(_0x3096ca,_0x21a5b5);if(_0x1e6fc4['length']>0x0)return console['error'](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0x101))),console['error'](formatValidationErrors(_0x1e6fc4)),console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xd4))),0x1;}catch(_0x582bfe){return console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0xed)+(_0x582bfe instanceof Error?_0x582bfe['message']:_0x582bfe))),0x1;}if(_0x1ca83c[_0x22acb8(0x107)]===0x0&&_0x5c001b[_0x22acb8(0x107)]===0x0){const _0x217c20=_0x1b9e3c['journeysOnly']?_0x22acb8(0xbd):_0x22acb8(0xe7);return console['error'](a41_0x2f0101[_0x22acb8(0x10e)]('No\x20'+_0x217c20+_0x22acb8(0x10d))),0x0;}const _0x38f6c5=new Map();_0x14b892[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x14b892,async _0x209b1a=>{const _0x4bbaf5=a41_0x340d,_0x54a424=await _0x1e52a1[_0x4bbaf5(0x114)][_0x4bbaf5(0x12d)](_0x4f0c6f,_0x209b1a['id']);_0x38f6c5['set'](_0x209b1a['id'],_0x54a424);});},{'verbose':_0x1b9e3c[_0x22acb8(0x129)]});const {segmentFiles:_0x589139,foldersToCreate:_0x1855f2}=await prepareSegmentFiles(_0x1ca83c,{'segmentByFolderAndName':_0x1421a6,'activationsBySegmentId':_0x38f6c5,'folderPathToId':_0x5e69c9,'idToEmailMap':_0x4ac6b,'connectionIdToNameMap':_0x23db79},_0xddf6b3,_0x2279a7,_0x326f80),_0x117c02=_0x815ab4?[]:findSegmentsToDelete(_0x14b892,_0x1ca83c[_0x22acb8(0x133)](({yamlConfig:_0x203a02,folderPath:_0x28fb63})=>({'yamlConfig':_0x203a02,'folderPath':resolveTDFolderPath(_0x28fb63,_0x2279a7,_0x326f80)})),_0x3d6fb6,_0x326f80,_0x2279a7),{journeyFiles:_0x19e079,foldersToCreate:_0x290b68}=await withProgressSpinner(_0x22acb8(0xbe),async _0x51e617=>prepareJourneyFiles(_0x5c001b,{'fetchJourney':async _0x4e756b=>_0x1e52a1[_0x22acb8(0xbd)][_0x22acb8(0xc8)](_0x4e756b[_0x22acb8(0xe3)]),'journeyBundlesByFolderAndName':_0x30d30d,'folderPathToId':_0x5e69c9,'idToEmailMap':_0x4ac6b,'connectionIdToNameMap':_0x23db79,'existingSegments':_0x14b892,'parentId':_0x4f0c6f,'deps':_0x1e52a1,'progress':{'update':_0x219863=>{const _0x48074f=_0x22acb8;_0x51e617[_0x48074f(0xdd)](_0x219863),_0x1b9e3c[_0x48074f(0x129)]&&console[_0x48074f(0xcc)]('\x20\x20'+_0x219863);}},'journeyById':_0xa15b21,'activationStepsById':_0x8feedb},_0x2279a7,_0x326f80),{'verbose':_0x1b9e3c['verbose']})[_0x22acb8(0x128)](_0x4bf370=>_0x4bf370[_0x22acb8(0x122)]);for(const _0x38468e of _0x290b68){_0x1855f2[_0x22acb8(0xaa)](_0x38468e);}const _0x45b9fa=_0x815ab4?[]:findJourneysToDelete(_0x1be8d3,_0x5c001b[_0x22acb8(0x133)](({yamlConfig:_0x2ed121,folderPath:_0x1bbf34})=>({'yamlConfig':_0x2ed121,'folderPath':resolveTDFolderPath(_0x1bbf34,_0x2279a7,_0x326f80)})),_0x3d6fb6,_0x326f80,_0x2279a7),_0x28de9b=calculatePushStats(_0x589139,_0x19e079,_0x1855f2,_0x117c02,_0x45b9fa,!!_0x1b9e3c['delete'],!!_0x1b9e3c[_0x22acb8(0xeb)]),_0x3eee29=_0x28de9b[_0x22acb8(0x125)]['new'],_0x5e12d7=_0x28de9b[_0x22acb8(0x125)]['changed'],_0x219fa0=_0x28de9b[_0x22acb8(0x125)]['unchanged'],_0x323e17=_0x28de9b['segments'][_0x22acb8(0x102)],_0x545702=_0x28de9b[_0x22acb8(0x121)][_0x22acb8(0x115)],_0x4d3292=_0x28de9b[_0x22acb8(0x10f)][_0x22acb8(0xb1)],_0x5d5768=_0x28de9b[_0x22acb8(0x10f)]['changed'],_0x289481=_0x28de9b[_0x22acb8(0x10f)][_0x22acb8(0xe1)],_0x38900e=_0x28de9b[_0x22acb8(0x10f)][_0x22acb8(0x102)],_0x2b28e1=_0x28de9b[_0x22acb8(0xae)]['all'],_0x360e8f=_0x28de9b[_0x22acb8(0xae)]['toCreate'],_0x177dba=_0x28de9b[_0x22acb8(0xae)][_0x22acb8(0x13f)],_0x2de805=_0x28de9b[_0x22acb8(0xae)]['toDelete'];console[_0x22acb8(0xcc)](_0x22acb8(0x11a)+_0x132128+'\x27:');_0x545702[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)]('\x20\x20'+a41_0x2f0101[_0x22acb8(0x137)](_0x22acb8(0x12a)+_0x545702[_0x22acb8(0x107)]+_0x22acb8(0xdf)));if(!_0x1b9e3c['journeysOnly']){console[_0x22acb8(0xcc)](_0x22acb8(0x134)),console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x113)]('+\x20'+_0x3eee29['length']+_0x22acb8(0x120))),console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x10e)]('~\x20'+_0x5e12d7[_0x22acb8(0x107)]+_0x22acb8(0xd6)));if(_0x323e17[_0x22acb8(0x107)]>0x0)console[_0x22acb8(0xcc)]('\x20\x20\x20\x20'+a41_0x2f0101[_0x22acb8(0xbb)]('-\x20'+_0x323e17[_0x22acb8(0x107)]+_0x22acb8(0xb4)));else _0x117c02[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0x11d)]&&console['error'](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x13b)](_0x117c02[_0x22acb8(0x107)]+_0x22acb8(0x106)));console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x13b)]('=\x20'+_0x219fa0[_0x22acb8(0x107)]+_0x22acb8(0xf9)));}if(_0x19e079[_0x22acb8(0x107)]>0x0||_0x45b9fa[_0x22acb8(0x107)]>0x0){console[_0x22acb8(0xcc)](_0x22acb8(0xb6)),console['error']('\x20\x20\x20\x20'+a41_0x2f0101[_0x22acb8(0x113)]('+\x20'+_0x4d3292['length']+_0x22acb8(0x120))),console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x10e)]('~\x20'+_0x5d5768[_0x22acb8(0x107)]+_0x22acb8(0xd6)));if(_0x38900e[_0x22acb8(0x107)]>0x0)console['error'](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0xbb)]('-\x20'+_0x38900e[_0x22acb8(0x107)]+'\x20to\x20delete'));else _0x45b9fa['length']>0x0&&!_0x1b9e3c[_0x22acb8(0x11d)]&&console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x13b)](_0x45b9fa[_0x22acb8(0x107)]+_0x22acb8(0x106)));console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x13b)]('=\x20'+_0x289481[_0x22acb8(0x107)]+'\x20unchanged'));}_0x2b28e1[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0xeb)]&&(console[_0x22acb8(0xcc)](''),console[_0x22acb8(0xcc)](_0x22acb8(0xaf)),_0x360e8f[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101['green']('+\x20'+_0x360e8f[_0x22acb8(0x107)]+_0x22acb8(0x142))),_0x177dba[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0x10e)]('~\x20'+_0x177dba[_0x22acb8(0x107)]+_0x22acb8(0xc5))),_0x2de805[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)](_0x22acb8(0xdc)+a41_0x2f0101[_0x22acb8(0xbb)]('-\x20'+_0x2de805['length']+_0x22acb8(0xb4))));console[_0x22acb8(0xcc)]('\x20\x20Source:\x20'+a41_0x2f0101[_0x22acb8(0x130)](_0x21a5b5)+'\x0a');if(_0x545702['length']>0x0){console[_0x22acb8(0xcc)](_0x22acb8(0xd0));for(const _0x1c22f3 of _0x545702){console[_0x22acb8(0xcc)]('\x20\x20'+a41_0x2f0101[_0x22acb8(0x137)]('+')+'\x20'+_0x1c22f3);}console[_0x22acb8(0xcc)]('');}if(_0x3eee29[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0xeb)])for(const _0x51bd9b of _0x3eee29){const _0x265838=_0x51bd9b[_0x22acb8(0xbf)]?_0x51bd9b[_0x22acb8(0xbf)]+'/'+_0x51bd9b[_0x22acb8(0xc2)][_0x22acb8(0xb5)]:_0x51bd9b[_0x22acb8(0xc2)][_0x22acb8(0xb5)],_0x264502=_0x51bd9b[_0x22acb8(0xc2)][_0x22acb8(0xae)]?.['length']||0x0,_0x269843=_0x264502>0x0?a41_0x2f0101[_0x22acb8(0x13b)]('\x20['+_0x264502+_0x22acb8(0xab)):'';console['error']('\x0a'+a41_0x2f0101[_0x22acb8(0x113)](_0x22acb8(0xfd))+'\x20'+_0x265838+_0x269843),console['error']('─'[_0x22acb8(0xf1)](0x3c)),_0x51bd9b[_0x22acb8(0xfc)]&&console[_0x22acb8(0xcc)](_0x51bd9b[_0x22acb8(0xfc)]),console[_0x22acb8(0xcc)]('─'['repeat'](0x3c));}if(_0x323e17[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0xeb)])for(const _0x684a5e of _0x323e17){const _0x4bd6fb=_0x684a5e[_0x22acb8(0x11c)]?_0x3d6fb6[_0x22acb8(0x112)](_0x684a5e[_0x22acb8(0x11c)][_0x22acb8(0xea)]())||'':'',_0x5b334e=_0x4bd6fb?_0x4bd6fb+'/'+_0x684a5e['name']:_0x684a5e[_0x22acb8(0xb5)],_0x361b3f=_0x38f6c5[_0x22acb8(0x112)](_0x684a5e['id'])||[],_0x3c60ab=_0x361b3f[_0x22acb8(0x107)]>0x0?a41_0x2f0101[_0x22acb8(0x13b)]('\x20['+_0x361b3f[_0x22acb8(0x107)]+_0x22acb8(0xab)):'';console[_0x22acb8(0xcc)]('\x0a'+a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0xcd))+'\x20'+_0x5b334e+_0x3c60ab),console['error']('─'[_0x22acb8(0xf1)](0x3c));const _0x213862=segmentWithActivationsToYaml(_0x684a5e,_0x361b3f,undefined,_0x4ac6b,_0x23db79),_0x50a69e=segmentToYamlString(_0x213862),_0x5e4aea=generateDiff(_0x50a69e,'');console['error'](formatDiffWithColors(_0x5e4aea)),console[_0x22acb8(0xcc)]('─'[_0x22acb8(0xf1)](0x3c));}const _0x3521ad=_0x589139[_0x22acb8(0x132)](_0x2a0661=>!_0x2a0661[_0x22acb8(0xef)]&&_0x2a0661[_0x22acb8(0xfc)]);if(_0x3521ad[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c['journeysOnly'])for(const _0x470f13 of _0x3521ad){const _0x93d89f=_0x470f13['folderPath']?_0x470f13['folderPath']+'/'+_0x470f13[_0x22acb8(0xc2)][_0x22acb8(0xb5)]:_0x470f13[_0x22acb8(0xc2)][_0x22acb8(0xb5)];console[_0x22acb8(0xcc)]('\x0a'+a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0x111))+'\x20'+_0x93d89f),console[_0x22acb8(0xcc)]('─'[_0x22acb8(0xf1)](0x3c)),console[_0x22acb8(0xcc)](_0x470f13[_0x22acb8(0xfc)]),console[_0x22acb8(0xcc)]('─'[_0x22acb8(0xf1)](0x3c));}if(_0x4d3292[_0x22acb8(0x107)]>0x0)for(const _0x5d4e77 of _0x4d3292){const _0x211506=_0x5d4e77[_0x22acb8(0xbf)]?_0x5d4e77[_0x22acb8(0xbf)]+'/'+_0x5d4e77['yamlConfig'][_0x22acb8(0xb5)]:_0x5d4e77[_0x22acb8(0xc2)]['name'];console[_0x22acb8(0xcc)]('\x0a'+a41_0x2f0101[_0x22acb8(0x113)]('New\x20journey:')+'\x20'+_0x211506),console['error']('─'['repeat'](0x3c)),_0x5d4e77[_0x22acb8(0xfc)]&&console[_0x22acb8(0xcc)](_0x5d4e77[_0x22acb8(0xfc)]),console['error']('─'[_0x22acb8(0xf1)](0x3c));}const _0x27c855=_0x19e079[_0x22acb8(0x132)](_0x50b37f=>!_0x50b37f[_0x22acb8(0xef)]&&_0x50b37f[_0x22acb8(0xfc)]);if(_0x27c855[_0x22acb8(0x107)]>0x0)for(const _0x44acf4 of _0x27c855){const _0x44d51b=_0x44acf4[_0x22acb8(0xbf)]?_0x44acf4['folderPath']+'/'+_0x44acf4['yamlConfig']['name']:_0x44acf4[_0x22acb8(0xc2)][_0x22acb8(0xb5)];console[_0x22acb8(0xcc)]('\x0a'+a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xb9))+'\x20'+_0x44d51b),console['error']('─'[_0x22acb8(0xf1)](0x3c)),console['error'](_0x44acf4[_0x22acb8(0xfc)]),console['error']('─'[_0x22acb8(0xf1)](0x3c));}if(_0x38900e[_0x22acb8(0x107)]>0x0)for(const _0x4c1b47 of _0x38900e){const _0x159455=_0x4c1b47['folderId']?_0x3d6fb6[_0x22acb8(0x112)](_0x4c1b47[_0x22acb8(0xac)])||'':'',_0x44afcc=_0x159455?_0x159455+'/'+_0x4c1b47[_0x22acb8(0xba)]:_0x4c1b47[_0x22acb8(0xba)];console['error']('\x0a'+a41_0x2f0101[_0x22acb8(0xbb)](_0x22acb8(0xda))+'\x20'+_0x44afcc),console['error']('─'[_0x22acb8(0xf1)](0x3c)),console[_0x22acb8(0xcc)](a41_0x2f0101['red'](_0x22acb8(0x12f))),console[_0x22acb8(0xcc)]('─'[_0x22acb8(0xf1)](0x3c));}if(_0x1b9e3c[_0x22acb8(0xff)])return console[_0x22acb8(0xcc)](a41_0x2f0101['yellow'](_0x22acb8(0x140))),0x0;const _0x5e603b=_0x1b9e3c['journeysOnly']?![]:_0x3eee29[_0x22acb8(0x107)]>0x0||_0x5e12d7[_0x22acb8(0x107)]>0x0||_0x323e17['length']>0x0,_0x3debb7=_0x4d3292[_0x22acb8(0x107)]>0x0||_0x5d5768['length']>0x0||_0x38900e['length']>0x0,_0x2f5b63=_0x1b9e3c[_0x22acb8(0xeb)]?![]:_0x2b28e1['length']>0x0,_0x23dcd7=_0x545702[_0x22acb8(0x107)]>0x0;if(!_0x5e603b&&!_0x3debb7&&!_0x2f5b63&&!_0x23dcd7){const _0x2ae0eb=_0x1b9e3c[_0x22acb8(0xeb)]?_0x22acb8(0x12e):_0x22acb8(0xee);console['error'](a41_0x2f0101[_0x22acb8(0x113)](_0x2ae0eb));if(_0x815ab4&&_0x219fa0[_0x22acb8(0x107)]===0x1){const _0x55ed70=_0x219fa0[0x0];if(_0x55ed70['existingSegment']?.['id']){const _0x5e7c62=getConsoleNextUrl(_0x1b9e3c['site'],_0x22acb8(0x116)+_0x4f0c6f+_0x22acb8(0xd1)+_0x55ed70[_0x22acb8(0x124)]['id']+'/sb/da/esr');console[_0x22acb8(0xcc)](_0x22acb8(0xca)+a41_0x2f0101[_0x22acb8(0x130)](_0x5e7c62));}}if(_0x815ab4&&_0x289481[_0x22acb8(0x107)]===0x1){const _0x285bfc=_0x289481[0x0];if(_0x285bfc[_0x22acb8(0xdb)]?.['id']){const _0x3ef77a=getConsoleNextUrl(_0x1b9e3c[_0x22acb8(0xb8)],_0x22acb8(0x116)+_0x4f0c6f+_0x22acb8(0xd1)+_0x285bfc[_0x22acb8(0xdb)]['id']+'/j/da/je');console[_0x22acb8(0xcc)]('\x20\x20'+a41_0x2f0101[_0x22acb8(0x130)](_0x3ef77a));}}return 0x0;}const _0x511f89=_0x1b9e3c[_0x22acb8(0xeb)]?_0x4d3292[_0x22acb8(0x107)]+_0x5d5768['length']+_0x38900e[_0x22acb8(0x107)]+_0x545702[_0x22acb8(0x107)]:_0x3eee29[_0x22acb8(0x107)]+_0x5e12d7[_0x22acb8(0x107)]+_0x323e17[_0x22acb8(0x107)]+_0x4d3292[_0x22acb8(0x107)]+_0x5d5768[_0x22acb8(0x107)]+_0x38900e[_0x22acb8(0x107)]+_0x545702['length']+_0x2b28e1[_0x22acb8(0x107)];if(!_0x1b9e3c['yes']&&_0x511f89>0x0){if(!isInteractive())return console['error'](a41_0x2f0101[_0x22acb8(0xbb)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a41_0x2f0101[_0x22acb8(0x13b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5b9331=await confirmKey(_0x22acb8(0xc9)+_0x511f89+_0x22acb8(0xad));if(!_0x5b9331)return console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xe9))),0x1;}const _0x5ef15e={'withProgress':async(_0x44f0ed,_0xfa100d)=>{const _0x3dd36e=_0x22acb8,_0x2f0290=await withSpinner(_0x44f0ed,_0xfa100d,{'verbose':_0x1b9e3c[_0x3dd36e(0x129)]});return{'data':_0x2f0290[_0x3dd36e(0x122)]};},'logInfo':_0x43aea3=>console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x137)]('✔\x20'+_0x43aea3)),'logSuccess':_0x2054c6=>console['error'](a41_0x2f0101['green']('✔\x20'+_0x2054c6)),'logWarning':_0x7edd97=>console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)]('⚠\x20'+_0x7edd97)),'logDeleted':_0x5ef54c=>console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0xbb)]('✔\x20'+_0x5ef54c))},_0x48690b={'segment':_0x1e52a1[_0x22acb8(0x114)],'journey':_0x1e52a1['journey'],'user':_0x1e52a1['user'],'connection':_0x1e52a1[_0x22acb8(0x118)]};_0x545702[_0x22acb8(0x107)]>0x0&&(_0x5e69c9=await executePushFolders(_0x48690b,_0x545702,_0x5e69c9,{'parentId':_0x4f0c6f},_0x5ef15e));const _0xf9ee20={'rootFolderId':_0x2e6077,'folderPathToId':_0x5e69c9,'folderIdToPath':_0x3d6fb6,'segmentNameToId':_0x193102,'activationsBySegmentId':_0x38f6c5,'emailToIdMap':_0x189968,'idToEmailMap':_0x4ac6b,'connectionNameToIdMap':_0x4701ef[_0x22acb8(0x13c)],'connectionIdToNameMap':_0x4701ef['idToName'],'connectionNameToTypeMap':_0xa43f3c},_0x362f71=await executePushSegments(_0x48690b,_0x1b9e3c[_0x22acb8(0xeb)]?[]:_0x589139,_0xf9ee20,{'parentId':_0x4f0c6f},_0x5ef15e),_0x5c22a6=_0x362f71[_0x22acb8(0xc0)],_0x4e0555=_0x362f71['updated'],_0x5bd671=_0x362f71['activations']['created'],_0x19d94a=_0x362f71[_0x22acb8(0xae)][_0x22acb8(0x143)],_0x43f022=_0x362f71[_0x22acb8(0xae)][_0x22acb8(0xe0)];let _0x1451e9;if(_0x815ab4&&_0x589139[_0x22acb8(0x107)]===0x1){const _0x2cbd7f=_0x589139[0x0];_0x1451e9=_0x2cbd7f['existingSegment']?.['id']??_0x362f71[_0x22acb8(0xe8)]['get'](_0x2cbd7f[_0x22acb8(0xc2)]['name']);}const _0x59c141=await executePushSegmentDeletions(_0x48690b,_0x1b9e3c[_0x22acb8(0xeb)]?[]:_0x323e17,_0x5ef15e);let _0x7c480f=0x0,_0x15d027=0x0,_0x5fc87a=0x0;const _0x43d11e=new Map(_0x193102);for(const [_0x1d64af,_0x4c4494]of _0x362f71[_0x22acb8(0xe8)]){_0x43d11e['set'](_0x1d64af,_0x4c4494);}if(_0x19e079[_0x22acb8(0x107)]>0x0){const _0x2b5ee5={..._0xf9ee20,'segmentNameToId':_0x43d11e,'existingSegments':_0x14b892,'activationContext':_0xddf6b3},_0x12d0a9=await executePushJourneys(_0x48690b,_0x19e079,_0x2b5ee5,{'parentId':_0x4f0c6f,'rootFolderId':_0x2e6077,'verbose':_0x1b9e3c[_0x22acb8(0x129)]},_0x5ef15e);_0x7c480f=_0x12d0a9[_0x22acb8(0xc0)],_0x15d027=_0x12d0a9['updated'];if(_0x815ab4&&_0x12d0a9[_0x22acb8(0xd7)][_0x22acb8(0x107)]===0x1){const _0x56d364=_0x12d0a9[_0x22acb8(0xd7)][0x0];if(_0x56d364[_0x22acb8(0xe3)]){const _0x52f267=getConsoleNextUrl(_0x1b9e3c['site'],_0x22acb8(0x116)+_0x4f0c6f+_0x22acb8(0xd1)+_0x56d364[_0x22acb8(0xe3)]+_0x22acb8(0xde));console['error']('\x20\x20'+a41_0x2f0101[_0x22acb8(0x130)](_0x52f267));}}}for(const _0x5a11e6 of _0x38900e){console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x10e)](_0x22acb8(0xd5)+_0x5a11e6[_0x22acb8(0xba)])),_0x5fc87a++;}const _0x2f59c8=[];if(_0x5c22a6>0x0)_0x2f59c8[_0x22acb8(0xfb)](_0x5c22a6+_0x22acb8(0xf0));if(_0x4e0555>0x0)_0x2f59c8[_0x22acb8(0xfb)](_0x4e0555+'\x20updated');if(_0x59c141>0x0)_0x2f59c8['push'](_0x59c141+_0x22acb8(0xec));const _0x1b02e4=[];if(_0x7c480f>0x0)_0x1b02e4[_0x22acb8(0xfb)](_0x7c480f+'\x20created');if(_0x15d027>0x0)_0x1b02e4[_0x22acb8(0xfb)](_0x15d027+_0x22acb8(0xb2));if(_0x5fc87a>0x0)_0x1b02e4[_0x22acb8(0xfb)](_0x5fc87a+_0x22acb8(0xec));const _0x12691f=[];if(_0x5bd671>0x0)_0x12691f[_0x22acb8(0xfb)](_0x5bd671+_0x22acb8(0xf0));if(_0x19d94a>0x0)_0x12691f[_0x22acb8(0xfb)](_0x19d94a+'\x20updated');if(_0x43f022>0x0)_0x12691f[_0x22acb8(0xfb)](_0x43f022+'\x20deleted');console[_0x22acb8(0xcc)](a41_0x2f0101[_0x22acb8(0x113)](_0x22acb8(0x10b)));_0x2f59c8[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c[_0x22acb8(0xeb)]&&console[_0x22acb8(0xcc)](_0x22acb8(0xc6)+_0x2f59c8[_0x22acb8(0x141)](',\x20'));_0x1b02e4[_0x22acb8(0x107)]>0x0&&console[_0x22acb8(0xcc)](_0x22acb8(0xf7)+_0x1b02e4[_0x22acb8(0x141)](',\x20'));_0x12691f[_0x22acb8(0x107)]>0x0&&!_0x1b9e3c['journeysOnly']&&console[_0x22acb8(0xcc)](_0x22acb8(0xc4)+_0x12691f[_0x22acb8(0x141)](',\x20'));if(_0x1451e9){const _0x815979=getConsoleNextUrl(_0x1b9e3c[_0x22acb8(0xb8)],_0x22acb8(0x116)+_0x4f0c6f+_0x22acb8(0xd1)+_0x1451e9+_0x22acb8(0xf6));console[_0x22acb8(0xcc)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x2f0101['cyan'](_0x815979));}return 0x0;}}
1
+ const a41_0x1ac2f4=a41_0xf44c;(function(_0x574ae1,_0x13e60a){const _0x331c46=a41_0xf44c,_0x3ccc00=_0x574ae1();while(!![]){try{const _0x39679c=parseInt(_0x331c46(0x1f5))/0x1*(-parseInt(_0x331c46(0x1de))/0x2)+-parseInt(_0x331c46(0x221))/0x3+parseInt(_0x331c46(0x1b3))/0x4*(parseInt(_0x331c46(0x23b))/0x5)+parseInt(_0x331c46(0x21b))/0x6+-parseInt(_0x331c46(0x249))/0x7+-parseInt(_0x331c46(0x210))/0x8*(parseInt(_0x331c46(0x213))/0x9)+parseInt(_0x331c46(0x20f))/0xa;if(_0x39679c===_0x13e60a)break;else _0x3ccc00['push'](_0x3ccc00['shift']());}catch(_0x4854ab){_0x3ccc00['push'](_0x3ccc00['shift']());}}}(a41_0x4b0f,0xb6f30));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x4c8e7e from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a41_0xf44c(_0x5e707d,_0x47ec67){_0x5e707d=_0x5e707d-0x1af;const _0x4b0ff8=a41_0x4b0f();let _0xf44cfd=_0x4b0ff8[_0x5e707d];return _0xf44cfd;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a41_0x4b0f(){const _0x819188=['journey','cyan','parentFolder','/e/','folderId','idToName','(Journey\x20will\x20be\x20deleted)','updated','Delete\x20segment:','map','\x20to\x20create','Source\x20directory:\x20','unchanged','95385LfDsET','verbose','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','join','push','Preparing\x20journeys...','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','toUpdate','\x27...','Fetching\x20existing\x20data...','Error:\x20Directory\x20not\x20found:\x20','Scoped\x20to\x20folder:\x20','red','Site:\x20','7546770HMiaLe','nameToId','file','nameToType','Fetching\x20existing\x20activations...','toCreate','createdSegmentIds','108xBCBYf','filter','length','cwd','diff','yes','Parent\x20segment:\x20','listJourneysWithDetailsFromParentSegment','yellow','isNew','helpText','set','\x20\x20Activations:\x20','journeyBundleName','created','.yml','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aValidation\x20failed:','\x20unchanged','blue','endsWith','targetDir','scopedFolderPath','audienceId','Fetching\x20connections\x20for\x20name\x20resolution...','message','getParent','\x20changed','journeyId','segments','/app/ps/','folders','data','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x20updated','\x20to\x20delete','description','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','segment','\x20created','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','attributes','46186YXgFBl','existingJourney','name','Push\x20','\x20\x20\x20\x20','errorCode','\x0aError:','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toDelete','listSegments','\x20\x20Journeys:\x20','createdAt','error','delete','repeat','paused','\x20YAML\x20files\x20found','deleted','all','yamlConfig','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','10VHGABt','\x20activations]','dryRun','existingSegment','versionNumber','New\x20journey:','Aborted.','parentSegment','no_parent','parent_name','getJourney','results','folderPath','\x20changes?','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Error:\x20','state','/j/da/je','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','filePath','activations','journeys','journeyBundleId','site','isScoped','list','9307650EJpiRk','91496umvrkm','\x20\x20🗺️\x20\x20Journeys:','\x20deleted','450EPHLpU','then','getOutputSchemaWithCache','/sb/da/esr','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','segment\x20or\x20journey','\x20\x20Source:\x20','journeysOnly','8864568xdaYdq','\x20new','Delete\x20journey:','changed','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','user','879066ETPktL','type','new','green','listActivations','get','\x0a✔\x20Push\x20complete','dim','connection','segmentFolderId','No\x20','Resolving\x20parent\x20segment\x20\x27','buildUserMaps'];a41_0x4b0f=function(){return _0x819188;};return a41_0x4b0f();}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x1ac2f4(0x1e0)]='segment:push';[a41_0x1ac2f4(0x1d7)]=a41_0x1ac2f4(0x207);async['execute'](_0x281283){const _0x15a334=a41_0x1ac2f4,{options:_0x187b16,args:_0xc6d2f6,tdx:_0x1fb905}=_0x281283,_0x2a6127=_0x187b16,_0x163d9b=await resolveTarget({'arg':_0xc6d2f6[0x0],'contextParent':_0x187b16[_0x15a334(0x1fc)],'cwd':process[_0x15a334(0x1b6)]()});if(!isSuccessfulResolution(_0x163d9b))return _0x163d9b[_0x15a334(0x1e3)]===_0x15a334(0x1fd)?(console['error'](a41_0x4c8e7e['yellow'](_0x15a334(0x23d))),console['error'](_0x15a334(0x1d4)),console['error'](_0x15a334(0x1f4)),console['error'](_0x15a334(0x1e6))):(console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x204)+_0x163d9b['message']+'\x0a')),_0x163d9b['helpText']&&console[_0x15a334(0x1ec)](a41_0x4c8e7e['cyan'](_0x163d9b[_0x15a334(0x1bd)]))),0x1;if(_0x163d9b['type']===_0x15a334(0x1fe))return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x245)+_0x163d9b['targetDir']+'\x0a')),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x22f)](_0x15a334(0x1d8))),0x1;const _0x481b0a=_0x163d9b['parentName'],_0x27c1e5=_0x163d9b[_0x15a334(0x1c8)],_0x23b3d0=_0x163d9b[_0x15a334(0x222)]===_0x15a334(0x24b)?_0x163d9b[_0x15a334(0x208)]:undefined,_0x7e38b3=getScopedDetails(_0x163d9b),_0x2ed217=_0x7e38b3?.[_0x15a334(0x20d)]??![],_0x5e4ae1=_0x7e38b3?.[_0x15a334(0x1c9)]??'';if(!existsSync(_0x27c1e5))return console['error'](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x245)+_0x27c1e5+'\x0a')),console['error'](a41_0x4c8e7e[_0x15a334(0x22f)](_0x15a334(0x1d8))),0x1;_0x2a6127[_0x15a334(0x23c)]&&(console[_0x15a334(0x1ec)](_0x15a334(0x248)+_0x2a6127[_0x15a334(0x20c)]),console[_0x15a334(0x1ec)](_0x15a334(0x1b9)+_0x481b0a),console[_0x15a334(0x1ec)](_0x15a334(0x239)+_0x27c1e5),_0x2ed217&&console[_0x15a334(0x1ec)](_0x15a334(0x246)+_0x5e4ae1));const _0x163258=await withSpinner(_0x15a334(0x22c)+_0x481b0a+_0x15a334(0x243),()=>_0x1fb905[_0x15a334(0x1da)][_0x15a334(0x1e5)](_0x481b0a),{'verbose':_0x2a6127['verbose']}),_0x486cee=_0x163258[_0x15a334(0x1d3)],{parentSegmentResult:_0x55b01e,segmentsResult:_0x5a8167,foldersResult:_0x31c1dd,journeysWithDetailsResult:_0x552b57,userMaps:_0x9746d3}=await withSpinner(_0x15a334(0x244),async()=>{const _0xa0714=_0x15a334,[_0x48a53c,_0x344b2c,_0x221238,_0x45c0a6,_0x5bde12]=await Promise[_0xa0714(0x1f2)]([_0x1fb905['segment'][_0xa0714(0x1cd)](_0x486cee),_0x1fb905[_0xa0714(0x1da)][_0xa0714(0x1e9)](_0x486cee),_0x1fb905['segment']['listFolders'](_0x486cee),_0x1fb905['journey'][_0xa0714(0x1ba)](_0x486cee,{'includeAllVersions':!![]}),_0x1fb905[_0xa0714(0x220)][_0xa0714(0x22d)]()]);return{'parentSegmentResult':_0x48a53c,'segmentsResult':_0x344b2c,'foldersResult':_0x221238,'journeysWithDetailsResult':_0x45c0a6,'userMaps':_0x5bde12};},{'verbose':_0x2a6127[_0x15a334(0x23c)]})[_0x15a334(0x214)](_0x49ca96=>_0x49ca96[_0x15a334(0x1d3)]),_0x32d4cb=_0x55b01e,_0x1c5d48=extractRootFolderId(_0x32d4cb),_0x251903=_0x5a8167,_0x2fcbdc=_0x31c1dd,{journeys:_0x2e820c,activationStepsById:_0x480837}=_0x552b57,_0x5107a9=new Map(_0x2e820c['map'](_0x2a580e=>[_0x2a580e['id'],_0x2a580e])),_0x17be51=_0x2e820c['map'](_0x3db85f=>({'id':_0x3db85f['id'],'name':_0x3db85f['attributes']['name'],'journeyBundleName':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x1c0)]||'','journeyBundleId':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x20b)]||'','versionNumber':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x1f9)],'description':_0x3db85f['attributes'][_0x15a334(0x1d7)],'state':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x205)],'paused':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x1ef)],'audienceId':_0x3db85f['attributes'][_0x15a334(0x1ca)],'folderId':_0x3db85f['relationships']?.[_0x15a334(0x230)]?.['data']?.['id'],'createdAt':_0x3db85f[_0x15a334(0x1dd)][_0x15a334(0x1eb)],'updatedAt':_0x3db85f[_0x15a334(0x1dd)]['updatedAt']})),{emailToId:_0x621521,idToEmail:_0x263f9e}=_0x9746d3,_0x3d4dba=await withSpinner(_0x15a334(0x1cb),async()=>{const _0x192892=_0x15a334,_0x25b4b7=await _0x1fb905['connection'][_0x192892(0x20e)]();return buildConnectionMaps(_0x25b4b7);},{'verbose':_0x2a6127[_0x15a334(0x23c)]})['then'](_0x12a549=>_0x12a549[_0x15a334(0x1d3)]),_0x4d19bf=_0x3d4dba[_0x15a334(0x24a)],_0x523453=_0x3d4dba[_0x15a334(0x233)],_0x18cc7e=_0x3d4dba[_0x15a334(0x1af)],_0x821952={'emailToIdMap':_0x621521,'connectionNameToIdMap':_0x4d19bf,'connectionNameToTypeMap':_0x18cc7e,'getSchema':_0xabb423=>_0x1fb905[_0x15a334(0x229)][_0x15a334(0x215)](_0xabb423)};let {pathToId:_0x2266e4,idToPath:_0x4e139f}=buildFolderMaps(_0x2fcbdc);const _0x4ef127=buildSegmentLookupMap(_0x251903,_0x4e139f),_0x4e67a6=buildSegmentNameToIdMap(_0x251903),_0x233906=buildJourneyBundleLookupMap(_0x17be51,_0x4e139f);let _0x373339;if(_0x23b3d0){if(!_0x23b3d0[_0x15a334(0x1c7)](_0x15a334(0x1c2))&&!_0x23b3d0[_0x15a334(0x1c7)]('.yaml'))return console[_0x15a334(0x1ec)](a41_0x4c8e7e['red'](_0x15a334(0x217)+_0x23b3d0+'\x0a')),0x1;_0x373339=[_0x23b3d0];}else _0x373339=findYamlFiles(_0x27c1e5);if(_0x373339[_0x15a334(0x1b5)]===0x0)return console[_0x15a334(0x1ec)](a41_0x4c8e7e['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x27c1e5+'\x0a')),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x22f)](_0x15a334(0x1d9))),0x1;let _0x183886,_0x3ce7f3;try{const _0x5dbee8=parseAndClassifyYamlFiles(_0x373339,_0x27c1e5,{'skipSegments':_0x2a6127[_0x15a334(0x21a)]});_0x183886=_0x5dbee8[_0x15a334(0x1d0)],_0x3ce7f3=_0x5dbee8[_0x15a334(0x20a)];const _0x4bf6db=validateParsedFiles(_0x5dbee8,_0x27c1e5);if(_0x4bf6db[_0x15a334(0x1b5)]>0x0)return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x1c4))),console[_0x15a334(0x1ec)](formatValidationErrors(_0x4bf6db)),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)](_0x15a334(0x21f))),0x1;}catch(_0x5ef29b){return console[_0x15a334(0x1ec)](a41_0x4c8e7e['red']('Error\x20parsing\x20YAML:\x20'+(_0x5ef29b instanceof Error?_0x5ef29b[_0x15a334(0x1cc)]:_0x5ef29b))),0x1;}if(_0x183886[_0x15a334(0x1b5)]===0x0&&_0x3ce7f3[_0x15a334(0x1b5)]===0x0){const _0x2ce46a=_0x2a6127['journeysOnly']?_0x15a334(0x22e):_0x15a334(0x218);return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)](_0x15a334(0x22b)+_0x2ce46a+_0x15a334(0x1f0))),0x0;}const _0x1872d2=new Map();_0x251903[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)]&&await withSpinner(_0x15a334(0x1b0),async()=>{await batchAsync(_0x251903,async _0x2b6daa=>{const _0x1d7907=a41_0xf44c,_0x3497d3=await _0x1fb905[_0x1d7907(0x1da)][_0x1d7907(0x225)](_0x486cee,_0x2b6daa['id']);_0x1872d2[_0x1d7907(0x1be)](_0x2b6daa['id'],_0x3497d3);});},{'verbose':_0x2a6127[_0x15a334(0x23c)]});const {segmentFiles:_0x246a9a,foldersToCreate:_0x26d5e0}=await prepareSegmentFiles(_0x183886,{'segmentByFolderAndName':_0x4ef127,'activationsBySegmentId':_0x1872d2,'folderPathToId':_0x2266e4,'idToEmailMap':_0x263f9e,'connectionIdToNameMap':_0x523453},_0x821952,_0x2ed217,_0x5e4ae1),_0xcf2ffd=_0x23b3d0?[]:findSegmentsToDelete(_0x251903,_0x183886[_0x15a334(0x237)](({yamlConfig:_0x58cd21,folderPath:_0x2ee089})=>({'yamlConfig':_0x58cd21,'folderPath':resolveTDFolderPath(_0x2ee089,_0x2ed217,_0x5e4ae1)})),_0x4e139f,_0x5e4ae1,_0x2ed217),{journeyFiles:_0x30c621,foldersToCreate:_0x2fe715}=await withProgressSpinner(_0x15a334(0x240),async _0x242dd4=>prepareJourneyFiles(_0x3ce7f3,{'fetchJourney':async _0x1a4106=>_0x1fb905[_0x15a334(0x22e)][_0x15a334(0x1ff)](_0x1a4106[_0x15a334(0x1cf)]),'journeyBundlesByFolderAndName':_0x233906,'folderPathToId':_0x2266e4,'idToEmailMap':_0x263f9e,'connectionIdToNameMap':_0x523453,'existingSegments':_0x251903,'parentId':_0x486cee,'deps':_0x1fb905,'progress':{'update':_0x1e0c89=>{const _0x3a0110=_0x15a334;_0x242dd4['setPhase'](_0x1e0c89),_0x2a6127['verbose']&&console[_0x3a0110(0x1ec)]('\x20\x20'+_0x1e0c89);}},'journeyById':_0x5107a9,'activationStepsById':_0x480837},_0x2ed217,_0x5e4ae1),{'verbose':_0x2a6127[_0x15a334(0x23c)]})[_0x15a334(0x214)](_0x1df697=>_0x1df697[_0x15a334(0x1d3)]);for(const _0x10effb of _0x2fe715){_0x26d5e0['add'](_0x10effb);}const _0x4ab460=_0x23b3d0?[]:findJourneysToDelete(_0x17be51,_0x3ce7f3[_0x15a334(0x237)](({yamlConfig:_0x5ef4f4,folderPath:_0x319a94})=>({'yamlConfig':_0x5ef4f4,'folderPath':resolveTDFolderPath(_0x319a94,_0x2ed217,_0x5e4ae1)})),_0x4e139f,_0x5e4ae1,_0x2ed217),_0x39a81f=calculatePushStats(_0x246a9a,_0x30c621,_0x26d5e0,_0xcf2ffd,_0x4ab460,!!_0x2a6127[_0x15a334(0x1ed)],!!_0x2a6127[_0x15a334(0x21a)]),_0x27bd7d=_0x39a81f['segments'][_0x15a334(0x223)],_0x53e98f=_0x39a81f[_0x15a334(0x1d0)][_0x15a334(0x21e)],_0x629bb0=_0x39a81f[_0x15a334(0x1d0)][_0x15a334(0x23a)],_0x487237=_0x39a81f['segments'][_0x15a334(0x1e8)],_0x4163ee=_0x39a81f[_0x15a334(0x1d2)][_0x15a334(0x1b1)],_0x4e1f72=_0x39a81f['journeys']['new'],_0x1d6e52=_0x39a81f['journeys'][_0x15a334(0x21e)],_0x42ae4b=_0x39a81f[_0x15a334(0x20a)]['unchanged'],_0x790d6e=_0x39a81f[_0x15a334(0x20a)][_0x15a334(0x1e8)],_0x171f21=_0x39a81f['activations'][_0x15a334(0x1f2)],_0x230b61=_0x39a81f['activations'][_0x15a334(0x1b1)],_0x10a2fd=_0x39a81f['activations'][_0x15a334(0x242)],_0x2f606a=_0x39a81f[_0x15a334(0x209)][_0x15a334(0x1e8)];console[_0x15a334(0x1ec)]('\x0aPush\x20summary\x20for\x20\x27'+_0x481b0a+'\x27:');_0x4163ee['length']>0x0&&console[_0x15a334(0x1ec)]('\x20\x20'+a41_0x4c8e7e[_0x15a334(0x1c6)]('📁\x20'+_0x4163ee['length']+'\x20folders\x20to\x20create'));if(!_0x2a6127[_0x15a334(0x21a)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x224)]('+\x20'+_0x27bd7d[_0x15a334(0x1b5)]+_0x15a334(0x21c))),console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x1bb)]('~\x20'+_0x53e98f[_0x15a334(0x1b5)]+_0x15a334(0x1ce)));if(_0x487237[_0x15a334(0x1b5)]>0x0)console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x247)]('-\x20'+_0x487237[_0x15a334(0x1b5)]+'\x20to\x20delete'));else _0xcf2ffd[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x1ed)]&&console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x228)](_0xcf2ffd['length']+_0x15a334(0x1e7)));console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x228)]('=\x20'+_0x629bb0['length']+_0x15a334(0x1c5)));}if(_0x30c621[_0x15a334(0x1b5)]>0x0||_0x4ab460[_0x15a334(0x1b5)]>0x0){console[_0x15a334(0x1ec)](_0x15a334(0x211)),console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e['green']('+\x20'+_0x4e1f72[_0x15a334(0x1b5)]+'\x20new')),console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x1bb)]('~\x20'+_0x1d6e52[_0x15a334(0x1b5)]+_0x15a334(0x1ce)));if(_0x790d6e[_0x15a334(0x1b5)]>0x0)console['error']('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x247)]('-\x20'+_0x790d6e[_0x15a334(0x1b5)]+_0x15a334(0x1d6)));else _0x4ab460[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x1ed)]&&console[_0x15a334(0x1ec)]('\x20\x20\x20\x20'+a41_0x4c8e7e[_0x15a334(0x228)](_0x4ab460[_0x15a334(0x1b5)]+_0x15a334(0x1e7)));console['error'](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x228)]('=\x20'+_0x42ae4b[_0x15a334(0x1b5)]+_0x15a334(0x1c5)));}_0x171f21[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)]&&(console['error'](''),console[_0x15a334(0x1ec)]('\x20\x20Activations:'),_0x230b61['length']>0x0&&console['error'](_0x15a334(0x1e2)+a41_0x4c8e7e['green']('+\x20'+_0x230b61[_0x15a334(0x1b5)]+_0x15a334(0x238))),_0x10a2fd[_0x15a334(0x1b5)]>0x0&&console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x1bb)]('~\x20'+_0x10a2fd[_0x15a334(0x1b5)]+'\x20to\x20update')),_0x2f606a[_0x15a334(0x1b5)]>0x0&&console[_0x15a334(0x1ec)](_0x15a334(0x1e2)+a41_0x4c8e7e[_0x15a334(0x247)]('-\x20'+_0x2f606a['length']+_0x15a334(0x1d6))));console[_0x15a334(0x1ec)](_0x15a334(0x219)+a41_0x4c8e7e['cyan'](_0x27c1e5)+'\x0a');if(_0x4163ee['length']>0x0){console[_0x15a334(0x1ec)]('Folders\x20to\x20create:');for(const _0x2b456b of _0x4163ee){console[_0x15a334(0x1ec)]('\x20\x20'+a41_0x4c8e7e[_0x15a334(0x1c6)]('+')+'\x20'+_0x2b456b);}console[_0x15a334(0x1ec)]('');}if(_0x27bd7d[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)])for(const _0x4ec2a7 of _0x27bd7d){const _0x2d1a95=_0x4ec2a7[_0x15a334(0x201)]?_0x4ec2a7['folderPath']+'/'+_0x4ec2a7[_0x15a334(0x1f3)][_0x15a334(0x1e0)]:_0x4ec2a7['yamlConfig'][_0x15a334(0x1e0)],_0x535faa=_0x4ec2a7[_0x15a334(0x1f3)]['activations']?.['length']||0x0,_0x58a9cb=_0x535faa>0x0?a41_0x4c8e7e['dim']('\x20['+_0x535faa+_0x15a334(0x1f6)):'';console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e[_0x15a334(0x224)]('New\x20segment:')+'\x20'+_0x2d1a95+_0x58a9cb),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c)),_0x4ec2a7[_0x15a334(0x1b7)]&&console[_0x15a334(0x1ec)](_0x4ec2a7['diff']),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c));}if(_0x487237[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)])for(const _0x157b7b of _0x487237){const _0x55406c=_0x157b7b[_0x15a334(0x22a)]?_0x4e139f[_0x15a334(0x226)](_0x157b7b[_0x15a334(0x22a)]['toString']())||'':'',_0x2be5a7=_0x55406c?_0x55406c+'/'+_0x157b7b[_0x15a334(0x1e0)]:_0x157b7b[_0x15a334(0x1e0)],_0x46639c=_0x1872d2[_0x15a334(0x226)](_0x157b7b['id'])||[],_0xa4e700=_0x46639c[_0x15a334(0x1b5)]>0x0?a41_0x4c8e7e[_0x15a334(0x228)]('\x20['+_0x46639c[_0x15a334(0x1b5)]+_0x15a334(0x1f6)):'';console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e['red'](_0x15a334(0x236))+'\x20'+_0x2be5a7+_0xa4e700),console['error']('─'[_0x15a334(0x1ee)](0x3c));const _0x1e4bfc=segmentWithActivationsToYaml(_0x157b7b,_0x46639c,undefined,_0x263f9e,_0x523453),_0x4c4f19=segmentToYamlString(_0x1e4bfc),_0x7e829c=generateDiff(_0x4c4f19,'');console[_0x15a334(0x1ec)](formatDiffWithColors(_0x7e829c)),console[_0x15a334(0x1ec)]('─'['repeat'](0x3c));}const _0x9564f8=_0x246a9a[_0x15a334(0x1b4)](_0x3712b5=>!_0x3712b5[_0x15a334(0x1bc)]&&_0x3712b5[_0x15a334(0x1b7)]);if(_0x9564f8[_0x15a334(0x1b5)]>0x0&&!_0x2a6127['journeysOnly'])for(const _0xa306ce of _0x9564f8){const _0x50e48e=_0xa306ce[_0x15a334(0x201)]?_0xa306ce[_0x15a334(0x201)]+'/'+_0xa306ce[_0x15a334(0x1f3)][_0x15a334(0x1e0)]:_0xa306ce[_0x15a334(0x1f3)][_0x15a334(0x1e0)];console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e['yellow']('Changes\x20to:')+'\x20'+_0x50e48e),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c)),console[_0x15a334(0x1ec)](_0xa306ce[_0x15a334(0x1b7)]),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c));}if(_0x4e1f72['length']>0x0)for(const _0x10ffe3 of _0x4e1f72){const _0x54830b=_0x10ffe3[_0x15a334(0x201)]?_0x10ffe3[_0x15a334(0x201)]+'/'+_0x10ffe3[_0x15a334(0x1f3)]['name']:_0x10ffe3[_0x15a334(0x1f3)]['name'];console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e[_0x15a334(0x224)](_0x15a334(0x1fa))+'\x20'+_0x54830b),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c)),_0x10ffe3['diff']&&console[_0x15a334(0x1ec)](_0x10ffe3[_0x15a334(0x1b7)]),console['error']('─'['repeat'](0x3c));}const _0x86599f=_0x30c621[_0x15a334(0x1b4)](_0xf79972=>!_0xf79972['isNew']&&_0xf79972[_0x15a334(0x1b7)]);if(_0x86599f[_0x15a334(0x1b5)]>0x0)for(const _0x4e2897 of _0x86599f){const _0x4d14a9=_0x4e2897[_0x15a334(0x201)]?_0x4e2897[_0x15a334(0x201)]+'/'+_0x4e2897[_0x15a334(0x1f3)][_0x15a334(0x1e0)]:_0x4e2897[_0x15a334(0x1f3)][_0x15a334(0x1e0)];console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e[_0x15a334(0x1bb)]('Changes\x20to\x20journey:')+'\x20'+_0x4d14a9),console[_0x15a334(0x1ec)]('─'[_0x15a334(0x1ee)](0x3c)),console[_0x15a334(0x1ec)](_0x4e2897['diff']),console[_0x15a334(0x1ec)]('─'['repeat'](0x3c));}if(_0x790d6e[_0x15a334(0x1b5)]>0x0)for(const _0x270739 of _0x790d6e){const _0x316a31=_0x270739[_0x15a334(0x232)]?_0x4e139f[_0x15a334(0x226)](_0x270739[_0x15a334(0x232)])||'':'',_0x5c9c3d=_0x316a31?_0x316a31+'/'+_0x270739['journeyBundleName']:_0x270739[_0x15a334(0x1c0)];console[_0x15a334(0x1ec)]('\x0a'+a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x21d))+'\x20'+_0x5c9c3d),console['error']('─'['repeat'](0x3c)),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x234))),console[_0x15a334(0x1ec)]('─'['repeat'](0x3c));}if(_0x2a6127[_0x15a334(0x1f7)])return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x16f8b5=_0x2a6127[_0x15a334(0x21a)]?![]:_0x27bd7d[_0x15a334(0x1b5)]>0x0||_0x53e98f[_0x15a334(0x1b5)]>0x0||_0x487237[_0x15a334(0x1b5)]>0x0,_0x41c6b0=_0x4e1f72[_0x15a334(0x1b5)]>0x0||_0x1d6e52['length']>0x0||_0x790d6e[_0x15a334(0x1b5)]>0x0,_0x53b83c=_0x2a6127[_0x15a334(0x21a)]?![]:_0x171f21['length']>0x0,_0x25eb70=_0x4163ee[_0x15a334(0x1b5)]>0x0;if(!_0x16f8b5&&!_0x41c6b0&&!_0x53b83c&&!_0x25eb70){const _0x26eba5=_0x2a6127[_0x15a334(0x21a)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x15a334(0x241);console['error'](a41_0x4c8e7e[_0x15a334(0x224)](_0x26eba5));if(_0x23b3d0&&_0x629bb0['length']===0x1){const _0x270d21=_0x629bb0[0x0];if(_0x270d21['existingSegment']?.['id']){const _0xbd47db=getConsoleNextUrl(_0x2a6127['site'],_0x15a334(0x1d1)+_0x486cee+_0x15a334(0x231)+_0x270d21[_0x15a334(0x1f8)]['id']+_0x15a334(0x216));console[_0x15a334(0x1ec)](_0x15a334(0x203)+a41_0x4c8e7e[_0x15a334(0x22f)](_0xbd47db));}}if(_0x23b3d0&&_0x42ae4b[_0x15a334(0x1b5)]===0x1){const _0x38352f=_0x42ae4b[0x0];if(_0x38352f[_0x15a334(0x1df)]?.['id']){const _0x541f79=getConsoleNextUrl(_0x2a6127[_0x15a334(0x20c)],_0x15a334(0x1d1)+_0x486cee+'/e/'+_0x38352f[_0x15a334(0x1df)]['id']+'/j/da/je');console['error']('\x20\x20'+a41_0x4c8e7e['cyan'](_0x541f79));}}return 0x0;}const _0x5ad6c8=_0x2a6127[_0x15a334(0x21a)]?_0x4e1f72[_0x15a334(0x1b5)]+_0x1d6e52['length']+_0x790d6e['length']+_0x4163ee['length']:_0x27bd7d['length']+_0x53e98f['length']+_0x487237[_0x15a334(0x1b5)]+_0x4e1f72[_0x15a334(0x1b5)]+_0x1d6e52[_0x15a334(0x1b5)]+_0x790d6e[_0x15a334(0x1b5)]+_0x4163ee[_0x15a334(0x1b5)]+_0x171f21[_0x15a334(0x1b5)];if(!_0x2a6127[_0x15a334(0x1b8)]&&_0x5ad6c8>0x0){if(!isInteractive())return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x247)](_0x15a334(0x1e4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x228)](_0x15a334(0x1c3))),0x1;const _0x52208d=await confirmKey(_0x15a334(0x1e1)+_0x5ad6c8+_0x15a334(0x202));if(!_0x52208d)return console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)](_0x15a334(0x1fb))),0x1;}const _0x5c731e={'withProgress':async(_0x200c9c,_0x37ea06)=>{const _0x6d4978=_0x15a334,_0x5a022a=await withSpinner(_0x200c9c,_0x37ea06,{'verbose':_0x2a6127[_0x6d4978(0x23c)]});return{'data':_0x5a022a[_0x6d4978(0x1d3)]};},'logInfo':_0x3fb34a=>console['error'](a41_0x4c8e7e[_0x15a334(0x1c6)]('✔\x20'+_0x3fb34a)),'logSuccess':_0x29f39f=>console['error'](a41_0x4c8e7e['green']('✔\x20'+_0x29f39f)),'logWarning':_0x1478cb=>console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)]('⚠\x20'+_0x1478cb)),'logDeleted':_0xe5b91f=>console['error'](a41_0x4c8e7e[_0x15a334(0x247)]('✔\x20'+_0xe5b91f))},_0x23e5d5={'segment':_0x1fb905[_0x15a334(0x1da)],'journey':_0x1fb905[_0x15a334(0x22e)],'user':_0x1fb905['user'],'connection':_0x1fb905[_0x15a334(0x229)]};_0x4163ee['length']>0x0&&(_0x2266e4=await executePushFolders(_0x23e5d5,_0x4163ee,_0x2266e4,{'parentId':_0x486cee},_0x5c731e));const _0x24a02a={'rootFolderId':_0x1c5d48,'folderPathToId':_0x2266e4,'folderIdToPath':_0x4e139f,'segmentNameToId':_0x4e67a6,'activationsBySegmentId':_0x1872d2,'emailToIdMap':_0x621521,'idToEmailMap':_0x263f9e,'connectionNameToIdMap':_0x3d4dba[_0x15a334(0x24a)],'connectionIdToNameMap':_0x3d4dba['idToName'],'connectionNameToTypeMap':_0x18cc7e},_0x20b191=await executePushSegments(_0x23e5d5,_0x2a6127[_0x15a334(0x21a)]?[]:_0x246a9a,_0x24a02a,{'parentId':_0x486cee},_0x5c731e),_0x30a363=_0x20b191[_0x15a334(0x1c1)],_0x170c78=_0x20b191[_0x15a334(0x235)],_0x5bfadc=_0x20b191[_0x15a334(0x209)]['created'],_0x3ed3af=_0x20b191['activations'][_0x15a334(0x235)],_0x19fb08=_0x20b191[_0x15a334(0x209)][_0x15a334(0x1f1)];let _0x291782;if(_0x23b3d0&&_0x246a9a[_0x15a334(0x1b5)]===0x1){const _0x3de7d9=_0x246a9a[0x0];_0x291782=_0x3de7d9['existingSegment']?.['id']??_0x20b191[_0x15a334(0x1b2)][_0x15a334(0x226)](_0x3de7d9[_0x15a334(0x1f3)][_0x15a334(0x1e0)]);}const _0x370e0f=await executePushSegmentDeletions(_0x23e5d5,_0x2a6127[_0x15a334(0x21a)]?[]:_0x487237,_0x5c731e);let _0xc081f4=0x0,_0x47666c=0x0,_0xee1858=0x0;const _0x20dcef=new Map(_0x4e67a6);for(const [_0x2d4807,_0x2b192e]of _0x20b191[_0x15a334(0x1b2)]){_0x20dcef[_0x15a334(0x1be)](_0x2d4807,_0x2b192e);}if(_0x30c621[_0x15a334(0x1b5)]>0x0){const _0x43257a={..._0x24a02a,'segmentNameToId':_0x20dcef,'existingSegments':_0x251903,'activationContext':_0x821952},_0x137955=await executePushJourneys(_0x23e5d5,_0x30c621,_0x43257a,{'parentId':_0x486cee,'rootFolderId':_0x1c5d48,'verbose':_0x2a6127[_0x15a334(0x23c)]},_0x5c731e);_0xc081f4=_0x137955[_0x15a334(0x1c1)],_0x47666c=_0x137955[_0x15a334(0x235)];if(_0x23b3d0&&_0x137955[_0x15a334(0x200)][_0x15a334(0x1b5)]===0x1){const _0x1debd2=_0x137955[_0x15a334(0x200)][0x0];if(_0x1debd2[_0x15a334(0x1cf)]){const _0xa907f4=getConsoleNextUrl(_0x2a6127[_0x15a334(0x20c)],_0x15a334(0x1d1)+_0x486cee+'/e/'+_0x1debd2[_0x15a334(0x1cf)]+_0x15a334(0x206));console['error']('\x20\x20'+a41_0x4c8e7e['cyan'](_0xa907f4));}}}for(const _0x47ac00 of _0x790d6e){console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x1bb)](_0x15a334(0x1dc)+_0x47ac00[_0x15a334(0x1c0)])),_0xee1858++;}const _0x53fb8d=[];if(_0x30a363>0x0)_0x53fb8d[_0x15a334(0x23f)](_0x30a363+'\x20created');if(_0x170c78>0x0)_0x53fb8d['push'](_0x170c78+_0x15a334(0x1d5));if(_0x370e0f>0x0)_0x53fb8d['push'](_0x370e0f+'\x20deleted');const _0x47ce37=[];if(_0xc081f4>0x0)_0x47ce37['push'](_0xc081f4+_0x15a334(0x1db));if(_0x47666c>0x0)_0x47ce37[_0x15a334(0x23f)](_0x47666c+_0x15a334(0x1d5));if(_0xee1858>0x0)_0x47ce37[_0x15a334(0x23f)](_0xee1858+'\x20deleted');const _0x3394f3=[];if(_0x5bfadc>0x0)_0x3394f3[_0x15a334(0x23f)](_0x5bfadc+_0x15a334(0x1db));if(_0x3ed3af>0x0)_0x3394f3['push'](_0x3ed3af+_0x15a334(0x1d5));if(_0x19fb08>0x0)_0x3394f3['push'](_0x19fb08+_0x15a334(0x212));console[_0x15a334(0x1ec)](a41_0x4c8e7e[_0x15a334(0x224)](_0x15a334(0x227)));_0x53fb8d['length']>0x0&&!_0x2a6127[_0x15a334(0x21a)]&&console[_0x15a334(0x1ec)]('\x20\x20Segments:\x20'+_0x53fb8d[_0x15a334(0x23e)](',\x20'));_0x47ce37[_0x15a334(0x1b5)]>0x0&&console[_0x15a334(0x1ec)](_0x15a334(0x1ea)+_0x47ce37[_0x15a334(0x23e)](',\x20'));_0x3394f3[_0x15a334(0x1b5)]>0x0&&!_0x2a6127[_0x15a334(0x21a)]&&console['error'](_0x15a334(0x1bf)+_0x3394f3[_0x15a334(0x23e)](',\x20'));if(_0x291782){const _0x239b17=getConsoleNextUrl(_0x2a6127[_0x15a334(0x20c)],'/app/ps/'+_0x486cee+_0x15a334(0x231)+_0x291782+_0x15a334(0x216));console[_0x15a334(0x1ec)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x4c8e7e[_0x15a334(0x22f)](_0x239b17));}return 0x0;}}
@@ -1 +1 @@
1
- function a42_0x9d47(){const _0x534906=['\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','385oFYMVn','Updating\x20segment\x20\x27','\x27...','data','Resolved\x20type:\x20','segment','name','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','12sHMLZa','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Resolving\x20path\x20\x27','3YZVlXz','1809GJeshi','323402xFdUqn','includes','1057952rxaVOA','yellow','107646cHWqcD','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','2536lGbDnP','type','segmentName','updateSegmentById','segment:update','verbose','error','segmentId','78110arDriE','Examples:','Segment\x20ID:\x20','42upwVAc','Error:\x20Cannot\x20update\x20','rule','518865Wtghaw','ruleFile','resolveFolderId','INTERNAL','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','4AKojMD','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','description','2755974CJibQw','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folder','✔\x20Updated\x20segment\x20\x27','parentId','resolvePathToResource','Update\x20existing\x20child\x20segment'];a42_0x9d47=function(){return _0x534906;};return a42_0x9d47();}const a42_0x5aacfe=a42_0x3c3e;(function(_0x59263d,_0x1a1cd4){const _0x802c12=a42_0x3c3e,_0x420057=_0x59263d();while(!![]){try{const _0x72a4be=parseInt(_0x802c12(0x12c))/0x1+-parseInt(_0x802c12(0x12a))/0x2*(-parseInt(_0x802c12(0x128))/0x3)+parseInt(_0x802c12(0x111))/0x4*(parseInt(_0x802c12(0x10c))/0x5)+parseInt(_0x802c12(0x12e))/0x6*(-parseInt(_0x802c12(0x109))/0x7)+-parseInt(_0x802c12(0x130))/0x8*(parseInt(_0x802c12(0x129))/0x9)+-parseInt(_0x802c12(0x106))/0xa*(parseInt(_0x802c12(0x11d))/0xb)+parseInt(_0x802c12(0x125))/0xc*(-parseInt(_0x802c12(0x114))/0xd);if(_0x72a4be===_0x1a1cd4)break;else _0x420057['push'](_0x420057['shift']());}catch(_0x16926f){_0x420057['push'](_0x420057['shift']());}}}(a42_0x9d47,0xa2c38));import{BaseCommand}from'./command.js';function a42_0x3c3e(_0x75291c,_0x5a9909){_0x75291c=_0x75291c-0x103;const _0x9d47a5=a42_0x9d47();let _0x3c3e07=_0x9d47a5[_0x75291c];return _0x3c3e07;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x44cf5a from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x5aacfe(0x123)]=a42_0x5aacfe(0x134);[a42_0x5aacfe(0x113)]=a42_0x5aacfe(0x11a);async['execute'](_0x49d637){const _0x3570a2=a42_0x5aacfe;console[_0x3570a2(0x104)](a42_0x44cf5a[_0x3570a2(0x12d)](_0x3570a2(0x112))),console[_0x3570a2(0x104)](a42_0x44cf5a['yellow'](_0x3570a2(0x110)));const {options:_0x2caf61,args:_0x49c018,tdx:_0x48deda}=_0x49d637,_0x3ea67b=_0x2caf61;if(_0x49c018['length']===0x0)return console['error'](_0x3570a2(0x126)),console[_0x3570a2(0x104)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x3570a2(0x104)](_0x3570a2(0x107)),console['error'](_0x3570a2(0x11b)),console[_0x3570a2(0x104)](_0x3570a2(0x12f)),0x1;const _0x2339c7=_0x49c018[0x0],_0x27d883=_0x2caf61['segmentPath'];let _0x165e7d=_0x2339c7;_0x27d883&&!_0x2339c7[_0x3570a2(0x12b)]('/')&&(_0x165e7d=_0x27d883+'/'+_0x2339c7,_0x3ea67b['verbose']&&console[_0x3570a2(0x104)]('Resolved\x20relative\x20path\x20to:\x20'+_0x165e7d));const _0x52f905=await withSpinner(_0x3570a2(0x127)+_0x165e7d+_0x3570a2(0x11f),()=>_0x48deda[_0x3570a2(0x122)][_0x3570a2(0x119)](_0x165e7d),{'verbose':_0x3ea67b[_0x3570a2(0x103)]}),_0x21fd7a=_0x52f905['data'];_0x3ea67b[_0x3570a2(0x103)]&&console[_0x3570a2(0x104)](_0x3570a2(0x121)+_0x21fd7a[_0x3570a2(0x131)]);if(_0x21fd7a[_0x3570a2(0x131)]!==_0x3570a2(0x122))return console[_0x3570a2(0x104)](_0x3570a2(0x10a)+_0x21fd7a['type']+_0x3570a2(0x11c)),console[_0x3570a2(0x104)](_0x3570a2(0x124)),0x1;if(!_0x21fd7a[_0x3570a2(0x105)])throw new SDKError(ErrorCode[_0x3570a2(0x10f)],_0x3570a2(0x115));const _0x50a469=_0x21fd7a[_0x3570a2(0x118)],_0x131001=_0x21fd7a[_0x3570a2(0x105)];_0x3ea67b[_0x3570a2(0x103)]&&(console[_0x3570a2(0x104)]('Parent\x20ID:\x20'+_0x50a469),console[_0x3570a2(0x104)](_0x3570a2(0x108)+_0x131001));let _0x228587;if(_0x3ea67b['folder']){const _0x3e4b0c=_0x3ea67b[_0x3570a2(0x116)],_0x59700e=await withSpinner('Resolving\x20folder\x20\x27'+_0x3e4b0c+_0x3570a2(0x11f),()=>_0x48deda['segment'][_0x3570a2(0x10e)](_0x50a469,_0x3e4b0c),{'verbose':_0x3ea67b[_0x3570a2(0x103)]});_0x228587=parseInt(_0x59700e['data'],0xa),_0x3ea67b['verbose']&&console[_0x3570a2(0x104)]('Resolved\x20folder\x20ID:\x20'+_0x228587);}const _0x1c2cf1=await loadJSONFromOptions(_0x3ea67b[_0x3570a2(0x10b)],_0x3ea67b[_0x3570a2(0x10d)]),_0x71e96b={'name':_0x3ea67b[_0x3570a2(0x123)],'description':_0x3ea67b[_0x3570a2(0x113)],'rule':_0x1c2cf1,'kind':_0x3ea67b['kind']!==undefined?parseInt(_0x3ea67b['kind'],0xa):undefined,'segmentFolderId':_0x228587},_0xd03deb=await withSpinner(_0x3570a2(0x11e)+_0x21fd7a[_0x3570a2(0x132)]+'\x27...',()=>_0x48deda[_0x3570a2(0x122)][_0x3570a2(0x133)](_0x50a469,_0x131001,_0x71e96b),{'verbose':_0x3ea67b[_0x3570a2(0x103)]}),_0x28253b=_0xd03deb[_0x3570a2(0x120)];return console['error'](_0x3570a2(0x117)+_0x28253b['name']+'\x27'),_0x165e7d!==_0x2339c7&&console[_0x3570a2(0x104)]('\x20\x20\x20Path:\x20'+_0x165e7d),await handleSDKOutput([_0x28253b],_0x3ea67b),0x0;}}
1
+ const a42_0x5b2ee7=a42_0x2a91;function a42_0x2a91(_0x2caf9d,_0x15d540){_0x2caf9d=_0x2caf9d-0x18c;const _0x46898b=a42_0x4689();let _0x2a910f=_0x46898b[_0x2caf9d];return _0x2a910f;}(function(_0x248712,_0x3c7d67){const _0x188159=a42_0x2a91,_0x2f7a06=_0x248712();while(!![]){try{const _0x430156=-parseInt(_0x188159(0x1b1))/0x1*(-parseInt(_0x188159(0x18d))/0x2)+parseInt(_0x188159(0x191))/0x3+-parseInt(_0x188159(0x19d))/0x4*(-parseInt(_0x188159(0x19a))/0x5)+-parseInt(_0x188159(0x1a8))/0x6*(-parseInt(_0x188159(0x195))/0x7)+-parseInt(_0x188159(0x1ad))/0x8*(parseInt(_0x188159(0x1ab))/0x9)+-parseInt(_0x188159(0x18e))/0xa*(-parseInt(_0x188159(0x19e))/0xb)+parseInt(_0x188159(0x18c))/0xc*(-parseInt(_0x188159(0x1b0))/0xd);if(_0x430156===_0x3c7d67)break;else _0x2f7a06['push'](_0x2f7a06['shift']());}catch(_0x49ae86){_0x2f7a06['push'](_0x2f7a06['shift']());}}}(a42_0x4689,0x4ae82));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x4689(){const _0x769fd1=['\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','execute','type','1673778GmoLhn','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentPath','963LqyQtE','rule','26504ojYAvc','Resolving\x20path\x20\x27','Resolved\x20type:\x20','286KmTndt','35873vIhPaO','Examples:','\x27...','Resolved\x20relative\x20path\x20to:\x20','segmentId','Error:\x20Cannot\x20update\x20','resolvePathToResource','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','verbose','segment:update','Resolved\x20folder\x20ID:\x20','\x20\x20\x20Path:\x20','includes','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','650028WFHtbL','18wuFNKl','130gFzvjr','segment','Parent\x20ID:\x20','219204DlzYNW','length','INTERNAL','Segment\x20ID:\x20','14NExsBu','resolveFolderId','kind','name','ruleFile','85VmEyeu','Updating\x20segment\x20\x27','error','126404BodOzU','306273BAyHDT','Update\x20existing\x20child\x20segment','data','description','parentId','yellow','folder'];a42_0x4689=function(){return _0x769fd1;};return a42_0x4689();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x11931c from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x5b2ee7(0x198)]=a42_0x5b2ee7(0x1ba);[a42_0x5b2ee7(0x1a1)]=a42_0x5b2ee7(0x19f);async[a42_0x5b2ee7(0x1a6)](_0x1cc7b6){const _0x4e518e=a42_0x5b2ee7;console[_0x4e518e(0x19c)](a42_0x11931c[_0x4e518e(0x1a3)](_0x4e518e(0x1b8))),console['error'](a42_0x11931c[_0x4e518e(0x1a3)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x12ec15,args:_0x35ea5a,tdx:_0x22cf8f}=_0x1cc7b6,_0x7e7a7=_0x12ec15;if(_0x35ea5a[_0x4e518e(0x192)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x4e518e(0x19c)](_0x4e518e(0x1a9)),console['error'](_0x4e518e(0x1b2)),console[_0x4e518e(0x19c)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x4e518e(0x19c)](_0x4e518e(0x1a5)),0x1;const _0x365370=_0x35ea5a[0x0],_0x17e237=_0x12ec15[_0x4e518e(0x1aa)];let _0x115cd8=_0x365370;_0x17e237&&!_0x365370[_0x4e518e(0x1bd)]('/')&&(_0x115cd8=_0x17e237+'/'+_0x365370,_0x7e7a7[_0x4e518e(0x1b9)]&&console[_0x4e518e(0x19c)](_0x4e518e(0x1b4)+_0x115cd8));const _0x16b1f3=await withSpinner(_0x4e518e(0x1ae)+_0x115cd8+_0x4e518e(0x1b3),()=>_0x22cf8f['segment'][_0x4e518e(0x1b7)](_0x115cd8),{'verbose':_0x7e7a7[_0x4e518e(0x1b9)]}),_0x5238d7=_0x16b1f3['data'];_0x7e7a7['verbose']&&console[_0x4e518e(0x19c)](_0x4e518e(0x1af)+_0x5238d7[_0x4e518e(0x1a7)]);if(_0x5238d7[_0x4e518e(0x1a7)]!==_0x4e518e(0x18f))return console[_0x4e518e(0x19c)](_0x4e518e(0x1b6)+_0x5238d7[_0x4e518e(0x1a7)]+_0x4e518e(0x1bf)),console[_0x4e518e(0x19c)](_0x4e518e(0x1be)),0x1;if(!_0x5238d7['segmentId'])throw new SDKError(ErrorCode[_0x4e518e(0x193)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2e1490=_0x5238d7[_0x4e518e(0x1a2)],_0x32e5da=_0x5238d7[_0x4e518e(0x1b5)];_0x7e7a7['verbose']&&(console[_0x4e518e(0x19c)](_0x4e518e(0x190)+_0x2e1490),console[_0x4e518e(0x19c)](_0x4e518e(0x194)+_0x32e5da));let _0x32cabb;if(_0x7e7a7['folder']){const _0x396590=_0x7e7a7[_0x4e518e(0x1a4)],_0x37a73f=await withSpinner('Resolving\x20folder\x20\x27'+_0x396590+_0x4e518e(0x1b3),()=>_0x22cf8f[_0x4e518e(0x18f)][_0x4e518e(0x196)](_0x2e1490,_0x396590),{'verbose':_0x7e7a7[_0x4e518e(0x1b9)]});_0x32cabb=parseInt(_0x37a73f[_0x4e518e(0x1a0)],0xa),_0x7e7a7[_0x4e518e(0x1b9)]&&console[_0x4e518e(0x19c)](_0x4e518e(0x1bb)+_0x32cabb);}const _0xdd5051=await loadJSONFromOptions(_0x7e7a7[_0x4e518e(0x1ac)],_0x7e7a7[_0x4e518e(0x199)]),_0xb9b1cf={'name':_0x7e7a7[_0x4e518e(0x198)],'description':_0x7e7a7[_0x4e518e(0x1a1)],'rule':_0xdd5051,'kind':_0x7e7a7[_0x4e518e(0x197)]!==undefined?parseInt(_0x7e7a7[_0x4e518e(0x197)],0xa):undefined,'segmentFolderId':_0x32cabb},_0x131952=await withSpinner(_0x4e518e(0x19b)+_0x5238d7['segmentName']+_0x4e518e(0x1b3),()=>_0x22cf8f[_0x4e518e(0x18f)]['updateSegmentById'](_0x2e1490,_0x32e5da,_0xb9b1cf),{'verbose':_0x7e7a7[_0x4e518e(0x1b9)]}),_0x1cfb8c=_0x131952['data'];return console[_0x4e518e(0x19c)]('✔\x20Updated\x20segment\x20\x27'+_0x1cfb8c[_0x4e518e(0x198)]+'\x27'),_0x115cd8!==_0x365370&&console[_0x4e518e(0x19c)](_0x4e518e(0x1bc)+_0x115cd8),await handleSDKOutput([_0x1cfb8c],_0x7e7a7),0x0;}}
@@ -1 +1 @@
1
- function a43_0x324d(){const _0xebb753=['cyan','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','fullPath','parentName','folderPath','1718955lWYsCJ','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Folder\x20ID:\x20','2676pxxbFp','645688rJCqBO','description','site','log','error','name','segments','Parent\x20ID:\x20','parent_segment','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','15lrZcLY','86408vPsUGC','5590RWTYMN','Target\x20path:\x20','split','parentId','type','data','red','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','segment:use','config','Error:\x20Path\x20is\x20required\x0a','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','56177alHxnW','verbose','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','slice','402aTZwoW','225iJLEZf','green','115736JDDOsE','5878086YVPLBI','execute','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','folderId','segment','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','join','dim','Resolved\x20path\x20type:\x20','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','\x27...','Site:\x20','✔\x20Context\x20set\x20to:\x20','Resolved\x20relative\x20path\x20to:\x20'];a43_0x324d=function(){return _0xebb753;};return a43_0x324d();}const a43_0x3e54e0=a43_0x1a53;(function(_0x23549d,_0x5c61cc){const _0x270560=a43_0x1a53,_0xcf623c=_0x23549d();while(!![]){try{const _0x55a2be=parseInt(_0x270560(0x1d7))/0x1*(-parseInt(_0x270560(0x1f4))/0x2)+-parseInt(_0x270560(0x1e2))/0x3*(parseInt(_0x270560(0x1d8))/0x4)+-parseInt(_0x270560(0x1d4))/0x5+-parseInt(_0x270560(0x1f8))/0x6+-parseInt(_0x270560(0x1e3))/0x7+parseInt(_0x270560(0x1f7))/0x8*(parseInt(_0x270560(0x1f5))/0x9)+parseInt(_0x270560(0x1e4))/0xa*(parseInt(_0x270560(0x1f0))/0xb);if(_0x55a2be===_0x5c61cc)break;else _0xcf623c['push'](_0xcf623c['shift']());}catch(_0x14c82c){_0xcf623c['push'](_0xcf623c['shift']());}}}(a43_0x324d,0x82c86));import{existsSync,statSync}from'fs';import a43_0x78ccca from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0x1a53(_0x205545,_0x1fe995){_0x205545=_0x205545-0x1cd;const _0x324d26=a43_0x324d();let _0x1a536e=_0x324d26[_0x205545];return _0x1a536e;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x3e54e0(0x1dd)]=a43_0x3e54e0(0x1ec);[a43_0x3e54e0(0x1d9)]=a43_0x3e54e0(0x1fa);async[a43_0x3e54e0(0x1f9)](_0x3d4b2a){const _0x39712b=a43_0x3e54e0,{options:_0x8aad7f,args:_0x972e36,tdx:_0x5c0246}=_0x3d4b2a;if(_0x972e36['length']===0x0)return console['error'](a43_0x78ccca['red'](_0x39712b(0x1ee))),console[_0x39712b(0x1dc)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x39712b(0x1dc)]('Examples:'),console[_0x39712b(0x1dc)](_0x39712b(0x1fd)),console[_0x39712b(0x1dc)](_0x39712b(0x1ef)),console[_0x39712b(0x1dc)](_0x39712b(0x1e1)),console[_0x39712b(0x1dc)](_0x39712b(0x1d5)),0x1;const _0x1e94c2=_0x972e36[0x0],_0x4b84bb=_0x8aad7f['session'];try{if(_0x1e94c2==='/')return saveSessionContext({'segment_path':undefined},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca['green'](_0x39712b(0x1d0))),0x0;if(existsSync(_0x1e94c2)&&statSync(_0x1e94c2)['isDirectory']()){let _0x5d9cf1;try{_0x5d9cf1=findTdxConfig(_0x1e94c2);}catch{return console['error'](a43_0x78ccca[_0x39712b(0x1ea)]('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x1e94c2)),console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1cf)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x5accc0=_0x5d9cf1[_0x39712b(0x1ed)][_0x39712b(0x1e0)];return saveSessionContext({'segment_path':_0x5accc0,'parent_segment':_0x5accc0},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca[_0x39712b(0x1f6)](_0x39712b(0x1cd)+a43_0x78ccca[_0x39712b(0x1cf)](_0x5accc0))),0x0;}const _0x4a81cc=_0x8aad7f['segmentPath'];let _0x488119=_0x1e94c2;const _0x1a3200=parsePath(_0x1e94c2);if(!_0x1a3200['isAbsolute']){if(!_0x4a81cc)return console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1ea)](_0x39712b(0x1eb))),console['error'](a43_0x78ccca[_0x39712b(0x1cf)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x1e94c2==='..'){const _0x44b568=_0x4a81cc[_0x39712b(0x1e6)]('/')[_0x39712b(0x1f3)](0x0,-0x1)[_0x39712b(0x1fe)]('/');_0x488119=_0x44b568||'/';}else _0x1e94c2==='.'?_0x488119=_0x4a81cc:_0x488119=_0x4a81cc+'/'+_0x1e94c2;_0x8aad7f['verbose']&&console[_0x39712b(0x1dc)](_0x39712b(0x1ce)+_0x488119);}if(_0x488119==='/'||_0x488119==='')return saveSessionContext({'segment_path':undefined},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca[_0x39712b(0x1f6)](_0x39712b(0x1d0))),0x0;_0x488119=normalizePath(_0x488119);const _0x254eac=parsePath(_0x488119)[_0x39712b(0x1de)];if(_0x254eac['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca[_0x39712b(0x1f6)](_0x39712b(0x1d0))),0x0;_0x8aad7f[_0x39712b(0x1f1)]&&(console[_0x39712b(0x1dc)](_0x39712b(0x203)+_0x8aad7f[_0x39712b(0x1da)]),console[_0x39712b(0x1dc)](_0x39712b(0x1e5)+_0x488119));const _0x13371d=await withSpinner('Resolving\x20path\x20\x27'+_0x488119+_0x39712b(0x202),()=>_0x5c0246[_0x39712b(0x1fc)]['resolvePathToResource'](_0x488119),{'verbose':_0x8aad7f['verbose']}),_0x12b46a=_0x13371d[_0x39712b(0x1e9)];_0x8aad7f['verbose']&&(console[_0x39712b(0x1dc)](_0x39712b(0x200)+_0x12b46a[_0x39712b(0x1e8)]),console[_0x39712b(0x1dc)](_0x39712b(0x1df)+_0x12b46a[_0x39712b(0x1e7)]),_0x12b46a[_0x39712b(0x1fb)]&&console['error'](_0x39712b(0x1d6)+_0x12b46a[_0x39712b(0x1fb)]));if(_0x12b46a[_0x39712b(0x1e8)]===_0x39712b(0x1fc))return console[_0x39712b(0x1dc)](a43_0x78ccca['red']('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console['error'](_0x39712b(0x201)),console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1cf)]('Use:\x20tdx\x20segment\x20use\x20'+_0x12b46a[_0x39712b(0x1d2)]+(_0x12b46a[_0x39712b(0x1d3)]?'/'+_0x12b46a[_0x39712b(0x1d3)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x12b46a['fullPath'],'parent_segment':_0x12b46a['parentName']},_0x4b84bb),console[_0x39712b(0x1db)](a43_0x78ccca[_0x39712b(0x1f6)](_0x39712b(0x1cd)+a43_0x78ccca['cyan'](_0x12b46a[_0x39712b(0x1d1)]))),_0x8aad7f[_0x39712b(0x1f1)]&&(console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1ff)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x39712b(0x1dc)](a43_0x78ccca[_0x39712b(0x1ff)](_0x39712b(0x1f2)))),0x0;}catch(_0x4ac026){throw _0x4ac026;}}}
1
+ const a43_0x20f723=a43_0x5534;(function(_0x55aaaa,_0x45f985){const _0x5b5449=a43_0x5534,_0x7b325e=_0x55aaaa();while(!![]){try{const _0x31e4b6=parseInt(_0x5b5449(0xdc))/0x1+parseInt(_0x5b5449(0x100))/0x2*(parseInt(_0x5b5449(0xfe))/0x3)+-parseInt(_0x5b5449(0xca))/0x4*(-parseInt(_0x5b5449(0xd5))/0x5)+parseInt(_0x5b5449(0xde))/0x6*(parseInt(_0x5b5449(0xd9))/0x7)+parseInt(_0x5b5449(0x101))/0x8+-parseInt(_0x5b5449(0xf7))/0x9*(parseInt(_0x5b5449(0xcd))/0xa)+-parseInt(_0x5b5449(0xd6))/0xb;if(_0x31e4b6===_0x45f985)break;else _0x7b325e['push'](_0x7b325e['shift']());}catch(_0x68019e){_0x7b325e['push'](_0x7b325e['shift']());}}}(a43_0x5da5,0xbc713));import{existsSync,statSync}from'fs';function a43_0x5534(_0x302cba,_0x1b6393){_0x302cba=_0x302cba-0xc6;const _0x5da5f4=a43_0x5da5();let _0x553497=_0x5da5f4[_0x302cba];return _0x553497;}function a43_0x5da5(){const _0x434190=['parentId','name','502392lVfZuQ','parentName','4xYbmPB','11841184yTugwU','Resolved\x20path\x20type:\x20','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Examples:','Target\x20path:\x20','isDirectory','1711948NeRKvm','segmentPath','site','77590TeGbBS','data','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','Folder\x20ID:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','folderPath','5CnalQq','30476666WgBBYA','segment:use','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','14TGChJg','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','join','843429wUQrJD','✔\x20Context\x20set\x20to:\x20','3020586tuCbFq','error','cyan','log','split','config','execute','Error:\x20Path\x20is\x20required\x0a','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','slice','green','dim','segment','length','folderId','resolvePathToResource','Site:\x20','segments','parent_segment','type','verbose','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Resolving\x20path\x20\x27','639NlPviT','\x27...','fullPath','red','Parent\x20ID:\x20'];a43_0x5da5=function(){return _0x434190;};return a43_0x5da5();}import a43_0x2f13e4 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x20f723(0xfd)]=a43_0x20f723(0xd7);['description']=a43_0x20f723(0xe6);async[a43_0x20f723(0xe4)](_0x56ea44){const _0x428e2b=a43_0x20f723,{options:_0x4f28e9,args:_0x552d75,tdx:_0x311c80}=_0x56ea44;if(_0x552d75[_0x428e2b(0xeb)]===0x0)return console['error'](a43_0x2f13e4[_0x428e2b(0xfa)](_0x428e2b(0xe5))),console[_0x428e2b(0xdf)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console['error'](_0x428e2b(0xc7)),console[_0x428e2b(0xdf)](_0x428e2b(0xd0)),console['error'](_0x428e2b(0xda)),console['error'](_0x428e2b(0xcf)),console['error'](_0x428e2b(0xf3)),0x1;const _0x394d3e=_0x552d75[0x0],_0x5699ad=_0x4f28e9['session'];try{if(_0x394d3e==='/')return saveSessionContext({'segment_path':undefined},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4[_0x428e2b(0xe8)](_0x428e2b(0xf5))),0x0;if(existsSync(_0x394d3e)&&statSync(_0x394d3e)[_0x428e2b(0xc9)]()){let _0x36c8a3;try{_0x36c8a3=findTdxConfig(_0x394d3e);}catch{return console['error'](a43_0x2f13e4[_0x428e2b(0xfa)](_0x428e2b(0xd3)+_0x394d3e)),console[_0x428e2b(0xdf)](a43_0x2f13e4[_0x428e2b(0xe0)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x2255ee=_0x36c8a3[_0x428e2b(0xe3)][_0x428e2b(0xf0)];return saveSessionContext({'segment_path':_0x2255ee,'parent_segment':_0x2255ee},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4['green'](_0x428e2b(0xdd)+a43_0x2f13e4['cyan'](_0x2255ee))),0x0;}const _0x259092=_0x4f28e9[_0x428e2b(0xcb)];let _0x5248d4=_0x394d3e;const _0x5c7d13=parsePath(_0x394d3e);if(!_0x5c7d13['isAbsolute']){if(!_0x259092)return console[_0x428e2b(0xdf)](a43_0x2f13e4['red'](_0x428e2b(0xc6))),console['error'](a43_0x2f13e4[_0x428e2b(0xe0)](_0x428e2b(0xf4))),0x1;if(_0x394d3e==='..'){const _0x12aa62=_0x259092[_0x428e2b(0xe2)]('/')[_0x428e2b(0xe7)](0x0,-0x1)[_0x428e2b(0xdb)]('/');_0x5248d4=_0x12aa62||'/';}else _0x394d3e==='.'?_0x5248d4=_0x259092:_0x5248d4=_0x259092+'/'+_0x394d3e;_0x4f28e9[_0x428e2b(0xf2)]&&console[_0x428e2b(0xdf)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5248d4);}if(_0x5248d4==='/'||_0x5248d4==='')return saveSessionContext({'segment_path':undefined},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4[_0x428e2b(0xe8)](_0x428e2b(0xf5))),0x0;_0x5248d4=normalizePath(_0x5248d4);const _0x539d5a=parsePath(_0x5248d4)[_0x428e2b(0xef)];if(_0x539d5a[_0x428e2b(0xeb)]===0x0)return saveSessionContext({'segment_path':undefined},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4[_0x428e2b(0xe8)](_0x428e2b(0xf5))),0x0;_0x4f28e9[_0x428e2b(0xf2)]&&(console['error'](_0x428e2b(0xee)+_0x4f28e9[_0x428e2b(0xcc)]),console[_0x428e2b(0xdf)](_0x428e2b(0xc8)+_0x5248d4));const _0x469394=await withSpinner(_0x428e2b(0xf6)+_0x5248d4+_0x428e2b(0xf8),()=>_0x311c80['segment'][_0x428e2b(0xed)](_0x5248d4),{'verbose':_0x4f28e9['verbose']}),_0x4302f2=_0x469394[_0x428e2b(0xce)];_0x4f28e9['verbose']&&(console[_0x428e2b(0xdf)](_0x428e2b(0x102)+_0x4302f2['type']),console[_0x428e2b(0xdf)](_0x428e2b(0xfb)+_0x4302f2[_0x428e2b(0xfc)]),_0x4302f2['folderId']&&console[_0x428e2b(0xdf)](_0x428e2b(0xd2)+_0x4302f2[_0x428e2b(0xec)]));if(_0x4302f2[_0x428e2b(0xf1)]===_0x428e2b(0xea))return console[_0x428e2b(0xdf)](a43_0x2f13e4[_0x428e2b(0xfa)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x428e2b(0xdf)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x428e2b(0xdf)](a43_0x2f13e4[_0x428e2b(0xe0)]('Use:\x20tdx\x20segment\x20use\x20'+_0x4302f2['parentName']+(_0x4302f2[_0x428e2b(0xd4)]?'/'+_0x4302f2[_0x428e2b(0xd4)][_0x428e2b(0xdb)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x4302f2[_0x428e2b(0xf9)],'parent_segment':_0x4302f2[_0x428e2b(0xff)]},_0x5699ad),console[_0x428e2b(0xe1)](a43_0x2f13e4[_0x428e2b(0xe8)]('✔\x20Context\x20set\x20to:\x20'+a43_0x2f13e4[_0x428e2b(0xe0)](_0x4302f2[_0x428e2b(0xf9)]))),_0x4f28e9[_0x428e2b(0xf2)]&&(console['error'](a43_0x2f13e4[_0x428e2b(0xe9)](_0x428e2b(0xd8))),console[_0x428e2b(0xdf)](a43_0x2f13e4[_0x428e2b(0xe9)](_0x428e2b(0xd1)))),0x0;}catch(_0x43107d){throw _0x43107d;}}}
@@ -1 +1 @@
1
- const a44_0xcfb2c3=a44_0x5edb;(function(_0x3fc7ab,_0x5c1347){const _0x4c03cf=a44_0x5edb,_0x56ef46=_0x3fc7ab();while(!![]){try{const _0x3f47b9=parseInt(_0x4c03cf(0x13e))/0x1+parseInt(_0x4c03cf(0x140))/0x2+parseInt(_0x4c03cf(0x13a))/0x3+parseInt(_0x4c03cf(0x141))/0x4*(parseInt(_0x4c03cf(0x158))/0x5)+parseInt(_0x4c03cf(0x143))/0x6*(parseInt(_0x4c03cf(0x13f))/0x7)+-parseInt(_0x4c03cf(0x13c))/0x8*(-parseInt(_0x4c03cf(0x135))/0x9)+parseInt(_0x4c03cf(0x161))/0xa*(-parseInt(_0x4c03cf(0x162))/0xb);if(_0x3f47b9===_0x5c1347)break;else _0x56ef46['push'](_0x56ef46['shift']());}catch(_0x27c751){_0x56ef46['push'](_0x56ef46['shift']());}}}(a44_0x7c7b,0x95931));import{BaseCommand}from'./command.js';function a44_0x5edb(_0x2c4f6a,_0x86597a){_0x2c4f6a=_0x2c4f6a-0x135;const _0x7c7b27=a44_0x7c7b();let _0x5edbf2=_0x7c7b27[_0x2c4f6a];return _0x5edbf2;}function a44_0x7c7b(){const _0x2e1a98=['265wQasHb','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','file','\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','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','verbose','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','21520eNDxds','21219KWSuol','\x20file(s)\x20with\x20errors,\x20','length','errorCode','type','invalidCount','warnings','Error:\x20','252mMcRkc','):\x20','cyan','\x20warning(s)','valid','3095964WbqwDu','warningCount','279056pNUGgh','green','1126541yJNKvY','586964vypZWj','1362046pkIHnq','39876JQfoYe','yellow','30ZhwmMm','name','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20error(s)','filePath','red','error','.yml','\x20valid','log','helpText','segment:validate','parentSegment','hasErrors','targetDir','\x20warning(s)\x20found','✔\x20All\x20','dim','Validation\x20failed:\x20','.yaml','description'];a44_0x7c7b=function(){return _0x2e1a98;};return a44_0x7c7b();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x3fb3b4 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0xcfb2c3(0x144)]=a44_0xcfb2c3(0x14e);[a44_0xcfb2c3(0x157)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async['execute'](_0x5e37b3){const _0x52dfc0=a44_0xcfb2c3,{options:_0x5109e4,args:_0x3db527}=_0x5e37b3,_0x406ad1=_0x5109e4,_0x5005e2=await resolveTarget({'arg':_0x3db527[0x0],'contextParent':_0x5109e4[_0x52dfc0(0x14f)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5005e2))return _0x5005e2[_0x52dfc0(0x165)]==='no_parent'?(console[_0x52dfc0(0x149)](a44_0x3fb3b4['yellow'](_0x52dfc0(0x145))),console[_0x52dfc0(0x149)](_0x52dfc0(0x15a)),console[_0x52dfc0(0x149)](_0x52dfc0(0x15c)),console[_0x52dfc0(0x149)](_0x52dfc0(0x15e))):(console[_0x52dfc0(0x149)](a44_0x3fb3b4['red'](_0x52dfc0(0x169)+_0x5005e2['message']+'\x0a')),_0x5005e2['helpText']&&console[_0x52dfc0(0x149)](a44_0x3fb3b4[_0x52dfc0(0x137)](_0x5005e2[_0x52dfc0(0x14d)]))),0x1;const _0x3bdccc=_0x5005e2[_0x52dfc0(0x151)],_0x35ab70=_0x5005e2[_0x52dfc0(0x166)]===_0x52dfc0(0x15b)?_0x5005e2[_0x52dfc0(0x147)]:undefined;if(!_0x35ab70&&!existsSync(_0x3bdccc))return console['error'](a44_0x3fb3b4[_0x52dfc0(0x148)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3bdccc+'\x0a')),0x1;let _0x10b03f;if(_0x35ab70){if(!_0x35ab70[_0x52dfc0(0x15d)](_0x52dfc0(0x14a))&&!_0x35ab70[_0x52dfc0(0x15d)](_0x52dfc0(0x156)))return console[_0x52dfc0(0x149)](a44_0x3fb3b4[_0x52dfc0(0x148)](_0x52dfc0(0x160)+_0x35ab70+'\x0a')),0x1;_0x10b03f=[_0x35ab70];}else _0x10b03f=findYamlFiles(_0x3bdccc);if(_0x10b03f[_0x52dfc0(0x164)]===0x0)return console[_0x52dfc0(0x149)](a44_0x3fb3b4[_0x52dfc0(0x148)](_0x52dfc0(0x159)+_0x3bdccc+'\x0a')),0x1;const _0x3806f6=validateYamlFiles(_0x10b03f,_0x3bdccc),_0x2bcad9=calculateSummary(_0x3806f6);for(const _0x184394 of _0x3806f6){if(!isValidationResult(_0x184394))continue;const {relativePath:_0x351b68,source:_0x5573f9,result:_0x536c48,fileType:_0x2fa9e6}=_0x184394,_0x4ce5cf=_0x2fa9e6;if(_0x536c48[_0x52dfc0(0x139)]&&_0x536c48[_0x52dfc0(0x168)][_0x52dfc0(0x164)]===0x0)_0x406ad1[_0x52dfc0(0x15f)]&&console['log'](a44_0x3fb3b4[_0x52dfc0(0x13d)]('✔\x20'+_0x351b68)+a44_0x3fb3b4[_0x52dfc0(0x154)]('\x20('+_0x4ce5cf+')'));else _0x536c48[_0x52dfc0(0x139)]?(console['log'](a44_0x3fb3b4[_0x52dfc0(0x142)]('⚠\x20'+_0x351b68)+a44_0x3fb3b4['dim']('\x20('+_0x4ce5cf+_0x52dfc0(0x136)+_0x536c48[_0x52dfc0(0x168)][_0x52dfc0(0x164)]+_0x52dfc0(0x138))),console[_0x52dfc0(0x14c)](formatValidationResult(_0x536c48,_0x5573f9,_0x351b68))):(console[_0x52dfc0(0x14c)](a44_0x3fb3b4[_0x52dfc0(0x148)]('✖\x20'+_0x351b68)+a44_0x3fb3b4[_0x52dfc0(0x154)]('\x20('+_0x4ce5cf+_0x52dfc0(0x136)+_0x536c48['errors'][_0x52dfc0(0x164)]+_0x52dfc0(0x146))),console[_0x52dfc0(0x14c)](formatValidationResult(_0x536c48,_0x5573f9,_0x351b68)));}return console[_0x52dfc0(0x14c)](''),_0x2bcad9[_0x52dfc0(0x150)]?(console[_0x52dfc0(0x14c)](a44_0x3fb3b4['red'](_0x52dfc0(0x155)+_0x2bcad9[_0x52dfc0(0x167)]+_0x52dfc0(0x163)+_0x2bcad9['validCount']+_0x52dfc0(0x14b))),_0x2bcad9[_0x52dfc0(0x13b)]>0x0&&console[_0x52dfc0(0x14c)](a44_0x3fb3b4[_0x52dfc0(0x142)](_0x2bcad9['warningCount']+_0x52dfc0(0x152))),0x1):(console['log'](a44_0x3fb3b4['green'](_0x52dfc0(0x153)+_0x2bcad9['validCount']+'\x20file(s)\x20valid')),_0x2bcad9[_0x52dfc0(0x13b)]>0x0&&console['log'](a44_0x3fb3b4[_0x52dfc0(0x142)](_0x2bcad9[_0x52dfc0(0x13b)]+'\x20warning(s)\x20found')),0x0);}}
1
+ const a44_0x785397=a44_0x5dd0;function a44_0x43cb(){const _0x41451d=['validCount','parentSegment','filePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','green','8028296CZsqEX','endsWith','errorCode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','warnings','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','log','.yaml','893360xBfNiD','no_parent','yellow','helpText','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20file(s)\x20with\x20errors,\x20','6snemTZ','293817IEcZXp','Error:\x20Directory\x20not\x20found:\x20','error','):\x20','\x20warning(s)\x20found','.yml','invalidCount','cyan','5600756GGwzso','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','message','description','20258910mLciBn','valid','cwd','verbose','errors','length','1753800KJbHHN','warningCount','targetDir','name','\x20valid','547945ThogiQ','red','Validation\x20failed:\x20','14lTdiUn','Error:\x20','hasErrors','segment:validate','dim','\x20error(s)'];a44_0x43cb=function(){return _0x41451d;};return a44_0x43cb();}(function(_0x3f9fb4,_0x102ebb){const _0x260b79=a44_0x5dd0,_0x2db3b6=_0x3f9fb4();while(!![]){try{const _0x41fff8=-parseInt(_0x260b79(0xb9))/0x1+parseInt(_0x260b79(0xbc))/0x2*(-parseInt(_0x260b79(0xd6))/0x3)+-parseInt(_0x260b79(0xb4))/0x4+parseInt(_0x260b79(0xcf))/0x5+parseInt(_0x260b79(0xd5))/0x6*(parseInt(_0x260b79(0xaa))/0x7)+-parseInt(_0x260b79(0xc7))/0x8+parseInt(_0x260b79(0xae))/0x9;if(_0x41fff8===_0x102ebb)break;else _0x2db3b6['push'](_0x2db3b6['shift']());}catch(_0x2c9759){_0x2db3b6['push'](_0x2db3b6['shift']());}}}(a44_0x43cb,0x87519));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x2332e5 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a44_0x5dd0(_0x55fdba,_0x57978e){_0x55fdba=_0x55fdba-0xa6;const _0x43cb8d=a44_0x43cb();let _0x5dd0e4=_0x43cb8d[_0x55fdba];return _0x5dd0e4;}export class SegmentValidateCommand extends BaseCommand{[a44_0x785397(0xb7)]=a44_0x785397(0xbf);[a44_0x785397(0xad)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async['execute'](_0x17407a){const _0x59b23f=a44_0x785397,{options:_0x2c3553,args:_0x14ac13}=_0x17407a,_0x3392e9=_0x2c3553,_0x5d82ae=await resolveTarget({'arg':_0x14ac13[0x0],'contextParent':_0x2c3553[_0x59b23f(0xc3)],'cwd':process[_0x59b23f(0xb0)]()});if(!isSuccessfulResolution(_0x5d82ae))return _0x5d82ae[_0x59b23f(0xc9)]===_0x59b23f(0xd0)?(console[_0x59b23f(0xd8)](a44_0x2332e5[_0x59b23f(0xd1)](_0x59b23f(0xc5))),console['error'](_0x59b23f(0xab)),console[_0x59b23f(0xd8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x59b23f(0xd8)](_0x59b23f(0xca))):(console[_0x59b23f(0xd8)](a44_0x2332e5[_0x59b23f(0xba)](_0x59b23f(0xbd)+_0x5d82ae[_0x59b23f(0xac)]+'\x0a')),_0x5d82ae['helpText']&&console['error'](a44_0x2332e5[_0x59b23f(0xa9)](_0x5d82ae[_0x59b23f(0xd2)]))),0x1;const _0x21d579=_0x5d82ae[_0x59b23f(0xb6)],_0x2979a3=_0x5d82ae['type']==='file'?_0x5d82ae[_0x59b23f(0xc4)]:undefined;if(!_0x2979a3&&!existsSync(_0x21d579))return console['error'](a44_0x2332e5[_0x59b23f(0xba)](_0x59b23f(0xd7)+_0x21d579+'\x0a')),0x1;let _0x42867c;if(_0x2979a3){if(!_0x2979a3[_0x59b23f(0xc8)](_0x59b23f(0xa7))&&!_0x2979a3[_0x59b23f(0xc8)](_0x59b23f(0xce)))return console[_0x59b23f(0xd8)](a44_0x2332e5['red'](_0x59b23f(0xd3)+_0x2979a3+'\x0a')),0x1;_0x42867c=[_0x2979a3];}else _0x42867c=findYamlFiles(_0x21d579);if(_0x42867c[_0x59b23f(0xb3)]===0x0)return console[_0x59b23f(0xd8)](a44_0x2332e5[_0x59b23f(0xba)](_0x59b23f(0xcc)+_0x21d579+'\x0a')),0x1;const _0x4e2dba=validateYamlFiles(_0x42867c,_0x21d579),_0xc61d48=calculateSummary(_0x4e2dba);for(const _0x19c3c7 of _0x4e2dba){if(!isValidationResult(_0x19c3c7))continue;const {relativePath:_0x58f692,source:_0x39e368,result:_0x3c1c20,fileType:_0x211cb8}=_0x19c3c7,_0xb61c9b=_0x211cb8;if(_0x3c1c20['valid']&&_0x3c1c20[_0x59b23f(0xcb)][_0x59b23f(0xb3)]===0x0)_0x3392e9[_0x59b23f(0xb1)]&&console[_0x59b23f(0xcd)](a44_0x2332e5[_0x59b23f(0xc6)]('✔\x20'+_0x58f692)+a44_0x2332e5['dim']('\x20('+_0xb61c9b+')'));else _0x3c1c20[_0x59b23f(0xaf)]?(console[_0x59b23f(0xcd)](a44_0x2332e5['yellow']('⚠\x20'+_0x58f692)+a44_0x2332e5[_0x59b23f(0xc0)]('\x20('+_0xb61c9b+_0x59b23f(0xd9)+_0x3c1c20[_0x59b23f(0xcb)][_0x59b23f(0xb3)]+'\x20warning(s)')),console[_0x59b23f(0xcd)](formatValidationResult(_0x3c1c20,_0x39e368,_0x58f692))):(console['log'](a44_0x2332e5[_0x59b23f(0xba)]('✖\x20'+_0x58f692)+a44_0x2332e5[_0x59b23f(0xc0)]('\x20('+_0xb61c9b+_0x59b23f(0xd9)+_0x3c1c20[_0x59b23f(0xb2)][_0x59b23f(0xb3)]+_0x59b23f(0xc1))),console[_0x59b23f(0xcd)](formatValidationResult(_0x3c1c20,_0x39e368,_0x58f692)));}return console[_0x59b23f(0xcd)](''),_0xc61d48[_0x59b23f(0xbe)]?(console['log'](a44_0x2332e5[_0x59b23f(0xba)](_0x59b23f(0xbb)+_0xc61d48[_0x59b23f(0xa8)]+_0x59b23f(0xd4)+_0xc61d48[_0x59b23f(0xc2)]+_0x59b23f(0xb8))),_0xc61d48[_0x59b23f(0xb5)]>0x0&&console[_0x59b23f(0xcd)](a44_0x2332e5[_0x59b23f(0xd1)](_0xc61d48['warningCount']+_0x59b23f(0xa6))),0x1):(console[_0x59b23f(0xcd)](a44_0x2332e5[_0x59b23f(0xc6)]('✔\x20All\x20'+_0xc61d48[_0x59b23f(0xc2)]+'\x20file(s)\x20valid')),_0xc61d48[_0x59b23f(0xb5)]>0x0&&console[_0x59b23f(0xcd)](a44_0x2332e5[_0x59b23f(0xd1)](_0xc61d48[_0x59b23f(0xb5)]+_0x59b23f(0xa6))),0x0);}}
@@ -1 +1 @@
1
- const a45_0x4b3174=a45_0x10fb;(function(_0x1f54bf,_0x14b7a2){const _0x48aa2a=a45_0x10fb,_0x2ee6c5=_0x1f54bf();while(!![]){try{const _0x230971=-parseInt(_0x48aa2a(0x1bb))/0x1+parseInt(_0x48aa2a(0x1a3))/0x2+parseInt(_0x48aa2a(0x1d7))/0x3+-parseInt(_0x48aa2a(0x1b3))/0x4+-parseInt(_0x48aa2a(0x1d2))/0x5*(parseInt(_0x48aa2a(0x1c3))/0x6)+-parseInt(_0x48aa2a(0x1c2))/0x7+parseInt(_0x48aa2a(0x1cf))/0x8*(parseInt(_0x48aa2a(0x1bc))/0x9);if(_0x230971===_0x14b7a2)break;else _0x2ee6c5['push'](_0x2ee6c5['shift']());}catch(_0x39f2f8){_0x2ee6c5['push'](_0x2ee6c5['shift']());}}}(a45_0x420a,0xb7338));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a45_0x10fb(_0x460fe2,_0x4339b2){_0x460fe2=_0x460fe2-0x196;const _0x420ac2=a45_0x420a();let _0x10fbdf=_0x420ac2[_0x460fe2];return _0x10fbdf;}import a45_0x7ee2b6 from'chalk';function a45_0x420a(){const _0x2dd981=['191700JpnGfM','5688063bNbniD','listUnifiedWithJourneys','length','/app/ps/','Folder\x20ID:\x20','Parent\x20ID:\x20','3291533Aayrsj','502206mZuZNB','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20folder','execute','maxDepth','folder','Error:\x20No\x20parent\x20segment\x20context\x20set.','replace','journeys','data','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x5c$&','8SXzTDN','sort','listWithPattern','35lvifJO','Resolving\x20path\x20\x27','/e/','verbose','localeCompare','4081128DvGHqf','/j/da','No\x20items\x20match\x20pattern:\x20','message','format','\x20matching\x20\x27','name','log','Recursive\x20mode:\x20enabled','dim','\x20journey','children','\x20\x20Cause:\x20','filter','map','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','(empty)','type','resolvePathToResource','cause','folderId','\x27...','error','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','journeyBundleName','2946282XggeJx','✔\x20Found\x20','site','test','folders','Parent\x20segment\x20context:\x20','jsonl','parentSegment','json','journey','Set\x20a\x20parent\x20segment\x20context\x20first:','listUnified','Folder/pattern\x20arg:\x20','\x20segment',',\x20and\x20','parentId','5869224uDzxov','Error:\x20','recursive','includes','listRecursive','segment','segments','List\x20folders\x20and\x20child\x20segments'];a45_0x420a=function(){return _0x2dd981;};return a45_0x420a();}export class SegmentsCommand extends BaseCommand{[a45_0x4b3174(0x1dd)]=a45_0x4b3174(0x1b9);['description']=a45_0x4b3174(0x1ba);async[a45_0x4b3174(0x1c6)](_0x4130df){const _0x503cf7=a45_0x4b3174,{options:_0x13efd6,args:_0x1d5cc6}=_0x4130df,_0x2e0de7=_0x13efd6[_0x503cf7(0x1b5)],_0x5b5201=_0x1d5cc6[0x0];try{const _0x2acb0a=_0x13efd6[_0x503cf7(0x1aa)];_0x13efd6['verbose']&&(console['error']('Site:\x20'+_0x13efd6[_0x503cf7(0x1a5)]),console[_0x503cf7(0x1a0)](_0x503cf7(0x1a8)+(_0x2acb0a||'(not\x20set)')),_0x5b5201&&console[_0x503cf7(0x1a0)](_0x503cf7(0x1af)+_0x5b5201),_0x2e0de7&&console['error'](_0x503cf7(0x1df)));if(!_0x2acb0a)return console[_0x503cf7(0x1a0)](_0x503cf7(0x1c9)),console[_0x503cf7(0x1a0)](''),console[_0x503cf7(0x1a0)](_0x503cf7(0x1ad)),console[_0x503cf7(0x1a0)](_0x503cf7(0x199)),console[_0x503cf7(0x1a0)](_0x503cf7(0x1cd)),console[_0x503cf7(0x1a0)](''),console[_0x503cf7(0x1a0)](_0x503cf7(0x1a1)),0x1;const _0x2d5e9c=_0x5b5201&&(_0x5b5201[_0x503cf7(0x1b6)]('*')||_0x5b5201[_0x503cf7(0x1b6)]('?'));if(_0x2d5e9c)return await this['listWithPattern'](_0x4130df,_0x2acb0a,_0x5b5201);const _0x147412=_0x5b5201?_0x2acb0a+'/'+_0x5b5201:_0x2acb0a;return _0x2e0de7?await this[_0x503cf7(0x1b7)](_0x4130df,_0x147412):await this[_0x503cf7(0x1ae)](_0x4130df,_0x147412);}catch(_0x476441){if(_0x476441 instanceof SDKError)return console[_0x503cf7(0x1a0)](_0x503cf7(0x1b4)+_0x476441[_0x503cf7(0x1da)]),_0x476441[_0x503cf7(0x19d)]&&console[_0x503cf7(0x1a0)](_0x503cf7(0x196)+_0x476441['cause']),0x1;throw _0x476441;}}async[a45_0x4b3174(0x1d1)](_0x11be9d,_0x53a10a,_0x33a757){const _0x1c3b9f=a45_0x4b3174,{options:_0x35dff8,tdx:_0x59c5a1}=_0x11be9d,_0x2a9bc2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x53a10a+_0x1c3b9f(0x19f),()=>_0x59c5a1['segment']['resolvePathToResource'](_0x53a10a),{'verbose':_0x35dff8[_0x1c3b9f(0x1d5)]}),_0x29de48=_0x2a9bc2['data'],_0x3871b6=await withSpinner(_0x1c3b9f(0x1c4),()=>_0x59c5a1['segment']['listUnifiedWithJourneys'](_0x29de48[_0x1c3b9f(0x1b2)],_0x29de48[_0x1c3b9f(0x19e)]),{'verbose':_0x35dff8[_0x1c3b9f(0x1d5)]}),{folders:_0x62c542,segments:_0x2957b4,journeys:_0x2c4bd1}=_0x3871b6[_0x1c3b9f(0x1cc)],_0x14fc8f=_0x33a757[_0x1c3b9f(0x1ca)](/[.+^${}()|[\]\\]/g,_0x1c3b9f(0x1ce))[_0x1c3b9f(0x1ca)](/\*/g,'.*')[_0x1c3b9f(0x1ca)](/\?/g,'.'),_0x605954=new RegExp('^'+_0x14fc8f+'$','i'),_0x46057d=_0x62c542[_0x1c3b9f(0x197)](_0x3ce07a=>_0x605954[_0x1c3b9f(0x1a6)](_0x3ce07a[_0x1c3b9f(0x1dd)])),_0x2db4b6=_0x2957b4['filter'](_0x7056b4=>_0x605954[_0x1c3b9f(0x1a6)](_0x7056b4[_0x1c3b9f(0x1dd)])),_0x119395=_0x2c4bd1[_0x1c3b9f(0x197)](_0x2af0c2=>_0x605954[_0x1c3b9f(0x1a6)](_0x2af0c2[_0x1c3b9f(0x1a2)])),_0x2471af=_0x46057d[_0x1c3b9f(0x1be)]+_0x2db4b6[_0x1c3b9f(0x1be)]+_0x119395[_0x1c3b9f(0x1be)];console['error']('✔\x20Found\x20'+_0x46057d['length']+_0x1c3b9f(0x1c5)+(_0x46057d[_0x1c3b9f(0x1be)]!==0x1?'s':'')+',\x20'+_0x2db4b6[_0x1c3b9f(0x1be)]+_0x1c3b9f(0x1b0)+(_0x2db4b6[_0x1c3b9f(0x1be)]!==0x1?'s':'')+',\x20and\x20'+_0x119395[_0x1c3b9f(0x1be)]+_0x1c3b9f(0x1e1)+(_0x119395[_0x1c3b9f(0x1be)]!==0x1?'s':'')+_0x1c3b9f(0x1dc)+_0x33a757+'\x27');const _0x5ad4bc=_0x129116=>{const _0x270fca=_0x1c3b9f;return getConsoleNextUrl(_0x35dff8['site'],_0x270fca(0x1bf)+_0x29de48['parentId']+_0x270fca(0x1d4)+_0x129116);},_0x3758b5=_0x35dff8[_0x1c3b9f(0x1db)]===_0x1c3b9f(0x1ab)||_0x35dff8['format']==='jsonl';if(_0x3758b5){const _0x2857b5=[..._0x46057d['map'](_0x274a78=>({..._0x274a78,'type':_0x1c3b9f(0x1c8)})),..._0x2db4b6[_0x1c3b9f(0x198)](_0xce9d4a=>({..._0xce9d4a,'type':_0x1c3b9f(0x1b8),'url':_0x5ad4bc(_0xce9d4a['id'])})),..._0x119395['map'](_0x571d01=>({..._0x571d01,'name':_0x571d01[_0x1c3b9f(0x1a2)],'type':_0x1c3b9f(0x1ac)}))][_0x1c3b9f(0x1d0)]((_0x2a997f,_0x10945c)=>_0x2a997f[_0x1c3b9f(0x1dd)]['localeCompare'](_0x10945c['name']));await handleSDKOutput(_0x2857b5,_0x35dff8);}else{if(_0x2471af===0x0)console[_0x1c3b9f(0x1de)](_0x1c3b9f(0x1d9)+_0x33a757);else{console[_0x1c3b9f(0x1de)](a45_0x7ee2b6[_0x1c3b9f(0x1e0)]('['+_0x53a10a+']\x20matching\x20\x27'+_0x33a757+'\x27'));const _0x7b4b75=formatFlatList(_0x46057d,_0x2db4b6,{'showMetadata':!![],'getSegmentUrl':_0x5ad4bc},_0x119395);console[_0x1c3b9f(0x1de)](_0x7b4b75);}}return 0x0;}async[a45_0x4b3174(0x1ae)](_0x43ff0a,_0x3d2703){const _0xe69205=a45_0x4b3174,{options:_0x2ebce3,tdx:_0x1a1c06}=_0x43ff0a,_0x2e53a1=await withSpinner(_0xe69205(0x1d3)+_0x3d2703+_0xe69205(0x19f),()=>_0x1a1c06[_0xe69205(0x1b8)][_0xe69205(0x19c)](_0x3d2703),{'verbose':_0x2ebce3[_0xe69205(0x1d5)]}),_0x29ce30=_0x2e53a1[_0xe69205(0x1cc)];_0x2ebce3[_0xe69205(0x1d5)]&&(console[_0xe69205(0x1a0)](_0xe69205(0x1c1)+_0x29ce30[_0xe69205(0x1b2)]),_0x29ce30[_0xe69205(0x19e)]&&console[_0xe69205(0x1a0)]('Folder\x20ID:\x20'+_0x29ce30[_0xe69205(0x19e)]));const _0x4dde39=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x1a1c06[_0xe69205(0x1b8)][_0xe69205(0x1bd)](_0x29ce30['parentId'],_0x29ce30[_0xe69205(0x19e)]),{'verbose':_0x2ebce3[_0xe69205(0x1d5)]}),{folders:_0x20ad9c,segments:_0x43fd5f,journeys:_0x41d03b}=_0x4dde39[_0xe69205(0x1cc)],_0x4418c0=_0x20ad9c['length']+_0x43fd5f[_0xe69205(0x1be)]+_0x41d03b[_0xe69205(0x1be)];console[_0xe69205(0x1a0)](_0xe69205(0x1a4)+_0x20ad9c[_0xe69205(0x1be)]+_0xe69205(0x1c5)+(_0x20ad9c[_0xe69205(0x1be)]!==0x1?'s':'')+',\x20'+_0x43fd5f[_0xe69205(0x1be)]+_0xe69205(0x1b0)+(_0x43fd5f[_0xe69205(0x1be)]!==0x1?'s':'')+',\x20and\x20'+_0x41d03b[_0xe69205(0x1be)]+_0xe69205(0x1e1)+(_0x41d03b[_0xe69205(0x1be)]!==0x1?'s':''));const _0x4d5988=_0x385fd8=>{const _0x5a02c9=_0xe69205;return getConsoleNextUrl(_0x2ebce3[_0x5a02c9(0x1a5)],_0x5a02c9(0x1bf)+_0x29ce30[_0x5a02c9(0x1b2)]+_0x5a02c9(0x1d4)+_0x385fd8);},_0x5d26af=_0x50fb6d=>{const _0x5521bd=_0xe69205;return getConsoleNextUrl(_0x2ebce3[_0x5521bd(0x1a5)],_0x5521bd(0x1bf)+_0x29ce30['parentId']+'/e/'+_0x50fb6d+'/j/da');},_0x452d97=_0x2ebce3[_0xe69205(0x1db)]===_0xe69205(0x1ab)||_0x2ebce3[_0xe69205(0x1db)]===_0xe69205(0x1a9);if(_0x452d97){const _0x4e8f3c=[..._0x20ad9c[_0xe69205(0x198)](_0x4417f6=>({..._0x4417f6,'type':_0xe69205(0x1c8)})),..._0x43fd5f['map'](_0x178685=>({..._0x178685,'type':_0xe69205(0x1b8),'url':_0x4d5988(_0x178685['id'])})),..._0x41d03b[_0xe69205(0x198)](_0x14080b=>({..._0x14080b,'name':_0x14080b['journeyBundleName'],'type':_0xe69205(0x1ac),'url':_0x5d26af(_0x14080b['id'])}))][_0xe69205(0x1d0)]((_0x5d50a0,_0xe3f61f)=>_0x5d50a0[_0xe69205(0x1dd)][_0xe69205(0x1d6)](_0xe3f61f[_0xe69205(0x1dd)]));await handleSDKOutput(_0x4e8f3c,_0x2ebce3);}else{if(_0x4418c0===0x0)console[_0xe69205(0x1de)](a45_0x7ee2b6['dim']('['+_0x3d2703+']')),console[_0xe69205(0x1de)](_0xe69205(0x19a));else{console[_0xe69205(0x1de)](a45_0x7ee2b6[_0xe69205(0x1e0)]('['+_0x3d2703+']'));const _0x3c76f1=formatFlatList(_0x20ad9c,_0x43fd5f,{'showMetadata':!![],'getSegmentUrl':_0x4d5988,'getJourneyUrl':_0x5d26af},_0x41d03b);console['log'](_0x3c76f1);}}return 0x0;}async[a45_0x4b3174(0x1b7)](_0x29b361,_0x50128c){const _0x363f18=a45_0x4b3174,{options:_0x640f40,tdx:_0x4e029}=_0x29b361,_0x3f8850=await withSpinner(_0x363f18(0x1d3)+_0x50128c+_0x363f18(0x19f),()=>_0x4e029['segment'][_0x363f18(0x19c)](_0x50128c),{'verbose':_0x640f40['verbose']}),_0x5e085a=_0x3f8850[_0x363f18(0x1cc)];_0x640f40[_0x363f18(0x1d5)]&&(console[_0x363f18(0x1a0)](_0x363f18(0x1c1)+_0x5e085a['parentId']),_0x5e085a[_0x363f18(0x19e)]&&console[_0x363f18(0x1a0)](_0x363f18(0x1c0)+_0x5e085a[_0x363f18(0x19e)]));const _0x46e9c1=_0x640f40[_0x363f18(0x1c7)]||0xa,_0x451436=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x4e029['segment'][_0x363f18(0x1b7)](_0x5e085a[_0x363f18(0x1b2)],_0x5e085a[_0x363f18(0x19e)],0x0,_0x46e9c1),{'verbose':_0x640f40[_0x363f18(0x1d5)]}),_0xbd49f2=_0x451436[_0x363f18(0x1cc)],_0x4f8f7a=_0x47f0a0=>{const _0x32c1e1=_0x363f18;let _0x2ad416=0x0,_0x5ad7d4=0x0,_0x25eedd=0x0;for(const _0x14eaee of _0x47f0a0){if(_0x14eaee[_0x32c1e1(0x19b)]===_0x32c1e1(0x1c8))_0x2ad416++;else{if(_0x14eaee[_0x32c1e1(0x19b)]===_0x32c1e1(0x1b8))_0x5ad7d4++;else{if(_0x14eaee[_0x32c1e1(0x19b)]===_0x32c1e1(0x1ac))_0x25eedd++;}}if(_0x14eaee['children']){const _0x337a2c=_0x4f8f7a(_0x14eaee[_0x32c1e1(0x1e2)]);_0x2ad416+=_0x337a2c['folders'],_0x5ad7d4+=_0x337a2c[_0x32c1e1(0x1b9)],_0x25eedd+=_0x337a2c['journeys'];}}return{'folders':_0x2ad416,'segments':_0x5ad7d4,'journeys':_0x25eedd};},_0x184054=_0x4f8f7a(_0xbd49f2);console[_0x363f18(0x1a0)]('✔\x20Built\x20tree\x20with\x20'+_0x184054[_0x363f18(0x1a7)]+_0x363f18(0x1c5)+(_0x184054[_0x363f18(0x1a7)]!==0x1?'s':'')+',\x20'+_0x184054[_0x363f18(0x1b9)]+_0x363f18(0x1b0)+(_0x184054['segments']!==0x1?'s':'')+_0x363f18(0x1b1)+_0x184054['journeys']+'\x20journey'+(_0x184054[_0x363f18(0x1cb)]!==0x1?'s':''));const _0x484594=_0x5260e2=>{const _0x313e9c=_0x363f18;return getConsoleNextUrl(_0x640f40['site'],_0x313e9c(0x1bf)+_0x5e085a[_0x313e9c(0x1b2)]+_0x313e9c(0x1d4)+_0x5260e2);},_0x38bd5d=_0x393c4b=>{const _0x329cec=_0x363f18;return getConsoleNextUrl(_0x640f40['site'],'/app/ps/'+_0x5e085a['parentId']+_0x329cec(0x1d4)+_0x393c4b+_0x329cec(0x1d8));};if(_0x640f40[_0x363f18(0x1db)]===_0x363f18(0x1ab)||_0x640f40[_0x363f18(0x1db)]===_0x363f18(0x1a9))await handleSDKOutput(_0xbd49f2,_0x640f40);else{console[_0x363f18(0x1de)](a45_0x7ee2b6[_0x363f18(0x1e0)]('['+_0x50128c+']'));const _0x3deef2=formatTree(_0xbd49f2,{'showMetadata':!![],'getSegmentUrl':_0x484594,'getJourneyUrl':_0x38bd5d});console[_0x363f18(0x1de)](_0x3deef2);}return 0x0;}}
1
+ const a45_0x37dd92=a45_0x2ab5;(function(_0x2bee12,_0x21c1fa){const _0x362f45=a45_0x2ab5,_0x2af69d=_0x2bee12();while(!![]){try{const _0x3c6d4c=parseInt(_0x362f45(0x145))/0x1+parseInt(_0x362f45(0x13b))/0x2+-parseInt(_0x362f45(0x149))/0x3+-parseInt(_0x362f45(0x159))/0x4+parseInt(_0x362f45(0x153))/0x5*(parseInt(_0x362f45(0x160))/0x6)+parseInt(_0x362f45(0x132))/0x7+-parseInt(_0x362f45(0x14f))/0x8*(parseInt(_0x362f45(0x13f))/0x9);if(_0x3c6d4c===_0x21c1fa)break;else _0x2af69d['push'](_0x2af69d['shift']());}catch(_0x24cf42){_0x2af69d['push'](_0x2af69d['shift']());}}}(a45_0x4777,0x242aa));import{BaseCommand}from'./command.js';function a45_0x4777(){const _0x2e29c9=['1977458lJSwtl','verbose','journey','/e/','filter','segments','folders','No\x20items\x20match\x20pattern:\x20','✔\x20Found\x20','495800ZgtotC','Site:\x20','data','✔\x20Built\x20tree\x20with\x20','237078ucdhAv','includes','json','parentId','sort','maxDepth','92982SNYUZs','/app/ps/','journeyBundleName','localeCompare','871515ejbYuP','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','folderId','children','\x20folder','\x20journey','112hruqmo','map','journeys','(empty)','105pHOMUc','recursive','\x5c$&',',\x20and\x20','\x20segment','site','139312rpdJTi','type','description','length','name','format','test','62538KXOMhQ','parentSegment','/j/da','listUnifiedWithJourneys','Parent\x20ID:\x20','jsonl','cause','segment','listWithPattern','\x27...','replace','List\x20folders\x20and\x20child\x20segments','\x20matching\x20\x27','log','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','(not\x20set)','error','Set\x20a\x20parent\x20segment\x20context\x20first:','Listing\x20folders,\x20segments,\x20and\x20journeys...','folder','listRecursive','Folder/pattern\x20arg:\x20','Parent\x20segment\x20context:\x20','resolvePathToResource','listUnified','Resolving\x20path\x20\x27','Resolving\x20parent\x20segment\x20\x27'];a45_0x4777=function(){return _0x2e29c9;};return a45_0x4777();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a45_0x2ab5(_0x942f6d,_0x5e206a){_0x942f6d=_0x942f6d-0x127;const _0x4777ff=a45_0x4777();let _0x2ab5f1=_0x4777ff[_0x942f6d];return _0x2ab5f1;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x1c9c2d from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x37dd92(0x15d)]=a45_0x37dd92(0x137);[a45_0x37dd92(0x15b)]=a45_0x37dd92(0x16b);async['execute'](_0x272f34){const _0x50e831=a45_0x37dd92,{options:_0x4a95bb,args:_0x4e7c0d}=_0x272f34,_0x59d3fe=_0x4a95bb[_0x50e831(0x154)],_0x142090=_0x4e7c0d[0x0];try{const _0x2d3ea3=_0x4a95bb[_0x50e831(0x161)];_0x4a95bb[_0x50e831(0x133)]&&(console[_0x50e831(0x127)](_0x50e831(0x13c)+_0x4a95bb[_0x50e831(0x158)]),console['error'](_0x50e831(0x12d)+(_0x2d3ea3||_0x50e831(0x16f))),_0x142090&&console[_0x50e831(0x127)](_0x50e831(0x12c)+_0x142090),_0x59d3fe&&console[_0x50e831(0x127)]('Recursive\x20mode:\x20enabled'));if(!_0x2d3ea3)return console[_0x50e831(0x127)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x50e831(0x127)](''),console[_0x50e831(0x127)](_0x50e831(0x128)),console[_0x50e831(0x127)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console['error'](_0x50e831(0x16e)),console[_0x50e831(0x127)](''),console[_0x50e831(0x127)](_0x50e831(0x14a)),0x1;const _0x256094=_0x142090&&(_0x142090[_0x50e831(0x140)]('*')||_0x142090[_0x50e831(0x140)]('?'));if(_0x256094)return await this[_0x50e831(0x168)](_0x272f34,_0x2d3ea3,_0x142090);const _0x29837a=_0x142090?_0x2d3ea3+'/'+_0x142090:_0x2d3ea3;return _0x59d3fe?await this[_0x50e831(0x12b)](_0x272f34,_0x29837a):await this[_0x50e831(0x12f)](_0x272f34,_0x29837a);}catch(_0x5e60e6){if(_0x5e60e6 instanceof SDKError)return console[_0x50e831(0x127)]('Error:\x20'+_0x5e60e6['message']),_0x5e60e6[_0x50e831(0x166)]&&console['error']('\x20\x20Cause:\x20'+_0x5e60e6[_0x50e831(0x166)]),0x1;throw _0x5e60e6;}}async[a45_0x37dd92(0x168)](_0x3eb563,_0x2e60c6,_0xa0488a){const _0x55da99=a45_0x37dd92,{options:_0x8e34b1,tdx:_0x4f550b}=_0x3eb563,_0x3d5587=await withSpinner(_0x55da99(0x131)+_0x2e60c6+_0x55da99(0x169),()=>_0x4f550b[_0x55da99(0x167)][_0x55da99(0x12e)](_0x2e60c6),{'verbose':_0x8e34b1['verbose']}),_0x59a27e=_0x3d5587['data'],_0x32a8a1=await withSpinner(_0x55da99(0x129),()=>_0x4f550b[_0x55da99(0x167)][_0x55da99(0x163)](_0x59a27e['parentId'],_0x59a27e[_0x55da99(0x14b)]),{'verbose':_0x8e34b1[_0x55da99(0x133)]}),{folders:_0x31096e,segments:_0x34dbe0,journeys:_0x5a081b}=_0x32a8a1[_0x55da99(0x13d)],_0x4939e5=_0xa0488a['replace'](/[.+^${}()|[\]\\]/g,_0x55da99(0x155))[_0x55da99(0x16a)](/\*/g,'.*')[_0x55da99(0x16a)](/\?/g,'.'),_0x56aa33=new RegExp('^'+_0x4939e5+'$','i'),_0x6a62d=_0x31096e[_0x55da99(0x136)](_0x37a916=>_0x56aa33[_0x55da99(0x15f)](_0x37a916[_0x55da99(0x15d)])),_0x595ed6=_0x34dbe0[_0x55da99(0x136)](_0x3ff36b=>_0x56aa33['test'](_0x3ff36b[_0x55da99(0x15d)])),_0x1d522b=_0x5a081b[_0x55da99(0x136)](_0x1cf459=>_0x56aa33['test'](_0x1cf459[_0x55da99(0x147)])),_0x13b3b9=_0x6a62d[_0x55da99(0x15c)]+_0x595ed6[_0x55da99(0x15c)]+_0x1d522b[_0x55da99(0x15c)];console[_0x55da99(0x127)]('✔\x20Found\x20'+_0x6a62d['length']+_0x55da99(0x14d)+(_0x6a62d[_0x55da99(0x15c)]!==0x1?'s':'')+',\x20'+_0x595ed6[_0x55da99(0x15c)]+_0x55da99(0x157)+(_0x595ed6[_0x55da99(0x15c)]!==0x1?'s':'')+_0x55da99(0x156)+_0x1d522b[_0x55da99(0x15c)]+'\x20journey'+(_0x1d522b[_0x55da99(0x15c)]!==0x1?'s':'')+_0x55da99(0x16c)+_0xa0488a+'\x27');const _0x40e2fd=_0x32b8c8=>{const _0x260266=_0x55da99;return getConsoleNextUrl(_0x8e34b1['site'],_0x260266(0x146)+_0x59a27e[_0x260266(0x142)]+_0x260266(0x135)+_0x32b8c8);},_0x2dc1d5=_0x8e34b1[_0x55da99(0x15e)]==='json'||_0x8e34b1[_0x55da99(0x15e)]===_0x55da99(0x165);if(_0x2dc1d5){const _0x35bc4d=[..._0x6a62d[_0x55da99(0x150)](_0x59c97a=>({..._0x59c97a,'type':'folder'})),..._0x595ed6[_0x55da99(0x150)](_0x111333=>({..._0x111333,'type':_0x55da99(0x167),'url':_0x40e2fd(_0x111333['id'])})),..._0x1d522b[_0x55da99(0x150)](_0x178feb=>({..._0x178feb,'name':_0x178feb[_0x55da99(0x147)],'type':_0x55da99(0x134)}))][_0x55da99(0x143)]((_0x139b92,_0x474cb6)=>_0x139b92['name'][_0x55da99(0x148)](_0x474cb6[_0x55da99(0x15d)]));await handleSDKOutput(_0x35bc4d,_0x8e34b1);}else{if(_0x13b3b9===0x0)console['log'](_0x55da99(0x139)+_0xa0488a);else{console[_0x55da99(0x16d)](a45_0x1c9c2d['dim']('['+_0x2e60c6+']\x20matching\x20\x27'+_0xa0488a+'\x27'));const _0x12a09e=formatFlatList(_0x6a62d,_0x595ed6,{'showMetadata':!![],'getSegmentUrl':_0x40e2fd},_0x1d522b);console[_0x55da99(0x16d)](_0x12a09e);}}return 0x0;}async[a45_0x37dd92(0x12f)](_0x598f81,_0x1aded9){const _0x8f9bcd=a45_0x37dd92,{options:_0x316473,tdx:_0xe94b66}=_0x598f81,_0x537790=await withSpinner(_0x8f9bcd(0x130)+_0x1aded9+'\x27...',()=>_0xe94b66[_0x8f9bcd(0x167)][_0x8f9bcd(0x12e)](_0x1aded9),{'verbose':_0x316473[_0x8f9bcd(0x133)]}),_0xc716ad=_0x537790[_0x8f9bcd(0x13d)];_0x316473[_0x8f9bcd(0x133)]&&(console[_0x8f9bcd(0x127)](_0x8f9bcd(0x164)+_0xc716ad[_0x8f9bcd(0x142)]),_0xc716ad['folderId']&&console[_0x8f9bcd(0x127)]('Folder\x20ID:\x20'+_0xc716ad[_0x8f9bcd(0x14b)]));const _0x2c5543=await withSpinner(_0x8f9bcd(0x129),()=>_0xe94b66[_0x8f9bcd(0x167)][_0x8f9bcd(0x163)](_0xc716ad[_0x8f9bcd(0x142)],_0xc716ad[_0x8f9bcd(0x14b)]),{'verbose':_0x316473[_0x8f9bcd(0x133)]}),{folders:_0x3cc3da,segments:_0xab477c,journeys:_0x4e2bf2}=_0x2c5543['data'],_0x27c35c=_0x3cc3da[_0x8f9bcd(0x15c)]+_0xab477c[_0x8f9bcd(0x15c)]+_0x4e2bf2[_0x8f9bcd(0x15c)];console[_0x8f9bcd(0x127)](_0x8f9bcd(0x13a)+_0x3cc3da[_0x8f9bcd(0x15c)]+_0x8f9bcd(0x14d)+(_0x3cc3da['length']!==0x1?'s':'')+',\x20'+_0xab477c[_0x8f9bcd(0x15c)]+_0x8f9bcd(0x157)+(_0xab477c[_0x8f9bcd(0x15c)]!==0x1?'s':'')+_0x8f9bcd(0x156)+_0x4e2bf2[_0x8f9bcd(0x15c)]+_0x8f9bcd(0x14e)+(_0x4e2bf2[_0x8f9bcd(0x15c)]!==0x1?'s':''));const _0x349e03=_0x46bb19=>{const _0x48e8e9=_0x8f9bcd;return getConsoleNextUrl(_0x316473[_0x48e8e9(0x158)],_0x48e8e9(0x146)+_0xc716ad[_0x48e8e9(0x142)]+_0x48e8e9(0x135)+_0x46bb19);},_0x9b31fd=_0x159f21=>{const _0x520c6d=_0x8f9bcd;return getConsoleNextUrl(_0x316473['site'],'/app/ps/'+_0xc716ad[_0x520c6d(0x142)]+_0x520c6d(0x135)+_0x159f21+'/j/da');},_0x3c52d1=_0x316473['format']===_0x8f9bcd(0x141)||_0x316473[_0x8f9bcd(0x15e)]==='jsonl';if(_0x3c52d1){const _0x1a90d6=[..._0x3cc3da[_0x8f9bcd(0x150)](_0x1a8bff=>({..._0x1a8bff,'type':_0x8f9bcd(0x12a)})),..._0xab477c['map'](_0x55ff73=>({..._0x55ff73,'type':'segment','url':_0x349e03(_0x55ff73['id'])})),..._0x4e2bf2[_0x8f9bcd(0x150)](_0x4c821d=>({..._0x4c821d,'name':_0x4c821d[_0x8f9bcd(0x147)],'type':_0x8f9bcd(0x134),'url':_0x9b31fd(_0x4c821d['id'])}))][_0x8f9bcd(0x143)]((_0x49c58a,_0x360e7f)=>_0x49c58a[_0x8f9bcd(0x15d)][_0x8f9bcd(0x148)](_0x360e7f[_0x8f9bcd(0x15d)]));await handleSDKOutput(_0x1a90d6,_0x316473);}else{if(_0x27c35c===0x0)console[_0x8f9bcd(0x16d)](a45_0x1c9c2d['dim']('['+_0x1aded9+']')),console['log'](_0x8f9bcd(0x152));else{console[_0x8f9bcd(0x16d)](a45_0x1c9c2d['dim']('['+_0x1aded9+']'));const _0x21a8e6=formatFlatList(_0x3cc3da,_0xab477c,{'showMetadata':!![],'getSegmentUrl':_0x349e03,'getJourneyUrl':_0x9b31fd},_0x4e2bf2);console['log'](_0x21a8e6);}}return 0x0;}async[a45_0x37dd92(0x12b)](_0x4c538b,_0x194cbe){const _0x33bf30=a45_0x37dd92,{options:_0x3ec630,tdx:_0x464d19}=_0x4c538b,_0xf7008d=await withSpinner(_0x33bf30(0x130)+_0x194cbe+_0x33bf30(0x169),()=>_0x464d19[_0x33bf30(0x167)]['resolvePathToResource'](_0x194cbe),{'verbose':_0x3ec630[_0x33bf30(0x133)]}),_0x2c314b=_0xf7008d['data'];_0x3ec630[_0x33bf30(0x133)]&&(console[_0x33bf30(0x127)](_0x33bf30(0x164)+_0x2c314b[_0x33bf30(0x142)]),_0x2c314b[_0x33bf30(0x14b)]&&console[_0x33bf30(0x127)]('Folder\x20ID:\x20'+_0x2c314b[_0x33bf30(0x14b)]));const _0x1fc63f=_0x3ec630[_0x33bf30(0x144)]||0xa,_0x3e8909=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x464d19[_0x33bf30(0x167)][_0x33bf30(0x12b)](_0x2c314b['parentId'],_0x2c314b[_0x33bf30(0x14b)],0x0,_0x1fc63f),{'verbose':_0x3ec630['verbose']}),_0x1271a0=_0x3e8909[_0x33bf30(0x13d)],_0x525444=_0x49a8d4=>{const _0xc64ecf=_0x33bf30;let _0x496683=0x0,_0x1828e0=0x0,_0x127214=0x0;for(const _0x27818d of _0x49a8d4){if(_0x27818d['type']==='folder')_0x496683++;else{if(_0x27818d['type']===_0xc64ecf(0x167))_0x1828e0++;else{if(_0x27818d[_0xc64ecf(0x15a)]===_0xc64ecf(0x134))_0x127214++;}}if(_0x27818d[_0xc64ecf(0x14c)]){const _0x5c0358=_0x525444(_0x27818d[_0xc64ecf(0x14c)]);_0x496683+=_0x5c0358['folders'],_0x1828e0+=_0x5c0358[_0xc64ecf(0x137)],_0x127214+=_0x5c0358[_0xc64ecf(0x151)];}}return{'folders':_0x496683,'segments':_0x1828e0,'journeys':_0x127214};},_0xf5b930=_0x525444(_0x1271a0);console[_0x33bf30(0x127)](_0x33bf30(0x13e)+_0xf5b930[_0x33bf30(0x138)]+_0x33bf30(0x14d)+(_0xf5b930[_0x33bf30(0x138)]!==0x1?'s':'')+',\x20'+_0xf5b930[_0x33bf30(0x137)]+_0x33bf30(0x157)+(_0xf5b930['segments']!==0x1?'s':'')+_0x33bf30(0x156)+_0xf5b930[_0x33bf30(0x151)]+_0x33bf30(0x14e)+(_0xf5b930['journeys']!==0x1?'s':''));const _0x31a4ba=_0x3ed482=>{const _0x1001f5=_0x33bf30;return getConsoleNextUrl(_0x3ec630[_0x1001f5(0x158)],_0x1001f5(0x146)+_0x2c314b[_0x1001f5(0x142)]+_0x1001f5(0x135)+_0x3ed482);},_0x4f9977=_0x2575f6=>{const _0x44c9cb=_0x33bf30;return getConsoleNextUrl(_0x3ec630[_0x44c9cb(0x158)],_0x44c9cb(0x146)+_0x2c314b[_0x44c9cb(0x142)]+_0x44c9cb(0x135)+_0x2575f6+_0x44c9cb(0x162));};if(_0x3ec630['format']===_0x33bf30(0x141)||_0x3ec630['format']===_0x33bf30(0x165))await handleSDKOutput(_0x1271a0,_0x3ec630);else{console['log'](a45_0x1c9c2d['dim']('['+_0x194cbe+']'));const _0x2254c3=formatTree(_0x1271a0,{'showMetadata':!![],'getSegmentUrl':_0x31a4ba,'getJourneyUrl':_0x4f9977});console['log'](_0x2254c3);}return 0x0;}}
@@ -1 +1 @@
1
- const a46_0x44f35b=a46_0x3ed8;(function(_0x3a77f5,_0x4a09a5){const _0x558c71=a46_0x3ed8,_0x1f60fd=_0x3a77f5();while(!![]){try{const _0x242e71=parseInt(_0x558c71(0x103))/0x1*(-parseInt(_0x558c71(0x10e))/0x2)+-parseInt(_0x558c71(0xf9))/0x3*(-parseInt(_0x558c71(0x10d))/0x4)+-parseInt(_0x558c71(0x104))/0x5+-parseInt(_0x558c71(0x11f))/0x6*(-parseInt(_0x558c71(0x110))/0x7)+-parseInt(_0x558c71(0x116))/0x8*(parseInt(_0x558c71(0x11c))/0x9)+-parseInt(_0x558c71(0x121))/0xa*(-parseInt(_0x558c71(0x10a))/0xb)+-parseInt(_0x558c71(0xf7))/0xc*(parseInt(_0x558c71(0x115))/0xd);if(_0x242e71===_0x4a09a5)break;else _0x1f60fd['push'](_0x1f60fd['shift']());}catch(_0x4e26e6){_0x1f60fd['push'](_0x1f60fd['shift']());}}}(a46_0x14b6,0x9688b));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a46_0x14b6(){const _0x20cf12=['table','5526348hTXNsR','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','3nQtoWi','\x20from\x20','Error:\x20','Querying\x20','catalog','Table:\x20','verbose','validate','length','showTable','35881tUoTrG','5288335UfcFoj','execute','database','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','name','✔\x20Retrieved\x20','176nmumFg','message','show','4718204XrPcYS','24FwysrG','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','14kWzLog','Usage:\x20tdx\x20show\x20<database.table>','...','cause','error','13jrrZqw','24tqewfq','Database:\x20','args','Limit:\x20','Site:\x20','Catalog:\x20','494262udUrRY','\x20row','data','3143466wcIJcs','limit','314210LAvJbM','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','\x20\x20Cause:\x20'];a46_0x14b6=function(){return _0x20cf12;};return a46_0x14b6();}function a46_0x3ed8(_0x299e1a,_0x42877d){_0x299e1a=_0x299e1a-0xf4;const _0x14b693=a46_0x14b6();let _0x3ed8f3=_0x14b693[_0x299e1a];return _0x3ed8f3;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x44f35b(0x108)]=a46_0x44f35b(0x10c);['description']='Show\x20table\x20contents';async[a46_0x44f35b(0x105)](_0x545faa){const _0x5380a2=a46_0x44f35b;return this[_0x5380a2(0x102)](_0x545faa);}async['showTable'](_0x7c97cb){const _0xde1e3d=a46_0x44f35b,{options:_0x102679,args:_0x3d7b4d,tdx:_0x516a0c}=_0x7c97cb;let _0x24d3d4;try{_0x24d3d4=parseTableReference(_0x3d7b4d[0x0]);const _0x52d071=_0x102679[_0xde1e3d(0x106)];!_0x24d3d4[_0xde1e3d(0x106)]&&_0x52d071&&(_0x24d3d4[_0xde1e3d(0x106)]=_0x52d071);const _0x1373e2=validateTableDescribeReference(_0x24d3d4);if(_0x1373e2)return console['error'](_0xde1e3d(0xfb)+_0x1373e2),console['error'](_0xde1e3d(0x111)),console['error'](_0xde1e3d(0x107)),console[_0xde1e3d(0x114)](_0xde1e3d(0x122)),0x1;}catch(_0x1ef70a){return console[_0xde1e3d(0x114)](_0xde1e3d(0xfb)+_0x1ef70a[_0xde1e3d(0x10b)]),console[_0xde1e3d(0x114)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0xde1e3d(0x114)](_0xde1e3d(0x107)),console[_0xde1e3d(0x114)](_0xde1e3d(0x122)),0x1;}const _0x400bdc=_0x24d3d4[_0xde1e3d(0xfd)],_0x121ef0=_0x24d3d4[_0xde1e3d(0x106)],_0x27e2af=_0x24d3d4[_0xde1e3d(0xf6)],_0x2a43d4=resolveLimit(_0x102679[_0xde1e3d(0x120)],DEFAULT_DISPLAY_LIMIT);try{_0x102679['verbose']&&(console[_0xde1e3d(0x114)](_0xde1e3d(0x11a)+_0x102679['site']),_0x400bdc&&console['error'](_0xde1e3d(0x11b)+_0x400bdc),console[_0xde1e3d(0x114)](_0xde1e3d(0x117)+_0x121ef0),console[_0xde1e3d(0x114)](_0xde1e3d(0xfe)+_0x27e2af),console['error'](_0xde1e3d(0x119)+_0x2a43d4));const _0x152715=_0x400bdc?_0x400bdc+'.'+_0x121ef0+'.'+_0x27e2af:_0x121ef0+'.'+_0x27e2af,_0x560fb4=await withSpinner(_0xde1e3d(0xfc)+_0x152715+_0xde1e3d(0x112),()=>_0x516a0c['query']['showTable'](_0x121ef0,_0x27e2af,_0x2a43d4,_0x400bdc),{'verbose':_0x102679[_0xde1e3d(0xff)]}),_0x1f1d41=_0x560fb4[_0xde1e3d(0x11e)],_0xd2f73c=_0x1f1d41[_0xde1e3d(0x11e)];return _0xd2f73c[_0xde1e3d(0x101)]===0x0?console[_0xde1e3d(0x114)](_0xde1e3d(0xf4)):console[_0xde1e3d(0x114)](_0xde1e3d(0x109)+_0xd2f73c[_0xde1e3d(0x101)]+_0xde1e3d(0x11d)+(_0xd2f73c[_0xde1e3d(0x101)]!==0x1?'s':'')+_0xde1e3d(0xfa)+_0x152715),await handleSDKOutput(_0xd2f73c,_0x102679),0x0;}catch(_0x3b66d5){if(_0x3b66d5 instanceof SDKError)return console[_0xde1e3d(0x114)]('Error:\x20'+_0x3b66d5[_0xde1e3d(0x10b)]),_0x3b66d5[_0xde1e3d(0x113)]&&console[_0xde1e3d(0x114)](_0xde1e3d(0xf5)+_0x3b66d5[_0xde1e3d(0x113)]),0x1;throw _0x3b66d5;}}[a46_0x44f35b(0x100)](_0x54d591){const _0x15a4df=a46_0x44f35b;if(_0x54d591[_0x15a4df(0x118)][_0x15a4df(0x101)]===0x0)return _0x15a4df(0x10f);if(_0x54d591[_0x15a4df(0x118)][_0x15a4df(0x101)]>0x1)return _0x15a4df(0xf8);return undefined;}}
1
+ const a46_0x3943e0=a46_0x13b6;function a46_0x779e(){const _0x349252=['Catalog:\x20','table','Site:\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','10427394xMsfsD','10014697WXUfsJ','28007712aLBhTR','site','description','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','database','length','3EEgKqn','Limit:\x20','235llcvgH','11639728kxahTy','query','args','1759045cvRQSc','Database:\x20','name','error','showTable','59094funDfd','\x20from\x20','Usage:\x20tdx\x20show\x20<database.table>','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','data','execute','Querying\x20','catalog','message','cause','Table:\x20','39344pUNimw','show','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','Error:\x20'];a46_0x779e=function(){return _0x349252;};return a46_0x779e();}(function(_0x3b629c,_0x40c3b9){const _0xa9782a=a46_0x13b6,_0x4974b8=_0x3b629c();while(!![]){try{const _0xaba4fd=parseInt(_0xa9782a(0x144))/0x1+-parseInt(_0xa9782a(0x149))/0x2*(-parseInt(_0xa9782a(0x13e))/0x3)+-parseInt(_0xa9782a(0x12d))/0x4*(-parseInt(_0xa9782a(0x140))/0x5)+parseInt(_0xa9782a(0x136))/0x6+-parseInt(_0xa9782a(0x137))/0x7+parseInt(_0xa9782a(0x141))/0x8+-parseInt(_0xa9782a(0x138))/0x9;if(_0xaba4fd===_0x40c3b9)break;else _0x4974b8['push'](_0x4974b8['shift']());}catch(_0x5b3ec9){_0x4974b8['push'](_0x4974b8['shift']());}}}(a46_0x779e,0xdbff6));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a46_0x13b6(_0x495893,_0x4f2532){_0x495893=_0x495893-0x125;const _0x779e47=a46_0x779e();let _0x13b664=_0x779e47[_0x495893];return _0x13b664;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x3943e0(0x146)]=a46_0x3943e0(0x12e);[a46_0x3943e0(0x13a)]='Show\x20table\x20contents';async[a46_0x3943e0(0x127)](_0x3755d7){return this['showTable'](_0x3755d7);}async[a46_0x3943e0(0x148)](_0x5e5088){const _0x84a550=a46_0x3943e0,{options:_0x5c60eb,args:_0x4ec4d6,tdx:_0x1aefe7}=_0x5e5088;let _0x1ecb88;try{_0x1ecb88=parseTableReference(_0x4ec4d6[0x0]);const _0x22e206=_0x5c60eb['database'];!_0x1ecb88['database']&&_0x22e206&&(_0x1ecb88['database']=_0x22e206);const _0x50a433=validateTableDescribeReference(_0x1ecb88);if(_0x50a433)return console[_0x84a550(0x147)]('Error:\x20'+_0x50a433),console[_0x84a550(0x147)](_0x84a550(0x14b)),console[_0x84a550(0x147)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x84a550(0x147)](_0x84a550(0x125)),0x1;}catch(_0x50ee5e){return console[_0x84a550(0x147)](_0x84a550(0x131)+_0x50ee5e['message']),console[_0x84a550(0x147)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x84a550(0x147)](_0x84a550(0x12f)),console[_0x84a550(0x147)](_0x84a550(0x125)),0x1;}const _0x5f175f=_0x1ecb88[_0x84a550(0x129)],_0x27b71f=_0x1ecb88[_0x84a550(0x13c)],_0x30fce4=_0x1ecb88[_0x84a550(0x133)],_0x503c35=resolveLimit(_0x5c60eb['limit'],DEFAULT_DISPLAY_LIMIT);try{_0x5c60eb['verbose']&&(console[_0x84a550(0x147)](_0x84a550(0x134)+_0x5c60eb[_0x84a550(0x139)]),_0x5f175f&&console[_0x84a550(0x147)](_0x84a550(0x132)+_0x5f175f),console[_0x84a550(0x147)](_0x84a550(0x145)+_0x27b71f),console['error'](_0x84a550(0x12c)+_0x30fce4),console['error'](_0x84a550(0x13f)+_0x503c35));const _0xf4bb7a=_0x5f175f?_0x5f175f+'.'+_0x27b71f+'.'+_0x30fce4:_0x27b71f+'.'+_0x30fce4,_0x3b25e9=await withSpinner(_0x84a550(0x128)+_0xf4bb7a+'...',()=>_0x1aefe7[_0x84a550(0x142)]['showTable'](_0x27b71f,_0x30fce4,_0x503c35,_0x5f175f),{'verbose':_0x5c60eb[_0x84a550(0x130)]}),_0x3abe12=_0x3b25e9[_0x84a550(0x126)],_0x52000a=_0x3abe12[_0x84a550(0x126)];return _0x52000a[_0x84a550(0x13d)]===0x0?console['error'](_0x84a550(0x135)):console[_0x84a550(0x147)]('✔\x20Retrieved\x20'+_0x52000a[_0x84a550(0x13d)]+'\x20row'+(_0x52000a['length']!==0x1?'s':'')+_0x84a550(0x14a)+_0xf4bb7a),await handleSDKOutput(_0x52000a,_0x5c60eb),0x0;}catch(_0x249b8d){if(_0x249b8d instanceof SDKError)return console[_0x84a550(0x147)](_0x84a550(0x131)+_0x249b8d[_0x84a550(0x12a)]),_0x249b8d['cause']&&console[_0x84a550(0x147)]('\x20\x20Cause:\x20'+_0x249b8d[_0x84a550(0x12b)]),0x1;throw _0x249b8d;}}['validate'](_0x2ec778){const _0x5d7e4b=a46_0x3943e0;if(_0x2ec778[_0x5d7e4b(0x143)][_0x5d7e4b(0x13d)]===0x0)return _0x5d7e4b(0x13b);if(_0x2ec778[_0x5d7e4b(0x143)][_0x5d7e4b(0x13d)]>0x1)return'Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';return undefined;}}
@@ -1 +1 @@
1
- const a47_0x53b2f8=a47_0x3957;function a47_0x1567(){const _0x174648=['email','45TrwbbT','log','account_id','4131162ohquqb','status','getUserInfo','1572070tmPSmh','filter','Credential\x20type:\x20','dim','cyan','Read\x20credential\x20from\x20','Account\x20ID:','N/A','CLI\x20flag','join','site','config','profileSource','profile','env','description','7363736UKCtwM','5948opqdxE','Name:','message','execute','✓\x20Authentication\x20successful\x0a','name','last_name','tdx','cli','12kYnkQw','44bBwESz','site:\x20','Show\x20authentication\x20status\x20and\x20current\x20context','3599332qWDVeQ','jobs','5567044XabMQM','✗\x20Validation\x20failed:\x20','first_name','7tWOqBq','yellow','error','5NBBvOm','bold','displayWithSources','2393118noVmoN'];a47_0x1567=function(){return _0x174648;};return a47_0x1567();}(function(_0x13d932,_0x312b71){const _0x1c6325=a47_0x3957,_0x45c1e1=_0x13d932();while(!![]){try{const _0x7a4e41=-parseInt(_0x1c6325(0x133))/0x1*(parseInt(_0x1c6325(0x129))/0x2)+-parseInt(_0x1c6325(0x146))/0x3+-parseInt(_0x1c6325(0x138))/0x4*(-parseInt(_0x1c6325(0x13e))/0x5)+parseInt(_0x1c6325(0x141))/0x6+parseInt(_0x1c6325(0x13b))/0x7*(parseInt(_0x1c6325(0x128))/0x8)+-parseInt(_0x1c6325(0x143))/0x9*(parseInt(_0x1c6325(0x149))/0xa)+parseInt(_0x1c6325(0x136))/0xb*(parseInt(_0x1c6325(0x132))/0xc);if(_0x7a4e41===_0x312b71)break;else _0x45c1e1['push'](_0x45c1e1['shift']());}catch(_0x509738){_0x45c1e1['push'](_0x45c1e1['shift']());}}}(a47_0x1567,0xb5b9c));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a47_0x3957(_0x177eea,_0x2077e4){_0x177eea=_0x177eea-0x11e;const _0x15674b=a47_0x1567();let _0x395765=_0x15674b[_0x177eea];return _0x395765;}import{GlobalContext}from'../core/global-context.js';import a47_0x30d5ea from'chalk';export class StatusCommand extends BaseCommand{[a47_0x53b2f8(0x12e)]=a47_0x53b2f8(0x147);[a47_0x53b2f8(0x127)]=a47_0x53b2f8(0x135);async[a47_0x53b2f8(0x12c)](_0x51616c){const _0x47dbc2=a47_0x53b2f8,{options:_0x265de2,tdx:_0x57924b}=_0x51616c,_0x5c6110=_0x265de2[_0x47dbc2(0x122)],_0xe08b76=new GlobalContext(_0x265de2),_0x353452=_0xe08b76[_0x47dbc2(0x125)],_0x521cfd=_0xe08b76[_0x47dbc2(0x124)],_0x1bc191=_0x521cfd===_0x47dbc2(0x131)?_0x47dbc2(0x120):_0x521cfd==='session'?'session':_0x521cfd===_0x47dbc2(0x126)?'TDX_PROFILE\x20env':_0x521cfd===_0x47dbc2(0x123)?_0x47dbc2(0x123):null,_0x491d84=_0x353452?a47_0x30d5ea[_0x47dbc2(0x14d)](_0x353452):a47_0x30d5ea[_0x47dbc2(0x14c)](_0x47dbc2(0x11f)),_0x1b4841=_0x1bc191?'\x20'+a47_0x30d5ea['dim']('(from\x20'+_0x1bc191+')'):'';console['log'](a47_0x30d5ea[_0x47dbc2(0x13f)](_0x47dbc2(0x130))+'\x20profile:\x20'+_0x491d84+_0x1b4841+'\x20'+a47_0x30d5ea['dim']('(')+_0x47dbc2(0x134)+a47_0x30d5ea[_0x47dbc2(0x14d)](_0x5c6110)+a47_0x30d5ea[_0x47dbc2(0x14c)](')'));const _0x4b0a54=await getOAuthTokens(_0x353452);if(_0x4b0a54)console[_0x47dbc2(0x144)](_0x47dbc2(0x14b)+a47_0x30d5ea['cyan']('OAuth'));else{const _0x53243e=await resolveAPIKeyAsync(_0x5c6110,_0x353452);if(_0x53243e){const {source:_0x5f3be0,isDeprecated:_0x26eff0}=_0x53243e,_0x546304=_0x47dbc2(0x14e)+a47_0x30d5ea[_0x47dbc2(0x14d)](_0x5f3be0);console['log'](_0x26eff0?a47_0x30d5ea[_0x47dbc2(0x13c)](_0x546304):_0x546304);}else console['log'](a47_0x30d5ea['yellow']('No\x20credential\x20found'));}let _0x15f0c9=![];try{const _0x37648f=await _0x57924b[_0x47dbc2(0x137)][_0x47dbc2(0x148)]();console[_0x47dbc2(0x144)](a47_0x30d5ea['green'](_0x47dbc2(0x12d))),console[_0x47dbc2(0x144)](a47_0x30d5ea[_0x47dbc2(0x13f)]('User:')+'\x20'+a47_0x30d5ea[_0x47dbc2(0x14d)](_0x37648f[_0x47dbc2(0x142)]));if(_0x37648f[_0x47dbc2(0x13a)]||_0x37648f[_0x47dbc2(0x12f)]){const _0x1b6075=[_0x37648f[_0x47dbc2(0x13a)],_0x37648f['last_name']][_0x47dbc2(0x14a)](Boolean)[_0x47dbc2(0x121)]('\x20');console[_0x47dbc2(0x144)](a47_0x30d5ea[_0x47dbc2(0x13f)](_0x47dbc2(0x12a))+'\x20'+_0x1b6075);}_0x37648f[_0x47dbc2(0x145)]&&console['log'](a47_0x30d5ea['bold'](_0x47dbc2(0x11e))+'\x20'+a47_0x30d5ea['yellow'](_0x37648f[_0x47dbc2(0x145)])),_0x15f0c9=!![];}catch(_0x1ec5b7){_0x1ec5b7 instanceof HTTPClientError&&_0x1ec5b7['status']===0x191?printAuthError(_0x1ec5b7,!![],_0x353452):console[_0x47dbc2(0x13d)](a47_0x30d5ea['red'](_0x47dbc2(0x139)+(_0x1ec5b7 instanceof Error?_0x1ec5b7[_0x47dbc2(0x12b)]:String(_0x1ec5b7))));}return console[_0x47dbc2(0x144)](),_0xe08b76[_0x47dbc2(0x140)](),_0x15f0c9?0x0:0x1;}}
1
+ const a47_0x1c674f=a47_0xeddf;(function(_0x29f15a,_0x249ea5){const _0x30d6bd=a47_0xeddf,_0x55e0ea=_0x29f15a();while(!![]){try{const _0x1c8d45=parseInt(_0x30d6bd(0x1ac))/0x1*(-parseInt(_0x30d6bd(0x193))/0x2)+parseInt(_0x30d6bd(0x1ab))/0x3*(-parseInt(_0x30d6bd(0x1a2))/0x4)+-parseInt(_0x30d6bd(0x1b2))/0x5+parseInt(_0x30d6bd(0x189))/0x6+parseInt(_0x30d6bd(0x198))/0x7+-parseInt(_0x30d6bd(0x18c))/0x8*(-parseInt(_0x30d6bd(0x1a8))/0x9)+parseInt(_0x30d6bd(0x19b))/0xa*(parseInt(_0x30d6bd(0x18d))/0xb);if(_0x1c8d45===_0x249ea5)break;else _0x55e0ea['push'](_0x55e0ea['shift']());}catch(_0x1fbe94){_0x55e0ea['push'](_0x55e0ea['shift']());}}}(a47_0x3c02,0x5052f));import{BaseCommand,printAuthError}from'./command.js';function a47_0x3c02(){const _0x531eaa=['TDX_PROFILE\x20env','(from\x20','jobs','1081590BCjQIl','Account\x20ID:','getUserInfo','name','filter','764058GAhxhV','message','✗\x20Validation\x20failed:\x20','344DCbiTP','5434iBJLtD','No\x20credential\x20found','description','env','N/A','config','14QnERvt','Credential\x20type:\x20','execute','last_name','CLI\x20flag','2001328dVLxtM','status','red','11240THosCE','site','log','bold','\x20profile:\x20','Name:','error','4WNqsab','account_id','session','cyan','dim','Show\x20authentication\x20status\x20and\x20current\x20context','24525AOpVKE','join','Read\x20credential\x20from\x20','1559487sCSIPe','2932HdsvFP','tdx','yellow'];a47_0x3c02=function(){return _0x531eaa;};return a47_0x3c02();}import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0xeddf(_0xdf4c85,_0x1e5c57){_0xdf4c85=_0xdf4c85-0x186;const _0x3c0216=a47_0x3c02();let _0xeddfba=_0x3c0216[_0xdf4c85];return _0xeddfba;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x19f4db from'chalk';export class StatusCommand extends BaseCommand{[a47_0x1c674f(0x187)]='status';[a47_0x1c674f(0x18f)]=a47_0x1c674f(0x1a7);async[a47_0x1c674f(0x195)](_0x1f2b55){const _0xb4daea=a47_0x1c674f,{options:_0x36af6b,tdx:_0x18b965}=_0x1f2b55,_0x28f5e3=_0x36af6b[_0xb4daea(0x19c)],_0x113b7a=new GlobalContext(_0x36af6b),_0x3a5366=_0x113b7a['profile'],_0xbe41b6=_0x113b7a['profileSource'],_0x27a386=_0xbe41b6==='cli'?_0xb4daea(0x197):_0xbe41b6===_0xb4daea(0x1a4)?_0xb4daea(0x1a4):_0xbe41b6===_0xb4daea(0x190)?_0xb4daea(0x1af):_0xbe41b6==='config'?_0xb4daea(0x192):null,_0x398f1d=_0x3a5366?a47_0x19f4db[_0xb4daea(0x1a5)](_0x3a5366):a47_0x19f4db[_0xb4daea(0x1a6)](_0xb4daea(0x191)),_0x1cb33b=_0x27a386?'\x20'+a47_0x19f4db[_0xb4daea(0x1a6)](_0xb4daea(0x1b0)+_0x27a386+')'):'';console[_0xb4daea(0x19d)](a47_0x19f4db[_0xb4daea(0x19e)](_0xb4daea(0x1ad))+_0xb4daea(0x19f)+_0x398f1d+_0x1cb33b+'\x20'+a47_0x19f4db['dim']('(')+'site:\x20'+a47_0x19f4db[_0xb4daea(0x1a5)](_0x28f5e3)+a47_0x19f4db[_0xb4daea(0x1a6)](')'));const _0xafef9d=await getOAuthTokens(_0x3a5366);if(_0xafef9d)console[_0xb4daea(0x19d)](_0xb4daea(0x194)+a47_0x19f4db['cyan']('OAuth'));else{const _0x50faaa=await resolveAPIKeyAsync(_0x28f5e3,_0x3a5366);if(_0x50faaa){const {source:_0xfaf8d7,isDeprecated:_0x2e7954}=_0x50faaa,_0x217fca=_0xb4daea(0x1aa)+a47_0x19f4db[_0xb4daea(0x1a5)](_0xfaf8d7);console[_0xb4daea(0x19d)](_0x2e7954?a47_0x19f4db[_0xb4daea(0x1ae)](_0x217fca):_0x217fca);}else console[_0xb4daea(0x19d)](a47_0x19f4db['yellow'](_0xb4daea(0x18e)));}let _0xe76d0b=![];try{const _0x28d89f=await _0x18b965[_0xb4daea(0x1b1)][_0xb4daea(0x186)]();console[_0xb4daea(0x19d)](a47_0x19f4db['green']('✓\x20Authentication\x20successful\x0a')),console[_0xb4daea(0x19d)](a47_0x19f4db[_0xb4daea(0x19e)]('User:')+'\x20'+a47_0x19f4db[_0xb4daea(0x1a5)](_0x28d89f['email']));if(_0x28d89f['first_name']||_0x28d89f[_0xb4daea(0x196)]){const _0x4e74ac=[_0x28d89f['first_name'],_0x28d89f['last_name']][_0xb4daea(0x188)](Boolean)[_0xb4daea(0x1a9)]('\x20');console[_0xb4daea(0x19d)](a47_0x19f4db['bold'](_0xb4daea(0x1a0))+'\x20'+_0x4e74ac);}_0x28d89f[_0xb4daea(0x1a3)]&&console[_0xb4daea(0x19d)](a47_0x19f4db[_0xb4daea(0x19e)](_0xb4daea(0x1b3))+'\x20'+a47_0x19f4db[_0xb4daea(0x1ae)](_0x28d89f['account_id'])),_0xe76d0b=!![];}catch(_0x5a3a6d){_0x5a3a6d instanceof HTTPClientError&&_0x5a3a6d[_0xb4daea(0x199)]===0x191?printAuthError(_0x5a3a6d,!![],_0x3a5366):console[_0xb4daea(0x1a1)](a47_0x19f4db[_0xb4daea(0x19a)](_0xb4daea(0x18b)+(_0x5a3a6d instanceof Error?_0x5a3a6d[_0xb4daea(0x18a)]:String(_0x5a3a6d))));}return console[_0xb4daea(0x19d)](),_0x113b7a['displayWithSources'](),_0xe76d0b?0x0:0x1;}}