@treasuredata/tdx 2026.3.4 β†’ 2026.3.5

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 (197) 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/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/engage-template-pull-command.js +1 -1
  24. package/dist/commands/engage-template-push-command.js +1 -1
  25. package/dist/commands/engage-template-validate-command.js +1 -1
  26. package/dist/commands/job-command.js +1 -1
  27. package/dist/commands/journey-command.js +1 -1
  28. package/dist/commands/journey-validate-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/mcp-command.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profile-command.js +1 -1
  33. package/dist/commands/profiles-command.js +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/schedule-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.js +1 -1
  41. package/dist/commands/segment-update-command.js +1 -1
  42. package/dist/commands/segment-use-command.js +1 -1
  43. package/dist/commands/segment-validate-command.js +1 -1
  44. package/dist/commands/segments.js +1 -1
  45. package/dist/commands/show.js +1 -1
  46. package/dist/commands/status-command.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/unset-command.js +1 -1
  49. package/dist/commands/upgrade-command.js +1 -1
  50. package/dist/commands/use-command.js +1 -1
  51. package/dist/commands/user-command.js +1 -1
  52. package/dist/commands/workflow-command.js +1 -1
  53. package/dist/core/auth.js +1 -1
  54. package/dist/core/command-output.js +1 -1
  55. package/dist/core/config.js +1 -1
  56. package/dist/core/connection-cache.js +1 -1
  57. package/dist/core/constants.js +1 -1
  58. package/dist/core/credential-cache.js +1 -1
  59. package/dist/core/global-context.js +1 -1
  60. package/dist/core/keychain.js +1 -1
  61. package/dist/core/profile.js +1 -1
  62. package/dist/core/project-config.js +1 -1
  63. package/dist/core/session.js +1 -1
  64. package/dist/core/user-cache.js +1 -1
  65. package/dist/core/version.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/mcp/server.js +1 -1
  68. package/dist/mcp/tools/index.js +1 -1
  69. package/dist/mcp/tools/tdx-run.js +1 -1
  70. package/dist/mcp/tools/tdx-search.js +1 -1
  71. package/dist/mcp/utils.js +1 -1
  72. package/dist/proxy/claude-usage-tracker.js +1 -1
  73. package/dist/proxy/passthrough-server.js +1 -1
  74. package/dist/proxy/sse-usage-parser.js +1 -1
  75. package/dist/sdk/agent/agent-config.js +1 -1
  76. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  77. package/dist/sdk/agent/agent-yaml.js +1 -1
  78. package/dist/sdk/agent/test/evaluator.js +1 -1
  79. package/dist/sdk/agent/test/executor.js +1 -1
  80. package/dist/sdk/agent/test/index.js +1 -1
  81. package/dist/sdk/agent/test/output.js +1 -1
  82. package/dist/sdk/agent/test/parser.js +1 -1
  83. package/dist/sdk/agent/tool-target-registry.js +1 -1
  84. package/dist/sdk/api.js +1 -1
  85. package/dist/sdk/client/cdp-api-client.js +1 -1
  86. package/dist/sdk/client/delivery-api-client.js +1 -1
  87. package/dist/sdk/client/endpoints.js +1 -1
  88. package/dist/sdk/client/engage-api-client.js +1 -1
  89. package/dist/sdk/client/http-client.js +1 -1
  90. package/dist/sdk/client/llm-api-client.js +1 -1
  91. package/dist/sdk/client/rate-limiter.js +1 -1
  92. package/dist/sdk/client/td-api-client.js +1 -1
  93. package/dist/sdk/client/trino-api-client.js +1 -1
  94. package/dist/sdk/client/workflow-client.js +1 -1
  95. package/dist/sdk/connection-validator.js +1 -1
  96. package/dist/sdk/connection.js +1 -1
  97. package/dist/sdk/delivery.js +1 -1
  98. package/dist/sdk/engage/campaign-pull.js +1 -1
  99. package/dist/sdk/engage/campaign-push.js +1 -1
  100. package/dist/sdk/engage/campaign-validator.js +1 -1
  101. package/dist/sdk/engage/campaign-yaml.js +1 -1
  102. package/dist/sdk/engage/template-pull.js +1 -1
  103. package/dist/sdk/engage/template-push.js +1 -1
  104. package/dist/sdk/engage/template-validator.js +1 -1
  105. package/dist/sdk/engage/template-yaml.js +1 -1
  106. package/dist/sdk/engage/types/campaign-def.js +1 -1
  107. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  108. package/dist/sdk/engage/types/template-schema.js +1 -1
  109. package/dist/sdk/engage.js +1 -1
  110. package/dist/sdk/errors.js +1 -1
  111. package/dist/sdk/index.js +1 -1
  112. package/dist/sdk/io/index.js +1 -1
  113. package/dist/sdk/io/node-filesystem.js +1 -1
  114. package/dist/sdk/job.js +1 -1
  115. package/dist/sdk/journey.js +1 -1
  116. package/dist/sdk/llm/chat-cache.js +1 -1
  117. package/dist/sdk/llm/index.js +1 -1
  118. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  119. package/dist/sdk/llm/model-factors.js +1 -1
  120. package/dist/sdk/personalization.js +1 -1
  121. package/dist/sdk/query/index.js +1 -1
  122. package/dist/sdk/query/sql-parser.js +1 -1
  123. package/dist/sdk/realtime.js +1 -1
  124. package/dist/sdk/schedule.js +1 -1
  125. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  126. package/dist/sdk/segment/fields-display.js +1 -1
  127. package/dist/sdk/segment/file-discovery.js +1 -1
  128. package/dist/sdk/segment/journey-utils.js +1 -1
  129. package/dist/sdk/segment/journey-validator.js +1 -1
  130. package/dist/sdk/segment/journey-yaml.js +1 -1
  131. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  132. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  133. package/dist/sdk/segment/pull-workflow.js +1 -1
  134. package/dist/sdk/segment/push-recovery.js +1 -1
  135. package/dist/sdk/segment/push-workflow.js +1 -1
  136. package/dist/sdk/segment/resolution-context.js +1 -1
  137. package/dist/sdk/segment/segment-path-parser.js +1 -1
  138. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  139. package/dist/sdk/segment/segment-validator.js +1 -1
  140. package/dist/sdk/segment/target-resolution.js +1 -1
  141. package/dist/sdk/segment/tdx-config.js +1 -1
  142. package/dist/sdk/segment/types/activation-schema.js +1 -1
  143. package/dist/sdk/segment/types/journey-def.js +1 -1
  144. package/dist/sdk/segment/types/journey-schema.js +1 -1
  145. package/dist/sdk/segment/types/segment-def.js +1 -1
  146. package/dist/sdk/segment/types/segment-schema.js +1 -1
  147. package/dist/sdk/segment/validate-files.js +1 -1
  148. package/dist/sdk/segment/yaml-validator.js +1 -1
  149. package/dist/sdk/segment.js +1 -1
  150. package/dist/sdk/types/index.js +1 -1
  151. package/dist/sdk/types/progress.js +1 -1
  152. package/dist/sdk/user.js +1 -1
  153. package/dist/sdk/util/format-detector.js +1 -1
  154. package/dist/sdk/util/formatters.js +1 -1
  155. package/dist/sdk/util/index.js +1 -1
  156. package/dist/sdk/util/paginate.js +1 -1
  157. package/dist/sdk/util/tree-formatter.js +1 -1
  158. package/dist/sdk/workflow/archive-validation.js +1 -1
  159. package/dist/sdk/workflow/clone-workflow.js +1 -1
  160. package/dist/sdk/workflow/index.js +1 -1
  161. package/dist/sdk/workflow/pull-workflow.js +1 -1
  162. package/dist/sdk/workflow/push-workflow.js +1 -1
  163. package/dist/sdk/workflow/tdx-config.js +1 -1
  164. package/dist/sdk/workflow/workflow-utils.js +1 -1
  165. package/dist/test-utils/command-runner.js +1 -1
  166. package/dist/test-utils/factories.js +1 -1
  167. package/dist/test-utils/fixtures.js +1 -1
  168. package/dist/test-utils/http-mock.js +1 -1
  169. package/dist/test-utils/index.js +1 -1
  170. package/dist/utils/async.js +1 -1
  171. package/dist/utils/colors.js +1 -1
  172. package/dist/utils/diff.js +1 -1
  173. package/dist/utils/file-permissions.js +1 -1
  174. package/dist/utils/file-reader.js +1 -1
  175. package/dist/utils/github-releases.js +1 -1
  176. package/dist/utils/global-cache.js +1 -1
  177. package/dist/utils/json-loader.js +1 -1
  178. package/dist/utils/local-cache.js +1 -1
  179. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  180. package/dist/utils/logger/formatters/index.js +1 -1
  181. package/dist/utils/logger/handlers/console-handler.js +1 -1
  182. package/dist/utils/logger/handlers/file-handler.js +1 -1
  183. package/dist/utils/logger/handlers/index.js +1 -1
  184. package/dist/utils/logger/handlers/null-handler.js +1 -1
  185. package/dist/utils/logger/index.js +1 -1
  186. package/dist/utils/logger/logger.js +1 -1
  187. package/dist/utils/logger/types.js +1 -1
  188. package/dist/utils/option-validation.js +1 -1
  189. package/dist/utils/process.js +1 -1
  190. package/dist/utils/prompt.js +1 -1
  191. package/dist/utils/spinner.js +1 -1
  192. package/dist/utils/sse-parser.js +1 -1
  193. package/dist/utils/string-utils.js +1 -1
  194. package/dist/utils/table-ref-parser.js +1 -1
  195. package/dist/utils/tdx-logger.js +1 -1
  196. package/dist/utils/version-check.js +1 -1
  197. package/package.json +1 -1
@@ -1 +1 @@
1
- const a33_0x1e4fb4=a33_0x2d54;(function(_0x1e7b7a,_0x1b1c79){const _0x47f7ca=a33_0x2d54,_0x54278d=_0x1e7b7a();while(!![]){try{const _0x52647c=parseInt(_0x47f7ca(0x113))/0x1+-parseInt(_0x47f7ca(0xf2))/0x2+-parseInt(_0x47f7ca(0x10a))/0x3*(parseInt(_0x47f7ca(0x92))/0x4)+-parseInt(_0x47f7ca(0x96))/0x5+-parseInt(_0x47f7ca(0xfa))/0x6*(parseInt(_0x47f7ca(0xd1))/0x7)+parseInt(_0x47f7ca(0xd0))/0x8+-parseInt(_0x47f7ca(0x90))/0x9*(-parseInt(_0x47f7ca(0xf8))/0xa);if(_0x52647c===_0x1b1c79)break;else _0x54278d['push'](_0x54278d['shift']());}catch(_0x36d754){_0x54278d['push'](_0x54278d['shift']());}}}(a33_0x1090,0x2bd0c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a33_0x2d54(_0xa747a5,_0x2bddd5){_0xa747a5=_0xa747a5-0x83;const _0x109077=a33_0x1090();let _0x2d543b=_0x109077[_0xa747a5];return _0x2d543b;}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';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a33_0x1090(){const _0x17a79e=['Update\x20a\x20scheduled\x20query','Creating\x20schedule:\x20','cyan','delete','result','description','query','Show\x20schedule\x20details','time','Updating\x20schedule:\x20','d\x20ago','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','num','\x20\x20Timezone:\x20','success','153knnEIM','Schedule\x20updated:\x20','268xYbzpT','schedule:show','keys','delay','1335620AhcyKX','Updating\x20schedule...','statusIcon','last_job','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','nextRun','user','next_run_at','schedule:update','substring','INVALID_ARGUMENT','engineVersion','args','schedules','yes','jsonl','red','Run\x20a\x20scheduled\x20query\x20immediately','validate','name','file','tsv','job_id','Schedule\x20run\x20submitted:\x20','schedule:run','\x22...','queries','\x20\x20Cron:\x20','json','cron','lastRun','Delete\x20a\x20scheduled\x20query','retryLimit','Listing\x20scheduled\x20queries...','just\x20now','\x20\x20Job\x20ID:\x20','Schedule\x20deleted:\x20','scheduled_at','No\x20scheduled\x20queries\x20found','format','Query\x20file\x20is\x20empty','Running\x20schedule:\x20','status','List\x20scheduled\x20queries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','map','execute','executing_user_id','options','schedule:list','\x20\x20Type:\x20','m\x20ago','max','create','list','\x20(showing\x20','getTime','table','1329856rTCjaz','359170sOTgUd','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','data','utf-8','/app/queries/editor?queryId=','repeat','Running\x20schedule...','Showing\x20first\x20','type','h\x20ago','trino','error','Failed\x20to\x20read\x20file:\x20','pagination','priority','round','run','schedule:history','verbose','padEnd','\x20matching\x20\x22','time_zone','ies','site','\x20created','database','limit','schedule:delete','retry_limit','Schedule\x20created:\x20','πŸ“…\x20','\x20\x20Database:\x20','soon','264494TufwAd','entries','\x20schedules','\x20\x20β†’\x20','length','\x20\x20Num:\x20','271270xeCQWu','in\x20','6jNyhQy','\x20\x20Time:\x20','trim','timezone','show','from','created_at','queryUrl','join','engine_version','never','\x20scheduled\x20quer','history','...','has_next_page','Getting\x20schedule\x20details...','8727pDwouF','Searching\x20scheduled\x20queries\x20matching\x20\x22','count','start_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','\x20job','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','dim','end_at','197661YWmjcH'];a33_0x1090=function(){return _0x17a79e;};return a33_0x1090();}import{hyperlink}from'../sdk/util/formatters.js';import a33_0x2856af from'chalk';function formatRelativeTime(_0x3f2808){const _0x3fd785=a33_0x2d54,_0x3fbee5=new Date(_0x3f2808),_0x360d0d=new Date(),_0x262d08=_0x3fbee5[_0x3fd785(0xce)]()-_0x360d0d[_0x3fd785(0xce)](),_0x5dd8ec=Math['abs'](_0x262d08)/0x3e8,_0xf9c014=_0x262d08<0x0;if(_0x5dd8ec<0x3c)return _0xf9c014?_0x3fd785(0xb8):_0x3fd785(0xf1);else{if(_0x5dd8ec<0xe10){const _0x163cdc=Math[_0x3fd785(0xe0)](_0x5dd8ec/0x3c);return _0xf9c014?_0x163cdc+_0x3fd785(0xc9):_0x3fd785(0xf9)+_0x163cdc+'m';}else{if(_0x5dd8ec<0x15180){const _0x4b7f11=Math[_0x3fd785(0xe0)](_0x5dd8ec/0xe10);return _0xf9c014?_0x4b7f11+_0x3fd785(0xda):'in\x20'+_0x4b7f11+'h';}else{if(_0x5dd8ec<0x93a80){const _0xcf1a5b=Math[_0x3fd785(0xe0)](_0x5dd8ec/0x15180);return _0xf9c014?_0xcf1a5b+_0x3fd785(0x8b):_0x3fd785(0xf9)+_0xcf1a5b+'d';}else return _0x3fbee5['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0xc7);['description']=a33_0x1e4fb4(0xc1);async['execute'](_0x1489d3){const _0x1c70f0=a33_0x1e4fb4,{options:_0x5a4631,args:_0x32399c,tdx:_0x362678}=_0x1489d3,_0x22707a=resolveLimit(_0x5a4631[_0x1c70f0(0xeb)],DEFAULT_DISPLAY_LIMIT),_0x4e2b56=_0x32399c[0x0],_0x44fd0f=_0x4e2b56?_0x1c70f0(0x10b)+_0x4e2b56+_0x1c70f0(0xaf):_0x1c70f0(0xb7),_0x5309e2=await withSpinner(_0x44fd0f,()=>_0x362678['schedules']['listQueries']({'limit':_0x22707a,'scheduled':!![],'pattern':_0x4e2b56}),{'verbose':_0x5a4631['verbose']}),_0x521247=_0x5309e2[_0x1c70f0(0xd3)][_0x1c70f0(0xb0)],_0x7febe6=_0x5309e2[_0x1c70f0(0xd3)][_0x1c70f0(0xde)][_0x1c70f0(0x108)],_0x2a7500=_0x4e2b56?_0x1c70f0(0xe5)+_0x4e2b56+'\x22':'';_0x7febe6?console[_0x1c70f0(0xdc)](_0x1c70f0(0xd8)+_0x521247[_0x1c70f0(0xf6)]+_0x1c70f0(0xf4)+_0x2a7500+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x1c70f0(0xdc)]('Found\x20'+_0x521247['length']+_0x1c70f0(0x105)+(_0x521247[_0x1c70f0(0xf6)]!==0x1?_0x1c70f0(0xe7):'y')+_0x2a7500);if(_0x5a4631[_0x1c70f0(0xbd)]===_0x1c70f0(0xb2)||_0x5a4631['format']===_0x1c70f0(0xa5)||_0x5a4631[_0x1c70f0(0xbd)]===_0x1c70f0(0xcf)||_0x5a4631[_0x1c70f0(0xbd)]===_0x1c70f0(0xab)){const _0x6d4d=_0x521247['map'](_0x48b2fd=>({'id':_0x48b2fd['id'],'name':_0x48b2fd[_0x1c70f0(0xa9)],'cron':_0x48b2fd[_0x1c70f0(0xb3)],'database':_0x48b2fd[_0x1c70f0(0xea)]?.['name'],'type':_0x48b2fd[_0x1c70f0(0xd9)],'timezone':_0x48b2fd[_0x1c70f0(0xe6)],'user_name':_0x48b2fd[_0x1c70f0(0x9c)]?.[_0x1c70f0(0xa9)],'updated_at':_0x48b2fd['updated_at'],'next_run_at':_0x48b2fd[_0x1c70f0(0x9d)],'last_job_status':_0x48b2fd[_0x1c70f0(0x99)]?.[_0x1c70f0(0xc0)]}));await handleSDKOutput(_0x6d4d,_0x5a4631);}else{if(_0x521247[_0x1c70f0(0xf6)]===0x0)console['log'](_0x1c70f0(0xbc));else{const _0x35f59e=_0x5a4631[_0x1c70f0(0xe8)],_0x18f38d=_0x521247[_0x1c70f0(0xc3)](_0x2b1f5e=>{const _0x3144e3=_0x1c70f0,_0x13f62d=_0x2b1f5e[_0x3144e3(0x99)]?.[_0x3144e3(0xc0)]?_0x2b1f5e[_0x3144e3(0x99)][_0x3144e3(0xc0)]===_0x3144e3(0x8f)?'βœ“':'βœ—':'-',_0xe7c629=_0x2b1f5e[_0x3144e3(0x99)]?.['ended_at']?formatRelativeTime(_0x2b1f5e['last_job']['ended_at']):_0x3144e3(0x104),_0x132342=_0x2b1f5e['next_run_at']?formatRelativeTime(_0x2b1f5e[_0x3144e3(0x9d)]):'-',_0x2821ee=_0x2b1f5e[_0x3144e3(0xb3)]||'',_0x14883a=_0x2b1f5e[_0x3144e3(0xa9)]||'(unnamed)',_0x48bfdb=getConsoleUrl(_0x35f59e,_0x3144e3(0xd5)+_0x2b1f5e['id']);return{'statusIcon':_0x13f62d,'lastRun':_0xe7c629,'nextRun':_0x132342,'cron':_0x2821ee,'name':_0x14883a,'queryUrl':_0x48bfdb,'status':_0x2b1f5e[_0x3144e3(0x99)]?.[_0x3144e3(0xc0)]};}),_0x3d462d=Math[_0x1c70f0(0xca)](..._0x18f38d['map'](_0xffa075=>_0xffa075[_0x1c70f0(0xb4)][_0x1c70f0(0xf6)])),_0x35a39a=Math[_0x1c70f0(0xca)](..._0x18f38d['map'](_0x36b082=>_0x36b082[_0x1c70f0(0x9b)][_0x1c70f0(0xf6)])),_0xd957d7=Math['max'](..._0x18f38d[_0x1c70f0(0xc3)](_0x176fdc=>_0x176fdc[_0x1c70f0(0xb3)][_0x1c70f0(0xf6)])),_0xdff62=_0x18f38d[_0x1c70f0(0xc3)](_0xc06bc5=>{const _0x371f3a=_0x1c70f0,_0x4a1595=_0xc06bc5[_0x371f3a(0xc0)]===_0x371f3a(0x8f)?a33_0x2856af['green'](_0xc06bc5[_0x371f3a(0x98)]):_0xc06bc5[_0x371f3a(0xc0)]===_0x371f3a(0xdc)?a33_0x2856af[_0x371f3a(0xa6)](_0xc06bc5['statusIcon']):a33_0x2856af[_0x371f3a(0x111)](_0xc06bc5[_0x371f3a(0x98)]),_0xda57e2=_0xc06bc5[_0x371f3a(0xb4)][_0x371f3a(0xe4)](_0x3d462d),_0x1a7268=_0xc06bc5['nextRun'][_0x371f3a(0xe4)](_0x35a39a),_0x3ddfeb=_0xc06bc5['cron']?a33_0x2856af[_0x371f3a(0x83)](_0xc06bc5[_0x371f3a(0xb3)][_0x371f3a(0xe4)](_0xd957d7)):'\x20'[_0x371f3a(0xd6)](_0xd957d7),_0x2e41eb=hyperlink(_0xc06bc5[_0x371f3a(0xa9)],_0xc06bc5[_0x371f3a(0x101)]);return _0x371f3a(0xef)+_0x4a1595+'\x20'+_0xda57e2+_0x371f3a(0xf5)+_0x1a7268+'\x20\x20'+_0x3ddfeb+'\x20\x20'+_0x2e41eb;});await writeOutput(_0xdff62[_0x1c70f0(0x102)]('\x0a'),_0x5a4631['output'],_0x1c70f0(0xcc));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0x93);[a33_0x1e4fb4(0x86)]=a33_0x1e4fb4(0x88);['validate'](_0x53491a){const _0x202c93=a33_0x1e4fb4,_0x7b3698=_0x53491a[_0x202c93(0xa2)][0x0];if(!_0x7b3698)return _0x202c93(0x10e);return undefined;}async[a33_0x1e4fb4(0xc4)](_0x31b13c){const _0x27fc3b=a33_0x1e4fb4,{options:_0x5e3b50,args:_0x2eed7c,tdx:_0x4379cf}=_0x31b13c,_0x5b181e=_0x2eed7c[0x0],_0x2b9c6=await withSpinner(_0x27fc3b(0x109),()=>_0x4379cf[_0x27fc3b(0xa3)][_0x27fc3b(0xfe)](_0x5b181e),{'verbose':_0x5e3b50['verbose']}),_0x27acc9=_0x2b9c6['data'],_0x3ce93c={'name':_0x27acc9[_0x27fc3b(0xa9)],'cron':_0x27acc9[_0x27fc3b(0xb3)],'database':_0x27acc9['database'],'type':_0x27acc9[_0x27fc3b(0xd9)],'timezone':_0x27acc9[_0x27fc3b(0xfd)],'user_name':_0x27acc9['user_name'],'created_at':_0x27acc9['created_at'],'engine_version':_0x27acc9['engine_version'],'executing_user_id':_0x27acc9[_0x27fc3b(0xc5)],'query':_0x27acc9[_0x27fc3b(0x87)],'delay':_0x27acc9[_0x27fc3b(0x95)],'priority':_0x27acc9[_0x27fc3b(0xdf)],'retry_limit':_0x27acc9[_0x27fc3b(0xed)],..._0x27acc9['result']&&{'result':_0x27acc9[_0x27fc3b(0x85)]}};return await handleSingleObjectOutput(_0x3ce93c,_0x5e3b50),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]='schedule:create';['description']='Create\x20a\x20scheduled\x20query';[a33_0x1e4fb4(0xa8)](_0x4cec8e){const _0x454cfd=a33_0x1e4fb4,_0x3789b4=_0x4cec8e[_0x454cfd(0xa2)][0x0];if(!_0x3789b4)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x11e8dd=_0x4cec8e[_0x454cfd(0xc6)];if(!_0x11e8dd[_0x454cfd(0xea)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a33_0x1e4fb4(0xc4)](_0x3318da){const _0x117c92=a33_0x1e4fb4,{options:_0x1c8e51,args:_0x4d5d1d,tdx:_0x3d34ed}=_0x3318da,_0x3bafe5=_0x4d5d1d[0x0],_0x5ac4ed=_0x1c8e51,_0x5d1a97=_0x5ac4ed[_0x117c92(0xea)],_0x57e2ef=_0x5ac4ed[_0x117c92(0xaa)],_0x7c17a0=_0x5ac4ed[_0x117c92(0xd9)]||_0x117c92(0xdb);let _0x452901;try{_0x452901=readFileSync(_0x57e2ef,'utf-8')[_0x117c92(0xfc)]();}catch(_0x2800db){throw new SDKError(ErrorCode[_0x117c92(0xa0)],_0x117c92(0xdd)+_0x57e2ef,_0x2800db instanceof Error?_0x2800db:undefined);}if(!_0x452901)throw new SDKError(ErrorCode[_0x117c92(0xa0)],_0x117c92(0xbe));const _0x1bd02b={'database':_0x5d1a97,'query':_0x452901,'type':_0x7c17a0};if(_0x5ac4ed[_0x117c92(0xb3)])_0x1bd02b[_0x117c92(0xb3)]=_0x5ac4ed[_0x117c92(0xb3)];if(_0x5ac4ed['timezone'])_0x1bd02b['timezone']=_0x5ac4ed[_0x117c92(0xfd)];if(_0x5ac4ed[_0x117c92(0x95)]!==undefined)_0x1bd02b[_0x117c92(0x95)]=Number(_0x5ac4ed['delay']);if(_0x5ac4ed[_0x117c92(0xdf)]!==undefined)_0x1bd02b[_0x117c92(0xdf)]=Number(_0x5ac4ed[_0x117c92(0xdf)]);if(_0x5ac4ed[_0x117c92(0xb6)]!==undefined)_0x1bd02b[_0x117c92(0xed)]=Number(_0x5ac4ed[_0x117c92(0xb6)]);if(_0x5ac4ed[_0x117c92(0xa1)])_0x1bd02b[_0x117c92(0x103)]=_0x5ac4ed[_0x117c92(0xa1)];if(_0x5ac4ed[_0x117c92(0x85)])_0x1bd02b[_0x117c92(0x85)]=_0x5ac4ed[_0x117c92(0x85)];if(_0x1c8e51[_0x117c92(0xe3)]){console[_0x117c92(0xdc)](_0x117c92(0x115)+_0x3bafe5),console[_0x117c92(0xdc)](_0x117c92(0xf0)+_0x5d1a97),console[_0x117c92(0xdc)](_0x117c92(0xc8)+_0x7c17a0);if(_0x1bd02b['cron'])console['error'](_0x117c92(0xb1)+_0x1bd02b['cron']);if(_0x1bd02b[_0x117c92(0xfd)])console[_0x117c92(0xdc)](_0x117c92(0x8e)+_0x1bd02b[_0x117c92(0xfd)]);}const _0x3d89cc=await withSpinner('Creating\x20schedule...',()=>_0x3d34ed[_0x117c92(0xa3)][_0x117c92(0xcb)](_0x3bafe5,_0x1bd02b),{'verbose':_0x1c8e51[_0x117c92(0xe3)]});return console['error'](_0x117c92(0xee)+_0x3d89cc[_0x117c92(0xd3)][_0x117c92(0xa9)]),await handleSingleObjectOutput(_0x3d89cc['data'],_0x1c8e51),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0x9e);['description']=a33_0x1e4fb4(0x114);[a33_0x1e4fb4(0xa8)](_0x1a834b){const _0x46127c=a33_0x1e4fb4,_0x4ef4c6=_0x1a834b[_0x46127c(0xa2)][0x0];if(!_0x4ef4c6)return _0x46127c(0x8c);return undefined;}async[a33_0x1e4fb4(0xc4)](_0x3416f3){const _0x8cbb3a=a33_0x1e4fb4,{options:_0x252b1c,args:_0x2054e4,tdx:_0x54cd98}=_0x3416f3,_0x406eb7=_0x2054e4[0x0],_0x5d2dd3=_0x252b1c,_0x54b624={};if(_0x5d2dd3[_0x8cbb3a(0xea)])_0x54b624[_0x8cbb3a(0xea)]=_0x5d2dd3[_0x8cbb3a(0xea)];if(_0x5d2dd3[_0x8cbb3a(0xd9)])_0x54b624[_0x8cbb3a(0xd9)]=_0x5d2dd3[_0x8cbb3a(0xd9)];if(_0x5d2dd3[_0x8cbb3a(0xb3)])_0x54b624[_0x8cbb3a(0xb3)]=_0x5d2dd3[_0x8cbb3a(0xb3)];if(_0x5d2dd3[_0x8cbb3a(0xfd)])_0x54b624['timezone']=_0x5d2dd3[_0x8cbb3a(0xfd)];if(_0x5d2dd3[_0x8cbb3a(0x95)]!==undefined)_0x54b624[_0x8cbb3a(0x95)]=Number(_0x5d2dd3[_0x8cbb3a(0x95)]);if(_0x5d2dd3[_0x8cbb3a(0xdf)]!==undefined)_0x54b624[_0x8cbb3a(0xdf)]=Number(_0x5d2dd3[_0x8cbb3a(0xdf)]);if(_0x5d2dd3[_0x8cbb3a(0xb6)]!==undefined)_0x54b624[_0x8cbb3a(0xed)]=Number(_0x5d2dd3[_0x8cbb3a(0xb6)]);if(_0x5d2dd3[_0x8cbb3a(0xa1)])_0x54b624[_0x8cbb3a(0x103)]=_0x5d2dd3[_0x8cbb3a(0xa1)];if(_0x5d2dd3[_0x8cbb3a(0x85)])_0x54b624[_0x8cbb3a(0x85)]=_0x5d2dd3[_0x8cbb3a(0x85)];if(_0x5d2dd3[_0x8cbb3a(0xaa)])try{_0x54b624[_0x8cbb3a(0x87)]=readFileSync(_0x5d2dd3[_0x8cbb3a(0xaa)],_0x8cbb3a(0xd4))[_0x8cbb3a(0xfc)]();}catch(_0x18acb4){throw new SDKError(ErrorCode[_0x8cbb3a(0xa0)],'Failed\x20to\x20read\x20file:\x20'+_0x5d2dd3[_0x8cbb3a(0xaa)],_0x18acb4 instanceof Error?_0x18acb4:undefined);}if(Object[_0x8cbb3a(0x94)](_0x54b624)[_0x8cbb3a(0xf6)]===0x0)throw new SDKError(ErrorCode[_0x8cbb3a(0xa0)],_0x8cbb3a(0x9a));if(_0x252b1c['verbose']){console[_0x8cbb3a(0xdc)](_0x8cbb3a(0x8a)+_0x406eb7);for(const [_0x3982d6,_0x1a173c]of Object[_0x8cbb3a(0xf3)](_0x54b624)){_0x3982d6===_0x8cbb3a(0x87)?console['error']('\x20\x20'+_0x3982d6+':\x20'+_0x1a173c[_0x8cbb3a(0x9f)](0x0,0x32)+_0x8cbb3a(0x107)):console[_0x8cbb3a(0xdc)]('\x20\x20'+_0x3982d6+':\x20'+_0x1a173c);}}const _0x12065d=await withSpinner(_0x8cbb3a(0x97),()=>_0x54cd98[_0x8cbb3a(0xa3)]['update'](_0x406eb7,_0x54b624),{'verbose':_0x252b1c[_0x8cbb3a(0xe3)]});return console['error'](_0x8cbb3a(0x91)+_0x12065d[_0x8cbb3a(0xd3)][_0x8cbb3a(0xa9)]),await handleSingleObjectOutput(_0x12065d['data'],_0x252b1c),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a33_0x1e4fb4(0xec);[a33_0x1e4fb4(0x86)]=a33_0x1e4fb4(0xb5);[a33_0x1e4fb4(0xa8)](_0x379893){const _0x109de5=a33_0x1e4fb4,_0x8594e5=_0x379893['args'][0x0];if(!_0x8594e5)return _0x109de5(0xc2);return undefined;}async[a33_0x1e4fb4(0xc4)](_0x509ecb){const _0x3cce61=a33_0x1e4fb4,{options:_0x3325a1,args:_0x2e31da,tdx:_0x56520a}=_0x509ecb,_0x1ec184=_0x2e31da[0x0];if(!_0x3325a1[_0x3cce61(0xa4)]){const _0x1e3fa7=await confirm(_0x3cce61(0x110)+_0x1ec184+'\x22?');if(!_0x1e3fa7)return console['error']('Cancelled'),0x0;}const _0x4a1b92=await withSpinner('Deleting\x20schedule...',()=>_0x56520a[_0x3cce61(0xa3)][_0x3cce61(0x84)](_0x1ec184),{'verbose':_0x3325a1[_0x3cce61(0xe3)]});return console[_0x3cce61(0xdc)](_0x3cce61(0xba)+_0x4a1b92[_0x3cce61(0xd3)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0xae);['description']=a33_0x1e4fb4(0xa7);['validate'](_0x49da80){const _0x2c94da=a33_0x1e4fb4,_0x168fb3=_0x49da80[_0x2c94da(0xa2)][0x0];if(!_0x168fb3)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async[a33_0x1e4fb4(0xc4)](_0xb963a6){const _0x46de11=a33_0x1e4fb4,{options:_0x9a00e9,args:_0x85b48e,tdx:_0x14ed82}=_0xb963a6,_0x503f0c=_0x85b48e[0x0],_0x2e36b5=_0x9a00e9,_0x582485=_0x2e36b5[_0x46de11(0x89)],_0x554d03=_0x2e36b5[_0x46de11(0x8d)]!==undefined?Number(_0x2e36b5[_0x46de11(0x8d)]):undefined;if(_0x9a00e9[_0x46de11(0xe3)]){console[_0x46de11(0xdc)](_0x46de11(0xbf)+_0x503f0c);if(_0x582485)console[_0x46de11(0xdc)](_0x46de11(0xfb)+_0x582485);if(_0x554d03)console[_0x46de11(0xdc)](_0x46de11(0xf7)+_0x554d03);}const _0xf96453=await withSpinner(_0x46de11(0xd7),()=>_0x14ed82[_0x46de11(0xa3)][_0x46de11(0xe1)](_0x503f0c,{'time':_0x582485,'num':_0x554d03}),{'verbose':_0x9a00e9['verbose']}),_0xa59b5d=_0xf96453[_0x46de11(0xd3)]['jobs'];console['error'](_0x46de11(0xad)+_0xa59b5d[_0x46de11(0xf6)]+_0x46de11(0x10f)+(_0xa59b5d[_0x46de11(0xf6)]!==0x1?'s':'')+_0x46de11(0xe9));for(const _0x4b9274 of _0xa59b5d){console[_0x46de11(0xdc)](_0x46de11(0xb9)+_0x4b9274[_0x46de11(0xac)]);}return await handleSDKOutput(_0xa59b5d,_0x9a00e9),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a33_0x1e4fb4(0xa9)]=a33_0x1e4fb4(0xe2);[a33_0x1e4fb4(0x86)]='Show\x20schedule\x20execution\x20history';[a33_0x1e4fb4(0xa8)](_0x419cd9){const _0x4af94e=a33_0x1e4fb4,_0xb1806=_0x419cd9['args'][0x0];if(!_0xb1806)return _0x4af94e(0xd2);return undefined;}async[a33_0x1e4fb4(0xc4)](_0x16ea9e){const _0x18b60b=a33_0x1e4fb4,{options:_0x1b568a,args:_0x80cdcd,tdx:_0x3f1b36}=_0x16ea9e,_0x303b0a=_0x80cdcd[0x0],_0x17680e=_0x1b568a,_0x383452=_0x17680e[_0x18b60b(0xff)]!==undefined?Number(_0x17680e[_0x18b60b(0xff)]):undefined,_0x133339=_0x17680e['to']!==undefined?Number(_0x17680e['to']):undefined,_0x592db0=await withSpinner('Getting\x20schedule\x20history...',()=>_0x3f1b36[_0x18b60b(0xa3)]['history'](_0x303b0a,{'from':_0x383452,'to':_0x133339}),{'verbose':_0x1b568a['verbose']}),_0x56be16=_0x592db0['data'];console[_0x18b60b(0xdc)]('Found\x20'+_0x56be16[_0x18b60b(0x10c)]+'\x20execution'+(_0x56be16['count']!==0x1?'s':'')+_0x18b60b(0xcd)+_0x56be16[_0x18b60b(0xff)]+'-'+_0x56be16['to']+')');const _0x536f8a=_0x56be16[_0x18b60b(0x106)][_0x18b60b(0xc3)](_0x469d3c=>({'job_id':_0x469d3c['job_id'],'type':_0x469d3c[_0x18b60b(0xd9)],'status':_0x469d3c[_0x18b60b(0xc0)],'scheduled_at':_0x469d3c[_0x18b60b(0xbb)],'created_at':_0x469d3c[_0x18b60b(0x100)],'start_at':_0x469d3c[_0x18b60b(0x10d)],'end_at':_0x469d3c[_0x18b60b(0x112)]}));return await handleSDKOutput(_0x536f8a,_0x1b568a),0x0;}}
1
+ const a33_0x3cb5a9=a33_0x472d;(function(_0x1fba55,_0x401ef5){const _0x223a68=a33_0x472d,_0x4839fd=_0x1fba55();while(!![]){try{const _0x48acf5=-parseInt(_0x223a68(0xe9))/0x1*(-parseInt(_0x223a68(0x10a))/0x2)+parseInt(_0x223a68(0xe4))/0x3*(-parseInt(_0x223a68(0xee))/0x4)+-parseInt(_0x223a68(0x10c))/0x5+-parseInt(_0x223a68(0xf1))/0x6*(parseInt(_0x223a68(0x14c))/0x7)+-parseInt(_0x223a68(0x104))/0x8+-parseInt(_0x223a68(0x156))/0x9*(parseInt(_0x223a68(0xc9))/0xa)+parseInt(_0x223a68(0xe0))/0xb;if(_0x48acf5===_0x401ef5)break;else _0x4839fd['push'](_0x4839fd['shift']());}catch(_0x12d70e){_0x4839fd['push'](_0x4839fd['shift']());}}}(a33_0x5be9,0x7dd81));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 a33_0x472d(_0x3f9a71,_0x5e5e43){_0x3f9a71=_0x3f9a71-0xc8;const _0x5be90e=a33_0x5be9();let _0x472d24=_0x5be90e[_0x3f9a71];return _0x472d24;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a33_0x5be9(){const _0x4478dc=['last_job','list','user_name','81598cyAqEe','priority','2323730rDOSfZ','\x20\x20Job\x20ID:\x20','Updating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','trino','\x20scheduled\x20quer','type','Run\x20a\x20scheduled\x20query\x20immediately','next_run_at','INVALID_ARGUMENT','verbose','Showing\x20first\x20','jobs','(unnamed)','log','Found\x20','retryLimit','m\x20ago','yes','jsonl','time_zone','engineVersion','\x20schedules','ies','...','options','success','retry_limit','Update\x20a\x20scheduled\x20query','statusIcon','error','utf-8','Failed\x20to\x20read\x20file:\x20','delay','Searching\x20scheduled\x20queries\x20matching\x20\x22','user','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Schedule\x20updated:\x20','data','Show\x20schedule\x20execution\x20history','h\x20ago','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','in\x20','nextRun','\x20job','map','database','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Schedule\x20deleted:\x20','Schedule\x20run\x20submitted:\x20','end_at','round','name','max','red','ended_at','Deleting\x20schedule...','just\x20now','limit','Schedule\x20created:\x20','/app/queries/editor?queryId=','\x20execution','Getting\x20schedule\x20history...','query','131873SzEiya','padEnd','queries','status','d\x20ago','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','green','execute','num','keys','6471TmxnOv','from','scheduled_at','schedule:history','740AIcLdy','result','length','\x20(showing\x20','schedule:delete','history','lastRun','tsv','cron','show','Show\x20schedule\x20details','\x22...','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','List\x20scheduled\x20queries','Create\x20a\x20scheduled\x20query','\x20\x20Type:\x20','soon','cyan','substring','\x20\x20Num:\x20','πŸ“…\x20','getTime','No\x20scheduled\x20queries\x20found','15691731ucbqIM','time','Updating\x20schedule:\x20','validate','1017033ztkwyT','Cancelled','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','schedules','Running\x20schedule...','13oVSlVZ','json','executing_user_id','schedule:list','pagination','4JcYJCT','count','timezone','96RbPAZe','format','args','\x20created','job_id','created_at','Creating\x20schedule...','description','abs','schedule:create','has_next_page','schedule:update','Creating\x20schedule:\x20','schedule:run','updated_at','output','trim','Getting\x20schedule\x20details...','\x20\x20Cron:\x20','2264512PUCNyi','dim','file'];a33_0x5be9=function(){return _0x4478dc;};return a33_0x5be9();}import{hyperlink}from'../sdk/util/formatters.js';import a33_0x8b8cd5 from'chalk';function formatRelativeTime(_0x3634db){const _0x58361d=a33_0x472d,_0x2713f8=new Date(_0x3634db),_0x1afc05=new Date(),_0x846ace=_0x2713f8[_0x58361d(0xde)]()-_0x1afc05[_0x58361d(0xde)](),_0x152e4d=Math[_0x58361d(0xf9)](_0x846ace)/0x3e8,_0x368bc4=_0x846ace<0x0;if(_0x152e4d<0x3c)return _0x368bc4?_0x58361d(0x145):_0x58361d(0xd9);else{if(_0x152e4d<0xe10){const _0x55f51=Math[_0x58361d(0x13f)](_0x152e4d/0x3c);return _0x368bc4?_0x55f51+_0x58361d(0x11d):_0x58361d(0x136)+_0x55f51+'m';}else{if(_0x152e4d<0x15180){const _0x4b856f=Math[_0x58361d(0x13f)](_0x152e4d/0xe10);return _0x368bc4?_0x4b856f+_0x58361d(0x134):_0x58361d(0x136)+_0x4b856f+'h';}else{if(_0x152e4d<0x93a80){const _0x23f8b4=Math['round'](_0x152e4d/0x15180);return _0x368bc4?_0x23f8b4+_0x58361d(0x150):'in\x20'+_0x23f8b4+'d';}else return _0x2713f8['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a33_0x3cb5a9(0x140)]=a33_0x3cb5a9(0xec);[a33_0x3cb5a9(0xf8)]=a33_0x3cb5a9(0xd6);async[a33_0x3cb5a9(0x153)](_0x1f9dee){const _0x539bf8=a33_0x3cb5a9,{options:_0x1e2681,args:_0x22f686,tdx:_0xb67392}=_0x1f9dee,_0x239b1a=resolveLimit(_0x1e2681[_0x539bf8(0x146)],DEFAULT_DISPLAY_LIMIT),_0x1af66d=_0x22f686[0x0],_0x1688b8=_0x1af66d?_0x539bf8(0x12e)+_0x1af66d+_0x539bf8(0xd4):'Listing\x20scheduled\x20queries...',_0x5b2afa=await withSpinner(_0x1688b8,()=>_0xb67392[_0x539bf8(0xe7)]['listQueries']({'limit':_0x239b1a,'scheduled':!![],'pattern':_0x1af66d}),{'verbose':_0x1e2681['verbose']}),_0x3da97f=_0x5b2afa[_0x539bf8(0x132)][_0x539bf8(0x14e)],_0x1692bf=_0x5b2afa['data'][_0x539bf8(0xed)][_0x539bf8(0xfb)],_0x5a97a2=_0x1af66d?'\x20matching\x20\x22'+_0x1af66d+'\x22':'';_0x1692bf?console[_0x539bf8(0x12a)](_0x539bf8(0x117)+_0x3da97f[_0x539bf8(0xcb)]+_0x539bf8(0x122)+_0x5a97a2+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x539bf8(0x12a)]('Found\x20'+_0x3da97f[_0x539bf8(0xcb)]+_0x539bf8(0x111)+(_0x3da97f['length']!==0x1?_0x539bf8(0x123):'y')+_0x5a97a2);if(_0x1e2681[_0x539bf8(0xf2)]===_0x539bf8(0xea)||_0x1e2681[_0x539bf8(0xf2)]===_0x539bf8(0x11f)||_0x1e2681[_0x539bf8(0xf2)]==='table'||_0x1e2681[_0x539bf8(0xf2)]===_0x539bf8(0xd0)){const _0x145dff=_0x3da97f[_0x539bf8(0x139)](_0x17f22d=>({'id':_0x17f22d['id'],'name':_0x17f22d['name'],'cron':_0x17f22d[_0x539bf8(0xd1)],'database':_0x17f22d[_0x539bf8(0x13a)]?.[_0x539bf8(0x140)],'type':_0x17f22d['type'],'timezone':_0x17f22d[_0x539bf8(0x120)],'user_name':_0x17f22d[_0x539bf8(0x12f)]?.[_0x539bf8(0x140)],'updated_at':_0x17f22d[_0x539bf8(0xff)],'next_run_at':_0x17f22d[_0x539bf8(0x114)],'last_job_status':_0x17f22d['last_job']?.[_0x539bf8(0x14f)]}));await handleSDKOutput(_0x145dff,_0x1e2681);}else{if(_0x3da97f[_0x539bf8(0xcb)]===0x0)console[_0x539bf8(0x11a)](_0x539bf8(0xdf));else{const _0x4f338a=_0x1e2681['site'],_0x48e23b=_0x3da97f[_0x539bf8(0x139)](_0x159973=>{const _0x180394=_0x539bf8,_0x24e442=_0x159973['last_job']?.[_0x180394(0x14f)]?_0x159973[_0x180394(0x107)]['status']===_0x180394(0x126)?'βœ“':'βœ—':'-',_0x2ed7be=_0x159973[_0x180394(0x107)]?.[_0x180394(0x143)]?formatRelativeTime(_0x159973[_0x180394(0x107)][_0x180394(0x143)]):'never',_0x24bbfc=_0x159973[_0x180394(0x114)]?formatRelativeTime(_0x159973[_0x180394(0x114)]):'-',_0x2b9097=_0x159973['cron']||'',_0x240c9d=_0x159973[_0x180394(0x140)]||_0x180394(0x119),_0x1b8e24=getConsoleUrl(_0x4f338a,_0x180394(0x148)+_0x159973['id']);return{'statusIcon':_0x24e442,'lastRun':_0x2ed7be,'nextRun':_0x24bbfc,'cron':_0x2b9097,'name':_0x240c9d,'queryUrl':_0x1b8e24,'status':_0x159973[_0x180394(0x107)]?.['status']};}),_0x39c3d2=Math[_0x539bf8(0x141)](..._0x48e23b['map'](_0x277c33=>_0x277c33[_0x539bf8(0xcf)][_0x539bf8(0xcb)])),_0x20e5e6=Math['max'](..._0x48e23b['map'](_0x3031fa=>_0x3031fa[_0x539bf8(0x137)][_0x539bf8(0xcb)])),_0x25f7ed=Math[_0x539bf8(0x141)](..._0x48e23b[_0x539bf8(0x139)](_0x38ca69=>_0x38ca69[_0x539bf8(0xd1)]['length'])),_0x429d69=_0x48e23b[_0x539bf8(0x139)](_0x386afa=>{const _0xed15ac=_0x539bf8,_0x4acd53=_0x386afa[_0xed15ac(0x14f)]===_0xed15ac(0x126)?a33_0x8b8cd5[_0xed15ac(0x152)](_0x386afa[_0xed15ac(0x129)]):_0x386afa[_0xed15ac(0x14f)]===_0xed15ac(0x12a)?a33_0x8b8cd5[_0xed15ac(0x142)](_0x386afa[_0xed15ac(0x129)]):a33_0x8b8cd5[_0xed15ac(0x105)](_0x386afa[_0xed15ac(0x129)]),_0x83bbdb=_0x386afa['lastRun'][_0xed15ac(0x14d)](_0x39c3d2),_0x32d494=_0x386afa[_0xed15ac(0x137)][_0xed15ac(0x14d)](_0x20e5e6),_0x5d88f2=_0x386afa['cron']?a33_0x8b8cd5[_0xed15ac(0xda)](_0x386afa[_0xed15ac(0xd1)][_0xed15ac(0x14d)](_0x25f7ed)):'\x20'['repeat'](_0x25f7ed),_0x4296d1=hyperlink(_0x386afa['name'],_0x386afa['queryUrl']);return _0xed15ac(0xdd)+_0x4acd53+'\x20'+_0x83bbdb+'\x20\x20β†’\x20'+_0x32d494+'\x20\x20'+_0x5d88f2+'\x20\x20'+_0x4296d1;});await writeOutput(_0x429d69['join']('\x0a'),_0x1e2681[_0x539bf8(0x100)],_0x539bf8(0x108));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']='schedule:show';[a33_0x3cb5a9(0xf8)]=a33_0x3cb5a9(0xd3);[a33_0x3cb5a9(0xe3)](_0x158d37){const _0x203f72=a33_0x3cb5a9,_0x36e8b9=_0x158d37[_0x203f72(0xf3)][0x0];if(!_0x36e8b9)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x46276d){const _0x3ce124=a33_0x3cb5a9,{options:_0x53d036,args:_0x358f94,tdx:_0x12908a}=_0x46276d,_0x562ec6=_0x358f94[0x0],_0x16d8c4=await withSpinner(_0x3ce124(0x102),()=>_0x12908a[_0x3ce124(0xe7)][_0x3ce124(0xd2)](_0x562ec6),{'verbose':_0x53d036[_0x3ce124(0x116)]}),_0x2ff746=_0x16d8c4['data'],_0x5bf827={'name':_0x2ff746[_0x3ce124(0x140)],'cron':_0x2ff746[_0x3ce124(0xd1)],'database':_0x2ff746[_0x3ce124(0x13a)],'type':_0x2ff746[_0x3ce124(0x112)],'timezone':_0x2ff746[_0x3ce124(0xf0)],'user_name':_0x2ff746[_0x3ce124(0x109)],'created_at':_0x2ff746[_0x3ce124(0xf6)],'engine_version':_0x2ff746['engine_version'],'executing_user_id':_0x2ff746[_0x3ce124(0xeb)],'query':_0x2ff746[_0x3ce124(0x14b)],'delay':_0x2ff746['delay'],'priority':_0x2ff746[_0x3ce124(0x10b)],'retry_limit':_0x2ff746['retry_limit'],..._0x2ff746[_0x3ce124(0xca)]&&{'result':_0x2ff746['result']}};return await handleSingleObjectOutput(_0x5bf827,_0x53d036),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a33_0x3cb5a9(0x140)]=a33_0x3cb5a9(0xfa);[a33_0x3cb5a9(0xf8)]=a33_0x3cb5a9(0xd7);['validate'](_0x2885dd){const _0x14d0f0=a33_0x3cb5a9,_0x1dad21=_0x2885dd['args'][0x0];if(!_0x1dad21)return _0x14d0f0(0x151);const _0xdae865=_0x2885dd[_0x14d0f0(0x125)];if(!_0xdae865[_0x14d0f0(0x13a)])return _0x14d0f0(0xd5);return undefined;}async[a33_0x3cb5a9(0x153)](_0x1597db){const _0x5d29e8=a33_0x3cb5a9,{options:_0x47841b,args:_0x3669da,tdx:_0x4ba48b}=_0x1597db,_0x92cfe7=_0x3669da[0x0],_0x3d28ba=_0x47841b,_0x4e2e62=_0x3d28ba['database'],_0xa7a116=_0x3d28ba[_0x5d29e8(0x106)],_0x58e292=_0x3d28ba[_0x5d29e8(0x112)]||_0x5d29e8(0x110);let _0x429435;try{_0x429435=readFileSync(_0xa7a116,'utf-8')[_0x5d29e8(0x101)]();}catch(_0x403548){throw new SDKError(ErrorCode[_0x5d29e8(0x115)],_0x5d29e8(0x12c)+_0xa7a116,_0x403548 instanceof Error?_0x403548:undefined);}if(!_0x429435)throw new SDKError(ErrorCode[_0x5d29e8(0x115)],'Query\x20file\x20is\x20empty');const _0x20e080={'database':_0x4e2e62,'query':_0x429435,'type':_0x58e292};if(_0x3d28ba[_0x5d29e8(0xd1)])_0x20e080[_0x5d29e8(0xd1)]=_0x3d28ba['cron'];if(_0x3d28ba[_0x5d29e8(0xf0)])_0x20e080[_0x5d29e8(0xf0)]=_0x3d28ba['timezone'];if(_0x3d28ba[_0x5d29e8(0x12d)]!==undefined)_0x20e080['delay']=Number(_0x3d28ba[_0x5d29e8(0x12d)]);if(_0x3d28ba[_0x5d29e8(0x10b)]!==undefined)_0x20e080[_0x5d29e8(0x10b)]=Number(_0x3d28ba['priority']);if(_0x3d28ba[_0x5d29e8(0x11c)]!==undefined)_0x20e080[_0x5d29e8(0x127)]=Number(_0x3d28ba[_0x5d29e8(0x11c)]);if(_0x3d28ba['engineVersion'])_0x20e080['engine_version']=_0x3d28ba[_0x5d29e8(0x121)];if(_0x3d28ba['result'])_0x20e080[_0x5d29e8(0xca)]=_0x3d28ba['result'];if(_0x47841b[_0x5d29e8(0x116)]){console[_0x5d29e8(0x12a)](_0x5d29e8(0xfd)+_0x92cfe7),console[_0x5d29e8(0x12a)]('\x20\x20Database:\x20'+_0x4e2e62),console[_0x5d29e8(0x12a)](_0x5d29e8(0xd8)+_0x58e292);if(_0x20e080[_0x5d29e8(0xd1)])console[_0x5d29e8(0x12a)](_0x5d29e8(0x103)+_0x20e080[_0x5d29e8(0xd1)]);if(_0x20e080[_0x5d29e8(0xf0)])console[_0x5d29e8(0x12a)]('\x20\x20Timezone:\x20'+_0x20e080[_0x5d29e8(0xf0)]);}const _0x546d6e=await withSpinner(_0x5d29e8(0xf7),()=>_0x4ba48b[_0x5d29e8(0xe7)]['create'](_0x92cfe7,_0x20e080),{'verbose':_0x47841b[_0x5d29e8(0x116)]});return console[_0x5d29e8(0x12a)](_0x5d29e8(0x147)+_0x546d6e[_0x5d29e8(0x132)][_0x5d29e8(0x140)]),await handleSingleObjectOutput(_0x546d6e[_0x5d29e8(0x132)],_0x47841b),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a33_0x3cb5a9(0x140)]=a33_0x3cb5a9(0xfc);[a33_0x3cb5a9(0xf8)]=a33_0x3cb5a9(0x128);[a33_0x3cb5a9(0xe3)](_0x2ee12c){const _0x925a81=_0x2ee12c['args'][0x0];if(!_0x925a81)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a33_0x3cb5a9(0x153)](_0x4d6725){const _0x1904bd=a33_0x3cb5a9,{options:_0x25cd8a,args:_0x2198fb,tdx:_0x16d094}=_0x4d6725,_0x1b6823=_0x2198fb[0x0],_0x3b9de2=_0x25cd8a,_0x33bd90={};if(_0x3b9de2[_0x1904bd(0x13a)])_0x33bd90[_0x1904bd(0x13a)]=_0x3b9de2['database'];if(_0x3b9de2[_0x1904bd(0x112)])_0x33bd90['type']=_0x3b9de2[_0x1904bd(0x112)];if(_0x3b9de2['cron'])_0x33bd90['cron']=_0x3b9de2[_0x1904bd(0xd1)];if(_0x3b9de2[_0x1904bd(0xf0)])_0x33bd90['timezone']=_0x3b9de2[_0x1904bd(0xf0)];if(_0x3b9de2['delay']!==undefined)_0x33bd90['delay']=Number(_0x3b9de2[_0x1904bd(0x12d)]);if(_0x3b9de2[_0x1904bd(0x10b)]!==undefined)_0x33bd90[_0x1904bd(0x10b)]=Number(_0x3b9de2[_0x1904bd(0x10b)]);if(_0x3b9de2[_0x1904bd(0x11c)]!==undefined)_0x33bd90[_0x1904bd(0x127)]=Number(_0x3b9de2[_0x1904bd(0x11c)]);if(_0x3b9de2[_0x1904bd(0x121)])_0x33bd90['engine_version']=_0x3b9de2[_0x1904bd(0x121)];if(_0x3b9de2[_0x1904bd(0xca)])_0x33bd90[_0x1904bd(0xca)]=_0x3b9de2[_0x1904bd(0xca)];if(_0x3b9de2[_0x1904bd(0x106)])try{_0x33bd90[_0x1904bd(0x14b)]=readFileSync(_0x3b9de2['file'],_0x1904bd(0x12b))[_0x1904bd(0x101)]();}catch(_0x396bf2){throw new SDKError(ErrorCode[_0x1904bd(0x115)],_0x1904bd(0x12c)+_0x3b9de2[_0x1904bd(0x106)],_0x396bf2 instanceof Error?_0x396bf2:undefined);}if(Object[_0x1904bd(0x155)](_0x33bd90)[_0x1904bd(0xcb)]===0x0)throw new SDKError(ErrorCode[_0x1904bd(0x115)],_0x1904bd(0x13b));if(_0x25cd8a[_0x1904bd(0x116)]){console['error'](_0x1904bd(0xe2)+_0x1b6823);for(const [_0x50c099,_0x23a6b0]of Object['entries'](_0x33bd90)){_0x50c099===_0x1904bd(0x14b)?console[_0x1904bd(0x12a)]('\x20\x20'+_0x50c099+':\x20'+_0x23a6b0[_0x1904bd(0xdb)](0x0,0x32)+_0x1904bd(0x124)):console[_0x1904bd(0x12a)]('\x20\x20'+_0x50c099+':\x20'+_0x23a6b0);}}const _0xbb23a4=await withSpinner(_0x1904bd(0x10e),()=>_0x16d094[_0x1904bd(0xe7)]['update'](_0x1b6823,_0x33bd90),{'verbose':_0x25cd8a[_0x1904bd(0x116)]});return console['error'](_0x1904bd(0x131)+_0xbb23a4[_0x1904bd(0x132)][_0x1904bd(0x140)]),await handleSingleObjectOutput(_0xbb23a4['data'],_0x25cd8a),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a33_0x3cb5a9(0x140)]=a33_0x3cb5a9(0xcd);[a33_0x3cb5a9(0xf8)]='Delete\x20a\x20scheduled\x20query';[a33_0x3cb5a9(0xe3)](_0x412483){const _0x28d0de=a33_0x3cb5a9,_0x3e0346=_0x412483['args'][0x0];if(!_0x3e0346)return _0x28d0de(0xe6);return undefined;}async[a33_0x3cb5a9(0x153)](_0x37580f){const _0x206723=a33_0x3cb5a9,{options:_0x475d18,args:_0xce3ef7,tdx:_0x142a75}=_0x37580f,_0x6520f4=_0xce3ef7[0x0];if(!_0x475d18[_0x206723(0x11e)]){const _0xbc1265=await confirm(_0x206723(0x135)+_0x6520f4+'\x22?');if(!_0xbc1265)return console[_0x206723(0x12a)](_0x206723(0xe5)),0x0;}const _0x41c8fc=await withSpinner(_0x206723(0x144),()=>_0x142a75[_0x206723(0xe7)]['delete'](_0x6520f4),{'verbose':_0x475d18[_0x206723(0x116)]});return console[_0x206723(0x12a)](_0x206723(0x13c)+_0x41c8fc[_0x206723(0x132)][_0x206723(0x140)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a33_0x3cb5a9(0xfe);[a33_0x3cb5a9(0xf8)]=a33_0x3cb5a9(0x113);[a33_0x3cb5a9(0xe3)](_0x4c3998){const _0xe4e56e=a33_0x3cb5a9,_0x543c82=_0x4c3998[_0xe4e56e(0xf3)][0x0];if(!_0x543c82)return _0xe4e56e(0x130);return undefined;}async[a33_0x3cb5a9(0x153)](_0x1da0bd){const _0x28c6ba=a33_0x3cb5a9,{options:_0x11994f,args:_0x77fc3f,tdx:_0x50c682}=_0x1da0bd,_0x54cc32=_0x77fc3f[0x0],_0x507ef6=_0x11994f,_0x58322f=_0x507ef6[_0x28c6ba(0xe1)],_0xa3762c=_0x507ef6[_0x28c6ba(0x154)]!==undefined?Number(_0x507ef6[_0x28c6ba(0x154)]):undefined;if(_0x11994f[_0x28c6ba(0x116)]){console[_0x28c6ba(0x12a)]('Running\x20schedule:\x20'+_0x54cc32);if(_0x58322f)console[_0x28c6ba(0x12a)]('\x20\x20Time:\x20'+_0x58322f);if(_0xa3762c)console[_0x28c6ba(0x12a)](_0x28c6ba(0xdc)+_0xa3762c);}const _0x1e4a43=await withSpinner(_0x28c6ba(0xe8),()=>_0x50c682['schedules']['run'](_0x54cc32,{'time':_0x58322f,'num':_0xa3762c}),{'verbose':_0x11994f['verbose']}),_0x113022=_0x1e4a43['data'][_0x28c6ba(0x118)];console[_0x28c6ba(0x12a)](_0x28c6ba(0x13d)+_0x113022['length']+_0x28c6ba(0x138)+(_0x113022[_0x28c6ba(0xcb)]!==0x1?'s':'')+_0x28c6ba(0xf4));for(const _0x5b6d0f of _0x113022){console[_0x28c6ba(0x12a)](_0x28c6ba(0x10d)+_0x5b6d0f[_0x28c6ba(0xf5)]);}return await handleSDKOutput(_0x113022,_0x11994f),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a33_0x3cb5a9(0x140)]=a33_0x3cb5a9(0xc8);[a33_0x3cb5a9(0xf8)]=a33_0x3cb5a9(0x133);[a33_0x3cb5a9(0xe3)](_0x216af8){const _0x2471ba=a33_0x3cb5a9,_0x5b8997=_0x216af8['args'][0x0];if(!_0x5b8997)return _0x2471ba(0x10f);return undefined;}async[a33_0x3cb5a9(0x153)](_0x592b97){const _0x34bb1d=a33_0x3cb5a9,{options:_0x4cd3f0,args:_0x12f4c3,tdx:_0xf41c59}=_0x592b97,_0x489356=_0x12f4c3[0x0],_0x5b58cb=_0x4cd3f0,_0x14ff70=_0x5b58cb[_0x34bb1d(0x157)]!==undefined?Number(_0x5b58cb[_0x34bb1d(0x157)]):undefined,_0x18e7db=_0x5b58cb['to']!==undefined?Number(_0x5b58cb['to']):undefined,_0x49a2f4=await withSpinner(_0x34bb1d(0x14a),()=>_0xf41c59['schedules'][_0x34bb1d(0xce)](_0x489356,{'from':_0x14ff70,'to':_0x18e7db}),{'verbose':_0x4cd3f0[_0x34bb1d(0x116)]}),_0x5bcf9c=_0x49a2f4[_0x34bb1d(0x132)];console[_0x34bb1d(0x12a)](_0x34bb1d(0x11b)+_0x5bcf9c[_0x34bb1d(0xef)]+_0x34bb1d(0x149)+(_0x5bcf9c[_0x34bb1d(0xef)]!==0x1?'s':'')+_0x34bb1d(0xcc)+_0x5bcf9c[_0x34bb1d(0x157)]+'-'+_0x5bcf9c['to']+')');const _0x11189f=_0x5bcf9c[_0x34bb1d(0xce)]['map'](_0xc2d386=>({'job_id':_0xc2d386[_0x34bb1d(0xf5)],'type':_0xc2d386[_0x34bb1d(0x112)],'status':_0xc2d386[_0x34bb1d(0x14f)],'scheduled_at':_0xc2d386[_0x34bb1d(0x158)],'created_at':_0xc2d386['created_at'],'start_at':_0xc2d386['start_at'],'end_at':_0xc2d386[_0x34bb1d(0x13e)]}));return await handleSDKOutput(_0x11189f,_0x4cd3f0),0x0;}}
@@ -1 +1 @@
1
- const a34_0xbe1e3b=a34_0x4609;(function(_0xee30f3,_0x2b05d4){const _0x43fc13=a34_0x4609,_0x32689b=_0xee30f3();while(!![]){try{const _0x21ff55=-parseInt(_0x43fc13(0x130))/0x1*(-parseInt(_0x43fc13(0x1a5))/0x2)+-parseInt(_0x43fc13(0x174))/0x3+-parseInt(_0x43fc13(0x1b8))/0x4*(-parseInt(_0x43fc13(0x1c7))/0x5)+parseInt(_0x43fc13(0x12a))/0x6+-parseInt(_0x43fc13(0x120))/0x7+-parseInt(_0x43fc13(0x188))/0x8*(-parseInt(_0x43fc13(0x17e))/0x9)+parseInt(_0x43fc13(0x12f))/0xa*(-parseInt(_0x43fc13(0x15e))/0xb);if(_0x21ff55===_0x2b05d4)break;else _0x32689b['push'](_0x32689b['shift']());}catch(_0x2fc2d9){_0x32689b['push'](_0x32689b['shift']());}}}(a34_0x4208,0x2eace));function a34_0x4609(_0x10c7ca,_0x38cab8){_0x10c7ca=_0x10c7ca-0x120;const _0x420882=a34_0x4208();let _0x4609e4=_0x420882[_0x10c7ca];return _0x4609e4;}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 a34_0x42cb39 from'chalk';async function resolveSegmentTarget(_0x3d7f0f,_0x2f9509,_0x189a72){const _0x4b891f=a34_0x4609;if(isYamlFilePath(_0x3d7f0f))try{const _0x59546a=await resolveYamlFilePath(_0x3d7f0f);return _0x189a72&&(console[_0x4b891f(0x143)](_0x4b891f(0x139)+_0x3d7f0f),console[_0x4b891f(0x143)](_0x4b891f(0x12b)+_0x59546a[_0x4b891f(0x198)]),console[_0x4b891f(0x143)](_0x4b891f(0x1bc)+_0x59546a[_0x4b891f(0x181)]),console[_0x4b891f(0x143)](_0x4b891f(0x1c6)+(_0x59546a['folderPath']||_0x4b891f(0x15a))),console[_0x4b891f(0x143)](_0x4b891f(0x16e)+_0x59546a[_0x4b891f(0x142)])),_0x59546a[_0x4b891f(0x142)];}catch(_0x552e5c){throw new SDKError(ErrorCode[_0x4b891f(0x17a)],_0x4b891f(0x169)+_0x552e5c[_0x4b891f(0x129)]);}if(!_0x2f9509)throw new SDKError(ErrorCode[_0x4b891f(0x17a)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x2f9509+'/'+_0x3d7f0f;}export class SegmentDescribeCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]='segment:describe';[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x1be);async[a34_0xbe1e3b(0x164)](_0x4fdada){const _0x2fb724=a34_0xbe1e3b,{options:_0x31e220,args:_0x55148e,tdx:_0x4acb9f}=_0x4fdada,_0x42148a=_0x55148e[0x0],_0x4b8a41=!_0x42148a&&!!_0x31e220[_0x2fb724(0x198)],_0x4ae643=_0x42148a||_0x31e220[_0x2fb724(0x198)];if(!_0x4ae643)return console[_0x2fb724(0x143)](_0x2fb724(0x145)),console[_0x2fb724(0x143)](_0x2fb724(0x123)),console[_0x2fb724(0x143)](_0x2fb724(0x156)),console['error'](_0x2fb724(0x13d)),console[_0x2fb724(0x143)](_0x2fb724(0x1a6)),console[_0x2fb724(0x143)](_0x2fb724(0x14a)),console[_0x2fb724(0x143)](_0x2fb724(0x191)),0x1;try{const _0x35de48=_0x31e220[_0x2fb724(0x146)];let _0x587155=_0x4ae643;!_0x4b8a41&&_0x35de48&&!_0x4ae643[_0x2fb724(0x1ad)]('/')&&(_0x587155=_0x35de48+'/'+_0x4ae643,_0x31e220[_0x2fb724(0x190)]&&console[_0x2fb724(0x143)](_0x2fb724(0x14e)+_0x587155));const _0x2d6d39=await withSpinner(_0x2fb724(0x167)+_0x587155+_0x2fb724(0x137),()=>_0x4acb9f[_0x2fb724(0x1b9)]['resolvePathToResource'](_0x587155),{'verbose':_0x31e220[_0x2fb724(0x190)]}),_0x1b7f13=_0x2d6d39['data'];_0x31e220[_0x2fb724(0x190)]&&(console[_0x2fb724(0x143)](_0x2fb724(0x1ab)+_0x1b7f13[_0x2fb724(0x18d)]),console[_0x2fb724(0x143)]('Parent\x20ID:\x20'+_0x1b7f13[_0x2fb724(0x1bb)]),_0x1b7f13[_0x2fb724(0x17d)]&&console[_0x2fb724(0x143)](_0x2fb724(0x19f)+_0x1b7f13['folderId']),_0x1b7f13[_0x2fb724(0x1b3)]&&console[_0x2fb724(0x143)](_0x2fb724(0x141)+_0x1b7f13[_0x2fb724(0x1b3)]));if(_0x1b7f13['type']===_0x2fb724(0x13a)){const _0x29562d=await withSpinner(_0x2fb724(0x134),()=>_0x4acb9f[_0x2fb724(0x1b9)]['getParent'](_0x1b7f13['parentId']),{'verbose':_0x31e220[_0x2fb724(0x190)]});await handleSingleObjectOutput(_0x29562d[_0x2fb724(0x14b)],_0x31e220);}else{if(_0x1b7f13[_0x2fb724(0x18d)]===_0x2fb724(0x122)){if(!_0x1b7f13[_0x2fb724(0x17d)])throw new SDKError(ErrorCode[_0x2fb724(0x147)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5b56af=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4acb9f[_0x2fb724(0x1b9)][_0x2fb724(0x1c5)](_0x1b7f13[_0x2fb724(0x17d)]),{'verbose':_0x31e220[_0x2fb724(0x190)]});await handleSingleObjectOutput(_0x5b56af[_0x2fb724(0x14b)],_0x31e220);}else{if(_0x1b7f13[_0x2fb724(0x18d)]==='segment'){if(!_0x1b7f13[_0x2fb724(0x1b3)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2fb724(0x183));const _0x2be9b4=await withSpinner(_0x2fb724(0x16c),()=>_0x4acb9f['segment'][_0x2fb724(0x160)](_0x1b7f13[_0x2fb724(0x1bb)],_0x1b7f13[_0x2fb724(0x1b3)]),{'verbose':_0x31e220['verbose']});await handleSingleObjectOutput(_0x2be9b4[_0x2fb724(0x14b)],_0x31e220);}}}return 0x0;}catch(_0x570e45){if(_0x570e45 instanceof SDKError)return console[_0x2fb724(0x143)](_0x2fb724(0x182)+_0x570e45[_0x2fb724(0x129)]),_0x570e45[_0x2fb724(0x1a2)]&&console['error']('\x20\x20Cause:\x20'+_0x570e45[_0x2fb724(0x1a2)]),0x1;throw _0x570e45;}}}export class SegmentShowCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x133);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x184);async[a34_0xbe1e3b(0x164)](_0x4956e6){const _0xc05393=a34_0xbe1e3b,{options:_0xf89c74,args:_0x1acd19,tdx:_0x4ffb67}=_0x4956e6,_0x33c59d=_0x1acd19[0x0];if(!_0x33c59d)return console['error'](_0xc05393(0x149)),console[_0xc05393(0x143)](_0xc05393(0x17b)),console[_0xc05393(0x143)](_0xc05393(0x1c2)),console['error'](_0xc05393(0x156)),console[_0xc05393(0x143)](_0xc05393(0x1b4)),console[_0xc05393(0x143)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2b3205=_0xf89c74[_0xc05393(0x198)],_0x25eb13=await resolveSegmentTarget(_0x33c59d,_0x2b3205,_0xf89c74['verbose']);_0xf89c74[_0xc05393(0x190)]&&console[_0xc05393(0x143)](_0xc05393(0x163)+_0x25eb13);const _0xb010e8=await withSpinner('Resolving\x20\x27'+_0x33c59d+_0xc05393(0x137),()=>_0x4ffb67[_0xc05393(0x1b9)][_0xc05393(0x16a)](_0x25eb13),{'verbose':_0xf89c74[_0xc05393(0x190)]}),_0x2c4d14=_0xb010e8['data'];_0xf89c74['verbose']&&(console[_0xc05393(0x143)]('Resolved\x20type:\x20'+_0x2c4d14[_0xc05393(0x18d)]),console['error'](_0xc05393(0x173)+_0x2c4d14[_0xc05393(0x1bb)]));if(_0x2c4d14[_0xc05393(0x18d)]===_0xc05393(0x122))return console[_0xc05393(0x143)](_0xc05393(0x12e)),console[_0xc05393(0x143)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x2c4d14[_0xc05393(0x18d)]==='parent')return console[_0xc05393(0x143)](_0xc05393(0x1af)),console[_0xc05393(0x143)](_0xc05393(0x1bf)),0x1;if(!_0x2c4d14[_0xc05393(0x1b3)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xc05393(0x183));const _0x4d5d84=await withSpinner(_0xc05393(0x192),()=>_0x4ffb67[_0xc05393(0x1b9)][_0xc05393(0x186)](_0x2c4d14[_0xc05393(0x1bb)],_0x2c4d14[_0xc05393(0x1b3)]),{'verbose':_0xf89c74['verbose']});let _0xe092c5=_0x4d5d84['data'];const _0x472972=resolveLimit(_0xf89c74[_0xc05393(0x1b1)],DEFAULT_DISPLAY_LIMIT),_0x34287f=/\bLIMIT\s+\d+/i[_0xc05393(0x1bd)](_0xe092c5);!_0x34287f&&(_0xe092c5=_0xe092c5[_0xc05393(0x1c8)]()[_0xc05393(0x179)](/;+$/,''),_0xe092c5=_0xc05393(0x127)+_0xe092c5+_0xc05393(0x166)+_0x472972);_0xf89c74[_0xc05393(0x190)]&&console[_0xc05393(0x143)](_0xc05393(0x18a)+_0xe092c5);const _0x4f48d7=await withProgressSpinner(_0xc05393(0x1b2),async _0x7ff6de=>{const _0x3a92e2=_0xc05393,_0x134fea=await _0x4ffb67['query']['execute'](_0xe092c5,{'catalog':'td','schema':_0x3a92e2(0x19c),'onJobId':_0x388ef6=>{const _0x532179=_0x3a92e2;_0x7ff6de[_0x532179(0x1a7)](_0x388ef6);}});return _0x134fea;},{'verbose':_0xf89c74[_0xc05393(0x190)]}),_0x72cd07=_0x4f48d7['data'],_0x22856f=_0x72cd07[_0xc05393(0x161)]?_0xc05393(0x13b)+_0x72cd07[_0xc05393(0x161)]+']':'';return console[_0xc05393(0x143)](_0xc05393(0x1ae)+_0x72cd07['stats'][_0xc05393(0x131)][_0xc05393(0x13f)]()+'\x20rows\x20'+(_0xc05393(0x124)+formatElapsed(_0x72cd07[_0xc05393(0x157)][_0xc05393(0x125)])+_0x22856f)),await handleQueryOutput(_0x72cd07,_0xf89c74),0x0;}catch(_0x1fbe04){if(_0x1fbe04 instanceof SDKError)return console[_0xc05393(0x143)](_0xc05393(0x159)+_0x1fbe04['code']+']'),console[_0xc05393(0x143)]('\x0a'+_0x1fbe04[_0xc05393(0x129)]),0x1;throw _0x1fbe04;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a34_0xbe1e3b(0x14c);['description']=a34_0xbe1e3b(0x151);async['execute'](_0x216733){const _0x3cd380=a34_0xbe1e3b,{options:_0x5210b1,args:_0x4a579a,tdx:_0x39aac1}=_0x216733;if(_0x4a579a['length']===0x0)return console[_0x3cd380(0x143)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3cd380(0x143)](_0x3cd380(0x15c)),0x1;const _0x3435c6=_0x4a579a[0x0];try{_0x5210b1[_0x3cd380(0x190)]&&(console[_0x3cd380(0x143)](_0x3cd380(0x1c3)+_0x5210b1[_0x3cd380(0x18b)]),console['error'](_0x3cd380(0x1a3)+_0x3435c6));const _0x1e15b5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3435c6+_0x3cd380(0x137),()=>_0x39aac1[_0x3cd380(0x1b9)][_0x3cd380(0x19a)](_0x3435c6),{'verbose':_0x5210b1[_0x3cd380(0x190)]}),_0x226876=_0x1e15b5[_0x3cd380(0x14b)];_0x5210b1[_0x3cd380(0x190)]&&console[_0x3cd380(0x143)](_0x3cd380(0x196)+_0x226876);const _0x3024bb=await withSpinner(_0x3cd380(0x1a8)+_0x3435c6+_0x3cd380(0x137),()=>_0x39aac1['segment']['listFolders'](_0x226876),{'verbose':_0x5210b1['verbose']}),_0x245c8d=_0x3024bb[_0x3cd380(0x14b)];return console[_0x3cd380(0x143)]('βœ”\x20Found\x20'+_0x245c8d[_0x3cd380(0x180)]+_0x3cd380(0x176)+(_0x245c8d[_0x3cd380(0x180)]!==0x1?'s':'')),await handleSDKOutput(_0x245c8d,_0x5210b1),0x0;}catch(_0x32037c){if(_0x32037c instanceof SDKError)return console[_0x3cd380(0x143)]('Error:\x20'+_0x32037c[_0x3cd380(0x129)]),_0x32037c[_0x3cd380(0x1a2)]&&console[_0x3cd380(0x143)]('\x20\x20Cause:\x20'+_0x32037c[_0x3cd380(0x1a2)]),0x1;throw _0x32037c;}}}export class SegmentFolderShowCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x19e);['description']=a34_0xbe1e3b(0x175);async[a34_0xbe1e3b(0x164)](_0x46354b){const _0x1eeb8e=a34_0xbe1e3b,{options:_0x1b4ef3,args:_0x3b44e0,tdx:_0x50c202}=_0x46354b;if(_0x3b44e0[_0x1eeb8e(0x180)]===0x0)return console[_0x1eeb8e(0x143)](_0x1eeb8e(0x121)),console[_0x1eeb8e(0x143)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x38019a,childId:_0x22804e}=parseSegmentRef(_0x3b44e0[0x0]);_0x1b4ef3[_0x1eeb8e(0x190)]&&(console[_0x1eeb8e(0x143)](_0x1eeb8e(0x1c3)+_0x1b4ef3[_0x1eeb8e(0x18b)]),console[_0x1eeb8e(0x143)](_0x1eeb8e(0x1a3)+_0x38019a),_0x22804e&&console['error'](_0x1eeb8e(0x1c0)+_0x22804e));if(!_0x22804e)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x30df91=await withSpinner(_0x1eeb8e(0x1c9)+_0x38019a+_0x1eeb8e(0x137),()=>_0x50c202[_0x1eeb8e(0x1b9)]['resolveParentId'](_0x38019a),{'verbose':_0x1b4ef3['verbose']}),_0x56abb3=_0x30df91[_0x1eeb8e(0x14b)];_0x1b4ef3[_0x1eeb8e(0x190)]&&console[_0x1eeb8e(0x143)](_0x1eeb8e(0x196)+_0x56abb3);const _0x43c14c=await withSpinner(_0x1eeb8e(0x15f)+_0x22804e+_0x1eeb8e(0x137),()=>_0x50c202['segment']['resolveFolderId'](_0x56abb3,_0x22804e),{'verbose':_0x1b4ef3[_0x1eeb8e(0x190)]}),_0x5d3c8e=_0x43c14c[_0x1eeb8e(0x14b)];_0x1b4ef3[_0x1eeb8e(0x190)]&&console[_0x1eeb8e(0x143)](_0x1eeb8e(0x135)+_0x5d3c8e);const _0x455f83=await withSpinner(_0x1eeb8e(0x16f)+_0x22804e+_0x1eeb8e(0x137),()=>_0x50c202[_0x1eeb8e(0x1b9)]['getFolder'](_0x5d3c8e),{'verbose':_0x1b4ef3[_0x1eeb8e(0x190)]});return await handleSDKOutput([_0x455f83['data']],_0x1b4ef3),0x0;}catch(_0x545aeb){if(_0x545aeb instanceof SDKError)return console['error'](_0x1eeb8e(0x182)+_0x545aeb['message']),_0x545aeb['cause']&&console[_0x1eeb8e(0x143)]('\x20\x20Cause:\x20'+_0x545aeb[_0x1eeb8e(0x1a2)]),0x1;throw _0x545aeb;}}}export class SegmentSQLCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x14d);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x18f);async[a34_0xbe1e3b(0x164)](_0x3988b){const _0x2af5c6=a34_0xbe1e3b,{options:_0x542695,args:_0x154ed0}=_0x3988b,_0x3c1ebf=_0x542695,_0x12494f=_0x3c1ebf[_0x2af5c6(0x1a4)],_0x43857e=_0x154ed0[0x0];if(!_0x43857e&&!_0x12494f)return console[_0x2af5c6(0x143)](a34_0x42cb39['red']('Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required')),console[_0x2af5c6(0x143)](_0x2af5c6(0x154)),console[_0x2af5c6(0x143)](_0x2af5c6(0x1aa)),console[_0x2af5c6(0x143)](_0x2af5c6(0x1a9)),console[_0x2af5c6(0x143)](_0x2af5c6(0x156)),console['error'](_0x2af5c6(0x136)),console[_0x2af5c6(0x143)](_0x2af5c6(0x1b7)),0x1;if(_0x43857e&&_0x12494f)return console[_0x2af5c6(0x143)](a34_0x42cb39[_0x2af5c6(0x18c)](_0x2af5c6(0x197))),0x1;try{let _0x315afc;if(_0x12494f)_0x315afc=await this['getSQLFromYamlFile'](_0x12494f,_0x3988b);else{if(isYamlFilePath(_0x43857e))return console[_0x2af5c6(0x143)](a34_0x42cb39[_0x2af5c6(0x18c)](_0x2af5c6(0x15d))),console[_0x2af5c6(0x143)](_0x2af5c6(0x19d)+_0x43857e),0x1;else _0x315afc=await this[_0x2af5c6(0x171)](_0x43857e,_0x3988b);}return _0x542695['format']===_0x2af5c6(0x1a1)||_0x542695[_0x2af5c6(0x13c)]===_0x2af5c6(0x185)?await handleSDKOutput([{'sql':_0x315afc}],_0x542695):console[_0x2af5c6(0x199)](_0x315afc),0x0;}catch(_0xac9f05){if(_0xac9f05 instanceof SDKError)return console['error'](_0x2af5c6(0x182)+_0xac9f05[_0x2af5c6(0x129)]),_0xac9f05[_0x2af5c6(0x1a2)]&&console[_0x2af5c6(0x143)](_0x2af5c6(0x128)+_0xac9f05[_0x2af5c6(0x1a2)]),0x1;throw _0xac9f05;}}async['getSQLFromYamlFile'](_0x36f457,_0x202af7){const _0x510ac1=a34_0xbe1e3b,{options:_0xff8bb4,tdx:_0x2ef656}=_0x202af7;let _0x24ef6;try{_0x24ef6=await resolveYamlFilePath(_0x36f457);}catch(_0x2d366c){throw new SDKError(ErrorCode[_0x510ac1(0x17a)],_0x510ac1(0x169)+_0x2d366c[_0x510ac1(0x129)]);}_0xff8bb4['verbose']&&console['error'](_0x510ac1(0x140)+_0x24ef6[_0x510ac1(0x198)]+'/'+_0x24ef6[_0x510ac1(0x181)]);const _0x1899fd=await withSpinner(_0x510ac1(0x194),()=>_0x2ef656[_0x510ac1(0x1b9)]['getSegmentSQLFromYaml'](_0x24ef6['content'],_0x24ef6['parentSegment'],_0x24ef6[_0x510ac1(0x181)]),{'verbose':_0xff8bb4[_0x510ac1(0x190)]});return _0x1899fd['data'];}async[a34_0xbe1e3b(0x171)](_0xb00ab4,_0x15e8c0){const _0x427626=a34_0xbe1e3b,{options:_0x4ee9e2,tdx:_0x41d3cc}=_0x15e8c0,_0x572d64=_0x4ee9e2[_0x427626(0x198)],_0x1d10e4=await resolveSegmentTarget(_0xb00ab4,_0x572d64,_0x4ee9e2['verbose']);_0x4ee9e2['verbose']&&console['error'](_0x427626(0x163)+_0x1d10e4);const _0xc39522=await withSpinner('Resolving\x20\x27'+_0xb00ab4+_0x427626(0x137),()=>_0x41d3cc[_0x427626(0x1b9)]['resolvePathToResource'](_0x1d10e4),{'verbose':_0x4ee9e2[_0x427626(0x190)]}),_0x134c70=_0xc39522[_0x427626(0x14b)];_0x4ee9e2[_0x427626(0x190)]&&(console[_0x427626(0x143)](_0x427626(0x1ab)+_0x134c70[_0x427626(0x18d)]),console[_0x427626(0x143)]('Parent\x20ID:\x20'+_0x134c70[_0x427626(0x1bb)]));if(_0x134c70[_0x427626(0x18d)]===_0x427626(0x122))throw new SDKError(ErrorCode[_0x427626(0x17a)],_0x427626(0x193));if(_0x134c70[_0x427626(0x18d)]==='parent')throw new SDKError(ErrorCode[_0x427626(0x17a)],_0x427626(0x189));if(!_0x134c70[_0x427626(0x1b3)])throw new SDKError(ErrorCode[_0x427626(0x1a0)],_0x427626(0x183));const _0x12cefd=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x41d3cc[_0x427626(0x1b9)][_0x427626(0x186)](_0x134c70[_0x427626(0x1bb)],_0x134c70[_0x427626(0x1b3)]),{'verbose':_0x4ee9e2[_0x427626(0x190)]});return _0x12cefd[_0x427626(0x14b)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x177);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x168);async[a34_0xbe1e3b(0x164)](_0x3111ea){const _0xf99b78=a34_0xbe1e3b,{options:_0x23cd39,args:_0x19dbb3,tdx:_0x414246}=_0x3111ea,_0x3461a9=_0x23cd39;if(_0x19dbb3[_0xf99b78(0x180)]<0x2)return console[_0xf99b78(0x143)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0xf99b78(0x1b6)),0x1;const _0x216178=_0x19dbb3[0x0],_0x6ca20a=_0x19dbb3[0x1];_0x3461a9[_0xf99b78(0x190)]&&(console[_0xf99b78(0x143)](_0xf99b78(0x1c3)+_0x3461a9['site']),console[_0xf99b78(0x143)](_0xf99b78(0x1ca)+_0x216178),console[_0xf99b78(0x143)](_0xf99b78(0x1c0)+_0x6ca20a));let _0x4d42a4;if(_0x3461a9[_0xf99b78(0x14f)]){const _0x3c14b2=_0x3461a9['parentFolder'],_0x5bb4ef=await withSpinner(_0xf99b78(0x1c9)+_0x216178+_0xf99b78(0x137),()=>_0x414246[_0xf99b78(0x1b9)][_0xf99b78(0x19a)](_0x216178),{'verbose':_0x3461a9[_0xf99b78(0x190)]}),_0x5c8823=_0x5bb4ef[_0xf99b78(0x14b)],_0x1751b1=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x3c14b2+'\x27...',()=>_0x414246['segment'][_0xf99b78(0x1c4)](_0x5c8823,_0x3c14b2),{'verbose':_0x3461a9['verbose']});_0x4d42a4=_0x1751b1[_0xf99b78(0x14b)],_0x3461a9['verbose']&&console[_0xf99b78(0x143)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x4d42a4);}const _0x9aec04={'name':_0x6ca20a,'description':_0x3461a9[_0xf99b78(0x1b5)],'parentFolderId':_0x4d42a4},_0x5a256f=await withSpinner(_0xf99b78(0x158)+_0x6ca20a+_0xf99b78(0x137),()=>_0x414246[_0xf99b78(0x1b9)][_0xf99b78(0x172)](_0x216178,_0x9aec04),{'verbose':_0x3461a9['verbose']}),_0x4f9ef6=_0x5a256f['data'];return console['error']('βœ”\x20Created\x20folder\x20\x27'+_0x4f9ef6[_0xf99b78(0x16d)]+_0xf99b78(0x153)+_0x4f9ef6['id']),await handleSDKOutput([_0x4f9ef6],_0x3461a9),0x0;}}export class SegmentViewCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x148);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x165);async[a34_0xbe1e3b(0x164)](_0x17d954){const _0x42311b=a34_0xbe1e3b,{options:_0xad6d8b,args:_0x30ccde,tdx:_0x1ba089}=_0x17d954,_0x3241dc=_0x30ccde[0x0];if(!_0x3241dc)return console[_0x42311b(0x143)](_0x42311b(0x195)),console[_0x42311b(0x143)](_0x42311b(0x155)),console[_0x42311b(0x143)](_0x42311b(0x170)),console['error'](_0x42311b(0x152)),console[_0x42311b(0x143)](_0x42311b(0x1b0)),console[_0x42311b(0x143)]('Examples:'),console[_0x42311b(0x143)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x42311b(0x143)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x42311b(0x143)](_0x42311b(0x16b)),console[_0x42311b(0x143)](_0x42311b(0x132)),0x1;try{const _0x4984f1=_0xad6d8b[_0x42311b(0x198)],_0x17fe96=await resolveSegmentTarget(_0x3241dc,_0x4984f1,_0xad6d8b['verbose']);_0xad6d8b[_0x42311b(0x190)]&&console[_0x42311b(0x143)](_0x42311b(0x163)+_0x17fe96);const _0x189858=await withSpinner(_0x42311b(0x144)+_0x3241dc+_0x42311b(0x137),()=>_0x1ba089[_0x42311b(0x1b9)][_0x42311b(0x16a)](_0x17fe96),{'verbose':_0xad6d8b[_0x42311b(0x190)]}),_0x2ebde7=_0x189858[_0x42311b(0x14b)];_0xad6d8b[_0x42311b(0x190)]&&(console[_0x42311b(0x143)](_0x42311b(0x1ab)+_0x2ebde7[_0x42311b(0x18d)]),console[_0x42311b(0x143)]('Parent\x20ID:\x20'+_0x2ebde7['parentId']),_0x2ebde7['folderId']&&console[_0x42311b(0x143)]('Folder\x20ID:\x20'+_0x2ebde7[_0x42311b(0x17d)]),_0x2ebde7['segmentId']&&console[_0x42311b(0x143)](_0x42311b(0x141)+_0x2ebde7['segmentId']));if(_0xad6d8b[_0x42311b(0x13e)]){if(_0x2ebde7[_0x42311b(0x18d)]==='folder')return console[_0x42311b(0x143)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x2ebde7[_0x42311b(0x18d)]===_0x42311b(0x13a))return console['error'](_0x42311b(0x12c)),console[_0x42311b(0x143)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x2ebde7['segmentId'])throw new SDKError(ErrorCode[_0x42311b(0x1a0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2a4da3=getConsoleNextUrl(_0xad6d8b[_0x42311b(0x18b)],'/app/ps/'+_0x2ebde7[_0x42311b(0x1bb)]+_0x42311b(0x138)+_0x2ebde7[_0x42311b(0x1b3)]);return console[_0x42311b(0x143)](a34_0x42cb39[_0x42311b(0x18e)]('βœ”')+'\x20Opening\x20'+a34_0x42cb39['cyan'](_0x2a4da3)),openBrowser(_0x2a4da3),0x0;}if(_0x2ebde7['type']===_0x42311b(0x122)){if(!_0x2ebde7[_0x42311b(0x17d)])throw new SDKError(ErrorCode[_0x42311b(0x147)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4716da=await withSpinner(_0x42311b(0x1ac),()=>_0x1ba089[_0x42311b(0x1b9)][_0x42311b(0x1c5)](_0x2ebde7['folderId']),{'verbose':_0xad6d8b[_0x42311b(0x190)]});await handleSingleObjectOutput(_0x4716da['data'],_0xad6d8b);}else{if(_0x2ebde7['type']==='segment'){if(!_0x2ebde7[_0x42311b(0x1b3)])throw new SDKError(ErrorCode[_0x42311b(0x1a0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2894fa=await withSpinner(_0x42311b(0x16c),()=>_0x1ba089['segment']['getSegment'](_0x2ebde7[_0x42311b(0x1bb)],_0x2ebde7[_0x42311b(0x1b3)]),{'verbose':_0xad6d8b['verbose']}),_0x2fb812=getConsoleNextUrl(_0xad6d8b[_0x42311b(0x18b)],_0x42311b(0x126)+_0x2ebde7['parentId']+_0x42311b(0x138)+_0x2ebde7['segmentId']),_0x2ea0ba=_0x2894fa[_0x42311b(0x14b)];_0x2ea0ba['url']=_0x2fb812,await handleSingleObjectOutput(_0x2ea0ba,_0xad6d8b);}else return console['error'](_0x42311b(0x1c1)),console['error'](_0x42311b(0x12d)),0x1;}return 0x0;}catch(_0xcaa15f){if(_0xcaa15f instanceof SDKError)return console['error'](_0x42311b(0x182)+_0xcaa15f['message']),_0xcaa15f[_0x42311b(0x1a2)]&&console[_0x42311b(0x143)](_0x42311b(0x128)+_0xcaa15f[_0x42311b(0x1a2)]),0x1;throw _0xcaa15f;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a34_0xbe1e3b(0x16d)]=a34_0xbe1e3b(0x150);[a34_0xbe1e3b(0x1b5)]=a34_0xbe1e3b(0x17c);async[a34_0xbe1e3b(0x164)](_0x221bcc){const _0x292ea9=a34_0xbe1e3b,{options:_0x35c888,args:_0xf93324,tdx:_0x2db580}=_0x221bcc,_0x47c77c=_0xf93324[0x0];if(!_0x47c77c)return console[_0x292ea9(0x143)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x292ea9(0x143)](_0x292ea9(0x178)),console[_0x292ea9(0x143)](_0x292ea9(0x1ba)),console['error']('Examples:'),console[_0x292ea9(0x143)](_0x292ea9(0x162)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x49d361=_0x35c888[_0x292ea9(0x198)],_0x3675ec=await resolveSegmentTarget(_0x47c77c,_0x49d361,_0x35c888['verbose']);_0x35c888[_0x292ea9(0x190)]&&console[_0x292ea9(0x143)]('Target\x20path:\x20'+_0x3675ec);const _0xe91174=await withSpinner('Resolving\x20\x27'+_0x47c77c+_0x292ea9(0x137),()=>_0x2db580[_0x292ea9(0x1b9)][_0x292ea9(0x16a)](_0x3675ec),{'verbose':_0x35c888[_0x292ea9(0x190)]}),_0x41f7bc=_0xe91174[_0x292ea9(0x14b)];_0x35c888[_0x292ea9(0x190)]&&(console[_0x292ea9(0x143)](_0x292ea9(0x1ab)+_0x41f7bc[_0x292ea9(0x18d)]),console[_0x292ea9(0x143)]('Parent\x20ID:\x20'+_0x41f7bc['parentId']));if(_0x41f7bc[_0x292ea9(0x18d)]===_0x292ea9(0x122))return console[_0x292ea9(0x143)](_0x292ea9(0x15b)),console[_0x292ea9(0x143)](_0x292ea9(0x187)),0x1;if(_0x41f7bc[_0x292ea9(0x18d)]===_0x292ea9(0x13a))return console[_0x292ea9(0x143)](_0x292ea9(0x19b)),console[_0x292ea9(0x143)](_0x292ea9(0x17f)),0x1;if(!_0x41f7bc[_0x292ea9(0x1b3)])throw new SDKError(ErrorCode[_0x292ea9(0x1a0)],_0x292ea9(0x183));const _0x39f0a4=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2db580['segment'][_0x292ea9(0x186)](_0x41f7bc[_0x292ea9(0x1bb)],_0x41f7bc[_0x292ea9(0x1b3)]),{'verbose':_0x35c888[_0x292ea9(0x190)]}),_0x157df6=_0x39f0a4[_0x292ea9(0x14b)],_0x51153d=await executeSchemaQuery(_0x157df6,_0x2db580,_0x35c888);return await handleQueryOutput(_0x51153d,_0x35c888),0x0;}catch(_0x35a269){if(_0x35a269 instanceof SDKError)return console['error'](_0x292ea9(0x182)+_0x35a269[_0x292ea9(0x129)]),_0x35a269[_0x292ea9(0x1a2)]&&console[_0x292ea9(0x143)](_0x292ea9(0x128)+_0x35a269['cause']),0x1;throw _0x35a269;}}}function a34_0x4208(){const _0x4f567e=['115359njtMqX','Show\x20segment\x20folder\x20details','\x20folder','segment:folder:create','Usage:\x20tdx\x20sg\x20desc\x20<name>','replace','INVALID_ARGUMENT','Usage:\x20tdx\x20sg\x20show\x20<name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','folderId','828081fXdzqh','Use:\x20tdx\x20ps\x20desc','length','segmentName','Error:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','jsonl','getSegmentSQL','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','24CxyNOl','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','SQL\x20query:\x0a','site','red','type','green','Get\x20SQL\x20query\x20for\x20child\x20segment','verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Fetching\x20SQL\x20for\x20segment...','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20SQL\x20from\x20rule...','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Resolved\x20parent\x20ID:\x20','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','parentSegment','log','resolveParentId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','information_schema','\x20\x20tdx\x20sg\x20sql\x20--path\x20','segment:folder:show','Folder\x20ID:\x20','SEGMENT_NOT_FOUND','json','cause','Parent\x20name:\x20','path','62ercuAJ','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','setJobId','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Resolved\x20type:\x20','Fetching\x20folder\x20details...','includes','βœ”\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','limit','Executing\x20segment\x20query...','segmentId','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','description','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','4XCwIIn','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','parentId','\x20\x20Segment\x20name:\x20','test','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20show','Folder\x20name:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Site:\x20','resolveFolderId','getFolder','\x20\x20Folder\x20path:\x20','398765zkQjnk','trim','Resolving\x20parent\x20segment\x20\x27','Parent\x20segment:\x20','1964690JgRQgm','Error:\x20Folder\x20reference\x20is\x20required','folder','Usage:\x20tdx\x20segment\x20describe\x20<path>','in\x20','elapsedTimeMillis','/app/ps/','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20Cause:\x20','message','727536PVbmHC','\x20\x20Parent\x20segment:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20view','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','140PPjuFi','4673YHmtBf','processedRows','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','segment:show','Fetching\x20parent\x20segment\x20details...','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x27...','/e/','Resolved\x20YAML\x20file:\x20','parent','\x20[Job\x20ID:\x20','format','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','web','toLocaleString','Resolved:\x20','Segment\x20ID:\x20','fullPath','error','Resolving\x20\x27','Error:\x20Path\x20or\x20name\x20is\x20required','segmentPath','SEGMENT_FOLDER_NOT_FOUND','segment:view','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','data','segment:folder:list','segment:sql','Resolved\x20relative\x20path\x20to:\x20','parentFolder','segment:desc','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Options:','\x27\x20with\x20ID:\x20','Usage:','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Examples:','stats','Creating\x20folder\x20\x27','βœ–\x20Query\x20failed\x20[','(root)','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','87681nNysTI','Resolving\x20folder\x20\x27','getSegment','jobId','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Target\x20path:\x20','execute','Show\x20folder\x20or\x20child\x20segment\x20details','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20path\x20\x27','Create\x20segment\x20folder\x20for\x20organization','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','resolvePathToResource','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Fetching\x20segment\x20details...','name','\x20\x20Full\x20path:\x20','Fetching\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','getSQLFromServerSegment','createFolder','Parent\x20ID:\x20'];a34_0x4208=function(){return _0x4f567e;};return a34_0x4208();}
1
+ const a34_0x1009d7=a34_0x1bee;(function(_0x4b5a85,_0x2ac777){const _0x5bc0a4=a34_0x1bee,_0x3cf232=_0x4b5a85();while(!![]){try{const _0x53080c=parseInt(_0x5bc0a4(0x174))/0x1+-parseInt(_0x5bc0a4(0x1de))/0x2*(parseInt(_0x5bc0a4(0x181))/0x3)+-parseInt(_0x5bc0a4(0x1c7))/0x4+parseInt(_0x5bc0a4(0x1cf))/0x5*(parseInt(_0x5bc0a4(0x156))/0x6)+parseInt(_0x5bc0a4(0x178))/0x7+parseInt(_0x5bc0a4(0x17b))/0x8*(parseInt(_0x5bc0a4(0x160))/0x9)+-parseInt(_0x5bc0a4(0x195))/0xa;if(_0x53080c===_0x2ac777)break;else _0x3cf232['push'](_0x3cf232['shift']());}catch(_0x57dd1f){_0x3cf232['push'](_0x3cf232['shift']());}}}(a34_0x3319,0x5e4e8));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a34_0x3319(){const _0x595c5c=['segment:folder:show','Resolving\x20parent\x20segment\x20\x27','Resolving\x20path\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','folder','length','name','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','execute','SEGMENT_FOLDER_NOT_FOUND','segmentPath','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','folderPath','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','jobId','Parent\x20ID:\x20','236704xEDarT','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Resolved\x20relative\x20path\x20to:\x20','(root)','3179421CchLXR','elapsedTimeMillis','cyan','3632CQJdxK','trim','parentId','Resolving\x20folder\x20\x27','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','984669UfLVqJ','Show\x20folder\x20or\x20child\x20segment\x20details','format','stats','in\x20','segment:desc','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20[Job\x20ID:\x20','data','jsonl','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Site:\x20','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','red','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','replace','segment','fullPath','processedRows','9570220XZzRSE','Resolved\x20parent\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','green','Use:\x20tdx\x20ps\x20desc','Fetching\x20folder\x20\x27','Fetching\x20parent\x20segment\x20details...','SELECT\x20*\x20FROM\x20(\x0a','segment:folder:list','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','query','parentFolder','getSegment','Error:\x20','Options:','resolveParentId','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','parent','Usage:','toLocaleString','\x20\x20Folder\x20path:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolved\x20type:\x20','Resolving\x20\x27','Resolved:\x20','segmentId','folderId','setJobId','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Use:\x20tdx\x20ps\x20show','Parent\x20name:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','code','verbose','/app/ps/','/e/','\x20\x20Segment\x20name:\x20','segmentName','\x20Opening\x20','Fetching\x20folder\x20details...','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20segment\x20details...','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','url','βœ”\x20Found\x20','type','\x27...','947228SivIOl','βœ”\x20Query\x20completed:\x20Processed\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20Full\x20path:\x20','βœ”\x20Created\x20folder\x20\x27','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Resolving\x20parent\x20folder\x20\x27','1049915eiXbKg','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Parent\x20segment:\x20','description','segment:folder:create','Executing\x20segment\x20query...','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','message','getSegmentSQLFromYaml','INVALID_ARGUMENT','error','getFolder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Use:\x20tdx\x20ps\x20view','Folder\x20name:\x20','2hhgSbp','limit','segment:describe','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Get\x20SQL\x20query\x20for\x20child\x20segment','parentSegment','segment:sql','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Show\x20segment\x20or\x20folder\x20details','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSQLFromYamlFile','\x20\x20Cause:\x20','Examples:','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','SQL\x20query:\x0a','Fetching\x20SQL\x20from\x20rule...','Resolved\x20folder\x20ID:\x20','includes','SEGMENT_NOT_FOUND','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','getSegmentSQL','web','site','test','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Target\x20path:\x20','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','path','resolvePathToResource','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','βœ–\x20Query\x20failed\x20[','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20YAML\x20file:\x20','json','getParent','18pytsku','resolveFolderId','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','getSQLFromServerSegment','cause','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20sg\x20show\x20<name>','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Segment\x20ID\x20missing\x20from\x20resolved\x20path','11646mUmpTr','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Folder\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20'];a34_0x3319=function(){return _0x595c5c;};return a34_0x3319();}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 a34_0x45fc67 from'chalk';async function resolveSegmentTarget(_0x5b131a,_0x11559c,_0x518e4f){const _0x518ad7=a34_0x1bee;if(isYamlFilePath(_0x5b131a))try{const _0x59952a=await resolveYamlFilePath(_0x5b131a);return _0x518e4f&&(console['error'](_0x518ad7(0x153)+_0x5b131a),console[_0x518ad7(0x1d9)]('\x20\x20Parent\x20segment:\x20'+_0x59952a[_0x518ad7(0x1e4)]),console['error'](_0x518ad7(0x1bc)+_0x59952a[_0x518ad7(0x1bd)]),console[_0x518ad7(0x1d9)](_0x518ad7(0x1ab)+(_0x59952a[_0x518ad7(0x170)]||_0x518ad7(0x177))),console[_0x518ad7(0x1d9)](_0x518ad7(0x1ca)+_0x59952a[_0x518ad7(0x193)])),_0x59952a[_0x518ad7(0x193)];}catch(_0x330431){throw new SDKError(ErrorCode[_0x518ad7(0x1d8)],_0x518ad7(0x16f)+_0x330431[_0x518ad7(0x1d6)]);}if(!_0x11559c)throw new SDKError(ErrorCode[_0x518ad7(0x1d8)],_0x518ad7(0x161));return _0x11559c+'/'+_0x5b131a;}export class SegmentDescribeCommand extends BaseCommand{[a34_0x1009d7(0x16a)]=a34_0x1009d7(0x1e0);[a34_0x1009d7(0x1d2)]=a34_0x1009d7(0x1e8);async[a34_0x1009d7(0x16c)](_0x261927){const _0x7a1eee=a34_0x1009d7,{options:_0x56af8a,args:_0xcf1abc,tdx:_0x33eb01}=_0x261927,_0x3d1c9e=_0xcf1abc[0x0],_0x597c19=!_0x3d1c9e&&!!_0x56af8a['parentSegment'],_0x24f01c=_0x3d1c9e||_0x56af8a[_0x7a1eee(0x1e4)];if(!_0x24f01c)return console[_0x7a1eee(0x1d9)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x7a1eee(0x1ac)),console[_0x7a1eee(0x1d9)](_0x7a1eee(0x1ec)),console['error'](_0x7a1eee(0x16b)),console[_0x7a1eee(0x1d9)](_0x7a1eee(0x152)),console[_0x7a1eee(0x1d9)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x7a1eee(0x190)),0x1;try{const _0x2cae5c=_0x56af8a[_0x7a1eee(0x16e)];let _0x1539f0=_0x24f01c;!_0x597c19&&_0x2cae5c&&!_0x24f01c[_0x7a1eee(0x1f1)]('/')&&(_0x1539f0=_0x2cae5c+'/'+_0x24f01c,_0x56af8a[_0x7a1eee(0x1b9)]&&console['error'](_0x7a1eee(0x176)+_0x1539f0));const _0x34b4ec=await withSpinner(_0x7a1eee(0x166)+_0x1539f0+'\x27...',()=>_0x33eb01[_0x7a1eee(0x192)][_0x7a1eee(0x14e)](_0x1539f0),{'verbose':_0x56af8a[_0x7a1eee(0x1b9)]}),_0x262bb=_0x34b4ec['data'];_0x56af8a[_0x7a1eee(0x1b9)]&&(console[_0x7a1eee(0x1d9)]('Resolved\x20type:\x20'+_0x262bb[_0x7a1eee(0x1c5)]),console[_0x7a1eee(0x1d9)](_0x7a1eee(0x173)+_0x262bb[_0x7a1eee(0x17d)]),_0x262bb['folderId']&&console[_0x7a1eee(0x1d9)]('Folder\x20ID:\x20'+_0x262bb[_0x7a1eee(0x1b1)]),_0x262bb[_0x7a1eee(0x1b0)]&&console['error'](_0x7a1eee(0x18d)+_0x262bb[_0x7a1eee(0x1b0)]));if(_0x262bb['type']===_0x7a1eee(0x1a8)){const _0x14a1ca=await withSpinner(_0x7a1eee(0x19b),()=>_0x33eb01['segment'][_0x7a1eee(0x155)](_0x262bb['parentId']),{'verbose':_0x56af8a['verbose']});await handleSingleObjectOutput(_0x14a1ca['data'],_0x56af8a);}else{if(_0x262bb[_0x7a1eee(0x1c5)]===_0x7a1eee(0x168)){if(!_0x262bb[_0x7a1eee(0x1b1)])throw new SDKError(ErrorCode[_0x7a1eee(0x16d)],_0x7a1eee(0x1db));const _0x22fab8=await withSpinner('Fetching\x20folder\x20details...',()=>_0x33eb01['segment'][_0x7a1eee(0x1da)](_0x262bb[_0x7a1eee(0x1b1)]),{'verbose':_0x56af8a[_0x7a1eee(0x1b9)]});await handleSingleObjectOutput(_0x22fab8['data'],_0x56af8a);}else{if(_0x262bb[_0x7a1eee(0x1c5)]===_0x7a1eee(0x192)){if(!_0x262bb['segmentId'])throw new SDKError(ErrorCode[_0x7a1eee(0x1f2)],_0x7a1eee(0x15f));const _0x240bc3=await withSpinner(_0x7a1eee(0x1c1),()=>_0x33eb01[_0x7a1eee(0x192)][_0x7a1eee(0x1a1)](_0x262bb[_0x7a1eee(0x17d)],_0x262bb['segmentId']),{'verbose':_0x56af8a[_0x7a1eee(0x1b9)]});await handleSingleObjectOutput(_0x240bc3['data'],_0x56af8a);}}}return 0x0;}catch(_0x409e3c){if(_0x409e3c instanceof SDKError)return console[_0x7a1eee(0x1d9)](_0x7a1eee(0x1a2)+_0x409e3c[_0x7a1eee(0x1d6)]),_0x409e3c[_0x7a1eee(0x15a)]&&console[_0x7a1eee(0x1d9)]('\x20\x20Cause:\x20'+_0x409e3c[_0x7a1eee(0x15a)]),0x1;throw _0x409e3c;}}}export class SegmentShowCommand extends BaseCommand{[a34_0x1009d7(0x16a)]='segment:show';[a34_0x1009d7(0x1d2)]=a34_0x1009d7(0x171);async['execute'](_0x37d3d5){const _0x237427=a34_0x1009d7,{options:_0x312570,args:_0x14926f,tdx:_0x33442f}=_0x37d3d5,_0x1bbb95=_0x14926f[0x0];if(!_0x1bbb95)return console['error'](_0x237427(0x1f3)),console['error'](_0x237427(0x15c)),console['error'](_0x237427(0x1c9)),console['error'](_0x237427(0x1ec)),console[_0x237427(0x1d9)](_0x237427(0x15e)),console['error'](_0x237427(0x18e)),0x1;try{const _0xa6565f=_0x312570[_0x237427(0x1e4)],_0x358ca7=await resolveSegmentTarget(_0x1bbb95,_0xa6565f,_0x312570[_0x237427(0x1b9)]);_0x312570[_0x237427(0x1b9)]&&console[_0x237427(0x1d9)]('Target\x20path:\x20'+_0x358ca7);const _0x217d1c=await withSpinner('Resolving\x20\x27'+_0x1bbb95+_0x237427(0x1c6),()=>_0x33442f[_0x237427(0x192)][_0x237427(0x14e)](_0x358ca7),{'verbose':_0x312570['verbose']}),_0x252bd9=_0x217d1c[_0x237427(0x189)];_0x312570[_0x237427(0x1b9)]&&(console[_0x237427(0x1d9)](_0x237427(0x1ad)+_0x252bd9[_0x237427(0x1c5)]),console[_0x237427(0x1d9)]('Parent\x20ID:\x20'+_0x252bd9['parentId']));if(_0x252bd9[_0x237427(0x1c5)]===_0x237427(0x168))return console[_0x237427(0x1d9)](_0x237427(0x14f)),console['error'](_0x237427(0x1e1)),0x1;if(_0x252bd9[_0x237427(0x1c5)]==='parent')return console[_0x237427(0x1d9)](_0x237427(0x1c0)),console[_0x237427(0x1d9)](_0x237427(0x1b5)),0x1;if(!_0x252bd9['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x237427(0x15f));const _0x4514e5=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x33442f[_0x237427(0x192)][_0x237427(0x1f4)](_0x252bd9['parentId'],_0x252bd9[_0x237427(0x1b0)]),{'verbose':_0x312570[_0x237427(0x1b9)]});let _0x49e646=_0x4514e5[_0x237427(0x189)];const _0x42725b=resolveLimit(_0x312570[_0x237427(0x1df)],DEFAULT_DISPLAY_LIMIT),_0x2d855a=/\bLIMIT\s+\d+/i[_0x237427(0x149)](_0x49e646);!_0x2d855a&&(_0x49e646=_0x49e646[_0x237427(0x17c)]()[_0x237427(0x191)](/;+$/,''),_0x49e646=_0x237427(0x19c)+_0x49e646+_0x237427(0x187)+_0x42725b);_0x312570['verbose']&&console[_0x237427(0x1d9)](_0x237427(0x1ee)+_0x49e646);const _0x39a935=await withProgressSpinner(_0x237427(0x1d4),async _0x5dfe94=>{const _0x1f01d2=_0x237427,_0x14d08a=await _0x33442f[_0x1f01d2(0x19f)]['execute'](_0x49e646,{'catalog':'td','schema':'information_schema','onJobId':_0x470038=>{const _0x5cd10c=_0x1f01d2;_0x5dfe94[_0x5cd10c(0x1b2)](_0x470038);}});return _0x14d08a;},{'verbose':_0x312570[_0x237427(0x1b9)]}),_0x3f79c7=_0x39a935[_0x237427(0x189)],_0xe1b6e2=_0x3f79c7[_0x237427(0x172)]?_0x237427(0x188)+_0x3f79c7[_0x237427(0x172)]+']':'';return console[_0x237427(0x1d9)](_0x237427(0x1c8)+_0x3f79c7[_0x237427(0x184)][_0x237427(0x194)][_0x237427(0x1aa)]()+'\x20rows\x20'+(_0x237427(0x185)+formatElapsed(_0x3f79c7['stats'][_0x237427(0x179)])+_0xe1b6e2)),await handleQueryOutput(_0x3f79c7,_0x312570),0x0;}catch(_0x2100f4){if(_0x2100f4 instanceof SDKError)return console[_0x237427(0x1d9)](_0x237427(0x151)+_0x2100f4[_0x237427(0x1b8)]+']'),console[_0x237427(0x1d9)]('\x0a'+_0x2100f4['message']),0x1;throw _0x2100f4;}}}export class SegmentFolderListCommand extends BaseCommand{[a34_0x1009d7(0x16a)]=a34_0x1009d7(0x19d);[a34_0x1009d7(0x1d2)]=a34_0x1009d7(0x17f);async[a34_0x1009d7(0x16c)](_0x1309cf){const _0x4a6836=a34_0x1009d7,{options:_0x34e085,args:_0x44c94b,tdx:_0x2e7346}=_0x1309cf;if(_0x44c94b[_0x4a6836(0x169)]===0x0)return console[_0x4a6836(0x1d9)](_0x4a6836(0x1e9)),console[_0x4a6836(0x1d9)](_0x4a6836(0x1a7)),0x1;const _0x5d8212=_0x44c94b[0x0];try{_0x34e085[_0x4a6836(0x1b9)]&&(console['error'](_0x4a6836(0x18c)+_0x34e085[_0x4a6836(0x148)]),console[_0x4a6836(0x1d9)](_0x4a6836(0x1b6)+_0x5d8212));const _0x20e98b=await withSpinner(_0x4a6836(0x165)+_0x5d8212+_0x4a6836(0x1c6),()=>_0x2e7346['segment'][_0x4a6836(0x1a4)](_0x5d8212),{'verbose':_0x34e085[_0x4a6836(0x1b9)]}),_0x158c39=_0x20e98b[_0x4a6836(0x189)];_0x34e085[_0x4a6836(0x1b9)]&&console[_0x4a6836(0x1d9)](_0x4a6836(0x196)+_0x158c39);const _0xb90312=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x5d8212+_0x4a6836(0x1c6),()=>_0x2e7346[_0x4a6836(0x192)]['listFolders'](_0x158c39),{'verbose':_0x34e085[_0x4a6836(0x1b9)]}),_0x483536=_0xb90312['data'];return console[_0x4a6836(0x1d9)](_0x4a6836(0x1c4)+_0x483536[_0x4a6836(0x169)]+'\x20folder'+(_0x483536[_0x4a6836(0x169)]!==0x1?'s':'')),await handleSDKOutput(_0x483536,_0x34e085),0x0;}catch(_0x179c07){if(_0x179c07 instanceof SDKError)return console[_0x4a6836(0x1d9)](_0x4a6836(0x1a2)+_0x179c07[_0x4a6836(0x1d6)]),_0x179c07['cause']&&console[_0x4a6836(0x1d9)]('\x20\x20Cause:\x20'+_0x179c07[_0x4a6836(0x15a)]),0x1;throw _0x179c07;}}}export class SegmentFolderShowCommand extends BaseCommand{[a34_0x1009d7(0x16a)]=a34_0x1009d7(0x164);[a34_0x1009d7(0x1d2)]='Show\x20segment\x20folder\x20details';async[a34_0x1009d7(0x16c)](_0x3d3458){const _0x57f149=a34_0x1009d7,{options:_0x994557,args:_0x4a24a2,tdx:_0xf812de}=_0x3d3458;if(_0x4a24a2[_0x57f149(0x169)]===0x0)return console[_0x57f149(0x1d9)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x57f149(0x1d9)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x683ac,childId:_0x57d4e9}=parseSegmentRef(_0x4a24a2[0x0]);_0x994557['verbose']&&(console[_0x57f149(0x1d9)](_0x57f149(0x18c)+_0x994557[_0x57f149(0x148)]),console[_0x57f149(0x1d9)]('Parent\x20name:\x20'+_0x683ac),_0x57d4e9&&console[_0x57f149(0x1d9)](_0x57f149(0x1dd)+_0x57d4e9));if(!_0x57d4e9)return console[_0x57f149(0x1d9)](_0x57f149(0x197)),0x1;const _0xa8716d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x683ac+_0x57f149(0x1c6),()=>_0xf812de[_0x57f149(0x192)][_0x57f149(0x1a4)](_0x683ac),{'verbose':_0x994557[_0x57f149(0x1b9)]}),_0x3e4720=_0xa8716d[_0x57f149(0x189)];_0x994557[_0x57f149(0x1b9)]&&console['error'](_0x57f149(0x196)+_0x3e4720);const _0x242f9f=await withSpinner(_0x57f149(0x17e)+_0x57d4e9+_0x57f149(0x1c6),()=>_0xf812de['segment'][_0x57f149(0x157)](_0x3e4720,_0x57d4e9),{'verbose':_0x994557[_0x57f149(0x1b9)]}),_0x4a5f35=_0x242f9f[_0x57f149(0x189)];_0x994557['verbose']&&console['error'](_0x57f149(0x1f0)+_0x4a5f35);const _0x4ff36b=await withSpinner(_0x57f149(0x19a)+_0x57d4e9+_0x57f149(0x1c6),()=>_0xf812de[_0x57f149(0x192)][_0x57f149(0x1da)](_0x4a5f35),{'verbose':_0x994557[_0x57f149(0x1b9)]});return await handleSDKOutput([_0x4ff36b['data']],_0x994557),0x0;}catch(_0x3fd913){if(_0x3fd913 instanceof SDKError)return console['error']('Error:\x20'+_0x3fd913['message']),_0x3fd913[_0x57f149(0x15a)]&&console['error']('\x20\x20Cause:\x20'+_0x3fd913[_0x57f149(0x15a)]),0x1;throw _0x3fd913;}}}export class SegmentSQLCommand extends BaseCommand{[a34_0x1009d7(0x16a)]=a34_0x1009d7(0x1e5);['description']=a34_0x1009d7(0x1e3);async['execute'](_0x4e9cb0){const _0x242ca9=a34_0x1009d7,{options:_0x377414,args:_0x11d7d6}=_0x4e9cb0,_0x40db92=_0x377414,_0x1dc3ff=_0x40db92[_0x242ca9(0x14d)],_0x4ee1a3=_0x11d7d6[0x0];if(!_0x4ee1a3&&!_0x1dc3ff)return console[_0x242ca9(0x1d9)](a34_0x45fc67[_0x242ca9(0x18f)](_0x242ca9(0x1d0))),console[_0x242ca9(0x1d9)](_0x242ca9(0x1a9)),console[_0x242ca9(0x1d9)](_0x242ca9(0x1e7)),console[_0x242ca9(0x1d9)](_0x242ca9(0x14c)),console[_0x242ca9(0x1d9)]('Examples:'),console[_0x242ca9(0x1d9)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x242ca9(0x1d9)](_0x242ca9(0x1e6)),0x1;if(_0x4ee1a3&&_0x1dc3ff)return console['error'](a34_0x45fc67[_0x242ca9(0x18f)](_0x242ca9(0x1c2))),0x1;try{let _0x2e2e68;if(_0x1dc3ff)_0x2e2e68=await this[_0x242ca9(0x1ea)](_0x1dc3ff,_0x4e9cb0);else{if(isYamlFilePath(_0x4ee1a3))return console[_0x242ca9(0x1d9)](a34_0x45fc67[_0x242ca9(0x18f)](_0x242ca9(0x150))),console[_0x242ca9(0x1d9)](_0x242ca9(0x163)+_0x4ee1a3),0x1;else _0x2e2e68=await this[_0x242ca9(0x159)](_0x4ee1a3,_0x4e9cb0);}return _0x377414[_0x242ca9(0x183)]===_0x242ca9(0x154)||_0x377414[_0x242ca9(0x183)]===_0x242ca9(0x18a)?await handleSDKOutput([{'sql':_0x2e2e68}],_0x377414):console['log'](_0x2e2e68),0x0;}catch(_0x38b3b2){if(_0x38b3b2 instanceof SDKError)return console[_0x242ca9(0x1d9)](_0x242ca9(0x1a2)+_0x38b3b2[_0x242ca9(0x1d6)]),_0x38b3b2['cause']&&console[_0x242ca9(0x1d9)]('\x20\x20Cause:\x20'+_0x38b3b2[_0x242ca9(0x15a)]),0x1;throw _0x38b3b2;}}async[a34_0x1009d7(0x1ea)](_0x32acc4,_0x619699){const _0x1f72d4=a34_0x1009d7,{options:_0x332fd3,tdx:_0x5bfbf2}=_0x619699;let _0x58b3b9;try{_0x58b3b9=await resolveYamlFilePath(_0x32acc4);}catch(_0x19ace7){throw new SDKError(ErrorCode[_0x1f72d4(0x1d8)],_0x1f72d4(0x16f)+_0x19ace7[_0x1f72d4(0x1d6)]);}_0x332fd3[_0x1f72d4(0x1b9)]&&console[_0x1f72d4(0x1d9)](_0x1f72d4(0x1af)+_0x58b3b9[_0x1f72d4(0x1e4)]+'/'+_0x58b3b9['segmentName']);const _0xc87c70=await withSpinner(_0x1f72d4(0x1ef),()=>_0x5bfbf2[_0x1f72d4(0x192)][_0x1f72d4(0x1d7)](_0x58b3b9['content'],_0x58b3b9['parentSegment'],_0x58b3b9[_0x1f72d4(0x1bd)]),{'verbose':_0x332fd3['verbose']});return _0xc87c70[_0x1f72d4(0x189)];}async[a34_0x1009d7(0x159)](_0x38aeff,_0x151505){const _0x7233ab=a34_0x1009d7,{options:_0x413385,tdx:_0x57e82a}=_0x151505,_0x43538f=_0x413385['parentSegment'],_0x2c1874=await resolveSegmentTarget(_0x38aeff,_0x43538f,_0x413385['verbose']);_0x413385[_0x7233ab(0x1b9)]&&console[_0x7233ab(0x1d9)](_0x7233ab(0x14b)+_0x2c1874);const _0x49e972=await withSpinner(_0x7233ab(0x1ae)+_0x38aeff+'\x27...',()=>_0x57e82a[_0x7233ab(0x192)]['resolvePathToResource'](_0x2c1874),{'verbose':_0x413385[_0x7233ab(0x1b9)]}),_0x1604b9=_0x49e972['data'];_0x413385[_0x7233ab(0x1b9)]&&(console['error'](_0x7233ab(0x1ad)+_0x1604b9[_0x7233ab(0x1c5)]),console[_0x7233ab(0x1d9)]('Parent\x20ID:\x20'+_0x1604b9[_0x7233ab(0x17d)]));if(_0x1604b9['type']===_0x7233ab(0x168))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x7233ab(0x1b3));if(_0x1604b9['type']==='parent')throw new SDKError(ErrorCode[_0x7233ab(0x1d8)],_0x7233ab(0x1cc));if(!_0x1604b9[_0x7233ab(0x1b0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x7233ab(0x15f));const _0x2a3e5c=await withSpinner(_0x7233ab(0x15d),()=>_0x57e82a[_0x7233ab(0x192)][_0x7233ab(0x1f4)](_0x1604b9[_0x7233ab(0x17d)],_0x1604b9[_0x7233ab(0x1b0)]),{'verbose':_0x413385[_0x7233ab(0x1b9)]});return _0x2a3e5c[_0x7233ab(0x189)];}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a34_0x1009d7(0x1d3);['description']=a34_0x1009d7(0x1a5);async[a34_0x1009d7(0x16c)](_0x435423){const _0xae5e6f=a34_0x1009d7,{options:_0x3727bf,args:_0x546959,tdx:_0x5a7171}=_0x435423,_0x118fd7=_0x3727bf;if(_0x546959['length']<0x2)return console[_0xae5e6f(0x1d9)](_0xae5e6f(0x14a)),console['error'](_0xae5e6f(0x1b4)),0x1;const _0x26a01e=_0x546959[0x0],_0x15e8af=_0x546959[0x1];_0x118fd7[_0xae5e6f(0x1b9)]&&(console['error'](_0xae5e6f(0x18c)+_0x118fd7['site']),console[_0xae5e6f(0x1d9)](_0xae5e6f(0x1d1)+_0x26a01e),console['error'](_0xae5e6f(0x1dd)+_0x15e8af));let _0x3278de;if(_0x118fd7[_0xae5e6f(0x1a0)]){const _0x5333d8=_0x118fd7[_0xae5e6f(0x1a0)],_0x5adc0a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x26a01e+'\x27...',()=>_0x5a7171[_0xae5e6f(0x192)][_0xae5e6f(0x1a4)](_0x26a01e),{'verbose':_0x118fd7[_0xae5e6f(0x1b9)]}),_0x3d8816=_0x5adc0a[_0xae5e6f(0x189)],_0x3d86e7=await withSpinner(_0xae5e6f(0x1ce)+_0x5333d8+_0xae5e6f(0x1c6),()=>_0x5a7171[_0xae5e6f(0x192)][_0xae5e6f(0x157)](_0x3d8816,_0x5333d8),{'verbose':_0x118fd7[_0xae5e6f(0x1b9)]});_0x3278de=_0x3d86e7[_0xae5e6f(0x189)],_0x118fd7[_0xae5e6f(0x1b9)]&&console[_0xae5e6f(0x1d9)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x3278de);}const _0x400395={'name':_0x15e8af,'description':_0x118fd7[_0xae5e6f(0x1d2)],'parentFolderId':_0x3278de},_0x4b8cce=await withSpinner('Creating\x20folder\x20\x27'+_0x15e8af+'\x27...',()=>_0x5a7171[_0xae5e6f(0x192)]['createFolder'](_0x26a01e,_0x400395),{'verbose':_0x118fd7[_0xae5e6f(0x1b9)]}),_0x22cdab=_0x4b8cce['data'];return console[_0xae5e6f(0x1d9)](_0xae5e6f(0x1cb)+_0x22cdab['name']+'\x27\x20with\x20ID:\x20'+_0x22cdab['id']),await handleSDKOutput([_0x22cdab],_0x118fd7),0x0;}}export class SegmentViewCommand extends BaseCommand{[a34_0x1009d7(0x16a)]='segment:view';[a34_0x1009d7(0x1d2)]=a34_0x1009d7(0x182);async[a34_0x1009d7(0x16c)](_0x3ea758){const _0x48e608=a34_0x1009d7,{options:_0x5d0f3b,args:_0x25c7fb,tdx:_0x2a4597}=_0x3ea758,_0x442e03=_0x25c7fb[0x0];if(!_0x442e03)return console['error']('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x48e608(0x1d9)](_0x48e608(0x15b)),console[_0x48e608(0x1d9)](_0x48e608(0x1cd)),console[_0x48e608(0x1d9)](_0x48e608(0x1a3)),console[_0x48e608(0x1d9)](_0x48e608(0x180)),console['error'](_0x48e608(0x1ec)),console['error'](_0x48e608(0x1e2)),console[_0x48e608(0x1d9)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x48e608(0x1d9)](_0x48e608(0x1ed)),console[_0x48e608(0x1d9)](_0x48e608(0x175)),0x1;try{const _0x1abbd4=_0x5d0f3b[_0x48e608(0x1e4)],_0xa1d1c8=await resolveSegmentTarget(_0x442e03,_0x1abbd4,_0x5d0f3b[_0x48e608(0x1b9)]);_0x5d0f3b[_0x48e608(0x1b9)]&&console[_0x48e608(0x1d9)](_0x48e608(0x14b)+_0xa1d1c8);const _0x295a5a=await withSpinner(_0x48e608(0x1ae)+_0x442e03+_0x48e608(0x1c6),()=>_0x2a4597['segment'][_0x48e608(0x14e)](_0xa1d1c8),{'verbose':_0x5d0f3b[_0x48e608(0x1b9)]}),_0x27ff8b=_0x295a5a[_0x48e608(0x189)];_0x5d0f3b['verbose']&&(console[_0x48e608(0x1d9)]('Resolved\x20type:\x20'+_0x27ff8b[_0x48e608(0x1c5)]),console['error'](_0x48e608(0x173)+_0x27ff8b[_0x48e608(0x17d)]),_0x27ff8b['folderId']&&console[_0x48e608(0x1d9)](_0x48e608(0x162)+_0x27ff8b[_0x48e608(0x1b1)]),_0x27ff8b[_0x48e608(0x1b0)]&&console[_0x48e608(0x1d9)]('Segment\x20ID:\x20'+_0x27ff8b[_0x48e608(0x1b0)]));if(_0x5d0f3b[_0x48e608(0x147)]){if(_0x27ff8b[_0x48e608(0x1c5)]===_0x48e608(0x168))return console[_0x48e608(0x1d9)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x27ff8b[_0x48e608(0x1c5)]===_0x48e608(0x1a8))return console['error'](_0x48e608(0x1b7)),console[_0x48e608(0x1d9)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x27ff8b[_0x48e608(0x1b0)])throw new SDKError(ErrorCode[_0x48e608(0x1f2)],_0x48e608(0x15f));const _0x1d8cf5=getConsoleNextUrl(_0x5d0f3b[_0x48e608(0x148)],_0x48e608(0x1ba)+_0x27ff8b[_0x48e608(0x17d)]+'/e/'+_0x27ff8b[_0x48e608(0x1b0)]);return console['error'](a34_0x45fc67[_0x48e608(0x198)]('βœ”')+_0x48e608(0x1be)+a34_0x45fc67[_0x48e608(0x17a)](_0x1d8cf5)),openBrowser(_0x1d8cf5),0x0;}if(_0x27ff8b[_0x48e608(0x1c5)]===_0x48e608(0x168)){if(!_0x27ff8b['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x145f92=await withSpinner(_0x48e608(0x1bf),()=>_0x2a4597[_0x48e608(0x192)][_0x48e608(0x1da)](_0x27ff8b[_0x48e608(0x1b1)]),{'verbose':_0x5d0f3b['verbose']});await handleSingleObjectOutput(_0x145f92[_0x48e608(0x189)],_0x5d0f3b);}else{if(_0x27ff8b[_0x48e608(0x1c5)]===_0x48e608(0x192)){if(!_0x27ff8b[_0x48e608(0x1b0)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x48e608(0x15f));const _0x2980eb=await withSpinner(_0x48e608(0x1c1),()=>_0x2a4597[_0x48e608(0x192)]['getSegment'](_0x27ff8b[_0x48e608(0x17d)],_0x27ff8b[_0x48e608(0x1b0)]),{'verbose':_0x5d0f3b['verbose']}),_0x581602=getConsoleNextUrl(_0x5d0f3b['site'],'/app/ps/'+_0x27ff8b[_0x48e608(0x17d)]+_0x48e608(0x1bb)+_0x27ff8b[_0x48e608(0x1b0)]),_0x1a82f5=_0x2980eb[_0x48e608(0x189)];_0x1a82f5[_0x48e608(0x1c3)]=_0x581602,await handleSingleObjectOutput(_0x1a82f5,_0x5d0f3b);}else return console[_0x48e608(0x1d9)](_0x48e608(0x1d5)),console[_0x48e608(0x1d9)](_0x48e608(0x1dc)),0x1;}return 0x0;}catch(_0x547082){if(_0x547082 instanceof SDKError)return console['error'](_0x48e608(0x1a2)+_0x547082[_0x48e608(0x1d6)]),_0x547082['cause']&&console[_0x48e608(0x1d9)](_0x48e608(0x1eb)+_0x547082[_0x48e608(0x15a)]),0x1;throw _0x547082;}}}export const SegmentInfoCommand=SegmentViewCommand;function a34_0x1bee(_0x39b041,_0x2b5d00){_0x39b041=_0x39b041-0x147;const _0x331982=a34_0x3319();let _0x1bee46=_0x331982[_0x39b041];return _0x1bee46;}export class SegmentDescCommand extends BaseCommand{[a34_0x1009d7(0x16a)]=a34_0x1009d7(0x186);[a34_0x1009d7(0x1d2)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a34_0x1009d7(0x16c)](_0x3edb07){const _0x1cf087=a34_0x1009d7,{options:_0x21ae54,args:_0x61779c,tdx:_0x45811e}=_0x3edb07,_0x156bf3=_0x61779c[0x0];if(!_0x156bf3)return console[_0x1cf087(0x1d9)](_0x1cf087(0x1f3)),console[_0x1cf087(0x1d9)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console[_0x1cf087(0x1d9)](_0x1cf087(0x167)),console['error']('Examples:'),console['error'](_0x1cf087(0x19e)),console[_0x1cf087(0x1d9)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5e9aae=_0x21ae54[_0x1cf087(0x1e4)],_0x4dfdb5=await resolveSegmentTarget(_0x156bf3,_0x5e9aae,_0x21ae54[_0x1cf087(0x1b9)]);_0x21ae54[_0x1cf087(0x1b9)]&&console['error'](_0x1cf087(0x14b)+_0x4dfdb5);const _0x31985b=await withSpinner(_0x1cf087(0x1ae)+_0x156bf3+_0x1cf087(0x1c6),()=>_0x45811e[_0x1cf087(0x192)]['resolvePathToResource'](_0x4dfdb5),{'verbose':_0x21ae54[_0x1cf087(0x1b9)]}),_0x384ee8=_0x31985b['data'];_0x21ae54[_0x1cf087(0x1b9)]&&(console['error'](_0x1cf087(0x1ad)+_0x384ee8['type']),console[_0x1cf087(0x1d9)](_0x1cf087(0x173)+_0x384ee8[_0x1cf087(0x17d)]));if(_0x384ee8['type']==='folder')return console[_0x1cf087(0x1d9)](_0x1cf087(0x158)),console[_0x1cf087(0x1d9)](_0x1cf087(0x18b)),0x1;if(_0x384ee8[_0x1cf087(0x1c5)]===_0x1cf087(0x1a8))return console[_0x1cf087(0x1d9)](_0x1cf087(0x1a6)),console['error'](_0x1cf087(0x199)),0x1;if(!_0x384ee8[_0x1cf087(0x1b0)])throw new SDKError(ErrorCode[_0x1cf087(0x1f2)],_0x1cf087(0x15f));const _0x5d4eff=await withSpinner(_0x1cf087(0x15d),()=>_0x45811e[_0x1cf087(0x192)]['getSegmentSQL'](_0x384ee8[_0x1cf087(0x17d)],_0x384ee8[_0x1cf087(0x1b0)]),{'verbose':_0x21ae54['verbose']}),_0x2a048a=_0x5d4eff[_0x1cf087(0x189)],_0x46acf2=await executeSchemaQuery(_0x2a048a,_0x45811e,_0x21ae54);return await handleQueryOutput(_0x46acf2,_0x21ae54),0x0;}catch(_0x2c45f9){if(_0x2c45f9 instanceof SDKError)return console[_0x1cf087(0x1d9)](_0x1cf087(0x1a2)+_0x2c45f9['message']),_0x2c45f9['cause']&&console[_0x1cf087(0x1d9)](_0x1cf087(0x1eb)+_0x2c45f9['cause']),0x1;throw _0x2c45f9;}}}
@@ -1 +1 @@
1
- function a35_0xb737(_0x1b2cf0,_0x251e1a){_0x1b2cf0=_0x1b2cf0-0x105;const _0x117626=a35_0x1176();let _0xb737d1=_0x117626[_0x1b2cf0];return _0xb737d1;}const a35_0x4ead0e=a35_0xb737;(function(_0x27ff3e,_0x2df1f2){const _0x513ebc=a35_0xb737,_0x939920=_0x27ff3e();while(!![]){try{const _0x29d213=-parseInt(_0x513ebc(0x138))/0x1+-parseInt(_0x513ebc(0x135))/0x2*(parseInt(_0x513ebc(0x108))/0x3)+-parseInt(_0x513ebc(0x136))/0x4*(-parseInt(_0x513ebc(0x112))/0x5)+-parseInt(_0x513ebc(0x127))/0x6+-parseInt(_0x513ebc(0x12a))/0x7+parseInt(_0x513ebc(0x10c))/0x8*(parseInt(_0x513ebc(0x11f))/0x9)+parseInt(_0x513ebc(0x139))/0xa*(parseInt(_0x513ebc(0x128))/0xb);if(_0x29d213===_0x2df1f2)break;else _0x939920['push'](_0x939920['shift']());}catch(_0x203081){_0x939920['push'](_0x939920['shift']());}}}(a35_0x1176,0xd2aad));function a35_0x1176(){const _0x412b92=['βœ”\x20Created\x20segment\x20\x27','Creating\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Site:\x20','kind','2015hYqvyZ','Resolved\x20folder\x20ID:\x20','description','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','invisible','Examples:','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','error','Resolving\x20parent\x20segment\x20\x27','includes','type','6165DTYhYN','ruleFile','Target\x20path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','noCountPopulation','execute','folder','resolveFolderId','10070736NboMKm','17478593RVpMbE','Resolved\x20relative\x20path\x20to:\x20','274946xSfivc','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','resolveParentId','Create\x20child\x20segment\x20with\x20filtering\x20rules','data','Resolving\x20folder\x20\x27','name','createSegment','segment','length','\x27...','127444GQQZGN','6004yvbILu','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','210633otisTV','20AogdKO','yellow','Parent:\x20','resolvePathToResource','66DseCGi','parent','\x27\x20with\x20ID:\x20','segments','4792hBoFIL'];a35_0x1176=function(){return _0x412b92;};return a35_0x1176();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a35_0xeaae53 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a35_0x4ead0e(0x130)]='segment:create';[a35_0x4ead0e(0x114)]=a35_0x4ead0e(0x12d);async[a35_0x4ead0e(0x124)](_0x3f03fe){const _0x21d828=a35_0x4ead0e;console[_0x21d828(0x11b)](a35_0xeaae53[_0x21d828(0x105)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a35_0xeaae53[_0x21d828(0x105)](_0x21d828(0x137)));const {options:_0x1d6752,args:_0xbbb13b,tdx:_0x1024dc}=_0x3f03fe,_0x644c1=_0x1d6752;if(_0xbbb13b['length']===0x0)return console['error'](_0x21d828(0x116)),console['error'](_0x21d828(0x119)),console[_0x21d828(0x11b)](_0x21d828(0x118)),console[_0x21d828(0x11b)](_0x21d828(0x11a)),console['error'](_0x21d828(0x12b)),console[_0x21d828(0x11b)](_0x21d828(0x10f)),0x1;const _0x4ff80a=_0xbbb13b[0x0],_0xd3d63a=_0x1d6752['segmentPath'];let _0x21e781=_0x4ff80a;_0xd3d63a&&!_0x4ff80a[_0x21d828(0x11d)]('/')&&(_0x21e781=_0xd3d63a+'/'+_0x4ff80a,_0x644c1[_0x21d828(0x115)]&&console['error'](_0x21d828(0x129)+_0x21e781));const _0x4458fa=parsePath(_0x21e781);if(_0x4458fa[_0x21d828(0x10b)][_0x21d828(0x133)]<0x2)return console[_0x21d828(0x11b)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x21d828(0x11b)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x22de55=_0x4458fa[_0x21d828(0x10b)][0x0],_0x2818fe=getBaseName(_0x21e781),_0xa00f99=getParentPath(_0x21e781);_0x644c1['verbose']&&(console[_0x21d828(0x11b)](_0x21d828(0x110)+_0x644c1['site']),console[_0x21d828(0x11b)](_0x21d828(0x121)+_0x21e781),console[_0x21d828(0x11b)](_0x21d828(0x106)+_0x22de55),console[_0x21d828(0x11b)]('Segment\x20name:\x20'+_0x2818fe),console[_0x21d828(0x11b)]('Parent\x20path:\x20'+_0xa00f99));const _0x4f9c9b=await withSpinner(_0x21d828(0x11c)+_0x22de55+_0x21d828(0x134),()=>_0x1024dc[_0x21d828(0x132)][_0x21d828(0x12c)](_0x22de55),{'verbose':_0x644c1['verbose']}),_0x5b2343=_0x4f9c9b[_0x21d828(0x12e)];let _0x558209;if(_0x4458fa['segments'][_0x21d828(0x133)]>0x2){const _0x3b5ec4=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0xa00f99+_0x21d828(0x134),()=>_0x1024dc['segment'][_0x21d828(0x107)](_0xa00f99),{'verbose':_0x644c1['verbose']}),_0x2b1622=_0x3b5ec4['data'];if(_0x2b1622['type']!==_0x21d828(0x125)&&_0x2b1622[_0x21d828(0x11e)]!==_0x21d828(0x109))return console[_0x21d828(0x11b)](_0x21d828(0x122)),0x1;_0x558209=_0x2b1622['folderId'];}else{if(_0x644c1['folder']){const _0x245347=await withSpinner(_0x21d828(0x12f)+_0x644c1['folder']+'\x27...',()=>_0x1024dc['segment'][_0x21d828(0x126)](_0x5b2343,_0x644c1['folder']),{'verbose':_0x644c1[_0x21d828(0x115)]});_0x558209=_0x245347['data'];}}_0x644c1[_0x21d828(0x115)]&&_0x558209&&console[_0x21d828(0x11b)](_0x21d828(0x113)+_0x558209);const _0x18d77c=await loadJSONFromOptions(_0x644c1['rule'],_0x644c1[_0x21d828(0x120)]),_0x50e5ba={'name':_0x2818fe,'description':_0x644c1[_0x21d828(0x114)],'rule':_0x18d77c,'kind':_0x644c1['kind']!==undefined?parseInt(_0x644c1[_0x21d828(0x111)],0xa):undefined,'isVisible':_0x644c1[_0x21d828(0x117)]?![]:undefined,'segmentFolderId':_0x558209,'countPopulation':_0x644c1[_0x21d828(0x123)]?![]:undefined},_0x44f2bb=await withSpinner(_0x21d828(0x10e)+_0x2818fe+_0x21d828(0x134),()=>_0x1024dc[_0x21d828(0x132)][_0x21d828(0x131)](_0x5b2343,_0x50e5ba),{'verbose':_0x644c1[_0x21d828(0x115)]}),_0x3ebe25=_0x44f2bb[_0x21d828(0x12e)];return console[_0x21d828(0x11b)](_0x21d828(0x10d)+_0x3ebe25['name']+_0x21d828(0x10a)+_0x3ebe25['id']),_0x21e781!==_0x4ff80a&&console[_0x21d828(0x11b)]('\x20\x20\x20Path:\x20'+_0x21e781),await handleSDKOutput([_0x3ebe25],_0x644c1),0x0;}}
1
+ const a35_0x24e7dc=a35_0x5d80;(function(_0x572998,_0x3343fd){const _0xdf34cc=a35_0x5d80,_0xd3763e=_0x572998();while(!![]){try{const _0x5a4e27=-parseInt(_0xdf34cc(0xa0))/0x1+parseInt(_0xdf34cc(0xa3))/0x2+-parseInt(_0xdf34cc(0xaf))/0x3+parseInt(_0xdf34cc(0xad))/0x4*(parseInt(_0xdf34cc(0x96))/0x5)+-parseInt(_0xdf34cc(0x9c))/0x6+parseInt(_0xdf34cc(0xb1))/0x7+parseInt(_0xdf34cc(0x97))/0x8;if(_0x5a4e27===_0x3343fd)break;else _0xd3763e['push'](_0xd3763e['shift']());}catch(_0x1c3b87){_0xd3763e['push'](_0xd3763e['shift']());}}}(a35_0x29d4,0x5fc04));import{BaseCommand}from'./command.js';function a35_0x29d4(){const _0x1c7215=['583323CVxAYb','Resolved\x20folder\x20ID:\x20','error','1402766yqawsX','Create\x20child\x20segment\x20with\x20filtering\x20rules','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','createSegment','\x27...','Parent:\x20','invisible','name','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','description','68372lscdBd','segmentPath','988299BZflvu','Site:\x20','4457047hwJPpj','folder','site','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','segment','resolveParentId','ruleFile','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Examples:','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','includes','noCountPopulation','\x27\x20with\x20ID:\x20','data','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolving\x20folder\x20\x27','Resolving\x20folder\x20path\x20\x27','yellow','folderId','Parent\x20path:\x20','type','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','resolveFolderId','kind','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','βœ”\x20Created\x20segment\x20\x27','verbose','35mwXrWQ','4208384mBUmpL','segments','\x20\x20\x20Path:\x20','Segment\x20name:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','4073106FVcRIK','parent','segment:create','length'];a35_0x29d4=function(){return _0x1c7215;};return a35_0x29d4();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a35_0x223439 from'chalk';function a35_0x5d80(_0x56f480,_0x39c909){_0x56f480=_0x56f480-0x87;const _0x29d4b6=a35_0x29d4();let _0x5d80c3=_0x29d4b6[_0x56f480];return _0x5d80c3;}export class SegmentCreateCommand extends BaseCommand{[a35_0x24e7dc(0xaa)]=a35_0x24e7dc(0x9e);['description']=a35_0x24e7dc(0xa4);async['execute'](_0x41ee0c){const _0x45e9d9=a35_0x24e7dc;console[_0x45e9d9(0xa2)](a35_0x223439[_0x45e9d9(0x8c)](_0x45e9d9(0xb4))),console[_0x45e9d9(0xa2)](a35_0x223439[_0x45e9d9(0x8c)](_0x45e9d9(0x89)));const {options:_0x1359c4,args:_0x57dc6c,tdx:_0x4a5ab7}=_0x41ee0c,_0x3fd6ad=_0x1359c4;if(_0x57dc6c['length']===0x0)return console[_0x45e9d9(0xa2)](_0x45e9d9(0xb8)),console['error'](_0x45e9d9(0x9b)),console[_0x45e9d9(0xa2)](_0x45e9d9(0xb9)),console[_0x45e9d9(0xa2)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x45e9d9(0xa2)](_0x45e9d9(0x90)),console[_0x45e9d9(0xa2)](_0x45e9d9(0xa5)),0x1;const _0x64d7cf=_0x57dc6c[0x0],_0x160248=_0x1359c4[_0x45e9d9(0xae)];let _0x2d1479=_0x64d7cf;_0x160248&&!_0x64d7cf[_0x45e9d9(0xbb)]('/')&&(_0x2d1479=_0x160248+'/'+_0x64d7cf,_0x3fd6ad[_0x45e9d9(0x95)]&&console[_0x45e9d9(0xa2)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2d1479));const _0x1af962=parsePath(_0x2d1479);if(_0x1af962[_0x45e9d9(0x98)]['length']<0x2)return console[_0x45e9d9(0xa2)](_0x45e9d9(0xab)),console['error'](_0x45e9d9(0x93)),0x1;const _0x5c3218=_0x1af962[_0x45e9d9(0x98)][0x0],_0x36f229=getBaseName(_0x2d1479),_0x46fc7b=getParentPath(_0x2d1479);_0x3fd6ad[_0x45e9d9(0x95)]&&(console[_0x45e9d9(0xa2)](_0x45e9d9(0xb0)+_0x3fd6ad[_0x45e9d9(0xb3)]),console[_0x45e9d9(0xa2)]('Target\x20path:\x20'+_0x2d1479),console['error'](_0x45e9d9(0xa8)+_0x5c3218),console[_0x45e9d9(0xa2)](_0x45e9d9(0x9a)+_0x36f229),console[_0x45e9d9(0xa2)](_0x45e9d9(0x8e)+_0x46fc7b));const _0x3dc263=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5c3218+'\x27...',()=>_0x4a5ab7['segment'][_0x45e9d9(0xb6)](_0x5c3218),{'verbose':_0x3fd6ad[_0x45e9d9(0x95)]}),_0x861ab4=_0x3dc263[_0x45e9d9(0x88)];let _0x58741c;if(_0x1af962[_0x45e9d9(0x98)][_0x45e9d9(0x9f)]>0x2){const _0x2627d3=await withSpinner(_0x45e9d9(0x8b)+_0x46fc7b+_0x45e9d9(0xa7),()=>_0x4a5ab7[_0x45e9d9(0xb5)]['resolvePathToResource'](_0x46fc7b),{'verbose':_0x3fd6ad[_0x45e9d9(0x95)]}),_0x4e1e19=_0x2627d3[_0x45e9d9(0x88)];if(_0x4e1e19[_0x45e9d9(0x8f)]!==_0x45e9d9(0xb2)&&_0x4e1e19[_0x45e9d9(0x8f)]!==_0x45e9d9(0x9d))return console[_0x45e9d9(0xa2)](_0x45e9d9(0xba)),0x1;_0x58741c=_0x4e1e19[_0x45e9d9(0x8d)];}else{if(_0x3fd6ad[_0x45e9d9(0xb2)]){const _0x52ca9d=await withSpinner(_0x45e9d9(0x8a)+_0x3fd6ad[_0x45e9d9(0xb2)]+_0x45e9d9(0xa7),()=>_0x4a5ab7[_0x45e9d9(0xb5)][_0x45e9d9(0x91)](_0x861ab4,_0x3fd6ad['folder']),{'verbose':_0x3fd6ad['verbose']});_0x58741c=_0x52ca9d[_0x45e9d9(0x88)];}}_0x3fd6ad[_0x45e9d9(0x95)]&&_0x58741c&&console[_0x45e9d9(0xa2)](_0x45e9d9(0xa1)+_0x58741c);const _0x560dfd=await loadJSONFromOptions(_0x3fd6ad['rule'],_0x3fd6ad[_0x45e9d9(0xb7)]),_0x283e91={'name':_0x36f229,'description':_0x3fd6ad[_0x45e9d9(0xac)],'rule':_0x560dfd,'kind':_0x3fd6ad[_0x45e9d9(0x92)]!==undefined?parseInt(_0x3fd6ad[_0x45e9d9(0x92)],0xa):undefined,'isVisible':_0x3fd6ad[_0x45e9d9(0xa9)]?![]:undefined,'segmentFolderId':_0x58741c,'countPopulation':_0x3fd6ad[_0x45e9d9(0xbc)]?![]:undefined},_0x54b0bc=await withSpinner('Creating\x20segment\x20\x27'+_0x36f229+_0x45e9d9(0xa7),()=>_0x4a5ab7[_0x45e9d9(0xb5)][_0x45e9d9(0xa6)](_0x861ab4,_0x283e91),{'verbose':_0x3fd6ad[_0x45e9d9(0x95)]}),_0x4c1c20=_0x54b0bc[_0x45e9d9(0x88)];return console[_0x45e9d9(0xa2)](_0x45e9d9(0x94)+_0x4c1c20[_0x45e9d9(0xaa)]+_0x45e9d9(0x87)+_0x4c1c20['id']),_0x2d1479!==_0x64d7cf&&console['error'](_0x45e9d9(0x99)+_0x2d1479),await handleSDKOutput([_0x4c1c20],_0x3fd6ad),0x0;}}
@@ -1 +1 @@
1
- function a36_0x57e2(_0x392715,_0x2d4ed3){_0x392715=_0x392715-0x1cb;const _0x3691e6=a36_0x3691();let _0x57e20f=_0x3691e6[_0x392715];return _0x57e20f;}const a36_0x5dfaee=a36_0x57e2;(function(_0x4b5ec1,_0x509e96){const _0x13fdc3=a36_0x57e2,_0x147ae0=_0x4b5ec1();while(!![]){try{const _0x3c5419=-parseInt(_0x13fdc3(0x1dd))/0x1+parseInt(_0x13fdc3(0x1db))/0x2+-parseInt(_0x13fdc3(0x1e4))/0x3*(-parseInt(_0x13fdc3(0x1ce))/0x4)+parseInt(_0x13fdc3(0x1d5))/0x5+-parseInt(_0x13fdc3(0x1dc))/0x6+parseInt(_0x13fdc3(0x1d8))/0x7*(parseInt(_0x13fdc3(0x1e2))/0x8)+parseInt(_0x13fdc3(0x1da))/0x9;if(_0x3c5419===_0x509e96)break;else _0x147ae0['push'](_0x147ae0['shift']());}catch(_0x1c395c){_0x147ae0['push'](_0x147ae0['shift']());}}}(a36_0x3691,0xa41ba));function a36_0x3691(){const _0x55a1b1=['site','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','jsonl','46848zsRDov','\x27...','name','Parent\x20segment:\x20','description','length','data','6637975cAGXwi','βœ”\x20Found\x20','Site:\x20','7XvvIPE','verbose','2026620eDIVLo','1341550WRYRmC','3638316szInPN','1235229XiYjbi','error','parentSegment','listFields','execute','822872ZuRJoW','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','48axLmlb','json','\x20field'];a36_0x3691=function(){return _0x55a1b1;};return a36_0x3691();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a36_0x5dfaee(0x1d0)]='segment:fields';[a36_0x5dfaee(0x1d2)]='List\x20available\x20fields\x20for\x20segmentation';async[a36_0x5dfaee(0x1e1)](_0x1dd9de){const _0x3423a6=a36_0x5dfaee,{options:_0x1d989a,args:_0x19b503,tdx:_0xd043ca}=_0x1dd9de,_0xe58bf8=_0x19b503[0x0]||_0x1d989a[_0x3423a6(0x1df)];if(!_0xe58bf8)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3423a6(0x1de)](_0x3423a6(0x1cc)),console[_0x3423a6(0x1de)](_0x3423a6(0x1e3)),0x1;_0x1d989a[_0x3423a6(0x1d9)]&&(console[_0x3423a6(0x1de)](_0x3423a6(0x1d7)+_0x1d989a[_0x3423a6(0x1cb)]),console[_0x3423a6(0x1de)](_0x3423a6(0x1d1)+_0xe58bf8));const _0x3e0066=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0xe58bf8+_0x3423a6(0x1cf),()=>_0xd043ca['segment'][_0x3423a6(0x1e0)](_0xe58bf8),{'verbose':_0x1d989a[_0x3423a6(0x1d9)]}),_0x283b4d=_0x3e0066[_0x3423a6(0x1d4)];console[_0x3423a6(0x1de)](_0x3423a6(0x1d6)+_0x283b4d[_0x3423a6(0x1d3)]+_0x3423a6(0x1e6)+(_0x283b4d[_0x3423a6(0x1d3)]!==0x1?'s':''));if(_0x1d989a[_0x3423a6(0x1e5)]||_0x1d989a[_0x3423a6(0x1cd)])return await handleSDKOutput(_0x283b4d,_0x1d989a),0x0;return displayFieldsHumanReadable(_0x283b4d,_0xe58bf8),0x0;}}
1
+ const a36_0x5758a9=a36_0x3165;(function(_0x2a1073,_0x2aa557){const _0x1ede9a=a36_0x3165,_0x4af31c=_0x2a1073();while(!![]){try{const _0xf2e1d6=-parseInt(_0x1ede9a(0x1bd))/0x1+parseInt(_0x1ede9a(0x1c0))/0x2*(-parseInt(_0x1ede9a(0x1b2))/0x3)+-parseInt(_0x1ede9a(0x1b1))/0x4+parseInt(_0x1ede9a(0x1c4))/0x5*(-parseInt(_0x1ede9a(0x1c5))/0x6)+parseInt(_0x1ede9a(0x1b0))/0x7+-parseInt(_0x1ede9a(0x1b6))/0x8*(-parseInt(_0x1ede9a(0x1c6))/0x9)+parseInt(_0x1ede9a(0x1bf))/0xa;if(_0xf2e1d6===_0x2aa557)break;else _0x4af31c['push'](_0x4af31c['shift']());}catch(_0x352839){_0x4af31c['push'](_0x4af31c['shift']());}}}(a36_0x3c48,0x9dc9f));import{BaseCommand}from'./command.js';function a36_0x3165(_0x6d8c70,_0x491fa5){_0x6d8c70=_0x6d8c70-0x1ae;const _0x3c488f=a36_0x3c48();let _0x3165b2=_0x3c488f[_0x6d8c70];return _0x3165b2;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a36_0x5758a9(0x1b4)]=a36_0x5758a9(0x1ba);['description']=a36_0x5758a9(0x1bc);async[a36_0x5758a9(0x1c1)](_0x4a8665){const _0x35649b=a36_0x5758a9,{options:_0xd6c4f3,args:_0x7306be,tdx:_0x55664a}=_0x4a8665,_0x2b4ea0=_0x7306be[0x0]||_0xd6c4f3[_0x35649b(0x1c7)];if(!_0x2b4ea0)return console[_0x35649b(0x1b7)](_0x35649b(0x1af)),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x35649b(0x1b7)](_0x35649b(0x1c2)),0x1;_0xd6c4f3[_0x35649b(0x1b5)]&&(console[_0x35649b(0x1b7)]('Site:\x20'+_0xd6c4f3[_0x35649b(0x1b3)]),console['error'](_0x35649b(0x1bb)+_0x2b4ea0));const _0x4518a5=await withSpinner(_0x35649b(0x1be)+_0x2b4ea0+_0x35649b(0x1ae),()=>_0x55664a[_0x35649b(0x1b8)][_0x35649b(0x1b9)](_0x2b4ea0),{'verbose':_0xd6c4f3[_0x35649b(0x1b5)]}),_0xd53c79=_0x4518a5['data'];console[_0x35649b(0x1b7)]('βœ”\x20Found\x20'+_0xd53c79[_0x35649b(0x1c8)]+'\x20field'+(_0xd53c79[_0x35649b(0x1c8)]!==0x1?'s':''));if(_0xd6c4f3[_0x35649b(0x1c3)]||_0xd6c4f3['jsonl'])return await handleSDKOutput(_0xd53c79,_0xd6c4f3),0x0;return displayFieldsHumanReadable(_0xd53c79,_0x2b4ea0),0x0;}}function a36_0x3c48(){const _0x129ad9=['segment:fields','Parent\x20segment:\x20','List\x20available\x20fields\x20for\x20segmentation','970487gTzIuz','Listing\x20fields\x20for\x20\x27','24009810AuajFb','904238KYZwsZ','execute','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','json','933665JnfzSK','30FemDCi','27ESuvLK','parentSegment','length','\x27...','Error:\x20Parent\x20segment\x20name\x20is\x20required','581371MCXHBF','941668lGgYNc','3BGgkZV','site','name','verbose','2010552gLLswA','error','segment','listFields'];a36_0x3c48=function(){return _0x129ad9;};return a36_0x3c48();}
@@ -1 +1 @@
1
- const a37_0x381668=a37_0x42f4;function a37_0x42f4(_0x13e886,_0x40e102){_0x13e886=_0x13e886-0xe9;const _0x1000a9=a37_0x1000();let _0x42f4f8=_0x1000a9[_0x13e886];return _0x42f4f8;}(function(_0x1aed49,_0x216434){const _0x20da25=a37_0x42f4,_0x54fc0f=_0x1aed49();while(!![]){try{const _0x245e1=-parseInt(_0x20da25(0x133))/0x1+-parseInt(_0x20da25(0xf8))/0x2*(-parseInt(_0x20da25(0x113))/0x3)+parseInt(_0x20da25(0x10d))/0x4*(parseInt(_0x20da25(0xf4))/0x5)+parseInt(_0x20da25(0x126))/0x6*(parseInt(_0x20da25(0x130))/0x7)+parseInt(_0x20da25(0x11c))/0x8+parseInt(_0x20da25(0xf0))/0x9+-parseInt(_0x20da25(0x12e))/0xa;if(_0x245e1===_0x216434)break;else _0x54fc0f['push'](_0x54fc0f['shift']());}catch(_0x1aa086){_0x54fc0f['push'](_0x54fc0f['shift']());}}}(a37_0x1000,0x40592));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a37_0x16d262 from'chalk';function a37_0x1000(){const _0x1663d7=['name','filter','resourceName','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','journeys','targetDir','repeat','dim','isNew','description','-\x20no\x20files\x20written','\x20\x20Target:\x20','type','segment','Write\x20','segment:pull','message','session','152QNKJcK','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)','Parent\x20segment:\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20changed\x20files','parentName','892959MgnEqd','no_parent','counts','data','file','\x20=\x20','Target\x20resource:\x20','execute','\x20journeys','1822776fAdVYS','parent_segment','\x0aPull\x20summary\x20for\x20\x27','dryRun','\x20files?','\x0aError:','\x27...','parentSegment','\x20activations','\x20new\x20files','6jJiSJm','\x20files\x20to\x20','setPhase','cwd','dirname','helpText','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20versions)','12231530PzYhbB','yellow','3145646hiSTee','error','\x20\x20πŸ—ΊοΈ\x20\x20','130684SNPlhq','Aborted.','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','length','journeyVersions','Pulling\x20segments\x20from\x20\x27','green','red','pullSegments','verbose','cyan','βœ”\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','utf-8','content','hasChanges','Site:\x20','errorCode','\x20segments','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2586087UKHrLk','\x20with\x20','files','absolutePath','46735rAlCuD','yes','diff','\x20\x20🎯\x20','2DuQVVt','segments','\x0aChanges\x20to\x20\x27'];a37_0x1000=function(){return _0x1663d7;};return a37_0x1000();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a37_0x886f5a 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{[a37_0x381668(0xfb)]=a37_0x381668(0x10a);[a37_0x381668(0x104)]=a37_0x381668(0x12c);async[a37_0x381668(0x11a)](_0x14ae26){const _0x33cf82=a37_0x381668,{options:_0x449c43,args:_0x5ec407,tdx:_0x32f0f4}=_0x14ae26,_0x214a9e=_0x449c43,_0x3a451b=await resolveTarget({'arg':_0x5ec407[0x0],'contextParent':_0x449c43[_0x33cf82(0x123)],'cwd':process[_0x33cf82(0x129)]()});if(!isSuccessfulResolution(_0x3a451b))return _0x3a451b[_0x33cf82(0xed)]===_0x33cf82(0x114)?(console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x12f)](_0x33cf82(0x135))),console[_0x33cf82(0x131)](_0x33cf82(0x10e)),console[_0x33cf82(0x131)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x33cf82(0x131)]('\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[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x13a)]('Error:\x20'+_0x3a451b[_0x33cf82(0x10b)]+'\x0a')),_0x3a451b[_0x33cf82(0x12b)]&&console[_0x33cf82(0x131)](a37_0x16d262['cyan'](_0x3a451b[_0x33cf82(0x12b)]))),0x1;const _0x49f6bc=_0x3a451b[_0x33cf82(0x112)],_0x2eb4dd=_0x3a451b[_0x33cf82(0x100)],_0x1fcc36=_0x3a451b[_0x33cf82(0x107)]===_0x33cf82(0x117)?_0x3a451b[_0x33cf82(0xfd)]:undefined;_0x214a9e[_0x33cf82(0x13c)]&&(console[_0x33cf82(0x131)](_0x33cf82(0xec)+_0x214a9e['site']),console[_0x33cf82(0x131)](_0x33cf82(0x10f)+_0x49f6bc),_0x1fcc36&&console[_0x33cf82(0x131)](_0x33cf82(0x119)+_0x1fcc36));const _0x291c48=await withProgressSpinner(_0x33cf82(0x138)+_0x49f6bc+_0x33cf82(0x122),_0x5fb037=>_0x32f0f4[_0x33cf82(0x108)][_0x33cf82(0x13b)](_0x49f6bc,{'targetDir':_0x2eb4dd,'targetResourceName':_0x1fcc36,'verbose':_0x214a9e[_0x33cf82(0x13c)],'progress':{'update':_0x391b98=>{const _0x177aa6=_0x33cf82;_0x5fb037[_0x177aa6(0x128)](_0x391b98),_0x214a9e[_0x177aa6(0x13c)]&&console['error']('\x20\x20'+_0x391b98);}}}),{'verbose':_0x214a9e[_0x33cf82(0x13c)]}),_0x473221=_0x291c48[_0x33cf82(0x116)];if(_0x473221[_0x33cf82(0x115)]['segments']===0x0&&_0x473221[_0x33cf82(0x115)][_0x33cf82(0xff)]===0x0)return console['error'](a37_0x16d262['yellow'](_0x33cf82(0x110)+_0x473221[_0x33cf82(0x112)]+'\x27')),0x0;const _0xdf21cd=_0x473221[_0x33cf82(0xf2)][_0x33cf82(0xfc)](_0x434c0c=>_0x434c0c[_0x33cf82(0x103)]),_0x5e1657=_0x473221[_0x33cf82(0xf2)][_0x33cf82(0xfc)](_0x40ea92=>!_0x40ea92[_0x33cf82(0x103)]&&_0x40ea92['hasChanges']),_0x54c15e=_0x473221[_0x33cf82(0xf2)][_0x33cf82(0xfc)](_0x49003f=>!_0x49003f['isNew']&&!_0x49003f[_0x33cf82(0xeb)]);console[_0x33cf82(0x131)](_0x33cf82(0x11e)+_0x473221['parentName']+'\x27:'),console[_0x33cf82(0x131)](_0x33cf82(0xf7)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221[_0x33cf82(0x115)][_0x33cf82(0xf9)]+_0x33cf82(0xee))+_0x33cf82(0xf1)+a37_0x16d262['cyan'](_0x473221['counts']['activations']+_0x33cf82(0x124)));if(_0x473221[_0x33cf82(0x115)][_0x33cf82(0xff)]>0x0){const _0x38c961=_0x473221[_0x33cf82(0x115)]['journeyVersions']>_0x473221[_0x33cf82(0x115)]['journeys']?'\x20('+_0x473221[_0x33cf82(0x115)][_0x33cf82(0x137)]+_0x33cf82(0x12d):'';console[_0x33cf82(0x131)](_0x33cf82(0x132)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221['counts'][_0x33cf82(0xff)]+_0x33cf82(0x11b))+a37_0x16d262[_0x33cf82(0x102)](_0x38c961));}console[_0x33cf82(0x131)]('\x20\x20'+a37_0x16d262['green']('+\x20'+_0xdf21cd['length']+_0x33cf82(0x125))),console[_0x33cf82(0x131)]('\x20\x20'+a37_0x16d262[_0x33cf82(0x12f)]('~\x20'+_0x5e1657[_0x33cf82(0x136)]+_0x33cf82(0x111))),console[_0x33cf82(0x131)]('\x20\x20'+a37_0x16d262[_0x33cf82(0x102)]('=\x20'+_0x54c15e[_0x33cf82(0x136)]+'\x20unchanged\x20files')),console[_0x33cf82(0x131)](_0x33cf82(0x106)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221['targetDir'])+'\x0a');if(_0x5e1657[_0x33cf82(0x136)]>0x0)for(const _0x15d2d4 of _0x5e1657){console['error'](_0x33cf82(0xfa)+_0x15d2d4['relativePath']+'\x27:'),console['error']('─'[_0x33cf82(0x101)](0x3c)),console[_0x33cf82(0x131)](_0x15d2d4[_0x33cf82(0xf6)]),console[_0x33cf82(0x131)]('─'[_0x33cf82(0x101)](0x3c));}if(_0x214a9e[_0x33cf82(0x11f)])return console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x12f)](_0x33cf82(0x13f))),0x0;if(_0xdf21cd[_0x33cf82(0x136)]===0x0&&_0x5e1657[_0x33cf82(0x136)]===0x0)return console[_0x33cf82(0x131)](a37_0x16d262['green'](_0x33cf82(0xfe))),saveSessionContext({'parent_segment':_0x473221[_0x33cf82(0x112)]},_0x214a9e[_0x33cf82(0x10c)]),console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x139)]('βœ”\x20Context\x20set:\x20'+a37_0x16d262['dim'](_0x33cf82(0x11d))+_0x33cf82(0x118)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221[_0x33cf82(0x112)]))),0x0;if(!_0x214a9e[_0x33cf82(0xf5)]){if(!isInteractive())return console[_0x33cf82(0x131)](a37_0x16d262['red'](_0x33cf82(0x121)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x102)](_0x33cf82(0xef))),0x1;const _0x44c9f4=await confirmKey(_0x33cf82(0x109)+(_0xdf21cd[_0x33cf82(0x136)]+_0x5e1657[_0x33cf82(0x136)])+_0x33cf82(0x120));if(!_0x44c9f4)return console['error'](a37_0x16d262['yellow'](_0x33cf82(0x134)),_0x33cf82(0x105)),0x1;}for(const _0x518cb2 of _0x473221[_0x33cf82(0xf2)]){if(_0x518cb2[_0x33cf82(0x103)]||_0x518cb2[_0x33cf82(0xeb)]){const _0x5080b1=a37_0x886f5a[_0x33cf82(0x12a)](_0x518cb2[_0x33cf82(0xf3)]);!existsSync(_0x5080b1)&&mkdirSync(_0x5080b1,{'recursive':!![]}),writeFileSync(_0x518cb2[_0x33cf82(0xf3)],_0x518cb2[_0x33cf82(0xea)],_0x33cf82(0xe9));}}return console[_0x33cf82(0x131)](a37_0x16d262[_0x33cf82(0x139)]('βœ”\x20Pulled\x20'+(_0xdf21cd[_0x33cf82(0x136)]+_0x5e1657['length'])+_0x33cf82(0x127)+_0x473221['targetDir'])),saveSessionContext({'parent_segment':_0x473221[_0x33cf82(0x112)]},_0x214a9e[_0x33cf82(0x10c)]),console['error'](a37_0x16d262[_0x33cf82(0x139)](_0x33cf82(0x13e)+a37_0x16d262[_0x33cf82(0x102)](_0x33cf82(0x11d))+_0x33cf82(0x118)+a37_0x16d262[_0x33cf82(0x13d)](_0x473221[_0x33cf82(0x112)]))),0x0;}}
1
+ const a37_0x4b108a=a37_0x9e91;(function(_0x190f53,_0x35debf){const _0x585b9a=a37_0x9e91,_0x14ce07=_0x190f53();while(!![]){try{const _0x3dbd8d=-parseInt(_0x585b9a(0x1ac))/0x1+parseInt(_0x585b9a(0x197))/0x2*(parseInt(_0x585b9a(0x174))/0x3)+-parseInt(_0x585b9a(0x1b0))/0x4+-parseInt(_0x585b9a(0x179))/0x5*(-parseInt(_0x585b9a(0x192))/0x6)+parseInt(_0x585b9a(0x1b7))/0x7*(parseInt(_0x585b9a(0x17b))/0x8)+-parseInt(_0x585b9a(0x17a))/0x9+parseInt(_0x585b9a(0x1b8))/0xa;if(_0x3dbd8d===_0x35debf)break;else _0x14ce07['push'](_0x14ce07['shift']());}catch(_0x249685){_0x14ce07['push'](_0x14ce07['shift']());}}}(a37_0x23d4,0x393fb));function a37_0x9e91(_0x1e776b,_0x3db447){_0x1e776b=_0x1e776b-0x166;const _0x23d4e9=a37_0x23d4();let _0x9e9195=_0x23d4e9[_0x1e776b];return _0x9e9195;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a37_0x1a7313 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a37_0x23d4(){const _0x1ee4bf=['journeyVersions','\x20\x20Target:\x20','\x0aChanges\x20to\x20\x27','content','dirname','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)','\x20with\x20','\x20versions)','repeat','isNew','83511vayNTy','description','Pulling\x20segments\x20from\x20\x27','green','resourceName','5725wWlZfQ','3905694aMRVTy','17016wmkpdq','\x0aError:','dim','error','\x0aPull\x20summary\x20for\x20\x27','\x20=\x20','\x20activations','\x20journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Aborted.','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','hasChanges','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20new\x20files','\x20files\x20to\x20','cyan','data','journeys','file','cwd','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','no_parent','2286ErZEzU','-\x20no\x20files\x20written','βœ”\x20Pulled\x20','utf-8','absolutePath','20kDHygN','type','site','red','\x20\x20🎯\x20','dryRun','pullSegments','segment','\x27...','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Error:\x20','verbose','βœ”\x20Context\x20set:\x20','counts','files','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Write\x20','name','segments','length','313632safUAV','filter','errorCode','yellow','998364sqaItv','parentSegment','parent_segment','targetDir','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','setPhase','Target\x20resource:\x20','847euWFoQ','2596980zrOKQY','\x20segments','message','Parent\x20segment:\x20','\x20unchanged\x20files','relativePath'];a37_0x23d4=function(){return _0x1ee4bf;};return a37_0x23d4();}import a37_0x19e5c9 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{[a37_0x4b108a(0x1a9)]='segment:pull';[a37_0x4b108a(0x175)]=a37_0x4b108a(0x1b4);async['execute'](_0x91365d){const _0x2a6354=a37_0x4b108a,{options:_0x5bd550,args:_0x256f24,tdx:_0x34ad15}=_0x91365d,_0x1d9886=_0x5bd550,_0x20e79e=await resolveTarget({'arg':_0x256f24[0x0],'contextParent':_0x5bd550[_0x2a6354(0x1b1)],'cwd':process[_0x2a6354(0x18f)]()});if(!isSuccessfulResolution(_0x20e79e))return _0x20e79e[_0x2a6354(0x1ae)]===_0x2a6354(0x191)?(console[_0x2a6354(0x17e)](a37_0x1a7313[_0x2a6354(0x1af)](_0x2a6354(0x188))),console[_0x2a6354(0x17e)](_0x2a6354(0x16f)),console[_0x2a6354(0x17e)](_0x2a6354(0x183)),console['error'](_0x2a6354(0x1a1))):(console[_0x2a6354(0x17e)](a37_0x1a7313['red'](_0x2a6354(0x1a2)+_0x20e79e[_0x2a6354(0x166)]+'\x0a')),_0x20e79e['helpText']&&console[_0x2a6354(0x17e)](a37_0x1a7313['cyan'](_0x20e79e['helpText']))),0x1;const _0xaa676a=_0x20e79e[_0x2a6354(0x1a0)],_0x1ddbce=_0x20e79e[_0x2a6354(0x1b3)],_0xfcfca4=_0x20e79e[_0x2a6354(0x198)]===_0x2a6354(0x18e)?_0x20e79e[_0x2a6354(0x178)]:undefined;_0x1d9886[_0x2a6354(0x1a3)]&&(console[_0x2a6354(0x17e)]('Site:\x20'+_0x1d9886[_0x2a6354(0x199)]),console[_0x2a6354(0x17e)](_0x2a6354(0x167)+_0xaa676a),_0xfcfca4&&console[_0x2a6354(0x17e)](_0x2a6354(0x1b6)+_0xfcfca4));const _0x287205=await withProgressSpinner(_0x2a6354(0x176)+_0xaa676a+_0x2a6354(0x19f),_0x2d545d=>_0x34ad15[_0x2a6354(0x19e)][_0x2a6354(0x19d)](_0xaa676a,{'targetDir':_0x1ddbce,'targetResourceName':_0xfcfca4,'verbose':_0x1d9886[_0x2a6354(0x1a3)],'progress':{'update':_0x1a55b9=>{const _0x5f7e9=_0x2a6354;_0x2d545d[_0x5f7e9(0x1b5)](_0x1a55b9),_0x1d9886['verbose']&&console[_0x5f7e9(0x17e)]('\x20\x20'+_0x1a55b9);}}}),{'verbose':_0x1d9886['verbose']}),_0x3c0166=_0x287205[_0x2a6354(0x18c)];if(_0x3c0166[_0x2a6354(0x1a5)][_0x2a6354(0x1aa)]===0x0&&_0x3c0166['counts']['journeys']===0x0)return console[_0x2a6354(0x17e)](a37_0x1a7313[_0x2a6354(0x1af)](_0x2a6354(0x186)+_0x3c0166[_0x2a6354(0x1a0)]+'\x27')),0x0;const _0x44cb3f=_0x3c0166[_0x2a6354(0x1a6)][_0x2a6354(0x1ad)](_0x72913a=>_0x72913a[_0x2a6354(0x173)]),_0x316fe0=_0x3c0166[_0x2a6354(0x1a6)]['filter'](_0x9cf664=>!_0x9cf664[_0x2a6354(0x173)]&&_0x9cf664[_0x2a6354(0x187)]),_0x5ad9b4=_0x3c0166['files'][_0x2a6354(0x1ad)](_0xc06be8=>!_0xc06be8[_0x2a6354(0x173)]&&!_0xc06be8[_0x2a6354(0x187)]);console[_0x2a6354(0x17e)](_0x2a6354(0x17f)+_0x3c0166[_0x2a6354(0x1a0)]+'\x27:'),console['error'](_0x2a6354(0x19b)+a37_0x1a7313[_0x2a6354(0x18b)](_0x3c0166[_0x2a6354(0x1a5)]['segments']+_0x2a6354(0x1b9))+_0x2a6354(0x170)+a37_0x1a7313[_0x2a6354(0x18b)](_0x3c0166[_0x2a6354(0x1a5)]['activations']+_0x2a6354(0x181)));if(_0x3c0166[_0x2a6354(0x1a5)][_0x2a6354(0x18d)]>0x0){const _0x2ba20f=_0x3c0166[_0x2a6354(0x1a5)]['journeyVersions']>_0x3c0166[_0x2a6354(0x1a5)][_0x2a6354(0x18d)]?'\x20('+_0x3c0166[_0x2a6354(0x1a5)][_0x2a6354(0x16a)]+_0x2a6354(0x171):'';console['error']('\x20\x20πŸ—ΊοΈ\x20\x20'+a37_0x1a7313[_0x2a6354(0x18b)](_0x3c0166[_0x2a6354(0x1a5)]['journeys']+_0x2a6354(0x182))+a37_0x1a7313['dim'](_0x2ba20f));}console['error']('\x20\x20'+a37_0x1a7313[_0x2a6354(0x177)]('+\x20'+_0x44cb3f[_0x2a6354(0x1ab)]+_0x2a6354(0x189))),console[_0x2a6354(0x17e)]('\x20\x20'+a37_0x1a7313[_0x2a6354(0x1af)]('~\x20'+_0x316fe0[_0x2a6354(0x1ab)]+'\x20changed\x20files')),console[_0x2a6354(0x17e)]('\x20\x20'+a37_0x1a7313[_0x2a6354(0x17d)]('=\x20'+_0x5ad9b4[_0x2a6354(0x1ab)]+_0x2a6354(0x168))),console[_0x2a6354(0x17e)](_0x2a6354(0x16b)+a37_0x1a7313[_0x2a6354(0x18b)](_0x3c0166[_0x2a6354(0x1b3)])+'\x0a');if(_0x316fe0[_0x2a6354(0x1ab)]>0x0)for(const _0x4ef37f of _0x316fe0){console[_0x2a6354(0x17e)](_0x2a6354(0x16c)+_0x4ef37f[_0x2a6354(0x169)]+'\x27:'),console[_0x2a6354(0x17e)]('─'[_0x2a6354(0x172)](0x3c)),console[_0x2a6354(0x17e)](_0x4ef37f['diff']),console['error']('─'['repeat'](0x3c));}if(_0x1d9886[_0x2a6354(0x19c)])return console[_0x2a6354(0x17e)](a37_0x1a7313[_0x2a6354(0x1af)](_0x2a6354(0x184))),0x0;if(_0x44cb3f[_0x2a6354(0x1ab)]===0x0&&_0x316fe0[_0x2a6354(0x1ab)]===0x0)return console[_0x2a6354(0x17e)](a37_0x1a7313['green'](_0x2a6354(0x190))),saveSessionContext({'parent_segment':_0x3c0166['parentName']},_0x1d9886['session']),console['error'](a37_0x1a7313[_0x2a6354(0x177)](_0x2a6354(0x1a4)+a37_0x1a7313[_0x2a6354(0x17d)](_0x2a6354(0x1b2))+_0x2a6354(0x180)+a37_0x1a7313[_0x2a6354(0x18b)](_0x3c0166['parentName']))),0x0;if(!_0x1d9886['yes']){if(!isInteractive())return console['error'](a37_0x1a7313[_0x2a6354(0x19a)](_0x2a6354(0x17c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2a6354(0x17e)](a37_0x1a7313[_0x2a6354(0x17d)](_0x2a6354(0x1a7))),0x1;const _0x3b5970=await confirmKey(_0x2a6354(0x1a8)+(_0x44cb3f['length']+_0x316fe0[_0x2a6354(0x1ab)])+'\x20files?');if(!_0x3b5970)return console[_0x2a6354(0x17e)](a37_0x1a7313[_0x2a6354(0x1af)](_0x2a6354(0x185)),_0x2a6354(0x193)),0x1;}for(const _0x14f973 of _0x3c0166['files']){if(_0x14f973[_0x2a6354(0x173)]||_0x14f973['hasChanges']){const _0x21c545=a37_0x19e5c9[_0x2a6354(0x16e)](_0x14f973[_0x2a6354(0x196)]);!existsSync(_0x21c545)&&mkdirSync(_0x21c545,{'recursive':!![]}),writeFileSync(_0x14f973[_0x2a6354(0x196)],_0x14f973[_0x2a6354(0x16d)],_0x2a6354(0x195));}}return console['error'](a37_0x1a7313[_0x2a6354(0x177)](_0x2a6354(0x194)+(_0x44cb3f[_0x2a6354(0x1ab)]+_0x316fe0[_0x2a6354(0x1ab)])+_0x2a6354(0x18a)+_0x3c0166['targetDir'])),saveSessionContext({'parent_segment':_0x3c0166[_0x2a6354(0x1a0)]},_0x1d9886['session']),console[_0x2a6354(0x17e)](a37_0x1a7313['green'](_0x2a6354(0x1a4)+a37_0x1a7313[_0x2a6354(0x17d)](_0x2a6354(0x1b2))+_0x2a6354(0x180)+a37_0x1a7313['cyan'](_0x3c0166[_0x2a6354(0x1a0)]))),0x0;}}
@@ -1 +1 @@
1
- const a38_0x2be8f4=a38_0x4920;(function(_0x5a9dfe,_0x1f03e9){const _0x50fa6d=a38_0x4920,_0x43d44d=_0x5a9dfe();while(!![]){try{const _0x3e93d2=-parseInt(_0x50fa6d(0xb4))/0x1*(parseInt(_0x50fa6d(0x11e))/0x2)+parseInt(_0x50fa6d(0x11d))/0x3*(-parseInt(_0x50fa6d(0xbb))/0x4)+parseInt(_0x50fa6d(0xb7))/0x5*(parseInt(_0x50fa6d(0x11f))/0x6)+parseInt(_0x50fa6d(0x13e))/0x7*(-parseInt(_0x50fa6d(0xee))/0x8)+parseInt(_0x50fa6d(0x12f))/0x9*(parseInt(_0x50fa6d(0x114))/0xa)+-parseInt(_0x50fa6d(0xd3))/0xb+parseInt(_0x50fa6d(0xbe))/0xc*(parseInt(_0x50fa6d(0x12a))/0xd);if(_0x3e93d2===_0x1f03e9)break;else _0x43d44d['push'](_0x43d44d['shift']());}catch(_0xcb4bd3){_0x43d44d['push'](_0x43d44d['shift']());}}}(a38_0x5d16,0xeea06));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';function a38_0x5d16(){const _0x339d73=['journeyId','user','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','555165pszHiU','isNew','results','changed','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','created','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','existingSegment','state','createdAt','\x20changes?','targetDir','\x20unchanged','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0aValidation\x20failed:','7uNFeDq','filePath','Delete\x20journey:','nameToId','dim','cwd','connection','attributes','length','activations','versionNumber','yamlConfig','listFolders','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','getJourney','Folders\x20to\x20create:','(Journey\x20will\x20be\x20deleted)','segments','Push\x20','/e/','Delete\x20segment:','\x20\x20Activations:','387503vItVQE','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','journey','6025GwTKXA','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','folderPath','segment','387736xQpLWJ','journeyBundleName','\x20folders\x20to\x20create','5823828vPehSl','.yml','map','data','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20activations]','Error\x20parsing\x20YAML:\x20','blue','parentFolder','\x27...','error','Preparing\x20journeys...','toString','folders','red','Site:\x20','segmentFolderId','listJourneysWithDetailsFromParentSegment','toCreate','set','Changes\x20to:','200046raiYLM','\x20deleted','\x20changed','all','helpText','type','nameToType','updated','updatedAt','\x20\x20Journeys:\x20','idToName','verbose','name','toDelete','/sb/da/esr','delete','\x20YAML\x20files\x20found','.yaml','Fetching\x20existing\x20activations...','πŸ“\x20','\x20\x20\x20\x20','createdSegmentIds','yellow','existingJourney','add','isScoped','execute','14400264ZFXgyl','\x20to\x20delete','cyan','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toUpdate','folderId','repeat','join','segment:push','journeyBundleId','parentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','listActivations','/j/da/je','/app/ps/','\x20\x20Source:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','new','paused','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','dryRun','getOutputSchemaWithCache','message','\x20\x20πŸ“Š\x20Segments:','No\x20','getParent','Error:\x20Directory\x20not\x20found:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','setPhase','site','green','journeys','unchanged','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','relationships','diff','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeysOnly','130dAIhUX','New\x20journey:','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','then','no_parent','\x20updated','file','\x20created','get','9pXvTru','10TLXkAr','8940WhaOHt','\x20to\x20update','yes','\x20new','buildUserMaps','filter','endsWith','\x20\x20Segments:\x20','parentSegment','push','Changes\x20to\x20journey:','65JUucIT','parent_name'];a38_0x5d16=function(){return _0x339d73;};return a38_0x5d16();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a38_0x4e5aba from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a38_0x4920(_0x2677ef,_0x3cd941){_0x2677ef=_0x2677ef-0xa9;const _0x5d1606=a38_0x5d16();let _0x4920c9=_0x5d1606[_0x2677ef];return _0x4920c9;}export class SegmentPushCommand extends BaseCommand{[a38_0x2be8f4(0xdf)]=a38_0x2be8f4(0xf6);['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a38_0x2be8f4(0xed)](_0x9441d){const _0x3c5a7b=a38_0x2be8f4,{options:_0x19a27f,args:_0x213280,tdx:_0x116ea1}=_0x9441d,_0x52f448=_0x19a27f,_0x1d0c3f=await resolveTarget({'arg':_0x213280[0x0],'contextParent':_0x19a27f[_0x3c5a7b(0x127)],'cwd':process[_0x3c5a7b(0x143)]()});if(!isSuccessfulResolution(_0x1d0c3f))return _0x1d0c3f['errorCode']===_0x3c5a7b(0x118)?(console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3c5a7b(0x109)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xf9)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xb5))):(console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)]('Error:\x20'+_0x1d0c3f[_0x3c5a7b(0x104)]+'\x0a')),_0x1d0c3f[_0x3c5a7b(0xd7)]&&console['error'](a38_0x4e5aba['cyan'](_0x1d0c3f[_0x3c5a7b(0xd7)]))),0x1;if(_0x1d0c3f[_0x3c5a7b(0xd8)]===_0x3c5a7b(0x12b))return console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x108)+_0x1d0c3f[_0x3c5a7b(0x13a)]+'\x0a')),console[_0x3c5a7b(0xc8)](a38_0x4e5aba['cyan'](_0x3c5a7b(0xf1))),0x1;const _0x4dcf5f=_0x1d0c3f[_0x3c5a7b(0xf8)],_0x534f92=_0x1d0c3f['targetDir'],_0x476586=_0x1d0c3f[_0x3c5a7b(0xd8)]===_0x3c5a7b(0x11a)?_0x1d0c3f[_0x3c5a7b(0x13f)]:undefined,_0x353675=getScopedDetails(_0x1d0c3f),_0x1e1e98=_0x353675?.[_0x3c5a7b(0xec)]??![],_0x30f1e9=_0x353675?.['scopedFolderPath']??'';if(!existsSync(_0x534f92))return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x108)+_0x534f92+'\x0a')),console['error'](a38_0x4e5aba['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x52f448['verbose']&&(console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xcd)+_0x52f448[_0x3c5a7b(0x10b)]),console[_0x3c5a7b(0xc8)]('Parent\x20segment:\x20'+_0x4dcf5f),console[_0x3c5a7b(0xc8)]('Source\x20directory:\x20'+_0x534f92),_0x1e1e98&&console['error']('Scoped\x20to\x20folder:\x20'+_0x30f1e9));const _0x1e06ae=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4dcf5f+_0x3c5a7b(0xc7),()=>_0x116ea1[_0x3c5a7b(0xba)]['resolveParentId'](_0x4dcf5f),{'verbose':_0x52f448[_0x3c5a7b(0xde)]}),_0x491c87=_0x1e06ae[_0x3c5a7b(0xc1)],{parentSegmentResult:_0x2fb39d,segmentsResult:_0x5a7474,foldersResult:_0x171c4a,journeysWithDetailsResult:_0x23bed8,userMaps:_0xd2c566}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x394f70=_0x3c5a7b,[_0x4d56a2,_0x24560c,_0x39c14e,_0x53072e,_0x2f8660]=await Promise[_0x394f70(0xd6)]([_0x116ea1['segment'][_0x394f70(0x107)](_0x491c87),_0x116ea1[_0x394f70(0xba)]['listSegments'](_0x491c87),_0x116ea1[_0x394f70(0xba)][_0x394f70(0xaa)](_0x491c87),_0x116ea1[_0x394f70(0xb6)][_0x394f70(0xcf)](_0x491c87,{'includeAllVersions':!![]}),_0x116ea1[_0x394f70(0x12d)][_0x394f70(0x123)]()]);return{'parentSegmentResult':_0x4d56a2,'segmentsResult':_0x24560c,'foldersResult':_0x39c14e,'journeysWithDetailsResult':_0x53072e,'userMaps':_0x2f8660};},{'verbose':_0x52f448['verbose']})[_0x3c5a7b(0x117)](_0xbe0954=>_0xbe0954['data']),_0x32fc09=_0x2fb39d,_0x5b8603=extractRootFolderId(_0x32fc09),_0xf51a17=_0x5a7474,_0x60eae5=_0x171c4a,{journeys:_0xf05fcb,activationStepsById:_0x186201}=_0x23bed8,_0x54cb8f=new Map(_0xf05fcb[_0x3c5a7b(0xc0)](_0x1fb409=>[_0x1fb409['id'],_0x1fb409])),_0x15086f=_0xf05fcb[_0x3c5a7b(0xc0)](_0x1926ea=>({'id':_0x1926ea['id'],'name':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0xdf)],'journeyBundleName':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0xbc)]||'','journeyBundleId':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0xf7)]||'','versionNumber':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0x148)],'description':_0x1926ea['attributes']['description'],'state':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0x137)],'paused':_0x1926ea[_0x3c5a7b(0x145)][_0x3c5a7b(0x100)],'audienceId':_0x1926ea['attributes']['audienceId'],'folderId':_0x1926ea[_0x3c5a7b(0x110)]?.[_0x3c5a7b(0xc6)]?.[_0x3c5a7b(0xc1)]?.['id'],'createdAt':_0x1926ea['attributes'][_0x3c5a7b(0x138)],'updatedAt':_0x1926ea['attributes'][_0x3c5a7b(0xdb)]})),{emailToId:_0x13a137,idToEmail:_0x116f92}=_0xd2c566,_0x5c42ee=await withSpinner(_0x3c5a7b(0xfe),async()=>{const _0x4cbf47=await _0x116ea1['connection']['list']();return buildConnectionMaps(_0x4cbf47);},{'verbose':_0x52f448[_0x3c5a7b(0xde)]})[_0x3c5a7b(0x117)](_0x22d454=>_0x22d454[_0x3c5a7b(0xc1)]),_0x17fb2a=_0x5c42ee[_0x3c5a7b(0x141)],_0x5f0336=_0x5c42ee['idToName'],_0x9d4b3b=_0x5c42ee[_0x3c5a7b(0xd9)],_0x47459f={'emailToIdMap':_0x13a137,'connectionNameToIdMap':_0x17fb2a,'connectionNameToTypeMap':_0x9d4b3b,'getSchema':_0x13d778=>_0x116ea1['connection'][_0x3c5a7b(0x103)](_0x13d778)};let {pathToId:_0x5b7fdd,idToPath:_0x1ffb9d}=buildFolderMaps(_0x60eae5);const _0x213935=buildSegmentLookupMap(_0xf51a17,_0x1ffb9d),_0x3fd0ca=buildSegmentNameToIdMap(_0xf51a17),_0x340cc4=buildJourneyBundleLookupMap(_0x15086f,_0x1ffb9d);let _0x3c0a11;if(_0x476586){if(!_0x476586[_0x3c5a7b(0x125)](_0x3c5a7b(0xbf))&&!_0x476586[_0x3c5a7b(0x125)](_0x3c5a7b(0xe4)))return console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x12e)+_0x476586+'\x0a')),0x1;_0x3c0a11=[_0x476586];}else _0x3c0a11=findYamlFiles(_0x534f92);if(_0x3c0a11[_0x3c5a7b(0x146)]===0x0)return console['error'](a38_0x4e5aba[_0x3c5a7b(0xcc)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x534f92+'\x0a')),console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xf0)](_0x3c5a7b(0x116))),0x1;let _0x14788b,_0x3e35ad;try{const _0x4dd8eb=parseAndClassifyYamlFiles(_0x3c0a11,_0x534f92,{'skipSegments':_0x52f448['journeysOnly']});_0x14788b=_0x4dd8eb[_0x3c5a7b(0xaf)],_0x3e35ad=_0x4dd8eb[_0x3c5a7b(0x10d)];const _0x2e6afe=validateParsedFiles(_0x4dd8eb,_0x534f92);if(_0x2e6afe['length']>0x0)return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x13d))),console[_0x3c5a7b(0xc8)](formatValidationErrors(_0x2e6afe)),console['error'](a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0x10f))),0x1;}catch(_0x5a97f6){return console[_0x3c5a7b(0xc8)](a38_0x4e5aba['red'](_0x3c5a7b(0xc4)+(_0x5a97f6 instanceof Error?_0x5a97f6[_0x3c5a7b(0x104)]:_0x5a97f6))),0x1;}if(_0x14788b[_0x3c5a7b(0x146)]===0x0&&_0x3e35ad[_0x3c5a7b(0x146)]===0x0){const _0x4af2ed=_0x52f448[_0x3c5a7b(0x113)]?_0x3c5a7b(0xb6):'segment\x20or\x20journey';return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0x106)+_0x4af2ed+_0x3c5a7b(0xe3))),0x0;}const _0x264316=new Map();_0xf51a17['length']>0x0&&!_0x52f448['journeysOnly']&&await withSpinner(_0x3c5a7b(0xe5),async()=>{await batchAsync(_0xf51a17,async _0x57388d=>{const _0x1f979e=a38_0x4920,_0x4f5672=await _0x116ea1[_0x1f979e(0xba)][_0x1f979e(0xfa)](_0x491c87,_0x57388d['id']);_0x264316[_0x1f979e(0xd1)](_0x57388d['id'],_0x4f5672);});},{'verbose':_0x52f448[_0x3c5a7b(0xde)]});const {segmentFiles:_0x5dbe71,foldersToCreate:_0x530d03}=await prepareSegmentFiles(_0x14788b,{'segmentByFolderAndName':_0x213935,'activationsBySegmentId':_0x264316,'folderPathToId':_0x5b7fdd,'idToEmailMap':_0x116f92,'connectionIdToNameMap':_0x5f0336},_0x47459f,_0x1e1e98,_0x30f1e9),_0x41f07d=_0x476586?[]:findSegmentsToDelete(_0xf51a17,_0x14788b[_0x3c5a7b(0xc0)](({yamlConfig:_0x128f1e,folderPath:_0x209a49})=>({'yamlConfig':_0x128f1e,'folderPath':resolveTDFolderPath(_0x209a49,_0x1e1e98,_0x30f1e9)})),_0x1ffb9d,_0x30f1e9,_0x1e1e98),{journeyFiles:_0x4e6ea6,foldersToCreate:_0x3bd5c9}=await withProgressSpinner(_0x3c5a7b(0xc9),async _0x3dd72a=>prepareJourneyFiles(_0x3e35ad,{'fetchJourney':async _0x4189b2=>_0x116ea1[_0x3c5a7b(0xb6)][_0x3c5a7b(0xac)](_0x4189b2['journeyId']),'journeyBundlesByFolderAndName':_0x340cc4,'folderPathToId':_0x5b7fdd,'idToEmailMap':_0x116f92,'connectionIdToNameMap':_0x5f0336,'existingSegments':_0xf51a17,'parentId':_0x491c87,'deps':_0x116ea1,'progress':{'update':_0x5bd4a6=>{const _0x5c2d1=_0x3c5a7b;_0x3dd72a[_0x5c2d1(0x10a)](_0x5bd4a6),_0x52f448['verbose']&&console[_0x5c2d1(0xc8)]('\x20\x20'+_0x5bd4a6);}},'journeyById':_0x54cb8f,'activationStepsById':_0x186201},_0x1e1e98,_0x30f1e9),{'verbose':_0x52f448['verbose']})['then'](_0x5975a8=>_0x5975a8[_0x3c5a7b(0xc1)]);for(const _0x40d044 of _0x3bd5c9){_0x530d03[_0x3c5a7b(0xeb)](_0x40d044);}const _0x4ade10=_0x476586?[]:findJourneysToDelete(_0x15086f,_0x3e35ad[_0x3c5a7b(0xc0)](({yamlConfig:_0x265337,folderPath:_0x2efd51})=>({'yamlConfig':_0x265337,'folderPath':resolveTDFolderPath(_0x2efd51,_0x1e1e98,_0x30f1e9)})),_0x1ffb9d,_0x30f1e9,_0x1e1e98),_0x143377=calculatePushStats(_0x5dbe71,_0x4e6ea6,_0x530d03,_0x41f07d,_0x4ade10,!!_0x52f448[_0x3c5a7b(0xe2)],!!_0x52f448['journeysOnly']),_0x548329=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0xff)],_0x42fc49=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0x132)],_0x12fc4d=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0x10e)],_0x5ce1cb=_0x143377[_0x3c5a7b(0xaf)][_0x3c5a7b(0xe0)],_0x3e4467=_0x143377[_0x3c5a7b(0xcb)][_0x3c5a7b(0xd0)],_0x30a19a=_0x143377[_0x3c5a7b(0x10d)][_0x3c5a7b(0xff)],_0x3ac9af=_0x143377[_0x3c5a7b(0x10d)][_0x3c5a7b(0x132)],_0x49669e=_0x143377[_0x3c5a7b(0x10d)][_0x3c5a7b(0x10e)],_0x41325b=_0x143377[_0x3c5a7b(0x10d)]['toDelete'],_0x48ad7d=_0x143377[_0x3c5a7b(0x147)][_0x3c5a7b(0xd6)],_0x83a9c=_0x143377['activations']['toCreate'],_0x8f8b2f=_0x143377[_0x3c5a7b(0x147)][_0x3c5a7b(0xf2)],_0x2a75ae=_0x143377[_0x3c5a7b(0x147)]['toDelete'];console[_0x3c5a7b(0xc8)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4dcf5f+'\x27:');_0x3e4467[_0x3c5a7b(0x146)]>0x0&&console[_0x3c5a7b(0xc8)]('\x20\x20'+a38_0x4e5aba[_0x3c5a7b(0xc5)](_0x3c5a7b(0xe6)+_0x3e4467[_0x3c5a7b(0x146)]+_0x3c5a7b(0xbd)));if(!_0x52f448[_0x3c5a7b(0x113)]){console[_0x3c5a7b(0xc8)](_0x3c5a7b(0x105)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x10c)]('+\x20'+_0x548329[_0x3c5a7b(0x146)]+_0x3c5a7b(0x122))),console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xe9)]('~\x20'+_0x42fc49[_0x3c5a7b(0x146)]+_0x3c5a7b(0xd5)));if(_0x5ce1cb[_0x3c5a7b(0x146)]>0x0)console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xcc)]('-\x20'+_0x5ce1cb[_0x3c5a7b(0x146)]+'\x20to\x20delete'));else _0x41f07d['length']>0x0&&!_0x52f448[_0x3c5a7b(0xe2)]&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x142)](_0x41f07d['length']+_0x3c5a7b(0xc2)));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x142)]('=\x20'+_0x12fc4d['length']+'\x20unchanged'));}if(_0x4e6ea6[_0x3c5a7b(0x146)]>0x0||_0x4ade10[_0x3c5a7b(0x146)]>0x0){console[_0x3c5a7b(0xc8)](_0x3c5a7b(0x135)),console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x10c)]('+\x20'+_0x30a19a[_0x3c5a7b(0x146)]+_0x3c5a7b(0x122))),console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xe9)]('~\x20'+_0x3ac9af[_0x3c5a7b(0x146)]+_0x3c5a7b(0xd5)));if(_0x41325b['length']>0x0)console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xcc)]('-\x20'+_0x41325b['length']+_0x3c5a7b(0xef)));else _0x4ade10[_0x3c5a7b(0x146)]>0x0&&!_0x52f448['delete']&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0x142)](_0x4ade10[_0x3c5a7b(0x146)]+_0x3c5a7b(0xc2)));console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba['dim']('=\x20'+_0x49669e[_0x3c5a7b(0x146)]+_0x3c5a7b(0x13b)));}_0x48ad7d[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)]&&(console[_0x3c5a7b(0xc8)](''),console['error'](_0x3c5a7b(0xb3)),_0x83a9c[_0x3c5a7b(0x146)]>0x0&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba['green']('+\x20'+_0x83a9c[_0x3c5a7b(0x146)]+'\x20to\x20create')),_0x8f8b2f[_0x3c5a7b(0x146)]>0x0&&console['error'](_0x3c5a7b(0xe7)+a38_0x4e5aba[_0x3c5a7b(0xe9)]('~\x20'+_0x8f8b2f['length']+_0x3c5a7b(0x120))),_0x2a75ae[_0x3c5a7b(0x146)]>0x0&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xe7)+a38_0x4e5aba['red']('-\x20'+_0x2a75ae[_0x3c5a7b(0x146)]+_0x3c5a7b(0xef))));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xfd)+a38_0x4e5aba['cyan'](_0x534f92)+'\x0a');if(_0x3e4467[_0x3c5a7b(0x146)]>0x0){console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xad));for(const _0x1ae734 of _0x3e4467){console['error']('\x20\x20'+a38_0x4e5aba['blue']('+')+'\x20'+_0x1ae734);}console[_0x3c5a7b(0xc8)]('');}if(_0x548329[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)])for(const _0x57d1ef of _0x548329){const _0x55d33c=_0x57d1ef[_0x3c5a7b(0xb9)]?_0x57d1ef['folderPath']+'/'+_0x57d1ef[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)]:_0x57d1ef[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)],_0x760d1e=_0x57d1ef[_0x3c5a7b(0xa9)][_0x3c5a7b(0x147)]?.[_0x3c5a7b(0x146)]||0x0,_0x35b8cc=_0x760d1e>0x0?a38_0x4e5aba[_0x3c5a7b(0x142)]('\x20['+_0x760d1e+'\x20activations]'):'';console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0x10c)]('New\x20segment:')+'\x20'+_0x55d33c+_0x35b8cc),console[_0x3c5a7b(0xc8)]('─'['repeat'](0x3c)),_0x57d1ef[_0x3c5a7b(0x111)]&&console['error'](_0x57d1ef['diff']),console['error']('─'['repeat'](0x3c));}if(_0x5ce1cb[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)])for(const _0x5cb1f0 of _0x5ce1cb){const _0xa3674e=_0x5cb1f0[_0x3c5a7b(0xce)]?_0x1ffb9d[_0x3c5a7b(0x11c)](_0x5cb1f0[_0x3c5a7b(0xce)][_0x3c5a7b(0xca)]())||'':'',_0x3d9327=_0xa3674e?_0xa3674e+'/'+_0x5cb1f0[_0x3c5a7b(0xdf)]:_0x5cb1f0['name'],_0x2711d2=_0x264316[_0x3c5a7b(0x11c)](_0x5cb1f0['id'])||[],_0x1c7f21=_0x2711d2['length']>0x0?a38_0x4e5aba[_0x3c5a7b(0x142)]('\x20['+_0x2711d2['length']+_0x3c5a7b(0xc3)):'';console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0xb2))+'\x20'+_0x3d9327+_0x1c7f21),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c));const _0x231636=segmentWithActivationsToYaml(_0x5cb1f0,_0x2711d2,undefined,_0x116f92,_0x5f0336),_0x218ba2=segmentToYamlString(_0x231636),_0x2b49ed=generateDiff(_0x218ba2,'');console['error'](formatDiffWithColors(_0x2b49ed)),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c));}const _0x26b026=_0x5dbe71[_0x3c5a7b(0x124)](_0x27ca46=>!_0x27ca46['isNew']&&_0x27ca46[_0x3c5a7b(0x111)]);if(_0x26b026[_0x3c5a7b(0x146)]>0x0&&!_0x52f448['journeysOnly'])for(const _0x1e8484 of _0x26b026){const _0xce8a7a=_0x1e8484[_0x3c5a7b(0xb9)]?_0x1e8484[_0x3c5a7b(0xb9)]+'/'+_0x1e8484['yamlConfig'][_0x3c5a7b(0xdf)]:_0x1e8484['yamlConfig']['name'];console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0xd2))+'\x20'+_0xce8a7a),console['error']('─'['repeat'](0x3c)),console[_0x3c5a7b(0xc8)](_0x1e8484[_0x3c5a7b(0x111)]),console[_0x3c5a7b(0xc8)]('─'['repeat'](0x3c));}if(_0x30a19a[_0x3c5a7b(0x146)]>0x0)for(const _0x41b44d of _0x30a19a){const _0x49a774=_0x41b44d[_0x3c5a7b(0xb9)]?_0x41b44d[_0x3c5a7b(0xb9)]+'/'+_0x41b44d[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)]:_0x41b44d[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)];console['error']('\x0a'+a38_0x4e5aba[_0x3c5a7b(0x10c)](_0x3c5a7b(0x115))+'\x20'+_0x49a774),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c)),_0x41b44d[_0x3c5a7b(0x111)]&&console[_0x3c5a7b(0xc8)](_0x41b44d[_0x3c5a7b(0x111)]),console[_0x3c5a7b(0xc8)]('─'['repeat'](0x3c));}const _0x42ce37=_0x4e6ea6[_0x3c5a7b(0x124)](_0x21557a=>!_0x21557a[_0x3c5a7b(0x130)]&&_0x21557a[_0x3c5a7b(0x111)]);if(_0x42ce37[_0x3c5a7b(0x146)]>0x0)for(const _0x181be5 of _0x42ce37){const _0x43aed7=_0x181be5[_0x3c5a7b(0xb9)]?_0x181be5['folderPath']+'/'+_0x181be5[_0x3c5a7b(0xa9)]['name']:_0x181be5[_0x3c5a7b(0xa9)][_0x3c5a7b(0xdf)];console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xe9)](_0x3c5a7b(0x129))+'\x20'+_0x43aed7),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c)),console[_0x3c5a7b(0xc8)](_0x181be5[_0x3c5a7b(0x111)]),console[_0x3c5a7b(0xc8)]('─'[_0x3c5a7b(0xf4)](0x3c));}if(_0x41325b['length']>0x0)for(const _0x429c8a of _0x41325b){const _0x5002ec=_0x429c8a[_0x3c5a7b(0xf3)]?_0x1ffb9d[_0x3c5a7b(0x11c)](_0x429c8a[_0x3c5a7b(0xf3)])||'':'',_0x109662=_0x5002ec?_0x5002ec+'/'+_0x429c8a['journeyBundleName']:_0x429c8a[_0x3c5a7b(0xbc)];console[_0x3c5a7b(0xc8)]('\x0a'+a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0x140))+'\x20'+_0x109662),console['error']('─'[_0x3c5a7b(0xf4)](0x3c)),console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)](_0x3c5a7b(0xae))),console[_0x3c5a7b(0xc8)]('─'['repeat'](0x3c));}if(_0x52f448[_0x3c5a7b(0x102)])return console['error'](a38_0x4e5aba[_0x3c5a7b(0xe9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4c8329=_0x52f448[_0x3c5a7b(0x113)]?![]:_0x548329['length']>0x0||_0x42fc49[_0x3c5a7b(0x146)]>0x0||_0x5ce1cb[_0x3c5a7b(0x146)]>0x0,_0x283edb=_0x30a19a[_0x3c5a7b(0x146)]>0x0||_0x3ac9af[_0x3c5a7b(0x146)]>0x0||_0x41325b[_0x3c5a7b(0x146)]>0x0,_0x59b218=_0x52f448[_0x3c5a7b(0x113)]?![]:_0x48ad7d['length']>0x0,_0x1fe1b7=_0x3e4467['length']>0x0;if(!_0x4c8329&&!_0x283edb&&!_0x59b218&&!_0x1fe1b7){const _0x6bce9e=_0x52f448['journeysOnly']?_0x3c5a7b(0x13c):_0x3c5a7b(0x101);console['error'](a38_0x4e5aba[_0x3c5a7b(0x10c)](_0x6bce9e));if(_0x476586&&_0x12fc4d[_0x3c5a7b(0x146)]===0x1){const _0x15857a=_0x12fc4d[0x0];if(_0x15857a[_0x3c5a7b(0x136)]?.['id']){const _0x12f8f7=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+_0x3c5a7b(0xb1)+_0x15857a[_0x3c5a7b(0x136)]['id']+_0x3c5a7b(0xe1));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xb8)+a38_0x4e5aba['cyan'](_0x12f8f7));}}if(_0x476586&&_0x49669e['length']===0x1){const _0x471786=_0x49669e[0x0];if(_0x471786[_0x3c5a7b(0xea)]?.['id']){const _0x39faf7=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+_0x3c5a7b(0xb1)+_0x471786['existingJourney']['id']+_0x3c5a7b(0xfb));console[_0x3c5a7b(0xc8)]('\x20\x20'+a38_0x4e5aba['cyan'](_0x39faf7));}}return 0x0;}const _0x166522=_0x52f448[_0x3c5a7b(0x113)]?_0x30a19a[_0x3c5a7b(0x146)]+_0x3ac9af[_0x3c5a7b(0x146)]+_0x41325b[_0x3c5a7b(0x146)]+_0x3e4467['length']:_0x548329['length']+_0x42fc49[_0x3c5a7b(0x146)]+_0x5ce1cb[_0x3c5a7b(0x146)]+_0x30a19a['length']+_0x3ac9af[_0x3c5a7b(0x146)]+_0x41325b['length']+_0x3e4467[_0x3c5a7b(0x146)]+_0x48ad7d[_0x3c5a7b(0x146)];if(!_0x52f448[_0x3c5a7b(0x121)]&&_0x166522>0x0){if(!isInteractive())return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)]('\x0aError:'),_0x3c5a7b(0x112)),console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0x142)](_0x3c5a7b(0x133))),0x1;const _0x454ccf=await confirmKey(_0x3c5a7b(0xb0)+_0x166522+_0x3c5a7b(0x139));if(!_0x454ccf)return console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)]('Aborted.')),0x1;}const _0x26d29d={'withProgress':async(_0x40a06c,_0x37bd72)=>{const _0xbd7340=_0x3c5a7b,_0x8fe8da=await withSpinner(_0x40a06c,_0x37bd72,{'verbose':_0x52f448[_0xbd7340(0xde)]});return{'data':_0x8fe8da[_0xbd7340(0xc1)]};},'logInfo':_0x1271e4=>console['error'](a38_0x4e5aba[_0x3c5a7b(0xc5)]('βœ”\x20'+_0x1271e4)),'logSuccess':_0x558eb1=>console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0x10c)]('βœ”\x20'+_0x558eb1)),'logWarning':_0x356c69=>console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xe9)]('⚠\x20'+_0x356c69)),'logDeleted':_0x57bc82=>console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0xcc)]('βœ”\x20'+_0x57bc82))},_0x4fe8d7={'segment':_0x116ea1[_0x3c5a7b(0xba)],'journey':_0x116ea1['journey'],'user':_0x116ea1[_0x3c5a7b(0x12d)],'connection':_0x116ea1[_0x3c5a7b(0x144)]};_0x3e4467[_0x3c5a7b(0x146)]>0x0&&(_0x5b7fdd=await executePushFolders(_0x4fe8d7,_0x3e4467,_0x5b7fdd,{'parentId':_0x491c87},_0x26d29d));const _0x15b2ee={'rootFolderId':_0x5b8603,'folderPathToId':_0x5b7fdd,'folderIdToPath':_0x1ffb9d,'segmentNameToId':_0x3fd0ca,'activationsBySegmentId':_0x264316,'emailToIdMap':_0x13a137,'idToEmailMap':_0x116f92,'connectionNameToIdMap':_0x5c42ee['nameToId'],'connectionIdToNameMap':_0x5c42ee[_0x3c5a7b(0xdd)],'connectionNameToTypeMap':_0x9d4b3b},_0x2f6748=await executePushSegments(_0x4fe8d7,_0x52f448[_0x3c5a7b(0x113)]?[]:_0x5dbe71,_0x15b2ee,{'parentId':_0x491c87},_0x26d29d),_0x79f4f1=_0x2f6748[_0x3c5a7b(0x134)],_0x6948f6=_0x2f6748['updated'],_0x172d92=_0x2f6748[_0x3c5a7b(0x147)]['created'],_0x347570=_0x2f6748[_0x3c5a7b(0x147)][_0x3c5a7b(0xda)],_0x4ac78b=_0x2f6748[_0x3c5a7b(0x147)]['deleted'];let _0x49055f;if(_0x476586&&_0x5dbe71[_0x3c5a7b(0x146)]===0x1){const _0xf62acc=_0x5dbe71[0x0];_0x49055f=_0xf62acc[_0x3c5a7b(0x136)]?.['id']??_0x2f6748[_0x3c5a7b(0xe8)][_0x3c5a7b(0x11c)](_0xf62acc['yamlConfig']['name']);}const _0x5959e8=await executePushSegmentDeletions(_0x4fe8d7,_0x52f448['journeysOnly']?[]:_0x5ce1cb,_0x26d29d);let _0x4437a8=0x0,_0x47af50=0x0,_0x59c7e0=0x0;const _0x3cf6e5=new Map(_0x3fd0ca);for(const [_0x33e3b7,_0x4577ec]of _0x2f6748[_0x3c5a7b(0xe8)]){_0x3cf6e5[_0x3c5a7b(0xd1)](_0x33e3b7,_0x4577ec);}if(_0x4e6ea6[_0x3c5a7b(0x146)]>0x0){const _0x560d2d={..._0x15b2ee,'segmentNameToId':_0x3cf6e5,'existingSegments':_0xf51a17,'activationContext':_0x47459f},_0x43c816=await executePushJourneys(_0x4fe8d7,_0x4e6ea6,_0x560d2d,{'parentId':_0x491c87,'rootFolderId':_0x5b8603,'verbose':_0x52f448[_0x3c5a7b(0xde)]},_0x26d29d);_0x4437a8=_0x43c816['created'],_0x47af50=_0x43c816['updated'];if(_0x476586&&_0x43c816[_0x3c5a7b(0x131)]['length']===0x1){const _0x277fe4=_0x43c816[_0x3c5a7b(0x131)][0x0];if(_0x277fe4[_0x3c5a7b(0x12c)]){const _0x93fb2b=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+_0x3c5a7b(0xb1)+_0x277fe4[_0x3c5a7b(0x12c)]+_0x3c5a7b(0xfb));console[_0x3c5a7b(0xc8)]('\x20\x20'+a38_0x4e5aba[_0x3c5a7b(0xf0)](_0x93fb2b));}}}for(const _0x14fc59 of _0x41325b){console[_0x3c5a7b(0xc8)](a38_0x4e5aba['yellow'](_0x3c5a7b(0xab)+_0x14fc59['journeyBundleName'])),_0x59c7e0++;}const _0x14bc9f=[];if(_0x79f4f1>0x0)_0x14bc9f[_0x3c5a7b(0x128)](_0x79f4f1+_0x3c5a7b(0x11b));if(_0x6948f6>0x0)_0x14bc9f[_0x3c5a7b(0x128)](_0x6948f6+_0x3c5a7b(0x119));if(_0x5959e8>0x0)_0x14bc9f[_0x3c5a7b(0x128)](_0x5959e8+_0x3c5a7b(0xd4));const _0x4ca3df=[];if(_0x4437a8>0x0)_0x4ca3df[_0x3c5a7b(0x128)](_0x4437a8+_0x3c5a7b(0x11b));if(_0x47af50>0x0)_0x4ca3df[_0x3c5a7b(0x128)](_0x47af50+_0x3c5a7b(0x119));if(_0x59c7e0>0x0)_0x4ca3df['push'](_0x59c7e0+_0x3c5a7b(0xd4));const _0x375941=[];if(_0x172d92>0x0)_0x375941[_0x3c5a7b(0x128)](_0x172d92+_0x3c5a7b(0x11b));if(_0x347570>0x0)_0x375941[_0x3c5a7b(0x128)](_0x347570+_0x3c5a7b(0x119));if(_0x4ac78b>0x0)_0x375941[_0x3c5a7b(0x128)](_0x4ac78b+_0x3c5a7b(0xd4));console[_0x3c5a7b(0xc8)](a38_0x4e5aba[_0x3c5a7b(0x10c)]('\x0aβœ”\x20Push\x20complete'));_0x14bc9f[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)]&&console['error'](_0x3c5a7b(0x126)+_0x14bc9f[_0x3c5a7b(0xf5)](',\x20'));_0x4ca3df['length']>0x0&&console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xdc)+_0x4ca3df[_0x3c5a7b(0xf5)](',\x20'));_0x375941[_0x3c5a7b(0x146)]>0x0&&!_0x52f448[_0x3c5a7b(0x113)]&&console[_0x3c5a7b(0xc8)]('\x20\x20Activations:\x20'+_0x375941[_0x3c5a7b(0xf5)](',\x20'));if(_0x49055f){const _0x4a212e=getConsoleNextUrl(_0x52f448[_0x3c5a7b(0x10b)],_0x3c5a7b(0xfc)+_0x491c87+'/e/'+_0x49055f+_0x3c5a7b(0xe1));console[_0x3c5a7b(0xc8)](_0x3c5a7b(0xb8)+a38_0x4e5aba['cyan'](_0x4a212e));}return 0x0;}}
1
+ const a38_0x3ff60a=a38_0x10fb;(function(_0x261628,_0x27a70e){const _0x1080b4=a38_0x10fb,_0x28c38a=_0x261628();while(!![]){try{const _0x229616=parseInt(_0x1080b4(0x156))/0x1*(parseInt(_0x1080b4(0x11c))/0x2)+parseInt(_0x1080b4(0x12e))/0x3*(-parseInt(_0x1080b4(0x14e))/0x4)+-parseInt(_0x1080b4(0xfa))/0x5+parseInt(_0x1080b4(0x161))/0x6*(-parseInt(_0x1080b4(0xcc))/0x7)+-parseInt(_0x1080b4(0x108))/0x8+-parseInt(_0x1080b4(0x103))/0x9*(parseInt(_0x1080b4(0x13d))/0xa)+-parseInt(_0x1080b4(0x145))/0xb*(-parseInt(_0x1080b4(0xd2))/0xc);if(_0x229616===_0x27a70e)break;else _0x28c38a['push'](_0x28c38a['shift']());}catch(_0x485c06){_0x28c38a['push'](_0x28c38a['shift']());}}}(a38_0x155b,0x3f93f));function a38_0x155b(){const _0x4ef754=['452688YyahPu','errorCode','Folders\x20to\x20create:','repeat','activations','\x20\x20Source:\x20','segment','execute','yellow','cyan','set','2618898jIsdCX','targetDir','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','nameToId','existingSegment','unchanged','createdSegmentIds','\x0aError:','\x20activations]','/app/ps/','new','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)','\x20folders\x20to\x20create','7zycwDw','\x0aPush\x20summary\x20for\x20\x27','journey','name','getParent','filter','16401684FdQcpi','Preparing\x20journeys...','type','createdAt','all','\x20\x20πŸ“Š\x20Segments:','folders','/sb/da/esr','\x20\x20Journeys:\x20','state','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','folderId','join','diff','buildUserMaps','length','listFolders','parentName','list','.yaml','journeys','listSegments','isNew','Site:\x20','Delete\x20segment:','updatedAt','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','New\x20segment:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeyId','data','Changes\x20to:','map','No\x20','listJourneysWithDetailsFromParentSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','/e/','delete','\x20\x20Activations:\x20','user','2008020DAarOo','Scoped\x20to\x20folder:\x20','paused','changed','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x27...','updated','idToName','Changes\x20to\x20journey:','9yskVPe','\x20\x20Activations:','created','\x20updated','Aborted.','2150648vfBDVJ','toCreate','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','πŸ“\x20','listActivations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeysOnly','\x0aValidation\x20failed:','red','message','then','site','.yml','description','helpText','parentFolder','toDelete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20new','segmentFolderId','2sNYeRV','existingJourney','\x20\x20Segments:\x20','\x20changed','add','\x20deleted','/j/da/je','get','blue','verbose','getOutputSchemaWithCache','parentSegment','relationships','\x20to\x20create','resolveParentId','\x20created','Error:\x20Directory\x20not\x20found:\x20','Parent\x20segment:\x20','29733HaLKyT','\x20\x20\x20\x20','endsWith','\x20changes?','getJourney','error','push','\x20unchanged','Source\x20directory:\x20','deleted','New\x20journey:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','no_parent','segments','segment\x20or\x20journey','1052770UleGLq','\x20YAML\x20files\x20found','toUpdate','green','\x20to\x20update','parent_name','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Fetching\x20existing\x20activations...','11lBfaHT','Delete\x20journey:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Resolving\x20parent\x20segment\x20\x27','folderPath','nameToType','journeyBundleName','results','\x20to\x20delete','140WDrLEA','setPhase','Fetching\x20existing\x20data...','connection','yamlConfig','dim','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','attributes'];a38_0x155b=function(){return _0x4ef754;};return a38_0x155b();}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 a38_0x18ff23 from'chalk';function a38_0x10fb(_0x3b1678,_0x29bb18){_0x3b1678=_0x3b1678-0xc7;const _0x155b23=a38_0x155b();let _0x10fb80=_0x155b23[_0x3b1678];return _0x10fb80;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a38_0x3ff60a(0xcf)]='segment:push';[a38_0x3ff60a(0x115)]=a38_0x3ff60a(0xfe);async[a38_0x3ff60a(0x15d)](_0x263c51){const _0xea7e5=a38_0x3ff60a,{options:_0x266d18,args:_0x492d29,tdx:_0x5231f5}=_0x263c51,_0x450e79=_0x266d18,_0x42eeb4=await resolveTarget({'arg':_0x492d29[0x0],'contextParent':_0x266d18[_0xea7e5(0x127)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x42eeb4))return _0x42eeb4[_0xea7e5(0x157)]===_0xea7e5(0x13a)?(console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x15e)](_0xea7e5(0xdc))),console[_0xea7e5(0x133)](_0xea7e5(0xca)),console['error'](_0xea7e5(0x147)),console[_0xea7e5(0x133)](_0xea7e5(0xf5))):(console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x110)]('Error:\x20'+_0x42eeb4[_0xea7e5(0x111)]+'\x0a')),_0x42eeb4[_0xea7e5(0x116)]&&console['error'](a38_0x18ff23[_0xea7e5(0x15f)](_0x42eeb4[_0xea7e5(0x116)]))),0x1;if(_0x42eeb4[_0xea7e5(0xd4)]===_0xea7e5(0x142))return console[_0xea7e5(0x133)](a38_0x18ff23['red'](_0xea7e5(0x12c)+_0x42eeb4[_0xea7e5(0x162)]+'\x0a')),console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x15f)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x40ecfe=_0x42eeb4[_0xea7e5(0xe3)],_0x2b2ab0=_0x42eeb4[_0xea7e5(0x162)],_0x482f0d=_0x42eeb4['type']==='file'?_0x42eeb4['filePath']:undefined,_0x2c7b88=getScopedDetails(_0x42eeb4),_0x434a0e=_0x2c7b88?.['isScoped']??![],_0x518929=_0x2c7b88?.['scopedFolderPath']??'';if(!existsSync(_0x2b2ab0))return console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x110)](_0xea7e5(0x12c)+_0x2b2ab0+'\x0a')),console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x15f)](_0xea7e5(0x163))),0x1;_0x450e79[_0xea7e5(0x125)]&&(console[_0xea7e5(0x133)](_0xea7e5(0xe9)+_0x450e79[_0xea7e5(0x113)]),console['error'](_0xea7e5(0x12d)+_0x40ecfe),console['error'](_0xea7e5(0x136)+_0x2b2ab0),_0x434a0e&&console[_0xea7e5(0x133)](_0xea7e5(0xfb)+_0x518929));const _0x592683=await withSpinner(_0xea7e5(0x148)+_0x40ecfe+_0xea7e5(0xff),()=>_0x5231f5[_0xea7e5(0x15c)][_0xea7e5(0x12a)](_0x40ecfe),{'verbose':_0x450e79[_0xea7e5(0x125)]}),_0x6da74=_0x592683[_0xea7e5(0xf0)],{parentSegmentResult:_0x476513,segmentsResult:_0x96a066,foldersResult:_0x2e764b,journeysWithDetailsResult:_0x100079,userMaps:_0x1f4e33}=await withSpinner(_0xea7e5(0x150),async()=>{const _0x226846=_0xea7e5,[_0x3467d4,_0x18e231,_0x4a820b,_0x6c712a,_0x4df3e7]=await Promise[_0x226846(0xd6)]([_0x5231f5[_0x226846(0x15c)][_0x226846(0xd0)](_0x6da74),_0x5231f5[_0x226846(0x15c)][_0x226846(0xe7)](_0x6da74),_0x5231f5[_0x226846(0x15c)][_0x226846(0xe2)](_0x6da74),_0x5231f5[_0x226846(0xce)][_0x226846(0xf4)](_0x6da74,{'includeAllVersions':!![]}),_0x5231f5[_0x226846(0xf9)][_0x226846(0xe0)]()]);return{'parentSegmentResult':_0x3467d4,'segmentsResult':_0x18e231,'foldersResult':_0x4a820b,'journeysWithDetailsResult':_0x6c712a,'userMaps':_0x4df3e7};},{'verbose':_0x450e79['verbose']})[_0xea7e5(0x112)](_0x5ba3f3=>_0x5ba3f3[_0xea7e5(0xf0)]),_0x141b26=_0x476513,_0x464e59=extractRootFolderId(_0x141b26),_0x457c12=_0x96a066,_0x5eb56a=_0x2e764b,{journeys:_0x2e0c36,activationStepsById:_0x5f3a46}=_0x100079,_0x4d5956=new Map(_0x2e0c36[_0xea7e5(0xf2)](_0x2eb21a=>[_0x2eb21a['id'],_0x2eb21a])),_0x3419b0=_0x2e0c36['map'](_0x1ca8bf=>({'id':_0x1ca8bf['id'],'name':_0x1ca8bf[_0xea7e5(0x155)]['name'],'journeyBundleName':_0x1ca8bf[_0xea7e5(0x155)][_0xea7e5(0x14b)]||'','journeyBundleId':_0x1ca8bf[_0xea7e5(0x155)]['journeyBundleId']||'','versionNumber':_0x1ca8bf[_0xea7e5(0x155)]['versionNumber'],'description':_0x1ca8bf[_0xea7e5(0x155)][_0xea7e5(0x115)],'state':_0x1ca8bf[_0xea7e5(0x155)][_0xea7e5(0xdb)],'paused':_0x1ca8bf['attributes'][_0xea7e5(0xfc)],'audienceId':_0x1ca8bf[_0xea7e5(0x155)]['audienceId'],'folderId':_0x1ca8bf[_0xea7e5(0x128)]?.[_0xea7e5(0x117)]?.[_0xea7e5(0xf0)]?.['id'],'createdAt':_0x1ca8bf[_0xea7e5(0x155)][_0xea7e5(0xd5)],'updatedAt':_0x1ca8bf[_0xea7e5(0x155)][_0xea7e5(0xeb)]})),{emailToId:_0x3be15b,idToEmail:_0x53e0af}=_0x1f4e33,_0x3a3934=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x24921b=_0xea7e5,_0x3ac7ed=await _0x5231f5['connection'][_0x24921b(0xe4)]();return buildConnectionMaps(_0x3ac7ed);},{'verbose':_0x450e79[_0xea7e5(0x125)]})[_0xea7e5(0x112)](_0x12d5f7=>_0x12d5f7[_0xea7e5(0xf0)]),_0x2fbf94=_0x3a3934[_0xea7e5(0x165)],_0xcb6855=_0x3a3934[_0xea7e5(0x101)],_0x5eaa55=_0x3a3934[_0xea7e5(0x14a)],_0x163215={'emailToIdMap':_0x3be15b,'connectionNameToIdMap':_0x2fbf94,'connectionNameToTypeMap':_0x5eaa55,'getSchema':_0x3d5d9c=>_0x5231f5[_0xea7e5(0x151)][_0xea7e5(0x126)](_0x3d5d9c)};let {pathToId:_0x3c3106,idToPath:_0x1bf909}=buildFolderMaps(_0x5eb56a);const _0x581c7b=buildSegmentLookupMap(_0x457c12,_0x1bf909),_0xcc39eb=buildSegmentNameToIdMap(_0x457c12),_0x3fd341=buildJourneyBundleLookupMap(_0x3419b0,_0x1bf909);let _0x51962a;if(_0x482f0d){if(!_0x482f0d[_0xea7e5(0x130)](_0xea7e5(0x114))&&!_0x482f0d[_0xea7e5(0x130)](_0xea7e5(0xe5)))return console[_0xea7e5(0x133)](a38_0x18ff23['red'](_0xea7e5(0x119)+_0x482f0d+'\x0a')),0x1;_0x51962a=[_0x482f0d];}else _0x51962a=findYamlFiles(_0x2b2ab0);if(_0x51962a['length']===0x0)return console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x110)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x2b2ab0+'\x0a')),console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x15f)](_0xea7e5(0x143))),0x1;let _0x5ad5b1,_0x2a517d;try{const _0xedfec7=parseAndClassifyYamlFiles(_0x51962a,_0x2b2ab0,{'skipSegments':_0x450e79[_0xea7e5(0x10e)]});_0x5ad5b1=_0xedfec7['segments'],_0x2a517d=_0xedfec7[_0xea7e5(0xe6)];const _0x5b725e=validateParsedFiles(_0xedfec7,_0x2b2ab0);if(_0x5b725e[_0xea7e5(0xe1)]>0x0)return console['error'](a38_0x18ff23[_0xea7e5(0x110)](_0xea7e5(0x10f))),console[_0xea7e5(0x133)](formatValidationErrors(_0x5b725e)),console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x15e)](_0xea7e5(0xee))),0x1;}catch(_0x449a60){return console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x110)]('Error\x20parsing\x20YAML:\x20'+(_0x449a60 instanceof Error?_0x449a60[_0xea7e5(0x111)]:_0x449a60))),0x1;}if(_0x5ad5b1[_0xea7e5(0xe1)]===0x0&&_0x2a517d['length']===0x0){const _0x4ebd15=_0x450e79[_0xea7e5(0x10e)]?_0xea7e5(0xce):_0xea7e5(0x13c);return console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x15e)](_0xea7e5(0xf3)+_0x4ebd15+_0xea7e5(0x13e))),0x0;}const _0x3defce=new Map();_0x457c12[_0xea7e5(0xe1)]>0x0&&!_0x450e79[_0xea7e5(0x10e)]&&await withSpinner(_0xea7e5(0x144),async()=>{await batchAsync(_0x457c12,async _0x10dd29=>{const _0x537304=a38_0x10fb,_0x8881a4=await _0x5231f5[_0x537304(0x15c)][_0x537304(0x10c)](_0x6da74,_0x10dd29['id']);_0x3defce[_0x537304(0x160)](_0x10dd29['id'],_0x8881a4);});},{'verbose':_0x450e79[_0xea7e5(0x125)]});const {segmentFiles:_0x4759d7,foldersToCreate:_0x4db1a8}=await prepareSegmentFiles(_0x5ad5b1,{'segmentByFolderAndName':_0x581c7b,'activationsBySegmentId':_0x3defce,'folderPathToId':_0x3c3106,'idToEmailMap':_0x53e0af,'connectionIdToNameMap':_0xcb6855},_0x163215,_0x434a0e,_0x518929),_0x1d7968=_0x482f0d?[]:findSegmentsToDelete(_0x457c12,_0x5ad5b1[_0xea7e5(0xf2)](({yamlConfig:_0x50c2c1,folderPath:_0x10f398})=>({'yamlConfig':_0x50c2c1,'folderPath':resolveTDFolderPath(_0x10f398,_0x434a0e,_0x518929)})),_0x1bf909,_0x518929,_0x434a0e),{journeyFiles:_0x2ff439,foldersToCreate:_0x56e524}=await withProgressSpinner(_0xea7e5(0xd3),async _0x4a76ef=>prepareJourneyFiles(_0x2a517d,{'fetchJourney':async _0x386305=>_0x5231f5[_0xea7e5(0xce)][_0xea7e5(0x132)](_0x386305['journeyId']),'journeyBundlesByFolderAndName':_0x3fd341,'folderPathToId':_0x3c3106,'idToEmailMap':_0x53e0af,'connectionIdToNameMap':_0xcb6855,'existingSegments':_0x457c12,'parentId':_0x6da74,'deps':_0x5231f5,'progress':{'update':_0x4ac17e=>{const _0x2e9fd0=_0xea7e5;_0x4a76ef[_0x2e9fd0(0x14f)](_0x4ac17e),_0x450e79['verbose']&&console['error']('\x20\x20'+_0x4ac17e);}},'journeyById':_0x4d5956,'activationStepsById':_0x5f3a46},_0x434a0e,_0x518929),{'verbose':_0x450e79['verbose']})[_0xea7e5(0x112)](_0x20c019=>_0x20c019[_0xea7e5(0xf0)]);for(const _0x4978cc of _0x56e524){_0x4db1a8[_0xea7e5(0x120)](_0x4978cc);}const _0x37894d=_0x482f0d?[]:findJourneysToDelete(_0x3419b0,_0x2a517d[_0xea7e5(0xf2)](({yamlConfig:_0x39bc79,folderPath:_0x1ef5fa})=>({'yamlConfig':_0x39bc79,'folderPath':resolveTDFolderPath(_0x1ef5fa,_0x434a0e,_0x518929)})),_0x1bf909,_0x518929,_0x434a0e),_0x318853=calculatePushStats(_0x4759d7,_0x2ff439,_0x4db1a8,_0x1d7968,_0x37894d,!!_0x450e79[_0xea7e5(0xf7)],!!_0x450e79[_0xea7e5(0x10e)]),_0x464cd1=_0x318853[_0xea7e5(0x13b)][_0xea7e5(0xc9)],_0x20cd36=_0x318853['segments']['changed'],_0x38e79c=_0x318853['segments'][_0xea7e5(0x167)],_0x3b9739=_0x318853[_0xea7e5(0x13b)][_0xea7e5(0x118)],_0x36b151=_0x318853[_0xea7e5(0xd8)][_0xea7e5(0x109)],_0x26ca8=_0x318853[_0xea7e5(0xe6)][_0xea7e5(0xc9)],_0x23e370=_0x318853[_0xea7e5(0xe6)][_0xea7e5(0xfd)],_0x220df2=_0x318853[_0xea7e5(0xe6)][_0xea7e5(0x167)],_0x31663a=_0x318853[_0xea7e5(0xe6)][_0xea7e5(0x118)],_0x36e42b=_0x318853[_0xea7e5(0x15a)]['all'],_0x5d2191=_0x318853[_0xea7e5(0x15a)]['toCreate'],_0x4c95ce=_0x318853['activations'][_0xea7e5(0x13f)],_0x499839=_0x318853['activations'][_0xea7e5(0x118)];console[_0xea7e5(0x133)](_0xea7e5(0xcd)+_0x40ecfe+'\x27:');_0x36b151[_0xea7e5(0xe1)]>0x0&&console['error']('\x20\x20'+a38_0x18ff23['blue'](_0xea7e5(0x10b)+_0x36b151[_0xea7e5(0xe1)]+_0xea7e5(0xcb)));if(!_0x450e79[_0xea7e5(0x10e)]){console[_0xea7e5(0x133)](_0xea7e5(0xd7)),console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x140)]('+\x20'+_0x464cd1[_0xea7e5(0xe1)]+_0xea7e5(0x11a))),console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x15e)]('~\x20'+_0x20cd36[_0xea7e5(0xe1)]+_0xea7e5(0x11f)));if(_0x3b9739[_0xea7e5(0xe1)]>0x0)console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x110)]('-\x20'+_0x3b9739[_0xea7e5(0xe1)]+_0xea7e5(0x14d)));else _0x1d7968[_0xea7e5(0xe1)]>0x0&&!_0x450e79[_0xea7e5(0xf7)]&&console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x153)](_0x1d7968[_0xea7e5(0xe1)]+_0xea7e5(0x164)));console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23['dim']('=\x20'+_0x38e79c[_0xea7e5(0xe1)]+_0xea7e5(0x135)));}if(_0x2ff439['length']>0x0||_0x37894d[_0xea7e5(0xe1)]>0x0){console[_0xea7e5(0x133)](_0xea7e5(0x154)),console[_0xea7e5(0x133)]('\x20\x20\x20\x20'+a38_0x18ff23['green']('+\x20'+_0x26ca8[_0xea7e5(0xe1)]+'\x20new')),console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x15e)]('~\x20'+_0x23e370[_0xea7e5(0xe1)]+'\x20changed'));if(_0x31663a['length']>0x0)console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x110)]('-\x20'+_0x31663a[_0xea7e5(0xe1)]+_0xea7e5(0x14d)));else _0x37894d[_0xea7e5(0xe1)]>0x0&&!_0x450e79[_0xea7e5(0xf7)]&&console['error'](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x153)](_0x37894d['length']+_0xea7e5(0x164)));console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x153)]('=\x20'+_0x220df2[_0xea7e5(0xe1)]+_0xea7e5(0x135)));}_0x36e42b[_0xea7e5(0xe1)]>0x0&&!_0x450e79['journeysOnly']&&(console[_0xea7e5(0x133)](''),console[_0xea7e5(0x133)](_0xea7e5(0x104)),_0x5d2191[_0xea7e5(0xe1)]>0x0&&console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x140)]('+\x20'+_0x5d2191['length']+_0xea7e5(0x129))),_0x4c95ce['length']>0x0&&console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23['yellow']('~\x20'+_0x4c95ce[_0xea7e5(0xe1)]+_0xea7e5(0x141))),_0x499839['length']>0x0&&console[_0xea7e5(0x133)](_0xea7e5(0x12f)+a38_0x18ff23[_0xea7e5(0x110)]('-\x20'+_0x499839[_0xea7e5(0xe1)]+_0xea7e5(0x14d))));console[_0xea7e5(0x133)](_0xea7e5(0x15b)+a38_0x18ff23[_0xea7e5(0x15f)](_0x2b2ab0)+'\x0a');if(_0x36b151[_0xea7e5(0xe1)]>0x0){console[_0xea7e5(0x133)](_0xea7e5(0x158));for(const _0x31bc3f of _0x36b151){console[_0xea7e5(0x133)]('\x20\x20'+a38_0x18ff23[_0xea7e5(0x124)]('+')+'\x20'+_0x31bc3f);}console[_0xea7e5(0x133)]('');}if(_0x464cd1[_0xea7e5(0xe1)]>0x0&&!_0x450e79['journeysOnly'])for(const _0x294c3f of _0x464cd1){const _0x591190=_0x294c3f[_0xea7e5(0x149)]?_0x294c3f['folderPath']+'/'+_0x294c3f[_0xea7e5(0x152)][_0xea7e5(0xcf)]:_0x294c3f[_0xea7e5(0x152)]['name'],_0x1d4551=_0x294c3f[_0xea7e5(0x152)][_0xea7e5(0x15a)]?.['length']||0x0,_0x59df3d=_0x1d4551>0x0?a38_0x18ff23[_0xea7e5(0x153)]('\x20['+_0x1d4551+_0xea7e5(0xc7)):'';console[_0xea7e5(0x133)]('\x0a'+a38_0x18ff23[_0xea7e5(0x140)](_0xea7e5(0xed))+'\x20'+_0x591190+_0x59df3d),console[_0xea7e5(0x133)]('─'[_0xea7e5(0x159)](0x3c)),_0x294c3f[_0xea7e5(0xdf)]&&console['error'](_0x294c3f[_0xea7e5(0xdf)]),console['error']('─'['repeat'](0x3c));}if(_0x3b9739['length']>0x0&&!_0x450e79[_0xea7e5(0x10e)])for(const _0x2f1244 of _0x3b9739){const _0x5e085d=_0x2f1244[_0xea7e5(0x11b)]?_0x1bf909[_0xea7e5(0x123)](_0x2f1244[_0xea7e5(0x11b)]['toString']())||'':'',_0x5ef47f=_0x5e085d?_0x5e085d+'/'+_0x2f1244[_0xea7e5(0xcf)]:_0x2f1244[_0xea7e5(0xcf)],_0x447b4a=_0x3defce[_0xea7e5(0x123)](_0x2f1244['id'])||[],_0x2bb5e7=_0x447b4a[_0xea7e5(0xe1)]>0x0?a38_0x18ff23[_0xea7e5(0x153)]('\x20['+_0x447b4a[_0xea7e5(0xe1)]+'\x20activations]'):'';console[_0xea7e5(0x133)]('\x0a'+a38_0x18ff23['red'](_0xea7e5(0xea))+'\x20'+_0x5ef47f+_0x2bb5e7),console[_0xea7e5(0x133)]('─'[_0xea7e5(0x159)](0x3c));const _0x3ecff3=segmentWithActivationsToYaml(_0x2f1244,_0x447b4a,undefined,_0x53e0af,_0xcb6855),_0x185b31=segmentToYamlString(_0x3ecff3),_0x41633a=generateDiff(_0x185b31,'');console['error'](formatDiffWithColors(_0x41633a)),console[_0xea7e5(0x133)]('─'['repeat'](0x3c));}const _0x23879b=_0x4759d7['filter'](_0xb67021=>!_0xb67021[_0xea7e5(0xe8)]&&_0xb67021['diff']);if(_0x23879b[_0xea7e5(0xe1)]>0x0&&!_0x450e79[_0xea7e5(0x10e)])for(const _0x2e1d39 of _0x23879b){const _0x445ba1=_0x2e1d39[_0xea7e5(0x149)]?_0x2e1d39[_0xea7e5(0x149)]+'/'+_0x2e1d39[_0xea7e5(0x152)][_0xea7e5(0xcf)]:_0x2e1d39[_0xea7e5(0x152)]['name'];console[_0xea7e5(0x133)]('\x0a'+a38_0x18ff23['yellow'](_0xea7e5(0xf1))+'\x20'+_0x445ba1),console[_0xea7e5(0x133)]('─'[_0xea7e5(0x159)](0x3c)),console[_0xea7e5(0x133)](_0x2e1d39[_0xea7e5(0xdf)]),console['error']('─'[_0xea7e5(0x159)](0x3c));}if(_0x26ca8[_0xea7e5(0xe1)]>0x0)for(const _0x42b162 of _0x26ca8){const _0x1f0f15=_0x42b162['folderPath']?_0x42b162['folderPath']+'/'+_0x42b162['yamlConfig'][_0xea7e5(0xcf)]:_0x42b162[_0xea7e5(0x152)]['name'];console[_0xea7e5(0x133)]('\x0a'+a38_0x18ff23[_0xea7e5(0x140)](_0xea7e5(0x138))+'\x20'+_0x1f0f15),console[_0xea7e5(0x133)]('─'[_0xea7e5(0x159)](0x3c)),_0x42b162[_0xea7e5(0xdf)]&&console[_0xea7e5(0x133)](_0x42b162[_0xea7e5(0xdf)]),console[_0xea7e5(0x133)]('─'[_0xea7e5(0x159)](0x3c));}const _0x343d99=_0x2ff439[_0xea7e5(0xd1)](_0x2f5215=>!_0x2f5215['isNew']&&_0x2f5215[_0xea7e5(0xdf)]);if(_0x343d99[_0xea7e5(0xe1)]>0x0)for(const _0x2d3fc6 of _0x343d99){const _0x5f5104=_0x2d3fc6[_0xea7e5(0x149)]?_0x2d3fc6[_0xea7e5(0x149)]+'/'+_0x2d3fc6[_0xea7e5(0x152)][_0xea7e5(0xcf)]:_0x2d3fc6[_0xea7e5(0x152)][_0xea7e5(0xcf)];console[_0xea7e5(0x133)]('\x0a'+a38_0x18ff23[_0xea7e5(0x15e)](_0xea7e5(0x102))+'\x20'+_0x5f5104),console[_0xea7e5(0x133)]('─'[_0xea7e5(0x159)](0x3c)),console[_0xea7e5(0x133)](_0x2d3fc6[_0xea7e5(0xdf)]),console[_0xea7e5(0x133)]('─'['repeat'](0x3c));}if(_0x31663a['length']>0x0)for(const _0x520f9a of _0x31663a){const _0x18e36d=_0x520f9a[_0xea7e5(0xdd)]?_0x1bf909['get'](_0x520f9a[_0xea7e5(0xdd)])||'':'',_0x16d0b7=_0x18e36d?_0x18e36d+'/'+_0x520f9a[_0xea7e5(0x14b)]:_0x520f9a[_0xea7e5(0x14b)];console[_0xea7e5(0x133)]('\x0a'+a38_0x18ff23['red'](_0xea7e5(0x146))+'\x20'+_0x16d0b7),console[_0xea7e5(0x133)]('─'[_0xea7e5(0x159)](0x3c)),console['error'](a38_0x18ff23[_0xea7e5(0x110)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0xea7e5(0x159)](0x3c));}if(_0x450e79['dryRun'])return console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x15e)](_0xea7e5(0xec))),0x0;const _0x3a2c68=_0x450e79[_0xea7e5(0x10e)]?![]:_0x464cd1[_0xea7e5(0xe1)]>0x0||_0x20cd36['length']>0x0||_0x3b9739[_0xea7e5(0xe1)]>0x0,_0x44e41f=_0x26ca8[_0xea7e5(0xe1)]>0x0||_0x23e370['length']>0x0||_0x31663a[_0xea7e5(0xe1)]>0x0,_0x33bedc=_0x450e79['journeysOnly']?![]:_0x36e42b[_0xea7e5(0xe1)]>0x0,_0x47030e=_0x36b151[_0xea7e5(0xe1)]>0x0;if(!_0x3a2c68&&!_0x44e41f&&!_0x33bedc&&!_0x47030e){const _0xf2ba34=_0x450e79[_0xea7e5(0x10e)]?_0xea7e5(0x10a):'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x140)](_0xf2ba34));if(_0x482f0d&&_0x38e79c[_0xea7e5(0xe1)]===0x1){const _0x2ce6d2=_0x38e79c[0x0];if(_0x2ce6d2[_0xea7e5(0x166)]?.['id']){const _0x33dbd5=getConsoleNextUrl(_0x450e79['site'],_0xea7e5(0xc8)+_0x6da74+_0xea7e5(0xf6)+_0x2ce6d2['existingSegment']['id']+_0xea7e5(0xd9));console[_0xea7e5(0x133)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a38_0x18ff23[_0xea7e5(0x15f)](_0x33dbd5));}}if(_0x482f0d&&_0x220df2['length']===0x1){const _0x232827=_0x220df2[0x0];if(_0x232827['existingJourney']?.['id']){const _0x4d1762=getConsoleNextUrl(_0x450e79[_0xea7e5(0x113)],'/app/ps/'+_0x6da74+_0xea7e5(0xf6)+_0x232827[_0xea7e5(0x11d)]['id']+_0xea7e5(0x122));console[_0xea7e5(0x133)]('\x20\x20'+a38_0x18ff23['cyan'](_0x4d1762));}}return 0x0;}const _0x130262=_0x450e79[_0xea7e5(0x10e)]?_0x26ca8[_0xea7e5(0xe1)]+_0x23e370[_0xea7e5(0xe1)]+_0x31663a[_0xea7e5(0xe1)]+_0x36b151[_0xea7e5(0xe1)]:_0x464cd1['length']+_0x20cd36['length']+_0x3b9739[_0xea7e5(0xe1)]+_0x26ca8[_0xea7e5(0xe1)]+_0x23e370['length']+_0x31663a[_0xea7e5(0xe1)]+_0x36b151[_0xea7e5(0xe1)]+_0x36e42b[_0xea7e5(0xe1)];if(!_0x450e79['yes']&&_0x130262>0x0){if(!isInteractive())return console['error'](a38_0x18ff23[_0xea7e5(0x110)](_0xea7e5(0x169)),_0xea7e5(0x10d)),console[_0xea7e5(0x133)](a38_0x18ff23['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5645f7=await confirmKey('Push\x20'+_0x130262+_0xea7e5(0x131));if(!_0x5645f7)return console[_0xea7e5(0x133)](a38_0x18ff23['yellow'](_0xea7e5(0x107))),0x1;}const _0x3e254c={'withProgress':async(_0x2544ca,_0x136968)=>{const _0x1c1828=_0xea7e5,_0x39754b=await withSpinner(_0x2544ca,_0x136968,{'verbose':_0x450e79[_0x1c1828(0x125)]});return{'data':_0x39754b[_0x1c1828(0xf0)]};},'logInfo':_0x47765b=>console['error'](a38_0x18ff23[_0xea7e5(0x124)]('βœ”\x20'+_0x47765b)),'logSuccess':_0x360093=>console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x140)]('βœ”\x20'+_0x360093)),'logWarning':_0x354272=>console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x15e)]('⚠\x20'+_0x354272)),'logDeleted':_0x4105a6=>console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x110)]('βœ”\x20'+_0x4105a6))},_0x11deb7={'segment':_0x5231f5[_0xea7e5(0x15c)],'journey':_0x5231f5[_0xea7e5(0xce)],'user':_0x5231f5[_0xea7e5(0xf9)],'connection':_0x5231f5[_0xea7e5(0x151)]};_0x36b151[_0xea7e5(0xe1)]>0x0&&(_0x3c3106=await executePushFolders(_0x11deb7,_0x36b151,_0x3c3106,{'parentId':_0x6da74},_0x3e254c));const _0x86baa1={'rootFolderId':_0x464e59,'folderPathToId':_0x3c3106,'folderIdToPath':_0x1bf909,'segmentNameToId':_0xcc39eb,'activationsBySegmentId':_0x3defce,'emailToIdMap':_0x3be15b,'idToEmailMap':_0x53e0af,'connectionNameToIdMap':_0x3a3934['nameToId'],'connectionIdToNameMap':_0x3a3934[_0xea7e5(0x101)],'connectionNameToTypeMap':_0x5eaa55},_0x5ec708=await executePushSegments(_0x11deb7,_0x450e79[_0xea7e5(0x10e)]?[]:_0x4759d7,_0x86baa1,{'parentId':_0x6da74},_0x3e254c),_0x55c6f8=_0x5ec708[_0xea7e5(0x105)],_0x2b2d09=_0x5ec708[_0xea7e5(0x100)],_0x1ceca1=_0x5ec708[_0xea7e5(0x15a)][_0xea7e5(0x105)],_0x3b4f84=_0x5ec708[_0xea7e5(0x15a)][_0xea7e5(0x100)],_0x52e173=_0x5ec708[_0xea7e5(0x15a)][_0xea7e5(0x137)];let _0x553d61;if(_0x482f0d&&_0x4759d7[_0xea7e5(0xe1)]===0x1){const _0x531164=_0x4759d7[0x0];_0x553d61=_0x531164[_0xea7e5(0x166)]?.['id']??_0x5ec708[_0xea7e5(0x168)][_0xea7e5(0x123)](_0x531164[_0xea7e5(0x152)][_0xea7e5(0xcf)]);}const _0x3ba44b=await executePushSegmentDeletions(_0x11deb7,_0x450e79[_0xea7e5(0x10e)]?[]:_0x3b9739,_0x3e254c);let _0x454681=0x0,_0x3ddbc7=0x0,_0x3337ca=0x0;const _0xf851c9=new Map(_0xcc39eb);for(const [_0x4f4d46,_0x398ae4]of _0x5ec708[_0xea7e5(0x168)]){_0xf851c9[_0xea7e5(0x160)](_0x4f4d46,_0x398ae4);}if(_0x2ff439['length']>0x0){const _0x53b252={..._0x86baa1,'segmentNameToId':_0xf851c9,'existingSegments':_0x457c12,'activationContext':_0x163215},_0x2e4c18=await executePushJourneys(_0x11deb7,_0x2ff439,_0x53b252,{'parentId':_0x6da74,'rootFolderId':_0x464e59,'verbose':_0x450e79[_0xea7e5(0x125)]},_0x3e254c);_0x454681=_0x2e4c18[_0xea7e5(0x105)],_0x3ddbc7=_0x2e4c18[_0xea7e5(0x100)];if(_0x482f0d&&_0x2e4c18[_0xea7e5(0x14c)][_0xea7e5(0xe1)]===0x1){const _0x758e5c=_0x2e4c18[_0xea7e5(0x14c)][0x0];if(_0x758e5c[_0xea7e5(0xef)]){const _0x176a8a=getConsoleNextUrl(_0x450e79['site'],_0xea7e5(0xc8)+_0x6da74+_0xea7e5(0xf6)+_0x758e5c[_0xea7e5(0xef)]+_0xea7e5(0x122));console['error']('\x20\x20'+a38_0x18ff23[_0xea7e5(0x15f)](_0x176a8a));}}}for(const _0x4f81f8 of _0x31663a){console[_0xea7e5(0x133)](a38_0x18ff23['yellow'](_0xea7e5(0x139)+_0x4f81f8[_0xea7e5(0x14b)])),_0x3337ca++;}const _0x3c4e89=[];if(_0x55c6f8>0x0)_0x3c4e89[_0xea7e5(0x134)](_0x55c6f8+_0xea7e5(0x12b));if(_0x2b2d09>0x0)_0x3c4e89[_0xea7e5(0x134)](_0x2b2d09+_0xea7e5(0x106));if(_0x3ba44b>0x0)_0x3c4e89[_0xea7e5(0x134)](_0x3ba44b+'\x20deleted');const _0x583e7f=[];if(_0x454681>0x0)_0x583e7f[_0xea7e5(0x134)](_0x454681+_0xea7e5(0x12b));if(_0x3ddbc7>0x0)_0x583e7f[_0xea7e5(0x134)](_0x3ddbc7+_0xea7e5(0x106));if(_0x3337ca>0x0)_0x583e7f[_0xea7e5(0x134)](_0x3337ca+_0xea7e5(0x121));const _0x1eae21=[];if(_0x1ceca1>0x0)_0x1eae21['push'](_0x1ceca1+'\x20created');if(_0x3b4f84>0x0)_0x1eae21[_0xea7e5(0x134)](_0x3b4f84+_0xea7e5(0x106));if(_0x52e173>0x0)_0x1eae21[_0xea7e5(0x134)](_0x52e173+_0xea7e5(0x121));console[_0xea7e5(0x133)](a38_0x18ff23[_0xea7e5(0x140)]('\x0aβœ”\x20Push\x20complete'));_0x3c4e89[_0xea7e5(0xe1)]>0x0&&!_0x450e79['journeysOnly']&&console[_0xea7e5(0x133)](_0xea7e5(0x11e)+_0x3c4e89[_0xea7e5(0xde)](',\x20'));_0x583e7f['length']>0x0&&console[_0xea7e5(0x133)](_0xea7e5(0xda)+_0x583e7f[_0xea7e5(0xde)](',\x20'));_0x1eae21[_0xea7e5(0xe1)]>0x0&&!_0x450e79[_0xea7e5(0x10e)]&&console[_0xea7e5(0x133)](_0xea7e5(0xf8)+_0x1eae21[_0xea7e5(0xde)](',\x20'));if(_0x553d61){const _0x3d44ad=getConsoleNextUrl(_0x450e79[_0xea7e5(0x113)],_0xea7e5(0xc8)+_0x6da74+_0xea7e5(0xf6)+_0x553d61+_0xea7e5(0xd9));console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a38_0x18ff23[_0xea7e5(0x15f)](_0x3d44ad));}return 0x0;}}