@treasuredata/tdx 0.26.4 β†’ 0.26.6

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 (169) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/mcp-command.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profile-command.js +1 -1
  28. package/dist/commands/profiles-command.js +1 -1
  29. package/dist/commands/query-command.js +1 -1
  30. package/dist/commands/schedule-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/status-command.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/unset-command.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/command-output.js +1 -1
  49. package/dist/core/config.js +1 -1
  50. package/dist/core/connection-cache.js +1 -1
  51. package/dist/core/constants.js +1 -1
  52. package/dist/core/credential-cache.js +1 -1
  53. package/dist/core/global-context.js +1 -1
  54. package/dist/core/keychain.js +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/project-config.js +1 -1
  57. package/dist/core/session.js +1 -1
  58. package/dist/core/user-cache.js +1 -1
  59. package/dist/core/version.js +1 -1
  60. package/dist/index.js +1 -1
  61. package/dist/mcp/server.js +1 -1
  62. package/dist/mcp/tools/index.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js +1 -1
  64. package/dist/mcp/tools/tdx-search.js +1 -1
  65. package/dist/mcp/utils.js +1 -1
  66. package/dist/proxy/claude-usage-tracker.js +1 -1
  67. package/dist/proxy/passthrough-server.js +1 -1
  68. package/dist/proxy/sse-usage-parser.js +1 -1
  69. package/dist/sdk/agent/agent-config.js +1 -1
  70. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  71. package/dist/sdk/agent/agent-yaml.js +1 -1
  72. package/dist/sdk/agent/test/evaluator.js +1 -1
  73. package/dist/sdk/agent/test/executor.js +1 -1
  74. package/dist/sdk/agent/test/index.js +1 -1
  75. package/dist/sdk/agent/test/output.js +1 -1
  76. package/dist/sdk/agent/test/parser.js +1 -1
  77. package/dist/sdk/api.js +1 -1
  78. package/dist/sdk/client/cdp-api-client.js +1 -1
  79. package/dist/sdk/client/endpoints.js +1 -1
  80. package/dist/sdk/client/engage-api-client.js +1 -1
  81. package/dist/sdk/client/http-client.js +1 -1
  82. package/dist/sdk/client/llm-api-client.js +1 -1
  83. package/dist/sdk/client/rate-limiter.js +1 -1
  84. package/dist/sdk/client/td-api-client.js +1 -1
  85. package/dist/sdk/client/trino-api-client.js +1 -1
  86. package/dist/sdk/client/workflow-client.js +1 -1
  87. package/dist/sdk/connection-validator.js +1 -1
  88. package/dist/sdk/connection.js +1 -1
  89. package/dist/sdk/engage.js +1 -1
  90. package/dist/sdk/errors.js +1 -1
  91. package/dist/sdk/index.js +1 -1
  92. package/dist/sdk/io/index.js +1 -1
  93. package/dist/sdk/io/node-filesystem.js +1 -1
  94. package/dist/sdk/job.js +1 -1
  95. package/dist/sdk/journey.js +1 -1
  96. package/dist/sdk/llm/chat-cache.js +1 -1
  97. package/dist/sdk/llm/index.js +1 -1
  98. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  99. package/dist/sdk/llm/model-factors.js +1 -1
  100. package/dist/sdk/personalization.js +1 -1
  101. package/dist/sdk/query/index.js +1 -1
  102. package/dist/sdk/query/sql-parser.js +1 -1
  103. package/dist/sdk/realtime.js +1 -1
  104. package/dist/sdk/schedule.js +1 -1
  105. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  106. package/dist/sdk/segment/fields-display.js +1 -1
  107. package/dist/sdk/segment/file-discovery.js +1 -1
  108. package/dist/sdk/segment/journey-utils.js +1 -1
  109. package/dist/sdk/segment/journey-validator.js +1 -1
  110. package/dist/sdk/segment/journey-yaml.js +1 -1
  111. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  112. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  113. package/dist/sdk/segment/pull-workflow.js +1 -1
  114. package/dist/sdk/segment/push-recovery.js +1 -1
  115. package/dist/sdk/segment/push-workflow.js +1 -1
  116. package/dist/sdk/segment/resolution-context.js +1 -1
  117. package/dist/sdk/segment/segment-path-parser.js +1 -1
  118. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  119. package/dist/sdk/segment/target-resolution.js +1 -1
  120. package/dist/sdk/segment/tdx-config.js +1 -1
  121. package/dist/sdk/segment/validate-files.js +1 -1
  122. package/dist/sdk/segment/yaml-validator.js +1 -1
  123. package/dist/sdk/segment.js +1 -1
  124. package/dist/sdk/types/index.js +1 -1
  125. package/dist/sdk/types/progress.js +1 -1
  126. package/dist/sdk/user.js +1 -1
  127. package/dist/sdk/util/format-detector.js +1 -1
  128. package/dist/sdk/util/formatters.js +1 -1
  129. package/dist/sdk/util/index.js +1 -1
  130. package/dist/sdk/util/tree-formatter.js +1 -1
  131. package/dist/sdk/workflow/archive-validation.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x4d179c=a26_0xc8d0;(function(_0x503da6,_0x48239f){const _0x1416bd=a26_0xc8d0,_0x336432=_0x503da6();while(!![]){try{const _0x56b48f=parseInt(_0x1416bd(0xc5))/0x1+parseInt(_0x1416bd(0x87))/0x2*(-parseInt(_0x1416bd(0xe1))/0x3)+parseInt(_0x1416bd(0x80))/0x4+parseInt(_0x1416bd(0x8c))/0x5+parseInt(_0x1416bd(0xdf))/0x6*(parseInt(_0x1416bd(0xe0))/0x7)+parseInt(_0x1416bd(0xeb))/0x8*(parseInt(_0x1416bd(0xb2))/0x9)+-parseInt(_0x1416bd(0x7b))/0xa;if(_0x56b48f===_0x48239f)break;else _0x336432['push'](_0x336432['shift']());}catch(_0x5f0556){_0x336432['push'](_0x336432['shift']());}}}(a26_0x55a3,0xafb22));function a26_0xc8d0(_0x3527c5,_0x21cb57){_0x3527c5=_0x3527c5-0x65;const _0x55a3ff=a26_0x55a3();let _0xc8d011=_0x55a3ff[_0x3527c5];return _0xc8d011;}import{BaseCommand}from'./command.js';function a26_0x55a3(){const _0x4b5dd8=['πŸ“…\x20','getTime','args','Create\x20a\x20scheduled\x20query','schedule:create','Getting\x20schedule\x20details...','\x20execution','type','8MzZxds','just\x20now','cron','list','success','json','nextRun','history','Deleting\x20schedule...','Running\x20schedule...','schedule:update','queryUrl','keys','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','soon','Creating\x20schedule:\x20','verbose','...','padEnd','\x20schedules','Schedule\x20run\x20submitted:\x20','time_zone','green','user','Schedule\x20deleted:\x20','map','28770950DZzuGd','Updating\x20schedule...','INVALID_ARGUMENT','length','schedule:history','5083788rINzIv','/app/queries/editor?queryId=','retryLimit','job_id','substring','has_next_page','show','2sznYAv','end_at','description','updated_at','List\x20scheduled\x20queries','4816365ypqssZ','round','result','create','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','priority','database','queries','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','validate','time','dim','Showing\x20first\x20','ended_at','lastRun','jsonl','scheduled_at','max','engine_version','status','toLocaleDateString','Run\x20a\x20scheduled\x20query\x20immediately','d\x20ago','next_run_at','start_at','Found\x20','file','join','name','pagination','\x20scheduled\x20quer','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','m\x20ago','log','never','engineVersion','tsv','\x22...','10115307UCpuYZ','ies','count','schedules','Show\x20schedule\x20execution\x20history','\x20(showing\x20','query','data','red','Schedule\x20created:\x20','schedule:run','utf-8','\x20\x20Job\x20ID:\x20','last_job','Delete\x20a\x20scheduled\x20query','delete','num','\x20matching\x20\x22','Update\x20a\x20scheduled\x20query','54878fKrCNh','Getting\x20schedule\x20history...','Listing\x20scheduled\x20queries...','\x20\x20Type:\x20','retry_limit','format','\x20\x20Timezone:\x20','site','\x20\x20Time:\x20','Updating\x20schedule:\x20','timezone','delay','Creating\x20schedule...','in\x20','statusIcon','Failed\x20to\x20read\x20file:\x20','error','execute','entries','created_at','\x20\x20Cron:\x20','Schedule\x20updated:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','user_name','table','trim','4050744IwBgvU','14yEJcHY','3499572hWNJrW','Cancelled'];a26_0x55a3=function(){return _0x4b5dd8;};return a26_0x55a3();}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_0x2c4436 from'chalk';function formatRelativeTime(_0xffb9c7){const _0x4266dc=a26_0xc8d0,_0x45146e=new Date(_0xffb9c7),_0xb97999=new Date(),_0x33a38b=_0x45146e[_0x4266dc(0xe4)]()-_0xb97999[_0x4266dc(0xe4)](),_0x2b23fb=Math['abs'](_0x33a38b)/0x3e8,_0x5aa2e8=_0x33a38b<0x0;if(_0x2b23fb<0x3c)return _0x5aa2e8?_0x4266dc(0xec):_0x4266dc(0x6f);else{if(_0x2b23fb<0xe10){const _0x4e5572=Math['round'](_0x2b23fb/0x3c);return _0x5aa2e8?_0x4e5572+_0x4266dc(0xac):_0x4266dc(0xd2)+_0x4e5572+'m';}else{if(_0x2b23fb<0x15180){const _0x3bbc8a=Math['round'](_0x2b23fb/0xe10);return _0x5aa2e8?_0x3bbc8a+'h\x20ago':_0x4266dc(0xd2)+_0x3bbc8a+'h';}else{if(_0x2b23fb<0x93a80){const _0x38252a=Math[_0x4266dc(0x8d)](_0x2b23fb/0x15180);return _0x5aa2e8?_0x38252a+_0x4266dc(0xa2):_0x4266dc(0xd2)+_0x38252a+'d';}else return _0x45146e[_0x4266dc(0xa0)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x4d179c(0xa8)]='schedule:list';[a26_0x4d179c(0x89)]=a26_0x4d179c(0x8b);async[a26_0x4d179c(0xd6)](_0x274ed7){const _0x24342e=a26_0x4d179c,{options:_0x5960e2,args:_0x23db1c,tdx:_0x597204}=_0x274ed7,_0x1b162e=resolveLimit(_0x5960e2['limit'],DEFAULT_DISPLAY_LIMIT),_0x1c39ab=_0x23db1c[0x0],_0x39cf30=_0x1c39ab?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x1c39ab+_0x24342e(0xb1):_0x24342e(0xc7),_0x15ff3c=await withSpinner(_0x39cf30,()=>_0x597204[_0x24342e(0xb5)]['listQueries']({'limit':_0x1b162e,'scheduled':!![],'pattern':_0x1c39ab}),{'verbose':_0x5960e2[_0x24342e(0x71)]}),_0x58f6fc=_0x15ff3c['data'][_0x24342e(0x93)],_0x167070=_0x15ff3c[_0x24342e(0xb9)][_0x24342e(0xa9)][_0x24342e(0x85)],_0x24b8bd=_0x1c39ab?_0x24342e(0xc3)+_0x1c39ab+'\x22':'';_0x167070?console[_0x24342e(0xd5)](_0x24342e(0x98)+_0x58f6fc[_0x24342e(0x7e)]+_0x24342e(0x74)+_0x24b8bd+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x24342e(0xd5)](_0x24342e(0xa5)+_0x58f6fc[_0x24342e(0x7e)]+_0x24342e(0xaa)+(_0x58f6fc[_0x24342e(0x7e)]!==0x1?_0x24342e(0xb3):'y')+_0x24b8bd);if(_0x5960e2[_0x24342e(0xca)]===_0x24342e(0x66)||_0x5960e2[_0x24342e(0xca)]===_0x24342e(0x9b)||_0x5960e2[_0x24342e(0xca)]===_0x24342e(0xdd)||_0x5960e2[_0x24342e(0xca)]===_0x24342e(0xb0)){const _0x1a69f1=_0x58f6fc[_0x24342e(0x7a)](_0x1449b5=>({'id':_0x1449b5['id'],'name':_0x1449b5['name'],'cron':_0x1449b5[_0x24342e(0xed)],'database':_0x1449b5[_0x24342e(0x92)]?.[_0x24342e(0xa8)],'type':_0x1449b5[_0x24342e(0xea)],'timezone':_0x1449b5[_0x24342e(0x76)],'user_name':_0x1449b5[_0x24342e(0x78)]?.[_0x24342e(0xa8)],'updated_at':_0x1449b5[_0x24342e(0x8a)],'next_run_at':_0x1449b5[_0x24342e(0xa3)],'last_job_status':_0x1449b5[_0x24342e(0xbf)]?.[_0x24342e(0x9f)]}));await handleSDKOutput(_0x1a69f1,_0x5960e2);}else{if(_0x58f6fc['length']===0x0)console[_0x24342e(0xad)]('No\x20scheduled\x20queries\x20found');else{const _0x363c27=_0x5960e2[_0x24342e(0xcc)],_0x2f8299=_0x58f6fc['map'](_0x213090=>{const _0x47794d=_0x24342e,_0x963d26=_0x213090[_0x47794d(0xbf)]?.[_0x47794d(0x9f)]?_0x213090[_0x47794d(0xbf)][_0x47794d(0x9f)]===_0x47794d(0x65)?'βœ“':'βœ—':'-',_0x23a503=_0x213090['last_job']?.[_0x47794d(0x99)]?formatRelativeTime(_0x213090[_0x47794d(0xbf)][_0x47794d(0x99)]):_0x47794d(0xae),_0x5e1888=_0x213090[_0x47794d(0xa3)]?formatRelativeTime(_0x213090[_0x47794d(0xa3)]):'-',_0x470a46=_0x213090[_0x47794d(0xed)]||'',_0x512073=_0x213090[_0x47794d(0xa8)]||'(unnamed)',_0x30a68f=getConsoleUrl(_0x363c27,_0x47794d(0x81)+_0x213090['id']);return{'statusIcon':_0x963d26,'lastRun':_0x23a503,'nextRun':_0x5e1888,'cron':_0x470a46,'name':_0x512073,'queryUrl':_0x30a68f,'status':_0x213090[_0x47794d(0xbf)]?.[_0x47794d(0x9f)]};}),_0x47cc80=Math[_0x24342e(0x9d)](..._0x2f8299[_0x24342e(0x7a)](_0x437430=>_0x437430['lastRun'][_0x24342e(0x7e)])),_0x5bcba3=Math[_0x24342e(0x9d)](..._0x2f8299[_0x24342e(0x7a)](_0x154e8a=>_0x154e8a[_0x24342e(0x67)][_0x24342e(0x7e)])),_0xfde2c5=Math[_0x24342e(0x9d)](..._0x2f8299[_0x24342e(0x7a)](_0x40b2c2=>_0x40b2c2['cron']['length'])),_0x3d49b8=_0x2f8299['map'](_0x2f8c0f=>{const _0x56098f=_0x24342e,_0x44cb3d=_0x2f8c0f['status']===_0x56098f(0x65)?a26_0x2c4436[_0x56098f(0x77)](_0x2f8c0f[_0x56098f(0xd3)]):_0x2f8c0f['status']===_0x56098f(0xd5)?a26_0x2c4436[_0x56098f(0xba)](_0x2f8c0f[_0x56098f(0xd3)]):a26_0x2c4436[_0x56098f(0x97)](_0x2f8c0f[_0x56098f(0xd3)]),_0xad9a9b=_0x2f8c0f[_0x56098f(0x9a)][_0x56098f(0x73)](_0x47cc80),_0x24ad46=_0x2f8c0f[_0x56098f(0x67)][_0x56098f(0x73)](_0x5bcba3),_0x34b227=_0x2f8c0f['cron']?a26_0x2c4436['cyan'](_0x2f8c0f['cron'][_0x56098f(0x73)](_0xfde2c5)):'\x20'['repeat'](_0xfde2c5),_0xaaf306=hyperlink(_0x2f8c0f['name'],_0x2f8c0f[_0x56098f(0x6c)]);return _0x56098f(0xe3)+_0x44cb3d+'\x20'+_0xad9a9b+'\x20\x20β†’\x20'+_0x24ad46+'\x20\x20'+_0x34b227+'\x20\x20'+_0xaaf306;});await writeOutput(_0x3d49b8[_0x24342e(0xa7)]('\x0a'),_0x5960e2['output'],_0x24342e(0xee));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x4d179c(0xa8)]='schedule:show';['description']='Show\x20schedule\x20details';[a26_0x4d179c(0x95)](_0x5ab1c0){const _0x44092a=a26_0x4d179c,_0x15054e=_0x5ab1c0[_0x44092a(0xe5)][0x0];if(!_0x15054e)return _0x44092a(0xab);return undefined;}async[a26_0x4d179c(0xd6)](_0x6007a0){const _0x2bfb53=a26_0x4d179c,{options:_0x1c58bb,args:_0x3fbdd3,tdx:_0x35bb14}=_0x6007a0,_0x13b801=_0x3fbdd3[0x0],_0x3c0fff=await withSpinner(_0x2bfb53(0xe8),()=>_0x35bb14['schedules'][_0x2bfb53(0x86)](_0x13b801),{'verbose':_0x1c58bb['verbose']}),_0x216d27=_0x3c0fff[_0x2bfb53(0xb9)],_0x247356={'name':_0x216d27[_0x2bfb53(0xa8)],'cron':_0x216d27[_0x2bfb53(0xed)],'database':_0x216d27[_0x2bfb53(0x92)],'type':_0x216d27[_0x2bfb53(0xea)],'timezone':_0x216d27['timezone'],'user_name':_0x216d27[_0x2bfb53(0xdc)],'created_at':_0x216d27[_0x2bfb53(0xd8)],'engine_version':_0x216d27['engine_version'],'executing_user_id':_0x216d27['executing_user_id'],'query':_0x216d27[_0x2bfb53(0xb8)],'delay':_0x216d27[_0x2bfb53(0xd0)],'priority':_0x216d27[_0x2bfb53(0x91)],'retry_limit':_0x216d27[_0x2bfb53(0xc9)],..._0x216d27[_0x2bfb53(0x8e)]&&{'result':_0x216d27[_0x2bfb53(0x8e)]}};return await handleSingleObjectOutput(_0x247356,_0x1c58bb),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a26_0x4d179c(0xe7);[a26_0x4d179c(0x89)]=a26_0x4d179c(0xe6);[a26_0x4d179c(0x95)](_0x301b99){const _0x1ff4f7=a26_0x4d179c,_0x1eae95=_0x301b99[_0x1ff4f7(0xe5)][0x0];if(!_0x1eae95)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_0x4d179c(0xd6)](_0x460c7e){const _0x498a09=a26_0x4d179c,{options:_0x5f31f9,args:_0xd2ac4a,tdx:_0x4e9726}=_0x460c7e,_0x5e0cb0=_0xd2ac4a[0x0],_0x383786=_0x5f31f9,_0x535a93=_0x383786[_0x498a09(0x92)],_0x409d11=_0x383786[_0x498a09(0xa6)],_0x25c040=_0x383786[_0x498a09(0xea)]||'trino';let _0x53ad60;try{_0x53ad60=readFileSync(_0x409d11,_0x498a09(0xbd))[_0x498a09(0xde)]();}catch(_0x3663bb){throw new SDKError(ErrorCode[_0x498a09(0x7d)],'Failed\x20to\x20read\x20file:\x20'+_0x409d11,_0x3663bb instanceof Error?_0x3663bb:undefined);}if(!_0x53ad60)throw new SDKError(ErrorCode[_0x498a09(0x7d)],'Query\x20file\x20is\x20empty');const _0x2327b0={'database':_0x535a93,'query':_0x53ad60,'type':_0x25c040};if(_0x383786[_0x498a09(0xed)])_0x2327b0[_0x498a09(0xed)]=_0x383786['cron'];if(_0x383786[_0x498a09(0xcf)])_0x2327b0[_0x498a09(0xcf)]=_0x383786[_0x498a09(0xcf)];if(_0x383786[_0x498a09(0xd0)]!==undefined)_0x2327b0['delay']=Number(_0x383786[_0x498a09(0xd0)]);if(_0x383786[_0x498a09(0x91)]!==undefined)_0x2327b0[_0x498a09(0x91)]=Number(_0x383786[_0x498a09(0x91)]);if(_0x383786[_0x498a09(0x82)]!==undefined)_0x2327b0[_0x498a09(0xc9)]=Number(_0x383786[_0x498a09(0x82)]);if(_0x383786[_0x498a09(0xaf)])_0x2327b0[_0x498a09(0x9e)]=_0x383786[_0x498a09(0xaf)];if(_0x383786[_0x498a09(0x8e)])_0x2327b0['result']=_0x383786[_0x498a09(0x8e)];if(_0x5f31f9[_0x498a09(0x71)]){console['error'](_0x498a09(0x70)+_0x5e0cb0),console[_0x498a09(0xd5)]('\x20\x20Database:\x20'+_0x535a93),console[_0x498a09(0xd5)](_0x498a09(0xc8)+_0x25c040);if(_0x2327b0['cron'])console['error'](_0x498a09(0xd9)+_0x2327b0[_0x498a09(0xed)]);if(_0x2327b0['timezone'])console['error'](_0x498a09(0xcb)+_0x2327b0[_0x498a09(0xcf)]);}const _0x50f199=await withSpinner(_0x498a09(0xd1),()=>_0x4e9726[_0x498a09(0xb5)][_0x498a09(0x8f)](_0x5e0cb0,_0x2327b0),{'verbose':_0x5f31f9['verbose']});return console[_0x498a09(0xd5)](_0x498a09(0xbb)+_0x50f199[_0x498a09(0xb9)][_0x498a09(0xa8)]),await handleSingleObjectOutput(_0x50f199[_0x498a09(0xb9)],_0x5f31f9),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x4d179c(0xa8)]=a26_0x4d179c(0x6b);['description']=a26_0x4d179c(0xc4);[a26_0x4d179c(0x95)](_0x2e7175){const _0x1acfef=a26_0x4d179c,_0x496685=_0x2e7175[_0x1acfef(0xe5)][0x0];if(!_0x496685)return _0x1acfef(0x6e);return undefined;}async[a26_0x4d179c(0xd6)](_0x3178ec){const _0x4478dd=a26_0x4d179c,{options:_0x23b374,args:_0x21feac,tdx:_0x5cc4e1}=_0x3178ec,_0x3e9f94=_0x21feac[0x0],_0x27d907=_0x23b374,_0x31853b={};if(_0x27d907[_0x4478dd(0x92)])_0x31853b[_0x4478dd(0x92)]=_0x27d907['database'];if(_0x27d907['type'])_0x31853b[_0x4478dd(0xea)]=_0x27d907['type'];if(_0x27d907[_0x4478dd(0xed)])_0x31853b[_0x4478dd(0xed)]=_0x27d907['cron'];if(_0x27d907[_0x4478dd(0xcf)])_0x31853b['timezone']=_0x27d907['timezone'];if(_0x27d907[_0x4478dd(0xd0)]!==undefined)_0x31853b[_0x4478dd(0xd0)]=Number(_0x27d907['delay']);if(_0x27d907['priority']!==undefined)_0x31853b[_0x4478dd(0x91)]=Number(_0x27d907[_0x4478dd(0x91)]);if(_0x27d907['retryLimit']!==undefined)_0x31853b[_0x4478dd(0xc9)]=Number(_0x27d907[_0x4478dd(0x82)]);if(_0x27d907[_0x4478dd(0xaf)])_0x31853b['engine_version']=_0x27d907[_0x4478dd(0xaf)];if(_0x27d907[_0x4478dd(0x8e)])_0x31853b[_0x4478dd(0x8e)]=_0x27d907['result'];if(_0x27d907['file'])try{_0x31853b[_0x4478dd(0xb8)]=readFileSync(_0x27d907['file'],_0x4478dd(0xbd))[_0x4478dd(0xde)]();}catch(_0x365701){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4478dd(0xd4)+_0x27d907[_0x4478dd(0xa6)],_0x365701 instanceof Error?_0x365701:undefined);}if(Object[_0x4478dd(0x6d)](_0x31853b)[_0x4478dd(0x7e)]===0x0)throw new SDKError(ErrorCode[_0x4478dd(0x7d)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x23b374[_0x4478dd(0x71)]){console[_0x4478dd(0xd5)](_0x4478dd(0xce)+_0x3e9f94);for(const [_0x37e2da,_0x188292]of Object[_0x4478dd(0xd7)](_0x31853b)){_0x37e2da==='query'?console['error']('\x20\x20'+_0x37e2da+':\x20'+_0x188292[_0x4478dd(0x84)](0x0,0x32)+_0x4478dd(0x72)):console[_0x4478dd(0xd5)]('\x20\x20'+_0x37e2da+':\x20'+_0x188292);}}const _0x3eab86=await withSpinner(_0x4478dd(0x7c),()=>_0x5cc4e1['schedules']['update'](_0x3e9f94,_0x31853b),{'verbose':_0x23b374[_0x4478dd(0x71)]});return console['error'](_0x4478dd(0xda)+_0x3eab86[_0x4478dd(0xb9)][_0x4478dd(0xa8)]),await handleSingleObjectOutput(_0x3eab86[_0x4478dd(0xb9)],_0x23b374),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']='schedule:delete';[a26_0x4d179c(0x89)]=a26_0x4d179c(0xc0);[a26_0x4d179c(0x95)](_0x481afc){const _0x1bc0cb=a26_0x4d179c,_0xedf842=_0x481afc[_0x1bc0cb(0xe5)][0x0];if(!_0xedf842)return _0x1bc0cb(0x90);return undefined;}async[a26_0x4d179c(0xd6)](_0x25a906){const _0x4f08cb=a26_0x4d179c,{options:_0x4acea8,args:_0x44caf5,tdx:_0x2dbe05}=_0x25a906,_0x1d9e3b=_0x44caf5[0x0];if(!_0x4acea8['yes']){const _0x7cfee9=await confirm(_0x4f08cb(0x94)+_0x1d9e3b+'\x22?');if(!_0x7cfee9)return console[_0x4f08cb(0xd5)](_0x4f08cb(0xe2)),0x0;}const _0x13810a=await withSpinner(_0x4f08cb(0x69),()=>_0x2dbe05['schedules'][_0x4f08cb(0xc1)](_0x1d9e3b),{'verbose':_0x4acea8[_0x4f08cb(0x71)]});return console[_0x4f08cb(0xd5)](_0x4f08cb(0x79)+_0x13810a[_0x4f08cb(0xb9)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a26_0x4d179c(0xbc);[a26_0x4d179c(0x89)]=a26_0x4d179c(0xa1);['validate'](_0x484e26){const _0x5c3f28=_0x484e26['args'][0x0];if(!_0x5c3f28)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async['execute'](_0x4c1725){const _0x131938=a26_0x4d179c,{options:_0x3f841f,args:_0x102ebd,tdx:_0x3e89a8}=_0x4c1725,_0x1749d0=_0x102ebd[0x0],_0x133b0b=_0x3f841f,_0x5e2035=_0x133b0b[_0x131938(0x96)],_0x2ff035=_0x133b0b[_0x131938(0xc2)]!==undefined?Number(_0x133b0b['num']):undefined;if(_0x3f841f[_0x131938(0x71)]){console['error']('Running\x20schedule:\x20'+_0x1749d0);if(_0x5e2035)console[_0x131938(0xd5)](_0x131938(0xcd)+_0x5e2035);if(_0x2ff035)console[_0x131938(0xd5)]('\x20\x20Num:\x20'+_0x2ff035);}const _0x30d8ac=await withSpinner(_0x131938(0x6a),()=>_0x3e89a8[_0x131938(0xb5)]['run'](_0x1749d0,{'time':_0x5e2035,'num':_0x2ff035}),{'verbose':_0x3f841f[_0x131938(0x71)]}),_0x33ce80=_0x30d8ac[_0x131938(0xb9)]['jobs'];console[_0x131938(0xd5)](_0x131938(0x75)+_0x33ce80[_0x131938(0x7e)]+'\x20job'+(_0x33ce80[_0x131938(0x7e)]!==0x1?'s':'')+'\x20created');for(const _0xdb18c1 of _0x33ce80){console[_0x131938(0xd5)](_0x131938(0xbe)+_0xdb18c1[_0x131938(0x83)]);}return await handleSDKOutput(_0x33ce80,_0x3f841f),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x4d179c(0xa8)]=a26_0x4d179c(0x7f);[a26_0x4d179c(0x89)]=a26_0x4d179c(0xb6);[a26_0x4d179c(0x95)](_0x2d43ad){const _0x147232=a26_0x4d179c,_0x7a7e28=_0x2d43ad[_0x147232(0xe5)][0x0];if(!_0x7a7e28)return _0x147232(0xdb);return undefined;}async[a26_0x4d179c(0xd6)](_0x3c4972){const _0x2b1eb9=a26_0x4d179c,{options:_0xec5778,args:_0x155906,tdx:_0x7c129a}=_0x3c4972,_0x52fc23=_0x155906[0x0],_0x1b0920=_0xec5778,_0x42761b=_0x1b0920['from']!==undefined?Number(_0x1b0920['from']):undefined,_0x240271=_0x1b0920['to']!==undefined?Number(_0x1b0920['to']):undefined,_0x2803c1=await withSpinner(_0x2b1eb9(0xc6),()=>_0x7c129a[_0x2b1eb9(0xb5)][_0x2b1eb9(0x68)](_0x52fc23,{'from':_0x42761b,'to':_0x240271}),{'verbose':_0xec5778['verbose']}),_0x20c1ee=_0x2803c1[_0x2b1eb9(0xb9)];console[_0x2b1eb9(0xd5)](_0x2b1eb9(0xa5)+_0x20c1ee[_0x2b1eb9(0xb4)]+_0x2b1eb9(0xe9)+(_0x20c1ee[_0x2b1eb9(0xb4)]!==0x1?'s':'')+_0x2b1eb9(0xb7)+_0x20c1ee['from']+'-'+_0x20c1ee['to']+')');const _0x2af158=_0x20c1ee[_0x2b1eb9(0x68)]['map'](_0x27fff0=>({'job_id':_0x27fff0[_0x2b1eb9(0x83)],'type':_0x27fff0[_0x2b1eb9(0xea)],'status':_0x27fff0['status'],'scheduled_at':_0x27fff0[_0x2b1eb9(0x9c)],'created_at':_0x27fff0['created_at'],'start_at':_0x27fff0[_0x2b1eb9(0xa4)],'end_at':_0x27fff0[_0x2b1eb9(0x88)]}));return await handleSDKOutput(_0x2af158,_0xec5778),0x0;}}
1
+ const a26_0xea0ac0=a26_0x1f9f;(function(_0x221d78,_0x5286ce){const _0x2b396a=a26_0x1f9f,_0x58bdfb=_0x221d78();while(!![]){try{const _0x2cd6f0=-parseInt(_0x2b396a(0x196))/0x1+parseInt(_0x2b396a(0x1a6))/0x2+-parseInt(_0x2b396a(0x18c))/0x3+-parseInt(_0x2b396a(0x125))/0x4+parseInt(_0x2b396a(0x176))/0x5*(-parseInt(_0x2b396a(0x15d))/0x6)+-parseInt(_0x2b396a(0x138))/0x7+parseInt(_0x2b396a(0x145))/0x8;if(_0x2cd6f0===_0x5286ce)break;else _0x58bdfb['push'](_0x58bdfb['shift']());}catch(_0x3f81f8){_0x58bdfb['push'](_0x58bdfb['shift']());}}}(a26_0x390a,0xbcb1d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a26_0x1f9f(_0x450795,_0x3c926a){_0x450795=_0x450795-0x123;const _0x390a09=a26_0x390a();let _0x1f9fb3=_0x390a09[_0x450795];return _0x1f9fb3;}function a26_0x390a(){const _0x58300c=['\x20\x20Database:\x20','Getting\x20schedule\x20history...','abs','engineVersion','Listing\x20scheduled\x20queries...','from','Query\x20file\x20is\x20empty','Schedule\x20updated:\x20','2093056aICtQP','schedule:update','length','Schedule\x20deleted:\x20','Running\x20schedule:\x20','success','getTime','has_next_page','\x20(showing\x20','description','1328584QtNFrB','tsv','statusIcon','map','utf-8','keys','list','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','user','Updating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','retryLimit','\x20execution','queries','delay','trim','database','Creating\x20schedule...','user_name','10760799gqlPdc','Run\x20a\x20scheduled\x20query\x20immediately','engine_version','h\x20ago','Schedule\x20run\x20submitted:\x20','name','just\x20now','Create\x20a\x20scheduled\x20query','result','pagination','retry_limit','No\x20scheduled\x20queries\x20found','schedules','29650680ZqrsXM','last_job','\x20\x20Job\x20ID:\x20','substring','end_at','toLocaleDateString','\x20\x20Num:\x20','Update\x20a\x20scheduled\x20query','created_at','Found\x20','red','scheduled_at','schedule:history','output','/app/queries/editor?queryId=','error','ended_at','status','yes','timezone','round','create','in\x20','Show\x20schedule\x20execution\x20history','1689852CvNXaV','\x20\x20β†’\x20','\x20\x20Timezone:\x20','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','max','jsonl','data','run','type','schedule:delete','\x20matching\x20\x22','count','update','lastRun','INVALID_ARGUMENT','d\x20ago','schedule:create','Creating\x20schedule:\x20','nextRun','Deleting\x20schedule...','green','Failed\x20to\x20read\x20file:\x20','jobs','cyan','Schedule\x20created:\x20','5gMnAYh','site','schedule:run','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','history','time_zone','repeat','job_id','cron','Getting\x20schedule\x20details...','padEnd','priority','\x20job','next_run_at','validate','query','executing_user_id','Delete\x20a\x20scheduled\x20query','file','verbose','Running\x20schedule...','execute','1134660lPPPRD','num','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','never','format','entries','dim','\x20\x20Type:\x20','m\x20ago','delete','1450705izmAdg','...','updated_at','\x20\x20Time:\x20','args','table','limit','soon'];a26_0x390a=function(){return _0x58300c;};return a26_0x390a();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x4bf6cd from'chalk';function formatRelativeTime(_0x39bfd4){const _0x553578=a26_0x1f9f,_0x219cfe=new Date(_0x39bfd4),_0x5b8bf3=new Date(),_0x1883dc=_0x219cfe['getTime']()-_0x5b8bf3[_0x553578(0x1ac)](),_0x45e5aa=Math[_0x553578(0x1a0)](_0x1883dc)/0x3e8,_0x4babca=_0x1883dc<0x0;if(_0x45e5aa<0x3c)return _0x4babca?_0x553578(0x13e):_0x553578(0x19d);else{if(_0x45e5aa<0xe10){const _0x2b2a4e=Math[_0x553578(0x159)](_0x45e5aa/0x3c);return _0x4babca?_0x2b2a4e+_0x553578(0x194):_0x553578(0x15b)+_0x2b2a4e+'m';}else{if(_0x45e5aa<0x15180){const _0x3c9b2e=Math[_0x553578(0x159)](_0x45e5aa/0xe10);return _0x4babca?_0x3c9b2e+_0x553578(0x13b):_0x553578(0x15b)+_0x3c9b2e+'h';}else{if(_0x45e5aa<0x93a80){const _0x390e2c=Math[_0x553578(0x159)](_0x45e5aa/0x15180);return _0x4babca?_0x390e2c+_0x553578(0x16c):_0x553578(0x15b)+_0x390e2c+'d';}else return _0x219cfe[_0x553578(0x14a)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0xea0ac0(0x13d)]='schedule:list';[a26_0xea0ac0(0x124)]='List\x20scheduled\x20queries';async['execute'](_0x25cc4d){const _0x446be2=a26_0xea0ac0,{options:_0x3d7502,args:_0x1467bf,tdx:_0x4bcc7b}=_0x25cc4d,_0x4bf2c7=resolveLimit(_0x3d7502[_0x446be2(0x19c)],DEFAULT_DISPLAY_LIMIT),_0x194fe=_0x1467bf[0x0],_0x40b2fd=_0x194fe?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x194fe+'\x22...':_0x446be2(0x1a2),_0x520b9e=await withSpinner(_0x40b2fd,()=>_0x4bcc7b[_0x446be2(0x144)]['listQueries']({'limit':_0x4bf2c7,'scheduled':!![],'pattern':_0x194fe}),{'verbose':_0x3d7502['verbose']}),_0x268571=_0x520b9e[_0x446be2(0x163)][_0x446be2(0x132)],_0x489268=_0x520b9e['data'][_0x446be2(0x141)][_0x446be2(0x1ad)],_0x4849f2=_0x194fe?_0x446be2(0x167)+_0x194fe+'\x22':'';_0x489268?console[_0x446be2(0x154)]('Showing\x20first\x20'+_0x268571[_0x446be2(0x1a8)]+'\x20schedules'+_0x4849f2+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x446be2(0x154)]('Found\x20'+_0x268571[_0x446be2(0x1a8)]+'\x20scheduled\x20quer'+(_0x268571[_0x446be2(0x1a8)]!==0x1?'ies':'y')+_0x4849f2);if(_0x3d7502[_0x446be2(0x190)]==='json'||_0x3d7502[_0x446be2(0x190)]===_0x446be2(0x162)||_0x3d7502[_0x446be2(0x190)]===_0x446be2(0x19b)||_0x3d7502[_0x446be2(0x190)]===_0x446be2(0x126)){const _0x6f24fd=_0x268571[_0x446be2(0x128)](_0x54d128=>({'id':_0x54d128['id'],'name':_0x54d128[_0x446be2(0x13d)],'cron':_0x54d128['cron'],'database':_0x54d128[_0x446be2(0x135)]?.['name'],'type':_0x54d128[_0x446be2(0x165)],'timezone':_0x54d128[_0x446be2(0x17b)],'user_name':_0x54d128[_0x446be2(0x12d)]?.['name'],'updated_at':_0x54d128[_0x446be2(0x198)],'next_run_at':_0x54d128[_0x446be2(0x183)],'last_job_status':_0x54d128[_0x446be2(0x146)]?.['status']}));await handleSDKOutput(_0x6f24fd,_0x3d7502);}else{if(_0x268571[_0x446be2(0x1a8)]===0x0)console['log'](_0x446be2(0x143));else{const _0x2db206=_0x3d7502[_0x446be2(0x177)],_0x30f25b=_0x268571[_0x446be2(0x128)](_0x3b7d08=>{const _0x167b7e=_0x446be2,_0x32b3f1=_0x3b7d08[_0x167b7e(0x146)]?.[_0x167b7e(0x156)]?_0x3b7d08['last_job']['status']===_0x167b7e(0x1ab)?'βœ“':'βœ—':'-',_0x266831=_0x3b7d08[_0x167b7e(0x146)]?.[_0x167b7e(0x155)]?formatRelativeTime(_0x3b7d08[_0x167b7e(0x146)]['ended_at']):_0x167b7e(0x18f),_0x38c3f7=_0x3b7d08['next_run_at']?formatRelativeTime(_0x3b7d08[_0x167b7e(0x183)]):'-',_0xd07168=_0x3b7d08[_0x167b7e(0x17e)]||'',_0x1f6f54=_0x3b7d08[_0x167b7e(0x13d)]||'(unnamed)',_0x42d8b1=getConsoleUrl(_0x2db206,_0x167b7e(0x153)+_0x3b7d08['id']);return{'statusIcon':_0x32b3f1,'lastRun':_0x266831,'nextRun':_0x38c3f7,'cron':_0xd07168,'name':_0x1f6f54,'queryUrl':_0x42d8b1,'status':_0x3b7d08[_0x167b7e(0x146)]?.[_0x167b7e(0x156)]};}),_0x442d5f=Math[_0x446be2(0x161)](..._0x30f25b['map'](_0x12096d=>_0x12096d['lastRun']['length'])),_0x5b6ad8=Math['max'](..._0x30f25b[_0x446be2(0x128)](_0x12384b=>_0x12384b[_0x446be2(0x16f)][_0x446be2(0x1a8)])),_0x51f6ad=Math[_0x446be2(0x161)](..._0x30f25b[_0x446be2(0x128)](_0x309182=>_0x309182[_0x446be2(0x17e)]['length'])),_0x1731e5=_0x30f25b[_0x446be2(0x128)](_0x3c99a2=>{const _0xc4a542=_0x446be2,_0x319d14=_0x3c99a2[_0xc4a542(0x156)]===_0xc4a542(0x1ab)?a26_0x4bf6cd[_0xc4a542(0x171)](_0x3c99a2['statusIcon']):_0x3c99a2[_0xc4a542(0x156)]===_0xc4a542(0x154)?a26_0x4bf6cd[_0xc4a542(0x14f)](_0x3c99a2[_0xc4a542(0x127)]):a26_0x4bf6cd[_0xc4a542(0x192)](_0x3c99a2[_0xc4a542(0x127)]),_0x1dace1=_0x3c99a2[_0xc4a542(0x16a)][_0xc4a542(0x180)](_0x442d5f),_0x3167c3=_0x3c99a2[_0xc4a542(0x16f)]['padEnd'](_0x5b6ad8),_0x35661f=_0x3c99a2[_0xc4a542(0x17e)]?a26_0x4bf6cd[_0xc4a542(0x174)](_0x3c99a2['cron'][_0xc4a542(0x180)](_0x51f6ad)):'\x20'[_0xc4a542(0x17c)](_0x51f6ad),_0x4d602b=hyperlink(_0x3c99a2['name'],_0x3c99a2['queryUrl']);return'πŸ“…\x20'+_0x319d14+'\x20'+_0x1dace1+_0xc4a542(0x15e)+_0x3167c3+'\x20\x20'+_0x35661f+'\x20\x20'+_0x4d602b;});await writeOutput(_0x1731e5['join']('\x0a'),_0x3d7502[_0x446be2(0x152)],_0x446be2(0x12b));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0xea0ac0(0x13d)]='schedule:show';['description']='Show\x20schedule\x20details';[a26_0xea0ac0(0x184)](_0x2fa832){const _0x4c6c9b=a26_0xea0ac0,_0x14e1ef=_0x2fa832[_0x4c6c9b(0x19a)][0x0];if(!_0x14e1ef)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a26_0xea0ac0(0x18b)](_0x2920c2){const _0x24a206=a26_0xea0ac0,{options:_0x1072dc,args:_0x18a35f,tdx:_0x1fa828}=_0x2920c2,_0x33a921=_0x18a35f[0x0],_0xb03faa=await withSpinner(_0x24a206(0x17f),()=>_0x1fa828[_0x24a206(0x144)]['show'](_0x33a921),{'verbose':_0x1072dc[_0x24a206(0x189)]}),_0x595fb7=_0xb03faa['data'],_0x5a4dca={'name':_0x595fb7[_0x24a206(0x13d)],'cron':_0x595fb7[_0x24a206(0x17e)],'database':_0x595fb7[_0x24a206(0x135)],'type':_0x595fb7[_0x24a206(0x165)],'timezone':_0x595fb7[_0x24a206(0x158)],'user_name':_0x595fb7[_0x24a206(0x137)],'created_at':_0x595fb7[_0x24a206(0x14d)],'engine_version':_0x595fb7['engine_version'],'executing_user_id':_0x595fb7[_0x24a206(0x186)],'query':_0x595fb7[_0x24a206(0x185)],'delay':_0x595fb7[_0x24a206(0x133)],'priority':_0x595fb7[_0x24a206(0x181)],'retry_limit':_0x595fb7[_0x24a206(0x142)],..._0x595fb7[_0x24a206(0x140)]&&{'result':_0x595fb7[_0x24a206(0x140)]}};return await handleSingleObjectOutput(_0x5a4dca,_0x1072dc),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0xea0ac0(0x13d)]=a26_0xea0ac0(0x16d);[a26_0xea0ac0(0x124)]=a26_0xea0ac0(0x13f);[a26_0xea0ac0(0x184)](_0x1ca694){const _0x37f18a=a26_0xea0ac0,_0x5e18c5=_0x1ca694['args'][0x0];if(!_0x5e18c5)return _0x37f18a(0x12f);return undefined;}async[a26_0xea0ac0(0x18b)](_0xda8d97){const _0x1af3f6=a26_0xea0ac0,{options:_0x1edbea,args:_0x2cebf3,tdx:_0x3a1d6c}=_0xda8d97,_0x291309=_0x2cebf3[0x0],_0x2bced7=_0x1edbea,_0x817d34=_0x2bced7[_0x1af3f6(0x135)],_0x23f5d1=_0x2bced7[_0x1af3f6(0x188)],_0xe509fc=_0x2bced7[_0x1af3f6(0x165)]||'trino';let _0x14c795;try{_0x14c795=readFileSync(_0x23f5d1,_0x1af3f6(0x129))[_0x1af3f6(0x134)]();}catch(_0x2438db){throw new SDKError(ErrorCode[_0x1af3f6(0x16b)],_0x1af3f6(0x172)+_0x23f5d1,_0x2438db instanceof Error?_0x2438db:undefined);}if(!_0x14c795)throw new SDKError(ErrorCode[_0x1af3f6(0x16b)],_0x1af3f6(0x1a4));const _0x17403a={'database':_0x817d34,'query':_0x14c795,'type':_0xe509fc};if(_0x2bced7[_0x1af3f6(0x17e)])_0x17403a[_0x1af3f6(0x17e)]=_0x2bced7[_0x1af3f6(0x17e)];if(_0x2bced7[_0x1af3f6(0x158)])_0x17403a[_0x1af3f6(0x158)]=_0x2bced7[_0x1af3f6(0x158)];if(_0x2bced7[_0x1af3f6(0x133)]!==undefined)_0x17403a[_0x1af3f6(0x133)]=Number(_0x2bced7[_0x1af3f6(0x133)]);if(_0x2bced7[_0x1af3f6(0x181)]!==undefined)_0x17403a['priority']=Number(_0x2bced7[_0x1af3f6(0x181)]);if(_0x2bced7[_0x1af3f6(0x130)]!==undefined)_0x17403a[_0x1af3f6(0x142)]=Number(_0x2bced7[_0x1af3f6(0x130)]);if(_0x2bced7['engineVersion'])_0x17403a[_0x1af3f6(0x13a)]=_0x2bced7[_0x1af3f6(0x1a1)];if(_0x2bced7[_0x1af3f6(0x140)])_0x17403a[_0x1af3f6(0x140)]=_0x2bced7['result'];if(_0x1edbea[_0x1af3f6(0x189)]){console[_0x1af3f6(0x154)](_0x1af3f6(0x16e)+_0x291309),console['error'](_0x1af3f6(0x19e)+_0x817d34),console['error'](_0x1af3f6(0x193)+_0xe509fc);if(_0x17403a[_0x1af3f6(0x17e)])console[_0x1af3f6(0x154)]('\x20\x20Cron:\x20'+_0x17403a['cron']);if(_0x17403a[_0x1af3f6(0x158)])console[_0x1af3f6(0x154)](_0x1af3f6(0x15f)+_0x17403a[_0x1af3f6(0x158)]);}const _0x1c69cd=await withSpinner(_0x1af3f6(0x136),()=>_0x3a1d6c[_0x1af3f6(0x144)][_0x1af3f6(0x15a)](_0x291309,_0x17403a),{'verbose':_0x1edbea['verbose']});return console[_0x1af3f6(0x154)](_0x1af3f6(0x175)+_0x1c69cd[_0x1af3f6(0x163)][_0x1af3f6(0x13d)]),await handleSingleObjectOutput(_0x1c69cd['data'],_0x1edbea),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0xea0ac0(0x13d)]=a26_0xea0ac0(0x1a7);[a26_0xea0ac0(0x124)]=a26_0xea0ac0(0x14c);['validate'](_0x54856c){const _0x4d1245=a26_0xea0ac0,_0x5e7b81=_0x54856c[_0x4d1245(0x19a)][0x0];if(!_0x5e7b81)return _0x4d1245(0x12c);return undefined;}async['execute'](_0x368505){const _0x522b6b=a26_0xea0ac0,{options:_0x3c5889,args:_0x437514,tdx:_0x282b77}=_0x368505,_0x2a14b2=_0x437514[0x0],_0x39b70b=_0x3c5889,_0x500991={};if(_0x39b70b['database'])_0x500991[_0x522b6b(0x135)]=_0x39b70b['database'];if(_0x39b70b[_0x522b6b(0x165)])_0x500991[_0x522b6b(0x165)]=_0x39b70b[_0x522b6b(0x165)];if(_0x39b70b['cron'])_0x500991[_0x522b6b(0x17e)]=_0x39b70b[_0x522b6b(0x17e)];if(_0x39b70b[_0x522b6b(0x158)])_0x500991[_0x522b6b(0x158)]=_0x39b70b[_0x522b6b(0x158)];if(_0x39b70b[_0x522b6b(0x133)]!==undefined)_0x500991[_0x522b6b(0x133)]=Number(_0x39b70b[_0x522b6b(0x133)]);if(_0x39b70b[_0x522b6b(0x181)]!==undefined)_0x500991[_0x522b6b(0x181)]=Number(_0x39b70b['priority']);if(_0x39b70b[_0x522b6b(0x130)]!==undefined)_0x500991['retry_limit']=Number(_0x39b70b[_0x522b6b(0x130)]);if(_0x39b70b[_0x522b6b(0x1a1)])_0x500991[_0x522b6b(0x13a)]=_0x39b70b[_0x522b6b(0x1a1)];if(_0x39b70b[_0x522b6b(0x140)])_0x500991[_0x522b6b(0x140)]=_0x39b70b['result'];if(_0x39b70b['file'])try{_0x500991['query']=readFileSync(_0x39b70b[_0x522b6b(0x188)],_0x522b6b(0x129))[_0x522b6b(0x134)]();}catch(_0x3f7254){throw new SDKError(ErrorCode[_0x522b6b(0x16b)],_0x522b6b(0x172)+_0x39b70b[_0x522b6b(0x188)],_0x3f7254 instanceof Error?_0x3f7254:undefined);}if(Object[_0x522b6b(0x12a)](_0x500991)['length']===0x0)throw new SDKError(ErrorCode[_0x522b6b(0x16b)],_0x522b6b(0x160));if(_0x3c5889[_0x522b6b(0x189)]){console[_0x522b6b(0x154)]('Updating\x20schedule:\x20'+_0x2a14b2);for(const [_0x2d659c,_0x3cc043]of Object[_0x522b6b(0x191)](_0x500991)){_0x2d659c===_0x522b6b(0x185)?console[_0x522b6b(0x154)]('\x20\x20'+_0x2d659c+':\x20'+_0x3cc043[_0x522b6b(0x148)](0x0,0x32)+_0x522b6b(0x197)):console[_0x522b6b(0x154)]('\x20\x20'+_0x2d659c+':\x20'+_0x3cc043);}}const _0x4ce59c=await withSpinner(_0x522b6b(0x12e),()=>_0x282b77[_0x522b6b(0x144)][_0x522b6b(0x169)](_0x2a14b2,_0x500991),{'verbose':_0x3c5889[_0x522b6b(0x189)]});return console[_0x522b6b(0x154)](_0x522b6b(0x1a5)+_0x4ce59c[_0x522b6b(0x163)][_0x522b6b(0x13d)]),await handleSingleObjectOutput(_0x4ce59c[_0x522b6b(0x163)],_0x3c5889),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0xea0ac0(0x13d)]=a26_0xea0ac0(0x166);['description']=a26_0xea0ac0(0x187);[a26_0xea0ac0(0x184)](_0xb6e1d2){const _0x281fd9=a26_0xea0ac0,_0x44317f=_0xb6e1d2[_0x281fd9(0x19a)][0x0];if(!_0x44317f)return _0x281fd9(0x179);return undefined;}async[a26_0xea0ac0(0x18b)](_0x1845f7){const _0x120e9a=a26_0xea0ac0,{options:_0x862e7b,args:_0x3709d1,tdx:_0x4dfd83}=_0x1845f7,_0x5606a0=_0x3709d1[0x0];if(!_0x862e7b[_0x120e9a(0x157)]){const _0x4da884=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x5606a0+'\x22?');if(!_0x4da884)return console['error']('Cancelled'),0x0;}const _0x4b75f0=await withSpinner(_0x120e9a(0x170),()=>_0x4dfd83[_0x120e9a(0x144)][_0x120e9a(0x195)](_0x5606a0),{'verbose':_0x862e7b[_0x120e9a(0x189)]});return console['error'](_0x120e9a(0x1a9)+_0x4b75f0[_0x120e9a(0x163)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0xea0ac0(0x13d)]=a26_0xea0ac0(0x178);['description']=a26_0xea0ac0(0x139);[a26_0xea0ac0(0x184)](_0x47479f){const _0x1b0d16=a26_0xea0ac0,_0x4719c6=_0x47479f[_0x1b0d16(0x19a)][0x0];if(!_0x4719c6)return _0x1b0d16(0x18e);return undefined;}async[a26_0xea0ac0(0x18b)](_0x14f073){const _0x51a530=a26_0xea0ac0,{options:_0x3c0b3e,args:_0x1daf06,tdx:_0x5a9380}=_0x14f073,_0x1eb0b8=_0x1daf06[0x0],_0xc7dbde=_0x3c0b3e,_0x248f43=_0xc7dbde['time'],_0x9eda50=_0xc7dbde[_0x51a530(0x18d)]!==undefined?Number(_0xc7dbde[_0x51a530(0x18d)]):undefined;if(_0x3c0b3e[_0x51a530(0x189)]){console[_0x51a530(0x154)](_0x51a530(0x1aa)+_0x1eb0b8);if(_0x248f43)console['error'](_0x51a530(0x199)+_0x248f43);if(_0x9eda50)console[_0x51a530(0x154)](_0x51a530(0x14b)+_0x9eda50);}const _0x4f3e24=await withSpinner(_0x51a530(0x18a),()=>_0x5a9380[_0x51a530(0x144)][_0x51a530(0x164)](_0x1eb0b8,{'time':_0x248f43,'num':_0x9eda50}),{'verbose':_0x3c0b3e['verbose']}),_0x4af364=_0x4f3e24[_0x51a530(0x163)][_0x51a530(0x173)];console['error'](_0x51a530(0x13c)+_0x4af364[_0x51a530(0x1a8)]+_0x51a530(0x182)+(_0x4af364[_0x51a530(0x1a8)]!==0x1?'s':'')+'\x20created');for(const _0x5d6869 of _0x4af364){console[_0x51a530(0x154)](_0x51a530(0x147)+_0x5d6869[_0x51a530(0x17d)]);}return await handleSDKOutput(_0x4af364,_0x3c0b3e),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0xea0ac0(0x13d)]=a26_0xea0ac0(0x151);[a26_0xea0ac0(0x124)]=a26_0xea0ac0(0x15c);[a26_0xea0ac0(0x184)](_0x39ed71){const _0x3d40de=a26_0xea0ac0,_0x14960a=_0x39ed71[_0x3d40de(0x19a)][0x0];if(!_0x14960a)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a26_0xea0ac0(0x18b)](_0x4ddd19){const _0x5c8ac8=a26_0xea0ac0,{options:_0xfef55a,args:_0xff7cf8,tdx:_0x3d3692}=_0x4ddd19,_0x2eabce=_0xff7cf8[0x0],_0x85125a=_0xfef55a,_0x1a60b5=_0x85125a[_0x5c8ac8(0x1a3)]!==undefined?Number(_0x85125a[_0x5c8ac8(0x1a3)]):undefined,_0x437362=_0x85125a['to']!==undefined?Number(_0x85125a['to']):undefined,_0x4b014d=await withSpinner(_0x5c8ac8(0x19f),()=>_0x3d3692['schedules'][_0x5c8ac8(0x17a)](_0x2eabce,{'from':_0x1a60b5,'to':_0x437362}),{'verbose':_0xfef55a[_0x5c8ac8(0x189)]}),_0xb88120=_0x4b014d['data'];console[_0x5c8ac8(0x154)](_0x5c8ac8(0x14e)+_0xb88120[_0x5c8ac8(0x168)]+_0x5c8ac8(0x131)+(_0xb88120[_0x5c8ac8(0x168)]!==0x1?'s':'')+_0x5c8ac8(0x123)+_0xb88120[_0x5c8ac8(0x1a3)]+'-'+_0xb88120['to']+')');const _0x529071=_0xb88120[_0x5c8ac8(0x17a)][_0x5c8ac8(0x128)](_0x24ff46=>({'job_id':_0x24ff46[_0x5c8ac8(0x17d)],'type':_0x24ff46['type'],'status':_0x24ff46[_0x5c8ac8(0x156)],'scheduled_at':_0x24ff46[_0x5c8ac8(0x150)],'created_at':_0x24ff46[_0x5c8ac8(0x14d)],'start_at':_0x24ff46['start_at'],'end_at':_0x24ff46[_0x5c8ac8(0x149)]}));return await handleSDKOutput(_0x529071,_0xfef55a),0x0;}}
@@ -1 +1 @@
1
- const a27_0x41eeed=a27_0x2981;(function(_0x567675,_0x383d79){const _0x58e37a=a27_0x2981,_0xd735e7=_0x567675();while(!![]){try{const _0x5732f9=-parseInt(_0x58e37a(0x74))/0x1+parseInt(_0x58e37a(0x8a))/0x2+-parseInt(_0x58e37a(0xdc))/0x3+parseInt(_0x58e37a(0x94))/0x4+-parseInt(_0x58e37a(0x72))/0x5+-parseInt(_0x58e37a(0x82))/0x6*(-parseInt(_0x58e37a(0xa0))/0x7)+parseInt(_0x58e37a(0x7d))/0x8*(parseInt(_0x58e37a(0x7a))/0x9);if(_0x5732f9===_0x383d79)break;else _0xd735e7['push'](_0xd735e7['shift']());}catch(_0x14c469){_0xd735e7['push'](_0xd735e7['shift']());}}}(a27_0x453a,0x98f9c));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_0x4d374c from'chalk';async function resolveSegmentTarget(_0xc468da,_0x69e26e,_0xe40d38){const _0x1983f0=a27_0x2981;if(isYamlFilePath(_0xc468da))try{const _0x400c3d=await resolveYamlFilePath(_0xc468da);return _0xe40d38&&(console[_0x1983f0(0xb1)](_0x1983f0(0xf4)+_0xc468da),console[_0x1983f0(0xb1)](_0x1983f0(0xad)+_0x400c3d[_0x1983f0(0xef)]),console[_0x1983f0(0xb1)](_0x1983f0(0x80)+_0x400c3d[_0x1983f0(0xe3)]),console[_0x1983f0(0xb1)](_0x1983f0(0x8d)+(_0x400c3d[_0x1983f0(0xf6)]||_0x1983f0(0x87))),console[_0x1983f0(0xb1)](_0x1983f0(0x6a)+_0x400c3d['fullPath'])),_0x400c3d['fullPath'];}catch(_0x3b39ea){throw new SDKError(ErrorCode[_0x1983f0(0x90)],_0x1983f0(0xda)+_0x3b39ea[_0x1983f0(0x97)]);}if(!_0x69e26e)throw new SDKError(ErrorCode[_0x1983f0(0x90)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x69e26e+'/'+_0xc468da;}function a27_0x2981(_0x233369,_0x2baed2){_0x233369=_0x233369-0x69;const _0x453a7b=a27_0x453a();let _0x29811b=_0x453a7b[_0x233369];return _0x29811b;}export class SegmentDescribeCommand extends BaseCommand{['name']=a27_0x41eeed(0x7f);[a27_0x41eeed(0xc9)]=a27_0x41eeed(0x78);async[a27_0x41eeed(0xe0)](_0x2dc1d5){const _0x54b928=a27_0x41eeed,{options:_0x6e79c9,args:_0x35ee87,tdx:_0x5a0906}=_0x2dc1d5,_0x19a7de=_0x35ee87[0x0],_0x2ede9e=!_0x19a7de&&!!_0x6e79c9['parentSegment'],_0x484575=_0x19a7de||_0x6e79c9[_0x54b928(0xef)];if(!_0x484575)return console['error'](_0x54b928(0xd3)),console[_0x54b928(0xb1)](_0x54b928(0x96)),console['error'](_0x54b928(0xfd)),console[_0x54b928(0xb1)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x54b928(0xb1)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x54b928(0xb1)](_0x54b928(0xd8)),console[_0x54b928(0xb1)](_0x54b928(0xc6)),0x1;try{const _0x183864=_0x6e79c9['segmentPath'];let _0x45424e=_0x484575;!_0x2ede9e&&_0x183864&&!_0x484575[_0x54b928(0xbb)]('/')&&(_0x45424e=_0x183864+'/'+_0x484575,_0x6e79c9['verbose']&&console[_0x54b928(0xb1)](_0x54b928(0xba)+_0x45424e));const _0x541c2c=await withSpinner(_0x54b928(0xec)+_0x45424e+_0x54b928(0xc5),()=>_0x5a0906['segment'][_0x54b928(0xd6)](_0x45424e),{'verbose':_0x6e79c9[_0x54b928(0x7e)]}),_0x30834a=_0x541c2c[_0x54b928(0xe6)];_0x6e79c9[_0x54b928(0x7e)]&&(console['error'](_0x54b928(0xaa)+_0x30834a[_0x54b928(0xc0)]),console[_0x54b928(0xb1)](_0x54b928(0x98)+_0x30834a[_0x54b928(0xa1)]),_0x30834a[_0x54b928(0xfb)]&&console['error'](_0x54b928(0x6b)+_0x30834a[_0x54b928(0xfb)]),_0x30834a[_0x54b928(0xdd)]&&console['error'](_0x54b928(0x93)+_0x30834a['segmentId']));if(_0x30834a['type']===_0x54b928(0x89)){const _0x2b7b17=await withSpinner(_0x54b928(0xea),()=>_0x5a0906[_0x54b928(0xd0)][_0x54b928(0xcd)](_0x30834a[_0x54b928(0xa1)]),{'verbose':_0x6e79c9[_0x54b928(0x7e)]});await handleSingleObjectOutput(_0x2b7b17[_0x54b928(0xe6)],_0x6e79c9);}else{if(_0x30834a[_0x54b928(0xc0)]===_0x54b928(0x71)){if(!_0x30834a[_0x54b928(0xfb)])throw new SDKError(ErrorCode[_0x54b928(0xd7)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4e9682=await withSpinner('Fetching\x20folder\x20details...',()=>_0x5a0906[_0x54b928(0xd0)][_0x54b928(0x9f)](_0x30834a[_0x54b928(0xfb)]),{'verbose':_0x6e79c9[_0x54b928(0x7e)]});await handleSingleObjectOutput(_0x4e9682[_0x54b928(0xe6)],_0x6e79c9);}else{if(_0x30834a[_0x54b928(0xc0)]===_0x54b928(0xd0)){if(!_0x30834a[_0x54b928(0xdd)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x54b928(0x79));const _0x5dff89=await withSpinner('Fetching\x20segment\x20details...',()=>_0x5a0906[_0x54b928(0xd0)]['getSegment'](_0x30834a[_0x54b928(0xa1)],_0x30834a['segmentId']),{'verbose':_0x6e79c9['verbose']});await handleSingleObjectOutput(_0x5dff89[_0x54b928(0xe6)],_0x6e79c9);}}}return 0x0;}catch(_0x91745){if(_0x91745 instanceof SDKError)return console[_0x54b928(0xb1)](_0x54b928(0xe7)+_0x91745[_0x54b928(0x97)]),_0x91745['cause']&&console[_0x54b928(0xb1)]('\x20\x20Cause:\x20'+_0x91745[_0x54b928(0xbf)]),0x1;throw _0x91745;}}}function a27_0x453a(){const _0xf7d547=['972UrKQaR','βœ”\x20Found\x20','/e/','Error:\x20Folder\x20reference\x20is\x20required','Usage:\x20tdx\x20sg\x20show\x20<name>','(root)','Executing\x20segment\x20query...','parent','2042816jkQzOY','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20parent\x20folder\x20\x27','\x20\x20Folder\x20path:\x20','replace','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','INVALID_ARGUMENT','Resolving\x20\x27','βœ”\x20Query\x20completed:\x20Processed\x20','Segment\x20ID:\x20','1901628PngITf','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Usage:\x20tdx\x20segment\x20describe\x20<path>','message','Parent\x20ID:\x20','cyan','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20view\x20-w','Folder\x20name:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','url','getFolder','20097tfmscH','parentId','information_schema','segment:view','parentFolder','setJobId','Create\x20segment\x20folder\x20for\x20organization','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','limit','\x20\x20Parent\x20segment:\x20','query','Use:\x20tdx\x20ps\x20view','segment:sql','error','\x20\x20Cause:\x20','resolveFolderId','in\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','getSegment','Parent\x20name:\x20','segment:desc','Resolved\x20relative\x20path\x20to:\x20','includes','log','βœ–\x20Query\x20failed\x20[','elapsedTimeMillis','cause','type','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Resolved\x20folder\x20ID:\x20','getSegmentSQL','\x27...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Fetching\x20segment\x20details...','description','Target\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Options:','getParent','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','length','segment','Usage:\x20tdx\x20sg\x20sql\x20<name>','SQL\x20query:\x0a','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','listFolders','resolvePathToResource','SEGMENT_FOLDER_NOT_FOUND','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','SEGMENT_NOT_FOUND','1038840XyjgAe','segmentId','Use:\x20tdx\x20ps\x20sql','Listing\x20folders\x20for\x20parent\x20\x27','execute','/app/ps/','Use:\x20tdx\x20ps\x20show','segmentName','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','jobId','data','Error:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolving\x20parent\x20segment\x20\x27','Fetching\x20parent\x20segment\x20details...','trim','Resolving\x20path\x20\x27','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','test','parentSegment','Show\x20segment\x20folder\x20details','jsonl','web','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolved\x20YAML\x20file:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','folderPath','\x20rows\x20','Resolved\x20parent\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Get\x20SQL\x20query\x20for\x20child\x20segment','folderId','Show\x20child\x20segment\x20schema\x20(column\x20types)','Examples:','createFolder','Site:\x20','format','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Full\x20path:\x20','Folder\x20ID:\x20','Parent\x20segment:\x20','json','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','stats','site','folder','1057415pDvFlx','Show\x20folder\x20or\x20child\x20segment\x20details','1167585YcXIGl','toLocaleString','SELECT\x20*\x20FROM\x20(\x0a','name','Show\x20segment\x20or\x20folder\x20details','Segment\x20ID\x20missing\x20from\x20resolved\x20path','63PSvccv','resolveParentId','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','445736lQzvzK','verbose','segment:describe','\x20\x20Segment\x20name:\x20','Fetching\x20folder\x20details...'];a27_0x453a=function(){return _0xf7d547;};return a27_0x453a();}export class SegmentShowCommand extends BaseCommand{[a27_0x41eeed(0x77)]='segment:show';[a27_0x41eeed(0xc9)]=a27_0x41eeed(0x9d);async['execute'](_0x515c23){const _0x272fd3=a27_0x41eeed,{options:_0xcf659b,args:_0x1644f9,tdx:_0x84f82c}=_0x515c23,_0x5c0025=_0x1644f9[0x0];if(!_0x5c0025)return console[_0x272fd3(0xb1)](_0x272fd3(0xb5)),console[_0x272fd3(0xb1)](_0x272fd3(0x86)),console[_0x272fd3(0xb1)](_0x272fd3(0xa7)),console[_0x272fd3(0xb1)]('Examples:'),console[_0x272fd3(0xb1)](_0x272fd3(0x8f)),console[_0x272fd3(0xb1)](_0x272fd3(0x9a)),0x1;try{const _0x44ac75=_0xcf659b[_0x272fd3(0xef)],_0x3ac1ef=await resolveSegmentTarget(_0x5c0025,_0x44ac75,_0xcf659b[_0x272fd3(0x7e)]);_0xcf659b[_0x272fd3(0x7e)]&&console[_0x272fd3(0xb1)](_0x272fd3(0xca)+_0x3ac1ef);const _0x5797b6=await withSpinner('Resolving\x20\x27'+_0x5c0025+_0x272fd3(0xc5),()=>_0x84f82c[_0x272fd3(0xd0)]['resolvePathToResource'](_0x3ac1ef),{'verbose':_0xcf659b[_0x272fd3(0x7e)]}),_0x1dbd2c=_0x5797b6[_0x272fd3(0xe6)];_0xcf659b[_0x272fd3(0x7e)]&&(console[_0x272fd3(0xb1)]('Resolved\x20type:\x20'+_0x1dbd2c['type']),console['error']('Parent\x20ID:\x20'+_0x1dbd2c[_0x272fd3(0xa1)]));if(_0x1dbd2c[_0x272fd3(0xc0)]==='folder')return console['error'](_0x272fd3(0x95)),console[_0x272fd3(0xb1)](_0x272fd3(0x7c)),0x1;if(_0x1dbd2c[_0x272fd3(0xc0)]===_0x272fd3(0x89))return console[_0x272fd3(0xb1)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x272fd3(0xb1)](_0x272fd3(0xe2)),0x1;if(!_0x1dbd2c[_0x272fd3(0xdd)])throw new SDKError(ErrorCode[_0x272fd3(0xdb)],_0x272fd3(0x79));const _0x5c0f7d=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x84f82c[_0x272fd3(0xd0)]['getSegmentSQL'](_0x1dbd2c[_0x272fd3(0xa1)],_0x1dbd2c[_0x272fd3(0xdd)]),{'verbose':_0xcf659b['verbose']});let _0x512270=_0x5c0f7d[_0x272fd3(0xe6)];const _0x186c32=resolveLimit(_0xcf659b[_0x272fd3(0xac)],DEFAULT_DISPLAY_LIMIT),_0x3fef8a=/\bLIMIT\s+\d+/i[_0x272fd3(0xee)](_0x512270);!_0x3fef8a&&(_0x512270=_0x512270[_0x272fd3(0xeb)]()[_0x272fd3(0x8e)](/;+$/,''),_0x512270=_0x272fd3(0x76)+_0x512270+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x186c32);_0xcf659b[_0x272fd3(0x7e)]&&console[_0x272fd3(0xb1)](_0x272fd3(0xd2)+_0x512270);const _0xcb52f3=await withProgressSpinner(_0x272fd3(0x88),async _0x14b263=>{const _0x210823=_0x272fd3,_0x5caf78=await _0x84f82c[_0x210823(0xae)][_0x210823(0xe0)](_0x512270,{'catalog':'td','schema':_0x210823(0xa2),'onJobId':_0x219907=>{const _0x22343f=_0x210823;_0x14b263[_0x22343f(0xa5)](_0x219907);}});return _0x5caf78;},{'verbose':_0xcf659b[_0x272fd3(0x7e)]}),_0x55b346=_0xcb52f3[_0x272fd3(0xe6)],_0x2b932a=_0x55b346[_0x272fd3(0xe5)]?'\x20[Job\x20ID:\x20'+_0x55b346[_0x272fd3(0xe5)]+']':'';return console['error'](_0x272fd3(0x92)+_0x55b346[_0x272fd3(0x6f)]['processedRows'][_0x272fd3(0x75)]()+_0x272fd3(0xf7)+(_0x272fd3(0xb4)+formatElapsed(_0x55b346[_0x272fd3(0x6f)][_0x272fd3(0xbe)])+_0x2b932a)),await handleQueryOutput(_0x55b346,_0xcf659b),0x0;}catch(_0x386a02){if(_0x386a02 instanceof SDKError)return console['error'](_0x272fd3(0xbd)+_0x386a02['code']+']'),console[_0x272fd3(0xb1)]('\x0a'+_0x386a02[_0x272fd3(0x97)]),0x1;throw _0x386a02;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x41eeed(0x77)]='segment:folder:list';['description']=a27_0x41eeed(0xe8);async[a27_0x41eeed(0xe0)](_0x17dd9b){const _0x5bd477=a27_0x41eeed,{options:_0x1b726b,args:_0x1825d9,tdx:_0x2673d8}=_0x17dd9b;if(_0x1825d9[_0x5bd477(0xcf)]===0x0)return console[_0x5bd477(0xb1)](_0x5bd477(0xf5)),console[_0x5bd477(0xb1)](_0x5bd477(0xb6)),0x1;const _0x3903d6=_0x1825d9[0x0];try{_0x1b726b[_0x5bd477(0x7e)]&&(console[_0x5bd477(0xb1)](_0x5bd477(0xff)+_0x1b726b[_0x5bd477(0x70)]),console[_0x5bd477(0xb1)]('Parent\x20name:\x20'+_0x3903d6));const _0x136287=await withSpinner(_0x5bd477(0xe9)+_0x3903d6+_0x5bd477(0xc5),()=>_0x2673d8[_0x5bd477(0xd0)][_0x5bd477(0x7b)](_0x3903d6),{'verbose':_0x1b726b[_0x5bd477(0x7e)]}),_0x312eee=_0x136287[_0x5bd477(0xe6)];_0x1b726b[_0x5bd477(0x7e)]&&console[_0x5bd477(0xb1)]('Resolved\x20parent\x20ID:\x20'+_0x312eee);const _0x10a4ca=await withSpinner(_0x5bd477(0xdf)+_0x3903d6+_0x5bd477(0xc5),()=>_0x2673d8[_0x5bd477(0xd0)][_0x5bd477(0xd5)](_0x312eee),{'verbose':_0x1b726b[_0x5bd477(0x7e)]}),_0xe712b1=_0x10a4ca['data'];return console[_0x5bd477(0xb1)](_0x5bd477(0x83)+_0xe712b1['length']+'\x20folder'+(_0xe712b1[_0x5bd477(0xcf)]!==0x1?'s':'')),await handleSDKOutput(_0xe712b1,_0x1b726b),0x0;}catch(_0x415f1b){if(_0x415f1b instanceof SDKError)return console[_0x5bd477(0xb1)]('Error:\x20'+_0x415f1b['message']),_0x415f1b['cause']&&console[_0x5bd477(0xb1)](_0x5bd477(0xb2)+_0x415f1b[_0x5bd477(0xbf)]),0x1;throw _0x415f1b;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a27_0x41eeed(0xc9)]=a27_0x41eeed(0xf0);async[a27_0x41eeed(0xe0)](_0x294d4c){const _0x55005e=a27_0x41eeed,{options:_0x4312e9,args:_0x198d87,tdx:_0xef2746}=_0x294d4c;if(_0x198d87['length']===0x0)return console[_0x55005e(0xb1)](_0x55005e(0x85)),console[_0x55005e(0xb1)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x29d8c8,childId:_0x2d8268}=parseSegmentRef(_0x198d87[0x0]);_0x4312e9[_0x55005e(0x7e)]&&(console['error'](_0x55005e(0xff)+_0x4312e9[_0x55005e(0x70)]),console[_0x55005e(0xb1)](_0x55005e(0xb8)+_0x29d8c8),_0x2d8268&&console[_0x55005e(0xb1)]('Folder\x20name:\x20'+_0x2d8268));if(!_0x2d8268)return console[_0x55005e(0xb1)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x11c1b6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x29d8c8+'\x27...',()=>_0xef2746[_0x55005e(0xd0)][_0x55005e(0x7b)](_0x29d8c8),{'verbose':_0x4312e9[_0x55005e(0x7e)]}),_0x588e53=_0x11c1b6[_0x55005e(0xe6)];_0x4312e9[_0x55005e(0x7e)]&&console[_0x55005e(0xb1)]('Resolved\x20parent\x20ID:\x20'+_0x588e53);const _0x4b5f55=await withSpinner('Resolving\x20folder\x20\x27'+_0x2d8268+_0x55005e(0xc5),()=>_0xef2746[_0x55005e(0xd0)][_0x55005e(0xb3)](_0x588e53,_0x2d8268),{'verbose':_0x4312e9['verbose']}),_0x21b3ad=_0x4b5f55[_0x55005e(0xe6)];_0x4312e9[_0x55005e(0x7e)]&&console[_0x55005e(0xb1)](_0x55005e(0xc3)+_0x21b3ad);const _0x5ab010=await withSpinner('Fetching\x20folder\x20\x27'+_0x2d8268+_0x55005e(0xc5),()=>_0xef2746[_0x55005e(0xd0)][_0x55005e(0x9f)](_0x21b3ad),{'verbose':_0x4312e9[_0x55005e(0x7e)]});return await handleSDKOutput([_0x5ab010[_0x55005e(0xe6)]],_0x4312e9),0x0;}catch(_0x46d16f){if(_0x46d16f instanceof SDKError)return console[_0x55005e(0xb1)](_0x55005e(0xe7)+_0x46d16f[_0x55005e(0x97)]),_0x46d16f[_0x55005e(0xbf)]&&console['error'](_0x55005e(0xb2)+_0x46d16f['cause']),0x1;throw _0x46d16f;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x41eeed(0x77)]=a27_0x41eeed(0xb0);[a27_0x41eeed(0xc9)]=a27_0x41eeed(0xfa);async[a27_0x41eeed(0xe0)](_0x2f1690){const _0x4f9ab2=a27_0x41eeed,{options:_0x4cacc1,args:_0x1a5d2e,tdx:_0x15c087}=_0x2f1690,_0x5166c8=_0x1a5d2e[0x0];if(!_0x5166c8)return console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xb5)),console['error'](_0x4f9ab2(0xd1)),console[_0x4f9ab2(0xb1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xfd)),console[_0x4f9ab2(0xb1)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xd4)),0x1;try{const _0x173eea=_0x4cacc1['parentSegment'],_0x332efa=await resolveSegmentTarget(_0x5166c8,_0x173eea,_0x4cacc1[_0x4f9ab2(0x7e)]);_0x4cacc1[_0x4f9ab2(0x7e)]&&console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xca)+_0x332efa);const _0x3fd5f5=await withSpinner('Resolving\x20\x27'+_0x5166c8+'\x27...',()=>_0x15c087[_0x4f9ab2(0xd0)][_0x4f9ab2(0xd6)](_0x332efa),{'verbose':_0x4cacc1[_0x4f9ab2(0x7e)]}),_0xd5e708=_0x3fd5f5[_0x4f9ab2(0xe6)];_0x4cacc1[_0x4f9ab2(0x7e)]&&(console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xaa)+_0xd5e708['type']),console[_0x4f9ab2(0xb1)]('Parent\x20ID:\x20'+_0xd5e708[_0x4f9ab2(0xa1)]));if(_0xd5e708[_0x4f9ab2(0xc0)]==='folder')return console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xf3)),console[_0x4f9ab2(0xb1)](_0x4f9ab2(0x69)),0x1;if(_0xd5e708[_0x4f9ab2(0xc0)]===_0x4f9ab2(0x89))return console[_0x4f9ab2(0xb1)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xde)),0x1;if(!_0xd5e708['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4f9ab2(0x79));const _0x64ecb4=await withSpinner(_0x4f9ab2(0xf9),()=>_0x15c087[_0x4f9ab2(0xd0)][_0x4f9ab2(0xc4)](_0xd5e708[_0x4f9ab2(0xa1)],_0xd5e708[_0x4f9ab2(0xdd)]),{'verbose':_0x4cacc1['verbose']}),_0x1a4de3=_0x64ecb4[_0x4f9ab2(0xe6)];return _0x4cacc1[_0x4f9ab2(0x100)]===_0x4f9ab2(0x6d)||_0x4cacc1[_0x4f9ab2(0x100)]===_0x4f9ab2(0xf1)?await handleSDKOutput([{'sql':_0x1a4de3}],_0x4cacc1):console[_0x4f9ab2(0xbc)](_0x1a4de3),0x0;}catch(_0x5c2df3){if(_0x5c2df3 instanceof SDKError)return console['error'](_0x4f9ab2(0xe7)+_0x5c2df3[_0x4f9ab2(0x97)]),_0x5c2df3[_0x4f9ab2(0xbf)]&&console['error']('\x20\x20Cause:\x20'+_0x5c2df3[_0x4f9ab2(0xbf)]),0x1;throw _0x5c2df3;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x41eeed(0x77)]='segment:folder:create';[a27_0x41eeed(0xc9)]=a27_0x41eeed(0xa6);async[a27_0x41eeed(0xe0)](_0x3460a8){const _0x3683c6=a27_0x41eeed,{options:_0x370cd3,args:_0xb61d19,tdx:_0x5149ae}=_0x3460a8,_0x2607f3=_0x370cd3;if(_0xb61d19[_0x3683c6(0xcf)]<0x2)return console[_0x3683c6(0xb1)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x3683c6(0xb1)](_0x3683c6(0xc7)),0x1;const _0x53cef8=_0xb61d19[0x0],_0x364653=_0xb61d19[0x1];_0x2607f3['verbose']&&(console[_0x3683c6(0xb1)](_0x3683c6(0xff)+_0x2607f3[_0x3683c6(0x70)]),console['error'](_0x3683c6(0x6c)+_0x53cef8),console[_0x3683c6(0xb1)](_0x3683c6(0x9c)+_0x364653));let _0x23abe5;if(_0x2607f3['parentFolder']){const _0xe9c3e8=_0x2607f3[_0x3683c6(0xa4)],_0x28aa2f=await withSpinner(_0x3683c6(0xe9)+_0x53cef8+_0x3683c6(0xc5),()=>_0x5149ae[_0x3683c6(0xd0)][_0x3683c6(0x7b)](_0x53cef8),{'verbose':_0x2607f3[_0x3683c6(0x7e)]}),_0x1a389c=_0x28aa2f[_0x3683c6(0xe6)],_0x5b2b24=await withSpinner(_0x3683c6(0x8c)+_0xe9c3e8+_0x3683c6(0xc5),()=>_0x5149ae[_0x3683c6(0xd0)]['resolveFolderId'](_0x1a389c,_0xe9c3e8),{'verbose':_0x2607f3[_0x3683c6(0x7e)]});_0x23abe5=_0x5b2b24[_0x3683c6(0xe6)],_0x2607f3[_0x3683c6(0x7e)]&&console['error'](_0x3683c6(0xf8)+_0x23abe5);}const _0x2e17db={'name':_0x364653,'description':_0x2607f3[_0x3683c6(0xc9)],'parentFolderId':_0x23abe5},_0x305e07=await withSpinner('Creating\x20folder\x20\x27'+_0x364653+_0x3683c6(0xc5),()=>_0x5149ae[_0x3683c6(0xd0)][_0x3683c6(0xfe)](_0x53cef8,_0x2e17db),{'verbose':_0x2607f3[_0x3683c6(0x7e)]}),_0x5140fd=_0x305e07[_0x3683c6(0xe6)];return console['error']('βœ”\x20Created\x20folder\x20\x27'+_0x5140fd['name']+'\x27\x20with\x20ID:\x20'+_0x5140fd['id']),await handleSDKOutput([_0x5140fd],_0x2607f3),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a27_0x41eeed(0xa3);[a27_0x41eeed(0xc9)]=a27_0x41eeed(0x73);async[a27_0x41eeed(0xe0)](_0x3e9e03){const _0x2bc655=a27_0x41eeed,{options:_0x40fbe8,args:_0x557fbd,tdx:_0x2574bb}=_0x3e9e03,_0x43c6e1=_0x557fbd[0x0];if(!_0x43c6e1)return console[_0x2bc655(0xb1)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x2bc655(0x6e)),console[_0x2bc655(0xb1)](_0x2bc655(0xa9)),console[_0x2bc655(0xb1)](_0x2bc655(0xcc)),console[_0x2bc655(0xb1)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x2bc655(0xb1)](_0x2bc655(0xfd)),console[_0x2bc655(0xb1)](_0x2bc655(0xe4)),console[_0x2bc655(0xb1)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x2bc655(0xcb)),console[_0x2bc655(0xb1)](_0x2bc655(0xab)),0x1;try{const _0x44d341=_0x40fbe8['parentSegment'],_0x795f10=await resolveSegmentTarget(_0x43c6e1,_0x44d341,_0x40fbe8[_0x2bc655(0x7e)]);_0x40fbe8['verbose']&&console[_0x2bc655(0xb1)](_0x2bc655(0xca)+_0x795f10);const _0x21fe10=await withSpinner(_0x2bc655(0x91)+_0x43c6e1+_0x2bc655(0xc5),()=>_0x2574bb[_0x2bc655(0xd0)][_0x2bc655(0xd6)](_0x795f10),{'verbose':_0x40fbe8[_0x2bc655(0x7e)]}),_0x577b70=_0x21fe10['data'];_0x40fbe8['verbose']&&(console[_0x2bc655(0xb1)](_0x2bc655(0xaa)+_0x577b70[_0x2bc655(0xc0)]),console[_0x2bc655(0xb1)](_0x2bc655(0x98)+_0x577b70['parentId']),_0x577b70[_0x2bc655(0xfb)]&&console[_0x2bc655(0xb1)](_0x2bc655(0x6b)+_0x577b70[_0x2bc655(0xfb)]),_0x577b70[_0x2bc655(0xdd)]&&console[_0x2bc655(0xb1)](_0x2bc655(0x93)+_0x577b70[_0x2bc655(0xdd)]));if(_0x40fbe8[_0x2bc655(0xf2)]){if(_0x577b70[_0x2bc655(0xc0)]===_0x2bc655(0x71))return console[_0x2bc655(0xb1)](_0x2bc655(0xce)),0x1;if(_0x577b70[_0x2bc655(0xc0)]===_0x2bc655(0x89))return console[_0x2bc655(0xb1)](_0x2bc655(0x8b)),console[_0x2bc655(0xb1)](_0x2bc655(0x9b)),0x1;if(!_0x577b70[_0x2bc655(0xdd)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2bc655(0x79));const _0x3b6a06=getConsoleNextUrl(_0x40fbe8[_0x2bc655(0x70)],_0x2bc655(0xe1)+_0x577b70[_0x2bc655(0xa1)]+_0x2bc655(0x84)+_0x577b70[_0x2bc655(0xdd)]);return console[_0x2bc655(0xb1)](a27_0x4d374c['green']('βœ”')+'\x20Opening\x20'+a27_0x4d374c[_0x2bc655(0x99)](_0x3b6a06)),openBrowser(_0x3b6a06),0x0;}if(_0x577b70['type']===_0x2bc655(0x71)){if(!_0x577b70[_0x2bc655(0xfb)])throw new SDKError(ErrorCode[_0x2bc655(0xd7)],_0x2bc655(0xd9));const _0x1b1cd9=await withSpinner(_0x2bc655(0x81),()=>_0x2574bb[_0x2bc655(0xd0)][_0x2bc655(0x9f)](_0x577b70[_0x2bc655(0xfb)]),{'verbose':_0x40fbe8[_0x2bc655(0x7e)]});await handleSingleObjectOutput(_0x1b1cd9[_0x2bc655(0xe6)],_0x40fbe8);}else{if(_0x577b70[_0x2bc655(0xc0)]===_0x2bc655(0xd0)){if(!_0x577b70[_0x2bc655(0xdd)])throw new SDKError(ErrorCode[_0x2bc655(0xdb)],_0x2bc655(0x79));const _0x33491d=await withSpinner(_0x2bc655(0xc8),()=>_0x2574bb[_0x2bc655(0xd0)][_0x2bc655(0xb7)](_0x577b70[_0x2bc655(0xa1)],_0x577b70[_0x2bc655(0xdd)]),{'verbose':_0x40fbe8[_0x2bc655(0x7e)]}),_0x254e59=getConsoleNextUrl(_0x40fbe8['site'],_0x2bc655(0xe1)+_0x577b70[_0x2bc655(0xa1)]+_0x2bc655(0x84)+_0x577b70[_0x2bc655(0xdd)]),_0x33848c=_0x33491d['data'];_0x33848c[_0x2bc655(0x9e)]=_0x254e59,await handleSingleObjectOutput(_0x33848c,_0x40fbe8);}else return console[_0x2bc655(0xb1)](_0x2bc655(0xc1)),console[_0x2bc655(0xb1)](_0x2bc655(0xaf)),0x1;}return 0x0;}catch(_0x578fd6){if(_0x578fd6 instanceof SDKError)return console[_0x2bc655(0xb1)](_0x2bc655(0xe7)+_0x578fd6[_0x2bc655(0x97)]),_0x578fd6[_0x2bc655(0xbf)]&&console[_0x2bc655(0xb1)](_0x2bc655(0xb2)+_0x578fd6['cause']),0x1;throw _0x578fd6;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a27_0x41eeed(0xb9);[a27_0x41eeed(0xc9)]=a27_0x41eeed(0xfc);async[a27_0x41eeed(0xe0)](_0x35814a){const _0x120e10=a27_0x41eeed,{options:_0x286022,args:_0x4cd975,tdx:_0x28749}=_0x35814a,_0x45be47=_0x4cd975[0x0];if(!_0x45be47)return console[_0x120e10(0xb1)](_0x120e10(0xb5)),console[_0x120e10(0xb1)](_0x120e10(0xa8)),console[_0x120e10(0xb1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x120e10(0xb1)](_0x120e10(0xfd)),console[_0x120e10(0xb1)](_0x120e10(0xc2)),console[_0x120e10(0xb1)](_0x120e10(0xed)),0x1;try{const _0x5530d4=_0x286022[_0x120e10(0xef)],_0x38e770=await resolveSegmentTarget(_0x45be47,_0x5530d4,_0x286022[_0x120e10(0x7e)]);_0x286022[_0x120e10(0x7e)]&&console[_0x120e10(0xb1)](_0x120e10(0xca)+_0x38e770);const _0x27f0bb=await withSpinner('Resolving\x20\x27'+_0x45be47+_0x120e10(0xc5),()=>_0x28749[_0x120e10(0xd0)][_0x120e10(0xd6)](_0x38e770),{'verbose':_0x286022[_0x120e10(0x7e)]}),_0x544a1c=_0x27f0bb[_0x120e10(0xe6)];_0x286022[_0x120e10(0x7e)]&&(console[_0x120e10(0xb1)]('Resolved\x20type:\x20'+_0x544a1c[_0x120e10(0xc0)]),console['error'](_0x120e10(0x98)+_0x544a1c[_0x120e10(0xa1)]));if(_0x544a1c[_0x120e10(0xc0)]===_0x120e10(0x71))return console[_0x120e10(0xb1)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x120e10(0xb1)](_0x120e10(0x69)),0x1;if(_0x544a1c[_0x120e10(0xc0)]===_0x120e10(0x89))return console[_0x120e10(0xb1)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x120e10(0xb1)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x544a1c[_0x120e10(0xdd)])throw new SDKError(ErrorCode[_0x120e10(0xdb)],_0x120e10(0x79));const _0x367c9c=await withSpinner(_0x120e10(0xf9),()=>_0x28749[_0x120e10(0xd0)][_0x120e10(0xc4)](_0x544a1c['parentId'],_0x544a1c[_0x120e10(0xdd)]),{'verbose':_0x286022[_0x120e10(0x7e)]}),_0x30e6d7=_0x367c9c[_0x120e10(0xe6)],_0x2bbab8=await executeSchemaQuery(_0x30e6d7,_0x28749,_0x286022);return await handleQueryOutput(_0x2bbab8,_0x286022),0x0;}catch(_0x420a83){if(_0x420a83 instanceof SDKError)return console['error']('Error:\x20'+_0x420a83['message']),_0x420a83[_0x120e10(0xbf)]&&console[_0x120e10(0xb1)](_0x120e10(0xb2)+_0x420a83[_0x120e10(0xbf)]),0x1;throw _0x420a83;}}}
1
+ const a27_0x1ea2db=a27_0x35d2;(function(_0x34cc29,_0x43f9e4){const _0x5348cf=a27_0x35d2,_0x16945e=_0x34cc29();while(!![]){try{const _0x2c0052=parseInt(_0x5348cf(0x1e0))/0x1*(-parseInt(_0x5348cf(0x274))/0x2)+-parseInt(_0x5348cf(0x268))/0x3+-parseInt(_0x5348cf(0x263))/0x4+-parseInt(_0x5348cf(0x235))/0x5*(parseInt(_0x5348cf(0x222))/0x6)+-parseInt(_0x5348cf(0x210))/0x7+parseInt(_0x5348cf(0x219))/0x8+parseInt(_0x5348cf(0x24e))/0x9;if(_0x2c0052===_0x43f9e4)break;else _0x16945e['push'](_0x16945e['shift']());}catch(_0x365394){_0x16945e['push'](_0x16945e['shift']());}}}(a27_0x1c77,0x2cfc9));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';function a27_0x1c77(){const _0x3950bd=['Use:\x20tdx\x20ps\x20view','segment:desc','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','elapsedTimeMillis','2KIBntP','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x27...','parentFolder','14159GmWnxV','Resolved\x20type:\x20','getParent','segment:folder:show','Use:\x20tdx\x20ps\x20view\x20-w','data','\x20Opening\x20','\x20\x20Folder\x20path:\x20','Use:\x20tdx\x20ps\x20desc','parentId','Creating\x20folder\x20\x27','βœ–\x20Query\x20failed\x20[','βœ”\x20Found\x20','information_schema','\x20\x20Cause:\x20','Parent\x20ID:\x20','SEGMENT_NOT_FOUND','in\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20path\x20\x27','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Folder\x20ID:\x20','Resolved\x20parent\x20folder\x20ID:\x20','Resolved\x20parent\x20ID:\x20','segmentPath','\x20\x20Full\x20path:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','parentSegment','format','cause','Target\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x27\x20with\x20ID:\x20','jobId','Resolving\x20parent\x20segment\x20\x27','toLocaleString','INVALID_ARGUMENT','Use:\x20tdx\x20ps\x20show','Fetching\x20SQL\x20for\x20segment...','processedRows','getSegmentSQL','cyan','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','query','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','segment:folder:list','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','139930JmWRyd','Examples:','name','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','segment:sql','/e/','replace','Fetching\x20folder\x20\x27','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','2279256tDuBWF','getFolder','folderPath','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Usage:\x20tdx\x20sg\x20sql\x20<name>','site','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','url','trim','373320hQSkmA','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','length','fullPath','Usage:\x20tdx\x20sg\x20show\x20<name>','execute','\x20\x20Parent\x20segment:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Site:\x20','description','verbose','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','setJobId','error','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','5NaIEhA','Resolved\x20relative\x20path\x20to:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','folderId','resolveFolderId','Fetching\x20folder\x20details...','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','stats','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','jsonl','segment:folder:create','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Resolving\x20folder\x20\x27','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','/app/ps/','resolvePathToResource','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Fetching\x20parent\x20segment\x20details...','getSegment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Error:\x20','includes','parent','3478473OjSFYL','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','SEGMENT_FOLDER_NOT_FOUND','Use:\x20tdx\x20ps\x20sql','Resolving\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:view','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Path\x20or\x20name\x20is\x20required','resolveParentId','segmentName','Segment\x20ID:\x20','segment:show','Options:','folder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Folder\x20name:\x20','segment','createFolder','103960oTeMAg','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','segmentId','1094340vdMihz','type','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','message','\x20\x20Segment\x20name:\x20'];a27_0x1c77=function(){return _0x3950bd;};return a27_0x1c77();}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_0x5807c4 from'chalk';async function resolveSegmentTarget(_0x3604fe,_0x3260e1,_0x5800b9){const _0x5afe7a=a27_0x35d2;if(isYamlFilePath(_0x3604fe))try{const _0x2aae8e=await resolveYamlFilePath(_0x3604fe);return _0x5800b9&&(console[_0x5afe7a(0x232)]('Resolved\x20YAML\x20file:\x20'+_0x3604fe),console['error'](_0x5afe7a(0x22a)+_0x2aae8e[_0x5afe7a(0x1fc)]),console[_0x5afe7a(0x232)](_0x5afe7a(0x26e)+_0x2aae8e[_0x5afe7a(0x25a)]),console[_0x5afe7a(0x232)](_0x5afe7a(0x1e7)+(_0x2aae8e[_0x5afe7a(0x21b)]||'(root)')),console[_0x5afe7a(0x232)](_0x5afe7a(0x1f9)+_0x2aae8e['fullPath'])),_0x2aae8e[_0x5afe7a(0x227)];}catch(_0x249440){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5afe7a(0x20f)+_0x249440[_0x5afe7a(0x26d)]);}if(!_0x3260e1)throw new SDKError(ErrorCode[_0x5afe7a(0x205)],_0x5afe7a(0x213));return _0x3260e1+'/'+_0x3604fe;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x1ea2db(0x212)]='segment:describe';[a27_0x1ea2db(0x22d)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x1ea2db(0x229)](_0x211e44){const _0x2cb4c5=a27_0x1ea2db,{options:_0x258d71,args:_0x54d3a8,tdx:_0xcfca04}=_0x211e44,_0x22a574=_0x54d3a8[0x0],_0x563dcb=!_0x22a574&&!!_0x258d71[_0x2cb4c5(0x1fc)],_0x1ce97e=_0x22a574||_0x258d71[_0x2cb4c5(0x1fc)];if(!_0x1ce97e)return console[_0x2cb4c5(0x232)](_0x2cb4c5(0x258)),console[_0x2cb4c5(0x232)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x2cb4c5(0x232)](_0x2cb4c5(0x211)),console[_0x2cb4c5(0x232)](_0x2cb4c5(0x1dd)),console[_0x2cb4c5(0x232)](_0x2cb4c5(0x26a)),console[_0x2cb4c5(0x232)](_0x2cb4c5(0x265)),console[_0x2cb4c5(0x232)](_0x2cb4c5(0x26b)),0x1;try{const _0x52cbdd=_0x258d71[_0x2cb4c5(0x1f8)];let _0x4252f0=_0x1ce97e;!_0x563dcb&&_0x52cbdd&&!_0x1ce97e[_0x2cb4c5(0x24c)]('/')&&(_0x4252f0=_0x52cbdd+'/'+_0x1ce97e,_0x258d71[_0x2cb4c5(0x22e)]&&console[_0x2cb4c5(0x232)](_0x2cb4c5(0x236)+_0x4252f0));const _0x2a7ef0=await withSpinner(_0x2cb4c5(0x1f3)+_0x4252f0+_0x2cb4c5(0x1de),()=>_0xcfca04[_0x2cb4c5(0x261)]['resolvePathToResource'](_0x4252f0),{'verbose':_0x258d71[_0x2cb4c5(0x22e)]}),_0x1e332b=_0x2a7ef0['data'];_0x258d71[_0x2cb4c5(0x22e)]&&(console[_0x2cb4c5(0x232)](_0x2cb4c5(0x1e1)+_0x1e332b['type']),console['error'](_0x2cb4c5(0x1ef)+_0x1e332b[_0x2cb4c5(0x1e9)]),_0x1e332b[_0x2cb4c5(0x238)]&&console['error']('Folder\x20ID:\x20'+_0x1e332b[_0x2cb4c5(0x238)]),_0x1e332b['segmentId']&&console['error'](_0x2cb4c5(0x25b)+_0x1e332b[_0x2cb4c5(0x267)]));if(_0x1e332b[_0x2cb4c5(0x269)]==='parent'){const _0x192afa=await withSpinner(_0x2cb4c5(0x248),()=>_0xcfca04[_0x2cb4c5(0x261)][_0x2cb4c5(0x1e2)](_0x1e332b[_0x2cb4c5(0x1e9)]),{'verbose':_0x258d71[_0x2cb4c5(0x22e)]});await handleSingleObjectOutput(_0x192afa[_0x2cb4c5(0x1e5)],_0x258d71);}else{if(_0x1e332b[_0x2cb4c5(0x269)]===_0x2cb4c5(0x25e)){if(!_0x1e332b['folderId'])throw new SDKError(ErrorCode[_0x2cb4c5(0x251)],_0x2cb4c5(0x25f));const _0x3e104b=await withSpinner(_0x2cb4c5(0x23a),()=>_0xcfca04[_0x2cb4c5(0x261)][_0x2cb4c5(0x21a)](_0x1e332b[_0x2cb4c5(0x238)]),{'verbose':_0x258d71['verbose']});await handleSingleObjectOutput(_0x3e104b[_0x2cb4c5(0x1e5)],_0x258d71);}else{if(_0x1e332b[_0x2cb4c5(0x269)]==='segment'){if(!_0x1e332b[_0x2cb4c5(0x267)])throw new SDKError(ErrorCode[_0x2cb4c5(0x1f0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x43d99e=await withSpinner('Fetching\x20segment\x20details...',()=>_0xcfca04['segment']['getSegment'](_0x1e332b[_0x2cb4c5(0x1e9)],_0x1e332b['segmentId']),{'verbose':_0x258d71[_0x2cb4c5(0x22e)]});await handleSingleObjectOutput(_0x43d99e[_0x2cb4c5(0x1e5)],_0x258d71);}}}return 0x0;}catch(_0x2a3203){if(_0x2a3203 instanceof SDKError)return console[_0x2cb4c5(0x232)](_0x2cb4c5(0x24b)+_0x2a3203[_0x2cb4c5(0x26d)]),_0x2a3203['cause']&&console[_0x2cb4c5(0x232)](_0x2cb4c5(0x1ee)+_0x2a3203['cause']),0x1;throw _0x2a3203;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x1ea2db(0x212)]=a27_0x1ea2db(0x25c);[a27_0x1ea2db(0x22d)]=a27_0x1ea2db(0x247);async[a27_0x1ea2db(0x229)](_0x2deebc){const _0xea6afe=a27_0x1ea2db,{options:_0xb2cc8b,args:_0x5a7589,tdx:_0x38382d}=_0x2deebc,_0x585e5a=_0x5a7589[0x0];if(!_0x585e5a)return console[_0xea6afe(0x232)](_0xea6afe(0x218)),console['error'](_0xea6afe(0x228)),console['error'](_0xea6afe(0x22f)),console[_0xea6afe(0x232)](_0xea6afe(0x211)),console[_0xea6afe(0x232)](_0xea6afe(0x1fb)),console[_0xea6afe(0x232)](_0xea6afe(0x250)),0x1;try{const _0x8cc963=_0xb2cc8b[_0xea6afe(0x1fc)],_0x2fc32e=await resolveSegmentTarget(_0x585e5a,_0x8cc963,_0xb2cc8b[_0xea6afe(0x22e)]);_0xb2cc8b[_0xea6afe(0x22e)]&&console[_0xea6afe(0x232)]('Target\x20path:\x20'+_0x2fc32e);const _0xa84f02=await withSpinner('Resolving\x20\x27'+_0x585e5a+'\x27...',()=>_0x38382d[_0xea6afe(0x261)]['resolvePathToResource'](_0x2fc32e),{'verbose':_0xb2cc8b['verbose']}),_0x2f773f=_0xa84f02[_0xea6afe(0x1e5)];_0xb2cc8b['verbose']&&(console[_0xea6afe(0x232)]('Resolved\x20type:\x20'+_0x2f773f[_0xea6afe(0x269)]),console[_0xea6afe(0x232)]('Parent\x20ID:\x20'+_0x2f773f['parentId']));if(_0x2f773f['type']===_0xea6afe(0x25e))return console[_0xea6afe(0x232)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console['error'](_0xea6afe(0x240)),0x1;if(_0x2f773f[_0xea6afe(0x269)]===_0xea6afe(0x24d))return console[_0xea6afe(0x232)](_0xea6afe(0x1f2)),console[_0xea6afe(0x232)](_0xea6afe(0x206)),0x1;if(!_0x2f773f['segmentId'])throw new SDKError(ErrorCode[_0xea6afe(0x1f0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2dce7b=await withSpinner(_0xea6afe(0x207),()=>_0x38382d[_0xea6afe(0x261)][_0xea6afe(0x209)](_0x2f773f[_0xea6afe(0x1e9)],_0x2f773f[_0xea6afe(0x267)]),{'verbose':_0xb2cc8b[_0xea6afe(0x22e)]});let _0x5c1cc2=_0x2dce7b[_0xea6afe(0x1e5)];const _0x4ce88f=resolveLimit(_0xb2cc8b['limit'],DEFAULT_DISPLAY_LIMIT),_0x153152=/\bLIMIT\s+\d+/i['test'](_0x5c1cc2);!_0x153152&&(_0x5c1cc2=_0x5c1cc2[_0xea6afe(0x221)]()[_0xea6afe(0x216)](/;+$/,''),_0x5c1cc2='SELECT\x20*\x20FROM\x20(\x0a'+_0x5c1cc2+_0xea6afe(0x230)+_0x4ce88f);_0xb2cc8b['verbose']&&console[_0xea6afe(0x232)]('SQL\x20query:\x0a'+_0x5c1cc2);const _0x27b4b9=await withProgressSpinner('Executing\x20segment\x20query...',async _0x264033=>{const _0x54cb93=_0xea6afe,_0x6b1c5=await _0x38382d[_0x54cb93(0x20c)][_0x54cb93(0x229)](_0x5c1cc2,{'catalog':'td','schema':_0x54cb93(0x1ed),'onJobId':_0x49be2b=>{const _0x480ef8=_0x54cb93;_0x264033[_0x480ef8(0x231)](_0x49be2b);}});return _0x6b1c5;},{'verbose':_0xb2cc8b[_0xea6afe(0x22e)]}),_0xc33500=_0x27b4b9[_0xea6afe(0x1e5)],_0x2edbf2=_0xc33500[_0xea6afe(0x202)]?'\x20[Job\x20ID:\x20'+_0xc33500[_0xea6afe(0x202)]+']':'';return console[_0xea6afe(0x232)]('βœ”\x20Query\x20completed:\x20Processed\x20'+_0xc33500['stats'][_0xea6afe(0x208)][_0xea6afe(0x204)]()+'\x20rows\x20'+(_0xea6afe(0x1f1)+formatElapsed(_0xc33500[_0xea6afe(0x23c)][_0xea6afe(0x273)])+_0x2edbf2)),await handleQueryOutput(_0xc33500,_0xb2cc8b),0x0;}catch(_0xe7224){if(_0xe7224 instanceof SDKError)return console[_0xea6afe(0x232)](_0xea6afe(0x1eb)+_0xe7224['code']+']'),console[_0xea6afe(0x232)]('\x0a'+_0xe7224[_0xea6afe(0x26d)]),0x1;throw _0xe7224;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x1ea2db(0x212)]=a27_0x1ea2db(0x20e);['description']='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a27_0x1ea2db(0x229)](_0x3cd416){const _0x27a254=a27_0x1ea2db,{options:_0x331f5f,args:_0x40d963,tdx:_0x32ba1e}=_0x3cd416;if(_0x40d963['length']===0x0)return console[_0x27a254(0x232)](_0x27a254(0x22b)),console['error'](_0x27a254(0x272)),0x1;const _0x404c50=_0x40d963[0x0];try{_0x331f5f['verbose']&&(console['error'](_0x27a254(0x22c)+_0x331f5f[_0x27a254(0x21e)]),console['error']('Parent\x20name:\x20'+_0x404c50));const _0x3ee8d4=await withSpinner(_0x27a254(0x203)+_0x404c50+_0x27a254(0x1de),()=>_0x32ba1e['segment'][_0x27a254(0x259)](_0x404c50),{'verbose':_0x331f5f['verbose']}),_0x5af28d=_0x3ee8d4[_0x27a254(0x1e5)];_0x331f5f[_0x27a254(0x22e)]&&console['error'](_0x27a254(0x1f7)+_0x5af28d);const _0x158ec6=await withSpinner(_0x27a254(0x224)+_0x404c50+_0x27a254(0x1de),()=>_0x32ba1e[_0x27a254(0x261)]['listFolders'](_0x5af28d),{'verbose':_0x331f5f[_0x27a254(0x22e)]}),_0x51568d=_0x158ec6[_0x27a254(0x1e5)];return console[_0x27a254(0x232)](_0x27a254(0x1ec)+_0x51568d['length']+'\x20folder'+(_0x51568d[_0x27a254(0x226)]!==0x1?'s':'')),await handleSDKOutput(_0x51568d,_0x331f5f),0x0;}catch(_0x2743be){if(_0x2743be instanceof SDKError)return console['error'](_0x27a254(0x24b)+_0x2743be[_0x27a254(0x26d)]),_0x2743be['cause']&&console[_0x27a254(0x232)](_0x27a254(0x1ee)+_0x2743be[_0x27a254(0x1fe)]),0x1;throw _0x2743be;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x1ea2db(0x212)]=a27_0x1ea2db(0x1e3);[a27_0x1ea2db(0x22d)]='Show\x20segment\x20folder\x20details';async[a27_0x1ea2db(0x229)](_0x254471){const _0x5bf967=a27_0x1ea2db,{options:_0xcf9683,args:_0x4d9b7f,tdx:_0x3d14b6}=_0x254471;if(_0x4d9b7f['length']===0x0)return console[_0x5bf967(0x232)](_0x5bf967(0x233)),console[_0x5bf967(0x232)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0xc86d6b,childId:_0x292f4f}=parseSegmentRef(_0x4d9b7f[0x0]);_0xcf9683['verbose']&&(console[_0x5bf967(0x232)](_0x5bf967(0x22c)+_0xcf9683[_0x5bf967(0x21e)]),console[_0x5bf967(0x232)]('Parent\x20name:\x20'+_0xc86d6b),_0x292f4f&&console['error']('Folder\x20name:\x20'+_0x292f4f));if(!_0x292f4f)return console[_0x5bf967(0x232)](_0x5bf967(0x255)),0x1;const _0x25fa48=await withSpinner(_0x5bf967(0x203)+_0xc86d6b+_0x5bf967(0x1de),()=>_0x3d14b6[_0x5bf967(0x261)][_0x5bf967(0x259)](_0xc86d6b),{'verbose':_0xcf9683['verbose']}),_0x2946ec=_0x25fa48[_0x5bf967(0x1e5)];_0xcf9683['verbose']&&console[_0x5bf967(0x232)]('Resolved\x20parent\x20ID:\x20'+_0x2946ec);const _0x50d576=await withSpinner(_0x5bf967(0x243)+_0x292f4f+_0x5bf967(0x1de),()=>_0x3d14b6[_0x5bf967(0x261)][_0x5bf967(0x239)](_0x2946ec,_0x292f4f),{'verbose':_0xcf9683[_0x5bf967(0x22e)]}),_0x1e2c1a=_0x50d576['data'];_0xcf9683[_0x5bf967(0x22e)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x1e2c1a);const _0x156f57=await withSpinner(_0x5bf967(0x217)+_0x292f4f+_0x5bf967(0x1de),()=>_0x3d14b6[_0x5bf967(0x261)][_0x5bf967(0x21a)](_0x1e2c1a),{'verbose':_0xcf9683[_0x5bf967(0x22e)]});return await handleSDKOutput([_0x156f57[_0x5bf967(0x1e5)]],_0xcf9683),0x0;}catch(_0x3dbb07){if(_0x3dbb07 instanceof SDKError)return console['error'](_0x5bf967(0x24b)+_0x3dbb07['message']),_0x3dbb07['cause']&&console['error'](_0x5bf967(0x1ee)+_0x3dbb07[_0x5bf967(0x1fe)]),0x1;throw _0x3dbb07;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x1ea2db(0x212)]=a27_0x1ea2db(0x214);[a27_0x1ea2db(0x22d)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x1ea2db(0x229)](_0x2be02c){const _0x6e1d9b=a27_0x1ea2db,{options:_0x2cb81b,args:_0x507457,tdx:_0x160f25}=_0x2be02c,_0x5e84b3=_0x507457[0x0];if(!_0x5e84b3)return console['error'](_0x6e1d9b(0x218)),console[_0x6e1d9b(0x232)](_0x6e1d9b(0x21d)),console[_0x6e1d9b(0x232)](_0x6e1d9b(0x24a)),console[_0x6e1d9b(0x232)](_0x6e1d9b(0x211)),console[_0x6e1d9b(0x232)](_0x6e1d9b(0x244)),console[_0x6e1d9b(0x232)](_0x6e1d9b(0x20b)),0x1;try{const _0x3d2a36=_0x2cb81b[_0x6e1d9b(0x1fc)],_0x226dd5=await resolveSegmentTarget(_0x5e84b3,_0x3d2a36,_0x2cb81b[_0x6e1d9b(0x22e)]);_0x2cb81b['verbose']&&console[_0x6e1d9b(0x232)](_0x6e1d9b(0x1ff)+_0x226dd5);const _0xd49cb1=await withSpinner(_0x6e1d9b(0x253)+_0x5e84b3+_0x6e1d9b(0x1de),()=>_0x160f25[_0x6e1d9b(0x261)][_0x6e1d9b(0x246)](_0x226dd5),{'verbose':_0x2cb81b[_0x6e1d9b(0x22e)]}),_0x271239=_0xd49cb1['data'];_0x2cb81b[_0x6e1d9b(0x22e)]&&(console['error']('Resolved\x20type:\x20'+_0x271239[_0x6e1d9b(0x269)]),console[_0x6e1d9b(0x232)](_0x6e1d9b(0x1ef)+_0x271239['parentId']));if(_0x271239[_0x6e1d9b(0x269)]===_0x6e1d9b(0x25e))return console[_0x6e1d9b(0x232)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x6e1d9b(0x232)](_0x6e1d9b(0x23b)),0x1;if(_0x271239[_0x6e1d9b(0x269)]===_0x6e1d9b(0x24d))return console[_0x6e1d9b(0x232)](_0x6e1d9b(0x23d)),console[_0x6e1d9b(0x232)](_0x6e1d9b(0x252)),0x1;if(!_0x271239[_0x6e1d9b(0x267)])throw new SDKError(ErrorCode[_0x6e1d9b(0x1f0)],_0x6e1d9b(0x1f4));const _0x1dc1d2=await withSpinner(_0x6e1d9b(0x207),()=>_0x160f25[_0x6e1d9b(0x261)][_0x6e1d9b(0x209)](_0x271239[_0x6e1d9b(0x1e9)],_0x271239['segmentId']),{'verbose':_0x2cb81b[_0x6e1d9b(0x22e)]}),_0x2b184a=_0x1dc1d2[_0x6e1d9b(0x1e5)];return _0x2cb81b[_0x6e1d9b(0x1fd)]==='json'||_0x2cb81b[_0x6e1d9b(0x1fd)]===_0x6e1d9b(0x23e)?await handleSDKOutput([{'sql':_0x2b184a}],_0x2cb81b):console['log'](_0x2b184a),0x0;}catch(_0x45d1f1){if(_0x45d1f1 instanceof SDKError)return console[_0x6e1d9b(0x232)](_0x6e1d9b(0x24b)+_0x45d1f1[_0x6e1d9b(0x26d)]),_0x45d1f1[_0x6e1d9b(0x1fe)]&&console[_0x6e1d9b(0x232)]('\x20\x20Cause:\x20'+_0x45d1f1[_0x6e1d9b(0x1fe)]),0x1;throw _0x45d1f1;}}}function a27_0x35d2(_0x1f16f7,_0x2c1a72){_0x1f16f7=_0x1f16f7-0x1dd;const _0x1c77ff=a27_0x1c77();let _0x35d25d=_0x1c77ff[_0x1f16f7];return _0x35d25d;}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x1ea2db(0x212)]=a27_0x1ea2db(0x23f);[a27_0x1ea2db(0x22d)]='Create\x20segment\x20folder\x20for\x20organization';async[a27_0x1ea2db(0x229)](_0x93f9cd){const _0x50f4b1=a27_0x1ea2db,{options:_0x1ecf55,args:_0x7075b,tdx:_0x5dd87f}=_0x93f9cd,_0x420e1d=_0x1ecf55;if(_0x7075b[_0x50f4b1(0x226)]<0x2)return console['error'](_0x50f4b1(0x271)),console[_0x50f4b1(0x232)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x4e2b79=_0x7075b[0x0],_0x18ba5d=_0x7075b[0x1];_0x420e1d[_0x50f4b1(0x22e)]&&(console[_0x50f4b1(0x232)](_0x50f4b1(0x22c)+_0x420e1d[_0x50f4b1(0x21e)]),console['error']('Parent\x20segment:\x20'+_0x4e2b79),console[_0x50f4b1(0x232)](_0x50f4b1(0x260)+_0x18ba5d));let _0x18be80;if(_0x420e1d[_0x50f4b1(0x1df)]){const _0x235ca8=_0x420e1d[_0x50f4b1(0x1df)],_0xf065d7=await withSpinner(_0x50f4b1(0x203)+_0x4e2b79+_0x50f4b1(0x1de),()=>_0x5dd87f[_0x50f4b1(0x261)][_0x50f4b1(0x259)](_0x4e2b79),{'verbose':_0x420e1d['verbose']}),_0x25cad5=_0xf065d7[_0x50f4b1(0x1e5)],_0x2f8132=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x235ca8+_0x50f4b1(0x1de),()=>_0x5dd87f[_0x50f4b1(0x261)]['resolveFolderId'](_0x25cad5,_0x235ca8),{'verbose':_0x420e1d[_0x50f4b1(0x22e)]});_0x18be80=_0x2f8132[_0x50f4b1(0x1e5)],_0x420e1d[_0x50f4b1(0x22e)]&&console[_0x50f4b1(0x232)](_0x50f4b1(0x1f6)+_0x18be80);}const _0x435690={'name':_0x18ba5d,'description':_0x420e1d['description'],'parentFolderId':_0x18be80},_0x3d6b9a=await withSpinner(_0x50f4b1(0x1ea)+_0x18ba5d+_0x50f4b1(0x1de),()=>_0x5dd87f['segment'][_0x50f4b1(0x262)](_0x4e2b79,_0x435690),{'verbose':_0x420e1d['verbose']}),_0x3ebb97=_0x3d6b9a[_0x50f4b1(0x1e5)];return console['error']('βœ”\x20Created\x20folder\x20\x27'+_0x3ebb97[_0x50f4b1(0x212)]+_0x50f4b1(0x201)+_0x3ebb97['id']),await handleSDKOutput([_0x3ebb97],_0x420e1d),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x1ea2db(0x212)]=a27_0x1ea2db(0x256);['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async[a27_0x1ea2db(0x229)](_0x248f52){const _0x15bcd2=a27_0x1ea2db,{options:_0x3e658b,args:_0x2a61ee,tdx:_0x2764cd}=_0x248f52,_0x1c41a4=_0x2a61ee[0x0];if(!_0x1c41a4)return console[_0x15bcd2(0x232)](_0x15bcd2(0x225)),console[_0x15bcd2(0x232)](_0x15bcd2(0x254)),console['error'](_0x15bcd2(0x237)),console[_0x15bcd2(0x232)](_0x15bcd2(0x25d)),console[_0x15bcd2(0x232)](_0x15bcd2(0x21f)),console[_0x15bcd2(0x232)](_0x15bcd2(0x211)),console['error'](_0x15bcd2(0x242)),console[_0x15bcd2(0x232)](_0x15bcd2(0x234)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x15bcd2(0x232)](_0x15bcd2(0x200)),0x1;try{const _0x467ad0=_0x3e658b['parentSegment'],_0x15e9bc=await resolveSegmentTarget(_0x1c41a4,_0x467ad0,_0x3e658b[_0x15bcd2(0x22e)]);_0x3e658b[_0x15bcd2(0x22e)]&&console[_0x15bcd2(0x232)](_0x15bcd2(0x1ff)+_0x15e9bc);const _0x2f022a=await withSpinner(_0x15bcd2(0x253)+_0x1c41a4+_0x15bcd2(0x1de),()=>_0x2764cd['segment'][_0x15bcd2(0x246)](_0x15e9bc),{'verbose':_0x3e658b['verbose']}),_0x469056=_0x2f022a[_0x15bcd2(0x1e5)];_0x3e658b[_0x15bcd2(0x22e)]&&(console[_0x15bcd2(0x232)](_0x15bcd2(0x1e1)+_0x469056['type']),console['error']('Parent\x20ID:\x20'+_0x469056[_0x15bcd2(0x1e9)]),_0x469056[_0x15bcd2(0x238)]&&console[_0x15bcd2(0x232)](_0x15bcd2(0x1f5)+_0x469056[_0x15bcd2(0x238)]),_0x469056[_0x15bcd2(0x267)]&&console[_0x15bcd2(0x232)](_0x15bcd2(0x25b)+_0x469056[_0x15bcd2(0x267)]));if(_0x3e658b['web']){if(_0x469056[_0x15bcd2(0x269)]===_0x15bcd2(0x25e))return console[_0x15bcd2(0x232)](_0x15bcd2(0x266)),0x1;if(_0x469056[_0x15bcd2(0x269)]===_0x15bcd2(0x24d))return console[_0x15bcd2(0x232)](_0x15bcd2(0x21c)),console[_0x15bcd2(0x232)](_0x15bcd2(0x1e4)),0x1;if(!_0x469056[_0x15bcd2(0x267)])throw new SDKError(ErrorCode[_0x15bcd2(0x1f0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5e68b8=getConsoleNextUrl(_0x3e658b[_0x15bcd2(0x21e)],_0x15bcd2(0x245)+_0x469056['parentId']+_0x15bcd2(0x215)+_0x469056[_0x15bcd2(0x267)]);return console[_0x15bcd2(0x232)](a27_0x5807c4['green']('βœ”')+_0x15bcd2(0x1e6)+a27_0x5807c4[_0x15bcd2(0x20a)](_0x5e68b8)),openBrowser(_0x5e68b8),0x0;}if(_0x469056['type']==='folder'){if(!_0x469056[_0x15bcd2(0x238)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x15bcd2(0x25f));const _0x1a352c=await withSpinner(_0x15bcd2(0x23a),()=>_0x2764cd[_0x15bcd2(0x261)][_0x15bcd2(0x21a)](_0x469056[_0x15bcd2(0x238)]),{'verbose':_0x3e658b[_0x15bcd2(0x22e)]});await handleSingleObjectOutput(_0x1a352c[_0x15bcd2(0x1e5)],_0x3e658b);}else{if(_0x469056[_0x15bcd2(0x269)]===_0x15bcd2(0x261)){if(!_0x469056[_0x15bcd2(0x267)])throw new SDKError(ErrorCode[_0x15bcd2(0x1f0)],_0x15bcd2(0x1f4));const _0x8a9a9f=await withSpinner(_0x15bcd2(0x24f),()=>_0x2764cd[_0x15bcd2(0x261)][_0x15bcd2(0x249)](_0x469056[_0x15bcd2(0x1e9)],_0x469056[_0x15bcd2(0x267)]),{'verbose':_0x3e658b[_0x15bcd2(0x22e)]}),_0xd05ae5=getConsoleNextUrl(_0x3e658b[_0x15bcd2(0x21e)],_0x15bcd2(0x245)+_0x469056[_0x15bcd2(0x1e9)]+'/e/'+_0x469056[_0x15bcd2(0x267)]),_0x143daa=_0x8a9a9f[_0x15bcd2(0x1e5)];_0x143daa[_0x15bcd2(0x220)]=_0xd05ae5,await handleSingleObjectOutput(_0x143daa,_0x3e658b);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x15bcd2(0x232)](_0x15bcd2(0x26f)),0x1;}return 0x0;}catch(_0x522611){if(_0x522611 instanceof SDKError)return console[_0x15bcd2(0x232)](_0x15bcd2(0x24b)+_0x522611[_0x15bcd2(0x26d)]),_0x522611['cause']&&console[_0x15bcd2(0x232)]('\x20\x20Cause:\x20'+_0x522611[_0x15bcd2(0x1fe)]),0x1;throw _0x522611;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x1ea2db(0x212)]=a27_0x1ea2db(0x270);[a27_0x1ea2db(0x22d)]=a27_0x1ea2db(0x264);async[a27_0x1ea2db(0x229)](_0x1e0f7c){const _0x3e6acb=a27_0x1ea2db,{options:_0x242c5a,args:_0x3fc1a1,tdx:_0x52311f}=_0x1e0f7c,_0x26a737=_0x3fc1a1[0x0];if(!_0x26a737)return console[_0x3e6acb(0x232)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3e6acb(0x232)](_0x3e6acb(0x257)),console[_0x3e6acb(0x232)](_0x3e6acb(0x20d)),console[_0x3e6acb(0x232)](_0x3e6acb(0x211)),console[_0x3e6acb(0x232)](_0x3e6acb(0x223)),console[_0x3e6acb(0x232)](_0x3e6acb(0x241)),0x1;try{const _0x981b7f=_0x242c5a[_0x3e6acb(0x1fc)],_0x37cade=await resolveSegmentTarget(_0x26a737,_0x981b7f,_0x242c5a['verbose']);_0x242c5a['verbose']&&console[_0x3e6acb(0x232)](_0x3e6acb(0x1ff)+_0x37cade);const _0xdf53df=await withSpinner(_0x3e6acb(0x253)+_0x26a737+_0x3e6acb(0x1de),()=>_0x52311f[_0x3e6acb(0x261)][_0x3e6acb(0x246)](_0x37cade),{'verbose':_0x242c5a[_0x3e6acb(0x22e)]}),_0x425f46=_0xdf53df[_0x3e6acb(0x1e5)];_0x242c5a[_0x3e6acb(0x22e)]&&(console[_0x3e6acb(0x232)](_0x3e6acb(0x1e1)+_0x425f46[_0x3e6acb(0x269)]),console[_0x3e6acb(0x232)]('Parent\x20ID:\x20'+_0x425f46[_0x3e6acb(0x1e9)]));if(_0x425f46['type']==='folder')return console['error'](_0x3e6acb(0x26c)),console[_0x3e6acb(0x232)](_0x3e6acb(0x23b)),0x1;if(_0x425f46[_0x3e6acb(0x269)]===_0x3e6acb(0x24d))return console['error'](_0x3e6acb(0x1fa)),console[_0x3e6acb(0x232)](_0x3e6acb(0x1e8)),0x1;if(!_0x425f46[_0x3e6acb(0x267)])throw new SDKError(ErrorCode[_0x3e6acb(0x1f0)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3f3e64=await withSpinner(_0x3e6acb(0x207),()=>_0x52311f[_0x3e6acb(0x261)][_0x3e6acb(0x209)](_0x425f46[_0x3e6acb(0x1e9)],_0x425f46[_0x3e6acb(0x267)]),{'verbose':_0x242c5a[_0x3e6acb(0x22e)]}),_0x536703=_0x3f3e64[_0x3e6acb(0x1e5)],_0x40d2e3=await executeSchemaQuery(_0x536703,_0x52311f,_0x242c5a);return await handleQueryOutput(_0x40d2e3,_0x242c5a),0x0;}catch(_0x59b71d){if(_0x59b71d instanceof SDKError)return console['error'](_0x3e6acb(0x24b)+_0x59b71d['message']),_0x59b71d['cause']&&console['error'](_0x3e6acb(0x1ee)+_0x59b71d[_0x3e6acb(0x1fe)]),0x1;throw _0x59b71d;}}}
@@ -1 +1 @@
1
- const a28_0x1257ec=a28_0x4d8e;function a28_0x4d8e(_0xfe4be2,_0x1b35cc){_0xfe4be2=_0xfe4be2-0x1a7;const _0x4420bf=a28_0x4420();let _0x4d8ea7=_0x4420bf[_0xfe4be2];return _0x4d8ea7;}(function(_0x137ec3,_0x299536){const _0xb49c6b=a28_0x4d8e,_0x39d08f=_0x137ec3();while(!![]){try{const _0x46e634=-parseInt(_0xb49c6b(0x1b4))/0x1+-parseInt(_0xb49c6b(0x1a8))/0x2+-parseInt(_0xb49c6b(0x1c6))/0x3+-parseInt(_0xb49c6b(0x1d6))/0x4*(-parseInt(_0xb49c6b(0x1d2))/0x5)+parseInt(_0xb49c6b(0x1cb))/0x6*(-parseInt(_0xb49c6b(0x1d0))/0x7)+parseInt(_0xb49c6b(0x1d5))/0x8+parseInt(_0xb49c6b(0x1cf))/0x9*(parseInt(_0xb49c6b(0x1d7))/0xa);if(_0x46e634===_0x299536)break;else _0x39d08f['push'](_0x39d08f['shift']());}catch(_0x3d7551){_0x39d08f['push'](_0x39d08f['shift']());}}}(a28_0x4420,0x2d21b));function a28_0x4420(){const _0xa5dc1c=['name','Examples:','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','createSegment','398760odKwcm','segment','noCountPopulation','folderId','site','582WvHHrM','βœ”\x20Created\x20segment\x20\x27','Creating\x20segment\x20\x27','Resolving\x20folder\x20\x27','1683IzTrMW','2863jrOpOK','includes','315jAjuNU','length','Target\x20path:\x20','1511680NnViLq','5996AdAgQW','23750DiHJbM','kind','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','segments','645138EtWrJV','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','rule','Resolved\x20folder\x20ID:\x20','yellow','type','resolveFolderId','error','description','verbose','segment:create','segmentPath','47501IqyQPG','\x20\x20\x20Path:\x20','ruleFile','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','data','Site:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','execute','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x27...','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules'];a28_0x4420=function(){return _0xa5dc1c;};return a28_0x4420();}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_0x4c8104 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x1257ec(0x1c2)]=a28_0x1257ec(0x1b2);[a28_0x1257ec(0x1b0)]=a28_0x1257ec(0x1c1);async[a28_0x1257ec(0x1bc)](_0x580308){const _0x40ef34=a28_0x1257ec;console[_0x40ef34(0x1af)](a28_0x4c8104[_0x40ef34(0x1ac)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a28_0x4c8104[_0x40ef34(0x1ac)](_0x40ef34(0x1bb)));const {options:_0x1735b4,args:_0x430033,tdx:_0x271aa6}=_0x580308,_0x5b8bd1=_0x1735b4;if(_0x430033['length']===0x0)return console['error'](_0x40ef34(0x1bd)),console[_0x40ef34(0x1af)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x40ef34(0x1af)](_0x40ef34(0x1c3)),console[_0x40ef34(0x1af)](_0x40ef34(0x1c0)),console[_0x40ef34(0x1af)](_0x40ef34(0x1c4)),console[_0x40ef34(0x1af)](_0x40ef34(0x1b7)),0x1;const _0xd59668=_0x430033[0x0],_0x1a812c=_0x1735b4[_0x40ef34(0x1b3)];let _0x507a1d=_0xd59668;_0x1a812c&&!_0xd59668[_0x40ef34(0x1d1)]('/')&&(_0x507a1d=_0x1a812c+'/'+_0xd59668,_0x5b8bd1[_0x40ef34(0x1b1)]&&console[_0x40ef34(0x1af)]('Resolved\x20relative\x20path\x20to:\x20'+_0x507a1d));const _0x36d7d3=parsePath(_0x507a1d);if(_0x36d7d3[_0x40ef34(0x1a7)][_0x40ef34(0x1d3)]<0x2)return console['error'](_0x40ef34(0x1a9)),console['error'](_0x40ef34(0x1da)),0x1;const _0x240b1d=_0x36d7d3[_0x40ef34(0x1a7)][0x0],_0x543fa0=getBaseName(_0x507a1d),_0x59b4ef=getParentPath(_0x507a1d);_0x5b8bd1[_0x40ef34(0x1b1)]&&(console[_0x40ef34(0x1af)](_0x40ef34(0x1ba)+_0x5b8bd1[_0x40ef34(0x1ca)]),console[_0x40ef34(0x1af)](_0x40ef34(0x1d4)+_0x507a1d),console[_0x40ef34(0x1af)]('Parent:\x20'+_0x240b1d),console[_0x40ef34(0x1af)]('Segment\x20name:\x20'+_0x543fa0),console['error']('Parent\x20path:\x20'+_0x59b4ef));const _0x161b59=await withSpinner(_0x40ef34(0x1d9)+_0x240b1d+_0x40ef34(0x1be),()=>_0x271aa6[_0x40ef34(0x1c7)]['resolveParentId'](_0x240b1d),{'verbose':_0x5b8bd1[_0x40ef34(0x1b1)]}),_0x4e06fe=_0x161b59[_0x40ef34(0x1b9)];let _0x257b3e;if(_0x36d7d3[_0x40ef34(0x1a7)][_0x40ef34(0x1d3)]>0x2){const _0x4aa9be=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x59b4ef+_0x40ef34(0x1be),()=>_0x271aa6[_0x40ef34(0x1c7)]['resolvePathToResource'](_0x59b4ef),{'verbose':_0x5b8bd1[_0x40ef34(0x1b1)]}),_0x1e59fc=_0x4aa9be['data'];if(_0x1e59fc[_0x40ef34(0x1ad)]!==_0x40ef34(0x1b8)&&_0x1e59fc[_0x40ef34(0x1ad)]!=='parent')return console[_0x40ef34(0x1af)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x257b3e=_0x1e59fc[_0x40ef34(0x1c9)];}else{if(_0x5b8bd1[_0x40ef34(0x1b8)]){const _0x9f1baa=await withSpinner(_0x40ef34(0x1ce)+_0x5b8bd1['folder']+_0x40ef34(0x1be),()=>_0x271aa6['segment'][_0x40ef34(0x1ae)](_0x4e06fe,_0x5b8bd1[_0x40ef34(0x1b8)]),{'verbose':_0x5b8bd1[_0x40ef34(0x1b1)]});_0x257b3e=_0x9f1baa[_0x40ef34(0x1b9)];}}_0x5b8bd1['verbose']&&_0x257b3e&&console['error'](_0x40ef34(0x1ab)+_0x257b3e);const _0x588b0c=await loadJSONFromOptions(_0x5b8bd1[_0x40ef34(0x1aa)],_0x5b8bd1[_0x40ef34(0x1b6)]),_0x29ec2e={'name':_0x543fa0,'description':_0x5b8bd1[_0x40ef34(0x1b0)],'rule':_0x588b0c,'kind':_0x5b8bd1[_0x40ef34(0x1d8)]!==undefined?parseInt(_0x5b8bd1[_0x40ef34(0x1d8)],0xa):undefined,'isVisible':_0x5b8bd1['invisible']?![]:undefined,'segmentFolderId':_0x257b3e,'countPopulation':_0x5b8bd1[_0x40ef34(0x1c8)]?![]:undefined},_0x5cbeb4=await withSpinner(_0x40ef34(0x1cd)+_0x543fa0+_0x40ef34(0x1be),()=>_0x271aa6[_0x40ef34(0x1c7)][_0x40ef34(0x1c5)](_0x4e06fe,_0x29ec2e),{'verbose':_0x5b8bd1[_0x40ef34(0x1b1)]}),_0x13f1b3=_0x5cbeb4[_0x40ef34(0x1b9)];return console['error'](_0x40ef34(0x1cc)+_0x13f1b3[_0x40ef34(0x1c2)]+_0x40ef34(0x1bf)+_0x13f1b3['id']),_0x507a1d!==_0xd59668&&console[_0x40ef34(0x1af)](_0x40ef34(0x1b5)+_0x507a1d),await handleSDKOutput([_0x13f1b3],_0x5b8bd1),0x0;}}
1
+ function a28_0x44d3(_0x5b55fb,_0x33bcc0){_0x5b55fb=_0x5b55fb-0x1bb;const _0x17c54c=a28_0x17c5();let _0x44d3d5=_0x17c54c[_0x5b55fb];return _0x44d3d5;}function a28_0x17c5(){const _0x569a0c=['βœ”\x20Created\x20segment\x20\x27','resolveParentId','type','\x27...','folderId','ruleFile','execute','length','506012qtMsUW','segments','Target\x20path:\x20','344967yItXNf','resolvePathToResource','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','segment:create','\x27\x20with\x20ID:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','verbose','14EJYVJO','name','error','178650uznZbz','\x20\x20\x20Path:\x20','Resolving\x20folder\x20path\x20\x27','746058PLhCpJ','5439888AMXnyr','Site:\x20','segmentPath','Resolving\x20parent\x20segment\x20\x27','yellow','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','folder','parent','15049750Kbgnoj','description','kind','2RCdxzn','5pepZNL','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolving\x20folder\x20\x27','site','rule','noCountPopulation','Create\x20child\x20segment\x20with\x20filtering\x20rules','segment','Resolved\x20folder\x20ID:\x20','9824904ctBJyw'];a28_0x17c5=function(){return _0x569a0c;};return a28_0x17c5();}const a28_0x41c3a0=a28_0x44d3;(function(_0xa9c456,_0x19208){const _0x21d54f=a28_0x44d3,_0x4d215e=_0xa9c456();while(!![]){try{const _0x183403=-parseInt(_0x21d54f(0x1be))/0x1+-parseInt(_0x21d54f(0x1cf))/0x2*(-parseInt(_0x21d54f(0x1e6))/0x3)+parseInt(_0x21d54f(0x1e3))/0x4*(-parseInt(_0x21d54f(0x1d0))/0x5)+parseInt(_0x21d54f(0x1c1))/0x6*(-parseInt(_0x21d54f(0x1bb))/0x7)+parseInt(_0x21d54f(0x1c2))/0x8+-parseInt(_0x21d54f(0x1da))/0x9+parseInt(_0x21d54f(0x1cc))/0xa;if(_0x183403===_0x19208)break;else _0x4d215e['push'](_0x4d215e['shift']());}catch(_0x22cb53){_0x4d215e['push'](_0x4d215e['shift']());}}}(a28_0x17c5,0x9fc77));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_0x43a1cc from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x41c3a0(0x1bc)]=a28_0x41c3a0(0x1e9);[a28_0x41c3a0(0x1cd)]=a28_0x41c3a0(0x1d7);async[a28_0x41c3a0(0x1e1)](_0x326e04){const _0x418b8e=a28_0x41c3a0;console[_0x418b8e(0x1bd)](a28_0x43a1cc[_0x418b8e(0x1c6)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a28_0x43a1cc[_0x418b8e(0x1c6)](_0x418b8e(0x1d2)));const {options:_0xd88ff8,args:_0x326613,tdx:_0x44c1fc}=_0x326e04,_0x15be8d=_0xd88ff8;if(_0x326613['length']===0x0)return console[_0x418b8e(0x1bd)](_0x418b8e(0x1eb)),console[_0x418b8e(0x1bd)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error']('Examples:'),console[_0x418b8e(0x1bd)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x418b8e(0x1bd)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x418b8e(0x1bd)](_0x418b8e(0x1e8)),0x1;const _0x2e8071=_0x326613[0x0],_0x493206=_0xd88ff8[_0x418b8e(0x1c4)];let _0x159235=_0x2e8071;_0x493206&&!_0x2e8071['includes']('/')&&(_0x159235=_0x493206+'/'+_0x2e8071,_0x15be8d['verbose']&&console[_0x418b8e(0x1bd)]('Resolved\x20relative\x20path\x20to:\x20'+_0x159235));const _0x5e4a35=parsePath(_0x159235);if(_0x5e4a35[_0x418b8e(0x1e4)][_0x418b8e(0x1e2)]<0x2)return console[_0x418b8e(0x1bd)](_0x418b8e(0x1c7)),console[_0x418b8e(0x1bd)](_0x418b8e(0x1c8)),0x1;const _0x4bc607=_0x5e4a35[_0x418b8e(0x1e4)][0x0],_0x30f82f=getBaseName(_0x159235),_0x581e3b=getParentPath(_0x159235);_0x15be8d[_0x418b8e(0x1ec)]&&(console[_0x418b8e(0x1bd)](_0x418b8e(0x1c3)+_0x15be8d[_0x418b8e(0x1d4)]),console[_0x418b8e(0x1bd)](_0x418b8e(0x1e5)+_0x159235),console[_0x418b8e(0x1bd)]('Parent:\x20'+_0x4bc607),console[_0x418b8e(0x1bd)]('Segment\x20name:\x20'+_0x30f82f),console[_0x418b8e(0x1bd)]('Parent\x20path:\x20'+_0x581e3b));const _0x34e058=await withSpinner(_0x418b8e(0x1c5)+_0x4bc607+'\x27...',()=>_0x44c1fc[_0x418b8e(0x1d8)][_0x418b8e(0x1dc)](_0x4bc607),{'verbose':_0x15be8d[_0x418b8e(0x1ec)]}),_0x4e606b=_0x34e058[_0x418b8e(0x1c9)];let _0x161c27;if(_0x5e4a35[_0x418b8e(0x1e4)][_0x418b8e(0x1e2)]>0x2){const _0x562ba0=await withSpinner(_0x418b8e(0x1c0)+_0x581e3b+_0x418b8e(0x1de),()=>_0x44c1fc[_0x418b8e(0x1d8)][_0x418b8e(0x1e7)](_0x581e3b),{'verbose':_0x15be8d['verbose']}),_0x5eadd1=_0x562ba0[_0x418b8e(0x1c9)];if(_0x5eadd1[_0x418b8e(0x1dd)]!==_0x418b8e(0x1ca)&&_0x5eadd1[_0x418b8e(0x1dd)]!==_0x418b8e(0x1cb))return console[_0x418b8e(0x1bd)](_0x418b8e(0x1d1)),0x1;_0x161c27=_0x5eadd1[_0x418b8e(0x1df)];}else{if(_0x15be8d[_0x418b8e(0x1ca)]){const _0x2de2ed=await withSpinner(_0x418b8e(0x1d3)+_0x15be8d[_0x418b8e(0x1ca)]+_0x418b8e(0x1de),()=>_0x44c1fc[_0x418b8e(0x1d8)]['resolveFolderId'](_0x4e606b,_0x15be8d[_0x418b8e(0x1ca)]),{'verbose':_0x15be8d[_0x418b8e(0x1ec)]});_0x161c27=_0x2de2ed[_0x418b8e(0x1c9)];}}_0x15be8d[_0x418b8e(0x1ec)]&&_0x161c27&&console[_0x418b8e(0x1bd)](_0x418b8e(0x1d9)+_0x161c27);const _0x465732=await loadJSONFromOptions(_0x15be8d[_0x418b8e(0x1d5)],_0x15be8d[_0x418b8e(0x1e0)]),_0x11748e={'name':_0x30f82f,'description':_0x15be8d['description'],'rule':_0x465732,'kind':_0x15be8d[_0x418b8e(0x1ce)]!==undefined?parseInt(_0x15be8d['kind'],0xa):undefined,'isVisible':_0x15be8d['invisible']?![]:undefined,'segmentFolderId':_0x161c27,'countPopulation':_0x15be8d[_0x418b8e(0x1d6)]?![]:undefined},_0x44f9ae=await withSpinner('Creating\x20segment\x20\x27'+_0x30f82f+_0x418b8e(0x1de),()=>_0x44c1fc[_0x418b8e(0x1d8)]['createSegment'](_0x4e606b,_0x11748e),{'verbose':_0x15be8d[_0x418b8e(0x1ec)]}),_0x161ec7=_0x44f9ae['data'];return console['error'](_0x418b8e(0x1db)+_0x161ec7[_0x418b8e(0x1bc)]+_0x418b8e(0x1ea)+_0x161ec7['id']),_0x159235!==_0x2e8071&&console[_0x418b8e(0x1bd)](_0x418b8e(0x1bf)+_0x159235),await handleSDKOutput([_0x161ec7],_0x15be8d),0x0;}}
@@ -1 +1 @@
1
- function a29_0x1673(_0x4cc760,_0x165b31){_0x4cc760=_0x4cc760-0x116;const _0x4c6985=a29_0x4c69();let _0x1673b6=_0x4c6985[_0x4cc760];return _0x1673b6;}const a29_0x3fd9fb=a29_0x1673;(function(_0x4eceb1,_0x1fb627){const _0x832d3d=a29_0x1673,_0xe527a8=_0x4eceb1();while(!![]){try{const _0x39ce59=parseInt(_0x832d3d(0x124))/0x1*(-parseInt(_0x832d3d(0x11b))/0x2)+-parseInt(_0x832d3d(0x11f))/0x3+-parseInt(_0x832d3d(0x11a))/0x4*(-parseInt(_0x832d3d(0x129))/0x5)+parseInt(_0x832d3d(0x12a))/0x6+-parseInt(_0x832d3d(0x12f))/0x7*(parseInt(_0x832d3d(0x125))/0x8)+-parseInt(_0x832d3d(0x120))/0x9*(parseInt(_0x832d3d(0x121))/0xa)+parseInt(_0x832d3d(0x12c))/0xb;if(_0x39ce59===_0x1fb627)break;else _0xe527a8['push'](_0xe527a8['shift']());}catch(_0x358cef){_0xe527a8['push'](_0xe527a8['shift']());}}}(a29_0x4c69,0x8d90e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x4c69(){const _0x343947=['data','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','164QmmtQo','380tEuRQs','jsonl','site','json','2797107yFYRMe','27ExMQcr','1952680tnxNkC','\x20field','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','5452QlFhtl','7096pkZLMc','execute','segment:fields','error','11415YOfHzO','2440662JolpTU','Error:\x20Parent\x20segment\x20name\x20is\x20required','31300720CgndJw','verbose','name','1673QOuhut','\x27...','listFields'];a29_0x4c69=function(){return _0x343947;};return a29_0x4c69();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x3fd9fb(0x12e)]=a29_0x3fd9fb(0x127);['description']='List\x20available\x20fields\x20for\x20segmentation';async[a29_0x3fd9fb(0x126)](_0x4d0d6a){const _0x63650d=a29_0x3fd9fb,{options:_0x2379ce,args:_0x14138d,tdx:_0x6e14a9}=_0x4d0d6a,_0x420f8d=_0x14138d[0x0]||_0x2379ce['parentSegment'];if(!_0x420f8d)return console[_0x63650d(0x128)](_0x63650d(0x12b)),console[_0x63650d(0x128)](_0x63650d(0x123)),console[_0x63650d(0x128)](_0x63650d(0x119)),0x1;_0x2379ce[_0x63650d(0x12d)]&&(console[_0x63650d(0x128)]('Site:\x20'+_0x2379ce[_0x63650d(0x11d)]),console[_0x63650d(0x128)]('Parent\x20segment:\x20'+_0x420f8d));const _0x5c7b78=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x420f8d+_0x63650d(0x116),()=>_0x6e14a9['segment'][_0x63650d(0x117)](_0x420f8d),{'verbose':_0x2379ce[_0x63650d(0x12d)]}),_0xa4a3d7=_0x5c7b78[_0x63650d(0x118)];console[_0x63650d(0x128)]('βœ”\x20Found\x20'+_0xa4a3d7['length']+_0x63650d(0x122)+(_0xa4a3d7['length']!==0x1?'s':''));if(_0x2379ce[_0x63650d(0x11e)]||_0x2379ce[_0x63650d(0x11c)])return await handleSDKOutput(_0xa4a3d7,_0x2379ce),0x0;return displayFieldsHumanReadable(_0xa4a3d7,_0x420f8d),0x0;}}
1
+ const a29_0x2b3ff9=a29_0x1407;function a29_0x1407(_0x5515b5,_0x2bb3a9){_0x5515b5=_0x5515b5-0xb8;const _0x3dd09a=a29_0x3dd0();let _0x1407d6=_0x3dd09a[_0x5515b5];return _0x1407d6;}(function(_0x5655ee,_0x43ba6a){const _0x25075=a29_0x1407,_0x347b9b=_0x5655ee();while(!![]){try{const _0x3baa59=parseInt(_0x25075(0xc6))/0x1*(-parseInt(_0x25075(0xc7))/0x2)+-parseInt(_0x25075(0xc3))/0x3+parseInt(_0x25075(0xd0))/0x4+parseInt(_0x25075(0xb9))/0x5+parseInt(_0x25075(0xce))/0x6*(-parseInt(_0x25075(0xca))/0x7)+-parseInt(_0x25075(0xd2))/0x8+parseInt(_0x25075(0xbc))/0x9;if(_0x3baa59===_0x43ba6a)break;else _0x347b9b['push'](_0x347b9b['shift']());}catch(_0x55c7b6){_0x347b9b['push'](_0x347b9b['shift']());}}}(a29_0x3dd0,0x9b84c));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x2b3ff9(0xc8)]=a29_0x2b3ff9(0xbb);[a29_0x2b3ff9(0xcd)]=a29_0x2b3ff9(0xc2);async[a29_0x2b3ff9(0xba)](_0x562c08){const _0x108ba1=a29_0x2b3ff9,{options:_0x215570,args:_0x14ec28,tdx:_0x31302b}=_0x562c08,_0x2826a4=_0x14ec28[0x0]||_0x215570['parentSegment'];if(!_0x2826a4)return console['error'](_0x108ba1(0xc5)),console[_0x108ba1(0xbf)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x108ba1(0xbf)](_0x108ba1(0xc4)),0x1;_0x215570[_0x108ba1(0xcc)]&&(console['error'](_0x108ba1(0xcb)+_0x215570['site']),console[_0x108ba1(0xbf)]('Parent\x20segment:\x20'+_0x2826a4));const _0x2e7b06=await withSpinner(_0x108ba1(0xc9)+_0x2826a4+_0x108ba1(0xcf),()=>_0x31302b[_0x108ba1(0xb8)][_0x108ba1(0xc0)](_0x2826a4),{'verbose':_0x215570[_0x108ba1(0xcc)]}),_0x46c831=_0x2e7b06[_0x108ba1(0xbd)];console[_0x108ba1(0xbf)]('βœ”\x20Found\x20'+_0x46c831['length']+_0x108ba1(0xbe)+(_0x46c831[_0x108ba1(0xc1)]!==0x1?'s':''));if(_0x215570['json']||_0x215570[_0x108ba1(0xd1)])return await handleSDKOutput(_0x46c831,_0x215570),0x0;return displayFieldsHumanReadable(_0x46c831,_0x2826a4),0x0;}}function a29_0x3dd0(){const _0x21d7f7=['7lLovBO','Site:\x20','verbose','description','338154VbRyUP','\x27...','500824htHGuA','jsonl','2911528WEMBEL','segment','2940795PctVbG','execute','segment:fields','3825648xAMHea','data','\x20field','error','listFields','length','List\x20available\x20fields\x20for\x20segmentation','150546UKnbij','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Parent\x20segment\x20name\x20is\x20required','1oTiHGx','61902acveVZ','name','Listing\x20fields\x20for\x20\x27'];a29_0x3dd0=function(){return _0x21d7f7;};return a29_0x3dd0();}
@@ -1 +1 @@
1
- const a30_0x536754=a30_0x53a9;function a30_0x53a9(_0x25351,_0x1c0f5d){_0x25351=_0x25351-0x1c6;const _0x33f6d0=a30_0x33f6();let _0x53a9df=_0x33f6d0[_0x25351];return _0x53a9df;}(function(_0x1d2600,_0x2befd9){const _0x4469fc=a30_0x53a9,_0x1855a5=_0x1d2600();while(!![]){try{const _0x584709=-parseInt(_0x4469fc(0x1d2))/0x1+-parseInt(_0x4469fc(0x1f0))/0x2*(-parseInt(_0x4469fc(0x1d5))/0x3)+-parseInt(_0x4469fc(0x1e8))/0x4+-parseInt(_0x4469fc(0x1e9))/0x5+parseInt(_0x4469fc(0x1f8))/0x6+parseInt(_0x4469fc(0x1d9))/0x7*(-parseInt(_0x4469fc(0x1c8))/0x8)+parseInt(_0x4469fc(0x1e3))/0x9*(parseInt(_0x4469fc(0x1dd))/0xa);if(_0x584709===_0x2befd9)break;else _0x1855a5['push'](_0x1855a5['shift']());}catch(_0x21e009){_0x1855a5['push'](_0x1855a5['shift']());}}}(a30_0x33f6,0xd935b));function a30_0x33f6(){const _0x2fcacd=['736909kQqQEI','\x20with\x20','error','694311tkcbdb','filter','\x20activations','message','175742OlHxqT','setPhase','dirname','isNew','50MHbUFj','description','Pulling\x20segments\x20from\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','verbose','green','4244004EgwlwI','parent_segment','counts','\x20\x20🎯\x20','absolutePath','4110836eFnOen','7916145cNywkF','\x0aError:','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','session','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','14TZxnOL','\x20files\x20to\x20','journeys','parentName','\x0aPull\x20summary\x20for\x20\x27','segments','yes','site','2010102hZLCKp','journeyVersions','segment','Parent\x20segment:\x20','files','relativePath','resourceName','execute','βœ”\x20Context\x20set:\x20','\x20=\x20','repeat','\x20\x20πŸ—ΊοΈ\x20\x20','targetDir','red','\x27...','dryRun','helpText','diff','\x0aChanges\x20to\x20\x27','dim','-\x20no\x20files\x20written','file','yellow','Error:\x20','\x20journeys','activations','\x20files?','Target\x20resource:\x20','24UoHeeO','cyan','length','\x20segments','pullSegments','βœ”\x20Pulled\x20','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)','\x20unchanged\x20files','hasChanges','segment:pull'];a30_0x33f6=function(){return _0x2fcacd;};return a30_0x33f6();}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_0x280b13 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0xb40f93 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_0x536754(0x1d1);[a30_0x536754(0x1de)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a30_0x536754(0x1ff)](_0x17f44f){const _0x3f5921=a30_0x536754,{options:_0x2513f9,args:_0x32cad7,tdx:_0x4d490a}=_0x17f44f,_0x2dca8b=_0x2513f9,_0x14e2a9=await resolveTarget({'arg':_0x32cad7[0x0],'contextParent':_0x2513f9['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x14e2a9))return _0x14e2a9['errorCode']==='no_parent'?(console[_0x3f5921(0x1d4)](a30_0x280b13['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3f5921(0x1ce)),console[_0x3f5921(0x1d4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x3f5921(0x1d4)](_0x3f5921(0x1ee))):(console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x205)](_0x3f5921(0x20f)+_0x14e2a9[_0x3f5921(0x1d8)]+'\x0a')),_0x14e2a9[_0x3f5921(0x208)]&&console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x1c9)](_0x14e2a9[_0x3f5921(0x208)]))),0x1;const _0x2b97f2=_0x14e2a9['parentName'],_0x251a9c=_0x14e2a9['targetDir'],_0x481d56=_0x14e2a9['type']===_0x3f5921(0x20d)?_0x14e2a9[_0x3f5921(0x1fe)]:undefined;_0x2dca8b[_0x3f5921(0x1e1)]&&(console['error']('Site:\x20'+_0x2dca8b[_0x3f5921(0x1f7)]),console[_0x3f5921(0x1d4)](_0x3f5921(0x1fb)+_0x2b97f2),_0x481d56&&console[_0x3f5921(0x1d4)](_0x3f5921(0x1c7)+_0x481d56));const _0x693446=await withProgressSpinner(_0x3f5921(0x1df)+_0x2b97f2+_0x3f5921(0x206),_0x34675d=>_0x4d490a[_0x3f5921(0x1fa)][_0x3f5921(0x1cc)](_0x2b97f2,{'targetDir':_0x251a9c,'targetResourceName':_0x481d56,'verbose':_0x2dca8b['verbose'],'progress':{'update':_0xa782be=>{const _0x4faa41=_0x3f5921;_0x34675d[_0x4faa41(0x1da)](_0xa782be),_0x2dca8b['verbose']&&console['error']('\x20\x20'+_0xa782be);}}}),{'verbose':_0x2dca8b[_0x3f5921(0x1e1)]}),_0xa6cad7=_0x693446[_0x3f5921(0x1ed)];if(_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x1f5)]===0x0&&_0xa6cad7[_0x3f5921(0x1e5)]['journeys']===0x0)return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x20e)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0xa6cad7['parentName']+'\x27')),0x0;const _0x12bdb5=_0xa6cad7[_0x3f5921(0x1fc)][_0x3f5921(0x1d6)](_0x146840=>_0x146840['isNew']),_0x1596fd=_0xa6cad7[_0x3f5921(0x1fc)]['filter'](_0x239931=>!_0x239931[_0x3f5921(0x1dc)]&&_0x239931[_0x3f5921(0x1d0)]),_0x5dc7f7=_0xa6cad7[_0x3f5921(0x1fc)][_0x3f5921(0x1d6)](_0x4a0b9e=>!_0x4a0b9e[_0x3f5921(0x1dc)]&&!_0x4a0b9e[_0x3f5921(0x1d0)]);console[_0x3f5921(0x1d4)](_0x3f5921(0x1f4)+_0xa6cad7[_0x3f5921(0x1f3)]+'\x27:'),console[_0x3f5921(0x1d4)](_0x3f5921(0x1e6)+a30_0x280b13['cyan'](_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x1f5)]+_0x3f5921(0x1cb))+_0x3f5921(0x1d3)+a30_0x280b13['cyan'](_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x211)]+_0x3f5921(0x1d7)));if(_0xa6cad7[_0x3f5921(0x1e5)]['journeys']>0x0){const _0x23eb44=_0xa6cad7['counts'][_0x3f5921(0x1f9)]>_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x1f2)]?'\x20('+_0xa6cad7['counts']['journeyVersions']+'\x20versions)':'';console[_0x3f5921(0x1d4)](_0x3f5921(0x203)+a30_0x280b13[_0x3f5921(0x1c9)](_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x1f2)]+_0x3f5921(0x210))+a30_0x280b13[_0x3f5921(0x20b)](_0x23eb44));}console[_0x3f5921(0x1d4)]('\x20\x20'+a30_0x280b13[_0x3f5921(0x1e2)]('+\x20'+_0x12bdb5['length']+'\x20new\x20files')),console[_0x3f5921(0x1d4)]('\x20\x20'+a30_0x280b13[_0x3f5921(0x20e)]('~\x20'+_0x1596fd[_0x3f5921(0x1ca)]+'\x20changed\x20files')),console[_0x3f5921(0x1d4)]('\x20\x20'+a30_0x280b13['dim']('=\x20'+_0x5dc7f7[_0x3f5921(0x1ca)]+_0x3f5921(0x1cf))),console[_0x3f5921(0x1d4)]('\x20\x20Target:\x20'+a30_0x280b13['cyan'](_0xa6cad7[_0x3f5921(0x204)])+'\x0a');if(_0x1596fd['length']>0x0)for(const _0x24bcea of _0x1596fd){console[_0x3f5921(0x1d4)](_0x3f5921(0x20a)+_0x24bcea[_0x3f5921(0x1fd)]+'\x27:'),console['error']('─'[_0x3f5921(0x202)](0x3c)),console[_0x3f5921(0x1d4)](_0x24bcea[_0x3f5921(0x209)]),console[_0x3f5921(0x1d4)]('─'[_0x3f5921(0x202)](0x3c));}if(_0x2dca8b[_0x3f5921(0x207)])return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x20e)](_0x3f5921(0x1e0))),0x0;if(_0x12bdb5[_0x3f5921(0x1ca)]===0x0&&_0x1596fd['length']===0x0)return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x1e2)](_0x3f5921(0x1eb))),saveSessionContext({'parent_segment':_0xa6cad7[_0x3f5921(0x1f3)]},_0x2dca8b[_0x3f5921(0x1ec)]),console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x1e2)](_0x3f5921(0x200)+a30_0x280b13[_0x3f5921(0x20b)](_0x3f5921(0x1e4))+_0x3f5921(0x201)+a30_0x280b13['cyan'](_0xa6cad7[_0x3f5921(0x1f3)]))),0x0;if(!_0x2dca8b[_0x3f5921(0x1f6)]){if(!isInteractive())return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x205)](_0x3f5921(0x1ea)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x20b)](_0x3f5921(0x1ef))),0x1;const _0x12b89c=await confirmKey('Write\x20'+(_0x12bdb5[_0x3f5921(0x1ca)]+_0x1596fd[_0x3f5921(0x1ca)])+_0x3f5921(0x1c6));if(!_0x12b89c)return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x20e)]('Aborted.'),_0x3f5921(0x20c)),0x1;}for(const _0x3082c9 of _0xa6cad7[_0x3f5921(0x1fc)]){if(_0x3082c9[_0x3f5921(0x1dc)]||_0x3082c9[_0x3f5921(0x1d0)]){const _0x555858=a30_0xb40f93[_0x3f5921(0x1db)](_0x3082c9[_0x3f5921(0x1e7)]);!existsSync(_0x555858)&&mkdirSync(_0x555858,{'recursive':!![]}),writeFileSync(_0x3082c9['absolutePath'],_0x3082c9['content'],'utf-8');}}return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x1e2)](_0x3f5921(0x1cd)+(_0x12bdb5[_0x3f5921(0x1ca)]+_0x1596fd[_0x3f5921(0x1ca)])+_0x3f5921(0x1f1)+_0xa6cad7[_0x3f5921(0x204)])),saveSessionContext({'parent_segment':_0xa6cad7[_0x3f5921(0x1f3)]},_0x2dca8b[_0x3f5921(0x1ec)]),console[_0x3f5921(0x1d4)](a30_0x280b13['green'](_0x3f5921(0x200)+a30_0x280b13['dim'](_0x3f5921(0x1e4))+_0x3f5921(0x201)+a30_0x280b13[_0x3f5921(0x1c9)](_0xa6cad7[_0x3f5921(0x1f3)]))),0x0;}}
1
+ const a30_0x29e0df=a30_0x5c4c;(function(_0x4e3bfc,_0x59e737){const _0x51edff=a30_0x5c4c,_0x223d41=_0x4e3bfc();while(!![]){try{const _0x132472=-parseInt(_0x51edff(0x137))/0x1*(parseInt(_0x51edff(0x125))/0x2)+parseInt(_0x51edff(0x11a))/0x3*(-parseInt(_0x51edff(0x154))/0x4)+parseInt(_0x51edff(0x15c))/0x5+-parseInt(_0x51edff(0x129))/0x6+-parseInt(_0x51edff(0x14a))/0x7+parseInt(_0x51edff(0x143))/0x8+parseInt(_0x51edff(0x14b))/0x9;if(_0x132472===_0x59e737)break;else _0x223d41['push'](_0x223d41['shift']());}catch(_0xba1777){_0x223d41['push'](_0x223d41['shift']());}}}(a30_0x344a,0xbb54d));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a30_0x5c4c(_0x3b69b2,_0x3569ac){_0x3b69b2=_0x3b69b2-0x113;const _0x344a79=a30_0x344a();let _0x5c4c33=_0x344a79[_0x3b69b2];return _0x5c4c33;}import a30_0x449662 from'chalk';function a30_0x344a(){const _0x207aa7=['description','isNew','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20=\x20','7625660aCDesr','34063155uplAxB','Parent\x20segment:\x20','journeyVersions','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','site','journeys','counts','\x20unchanged\x20files','dryRun','4kBMvgz','\x20journeys','parentName','segments','Target\x20resource:\x20','no_parent','hasChanges','yellow','62775esFAlU','\x20\x20Target:\x20','pullSegments','red','name','segment','\x20\x20🎯\x20','Write\x20','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','activations','content','\x20files?','setPhase','4326522aArEkm','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','error','\x27...','dim','verbose','execute','length','\x20with\x20','parent_segment','Error:\x20','395216JwMQLp','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20segments','files','1136898zMjmpo','βœ”\x20Pulled\x20','green','Aborted.','\x0aChanges\x20to\x20\x27','\x20versions)','helpText','repeat','resourceName','relativePath','utf-8','Pulling\x20segments\x20from\x20\x27','-\x20no\x20files\x20written','parentSegment','4zViXbq','diff','data','segment:pull','\x20changed\x20files','cyan','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','filter','βœ”\x20Context\x20set:\x20','dirname','\x20activations','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','3851424EkyaUR','Site:\x20','cwd'];a30_0x344a=function(){return _0x207aa7;};return a30_0x344a();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x239c5e 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_0x29e0df(0x160)]=a30_0x29e0df(0x13a);[a30_0x29e0df(0x146)]=a30_0x29e0df(0x14e);async[a30_0x29e0df(0x120)](_0x563a83){const _0x1da58a=a30_0x29e0df,{options:_0x3a5c2c,args:_0x31bc66,tdx:_0x28e92d}=_0x563a83,_0x3e3a0d=_0x3a5c2c,_0x362248=await resolveTarget({'arg':_0x31bc66[0x0],'contextParent':_0x3a5c2c[_0x1da58a(0x136)],'cwd':process[_0x1da58a(0x145)]()});if(!isSuccessfulResolution(_0x362248))return _0x362248['errorCode']===_0x1da58a(0x159)?(console['error'](a30_0x449662['yellow'](_0x1da58a(0x13d))),console[_0x1da58a(0x11c)](_0x1da58a(0x148)),console[_0x1da58a(0x11c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x1da58a(0x11c)](_0x1da58a(0x126))):(console[_0x1da58a(0x11c)](a30_0x449662[_0x1da58a(0x15f)](_0x1da58a(0x124)+_0x362248['message']+'\x0a')),_0x362248[_0x1da58a(0x12f)]&&console[_0x1da58a(0x11c)](a30_0x449662[_0x1da58a(0x13c)](_0x362248['helpText']))),0x1;const _0x2fd923=_0x362248[_0x1da58a(0x156)],_0x8ad089=_0x362248['targetDir'],_0x392885=_0x362248['type']==='file'?_0x362248[_0x1da58a(0x131)]:undefined;_0x3e3a0d[_0x1da58a(0x11f)]&&(console[_0x1da58a(0x11c)](_0x1da58a(0x144)+_0x3e3a0d[_0x1da58a(0x14f)]),console[_0x1da58a(0x11c)](_0x1da58a(0x14c)+_0x2fd923),_0x392885&&console['error'](_0x1da58a(0x158)+_0x392885));const _0x42f347=await withProgressSpinner(_0x1da58a(0x134)+_0x2fd923+_0x1da58a(0x11d),_0x3088d3=>_0x28e92d[_0x1da58a(0x161)][_0x1da58a(0x15e)](_0x2fd923,{'targetDir':_0x8ad089,'targetResourceName':_0x392885,'verbose':_0x3e3a0d[_0x1da58a(0x11f)],'progress':{'update':_0x39214c=>{const _0x73f225=_0x1da58a;_0x3088d3[_0x73f225(0x119)](_0x39214c),_0x3e3a0d['verbose']&&console[_0x73f225(0x11c)]('\x20\x20'+_0x39214c);}}}),{'verbose':_0x3e3a0d['verbose']}),_0xac35a2=_0x42f347[_0x1da58a(0x139)];if(_0xac35a2['counts'][_0x1da58a(0x157)]===0x0&&_0xac35a2['counts'][_0x1da58a(0x150)]===0x0)return console[_0x1da58a(0x11c)](a30_0x449662[_0x1da58a(0x15b)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0xac35a2[_0x1da58a(0x156)]+'\x27')),0x0;const _0x1f599f=_0xac35a2[_0x1da58a(0x128)]['filter'](_0x1d850b=>_0x1d850b[_0x1da58a(0x147)]),_0x47135f=_0xac35a2[_0x1da58a(0x128)]['filter'](_0x3fcfb9=>!_0x3fcfb9[_0x1da58a(0x147)]&&_0x3fcfb9[_0x1da58a(0x15a)]),_0x516f98=_0xac35a2['files'][_0x1da58a(0x13e)](_0x206d50=>!_0x206d50[_0x1da58a(0x147)]&&!_0x206d50[_0x1da58a(0x15a)]);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0xac35a2[_0x1da58a(0x156)]+'\x27:'),console[_0x1da58a(0x11c)](_0x1da58a(0x113)+a30_0x449662[_0x1da58a(0x13c)](_0xac35a2['counts'][_0x1da58a(0x157)]+_0x1da58a(0x127))+_0x1da58a(0x122)+a30_0x449662[_0x1da58a(0x13c)](_0xac35a2[_0x1da58a(0x151)][_0x1da58a(0x116)]+_0x1da58a(0x141)));if(_0xac35a2[_0x1da58a(0x151)][_0x1da58a(0x150)]>0x0){const _0x4f693c=_0xac35a2[_0x1da58a(0x151)][_0x1da58a(0x14d)]>_0xac35a2['counts']['journeys']?'\x20('+_0xac35a2['counts'][_0x1da58a(0x14d)]+_0x1da58a(0x12e):'';console['error']('\x20\x20πŸ—ΊοΈ\x20\x20'+a30_0x449662['cyan'](_0xac35a2[_0x1da58a(0x151)][_0x1da58a(0x150)]+_0x1da58a(0x155))+a30_0x449662[_0x1da58a(0x11e)](_0x4f693c));}console[_0x1da58a(0x11c)]('\x20\x20'+a30_0x449662['green']('+\x20'+_0x1f599f['length']+'\x20new\x20files')),console[_0x1da58a(0x11c)]('\x20\x20'+a30_0x449662[_0x1da58a(0x15b)]('~\x20'+_0x47135f[_0x1da58a(0x121)]+_0x1da58a(0x13b))),console[_0x1da58a(0x11c)]('\x20\x20'+a30_0x449662[_0x1da58a(0x11e)]('=\x20'+_0x516f98['length']+_0x1da58a(0x152))),console[_0x1da58a(0x11c)](_0x1da58a(0x15d)+a30_0x449662[_0x1da58a(0x13c)](_0xac35a2['targetDir'])+'\x0a');if(_0x47135f[_0x1da58a(0x121)]>0x0)for(const _0x1cf750 of _0x47135f){console[_0x1da58a(0x11c)](_0x1da58a(0x12d)+_0x1cf750[_0x1da58a(0x132)]+'\x27:'),console[_0x1da58a(0x11c)]('─'[_0x1da58a(0x130)](0x3c)),console[_0x1da58a(0x11c)](_0x1cf750[_0x1da58a(0x138)]),console[_0x1da58a(0x11c)]('─'[_0x1da58a(0x130)](0x3c));}if(_0x3e3a0d[_0x1da58a(0x153)])return console[_0x1da58a(0x11c)](a30_0x449662['yellow'](_0x1da58a(0x142))),0x0;if(_0x1f599f[_0x1da58a(0x121)]===0x0&&_0x47135f[_0x1da58a(0x121)]===0x0)return console['error'](a30_0x449662[_0x1da58a(0x12b)](_0x1da58a(0x115))),saveSessionContext({'parent_segment':_0xac35a2['parentName']},_0x3e3a0d['session']),console[_0x1da58a(0x11c)](a30_0x449662[_0x1da58a(0x12b)](_0x1da58a(0x13f)+a30_0x449662[_0x1da58a(0x11e)](_0x1da58a(0x123))+_0x1da58a(0x149)+a30_0x449662[_0x1da58a(0x13c)](_0xac35a2[_0x1da58a(0x156)]))),0x0;if(!_0x3e3a0d['yes']){if(!isInteractive())return console[_0x1da58a(0x11c)](a30_0x449662[_0x1da58a(0x15f)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1da58a(0x11c)](a30_0x449662[_0x1da58a(0x11e)](_0x1da58a(0x11b))),0x1;const _0x3b4625=await confirmKey(_0x1da58a(0x114)+(_0x1f599f[_0x1da58a(0x121)]+_0x47135f[_0x1da58a(0x121)])+_0x1da58a(0x118));if(!_0x3b4625)return console[_0x1da58a(0x11c)](a30_0x449662[_0x1da58a(0x15b)](_0x1da58a(0x12c)),_0x1da58a(0x135)),0x1;}for(const _0x6e61f8 of _0xac35a2['files']){if(_0x6e61f8[_0x1da58a(0x147)]||_0x6e61f8['hasChanges']){const _0x2aa73d=a30_0x239c5e[_0x1da58a(0x140)](_0x6e61f8['absolutePath']);!existsSync(_0x2aa73d)&&mkdirSync(_0x2aa73d,{'recursive':!![]}),writeFileSync(_0x6e61f8['absolutePath'],_0x6e61f8[_0x1da58a(0x117)],_0x1da58a(0x133));}}return console[_0x1da58a(0x11c)](a30_0x449662[_0x1da58a(0x12b)](_0x1da58a(0x12a)+(_0x1f599f[_0x1da58a(0x121)]+_0x47135f[_0x1da58a(0x121)])+'\x20files\x20to\x20'+_0xac35a2['targetDir'])),saveSessionContext({'parent_segment':_0xac35a2[_0x1da58a(0x156)]},_0x3e3a0d['session']),console[_0x1da58a(0x11c)](a30_0x449662[_0x1da58a(0x12b)]('βœ”\x20Context\x20set:\x20'+a30_0x449662[_0x1da58a(0x11e)](_0x1da58a(0x123))+_0x1da58a(0x149)+a30_0x449662[_0x1da58a(0x13c)](_0xac35a2['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a31_0x3e7923=a31_0x316c;function a31_0x316c(_0x225de5,_0x7ca5fb){_0x225de5=_0x225de5-0x1ed;const _0x2c5497=a31_0x2c54();let _0x316cbd=_0x2c5497[_0x225de5];return _0x316cbd;}(function(_0x3df46c,_0x166ee2){const _0xc4e248=a31_0x316c,_0x54e556=_0x3df46c();while(!![]){try{const _0x5ce538=parseInt(_0xc4e248(0x23c))/0x1*(-parseInt(_0xc4e248(0x223))/0x2)+parseInt(_0xc4e248(0x273))/0x3+parseInt(_0xc4e248(0x268))/0x4+-parseInt(_0xc4e248(0x229))/0x5+-parseInt(_0xc4e248(0x236))/0x6+-parseInt(_0xc4e248(0x261))/0x7*(-parseInt(_0xc4e248(0x21d))/0x8)+-parseInt(_0xc4e248(0x230))/0x9;if(_0x5ce538===_0x166ee2)break;else _0x54e556['push'](_0x54e556['shift']());}catch(_0x35e64d){_0x54e556['push'](_0x54e556['shift']());}}}(a31_0x2c54,0x8fb59));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_0x790da0 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a31_0x2c54(){const _0x442a35=['isNew','\x20changes?','\x20deleted','updated','journey','.yaml','setPhase','delete','folderId','activations','then','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','segmentFolderId','updatedAt','\x0aError:','segment','filter','site','cwd','errorCode','listSegments','segment:push','Fetching\x20existing\x20folders...','folderPath','Delete\x20journey:','new','helpText','\x0aβœ”\x20Push\x20complete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Resolving\x20parent\x20segment\x20\x27','push','\x20to\x20update','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','yamlConfig','/j/da/je','toUpdate','\x20\x20Source:\x20','Error\x20parsing\x20YAML:\x20','cyan','verbose','journeyId','Error:\x20','name','getParent','2146264hwHqQI','existingJourney','add','dim','createdSegmentIds','message','326iUIsAf','red','Fetching\x20existing\x20segments...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','get','idToName','1207255BHrDOZ','created','nameToType','user','journeys','parent_name','diff','1507941GBRXKT','Changes\x20to:','\x20\x20Journeys:\x20','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','segments','state','1121196jzVhbM','\x20YAML\x20files\x20found','toDelete','buildUserMaps','\x20\x20\x20\x20','\x20folders\x20to\x20create','4162sNnXlD','/e/','targetDir','connection','Push\x20','No\x20','\x20to\x20delete','all','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','blue','Changes\x20to\x20journey:','isScoped','\x0aPush\x20summary\x20for\x20\x27','map','yes','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20changed','join','Source\x20directory:\x20','deleted','\x20\x20Activations:\x20','repeat','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Folders\x20to\x20create:','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20Segments:\x20','toCreate','.yml','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x27...','endsWith','changed','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','nameToId','length','Fetching\x20existing\x20activations...','21roYEDA','\x20unchanged','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20users\x20for\x20email\x20resolution...','parentSegment','versionNumber','2946104imcUYp','journeysOnly','\x20activations]','\x0aValidation\x20failed:','Preparing\x20journeys...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','toString','Scoped\x20to\x20folder:\x20','parentName','journeyBundleName','/app/ps/','964590jwArwY','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)','attributes','listFolders','results','New\x20journey:','listActivations','type','set','\x20to\x20create','audienceId','Delete\x20segment:','green','scopedFolderPath','Aborted.','\x20created','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yellow','Fetching\x20parent\x20segment\x20details...','createdAt','\x20new','filePath','journeyBundleId','dryRun','list','data','error','getJourney','execute','New\x20segment:','no_parent'];a31_0x2c54=function(){return _0x442a35;};return a31_0x2c54();}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{[a31_0x3e7923(0x21b)]=a31_0x3e7923(0x206);['description']=a31_0x3e7923(0x252);async[a31_0x3e7923(0x1ee)](_0x4488ea){const _0x49bb6c=a31_0x3e7923,{options:_0x3f5f94,args:_0x47d877,tdx:_0x1bb87a}=_0x4488ea,_0x342908=_0x3f5f94,_0x143246=await resolveTarget({'arg':_0x47d877[0x0],'contextParent':_0x3f5f94[_0x49bb6c(0x266)],'cwd':process[_0x49bb6c(0x203)]()});if(!isSuccessfulResolution(_0x143246))return _0x143246[_0x49bb6c(0x204)]===_0x49bb6c(0x1f0)?(console['error'](a31_0x790da0['yellow'](_0x49bb6c(0x244))),console[_0x49bb6c(0x28d)](_0x49bb6c(0x274)),console[_0x49bb6c(0x28d)](_0x49bb6c(0x26d)),console[_0x49bb6c(0x28d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x21a)+_0x143246[_0x49bb6c(0x222)]+'\x0a')),_0x143246[_0x49bb6c(0x20b)]&&console['error'](a31_0x790da0[_0x49bb6c(0x217)](_0x143246[_0x49bb6c(0x20b)]))),0x1;if(_0x143246[_0x49bb6c(0x27a)]===_0x49bb6c(0x22e))return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x264)+_0x143246[_0x49bb6c(0x23e)]+'\x0a')),console['error'](a31_0x790da0[_0x49bb6c(0x217)](_0x49bb6c(0x20d))),0x1;const _0x1245c9=_0x143246[_0x49bb6c(0x270)],_0x3805f2=_0x143246['targetDir'],_0x320faa=_0x143246[_0x49bb6c(0x27a)]==='file'?_0x143246[_0x49bb6c(0x288)]:undefined,_0x17b599=getScopedDetails(_0x143246),_0x1f2507=_0x17b599?.[_0x49bb6c(0x247)]??![],_0x5cecaa=_0x17b599?.[_0x49bb6c(0x280)]??'';if(!existsSync(_0x3805f2))return console['error'](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x264)+_0x3805f2+'\x0a')),console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x217)](_0x49bb6c(0x20d))),0x1;_0x342908[_0x49bb6c(0x218)]&&(console[_0x49bb6c(0x28d)]('Site:\x20'+_0x342908[_0x49bb6c(0x202)]),console[_0x49bb6c(0x28d)]('Parent\x20segment:\x20'+_0x1245c9),console[_0x49bb6c(0x28d)](_0x49bb6c(0x24e)+_0x3805f2),_0x1f2507&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x26f)+_0x5cecaa));const _0x306f23=await withSpinner(_0x49bb6c(0x20e)+_0x1245c9+_0x49bb6c(0x259),()=>_0x1bb87a[_0x49bb6c(0x200)]['resolveParentId'](_0x1245c9),{'verbose':_0x342908[_0x49bb6c(0x218)]}),_0x189b3e=_0x306f23[_0x49bb6c(0x28c)],[_0x4f14de,_0x4c524d,_0x445900,_0x444c63,_0x125f63]=await Promise[_0x49bb6c(0x243)]([withSpinner(_0x49bb6c(0x285),()=>_0x1bb87a[_0x49bb6c(0x200)][_0x49bb6c(0x21c)](_0x189b3e),{'verbose':_0x342908[_0x49bb6c(0x218)]}),withSpinner(_0x49bb6c(0x225),()=>_0x1bb87a[_0x49bb6c(0x200)][_0x49bb6c(0x205)](_0x189b3e),{'verbose':_0x342908[_0x49bb6c(0x218)]}),withSpinner(_0x49bb6c(0x207),()=>_0x1bb87a['segment'][_0x49bb6c(0x276)](_0x189b3e),{'verbose':_0x342908[_0x49bb6c(0x218)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x1bb87a['journey']['listJourneysWithDetailsFromParentSegment'](_0x189b3e,{'includeAllVersions':!![]}),{'verbose':_0x342908[_0x49bb6c(0x218)]}),withSpinner(_0x49bb6c(0x265),()=>_0x1bb87a[_0x49bb6c(0x22c)][_0x49bb6c(0x239)](),{'verbose':_0x342908[_0x49bb6c(0x218)]})['then'](_0x21a4b6=>_0x21a4b6[_0x49bb6c(0x28c)])]),_0x1e2ea9=_0x4f14de[_0x49bb6c(0x28c)],_0x53c20d=extractRootFolderId(_0x1e2ea9),_0x44a7da=_0x4c524d[_0x49bb6c(0x28c)],_0x29b5c9=_0x445900[_0x49bb6c(0x28c)],{journeys:_0x2bc923,activationStepsById:_0x4483dd}=_0x444c63[_0x49bb6c(0x28c)],_0x5e0623=new Map(_0x2bc923[_0x49bb6c(0x249)](_0x550bcb=>[_0x550bcb['id'],_0x550bcb])),_0x5e4807=_0x2bc923['map'](_0x3a4d91=>({'id':_0x3a4d91['id'],'name':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x21b)],'journeyBundleName':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x271)]||'','journeyBundleId':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x289)]||'','versionNumber':_0x3a4d91['attributes'][_0x49bb6c(0x267)],'description':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x25c)],'state':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x235)],'paused':_0x3a4d91['attributes']['paused'],'audienceId':_0x3a4d91['attributes'][_0x49bb6c(0x27d)],'folderId':_0x3a4d91['relationships']?.['parentFolder']?.[_0x49bb6c(0x28c)]?.['id'],'createdAt':_0x3a4d91['attributes'][_0x49bb6c(0x286)],'updatedAt':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x1fe)]})),{emailToId:_0x3fb433,idToEmail:_0xaccaab}=_0x125f63,_0x13195e=await withSpinner(_0x49bb6c(0x254),async()=>{const _0x8c8454=_0x49bb6c,_0x4c3f31=await _0x1bb87a[_0x8c8454(0x23f)][_0x8c8454(0x28b)]();return buildConnectionMaps(_0x4c3f31);},{'verbose':_0x342908[_0x49bb6c(0x218)]})[_0x49bb6c(0x1fb)](_0x1c80b1=>_0x1c80b1[_0x49bb6c(0x28c)]),_0x5aa211=_0x13195e[_0x49bb6c(0x25e)],_0x34bc3e=_0x13195e[_0x49bb6c(0x228)],_0x299999=_0x13195e[_0x49bb6c(0x22b)],_0x1cadb1={'emailToIdMap':_0x3fb433,'connectionNameToIdMap':_0x5aa211,'connectionNameToTypeMap':_0x299999,'getSchema':_0x5a5bc1=>_0x1bb87a[_0x49bb6c(0x23f)]['getOutputSchemaWithCache'](_0x5a5bc1)};let {pathToId:_0x1ca34b,idToPath:_0x4481e6}=buildFolderMaps(_0x29b5c9);const _0x3d2eda=buildSegmentLookupMap(_0x44a7da,_0x4481e6),_0x11d641=buildSegmentNameToIdMap(_0x44a7da),_0x222133=buildJourneyBundleLookupMap(_0x5e4807,_0x4481e6);let _0x66f4fd;if(_0x320faa){if(!_0x320faa['endsWith'](_0x49bb6c(0x257))&&!_0x320faa[_0x49bb6c(0x25a)](_0x49bb6c(0x1f6)))return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x283)+_0x320faa+'\x0a')),0x1;_0x66f4fd=[_0x320faa];}else _0x66f4fd=findYamlFiles(_0x3805f2);if(_0x66f4fd[_0x49bb6c(0x25f)]===0x0)return console['error'](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x25d)+_0x3805f2+'\x0a')),console['error'](a31_0x790da0[_0x49bb6c(0x217)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x4be9e4,_0x1c52b4;try{const _0x2caee1=parseAndClassifyYamlFiles(_0x66f4fd,_0x3805f2,{'skipSegments':_0x342908[_0x49bb6c(0x269)]});_0x4be9e4=_0x2caee1[_0x49bb6c(0x234)],_0x1c52b4=_0x2caee1['journeys'];const _0x37a297=validateParsedFiles(_0x2caee1,_0x3805f2);if(_0x37a297[_0x49bb6c(0x25f)]>0x0)return console['error'](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x26b))),console[_0x49bb6c(0x28d)](formatValidationErrors(_0x37a297)),console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x1fc))),0x1;}catch(_0x39f4d2){return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x216)+(_0x39f4d2 instanceof Error?_0x39f4d2[_0x49bb6c(0x222)]:_0x39f4d2))),0x1;}if(_0x4be9e4[_0x49bb6c(0x25f)]===0x0&&_0x1c52b4[_0x49bb6c(0x25f)]===0x0){const _0x41262a=_0x342908[_0x49bb6c(0x269)]?_0x49bb6c(0x1f5):'segment\x20or\x20journey';return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x241)+_0x41262a+_0x49bb6c(0x237))),0x0;}const _0x33fe7b=new Map();_0x44a7da['length']>0x0&&!_0x342908[_0x49bb6c(0x269)]&&await withSpinner(_0x49bb6c(0x260),async()=>{await batchAsync(_0x44a7da,async _0x191714=>{const _0x282d0b=a31_0x316c,_0x301b64=await _0x1bb87a[_0x282d0b(0x200)][_0x282d0b(0x279)](_0x189b3e,_0x191714['id']);_0x33fe7b[_0x282d0b(0x27b)](_0x191714['id'],_0x301b64);});},{'verbose':_0x342908['verbose']});const {segmentFiles:_0x50401a,foldersToCreate:_0x1ce0d1}=await prepareSegmentFiles(_0x4be9e4,{'segmentByFolderAndName':_0x3d2eda,'activationsBySegmentId':_0x33fe7b,'folderPathToId':_0x1ca34b,'idToEmailMap':_0xaccaab,'connectionIdToNameMap':_0x34bc3e},_0x1cadb1,_0x1f2507,_0x5cecaa),_0x19fcad=_0x320faa?[]:findSegmentsToDelete(_0x44a7da,_0x4be9e4[_0x49bb6c(0x249)](({yamlConfig:_0x31be6c,folderPath:_0xe27859})=>({'yamlConfig':_0x31be6c,'folderPath':resolveTDFolderPath(_0xe27859,_0x1f2507,_0x5cecaa)})),_0x4481e6,_0x5cecaa,_0x1f2507),{journeyFiles:_0x2a7fa4,foldersToCreate:_0x26a619}=await withProgressSpinner(_0x49bb6c(0x26c),async _0x52c6ac=>prepareJourneyFiles(_0x1c52b4,{'fetchJourney':async _0x5a83f1=>_0x1bb87a['journey'][_0x49bb6c(0x1ed)](_0x5a83f1[_0x49bb6c(0x219)]),'journeyBundlesByFolderAndName':_0x222133,'folderPathToId':_0x1ca34b,'idToEmailMap':_0xaccaab,'connectionIdToNameMap':_0x34bc3e,'existingSegments':_0x44a7da,'parentId':_0x189b3e,'deps':_0x1bb87a,'progress':{'update':_0x511c39=>{const _0x5e3a61=_0x49bb6c;_0x52c6ac[_0x5e3a61(0x1f7)](_0x511c39),_0x342908[_0x5e3a61(0x218)]&&console[_0x5e3a61(0x28d)]('\x20\x20'+_0x511c39);}},'journeyById':_0x5e0623,'activationStepsById':_0x4483dd},_0x1f2507,_0x5cecaa),{'verbose':_0x342908['verbose']})[_0x49bb6c(0x1fb)](_0x4aa476=>_0x4aa476[_0x49bb6c(0x28c)]);for(const _0x55daa1 of _0x26a619){_0x1ce0d1[_0x49bb6c(0x21f)](_0x55daa1);}const _0x55c4f3=_0x320faa?[]:findJourneysToDelete(_0x5e4807,_0x1c52b4['map'](({yamlConfig:_0x1207b2,folderPath:_0x138dc9})=>({'yamlConfig':_0x1207b2,'folderPath':resolveTDFolderPath(_0x138dc9,_0x1f2507,_0x5cecaa)})),_0x4481e6,_0x5cecaa,_0x1f2507),_0x3899fb=calculatePushStats(_0x50401a,_0x2a7fa4,_0x1ce0d1,_0x19fcad,_0x55c4f3,!!_0x342908[_0x49bb6c(0x1f8)],!!_0x342908[_0x49bb6c(0x269)]),_0x4357fc=_0x3899fb['segments'][_0x49bb6c(0x20a)],_0x5ac274=_0x3899fb[_0x49bb6c(0x234)][_0x49bb6c(0x25b)],_0x21f273=_0x3899fb[_0x49bb6c(0x234)]['unchanged'],_0x3d79de=_0x3899fb[_0x49bb6c(0x234)][_0x49bb6c(0x238)],_0x1793cb=_0x3899fb['folders'][_0x49bb6c(0x256)],_0x1670b0=_0x3899fb[_0x49bb6c(0x22d)][_0x49bb6c(0x20a)],_0x4fa355=_0x3899fb[_0x49bb6c(0x22d)][_0x49bb6c(0x25b)],_0xfafad4=_0x3899fb['journeys']['unchanged'],_0x301ca5=_0x3899fb['journeys'][_0x49bb6c(0x238)],_0xd8e364=_0x3899fb[_0x49bb6c(0x1fa)]['all'],_0x35a3a9=_0x3899fb[_0x49bb6c(0x1fa)][_0x49bb6c(0x256)],_0x473e9d=_0x3899fb[_0x49bb6c(0x1fa)][_0x49bb6c(0x214)],_0x3f3490=_0x3899fb[_0x49bb6c(0x1fa)][_0x49bb6c(0x238)];console['error'](_0x49bb6c(0x248)+_0x1245c9+'\x27:');_0x1793cb['length']>0x0&&console['error']('\x20\x20'+a31_0x790da0[_0x49bb6c(0x245)]('πŸ“\x20'+_0x1793cb[_0x49bb6c(0x25f)]+_0x49bb6c(0x23b)));if(!_0x342908['journeysOnly']){console[_0x49bb6c(0x28d)]('\x20\x20πŸ“Š\x20Segments:'),console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x27f)]('+\x20'+_0x4357fc[_0x49bb6c(0x25f)]+_0x49bb6c(0x287))),console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x284)]('~\x20'+_0x5ac274[_0x49bb6c(0x25f)]+_0x49bb6c(0x24c)));if(_0x3d79de[_0x49bb6c(0x25f)]>0x0)console[_0x49bb6c(0x28d)]('\x20\x20\x20\x20'+a31_0x790da0['red']('-\x20'+_0x3d79de[_0x49bb6c(0x25f)]+_0x49bb6c(0x242)));else _0x19fcad[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x1f8)]&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x220)](_0x19fcad[_0x49bb6c(0x25f)]+_0x49bb6c(0x211)));console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x220)]('=\x20'+_0x21f273[_0x49bb6c(0x25f)]+_0x49bb6c(0x262)));}if(_0x2a7fa4[_0x49bb6c(0x25f)]>0x0||_0x55c4f3['length']>0x0){console[_0x49bb6c(0x28d)](_0x49bb6c(0x233)),console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x27f)]('+\x20'+_0x1670b0[_0x49bb6c(0x25f)]+_0x49bb6c(0x287))),console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0['yellow']('~\x20'+_0x4fa355[_0x49bb6c(0x25f)]+_0x49bb6c(0x24c)));if(_0x301ca5[_0x49bb6c(0x25f)]>0x0)console[_0x49bb6c(0x28d)]('\x20\x20\x20\x20'+a31_0x790da0[_0x49bb6c(0x224)]('-\x20'+_0x301ca5[_0x49bb6c(0x25f)]+_0x49bb6c(0x242)));else _0x55c4f3[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x1f8)]&&console['error']('\x20\x20\x20\x20'+a31_0x790da0[_0x49bb6c(0x220)](_0x55c4f3['length']+_0x49bb6c(0x211)));console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0['dim']('=\x20'+_0xfafad4[_0x49bb6c(0x25f)]+_0x49bb6c(0x262)));}_0xd8e364[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x269)]&&(console['error'](''),console[_0x49bb6c(0x28d)]('\x20\x20Activations:'),_0x35a3a9[_0x49bb6c(0x25f)]>0x0&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0['green']('+\x20'+_0x35a3a9['length']+_0x49bb6c(0x27c))),_0x473e9d['length']>0x0&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x284)]('~\x20'+_0x473e9d[_0x49bb6c(0x25f)]+_0x49bb6c(0x210))),_0x3f3490['length']>0x0&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x224)]('-\x20'+_0x3f3490['length']+_0x49bb6c(0x242))));console[_0x49bb6c(0x28d)](_0x49bb6c(0x215)+a31_0x790da0[_0x49bb6c(0x217)](_0x3805f2)+'\x0a');if(_0x1793cb[_0x49bb6c(0x25f)]>0x0){console[_0x49bb6c(0x28d)](_0x49bb6c(0x253));for(const _0xb0c78f of _0x1793cb){console[_0x49bb6c(0x28d)]('\x20\x20'+a31_0x790da0[_0x49bb6c(0x245)]('+')+'\x20'+_0xb0c78f);}console[_0x49bb6c(0x28d)]('');}if(_0x4357fc[_0x49bb6c(0x25f)]>0x0&&!_0x342908['journeysOnly'])for(const _0x5b484 of _0x4357fc){const _0x2fb8c=_0x5b484[_0x49bb6c(0x208)]?_0x5b484['folderPath']+'/'+_0x5b484[_0x49bb6c(0x212)]['name']:_0x5b484[_0x49bb6c(0x212)][_0x49bb6c(0x21b)],_0x26a54c=_0x5b484[_0x49bb6c(0x212)][_0x49bb6c(0x1fa)]?.[_0x49bb6c(0x25f)]||0x0,_0x4cddd5=_0x26a54c>0x0?a31_0x790da0[_0x49bb6c(0x220)]('\x20['+_0x26a54c+'\x20activations]'):'';console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0[_0x49bb6c(0x27f)](_0x49bb6c(0x1ef))+'\x20'+_0x2fb8c+_0x4cddd5),console['error']('─'[_0x49bb6c(0x251)](0x3c)),_0x5b484[_0x49bb6c(0x22f)]&&console[_0x49bb6c(0x28d)](_0x5b484[_0x49bb6c(0x22f)]),console[_0x49bb6c(0x28d)]('─'['repeat'](0x3c));}if(_0x3d79de[_0x49bb6c(0x25f)]>0x0&&!_0x342908['journeysOnly'])for(const _0x2ecf04 of _0x3d79de){const _0x57524f=_0x2ecf04[_0x49bb6c(0x1fd)]?_0x4481e6['get'](_0x2ecf04[_0x49bb6c(0x1fd)][_0x49bb6c(0x26e)]())||'':'',_0x50c240=_0x57524f?_0x57524f+'/'+_0x2ecf04[_0x49bb6c(0x21b)]:_0x2ecf04[_0x49bb6c(0x21b)],_0x52e976=_0x33fe7b[_0x49bb6c(0x227)](_0x2ecf04['id'])||[],_0x39541f=_0x52e976['length']>0x0?a31_0x790da0[_0x49bb6c(0x220)]('\x20['+_0x52e976[_0x49bb6c(0x25f)]+_0x49bb6c(0x26a)):'';console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0['red'](_0x49bb6c(0x27e))+'\x20'+_0x50c240+_0x39541f),console['error']('─'[_0x49bb6c(0x251)](0x3c));const _0x3ede48=segmentWithActivationsToYaml(_0x2ecf04,_0x52e976,undefined,_0xaccaab,_0x34bc3e),_0x3197aa=segmentToYamlString(_0x3ede48),_0x5a747c=generateDiff(_0x3197aa,'');console[_0x49bb6c(0x28d)](formatDiffWithColors(_0x5a747c)),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c));}const _0x345968=_0x50401a['filter'](_0xc82496=>!_0xc82496[_0x49bb6c(0x1f1)]&&_0xc82496[_0x49bb6c(0x22f)]);if(_0x345968[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x269)])for(const _0x4e85d2 of _0x345968){const _0x4c69e5=_0x4e85d2['folderPath']?_0x4e85d2[_0x49bb6c(0x208)]+'/'+_0x4e85d2[_0x49bb6c(0x212)][_0x49bb6c(0x21b)]:_0x4e85d2[_0x49bb6c(0x212)]['name'];console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x231))+'\x20'+_0x4c69e5),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c)),console[_0x49bb6c(0x28d)](_0x4e85d2[_0x49bb6c(0x22f)]),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c));}if(_0x1670b0[_0x49bb6c(0x25f)]>0x0)for(const _0x1ccf74 of _0x1670b0){const _0x4fb3fb=_0x1ccf74[_0x49bb6c(0x208)]?_0x1ccf74[_0x49bb6c(0x208)]+'/'+_0x1ccf74['yamlConfig']['name']:_0x1ccf74['yamlConfig']['name'];console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0[_0x49bb6c(0x27f)](_0x49bb6c(0x278))+'\x20'+_0x4fb3fb),console[_0x49bb6c(0x28d)]('─'['repeat'](0x3c)),_0x1ccf74[_0x49bb6c(0x22f)]&&console[_0x49bb6c(0x28d)](_0x1ccf74[_0x49bb6c(0x22f)]),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c));}const _0x5a906e=_0x2a7fa4[_0x49bb6c(0x201)](_0x241689=>!_0x241689[_0x49bb6c(0x1f1)]&&_0x241689[_0x49bb6c(0x22f)]);if(_0x5a906e[_0x49bb6c(0x25f)]>0x0)for(const _0x8298e1 of _0x5a906e){const _0x482a74=_0x8298e1[_0x49bb6c(0x208)]?_0x8298e1[_0x49bb6c(0x208)]+'/'+_0x8298e1[_0x49bb6c(0x212)][_0x49bb6c(0x21b)]:_0x8298e1[_0x49bb6c(0x212)][_0x49bb6c(0x21b)];console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x246))+'\x20'+_0x482a74),console[_0x49bb6c(0x28d)]('─'['repeat'](0x3c)),console['error'](_0x8298e1['diff']),console['error']('─'[_0x49bb6c(0x251)](0x3c));}if(_0x301ca5[_0x49bb6c(0x25f)]>0x0)for(const _0x517ce1 of _0x301ca5){const _0x1ee617=_0x517ce1[_0x49bb6c(0x1f9)]?_0x4481e6['get'](_0x517ce1['folderId'])||'':'',_0x19e4c4=_0x1ee617?_0x1ee617+'/'+_0x517ce1[_0x49bb6c(0x271)]:_0x517ce1[_0x49bb6c(0x271)];console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0['red'](_0x49bb6c(0x209))+'\x20'+_0x19e4c4),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c)),console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)]('(Journey\x20will\x20be\x20deleted)')),console[_0x49bb6c(0x28d)]('─'['repeat'](0x3c));}if(_0x342908[_0x49bb6c(0x28a)])return console[_0x49bb6c(0x28d)](a31_0x790da0['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x248205=_0x342908[_0x49bb6c(0x269)]?![]:_0x4357fc[_0x49bb6c(0x25f)]>0x0||_0x5ac274[_0x49bb6c(0x25f)]>0x0||_0x3d79de[_0x49bb6c(0x25f)]>0x0,_0x50f758=_0x1670b0[_0x49bb6c(0x25f)]>0x0||_0x4fa355['length']>0x0||_0x301ca5[_0x49bb6c(0x25f)]>0x0,_0x4d782f=_0x342908[_0x49bb6c(0x269)]?![]:_0xd8e364[_0x49bb6c(0x25f)]>0x0,_0x20c20f=_0x1793cb[_0x49bb6c(0x25f)]>0x0;if(!_0x248205&&!_0x50f758&&!_0x4d782f&&!_0x20c20f){const _0x1e74fd=_0x342908[_0x49bb6c(0x269)]?_0x49bb6c(0x263):_0x49bb6c(0x24b);console['error'](a31_0x790da0['green'](_0x1e74fd));if(_0x320faa&&_0xfafad4[_0x49bb6c(0x25f)]===0x1){const _0x26f9cf=_0xfafad4[0x0];if(_0x26f9cf[_0x49bb6c(0x21e)]?.['id']){const _0x259db3=getConsoleNextUrl(_0x342908[_0x49bb6c(0x202)],_0x49bb6c(0x272)+_0x189b3e+'/e/'+_0x26f9cf[_0x49bb6c(0x21e)]['id']+_0x49bb6c(0x213));console[_0x49bb6c(0x28d)]('\x20\x20'+a31_0x790da0[_0x49bb6c(0x217)](_0x259db3));}}return 0x0;}const _0x5b7cb1=_0x342908['journeysOnly']?_0x1670b0[_0x49bb6c(0x25f)]+_0x4fa355[_0x49bb6c(0x25f)]+_0x301ca5[_0x49bb6c(0x25f)]+_0x1793cb[_0x49bb6c(0x25f)]:_0x4357fc['length']+_0x5ac274[_0x49bb6c(0x25f)]+_0x3d79de['length']+_0x1670b0[_0x49bb6c(0x25f)]+_0x4fa355[_0x49bb6c(0x25f)]+_0x301ca5[_0x49bb6c(0x25f)]+_0x1793cb[_0x49bb6c(0x25f)]+_0xd8e364[_0x49bb6c(0x25f)];if(!_0x342908[_0x49bb6c(0x24a)]&&_0x5b7cb1>0x0){if(!isInteractive())return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x1ff)),_0x49bb6c(0x258)),console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x220)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x57c7fe=await confirmKey(_0x49bb6c(0x240)+_0x5b7cb1+_0x49bb6c(0x1f2));if(!_0x57c7fe)return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x281))),0x1;}const _0x1c7261={'withProgress':async(_0x25b332,_0x170c56)=>{const _0x2100e2=_0x49bb6c,_0x4a27de=await withSpinner(_0x25b332,_0x170c56,{'verbose':_0x342908[_0x2100e2(0x218)]});return{'data':_0x4a27de[_0x2100e2(0x28c)]};},'logInfo':_0x1f1b04=>console[_0x49bb6c(0x28d)](a31_0x790da0['blue']('βœ”\x20'+_0x1f1b04)),'logSuccess':_0x40349f=>console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x27f)]('βœ”\x20'+_0x40349f)),'logWarning':_0x551eee=>console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x284)]('⚠\x20'+_0x551eee)),'logDeleted':_0x1a6c4e=>console['error'](a31_0x790da0[_0x49bb6c(0x224)]('βœ”\x20'+_0x1a6c4e))},_0x557f3b={'segment':_0x1bb87a[_0x49bb6c(0x200)],'journey':_0x1bb87a['journey'],'user':_0x1bb87a[_0x49bb6c(0x22c)],'connection':_0x1bb87a[_0x49bb6c(0x23f)]};_0x1793cb[_0x49bb6c(0x25f)]>0x0&&(_0x1ca34b=await executePushFolders(_0x557f3b,_0x1793cb,_0x1ca34b,{'parentId':_0x189b3e},_0x1c7261));const _0x58f039={'rootFolderId':_0x53c20d,'folderPathToId':_0x1ca34b,'folderIdToPath':_0x4481e6,'segmentNameToId':_0x11d641,'activationsBySegmentId':_0x33fe7b,'emailToIdMap':_0x3fb433,'idToEmailMap':_0xaccaab,'connectionNameToIdMap':_0x13195e[_0x49bb6c(0x25e)],'connectionIdToNameMap':_0x13195e[_0x49bb6c(0x228)],'connectionNameToTypeMap':_0x299999},_0x3a7c30=await executePushSegments(_0x557f3b,_0x342908[_0x49bb6c(0x269)]?[]:_0x50401a,_0x58f039,{'parentId':_0x189b3e},_0x1c7261),_0xbac0ce=_0x3a7c30[_0x49bb6c(0x22a)],_0x3621ff=_0x3a7c30['updated'],_0xa6c1af=_0x3a7c30['activations'][_0x49bb6c(0x22a)],_0x4fd3a4=_0x3a7c30[_0x49bb6c(0x1fa)][_0x49bb6c(0x1f4)],_0x805abf=_0x3a7c30['activations'][_0x49bb6c(0x24f)],_0x54a19b=await executePushSegmentDeletions(_0x557f3b,_0x342908[_0x49bb6c(0x269)]?[]:_0x3d79de,_0x1c7261);let _0x28f725=0x0,_0x59998a=0x0,_0xf5ab85=0x0;const _0x24a538=new Map(_0x11d641);for(const [_0x36f00d,_0x34c017]of _0x3a7c30[_0x49bb6c(0x221)]){_0x24a538[_0x49bb6c(0x27b)](_0x36f00d,_0x34c017);}if(_0x2a7fa4['length']>0x0){const _0x41981e={..._0x58f039,'segmentNameToId':_0x24a538,'existingSegments':_0x44a7da,'activationContext':_0x1cadb1},_0x21885f=await executePushJourneys(_0x557f3b,_0x2a7fa4,_0x41981e,{'parentId':_0x189b3e,'rootFolderId':_0x53c20d,'verbose':_0x342908['verbose']},_0x1c7261);_0x28f725=_0x21885f[_0x49bb6c(0x22a)],_0x59998a=_0x21885f[_0x49bb6c(0x1f4)];if(_0x320faa&&_0x21885f['results'][_0x49bb6c(0x25f)]===0x1){const _0x943c22=_0x21885f[_0x49bb6c(0x277)][0x0];if(_0x943c22[_0x49bb6c(0x219)]){const _0x109fe6=getConsoleNextUrl(_0x342908[_0x49bb6c(0x202)],_0x49bb6c(0x272)+_0x189b3e+_0x49bb6c(0x23d)+_0x943c22['journeyId']+_0x49bb6c(0x213));console[_0x49bb6c(0x28d)]('\x20\x20'+a31_0x790da0[_0x49bb6c(0x217)](_0x109fe6));}}}for(const _0x1906ca of _0x301ca5){console['error'](a31_0x790da0['yellow'](_0x49bb6c(0x226)+_0x1906ca[_0x49bb6c(0x271)])),_0xf5ab85++;}const _0x5a79aa=[];if(_0xbac0ce>0x0)_0x5a79aa['push'](_0xbac0ce+'\x20created');if(_0x3621ff>0x0)_0x5a79aa['push'](_0x3621ff+'\x20updated');if(_0x54a19b>0x0)_0x5a79aa[_0x49bb6c(0x20f)](_0x54a19b+_0x49bb6c(0x1f3));const _0x189e04=[];if(_0x28f725>0x0)_0x189e04[_0x49bb6c(0x20f)](_0x28f725+_0x49bb6c(0x282));if(_0x59998a>0x0)_0x189e04[_0x49bb6c(0x20f)](_0x59998a+'\x20updated');if(_0xf5ab85>0x0)_0x189e04[_0x49bb6c(0x20f)](_0xf5ab85+'\x20deleted');const _0x3670e8=[];if(_0xa6c1af>0x0)_0x3670e8['push'](_0xa6c1af+_0x49bb6c(0x282));if(_0x4fd3a4>0x0)_0x3670e8['push'](_0x4fd3a4+'\x20updated');if(_0x805abf>0x0)_0x3670e8[_0x49bb6c(0x20f)](_0x805abf+_0x49bb6c(0x1f3));return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x27f)](_0x49bb6c(0x20c))),_0x5a79aa[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x269)]&&console['error'](_0x49bb6c(0x255)+_0x5a79aa[_0x49bb6c(0x24d)](',\x20')),_0x189e04['length']>0x0&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x232)+_0x189e04[_0x49bb6c(0x24d)](',\x20')),_0x3670e8['length']>0x0&&!_0x342908[_0x49bb6c(0x269)]&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x250)+_0x3670e8['join'](',\x20')),0x0;}}
1
+ const a31_0x23be32=a31_0x14be;(function(_0x2d64ae,_0x3898e3){const _0x4a67c8=a31_0x14be,_0x356275=_0x2d64ae();while(!![]){try{const _0x2b6016=parseInt(_0x4a67c8(0xa3))/0x1*(-parseInt(_0x4a67c8(0xa6))/0x2)+parseInt(_0x4a67c8(0xe3))/0x3*(parseInt(_0x4a67c8(0x84))/0x4)+-parseInt(_0x4a67c8(0x11a))/0x5+-parseInt(_0x4a67c8(0xe6))/0x6*(parseInt(_0x4a67c8(0xc6))/0x7)+parseInt(_0x4a67c8(0x100))/0x8+parseInt(_0x4a67c8(0xdf))/0x9+parseInt(_0x4a67c8(0xa8))/0xa*(-parseInt(_0x4a67c8(0x10f))/0xb);if(_0x2b6016===_0x3898e3)break;else _0x356275['push'](_0x356275['shift']());}catch(_0x2a984d){_0x356275['push'](_0x356275['shift']());}}}(a31_0x21e2,0x24a13));import{BaseCommand}from'./command.js';function a31_0x14be(_0x2ab8d9,_0x4f8d9f){_0x2ab8d9=_0x2ab8d9-0x83;const _0x21e281=a31_0x21e2();let _0x14be5b=_0x21e281[_0x2ab8d9];return _0x14be5b;}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';function a31_0x21e2(){const _0x4a0d21=['Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','.yaml','\x20deleted','state','idToName','execute','diff','journeyBundleName','Aborted.','site','green','7OcheMW','targetDir','cwd','relationships','user','type','Site:\x20','Parent\x20segment:\x20','\x20activations]','listSegments','unchanged','Fetching\x20existing\x20segments...','red','Error:\x20','Error:\x20Directory\x20not\x20found:\x20','nameToId','list','map','\x0aError:','\x20changes?','toDelete','audienceId','name','journeys','dryRun','2078865sgEVbB','journeysOnly','errorCode','segment\x20or\x20journey','6tHtmHO','/app/ps/','activations','1187100SvUqDj','Fetching\x20connections\x20for\x20name\x20resolution...','Delete\x20segment:','folderId','Changes\x20to\x20journey:','Delete\x20journey:','Push\x20','\x20new','error','length','yellow','Fetching\x20existing\x20folders...','(Journey\x20will\x20be\x20deleted)','parent_name','Fetching\x20users\x20for\x20email\x20resolution...','\x20\x20Activations:\x20','journeyId','versionNumber','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20\x20\x20','\x20created','blue','filter','changed','Changes\x20to:','then','1978984bSeqFu','journey','yes','listFolders','delete','\x27...','get','endsWith','Folders\x20to\x20create:','paused','\x20\x20Segments:\x20','attributes','connection','folderPath','\x20updated','240801KLezUo','listJourneysWithDetailsFromParentSegment','\x20\x20Activations:','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','message','\x0aPush\x20summary\x20for\x20\x27','push','listActivations','New\x20segment:','\x20unchanged','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','1309615IUTAuI','segmentFolderId','deleted','\x20\x20Journeys:\x20','updated','setPhase','.yml','\x20YAML\x20files\x20found','resolveParentId','add','571772eFFJKs','πŸ“\x20','Fetching\x20existing\x20journeys...','created','createdSegmentIds','new','nameToType','getParent','getJourney','set','Resolving\x20parent\x20segment\x20\x27','toString','\x20to\x20delete','scopedFolderPath','\x20to\x20create','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','yamlConfig','parentSegment','verbose','isScoped','/e/','updatedAt','segments','segment','isNew','repeat','all','\x20to\x20update','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','description','results','61eeufzK','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','helpText','3628GEWGQF','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','20qlFgcp','\x20folders\x20to\x20create','Error\x20parsing\x20YAML:\x20','folders','cyan','Scoped\x20to\x20folder:\x20','filePath','data','join','dim','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeyBundleId','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20changed','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)','toCreate','\x0aβœ”\x20Push\x20complete','file','/j/da/je'];a31_0x21e2=function(){return _0x4a0d21;};return a31_0x21e2();}import a31_0x56f03 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']='segment:push';[a31_0x23be32(0xa1)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a31_0x23be32(0xc0)](_0x1558cf){const _0xb2ff17=a31_0x23be32,{options:_0x3447af,args:_0x331e08,tdx:_0x47cd2e}=_0x1558cf,_0x24becb=_0x3447af,_0xe57842=await resolveTarget({'arg':_0x331e08[0x0],'contextParent':_0x3447af[_0xb2ff17(0x95)],'cwd':process[_0xb2ff17(0xc8)]()});if(!isSuccessfulResolution(_0xe57842))return _0xe57842[_0xb2ff17(0xe1)]==='no_parent'?(console[_0xb2ff17(0xee)](a31_0x56f03['yellow'](_0xb2ff17(0xb4))),console[_0xb2ff17(0xee)](_0xb2ff17(0xb6)),console[_0xb2ff17(0xee)](_0xb2ff17(0xa4)),console[_0xb2ff17(0xee)](_0xb2ff17(0x119))):(console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xd2)](_0xb2ff17(0xd3)+_0xe57842[_0xb2ff17(0x113)]+'\x0a')),_0xe57842['helpText']&&console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xac)](_0xe57842[_0xb2ff17(0xa5)]))),0x1;if(_0xe57842[_0xb2ff17(0xcb)]===_0xb2ff17(0xf3))return console['error'](a31_0x56f03['red'](_0xb2ff17(0xd4)+_0xe57842[_0xb2ff17(0xc7)]+'\x0a')),console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xac)](_0xb2ff17(0xbb))),0x1;const _0x459127=_0xe57842['parentName'],_0xa33290=_0xe57842[_0xb2ff17(0xc7)],_0x48d6a0=_0xe57842['type']===_0xb2ff17(0xb9)?_0xe57842[_0xb2ff17(0xae)]:undefined,_0x41c1ca=getScopedDetails(_0xe57842),_0x31ef79=_0x41c1ca?.[_0xb2ff17(0x97)]??![],_0x571985=_0x41c1ca?.[_0xb2ff17(0x91)]??'';if(!existsSync(_0xa33290))return console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xd2)]('Error:\x20Directory\x20not\x20found:\x20'+_0xa33290+'\x0a')),console[_0xb2ff17(0xee)](a31_0x56f03['cyan'](_0xb2ff17(0xbb))),0x1;_0x24becb[_0xb2ff17(0x96)]&&(console[_0xb2ff17(0xee)](_0xb2ff17(0xcc)+_0x24becb[_0xb2ff17(0xc4)]),console['error'](_0xb2ff17(0xcd)+_0x459127),console[_0xb2ff17(0xee)]('Source\x20directory:\x20'+_0xa33290),_0x31ef79&&console['error'](_0xb2ff17(0xad)+_0x571985));const _0x2a4dec=await withSpinner(_0xb2ff17(0x8e)+_0x459127+_0xb2ff17(0x105),()=>_0x47cd2e[_0xb2ff17(0x9b)][_0xb2ff17(0x122)](_0x459127),{'verbose':_0x24becb[_0xb2ff17(0x96)]}),_0x299b09=_0x2a4dec['data'],[_0x4f574d,_0x37eb99,_0x38273d,_0x3aabba,_0x14c1be]=await Promise[_0xb2ff17(0x9e)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x47cd2e['segment'][_0xb2ff17(0x8b)](_0x299b09),{'verbose':_0x24becb['verbose']}),withSpinner(_0xb2ff17(0xd1),()=>_0x47cd2e[_0xb2ff17(0x9b)][_0xb2ff17(0xcf)](_0x299b09),{'verbose':_0x24becb[_0xb2ff17(0x96)]}),withSpinner(_0xb2ff17(0xf1),()=>_0x47cd2e[_0xb2ff17(0x9b)][_0xb2ff17(0x103)](_0x299b09),{'verbose':_0x24becb[_0xb2ff17(0x96)]}),withSpinner(_0xb2ff17(0x86),()=>_0x47cd2e[_0xb2ff17(0x101)][_0xb2ff17(0x110)](_0x299b09,{'includeAllVersions':!![]}),{'verbose':_0x24becb[_0xb2ff17(0x96)]}),withSpinner(_0xb2ff17(0xf4),()=>_0x47cd2e[_0xb2ff17(0xca)]['buildUserMaps'](),{'verbose':_0x24becb[_0xb2ff17(0x96)]})[_0xb2ff17(0xff)](_0x3980c6=>_0x3980c6['data'])]),_0xcd2c35=_0x4f574d[_0xb2ff17(0xaf)],_0x22ce67=extractRootFolderId(_0xcd2c35),_0x338db3=_0x37eb99[_0xb2ff17(0xaf)],_0x5602ca=_0x38273d[_0xb2ff17(0xaf)],{journeys:_0x2c7711,activationStepsById:_0x4257b8}=_0x3aabba[_0xb2ff17(0xaf)],_0x5b7df5=new Map(_0x2c7711['map'](_0x40d01e=>[_0x40d01e['id'],_0x40d01e])),_0x535b91=_0x2c7711['map'](_0x38f872=>({'id':_0x38f872['id'],'name':_0x38f872[_0xb2ff17(0x10b)]['name'],'journeyBundleName':_0x38f872[_0xb2ff17(0x10b)][_0xb2ff17(0xc2)]||'','journeyBundleId':_0x38f872[_0xb2ff17(0x10b)][_0xb2ff17(0xb3)]||'','versionNumber':_0x38f872[_0xb2ff17(0x10b)][_0xb2ff17(0xf7)],'description':_0x38f872[_0xb2ff17(0x10b)][_0xb2ff17(0xa1)],'state':_0x38f872[_0xb2ff17(0x10b)][_0xb2ff17(0xbe)],'paused':_0x38f872[_0xb2ff17(0x10b)][_0xb2ff17(0x109)],'audienceId':_0x38f872['attributes'][_0xb2ff17(0xdb)],'folderId':_0x38f872[_0xb2ff17(0xc9)]?.['parentFolder']?.[_0xb2ff17(0xaf)]?.['id'],'createdAt':_0x38f872[_0xb2ff17(0x10b)]['createdAt'],'updatedAt':_0x38f872[_0xb2ff17(0x10b)][_0xb2ff17(0x99)]})),{emailToId:_0x5b6e47,idToEmail:_0x4e1e16}=_0x14c1be,_0x365db2=await withSpinner(_0xb2ff17(0xe7),async()=>{const _0xd5b00b=_0xb2ff17,_0x4e3642=await _0x47cd2e[_0xd5b00b(0x10c)][_0xd5b00b(0xd6)]();return buildConnectionMaps(_0x4e3642);},{'verbose':_0x24becb[_0xb2ff17(0x96)]})[_0xb2ff17(0xff)](_0x268a41=>_0x268a41[_0xb2ff17(0xaf)]),_0x5cd69f=_0x365db2[_0xb2ff17(0xd5)],_0x55eb71=_0x365db2[_0xb2ff17(0xbf)],_0x48dc56=_0x365db2[_0xb2ff17(0x8a)],_0x2af1b5={'emailToIdMap':_0x5b6e47,'connectionNameToIdMap':_0x5cd69f,'connectionNameToTypeMap':_0x48dc56,'getSchema':_0x1049e3=>_0x47cd2e[_0xb2ff17(0x10c)]['getOutputSchemaWithCache'](_0x1049e3)};let {pathToId:_0x3db17f,idToPath:_0x1a9cc4}=buildFolderMaps(_0x5602ca);const _0x2854cc=buildSegmentLookupMap(_0x338db3,_0x1a9cc4),_0x1edd0a=buildSegmentNameToIdMap(_0x338db3),_0x5520c8=buildJourneyBundleLookupMap(_0x535b91,_0x1a9cc4);let _0x2e36b0;if(_0x48d6a0){if(!_0x48d6a0[_0xb2ff17(0x107)](_0xb2ff17(0x120))&&!_0x48d6a0[_0xb2ff17(0x107)](_0xb2ff17(0xbc)))return console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xd2)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x48d6a0+'\x0a')),0x1;_0x2e36b0=[_0x48d6a0];}else _0x2e36b0=findYamlFiles(_0xa33290);if(_0x2e36b0[_0xb2ff17(0xef)]===0x0)return console['error'](a31_0x56f03[_0xb2ff17(0xd2)](_0xb2ff17(0x112)+_0xa33290+'\x0a')),console['error'](a31_0x56f03[_0xb2ff17(0xac)](_0xb2ff17(0xa0))),0x1;let _0x11cd19,_0x3b8ea0;try{const _0x3d61f2=parseAndClassifyYamlFiles(_0x2e36b0,_0xa33290,{'skipSegments':_0x24becb['journeysOnly']});_0x11cd19=_0x3d61f2[_0xb2ff17(0x9a)],_0x3b8ea0=_0x3d61f2['journeys'];const _0x13adf0=validateParsedFiles(_0x3d61f2,_0xa33290);if(_0x13adf0[_0xb2ff17(0xef)]>0x0)return console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xd2)]('\x0aValidation\x20failed:')),console[_0xb2ff17(0xee)](formatValidationErrors(_0x13adf0)),console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xf0)](_0xb2ff17(0xb2))),0x1;}catch(_0x29e004){return console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xd2)](_0xb2ff17(0xaa)+(_0x29e004 instanceof Error?_0x29e004[_0xb2ff17(0x113)]:_0x29e004))),0x1;}if(_0x11cd19['length']===0x0&&_0x3b8ea0['length']===0x0){const _0x1eb05f=_0x24becb[_0xb2ff17(0xe0)]?_0xb2ff17(0x101):_0xb2ff17(0xe2);return console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xf0)]('No\x20'+_0x1eb05f+_0xb2ff17(0x121))),0x0;}const _0x504497=new Map();_0x338db3['length']>0x0&&!_0x24becb[_0xb2ff17(0xe0)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x338db3,async _0x55994b=>{const _0x2f18ed=a31_0x14be,_0x38892d=await _0x47cd2e[_0x2f18ed(0x9b)][_0x2f18ed(0x116)](_0x299b09,_0x55994b['id']);_0x504497['set'](_0x55994b['id'],_0x38892d);});},{'verbose':_0x24becb['verbose']});const {segmentFiles:_0x5e02dc,foldersToCreate:_0x373900}=await prepareSegmentFiles(_0x11cd19,{'segmentByFolderAndName':_0x2854cc,'activationsBySegmentId':_0x504497,'folderPathToId':_0x3db17f,'idToEmailMap':_0x4e1e16,'connectionIdToNameMap':_0x55eb71},_0x2af1b5,_0x31ef79,_0x571985),_0x45d9a3=_0x48d6a0?[]:findSegmentsToDelete(_0x338db3,_0x11cd19[_0xb2ff17(0xd7)](({yamlConfig:_0x1601c3,folderPath:_0x56ca93})=>({'yamlConfig':_0x1601c3,'folderPath':resolveTDFolderPath(_0x56ca93,_0x31ef79,_0x571985)})),_0x1a9cc4,_0x571985,_0x31ef79),{journeyFiles:_0x1cfae9,foldersToCreate:_0x385ba9}=await withProgressSpinner('Preparing\x20journeys...',async _0x1c0872=>prepareJourneyFiles(_0x3b8ea0,{'fetchJourney':async _0xbf3bdb=>_0x47cd2e[_0xb2ff17(0x101)][_0xb2ff17(0x8c)](_0xbf3bdb['journeyId']),'journeyBundlesByFolderAndName':_0x5520c8,'folderPathToId':_0x3db17f,'idToEmailMap':_0x4e1e16,'connectionIdToNameMap':_0x55eb71,'existingSegments':_0x338db3,'parentId':_0x299b09,'deps':_0x47cd2e,'progress':{'update':_0x2d55e0=>{const _0x398781=_0xb2ff17;_0x1c0872[_0x398781(0x11f)](_0x2d55e0),_0x24becb[_0x398781(0x96)]&&console[_0x398781(0xee)]('\x20\x20'+_0x2d55e0);}},'journeyById':_0x5b7df5,'activationStepsById':_0x4257b8},_0x31ef79,_0x571985),{'verbose':_0x24becb[_0xb2ff17(0x96)]})[_0xb2ff17(0xff)](_0x3e6d8c=>_0x3e6d8c[_0xb2ff17(0xaf)]);for(const _0x3a6831 of _0x385ba9){_0x373900[_0xb2ff17(0x83)](_0x3a6831);}const _0x532607=_0x48d6a0?[]:findJourneysToDelete(_0x535b91,_0x3b8ea0[_0xb2ff17(0xd7)](({yamlConfig:_0x16e090,folderPath:_0xc1f6ab})=>({'yamlConfig':_0x16e090,'folderPath':resolveTDFolderPath(_0xc1f6ab,_0x31ef79,_0x571985)})),_0x1a9cc4,_0x571985,_0x31ef79),_0x4e6437=calculatePushStats(_0x5e02dc,_0x1cfae9,_0x373900,_0x45d9a3,_0x532607,!!_0x24becb['delete'],!!_0x24becb['journeysOnly']),_0xa82ec8=_0x4e6437[_0xb2ff17(0x9a)]['new'],_0x3806bf=_0x4e6437[_0xb2ff17(0x9a)][_0xb2ff17(0xfd)],_0x1fa992=_0x4e6437[_0xb2ff17(0x9a)][_0xb2ff17(0xd0)],_0x139940=_0x4e6437[_0xb2ff17(0x9a)]['toDelete'],_0x4c3c4f=_0x4e6437[_0xb2ff17(0xab)][_0xb2ff17(0xb7)],_0x2bc4ba=_0x4e6437[_0xb2ff17(0xdd)][_0xb2ff17(0x89)],_0x19f5f2=_0x4e6437[_0xb2ff17(0xdd)][_0xb2ff17(0xfd)],_0xd45640=_0x4e6437[_0xb2ff17(0xdd)][_0xb2ff17(0xd0)],_0x2191f3=_0x4e6437[_0xb2ff17(0xdd)][_0xb2ff17(0xda)],_0x373d6b=_0x4e6437[_0xb2ff17(0xe5)][_0xb2ff17(0x9e)],_0x31d10d=_0x4e6437[_0xb2ff17(0xe5)]['toCreate'],_0x5b3668=_0x4e6437[_0xb2ff17(0xe5)]['toUpdate'],_0x5492e4=_0x4e6437[_0xb2ff17(0xe5)][_0xb2ff17(0xda)];console[_0xb2ff17(0xee)](_0xb2ff17(0x114)+_0x459127+'\x27:');_0x4c3c4f[_0xb2ff17(0xef)]>0x0&&console[_0xb2ff17(0xee)]('\x20\x20'+a31_0x56f03[_0xb2ff17(0xfb)](_0xb2ff17(0x85)+_0x4c3c4f[_0xb2ff17(0xef)]+_0xb2ff17(0xa9)));if(!_0x24becb[_0xb2ff17(0xe0)]){console[_0xb2ff17(0xee)]('\x20\x20πŸ“Š\x20Segments:'),console[_0xb2ff17(0xee)](_0xb2ff17(0xf9)+a31_0x56f03['green']('+\x20'+_0xa82ec8[_0xb2ff17(0xef)]+_0xb2ff17(0xed))),console[_0xb2ff17(0xee)]('\x20\x20\x20\x20'+a31_0x56f03[_0xb2ff17(0xf0)]('~\x20'+_0x3806bf[_0xb2ff17(0xef)]+'\x20changed'));if(_0x139940[_0xb2ff17(0xef)]>0x0)console['error'](_0xb2ff17(0xf9)+a31_0x56f03[_0xb2ff17(0xd2)]('-\x20'+_0x139940[_0xb2ff17(0xef)]+_0xb2ff17(0x90)));else _0x45d9a3['length']>0x0&&!_0x24becb[_0xb2ff17(0x104)]&&console[_0xb2ff17(0xee)](_0xb2ff17(0xf9)+a31_0x56f03['dim'](_0x45d9a3['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xb2ff17(0xee)]('\x20\x20\x20\x20'+a31_0x56f03[_0xb2ff17(0xb1)]('=\x20'+_0x1fa992[_0xb2ff17(0xef)]+'\x20unchanged'));}if(_0x1cfae9[_0xb2ff17(0xef)]>0x0||_0x532607[_0xb2ff17(0xef)]>0x0){console['error']('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console['error'](_0xb2ff17(0xf9)+a31_0x56f03['green']('+\x20'+_0x2bc4ba['length']+_0xb2ff17(0xed))),console['error'](_0xb2ff17(0xf9)+a31_0x56f03[_0xb2ff17(0xf0)]('~\x20'+_0x19f5f2[_0xb2ff17(0xef)]+_0xb2ff17(0xb5)));if(_0x2191f3[_0xb2ff17(0xef)]>0x0)console[_0xb2ff17(0xee)](_0xb2ff17(0xf9)+a31_0x56f03[_0xb2ff17(0xd2)]('-\x20'+_0x2191f3['length']+_0xb2ff17(0x90)));else _0x532607[_0xb2ff17(0xef)]>0x0&&!_0x24becb['delete']&&console['error'](_0xb2ff17(0xf9)+a31_0x56f03[_0xb2ff17(0xb1)](_0x532607[_0xb2ff17(0xef)]+_0xb2ff17(0xf8)));console[_0xb2ff17(0xee)]('\x20\x20\x20\x20'+a31_0x56f03[_0xb2ff17(0xb1)]('=\x20'+_0xd45640[_0xb2ff17(0xef)]+_0xb2ff17(0x118)));}_0x373d6b[_0xb2ff17(0xef)]>0x0&&!_0x24becb['journeysOnly']&&(console['error'](''),console[_0xb2ff17(0xee)](_0xb2ff17(0x111)),_0x31d10d[_0xb2ff17(0xef)]>0x0&&console['error'](_0xb2ff17(0xf9)+a31_0x56f03[_0xb2ff17(0xc5)]('+\x20'+_0x31d10d[_0xb2ff17(0xef)]+_0xb2ff17(0x92))),_0x5b3668[_0xb2ff17(0xef)]>0x0&&console[_0xb2ff17(0xee)](_0xb2ff17(0xf9)+a31_0x56f03[_0xb2ff17(0xf0)]('~\x20'+_0x5b3668[_0xb2ff17(0xef)]+_0xb2ff17(0x9f))),_0x5492e4[_0xb2ff17(0xef)]>0x0&&console['error'](_0xb2ff17(0xf9)+a31_0x56f03[_0xb2ff17(0xd2)]('-\x20'+_0x5492e4[_0xb2ff17(0xef)]+'\x20to\x20delete')));console[_0xb2ff17(0xee)]('\x20\x20Source:\x20'+a31_0x56f03[_0xb2ff17(0xac)](_0xa33290)+'\x0a');if(_0x4c3c4f[_0xb2ff17(0xef)]>0x0){console[_0xb2ff17(0xee)](_0xb2ff17(0x108));for(const _0x25611a of _0x4c3c4f){console[_0xb2ff17(0xee)]('\x20\x20'+a31_0x56f03[_0xb2ff17(0xfb)]('+')+'\x20'+_0x25611a);}console[_0xb2ff17(0xee)]('');}if(_0xa82ec8[_0xb2ff17(0xef)]>0x0&&!_0x24becb[_0xb2ff17(0xe0)])for(const _0x4c9b6d of _0xa82ec8){const _0x4fc66d=_0x4c9b6d[_0xb2ff17(0x10d)]?_0x4c9b6d[_0xb2ff17(0x10d)]+'/'+_0x4c9b6d[_0xb2ff17(0x94)][_0xb2ff17(0xdc)]:_0x4c9b6d[_0xb2ff17(0x94)][_0xb2ff17(0xdc)],_0x2357fc=_0x4c9b6d[_0xb2ff17(0x94)][_0xb2ff17(0xe5)]?.['length']||0x0,_0x4314ae=_0x2357fc>0x0?a31_0x56f03['dim']('\x20['+_0x2357fc+_0xb2ff17(0xce)):'';console[_0xb2ff17(0xee)]('\x0a'+a31_0x56f03[_0xb2ff17(0xc5)](_0xb2ff17(0x117))+'\x20'+_0x4fc66d+_0x4314ae),console[_0xb2ff17(0xee)]('─'[_0xb2ff17(0x9d)](0x3c)),_0x4c9b6d[_0xb2ff17(0xc1)]&&console[_0xb2ff17(0xee)](_0x4c9b6d[_0xb2ff17(0xc1)]),console[_0xb2ff17(0xee)]('─'['repeat'](0x3c));}if(_0x139940[_0xb2ff17(0xef)]>0x0&&!_0x24becb[_0xb2ff17(0xe0)])for(const _0x4fdd27 of _0x139940){const _0x49776c=_0x4fdd27[_0xb2ff17(0x11b)]?_0x1a9cc4[_0xb2ff17(0x106)](_0x4fdd27[_0xb2ff17(0x11b)][_0xb2ff17(0x8f)]())||'':'',_0x5326b6=_0x49776c?_0x49776c+'/'+_0x4fdd27['name']:_0x4fdd27[_0xb2ff17(0xdc)],_0x41a1e3=_0x504497[_0xb2ff17(0x106)](_0x4fdd27['id'])||[],_0x2fc5b7=_0x41a1e3['length']>0x0?a31_0x56f03[_0xb2ff17(0xb1)]('\x20['+_0x41a1e3[_0xb2ff17(0xef)]+_0xb2ff17(0xce)):'';console[_0xb2ff17(0xee)]('\x0a'+a31_0x56f03[_0xb2ff17(0xd2)](_0xb2ff17(0xe8))+'\x20'+_0x5326b6+_0x2fc5b7),console[_0xb2ff17(0xee)]('─'[_0xb2ff17(0x9d)](0x3c));const _0x5dd157=segmentWithActivationsToYaml(_0x4fdd27,_0x41a1e3,undefined,_0x4e1e16,_0x55eb71),_0x5c4ec1=segmentToYamlString(_0x5dd157),_0x1d9608=generateDiff(_0x5c4ec1,'');console['error'](formatDiffWithColors(_0x1d9608)),console[_0xb2ff17(0xee)]('─'[_0xb2ff17(0x9d)](0x3c));}const _0x1fbf6a=_0x5e02dc[_0xb2ff17(0xfc)](_0x4cfa21=>!_0x4cfa21[_0xb2ff17(0x9c)]&&_0x4cfa21[_0xb2ff17(0xc1)]);if(_0x1fbf6a['length']>0x0&&!_0x24becb[_0xb2ff17(0xe0)])for(const _0x27364d of _0x1fbf6a){const _0x5a4da0=_0x27364d[_0xb2ff17(0x10d)]?_0x27364d[_0xb2ff17(0x10d)]+'/'+_0x27364d[_0xb2ff17(0x94)][_0xb2ff17(0xdc)]:_0x27364d[_0xb2ff17(0x94)]['name'];console[_0xb2ff17(0xee)]('\x0a'+a31_0x56f03[_0xb2ff17(0xf0)](_0xb2ff17(0xfe))+'\x20'+_0x5a4da0),console[_0xb2ff17(0xee)]('─'['repeat'](0x3c)),console[_0xb2ff17(0xee)](_0x27364d[_0xb2ff17(0xc1)]),console[_0xb2ff17(0xee)]('─'['repeat'](0x3c));}if(_0x2bc4ba[_0xb2ff17(0xef)]>0x0)for(const _0x1aff04 of _0x2bc4ba){const _0x320d39=_0x1aff04[_0xb2ff17(0x10d)]?_0x1aff04['folderPath']+'/'+_0x1aff04['yamlConfig'][_0xb2ff17(0xdc)]:_0x1aff04['yamlConfig']['name'];console['error']('\x0a'+a31_0x56f03[_0xb2ff17(0xc5)]('New\x20journey:')+'\x20'+_0x320d39),console['error']('─'[_0xb2ff17(0x9d)](0x3c)),_0x1aff04['diff']&&console[_0xb2ff17(0xee)](_0x1aff04[_0xb2ff17(0xc1)]),console[_0xb2ff17(0xee)]('─'[_0xb2ff17(0x9d)](0x3c));}const _0x53b18f=_0x1cfae9[_0xb2ff17(0xfc)](_0x220f52=>!_0x220f52[_0xb2ff17(0x9c)]&&_0x220f52[_0xb2ff17(0xc1)]);if(_0x53b18f[_0xb2ff17(0xef)]>0x0)for(const _0x85d9a0 of _0x53b18f){const _0x4f344c=_0x85d9a0[_0xb2ff17(0x10d)]?_0x85d9a0['folderPath']+'/'+_0x85d9a0[_0xb2ff17(0x94)][_0xb2ff17(0xdc)]:_0x85d9a0['yamlConfig'][_0xb2ff17(0xdc)];console[_0xb2ff17(0xee)]('\x0a'+a31_0x56f03['yellow'](_0xb2ff17(0xea))+'\x20'+_0x4f344c),console['error']('─'[_0xb2ff17(0x9d)](0x3c)),console[_0xb2ff17(0xee)](_0x85d9a0[_0xb2ff17(0xc1)]),console[_0xb2ff17(0xee)]('─'[_0xb2ff17(0x9d)](0x3c));}if(_0x2191f3[_0xb2ff17(0xef)]>0x0)for(const _0x354db4 of _0x2191f3){const _0x52fec6=_0x354db4[_0xb2ff17(0xe9)]?_0x1a9cc4[_0xb2ff17(0x106)](_0x354db4[_0xb2ff17(0xe9)])||'':'',_0x362590=_0x52fec6?_0x52fec6+'/'+_0x354db4[_0xb2ff17(0xc2)]:_0x354db4[_0xb2ff17(0xc2)];console['error']('\x0a'+a31_0x56f03[_0xb2ff17(0xd2)](_0xb2ff17(0xeb))+'\x20'+_0x362590),console[_0xb2ff17(0xee)]('─'['repeat'](0x3c)),console[_0xb2ff17(0xee)](a31_0x56f03['red'](_0xb2ff17(0xf2))),console['error']('─'[_0xb2ff17(0x9d)](0x3c));}if(_0x24becb[_0xb2ff17(0xde)])return console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xf0)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x5d2e02=_0x24becb[_0xb2ff17(0xe0)]?![]:_0xa82ec8[_0xb2ff17(0xef)]>0x0||_0x3806bf[_0xb2ff17(0xef)]>0x0||_0x139940['length']>0x0,_0x1db009=_0x2bc4ba[_0xb2ff17(0xef)]>0x0||_0x19f5f2['length']>0x0||_0x2191f3[_0xb2ff17(0xef)]>0x0,_0x3bbcbb=_0x24becb[_0xb2ff17(0xe0)]?![]:_0x373d6b[_0xb2ff17(0xef)]>0x0,_0xf327da=_0x4c3c4f['length']>0x0;if(!_0x5d2e02&&!_0x1db009&&!_0x3bbcbb&&!_0xf327da){const _0xde55a7=_0x24becb[_0xb2ff17(0xe0)]?_0xb2ff17(0xa7):'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xc5)](_0xde55a7));if(_0x48d6a0&&_0xd45640['length']===0x1){const _0x3d2dff=_0xd45640[0x0];if(_0x3d2dff['existingJourney']?.['id']){const _0x50724b=getConsoleNextUrl(_0x24becb[_0xb2ff17(0xc4)],'/app/ps/'+_0x299b09+_0xb2ff17(0x98)+_0x3d2dff['existingJourney']['id']+_0xb2ff17(0xba));console[_0xb2ff17(0xee)]('\x20\x20'+a31_0x56f03[_0xb2ff17(0xac)](_0x50724b));}}return 0x0;}const _0x2b2b01=_0x24becb[_0xb2ff17(0xe0)]?_0x2bc4ba[_0xb2ff17(0xef)]+_0x19f5f2[_0xb2ff17(0xef)]+_0x2191f3[_0xb2ff17(0xef)]+_0x4c3c4f[_0xb2ff17(0xef)]:_0xa82ec8[_0xb2ff17(0xef)]+_0x3806bf[_0xb2ff17(0xef)]+_0x139940['length']+_0x2bc4ba[_0xb2ff17(0xef)]+_0x19f5f2[_0xb2ff17(0xef)]+_0x2191f3[_0xb2ff17(0xef)]+_0x4c3c4f[_0xb2ff17(0xef)]+_0x373d6b['length'];if(!_0x24becb[_0xb2ff17(0x102)]&&_0x2b2b01>0x0){if(!isInteractive())return console['error'](a31_0x56f03['red'](_0xb2ff17(0xd8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xb1)](_0xb2ff17(0x93))),0x1;const _0x21c211=await confirmKey(_0xb2ff17(0xec)+_0x2b2b01+_0xb2ff17(0xd9));if(!_0x21c211)return console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xf0)](_0xb2ff17(0xc3))),0x1;}const _0x37f5e6={'withProgress':async(_0x394685,_0x1b2ab2)=>{const _0x568483=_0xb2ff17,_0x8632b4=await withSpinner(_0x394685,_0x1b2ab2,{'verbose':_0x24becb[_0x568483(0x96)]});return{'data':_0x8632b4[_0x568483(0xaf)]};},'logInfo':_0x881242=>console[_0xb2ff17(0xee)](a31_0x56f03['blue']('βœ”\x20'+_0x881242)),'logSuccess':_0x217d5a=>console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xc5)]('βœ”\x20'+_0x217d5a)),'logWarning':_0xcb9941=>console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xf0)]('⚠\x20'+_0xcb9941)),'logDeleted':_0x4caffb=>console['error'](a31_0x56f03[_0xb2ff17(0xd2)]('βœ”\x20'+_0x4caffb))},_0x2a4a19={'segment':_0x47cd2e[_0xb2ff17(0x9b)],'journey':_0x47cd2e['journey'],'user':_0x47cd2e[_0xb2ff17(0xca)],'connection':_0x47cd2e[_0xb2ff17(0x10c)]};_0x4c3c4f['length']>0x0&&(_0x3db17f=await executePushFolders(_0x2a4a19,_0x4c3c4f,_0x3db17f,{'parentId':_0x299b09},_0x37f5e6));const _0x574781={'rootFolderId':_0x22ce67,'folderPathToId':_0x3db17f,'folderIdToPath':_0x1a9cc4,'segmentNameToId':_0x1edd0a,'activationsBySegmentId':_0x504497,'emailToIdMap':_0x5b6e47,'idToEmailMap':_0x4e1e16,'connectionNameToIdMap':_0x365db2[_0xb2ff17(0xd5)],'connectionIdToNameMap':_0x365db2['idToName'],'connectionNameToTypeMap':_0x48dc56},_0x531c40=await executePushSegments(_0x2a4a19,_0x24becb[_0xb2ff17(0xe0)]?[]:_0x5e02dc,_0x574781,{'parentId':_0x299b09},_0x37f5e6),_0x4f22a5=_0x531c40[_0xb2ff17(0x87)],_0x4007e7=_0x531c40[_0xb2ff17(0x11e)],_0x40fade=_0x531c40['activations'][_0xb2ff17(0x87)],_0x282d12=_0x531c40[_0xb2ff17(0xe5)]['updated'],_0x40d1a0=_0x531c40[_0xb2ff17(0xe5)][_0xb2ff17(0x11c)],_0x2335c9=await executePushSegmentDeletions(_0x2a4a19,_0x24becb['journeysOnly']?[]:_0x139940,_0x37f5e6);let _0x3ea297=0x0,_0x4ea391=0x0,_0x18e885=0x0;const _0x11852c=new Map(_0x1edd0a);for(const [_0x44fa1a,_0x2fa8c6]of _0x531c40[_0xb2ff17(0x88)]){_0x11852c[_0xb2ff17(0x8d)](_0x44fa1a,_0x2fa8c6);}if(_0x1cfae9[_0xb2ff17(0xef)]>0x0){const _0x431729={..._0x574781,'segmentNameToId':_0x11852c,'existingSegments':_0x338db3,'activationContext':_0x2af1b5},_0x37e34a=await executePushJourneys(_0x2a4a19,_0x1cfae9,_0x431729,{'parentId':_0x299b09,'rootFolderId':_0x22ce67,'verbose':_0x24becb[_0xb2ff17(0x96)]},_0x37f5e6);_0x3ea297=_0x37e34a['created'],_0x4ea391=_0x37e34a[_0xb2ff17(0x11e)];if(_0x48d6a0&&_0x37e34a[_0xb2ff17(0xa2)][_0xb2ff17(0xef)]===0x1){const _0x38b54a=_0x37e34a[_0xb2ff17(0xa2)][0x0];if(_0x38b54a[_0xb2ff17(0xf6)]){const _0xdf032b=getConsoleNextUrl(_0x24becb[_0xb2ff17(0xc4)],_0xb2ff17(0xe4)+_0x299b09+'/e/'+_0x38b54a['journeyId']+_0xb2ff17(0xba));console[_0xb2ff17(0xee)]('\x20\x20'+a31_0x56f03[_0xb2ff17(0xac)](_0xdf032b));}}}for(const _0x3429c5 of _0x2191f3){console[_0xb2ff17(0xee)](a31_0x56f03[_0xb2ff17(0xf0)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x3429c5[_0xb2ff17(0xc2)])),_0x18e885++;}const _0x44e3eb=[];if(_0x4f22a5>0x0)_0x44e3eb[_0xb2ff17(0x115)](_0x4f22a5+_0xb2ff17(0xfa));if(_0x4007e7>0x0)_0x44e3eb[_0xb2ff17(0x115)](_0x4007e7+_0xb2ff17(0x10e));if(_0x2335c9>0x0)_0x44e3eb[_0xb2ff17(0x115)](_0x2335c9+_0xb2ff17(0xbd));const _0x5bc761=[];if(_0x3ea297>0x0)_0x5bc761[_0xb2ff17(0x115)](_0x3ea297+_0xb2ff17(0xfa));if(_0x4ea391>0x0)_0x5bc761[_0xb2ff17(0x115)](_0x4ea391+'\x20updated');if(_0x18e885>0x0)_0x5bc761[_0xb2ff17(0x115)](_0x18e885+_0xb2ff17(0xbd));const _0x3c212e=[];if(_0x40fade>0x0)_0x3c212e[_0xb2ff17(0x115)](_0x40fade+_0xb2ff17(0xfa));if(_0x282d12>0x0)_0x3c212e['push'](_0x282d12+_0xb2ff17(0x10e));if(_0x40d1a0>0x0)_0x3c212e[_0xb2ff17(0x115)](_0x40d1a0+_0xb2ff17(0xbd));return console[_0xb2ff17(0xee)](a31_0x56f03['green'](_0xb2ff17(0xb8))),_0x44e3eb['length']>0x0&&!_0x24becb[_0xb2ff17(0xe0)]&&console[_0xb2ff17(0xee)](_0xb2ff17(0x10a)+_0x44e3eb[_0xb2ff17(0xb0)](',\x20')),_0x5bc761[_0xb2ff17(0xef)]>0x0&&console[_0xb2ff17(0xee)](_0xb2ff17(0x11d)+_0x5bc761['join'](',\x20')),_0x3c212e[_0xb2ff17(0xef)]>0x0&&!_0x24becb['journeysOnly']&&console[_0xb2ff17(0xee)](_0xb2ff17(0xf5)+_0x3c212e[_0xb2ff17(0xb0)](',\x20')),0x0;}}