@treasuredata/tdx 0.25.8 β†’ 0.26.0

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 (167) 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/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.js +1 -1
  121. package/dist/sdk/segment.js +1 -1
  122. package/dist/sdk/types/index.js +1 -1
  123. package/dist/sdk/types/progress.js +1 -1
  124. package/dist/sdk/user.js +1 -1
  125. package/dist/sdk/util/format-detector.js +1 -1
  126. package/dist/sdk/util/formatters.js +1 -1
  127. package/dist/sdk/util/index.js +1 -1
  128. package/dist/sdk/util/tree-formatter.js +1 -1
  129. package/dist/sdk/workflow/archive-validation.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.js +1 -1
  148. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  149. package/dist/utils/logger/formatters/index.js +1 -1
  150. package/dist/utils/logger/handlers/console-handler.js +1 -1
  151. package/dist/utils/logger/handlers/file-handler.js +1 -1
  152. package/dist/utils/logger/handlers/index.js +1 -1
  153. package/dist/utils/logger/handlers/null-handler.js +1 -1
  154. package/dist/utils/logger/index.js +1 -1
  155. package/dist/utils/logger/logger.js +1 -1
  156. package/dist/utils/logger/types.js +1 -1
  157. package/dist/utils/option-validation.js +1 -1
  158. package/dist/utils/port.js +1 -1
  159. package/dist/utils/process.js +1 -1
  160. package/dist/utils/prompt.js +1 -1
  161. package/dist/utils/spinner.js +1 -1
  162. package/dist/utils/sse-parser.js +1 -1
  163. package/dist/utils/string-utils.js +1 -1
  164. package/dist/utils/table-ref-parser.js +1 -1
  165. package/dist/utils/tdx-logger.js +1 -1
  166. package/dist/utils/version-check.js +1 -1
  167. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x31463c=a26_0x2c66;(function(_0x21746e,_0x240d0d){const _0x16bcf2=a26_0x2c66,_0xa2b0a7=_0x21746e();while(!![]){try{const _0x3c092e=-parseInt(_0x16bcf2(0x182))/0x1+parseInt(_0x16bcf2(0x1e4))/0x2+parseInt(_0x16bcf2(0x1bd))/0x3+parseInt(_0x16bcf2(0x1a7))/0x4+-parseInt(_0x16bcf2(0x1b0))/0x5+parseInt(_0x16bcf2(0x1b2))/0x6+parseInt(_0x16bcf2(0x18c))/0x7*(-parseInt(_0x16bcf2(0x1b4))/0x8);if(_0x3c092e===_0x240d0d)break;else _0xa2b0a7['push'](_0xa2b0a7['shift']());}catch(_0x3065f9){_0xa2b0a7['push'](_0xa2b0a7['shift']());}}}(a26_0xd2f1,0x93f6b));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';function a26_0x2c66(_0x59bde1,_0x5efc1c){_0x59bde1=_0x59bde1-0x17a;const _0xd2f110=a26_0xd2f1();let _0x2c6647=_0xd2f110[_0x59bde1];return _0x2c6647;}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';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x423a87 from'chalk';function formatRelativeTime(_0x72d722){const _0x5d32e3=a26_0x2c66,_0x45a12c=new Date(_0x72d722),_0x4cbd60=new Date(),_0x1acdc8=_0x45a12c[_0x5d32e3(0x1eb)]()-_0x4cbd60[_0x5d32e3(0x1eb)](),_0x4fa32f=Math[_0x5d32e3(0x1d9)](_0x1acdc8)/0x3e8,_0x463efb=_0x1acdc8<0x0;if(_0x4fa32f<0x3c)return _0x463efb?_0x5d32e3(0x1a5):_0x5d32e3(0x1d8);else{if(_0x4fa32f<0xe10){const _0x4456ae=Math[_0x5d32e3(0x185)](_0x4fa32f/0x3c);return _0x463efb?_0x4456ae+_0x5d32e3(0x19f):'in\x20'+_0x4456ae+'m';}else{if(_0x4fa32f<0x15180){const _0x5aaebc=Math[_0x5d32e3(0x185)](_0x4fa32f/0xe10);return _0x463efb?_0x5aaebc+_0x5d32e3(0x1b6):'in\x20'+_0x5aaebc+'h';}else{if(_0x4fa32f<0x93a80){const _0xbc749c=Math['round'](_0x4fa32f/0x15180);return _0x463efb?_0xbc749c+_0x5d32e3(0x1a1):'in\x20'+_0xbc749c+'d';}else return _0x45a12c['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x31463c(0x1ce)]='schedule:list';[a26_0x31463c(0x1d1)]=a26_0x31463c(0x1d7);async[a26_0x31463c(0x1b1)](_0x15fea3){const _0x11f560=a26_0x31463c,{options:_0x54e433,args:_0x3dbf6d,tdx:_0x486698}=_0x15fea3,_0x1f1b9a=resolveLimit(_0x54e433[_0x11f560(0x1cd)],DEFAULT_DISPLAY_LIMIT),_0x1c4206=_0x3dbf6d[0x0],_0x2bdfbf=_0x1c4206?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x1c4206+_0x11f560(0x19a):_0x11f560(0x190),_0x5bc0cd=await withSpinner(_0x2bdfbf,()=>_0x486698[_0x11f560(0x1db)]['listQueries']({'limit':_0x1f1b9a,'scheduled':!![],'pattern':_0x1c4206}),{'verbose':_0x54e433[_0x11f560(0x1c3)]}),_0x532ae6=_0x5bc0cd[_0x11f560(0x1d0)][_0x11f560(0x17c)],_0x3a95de=_0x5bc0cd['data'][_0x11f560(0x1a4)][_0x11f560(0x196)],_0x32876b=_0x1c4206?_0x11f560(0x1e9)+_0x1c4206+'\x22':'';_0x3a95de?console[_0x11f560(0x180)]('Showing\x20first\x20'+_0x532ae6[_0x11f560(0x1f9)]+'\x20schedules'+_0x32876b+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x11f560(0x180)](_0x11f560(0x1fc)+_0x532ae6[_0x11f560(0x1f9)]+_0x11f560(0x1a9)+(_0x532ae6[_0x11f560(0x1f9)]!==0x1?_0x11f560(0x199):'y')+_0x32876b);if(_0x54e433['format']==='json'||_0x54e433[_0x11f560(0x1fd)]===_0x11f560(0x17a)||_0x54e433['format']===_0x11f560(0x17f)||_0x54e433['format']===_0x11f560(0x1af)){const _0x1644b4=_0x532ae6[_0x11f560(0x1ad)](_0x43050e=>({'id':_0x43050e['id'],'name':_0x43050e[_0x11f560(0x1ce)],'cron':_0x43050e['cron'],'database':_0x43050e[_0x11f560(0x1c0)]?.[_0x11f560(0x1ce)],'type':_0x43050e[_0x11f560(0x197)],'timezone':_0x43050e['time_zone'],'user_name':_0x43050e['user']?.[_0x11f560(0x1ce)],'updated_at':_0x43050e[_0x11f560(0x183)],'next_run_at':_0x43050e['next_run_at'],'last_job_status':_0x43050e['last_job']?.['status']}));await handleSDKOutput(_0x1644b4,_0x54e433);}else{if(_0x532ae6[_0x11f560(0x1f9)]===0x0)console['log'](_0x11f560(0x18a));else{const _0x3f8092=_0x54e433['site'],_0x636969=_0x532ae6[_0x11f560(0x1ad)](_0x28a76e=>{const _0x39df4f=_0x11f560,_0x139c71=_0x28a76e[_0x39df4f(0x1f6)]?.['status']?_0x28a76e[_0x39df4f(0x1f6)]['status']==='success'?'βœ“':'βœ—':'-',_0x9d8083=_0x28a76e[_0x39df4f(0x1f6)]?.['ended_at']?formatRelativeTime(_0x28a76e['last_job'][_0x39df4f(0x191)]):_0x39df4f(0x1ea),_0x20c498=_0x28a76e[_0x39df4f(0x184)]?formatRelativeTime(_0x28a76e['next_run_at']):'-',_0x547d32=_0x28a76e[_0x39df4f(0x186)]||'',_0x44c88e=_0x28a76e[_0x39df4f(0x1ce)]||'(unnamed)',_0x365dd4=getConsoleUrl(_0x3f8092,_0x39df4f(0x1f0)+_0x28a76e['id']);return{'statusIcon':_0x139c71,'lastRun':_0x9d8083,'nextRun':_0x20c498,'cron':_0x547d32,'name':_0x44c88e,'queryUrl':_0x365dd4,'status':_0x28a76e[_0x39df4f(0x1f6)]?.['status']};}),_0xfa48d6=Math[_0x11f560(0x1c6)](..._0x636969[_0x11f560(0x1ad)](_0xc4f400=>_0xc4f400[_0x11f560(0x1e0)]['length'])),_0x1dfc38=Math[_0x11f560(0x1c6)](..._0x636969[_0x11f560(0x1ad)](_0x160ae6=>_0x160ae6['nextRun'][_0x11f560(0x1f9)])),_0x1763a0=Math[_0x11f560(0x1c6)](..._0x636969[_0x11f560(0x1ad)](_0x4074a1=>_0x4074a1[_0x11f560(0x186)][_0x11f560(0x1f9)])),_0x5adcb2=_0x636969[_0x11f560(0x1ad)](_0x3a3f68=>{const _0x470594=_0x11f560,_0x39ddcc=_0x3a3f68[_0x470594(0x1cb)]===_0x470594(0x1cf)?a26_0x423a87['green'](_0x3a3f68['statusIcon']):_0x3a3f68['status']==='error'?a26_0x423a87['red'](_0x3a3f68[_0x470594(0x195)]):a26_0x423a87[_0x470594(0x1d3)](_0x3a3f68[_0x470594(0x195)]),_0x2ddeef=_0x3a3f68['lastRun']['padEnd'](_0xfa48d6),_0x1c36d3=_0x3a3f68[_0x470594(0x1a2)][_0x470594(0x1a3)](_0x1dfc38),_0x36b160=_0x3a3f68[_0x470594(0x186)]?a26_0x423a87[_0x470594(0x1c8)](_0x3a3f68['cron'][_0x470594(0x1a3)](_0x1763a0)):'\x20'[_0x470594(0x1bb)](_0x1763a0),_0x5edccf=hyperlink(_0x3a3f68['name'],_0x3a3f68[_0x470594(0x194)]);return _0x470594(0x18e)+_0x39ddcc+'\x20'+_0x2ddeef+_0x470594(0x1c2)+_0x1c36d3+'\x20\x20'+_0x36b160+'\x20\x20'+_0x5edccf;});await writeOutput(_0x5adcb2[_0x11f560(0x1b9)]('\x0a'),_0x54e433[_0x11f560(0x1ef)],_0x11f560(0x1c5));}}return 0x0;}}function a26_0xd2f1(){const _0x5c286a=['delete','378289smLGNj','updated_at','next_run_at','round','cron','Running\x20schedule...','engine_version','\x20execution','No\x20scheduled\x20queries\x20found','\x20\x20Time:\x20','343SHMwSN','utf-8','πŸ“…\x20','Schedule\x20deleted:\x20','Listing\x20scheduled\x20queries...','ended_at','Failed\x20to\x20read\x20file:\x20','retry_limit','queryUrl','statusIcon','has_next_page','type','from','ies','\x22...','priority','\x20\x20Job\x20ID:\x20','created_at','yes','m\x20ago','update','d\x20ago','nextRun','padEnd','pagination','just\x20now','scheduled_at','2917656sEAdxw','validate','\x20scheduled\x20quer','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','num','end_at','map','create','tsv','2095620iFlSxX','execute','712632OfxNsy','count','82504kyYptm','Updating\x20schedule:\x20','h\x20ago','Creating\x20schedule:\x20','Updating\x20schedule...','join','Getting\x20schedule\x20details...','repeat','start_at','1669071KzPHFL','Schedule\x20created:\x20','entries','database','Show\x20schedule\x20execution\x20history','\x20\x20β†’\x20','verbose','show','list','max','schedule:delete','cyan','Run\x20a\x20scheduled\x20query\x20immediately','query','status','history','limit','name','success','data','description','INVALID_ARGUMENT','dim','Create\x20a\x20scheduled\x20query','job_id','\x20job','List\x20scheduled\x20queries','soon','abs','Creating\x20schedule...','schedules','Getting\x20schedule\x20history...','args','delay','Schedule\x20run\x20submitted:\x20','lastRun','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','time','timezone','1008532nRhHGQ','user_name','retryLimit','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','schedule:create','\x20matching\x20\x22','never','getTime','keys','substring','\x20\x20Timezone:\x20','output','/app/queries/editor?queryId=','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','schedule:run','jobs','trim','engineVersion','last_job','\x20\x20Database:\x20','file','length','...','Deleting\x20schedule...','Found\x20','format','jsonl','\x20\x20Cron:\x20','queries','schedule:update','result','table','error'];a26_0xd2f1=function(){return _0x5c286a;};return a26_0xd2f1();}export class ScheduleShowCommand extends BaseCommand{[a26_0x31463c(0x1ce)]='schedule:show';[a26_0x31463c(0x1d1)]='Show\x20schedule\x20details';[a26_0x31463c(0x1a8)](_0x13b96d){const _0x4a39b2=_0x13b96d['args'][0x0];if(!_0x4a39b2)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a26_0x31463c(0x1b1)](_0x2646b7){const _0x22f1b2=a26_0x31463c,{options:_0x94a952,args:_0x2e0464,tdx:_0x5b7585}=_0x2646b7,_0x3ce83c=_0x2e0464[0x0],_0x36c66e=await withSpinner(_0x22f1b2(0x1ba),()=>_0x5b7585[_0x22f1b2(0x1db)][_0x22f1b2(0x1c4)](_0x3ce83c),{'verbose':_0x94a952[_0x22f1b2(0x1c3)]}),_0x800c5b=_0x36c66e[_0x22f1b2(0x1d0)],_0x1e4436={'name':_0x800c5b[_0x22f1b2(0x1ce)],'cron':_0x800c5b[_0x22f1b2(0x186)],'database':_0x800c5b[_0x22f1b2(0x1c0)],'type':_0x800c5b[_0x22f1b2(0x197)],'timezone':_0x800c5b[_0x22f1b2(0x1e3)],'user_name':_0x800c5b[_0x22f1b2(0x1e5)],'created_at':_0x800c5b[_0x22f1b2(0x19d)],'engine_version':_0x800c5b[_0x22f1b2(0x188)],'executing_user_id':_0x800c5b['executing_user_id'],'query':_0x800c5b['query'],'delay':_0x800c5b['delay'],'priority':_0x800c5b[_0x22f1b2(0x19b)],'retry_limit':_0x800c5b[_0x22f1b2(0x193)],..._0x800c5b['result']&&{'result':_0x800c5b[_0x22f1b2(0x17e)]}};return await handleSingleObjectOutput(_0x1e4436,_0x94a952),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x31463c(0x1ce)]=a26_0x31463c(0x1e8);[a26_0x31463c(0x1d1)]=a26_0x31463c(0x1d4);[a26_0x31463c(0x1a8)](_0x1514b1){const _0xc6290a=a26_0x31463c,_0x20d907=_0x1514b1[_0xc6290a(0x1dd)][0x0];if(!_0x20d907)return _0xc6290a(0x1f1);return undefined;}async[a26_0x31463c(0x1b1)](_0x1930ec){const _0x324798=a26_0x31463c,{options:_0x2ee4c8,args:_0x3a8433,tdx:_0x1bfed1}=_0x1930ec,_0x46bb8e=_0x3a8433[0x0],_0x57e529=_0x2ee4c8,_0x513b40=_0x57e529[_0x324798(0x1c0)],_0x2482cf=_0x57e529['file'],_0x1b2c53=_0x57e529['type']||'trino';let _0x1f5ad7;try{_0x1f5ad7=readFileSync(_0x2482cf,'utf-8')[_0x324798(0x1f4)]();}catch(_0x443711){throw new SDKError(ErrorCode[_0x324798(0x1d2)],_0x324798(0x192)+_0x2482cf,_0x443711 instanceof Error?_0x443711:undefined);}if(!_0x1f5ad7)throw new SDKError(ErrorCode[_0x324798(0x1d2)],'Query\x20file\x20is\x20empty');const _0x3daac6={'database':_0x513b40,'query':_0x1f5ad7,'type':_0x1b2c53};if(_0x57e529[_0x324798(0x186)])_0x3daac6[_0x324798(0x186)]=_0x57e529[_0x324798(0x186)];if(_0x57e529[_0x324798(0x1e3)])_0x3daac6[_0x324798(0x1e3)]=_0x57e529[_0x324798(0x1e3)];if(_0x57e529[_0x324798(0x1de)]!==undefined)_0x3daac6[_0x324798(0x1de)]=Number(_0x57e529[_0x324798(0x1de)]);if(_0x57e529[_0x324798(0x19b)]!==undefined)_0x3daac6[_0x324798(0x19b)]=Number(_0x57e529['priority']);if(_0x57e529['retryLimit']!==undefined)_0x3daac6['retry_limit']=Number(_0x57e529['retryLimit']);if(_0x57e529[_0x324798(0x1f5)])_0x3daac6[_0x324798(0x188)]=_0x57e529[_0x324798(0x1f5)];if(_0x57e529['result'])_0x3daac6[_0x324798(0x17e)]=_0x57e529[_0x324798(0x17e)];if(_0x2ee4c8[_0x324798(0x1c3)]){console['error'](_0x324798(0x1b7)+_0x46bb8e),console[_0x324798(0x180)](_0x324798(0x1f7)+_0x513b40),console[_0x324798(0x180)]('\x20\x20Type:\x20'+_0x1b2c53);if(_0x3daac6[_0x324798(0x186)])console['error'](_0x324798(0x17b)+_0x3daac6[_0x324798(0x186)]);if(_0x3daac6['timezone'])console['error'](_0x324798(0x1ee)+_0x3daac6['timezone']);}const _0x172c99=await withSpinner(_0x324798(0x1da),()=>_0x1bfed1[_0x324798(0x1db)][_0x324798(0x1ae)](_0x46bb8e,_0x3daac6),{'verbose':_0x2ee4c8[_0x324798(0x1c3)]});return console[_0x324798(0x180)](_0x324798(0x1be)+_0x172c99['data'][_0x324798(0x1ce)]),await handleSingleObjectOutput(_0x172c99[_0x324798(0x1d0)],_0x2ee4c8),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x31463c(0x1ce)]=a26_0x31463c(0x17d);[a26_0x31463c(0x1d1)]='Update\x20a\x20scheduled\x20query';[a26_0x31463c(0x1a8)](_0xa96e){const _0x404e85=a26_0x31463c,_0x3963c9=_0xa96e[_0x404e85(0x1dd)][0x0];if(!_0x3963c9)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a26_0x31463c(0x1b1)](_0x41a6ab){const _0x47683c=a26_0x31463c,{options:_0xc76edd,args:_0x77d90d,tdx:_0x2c7db5}=_0x41a6ab,_0x429722=_0x77d90d[0x0],_0xa95779=_0xc76edd,_0x5f3f78={};if(_0xa95779[_0x47683c(0x1c0)])_0x5f3f78[_0x47683c(0x1c0)]=_0xa95779[_0x47683c(0x1c0)];if(_0xa95779[_0x47683c(0x197)])_0x5f3f78[_0x47683c(0x197)]=_0xa95779['type'];if(_0xa95779['cron'])_0x5f3f78['cron']=_0xa95779[_0x47683c(0x186)];if(_0xa95779['timezone'])_0x5f3f78[_0x47683c(0x1e3)]=_0xa95779['timezone'];if(_0xa95779[_0x47683c(0x1de)]!==undefined)_0x5f3f78[_0x47683c(0x1de)]=Number(_0xa95779[_0x47683c(0x1de)]);if(_0xa95779[_0x47683c(0x19b)]!==undefined)_0x5f3f78[_0x47683c(0x19b)]=Number(_0xa95779[_0x47683c(0x19b)]);if(_0xa95779[_0x47683c(0x1e6)]!==undefined)_0x5f3f78['retry_limit']=Number(_0xa95779[_0x47683c(0x1e6)]);if(_0xa95779[_0x47683c(0x1f5)])_0x5f3f78[_0x47683c(0x188)]=_0xa95779[_0x47683c(0x1f5)];if(_0xa95779[_0x47683c(0x17e)])_0x5f3f78[_0x47683c(0x17e)]=_0xa95779[_0x47683c(0x17e)];if(_0xa95779[_0x47683c(0x1f8)])try{_0x5f3f78['query']=readFileSync(_0xa95779[_0x47683c(0x1f8)],_0x47683c(0x18d))['trim']();}catch(_0x2c341c){throw new SDKError(ErrorCode[_0x47683c(0x1d2)],_0x47683c(0x192)+_0xa95779[_0x47683c(0x1f8)],_0x2c341c instanceof Error?_0x2c341c:undefined);}if(Object[_0x47683c(0x1ec)](_0x5f3f78)[_0x47683c(0x1f9)]===0x0)throw new SDKError(ErrorCode[_0x47683c(0x1d2)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0xc76edd[_0x47683c(0x1c3)]){console[_0x47683c(0x180)](_0x47683c(0x1b5)+_0x429722);for(const [_0x48f7a9,_0x2a4702]of Object[_0x47683c(0x1bf)](_0x5f3f78)){_0x48f7a9===_0x47683c(0x1ca)?console['error']('\x20\x20'+_0x48f7a9+':\x20'+_0x2a4702[_0x47683c(0x1ed)](0x0,0x32)+_0x47683c(0x1fa)):console['error']('\x20\x20'+_0x48f7a9+':\x20'+_0x2a4702);}}const _0x32c5d8=await withSpinner(_0x47683c(0x1b8),()=>_0x2c7db5['schedules'][_0x47683c(0x1a0)](_0x429722,_0x5f3f78),{'verbose':_0xc76edd[_0x47683c(0x1c3)]});return console['error']('Schedule\x20updated:\x20'+_0x32c5d8[_0x47683c(0x1d0)][_0x47683c(0x1ce)]),await handleSingleObjectOutput(_0x32c5d8[_0x47683c(0x1d0)],_0xc76edd),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x31463c(0x1ce)]=a26_0x31463c(0x1c7);[a26_0x31463c(0x1d1)]='Delete\x20a\x20scheduled\x20query';[a26_0x31463c(0x1a8)](_0x173acf){const _0x49fcea=a26_0x31463c,_0xd9fa2f=_0x173acf[_0x49fcea(0x1dd)][0x0];if(!_0xd9fa2f)return _0x49fcea(0x1e1);return undefined;}async[a26_0x31463c(0x1b1)](_0x43379c){const _0x4a0afa=a26_0x31463c,{options:_0x9515fa,args:_0x49c445,tdx:_0x5b86fd}=_0x43379c,_0x59de23=_0x49c445[0x0];if(!_0x9515fa[_0x4a0afa(0x19e)]){const _0x2d1e55=await confirm(_0x4a0afa(0x1aa)+_0x59de23+'\x22?');if(!_0x2d1e55)return console[_0x4a0afa(0x180)]('Cancelled'),0x0;}const _0x242cf0=await withSpinner(_0x4a0afa(0x1fb),()=>_0x5b86fd['schedules'][_0x4a0afa(0x181)](_0x59de23),{'verbose':_0x9515fa[_0x4a0afa(0x1c3)]});return console[_0x4a0afa(0x180)](_0x4a0afa(0x18f)+_0x242cf0[_0x4a0afa(0x1d0)][_0x4a0afa(0x1ce)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a26_0x31463c(0x1f2);[a26_0x31463c(0x1d1)]=a26_0x31463c(0x1c9);[a26_0x31463c(0x1a8)](_0x187de3){const _0x54cff0=a26_0x31463c,_0x18b9c0=_0x187de3[_0x54cff0(0x1dd)][0x0];if(!_0x18b9c0)return _0x54cff0(0x1e7);return undefined;}async['execute'](_0x53afa1){const _0x2b7371=a26_0x31463c,{options:_0x5dd9d3,args:_0x5e8cc3,tdx:_0x1fc4ef}=_0x53afa1,_0x42ca5a=_0x5e8cc3[0x0],_0x12fa9c=_0x5dd9d3,_0x315add=_0x12fa9c[_0x2b7371(0x1e2)],_0x4a5073=_0x12fa9c[_0x2b7371(0x1ab)]!==undefined?Number(_0x12fa9c[_0x2b7371(0x1ab)]):undefined;if(_0x5dd9d3['verbose']){console['error']('Running\x20schedule:\x20'+_0x42ca5a);if(_0x315add)console[_0x2b7371(0x180)](_0x2b7371(0x18b)+_0x315add);if(_0x4a5073)console['error']('\x20\x20Num:\x20'+_0x4a5073);}const _0x1d11a6=await withSpinner(_0x2b7371(0x187),()=>_0x1fc4ef[_0x2b7371(0x1db)]['run'](_0x42ca5a,{'time':_0x315add,'num':_0x4a5073}),{'verbose':_0x5dd9d3[_0x2b7371(0x1c3)]}),_0x2988b9=_0x1d11a6[_0x2b7371(0x1d0)][_0x2b7371(0x1f3)];console[_0x2b7371(0x180)](_0x2b7371(0x1df)+_0x2988b9[_0x2b7371(0x1f9)]+_0x2b7371(0x1d6)+(_0x2988b9['length']!==0x1?'s':'')+'\x20created');for(const _0x519921 of _0x2988b9){console[_0x2b7371(0x180)](_0x2b7371(0x19c)+_0x519921['job_id']);}return await handleSDKOutput(_0x2988b9,_0x5dd9d3),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']='schedule:history';[a26_0x31463c(0x1d1)]=a26_0x31463c(0x1c1);[a26_0x31463c(0x1a8)](_0x133f54){const _0x13de22=a26_0x31463c,_0x2fb5e2=_0x133f54[_0x13de22(0x1dd)][0x0];if(!_0x2fb5e2)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a26_0x31463c(0x1b1)](_0x3a6e07){const _0x1f211c=a26_0x31463c,{options:_0x502661,args:_0x3ddaae,tdx:_0x231f55}=_0x3a6e07,_0x25a332=_0x3ddaae[0x0],_0x1f6777=_0x502661,_0x2f759b=_0x1f6777[_0x1f211c(0x198)]!==undefined?Number(_0x1f6777[_0x1f211c(0x198)]):undefined,_0x62754b=_0x1f6777['to']!==undefined?Number(_0x1f6777['to']):undefined,_0xfc79b1=await withSpinner(_0x1f211c(0x1dc),()=>_0x231f55[_0x1f211c(0x1db)][_0x1f211c(0x1cc)](_0x25a332,{'from':_0x2f759b,'to':_0x62754b}),{'verbose':_0x502661[_0x1f211c(0x1c3)]}),_0x245e1c=_0xfc79b1['data'];console[_0x1f211c(0x180)](_0x1f211c(0x1fc)+_0x245e1c[_0x1f211c(0x1b3)]+_0x1f211c(0x189)+(_0x245e1c[_0x1f211c(0x1b3)]!==0x1?'s':'')+'\x20(showing\x20'+_0x245e1c[_0x1f211c(0x198)]+'-'+_0x245e1c['to']+')');const _0x130853=_0x245e1c[_0x1f211c(0x1cc)][_0x1f211c(0x1ad)](_0x1161fb=>({'job_id':_0x1161fb[_0x1f211c(0x1d5)],'type':_0x1161fb[_0x1f211c(0x197)],'status':_0x1161fb['status'],'scheduled_at':_0x1161fb[_0x1f211c(0x1a6)],'created_at':_0x1161fb[_0x1f211c(0x19d)],'start_at':_0x1161fb[_0x1f211c(0x1bc)],'end_at':_0x1161fb[_0x1f211c(0x1ac)]}));return await handleSDKOutput(_0x130853,_0x502661),0x0;}}
1
+ const a26_0x34f809=a26_0x5ddf;(function(_0x468849,_0x6727e5){const _0x73c2f8=a26_0x5ddf,_0x5bff54=_0x468849();while(!![]){try{const _0x399d6d=-parseInt(_0x73c2f8(0x93))/0x1+parseInt(_0x73c2f8(0xdd))/0x2+parseInt(_0x73c2f8(0xa7))/0x3*(parseInt(_0x73c2f8(0xe6))/0x4)+-parseInt(_0x73c2f8(0xe1))/0x5*(-parseInt(_0x73c2f8(0xce))/0x6)+parseInt(_0x73c2f8(0xea))/0x7+parseInt(_0x73c2f8(0xab))/0x8+-parseInt(_0x73c2f8(0xbc))/0x9*(parseInt(_0x73c2f8(0xb8))/0xa);if(_0x399d6d===_0x6727e5)break;else _0x5bff54['push'](_0x5bff54['shift']());}catch(_0x595243){_0x5bff54['push'](_0x5bff54['shift']());}}}(a26_0x575a,0x904dc));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 a26_0x575a(){const _0x2c9d87=['Getting\x20schedule\x20history...','\x20scheduled\x20quer','Running\x20schedule...','135044QfpGML','user_name','num','last_job','7770427FKljnc','cyan','table','count','queryUrl','/app/queries/editor?queryId=','site','Run\x20a\x20scheduled\x20query\x20immediately','round','engineVersion','trino','green','output','created_at','dim','nextRun','time','schedule:create','Schedule\x20deleted:\x20','priority','\x20\x20Timezone:\x20','utf-8','Cancelled','Failed\x20to\x20read\x20file:\x20','description','Deleting\x20schedule...','in\x20','file','job_id','padEnd','verbose','Running\x20schedule:\x20','\x20\x20Num:\x20','args','from','\x20\x20Time:\x20','name','timezone','\x20\x20Cron:\x20','\x20\x20β†’\x20','Listing\x20scheduled\x20queries...','jsonl','schedule:update','result','d\x20ago','Schedule\x20updated:\x20','execute','user','ended_at','toLocaleDateString','\x20\x20Type:\x20','delay','engine_version','abs','next_run_at','map','max','Found\x20','1031610gbYGff','format','update','list','Showing\x20first\x20','validate','type','\x20job','Creating\x20schedule:\x20','...','database','status','has_next_page','\x20(use\x20--limit\x20to\x20see\x20more)','schedule:delete','List\x20scheduled\x20queries','retry_limit','show','queries','m\x20ago','51dtTRjJ','lastRun','entries','create','5727616NGKXCH','schedule:list','scheduled_at','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','\x20schedules','jobs','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','json','statusIcon','error','Getting\x20schedule\x20details...','start_at','\x20matching\x20\x22','140mgEQZf','Create\x20a\x20scheduled\x20query','history','getTime','1424394APjgye','yes','Schedule\x20created:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','(unnamed)','Show\x20schedule\x20details','query','repeat','schedules','Updating\x20schedule:\x20','keys','cron','data','length','INVALID_ARGUMENT','pagination','limit','trim','6RpQIAk','just\x20now','ies','Updating\x20schedule...','Delete\x20a\x20scheduled\x20query','red','Searching\x20scheduled\x20queries\x20matching\x20\x22','\x20\x20Job\x20ID:\x20','\x22...','success','Show\x20schedule\x20execution\x20history','delete','listQueries','retryLimit','schedule:run','1741918lJlcLi','never','executing_user_id','\x20created','2837465FDwcXF','πŸ“…\x20'];a26_0x575a=function(){return _0x2c9d87;};return a26_0x575a();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x53ebf6 from'chalk';function formatRelativeTime(_0x282a69){const _0x11b6b3=a26_0x5ddf,_0x2ce2ff=new Date(_0x282a69),_0x7144e6=new Date(),_0x3d9efa=_0x2ce2ff[_0x11b6b3(0xbb)]()-_0x7144e6[_0x11b6b3(0xbb)](),_0x12ca7e=Math[_0x11b6b3(0x8e)](_0x3d9efa)/0x3e8,_0x844db5=_0x3d9efa<0x0;if(_0x12ca7e<0x3c)return _0x844db5?_0x11b6b3(0xcf):'soon';else{if(_0x12ca7e<0xe10){const _0x36ae53=Math[_0x11b6b3(0xf2)](_0x12ca7e/0x3c);return _0x844db5?_0x36ae53+_0x11b6b3(0xa6):'in\x20'+_0x36ae53+'m';}else{if(_0x12ca7e<0x15180){const _0x7c1cd1=Math[_0x11b6b3(0xf2)](_0x12ca7e/0xe10);return _0x844db5?_0x7c1cd1+'h\x20ago':_0x11b6b3(0x104)+_0x7c1cd1+'h';}else{if(_0x12ca7e<0x93a80){const _0x339ec0=Math[_0x11b6b3(0xf2)](_0x12ca7e/0x15180);return _0x844db5?_0x339ec0+_0x11b6b3(0x116):_0x11b6b3(0x104)+_0x339ec0+'d';}else return _0x2ce2ff[_0x11b6b3(0x11b)]();}}}}function a26_0x5ddf(_0x4e26c7,_0x13dc12){_0x4e26c7=_0x4e26c7-0x8c;const _0x575ae0=a26_0x575a();let _0x5ddf92=_0x575ae0[_0x4e26c7];return _0x5ddf92;}export class ScheduleListCommand extends BaseCommand{[a26_0x34f809(0x10e)]=a26_0x34f809(0xac);['description']=a26_0x34f809(0xa2);async[a26_0x34f809(0x118)](_0x1fe68e){const _0x3b6bb5=a26_0x34f809,{options:_0x341c5b,args:_0x59fc6a,tdx:_0x430189}=_0x1fe68e,_0x5245ee=resolveLimit(_0x341c5b[_0x3b6bb5(0xcc)],DEFAULT_DISPLAY_LIMIT),_0x4be4ef=_0x59fc6a[0x0],_0x5d9786=_0x4be4ef?_0x3b6bb5(0xd4)+_0x4be4ef+_0x3b6bb5(0xd6):_0x3b6bb5(0x112),_0x2c94fd=await withSpinner(_0x5d9786,()=>_0x430189['schedules'][_0x3b6bb5(0xda)]({'limit':_0x5245ee,'scheduled':!![],'pattern':_0x4be4ef}),{'verbose':_0x341c5b[_0x3b6bb5(0x108)]}),_0x371d70=_0x2c94fd[_0x3b6bb5(0xc8)][_0x3b6bb5(0xa5)],_0x150bdc=_0x2c94fd[_0x3b6bb5(0xc8)][_0x3b6bb5(0xcb)][_0x3b6bb5(0x9f)],_0x40f12b=_0x4be4ef?_0x3b6bb5(0xb7)+_0x4be4ef+'\x22':'';_0x150bdc?console['error'](_0x3b6bb5(0x97)+_0x371d70[_0x3b6bb5(0xc9)]+_0x3b6bb5(0xaf)+_0x40f12b+_0x3b6bb5(0xa0)):console[_0x3b6bb5(0xb4)](_0x3b6bb5(0x92)+_0x371d70['length']+_0x3b6bb5(0xe4)+(_0x371d70[_0x3b6bb5(0xc9)]!==0x1?_0x3b6bb5(0xd0):'y')+_0x40f12b);if(_0x341c5b['format']===_0x3b6bb5(0xb2)||_0x341c5b['format']===_0x3b6bb5(0x113)||_0x341c5b[_0x3b6bb5(0x94)]===_0x3b6bb5(0xec)||_0x341c5b[_0x3b6bb5(0x94)]==='tsv'){const _0x6d3e79=_0x371d70[_0x3b6bb5(0x90)](_0x2ea72a=>({'id':_0x2ea72a['id'],'name':_0x2ea72a[_0x3b6bb5(0x10e)],'cron':_0x2ea72a[_0x3b6bb5(0xc7)],'database':_0x2ea72a[_0x3b6bb5(0x9d)]?.['name'],'type':_0x2ea72a[_0x3b6bb5(0x99)],'timezone':_0x2ea72a['time_zone'],'user_name':_0x2ea72a[_0x3b6bb5(0x119)]?.[_0x3b6bb5(0x10e)],'updated_at':_0x2ea72a['updated_at'],'next_run_at':_0x2ea72a[_0x3b6bb5(0x8f)],'last_job_status':_0x2ea72a['last_job']?.['status']}));await handleSDKOutput(_0x6d3e79,_0x341c5b);}else{if(_0x371d70[_0x3b6bb5(0xc9)]===0x0)console['log']('No\x20scheduled\x20queries\x20found');else{const _0x5aecc7=_0x341c5b[_0x3b6bb5(0xf0)],_0x3ee33d=_0x371d70[_0x3b6bb5(0x90)](_0x420af5=>{const _0x313fad=_0x3b6bb5,_0x56ff46=_0x420af5['last_job']?.['status']?_0x420af5[_0x313fad(0xe9)]['status']===_0x313fad(0xd7)?'βœ“':'βœ—':'-',_0x489840=_0x420af5[_0x313fad(0xe9)]?.[_0x313fad(0x11a)]?formatRelativeTime(_0x420af5[_0x313fad(0xe9)][_0x313fad(0x11a)]):_0x313fad(0xde),_0x56d43e=_0x420af5[_0x313fad(0x8f)]?formatRelativeTime(_0x420af5[_0x313fad(0x8f)]):'-',_0x425cde=_0x420af5[_0x313fad(0xc7)]||'',_0x516ab1=_0x420af5[_0x313fad(0x10e)]||_0x313fad(0xc0),_0x3a0b30=getConsoleUrl(_0x5aecc7,_0x313fad(0xef)+_0x420af5['id']);return{'statusIcon':_0x56ff46,'lastRun':_0x489840,'nextRun':_0x56d43e,'cron':_0x425cde,'name':_0x516ab1,'queryUrl':_0x3a0b30,'status':_0x420af5[_0x313fad(0xe9)]?.[_0x313fad(0x9e)]};}),_0x1cc4e2=Math[_0x3b6bb5(0x91)](..._0x3ee33d['map'](_0x35365e=>_0x35365e['lastRun'][_0x3b6bb5(0xc9)])),_0x141fed=Math['max'](..._0x3ee33d['map'](_0x20ecbb=>_0x20ecbb[_0x3b6bb5(0xf9)][_0x3b6bb5(0xc9)])),_0xcc474a=Math[_0x3b6bb5(0x91)](..._0x3ee33d[_0x3b6bb5(0x90)](_0xdbeef4=>_0xdbeef4[_0x3b6bb5(0xc7)][_0x3b6bb5(0xc9)])),_0x26676e=_0x3ee33d[_0x3b6bb5(0x90)](_0x526425=>{const _0x3be9e5=_0x3b6bb5,_0x490380=_0x526425[_0x3be9e5(0x9e)]==='success'?a26_0x53ebf6[_0x3be9e5(0xf5)](_0x526425[_0x3be9e5(0xb3)]):_0x526425[_0x3be9e5(0x9e)]===_0x3be9e5(0xb4)?a26_0x53ebf6[_0x3be9e5(0xd3)](_0x526425[_0x3be9e5(0xb3)]):a26_0x53ebf6[_0x3be9e5(0xf8)](_0x526425['statusIcon']),_0x2f5b9f=_0x526425[_0x3be9e5(0xa8)]['padEnd'](_0x1cc4e2),_0x26cca8=_0x526425[_0x3be9e5(0xf9)][_0x3be9e5(0x107)](_0x141fed),_0x4f01a5=_0x526425[_0x3be9e5(0xc7)]?a26_0x53ebf6[_0x3be9e5(0xeb)](_0x526425[_0x3be9e5(0xc7)][_0x3be9e5(0x107)](_0xcc474a)):'\x20'[_0x3be9e5(0xc3)](_0xcc474a),_0x578f58=hyperlink(_0x526425['name'],_0x526425[_0x3be9e5(0xee)]);return _0x3be9e5(0xe2)+_0x490380+'\x20'+_0x2f5b9f+_0x3be9e5(0x111)+_0x26cca8+'\x20\x20'+_0x4f01a5+'\x20\x20'+_0x578f58;});await writeOutput(_0x26676e['join']('\x0a'),_0x341c5b[_0x3b6bb5(0xf6)],_0x3b6bb5(0x96));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x34f809(0x10e)]='schedule:show';[a26_0x34f809(0x102)]=a26_0x34f809(0xc1);[a26_0x34f809(0x98)](_0x4d0c0e){const _0x35e004=a26_0x34f809,_0x243c7c=_0x4d0c0e[_0x35e004(0x10b)][0x0];if(!_0x243c7c)return _0x35e004(0xb1);return undefined;}async['execute'](_0x579784){const _0x43724d=a26_0x34f809,{options:_0x558d1d,args:_0x21006b,tdx:_0x5750e0}=_0x579784,_0x408a5f=_0x21006b[0x0],_0x3b5672=await withSpinner(_0x43724d(0xb5),()=>_0x5750e0[_0x43724d(0xc4)][_0x43724d(0xa4)](_0x408a5f),{'verbose':_0x558d1d[_0x43724d(0x108)]}),_0x4b5448=_0x3b5672[_0x43724d(0xc8)],_0x42c44d={'name':_0x4b5448[_0x43724d(0x10e)],'cron':_0x4b5448[_0x43724d(0xc7)],'database':_0x4b5448['database'],'type':_0x4b5448[_0x43724d(0x99)],'timezone':_0x4b5448['timezone'],'user_name':_0x4b5448[_0x43724d(0xe7)],'created_at':_0x4b5448[_0x43724d(0xf7)],'engine_version':_0x4b5448[_0x43724d(0x8d)],'executing_user_id':_0x4b5448[_0x43724d(0xdf)],'query':_0x4b5448[_0x43724d(0xc2)],'delay':_0x4b5448[_0x43724d(0x8c)],'priority':_0x4b5448['priority'],'retry_limit':_0x4b5448[_0x43724d(0xa3)],..._0x4b5448[_0x43724d(0x115)]&&{'result':_0x4b5448['result']}};return await handleSingleObjectOutput(_0x42c44d,_0x558d1d),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a26_0x34f809(0xfb);[a26_0x34f809(0x102)]=a26_0x34f809(0xb9);[a26_0x34f809(0x98)](_0x16924a){const _0x474297=a26_0x34f809,_0x4725e4=_0x16924a[_0x474297(0x10b)][0x0];if(!_0x4725e4)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a26_0x34f809(0x118)](_0x3a3297){const _0x22b0b5=a26_0x34f809,{options:_0x291c96,args:_0x11755d,tdx:_0x1fffdd}=_0x3a3297,_0x4b83f2=_0x11755d[0x0],_0x55ba76=_0x291c96,_0x102cf0=_0x55ba76[_0x22b0b5(0x9d)],_0x361250=_0x55ba76[_0x22b0b5(0x105)],_0x3a946c=_0x55ba76['type']||_0x22b0b5(0xf4);let _0x2d844d;try{_0x2d844d=readFileSync(_0x361250,_0x22b0b5(0xff))[_0x22b0b5(0xcd)]();}catch(_0x1bb946){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x22b0b5(0x101)+_0x361250,_0x1bb946 instanceof Error?_0x1bb946:undefined);}if(!_0x2d844d)throw new SDKError(ErrorCode[_0x22b0b5(0xca)],'Query\x20file\x20is\x20empty');const _0x33c549={'database':_0x102cf0,'query':_0x2d844d,'type':_0x3a946c};if(_0x55ba76[_0x22b0b5(0xc7)])_0x33c549[_0x22b0b5(0xc7)]=_0x55ba76[_0x22b0b5(0xc7)];if(_0x55ba76[_0x22b0b5(0x10f)])_0x33c549[_0x22b0b5(0x10f)]=_0x55ba76[_0x22b0b5(0x10f)];if(_0x55ba76[_0x22b0b5(0x8c)]!==undefined)_0x33c549[_0x22b0b5(0x8c)]=Number(_0x55ba76[_0x22b0b5(0x8c)]);if(_0x55ba76[_0x22b0b5(0xfd)]!==undefined)_0x33c549['priority']=Number(_0x55ba76[_0x22b0b5(0xfd)]);if(_0x55ba76[_0x22b0b5(0xdb)]!==undefined)_0x33c549[_0x22b0b5(0xa3)]=Number(_0x55ba76[_0x22b0b5(0xdb)]);if(_0x55ba76[_0x22b0b5(0xf3)])_0x33c549[_0x22b0b5(0x8d)]=_0x55ba76[_0x22b0b5(0xf3)];if(_0x55ba76[_0x22b0b5(0x115)])_0x33c549[_0x22b0b5(0x115)]=_0x55ba76[_0x22b0b5(0x115)];if(_0x291c96['verbose']){console['error'](_0x22b0b5(0x9b)+_0x4b83f2),console[_0x22b0b5(0xb4)]('\x20\x20Database:\x20'+_0x102cf0),console[_0x22b0b5(0xb4)](_0x22b0b5(0x11c)+_0x3a946c);if(_0x33c549[_0x22b0b5(0xc7)])console[_0x22b0b5(0xb4)](_0x22b0b5(0x110)+_0x33c549[_0x22b0b5(0xc7)]);if(_0x33c549['timezone'])console['error'](_0x22b0b5(0xfe)+_0x33c549['timezone']);}const _0x45b0f3=await withSpinner('Creating\x20schedule...',()=>_0x1fffdd[_0x22b0b5(0xc4)][_0x22b0b5(0xaa)](_0x4b83f2,_0x33c549),{'verbose':_0x291c96[_0x22b0b5(0x108)]});return console[_0x22b0b5(0xb4)](_0x22b0b5(0xbe)+_0x45b0f3[_0x22b0b5(0xc8)][_0x22b0b5(0x10e)]),await handleSingleObjectOutput(_0x45b0f3[_0x22b0b5(0xc8)],_0x291c96),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x34f809(0x10e)]=a26_0x34f809(0x114);[a26_0x34f809(0x102)]='Update\x20a\x20scheduled\x20query';[a26_0x34f809(0x98)](_0x5d69be){const _0x12048=a26_0x34f809,_0x3a2dfb=_0x5d69be['args'][0x0];if(!_0x3a2dfb)return _0x12048(0xbf);return undefined;}async[a26_0x34f809(0x118)](_0x54480b){const _0x541357=a26_0x34f809,{options:_0x1e7261,args:_0x513b2a,tdx:_0xe92de7}=_0x54480b,_0x44fae5=_0x513b2a[0x0],_0x1906b0=_0x1e7261,_0x2d20c7={};if(_0x1906b0['database'])_0x2d20c7[_0x541357(0x9d)]=_0x1906b0['database'];if(_0x1906b0[_0x541357(0x99)])_0x2d20c7[_0x541357(0x99)]=_0x1906b0[_0x541357(0x99)];if(_0x1906b0[_0x541357(0xc7)])_0x2d20c7[_0x541357(0xc7)]=_0x1906b0[_0x541357(0xc7)];if(_0x1906b0[_0x541357(0x10f)])_0x2d20c7[_0x541357(0x10f)]=_0x1906b0[_0x541357(0x10f)];if(_0x1906b0[_0x541357(0x8c)]!==undefined)_0x2d20c7[_0x541357(0x8c)]=Number(_0x1906b0['delay']);if(_0x1906b0[_0x541357(0xfd)]!==undefined)_0x2d20c7[_0x541357(0xfd)]=Number(_0x1906b0[_0x541357(0xfd)]);if(_0x1906b0[_0x541357(0xdb)]!==undefined)_0x2d20c7[_0x541357(0xa3)]=Number(_0x1906b0['retryLimit']);if(_0x1906b0[_0x541357(0xf3)])_0x2d20c7[_0x541357(0x8d)]=_0x1906b0[_0x541357(0xf3)];if(_0x1906b0['result'])_0x2d20c7[_0x541357(0x115)]=_0x1906b0[_0x541357(0x115)];if(_0x1906b0['file'])try{_0x2d20c7[_0x541357(0xc2)]=readFileSync(_0x1906b0['file'],_0x541357(0xff))[_0x541357(0xcd)]();}catch(_0x3932f4){throw new SDKError(ErrorCode[_0x541357(0xca)],_0x541357(0x101)+_0x1906b0[_0x541357(0x105)],_0x3932f4 instanceof Error?_0x3932f4:undefined);}if(Object[_0x541357(0xc6)](_0x2d20c7)[_0x541357(0xc9)]===0x0)throw new SDKError(ErrorCode[_0x541357(0xca)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x1e7261['verbose']){console['error'](_0x541357(0xc5)+_0x44fae5);for(const [_0x1da446,_0x590a16]of Object[_0x541357(0xa9)](_0x2d20c7)){_0x1da446===_0x541357(0xc2)?console[_0x541357(0xb4)]('\x20\x20'+_0x1da446+':\x20'+_0x590a16['substring'](0x0,0x32)+_0x541357(0x9c)):console['error']('\x20\x20'+_0x1da446+':\x20'+_0x590a16);}}const _0x3bb08f=await withSpinner(_0x541357(0xd1),()=>_0xe92de7[_0x541357(0xc4)][_0x541357(0x95)](_0x44fae5,_0x2d20c7),{'verbose':_0x1e7261['verbose']});return console[_0x541357(0xb4)](_0x541357(0x117)+_0x3bb08f['data'][_0x541357(0x10e)]),await handleSingleObjectOutput(_0x3bb08f[_0x541357(0xc8)],_0x1e7261),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a26_0x34f809(0xa1);[a26_0x34f809(0x102)]=a26_0x34f809(0xd2);['validate'](_0x506ade){const _0x2dcd60=a26_0x34f809,_0x40b82d=_0x506ade[_0x2dcd60(0x10b)][0x0];if(!_0x40b82d)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a26_0x34f809(0x118)](_0x4d185b){const _0x4b8888=a26_0x34f809,{options:_0x24bb1b,args:_0x3c52f5,tdx:_0x2f620e}=_0x4d185b,_0x406650=_0x3c52f5[0x0];if(!_0x24bb1b[_0x4b8888(0xbd)]){const _0x4352e0=await confirm(_0x4b8888(0xae)+_0x406650+'\x22?');if(!_0x4352e0)return console['error'](_0x4b8888(0x100)),0x0;}const _0x1eb14a=await withSpinner(_0x4b8888(0x103),()=>_0x2f620e[_0x4b8888(0xc4)][_0x4b8888(0xd9)](_0x406650),{'verbose':_0x24bb1b[_0x4b8888(0x108)]});return console['error'](_0x4b8888(0xfc)+_0x1eb14a[_0x4b8888(0xc8)][_0x4b8888(0x10e)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a26_0x34f809(0xdc);[a26_0x34f809(0x102)]=a26_0x34f809(0xf1);['validate'](_0x156d29){const _0x5a0c56=a26_0x34f809,_0x3d1c30=_0x156d29[_0x5a0c56(0x10b)][0x0];if(!_0x3d1c30)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async[a26_0x34f809(0x118)](_0x464f14){const _0xf8c49a=a26_0x34f809,{options:_0x31f572,args:_0x21b44d,tdx:_0xdd20bb}=_0x464f14,_0x382c64=_0x21b44d[0x0],_0x12c622=_0x31f572,_0x5af3ad=_0x12c622[_0xf8c49a(0xfa)],_0x3e6df0=_0x12c622[_0xf8c49a(0xe8)]!==undefined?Number(_0x12c622['num']):undefined;if(_0x31f572[_0xf8c49a(0x108)]){console[_0xf8c49a(0xb4)](_0xf8c49a(0x109)+_0x382c64);if(_0x5af3ad)console[_0xf8c49a(0xb4)](_0xf8c49a(0x10d)+_0x5af3ad);if(_0x3e6df0)console[_0xf8c49a(0xb4)](_0xf8c49a(0x10a)+_0x3e6df0);}const _0x282f07=await withSpinner(_0xf8c49a(0xe5),()=>_0xdd20bb['schedules']['run'](_0x382c64,{'time':_0x5af3ad,'num':_0x3e6df0}),{'verbose':_0x31f572[_0xf8c49a(0x108)]}),_0x3c261f=_0x282f07[_0xf8c49a(0xc8)][_0xf8c49a(0xb0)];console[_0xf8c49a(0xb4)]('Schedule\x20run\x20submitted:\x20'+_0x3c261f[_0xf8c49a(0xc9)]+_0xf8c49a(0x9a)+(_0x3c261f[_0xf8c49a(0xc9)]!==0x1?'s':'')+_0xf8c49a(0xe0));for(const _0x9297c5 of _0x3c261f){console[_0xf8c49a(0xb4)](_0xf8c49a(0xd5)+_0x9297c5['job_id']);}return await handleSDKOutput(_0x3c261f,_0x31f572),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x34f809(0x10e)]='schedule:history';[a26_0x34f809(0x102)]=a26_0x34f809(0xd8);['validate'](_0x363791){const _0x5793af=a26_0x34f809,_0x29f434=_0x363791[_0x5793af(0x10b)][0x0];if(!_0x29f434)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a26_0x34f809(0x118)](_0x4ec6c7){const _0x1ae665=a26_0x34f809,{options:_0x1ccb85,args:_0x236946,tdx:_0x508fcc}=_0x4ec6c7,_0x68ec85=_0x236946[0x0],_0x4e6086=_0x1ccb85,_0x5a6a44=_0x4e6086['from']!==undefined?Number(_0x4e6086[_0x1ae665(0x10c)]):undefined,_0x3182e1=_0x4e6086['to']!==undefined?Number(_0x4e6086['to']):undefined,_0x20e6d6=await withSpinner(_0x1ae665(0xe3),()=>_0x508fcc[_0x1ae665(0xc4)][_0x1ae665(0xba)](_0x68ec85,{'from':_0x5a6a44,'to':_0x3182e1}),{'verbose':_0x1ccb85[_0x1ae665(0x108)]}),_0x34deb4=_0x20e6d6[_0x1ae665(0xc8)];console[_0x1ae665(0xb4)](_0x1ae665(0x92)+_0x34deb4[_0x1ae665(0xed)]+'\x20execution'+(_0x34deb4['count']!==0x1?'s':'')+'\x20(showing\x20'+_0x34deb4['from']+'-'+_0x34deb4['to']+')');const _0x1b07d1=_0x34deb4[_0x1ae665(0xba)][_0x1ae665(0x90)](_0xc36685=>({'job_id':_0xc36685[_0x1ae665(0x106)],'type':_0xc36685[_0x1ae665(0x99)],'status':_0xc36685[_0x1ae665(0x9e)],'scheduled_at':_0xc36685[_0x1ae665(0xad)],'created_at':_0xc36685[_0x1ae665(0xf7)],'start_at':_0xc36685[_0x1ae665(0xb6)],'end_at':_0xc36685['end_at']}));return await handleSDKOutput(_0x1b07d1,_0x1ccb85),0x0;}}
@@ -1 +1 @@
1
- const a27_0x1e64ff=a27_0x1d66;(function(_0x258bf3,_0x158bf3){const _0x31ad0c=a27_0x1d66,_0x573158=_0x258bf3();while(!![]){try{const _0x1ec1d9=-parseInt(_0x31ad0c(0xf4))/0x1+-parseInt(_0x31ad0c(0x13f))/0x2+parseInt(_0x31ad0c(0x15a))/0x3*(parseInt(_0x31ad0c(0x154))/0x4)+parseInt(_0x31ad0c(0x100))/0x5+parseInt(_0x31ad0c(0xe6))/0x6+parseInt(_0x31ad0c(0x139))/0x7*(-parseInt(_0x31ad0c(0xfd))/0x8)+parseInt(_0x31ad0c(0x156))/0x9*(parseInt(_0x31ad0c(0xf6))/0xa);if(_0x1ec1d9===_0x158bf3)break;else _0x573158['push'](_0x573158['shift']());}catch(_0x210d4e){_0x573158['push'](_0x573158['shift']());}}}(a27_0x3b2e,0xc9822));import{BaseCommand}from'./command.js';function a27_0x3b2e(){const _0x1f0549=['Resolved\x20folder\x20ID:\x20','Resolving\x20parent\x20folder\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Resolving\x20parent\x20segment\x20\x27','Resolved\x20YAML\x20file:\x20','Use:\x20tdx\x20ps\x20view','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Parent\x20name:\x20','2321772bEfhkx','resolvePathToResource','parentFolder','resolveFolderId','Get\x20SQL\x20query\x20for\x20child\x20segment','segment:desc','Fetching\x20folder\x20details...','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','error','jobId','Parent\x20segment:\x20','parentId','folder','421171vrPNGN','βœ”\x20Query\x20completed:\x20Processed\x20','10SwlRyo','cause','toLocaleString','\x20\x20Cause:\x20','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','βœ”\x20Found\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','3488nAInLI','segment:folder:list','information_schema','6151970PmcvkI','elapsedTimeMillis','Fetching\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','format','\x20\x20Full\x20path:\x20','includes','description','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','query','Segment\x20ID:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Resolved\x20parent\x20folder\x20ID:\x20','url','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','type','Folder\x20ID:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:folder:show','getParent','length','SEGMENT_FOLDER_NOT_FOUND','Creating\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','SQL\x20query:\x0a','jsonl','Examples:','Parent\x20ID:\x20','stats','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','parentSegment','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','/app/ps/','name','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Show\x20segment\x20folder\x20details','getSegmentSQL','βœ”\x20Created\x20folder\x20\x27','resolveParentId','(root)','data','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','/e/','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','json','Error:\x20Path\x20or\x20name\x20is\x20required','setJobId','segment:sql','verbose','Fetching\x20parent\x20segment\x20details...','segment:describe','20482whuvnp','Options:','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','848308zmoOzv','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20','Site:\x20','test','listFolders','segmentId','Create\x20segment\x20folder\x20for\x20organization','parent','Fetching\x20segment\x20details...','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Usage:\x20tdx\x20sg\x20desc\x20<name>','segmentPath','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','segment:folder:create','segmentName','in\x20','green','\x27...','\x20\x20Parent\x20segment:\x20','39864FyevLp','log','9181233xZckdp','createFolder','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolved\x20parent\x20ID:\x20','93DrvAgz','Target\x20path:\x20','Folder\x20name:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','trim','Error:\x20Parent\x20segment\x20name\x20is\x20required','web','Listing\x20folders\x20for\x20parent\x20\x27','Resolving\x20\x27','fullPath','Show\x20child\x20segment\x20schema\x20(column\x20types)','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolving\x20path\x20\x27','execute','\x20Opening\x20','site','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','getFolder','segment:show','Segment\x20ID\x20missing\x20from\x20resolved\x20path','replace','SEGMENT_NOT_FOUND','folderId','message','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','segment','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x27\x20with\x20ID:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','getSegment','\x20\x20Folder\x20path:\x20','INVALID_ARGUMENT'];a27_0x3b2e=function(){return _0x1f0549;};return a27_0x3b2e();}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 a27_0x38db4b from'chalk';function a27_0x1d66(_0x211709,_0x5827df){_0x211709=_0x211709-0xdc;const _0x3b2e5a=a27_0x3b2e();let _0x1d6634=_0x3b2e5a[_0x211709];return _0x1d6634;}async function resolveSegmentTarget(_0x23e51b,_0xb8df85,_0x53d3c3){const _0x11e167=a27_0x1d66;if(isYamlFilePath(_0x23e51b))try{const _0x604437=await resolveYamlFilePath(_0x23e51b);return _0x53d3c3&&(console[_0x11e167(0xef)](_0x11e167(0xe2)+_0x23e51b),console[_0x11e167(0xef)](_0x11e167(0x153)+_0x604437['parentSegment']),console[_0x11e167(0xef)]('\x20\x20Segment\x20name:\x20'+_0x604437[_0x11e167(0x14f)]),console[_0x11e167(0xef)](_0x11e167(0xdc)+(_0x604437['folderPath']||_0x11e167(0x12d))),console[_0x11e167(0xef)](_0x11e167(0x107)+_0x604437[_0x11e167(0x164)])),_0x604437[_0x11e167(0x164)];}catch(_0x50dd15){throw new SDKError(ErrorCode[_0x11e167(0xdd)],_0x11e167(0xee)+_0x50dd15[_0x11e167(0x172)]);}if(!_0xb8df85)throw new SDKError(ErrorCode[_0x11e167(0xdd)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0xb8df85+'/'+_0x23e51b;}export class SegmentDescribeCommand extends BaseCommand{['name']=a27_0x1e64ff(0x138);[a27_0x1e64ff(0x109)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x1e64ff(0x168)](_0x4974cf){const _0x18da57=a27_0x1e64ff,{options:_0x1c3d6b,args:_0xc6ecb1,tdx:_0x2e6693}=_0x4974cf,_0x46a9dd=_0xc6ecb1[0x0],_0x29959c=!_0x46a9dd&&!!_0x1c3d6b['parentSegment'],_0x1519fb=_0x46a9dd||_0x1c3d6b[_0x18da57(0x123)];if(!_0x1519fb)return console[_0x18da57(0xef)](_0x18da57(0x133)),console[_0x18da57(0xef)](_0x18da57(0x166)),console[_0x18da57(0xef)](_0x18da57(0x11e)),console[_0x18da57(0xef)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x18da57(0xef)](_0x18da57(0x16b)),console['error'](_0x18da57(0x149)),console[_0x18da57(0xef)](_0x18da57(0x128)),0x1;try{const _0x20a9cd=_0x1c3d6b[_0x18da57(0x14b)];let _0x7669dd=_0x1519fb;!_0x29959c&&_0x20a9cd&&!_0x1519fb[_0x18da57(0x108)]('/')&&(_0x7669dd=_0x20a9cd+'/'+_0x1519fb,_0x1c3d6b[_0x18da57(0x136)]&&console[_0x18da57(0xef)]('Resolved\x20relative\x20path\x20to:\x20'+_0x7669dd));const _0x51a897=await withSpinner(_0x18da57(0x167)+_0x7669dd+_0x18da57(0x152),()=>_0x2e6693['segment'][_0x18da57(0xe7)](_0x7669dd),{'verbose':_0x1c3d6b[_0x18da57(0x136)]}),_0x38ab3e=_0x51a897[_0x18da57(0x12e)];_0x1c3d6b['verbose']&&(console[_0x18da57(0xef)]('Resolved\x20type:\x20'+_0x38ab3e[_0x18da57(0x112)]),console[_0x18da57(0xef)](_0x18da57(0x11f)+_0x38ab3e[_0x18da57(0xf2)]),_0x38ab3e[_0x18da57(0x171)]&&console[_0x18da57(0xef)]('Folder\x20ID:\x20'+_0x38ab3e['folderId']),_0x38ab3e[_0x18da57(0x145)]&&console[_0x18da57(0xef)]('Segment\x20ID:\x20'+_0x38ab3e['segmentId']));if(_0x38ab3e[_0x18da57(0x112)]===_0x18da57(0x147)){const _0x2c4df6=await withSpinner(_0x18da57(0x137),()=>_0x2e6693[_0x18da57(0x174)][_0x18da57(0x116)](_0x38ab3e[_0x18da57(0xf2)]),{'verbose':_0x1c3d6b[_0x18da57(0x136)]});await handleSingleObjectOutput(_0x2c4df6['data'],_0x1c3d6b);}else{if(_0x38ab3e[_0x18da57(0x112)]===_0x18da57(0xf3)){if(!_0x38ab3e[_0x18da57(0x171)])throw new SDKError(ErrorCode[_0x18da57(0x118)],_0x18da57(0xfc));const _0xd5818d=await withSpinner(_0x18da57(0xec),()=>_0x2e6693[_0x18da57(0x174)]['getFolder'](_0x38ab3e[_0x18da57(0x171)]),{'verbose':_0x1c3d6b['verbose']});await handleSingleObjectOutput(_0xd5818d[_0x18da57(0x12e)],_0x1c3d6b);}else{if(_0x38ab3e[_0x18da57(0x112)]===_0x18da57(0x174)){if(!_0x38ab3e[_0x18da57(0x145)])throw new SDKError(ErrorCode[_0x18da57(0x170)],_0x18da57(0x16e));const _0x4d5a8c=await withSpinner(_0x18da57(0x148),()=>_0x2e6693[_0x18da57(0x174)]['getSegment'](_0x38ab3e[_0x18da57(0xf2)],_0x38ab3e['segmentId']),{'verbose':_0x1c3d6b[_0x18da57(0x136)]});await handleSingleObjectOutput(_0x4d5a8c[_0x18da57(0x12e)],_0x1c3d6b);}}}return 0x0;}catch(_0x315322){if(_0x315322 instanceof SDKError)return console[_0x18da57(0xef)](_0x18da57(0x141)+_0x315322[_0x18da57(0x172)]),_0x315322[_0x18da57(0xf7)]&&console[_0x18da57(0xef)]('\x20\x20Cause:\x20'+_0x315322[_0x18da57(0xf7)]),0x1;throw _0x315322;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x1e64ff(0x127)]=a27_0x1e64ff(0x16d);[a27_0x1e64ff(0x109)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x1e64ff(0x168)](_0xe4401){const _0x2323b7=a27_0x1e64ff,{options:_0x1b7514,args:_0x31893e,tdx:_0xa5133f}=_0xe4401,_0x35a658=_0x31893e[0x0];if(!_0x35a658)return console[_0x2323b7(0xef)](_0x2323b7(0x15d)),console['error']('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x2323b7(0xef)](_0x2323b7(0x103)),console['error'](_0x2323b7(0x11e)),console[_0x2323b7(0xef)](_0x2323b7(0x140)),console['error'](_0x2323b7(0x15e)),0x1;try{const _0x48eaf2=_0x1b7514['parentSegment'],_0x16f6f5=await resolveSegmentTarget(_0x35a658,_0x48eaf2,_0x1b7514[_0x2323b7(0x136)]);_0x1b7514[_0x2323b7(0x136)]&&console[_0x2323b7(0xef)](_0x2323b7(0x15b)+_0x16f6f5);const _0x3bf2db=await withSpinner(_0x2323b7(0x163)+_0x35a658+_0x2323b7(0x152),()=>_0xa5133f[_0x2323b7(0x174)][_0x2323b7(0xe7)](_0x16f6f5),{'verbose':_0x1b7514['verbose']}),_0xf76c64=_0x3bf2db[_0x2323b7(0x12e)];_0x1b7514[_0x2323b7(0x136)]&&(console[_0x2323b7(0xef)](_0x2323b7(0x124)+_0xf76c64[_0x2323b7(0x112)]),console[_0x2323b7(0xef)]('Parent\x20ID:\x20'+_0xf76c64[_0x2323b7(0xf2)]));if(_0xf76c64['type']==='folder')return console[_0x2323b7(0xef)](_0x2323b7(0x111)),console[_0x2323b7(0xef)](_0x2323b7(0x10e)),0x1;if(_0xf76c64[_0x2323b7(0x112)]==='parent')return console[_0x2323b7(0xef)](_0x2323b7(0x14d)),console[_0x2323b7(0xef)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0xf76c64[_0x2323b7(0x145)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2323b7(0x16e));const _0x4d237d=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0xa5133f['segment'][_0x2323b7(0x12a)](_0xf76c64[_0x2323b7(0xf2)],_0xf76c64[_0x2323b7(0x145)]),{'verbose':_0x1b7514[_0x2323b7(0x136)]});let _0x4def51=_0x4d237d['data'];const _0x9cd9d6=resolveLimit(_0x1b7514['limit'],DEFAULT_DISPLAY_LIMIT),_0x341d09=/\bLIMIT\s+\d+/i[_0x2323b7(0x143)](_0x4def51);!_0x341d09&&(_0x4def51=_0x4def51[_0x2323b7(0x15f)]()[_0x2323b7(0x16f)](/;+$/,''),_0x4def51='SELECT\x20*\x20FROM\x20(\x0a'+_0x4def51+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x9cd9d6);_0x1b7514['verbose']&&console[_0x2323b7(0xef)](_0x2323b7(0x11c)+_0x4def51);const _0x385ed9=await withProgressSpinner('Executing\x20segment\x20query...',async _0x55f0a0=>{const _0x14c9ae=_0x2323b7,_0x472008=await _0xa5133f[_0x14c9ae(0x10c)]['execute'](_0x4def51,{'catalog':'td','schema':_0x14c9ae(0xff),'onJobId':_0x5a6ef1=>{const _0x288e5d=_0x14c9ae;_0x55f0a0[_0x288e5d(0x134)](_0x5a6ef1);}});return _0x472008;},{'verbose':_0x1b7514['verbose']}),_0x4e5d19=_0x385ed9['data'],_0x3d2b65=_0x4e5d19[_0x2323b7(0xf0)]?'\x20[Job\x20ID:\x20'+_0x4e5d19[_0x2323b7(0xf0)]+']':'';return console[_0x2323b7(0xef)](_0x2323b7(0xf5)+_0x4e5d19[_0x2323b7(0x120)]['processedRows'][_0x2323b7(0xf8)]()+'\x20rows\x20'+(_0x2323b7(0x150)+formatElapsed(_0x4e5d19[_0x2323b7(0x120)][_0x2323b7(0x101)])+_0x3d2b65)),await handleQueryOutput(_0x4e5d19,_0x1b7514),0x0;}catch(_0x44c7c7){if(_0x44c7c7 instanceof SDKError)return console[_0x2323b7(0xef)]('βœ–\x20Query\x20failed\x20['+_0x44c7c7['code']+']'),console['error']('\x0a'+_0x44c7c7['message']),0x1;throw _0x44c7c7;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x1e64ff(0xfe);[a27_0x1e64ff(0x109)]=a27_0x1e64ff(0x10b);async[a27_0x1e64ff(0x168)](_0x446154){const _0x14197e=a27_0x1e64ff,{options:_0x106cf,args:_0x4b4b97,tdx:_0x54fd0c}=_0x446154;if(_0x4b4b97[_0x14197e(0x117)]===0x0)return console[_0x14197e(0xef)](_0x14197e(0x160)),console[_0x14197e(0xef)](_0x14197e(0x11a)),0x1;const _0x502ed7=_0x4b4b97[0x0];try{_0x106cf['verbose']&&(console[_0x14197e(0xef)](_0x14197e(0x142)+_0x106cf['site']),console[_0x14197e(0xef)](_0x14197e(0xe5)+_0x502ed7));const _0x46a9e1=await withSpinner(_0x14197e(0xe1)+_0x502ed7+'\x27...',()=>_0x54fd0c[_0x14197e(0x174)][_0x14197e(0x12c)](_0x502ed7),{'verbose':_0x106cf[_0x14197e(0x136)]}),_0x331abd=_0x46a9e1['data'];_0x106cf['verbose']&&console['error'](_0x14197e(0x159)+_0x331abd);const _0x2370dc=await withSpinner(_0x14197e(0x162)+_0x502ed7+_0x14197e(0x152),()=>_0x54fd0c[_0x14197e(0x174)][_0x14197e(0x144)](_0x331abd),{'verbose':_0x106cf[_0x14197e(0x136)]}),_0xc9c48e=_0x2370dc[_0x14197e(0x12e)];return console[_0x14197e(0xef)](_0x14197e(0xfb)+_0xc9c48e[_0x14197e(0x117)]+'\x20folder'+(_0xc9c48e[_0x14197e(0x117)]!==0x1?'s':'')),await handleSDKOutput(_0xc9c48e,_0x106cf),0x0;}catch(_0x247818){if(_0x247818 instanceof SDKError)return console[_0x14197e(0xef)]('Error:\x20'+_0x247818[_0x14197e(0x172)]),_0x247818[_0x14197e(0xf7)]&&console[_0x14197e(0xef)](_0x14197e(0xf9)+_0x247818[_0x14197e(0xf7)]),0x1;throw _0x247818;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x1e64ff(0x127)]=a27_0x1e64ff(0x115);[a27_0x1e64ff(0x109)]=a27_0x1e64ff(0x129);async[a27_0x1e64ff(0x168)](_0x564871){const _0xdcff5e=a27_0x1e64ff,{options:_0x5d23da,args:_0x2616af,tdx:_0x4be176}=_0x564871;if(_0x2616af[_0xdcff5e(0x117)]===0x0)return console[_0xdcff5e(0xef)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0xdcff5e(0xef)](_0xdcff5e(0x12f)),0x1;try{const {parentId:_0x46dd57,childId:_0x7592e5}=parseSegmentRef(_0x2616af[0x0]);_0x5d23da[_0xdcff5e(0x136)]&&(console[_0xdcff5e(0xef)](_0xdcff5e(0x142)+_0x5d23da['site']),console[_0xdcff5e(0xef)](_0xdcff5e(0xe5)+_0x46dd57),_0x7592e5&&console['error']('Folder\x20name:\x20'+_0x7592e5));if(!_0x7592e5)return console['error'](_0xdcff5e(0x114)),0x1;const _0x36f929=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x46dd57+_0xdcff5e(0x152),()=>_0x4be176[_0xdcff5e(0x174)][_0xdcff5e(0x12c)](_0x46dd57),{'verbose':_0x5d23da['verbose']}),_0x5d6ae3=_0x36f929['data'];_0x5d23da[_0xdcff5e(0x136)]&&console['error'](_0xdcff5e(0x159)+_0x5d6ae3);const _0x58e4d1=await withSpinner('Resolving\x20folder\x20\x27'+_0x7592e5+'\x27...',()=>_0x4be176[_0xdcff5e(0x174)][_0xdcff5e(0xe9)](_0x5d6ae3,_0x7592e5),{'verbose':_0x5d23da[_0xdcff5e(0x136)]}),_0x24cc9e=_0x58e4d1[_0xdcff5e(0x12e)];_0x5d23da[_0xdcff5e(0x136)]&&console[_0xdcff5e(0xef)](_0xdcff5e(0xde)+_0x24cc9e);const _0x40bd9c=await withSpinner(_0xdcff5e(0x102)+_0x7592e5+_0xdcff5e(0x152),()=>_0x4be176['segment']['getFolder'](_0x24cc9e),{'verbose':_0x5d23da[_0xdcff5e(0x136)]});return await handleSDKOutput([_0x40bd9c['data']],_0x5d23da),0x0;}catch(_0x5c2ac3){if(_0x5c2ac3 instanceof SDKError)return console[_0xdcff5e(0xef)](_0xdcff5e(0x141)+_0x5c2ac3['message']),_0x5c2ac3['cause']&&console[_0xdcff5e(0xef)](_0xdcff5e(0xf9)+_0x5c2ac3['cause']),0x1;throw _0x5c2ac3;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x1e64ff(0x135);[a27_0x1e64ff(0x109)]=a27_0x1e64ff(0xea);async[a27_0x1e64ff(0x168)](_0x521e8f){const _0x20e152=a27_0x1e64ff,{options:_0x26c543,args:_0xa6b8b1,tdx:_0x4593f7}=_0x521e8f,_0x1dc79a=_0xa6b8b1[0x0];if(!_0x1dc79a)return console[_0x20e152(0xef)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x20e152(0x13e)),console['error'](_0x20e152(0x11e)),console[_0x20e152(0xef)](_0x20e152(0x11b)),console['error'](_0x20e152(0x175)),0x1;try{const _0x5e0327=_0x26c543['parentSegment'],_0xa1367f=await resolveSegmentTarget(_0x1dc79a,_0x5e0327,_0x26c543['verbose']);_0x26c543[_0x20e152(0x136)]&&console[_0x20e152(0xef)](_0x20e152(0x15b)+_0xa1367f);const _0x5e54dc=await withSpinner(_0x20e152(0x163)+_0x1dc79a+'\x27...',()=>_0x4593f7['segment'][_0x20e152(0xe7)](_0xa1367f),{'verbose':_0x26c543['verbose']}),_0x178225=_0x5e54dc['data'];_0x26c543[_0x20e152(0x136)]&&(console['error'](_0x20e152(0x124)+_0x178225[_0x20e152(0x112)]),console[_0x20e152(0xef)]('Parent\x20ID:\x20'+_0x178225[_0x20e152(0xf2)]));if(_0x178225[_0x20e152(0x112)]==='folder')return console[_0x20e152(0xef)](_0x20e152(0x158)),console['error'](_0x20e152(0xe0)),0x1;if(_0x178225[_0x20e152(0x112)]==='parent')return console[_0x20e152(0xef)](_0x20e152(0x178)),console[_0x20e152(0xef)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x178225[_0x20e152(0x145)])throw new SDKError(ErrorCode[_0x20e152(0x170)],_0x20e152(0x16e));const _0x561da4=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x4593f7[_0x20e152(0x174)][_0x20e152(0x12a)](_0x178225[_0x20e152(0xf2)],_0x178225[_0x20e152(0x145)]),{'verbose':_0x26c543[_0x20e152(0x136)]}),_0x6f85f6=_0x561da4[_0x20e152(0x12e)];return _0x26c543[_0x20e152(0x106)]===_0x20e152(0x132)||_0x26c543[_0x20e152(0x106)]===_0x20e152(0x11d)?await handleSDKOutput([{'sql':_0x6f85f6}],_0x26c543):console[_0x20e152(0x155)](_0x6f85f6),0x0;}catch(_0x290690){if(_0x290690 instanceof SDKError)return console[_0x20e152(0xef)](_0x20e152(0x141)+_0x290690['message']),_0x290690[_0x20e152(0xf7)]&&console['error']('\x20\x20Cause:\x20'+_0x290690[_0x20e152(0xf7)]),0x1;throw _0x290690;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a27_0x1e64ff(0x14e);['description']=a27_0x1e64ff(0x146);async[a27_0x1e64ff(0x168)](_0x4a1e78){const _0x50527d=a27_0x1e64ff,{options:_0x38a12b,args:_0x26e85c,tdx:_0x5ed12e}=_0x4a1e78,_0x2b73ac=_0x38a12b;if(_0x26e85c[_0x50527d(0x117)]<0x2)return console[_0x50527d(0xef)](_0x50527d(0x173)),console['error'](_0x50527d(0xe4)),0x1;const _0x9c2a7c=_0x26e85c[0x0],_0x42cf89=_0x26e85c[0x1];_0x2b73ac['verbose']&&(console['error'](_0x50527d(0x142)+_0x2b73ac[_0x50527d(0x16a)]),console['error'](_0x50527d(0xf1)+_0x9c2a7c),console[_0x50527d(0xef)](_0x50527d(0x15c)+_0x42cf89));let _0x57ed41;if(_0x2b73ac[_0x50527d(0xe8)]){const _0x1b7e96=_0x2b73ac['parentFolder'],_0x15267f=await withSpinner(_0x50527d(0xe1)+_0x9c2a7c+_0x50527d(0x152),()=>_0x5ed12e[_0x50527d(0x174)][_0x50527d(0x12c)](_0x9c2a7c),{'verbose':_0x2b73ac['verbose']}),_0x20d8de=_0x15267f[_0x50527d(0x12e)],_0x1a0b94=await withSpinner(_0x50527d(0xdf)+_0x1b7e96+_0x50527d(0x152),()=>_0x5ed12e[_0x50527d(0x174)][_0x50527d(0xe9)](_0x20d8de,_0x1b7e96),{'verbose':_0x2b73ac[_0x50527d(0x136)]});_0x57ed41=_0x1a0b94['data'],_0x2b73ac[_0x50527d(0x136)]&&console[_0x50527d(0xef)](_0x50527d(0x10f)+_0x57ed41);}const _0xc940c2={'name':_0x42cf89,'description':_0x2b73ac[_0x50527d(0x109)],'parentFolderId':_0x57ed41},_0x4908e8=await withSpinner(_0x50527d(0x119)+_0x42cf89+_0x50527d(0x152),()=>_0x5ed12e['segment'][_0x50527d(0x157)](_0x9c2a7c,_0xc940c2),{'verbose':_0x2b73ac[_0x50527d(0x136)]}),_0x2410fd=_0x4908e8[_0x50527d(0x12e)];return console[_0x50527d(0xef)](_0x50527d(0x12b)+_0x2410fd[_0x50527d(0x127)]+_0x50527d(0x176)+_0x2410fd['id']),await handleSDKOutput([_0x2410fd],_0x2b73ac),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x1e64ff(0x127)]='segment:view';['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x485e77){const _0x4f3253=a27_0x1e64ff,{options:_0x3e52e2,args:_0x138a4a,tdx:_0x46a5f5}=_0x485e77,_0x49ca45=_0x138a4a[0x0];if(!_0x49ca45)return console['error'](_0x4f3253(0x13c)),console['error'](_0x4f3253(0x13b)),console[_0x4f3253(0xef)](_0x4f3253(0x122)),console[_0x4f3253(0xef)](_0x4f3253(0x13a)),console[_0x4f3253(0xef)](_0x4f3253(0x177)),console['error'](_0x4f3253(0x11e)),console[_0x4f3253(0xef)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error'](_0x4f3253(0x10a)),console[_0x4f3253(0xef)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x4f3253(0xef)](_0x4f3253(0x104)),0x1;try{const _0x5dd10d=_0x3e52e2[_0x4f3253(0x123)],_0x514ff4=await resolveSegmentTarget(_0x49ca45,_0x5dd10d,_0x3e52e2[_0x4f3253(0x136)]);_0x3e52e2['verbose']&&console[_0x4f3253(0xef)]('Target\x20path:\x20'+_0x514ff4);const _0x3e8142=await withSpinner('Resolving\x20\x27'+_0x49ca45+_0x4f3253(0x152),()=>_0x46a5f5['segment']['resolvePathToResource'](_0x514ff4),{'verbose':_0x3e52e2[_0x4f3253(0x136)]}),_0x35a519=_0x3e8142[_0x4f3253(0x12e)];_0x3e52e2[_0x4f3253(0x136)]&&(console['error']('Resolved\x20type:\x20'+_0x35a519[_0x4f3253(0x112)]),console[_0x4f3253(0xef)](_0x4f3253(0x11f)+_0x35a519[_0x4f3253(0xf2)]),_0x35a519[_0x4f3253(0x171)]&&console['error'](_0x4f3253(0x113)+_0x35a519[_0x4f3253(0x171)]),_0x35a519['segmentId']&&console['error'](_0x4f3253(0x10d)+_0x35a519[_0x4f3253(0x145)]));if(_0x3e52e2[_0x4f3253(0x161)]){if(_0x35a519[_0x4f3253(0x112)]===_0x4f3253(0xf3))return console[_0x4f3253(0xef)](_0x4f3253(0x14c)),0x1;if(_0x35a519[_0x4f3253(0x112)]===_0x4f3253(0x147))return console[_0x4f3253(0xef)](_0x4f3253(0x13d)),console[_0x4f3253(0xef)](_0x4f3253(0x121)),0x1;if(!_0x35a519[_0x4f3253(0x145)])throw new SDKError(ErrorCode[_0x4f3253(0x170)],_0x4f3253(0x16e));const _0x179760=getConsoleNextUrl(_0x3e52e2[_0x4f3253(0x16a)],_0x4f3253(0x126)+_0x35a519[_0x4f3253(0xf2)]+'/e/'+_0x35a519[_0x4f3253(0x145)]);return console['error'](a27_0x38db4b[_0x4f3253(0x151)]('βœ”')+_0x4f3253(0x169)+a27_0x38db4b['cyan'](_0x179760)),openBrowser(_0x179760),0x0;}if(_0x35a519['type']===_0x4f3253(0xf3)){if(!_0x35a519[_0x4f3253(0x171)])throw new SDKError(ErrorCode[_0x4f3253(0x118)],_0x4f3253(0xfc));const _0x3c6d8b=await withSpinner(_0x4f3253(0xec),()=>_0x46a5f5[_0x4f3253(0x174)][_0x4f3253(0x16c)](_0x35a519[_0x4f3253(0x171)]),{'verbose':_0x3e52e2['verbose']});await handleSingleObjectOutput(_0x3c6d8b[_0x4f3253(0x12e)],_0x3e52e2);}else{if(_0x35a519['type']===_0x4f3253(0x174)){if(!_0x35a519[_0x4f3253(0x145)])throw new SDKError(ErrorCode[_0x4f3253(0x170)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x422c8b=await withSpinner(_0x4f3253(0x148),()=>_0x46a5f5[_0x4f3253(0x174)][_0x4f3253(0x179)](_0x35a519['parentId'],_0x35a519[_0x4f3253(0x145)]),{'verbose':_0x3e52e2[_0x4f3253(0x136)]}),_0x592510=getConsoleNextUrl(_0x3e52e2['site'],_0x4f3253(0x126)+_0x35a519[_0x4f3253(0xf2)]+_0x4f3253(0x130)+_0x35a519[_0x4f3253(0x145)]),_0x46d4e5=_0x422c8b[_0x4f3253(0x12e)];_0x46d4e5[_0x4f3253(0x110)]=_0x592510,await handleSingleObjectOutput(_0x46d4e5,_0x3e52e2);}else return console['error'](_0x4f3253(0x131)),console[_0x4f3253(0xef)](_0x4f3253(0xe3)),0x1;}return 0x0;}catch(_0x39ec8d){if(_0x39ec8d instanceof SDKError)return console[_0x4f3253(0xef)](_0x4f3253(0x141)+_0x39ec8d[_0x4f3253(0x172)]),_0x39ec8d[_0x4f3253(0xf7)]&&console[_0x4f3253(0xef)](_0x4f3253(0xf9)+_0x39ec8d['cause']),0x1;throw _0x39ec8d;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x1e64ff(0x127)]=a27_0x1e64ff(0xeb);[a27_0x1e64ff(0x109)]=a27_0x1e64ff(0x165);async[a27_0x1e64ff(0x168)](_0x699495){const _0x363d9a=a27_0x1e64ff,{options:_0x364219,args:_0x2dce47,tdx:_0x40017d}=_0x699495,_0x875057=_0x2dce47[0x0];if(!_0x875057)return console[_0x363d9a(0xef)](_0x363d9a(0x15d)),console[_0x363d9a(0xef)](_0x363d9a(0x14a)),console[_0x363d9a(0xef)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x363d9a(0xef)]('Examples:'),console[_0x363d9a(0xef)](_0x363d9a(0xfa)),console[_0x363d9a(0xef)](_0x363d9a(0x125)),0x1;try{const _0x207cad=_0x364219[_0x363d9a(0x123)],_0x280447=await resolveSegmentTarget(_0x875057,_0x207cad,_0x364219[_0x363d9a(0x136)]);_0x364219[_0x363d9a(0x136)]&&console[_0x363d9a(0xef)](_0x363d9a(0x15b)+_0x280447);const _0x20a2cc=await withSpinner(_0x363d9a(0x163)+_0x875057+'\x27...',()=>_0x40017d[_0x363d9a(0x174)][_0x363d9a(0xe7)](_0x280447),{'verbose':_0x364219[_0x363d9a(0x136)]}),_0x4509d6=_0x20a2cc[_0x363d9a(0x12e)];_0x364219[_0x363d9a(0x136)]&&(console['error']('Resolved\x20type:\x20'+_0x4509d6[_0x363d9a(0x112)]),console[_0x363d9a(0xef)](_0x363d9a(0x11f)+_0x4509d6[_0x363d9a(0xf2)]));if(_0x4509d6['type']==='folder')return console[_0x363d9a(0xef)](_0x363d9a(0xed)),console[_0x363d9a(0xef)](_0x363d9a(0xe0)),0x1;if(_0x4509d6[_0x363d9a(0x112)]===_0x363d9a(0x147))return console['error'](_0x363d9a(0x105)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x4509d6[_0x363d9a(0x145)])throw new SDKError(ErrorCode[_0x363d9a(0x170)],_0x363d9a(0x16e));const _0x455289=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x40017d[_0x363d9a(0x174)]['getSegmentSQL'](_0x4509d6[_0x363d9a(0xf2)],_0x4509d6[_0x363d9a(0x145)]),{'verbose':_0x364219['verbose']}),_0x21b0dd=_0x455289[_0x363d9a(0x12e)],_0x3aafb5=await executeSchemaQuery(_0x21b0dd,_0x40017d,_0x364219);return await handleQueryOutput(_0x3aafb5,_0x364219),0x0;}catch(_0x419d48){if(_0x419d48 instanceof SDKError)return console['error'](_0x363d9a(0x141)+_0x419d48[_0x363d9a(0x172)]),_0x419d48['cause']&&console[_0x363d9a(0xef)](_0x363d9a(0xf9)+_0x419d48[_0x363d9a(0xf7)]),0x1;throw _0x419d48;}}}
1
+ const a27_0x51d0c2=a27_0xea12;(function(_0x4c8ce4,_0x5d9496){const _0x104b99=a27_0xea12,_0x286f47=_0x4c8ce4();while(!![]){try{const _0x7e9fbd=-parseInt(_0x104b99(0x200))/0x1*(-parseInt(_0x104b99(0x17d))/0x2)+-parseInt(_0x104b99(0x18d))/0x3*(-parseInt(_0x104b99(0x1ef))/0x4)+-parseInt(_0x104b99(0x1f3))/0x5*(parseInt(_0x104b99(0x1a7))/0x6)+-parseInt(_0x104b99(0x1ea))/0x7*(parseInt(_0x104b99(0x1c6))/0x8)+-parseInt(_0x104b99(0x1df))/0x9*(parseInt(_0x104b99(0x1c9))/0xa)+-parseInt(_0x104b99(0x1f2))/0xb*(parseInt(_0x104b99(0x1d3))/0xc)+-parseInt(_0x104b99(0x17c))/0xd*(-parseInt(_0x104b99(0x1f6))/0xe);if(_0x7e9fbd===_0x5d9496)break;else _0x286f47['push'](_0x286f47['shift']());}catch(_0x4881cc){_0x286f47['push'](_0x286f47['shift']());}}}(a27_0x46c1,0xded2f));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';function a27_0xea12(_0x9b02df,_0x5eb5e1){_0x9b02df=_0x9b02df-0x171;const _0x46c17a=a27_0x46c1();let _0xea1293=_0x46c17a[_0x9b02df];return _0xea1293;}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 a27_0x25ee13 from'chalk';async function resolveSegmentTarget(_0xc2816,_0x1d5649,_0x2a52fb){const _0x364c6c=a27_0xea12;if(isYamlFilePath(_0xc2816))try{const _0x54c037=await resolveYamlFilePath(_0xc2816);return _0x2a52fb&&(console[_0x364c6c(0x175)](_0x364c6c(0x1e0)+_0xc2816),console[_0x364c6c(0x175)](_0x364c6c(0x1de)+_0x54c037[_0x364c6c(0x17e)]),console[_0x364c6c(0x175)](_0x364c6c(0x19c)+_0x54c037[_0x364c6c(0x195)]),console[_0x364c6c(0x175)](_0x364c6c(0x1a5)+(_0x54c037[_0x364c6c(0x1a3)]||_0x364c6c(0x1f0))),console[_0x364c6c(0x175)](_0x364c6c(0x1fb)+_0x54c037['fullPath'])),_0x54c037[_0x364c6c(0x1ce)];}catch(_0x39fcf1){throw new SDKError(ErrorCode[_0x364c6c(0x1bf)],_0x364c6c(0x176)+_0x39fcf1[_0x364c6c(0x190)]);}if(!_0x1d5649)throw new SDKError(ErrorCode[_0x364c6c(0x1bf)],_0x364c6c(0x172));return _0x1d5649+'/'+_0xc2816;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x51d0c2(0x202)]=a27_0x51d0c2(0x1c1);['description']=a27_0x51d0c2(0x17a);async['execute'](_0x325479){const _0x4f0061=a27_0x51d0c2,{options:_0x20a504,args:_0x4a76c2,tdx:_0x833fb}=_0x325479,_0x21c069=_0x4a76c2[0x0],_0x349f7a=!_0x21c069&&!!_0x20a504[_0x4f0061(0x17e)],_0x17fa98=_0x21c069||_0x20a504[_0x4f0061(0x17e)];if(!_0x17fa98)return console[_0x4f0061(0x175)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x4f0061(0x175)](_0x4f0061(0x1e8)),console[_0x4f0061(0x175)](_0x4f0061(0x1ec)),console[_0x4f0061(0x175)](_0x4f0061(0x1ad)),console[_0x4f0061(0x175)](_0x4f0061(0x1d4)),console[_0x4f0061(0x175)](_0x4f0061(0x1c0)),console[_0x4f0061(0x175)](_0x4f0061(0x194)),0x1;try{const _0x54be05=_0x20a504['segmentPath'];let _0x583635=_0x17fa98;!_0x349f7a&&_0x54be05&&!_0x17fa98[_0x4f0061(0x201)]('/')&&(_0x583635=_0x54be05+'/'+_0x17fa98,_0x20a504[_0x4f0061(0x18b)]&&console[_0x4f0061(0x175)]('Resolved\x20relative\x20path\x20to:\x20'+_0x583635));const _0x1ce698=await withSpinner(_0x4f0061(0x1b5)+_0x583635+_0x4f0061(0x1d7),()=>_0x833fb[_0x4f0061(0x1b9)][_0x4f0061(0x1bb)](_0x583635),{'verbose':_0x20a504[_0x4f0061(0x18b)]}),_0x1b3909=_0x1ce698[_0x4f0061(0x1e7)];_0x20a504['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x1b3909['type']),console[_0x4f0061(0x175)](_0x4f0061(0x1bc)+_0x1b3909[_0x4f0061(0x1d9)]),_0x1b3909[_0x4f0061(0x19a)]&&console[_0x4f0061(0x175)]('Folder\x20ID:\x20'+_0x1b3909[_0x4f0061(0x19a)]),_0x1b3909['segmentId']&&console[_0x4f0061(0x175)](_0x4f0061(0x209)+_0x1b3909[_0x4f0061(0x181)]));if(_0x1b3909['type']===_0x4f0061(0x19f)){const _0x3da2ee=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x833fb[_0x4f0061(0x1b9)][_0x4f0061(0x204)](_0x1b3909[_0x4f0061(0x1d9)]),{'verbose':_0x20a504[_0x4f0061(0x18b)]});await handleSingleObjectOutput(_0x3da2ee[_0x4f0061(0x1e7)],_0x20a504);}else{if(_0x1b3909['type']===_0x4f0061(0x177)){if(!_0x1b3909[_0x4f0061(0x19a)])throw new SDKError(ErrorCode[_0x4f0061(0x18f)],_0x4f0061(0x1fe));const _0x46a965=await withSpinner(_0x4f0061(0x1f8),()=>_0x833fb['segment'][_0x4f0061(0x1be)](_0x1b3909[_0x4f0061(0x19a)]),{'verbose':_0x20a504[_0x4f0061(0x18b)]});await handleSingleObjectOutput(_0x46a965[_0x4f0061(0x1e7)],_0x20a504);}else{if(_0x1b3909[_0x4f0061(0x1c7)]===_0x4f0061(0x1b9)){if(!_0x1b3909[_0x4f0061(0x181)])throw new SDKError(ErrorCode[_0x4f0061(0x18c)],_0x4f0061(0x196));const _0x35ba2a=await withSpinner(_0x4f0061(0x1a6),()=>_0x833fb['segment']['getSegment'](_0x1b3909['parentId'],_0x1b3909[_0x4f0061(0x181)]),{'verbose':_0x20a504['verbose']});await handleSingleObjectOutput(_0x35ba2a[_0x4f0061(0x1e7)],_0x20a504);}}}return 0x0;}catch(_0x56ee03){if(_0x56ee03 instanceof SDKError)return console['error'](_0x4f0061(0x1d0)+_0x56ee03['message']),_0x56ee03['cause']&&console[_0x4f0061(0x175)](_0x4f0061(0x185)+_0x56ee03[_0x4f0061(0x1b2)]),0x1;throw _0x56ee03;}}}export class SegmentShowCommand extends BaseCommand{['name']=a27_0x51d0c2(0x1c2);[a27_0x51d0c2(0x187)]=a27_0x51d0c2(0x1b6);async['execute'](_0x3df5fd){const _0x30f950=a27_0x51d0c2,{options:_0x565210,args:_0x1deefb,tdx:_0x39ed66}=_0x3df5fd,_0x42846b=_0x1deefb[0x0];if(!_0x42846b)return console[_0x30f950(0x175)](_0x30f950(0x1fa)),console['error'](_0x30f950(0x18e)),console[_0x30f950(0x175)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console['error'](_0x30f950(0x1ec)),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x30f950(0x175)](_0x30f950(0x1f9)),0x1;try{const _0x3b99b0=_0x565210[_0x30f950(0x17e)],_0x3decb6=await resolveSegmentTarget(_0x42846b,_0x3b99b0,_0x565210[_0x30f950(0x18b)]);_0x565210['verbose']&&console['error'](_0x30f950(0x18a)+_0x3decb6);const _0x4e354b=await withSpinner(_0x30f950(0x198)+_0x42846b+_0x30f950(0x1d7),()=>_0x39ed66['segment'][_0x30f950(0x1bb)](_0x3decb6),{'verbose':_0x565210[_0x30f950(0x18b)]}),_0x3ddb91=_0x4e354b[_0x30f950(0x1e7)];_0x565210[_0x30f950(0x18b)]&&(console[_0x30f950(0x175)](_0x30f950(0x1c5)+_0x3ddb91['type']),console[_0x30f950(0x175)](_0x30f950(0x1bc)+_0x3ddb91['parentId']));if(_0x3ddb91[_0x30f950(0x1c7)]==='folder')return console[_0x30f950(0x175)](_0x30f950(0x1f5)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x3ddb91['type']===_0x30f950(0x19f))return console[_0x30f950(0x175)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x30f950(0x175)](_0x30f950(0x191)),0x1;if(!_0x3ddb91['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x30f950(0x196));const _0x7336d=await withSpinner(_0x30f950(0x1b8),()=>_0x39ed66[_0x30f950(0x1b9)][_0x30f950(0x1ee)](_0x3ddb91[_0x30f950(0x1d9)],_0x3ddb91['segmentId']),{'verbose':_0x565210[_0x30f950(0x18b)]});let _0x132cf0=_0x7336d[_0x30f950(0x1e7)];const _0x2e6b73=resolveLimit(_0x565210['limit'],DEFAULT_DISPLAY_LIMIT),_0x5ac414=/\bLIMIT\s+\d+/i[_0x30f950(0x1a1)](_0x132cf0);!_0x5ac414&&(_0x132cf0=_0x132cf0['trim']()['replace'](/;+$/,''),_0x132cf0='SELECT\x20*\x20FROM\x20(\x0a'+_0x132cf0+_0x30f950(0x1dd)+_0x2e6b73);_0x565210[_0x30f950(0x18b)]&&console[_0x30f950(0x175)](_0x30f950(0x1db)+_0x132cf0);const _0xed73e9=await withProgressSpinner(_0x30f950(0x20e),async _0x33d94a=>{const _0x302d65=_0x30f950,_0x4e9070=await _0x39ed66[_0x302d65(0x1b7)][_0x302d65(0x188)](_0x132cf0,{'catalog':'td','schema':'information_schema','onJobId':_0x1c1904=>{const _0x2abcb8=_0x302d65;_0x33d94a[_0x2abcb8(0x1a0)](_0x1c1904);}});return _0x4e9070;},{'verbose':_0x565210[_0x30f950(0x18b)]}),_0x1d56ec=_0xed73e9['data'],_0x507a4e=_0x1d56ec['jobId']?_0x30f950(0x179)+_0x1d56ec[_0x30f950(0x1a4)]+']':'';return console['error'](_0x30f950(0x171)+_0x1d56ec[_0x30f950(0x174)][_0x30f950(0x1cb)]['toLocaleString']()+'\x20rows\x20'+(_0x30f950(0x1e6)+formatElapsed(_0x1d56ec[_0x30f950(0x174)][_0x30f950(0x178)])+_0x507a4e)),await handleQueryOutput(_0x1d56ec,_0x565210),0x0;}catch(_0x3e6a70){if(_0x3e6a70 instanceof SDKError)return console[_0x30f950(0x175)](_0x30f950(0x1d5)+_0x3e6a70[_0x30f950(0x1cd)]+']'),console[_0x30f950(0x175)]('\x0a'+_0x3e6a70[_0x30f950(0x190)]),0x1;throw _0x3e6a70;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x51d0c2(0x202)]=a27_0x51d0c2(0x1e9);[a27_0x51d0c2(0x187)]=a27_0x51d0c2(0x1c4);async[a27_0x51d0c2(0x188)](_0x2494ff){const _0x2da424=a27_0x51d0c2,{options:_0x5d209b,args:_0x41c347,tdx:_0x39dcf2}=_0x2494ff;if(_0x41c347[_0x2da424(0x184)]===0x0)return console[_0x2da424(0x175)](_0x2da424(0x1ae)),console['error'](_0x2da424(0x1cc)),0x1;const _0x36c2ab=_0x41c347[0x0];try{_0x5d209b[_0x2da424(0x18b)]&&(console[_0x2da424(0x175)]('Site:\x20'+_0x5d209b[_0x2da424(0x1fd)]),console[_0x2da424(0x175)](_0x2da424(0x17b)+_0x36c2ab));const _0x1bb24d=await withSpinner(_0x2da424(0x1a8)+_0x36c2ab+_0x2da424(0x1d7),()=>_0x39dcf2[_0x2da424(0x1b9)][_0x2da424(0x1c3)](_0x36c2ab),{'verbose':_0x5d209b[_0x2da424(0x18b)]}),_0x149f50=_0x1bb24d[_0x2da424(0x1e7)];_0x5d209b[_0x2da424(0x18b)]&&console[_0x2da424(0x175)](_0x2da424(0x19e)+_0x149f50);const _0x3d0813=await withSpinner(_0x2da424(0x1ca)+_0x36c2ab+'\x27...',()=>_0x39dcf2[_0x2da424(0x1b9)][_0x2da424(0x1e5)](_0x149f50),{'verbose':_0x5d209b[_0x2da424(0x18b)]}),_0x10e562=_0x3d0813[_0x2da424(0x1e7)];return console[_0x2da424(0x175)](_0x2da424(0x1aa)+_0x10e562[_0x2da424(0x184)]+_0x2da424(0x1b0)+(_0x10e562['length']!==0x1?'s':'')),await handleSDKOutput(_0x10e562,_0x5d209b),0x0;}catch(_0x44618a){if(_0x44618a instanceof SDKError)return console['error'](_0x2da424(0x1d0)+_0x44618a[_0x2da424(0x190)]),_0x44618a['cause']&&console[_0x2da424(0x175)](_0x2da424(0x185)+_0x44618a[_0x2da424(0x1b2)]),0x1;throw _0x44618a;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x51d0c2(0x202)]=a27_0x51d0c2(0x19b);[a27_0x51d0c2(0x187)]=a27_0x51d0c2(0x207);async[a27_0x51d0c2(0x188)](_0x198fcf){const _0xf28df2=a27_0x51d0c2,{options:_0x5d4b63,args:_0x437dda,tdx:_0x55fafc}=_0x198fcf;if(_0x437dda[_0xf28df2(0x184)]===0x0)return console[_0xf28df2(0x175)](_0xf28df2(0x1c8)),console[_0xf28df2(0x175)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x3ebddf,childId:_0x126d1f}=parseSegmentRef(_0x437dda[0x0]);_0x5d4b63[_0xf28df2(0x18b)]&&(console[_0xf28df2(0x175)](_0xf28df2(0x17f)+_0x5d4b63[_0xf28df2(0x1fd)]),console[_0xf28df2(0x175)](_0xf28df2(0x17b)+_0x3ebddf),_0x126d1f&&console[_0xf28df2(0x175)](_0xf28df2(0x1a9)+_0x126d1f));if(!_0x126d1f)return console['error'](_0xf28df2(0x1e2)),0x1;const _0x4e5419=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3ebddf+_0xf28df2(0x1d7),()=>_0x55fafc['segment']['resolveParentId'](_0x3ebddf),{'verbose':_0x5d4b63['verbose']}),_0x3cbc7f=_0x4e5419[_0xf28df2(0x1e7)];_0x5d4b63['verbose']&&console[_0xf28df2(0x175)](_0xf28df2(0x19e)+_0x3cbc7f);const _0x132574=await withSpinner(_0xf28df2(0x1bd)+_0x126d1f+_0xf28df2(0x1d7),()=>_0x55fafc[_0xf28df2(0x1b9)][_0xf28df2(0x1e4)](_0x3cbc7f,_0x126d1f),{'verbose':_0x5d4b63[_0xf28df2(0x18b)]}),_0xa73e79=_0x132574[_0xf28df2(0x1e7)];_0x5d4b63[_0xf28df2(0x18b)]&&console[_0xf28df2(0x175)](_0xf28df2(0x1cf)+_0xa73e79);const _0x32b12b=await withSpinner(_0xf28df2(0x1b1)+_0x126d1f+_0xf28df2(0x1d7),()=>_0x55fafc[_0xf28df2(0x1b9)]['getFolder'](_0xa73e79),{'verbose':_0x5d4b63[_0xf28df2(0x18b)]});return await handleSDKOutput([_0x32b12b[_0xf28df2(0x1e7)]],_0x5d4b63),0x0;}catch(_0x2d7f91){if(_0x2d7f91 instanceof SDKError)return console['error'](_0xf28df2(0x1d0)+_0x2d7f91['message']),_0x2d7f91[_0xf28df2(0x1b2)]&&console[_0xf28df2(0x175)](_0xf28df2(0x185)+_0x2d7f91[_0xf28df2(0x1b2)]),0x1;throw _0x2d7f91;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x51d0c2(0x205);[a27_0x51d0c2(0x187)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x51d0c2(0x188)](_0x4d3184){const _0x114aed=a27_0x51d0c2,{options:_0x4bdc6c,args:_0xf1e54d,tdx:_0x533ef4}=_0x4d3184,_0x32163a=_0xf1e54d[0x0];if(!_0x32163a)return console[_0x114aed(0x175)](_0x114aed(0x1fa)),console[_0x114aed(0x175)](_0x114aed(0x1f1)),console[_0x114aed(0x175)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x114aed(0x175)](_0x114aed(0x1ec)),console['error'](_0x114aed(0x193)),console[_0x114aed(0x175)](_0x114aed(0x182)),0x1;try{const _0x371e8c=_0x4bdc6c[_0x114aed(0x17e)],_0x20f4b3=await resolveSegmentTarget(_0x32163a,_0x371e8c,_0x4bdc6c[_0x114aed(0x18b)]);_0x4bdc6c['verbose']&&console['error'](_0x114aed(0x18a)+_0x20f4b3);const _0xe73787=await withSpinner(_0x114aed(0x198)+_0x32163a+_0x114aed(0x1d7),()=>_0x533ef4[_0x114aed(0x1b9)][_0x114aed(0x1bb)](_0x20f4b3),{'verbose':_0x4bdc6c[_0x114aed(0x18b)]}),_0x32475d=_0xe73787[_0x114aed(0x1e7)];_0x4bdc6c[_0x114aed(0x18b)]&&(console[_0x114aed(0x175)](_0x114aed(0x1c5)+_0x32475d[_0x114aed(0x1c7)]),console[_0x114aed(0x175)](_0x114aed(0x1bc)+_0x32475d['parentId']));if(_0x32475d['type']===_0x114aed(0x177))return console['error']('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x114aed(0x175)](_0x114aed(0x189)),0x1;if(_0x32475d['type']===_0x114aed(0x19f))return console[_0x114aed(0x175)](_0x114aed(0x19d)),console[_0x114aed(0x175)](_0x114aed(0x173)),0x1;if(!_0x32475d[_0x114aed(0x181)])throw new SDKError(ErrorCode[_0x114aed(0x18c)],_0x114aed(0x196));const _0x522fd1=await withSpinner(_0x114aed(0x1b8),()=>_0x533ef4[_0x114aed(0x1b9)][_0x114aed(0x1ee)](_0x32475d[_0x114aed(0x1d9)],_0x32475d[_0x114aed(0x181)]),{'verbose':_0x4bdc6c[_0x114aed(0x18b)]}),_0x44efc2=_0x522fd1[_0x114aed(0x1e7)];return _0x4bdc6c[_0x114aed(0x1ed)]===_0x114aed(0x192)||_0x4bdc6c[_0x114aed(0x1ed)]===_0x114aed(0x197)?await handleSDKOutput([{'sql':_0x44efc2}],_0x4bdc6c):console[_0x114aed(0x1da)](_0x44efc2),0x0;}catch(_0x4a950b){if(_0x4a950b instanceof SDKError)return console[_0x114aed(0x175)](_0x114aed(0x1d0)+_0x4a950b[_0x114aed(0x190)]),_0x4a950b[_0x114aed(0x1b2)]&&console[_0x114aed(0x175)](_0x114aed(0x185)+_0x4a950b[_0x114aed(0x1b2)]),0x1;throw _0x4a950b;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x51d0c2(0x202)]=a27_0x51d0c2(0x20c);['description']='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x1c7542){const _0x35d87a=a27_0x51d0c2,{options:_0x3b08a5,args:_0x4e4fc2,tdx:_0x511024}=_0x1c7542,_0x3c180b=_0x3b08a5;if(_0x4e4fc2[_0x35d87a(0x184)]<0x2)return console[_0x35d87a(0x175)](_0x35d87a(0x20d)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0xfb639=_0x4e4fc2[0x0],_0xad4054=_0x4e4fc2[0x1];_0x3c180b[_0x35d87a(0x18b)]&&(console['error'](_0x35d87a(0x17f)+_0x3c180b[_0x35d87a(0x1fd)]),console['error'](_0x35d87a(0x199)+_0xfb639),console['error'](_0x35d87a(0x1a9)+_0xad4054));let _0xc304d4;if(_0x3c180b[_0x35d87a(0x1d1)]){const _0x57cc7a=_0x3c180b[_0x35d87a(0x1d1)],_0x4e23f6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xfb639+'\x27...',()=>_0x511024[_0x35d87a(0x1b9)][_0x35d87a(0x1c3)](_0xfb639),{'verbose':_0x3c180b['verbose']}),_0x422310=_0x4e23f6[_0x35d87a(0x1e7)],_0x4fa1d6=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x57cc7a+_0x35d87a(0x1d7),()=>_0x511024[_0x35d87a(0x1b9)][_0x35d87a(0x1e4)](_0x422310,_0x57cc7a),{'verbose':_0x3c180b[_0x35d87a(0x18b)]});_0xc304d4=_0x4fa1d6[_0x35d87a(0x1e7)],_0x3c180b[_0x35d87a(0x18b)]&&console[_0x35d87a(0x175)](_0x35d87a(0x1d2)+_0xc304d4);}const _0x5abfa8={'name':_0xad4054,'description':_0x3c180b[_0x35d87a(0x187)],'parentFolderId':_0xc304d4},_0x401429=await withSpinner('Creating\x20folder\x20\x27'+_0xad4054+'\x27...',()=>_0x511024['segment'][_0x35d87a(0x1ac)](_0xfb639,_0x5abfa8),{'verbose':_0x3c180b[_0x35d87a(0x18b)]}),_0x1f656b=_0x401429['data'];return console[_0x35d87a(0x175)]('βœ”\x20Created\x20folder\x20\x27'+_0x1f656b[_0x35d87a(0x202)]+'\x27\x20with\x20ID:\x20'+_0x1f656b['id']),await handleSDKOutput([_0x1f656b],_0x3c180b),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a27_0x51d0c2(0x20a);[a27_0x51d0c2(0x187)]=a27_0x51d0c2(0x1af);async[a27_0x51d0c2(0x188)](_0x19ef8f){const _0xd4fc05=a27_0x51d0c2,{options:_0x91d32c,args:_0x924f76,tdx:_0xb99de3}=_0x19ef8f,_0x4f7da5=_0x924f76[0x0];if(!_0x4f7da5)return console[_0xd4fc05(0x175)](_0xd4fc05(0x1d8)),console[_0xd4fc05(0x175)](_0xd4fc05(0x1a2)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0xd4fc05(0x175)](_0xd4fc05(0x1f7)),console[_0xd4fc05(0x175)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error']('Examples:'),console['error'](_0xd4fc05(0x1d6)),console[_0xd4fc05(0x175)](_0xd4fc05(0x1fc)),console[_0xd4fc05(0x175)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0xd4fc05(0x175)](_0xd4fc05(0x1e3)),0x1;try{const _0x23a565=_0x91d32c['parentSegment'],_0x2d91ca=await resolveSegmentTarget(_0x4f7da5,_0x23a565,_0x91d32c[_0xd4fc05(0x18b)]);_0x91d32c[_0xd4fc05(0x18b)]&&console[_0xd4fc05(0x175)](_0xd4fc05(0x18a)+_0x2d91ca);const _0x3bb7e6=await withSpinner(_0xd4fc05(0x198)+_0x4f7da5+_0xd4fc05(0x1d7),()=>_0xb99de3['segment'][_0xd4fc05(0x1bb)](_0x2d91ca),{'verbose':_0x91d32c[_0xd4fc05(0x18b)]}),_0x2c0b08=_0x3bb7e6[_0xd4fc05(0x1e7)];_0x91d32c[_0xd4fc05(0x18b)]&&(console[_0xd4fc05(0x175)](_0xd4fc05(0x1c5)+_0x2c0b08[_0xd4fc05(0x1c7)]),console[_0xd4fc05(0x175)](_0xd4fc05(0x1bc)+_0x2c0b08['parentId']),_0x2c0b08['folderId']&&console['error']('Folder\x20ID:\x20'+_0x2c0b08['folderId']),_0x2c0b08['segmentId']&&console[_0xd4fc05(0x175)](_0xd4fc05(0x209)+_0x2c0b08[_0xd4fc05(0x181)]));if(_0x91d32c['web']){if(_0x2c0b08[_0xd4fc05(0x1c7)]===_0xd4fc05(0x177))return console[_0xd4fc05(0x175)](_0xd4fc05(0x1dc)),0x1;if(_0x2c0b08[_0xd4fc05(0x1c7)]===_0xd4fc05(0x19f))return console['error'](_0xd4fc05(0x208)),console[_0xd4fc05(0x175)](_0xd4fc05(0x1ba)),0x1;if(!_0x2c0b08[_0xd4fc05(0x181)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xd4fc05(0x196));const _0x4d5f4e=getConsoleNextUrl(_0x91d32c[_0xd4fc05(0x1fd)],_0xd4fc05(0x206)+_0x2c0b08['parentId']+_0xd4fc05(0x1e1)+_0x2c0b08['segmentId']);return console[_0xd4fc05(0x175)](a27_0x25ee13[_0xd4fc05(0x203)]('βœ”')+'\x20Opening\x20'+a27_0x25ee13[_0xd4fc05(0x20b)](_0x4d5f4e)),openBrowser(_0x4d5f4e),0x0;}if(_0x2c0b08['type']===_0xd4fc05(0x177)){if(!_0x2c0b08[_0xd4fc05(0x19a)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0xd4fc05(0x1fe));const _0x30ba6b=await withSpinner(_0xd4fc05(0x1f8),()=>_0xb99de3[_0xd4fc05(0x1b9)]['getFolder'](_0x2c0b08['folderId']),{'verbose':_0x91d32c[_0xd4fc05(0x18b)]});await handleSingleObjectOutput(_0x30ba6b[_0xd4fc05(0x1e7)],_0x91d32c);}else{if(_0x2c0b08[_0xd4fc05(0x1c7)]===_0xd4fc05(0x1b9)){if(!_0x2c0b08[_0xd4fc05(0x181)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xaf4376=await withSpinner(_0xd4fc05(0x1a6),()=>_0xb99de3[_0xd4fc05(0x1b9)]['getSegment'](_0x2c0b08['parentId'],_0x2c0b08[_0xd4fc05(0x181)]),{'verbose':_0x91d32c[_0xd4fc05(0x18b)]}),_0x5ba5a2=getConsoleNextUrl(_0x91d32c[_0xd4fc05(0x1fd)],_0xd4fc05(0x206)+_0x2c0b08[_0xd4fc05(0x1d9)]+_0xd4fc05(0x1e1)+_0x2c0b08['segmentId']),_0x214cca=_0xaf4376[_0xd4fc05(0x1e7)];_0x214cca[_0xd4fc05(0x1ab)]=_0x5ba5a2,await handleSingleObjectOutput(_0x214cca,_0x91d32c);}else return console[_0xd4fc05(0x175)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0xd4fc05(0x175)](_0xd4fc05(0x20f)),0x1;}return 0x0;}catch(_0x5b938d){if(_0x5b938d instanceof SDKError)return console['error'](_0xd4fc05(0x1d0)+_0x5b938d['message']),_0x5b938d['cause']&&console[_0xd4fc05(0x175)](_0xd4fc05(0x185)+_0x5b938d['cause']),0x1;throw _0x5b938d;}}}export const SegmentInfoCommand=SegmentViewCommand;function a27_0x46c1(){const _0x3a5ace=['type','Error:\x20Folder\x20reference\x20is\x20required','3810370hXvviB','Listing\x20folders\x20for\x20parent\x20\x27','processedRows','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','code','fullPath','Resolved\x20folder\x20ID:\x20','Error:\x20','parentFolder','Resolved\x20parent\x20folder\x20ID:\x20','48ARoxlA','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','βœ–\x20Query\x20failed\x20[','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','\x27...','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','parentId','log','SQL\x20query:\x0a','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20Parent\x20segment:\x20','27GuAbSV','Resolved\x20YAML\x20file:\x20','/e/','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','resolveFolderId','listFolders','in\x20','data','Usage:\x20tdx\x20segment\x20describe\x20<path>','segment:folder:list','1186787QsBBHr','Usage:\x20tdx\x20sg\x20desc\x20<name>','Examples:','format','getSegmentSQL','940FLuTNv','(root)','Usage:\x20tdx\x20sg\x20sql\x20<name>','2609794izwdCh','15YCUIMU','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','269584BNTYkz','Options:','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20Full\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','site','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Use:\x20tdx\x20ps\x20desc','195knlKmn','includes','name','green','getParent','segment:sql','/app/ps/','Show\x20segment\x20folder\x20details','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Segment\x20ID:\x20','segment:view','cyan','segment:folder:create','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Executing\x20segment\x20query...','Use:\x20tdx\x20ps\x20view','βœ”\x20Query\x20completed:\x20Processed\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Use:\x20tdx\x20ps\x20sql','stats','error','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','folder','elapsedTimeMillis','\x20[Job\x20ID:\x20','Show\x20segment\x20or\x20folder\x20details','Parent\x20name:\x20','715OGpscy','17392DzqDHD','parentSegment','Site:\x20','segment:desc','segmentId','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','length','\x20\x20Cause:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','description','execute','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Target\x20path:\x20','verbose','SEGMENT_NOT_FOUND','11478ikpqjo','Usage:\x20tdx\x20sg\x20show\x20<name>','SEGMENT_FOLDER_NOT_FOUND','message','Use:\x20tdx\x20ps\x20show','json','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segmentName','Segment\x20ID\x20missing\x20from\x20resolved\x20path','jsonl','Resolving\x20\x27','Parent\x20segment:\x20','folderId','segment:folder:show','\x20\x20Segment\x20name:\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20parent\x20ID:\x20','parent','setJobId','test','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','folderPath','jobId','\x20\x20Folder\x20path:\x20','Fetching\x20segment\x20details...','620028lLEOuY','Resolving\x20parent\x20segment\x20\x27','Folder\x20name:\x20','βœ”\x20Found\x20','url','createFolder','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Parent\x20segment\x20name\x20is\x20required','Show\x20folder\x20or\x20child\x20segment\x20details','\x20folder','Fetching\x20folder\x20\x27','cause','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20path\x20\x27','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','query','Fetching\x20SQL\x20for\x20segment...','segment','Use:\x20tdx\x20ps\x20view\x20-w','resolvePathToResource','Parent\x20ID:\x20','Resolving\x20folder\x20\x27','getFolder','INVALID_ARGUMENT','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segment:describe','segment:show','resolveParentId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolved\x20type:\x20','16heDmGx'];a27_0x46c1=function(){return _0x3a5ace;};return a27_0x46c1();}export class SegmentDescCommand extends BaseCommand{['name']=a27_0x51d0c2(0x180);[a27_0x51d0c2(0x187)]=a27_0x51d0c2(0x186);async['execute'](_0xbb1c03){const _0x2b3982=a27_0x51d0c2,{options:_0x5521cd,args:_0x396c5f,tdx:_0x5b12c2}=_0xbb1c03,_0x355559=_0x396c5f[0x0];if(!_0x355559)return console[_0x2b3982(0x175)](_0x2b3982(0x1fa)),console['error'](_0x2b3982(0x1eb)),console[_0x2b3982(0x175)](_0x2b3982(0x183)),console[_0x2b3982(0x175)]('Examples:'),console[_0x2b3982(0x175)](_0x2b3982(0x1b3)),console[_0x2b3982(0x175)](_0x2b3982(0x1f4)),0x1;try{const _0x39f6f0=_0x5521cd['parentSegment'],_0x3b2416=await resolveSegmentTarget(_0x355559,_0x39f6f0,_0x5521cd['verbose']);_0x5521cd[_0x2b3982(0x18b)]&&console[_0x2b3982(0x175)]('Target\x20path:\x20'+_0x3b2416);const _0x5dc894=await withSpinner(_0x2b3982(0x198)+_0x355559+_0x2b3982(0x1d7),()=>_0x5b12c2[_0x2b3982(0x1b9)][_0x2b3982(0x1bb)](_0x3b2416),{'verbose':_0x5521cd[_0x2b3982(0x18b)]}),_0x7c8824=_0x5dc894[_0x2b3982(0x1e7)];_0x5521cd[_0x2b3982(0x18b)]&&(console[_0x2b3982(0x175)]('Resolved\x20type:\x20'+_0x7c8824[_0x2b3982(0x1c7)]),console['error'](_0x2b3982(0x1bc)+_0x7c8824[_0x2b3982(0x1d9)]));if(_0x7c8824[_0x2b3982(0x1c7)]===_0x2b3982(0x177))return console[_0x2b3982(0x175)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x2b3982(0x175)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x7c8824[_0x2b3982(0x1c7)]===_0x2b3982(0x19f))return console['error'](_0x2b3982(0x1b4)),console['error'](_0x2b3982(0x1ff)),0x1;if(!_0x7c8824[_0x2b3982(0x181)])throw new SDKError(ErrorCode[_0x2b3982(0x18c)],_0x2b3982(0x196));const _0x9c08ce=await withSpinner(_0x2b3982(0x1b8),()=>_0x5b12c2[_0x2b3982(0x1b9)][_0x2b3982(0x1ee)](_0x7c8824['parentId'],_0x7c8824[_0x2b3982(0x181)]),{'verbose':_0x5521cd[_0x2b3982(0x18b)]}),_0x19f932=_0x9c08ce[_0x2b3982(0x1e7)],_0x463dd5=await executeSchemaQuery(_0x19f932,_0x5b12c2,_0x5521cd);return await handleQueryOutput(_0x463dd5,_0x5521cd),0x0;}catch(_0x21db29){if(_0x21db29 instanceof SDKError)return console['error'](_0x2b3982(0x1d0)+_0x21db29[_0x2b3982(0x190)]),_0x21db29[_0x2b3982(0x1b2)]&&console['error']('\x20\x20Cause:\x20'+_0x21db29['cause']),0x1;throw _0x21db29;}}}
@@ -1 +1 @@
1
- const a28_0x2684fb=a28_0x4fe8;(function(_0x50a825,_0x56c286){const _0x2cccb4=a28_0x4fe8,_0x3e0980=_0x50a825();while(!![]){try{const _0x4fc188=parseInt(_0x2cccb4(0x15e))/0x1*(parseInt(_0x2cccb4(0x160))/0x2)+-parseInt(_0x2cccb4(0x140))/0x3*(-parseInt(_0x2cccb4(0x15d))/0x4)+-parseInt(_0x2cccb4(0x15a))/0x5+parseInt(_0x2cccb4(0x14b))/0x6+-parseInt(_0x2cccb4(0x146))/0x7*(parseInt(_0x2cccb4(0x153))/0x8)+parseInt(_0x2cccb4(0x141))/0x9+-parseInt(_0x2cccb4(0x16c))/0xa*(parseInt(_0x2cccb4(0x156))/0xb);if(_0x4fc188===_0x56c286)break;else _0x3e0980['push'](_0x3e0980['shift']());}catch(_0x565131){_0x3e0980['push'](_0x3e0980['shift']());}}}(a28_0x4d09,0xdeae6));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a28_0x4fe8(_0x5da524,_0x126547){_0x5da524=_0x5da524-0x13e;const _0x4d09db=a28_0x4d09();let _0x4fe80f=_0x4d09db[_0x5da524];return _0x4fe80f;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x32a32b from'chalk';function a28_0x4d09(){const _0x131f2c=['segment','resolvePathToResource','\x27\x20with\x20ID:\x20','length','6508104lnBnAm','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','site','11rtDyCx','segments','parent','\x20\x20\x20Path:\x20','1947920mSytaQ','resolveParentId','invisible','915108BJimlH','1IPYQyF','Examples:','2823454lOnQPY','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20folder\x20path\x20\x27','\x27...','segment:create','Resolving\x20parent\x20segment\x20\x27','Segment\x20name:\x20','ruleFile','Creating\x20segment\x20\x27','Target\x20path:\x20','yellow','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','12840330dzppGv','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','error','verbose','createSegment','noCountPopulation','name','segmentPath','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','3sgQrtW','278523wtmVrW','data','kind','Create\x20child\x20segment\x20with\x20filtering\x20rules','Site:\x20','7MDnQYO','description','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Resolved\x20folder\x20ID:\x20','type','10366686qwofeH','folderId','folder','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'];a28_0x4d09=function(){return _0x131f2c;};return a28_0x4d09();}export class SegmentCreateCommand extends BaseCommand{['name']=a28_0x2684fb(0x164);[a28_0x2684fb(0x147)]=a28_0x2684fb(0x144);async['execute'](_0x2ebe13){const _0x311d5c=a28_0x2684fb;console[_0x311d5c(0x16e)](a28_0x32a32b[_0x311d5c(0x16a)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a28_0x32a32b['yellow'](_0x311d5c(0x16b)));const {options:_0x23fba9,args:_0xa20808,tdx:_0x2dcf84}=_0x2ebe13,_0x347dde=_0x23fba9;if(_0xa20808[_0x311d5c(0x152)]===0x0)return console[_0x311d5c(0x16e)](_0x311d5c(0x13f)),console[_0x311d5c(0x16e)](_0x311d5c(0x14e)),console[_0x311d5c(0x16e)](_0x311d5c(0x15f)),console[_0x311d5c(0x16e)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x311d5c(0x16e)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x311d5c(0x154)),0x1;const _0x83d805=_0xa20808[0x0],_0xc48bbe=_0x23fba9[_0x311d5c(0x13e)];let _0x249677=_0x83d805;_0xc48bbe&&!_0x83d805['includes']('/')&&(_0x249677=_0xc48bbe+'/'+_0x83d805,_0x347dde['verbose']&&console[_0x311d5c(0x16e)](_0x311d5c(0x161)+_0x249677));const _0x43f5d2=parsePath(_0x249677);if(_0x43f5d2['segments'][_0x311d5c(0x152)]<0x2)return console[_0x311d5c(0x16e)](_0x311d5c(0x148)),console[_0x311d5c(0x16e)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x4fa968=_0x43f5d2[_0x311d5c(0x157)][0x0],_0xa3ea22=getBaseName(_0x249677),_0x25cc5d=getParentPath(_0x249677);_0x347dde['verbose']&&(console[_0x311d5c(0x16e)](_0x311d5c(0x145)+_0x347dde[_0x311d5c(0x155)]),console[_0x311d5c(0x16e)](_0x311d5c(0x169)+_0x249677),console[_0x311d5c(0x16e)]('Parent:\x20'+_0x4fa968),console['error'](_0x311d5c(0x166)+_0xa3ea22),console['error']('Parent\x20path:\x20'+_0x25cc5d));const _0x30001a=await withSpinner(_0x311d5c(0x165)+_0x4fa968+'\x27...',()=>_0x2dcf84['segment'][_0x311d5c(0x15b)](_0x4fa968),{'verbose':_0x347dde[_0x311d5c(0x16f)]}),_0x2db22a=_0x30001a[_0x311d5c(0x142)];let _0x44f501;if(_0x43f5d2[_0x311d5c(0x157)][_0x311d5c(0x152)]>0x2){const _0x5b0201=await withSpinner(_0x311d5c(0x162)+_0x25cc5d+_0x311d5c(0x163),()=>_0x2dcf84[_0x311d5c(0x14f)][_0x311d5c(0x150)](_0x25cc5d),{'verbose':_0x347dde[_0x311d5c(0x16f)]}),_0x5dbce8=_0x5b0201['data'];if(_0x5dbce8['type']!=='folder'&&_0x5dbce8[_0x311d5c(0x14a)]!==_0x311d5c(0x158))return console[_0x311d5c(0x16e)](_0x311d5c(0x16d)),0x1;_0x44f501=_0x5dbce8[_0x311d5c(0x14c)];}else{if(_0x347dde['folder']){const _0x35d4a1=await withSpinner('Resolving\x20folder\x20\x27'+_0x347dde[_0x311d5c(0x14d)]+_0x311d5c(0x163),()=>_0x2dcf84[_0x311d5c(0x14f)]['resolveFolderId'](_0x2db22a,_0x347dde['folder']),{'verbose':_0x347dde[_0x311d5c(0x16f)]});_0x44f501=_0x35d4a1[_0x311d5c(0x142)];}}_0x347dde['verbose']&&_0x44f501&&console[_0x311d5c(0x16e)](_0x311d5c(0x149)+_0x44f501);const _0x2413a3=await loadJSONFromOptions(_0x347dde['rule'],_0x347dde[_0x311d5c(0x167)]),_0x39c030={'name':_0xa3ea22,'description':_0x347dde[_0x311d5c(0x147)],'rule':_0x2413a3,'kind':_0x347dde[_0x311d5c(0x143)]!==undefined?parseInt(_0x347dde[_0x311d5c(0x143)],0xa):undefined,'isVisible':_0x347dde[_0x311d5c(0x15c)]?![]:undefined,'segmentFolderId':_0x44f501,'countPopulation':_0x347dde[_0x311d5c(0x171)]?![]:undefined},_0x41f33d=await withSpinner(_0x311d5c(0x168)+_0xa3ea22+_0x311d5c(0x163),()=>_0x2dcf84[_0x311d5c(0x14f)][_0x311d5c(0x170)](_0x2db22a,_0x39c030),{'verbose':_0x347dde['verbose']}),_0x4cf420=_0x41f33d[_0x311d5c(0x142)];return console[_0x311d5c(0x16e)]('βœ”\x20Created\x20segment\x20\x27'+_0x4cf420[_0x311d5c(0x172)]+_0x311d5c(0x151)+_0x4cf420['id']),_0x249677!==_0x83d805&&console['error'](_0x311d5c(0x159)+_0x249677),await handleSDKOutput([_0x4cf420],_0x347dde),0x0;}}
1
+ const a28_0x9a9bbe=a28_0x102f;function a28_0x3a83(){const _0x593933=['\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','yellow','Resolving\x20parent\x20segment\x20\x27','βœ”\x20Created\x20segment\x20\x27','752aJpYTb','Resolving\x20folder\x20path\x20\x27','ruleFile','error','name','12325984EiYjdm','resolvePathToResource','noCountPopulation','Parent:\x20','description','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','233324UFvBaP','segment','5930QJnYun','117063vUHgSK','\x20\x20\x20Path:\x20','createSegment','segments','kind','\x27...','resolveFolderId','1536590kwQPzm','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','76071KoCwxb','Target\x20path:\x20','folderId','40AUBBuR','Resolved\x20folder\x20ID:\x20','includes','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','length','folder','108ctFNsg','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Site:\x20','Segment\x20name:\x20','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','1524OnrRIm','resolveParentId','2347702iCuyVv','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','data','Create\x20child\x20segment\x20with\x20filtering\x20rules','Parent\x20path:\x20','rule','site','type','invisible','verbose'];a28_0x3a83=function(){return _0x593933;};return a28_0x3a83();}(function(_0x1192d2,_0x1ee84d){const _0x225cb7=a28_0x102f,_0x2a7bf8=_0x1192d2();while(!![]){try{const _0x3e9c46=-parseInt(_0x225cb7(0x159))/0x1+-parseInt(_0x225cb7(0x16b))/0x2+parseInt(_0x225cb7(0x15b))/0x3*(parseInt(_0x225cb7(0x164))/0x4)+-parseInt(_0x225cb7(0x186))/0x5*(parseInt(_0x225cb7(0x169))/0x6)+parseInt(_0x225cb7(0x184))/0x7+parseInt(_0x225cb7(0x179))/0x8*(-parseInt(_0x225cb7(0x187))/0x9)+parseInt(_0x225cb7(0x15e))/0xa*(parseInt(_0x225cb7(0x17e))/0xb);if(_0x3e9c46===_0x1ee84d)break;else _0x2a7bf8['push'](_0x2a7bf8['shift']());}catch(_0xf75905){_0x2a7bf8['push'](_0x2a7bf8['shift']());}}}(a28_0x3a83,0xebcac));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';function a28_0x102f(_0x3c501b,_0x4a5f4a){_0x3c501b=_0x3c501b-0x157;const _0x3a83e9=a28_0x3a83();let _0x102ff5=_0x3a83e9[_0x3c501b];return _0x102ff5;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x41f369 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x9a9bbe(0x17d)]='segment:create';[a28_0x9a9bbe(0x182)]=a28_0x9a9bbe(0x16e);async['execute'](_0xf31b8f){const _0x5b50d7=a28_0x9a9bbe;console[_0x5b50d7(0x17c)](a28_0x41f369[_0x5b50d7(0x176)](_0x5b50d7(0x183))),console['error'](a28_0x41f369[_0x5b50d7(0x176)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x577d87,args:_0x24f851,tdx:_0x4e28f0}=_0xf31b8f,_0x51e13c=_0x577d87;if(_0x24f851['length']===0x0)return console[_0x5b50d7(0x17c)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x5b50d7(0x17c)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x5b50d7(0x17c)]('Examples:'),console['error'](_0x5b50d7(0x175)),console['error'](_0x5b50d7(0x16c)),console[_0x5b50d7(0x17c)](_0x5b50d7(0x165)),0x1;const _0x4cdef1=_0x24f851[0x0],_0x358a1c=_0x577d87['segmentPath'];let _0x2dc794=_0x4cdef1;_0x358a1c&&!_0x4cdef1[_0x5b50d7(0x160)]('/')&&(_0x2dc794=_0x358a1c+'/'+_0x4cdef1,_0x51e13c['verbose']&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x2dc794));const _0x1fff65=parsePath(_0x2dc794);if(_0x1fff65[_0x5b50d7(0x18a)][_0x5b50d7(0x162)]<0x2)return console['error'](_0x5b50d7(0x161)),console['error'](_0x5b50d7(0x168)),0x1;const _0x257e10=_0x1fff65[_0x5b50d7(0x18a)][0x0],_0x1b19b4=getBaseName(_0x2dc794),_0x368943=getParentPath(_0x2dc794);_0x51e13c[_0x5b50d7(0x174)]&&(console[_0x5b50d7(0x17c)](_0x5b50d7(0x166)+_0x51e13c[_0x5b50d7(0x171)]),console[_0x5b50d7(0x17c)](_0x5b50d7(0x15c)+_0x2dc794),console[_0x5b50d7(0x17c)](_0x5b50d7(0x181)+_0x257e10),console[_0x5b50d7(0x17c)](_0x5b50d7(0x167)+_0x1b19b4),console['error'](_0x5b50d7(0x16f)+_0x368943));const _0x449384=await withSpinner(_0x5b50d7(0x177)+_0x257e10+_0x5b50d7(0x157),()=>_0x4e28f0[_0x5b50d7(0x185)][_0x5b50d7(0x16a)](_0x257e10),{'verbose':_0x51e13c[_0x5b50d7(0x174)]}),_0x34e68b=_0x449384[_0x5b50d7(0x16d)];let _0x4c1e1f;if(_0x1fff65[_0x5b50d7(0x18a)][_0x5b50d7(0x162)]>0x2){const _0x453de6=await withSpinner(_0x5b50d7(0x17a)+_0x368943+_0x5b50d7(0x157),()=>_0x4e28f0[_0x5b50d7(0x185)][_0x5b50d7(0x17f)](_0x368943),{'verbose':_0x51e13c[_0x5b50d7(0x174)]}),_0x39a61a=_0x453de6['data'];if(_0x39a61a[_0x5b50d7(0x172)]!=='folder'&&_0x39a61a['type']!=='parent')return console[_0x5b50d7(0x17c)](_0x5b50d7(0x15a)),0x1;_0x4c1e1f=_0x39a61a[_0x5b50d7(0x15d)];}else{if(_0x51e13c[_0x5b50d7(0x163)]){const _0x1a7a6f=await withSpinner('Resolving\x20folder\x20\x27'+_0x51e13c['folder']+_0x5b50d7(0x157),()=>_0x4e28f0[_0x5b50d7(0x185)][_0x5b50d7(0x158)](_0x34e68b,_0x51e13c['folder']),{'verbose':_0x51e13c[_0x5b50d7(0x174)]});_0x4c1e1f=_0x1a7a6f[_0x5b50d7(0x16d)];}}_0x51e13c[_0x5b50d7(0x174)]&&_0x4c1e1f&&console['error'](_0x5b50d7(0x15f)+_0x4c1e1f);const _0x1064cf=await loadJSONFromOptions(_0x51e13c[_0x5b50d7(0x170)],_0x51e13c[_0x5b50d7(0x17b)]),_0x5b5e73={'name':_0x1b19b4,'description':_0x51e13c[_0x5b50d7(0x182)],'rule':_0x1064cf,'kind':_0x51e13c[_0x5b50d7(0x18b)]!==undefined?parseInt(_0x51e13c[_0x5b50d7(0x18b)],0xa):undefined,'isVisible':_0x51e13c[_0x5b50d7(0x173)]?![]:undefined,'segmentFolderId':_0x4c1e1f,'countPopulation':_0x51e13c[_0x5b50d7(0x180)]?![]:undefined},_0x317099=await withSpinner('Creating\x20segment\x20\x27'+_0x1b19b4+'\x27...',()=>_0x4e28f0[_0x5b50d7(0x185)][_0x5b50d7(0x189)](_0x34e68b,_0x5b5e73),{'verbose':_0x51e13c[_0x5b50d7(0x174)]}),_0x2e7f68=_0x317099[_0x5b50d7(0x16d)];return console[_0x5b50d7(0x17c)](_0x5b50d7(0x178)+_0x2e7f68['name']+'\x27\x20with\x20ID:\x20'+_0x2e7f68['id']),_0x2dc794!==_0x4cdef1&&console[_0x5b50d7(0x17c)](_0x5b50d7(0x188)+_0x2dc794),await handleSDKOutput([_0x2e7f68],_0x51e13c),0x0;}}
@@ -1 +1 @@
1
- const a29_0x414549=a29_0x19dd;(function(_0x2c6fd1,_0x44bbfb){const _0x457844=a29_0x19dd,_0x223890=_0x2c6fd1();while(!![]){try{const _0x177831=-parseInt(_0x457844(0xdd))/0x1*(parseInt(_0x457844(0xdf))/0x2)+-parseInt(_0x457844(0xe2))/0x3*(parseInt(_0x457844(0xd4))/0x4)+-parseInt(_0x457844(0xec))/0x5*(parseInt(_0x457844(0xe5))/0x6)+parseInt(_0x457844(0xea))/0x7*(-parseInt(_0x457844(0xe6))/0x8)+parseInt(_0x457844(0xf2))/0x9*(parseInt(_0x457844(0xd6))/0xa)+-parseInt(_0x457844(0xd8))/0xb+-parseInt(_0x457844(0xdb))/0xc*(-parseInt(_0x457844(0xee))/0xd);if(_0x177831===_0x44bbfb)break;else _0x223890['push'](_0x223890['shift']());}catch(_0x3fa5b4){_0x223890['push'](_0x223890['shift']());}}}(a29_0x4679,0xb28a7));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x19dd(_0x341f52,_0x51e959){_0x341f52=_0x341f52-0xd2;const _0x4679cf=a29_0x4679();let _0x19dd06=_0x4679cf[_0x341f52];return _0x19dd06;}function a29_0x4679(){const _0x18154a=['2709KjSitq','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','βœ”\x20Found\x20','12292iSrPkE','Error:\x20Parent\x20segment\x20name\x20is\x20required','6910CqFyKe','description','7536133QThySZ','jsonl','Parent\x20segment:\x20','12uxYwgV','length','1054Ensjmp','segment','1502ztrVbo','Listing\x20fields\x20for\x20\x27','execute','537QKEXjO','segment:fields','error','1091274OCgyfa','2536iuoQNh','verbose','parentSegment','json','3241akTyaQ','Site:\x20','15hjtrPn','\x20field','42151772hyYVuP','name','listFields','site'];a29_0x4679=function(){return _0x18154a;};return a29_0x4679();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x414549(0xef)]=a29_0x414549(0xe3);[a29_0x414549(0xd7)]='List\x20available\x20fields\x20for\x20segmentation';async[a29_0x414549(0xe1)](_0x44ee44){const _0x310639=a29_0x414549,{options:_0x1fcf7f,args:_0x4f0cab,tdx:_0x38fc74}=_0x44ee44,_0x51dbb0=_0x4f0cab[0x0]||_0x1fcf7f[_0x310639(0xe8)];if(!_0x51dbb0)return console[_0x310639(0xe4)](_0x310639(0xd5)),console['error'](_0x310639(0xd2)),console[_0x310639(0xe4)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x1fcf7f[_0x310639(0xe7)]&&(console[_0x310639(0xe4)](_0x310639(0xeb)+_0x1fcf7f[_0x310639(0xf1)]),console[_0x310639(0xe4)](_0x310639(0xda)+_0x51dbb0));const _0x5695c6=await withSpinner(_0x310639(0xe0)+_0x51dbb0+'\x27...',()=>_0x38fc74[_0x310639(0xde)][_0x310639(0xf0)](_0x51dbb0),{'verbose':_0x1fcf7f[_0x310639(0xe7)]}),_0x463eb8=_0x5695c6[_0x310639(0xf3)];console[_0x310639(0xe4)](_0x310639(0xd3)+_0x463eb8[_0x310639(0xdc)]+_0x310639(0xed)+(_0x463eb8[_0x310639(0xdc)]!==0x1?'s':''));if(_0x1fcf7f[_0x310639(0xe9)]||_0x1fcf7f[_0x310639(0xd9)])return await handleSDKOutput(_0x463eb8,_0x1fcf7f),0x0;return displayFieldsHumanReadable(_0x463eb8,_0x51dbb0),0x0;}}
1
+ const a29_0x49e8ad=a29_0xa7de;(function(_0x29e2d7,_0x17a8ab){const _0x569f2a=a29_0xa7de,_0x5ae4a6=_0x29e2d7();while(!![]){try{const _0x32a25b=-parseInt(_0x569f2a(0x1d6))/0x1*(parseInt(_0x569f2a(0x1eb))/0x2)+-parseInt(_0x569f2a(0x1e8))/0x3*(-parseInt(_0x569f2a(0x1d4))/0x4)+-parseInt(_0x569f2a(0x1e7))/0x5*(-parseInt(_0x569f2a(0x1e4))/0x6)+-parseInt(_0x569f2a(0x1e9))/0x7*(-parseInt(_0x569f2a(0x1df))/0x8)+parseInt(_0x569f2a(0x1e2))/0x9+-parseInt(_0x569f2a(0x1d7))/0xa*(parseInt(_0x569f2a(0x1ec))/0xb)+-parseInt(_0x569f2a(0x1ce))/0xc;if(_0x32a25b===_0x17a8ab)break;else _0x5ae4a6['push'](_0x5ae4a6['shift']());}catch(_0x10540a){_0x5ae4a6['push'](_0x5ae4a6['shift']());}}}(a29_0x227e,0x9567d));import{BaseCommand}from'./command.js';function a29_0x227e(){const _0x287bf8=['\x27...','6TdwHqS','data','verbose','4980265ytLSbI','375aNACjQ','50239qxosUA','Error:\x20Parent\x20segment\x20name\x20is\x20required','2KAcsms','66CyJTBF','Site:\x20','7326684pYfmhD','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment:fields','description','Parent\x20segment:\x20','execute','20620KAylSU','segment','808053uiwARF','1048710FOVLIC','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','length','parentSegment','jsonl','site','List\x20available\x20fields\x20for\x20segmentation','listFields','344zQurVG','json','error','6396858iGuNDJ'];a29_0x227e=function(){return _0x287bf8;};return a29_0x227e();}function a29_0xa7de(_0x80e1cc,_0x401eb5){_0x80e1cc=_0x80e1cc-0x1ce;const _0x227efc=a29_0x227e();let _0xa7debc=_0x227efc[_0x80e1cc];return _0xa7debc;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a29_0x49e8ad(0x1d0);[a29_0x49e8ad(0x1d1)]=a29_0x49e8ad(0x1dd);async[a29_0x49e8ad(0x1d3)](_0x19e932){const _0x8ac55b=a29_0x49e8ad,{options:_0x10e401,args:_0x53eb8a,tdx:_0x5d6763}=_0x19e932,_0x30856d=_0x53eb8a[0x0]||_0x10e401[_0x8ac55b(0x1da)];if(!_0x30856d)return console[_0x8ac55b(0x1e1)](_0x8ac55b(0x1ea)),console['error'](_0x8ac55b(0x1d8)),console[_0x8ac55b(0x1e1)](_0x8ac55b(0x1cf)),0x1;_0x10e401['verbose']&&(console[_0x8ac55b(0x1e1)](_0x8ac55b(0x1ed)+_0x10e401[_0x8ac55b(0x1dc)]),console[_0x8ac55b(0x1e1)](_0x8ac55b(0x1d2)+_0x30856d));const _0x2e8008=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x30856d+_0x8ac55b(0x1e3),()=>_0x5d6763[_0x8ac55b(0x1d5)][_0x8ac55b(0x1de)](_0x30856d),{'verbose':_0x10e401[_0x8ac55b(0x1e6)]}),_0x273528=_0x2e8008[_0x8ac55b(0x1e5)];console[_0x8ac55b(0x1e1)]('βœ”\x20Found\x20'+_0x273528[_0x8ac55b(0x1d9)]+'\x20field'+(_0x273528[_0x8ac55b(0x1d9)]!==0x1?'s':''));if(_0x10e401[_0x8ac55b(0x1e0)]||_0x10e401[_0x8ac55b(0x1db)])return await handleSDKOutput(_0x273528,_0x10e401),0x0;return displayFieldsHumanReadable(_0x273528,_0x30856d),0x0;}}
@@ -1 +1 @@
1
- const a30_0x56ab93=a30_0x2fc8;(function(_0x29eb65,_0x4e29f8){const _0x5bdabb=a30_0x2fc8,_0x100a73=_0x29eb65();while(!![]){try{const _0x51a7b0=-parseInt(_0x5bdabb(0xe4))/0x1*(-parseInt(_0x5bdabb(0xbb))/0x2)+parseInt(_0x5bdabb(0xfb))/0x3+-parseInt(_0x5bdabb(0xe7))/0x4+parseInt(_0x5bdabb(0xd9))/0x5+-parseInt(_0x5bdabb(0xda))/0x6*(-parseInt(_0x5bdabb(0xf5))/0x7)+-parseInt(_0x5bdabb(0xd4))/0x8+parseInt(_0x5bdabb(0xb7))/0x9*(-parseInt(_0x5bdabb(0xbe))/0xa);if(_0x51a7b0===_0x4e29f8)break;else _0x100a73['push'](_0x100a73['shift']());}catch(_0x1aabb6){_0x100a73['push'](_0x100a73['shift']());}}}(a30_0x25f9,0x94c8a));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 a30_0x28c8ed from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x5e7b22 from'path';function a30_0x25f9(){const _0x1dbbff=['\x20files\x20to\x20','segments','Write\x20','repeat','absolutePath','parentName','files','Target\x20resource:\x20','175osVCwu','parentSegment','name','session','βœ”\x20Context\x20set:\x20','counts','1692507SesyDO','type','βœ”\x20Pulled\x20','filter','Pulling\x20segments\x20from\x20\x27','cwd','cyan','activations','errorCode','journeys','4293zuwjVa','red','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Target:\x20','137954NUpGQw','segment:pull','yellow','31890iJVosc','verbose','segment','\x20unchanged\x20files','\x20=\x20','\x20files?','\x0aChanges\x20to\x20\x27','\x0aError:','journeyVersions','\x20new\x20files','hasChanges','relativePath','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','green','description','isNew','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','execute','\x20versions)','no_parent','dirname','5039472CtfYNL','length','diff','site','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)','3750870rcpXPW','107172RqbOxg','-\x20no\x20files\x20written','\x20activations','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','content','targetDir','parent_segment','\x27...','16YRvpQC','error','helpText','416080POxxxH','data','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dim','\x20changed\x20files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a30_0x25f9=function(){return _0x1dbbff;};return a30_0x25f9();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a30_0x2fc8(_0x5d78c5,_0x50c693){_0x5d78c5=_0x5d78c5-0xae;const _0x25f913=a30_0x25f9();let _0x2fc89b=_0x25f913[_0x5d78c5];return _0x2fc89b;}export class SegmentPullCommand extends BaseCommand{[a30_0x56ab93(0xf7)]=a30_0x56ab93(0xbc);[a30_0x56ab93(0xcd)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a30_0x56ab93(0xd0)](_0x2e7f33){const _0x3954ce=a30_0x56ab93,{options:_0x2e9c03,args:_0x48dddf,tdx:_0x32897b}=_0x2e7f33,_0x5d9f19=_0x2e9c03,_0x47f297=await resolveTarget({'arg':_0x48dddf[0x0],'contextParent':_0x2e9c03[_0x3954ce(0xf6)],'cwd':process[_0x3954ce(0xb2)]()});if(!isSuccessfulResolution(_0x47f297))return _0x47f297[_0x3954ce(0xb5)]===_0x3954ce(0xd2)?(console[_0x3954ce(0xe5)](a30_0x28c8ed[_0x3954ce(0xbd)](_0x3954ce(0xec))),console[_0x3954ce(0xe5)](_0x3954ce(0xd8)),console['error'](_0x3954ce(0xcb)),console['error'](_0x3954ce(0xdd))):(console[_0x3954ce(0xe5)](a30_0x28c8ed[_0x3954ce(0xb8)]('Error:\x20'+_0x47f297['message']+'\x0a')),_0x47f297[_0x3954ce(0xe6)]&&console[_0x3954ce(0xe5)](a30_0x28c8ed['cyan'](_0x47f297[_0x3954ce(0xe6)]))),0x1;const _0x5ec17e=_0x47f297['parentName'],_0x475b6e=_0x47f297[_0x3954ce(0xe1)],_0x8bea5f=_0x47f297[_0x3954ce(0xae)]==='file'?_0x47f297['resourceName']:undefined;_0x5d9f19['verbose']&&(console[_0x3954ce(0xe5)]('Site:\x20'+_0x5d9f19[_0x3954ce(0xd7)]),console[_0x3954ce(0xe5)]('Parent\x20segment:\x20'+_0x5ec17e),_0x8bea5f&&console[_0x3954ce(0xe5)](_0x3954ce(0xf4)+_0x8bea5f));const _0x543131=await withProgressSpinner(_0x3954ce(0xb1)+_0x5ec17e+_0x3954ce(0xe3),_0x189bcc=>_0x32897b[_0x3954ce(0xc0)]['pullSegments'](_0x5ec17e,{'targetDir':_0x475b6e,'targetResourceName':_0x8bea5f,'verbose':_0x5d9f19['verbose'],'progress':{'update':_0x8729ab=>{const _0x20d360=_0x3954ce;_0x189bcc['setPhase'](_0x8729ab),_0x5d9f19[_0x20d360(0xbf)]&&console[_0x20d360(0xe5)]('\x20\x20'+_0x8729ab);}}}),{'verbose':_0x5d9f19[_0x3954ce(0xbf)]}),_0x1a7250=_0x543131[_0x3954ce(0xe8)];if(_0x1a7250[_0x3954ce(0xfa)][_0x3954ce(0xee)]===0x0&&_0x1a7250['counts'][_0x3954ce(0xb6)]===0x0)return console[_0x3954ce(0xe5)](a30_0x28c8ed[_0x3954ce(0xbd)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x1a7250[_0x3954ce(0xf2)]+'\x27')),0x0;const _0x1ff2a1=_0x1a7250['files']['filter'](_0x5a26e1=>_0x5a26e1[_0x3954ce(0xce)]),_0x241719=_0x1a7250[_0x3954ce(0xf3)][_0x3954ce(0xb0)](_0x1e2472=>!_0x1e2472[_0x3954ce(0xce)]&&_0x1e2472['hasChanges']),_0x4eca95=_0x1a7250[_0x3954ce(0xf3)][_0x3954ce(0xb0)](_0x4fc35c=>!_0x4fc35c[_0x3954ce(0xce)]&&!_0x4fc35c[_0x3954ce(0xc8)]);console[_0x3954ce(0xe5)](_0x3954ce(0xdf)+_0x1a7250[_0x3954ce(0xf2)]+'\x27:'),console[_0x3954ce(0xe5)]('\x20\x20🎯\x20'+a30_0x28c8ed[_0x3954ce(0xb3)](_0x1a7250[_0x3954ce(0xfa)][_0x3954ce(0xee)]+'\x20segments')+_0x3954ce(0xde)+a30_0x28c8ed[_0x3954ce(0xb3)](_0x1a7250[_0x3954ce(0xfa)][_0x3954ce(0xb4)]+_0x3954ce(0xdc)));if(_0x1a7250[_0x3954ce(0xfa)]['journeys']>0x0){const _0x3e9a49=_0x1a7250[_0x3954ce(0xfa)]['journeyVersions']>_0x1a7250[_0x3954ce(0xfa)][_0x3954ce(0xb6)]?'\x20('+_0x1a7250[_0x3954ce(0xfa)][_0x3954ce(0xc6)]+_0x3954ce(0xd1):'';console[_0x3954ce(0xe5)]('\x20\x20πŸ—ΊοΈ\x20\x20'+a30_0x28c8ed['cyan'](_0x1a7250['counts'][_0x3954ce(0xb6)]+'\x20journeys')+a30_0x28c8ed[_0x3954ce(0xea)](_0x3e9a49));}console[_0x3954ce(0xe5)]('\x20\x20'+a30_0x28c8ed[_0x3954ce(0xcc)]('+\x20'+_0x1ff2a1[_0x3954ce(0xd5)]+_0x3954ce(0xc7))),console[_0x3954ce(0xe5)]('\x20\x20'+a30_0x28c8ed[_0x3954ce(0xbd)]('~\x20'+_0x241719[_0x3954ce(0xd5)]+_0x3954ce(0xeb))),console[_0x3954ce(0xe5)]('\x20\x20'+a30_0x28c8ed[_0x3954ce(0xea)]('=\x20'+_0x4eca95[_0x3954ce(0xd5)]+_0x3954ce(0xc1))),console['error'](_0x3954ce(0xba)+a30_0x28c8ed[_0x3954ce(0xb3)](_0x1a7250[_0x3954ce(0xe1)])+'\x0a');if(_0x241719[_0x3954ce(0xd5)]>0x0)for(const _0x15a03c of _0x241719){console[_0x3954ce(0xe5)](_0x3954ce(0xc4)+_0x15a03c[_0x3954ce(0xc9)]+'\x27:'),console[_0x3954ce(0xe5)]('─'[_0x3954ce(0xf0)](0x3c)),console[_0x3954ce(0xe5)](_0x15a03c[_0x3954ce(0xd6)]),console[_0x3954ce(0xe5)]('─'[_0x3954ce(0xf0)](0x3c));}if(_0x5d9f19[_0x3954ce(0xca)])return console[_0x3954ce(0xe5)](a30_0x28c8ed[_0x3954ce(0xbd)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1ff2a1[_0x3954ce(0xd5)]===0x0&&_0x241719[_0x3954ce(0xd5)]===0x0)return console[_0x3954ce(0xe5)](a30_0x28c8ed['green'](_0x3954ce(0xcf))),saveSessionContext({'parent_segment':_0x1a7250[_0x3954ce(0xf2)]},_0x5d9f19[_0x3954ce(0xf8)]),console[_0x3954ce(0xe5)](a30_0x28c8ed['green']('βœ”\x20Context\x20set:\x20'+a30_0x28c8ed[_0x3954ce(0xea)](_0x3954ce(0xe2))+_0x3954ce(0xc2)+a30_0x28c8ed[_0x3954ce(0xb3)](_0x1a7250[_0x3954ce(0xf2)]))),0x0;if(!_0x5d9f19['yes']){if(!isInteractive())return console[_0x3954ce(0xe5)](a30_0x28c8ed[_0x3954ce(0xb8)](_0x3954ce(0xc5)),_0x3954ce(0xb9)),console['error'](a30_0x28c8ed[_0x3954ce(0xea)](_0x3954ce(0xe9))),0x1;const _0x38759f=await confirmKey(_0x3954ce(0xef)+(_0x1ff2a1['length']+_0x241719['length'])+_0x3954ce(0xc3));if(!_0x38759f)return console['error'](a30_0x28c8ed['yellow']('Aborted.'),_0x3954ce(0xdb)),0x1;}for(const _0x2d601c of _0x1a7250['files']){if(_0x2d601c[_0x3954ce(0xce)]||_0x2d601c[_0x3954ce(0xc8)]){const _0x24424d=a30_0x5e7b22[_0x3954ce(0xd3)](_0x2d601c[_0x3954ce(0xf1)]);!existsSync(_0x24424d)&&mkdirSync(_0x24424d,{'recursive':!![]}),writeFileSync(_0x2d601c[_0x3954ce(0xf1)],_0x2d601c[_0x3954ce(0xe0)],'utf-8');}}return console['error'](a30_0x28c8ed[_0x3954ce(0xcc)](_0x3954ce(0xaf)+(_0x1ff2a1['length']+_0x241719[_0x3954ce(0xd5)])+_0x3954ce(0xed)+_0x1a7250[_0x3954ce(0xe1)])),saveSessionContext({'parent_segment':_0x1a7250[_0x3954ce(0xf2)]},_0x5d9f19[_0x3954ce(0xf8)]),console[_0x3954ce(0xe5)](a30_0x28c8ed[_0x3954ce(0xcc)](_0x3954ce(0xf9)+a30_0x28c8ed[_0x3954ce(0xea)]('parent_segment')+_0x3954ce(0xc2)+a30_0x28c8ed['cyan'](_0x1a7250[_0x3954ce(0xf2)]))),0x0;}}
1
+ const a30_0x1ce53d=a30_0x3f98;(function(_0x245a5e,_0x20aceb){const _0x47b236=a30_0x3f98,_0x7592f7=_0x245a5e();while(!![]){try{const _0x307f97=parseInt(_0x47b236(0x14e))/0x1+parseInt(_0x47b236(0x143))/0x2+-parseInt(_0x47b236(0x180))/0x3+parseInt(_0x47b236(0x15d))/0x4*(-parseInt(_0x47b236(0x17d))/0x5)+parseInt(_0x47b236(0x156))/0x6+-parseInt(_0x47b236(0x14f))/0x7*(parseInt(_0x47b236(0x179))/0x8)+parseInt(_0x47b236(0x173))/0x9*(parseInt(_0x47b236(0x155))/0xa);if(_0x307f97===_0x20aceb)break;else _0x7592f7['push'](_0x7592f7['shift']());}catch(_0x31820a){_0x7592f7['push'](_0x7592f7['shift']());}}}(a30_0x2e8c,0x8f72b));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a30_0x2e8c(){const _0x866104=['668908sjbNmg','dirname','\x20versions)','\x20unchanged\x20files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segments','\x0aPull\x20summary\x20for\x20\x27','βœ”\x20Context\x20set:\x20','\x20activations','green','message','383087mqibch','1990198goEskt','isNew','Site:\x20','cyan','counts','\x20\x20🎯\x20','15303180lGtkrV','5496558VJBQsI','absolutePath','Error:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','hasChanges','file','\x20files\x20to\x20','40CmkfbN','yes','\x20segments','-\x20no\x20files\x20written','segment','setPhase','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','diff','execute','session','dim','yellow','journeys','repeat','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','site','parent_segment','journeyVersions','\x20=\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Write\x20','verbose','9PlFWlG','helpText','\x20with\x20','parentName','no_parent','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','32evAStG','description','filter','errorCode','389885mObtOO','files','pullSegments','1978089dwlRNp','activations','length','error','content','\x20\x20πŸ—ΊοΈ\x20\x20','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','parentSegment','\x20new\x20files','\x20journeys','\x27...','utf-8','\x20\x20Target:\x20'];a30_0x2e8c=function(){return _0x866104;};return a30_0x2e8c();}import a30_0x5623ec from'chalk';function a30_0x3f98(_0x1147b5,_0x1ed07c){_0x1147b5=_0x1147b5-0x140;const _0x2e8c5d=a30_0x2e8c();let _0x3f9880=_0x2e8c5d[_0x1147b5];return _0x3f9880;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x89cf23 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a30_0x1ce53d(0x17a)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a30_0x1ce53d(0x165)](_0x2f427a){const _0x239252=a30_0x1ce53d,{options:_0x171734,args:_0x2251ac,tdx:_0x37f8d7}=_0x2f427a,_0x191f5c=_0x171734,_0x3c3c5a=await resolveTarget({'arg':_0x2251ac[0x0],'contextParent':_0x171734[_0x239252(0x188)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3c3c5a))return _0x3c3c5a[_0x239252(0x17c)]===_0x239252(0x177)?(console[_0x239252(0x183)](a30_0x5623ec[_0x239252(0x168)](_0x239252(0x170))),console[_0x239252(0x183)]('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)'),console['error'](_0x239252(0x163)),console[_0x239252(0x183)](_0x239252(0x187))):(console[_0x239252(0x183)](a30_0x5623ec['red'](_0x239252(0x158)+_0x3c3c5a[_0x239252(0x14d)]+'\x0a')),_0x3c3c5a[_0x239252(0x174)]&&console[_0x239252(0x183)](a30_0x5623ec[_0x239252(0x152)](_0x3c3c5a[_0x239252(0x174)]))),0x1;const _0x2bf9a2=_0x3c3c5a[_0x239252(0x176)],_0x511165=_0x3c3c5a['targetDir'],_0x74d7bb=_0x3c3c5a['type']===_0x239252(0x15b)?_0x3c3c5a['resourceName']:undefined;_0x191f5c[_0x239252(0x172)]&&(console['error'](_0x239252(0x151)+_0x191f5c[_0x239252(0x16c)]),console[_0x239252(0x183)]('Parent\x20segment:\x20'+_0x2bf9a2),_0x74d7bb&&console[_0x239252(0x183)]('Target\x20resource:\x20'+_0x74d7bb));const _0x576b71=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x2bf9a2+_0x239252(0x140),_0x1b22fc=>_0x37f8d7[_0x239252(0x161)][_0x239252(0x17f)](_0x2bf9a2,{'targetDir':_0x511165,'targetResourceName':_0x74d7bb,'verbose':_0x191f5c[_0x239252(0x172)],'progress':{'update':_0x2ec560=>{const _0x272b00=_0x239252;_0x1b22fc[_0x272b00(0x162)](_0x2ec560),_0x191f5c[_0x272b00(0x172)]&&console[_0x272b00(0x183)]('\x20\x20'+_0x2ec560);}}}),{'verbose':_0x191f5c[_0x239252(0x172)]}),_0x38bd0e=_0x576b71['data'];if(_0x38bd0e[_0x239252(0x153)][_0x239252(0x148)]===0x0&&_0x38bd0e[_0x239252(0x153)][_0x239252(0x169)]===0x0)return console['error'](a30_0x5623ec[_0x239252(0x168)](_0x239252(0x16b)+_0x38bd0e[_0x239252(0x176)]+'\x27')),0x0;const _0x3ddb17=_0x38bd0e['files']['filter'](_0x260e35=>_0x260e35[_0x239252(0x150)]),_0x2df319=_0x38bd0e['files'][_0x239252(0x17b)](_0x382233=>!_0x382233[_0x239252(0x150)]&&_0x382233[_0x239252(0x15a)]),_0x220126=_0x38bd0e[_0x239252(0x17e)]['filter'](_0x1a5c44=>!_0x1a5c44[_0x239252(0x150)]&&!_0x1a5c44[_0x239252(0x15a)]);console['error'](_0x239252(0x149)+_0x38bd0e[_0x239252(0x176)]+'\x27:'),console[_0x239252(0x183)](_0x239252(0x154)+a30_0x5623ec[_0x239252(0x152)](_0x38bd0e[_0x239252(0x153)]['segments']+_0x239252(0x15f))+_0x239252(0x175)+a30_0x5623ec[_0x239252(0x152)](_0x38bd0e[_0x239252(0x153)][_0x239252(0x181)]+_0x239252(0x14b)));if(_0x38bd0e[_0x239252(0x153)][_0x239252(0x169)]>0x0){const _0x4c712f=_0x38bd0e['counts']['journeyVersions']>_0x38bd0e[_0x239252(0x153)][_0x239252(0x169)]?'\x20('+_0x38bd0e[_0x239252(0x153)][_0x239252(0x16e)]+_0x239252(0x145):'';console[_0x239252(0x183)](_0x239252(0x185)+a30_0x5623ec[_0x239252(0x152)](_0x38bd0e[_0x239252(0x153)][_0x239252(0x169)]+_0x239252(0x18a))+a30_0x5623ec[_0x239252(0x167)](_0x4c712f));}console['error']('\x20\x20'+a30_0x5623ec['green']('+\x20'+_0x3ddb17[_0x239252(0x182)]+_0x239252(0x189))),console[_0x239252(0x183)]('\x20\x20'+a30_0x5623ec['yellow']('~\x20'+_0x2df319[_0x239252(0x182)]+'\x20changed\x20files')),console[_0x239252(0x183)]('\x20\x20'+a30_0x5623ec[_0x239252(0x167)]('=\x20'+_0x220126['length']+_0x239252(0x146))),console[_0x239252(0x183)](_0x239252(0x142)+a30_0x5623ec[_0x239252(0x152)](_0x38bd0e['targetDir'])+'\x0a');if(_0x2df319['length']>0x0)for(const _0x1dfea5 of _0x2df319){console['error']('\x0aChanges\x20to\x20\x27'+_0x1dfea5['relativePath']+'\x27:'),console['error']('─'[_0x239252(0x16a)](0x3c)),console[_0x239252(0x183)](_0x1dfea5[_0x239252(0x164)]),console['error']('─'[_0x239252(0x16a)](0x3c));}if(_0x191f5c['dryRun'])return console[_0x239252(0x183)](a30_0x5623ec[_0x239252(0x168)](_0x239252(0x159))),0x0;if(_0x3ddb17[_0x239252(0x182)]===0x0&&_0x2df319['length']===0x0)return console['error'](a30_0x5623ec[_0x239252(0x14c)](_0x239252(0x178))),saveSessionContext({'parent_segment':_0x38bd0e[_0x239252(0x176)]},_0x191f5c[_0x239252(0x166)]),console[_0x239252(0x183)](a30_0x5623ec[_0x239252(0x14c)](_0x239252(0x14a)+a30_0x5623ec[_0x239252(0x167)](_0x239252(0x16d))+_0x239252(0x16f)+a30_0x5623ec['cyan'](_0x38bd0e[_0x239252(0x176)]))),0x0;if(!_0x191f5c[_0x239252(0x15e)]){if(!isInteractive())return console[_0x239252(0x183)](a30_0x5623ec[_0x239252(0x186)]('\x0aError:'),_0x239252(0x147)),console[_0x239252(0x183)](a30_0x5623ec['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1766d3=await confirmKey(_0x239252(0x171)+(_0x3ddb17[_0x239252(0x182)]+_0x2df319[_0x239252(0x182)])+'\x20files?');if(!_0x1766d3)return console[_0x239252(0x183)](a30_0x5623ec['yellow']('Aborted.'),_0x239252(0x160)),0x1;}for(const _0x25935b of _0x38bd0e[_0x239252(0x17e)]){if(_0x25935b['isNew']||_0x25935b[_0x239252(0x15a)]){const _0x14a284=a30_0x89cf23[_0x239252(0x144)](_0x25935b[_0x239252(0x157)]);!existsSync(_0x14a284)&&mkdirSync(_0x14a284,{'recursive':!![]}),writeFileSync(_0x25935b[_0x239252(0x157)],_0x25935b[_0x239252(0x184)],_0x239252(0x141));}}return console[_0x239252(0x183)](a30_0x5623ec[_0x239252(0x14c)]('βœ”\x20Pulled\x20'+(_0x3ddb17['length']+_0x2df319[_0x239252(0x182)])+_0x239252(0x15c)+_0x38bd0e['targetDir'])),saveSessionContext({'parent_segment':_0x38bd0e[_0x239252(0x176)]},_0x191f5c[_0x239252(0x166)]),console[_0x239252(0x183)](a30_0x5623ec['green'](_0x239252(0x14a)+a30_0x5623ec[_0x239252(0x167)]('parent_segment')+_0x239252(0x16f)+a30_0x5623ec[_0x239252(0x152)](_0x38bd0e[_0x239252(0x176)]))),0x0;}}
@@ -1 +1 @@
1
- const a31_0x594b11=a31_0x9dc6;(function(_0x4ede01,_0x8ea6cf){const _0x599053=a31_0x9dc6,_0x269a2f=_0x4ede01();while(!![]){try{const _0x378416=parseInt(_0x599053(0xd5))/0x1*(parseInt(_0x599053(0xe3))/0x2)+parseInt(_0x599053(0xf3))/0x3+parseInt(_0x599053(0xe8))/0x4*(-parseInt(_0x599053(0xe0))/0x5)+parseInt(_0x599053(0xd1))/0x6*(-parseInt(_0x599053(0xf9))/0x7)+-parseInt(_0x599053(0x141))/0x8*(-parseInt(_0x599053(0x150))/0x9)+parseInt(_0x599053(0x149))/0xa+-parseInt(_0x599053(0x137))/0xb;if(_0x378416===_0x8ea6cf)break;else _0x269a2f['push'](_0x269a2f['shift']());}catch(_0x5b8baf){_0x269a2f['push'](_0x269a2f['shift']());}}}(a31_0x26f9,0xb07c1));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 a31_0x28fa27 from'chalk';function a31_0x26f9(){const _0x2b5951=['all','toCreate','cwd','yellow','errorCode','\x20YAML\x20files\x20found','dim','endsWith','filter','\x20to\x20delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','diff','targetDir','deleted','\x20\x20Journeys:\x20','listActivations','parentName','verbose','Source\x20directory:\x20','attributes','Changes\x20to\x20journey:','folderPath','map','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Resolving\x20parent\x20segment\x20\x27','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Aborted.','yes','No\x20','parentFolder','error','segment','name','getOutputSchemaWithCache','description','paused','versionNumber','list','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','createdSegmentIds','\x20\x20Source:\x20','Folders\x20to\x20create:','push','folders','then','nameToType','\x20new','Error\x20parsing\x20YAML:\x20','toDelete','idToName','buildUserMaps','Fetching\x20existing\x20folders...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aError:','10867164uNyTii','createdAt','\x20changes?','segment:push','\x0aβœ”\x20Push\x20complete','Delete\x20journey:','\x20created','scopedFolderPath','helpText','site','8mwNRZk','\x20\x20Activations:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','cyan','Error:\x20Directory\x20not\x20found:\x20','\x20activations]','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20deleted','5955980jUssWk','nameToId','journeyId','changed','updatedAt','listSegments','resolveParentId','7650423IYUkZh','red','journeyBundleId','.yaml','isNew','\x27...','data','activations','join','segments','length','filePath','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20folders\x20to\x20create','\x0aValidation\x20failed:','repeat','toString','getJourney','journeysOnly','\x20\x20\x20\x20','\x20updated','journeys','\x20\x20Activations:\x20','green','listFolders','/j/da/je','file','Fetching\x20existing\x20activations...','\x20changed','updated','segmentFolderId','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','206478ryvMiM','type','/e/','message','23mjvdJY','audienceId','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','get','dryRun','Site:\x20','Changes\x20to:','πŸ“\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journeyBundleName','state','25JDHvuA','Push\x20','blue','104094jfQDyM','/app/ps/','connection','\x20to\x20create','New\x20journey:','536156VcsPmj','yamlConfig','folderId','unchanged','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toUpdate','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Error:\x20','Preparing\x20journeys...','created','journey','969885XuIeFk','isScoped','set','Parent\x20segment:\x20','delete','results','119yjjsaD','segment\x20or\x20journey','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Fetching\x20users\x20for\x20email\x20resolution...','new','Fetching\x20existing\x20segments...','getParent'];a31_0x26f9=function(){return _0x2b5951;};return a31_0x26f9();}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a31_0x9dc6(_0x29f064,_0x1759aa){_0x29f064=_0x29f064-0xcf;const _0x26f949=a31_0x26f9();let _0x9dc6c9=_0x26f949[_0x29f064];return _0x9dc6c9;}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a31_0x594b11(0x13a);[a31_0x594b11(0x123)]=a31_0x594b11(0x11a);async['execute'](_0x529d4b){const _0x1e62b0=a31_0x594b11,{options:_0x9fdbd1,args:_0x399e64,tdx:_0x103359}=_0x529d4b,_0x8d33a5=_0x9fdbd1,_0x444271=await resolveTarget({'arg':_0x399e64[0x0],'contextParent':_0x9fdbd1['parentSegment'],'cwd':process[_0x1e62b0(0x102)]()});if(!isSuccessfulResolution(_0x444271))return _0x444271[_0x1e62b0(0x104)]==='no_parent'?(console['error'](a31_0x28fa27[_0x1e62b0(0x103)](_0x1e62b0(0xdd))),console[_0x1e62b0(0x11f)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x1e62b0(0x11f)](_0x1e62b0(0x10a)),console[_0x1e62b0(0x11f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x151)](_0x1e62b0(0xef)+_0x444271[_0x1e62b0(0xd4)]+'\x0a')),_0x444271[_0x1e62b0(0x13f)]&&console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x144)](_0x444271[_0x1e62b0(0x13f)]))),0x1;if(_0x444271['type']==='parent_name')return console['error'](a31_0x28fa27[_0x1e62b0(0x151)](_0x1e62b0(0x145)+_0x444271[_0x1e62b0(0x10d)]+'\x0a')),console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x144)](_0x1e62b0(0xec))),0x1;const _0x556efd=_0x444271[_0x1e62b0(0x111)],_0x471191=_0x444271[_0x1e62b0(0x10d)],_0x7a6c64=_0x444271[_0x1e62b0(0xd2)]===_0x1e62b0(0x16a)?_0x444271[_0x1e62b0(0x15b)]:undefined,_0x1d970e=getScopedDetails(_0x444271),_0x2e0b04=_0x1d970e?.[_0x1e62b0(0xf4)]??![],_0x17e18e=_0x1d970e?.[_0x1e62b0(0x13e)]??'';if(!existsSync(_0x471191))return console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x151)](_0x1e62b0(0x145)+_0x471191+'\x0a')),console[_0x1e62b0(0x11f)](a31_0x28fa27['cyan'](_0x1e62b0(0xec))),0x1;_0x8d33a5[_0x1e62b0(0x112)]&&(console[_0x1e62b0(0x11f)](_0x1e62b0(0xda)+_0x8d33a5['site']),console[_0x1e62b0(0x11f)](_0x1e62b0(0xf6)+_0x556efd),console['error'](_0x1e62b0(0x113)+_0x471191),_0x2e0b04&&console[_0x1e62b0(0x11f)]('Scoped\x20to\x20folder:\x20'+_0x17e18e));const _0x5765d5=await withSpinner(_0x1e62b0(0x119)+_0x556efd+_0x1e62b0(0x155),()=>_0x103359[_0x1e62b0(0x120)][_0x1e62b0(0x14f)](_0x556efd),{'verbose':_0x8d33a5[_0x1e62b0(0x112)]}),_0x251477=_0x5765d5['data'],[_0x37836c,_0x900fd5,_0x5cbe80,_0x203b1d,_0x3a9431]=await Promise['all']([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x103359[_0x1e62b0(0x120)][_0x1e62b0(0xff)](_0x251477),{'verbose':_0x8d33a5['verbose']}),withSpinner(_0x1e62b0(0xfe),()=>_0x103359['segment'][_0x1e62b0(0x14e)](_0x251477),{'verbose':_0x8d33a5[_0x1e62b0(0x112)]}),withSpinner(_0x1e62b0(0x134),()=>_0x103359[_0x1e62b0(0x120)][_0x1e62b0(0x168)](_0x251477),{'verbose':_0x8d33a5[_0x1e62b0(0x112)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x103359[_0x1e62b0(0xf2)]['listJourneysWithDetailsFromParentSegment'](_0x251477,{'includeAllVersions':!![]}),{'verbose':_0x8d33a5[_0x1e62b0(0x112)]}),withSpinner(_0x1e62b0(0xfc),()=>_0x103359['user'][_0x1e62b0(0x133)](),{'verbose':_0x8d33a5['verbose']})[_0x1e62b0(0x12d)](_0xa10e1b=>_0xa10e1b[_0x1e62b0(0x156)])]),_0x14945d=_0x37836c[_0x1e62b0(0x156)],_0x3b62c1=extractRootFolderId(_0x14945d),_0x356771=_0x900fd5['data'],_0xad569a=_0x5cbe80[_0x1e62b0(0x156)],{journeys:_0x738b47,activationStepsById:_0x3c16f2}=_0x203b1d[_0x1e62b0(0x156)],_0x14737a=new Map(_0x738b47['map'](_0x25250f=>[_0x25250f['id'],_0x25250f])),_0x1dbeb3=_0x738b47[_0x1e62b0(0x117)](_0x3265c9=>({'id':_0x3265c9['id'],'name':_0x3265c9[_0x1e62b0(0x114)][_0x1e62b0(0x121)],'journeyBundleName':_0x3265c9[_0x1e62b0(0x114)][_0x1e62b0(0xde)]||'','journeyBundleId':_0x3265c9[_0x1e62b0(0x114)][_0x1e62b0(0x152)]||'','versionNumber':_0x3265c9[_0x1e62b0(0x114)][_0x1e62b0(0x125)],'description':_0x3265c9[_0x1e62b0(0x114)]['description'],'state':_0x3265c9[_0x1e62b0(0x114)][_0x1e62b0(0xdf)],'paused':_0x3265c9['attributes'][_0x1e62b0(0x124)],'audienceId':_0x3265c9['attributes'][_0x1e62b0(0xd6)],'folderId':_0x3265c9['relationships']?.[_0x1e62b0(0x11e)]?.[_0x1e62b0(0x156)]?.['id'],'createdAt':_0x3265c9['attributes'][_0x1e62b0(0x138)],'updatedAt':_0x3265c9['attributes'][_0x1e62b0(0x14d)]})),{emailToId:_0x4399cf,idToEmail:_0xeda80}=_0x3a9431,_0x3a1bfb=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xb9692d=_0x1e62b0,_0x4a2323=await _0x103359[_0xb9692d(0xe5)][_0xb9692d(0x126)]();return buildConnectionMaps(_0x4a2323);},{'verbose':_0x8d33a5[_0x1e62b0(0x112)]})[_0x1e62b0(0x12d)](_0x108676=>_0x108676[_0x1e62b0(0x156)]),_0x27007e=_0x3a1bfb[_0x1e62b0(0x14a)],_0x112d92=_0x3a1bfb[_0x1e62b0(0x132)],_0x59e0b5=_0x3a1bfb[_0x1e62b0(0x12e)],_0x5b2634={'emailToIdMap':_0x4399cf,'connectionNameToIdMap':_0x27007e,'connectionNameToTypeMap':_0x59e0b5,'getSchema':_0x3cf906=>_0x103359[_0x1e62b0(0xe5)][_0x1e62b0(0x122)](_0x3cf906)};let {pathToId:_0x21b0ff,idToPath:_0x12a36a}=buildFolderMaps(_0xad569a);const _0x11a4f1=buildSegmentLookupMap(_0x356771,_0x12a36a),_0x4a5092=buildSegmentNameToIdMap(_0x356771),_0x2abe29=buildJourneyBundleLookupMap(_0x1dbeb3,_0x12a36a);let _0x445781;if(_0x7a6c64){if(!_0x7a6c64[_0x1e62b0(0x107)]('.yml')&&!_0x7a6c64['endsWith'](_0x1e62b0(0x153)))return console['error'](a31_0x28fa27[_0x1e62b0(0x151)](_0x1e62b0(0xd7)+_0x7a6c64+'\x0a')),0x1;_0x445781=[_0x7a6c64];}else _0x445781=findYamlFiles(_0x471191);if(_0x445781['length']===0x0)return console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x151)](_0x1e62b0(0x147)+_0x471191+'\x0a')),console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x144)](_0x1e62b0(0x15c))),0x1;let _0x2b08ab,_0x499d53;try{const _0x588d98=parseAndClassifyYamlFiles(_0x445781,_0x471191,{'skipSegments':_0x8d33a5[_0x1e62b0(0x162)]});_0x2b08ab=_0x588d98[_0x1e62b0(0x159)],_0x499d53=_0x588d98['journeys'];const _0x61ae9c=validateParsedFiles(_0x588d98,_0x471191);if(_0x61ae9c[_0x1e62b0(0x15a)]>0x0)return console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x151)](_0x1e62b0(0x15e))),console[_0x1e62b0(0x11f)](formatValidationErrors(_0x61ae9c)),console['error'](a31_0x28fa27[_0x1e62b0(0x103)](_0x1e62b0(0x118))),0x1;}catch(_0x165e87){return console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x151)](_0x1e62b0(0x130)+(_0x165e87 instanceof Error?_0x165e87['message']:_0x165e87))),0x1;}if(_0x2b08ab[_0x1e62b0(0x15a)]===0x0&&_0x499d53['length']===0x0){const _0xf42610=_0x8d33a5[_0x1e62b0(0x162)]?_0x1e62b0(0xf2):_0x1e62b0(0xfa);return console['error'](a31_0x28fa27[_0x1e62b0(0x103)](_0x1e62b0(0x11d)+_0xf42610+_0x1e62b0(0x105))),0x0;}const _0x23abaa=new Map();_0x356771[_0x1e62b0(0x15a)]>0x0&&!_0x8d33a5[_0x1e62b0(0x162)]&&await withSpinner(_0x1e62b0(0x16b),async()=>{await batchAsync(_0x356771,async _0x1758dc=>{const _0x3c9e93=a31_0x9dc6,_0xc6de99=await _0x103359[_0x3c9e93(0x120)][_0x3c9e93(0x110)](_0x251477,_0x1758dc['id']);_0x23abaa['set'](_0x1758dc['id'],_0xc6de99);});},{'verbose':_0x8d33a5[_0x1e62b0(0x112)]});const {segmentFiles:_0x2c6ca8,foldersToCreate:_0x5de586}=await prepareSegmentFiles(_0x2b08ab,{'segmentByFolderAndName':_0x11a4f1,'activationsBySegmentId':_0x23abaa,'folderPathToId':_0x21b0ff,'idToEmailMap':_0xeda80,'connectionIdToNameMap':_0x112d92},_0x5b2634,_0x2e0b04,_0x17e18e),_0x44ae86=_0x7a6c64?[]:findSegmentsToDelete(_0x356771,_0x2b08ab['map'](({yamlConfig:_0x2150fb,folderPath:_0x31e298})=>({'yamlConfig':_0x2150fb,'folderPath':resolveTDFolderPath(_0x31e298,_0x2e0b04,_0x17e18e)})),_0x12a36a,_0x17e18e,_0x2e0b04),{journeyFiles:_0x548b94,foldersToCreate:_0x59ba58}=await withProgressSpinner(_0x1e62b0(0xf0),async _0x238187=>prepareJourneyFiles(_0x499d53,{'fetchJourney':async _0x39a0f0=>_0x103359[_0x1e62b0(0xf2)][_0x1e62b0(0x161)](_0x39a0f0[_0x1e62b0(0x14b)]),'journeyBundlesByFolderAndName':_0x2abe29,'folderPathToId':_0x21b0ff,'idToEmailMap':_0xeda80,'connectionIdToNameMap':_0x112d92,'existingSegments':_0x356771,'parentId':_0x251477,'deps':_0x103359,'progress':{'update':_0x3af91b=>{const _0x10b7c6=_0x1e62b0;_0x238187['setPhase'](_0x3af91b),_0x8d33a5['verbose']&&console[_0x10b7c6(0x11f)]('\x20\x20'+_0x3af91b);}},'journeyById':_0x14737a,'activationStepsById':_0x3c16f2},_0x2e0b04,_0x17e18e),{'verbose':_0x8d33a5['verbose']})['then'](_0x27aba7=>_0x27aba7['data']);for(const _0x5427d8 of _0x59ba58){_0x5de586['add'](_0x5427d8);}const _0x169cd3=_0x7a6c64?[]:findJourneysToDelete(_0x1dbeb3,_0x499d53[_0x1e62b0(0x117)](({yamlConfig:_0x46ae2b,folderPath:_0x212bdd})=>({'yamlConfig':_0x46ae2b,'folderPath':resolveTDFolderPath(_0x212bdd,_0x2e0b04,_0x17e18e)})),_0x12a36a,_0x17e18e,_0x2e0b04),_0x5574b9=calculatePushStats(_0x2c6ca8,_0x548b94,_0x5de586,_0x44ae86,_0x169cd3,!!_0x8d33a5[_0x1e62b0(0xf7)],!!_0x8d33a5[_0x1e62b0(0x162)]),_0x1590bc=_0x5574b9[_0x1e62b0(0x159)][_0x1e62b0(0xfd)],_0x52f79e=_0x5574b9[_0x1e62b0(0x159)][_0x1e62b0(0x14c)],_0xb98480=_0x5574b9[_0x1e62b0(0x159)][_0x1e62b0(0xeb)],_0x5881b2=_0x5574b9[_0x1e62b0(0x159)][_0x1e62b0(0x131)],_0x460bab=_0x5574b9[_0x1e62b0(0x12c)][_0x1e62b0(0x101)],_0x33737b=_0x5574b9[_0x1e62b0(0x165)][_0x1e62b0(0xfd)],_0x2b60b0=_0x5574b9[_0x1e62b0(0x165)][_0x1e62b0(0x14c)],_0x3f130a=_0x5574b9['journeys'][_0x1e62b0(0xeb)],_0x23adb8=_0x5574b9[_0x1e62b0(0x165)][_0x1e62b0(0x131)],_0x1cf758=_0x5574b9[_0x1e62b0(0x157)][_0x1e62b0(0x100)],_0xcc0495=_0x5574b9[_0x1e62b0(0x157)]['toCreate'],_0x533cb7=_0x5574b9[_0x1e62b0(0x157)][_0x1e62b0(0xed)],_0x1fef40=_0x5574b9[_0x1e62b0(0x157)][_0x1e62b0(0x131)];console[_0x1e62b0(0x11f)]('\x0aPush\x20summary\x20for\x20\x27'+_0x556efd+'\x27:');_0x460bab[_0x1e62b0(0x15a)]>0x0&&console[_0x1e62b0(0x11f)]('\x20\x20'+a31_0x28fa27[_0x1e62b0(0xe2)](_0x1e62b0(0xdc)+_0x460bab[_0x1e62b0(0x15a)]+_0x1e62b0(0x15d)));if(!_0x8d33a5[_0x1e62b0(0x162)]){console[_0x1e62b0(0x11f)]('\x20\x20πŸ“Š\x20Segments:'),console[_0x1e62b0(0x11f)]('\x20\x20\x20\x20'+a31_0x28fa27['green']('+\x20'+_0x1590bc['length']+_0x1e62b0(0x12f))),console[_0x1e62b0(0x11f)]('\x20\x20\x20\x20'+a31_0x28fa27[_0x1e62b0(0x103)]('~\x20'+_0x52f79e[_0x1e62b0(0x15a)]+_0x1e62b0(0x16c)));if(_0x5881b2[_0x1e62b0(0x15a)]>0x0)console['error'](_0x1e62b0(0x163)+a31_0x28fa27[_0x1e62b0(0x151)]('-\x20'+_0x5881b2[_0x1e62b0(0x15a)]+_0x1e62b0(0x109)));else _0x44ae86['length']>0x0&&!_0x8d33a5[_0x1e62b0(0xf7)]&&console[_0x1e62b0(0x11f)](_0x1e62b0(0x163)+a31_0x28fa27[_0x1e62b0(0x106)](_0x44ae86[_0x1e62b0(0x15a)]+_0x1e62b0(0x127)));console[_0x1e62b0(0x11f)](_0x1e62b0(0x163)+a31_0x28fa27[_0x1e62b0(0x106)]('=\x20'+_0xb98480[_0x1e62b0(0x15a)]+'\x20unchanged'));}if(_0x548b94[_0x1e62b0(0x15a)]>0x0||_0x169cd3[_0x1e62b0(0x15a)]>0x0){console[_0x1e62b0(0x11f)](_0x1e62b0(0xd0)),console[_0x1e62b0(0x11f)](_0x1e62b0(0x163)+a31_0x28fa27[_0x1e62b0(0x167)]('+\x20'+_0x33737b[_0x1e62b0(0x15a)]+'\x20new')),console['error']('\x20\x20\x20\x20'+a31_0x28fa27[_0x1e62b0(0x103)]('~\x20'+_0x2b60b0[_0x1e62b0(0x15a)]+_0x1e62b0(0x16c)));if(_0x23adb8[_0x1e62b0(0x15a)]>0x0)console[_0x1e62b0(0x11f)]('\x20\x20\x20\x20'+a31_0x28fa27[_0x1e62b0(0x151)]('-\x20'+_0x23adb8['length']+'\x20to\x20delete'));else _0x169cd3['length']>0x0&&!_0x8d33a5[_0x1e62b0(0xf7)]&&console[_0x1e62b0(0x11f)](_0x1e62b0(0x163)+a31_0x28fa27[_0x1e62b0(0x106)](_0x169cd3[_0x1e62b0(0x15a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x1e62b0(0x11f)](_0x1e62b0(0x163)+a31_0x28fa27['dim']('=\x20'+_0x3f130a[_0x1e62b0(0x15a)]+'\x20unchanged'));}_0x1cf758[_0x1e62b0(0x15a)]>0x0&&!_0x8d33a5['journeysOnly']&&(console['error'](''),console[_0x1e62b0(0x11f)](_0x1e62b0(0x142)),_0xcc0495[_0x1e62b0(0x15a)]>0x0&&console[_0x1e62b0(0x11f)](_0x1e62b0(0x163)+a31_0x28fa27[_0x1e62b0(0x167)]('+\x20'+_0xcc0495[_0x1e62b0(0x15a)]+_0x1e62b0(0xe6))),_0x533cb7[_0x1e62b0(0x15a)]>0x0&&console[_0x1e62b0(0x11f)]('\x20\x20\x20\x20'+a31_0x28fa27[_0x1e62b0(0x103)]('~\x20'+_0x533cb7[_0x1e62b0(0x15a)]+'\x20to\x20update')),_0x1fef40[_0x1e62b0(0x15a)]>0x0&&console[_0x1e62b0(0x11f)](_0x1e62b0(0x163)+a31_0x28fa27[_0x1e62b0(0x151)]('-\x20'+_0x1fef40['length']+_0x1e62b0(0x109))));console[_0x1e62b0(0x11f)](_0x1e62b0(0x129)+a31_0x28fa27['cyan'](_0x471191)+'\x0a');if(_0x460bab['length']>0x0){console[_0x1e62b0(0x11f)](_0x1e62b0(0x12a));for(const _0x1f9d5e of _0x460bab){console[_0x1e62b0(0x11f)]('\x20\x20'+a31_0x28fa27[_0x1e62b0(0xe2)]('+')+'\x20'+_0x1f9d5e);}console[_0x1e62b0(0x11f)]('');}if(_0x1590bc[_0x1e62b0(0x15a)]>0x0&&!_0x8d33a5[_0x1e62b0(0x162)])for(const _0x43b847 of _0x1590bc){const _0x5a3d0b=_0x43b847[_0x1e62b0(0x116)]?_0x43b847[_0x1e62b0(0x116)]+'/'+_0x43b847[_0x1e62b0(0xe9)][_0x1e62b0(0x121)]:_0x43b847[_0x1e62b0(0xe9)]['name'],_0x2c2587=_0x43b847[_0x1e62b0(0xe9)][_0x1e62b0(0x157)]?.[_0x1e62b0(0x15a)]||0x0,_0x6892d3=_0x2c2587>0x0?a31_0x28fa27[_0x1e62b0(0x106)]('\x20['+_0x2c2587+_0x1e62b0(0x146)):'';console['error']('\x0a'+a31_0x28fa27[_0x1e62b0(0x167)]('New\x20segment:')+'\x20'+_0x5a3d0b+_0x6892d3),console[_0x1e62b0(0x11f)]('─'[_0x1e62b0(0x15f)](0x3c)),_0x43b847[_0x1e62b0(0x10c)]&&console['error'](_0x43b847[_0x1e62b0(0x10c)]),console['error']('─'[_0x1e62b0(0x15f)](0x3c));}if(_0x5881b2[_0x1e62b0(0x15a)]>0x0&&!_0x8d33a5[_0x1e62b0(0x162)])for(const _0x32bcb8 of _0x5881b2){const _0x207088=_0x32bcb8['segmentFolderId']?_0x12a36a[_0x1e62b0(0xd8)](_0x32bcb8[_0x1e62b0(0xcf)][_0x1e62b0(0x160)]())||'':'',_0x16bc60=_0x207088?_0x207088+'/'+_0x32bcb8[_0x1e62b0(0x121)]:_0x32bcb8[_0x1e62b0(0x121)],_0x5570f5=_0x23abaa[_0x1e62b0(0xd8)](_0x32bcb8['id'])||[],_0x4235fc=_0x5570f5[_0x1e62b0(0x15a)]>0x0?a31_0x28fa27[_0x1e62b0(0x106)]('\x20['+_0x5570f5[_0x1e62b0(0x15a)]+_0x1e62b0(0x146)):'';console[_0x1e62b0(0x11f)]('\x0a'+a31_0x28fa27[_0x1e62b0(0x151)]('Delete\x20segment:')+'\x20'+_0x16bc60+_0x4235fc),console[_0x1e62b0(0x11f)]('─'['repeat'](0x3c));const _0x480f04=segmentWithActivationsToYaml(_0x32bcb8,_0x5570f5,undefined,_0xeda80,_0x112d92),_0x5617f9=segmentToYamlString(_0x480f04),_0x2c0785=generateDiff(_0x5617f9,'');console[_0x1e62b0(0x11f)](formatDiffWithColors(_0x2c0785)),console[_0x1e62b0(0x11f)]('─'[_0x1e62b0(0x15f)](0x3c));}const _0x52cbb9=_0x2c6ca8[_0x1e62b0(0x108)](_0x1ad91f=>!_0x1ad91f[_0x1e62b0(0x154)]&&_0x1ad91f[_0x1e62b0(0x10c)]);if(_0x52cbb9[_0x1e62b0(0x15a)]>0x0&&!_0x8d33a5[_0x1e62b0(0x162)])for(const _0x152be8 of _0x52cbb9){const _0x60b4f3=_0x152be8[_0x1e62b0(0x116)]?_0x152be8[_0x1e62b0(0x116)]+'/'+_0x152be8[_0x1e62b0(0xe9)][_0x1e62b0(0x121)]:_0x152be8[_0x1e62b0(0xe9)][_0x1e62b0(0x121)];console['error']('\x0a'+a31_0x28fa27['yellow'](_0x1e62b0(0xdb))+'\x20'+_0x60b4f3),console[_0x1e62b0(0x11f)]('─'[_0x1e62b0(0x15f)](0x3c)),console['error'](_0x152be8[_0x1e62b0(0x10c)]),console[_0x1e62b0(0x11f)]('─'[_0x1e62b0(0x15f)](0x3c));}if(_0x33737b[_0x1e62b0(0x15a)]>0x0)for(const _0x4e8f7a of _0x33737b){const _0x34cd5e=_0x4e8f7a['folderPath']?_0x4e8f7a[_0x1e62b0(0x116)]+'/'+_0x4e8f7a['yamlConfig'][_0x1e62b0(0x121)]:_0x4e8f7a['yamlConfig'][_0x1e62b0(0x121)];console[_0x1e62b0(0x11f)]('\x0a'+a31_0x28fa27[_0x1e62b0(0x167)](_0x1e62b0(0xe7))+'\x20'+_0x34cd5e),console['error']('─'[_0x1e62b0(0x15f)](0x3c)),_0x4e8f7a[_0x1e62b0(0x10c)]&&console[_0x1e62b0(0x11f)](_0x4e8f7a[_0x1e62b0(0x10c)]),console[_0x1e62b0(0x11f)]('─'['repeat'](0x3c));}const _0x582b12=_0x548b94['filter'](_0xd3897b=>!_0xd3897b['isNew']&&_0xd3897b[_0x1e62b0(0x10c)]);if(_0x582b12[_0x1e62b0(0x15a)]>0x0)for(const _0x8a8773 of _0x582b12){const _0x45086e=_0x8a8773['folderPath']?_0x8a8773[_0x1e62b0(0x116)]+'/'+_0x8a8773[_0x1e62b0(0xe9)]['name']:_0x8a8773[_0x1e62b0(0xe9)]['name'];console['error']('\x0a'+a31_0x28fa27[_0x1e62b0(0x103)](_0x1e62b0(0x115))+'\x20'+_0x45086e),console[_0x1e62b0(0x11f)]('─'[_0x1e62b0(0x15f)](0x3c)),console[_0x1e62b0(0x11f)](_0x8a8773[_0x1e62b0(0x10c)]),console[_0x1e62b0(0x11f)]('─'[_0x1e62b0(0x15f)](0x3c));}if(_0x23adb8[_0x1e62b0(0x15a)]>0x0)for(const _0x4efcda of _0x23adb8){const _0x1fb817=_0x4efcda[_0x1e62b0(0xea)]?_0x12a36a['get'](_0x4efcda[_0x1e62b0(0xea)])||'':'',_0x2d90e7=_0x1fb817?_0x1fb817+'/'+_0x4efcda[_0x1e62b0(0xde)]:_0x4efcda[_0x1e62b0(0xde)];console[_0x1e62b0(0x11f)]('\x0a'+a31_0x28fa27[_0x1e62b0(0x151)](_0x1e62b0(0x13c))+'\x20'+_0x2d90e7),console[_0x1e62b0(0x11f)]('─'['repeat'](0x3c)),console[_0x1e62b0(0x11f)](a31_0x28fa27['red']('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x1e62b0(0x15f)](0x3c));}if(_0x8d33a5[_0x1e62b0(0xd9)])return console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x103)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x4df157=_0x8d33a5['journeysOnly']?![]:_0x1590bc[_0x1e62b0(0x15a)]>0x0||_0x52f79e[_0x1e62b0(0x15a)]>0x0||_0x5881b2[_0x1e62b0(0x15a)]>0x0,_0x1b679a=_0x33737b[_0x1e62b0(0x15a)]>0x0||_0x2b60b0['length']>0x0||_0x23adb8[_0x1e62b0(0x15a)]>0x0,_0x2af858=_0x8d33a5[_0x1e62b0(0x162)]?![]:_0x1cf758[_0x1e62b0(0x15a)]>0x0,_0x17f9e3=_0x460bab[_0x1e62b0(0x15a)]>0x0;if(!_0x4df157&&!_0x1b679a&&!_0x2af858&&!_0x17f9e3){const _0x2b9439=_0x8d33a5[_0x1e62b0(0x162)]?_0x1e62b0(0x10b):_0x1e62b0(0xee);console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x167)](_0x2b9439));if(_0x7a6c64&&_0x3f130a['length']===0x1){const _0x4e6a6b=_0x3f130a[0x0];if(_0x4e6a6b['existingJourney']?.['id']){const _0x5922fe=getConsoleNextUrl(_0x8d33a5[_0x1e62b0(0x140)],_0x1e62b0(0xe4)+_0x251477+_0x1e62b0(0xd3)+_0x4e6a6b['existingJourney']['id']+_0x1e62b0(0x169));console['error']('\x20\x20'+a31_0x28fa27[_0x1e62b0(0x144)](_0x5922fe));}}return 0x0;}const _0x402e07=_0x8d33a5[_0x1e62b0(0x162)]?_0x33737b[_0x1e62b0(0x15a)]+_0x2b60b0[_0x1e62b0(0x15a)]+_0x23adb8[_0x1e62b0(0x15a)]+_0x460bab[_0x1e62b0(0x15a)]:_0x1590bc[_0x1e62b0(0x15a)]+_0x52f79e['length']+_0x5881b2[_0x1e62b0(0x15a)]+_0x33737b[_0x1e62b0(0x15a)]+_0x2b60b0['length']+_0x23adb8['length']+_0x460bab['length']+_0x1cf758[_0x1e62b0(0x15a)];if(!_0x8d33a5[_0x1e62b0(0x11c)]&&_0x402e07>0x0){if(!isInteractive())return console[_0x1e62b0(0x11f)](a31_0x28fa27['red'](_0x1e62b0(0x136)),_0x1e62b0(0x135)),console['error'](a31_0x28fa27[_0x1e62b0(0x106)](_0x1e62b0(0xfb))),0x1;const _0x19dead=await confirmKey(_0x1e62b0(0xe1)+_0x402e07+_0x1e62b0(0x139));if(!_0x19dead)return console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x103)](_0x1e62b0(0x11b))),0x1;}const _0x6b1f68={'withProgress':async(_0x35087d,_0xe9bab8)=>{const _0x455ee=_0x1e62b0,_0x2c7873=await withSpinner(_0x35087d,_0xe9bab8,{'verbose':_0x8d33a5['verbose']});return{'data':_0x2c7873[_0x455ee(0x156)]};},'logInfo':_0xfcbc01=>console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0xe2)]('βœ”\x20'+_0xfcbc01)),'logSuccess':_0x262365=>console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x167)]('βœ”\x20'+_0x262365)),'logWarning':_0x4ddefa=>console[_0x1e62b0(0x11f)](a31_0x28fa27['yellow']('⚠\x20'+_0x4ddefa)),'logDeleted':_0x1c94bb=>console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x151)]('βœ”\x20'+_0x1c94bb))},_0x426ed9={'segment':_0x103359[_0x1e62b0(0x120)],'journey':_0x103359[_0x1e62b0(0xf2)],'user':_0x103359['user'],'connection':_0x103359[_0x1e62b0(0xe5)]};_0x460bab[_0x1e62b0(0x15a)]>0x0&&(_0x21b0ff=await executePushFolders(_0x426ed9,_0x460bab,_0x21b0ff,{'parentId':_0x251477},_0x6b1f68));const _0x143f4f={'rootFolderId':_0x3b62c1,'folderPathToId':_0x21b0ff,'folderIdToPath':_0x12a36a,'segmentNameToId':_0x4a5092,'activationsBySegmentId':_0x23abaa,'emailToIdMap':_0x4399cf,'idToEmailMap':_0xeda80,'connectionNameToIdMap':_0x3a1bfb['nameToId'],'connectionIdToNameMap':_0x3a1bfb[_0x1e62b0(0x132)],'connectionNameToTypeMap':_0x59e0b5},_0x9b94ee=await executePushSegments(_0x426ed9,_0x8d33a5[_0x1e62b0(0x162)]?[]:_0x2c6ca8,_0x143f4f,{'parentId':_0x251477},_0x6b1f68),_0x5e70dd=_0x9b94ee[_0x1e62b0(0xf1)],_0x3d4b7d=_0x9b94ee[_0x1e62b0(0x16d)],_0xeb3220=_0x9b94ee['activations']['created'],_0x7495d1=_0x9b94ee[_0x1e62b0(0x157)][_0x1e62b0(0x16d)],_0x5704ba=_0x9b94ee[_0x1e62b0(0x157)][_0x1e62b0(0x10e)],_0x1c51d9=await executePushSegmentDeletions(_0x426ed9,_0x8d33a5[_0x1e62b0(0x162)]?[]:_0x5881b2,_0x6b1f68);let _0x4d2827=0x0,_0x54647d=0x0,_0x34a4ea=0x0;const _0x4b3fed=new Map(_0x4a5092);for(const [_0x4a4750,_0x4f5511]of _0x9b94ee[_0x1e62b0(0x128)]){_0x4b3fed[_0x1e62b0(0xf5)](_0x4a4750,_0x4f5511);}if(_0x548b94['length']>0x0){const _0x58ec28={..._0x143f4f,'segmentNameToId':_0x4b3fed,'existingSegments':_0x356771,'activationContext':_0x5b2634},_0x4fadc1=await executePushJourneys(_0x426ed9,_0x548b94,_0x58ec28,{'parentId':_0x251477,'rootFolderId':_0x3b62c1,'verbose':_0x8d33a5['verbose']},_0x6b1f68);_0x4d2827=_0x4fadc1[_0x1e62b0(0xf1)],_0x54647d=_0x4fadc1['updated'];if(_0x7a6c64&&_0x4fadc1[_0x1e62b0(0xf8)]['length']===0x1){const _0x15a9ae=_0x4fadc1['results'][0x0];if(_0x15a9ae['journeyId']){const _0x5a7a04=getConsoleNextUrl(_0x8d33a5[_0x1e62b0(0x140)],_0x1e62b0(0xe4)+_0x251477+_0x1e62b0(0xd3)+_0x15a9ae[_0x1e62b0(0x14b)]+_0x1e62b0(0x169));console[_0x1e62b0(0x11f)]('\x20\x20'+a31_0x28fa27[_0x1e62b0(0x144)](_0x5a7a04));}}}for(const _0x6b7785 of _0x23adb8){console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x103)](_0x1e62b0(0x143)+_0x6b7785[_0x1e62b0(0xde)])),_0x34a4ea++;}const _0x503241=[];if(_0x5e70dd>0x0)_0x503241['push'](_0x5e70dd+_0x1e62b0(0x13d));if(_0x3d4b7d>0x0)_0x503241['push'](_0x3d4b7d+'\x20updated');if(_0x1c51d9>0x0)_0x503241['push'](_0x1c51d9+_0x1e62b0(0x148));const _0x49498f=[];if(_0x4d2827>0x0)_0x49498f[_0x1e62b0(0x12b)](_0x4d2827+'\x20created');if(_0x54647d>0x0)_0x49498f[_0x1e62b0(0x12b)](_0x54647d+_0x1e62b0(0x164));if(_0x34a4ea>0x0)_0x49498f[_0x1e62b0(0x12b)](_0x34a4ea+'\x20deleted');const _0x9e8844=[];if(_0xeb3220>0x0)_0x9e8844['push'](_0xeb3220+_0x1e62b0(0x13d));if(_0x7495d1>0x0)_0x9e8844['push'](_0x7495d1+_0x1e62b0(0x164));if(_0x5704ba>0x0)_0x9e8844[_0x1e62b0(0x12b)](_0x5704ba+'\x20deleted');return console[_0x1e62b0(0x11f)](a31_0x28fa27[_0x1e62b0(0x167)](_0x1e62b0(0x13b))),_0x503241[_0x1e62b0(0x15a)]>0x0&&!_0x8d33a5[_0x1e62b0(0x162)]&&console[_0x1e62b0(0x11f)]('\x20\x20Segments:\x20'+_0x503241[_0x1e62b0(0x158)](',\x20')),_0x49498f[_0x1e62b0(0x15a)]>0x0&&console[_0x1e62b0(0x11f)](_0x1e62b0(0x10f)+_0x49498f['join'](',\x20')),_0x9e8844['length']>0x0&&!_0x8d33a5['journeysOnly']&&console[_0x1e62b0(0x11f)](_0x1e62b0(0x166)+_0x9e8844[_0x1e62b0(0x158)](',\x20')),0x0;}}
1
+ const a31_0x1b7467=a31_0x4679;(function(_0x5a9ddb,_0x3f83f6){const _0x5173b3=a31_0x4679,_0x115fbc=_0x5a9ddb();while(!![]){try{const _0x216b94=-parseInt(_0x5173b3(0x17d))/0x1*(-parseInt(_0x5173b3(0x174))/0x2)+parseInt(_0x5173b3(0x1b5))/0x3*(-parseInt(_0x5173b3(0x1dd))/0x4)+-parseInt(_0x5173b3(0x176))/0x5+parseInt(_0x5173b3(0x16f))/0x6*(-parseInt(_0x5173b3(0x155))/0x7)+-parseInt(_0x5173b3(0x19f))/0x8+-parseInt(_0x5173b3(0x1ab))/0x9*(-parseInt(_0x5173b3(0x15d))/0xa)+parseInt(_0x5173b3(0x165))/0xb;if(_0x216b94===_0x3f83f6)break;else _0x115fbc['push'](_0x115fbc['shift']());}catch(_0x5dbf49){_0x115fbc['push'](_0x115fbc['shift']());}}}(a31_0x3d26,0xc834b));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a31_0x4679(_0x427075,_0x252ced){_0x427075=_0x427075-0x14f;const _0x3d2697=a31_0x3d26();let _0x4679da=_0x3d2697[_0x427075];return _0x4679da;}import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a31_0x3d26(){const _0x4ac5ea=['parentSegment','green','Fetching\x20existing\x20folders...','message','.yml','journeysOnly','repeat','then','\x0aValidation\x20failed:','name','Fetching\x20existing\x20journeys...','map','cyan','error','listActivations','/e/','21JUxBes','(Journey\x20will\x20be\x20deleted)','file','setPhase','segments','targetDir','attributes','Folders\x20to\x20create:','10FIbdqS','Resolving\x20parent\x20segment\x20\x27','\x20\x20Journeys:\x20','yamlConfig','\x20created','user','list','\x20new','41106747ZokKlh','filePath','folderId','results','folderPath','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)','Fetching\x20connections\x20for\x20name\x20resolution...','no_parent','Parent\x20segment:\x20','\x20unchanged','3065658zvdnfD','No\x20','state','existingJourney','parentName','10078mqqIBu','nameToType','3663715sdsbKE','scopedFolderPath','deleted','cwd','paused','toString','journeyBundleId','205XorGWL','connection','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','delete','Fetching\x20existing\x20segments...','New\x20segment:','journeyId','.yaml','updated','relationships','type','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20updated','changed','dryRun','\x0aError:','segment','resolveParentId','created','getParent','dim','toUpdate','filter','Delete\x20segment:','\x20\x20Segments:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20πŸ“Š\x20Segments:','all','Delete\x20journey:','segmentFolderId','πŸ“\x20','diff','length','6618768HHgFEq','endsWith','description','versionNumber','nameToId','parentFolder','yellow','\x20changed','verbose','Fetching\x20parent\x20segment\x20details...','updatedAt','\x20to\x20delete','3293037hnSjJx','unchanged','helpText','Error\x20parsing\x20YAML:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','createdAt','\x20folders\x20to\x20create','\x20to\x20create','listSegments','listFolders','852qFsnwQ','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','join','site','/j/da/je','\x0aPush\x20summary\x20for\x20\x27','parent_name','Push\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','get','blue','\x20deleted','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Fetching\x20users\x20for\x20email\x20resolution...','\x20changes?','journeys','activations','data','Changes\x20to:','yes','\x20\x20Activations:\x20','\x20\x20\x20\x20','journeyBundleName','red','push','\x20activations]','Error:\x20Directory\x20not\x20found:\x20','isNew','idToName','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','getJourney','new','isScoped','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','toDelete','17224OnqvRx','/app/ps/','audienceId','createdSegmentIds','set','getOutputSchemaWithCache','toCreate','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a31_0x3d26=function(){return _0x4ac5ea;};return a31_0x3d26();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x4c9dba from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']='segment:push';[a31_0x1b7467(0x1a1)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a31_0x1b7467(0x1d4)](_0x2e762a){const _0x4ba892=a31_0x1b7467,{options:_0x524227,args:_0x3392be,tdx:_0x90e34a}=_0x2e762a,_0x15101f=_0x524227,_0x1c0ba1=await resolveTarget({'arg':_0x3392be[0x0],'contextParent':_0x524227[_0x4ba892(0x1e5)],'cwd':process[_0x4ba892(0x179)]()});if(!isSuccessfulResolution(_0x1c0ba1))return _0x1c0ba1['errorCode']===_0x4ba892(0x16c)?(console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1a5)](_0x4ba892(0x1e4))),console['error'](_0x4ba892(0x16a)),console[_0x4ba892(0x152)](_0x4ba892(0x197)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1ce)]('Error:\x20'+_0x1c0ba1[_0x4ba892(0x1e8)]+'\x0a')),_0x1c0ba1[_0x4ba892(0x1ad)]&&console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x151)](_0x1c0ba1['helpText']))),0x1;if(_0x1c0ba1['type']===_0x4ba892(0x1bc))return console['error'](a31_0x4c9dba[_0x4ba892(0x1ce)](_0x4ba892(0x1d1)+_0x1c0ba1[_0x4ba892(0x15a)]+'\x0a')),console['error'](a31_0x4c9dba[_0x4ba892(0x151)](_0x4ba892(0x1db))),0x1;const _0x4c169b=_0x1c0ba1[_0x4ba892(0x173)],_0x4493e2=_0x1c0ba1['targetDir'],_0x10e27c=_0x1c0ba1[_0x4ba892(0x187)]===_0x4ba892(0x157)?_0x1c0ba1[_0x4ba892(0x166)]:undefined,_0x25fc9d=getScopedDetails(_0x1c0ba1),_0x2c27f7=_0x25fc9d?.[_0x4ba892(0x1d9)]??![],_0x391204=_0x25fc9d?.[_0x4ba892(0x177)]??'';if(!existsSync(_0x4493e2))return console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1ce)](_0x4ba892(0x1d1)+_0x4493e2+'\x0a')),console[_0x4ba892(0x152)](a31_0x4c9dba['cyan'](_0x4ba892(0x1db))),0x1;_0x15101f[_0x4ba892(0x1a7)]&&(console[_0x4ba892(0x152)]('Site:\x20'+_0x15101f['site']),console[_0x4ba892(0x152)](_0x4ba892(0x16d)+_0x4c169b),console[_0x4ba892(0x152)]('Source\x20directory:\x20'+_0x4493e2),_0x2c27f7&&console[_0x4ba892(0x152)]('Scoped\x20to\x20folder:\x20'+_0x391204));const _0x400deb=await withSpinner(_0x4ba892(0x15e)+_0x4c169b+'\x27...',()=>_0x90e34a[_0x4ba892(0x18e)][_0x4ba892(0x18f)](_0x4c169b),{'verbose':_0x15101f[_0x4ba892(0x1a7)]}),_0x96b819=_0x400deb[_0x4ba892(0x1c8)],[_0x350caf,_0x1e4257,_0x4750ea,_0x50295a,_0xc6f116]=await Promise[_0x4ba892(0x199)]([withSpinner(_0x4ba892(0x1a8),()=>_0x90e34a[_0x4ba892(0x18e)][_0x4ba892(0x191)](_0x96b819),{'verbose':_0x15101f['verbose']}),withSpinner(_0x4ba892(0x181),()=>_0x90e34a[_0x4ba892(0x18e)][_0x4ba892(0x1b3)](_0x96b819),{'verbose':_0x15101f[_0x4ba892(0x1a7)]}),withSpinner(_0x4ba892(0x1e7),()=>_0x90e34a[_0x4ba892(0x18e)][_0x4ba892(0x1b4)](_0x96b819),{'verbose':_0x15101f['verbose']}),withSpinner(_0x4ba892(0x14f),()=>_0x90e34a[_0x4ba892(0x1b6)]['listJourneysWithDetailsFromParentSegment'](_0x96b819,{'includeAllVersions':!![]}),{'verbose':_0x15101f[_0x4ba892(0x1a7)]}),withSpinner(_0x4ba892(0x1c4),()=>_0x90e34a[_0x4ba892(0x162)]['buildUserMaps'](),{'verbose':_0x15101f[_0x4ba892(0x1a7)]})['then'](_0x3edd29=>_0x3edd29[_0x4ba892(0x1c8)])]),_0x3a58b7=_0x350caf[_0x4ba892(0x1c8)],_0x3e1bba=extractRootFolderId(_0x3a58b7),_0x4df39e=_0x1e4257['data'],_0x175b76=_0x4750ea['data'],{journeys:_0x3e1e36,activationStepsById:_0x4f4175}=_0x50295a[_0x4ba892(0x1c8)],_0x10d577=new Map(_0x3e1e36[_0x4ba892(0x150)](_0x3d55c0=>[_0x3d55c0['id'],_0x3d55c0])),_0xbbcbe9=_0x3e1e36[_0x4ba892(0x150)](_0x38b02d=>({'id':_0x38b02d['id'],'name':_0x38b02d[_0x4ba892(0x15b)][_0x4ba892(0x1ee)],'journeyBundleName':_0x38b02d[_0x4ba892(0x15b)][_0x4ba892(0x1cd)]||'','journeyBundleId':_0x38b02d[_0x4ba892(0x15b)][_0x4ba892(0x17c)]||'','versionNumber':_0x38b02d[_0x4ba892(0x15b)][_0x4ba892(0x1a2)],'description':_0x38b02d[_0x4ba892(0x15b)]['description'],'state':_0x38b02d[_0x4ba892(0x15b)][_0x4ba892(0x171)],'paused':_0x38b02d[_0x4ba892(0x15b)][_0x4ba892(0x17a)],'audienceId':_0x38b02d[_0x4ba892(0x15b)][_0x4ba892(0x1df)],'folderId':_0x38b02d[_0x4ba892(0x186)]?.[_0x4ba892(0x1a4)]?.[_0x4ba892(0x1c8)]?.['id'],'createdAt':_0x38b02d['attributes'][_0x4ba892(0x1b0)],'updatedAt':_0x38b02d['attributes'][_0x4ba892(0x1a9)]})),{emailToId:_0x325468,idToEmail:_0x2a3062}=_0xc6f116,_0x405b63=await withSpinner(_0x4ba892(0x16b),async()=>{const _0x3a9cff=_0x4ba892,_0x4e7b8f=await _0x90e34a[_0x3a9cff(0x17e)][_0x3a9cff(0x163)]();return buildConnectionMaps(_0x4e7b8f);},{'verbose':_0x15101f['verbose']})[_0x4ba892(0x1ec)](_0x52e4f7=>_0x52e4f7[_0x4ba892(0x1c8)]),_0x3e080f=_0x405b63[_0x4ba892(0x1a3)],_0x22d8cf=_0x405b63[_0x4ba892(0x1d3)],_0x2e9d5a=_0x405b63[_0x4ba892(0x175)],_0x297677={'emailToIdMap':_0x325468,'connectionNameToIdMap':_0x3e080f,'connectionNameToTypeMap':_0x2e9d5a,'getSchema':_0x38cf04=>_0x90e34a[_0x4ba892(0x17e)][_0x4ba892(0x1e2)](_0x38cf04)};let {pathToId:_0x37b794,idToPath:_0x4f4377}=buildFolderMaps(_0x175b76);const _0x33edea=buildSegmentLookupMap(_0x4df39e,_0x4f4377),_0x4246d9=buildSegmentNameToIdMap(_0x4df39e),_0x2fd3de=buildJourneyBundleLookupMap(_0xbbcbe9,_0x4f4377);let _0x4f18bd;if(_0x10e27c){if(!_0x10e27c[_0x4ba892(0x1a0)](_0x4ba892(0x1e9))&&!_0x10e27c[_0x4ba892(0x1a0)](_0x4ba892(0x184)))return console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1ce)](_0x4ba892(0x17f)+_0x10e27c+'\x0a')),0x1;_0x4f18bd=[_0x10e27c];}else _0x4f18bd=findYamlFiles(_0x4493e2);if(_0x4f18bd[_0x4ba892(0x19e)]===0x0)return console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1ce)](_0x4ba892(0x1b7)+_0x4493e2+'\x0a')),console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x151)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x19a82c,_0x2d442b;try{const _0x1b61bc=parseAndClassifyYamlFiles(_0x4f18bd,_0x4493e2,{'skipSegments':_0x15101f[_0x4ba892(0x1ea)]});_0x19a82c=_0x1b61bc[_0x4ba892(0x159)],_0x2d442b=_0x1b61bc[_0x4ba892(0x1c6)];const _0x567c85=validateParsedFiles(_0x1b61bc,_0x4493e2);if(_0x567c85[_0x4ba892(0x19e)]>0x0)return console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1ce)](_0x4ba892(0x1ed))),console['error'](formatValidationErrors(_0x567c85)),console[_0x4ba892(0x152)](a31_0x4c9dba['yellow'](_0x4ba892(0x1be))),0x1;}catch(_0x19c14b){return console['error'](a31_0x4c9dba[_0x4ba892(0x1ce)](_0x4ba892(0x1ae)+(_0x19c14b instanceof Error?_0x19c14b['message']:_0x19c14b))),0x1;}if(_0x19a82c[_0x4ba892(0x19e)]===0x0&&_0x2d442b['length']===0x0){const _0x3aff57=_0x15101f[_0x4ba892(0x1ea)]?_0x4ba892(0x1b6):'segment\x20or\x20journey';return console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1a5)](_0x4ba892(0x170)+_0x3aff57+'\x20YAML\x20files\x20found')),0x0;}const _0x4b71d3=new Map();_0x4df39e['length']>0x0&&!_0x15101f[_0x4ba892(0x1ea)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x4df39e,async _0x259c89=>{const _0x27d243=a31_0x4679,_0x2b6d2d=await _0x90e34a[_0x27d243(0x18e)][_0x27d243(0x153)](_0x96b819,_0x259c89['id']);_0x4b71d3[_0x27d243(0x1e1)](_0x259c89['id'],_0x2b6d2d);});},{'verbose':_0x15101f[_0x4ba892(0x1a7)]});const {segmentFiles:_0x56be2a,foldersToCreate:_0x4c3368}=await prepareSegmentFiles(_0x19a82c,{'segmentByFolderAndName':_0x33edea,'activationsBySegmentId':_0x4b71d3,'folderPathToId':_0x37b794,'idToEmailMap':_0x2a3062,'connectionIdToNameMap':_0x22d8cf},_0x297677,_0x2c27f7,_0x391204),_0x542946=_0x10e27c?[]:findSegmentsToDelete(_0x4df39e,_0x19a82c[_0x4ba892(0x150)](({yamlConfig:_0x9a02de,folderPath:_0x90af6d})=>({'yamlConfig':_0x9a02de,'folderPath':resolveTDFolderPath(_0x90af6d,_0x2c27f7,_0x391204)})),_0x4f4377,_0x391204,_0x2c27f7),{journeyFiles:_0x32d1f0,foldersToCreate:_0x3f36ba}=await withProgressSpinner('Preparing\x20journeys...',async _0x374e7d=>prepareJourneyFiles(_0x2d442b,{'fetchJourney':async _0x10c583=>_0x90e34a[_0x4ba892(0x1b6)][_0x4ba892(0x1d7)](_0x10c583[_0x4ba892(0x183)]),'journeyBundlesByFolderAndName':_0x2fd3de,'folderPathToId':_0x37b794,'idToEmailMap':_0x2a3062,'connectionIdToNameMap':_0x22d8cf,'existingSegments':_0x4df39e,'parentId':_0x96b819,'deps':_0x90e34a,'progress':{'update':_0x57b06a=>{const _0x1fda5c=_0x4ba892;_0x374e7d[_0x1fda5c(0x158)](_0x57b06a),_0x15101f[_0x1fda5c(0x1a7)]&&console[_0x1fda5c(0x152)]('\x20\x20'+_0x57b06a);}},'journeyById':_0x10d577,'activationStepsById':_0x4f4175},_0x2c27f7,_0x391204),{'verbose':_0x15101f[_0x4ba892(0x1a7)]})[_0x4ba892(0x1ec)](_0x167226=>_0x167226[_0x4ba892(0x1c8)]);for(const _0x11b977 of _0x3f36ba){_0x4c3368['add'](_0x11b977);}const _0x59c006=_0x10e27c?[]:findJourneysToDelete(_0xbbcbe9,_0x2d442b[_0x4ba892(0x150)](({yamlConfig:_0x409dae,folderPath:_0x37d706})=>({'yamlConfig':_0x409dae,'folderPath':resolveTDFolderPath(_0x37d706,_0x2c27f7,_0x391204)})),_0x4f4377,_0x391204,_0x2c27f7),_0x384a2a=calculatePushStats(_0x56be2a,_0x32d1f0,_0x4c3368,_0x542946,_0x59c006,!!_0x15101f[_0x4ba892(0x180)],!!_0x15101f[_0x4ba892(0x1ea)]),_0x45c0a2=_0x384a2a[_0x4ba892(0x159)]['new'],_0x4dc254=_0x384a2a[_0x4ba892(0x159)][_0x4ba892(0x18b)],_0x6a56fb=_0x384a2a[_0x4ba892(0x159)][_0x4ba892(0x1ac)],_0x5b45f1=_0x384a2a[_0x4ba892(0x159)][_0x4ba892(0x1dc)],_0x5ff0e4=_0x384a2a['folders']['toCreate'],_0xae9220=_0x384a2a[_0x4ba892(0x1c6)][_0x4ba892(0x1d8)],_0x3c3066=_0x384a2a[_0x4ba892(0x1c6)]['changed'],_0x5b135f=_0x384a2a[_0x4ba892(0x1c6)][_0x4ba892(0x1ac)],_0x5af782=_0x384a2a[_0x4ba892(0x1c6)][_0x4ba892(0x1dc)],_0x4abe82=_0x384a2a['activations'][_0x4ba892(0x199)],_0x37b5ef=_0x384a2a[_0x4ba892(0x1c7)][_0x4ba892(0x1e3)],_0x43e331=_0x384a2a[_0x4ba892(0x1c7)][_0x4ba892(0x193)],_0x134442=_0x384a2a[_0x4ba892(0x1c7)]['toDelete'];console[_0x4ba892(0x152)](_0x4ba892(0x1bb)+_0x4c169b+'\x27:');_0x5ff0e4['length']>0x0&&console[_0x4ba892(0x152)]('\x20\x20'+a31_0x4c9dba['blue'](_0x4ba892(0x19c)+_0x5ff0e4['length']+_0x4ba892(0x1b1)));if(!_0x15101f[_0x4ba892(0x1ea)]){console['error'](_0x4ba892(0x198)),console[_0x4ba892(0x152)](_0x4ba892(0x1cc)+a31_0x4c9dba[_0x4ba892(0x1e6)]('+\x20'+_0x45c0a2['length']+_0x4ba892(0x164))),console[_0x4ba892(0x152)](_0x4ba892(0x1cc)+a31_0x4c9dba[_0x4ba892(0x1a5)]('~\x20'+_0x4dc254[_0x4ba892(0x19e)]+_0x4ba892(0x1a6)));if(_0x5b45f1['length']>0x0)console[_0x4ba892(0x152)](_0x4ba892(0x1cc)+a31_0x4c9dba['red']('-\x20'+_0x5b45f1[_0x4ba892(0x19e)]+'\x20to\x20delete'));else _0x542946[_0x4ba892(0x19e)]>0x0&&!_0x15101f['delete']&&console[_0x4ba892(0x152)]('\x20\x20\x20\x20'+a31_0x4c9dba['dim'](_0x542946[_0x4ba892(0x19e)]+_0x4ba892(0x1d6)));console[_0x4ba892(0x152)](_0x4ba892(0x1cc)+a31_0x4c9dba[_0x4ba892(0x192)]('=\x20'+_0x6a56fb['length']+'\x20unchanged'));}if(_0x32d1f0['length']>0x0||_0x59c006[_0x4ba892(0x19e)]>0x0){console['error'](_0x4ba892(0x188)),console[_0x4ba892(0x152)]('\x20\x20\x20\x20'+a31_0x4c9dba[_0x4ba892(0x1e6)]('+\x20'+_0xae9220[_0x4ba892(0x19e)]+'\x20new')),console['error'](_0x4ba892(0x1cc)+a31_0x4c9dba['yellow']('~\x20'+_0x3c3066['length']+_0x4ba892(0x1a6)));if(_0x5af782[_0x4ba892(0x19e)]>0x0)console['error'](_0x4ba892(0x1cc)+a31_0x4c9dba[_0x4ba892(0x1ce)]('-\x20'+_0x5af782['length']+_0x4ba892(0x1aa)));else _0x59c006[_0x4ba892(0x19e)]>0x0&&!_0x15101f[_0x4ba892(0x180)]&&console[_0x4ba892(0x152)](_0x4ba892(0x1cc)+a31_0x4c9dba[_0x4ba892(0x192)](_0x59c006[_0x4ba892(0x19e)]+_0x4ba892(0x1d6)));console[_0x4ba892(0x152)](_0x4ba892(0x1cc)+a31_0x4c9dba[_0x4ba892(0x192)]('=\x20'+_0x5b135f[_0x4ba892(0x19e)]+_0x4ba892(0x16e)));}_0x4abe82[_0x4ba892(0x19e)]>0x0&&!_0x15101f['journeysOnly']&&(console[_0x4ba892(0x152)](''),console[_0x4ba892(0x152)]('\x20\x20Activations:'),_0x37b5ef[_0x4ba892(0x19e)]>0x0&&console[_0x4ba892(0x152)](_0x4ba892(0x1cc)+a31_0x4c9dba['green']('+\x20'+_0x37b5ef[_0x4ba892(0x19e)]+_0x4ba892(0x1b2))),_0x43e331['length']>0x0&&console[_0x4ba892(0x152)](_0x4ba892(0x1cc)+a31_0x4c9dba['yellow']('~\x20'+_0x43e331[_0x4ba892(0x19e)]+'\x20to\x20update')),_0x134442['length']>0x0&&console[_0x4ba892(0x152)](_0x4ba892(0x1cc)+a31_0x4c9dba['red']('-\x20'+_0x134442[_0x4ba892(0x19e)]+_0x4ba892(0x1aa))));console[_0x4ba892(0x152)]('\x20\x20Source:\x20'+a31_0x4c9dba[_0x4ba892(0x151)](_0x4493e2)+'\x0a');if(_0x5ff0e4[_0x4ba892(0x19e)]>0x0){console['error'](_0x4ba892(0x15c));for(const _0x19806a of _0x5ff0e4){console[_0x4ba892(0x152)]('\x20\x20'+a31_0x4c9dba['blue']('+')+'\x20'+_0x19806a);}console[_0x4ba892(0x152)]('');}if(_0x45c0a2[_0x4ba892(0x19e)]>0x0&&!_0x15101f[_0x4ba892(0x1ea)])for(const _0x351215 of _0x45c0a2){const _0x356718=_0x351215['folderPath']?_0x351215[_0x4ba892(0x169)]+'/'+_0x351215['yamlConfig'][_0x4ba892(0x1ee)]:_0x351215['yamlConfig']['name'],_0x560787=_0x351215[_0x4ba892(0x160)][_0x4ba892(0x1c7)]?.[_0x4ba892(0x19e)]||0x0,_0x43f3ae=_0x560787>0x0?a31_0x4c9dba[_0x4ba892(0x192)]('\x20['+_0x560787+_0x4ba892(0x1d0)):'';console[_0x4ba892(0x152)]('\x0a'+a31_0x4c9dba[_0x4ba892(0x1e6)](_0x4ba892(0x182))+'\x20'+_0x356718+_0x43f3ae),console[_0x4ba892(0x152)]('─'[_0x4ba892(0x1eb)](0x3c)),_0x351215['diff']&&console['error'](_0x351215[_0x4ba892(0x19d)]),console[_0x4ba892(0x152)]('─'[_0x4ba892(0x1eb)](0x3c));}if(_0x5b45f1[_0x4ba892(0x19e)]>0x0&&!_0x15101f['journeysOnly'])for(const _0x3cb4b8 of _0x5b45f1){const _0x3481c9=_0x3cb4b8[_0x4ba892(0x19b)]?_0x4f4377[_0x4ba892(0x1c0)](_0x3cb4b8[_0x4ba892(0x19b)][_0x4ba892(0x17b)]())||'':'',_0x26bc72=_0x3481c9?_0x3481c9+'/'+_0x3cb4b8[_0x4ba892(0x1ee)]:_0x3cb4b8[_0x4ba892(0x1ee)],_0x437cd5=_0x4b71d3[_0x4ba892(0x1c0)](_0x3cb4b8['id'])||[],_0x57b480=_0x437cd5[_0x4ba892(0x19e)]>0x0?a31_0x4c9dba[_0x4ba892(0x192)]('\x20['+_0x437cd5['length']+_0x4ba892(0x1d0)):'';console[_0x4ba892(0x152)]('\x0a'+a31_0x4c9dba[_0x4ba892(0x1ce)](_0x4ba892(0x195))+'\x20'+_0x26bc72+_0x57b480),console['error']('─'[_0x4ba892(0x1eb)](0x3c));const _0x361450=segmentWithActivationsToYaml(_0x3cb4b8,_0x437cd5,undefined,_0x2a3062,_0x22d8cf),_0x1e12f7=segmentToYamlString(_0x361450),_0x5ab3d9=generateDiff(_0x1e12f7,'');console[_0x4ba892(0x152)](formatDiffWithColors(_0x5ab3d9)),console['error']('─'[_0x4ba892(0x1eb)](0x3c));}const _0x525eb0=_0x56be2a[_0x4ba892(0x194)](_0x2be17d=>!_0x2be17d[_0x4ba892(0x1d2)]&&_0x2be17d[_0x4ba892(0x19d)]);if(_0x525eb0['length']>0x0&&!_0x15101f['journeysOnly'])for(const _0x260f8e of _0x525eb0){const _0x2403c6=_0x260f8e[_0x4ba892(0x169)]?_0x260f8e[_0x4ba892(0x169)]+'/'+_0x260f8e['yamlConfig'][_0x4ba892(0x1ee)]:_0x260f8e[_0x4ba892(0x160)][_0x4ba892(0x1ee)];console[_0x4ba892(0x152)]('\x0a'+a31_0x4c9dba[_0x4ba892(0x1a5)](_0x4ba892(0x1c9))+'\x20'+_0x2403c6),console[_0x4ba892(0x152)]('─'[_0x4ba892(0x1eb)](0x3c)),console['error'](_0x260f8e[_0x4ba892(0x19d)]),console[_0x4ba892(0x152)]('─'['repeat'](0x3c));}if(_0xae9220[_0x4ba892(0x19e)]>0x0)for(const _0x4361f0 of _0xae9220){const _0x1139f7=_0x4361f0[_0x4ba892(0x169)]?_0x4361f0[_0x4ba892(0x169)]+'/'+_0x4361f0['yamlConfig'][_0x4ba892(0x1ee)]:_0x4361f0[_0x4ba892(0x160)][_0x4ba892(0x1ee)];console[_0x4ba892(0x152)]('\x0a'+a31_0x4c9dba['green']('New\x20journey:')+'\x20'+_0x1139f7),console[_0x4ba892(0x152)]('─'[_0x4ba892(0x1eb)](0x3c)),_0x4361f0[_0x4ba892(0x19d)]&&console[_0x4ba892(0x152)](_0x4361f0[_0x4ba892(0x19d)]),console[_0x4ba892(0x152)]('─'['repeat'](0x3c));}const _0x2c3f58=_0x32d1f0[_0x4ba892(0x194)](_0x234f5c=>!_0x234f5c['isNew']&&_0x234f5c[_0x4ba892(0x19d)]);if(_0x2c3f58['length']>0x0)for(const _0xbe23a1 of _0x2c3f58){const _0xd21bea=_0xbe23a1[_0x4ba892(0x169)]?_0xbe23a1[_0x4ba892(0x169)]+'/'+_0xbe23a1[_0x4ba892(0x160)][_0x4ba892(0x1ee)]:_0xbe23a1[_0x4ba892(0x160)][_0x4ba892(0x1ee)];console['error']('\x0a'+a31_0x4c9dba[_0x4ba892(0x1a5)]('Changes\x20to\x20journey:')+'\x20'+_0xd21bea),console['error']('─'[_0x4ba892(0x1eb)](0x3c)),console[_0x4ba892(0x152)](_0xbe23a1[_0x4ba892(0x19d)]),console[_0x4ba892(0x152)]('─'[_0x4ba892(0x1eb)](0x3c));}if(_0x5af782['length']>0x0)for(const _0x2c1074 of _0x5af782){const _0x3f69c6=_0x2c1074[_0x4ba892(0x167)]?_0x4f4377[_0x4ba892(0x1c0)](_0x2c1074['folderId'])||'':'',_0x5d5e88=_0x3f69c6?_0x3f69c6+'/'+_0x2c1074[_0x4ba892(0x1cd)]:_0x2c1074[_0x4ba892(0x1cd)];console[_0x4ba892(0x152)]('\x0a'+a31_0x4c9dba[_0x4ba892(0x1ce)](_0x4ba892(0x19a))+'\x20'+_0x5d5e88),console['error']('─'[_0x4ba892(0x1eb)](0x3c)),console[_0x4ba892(0x152)](a31_0x4c9dba['red'](_0x4ba892(0x156))),console['error']('─'[_0x4ba892(0x1eb)](0x3c));}if(_0x15101f[_0x4ba892(0x18c)])return console['error'](a31_0x4c9dba[_0x4ba892(0x1a5)](_0x4ba892(0x189))),0x0;const _0x9ef00c=_0x15101f[_0x4ba892(0x1ea)]?![]:_0x45c0a2[_0x4ba892(0x19e)]>0x0||_0x4dc254['length']>0x0||_0x5b45f1[_0x4ba892(0x19e)]>0x0,_0x260fc9=_0xae9220[_0x4ba892(0x19e)]>0x0||_0x3c3066[_0x4ba892(0x19e)]>0x0||_0x5af782[_0x4ba892(0x19e)]>0x0,_0x2aef11=_0x15101f[_0x4ba892(0x1ea)]?![]:_0x4abe82[_0x4ba892(0x19e)]>0x0,_0x72bb20=_0x5ff0e4[_0x4ba892(0x19e)]>0x0;if(!_0x9ef00c&&!_0x260fc9&&!_0x2aef11&&!_0x72bb20){const _0x5987ed=_0x15101f['journeysOnly']?_0x4ba892(0x1bf):_0x4ba892(0x1da);console['error'](a31_0x4c9dba[_0x4ba892(0x1e6)](_0x5987ed));if(_0x10e27c&&_0x5b135f[_0x4ba892(0x19e)]===0x1){const _0x170e9a=_0x5b135f[0x0];if(_0x170e9a[_0x4ba892(0x172)]?.['id']){const _0x4319f6=getConsoleNextUrl(_0x15101f[_0x4ba892(0x1b9)],_0x4ba892(0x1de)+_0x96b819+_0x4ba892(0x154)+_0x170e9a[_0x4ba892(0x172)]['id']+_0x4ba892(0x1ba));console['error']('\x20\x20'+a31_0x4c9dba[_0x4ba892(0x151)](_0x4319f6));}}return 0x0;}const _0x5ceb86=_0x15101f[_0x4ba892(0x1ea)]?_0xae9220[_0x4ba892(0x19e)]+_0x3c3066[_0x4ba892(0x19e)]+_0x5af782[_0x4ba892(0x19e)]+_0x5ff0e4[_0x4ba892(0x19e)]:_0x45c0a2[_0x4ba892(0x19e)]+_0x4dc254['length']+_0x5b45f1[_0x4ba892(0x19e)]+_0xae9220['length']+_0x3c3066['length']+_0x5af782['length']+_0x5ff0e4['length']+_0x4abe82[_0x4ba892(0x19e)];if(!_0x15101f[_0x4ba892(0x1ca)]&&_0x5ceb86>0x0){if(!isInteractive())return console['error'](a31_0x4c9dba[_0x4ba892(0x1ce)](_0x4ba892(0x18d)),_0x4ba892(0x1d5)),console['error'](a31_0x4c9dba[_0x4ba892(0x192)](_0x4ba892(0x1af))),0x1;const _0xc4d7f=await confirmKey(_0x4ba892(0x1bd)+_0x5ceb86+_0x4ba892(0x1c5));if(!_0xc4d7f)return console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1a5)]('Aborted.')),0x1;}const _0x3b1a97={'withProgress':async(_0xc3c068,_0x3e74d9)=>{const _0x5a8e8=_0x4ba892,_0x530cbd=await withSpinner(_0xc3c068,_0x3e74d9,{'verbose':_0x15101f[_0x5a8e8(0x1a7)]});return{'data':_0x530cbd['data']};},'logInfo':_0x20cfa5=>console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1c1)]('βœ”\x20'+_0x20cfa5)),'logSuccess':_0x4c66ed=>console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1e6)]('βœ”\x20'+_0x4c66ed)),'logWarning':_0x239419=>console[_0x4ba892(0x152)](a31_0x4c9dba['yellow']('⚠\x20'+_0x239419)),'logDeleted':_0x5227ee=>console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1ce)]('βœ”\x20'+_0x5227ee))},_0x3b5533={'segment':_0x90e34a[_0x4ba892(0x18e)],'journey':_0x90e34a[_0x4ba892(0x1b6)],'user':_0x90e34a['user'],'connection':_0x90e34a[_0x4ba892(0x17e)]};_0x5ff0e4['length']>0x0&&(_0x37b794=await executePushFolders(_0x3b5533,_0x5ff0e4,_0x37b794,{'parentId':_0x96b819},_0x3b1a97));const _0x3f0628={'rootFolderId':_0x3e1bba,'folderPathToId':_0x37b794,'folderIdToPath':_0x4f4377,'segmentNameToId':_0x4246d9,'activationsBySegmentId':_0x4b71d3,'emailToIdMap':_0x325468,'idToEmailMap':_0x2a3062,'connectionNameToIdMap':_0x405b63[_0x4ba892(0x1a3)],'connectionIdToNameMap':_0x405b63[_0x4ba892(0x1d3)],'connectionNameToTypeMap':_0x2e9d5a},_0x422cf4=await executePushSegments(_0x3b5533,_0x15101f[_0x4ba892(0x1ea)]?[]:_0x56be2a,_0x3f0628,{'parentId':_0x96b819},_0x3b1a97),_0x51c1c3=_0x422cf4['created'],_0x31ceb3=_0x422cf4[_0x4ba892(0x185)],_0x59d021=_0x422cf4[_0x4ba892(0x1c7)][_0x4ba892(0x190)],_0x461cb3=_0x422cf4[_0x4ba892(0x1c7)][_0x4ba892(0x185)],_0x517b23=_0x422cf4[_0x4ba892(0x1c7)][_0x4ba892(0x178)],_0x2d33ba=await executePushSegmentDeletions(_0x3b5533,_0x15101f[_0x4ba892(0x1ea)]?[]:_0x5b45f1,_0x3b1a97);let _0x50599d=0x0,_0xa0920f=0x0,_0x5b7bd7=0x0;const _0x3433b1=new Map(_0x4246d9);for(const [_0x3cd24f,_0x590fe0]of _0x422cf4[_0x4ba892(0x1e0)]){_0x3433b1[_0x4ba892(0x1e1)](_0x3cd24f,_0x590fe0);}if(_0x32d1f0[_0x4ba892(0x19e)]>0x0){const _0x1fb639={..._0x3f0628,'segmentNameToId':_0x3433b1,'existingSegments':_0x4df39e,'activationContext':_0x297677},_0x228f1=await executePushJourneys(_0x3b5533,_0x32d1f0,_0x1fb639,{'parentId':_0x96b819,'rootFolderId':_0x3e1bba,'verbose':_0x15101f[_0x4ba892(0x1a7)]},_0x3b1a97);_0x50599d=_0x228f1[_0x4ba892(0x190)],_0xa0920f=_0x228f1['updated'];if(_0x10e27c&&_0x228f1[_0x4ba892(0x168)][_0x4ba892(0x19e)]===0x1){const _0x76c0aa=_0x228f1['results'][0x0];if(_0x76c0aa[_0x4ba892(0x183)]){const _0x7a4d59=getConsoleNextUrl(_0x15101f[_0x4ba892(0x1b9)],_0x4ba892(0x1de)+_0x96b819+_0x4ba892(0x154)+_0x76c0aa[_0x4ba892(0x183)]+_0x4ba892(0x1ba));console['error']('\x20\x20'+a31_0x4c9dba[_0x4ba892(0x151)](_0x7a4d59));}}}for(const _0x5db254 of _0x5af782){console[_0x4ba892(0x152)](a31_0x4c9dba[_0x4ba892(0x1a5)](_0x4ba892(0x1c3)+_0x5db254['journeyBundleName'])),_0x5b7bd7++;}const _0x3a1919=[];if(_0x51c1c3>0x0)_0x3a1919[_0x4ba892(0x1cf)](_0x51c1c3+_0x4ba892(0x161));if(_0x31ceb3>0x0)_0x3a1919['push'](_0x31ceb3+_0x4ba892(0x18a));if(_0x2d33ba>0x0)_0x3a1919[_0x4ba892(0x1cf)](_0x2d33ba+_0x4ba892(0x1c2));const _0x1c8506=[];if(_0x50599d>0x0)_0x1c8506[_0x4ba892(0x1cf)](_0x50599d+_0x4ba892(0x161));if(_0xa0920f>0x0)_0x1c8506[_0x4ba892(0x1cf)](_0xa0920f+_0x4ba892(0x18a));if(_0x5b7bd7>0x0)_0x1c8506[_0x4ba892(0x1cf)](_0x5b7bd7+_0x4ba892(0x1c2));const _0x285130=[];if(_0x59d021>0x0)_0x285130[_0x4ba892(0x1cf)](_0x59d021+_0x4ba892(0x161));if(_0x461cb3>0x0)_0x285130['push'](_0x461cb3+_0x4ba892(0x18a));if(_0x517b23>0x0)_0x285130[_0x4ba892(0x1cf)](_0x517b23+_0x4ba892(0x1c2));return console['error'](a31_0x4c9dba[_0x4ba892(0x1e6)]('\x0aβœ”\x20Push\x20complete')),_0x3a1919[_0x4ba892(0x19e)]>0x0&&!_0x15101f[_0x4ba892(0x1ea)]&&console[_0x4ba892(0x152)](_0x4ba892(0x196)+_0x3a1919[_0x4ba892(0x1b8)](',\x20')),_0x1c8506[_0x4ba892(0x19e)]>0x0&&console['error'](_0x4ba892(0x15f)+_0x1c8506[_0x4ba892(0x1b8)](',\x20')),_0x285130[_0x4ba892(0x19e)]>0x0&&!_0x15101f[_0x4ba892(0x1ea)]&&console[_0x4ba892(0x152)](_0x4ba892(0x1cb)+_0x285130[_0x4ba892(0x1b8)](',\x20')),0x0;}}