@treasuredata/tdx 0.26.1 β†’ 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.js +1 -1
  121. package/dist/sdk/segment.js +1 -1
  122. package/dist/sdk/types/index.js +1 -1
  123. package/dist/sdk/types/progress.js +1 -1
  124. package/dist/sdk/user.js +1 -1
  125. package/dist/sdk/util/format-detector.js +1 -1
  126. package/dist/sdk/util/formatters.js +1 -1
  127. package/dist/sdk/util/index.js +1 -1
  128. package/dist/sdk/util/tree-formatter.js +1 -1
  129. package/dist/sdk/workflow/archive-validation.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.js +1 -1
  148. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  149. package/dist/utils/logger/formatters/index.js +1 -1
  150. package/dist/utils/logger/handlers/console-handler.js +1 -1
  151. package/dist/utils/logger/handlers/file-handler.js +1 -1
  152. package/dist/utils/logger/handlers/index.js +1 -1
  153. package/dist/utils/logger/handlers/null-handler.js +1 -1
  154. package/dist/utils/logger/index.js +1 -1
  155. package/dist/utils/logger/logger.js +1 -1
  156. package/dist/utils/logger/types.js +1 -1
  157. package/dist/utils/option-validation.js +1 -1
  158. package/dist/utils/port.js +1 -1
  159. package/dist/utils/process.js +1 -1
  160. package/dist/utils/prompt.js +1 -1
  161. package/dist/utils/spinner.js +1 -1
  162. package/dist/utils/sse-parser.js +1 -1
  163. package/dist/utils/string-utils.js +1 -1
  164. package/dist/utils/table-ref-parser.js +1 -1
  165. package/dist/utils/tdx-logger.js +1 -1
  166. package/dist/utils/version-check.js +1 -1
  167. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x48d5ba=a26_0x461c;function a26_0x461c(_0x1db0cf,_0x5a18ae){_0x1db0cf=_0x1db0cf-0x160;const _0x9e6784=a26_0x9e67();let _0x461caf=_0x9e6784[_0x1db0cf];return _0x461caf;}(function(_0x3f13c1,_0x37773f){const _0x2d54e2=a26_0x461c,_0x17692d=_0x3f13c1();while(!![]){try{const _0x5d7c66=parseInt(_0x2d54e2(0x168))/0x1*(parseInt(_0x2d54e2(0x167))/0x2)+-parseInt(_0x2d54e2(0x18a))/0x3*(-parseInt(_0x2d54e2(0x1b6))/0x4)+parseInt(_0x2d54e2(0x19e))/0x5*(parseInt(_0x2d54e2(0x1e9))/0x6)+parseInt(_0x2d54e2(0x1df))/0x7+-parseInt(_0x2d54e2(0x16b))/0x8*(-parseInt(_0x2d54e2(0x196))/0x9)+parseInt(_0x2d54e2(0x1a0))/0xa+-parseInt(_0x2d54e2(0x17f))/0xb*(parseInt(_0x2d54e2(0x1bd))/0xc);if(_0x5d7c66===_0x37773f)break;else _0x17692d['push'](_0x17692d['shift']());}catch(_0x2cc9f2){_0x17692d['push'](_0x17692d['shift']());}}}(a26_0x9e67,0x60df6));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 a26_0x313a4b from'chalk';function a26_0x9e67(){const _0x2fb1e4=['Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Creating\x20schedule:\x20','Delete\x20a\x20scheduled\x20query','substring','20xgMmAi','success','\x20(showing\x20','green','repeat','jsonl','schedule:create','12bKXzAg','time','user_name','ies','trino','m\x20ago','engineVersion','abs','queries','Schedule\x20deleted:\x20','soon','/app/queries/editor?queryId=','listQueries','schedules','Query\x20file\x20is\x20empty','\x20\x20Cron:\x20','created_at','priority','last_job','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','schedule:update','updated_at','create','cyan','output','schedule:show','Schedule\x20run\x20submitted:\x20','args','πŸ“…\x20','queryUrl','result','next_run_at','toLocaleDateString','schedule:history','5239493BJAxnb','type','json','max','length','\x20(use\x20--limit\x20to\x20see\x20more)','Deleting\x20schedule...','database','cron','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','15822MVfwHm','Updating\x20schedule:\x20','Show\x20schedule\x20execution\x20history','end_at','Update\x20a\x20scheduled\x20query','lastRun','schedule:delete','yes','format','log','limit','6Xhcmvd','70563CVwOoj','statusIcon','Updating\x20schedule...','24MaObAr','file','Creating\x20schedule...','keys','table','d\x20ago','executing_user_id','nextRun','verbose','data','user','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','...','Showing\x20first\x20','\x20\x20Job\x20ID:\x20','join','name','start_at','utf-8','show','16870887pHdkTD','list','padEnd','in\x20','retryLimit','Run\x20a\x20scheduled\x20query\x20immediately','update','timezone','execute','schedule:list','count','7527uRfzQq','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','ended_at','tsv','\x20scheduled\x20quer','\x20\x20Num:\x20','error','delay','dim','\x20matching\x20\x22','No\x20scheduled\x20queries\x20found','round','1063701wuHHXg','\x20\x20Time:\x20','INVALID_ARGUMENT','\x20\x20Type:\x20','retry_limit','h\x20ago','query','\x20schedules','270bcZWCW','just\x20now','4608090sLMDHz','run','site','trim','\x20\x20β†’\x20','from','Failed\x20to\x20read\x20file:\x20','engine_version','map','Cancelled','pagination','Show\x20schedule\x20details','num','description','status','Searching\x20scheduled\x20queries\x20matching\x20\x22','validate','entries'];a26_0x9e67=function(){return _0x2fb1e4;};return a26_0x9e67();}function formatRelativeTime(_0x1e3b96){const _0x1fa443=a26_0x461c,_0x183b4f=new Date(_0x1e3b96),_0x5f0b8e=new Date(),_0x95718=_0x183b4f['getTime']()-_0x5f0b8e['getTime'](),_0x2fdf39=Math[_0x1fa443(0x1c4)](_0x95718)/0x3e8,_0x4ad13d=_0x95718<0x0;if(_0x2fdf39<0x3c)return _0x4ad13d?_0x1fa443(0x19f):_0x1fa443(0x1c7);else{if(_0x2fdf39<0xe10){const _0x1da955=Math[_0x1fa443(0x195)](_0x2fdf39/0x3c);return _0x4ad13d?_0x1da955+_0x1fa443(0x1c2):_0x1fa443(0x182)+_0x1da955+'m';}else{if(_0x2fdf39<0x15180){const _0x4ea015=Math['round'](_0x2fdf39/0xe10);return _0x4ad13d?_0x4ea015+_0x1fa443(0x19b):_0x1fa443(0x182)+_0x4ea015+'h';}else{if(_0x2fdf39<0x93a80){const _0x278edf=Math[_0x1fa443(0x195)](_0x2fdf39/0x15180);return _0x4ad13d?_0x278edf+_0x1fa443(0x170):'in\x20'+_0x278edf+'d';}else return _0x183b4f[_0x1fa443(0x1dd)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x48d5ba(0x17b)]=a26_0x48d5ba(0x188);[a26_0x48d5ba(0x1ad)]='List\x20scheduled\x20queries';async['execute'](_0xd078c9){const _0x549501=a26_0x48d5ba,{options:_0x1947e6,args:_0x10b08f,tdx:_0x25a80e}=_0xd078c9,_0x472706=resolveLimit(_0x1947e6[_0x549501(0x166)],DEFAULT_DISPLAY_LIMIT),_0x4496e1=_0x10b08f[0x0],_0x289238=_0x4496e1?_0x549501(0x1af)+_0x4496e1+'\x22...':'Listing\x20scheduled\x20queries...',_0x45120a=await withSpinner(_0x289238,()=>_0x25a80e[_0x549501(0x1ca)][_0x549501(0x1c9)]({'limit':_0x472706,'scheduled':!![],'pattern':_0x4496e1}),{'verbose':_0x1947e6[_0x549501(0x173)]}),_0x2ea8b4=_0x45120a[_0x549501(0x174)][_0x549501(0x1c5)],_0x3139a8=_0x45120a[_0x549501(0x174)][_0x549501(0x1aa)]['has_next_page'],_0x224b5c=_0x4496e1?_0x549501(0x193)+_0x4496e1+'\x22':'';_0x3139a8?console[_0x549501(0x190)](_0x549501(0x178)+_0x2ea8b4[_0x549501(0x1e3)]+_0x549501(0x19d)+_0x224b5c+_0x549501(0x1e4)):console['error']('Found\x20'+_0x2ea8b4[_0x549501(0x1e3)]+_0x549501(0x18e)+(_0x2ea8b4[_0x549501(0x1e3)]!==0x1?_0x549501(0x1c0):'y')+_0x224b5c);if(_0x1947e6[_0x549501(0x164)]===_0x549501(0x1e1)||_0x1947e6[_0x549501(0x164)]===_0x549501(0x1bb)||_0x1947e6[_0x549501(0x164)]===_0x549501(0x16f)||_0x1947e6[_0x549501(0x164)]===_0x549501(0x18d)){const _0x1f0008=_0x2ea8b4['map'](_0x39c042=>({'id':_0x39c042['id'],'name':_0x39c042[_0x549501(0x17b)],'cron':_0x39c042[_0x549501(0x1e7)],'database':_0x39c042['database']?.[_0x549501(0x17b)],'type':_0x39c042[_0x549501(0x1e0)],'timezone':_0x39c042['time_zone'],'user_name':_0x39c042[_0x549501(0x175)]?.[_0x549501(0x17b)],'updated_at':_0x39c042[_0x549501(0x1d2)],'next_run_at':_0x39c042[_0x549501(0x1dc)],'last_job_status':_0x39c042['last_job']?.[_0x549501(0x1ae)]}));await handleSDKOutput(_0x1f0008,_0x1947e6);}else{if(_0x2ea8b4[_0x549501(0x1e3)]===0x0)console[_0x549501(0x165)](_0x549501(0x194));else{const _0x2c719a=_0x1947e6[_0x549501(0x1a2)],_0x4db918=_0x2ea8b4[_0x549501(0x1a8)](_0x137d0d=>{const _0xe25699=_0x549501,_0x2cea8d=_0x137d0d[_0xe25699(0x1cf)]?.[_0xe25699(0x1ae)]?_0x137d0d['last_job'][_0xe25699(0x1ae)]==='success'?'βœ“':'βœ—':'-',_0x268288=_0x137d0d[_0xe25699(0x1cf)]?.[_0xe25699(0x18c)]?formatRelativeTime(_0x137d0d[_0xe25699(0x1cf)][_0xe25699(0x18c)]):'never',_0x57d7bb=_0x137d0d[_0xe25699(0x1dc)]?formatRelativeTime(_0x137d0d['next_run_at']):'-',_0x4bc829=_0x137d0d[_0xe25699(0x1e7)]||'',_0x50cc82=_0x137d0d[_0xe25699(0x17b)]||'(unnamed)',_0x1135df=getConsoleUrl(_0x2c719a,_0xe25699(0x1c8)+_0x137d0d['id']);return{'statusIcon':_0x2cea8d,'lastRun':_0x268288,'nextRun':_0x57d7bb,'cron':_0x4bc829,'name':_0x50cc82,'queryUrl':_0x1135df,'status':_0x137d0d['last_job']?.[_0xe25699(0x1ae)]};}),_0x597cf0=Math[_0x549501(0x1e2)](..._0x4db918[_0x549501(0x1a8)](_0x22ec50=>_0x22ec50[_0x549501(0x161)][_0x549501(0x1e3)])),_0x614d32=Math[_0x549501(0x1e2)](..._0x4db918[_0x549501(0x1a8)](_0xa66849=>_0xa66849[_0x549501(0x172)][_0x549501(0x1e3)])),_0xe1656d=Math[_0x549501(0x1e2)](..._0x4db918['map'](_0x2e4c03=>_0x2e4c03[_0x549501(0x1e7)][_0x549501(0x1e3)])),_0x565fe4=_0x4db918[_0x549501(0x1a8)](_0x378f38=>{const _0x53fa9c=_0x549501,_0x4daf19=_0x378f38[_0x53fa9c(0x1ae)]===_0x53fa9c(0x1b7)?a26_0x313a4b[_0x53fa9c(0x1b9)](_0x378f38[_0x53fa9c(0x169)]):_0x378f38['status']===_0x53fa9c(0x190)?a26_0x313a4b['red'](_0x378f38[_0x53fa9c(0x169)]):a26_0x313a4b[_0x53fa9c(0x192)](_0x378f38[_0x53fa9c(0x169)]),_0x85b6d3=_0x378f38['lastRun'][_0x53fa9c(0x181)](_0x597cf0),_0x3e86f8=_0x378f38[_0x53fa9c(0x172)][_0x53fa9c(0x181)](_0x614d32),_0x5080c3=_0x378f38[_0x53fa9c(0x1e7)]?a26_0x313a4b[_0x53fa9c(0x1d4)](_0x378f38['cron'][_0x53fa9c(0x181)](_0xe1656d)):'\x20'[_0x53fa9c(0x1ba)](_0xe1656d),_0x2f8d7d=hyperlink(_0x378f38[_0x53fa9c(0x17b)],_0x378f38[_0x53fa9c(0x1da)]);return _0x53fa9c(0x1d9)+_0x4daf19+'\x20'+_0x85b6d3+_0x53fa9c(0x1a4)+_0x3e86f8+'\x20\x20'+_0x5080c3+'\x20\x20'+_0x2f8d7d;});await writeOutput(_0x565fe4[_0x549501(0x17a)]('\x0a'),_0x1947e6[_0x549501(0x1d5)],_0x549501(0x180));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x48d5ba(0x17b)]=a26_0x48d5ba(0x1d6);[a26_0x48d5ba(0x1ad)]=a26_0x48d5ba(0x1ab);[a26_0x48d5ba(0x1b0)](_0x2171b2){const _0x36435e=_0x2171b2['args'][0x0];if(!_0x36435e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a26_0x48d5ba(0x187)](_0x1ed753){const _0x412102=a26_0x48d5ba,{options:_0x3370d7,args:_0x253f97,tdx:_0x2cd1bd}=_0x1ed753,_0x478264=_0x253f97[0x0],_0xab3d02=await withSpinner('Getting\x20schedule\x20details...',()=>_0x2cd1bd['schedules'][_0x412102(0x17e)](_0x478264),{'verbose':_0x3370d7[_0x412102(0x173)]}),_0x3af90c=_0xab3d02[_0x412102(0x174)],_0x362913={'name':_0x3af90c[_0x412102(0x17b)],'cron':_0x3af90c[_0x412102(0x1e7)],'database':_0x3af90c[_0x412102(0x1e6)],'type':_0x3af90c[_0x412102(0x1e0)],'timezone':_0x3af90c[_0x412102(0x186)],'user_name':_0x3af90c[_0x412102(0x1bf)],'created_at':_0x3af90c[_0x412102(0x1cd)],'engine_version':_0x3af90c['engine_version'],'executing_user_id':_0x3af90c[_0x412102(0x171)],'query':_0x3af90c[_0x412102(0x19c)],'delay':_0x3af90c[_0x412102(0x191)],'priority':_0x3af90c[_0x412102(0x1ce)],'retry_limit':_0x3af90c[_0x412102(0x19a)],..._0x3af90c[_0x412102(0x1db)]&&{'result':_0x3af90c[_0x412102(0x1db)]}};return await handleSingleObjectOutput(_0x362913,_0x3370d7),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x48d5ba(0x17b)]=a26_0x48d5ba(0x1bc);[a26_0x48d5ba(0x1ad)]='Create\x20a\x20scheduled\x20query';['validate'](_0x300e47){const _0x3c13ef=_0x300e47['args'][0x0];if(!_0x3c13ef)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a26_0x48d5ba(0x187)](_0x11bc3d){const _0x39aa5c=a26_0x48d5ba,{options:_0x4ef737,args:_0x4e010f,tdx:_0x6beb76}=_0x11bc3d,_0x3ef163=_0x4e010f[0x0],_0x112014=_0x4ef737,_0x1e138e=_0x112014[_0x39aa5c(0x1e6)],_0x5020dd=_0x112014[_0x39aa5c(0x16c)],_0x4ba73f=_0x112014[_0x39aa5c(0x1e0)]||_0x39aa5c(0x1c1);let _0x46b372;try{_0x46b372=readFileSync(_0x5020dd,_0x39aa5c(0x17d))[_0x39aa5c(0x1a3)]();}catch(_0x30c594){throw new SDKError(ErrorCode[_0x39aa5c(0x198)],_0x39aa5c(0x1a6)+_0x5020dd,_0x30c594 instanceof Error?_0x30c594:undefined);}if(!_0x46b372)throw new SDKError(ErrorCode[_0x39aa5c(0x198)],_0x39aa5c(0x1cb));const _0x448f2c={'database':_0x1e138e,'query':_0x46b372,'type':_0x4ba73f};if(_0x112014[_0x39aa5c(0x1e7)])_0x448f2c[_0x39aa5c(0x1e7)]=_0x112014['cron'];if(_0x112014[_0x39aa5c(0x186)])_0x448f2c[_0x39aa5c(0x186)]=_0x112014['timezone'];if(_0x112014[_0x39aa5c(0x191)]!==undefined)_0x448f2c[_0x39aa5c(0x191)]=Number(_0x112014['delay']);if(_0x112014[_0x39aa5c(0x1ce)]!==undefined)_0x448f2c[_0x39aa5c(0x1ce)]=Number(_0x112014[_0x39aa5c(0x1ce)]);if(_0x112014[_0x39aa5c(0x183)]!==undefined)_0x448f2c[_0x39aa5c(0x19a)]=Number(_0x112014[_0x39aa5c(0x183)]);if(_0x112014[_0x39aa5c(0x1c3)])_0x448f2c[_0x39aa5c(0x1a7)]=_0x112014[_0x39aa5c(0x1c3)];if(_0x112014[_0x39aa5c(0x1db)])_0x448f2c[_0x39aa5c(0x1db)]=_0x112014['result'];if(_0x4ef737[_0x39aa5c(0x173)]){console['error'](_0x39aa5c(0x1b3)+_0x3ef163),console['error']('\x20\x20Database:\x20'+_0x1e138e),console[_0x39aa5c(0x190)](_0x39aa5c(0x199)+_0x4ba73f);if(_0x448f2c[_0x39aa5c(0x1e7)])console[_0x39aa5c(0x190)](_0x39aa5c(0x1cc)+_0x448f2c[_0x39aa5c(0x1e7)]);if(_0x448f2c[_0x39aa5c(0x186)])console['error']('\x20\x20Timezone:\x20'+_0x448f2c[_0x39aa5c(0x186)]);}const _0x23f90c=await withSpinner(_0x39aa5c(0x16d),()=>_0x6beb76[_0x39aa5c(0x1ca)][_0x39aa5c(0x1d3)](_0x3ef163,_0x448f2c),{'verbose':_0x4ef737['verbose']});return console[_0x39aa5c(0x190)]('Schedule\x20created:\x20'+_0x23f90c['data'][_0x39aa5c(0x17b)]),await handleSingleObjectOutput(_0x23f90c[_0x39aa5c(0x174)],_0x4ef737),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x48d5ba(0x17b)]=a26_0x48d5ba(0x1d1);[a26_0x48d5ba(0x1ad)]=a26_0x48d5ba(0x160);[a26_0x48d5ba(0x1b0)](_0x5f0993){const _0x3309da=a26_0x48d5ba,_0xaa337f=_0x5f0993[_0x3309da(0x1d8)][0x0];if(!_0xaa337f)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a26_0x48d5ba(0x187)](_0x228ca9){const _0x1d463a=a26_0x48d5ba,{options:_0x2dfba1,args:_0x51c677,tdx:_0x179797}=_0x228ca9,_0x1173d0=_0x51c677[0x0],_0x3ee5dc=_0x2dfba1,_0x35b8e9={};if(_0x3ee5dc['database'])_0x35b8e9[_0x1d463a(0x1e6)]=_0x3ee5dc[_0x1d463a(0x1e6)];if(_0x3ee5dc[_0x1d463a(0x1e0)])_0x35b8e9['type']=_0x3ee5dc[_0x1d463a(0x1e0)];if(_0x3ee5dc[_0x1d463a(0x1e7)])_0x35b8e9['cron']=_0x3ee5dc[_0x1d463a(0x1e7)];if(_0x3ee5dc[_0x1d463a(0x186)])_0x35b8e9['timezone']=_0x3ee5dc[_0x1d463a(0x186)];if(_0x3ee5dc[_0x1d463a(0x191)]!==undefined)_0x35b8e9[_0x1d463a(0x191)]=Number(_0x3ee5dc[_0x1d463a(0x191)]);if(_0x3ee5dc['priority']!==undefined)_0x35b8e9['priority']=Number(_0x3ee5dc[_0x1d463a(0x1ce)]);if(_0x3ee5dc[_0x1d463a(0x183)]!==undefined)_0x35b8e9[_0x1d463a(0x19a)]=Number(_0x3ee5dc[_0x1d463a(0x183)]);if(_0x3ee5dc['engineVersion'])_0x35b8e9['engine_version']=_0x3ee5dc[_0x1d463a(0x1c3)];if(_0x3ee5dc[_0x1d463a(0x1db)])_0x35b8e9['result']=_0x3ee5dc[_0x1d463a(0x1db)];if(_0x3ee5dc[_0x1d463a(0x16c)])try{_0x35b8e9[_0x1d463a(0x19c)]=readFileSync(_0x3ee5dc[_0x1d463a(0x16c)],'utf-8')[_0x1d463a(0x1a3)]();}catch(_0x155a66){throw new SDKError(ErrorCode[_0x1d463a(0x198)],'Failed\x20to\x20read\x20file:\x20'+_0x3ee5dc[_0x1d463a(0x16c)],_0x155a66 instanceof Error?_0x155a66:undefined);}if(Object[_0x1d463a(0x16e)](_0x35b8e9)['length']===0x0)throw new SDKError(ErrorCode[_0x1d463a(0x198)],_0x1d463a(0x18b));if(_0x2dfba1[_0x1d463a(0x173)]){console[_0x1d463a(0x190)](_0x1d463a(0x1ea)+_0x1173d0);for(const [_0x451f29,_0x7d8557]of Object[_0x1d463a(0x1b1)](_0x35b8e9)){_0x451f29===_0x1d463a(0x19c)?console['error']('\x20\x20'+_0x451f29+':\x20'+_0x7d8557[_0x1d463a(0x1b5)](0x0,0x32)+_0x1d463a(0x177)):console[_0x1d463a(0x190)]('\x20\x20'+_0x451f29+':\x20'+_0x7d8557);}}const _0x9d3680=await withSpinner(_0x1d463a(0x16a),()=>_0x179797[_0x1d463a(0x1ca)][_0x1d463a(0x185)](_0x1173d0,_0x35b8e9),{'verbose':_0x2dfba1[_0x1d463a(0x173)]});return console['error']('Schedule\x20updated:\x20'+_0x9d3680[_0x1d463a(0x174)][_0x1d463a(0x17b)]),await handleSingleObjectOutput(_0x9d3680[_0x1d463a(0x174)],_0x2dfba1),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a26_0x48d5ba(0x162);[a26_0x48d5ba(0x1ad)]=a26_0x48d5ba(0x1b4);[a26_0x48d5ba(0x1b0)](_0x41fa1b){const _0x364572=a26_0x48d5ba,_0x57bf0c=_0x41fa1b[_0x364572(0x1d8)][0x0];if(!_0x57bf0c)return _0x364572(0x176);return undefined;}async['execute'](_0x45078a){const _0x44382e=a26_0x48d5ba,{options:_0x36b189,args:_0x5780db,tdx:_0x558b00}=_0x45078a,_0xf71f02=_0x5780db[0x0];if(!_0x36b189[_0x44382e(0x163)]){const _0x5587ea=await confirm(_0x44382e(0x1b2)+_0xf71f02+'\x22?');if(!_0x5587ea)return console[_0x44382e(0x190)](_0x44382e(0x1a9)),0x0;}const _0x191dc5=await withSpinner(_0x44382e(0x1e5),()=>_0x558b00['schedules']['delete'](_0xf71f02),{'verbose':_0x36b189['verbose']});return console[_0x44382e(0x190)](_0x44382e(0x1c6)+_0x191dc5['data'][_0x44382e(0x17b)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x48d5ba(0x17b)]='schedule:run';[a26_0x48d5ba(0x1ad)]=a26_0x48d5ba(0x184);[a26_0x48d5ba(0x1b0)](_0x25d5d4){const _0x15ecb9=a26_0x48d5ba,_0x5b9184=_0x25d5d4[_0x15ecb9(0x1d8)][0x0];if(!_0x5b9184)return _0x15ecb9(0x1d0);return undefined;}async[a26_0x48d5ba(0x187)](_0x3886fa){const _0xf8cd0e=a26_0x48d5ba,{options:_0x4026de,args:_0x45b514,tdx:_0x498834}=_0x3886fa,_0x555bb3=_0x45b514[0x0],_0x4d8c09=_0x4026de,_0xdb4b0c=_0x4d8c09[_0xf8cd0e(0x1be)],_0x4f8081=_0x4d8c09[_0xf8cd0e(0x1ac)]!==undefined?Number(_0x4d8c09[_0xf8cd0e(0x1ac)]):undefined;if(_0x4026de['verbose']){console[_0xf8cd0e(0x190)]('Running\x20schedule:\x20'+_0x555bb3);if(_0xdb4b0c)console[_0xf8cd0e(0x190)](_0xf8cd0e(0x197)+_0xdb4b0c);if(_0x4f8081)console[_0xf8cd0e(0x190)](_0xf8cd0e(0x18f)+_0x4f8081);}const _0x570f14=await withSpinner('Running\x20schedule...',()=>_0x498834[_0xf8cd0e(0x1ca)][_0xf8cd0e(0x1a1)](_0x555bb3,{'time':_0xdb4b0c,'num':_0x4f8081}),{'verbose':_0x4026de[_0xf8cd0e(0x173)]}),_0xc33b54=_0x570f14[_0xf8cd0e(0x174)]['jobs'];console[_0xf8cd0e(0x190)](_0xf8cd0e(0x1d7)+_0xc33b54[_0xf8cd0e(0x1e3)]+'\x20job'+(_0xc33b54[_0xf8cd0e(0x1e3)]!==0x1?'s':'')+'\x20created');for(const _0x5eab8d of _0xc33b54){console['error'](_0xf8cd0e(0x179)+_0x5eab8d['job_id']);}return await handleSDKOutput(_0xc33b54,_0x4026de),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x48d5ba(0x17b)]=a26_0x48d5ba(0x1de);[a26_0x48d5ba(0x1ad)]=a26_0x48d5ba(0x1eb);[a26_0x48d5ba(0x1b0)](_0x48a699){const _0x2954a7=a26_0x48d5ba,_0x4e3a1f=_0x48a699['args'][0x0];if(!_0x4e3a1f)return _0x2954a7(0x1e8);return undefined;}async['execute'](_0x5ba7c8){const _0xab9549=a26_0x48d5ba,{options:_0x4a89d3,args:_0x44f406,tdx:_0x3c2712}=_0x5ba7c8,_0x5a2cea=_0x44f406[0x0],_0x482bfa=_0x4a89d3,_0x1b7290=_0x482bfa[_0xab9549(0x1a5)]!==undefined?Number(_0x482bfa['from']):undefined,_0x3c5249=_0x482bfa['to']!==undefined?Number(_0x482bfa['to']):undefined,_0x42eaf8=await withSpinner('Getting\x20schedule\x20history...',()=>_0x3c2712[_0xab9549(0x1ca)]['history'](_0x5a2cea,{'from':_0x1b7290,'to':_0x3c5249}),{'verbose':_0x4a89d3[_0xab9549(0x173)]}),_0x327a35=_0x42eaf8['data'];console['error']('Found\x20'+_0x327a35[_0xab9549(0x189)]+'\x20execution'+(_0x327a35['count']!==0x1?'s':'')+_0xab9549(0x1b8)+_0x327a35[_0xab9549(0x1a5)]+'-'+_0x327a35['to']+')');const _0x30d071=_0x327a35['history'][_0xab9549(0x1a8)](_0x255541=>({'job_id':_0x255541['job_id'],'type':_0x255541[_0xab9549(0x1e0)],'status':_0x255541['status'],'scheduled_at':_0x255541['scheduled_at'],'created_at':_0x255541[_0xab9549(0x1cd)],'start_at':_0x255541[_0xab9549(0x17c)],'end_at':_0x255541[_0xab9549(0x1ec)]}));return await handleSDKOutput(_0x30d071,_0x4a89d3),0x0;}}
1
+ const a26_0x5449f7=a26_0x3f49;(function(_0x385acd,_0x4708a0){const _0x54da83=a26_0x3f49,_0x1cf25f=_0x385acd();while(!![]){try{const _0x45bf92=-parseInt(_0x54da83(0x229))/0x1+parseInt(_0x54da83(0x21e))/0x2*(parseInt(_0x54da83(0x1cc))/0x3)+-parseInt(_0x54da83(0x1e0))/0x4*(parseInt(_0x54da83(0x1e3))/0x5)+parseInt(_0x54da83(0x1fb))/0x6+parseInt(_0x54da83(0x208))/0x7+parseInt(_0x54da83(0x1d2))/0x8+parseInt(_0x54da83(0x22e))/0x9*(parseInt(_0x54da83(0x22d))/0xa);if(_0x45bf92===_0x4708a0)break;else _0x1cf25f['push'](_0x1cf25f['shift']());}catch(_0x5e9961){_0x1cf25f['push'](_0x1cf25f['shift']());}}}(a26_0x4dcd,0x5eaab));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';function a26_0x4dcd(){const _0x2f2505=['dim','created_at','delay','pagination','user_name','args','name','retry_limit','priority','πŸ“…\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','1578885vZtKhW','query','timezone','Found\x20','just\x20now','create','user','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Failed\x20to\x20read\x20file:\x20','result','utf-8','cyan','trim','Show\x20schedule\x20execution\x20history','validate','job_id','Query\x20file\x20is\x20empty','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Schedule\x20run\x20submitted:\x20','tsv','Deleting\x20schedule...','52QdfTAx','site','nextRun','repeat','getTime','list','has_next_page','Schedule\x20updated:\x20','from','format','Updating\x20schedule:\x20','680926RkAUxD','\x20\x20Job\x20ID:\x20','num','engineVersion','70fAWgGv','1160820gtcDBx','status','schedule:delete','Update\x20a\x20scheduled\x20query','trino','log','queryUrl','round','in\x20','start_at','database','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','yes','executing_user_id','success','json','engine_version','last_job','Listing\x20scheduled\x20queries...','ies','Getting\x20schedule\x20details...','padEnd','Creating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','ended_at','length','\x20\x20Cron:\x20','schedule:history','\x20\x20Time:\x20','schedule:show','\x20(showing\x20','limit','\x22...','scheduled_at','error','listQueries','d\x20ago','\x20matching\x20\x22','\x20\x20β†’\x20','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','31449eXwHSl','No\x20scheduled\x20queries\x20found','INVALID_ARGUMENT','\x20schedules','\x20\x20Database:\x20','time_zone','738656QtNNbV','count','Searching\x20scheduled\x20queries\x20matching\x20\x22','history','execute','map','statusIcon','Showing\x20first\x20','soon','retryLimit','\x20(use\x20--limit\x20to\x20see\x20more)','output','verbose','...','4jPoTIj','\x20execution','schedule:create','2470410jgkFCL','next_run_at','description','lastRun','show','Show\x20schedule\x20details','m\x20ago','schedule:update','Delete\x20a\x20scheduled\x20query','Running\x20schedule:\x20','entries','data','h\x20ago','\x20\x20Num:\x20','cron','type','green','\x20\x20Timezone:\x20','time','toLocaleDateString','schedules','Schedule\x20deleted:\x20','delete','\x20created','416748UqCCnx','file'];a26_0x4dcd=function(){return _0x2f2505;};return a26_0x4dcd();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x1b9a6a from'chalk';function a26_0x3f49(_0x376299,_0x550c69){_0x376299=_0x376299-0x1c0;const _0x4dcde6=a26_0x4dcd();let _0x3f498c=_0x4dcde6[_0x376299];return _0x3f498c;}function formatRelativeTime(_0x40cc82){const _0x2da0d5=a26_0x3f49,_0x21ab25=new Date(_0x40cc82),_0x2cd1bf=new Date(),_0x46f3ed=_0x21ab25[_0x2da0d5(0x222)]()-_0x2cd1bf[_0x2da0d5(0x222)](),_0x1b1640=Math['abs'](_0x46f3ed)/0x3e8,_0x556ef4=_0x46f3ed<0x0;if(_0x1b1640<0x3c)return _0x556ef4?_0x2da0d5(0x20c):_0x2da0d5(0x1da);else{if(_0x1b1640<0xe10){const _0x22725a=Math[_0x2da0d5(0x235)](_0x1b1640/0x3c);return _0x556ef4?_0x22725a+_0x2da0d5(0x1e9):_0x2da0d5(0x236)+_0x22725a+'m';}else{if(_0x1b1640<0x15180){const _0x4e1d09=Math[_0x2da0d5(0x235)](_0x1b1640/0xe10);return _0x556ef4?_0x4e1d09+_0x2da0d5(0x1ef):_0x2da0d5(0x236)+_0x4e1d09+'h';}else{if(_0x1b1640<0x93a80){const _0x5b4bc2=Math['round'](_0x1b1640/0x15180);return _0x556ef4?_0x5b4bc2+_0x2da0d5(0x1c8):_0x2da0d5(0x236)+_0x5b4bc2+'d';}else return _0x21ab25[_0x2da0d5(0x1f6)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x5449f7(0x203)]='schedule:list';['description']='List\x20scheduled\x20queries';async[a26_0x5449f7(0x1d6)](_0x516a80){const _0x3c52c1=a26_0x5449f7,{options:_0x370fb9,args:_0x33422c,tdx:_0x8cea06}=_0x516a80,_0x34e90a=resolveLimit(_0x370fb9[_0x3c52c1(0x1c3)],DEFAULT_DISPLAY_LIMIT),_0x418f36=_0x33422c[0x0],_0x107e03=_0x418f36?_0x3c52c1(0x1d4)+_0x418f36+_0x3c52c1(0x1c4):_0x3c52c1(0x240),_0x236cc4=await withSpinner(_0x107e03,()=>_0x8cea06['schedules'][_0x3c52c1(0x1c7)]({'limit':_0x34e90a,'scheduled':!![],'pattern':_0x418f36}),{'verbose':_0x370fb9[_0x3c52c1(0x1de)]}),_0x1c1aa9=_0x236cc4['data']['queries'],_0x4279ce=_0x236cc4[_0x3c52c1(0x1ee)][_0x3c52c1(0x200)][_0x3c52c1(0x224)],_0x2cfc1f=_0x418f36?_0x3c52c1(0x1c9)+_0x418f36+'\x22':'';_0x4279ce?console[_0x3c52c1(0x1c6)](_0x3c52c1(0x1d9)+_0x1c1aa9[_0x3c52c1(0x247)]+_0x3c52c1(0x1cf)+_0x2cfc1f+_0x3c52c1(0x1dc)):console[_0x3c52c1(0x1c6)](_0x3c52c1(0x20b)+_0x1c1aa9['length']+'\x20scheduled\x20quer'+(_0x1c1aa9[_0x3c52c1(0x247)]!==0x1?_0x3c52c1(0x241):'y')+_0x2cfc1f);if(_0x370fb9['format']===_0x3c52c1(0x23d)||_0x370fb9[_0x3c52c1(0x227)]==='jsonl'||_0x370fb9[_0x3c52c1(0x227)]==='table'||_0x370fb9[_0x3c52c1(0x227)]===_0x3c52c1(0x21c)){const _0x20e38a=_0x1c1aa9[_0x3c52c1(0x1d7)](_0x574f14=>({'id':_0x574f14['id'],'name':_0x574f14[_0x3c52c1(0x203)],'cron':_0x574f14['cron'],'database':_0x574f14['database']?.[_0x3c52c1(0x203)],'type':_0x574f14[_0x3c52c1(0x1f2)],'timezone':_0x574f14[_0x3c52c1(0x1d1)],'user_name':_0x574f14[_0x3c52c1(0x20e)]?.[_0x3c52c1(0x203)],'updated_at':_0x574f14['updated_at'],'next_run_at':_0x574f14[_0x3c52c1(0x1e4)],'last_job_status':_0x574f14[_0x3c52c1(0x23f)]?.['status']}));await handleSDKOutput(_0x20e38a,_0x370fb9);}else{if(_0x1c1aa9['length']===0x0)console[_0x3c52c1(0x233)](_0x3c52c1(0x1cd));else{const _0x58a1e9=_0x370fb9[_0x3c52c1(0x21f)],_0x12a960=_0x1c1aa9[_0x3c52c1(0x1d7)](_0x381d2b=>{const _0x969913=_0x3c52c1,_0x52cd47=_0x381d2b[_0x969913(0x23f)]?.[_0x969913(0x22f)]?_0x381d2b[_0x969913(0x23f)][_0x969913(0x22f)]===_0x969913(0x23c)?'βœ“':'βœ—':'-',_0x410d84=_0x381d2b[_0x969913(0x23f)]?.['ended_at']?formatRelativeTime(_0x381d2b[_0x969913(0x23f)][_0x969913(0x246)]):'never',_0x289e7e=_0x381d2b[_0x969913(0x1e4)]?formatRelativeTime(_0x381d2b[_0x969913(0x1e4)]):'-',_0x1f174b=_0x381d2b[_0x969913(0x1f1)]||'',_0x5bd383=_0x381d2b[_0x969913(0x203)]||'(unnamed)',_0x3d2af9=getConsoleUrl(_0x58a1e9,'/app/queries/editor?queryId='+_0x381d2b['id']);return{'statusIcon':_0x52cd47,'lastRun':_0x410d84,'nextRun':_0x289e7e,'cron':_0x1f174b,'name':_0x5bd383,'queryUrl':_0x3d2af9,'status':_0x381d2b[_0x969913(0x23f)]?.[_0x969913(0x22f)]};}),_0x3383be=Math['max'](..._0x12a960[_0x3c52c1(0x1d7)](_0x5055b9=>_0x5055b9[_0x3c52c1(0x1e6)][_0x3c52c1(0x247)])),_0x1c4dae=Math['max'](..._0x12a960[_0x3c52c1(0x1d7)](_0x366eb7=>_0x366eb7[_0x3c52c1(0x220)]['length'])),_0x4728bc=Math['max'](..._0x12a960[_0x3c52c1(0x1d7)](_0x5004e0=>_0x5004e0['cron'][_0x3c52c1(0x247)])),_0x55dd22=_0x12a960[_0x3c52c1(0x1d7)](_0x36c52c=>{const _0x991ee=_0x3c52c1,_0x3b3d7c=_0x36c52c[_0x991ee(0x22f)]===_0x991ee(0x23c)?a26_0x1b9a6a[_0x991ee(0x1f3)](_0x36c52c['statusIcon']):_0x36c52c[_0x991ee(0x22f)]===_0x991ee(0x1c6)?a26_0x1b9a6a['red'](_0x36c52c[_0x991ee(0x1d8)]):a26_0x1b9a6a[_0x991ee(0x1fd)](_0x36c52c['statusIcon']),_0xe53ddb=_0x36c52c[_0x991ee(0x1e6)][_0x991ee(0x243)](_0x3383be),_0x548cd3=_0x36c52c[_0x991ee(0x220)][_0x991ee(0x243)](_0x1c4dae),_0x49a69e=_0x36c52c['cron']?a26_0x1b9a6a[_0x991ee(0x213)](_0x36c52c[_0x991ee(0x1f1)][_0x991ee(0x243)](_0x4728bc)):'\x20'[_0x991ee(0x221)](_0x4728bc),_0x2f92f0=hyperlink(_0x36c52c['name'],_0x36c52c[_0x991ee(0x234)]);return _0x991ee(0x206)+_0x3b3d7c+'\x20'+_0xe53ddb+_0x991ee(0x1ca)+_0x548cd3+'\x20\x20'+_0x49a69e+'\x20\x20'+_0x2f92f0;});await writeOutput(_0x55dd22['join']('\x0a'),_0x370fb9[_0x3c52c1(0x1dd)],_0x3c52c1(0x223));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x5449f7(0x203)]=a26_0x5449f7(0x1c1);['description']=a26_0x5449f7(0x1e8);[a26_0x5449f7(0x216)](_0x2a806c){const _0x5ddafb=a26_0x5449f7,_0x127ac2=_0x2a806c['args'][0x0];if(!_0x127ac2)return _0x5ddafb(0x207);return undefined;}async[a26_0x5449f7(0x1d6)](_0x44a91d){const _0x10c66a=a26_0x5449f7,{options:_0x4b4a08,args:_0x233950,tdx:_0x175b28}=_0x44a91d,_0x222db3=_0x233950[0x0],_0x2cb419=await withSpinner(_0x10c66a(0x242),()=>_0x175b28[_0x10c66a(0x1f7)][_0x10c66a(0x1e7)](_0x222db3),{'verbose':_0x4b4a08[_0x10c66a(0x1de)]}),_0x32d3df=_0x2cb419[_0x10c66a(0x1ee)],_0x5072ec={'name':_0x32d3df['name'],'cron':_0x32d3df['cron'],'database':_0x32d3df[_0x10c66a(0x238)],'type':_0x32d3df[_0x10c66a(0x1f2)],'timezone':_0x32d3df[_0x10c66a(0x20a)],'user_name':_0x32d3df[_0x10c66a(0x201)],'created_at':_0x32d3df[_0x10c66a(0x1fe)],'engine_version':_0x32d3df[_0x10c66a(0x23e)],'executing_user_id':_0x32d3df[_0x10c66a(0x23b)],'query':_0x32d3df[_0x10c66a(0x209)],'delay':_0x32d3df[_0x10c66a(0x1ff)],'priority':_0x32d3df[_0x10c66a(0x205)],'retry_limit':_0x32d3df[_0x10c66a(0x204)],..._0x32d3df[_0x10c66a(0x211)]&&{'result':_0x32d3df['result']}};return await handleSingleObjectOutput(_0x5072ec,_0x4b4a08),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x5449f7(0x203)]=a26_0x5449f7(0x1e2);[a26_0x5449f7(0x1e5)]='Create\x20a\x20scheduled\x20query';[a26_0x5449f7(0x216)](_0x4800e8){const _0x2f9889=a26_0x5449f7,_0x49b804=_0x4800e8[_0x2f9889(0x202)][0x0];if(!_0x49b804)return _0x2f9889(0x21a);return undefined;}async[a26_0x5449f7(0x1d6)](_0x27d0e0){const _0x50915e=a26_0x5449f7,{options:_0x7326f9,args:_0x150484,tdx:_0x1347fe}=_0x27d0e0,_0x29bef2=_0x150484[0x0],_0x2dca06=_0x7326f9,_0x5bfa47=_0x2dca06[_0x50915e(0x238)],_0x570dad=_0x2dca06[_0x50915e(0x1fc)],_0x1c6ea6=_0x2dca06[_0x50915e(0x1f2)]||_0x50915e(0x232);let _0x5bda7b;try{_0x5bda7b=readFileSync(_0x570dad,_0x50915e(0x212))[_0x50915e(0x214)]();}catch(_0x1eccd3){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x50915e(0x210)+_0x570dad,_0x1eccd3 instanceof Error?_0x1eccd3:undefined);}if(!_0x5bda7b)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x50915e(0x218));const _0x3ec070={'database':_0x5bfa47,'query':_0x5bda7b,'type':_0x1c6ea6};if(_0x2dca06['cron'])_0x3ec070[_0x50915e(0x1f1)]=_0x2dca06[_0x50915e(0x1f1)];if(_0x2dca06['timezone'])_0x3ec070[_0x50915e(0x20a)]=_0x2dca06[_0x50915e(0x20a)];if(_0x2dca06[_0x50915e(0x1ff)]!==undefined)_0x3ec070['delay']=Number(_0x2dca06[_0x50915e(0x1ff)]);if(_0x2dca06[_0x50915e(0x205)]!==undefined)_0x3ec070[_0x50915e(0x205)]=Number(_0x2dca06['priority']);if(_0x2dca06[_0x50915e(0x1db)]!==undefined)_0x3ec070[_0x50915e(0x204)]=Number(_0x2dca06[_0x50915e(0x1db)]);if(_0x2dca06[_0x50915e(0x22c)])_0x3ec070[_0x50915e(0x23e)]=_0x2dca06[_0x50915e(0x22c)];if(_0x2dca06['result'])_0x3ec070[_0x50915e(0x211)]=_0x2dca06[_0x50915e(0x211)];if(_0x7326f9['verbose']){console[_0x50915e(0x1c6)]('Creating\x20schedule:\x20'+_0x29bef2),console[_0x50915e(0x1c6)](_0x50915e(0x1d0)+_0x5bfa47),console[_0x50915e(0x1c6)]('\x20\x20Type:\x20'+_0x1c6ea6);if(_0x3ec070[_0x50915e(0x1f1)])console[_0x50915e(0x1c6)](_0x50915e(0x248)+_0x3ec070['cron']);if(_0x3ec070['timezone'])console[_0x50915e(0x1c6)](_0x50915e(0x1f4)+_0x3ec070[_0x50915e(0x20a)]);}const _0x1f61b1=await withSpinner(_0x50915e(0x244),()=>_0x1347fe[_0x50915e(0x1f7)][_0x50915e(0x20d)](_0x29bef2,_0x3ec070),{'verbose':_0x7326f9[_0x50915e(0x1de)]});return console[_0x50915e(0x1c6)]('Schedule\x20created:\x20'+_0x1f61b1[_0x50915e(0x1ee)][_0x50915e(0x203)]),await handleSingleObjectOutput(_0x1f61b1[_0x50915e(0x1ee)],_0x7326f9),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a26_0x5449f7(0x1ea);[a26_0x5449f7(0x1e5)]=a26_0x5449f7(0x231);[a26_0x5449f7(0x216)](_0x2911a0){const _0x3a7f4c=a26_0x5449f7,_0x2fe390=_0x2911a0[_0x3a7f4c(0x202)][0x0];if(!_0x2fe390)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async['execute'](_0x1f8ed4){const _0x936aff=a26_0x5449f7,{options:_0xaf59e7,args:_0x3a4731,tdx:_0x20eb68}=_0x1f8ed4,_0x1177dc=_0x3a4731[0x0],_0x66191f=_0xaf59e7,_0x5896a7={};if(_0x66191f[_0x936aff(0x238)])_0x5896a7[_0x936aff(0x238)]=_0x66191f[_0x936aff(0x238)];if(_0x66191f[_0x936aff(0x1f2)])_0x5896a7[_0x936aff(0x1f2)]=_0x66191f[_0x936aff(0x1f2)];if(_0x66191f[_0x936aff(0x1f1)])_0x5896a7[_0x936aff(0x1f1)]=_0x66191f[_0x936aff(0x1f1)];if(_0x66191f[_0x936aff(0x20a)])_0x5896a7[_0x936aff(0x20a)]=_0x66191f[_0x936aff(0x20a)];if(_0x66191f[_0x936aff(0x1ff)]!==undefined)_0x5896a7[_0x936aff(0x1ff)]=Number(_0x66191f[_0x936aff(0x1ff)]);if(_0x66191f[_0x936aff(0x205)]!==undefined)_0x5896a7['priority']=Number(_0x66191f[_0x936aff(0x205)]);if(_0x66191f['retryLimit']!==undefined)_0x5896a7[_0x936aff(0x204)]=Number(_0x66191f[_0x936aff(0x1db)]);if(_0x66191f[_0x936aff(0x22c)])_0x5896a7[_0x936aff(0x23e)]=_0x66191f[_0x936aff(0x22c)];if(_0x66191f[_0x936aff(0x211)])_0x5896a7['result']=_0x66191f[_0x936aff(0x211)];if(_0x66191f[_0x936aff(0x1fc)])try{_0x5896a7[_0x936aff(0x209)]=readFileSync(_0x66191f[_0x936aff(0x1fc)],_0x936aff(0x212))[_0x936aff(0x214)]();}catch(_0x2e561c){throw new SDKError(ErrorCode[_0x936aff(0x1ce)],_0x936aff(0x210)+_0x66191f[_0x936aff(0x1fc)],_0x2e561c instanceof Error?_0x2e561c:undefined);}if(Object['keys'](_0x5896a7)['length']===0x0)throw new SDKError(ErrorCode[_0x936aff(0x1ce)],_0x936aff(0x1cb));if(_0xaf59e7[_0x936aff(0x1de)]){console[_0x936aff(0x1c6)](_0x936aff(0x228)+_0x1177dc);for(const [_0x3e1d5a,_0x1eaf31]of Object[_0x936aff(0x1ed)](_0x5896a7)){_0x3e1d5a===_0x936aff(0x209)?console[_0x936aff(0x1c6)]('\x20\x20'+_0x3e1d5a+':\x20'+_0x1eaf31['substring'](0x0,0x32)+_0x936aff(0x1df)):console[_0x936aff(0x1c6)]('\x20\x20'+_0x3e1d5a+':\x20'+_0x1eaf31);}}const _0x4434a9=await withSpinner('Updating\x20schedule...',()=>_0x20eb68[_0x936aff(0x1f7)]['update'](_0x1177dc,_0x5896a7),{'verbose':_0xaf59e7[_0x936aff(0x1de)]});return console[_0x936aff(0x1c6)](_0x936aff(0x225)+_0x4434a9['data'][_0x936aff(0x203)]),await handleSingleObjectOutput(_0x4434a9['data'],_0xaf59e7),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x5449f7(0x203)]=a26_0x5449f7(0x230);['description']=a26_0x5449f7(0x1eb);[a26_0x5449f7(0x216)](_0xfd53c9){const _0x38a2e0=a26_0x5449f7,_0x505c6c=_0xfd53c9[_0x38a2e0(0x202)][0x0];if(!_0x505c6c)return _0x38a2e0(0x245);return undefined;}async[a26_0x5449f7(0x1d6)](_0x5d10c3){const _0x51d070=a26_0x5449f7,{options:_0x16768b,args:_0x294325,tdx:_0x18252c}=_0x5d10c3,_0x573724=_0x294325[0x0];if(!_0x16768b[_0x51d070(0x23a)]){const _0x28b6f4=await confirm(_0x51d070(0x219)+_0x573724+'\x22?');if(!_0x28b6f4)return console['error']('Cancelled'),0x0;}const _0x4f9bb6=await withSpinner(_0x51d070(0x21d),()=>_0x18252c[_0x51d070(0x1f7)][_0x51d070(0x1f9)](_0x573724),{'verbose':_0x16768b[_0x51d070(0x1de)]});return console[_0x51d070(0x1c6)](_0x51d070(0x1f8)+_0x4f9bb6[_0x51d070(0x1ee)][_0x51d070(0x203)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x5449f7(0x203)]='schedule:run';[a26_0x5449f7(0x1e5)]='Run\x20a\x20scheduled\x20query\x20immediately';[a26_0x5449f7(0x216)](_0x9a549d){const _0x19786a=a26_0x5449f7,_0x4ae39d=_0x9a549d[_0x19786a(0x202)][0x0];if(!_0x4ae39d)return _0x19786a(0x239);return undefined;}async['execute'](_0x43d518){const _0x452886=a26_0x5449f7,{options:_0x2bc923,args:_0x2c4422,tdx:_0x4df2a0}=_0x43d518,_0x56290d=_0x2c4422[0x0],_0x5b5e14=_0x2bc923,_0xa5c3a5=_0x5b5e14[_0x452886(0x1f5)],_0x2344f5=_0x5b5e14[_0x452886(0x22b)]!==undefined?Number(_0x5b5e14['num']):undefined;if(_0x2bc923[_0x452886(0x1de)]){console[_0x452886(0x1c6)](_0x452886(0x1ec)+_0x56290d);if(_0xa5c3a5)console['error'](_0x452886(0x1c0)+_0xa5c3a5);if(_0x2344f5)console[_0x452886(0x1c6)](_0x452886(0x1f0)+_0x2344f5);}const _0x8839f=await withSpinner('Running\x20schedule...',()=>_0x4df2a0[_0x452886(0x1f7)]['run'](_0x56290d,{'time':_0xa5c3a5,'num':_0x2344f5}),{'verbose':_0x2bc923[_0x452886(0x1de)]}),_0x4d2ca0=_0x8839f[_0x452886(0x1ee)]['jobs'];console[_0x452886(0x1c6)](_0x452886(0x21b)+_0x4d2ca0[_0x452886(0x247)]+'\x20job'+(_0x4d2ca0[_0x452886(0x247)]!==0x1?'s':'')+_0x452886(0x1fa));for(const _0xf64212 of _0x4d2ca0){console[_0x452886(0x1c6)](_0x452886(0x22a)+_0xf64212['job_id']);}return await handleSDKOutput(_0x4d2ca0,_0x2bc923),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x5449f7(0x203)]=a26_0x5449f7(0x249);[a26_0x5449f7(0x1e5)]=a26_0x5449f7(0x215);[a26_0x5449f7(0x216)](_0x11f83b){const _0x201d80=a26_0x5449f7,_0xc5ea65=_0x11f83b[_0x201d80(0x202)][0x0];if(!_0xc5ea65)return _0x201d80(0x20f);return undefined;}async[a26_0x5449f7(0x1d6)](_0x244540){const _0x1cabf0=a26_0x5449f7,{options:_0x6692f3,args:_0x190ea3,tdx:_0x23641e}=_0x244540,_0x23a447=_0x190ea3[0x0],_0xcd411b=_0x6692f3,_0x3ad240=_0xcd411b[_0x1cabf0(0x226)]!==undefined?Number(_0xcd411b[_0x1cabf0(0x226)]):undefined,_0x4138d0=_0xcd411b['to']!==undefined?Number(_0xcd411b['to']):undefined,_0x43fc4a=await withSpinner('Getting\x20schedule\x20history...',()=>_0x23641e[_0x1cabf0(0x1f7)][_0x1cabf0(0x1d5)](_0x23a447,{'from':_0x3ad240,'to':_0x4138d0}),{'verbose':_0x6692f3['verbose']}),_0x4acaba=_0x43fc4a['data'];console['error'](_0x1cabf0(0x20b)+_0x4acaba[_0x1cabf0(0x1d3)]+_0x1cabf0(0x1e1)+(_0x4acaba['count']!==0x1?'s':'')+_0x1cabf0(0x1c2)+_0x4acaba[_0x1cabf0(0x226)]+'-'+_0x4acaba['to']+')');const _0x2dac06=_0x4acaba['history'][_0x1cabf0(0x1d7)](_0x1ee491=>({'job_id':_0x1ee491[_0x1cabf0(0x217)],'type':_0x1ee491[_0x1cabf0(0x1f2)],'status':_0x1ee491['status'],'scheduled_at':_0x1ee491[_0x1cabf0(0x1c5)],'created_at':_0x1ee491[_0x1cabf0(0x1fe)],'start_at':_0x1ee491[_0x1cabf0(0x237)],'end_at':_0x1ee491['end_at']}));return await handleSDKOutput(_0x2dac06,_0x6692f3),0x0;}}
@@ -1 +1 @@
1
- const a27_0x4ad3fa=a27_0x45bb;function a27_0x297f(){const _0x12078f=['βœ”\x20Found\x20','format','Usage:\x20tdx\x20sg\x20sql\x20<name>','execute','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Resolving\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Resolved\x20type:\x20','835880rRNNQG','Resolving\x20path\x20\x27','\x20\x20Cause:\x20','\x20[Job\x20ID:\x20','resolvePathToResource','SEGMENT_FOLDER_NOT_FOUND','Site:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment:folder:show','Use:\x20tdx\x20ps\x20view\x20-w','Fetching\x20parent\x20segment\x20details...','Create\x20segment\x20folder\x20for\x20organization','Get\x20SQL\x20query\x20for\x20child\x20segment','Use:\x20tdx\x20ps\x20show','limit','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20view','92277LamUwp','getParent','\x20\x20Folder\x20path:\x20','236536sJISjC','json','Parent\x20name:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Parent\x20segment:\x20','data','parent','in\x20','Resolved\x20parent\x20folder\x20ID:\x20','\x20folder','Segment\x20ID:\x20','Creating\x20folder\x20\x27','Show\x20segment\x20folder\x20details','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','type','parentId','\x20Opening\x20','code','Error:\x20','25vzhGSk','trim','folderId','/e/','βœ–\x20Query\x20failed\x20[','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','(root)','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','includes','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','length','SQL\x20query:\x0a','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Parent\x20ID:\x20','Executing\x20segment\x20query...','Resolved\x20relative\x20path\x20to:\x20','segment:folder:create','replace','segmentId','\x20\x20Segment\x20name:\x20','description','Show\x20segment\x20or\x20folder\x20details','\x20\x20Parent\x20segment:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','getSegmentSQL','Examples:','createFolder','error','\x20\x20Full\x20path:\x20','Target\x20path:\x20','message','parentSegment','segmentPath','cause','getSegment','resolveFolderId','/app/ps/','segment:sql','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20SQL\x20for\x20segment...','130884gZrsEc','Resolving\x20folder\x20\x27','getFolder','test','stats','setJobId','information_schema','Folder\x20ID:\x20','name','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','2484902wocqJX','701193NYRjbf','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','fullPath','\x27...','Listing\x20folders\x20for\x20parent\x20\x27','url','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','query','24197976aevzck','folder','segment:desc','site','Usage:\x20tdx\x20sg\x20desc\x20<name>','listFolders','verbose','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','18yqRwjN','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','segment','Folder\x20name:\x20','segment:view','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Resolved\x20folder\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27\x20with\x20ID:\x20','toLocaleString','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20sg\x20show\x20<name>','parentFolder','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Show\x20child\x20segment\x20schema\x20(column\x20types)','segmentName','Options:','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','jsonl','web','cyan','INVALID_ARGUMENT','Resolved\x20parent\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','SEGMENT_NOT_FOUND','Fetching\x20segment\x20details...','Segment\x20ID\x20missing\x20from\x20resolved\x20path','resolveParentId','βœ”\x20Query\x20completed:\x20Processed\x20','processedRows'];a27_0x297f=function(){return _0x12078f;};return a27_0x297f();}(function(_0x208e70,_0x21a61a){const _0x2ef6af=a27_0x45bb,_0x29a8e3=_0x208e70();while(!![]){try{const _0x314253=parseInt(_0x2ef6af(0xbf))/0x1*(-parseInt(_0x2ef6af(0x11f))/0x2)+parseInt(_0x2ef6af(0x10b))/0x3+parseInt(_0x2ef6af(0x148))/0x4*(-parseInt(_0x2ef6af(0xd5))/0x5)+-parseInt(_0x2ef6af(0x100))/0x6+-parseInt(_0x2ef6af(0x10a))/0x7+-parseInt(_0x2ef6af(0xc2))/0x8+parseInt(_0x2ef6af(0x116))/0x9;if(_0x314253===_0x21a61a)break;else _0x29a8e3['push'](_0x29a8e3['shift']());}catch(_0x2c3c59){_0x29a8e3['push'](_0x29a8e3['shift']());}}}(a27_0x297f,0x9c6ad));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x54a151 from'chalk';async function resolveSegmentTarget(_0x2ac9a2,_0x3dccbf,_0x2959f6){const _0x128e57=a27_0x45bb;if(isYamlFilePath(_0x2ac9a2))try{const _0x16d973=await resolveYamlFilePath(_0x2ac9a2);return _0x2959f6&&(console['error'](_0x128e57(0x113)+_0x2ac9a2),console[_0x128e57(0xf1)](_0x128e57(0xec)+_0x16d973[_0x128e57(0xf5)]),console[_0x128e57(0xf1)](_0x128e57(0xe9)+_0x16d973[_0x128e57(0x12e)]),console['error'](_0x128e57(0xc1)+(_0x16d973['folderPath']||_0x128e57(0xdb))),console[_0x128e57(0xf1)](_0x128e57(0xf2)+_0x16d973['fullPath'])),_0x16d973[_0x128e57(0x10d)];}catch(_0x339723){throw new SDKError(ErrorCode[_0x128e57(0x135)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x339723['message']);}if(!_0x3dccbf)throw new SDKError(ErrorCode[_0x128e57(0x135)],_0x128e57(0xcf));return _0x3dccbf+'/'+_0x2ac9a2;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x4ad3fa(0x108)]='segment:describe';[a27_0x4ad3fa(0xea)]=a27_0x4ad3fa(0xeb);async[a27_0x4ad3fa(0x141)](_0x5d21b2){const _0x39af95=a27_0x4ad3fa,{options:_0x489a99,args:_0x2b2853,tdx:_0x323d17}=_0x5d21b2,_0x34de97=_0x2b2853[0x0],_0x415f20=!_0x34de97&&!!_0x489a99[_0x39af95(0xf5)],_0x2017ff=_0x34de97||_0x489a99[_0x39af95(0xf5)];if(!_0x2017ff)return console[_0x39af95(0xf1)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x39af95(0xf1)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error'](_0x39af95(0xef)),console[_0x39af95(0xf1)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x39af95(0xf1)](_0x39af95(0x137)),console[_0x39af95(0xf1)](_0x39af95(0x145)),console[_0x39af95(0xf1)](_0x39af95(0xb5)),0x1;try{const _0x541c3b=_0x489a99[_0x39af95(0xf6)];let _0x1c579f=_0x2017ff;!_0x415f20&&_0x541c3b&&!_0x2017ff[_0x39af95(0xdd)]('/')&&(_0x1c579f=_0x541c3b+'/'+_0x2017ff,_0x489a99[_0x39af95(0x11c)]&&console[_0x39af95(0xf1)](_0x39af95(0xe5)+_0x1c579f));const _0x8b51eb=await withSpinner(_0x39af95(0x149)+_0x1c579f+_0x39af95(0x10e),()=>_0x323d17[_0x39af95(0x121)][_0x39af95(0xb2)](_0x1c579f),{'verbose':_0x489a99[_0x39af95(0x11c)]}),_0x271e0e=_0x8b51eb[_0x39af95(0xc7)];_0x489a99[_0x39af95(0x11c)]&&(console[_0x39af95(0xf1)]('Resolved\x20type:\x20'+_0x271e0e[_0x39af95(0xd0)]),console[_0x39af95(0xf1)](_0x39af95(0xe3)+_0x271e0e['parentId']),_0x271e0e[_0x39af95(0xd7)]&&console[_0x39af95(0xf1)](_0x39af95(0x107)+_0x271e0e[_0x39af95(0xd7)]),_0x271e0e['segmentId']&&console['error'](_0x39af95(0xcc)+_0x271e0e['segmentId']));if(_0x271e0e['type']===_0x39af95(0xc8)){const _0x74908f=await withSpinner(_0x39af95(0xb8),()=>_0x323d17[_0x39af95(0x121)][_0x39af95(0xc0)](_0x271e0e['parentId']),{'verbose':_0x489a99[_0x39af95(0x11c)]});await handleSingleObjectOutput(_0x74908f['data'],_0x489a99);}else{if(_0x271e0e[_0x39af95(0xd0)]===_0x39af95(0x117)){if(!_0x271e0e[_0x39af95(0xd7)])throw new SDKError(ErrorCode[_0x39af95(0xb3)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x17a5bd=await withSpinner(_0x39af95(0x142),()=>_0x323d17['segment'][_0x39af95(0x102)](_0x271e0e[_0x39af95(0xd7)]),{'verbose':_0x489a99['verbose']});await handleSingleObjectOutput(_0x17a5bd[_0x39af95(0xc7)],_0x489a99);}else{if(_0x271e0e[_0x39af95(0xd0)]===_0x39af95(0x121)){if(!_0x271e0e[_0x39af95(0xe8)])throw new SDKError(ErrorCode[_0x39af95(0x138)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x130d4c=await withSpinner(_0x39af95(0x139),()=>_0x323d17[_0x39af95(0x121)]['getSegment'](_0x271e0e[_0x39af95(0xd1)],_0x271e0e[_0x39af95(0xe8)]),{'verbose':_0x489a99[_0x39af95(0x11c)]});await handleSingleObjectOutput(_0x130d4c[_0x39af95(0xc7)],_0x489a99);}}}return 0x0;}catch(_0x5271cf){if(_0x5271cf instanceof SDKError)return console[_0x39af95(0xf1)](_0x39af95(0xd4)+_0x5271cf[_0x39af95(0xf4)]),_0x5271cf[_0x39af95(0xf7)]&&console[_0x39af95(0xf1)](_0x39af95(0xb0)+_0x5271cf[_0x39af95(0xf7)]),0x1;throw _0x5271cf;}}}function a27_0x45bb(_0x1e5877,_0x2bb62d){_0x1e5877=_0x1e5877-0xb0;const _0x297f22=a27_0x297f();let _0x45bb66=_0x297f22[_0x1e5877];return _0x45bb66;}export class SegmentShowCommand extends BaseCommand{[a27_0x4ad3fa(0x108)]='segment:show';[a27_0x4ad3fa(0xea)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x4ad3fa(0x141)](_0x36b012){const _0x303b69=a27_0x4ad3fa,{options:_0x330fec,args:_0x1eb069,tdx:_0x35a6fc}=_0x36b012,_0x141f28=_0x1eb069[0x0];if(!_0x141f28)return console['error'](_0x303b69(0xed)),console[_0x303b69(0xf1)](_0x303b69(0x12a)),console[_0x303b69(0xf1)](_0x303b69(0xda)),console[_0x303b69(0xf1)]('Examples:'),console[_0x303b69(0xf1)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error'](_0x303b69(0x120)),0x1;try{const _0x3aeea0=_0x330fec[_0x303b69(0xf5)],_0x36ba85=await resolveSegmentTarget(_0x141f28,_0x3aeea0,_0x330fec['verbose']);_0x330fec[_0x303b69(0x11c)]&&console[_0x303b69(0xf1)](_0x303b69(0xf3)+_0x36ba85);const _0x3b8da1=await withSpinner('Resolving\x20\x27'+_0x141f28+_0x303b69(0x10e),()=>_0x35a6fc[_0x303b69(0x121)][_0x303b69(0xb2)](_0x36ba85),{'verbose':_0x330fec[_0x303b69(0x11c)]}),_0x1708ec=_0x3b8da1[_0x303b69(0xc7)];_0x330fec['verbose']&&(console[_0x303b69(0xf1)]('Resolved\x20type:\x20'+_0x1708ec['type']),console[_0x303b69(0xf1)](_0x303b69(0xe3)+_0x1708ec[_0x303b69(0xd1)]));if(_0x1708ec[_0x303b69(0xd0)]===_0x303b69(0x117))return console[_0x303b69(0xf1)](_0x303b69(0x131)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x1708ec[_0x303b69(0xd0)]==='parent')return console[_0x303b69(0xf1)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x303b69(0xbb)),0x1;if(!_0x1708ec[_0x303b69(0xe8)])throw new SDKError(ErrorCode[_0x303b69(0x138)],_0x303b69(0x13a));const _0x5d46da=await withSpinner(_0x303b69(0xff),()=>_0x35a6fc[_0x303b69(0x121)][_0x303b69(0xee)](_0x1708ec[_0x303b69(0xd1)],_0x1708ec[_0x303b69(0xe8)]),{'verbose':_0x330fec[_0x303b69(0x11c)]});let _0x44d54a=_0x5d46da[_0x303b69(0xc7)];const _0xd04273=resolveLimit(_0x330fec[_0x303b69(0xbc)],DEFAULT_DISPLAY_LIMIT),_0x5c55ba=/\bLIMIT\s+\d+/i[_0x303b69(0x103)](_0x44d54a);!_0x5c55ba&&(_0x44d54a=_0x44d54a[_0x303b69(0xd6)]()[_0x303b69(0xe7)](/;+$/,''),_0x44d54a='SELECT\x20*\x20FROM\x20(\x0a'+_0x44d54a+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0xd04273);_0x330fec['verbose']&&console[_0x303b69(0xf1)](_0x303b69(0xe1)+_0x44d54a);const _0x4afad1=await withProgressSpinner(_0x303b69(0xe4),async _0x1e93d2=>{const _0x40957e=_0x303b69,_0x47c657=await _0x35a6fc[_0x40957e(0x115)]['execute'](_0x44d54a,{'catalog':'td','schema':_0x40957e(0x106),'onJobId':_0x89ff4a=>{const _0x46ad53=_0x40957e;_0x1e93d2[_0x46ad53(0x105)](_0x89ff4a);}});return _0x47c657;},{'verbose':_0x330fec[_0x303b69(0x11c)]}),_0x12111c=_0x4afad1[_0x303b69(0xc7)],_0x640b16=_0x12111c['jobId']?_0x303b69(0xb1)+_0x12111c['jobId']+']':'';return console[_0x303b69(0xf1)](_0x303b69(0x13c)+_0x12111c[_0x303b69(0x104)][_0x303b69(0x13d)][_0x303b69(0x128)]()+'\x20rows\x20'+(_0x303b69(0xc9)+formatElapsed(_0x12111c[_0x303b69(0x104)]['elapsedTimeMillis'])+_0x640b16)),await handleQueryOutput(_0x12111c,_0x330fec),0x0;}catch(_0x1cb887){if(_0x1cb887 instanceof SDKError)return console[_0x303b69(0xf1)](_0x303b69(0xd9)+_0x1cb887[_0x303b69(0xd3)]+']'),console['error']('\x0a'+_0x1cb887[_0x303b69(0xf4)]),0x1;throw _0x1cb887;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a27_0x4ad3fa(0xea)]=a27_0x4ad3fa(0xe2);async['execute'](_0x555dbd){const _0x3d74c3=a27_0x4ad3fa,{options:_0x4d66a9,args:_0x37d9f7,tdx:_0x581836}=_0x555dbd;if(_0x37d9f7[_0x3d74c3(0xe0)]===0x0)return console['error'](_0x3d74c3(0x126)),console[_0x3d74c3(0xf1)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x26ce61=_0x37d9f7[0x0];try{_0x4d66a9['verbose']&&(console[_0x3d74c3(0xf1)](_0x3d74c3(0xb4)+_0x4d66a9[_0x3d74c3(0x119)]),console[_0x3d74c3(0xf1)](_0x3d74c3(0xc4)+_0x26ce61));const _0x280bc8=await withSpinner(_0x3d74c3(0x129)+_0x26ce61+_0x3d74c3(0x10e),()=>_0x581836[_0x3d74c3(0x121)][_0x3d74c3(0x13b)](_0x26ce61),{'verbose':_0x4d66a9[_0x3d74c3(0x11c)]}),_0x9ee2a8=_0x280bc8[_0x3d74c3(0xc7)];_0x4d66a9[_0x3d74c3(0x11c)]&&console['error'](_0x3d74c3(0x136)+_0x9ee2a8);const _0xf90b69=await withSpinner(_0x3d74c3(0x10f)+_0x26ce61+_0x3d74c3(0x10e),()=>_0x581836[_0x3d74c3(0x121)][_0x3d74c3(0x11b)](_0x9ee2a8),{'verbose':_0x4d66a9[_0x3d74c3(0x11c)]}),_0x34f4bc=_0xf90b69['data'];return console[_0x3d74c3(0xf1)](_0x3d74c3(0x13e)+_0x34f4bc[_0x3d74c3(0xe0)]+_0x3d74c3(0xcb)+(_0x34f4bc[_0x3d74c3(0xe0)]!==0x1?'s':'')),await handleSDKOutput(_0x34f4bc,_0x4d66a9),0x0;}catch(_0x464307){if(_0x464307 instanceof SDKError)return console[_0x3d74c3(0xf1)](_0x3d74c3(0xd4)+_0x464307['message']),_0x464307['cause']&&console[_0x3d74c3(0xf1)]('\x20\x20Cause:\x20'+_0x464307[_0x3d74c3(0xf7)]),0x1;throw _0x464307;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a27_0x4ad3fa(0xb6);[a27_0x4ad3fa(0xea)]=a27_0x4ad3fa(0xce);async[a27_0x4ad3fa(0x141)](_0x37a7ce){const _0x55419f=a27_0x4ad3fa,{options:_0x2c8d10,args:_0x3409bf,tdx:_0x3851c2}=_0x37a7ce;if(_0x3409bf[_0x55419f(0xe0)]===0x0)return console[_0x55419f(0xf1)]('Error:\x20Folder\x20reference\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x223044,childId:_0x4af582}=parseSegmentRef(_0x3409bf[0x0]);_0x2c8d10[_0x55419f(0x11c)]&&(console[_0x55419f(0xf1)](_0x55419f(0xb4)+_0x2c8d10[_0x55419f(0x119)]),console[_0x55419f(0xf1)]('Parent\x20name:\x20'+_0x223044),_0x4af582&&console[_0x55419f(0xf1)]('Folder\x20name:\x20'+_0x4af582));if(!_0x4af582)return console[_0x55419f(0xf1)](_0x55419f(0xde)),0x1;const _0x477021=await withSpinner(_0x55419f(0x129)+_0x223044+'\x27...',()=>_0x3851c2['segment'][_0x55419f(0x13b)](_0x223044),{'verbose':_0x2c8d10[_0x55419f(0x11c)]}),_0x4b4a81=_0x477021['data'];_0x2c8d10['verbose']&&console[_0x55419f(0xf1)](_0x55419f(0x136)+_0x4b4a81);const _0x3f0e30=await withSpinner(_0x55419f(0x101)+_0x4af582+_0x55419f(0x10e),()=>_0x3851c2[_0x55419f(0x121)][_0x55419f(0xf9)](_0x4b4a81,_0x4af582),{'verbose':_0x2c8d10[_0x55419f(0x11c)]}),_0x381f52=_0x3f0e30[_0x55419f(0xc7)];_0x2c8d10[_0x55419f(0x11c)]&&console[_0x55419f(0xf1)](_0x55419f(0x125)+_0x381f52);const _0x488787=await withSpinner('Fetching\x20folder\x20\x27'+_0x4af582+_0x55419f(0x10e),()=>_0x3851c2[_0x55419f(0x121)][_0x55419f(0x102)](_0x381f52),{'verbose':_0x2c8d10['verbose']});return await handleSDKOutput([_0x488787[_0x55419f(0xc7)]],_0x2c8d10),0x0;}catch(_0x44141b){if(_0x44141b instanceof SDKError)return console[_0x55419f(0xf1)]('Error:\x20'+_0x44141b[_0x55419f(0xf4)]),_0x44141b[_0x55419f(0xf7)]&&console[_0x55419f(0xf1)](_0x55419f(0xb0)+_0x44141b[_0x55419f(0xf7)]),0x1;throw _0x44141b;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x4ad3fa(0x108)]=a27_0x4ad3fa(0xfb);['description']=a27_0x4ad3fa(0xba);async[a27_0x4ad3fa(0x141)](_0x28da7b){const _0x6c17a=a27_0x4ad3fa,{options:_0x5136b7,args:_0x2c3ecb,tdx:_0x30e6f3}=_0x28da7b,_0x519c56=_0x2c3ecb[0x0];if(!_0x519c56)return console[_0x6c17a(0xf1)](_0x6c17a(0xed)),console[_0x6c17a(0xf1)](_0x6c17a(0x140)),console[_0x6c17a(0xf1)](_0x6c17a(0x112)),console[_0x6c17a(0xf1)](_0x6c17a(0xef)),console[_0x6c17a(0xf1)](_0x6c17a(0x130)),console[_0x6c17a(0xf1)](_0x6c17a(0xdc)),0x1;try{const _0x152a6a=_0x5136b7['parentSegment'],_0x16f022=await resolveSegmentTarget(_0x519c56,_0x152a6a,_0x5136b7['verbose']);_0x5136b7['verbose']&&console[_0x6c17a(0xf1)](_0x6c17a(0xf3)+_0x16f022);const _0x72a353=await withSpinner(_0x6c17a(0x144)+_0x519c56+_0x6c17a(0x10e),()=>_0x30e6f3['segment'][_0x6c17a(0xb2)](_0x16f022),{'verbose':_0x5136b7[_0x6c17a(0x11c)]}),_0x30134f=_0x72a353[_0x6c17a(0xc7)];_0x5136b7[_0x6c17a(0x11c)]&&(console[_0x6c17a(0xf1)](_0x6c17a(0x147)+_0x30134f[_0x6c17a(0xd0)]),console[_0x6c17a(0xf1)](_0x6c17a(0xe3)+_0x30134f[_0x6c17a(0xd1)]));if(_0x30134f['type']===_0x6c17a(0x117))return console['error'](_0x6c17a(0x114)),console[_0x6c17a(0xf1)](_0x6c17a(0x109)),0x1;if(_0x30134f[_0x6c17a(0xd0)]===_0x6c17a(0xc8))return console['error'](_0x6c17a(0xfe)),console[_0x6c17a(0xf1)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x30134f['segmentId'])throw new SDKError(ErrorCode[_0x6c17a(0x138)],_0x6c17a(0x13a));const _0x59cb4c=await withSpinner(_0x6c17a(0xff),()=>_0x30e6f3['segment']['getSegmentSQL'](_0x30134f[_0x6c17a(0xd1)],_0x30134f['segmentId']),{'verbose':_0x5136b7[_0x6c17a(0x11c)]}),_0x4b8386=_0x59cb4c[_0x6c17a(0xc7)];return _0x5136b7[_0x6c17a(0x13f)]===_0x6c17a(0xc3)||_0x5136b7['format']===_0x6c17a(0x132)?await handleSDKOutput([{'sql':_0x4b8386}],_0x5136b7):console['log'](_0x4b8386),0x0;}catch(_0x30b9b2){if(_0x30b9b2 instanceof SDKError)return console[_0x6c17a(0xf1)](_0x6c17a(0xd4)+_0x30b9b2[_0x6c17a(0xf4)]),_0x30b9b2['cause']&&console[_0x6c17a(0xf1)](_0x6c17a(0xb0)+_0x30b9b2[_0x6c17a(0xf7)]),0x1;throw _0x30b9b2;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x4ad3fa(0x108)]=a27_0x4ad3fa(0xe6);[a27_0x4ad3fa(0xea)]=a27_0x4ad3fa(0xb9);async[a27_0x4ad3fa(0x141)](_0xd8f1f0){const _0x59f4a2=a27_0x4ad3fa,{options:_0x3bc79e,args:_0x268863,tdx:_0x2df106}=_0xd8f1f0,_0x313134=_0x3bc79e;if(_0x268863['length']<0x2)return console['error'](_0x59f4a2(0xfd)),console[_0x59f4a2(0xf1)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x221006=_0x268863[0x0],_0x599d3d=_0x268863[0x1];_0x313134['verbose']&&(console[_0x59f4a2(0xf1)](_0x59f4a2(0xb4)+_0x313134[_0x59f4a2(0x119)]),console[_0x59f4a2(0xf1)](_0x59f4a2(0xc6)+_0x221006),console[_0x59f4a2(0xf1)](_0x59f4a2(0x122)+_0x599d3d));let _0x50c74c;if(_0x313134[_0x59f4a2(0x12b)]){const _0x14682=_0x313134[_0x59f4a2(0x12b)],_0x211ee6=await withSpinner(_0x59f4a2(0x129)+_0x221006+_0x59f4a2(0x10e),()=>_0x2df106[_0x59f4a2(0x121)]['resolveParentId'](_0x221006),{'verbose':_0x313134[_0x59f4a2(0x11c)]}),_0x1d7674=_0x211ee6[_0x59f4a2(0xc7)],_0x23cb01=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x14682+_0x59f4a2(0x10e),()=>_0x2df106[_0x59f4a2(0x121)][_0x59f4a2(0xf9)](_0x1d7674,_0x14682),{'verbose':_0x313134['verbose']});_0x50c74c=_0x23cb01['data'],_0x313134['verbose']&&console['error'](_0x59f4a2(0xca)+_0x50c74c);}const _0x19b273={'name':_0x599d3d,'description':_0x313134[_0x59f4a2(0xea)],'parentFolderId':_0x50c74c},_0x321ba1=await withSpinner(_0x59f4a2(0xcd)+_0x599d3d+_0x59f4a2(0x10e),()=>_0x2df106[_0x59f4a2(0x121)][_0x59f4a2(0xf0)](_0x221006,_0x19b273),{'verbose':_0x313134[_0x59f4a2(0x11c)]}),_0x45d77b=_0x321ba1[_0x59f4a2(0xc7)];return console[_0x59f4a2(0xf1)]('βœ”\x20Created\x20folder\x20\x27'+_0x45d77b[_0x59f4a2(0x108)]+_0x59f4a2(0x127)+_0x45d77b['id']),await handleSDKOutput([_0x45d77b],_0x313134),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x4ad3fa(0x108)]=a27_0x4ad3fa(0x123);[a27_0x4ad3fa(0xea)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a27_0x4ad3fa(0x141)](_0x4d6604){const _0x4636a1=a27_0x4ad3fa,{options:_0x854db6,args:_0x37462e,tdx:_0x41f885}=_0x4d6604,_0x4be1f3=_0x37462e[0x0];if(!_0x4be1f3)return console[_0x4636a1(0xf1)](_0x4636a1(0x124)),console[_0x4636a1(0xf1)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console['error'](_0x4636a1(0xfc)),console[_0x4636a1(0xf1)](_0x4636a1(0x12f)),console[_0x4636a1(0xf1)](_0x4636a1(0x12c)),console[_0x4636a1(0xf1)](_0x4636a1(0xef)),console[_0x4636a1(0xf1)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x4636a1(0xf1)](_0x4636a1(0x10c)),console[_0x4636a1(0xf1)](_0x4636a1(0xdf)),0x1;try{const _0x57f4ef=_0x854db6['parentSegment'],_0x3ce2ba=await resolveSegmentTarget(_0x4be1f3,_0x57f4ef,_0x854db6[_0x4636a1(0x11c)]);_0x854db6['verbose']&&console[_0x4636a1(0xf1)](_0x4636a1(0xf3)+_0x3ce2ba);const _0x47fd76=await withSpinner(_0x4636a1(0x144)+_0x4be1f3+_0x4636a1(0x10e),()=>_0x41f885[_0x4636a1(0x121)][_0x4636a1(0xb2)](_0x3ce2ba),{'verbose':_0x854db6['verbose']}),_0x15b587=_0x47fd76[_0x4636a1(0xc7)];_0x854db6[_0x4636a1(0x11c)]&&(console[_0x4636a1(0xf1)]('Resolved\x20type:\x20'+_0x15b587[_0x4636a1(0xd0)]),console[_0x4636a1(0xf1)](_0x4636a1(0xe3)+_0x15b587[_0x4636a1(0xd1)]),_0x15b587[_0x4636a1(0xd7)]&&console['error'](_0x4636a1(0x107)+_0x15b587[_0x4636a1(0xd7)]),_0x15b587[_0x4636a1(0xe8)]&&console[_0x4636a1(0xf1)](_0x4636a1(0xcc)+_0x15b587[_0x4636a1(0xe8)]));if(_0x854db6[_0x4636a1(0x133)]){if(_0x15b587[_0x4636a1(0xd0)]===_0x4636a1(0x117))return console[_0x4636a1(0xf1)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x15b587['type']==='parent')return console['error'](_0x4636a1(0x11d)),console[_0x4636a1(0xf1)](_0x4636a1(0xb7)),0x1;if(!_0x15b587[_0x4636a1(0xe8)])throw new SDKError(ErrorCode[_0x4636a1(0x138)],_0x4636a1(0x13a));const _0x55d219=getConsoleNextUrl(_0x854db6[_0x4636a1(0x119)],_0x4636a1(0xfa)+_0x15b587[_0x4636a1(0xd1)]+_0x4636a1(0xd8)+_0x15b587[_0x4636a1(0xe8)]);return console[_0x4636a1(0xf1)](a27_0x54a151[_0x4636a1(0x111)]('βœ”')+_0x4636a1(0xd2)+a27_0x54a151[_0x4636a1(0x134)](_0x55d219)),openBrowser(_0x55d219),0x0;}if(_0x15b587[_0x4636a1(0xd0)]===_0x4636a1(0x117)){if(!_0x15b587[_0x4636a1(0xd7)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x4636a1(0xc5));const _0x420de1=await withSpinner(_0x4636a1(0x142),()=>_0x41f885[_0x4636a1(0x121)][_0x4636a1(0x102)](_0x15b587[_0x4636a1(0xd7)]),{'verbose':_0x854db6[_0x4636a1(0x11c)]});await handleSingleObjectOutput(_0x420de1[_0x4636a1(0xc7)],_0x854db6);}else{if(_0x15b587[_0x4636a1(0xd0)]===_0x4636a1(0x121)){if(!_0x15b587['segmentId'])throw new SDKError(ErrorCode[_0x4636a1(0x138)],_0x4636a1(0x13a));const _0x324809=await withSpinner(_0x4636a1(0x139),()=>_0x41f885[_0x4636a1(0x121)][_0x4636a1(0xf8)](_0x15b587[_0x4636a1(0xd1)],_0x15b587[_0x4636a1(0xe8)]),{'verbose':_0x854db6[_0x4636a1(0x11c)]}),_0x26a33b=getConsoleNextUrl(_0x854db6[_0x4636a1(0x119)],_0x4636a1(0xfa)+_0x15b587[_0x4636a1(0xd1)]+'/e/'+_0x15b587[_0x4636a1(0xe8)]),_0x3232f2=_0x324809[_0x4636a1(0xc7)];_0x3232f2[_0x4636a1(0x110)]=_0x26a33b,await handleSingleObjectOutput(_0x3232f2,_0x854db6);}else return console[_0x4636a1(0xf1)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x4636a1(0xbe)),0x1;}return 0x0;}catch(_0x1cfe67){if(_0x1cfe67 instanceof SDKError)return console[_0x4636a1(0xf1)](_0x4636a1(0xd4)+_0x1cfe67[_0x4636a1(0xf4)]),_0x1cfe67[_0x4636a1(0xf7)]&&console[_0x4636a1(0xf1)]('\x20\x20Cause:\x20'+_0x1cfe67[_0x4636a1(0xf7)]),0x1;throw _0x1cfe67;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x4ad3fa(0x108)]=a27_0x4ad3fa(0x118);['description']=a27_0x4ad3fa(0x12d);async[a27_0x4ad3fa(0x141)](_0xe95dcd){const _0x4cdbb5=a27_0x4ad3fa,{options:_0x220487,args:_0x574a2e,tdx:_0x521abd}=_0xe95dcd,_0x31955f=_0x574a2e[0x0];if(!_0x31955f)return console[_0x4cdbb5(0xf1)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4cdbb5(0xf1)](_0x4cdbb5(0x11a)),console[_0x4cdbb5(0xf1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x4cdbb5(0xf1)](_0x4cdbb5(0xef)),console[_0x4cdbb5(0xf1)](_0x4cdbb5(0x143)),console[_0x4cdbb5(0xf1)](_0x4cdbb5(0xbd)),0x1;try{const _0x511520=_0x220487[_0x4cdbb5(0xf5)],_0x360af4=await resolveSegmentTarget(_0x31955f,_0x511520,_0x220487[_0x4cdbb5(0x11c)]);_0x220487[_0x4cdbb5(0x11c)]&&console[_0x4cdbb5(0xf1)](_0x4cdbb5(0xf3)+_0x360af4);const _0x566b57=await withSpinner(_0x4cdbb5(0x144)+_0x31955f+'\x27...',()=>_0x521abd[_0x4cdbb5(0x121)][_0x4cdbb5(0xb2)](_0x360af4),{'verbose':_0x220487[_0x4cdbb5(0x11c)]}),_0x478d4e=_0x566b57[_0x4cdbb5(0xc7)];_0x220487[_0x4cdbb5(0x11c)]&&(console[_0x4cdbb5(0xf1)](_0x4cdbb5(0x147)+_0x478d4e['type']),console[_0x4cdbb5(0xf1)]('Parent\x20ID:\x20'+_0x478d4e[_0x4cdbb5(0xd1)]));if(_0x478d4e[_0x4cdbb5(0xd0)]===_0x4cdbb5(0x117))return console[_0x4cdbb5(0xf1)](_0x4cdbb5(0x146)),console[_0x4cdbb5(0xf1)](_0x4cdbb5(0x109)),0x1;if(_0x478d4e['type']==='parent')return console[_0x4cdbb5(0xf1)](_0x4cdbb5(0x11e)),console[_0x4cdbb5(0xf1)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x478d4e[_0x4cdbb5(0xe8)])throw new SDKError(ErrorCode[_0x4cdbb5(0x138)],_0x4cdbb5(0x13a));const _0xe0887e=await withSpinner(_0x4cdbb5(0xff),()=>_0x521abd[_0x4cdbb5(0x121)][_0x4cdbb5(0xee)](_0x478d4e['parentId'],_0x478d4e[_0x4cdbb5(0xe8)]),{'verbose':_0x220487[_0x4cdbb5(0x11c)]}),_0x5bf56c=_0xe0887e['data'],_0x319ebf=await executeSchemaQuery(_0x5bf56c,_0x521abd,_0x220487);return await handleQueryOutput(_0x319ebf,_0x220487),0x0;}catch(_0x52bf39){if(_0x52bf39 instanceof SDKError)return console['error'](_0x4cdbb5(0xd4)+_0x52bf39[_0x4cdbb5(0xf4)]),_0x52bf39[_0x4cdbb5(0xf7)]&&console[_0x4cdbb5(0xf1)](_0x4cdbb5(0xb0)+_0x52bf39[_0x4cdbb5(0xf7)]),0x1;throw _0x52bf39;}}}
1
+ const a27_0x14b939=a27_0x382a;(function(_0x38f667,_0x56beb4){const _0x5916d1=a27_0x382a,_0x183189=_0x38f667();while(!![]){try{const _0x2f52f4=parseInt(_0x5916d1(0x266))/0x1+-parseInt(_0x5916d1(0x200))/0x2+-parseInt(_0x5916d1(0x227))/0x3*(-parseInt(_0x5916d1(0x265))/0x4)+-parseInt(_0x5916d1(0x26f))/0x5*(parseInt(_0x5916d1(0x23e))/0x6)+-parseInt(_0x5916d1(0x216))/0x7*(parseInt(_0x5916d1(0x21e))/0x8)+-parseInt(_0x5916d1(0x21f))/0x9*(-parseInt(_0x5916d1(0x257))/0xa)+-parseInt(_0x5916d1(0x207))/0xb*(-parseInt(_0x5916d1(0x22e))/0xc);if(_0x2f52f4===_0x56beb4)break;else _0x183189['push'](_0x183189['shift']());}catch(_0x2d8db8){_0x183189['push'](_0x183189['shift']());}}}(a27_0x2cce,0x1b84a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x43b323 from'chalk';function a27_0x382a(_0x2513a7,_0x1d32d4){_0x2513a7=_0x2513a7-0x1dd;const _0x2cce8d=a27_0x2cce();let _0x382a1b=_0x2cce8d[_0x2513a7];return _0x382a1b;}async function resolveSegmentTarget(_0x3d406c,_0x8f9824,_0x856595){const _0x3187d3=a27_0x382a;if(isYamlFilePath(_0x3d406c))try{const _0x4ed85d=await resolveYamlFilePath(_0x3d406c);return _0x856595&&(console['error'](_0x3187d3(0x236)+_0x3d406c),console['error'](_0x3187d3(0x219)+_0x4ed85d[_0x3187d3(0x228)]),console[_0x3187d3(0x275)](_0x3187d3(0x210)+_0x4ed85d[_0x3187d3(0x20d)]),console[_0x3187d3(0x275)]('\x20\x20Folder\x20path:\x20'+(_0x4ed85d[_0x3187d3(0x223)]||_0x3187d3(0x201))),console[_0x3187d3(0x275)]('\x20\x20Full\x20path:\x20'+_0x4ed85d[_0x3187d3(0x27c)])),_0x4ed85d[_0x3187d3(0x27c)];}catch(_0x34ed1f){throw new SDKError(ErrorCode[_0x3187d3(0x21c)],_0x3187d3(0x273)+_0x34ed1f[_0x3187d3(0x256)]);}if(!_0x8f9824)throw new SDKError(ErrorCode[_0x3187d3(0x21c)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x8f9824+'/'+_0x3d406c;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x14b939(0x262)]=a27_0x14b939(0x271);[a27_0x14b939(0x247)]=a27_0x14b939(0x213);async[a27_0x14b939(0x1fd)](_0x50795a){const _0x5a7d1e=a27_0x14b939,{options:_0x22ffbf,args:_0x410392,tdx:_0x13af53}=_0x50795a,_0x4dad62=_0x410392[0x0],_0x387a64=!_0x4dad62&&!!_0x22ffbf[_0x5a7d1e(0x228)],_0x8bed4c=_0x4dad62||_0x22ffbf['parentSegment'];if(!_0x8bed4c)return console[_0x5a7d1e(0x275)](_0x5a7d1e(0x212)),console[_0x5a7d1e(0x275)](_0x5a7d1e(0x1df)),console[_0x5a7d1e(0x275)](_0x5a7d1e(0x244)),console['error'](_0x5a7d1e(0x221)),console[_0x5a7d1e(0x275)](_0x5a7d1e(0x203)),console[_0x5a7d1e(0x275)](_0x5a7d1e(0x26b)),console['error'](_0x5a7d1e(0x1dd)),0x1;try{const _0x1785e0=_0x22ffbf[_0x5a7d1e(0x202)];let _0x57132d=_0x8bed4c;!_0x387a64&&_0x1785e0&&!_0x8bed4c['includes']('/')&&(_0x57132d=_0x1785e0+'/'+_0x8bed4c,_0x22ffbf[_0x5a7d1e(0x234)]&&console[_0x5a7d1e(0x275)]('Resolved\x20relative\x20path\x20to:\x20'+_0x57132d));const _0x3469c7=await withSpinner(_0x5a7d1e(0x268)+_0x57132d+_0x5a7d1e(0x238),()=>_0x13af53['segment'][_0x5a7d1e(0x1fe)](_0x57132d),{'verbose':_0x22ffbf[_0x5a7d1e(0x234)]}),_0x510b99=_0x3469c7[_0x5a7d1e(0x204)];_0x22ffbf[_0x5a7d1e(0x234)]&&(console['error']('Resolved\x20type:\x20'+_0x510b99[_0x5a7d1e(0x1e2)]),console['error']('Parent\x20ID:\x20'+_0x510b99[_0x5a7d1e(0x208)]),_0x510b99[_0x5a7d1e(0x22a)]&&console[_0x5a7d1e(0x275)](_0x5a7d1e(0x1e8)+_0x510b99[_0x5a7d1e(0x22a)]),_0x510b99[_0x5a7d1e(0x274)]&&console[_0x5a7d1e(0x275)](_0x5a7d1e(0x260)+_0x510b99[_0x5a7d1e(0x274)]));if(_0x510b99['type']===_0x5a7d1e(0x20f)){const _0x203f14=await withSpinner(_0x5a7d1e(0x232),()=>_0x13af53[_0x5a7d1e(0x269)]['getParent'](_0x510b99[_0x5a7d1e(0x208)]),{'verbose':_0x22ffbf[_0x5a7d1e(0x234)]});await handleSingleObjectOutput(_0x203f14['data'],_0x22ffbf);}else{if(_0x510b99[_0x5a7d1e(0x1e2)]===_0x5a7d1e(0x230)){if(!_0x510b99['folderId'])throw new SDKError(ErrorCode[_0x5a7d1e(0x1fa)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4b4d98=await withSpinner(_0x5a7d1e(0x1e4),()=>_0x13af53['segment'][_0x5a7d1e(0x251)](_0x510b99[_0x5a7d1e(0x22a)]),{'verbose':_0x22ffbf[_0x5a7d1e(0x234)]});await handleSingleObjectOutput(_0x4b4d98[_0x5a7d1e(0x204)],_0x22ffbf);}else{if(_0x510b99[_0x5a7d1e(0x1e2)]==='segment'){if(!_0x510b99[_0x5a7d1e(0x274)])throw new SDKError(ErrorCode[_0x5a7d1e(0x26c)],_0x5a7d1e(0x1e5));const _0x2f9a50=await withSpinner(_0x5a7d1e(0x20a),()=>_0x13af53[_0x5a7d1e(0x269)][_0x5a7d1e(0x225)](_0x510b99['parentId'],_0x510b99[_0x5a7d1e(0x274)]),{'verbose':_0x22ffbf[_0x5a7d1e(0x234)]});await handleSingleObjectOutput(_0x2f9a50[_0x5a7d1e(0x204)],_0x22ffbf);}}}return 0x0;}catch(_0x549a94){if(_0x549a94 instanceof SDKError)return console[_0x5a7d1e(0x275)]('Error:\x20'+_0x549a94[_0x5a7d1e(0x256)]),_0x549a94[_0x5a7d1e(0x272)]&&console['error'](_0x5a7d1e(0x220)+_0x549a94[_0x5a7d1e(0x272)]),0x1;throw _0x549a94;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';[a27_0x14b939(0x247)]=a27_0x14b939(0x25f);async[a27_0x14b939(0x1fd)](_0x2ffba6){const _0x1aeaec=a27_0x14b939,{options:_0x28d071,args:_0x1936ee,tdx:_0x14ef6c}=_0x2ffba6,_0x1bd554=_0x1936ee[0x0];if(!_0x1bd554)return console[_0x1aeaec(0x275)](_0x1aeaec(0x267)),console['error'](_0x1aeaec(0x224)),console['error'](_0x1aeaec(0x270)),console[_0x1aeaec(0x275)](_0x1aeaec(0x244)),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error'](_0x1aeaec(0x24c)),0x1;try{const _0x2ff33a=_0x28d071['parentSegment'],_0x397749=await resolveSegmentTarget(_0x1bd554,_0x2ff33a,_0x28d071[_0x1aeaec(0x234)]);_0x28d071[_0x1aeaec(0x234)]&&console[_0x1aeaec(0x275)](_0x1aeaec(0x242)+_0x397749);const _0x3f31f0=await withSpinner('Resolving\x20\x27'+_0x1bd554+_0x1aeaec(0x238),()=>_0x14ef6c[_0x1aeaec(0x269)][_0x1aeaec(0x1fe)](_0x397749),{'verbose':_0x28d071[_0x1aeaec(0x234)]}),_0x2b0bc5=_0x3f31f0[_0x1aeaec(0x204)];_0x28d071[_0x1aeaec(0x234)]&&(console[_0x1aeaec(0x275)](_0x1aeaec(0x240)+_0x2b0bc5[_0x1aeaec(0x1e2)]),console[_0x1aeaec(0x275)]('Parent\x20ID:\x20'+_0x2b0bc5[_0x1aeaec(0x208)]));if(_0x2b0bc5[_0x1aeaec(0x1e2)]==='folder')return console[_0x1aeaec(0x275)](_0x1aeaec(0x278)),console[_0x1aeaec(0x275)](_0x1aeaec(0x20c)),0x1;if(_0x2b0bc5['type']===_0x1aeaec(0x20f))return console[_0x1aeaec(0x275)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1aeaec(0x275)](_0x1aeaec(0x21b)),0x1;if(!_0x2b0bc5['segmentId'])throw new SDKError(ErrorCode[_0x1aeaec(0x26c)],_0x1aeaec(0x1e5));const _0x473a1f=await withSpinner(_0x1aeaec(0x259),()=>_0x14ef6c[_0x1aeaec(0x269)][_0x1aeaec(0x22b)](_0x2b0bc5['parentId'],_0x2b0bc5[_0x1aeaec(0x274)]),{'verbose':_0x28d071[_0x1aeaec(0x234)]});let _0x16a31d=_0x473a1f[_0x1aeaec(0x204)];const _0x759c9b=resolveLimit(_0x28d071['limit'],DEFAULT_DISPLAY_LIMIT),_0x5a151d=/\bLIMIT\s+\d+/i[_0x1aeaec(0x24d)](_0x16a31d);!_0x5a151d&&(_0x16a31d=_0x16a31d[_0x1aeaec(0x263)]()[_0x1aeaec(0x1e7)](/;+$/,''),_0x16a31d=_0x1aeaec(0x261)+_0x16a31d+_0x1aeaec(0x276)+_0x759c9b);_0x28d071[_0x1aeaec(0x234)]&&console[_0x1aeaec(0x275)](_0x1aeaec(0x26d)+_0x16a31d);const _0x3ad3bf=await withProgressSpinner(_0x1aeaec(0x254),async _0x333322=>{const _0x305447=_0x1aeaec,_0x13f797=await _0x14ef6c[_0x305447(0x264)][_0x305447(0x1fd)](_0x16a31d,{'catalog':'td','schema':'information_schema','onJobId':_0x2cc2f7=>{const _0x872481=_0x305447;_0x333322[_0x872481(0x1f8)](_0x2cc2f7);}});return _0x13f797;},{'verbose':_0x28d071[_0x1aeaec(0x234)]}),_0x2bccd6=_0x3ad3bf[_0x1aeaec(0x204)],_0x378069=_0x2bccd6[_0x1aeaec(0x21d)]?_0x1aeaec(0x20b)+_0x2bccd6[_0x1aeaec(0x21d)]+']':'';return console['error'](_0x1aeaec(0x1f0)+_0x2bccd6[_0x1aeaec(0x1fc)][_0x1aeaec(0x1f7)][_0x1aeaec(0x26a)]()+_0x1aeaec(0x241)+(_0x1aeaec(0x23d)+formatElapsed(_0x2bccd6['stats'][_0x1aeaec(0x1f3)])+_0x378069)),await handleQueryOutput(_0x2bccd6,_0x28d071),0x0;}catch(_0x559680){if(_0x559680 instanceof SDKError)return console[_0x1aeaec(0x275)]('βœ–\x20Query\x20failed\x20['+_0x559680[_0x1aeaec(0x27d)]+']'),console[_0x1aeaec(0x275)]('\x0a'+_0x559680[_0x1aeaec(0x256)]),0x1;throw _0x559680;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x14b939(0x258);[a27_0x14b939(0x247)]=a27_0x14b939(0x22d);async[a27_0x14b939(0x1fd)](_0x22f61f){const _0x383c6e=a27_0x14b939,{options:_0x4ec22e,args:_0x34d789,tdx:_0x482d00}=_0x22f61f;if(_0x34d789[_0x383c6e(0x25b)]===0x0)return console[_0x383c6e(0x275)](_0x383c6e(0x1f1)),console[_0x383c6e(0x275)](_0x383c6e(0x27b)),0x1;const _0x4eadcb=_0x34d789[0x0];try{_0x4ec22e[_0x383c6e(0x234)]&&(console[_0x383c6e(0x275)]('Site:\x20'+_0x4ec22e[_0x383c6e(0x209)]),console[_0x383c6e(0x275)](_0x383c6e(0x205)+_0x4eadcb));const _0x586801=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4eadcb+'\x27...',()=>_0x482d00['segment'][_0x383c6e(0x1ea)](_0x4eadcb),{'verbose':_0x4ec22e[_0x383c6e(0x234)]}),_0x1d3ff8=_0x586801['data'];_0x4ec22e['verbose']&&console[_0x383c6e(0x275)]('Resolved\x20parent\x20ID:\x20'+_0x1d3ff8);const _0x31db9b=await withSpinner(_0x383c6e(0x211)+_0x4eadcb+_0x383c6e(0x238),()=>_0x482d00[_0x383c6e(0x269)][_0x383c6e(0x23c)](_0x1d3ff8),{'verbose':_0x4ec22e[_0x383c6e(0x234)]}),_0x5a333a=_0x31db9b[_0x383c6e(0x204)];return console['error'](_0x383c6e(0x27a)+_0x5a333a[_0x383c6e(0x25b)]+_0x383c6e(0x235)+(_0x5a333a[_0x383c6e(0x25b)]!==0x1?'s':'')),await handleSDKOutput(_0x5a333a,_0x4ec22e),0x0;}catch(_0xd5b549){if(_0xd5b549 instanceof SDKError)return console[_0x383c6e(0x275)](_0x383c6e(0x239)+_0xd5b549['message']),_0xd5b549[_0x383c6e(0x272)]&&console[_0x383c6e(0x275)](_0x383c6e(0x220)+_0xd5b549[_0x383c6e(0x272)]),0x1;throw _0xd5b549;}}}function a27_0x2cce(){const _0x4e1c58=['\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','data','Parent\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','55mZzYNs','parentId','site','Fetching\x20segment\x20details...','\x20[Job\x20ID:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segmentName','\x27\x20with\x20ID:\x20','parent','\x20\x20Segment\x20name:\x20','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Path\x20or\x20name\x20is\x20required','Show\x20segment\x20or\x20folder\x20details','βœ”\x20Created\x20folder\x20\x27','/e/','7iZUVGt','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','log','\x20\x20Parent\x20segment:\x20','Resolved\x20parent\x20ID:\x20','Use:\x20tdx\x20ps\x20show','INVALID_ARGUMENT','jobId','804200GgCqvW','39168rtRzRE','\x20\x20Cause:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','folderPath','Usage:\x20tdx\x20sg\x20show\x20<name>','getSegment','Use:\x20tdx\x20ps\x20view','18BlNmye','parentSegment','segment:folder:show','folderId','getSegmentSQL','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','345084JsOWAv','\x20Opening\x20','folder','Show\x20child\x20segment\x20schema\x20(column\x20types)','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','verbose','\x20folder','Resolved\x20YAML\x20file:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x27...','Error:\x20','web','Create\x20segment\x20folder\x20for\x20organization','listFolders','in\x20','12FQzFSg','Show\x20folder\x20or\x20child\x20segment\x20details','Resolved\x20type:\x20','\x20rows\x20','Target\x20path:\x20','Resolving\x20parent\x20folder\x20\x27','Examples:','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Folder\x20name:\x20','description','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Resolving\x20folder\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','test','Use:\x20tdx\x20ps\x20view\x20-w','jsonl','Use:\x20tdx\x20ps\x20sql','getFolder','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Site:\x20','Executing\x20segment\x20query...','Error:\x20Folder\x20reference\x20is\x20required','message','40kYVXUW','segment:folder:list','Fetching\x20SQL\x20for\x20segment...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','length','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','resolveFolderId','/app/ps/','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Segment\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','name','trim','query','27044sfhYwr','120824yNgelX','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Resolving\x20path\x20\x27','segment','toLocaleString','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SEGMENT_NOT_FOUND','SQL\x20query:\x0a','createFolder','112895ujaAXX','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:describe','cause','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segmentId','error','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','βœ”\x20Found\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','fullPath','code','Creating\x20folder\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','type','Show\x20segment\x20folder\x20details','Fetching\x20folder\x20details...','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Folder\x20ID\x20missing\x20from\x20resolved\x20path','replace','Folder\x20ID:\x20','format','resolveParentId','Usage:\x20tdx\x20sg\x20desc\x20<name>','parentFolder','Parent\x20segment:\x20','Resolving\x20\x27','segment:folder:create','βœ”\x20Query\x20completed:\x20Processed\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','elapsedTimeMillis','Use:\x20tdx\x20ps\x20desc','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','green','processedRows','setJobId','Resolved\x20folder\x20ID:\x20','SEGMENT_FOLDER_NOT_FOUND','segment:sql','stats','execute','resolvePathToResource','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','128372CEBGNJ','(root)','segmentPath'];a27_0x2cce=function(){return _0x4e1c58;};return a27_0x2cce();}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x14b939(0x262)]=a27_0x14b939(0x229);[a27_0x14b939(0x247)]=a27_0x14b939(0x1e3);async['execute'](_0x2af68c){const _0x3b634f=a27_0x14b939,{options:_0xac476f,args:_0x447427,tdx:_0x3dcd25}=_0x2af68c;if(_0x447427[_0x3b634f(0x25b)]===0x0)return console[_0x3b634f(0x275)](_0x3b634f(0x255)),console['error'](_0x3b634f(0x1f2)),0x1;try{const {parentId:_0x5f2ed2,childId:_0x3ec82a}=parseSegmentRef(_0x447427[0x0]);_0xac476f[_0x3b634f(0x234)]&&(console[_0x3b634f(0x275)](_0x3b634f(0x253)+_0xac476f['site']),console['error'](_0x3b634f(0x205)+_0x5f2ed2),_0x3ec82a&&console[_0x3b634f(0x275)](_0x3b634f(0x246)+_0x3ec82a));if(!_0x3ec82a)return console['error'](_0x3b634f(0x237)),0x1;const _0x2bc656=await withSpinner(_0x3b634f(0x1e0)+_0x5f2ed2+_0x3b634f(0x238),()=>_0x3dcd25[_0x3b634f(0x269)][_0x3b634f(0x1ea)](_0x5f2ed2),{'verbose':_0xac476f[_0x3b634f(0x234)]}),_0xe26fc=_0x2bc656[_0x3b634f(0x204)];_0xac476f[_0x3b634f(0x234)]&&console[_0x3b634f(0x275)](_0x3b634f(0x21a)+_0xe26fc);const _0x1a3064=await withSpinner(_0x3b634f(0x24a)+_0x3ec82a+_0x3b634f(0x238),()=>_0x3dcd25[_0x3b634f(0x269)][_0x3b634f(0x25d)](_0xe26fc,_0x3ec82a),{'verbose':_0xac476f[_0x3b634f(0x234)]}),_0x4aa3d5=_0x1a3064[_0x3b634f(0x204)];_0xac476f[_0x3b634f(0x234)]&&console[_0x3b634f(0x275)](_0x3b634f(0x1f9)+_0x4aa3d5);const _0x3a656c=await withSpinner('Fetching\x20folder\x20\x27'+_0x3ec82a+_0x3b634f(0x238),()=>_0x3dcd25[_0x3b634f(0x269)][_0x3b634f(0x251)](_0x4aa3d5),{'verbose':_0xac476f[_0x3b634f(0x234)]});return await handleSDKOutput([_0x3a656c[_0x3b634f(0x204)]],_0xac476f),0x0;}catch(_0x57ddc6){if(_0x57ddc6 instanceof SDKError)return console[_0x3b634f(0x275)](_0x3b634f(0x239)+_0x57ddc6[_0x3b634f(0x256)]),_0x57ddc6[_0x3b634f(0x272)]&&console[_0x3b634f(0x275)](_0x3b634f(0x220)+_0x57ddc6[_0x3b634f(0x272)]),0x1;throw _0x57ddc6;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x14b939(0x262)]=a27_0x14b939(0x1fb);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x14b939(0x1fd)](_0x24f184){const _0x2bdd8e=a27_0x14b939,{options:_0x521abe,args:_0xe232aa,tdx:_0xbfaaac}=_0x24f184,_0x3c7317=_0xe232aa[0x0];if(!_0x3c7317)return console[_0x2bdd8e(0x275)](_0x2bdd8e(0x267)),console[_0x2bdd8e(0x275)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x249)),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x244)),console['error']('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x2bdd8e(0x275)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x42c150=_0x521abe[_0x2bdd8e(0x228)],_0x3e3908=await resolveSegmentTarget(_0x3c7317,_0x42c150,_0x521abe[_0x2bdd8e(0x234)]);_0x521abe[_0x2bdd8e(0x234)]&&console[_0x2bdd8e(0x275)](_0x2bdd8e(0x242)+_0x3e3908);const _0x4e6045=await withSpinner(_0x2bdd8e(0x1ee)+_0x3c7317+_0x2bdd8e(0x238),()=>_0xbfaaac[_0x2bdd8e(0x269)][_0x2bdd8e(0x1fe)](_0x3e3908),{'verbose':_0x521abe[_0x2bdd8e(0x234)]}),_0x20d7d1=_0x4e6045[_0x2bdd8e(0x204)];_0x521abe[_0x2bdd8e(0x234)]&&(console['error'](_0x2bdd8e(0x240)+_0x20d7d1[_0x2bdd8e(0x1e2)]),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x1de)+_0x20d7d1[_0x2bdd8e(0x208)]));if(_0x20d7d1[_0x2bdd8e(0x1e2)]===_0x2bdd8e(0x230))return console['error'](_0x2bdd8e(0x277)),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x24b)),0x1;if(_0x20d7d1[_0x2bdd8e(0x1e2)]===_0x2bdd8e(0x20f))return console['error'](_0x2bdd8e(0x279)),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x250)),0x1;if(!_0x20d7d1['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3c3a3a=await withSpinner(_0x2bdd8e(0x259),()=>_0xbfaaac[_0x2bdd8e(0x269)][_0x2bdd8e(0x22b)](_0x20d7d1[_0x2bdd8e(0x208)],_0x20d7d1[_0x2bdd8e(0x274)]),{'verbose':_0x521abe['verbose']}),_0x325021=_0x3c3a3a[_0x2bdd8e(0x204)];return _0x521abe['format']==='json'||_0x521abe[_0x2bdd8e(0x1e9)]===_0x2bdd8e(0x24f)?await handleSDKOutput([{'sql':_0x325021}],_0x521abe):console[_0x2bdd8e(0x218)](_0x325021),0x0;}catch(_0x593e80){if(_0x593e80 instanceof SDKError)return console[_0x2bdd8e(0x275)]('Error:\x20'+_0x593e80[_0x2bdd8e(0x256)]),_0x593e80[_0x2bdd8e(0x272)]&&console[_0x2bdd8e(0x275)]('\x20\x20Cause:\x20'+_0x593e80[_0x2bdd8e(0x272)]),0x1;throw _0x593e80;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x14b939(0x262)]=a27_0x14b939(0x1ef);[a27_0x14b939(0x247)]=a27_0x14b939(0x23b);async[a27_0x14b939(0x1fd)](_0x3e7aa4){const _0x59cc22=a27_0x14b939,{options:_0x532667,args:_0x3f6072,tdx:_0xa1daba}=_0x3e7aa4,_0x47ca05=_0x532667;if(_0x3f6072[_0x59cc22(0x25b)]<0x2)return console[_0x59cc22(0x275)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x59cc22(0x206)),0x1;const _0x3ee98c=_0x3f6072[0x0],_0x1efae1=_0x3f6072[0x1];_0x47ca05[_0x59cc22(0x234)]&&(console[_0x59cc22(0x275)](_0x59cc22(0x253)+_0x47ca05[_0x59cc22(0x209)]),console[_0x59cc22(0x275)](_0x59cc22(0x1ed)+_0x3ee98c),console[_0x59cc22(0x275)]('Folder\x20name:\x20'+_0x1efae1));let _0x34e9cf;if(_0x47ca05[_0x59cc22(0x1ec)]){const _0x33ae49=_0x47ca05[_0x59cc22(0x1ec)],_0x308ef8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3ee98c+_0x59cc22(0x238),()=>_0xa1daba[_0x59cc22(0x269)][_0x59cc22(0x1ea)](_0x3ee98c),{'verbose':_0x47ca05[_0x59cc22(0x234)]}),_0x195fdc=_0x308ef8[_0x59cc22(0x204)],_0x3d3a8e=await withSpinner(_0x59cc22(0x243)+_0x33ae49+_0x59cc22(0x238),()=>_0xa1daba[_0x59cc22(0x269)]['resolveFolderId'](_0x195fdc,_0x33ae49),{'verbose':_0x47ca05[_0x59cc22(0x234)]});_0x34e9cf=_0x3d3a8e[_0x59cc22(0x204)],_0x47ca05[_0x59cc22(0x234)]&&console[_0x59cc22(0x275)](_0x59cc22(0x248)+_0x34e9cf);}const _0x19fcc7={'name':_0x1efae1,'description':_0x47ca05[_0x59cc22(0x247)],'parentFolderId':_0x34e9cf},_0x31634f=await withSpinner(_0x59cc22(0x27e)+_0x1efae1+'\x27...',()=>_0xa1daba['segment'][_0x59cc22(0x26e)](_0x3ee98c,_0x19fcc7),{'verbose':_0x47ca05[_0x59cc22(0x234)]}),_0x3b4b40=_0x31634f[_0x59cc22(0x204)];return console[_0x59cc22(0x275)](_0x59cc22(0x214)+_0x3b4b40[_0x59cc22(0x262)]+_0x59cc22(0x20e)+_0x3b4b40['id']),await handleSDKOutput([_0x3b4b40],_0x47ca05),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x14b939(0x262)]='segment:view';[a27_0x14b939(0x247)]=a27_0x14b939(0x23f);async['execute'](_0x442a9a){const _0x2a66d5=a27_0x14b939,{options:_0x186f7b,args:_0x6de5dd,tdx:_0x1a809e}=_0x442a9a,_0x58265f=_0x6de5dd[0x0];if(!_0x58265f)return console[_0x2a66d5(0x275)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x2a66d5(0x275)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x2a66d5(0x275)](_0x2a66d5(0x1f5)),console['error']('Options:'),console[_0x2a66d5(0x275)](_0x2a66d5(0x22c)),console[_0x2a66d5(0x275)](_0x2a66d5(0x244)),console['error'](_0x2a66d5(0x222)),console[_0x2a66d5(0x275)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x2a66d5(0x1e1)),console['error'](_0x2a66d5(0x233)),0x1;try{const _0x40cb36=_0x186f7b['parentSegment'],_0xff74c9=await resolveSegmentTarget(_0x58265f,_0x40cb36,_0x186f7b[_0x2a66d5(0x234)]);_0x186f7b[_0x2a66d5(0x234)]&&console[_0x2a66d5(0x275)](_0x2a66d5(0x242)+_0xff74c9);const _0x4ac5d8=await withSpinner(_0x2a66d5(0x1ee)+_0x58265f+_0x2a66d5(0x238),()=>_0x1a809e[_0x2a66d5(0x269)][_0x2a66d5(0x1fe)](_0xff74c9),{'verbose':_0x186f7b[_0x2a66d5(0x234)]}),_0x304036=_0x4ac5d8[_0x2a66d5(0x204)];_0x186f7b[_0x2a66d5(0x234)]&&(console[_0x2a66d5(0x275)](_0x2a66d5(0x240)+_0x304036[_0x2a66d5(0x1e2)]),console['error'](_0x2a66d5(0x1de)+_0x304036[_0x2a66d5(0x208)]),_0x304036[_0x2a66d5(0x22a)]&&console[_0x2a66d5(0x275)](_0x2a66d5(0x1e8)+_0x304036[_0x2a66d5(0x22a)]),_0x304036[_0x2a66d5(0x274)]&&console['error'](_0x2a66d5(0x260)+_0x304036['segmentId']));if(_0x186f7b[_0x2a66d5(0x23a)]){if(_0x304036['type']===_0x2a66d5(0x230))return console['error'](_0x2a66d5(0x245)),0x1;if(_0x304036['type']===_0x2a66d5(0x20f))return console[_0x2a66d5(0x275)](_0x2a66d5(0x25c)),console[_0x2a66d5(0x275)](_0x2a66d5(0x24e)),0x1;if(!_0x304036[_0x2a66d5(0x274)])throw new SDKError(ErrorCode[_0x2a66d5(0x26c)],_0x2a66d5(0x1e5));const _0x1cc75c=getConsoleNextUrl(_0x186f7b[_0x2a66d5(0x209)],'/app/ps/'+_0x304036['parentId']+_0x2a66d5(0x215)+_0x304036[_0x2a66d5(0x274)]);return console[_0x2a66d5(0x275)](a27_0x43b323[_0x2a66d5(0x1f6)]('βœ”')+_0x2a66d5(0x22f)+a27_0x43b323['cyan'](_0x1cc75c)),openBrowser(_0x1cc75c),0x0;}if(_0x304036[_0x2a66d5(0x1e2)]==='folder'){if(!_0x304036[_0x2a66d5(0x22a)])throw new SDKError(ErrorCode[_0x2a66d5(0x1fa)],_0x2a66d5(0x1e6));const _0x9a5fe0=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1a809e[_0x2a66d5(0x269)][_0x2a66d5(0x251)](_0x304036[_0x2a66d5(0x22a)]),{'verbose':_0x186f7b[_0x2a66d5(0x234)]});await handleSingleObjectOutput(_0x9a5fe0[_0x2a66d5(0x204)],_0x186f7b);}else{if(_0x304036[_0x2a66d5(0x1e2)]===_0x2a66d5(0x269)){if(!_0x304036[_0x2a66d5(0x274)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2a66d5(0x1e5));const _0x3f7587=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1a809e[_0x2a66d5(0x269)]['getSegment'](_0x304036[_0x2a66d5(0x208)],_0x304036[_0x2a66d5(0x274)]),{'verbose':_0x186f7b[_0x2a66d5(0x234)]}),_0x4e0a9f=getConsoleNextUrl(_0x186f7b[_0x2a66d5(0x209)],_0x2a66d5(0x25e)+_0x304036['parentId']+'/e/'+_0x304036[_0x2a66d5(0x274)]),_0x3df02b=_0x3f7587['data'];_0x3df02b['url']=_0x4e0a9f,await handleSingleObjectOutput(_0x3df02b,_0x186f7b);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x2a66d5(0x226)),0x1;}return 0x0;}catch(_0x1b3cb6){if(_0x1b3cb6 instanceof SDKError)return console['error'](_0x2a66d5(0x239)+_0x1b3cb6[_0x2a66d5(0x256)]),_0x1b3cb6[_0x2a66d5(0x272)]&&console['error'](_0x2a66d5(0x220)+_0x1b3cb6[_0x2a66d5(0x272)]),0x1;throw _0x1b3cb6;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';[a27_0x14b939(0x247)]=a27_0x14b939(0x231);async[a27_0x14b939(0x1fd)](_0x36ff40){const _0x508b5a=a27_0x14b939,{options:_0x6526e9,args:_0x344f36,tdx:_0x3b5b06}=_0x36ff40,_0x5c8ef2=_0x344f36[0x0];if(!_0x5c8ef2)return console[_0x508b5a(0x275)](_0x508b5a(0x267)),console[_0x508b5a(0x275)](_0x508b5a(0x1eb)),console['error'](_0x508b5a(0x25a)),console['error'](_0x508b5a(0x244)),console[_0x508b5a(0x275)](_0x508b5a(0x217)),console[_0x508b5a(0x275)](_0x508b5a(0x1ff)),0x1;try{const _0x2641fa=_0x6526e9['parentSegment'],_0x39ff9f=await resolveSegmentTarget(_0x5c8ef2,_0x2641fa,_0x6526e9['verbose']);_0x6526e9['verbose']&&console['error'](_0x508b5a(0x242)+_0x39ff9f);const _0x4d539f=await withSpinner(_0x508b5a(0x1ee)+_0x5c8ef2+_0x508b5a(0x238),()=>_0x3b5b06[_0x508b5a(0x269)][_0x508b5a(0x1fe)](_0x39ff9f),{'verbose':_0x6526e9['verbose']}),_0x209673=_0x4d539f[_0x508b5a(0x204)];_0x6526e9[_0x508b5a(0x234)]&&(console[_0x508b5a(0x275)](_0x508b5a(0x240)+_0x209673[_0x508b5a(0x1e2)]),console[_0x508b5a(0x275)]('Parent\x20ID:\x20'+_0x209673['parentId']));if(_0x209673[_0x508b5a(0x1e2)]==='folder')return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x508b5a(0x275)](_0x508b5a(0x24b)),0x1;if(_0x209673[_0x508b5a(0x1e2)]===_0x508b5a(0x20f))return console[_0x508b5a(0x275)](_0x508b5a(0x252)),console[_0x508b5a(0x275)](_0x508b5a(0x1f4)),0x1;if(!_0x209673[_0x508b5a(0x274)])throw new SDKError(ErrorCode[_0x508b5a(0x26c)],_0x508b5a(0x1e5));const _0x5269ae=await withSpinner(_0x508b5a(0x259),()=>_0x3b5b06['segment'][_0x508b5a(0x22b)](_0x209673[_0x508b5a(0x208)],_0x209673[_0x508b5a(0x274)]),{'verbose':_0x6526e9[_0x508b5a(0x234)]}),_0x15ced4=_0x5269ae[_0x508b5a(0x204)],_0x5aa172=await executeSchemaQuery(_0x15ced4,_0x3b5b06,_0x6526e9);return await handleQueryOutput(_0x5aa172,_0x6526e9),0x0;}catch(_0x51de0c){if(_0x51de0c instanceof SDKError)return console[_0x508b5a(0x275)](_0x508b5a(0x239)+_0x51de0c[_0x508b5a(0x256)]),_0x51de0c['cause']&&console['error'](_0x508b5a(0x220)+_0x51de0c[_0x508b5a(0x272)]),0x1;throw _0x51de0c;}}}
@@ -1 +1 @@
1
- const a28_0x255766=a28_0xc766;(function(_0x6ceca6,_0xbaec39){const _0x35ba23=a28_0xc766,_0x2b4dcd=_0x6ceca6();while(!![]){try{const _0x4ecf2e=-parseInt(_0x35ba23(0x101))/0x1*(parseInt(_0x35ba23(0x10e))/0x2)+-parseInt(_0x35ba23(0x118))/0x3*(parseInt(_0x35ba23(0xfe))/0x4)+-parseInt(_0x35ba23(0xee))/0x5+parseInt(_0x35ba23(0xeb))/0x6*(parseInt(_0x35ba23(0x100))/0x7)+parseInt(_0x35ba23(0xf0))/0x8+-parseInt(_0x35ba23(0x10a))/0x9+parseInt(_0x35ba23(0xf6))/0xa*(parseInt(_0x35ba23(0x11d))/0xb);if(_0x4ecf2e===_0xbaec39)break;else _0x2b4dcd['push'](_0x2b4dcd['shift']());}catch(_0x2cfe5d){_0x2b4dcd['push'](_0x2b4dcd['shift']());}}}(a28_0x3cd7,0x61c04));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x4744b7 from'chalk';function a28_0x3cd7(){const _0x394bec=['Resolving\x20folder\x20path\x20\x27','1244200tODdrb','\x20\x20\x20Path:\x20','Site:\x20','segments','folderId','folder','1358410XHMZFf','rule','Resolving\x20folder\x20\x27','ruleFile','\x27...','\x27\x20with\x20ID:\x20','includes','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','674804apFAgg','resolvePathToResource','469iZTRze','662602pvkWBF','Parent:\x20','βœ”\x20Created\x20segment\x20\x27','error','segment:create','data','type','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','length','1037961eNxeQT','resolveParentId','invisible','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','2rtaaqV','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Resolving\x20parent\x20segment\x20\x27','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','description','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','parent','Resolved\x20folder\x20ID:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment','3JZsavI','kind','Resolved\x20relative\x20path\x20to:\x20','Creating\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','143RUFYFm','yellow','execute','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules','site','Parent\x20path:\x20','3378KALCWb','verbose','segmentPath','3060795iVyYmh'];a28_0x3cd7=function(){return _0x394bec;};return a28_0x3cd7();}function a28_0xc766(_0x590ec6,_0x158cc1){_0x590ec6=_0x590ec6-0xe5;const _0x3cd760=a28_0x3cd7();let _0xc766cd=_0x3cd760[_0x590ec6];return _0xc766cd;}export class SegmentCreateCommand extends BaseCommand{['name']=a28_0x255766(0x105);[a28_0x255766(0x112)]=a28_0x255766(0xe8);async[a28_0x255766(0xe6)](_0x4cee53){const _0x2bdb63=a28_0x255766;console[_0x2bdb63(0x104)](a28_0x4744b7[_0x2bdb63(0xe5)](_0x2bdb63(0x10f))),console[_0x2bdb63(0x104)](a28_0x4744b7[_0x2bdb63(0xe5)](_0x2bdb63(0x11c)));const {options:_0x504f73,args:_0x6196ad,tdx:_0x52faae}=_0x4cee53,_0x3c287f=_0x504f73;if(_0x6196ad[_0x2bdb63(0x109)]===0x0)return console[_0x2bdb63(0x104)](_0x2bdb63(0x116)),console[_0x2bdb63(0x104)](_0x2bdb63(0x108)),console[_0x2bdb63(0x104)]('Examples:'),console[_0x2bdb63(0x104)](_0x2bdb63(0xe7)),console[_0x2bdb63(0x104)](_0x2bdb63(0xfd)),console[_0x2bdb63(0x104)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x3860c8=_0x6196ad[0x0],_0x5a8c50=_0x504f73[_0x2bdb63(0xed)];let _0x5161e1=_0x3860c8;_0x5a8c50&&!_0x3860c8[_0x2bdb63(0xfc)]('/')&&(_0x5161e1=_0x5a8c50+'/'+_0x3860c8,_0x3c287f['verbose']&&console[_0x2bdb63(0x104)](_0x2bdb63(0x11a)+_0x5161e1));const _0x1d498c=parsePath(_0x5161e1);if(_0x1d498c[_0x2bdb63(0xf3)][_0x2bdb63(0x109)]<0x2)return console['error'](_0x2bdb63(0x111)),console[_0x2bdb63(0x104)](_0x2bdb63(0x10d)),0x1;const _0x180202=_0x1d498c[_0x2bdb63(0xf3)][0x0],_0x5236fa=getBaseName(_0x5161e1),_0xb6212c=getParentPath(_0x5161e1);_0x3c287f[_0x2bdb63(0xec)]&&(console['error'](_0x2bdb63(0xf2)+_0x3c287f[_0x2bdb63(0xe9)]),console[_0x2bdb63(0x104)]('Target\x20path:\x20'+_0x5161e1),console[_0x2bdb63(0x104)](_0x2bdb63(0x102)+_0x180202),console[_0x2bdb63(0x104)]('Segment\x20name:\x20'+_0x5236fa),console['error'](_0x2bdb63(0xea)+_0xb6212c));const _0x216c53=await withSpinner(_0x2bdb63(0x110)+_0x180202+_0x2bdb63(0xfa),()=>_0x52faae[_0x2bdb63(0x117)][_0x2bdb63(0x10b)](_0x180202),{'verbose':_0x3c287f['verbose']}),_0x1f7b73=_0x216c53[_0x2bdb63(0x106)];let _0x5acbdb;if(_0x1d498c[_0x2bdb63(0xf3)]['length']>0x2){const _0x11ebea=await withSpinner(_0x2bdb63(0xef)+_0xb6212c+'\x27...',()=>_0x52faae['segment'][_0x2bdb63(0xff)](_0xb6212c),{'verbose':_0x3c287f[_0x2bdb63(0xec)]}),_0x18d309=_0x11ebea[_0x2bdb63(0x106)];if(_0x18d309[_0x2bdb63(0x107)]!=='folder'&&_0x18d309[_0x2bdb63(0x107)]!==_0x2bdb63(0x114))return console['error'](_0x2bdb63(0x113)),0x1;_0x5acbdb=_0x18d309[_0x2bdb63(0xf4)];}else{if(_0x3c287f[_0x2bdb63(0xf5)]){const _0x673eb2=await withSpinner(_0x2bdb63(0xf8)+_0x3c287f[_0x2bdb63(0xf5)]+_0x2bdb63(0xfa),()=>_0x52faae[_0x2bdb63(0x117)]['resolveFolderId'](_0x1f7b73,_0x3c287f['folder']),{'verbose':_0x3c287f['verbose']});_0x5acbdb=_0x673eb2['data'];}}_0x3c287f['verbose']&&_0x5acbdb&&console[_0x2bdb63(0x104)](_0x2bdb63(0x115)+_0x5acbdb);const _0x36e0ea=await loadJSONFromOptions(_0x3c287f[_0x2bdb63(0xf7)],_0x3c287f[_0x2bdb63(0xf9)]),_0x23a58a={'name':_0x5236fa,'description':_0x3c287f[_0x2bdb63(0x112)],'rule':_0x36e0ea,'kind':_0x3c287f[_0x2bdb63(0x119)]!==undefined?parseInt(_0x3c287f[_0x2bdb63(0x119)],0xa):undefined,'isVisible':_0x3c287f[_0x2bdb63(0x10c)]?![]:undefined,'segmentFolderId':_0x5acbdb,'countPopulation':_0x3c287f['noCountPopulation']?![]:undefined},_0x3d1b6c=await withSpinner(_0x2bdb63(0x11b)+_0x5236fa+_0x2bdb63(0xfa),()=>_0x52faae[_0x2bdb63(0x117)]['createSegment'](_0x1f7b73,_0x23a58a),{'verbose':_0x3c287f['verbose']}),_0x38aee0=_0x3d1b6c[_0x2bdb63(0x106)];return console['error'](_0x2bdb63(0x103)+_0x38aee0['name']+_0x2bdb63(0xfb)+_0x38aee0['id']),_0x5161e1!==_0x3860c8&&console['error'](_0x2bdb63(0xf1)+_0x5161e1),await handleSDKOutput([_0x38aee0],_0x3c287f),0x0;}}
1
+ const a28_0x3320a0=a28_0x75b4;(function(_0x5a467a,_0x28a502){const _0x37d9d9=a28_0x75b4,_0x34fc34=_0x5a467a();while(!![]){try{const _0xc0bf0a=-parseInt(_0x37d9d9(0x183))/0x1*(parseInt(_0x37d9d9(0x18d))/0x2)+parseInt(_0x37d9d9(0x17c))/0x3*(-parseInt(_0x37d9d9(0x175))/0x4)+-parseInt(_0x37d9d9(0x17f))/0x5*(-parseInt(_0x37d9d9(0x173))/0x6)+parseInt(_0x37d9d9(0x19c))/0x7+parseInt(_0x37d9d9(0x178))/0x8+-parseInt(_0x37d9d9(0x18f))/0x9*(parseInt(_0x37d9d9(0x17e))/0xa)+parseInt(_0x37d9d9(0x191))/0xb*(parseInt(_0x37d9d9(0x188))/0xc);if(_0xc0bf0a===_0x28a502)break;else _0x34fc34['push'](_0x34fc34['shift']());}catch(_0x16d3c7){_0x34fc34['push'](_0x34fc34['shift']());}}}(a28_0x6596,0x884e7));function a28_0x75b4(_0x18f7aa,_0xc1538b){_0x18f7aa=_0x18f7aa-0x16e;const _0x65961b=a28_0x6596();let _0x75b40=_0x65961b[_0x18f7aa];return _0x75b40;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x421407 from'chalk';function a28_0x6596(){const _0x3ed0d4=['invisible','Site:\x20','360276IHATvM','resolveParentId','16540VFKLid','4210340XFtmaH','data','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolved\x20folder\x20ID:\x20','9RGxuPY','type','\x20\x20\x20Path:\x20','segments','yellow','60UxUCNX','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment:create','name','resolvePathToResource','80702foxUTw','rule','1980jpRByu','Examples:','1392017Peclhp','parent','ruleFile','Resolving\x20folder\x20path\x20\x27','site','verbose','error','folder','Creating\x20segment\x20\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','4238346zVDZOZ','\x27...','folderId','resolveFolderId','βœ”\x20Created\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','length','Resolving\x20parent\x20segment\x20\x27','includes','segmentPath','noCountPopulation','6USgrOn','createSegment','28kCjJGk','kind','segment','365704NletQc','Target\x20path:\x20'];a28_0x6596=function(){return _0x3ed0d4;};return a28_0x6596();}export class SegmentCreateCommand extends BaseCommand{[a28_0x3320a0(0x18b)]=a28_0x3320a0(0x18a);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0x55bf31){const _0x3092dc=a28_0x3320a0;console[_0x3092dc(0x197)](a28_0x421407[_0x3092dc(0x187)](_0x3092dc(0x19a))),console[_0x3092dc(0x197)](a28_0x421407[_0x3092dc(0x187)](_0x3092dc(0x1a1)));const {options:_0x3a9f27,args:_0x5e2f02,tdx:_0xaee54d}=_0x55bf31,_0xf3ea5b=_0x3a9f27;if(_0x5e2f02[_0x3092dc(0x16e)]===0x0)return console['error'](_0x3092dc(0x189)),console[_0x3092dc(0x197)](_0x3092dc(0x181)),console[_0x3092dc(0x197)](_0x3092dc(0x190)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x3092dc(0x197)](_0x3092dc(0x19b)),console['error'](_0x3092dc(0x1a2)),0x1;const _0x233abe=_0x5e2f02[0x0],_0x3047d4=_0x3a9f27[_0x3092dc(0x171)];let _0x22d68b=_0x233abe;_0x3047d4&&!_0x233abe[_0x3092dc(0x170)]('/')&&(_0x22d68b=_0x3047d4+'/'+_0x233abe,_0xf3ea5b[_0x3092dc(0x196)]&&console[_0x3092dc(0x197)]('Resolved\x20relative\x20path\x20to:\x20'+_0x22d68b));const _0x51835c=parsePath(_0x22d68b);if(_0x51835c[_0x3092dc(0x186)][_0x3092dc(0x16e)]<0x2)return console[_0x3092dc(0x197)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x3092dc(0x197)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x5c4aaa=_0x51835c[_0x3092dc(0x186)][0x0],_0x2d89c7=getBaseName(_0x22d68b),_0x169e39=getParentPath(_0x22d68b);_0xf3ea5b['verbose']&&(console['error'](_0x3092dc(0x17b)+_0xf3ea5b[_0x3092dc(0x195)]),console[_0x3092dc(0x197)](_0x3092dc(0x179)+_0x22d68b),console['error']('Parent:\x20'+_0x5c4aaa),console[_0x3092dc(0x197)]('Segment\x20name:\x20'+_0x2d89c7),console[_0x3092dc(0x197)]('Parent\x20path:\x20'+_0x169e39));const _0x32f174=await withSpinner(_0x3092dc(0x16f)+_0x5c4aaa+_0x3092dc(0x19d),()=>_0xaee54d[_0x3092dc(0x177)][_0x3092dc(0x17d)](_0x5c4aaa),{'verbose':_0xf3ea5b[_0x3092dc(0x196)]}),_0x59ca53=_0x32f174[_0x3092dc(0x180)];let _0x244e35;if(_0x51835c['segments'][_0x3092dc(0x16e)]>0x2){const _0x2d5fb7=await withSpinner(_0x3092dc(0x194)+_0x169e39+_0x3092dc(0x19d),()=>_0xaee54d[_0x3092dc(0x177)][_0x3092dc(0x18c)](_0x169e39),{'verbose':_0xf3ea5b['verbose']}),_0x4c70e8=_0x2d5fb7['data'];if(_0x4c70e8[_0x3092dc(0x184)]!==_0x3092dc(0x198)&&_0x4c70e8[_0x3092dc(0x184)]!==_0x3092dc(0x192))return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x244e35=_0x4c70e8[_0x3092dc(0x19e)];}else{if(_0xf3ea5b[_0x3092dc(0x198)]){const _0x10cbc9=await withSpinner('Resolving\x20folder\x20\x27'+_0xf3ea5b[_0x3092dc(0x198)]+_0x3092dc(0x19d),()=>_0xaee54d[_0x3092dc(0x177)][_0x3092dc(0x19f)](_0x59ca53,_0xf3ea5b['folder']),{'verbose':_0xf3ea5b[_0x3092dc(0x196)]});_0x244e35=_0x10cbc9[_0x3092dc(0x180)];}}_0xf3ea5b['verbose']&&_0x244e35&&console['error'](_0x3092dc(0x182)+_0x244e35);const _0x139d52=await loadJSONFromOptions(_0xf3ea5b[_0x3092dc(0x18e)],_0xf3ea5b[_0x3092dc(0x193)]),_0x466fe8={'name':_0x2d89c7,'description':_0xf3ea5b['description'],'rule':_0x139d52,'kind':_0xf3ea5b[_0x3092dc(0x176)]!==undefined?parseInt(_0xf3ea5b['kind'],0xa):undefined,'isVisible':_0xf3ea5b[_0x3092dc(0x17a)]?![]:undefined,'segmentFolderId':_0x244e35,'countPopulation':_0xf3ea5b[_0x3092dc(0x172)]?![]:undefined},_0x39d84b=await withSpinner(_0x3092dc(0x199)+_0x2d89c7+'\x27...',()=>_0xaee54d[_0x3092dc(0x177)][_0x3092dc(0x174)](_0x59ca53,_0x466fe8),{'verbose':_0xf3ea5b[_0x3092dc(0x196)]}),_0x5b12a4=_0x39d84b[_0x3092dc(0x180)];return console[_0x3092dc(0x197)](_0x3092dc(0x1a0)+_0x5b12a4['name']+'\x27\x20with\x20ID:\x20'+_0x5b12a4['id']),_0x22d68b!==_0x233abe&&console[_0x3092dc(0x197)](_0x3092dc(0x185)+_0x22d68b),await handleSDKOutput([_0x5b12a4],_0xf3ea5b),0x0;}}
@@ -1 +1 @@
1
- const a29_0x2ba406=a29_0x3061;function a29_0x3be3(){const _0x3cb11a=['600554fAlTmC','name','4930902VPLIoU','12132yMoPMr','\x27...','Error:\x20Parent\x20segment\x20name\x20is\x20required','5419008TrgduE','error','85864oYoxnK','jsonl','length','20644AvFWMq','693AXrkjL','json','655DctZrV','description','segment','βœ”\x20Found\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','2060cpAdcE','2dglyTf','parentSegment','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','Site:\x20','Parent\x20segment:\x20','7120069TwmvYy','segment:fields','verbose'];a29_0x3be3=function(){return _0x3cb11a;};return a29_0x3be3();}(function(_0x2e420e,_0x44caf1){const _0x523b8d=a29_0x3061,_0x5d3db4=_0x2e420e();while(!![]){try{const _0x324fe6=-parseInt(_0x523b8d(0xae))/0x1*(-parseInt(_0x523b8d(0xc2))/0x2)+-parseInt(_0x523b8d(0xb4))/0x3+parseInt(_0x523b8d(0xb9))/0x4*(parseInt(_0x523b8d(0xbc))/0x5)+parseInt(_0x523b8d(0xb0))/0x6+parseInt(_0x523b8d(0xba))/0x7*(parseInt(_0x523b8d(0xb6))/0x8)+parseInt(_0x523b8d(0xb1))/0x9*(parseInt(_0x523b8d(0xc1))/0xa)+-parseInt(_0x523b8d(0xab))/0xb;if(_0x324fe6===_0x44caf1)break;else _0x5d3db4['push'](_0x5d3db4['shift']());}catch(_0x3eaffa){_0x5d3db4['push'](_0x5d3db4['shift']());}}}(a29_0x3be3,0xf080e));import{BaseCommand}from'./command.js';function a29_0x3061(_0x3e0b25,_0x1b2946){_0x3e0b25=_0x3e0b25-0xa7;const _0x3be339=a29_0x3be3();let _0x3061f0=_0x3be339[_0x3e0b25];return _0x3061f0;}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{[a29_0x2ba406(0xaf)]=a29_0x2ba406(0xac);[a29_0x2ba406(0xbd)]='List\x20available\x20fields\x20for\x20segmentation';async['execute'](_0x442c24){const _0x1ad8ea=a29_0x2ba406,{options:_0x657b3,args:_0xe61293,tdx:_0x5719e2}=_0x442c24,_0x5190ad=_0xe61293[0x0]||_0x657b3[_0x1ad8ea(0xa7)];if(!_0x5190ad)return console[_0x1ad8ea(0xb5)](_0x1ad8ea(0xb3)),console[_0x1ad8ea(0xb5)](_0x1ad8ea(0xa8)),console['error'](_0x1ad8ea(0xc0)),0x1;_0x657b3[_0x1ad8ea(0xad)]&&(console[_0x1ad8ea(0xb5)](_0x1ad8ea(0xa9)+_0x657b3['site']),console[_0x1ad8ea(0xb5)](_0x1ad8ea(0xaa)+_0x5190ad));const _0xf37520=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x5190ad+_0x1ad8ea(0xb2),()=>_0x5719e2[_0x1ad8ea(0xbe)]['listFields'](_0x5190ad),{'verbose':_0x657b3[_0x1ad8ea(0xad)]}),_0x638256=_0xf37520['data'];console[_0x1ad8ea(0xb5)](_0x1ad8ea(0xbf)+_0x638256[_0x1ad8ea(0xb8)]+'\x20field'+(_0x638256['length']!==0x1?'s':''));if(_0x657b3[_0x1ad8ea(0xbb)]||_0x657b3[_0x1ad8ea(0xb7)])return await handleSDKOutput(_0x638256,_0x657b3),0x0;return displayFieldsHumanReadable(_0x638256,_0x5190ad),0x0;}}
1
+ function a29_0x43bd(){const _0x39d128=['verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','name','9922zXTApp','length','579547TJRHze','\x20field','error','2946312uJIanS','Error:\x20Parent\x20segment\x20name\x20is\x20required','listFields','\x27...','4216DaFReY','βœ”\x20Found\x20','15561ICUsGx','3772590iWpDZO','22zHUceZ','parentSegment','segment','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','3028kAmjAc','12rtzhsr','description','582LtsURA','Listing\x20fields\x20for\x20\x27','Parent\x20segment:\x20','4703951bDvwrV','data','Site:\x20','jsonl','execute','6595ethOVi'];a29_0x43bd=function(){return _0x39d128;};return a29_0x43bd();}const a29_0x3f51a4=a29_0x12e4;(function(_0x41a153,_0x597053){const _0x90c275=a29_0x12e4,_0x2e61e7=_0x41a153();while(!![]){try{const _0x2dd146=-parseInt(_0x90c275(0x125))/0x1+parseInt(_0x90c275(0x123))/0x2*(-parseInt(_0x90c275(0x117))/0x3)+-parseInt(_0x90c275(0x114))/0x4*(-parseInt(_0x90c275(0x11f))/0x5)+-parseInt(_0x90c275(0x115))/0x6*(-parseInt(_0x90c275(0x11a))/0x7)+-parseInt(_0x90c275(0x12c))/0x8*(parseInt(_0x90c275(0x12e))/0x9)+parseInt(_0x90c275(0x12f))/0xa+parseInt(_0x90c275(0x130))/0xb*(parseInt(_0x90c275(0x128))/0xc);if(_0x2dd146===_0x597053)break;else _0x2e61e7['push'](_0x2e61e7['shift']());}catch(_0xed4f5a){_0x2e61e7['push'](_0x2e61e7['shift']());}}}(a29_0x43bd,0xb8f70));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x12e4(_0xa3e92d,_0x5d7080){_0xa3e92d=_0xa3e92d-0x112;const _0x43bd69=a29_0x43bd();let _0x12e48c=_0x43bd69[_0xa3e92d];return _0x12e48c;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x3f51a4(0x122)]='segment:fields';[a29_0x3f51a4(0x116)]='List\x20available\x20fields\x20for\x20segmentation';async[a29_0x3f51a4(0x11e)](_0x1e8674){const _0x21b6f0=a29_0x3f51a4,{options:_0x2687bf,args:_0x2a3af5,tdx:_0x1d2f6b}=_0x1e8674,_0x41bbb9=_0x2a3af5[0x0]||_0x2687bf[_0x21b6f0(0x131)];if(!_0x41bbb9)return console[_0x21b6f0(0x127)](_0x21b6f0(0x129)),console[_0x21b6f0(0x127)](_0x21b6f0(0x113)),console['error'](_0x21b6f0(0x121)),0x1;_0x2687bf[_0x21b6f0(0x120)]&&(console[_0x21b6f0(0x127)](_0x21b6f0(0x11c)+_0x2687bf['site']),console[_0x21b6f0(0x127)](_0x21b6f0(0x119)+_0x41bbb9));const _0xad46d8=await withSpinner(_0x21b6f0(0x118)+_0x41bbb9+_0x21b6f0(0x12b),()=>_0x1d2f6b[_0x21b6f0(0x112)][_0x21b6f0(0x12a)](_0x41bbb9),{'verbose':_0x2687bf['verbose']}),_0x39a56f=_0xad46d8[_0x21b6f0(0x11b)];console[_0x21b6f0(0x127)](_0x21b6f0(0x12d)+_0x39a56f[_0x21b6f0(0x124)]+_0x21b6f0(0x126)+(_0x39a56f[_0x21b6f0(0x124)]!==0x1?'s':''));if(_0x2687bf['json']||_0x2687bf[_0x21b6f0(0x11d)])return await handleSDKOutput(_0x39a56f,_0x2687bf),0x0;return displayFieldsHumanReadable(_0x39a56f,_0x41bbb9),0x0;}}
@@ -1 +1 @@
1
- const a30_0x1ad476=a30_0x2737;(function(_0x4008d8,_0x3cd6be){const _0x5c7001=a30_0x2737,_0x2ce692=_0x4008d8();while(!![]){try{const _0x3b7dd0=parseInt(_0x5c7001(0x158))/0x1*(parseInt(_0x5c7001(0x14e))/0x2)+-parseInt(_0x5c7001(0x162))/0x3+parseInt(_0x5c7001(0x183))/0x4+parseInt(_0x5c7001(0x140))/0x5*(parseInt(_0x5c7001(0x15f))/0x6)+-parseInt(_0x5c7001(0x15e))/0x7+parseInt(_0x5c7001(0x16a))/0x8+-parseInt(_0x5c7001(0x13e))/0x9;if(_0x3b7dd0===_0x3cd6be)break;else _0x2ce692['push'](_0x2ce692['shift']());}catch(_0x23928c){_0x2ce692['push'](_0x2ce692['shift']());}}}(a30_0x23dd,0x7987e));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a30_0x2737(_0x1c3a3b,_0x54c93f){_0x1c3a3b=_0x1c3a3b-0x13c;const _0x23dd73=a30_0x23dd();let _0x27373a=_0x23dd73[_0x1c3a3b];return _0x27373a;}function a30_0x23dd(){const _0x39e90d=['6474080PiGOSt','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segment','repeat','red','segment:pull','Parent\x20segment:\x20','\x20new\x20files','relativePath','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','diff','counts','Error:\x20','journeys','\x20unchanged\x20files','cwd','parent_segment','files','helpText','site','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','segments','message','session','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','3867904mcMqpy','βœ”\x20Context\x20set:\x20','\x20=\x20','dryRun','\x20\x20🎯\x20','\x20activations','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','\x20changed\x20files','12532743NoHxyK','-\x20no\x20files\x20written','3230gwSiaL','utf-8','\x20segments','pullSegments','parentSegment','targetDir','journeyVersions','Site:\x20','dim','data','\x0aChanges\x20to\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','verbose','description','112094LnwmtR','resourceName','\x20journeys','parentName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','absolutePath','isNew','file','\x20files\x20to\x20','no_parent','17rKCJrm','green','\x20\x20Target:\x20','filter','hasChanges','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)','5002312ISUida','6066IEXnht','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','2331624BGRarj','yellow','cyan','setPhase','Pulling\x20segments\x20from\x20\x27','content','Aborted.','error'];a30_0x23dd=function(){return _0x39e90d;};return a30_0x23dd();}import{saveSessionContext}from'../core/session.js';import a30_0xaf1a69 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x53e3bd from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a30_0x1ad476(0x16f);[a30_0x1ad476(0x14d)]=a30_0x1ad476(0x182);async['execute'](_0x198710){const _0x333402=a30_0x1ad476,{options:_0x11a464,args:_0x22cc9f,tdx:_0xdd115d}=_0x198710,_0x9e1b9b=_0x11a464,_0x2399cf=await resolveTarget({'arg':_0x22cc9f[0x0],'contextParent':_0x11a464[_0x333402(0x144)],'cwd':process[_0x333402(0x179)]()});if(!isSuccessfulResolution(_0x2399cf))return _0x2399cf['errorCode']===_0x333402(0x157)?(console[_0x333402(0x169)](a30_0xaf1a69['yellow'](_0x333402(0x16b))),console[_0x333402(0x169)](_0x333402(0x15d)),console[_0x333402(0x169)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x333402(0x169)](_0x333402(0x161))):(console[_0x333402(0x169)](a30_0xaf1a69[_0x333402(0x16e)](_0x333402(0x176)+_0x2399cf[_0x333402(0x180)]+'\x0a')),_0x2399cf[_0x333402(0x17c)]&&console[_0x333402(0x169)](a30_0xaf1a69['cyan'](_0x2399cf[_0x333402(0x17c)]))),0x1;const _0x2fb16b=_0x2399cf[_0x333402(0x151)],_0x535dfc=_0x2399cf['targetDir'],_0x22a9d8=_0x2399cf['type']===_0x333402(0x155)?_0x2399cf[_0x333402(0x14f)]:undefined;_0x9e1b9b[_0x333402(0x14c)]&&(console[_0x333402(0x169)](_0x333402(0x147)+_0x9e1b9b[_0x333402(0x17d)]),console[_0x333402(0x169)](_0x333402(0x170)+_0x2fb16b),_0x22a9d8&&console['error']('Target\x20resource:\x20'+_0x22a9d8));const _0x1a58a8=await withProgressSpinner(_0x333402(0x166)+_0x2fb16b+'\x27...',_0x344d47=>_0xdd115d[_0x333402(0x16c)][_0x333402(0x143)](_0x2fb16b,{'targetDir':_0x535dfc,'targetResourceName':_0x22a9d8,'verbose':_0x9e1b9b[_0x333402(0x14c)],'progress':{'update':_0x2a5930=>{const _0x30f6b6=_0x333402;_0x344d47[_0x30f6b6(0x165)](_0x2a5930),_0x9e1b9b[_0x30f6b6(0x14c)]&&console[_0x30f6b6(0x169)]('\x20\x20'+_0x2a5930);}}}),{'verbose':_0x9e1b9b[_0x333402(0x14c)]}),_0x201903=_0x1a58a8[_0x333402(0x149)];if(_0x201903[_0x333402(0x175)][_0x333402(0x17f)]===0x0&&_0x201903[_0x333402(0x175)][_0x333402(0x177)]===0x0)return console['error'](a30_0xaf1a69[_0x333402(0x163)](_0x333402(0x17e)+_0x201903[_0x333402(0x151)]+'\x27')),0x0;const _0x28d868=_0x201903[_0x333402(0x17b)][_0x333402(0x15b)](_0x13ccf7=>_0x13ccf7[_0x333402(0x154)]),_0x2ebeb1=_0x201903[_0x333402(0x17b)][_0x333402(0x15b)](_0x485cc3=>!_0x485cc3[_0x333402(0x154)]&&_0x485cc3[_0x333402(0x15c)]),_0xca1641=_0x201903[_0x333402(0x17b)]['filter'](_0x54bb6a=>!_0x54bb6a[_0x333402(0x154)]&&!_0x54bb6a[_0x333402(0x15c)]);console[_0x333402(0x169)]('\x0aPull\x20summary\x20for\x20\x27'+_0x201903['parentName']+'\x27:'),console[_0x333402(0x169)](_0x333402(0x187)+a30_0xaf1a69[_0x333402(0x164)](_0x201903[_0x333402(0x175)][_0x333402(0x17f)]+_0x333402(0x142))+'\x20with\x20'+a30_0xaf1a69[_0x333402(0x164)](_0x201903[_0x333402(0x175)]['activations']+_0x333402(0x188)));if(_0x201903[_0x333402(0x175)]['journeys']>0x0){const _0x3f51db=_0x201903['counts'][_0x333402(0x146)]>_0x201903['counts']['journeys']?'\x20('+_0x201903[_0x333402(0x175)][_0x333402(0x146)]+'\x20versions)':'';console[_0x333402(0x169)]('\x20\x20πŸ—ΊοΈ\x20\x20'+a30_0xaf1a69[_0x333402(0x164)](_0x201903['counts'][_0x333402(0x177)]+_0x333402(0x150))+a30_0xaf1a69[_0x333402(0x148)](_0x3f51db));}console[_0x333402(0x169)]('\x20\x20'+a30_0xaf1a69[_0x333402(0x159)]('+\x20'+_0x28d868[_0x333402(0x160)]+_0x333402(0x171))),console[_0x333402(0x169)]('\x20\x20'+a30_0xaf1a69['yellow']('~\x20'+_0x2ebeb1[_0x333402(0x160)]+_0x333402(0x13d))),console[_0x333402(0x169)]('\x20\x20'+a30_0xaf1a69[_0x333402(0x148)]('=\x20'+_0xca1641[_0x333402(0x160)]+_0x333402(0x178))),console[_0x333402(0x169)](_0x333402(0x15a)+a30_0xaf1a69[_0x333402(0x164)](_0x201903['targetDir'])+'\x0a');if(_0x2ebeb1[_0x333402(0x160)]>0x0)for(const _0xf9c830 of _0x2ebeb1){console[_0x333402(0x169)](_0x333402(0x14a)+_0xf9c830[_0x333402(0x172)]+'\x27:'),console[_0x333402(0x169)]('─'[_0x333402(0x16d)](0x3c)),console['error'](_0xf9c830[_0x333402(0x174)]),console[_0x333402(0x169)]('─'[_0x333402(0x16d)](0x3c));}if(_0x9e1b9b[_0x333402(0x186)])return console[_0x333402(0x169)](a30_0xaf1a69[_0x333402(0x163)](_0x333402(0x173))),0x0;if(_0x28d868[_0x333402(0x160)]===0x0&&_0x2ebeb1[_0x333402(0x160)]===0x0)return console['error'](a30_0xaf1a69['green'](_0x333402(0x13c))),saveSessionContext({'parent_segment':_0x201903[_0x333402(0x151)]},_0x9e1b9b['session']),console['error'](a30_0xaf1a69['green'](_0x333402(0x184)+a30_0xaf1a69[_0x333402(0x148)](_0x333402(0x17a))+'\x20=\x20'+a30_0xaf1a69[_0x333402(0x164)](_0x201903[_0x333402(0x151)]))),0x0;if(!_0x9e1b9b['yes']){if(!isInteractive())return console[_0x333402(0x169)](a30_0xaf1a69[_0x333402(0x16e)]('\x0aError:'),_0x333402(0x152)),console[_0x333402(0x169)](a30_0xaf1a69['dim'](_0x333402(0x14b))),0x1;const _0x14ca89=await confirmKey('Write\x20'+(_0x28d868[_0x333402(0x160)]+_0x2ebeb1[_0x333402(0x160)])+'\x20files?');if(!_0x14ca89)return console[_0x333402(0x169)](a30_0xaf1a69[_0x333402(0x163)](_0x333402(0x168)),_0x333402(0x13f)),0x1;}for(const _0xfd90e5 of _0x201903[_0x333402(0x17b)]){if(_0xfd90e5['isNew']||_0xfd90e5[_0x333402(0x15c)]){const _0x5df29c=a30_0x53e3bd['dirname'](_0xfd90e5[_0x333402(0x153)]);!existsSync(_0x5df29c)&&mkdirSync(_0x5df29c,{'recursive':!![]}),writeFileSync(_0xfd90e5[_0x333402(0x153)],_0xfd90e5[_0x333402(0x167)],_0x333402(0x141));}}return console[_0x333402(0x169)](a30_0xaf1a69[_0x333402(0x159)]('βœ”\x20Pulled\x20'+(_0x28d868[_0x333402(0x160)]+_0x2ebeb1[_0x333402(0x160)])+_0x333402(0x156)+_0x201903[_0x333402(0x145)])),saveSessionContext({'parent_segment':_0x201903['parentName']},_0x9e1b9b[_0x333402(0x181)]),console[_0x333402(0x169)](a30_0xaf1a69['green'](_0x333402(0x184)+a30_0xaf1a69['dim'](_0x333402(0x17a))+_0x333402(0x185)+a30_0xaf1a69['cyan'](_0x201903['parentName']))),0x0;}}
1
+ function a30_0x7710(){const _0x2fda81=['helpText','parentSegment','session','\x20journeys','cyan','32217AaSCPQ','dirname','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cwd','parent_segment','journeyVersions','hasChanges','filter','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pulling\x20segments\x20from\x20\x27','155asJlvb','\x27...','targetDir','isNew','setPhase','data','green','site','\x0aChanges\x20to\x20\x27','pullSegments','Site:\x20','segments','Error:\x20','\x20new\x20files','βœ”\x20Pulled\x20','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','segment','length','type','\x20\x20πŸ—ΊοΈ\x20\x20','\x20files?','\x20activations','dryRun','271002XEbRxz','resourceName','\x20with\x20','no_parent','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','9812901mUgvJL','1837908exqCQk','name','files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','1436648ShltiW','error','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)','yellow','dim','\x20versions)','utf-8','relativePath','Aborted.','\x20files\x20to\x20','\x20changed\x20files','execute','\x20=\x20','errorCode','parentName','βœ”\x20Context\x20set:\x20','verbose','1674300ZvrfRb','9wPMgAW','absolutePath','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','diff','\x20\x20🎯\x20','counts','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','2735416PGBNqM','repeat','\x20unchanged\x20files','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation'];a30_0x7710=function(){return _0x2fda81;};return a30_0x7710();}const a30_0x533de9=a30_0x4a44;(function(_0x4e102a,_0x4c4467){const _0x189311=a30_0x4a44,_0x58c1af=_0x4e102a();while(!![]){try{const _0xc4df9a=-parseInt(_0x189311(0x15a))/0x1+parseInt(_0x189311(0x196))/0x2+parseInt(_0x189311(0x181))/0x3+-parseInt(_0x189311(0x19f))/0x4+-parseInt(_0x189311(0x164))/0x5*(parseInt(_0x189311(0x17b))/0x6)+parseInt(_0x189311(0x180))/0x7+-parseInt(_0x189311(0x185))/0x8*(-parseInt(_0x189311(0x197))/0x9);if(_0xc4df9a===_0x4c4467)break;else _0x58c1af['push'](_0x58c1af['shift']());}catch(_0x14e9f8){_0x58c1af['push'](_0x58c1af['shift']());}}}(a30_0x7710,0xdf612));function a30_0x4a44(_0x2c8e82,_0x3a9776){_0x2c8e82=_0x2c8e82-0x156;const _0x7710f6=a30_0x7710();let _0x4a44f4=_0x7710f6[_0x2c8e82];return _0x4a44f4;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x32dc83 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x48194f 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{[a30_0x533de9(0x182)]='segment:pull';['description']=a30_0x533de9(0x19e);async[a30_0x533de9(0x190)](_0x4ca853){const _0x3bc9ca=a30_0x533de9,{options:_0x6bca86,args:_0x4c9a14,tdx:_0x404a1e}=_0x4ca853,_0x551a4a=_0x6bca86,_0x3d7a5d=await resolveTarget({'arg':_0x4c9a14[0x0],'contextParent':_0x6bca86[_0x3bc9ca(0x156)],'cwd':process[_0x3bc9ca(0x15d)]()});if(!isSuccessfulResolution(_0x3d7a5d))return _0x3d7a5d[_0x3bc9ca(0x192)]===_0x3bc9ca(0x17e)?(console[_0x3bc9ca(0x186)](a30_0x32dc83[_0x3bc9ca(0x188)](_0x3bc9ca(0x184))),console['error'](_0x3bc9ca(0x187)),console[_0x3bc9ca(0x186)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x3bc9ca(0x186)](_0x3bc9ca(0x19a))):(console[_0x3bc9ca(0x186)](a30_0x32dc83['red'](_0x3bc9ca(0x170)+_0x3d7a5d['message']+'\x0a')),_0x3d7a5d[_0x3bc9ca(0x1a3)]&&console['error'](a30_0x32dc83[_0x3bc9ca(0x159)](_0x3d7a5d[_0x3bc9ca(0x1a3)]))),0x1;const _0x20e54f=_0x3d7a5d[_0x3bc9ca(0x193)],_0x227756=_0x3d7a5d['targetDir'],_0x5135c7=_0x3d7a5d[_0x3bc9ca(0x176)]==='file'?_0x3d7a5d[_0x3bc9ca(0x17c)]:undefined;_0x551a4a['verbose']&&(console[_0x3bc9ca(0x186)](_0x3bc9ca(0x16e)+_0x551a4a[_0x3bc9ca(0x16b)]),console['error']('Parent\x20segment:\x20'+_0x20e54f),_0x5135c7&&console['error']('Target\x20resource:\x20'+_0x5135c7));const _0x484e21=await withProgressSpinner(_0x3bc9ca(0x163)+_0x20e54f+_0x3bc9ca(0x165),_0x4c345a=>_0x404a1e[_0x3bc9ca(0x174)][_0x3bc9ca(0x16d)](_0x20e54f,{'targetDir':_0x227756,'targetResourceName':_0x5135c7,'verbose':_0x551a4a[_0x3bc9ca(0x195)],'progress':{'update':_0x5b3fdb=>{const _0x1a1d55=_0x3bc9ca;_0x4c345a[_0x1a1d55(0x168)](_0x5b3fdb),_0x551a4a[_0x1a1d55(0x195)]&&console[_0x1a1d55(0x186)]('\x20\x20'+_0x5b3fdb);}}}),{'verbose':_0x551a4a[_0x3bc9ca(0x195)]}),_0x1fad74=_0x484e21[_0x3bc9ca(0x169)];if(_0x1fad74[_0x3bc9ca(0x19d)][_0x3bc9ca(0x16f)]===0x0&&_0x1fad74[_0x3bc9ca(0x19d)]['journeys']===0x0)return console[_0x3bc9ca(0x186)](a30_0x32dc83['yellow'](_0x3bc9ca(0x17f)+_0x1fad74[_0x3bc9ca(0x193)]+'\x27')),0x0;const _0x32cb44=_0x1fad74['files'][_0x3bc9ca(0x161)](_0x419263=>_0x419263[_0x3bc9ca(0x167)]),_0xc56ac0=_0x1fad74[_0x3bc9ca(0x183)]['filter'](_0xc3dfa0=>!_0xc3dfa0['isNew']&&_0xc3dfa0[_0x3bc9ca(0x160)]),_0x299e5d=_0x1fad74['files'][_0x3bc9ca(0x161)](_0x16d735=>!_0x16d735[_0x3bc9ca(0x167)]&&!_0x16d735[_0x3bc9ca(0x160)]);console[_0x3bc9ca(0x186)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1fad74[_0x3bc9ca(0x193)]+'\x27:'),console[_0x3bc9ca(0x186)](_0x3bc9ca(0x19c)+a30_0x32dc83['cyan'](_0x1fad74[_0x3bc9ca(0x19d)]['segments']+'\x20segments')+_0x3bc9ca(0x17d)+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74[_0x3bc9ca(0x19d)]['activations']+_0x3bc9ca(0x179)));if(_0x1fad74['counts']['journeys']>0x0){const _0x3b7ea6=_0x1fad74[_0x3bc9ca(0x19d)][_0x3bc9ca(0x15f)]>_0x1fad74[_0x3bc9ca(0x19d)]['journeys']?'\x20('+_0x1fad74['counts'][_0x3bc9ca(0x15f)]+_0x3bc9ca(0x18a):'';console[_0x3bc9ca(0x186)](_0x3bc9ca(0x177)+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74['counts']['journeys']+_0x3bc9ca(0x158))+a30_0x32dc83['dim'](_0x3b7ea6));}console['error']('\x20\x20'+a30_0x32dc83[_0x3bc9ca(0x16a)]('+\x20'+_0x32cb44[_0x3bc9ca(0x175)]+_0x3bc9ca(0x171))),console[_0x3bc9ca(0x186)]('\x20\x20'+a30_0x32dc83[_0x3bc9ca(0x188)]('~\x20'+_0xc56ac0[_0x3bc9ca(0x175)]+_0x3bc9ca(0x18f))),console[_0x3bc9ca(0x186)]('\x20\x20'+a30_0x32dc83[_0x3bc9ca(0x189)]('=\x20'+_0x299e5d['length']+_0x3bc9ca(0x1a1))),console['error']('\x20\x20Target:\x20'+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74[_0x3bc9ca(0x166)])+'\x0a');if(_0xc56ac0[_0x3bc9ca(0x175)]>0x0)for(const _0x2a7d7c of _0xc56ac0){console['error'](_0x3bc9ca(0x16c)+_0x2a7d7c[_0x3bc9ca(0x18c)]+'\x27:'),console[_0x3bc9ca(0x186)]('─'['repeat'](0x3c)),console[_0x3bc9ca(0x186)](_0x2a7d7c[_0x3bc9ca(0x19b)]),console['error']('─'[_0x3bc9ca(0x1a0)](0x3c));}if(_0x551a4a[_0x3bc9ca(0x17a)])return console['error'](a30_0x32dc83[_0x3bc9ca(0x188)](_0x3bc9ca(0x15c))),0x0;if(_0x32cb44['length']===0x0&&_0xc56ac0[_0x3bc9ca(0x175)]===0x0)return console[_0x3bc9ca(0x186)](a30_0x32dc83[_0x3bc9ca(0x16a)](_0x3bc9ca(0x173))),saveSessionContext({'parent_segment':_0x1fad74[_0x3bc9ca(0x193)]},_0x551a4a[_0x3bc9ca(0x157)]),console[_0x3bc9ca(0x186)](a30_0x32dc83['green'](_0x3bc9ca(0x194)+a30_0x32dc83[_0x3bc9ca(0x189)](_0x3bc9ca(0x15e))+_0x3bc9ca(0x191)+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74[_0x3bc9ca(0x193)]))),0x0;if(!_0x551a4a['yes']){if(!isInteractive())return console['error'](a30_0x32dc83['red'](_0x3bc9ca(0x199)),_0x3bc9ca(0x162)),console[_0x3bc9ca(0x186)](a30_0x32dc83[_0x3bc9ca(0x189)](_0x3bc9ca(0x1a2))),0x1;const _0x54a468=await confirmKey('Write\x20'+(_0x32cb44[_0x3bc9ca(0x175)]+_0xc56ac0[_0x3bc9ca(0x175)])+_0x3bc9ca(0x178));if(!_0x54a468)return console[_0x3bc9ca(0x186)](a30_0x32dc83[_0x3bc9ca(0x188)](_0x3bc9ca(0x18d)),'-\x20no\x20files\x20written'),0x1;}for(const _0x209284 of _0x1fad74[_0x3bc9ca(0x183)]){if(_0x209284[_0x3bc9ca(0x167)]||_0x209284['hasChanges']){const _0x15ed69=a30_0x48194f[_0x3bc9ca(0x15b)](_0x209284[_0x3bc9ca(0x198)]);!existsSync(_0x15ed69)&&mkdirSync(_0x15ed69,{'recursive':!![]}),writeFileSync(_0x209284[_0x3bc9ca(0x198)],_0x209284['content'],_0x3bc9ca(0x18b));}}return console[_0x3bc9ca(0x186)](a30_0x32dc83['green'](_0x3bc9ca(0x172)+(_0x32cb44[_0x3bc9ca(0x175)]+_0xc56ac0[_0x3bc9ca(0x175)])+_0x3bc9ca(0x18e)+_0x1fad74[_0x3bc9ca(0x166)])),saveSessionContext({'parent_segment':_0x1fad74['parentName']},_0x551a4a[_0x3bc9ca(0x157)]),console['error'](a30_0x32dc83[_0x3bc9ca(0x16a)](_0x3bc9ca(0x194)+a30_0x32dc83['dim'](_0x3bc9ca(0x15e))+_0x3bc9ca(0x191)+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74[_0x3bc9ca(0x193)]))),0x0;}}
@@ -1 +1 @@
1
- const a31_0x3323a9=a31_0x3b7d;(function(_0x5c0fa9,_0x952f6f){const _0x5d1d18=a31_0x3b7d,_0xc177ad=_0x5c0fa9();while(!![]){try{const _0x5500e3=-parseInt(_0x5d1d18(0x1e0))/0x1+-parseInt(_0x5d1d18(0x1a3))/0x2*(-parseInt(_0x5d1d18(0x1a6))/0x3)+parseInt(_0x5d1d18(0x1f0))/0x4*(-parseInt(_0x5d1d18(0x1c6))/0x5)+parseInt(_0x5d1d18(0x1ae))/0x6+-parseInt(_0x5d1d18(0x1f3))/0x7*(-parseInt(_0x5d1d18(0x1c9))/0x8)+-parseInt(_0x5d1d18(0x161))/0x9+parseInt(_0x5d1d18(0x1d6))/0xa*(parseInt(_0x5d1d18(0x1b2))/0xb);if(_0x5500e3===_0x952f6f)break;else _0xc177ad['push'](_0xc177ad['shift']());}catch(_0x11371e){_0xc177ad['push'](_0xc177ad['shift']());}}}(a31_0x2ab7,0x371d9));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a31_0x2ab7(){const _0x574c54=['map','journeyBundleName','353534AmhUbs','join','Changes\x20to:','6QayqHH','\x20to\x20delete','parentSegment','isScoped','(Journey\x20will\x20be\x20deleted)','resolveParentId','error','endsWith','1877880hVyvgi','existingJourney','diff','toCreate','11MkHRNw','\x20\x20Activations:\x20','new','user','\x20deleted','Changes\x20to\x20journey:','\x20to\x20create','blue','journeys','unchanged','Delete\x20segment:','message','execute','Fetching\x20existing\x20segments...','targetDir','connection','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','segment:push','all','/app/ps/','5cArDok','listSegments','\x0aPush\x20summary\x20for\x20\x27','2193376kfcWSO','\x20\x20Source:\x20','\x20created','Fetching\x20parent\x20segment\x20details...','dryRun','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','nameToType','\x20unchanged','toDelete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','length','\x20activations]','getParent','90260HEvHkn','listJourneysWithDetailsFromParentSegment','\x20\x20πŸ“Š\x20Segments:','πŸ“\x20','add','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','listFolders','isNew','\x20YAML\x20files\x20found','description','338252tcQaQF','\x0aβœ”\x20Push\x20complete','\x20\x20Journeys:\x20','parentName','folderId','name','updatedAt','site','results','cyan','/j/da/je','no_parent','type','\x20\x20Segments:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','relationships','71488AluMHo','Parent\x20segment:\x20','Delete\x20journey:','7MwemBh','\x20folders\x20to\x20create','green','\x20changed','segments','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','dim','delete','getJourney','3310515VJMmxx','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','red','Resolving\x20parent\x20segment\x20\x27','parentFolder','Folders\x20to\x20create:','idToName','attributes','Site:\x20','list','/e/','journey','folders','scopedFolderPath','set','\x0aError:','\x20updated','Source\x20directory:\x20','segment\x20or\x20journey','push','repeat','deleted','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errorCode','\x0aValidation\x20failed:','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','created','folderPath','state','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','paused','createdSegmentIds','getOutputSchemaWithCache','verbose','\x20new','then','\x20\x20\x20\x20','Scoped\x20to\x20folder:\x20','segmentFolderId','\x20\x20Activations:','Error:\x20Directory\x20not\x20found:\x20','get','journeysOnly','Fetching\x20existing\x20activations...','updated','\x20changes?','activations','yamlConfig','parent_name','filePath','New\x20segment:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','nameToId','changed','helpText','segment','journeyId','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','yellow','Error\x20parsing\x20YAML:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','data','filter','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files'];a31_0x2ab7=function(){return _0x574c54;};return a31_0x2ab7();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x25be58 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a31_0x3b7d(_0x2f8471,_0x5e5597){_0x2f8471=_0x2f8471-0x15d;const _0x2ab72f=a31_0x2ab7();let _0x3b7dec=_0x2ab72f[_0x2f8471];return _0x3b7dec;}import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a31_0x3323a9(0x1c3);[a31_0x3323a9(0x1df)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a31_0x3323a9(0x1be)](_0x25c001){const _0x15b353=a31_0x3323a9,{options:_0x387222,args:_0xe1b6e9,tdx:_0x4ba8e1}=_0x25c001,_0x4801f1=_0x387222,_0x118b16=await resolveTarget({'arg':_0xe1b6e9[0x0],'contextParent':_0x387222[_0x15b353(0x1a8)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x118b16))return _0x118b16[_0x15b353(0x178)]===_0x15b353(0x1eb)?(console['error'](a31_0x25be58['yellow'](_0x15b353(0x177))),console['error']('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[_0x15b353(0x1ac)](_0x15b353(0x1d2)),console[_0x15b353(0x1ac)](_0x15b353(0x162))):(console[_0x15b353(0x1ac)](a31_0x25be58['red']('Error:\x20'+_0x118b16['message']+'\x0a')),_0x118b16[_0x15b353(0x197)]&&console[_0x15b353(0x1ac)](a31_0x25be58['cyan'](_0x118b16['helpText']))),0x1;if(_0x118b16[_0x15b353(0x1ec)]===_0x15b353(0x191))return console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x163)](_0x15b353(0x189)+_0x118b16[_0x15b353(0x1c0)]+'\x0a')),console['error'](a31_0x25be58[_0x15b353(0x1e9)](_0x15b353(0x15d))),0x1;const _0x4ad6ed=_0x118b16[_0x15b353(0x1e3)],_0x34316a=_0x118b16[_0x15b353(0x1c0)],_0x4887b8=_0x118b16[_0x15b353(0x1ec)]==='file'?_0x118b16[_0x15b353(0x192)]:undefined,_0x1db646=getScopedDetails(_0x118b16),_0x5175ed=_0x1db646?.[_0x15b353(0x1a9)]??![],_0x10e5b6=_0x1db646?.[_0x15b353(0x16e)]??'';if(!existsSync(_0x34316a))return console['error'](a31_0x25be58[_0x15b353(0x163)](_0x15b353(0x189)+_0x34316a+'\x0a')),console[_0x15b353(0x1ac)](a31_0x25be58['cyan'](_0x15b353(0x15d))),0x1;_0x4801f1[_0x15b353(0x182)]&&(console[_0x15b353(0x1ac)](_0x15b353(0x169)+_0x4801f1[_0x15b353(0x1e7)]),console[_0x15b353(0x1ac)](_0x15b353(0x1f1)+_0x4ad6ed),console[_0x15b353(0x1ac)](_0x15b353(0x172)+_0x34316a),_0x5175ed&&console['error'](_0x15b353(0x186)+_0x10e5b6));const _0x65f3=await withSpinner(_0x15b353(0x164)+_0x4ad6ed+'\x27...',()=>_0x4ba8e1[_0x15b353(0x198)][_0x15b353(0x1ab)](_0x4ad6ed),{'verbose':_0x4801f1['verbose']}),_0x4ebe42=_0x65f3[_0x15b353(0x19e)],[_0x4514a2,_0x27dc4b,_0xa7f382,_0x5b1274,_0x47e630]=await Promise[_0x15b353(0x1c4)]([withSpinner(_0x15b353(0x1cc),()=>_0x4ba8e1['segment'][_0x15b353(0x1d5)](_0x4ebe42),{'verbose':_0x4801f1['verbose']}),withSpinner(_0x15b353(0x1bf),()=>_0x4ba8e1['segment'][_0x15b353(0x1c7)](_0x4ebe42),{'verbose':_0x4801f1[_0x15b353(0x182)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x4ba8e1['segment'][_0x15b353(0x1dc)](_0x4ebe42),{'verbose':_0x4801f1['verbose']}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x4ba8e1[_0x15b353(0x16c)][_0x15b353(0x1d7)](_0x4ebe42,{'includeAllVersions':!![]}),{'verbose':_0x4801f1[_0x15b353(0x182)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x4ba8e1[_0x15b353(0x1b5)]['buildUserMaps'](),{'verbose':_0x4801f1['verbose']})[_0x15b353(0x184)](_0x2423f4=>_0x2423f4['data'])]),_0x19285b=_0x4514a2[_0x15b353(0x19e)],_0x2e3279=extractRootFolderId(_0x19285b),_0x42e063=_0x27dc4b[_0x15b353(0x19e)],_0xdf6bec=_0xa7f382[_0x15b353(0x19e)],{journeys:_0x239122,activationStepsById:_0x297cfb}=_0x5b1274[_0x15b353(0x19e)],_0x2b6317=new Map(_0x239122['map'](_0x27a5a1=>[_0x27a5a1['id'],_0x27a5a1])),_0x2b98c2=_0x239122[_0x15b353(0x1a1)](_0x1dc8b7=>({'id':_0x1dc8b7['id'],'name':_0x1dc8b7[_0x15b353(0x168)][_0x15b353(0x1e5)],'journeyBundleName':_0x1dc8b7[_0x15b353(0x168)][_0x15b353(0x1a2)]||'','journeyBundleId':_0x1dc8b7[_0x15b353(0x168)]['journeyBundleId']||'','versionNumber':_0x1dc8b7['attributes']['versionNumber'],'description':_0x1dc8b7[_0x15b353(0x168)][_0x15b353(0x1df)],'state':_0x1dc8b7[_0x15b353(0x168)][_0x15b353(0x17d)],'paused':_0x1dc8b7[_0x15b353(0x168)][_0x15b353(0x17f)],'audienceId':_0x1dc8b7[_0x15b353(0x168)]['audienceId'],'folderId':_0x1dc8b7[_0x15b353(0x1ef)]?.[_0x15b353(0x165)]?.['data']?.['id'],'createdAt':_0x1dc8b7[_0x15b353(0x168)]['createdAt'],'updatedAt':_0x1dc8b7[_0x15b353(0x168)][_0x15b353(0x1e6)]})),{emailToId:_0x475194,idToEmail:_0x358bfd}=_0x47e630,_0x843710=await withSpinner(_0x15b353(0x1ee),async()=>{const _0x2f8fc2=_0x15b353,_0x339e02=await _0x4ba8e1[_0x2f8fc2(0x1c1)][_0x2f8fc2(0x16a)]();return buildConnectionMaps(_0x339e02);},{'verbose':_0x4801f1[_0x15b353(0x182)]})[_0x15b353(0x184)](_0x559737=>_0x559737[_0x15b353(0x19e)]),_0x2a2a1d=_0x843710[_0x15b353(0x195)],_0x28f222=_0x843710[_0x15b353(0x167)],_0x1ef43a=_0x843710[_0x15b353(0x1cf)],_0x2f7a74={'emailToIdMap':_0x475194,'connectionNameToIdMap':_0x2a2a1d,'connectionNameToTypeMap':_0x1ef43a,'getSchema':_0x48ec09=>_0x4ba8e1[_0x15b353(0x1c1)][_0x15b353(0x181)](_0x48ec09)};let {pathToId:_0x2d8c86,idToPath:_0x1a87be}=buildFolderMaps(_0xdf6bec);const _0x9e8ac2=buildSegmentLookupMap(_0x42e063,_0x1a87be),_0xc20188=buildSegmentNameToIdMap(_0x42e063),_0x1dee1c=buildJourneyBundleLookupMap(_0x2b98c2,_0x1a87be);let _0x8bbde5;if(_0x4887b8){if(!_0x4887b8[_0x15b353(0x1ad)]('.yml')&&!_0x4887b8[_0x15b353(0x1ad)]('.yaml'))return console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x163)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x4887b8+'\x0a')),0x1;_0x8bbde5=[_0x4887b8];}else _0x8bbde5=findYamlFiles(_0x34316a);if(_0x8bbde5[_0x15b353(0x1d3)]===0x0)return console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x163)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x34316a+'\x0a')),console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x1e9)](_0x15b353(0x1a0))),0x1;let _0x767419,_0x800ed5;try{const _0x490b6b=parseAndClassifyYamlFiles(_0x8bbde5,_0x34316a,{'skipSegments':_0x4801f1['journeysOnly']});_0x767419=_0x490b6b[_0x15b353(0x1f7)],_0x800ed5=_0x490b6b[_0x15b353(0x1ba)];const _0x339a05=validateParsedFiles(_0x490b6b,_0x34316a);if(_0x339a05['length']>0x0)return console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x163)](_0x15b353(0x179))),console[_0x15b353(0x1ac)](formatValidationErrors(_0x339a05)),console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x19b)](_0x15b353(0x1c2))),0x1;}catch(_0x44c632){return console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x163)](_0x15b353(0x19c)+(_0x44c632 instanceof Error?_0x44c632[_0x15b353(0x1bd)]:_0x44c632))),0x1;}if(_0x767419[_0x15b353(0x1d3)]===0x0&&_0x800ed5[_0x15b353(0x1d3)]===0x0){const _0x5cab2d=_0x4801f1[_0x15b353(0x18b)]?_0x15b353(0x16c):_0x15b353(0x173);return console['error'](a31_0x25be58['yellow']('No\x20'+_0x5cab2d+_0x15b353(0x1de))),0x0;}const _0x36af98=new Map();_0x42e063[_0x15b353(0x1d3)]>0x0&&!_0x4801f1['journeysOnly']&&await withSpinner(_0x15b353(0x18c),async()=>{await batchAsync(_0x42e063,async _0x18e991=>{const _0x853eb2=await _0x4ba8e1['segment']['listActivations'](_0x4ebe42,_0x18e991['id']);_0x36af98['set'](_0x18e991['id'],_0x853eb2);});},{'verbose':_0x4801f1[_0x15b353(0x182)]});const {segmentFiles:_0x319fe4,foldersToCreate:_0x1e98fa}=await prepareSegmentFiles(_0x767419,{'segmentByFolderAndName':_0x9e8ac2,'activationsBySegmentId':_0x36af98,'folderPathToId':_0x2d8c86,'idToEmailMap':_0x358bfd,'connectionIdToNameMap':_0x28f222},_0x2f7a74,_0x5175ed,_0x10e5b6),_0x503bd=_0x4887b8?[]:findSegmentsToDelete(_0x42e063,_0x767419['map'](({yamlConfig:_0x3ea396,folderPath:_0x14c194})=>({'yamlConfig':_0x3ea396,'folderPath':resolveTDFolderPath(_0x14c194,_0x5175ed,_0x10e5b6)})),_0x1a87be,_0x10e5b6,_0x5175ed),{journeyFiles:_0x79efc5,foldersToCreate:_0x5420fc}=await withProgressSpinner('Preparing\x20journeys...',async _0x530da5=>prepareJourneyFiles(_0x800ed5,{'fetchJourney':async _0x4e2cb1=>_0x4ba8e1[_0x15b353(0x16c)][_0x15b353(0x160)](_0x4e2cb1[_0x15b353(0x199)]),'journeyBundlesByFolderAndName':_0x1dee1c,'folderPathToId':_0x2d8c86,'idToEmailMap':_0x358bfd,'connectionIdToNameMap':_0x28f222,'existingSegments':_0x42e063,'parentId':_0x4ebe42,'deps':_0x4ba8e1,'progress':{'update':_0x3bd232=>{const _0x19548d=_0x15b353;_0x530da5['setPhase'](_0x3bd232),_0x4801f1['verbose']&&console[_0x19548d(0x1ac)]('\x20\x20'+_0x3bd232);}},'journeyById':_0x2b6317,'activationStepsById':_0x297cfb},_0x5175ed,_0x10e5b6),{'verbose':_0x4801f1[_0x15b353(0x182)]})[_0x15b353(0x184)](_0x1ecc4d=>_0x1ecc4d[_0x15b353(0x19e)]);for(const _0x30eee8 of _0x5420fc){_0x1e98fa[_0x15b353(0x1da)](_0x30eee8);}const _0x517932=_0x4887b8?[]:findJourneysToDelete(_0x2b98c2,_0x800ed5[_0x15b353(0x1a1)](({yamlConfig:_0x40caf2,folderPath:_0x443eba})=>({'yamlConfig':_0x40caf2,'folderPath':resolveTDFolderPath(_0x443eba,_0x5175ed,_0x10e5b6)})),_0x1a87be,_0x10e5b6,_0x5175ed),_0x4be579=calculatePushStats(_0x319fe4,_0x79efc5,_0x1e98fa,_0x503bd,_0x517932,!!_0x4801f1[_0x15b353(0x15f)],!!_0x4801f1[_0x15b353(0x18b)]),_0x533c23=_0x4be579[_0x15b353(0x1f7)][_0x15b353(0x1b4)],_0x11fa30=_0x4be579[_0x15b353(0x1f7)]['changed'],_0x115a20=_0x4be579[_0x15b353(0x1f7)][_0x15b353(0x1bb)],_0x353c73=_0x4be579[_0x15b353(0x1f7)]['toDelete'],_0x38a9c5=_0x4be579[_0x15b353(0x16d)][_0x15b353(0x1b1)],_0x1e398b=_0x4be579[_0x15b353(0x1ba)]['new'],_0x389b0d=_0x4be579[_0x15b353(0x1ba)][_0x15b353(0x196)],_0x26dd48=_0x4be579['journeys'][_0x15b353(0x1bb)],_0x3eb7b9=_0x4be579[_0x15b353(0x1ba)][_0x15b353(0x1d1)],_0xb798ac=_0x4be579['activations']['all'],_0x58244f=_0x4be579['activations'][_0x15b353(0x1b1)],_0x3673a3=_0x4be579['activations']['toUpdate'],_0x401d5b=_0x4be579[_0x15b353(0x18f)][_0x15b353(0x1d1)];console[_0x15b353(0x1ac)](_0x15b353(0x1c8)+_0x4ad6ed+'\x27:');_0x38a9c5[_0x15b353(0x1d3)]>0x0&&console[_0x15b353(0x1ac)]('\x20\x20'+a31_0x25be58[_0x15b353(0x1b9)](_0x15b353(0x1d9)+_0x38a9c5['length']+_0x15b353(0x1f4)));if(!_0x4801f1[_0x15b353(0x18b)]){console[_0x15b353(0x1ac)](_0x15b353(0x1d8)),console['error'](_0x15b353(0x185)+a31_0x25be58[_0x15b353(0x1f5)]('+\x20'+_0x533c23['length']+_0x15b353(0x183))),console[_0x15b353(0x1ac)](_0x15b353(0x185)+a31_0x25be58[_0x15b353(0x19b)]('~\x20'+_0x11fa30[_0x15b353(0x1d3)]+_0x15b353(0x1f6)));if(_0x353c73[_0x15b353(0x1d3)]>0x0)console[_0x15b353(0x1ac)]('\x20\x20\x20\x20'+a31_0x25be58[_0x15b353(0x163)]('-\x20'+_0x353c73[_0x15b353(0x1d3)]+'\x20to\x20delete'));else _0x503bd[_0x15b353(0x1d3)]>0x0&&!_0x4801f1[_0x15b353(0x15f)]&&console['error']('\x20\x20\x20\x20'+a31_0x25be58[_0x15b353(0x15e)](_0x503bd[_0x15b353(0x1d3)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x15b353(0x1ac)]('\x20\x20\x20\x20'+a31_0x25be58[_0x15b353(0x15e)]('=\x20'+_0x115a20['length']+'\x20unchanged'));}if(_0x79efc5[_0x15b353(0x1d3)]>0x0||_0x517932[_0x15b353(0x1d3)]>0x0){console['error']('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0x15b353(0x1ac)]('\x20\x20\x20\x20'+a31_0x25be58[_0x15b353(0x1f5)]('+\x20'+_0x1e398b[_0x15b353(0x1d3)]+_0x15b353(0x183))),console[_0x15b353(0x1ac)](_0x15b353(0x185)+a31_0x25be58[_0x15b353(0x19b)]('~\x20'+_0x389b0d[_0x15b353(0x1d3)]+'\x20changed'));if(_0x3eb7b9[_0x15b353(0x1d3)]>0x0)console[_0x15b353(0x1ac)](_0x15b353(0x185)+a31_0x25be58[_0x15b353(0x163)]('-\x20'+_0x3eb7b9[_0x15b353(0x1d3)]+_0x15b353(0x1a7)));else _0x517932[_0x15b353(0x1d3)]>0x0&&!_0x4801f1[_0x15b353(0x15f)]&&console[_0x15b353(0x1ac)](_0x15b353(0x185)+a31_0x25be58[_0x15b353(0x15e)](_0x517932['length']+_0x15b353(0x17a)));console[_0x15b353(0x1ac)](_0x15b353(0x185)+a31_0x25be58['dim']('=\x20'+_0x26dd48[_0x15b353(0x1d3)]+_0x15b353(0x1d0)));}_0xb798ac['length']>0x0&&!_0x4801f1['journeysOnly']&&(console['error'](''),console[_0x15b353(0x1ac)](_0x15b353(0x188)),_0x58244f[_0x15b353(0x1d3)]>0x0&&console[_0x15b353(0x1ac)](_0x15b353(0x185)+a31_0x25be58['green']('+\x20'+_0x58244f['length']+_0x15b353(0x1b8))),_0x3673a3['length']>0x0&&console[_0x15b353(0x1ac)](_0x15b353(0x185)+a31_0x25be58[_0x15b353(0x19b)]('~\x20'+_0x3673a3[_0x15b353(0x1d3)]+'\x20to\x20update')),_0x401d5b[_0x15b353(0x1d3)]>0x0&&console[_0x15b353(0x1ac)](_0x15b353(0x185)+a31_0x25be58['red']('-\x20'+_0x401d5b[_0x15b353(0x1d3)]+'\x20to\x20delete')));console[_0x15b353(0x1ac)](_0x15b353(0x1ca)+a31_0x25be58[_0x15b353(0x1e9)](_0x34316a)+'\x0a');if(_0x38a9c5[_0x15b353(0x1d3)]>0x0){console['error'](_0x15b353(0x166));for(const _0x561d6c of _0x38a9c5){console['error']('\x20\x20'+a31_0x25be58['blue']('+')+'\x20'+_0x561d6c);}console[_0x15b353(0x1ac)]('');}if(_0x533c23[_0x15b353(0x1d3)]>0x0&&!_0x4801f1[_0x15b353(0x18b)])for(const _0x178059 of _0x533c23){const _0x5f19ad=_0x178059['folderPath']?_0x178059['folderPath']+'/'+_0x178059[_0x15b353(0x190)]['name']:_0x178059[_0x15b353(0x190)]['name'],_0x29c26b=_0x178059['yamlConfig'][_0x15b353(0x18f)]?.[_0x15b353(0x1d3)]||0x0,_0x5e5996=_0x29c26b>0x0?a31_0x25be58[_0x15b353(0x15e)]('\x20['+_0x29c26b+_0x15b353(0x1d4)):'';console[_0x15b353(0x1ac)]('\x0a'+a31_0x25be58[_0x15b353(0x1f5)](_0x15b353(0x193))+'\x20'+_0x5f19ad+_0x5e5996),console[_0x15b353(0x1ac)]('─'[_0x15b353(0x175)](0x3c)),_0x178059[_0x15b353(0x1b0)]&&console[_0x15b353(0x1ac)](_0x178059[_0x15b353(0x1b0)]),console[_0x15b353(0x1ac)]('─'[_0x15b353(0x175)](0x3c));}if(_0x353c73[_0x15b353(0x1d3)]>0x0&&!_0x4801f1['journeysOnly'])for(const _0x2012d5 of _0x353c73){const _0x3efbb6=_0x2012d5[_0x15b353(0x187)]?_0x1a87be[_0x15b353(0x18a)](_0x2012d5[_0x15b353(0x187)]['toString']())||'':'',_0x1a36b6=_0x3efbb6?_0x3efbb6+'/'+_0x2012d5[_0x15b353(0x1e5)]:_0x2012d5['name'],_0x5dcdd1=_0x36af98['get'](_0x2012d5['id'])||[],_0x727902=_0x5dcdd1[_0x15b353(0x1d3)]>0x0?a31_0x25be58['dim']('\x20['+_0x5dcdd1[_0x15b353(0x1d3)]+_0x15b353(0x1d4)):'';console[_0x15b353(0x1ac)]('\x0a'+a31_0x25be58[_0x15b353(0x163)](_0x15b353(0x1bc))+'\x20'+_0x1a36b6+_0x727902),console[_0x15b353(0x1ac)]('─'[_0x15b353(0x175)](0x3c));const _0x108e56=segmentWithActivationsToYaml(_0x2012d5,_0x5dcdd1,undefined,_0x358bfd,_0x28f222),_0x163ae6=segmentToYamlString(_0x108e56),_0x464af7=generateDiff(_0x163ae6,'');console[_0x15b353(0x1ac)](formatDiffWithColors(_0x464af7)),console[_0x15b353(0x1ac)]('─'[_0x15b353(0x175)](0x3c));}const _0x41654c=_0x319fe4[_0x15b353(0x19f)](_0x3ff536=>!_0x3ff536[_0x15b353(0x1dd)]&&_0x3ff536[_0x15b353(0x1b0)]);if(_0x41654c[_0x15b353(0x1d3)]>0x0&&!_0x4801f1[_0x15b353(0x18b)])for(const _0x20b59f of _0x41654c){const _0x14d4cf=_0x20b59f[_0x15b353(0x17c)]?_0x20b59f['folderPath']+'/'+_0x20b59f[_0x15b353(0x190)][_0x15b353(0x1e5)]:_0x20b59f[_0x15b353(0x190)][_0x15b353(0x1e5)];console[_0x15b353(0x1ac)]('\x0a'+a31_0x25be58[_0x15b353(0x19b)](_0x15b353(0x1a5))+'\x20'+_0x14d4cf),console[_0x15b353(0x1ac)]('─'[_0x15b353(0x175)](0x3c)),console['error'](_0x20b59f['diff']),console['error']('─'['repeat'](0x3c));}if(_0x1e398b[_0x15b353(0x1d3)]>0x0)for(const _0x13b8ff of _0x1e398b){const _0x103c87=_0x13b8ff[_0x15b353(0x17c)]?_0x13b8ff['folderPath']+'/'+_0x13b8ff['yamlConfig'][_0x15b353(0x1e5)]:_0x13b8ff[_0x15b353(0x190)][_0x15b353(0x1e5)];console[_0x15b353(0x1ac)]('\x0a'+a31_0x25be58['green']('New\x20journey:')+'\x20'+_0x103c87),console['error']('─'[_0x15b353(0x175)](0x3c)),_0x13b8ff[_0x15b353(0x1b0)]&&console[_0x15b353(0x1ac)](_0x13b8ff[_0x15b353(0x1b0)]),console[_0x15b353(0x1ac)]('─'['repeat'](0x3c));}const _0xcdb14a=_0x79efc5[_0x15b353(0x19f)](_0xf815d7=>!_0xf815d7[_0x15b353(0x1dd)]&&_0xf815d7[_0x15b353(0x1b0)]);if(_0xcdb14a[_0x15b353(0x1d3)]>0x0)for(const _0x16c17e of _0xcdb14a){const _0x4ae945=_0x16c17e[_0x15b353(0x17c)]?_0x16c17e[_0x15b353(0x17c)]+'/'+_0x16c17e[_0x15b353(0x190)][_0x15b353(0x1e5)]:_0x16c17e[_0x15b353(0x190)]['name'];console[_0x15b353(0x1ac)]('\x0a'+a31_0x25be58[_0x15b353(0x19b)](_0x15b353(0x1b7))+'\x20'+_0x4ae945),console[_0x15b353(0x1ac)]('─'[_0x15b353(0x175)](0x3c)),console['error'](_0x16c17e[_0x15b353(0x1b0)]),console[_0x15b353(0x1ac)]('─'[_0x15b353(0x175)](0x3c));}if(_0x3eb7b9['length']>0x0)for(const _0x4f256f of _0x3eb7b9){const _0x2d6c08=_0x4f256f[_0x15b353(0x1e4)]?_0x1a87be['get'](_0x4f256f['folderId'])||'':'',_0x486b4e=_0x2d6c08?_0x2d6c08+'/'+_0x4f256f[_0x15b353(0x1a2)]:_0x4f256f[_0x15b353(0x1a2)];console['error']('\x0a'+a31_0x25be58[_0x15b353(0x163)](_0x15b353(0x1f2))+'\x20'+_0x486b4e),console[_0x15b353(0x1ac)]('─'[_0x15b353(0x175)](0x3c)),console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x163)](_0x15b353(0x1aa))),console[_0x15b353(0x1ac)]('─'['repeat'](0x3c));}if(_0x4801f1[_0x15b353(0x1cd)])return console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x19b)](_0x15b353(0x17e))),0x0;const _0x35f4e0=_0x4801f1['journeysOnly']?![]:_0x533c23[_0x15b353(0x1d3)]>0x0||_0x11fa30[_0x15b353(0x1d3)]>0x0||_0x353c73[_0x15b353(0x1d3)]>0x0,_0x496ec9=_0x1e398b[_0x15b353(0x1d3)]>0x0||_0x389b0d[_0x15b353(0x1d3)]>0x0||_0x3eb7b9[_0x15b353(0x1d3)]>0x0,_0xec190c=_0x4801f1[_0x15b353(0x18b)]?![]:_0xb798ac[_0x15b353(0x1d3)]>0x0,_0x197f14=_0x38a9c5[_0x15b353(0x1d3)]>0x0;if(!_0x35f4e0&&!_0x496ec9&&!_0xec190c&&!_0x197f14){const _0x362548=_0x4801f1['journeysOnly']?_0x15b353(0x1ce):_0x15b353(0x19a);console['error'](a31_0x25be58[_0x15b353(0x1f5)](_0x362548));if(_0x4887b8&&_0x26dd48[_0x15b353(0x1d3)]===0x1){const _0x321976=_0x26dd48[0x0];if(_0x321976[_0x15b353(0x1af)]?.['id']){const _0x27ac6e=getConsoleNextUrl(_0x4801f1[_0x15b353(0x1e7)],_0x15b353(0x1c5)+_0x4ebe42+'/e/'+_0x321976[_0x15b353(0x1af)]['id']+_0x15b353(0x1ea));console[_0x15b353(0x1ac)]('\x20\x20'+a31_0x25be58[_0x15b353(0x1e9)](_0x27ac6e));}}return 0x0;}const _0x499e1e=_0x4801f1['journeysOnly']?_0x1e398b[_0x15b353(0x1d3)]+_0x389b0d[_0x15b353(0x1d3)]+_0x3eb7b9[_0x15b353(0x1d3)]+_0x38a9c5[_0x15b353(0x1d3)]:_0x533c23[_0x15b353(0x1d3)]+_0x11fa30[_0x15b353(0x1d3)]+_0x353c73[_0x15b353(0x1d3)]+_0x1e398b[_0x15b353(0x1d3)]+_0x389b0d[_0x15b353(0x1d3)]+_0x3eb7b9[_0x15b353(0x1d3)]+_0x38a9c5[_0x15b353(0x1d3)]+_0xb798ac[_0x15b353(0x1d3)];if(!_0x4801f1['yes']&&_0x499e1e>0x0){if(!isInteractive())return console[_0x15b353(0x1ac)](a31_0x25be58['red'](_0x15b353(0x170)),_0x15b353(0x194)),console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x15e)](_0x15b353(0x19d))),0x1;const _0xb616e5=await confirmKey('Push\x20'+_0x499e1e+_0x15b353(0x18e));if(!_0xb616e5)return console[_0x15b353(0x1ac)](a31_0x25be58['yellow']('Aborted.')),0x1;}const _0x29a9fb={'withProgress':async(_0x3dee67,_0x23331)=>{const _0x45a126=_0x15b353,_0x4b49fd=await withSpinner(_0x3dee67,_0x23331,{'verbose':_0x4801f1[_0x45a126(0x182)]});return{'data':_0x4b49fd[_0x45a126(0x19e)]};},'logInfo':_0x4d19c1=>console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x1b9)]('βœ”\x20'+_0x4d19c1)),'logSuccess':_0x19f890=>console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x1f5)]('βœ”\x20'+_0x19f890)),'logWarning':_0x49b890=>console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x19b)]('⚠\x20'+_0x49b890)),'logDeleted':_0x25a066=>console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x163)]('βœ”\x20'+_0x25a066))},_0x41ae66={'segment':_0x4ba8e1[_0x15b353(0x198)],'journey':_0x4ba8e1[_0x15b353(0x16c)],'user':_0x4ba8e1['user'],'connection':_0x4ba8e1[_0x15b353(0x1c1)]};_0x38a9c5['length']>0x0&&(_0x2d8c86=await executePushFolders(_0x41ae66,_0x38a9c5,_0x2d8c86,{'parentId':_0x4ebe42},_0x29a9fb));const _0x49e2ec={'rootFolderId':_0x2e3279,'folderPathToId':_0x2d8c86,'folderIdToPath':_0x1a87be,'segmentNameToId':_0xc20188,'activationsBySegmentId':_0x36af98,'emailToIdMap':_0x475194,'idToEmailMap':_0x358bfd,'connectionNameToIdMap':_0x843710[_0x15b353(0x195)],'connectionIdToNameMap':_0x843710['idToName'],'connectionNameToTypeMap':_0x1ef43a},_0x2d8ed5=await executePushSegments(_0x41ae66,_0x4801f1[_0x15b353(0x18b)]?[]:_0x319fe4,_0x49e2ec,{'parentId':_0x4ebe42},_0x29a9fb),_0x48c008=_0x2d8ed5['created'],_0x347e4c=_0x2d8ed5[_0x15b353(0x18d)],_0x724f06=_0x2d8ed5[_0x15b353(0x18f)][_0x15b353(0x17b)],_0x47c5a2=_0x2d8ed5[_0x15b353(0x18f)][_0x15b353(0x18d)],_0x4c0808=_0x2d8ed5[_0x15b353(0x18f)][_0x15b353(0x176)],_0x38f576=await executePushSegmentDeletions(_0x41ae66,_0x4801f1[_0x15b353(0x18b)]?[]:_0x353c73,_0x29a9fb);let _0x5e2ece=0x0,_0xa01069=0x0,_0x43de58=0x0;const _0x1b853e=new Map(_0xc20188);for(const [_0x47a010,_0x4785b5]of _0x2d8ed5[_0x15b353(0x180)]){_0x1b853e[_0x15b353(0x16f)](_0x47a010,_0x4785b5);}if(_0x79efc5[_0x15b353(0x1d3)]>0x0){const _0x5d80f1={..._0x49e2ec,'segmentNameToId':_0x1b853e,'existingSegments':_0x42e063,'activationContext':_0x2f7a74},_0x11256f=await executePushJourneys(_0x41ae66,_0x79efc5,_0x5d80f1,{'parentId':_0x4ebe42,'rootFolderId':_0x2e3279,'verbose':_0x4801f1[_0x15b353(0x182)]},_0x29a9fb);_0x5e2ece=_0x11256f['created'],_0xa01069=_0x11256f[_0x15b353(0x18d)];if(_0x4887b8&&_0x11256f[_0x15b353(0x1e8)]['length']===0x1){const _0x2ce884=_0x11256f[_0x15b353(0x1e8)][0x0];if(_0x2ce884[_0x15b353(0x199)]){const _0x115d55=getConsoleNextUrl(_0x4801f1['site'],_0x15b353(0x1c5)+_0x4ebe42+_0x15b353(0x16b)+_0x2ce884[_0x15b353(0x199)]+_0x15b353(0x1ea));console[_0x15b353(0x1ac)]('\x20\x20'+a31_0x25be58[_0x15b353(0x1e9)](_0x115d55));}}}for(const _0x32a3ba of _0x3eb7b9){console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x19b)](_0x15b353(0x1db)+_0x32a3ba[_0x15b353(0x1a2)])),_0x43de58++;}const _0x2b7499=[];if(_0x48c008>0x0)_0x2b7499['push'](_0x48c008+_0x15b353(0x1cb));if(_0x347e4c>0x0)_0x2b7499[_0x15b353(0x174)](_0x347e4c+_0x15b353(0x171));if(_0x38f576>0x0)_0x2b7499[_0x15b353(0x174)](_0x38f576+_0x15b353(0x1b6));const _0x3795d0=[];if(_0x5e2ece>0x0)_0x3795d0['push'](_0x5e2ece+'\x20created');if(_0xa01069>0x0)_0x3795d0[_0x15b353(0x174)](_0xa01069+'\x20updated');if(_0x43de58>0x0)_0x3795d0[_0x15b353(0x174)](_0x43de58+_0x15b353(0x1b6));const _0x574d5d=[];if(_0x724f06>0x0)_0x574d5d['push'](_0x724f06+_0x15b353(0x1cb));if(_0x47c5a2>0x0)_0x574d5d[_0x15b353(0x174)](_0x47c5a2+_0x15b353(0x171));if(_0x4c0808>0x0)_0x574d5d[_0x15b353(0x174)](_0x4c0808+_0x15b353(0x1b6));return console[_0x15b353(0x1ac)](a31_0x25be58[_0x15b353(0x1f5)](_0x15b353(0x1e1))),_0x2b7499[_0x15b353(0x1d3)]>0x0&&!_0x4801f1[_0x15b353(0x18b)]&&console[_0x15b353(0x1ac)](_0x15b353(0x1ed)+_0x2b7499['join'](',\x20')),_0x3795d0[_0x15b353(0x1d3)]>0x0&&console[_0x15b353(0x1ac)](_0x15b353(0x1e2)+_0x3795d0[_0x15b353(0x1a4)](',\x20')),_0x574d5d[_0x15b353(0x1d3)]>0x0&&!_0x4801f1[_0x15b353(0x18b)]&&console[_0x15b353(0x1ac)](_0x15b353(0x1b3)+_0x574d5d[_0x15b353(0x1a4)](',\x20')),0x0;}}
1
+ const a31_0x4eb3d7=a31_0x33d2;(function(_0x36606d,_0x3fd7df){const _0x3bf464=a31_0x33d2,_0x425cc0=_0x36606d();while(!![]){try{const _0x20d72a=parseInt(_0x3bf464(0x1bd))/0x1+-parseInt(_0x3bf464(0x242))/0x2+parseInt(_0x3bf464(0x231))/0x3*(-parseInt(_0x3bf464(0x223))/0x4)+-parseInt(_0x3bf464(0x1ce))/0x5*(parseInt(_0x3bf464(0x213))/0x6)+parseInt(_0x3bf464(0x1b3))/0x7+parseInt(_0x3bf464(0x23c))/0x8+-parseInt(_0x3bf464(0x204))/0x9*(-parseInt(_0x3bf464(0x1dc))/0xa);if(_0x20d72a===_0x3fd7df)break;else _0x425cc0['push'](_0x425cc0['shift']());}catch(_0x499ac0){_0x425cc0['push'](_0x425cc0['shift']());}}}(a31_0x1c6a,0x67b65));function a31_0x1c6a(){const _0x306bf4=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','setPhase','\x0aValidation\x20failed:','parentFolder','nameToId','New\x20journey:','error','listJourneysWithDetailsFromParentSegment','journeysOnly','Fetching\x20existing\x20segments...','3024665NXIGvl','red','errorCode','\x20changed','endsWith','toString','\x20\x20πŸ“Š\x20Segments:','folderId','verbose','listActivations','327429aSEHnG','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','buildUserMaps','deleted','Resolving\x20parent\x20segment\x20\x27','audienceId','description','length','Fetching\x20existing\x20folders...','parentSegment','resolveParentId','data','get','type','/app/ps/','createdSegmentIds','285vMXQCc','blue','unchanged','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)','Aborted.','Site:\x20','Changes\x20to:','site','helpText','name','cyan','\x20to\x20create','all','map','29850RQULif','connection','repeat','segments','relationships','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','journeyBundleName','execute','/j/da/je','updated','toUpdate','cwd','createdAt','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','getOutputSchemaWithCache','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','activations','filter','file','Push\x20','\x20updated','Changes\x20to\x20journey:','\x20\x20Activations:','set','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parent_name','\x20changes?','message','list','versionNumber','isNew','Fetching\x20existing\x20journeys...','updatedAt','filePath','toDelete','parentName','Scoped\x20to\x20folder:\x20','segment:push','nameToType','.yml','297AkeIKJ','join','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','scopedFolderPath','then','yamlConfig','isScoped','folderPath','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','green','changed','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','πŸ“\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment\x20or\x20journey','65346lPHfZX','created','user','\x20\x20Activations:\x20','Fetching\x20users\x20for\x20email\x20resolution...','\x20to\x20update','existingJourney','results','toCreate','\x0aError:','\x20\x20\x20\x20','Error:\x20','no_parent','Fetching\x20parent\x20segment\x20details...','segment','New\x20segment:','8Plrieq','journeyId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20YAML\x20files\x20found','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20to\x20delete','Error\x20parsing\x20YAML:\x20','(Journey\x20will\x20be\x20deleted)','Folders\x20to\x20create:','yellow','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','targetDir','Source\x20directory:\x20','attributes','444774QdPUWY','\x20activations]','delete','journeys','\x20new','\x20created','add','Parent\x20segment:\x20','segmentFolderId','idToName','diff','4157320yzvttO','push','getParent','\x20deleted','dim','\x0aPush\x20summary\x20for\x20\x27','71172SkgaqO','Delete\x20segment:','getJourney','journeyBundleId','journey'];a31_0x1c6a=function(){return _0x306bf4;};return a31_0x1c6a();}import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x3c19d4 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 a31_0x33d2(_0x37ce65,_0x56b63a){_0x37ce65=_0x37ce65-0x1b1;const _0x1c6a50=a31_0x1c6a();let _0x33d270=_0x1c6a50[_0x37ce65];return _0x33d270;}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a31_0x4eb3d7(0x201);[a31_0x4eb3d7(0x1c4)]=a31_0x4eb3d7(0x20c);async[a31_0x4eb3d7(0x1e3)](_0x39f605){const _0x164267=a31_0x4eb3d7,{options:_0x504af2,args:_0x5b65dd,tdx:_0x3295d9}=_0x39f605,_0x273847=_0x504af2,_0x19766e=await resolveTarget({'arg':_0x5b65dd[0x0],'contextParent':_0x504af2[_0x164267(0x1c7)],'cwd':process[_0x164267(0x1e7)]()});if(!isSuccessfulResolution(_0x19766e))return _0x19766e[_0x164267(0x1b5)]===_0x164267(0x21f)?(console[_0x164267(0x24d)](a31_0x3c19d4['yellow'](_0x164267(0x1f4))),console[_0x164267(0x24d)](_0x164267(0x1d1)),console[_0x164267(0x24d)](_0x164267(0x247)),console[_0x164267(0x24d)](_0x164267(0x20f))):(console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x21e)+_0x19766e['message']+'\x0a')),_0x19766e[_0x164267(0x1d6)]&&console['error'](a31_0x3c19d4[_0x164267(0x1d8)](_0x19766e[_0x164267(0x1d6)]))),0x1;if(_0x19766e[_0x164267(0x1cb)]===_0x164267(0x1f5))return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)]('Error:\x20Directory\x20not\x20found:\x20'+_0x19766e['targetDir']+'\x0a')),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1d8)](_0x164267(0x1eb))),0x1;const _0x58e4e6=_0x19766e[_0x164267(0x1ff)],_0x1b3962=_0x19766e[_0x164267(0x22e)],_0x1f3b9f=_0x19766e['type']===_0x164267(0x1ee)?_0x19766e[_0x164267(0x1fd)]:undefined,_0x532167=getScopedDetails(_0x19766e),_0x3b4580=_0x532167?.[_0x164267(0x20a)]??![],_0x402998=_0x532167?.[_0x164267(0x207)]??'';if(!existsSync(_0x1b3962))return console[_0x164267(0x24d)](a31_0x3c19d4['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x1b3962+'\x0a')),console[_0x164267(0x24d)](a31_0x3c19d4['cyan'](_0x164267(0x1eb))),0x1;_0x273847[_0x164267(0x1bb)]&&(console[_0x164267(0x24d)](_0x164267(0x1d3)+_0x273847['site']),console['error'](_0x164267(0x238)+_0x58e4e6),console[_0x164267(0x24d)](_0x164267(0x22f)+_0x1b3962),_0x3b4580&&console['error'](_0x164267(0x200)+_0x402998));const _0x479944=await withSpinner(_0x164267(0x1c2)+_0x58e4e6+'\x27...',()=>_0x3295d9['segment'][_0x164267(0x1c8)](_0x58e4e6),{'verbose':_0x273847[_0x164267(0x1bb)]}),_0x56fdb8=_0x479944[_0x164267(0x1c9)],[_0x27af39,_0x44ef6e,_0x58c268,_0x285123,_0x299df7]=await Promise[_0x164267(0x1da)]([withSpinner(_0x164267(0x220),()=>_0x3295d9[_0x164267(0x221)][_0x164267(0x23e)](_0x56fdb8),{'verbose':_0x273847['verbose']}),withSpinner(_0x164267(0x1b2),()=>_0x3295d9[_0x164267(0x221)]['listSegments'](_0x56fdb8),{'verbose':_0x273847['verbose']}),withSpinner(_0x164267(0x1c6),()=>_0x3295d9[_0x164267(0x221)]['listFolders'](_0x56fdb8),{'verbose':_0x273847['verbose']}),withSpinner(_0x164267(0x1fb),()=>_0x3295d9[_0x164267(0x246)][_0x164267(0x24e)](_0x56fdb8,{'includeAllVersions':!![]}),{'verbose':_0x273847[_0x164267(0x1bb)]}),withSpinner(_0x164267(0x217),()=>_0x3295d9[_0x164267(0x215)][_0x164267(0x1c0)](),{'verbose':_0x273847[_0x164267(0x1bb)]})[_0x164267(0x208)](_0xe499ba=>_0xe499ba[_0x164267(0x1c9)])]),_0x560ecd=_0x27af39[_0x164267(0x1c9)],_0x13179c=extractRootFolderId(_0x560ecd),_0x12e078=_0x44ef6e[_0x164267(0x1c9)],_0x3160ba=_0x58c268[_0x164267(0x1c9)],{journeys:_0x320483,activationStepsById:_0x1d30e4}=_0x285123[_0x164267(0x1c9)],_0x14ee60=new Map(_0x320483[_0x164267(0x1db)](_0x31fafc=>[_0x31fafc['id'],_0x31fafc])),_0x3224ab=_0x320483['map'](_0x1629cd=>({'id':_0x1629cd['id'],'name':_0x1629cd[_0x164267(0x230)][_0x164267(0x1d7)],'journeyBundleName':_0x1629cd['attributes'][_0x164267(0x1e2)]||'','journeyBundleId':_0x1629cd[_0x164267(0x230)][_0x164267(0x245)]||'','versionNumber':_0x1629cd[_0x164267(0x230)][_0x164267(0x1f9)],'description':_0x1629cd['attributes']['description'],'state':_0x1629cd[_0x164267(0x230)]['state'],'paused':_0x1629cd['attributes']['paused'],'audienceId':_0x1629cd[_0x164267(0x230)][_0x164267(0x1c3)],'folderId':_0x1629cd[_0x164267(0x1e0)]?.[_0x164267(0x24a)]?.[_0x164267(0x1c9)]?.['id'],'createdAt':_0x1629cd['attributes'][_0x164267(0x1e8)],'updatedAt':_0x1629cd[_0x164267(0x230)][_0x164267(0x1fc)]})),{emailToId:_0x3435f3,idToEmail:_0x7b80aa}=_0x299df7,_0x22c6a1=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x740bed=_0x164267,_0x5a271b=await _0x3295d9[_0x740bed(0x1dd)][_0x740bed(0x1f8)]();return buildConnectionMaps(_0x5a271b);},{'verbose':_0x273847[_0x164267(0x1bb)]})[_0x164267(0x208)](_0x2a6b86=>_0x2a6b86[_0x164267(0x1c9)]),_0x153242=_0x22c6a1[_0x164267(0x24b)],_0x3ad2c9=_0x22c6a1[_0x164267(0x23a)],_0x2a9437=_0x22c6a1[_0x164267(0x202)],_0x2ab540={'emailToIdMap':_0x3435f3,'connectionNameToIdMap':_0x153242,'connectionNameToTypeMap':_0x2a9437,'getSchema':_0x4d623c=>_0x3295d9['connection'][_0x164267(0x1ea)](_0x4d623c)};let {pathToId:_0x4461f6,idToPath:_0x5c04dc}=buildFolderMaps(_0x3160ba);const _0xcfebb1=buildSegmentLookupMap(_0x12e078,_0x5c04dc),_0x53b15f=buildSegmentNameToIdMap(_0x12e078),_0x17158e=buildJourneyBundleLookupMap(_0x3224ab,_0x5c04dc);let _0x1d2910;if(_0x1f3b9f){if(!_0x1f3b9f[_0x164267(0x1b7)](_0x164267(0x203))&&!_0x1f3b9f[_0x164267(0x1b7)]('.yaml'))return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1f3b9f+'\x0a')),0x1;_0x1d2910=[_0x1f3b9f];}else _0x1d2910=findYamlFiles(_0x1b3962);if(_0x1d2910[_0x164267(0x1c5)]===0x0)return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x1e1)+_0x1b3962+'\x0a')),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1d8)](_0x164267(0x1e9))),0x1;let _0x29afad,_0x54fd76;try{const _0x4ef6ae=parseAndClassifyYamlFiles(_0x1d2910,_0x1b3962,{'skipSegments':_0x273847[_0x164267(0x1b1)]});_0x29afad=_0x4ef6ae[_0x164267(0x1df)],_0x54fd76=_0x4ef6ae['journeys'];const _0x5922e0=validateParsedFiles(_0x4ef6ae,_0x1b3962);if(_0x5922e0[_0x164267(0x1c5)]>0x0)return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x249))),console[_0x164267(0x24d)](formatValidationErrors(_0x5922e0)),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x22d))),0x1;}catch(_0xeb19d){return console['error'](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x229)+(_0xeb19d instanceof Error?_0xeb19d[_0x164267(0x1f7)]:_0xeb19d))),0x1;}if(_0x29afad[_0x164267(0x1c5)]===0x0&&_0x54fd76[_0x164267(0x1c5)]===0x0){const _0x580a5f=_0x273847[_0x164267(0x1b1)]?_0x164267(0x246):_0x164267(0x212);return console['error'](a31_0x3c19d4[_0x164267(0x22c)]('No\x20'+_0x580a5f+_0x164267(0x226))),0x0;}const _0x2e9fce=new Map();_0x12e078[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x12e078,async _0x4b740c=>{const _0xb175f0=a31_0x33d2,_0x30396a=await _0x3295d9[_0xb175f0(0x221)][_0xb175f0(0x1bc)](_0x56fdb8,_0x4b740c['id']);_0x2e9fce[_0xb175f0(0x1f3)](_0x4b740c['id'],_0x30396a);});},{'verbose':_0x273847['verbose']});const {segmentFiles:_0x550a7c,foldersToCreate:_0x5aee64}=await prepareSegmentFiles(_0x29afad,{'segmentByFolderAndName':_0xcfebb1,'activationsBySegmentId':_0x2e9fce,'folderPathToId':_0x4461f6,'idToEmailMap':_0x7b80aa,'connectionIdToNameMap':_0x3ad2c9},_0x2ab540,_0x3b4580,_0x402998),_0x2873f2=_0x1f3b9f?[]:findSegmentsToDelete(_0x12e078,_0x29afad[_0x164267(0x1db)](({yamlConfig:_0x2eb8ac,folderPath:_0x2d4cde})=>({'yamlConfig':_0x2eb8ac,'folderPath':resolveTDFolderPath(_0x2d4cde,_0x3b4580,_0x402998)})),_0x5c04dc,_0x402998,_0x3b4580),{journeyFiles:_0x1d3a66,foldersToCreate:_0x4469a8}=await withProgressSpinner('Preparing\x20journeys...',async _0x50b4b5=>prepareJourneyFiles(_0x54fd76,{'fetchJourney':async _0x46935d=>_0x3295d9[_0x164267(0x246)][_0x164267(0x244)](_0x46935d[_0x164267(0x224)]),'journeyBundlesByFolderAndName':_0x17158e,'folderPathToId':_0x4461f6,'idToEmailMap':_0x7b80aa,'connectionIdToNameMap':_0x3ad2c9,'existingSegments':_0x12e078,'parentId':_0x56fdb8,'deps':_0x3295d9,'progress':{'update':_0x4dd443=>{const _0x4ae266=_0x164267;_0x50b4b5[_0x4ae266(0x248)](_0x4dd443),_0x273847['verbose']&&console[_0x4ae266(0x24d)]('\x20\x20'+_0x4dd443);}},'journeyById':_0x14ee60,'activationStepsById':_0x1d30e4},_0x3b4580,_0x402998),{'verbose':_0x273847['verbose']})[_0x164267(0x208)](_0x374ee2=>_0x374ee2[_0x164267(0x1c9)]);for(const _0x4687ee of _0x4469a8){_0x5aee64[_0x164267(0x237)](_0x4687ee);}const _0x20c3d2=_0x1f3b9f?[]:findJourneysToDelete(_0x3224ab,_0x54fd76['map'](({yamlConfig:_0x5d1247,folderPath:_0x184b30})=>({'yamlConfig':_0x5d1247,'folderPath':resolveTDFolderPath(_0x184b30,_0x3b4580,_0x402998)})),_0x5c04dc,_0x402998,_0x3b4580),_0x3523e5=calculatePushStats(_0x550a7c,_0x1d3a66,_0x5aee64,_0x2873f2,_0x20c3d2,!!_0x273847['delete'],!!_0x273847[_0x164267(0x1b1)]),_0x5021e9=_0x3523e5[_0x164267(0x1df)]['new'],_0x18f1e0=_0x3523e5[_0x164267(0x1df)][_0x164267(0x20e)],_0x788575=_0x3523e5[_0x164267(0x1df)][_0x164267(0x1d0)],_0x2dba2c=_0x3523e5[_0x164267(0x1df)]['toDelete'],_0x514358=_0x3523e5['folders']['toCreate'],_0x294b5d=_0x3523e5[_0x164267(0x234)]['new'],_0x427274=_0x3523e5[_0x164267(0x234)]['changed'],_0x56ae0c=_0x3523e5[_0x164267(0x234)][_0x164267(0x1d0)],_0x188f0f=_0x3523e5[_0x164267(0x234)][_0x164267(0x1fe)],_0x452c26=_0x3523e5[_0x164267(0x1ec)]['all'],_0xe76370=_0x3523e5[_0x164267(0x1ec)][_0x164267(0x21b)],_0x3aeea2=_0x3523e5[_0x164267(0x1ec)][_0x164267(0x1e6)],_0x508727=_0x3523e5[_0x164267(0x1ec)]['toDelete'];console[_0x164267(0x24d)](_0x164267(0x241)+_0x58e4e6+'\x27:');_0x514358[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)]('\x20\x20'+a31_0x3c19d4[_0x164267(0x1cf)](_0x164267(0x210)+_0x514358[_0x164267(0x1c5)]+'\x20folders\x20to\x20create'));if(!_0x273847['journeysOnly']){console[_0x164267(0x24d)](_0x164267(0x1b9)),console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x20d)]('+\x20'+_0x5021e9[_0x164267(0x1c5)]+_0x164267(0x235))),console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x22c)]('~\x20'+_0x18f1e0[_0x164267(0x1c5)]+'\x20changed'));if(_0x2dba2c[_0x164267(0x1c5)]>0x0)console['error']('\x20\x20\x20\x20'+a31_0x3c19d4[_0x164267(0x1b4)]('-\x20'+_0x2dba2c[_0x164267(0x1c5)]+'\x20to\x20delete'));else _0x2873f2['length']>0x0&&!_0x273847[_0x164267(0x233)]&&console[_0x164267(0x24d)]('\x20\x20\x20\x20'+a31_0x3c19d4[_0x164267(0x240)](_0x2873f2[_0x164267(0x1c5)]+_0x164267(0x1bf)));console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x240)]('=\x20'+_0x788575[_0x164267(0x1c5)]+'\x20unchanged'));}if(_0x1d3a66[_0x164267(0x1c5)]>0x0||_0x20c3d2[_0x164267(0x1c5)]>0x0){console['error'](_0x164267(0x206)),console['error'](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x20d)]('+\x20'+_0x294b5d[_0x164267(0x1c5)]+_0x164267(0x235))),console['error'](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x22c)]('~\x20'+_0x427274[_0x164267(0x1c5)]+_0x164267(0x1b6)));if(_0x188f0f['length']>0x0)console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x1b4)]('-\x20'+_0x188f0f[_0x164267(0x1c5)]+_0x164267(0x228)));else _0x20c3d2[_0x164267(0x1c5)]>0x0&&!_0x273847['delete']&&console['error'](_0x164267(0x21d)+a31_0x3c19d4['dim'](_0x20c3d2['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4['dim']('=\x20'+_0x56ae0c[_0x164267(0x1c5)]+'\x20unchanged'));}_0x452c26['length']>0x0&&!_0x273847[_0x164267(0x1b1)]&&(console[_0x164267(0x24d)](''),console['error'](_0x164267(0x1f2)),_0xe76370[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4['green']('+\x20'+_0xe76370[_0x164267(0x1c5)]+_0x164267(0x1d9))),_0x3aeea2[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x22c)]('~\x20'+_0x3aeea2['length']+_0x164267(0x218))),_0x508727[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4['red']('-\x20'+_0x508727['length']+'\x20to\x20delete')));console[_0x164267(0x24d)]('\x20\x20Source:\x20'+a31_0x3c19d4[_0x164267(0x1d8)](_0x1b3962)+'\x0a');if(_0x514358[_0x164267(0x1c5)]>0x0){console[_0x164267(0x24d)](_0x164267(0x22b));for(const _0x1d4650 of _0x514358){console['error']('\x20\x20'+a31_0x3c19d4[_0x164267(0x1cf)]('+')+'\x20'+_0x1d4650);}console[_0x164267(0x24d)]('');}if(_0x5021e9[_0x164267(0x1c5)]>0x0&&!_0x273847['journeysOnly'])for(const _0x40008f of _0x5021e9){const _0x28351f=_0x40008f[_0x164267(0x20b)]?_0x40008f['folderPath']+'/'+_0x40008f[_0x164267(0x209)][_0x164267(0x1d7)]:_0x40008f[_0x164267(0x209)][_0x164267(0x1d7)],_0x21475d=_0x40008f[_0x164267(0x209)][_0x164267(0x1ec)]?.[_0x164267(0x1c5)]||0x0,_0x7d3945=_0x21475d>0x0?a31_0x3c19d4[_0x164267(0x240)]('\x20['+_0x21475d+_0x164267(0x232)):'';console[_0x164267(0x24d)]('\x0a'+a31_0x3c19d4[_0x164267(0x20d)](_0x164267(0x222))+'\x20'+_0x28351f+_0x7d3945),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c)),_0x40008f[_0x164267(0x23b)]&&console[_0x164267(0x24d)](_0x40008f[_0x164267(0x23b)]),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}if(_0x2dba2c[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)])for(const _0x48d68e of _0x2dba2c){const _0x3ad177=_0x48d68e['segmentFolderId']?_0x5c04dc[_0x164267(0x1ca)](_0x48d68e[_0x164267(0x239)][_0x164267(0x1b8)]())||'':'',_0x18badd=_0x3ad177?_0x3ad177+'/'+_0x48d68e[_0x164267(0x1d7)]:_0x48d68e['name'],_0x3a23f4=_0x2e9fce[_0x164267(0x1ca)](_0x48d68e['id'])||[],_0x129c51=_0x3a23f4[_0x164267(0x1c5)]>0x0?a31_0x3c19d4['dim']('\x20['+_0x3a23f4['length']+_0x164267(0x232)):'';console[_0x164267(0x24d)]('\x0a'+a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x243))+'\x20'+_0x18badd+_0x129c51),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));const _0x226f2e=segmentWithActivationsToYaml(_0x48d68e,_0x3a23f4,undefined,_0x7b80aa,_0x3ad2c9),_0x432596=segmentToYamlString(_0x226f2e),_0x11df4b=generateDiff(_0x432596,'');console[_0x164267(0x24d)](formatDiffWithColors(_0x11df4b)),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}const _0x40beb1=_0x550a7c[_0x164267(0x1ed)](_0x56f3dd=>!_0x56f3dd[_0x164267(0x1fa)]&&_0x56f3dd[_0x164267(0x23b)]);if(_0x40beb1[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)])for(const _0xee73b3 of _0x40beb1){const _0x4aaece=_0xee73b3[_0x164267(0x20b)]?_0xee73b3['folderPath']+'/'+_0xee73b3['yamlConfig'][_0x164267(0x1d7)]:_0xee73b3[_0x164267(0x209)][_0x164267(0x1d7)];console['error']('\x0a'+a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x1d4))+'\x20'+_0x4aaece),console['error']('─'['repeat'](0x3c)),console[_0x164267(0x24d)](_0xee73b3[_0x164267(0x23b)]),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}if(_0x294b5d[_0x164267(0x1c5)]>0x0)for(const _0x487caa of _0x294b5d){const _0x3508d4=_0x487caa[_0x164267(0x20b)]?_0x487caa[_0x164267(0x20b)]+'/'+_0x487caa[_0x164267(0x209)]['name']:_0x487caa['yamlConfig']['name'];console[_0x164267(0x24d)]('\x0a'+a31_0x3c19d4[_0x164267(0x20d)](_0x164267(0x24c))+'\x20'+_0x3508d4),console['error']('─'[_0x164267(0x1de)](0x3c)),_0x487caa[_0x164267(0x23b)]&&console[_0x164267(0x24d)](_0x487caa[_0x164267(0x23b)]),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}const _0x5c7385=_0x1d3a66[_0x164267(0x1ed)](_0x5e4f8c=>!_0x5e4f8c[_0x164267(0x1fa)]&&_0x5e4f8c['diff']);if(_0x5c7385['length']>0x0)for(const _0x111501 of _0x5c7385){const _0x230b76=_0x111501['folderPath']?_0x111501[_0x164267(0x20b)]+'/'+_0x111501[_0x164267(0x209)]['name']:_0x111501[_0x164267(0x209)]['name'];console[_0x164267(0x24d)]('\x0a'+a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x1f1))+'\x20'+_0x230b76),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c)),console[_0x164267(0x24d)](_0x111501['diff']),console['error']('─'[_0x164267(0x1de)](0x3c));}if(_0x188f0f[_0x164267(0x1c5)]>0x0)for(const _0x2b19bf of _0x188f0f){const _0x201ce1=_0x2b19bf['folderId']?_0x5c04dc['get'](_0x2b19bf[_0x164267(0x1ba)])||'':'',_0x38d8f2=_0x201ce1?_0x201ce1+'/'+_0x2b19bf[_0x164267(0x1e2)]:_0x2b19bf[_0x164267(0x1e2)];console['error']('\x0a'+a31_0x3c19d4[_0x164267(0x1b4)]('Delete\x20journey:')+'\x20'+_0x38d8f2),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c)),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x22a))),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}if(_0x273847['dryRun'])return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x227))),0x0;const _0x2ecaa0=_0x273847['journeysOnly']?![]:_0x5021e9[_0x164267(0x1c5)]>0x0||_0x18f1e0[_0x164267(0x1c5)]>0x0||_0x2dba2c['length']>0x0,_0x59d47a=_0x294b5d['length']>0x0||_0x427274['length']>0x0||_0x188f0f['length']>0x0,_0x27503b=_0x273847[_0x164267(0x1b1)]?![]:_0x452c26[_0x164267(0x1c5)]>0x0,_0x2df544=_0x514358[_0x164267(0x1c5)]>0x0;if(!_0x2ecaa0&&!_0x59d47a&&!_0x27503b&&!_0x2df544){const _0x33812c=_0x273847[_0x164267(0x1b1)]?'βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x164267(0x1be);console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x20d)](_0x33812c));if(_0x1f3b9f&&_0x56ae0c['length']===0x1){const _0x53cab1=_0x56ae0c[0x0];if(_0x53cab1[_0x164267(0x219)]?.['id']){const _0xb90678=getConsoleNextUrl(_0x273847[_0x164267(0x1d5)],_0x164267(0x1cc)+_0x56fdb8+'/e/'+_0x53cab1[_0x164267(0x219)]['id']+'/j/da/je');console[_0x164267(0x24d)]('\x20\x20'+a31_0x3c19d4['cyan'](_0xb90678));}}return 0x0;}const _0x41b2d8=_0x273847['journeysOnly']?_0x294b5d['length']+_0x427274[_0x164267(0x1c5)]+_0x188f0f['length']+_0x514358['length']:_0x5021e9[_0x164267(0x1c5)]+_0x18f1e0[_0x164267(0x1c5)]+_0x2dba2c[_0x164267(0x1c5)]+_0x294b5d[_0x164267(0x1c5)]+_0x427274[_0x164267(0x1c5)]+_0x188f0f[_0x164267(0x1c5)]+_0x514358[_0x164267(0x1c5)]+_0x452c26['length'];if(!_0x273847['yes']&&_0x41b2d8>0x0){if(!isInteractive())return console['error'](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x21c)),_0x164267(0x211)),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x240)](_0x164267(0x225))),0x1;const _0x4baebb=await confirmKey(_0x164267(0x1ef)+_0x41b2d8+_0x164267(0x1f6));if(!_0x4baebb)return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x1d2))),0x1;}const _0x1d362a={'withProgress':async(_0x17c031,_0x8c6b13)=>{const _0x388841=_0x164267,_0x15f9ec=await withSpinner(_0x17c031,_0x8c6b13,{'verbose':_0x273847[_0x388841(0x1bb)]});return{'data':_0x15f9ec[_0x388841(0x1c9)]};},'logInfo':_0x1f2ed9=>console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1cf)]('βœ”\x20'+_0x1f2ed9)),'logSuccess':_0x5bd1ca=>console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x20d)]('βœ”\x20'+_0x5bd1ca)),'logWarning':_0x3eef87=>console[_0x164267(0x24d)](a31_0x3c19d4['yellow']('⚠\x20'+_0x3eef87)),'logDeleted':_0x1a0921=>console[_0x164267(0x24d)](a31_0x3c19d4['red']('βœ”\x20'+_0x1a0921))},_0x3569ba={'segment':_0x3295d9[_0x164267(0x221)],'journey':_0x3295d9[_0x164267(0x246)],'user':_0x3295d9[_0x164267(0x215)],'connection':_0x3295d9['connection']};_0x514358[_0x164267(0x1c5)]>0x0&&(_0x4461f6=await executePushFolders(_0x3569ba,_0x514358,_0x4461f6,{'parentId':_0x56fdb8},_0x1d362a));const _0x5dd7ac={'rootFolderId':_0x13179c,'folderPathToId':_0x4461f6,'folderIdToPath':_0x5c04dc,'segmentNameToId':_0x53b15f,'activationsBySegmentId':_0x2e9fce,'emailToIdMap':_0x3435f3,'idToEmailMap':_0x7b80aa,'connectionNameToIdMap':_0x22c6a1[_0x164267(0x24b)],'connectionIdToNameMap':_0x22c6a1[_0x164267(0x23a)],'connectionNameToTypeMap':_0x2a9437},_0x245305=await executePushSegments(_0x3569ba,_0x273847[_0x164267(0x1b1)]?[]:_0x550a7c,_0x5dd7ac,{'parentId':_0x56fdb8},_0x1d362a),_0x3ff4fa=_0x245305[_0x164267(0x214)],_0x2294c3=_0x245305['updated'],_0x24eac4=_0x245305[_0x164267(0x1ec)][_0x164267(0x214)],_0xa1847d=_0x245305['activations'][_0x164267(0x1e5)],_0x1202d7=_0x245305[_0x164267(0x1ec)][_0x164267(0x1c1)],_0x5f0618=await executePushSegmentDeletions(_0x3569ba,_0x273847[_0x164267(0x1b1)]?[]:_0x2dba2c,_0x1d362a);let _0x511a1a=0x0,_0x23dd88=0x0,_0x5d4450=0x0;const _0x1bf2b0=new Map(_0x53b15f);for(const [_0x562be6,_0xff0308]of _0x245305[_0x164267(0x1cd)]){_0x1bf2b0[_0x164267(0x1f3)](_0x562be6,_0xff0308);}if(_0x1d3a66[_0x164267(0x1c5)]>0x0){const _0x5cc9fc={..._0x5dd7ac,'segmentNameToId':_0x1bf2b0,'existingSegments':_0x12e078,'activationContext':_0x2ab540},_0x37dab7=await executePushJourneys(_0x3569ba,_0x1d3a66,_0x5cc9fc,{'parentId':_0x56fdb8,'rootFolderId':_0x13179c,'verbose':_0x273847[_0x164267(0x1bb)]},_0x1d362a);_0x511a1a=_0x37dab7[_0x164267(0x214)],_0x23dd88=_0x37dab7[_0x164267(0x1e5)];if(_0x1f3b9f&&_0x37dab7[_0x164267(0x21a)][_0x164267(0x1c5)]===0x1){const _0x47690a=_0x37dab7['results'][0x0];if(_0x47690a[_0x164267(0x224)]){const _0x1703a2=getConsoleNextUrl(_0x273847['site'],_0x164267(0x1cc)+_0x56fdb8+'/e/'+_0x47690a['journeyId']+_0x164267(0x1e4));console[_0x164267(0x24d)]('\x20\x20'+a31_0x3c19d4['cyan'](_0x1703a2));}}}for(const _0x3b44be of _0x188f0f){console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x22c)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x3b44be[_0x164267(0x1e2)])),_0x5d4450++;}const _0x4ba1bf=[];if(_0x3ff4fa>0x0)_0x4ba1bf[_0x164267(0x23d)](_0x3ff4fa+_0x164267(0x236));if(_0x2294c3>0x0)_0x4ba1bf['push'](_0x2294c3+_0x164267(0x1f0));if(_0x5f0618>0x0)_0x4ba1bf[_0x164267(0x23d)](_0x5f0618+_0x164267(0x23f));const _0x1f0487=[];if(_0x511a1a>0x0)_0x1f0487['push'](_0x511a1a+'\x20created');if(_0x23dd88>0x0)_0x1f0487[_0x164267(0x23d)](_0x23dd88+_0x164267(0x1f0));if(_0x5d4450>0x0)_0x1f0487[_0x164267(0x23d)](_0x5d4450+_0x164267(0x23f));const _0x26391e=[];if(_0x24eac4>0x0)_0x26391e[_0x164267(0x23d)](_0x24eac4+_0x164267(0x236));if(_0xa1847d>0x0)_0x26391e['push'](_0xa1847d+_0x164267(0x1f0));if(_0x1202d7>0x0)_0x26391e[_0x164267(0x23d)](_0x1202d7+'\x20deleted');return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x20d)]('\x0aβœ”\x20Push\x20complete')),_0x4ba1bf[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)]&&console[_0x164267(0x24d)]('\x20\x20Segments:\x20'+_0x4ba1bf[_0x164267(0x205)](',\x20')),_0x1f0487[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)]('\x20\x20Journeys:\x20'+_0x1f0487[_0x164267(0x205)](',\x20')),_0x26391e[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)]&&console[_0x164267(0x24d)](_0x164267(0x216)+_0x26391e[_0x164267(0x205)](',\x20')),0x0;}}