@treasuredata/tdx 2026.3.16 → 2026.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/profile-command.js +1 -1
  34. package/dist/commands/profiles-command.js +1 -1
  35. package/dist/commands/query-command.js +1 -1
  36. package/dist/commands/schedule-command.js +1 -1
  37. package/dist/commands/segment-command.js +1 -1
  38. package/dist/commands/segment-create-command.js +1 -1
  39. package/dist/commands/segment-fields-command.js +1 -1
  40. package/dist/commands/segment-pull-command.js +1 -1
  41. package/dist/commands/segment-push-command.js +1 -1
  42. package/dist/commands/segment-update-command.js +1 -1
  43. package/dist/commands/segment-use-command.js +1 -1
  44. package/dist/commands/segment-validate-command.js +1 -1
  45. package/dist/commands/segments.js +1 -1
  46. package/dist/commands/show.js +1 -1
  47. package/dist/commands/status-command.js +1 -1
  48. package/dist/commands/tables.js +1 -1
  49. package/dist/commands/unset-command.js +1 -1
  50. package/dist/commands/upgrade-command.js +1 -1
  51. package/dist/commands/use-command.js +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.js +1 -1
  57. package/dist/core/connection-cache.js +1 -1
  58. package/dist/core/constants.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/oauth-keychain.js +1 -1
  63. package/dist/core/oauth.js +1 -1
  64. package/dist/core/profile.js +1 -1
  65. package/dist/core/project-config.js +1 -1
  66. package/dist/core/session.js +1 -1
  67. package/dist/core/user-cache.js +1 -1
  68. package/dist/core/version.js +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/mcp/server.js +1 -1
  71. package/dist/mcp/tools/index.js +1 -1
  72. package/dist/mcp/tools/tdx-run.js +1 -1
  73. package/dist/mcp/tools/tdx-search.js +1 -1
  74. package/dist/mcp/utils.js +1 -1
  75. package/dist/proxy/claude-usage-tracker.js +1 -1
  76. package/dist/proxy/passthrough-server.js +1 -1
  77. package/dist/proxy/sse-usage-parser.js +1 -1
  78. package/dist/sdk/agent/agent-config.js +1 -1
  79. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  80. package/dist/sdk/agent/agent-yaml.js +1 -1
  81. package/dist/sdk/agent/test/evaluator.js +1 -1
  82. package/dist/sdk/agent/test/executor.js +1 -1
  83. package/dist/sdk/agent/test/index.js +1 -1
  84. package/dist/sdk/agent/test/output.js +1 -1
  85. package/dist/sdk/agent/test/parser.js +1 -1
  86. package/dist/sdk/agent/tool-target-registry.js +1 -1
  87. package/dist/sdk/api.js +1 -1
  88. package/dist/sdk/client/cdp-api-client.js +1 -1
  89. package/dist/sdk/client/delivery-api-client.js +1 -1
  90. package/dist/sdk/client/endpoints.js +1 -1
  91. package/dist/sdk/client/engage-api-client.js +1 -1
  92. package/dist/sdk/client/http-client.js +1 -1
  93. package/dist/sdk/client/llm-api-client.js +1 -1
  94. package/dist/sdk/client/oauth-refresh.js +1 -1
  95. package/dist/sdk/client/rate-limiter.js +1 -1
  96. package/dist/sdk/client/td-api-client.js +1 -1
  97. package/dist/sdk/client/trino-api-client.js +1 -1
  98. package/dist/sdk/client/workflow-client.js +1 -1
  99. package/dist/sdk/connection-validator.js +1 -1
  100. package/dist/sdk/connection.js +1 -1
  101. package/dist/sdk/delivery.js +1 -1
  102. package/dist/sdk/engage/campaign-pull.js +1 -1
  103. package/dist/sdk/engage/campaign-push.js +1 -1
  104. package/dist/sdk/engage/campaign-validator.js +1 -1
  105. package/dist/sdk/engage/campaign-yaml.js +1 -1
  106. package/dist/sdk/engage/template-pull.js +1 -1
  107. package/dist/sdk/engage/template-push.js +1 -1
  108. package/dist/sdk/engage/template-validator.js +1 -1
  109. package/dist/sdk/engage/template-yaml.js +1 -1
  110. package/dist/sdk/engage/types/campaign-def.js +1 -1
  111. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  112. package/dist/sdk/engage/types/template-schema.js +1 -1
  113. package/dist/sdk/engage.js +1 -1
  114. package/dist/sdk/errors.js +1 -1
  115. package/dist/sdk/index.js +1 -1
  116. package/dist/sdk/io/index.js +1 -1
  117. package/dist/sdk/io/node-filesystem.js +1 -1
  118. package/dist/sdk/job.js +1 -1
  119. package/dist/sdk/journey.js +1 -1
  120. package/dist/sdk/llm/chat-cache.js +1 -1
  121. package/dist/sdk/llm/index.js +1 -1
  122. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  123. package/dist/sdk/llm/model-factors.js +1 -1
  124. package/dist/sdk/personalization.js +1 -1
  125. package/dist/sdk/query/index.js +1 -1
  126. package/dist/sdk/query/sql-parser.js +1 -1
  127. package/dist/sdk/realtime.js +1 -1
  128. package/dist/sdk/schedule.js +1 -1
  129. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  130. package/dist/sdk/segment/fields-display.js +1 -1
  131. package/dist/sdk/segment/file-discovery.js +1 -1
  132. package/dist/sdk/segment/journey-utils.js +1 -1
  133. package/dist/sdk/segment/journey-validator.js +1 -1
  134. package/dist/sdk/segment/journey-yaml.js +1 -1
  135. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  136. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/pull-workflow.js +1 -1
  138. package/dist/sdk/segment/push-recovery.js +1 -1
  139. package/dist/sdk/segment/push-workflow.js +1 -1
  140. package/dist/sdk/segment/resolution-context.js +1 -1
  141. package/dist/sdk/segment/segment-path-parser.js +1 -1
  142. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  143. package/dist/sdk/segment/segment-validator.js +1 -1
  144. package/dist/sdk/segment/target-resolution.js +1 -1
  145. package/dist/sdk/segment/tdx-config.js +1 -1
  146. package/dist/sdk/segment/types/activation-schema.js +1 -1
  147. package/dist/sdk/segment/types/journey-def.js +1 -1
  148. package/dist/sdk/segment/types/journey-schema.js +1 -1
  149. package/dist/sdk/segment/types/segment-def.js +1 -1
  150. package/dist/sdk/segment/types/segment-schema.js +1 -1
  151. package/dist/sdk/segment/validate-files.js +1 -1
  152. package/dist/sdk/segment/yaml-validator.js +1 -1
  153. package/dist/sdk/segment.js +1 -1
  154. package/dist/sdk/types/index.js +1 -1
  155. package/dist/sdk/types/progress.js +1 -1
  156. package/dist/sdk/user.js +1 -1
  157. package/dist/sdk/util/format-detector.js +1 -1
  158. package/dist/sdk/util/formatters.js +1 -1
  159. package/dist/sdk/util/index.js +1 -1
  160. package/dist/sdk/util/paginate.js +1 -1
  161. package/dist/sdk/util/tree-formatter.js +1 -1
  162. package/dist/sdk/workflow/archive-validation.js +1 -1
  163. package/dist/sdk/workflow/clone-workflow.js +1 -1
  164. package/dist/sdk/workflow/index.js +1 -1
  165. package/dist/sdk/workflow/pull-workflow.js +1 -1
  166. package/dist/sdk/workflow/push-workflow.js +1 -1
  167. package/dist/sdk/workflow/tdx-config.js +1 -1
  168. package/dist/sdk/workflow/workflow-utils.js +1 -1
  169. package/dist/test-utils/command-runner.js +1 -1
  170. package/dist/test-utils/factories.js +1 -1
  171. package/dist/test-utils/fixtures.js +1 -1
  172. package/dist/test-utils/http-mock.js +1 -1
  173. package/dist/test-utils/index.js +1 -1
  174. package/dist/utils/async.js +1 -1
  175. package/dist/utils/colors.js +1 -1
  176. package/dist/utils/diff.js +1 -1
  177. package/dist/utils/file-permissions.js +1 -1
  178. package/dist/utils/file-reader.js +1 -1
  179. package/dist/utils/github-releases.js +1 -1
  180. package/dist/utils/global-cache.js +1 -1
  181. package/dist/utils/json-loader.js +1 -1
  182. package/dist/utils/local-cache.js +1 -1
  183. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  184. package/dist/utils/logger/formatters/index.js +1 -1
  185. package/dist/utils/logger/handlers/console-handler.js +1 -1
  186. package/dist/utils/logger/handlers/file-handler.js +1 -1
  187. package/dist/utils/logger/handlers/index.js +1 -1
  188. package/dist/utils/logger/handlers/null-handler.js +1 -1
  189. package/dist/utils/logger/index.js +1 -1
  190. package/dist/utils/logger/logger.js +1 -1
  191. package/dist/utils/logger/types.js +1 -1
  192. package/dist/utils/option-validation.js +1 -1
  193. package/dist/utils/process.js +1 -1
  194. package/dist/utils/prompt.js +1 -1
  195. package/dist/utils/spinner.js +1 -1
  196. package/dist/utils/sse-parser.js +1 -1
  197. package/dist/utils/string-utils.js +1 -1
  198. package/dist/utils/table-ref-parser.js +1 -1
  199. package/dist/utils/tdx-logger.js +1 -1
  200. package/dist/utils/version-check.js +1 -1
  201. package/package.json +2 -2
@@ -1 +1 @@
1
- const a34_0x5505b1=a34_0x151c;(function(_0x4f80b6,_0x3ea665){const _0x4584d2=a34_0x151c,_0x4effc9=_0x4f80b6();while(!![]){try{const _0xab611a=-parseInt(_0x4584d2(0xde))/0x1+parseInt(_0x4584d2(0x13f))/0x2*(parseInt(_0x4584d2(0x101))/0x3)+parseInt(_0x4584d2(0x13a))/0x4+-parseInt(_0x4584d2(0x118))/0x5*(-parseInt(_0x4584d2(0x11f))/0x6)+parseInt(_0x4584d2(0xda))/0x7+parseInt(_0x4584d2(0xfd))/0x8*(-parseInt(_0x4584d2(0xcb))/0x9)+parseInt(_0x4584d2(0xc9))/0xa;if(_0xab611a===_0x3ea665)break;else _0x4effc9['push'](_0x4effc9['shift']());}catch(_0xefb307){_0x4effc9['push'](_0x4effc9['shift']());}}}(a34_0x23c9,0x94248));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';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a34_0x151c(_0xf07bad,_0x2e5bd6){_0xf07bad=_0xf07bad-0xb9;const _0x23c9bd=a34_0x23c9();let _0x151c0a=_0x23c9bd[_0xf07bad];return _0x151c0a;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a34_0x23c9(){const _0x14d230=['utf-8','user','2kEzZKx','format','schedule:create','length','abs','repeat','trino','Schedule\x20deleted:\x20','file','Running\x20schedule...','h\x20ago','show','schedule:show','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','log','start_at','d\x20ago','entries','jsonl','\x20scheduled\x20quer','tsv','5505320nLDILv','execute','1684494ttMvbY','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','List\x20scheduled\x20queries','Update\x20a\x20scheduled\x20query','padEnd','schedule:update','ended_at','\x20(use\x20--limit\x20to\x20see\x20more)','args','Searching\x20scheduled\x20queries\x20matching\x20\x22','No\x20scheduled\x20queries\x20found','round','trim','\x22...','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','2573032wrDTHP','\x20\x20Timezone:\x20','cron','Showing\x20first\x20','258091sdcDdA','yes','verbose','next_run_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Cancelled','Show\x20schedule\x20execution\x20history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','priority','cyan','Create\x20a\x20scheduled\x20query','scheduled_at','map','statusIcon','last_job','limit','m\x20ago','\x20\x20Cron:\x20','updated_at','create','\x20\x20→\x20','history','nextRun','time','count','delay','retryLimit','(unnamed)','schedule:delete','toLocaleDateString','\x20\x20Time:\x20','24VFNaZa','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','executing_user_id','query','732873xzxpVc','Failed\x20to\x20read\x20file:\x20','retry_limit','schedules','ies','\x20\x20Type:\x20','delete','run','\x20job','Schedule\x20run\x20submitted:\x20','in\x20','Updating\x20schedule:\x20','user_name','\x20\x20Num:\x20','lastRun','...','getTime','num','json','error','created_at','data','pagination','123635vBkunN','queries','Schedule\x20created:\x20','jobs','from','success','engine_version','42KfqBHB','\x20matching\x20\x22','Found\x20','job_id','keys','site','result','validate','Getting\x20schedule\x20history...','status','description','name','queryUrl','Creating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','Deleting\x20schedule...','database','/app/queries/editor?queryId=','Schedule\x20updated:\x20','soon','Listing\x20scheduled\x20queries...','Creating\x20schedule:\x20','Show\x20schedule\x20details','timezone','Delete\x20a\x20scheduled\x20query','type','Running\x20schedule:\x20','363572mmPtSa','engineVersion','max'];a34_0x23c9=function(){return _0x14d230;};return a34_0x23c9();}import a34_0x233df7 from'chalk';function formatRelativeTime(_0xa4c81f){const _0x396c4a=a34_0x151c,_0x29422c=new Date(_0xa4c81f),_0x2cadff=new Date(),_0x3a85dc=_0x29422c[_0x396c4a(0x111)]()-_0x2cadff['getTime'](),_0x205792=Math[_0x396c4a(0x143)](_0x3a85dc)/0x3e8,_0x5cdd61=_0x3a85dc<0x0;if(_0x205792<0x3c)return _0x5cdd61?'just\x20now':_0x396c4a(0x132);else{if(_0x205792<0xe10){const _0xb973a3=Math[_0x396c4a(0xd6)](_0x205792/0x3c);return _0x5cdd61?_0xb973a3+_0x396c4a(0xee):_0x396c4a(0x10b)+_0xb973a3+'m';}else{if(_0x205792<0x15180){const _0x4423ec=Math[_0x396c4a(0xd6)](_0x205792/0xe10);return _0x5cdd61?_0x4423ec+_0x396c4a(0xbe):_0x396c4a(0x10b)+_0x4423ec+'h';}else{if(_0x205792<0x93a80){const _0x13502e=Math['round'](_0x205792/0x15180);return _0x5cdd61?_0x13502e+_0x396c4a(0xc4):'in\x20'+_0x13502e+'d';}else return _0x29422c[_0x396c4a(0xfb)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']='schedule:list';['description']=a34_0x5505b1(0xcd);async[a34_0x5505b1(0xca)](_0x56011d){const _0x2ec66b=a34_0x5505b1,{options:_0x3149c4,args:_0x2795ec,tdx:_0x12f35a}=_0x56011d,_0x2c9def=resolveLimit(_0x3149c4[_0x2ec66b(0xed)],DEFAULT_DISPLAY_LIMIT),_0x232b3a=_0x2795ec[0x0],_0x4d921b=_0x232b3a?_0x2ec66b(0xd4)+_0x232b3a+_0x2ec66b(0xd8):_0x2ec66b(0x133),_0x37375e=await withSpinner(_0x4d921b,()=>_0x12f35a[_0x2ec66b(0x104)]['listQueries']({'limit':_0x2c9def,'scheduled':!![],'pattern':_0x232b3a}),{'verbose':_0x3149c4[_0x2ec66b(0xe0)]}),_0x137ec6=_0x37375e['data'][_0x2ec66b(0x119)],_0x5b37a7=_0x37375e[_0x2ec66b(0x116)][_0x2ec66b(0x117)]['has_next_page'],_0x180a33=_0x232b3a?_0x2ec66b(0x120)+_0x232b3a+'\x22':'';_0x5b37a7?console['error'](_0x2ec66b(0xdd)+_0x137ec6[_0x2ec66b(0x142)]+'\x20schedules'+_0x180a33+_0x2ec66b(0xd2)):console[_0x2ec66b(0x114)](_0x2ec66b(0x121)+_0x137ec6[_0x2ec66b(0x142)]+_0x2ec66b(0xc7)+(_0x137ec6[_0x2ec66b(0x142)]!==0x1?_0x2ec66b(0x105):'y')+_0x180a33);if(_0x3149c4['format']===_0x2ec66b(0x113)||_0x3149c4[_0x2ec66b(0x140)]===_0x2ec66b(0xc6)||_0x3149c4[_0x2ec66b(0x140)]==='table'||_0x3149c4['format']===_0x2ec66b(0xc8)){const _0x45b7ec=_0x137ec6['map'](_0x2349eb=>({'id':_0x2349eb['id'],'name':_0x2349eb[_0x2ec66b(0x12a)],'cron':_0x2349eb[_0x2ec66b(0xdc)],'database':_0x2349eb[_0x2ec66b(0x12f)]?.[_0x2ec66b(0x12a)],'type':_0x2349eb[_0x2ec66b(0x138)],'timezone':_0x2349eb['time_zone'],'user_name':_0x2349eb[_0x2ec66b(0x13e)]?.[_0x2ec66b(0x12a)],'updated_at':_0x2349eb[_0x2ec66b(0xf0)],'next_run_at':_0x2349eb[_0x2ec66b(0xe1)],'last_job_status':_0x2349eb[_0x2ec66b(0xec)]?.['status']}));await handleSDKOutput(_0x45b7ec,_0x3149c4);}else{if(_0x137ec6[_0x2ec66b(0x142)]===0x0)console[_0x2ec66b(0xc2)](_0x2ec66b(0xd5));else{const _0x200a71=_0x3149c4[_0x2ec66b(0x124)],_0x18a947=_0x137ec6[_0x2ec66b(0xea)](_0x561b59=>{const _0x514865=_0x2ec66b,_0x37d69f=_0x561b59[_0x514865(0xec)]?.[_0x514865(0x128)]?_0x561b59[_0x514865(0xec)][_0x514865(0x128)]===_0x514865(0x11d)?'✓':'✗':'-',_0x15d247=_0x561b59[_0x514865(0xec)]?.[_0x514865(0xd1)]?formatRelativeTime(_0x561b59[_0x514865(0xec)][_0x514865(0xd1)]):'never',_0xb8b1ff=_0x561b59[_0x514865(0xe1)]?formatRelativeTime(_0x561b59[_0x514865(0xe1)]):'-',_0xe8dd07=_0x561b59[_0x514865(0xdc)]||'',_0x32c084=_0x561b59[_0x514865(0x12a)]||_0x514865(0xf9),_0x5a378e=getConsoleUrl(_0x200a71,_0x514865(0x130)+_0x561b59['id']);return{'statusIcon':_0x37d69f,'lastRun':_0x15d247,'nextRun':_0xb8b1ff,'cron':_0xe8dd07,'name':_0x32c084,'queryUrl':_0x5a378e,'status':_0x561b59[_0x514865(0xec)]?.['status']};}),_0x18691b=Math[_0x2ec66b(0x13c)](..._0x18a947['map'](_0xece04c=>_0xece04c[_0x2ec66b(0x10f)][_0x2ec66b(0x142)])),_0xe38337=Math[_0x2ec66b(0x13c)](..._0x18a947[_0x2ec66b(0xea)](_0x8035c3=>_0x8035c3[_0x2ec66b(0xf4)]['length'])),_0x12ce44=Math[_0x2ec66b(0x13c)](..._0x18a947[_0x2ec66b(0xea)](_0x4e6a55=>_0x4e6a55[_0x2ec66b(0xdc)][_0x2ec66b(0x142)])),_0x2ed1b1=_0x18a947[_0x2ec66b(0xea)](_0x44a138=>{const _0x507a0b=_0x2ec66b,_0x40897a=_0x44a138[_0x507a0b(0x128)]===_0x507a0b(0x11d)?a34_0x233df7['green'](_0x44a138[_0x507a0b(0xeb)]):_0x44a138['status']==='error'?a34_0x233df7['red'](_0x44a138[_0x507a0b(0xeb)]):a34_0x233df7['dim'](_0x44a138[_0x507a0b(0xeb)]),_0x8824a7=_0x44a138[_0x507a0b(0x10f)][_0x507a0b(0xcf)](_0x18691b),_0x3d0bc6=_0x44a138[_0x507a0b(0xf4)][_0x507a0b(0xcf)](_0xe38337),_0x477c68=_0x44a138[_0x507a0b(0xdc)]?a34_0x233df7[_0x507a0b(0xe7)](_0x44a138['cron'][_0x507a0b(0xcf)](_0x12ce44)):'\x20'[_0x507a0b(0xb9)](_0x12ce44),_0x72ac97=hyperlink(_0x44a138[_0x507a0b(0x12a)],_0x44a138[_0x507a0b(0x12b)]);return'📅\x20'+_0x40897a+'\x20'+_0x8824a7+_0x507a0b(0xf2)+_0x3d0bc6+'\x20\x20'+_0x477c68+'\x20\x20'+_0x72ac97;});await writeOutput(_0x2ed1b1['join']('\x0a'),_0x3149c4['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x5505b1(0x12a)]=a34_0x5505b1(0xc0);[a34_0x5505b1(0x129)]=a34_0x5505b1(0x135);[a34_0x5505b1(0x126)](_0x1ee35b){const _0x686a39=a34_0x5505b1,_0x32eaf1=_0x1ee35b[_0x686a39(0xd3)][0x0];if(!_0x32eaf1)return _0x686a39(0xfe);return undefined;}async['execute'](_0x268a80){const _0x25e79e=a34_0x5505b1,{options:_0x293e35,args:_0x43a13f,tdx:_0x591420}=_0x268a80,_0x2fc837=_0x43a13f[0x0],_0x5878fb=await withSpinner('Getting\x20schedule\x20details...',()=>_0x591420[_0x25e79e(0x104)][_0x25e79e(0xbf)](_0x2fc837),{'verbose':_0x293e35['verbose']}),_0x4d6942=_0x5878fb['data'],_0xddee88={'name':_0x4d6942['name'],'cron':_0x4d6942['cron'],'database':_0x4d6942['database'],'type':_0x4d6942[_0x25e79e(0x138)],'timezone':_0x4d6942[_0x25e79e(0x136)],'user_name':_0x4d6942[_0x25e79e(0x10d)],'created_at':_0x4d6942[_0x25e79e(0x115)],'engine_version':_0x4d6942[_0x25e79e(0x11e)],'executing_user_id':_0x4d6942[_0x25e79e(0xff)],'query':_0x4d6942['query'],'delay':_0x4d6942[_0x25e79e(0xf7)],'priority':_0x4d6942[_0x25e79e(0xe6)],'retry_limit':_0x4d6942[_0x25e79e(0x103)],..._0x4d6942[_0x25e79e(0x125)]&&{'result':_0x4d6942[_0x25e79e(0x125)]}};return await handleSingleObjectOutput(_0xddee88,_0x293e35),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x5505b1(0x12a)]=a34_0x5505b1(0x141);[a34_0x5505b1(0x129)]=a34_0x5505b1(0xe8);[a34_0x5505b1(0x126)](_0x287911){const _0x589fc6=a34_0x5505b1,_0x4d438b=_0x287911[_0x589fc6(0xd3)][0x0];if(!_0x4d438b)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x32bc64=_0x287911['options'];if(!_0x32bc64[_0x589fc6(0x12f)])return _0x589fc6(0xd9);return undefined;}async[a34_0x5505b1(0xca)](_0x101438){const _0x558f5b=a34_0x5505b1,{options:_0x369452,args:_0x40b5ec,tdx:_0x31b431}=_0x101438,_0x1b8825=_0x40b5ec[0x0],_0x1729d4=_0x369452,_0x255a33=_0x1729d4[_0x558f5b(0x12f)],_0x3a4610=_0x1729d4['file'],_0x28da45=_0x1729d4[_0x558f5b(0x138)]||_0x558f5b(0xba);let _0x217c41;try{_0x217c41=readFileSync(_0x3a4610,_0x558f5b(0x13d))['trim']();}catch(_0x10c3fb){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x558f5b(0x102)+_0x3a4610,_0x10c3fb instanceof Error?_0x10c3fb:undefined);}if(!_0x217c41)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20file\x20is\x20empty');const _0x3f4550={'database':_0x255a33,'query':_0x217c41,'type':_0x28da45};if(_0x1729d4[_0x558f5b(0xdc)])_0x3f4550[_0x558f5b(0xdc)]=_0x1729d4['cron'];if(_0x1729d4[_0x558f5b(0x136)])_0x3f4550[_0x558f5b(0x136)]=_0x1729d4[_0x558f5b(0x136)];if(_0x1729d4[_0x558f5b(0xf7)]!==undefined)_0x3f4550[_0x558f5b(0xf7)]=Number(_0x1729d4['delay']);if(_0x1729d4[_0x558f5b(0xe6)]!==undefined)_0x3f4550[_0x558f5b(0xe6)]=Number(_0x1729d4[_0x558f5b(0xe6)]);if(_0x1729d4[_0x558f5b(0xf8)]!==undefined)_0x3f4550['retry_limit']=Number(_0x1729d4[_0x558f5b(0xf8)]);if(_0x1729d4['engineVersion'])_0x3f4550['engine_version']=_0x1729d4[_0x558f5b(0x13b)];if(_0x1729d4[_0x558f5b(0x125)])_0x3f4550['result']=_0x1729d4[_0x558f5b(0x125)];if(_0x369452['verbose']){console['error'](_0x558f5b(0x134)+_0x1b8825),console[_0x558f5b(0x114)]('\x20\x20Database:\x20'+_0x255a33),console[_0x558f5b(0x114)](_0x558f5b(0x106)+_0x28da45);if(_0x3f4550[_0x558f5b(0xdc)])console[_0x558f5b(0x114)](_0x558f5b(0xef)+_0x3f4550[_0x558f5b(0xdc)]);if(_0x3f4550[_0x558f5b(0x136)])console['error'](_0x558f5b(0xdb)+_0x3f4550[_0x558f5b(0x136)]);}const _0x439df9=await withSpinner(_0x558f5b(0x12c),()=>_0x31b431['schedules'][_0x558f5b(0xf1)](_0x1b8825,_0x3f4550),{'verbose':_0x369452[_0x558f5b(0xe0)]});return console['error'](_0x558f5b(0x11a)+_0x439df9['data'][_0x558f5b(0x12a)]),await handleSingleObjectOutput(_0x439df9[_0x558f5b(0x116)],_0x369452),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x5505b1(0x12a)]=a34_0x5505b1(0xd0);[a34_0x5505b1(0x129)]=a34_0x5505b1(0xce);['validate'](_0x155236){const _0x1ea93c=a34_0x5505b1,_0x46a40d=_0x155236[_0x1ea93c(0xd3)][0x0];if(!_0x46a40d)return _0x1ea93c(0xc1);return undefined;}async[a34_0x5505b1(0xca)](_0x221cdd){const _0x301beb=a34_0x5505b1,{options:_0x52ac62,args:_0x56a93d,tdx:_0x3e8aca}=_0x221cdd,_0x2d2616=_0x56a93d[0x0],_0x2fb703=_0x52ac62,_0x18d4df={};if(_0x2fb703[_0x301beb(0x12f)])_0x18d4df[_0x301beb(0x12f)]=_0x2fb703['database'];if(_0x2fb703[_0x301beb(0x138)])_0x18d4df[_0x301beb(0x138)]=_0x2fb703[_0x301beb(0x138)];if(_0x2fb703[_0x301beb(0xdc)])_0x18d4df['cron']=_0x2fb703[_0x301beb(0xdc)];if(_0x2fb703['timezone'])_0x18d4df[_0x301beb(0x136)]=_0x2fb703[_0x301beb(0x136)];if(_0x2fb703[_0x301beb(0xf7)]!==undefined)_0x18d4df['delay']=Number(_0x2fb703[_0x301beb(0xf7)]);if(_0x2fb703[_0x301beb(0xe6)]!==undefined)_0x18d4df[_0x301beb(0xe6)]=Number(_0x2fb703['priority']);if(_0x2fb703[_0x301beb(0xf8)]!==undefined)_0x18d4df[_0x301beb(0x103)]=Number(_0x2fb703['retryLimit']);if(_0x2fb703[_0x301beb(0x13b)])_0x18d4df[_0x301beb(0x11e)]=_0x2fb703[_0x301beb(0x13b)];if(_0x2fb703[_0x301beb(0x125)])_0x18d4df['result']=_0x2fb703['result'];if(_0x2fb703[_0x301beb(0xbc)])try{_0x18d4df['query']=readFileSync(_0x2fb703[_0x301beb(0xbc)],_0x301beb(0x13d))[_0x301beb(0xd7)]();}catch(_0x1acc92){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x301beb(0x102)+_0x2fb703[_0x301beb(0xbc)],_0x1acc92 instanceof Error?_0x1acc92:undefined);}if(Object[_0x301beb(0x123)](_0x18d4df)['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x52ac62[_0x301beb(0xe0)]){console[_0x301beb(0x114)](_0x301beb(0x10c)+_0x2d2616);for(const [_0x1b375b,_0x380f91]of Object[_0x301beb(0xc5)](_0x18d4df)){_0x1b375b===_0x301beb(0x100)?console[_0x301beb(0x114)]('\x20\x20'+_0x1b375b+':\x20'+_0x380f91['substring'](0x0,0x32)+_0x301beb(0x110)):console[_0x301beb(0x114)]('\x20\x20'+_0x1b375b+':\x20'+_0x380f91);}}const _0x636e3=await withSpinner('Updating\x20schedule...',()=>_0x3e8aca['schedules']['update'](_0x2d2616,_0x18d4df),{'verbose':_0x52ac62[_0x301beb(0xe0)]});return console['error'](_0x301beb(0x131)+_0x636e3[_0x301beb(0x116)][_0x301beb(0x12a)]),await handleSingleObjectOutput(_0x636e3[_0x301beb(0x116)],_0x52ac62),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x5505b1(0xfa);[a34_0x5505b1(0x129)]=a34_0x5505b1(0x137);['validate'](_0xe62f72){const _0xacb3c1=a34_0x5505b1,_0x5123a7=_0xe62f72[_0xacb3c1(0xd3)][0x0];if(!_0x5123a7)return _0xacb3c1(0x12d);return undefined;}async[a34_0x5505b1(0xca)](_0x50fdd7){const _0x25fd41=a34_0x5505b1,{options:_0x5269e8,args:_0x208d73,tdx:_0x57bba5}=_0x50fdd7,_0x485551=_0x208d73[0x0];if(!_0x5269e8[_0x25fd41(0xdf)]){const _0x4ac666=await confirm(_0x25fd41(0xcc)+_0x485551+'\x22?');if(!_0x4ac666)return console[_0x25fd41(0x114)](_0x25fd41(0xe3)),0x0;}const _0x1643ea=await withSpinner(_0x25fd41(0x12e),()=>_0x57bba5[_0x25fd41(0x104)][_0x25fd41(0x107)](_0x485551),{'verbose':_0x5269e8[_0x25fd41(0xe0)]});return console[_0x25fd41(0x114)](_0x25fd41(0xbb)+_0x1643ea['data']['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x5505b1(0x12a)]='schedule:run';['description']='Run\x20a\x20scheduled\x20query\x20immediately';[a34_0x5505b1(0x126)](_0x18b7a7){const _0x917dc0=a34_0x5505b1,_0x2271c9=_0x18b7a7['args'][0x0];if(!_0x2271c9)return _0x917dc0(0xe5);return undefined;}async['execute'](_0x2750f5){const _0xa9a562=a34_0x5505b1,{options:_0x5877a0,args:_0xc436d5,tdx:_0x2feba2}=_0x2750f5,_0x48f9dc=_0xc436d5[0x0],_0x398cfe=_0x5877a0,_0x483879=_0x398cfe[_0xa9a562(0xf5)],_0x21d4bc=_0x398cfe[_0xa9a562(0x112)]!==undefined?Number(_0x398cfe[_0xa9a562(0x112)]):undefined;if(_0x5877a0[_0xa9a562(0xe0)]){console[_0xa9a562(0x114)](_0xa9a562(0x139)+_0x48f9dc);if(_0x483879)console[_0xa9a562(0x114)](_0xa9a562(0xfc)+_0x483879);if(_0x21d4bc)console[_0xa9a562(0x114)](_0xa9a562(0x10e)+_0x21d4bc);}const _0x7a427c=await withSpinner(_0xa9a562(0xbd),()=>_0x2feba2[_0xa9a562(0x104)][_0xa9a562(0x108)](_0x48f9dc,{'time':_0x483879,'num':_0x21d4bc}),{'verbose':_0x5877a0[_0xa9a562(0xe0)]}),_0x573184=_0x7a427c[_0xa9a562(0x116)][_0xa9a562(0x11b)];console[_0xa9a562(0x114)](_0xa9a562(0x10a)+_0x573184['length']+_0xa9a562(0x109)+(_0x573184[_0xa9a562(0x142)]!==0x1?'s':'')+'\x20created');for(const _0x18deaf of _0x573184){console[_0xa9a562(0x114)]('\x20\x20Job\x20ID:\x20'+_0x18deaf[_0xa9a562(0x122)]);}return await handleSDKOutput(_0x573184,_0x5877a0),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']='schedule:history';[a34_0x5505b1(0x129)]=a34_0x5505b1(0xe4);[a34_0x5505b1(0x126)](_0x1668d4){const _0x1b9660=a34_0x5505b1,_0x484801=_0x1668d4['args'][0x0];if(!_0x484801)return _0x1b9660(0xe2);return undefined;}async[a34_0x5505b1(0xca)](_0x416ba1){const _0x2dac8e=a34_0x5505b1,{options:_0x2b5bf6,args:_0x5aa402,tdx:_0x40af44}=_0x416ba1,_0x259a4d=_0x5aa402[0x0],_0x399463=_0x2b5bf6,_0x1ab79b=_0x399463['from']!==undefined?Number(_0x399463[_0x2dac8e(0x11c)]):undefined,_0xd7636d=_0x399463['to']!==undefined?Number(_0x399463['to']):undefined,_0x3b86b4=await withSpinner(_0x2dac8e(0x127),()=>_0x40af44[_0x2dac8e(0x104)]['history'](_0x259a4d,{'from':_0x1ab79b,'to':_0xd7636d}),{'verbose':_0x2b5bf6[_0x2dac8e(0xe0)]}),_0x31701d=_0x3b86b4['data'];console[_0x2dac8e(0x114)](_0x2dac8e(0x121)+_0x31701d[_0x2dac8e(0xf6)]+'\x20execution'+(_0x31701d[_0x2dac8e(0xf6)]!==0x1?'s':'')+'\x20(showing\x20'+_0x31701d[_0x2dac8e(0x11c)]+'-'+_0x31701d['to']+')');const _0x3d24b6=_0x31701d[_0x2dac8e(0xf3)]['map'](_0x1e1290=>({'job_id':_0x1e1290[_0x2dac8e(0x122)],'type':_0x1e1290['type'],'status':_0x1e1290[_0x2dac8e(0x128)],'scheduled_at':_0x1e1290[_0x2dac8e(0xe9)],'created_at':_0x1e1290[_0x2dac8e(0x115)],'start_at':_0x1e1290[_0x2dac8e(0xc3)],'end_at':_0x1e1290['end_at']}));return await handleSDKOutput(_0x3d24b6,_0x2b5bf6),0x0;}}
1
+ function a34_0x2ebe(){const _0x3cd337=['query','list','delete','has_next_page','(unnamed)','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Running\x20schedule...','retryLimit','ies','ended_at','schedule:history','priority','schedule:run','Getting\x20schedule\x20details...','\x20\x20Time:\x20','statusIcon','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','last_job','Deleting\x20schedule...','lastRun','\x20matching\x20\x22','Schedule\x20updated:\x20','157128JqQKRe','Updating\x20schedule...','data','just\x20now','round','1058616LBPAak','success','soon','site','schedule:show','verbose','No\x20scheduled\x20queries\x20found','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','\x20\x20Num:\x20','abs','options','pagination','schedule:update','utf-8','engineVersion','Create\x20a\x20scheduled\x20query','max','Showing\x20first\x20','table','in\x20','history','args','listQueries','\x20\x20→\x20','type','Updating\x20schedule:\x20','tsv','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','output','error','executing_user_id','\x20scheduled\x20quer','name','\x20(use\x20--limit\x20to\x20see\x20more)','Creating\x20schedule:\x20','schedule:create','m\x20ago','user_name','next_run_at','status','file','nextRun','\x20\x20Cron:\x20','validate','timezone','description','\x20\x20Database:\x20','never','show','📅\x20','user','scheduled_at','Found\x20','8754888OhboRB','565698DntlOi','\x20job','\x20\x20Timezone:\x20','queryUrl','54kULSaJ','4gaRYwF','getTime','end_at','execute','Schedule\x20created:\x20','...','retry_limit','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','\x20(showing\x20','repeat','update','Run\x20a\x20scheduled\x20query\x20immediately','updated_at','job_id','format','Creating\x20schedule...','trim','cron','create','INVALID_ARGUMENT','queries','1668djOhZS','engine_version','padEnd','result','red','map','time','Query\x20file\x20is\x20empty','database','Cancelled','substring','\x20schedules','time_zone','Delete\x20a\x20scheduled\x20query','3179BEigtf','\x20execution','cyan','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','84627xlyIti','/app/queries/editor?queryId=','1054420WBjsJp','\x20\x20Job\x20ID:\x20','d\x20ago','created_at','dim','keys','1640saZTNL','\x20created','length','green','Searching\x20scheduled\x20queries\x20matching\x20\x22','schedules','schedule:delete','7NluvTG','Schedule\x20deleted:\x20','Failed\x20to\x20read\x20file:\x20','h\x20ago','schedule:list','delay','entries','from','Show\x20schedule\x20execution\x20history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','\x22...','num','Update\x20a\x20scheduled\x20query','count','limit'];a34_0x2ebe=function(){return _0x3cd337;};return a34_0x2ebe();}const a34_0x9bfb35=a34_0xcb4f;(function(_0x32a133,_0x2c96da){const _0x591cf7=a34_0xcb4f,_0x308cc8=_0x32a133();while(!![]){try{const _0x3e436f=parseInt(_0x591cf7(0x156))/0x1*(-parseInt(_0x591cf7(0x15b))/0x2)+-parseInt(_0x591cf7(0x182))/0x3+parseInt(_0x591cf7(0x170))/0x4*(-parseInt(_0x591cf7(0x18a))/0x5)+-parseInt(_0x591cf7(0x120))/0x6*(parseInt(_0x591cf7(0x191))/0x7)+-parseInt(_0x591cf7(0x155))/0x8+parseInt(_0x591cf7(0x15a))/0x9*(-parseInt(_0x591cf7(0x184))/0xa)+-parseInt(_0x591cf7(0x17e))/0xb*(-parseInt(_0x591cf7(0x11b))/0xc);if(_0x3e436f===_0x2c96da)break;else _0x308cc8['push'](_0x308cc8['shift']());}catch(_0x5a5b2e){_0x308cc8['push'](_0x308cc8['shift']());}}}(a34_0x2ebe,0x8ea90));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';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x2e487a from'chalk';function formatRelativeTime(_0x20e5c5){const _0x30cb38=a34_0xcb4f,_0xb3fa08=new Date(_0x20e5c5),_0x51fa64=new Date(),_0x667b51=_0xb3fa08[_0x30cb38(0x15c)]()-_0x51fa64[_0x30cb38(0x15c)](),_0x47d643=Math[_0x30cb38(0x129)](_0x667b51)/0x3e8,_0x5e1ff2=_0x667b51<0x0;if(_0x47d643<0x3c)return _0x5e1ff2?_0x30cb38(0x11e):_0x30cb38(0x122);else{if(_0x47d643<0xe10){const _0x5dcf40=Math['round'](_0x47d643/0x3c);return _0x5e1ff2?_0x5dcf40+_0x30cb38(0x144):_0x30cb38(0x133)+_0x5dcf40+'m';}else{if(_0x47d643<0x15180){const _0x40d9d2=Math[_0x30cb38(0x11f)](_0x47d643/0xe10);return _0x5e1ff2?_0x40d9d2+_0x30cb38(0x194):'in\x20'+_0x40d9d2+'h';}else{if(_0x47d643<0x93a80){const _0x523484=Math['round'](_0x47d643/0x15180);return _0x5e1ff2?_0x523484+_0x30cb38(0x186):_0x30cb38(0x133)+_0x523484+'d';}else return _0xb3fa08['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a34_0x9bfb35(0x195);[a34_0x9bfb35(0x14d)]='List\x20scheduled\x20queries';async['execute'](_0x5310d0){const _0x1c67c8=a34_0x9bfb35,{options:_0x5240c7,args:_0x3ee1fb,tdx:_0x167e81}=_0x5310d0,_0xaa81fe=resolveLimit(_0x5240c7[_0x1c67c8(0x19f)],DEFAULT_DISPLAY_LIMIT),_0x305850=_0x3ee1fb[0x0],_0x4090d0=_0x305850?_0x1c67c8(0x18e)+_0x305850+_0x1c67c8(0x19b):'Listing\x20scheduled\x20queries...',_0x23ba0e=await withSpinner(_0x4090d0,()=>_0x167e81[_0x1c67c8(0x18f)][_0x1c67c8(0x136)]({'limit':_0xaa81fe,'scheduled':!![],'pattern':_0x305850}),{'verbose':_0x5240c7[_0x1c67c8(0x125)]}),_0x2a5505=_0x23ba0e[_0x1c67c8(0x11d)][_0x1c67c8(0x16f)],_0x41fd55=_0x23ba0e[_0x1c67c8(0x11d)][_0x1c67c8(0x12b)][_0x1c67c8(0x108)],_0x140eed=_0x305850?_0x1c67c8(0x119)+_0x305850+'\x22':'';_0x41fd55?console[_0x1c67c8(0x13d)](_0x1c67c8(0x131)+_0x2a5505[_0x1c67c8(0x18c)]+_0x1c67c8(0x17b)+_0x140eed+_0x1c67c8(0x141)):console['error']('Found\x20'+_0x2a5505[_0x1c67c8(0x18c)]+_0x1c67c8(0x13f)+(_0x2a5505[_0x1c67c8(0x18c)]!==0x1?_0x1c67c8(0x10d):'y')+_0x140eed);if(_0x5240c7['format']==='json'||_0x5240c7[_0x1c67c8(0x169)]==='jsonl'||_0x5240c7[_0x1c67c8(0x169)]===_0x1c67c8(0x132)||_0x5240c7['format']===_0x1c67c8(0x13a)){const _0xe22866=_0x2a5505['map'](_0x3f593b=>({'id':_0x3f593b['id'],'name':_0x3f593b['name'],'cron':_0x3f593b[_0x1c67c8(0x16c)],'database':_0x3f593b[_0x1c67c8(0x178)]?.['name'],'type':_0x3f593b[_0x1c67c8(0x138)],'timezone':_0x3f593b[_0x1c67c8(0x17c)],'user_name':_0x3f593b[_0x1c67c8(0x152)]?.[_0x1c67c8(0x140)],'updated_at':_0x3f593b[_0x1c67c8(0x167)],'next_run_at':_0x3f593b[_0x1c67c8(0x146)],'last_job_status':_0x3f593b[_0x1c67c8(0x116)]?.[_0x1c67c8(0x147)]}));await handleSDKOutput(_0xe22866,_0x5240c7);}else{if(_0x2a5505['length']===0x0)console['log'](_0x1c67c8(0x126));else{const _0x41d489=_0x5240c7[_0x1c67c8(0x123)],_0x14d969=_0x2a5505[_0x1c67c8(0x175)](_0x51673d=>{const _0x3f068d=_0x1c67c8,_0x4f84ed=_0x51673d[_0x3f068d(0x116)]?.[_0x3f068d(0x147)]?_0x51673d[_0x3f068d(0x116)]['status']===_0x3f068d(0x121)?'✓':'✗':'-',_0x765aa5=_0x51673d[_0x3f068d(0x116)]?.['ended_at']?formatRelativeTime(_0x51673d[_0x3f068d(0x116)][_0x3f068d(0x10e)]):_0x3f068d(0x14f),_0x3406f8=_0x51673d['next_run_at']?formatRelativeTime(_0x51673d['next_run_at']):'-',_0x1f353b=_0x51673d['cron']||'',_0x5036d9=_0x51673d['name']||_0x3f068d(0x109),_0x170073=getConsoleUrl(_0x41d489,_0x3f068d(0x183)+_0x51673d['id']);return{'statusIcon':_0x4f84ed,'lastRun':_0x765aa5,'nextRun':_0x3406f8,'cron':_0x1f353b,'name':_0x5036d9,'queryUrl':_0x170073,'status':_0x51673d[_0x3f068d(0x116)]?.[_0x3f068d(0x147)]};}),_0x51970c=Math[_0x1c67c8(0x130)](..._0x14d969[_0x1c67c8(0x175)](_0xb3dff=>_0xb3dff[_0x1c67c8(0x118)][_0x1c67c8(0x18c)])),_0x106dde=Math[_0x1c67c8(0x130)](..._0x14d969[_0x1c67c8(0x175)](_0x11c782=>_0x11c782[_0x1c67c8(0x149)][_0x1c67c8(0x18c)])),_0xd6fadc=Math[_0x1c67c8(0x130)](..._0x14d969[_0x1c67c8(0x175)](_0x1d4bb3=>_0x1d4bb3['cron'][_0x1c67c8(0x18c)])),_0x5e4c73=_0x14d969[_0x1c67c8(0x175)](_0xef3bff=>{const _0x339e8a=_0x1c67c8,_0x3aa5b2=_0xef3bff[_0x339e8a(0x147)]===_0x339e8a(0x121)?a34_0x2e487a[_0x339e8a(0x18d)](_0xef3bff[_0x339e8a(0x114)]):_0xef3bff[_0x339e8a(0x147)]===_0x339e8a(0x13d)?a34_0x2e487a[_0x339e8a(0x174)](_0xef3bff[_0x339e8a(0x114)]):a34_0x2e487a[_0x339e8a(0x188)](_0xef3bff[_0x339e8a(0x114)]),_0x65c2=_0xef3bff['lastRun']['padEnd'](_0x51970c),_0x4695f4=_0xef3bff[_0x339e8a(0x149)][_0x339e8a(0x172)](_0x106dde),_0x310776=_0xef3bff[_0x339e8a(0x16c)]?a34_0x2e487a[_0x339e8a(0x180)](_0xef3bff[_0x339e8a(0x16c)][_0x339e8a(0x172)](_0xd6fadc)):'\x20'[_0x339e8a(0x164)](_0xd6fadc),_0x27c76d=hyperlink(_0xef3bff[_0x339e8a(0x140)],_0xef3bff[_0x339e8a(0x159)]);return _0x339e8a(0x151)+_0x3aa5b2+'\x20'+_0x65c2+_0x339e8a(0x137)+_0x4695f4+'\x20\x20'+_0x310776+'\x20\x20'+_0x27c76d;});await writeOutput(_0x5e4c73['join']('\x0a'),_0x5240c7[_0x1c67c8(0x13c)],_0x1c67c8(0x1a1));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x9bfb35(0x124);['description']='Show\x20schedule\x20details';['validate'](_0x15e571){const _0x5240a0=a34_0x9bfb35,_0x2afca0=_0x15e571[_0x5240a0(0x135)][0x0];if(!_0x2afca0)return _0x5240a0(0x13b);return undefined;}async[a34_0x9bfb35(0x15e)](_0x1f0807){const _0x256f48=a34_0x9bfb35,{options:_0x121ffe,args:_0x293e8a,tdx:_0x44d0af}=_0x1f0807,_0x35dc70=_0x293e8a[0x0],_0x57149a=await withSpinner(_0x256f48(0x112),()=>_0x44d0af['schedules'][_0x256f48(0x150)](_0x35dc70),{'verbose':_0x121ffe[_0x256f48(0x125)]}),_0x535214=_0x57149a[_0x256f48(0x11d)],_0xbd3e0c={'name':_0x535214['name'],'cron':_0x535214[_0x256f48(0x16c)],'database':_0x535214[_0x256f48(0x178)],'type':_0x535214['type'],'timezone':_0x535214[_0x256f48(0x14c)],'user_name':_0x535214[_0x256f48(0x145)],'created_at':_0x535214[_0x256f48(0x187)],'engine_version':_0x535214['engine_version'],'executing_user_id':_0x535214[_0x256f48(0x13e)],'query':_0x535214['query'],'delay':_0x535214['delay'],'priority':_0x535214['priority'],'retry_limit':_0x535214[_0x256f48(0x161)],..._0x535214[_0x256f48(0x173)]&&{'result':_0x535214[_0x256f48(0x173)]}};return await handleSingleObjectOutput(_0xbd3e0c,_0x121ffe),0x0;}}function a34_0xcb4f(_0x24dd3d,_0x39d8a3){_0x24dd3d=_0x24dd3d-0x107;const _0x2ebe3e=a34_0x2ebe();let _0xcb4f6a=_0x2ebe3e[_0x24dd3d];return _0xcb4f6a;}export class ScheduleCreateCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x143);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x12f);[a34_0x9bfb35(0x14b)](_0x24d00c){const _0x3ac86f=a34_0x9bfb35,_0x45146e=_0x24d00c[_0x3ac86f(0x135)][0x0];if(!_0x45146e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0xf6dcff=_0x24d00c[_0x3ac86f(0x12a)];if(!_0xf6dcff[_0x3ac86f(0x178)])return _0x3ac86f(0x115);return undefined;}async[a34_0x9bfb35(0x15e)](_0x543d9c){const _0x421ba8=a34_0x9bfb35,{options:_0x21618c,args:_0x32aba0,tdx:_0x5290e8}=_0x543d9c,_0x1ae80b=_0x32aba0[0x0],_0x32e6dc=_0x21618c,_0x3ae393=_0x32e6dc[_0x421ba8(0x178)],_0x37b4fa=_0x32e6dc['file'],_0x56b2fb=_0x32e6dc[_0x421ba8(0x138)]||'trino';let _0x325683;try{_0x325683=readFileSync(_0x37b4fa,'utf-8')[_0x421ba8(0x16b)]();}catch(_0x2370a9){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20read\x20file:\x20'+_0x37b4fa,_0x2370a9 instanceof Error?_0x2370a9:undefined);}if(!_0x325683)throw new SDKError(ErrorCode[_0x421ba8(0x16e)],_0x421ba8(0x177));const _0x668d4f={'database':_0x3ae393,'query':_0x325683,'type':_0x56b2fb};if(_0x32e6dc['cron'])_0x668d4f[_0x421ba8(0x16c)]=_0x32e6dc['cron'];if(_0x32e6dc[_0x421ba8(0x14c)])_0x668d4f[_0x421ba8(0x14c)]=_0x32e6dc['timezone'];if(_0x32e6dc[_0x421ba8(0x196)]!==undefined)_0x668d4f[_0x421ba8(0x196)]=Number(_0x32e6dc[_0x421ba8(0x196)]);if(_0x32e6dc[_0x421ba8(0x110)]!==undefined)_0x668d4f[_0x421ba8(0x110)]=Number(_0x32e6dc[_0x421ba8(0x110)]);if(_0x32e6dc[_0x421ba8(0x10c)]!==undefined)_0x668d4f[_0x421ba8(0x161)]=Number(_0x32e6dc['retryLimit']);if(_0x32e6dc[_0x421ba8(0x12e)])_0x668d4f[_0x421ba8(0x171)]=_0x32e6dc[_0x421ba8(0x12e)];if(_0x32e6dc[_0x421ba8(0x173)])_0x668d4f[_0x421ba8(0x173)]=_0x32e6dc[_0x421ba8(0x173)];if(_0x21618c[_0x421ba8(0x125)]){console[_0x421ba8(0x13d)](_0x421ba8(0x142)+_0x1ae80b),console[_0x421ba8(0x13d)](_0x421ba8(0x14e)+_0x3ae393),console[_0x421ba8(0x13d)]('\x20\x20Type:\x20'+_0x56b2fb);if(_0x668d4f[_0x421ba8(0x16c)])console[_0x421ba8(0x13d)](_0x421ba8(0x14a)+_0x668d4f[_0x421ba8(0x16c)]);if(_0x668d4f[_0x421ba8(0x14c)])console[_0x421ba8(0x13d)](_0x421ba8(0x158)+_0x668d4f['timezone']);}const _0x4b06cd=await withSpinner(_0x421ba8(0x16a),()=>_0x5290e8[_0x421ba8(0x18f)][_0x421ba8(0x16d)](_0x1ae80b,_0x668d4f),{'verbose':_0x21618c[_0x421ba8(0x125)]});return console['error'](_0x421ba8(0x15f)+_0x4b06cd['data']['name']),await handleSingleObjectOutput(_0x4b06cd[_0x421ba8(0x11d)],_0x21618c),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a34_0x9bfb35(0x12c);['description']=a34_0x9bfb35(0x19d);[a34_0x9bfb35(0x14b)](_0x3e0660){const _0x362048=a34_0x9bfb35,_0x394b33=_0x3e0660[_0x362048(0x135)][0x0];if(!_0x394b33)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a34_0x9bfb35(0x15e)](_0x693fde){const _0x12c391=a34_0x9bfb35,{options:_0xb1548e,args:_0x826e7b,tdx:_0x3bcae3}=_0x693fde,_0x530b24=_0x826e7b[0x0],_0x2e68f9=_0xb1548e,_0x375993={};if(_0x2e68f9[_0x12c391(0x178)])_0x375993[_0x12c391(0x178)]=_0x2e68f9['database'];if(_0x2e68f9['type'])_0x375993[_0x12c391(0x138)]=_0x2e68f9['type'];if(_0x2e68f9[_0x12c391(0x16c)])_0x375993['cron']=_0x2e68f9[_0x12c391(0x16c)];if(_0x2e68f9[_0x12c391(0x14c)])_0x375993[_0x12c391(0x14c)]=_0x2e68f9[_0x12c391(0x14c)];if(_0x2e68f9['delay']!==undefined)_0x375993['delay']=Number(_0x2e68f9[_0x12c391(0x196)]);if(_0x2e68f9['priority']!==undefined)_0x375993[_0x12c391(0x110)]=Number(_0x2e68f9['priority']);if(_0x2e68f9[_0x12c391(0x10c)]!==undefined)_0x375993[_0x12c391(0x161)]=Number(_0x2e68f9['retryLimit']);if(_0x2e68f9['engineVersion'])_0x375993[_0x12c391(0x171)]=_0x2e68f9[_0x12c391(0x12e)];if(_0x2e68f9[_0x12c391(0x173)])_0x375993[_0x12c391(0x173)]=_0x2e68f9['result'];if(_0x2e68f9['file'])try{_0x375993[_0x12c391(0x1a0)]=readFileSync(_0x2e68f9[_0x12c391(0x148)],_0x12c391(0x12d))[_0x12c391(0x16b)]();}catch(_0x511af1){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12c391(0x193)+_0x2e68f9[_0x12c391(0x148)],_0x511af1 instanceof Error?_0x511af1:undefined);}if(Object[_0x12c391(0x189)](_0x375993)[_0x12c391(0x18c)]===0x0)throw new SDKError(ErrorCode[_0x12c391(0x16e)],_0x12c391(0x127));if(_0xb1548e['verbose']){console['error'](_0x12c391(0x139)+_0x530b24);for(const [_0x16e2d0,_0x7b0fca]of Object[_0x12c391(0x197)](_0x375993)){_0x16e2d0===_0x12c391(0x1a0)?console['error']('\x20\x20'+_0x16e2d0+':\x20'+_0x7b0fca[_0x12c391(0x17a)](0x0,0x32)+_0x12c391(0x160)):console[_0x12c391(0x13d)]('\x20\x20'+_0x16e2d0+':\x20'+_0x7b0fca);}}const _0x2611f3=await withSpinner(_0x12c391(0x11c),()=>_0x3bcae3[_0x12c391(0x18f)][_0x12c391(0x165)](_0x530b24,_0x375993),{'verbose':_0xb1548e['verbose']});return console[_0x12c391(0x13d)](_0x12c391(0x11a)+_0x2611f3['data'][_0x12c391(0x140)]),await handleSingleObjectOutput(_0x2611f3[_0x12c391(0x11d)],_0xb1548e),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x190);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x17d);['validate'](_0xce91b){const _0x1fc1ed=a34_0x9bfb35,_0x335979=_0xce91b[_0x1fc1ed(0x135)][0x0];if(!_0x335979)return _0x1fc1ed(0x162);return undefined;}async[a34_0x9bfb35(0x15e)](_0x1684f0){const _0x13cd89=a34_0x9bfb35,{options:_0x5476fe,args:_0x378243,tdx:_0x15d0cf}=_0x1684f0,_0x5ae915=_0x378243[0x0];if(!_0x5476fe['yes']){const _0x5b0c89=await confirm(_0x13cd89(0x181)+_0x5ae915+'\x22?');if(!_0x5b0c89)return console[_0x13cd89(0x13d)](_0x13cd89(0x179)),0x0;}const _0xfda51f=await withSpinner(_0x13cd89(0x117),()=>_0x15d0cf[_0x13cd89(0x18f)][_0x13cd89(0x107)](_0x5ae915),{'verbose':_0x5476fe[_0x13cd89(0x125)]});return console[_0x13cd89(0x13d)](_0x13cd89(0x192)+_0xfda51f[_0x13cd89(0x11d)][_0x13cd89(0x140)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x111);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x166);['validate'](_0x573f17){const _0x571df2=a34_0x9bfb35,_0x57ce8d=_0x573f17[_0x571df2(0x135)][0x0];if(!_0x57ce8d)return _0x571df2(0x19a);return undefined;}async[a34_0x9bfb35(0x15e)](_0x161429){const _0xe58d9c=a34_0x9bfb35,{options:_0x6efc28,args:_0x4241cd,tdx:_0x5670b1}=_0x161429,_0x616b53=_0x4241cd[0x0],_0x18234e=_0x6efc28,_0x1d0658=_0x18234e[_0xe58d9c(0x176)],_0x5caa55=_0x18234e[_0xe58d9c(0x19c)]!==undefined?Number(_0x18234e[_0xe58d9c(0x19c)]):undefined;if(_0x6efc28[_0xe58d9c(0x125)]){console[_0xe58d9c(0x13d)]('Running\x20schedule:\x20'+_0x616b53);if(_0x1d0658)console[_0xe58d9c(0x13d)](_0xe58d9c(0x113)+_0x1d0658);if(_0x5caa55)console[_0xe58d9c(0x13d)](_0xe58d9c(0x128)+_0x5caa55);}const _0xdfc6f8=await withSpinner(_0xe58d9c(0x10b),()=>_0x5670b1[_0xe58d9c(0x18f)]['run'](_0x616b53,{'time':_0x1d0658,'num':_0x5caa55}),{'verbose':_0x6efc28[_0xe58d9c(0x125)]}),_0x1a581f=_0xdfc6f8[_0xe58d9c(0x11d)]['jobs'];console[_0xe58d9c(0x13d)]('Schedule\x20run\x20submitted:\x20'+_0x1a581f['length']+_0xe58d9c(0x157)+(_0x1a581f['length']!==0x1?'s':'')+_0xe58d9c(0x18b));for(const _0x47b8e1 of _0x1a581f){console['error'](_0xe58d9c(0x185)+_0x47b8e1[_0xe58d9c(0x168)]);}return await handleSDKOutput(_0x1a581f,_0x6efc28),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x9bfb35(0x140)]=a34_0x9bfb35(0x10f);[a34_0x9bfb35(0x14d)]=a34_0x9bfb35(0x199);['validate'](_0x4edf08){const _0x313bf7=a34_0x9bfb35,_0x26bd68=_0x4edf08[_0x313bf7(0x135)][0x0];if(!_0x26bd68)return _0x313bf7(0x10a);return undefined;}async['execute'](_0x3c74f5){const _0x4ebc09=a34_0x9bfb35,{options:_0x3d7d4b,args:_0x340d98,tdx:_0x47167f}=_0x3c74f5,_0x368ca9=_0x340d98[0x0],_0x2d5b01=_0x3d7d4b,_0x57b7c6=_0x2d5b01[_0x4ebc09(0x198)]!==undefined?Number(_0x2d5b01[_0x4ebc09(0x198)]):undefined,_0x4823c9=_0x2d5b01['to']!==undefined?Number(_0x2d5b01['to']):undefined,_0x1da94a=await withSpinner('Getting\x20schedule\x20history...',()=>_0x47167f['schedules'][_0x4ebc09(0x134)](_0x368ca9,{'from':_0x57b7c6,'to':_0x4823c9}),{'verbose':_0x3d7d4b[_0x4ebc09(0x125)]}),_0xef89ec=_0x1da94a[_0x4ebc09(0x11d)];console[_0x4ebc09(0x13d)](_0x4ebc09(0x154)+_0xef89ec[_0x4ebc09(0x19e)]+_0x4ebc09(0x17f)+(_0xef89ec[_0x4ebc09(0x19e)]!==0x1?'s':'')+_0x4ebc09(0x163)+_0xef89ec[_0x4ebc09(0x198)]+'-'+_0xef89ec['to']+')');const _0x222059=_0xef89ec[_0x4ebc09(0x134)][_0x4ebc09(0x175)](_0x91d754=>({'job_id':_0x91d754['job_id'],'type':_0x91d754[_0x4ebc09(0x138)],'status':_0x91d754[_0x4ebc09(0x147)],'scheduled_at':_0x91d754[_0x4ebc09(0x153)],'created_at':_0x91d754[_0x4ebc09(0x187)],'start_at':_0x91d754['start_at'],'end_at':_0x91d754[_0x4ebc09(0x15d)]}));return await handleSDKOutput(_0x222059,_0x3d7d4b),0x0;}}
@@ -1 +1 @@
1
- const a35_0x596d4b=a35_0x5922;(function(_0x4e77e7,_0xf58398){const _0x5c3704=a35_0x5922,_0x60ec57=_0x4e77e7();while(!![]){try{const _0x4340bb=-parseInt(_0x5c3704(0x141))/0x1+parseInt(_0x5c3704(0xd8))/0x2*(-parseInt(_0x5c3704(0xe2))/0x3)+parseInt(_0x5c3704(0x115))/0x4+-parseInt(_0x5c3704(0xe9))/0x5*(parseInt(_0x5c3704(0x14c))/0x6)+parseInt(_0x5c3704(0x171))/0x7+parseInt(_0x5c3704(0xfb))/0x8+parseInt(_0x5c3704(0x15d))/0x9;if(_0x4340bb===_0xf58398)break;else _0x60ec57['push'](_0x60ec57['shift']());}catch(_0x4f34a2){_0x60ec57['push'](_0x60ec57['shift']());}}}(a35_0x1df4,0x6e045));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a35_0x1df4(){const _0x47d1a8=['Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:folder:list','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','listFolders','trim','5374sSVDCf','limit','web','Segment\x20ID:\x20','stats','parentSegment','segment:sql','getSQLFromServerSegment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','177KUjgby','Fetching\x20folder\x20\x27','Examples:','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Executing\x20segment\x20query...','/app/ps/','segmentName','10PTVohn','SELECT\x20*\x20FROM\x20(\x0a','getFolder','segment','Use:\x20tdx\x20ps\x20view','Folder\x20ID:\x20','Creating\x20folder\x20\x27','Resolved\x20parent\x20folder\x20ID:\x20','green','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:show','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20describe\x20<path>','parentId','segment:folder:show','Resolving\x20folder\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','5944728etmUFY','Fetching\x20SQL\x20from\x20rule...','resolvePathToResource','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','segment:desc','processedRows','Resolved:\x20','parent','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','jsonl','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','getSegment','\x27\x20with\x20ID:\x20','folderPath','includes','Resolving\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','segment:view','getSQLFromYamlFile','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Fetching\x20parent\x20segment\x20details...','log','Resolving\x20parent\x20folder\x20\x27','411180AeZCHF','content','(root)','✔\x20Found\x20','cyan','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','red','\x20\x20Cause:\x20','parentFolder','\x20\x20Segment\x20name:\x20','setJobId','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Resolving\x20path\x20\x27','site','Get\x20SQL\x20query\x20for\x20child\x20segment','Fetching\x20SQL\x20for\x20segment...','\x20\x20tdx\x20sg\x20sql\x20--path\x20','execute','getParent','INVALID_ARGUMENT','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','description','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','query','Resolved\x20parent\x20ID:\x20','Use:\x20tdx\x20ps\x20view\x20-w','segmentId','type','Resolved\x20type:\x20','replace','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Folder\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','message','\x20\x20Full\x20path:\x20','folder','SQL\x20query:\x0a','folderId','Parent\x20name:\x20','\x20Opening\x20','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','Site:\x20','786736LgPgKj','error','Resolving\x20parent\x20segment\x20\x27','resolveParentId','Show\x20segment\x20or\x20folder\x20details','/e/','✔\x20Query\x20completed:\x20Processed\x20','Parent\x20ID:\x20','url','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','jobId','2251218ERhIbx','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Target\x20path:\x20','length','SEGMENT_NOT_FOUND','Show\x20segment\x20folder\x20details','Options:','Usage:','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Parent\x20segment\x20name\x20is\x20required','getSegmentSQL','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','cause','verbose','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','3864168IQvKDT','\x20\x20Folder\x20path:\x20','Fetching\x20segment\x20details...','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20folder','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','code','Error:\x20','Resolved\x20relative\x20path\x20to:\x20','createFolder','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','data','SEGMENT_FOLDER_NOT_FOUND','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x27...','Usage:\x20tdx\x20sg\x20show\x20<name>','format','\x20\x20Parent\x20segment:\x20','6097462aZAfBv','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20YAML\x20file:\x20','Use:\x20tdx\x20ps\x20show','fullPath','name','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','✖\x20Query\x20failed\x20[','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','Fetching\x20folder\x20details...','Listing\x20folders\x20for\x20parent\x20\x27','resolveFolderId'];a35_0x1df4=function(){return _0x47d1a8;};return a35_0x1df4();}import{openBrowser}from'../utils/process.js';function a35_0x5922(_0x111510,_0x499be6){_0x111510=_0x111510-0xd3;const _0x1df4ff=a35_0x1df4();let _0x5922e0=_0x1df4ff[_0x111510];return _0x5922e0;}import a35_0x1088f7 from'chalk';async function resolveSegmentTarget(_0x4cebed,_0x35bda5,_0x2bde79){const _0x495759=a35_0x5922;if(isYamlFilePath(_0x4cebed))try{const _0xe3b2ab=await resolveYamlFilePath(_0x4cebed);return _0x2bde79&&(console[_0x495759(0x142)](_0x495759(0x174)+_0x4cebed),console[_0x495759(0x142)](_0x495759(0x170)+_0xe3b2ab['parentSegment']),console[_0x495759(0x142)](_0x495759(0x11e)+_0xe3b2ab[_0x495759(0xe8)]),console['error'](_0x495759(0x15e)+(_0xe3b2ab[_0x495759(0x109)]||_0x495759(0x117))),console[_0x495759(0x142)](_0x495759(0x139)+_0xe3b2ab[_0x495759(0x176)])),_0xe3b2ab[_0x495759(0x176)];}catch(_0x2b4b0a){throw new SDKError(ErrorCode[_0x495759(0x129)],_0x495759(0xd5)+_0x2b4b0a['message']);}if(!_0x35bda5)throw new SDKError(ErrorCode[_0x495759(0x129)],_0x495759(0x17a));return _0x35bda5+'/'+_0x4cebed;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x596d4b(0x177)]='segment:describe';[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x145);async[a35_0x596d4b(0x127)](_0x2cd1a2){const _0x5836ef=a35_0x596d4b,{options:_0x64df9c,args:_0x4a04b3,tdx:_0x4d3b1b}=_0x2cd1a2,_0x69361c=_0x4a04b3[0x0],_0x4fc6f9=!_0x69361c&&!!_0x64df9c['parentSegment'],_0x49acc8=_0x69361c||_0x64df9c[_0x5836ef(0xdd)];if(!_0x49acc8)return console[_0x5836ef(0x142)](_0x5836ef(0x172)),console[_0x5836ef(0x142)](_0x5836ef(0xf6)),console[_0x5836ef(0x142)](_0x5836ef(0xe4)),console['error'](_0x5836ef(0x164)),console[_0x5836ef(0x142)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x5836ef(0x142)](_0x5836ef(0x10c)),console[_0x5836ef(0x142)](_0x5836ef(0x121)),0x1;try{const _0x1d09c7=_0x64df9c['segmentPath'];let _0x5e7772=_0x49acc8;!_0x4fc6f9&&_0x1d09c7&&!_0x49acc8[_0x5836ef(0x10a)]('/')&&(_0x5e7772=_0x1d09c7+'/'+_0x49acc8,_0x64df9c[_0x5836ef(0x159)]&&console[_0x5836ef(0x142)](_0x5836ef(0x167)+_0x5e7772));const _0x2d50f1=await withSpinner(_0x5836ef(0x122)+_0x5e7772+_0x5836ef(0x16d),()=>_0x4d3b1b[_0x5836ef(0xec)]['resolvePathToResource'](_0x5e7772),{'verbose':_0x64df9c[_0x5836ef(0x159)]}),_0x4bdda8=_0x2d50f1['data'];_0x64df9c[_0x5836ef(0x159)]&&(console[_0x5836ef(0x142)](_0x5836ef(0x133)+_0x4bdda8[_0x5836ef(0x132)]),console[_0x5836ef(0x142)](_0x5836ef(0x148)+_0x4bdda8[_0x5836ef(0xf7)]),_0x4bdda8[_0x5836ef(0x13c)]&&console[_0x5836ef(0x142)](_0x5836ef(0xee)+_0x4bdda8[_0x5836ef(0x13c)]),_0x4bdda8[_0x5836ef(0x131)]&&console[_0x5836ef(0x142)](_0x5836ef(0xdb)+_0x4bdda8['segmentId']));if(_0x4bdda8['type']===_0x5836ef(0x102)){const _0x2dd5e9=await withSpinner(_0x5836ef(0x112),()=>_0x4d3b1b['segment'][_0x5836ef(0x128)](_0x4bdda8[_0x5836ef(0xf7)]),{'verbose':_0x64df9c[_0x5836ef(0x159)]});await handleSingleObjectOutput(_0x2dd5e9[_0x5836ef(0x16a)],_0x64df9c);}else{if(_0x4bdda8[_0x5836ef(0x132)]==='folder'){if(!_0x4bdda8[_0x5836ef(0x13c)])throw new SDKError(ErrorCode[_0x5836ef(0x16b)],_0x5836ef(0xf5));const _0x47d443=await withSpinner(_0x5836ef(0x17c),()=>_0x4d3b1b[_0x5836ef(0xec)][_0x5836ef(0xeb)](_0x4bdda8['folderId']),{'verbose':_0x64df9c[_0x5836ef(0x159)]});await handleSingleObjectOutput(_0x47d443[_0x5836ef(0x16a)],_0x64df9c);}else{if(_0x4bdda8[_0x5836ef(0x132)]==='segment'){if(!_0x4bdda8[_0x5836ef(0x131)])throw new SDKError(ErrorCode[_0x5836ef(0x150)],_0x5836ef(0xe0));const _0x316dd5=await withSpinner(_0x5836ef(0x15f),()=>_0x4d3b1b[_0x5836ef(0xec)][_0x5836ef(0x107)](_0x4bdda8['parentId'],_0x4bdda8[_0x5836ef(0x131)]),{'verbose':_0x64df9c[_0x5836ef(0x159)]});await handleSingleObjectOutput(_0x316dd5['data'],_0x64df9c);}}}return 0x0;}catch(_0x343173){if(_0x343173 instanceof SDKError)return console[_0x5836ef(0x142)](_0x5836ef(0x166)+_0x343173[_0x5836ef(0x138)]),_0x343173[_0x5836ef(0x158)]&&console[_0x5836ef(0x142)]('\x20\x20Cause:\x20'+_0x343173['cause']),0x1;throw _0x343173;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xf4);[a35_0x596d4b(0x12c)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x116943){const _0x12b326=a35_0x596d4b,{options:_0x29c2e5,args:_0x39df77,tdx:_0x31e57c}=_0x116943,_0x4c935c=_0x39df77[0x0];if(!_0x4c935c)return console[_0x12b326(0x142)](_0x12b326(0xf2)),console[_0x12b326(0x142)](_0x12b326(0x16e)),console['error'](_0x12b326(0xf3)),console[_0x12b326(0x142)](_0x12b326(0xe4)),console[_0x12b326(0x142)](_0x12b326(0x169)),console[_0x12b326(0x142)](_0x12b326(0x16c)),0x1;try{const _0x4f9d83=_0x29c2e5[_0x12b326(0xdd)],_0x4c1885=await resolveSegmentTarget(_0x4c935c,_0x4f9d83,_0x29c2e5[_0x12b326(0x159)]);_0x29c2e5[_0x12b326(0x159)]&&console['error'](_0x12b326(0x14e)+_0x4c1885);const _0x4d8e6d=await withSpinner('Resolving\x20\x27'+_0x4c935c+_0x12b326(0x16d),()=>_0x31e57c[_0x12b326(0xec)][_0x12b326(0xfd)](_0x4c1885),{'verbose':_0x29c2e5[_0x12b326(0x159)]}),_0xc27eb2=_0x4d8e6d['data'];_0x29c2e5['verbose']&&(console[_0x12b326(0x142)]('Resolved\x20type:\x20'+_0xc27eb2[_0x12b326(0x132)]),console[_0x12b326(0x142)]('Parent\x20ID:\x20'+_0xc27eb2['parentId']));if(_0xc27eb2[_0x12b326(0x132)]===_0x12b326(0x13a))return console[_0x12b326(0x142)](_0x12b326(0x11a)),console['error'](_0x12b326(0xd4)),0x1;if(_0xc27eb2['type']==='parent')return console['error'](_0x12b326(0x157)),console[_0x12b326(0x142)](_0x12b326(0x175)),0x1;if(!_0xc27eb2[_0x12b326(0x131)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x12b326(0xe0));const _0x2b6163=await withSpinner(_0x12b326(0x125),()=>_0x31e57c['segment'][_0x12b326(0x156)](_0xc27eb2[_0x12b326(0xf7)],_0xc27eb2[_0x12b326(0x131)]),{'verbose':_0x29c2e5[_0x12b326(0x159)]});let _0x582814=_0x2b6163[_0x12b326(0x16a)];const _0xd327b1=resolveLimit(_0x29c2e5[_0x12b326(0xd9)],DEFAULT_DISPLAY_LIMIT),_0x2a5b33=/\bLIMIT\s+\d+/i['test'](_0x582814);!_0x2a5b33&&(_0x582814=_0x582814[_0x12b326(0xd7)]()[_0x12b326(0x134)](/;+$/,''),_0x582814=_0x12b326(0xea)+_0x582814+_0x12b326(0xfa)+_0xd327b1);_0x29c2e5['verbose']&&console[_0x12b326(0x142)](_0x12b326(0x13b)+_0x582814);const _0x393291=await withProgressSpinner(_0x12b326(0xe6),async _0x4ebd30=>{const _0x1a8713=_0x12b326,_0xcdc3cb=await _0x31e57c[_0x1a8713(0x12e)]['execute'](_0x582814,{'catalog':'td','schema':'information_schema','onJobId':_0x57cbaf=>{const _0x8c94a5=_0x1a8713;_0x4ebd30[_0x8c94a5(0x11f)](_0x57cbaf);}});return _0xcdc3cb;},{'verbose':_0x29c2e5[_0x12b326(0x159)]}),_0x4a1b8d=_0x393291['data'],_0x20c452=_0x4a1b8d[_0x12b326(0x14b)]?'\x20[Job\x20ID:\x20'+_0x4a1b8d['jobId']+']':'';return console[_0x12b326(0x142)](_0x12b326(0x147)+_0x4a1b8d['stats'][_0x12b326(0x100)]['toLocaleString']()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x4a1b8d[_0x12b326(0xdc)]['elapsedTimeMillis'])+_0x20c452)),await handleQueryOutput(_0x4a1b8d,_0x29c2e5),0x0;}catch(_0x44bf5c){if(_0x44bf5c instanceof SDKError)return console['error'](_0x12b326(0x179)+_0x44bf5c[_0x12b326(0x165)]+']'),console[_0x12b326(0x142)]('\x0a'+_0x44bf5c['message']),0x1;throw _0x44bf5c;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xd3);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x10e);async[a35_0x596d4b(0x127)](_0x430ad5){const _0x48dfdc=a35_0x596d4b,{options:_0x3ece85,args:_0x1468a2,tdx:_0x5224c0}=_0x430ad5;if(_0x1468a2[_0x48dfdc(0x14f)]===0x0)return console[_0x48dfdc(0x142)](_0x48dfdc(0x155)),console[_0x48dfdc(0x142)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x3f76fd=_0x1468a2[0x0];try{_0x3ece85[_0x48dfdc(0x159)]&&(console[_0x48dfdc(0x142)]('Site:\x20'+_0x3ece85[_0x48dfdc(0x123)]),console[_0x48dfdc(0x142)](_0x48dfdc(0x13d)+_0x3f76fd));const _0x1b2137=await withSpinner(_0x48dfdc(0x143)+_0x3f76fd+_0x48dfdc(0x16d),()=>_0x5224c0[_0x48dfdc(0xec)][_0x48dfdc(0x144)](_0x3f76fd),{'verbose':_0x3ece85[_0x48dfdc(0x159)]}),_0x38bf7d=_0x1b2137[_0x48dfdc(0x16a)];_0x3ece85[_0x48dfdc(0x159)]&&console['error'](_0x48dfdc(0x12f)+_0x38bf7d);const _0x517738=await withSpinner(_0x48dfdc(0x17d)+_0x3f76fd+_0x48dfdc(0x16d),()=>_0x5224c0[_0x48dfdc(0xec)][_0x48dfdc(0xd6)](_0x38bf7d),{'verbose':_0x3ece85[_0x48dfdc(0x159)]}),_0x140812=_0x517738[_0x48dfdc(0x16a)];return console[_0x48dfdc(0x142)](_0x48dfdc(0x118)+_0x140812[_0x48dfdc(0x14f)]+_0x48dfdc(0x162)+(_0x140812['length']!==0x1?'s':'')),await handleSDKOutput(_0x140812,_0x3ece85),0x0;}catch(_0x537a9c){if(_0x537a9c instanceof SDKError)return console[_0x48dfdc(0x142)](_0x48dfdc(0x166)+_0x537a9c['message']),_0x537a9c[_0x48dfdc(0x158)]&&console['error'](_0x48dfdc(0x11c)+_0x537a9c[_0x48dfdc(0x158)]),0x1;throw _0x537a9c;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x596d4b(0xf8);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x151);async[a35_0x596d4b(0x127)](_0x22ae9f){const _0x5f34b2=a35_0x596d4b,{options:_0x54fcfc,args:_0x1082b9,tdx:_0x53268b}=_0x22ae9f;if(_0x1082b9[_0x5f34b2(0x14f)]===0x0)return console[_0x5f34b2(0x142)](_0x5f34b2(0x173)),console[_0x5f34b2(0x142)](_0x5f34b2(0x15c)),0x1;try{const {parentId:_0x3f4c1d,childId:_0x18eb7f}=parseSegmentRef(_0x1082b9[0x0]);_0x54fcfc[_0x5f34b2(0x159)]&&(console['error'](_0x5f34b2(0x140)+_0x54fcfc['site']),console[_0x5f34b2(0x142)](_0x5f34b2(0x13d)+_0x3f4c1d),_0x18eb7f&&console[_0x5f34b2(0x142)]('Folder\x20name:\x20'+_0x18eb7f));if(!_0x18eb7f)return console[_0x5f34b2(0x142)](_0x5f34b2(0x12d)),0x1;const _0x3269e2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3f4c1d+_0x5f34b2(0x16d),()=>_0x53268b['segment']['resolveParentId'](_0x3f4c1d),{'verbose':_0x54fcfc[_0x5f34b2(0x159)]}),_0x33ae96=_0x3269e2['data'];_0x54fcfc['verbose']&&console[_0x5f34b2(0x142)](_0x5f34b2(0x12f)+_0x33ae96);const _0x4f21a0=await withSpinner(_0x5f34b2(0xf9)+_0x18eb7f+'\x27...',()=>_0x53268b[_0x5f34b2(0xec)][_0x5f34b2(0x17e)](_0x33ae96,_0x18eb7f),{'verbose':_0x54fcfc[_0x5f34b2(0x159)]}),_0x4c245a=_0x4f21a0[_0x5f34b2(0x16a)];_0x54fcfc[_0x5f34b2(0x159)]&&console[_0x5f34b2(0x142)](_0x5f34b2(0x15a)+_0x4c245a);const _0x26001d=await withSpinner(_0x5f34b2(0xe3)+_0x18eb7f+'\x27...',()=>_0x53268b[_0x5f34b2(0xec)]['getFolder'](_0x4c245a),{'verbose':_0x54fcfc[_0x5f34b2(0x159)]});return await handleSDKOutput([_0x26001d['data']],_0x54fcfc),0x0;}catch(_0x2fa596){if(_0x2fa596 instanceof SDKError)return console[_0x5f34b2(0x142)]('Error:\x20'+_0x2fa596[_0x5f34b2(0x138)]),_0x2fa596[_0x5f34b2(0x158)]&&console[_0x5f34b2(0x142)](_0x5f34b2(0x11c)+_0x2fa596[_0x5f34b2(0x158)]),0x1;throw _0x2fa596;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xde);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x124);async[a35_0x596d4b(0x127)](_0x544b81){const _0x14f4ff=a35_0x596d4b,{options:_0x47922a,args:_0x24850c}=_0x544b81,_0x44c847=_0x47922a,_0x3dab91=_0x44c847['path'],_0x399fb1=_0x24850c[0x0];if(!_0x399fb1&&!_0x3dab91)return console['error'](a35_0x1088f7[_0x14f4ff(0x11b)](_0x14f4ff(0x163))),console[_0x14f4ff(0x142)](_0x14f4ff(0x153)),console['error']('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x14f4ff(0x142)](_0x14f4ff(0xfe)),console[_0x14f4ff(0x142)](_0x14f4ff(0xe4)),console[_0x14f4ff(0x142)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x14f4ff(0x142)](_0x14f4ff(0x12b)),0x1;if(_0x399fb1&&_0x3dab91)return console[_0x14f4ff(0x142)](a35_0x1088f7[_0x14f4ff(0x11b)](_0x14f4ff(0x120))),0x1;try{let _0x143244;if(_0x3dab91)_0x143244=await this[_0x14f4ff(0x110)](_0x3dab91,_0x544b81);else{if(isYamlFilePath(_0x399fb1))return console[_0x14f4ff(0x142)](a35_0x1088f7[_0x14f4ff(0x11b)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x14f4ff(0x142)](_0x14f4ff(0x126)+_0x399fb1),0x1;else _0x143244=await this[_0x14f4ff(0xdf)](_0x399fb1,_0x544b81);}return _0x47922a[_0x14f4ff(0x16f)]==='json'||_0x47922a[_0x14f4ff(0x16f)]===_0x14f4ff(0x105)?await handleSDKOutput([{'sql':_0x143244}],_0x47922a):console[_0x14f4ff(0x113)](_0x143244),0x0;}catch(_0x55c7c7){if(_0x55c7c7 instanceof SDKError)return console[_0x14f4ff(0x142)]('Error:\x20'+_0x55c7c7[_0x14f4ff(0x138)]),_0x55c7c7[_0x14f4ff(0x158)]&&console['error']('\x20\x20Cause:\x20'+_0x55c7c7[_0x14f4ff(0x158)]),0x1;throw _0x55c7c7;}}async[a35_0x596d4b(0x110)](_0x537e0e,_0x325e92){const _0x2d82b9=a35_0x596d4b,{options:_0x54831b,tdx:_0x34348d}=_0x325e92;let _0xac3e0f;try{_0xac3e0f=await resolveYamlFilePath(_0x537e0e);}catch(_0x1aa81b){throw new SDKError(ErrorCode[_0x2d82b9(0x129)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1aa81b[_0x2d82b9(0x138)]);}_0x54831b['verbose']&&console[_0x2d82b9(0x142)](_0x2d82b9(0x101)+_0xac3e0f['parentSegment']+'/'+_0xac3e0f[_0x2d82b9(0xe8)]);const _0x3f92f3=await withSpinner(_0x2d82b9(0xfc),()=>_0x34348d[_0x2d82b9(0xec)]['getSegmentSQLFromYaml'](_0xac3e0f[_0x2d82b9(0x116)],_0xac3e0f[_0x2d82b9(0xdd)],_0xac3e0f[_0x2d82b9(0xe8)]),{'verbose':_0x54831b[_0x2d82b9(0x159)]});return _0x3f92f3[_0x2d82b9(0x16a)];}async[a35_0x596d4b(0xdf)](_0x22ff2e,_0x20a8a6){const _0x4e4199=a35_0x596d4b,{options:_0x355f73,tdx:_0x48a845}=_0x20a8a6,_0x254ae8=_0x355f73[_0x4e4199(0xdd)],_0x10b045=await resolveSegmentTarget(_0x22ff2e,_0x254ae8,_0x355f73[_0x4e4199(0x159)]);_0x355f73[_0x4e4199(0x159)]&&console[_0x4e4199(0x142)](_0x4e4199(0x14e)+_0x10b045);const _0x12ec56=await withSpinner(_0x4e4199(0x10b)+_0x22ff2e+_0x4e4199(0x16d),()=>_0x48a845[_0x4e4199(0xec)][_0x4e4199(0xfd)](_0x10b045),{'verbose':_0x355f73[_0x4e4199(0x159)]}),_0x52df33=_0x12ec56['data'];_0x355f73['verbose']&&(console[_0x4e4199(0x142)](_0x4e4199(0x133)+_0x52df33[_0x4e4199(0x132)]),console[_0x4e4199(0x142)](_0x4e4199(0x148)+_0x52df33[_0x4e4199(0xf7)]));if(_0x52df33[_0x4e4199(0x132)]==='folder')throw new SDKError(ErrorCode[_0x4e4199(0x129)],_0x4e4199(0x103));if(_0x52df33['type']===_0x4e4199(0x102))throw new SDKError(ErrorCode[_0x4e4199(0x129)],_0x4e4199(0x13f));if(!_0x52df33['segmentId'])throw new SDKError(ErrorCode[_0x4e4199(0x150)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3fa62a=await withSpinner(_0x4e4199(0x125),()=>_0x48a845[_0x4e4199(0xec)][_0x4e4199(0x156)](_0x52df33[_0x4e4199(0xf7)],_0x52df33[_0x4e4199(0x131)]),{'verbose':_0x355f73[_0x4e4199(0x159)]});return _0x3fa62a[_0x4e4199(0x16a)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x596d4b(0x177)]='segment:folder:create';[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x154);async[a35_0x596d4b(0x127)](_0x6ee48a){const _0x428892=a35_0x596d4b,{options:_0x43f9e8,args:_0x5b6668,tdx:_0x161b60}=_0x6ee48a,_0x4cb4a0=_0x43f9e8;if(_0x5b6668['length']<0x2)return console['error'](_0x428892(0x106)),console[_0x428892(0x142)](_0x428892(0x15b)),0x1;const _0xdd587=_0x5b6668[0x0],_0x27265c=_0x5b6668[0x1];_0x4cb4a0[_0x428892(0x159)]&&(console[_0x428892(0x142)]('Site:\x20'+_0x4cb4a0[_0x428892(0x123)]),console[_0x428892(0x142)]('Parent\x20segment:\x20'+_0xdd587),console[_0x428892(0x142)](_0x428892(0x136)+_0x27265c));let _0x15f4d9;if(_0x4cb4a0[_0x428892(0x11d)]){const _0xb99b1d=_0x4cb4a0[_0x428892(0x11d)],_0x5e7761=await withSpinner(_0x428892(0x143)+_0xdd587+_0x428892(0x16d),()=>_0x161b60[_0x428892(0xec)][_0x428892(0x144)](_0xdd587),{'verbose':_0x4cb4a0[_0x428892(0x159)]}),_0x59eb93=_0x5e7761['data'],_0x24a667=await withSpinner(_0x428892(0x114)+_0xb99b1d+'\x27...',()=>_0x161b60[_0x428892(0xec)]['resolveFolderId'](_0x59eb93,_0xb99b1d),{'verbose':_0x4cb4a0[_0x428892(0x159)]});_0x15f4d9=_0x24a667[_0x428892(0x16a)],_0x4cb4a0[_0x428892(0x159)]&&console['error'](_0x428892(0xf0)+_0x15f4d9);}const _0x22ee17={'name':_0x27265c,'description':_0x4cb4a0['description'],'parentFolderId':_0x15f4d9},_0x327efe=await withSpinner(_0x428892(0xef)+_0x27265c+_0x428892(0x16d),()=>_0x161b60[_0x428892(0xec)][_0x428892(0x168)](_0xdd587,_0x22ee17),{'verbose':_0x4cb4a0[_0x428892(0x159)]}),_0x5c6de5=_0x327efe[_0x428892(0x16a)];return console[_0x428892(0x142)]('✔\x20Created\x20folder\x20\x27'+_0x5c6de5[_0x428892(0x177)]+_0x428892(0x108)+_0x5c6de5['id']),await handleSDKOutput([_0x5c6de5],_0x4cb4a0),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0x10f);[a35_0x596d4b(0x12c)]=a35_0x596d4b(0x12a);async[a35_0x596d4b(0x127)](_0x97e79c){const _0x31bf32=a35_0x596d4b,{options:_0x567ce0,args:_0x152d2a,tdx:_0x27bed1}=_0x97e79c,_0x254a78=_0x152d2a[0x0];if(!_0x254a78)return console[_0x31bf32(0x142)](_0x31bf32(0x10d)),console['error'](_0x31bf32(0x17f)),console['error'](_0x31bf32(0x135)),console['error'](_0x31bf32(0x152)),console[_0x31bf32(0x142)](_0x31bf32(0x14d)),console['error'](_0x31bf32(0xe4)),console['error'](_0x31bf32(0x14a)),console[_0x31bf32(0x142)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x31bf32(0x142)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x31bf32(0x142)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x220825=_0x567ce0[_0x31bf32(0xdd)],_0x27634b=await resolveSegmentTarget(_0x254a78,_0x220825,_0x567ce0[_0x31bf32(0x159)]);_0x567ce0['verbose']&&console[_0x31bf32(0x142)](_0x31bf32(0x14e)+_0x27634b);const _0x4c9d1f=await withSpinner('Resolving\x20\x27'+_0x254a78+_0x31bf32(0x16d),()=>_0x27bed1[_0x31bf32(0xec)][_0x31bf32(0xfd)](_0x27634b),{'verbose':_0x567ce0[_0x31bf32(0x159)]}),_0x43ff99=_0x4c9d1f['data'];_0x567ce0['verbose']&&(console[_0x31bf32(0x142)](_0x31bf32(0x133)+_0x43ff99['type']),console[_0x31bf32(0x142)](_0x31bf32(0x148)+_0x43ff99[_0x31bf32(0xf7)]),_0x43ff99[_0x31bf32(0x13c)]&&console['error'](_0x31bf32(0xee)+_0x43ff99['folderId']),_0x43ff99[_0x31bf32(0x131)]&&console[_0x31bf32(0x142)](_0x31bf32(0xdb)+_0x43ff99[_0x31bf32(0x131)]));if(_0x567ce0[_0x31bf32(0xda)]){if(_0x43ff99[_0x31bf32(0x132)]===_0x31bf32(0x13a))return console[_0x31bf32(0x142)](_0x31bf32(0x111)),0x1;if(_0x43ff99['type']===_0x31bf32(0x102))return console['error'](_0x31bf32(0x178)),console[_0x31bf32(0x142)](_0x31bf32(0x130)),0x1;if(!_0x43ff99[_0x31bf32(0x131)])throw new SDKError(ErrorCode[_0x31bf32(0x150)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4da9d7=getConsoleNextUrl(_0x567ce0['site'],_0x31bf32(0xe7)+_0x43ff99[_0x31bf32(0xf7)]+_0x31bf32(0x146)+_0x43ff99[_0x31bf32(0x131)]);return console[_0x31bf32(0x142)](a35_0x1088f7[_0x31bf32(0xf1)]('✔')+_0x31bf32(0x13e)+a35_0x1088f7[_0x31bf32(0x119)](_0x4da9d7)),openBrowser(_0x4da9d7),0x0;}if(_0x43ff99[_0x31bf32(0x132)]===_0x31bf32(0x13a)){if(!_0x43ff99[_0x31bf32(0x13c)])throw new SDKError(ErrorCode[_0x31bf32(0x16b)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x416751=await withSpinner('Fetching\x20folder\x20details...',()=>_0x27bed1['segment'][_0x31bf32(0xeb)](_0x43ff99['folderId']),{'verbose':_0x567ce0[_0x31bf32(0x159)]});await handleSingleObjectOutput(_0x416751['data'],_0x567ce0);}else{if(_0x43ff99[_0x31bf32(0x132)]===_0x31bf32(0xec)){if(!_0x43ff99['segmentId'])throw new SDKError(ErrorCode[_0x31bf32(0x150)],_0x31bf32(0xe0));const _0x3418c9=await withSpinner(_0x31bf32(0x15f),()=>_0x27bed1[_0x31bf32(0xec)]['getSegment'](_0x43ff99['parentId'],_0x43ff99[_0x31bf32(0x131)]),{'verbose':_0x567ce0[_0x31bf32(0x159)]}),_0x5509e9=getConsoleNextUrl(_0x567ce0[_0x31bf32(0x123)],'/app/ps/'+_0x43ff99[_0x31bf32(0xf7)]+_0x31bf32(0x146)+_0x43ff99[_0x31bf32(0x131)]),_0x9e644f=_0x3418c9[_0x31bf32(0x16a)];_0x9e644f[_0x31bf32(0x149)]=_0x5509e9,await handleSingleObjectOutput(_0x9e644f,_0x567ce0);}else return console[_0x31bf32(0x142)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x31bf32(0x142)](_0x31bf32(0xed)),0x1;}return 0x0;}catch(_0x4004f4){if(_0x4004f4 instanceof SDKError)return console[_0x31bf32(0x142)](_0x31bf32(0x166)+_0x4004f4['message']),_0x4004f4[_0x31bf32(0x158)]&&console[_0x31bf32(0x142)]('\x20\x20Cause:\x20'+_0x4004f4[_0x31bf32(0x158)]),0x1;throw _0x4004f4;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x596d4b(0x177)]=a35_0x596d4b(0xff);['description']=a35_0x596d4b(0x160);async[a35_0x596d4b(0x127)](_0x1ae029){const _0xfd4bc6=a35_0x596d4b,{options:_0x3fb2ab,args:_0x247753,tdx:_0x4f554b}=_0x1ae029,_0x38f61c=_0x247753[0x0];if(!_0x38f61c)return console['error'](_0xfd4bc6(0xf2)),console['error'](_0xfd4bc6(0x17b)),console['error'](_0xfd4bc6(0x137)),console['error'](_0xfd4bc6(0xe4)),console['error'](_0xfd4bc6(0x104)),console[_0xfd4bc6(0x142)](_0xfd4bc6(0x161)),0x1;try{const _0x2a1014=_0x3fb2ab[_0xfd4bc6(0xdd)],_0x3f3bb4=await resolveSegmentTarget(_0x38f61c,_0x2a1014,_0x3fb2ab['verbose']);_0x3fb2ab[_0xfd4bc6(0x159)]&&console['error'](_0xfd4bc6(0x14e)+_0x3f3bb4);const _0x3ef2f6=await withSpinner('Resolving\x20\x27'+_0x38f61c+_0xfd4bc6(0x16d),()=>_0x4f554b[_0xfd4bc6(0xec)][_0xfd4bc6(0xfd)](_0x3f3bb4),{'verbose':_0x3fb2ab[_0xfd4bc6(0x159)]}),_0x513be9=_0x3ef2f6[_0xfd4bc6(0x16a)];_0x3fb2ab[_0xfd4bc6(0x159)]&&(console[_0xfd4bc6(0x142)](_0xfd4bc6(0x133)+_0x513be9[_0xfd4bc6(0x132)]),console[_0xfd4bc6(0x142)](_0xfd4bc6(0x148)+_0x513be9['parentId']));if(_0x513be9[_0xfd4bc6(0x132)]==='folder')return console[_0xfd4bc6(0x142)](_0xfd4bc6(0xe1)),console[_0xfd4bc6(0x142)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x513be9[_0xfd4bc6(0x132)]==='parent')return console[_0xfd4bc6(0x142)](_0xfd4bc6(0xe5)),console[_0xfd4bc6(0x142)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x513be9['segmentId'])throw new SDKError(ErrorCode[_0xfd4bc6(0x150)],_0xfd4bc6(0xe0));const _0x339478=await withSpinner(_0xfd4bc6(0x125),()=>_0x4f554b[_0xfd4bc6(0xec)]['getSegmentSQL'](_0x513be9['parentId'],_0x513be9[_0xfd4bc6(0x131)]),{'verbose':_0x3fb2ab[_0xfd4bc6(0x159)]}),_0x34fccd=_0x339478[_0xfd4bc6(0x16a)],_0x58fe36=await executeSchemaQuery(_0x34fccd,_0x4f554b,_0x3fb2ab);return await handleQueryOutput(_0x58fe36,_0x3fb2ab),0x0;}catch(_0x598ff0){if(_0x598ff0 instanceof SDKError)return console[_0xfd4bc6(0x142)](_0xfd4bc6(0x166)+_0x598ff0['message']),_0x598ff0[_0xfd4bc6(0x158)]&&console[_0xfd4bc6(0x142)](_0xfd4bc6(0x11c)+_0x598ff0[_0xfd4bc6(0x158)]),0x1;throw _0x598ff0;}}}
1
+ const a35_0x1189b6=a35_0x303a;function a35_0x303a(_0x16c3d1,_0x56f5f6){_0x16c3d1=_0x16c3d1-0xc7;const _0x4f5a91=a35_0x4f5a();let _0x303a47=_0x4f5a91[_0x16c3d1];return _0x303a47;}(function(_0x1e95c5,_0x1c9e20){const _0x36e8db=a35_0x303a,_0x13884a=_0x1e95c5();while(!![]){try{const _0x1dd5d8=-parseInt(_0x36e8db(0xf9))/0x1+parseInt(_0x36e8db(0x148))/0x2+-parseInt(_0x36e8db(0x147))/0x3+-parseInt(_0x36e8db(0xcf))/0x4*(-parseInt(_0x36e8db(0xfa))/0x5)+parseInt(_0x36e8db(0xe5))/0x6*(parseInt(_0x36e8db(0x105))/0x7)+parseInt(_0x36e8db(0xd4))/0x8*(parseInt(_0x36e8db(0xeb))/0x9)+parseInt(_0x36e8db(0x103))/0xa*(parseInt(_0x36e8db(0x13e))/0xb);if(_0x1dd5d8===_0x1c9e20)break;else _0x13884a['push'](_0x13884a['shift']());}catch(_0xd60164){_0x13884a['push'](_0x13884a['shift']());}}}(a35_0x4f5a,0x231fa));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 a35_0x4f5a(){const _0x14f660=['Fetching\x20SQL\x20from\x20rule...','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','174852RHwdTr','56365OXxoGb','Show\x20child\x20segment\x20schema\x20(column\x20types)','jsonl','\x20\x20Cause:\x20','parent','replace','log','/app/ps/','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','30dSSOAf','site','7ayhLVR','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segment:view','Resolving\x20parent\x20folder\x20\x27','segment:desc','Executing\x20segment\x20query...','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolving\x20\x27','segment','Show\x20segment\x20or\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Fetching\x20folder\x20details...','toLocaleString','Error:\x20Folder\x20reference\x20is\x20required','segment:folder:list','getSQLFromYamlFile','Resolved\x20folder\x20ID:\x20','Parent\x20name:\x20','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','green','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','/e/','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolved\x20type:\x20','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Resolved\x20parent\x20ID:\x20','\x20\x20Full\x20path:\x20','resolveFolderId','error','Segment\x20ID:\x20','resolveParentId','Examples:','\x27...','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Fetching\x20folder\x20\x27','message','query','SQL\x20query:\x0a','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20relative\x20path\x20to:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','getSegmentSQL','Creating\x20folder\x20\x27','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20Segment\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','Folder\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','elapsedTimeMillis','Resolved:\x20','getSQLFromServerSegment','setJobId','description','Parent\x20segment:\x20','771441FZjYSm','folderPath','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','data','Parent\x20ID:\x20','red','Use:\x20tdx\x20ps\x20show','code','INVALID_ARGUMENT','813585YxomZe','219218IfVOpa','cause','getFolder','segmentId','createFolder','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:folder:create','cyan','test','Error:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','parentFolder','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','trim','web','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','jobId','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','fullPath','path','Target\x20path:\x20','Options:','name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','stats','\x20rows\x20','Site:\x20','in\x20','Get\x20SQL\x20query\x20for\x20child\x20segment','Usage:\x20tdx\x20sg\x20desc\x20<name>','segment:sql','limit','Fetching\x20SQL\x20for\x20segment...','execute','Resolved\x20parent\x20folder\x20ID:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','includes','Resolving\x20folder\x20\x27','resolvePathToResource','8XkoaNT','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','Use:\x20tdx\x20ps\x20desc','\x20\x20Folder\x20path:\x20','folder','923344vAjTSC','\x20\x20tdx\x20sg\x20sql\x20--path\x20','verbose','parentId','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','length','SELECT\x20*\x20FROM\x20(\x0a','folderId','Error:\x20Parent\x20segment\x20name\x20is\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segment:describe','segmentName','content','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','791682QhwDQB','parentSegment','getSegment','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','✔\x20Created\x20folder\x20\x27','9ROMVZL','SEGMENT_NOT_FOUND','getParent','segment:show','✔\x20Query\x20completed:\x20Processed\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','url','type','Use:\x20tdx\x20ps\x20view'];a35_0x4f5a=function(){return _0x14f660;};return a35_0x4f5a();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x2f1bdc from'chalk';async function resolveSegmentTarget(_0x4983cc,_0x5d7e4c,_0x531623){const _0x1d898d=a35_0x303a;if(isYamlFilePath(_0x4983cc))try{const _0xbe11c6=await resolveYamlFilePath(_0x4983cc);return _0x531623&&(console[_0x1d898d(0x124)]('Resolved\x20YAML\x20file:\x20'+_0x4983cc),console[_0x1d898d(0x124)]('\x20\x20Parent\x20segment:\x20'+_0xbe11c6[_0x1d898d(0xe6)]),console['error'](_0x1d898d(0x134)+_0xbe11c6[_0x1d898d(0xe0)]),console[_0x1d898d(0x124)](_0x1d898d(0xd2)+(_0xbe11c6[_0x1d898d(0x13f)]||'(root)')),console[_0x1d898d(0x124)](_0x1d898d(0x122)+_0xbe11c6[_0x1d898d(0x15b)])),_0xbe11c6['fullPath'];}catch(_0x160e4e){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1d898d(0xde)+_0x160e4e['message']);}if(!_0x5d7e4c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1d898d(0x130));return _0x5d7e4c+'/'+_0x4983cc;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0xdf);['description']=a35_0x1189b6(0x10f);async[a35_0x1189b6(0xc9)](_0x24e67a){const _0x37f148=a35_0x1189b6,{options:_0x7c053d,args:_0x56a7a7,tdx:_0x36ed1e}=_0x24e67a,_0x37826b=_0x56a7a7[0x0],_0x7a2d12=!_0x37826b&&!!_0x7c053d[_0x37f148(0xe6)],_0x4ed645=_0x37826b||_0x7c053d[_0x37f148(0xe6)];if(!_0x4ed645)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x37f148(0x124)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x37f148(0x124)]('Examples:'),console[_0x37f148(0x124)](_0x37f148(0xf6)),console[_0x37f148(0x124)](_0x37f148(0x106)),console[_0x37f148(0x124)](_0x37f148(0xf1)),console['error'](_0x37f148(0x155)),0x1;try{const _0x1d032e=_0x7c053d['segmentPath'];let _0x2b35b4=_0x4ed645;!_0x7a2d12&&_0x1d032e&&!_0x4ed645[_0x37f148(0xcc)]('/')&&(_0x2b35b4=_0x1d032e+'/'+_0x4ed645,_0x7c053d['verbose']&&console[_0x37f148(0x124)](_0x37f148(0x12f)+_0x2b35b4));const _0x1bfe2b=await withSpinner('Resolving\x20path\x20\x27'+_0x2b35b4+_0x37f148(0x128),()=>_0x36ed1e[_0x37f148(0x10e)][_0x37f148(0xce)](_0x2b35b4),{'verbose':_0x7c053d[_0x37f148(0xd6)]}),_0x2cae62=_0x1bfe2b[_0x37f148(0x141)];_0x7c053d[_0x37f148(0xd6)]&&(console[_0x37f148(0x124)](_0x37f148(0x11e)+_0x2cae62[_0x37f148(0xf3)]),console[_0x37f148(0x124)](_0x37f148(0x142)+_0x2cae62[_0x37f148(0xd7)]),_0x2cae62['folderId']&&console[_0x37f148(0x124)](_0x37f148(0x136)+_0x2cae62[_0x37f148(0xdc)]),_0x2cae62[_0x37f148(0x14b)]&&console[_0x37f148(0x124)](_0x37f148(0x125)+_0x2cae62[_0x37f148(0x14b)]));if(_0x2cae62['type']==='parent'){const _0x537ae7=await withSpinner(_0x37f148(0x10b),()=>_0x36ed1e['segment'][_0x37f148(0xed)](_0x2cae62['parentId']),{'verbose':_0x7c053d[_0x37f148(0xd6)]});await handleSingleObjectOutput(_0x537ae7[_0x37f148(0x141)],_0x7c053d);}else{if(_0x2cae62[_0x37f148(0xf3)]===_0x37f148(0xd3)){if(!_0x2cae62[_0x37f148(0xdc)])throw new SDKError(ErrorCode[_0x37f148(0xe4)],_0x37f148(0x14e));const _0x16e984=await withSpinner('Fetching\x20folder\x20details...',()=>_0x36ed1e[_0x37f148(0x10e)]['getFolder'](_0x2cae62[_0x37f148(0xdc)]),{'verbose':_0x7c053d[_0x37f148(0xd6)]});await handleSingleObjectOutput(_0x16e984[_0x37f148(0x141)],_0x7c053d);}else{if(_0x2cae62[_0x37f148(0xf3)]==='segment'){if(!_0x2cae62[_0x37f148(0x14b)])throw new SDKError(ErrorCode[_0x37f148(0xec)],_0x37f148(0x137));const _0x3e962b=await withSpinner(_0x37f148(0xe2),()=>_0x36ed1e[_0x37f148(0x10e)][_0x37f148(0xe7)](_0x2cae62[_0x37f148(0xd7)],_0x2cae62['segmentId']),{'verbose':_0x7c053d['verbose']});await handleSingleObjectOutput(_0x3e962b[_0x37f148(0x141)],_0x7c053d);}}}return 0x0;}catch(_0x1f6465){if(_0x1f6465 instanceof SDKError)return console[_0x37f148(0x124)](_0x37f148(0x152)+_0x1f6465[_0x37f148(0x12b)]),_0x1f6465['cause']&&console['error'](_0x37f148(0xfd)+_0x1f6465[_0x37f148(0x149)]),0x1;throw _0x1f6465;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0xee);[a35_0x1189b6(0x13c)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a35_0x1189b6(0xc9)](_0x32db1a){const _0x98ecc3=a35_0x1189b6,{options:_0x1657ec,args:_0x111d2f,tdx:_0x4ac3f1}=_0x32db1a,_0x49750f=_0x111d2f[0x0];if(!_0x49750f)return console[_0x98ecc3(0x124)](_0x98ecc3(0x119)),console['error'](_0x98ecc3(0xd8)),console[_0x98ecc3(0x124)](_0x98ecc3(0x160)),console['error'](_0x98ecc3(0x127)),console['error'](_0x98ecc3(0xe3)),console[_0x98ecc3(0x124)](_0x98ecc3(0x10c)),0x1;try{const _0xa237ff=_0x1657ec[_0x98ecc3(0xe6)],_0x47f0c4=await resolveSegmentTarget(_0x49750f,_0xa237ff,_0x1657ec[_0x98ecc3(0xd6)]);_0x1657ec[_0x98ecc3(0xd6)]&&console[_0x98ecc3(0x124)](_0x98ecc3(0x15d)+_0x47f0c4);const _0x22b5b6=await withSpinner('Resolving\x20\x27'+_0x49750f+_0x98ecc3(0x128),()=>_0x4ac3f1['segment'][_0x98ecc3(0xce)](_0x47f0c4),{'verbose':_0x1657ec[_0x98ecc3(0xd6)]}),_0x3f796b=_0x22b5b6['data'];_0x1657ec[_0x98ecc3(0xd6)]&&(console[_0x98ecc3(0x124)](_0x98ecc3(0x11e)+_0x3f796b[_0x98ecc3(0xf3)]),console['error'](_0x98ecc3(0x142)+_0x3f796b[_0x98ecc3(0xd7)]));if(_0x3f796b[_0x98ecc3(0xf3)]===_0x98ecc3(0xd3))return console[_0x98ecc3(0x124)](_0x98ecc3(0x11d)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x3f796b[_0x98ecc3(0xf3)]===_0x98ecc3(0xfe))return console[_0x98ecc3(0x124)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x98ecc3(0x124)](_0x98ecc3(0x144)),0x1;if(!_0x3f796b[_0x98ecc3(0x14b)])throw new SDKError(ErrorCode[_0x98ecc3(0xec)],_0x98ecc3(0x137));const _0xaa0320=await withSpinner(_0x98ecc3(0xc8),()=>_0x4ac3f1['segment'][_0x98ecc3(0x131)](_0x3f796b['parentId'],_0x3f796b[_0x98ecc3(0x14b)]),{'verbose':_0x1657ec[_0x98ecc3(0xd6)]});let _0x5c64f8=_0xaa0320[_0x98ecc3(0x141)];const _0x5de3f6=resolveLimit(_0x1657ec[_0x98ecc3(0xc7)],DEFAULT_DISPLAY_LIMIT),_0x22b241=/\bLIMIT\s+\d+/i[_0x98ecc3(0x151)](_0x5c64f8);!_0x22b241&&(_0x5c64f8=_0x5c64f8[_0x98ecc3(0x156)]()[_0x98ecc3(0xff)](/;+$/,''),_0x5c64f8=_0x98ecc3(0xdb)+_0x5c64f8+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x5de3f6);_0x1657ec['verbose']&&console[_0x98ecc3(0x124)](_0x98ecc3(0x12d)+_0x5c64f8);const _0x3e4ed4=await withProgressSpinner(_0x98ecc3(0x10a),async _0x4c9d9d=>{const _0x1dc1c8=_0x98ecc3,_0x5bdee3=await _0x4ac3f1[_0x1dc1c8(0x12c)][_0x1dc1c8(0xc9)](_0x5c64f8,{'catalog':'td','schema':'information_schema','onJobId':_0x4a66fa=>{const _0x4cbfd0=_0x1dc1c8;_0x4c9d9d[_0x4cbfd0(0x13b)](_0x4a66fa);}});return _0x5bdee3;},{'verbose':_0x1657ec[_0x98ecc3(0xd6)]}),_0xbdd64d=_0x3e4ed4['data'],_0x3f3332=_0xbdd64d[_0x98ecc3(0x159)]?'\x20[Job\x20ID:\x20'+_0xbdd64d[_0x98ecc3(0x159)]+']':'';return console[_0x98ecc3(0x124)](_0x98ecc3(0xef)+_0xbdd64d['stats']['processedRows'][_0x98ecc3(0x112)]()+_0x98ecc3(0x162)+(_0x98ecc3(0x164)+formatElapsed(_0xbdd64d[_0x98ecc3(0x161)][_0x98ecc3(0x138)])+_0x3f3332)),await handleQueryOutput(_0xbdd64d,_0x1657ec),0x0;}catch(_0x934f3f){if(_0x934f3f instanceof SDKError)return console[_0x98ecc3(0x124)]('✖\x20Query\x20failed\x20['+_0x934f3f[_0x98ecc3(0x145)]+']'),console[_0x98ecc3(0x124)]('\x0a'+_0x934f3f[_0x98ecc3(0x12b)]),0x1;throw _0x934f3f;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x114);[a35_0x1189b6(0x13c)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a35_0x1189b6(0xc9)](_0x1f459c){const _0x16c157=a35_0x1189b6,{options:_0x31e8cd,args:_0x228481,tdx:_0x3855f3}=_0x1f459c;if(_0x228481['length']===0x0)return console[_0x16c157(0x124)](_0x16c157(0xdd)),console[_0x16c157(0x124)](_0x16c157(0x14d)),0x1;const _0x1752d4=_0x228481[0x0];try{_0x31e8cd[_0x16c157(0xd6)]&&(console['error'](_0x16c157(0x163)+_0x31e8cd[_0x16c157(0x104)]),console[_0x16c157(0x124)](_0x16c157(0x117)+_0x1752d4));const _0x51c652=await withSpinner(_0x16c157(0x135)+_0x1752d4+_0x16c157(0x128),()=>_0x3855f3[_0x16c157(0x10e)][_0x16c157(0x126)](_0x1752d4),{'verbose':_0x31e8cd[_0x16c157(0xd6)]}),_0x16024b=_0x51c652[_0x16c157(0x141)];_0x31e8cd['verbose']&&console[_0x16c157(0x124)](_0x16c157(0x121)+_0x16024b);const _0x278d81=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x1752d4+_0x16c157(0x128),()=>_0x3855f3[_0x16c157(0x10e)]['listFolders'](_0x16024b),{'verbose':_0x31e8cd[_0x16c157(0xd6)]}),_0x41af38=_0x278d81[_0x16c157(0x141)];return console['error']('✔\x20Found\x20'+_0x41af38[_0x16c157(0xda)]+'\x20folder'+(_0x41af38[_0x16c157(0xda)]!==0x1?'s':'')),await handleSDKOutput(_0x41af38,_0x31e8cd),0x0;}catch(_0x5af53f){if(_0x5af53f instanceof SDKError)return console[_0x16c157(0x124)](_0x16c157(0x152)+_0x5af53f[_0x16c157(0x12b)]),_0x5af53f[_0x16c157(0x149)]&&console[_0x16c157(0x124)](_0x16c157(0xfd)+_0x5af53f[_0x16c157(0x149)]),0x1;throw _0x5af53f;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a35_0x1189b6(0x13c)]='Show\x20segment\x20folder\x20details';async[a35_0x1189b6(0xc9)](_0x1865cb){const _0x5f3a1d=a35_0x1189b6,{options:_0x318417,args:_0x4eec2b,tdx:_0x4f162d}=_0x1865cb;if(_0x4eec2b['length']===0x0)return console[_0x5f3a1d(0x124)](_0x5f3a1d(0x113)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x44251f,childId:_0x5b69b7}=parseSegmentRef(_0x4eec2b[0x0]);_0x318417[_0x5f3a1d(0xd6)]&&(console['error'](_0x5f3a1d(0x163)+_0x318417[_0x5f3a1d(0x104)]),console[_0x5f3a1d(0x124)](_0x5f3a1d(0x117)+_0x44251f),_0x5b69b7&&console[_0x5f3a1d(0x124)]('Folder\x20name:\x20'+_0x5b69b7));if(!_0x5b69b7)return console[_0x5f3a1d(0x124)](_0x5f3a1d(0xf0)),0x1;const _0x517e92=await withSpinner(_0x5f3a1d(0x135)+_0x44251f+_0x5f3a1d(0x128),()=>_0x4f162d[_0x5f3a1d(0x10e)][_0x5f3a1d(0x126)](_0x44251f),{'verbose':_0x318417[_0x5f3a1d(0xd6)]}),_0x8511e=_0x517e92[_0x5f3a1d(0x141)];_0x318417[_0x5f3a1d(0xd6)]&&console['error'](_0x5f3a1d(0x121)+_0x8511e);const _0x45b62f=await withSpinner(_0x5f3a1d(0xcd)+_0x5b69b7+'\x27...',()=>_0x4f162d[_0x5f3a1d(0x10e)]['resolveFolderId'](_0x8511e,_0x5b69b7),{'verbose':_0x318417[_0x5f3a1d(0xd6)]}),_0x52cc01=_0x45b62f['data'];_0x318417[_0x5f3a1d(0xd6)]&&console[_0x5f3a1d(0x124)](_0x5f3a1d(0x116)+_0x52cc01);const _0xddd838=await withSpinner(_0x5f3a1d(0x12a)+_0x5b69b7+'\x27...',()=>_0x4f162d[_0x5f3a1d(0x10e)][_0x5f3a1d(0x14a)](_0x52cc01),{'verbose':_0x318417[_0x5f3a1d(0xd6)]});return await handleSDKOutput([_0xddd838[_0x5f3a1d(0x141)]],_0x318417),0x0;}catch(_0x5eca75){if(_0x5eca75 instanceof SDKError)return console[_0x5f3a1d(0x124)](_0x5f3a1d(0x152)+_0x5eca75[_0x5f3a1d(0x12b)]),_0x5eca75[_0x5f3a1d(0x149)]&&console[_0x5f3a1d(0x124)](_0x5f3a1d(0xfd)+_0x5eca75[_0x5f3a1d(0x149)]),0x1;throw _0x5eca75;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x167);[a35_0x1189b6(0x13c)]=a35_0x1189b6(0x165);async[a35_0x1189b6(0xc9)](_0x3f532a){const _0x1d97d6=a35_0x1189b6,{options:_0x2e0c05,args:_0x4b4c5c}=_0x3f532a,_0x3c9d72=_0x2e0c05,_0x33322c=_0x3c9d72[_0x1d97d6(0x15c)],_0x371127=_0x4b4c5c[0x0];if(!_0x371127&&!_0x33322c)return console['error'](a35_0x2f1bdc[_0x1d97d6(0x143)](_0x1d97d6(0xf7))),console[_0x1d97d6(0x124)]('Usage:'),console[_0x1d97d6(0x124)](_0x1d97d6(0x118)),console[_0x1d97d6(0x124)](_0x1d97d6(0xd0)),console[_0x1d97d6(0x124)](_0x1d97d6(0x127)),console[_0x1d97d6(0x124)](_0x1d97d6(0x140)),console[_0x1d97d6(0x124)](_0x1d97d6(0x102)),0x1;if(_0x371127&&_0x33322c)return console[_0x1d97d6(0x124)](a35_0x2f1bdc[_0x1d97d6(0x143)](_0x1d97d6(0x11b))),0x1;try{let _0x20260b;if(_0x33322c)_0x20260b=await this[_0x1d97d6(0x115)](_0x33322c,_0x3f532a);else{if(isYamlFilePath(_0x371127))return console[_0x1d97d6(0x124)](a35_0x2f1bdc[_0x1d97d6(0x143)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x1d97d6(0x124)](_0x1d97d6(0xd5)+_0x371127),0x1;else _0x20260b=await this['getSQLFromServerSegment'](_0x371127,_0x3f532a);}return _0x2e0c05['format']==='json'||_0x2e0c05['format']===_0x1d97d6(0xfc)?await handleSDKOutput([{'sql':_0x20260b}],_0x2e0c05):console[_0x1d97d6(0x100)](_0x20260b),0x0;}catch(_0x22801f){if(_0x22801f instanceof SDKError)return console['error'](_0x1d97d6(0x152)+_0x22801f[_0x1d97d6(0x12b)]),_0x22801f['cause']&&console[_0x1d97d6(0x124)]('\x20\x20Cause:\x20'+_0x22801f[_0x1d97d6(0x149)]),0x1;throw _0x22801f;}}async[a35_0x1189b6(0x115)](_0x4c02ca,_0x1a8d57){const _0x8f348f=a35_0x1189b6,{options:_0x12ec42,tdx:_0x52f5cd}=_0x1a8d57;let _0x5d2eca;try{_0x5d2eca=await resolveYamlFilePath(_0x4c02ca);}catch(_0x495d18){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x8f348f(0xde)+_0x495d18[_0x8f348f(0x12b)]);}_0x12ec42[_0x8f348f(0xd6)]&&console[_0x8f348f(0x124)](_0x8f348f(0x139)+_0x5d2eca[_0x8f348f(0xe6)]+'/'+_0x5d2eca[_0x8f348f(0xe0)]);const _0x5eaa7e=await withSpinner(_0x8f348f(0xf5),()=>_0x52f5cd['segment']['getSegmentSQLFromYaml'](_0x5d2eca[_0x8f348f(0xe1)],_0x5d2eca['parentSegment'],_0x5d2eca[_0x8f348f(0xe0)]),{'verbose':_0x12ec42['verbose']});return _0x5eaa7e[_0x8f348f(0x141)];}async[a35_0x1189b6(0x13a)](_0x1e3f8e,_0x226408){const _0x33eb06=a35_0x1189b6,{options:_0x561928,tdx:_0x340d8d}=_0x226408,_0x564b6e=_0x561928[_0x33eb06(0xe6)],_0x18c897=await resolveSegmentTarget(_0x1e3f8e,_0x564b6e,_0x561928[_0x33eb06(0xd6)]);_0x561928[_0x33eb06(0xd6)]&&console[_0x33eb06(0x124)]('Target\x20path:\x20'+_0x18c897);const _0x1fa548=await withSpinner(_0x33eb06(0x10d)+_0x1e3f8e+'\x27...',()=>_0x340d8d['segment']['resolvePathToResource'](_0x18c897),{'verbose':_0x561928[_0x33eb06(0xd6)]}),_0x318571=_0x1fa548[_0x33eb06(0x141)];_0x561928[_0x33eb06(0xd6)]&&(console[_0x33eb06(0x124)](_0x33eb06(0x11e)+_0x318571['type']),console[_0x33eb06(0x124)](_0x33eb06(0x142)+_0x318571[_0x33eb06(0xd7)]));if(_0x318571[_0x33eb06(0xf3)]==='folder')throw new SDKError(ErrorCode[_0x33eb06(0x146)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x318571[_0x33eb06(0xf3)]==='parent')throw new SDKError(ErrorCode[_0x33eb06(0x146)],_0x33eb06(0x158));if(!_0x318571['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x33eb06(0x137));const _0x201628=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x340d8d[_0x33eb06(0x10e)][_0x33eb06(0x131)](_0x318571['parentId'],_0x318571[_0x33eb06(0x14b)]),{'verbose':_0x561928[_0x33eb06(0xd6)]});return _0x201628['data'];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x14f);[a35_0x1189b6(0x13c)]='Create\x20segment\x20folder\x20for\x20organization';async[a35_0x1189b6(0xc9)](_0x48dd3a){const _0x194076=a35_0x1189b6,{options:_0x1b10bd,args:_0x3514d3,tdx:_0x53e2dc}=_0x48dd3a,_0x37d263=_0x1b10bd;if(_0x3514d3['length']<0x2)return console[_0x194076(0x124)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x194076(0x124)](_0x194076(0x120)),0x1;const _0x13bcd5=_0x3514d3[0x0],_0x5357af=_0x3514d3[0x1];_0x37d263[_0x194076(0xd6)]&&(console[_0x194076(0x124)](_0x194076(0x163)+_0x37d263[_0x194076(0x104)]),console[_0x194076(0x124)](_0x194076(0x13d)+_0x13bcd5),console[_0x194076(0x124)](_0x194076(0x11f)+_0x5357af));let _0x334727;if(_0x37d263['parentFolder']){const _0x1a96bb=_0x37d263[_0x194076(0x154)],_0x17e4bb=await withSpinner(_0x194076(0x135)+_0x13bcd5+_0x194076(0x128),()=>_0x53e2dc[_0x194076(0x10e)][_0x194076(0x126)](_0x13bcd5),{'verbose':_0x37d263[_0x194076(0xd6)]}),_0x2a1e86=_0x17e4bb[_0x194076(0x141)],_0x2caaa3=await withSpinner(_0x194076(0x108)+_0x1a96bb+_0x194076(0x128),()=>_0x53e2dc['segment'][_0x194076(0x123)](_0x2a1e86,_0x1a96bb),{'verbose':_0x37d263[_0x194076(0xd6)]});_0x334727=_0x2caaa3[_0x194076(0x141)],_0x37d263[_0x194076(0xd6)]&&console[_0x194076(0x124)](_0x194076(0xca)+_0x334727);}const _0x503111={'name':_0x5357af,'description':_0x37d263[_0x194076(0x13c)],'parentFolderId':_0x334727},_0x20c638=await withSpinner(_0x194076(0x132)+_0x5357af+'\x27...',()=>_0x53e2dc[_0x194076(0x10e)][_0x194076(0x14c)](_0x13bcd5,_0x503111),{'verbose':_0x37d263['verbose']}),_0x2b03b4=_0x20c638[_0x194076(0x141)];return console['error'](_0x194076(0xea)+_0x2b03b4[_0x194076(0x15f)]+'\x27\x20with\x20ID:\x20'+_0x2b03b4['id']),await handleSDKOutput([_0x2b03b4],_0x37d263),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x107);[a35_0x1189b6(0x13c)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0x1189b6(0xc9)](_0x585169){const _0x3242c4=a35_0x1189b6,{options:_0x5ad2b2,args:_0x1c3b6c,tdx:_0x13593f}=_0x585169,_0x42c46b=_0x1c3b6c[0x0];if(!_0x42c46b)return console[_0x3242c4(0x124)](_0x3242c4(0xe8)),console[_0x3242c4(0x124)](_0x3242c4(0xe9)),console[_0x3242c4(0x124)](_0x3242c4(0x110)),console['error'](_0x3242c4(0x15e)),console[_0x3242c4(0x124)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3242c4(0x124)](_0x3242c4(0x127)),console[_0x3242c4(0x124)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x3242c4(0x124)](_0x3242c4(0x15a)),console[_0x3242c4(0x124)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3242c4(0x124)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x3ab9bf=_0x5ad2b2['parentSegment'],_0x3d670e=await resolveSegmentTarget(_0x42c46b,_0x3ab9bf,_0x5ad2b2[_0x3242c4(0xd6)]);_0x5ad2b2[_0x3242c4(0xd6)]&&console[_0x3242c4(0x124)](_0x3242c4(0x15d)+_0x3d670e);const _0x129c92=await withSpinner(_0x3242c4(0x10d)+_0x42c46b+'\x27...',()=>_0x13593f['segment'][_0x3242c4(0xce)](_0x3d670e),{'verbose':_0x5ad2b2['verbose']}),_0x339b5=_0x129c92[_0x3242c4(0x141)];_0x5ad2b2['verbose']&&(console[_0x3242c4(0x124)](_0x3242c4(0x11e)+_0x339b5[_0x3242c4(0xf3)]),console[_0x3242c4(0x124)]('Parent\x20ID:\x20'+_0x339b5[_0x3242c4(0xd7)]),_0x339b5[_0x3242c4(0xdc)]&&console['error'](_0x3242c4(0x136)+_0x339b5[_0x3242c4(0xdc)]),_0x339b5['segmentId']&&console['error'](_0x3242c4(0x125)+_0x339b5['segmentId']));if(_0x5ad2b2[_0x3242c4(0x157)]){if(_0x339b5[_0x3242c4(0xf3)]===_0x3242c4(0xd3))return console[_0x3242c4(0x124)](_0x3242c4(0xf8)),0x1;if(_0x339b5[_0x3242c4(0xf3)]===_0x3242c4(0xfe))return console[_0x3242c4(0x124)](_0x3242c4(0x12e)),console[_0x3242c4(0x124)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x339b5[_0x3242c4(0x14b)])throw new SDKError(ErrorCode[_0x3242c4(0xec)],_0x3242c4(0x137));const _0xba16d=getConsoleNextUrl(_0x5ad2b2[_0x3242c4(0x104)],'/app/ps/'+_0x339b5[_0x3242c4(0xd7)]+_0x3242c4(0x11c)+_0x339b5[_0x3242c4(0x14b)]);return console['error'](a35_0x2f1bdc[_0x3242c4(0x11a)]('✔')+'\x20Opening\x20'+a35_0x2f1bdc[_0x3242c4(0x150)](_0xba16d)),openBrowser(_0xba16d),0x0;}if(_0x339b5[_0x3242c4(0xf3)]==='folder'){if(!_0x339b5[_0x3242c4(0xdc)])throw new SDKError(ErrorCode[_0x3242c4(0xe4)],_0x3242c4(0x14e));const _0x245c01=await withSpinner(_0x3242c4(0x111),()=>_0x13593f[_0x3242c4(0x10e)][_0x3242c4(0x14a)](_0x339b5[_0x3242c4(0xdc)]),{'verbose':_0x5ad2b2[_0x3242c4(0xd6)]});await handleSingleObjectOutput(_0x245c01['data'],_0x5ad2b2);}else{if(_0x339b5[_0x3242c4(0xf3)]===_0x3242c4(0x10e)){if(!_0x339b5[_0x3242c4(0x14b)])throw new SDKError(ErrorCode[_0x3242c4(0xec)],_0x3242c4(0x137));const _0xd695fc=await withSpinner(_0x3242c4(0xe2),()=>_0x13593f[_0x3242c4(0x10e)][_0x3242c4(0xe7)](_0x339b5[_0x3242c4(0xd7)],_0x339b5['segmentId']),{'verbose':_0x5ad2b2[_0x3242c4(0xd6)]}),_0x76ed73=getConsoleNextUrl(_0x5ad2b2[_0x3242c4(0x104)],_0x3242c4(0x101)+_0x339b5[_0x3242c4(0xd7)]+_0x3242c4(0x11c)+_0x339b5[_0x3242c4(0x14b)]),_0x492fba=_0xd695fc['data'];_0x492fba[_0x3242c4(0xf2)]=_0x76ed73,await handleSingleObjectOutput(_0x492fba,_0x5ad2b2);}else return console[_0x3242c4(0x124)](_0x3242c4(0x129)),console[_0x3242c4(0x124)](_0x3242c4(0xf4)),0x1;}return 0x0;}catch(_0x5e3a34){if(_0x5e3a34 instanceof SDKError)return console[_0x3242c4(0x124)](_0x3242c4(0x152)+_0x5e3a34[_0x3242c4(0x12b)]),_0x5e3a34[_0x3242c4(0x149)]&&console[_0x3242c4(0x124)](_0x3242c4(0xfd)+_0x5e3a34[_0x3242c4(0x149)]),0x1;throw _0x5e3a34;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x1189b6(0x15f)]=a35_0x1189b6(0x109);['description']=a35_0x1189b6(0xfb);async['execute'](_0x43fb64){const _0x5d6f4f=a35_0x1189b6,{options:_0x2b7a73,args:_0x2ed826,tdx:_0x43d9c4}=_0x43fb64,_0x4fe4ce=_0x2ed826[0x0];if(!_0x4fe4ce)return console[_0x5d6f4f(0x124)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x5d6f4f(0x124)](_0x5d6f4f(0x166)),console[_0x5d6f4f(0x124)](_0x5d6f4f(0xd9)),console['error'](_0x5d6f4f(0x127)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x5d6f4f(0x124)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x21ce32=_0x2b7a73[_0x5d6f4f(0xe6)],_0x2c70df=await resolveSegmentTarget(_0x4fe4ce,_0x21ce32,_0x2b7a73[_0x5d6f4f(0xd6)]);_0x2b7a73[_0x5d6f4f(0xd6)]&&console['error']('Target\x20path:\x20'+_0x2c70df);const _0x3ce90d=await withSpinner('Resolving\x20\x27'+_0x4fe4ce+_0x5d6f4f(0x128),()=>_0x43d9c4[_0x5d6f4f(0x10e)]['resolvePathToResource'](_0x2c70df),{'verbose':_0x2b7a73[_0x5d6f4f(0xd6)]}),_0x41e849=_0x3ce90d['data'];_0x2b7a73[_0x5d6f4f(0xd6)]&&(console[_0x5d6f4f(0x124)](_0x5d6f4f(0x11e)+_0x41e849[_0x5d6f4f(0xf3)]),console['error']('Parent\x20ID:\x20'+_0x41e849[_0x5d6f4f(0xd7)]));if(_0x41e849[_0x5d6f4f(0xf3)]==='folder')return console['error'](_0x5d6f4f(0x133)),console[_0x5d6f4f(0x124)](_0x5d6f4f(0xcb)),0x1;if(_0x41e849[_0x5d6f4f(0xf3)]==='parent')return console[_0x5d6f4f(0x124)](_0x5d6f4f(0x153)),console[_0x5d6f4f(0x124)](_0x5d6f4f(0xd1)),0x1;if(!_0x41e849[_0x5d6f4f(0x14b)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5d6f4f(0x137));const _0x2df12c=await withSpinner(_0x5d6f4f(0xc8),()=>_0x43d9c4[_0x5d6f4f(0x10e)][_0x5d6f4f(0x131)](_0x41e849[_0x5d6f4f(0xd7)],_0x41e849['segmentId']),{'verbose':_0x2b7a73[_0x5d6f4f(0xd6)]}),_0x3c4d25=_0x2df12c[_0x5d6f4f(0x141)],_0x58fc50=await executeSchemaQuery(_0x3c4d25,_0x43d9c4,_0x2b7a73);return await handleQueryOutput(_0x58fc50,_0x2b7a73),0x0;}catch(_0x11dc8c){if(_0x11dc8c instanceof SDKError)return console[_0x5d6f4f(0x124)](_0x5d6f4f(0x152)+_0x11dc8c[_0x5d6f4f(0x12b)]),_0x11dc8c[_0x5d6f4f(0x149)]&&console[_0x5d6f4f(0x124)](_0x5d6f4f(0xfd)+_0x11dc8c[_0x5d6f4f(0x149)]),0x1;throw _0x11dc8c;}}}
@@ -1 +1 @@
1
- const a36_0x451c35=a36_0x57fa;(function(_0x35fa4d,_0x4590d){const _0x471c94=a36_0x57fa,_0x3932c=_0x35fa4d();while(!![]){try{const _0x5097ab=-parseInt(_0x471c94(0x122))/0x1*(-parseInt(_0x471c94(0x100))/0x2)+parseInt(_0x471c94(0x10e))/0x3*(parseInt(_0x471c94(0xfe))/0x4)+-parseInt(_0x471c94(0x12a))/0x5*(-parseInt(_0x471c94(0x12e))/0x6)+parseInt(_0x471c94(0x130))/0x7+-parseInt(_0x471c94(0x11a))/0x8+parseInt(_0x471c94(0x121))/0x9+-parseInt(_0x471c94(0x12b))/0xa;if(_0x5097ab===_0x4590d)break;else _0x3932c['push'](_0x3932c['shift']());}catch(_0x250eee){_0x3932c['push'](_0x3932c['shift']());}}}(a36_0x1c34,0x3c267));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a36_0x57fa(_0x5797eb,_0x5ded3a){_0x5797eb=_0x5797eb-0xfe;const _0x1c3421=a36_0x1c34();let _0x57fa36=_0x1c3421[_0x5797eb];return _0x57fa36;}import a36_0x3dcd44 from'chalk';function a36_0x1c34(){const _0x15a12d=['description','data','folderId','yellow','Segment\x20name:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','folder','Parent:\x20','parent','includes','error','21AayyEB','name','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segments','segment:create','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolving\x20folder\x20path\x20\x27','Target\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','verbose','Creating\x20segment\x20\x27','length','2402304vPwFIW','Resolved\x20relative\x20path\x20to:\x20','kind','✔\x20Created\x20segment\x20\x27','createSegment','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','noCountPopulation','4352553cAoEgT','58EOooDY','invisible','Resolving\x20parent\x20segment\x20\x27','execute','\x27...','type','segment','segmentPath','169625zFkVdp','8368980UjNwXJ','Site:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','18YtKlal','Resolving\x20folder\x20\x27','2666237VNsYBj','5152PTvRBn','\x27\x20with\x20ID:\x20','14078muXSCs','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'];a36_0x1c34=function(){return _0x15a12d;};return a36_0x1c34();}export class SegmentCreateCommand extends BaseCommand{['name']=a36_0x451c35(0x112);['description']=a36_0x451c35(0x116);async[a36_0x451c35(0x125)](_0x4d49bf){const _0x287bfa=a36_0x451c35;console['error'](a36_0x3dcd44[_0x287bfa(0x105)](_0x287bfa(0x12d))),console[_0x287bfa(0x10d)](a36_0x3dcd44['yellow'](_0x287bfa(0x113)));const {options:_0x102a3d,args:_0x46f1e2,tdx:_0xd83f3e}=_0x4d49bf,_0x411114=_0x102a3d;if(_0x46f1e2[_0x287bfa(0x119)]===0x0)return console[_0x287bfa(0x10d)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x287bfa(0x10d)](_0x287bfa(0x101)),console[_0x287bfa(0x10d)]('Examples:'),console[_0x287bfa(0x10d)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console['error'](_0x287bfa(0x110)),console[_0x287bfa(0x10d)](_0x287bfa(0x107)),0x1;const _0x539eb2=_0x46f1e2[0x0],_0x157d46=_0x102a3d[_0x287bfa(0x129)];let _0x175cd5=_0x539eb2;_0x157d46&&!_0x539eb2[_0x287bfa(0x10c)]('/')&&(_0x175cd5=_0x157d46+'/'+_0x539eb2,_0x411114['verbose']&&console[_0x287bfa(0x10d)](_0x287bfa(0x11b)+_0x175cd5));const _0x3a0c39=parsePath(_0x175cd5);if(_0x3a0c39[_0x287bfa(0x111)][_0x287bfa(0x119)]<0x2)return console[_0x287bfa(0x10d)](_0x287bfa(0x11f)),console[_0x287bfa(0x10d)](_0x287bfa(0x108)),0x1;const _0x31aeef=_0x3a0c39['segments'][0x0],_0x4cf0f3=getBaseName(_0x175cd5),_0x2631c9=getParentPath(_0x175cd5);_0x411114[_0x287bfa(0x117)]&&(console[_0x287bfa(0x10d)](_0x287bfa(0x12c)+_0x411114['site']),console[_0x287bfa(0x10d)](_0x287bfa(0x115)+_0x175cd5),console['error'](_0x287bfa(0x10a)+_0x31aeef),console[_0x287bfa(0x10d)](_0x287bfa(0x106)+_0x4cf0f3),console['error']('Parent\x20path:\x20'+_0x2631c9));const _0x231295=await withSpinner(_0x287bfa(0x124)+_0x31aeef+_0x287bfa(0x126),()=>_0xd83f3e[_0x287bfa(0x128)]['resolveParentId'](_0x31aeef),{'verbose':_0x411114[_0x287bfa(0x117)]}),_0x12ddf3=_0x231295[_0x287bfa(0x103)];let _0x294535;if(_0x3a0c39[_0x287bfa(0x111)]['length']>0x2){const _0x50b7b3=await withSpinner(_0x287bfa(0x114)+_0x2631c9+'\x27...',()=>_0xd83f3e[_0x287bfa(0x128)]['resolvePathToResource'](_0x2631c9),{'verbose':_0x411114['verbose']}),_0x2359ce=_0x50b7b3[_0x287bfa(0x103)];if(_0x2359ce[_0x287bfa(0x127)]!=='folder'&&_0x2359ce['type']!==_0x287bfa(0x10b))return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x294535=_0x2359ce[_0x287bfa(0x104)];}else{if(_0x411114[_0x287bfa(0x109)]){const _0x55341d=await withSpinner(_0x287bfa(0x12f)+_0x411114[_0x287bfa(0x109)]+_0x287bfa(0x126),()=>_0xd83f3e[_0x287bfa(0x128)]['resolveFolderId'](_0x12ddf3,_0x411114['folder']),{'verbose':_0x411114[_0x287bfa(0x117)]});_0x294535=_0x55341d['data'];}}_0x411114[_0x287bfa(0x117)]&&_0x294535&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x294535);const _0x3f9fb3=await loadJSONFromOptions(_0x411114['rule'],_0x411114['ruleFile']),_0x591c05={'name':_0x4cf0f3,'description':_0x411114[_0x287bfa(0x102)],'rule':_0x3f9fb3,'kind':_0x411114[_0x287bfa(0x11c)]!==undefined?parseInt(_0x411114['kind'],0xa):undefined,'isVisible':_0x411114[_0x287bfa(0x123)]?![]:undefined,'segmentFolderId':_0x294535,'countPopulation':_0x411114[_0x287bfa(0x120)]?![]:undefined},_0x54cc1b=await withSpinner(_0x287bfa(0x118)+_0x4cf0f3+_0x287bfa(0x126),()=>_0xd83f3e[_0x287bfa(0x128)][_0x287bfa(0x11e)](_0x12ddf3,_0x591c05),{'verbose':_0x411114[_0x287bfa(0x117)]}),_0x27f187=_0x54cc1b[_0x287bfa(0x103)];return console['error'](_0x287bfa(0x11d)+_0x27f187[_0x287bfa(0x10f)]+_0x287bfa(0xff)+_0x27f187['id']),_0x175cd5!==_0x539eb2&&console[_0x287bfa(0x10d)]('\x20\x20\x20Path:\x20'+_0x175cd5),await handleSDKOutput([_0x27f187],_0x411114),0x0;}}
1
+ const a36_0x4e5001=a36_0x517f;(function(_0x12c5b9,_0x179b1c){const _0x3066e0=a36_0x517f,_0x2aa236=_0x12c5b9();while(!![]){try{const _0x4af9cd=parseInt(_0x3066e0(0x19c))/0x1*(parseInt(_0x3066e0(0x1ac))/0x2)+parseInt(_0x3066e0(0x1a0))/0x3+-parseInt(_0x3066e0(0x1b0))/0x4*(-parseInt(_0x3066e0(0x1ad))/0x5)+-parseInt(_0x3066e0(0x1bc))/0x6*(parseInt(_0x3066e0(0x1b2))/0x7)+parseInt(_0x3066e0(0x1b8))/0x8+-parseInt(_0x3066e0(0x1b9))/0x9+-parseInt(_0x3066e0(0x1a4))/0xa*(parseInt(_0x3066e0(0x191))/0xb);if(_0x4af9cd===_0x179b1c)break;else _0x2aa236['push'](_0x2aa236['shift']());}catch(_0x346251){_0x2aa236['push'](_0x2aa236['shift']());}}}(a36_0x2933,0x51ca2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a36_0x2933(){const _0x198a2c=['error','1447770JvoAuk','createSegment','Resolving\x20folder\x20path\x20\x27','segments','name','\x20\x20\x20Path:\x20','segmentPath','verbose','26hWnwqp','5tLKpMz','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','815484nQPucT','Site:\x20','2961rzlxdw','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','resolveParentId','✔\x20Created\x20segment\x20\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','yellow','1702336xPboey','2206008VsmvTJ','Creating\x20segment\x20\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','1266BNLUND','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','includes','resolvePathToResource','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','segment','site','description','noCountPopulation','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','33DOyjOY','Parent:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolved\x20folder\x20ID:\x20','data','Parent\x20path:\x20','Target\x20path:\x20','kind','Resolving\x20folder\x20\x27','length','Segment\x20name:\x20','20243QIeOER','segment:create','folder','folderId','1271652ztrsax','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','\x27...'];a36_0x2933=function(){return _0x198a2c;};return a36_0x2933();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x32d1a9 from'chalk';function a36_0x517f(_0x104f3c,_0x565cc1){_0x104f3c=_0x104f3c-0x18f;const _0x293342=a36_0x2933();let _0x517f07=_0x293342[_0x104f3c];return _0x517f07;}export class SegmentCreateCommand extends BaseCommand{['name']=a36_0x4e5001(0x19d);['description']=a36_0x4e5001(0x193);async['execute'](_0x38a445){const _0x3346a5=a36_0x4e5001;console['error'](a36_0x32d1a9['yellow'](_0x3346a5(0x1bb))),console[_0x3346a5(0x1a3)](a36_0x32d1a9[_0x3346a5(0x1b7)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x5b0f25,args:_0x44f261,tdx:_0xf47744}=_0x38a445,_0x59de17=_0x5b0f25;if(_0x44f261['length']===0x0)return console[_0x3346a5(0x1a3)](_0x3346a5(0x1b3)),console['error']('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x3346a5(0x1a3)]('Examples:'),console[_0x3346a5(0x1a3)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x3346a5(0x1a3)](_0x3346a5(0x1af)),console[_0x3346a5(0x1a3)](_0x3346a5(0x1bd)),0x1;const _0x158895=_0x44f261[0x0],_0x5f075b=_0x5b0f25[_0x3346a5(0x1aa)];let _0xe6c205=_0x158895;_0x5f075b&&!_0x158895[_0x3346a5(0x1be)]('/')&&(_0xe6c205=_0x5f075b+'/'+_0x158895,_0x59de17['verbose']&&console[_0x3346a5(0x1a3)](_0x3346a5(0x1ae)+_0xe6c205));const _0x24f224=parsePath(_0xe6c205);if(_0x24f224[_0x3346a5(0x1a7)]['length']<0x2)return console[_0x3346a5(0x1a3)](_0x3346a5(0x1a1)),console[_0x3346a5(0x1a3)](_0x3346a5(0x1c0)),0x1;const _0x28e819=_0x24f224[_0x3346a5(0x1a7)][0x0],_0x36c7a0=getBaseName(_0xe6c205),_0x4ca1c4=getParentPath(_0xe6c205);_0x59de17[_0x3346a5(0x1ab)]&&(console[_0x3346a5(0x1a3)](_0x3346a5(0x1b1)+_0x59de17[_0x3346a5(0x1c2)]),console[_0x3346a5(0x1a3)](_0x3346a5(0x197)+_0xe6c205),console[_0x3346a5(0x1a3)](_0x3346a5(0x192)+_0x28e819),console[_0x3346a5(0x1a3)](_0x3346a5(0x19b)+_0x36c7a0),console[_0x3346a5(0x1a3)](_0x3346a5(0x196)+_0x4ca1c4));const _0x2548a5=await withSpinner(_0x3346a5(0x18f)+_0x28e819+_0x3346a5(0x1a2),()=>_0xf47744[_0x3346a5(0x1c1)][_0x3346a5(0x1b4)](_0x28e819),{'verbose':_0x59de17[_0x3346a5(0x1ab)]}),_0x270879=_0x2548a5[_0x3346a5(0x195)];let _0x343f79;if(_0x24f224[_0x3346a5(0x1a7)][_0x3346a5(0x19a)]>0x2){const _0x900792=await withSpinner(_0x3346a5(0x1a6)+_0x4ca1c4+_0x3346a5(0x1a2),()=>_0xf47744[_0x3346a5(0x1c1)][_0x3346a5(0x1bf)](_0x4ca1c4),{'verbose':_0x59de17[_0x3346a5(0x1ab)]}),_0x52f4e2=_0x900792['data'];if(_0x52f4e2['type']!=='folder'&&_0x52f4e2['type']!=='parent')return console['error'](_0x3346a5(0x1b6)),0x1;_0x343f79=_0x52f4e2[_0x3346a5(0x19f)];}else{if(_0x59de17[_0x3346a5(0x19e)]){const _0x46a5ff=await withSpinner(_0x3346a5(0x199)+_0x59de17[_0x3346a5(0x19e)]+_0x3346a5(0x1a2),()=>_0xf47744[_0x3346a5(0x1c1)][_0x3346a5(0x190)](_0x270879,_0x59de17['folder']),{'verbose':_0x59de17[_0x3346a5(0x1ab)]});_0x343f79=_0x46a5ff['data'];}}_0x59de17[_0x3346a5(0x1ab)]&&_0x343f79&&console['error'](_0x3346a5(0x194)+_0x343f79);const _0x20d938=await loadJSONFromOptions(_0x59de17['rule'],_0x59de17['ruleFile']),_0x18430b={'name':_0x36c7a0,'description':_0x59de17[_0x3346a5(0x1c3)],'rule':_0x20d938,'kind':_0x59de17[_0x3346a5(0x198)]!==undefined?parseInt(_0x59de17[_0x3346a5(0x198)],0xa):undefined,'isVisible':_0x59de17['invisible']?![]:undefined,'segmentFolderId':_0x343f79,'countPopulation':_0x59de17[_0x3346a5(0x1c4)]?![]:undefined},_0x4d9d6d=await withSpinner(_0x3346a5(0x1ba)+_0x36c7a0+_0x3346a5(0x1a2),()=>_0xf47744[_0x3346a5(0x1c1)][_0x3346a5(0x1a5)](_0x270879,_0x18430b),{'verbose':_0x59de17[_0x3346a5(0x1ab)]}),_0x183bb3=_0x4d9d6d['data'];return console[_0x3346a5(0x1a3)](_0x3346a5(0x1b5)+_0x183bb3[_0x3346a5(0x1a8)]+'\x27\x20with\x20ID:\x20'+_0x183bb3['id']),_0xe6c205!==_0x158895&&console[_0x3346a5(0x1a3)](_0x3346a5(0x1a9)+_0xe6c205),await handleSDKOutput([_0x183bb3],_0x59de17),0x0;}}
@@ -1 +1 @@
1
- const a37_0x288e03=a37_0x3cb0;(function(_0x1201fa,_0x5b5dab){const _0x3c2d8f=a37_0x3cb0,_0x2214e8=_0x1201fa();while(!![]){try{const _0x2c2a6d=parseInt(_0x3c2d8f(0xd6))/0x1*(parseInt(_0x3c2d8f(0xce))/0x2)+parseInt(_0x3c2d8f(0xc5))/0x3+parseInt(_0x3c2d8f(0xbf))/0x4+-parseInt(_0x3c2d8f(0xc9))/0x5*(parseInt(_0x3c2d8f(0xbc))/0x6)+parseInt(_0x3c2d8f(0xd4))/0x7+-parseInt(_0x3c2d8f(0xcb))/0x8+-parseInt(_0x3c2d8f(0xcf))/0x9*(parseInt(_0x3c2d8f(0xd1))/0xa);if(_0x2c2a6d===_0x5b5dab)break;else _0x2214e8['push'](_0x2214e8['shift']());}catch(_0x559a99){_0x2214e8['push'](_0x2214e8['shift']());}}}(a37_0x2b22,0x8291d));function a37_0x3cb0(_0x27bfae,_0x524ccb){_0x27bfae=_0x27bfae-0xbc;const _0x2b2282=a37_0x2b22();let _0x3cb096=_0x2b2282[_0x27bfae];return _0x3cb096;}import{BaseCommand}from'./command.js';function a37_0x2b22(){const _0x436a28=['data','244064BeJROt','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','length','1719524PfdRHV','18kLzTCI','parentSegment','7990960tKtnjs','List\x20available\x20fields\x20for\x20segmentation','site','6310836czxvvd','✔\x20Found\x20','1lLCneJ','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','1032JbaxfW','listFields','segment:fields','1483948KoDult','Site:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27...','\x20field','jsonl','2512656AUyLJg','execute','Parent\x20segment:\x20','error','23440QafxCI'];a37_0x2b22=function(){return _0x436a28;};return a37_0x2b22();}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']=a37_0x288e03(0xbe);['description']=a37_0x288e03(0xd2);async[a37_0x288e03(0xc6)](_0x5c767f){const _0x1c24aa=a37_0x288e03,{options:_0x2f7451,args:_0x7f1c64,tdx:_0xffb24a}=_0x5c767f,_0x122d9c=_0x7f1c64[0x0]||_0x2f7451[_0x1c24aa(0xd0)];if(!_0x122d9c)return console[_0x1c24aa(0xc8)](_0x1c24aa(0xc1)),console[_0x1c24aa(0xc8)](_0x1c24aa(0xcc)),console[_0x1c24aa(0xc8)](_0x1c24aa(0xd7)),0x1;_0x2f7451['verbose']&&(console['error'](_0x1c24aa(0xc0)+_0x2f7451[_0x1c24aa(0xd3)]),console[_0x1c24aa(0xc8)](_0x1c24aa(0xc7)+_0x122d9c));const _0x56bb1c=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x122d9c+_0x1c24aa(0xc2),()=>_0xffb24a['segment'][_0x1c24aa(0xbd)](_0x122d9c),{'verbose':_0x2f7451['verbose']}),_0x1c388e=_0x56bb1c[_0x1c24aa(0xca)];console['error'](_0x1c24aa(0xd5)+_0x1c388e[_0x1c24aa(0xcd)]+_0x1c24aa(0xc3)+(_0x1c388e['length']!==0x1?'s':''));if(_0x2f7451['json']||_0x2f7451[_0x1c24aa(0xc4)])return await handleSDKOutput(_0x1c388e,_0x2f7451),0x0;return displayFieldsHumanReadable(_0x1c388e,_0x122d9c),0x0;}}
1
+ function a37_0x2246(){const _0x58a917=['listFields','7548792KhkoMe','execute','site','58236slGMvm','4338531PmAiKf','9iYgvZk','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','description','Parent\x20segment:\x20','List\x20available\x20fields\x20for\x20segmentation','Error:\x20Parent\x20segment\x20name\x20is\x20required','1080AfCRpK','20QmXwPT','193501KUoGSB','jsonl','272212qAuqdW','name','verbose','✔\x20Found\x20','error','\x27...','length','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','parentSegment','4858KMhtqH','27993680bkiRXo','\x20field','205eykwXC','segment','segment:fields','Site:\x20','Listing\x20fields\x20for\x20\x27'];a37_0x2246=function(){return _0x58a917;};return a37_0x2246();}const a37_0x4fdc4c=a37_0x564f;(function(_0x3d6834,_0x1574c6){const _0xcbddb8=a37_0x564f,_0x5d5536=_0x3d6834();while(!![]){try{const _0x46887a=-parseInt(_0xcbddb8(0x19a))/0x1+parseInt(_0xcbddb8(0x19c))/0x2*(-parseInt(_0xcbddb8(0x192))/0x3)+parseInt(_0xcbddb8(0x1b1))/0x4*(parseInt(_0xcbddb8(0x1a8))/0x5)+-parseInt(_0xcbddb8(0x198))/0x6*(-parseInt(_0xcbddb8(0x1a5))/0x7)+-parseInt(_0xcbddb8(0x1ae))/0x8+-parseInt(_0xcbddb8(0x191))/0x9*(parseInt(_0xcbddb8(0x199))/0xa)+parseInt(_0xcbddb8(0x1a6))/0xb;if(_0x46887a===_0x1574c6)break;else _0x5d5536['push'](_0x5d5536['shift']());}catch(_0x4028b2){_0x5d5536['push'](_0x5d5536['shift']());}}}(a37_0x2246,0xb8dbf));import{BaseCommand}from'./command.js';function a37_0x564f(_0x320dec,_0x39f3b9){_0x320dec=_0x320dec-0x191;const _0x2246a0=a37_0x2246();let _0x564f88=_0x2246a0[_0x320dec];return _0x564f88;}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{[a37_0x4fdc4c(0x19d)]=a37_0x4fdc4c(0x1aa);[a37_0x4fdc4c(0x194)]=a37_0x4fdc4c(0x196);async[a37_0x4fdc4c(0x1af)](_0x385a99){const _0xc7e9f2=a37_0x4fdc4c,{options:_0x491633,args:_0x1a2e24,tdx:_0x619a26}=_0x385a99,_0x545a9f=_0x1a2e24[0x0]||_0x491633[_0xc7e9f2(0x1a4)];if(!_0x545a9f)return console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x197)),console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x1a3)),console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x193)),0x1;_0x491633[_0xc7e9f2(0x19e)]&&(console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x1ab)+_0x491633[_0xc7e9f2(0x1b0)]),console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x195)+_0x545a9f));const _0x2b6caa=await withSpinner(_0xc7e9f2(0x1ac)+_0x545a9f+_0xc7e9f2(0x1a1),()=>_0x619a26[_0xc7e9f2(0x1a9)][_0xc7e9f2(0x1ad)](_0x545a9f),{'verbose':_0x491633[_0xc7e9f2(0x19e)]}),_0x4e6964=_0x2b6caa['data'];console[_0xc7e9f2(0x1a0)](_0xc7e9f2(0x19f)+_0x4e6964[_0xc7e9f2(0x1a2)]+_0xc7e9f2(0x1a7)+(_0x4e6964[_0xc7e9f2(0x1a2)]!==0x1?'s':''));if(_0x491633['json']||_0x491633[_0xc7e9f2(0x19b)])return await handleSDKOutput(_0x4e6964,_0x491633),0x0;return displayFieldsHumanReadable(_0x4e6964,_0x545a9f),0x0;}}
@@ -1 +1 @@
1
- const a38_0x4ad4ab=a38_0x341a;(function(_0x2a9696,_0x213842){const _0x515c90=a38_0x341a,_0x212150=_0x2a9696();while(!![]){try{const _0x1a46a6=-parseInt(_0x515c90(0x165))/0x1+-parseInt(_0x515c90(0x161))/0x2+parseInt(_0x515c90(0x18d))/0x3+parseInt(_0x515c90(0x163))/0x4*(-parseInt(_0x515c90(0x17a))/0x5)+parseInt(_0x515c90(0x179))/0x6*(parseInt(_0x515c90(0x16e))/0x7)+parseInt(_0x515c90(0x15a))/0x8+-parseInt(_0x515c90(0x157))/0x9*(-parseInt(_0x515c90(0x17f))/0xa);if(_0x1a46a6===_0x213842)break;else _0x212150['push'](_0x212150['shift']());}catch(_0x22a53a){_0x212150['push'](_0x212150['shift']());}}}(a38_0xc888,0x4ceb0));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 a38_0x18f086 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x2e14c6 from'path';function a38_0x341a(_0x46c824,_0x40719b){_0x46c824=_0x46c824-0x145;const _0xc888d9=a38_0xc888();let _0x341a08=_0xc888d9[_0x46c824];return _0x341a08;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a38_0x4ad4ab(0x18a)]=a38_0x4ad4ab(0x146);[a38_0x4ad4ab(0x173)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a38_0x4ad4ab(0x174)](_0x4b2b0f){const _0x2f3ef9=a38_0x4ad4ab,{options:_0x4cf5f4,args:_0x14d080,tdx:_0x5877d1}=_0x4b2b0f,_0x18b649=_0x4cf5f4,_0x234ec2=await resolveTarget({'arg':_0x14d080[0x0],'contextParent':_0x4cf5f4[_0x2f3ef9(0x17d)],'cwd':process[_0x2f3ef9(0x156)]()});if(!isSuccessfulResolution(_0x234ec2))return _0x234ec2[_0x2f3ef9(0x16c)]===_0x2f3ef9(0x16b)?(console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18c)](_0x2f3ef9(0x14e))),console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x169)),console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x150)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x154)]('Error:\x20'+_0x234ec2['message']+'\x0a')),_0x234ec2['helpText']&&console['error'](a38_0x18f086[_0x2f3ef9(0x175)](_0x234ec2[_0x2f3ef9(0x182)]))),0x1;const _0x32cb31=_0x234ec2[_0x2f3ef9(0x18e)],_0x3d5e70=_0x234ec2[_0x2f3ef9(0x168)],_0x7c6f57=_0x234ec2['type']==='file'?_0x234ec2['resourceName']:undefined;_0x18b649[_0x2f3ef9(0x148)]&&(console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x178)+_0x18b649['site']),console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x159)+_0x32cb31),_0x7c6f57&&console[_0x2f3ef9(0x15d)]('Target\x20resource:\x20'+_0x7c6f57));const _0x3753ff=await withProgressSpinner(_0x2f3ef9(0x17b)+_0x32cb31+_0x2f3ef9(0x158),_0x504a52=>_0x5877d1[_0x2f3ef9(0x15c)][_0x2f3ef9(0x191)](_0x32cb31,{'targetDir':_0x3d5e70,'targetResourceName':_0x7c6f57,'verbose':_0x18b649[_0x2f3ef9(0x148)],'progress':{'update':_0x4d5595=>{const _0x4d3985=_0x2f3ef9;_0x504a52[_0x4d3985(0x189)](_0x4d5595),_0x18b649[_0x4d3985(0x148)]&&console[_0x4d3985(0x15d)]('\x20\x20'+_0x4d5595);}}}),{'verbose':_0x18b649[_0x2f3ef9(0x148)]}),_0x5f25ed=_0x3753ff[_0x2f3ef9(0x16f)];if(_0x5f25ed['counts'][_0x2f3ef9(0x180)]===0x0&&_0x5f25ed['counts'][_0x2f3ef9(0x155)]===0x0)return console['error'](a38_0x18f086['yellow'](_0x2f3ef9(0x162)+_0x5f25ed['parentName']+'\x27')),0x0;const _0x5252f2=_0x5f25ed[_0x2f3ef9(0x145)]['filter'](_0x1fe113=>_0x1fe113[_0x2f3ef9(0x15f)]),_0x4f916f=_0x5f25ed[_0x2f3ef9(0x145)][_0x2f3ef9(0x15e)](_0x4023a7=>!_0x4023a7[_0x2f3ef9(0x15f)]&&_0x4023a7['hasChanges']),_0x48cde1=_0x5f25ed[_0x2f3ef9(0x145)][_0x2f3ef9(0x15e)](_0x585d09=>!_0x585d09[_0x2f3ef9(0x15f)]&&!_0x585d09[_0x2f3ef9(0x17e)]);console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x14b)+_0x5f25ed[_0x2f3ef9(0x18e)]+'\x27:'),console[_0x2f3ef9(0x15d)]('\x20\x20🎯\x20'+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x180)]+'\x20segments')+'\x20with\x20'+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x14d)]+_0x2f3ef9(0x171)));if(_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x155)]>0x0){const _0x45546d=_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x190)]>_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x155)]?'\x20('+_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x190)]+'\x20versions)':'';console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x166)+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x160)][_0x2f3ef9(0x155)]+'\x20journeys')+a38_0x18f086[_0x2f3ef9(0x187)](_0x45546d));}console[_0x2f3ef9(0x15d)]('\x20\x20'+a38_0x18f086[_0x2f3ef9(0x18f)]('+\x20'+_0x5252f2[_0x2f3ef9(0x183)]+'\x20new\x20files')),console[_0x2f3ef9(0x15d)]('\x20\x20'+a38_0x18f086[_0x2f3ef9(0x18c)]('~\x20'+_0x4f916f['length']+_0x2f3ef9(0x192))),console[_0x2f3ef9(0x15d)]('\x20\x20'+a38_0x18f086[_0x2f3ef9(0x187)]('=\x20'+_0x48cde1['length']+_0x2f3ef9(0x16d))),console['error'](_0x2f3ef9(0x170)+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed['targetDir'])+'\x0a');if(_0x4f916f['length']>0x0)for(const _0x48b479 of _0x4f916f){console[_0x2f3ef9(0x15d)](_0x2f3ef9(0x14c)+_0x48b479[_0x2f3ef9(0x176)]+'\x27:'),console[_0x2f3ef9(0x15d)]('─'['repeat'](0x3c)),console[_0x2f3ef9(0x15d)](_0x48b479['diff']),console[_0x2f3ef9(0x15d)]('─'[_0x2f3ef9(0x149)](0x3c));}if(_0x18b649[_0x2f3ef9(0x153)])return console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18c)](_0x2f3ef9(0x172))),0x0;if(_0x5252f2[_0x2f3ef9(0x183)]===0x0&&_0x4f916f[_0x2f3ef9(0x183)]===0x0)return console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18f)](_0x2f3ef9(0x185))),saveSessionContext({'parent_segment':_0x5f25ed['parentName']},_0x18b649[_0x2f3ef9(0x167)]),console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18f)](_0x2f3ef9(0x184)+a38_0x18f086[_0x2f3ef9(0x187)](_0x2f3ef9(0x147))+_0x2f3ef9(0x16a)+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x18e)]))),0x0;if(!_0x18b649[_0x2f3ef9(0x177)]){if(!isInteractive())return console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x154)](_0x2f3ef9(0x181)),_0x2f3ef9(0x14f)),console['error'](a38_0x18f086[_0x2f3ef9(0x187)](_0x2f3ef9(0x18b))),0x1;const _0x5609f9=await confirmKey(_0x2f3ef9(0x188)+(_0x5252f2[_0x2f3ef9(0x183)]+_0x4f916f[_0x2f3ef9(0x183)])+'\x20files?');if(!_0x5609f9)return console['error'](a38_0x18f086[_0x2f3ef9(0x18c)](_0x2f3ef9(0x186)),_0x2f3ef9(0x151)),0x1;}for(const _0x4d4316 of _0x5f25ed[_0x2f3ef9(0x145)]){if(_0x4d4316[_0x2f3ef9(0x15f)]||_0x4d4316[_0x2f3ef9(0x17e)]){const _0x4aa39e=a38_0x2e14c6[_0x2f3ef9(0x15b)](_0x4d4316[_0x2f3ef9(0x17c)]);!existsSync(_0x4aa39e)&&mkdirSync(_0x4aa39e,{'recursive':!![]}),writeFileSync(_0x4d4316['absolutePath'],_0x4d4316[_0x2f3ef9(0x152)],_0x2f3ef9(0x164));}}return console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18f)]('✔\x20Pulled\x20'+(_0x5252f2[_0x2f3ef9(0x183)]+_0x4f916f[_0x2f3ef9(0x183)])+_0x2f3ef9(0x14a)+_0x5f25ed[_0x2f3ef9(0x168)])),saveSessionContext({'parent_segment':_0x5f25ed[_0x2f3ef9(0x18e)]},_0x18b649[_0x2f3ef9(0x167)]),console[_0x2f3ef9(0x15d)](a38_0x18f086[_0x2f3ef9(0x18f)](_0x2f3ef9(0x184)+a38_0x18f086[_0x2f3ef9(0x187)](_0x2f3ef9(0x147))+'\x20=\x20'+a38_0x18f086[_0x2f3ef9(0x175)](_0x5f25ed[_0x2f3ef9(0x18e)]))),0x0;}}function a38_0xc888(){const _0x187cec=['yes','Site:\x20','54urDWhM','23060SPBqmy','Pulling\x20segments\x20from\x20\x27','absolutePath','parentSegment','hasChanges','10TygPtL','segments','\x0aError:','helpText','length','✔\x20Context\x20set:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','Aborted.','dim','Write\x20','setPhase','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','yellow','116643wXCJEt','parentName','green','journeyVersions','pullSegments','\x20changed\x20files','files','segment:pull','parent_segment','verbose','repeat','\x20files\x20to\x20','\x0aPull\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20\x27','activations','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','-\x20no\x20files\x20written','content','dryRun','red','journeys','cwd','6517539lgXySC','\x27...','Parent\x20segment:\x20','3870688kIRVfL','dirname','segment','error','filter','isNew','counts','336848iIzUhF','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','388cfpkrm','utf-8','330138FijDCq','\x20\x20🗺️\x20\x20','session','targetDir','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)','\x20=\x20','no_parent','errorCode','\x20unchanged\x20files','10962fqPbPK','data','\x20\x20Target:\x20','\x20activations','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','description','execute','cyan','relativePath'];a38_0xc888=function(){return _0x187cec;};return a38_0xc888();}
1
+ const a38_0x47ef95=a38_0x586d;(function(_0x2cd7e1,_0x769aed){const _0x43aa07=a38_0x586d,_0xf9fd58=_0x2cd7e1();while(!![]){try{const _0x57c744=-parseInt(_0x43aa07(0x129))/0x1*(parseInt(_0x43aa07(0x13d))/0x2)+-parseInt(_0x43aa07(0x108))/0x3*(parseInt(_0x43aa07(0x13a))/0x4)+-parseInt(_0x43aa07(0x103))/0x5+-parseInt(_0x43aa07(0x116))/0x6+-parseInt(_0x43aa07(0x14d))/0x7+parseInt(_0x43aa07(0x139))/0x8*(parseInt(_0x43aa07(0x107))/0x9)+parseInt(_0x43aa07(0x126))/0xa;if(_0x57c744===_0x769aed)break;else _0xf9fd58['push'](_0xf9fd58['shift']());}catch(_0x591166){_0xf9fd58['push'](_0xf9fd58['shift']());}}}(a38_0x2ad6,0x8bdbb));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 a38_0x2ad6(){const _0x40e8d4=['\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20versions)','setPhase','type','✔\x20Context\x20set:\x20','\x20journeys','yes','Parent\x20segment:\x20','parentName','yellow','length','message','utf-8','data','26451520njrTPr','\x20\x20Target:\x20','file','1pdBSpA','Site:\x20','\x20=\x20','cwd','Error:\x20','targetDir','error','\x20segments','description','cyan','pullSegments','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)','absolutePath','\x0aPull\x20summary\x20for\x20\x27','filter','isNew','24gAWHOj','2093260pGAheb','activations','segments','1359986ahWcqj','helpText','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20new\x20files','\x27...','files','\x20activations','journeys','dryRun','-\x20no\x20files\x20written','verbose','no_parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Write\x20','repeat','name','5375111MMJdxy','counts','\x20unchanged\x20files','parent_segment','resourceName','parentSegment','3779485csPuLv','\x20\x20🎯\x20','✔\x20Pulled\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','2183886dqvTXa','3bHphMI','\x20with\x20','\x0aError:','diff','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','segment:pull','dim','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','errorCode','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20🗺️\x20\x20','\x0aChanges\x20to\x20\x27','439062iTgWog'];a38_0x2ad6=function(){return _0x40e8d4;};return a38_0x2ad6();}import a38_0x516896 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a38_0x586d(_0xf9c8fc,_0x1868eb){_0xf9c8fc=_0xf9c8fc-0x100;const _0x2ad642=a38_0x2ad6();let _0x586d06=_0x2ad642[_0xf9c8fc];return _0x586d06;}import a38_0x4c5a86 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{[a38_0x47ef95(0x14c)]=a38_0x47ef95(0x10e);[a38_0x47ef95(0x131)]=a38_0x47ef95(0x118);async['execute'](_0x2c6d8a){const _0x3a52f0=a38_0x47ef95,{options:_0x5172f4,args:_0x2e68af,tdx:_0x545523}=_0x2c6d8a,_0x45297b=_0x5172f4,_0x516ad4=await resolveTarget({'arg':_0x2e68af[0x0],'contextParent':_0x5172f4[_0x3a52f0(0x102)],'cwd':process[_0x3a52f0(0x12c)]()});if(!isSuccessfulResolution(_0x516ad4))return _0x516ad4[_0x3a52f0(0x112)]===_0x3a52f0(0x148)?(console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x121)](_0x3a52f0(0x106))),console[_0x3a52f0(0x12f)](_0x3a52f0(0x134)),console[_0x3a52f0(0x12f)](_0x3a52f0(0x149)),console[_0x3a52f0(0x12f)](_0x3a52f0(0x111))):(console['error'](a38_0x516896['red'](_0x3a52f0(0x12d)+_0x516ad4[_0x3a52f0(0x123)]+'\x0a')),_0x516ad4[_0x3a52f0(0x13e)]&&console[_0x3a52f0(0x12f)](a38_0x516896['cyan'](_0x516ad4[_0x3a52f0(0x13e)]))),0x1;const _0x342852=_0x516ad4['parentName'],_0x2340e4=_0x516ad4[_0x3a52f0(0x12e)],_0x49ee39=_0x516ad4[_0x3a52f0(0x11b)]===_0x3a52f0(0x128)?_0x516ad4[_0x3a52f0(0x101)]:undefined;_0x45297b[_0x3a52f0(0x147)]&&(console['error'](_0x3a52f0(0x12a)+_0x45297b['site']),console[_0x3a52f0(0x12f)](_0x3a52f0(0x11f)+_0x342852),_0x49ee39&&console[_0x3a52f0(0x12f)]('Target\x20resource:\x20'+_0x49ee39));const _0x273058=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x342852+_0x3a52f0(0x141),_0x3f928c=>_0x545523['segment'][_0x3a52f0(0x133)](_0x342852,{'targetDir':_0x2340e4,'targetResourceName':_0x49ee39,'verbose':_0x45297b[_0x3a52f0(0x147)],'progress':{'update':_0x4584fa=>{const _0x336613=_0x3a52f0;_0x3f928c[_0x336613(0x11a)](_0x4584fa),_0x45297b[_0x336613(0x147)]&&console[_0x336613(0x12f)]('\x20\x20'+_0x4584fa);}}}),{'verbose':_0x45297b['verbose']}),_0x3bc790=_0x273058[_0x3a52f0(0x125)];if(_0x3bc790['counts'][_0x3a52f0(0x13c)]===0x0&&_0x3bc790[_0x3a52f0(0x14e)][_0x3a52f0(0x144)]===0x0)return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x121)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x3bc790[_0x3a52f0(0x120)]+'\x27')),0x0;const _0x575267=_0x3bc790[_0x3a52f0(0x142)][_0x3a52f0(0x137)](_0x371ee7=>_0x371ee7[_0x3a52f0(0x138)]),_0x55238c=_0x3bc790['files'][_0x3a52f0(0x137)](_0x2afb07=>!_0x2afb07[_0x3a52f0(0x138)]&&_0x2afb07[_0x3a52f0(0x110)]),_0x170afa=_0x3bc790[_0x3a52f0(0x142)][_0x3a52f0(0x137)](_0x406c1c=>!_0x406c1c[_0x3a52f0(0x138)]&&!_0x406c1c['hasChanges']);console[_0x3a52f0(0x12f)](_0x3a52f0(0x136)+_0x3bc790['parentName']+'\x27:'),console[_0x3a52f0(0x12f)](_0x3a52f0(0x104)+a38_0x516896[_0x3a52f0(0x132)](_0x3bc790[_0x3a52f0(0x14e)]['segments']+_0x3a52f0(0x130))+_0x3a52f0(0x109)+a38_0x516896['cyan'](_0x3bc790['counts'][_0x3a52f0(0x13b)]+_0x3a52f0(0x143)));if(_0x3bc790['counts'][_0x3a52f0(0x144)]>0x0){const _0x2950df=_0x3bc790[_0x3a52f0(0x14e)]['journeyVersions']>_0x3bc790[_0x3a52f0(0x14e)][_0x3a52f0(0x144)]?'\x20('+_0x3bc790['counts']['journeyVersions']+_0x3a52f0(0x119):'';console[_0x3a52f0(0x12f)](_0x3a52f0(0x114)+a38_0x516896['cyan'](_0x3bc790[_0x3a52f0(0x14e)][_0x3a52f0(0x144)]+_0x3a52f0(0x11d))+a38_0x516896[_0x3a52f0(0x10f)](_0x2950df));}console[_0x3a52f0(0x12f)]('\x20\x20'+a38_0x516896[_0x3a52f0(0x10d)]('+\x20'+_0x575267[_0x3a52f0(0x122)]+_0x3a52f0(0x140))),console['error']('\x20\x20'+a38_0x516896['yellow']('~\x20'+_0x55238c[_0x3a52f0(0x122)]+'\x20changed\x20files')),console[_0x3a52f0(0x12f)]('\x20\x20'+a38_0x516896['dim']('=\x20'+_0x170afa[_0x3a52f0(0x122)]+_0x3a52f0(0x14f))),console[_0x3a52f0(0x12f)](_0x3a52f0(0x127)+a38_0x516896[_0x3a52f0(0x132)](_0x3bc790['targetDir'])+'\x0a');if(_0x55238c['length']>0x0)for(const _0x1f2da2 of _0x55238c){console[_0x3a52f0(0x12f)](_0x3a52f0(0x115)+_0x1f2da2['relativePath']+'\x27:'),console[_0x3a52f0(0x12f)]('─'['repeat'](0x3c)),console[_0x3a52f0(0x12f)](_0x1f2da2[_0x3a52f0(0x10b)]),console[_0x3a52f0(0x12f)]('─'[_0x3a52f0(0x14b)](0x3c));}if(_0x45297b[_0x3a52f0(0x145)])return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x121)](_0x3a52f0(0x117))),0x0;if(_0x575267[_0x3a52f0(0x122)]===0x0&&_0x55238c[_0x3a52f0(0x122)]===0x0)return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x10d)](_0x3a52f0(0x13f))),saveSessionContext({'parent_segment':_0x3bc790['parentName']},_0x45297b['session']),console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x10d)](_0x3a52f0(0x11c)+a38_0x516896['dim'](_0x3a52f0(0x100))+_0x3a52f0(0x12b)+a38_0x516896[_0x3a52f0(0x132)](_0x3bc790[_0x3a52f0(0x120)]))),0x0;if(!_0x45297b[_0x3a52f0(0x11e)]){if(!isInteractive())return console[_0x3a52f0(0x12f)](a38_0x516896['red'](_0x3a52f0(0x10a)),_0x3a52f0(0x113)),console['error'](a38_0x516896['dim'](_0x3a52f0(0x10c))),0x1;const _0x580837=await confirmKey(_0x3a52f0(0x14a)+(_0x575267[_0x3a52f0(0x122)]+_0x55238c[_0x3a52f0(0x122)])+'\x20files?');if(!_0x580837)return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x121)]('Aborted.'),_0x3a52f0(0x146)),0x1;}for(const _0x4d6156 of _0x3bc790[_0x3a52f0(0x142)]){if(_0x4d6156[_0x3a52f0(0x138)]||_0x4d6156['hasChanges']){const _0x5aab8d=a38_0x4c5a86['dirname'](_0x4d6156[_0x3a52f0(0x135)]);!existsSync(_0x5aab8d)&&mkdirSync(_0x5aab8d,{'recursive':!![]}),writeFileSync(_0x4d6156[_0x3a52f0(0x135)],_0x4d6156['content'],_0x3a52f0(0x124));}}return console[_0x3a52f0(0x12f)](a38_0x516896[_0x3a52f0(0x10d)](_0x3a52f0(0x105)+(_0x575267['length']+_0x55238c[_0x3a52f0(0x122)])+'\x20files\x20to\x20'+_0x3bc790[_0x3a52f0(0x12e)])),saveSessionContext({'parent_segment':_0x3bc790['parentName']},_0x45297b['session']),console['error'](a38_0x516896[_0x3a52f0(0x10d)](_0x3a52f0(0x11c)+a38_0x516896[_0x3a52f0(0x10f)](_0x3a52f0(0x100))+_0x3a52f0(0x12b)+a38_0x516896[_0x3a52f0(0x132)](_0x3bc790[_0x3a52f0(0x120)]))),0x0;}}
@@ -1 +1 @@
1
- const a39_0x48a134=a39_0x1732;function a39_0x27e5(){const _0x2a3cfe=['folderPath','\x20changed','\x20\x20Journeys:\x20','set','journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','helpText','\x20\x20📊\x20Segments:','Delete\x20segment:','New\x20journey:','diff','Parent\x20segment:\x20','green','getParent','segment\x20or\x20journey','activations','errorCode','\x20new','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','/j/da/je','(Journey\x20will\x20be\x20deleted)','parentSegment','\x20activations]','dryRun','name','toDelete','user','yes','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Changes\x20to\x20journey:','/e/','523676DckxWm','red','created','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','folders','617008XtzmlG','buildUserMaps','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Error\x20parsing\x20YAML:\x20','segment:push','versionNumber','new','Fetching\x20existing\x20data...','toString','join','\x20unchanged','\x0aPush\x20summary\x20for\x20\x27','push','isNew','journeysOnly','data','\x20changes?','listFolders','76621yUsTYR','description','\x20\x20\x20\x20','getOutputSchemaWithCache','state','\x20\x20🗺️\x20\x20Journeys:','\x20deleted','\x20to\x20delete','No\x20','existingJourney','deleted','updatedAt','list','length','message','verbose','targetDir','\x20folders\x20to\x20create','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','cwd','parentName','174610UEqbzM','Error:\x20Directory\x20not\x20found:\x20','/sb/da/esr','journeyId','517310JYcyTE','paused','results','audienceId','parentFolder','connection','\x27...','unchanged','segmentFolderId','\x20\x20Source:\x20','scopedFolderPath','9093717YIlQMi','Aborted.','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x0aValidation\x20failed:','10nJyDyU','endsWith','filter','\x20updated','Delete\x20journey:','Changes\x20to:','72eWKRTD','yamlConfig','Folders\x20to\x20create:','segments','changed','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','cyan','\x20to\x20create','updated','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','all','yellow','blue','/app/ps/','.yml','existingSegment','resolveParentId','\x20created','error','site','get','createdAt','\x0aError:','3NTpgwU','file','type','Resolving\x20parent\x20segment\x20\x27','isScoped','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','dim','repeat','Fetching\x20existing\x20activations...','journeyBundleName','segment','folderId','📁\x20','\x20\x20Activations:','idToName','relationships','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','delete','nameToId','Error:\x20','New\x20segment:','\x20to\x20update','toCreate','\x20\x20Segments:\x20','journey','add','getJourney','\x20\x20Activations:\x20','Preparing\x20journeys...','attributes','no_parent','then','2905945JqURlu','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','map','nameToType','setPhase','listActivations'];a39_0x27e5=function(){return _0x2a3cfe;};return a39_0x27e5();}(function(_0x23f866,_0x26cfc7){const _0x3c5a6a=a39_0x1732,_0x1beb4a=_0x23f866();while(!![]){try{const _0x510bf1=parseInt(_0x3c5a6a(0x1e6))/0x1+parseInt(_0x3c5a6a(0x1ff))/0x2+parseInt(_0x3c5a6a(0x188))/0x3*(parseInt(_0x3c5a6a(0x1cf))/0x4)+parseInt(_0x3c5a6a(0x1fb))/0x5*(parseInt(_0x3c5a6a(0x171))/0x6)+parseInt(_0x3c5a6a(0x1a8))/0x7+-parseInt(_0x3c5a6a(0x1d4))/0x8+-parseInt(_0x3c5a6a(0x20a))/0x9*(parseInt(_0x3c5a6a(0x20e))/0xa);if(_0x510bf1===_0x26cfc7)break;else _0x1beb4a['push'](_0x1beb4a['shift']());}catch(_0xc83d3d){_0x1beb4a['push'](_0x1beb4a['shift']());}}}(a39_0x27e5,0x33f77));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x7b193f from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a39_0x1732(_0x473cce,_0x1a6b9b){_0x473cce=_0x473cce-0x16f;const _0x27e55f=a39_0x27e5();let _0x1732a3=_0x27e55f[_0x473cce];return _0x1732a3;}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']=a39_0x48a134(0x1d8);[a39_0x48a134(0x1e7)]=a39_0x48a134(0x1ca);async['execute'](_0x241a6f){const _0x141702=a39_0x48a134,{options:_0xc6df7a,args:_0x759b24,tdx:_0x11304b}=_0x241a6f,_0x11005c=_0xc6df7a,_0xb456fb=await resolveTarget({'arg':_0x759b24[0x0],'contextParent':_0xc6df7a[_0x141702(0x1c3)],'cwd':process[_0x141702(0x1f9)]()});if(!isSuccessfulResolution(_0xb456fb))return _0xb456fb[_0x141702(0x1be)]===_0x141702(0x1a6)?(console['error'](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x198))),console[_0x141702(0x183)]('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[_0x141702(0x183)](_0x141702(0x1d6)),console[_0x141702(0x183)]('\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[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x19b)+_0xb456fb['message']+'\x0a')),_0xb456fb['helpText']&&console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x177)](_0xb456fb[_0x141702(0x1b4)]))),0x1;if(_0xb456fb[_0x141702(0x18a)]==='parent_name')return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1fc)+_0xb456fb[_0x141702(0x1f6)]+'\x0a')),console['error'](a39_0x7b193f[_0x141702(0x177)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x39eb52=_0xb456fb[_0x141702(0x1fa)],_0x4311bb=_0xb456fb['targetDir'],_0x3ec5ac=_0xb456fb[_0x141702(0x18a)]===_0x141702(0x189)?_0xb456fb['filePath']:undefined,_0x4b1998=getScopedDetails(_0xb456fb),_0x4ff7bc=_0x4b1998?.[_0x141702(0x18c)]??![],_0x1fb24e=_0x4b1998?.[_0x141702(0x209)]??'';if(!existsSync(_0x4311bb))return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1fc)+_0x4311bb+'\x0a')),console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x177)](_0x141702(0x1a9))),0x1;_0x11005c['verbose']&&(console[_0x141702(0x183)]('Site:\x20'+_0x11005c[_0x141702(0x184)]),console['error'](_0x141702(0x1b9)+_0x39eb52),console[_0x141702(0x183)]('Source\x20directory:\x20'+_0x4311bb),_0x4ff7bc&&console[_0x141702(0x183)]('Scoped\x20to\x20folder:\x20'+_0x1fb24e));const _0x240485=await withSpinner(_0x141702(0x18b)+_0x39eb52+_0x141702(0x205),()=>_0x11304b[_0x141702(0x192)][_0x141702(0x181)](_0x39eb52),{'verbose':_0x11005c['verbose']}),_0x3b9487=_0x240485[_0x141702(0x1e3)],{parentSegmentResult:_0xf2a669,segmentsResult:_0x3143ad,foldersResult:_0x1387f4,journeysWithDetailsResult:_0x2a3e94,userMaps:_0x296886}=await withSpinner(_0x141702(0x1db),async()=>{const _0x130afa=_0x141702,[_0xcf702e,_0x35998e,_0x2dad61,_0x1dae1c,_0x5ccf47]=await Promise['all']([_0x11304b['segment'][_0x130afa(0x1bb)](_0x3b9487),_0x11304b['segment']['listSegments'](_0x3b9487),_0x11304b[_0x130afa(0x192)][_0x130afa(0x1e5)](_0x3b9487),_0x11304b[_0x130afa(0x1a0)]['listJourneysWithDetailsFromParentSegment'](_0x3b9487,{'includeAllVersions':!![]}),_0x11304b['user'][_0x130afa(0x1d5)]()]);return{'parentSegmentResult':_0xcf702e,'segmentsResult':_0x35998e,'foldersResult':_0x2dad61,'journeysWithDetailsResult':_0x1dae1c,'userMaps':_0x5ccf47};},{'verbose':_0x11005c['verbose']})['then'](_0x14f6d8=>_0x14f6d8[_0x141702(0x1e3)]),_0x16ef15=_0xf2a669,_0x48c5a9=extractRootFolderId(_0x16ef15),_0x1846ee=_0x3143ad,_0x3abc12=_0x1387f4,{journeys:_0xb3616,activationStepsById:_0x1aafd3}=_0x2a3e94,_0x3e70c0=new Map(_0xb3616[_0x141702(0x1aa)](_0x597a25=>[_0x597a25['id'],_0x597a25])),_0x59adc3=_0xb3616[_0x141702(0x1aa)](_0x3d05b0=>({'id':_0x3d05b0['id'],'name':_0x3d05b0[_0x141702(0x1a5)]['name'],'journeyBundleName':_0x3d05b0['attributes']['journeyBundleName']||'','journeyBundleId':_0x3d05b0[_0x141702(0x1a5)]['journeyBundleId']||'','versionNumber':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x1d9)],'description':_0x3d05b0[_0x141702(0x1a5)]['description'],'state':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x1ea)],'paused':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x200)],'audienceId':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x202)],'folderId':_0x3d05b0[_0x141702(0x197)]?.[_0x141702(0x203)]?.['data']?.['id'],'createdAt':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x186)],'updatedAt':_0x3d05b0[_0x141702(0x1a5)][_0x141702(0x1f1)]})),{emailToId:_0x399a1e,idToEmail:_0x458e57}=_0x296886,_0x1902b3=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xe9500f=_0x141702,_0x2cc224=await _0x11304b[_0xe9500f(0x204)][_0xe9500f(0x1f2)]();return buildConnectionMaps(_0x2cc224);},{'verbose':_0x11005c[_0x141702(0x1f5)]})[_0x141702(0x1a7)](_0x324a2a=>_0x324a2a[_0x141702(0x1e3)]),_0x185e97=_0x1902b3[_0x141702(0x19a)],_0x149e9d=_0x1902b3[_0x141702(0x196)],_0x65ece6=_0x1902b3[_0x141702(0x1ab)],_0x512463={'emailToIdMap':_0x399a1e,'connectionNameToIdMap':_0x185e97,'connectionNameToTypeMap':_0x65ece6,'getSchema':_0x2b7cca=>_0x11304b['connection'][_0x141702(0x1e9)](_0x2b7cca)};let {pathToId:_0x596dc7,idToPath:_0x5f42a1}=buildFolderMaps(_0x3abc12);const _0x3003fd=buildSegmentLookupMap(_0x1846ee,_0x5f42a1),_0x1b57aa=buildSegmentNameToIdMap(_0x1846ee),_0x4d7ff9=buildJourneyBundleLookupMap(_0x59adc3,_0x5f42a1);let _0x1de463;if(_0x3ec5ac){if(!_0x3ec5ac[_0x141702(0x20f)](_0x141702(0x17f))&&!_0x3ec5ac[_0x141702(0x20f)]('.yaml'))return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1d2)+_0x3ec5ac+'\x0a')),0x1;_0x1de463=[_0x3ec5ac];}else _0x1de463=findYamlFiles(_0x4311bb);if(_0x1de463[_0x141702(0x1f3)]===0x0)return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x20c)+_0x4311bb+'\x0a')),console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x177)](_0x141702(0x1c0))),0x1;let _0x330228,_0x2ce2ef;try{const _0x15fd64=parseAndClassifyYamlFiles(_0x1de463,_0x4311bb,{'skipSegments':_0x11005c[_0x141702(0x1e2)]});_0x330228=_0x15fd64[_0x141702(0x174)],_0x2ce2ef=_0x15fd64[_0x141702(0x1b2)];const _0xa3f971=validateParsedFiles(_0x15fd64,_0x4311bb);if(_0xa3f971[_0x141702(0x1f3)]>0x0)return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x20d))),console[_0x141702(0x183)](formatValidationErrors(_0xa3f971)),console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x176))),0x1;}catch(_0x27acef){return console['error'](a39_0x7b193f['red'](_0x141702(0x1d7)+(_0x27acef instanceof Error?_0x27acef[_0x141702(0x1f4)]:_0x27acef))),0x1;}if(_0x330228[_0x141702(0x1f3)]===0x0&&_0x2ce2ef[_0x141702(0x1f3)]===0x0){const _0x574d6a=_0x11005c[_0x141702(0x1e2)]?'journey':_0x141702(0x1bc);return console[_0x141702(0x183)](a39_0x7b193f['yellow'](_0x141702(0x1ee)+_0x574d6a+'\x20YAML\x20files\x20found')),0x0;}const _0x3ae103=new Map();_0x1846ee[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)]&&await withSpinner(_0x141702(0x190),async()=>{await batchAsync(_0x1846ee,async _0x2e8f3e=>{const _0x3697bc=a39_0x1732,_0x7572f3=await _0x11304b[_0x3697bc(0x192)][_0x3697bc(0x1ad)](_0x3b9487,_0x2e8f3e['id']);_0x3ae103[_0x3697bc(0x1b1)](_0x2e8f3e['id'],_0x7572f3);});},{'verbose':_0x11005c[_0x141702(0x1f5)]});const {segmentFiles:_0xec3b07,foldersToCreate:_0x56de1f}=await prepareSegmentFiles(_0x330228,{'segmentByFolderAndName':_0x3003fd,'activationsBySegmentId':_0x3ae103,'folderPathToId':_0x596dc7,'idToEmailMap':_0x458e57,'connectionIdToNameMap':_0x149e9d},_0x512463,_0x4ff7bc,_0x1fb24e),_0x3e0fab=_0x3ec5ac?[]:findSegmentsToDelete(_0x1846ee,_0x330228[_0x141702(0x1aa)](({yamlConfig:_0x15afaf,folderPath:_0x17d2e0})=>({'yamlConfig':_0x15afaf,'folderPath':resolveTDFolderPath(_0x17d2e0,_0x4ff7bc,_0x1fb24e)})),_0x5f42a1,_0x1fb24e,_0x4ff7bc),{journeyFiles:_0x51cb98,foldersToCreate:_0x1fd2d9}=await withProgressSpinner(_0x141702(0x1a4),async _0x22db05=>prepareJourneyFiles(_0x2ce2ef,{'fetchJourney':async _0x30e9a4=>_0x11304b[_0x141702(0x1a0)][_0x141702(0x1a2)](_0x30e9a4[_0x141702(0x1fe)]),'journeyBundlesByFolderAndName':_0x4d7ff9,'folderPathToId':_0x596dc7,'idToEmailMap':_0x458e57,'connectionIdToNameMap':_0x149e9d,'existingSegments':_0x1846ee,'parentId':_0x3b9487,'deps':_0x11304b,'progress':{'update':_0x260c03=>{const _0x10d972=_0x141702;_0x22db05[_0x10d972(0x1ac)](_0x260c03),_0x11005c[_0x10d972(0x1f5)]&&console[_0x10d972(0x183)]('\x20\x20'+_0x260c03);}},'journeyById':_0x3e70c0,'activationStepsById':_0x1aafd3},_0x4ff7bc,_0x1fb24e),{'verbose':_0x11005c[_0x141702(0x1f5)]})[_0x141702(0x1a7)](_0x56fb55=>_0x56fb55[_0x141702(0x1e3)]);for(const _0x532cab of _0x1fd2d9){_0x56de1f[_0x141702(0x1a1)](_0x532cab);}const _0x2657d7=_0x3ec5ac?[]:findJourneysToDelete(_0x59adc3,_0x2ce2ef[_0x141702(0x1aa)](({yamlConfig:_0x5c572a,folderPath:_0x52120d})=>({'yamlConfig':_0x5c572a,'folderPath':resolveTDFolderPath(_0x52120d,_0x4ff7bc,_0x1fb24e)})),_0x5f42a1,_0x1fb24e,_0x4ff7bc),_0x2ddf0f=calculatePushStats(_0xec3b07,_0x51cb98,_0x56de1f,_0x3e0fab,_0x2657d7,!!_0x11005c[_0x141702(0x199)],!!_0x11005c[_0x141702(0x1e2)]),_0xbd9d0f=_0x2ddf0f[_0x141702(0x174)][_0x141702(0x1da)],_0xdbfaca=_0x2ddf0f[_0x141702(0x174)][_0x141702(0x175)],_0x5c2fd0=_0x2ddf0f['segments'][_0x141702(0x206)],_0x499938=_0x2ddf0f['segments'][_0x141702(0x1c7)],_0x3dc342=_0x2ddf0f[_0x141702(0x1d3)][_0x141702(0x19e)],_0x41d506=_0x2ddf0f[_0x141702(0x1b2)][_0x141702(0x1da)],_0x4938bf=_0x2ddf0f['journeys'][_0x141702(0x175)],_0x105240=_0x2ddf0f[_0x141702(0x1b2)][_0x141702(0x206)],_0x411aa7=_0x2ddf0f[_0x141702(0x1b2)][_0x141702(0x1c7)],_0x1249eb=_0x2ddf0f[_0x141702(0x1bd)][_0x141702(0x17b)],_0x4986ec=_0x2ddf0f[_0x141702(0x1bd)]['toCreate'],_0x464e8b=_0x2ddf0f[_0x141702(0x1bd)]['toUpdate'],_0xa124d9=_0x2ddf0f[_0x141702(0x1bd)][_0x141702(0x1c7)];console['error'](_0x141702(0x1df)+_0x39eb52+'\x27:');_0x3dc342[_0x141702(0x1f3)]>0x0&&console[_0x141702(0x183)]('\x20\x20'+a39_0x7b193f[_0x141702(0x17d)](_0x141702(0x194)+_0x3dc342['length']+_0x141702(0x1f7)));if(!_0x11005c[_0x141702(0x1e2)]){console[_0x141702(0x183)](_0x141702(0x1b5)),console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x1ba)]('+\x20'+_0xbd9d0f[_0x141702(0x1f3)]+_0x141702(0x1bf))),console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x17c)]('~\x20'+_0xdbfaca[_0x141702(0x1f3)]+'\x20changed'));if(_0x499938[_0x141702(0x1f3)]>0x0)console['error']('\x20\x20\x20\x20'+a39_0x7b193f['red']('-\x20'+_0x499938[_0x141702(0x1f3)]+'\x20to\x20delete'));else _0x3e0fab[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x199)]&&console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x18e)](_0x3e0fab[_0x141702(0x1f3)]+_0x141702(0x1cb)));console[_0x141702(0x183)]('\x20\x20\x20\x20'+a39_0x7b193f[_0x141702(0x18e)]('=\x20'+_0x5c2fd0[_0x141702(0x1f3)]+'\x20unchanged'));}if(_0x51cb98[_0x141702(0x1f3)]>0x0||_0x2657d7['length']>0x0){console[_0x141702(0x183)](_0x141702(0x1eb)),console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f['green']('+\x20'+_0x41d506[_0x141702(0x1f3)]+_0x141702(0x1bf))),console['error'](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x17c)]('~\x20'+_0x4938bf['length']+_0x141702(0x1af)));if(_0x411aa7[_0x141702(0x1f3)]>0x0)console[_0x141702(0x183)]('\x20\x20\x20\x20'+a39_0x7b193f['red']('-\x20'+_0x411aa7['length']+_0x141702(0x1ed)));else _0x2657d7[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x199)]&&console['error']('\x20\x20\x20\x20'+a39_0x7b193f[_0x141702(0x18e)](_0x2657d7[_0x141702(0x1f3)]+_0x141702(0x1cb)));console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x18e)]('=\x20'+_0x105240[_0x141702(0x1f3)]+_0x141702(0x1de)));}_0x1249eb[_0x141702(0x1f3)]>0x0&&!_0x11005c['journeysOnly']&&(console['error'](''),console['error'](_0x141702(0x195)),_0x4986ec[_0x141702(0x1f3)]>0x0&&console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f['green']('+\x20'+_0x4986ec[_0x141702(0x1f3)]+_0x141702(0x178))),_0x464e8b[_0x141702(0x1f3)]>0x0&&console['error'](_0x141702(0x1e8)+a39_0x7b193f['yellow']('~\x20'+_0x464e8b[_0x141702(0x1f3)]+_0x141702(0x19d))),_0xa124d9['length']>0x0&&console[_0x141702(0x183)](_0x141702(0x1e8)+a39_0x7b193f[_0x141702(0x1d0)]('-\x20'+_0xa124d9[_0x141702(0x1f3)]+_0x141702(0x1ed))));console[_0x141702(0x183)](_0x141702(0x208)+a39_0x7b193f[_0x141702(0x177)](_0x4311bb)+'\x0a');if(_0x3dc342[_0x141702(0x1f3)]>0x0){console[_0x141702(0x183)](_0x141702(0x173));for(const _0x2cb54d of _0x3dc342){console['error']('\x20\x20'+a39_0x7b193f[_0x141702(0x17d)]('+')+'\x20'+_0x2cb54d);}console['error']('');}if(_0xbd9d0f[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)])for(const _0x265c9f of _0xbd9d0f){const _0x34239b=_0x265c9f[_0x141702(0x1ae)]?_0x265c9f[_0x141702(0x1ae)]+'/'+_0x265c9f[_0x141702(0x172)][_0x141702(0x1c6)]:_0x265c9f[_0x141702(0x172)][_0x141702(0x1c6)],_0x422f56=_0x265c9f[_0x141702(0x172)][_0x141702(0x1bd)]?.[_0x141702(0x1f3)]||0x0,_0xcd3dcc=_0x422f56>0x0?a39_0x7b193f[_0x141702(0x18e)]('\x20['+_0x422f56+'\x20activations]'):'';console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1ba)](_0x141702(0x19c))+'\x20'+_0x34239b+_0xcd3dcc),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c)),_0x265c9f[_0x141702(0x1b8)]&&console['error'](_0x265c9f[_0x141702(0x1b8)]),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}if(_0x499938[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)])for(const _0x4f2767 of _0x499938){const _0x161b29=_0x4f2767['segmentFolderId']?_0x5f42a1[_0x141702(0x185)](_0x4f2767[_0x141702(0x207)][_0x141702(0x1dc)]())||'':'',_0x57bc3c=_0x161b29?_0x161b29+'/'+_0x4f2767[_0x141702(0x1c6)]:_0x4f2767[_0x141702(0x1c6)],_0x1b9a04=_0x3ae103['get'](_0x4f2767['id'])||[],_0x2a856f=_0x1b9a04[_0x141702(0x1f3)]>0x0?a39_0x7b193f[_0x141702(0x18e)]('\x20['+_0x1b9a04[_0x141702(0x1f3)]+_0x141702(0x1c4)):'';console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x1b6))+'\x20'+_0x57bc3c+_0x2a856f),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));const _0x51831e=segmentWithActivationsToYaml(_0x4f2767,_0x1b9a04,undefined,_0x458e57,_0x149e9d),_0x2ffcdd=segmentToYamlString(_0x51831e),_0x47f444=generateDiff(_0x2ffcdd,'');console[_0x141702(0x183)](formatDiffWithColors(_0x47f444)),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}const _0x3131b6=_0xec3b07[_0x141702(0x210)](_0x34efd0=>!_0x34efd0['isNew']&&_0x34efd0[_0x141702(0x1b8)]);if(_0x3131b6[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)])for(const _0xacbfa8 of _0x3131b6){const _0x10aa6c=_0xacbfa8['folderPath']?_0xacbfa8[_0x141702(0x1ae)]+'/'+_0xacbfa8[_0x141702(0x172)]['name']:_0xacbfa8[_0x141702(0x172)][_0x141702(0x1c6)];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x170))+'\x20'+_0x10aa6c),console[_0x141702(0x183)]('─'['repeat'](0x3c)),console[_0x141702(0x183)](_0xacbfa8[_0x141702(0x1b8)]),console['error']('─'[_0x141702(0x18f)](0x3c));}if(_0x41d506[_0x141702(0x1f3)]>0x0)for(const _0x503dc6 of _0x41d506){const _0x55de19=_0x503dc6[_0x141702(0x1ae)]?_0x503dc6[_0x141702(0x1ae)]+'/'+_0x503dc6['yamlConfig'][_0x141702(0x1c6)]:_0x503dc6[_0x141702(0x172)]['name'];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1ba)](_0x141702(0x1b7))+'\x20'+_0x55de19),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c)),_0x503dc6['diff']&&console[_0x141702(0x183)](_0x503dc6['diff']),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}const _0x2c6ae4=_0x51cb98[_0x141702(0x210)](_0x29b21f=>!_0x29b21f[_0x141702(0x1e1)]&&_0x29b21f[_0x141702(0x1b8)]);if(_0x2c6ae4[_0x141702(0x1f3)]>0x0)for(const _0x5973ea of _0x2c6ae4){const _0xe0de39=_0x5973ea['folderPath']?_0x5973ea[_0x141702(0x1ae)]+'/'+_0x5973ea['yamlConfig'][_0x141702(0x1c6)]:_0x5973ea['yamlConfig'][_0x141702(0x1c6)];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x1cd))+'\x20'+_0xe0de39),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c)),console[_0x141702(0x183)](_0x5973ea[_0x141702(0x1b8)]),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}if(_0x411aa7[_0x141702(0x1f3)]>0x0)for(const _0x3b6951 of _0x411aa7){const _0x566a27=_0x3b6951[_0x141702(0x193)]?_0x5f42a1[_0x141702(0x185)](_0x3b6951[_0x141702(0x193)])||'':'',_0x19ef98=_0x566a27?_0x566a27+'/'+_0x3b6951[_0x141702(0x191)]:_0x3b6951[_0x141702(0x191)];console['error']('\x0a'+a39_0x7b193f[_0x141702(0x1d0)](_0x141702(0x16f))+'\x20'+_0x19ef98),console[_0x141702(0x183)]('─'['repeat'](0x3c)),console[_0x141702(0x183)](a39_0x7b193f['red'](_0x141702(0x1c2))),console[_0x141702(0x183)]('─'[_0x141702(0x18f)](0x3c));}if(_0x11005c[_0x141702(0x1c5)])return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17c)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x560691=_0x11005c[_0x141702(0x1e2)]?![]:_0xbd9d0f[_0x141702(0x1f3)]>0x0||_0xdbfaca[_0x141702(0x1f3)]>0x0||_0x499938['length']>0x0,_0x28527a=_0x41d506[_0x141702(0x1f3)]>0x0||_0x4938bf[_0x141702(0x1f3)]>0x0||_0x411aa7[_0x141702(0x1f3)]>0x0,_0x4129b9=_0x11005c[_0x141702(0x1e2)]?![]:_0x1249eb[_0x141702(0x1f3)]>0x0,_0x476b06=_0x3dc342[_0x141702(0x1f3)]>0x0;if(!_0x560691&&!_0x28527a&&!_0x4129b9&&!_0x476b06){const _0x3aa040=_0x11005c[_0x141702(0x1e2)]?_0x141702(0x1cc):_0x141702(0x1f8);console['error'](a39_0x7b193f[_0x141702(0x1ba)](_0x3aa040));if(_0x3ec5ac&&_0x5c2fd0[_0x141702(0x1f3)]===0x1){const _0x28943a=_0x5c2fd0[0x0];if(_0x28943a['existingSegment']?.['id']){const _0x2e3dd4=getConsoleNextUrl(_0x11005c[_0x141702(0x184)],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x28943a[_0x141702(0x180)]['id']+_0x141702(0x1fd));console[_0x141702(0x183)](_0x141702(0x17a)+a39_0x7b193f['cyan'](_0x2e3dd4));}}if(_0x3ec5ac&&_0x105240[_0x141702(0x1f3)]===0x1){const _0x5b94a4=_0x105240[0x0];if(_0x5b94a4['existingJourney']?.['id']){const _0x52f537=getConsoleNextUrl(_0x11005c['site'],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x5b94a4[_0x141702(0x1ef)]['id']+_0x141702(0x1c1));console[_0x141702(0x183)]('\x20\x20'+a39_0x7b193f['cyan'](_0x52f537));}}return 0x0;}const _0x4470e9=_0x11005c['journeysOnly']?_0x41d506[_0x141702(0x1f3)]+_0x4938bf[_0x141702(0x1f3)]+_0x411aa7[_0x141702(0x1f3)]+_0x3dc342[_0x141702(0x1f3)]:_0xbd9d0f[_0x141702(0x1f3)]+_0xdbfaca['length']+_0x499938[_0x141702(0x1f3)]+_0x41d506[_0x141702(0x1f3)]+_0x4938bf[_0x141702(0x1f3)]+_0x411aa7['length']+_0x3dc342[_0x141702(0x1f3)]+_0x1249eb['length'];if(!_0x11005c[_0x141702(0x1c9)]&&_0x4470e9>0x0){if(!isInteractive())return console[_0x141702(0x183)](a39_0x7b193f['red'](_0x141702(0x187)),_0x141702(0x1b3)),console[_0x141702(0x183)](a39_0x7b193f['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x248a27=await confirmKey('Push\x20'+_0x4470e9+_0x141702(0x1e4));if(!_0x248a27)return console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x20b))),0x1;}const _0x5d3544={'withProgress':async(_0x42c275,_0x377482)=>{const _0x1104e=await withSpinner(_0x42c275,_0x377482,{'verbose':_0x11005c['verbose']});return{'data':_0x1104e['data']};},'logInfo':_0x5dbfc6=>console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x17d)]('✔\x20'+_0x5dbfc6)),'logSuccess':_0x43e305=>console[_0x141702(0x183)](a39_0x7b193f['green']('✔\x20'+_0x43e305)),'logWarning':_0x3cede9=>console[_0x141702(0x183)](a39_0x7b193f['yellow']('⚠\x20'+_0x3cede9)),'logDeleted':_0x117573=>console['error'](a39_0x7b193f[_0x141702(0x1d0)]('✔\x20'+_0x117573))},_0x590bf3={'segment':_0x11304b[_0x141702(0x192)],'journey':_0x11304b[_0x141702(0x1a0)],'user':_0x11304b[_0x141702(0x1c8)],'connection':_0x11304b[_0x141702(0x204)]};_0x3dc342['length']>0x0&&(_0x596dc7=await executePushFolders(_0x590bf3,_0x3dc342,_0x596dc7,{'parentId':_0x3b9487},_0x5d3544));const _0x47fd68={'rootFolderId':_0x48c5a9,'folderPathToId':_0x596dc7,'folderIdToPath':_0x5f42a1,'segmentNameToId':_0x1b57aa,'activationsBySegmentId':_0x3ae103,'emailToIdMap':_0x399a1e,'idToEmailMap':_0x458e57,'connectionNameToIdMap':_0x1902b3[_0x141702(0x19a)],'connectionIdToNameMap':_0x1902b3['idToName'],'connectionNameToTypeMap':_0x65ece6},_0x5ee5a1=await executePushSegments(_0x590bf3,_0x11005c[_0x141702(0x1e2)]?[]:_0xec3b07,_0x47fd68,{'parentId':_0x3b9487},_0x5d3544),_0x46144d=_0x5ee5a1['created'],_0x58ce0c=_0x5ee5a1[_0x141702(0x179)],_0x5ef0e7=_0x5ee5a1[_0x141702(0x1bd)][_0x141702(0x1d1)],_0x4d8322=_0x5ee5a1['activations'][_0x141702(0x179)],_0x2596b8=_0x5ee5a1['activations'][_0x141702(0x1f0)];let _0x160875;if(_0x3ec5ac&&_0xec3b07[_0x141702(0x1f3)]===0x1){const _0x33ec64=_0xec3b07[0x0];_0x160875=_0x33ec64['existingSegment']?.['id']??_0x5ee5a1['createdSegmentIds'][_0x141702(0x185)](_0x33ec64[_0x141702(0x172)][_0x141702(0x1c6)]);}const _0x2b90cb=await executePushSegmentDeletions(_0x590bf3,_0x11005c['journeysOnly']?[]:_0x499938,_0x5d3544);let _0x1f378a=0x0,_0x20d867=0x0,_0x1f493f=0x0;const _0x516056=new Map(_0x1b57aa);for(const [_0x29d084,_0x4fa14d]of _0x5ee5a1['createdSegmentIds']){_0x516056['set'](_0x29d084,_0x4fa14d);}if(_0x51cb98['length']>0x0){const _0x1951f4={..._0x47fd68,'segmentNameToId':_0x516056,'existingSegments':_0x1846ee,'activationContext':_0x512463},_0x150aa6=await executePushJourneys(_0x590bf3,_0x51cb98,_0x1951f4,{'parentId':_0x3b9487,'rootFolderId':_0x48c5a9,'verbose':_0x11005c[_0x141702(0x1f5)]},_0x5d3544);_0x1f378a=_0x150aa6[_0x141702(0x1d1)],_0x20d867=_0x150aa6[_0x141702(0x179)];if(_0x3ec5ac&&_0x150aa6[_0x141702(0x201)][_0x141702(0x1f3)]===0x1){const _0x106206=_0x150aa6[_0x141702(0x201)][0x0];if(_0x106206['journeyId']){const _0x2f46be=getConsoleNextUrl(_0x11005c['site'],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x106206[_0x141702(0x1fe)]+_0x141702(0x1c1));console[_0x141702(0x183)]('\x20\x20'+a39_0x7b193f[_0x141702(0x177)](_0x2f46be));}}}for(const _0x2dfe6e of _0x411aa7){console['error'](a39_0x7b193f[_0x141702(0x17c)](_0x141702(0x18d)+_0x2dfe6e[_0x141702(0x191)])),_0x1f493f++;}const _0xc31c2=[];if(_0x46144d>0x0)_0xc31c2['push'](_0x46144d+_0x141702(0x182));if(_0x58ce0c>0x0)_0xc31c2['push'](_0x58ce0c+_0x141702(0x211));if(_0x2b90cb>0x0)_0xc31c2['push'](_0x2b90cb+_0x141702(0x1ec));const _0x2905da=[];if(_0x1f378a>0x0)_0x2905da[_0x141702(0x1e0)](_0x1f378a+_0x141702(0x182));if(_0x20d867>0x0)_0x2905da[_0x141702(0x1e0)](_0x20d867+'\x20updated');if(_0x1f493f>0x0)_0x2905da[_0x141702(0x1e0)](_0x1f493f+'\x20deleted');const _0x1a721a=[];if(_0x5ef0e7>0x0)_0x1a721a['push'](_0x5ef0e7+'\x20created');if(_0x4d8322>0x0)_0x1a721a[_0x141702(0x1e0)](_0x4d8322+'\x20updated');if(_0x2596b8>0x0)_0x1a721a[_0x141702(0x1e0)](_0x2596b8+_0x141702(0x1ec));console[_0x141702(0x183)](a39_0x7b193f[_0x141702(0x1ba)]('\x0a✔\x20Push\x20complete'));_0xc31c2[_0x141702(0x1f3)]>0x0&&!_0x11005c[_0x141702(0x1e2)]&&console[_0x141702(0x183)](_0x141702(0x19f)+_0xc31c2[_0x141702(0x1dd)](',\x20'));_0x2905da[_0x141702(0x1f3)]>0x0&&console[_0x141702(0x183)](_0x141702(0x1b0)+_0x2905da[_0x141702(0x1dd)](',\x20'));_0x1a721a[_0x141702(0x1f3)]>0x0&&!_0x11005c['journeysOnly']&&console[_0x141702(0x183)](_0x141702(0x1a3)+_0x1a721a[_0x141702(0x1dd)](',\x20'));if(_0x160875){const _0x568e0f=getConsoleNextUrl(_0x11005c['site'],_0x141702(0x17e)+_0x3b9487+_0x141702(0x1ce)+_0x160875+_0x141702(0x1fd));console[_0x141702(0x183)](_0x141702(0x17a)+a39_0x7b193f['cyan'](_0x568e0f));}return 0x0;}}
1
+ const a39_0x4f0c1e=a39_0x37a0;(function(_0xfd718,_0x5acdcd){const _0x5d1354=a39_0x37a0,_0x3f0d73=_0xfd718();while(!![]){try{const _0x47cba5=parseInt(_0x5d1354(0x12d))/0x1+-parseInt(_0x5d1354(0xb8))/0x2+parseInt(_0x5d1354(0x115))/0x3*(parseInt(_0x5d1354(0xd4))/0x4)+-parseInt(_0x5d1354(0x129))/0x5*(parseInt(_0x5d1354(0x11f))/0x6)+parseInt(_0x5d1354(0xdc))/0x7+parseInt(_0x5d1354(0x103))/0x8*(parseInt(_0x5d1354(0xb1))/0x9)+parseInt(_0x5d1354(0xec))/0xa*(-parseInt(_0x5d1354(0xe9))/0xb);if(_0x47cba5===_0x5acdcd)break;else _0x3f0d73['push'](_0x3f0d73['shift']());}catch(_0x5259e9){_0x3f0d73['push'](_0x3f0d73['shift']());}}}(a39_0xb36b,0xd8cd2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a39_0xb36b(){const _0x12cc31=['\x20changed','2107392NYobnG','unchanged','New\x20journey:','updatedAt','attributes','\x20\x20Segments:\x20','\x20folders\x20to\x20create','deleted','execute','length','blue','message','New\x20segment:','/j/da/je','journeyId','segment\x20or\x20journey','diff','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','set','delete','listFolders','\x20changes?','\x20\x20📊\x20Segments:','toCreate','list','listActivations','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','verbose','287132HaqAKr','created','\x20\x20\x20\x20','Fetching\x20connections\x20for\x20name\x20resolution...','all','helpText','Error:\x20Directory\x20not\x20found:\x20','getParent','6200537KUHDOz','yes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20activations]','type','\x27...','endsWith','Aborted.','getJourney','journeysOnly','join','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Delete\x20journey:','16083672RTviGm','\x20created','get','10ZsejTn','.yaml','new','state','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segments','Scoped\x20to\x20folder:\x20','\x20\x20Activations:\x20','toString','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','data','changed','parentName','isScoped','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parentFolder','yellow','red','(Journey\x20will\x20be\x20deleted)','error','repeat','folders','11433976HHQKlv','green','\x20updated','\x0aValidation\x20failed:','add','cwd','/app/ps/','Site:\x20','site','scopedFolderPath','push','folderId','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','segment','\x20\x20Source:\x20','file','No\x20','69wfOPbE','\x20unchanged','resolveParentId','cyan','journeyBundleName','createdAt','journey','buildUserMaps','createdSegmentIds','Resolving\x20parent\x20segment\x20\x27','276bGHDiK','existingSegment','filePath','Changes\x20to\x20journey:','\x20new','Push\x20','paused','\x20deleted','activations','existingJourney','153470McIXoA','versionNumber','no_parent','\x0aPush\x20summary\x20for\x20\x27','849743EaTgSY','connection','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','dim','\x0aError:','\x20to\x20delete','journeys','user','segment:push','\x20to\x20create','Fetching\x20existing\x20activations...','map','\x20\x20🗺️\x20\x20Journeys:','parent_name','Preparing\x20journeys...','description','\x20\x20Activations:','/sb/da/esr','Source\x20directory:\x20','filter','folderPath','name','updated','Changes\x20to:','then','idToName','Delete\x20segment:','toDelete','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','nameToId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/e/','9CaHBhT','segmentFolderId','yamlConfig','Error\x20parsing\x20YAML:\x20','targetDir','isNew'];a39_0xb36b=function(){return _0x12cc31;};return a39_0xb36b();}import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x247d52 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a39_0x37a0(_0x44a6a3,_0x45f9cc){_0x44a6a3=_0x44a6a3-0xaa;const _0xb36be8=a39_0xb36b();let _0x37a012=_0xb36be8[_0x44a6a3];return _0x37a012;}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a39_0x4f0c1e(0x135);[a39_0x4f0c1e(0x13c)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a39_0x4f0c1e(0xc0)](_0x28f904){const _0x58e197=a39_0x4f0c1e,{options:_0x3b5e8e,args:_0x3fc4dd,tdx:_0x21989c}=_0x28f904,_0x16c303=_0x3b5e8e,_0x34eb04=await resolveTarget({'arg':_0x3fc4dd[0x0],'contextParent':_0x3b5e8e['parentSegment'],'cwd':process[_0x58e197(0x108)]()});if(!isSuccessfulResolution(_0x34eb04))return _0x34eb04['errorCode']===_0x58e197(0x12b)?(console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xde))),console[_0x58e197(0x100)](_0x58e197(0x12f)),console[_0x58e197(0x100)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x58e197(0x100)](_0x58e197(0x110))):(console[_0x58e197(0x100)](a39_0x247d52['red'](_0x58e197(0x10f)+_0x34eb04[_0x58e197(0xc3)]+'\x0a')),_0x34eb04[_0x58e197(0xd9)]&&console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x118)](_0x34eb04[_0x58e197(0xd9)]))),0x1;if(_0x34eb04[_0x58e197(0xe0)]===_0x58e197(0x13a))return console[_0x58e197(0x100)](a39_0x247d52['red'](_0x58e197(0xda)+_0x34eb04['targetDir']+'\x0a')),console[_0x58e197(0x100)](a39_0x247d52['cyan'](_0x58e197(0xaf))),0x1;const _0x212cec=_0x34eb04[_0x58e197(0xf8)],_0x52f893=_0x34eb04[_0x58e197(0xb5)],_0x559818=_0x34eb04['type']===_0x58e197(0x113)?_0x34eb04[_0x58e197(0x121)]:undefined,_0x2ec021=getScopedDetails(_0x34eb04),_0x5972a4=_0x2ec021?.[_0x58e197(0xf9)]??![],_0x5d6f66=_0x2ec021?.[_0x58e197(0x10c)]??'';if(!existsSync(_0x52f893))return console[_0x58e197(0x100)](a39_0x247d52['red'](_0x58e197(0xda)+_0x52f893+'\x0a')),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x118)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x16c303[_0x58e197(0xd3)]&&(console[_0x58e197(0x100)](_0x58e197(0x10a)+_0x16c303[_0x58e197(0x10b)]),console['error']('Parent\x20segment:\x20'+_0x212cec),console[_0x58e197(0x100)](_0x58e197(0x13f)+_0x52f893),_0x5972a4&&console[_0x58e197(0x100)](_0x58e197(0xf2)+_0x5d6f66));const _0x2b4a96=await withSpinner(_0x58e197(0x11e)+_0x212cec+_0x58e197(0xe1),()=>_0x21989c[_0x58e197(0x111)][_0x58e197(0x117)](_0x212cec),{'verbose':_0x16c303['verbose']}),_0x21acdf=_0x2b4a96['data'],{parentSegmentResult:_0x5aa1e6,segmentsResult:_0x138c41,foldersResult:_0x53d638,journeysWithDetailsResult:_0x21f1aa,userMaps:_0xf9a6b3}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x3364bd=_0x58e197,[_0x3546f5,_0x239714,_0x112f8f,_0x262119,_0xfe94ac]=await Promise[_0x3364bd(0xd8)]([_0x21989c[_0x3364bd(0x111)][_0x3364bd(0xdb)](_0x21acdf),_0x21989c['segment']['listSegments'](_0x21acdf),_0x21989c[_0x3364bd(0x111)][_0x3364bd(0xcc)](_0x21acdf),_0x21989c[_0x3364bd(0x11b)]['listJourneysWithDetailsFromParentSegment'](_0x21acdf,{'includeAllVersions':!![]}),_0x21989c[_0x3364bd(0x134)][_0x3364bd(0x11c)]()]);return{'parentSegmentResult':_0x3546f5,'segmentsResult':_0x239714,'foldersResult':_0x112f8f,'journeysWithDetailsResult':_0x262119,'userMaps':_0xfe94ac};},{'verbose':_0x16c303[_0x58e197(0xd3)]})[_0x58e197(0x145)](_0x5a9450=>_0x5a9450[_0x58e197(0xf6)]),_0x561ca4=_0x5aa1e6,_0x24d20a=extractRootFolderId(_0x561ca4),_0x3fb192=_0x138c41,_0x10d75c=_0x53d638,{journeys:_0x5814f1,activationStepsById:_0x40713d}=_0x21f1aa,_0x589efb=new Map(_0x5814f1[_0x58e197(0x138)](_0x4150f2=>[_0x4150f2['id'],_0x4150f2])),_0x2ee3bd=_0x5814f1[_0x58e197(0x138)](_0x3403c5=>({'id':_0x3403c5['id'],'name':_0x3403c5['attributes']['name'],'journeyBundleName':_0x3403c5[_0x58e197(0xbc)]['journeyBundleName']||'','journeyBundleId':_0x3403c5[_0x58e197(0xbc)]['journeyBundleId']||'','versionNumber':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0x12a)],'description':_0x3403c5[_0x58e197(0xbc)]['description'],'state':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0xef)],'paused':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0x125)],'audienceId':_0x3403c5[_0x58e197(0xbc)]['audienceId'],'folderId':_0x3403c5['relationships']?.[_0x58e197(0xfc)]?.[_0x58e197(0xf6)]?.['id'],'createdAt':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0x11a)],'updatedAt':_0x3403c5[_0x58e197(0xbc)][_0x58e197(0xbb)]})),{emailToId:_0x2a8845,idToEmail:_0x248fce}=_0xf9a6b3,_0x5df252=await withSpinner(_0x58e197(0xd7),async()=>{const _0x169513=_0x58e197,_0x38c0bc=await _0x21989c[_0x169513(0x12e)][_0x169513(0xd0)]();return buildConnectionMaps(_0x38c0bc);},{'verbose':_0x16c303[_0x58e197(0xd3)]})[_0x58e197(0x145)](_0x38d7a7=>_0x38d7a7[_0x58e197(0xf6)]),_0x33aa63=_0x5df252[_0x58e197(0xae)],_0xd33dd=_0x5df252['idToName'],_0x4be8cb=_0x5df252['nameToType'],_0x1179cd={'emailToIdMap':_0x2a8845,'connectionNameToIdMap':_0x33aa63,'connectionNameToTypeMap':_0x4be8cb,'getSchema':_0x587bd0=>_0x21989c[_0x58e197(0x12e)]['getOutputSchemaWithCache'](_0x587bd0)};let {pathToId:_0x26b5f7,idToPath:_0x39e11c}=buildFolderMaps(_0x10d75c);const _0x103dce=buildSegmentLookupMap(_0x3fb192,_0x39e11c),_0x463468=buildSegmentNameToIdMap(_0x3fb192),_0x29acf1=buildJourneyBundleLookupMap(_0x2ee3bd,_0x39e11c);let _0x30f288;if(_0x559818){if(!_0x559818[_0x58e197(0xe2)]('.yml')&&!_0x559818[_0x58e197(0xe2)](_0x58e197(0xed)))return console['error'](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xad)+_0x559818+'\x0a')),0x1;_0x30f288=[_0x559818];}else _0x30f288=findYamlFiles(_0x52f893);if(_0x30f288[_0x58e197(0xc1)]===0x0)return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x52f893+'\x0a')),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x118)](_0x58e197(0xf5))),0x1;let _0x2053d8,_0x48ccc7;try{const _0x4ab3f6=parseAndClassifyYamlFiles(_0x30f288,_0x52f893,{'skipSegments':_0x16c303['journeysOnly']});_0x2053d8=_0x4ab3f6[_0x58e197(0xf1)],_0x48ccc7=_0x4ab3f6[_0x58e197(0x133)];const _0x8a657f=validateParsedFiles(_0x4ab3f6,_0x52f893);if(_0x8a657f[_0x58e197(0xc1)]>0x0)return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0x106))),console['error'](formatValidationErrors(_0x8a657f)),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x157cb7){return console['error'](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xb4)+(_0x157cb7 instanceof Error?_0x157cb7[_0x58e197(0xc3)]:_0x157cb7))),0x1;}if(_0x2053d8[_0x58e197(0xc1)]===0x0&&_0x48ccc7['length']===0x0){const _0x3bc39e=_0x16c303[_0x58e197(0xe5)]?_0x58e197(0x11b):_0x58e197(0xc7);return console['error'](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0x114)+_0x3bc39e+'\x20YAML\x20files\x20found')),0x0;}const _0x447908=new Map();_0x3fb192[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)]&&await withSpinner(_0x58e197(0x137),async()=>{await batchAsync(_0x3fb192,async _0x51f0e3=>{const _0x16fadf=a39_0x37a0,_0x247fe9=await _0x21989c[_0x16fadf(0x111)][_0x16fadf(0xd1)](_0x21acdf,_0x51f0e3['id']);_0x447908[_0x16fadf(0xca)](_0x51f0e3['id'],_0x247fe9);});},{'verbose':_0x16c303[_0x58e197(0xd3)]});const {segmentFiles:_0x3e4137,foldersToCreate:_0x5db9ac}=await prepareSegmentFiles(_0x2053d8,{'segmentByFolderAndName':_0x103dce,'activationsBySegmentId':_0x447908,'folderPathToId':_0x26b5f7,'idToEmailMap':_0x248fce,'connectionIdToNameMap':_0xd33dd},_0x1179cd,_0x5972a4,_0x5d6f66),_0x2c6205=_0x559818?[]:findSegmentsToDelete(_0x3fb192,_0x2053d8[_0x58e197(0x138)](({yamlConfig:_0x5411b0,folderPath:_0x1b6785})=>({'yamlConfig':_0x5411b0,'folderPath':resolveTDFolderPath(_0x1b6785,_0x5972a4,_0x5d6f66)})),_0x39e11c,_0x5d6f66,_0x5972a4),{journeyFiles:_0x903edc,foldersToCreate:_0x17a69b}=await withProgressSpinner(_0x58e197(0x13b),async _0x4c845c=>prepareJourneyFiles(_0x48ccc7,{'fetchJourney':async _0x490728=>_0x21989c[_0x58e197(0x11b)][_0x58e197(0xe4)](_0x490728[_0x58e197(0xc6)]),'journeyBundlesByFolderAndName':_0x29acf1,'folderPathToId':_0x26b5f7,'idToEmailMap':_0x248fce,'connectionIdToNameMap':_0xd33dd,'existingSegments':_0x3fb192,'parentId':_0x21acdf,'deps':_0x21989c,'progress':{'update':_0xd6b8e6=>{const _0x12e1a3=_0x58e197;_0x4c845c['setPhase'](_0xd6b8e6),_0x16c303[_0x12e1a3(0xd3)]&&console[_0x12e1a3(0x100)]('\x20\x20'+_0xd6b8e6);}},'journeyById':_0x589efb,'activationStepsById':_0x40713d},_0x5972a4,_0x5d6f66),{'verbose':_0x16c303['verbose']})['then'](_0x666bab=>_0x666bab[_0x58e197(0xf6)]);for(const _0x17e892 of _0x17a69b){_0x5db9ac[_0x58e197(0x107)](_0x17e892);}const _0x5461e3=_0x559818?[]:findJourneysToDelete(_0x2ee3bd,_0x48ccc7['map'](({yamlConfig:_0x1f969d,folderPath:_0x22bbd4})=>({'yamlConfig':_0x1f969d,'folderPath':resolveTDFolderPath(_0x22bbd4,_0x5972a4,_0x5d6f66)})),_0x39e11c,_0x5d6f66,_0x5972a4),_0x207c9e=calculatePushStats(_0x3e4137,_0x903edc,_0x5db9ac,_0x2c6205,_0x5461e3,!!_0x16c303[_0x58e197(0xcb)],!!_0x16c303['journeysOnly']),_0x1ba209=_0x207c9e[_0x58e197(0xf1)][_0x58e197(0xee)],_0x11132b=_0x207c9e[_0x58e197(0xf1)][_0x58e197(0xf7)],_0x9f87f4=_0x207c9e[_0x58e197(0xf1)]['unchanged'],_0x19825a=_0x207c9e[_0x58e197(0xf1)][_0x58e197(0xab)],_0x3f956a=_0x207c9e[_0x58e197(0x102)][_0x58e197(0xcf)],_0x765293=_0x207c9e['journeys'][_0x58e197(0xee)],_0x372e88=_0x207c9e[_0x58e197(0x133)][_0x58e197(0xf7)],_0x3c4aa2=_0x207c9e['journeys'][_0x58e197(0xb9)],_0x5d76a0=_0x207c9e[_0x58e197(0x133)][_0x58e197(0xab)],_0x25a3ec=_0x207c9e[_0x58e197(0x127)]['all'],_0x25f0a7=_0x207c9e['activations']['toCreate'],_0x21f78b=_0x207c9e[_0x58e197(0x127)]['toUpdate'],_0x3ff9bb=_0x207c9e['activations']['toDelete'];console[_0x58e197(0x100)](_0x58e197(0x12c)+_0x212cec+'\x27:');_0x3f956a[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0xc2)]('📁\x20'+_0x3f956a[_0x58e197(0xc1)]+_0x58e197(0xbe)));if(!_0x16c303[_0x58e197(0xe5)]){console[_0x58e197(0x100)](_0x58e197(0xce)),console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x104)]('+\x20'+_0x1ba209[_0x58e197(0xc1)]+_0x58e197(0x123))),console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52['yellow']('~\x20'+_0x11132b[_0x58e197(0xc1)]+_0x58e197(0xb7)));if(_0x19825a[_0x58e197(0xc1)]>0x0)console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0xfe)]('-\x20'+_0x19825a['length']+_0x58e197(0x132)));else _0x2c6205[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xcb)]&&console['error'](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x130)](_0x2c6205['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x58e197(0xd6)+a39_0x247d52['dim']('=\x20'+_0x9f87f4[_0x58e197(0xc1)]+_0x58e197(0x116)));}if(_0x903edc[_0x58e197(0xc1)]>0x0||_0x5461e3[_0x58e197(0xc1)]>0x0){console[_0x58e197(0x100)](_0x58e197(0x139)),console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x104)]('+\x20'+_0x765293['length']+_0x58e197(0x123))),console['error'](_0x58e197(0xd6)+a39_0x247d52['yellow']('~\x20'+_0x372e88[_0x58e197(0xc1)]+'\x20changed'));if(_0x5d76a0['length']>0x0)console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0xfe)]('-\x20'+_0x5d76a0[_0x58e197(0xc1)]+_0x58e197(0x132)));else _0x5461e3['length']>0x0&&!_0x16c303[_0x58e197(0xcb)]&&console['error'](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x130)](_0x5461e3[_0x58e197(0xc1)]+_0x58e197(0xfa)));console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0x130)]('=\x20'+_0x3c4aa2['length']+_0x58e197(0x116)));}_0x25a3ec[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)]&&(console[_0x58e197(0x100)](''),console[_0x58e197(0x100)](_0x58e197(0x13d)),_0x25f0a7[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52['green']('+\x20'+_0x25f0a7[_0x58e197(0xc1)]+_0x58e197(0x136))),_0x21f78b[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)]('\x20\x20\x20\x20'+a39_0x247d52[_0x58e197(0xfd)]('~\x20'+_0x21f78b[_0x58e197(0xc1)]+'\x20to\x20update')),_0x3ff9bb[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)](_0x58e197(0xd6)+a39_0x247d52[_0x58e197(0xfe)]('-\x20'+_0x3ff9bb[_0x58e197(0xc1)]+'\x20to\x20delete')));console['error'](_0x58e197(0x112)+a39_0x247d52['cyan'](_0x52f893)+'\x0a');if(_0x3f956a[_0x58e197(0xc1)]>0x0){console[_0x58e197(0x100)]('Folders\x20to\x20create:');for(const _0x23bc23 of _0x3f956a){console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0xc2)]('+')+'\x20'+_0x23bc23);}console[_0x58e197(0x100)]('');}if(_0x1ba209[_0x58e197(0xc1)]>0x0&&!_0x16c303['journeysOnly'])for(const _0xe4f486 of _0x1ba209){const _0x292978=_0xe4f486[_0x58e197(0x141)]?_0xe4f486[_0x58e197(0x141)]+'/'+_0xe4f486[_0x58e197(0xb3)][_0x58e197(0x142)]:_0xe4f486[_0x58e197(0xb3)][_0x58e197(0x142)],_0x3454d5=_0xe4f486['yamlConfig'][_0x58e197(0x127)]?.[_0x58e197(0xc1)]||0x0,_0x42bed7=_0x3454d5>0x0?a39_0x247d52[_0x58e197(0x130)]('\x20['+_0x3454d5+_0x58e197(0xdf)):'';console['error']('\x0a'+a39_0x247d52[_0x58e197(0x104)](_0x58e197(0xc4))+'\x20'+_0x292978+_0x42bed7),console[_0x58e197(0x100)]('─'['repeat'](0x3c)),_0xe4f486[_0x58e197(0xc8)]&&console['error'](_0xe4f486[_0x58e197(0xc8)]),console['error']('─'['repeat'](0x3c));}if(_0x19825a['length']>0x0&&!_0x16c303['journeysOnly'])for(const _0x5bce32 of _0x19825a){const _0x4cbc3b=_0x5bce32[_0x58e197(0xb2)]?_0x39e11c['get'](_0x5bce32[_0x58e197(0xb2)][_0x58e197(0xf4)]())||'':'',_0x459d2d=_0x4cbc3b?_0x4cbc3b+'/'+_0x5bce32[_0x58e197(0x142)]:_0x5bce32[_0x58e197(0x142)],_0x1729ec=_0x447908[_0x58e197(0xeb)](_0x5bce32['id'])||[],_0x589280=_0x1729ec[_0x58e197(0xc1)]>0x0?a39_0x247d52[_0x58e197(0x130)]('\x20['+_0x1729ec[_0x58e197(0xc1)]+_0x58e197(0xdf)):'';console[_0x58e197(0x100)]('\x0a'+a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xaa))+'\x20'+_0x459d2d+_0x589280),console['error']('─'['repeat'](0x3c));const _0x31b2fb=segmentWithActivationsToYaml(_0x5bce32,_0x1729ec,undefined,_0x248fce,_0xd33dd),_0x573147=segmentToYamlString(_0x31b2fb),_0x57f6a2=generateDiff(_0x573147,'');console[_0x58e197(0x100)](formatDiffWithColors(_0x57f6a2)),console[_0x58e197(0x100)]('─'['repeat'](0x3c));}const _0x5ea346=_0x3e4137[_0x58e197(0x140)](_0x17711a=>!_0x17711a[_0x58e197(0xb6)]&&_0x17711a[_0x58e197(0xc8)]);if(_0x5ea346[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)])for(const _0xbd6c2a of _0x5ea346){const _0x28c3d8=_0xbd6c2a[_0x58e197(0x141)]?_0xbd6c2a['folderPath']+'/'+_0xbd6c2a[_0x58e197(0xb3)][_0x58e197(0x142)]:_0xbd6c2a[_0x58e197(0xb3)][_0x58e197(0x142)];console['error']('\x0a'+a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0x144))+'\x20'+_0x28c3d8),console['error']('─'[_0x58e197(0x101)](0x3c)),console[_0x58e197(0x100)](_0xbd6c2a[_0x58e197(0xc8)]),console['error']('─'[_0x58e197(0x101)](0x3c));}if(_0x765293['length']>0x0)for(const _0x96e10f of _0x765293){const _0x1f2f5a=_0x96e10f[_0x58e197(0x141)]?_0x96e10f[_0x58e197(0x141)]+'/'+_0x96e10f['yamlConfig']['name']:_0x96e10f[_0x58e197(0xb3)][_0x58e197(0x142)];console[_0x58e197(0x100)]('\x0a'+a39_0x247d52['green'](_0x58e197(0xba))+'\x20'+_0x1f2f5a),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c)),_0x96e10f[_0x58e197(0xc8)]&&console['error'](_0x96e10f[_0x58e197(0xc8)]),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c));}const _0x221ac5=_0x903edc[_0x58e197(0x140)](_0x334578=>!_0x334578[_0x58e197(0xb6)]&&_0x334578[_0x58e197(0xc8)]);if(_0x221ac5[_0x58e197(0xc1)]>0x0)for(const _0x4f0d03 of _0x221ac5){const _0x4aedb8=_0x4f0d03[_0x58e197(0x141)]?_0x4f0d03['folderPath']+'/'+_0x4f0d03[_0x58e197(0xb3)][_0x58e197(0x142)]:_0x4f0d03[_0x58e197(0xb3)][_0x58e197(0x142)];console[_0x58e197(0x100)]('\x0a'+a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0x122))+'\x20'+_0x4aedb8),console[_0x58e197(0x100)]('─'['repeat'](0x3c)),console[_0x58e197(0x100)](_0x4f0d03[_0x58e197(0xc8)]),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c));}if(_0x5d76a0[_0x58e197(0xc1)]>0x0)for(const _0x1c17f4 of _0x5d76a0){const _0x269ffd=_0x1c17f4[_0x58e197(0x10e)]?_0x39e11c['get'](_0x1c17f4[_0x58e197(0x10e)])||'':'',_0x42d106=_0x269ffd?_0x269ffd+'/'+_0x1c17f4[_0x58e197(0x119)]:_0x1c17f4[_0x58e197(0x119)];console[_0x58e197(0x100)]('\x0a'+a39_0x247d52['red'](_0x58e197(0xe8))+'\x20'+_0x42d106),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c)),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0xff))),console[_0x58e197(0x100)]('─'[_0x58e197(0x101)](0x3c));}if(_0x16c303['dryRun'])return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xe7))),0x0;const _0x4eb0e2=_0x16c303[_0x58e197(0xe5)]?![]:_0x1ba209['length']>0x0||_0x11132b[_0x58e197(0xc1)]>0x0||_0x19825a[_0x58e197(0xc1)]>0x0,_0x3cc95d=_0x765293[_0x58e197(0xc1)]>0x0||_0x372e88[_0x58e197(0xc1)]>0x0||_0x5d76a0['length']>0x0,_0x3f2958=_0x16c303[_0x58e197(0xe5)]?![]:_0x25a3ec[_0x58e197(0xc1)]>0x0,_0x428c70=_0x3f956a['length']>0x0;if(!_0x4eb0e2&&!_0x3cc95d&&!_0x3f2958&&!_0x428c70){const _0x5903f0=_0x16c303[_0x58e197(0xe5)]?_0x58e197(0xd2):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x104)](_0x5903f0));if(_0x559818&&_0x9f87f4['length']===0x1){const _0x281906=_0x9f87f4[0x0];if(_0x281906[_0x58e197(0x120)]?.['id']){const _0x59b8f0=getConsoleNextUrl(_0x16c303[_0x58e197(0x10b)],_0x58e197(0x109)+_0x21acdf+_0x58e197(0xb0)+_0x281906[_0x58e197(0x120)]['id']+_0x58e197(0x13e));console[_0x58e197(0x100)](_0x58e197(0xac)+a39_0x247d52['cyan'](_0x59b8f0));}}if(_0x559818&&_0x3c4aa2[_0x58e197(0xc1)]===0x1){const _0x1cf4e4=_0x3c4aa2[0x0];if(_0x1cf4e4['existingJourney']?.['id']){const _0x53569c=getConsoleNextUrl(_0x16c303[_0x58e197(0x10b)],'/app/ps/'+_0x21acdf+_0x58e197(0xb0)+_0x1cf4e4[_0x58e197(0x128)]['id']+'/j/da/je');console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0x118)](_0x53569c));}}return 0x0;}const _0x4326a8=_0x16c303[_0x58e197(0xe5)]?_0x765293[_0x58e197(0xc1)]+_0x372e88['length']+_0x5d76a0[_0x58e197(0xc1)]+_0x3f956a[_0x58e197(0xc1)]:_0x1ba209[_0x58e197(0xc1)]+_0x11132b[_0x58e197(0xc1)]+_0x19825a[_0x58e197(0xc1)]+_0x765293['length']+_0x372e88[_0x58e197(0xc1)]+_0x5d76a0['length']+_0x3f956a[_0x58e197(0xc1)]+_0x25a3ec[_0x58e197(0xc1)];if(!_0x16c303[_0x58e197(0xdd)]&&_0x4326a8>0x0){if(!isInteractive())return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)](_0x58e197(0x131)),_0x58e197(0xf0)),console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x130)](_0x58e197(0xfb))),0x1;const _0x5679ce=await confirmKey(_0x58e197(0x124)+_0x4326a8+_0x58e197(0xcd));if(!_0x5679ce)return console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xe3))),0x1;}const _0x2941d6={'withProgress':async(_0x3e38ae,_0x25dca6)=>{const _0x2af588=_0x58e197,_0x4b2882=await withSpinner(_0x3e38ae,_0x25dca6,{'verbose':_0x16c303['verbose']});return{'data':_0x4b2882[_0x2af588(0xf6)]};},'logInfo':_0x12975a=>console['error'](a39_0x247d52['blue']('✔\x20'+_0x12975a)),'logSuccess':_0x419633=>console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x104)]('✔\x20'+_0x419633)),'logWarning':_0x4239e6=>console['error'](a39_0x247d52[_0x58e197(0xfd)]('⚠\x20'+_0x4239e6)),'logDeleted':_0x22dff6=>console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfe)]('✔\x20'+_0x22dff6))},_0x3a5b61={'segment':_0x21989c['segment'],'journey':_0x21989c[_0x58e197(0x11b)],'user':_0x21989c['user'],'connection':_0x21989c[_0x58e197(0x12e)]};_0x3f956a[_0x58e197(0xc1)]>0x0&&(_0x26b5f7=await executePushFolders(_0x3a5b61,_0x3f956a,_0x26b5f7,{'parentId':_0x21acdf},_0x2941d6));const _0x2e9108={'rootFolderId':_0x24d20a,'folderPathToId':_0x26b5f7,'folderIdToPath':_0x39e11c,'segmentNameToId':_0x463468,'activationsBySegmentId':_0x447908,'emailToIdMap':_0x2a8845,'idToEmailMap':_0x248fce,'connectionNameToIdMap':_0x5df252[_0x58e197(0xae)],'connectionIdToNameMap':_0x5df252[_0x58e197(0x146)],'connectionNameToTypeMap':_0x4be8cb},_0x4a1691=await executePushSegments(_0x3a5b61,_0x16c303['journeysOnly']?[]:_0x3e4137,_0x2e9108,{'parentId':_0x21acdf},_0x2941d6),_0x2d9e62=_0x4a1691[_0x58e197(0xd5)],_0x3b62b9=_0x4a1691[_0x58e197(0x143)],_0x188d03=_0x4a1691['activations'][_0x58e197(0xd5)],_0x2ccc9b=_0x4a1691['activations']['updated'],_0x2f07e6=_0x4a1691[_0x58e197(0x127)][_0x58e197(0xbf)];let _0x324b60;if(_0x559818&&_0x3e4137['length']===0x1){const _0x488c74=_0x3e4137[0x0];_0x324b60=_0x488c74[_0x58e197(0x120)]?.['id']??_0x4a1691[_0x58e197(0x11d)][_0x58e197(0xeb)](_0x488c74[_0x58e197(0xb3)][_0x58e197(0x142)]);}const _0x54e034=await executePushSegmentDeletions(_0x3a5b61,_0x16c303[_0x58e197(0xe5)]?[]:_0x19825a,_0x2941d6);let _0x4b695f=0x0,_0x3996ec=0x0,_0x44b8a2=0x0;const _0x1ccdb6=new Map(_0x463468);for(const [_0x55f561,_0x30f497]of _0x4a1691[_0x58e197(0x11d)]){_0x1ccdb6[_0x58e197(0xca)](_0x55f561,_0x30f497);}if(_0x903edc[_0x58e197(0xc1)]>0x0){const _0x2d8a71={..._0x2e9108,'segmentNameToId':_0x1ccdb6,'existingSegments':_0x3fb192,'activationContext':_0x1179cd},_0x4681d8=await executePushJourneys(_0x3a5b61,_0x903edc,_0x2d8a71,{'parentId':_0x21acdf,'rootFolderId':_0x24d20a,'verbose':_0x16c303[_0x58e197(0xd3)]},_0x2941d6);_0x4b695f=_0x4681d8[_0x58e197(0xd5)],_0x3996ec=_0x4681d8['updated'];if(_0x559818&&_0x4681d8['results'][_0x58e197(0xc1)]===0x1){const _0x196133=_0x4681d8['results'][0x0];if(_0x196133[_0x58e197(0xc6)]){const _0x30c064=getConsoleNextUrl(_0x16c303['site'],'/app/ps/'+_0x21acdf+_0x58e197(0xb0)+_0x196133[_0x58e197(0xc6)]+_0x58e197(0xc5));console[_0x58e197(0x100)]('\x20\x20'+a39_0x247d52[_0x58e197(0x118)](_0x30c064));}}}for(const _0x56066b of _0x5d76a0){console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0xfd)](_0x58e197(0xc9)+_0x56066b['journeyBundleName'])),_0x44b8a2++;}const _0x4609d6=[];if(_0x2d9e62>0x0)_0x4609d6[_0x58e197(0x10d)](_0x2d9e62+_0x58e197(0xea));if(_0x3b62b9>0x0)_0x4609d6[_0x58e197(0x10d)](_0x3b62b9+_0x58e197(0x105));if(_0x54e034>0x0)_0x4609d6[_0x58e197(0x10d)](_0x54e034+_0x58e197(0x126));const _0x1d997c=[];if(_0x4b695f>0x0)_0x1d997c[_0x58e197(0x10d)](_0x4b695f+_0x58e197(0xea));if(_0x3996ec>0x0)_0x1d997c[_0x58e197(0x10d)](_0x3996ec+_0x58e197(0x105));if(_0x44b8a2>0x0)_0x1d997c[_0x58e197(0x10d)](_0x44b8a2+_0x58e197(0x126));const _0x56041e=[];if(_0x188d03>0x0)_0x56041e[_0x58e197(0x10d)](_0x188d03+'\x20created');if(_0x2ccc9b>0x0)_0x56041e['push'](_0x2ccc9b+_0x58e197(0x105));if(_0x2f07e6>0x0)_0x56041e[_0x58e197(0x10d)](_0x2f07e6+_0x58e197(0x126));console[_0x58e197(0x100)](a39_0x247d52[_0x58e197(0x104)]('\x0a✔\x20Push\x20complete'));_0x4609d6[_0x58e197(0xc1)]>0x0&&!_0x16c303[_0x58e197(0xe5)]&&console[_0x58e197(0x100)](_0x58e197(0xbd)+_0x4609d6[_0x58e197(0xe6)](',\x20'));_0x1d997c[_0x58e197(0xc1)]>0x0&&console[_0x58e197(0x100)]('\x20\x20Journeys:\x20'+_0x1d997c[_0x58e197(0xe6)](',\x20'));_0x56041e['length']>0x0&&!_0x16c303['journeysOnly']&&console[_0x58e197(0x100)](_0x58e197(0xf3)+_0x56041e[_0x58e197(0xe6)](',\x20'));if(_0x324b60){const _0x334da1=getConsoleNextUrl(_0x16c303[_0x58e197(0x10b)],_0x58e197(0x109)+_0x21acdf+_0x58e197(0xb0)+_0x324b60+_0x58e197(0x13e));console[_0x58e197(0x100)](_0x58e197(0xac)+a39_0x247d52[_0x58e197(0x118)](_0x334da1));}return 0x0;}}