@treasuredata/tdx 2026.3.11 → 2026.3.12

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 (201) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +1 -1
@@ -1 +1 @@
1
- const a34_0x554f9a=a34_0x3cff;(function(_0x1e96cf,_0x1af5ff){const _0x1869fe=a34_0x3cff,_0xa8845f=_0x1e96cf();while(!![]){try{const _0x457d0a=-parseInt(_0x1869fe(0x10b))/0x1*(parseInt(_0x1869fe(0xc0))/0x2)+-parseInt(_0x1869fe(0xbb))/0x3*(parseInt(_0x1869fe(0xd7))/0x4)+-parseInt(_0x1869fe(0x130))/0x5+parseInt(_0x1869fe(0x116))/0x6+parseInt(_0x1869fe(0xd0))/0x7+parseInt(_0x1869fe(0xb1))/0x8+-parseInt(_0x1869fe(0xd9))/0x9*(parseInt(_0x1869fe(0xdc))/0xa);if(_0x457d0a===_0x1af5ff)break;else _0xa8845f['push'](_0xa8845f['shift']());}catch(_0x46b1e0){_0xa8845f['push'](_0xa8845f['shift']());}}}(a34_0x4b72,0x5f923));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';function a34_0x3cff(_0x41c8fe,_0x589799){_0x41c8fe=_0x41c8fe-0xae;const _0x4b7201=a34_0x4b72();let _0x3cff34=_0x4b7201[_0x41c8fe];return _0x3cff34;}import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x4b19e1 from'chalk';function formatRelativeTime(_0xe6597d){const _0x2fe353=a34_0x3cff,_0xef3ae2=new Date(_0xe6597d),_0x221dad=new Date(),_0x7f209b=_0xef3ae2['getTime']()-_0x221dad['getTime'](),_0x3efbb0=Math[_0x2fe353(0xca)](_0x7f209b)/0x3e8,_0x575fce=_0x7f209b<0x0;if(_0x3efbb0<0x3c)return _0x575fce?_0x2fe353(0xfe):_0x2fe353(0xde);else{if(_0x3efbb0<0xe10){const _0x4398ba=Math['round'](_0x3efbb0/0x3c);return _0x575fce?_0x4398ba+'m\x20ago':_0x2fe353(0xef)+_0x4398ba+'m';}else{if(_0x3efbb0<0x15180){const _0x168ee8=Math[_0x2fe353(0xd4)](_0x3efbb0/0xe10);return _0x575fce?_0x168ee8+_0x2fe353(0xf4):_0x2fe353(0xef)+_0x168ee8+'h';}else{if(_0x3efbb0<0x93a80){const _0x51dabe=Math[_0x2fe353(0xd4)](_0x3efbb0/0x15180);return _0x575fce?_0x51dabe+_0x2fe353(0x11d):_0x2fe353(0xef)+_0x51dabe+'d';}else return _0xef3ae2[_0x2fe353(0x13a)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0xf6);[a34_0x554f9a(0x134)]=a34_0x554f9a(0x138);async[a34_0x554f9a(0xd2)](_0x28dc37){const _0x4028cb=a34_0x554f9a,{options:_0x15cb5f,args:_0x4e4e01,tdx:_0x1f1b07}=_0x28dc37,_0x50c8b7=resolveLimit(_0x15cb5f[_0x4028cb(0x131)],DEFAULT_DISPLAY_LIMIT),_0x125383=_0x4e4e01[0x0],_0x4c7a90=_0x125383?_0x4028cb(0x133)+_0x125383+'\x22...':_0x4028cb(0x121),_0x5f4ccd=await withSpinner(_0x4c7a90,()=>_0x1f1b07['schedules'][_0x4028cb(0x104)]({'limit':_0x50c8b7,'scheduled':!![],'pattern':_0x125383}),{'verbose':_0x15cb5f[_0x4028cb(0x129)]}),_0x36d5fd=_0x5f4ccd[_0x4028cb(0xeb)]['queries'],_0x315659=_0x5f4ccd['data'][_0x4028cb(0xb3)]['has_next_page'],_0x1b8d3e=_0x125383?_0x4028cb(0xce)+_0x125383+'\x22':'';_0x315659?console[_0x4028cb(0x125)]('Showing\x20first\x20'+_0x36d5fd[_0x4028cb(0x12d)]+_0x4028cb(0xd1)+_0x1b8d3e+_0x4028cb(0x12f)):console[_0x4028cb(0x125)](_0x4028cb(0xf1)+_0x36d5fd[_0x4028cb(0x12d)]+_0x4028cb(0xdb)+(_0x36d5fd['length']!==0x1?_0x4028cb(0x105):'y')+_0x1b8d3e);if(_0x15cb5f[_0x4028cb(0x115)]===_0x4028cb(0x12b)||_0x15cb5f[_0x4028cb(0x115)]===_0x4028cb(0x10d)||_0x15cb5f['format']===_0x4028cb(0xd3)||_0x15cb5f[_0x4028cb(0x115)]===_0x4028cb(0xd6)){const _0x1849fe=_0x36d5fd[_0x4028cb(0xe6)](_0x40e708=>({'id':_0x40e708['id'],'name':_0x40e708['name'],'cron':_0x40e708[_0x4028cb(0xe7)],'database':_0x40e708['database']?.['name'],'type':_0x40e708[_0x4028cb(0x132)],'timezone':_0x40e708[_0x4028cb(0xff)],'user_name':_0x40e708['user']?.['name'],'updated_at':_0x40e708[_0x4028cb(0xb0)],'next_run_at':_0x40e708[_0x4028cb(0x111)],'last_job_status':_0x40e708[_0x4028cb(0xd8)]?.[_0x4028cb(0x112)]}));await handleSDKOutput(_0x1849fe,_0x15cb5f);}else{if(_0x36d5fd[_0x4028cb(0x12d)]===0x0)console[_0x4028cb(0x128)](_0x4028cb(0x108));else{const _0xee6e91=_0x15cb5f[_0x4028cb(0x120)],_0x37be95=_0x36d5fd[_0x4028cb(0xe6)](_0x522545=>{const _0x3b85dc=_0x4028cb,_0x22effb=_0x522545[_0x3b85dc(0xd8)]?.['status']?_0x522545[_0x3b85dc(0xd8)][_0x3b85dc(0x112)]===_0x3b85dc(0xe9)?'✓':'✗':'-',_0x3c570c=_0x522545[_0x3b85dc(0xd8)]?.['ended_at']?formatRelativeTime(_0x522545[_0x3b85dc(0xd8)]['ended_at']):'never',_0x5e14f7=_0x522545[_0x3b85dc(0x111)]?formatRelativeTime(_0x522545[_0x3b85dc(0x111)]):'-',_0x5a07f4=_0x522545['cron']||'',_0x5166eb=_0x522545['name']||_0x3b85dc(0x11e),_0x502793=getConsoleUrl(_0xee6e91,_0x3b85dc(0x135)+_0x522545['id']);return{'statusIcon':_0x22effb,'lastRun':_0x3c570c,'nextRun':_0x5e14f7,'cron':_0x5a07f4,'name':_0x5166eb,'queryUrl':_0x502793,'status':_0x522545[_0x3b85dc(0xd8)]?.[_0x3b85dc(0x112)]};}),_0x43c666=Math[_0x4028cb(0x127)](..._0x37be95['map'](_0x395809=>_0x395809[_0x4028cb(0xb5)][_0x4028cb(0x12d)])),_0x3148bd=Math[_0x4028cb(0x127)](..._0x37be95[_0x4028cb(0xe6)](_0x32c3df=>_0x32c3df[_0x4028cb(0xf2)][_0x4028cb(0x12d)])),_0x193217=Math['max'](..._0x37be95[_0x4028cb(0xe6)](_0x416126=>_0x416126['cron'][_0x4028cb(0x12d)])),_0x2f8848=_0x37be95['map'](_0xf941f5=>{const _0x19e4fb=_0x4028cb,_0x5f8b01=_0xf941f5['status']===_0x19e4fb(0xe9)?a34_0x4b19e1[_0x19e4fb(0xd5)](_0xf941f5[_0x19e4fb(0x10e)]):_0xf941f5['status']===_0x19e4fb(0x125)?a34_0x4b19e1['red'](_0xf941f5[_0x19e4fb(0x10e)]):a34_0x4b19e1[_0x19e4fb(0xcb)](_0xf941f5[_0x19e4fb(0x10e)]),_0x389bc1=_0xf941f5[_0x19e4fb(0xb5)][_0x19e4fb(0x10c)](_0x43c666),_0x29242d=_0xf941f5[_0x19e4fb(0xf2)]['padEnd'](_0x3148bd),_0x4bb2b4=_0xf941f5['cron']?a34_0x4b19e1['cyan'](_0xf941f5[_0x19e4fb(0xe7)]['padEnd'](_0x193217)):'\x20'['repeat'](_0x193217),_0x55185c=hyperlink(_0xf941f5['name'],_0xf941f5[_0x19e4fb(0xbe)]);return _0x19e4fb(0x12c)+_0x5f8b01+'\x20'+_0x389bc1+_0x19e4fb(0xbd)+_0x29242d+'\x20\x20'+_0x4bb2b4+'\x20\x20'+_0x55185c;});await writeOutput(_0x2f8848[_0x4028cb(0x107)]('\x0a'),_0x15cb5f[_0x4028cb(0xc6)],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0x126);[a34_0x554f9a(0x134)]=a34_0x554f9a(0x11f);[a34_0x554f9a(0xea)](_0x3e4c61){const _0x52072a=a34_0x554f9a,_0x3e7f83=_0x3e4c61[_0x52072a(0xb8)][0x0];if(!_0x3e7f83)return _0x52072a(0xf7);return undefined;}async[a34_0x554f9a(0xd2)](_0x376322){const _0x2a7c1e=a34_0x554f9a,{options:_0x352ac6,args:_0x468906,tdx:_0x5d88ab}=_0x376322,_0x5ec24a=_0x468906[0x0],_0x5276a1=await withSpinner('Getting\x20schedule\x20details...',()=>_0x5d88ab[_0x2a7c1e(0xcc)][_0x2a7c1e(0x119)](_0x5ec24a),{'verbose':_0x352ac6[_0x2a7c1e(0x129)]}),_0x25c3c5=_0x5276a1[_0x2a7c1e(0xeb)],_0x34d5fb={'name':_0x25c3c5[_0x2a7c1e(0xf0)],'cron':_0x25c3c5[_0x2a7c1e(0xe7)],'database':_0x25c3c5[_0x2a7c1e(0xc8)],'type':_0x25c3c5[_0x2a7c1e(0x132)],'timezone':_0x25c3c5[_0x2a7c1e(0xcf)],'user_name':_0x25c3c5[_0x2a7c1e(0xcd)],'created_at':_0x25c3c5[_0x2a7c1e(0xda)],'engine_version':_0x25c3c5[_0x2a7c1e(0xc7)],'executing_user_id':_0x25c3c5[_0x2a7c1e(0xc1)],'query':_0x25c3c5[_0x2a7c1e(0x11c)],'delay':_0x25c3c5['delay'],'priority':_0x25c3c5[_0x2a7c1e(0xe0)],'retry_limit':_0x25c3c5[_0x2a7c1e(0xe8)],..._0x25c3c5[_0x2a7c1e(0xc2)]&&{'result':_0x25c3c5[_0x2a7c1e(0xc2)]}};return await handleSingleObjectOutput(_0x34d5fb,_0x352ac6),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0x137);['description']='Create\x20a\x20scheduled\x20query';[a34_0x554f9a(0xea)](_0x45b6fb){const _0x23ae9e=a34_0x554f9a,_0x55b81e=_0x45b6fb[_0x23ae9e(0xb8)][0x0];if(!_0x55b81e)return _0x23ae9e(0xc4);const _0x4474bd=_0x45b6fb[_0x23ae9e(0xba)];if(!_0x4474bd[_0x23ae9e(0xc8)])return _0x23ae9e(0xc9);return undefined;}async[a34_0x554f9a(0xd2)](_0x35179f){const _0x581d24=a34_0x554f9a,{options:_0x3c8079,args:_0x360474,tdx:_0x279ec3}=_0x35179f,_0x1b704d=_0x360474[0x0],_0x70a0e4=_0x3c8079,_0x4c1d40=_0x70a0e4['database'],_0x8813a4=_0x70a0e4[_0x581d24(0xb4)],_0x4d404c=_0x70a0e4[_0x581d24(0x132)]||_0x581d24(0x101);let _0x1a64f4;try{_0x1a64f4=readFileSync(_0x8813a4,_0x581d24(0xe2))[_0x581d24(0x122)]();}catch(_0x44f89f){throw new SDKError(ErrorCode[_0x581d24(0xfb)],_0x581d24(0x123)+_0x8813a4,_0x44f89f instanceof Error?_0x44f89f:undefined);}if(!_0x1a64f4)throw new SDKError(ErrorCode[_0x581d24(0xfb)],_0x581d24(0xe4));const _0x3c3370={'database':_0x4c1d40,'query':_0x1a64f4,'type':_0x4d404c};if(_0x70a0e4['cron'])_0x3c3370['cron']=_0x70a0e4['cron'];if(_0x70a0e4[_0x581d24(0xcf)])_0x3c3370['timezone']=_0x70a0e4['timezone'];if(_0x70a0e4[_0x581d24(0x10a)]!==undefined)_0x3c3370[_0x581d24(0x10a)]=Number(_0x70a0e4[_0x581d24(0x10a)]);if(_0x70a0e4[_0x581d24(0xe0)]!==undefined)_0x3c3370[_0x581d24(0xe0)]=Number(_0x70a0e4[_0x581d24(0xe0)]);if(_0x70a0e4[_0x581d24(0xe1)]!==undefined)_0x3c3370[_0x581d24(0xe8)]=Number(_0x70a0e4[_0x581d24(0xe1)]);if(_0x70a0e4[_0x581d24(0x102)])_0x3c3370[_0x581d24(0xc7)]=_0x70a0e4[_0x581d24(0x102)];if(_0x70a0e4['result'])_0x3c3370[_0x581d24(0xc2)]=_0x70a0e4[_0x581d24(0xc2)];if(_0x3c8079[_0x581d24(0x129)]){console['error'](_0x581d24(0x136)+_0x1b704d),console[_0x581d24(0x125)]('\x20\x20Database:\x20'+_0x4c1d40),console[_0x581d24(0x125)]('\x20\x20Type:\x20'+_0x4d404c);if(_0x3c3370[_0x581d24(0xe7)])console[_0x581d24(0x125)](_0x581d24(0xc5)+_0x3c3370[_0x581d24(0xe7)]);if(_0x3c3370['timezone'])console[_0x581d24(0x125)](_0x581d24(0xf8)+_0x3c3370[_0x581d24(0xcf)]);}const _0x2e060c=await withSpinner(_0x581d24(0xf9),()=>_0x279ec3[_0x581d24(0xcc)][_0x581d24(0xfa)](_0x1b704d,_0x3c3370),{'verbose':_0x3c8079[_0x581d24(0x129)]});return console[_0x581d24(0x125)](_0x581d24(0xee)+_0x2e060c[_0x581d24(0xeb)][_0x581d24(0xf0)]),await handleSingleObjectOutput(_0x2e060c[_0x581d24(0xeb)],_0x3c8079),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0x100);[a34_0x554f9a(0x134)]=a34_0x554f9a(0x114);[a34_0x554f9a(0xea)](_0x20ab64){const _0x5bb860=a34_0x554f9a,_0x23bb93=_0x20ab64[_0x5bb860(0xb8)][0x0];if(!_0x23bb93)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async['execute'](_0x27fa5d){const _0x19ddea=a34_0x554f9a,{options:_0x4da896,args:_0x263787,tdx:_0x5ca884}=_0x27fa5d,_0x421d2d=_0x263787[0x0],_0xb35646=_0x4da896,_0x91427={};if(_0xb35646['database'])_0x91427[_0x19ddea(0xc8)]=_0xb35646[_0x19ddea(0xc8)];if(_0xb35646[_0x19ddea(0x132)])_0x91427['type']=_0xb35646[_0x19ddea(0x132)];if(_0xb35646['cron'])_0x91427[_0x19ddea(0xe7)]=_0xb35646[_0x19ddea(0xe7)];if(_0xb35646['timezone'])_0x91427[_0x19ddea(0xcf)]=_0xb35646[_0x19ddea(0xcf)];if(_0xb35646[_0x19ddea(0x10a)]!==undefined)_0x91427[_0x19ddea(0x10a)]=Number(_0xb35646['delay']);if(_0xb35646[_0x19ddea(0xe0)]!==undefined)_0x91427[_0x19ddea(0xe0)]=Number(_0xb35646[_0x19ddea(0xe0)]);if(_0xb35646[_0x19ddea(0xe1)]!==undefined)_0x91427['retry_limit']=Number(_0xb35646[_0x19ddea(0xe1)]);if(_0xb35646[_0x19ddea(0x102)])_0x91427[_0x19ddea(0xc7)]=_0xb35646[_0x19ddea(0x102)];if(_0xb35646['result'])_0x91427['result']=_0xb35646['result'];if(_0xb35646[_0x19ddea(0xb4)])try{_0x91427['query']=readFileSync(_0xb35646[_0x19ddea(0xb4)],_0x19ddea(0xe2))[_0x19ddea(0x122)]();}catch(_0xe1ddd2){throw new SDKError(ErrorCode[_0x19ddea(0xfb)],_0x19ddea(0x123)+_0xb35646[_0x19ddea(0xb4)],_0xe1ddd2 instanceof Error?_0xe1ddd2:undefined);}if(Object[_0x19ddea(0x103)](_0x91427)['length']===0x0)throw new SDKError(ErrorCode[_0x19ddea(0xfb)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x4da896[_0x19ddea(0x129)]){console[_0x19ddea(0x125)](_0x19ddea(0x117)+_0x421d2d);for(const [_0x4121ce,_0x9131f1]of Object[_0x19ddea(0x124)](_0x91427)){_0x4121ce===_0x19ddea(0x11c)?console[_0x19ddea(0x125)]('\x20\x20'+_0x4121ce+':\x20'+_0x9131f1[_0x19ddea(0xae)](0x0,0x32)+_0x19ddea(0x139)):console[_0x19ddea(0x125)]('\x20\x20'+_0x4121ce+':\x20'+_0x9131f1);}}const _0x321c99=await withSpinner(_0x19ddea(0x10f),()=>_0x5ca884[_0x19ddea(0xcc)][_0x19ddea(0x11a)](_0x421d2d,_0x91427),{'verbose':_0x4da896[_0x19ddea(0x129)]});return console['error'](_0x19ddea(0x118)+_0x321c99[_0x19ddea(0xeb)][_0x19ddea(0xf0)]),await handleSingleObjectOutput(_0x321c99['data'],_0x4da896),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0xaf);[a34_0x554f9a(0x134)]=a34_0x554f9a(0x13c);[a34_0x554f9a(0xea)](_0x5f0e34){const _0x36cc6d=a34_0x554f9a,_0x2d9f2b=_0x5f0e34[_0x36cc6d(0xb8)][0x0];if(!_0x2d9f2b)return _0x36cc6d(0xb9);return undefined;}async[a34_0x554f9a(0xd2)](_0x415173){const _0x506e38=a34_0x554f9a,{options:_0x247a2a,args:_0x2eb40a,tdx:_0x1448aa}=_0x415173,_0x198fbc=_0x2eb40a[0x0];if(!_0x247a2a[_0x506e38(0x113)]){const _0x231b22=await confirm(_0x506e38(0x12e)+_0x198fbc+'\x22?');if(!_0x231b22)return console['error'](_0x506e38(0xc3)),0x0;}const _0x983c5b=await withSpinner('Deleting\x20schedule...',()=>_0x1448aa['schedules'][_0x506e38(0x106)](_0x198fbc),{'verbose':_0x247a2a[_0x506e38(0x129)]});return console[_0x506e38(0x125)]('Schedule\x20deleted:\x20'+_0x983c5b[_0x506e38(0xeb)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a34_0x554f9a(0x110);[a34_0x554f9a(0x134)]='Run\x20a\x20scheduled\x20query\x20immediately';['validate'](_0x3b8f18){const _0x38aacd=a34_0x554f9a,_0x3c4a56=_0x3b8f18[_0x38aacd(0xb8)][0x0];if(!_0x3c4a56)return _0x38aacd(0xe5);return undefined;}async['execute'](_0x2b8c10){const _0x2781be=a34_0x554f9a,{options:_0x281261,args:_0x45c14a,tdx:_0x480a4e}=_0x2b8c10,_0x54c9e8=_0x45c14a[0x0],_0x2e65bf=_0x281261,_0x36f8b3=_0x2e65bf[_0x2781be(0xfc)],_0x23cc70=_0x2e65bf['num']!==undefined?Number(_0x2e65bf[_0x2781be(0xfd)]):undefined;if(_0x281261[_0x2781be(0x129)]){console['error'](_0x2781be(0x12a)+_0x54c9e8);if(_0x36f8b3)console[_0x2781be(0x125)]('\x20\x20Time:\x20'+_0x36f8b3);if(_0x23cc70)console[_0x2781be(0x125)](_0x2781be(0x109)+_0x23cc70);}const _0x4a90c2=await withSpinner(_0x2781be(0x13b),()=>_0x480a4e[_0x2781be(0xcc)][_0x2781be(0xb2)](_0x54c9e8,{'time':_0x36f8b3,'num':_0x23cc70}),{'verbose':_0x281261[_0x2781be(0x129)]}),_0x1ac1e4=_0x4a90c2[_0x2781be(0xeb)][_0x2781be(0xb6)];console[_0x2781be(0x125)]('Schedule\x20run\x20submitted:\x20'+_0x1ac1e4[_0x2781be(0x12d)]+_0x2781be(0xdd)+(_0x1ac1e4['length']!==0x1?'s':'')+'\x20created');for(const _0x44ffad of _0x1ac1e4){console['error'](_0x2781be(0xbf)+_0x44ffad[_0x2781be(0xbc)]);}return await handleSDKOutput(_0x1ac1e4,_0x281261),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x554f9a(0xf0)]=a34_0x554f9a(0x11b);['description']='Show\x20schedule\x20execution\x20history';[a34_0x554f9a(0xea)](_0x424a7b){const _0x2d4b49=_0x424a7b['args'][0x0];if(!_0x2d4b49)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a34_0x554f9a(0xd2)](_0x45c565){const _0x4d6f4f=a34_0x554f9a,{options:_0x5c48bd,args:_0x44f3c8,tdx:_0x1606ab}=_0x45c565,_0x122f90=_0x44f3c8[0x0],_0x3588c2=_0x5c48bd,_0x4080e0=_0x3588c2['from']!==undefined?Number(_0x3588c2[_0x4d6f4f(0xf5)]):undefined,_0x38c4b7=_0x3588c2['to']!==undefined?Number(_0x3588c2['to']):undefined,_0x555943=await withSpinner('Getting\x20schedule\x20history...',()=>_0x1606ab[_0x4d6f4f(0xcc)]['history'](_0x122f90,{'from':_0x4080e0,'to':_0x38c4b7}),{'verbose':_0x5c48bd[_0x4d6f4f(0x129)]}),_0x6b26dc=_0x555943[_0x4d6f4f(0xeb)];console['error'](_0x4d6f4f(0xf1)+_0x6b26dc['count']+_0x4d6f4f(0xb7)+(_0x6b26dc[_0x4d6f4f(0xdf)]!==0x1?'s':'')+_0x4d6f4f(0xed)+_0x6b26dc['from']+'-'+_0x6b26dc['to']+')');const _0x2fb638=_0x6b26dc[_0x4d6f4f(0xf3)]['map'](_0x1b8549=>({'job_id':_0x1b8549[_0x4d6f4f(0xbc)],'type':_0x1b8549['type'],'status':_0x1b8549[_0x4d6f4f(0x112)],'scheduled_at':_0x1b8549['scheduled_at'],'created_at':_0x1b8549[_0x4d6f4f(0xda)],'start_at':_0x1b8549[_0x4d6f4f(0xe3)],'end_at':_0x1b8549[_0x4d6f4f(0xec)]}));return await handleSDKOutput(_0x2fb638,_0x5c48bd),0x0;}}function a34_0x4b72(){const _0x3226ec=['7212HwvSxn','job_id','\x20\x20→\x20','queryUrl','\x20\x20Job\x20ID:\x20','1234UwMuEZ','executing_user_id','result','Cancelled','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','\x20\x20Cron:\x20','output','engine_version','database','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','abs','dim','schedules','user_name','\x20matching\x20\x22','timezone','5151111XVErhv','\x20schedules','execute','table','round','green','tsv','976tiThUl','last_job','134019XrnNAX','created_at','\x20scheduled\x20quer','180CIEjCb','\x20job','soon','count','priority','retryLimit','utf-8','start_at','Query\x20file\x20is\x20empty','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','map','cron','retry_limit','success','validate','data','end_at','\x20(showing\x20','Schedule\x20created:\x20','in\x20','name','Found\x20','nextRun','history','h\x20ago','from','schedule:list','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','\x20\x20Timezone:\x20','Creating\x20schedule...','create','INVALID_ARGUMENT','time','num','just\x20now','time_zone','schedule:update','trino','engineVersion','keys','listQueries','ies','delete','join','No\x20scheduled\x20queries\x20found','\x20\x20Num:\x20','delay','507XAxePB','padEnd','jsonl','statusIcon','Updating\x20schedule...','schedule:run','next_run_at','status','yes','Update\x20a\x20scheduled\x20query','format','3600444kKGrqM','Updating\x20schedule:\x20','Schedule\x20updated:\x20','show','update','schedule:history','query','d\x20ago','(unnamed)','Show\x20schedule\x20details','site','Listing\x20scheduled\x20queries...','trim','Failed\x20to\x20read\x20file:\x20','entries','error','schedule:show','max','log','verbose','Running\x20schedule:\x20','json','📅\x20','length','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','\x20(use\x20--limit\x20to\x20see\x20more)','1476690YzHBql','limit','type','Searching\x20scheduled\x20queries\x20matching\x20\x22','description','/app/queries/editor?queryId=','Creating\x20schedule:\x20','schedule:create','List\x20scheduled\x20queries','...','toLocaleDateString','Running\x20schedule...','Delete\x20a\x20scheduled\x20query','substring','schedule:delete','updated_at','4146264kTPmzC','run','pagination','file','lastRun','jobs','\x20execution','args','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','options'];a34_0x4b72=function(){return _0x3226ec;};return a34_0x4b72();}
1
+ const a34_0x33a2e9=a34_0x4f62;(function(_0x3ace69,_0x15c554){const _0x25db01=a34_0x4f62,_0x1a3369=_0x3ace69();while(!![]){try{const _0x44b53f=-parseInt(_0x25db01(0x9c))/0x1*(-parseInt(_0x25db01(0x6c))/0x2)+-parseInt(_0x25db01(0xa0))/0x3*(-parseInt(_0x25db01(0x96))/0x4)+parseInt(_0x25db01(0xd9))/0x5*(-parseInt(_0x25db01(0xea))/0x6)+parseInt(_0x25db01(0xca))/0x7*(parseInt(_0x25db01(0xaa))/0x8)+parseInt(_0x25db01(0xa1))/0x9*(parseInt(_0x25db01(0xec))/0xa)+parseInt(_0x25db01(0xdc))/0xb*(-parseInt(_0x25db01(0xf4))/0xc)+parseInt(_0x25db01(0xfc))/0xd*(parseInt(_0x25db01(0xc2))/0xe);if(_0x44b53f===_0x15c554)break;else _0x1a3369['push'](_0x1a3369['shift']());}catch(_0x172aa0){_0x1a3369['push'](_0x1a3369['shift']());}}}(a34_0xd7e3,0x63440));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';function a34_0xd7e3(){const _0x33c36f=['tsv','delay','2VqzduK','timezone','queryUrl','utf-8','show','\x20\x20Type:\x20','schedule:run','length','schedule:show','Schedule\x20deleted:\x20','dim','keys','\x20schedules','time','user','\x20execution','Updating\x20schedule:\x20','scheduled_at','Show\x20schedule\x20execution\x20history','file','\x20\x20Num:\x20','verbose','num','trino','abs','from','\x20matching\x20\x22','...','\x20\x20Job\x20ID:\x20','output','ended_at','just\x20now','Showing\x20first\x20','listQueries','m\x20ago','\x20\x20→\x20','format','Schedule\x20created:\x20','engineVersion','name','\x20(showing\x20','cron','8QkPDNx','list','schedule:delete','end_at','type','next_run_at','65659ZmeJHQ','database','pagination','entries','101922MUAAHO','9dUbUeR','Schedule\x20run\x20submitted:\x20','result','toLocaleDateString','jsonl','INVALID_ARGUMENT','Creating\x20schedule...','error','limit','8aYaioj','never','history','schedule:create','green','args','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','validate','has_next_page','log','substring','schedule:update','queries','Found\x20','in\x20','join','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Running\x20schedule...','priority','schedule:list','Run\x20a\x20scheduled\x20query\x20immediately','data','success','14IdZvpB','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','retry_limit','Show\x20schedule\x20details','Cancelled','execute','created_at','trim','5253199xcwFhY','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Getting\x20schedule\x20details...','getTime','job_id','Query\x20file\x20is\x20empty','\x20\x20Database:\x20','schedule:history','d\x20ago','Create\x20a\x20scheduled\x20query','Deleting\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','max','/app/queries/editor?queryId=','\x20\x20Timezone:\x20','10cJzLey','jobs','List\x20scheduled\x20queries','11Glwnkg','delete','h\x20ago','count','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','schedules','site','Delete\x20a\x20scheduled\x20query','nextRun','last_job','lastRun','start_at','Failed\x20to\x20read\x20file:\x20','query','1565538HSEdXe','round','260560rZiVtd','map','Getting\x20schedule\x20history...','create','retryLimit','\x20created','description','status','5409588MgboUF','Update\x20a\x20scheduled\x20query','Creating\x20schedule:\x20','Searching\x20scheduled\x20queries\x20matching\x20\x22','padEnd','run','\x20job','statusIcon','6098521bknFbw','update'];a34_0xd7e3=function(){return _0x33c36f;};return a34_0xd7e3();}function a34_0x4f62(_0x529f67,_0x59c370){_0x529f67=_0x529f67-0x69;const _0xd7e349=a34_0xd7e3();let _0x4f6257=_0xd7e349[_0x529f67];return _0x4f6257;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x19a858 from'chalk';function formatRelativeTime(_0x880bc0){const _0x35fc07=a34_0x4f62,_0x4141e0=new Date(_0x880bc0),_0x25b3ac=new Date(),_0x51e13c=_0x4141e0[_0x35fc07(0xcd)]()-_0x25b3ac[_0x35fc07(0xcd)](),_0x31d6e2=Math[_0x35fc07(0x84)](_0x51e13c)/0x3e8,_0x1fb920=_0x51e13c<0x0;if(_0x31d6e2<0x3c)return _0x1fb920?_0x35fc07(0x8b):'soon';else{if(_0x31d6e2<0xe10){const _0x3888ce=Math[_0x35fc07(0xeb)](_0x31d6e2/0x3c);return _0x1fb920?_0x3888ce+_0x35fc07(0x8e):_0x35fc07(0xb9)+_0x3888ce+'m';}else{if(_0x31d6e2<0x15180){const _0x11f806=Math['round'](_0x31d6e2/0xe10);return _0x1fb920?_0x11f806+_0x35fc07(0xde):'in\x20'+_0x11f806+'h';}else{if(_0x31d6e2<0x93a80){const _0x4fd5f4=Math[_0x35fc07(0xeb)](_0x31d6e2/0x15180);return _0x1fb920?_0x4fd5f4+_0x35fc07(0xd2):'in\x20'+_0x4fd5f4+'d';}else return _0x4141e0[_0x35fc07(0xa4)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0xbe);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xdb);async[a34_0x33a2e9(0xc7)](_0x3ff6f0){const _0x25898d=a34_0x33a2e9,{options:_0x26e50a,args:_0x15afdc,tdx:_0x520b98}=_0x3ff6f0,_0x23f173=resolveLimit(_0x26e50a[_0x25898d(0xa9)],DEFAULT_DISPLAY_LIMIT),_0x93326c=_0x15afdc[0x0],_0x355c52=_0x93326c?_0x25898d(0xf7)+_0x93326c+'\x22...':'Listing\x20scheduled\x20queries...',_0x289da7=await withSpinner(_0x355c52,()=>_0x520b98[_0x25898d(0xe1)][_0x25898d(0x8d)]({'limit':_0x23f173,'scheduled':!![],'pattern':_0x93326c}),{'verbose':_0x26e50a[_0x25898d(0x81)]}),_0x45a504=_0x289da7[_0x25898d(0xc0)][_0x25898d(0xb7)],_0x55e56e=_0x289da7[_0x25898d(0xc0)][_0x25898d(0x9e)][_0x25898d(0xb3)],_0x2b1426=_0x93326c?_0x25898d(0x86)+_0x93326c+'\x22':'';_0x55e56e?console['error'](_0x25898d(0x8c)+_0x45a504['length']+_0x25898d(0x78)+_0x2b1426+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x25898d(0xa8)](_0x25898d(0xb8)+_0x45a504[_0x25898d(0x73)]+'\x20scheduled\x20quer'+(_0x45a504[_0x25898d(0x73)]!==0x1?'ies':'y')+_0x2b1426);if(_0x26e50a[_0x25898d(0x90)]==='json'||_0x26e50a[_0x25898d(0x90)]===_0x25898d(0xa5)||_0x26e50a[_0x25898d(0x90)]==='table'||_0x26e50a[_0x25898d(0x90)]===_0x25898d(0x6a)){const _0x25549e=_0x45a504[_0x25898d(0xed)](_0x756bd=>({'id':_0x756bd['id'],'name':_0x756bd[_0x25898d(0x93)],'cron':_0x756bd[_0x25898d(0x95)],'database':_0x756bd['database']?.['name'],'type':_0x756bd[_0x25898d(0x9a)],'timezone':_0x756bd['time_zone'],'user_name':_0x756bd[_0x25898d(0x7a)]?.['name'],'updated_at':_0x756bd['updated_at'],'next_run_at':_0x756bd[_0x25898d(0x9b)],'last_job_status':_0x756bd[_0x25898d(0xe5)]?.[_0x25898d(0xf3)]}));await handleSDKOutput(_0x25549e,_0x26e50a);}else{if(_0x45a504[_0x25898d(0x73)]===0x0)console[_0x25898d(0xb4)]('No\x20scheduled\x20queries\x20found');else{const _0x16c56d=_0x26e50a[_0x25898d(0xe2)],_0x2ad995=_0x45a504[_0x25898d(0xed)](_0x1dedde=>{const _0x5f2263=_0x25898d,_0x38a50e=_0x1dedde[_0x5f2263(0xe5)]?.['status']?_0x1dedde[_0x5f2263(0xe5)][_0x5f2263(0xf3)]==='success'?'✓':'✗':'-',_0x1515bb=_0x1dedde[_0x5f2263(0xe5)]?.[_0x5f2263(0x8a)]?formatRelativeTime(_0x1dedde[_0x5f2263(0xe5)][_0x5f2263(0x8a)]):_0x5f2263(0xab),_0x4f0edd=_0x1dedde['next_run_at']?formatRelativeTime(_0x1dedde[_0x5f2263(0x9b)]):'-',_0x65956e=_0x1dedde['cron']||'',_0x1496dc=_0x1dedde[_0x5f2263(0x93)]||'(unnamed)',_0x35529e=getConsoleUrl(_0x16c56d,_0x5f2263(0xd7)+_0x1dedde['id']);return{'statusIcon':_0x38a50e,'lastRun':_0x1515bb,'nextRun':_0x4f0edd,'cron':_0x65956e,'name':_0x1496dc,'queryUrl':_0x35529e,'status':_0x1dedde[_0x5f2263(0xe5)]?.[_0x5f2263(0xf3)]};}),_0x57869f=Math[_0x25898d(0xd6)](..._0x2ad995[_0x25898d(0xed)](_0x2e20a8=>_0x2e20a8[_0x25898d(0xe6)]['length'])),_0x550cca=Math['max'](..._0x2ad995[_0x25898d(0xed)](_0x4a5848=>_0x4a5848['nextRun'][_0x25898d(0x73)])),_0x5a55ba=Math[_0x25898d(0xd6)](..._0x2ad995[_0x25898d(0xed)](_0x2d9da1=>_0x2d9da1[_0x25898d(0x95)][_0x25898d(0x73)])),_0x59e926=_0x2ad995[_0x25898d(0xed)](_0x2c95d6=>{const _0x197476=_0x25898d,_0x1042fe=_0x2c95d6[_0x197476(0xf3)]===_0x197476(0xc1)?a34_0x19a858[_0x197476(0xae)](_0x2c95d6[_0x197476(0xfb)]):_0x2c95d6['status']===_0x197476(0xa8)?a34_0x19a858['red'](_0x2c95d6['statusIcon']):a34_0x19a858[_0x197476(0x76)](_0x2c95d6[_0x197476(0xfb)]),_0x5f5b4c=_0x2c95d6['lastRun']['padEnd'](_0x57869f),_0xb01175=_0x2c95d6[_0x197476(0xe4)][_0x197476(0xf8)](_0x550cca),_0x2a350d=_0x2c95d6[_0x197476(0x95)]?a34_0x19a858['cyan'](_0x2c95d6['cron'][_0x197476(0xf8)](_0x5a55ba)):'\x20'['repeat'](_0x5a55ba),_0x4f984b=hyperlink(_0x2c95d6[_0x197476(0x93)],_0x2c95d6[_0x197476(0x6e)]);return'📅\x20'+_0x1042fe+'\x20'+_0x5f5b4c+_0x197476(0x8f)+_0xb01175+'\x20\x20'+_0x2a350d+'\x20\x20'+_0x4f984b;});await writeOutput(_0x59e926[_0x25898d(0xba)]('\x0a'),_0x26e50a[_0x25898d(0x89)],_0x25898d(0x97));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0x74);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xc5);[a34_0x33a2e9(0xb2)](_0x2729b6){const _0x11df0b=a34_0x33a2e9,_0x27ea15=_0x2729b6[_0x11df0b(0xaf)][0x0];if(!_0x27ea15)return _0x11df0b(0xe0);return undefined;}async[a34_0x33a2e9(0xc7)](_0x5412b7){const _0x5769f3=a34_0x33a2e9,{options:_0x1078d1,args:_0x263c86,tdx:_0x323024}=_0x5412b7,_0x15b034=_0x263c86[0x0],_0x4dacff=await withSpinner(_0x5769f3(0xcc),()=>_0x323024[_0x5769f3(0xe1)][_0x5769f3(0x70)](_0x15b034),{'verbose':_0x1078d1[_0x5769f3(0x81)]}),_0x376669=_0x4dacff[_0x5769f3(0xc0)],_0x2fe221={'name':_0x376669[_0x5769f3(0x93)],'cron':_0x376669['cron'],'database':_0x376669[_0x5769f3(0x9d)],'type':_0x376669[_0x5769f3(0x9a)],'timezone':_0x376669[_0x5769f3(0x6d)],'user_name':_0x376669['user_name'],'created_at':_0x376669[_0x5769f3(0xc8)],'engine_version':_0x376669['engine_version'],'executing_user_id':_0x376669['executing_user_id'],'query':_0x376669[_0x5769f3(0xe9)],'delay':_0x376669[_0x5769f3(0x6b)],'priority':_0x376669[_0x5769f3(0xbd)],'retry_limit':_0x376669[_0x5769f3(0xc4)],..._0x376669[_0x5769f3(0xa3)]&&{'result':_0x376669[_0x5769f3(0xa3)]}};return await handleSingleObjectOutput(_0x2fe221,_0x1078d1),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x33a2e9(0xad);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xd3);[a34_0x33a2e9(0xb2)](_0x544dee){const _0x154057=a34_0x33a2e9,_0x2937d7=_0x544dee[_0x154057(0xaf)][0x0];if(!_0x2937d7)return _0x154057(0xb1);const _0x41145c=_0x544dee['options'];if(!_0x41145c['database'])return _0x154057(0xbb);return undefined;}async['execute'](_0x47c547){const _0x1336d6=a34_0x33a2e9,{options:_0xea1ce6,args:_0x584525,tdx:_0xba5da2}=_0x47c547,_0x529b37=_0x584525[0x0],_0xa12def=_0xea1ce6,_0x100ea9=_0xa12def[_0x1336d6(0x9d)],_0x3d53ce=_0xa12def[_0x1336d6(0x7f)],_0x55ce43=_0xa12def[_0x1336d6(0x9a)]||_0x1336d6(0x83);let _0x464217;try{_0x464217=readFileSync(_0x3d53ce,_0x1336d6(0x6f))[_0x1336d6(0xc9)]();}catch(_0x1cad71){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1336d6(0xe8)+_0x3d53ce,_0x1cad71 instanceof Error?_0x1cad71:undefined);}if(!_0x464217)throw new SDKError(ErrorCode[_0x1336d6(0xa6)],_0x1336d6(0xcf));const _0x2db129={'database':_0x100ea9,'query':_0x464217,'type':_0x55ce43};if(_0xa12def[_0x1336d6(0x95)])_0x2db129[_0x1336d6(0x95)]=_0xa12def[_0x1336d6(0x95)];if(_0xa12def[_0x1336d6(0x6d)])_0x2db129[_0x1336d6(0x6d)]=_0xa12def[_0x1336d6(0x6d)];if(_0xa12def[_0x1336d6(0x6b)]!==undefined)_0x2db129[_0x1336d6(0x6b)]=Number(_0xa12def[_0x1336d6(0x6b)]);if(_0xa12def['priority']!==undefined)_0x2db129[_0x1336d6(0xbd)]=Number(_0xa12def[_0x1336d6(0xbd)]);if(_0xa12def[_0x1336d6(0xf0)]!==undefined)_0x2db129[_0x1336d6(0xc4)]=Number(_0xa12def[_0x1336d6(0xf0)]);if(_0xa12def[_0x1336d6(0x92)])_0x2db129['engine_version']=_0xa12def[_0x1336d6(0x92)];if(_0xa12def[_0x1336d6(0xa3)])_0x2db129[_0x1336d6(0xa3)]=_0xa12def[_0x1336d6(0xa3)];if(_0xea1ce6[_0x1336d6(0x81)]){console[_0x1336d6(0xa8)](_0x1336d6(0xf6)+_0x529b37),console[_0x1336d6(0xa8)](_0x1336d6(0xd0)+_0x100ea9),console[_0x1336d6(0xa8)](_0x1336d6(0x71)+_0x55ce43);if(_0x2db129[_0x1336d6(0x95)])console[_0x1336d6(0xa8)]('\x20\x20Cron:\x20'+_0x2db129['cron']);if(_0x2db129[_0x1336d6(0x6d)])console[_0x1336d6(0xa8)](_0x1336d6(0xd8)+_0x2db129[_0x1336d6(0x6d)]);}const _0x5b0cb5=await withSpinner(_0x1336d6(0xa7),()=>_0xba5da2[_0x1336d6(0xe1)][_0x1336d6(0xef)](_0x529b37,_0x2db129),{'verbose':_0xea1ce6[_0x1336d6(0x81)]});return console[_0x1336d6(0xa8)](_0x1336d6(0x91)+_0x5b0cb5[_0x1336d6(0xc0)]['name']),await handleSingleObjectOutput(_0x5b0cb5[_0x1336d6(0xc0)],_0xea1ce6),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0xb6);['description']=a34_0x33a2e9(0xf5);[a34_0x33a2e9(0xb2)](_0x395ba6){const _0x34780c=a34_0x33a2e9,_0x3b74d1=_0x395ba6[_0x34780c(0xaf)][0x0];if(!_0x3b74d1)return _0x34780c(0xd5);return undefined;}async[a34_0x33a2e9(0xc7)](_0x401708){const _0xa9ed69=a34_0x33a2e9,{options:_0x1d8583,args:_0x55b95a,tdx:_0x2cb6a7}=_0x401708,_0x8b4c06=_0x55b95a[0x0],_0x469dfc=_0x1d8583,_0xb404fb={};if(_0x469dfc['database'])_0xb404fb[_0xa9ed69(0x9d)]=_0x469dfc['database'];if(_0x469dfc['type'])_0xb404fb[_0xa9ed69(0x9a)]=_0x469dfc[_0xa9ed69(0x9a)];if(_0x469dfc[_0xa9ed69(0x95)])_0xb404fb[_0xa9ed69(0x95)]=_0x469dfc[_0xa9ed69(0x95)];if(_0x469dfc[_0xa9ed69(0x6d)])_0xb404fb[_0xa9ed69(0x6d)]=_0x469dfc['timezone'];if(_0x469dfc[_0xa9ed69(0x6b)]!==undefined)_0xb404fb[_0xa9ed69(0x6b)]=Number(_0x469dfc['delay']);if(_0x469dfc[_0xa9ed69(0xbd)]!==undefined)_0xb404fb['priority']=Number(_0x469dfc[_0xa9ed69(0xbd)]);if(_0x469dfc['retryLimit']!==undefined)_0xb404fb[_0xa9ed69(0xc4)]=Number(_0x469dfc[_0xa9ed69(0xf0)]);if(_0x469dfc[_0xa9ed69(0x92)])_0xb404fb['engine_version']=_0x469dfc[_0xa9ed69(0x92)];if(_0x469dfc[_0xa9ed69(0xa3)])_0xb404fb[_0xa9ed69(0xa3)]=_0x469dfc[_0xa9ed69(0xa3)];if(_0x469dfc['file'])try{_0xb404fb[_0xa9ed69(0xe9)]=readFileSync(_0x469dfc[_0xa9ed69(0x7f)],_0xa9ed69(0x6f))[_0xa9ed69(0xc9)]();}catch(_0x562ae5){throw new SDKError(ErrorCode[_0xa9ed69(0xa6)],_0xa9ed69(0xe8)+_0x469dfc['file'],_0x562ae5 instanceof Error?_0x562ae5:undefined);}if(Object[_0xa9ed69(0x77)](_0xb404fb)[_0xa9ed69(0x73)]===0x0)throw new SDKError(ErrorCode[_0xa9ed69(0xa6)],_0xa9ed69(0xc3));if(_0x1d8583['verbose']){console[_0xa9ed69(0xa8)](_0xa9ed69(0x7c)+_0x8b4c06);for(const [_0x5259dd,_0x1df900]of Object[_0xa9ed69(0x9f)](_0xb404fb)){_0x5259dd===_0xa9ed69(0xe9)?console[_0xa9ed69(0xa8)]('\x20\x20'+_0x5259dd+':\x20'+_0x1df900[_0xa9ed69(0xb5)](0x0,0x32)+_0xa9ed69(0x87)):console[_0xa9ed69(0xa8)]('\x20\x20'+_0x5259dd+':\x20'+_0x1df900);}}const _0x65e59d=await withSpinner('Updating\x20schedule...',()=>_0x2cb6a7[_0xa9ed69(0xe1)][_0xa9ed69(0x69)](_0x8b4c06,_0xb404fb),{'verbose':_0x1d8583[_0xa9ed69(0x81)]});return console['error']('Schedule\x20updated:\x20'+_0x65e59d['data'][_0xa9ed69(0x93)]),await handleSingleObjectOutput(_0x65e59d[_0xa9ed69(0xc0)],_0x1d8583),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x33a2e9(0x98);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0xe3);[a34_0x33a2e9(0xb2)](_0x2b20f5){const _0xaa66b8=a34_0x33a2e9,_0x2a6199=_0x2b20f5[_0xaa66b8(0xaf)][0x0];if(!_0x2a6199)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x33a2e9(0xc7)](_0x1dbc65){const _0x59dff6=a34_0x33a2e9,{options:_0x16a3bc,args:_0x14e2a7,tdx:_0x40c8f0}=_0x1dbc65,_0x2df443=_0x14e2a7[0x0];if(!_0x16a3bc['yes']){const _0x5e7535=await confirm(_0x59dff6(0xb0)+_0x2df443+'\x22?');if(!_0x5e7535)return console[_0x59dff6(0xa8)](_0x59dff6(0xc6)),0x0;}const _0xbc240f=await withSpinner(_0x59dff6(0xd4),()=>_0x40c8f0[_0x59dff6(0xe1)][_0x59dff6(0xdd)](_0x2df443),{'verbose':_0x16a3bc[_0x59dff6(0x81)]});return console['error'](_0x59dff6(0x75)+_0xbc240f[_0x59dff6(0xc0)][_0x59dff6(0x93)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0x72);['description']=a34_0x33a2e9(0xbf);[a34_0x33a2e9(0xb2)](_0x3bad0d){const _0x2dd86f=a34_0x33a2e9,_0x111ddf=_0x3bad0d[_0x2dd86f(0xaf)][0x0];if(!_0x111ddf)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async['execute'](_0x564969){const _0x8e2fb2=a34_0x33a2e9,{options:_0x2976c4,args:_0x14f296,tdx:_0x579535}=_0x564969,_0x573ae5=_0x14f296[0x0],_0x128253=_0x2976c4,_0x4595fb=_0x128253[_0x8e2fb2(0x79)],_0x882a31=_0x128253[_0x8e2fb2(0x82)]!==undefined?Number(_0x128253[_0x8e2fb2(0x82)]):undefined;if(_0x2976c4[_0x8e2fb2(0x81)]){console[_0x8e2fb2(0xa8)]('Running\x20schedule:\x20'+_0x573ae5);if(_0x4595fb)console[_0x8e2fb2(0xa8)]('\x20\x20Time:\x20'+_0x4595fb);if(_0x882a31)console[_0x8e2fb2(0xa8)](_0x8e2fb2(0x80)+_0x882a31);}const _0x44725d=await withSpinner(_0x8e2fb2(0xbc),()=>_0x579535[_0x8e2fb2(0xe1)][_0x8e2fb2(0xf9)](_0x573ae5,{'time':_0x4595fb,'num':_0x882a31}),{'verbose':_0x2976c4['verbose']}),_0x1bab1a=_0x44725d['data'][_0x8e2fb2(0xda)];console['error'](_0x8e2fb2(0xa2)+_0x1bab1a['length']+_0x8e2fb2(0xfa)+(_0x1bab1a[_0x8e2fb2(0x73)]!==0x1?'s':'')+_0x8e2fb2(0xf1));for(const _0x211d93 of _0x1bab1a){console[_0x8e2fb2(0xa8)](_0x8e2fb2(0x88)+_0x211d93[_0x8e2fb2(0xce)]);}return await handleSDKOutput(_0x1bab1a,_0x2976c4),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x33a2e9(0x93)]=a34_0x33a2e9(0xd1);[a34_0x33a2e9(0xf2)]=a34_0x33a2e9(0x7e);['validate'](_0x3d3996){const _0xbae0f5=a34_0x33a2e9,_0x4e8c87=_0x3d3996[_0xbae0f5(0xaf)][0x0];if(!_0x4e8c87)return _0xbae0f5(0xcb);return undefined;}async[a34_0x33a2e9(0xc7)](_0x3b061c){const _0x4aaed7=a34_0x33a2e9,{options:_0x45a558,args:_0x22f98c,tdx:_0x5a1999}=_0x3b061c,_0x5ecfd2=_0x22f98c[0x0],_0x325951=_0x45a558,_0x16139a=_0x325951[_0x4aaed7(0x85)]!==undefined?Number(_0x325951['from']):undefined,_0x326e35=_0x325951['to']!==undefined?Number(_0x325951['to']):undefined,_0x3836e1=await withSpinner(_0x4aaed7(0xee),()=>_0x5a1999['schedules'][_0x4aaed7(0xac)](_0x5ecfd2,{'from':_0x16139a,'to':_0x326e35}),{'verbose':_0x45a558[_0x4aaed7(0x81)]}),_0x1d9b71=_0x3836e1[_0x4aaed7(0xc0)];console['error'](_0x4aaed7(0xb8)+_0x1d9b71[_0x4aaed7(0xdf)]+_0x4aaed7(0x7b)+(_0x1d9b71[_0x4aaed7(0xdf)]!==0x1?'s':'')+_0x4aaed7(0x94)+_0x1d9b71[_0x4aaed7(0x85)]+'-'+_0x1d9b71['to']+')');const _0x1bb8c9=_0x1d9b71[_0x4aaed7(0xac)][_0x4aaed7(0xed)](_0x292161=>({'job_id':_0x292161[_0x4aaed7(0xce)],'type':_0x292161[_0x4aaed7(0x9a)],'status':_0x292161['status'],'scheduled_at':_0x292161[_0x4aaed7(0x7d)],'created_at':_0x292161[_0x4aaed7(0xc8)],'start_at':_0x292161[_0x4aaed7(0xe7)],'end_at':_0x292161[_0x4aaed7(0x99)]}));return await handleSDKOutput(_0x1bb8c9,_0x45a558),0x0;}}
@@ -1 +1 @@
1
- const a35_0x3e5dea=a35_0x42a2;(function(_0x2d8c67,_0x2c25e9){const _0x4e18ff=a35_0x42a2,_0x56ba42=_0x2d8c67();while(!![]){try{const _0x456170=parseInt(_0x4e18ff(0x118))/0x1*(-parseInt(_0x4e18ff(0x12a))/0x2)+parseInt(_0x4e18ff(0xc1))/0x3*(parseInt(_0x4e18ff(0x121))/0x4)+-parseInt(_0x4e18ff(0x10e))/0x5+-parseInt(_0x4e18ff(0x96))/0x6+-parseInt(_0x4e18ff(0x111))/0x7*(-parseInt(_0x4e18ff(0xb5))/0x8)+-parseInt(_0x4e18ff(0xe3))/0x9+parseInt(_0x4e18ff(0x11f))/0xa;if(_0x456170===_0x2c25e9)break;else _0x56ba42['push'](_0x56ba42['shift']());}catch(_0x295650){_0x56ba42['push'](_0x56ba42['shift']());}}}(a35_0x49ff,0x719f6));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x135643 from'chalk';async function resolveSegmentTarget(_0x42286c,_0x1c5c68,_0x8e1ef7){const _0x3564f5=a35_0x42a2;if(isYamlFilePath(_0x42286c))try{const _0x197ae0=await resolveYamlFilePath(_0x42286c);return _0x8e1ef7&&(console[_0x3564f5(0x122)](_0x3564f5(0xcd)+_0x42286c),console[_0x3564f5(0x122)]('\x20\x20Parent\x20segment:\x20'+_0x197ae0[_0x3564f5(0xd4)]),console[_0x3564f5(0x122)](_0x3564f5(0x11a)+_0x197ae0[_0x3564f5(0x9e)]),console[_0x3564f5(0x122)](_0x3564f5(0xb7)+(_0x197ae0['folderPath']||_0x3564f5(0xfc))),console[_0x3564f5(0x122)](_0x3564f5(0x95)+_0x197ae0['fullPath'])),_0x197ae0[_0x3564f5(0x124)];}catch(_0x398054){throw new SDKError(ErrorCode[_0x3564f5(0xd7)],_0x3564f5(0x12f)+_0x398054[_0x3564f5(0x8e)]);}if(!_0x1c5c68)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x1c5c68+'/'+_0x42286c;}function a35_0x42a2(_0x1665aa,_0x2d589a){_0x1665aa=_0x1665aa-0x8c;const _0x49ff3e=a35_0x49ff();let _0x42a2ff=_0x49ff3e[_0x1665aa];return _0x42a2ff;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0x100);['description']=a35_0x3e5dea(0x128);async[a35_0x3e5dea(0xe1)](_0x50a47){const _0x4f2149=a35_0x3e5dea,{options:_0x4b6a2f,args:_0x4bf9d2,tdx:_0x50cd5b}=_0x50a47,_0x29943c=_0x4bf9d2[0x0],_0x4b347c=!_0x29943c&&!!_0x4b6a2f[_0x4f2149(0xd4)],_0x18e0d4=_0x29943c||_0x4b6a2f[_0x4f2149(0xd4)];if(!_0x18e0d4)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x4f2149(0x125)),console[_0x4f2149(0x122)](_0x4f2149(0xad)),console['error'](_0x4f2149(0x8f)),console[_0x4f2149(0x122)](_0x4f2149(0xc3)),console[_0x4f2149(0x122)](_0x4f2149(0x104)),console['error'](_0x4f2149(0xd3)),0x1;try{const _0x61862=_0x4b6a2f['segmentPath'];let _0x518b91=_0x18e0d4;!_0x4b347c&&_0x61862&&!_0x18e0d4['includes']('/')&&(_0x518b91=_0x61862+'/'+_0x18e0d4,_0x4b6a2f[_0x4f2149(0xe0)]&&console['error'](_0x4f2149(0xbc)+_0x518b91));const _0x1a8fec=await withSpinner('Resolving\x20path\x20\x27'+_0x518b91+'\x27...',()=>_0x50cd5b[_0x4f2149(0xd9)][_0x4f2149(0x9f)](_0x518b91),{'verbose':_0x4b6a2f['verbose']}),_0x3a7719=_0x1a8fec[_0x4f2149(0xea)];_0x4b6a2f[_0x4f2149(0xe0)]&&(console['error'](_0x4f2149(0x9d)+_0x3a7719[_0x4f2149(0x90)]),console[_0x4f2149(0x122)](_0x4f2149(0xff)+_0x3a7719[_0x4f2149(0xcb)]),_0x3a7719[_0x4f2149(0xf1)]&&console[_0x4f2149(0x122)](_0x4f2149(0x8c)+_0x3a7719[_0x4f2149(0xf1)]),_0x3a7719[_0x4f2149(0x109)]&&console[_0x4f2149(0x122)](_0x4f2149(0x91)+_0x3a7719['segmentId']));if(_0x3a7719[_0x4f2149(0x90)]==='parent'){const _0x33cb94=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x50cd5b[_0x4f2149(0xd9)]['getParent'](_0x3a7719[_0x4f2149(0xcb)]),{'verbose':_0x4b6a2f[_0x4f2149(0xe0)]});await handleSingleObjectOutput(_0x33cb94[_0x4f2149(0xea)],_0x4b6a2f);}else{if(_0x3a7719[_0x4f2149(0x90)]==='folder'){if(!_0x3a7719[_0x4f2149(0xf1)])throw new SDKError(ErrorCode[_0x4f2149(0x9b)],_0x4f2149(0xb2));const _0x1f374f=await withSpinner(_0x4f2149(0xa5),()=>_0x50cd5b[_0x4f2149(0xd9)][_0x4f2149(0x112)](_0x3a7719['folderId']),{'verbose':_0x4b6a2f[_0x4f2149(0xe0)]});await handleSingleObjectOutput(_0x1f374f[_0x4f2149(0xea)],_0x4b6a2f);}else{if(_0x3a7719[_0x4f2149(0x90)]==='segment'){if(!_0x3a7719[_0x4f2149(0x109)])throw new SDKError(ErrorCode[_0x4f2149(0xfd)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3bd4a1=await withSpinner('Fetching\x20segment\x20details...',()=>_0x50cd5b[_0x4f2149(0xd9)]['getSegment'](_0x3a7719[_0x4f2149(0xcb)],_0x3a7719[_0x4f2149(0x109)]),{'verbose':_0x4b6a2f[_0x4f2149(0xe0)]});await handleSingleObjectOutput(_0x3bd4a1[_0x4f2149(0xea)],_0x4b6a2f);}}}return 0x0;}catch(_0xbcf581){if(_0xbcf581 instanceof SDKError)return console[_0x4f2149(0x122)](_0x4f2149(0xd0)+_0xbcf581[_0x4f2149(0x8e)]),_0xbcf581[_0x4f2149(0x107)]&&console[_0x4f2149(0x122)](_0x4f2149(0xce)+_0xbcf581[_0x4f2149(0x107)]),0x1;throw _0xbcf581;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0xa9);[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0x126);async['execute'](_0x28bf08){const _0x28c164=a35_0x3e5dea,{options:_0x5e360c,args:_0x2c5c6e,tdx:_0x589c78}=_0x28bf08,_0x13d4c6=_0x2c5c6e[0x0];if(!_0x13d4c6)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x28c164(0x122)](_0x28c164(0xdd)),console[_0x28c164(0x122)](_0x28c164(0xf6)),console['error'](_0x28c164(0xad)),console[_0x28c164(0x122)](_0x28c164(0xd5)),console[_0x28c164(0x122)](_0x28c164(0x106)),0x1;try{const _0x23c2b6=_0x5e360c[_0x28c164(0xd4)],_0x17513e=await resolveSegmentTarget(_0x13d4c6,_0x23c2b6,_0x5e360c[_0x28c164(0xe0)]);_0x5e360c['verbose']&&console[_0x28c164(0x122)](_0x28c164(0x123)+_0x17513e);const _0x8f910c=await withSpinner(_0x28c164(0xc8)+_0x13d4c6+'\x27...',()=>_0x589c78[_0x28c164(0xd9)][_0x28c164(0x9f)](_0x17513e),{'verbose':_0x5e360c['verbose']}),_0x55366a=_0x8f910c[_0x28c164(0xea)];_0x5e360c[_0x28c164(0xe0)]&&(console[_0x28c164(0x122)](_0x28c164(0x9d)+_0x55366a[_0x28c164(0x90)]),console[_0x28c164(0x122)](_0x28c164(0xff)+_0x55366a[_0x28c164(0xcb)]));if(_0x55366a[_0x28c164(0x90)]===_0x28c164(0x10a))return console[_0x28c164(0x122)](_0x28c164(0xe5)),console[_0x28c164(0x122)](_0x28c164(0xbe)),0x1;if(_0x55366a[_0x28c164(0x90)]===_0x28c164(0x12e))return console['error'](_0x28c164(0xb0)),console[_0x28c164(0x122)](_0x28c164(0x101)),0x1;if(!_0x55366a[_0x28c164(0x109)])throw new SDKError(ErrorCode[_0x28c164(0xfd)],_0x28c164(0xf0));const _0xd24942=await withSpinner(_0x28c164(0x10f),()=>_0x589c78[_0x28c164(0xd9)]['getSegmentSQL'](_0x55366a['parentId'],_0x55366a[_0x28c164(0x109)]),{'verbose':_0x5e360c[_0x28c164(0xe0)]});let _0x135276=_0xd24942[_0x28c164(0xea)];const _0x312da4=resolveLimit(_0x5e360c[_0x28c164(0x113)],DEFAULT_DISPLAY_LIMIT),_0x10ce16=/\bLIMIT\s+\d+/i[_0x28c164(0xed)](_0x135276);!_0x10ce16&&(_0x135276=_0x135276[_0x28c164(0x119)]()['replace'](/;+$/,''),_0x135276=_0x28c164(0x103)+_0x135276+_0x28c164(0x11e)+_0x312da4);_0x5e360c[_0x28c164(0xe0)]&&console[_0x28c164(0x122)](_0x28c164(0xc9)+_0x135276);const _0x214b63=await withProgressSpinner(_0x28c164(0xfe),async _0x30079e=>{const _0x573661=_0x28c164,_0x472742=await _0x589c78['query'][_0x573661(0xe1)](_0x135276,{'catalog':'td','schema':_0x573661(0x99),'onJobId':_0x2ad46e=>{const _0x3a81fd=_0x573661;_0x30079e[_0x3a81fd(0x10d)](_0x2ad46e);}});return _0x472742;},{'verbose':_0x5e360c[_0x28c164(0xe0)]}),_0x1a3954=_0x214b63[_0x28c164(0xea)],_0x106b4c=_0x1a3954[_0x28c164(0x130)]?_0x28c164(0xe4)+_0x1a3954[_0x28c164(0x130)]+']':'';return console[_0x28c164(0x122)](_0x28c164(0xdb)+_0x1a3954[_0x28c164(0xb8)]['processedRows']['toLocaleString']()+_0x28c164(0xba)+(_0x28c164(0xd6)+formatElapsed(_0x1a3954['stats'][_0x28c164(0x102)])+_0x106b4c)),await handleQueryOutput(_0x1a3954,_0x5e360c),0x0;}catch(_0x1aa3d9){if(_0x1aa3d9 instanceof SDKError)return console[_0x28c164(0x122)]('✖\x20Query\x20failed\x20['+_0x1aa3d9[_0x28c164(0xf3)]+']'),console[_0x28c164(0x122)]('\x0a'+_0x1aa3d9['message']),0x1;throw _0x1aa3d9;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0xf9);[a35_0x3e5dea(0x129)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a35_0x3e5dea(0xe1)](_0x7c2525){const _0x291860=a35_0x3e5dea,{options:_0x54f687,args:_0x437c64,tdx:_0x1d17eb}=_0x7c2525;if(_0x437c64['length']===0x0)return console[_0x291860(0x122)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x291860(0x122)](_0x291860(0x10c)),0x1;const _0x3070fb=_0x437c64[0x0];try{_0x54f687[_0x291860(0xe0)]&&(console[_0x291860(0x122)](_0x291860(0xd8)+_0x54f687[_0x291860(0xa1)]),console[_0x291860(0x122)]('Parent\x20name:\x20'+_0x3070fb));const _0x33e5ed=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3070fb+_0x291860(0xe9),()=>_0x1d17eb['segment']['resolveParentId'](_0x3070fb),{'verbose':_0x54f687['verbose']}),_0x197608=_0x33e5ed[_0x291860(0xea)];_0x54f687[_0x291860(0xe0)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x197608);const _0x1955e9=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x3070fb+'\x27...',()=>_0x1d17eb[_0x291860(0xd9)][_0x291860(0xfa)](_0x197608),{'verbose':_0x54f687[_0x291860(0xe0)]}),_0xd6001=_0x1955e9[_0x291860(0xea)];return console[_0x291860(0x122)](_0x291860(0x93)+_0xd6001[_0x291860(0xaf)]+_0x291860(0x116)+(_0xd6001['length']!==0x1?'s':'')),await handleSDKOutput(_0xd6001,_0x54f687),0x0;}catch(_0x45b8dd){if(_0x45b8dd instanceof SDKError)return console['error'](_0x291860(0xd0)+_0x45b8dd['message']),_0x45b8dd[_0x291860(0x107)]&&console['error']('\x20\x20Cause:\x20'+_0x45b8dd['cause']),0x1;throw _0x45b8dd;}}}function a35_0x49ff(){const _0x9aa8b=['listFolders','resolveParentId','(root)','SEGMENT_NOT_FOUND','Executing\x20segment\x20query...','Parent\x20ID:\x20','segment:describe','Use:\x20tdx\x20ps\x20show','elapsedTimeMillis','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','cause','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segmentId','folder','content','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','setJobId','4192940RceeGm','Fetching\x20SQL\x20for\x20segment...','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','14aZnRmC','getFolder','limit','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Resolved\x20parent\x20ID:\x20','\x20folder','createFolder','85413bVtCJA','trim','\x20\x20Segment\x20name:\x20','url','/app/ps/','Parent\x20name:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','21062580NbHcuh','green','438004xvanSh','error','Target\x20path:\x20','fullPath','Usage:\x20tdx\x20segment\x20describe\x20<path>','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolving\x20parent\x20segment\x20\x27','Show\x20segment\x20or\x20folder\x20details','description','2seDgqz','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Usage:\x20tdx\x20sg\x20desc\x20<name>','/e/','parent','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','jobId','Folder\x20ID:\x20','resolveFolderId','message','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','type','Segment\x20ID:\x20','Parent\x20segment:\x20','✔\x20Found\x20','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Full\x20path:\x20','5356350nmghEK','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','information_schema','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','SEGMENT_FOLDER_NOT_FOUND','segment:sql','Resolved\x20type:\x20','segmentName','resolvePathToResource','Resolving\x20folder\x20\x27','site','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20segment\x20details...','\x20Opening\x20','Fetching\x20folder\x20details...','name','\x27\x20with\x20ID:\x20','✔\x20Created\x20folder\x20\x27','segment:show','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','format','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Examples:','Use:\x20tdx\x20ps\x20desc','length','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:folder:show','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Create\x20segment\x20folder\x20for\x20organization','segment:desc','1052000wbQImT','getSegment','\x20\x20Folder\x20path:\x20','stats','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20rows\x20','getSQLFromYamlFile','Resolved\x20relative\x20path\x20to:\x20','Show\x20folder\x20or\x20child\x20segment\x20details','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','getSQLFromServerSegment','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','12kdChtJ','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Options:','Use:\x20tdx\x20ps\x20view\x20-w','red','Resolving\x20\x27','SQL\x20query:\x0a','getSegmentSQL','parentId','segment:view','Resolved\x20YAML\x20file:\x20','\x20\x20Cause:\x20','cyan','Error:\x20','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','jsonl','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentSegment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','in\x20','INVALID_ARGUMENT','Site:\x20','segment','Show\x20child\x20segment\x20schema\x20(column\x20types)','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Resolved:\x20','verbose','execute','Folder\x20name:\x20','4726242dYxstT','\x20[Job\x20ID:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x27...','data','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','test','getSegmentSQLFromYaml','Usage:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folderId','web','code','parentFolder','Resolved\x20folder\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20--path\x20','segment:folder:list'];a35_0x49ff=function(){return _0x9aa8b;};return a35_0x49ff();}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0xb1);[a35_0x3e5dea(0x129)]='Show\x20segment\x20folder\x20details';async[a35_0x3e5dea(0xe1)](_0x1f760a){const _0x17224d=a35_0x3e5dea,{options:_0x2eddfa,args:_0x5e51cf,tdx:_0xdca224}=_0x1f760a;if(_0x5e51cf[_0x17224d(0xaf)]===0x0)return console[_0x17224d(0x122)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x17224d(0x122)](_0x17224d(0x108)),0x1;try{const {parentId:_0x3dd6e0,childId:_0x598db0}=parseSegmentRef(_0x5e51cf[0x0]);_0x2eddfa[_0x17224d(0xe0)]&&(console[_0x17224d(0x122)](_0x17224d(0xd8)+_0x2eddfa[_0x17224d(0xa1)]),console[_0x17224d(0x122)](_0x17224d(0x11d)+_0x3dd6e0),_0x598db0&&console[_0x17224d(0x122)](_0x17224d(0xe2)+_0x598db0));if(!_0x598db0)return console[_0x17224d(0x122)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x97bddd=await withSpinner(_0x17224d(0x127)+_0x3dd6e0+_0x17224d(0xe9),()=>_0xdca224[_0x17224d(0xd9)]['resolveParentId'](_0x3dd6e0),{'verbose':_0x2eddfa[_0x17224d(0xe0)]}),_0x4cbe91=_0x97bddd['data'];_0x2eddfa[_0x17224d(0xe0)]&&console['error'](_0x17224d(0x115)+_0x4cbe91);const _0x1e0688=await withSpinner(_0x17224d(0xa0)+_0x598db0+_0x17224d(0xe9),()=>_0xdca224[_0x17224d(0xd9)][_0x17224d(0x8d)](_0x4cbe91,_0x598db0),{'verbose':_0x2eddfa[_0x17224d(0xe0)]}),_0x2b56f0=_0x1e0688[_0x17224d(0xea)];_0x2eddfa['verbose']&&console[_0x17224d(0x122)](_0x17224d(0xf5)+_0x2b56f0);const _0x2ac603=await withSpinner(_0x17224d(0xdc)+_0x598db0+'\x27...',()=>_0xdca224[_0x17224d(0xd9)][_0x17224d(0x112)](_0x2b56f0),{'verbose':_0x2eddfa[_0x17224d(0xe0)]});return await handleSDKOutput([_0x2ac603[_0x17224d(0xea)]],_0x2eddfa),0x0;}catch(_0x5374fa){if(_0x5374fa instanceof SDKError)return console[_0x17224d(0x122)](_0x17224d(0xd0)+_0x5374fa[_0x17224d(0x8e)]),_0x5374fa[_0x17224d(0x107)]&&console[_0x17224d(0x122)](_0x17224d(0xce)+_0x5374fa[_0x17224d(0x107)]),0x1;throw _0x5374fa;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0x9c);[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0x105);async['execute'](_0x485c86){const _0x25eb62=a35_0x3e5dea,{options:_0x5d56a5,args:_0x1f11dd}=_0x485c86,_0x2a3ba9=_0x5d56a5,_0xcdee49=_0x2a3ba9['path'],_0x485734=_0x1f11dd[0x0];if(!_0x485734&&!_0xcdee49)return console['error'](a35_0x135643[_0x25eb62(0xc7)](_0x25eb62(0xf7))),console[_0x25eb62(0x122)](_0x25eb62(0xef)),console['error'](_0x25eb62(0xec)),console['error'](_0x25eb62(0x94)),console[_0x25eb62(0x122)](_0x25eb62(0xad)),console[_0x25eb62(0x122)](_0x25eb62(0xde)),console['error'](_0x25eb62(0x114)),0x1;if(_0x485734&&_0xcdee49)return console[_0x25eb62(0x122)](a35_0x135643['red'](_0x25eb62(0xc0))),0x1;try{let _0x14f1fc;if(_0xcdee49)_0x14f1fc=await this[_0x25eb62(0xbb)](_0xcdee49,_0x485c86);else{if(isYamlFilePath(_0x485734))return console[_0x25eb62(0x122)](a35_0x135643['red'](_0x25eb62(0xe7))),console[_0x25eb62(0x122)](_0x25eb62(0xf8)+_0x485734),0x1;else _0x14f1fc=await this[_0x25eb62(0xbf)](_0x485734,_0x485c86);}return _0x5d56a5[_0x25eb62(0xab)]==='json'||_0x5d56a5[_0x25eb62(0xab)]===_0x25eb62(0xd2)?await handleSDKOutput([{'sql':_0x14f1fc}],_0x5d56a5):console['log'](_0x14f1fc),0x0;}catch(_0x5147f7){if(_0x5147f7 instanceof SDKError)return console[_0x25eb62(0x122)]('Error:\x20'+_0x5147f7[_0x25eb62(0x8e)]),_0x5147f7[_0x25eb62(0x107)]&&console['error'](_0x25eb62(0xce)+_0x5147f7['cause']),0x1;throw _0x5147f7;}}async[a35_0x3e5dea(0xbb)](_0x422814,_0x2a1c86){const _0x2baf55=a35_0x3e5dea,{options:_0xd04aca,tdx:_0x377aa2}=_0x2a1c86;let _0x48525c;try{_0x48525c=await resolveYamlFilePath(_0x422814);}catch(_0x4b88ec){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2baf55(0x12f)+_0x4b88ec[_0x2baf55(0x8e)]);}_0xd04aca[_0x2baf55(0xe0)]&&console[_0x2baf55(0x122)](_0x2baf55(0xdf)+_0x48525c['parentSegment']+'/'+_0x48525c['segmentName']);const _0x57fa99=await withSpinner('Fetching\x20SQL\x20from\x20rule...',()=>_0x377aa2['segment'][_0x2baf55(0xee)](_0x48525c[_0x2baf55(0x10b)],_0x48525c[_0x2baf55(0xd4)],_0x48525c['segmentName']),{'verbose':_0xd04aca['verbose']});return _0x57fa99[_0x2baf55(0xea)];}async['getSQLFromServerSegment'](_0x3892f0,_0x451e2a){const _0x4fc67a=a35_0x3e5dea,{options:_0x5d50a4,tdx:_0x2b9dbc}=_0x451e2a,_0x27fe12=_0x5d50a4[_0x4fc67a(0xd4)],_0x22e9dd=await resolveSegmentTarget(_0x3892f0,_0x27fe12,_0x5d50a4['verbose']);_0x5d50a4[_0x4fc67a(0xe0)]&&console[_0x4fc67a(0x122)](_0x4fc67a(0x123)+_0x22e9dd);const _0x2c61c8=await withSpinner(_0x4fc67a(0xc8)+_0x3892f0+_0x4fc67a(0xe9),()=>_0x2b9dbc[_0x4fc67a(0xd9)][_0x4fc67a(0x9f)](_0x22e9dd),{'verbose':_0x5d50a4['verbose']}),_0x384b48=_0x2c61c8[_0x4fc67a(0xea)];_0x5d50a4['verbose']&&(console['error'](_0x4fc67a(0x9d)+_0x384b48[_0x4fc67a(0x90)]),console['error'](_0x4fc67a(0xff)+_0x384b48[_0x4fc67a(0xcb)]));if(_0x384b48[_0x4fc67a(0x90)]===_0x4fc67a(0x10a))throw new SDKError(ErrorCode[_0x4fc67a(0xd7)],_0x4fc67a(0xa2));if(_0x384b48[_0x4fc67a(0x90)]==='parent')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x384b48[_0x4fc67a(0x109)])throw new SDKError(ErrorCode[_0x4fc67a(0xfd)],_0x4fc67a(0xf0));const _0x357fbc=await withSpinner(_0x4fc67a(0x10f),()=>_0x2b9dbc[_0x4fc67a(0xd9)][_0x4fc67a(0xca)](_0x384b48[_0x4fc67a(0xcb)],_0x384b48[_0x4fc67a(0x109)]),{'verbose':_0x5d50a4['verbose']});return _0x357fbc[_0x4fc67a(0xea)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]='segment:folder:create';[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0xb3);async[a35_0x3e5dea(0xe1)](_0x2c4066){const _0x10c7d5=a35_0x3e5dea,{options:_0x3a3419,args:_0x2a9c6a,tdx:_0x33b8e3}=_0x2c4066,_0x5ba638=_0x3a3419;if(_0x2a9c6a[_0x10c7d5(0xaf)]<0x2)return console['error'](_0x10c7d5(0xac)),console['error'](_0x10c7d5(0x110)),0x1;const _0x23fcb4=_0x2a9c6a[0x0],_0x426b17=_0x2a9c6a[0x1];_0x5ba638[_0x10c7d5(0xe0)]&&(console[_0x10c7d5(0x122)]('Site:\x20'+_0x5ba638[_0x10c7d5(0xa1)]),console[_0x10c7d5(0x122)](_0x10c7d5(0x92)+_0x23fcb4),console[_0x10c7d5(0x122)](_0x10c7d5(0xe2)+_0x426b17));let _0x354fd8;if(_0x5ba638[_0x10c7d5(0xf4)]){const _0x841676=_0x5ba638[_0x10c7d5(0xf4)],_0x46b68d=await withSpinner(_0x10c7d5(0x127)+_0x23fcb4+_0x10c7d5(0xe9),()=>_0x33b8e3[_0x10c7d5(0xd9)][_0x10c7d5(0xfb)](_0x23fcb4),{'verbose':_0x5ba638[_0x10c7d5(0xe0)]}),_0x54a4de=_0x46b68d[_0x10c7d5(0xea)],_0x435991=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x841676+_0x10c7d5(0xe9),()=>_0x33b8e3[_0x10c7d5(0xd9)][_0x10c7d5(0x8d)](_0x54a4de,_0x841676),{'verbose':_0x5ba638[_0x10c7d5(0xe0)]});_0x354fd8=_0x435991[_0x10c7d5(0xea)],_0x5ba638[_0x10c7d5(0xe0)]&&console[_0x10c7d5(0x122)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x354fd8);}const _0x20f1b3={'name':_0x426b17,'description':_0x5ba638[_0x10c7d5(0x129)],'parentFolderId':_0x354fd8},_0x5c2d32=await withSpinner('Creating\x20folder\x20\x27'+_0x426b17+_0x10c7d5(0xe9),()=>_0x33b8e3[_0x10c7d5(0xd9)][_0x10c7d5(0x117)](_0x23fcb4,_0x20f1b3),{'verbose':_0x5ba638[_0x10c7d5(0xe0)]}),_0x26bbb8=_0x5c2d32[_0x10c7d5(0xea)];return console[_0x10c7d5(0x122)](_0x10c7d5(0xa8)+_0x26bbb8[_0x10c7d5(0xa6)]+_0x10c7d5(0xa7)+_0x26bbb8['id']),await handleSDKOutput([_0x26bbb8],_0x5ba638),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x3e5dea(0xa6)]=a35_0x3e5dea(0xcc);[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0xbd);async[a35_0x3e5dea(0xe1)](_0x4ec440){const _0x2cb060=a35_0x3e5dea,{options:_0x47d200,args:_0xc22053,tdx:_0x6601ce}=_0x4ec440,_0x3e2561=_0xc22053[0x0];if(!_0x3e2561)return console[_0x2cb060(0x122)](_0x2cb060(0x98)),console[_0x2cb060(0x122)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x2cb060(0x122)](_0x2cb060(0xc4)),console['error'](_0x2cb060(0xc5)),console[_0x2cb060(0x122)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x2cb060(0x122)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x2cb060(0x12b)),console['error'](_0x2cb060(0xb9)),0x1;try{const _0x2c6536=_0x47d200[_0x2cb060(0xd4)],_0x263a71=await resolveSegmentTarget(_0x3e2561,_0x2c6536,_0x47d200[_0x2cb060(0xe0)]);_0x47d200[_0x2cb060(0xe0)]&&console[_0x2cb060(0x122)](_0x2cb060(0x123)+_0x263a71);const _0x333d7b=await withSpinner(_0x2cb060(0xc8)+_0x3e2561+'\x27...',()=>_0x6601ce[_0x2cb060(0xd9)][_0x2cb060(0x9f)](_0x263a71),{'verbose':_0x47d200[_0x2cb060(0xe0)]}),_0x34e1c0=_0x333d7b[_0x2cb060(0xea)];_0x47d200['verbose']&&(console[_0x2cb060(0x122)](_0x2cb060(0x9d)+_0x34e1c0[_0x2cb060(0x90)]),console[_0x2cb060(0x122)]('Parent\x20ID:\x20'+_0x34e1c0[_0x2cb060(0xcb)]),_0x34e1c0[_0x2cb060(0xf1)]&&console['error']('Folder\x20ID:\x20'+_0x34e1c0[_0x2cb060(0xf1)]),_0x34e1c0[_0x2cb060(0x109)]&&console[_0x2cb060(0x122)](_0x2cb060(0x91)+_0x34e1c0[_0x2cb060(0x109)]));if(_0x47d200[_0x2cb060(0xf2)]){if(_0x34e1c0[_0x2cb060(0x90)]==='folder')return console['error']('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x34e1c0[_0x2cb060(0x90)]==='parent')return console[_0x2cb060(0x122)](_0x2cb060(0xc2)),console[_0x2cb060(0x122)](_0x2cb060(0xc6)),0x1;if(!_0x34e1c0[_0x2cb060(0x109)])throw new SDKError(ErrorCode[_0x2cb060(0xfd)],_0x2cb060(0xf0));const _0x31410f=getConsoleNextUrl(_0x47d200[_0x2cb060(0xa1)],_0x2cb060(0x11c)+_0x34e1c0[_0x2cb060(0xcb)]+'/e/'+_0x34e1c0[_0x2cb060(0x109)]);return console[_0x2cb060(0x122)](a35_0x135643[_0x2cb060(0x120)]('✔')+_0x2cb060(0xa4)+a35_0x135643[_0x2cb060(0xcf)](_0x31410f)),openBrowser(_0x31410f),0x0;}if(_0x34e1c0[_0x2cb060(0x90)]===_0x2cb060(0x10a)){if(!_0x34e1c0['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x2cb060(0xb2));const _0x3bbc57=await withSpinner(_0x2cb060(0xa5),()=>_0x6601ce[_0x2cb060(0xd9)]['getFolder'](_0x34e1c0[_0x2cb060(0xf1)]),{'verbose':_0x47d200[_0x2cb060(0xe0)]});await handleSingleObjectOutput(_0x3bbc57['data'],_0x47d200);}else{if(_0x34e1c0[_0x2cb060(0x90)]===_0x2cb060(0xd9)){if(!_0x34e1c0[_0x2cb060(0x109)])throw new SDKError(ErrorCode[_0x2cb060(0xfd)],_0x2cb060(0xf0));const _0x318892=await withSpinner(_0x2cb060(0xa3),()=>_0x6601ce[_0x2cb060(0xd9)][_0x2cb060(0xb6)](_0x34e1c0[_0x2cb060(0xcb)],_0x34e1c0['segmentId']),{'verbose':_0x47d200['verbose']}),_0x5d6679=getConsoleNextUrl(_0x47d200[_0x2cb060(0xa1)],'/app/ps/'+_0x34e1c0['parentId']+_0x2cb060(0x12d)+_0x34e1c0['segmentId']),_0x30c028=_0x318892[_0x2cb060(0xea)];_0x30c028[_0x2cb060(0x11b)]=_0x5d6679,await handleSingleObjectOutput(_0x30c028,_0x47d200);}else return console[_0x2cb060(0x122)](_0x2cb060(0x97)),console[_0x2cb060(0x122)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0xcaf88e){if(_0xcaf88e instanceof SDKError)return console[_0x2cb060(0x122)]('Error:\x20'+_0xcaf88e[_0x2cb060(0x8e)]),_0xcaf88e[_0x2cb060(0x107)]&&console[_0x2cb060(0x122)](_0x2cb060(0xce)+_0xcaf88e['cause']),0x1;throw _0xcaf88e;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a35_0x3e5dea(0xb4);[a35_0x3e5dea(0x129)]=a35_0x3e5dea(0xda);async[a35_0x3e5dea(0xe1)](_0x1df76f){const _0x282e91=a35_0x3e5dea,{options:_0x2a16e2,args:_0x2a446f,tdx:_0x1cfcae}=_0x1df76f,_0x7ec67c=_0x2a446f[0x0];if(!_0x7ec67c)return console[_0x282e91(0x122)](_0x282e91(0xe8)),console[_0x282e91(0x122)](_0x282e91(0x12c)),console[_0x282e91(0x122)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x282e91(0x122)]('Examples:'),console[_0x282e91(0x122)](_0x282e91(0xe6)),console[_0x282e91(0x122)](_0x282e91(0xd1)),0x1;try{const _0x592504=_0x2a16e2['parentSegment'],_0x182385=await resolveSegmentTarget(_0x7ec67c,_0x592504,_0x2a16e2[_0x282e91(0xe0)]);_0x2a16e2[_0x282e91(0xe0)]&&console[_0x282e91(0x122)]('Target\x20path:\x20'+_0x182385);const _0x1a0477=await withSpinner(_0x282e91(0xc8)+_0x7ec67c+_0x282e91(0xe9),()=>_0x1cfcae[_0x282e91(0xd9)]['resolvePathToResource'](_0x182385),{'verbose':_0x2a16e2[_0x282e91(0xe0)]}),_0x359701=_0x1a0477['data'];_0x2a16e2['verbose']&&(console[_0x282e91(0x122)](_0x282e91(0x9d)+_0x359701[_0x282e91(0x90)]),console['error'](_0x282e91(0xff)+_0x359701['parentId']));if(_0x359701[_0x282e91(0x90)]==='folder')return console[_0x282e91(0x122)](_0x282e91(0xaa)),console[_0x282e91(0x122)](_0x282e91(0xeb)),0x1;if(_0x359701[_0x282e91(0x90)]===_0x282e91(0x12e))return console[_0x282e91(0x122)](_0x282e91(0x9a)),console['error'](_0x282e91(0xae)),0x1;if(!_0x359701[_0x282e91(0x109)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x282e91(0xf0));const _0x2aa01b=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x1cfcae['segment']['getSegmentSQL'](_0x359701['parentId'],_0x359701[_0x282e91(0x109)]),{'verbose':_0x2a16e2[_0x282e91(0xe0)]}),_0x4f78f8=_0x2aa01b[_0x282e91(0xea)],_0x4e9f5c=await executeSchemaQuery(_0x4f78f8,_0x1cfcae,_0x2a16e2);return await handleQueryOutput(_0x4e9f5c,_0x2a16e2),0x0;}catch(_0x58c423){if(_0x58c423 instanceof SDKError)return console[_0x282e91(0x122)](_0x282e91(0xd0)+_0x58c423[_0x282e91(0x8e)]),_0x58c423[_0x282e91(0x107)]&&console['error'](_0x282e91(0xce)+_0x58c423[_0x282e91(0x107)]),0x1;throw _0x58c423;}}}
1
+ const a35_0x887130=a35_0x458b;(function(_0x330c2a,_0x537c68){const _0x410b6d=a35_0x458b,_0x3f59b7=_0x330c2a();while(!![]){try{const _0x22e47f=-parseInt(_0x410b6d(0xf2))/0x1*(parseInt(_0x410b6d(0x132))/0x2)+parseInt(_0x410b6d(0x14f))/0x3+parseInt(_0x410b6d(0x137))/0x4+parseInt(_0x410b6d(0xc3))/0x5*(parseInt(_0x410b6d(0x119))/0x6)+parseInt(_0x410b6d(0x121))/0x7+-parseInt(_0x410b6d(0xe1))/0x8+-parseInt(_0x410b6d(0x13d))/0x9*(parseInt(_0x410b6d(0x111))/0xa);if(_0x22e47f===_0x537c68)break;else _0x3f59b7['push'](_0x3f59b7['shift']());}catch(_0x16f403){_0x3f59b7['push'](_0x3f59b7['shift']());}}}(a35_0x2de9,0xe084f));import{BaseCommand}from'./command.js';function a35_0x458b(_0xc1207e,_0x55a8b8){_0xc1207e=_0xc1207e-0xbe;const _0x2de938=a35_0x2de9();let _0x458b7c=_0x2de938[_0xc1207e];return _0x458b7c;}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x557d03 from'chalk';async function resolveSegmentTarget(_0x251f74,_0x50991c,_0x4eefde){const _0x4b1297=a35_0x458b;if(isYamlFilePath(_0x251f74))try{const _0x399390=await resolveYamlFilePath(_0x251f74);return _0x4eefde&&(console[_0x4b1297(0x144)]('Resolved\x20YAML\x20file:\x20'+_0x251f74),console[_0x4b1297(0x144)](_0x4b1297(0x145)+_0x399390['parentSegment']),console[_0x4b1297(0x144)](_0x4b1297(0x13b)+_0x399390[_0x4b1297(0xf3)]),console[_0x4b1297(0x144)](_0x4b1297(0x14a)+(_0x399390[_0x4b1297(0x14c)]||'(root)')),console['error'](_0x4b1297(0x15a)+_0x399390[_0x4b1297(0xeb)])),_0x399390[_0x4b1297(0xeb)];}catch(_0x14a49e){throw new SDKError(ErrorCode[_0x4b1297(0xcc)],_0x4b1297(0x10e)+_0x14a49e[_0x4b1297(0x15c)]);}if(!_0x50991c)throw new SDKError(ErrorCode[_0x4b1297(0xcc)],_0x4b1297(0x13f));return _0x50991c+'/'+_0x251f74;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0xd2);[a35_0x887130(0x16b)]=a35_0x887130(0xe4);async[a35_0x887130(0x154)](_0x2cafa5){const _0x4c7ede=a35_0x887130,{options:_0x37736d,args:_0x126e50,tdx:_0x2964e9}=_0x2cafa5,_0x4bd9f4=_0x126e50[0x0],_0x229fd0=!_0x4bd9f4&&!!_0x37736d[_0x4c7ede(0xce)],_0x5c4163=_0x4bd9f4||_0x37736d[_0x4c7ede(0xce)];if(!_0x5c4163)return console[_0x4c7ede(0x144)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x4c7ede(0xd7)),console[_0x4c7ede(0x144)]('Examples:'),console[_0x4c7ede(0x144)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x4c7ede(0x144)](_0x4c7ede(0x10a)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x4c7ede(0x144)](_0x4c7ede(0x14e)),0x1;try{const _0x343f17=_0x37736d['segmentPath'];let _0x43a6bb=_0x5c4163;!_0x229fd0&&_0x343f17&&!_0x5c4163[_0x4c7ede(0xfa)]('/')&&(_0x43a6bb=_0x343f17+'/'+_0x5c4163,_0x37736d['verbose']&&console[_0x4c7ede(0x144)](_0x4c7ede(0x113)+_0x43a6bb));const _0x26b9f5=await withSpinner(_0x4c7ede(0x142)+_0x43a6bb+_0x4c7ede(0xc4),()=>_0x2964e9['segment'][_0x4c7ede(0x16a)](_0x43a6bb),{'verbose':_0x37736d[_0x4c7ede(0x148)]}),_0x492cd3=_0x26b9f5['data'];_0x37736d[_0x4c7ede(0x148)]&&(console['error'](_0x4c7ede(0x155)+_0x492cd3['type']),console[_0x4c7ede(0x144)](_0x4c7ede(0x11a)+_0x492cd3[_0x4c7ede(0x110)]),_0x492cd3[_0x4c7ede(0x117)]&&console[_0x4c7ede(0x144)]('Folder\x20ID:\x20'+_0x492cd3[_0x4c7ede(0x117)]),_0x492cd3[_0x4c7ede(0x13c)]&&console[_0x4c7ede(0x144)]('Segment\x20ID:\x20'+_0x492cd3[_0x4c7ede(0x13c)]));if(_0x492cd3[_0x4c7ede(0xc2)]===_0x4c7ede(0x10c)){const _0x339304=await withSpinner(_0x4c7ede(0x106),()=>_0x2964e9[_0x4c7ede(0xd0)][_0x4c7ede(0x129)](_0x492cd3[_0x4c7ede(0x110)]),{'verbose':_0x37736d[_0x4c7ede(0x148)]});await handleSingleObjectOutput(_0x339304[_0x4c7ede(0x11f)],_0x37736d);}else{if(_0x492cd3['type']===_0x4c7ede(0xd8)){if(!_0x492cd3['folderId'])throw new SDKError(ErrorCode[_0x4c7ede(0x114)],_0x4c7ede(0x138));const _0x55891a=await withSpinner(_0x4c7ede(0xed),()=>_0x2964e9[_0x4c7ede(0xd0)]['getFolder'](_0x492cd3[_0x4c7ede(0x117)]),{'verbose':_0x37736d['verbose']});await handleSingleObjectOutput(_0x55891a[_0x4c7ede(0x11f)],_0x37736d);}else{if(_0x492cd3[_0x4c7ede(0xc2)]===_0x4c7ede(0xd0)){if(!_0x492cd3[_0x4c7ede(0x13c)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x26ca95=await withSpinner(_0x4c7ede(0x15b),()=>_0x2964e9[_0x4c7ede(0xd0)][_0x4c7ede(0x11c)](_0x492cd3[_0x4c7ede(0x110)],_0x492cd3[_0x4c7ede(0x13c)]),{'verbose':_0x37736d[_0x4c7ede(0x148)]});await handleSingleObjectOutput(_0x26ca95[_0x4c7ede(0x11f)],_0x37736d);}}}return 0x0;}catch(_0x79731f){if(_0x79731f instanceof SDKError)return console[_0x4c7ede(0x144)]('Error:\x20'+_0x79731f['message']),_0x79731f[_0x4c7ede(0x15e)]&&console[_0x4c7ede(0x144)](_0x4c7ede(0xca)+_0x79731f[_0x4c7ede(0x15e)]),0x1;throw _0x79731f;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0xfe);[a35_0x887130(0x16b)]=a35_0x887130(0x136);async[a35_0x887130(0x154)](_0x356182){const _0x17a445=a35_0x887130,{options:_0x2a9f85,args:_0x46af24,tdx:_0x3d9c1d}=_0x356182,_0x11ca95=_0x46af24[0x0];if(!_0x11ca95)return console[_0x17a445(0x144)](_0x17a445(0xf8)),console['error'](_0x17a445(0xe7)),console[_0x17a445(0x144)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console['error']('Examples:'),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error']('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xb071e6=_0x2a9f85[_0x17a445(0xce)],_0xa0b657=await resolveSegmentTarget(_0x11ca95,_0xb071e6,_0x2a9f85[_0x17a445(0x148)]);_0x2a9f85[_0x17a445(0x148)]&&console[_0x17a445(0x144)]('Target\x20path:\x20'+_0xa0b657);const _0x4ee75b=await withSpinner(_0x17a445(0xdd)+_0x11ca95+_0x17a445(0xc4),()=>_0x3d9c1d[_0x17a445(0xd0)][_0x17a445(0x16a)](_0xa0b657),{'verbose':_0x2a9f85['verbose']}),_0x332921=_0x4ee75b['data'];_0x2a9f85['verbose']&&(console[_0x17a445(0x144)](_0x17a445(0x155)+_0x332921['type']),console[_0x17a445(0x144)](_0x17a445(0x11a)+_0x332921[_0x17a445(0x110)]));if(_0x332921[_0x17a445(0xc2)]===_0x17a445(0xd8))return console['error'](_0x17a445(0x115)),console[_0x17a445(0x144)](_0x17a445(0xc1)),0x1;if(_0x332921[_0x17a445(0xc2)]==='parent')return console['error'](_0x17a445(0xd1)),console[_0x17a445(0x144)](_0x17a445(0xef)),0x1;if(!_0x332921['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x17a445(0xde));const _0x274174=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3d9c1d[_0x17a445(0xd0)][_0x17a445(0xe0)](_0x332921['parentId'],_0x332921[_0x17a445(0x13c)]),{'verbose':_0x2a9f85[_0x17a445(0x148)]});let _0x56580a=_0x274174[_0x17a445(0x11f)];const _0x215c2a=resolveLimit(_0x2a9f85[_0x17a445(0x12a)],DEFAULT_DISPLAY_LIMIT),_0x473f7d=/\bLIMIT\s+\d+/i[_0x17a445(0xc8)](_0x56580a);!_0x473f7d&&(_0x56580a=_0x56580a[_0x17a445(0xe8)]()[_0x17a445(0x13a)](/;+$/,''),_0x56580a=_0x17a445(0xbe)+_0x56580a+_0x17a445(0x10b)+_0x215c2a);_0x2a9f85[_0x17a445(0x148)]&&console[_0x17a445(0x144)]('SQL\x20query:\x0a'+_0x56580a);const _0x416a1c=await withProgressSpinner(_0x17a445(0x10d),async _0x5e956c=>{const _0x5b4f3f=_0x17a445,_0x491744=await _0x3d9c1d[_0x5b4f3f(0x153)]['execute'](_0x56580a,{'catalog':'td','schema':_0x5b4f3f(0x15d),'onJobId':_0x2c3f47=>{_0x5e956c['setJobId'](_0x2c3f47);}});return _0x491744;},{'verbose':_0x2a9f85['verbose']}),_0x4b470b=_0x416a1c['data'],_0x5c739e=_0x4b470b[_0x17a445(0x12d)]?'\x20[Job\x20ID:\x20'+_0x4b470b[_0x17a445(0x12d)]+']':'';return console[_0x17a445(0x144)](_0x17a445(0xe9)+_0x4b470b[_0x17a445(0x120)][_0x17a445(0x104)][_0x17a445(0xd3)]()+_0x17a445(0x165)+(_0x17a445(0xcb)+formatElapsed(_0x4b470b[_0x17a445(0x120)][_0x17a445(0x135)])+_0x5c739e)),await handleQueryOutput(_0x4b470b,_0x2a9f85),0x0;}catch(_0x16dc63){if(_0x16dc63 instanceof SDKError)return console[_0x17a445(0x144)](_0x17a445(0x11e)+_0x16dc63[_0x17a445(0x134)]+']'),console[_0x17a445(0x144)]('\x0a'+_0x16dc63[_0x17a445(0x15c)]),0x1;throw _0x16dc63;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x887130(0x151)]='segment:folder:list';[a35_0x887130(0x16b)]=a35_0x887130(0xc7);async[a35_0x887130(0x154)](_0xa103ba){const _0x136d10=a35_0x887130,{options:_0x58e14d,args:_0x427d1e,tdx:_0x59d05c}=_0xa103ba;if(_0x427d1e['length']===0x0)return console[_0x136d10(0x144)](_0x136d10(0x118)),console[_0x136d10(0x144)](_0x136d10(0xff)),0x1;const _0x4241b5=_0x427d1e[0x0];try{_0x58e14d['verbose']&&(console[_0x136d10(0x144)](_0x136d10(0xfd)+_0x58e14d[_0x136d10(0xfc)]),console[_0x136d10(0x144)](_0x136d10(0xda)+_0x4241b5));const _0x1b2dbc=await withSpinner(_0x136d10(0x13e)+_0x4241b5+_0x136d10(0xc4),()=>_0x59d05c[_0x136d10(0xd0)][_0x136d10(0xf9)](_0x4241b5),{'verbose':_0x58e14d[_0x136d10(0x148)]}),_0x2da79c=_0x1b2dbc['data'];_0x58e14d[_0x136d10(0x148)]&&console[_0x136d10(0x144)](_0x136d10(0x139)+_0x2da79c);const _0x584f97=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x4241b5+_0x136d10(0xc4),()=>_0x59d05c[_0x136d10(0xd0)][_0x136d10(0x123)](_0x2da79c),{'verbose':_0x58e14d['verbose']}),_0x33912f=_0x584f97[_0x136d10(0x11f)];return console[_0x136d10(0x144)](_0x136d10(0x141)+_0x33912f[_0x136d10(0xf4)]+_0x136d10(0xf6)+(_0x33912f[_0x136d10(0xf4)]!==0x1?'s':'')),await handleSDKOutput(_0x33912f,_0x58e14d),0x0;}catch(_0x452af2){if(_0x452af2 instanceof SDKError)return console[_0x136d10(0x144)](_0x136d10(0x161)+_0x452af2[_0x136d10(0x15c)]),_0x452af2['cause']&&console[_0x136d10(0x144)](_0x136d10(0xca)+_0x452af2[_0x136d10(0x15e)]),0x1;throw _0x452af2;}}}function a35_0x2de9(){const _0x128fd8=['getParent','limit','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','red','jobId','Folder\x20ID:\x20','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Target\x20path:\x20','Fetching\x20SQL\x20for\x20segment...','1168606VffmLw','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','code','elapsedTimeMillis','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','621324YCOSAx','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Resolved\x20parent\x20ID:\x20','replace','\x20\x20Segment\x20name:\x20','segmentId','9HlMgZe','Resolving\x20parent\x20segment\x20\x27','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Options:','✔\x20Found\x20','Resolving\x20path\x20\x27','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','error','\x20\x20Parent\x20segment:\x20','Use:\x20tdx\x20ps\x20view','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','verbose','segment:folder:create','\x20\x20Folder\x20path:\x20','Fetching\x20folder\x20\x27','folderPath','getSegmentSQLFromYaml','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','3476379HLTygx','Usage:\x20tdx\x20sg\x20desc\x20<name>','name','Resolved\x20folder\x20ID:\x20','query','execute','Resolved\x20type:\x20','getSQLFromYamlFile','Create\x20segment\x20folder\x20for\x20organization','Fetching\x20SQL\x20from\x20rule...','Usage:','\x20\x20Full\x20path:\x20','Fetching\x20segment\x20details...','message','information_schema','cause','Show\x20folder\x20or\x20child\x20segment\x20details','log','Error:\x20','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','parentFolder','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20rows\x20','format','\x27\x20with\x20ID:\x20','content','Show\x20segment\x20folder\x20details','resolvePathToResource','description','SELECT\x20*\x20FROM\x20(\x0a','Creating\x20folder\x20\x27','SEGMENT_NOT_FOUND','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','type','474335jgRinV','\x27...','Error:\x20Folder\x20reference\x20is\x20required','/e/','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','test','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20Cause:\x20','in\x20','INVALID_ARGUMENT','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','parentSegment','/app/ps/','segment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:describe','toLocaleString','path','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','green','Usage:\x20tdx\x20segment\x20describe\x20<path>','folder','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Parent\x20name:\x20','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20tdx\x20sg\x20sql\x20--path\x20','Resolving\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','getSegmentSQL','10434696ROvvog','url','Use:\x20tdx\x20ps\x20desc','Show\x20segment\x20or\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Usage:\x20tdx\x20sg\x20show\x20<name>','trim','✔\x20Query\x20completed:\x20Processed\x20','segment:folder:show','fullPath','getSQLFromServerSegment','Fetching\x20folder\x20details...','Resolving\x20parent\x20folder\x20\x27','Use:\x20tdx\x20ps\x20show','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','getFolder','2oyBufu','segmentName','length','Resolved\x20parent\x20folder\x20ID:\x20','\x20folder','\x20Opening\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','resolveParentId','includes','cyan','site','Site:\x20','segment:show','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','✔\x20Created\x20folder\x20\x27','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Get\x20SQL\x20query\x20for\x20child\x20segment','processedRows','Resolved:\x20','Fetching\x20parent\x20segment\x20details...','createFolder','resolveFolderId','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','parent','Executing\x20segment\x20query...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Folder\x20name:\x20','parentId','7261050BbQqxF','segment:view','Resolved\x20relative\x20path\x20to:\x20','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','folderId','Error:\x20Parent\x20segment\x20name\x20is\x20required','108FhVDGy','Parent\x20ID:\x20','Parent\x20segment:\x20','getSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','✖\x20Query\x20failed\x20[','data','stats','7678643qmKosr','Resolving\x20folder\x20\x27','listFolders','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'];a35_0x2de9=function(){return _0x128fd8;};return a35_0x2de9();}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x887130(0xea);[a35_0x887130(0x16b)]=a35_0x887130(0x169);async[a35_0x887130(0x154)](_0x260827){const _0x5ca94f=a35_0x887130,{options:_0x3d2a0f,args:_0x5d19a4,tdx:_0x1f0381}=_0x260827;if(_0x5d19a4[_0x5ca94f(0xf4)]===0x0)return console[_0x5ca94f(0x144)](_0x5ca94f(0xc5)),console[_0x5ca94f(0x144)](_0x5ca94f(0xc9)),0x1;try{const {parentId:_0x222955,childId:_0x2971b5}=parseSegmentRef(_0x5d19a4[0x0]);_0x3d2a0f[_0x5ca94f(0x148)]&&(console['error']('Site:\x20'+_0x3d2a0f[_0x5ca94f(0xfc)]),console['error'](_0x5ca94f(0xda)+_0x222955),_0x2971b5&&console[_0x5ca94f(0x144)]('Folder\x20name:\x20'+_0x2971b5));if(!_0x2971b5)return console[_0x5ca94f(0x144)](_0x5ca94f(0x143)),0x1;const _0x41e748=await withSpinner(_0x5ca94f(0x13e)+_0x222955+_0x5ca94f(0xc4),()=>_0x1f0381['segment'][_0x5ca94f(0xf9)](_0x222955),{'verbose':_0x3d2a0f['verbose']}),_0x24ad7e=_0x41e748['data'];_0x3d2a0f[_0x5ca94f(0x148)]&&console[_0x5ca94f(0x144)](_0x5ca94f(0x139)+_0x24ad7e);const _0x485efa=await withSpinner(_0x5ca94f(0x122)+_0x2971b5+_0x5ca94f(0xc4),()=>_0x1f0381[_0x5ca94f(0xd0)]['resolveFolderId'](_0x24ad7e,_0x2971b5),{'verbose':_0x3d2a0f[_0x5ca94f(0x148)]}),_0x572b68=_0x485efa[_0x5ca94f(0x11f)];_0x3d2a0f[_0x5ca94f(0x148)]&&console[_0x5ca94f(0x144)](_0x5ca94f(0x152)+_0x572b68);const _0x2afa3e=await withSpinner(_0x5ca94f(0x14b)+_0x2971b5+'\x27...',()=>_0x1f0381['segment']['getFolder'](_0x572b68),{'verbose':_0x3d2a0f[_0x5ca94f(0x148)]});return await handleSDKOutput([_0x2afa3e[_0x5ca94f(0x11f)]],_0x3d2a0f),0x0;}catch(_0x29e2d3){if(_0x29e2d3 instanceof SDKError)return console[_0x5ca94f(0x144)]('Error:\x20'+_0x29e2d3[_0x5ca94f(0x15c)]),_0x29e2d3['cause']&&console['error'](_0x5ca94f(0xca)+_0x29e2d3[_0x5ca94f(0x15e)]),0x1;throw _0x29e2d3;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';['description']=a35_0x887130(0x103);async['execute'](_0x2afeda){const _0x2b10f1=a35_0x887130,{options:_0x379af6,args:_0x1e7fb2}=_0x2afeda,_0x569248=_0x379af6,_0x58fb03=_0x569248[_0x2b10f1(0xd4)],_0x3c5782=_0x1e7fb2[0x0];if(!_0x3c5782&&!_0x58fb03)return console[_0x2b10f1(0x144)](a35_0x557d03[_0x2b10f1(0x12c)](_0x2b10f1(0x12f))),console[_0x2b10f1(0x144)](_0x2b10f1(0x159)),console[_0x2b10f1(0x144)](_0x2b10f1(0xd9)),console['error'](_0x2b10f1(0x116)),console[_0x2b10f1(0x144)](_0x2b10f1(0x109)),console[_0x2b10f1(0x144)](_0x2b10f1(0xd5)),console[_0x2b10f1(0x144)](_0x2b10f1(0x102)),0x1;if(_0x3c5782&&_0x58fb03)return console[_0x2b10f1(0x144)](a35_0x557d03[_0x2b10f1(0x12c)](_0x2b10f1(0x126))),0x1;try{let _0x1b8be8;if(_0x58fb03)_0x1b8be8=await this[_0x2b10f1(0x156)](_0x58fb03,_0x2afeda);else{if(isYamlFilePath(_0x3c5782))return console[_0x2b10f1(0x144)](a35_0x557d03[_0x2b10f1(0x12c)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console['error'](_0x2b10f1(0xdc)+_0x3c5782),0x1;else _0x1b8be8=await this['getSQLFromServerSegment'](_0x3c5782,_0x2afeda);}return _0x379af6[_0x2b10f1(0x166)]==='json'||_0x379af6[_0x2b10f1(0x166)]==='jsonl'?await handleSDKOutput([{'sql':_0x1b8be8}],_0x379af6):console[_0x2b10f1(0x160)](_0x1b8be8),0x0;}catch(_0x7f8126){if(_0x7f8126 instanceof SDKError)return console['error'](_0x2b10f1(0x161)+_0x7f8126['message']),_0x7f8126[_0x2b10f1(0x15e)]&&console[_0x2b10f1(0x144)](_0x2b10f1(0xca)+_0x7f8126['cause']),0x1;throw _0x7f8126;}}async[a35_0x887130(0x156)](_0x4f7992,_0x1a80f5){const _0x446013=a35_0x887130,{options:_0x52c51e,tdx:_0x24994c}=_0x1a80f5;let _0x55cfab;try{_0x55cfab=await resolveYamlFilePath(_0x4f7992);}catch(_0x1b34b9){throw new SDKError(ErrorCode[_0x446013(0xcc)],_0x446013(0x10e)+_0x1b34b9['message']);}_0x52c51e[_0x446013(0x148)]&&console[_0x446013(0x144)](_0x446013(0x105)+_0x55cfab[_0x446013(0xce)]+'/'+_0x55cfab['segmentName']);const _0x14aa1a=await withSpinner(_0x446013(0x158),()=>_0x24994c[_0x446013(0xd0)][_0x446013(0x14d)](_0x55cfab[_0x446013(0x168)],_0x55cfab[_0x446013(0xce)],_0x55cfab['segmentName']),{'verbose':_0x52c51e[_0x446013(0x148)]});return _0x14aa1a[_0x446013(0x11f)];}async[a35_0x887130(0xec)](_0x449779,_0x527126){const _0x528577=a35_0x887130,{options:_0x2d647f,tdx:_0x4d5b5a}=_0x527126,_0x401149=_0x2d647f[_0x528577(0xce)],_0x5215f2=await resolveSegmentTarget(_0x449779,_0x401149,_0x2d647f[_0x528577(0x148)]);_0x2d647f[_0x528577(0x148)]&&console[_0x528577(0x144)](_0x528577(0x130)+_0x5215f2);const _0xf59f3f=await withSpinner(_0x528577(0xdd)+_0x449779+_0x528577(0xc4),()=>_0x4d5b5a['segment'][_0x528577(0x16a)](_0x5215f2),{'verbose':_0x2d647f[_0x528577(0x148)]}),_0x3d7b56=_0xf59f3f['data'];_0x2d647f['verbose']&&(console[_0x528577(0x144)]('Resolved\x20type:\x20'+_0x3d7b56[_0x528577(0xc2)]),console[_0x528577(0x144)](_0x528577(0x11a)+_0x3d7b56[_0x528577(0x110)]));if(_0x3d7b56[_0x528577(0xc2)]===_0x528577(0xd8))throw new SDKError(ErrorCode[_0x528577(0xcc)],_0x528577(0x162));if(_0x3d7b56[_0x528577(0xc2)]==='parent')throw new SDKError(ErrorCode[_0x528577(0xcc)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x3d7b56['segmentId'])throw new SDKError(ErrorCode[_0x528577(0xc0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x45f765=await withSpinner(_0x528577(0x131),()=>_0x4d5b5a[_0x528577(0xd0)]['getSegmentSQL'](_0x3d7b56[_0x528577(0x110)],_0x3d7b56[_0x528577(0x13c)]),{'verbose':_0x2d647f['verbose']});return _0x45f765[_0x528577(0x11f)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0x149);[a35_0x887130(0x16b)]=a35_0x887130(0x157);async[a35_0x887130(0x154)](_0x3b6983){const _0x5a9693=a35_0x887130,{options:_0x4c81e0,args:_0x53bcf0,tdx:_0x252a94}=_0x3b6983,_0x17afd6=_0x4c81e0;if(_0x53bcf0[_0x5a9693(0xf4)]<0x2)return console[_0x5a9693(0x144)](_0x5a9693(0x12b)),console[_0x5a9693(0x144)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x35c234=_0x53bcf0[0x0],_0x2c741f=_0x53bcf0[0x1];_0x17afd6[_0x5a9693(0x148)]&&(console['error'](_0x5a9693(0xfd)+_0x17afd6['site']),console[_0x5a9693(0x144)](_0x5a9693(0x11b)+_0x35c234),console[_0x5a9693(0x144)](_0x5a9693(0x10f)+_0x2c741f));let _0x4aac6e;if(_0x17afd6[_0x5a9693(0x163)]){const _0x444d86=_0x17afd6['parentFolder'],_0x5711c1=await withSpinner(_0x5a9693(0x13e)+_0x35c234+_0x5a9693(0xc4),()=>_0x252a94['segment'][_0x5a9693(0xf9)](_0x35c234),{'verbose':_0x17afd6[_0x5a9693(0x148)]}),_0x23f20c=_0x5711c1[_0x5a9693(0x11f)],_0x4c92d5=await withSpinner(_0x5a9693(0xee)+_0x444d86+'\x27...',()=>_0x252a94[_0x5a9693(0xd0)][_0x5a9693(0x108)](_0x23f20c,_0x444d86),{'verbose':_0x17afd6[_0x5a9693(0x148)]});_0x4aac6e=_0x4c92d5[_0x5a9693(0x11f)],_0x17afd6[_0x5a9693(0x148)]&&console['error'](_0x5a9693(0xf5)+_0x4aac6e);}const _0x1c9a7f={'name':_0x2c741f,'description':_0x17afd6[_0x5a9693(0x16b)],'parentFolderId':_0x4aac6e},_0xbf5655=await withSpinner(_0x5a9693(0xbf)+_0x2c741f+_0x5a9693(0xc4),()=>_0x252a94[_0x5a9693(0xd0)][_0x5a9693(0x107)](_0x35c234,_0x1c9a7f),{'verbose':_0x17afd6[_0x5a9693(0x148)]}),_0x3c14ec=_0xbf5655['data'];return console[_0x5a9693(0x144)](_0x5a9693(0x100)+_0x3c14ec[_0x5a9693(0x151)]+_0x5a9693(0x167)+_0x3c14ec['id']),await handleSDKOutput([_0x3c14ec],_0x17afd6),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x887130(0x151)]=a35_0x887130(0x112);[a35_0x887130(0x16b)]=a35_0x887130(0x15f);async[a35_0x887130(0x154)](_0x1aea56){const _0x4f5b65=a35_0x887130,{options:_0x518431,args:_0x2d6bd9,tdx:_0x50762d}=_0x1aea56,_0x5dd59f=_0x2d6bd9[0x0];if(!_0x5dd59f)return console[_0x4f5b65(0x144)](_0x4f5b65(0x147)),console[_0x4f5b65(0x144)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0x4f5b65(0x11d)),console[_0x4f5b65(0x144)](_0x4f5b65(0x140)),console[_0x4f5b65(0x144)](_0x4f5b65(0x124)),console[_0x4f5b65(0x144)](_0x4f5b65(0x109)),console[_0x4f5b65(0x144)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x4f5b65(0x144)](_0x4f5b65(0xe5)),console[_0x4f5b65(0x144)](_0x4f5b65(0x164)),console['error'](_0x4f5b65(0x127)),0x1;try{const _0x8c0161=_0x518431[_0x4f5b65(0xce)],_0x11f3c4=await resolveSegmentTarget(_0x5dd59f,_0x8c0161,_0x518431[_0x4f5b65(0x148)]);_0x518431['verbose']&&console['error'](_0x4f5b65(0x130)+_0x11f3c4);const _0x4e81fc=await withSpinner(_0x4f5b65(0xdd)+_0x5dd59f+_0x4f5b65(0xc4),()=>_0x50762d[_0x4f5b65(0xd0)][_0x4f5b65(0x16a)](_0x11f3c4),{'verbose':_0x518431[_0x4f5b65(0x148)]}),_0x246a85=_0x4e81fc['data'];_0x518431[_0x4f5b65(0x148)]&&(console[_0x4f5b65(0x144)](_0x4f5b65(0x155)+_0x246a85[_0x4f5b65(0xc2)]),console[_0x4f5b65(0x144)]('Parent\x20ID:\x20'+_0x246a85[_0x4f5b65(0x110)]),_0x246a85[_0x4f5b65(0x117)]&&console[_0x4f5b65(0x144)](_0x4f5b65(0x12e)+_0x246a85['folderId']),_0x246a85['segmentId']&&console[_0x4f5b65(0x144)]('Segment\x20ID:\x20'+_0x246a85['segmentId']));if(_0x518431['web']){if(_0x246a85[_0x4f5b65(0xc2)]===_0x4f5b65(0xd8))return console['error'](_0x4f5b65(0xcd)),0x1;if(_0x246a85[_0x4f5b65(0xc2)]===_0x4f5b65(0x10c))return console[_0x4f5b65(0x144)](_0x4f5b65(0x125)),console['error'](_0x4f5b65(0xdb)),0x1;if(!_0x246a85[_0x4f5b65(0x13c)])throw new SDKError(ErrorCode[_0x4f5b65(0xc0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1c93e9=getConsoleNextUrl(_0x518431['site'],'/app/ps/'+_0x246a85[_0x4f5b65(0x110)]+'/e/'+_0x246a85['segmentId']);return console[_0x4f5b65(0x144)](a35_0x557d03[_0x4f5b65(0xd6)]('✔')+_0x4f5b65(0xf7)+a35_0x557d03[_0x4f5b65(0xfb)](_0x1c93e9)),openBrowser(_0x1c93e9),0x0;}if(_0x246a85[_0x4f5b65(0xc2)]==='folder'){if(!_0x246a85[_0x4f5b65(0x117)])throw new SDKError(ErrorCode[_0x4f5b65(0x114)],_0x4f5b65(0x138));const _0x3a5d4d=await withSpinner(_0x4f5b65(0xed),()=>_0x50762d[_0x4f5b65(0xd0)][_0x4f5b65(0xf1)](_0x246a85['folderId']),{'verbose':_0x518431[_0x4f5b65(0x148)]});await handleSingleObjectOutput(_0x3a5d4d[_0x4f5b65(0x11f)],_0x518431);}else{if(_0x246a85[_0x4f5b65(0xc2)]===_0x4f5b65(0xd0)){if(!_0x246a85[_0x4f5b65(0x13c)])throw new SDKError(ErrorCode[_0x4f5b65(0xc0)],_0x4f5b65(0xde));const _0x54aabb=await withSpinner(_0x4f5b65(0x15b),()=>_0x50762d['segment'][_0x4f5b65(0x11c)](_0x246a85[_0x4f5b65(0x110)],_0x246a85['segmentId']),{'verbose':_0x518431[_0x4f5b65(0x148)]}),_0x2f72eb=getConsoleNextUrl(_0x518431[_0x4f5b65(0xfc)],_0x4f5b65(0xcf)+_0x246a85[_0x4f5b65(0x110)]+_0x4f5b65(0xc6)+_0x246a85[_0x4f5b65(0x13c)]),_0x118532=_0x54aabb[_0x4f5b65(0x11f)];_0x118532[_0x4f5b65(0xe2)]=_0x2f72eb,await handleSingleObjectOutput(_0x118532,_0x518431);}else return console['error'](_0x4f5b65(0x101)),console['error'](_0x4f5b65(0x146)),0x1;}return 0x0;}catch(_0x4700ac){if(_0x4700ac instanceof SDKError)return console[_0x4f5b65(0x144)](_0x4f5b65(0x161)+_0x4700ac[_0x4f5b65(0x15c)]),_0x4700ac[_0x4f5b65(0x15e)]&&console[_0x4f5b65(0x144)](_0x4f5b65(0xca)+_0x4700ac[_0x4f5b65(0x15e)]),0x1;throw _0x4700ac;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x887130(0x151)]='segment:desc';[a35_0x887130(0x16b)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a35_0x887130(0x154)](_0x1fd0f2){const _0x2cc43c=a35_0x887130,{options:_0x3d3fa6,args:_0x25fc11,tdx:_0x7b03c}=_0x1fd0f2,_0x476280=_0x25fc11[0x0];if(!_0x476280)return console[_0x2cc43c(0x144)](_0x2cc43c(0xf8)),console['error'](_0x2cc43c(0x150)),console[_0x2cc43c(0x144)](_0x2cc43c(0x128)),console[_0x2cc43c(0x144)](_0x2cc43c(0x109)),console['error'](_0x2cc43c(0xdf)),console[_0x2cc43c(0x144)](_0x2cc43c(0x133)),0x1;try{const _0x48c632=_0x3d3fa6[_0x2cc43c(0xce)],_0x2febb0=await resolveSegmentTarget(_0x476280,_0x48c632,_0x3d3fa6[_0x2cc43c(0x148)]);_0x3d3fa6[_0x2cc43c(0x148)]&&console[_0x2cc43c(0x144)](_0x2cc43c(0x130)+_0x2febb0);const _0x4b46e0=await withSpinner(_0x2cc43c(0xdd)+_0x476280+_0x2cc43c(0xc4),()=>_0x7b03c[_0x2cc43c(0xd0)][_0x2cc43c(0x16a)](_0x2febb0),{'verbose':_0x3d3fa6[_0x2cc43c(0x148)]}),_0x47c86c=_0x4b46e0['data'];_0x3d3fa6['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x47c86c[_0x2cc43c(0xc2)]),console[_0x2cc43c(0x144)]('Parent\x20ID:\x20'+_0x47c86c[_0x2cc43c(0x110)]));if(_0x47c86c['type']===_0x2cc43c(0xd8))return console[_0x2cc43c(0x144)](_0x2cc43c(0xe6)),console[_0x2cc43c(0x144)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x47c86c[_0x2cc43c(0xc2)]===_0x2cc43c(0x10c))return console[_0x2cc43c(0x144)](_0x2cc43c(0xf0)),console[_0x2cc43c(0x144)](_0x2cc43c(0xe3)),0x1;if(!_0x47c86c[_0x2cc43c(0x13c)])throw new SDKError(ErrorCode[_0x2cc43c(0xc0)],_0x2cc43c(0xde));const _0x382fb6=await withSpinner(_0x2cc43c(0x131),()=>_0x7b03c[_0x2cc43c(0xd0)][_0x2cc43c(0xe0)](_0x47c86c['parentId'],_0x47c86c[_0x2cc43c(0x13c)]),{'verbose':_0x3d3fa6[_0x2cc43c(0x148)]}),_0x3fa55f=_0x382fb6[_0x2cc43c(0x11f)],_0x398556=await executeSchemaQuery(_0x3fa55f,_0x7b03c,_0x3d3fa6);return await handleQueryOutput(_0x398556,_0x3d3fa6),0x0;}catch(_0xfb4648){if(_0xfb4648 instanceof SDKError)return console[_0x2cc43c(0x144)](_0x2cc43c(0x161)+_0xfb4648[_0x2cc43c(0x15c)]),_0xfb4648[_0x2cc43c(0x15e)]&&console[_0x2cc43c(0x144)](_0x2cc43c(0xca)+_0xfb4648[_0x2cc43c(0x15e)]),0x1;throw _0xfb4648;}}}
@@ -1 +1 @@
1
- const a36_0x3ecc2b=a36_0x14a0;(function(_0x2d2895,_0x1bde66){const _0x1a7db5=a36_0x14a0,_0x1ceb5e=_0x2d2895();while(!![]){try{const _0x195ffb=-parseInt(_0x1a7db5(0x171))/0x1+-parseInt(_0x1a7db5(0x179))/0x2*(-parseInt(_0x1a7db5(0x16d))/0x3)+parseInt(_0x1a7db5(0x160))/0x4*(parseInt(_0x1a7db5(0x168))/0x5)+-parseInt(_0x1a7db5(0x170))/0x6+-parseInt(_0x1a7db5(0x183))/0x7+parseInt(_0x1a7db5(0x17e))/0x8*(-parseInt(_0x1a7db5(0x16a))/0x9)+parseInt(_0x1a7db5(0x17c))/0xa*(parseInt(_0x1a7db5(0x178))/0xb);if(_0x195ffb===_0x1bde66)break;else _0x1ceb5e['push'](_0x1ceb5e['shift']());}catch(_0x64b362){_0x1ceb5e['push'](_0x1ceb5e['shift']());}}}(a36_0x4226,0xd96ba));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a36_0x4226(){const _0x57476d=['Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','4420dxrKkR','description','6664VaeSkj','Site:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','includes','Target\x20path:\x20','2034641mNoeVv','noCountPopulation','parent','ruleFile','Parent:\x20','segments','Segment\x20name:\x20','execute','segment:create','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','createSegment','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segment','Parent\x20path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','error','folder','resolveFolderId','13548fQGIoD','Create\x20child\x20segment\x20with\x20filtering\x20rules','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','verbose','resolvePathToResource','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','data','1210xkciPz','segmentPath','8118mMahjz','length','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','848313PwXLjv','name','kind','9045708JqfApu','154220DiCWWX','\x27...','type','resolveParentId','Resolved\x20folder\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','site','62018ZAFLkC','2qjADjp','Resolving\x20folder\x20\x27'];a36_0x4226=function(){return _0x57476d;};return a36_0x4226();}import{withSpinner}from'../utils/spinner.js';function a36_0x14a0(_0x3fb05a,_0x2397f3){_0x3fb05a=_0x3fb05a-0x150;const _0x4226bf=a36_0x4226();let _0x14a03b=_0x4226bf[_0x3fb05a];return _0x14a03b;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x41a530 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x3ecc2b(0x16e)]=a36_0x3ecc2b(0x156);[a36_0x3ecc2b(0x17d)]=a36_0x3ecc2b(0x161);async[a36_0x3ecc2b(0x155)](_0x3b0f77){const _0x36cf6a=a36_0x3ecc2b;console[_0x36cf6a(0x15d)](a36_0x41a530['yellow'](_0x36cf6a(0x180))),console[_0x36cf6a(0x15d)](a36_0x41a530['yellow'](_0x36cf6a(0x162)));const {options:_0x1ee8e2,args:_0x55393a,tdx:_0x18085a}=_0x3b0f77,_0x3c6748=_0x1ee8e2;if(_0x55393a['length']===0x0)return console[_0x36cf6a(0x15d)](_0x36cf6a(0x16c)),console[_0x36cf6a(0x15d)](_0x36cf6a(0x166)),console['error']('Examples:'),console['error'](_0x36cf6a(0x165)),console[_0x36cf6a(0x15d)](_0x36cf6a(0x15c)),console[_0x36cf6a(0x15d)](_0x36cf6a(0x159)),0x1;const _0x519ac9=_0x55393a[0x0],_0x398fdf=_0x1ee8e2[_0x36cf6a(0x169)];let _0x394197=_0x519ac9;_0x398fdf&&!_0x519ac9[_0x36cf6a(0x181)]('/')&&(_0x394197=_0x398fdf+'/'+_0x519ac9,_0x3c6748[_0x36cf6a(0x163)]&&console[_0x36cf6a(0x15d)]('Resolved\x20relative\x20path\x20to:\x20'+_0x394197));const _0x3ef8e6=parsePath(_0x394197);if(_0x3ef8e6['segments'][_0x36cf6a(0x16b)]<0x2)return console[_0x36cf6a(0x15d)](_0x36cf6a(0x17b)),console[_0x36cf6a(0x15d)](_0x36cf6a(0x157)),0x1;const _0x4db4bb=_0x3ef8e6[_0x36cf6a(0x153)][0x0],_0x4b4659=getBaseName(_0x394197),_0x47a36a=getParentPath(_0x394197);_0x3c6748[_0x36cf6a(0x163)]&&(console[_0x36cf6a(0x15d)](_0x36cf6a(0x17f)+_0x3c6748[_0x36cf6a(0x177)]),console[_0x36cf6a(0x15d)](_0x36cf6a(0x182)+_0x394197),console['error'](_0x36cf6a(0x152)+_0x4db4bb),console[_0x36cf6a(0x15d)](_0x36cf6a(0x154)+_0x4b4659),console[_0x36cf6a(0x15d)](_0x36cf6a(0x15b)+_0x47a36a));const _0x435fb2=await withSpinner(_0x36cf6a(0x176)+_0x4db4bb+_0x36cf6a(0x172),()=>_0x18085a[_0x36cf6a(0x15a)][_0x36cf6a(0x174)](_0x4db4bb),{'verbose':_0x3c6748[_0x36cf6a(0x163)]}),_0x1e98f2=_0x435fb2[_0x36cf6a(0x167)];let _0x38a293;if(_0x3ef8e6[_0x36cf6a(0x153)]['length']>0x2){const _0x311403=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x47a36a+'\x27...',()=>_0x18085a[_0x36cf6a(0x15a)][_0x36cf6a(0x164)](_0x47a36a),{'verbose':_0x3c6748['verbose']}),_0x23559f=_0x311403[_0x36cf6a(0x167)];if(_0x23559f['type']!==_0x36cf6a(0x15e)&&_0x23559f[_0x36cf6a(0x173)]!==_0x36cf6a(0x150))return console[_0x36cf6a(0x15d)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x38a293=_0x23559f['folderId'];}else{if(_0x3c6748[_0x36cf6a(0x15e)]){const _0x454586=await withSpinner(_0x36cf6a(0x17a)+_0x3c6748[_0x36cf6a(0x15e)]+_0x36cf6a(0x172),()=>_0x18085a[_0x36cf6a(0x15a)][_0x36cf6a(0x15f)](_0x1e98f2,_0x3c6748[_0x36cf6a(0x15e)]),{'verbose':_0x3c6748[_0x36cf6a(0x163)]});_0x38a293=_0x454586[_0x36cf6a(0x167)];}}_0x3c6748['verbose']&&_0x38a293&&console['error'](_0x36cf6a(0x175)+_0x38a293);const _0x3b812a=await loadJSONFromOptions(_0x3c6748['rule'],_0x3c6748[_0x36cf6a(0x151)]),_0x4765fd={'name':_0x4b4659,'description':_0x3c6748[_0x36cf6a(0x17d)],'rule':_0x3b812a,'kind':_0x3c6748[_0x36cf6a(0x16f)]!==undefined?parseInt(_0x3c6748['kind'],0xa):undefined,'isVisible':_0x3c6748['invisible']?![]:undefined,'segmentFolderId':_0x38a293,'countPopulation':_0x3c6748[_0x36cf6a(0x184)]?![]:undefined},_0x2599ac=await withSpinner('Creating\x20segment\x20\x27'+_0x4b4659+_0x36cf6a(0x172),()=>_0x18085a[_0x36cf6a(0x15a)][_0x36cf6a(0x158)](_0x1e98f2,_0x4765fd),{'verbose':_0x3c6748[_0x36cf6a(0x163)]}),_0x243d85=_0x2599ac[_0x36cf6a(0x167)];return console[_0x36cf6a(0x15d)]('✔\x20Created\x20segment\x20\x27'+_0x243d85[_0x36cf6a(0x16e)]+'\x27\x20with\x20ID:\x20'+_0x243d85['id']),_0x394197!==_0x519ac9&&console[_0x36cf6a(0x15d)]('\x20\x20\x20Path:\x20'+_0x394197),await handleSDKOutput([_0x243d85],_0x3c6748),0x0;}}
1
+ const a36_0x47e695=a36_0x8dc4;(function(_0x394117,_0x50a741){const _0x3c77f7=a36_0x8dc4,_0x540650=_0x394117();while(!![]){try{const _0x32bd2f=parseInt(_0x3c77f7(0xd1))/0x1*(parseInt(_0x3c77f7(0xc2))/0x2)+parseInt(_0x3c77f7(0xdb))/0x3+-parseInt(_0x3c77f7(0xba))/0x4*(-parseInt(_0x3c77f7(0xb4))/0x5)+parseInt(_0x3c77f7(0xe2))/0x6*(-parseInt(_0x3c77f7(0xca))/0x7)+-parseInt(_0x3c77f7(0xd0))/0x8*(-parseInt(_0x3c77f7(0xdc))/0x9)+parseInt(_0x3c77f7(0xd7))/0xa*(-parseInt(_0x3c77f7(0xb6))/0xb)+-parseInt(_0x3c77f7(0xd2))/0xc;if(_0x32bd2f===_0x50a741)break;else _0x540650['push'](_0x540650['shift']());}catch(_0x2ff964){_0x540650['push'](_0x540650['shift']());}}}(a36_0x37ac,0x357ec));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a36_0x8dc4(_0x43edbf,_0x470989){_0x43edbf=_0x43edbf-0xaf;const _0x37acc6=a36_0x37ac();let _0x8dc4f9=_0x37acc6[_0x43edbf];return _0x8dc4f9;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a36_0x37ac(){const _0xa7cd67=['Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','kind','error','\x27\x20with\x20ID:\x20','3400864JjmIMz','499rYQwqg','557076fUmEpy','\x20\x20\x20Path:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','✔\x20Created\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','160260yxatsz','\x27...','yellow','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','82425UBWsHJ','9xrEAsK','Resolved\x20relative\x20path\x20to:\x20','name','parent','includes','noCountPopulation','114cFdxIe','Parent\x20path:\x20','Segment\x20name:\x20','resolveFolderId','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segment:create','segment','Target\x20path:\x20','Parent:\x20','execute','1101115uBUqJB','createSegment','198ZnxUvV','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Site:\x20','Resolved\x20folder\x20ID:\x20','4TwTueh','Create\x20child\x20segment\x20with\x20filtering\x20rules','Creating\x20segment\x20\x27','description','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Resolving\x20parent\x20segment\x20\x27','data','Resolving\x20folder\x20path\x20\x27','634rebHIV','segments','resolvePathToResource','verbose','type','length','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','invisible','102046UJqRYn','folder'];a36_0x37ac=function(){return _0xa7cd67;};return a36_0x37ac();}import a36_0x5c63e8 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x47e695(0xde)]=a36_0x47e695(0xaf);[a36_0x47e695(0xbd)]=a36_0x47e695(0xbb);async[a36_0x47e695(0xb3)](_0x368057){const _0x25c290=a36_0x47e695;console['error'](a36_0x5c63e8[_0x25c290(0xd9)](_0x25c290(0xc8))),console[_0x25c290(0xce)](a36_0x5c63e8[_0x25c290(0xd9)](_0x25c290(0xb7)));const {options:_0x13e41f,args:_0x3156a2,tdx:_0x5ab7e0}=_0x368057,_0x1dcf77=_0x13e41f;if(_0x3156a2[_0x25c290(0xc7)]===0x0)return console[_0x25c290(0xce)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x25c290(0xd4)),console[_0x25c290(0xce)]('Examples:'),console[_0x25c290(0xce)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x25c290(0xce)](_0x25c290(0xe6)),console[_0x25c290(0xce)](_0x25c290(0xbe)),0x1;const _0x112f55=_0x3156a2[0x0],_0x73fca4=_0x13e41f['segmentPath'];let _0x560d7e=_0x112f55;_0x73fca4&&!_0x112f55[_0x25c290(0xe0)]('/')&&(_0x560d7e=_0x73fca4+'/'+_0x112f55,_0x1dcf77[_0x25c290(0xc5)]&&console[_0x25c290(0xce)](_0x25c290(0xdd)+_0x560d7e));const _0x4c1e0a=parsePath(_0x560d7e);if(_0x4c1e0a[_0x25c290(0xc3)][_0x25c290(0xc7)]<0x2)return console[_0x25c290(0xce)](_0x25c290(0xcc)),console[_0x25c290(0xce)](_0x25c290(0xd6)),0x1;const _0x2b060a=_0x4c1e0a['segments'][0x0],_0x5d173b=getBaseName(_0x560d7e),_0x1a2d64=getParentPath(_0x560d7e);_0x1dcf77['verbose']&&(console[_0x25c290(0xce)](_0x25c290(0xb8)+_0x1dcf77['site']),console[_0x25c290(0xce)](_0x25c290(0xb1)+_0x560d7e),console['error'](_0x25c290(0xb2)+_0x2b060a),console['error'](_0x25c290(0xe4)+_0x5d173b),console[_0x25c290(0xce)](_0x25c290(0xe3)+_0x1a2d64));const _0x52432e=await withSpinner(_0x25c290(0xbf)+_0x2b060a+'\x27...',()=>_0x5ab7e0[_0x25c290(0xb0)]['resolveParentId'](_0x2b060a),{'verbose':_0x1dcf77[_0x25c290(0xc5)]}),_0x5f1968=_0x52432e[_0x25c290(0xc0)];let _0x222336;if(_0x4c1e0a[_0x25c290(0xc3)][_0x25c290(0xc7)]>0x2){const _0x442f49=await withSpinner(_0x25c290(0xc1)+_0x1a2d64+_0x25c290(0xd8),()=>_0x5ab7e0[_0x25c290(0xb0)][_0x25c290(0xc4)](_0x1a2d64),{'verbose':_0x1dcf77[_0x25c290(0xc5)]}),_0x655c55=_0x442f49[_0x25c290(0xc0)];if(_0x655c55[_0x25c290(0xc6)]!==_0x25c290(0xcb)&&_0x655c55['type']!==_0x25c290(0xdf))return console['error'](_0x25c290(0xda)),0x1;_0x222336=_0x655c55['folderId'];}else{if(_0x1dcf77[_0x25c290(0xcb)]){const _0x335162=await withSpinner('Resolving\x20folder\x20\x27'+_0x1dcf77['folder']+_0x25c290(0xd8),()=>_0x5ab7e0[_0x25c290(0xb0)][_0x25c290(0xe5)](_0x5f1968,_0x1dcf77[_0x25c290(0xcb)]),{'verbose':_0x1dcf77[_0x25c290(0xc5)]});_0x222336=_0x335162[_0x25c290(0xc0)];}}_0x1dcf77[_0x25c290(0xc5)]&&_0x222336&&console['error'](_0x25c290(0xb9)+_0x222336);const _0x182e8d=await loadJSONFromOptions(_0x1dcf77['rule'],_0x1dcf77['ruleFile']),_0x28cb3c={'name':_0x5d173b,'description':_0x1dcf77['description'],'rule':_0x182e8d,'kind':_0x1dcf77[_0x25c290(0xcd)]!==undefined?parseInt(_0x1dcf77[_0x25c290(0xcd)],0xa):undefined,'isVisible':_0x1dcf77[_0x25c290(0xc9)]?![]:undefined,'segmentFolderId':_0x222336,'countPopulation':_0x1dcf77[_0x25c290(0xe1)]?![]:undefined},_0x347eb4=await withSpinner(_0x25c290(0xbc)+_0x5d173b+_0x25c290(0xd8),()=>_0x5ab7e0[_0x25c290(0xb0)][_0x25c290(0xb5)](_0x5f1968,_0x28cb3c),{'verbose':_0x1dcf77[_0x25c290(0xc5)]}),_0x2c71a4=_0x347eb4[_0x25c290(0xc0)];return console[_0x25c290(0xce)](_0x25c290(0xd5)+_0x2c71a4[_0x25c290(0xde)]+_0x25c290(0xcf)+_0x2c71a4['id']),_0x560d7e!==_0x112f55&&console[_0x25c290(0xce)](_0x25c290(0xd3)+_0x560d7e),await handleSDKOutput([_0x2c71a4],_0x1dcf77),0x0;}}
@@ -1 +1 @@
1
- const a37_0x4956d8=a37_0x4ef5;function a37_0x5c18(){const _0x41ff94=['1642YpeKuq','length','5952180MeUQLu','json','verbose','Parent\x20segment:\x20','7855299fpeCjX','1208ISBNjX','segment:fields','error','3681412EcPBPB','Site:\x20','✔\x20Found\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27...','1029963pQpxzs','7669914iIwGRm','listFields','name','jsonl','24QkGMCf','parentSegment','data','execute','description','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','segment','6473340rjZkOT'];a37_0x5c18=function(){return _0x41ff94;};return a37_0x5c18();}(function(_0x2072e5,_0x23f954){const _0x41b327=a37_0x4ef5,_0x3df2d0=_0x2072e5();while(!![]){try{const _0x15f20d=parseInt(_0x41b327(0x1c7))/0x1*(-parseInt(_0x41b327(0x1ce))/0x2)+-parseInt(_0x41b327(0x1d6))/0x3+parseInt(_0x41b327(0x1c9))/0x4+parseInt(_0x41b327(0x1c6))/0x5+-parseInt(_0x41b327(0x1d7))/0x6+-parseInt(_0x41b327(0x1d1))/0x7*(-parseInt(_0x41b327(0x1bf))/0x8)+-parseInt(_0x41b327(0x1cd))/0x9;if(_0x15f20d===_0x23f954)break;else _0x3df2d0['push'](_0x3df2d0['shift']());}catch(_0x2e3a54){_0x3df2d0['push'](_0x3df2d0['shift']());}}}(a37_0x5c18,0xd5702));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x4ef5(_0x4740c8,_0x5df4de){_0x4740c8=_0x4740c8-0x1bc;const _0x5c1873=a37_0x5c18();let _0x4ef5c4=_0x5c1873[_0x4740c8];return _0x4ef5c4;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a37_0x4956d8(0x1bd)]=a37_0x4956d8(0x1cf);[a37_0x4956d8(0x1c3)]='List\x20available\x20fields\x20for\x20segmentation';async[a37_0x4956d8(0x1c2)](_0xe0ce6e){const _0xf7a877=a37_0x4956d8,{options:_0x40d32c,args:_0x2f6944,tdx:_0x14fba6}=_0xe0ce6e,_0x17faae=_0x2f6944[0x0]||_0x40d32c[_0xf7a877(0x1c0)];if(!_0x17faae)return console[_0xf7a877(0x1d0)](_0xf7a877(0x1d4)),console['error'](_0xf7a877(0x1c4)),console[_0xf7a877(0x1d0)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x40d32c[_0xf7a877(0x1cb)]&&(console[_0xf7a877(0x1d0)](_0xf7a877(0x1d2)+_0x40d32c['site']),console[_0xf7a877(0x1d0)](_0xf7a877(0x1cc)+_0x17faae));const _0x572814=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x17faae+_0xf7a877(0x1d5),()=>_0x14fba6[_0xf7a877(0x1c5)][_0xf7a877(0x1bc)](_0x17faae),{'verbose':_0x40d32c[_0xf7a877(0x1cb)]}),_0x2dcd91=_0x572814[_0xf7a877(0x1c1)];console[_0xf7a877(0x1d0)](_0xf7a877(0x1d3)+_0x2dcd91[_0xf7a877(0x1c8)]+'\x20field'+(_0x2dcd91[_0xf7a877(0x1c8)]!==0x1?'s':''));if(_0x40d32c[_0xf7a877(0x1ca)]||_0x40d32c[_0xf7a877(0x1be)])return await handleSDKOutput(_0x2dcd91,_0x40d32c),0x0;return displayFieldsHumanReadable(_0x2dcd91,_0x17faae),0x0;}}
1
+ const a37_0x1ba1af=a37_0x2d24;(function(_0x2fe751,_0x208634){const _0x23b90a=a37_0x2d24,_0x290f8e=_0x2fe751();while(!![]){try{const _0x294417=parseInt(_0x23b90a(0xce))/0x1+-parseInt(_0x23b90a(0xd4))/0x2*(-parseInt(_0x23b90a(0xc2))/0x3)+-parseInt(_0x23b90a(0xc5))/0x4+parseInt(_0x23b90a(0xc6))/0x5*(-parseInt(_0x23b90a(0xc4))/0x6)+-parseInt(_0x23b90a(0xd0))/0x7*(parseInt(_0x23b90a(0xcb))/0x8)+-parseInt(_0x23b90a(0xcd))/0x9+parseInt(_0x23b90a(0xda))/0xa;if(_0x294417===_0x208634)break;else _0x290f8e['push'](_0x290f8e['shift']());}catch(_0xc29574){_0x290f8e['push'](_0x290f8e['shift']());}}}(a37_0x3e43,0x869d3));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x3e43(){const _0x190cd8=['Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','data','segment','22425950JRGslL','Listing\x20fields\x20for\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','listFields','✔\x20Found\x20','List\x20available\x20fields\x20for\x20segmentation','Error:\x20Parent\x20segment\x20name\x20is\x20required','1521FFMLkV','description','28182suWyRC','598476snTMeV','250NwGbIa','Site:\x20','json','name','length','7830280NqMdkV','verbose','9660015yQybuK','680984hwLCGv','\x20field','7vNLyma','Parent\x20segment:\x20','site','execute','254IFeFBn','error','\x27...'];a37_0x3e43=function(){return _0x190cd8;};return a37_0x3e43();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a37_0x2d24(_0x18ed4d,_0x222f56){_0x18ed4d=_0x18ed4d-0xc0;const _0x3e43f9=a37_0x3e43();let _0x2d2460=_0x3e43f9[_0x18ed4d];return _0x2d2460;}export class SegmentFieldsCommand extends BaseCommand{[a37_0x1ba1af(0xc9)]='segment:fields';[a37_0x1ba1af(0xc3)]=a37_0x1ba1af(0xc0);async[a37_0x1ba1af(0xd3)](_0x401f26){const _0x1e170c=a37_0x1ba1af,{options:_0x53bc40,args:_0x286f83,tdx:_0x1bdbd2}=_0x401f26,_0x388c4d=_0x286f83[0x0]||_0x53bc40['parentSegment'];if(!_0x388c4d)return console[_0x1e170c(0xd5)](_0x1e170c(0xc1)),console[_0x1e170c(0xd5)](_0x1e170c(0xd7)),console[_0x1e170c(0xd5)](_0x1e170c(0xdc)),0x1;_0x53bc40[_0x1e170c(0xcc)]&&(console['error'](_0x1e170c(0xc7)+_0x53bc40[_0x1e170c(0xd2)]),console[_0x1e170c(0xd5)](_0x1e170c(0xd1)+_0x388c4d));const _0x341e44=await withSpinner(_0x1e170c(0xdb)+_0x388c4d+_0x1e170c(0xd6),()=>_0x1bdbd2[_0x1e170c(0xd9)][_0x1e170c(0xdd)](_0x388c4d),{'verbose':_0x53bc40[_0x1e170c(0xcc)]}),_0x2b02c5=_0x341e44[_0x1e170c(0xd8)];console[_0x1e170c(0xd5)](_0x1e170c(0xde)+_0x2b02c5[_0x1e170c(0xca)]+_0x1e170c(0xcf)+(_0x2b02c5[_0x1e170c(0xca)]!==0x1?'s':''));if(_0x53bc40[_0x1e170c(0xc8)]||_0x53bc40['jsonl'])return await handleSDKOutput(_0x2b02c5,_0x53bc40),0x0;return displayFieldsHumanReadable(_0x2b02c5,_0x388c4d),0x0;}}
@@ -1 +1 @@
1
- const a38_0x1f93d7=a38_0x5c25;(function(_0x5c2a62,_0x320bf3){const _0x1f6592=a38_0x5c25,_0xd4a539=_0x5c2a62();while(!![]){try{const _0x3d5a7a=-parseInt(_0x1f6592(0x1bd))/0x1*(parseInt(_0x1f6592(0x18a))/0x2)+-parseInt(_0x1f6592(0x192))/0x3+-parseInt(_0x1f6592(0x1ad))/0x4+-parseInt(_0x1f6592(0x1c9))/0x5+parseInt(_0x1f6592(0x189))/0x6+-parseInt(_0x1f6592(0x195))/0x7*(parseInt(_0x1f6592(0x184))/0x8)+-parseInt(_0x1f6592(0x1a8))/0x9*(-parseInt(_0x1f6592(0x1a0))/0xa);if(_0x3d5a7a===_0x320bf3)break;else _0xd4a539['push'](_0xd4a539['shift']());}catch(_0x240229){_0xd4a539['push'](_0xd4a539['shift']());}}}(a38_0xb15b,0xb57f4));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a38_0x5c25(_0x45122c,_0x4e76fd){_0x45122c=_0x45122c-0x183;const _0xb15b13=a38_0xb15b();let _0x5c256d=_0xb15b13[_0x45122c];return _0x5c256d;}import{saveSessionContext}from'../core/session.js';function a38_0xb15b(){const _0x78233b=['\x20activations','538542DWNisX','113716kAizfQ','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','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)','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x27...','counts','990306CdadNz','length','dim','2621899FIqzsp','dryRun','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','site','-\x20no\x20files\x20written','content','✔\x20Pulled\x20','file','segment:pull','\x20\x20Target:\x20','yellow','10RMEEol','✔\x20Context\x20set:\x20','files','repeat','parentSegment','hasChanges','red','type','37645605MGkbcC','Parent\x20segment:\x20','absolutePath','activations','cwd','2614524lTYLag','filter','targetDir','Site:\x20','session','utf-8','Target\x20resource:\x20','resourceName','journeyVersions','\x20journeys','\x20versions)','\x0aError:','description','✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','cyan','19EfNawB','journeys','diff','relativePath','\x20changed\x20files','verbose','errorCode','\x20with\x20','\x20unchanged\x20files','isNew','data','Write\x20','5452990JlzDvD','Pulling\x20segments\x20from\x20\x27','parentName','parent_segment','segments','\x0aChanges\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','execute','error','Error:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20=\x20','8oljKrU','message','Aborted.','helpText'];a38_0xb15b=function(){return _0x78233b;};return a38_0xb15b();}import a38_0xed7c91 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x3a6548 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']=a38_0x1f93d7(0x19d);[a38_0x1f93d7(0x1b9)]=a38_0x1f93d7(0x18f);async[a38_0x1f93d7(0x1d0)](_0x2a1f66){const _0x529504=a38_0x1f93d7,{options:_0x5c488b,args:_0x4d4d50,tdx:_0x19a0d8}=_0x2a1f66,_0x336395=_0x5c488b,_0x1f50a8=await resolveTarget({'arg':_0x4d4d50[0x0],'contextParent':_0x5c488b[_0x529504(0x1a4)],'cwd':process[_0x529504(0x1ac)]()});if(!isSuccessfulResolution(_0x1f50a8))return _0x1f50a8[_0x529504(0x1c3)]==='no_parent'?(console[_0x529504(0x1d1)](a38_0xed7c91[_0x529504(0x19f)](_0x529504(0x197))),console[_0x529504(0x1d1)](_0x529504(0x18e)),console[_0x529504(0x1d1)](_0x529504(0x1cf)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a38_0xed7c91[_0x529504(0x1a6)](_0x529504(0x1d2)+_0x1f50a8[_0x529504(0x185)]+'\x0a')),_0x1f50a8[_0x529504(0x187)]&&console[_0x529504(0x1d1)](a38_0xed7c91[_0x529504(0x1bc)](_0x1f50a8['helpText']))),0x1;const _0x52520b=_0x1f50a8[_0x529504(0x1cb)],_0x3ba42f=_0x1f50a8['targetDir'],_0xce99de=_0x1f50a8[_0x529504(0x1a7)]===_0x529504(0x19c)?_0x1f50a8[_0x529504(0x1b4)]:undefined;_0x336395[_0x529504(0x1c2)]&&(console[_0x529504(0x1d1)](_0x529504(0x1b0)+_0x336395[_0x529504(0x198)]),console[_0x529504(0x1d1)](_0x529504(0x1a9)+_0x52520b),_0xce99de&&console['error'](_0x529504(0x1b3)+_0xce99de));const _0x3383ec=await withProgressSpinner(_0x529504(0x1ca)+_0x52520b+_0x529504(0x190),_0x276211=>_0x19a0d8['segment']['pullSegments'](_0x52520b,{'targetDir':_0x3ba42f,'targetResourceName':_0xce99de,'verbose':_0x336395[_0x529504(0x1c2)],'progress':{'update':_0x3f5c58=>{const _0x168599=_0x529504;_0x276211['setPhase'](_0x3f5c58),_0x336395[_0x168599(0x1c2)]&&console[_0x168599(0x1d1)]('\x20\x20'+_0x3f5c58);}}}),{'verbose':_0x336395[_0x529504(0x1c2)]}),_0x3e9864=_0x3383ec[_0x529504(0x1c7)];if(_0x3e9864['counts']['segments']===0x0&&_0x3e9864['counts'][_0x529504(0x1be)]===0x0)return console[_0x529504(0x1d1)](a38_0xed7c91['yellow'](_0x529504(0x18d)+_0x3e9864[_0x529504(0x1cb)]+'\x27')),0x0;const _0x87343c=_0x3e9864[_0x529504(0x1a2)][_0x529504(0x1ae)](_0x5b7bdd=>_0x5b7bdd[_0x529504(0x1c6)]),_0x5c4b19=_0x3e9864[_0x529504(0x1a2)][_0x529504(0x1ae)](_0x17eb7e=>!_0x17eb7e[_0x529504(0x1c6)]&&_0x17eb7e[_0x529504(0x1a5)]),_0x156578=_0x3e9864[_0x529504(0x1a2)][_0x529504(0x1ae)](_0x36cf01=>!_0x36cf01[_0x529504(0x1c6)]&&!_0x36cf01[_0x529504(0x1a5)]);console[_0x529504(0x1d1)]('\x0aPull\x20summary\x20for\x20\x27'+_0x3e9864[_0x529504(0x1cb)]+'\x27:'),console['error']('\x20\x20🎯\x20'+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x191)][_0x529504(0x1cd)]+'\x20segments')+_0x529504(0x1c4)+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x191)][_0x529504(0x1ab)]+_0x529504(0x188)));if(_0x3e9864[_0x529504(0x191)][_0x529504(0x1be)]>0x0){const _0x32617d=_0x3e9864[_0x529504(0x191)][_0x529504(0x1b5)]>_0x3e9864[_0x529504(0x191)][_0x529504(0x1be)]?'\x20('+_0x3e9864[_0x529504(0x191)][_0x529504(0x1b5)]+_0x529504(0x1b7):'';console[_0x529504(0x1d1)]('\x20\x20🗺️\x20\x20'+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x191)][_0x529504(0x1be)]+_0x529504(0x1b6))+a38_0xed7c91[_0x529504(0x194)](_0x32617d));}console[_0x529504(0x1d1)]('\x20\x20'+a38_0xed7c91[_0x529504(0x18c)]('+\x20'+_0x87343c[_0x529504(0x193)]+'\x20new\x20files')),console[_0x529504(0x1d1)]('\x20\x20'+a38_0xed7c91['yellow']('~\x20'+_0x5c4b19[_0x529504(0x193)]+_0x529504(0x1c1))),console[_0x529504(0x1d1)]('\x20\x20'+a38_0xed7c91['dim']('=\x20'+_0x156578[_0x529504(0x193)]+_0x529504(0x1c5))),console['error'](_0x529504(0x19e)+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x1af)])+'\x0a');if(_0x5c4b19['length']>0x0)for(const _0x2a4075 of _0x5c4b19){console[_0x529504(0x1d1)](_0x529504(0x1ce)+_0x2a4075[_0x529504(0x1c0)]+'\x27:'),console[_0x529504(0x1d1)]('─'[_0x529504(0x1a3)](0x3c)),console[_0x529504(0x1d1)](_0x2a4075[_0x529504(0x1bf)]),console[_0x529504(0x1d1)]('─'[_0x529504(0x1a3)](0x3c));}if(_0x336395[_0x529504(0x196)])return console[_0x529504(0x1d1)](a38_0xed7c91[_0x529504(0x19f)](_0x529504(0x1d3))),0x0;if(_0x87343c['length']===0x0&&_0x5c4b19[_0x529504(0x193)]===0x0)return console['error'](a38_0xed7c91[_0x529504(0x18c)](_0x529504(0x1ba))),saveSessionContext({'parent_segment':_0x3e9864[_0x529504(0x1cb)]},_0x336395[_0x529504(0x1b1)]),console[_0x529504(0x1d1)](a38_0xed7c91['green'](_0x529504(0x1a1)+a38_0xed7c91[_0x529504(0x194)](_0x529504(0x1cc))+_0x529504(0x183)+a38_0xed7c91[_0x529504(0x1bc)](_0x3e9864[_0x529504(0x1cb)]))),0x0;if(!_0x336395['yes']){if(!isInteractive())return console[_0x529504(0x1d1)](a38_0xed7c91[_0x529504(0x1a6)](_0x529504(0x1b8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a38_0xed7c91[_0x529504(0x194)](_0x529504(0x18b))),0x1;const _0x4d0e8a=await confirmKey(_0x529504(0x1c8)+(_0x87343c['length']+_0x5c4b19[_0x529504(0x193)])+'\x20files?');if(!_0x4d0e8a)return console['error'](a38_0xed7c91[_0x529504(0x19f)](_0x529504(0x186)),_0x529504(0x199)),0x1;}for(const _0x1da02b of _0x3e9864[_0x529504(0x1a2)]){if(_0x1da02b[_0x529504(0x1c6)]||_0x1da02b[_0x529504(0x1a5)]){const _0x38b568=a38_0x3a6548[_0x529504(0x1bb)](_0x1da02b[_0x529504(0x1aa)]);!existsSync(_0x38b568)&&mkdirSync(_0x38b568,{'recursive':!![]}),writeFileSync(_0x1da02b[_0x529504(0x1aa)],_0x1da02b[_0x529504(0x19a)],_0x529504(0x1b2));}}return console['error'](a38_0xed7c91[_0x529504(0x18c)](_0x529504(0x19b)+(_0x87343c[_0x529504(0x193)]+_0x5c4b19[_0x529504(0x193)])+'\x20files\x20to\x20'+_0x3e9864[_0x529504(0x1af)])),saveSessionContext({'parent_segment':_0x3e9864[_0x529504(0x1cb)]},_0x336395[_0x529504(0x1b1)]),console['error'](a38_0xed7c91[_0x529504(0x18c)](_0x529504(0x1a1)+a38_0xed7c91['dim'](_0x529504(0x1cc))+_0x529504(0x183)+a38_0xed7c91['cyan'](_0x3e9864[_0x529504(0x1cb)]))),0x0;}}
1
+ const a38_0x4b4fc9=a38_0x42b6;(function(_0x5baa52,_0x1101d7){const _0x40a7f6=a38_0x42b6,_0x373a0f=_0x5baa52();while(!![]){try{const _0x18c063=-parseInt(_0x40a7f6(0x130))/0x1*(-parseInt(_0x40a7f6(0xfc))/0x2)+-parseInt(_0x40a7f6(0x12b))/0x3*(-parseInt(_0x40a7f6(0x112))/0x4)+parseInt(_0x40a7f6(0xf9))/0x5*(-parseInt(_0x40a7f6(0xfb))/0x6)+parseInt(_0x40a7f6(0xf5))/0x7+parseInt(_0x40a7f6(0xe5))/0x8*(-parseInt(_0x40a7f6(0x103))/0x9)+-parseInt(_0x40a7f6(0x107))/0xa*(parseInt(_0x40a7f6(0xdf))/0xb)+parseInt(_0x40a7f6(0xf0))/0xc;if(_0x18c063===_0x1101d7)break;else _0x373a0f['push'](_0x373a0f['shift']());}catch(_0x231def){_0x373a0f['push'](_0x373a0f['shift']());}}}(a38_0x55c3,0x90c7d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a38_0x55c3(){const _0x519e1d=['3107864aoGSSM','parentSegment','✔\x20Pulled\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','dryRun','yellow','counts','session','✔\x20All\x20files\x20are\x20up\x20to\x20date','filter','helpText','7962048YOubjS','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)','error','\x20with\x20','Error:\x20','6143921FTWXri','site','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20=\x20','10grAvbD','✔\x20Context\x20set:\x20','2189622CkuYFj','78zeAAni','length','type','parentName','content','\x20changed\x20files','description','9yhhEWV','-\x20no\x20files\x20written','\x20versions)','dim','1650QZVPMr','cwd','\x20\x20Target:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segments','utf-8','Write\x20','yes','Aborted.','\x0aChanges\x20to\x20\x27','diff','104552gzEUhZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x0aPull\x20summary\x20for\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','segment:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','parent_segment','message','files','\x20journeys','repeat','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeys','Site:\x20','\x0aError:','green','cyan','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','hasChanges','file','data','\x27...','targetDir','\x20files\x20to\x20','\x20\x20🎯\x20','75TnigjM','\x20files?','red','Parent\x20segment:\x20','resourceName','8834JtNYrx','verbose','no_parent','pullSegments','segment','dirname','55187WARfLS','Target\x20resource:\x20','isNew','relativePath','setPhase','\x20unchanged\x20files'];a38_0x55c3=function(){return _0x519e1d;};return a38_0x55c3();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a38_0x42b6(_0x1a1e1b,_0x4538d6){_0x1a1e1b=_0x1a1e1b-0xda;const _0x55c33c=a38_0x55c3();let _0x42b682=_0x55c33c[_0x1a1e1b];return _0x42b682;}import a38_0x507e98 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x1baa51 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']=a38_0x4b4fc9(0x116);[a38_0x4b4fc9(0x102)]=a38_0x4b4fc9(0x123);async['execute'](_0x22b494){const _0x4d7365=a38_0x4b4fc9,{options:_0x47b111,args:_0x40c1bc,tdx:_0x287d63}=_0x22b494,_0x5ba569=_0x47b111,_0x1156d6=await resolveTarget({'arg':_0x40c1bc[0x0],'contextParent':_0x47b111[_0x4d7365(0xe6)],'cwd':process[_0x4d7365(0x108)]()});if(!isSuccessfulResolution(_0x1156d6))return _0x1156d6['errorCode']===_0x4d7365(0xdb)?(console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0xea)](_0x4d7365(0x10a))),console[_0x4d7365(0xf2)](_0x4d7365(0xf1)),console[_0x4d7365(0xf2)](_0x4d7365(0x117)),console[_0x4d7365(0xf2)](_0x4d7365(0x113))):(console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x12d)](_0x4d7365(0xf4)+_0x1156d6[_0x4d7365(0x119)]+'\x0a')),_0x1156d6[_0x4d7365(0xef)]&&console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x122)](_0x1156d6[_0x4d7365(0xef)]))),0x1;const _0x31d339=_0x1156d6[_0x4d7365(0xff)],_0x3bc4ff=_0x1156d6[_0x4d7365(0x128)],_0x549f32=_0x1156d6[_0x4d7365(0xfe)]===_0x4d7365(0x125)?_0x1156d6[_0x4d7365(0x12f)]:undefined;_0x5ba569['verbose']&&(console[_0x4d7365(0xf2)](_0x4d7365(0x11f)+_0x5ba569[_0x4d7365(0xf6)]),console[_0x4d7365(0xf2)](_0x4d7365(0x12e)+_0x31d339),_0x549f32&&console[_0x4d7365(0xf2)](_0x4d7365(0xe0)+_0x549f32));const _0x494dab=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x31d339+_0x4d7365(0x127),_0x15b46c=>_0x287d63[_0x4d7365(0xdd)][_0x4d7365(0xdc)](_0x31d339,{'targetDir':_0x3bc4ff,'targetResourceName':_0x549f32,'verbose':_0x5ba569[_0x4d7365(0xda)],'progress':{'update':_0x1ff1bc=>{const _0x1cf769=_0x4d7365;_0x15b46c[_0x1cf769(0xe3)](_0x1ff1bc),_0x5ba569[_0x1cf769(0xda)]&&console[_0x1cf769(0xf2)]('\x20\x20'+_0x1ff1bc);}}}),{'verbose':_0x5ba569[_0x4d7365(0xda)]}),_0x6384d5=_0x494dab[_0x4d7365(0x126)];if(_0x6384d5[_0x4d7365(0xeb)][_0x4d7365(0x10b)]===0x0&&_0x6384d5['counts'][_0x4d7365(0x11e)]===0x0)return console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0xea)](_0x4d7365(0xe8)+_0x6384d5['parentName']+'\x27')),0x0;const _0x184d0c=_0x6384d5['files'][_0x4d7365(0xee)](_0x541953=>_0x541953[_0x4d7365(0xe1)]),_0x545de8=_0x6384d5[_0x4d7365(0x11a)][_0x4d7365(0xee)](_0x3e0d2c=>!_0x3e0d2c[_0x4d7365(0xe1)]&&_0x3e0d2c['hasChanges']),_0x3bbf3e=_0x6384d5[_0x4d7365(0x11a)][_0x4d7365(0xee)](_0x321ac3=>!_0x321ac3['isNew']&&!_0x321ac3[_0x4d7365(0x124)]);console[_0x4d7365(0xf2)](_0x4d7365(0x114)+_0x6384d5[_0x4d7365(0xff)]+'\x27:'),console[_0x4d7365(0xf2)](_0x4d7365(0x12a)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5['counts'][_0x4d7365(0x10b)]+'\x20segments')+_0x4d7365(0xf3)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xeb)]['activations']+'\x20activations'));if(_0x6384d5[_0x4d7365(0xeb)][_0x4d7365(0x11e)]>0x0){const _0x1bb9e7=_0x6384d5['counts']['journeyVersions']>_0x6384d5['counts'][_0x4d7365(0x11e)]?'\x20('+_0x6384d5[_0x4d7365(0xeb)]['journeyVersions']+_0x4d7365(0x105):'';console[_0x4d7365(0xf2)]('\x20\x20🗺️\x20\x20'+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xeb)][_0x4d7365(0x11e)]+_0x4d7365(0x11b))+a38_0x507e98[_0x4d7365(0x106)](_0x1bb9e7));}console[_0x4d7365(0xf2)]('\x20\x20'+a38_0x507e98[_0x4d7365(0x121)]('+\x20'+_0x184d0c[_0x4d7365(0xfd)]+'\x20new\x20files')),console['error']('\x20\x20'+a38_0x507e98[_0x4d7365(0xea)]('~\x20'+_0x545de8[_0x4d7365(0xfd)]+_0x4d7365(0x101))),console[_0x4d7365(0xf2)]('\x20\x20'+a38_0x507e98['dim']('=\x20'+_0x3bbf3e[_0x4d7365(0xfd)]+_0x4d7365(0xe4))),console[_0x4d7365(0xf2)](_0x4d7365(0x109)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5['targetDir'])+'\x0a');if(_0x545de8[_0x4d7365(0xfd)]>0x0)for(const _0x5f52ac of _0x545de8){console[_0x4d7365(0xf2)](_0x4d7365(0x110)+_0x5f52ac[_0x4d7365(0xe2)]+'\x27:'),console[_0x4d7365(0xf2)]('─'[_0x4d7365(0x11c)](0x3c)),console[_0x4d7365(0xf2)](_0x5f52ac[_0x4d7365(0x111)]),console[_0x4d7365(0xf2)]('─'[_0x4d7365(0x11c)](0x3c));}if(_0x5ba569[_0x4d7365(0xe9)])return console[_0x4d7365(0xf2)](a38_0x507e98['yellow'](_0x4d7365(0x115))),0x0;if(_0x184d0c[_0x4d7365(0xfd)]===0x0&&_0x545de8[_0x4d7365(0xfd)]===0x0)return console['error'](a38_0x507e98[_0x4d7365(0x121)](_0x4d7365(0xed))),saveSessionContext({'parent_segment':_0x6384d5[_0x4d7365(0xff)]},_0x5ba569['session']),console['error'](a38_0x507e98[_0x4d7365(0x121)]('✔\x20Context\x20set:\x20'+a38_0x507e98[_0x4d7365(0x106)](_0x4d7365(0x118))+_0x4d7365(0xf8)+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xff)]))),0x0;if(!_0x5ba569[_0x4d7365(0x10e)]){if(!isInteractive())return console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x12d)](_0x4d7365(0x120)),_0x4d7365(0x11d)),console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x106)](_0x4d7365(0xf7))),0x1;const _0x57ccb5=await confirmKey(_0x4d7365(0x10d)+(_0x184d0c[_0x4d7365(0xfd)]+_0x545de8['length'])+_0x4d7365(0x12c));if(!_0x57ccb5)return console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0xea)](_0x4d7365(0x10f)),_0x4d7365(0x104)),0x1;}for(const _0x37c26b of _0x6384d5['files']){if(_0x37c26b[_0x4d7365(0xe1)]||_0x37c26b[_0x4d7365(0x124)]){const _0x3bded7=a38_0x1baa51[_0x4d7365(0xde)](_0x37c26b['absolutePath']);!existsSync(_0x3bded7)&&mkdirSync(_0x3bded7,{'recursive':!![]}),writeFileSync(_0x37c26b['absolutePath'],_0x37c26b[_0x4d7365(0x100)],_0x4d7365(0x10c));}}return console[_0x4d7365(0xf2)](a38_0x507e98['green'](_0x4d7365(0xe7)+(_0x184d0c[_0x4d7365(0xfd)]+_0x545de8['length'])+_0x4d7365(0x129)+_0x6384d5[_0x4d7365(0x128)])),saveSessionContext({'parent_segment':_0x6384d5['parentName']},_0x5ba569[_0x4d7365(0xec)]),console[_0x4d7365(0xf2)](a38_0x507e98[_0x4d7365(0x121)](_0x4d7365(0xfa)+a38_0x507e98[_0x4d7365(0x106)](_0x4d7365(0x118))+'\x20=\x20'+a38_0x507e98[_0x4d7365(0x122)](_0x6384d5[_0x4d7365(0xff)]))),0x0;}}
@@ -1 +1 @@
1
- const a39_0x1569de=a39_0x3316;(function(_0x30112c,_0xe5d502){const _0x24458b=a39_0x3316,_0x1ce27c=_0x30112c();while(!![]){try{const _0x39f6cf=parseInt(_0x24458b(0x156))/0x1+parseInt(_0x24458b(0x157))/0x2*(parseInt(_0x24458b(0x14f))/0x3)+parseInt(_0x24458b(0x15a))/0x4+-parseInt(_0x24458b(0x197))/0x5+parseInt(_0x24458b(0x139))/0x6+-parseInt(_0x24458b(0x1b9))/0x7*(parseInt(_0x24458b(0x142))/0x8)+parseInt(_0x24458b(0x184))/0x9;if(_0x39f6cf===_0xe5d502)break;else _0x1ce27c['push'](_0x1ce27c['shift']());}catch(_0x1d001c){_0x1ce27c['push'](_0x1ce27c['shift']());}}}(a39_0x5808,0xa24fe));function a39_0x3316(_0x5b70ca,_0x36e1a1){_0x5b70ca=_0x5b70ca-0x135;const _0x5808b1=a39_0x5808();let _0x33160d=_0x5808b1[_0x5b70ca];return _0x33160d;}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 a39_0x35cc63 from'chalk';import{existsSync}from'fs';function a39_0x5808(){const _0x11a063=['2194656JAPYnm','helpText','segments','getJourney','created','execute','paused','Folders\x20to\x20create:','description','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Aborted.','new','versionNumber','results','nameToId','Resolving\x20parent\x20segment\x20\x27','get','.yml','\x0a✔\x20Push\x20complete','existingJourney','\x20YAML\x20files\x20found','activations','join','\x0aValidation\x20failed:','segmentFolderId','parentFolder','errorCode','error','\x20\x20Activations:\x20','journeyId','parentName','parent_name','yes','createdAt','audienceId','Delete\x20segment:','\x20new','filePath','segment','endsWith','resolveParentId','file','9927198xeiipg','\x0aPush\x20summary\x20for\x20\x27','user','verbose','\x27...','listSegments','setPhase','segment\x20or\x20journey','yellow','repeat','Push\x20','Changes\x20to:','message','\x20to\x20delete','toUpdate','getParent','push','Error:\x20','isNew','6479345xOdsnT','dryRun','green','name','folderId','targetDir','journeyBundleId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Delete\x20journey:','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x20\x20Activations:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','map','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','.yaml','changed','/app/ps/','\x20updated','connection','set','delete','/sb/da/esr','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20Segments:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','folderPath','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','red','state','existingSegment','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','updated','Site:\x20','623ITYDxv','all','(Journey\x20will\x20be\x20deleted)','toCreate','toDelete','site','\x20\x20\x20\x20','journey','then','\x20\x20📊\x20Segments:','data','idToName','\x20changed','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','cyan','journeys','\x20to\x20create','getOutputSchemaWithCache','scopedFolderPath','Changes\x20to\x20journey:','journeysOnly','1648902iltNey','toString','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20deleted','length','diff','Fetching\x20existing\x20data...','yamlConfig','\x20created','44168FXrBCH','attributes','\x20changes?','createdSegmentIds','\x20unchanged','\x20\x20Journeys:\x20','Scoped\x20to\x20folder:\x20','Source\x20directory:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20folders\x20to\x20create','journeyBundleName','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','7308vFOHIs','/e/','No\x20','dim','\x0aError:','\x20\x20Source:\x20','unchanged','418381SspjeS','88zbPmIF','list','buildUserMaps'];a39_0x5808=function(){return _0x11a063;};return a39_0x5808();}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{[a39_0x1569de(0x19a)]='segment:push';[a39_0x1569de(0x162)]=a39_0x1569de(0x13b);async[a39_0x1569de(0x15f)](_0x4deded){const _0x58e525=a39_0x1569de,{options:_0x430a5d,args:_0x565b02,tdx:_0x42a1fa}=_0x4deded,_0x88b10a=_0x430a5d,_0x2d5b45=await resolveTarget({'arg':_0x565b02[0x0],'contextParent':_0x430a5d['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2d5b45))return _0x2d5b45[_0x58e525(0x174)]==='no_parent'?(console[_0x58e525(0x175)](a39_0x35cc63['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x58e525(0x175)](_0x58e525(0x1a0)),console[_0x58e525(0x175)](_0x58e525(0x1b0)),console[_0x58e525(0x175)](_0x58e525(0x1a4))):(console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x195)+_0x2d5b45['message']+'\x0a')),_0x2d5b45['helpText']&&console['error'](a39_0x35cc63[_0x58e525(0x1c7)](_0x2d5b45[_0x58e525(0x15b)]))),0x1;if(_0x2d5b45['type']===_0x58e525(0x179))return console['error'](a39_0x35cc63[_0x58e525(0x1b3)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2d5b45[_0x58e525(0x19c)]+'\x0a')),console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1c7)](_0x58e525(0x1b2))),0x1;const _0x162a71=_0x2d5b45[_0x58e525(0x178)],_0x5a44f3=_0x2d5b45[_0x58e525(0x19c)],_0x8ee431=_0x2d5b45['type']===_0x58e525(0x183)?_0x2d5b45[_0x58e525(0x17f)]:undefined,_0x5a6925=getScopedDetails(_0x2d5b45),_0x124fa3=_0x5a6925?.['isScoped']??![],_0x435185=_0x5a6925?.[_0x58e525(0x136)]??'';if(!existsSync(_0x5a44f3))return console[_0x58e525(0x175)](a39_0x35cc63['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x5a44f3+'\x0a')),console[_0x58e525(0x175)](a39_0x35cc63['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x88b10a['verbose']&&(console[_0x58e525(0x175)](_0x58e525(0x1b8)+_0x88b10a[_0x58e525(0x1be)]),console['error']('Parent\x20segment:\x20'+_0x162a71),console[_0x58e525(0x175)](_0x58e525(0x149)+_0x5a44f3),_0x124fa3&&console[_0x58e525(0x175)](_0x58e525(0x148)+_0x435185));const _0x2891b1=await withSpinner(_0x58e525(0x169)+_0x162a71+_0x58e525(0x188),()=>_0x42a1fa[_0x58e525(0x180)][_0x58e525(0x182)](_0x162a71),{'verbose':_0x88b10a[_0x58e525(0x187)]}),_0x5ccc52=_0x2891b1[_0x58e525(0x1c3)],{parentSegmentResult:_0x1077cc,segmentsResult:_0x322ac0,foldersResult:_0x8de6fc,journeysWithDetailsResult:_0x4b84cc,userMaps:_0x1e4ec8}=await withSpinner(_0x58e525(0x13f),async()=>{const _0x542f79=_0x58e525,[_0x110e4e,_0x27ea13,_0x1b8d45,_0x25ed5f,_0x2b6a6]=await Promise[_0x542f79(0x1ba)]([_0x42a1fa[_0x542f79(0x180)][_0x542f79(0x193)](_0x5ccc52),_0x42a1fa[_0x542f79(0x180)][_0x542f79(0x189)](_0x5ccc52),_0x42a1fa['segment']['listFolders'](_0x5ccc52),_0x42a1fa[_0x542f79(0x1c0)]['listJourneysWithDetailsFromParentSegment'](_0x5ccc52,{'includeAllVersions':!![]}),_0x42a1fa['user'][_0x542f79(0x159)]()]);return{'parentSegmentResult':_0x110e4e,'segmentsResult':_0x27ea13,'foldersResult':_0x1b8d45,'journeysWithDetailsResult':_0x25ed5f,'userMaps':_0x2b6a6};},{'verbose':_0x88b10a[_0x58e525(0x187)]})[_0x58e525(0x1c1)](_0x4b5f71=>_0x4b5f71[_0x58e525(0x1c3)]),_0x5b0c0d=_0x1077cc,_0x2cfc7c=extractRootFolderId(_0x5b0c0d),_0x21cc44=_0x322ac0,_0x1bd8f3=_0x8de6fc,{journeys:_0x54c119,activationStepsById:_0x176b7a}=_0x4b84cc,_0x111d38=new Map(_0x54c119[_0x58e525(0x1a3)](_0x5e13c7=>[_0x5e13c7['id'],_0x5e13c7])),_0x22a781=_0x54c119[_0x58e525(0x1a3)](_0xaff2a5=>({'id':_0xaff2a5['id'],'name':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x19a)],'journeyBundleName':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x14c)]||'','journeyBundleId':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x19d)]||'','versionNumber':_0xaff2a5['attributes'][_0x58e525(0x166)],'description':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x162)],'state':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x1b4)],'paused':_0xaff2a5['attributes'][_0x58e525(0x160)],'audienceId':_0xaff2a5['attributes'][_0x58e525(0x17c)],'folderId':_0xaff2a5['relationships']?.[_0x58e525(0x173)]?.['data']?.['id'],'createdAt':_0xaff2a5[_0x58e525(0x143)][_0x58e525(0x17b)],'updatedAt':_0xaff2a5[_0x58e525(0x143)]['updatedAt']})),{emailToId:_0x3f1b14,idToEmail:_0xfb29f2}=_0x1e4ec8,_0x198991=await withSpinner(_0x58e525(0x1ae),async()=>{const _0x2cadfb=_0x58e525,_0x1dc9c7=await _0x42a1fa[_0x2cadfb(0x1aa)][_0x2cadfb(0x158)]();return buildConnectionMaps(_0x1dc9c7);},{'verbose':_0x88b10a['verbose']})[_0x58e525(0x1c1)](_0x5e5c0c=>_0x5e5c0c[_0x58e525(0x1c3)]),_0x273f88=_0x198991[_0x58e525(0x168)],_0x28b01d=_0x198991[_0x58e525(0x1c4)],_0x2a54f8=_0x198991['nameToType'],_0x524019={'emailToIdMap':_0x3f1b14,'connectionNameToIdMap':_0x273f88,'connectionNameToTypeMap':_0x2a54f8,'getSchema':_0xd5b2de=>_0x42a1fa[_0x58e525(0x1aa)][_0x58e525(0x135)](_0xd5b2de)};let {pathToId:_0xc06337,idToPath:_0x5994af}=buildFolderMaps(_0x1bd8f3);const _0x2767da=buildSegmentLookupMap(_0x21cc44,_0x5994af),_0x1ea51b=buildSegmentNameToIdMap(_0x21cc44),_0x34329c=buildJourneyBundleLookupMap(_0x22a781,_0x5994af);let _0x34c096;if(_0x8ee431){if(!_0x8ee431[_0x58e525(0x181)](_0x58e525(0x16b))&&!_0x8ee431[_0x58e525(0x181)](_0x58e525(0x1a6)))return console['error'](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x1a2)+_0x8ee431+'\x0a')),0x1;_0x34c096=[_0x8ee431];}else _0x34c096=findYamlFiles(_0x5a44f3);if(_0x34c096[_0x58e525(0x13d)]===0x0)return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5a44f3+'\x0a')),console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1c7)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x2d4786,_0x4c3e8e;try{const _0x1f21f1=parseAndClassifyYamlFiles(_0x34c096,_0x5a44f3,{'skipSegments':_0x88b10a['journeysOnly']});_0x2d4786=_0x1f21f1[_0x58e525(0x15c)],_0x4c3e8e=_0x1f21f1[_0x58e525(0x1c8)];const _0x56fb4d=validateParsedFiles(_0x1f21f1,_0x5a44f3);if(_0x56fb4d[_0x58e525(0x13d)]>0x0)return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x171))),console[_0x58e525(0x175)](formatValidationErrors(_0x56fb4d)),console[_0x58e525(0x175)](a39_0x35cc63['yellow'](_0x58e525(0x14a))),0x1;}catch(_0x5b1da4){return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)]('Error\x20parsing\x20YAML:\x20'+(_0x5b1da4 instanceof Error?_0x5b1da4[_0x58e525(0x190)]:_0x5b1da4))),0x1;}if(_0x2d4786['length']===0x0&&_0x4c3e8e[_0x58e525(0x13d)]===0x0){const _0x462cae=_0x88b10a['journeysOnly']?'journey':_0x58e525(0x18b);return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x18c)](_0x58e525(0x151)+_0x462cae+_0x58e525(0x16e))),0x0;}const _0x4fd4cf=new Map();_0x21cc44['length']>0x0&&!_0x88b10a['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x21cc44,async _0x4781b0=>{const _0xc811fa=a39_0x3316,_0x2fd252=await _0x42a1fa[_0xc811fa(0x180)]['listActivations'](_0x5ccc52,_0x4781b0['id']);_0x4fd4cf['set'](_0x4781b0['id'],_0x2fd252);});},{'verbose':_0x88b10a['verbose']});const {segmentFiles:_0x596bbf,foldersToCreate:_0x1cf1fa}=await prepareSegmentFiles(_0x2d4786,{'segmentByFolderAndName':_0x2767da,'activationsBySegmentId':_0x4fd4cf,'folderPathToId':_0xc06337,'idToEmailMap':_0xfb29f2,'connectionIdToNameMap':_0x28b01d},_0x524019,_0x124fa3,_0x435185),_0x1c04bc=_0x8ee431?[]:findSegmentsToDelete(_0x21cc44,_0x2d4786[_0x58e525(0x1a3)](({yamlConfig:_0x30a95f,folderPath:_0xe44599})=>({'yamlConfig':_0x30a95f,'folderPath':resolveTDFolderPath(_0xe44599,_0x124fa3,_0x435185)})),_0x5994af,_0x435185,_0x124fa3),{journeyFiles:_0x542cbb,foldersToCreate:_0xe6c8f0}=await withProgressSpinner('Preparing\x20journeys...',async _0x2b44ca=>prepareJourneyFiles(_0x4c3e8e,{'fetchJourney':async _0x23e260=>_0x42a1fa[_0x58e525(0x1c0)][_0x58e525(0x15d)](_0x23e260[_0x58e525(0x177)]),'journeyBundlesByFolderAndName':_0x34329c,'folderPathToId':_0xc06337,'idToEmailMap':_0xfb29f2,'connectionIdToNameMap':_0x28b01d,'existingSegments':_0x21cc44,'parentId':_0x5ccc52,'deps':_0x42a1fa,'progress':{'update':_0x259cdd=>{const _0x169131=_0x58e525;_0x2b44ca[_0x169131(0x18a)](_0x259cdd),_0x88b10a['verbose']&&console['error']('\x20\x20'+_0x259cdd);}},'journeyById':_0x111d38,'activationStepsById':_0x176b7a},_0x124fa3,_0x435185),{'verbose':_0x88b10a[_0x58e525(0x187)]})[_0x58e525(0x1c1)](_0x3c7a86=>_0x3c7a86['data']);for(const _0xbaa1e1 of _0xe6c8f0){_0x1cf1fa['add'](_0xbaa1e1);}const _0x16cd53=_0x8ee431?[]:findJourneysToDelete(_0x22a781,_0x4c3e8e[_0x58e525(0x1a3)](({yamlConfig:_0x30a3f8,folderPath:_0x401379})=>({'yamlConfig':_0x30a3f8,'folderPath':resolveTDFolderPath(_0x401379,_0x124fa3,_0x435185)})),_0x5994af,_0x435185,_0x124fa3),_0x58ee3f=calculatePushStats(_0x596bbf,_0x542cbb,_0x1cf1fa,_0x1c04bc,_0x16cd53,!!_0x88b10a['delete'],!!_0x88b10a[_0x58e525(0x138)]),_0x478621=_0x58ee3f['segments'][_0x58e525(0x165)],_0x439c29=_0x58ee3f[_0x58e525(0x15c)][_0x58e525(0x1a7)],_0x4df780=_0x58ee3f[_0x58e525(0x15c)][_0x58e525(0x155)],_0x281ffd=_0x58ee3f[_0x58e525(0x15c)][_0x58e525(0x1bd)],_0x1c663f=_0x58ee3f['folders'][_0x58e525(0x1bc)],_0x1e07cd=_0x58ee3f[_0x58e525(0x1c8)][_0x58e525(0x165)],_0x34666e=_0x58ee3f[_0x58e525(0x1c8)]['changed'],_0x1a11f0=_0x58ee3f[_0x58e525(0x1c8)]['unchanged'],_0x30f65d=_0x58ee3f[_0x58e525(0x1c8)][_0x58e525(0x1bd)],_0x1b6f16=_0x58ee3f[_0x58e525(0x16f)][_0x58e525(0x1ba)],_0x11b6e6=_0x58ee3f[_0x58e525(0x16f)][_0x58e525(0x1bc)],_0xb4e5a7=_0x58ee3f[_0x58e525(0x16f)][_0x58e525(0x192)],_0x5d7d73=_0x58ee3f[_0x58e525(0x16f)][_0x58e525(0x1bd)];console[_0x58e525(0x175)](_0x58e525(0x185)+_0x162a71+'\x27:');_0x1c663f[_0x58e525(0x13d)]>0x0&&console[_0x58e525(0x175)]('\x20\x20'+a39_0x35cc63['blue']('📁\x20'+_0x1c663f[_0x58e525(0x13d)]+_0x58e525(0x14b)));if(!_0x88b10a['journeysOnly']){console[_0x58e525(0x175)](_0x58e525(0x1c2)),console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x199)]('+\x20'+_0x478621[_0x58e525(0x13d)]+_0x58e525(0x17e))),console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x18c)]('~\x20'+_0x439c29[_0x58e525(0x13d)]+_0x58e525(0x1c5)));if(_0x281ffd[_0x58e525(0x13d)]>0x0)console['error']('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x1b3)]('-\x20'+_0x281ffd[_0x58e525(0x13d)]+_0x58e525(0x191)));else _0x1c04bc[_0x58e525(0x13d)]>0x0&&!_0x88b10a['delete']&&console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x152)](_0x1c04bc['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x58e525(0x175)]('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x152)]('=\x20'+_0x4df780['length']+_0x58e525(0x146)));}if(_0x542cbb[_0x58e525(0x13d)]>0x0||_0x16cd53[_0x58e525(0x13d)]>0x0){console[_0x58e525(0x175)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x199)]('+\x20'+_0x1e07cd[_0x58e525(0x13d)]+_0x58e525(0x17e))),console['error'](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x18c)]('~\x20'+_0x34666e[_0x58e525(0x13d)]+_0x58e525(0x1c5)));if(_0x30f65d[_0x58e525(0x13d)]>0x0)console['error'](_0x58e525(0x1bf)+a39_0x35cc63['red']('-\x20'+_0x30f65d['length']+'\x20to\x20delete'));else _0x16cd53[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x1ac)]&&console['error']('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x152)](_0x16cd53['length']+_0x58e525(0x19e)));console[_0x58e525(0x175)]('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x152)]('=\x20'+_0x1a11f0[_0x58e525(0x13d)]+_0x58e525(0x146)));}_0x1b6f16[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)]&&(console[_0x58e525(0x175)](''),console['error'](_0x58e525(0x1a1)),_0x11b6e6['length']>0x0&&console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x199)]('+\x20'+_0x11b6e6[_0x58e525(0x13d)]+_0x58e525(0x1c9))),_0xb4e5a7[_0x58e525(0x13d)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x35cc63[_0x58e525(0x18c)]('~\x20'+_0xb4e5a7[_0x58e525(0x13d)]+'\x20to\x20update')),_0x5d7d73[_0x58e525(0x13d)]>0x0&&console[_0x58e525(0x175)](_0x58e525(0x1bf)+a39_0x35cc63[_0x58e525(0x1b3)]('-\x20'+_0x5d7d73[_0x58e525(0x13d)]+'\x20to\x20delete')));console[_0x58e525(0x175)](_0x58e525(0x154)+a39_0x35cc63[_0x58e525(0x1c7)](_0x5a44f3)+'\x0a');if(_0x1c663f[_0x58e525(0x13d)]>0x0){console['error'](_0x58e525(0x161));for(const _0x2875e3 of _0x1c663f){console[_0x58e525(0x175)]('\x20\x20'+a39_0x35cc63['blue']('+')+'\x20'+_0x2875e3);}console[_0x58e525(0x175)]('');}if(_0x478621[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)])for(const _0x377273 of _0x478621){const _0x15affd=_0x377273['folderPath']?_0x377273[_0x58e525(0x1b1)]+'/'+_0x377273[_0x58e525(0x140)][_0x58e525(0x19a)]:_0x377273[_0x58e525(0x140)][_0x58e525(0x19a)],_0x2d6585=_0x377273[_0x58e525(0x140)][_0x58e525(0x16f)]?.[_0x58e525(0x13d)]||0x0,_0x32e853=_0x2d6585>0x0?a39_0x35cc63['dim']('\x20['+_0x2d6585+'\x20activations]'):'';console[_0x58e525(0x175)]('\x0a'+a39_0x35cc63[_0x58e525(0x199)]('New\x20segment:')+'\x20'+_0x15affd+_0x32e853),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c)),_0x377273[_0x58e525(0x13e)]&&console[_0x58e525(0x175)](_0x377273[_0x58e525(0x13e)]),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c));}if(_0x281ffd[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)])for(const _0x573216 of _0x281ffd){const _0x500b5f=_0x573216[_0x58e525(0x172)]?_0x5994af['get'](_0x573216['segmentFolderId'][_0x58e525(0x13a)]())||'':'',_0x58eb9f=_0x500b5f?_0x500b5f+'/'+_0x573216[_0x58e525(0x19a)]:_0x573216[_0x58e525(0x19a)],_0x459a09=_0x4fd4cf[_0x58e525(0x16a)](_0x573216['id'])||[],_0x20f43a=_0x459a09[_0x58e525(0x13d)]>0x0?a39_0x35cc63[_0x58e525(0x152)]('\x20['+_0x459a09[_0x58e525(0x13d)]+'\x20activations]'):'';console['error']('\x0a'+a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x17d))+'\x20'+_0x58eb9f+_0x20f43a),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c));const _0x523b53=segmentWithActivationsToYaml(_0x573216,_0x459a09,undefined,_0xfb29f2,_0x28b01d),_0x5ed82b=segmentToYamlString(_0x523b53),_0x46c038=generateDiff(_0x5ed82b,'');console[_0x58e525(0x175)](formatDiffWithColors(_0x46c038)),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c));}const _0x3f2e20=_0x596bbf['filter'](_0xbec231=>!_0xbec231[_0x58e525(0x196)]&&_0xbec231['diff']);if(_0x3f2e20[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)])for(const _0x5b7bfd of _0x3f2e20){const _0x58a7a6=_0x5b7bfd[_0x58e525(0x1b1)]?_0x5b7bfd[_0x58e525(0x1b1)]+'/'+_0x5b7bfd[_0x58e525(0x140)][_0x58e525(0x19a)]:_0x5b7bfd[_0x58e525(0x140)][_0x58e525(0x19a)];console[_0x58e525(0x175)]('\x0a'+a39_0x35cc63[_0x58e525(0x18c)](_0x58e525(0x18f))+'\x20'+_0x58a7a6),console[_0x58e525(0x175)]('─'['repeat'](0x3c)),console[_0x58e525(0x175)](_0x5b7bfd[_0x58e525(0x13e)]),console['error']('─'['repeat'](0x3c));}if(_0x1e07cd['length']>0x0)for(const _0x10ba41 of _0x1e07cd){const _0x458a91=_0x10ba41[_0x58e525(0x1b1)]?_0x10ba41[_0x58e525(0x1b1)]+'/'+_0x10ba41[_0x58e525(0x140)][_0x58e525(0x19a)]:_0x10ba41['yamlConfig']['name'];console[_0x58e525(0x175)]('\x0a'+a39_0x35cc63[_0x58e525(0x199)]('New\x20journey:')+'\x20'+_0x458a91),console['error']('─'[_0x58e525(0x18d)](0x3c)),_0x10ba41[_0x58e525(0x13e)]&&console[_0x58e525(0x175)](_0x10ba41[_0x58e525(0x13e)]),console[_0x58e525(0x175)]('─'['repeat'](0x3c));}const _0xbae575=_0x542cbb['filter'](_0x7bdfc8=>!_0x7bdfc8[_0x58e525(0x196)]&&_0x7bdfc8[_0x58e525(0x13e)]);if(_0xbae575[_0x58e525(0x13d)]>0x0)for(const _0x35a0d0 of _0xbae575){const _0x3bd14f=_0x35a0d0[_0x58e525(0x1b1)]?_0x35a0d0[_0x58e525(0x1b1)]+'/'+_0x35a0d0[_0x58e525(0x140)][_0x58e525(0x19a)]:_0x35a0d0[_0x58e525(0x140)]['name'];console['error']('\x0a'+a39_0x35cc63['yellow'](_0x58e525(0x137))+'\x20'+_0x3bd14f),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c)),console[_0x58e525(0x175)](_0x35a0d0[_0x58e525(0x13e)]),console['error']('─'[_0x58e525(0x18d)](0x3c));}if(_0x30f65d['length']>0x0)for(const _0x590ba7 of _0x30f65d){const _0x5b4575=_0x590ba7[_0x58e525(0x19b)]?_0x5994af['get'](_0x590ba7[_0x58e525(0x19b)])||'':'',_0x83101d=_0x5b4575?_0x5b4575+'/'+_0x590ba7['journeyBundleName']:_0x590ba7['journeyBundleName'];console['error']('\x0a'+a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x19f))+'\x20'+_0x83101d),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c)),console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x1bb))),console[_0x58e525(0x175)]('─'[_0x58e525(0x18d)](0x3c));}if(_0x88b10a[_0x58e525(0x198)])return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x18c)](_0x58e525(0x1c6))),0x0;const _0xb25d93=_0x88b10a[_0x58e525(0x138)]?![]:_0x478621['length']>0x0||_0x439c29['length']>0x0||_0x281ffd[_0x58e525(0x13d)]>0x0,_0x3c1761=_0x1e07cd[_0x58e525(0x13d)]>0x0||_0x34666e['length']>0x0||_0x30f65d[_0x58e525(0x13d)]>0x0,_0x4346f6=_0x88b10a[_0x58e525(0x138)]?![]:_0x1b6f16[_0x58e525(0x13d)]>0x0,_0x320ed4=_0x1c663f['length']>0x0;if(!_0xb25d93&&!_0x3c1761&&!_0x4346f6&&!_0x320ed4){const _0xc9bcc0=_0x88b10a[_0x58e525(0x138)]?_0x58e525(0x14e):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x199)](_0xc9bcc0));if(_0x8ee431&&_0x4df780[_0x58e525(0x13d)]===0x1){const _0x1ecf53=_0x4df780[0x0];if(_0x1ecf53[_0x58e525(0x1b5)]?.['id']){const _0x7f4410=getConsoleNextUrl(_0x88b10a[_0x58e525(0x1be)],'/app/ps/'+_0x5ccc52+'/e/'+_0x1ecf53['existingSegment']['id']+_0x58e525(0x1ad));console[_0x58e525(0x175)](_0x58e525(0x1b6)+a39_0x35cc63[_0x58e525(0x1c7)](_0x7f4410));}}if(_0x8ee431&&_0x1a11f0[_0x58e525(0x13d)]===0x1){const _0xa6cef8=_0x1a11f0[0x0];if(_0xa6cef8[_0x58e525(0x16d)]?.['id']){const _0x3aa35c=getConsoleNextUrl(_0x88b10a[_0x58e525(0x1be)],'/app/ps/'+_0x5ccc52+_0x58e525(0x150)+_0xa6cef8[_0x58e525(0x16d)]['id']+'/j/da/je');console[_0x58e525(0x175)]('\x20\x20'+a39_0x35cc63[_0x58e525(0x1c7)](_0x3aa35c));}}return 0x0;}const _0x1504bd=_0x88b10a[_0x58e525(0x138)]?_0x1e07cd['length']+_0x34666e['length']+_0x30f65d[_0x58e525(0x13d)]+_0x1c663f[_0x58e525(0x13d)]:_0x478621[_0x58e525(0x13d)]+_0x439c29['length']+_0x281ffd[_0x58e525(0x13d)]+_0x1e07cd[_0x58e525(0x13d)]+_0x34666e['length']+_0x30f65d[_0x58e525(0x13d)]+_0x1c663f[_0x58e525(0x13d)]+_0x1b6f16[_0x58e525(0x13d)];if(!_0x88b10a[_0x58e525(0x17a)]&&_0x1504bd>0x0){if(!isInteractive())return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)](_0x58e525(0x153)),_0x58e525(0x163)),console[_0x58e525(0x175)](a39_0x35cc63['dim'](_0x58e525(0x1a5))),0x1;const _0x169809=await confirmKey(_0x58e525(0x18e)+_0x1504bd+_0x58e525(0x144));if(!_0x169809)return console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x18c)](_0x58e525(0x164))),0x1;}const _0x27e7eb={'withProgress':async(_0x5149f3,_0x1acdde)=>{const _0x3bf180=_0x58e525,_0x1c5786=await withSpinner(_0x5149f3,_0x1acdde,{'verbose':_0x88b10a[_0x3bf180(0x187)]});return{'data':_0x1c5786[_0x3bf180(0x1c3)]};},'logInfo':_0x54b09c=>console[_0x58e525(0x175)](a39_0x35cc63['blue']('✔\x20'+_0x54b09c)),'logSuccess':_0x31eb50=>console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x199)]('✔\x20'+_0x31eb50)),'logWarning':_0x4836e2=>console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x18c)]('⚠\x20'+_0x4836e2)),'logDeleted':_0x3f1c06=>console[_0x58e525(0x175)](a39_0x35cc63[_0x58e525(0x1b3)]('✔\x20'+_0x3f1c06))},_0x867f78={'segment':_0x42a1fa['segment'],'journey':_0x42a1fa[_0x58e525(0x1c0)],'user':_0x42a1fa[_0x58e525(0x186)],'connection':_0x42a1fa[_0x58e525(0x1aa)]};_0x1c663f[_0x58e525(0x13d)]>0x0&&(_0xc06337=await executePushFolders(_0x867f78,_0x1c663f,_0xc06337,{'parentId':_0x5ccc52},_0x27e7eb));const _0x7abab9={'rootFolderId':_0x2cfc7c,'folderPathToId':_0xc06337,'folderIdToPath':_0x5994af,'segmentNameToId':_0x1ea51b,'activationsBySegmentId':_0x4fd4cf,'emailToIdMap':_0x3f1b14,'idToEmailMap':_0xfb29f2,'connectionNameToIdMap':_0x198991[_0x58e525(0x168)],'connectionIdToNameMap':_0x198991[_0x58e525(0x1c4)],'connectionNameToTypeMap':_0x2a54f8},_0x125cee=await executePushSegments(_0x867f78,_0x88b10a[_0x58e525(0x138)]?[]:_0x596bbf,_0x7abab9,{'parentId':_0x5ccc52},_0x27e7eb),_0x541a2e=_0x125cee[_0x58e525(0x15e)],_0x7bf1c=_0x125cee[_0x58e525(0x1b7)],_0x38d95f=_0x125cee[_0x58e525(0x16f)][_0x58e525(0x15e)],_0x1491d9=_0x125cee[_0x58e525(0x16f)][_0x58e525(0x1b7)],_0x2b43ea=_0x125cee['activations']['deleted'];let _0x1de317;if(_0x8ee431&&_0x596bbf['length']===0x1){const _0x2b6013=_0x596bbf[0x0];_0x1de317=_0x2b6013[_0x58e525(0x1b5)]?.['id']??_0x125cee[_0x58e525(0x145)][_0x58e525(0x16a)](_0x2b6013[_0x58e525(0x140)]['name']);}const _0x21119f=await executePushSegmentDeletions(_0x867f78,_0x88b10a['journeysOnly']?[]:_0x281ffd,_0x27e7eb);let _0x1cc6d0=0x0,_0x2ba41d=0x0,_0x29d73c=0x0;const _0x18e2f8=new Map(_0x1ea51b);for(const [_0xcd2e69,_0x3152b5]of _0x125cee['createdSegmentIds']){_0x18e2f8[_0x58e525(0x1ab)](_0xcd2e69,_0x3152b5);}if(_0x542cbb['length']>0x0){const _0x4e4384={..._0x7abab9,'segmentNameToId':_0x18e2f8,'existingSegments':_0x21cc44,'activationContext':_0x524019},_0x2d4209=await executePushJourneys(_0x867f78,_0x542cbb,_0x4e4384,{'parentId':_0x5ccc52,'rootFolderId':_0x2cfc7c,'verbose':_0x88b10a[_0x58e525(0x187)]},_0x27e7eb);_0x1cc6d0=_0x2d4209[_0x58e525(0x15e)],_0x2ba41d=_0x2d4209[_0x58e525(0x1b7)];if(_0x8ee431&&_0x2d4209[_0x58e525(0x167)][_0x58e525(0x13d)]===0x1){const _0x4acc65=_0x2d4209[_0x58e525(0x167)][0x0];if(_0x4acc65[_0x58e525(0x177)]){const _0x2b2a72=getConsoleNextUrl(_0x88b10a[_0x58e525(0x1be)],_0x58e525(0x1a8)+_0x5ccc52+_0x58e525(0x150)+_0x4acc65['journeyId']+'/j/da/je');console[_0x58e525(0x175)]('\x20\x20'+a39_0x35cc63['cyan'](_0x2b2a72));}}}for(const _0x478495 of _0x30f65d){console[_0x58e525(0x175)](a39_0x35cc63['yellow'](_0x58e525(0x14d)+_0x478495['journeyBundleName'])),_0x29d73c++;}const _0x5185cf=[];if(_0x541a2e>0x0)_0x5185cf[_0x58e525(0x194)](_0x541a2e+_0x58e525(0x141));if(_0x7bf1c>0x0)_0x5185cf[_0x58e525(0x194)](_0x7bf1c+'\x20updated');if(_0x21119f>0x0)_0x5185cf[_0x58e525(0x194)](_0x21119f+_0x58e525(0x13c));const _0x15494f=[];if(_0x1cc6d0>0x0)_0x15494f[_0x58e525(0x194)](_0x1cc6d0+'\x20created');if(_0x2ba41d>0x0)_0x15494f[_0x58e525(0x194)](_0x2ba41d+_0x58e525(0x1a9));if(_0x29d73c>0x0)_0x15494f[_0x58e525(0x194)](_0x29d73c+_0x58e525(0x13c));const _0xb294c8=[];if(_0x38d95f>0x0)_0xb294c8[_0x58e525(0x194)](_0x38d95f+'\x20created');if(_0x1491d9>0x0)_0xb294c8[_0x58e525(0x194)](_0x1491d9+_0x58e525(0x1a9));if(_0x2b43ea>0x0)_0xb294c8['push'](_0x2b43ea+_0x58e525(0x13c));console['error'](a39_0x35cc63[_0x58e525(0x199)](_0x58e525(0x16c)));_0x5185cf['length']>0x0&&!_0x88b10a[_0x58e525(0x138)]&&console[_0x58e525(0x175)](_0x58e525(0x1af)+_0x5185cf[_0x58e525(0x170)](',\x20'));_0x15494f[_0x58e525(0x13d)]>0x0&&console[_0x58e525(0x175)](_0x58e525(0x147)+_0x15494f[_0x58e525(0x170)](',\x20'));_0xb294c8[_0x58e525(0x13d)]>0x0&&!_0x88b10a[_0x58e525(0x138)]&&console[_0x58e525(0x175)](_0x58e525(0x176)+_0xb294c8[_0x58e525(0x170)](',\x20'));if(_0x1de317){const _0x384ea6=getConsoleNextUrl(_0x88b10a[_0x58e525(0x1be)],_0x58e525(0x1a8)+_0x5ccc52+_0x58e525(0x150)+_0x1de317+_0x58e525(0x1ad));console['error'](_0x58e525(0x1b6)+a39_0x35cc63[_0x58e525(0x1c7)](_0x384ea6));}return 0x0;}}
1
+ const a39_0x2b9c18=a39_0x47dc;(function(_0x3b5a6b,_0x475f98){const _0x3b66d4=a39_0x47dc,_0x21021b=_0x3b5a6b();while(!![]){try{const _0x34c6c6=-parseInt(_0x3b66d4(0xf6))/0x1*(parseInt(_0x3b66d4(0x95))/0x2)+-parseInt(_0x3b66d4(0xb3))/0x3+-parseInt(_0x3b66d4(0xa1))/0x4*(-parseInt(_0x3b66d4(0xf3))/0x5)+parseInt(_0x3b66d4(0xd9))/0x6+parseInt(_0x3b66d4(0x10c))/0x7+-parseInt(_0x3b66d4(0xc3))/0x8*(parseInt(_0x3b66d4(0xcd))/0x9)+-parseInt(_0x3b66d4(0x93))/0xa*(-parseInt(_0x3b66d4(0x107))/0xb);if(_0x34c6c6===_0x475f98)break;else _0x21021b['push'](_0x21021b['shift']());}catch(_0x43fb15){_0x21021b['push'](_0x21021b['shift']());}}}(a39_0x29e8,0x48bff));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a39_0x47dc(_0x1db9a8,_0x1bf07b){_0x1db9a8=_0x1db9a8-0x92;const _0x29e8db=a39_0x29e8();let _0x47dc4c=_0x29e8db[_0x1db9a8];return _0x47dc4c;}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 a39_0x1bc6de 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';function a39_0x29e8(){const _0x4ca7d9=['7953cPIhDs','buildUserMaps','data','type','parentFolder','395689AJUONT','yes','Error\x20parsing\x20YAML:\x20','existingSegment','\x20unchanged','paused','New\x20journey:','\x20to\x20create','name','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','add','dryRun','Changes\x20to:','all','filter','Aborted.','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','audienceId','/e/','map','\x20\x20Source:\x20','Error:\x20','setPhase','\x0aPush\x20summary\x20for\x20\x27','\x20\x20\x20\x20','\x20changes?','list','updated','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','segment\x20or\x20journey','parent_name','\x20YAML\x20files\x20found','Folders\x20to\x20create:','\x20\x20Segments:\x20','toDelete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','versionNumber','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','idToName','Error:\x20Directory\x20not\x20found:\x20','created','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','getJourney','13010ZrOQSL','description','7358kvWpZV','\x0aError:','join','toUpdate','deleted','isNew','/sb/da/esr','Resolving\x20parent\x20segment\x20\x27','green','folderId','attributes','errorCode','490276itXZNw','resolveParentId','\x20new','filePath','site','nameToId','changed','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Source\x20directory:\x20','\x20to\x20delete','segmentFolderId','state','Preparing\x20journeys...','dim','activations','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)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','1383768sNdXNj','segment:push','Parent\x20segment:\x20','targetDir','file','\x20changed','yamlConfig','\x20\x20Activations:\x20','segment','red','length','new','toString','connection','results','delete','16PFnSdP','\x27...','.yml','get','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','yellow','error','\x0a✔\x20Push\x20complete','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeysOnly','2335653mLRsXd','parentName','createdSegmentIds','\x20activations]','\x20updated','Fetching\x20existing\x20data...','journeyBundleName','push','\x20folders\x20to\x20create','Push\x20','endsWith','isScoped','1436952DQYqFy','\x20\x20Activations:','Site:\x20','set','toCreate','New\x20segment:','journeyId','createdAt','no_parent','getParent','/app/ps/','user','getOutputSchemaWithCache','folderPath','then','repeat','\x20created','nameToType','Scoped\x20to\x20folder:\x20','diff','journeyBundleId','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','(Journey\x20will\x20be\x20deleted)','verbose','updatedAt','Delete\x20segment:','5ntTAiK','segments','journey','22MrofUW','/j/da/je','cwd','unchanged','execute','listActivations','relationships','cyan','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','helpText','Changes\x20to\x20journey:','blue','\x20deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','.yaml','journeys','existingJourney'];a39_0x29e8=function(){return _0x4ca7d9;};return a39_0x29e8();}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']=a39_0x2b9c18(0xb4);[a39_0x2b9c18(0x94)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a39_0x2b9c18(0xfa)](_0x39d945){const _0x53c215=a39_0x2b9c18,{options:_0x3699fb,args:_0x332666,tdx:_0x19185a}=_0x39d945,_0x357875=_0x3699fb,_0x365ff7=await resolveTarget({'arg':_0x332666[0x0],'contextParent':_0x3699fb['parentSegment'],'cwd':process[_0x53c215(0xf8)]()});if(!isSuccessfulResolution(_0x365ff7))return _0x365ff7[_0x53c215(0xa0)]===_0x53c215(0xe1)?(console['error'](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x128))),console[_0x53c215(0xc9)](_0x53c215(0xb0)),console['error'](_0x53c215(0x132)),console[_0x53c215(0xc9)](_0x53c215(0x130))):(console['error'](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x121)+_0x365ff7['message']+'\x0a')),_0x365ff7['helpText']&&console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x365ff7[_0x53c215(0xff)]))),0x1;if(_0x365ff7[_0x53c215(0x10a)]===_0x53c215(0x12b))return console['error'](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x134)+_0x365ff7['targetDir']+'\x0a')),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x53c215(0x103))),0x1;const _0x23eadb=_0x365ff7[_0x53c215(0xce)],_0x4fcdc2=_0x365ff7[_0x53c215(0xb6)],_0x2f2571=_0x365ff7[_0x53c215(0x10a)]===_0x53c215(0xb7)?_0x365ff7[_0x53c215(0xa4)]:undefined,_0x15d5d1=getScopedDetails(_0x365ff7),_0x57f142=_0x15d5d1?.[_0x53c215(0xd8)]??![],_0x2613fc=_0x15d5d1?.['scopedFolderPath']??'';if(!existsSync(_0x4fcdc2))return console['error'](a39_0x1bc6de['red'](_0x53c215(0x134)+_0x4fcdc2+'\x0a')),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x53c215(0x103))),0x1;_0x357875[_0x53c215(0xf0)]&&(console['error'](_0x53c215(0xdb)+_0x357875[_0x53c215(0xa5)]),console[_0x53c215(0xc9)](_0x53c215(0xb5)+_0x23eadb),console[_0x53c215(0xc9)](_0x53c215(0xa9)+_0x4fcdc2),_0x57f142&&console['error'](_0x53c215(0xeb)+_0x2613fc));const _0xe117bf=await withSpinner(_0x53c215(0x9c)+_0x23eadb+_0x53c215(0xc4),()=>_0x19185a['segment'][_0x53c215(0xa2)](_0x23eadb),{'verbose':_0x357875[_0x53c215(0xf0)]}),_0x2e7129=_0xe117bf[_0x53c215(0x109)],{parentSegmentResult:_0x1ab5e7,segmentsResult:_0x43d6f3,foldersResult:_0x5de8ed,journeysWithDetailsResult:_0x3f02f8,userMaps:_0x465ccf}=await withSpinner(_0x53c215(0xd2),async()=>{const _0x15e2a0=_0x53c215,[_0x3cae78,_0x212850,_0x14a32a,_0x27de00,_0x2944f1]=await Promise[_0x15e2a0(0x119)]([_0x19185a['segment'][_0x15e2a0(0xe2)](_0x2e7129),_0x19185a[_0x15e2a0(0xbb)]['listSegments'](_0x2e7129),_0x19185a[_0x15e2a0(0xbb)]['listFolders'](_0x2e7129),_0x19185a['journey']['listJourneysWithDetailsFromParentSegment'](_0x2e7129,{'includeAllVersions':!![]}),_0x19185a[_0x15e2a0(0xe4)][_0x15e2a0(0x108)]()]);return{'parentSegmentResult':_0x3cae78,'segmentsResult':_0x212850,'foldersResult':_0x14a32a,'journeysWithDetailsResult':_0x27de00,'userMaps':_0x2944f1};},{'verbose':_0x357875[_0x53c215(0xf0)]})[_0x53c215(0xe7)](_0x3477d8=>_0x3477d8[_0x53c215(0x109)]),_0x28cbae=_0x1ab5e7,_0x5628b6=extractRootFolderId(_0x28cbae),_0x30fd11=_0x43d6f3,_0x41f328=_0x5de8ed,{journeys:_0xca9fc,activationStepsById:_0x3f00a4}=_0x3f02f8,_0x59d085=new Map(_0xca9fc['map'](_0x29b7d3=>[_0x29b7d3['id'],_0x29b7d3])),_0x48d2f3=_0xca9fc['map'](_0x2bda9a=>({'id':_0x2bda9a['id'],'name':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0x114)],'journeyBundleName':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xd3)]||'','journeyBundleId':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xed)]||'','versionNumber':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0x131)],'description':_0x2bda9a['attributes'][_0x53c215(0x94)],'state':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xac)],'paused':_0x2bda9a['attributes'][_0x53c215(0x111)],'audienceId':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0x11d)],'folderId':_0x2bda9a[_0x53c215(0xfc)]?.[_0x53c215(0x10b)]?.[_0x53c215(0x109)]?.['id'],'createdAt':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xe0)],'updatedAt':_0x2bda9a[_0x53c215(0x9f)][_0x53c215(0xf1)]})),{emailToId:_0x21a1fc,idToEmail:_0x591757}=_0x465ccf,_0x265064=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x425f41=_0x53c215,_0x25c1b4=await _0x19185a[_0x425f41(0xc0)][_0x425f41(0x126)]();return buildConnectionMaps(_0x25c1b4);},{'verbose':_0x357875['verbose']})['then'](_0x2b45e6=>_0x2b45e6[_0x53c215(0x109)]),_0x26d8aa=_0x265064['nameToId'],_0x29128d=_0x265064[_0x53c215(0x133)],_0x215b8b=_0x265064[_0x53c215(0xea)],_0x1ce3d9={'emailToIdMap':_0x21a1fc,'connectionNameToIdMap':_0x26d8aa,'connectionNameToTypeMap':_0x215b8b,'getSchema':_0x3993ea=>_0x19185a[_0x53c215(0xc0)][_0x53c215(0xe5)](_0x3993ea)};let {pathToId:_0x5c4c14,idToPath:_0x4e476b}=buildFolderMaps(_0x41f328);const _0xad9031=buildSegmentLookupMap(_0x30fd11,_0x4e476b),_0xe605eb=buildSegmentNameToIdMap(_0x30fd11),_0x19307b=buildJourneyBundleLookupMap(_0x48d2f3,_0x4e476b);let _0x461e8e;if(_0x2f2571){if(!_0x2f2571['endsWith'](_0x53c215(0xc5))&&!_0x2f2571[_0x53c215(0xd7)](_0x53c215(0x104)))return console['error'](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x136)+_0x2f2571+'\x0a')),0x1;_0x461e8e=[_0x2f2571];}else _0x461e8e=findYamlFiles(_0x4fcdc2);if(_0x461e8e[_0x53c215(0xbd)]===0x0)return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x4fcdc2+'\x0a')),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xfd)](_0x53c215(0xee))),0x1;let _0x404a7f,_0x1437b1;try{const _0x404024=parseAndClassifyYamlFiles(_0x461e8e,_0x4fcdc2,{'skipSegments':_0x357875[_0x53c215(0xcc)]});_0x404a7f=_0x404024[_0x53c215(0xf4)],_0x1437b1=_0x404024['journeys'];const _0x4567cb=validateParsedFiles(_0x404024,_0x4fcdc2);if(_0x4567cb[_0x53c215(0xbd)]>0x0)return console[_0x53c215(0xc9)](a39_0x1bc6de['red']('\x0aValidation\x20failed:')),console[_0x53c215(0xc9)](formatValidationErrors(_0x4567cb)),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x115))),0x1;}catch(_0x366724){return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x10e)+(_0x366724 instanceof Error?_0x366724['message']:_0x366724))),0x1;}if(_0x404a7f['length']===0x0&&_0x1437b1[_0x53c215(0xbd)]===0x0){const _0x1194b7=_0x357875[_0x53c215(0xcc)]?_0x53c215(0xf5):_0x53c215(0x12a);return console[_0x53c215(0xc9)](a39_0x1bc6de['yellow']('No\x20'+_0x1194b7+_0x53c215(0x12c))),0x0;}const _0x44f9bd=new Map();_0x30fd11[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x30fd11,async _0x43cf08=>{const _0x3fe1e8=a39_0x47dc,_0x3067ab=await _0x19185a['segment'][_0x3fe1e8(0xfb)](_0x2e7129,_0x43cf08['id']);_0x44f9bd[_0x3fe1e8(0xdc)](_0x43cf08['id'],_0x3067ab);});},{'verbose':_0x357875[_0x53c215(0xf0)]});const {segmentFiles:_0x15aefc,foldersToCreate:_0xf77fdc}=await prepareSegmentFiles(_0x404a7f,{'segmentByFolderAndName':_0xad9031,'activationsBySegmentId':_0x44f9bd,'folderPathToId':_0x5c4c14,'idToEmailMap':_0x591757,'connectionIdToNameMap':_0x29128d},_0x1ce3d9,_0x57f142,_0x2613fc),_0x3fdef6=_0x2f2571?[]:findSegmentsToDelete(_0x30fd11,_0x404a7f[_0x53c215(0x11f)](({yamlConfig:_0x1307f2,folderPath:_0x1f2468})=>({'yamlConfig':_0x1307f2,'folderPath':resolveTDFolderPath(_0x1f2468,_0x57f142,_0x2613fc)})),_0x4e476b,_0x2613fc,_0x57f142),{journeyFiles:_0x45945b,foldersToCreate:_0x479c5e}=await withProgressSpinner(_0x53c215(0xad),async _0x3bdce5=>prepareJourneyFiles(_0x1437b1,{'fetchJourney':async _0x50b367=>_0x19185a[_0x53c215(0xf5)][_0x53c215(0x92)](_0x50b367[_0x53c215(0xdf)]),'journeyBundlesByFolderAndName':_0x19307b,'folderPathToId':_0x5c4c14,'idToEmailMap':_0x591757,'connectionIdToNameMap':_0x29128d,'existingSegments':_0x30fd11,'parentId':_0x2e7129,'deps':_0x19185a,'progress':{'update':_0x5521e3=>{const _0x60a45c=_0x53c215;_0x3bdce5[_0x60a45c(0x122)](_0x5521e3),_0x357875[_0x60a45c(0xf0)]&&console['error']('\x20\x20'+_0x5521e3);}},'journeyById':_0x59d085,'activationStepsById':_0x3f00a4},_0x57f142,_0x2613fc),{'verbose':_0x357875[_0x53c215(0xf0)]})['then'](_0x4e6873=>_0x4e6873[_0x53c215(0x109)]);for(const _0x7d1275 of _0x479c5e){_0xf77fdc[_0x53c215(0x116)](_0x7d1275);}const _0x2e474c=_0x2f2571?[]:findJourneysToDelete(_0x48d2f3,_0x1437b1[_0x53c215(0x11f)](({yamlConfig:_0xe53560,folderPath:_0x5ec383})=>({'yamlConfig':_0xe53560,'folderPath':resolveTDFolderPath(_0x5ec383,_0x57f142,_0x2613fc)})),_0x4e476b,_0x2613fc,_0x57f142),_0x3b49b6=calculatePushStats(_0x15aefc,_0x45945b,_0xf77fdc,_0x3fdef6,_0x2e474c,!!_0x357875[_0x53c215(0xc2)],!!_0x357875[_0x53c215(0xcc)]),_0x2aa937=_0x3b49b6[_0x53c215(0xf4)][_0x53c215(0xbe)],_0x5c7752=_0x3b49b6['segments'][_0x53c215(0xa7)],_0x2db4e0=_0x3b49b6[_0x53c215(0xf4)][_0x53c215(0xf9)],_0x2c1768=_0x3b49b6['segments']['toDelete'],_0x5c80b7=_0x3b49b6['folders'][_0x53c215(0xdd)],_0x249b48=_0x3b49b6['journeys'][_0x53c215(0xbe)],_0x24e8c3=_0x3b49b6[_0x53c215(0x105)][_0x53c215(0xa7)],_0x291fab=_0x3b49b6[_0x53c215(0x105)][_0x53c215(0xf9)],_0x4c27ff=_0x3b49b6[_0x53c215(0x105)][_0x53c215(0x12f)],_0x545b18=_0x3b49b6[_0x53c215(0xaf)][_0x53c215(0x119)],_0x32aa56=_0x3b49b6[_0x53c215(0xaf)][_0x53c215(0xdd)],_0x6c8142=_0x3b49b6['activations'][_0x53c215(0x98)],_0x120469=_0x3b49b6[_0x53c215(0xaf)][_0x53c215(0x12f)];console[_0x53c215(0xc9)](_0x53c215(0x123)+_0x23eadb+'\x27:');_0x5c80b7[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de['blue']('📁\x20'+_0x5c80b7[_0x53c215(0xbd)]+_0x53c215(0xd5)));if(!_0x357875[_0x53c215(0xcc)]){console[_0x53c215(0xc9)]('\x20\x20📊\x20Segments:'),console[_0x53c215(0xc9)]('\x20\x20\x20\x20'+a39_0x1bc6de[_0x53c215(0x9d)]('+\x20'+_0x2aa937[_0x53c215(0xbd)]+'\x20new')),console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xc8)]('~\x20'+_0x5c7752['length']+_0x53c215(0xb8)));if(_0x2c1768['length']>0x0)console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xbc)]('-\x20'+_0x2c1768[_0x53c215(0xbd)]+_0x53c215(0xaa)));else _0x3fdef6[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xc2)]&&console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de['dim'](_0x3fdef6[_0x53c215(0xbd)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xae)]('=\x20'+_0x2db4e0['length']+'\x20unchanged'));}if(_0x45945b[_0x53c215(0xbd)]>0x0||_0x2e474c[_0x53c215(0xbd)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0x9d)]('+\x20'+_0x249b48['length']+_0x53c215(0xa3))),console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de['yellow']('~\x20'+_0x24e8c3['length']+_0x53c215(0xb8)));if(_0x4c27ff['length']>0x0)console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de['red']('-\x20'+_0x4c27ff[_0x53c215(0xbd)]+_0x53c215(0xaa)));else _0x2e474c[_0x53c215(0xbd)]>0x0&&!_0x357875['delete']&&console['error']('\x20\x20\x20\x20'+a39_0x1bc6de[_0x53c215(0xae)](_0x2e474c['length']+_0x53c215(0xcb)));console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xae)]('=\x20'+_0x291fab[_0x53c215(0xbd)]+_0x53c215(0x110)));}_0x545b18[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&(console[_0x53c215(0xc9)](''),console[_0x53c215(0xc9)](_0x53c215(0xda)),_0x32aa56['length']>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x1bc6de[_0x53c215(0x9d)]('+\x20'+_0x32aa56['length']+_0x53c215(0x113))),_0x6c8142[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xc8)]('~\x20'+_0x6c8142['length']+'\x20to\x20update')),_0x120469[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)](_0x53c215(0x124)+a39_0x1bc6de[_0x53c215(0xbc)]('-\x20'+_0x120469[_0x53c215(0xbd)]+_0x53c215(0xaa))));console['error'](_0x53c215(0x120)+a39_0x1bc6de[_0x53c215(0xfd)](_0x4fcdc2)+'\x0a');if(_0x5c80b7[_0x53c215(0xbd)]>0x0){console[_0x53c215(0xc9)](_0x53c215(0x12d));for(const _0x25dd71 of _0x5c80b7){console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de[_0x53c215(0x101)]('+')+'\x20'+_0x25dd71);}console[_0x53c215(0xc9)]('');}if(_0x2aa937[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)])for(const _0x3797a2 of _0x2aa937){const _0x27b328=_0x3797a2[_0x53c215(0xe6)]?_0x3797a2[_0x53c215(0xe6)]+'/'+_0x3797a2['yamlConfig'][_0x53c215(0x114)]:_0x3797a2[_0x53c215(0xb9)][_0x53c215(0x114)],_0x4f1f82=_0x3797a2[_0x53c215(0xb9)][_0x53c215(0xaf)]?.[_0x53c215(0xbd)]||0x0,_0x35a5d4=_0x4f1f82>0x0?a39_0x1bc6de[_0x53c215(0xae)]('\x20['+_0x4f1f82+_0x53c215(0xd0)):'';console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de[_0x53c215(0x9d)](_0x53c215(0xde))+'\x20'+_0x27b328+_0x35a5d4),console['error']('─'[_0x53c215(0xe8)](0x3c)),_0x3797a2[_0x53c215(0xec)]&&console[_0x53c215(0xc9)](_0x3797a2[_0x53c215(0xec)]),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c));}if(_0x2c1768[_0x53c215(0xbd)]>0x0&&!_0x357875['journeysOnly'])for(const _0x2bce7f of _0x2c1768){const _0x28ab1c=_0x2bce7f[_0x53c215(0xab)]?_0x4e476b[_0x53c215(0xc6)](_0x2bce7f[_0x53c215(0xab)][_0x53c215(0xbf)]())||'':'',_0x135d36=_0x28ab1c?_0x28ab1c+'/'+_0x2bce7f['name']:_0x2bce7f[_0x53c215(0x114)],_0x4a371b=_0x44f9bd['get'](_0x2bce7f['id'])||[],_0x5491ab=_0x4a371b[_0x53c215(0xbd)]>0x0?a39_0x1bc6de['dim']('\x20['+_0x4a371b[_0x53c215(0xbd)]+_0x53c215(0xd0)):'';console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0xf2))+'\x20'+_0x135d36+_0x5491ab),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c));const _0x13342d=segmentWithActivationsToYaml(_0x2bce7f,_0x4a371b,undefined,_0x591757,_0x29128d),_0x52cf70=segmentToYamlString(_0x13342d),_0x10e560=generateDiff(_0x52cf70,'');console[_0x53c215(0xc9)](formatDiffWithColors(_0x10e560)),console[_0x53c215(0xc9)]('─'['repeat'](0x3c));}const _0x557c7d=_0x15aefc[_0x53c215(0x11a)](_0x22105e=>!_0x22105e[_0x53c215(0x9a)]&&_0x22105e[_0x53c215(0xec)]);if(_0x557c7d['length']>0x0&&!_0x357875[_0x53c215(0xcc)])for(const _0x446ce1 of _0x557c7d){const _0x29734d=_0x446ce1[_0x53c215(0xe6)]?_0x446ce1[_0x53c215(0xe6)]+'/'+_0x446ce1[_0x53c215(0xb9)][_0x53c215(0x114)]:_0x446ce1[_0x53c215(0xb9)][_0x53c215(0x114)];console['error']('\x0a'+a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x118))+'\x20'+_0x29734d),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c)),console[_0x53c215(0xc9)](_0x446ce1['diff']),console['error']('─'['repeat'](0x3c));}if(_0x249b48[_0x53c215(0xbd)]>0x0)for(const _0x2c3876 of _0x249b48){const _0x4be5e6=_0x2c3876['folderPath']?_0x2c3876[_0x53c215(0xe6)]+'/'+_0x2c3876[_0x53c215(0xb9)]['name']:_0x2c3876[_0x53c215(0xb9)][_0x53c215(0x114)];console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de['green'](_0x53c215(0x112))+'\x20'+_0x4be5e6),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c)),_0x2c3876[_0x53c215(0xec)]&&console['error'](_0x2c3876['diff']),console[_0x53c215(0xc9)]('─'['repeat'](0x3c));}const _0x590428=_0x45945b[_0x53c215(0x11a)](_0x4233ad=>!_0x4233ad[_0x53c215(0x9a)]&&_0x4233ad['diff']);if(_0x590428['length']>0x0)for(const _0x280388 of _0x590428){const _0x175942=_0x280388['folderPath']?_0x280388[_0x53c215(0xe6)]+'/'+_0x280388[_0x53c215(0xb9)][_0x53c215(0x114)]:_0x280388[_0x53c215(0xb9)][_0x53c215(0x114)];console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de['yellow'](_0x53c215(0x100))+'\x20'+_0x175942),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c)),console[_0x53c215(0xc9)](_0x280388[_0x53c215(0xec)]),console[_0x53c215(0xc9)]('─'['repeat'](0x3c));}if(_0x4c27ff[_0x53c215(0xbd)]>0x0)for(const _0x5132ca of _0x4c27ff){const _0x599ca0=_0x5132ca[_0x53c215(0x9e)]?_0x4e476b[_0x53c215(0xc6)](_0x5132ca[_0x53c215(0x9e)])||'':'',_0x3ff062=_0x599ca0?_0x599ca0+'/'+_0x5132ca[_0x53c215(0xd3)]:_0x5132ca[_0x53c215(0xd3)];console[_0x53c215(0xc9)]('\x0a'+a39_0x1bc6de['red']('Delete\x20journey:')+'\x20'+_0x3ff062),console[_0x53c215(0xc9)]('─'['repeat'](0x3c)),console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0xef))),console[_0x53c215(0xc9)]('─'[_0x53c215(0xe8)](0x3c));}if(_0x357875[_0x53c215(0x117)])return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x129))),0x0;const _0x506d97=_0x357875[_0x53c215(0xcc)]?![]:_0x2aa937[_0x53c215(0xbd)]>0x0||_0x5c7752[_0x53c215(0xbd)]>0x0||_0x2c1768[_0x53c215(0xbd)]>0x0,_0x5a276b=_0x249b48['length']>0x0||_0x24e8c3[_0x53c215(0xbd)]>0x0||_0x4c27ff[_0x53c215(0xbd)]>0x0,_0x5cca84=_0x357875[_0x53c215(0xcc)]?![]:_0x545b18[_0x53c215(0xbd)]>0x0,_0x5f27e5=_0x5c80b7[_0x53c215(0xbd)]>0x0;if(!_0x506d97&&!_0x5a276b&&!_0x5cca84&&!_0x5f27e5){const _0x2e0ddb=_0x357875[_0x53c215(0xcc)]?_0x53c215(0xb2):_0x53c215(0xa8);console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0x9d)](_0x2e0ddb));if(_0x2f2571&&_0x2db4e0[_0x53c215(0xbd)]===0x1){const _0x5e942d=_0x2db4e0[0x0];if(_0x5e942d[_0x53c215(0x10f)]?.['id']){const _0x115b28=getConsoleNextUrl(_0x357875['site'],_0x53c215(0xe3)+_0x2e7129+'/e/'+_0x5e942d[_0x53c215(0x10f)]['id']+'/sb/da/esr');console[_0x53c215(0xc9)](_0x53c215(0xfe)+a39_0x1bc6de[_0x53c215(0xfd)](_0x115b28));}}if(_0x2f2571&&_0x291fab['length']===0x1){const _0x5ad7b6=_0x291fab[0x0];if(_0x5ad7b6[_0x53c215(0x106)]?.['id']){const _0x4d763b=getConsoleNextUrl(_0x357875[_0x53c215(0xa5)],'/app/ps/'+_0x2e7129+_0x53c215(0x11e)+_0x5ad7b6[_0x53c215(0x106)]['id']+_0x53c215(0xf7));console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de[_0x53c215(0xfd)](_0x4d763b));}}return 0x0;}const _0x5a9dfc=_0x357875[_0x53c215(0xcc)]?_0x249b48[_0x53c215(0xbd)]+_0x24e8c3[_0x53c215(0xbd)]+_0x4c27ff[_0x53c215(0xbd)]+_0x5c80b7[_0x53c215(0xbd)]:_0x2aa937['length']+_0x5c7752[_0x53c215(0xbd)]+_0x2c1768['length']+_0x249b48[_0x53c215(0xbd)]+_0x24e8c3[_0x53c215(0xbd)]+_0x4c27ff['length']+_0x5c80b7['length']+_0x545b18[_0x53c215(0xbd)];if(!_0x357875[_0x53c215(0x10d)]&&_0x5a9dfc>0x0){if(!isInteractive())return console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xbc)](_0x53c215(0x96)),_0x53c215(0x11c)),console['error'](a39_0x1bc6de[_0x53c215(0xae)](_0x53c215(0xb1))),0x1;const _0x1e28ae=await confirmKey(_0x53c215(0xd6)+_0x5a9dfc+_0x53c215(0x125));if(!_0x1e28ae)return console['error'](a39_0x1bc6de[_0x53c215(0xc8)](_0x53c215(0x11b))),0x1;}const _0x49620={'withProgress':async(_0x3f9ecd,_0x253c49)=>{const _0xf86a65=_0x53c215,_0x19dbd5=await withSpinner(_0x3f9ecd,_0x253c49,{'verbose':_0x357875[_0xf86a65(0xf0)]});return{'data':_0x19dbd5[_0xf86a65(0x109)]};},'logInfo':_0x50b699=>console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0x101)]('✔\x20'+_0x50b699)),'logSuccess':_0x226f7a=>console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0x9d)]('✔\x20'+_0x226f7a)),'logWarning':_0x40d564=>console[_0x53c215(0xc9)](a39_0x1bc6de[_0x53c215(0xc8)]('⚠\x20'+_0x40d564)),'logDeleted':_0x2737c7=>console['error'](a39_0x1bc6de[_0x53c215(0xbc)]('✔\x20'+_0x2737c7))},_0x3f04f0={'segment':_0x19185a[_0x53c215(0xbb)],'journey':_0x19185a['journey'],'user':_0x19185a[_0x53c215(0xe4)],'connection':_0x19185a[_0x53c215(0xc0)]};_0x5c80b7[_0x53c215(0xbd)]>0x0&&(_0x5c4c14=await executePushFolders(_0x3f04f0,_0x5c80b7,_0x5c4c14,{'parentId':_0x2e7129},_0x49620));const _0x5652e1={'rootFolderId':_0x5628b6,'folderPathToId':_0x5c4c14,'folderIdToPath':_0x4e476b,'segmentNameToId':_0xe605eb,'activationsBySegmentId':_0x44f9bd,'emailToIdMap':_0x21a1fc,'idToEmailMap':_0x591757,'connectionNameToIdMap':_0x265064[_0x53c215(0xa6)],'connectionIdToNameMap':_0x265064[_0x53c215(0x133)],'connectionNameToTypeMap':_0x215b8b},_0x254684=await executePushSegments(_0x3f04f0,_0x357875[_0x53c215(0xcc)]?[]:_0x15aefc,_0x5652e1,{'parentId':_0x2e7129},_0x49620),_0x1d38e2=_0x254684[_0x53c215(0x135)],_0x253f62=_0x254684[_0x53c215(0x127)],_0x2ca960=_0x254684[_0x53c215(0xaf)][_0x53c215(0x135)],_0x5decff=_0x254684['activations'][_0x53c215(0x127)],_0x256c8c=_0x254684[_0x53c215(0xaf)][_0x53c215(0x99)];let _0x163007;if(_0x2f2571&&_0x15aefc[_0x53c215(0xbd)]===0x1){const _0x392aac=_0x15aefc[0x0];_0x163007=_0x392aac[_0x53c215(0x10f)]?.['id']??_0x254684[_0x53c215(0xcf)][_0x53c215(0xc6)](_0x392aac[_0x53c215(0xb9)]['name']);}const _0x100e2f=await executePushSegmentDeletions(_0x3f04f0,_0x357875[_0x53c215(0xcc)]?[]:_0x2c1768,_0x49620);let _0x244e1f=0x0,_0x139c54=0x0,_0x30c192=0x0;const _0x3bcf58=new Map(_0xe605eb);for(const [_0x46bbe3,_0x19ad4f]of _0x254684[_0x53c215(0xcf)]){_0x3bcf58[_0x53c215(0xdc)](_0x46bbe3,_0x19ad4f);}if(_0x45945b[_0x53c215(0xbd)]>0x0){const _0x2c9f94={..._0x5652e1,'segmentNameToId':_0x3bcf58,'existingSegments':_0x30fd11,'activationContext':_0x1ce3d9},_0x3e202e=await executePushJourneys(_0x3f04f0,_0x45945b,_0x2c9f94,{'parentId':_0x2e7129,'rootFolderId':_0x5628b6,'verbose':_0x357875[_0x53c215(0xf0)]},_0x49620);_0x244e1f=_0x3e202e['created'],_0x139c54=_0x3e202e[_0x53c215(0x127)];if(_0x2f2571&&_0x3e202e[_0x53c215(0xc1)][_0x53c215(0xbd)]===0x1){const _0x18d408=_0x3e202e[_0x53c215(0xc1)][0x0];if(_0x18d408['journeyId']){const _0x465c67=getConsoleNextUrl(_0x357875[_0x53c215(0xa5)],'/app/ps/'+_0x2e7129+'/e/'+_0x18d408[_0x53c215(0xdf)]+_0x53c215(0xf7));console[_0x53c215(0xc9)]('\x20\x20'+a39_0x1bc6de[_0x53c215(0xfd)](_0x465c67));}}}for(const _0x282b69 of _0x4c27ff){console[_0x53c215(0xc9)](a39_0x1bc6de['yellow'](_0x53c215(0xc7)+_0x282b69['journeyBundleName'])),_0x30c192++;}const _0x4e2e67=[];if(_0x1d38e2>0x0)_0x4e2e67[_0x53c215(0xd4)](_0x1d38e2+_0x53c215(0xe9));if(_0x253f62>0x0)_0x4e2e67['push'](_0x253f62+'\x20updated');if(_0x100e2f>0x0)_0x4e2e67[_0x53c215(0xd4)](_0x100e2f+_0x53c215(0x102));const _0x1166dd=[];if(_0x244e1f>0x0)_0x1166dd[_0x53c215(0xd4)](_0x244e1f+_0x53c215(0xe9));if(_0x139c54>0x0)_0x1166dd[_0x53c215(0xd4)](_0x139c54+_0x53c215(0xd1));if(_0x30c192>0x0)_0x1166dd['push'](_0x30c192+_0x53c215(0x102));const _0x46ef07=[];if(_0x2ca960>0x0)_0x46ef07['push'](_0x2ca960+'\x20created');if(_0x5decff>0x0)_0x46ef07[_0x53c215(0xd4)](_0x5decff+_0x53c215(0xd1));if(_0x256c8c>0x0)_0x46ef07['push'](_0x256c8c+_0x53c215(0x102));console['error'](a39_0x1bc6de[_0x53c215(0x9d)](_0x53c215(0xca)));_0x4e2e67[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&console[_0x53c215(0xc9)](_0x53c215(0x12e)+_0x4e2e67[_0x53c215(0x97)](',\x20'));_0x1166dd[_0x53c215(0xbd)]>0x0&&console[_0x53c215(0xc9)]('\x20\x20Journeys:\x20'+_0x1166dd[_0x53c215(0x97)](',\x20'));_0x46ef07[_0x53c215(0xbd)]>0x0&&!_0x357875[_0x53c215(0xcc)]&&console[_0x53c215(0xc9)](_0x53c215(0xba)+_0x46ef07[_0x53c215(0x97)](',\x20'));if(_0x163007){const _0x5cb4e1=getConsoleNextUrl(_0x357875[_0x53c215(0xa5)],'/app/ps/'+_0x2e7129+_0x53c215(0x11e)+_0x163007+_0x53c215(0x9b));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x1bc6de['cyan'](_0x5cb4e1));}return 0x0;}}