@treasuredata/tdx 0.28.3 β†’ 0.28.4

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 (184) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x5c10b4=a30_0x2541;(function(_0x40df23,_0x1cfbb9){const _0x398ab3=a30_0x2541,_0x499a4c=_0x40df23();while(!![]){try{const _0x31502d=parseInt(_0x398ab3(0x1dd))/0x1+-parseInt(_0x398ab3(0x217))/0x2*(-parseInt(_0x398ab3(0x203))/0x3)+-parseInt(_0x398ab3(0x1d0))/0x4+parseInt(_0x398ab3(0x201))/0x5*(-parseInt(_0x398ab3(0x20d))/0x6)+-parseInt(_0x398ab3(0x1c8))/0x7+parseInt(_0x398ab3(0x202))/0x8+parseInt(_0x398ab3(0x216))/0x9;if(_0x31502d===_0x1cfbb9)break;else _0x499a4c['push'](_0x499a4c['shift']());}catch(_0x1c6fc6){_0x499a4c['push'](_0x499a4c['shift']());}}}(a30_0x17fb,0x527eb));function a30_0x17fb(){const _0xcb165d=['Running\x20schedule:\x20','query','num','\x20\x20Cron:\x20','updated_at','\x20schedules','options','\x20\x20Num:\x20','schedule:history','2403814yOlHAX','map','No\x20scheduled\x20queries\x20found','\x20\x20Time:\x20','join','queries','statusIcon','user_name','2584000zJodIj','jobs','substring','show','schedule:update','site','args','...','Deleting\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','\x20scheduled\x20quer','schedule:create','Show\x20schedule\x20details','206059JAwVrO','length','\x20(showing\x20','name','success','last_job','has_next_page','delete','soon','ended_at','end_at','Run\x20a\x20scheduled\x20query\x20immediately','\x20(use\x20--limit\x20to\x20see\x20more)','lastRun','timezone','tsv','database','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','keys','data','schedules','time','listQueries','error','history','getTime','priority','(unnamed)','\x20\x20Database:\x20','count','queryUrl','description','schedule:show','green','created_at','ies','84185eScgCU','2253456yZSfnc','3WlTqJC','schedule:delete','toLocaleDateString','file','abs','trim','Found\x20','type','pagination','verbose','18RZVMUD','INVALID_ARGUMENT','json','cron','executing_user_id','in\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Creating\x20schedule:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','6603534bBusGO','312690qoiqMf','just\x20now','Schedule\x20updated:\x20','result','Updating\x20schedule...','Delete\x20a\x20scheduled\x20query','engine_version','\x22...','Failed\x20to\x20read\x20file:\x20','repeat','Update\x20a\x20scheduled\x20query','Showing\x20first\x20','Getting\x20schedule\x20details...','Schedule\x20deleted:\x20','validate','cyan','m\x20ago','retryLimit','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Query\x20file\x20is\x20empty','h\x20ago','Schedule\x20run\x20submitted:\x20','from','execute','Searching\x20scheduled\x20queries\x20matching\x20\x22','user','Running\x20schedule...','\x20matching\x20\x22','status','update','red','retry_limit','table','next_run_at','scheduled_at','limit','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','yes','padEnd','delay','Show\x20schedule\x20execution\x20history','/app/queries/editor?queryId=','format','\x20\x20Timezone:\x20','max','engineVersion','list','utf-8','Updating\x20schedule:\x20','job_id'];a30_0x17fb=function(){return _0xcb165d;};return a30_0x17fb();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x1aee3b from'chalk';function formatRelativeTime(_0xd1a669){const _0x509530=a30_0x2541,_0x26aeeb=new Date(_0xd1a669),_0x1e942f=new Date(),_0x38959b=_0x26aeeb[_0x509530(0x1f6)]()-_0x1e942f[_0x509530(0x1f6)](),_0x423ce2=Math[_0x509530(0x207)](_0x38959b)/0x3e8,_0xf75e27=_0x38959b<0x0;if(_0x423ce2<0x3c)return _0xf75e27?_0x509530(0x218):_0x509530(0x1e5);else{if(_0x423ce2<0xe10){const _0x5ad3bb=Math['round'](_0x423ce2/0x3c);return _0xf75e27?_0x5ad3bb+_0x509530(0x19d):_0x509530(0x212)+_0x5ad3bb+'m';}else{if(_0x423ce2<0x15180){const _0xee5d4a=Math['round'](_0x423ce2/0xe10);return _0xf75e27?_0xee5d4a+_0x509530(0x1a1):_0x509530(0x212)+_0xee5d4a+'h';}else{if(_0x423ce2<0x93a80){const _0x4237d2=Math['round'](_0x423ce2/0x15180);return _0xf75e27?_0x4237d2+'d\x20ago':_0x509530(0x212)+_0x4237d2+'d';}else return _0x26aeeb[_0x509530(0x205)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]='schedule:list';[a30_0x5c10b4(0x1fc)]='List\x20scheduled\x20queries';async[a30_0x5c10b4(0x1a4)](_0xc666bb){const _0x14e66c=a30_0x5c10b4,{options:_0x53c5e5,args:_0x46b71f,tdx:_0x160627}=_0xc666bb,_0x435a82=resolveLimit(_0x53c5e5[_0x14e66c(0x1b0)],DEFAULT_DISPLAY_LIMIT),_0x28cdce=_0x46b71f[0x0],_0x3c0a83=_0x28cdce?_0x14e66c(0x1a5)+_0x28cdce+_0x14e66c(0x194):'Listing\x20scheduled\x20queries...',_0x2c7166=await withSpinner(_0x3c0a83,()=>_0x160627[_0x14e66c(0x1f1)][_0x14e66c(0x1f3)]({'limit':_0x435a82,'scheduled':!![],'pattern':_0x28cdce}),{'verbose':_0x53c5e5['verbose']}),_0x308524=_0x2c7166['data'][_0x14e66c(0x1cd)],_0x243647=_0x2c7166[_0x14e66c(0x1f0)][_0x14e66c(0x20b)][_0x14e66c(0x1e3)],_0x6d89a8=_0x28cdce?_0x14e66c(0x1a8)+_0x28cdce+'\x22':'';_0x243647?console[_0x14e66c(0x1f4)](_0x14e66c(0x198)+_0x308524['length']+_0x14e66c(0x1c4)+_0x6d89a8+_0x14e66c(0x1e9)):console[_0x14e66c(0x1f4)](_0x14e66c(0x209)+_0x308524['length']+_0x14e66c(0x1da)+(_0x308524[_0x14e66c(0x1de)]!==0x1?_0x14e66c(0x200):'y')+_0x6d89a8);if(_0x53c5e5[_0x14e66c(0x1b7)]===_0x14e66c(0x20f)||_0x53c5e5[_0x14e66c(0x1b7)]==='jsonl'||_0x53c5e5[_0x14e66c(0x1b7)]===_0x14e66c(0x1ad)||_0x53c5e5['format']===_0x14e66c(0x1ec)){const _0x153b4f=_0x308524[_0x14e66c(0x1c9)](_0x3a2099=>({'id':_0x3a2099['id'],'name':_0x3a2099['name'],'cron':_0x3a2099['cron'],'database':_0x3a2099['database']?.[_0x14e66c(0x1e0)],'type':_0x3a2099['type'],'timezone':_0x3a2099['time_zone'],'user_name':_0x3a2099[_0x14e66c(0x1a6)]?.[_0x14e66c(0x1e0)],'updated_at':_0x3a2099[_0x14e66c(0x1c3)],'next_run_at':_0x3a2099[_0x14e66c(0x1ae)],'last_job_status':_0x3a2099['last_job']?.[_0x14e66c(0x1a9)]}));await handleSDKOutput(_0x153b4f,_0x53c5e5);}else{if(_0x308524[_0x14e66c(0x1de)]===0x0)console['log'](_0x14e66c(0x1ca));else{const _0x27f4a2=_0x53c5e5[_0x14e66c(0x1d5)],_0x5c5017=_0x308524['map'](_0x7d0eb4=>{const _0x29fdd7=_0x14e66c,_0x5af1a7=_0x7d0eb4['last_job']?.[_0x29fdd7(0x1a9)]?_0x7d0eb4['last_job']['status']===_0x29fdd7(0x1e1)?'βœ“':'βœ—':'-',_0x4dc131=_0x7d0eb4[_0x29fdd7(0x1e2)]?.[_0x29fdd7(0x1e6)]?formatRelativeTime(_0x7d0eb4['last_job']['ended_at']):'never',_0xf9512e=_0x7d0eb4[_0x29fdd7(0x1ae)]?formatRelativeTime(_0x7d0eb4['next_run_at']):'-',_0x2694f3=_0x7d0eb4[_0x29fdd7(0x210)]||'',_0x53d299=_0x7d0eb4[_0x29fdd7(0x1e0)]||_0x29fdd7(0x1f8),_0x3195fa=getConsoleUrl(_0x27f4a2,_0x29fdd7(0x1b6)+_0x7d0eb4['id']);return{'statusIcon':_0x5af1a7,'lastRun':_0x4dc131,'nextRun':_0xf9512e,'cron':_0x2694f3,'name':_0x53d299,'queryUrl':_0x3195fa,'status':_0x7d0eb4[_0x29fdd7(0x1e2)]?.[_0x29fdd7(0x1a9)]};}),_0x47f616=Math[_0x14e66c(0x1b9)](..._0x5c5017[_0x14e66c(0x1c9)](_0x171d85=>_0x171d85[_0x14e66c(0x1ea)][_0x14e66c(0x1de)])),_0x6c7385=Math[_0x14e66c(0x1b9)](..._0x5c5017[_0x14e66c(0x1c9)](_0x17a7de=>_0x17a7de['nextRun']['length'])),_0xd5e3fa=Math[_0x14e66c(0x1b9)](..._0x5c5017[_0x14e66c(0x1c9)](_0x2188cd=>_0x2188cd['cron'][_0x14e66c(0x1de)])),_0x5064ae=_0x5c5017[_0x14e66c(0x1c9)](_0x5c27da=>{const _0x1fbf22=_0x14e66c,_0x21fee8=_0x5c27da[_0x1fbf22(0x1a9)]===_0x1fbf22(0x1e1)?a30_0x1aee3b[_0x1fbf22(0x1fe)](_0x5c27da['statusIcon']):_0x5c27da[_0x1fbf22(0x1a9)]===_0x1fbf22(0x1f4)?a30_0x1aee3b[_0x1fbf22(0x1ab)](_0x5c27da[_0x1fbf22(0x1ce)]):a30_0x1aee3b['dim'](_0x5c27da[_0x1fbf22(0x1ce)]),_0x1c5864=_0x5c27da['lastRun'][_0x1fbf22(0x1b3)](_0x47f616),_0x499a9b=_0x5c27da['nextRun'][_0x1fbf22(0x1b3)](_0x6c7385),_0x1c31d1=_0x5c27da[_0x1fbf22(0x210)]?a30_0x1aee3b[_0x1fbf22(0x19c)](_0x5c27da['cron'][_0x1fbf22(0x1b3)](_0xd5e3fa)):'\x20'[_0x1fbf22(0x196)](_0xd5e3fa),_0x1df67d=hyperlink(_0x5c27da[_0x1fbf22(0x1e0)],_0x5c27da[_0x1fbf22(0x1fb)]);return'πŸ“…\x20'+_0x21fee8+'\x20'+_0x1c5864+'\x20\x20β†’\x20'+_0x499a9b+'\x20\x20'+_0x1c31d1+'\x20\x20'+_0x1df67d;});await writeOutput(_0x5064ae[_0x14e66c(0x1cc)]('\x0a'),_0x53c5e5['output'],_0x14e66c(0x1bb));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]=a30_0x5c10b4(0x1fd);[a30_0x5c10b4(0x1fc)]=a30_0x5c10b4(0x1dc);[a30_0x5c10b4(0x19b)](_0x3e5045){const _0x4d6491=a30_0x5c10b4,_0x2bf087=_0x3e5045[_0x4d6491(0x1d6)][0x0];if(!_0x2bf087)return _0x4d6491(0x215);return undefined;}async[a30_0x5c10b4(0x1a4)](_0x1e1083){const _0x5d97f7=a30_0x5c10b4,{options:_0x9a6d20,args:_0x2d5299,tdx:_0x569c9c}=_0x1e1083,_0x5e1396=_0x2d5299[0x0],_0x3ebaad=await withSpinner(_0x5d97f7(0x199),()=>_0x569c9c[_0x5d97f7(0x1f1)][_0x5d97f7(0x1d3)](_0x5e1396),{'verbose':_0x9a6d20['verbose']}),_0x36a3b0=_0x3ebaad['data'],_0x506b88={'name':_0x36a3b0[_0x5d97f7(0x1e0)],'cron':_0x36a3b0[_0x5d97f7(0x210)],'database':_0x36a3b0[_0x5d97f7(0x1ed)],'type':_0x36a3b0[_0x5d97f7(0x20a)],'timezone':_0x36a3b0['timezone'],'user_name':_0x36a3b0[_0x5d97f7(0x1cf)],'created_at':_0x36a3b0['created_at'],'engine_version':_0x36a3b0[_0x5d97f7(0x193)],'executing_user_id':_0x36a3b0[_0x5d97f7(0x211)],'query':_0x36a3b0[_0x5d97f7(0x1c0)],'delay':_0x36a3b0[_0x5d97f7(0x1b4)],'priority':_0x36a3b0[_0x5d97f7(0x1f7)],'retry_limit':_0x36a3b0[_0x5d97f7(0x1ac)],..._0x36a3b0[_0x5d97f7(0x190)]&&{'result':_0x36a3b0[_0x5d97f7(0x190)]}};return await handleSingleObjectOutput(_0x506b88,_0x9a6d20),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]=a30_0x5c10b4(0x1db);[a30_0x5c10b4(0x1fc)]='Create\x20a\x20scheduled\x20query';[a30_0x5c10b4(0x19b)](_0x103a84){const _0x698dca=a30_0x5c10b4,_0x50474e=_0x103a84['args'][0x0];if(!_0x50474e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x157e05=_0x103a84[_0x698dca(0x1c5)];if(!_0x157e05[_0x698dca(0x1ed)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async['execute'](_0x24641b){const _0x5a6ea0=a30_0x5c10b4,{options:_0x35f7d4,args:_0x1a47d6,tdx:_0xd31f43}=_0x24641b,_0x39de12=_0x1a47d6[0x0],_0x322c47=_0x35f7d4,_0x3cc1f4=_0x322c47['database'],_0x3849d9=_0x322c47['file'],_0xa7c402=_0x322c47[_0x5a6ea0(0x20a)]||'trino';let _0x467479;try{_0x467479=readFileSync(_0x3849d9,_0x5a6ea0(0x1bc))[_0x5a6ea0(0x208)]();}catch(_0x13a35e){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5a6ea0(0x195)+_0x3849d9,_0x13a35e instanceof Error?_0x13a35e:undefined);}if(!_0x467479)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5a6ea0(0x1a0));const _0x4cdf78={'database':_0x3cc1f4,'query':_0x467479,'type':_0xa7c402};if(_0x322c47['cron'])_0x4cdf78[_0x5a6ea0(0x210)]=_0x322c47[_0x5a6ea0(0x210)];if(_0x322c47['timezone'])_0x4cdf78[_0x5a6ea0(0x1eb)]=_0x322c47[_0x5a6ea0(0x1eb)];if(_0x322c47[_0x5a6ea0(0x1b4)]!==undefined)_0x4cdf78[_0x5a6ea0(0x1b4)]=Number(_0x322c47['delay']);if(_0x322c47[_0x5a6ea0(0x1f7)]!==undefined)_0x4cdf78[_0x5a6ea0(0x1f7)]=Number(_0x322c47['priority']);if(_0x322c47[_0x5a6ea0(0x19e)]!==undefined)_0x4cdf78[_0x5a6ea0(0x1ac)]=Number(_0x322c47['retryLimit']);if(_0x322c47[_0x5a6ea0(0x1ba)])_0x4cdf78[_0x5a6ea0(0x193)]=_0x322c47[_0x5a6ea0(0x1ba)];if(_0x322c47[_0x5a6ea0(0x190)])_0x4cdf78['result']=_0x322c47[_0x5a6ea0(0x190)];if(_0x35f7d4[_0x5a6ea0(0x20c)]){console[_0x5a6ea0(0x1f4)](_0x5a6ea0(0x214)+_0x39de12),console['error'](_0x5a6ea0(0x1f9)+_0x3cc1f4),console[_0x5a6ea0(0x1f4)]('\x20\x20Type:\x20'+_0xa7c402);if(_0x4cdf78[_0x5a6ea0(0x210)])console[_0x5a6ea0(0x1f4)](_0x5a6ea0(0x1c2)+_0x4cdf78[_0x5a6ea0(0x210)]);if(_0x4cdf78[_0x5a6ea0(0x1eb)])console['error'](_0x5a6ea0(0x1b8)+_0x4cdf78[_0x5a6ea0(0x1eb)]);}const _0xa4cac3=await withSpinner('Creating\x20schedule...',()=>_0xd31f43[_0x5a6ea0(0x1f1)]['create'](_0x39de12,_0x4cdf78),{'verbose':_0x35f7d4[_0x5a6ea0(0x20c)]});return console[_0x5a6ea0(0x1f4)]('Schedule\x20created:\x20'+_0xa4cac3[_0x5a6ea0(0x1f0)][_0x5a6ea0(0x1e0)]),await handleSingleObjectOutput(_0xa4cac3[_0x5a6ea0(0x1f0)],_0x35f7d4),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]=a30_0x5c10b4(0x1d4);[a30_0x5c10b4(0x1fc)]=a30_0x5c10b4(0x197);[a30_0x5c10b4(0x19b)](_0x1af1be){const _0x4038fe=a30_0x5c10b4,_0x69b2c8=_0x1af1be[_0x4038fe(0x1d6)][0x0];if(!_0x69b2c8)return _0x4038fe(0x19f);return undefined;}async[a30_0x5c10b4(0x1a4)](_0x258b8c){const _0x1f0457=a30_0x5c10b4,{options:_0x54127d,args:_0x3bc788,tdx:_0x1f0b0a}=_0x258b8c,_0x1f7906=_0x3bc788[0x0],_0x1b7586=_0x54127d,_0x17ea95={};if(_0x1b7586[_0x1f0457(0x1ed)])_0x17ea95[_0x1f0457(0x1ed)]=_0x1b7586[_0x1f0457(0x1ed)];if(_0x1b7586[_0x1f0457(0x20a)])_0x17ea95['type']=_0x1b7586[_0x1f0457(0x20a)];if(_0x1b7586[_0x1f0457(0x210)])_0x17ea95['cron']=_0x1b7586[_0x1f0457(0x210)];if(_0x1b7586[_0x1f0457(0x1eb)])_0x17ea95[_0x1f0457(0x1eb)]=_0x1b7586['timezone'];if(_0x1b7586[_0x1f0457(0x1b4)]!==undefined)_0x17ea95[_0x1f0457(0x1b4)]=Number(_0x1b7586[_0x1f0457(0x1b4)]);if(_0x1b7586[_0x1f0457(0x1f7)]!==undefined)_0x17ea95[_0x1f0457(0x1f7)]=Number(_0x1b7586['priority']);if(_0x1b7586[_0x1f0457(0x19e)]!==undefined)_0x17ea95[_0x1f0457(0x1ac)]=Number(_0x1b7586[_0x1f0457(0x19e)]);if(_0x1b7586['engineVersion'])_0x17ea95[_0x1f0457(0x193)]=_0x1b7586[_0x1f0457(0x1ba)];if(_0x1b7586[_0x1f0457(0x190)])_0x17ea95['result']=_0x1b7586['result'];if(_0x1b7586[_0x1f0457(0x206)])try{_0x17ea95[_0x1f0457(0x1c0)]=readFileSync(_0x1b7586[_0x1f0457(0x206)],_0x1f0457(0x1bc))[_0x1f0457(0x208)]();}catch(_0x4d344d){throw new SDKError(ErrorCode[_0x1f0457(0x20e)],'Failed\x20to\x20read\x20file:\x20'+_0x1b7586[_0x1f0457(0x206)],_0x4d344d instanceof Error?_0x4d344d:undefined);}if(Object[_0x1f0457(0x1ef)](_0x17ea95)['length']===0x0)throw new SDKError(ErrorCode[_0x1f0457(0x20e)],_0x1f0457(0x1ee));if(_0x54127d['verbose']){console[_0x1f0457(0x1f4)](_0x1f0457(0x1bd)+_0x1f7906);for(const [_0xe5ca4,_0x1e0e14]of Object['entries'](_0x17ea95)){_0xe5ca4===_0x1f0457(0x1c0)?console[_0x1f0457(0x1f4)]('\x20\x20'+_0xe5ca4+':\x20'+_0x1e0e14[_0x1f0457(0x1d2)](0x0,0x32)+_0x1f0457(0x1d7)):console['error']('\x20\x20'+_0xe5ca4+':\x20'+_0x1e0e14);}}const _0x375ca3=await withSpinner(_0x1f0457(0x191),()=>_0x1f0b0a[_0x1f0457(0x1f1)][_0x1f0457(0x1aa)](_0x1f7906,_0x17ea95),{'verbose':_0x54127d[_0x1f0457(0x20c)]});return console[_0x1f0457(0x1f4)](_0x1f0457(0x18f)+_0x375ca3[_0x1f0457(0x1f0)][_0x1f0457(0x1e0)]),await handleSingleObjectOutput(_0x375ca3['data'],_0x54127d),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a30_0x5c10b4(0x204);[a30_0x5c10b4(0x1fc)]=a30_0x5c10b4(0x192);[a30_0x5c10b4(0x19b)](_0x20a8e5){const _0x1660f4=a30_0x5c10b4,_0x1b3b48=_0x20a8e5[_0x1660f4(0x1d6)][0x0];if(!_0x1b3b48)return _0x1660f4(0x1b1);return undefined;}async[a30_0x5c10b4(0x1a4)](_0x2114dd){const _0x17a345=a30_0x5c10b4,{options:_0x375f02,args:_0x316ef4,tdx:_0x12d05e}=_0x2114dd,_0x3da8c4=_0x316ef4[0x0];if(!_0x375f02[_0x17a345(0x1b2)]){const _0x487857=await confirm(_0x17a345(0x213)+_0x3da8c4+'\x22?');if(!_0x487857)return console[_0x17a345(0x1f4)]('Cancelled'),0x0;}const _0x131c77=await withSpinner(_0x17a345(0x1d8),()=>_0x12d05e[_0x17a345(0x1f1)][_0x17a345(0x1e4)](_0x3da8c4),{'verbose':_0x375f02['verbose']});return console[_0x17a345(0x1f4)](_0x17a345(0x19a)+_0x131c77[_0x17a345(0x1f0)][_0x17a345(0x1e0)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']='schedule:run';['description']=a30_0x5c10b4(0x1e8);[a30_0x5c10b4(0x19b)](_0x15d2a2){const _0x1dbb71=a30_0x5c10b4,_0x45b6fb=_0x15d2a2[_0x1dbb71(0x1d6)][0x0];if(!_0x45b6fb)return _0x1dbb71(0x1d9);return undefined;}async[a30_0x5c10b4(0x1a4)](_0x512f59){const _0x125dc3=a30_0x5c10b4,{options:_0x2634e0,args:_0x525c4f,tdx:_0x25148e}=_0x512f59,_0xc8d643=_0x525c4f[0x0],_0x19842a=_0x2634e0,_0x113d49=_0x19842a[_0x125dc3(0x1f2)],_0x37d475=_0x19842a['num']!==undefined?Number(_0x19842a[_0x125dc3(0x1c1)]):undefined;if(_0x2634e0['verbose']){console[_0x125dc3(0x1f4)](_0x125dc3(0x1bf)+_0xc8d643);if(_0x113d49)console[_0x125dc3(0x1f4)](_0x125dc3(0x1cb)+_0x113d49);if(_0x37d475)console[_0x125dc3(0x1f4)](_0x125dc3(0x1c6)+_0x37d475);}const _0x2e8d24=await withSpinner(_0x125dc3(0x1a7),()=>_0x25148e[_0x125dc3(0x1f1)]['run'](_0xc8d643,{'time':_0x113d49,'num':_0x37d475}),{'verbose':_0x2634e0[_0x125dc3(0x20c)]}),_0x46d1c0=_0x2e8d24[_0x125dc3(0x1f0)][_0x125dc3(0x1d1)];console['error'](_0x125dc3(0x1a2)+_0x46d1c0[_0x125dc3(0x1de)]+'\x20job'+(_0x46d1c0[_0x125dc3(0x1de)]!==0x1?'s':'')+'\x20created');for(const _0x30546e of _0x46d1c0){console[_0x125dc3(0x1f4)]('\x20\x20Job\x20ID:\x20'+_0x30546e[_0x125dc3(0x1be)]);}return await handleSDKOutput(_0x46d1c0,_0x2634e0),0x0;}}function a30_0x2541(_0x455095,_0x52db51){_0x455095=_0x455095-0x18f;const _0x17fb6c=a30_0x17fb();let _0x254132=_0x17fb6c[_0x455095];return _0x254132;}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]=a30_0x5c10b4(0x1c7);[a30_0x5c10b4(0x1fc)]=a30_0x5c10b4(0x1b5);['validate'](_0x35e6ca){const _0x1e1458=a30_0x5c10b4,_0x293a34=_0x35e6ca[_0x1e1458(0x1d6)][0x0];if(!_0x293a34)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a30_0x5c10b4(0x1a4)](_0x40018b){const _0x25bab1=a30_0x5c10b4,{options:_0xf3e2dc,args:_0x3f4a36,tdx:_0x246c60}=_0x40018b,_0xa8956d=_0x3f4a36[0x0],_0x5aa755=_0xf3e2dc,_0x1a5686=_0x5aa755['from']!==undefined?Number(_0x5aa755[_0x25bab1(0x1a3)]):undefined,_0x1eb37a=_0x5aa755['to']!==undefined?Number(_0x5aa755['to']):undefined,_0x33edc5=await withSpinner('Getting\x20schedule\x20history...',()=>_0x246c60[_0x25bab1(0x1f1)][_0x25bab1(0x1f5)](_0xa8956d,{'from':_0x1a5686,'to':_0x1eb37a}),{'verbose':_0xf3e2dc[_0x25bab1(0x20c)]}),_0x4ebb09=_0x33edc5['data'];console['error'](_0x25bab1(0x209)+_0x4ebb09[_0x25bab1(0x1fa)]+'\x20execution'+(_0x4ebb09[_0x25bab1(0x1fa)]!==0x1?'s':'')+_0x25bab1(0x1df)+_0x4ebb09[_0x25bab1(0x1a3)]+'-'+_0x4ebb09['to']+')');const _0x440467=_0x4ebb09[_0x25bab1(0x1f5)][_0x25bab1(0x1c9)](_0x178def=>({'job_id':_0x178def[_0x25bab1(0x1be)],'type':_0x178def[_0x25bab1(0x20a)],'status':_0x178def[_0x25bab1(0x1a9)],'scheduled_at':_0x178def[_0x25bab1(0x1af)],'created_at':_0x178def[_0x25bab1(0x1ff)],'start_at':_0x178def['start_at'],'end_at':_0x178def[_0x25bab1(0x1e7)]}));return await handleSDKOutput(_0x440467,_0xf3e2dc),0x0;}}
1
+ const a30_0x3f1c4d=a30_0x5e09;(function(_0x1be752,_0x3fc358){const _0x4bb3d9=a30_0x5e09,_0x20a03c=_0x1be752();while(!![]){try{const _0x32aa04=-parseInt(_0x4bb3d9(0x213))/0x1+-parseInt(_0x4bb3d9(0x1eb))/0x2*(-parseInt(_0x4bb3d9(0x254))/0x3)+parseInt(_0x4bb3d9(0x23f))/0x4+-parseInt(_0x4bb3d9(0x26d))/0x5*(-parseInt(_0x4bb3d9(0x208))/0x6)+parseInt(_0x4bb3d9(0x20f))/0x7*(-parseInt(_0x4bb3d9(0x26a))/0x8)+-parseInt(_0x4bb3d9(0x25b))/0x9+-parseInt(_0x4bb3d9(0x233))/0xa*(-parseInt(_0x4bb3d9(0x22f))/0xb);if(_0x32aa04===_0x3fc358)break;else _0x20a03c['push'](_0x20a03c['shift']());}catch(_0x2917dc){_0x20a03c['push'](_0x20a03c['shift']());}}}(a30_0x17ef,0xca2b1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x16abd3 from'chalk';function formatRelativeTime(_0x47d8a5){const _0x215ef8=a30_0x5e09,_0x1aa660=new Date(_0x47d8a5),_0x29d050=new Date(),_0x572feb=_0x1aa660[_0x215ef8(0x24b)]()-_0x29d050[_0x215ef8(0x24b)](),_0x4fd95d=Math[_0x215ef8(0x22e)](_0x572feb)/0x3e8,_0x44674f=_0x572feb<0x0;if(_0x4fd95d<0x3c)return _0x44674f?_0x215ef8(0x240):_0x215ef8(0x202);else{if(_0x4fd95d<0xe10){const _0xa677d8=Math[_0x215ef8(0x226)](_0x4fd95d/0x3c);return _0x44674f?_0xa677d8+_0x215ef8(0x207):_0x215ef8(0x1ef)+_0xa677d8+'m';}else{if(_0x4fd95d<0x15180){const _0x14a26e=Math[_0x215ef8(0x226)](_0x4fd95d/0xe10);return _0x44674f?_0x14a26e+_0x215ef8(0x218):'in\x20'+_0x14a26e+'h';}else{if(_0x4fd95d<0x93a80){const _0x2ab634=Math['round'](_0x4fd95d/0x15180);return _0x44674f?_0x2ab634+_0x215ef8(0x228):_0x215ef8(0x1ef)+_0x2ab634+'d';}else return _0x1aa660[_0x215ef8(0x1f3)]();}}}}export class ScheduleListCommand extends BaseCommand{['name']=a30_0x3f1c4d(0x272);['description']=a30_0x3f1c4d(0x227);async[a30_0x3f1c4d(0x1e9)](_0x5411d2){const _0x48d875=a30_0x3f1c4d,{options:_0x52b61c,args:_0x556d5e,tdx:_0x45d47b}=_0x5411d2,_0x1650b9=resolveLimit(_0x52b61c['limit'],DEFAULT_DISPLAY_LIMIT),_0x31f0c8=_0x556d5e[0x0],_0x48f056=_0x31f0c8?_0x48d875(0x23d)+_0x31f0c8+_0x48d875(0x1fb):_0x48d875(0x24a),_0x210038=await withSpinner(_0x48f056,()=>_0x45d47b['schedules'][_0x48d875(0x209)]({'limit':_0x1650b9,'scheduled':!![],'pattern':_0x31f0c8}),{'verbose':_0x52b61c[_0x48d875(0x21b)]}),_0x401b8b=_0x210038[_0x48d875(0x23e)][_0x48d875(0x267)],_0x430e25=_0x210038[_0x48d875(0x23e)][_0x48d875(0x223)][_0x48d875(0x20a)],_0x27f06e=_0x31f0c8?'\x20matching\x20\x22'+_0x31f0c8+'\x22':'';_0x430e25?console[_0x48d875(0x1ea)](_0x48d875(0x24c)+_0x401b8b[_0x48d875(0x216)]+'\x20schedules'+_0x27f06e+_0x48d875(0x236)):console['error'](_0x48d875(0x276)+_0x401b8b[_0x48d875(0x216)]+_0x48d875(0x205)+(_0x401b8b['length']!==0x1?_0x48d875(0x25f):'y')+_0x27f06e);if(_0x52b61c[_0x48d875(0x273)]===_0x48d875(0x21c)||_0x52b61c['format']===_0x48d875(0x1fd)||_0x52b61c[_0x48d875(0x273)]===_0x48d875(0x26c)||_0x52b61c[_0x48d875(0x273)]===_0x48d875(0x262)){const _0x20480d=_0x401b8b['map'](_0x107f6c=>({'id':_0x107f6c['id'],'name':_0x107f6c['name'],'cron':_0x107f6c[_0x48d875(0x212)],'database':_0x107f6c[_0x48d875(0x1f5)]?.[_0x48d875(0x237)],'type':_0x107f6c[_0x48d875(0x21f)],'timezone':_0x107f6c[_0x48d875(0x1f7)],'user_name':_0x107f6c['user']?.[_0x48d875(0x237)],'updated_at':_0x107f6c[_0x48d875(0x1ed)],'next_run_at':_0x107f6c['next_run_at'],'last_job_status':_0x107f6c[_0x48d875(0x22d)]?.[_0x48d875(0x1f9)]}));await handleSDKOutput(_0x20480d,_0x52b61c);}else{if(_0x401b8b[_0x48d875(0x216)]===0x0)console[_0x48d875(0x1ec)](_0x48d875(0x20d));else{const _0x279eb5=_0x52b61c[_0x48d875(0x1f0)],_0x4b8e91=_0x401b8b[_0x48d875(0x25e)](_0x10555b=>{const _0x32e34c=_0x48d875,_0x5ba5b6=_0x10555b[_0x32e34c(0x22d)]?.[_0x32e34c(0x1f9)]?_0x10555b['last_job'][_0x32e34c(0x1f9)]===_0x32e34c(0x268)?'βœ“':'βœ—':'-',_0x2ef144=_0x10555b['last_job']?.[_0x32e34c(0x265)]?formatRelativeTime(_0x10555b[_0x32e34c(0x22d)][_0x32e34c(0x265)]):_0x32e34c(0x257),_0x399a4b=_0x10555b[_0x32e34c(0x232)]?formatRelativeTime(_0x10555b[_0x32e34c(0x232)]):'-',_0x27f07e=_0x10555b[_0x32e34c(0x212)]||'',_0x4c1d48=_0x10555b['name']||'(unnamed)',_0x10ae47=getConsoleUrl(_0x279eb5,_0x32e34c(0x256)+_0x10555b['id']);return{'statusIcon':_0x5ba5b6,'lastRun':_0x2ef144,'nextRun':_0x399a4b,'cron':_0x27f07e,'name':_0x4c1d48,'queryUrl':_0x10ae47,'status':_0x10555b[_0x32e34c(0x22d)]?.['status']};}),_0x5be0cc=Math['max'](..._0x4b8e91[_0x48d875(0x25e)](_0xbb2d9c=>_0xbb2d9c[_0x48d875(0x21e)][_0x48d875(0x216)])),_0x5f55c5=Math[_0x48d875(0x253)](..._0x4b8e91[_0x48d875(0x25e)](_0xc52743=>_0xc52743[_0x48d875(0x1fa)]['length'])),_0x1c0d88=Math[_0x48d875(0x253)](..._0x4b8e91[_0x48d875(0x25e)](_0x25b0f0=>_0x25b0f0['cron'][_0x48d875(0x216)])),_0x39991b=_0x4b8e91[_0x48d875(0x25e)](_0xa7f418=>{const _0x596fc=_0x48d875,_0x12175=_0xa7f418['status']===_0x596fc(0x268)?a30_0x16abd3[_0x596fc(0x215)](_0xa7f418[_0x596fc(0x249)]):_0xa7f418[_0x596fc(0x1f9)]===_0x596fc(0x1ea)?a30_0x16abd3[_0x596fc(0x259)](_0xa7f418[_0x596fc(0x249)]):a30_0x16abd3[_0x596fc(0x274)](_0xa7f418[_0x596fc(0x249)]),_0x44e780=_0xa7f418['lastRun'][_0x596fc(0x23a)](_0x5be0cc),_0x5a4704=_0xa7f418[_0x596fc(0x1fa)][_0x596fc(0x23a)](_0x5f55c5),_0x3acaaf=_0xa7f418[_0x596fc(0x212)]?a30_0x16abd3[_0x596fc(0x244)](_0xa7f418[_0x596fc(0x212)][_0x596fc(0x23a)](_0x1c0d88)):'\x20'['repeat'](_0x1c0d88),_0x21ac73=hyperlink(_0xa7f418[_0x596fc(0x237)],_0xa7f418['queryUrl']);return _0x596fc(0x275)+_0x12175+'\x20'+_0x44e780+_0x596fc(0x217)+_0x5a4704+'\x20\x20'+_0x3acaaf+'\x20\x20'+_0x21ac73;});await writeOutput(_0x39991b[_0x48d875(0x26f)]('\x0a'),_0x52b61c['output'],_0x48d875(0x1f2));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]=a30_0x3f1c4d(0x22b);[a30_0x3f1c4d(0x24e)]='Show\x20schedule\x20details';[a30_0x3f1c4d(0x231)](_0x209517){const _0x593ee8=a30_0x3f1c4d,_0x2f081c=_0x209517['args'][0x0];if(!_0x2f081c)return _0x593ee8(0x270);return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x174660){const _0x4f1145=a30_0x3f1c4d,{options:_0x3bd651,args:_0x407d72,tdx:_0x3a9ed9}=_0x174660,_0xb433bc=_0x407d72[0x0],_0x4fe2d5=await withSpinner(_0x4f1145(0x203),()=>_0x3a9ed9[_0x4f1145(0x230)]['show'](_0xb433bc),{'verbose':_0x3bd651[_0x4f1145(0x21b)]}),_0x555f4e=_0x4fe2d5[_0x4f1145(0x23e)],_0x102712={'name':_0x555f4e[_0x4f1145(0x237)],'cron':_0x555f4e['cron'],'database':_0x555f4e[_0x4f1145(0x1f5)],'type':_0x555f4e['type'],'timezone':_0x555f4e[_0x4f1145(0x271)],'user_name':_0x555f4e[_0x4f1145(0x21a)],'created_at':_0x555f4e[_0x4f1145(0x25d)],'engine_version':_0x555f4e['engine_version'],'executing_user_id':_0x555f4e[_0x4f1145(0x23c)],'query':_0x555f4e[_0x4f1145(0x242)],'delay':_0x555f4e[_0x4f1145(0x21d)],'priority':_0x555f4e[_0x4f1145(0x1f1)],'retry_limit':_0x555f4e['retry_limit'],..._0x555f4e[_0x4f1145(0x248)]&&{'result':_0x555f4e['result']}};return await handleSingleObjectOutput(_0x102712,_0x3bd651),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]=a30_0x3f1c4d(0x239);[a30_0x3f1c4d(0x24e)]=a30_0x3f1c4d(0x258);[a30_0x3f1c4d(0x231)](_0x5c5f89){const _0x42f684=a30_0x3f1c4d,_0x5e21b7=_0x5c5f89['args'][0x0];if(!_0x5e21b7)return _0x42f684(0x241);const _0x45f466=_0x5c5f89[_0x42f684(0x247)];if(!_0x45f466[_0x42f684(0x1f5)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x5cb754){const _0x43d95c=a30_0x3f1c4d,{options:_0x5f3977,args:_0x48e21c,tdx:_0xdc6160}=_0x5cb754,_0x1302a6=_0x48e21c[0x0],_0xc5a913=_0x5f3977,_0x56a8c2=_0xc5a913[_0x43d95c(0x1f5)],_0x684831=_0xc5a913['file'],_0x42e103=_0xc5a913['type']||_0x43d95c(0x1f8);let _0xa7f480;try{_0xa7f480=readFileSync(_0x684831,_0x43d95c(0x24d))['trim']();}catch(_0xb21ac6){throw new SDKError(ErrorCode[_0x43d95c(0x24f)],_0x43d95c(0x246)+_0x684831,_0xb21ac6 instanceof Error?_0xb21ac6:undefined);}if(!_0xa7f480)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x43d95c(0x235));const _0x22ef6b={'database':_0x56a8c2,'query':_0xa7f480,'type':_0x42e103};if(_0xc5a913[_0x43d95c(0x212)])_0x22ef6b[_0x43d95c(0x212)]=_0xc5a913['cron'];if(_0xc5a913[_0x43d95c(0x271)])_0x22ef6b[_0x43d95c(0x271)]=_0xc5a913[_0x43d95c(0x271)];if(_0xc5a913['delay']!==undefined)_0x22ef6b[_0x43d95c(0x21d)]=Number(_0xc5a913[_0x43d95c(0x21d)]);if(_0xc5a913[_0x43d95c(0x1f1)]!==undefined)_0x22ef6b[_0x43d95c(0x1f1)]=Number(_0xc5a913[_0x43d95c(0x1f1)]);if(_0xc5a913[_0x43d95c(0x255)]!==undefined)_0x22ef6b['retry_limit']=Number(_0xc5a913[_0x43d95c(0x255)]);if(_0xc5a913[_0x43d95c(0x222)])_0x22ef6b[_0x43d95c(0x219)]=_0xc5a913[_0x43d95c(0x222)];if(_0xc5a913[_0x43d95c(0x248)])_0x22ef6b['result']=_0xc5a913[_0x43d95c(0x248)];if(_0x5f3977['verbose']){console['error'](_0x43d95c(0x264)+_0x1302a6),console['error'](_0x43d95c(0x20b)+_0x56a8c2),console[_0x43d95c(0x1ea)](_0x43d95c(0x1e5)+_0x42e103);if(_0x22ef6b[_0x43d95c(0x212)])console['error'](_0x43d95c(0x234)+_0x22ef6b[_0x43d95c(0x212)]);if(_0x22ef6b[_0x43d95c(0x271)])console[_0x43d95c(0x1ea)](_0x43d95c(0x214)+_0x22ef6b[_0x43d95c(0x271)]);}const _0x5cbeb1=await withSpinner(_0x43d95c(0x238),()=>_0xdc6160[_0x43d95c(0x230)][_0x43d95c(0x1fe)](_0x1302a6,_0x22ef6b),{'verbose':_0x5f3977['verbose']});return console[_0x43d95c(0x1ea)]('Schedule\x20created:\x20'+_0x5cbeb1[_0x43d95c(0x23e)][_0x43d95c(0x237)]),await handleSingleObjectOutput(_0x5cbeb1[_0x43d95c(0x23e)],_0x5f3977),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]='schedule:update';[a30_0x3f1c4d(0x24e)]=a30_0x3f1c4d(0x263);['validate'](_0x5ab85f){const _0x460aa7=a30_0x3f1c4d,_0xd1886a=_0x5ab85f[_0x460aa7(0x229)][0x0];if(!_0xd1886a)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x1a537b){const _0x3f3a8b=a30_0x3f1c4d,{options:_0x286300,args:_0x1d6074,tdx:_0x5343c8}=_0x1a537b,_0x3d4a6e=_0x1d6074[0x0],_0x8c5b85=_0x286300,_0x2f1b31={};if(_0x8c5b85['database'])_0x2f1b31[_0x3f3a8b(0x1f5)]=_0x8c5b85['database'];if(_0x8c5b85['type'])_0x2f1b31[_0x3f3a8b(0x21f)]=_0x8c5b85[_0x3f3a8b(0x21f)];if(_0x8c5b85[_0x3f3a8b(0x212)])_0x2f1b31[_0x3f3a8b(0x212)]=_0x8c5b85['cron'];if(_0x8c5b85[_0x3f3a8b(0x271)])_0x2f1b31[_0x3f3a8b(0x271)]=_0x8c5b85[_0x3f3a8b(0x271)];if(_0x8c5b85[_0x3f3a8b(0x21d)]!==undefined)_0x2f1b31[_0x3f3a8b(0x21d)]=Number(_0x8c5b85[_0x3f3a8b(0x21d)]);if(_0x8c5b85[_0x3f3a8b(0x1f1)]!==undefined)_0x2f1b31['priority']=Number(_0x8c5b85[_0x3f3a8b(0x1f1)]);if(_0x8c5b85[_0x3f3a8b(0x255)]!==undefined)_0x2f1b31['retry_limit']=Number(_0x8c5b85[_0x3f3a8b(0x255)]);if(_0x8c5b85[_0x3f3a8b(0x222)])_0x2f1b31[_0x3f3a8b(0x219)]=_0x8c5b85['engineVersion'];if(_0x8c5b85[_0x3f3a8b(0x248)])_0x2f1b31[_0x3f3a8b(0x248)]=_0x8c5b85[_0x3f3a8b(0x248)];if(_0x8c5b85[_0x3f3a8b(0x1fc)])try{_0x2f1b31[_0x3f3a8b(0x242)]=readFileSync(_0x8c5b85[_0x3f3a8b(0x1fc)],_0x3f3a8b(0x24d))[_0x3f3a8b(0x23b)]();}catch(_0x23e51b){throw new SDKError(ErrorCode[_0x3f3a8b(0x24f)],'Failed\x20to\x20read\x20file:\x20'+_0x8c5b85[_0x3f3a8b(0x1fc)],_0x23e51b instanceof Error?_0x23e51b:undefined);}if(Object[_0x3f3a8b(0x224)](_0x2f1b31)[_0x3f3a8b(0x216)]===0x0)throw new SDKError(ErrorCode[_0x3f3a8b(0x24f)],_0x3f3a8b(0x1e8));if(_0x286300[_0x3f3a8b(0x21b)]){console[_0x3f3a8b(0x1ea)]('Updating\x20schedule:\x20'+_0x3d4a6e);for(const [_0x3d525a,_0x172d46]of Object[_0x3f3a8b(0x260)](_0x2f1b31)){_0x3d525a===_0x3f3a8b(0x242)?console[_0x3f3a8b(0x1ea)]('\x20\x20'+_0x3d525a+':\x20'+_0x172d46[_0x3f3a8b(0x1ff)](0x0,0x32)+_0x3f3a8b(0x1f4)):console['error']('\x20\x20'+_0x3d525a+':\x20'+_0x172d46);}}const _0x32d5f9=await withSpinner(_0x3f3a8b(0x22c),()=>_0x5343c8[_0x3f3a8b(0x230)][_0x3f3a8b(0x26b)](_0x3d4a6e,_0x2f1b31),{'verbose':_0x286300['verbose']});return console[_0x3f3a8b(0x1ea)]('Schedule\x20updated:\x20'+_0x32d5f9[_0x3f3a8b(0x23e)][_0x3f3a8b(0x237)]),await handleSingleObjectOutput(_0x32d5f9[_0x3f3a8b(0x23e)],_0x286300),0x0;}}function a30_0x5e09(_0xc785cd,_0x433c75){_0xc785cd=_0xc785cd-0x1e5;const _0x17eff9=a30_0x17ef();let _0x5e0976=_0x17eff9[_0xc785cd];return _0x5e0976;}function a30_0x17ef(){const _0x121de7=['updated_at','scheduled_at','in\x20','site','priority','list','toLocaleDateString','...','database','history','time_zone','trino','status','nextRun','\x22...','file','jsonl','create','substring','Deleting\x20schedule...','Run\x20a\x20scheduled\x20query\x20immediately','soon','Getting\x20schedule\x20details...','schedule:run','\x20scheduled\x20quer','\x20\x20Time:\x20','m\x20ago','30PYIDns','listQueries','has_next_page','\x20\x20Database:\x20','end_at','No\x20scheduled\x20queries\x20found','Running\x20schedule...','3247594QfWoPk','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Getting\x20schedule\x20history...','cron','806502mDnCGw','\x20\x20Timezone:\x20','green','length','\x20\x20β†’\x20','h\x20ago','engine_version','user_name','verbose','json','delay','lastRun','type','from','Schedule\x20deleted:\x20','engineVersion','pagination','keys','num','round','List\x20scheduled\x20queries','d\x20ago','args','Schedule\x20run\x20submitted:\x20','schedule:show','Updating\x20schedule...','last_job','abs','1716539CkNCwT','schedules','validate','next_run_at','70rPDZIr','\x20\x20Cron:\x20','Query\x20file\x20is\x20empty','\x20(use\x20--limit\x20to\x20see\x20more)','name','Creating\x20schedule...','schedule:create','padEnd','trim','executing_user_id','Searching\x20scheduled\x20queries\x20matching\x20\x22','data','215772QOYyQV','just\x20now','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','query','\x20job','cyan','run','Failed\x20to\x20read\x20file:\x20','options','result','statusIcon','Listing\x20scheduled\x20queries...','getTime','Showing\x20first\x20','utf-8','description','INVALID_ARGUMENT','Delete\x20a\x20scheduled\x20query','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','\x20created','max','84387cRBpcw','retryLimit','/app/queries/editor?queryId=','never','Create\x20a\x20scheduled\x20query','red','start_at','9295659NKedpv','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','created_at','map','ies','entries','Running\x20schedule:\x20','tsv','Update\x20a\x20scheduled\x20query','Creating\x20schedule:\x20','ended_at','count','queries','success','yes','16qWiJoX','update','table','1520775axjlOo','schedule:delete','join','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','timezone','schedule:list','format','dim','πŸ“…\x20','Found\x20','\x20\x20Type:\x20','job_id','\x20(showing\x20','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','execute','error','66hPZzcQ','log'];a30_0x17ef=function(){return _0x121de7;};return a30_0x17ef();}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]=a30_0x3f1c4d(0x26e);['description']=a30_0x3f1c4d(0x250);[a30_0x3f1c4d(0x231)](_0x3ab8cb){const _0x541a34=_0x3ab8cb['args'][0x0];if(!_0x541a34)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async['execute'](_0x29d54b){const _0x4d2417=a30_0x3f1c4d,{options:_0xe984e1,args:_0x20e97a,tdx:_0x4623fe}=_0x29d54b,_0x34b3ba=_0x20e97a[0x0];if(!_0xe984e1[_0x4d2417(0x269)]){const _0x292d7b=await confirm(_0x4d2417(0x210)+_0x34b3ba+'\x22?');if(!_0x292d7b)return console[_0x4d2417(0x1ea)]('Cancelled'),0x0;}const _0x3ee67e=await withSpinner(_0x4d2417(0x200),()=>_0x4623fe['schedules']['delete'](_0x34b3ba),{'verbose':_0xe984e1[_0x4d2417(0x21b)]});return console[_0x4d2417(0x1ea)](_0x4d2417(0x221)+_0x3ee67e[_0x4d2417(0x23e)][_0x4d2417(0x237)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]=a30_0x3f1c4d(0x204);[a30_0x3f1c4d(0x24e)]=a30_0x3f1c4d(0x201);[a30_0x3f1c4d(0x231)](_0x1ef48f){const _0x3cf496=a30_0x3f1c4d,_0x50fc9d=_0x1ef48f[_0x3cf496(0x229)][0x0];if(!_0x50fc9d)return _0x3cf496(0x251);return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x2d39d0){const _0xf345de=a30_0x3f1c4d,{options:_0x2f8f80,args:_0x47b69e,tdx:_0x55b5d2}=_0x2d39d0,_0xad5733=_0x47b69e[0x0],_0x4b162b=_0x2f8f80,_0x3e970e=_0x4b162b['time'],_0x1067d=_0x4b162b[_0xf345de(0x225)]!==undefined?Number(_0x4b162b[_0xf345de(0x225)]):undefined;if(_0x2f8f80[_0xf345de(0x21b)]){console[_0xf345de(0x1ea)](_0xf345de(0x261)+_0xad5733);if(_0x3e970e)console['error'](_0xf345de(0x206)+_0x3e970e);if(_0x1067d)console[_0xf345de(0x1ea)]('\x20\x20Num:\x20'+_0x1067d);}const _0x37199e=await withSpinner(_0xf345de(0x20e),()=>_0x55b5d2[_0xf345de(0x230)][_0xf345de(0x245)](_0xad5733,{'time':_0x3e970e,'num':_0x1067d}),{'verbose':_0x2f8f80[_0xf345de(0x21b)]}),_0xb82c81=_0x37199e[_0xf345de(0x23e)]['jobs'];console['error'](_0xf345de(0x22a)+_0xb82c81['length']+_0xf345de(0x243)+(_0xb82c81[_0xf345de(0x216)]!==0x1?'s':'')+_0xf345de(0x252));for(const _0x236634 of _0xb82c81){console[_0xf345de(0x1ea)]('\x20\x20Job\x20ID:\x20'+_0x236634[_0xf345de(0x1e6)]);}return await handleSDKOutput(_0xb82c81,_0x2f8f80),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x3f1c4d(0x237)]='schedule:history';[a30_0x3f1c4d(0x24e)]='Show\x20schedule\x20execution\x20history';['validate'](_0x247cce){const _0x17107b=a30_0x3f1c4d,_0x44f7a9=_0x247cce[_0x17107b(0x229)][0x0];if(!_0x44f7a9)return _0x17107b(0x25c);return undefined;}async[a30_0x3f1c4d(0x1e9)](_0x35e934){const _0x54d018=a30_0x3f1c4d,{options:_0x2ea533,args:_0x212fde,tdx:_0x3b6b09}=_0x35e934,_0x156f31=_0x212fde[0x0],_0x4b69b5=_0x2ea533,_0x37f5e3=_0x4b69b5[_0x54d018(0x220)]!==undefined?Number(_0x4b69b5['from']):undefined,_0x487a48=_0x4b69b5['to']!==undefined?Number(_0x4b69b5['to']):undefined,_0x787908=await withSpinner(_0x54d018(0x211),()=>_0x3b6b09[_0x54d018(0x230)][_0x54d018(0x1f6)](_0x156f31,{'from':_0x37f5e3,'to':_0x487a48}),{'verbose':_0x2ea533[_0x54d018(0x21b)]}),_0x2e16a5=_0x787908['data'];console[_0x54d018(0x1ea)](_0x54d018(0x276)+_0x2e16a5[_0x54d018(0x266)]+'\x20execution'+(_0x2e16a5[_0x54d018(0x266)]!==0x1?'s':'')+_0x54d018(0x1e7)+_0x2e16a5[_0x54d018(0x220)]+'-'+_0x2e16a5['to']+')');const _0x3c2f2e=_0x2e16a5[_0x54d018(0x1f6)][_0x54d018(0x25e)](_0x21e1a6=>({'job_id':_0x21e1a6[_0x54d018(0x1e6)],'type':_0x21e1a6[_0x54d018(0x21f)],'status':_0x21e1a6[_0x54d018(0x1f9)],'scheduled_at':_0x21e1a6[_0x54d018(0x1ee)],'created_at':_0x21e1a6[_0x54d018(0x25d)],'start_at':_0x21e1a6[_0x54d018(0x25a)],'end_at':_0x21e1a6[_0x54d018(0x20c)]}));return await handleSDKOutput(_0x3c2f2e,_0x2ea533),0x0;}}
@@ -1 +1 @@
1
- const a31_0x1b8e25=a31_0x2140;function a31_0x5719(){const _0x99d944=['Resolving\x20folder\x20\x27','folderPath','Error:\x20','error','683640COxVql','name','Resolved\x20folder\x20ID:\x20','getParent','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','in\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Listing\x20folders\x20for\x20parent\x20\x27','(root)','Resolving\x20path\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','242WjBxIk','getSegment','643245ESyCVS','Folder\x20name:\x20','Parent\x20segment:\x20','Examples:','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Parent\x20name:\x20','Resolving\x20\x27','toLocaleString','segmentPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Folder\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','\x27...','folderId','resolveParentId','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','limit','Error:\x20Folder\x20reference\x20is\x20required','βœ”\x20Created\x20folder\x20\x27','\x20Opening\x20','web','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','elapsedTimeMillis','Target\x20path:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','45wsIrFb','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','site','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','SQL\x20query:\x0a','segmentId','\x27\x20with\x20ID:\x20','message','15549770hmTTOQ','Use:\x20tdx\x20ps\x20show','fullPath','parentFolder','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','json','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Fetching\x20folder\x20\x27','folder','cyan','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','jobId','segment:sql','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','resolvePathToResource','parent','segment:folder:show','parentSegment','createFolder','Show\x20segment\x20folder\x20details','Get\x20SQL\x20query\x20for\x20child\x20segment','Folder\x20ID\x20missing\x20from\x20resolved\x20path','description','format','type','Options:','Parent\x20ID:\x20','SEGMENT_NOT_FOUND','Resolved\x20parent\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','βœ”\x20Query\x20completed:\x20Processed\x20','getFolder','trim','Segment\x20ID:\x20','data','jsonl','600212AgPEBi','\x20\x20Full\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20rows\x20','segment:desc','Fetching\x20SQL\x20for\x20segment...','cause','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolved\x20type:\x20','Site:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Use:\x20tdx\x20ps\x20desc','execute','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20folder','\x20\x20Cause:\x20','/e/','\x20\x20Folder\x20path:\x20','Use:\x20tdx\x20ps\x20view\x20-w','listFolders','segment:folder:list','Executing\x20segment\x20query...','Usage:\x20tdx\x20sg\x20show\x20<name>','15kjxNhO','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Show\x20segment\x20or\x20folder\x20details','Create\x20segment\x20folder\x20for\x20organization','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Use:\x20tdx\x20ps\x20sql','Resolving\x20parent\x20folder\x20\x27','segment:view','segmentName','Segment\x20ID\x20missing\x20from\x20resolved\x20path','resolveFolderId','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20[Job\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','1005312mFWnGV','getSegmentSQL','\x20\x20Segment\x20name:\x20','2723777JvgVBE','Use:\x20tdx\x20ps\x20view','parentId','information_schema','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Show\x20folder\x20or\x20child\x20segment\x20details','113DcoLVr','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','segment','length','Fetching\x20folder\x20details...','Resolving\x20parent\x20segment\x20\x27','/app/ps/','verbose','test','SELECT\x20*\x20FROM\x20(\x0a','INVALID_ARGUMENT'];a31_0x5719=function(){return _0x99d944;};return a31_0x5719();}(function(_0x2b0c51,_0x4639f7){const _0x3f7344=a31_0x2140,_0x4aa4dd=_0x2b0c51();while(!![]){try{const _0x1662a4=-parseInt(_0x3f7344(0x1f1))/0x1*(-parseInt(_0x3f7344(0x175))/0x2)+-parseInt(_0x3f7344(0x177))/0x3+-parseInt(_0x3f7344(0x1c2))/0x4*(parseInt(_0x3f7344(0x1d9))/0x5)+parseInt(_0x3f7344(0x1e8))/0x6+-parseInt(_0x3f7344(0x1eb))/0x7+-parseInt(_0x3f7344(0x201))/0x8*(parseInt(_0x3f7344(0x193))/0x9)+parseInt(_0x3f7344(0x19b))/0xa;if(_0x1662a4===_0x4639f7)break;else _0x4aa4dd['push'](_0x4aa4dd['shift']());}catch(_0x26c901){_0x4aa4dd['push'](_0x4aa4dd['shift']());}}}(a31_0x5719,0x3e50a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a31_0x2140(_0x3c022d,_0x5e92cb){_0x3c022d=_0x3c022d-0x174;const _0x5719c2=a31_0x5719();let _0x2140a9=_0x5719c2[_0x3c022d];return _0x2140a9;}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 a31_0x13008a from'chalk';async function resolveSegmentTarget(_0xd191e7,_0x93281a,_0x7e5ac3){const _0x41f4e8=a31_0x2140;if(isYamlFilePath(_0xd191e7))try{const _0x460fae=await resolveYamlFilePath(_0xd191e7);return _0x7e5ac3&&(console[_0x41f4e8(0x200)]('Resolved\x20YAML\x20file:\x20'+_0xd191e7),console[_0x41f4e8(0x200)]('\x20\x20Parent\x20segment:\x20'+_0x460fae[_0x41f4e8(0x1ac)]),console[_0x41f4e8(0x200)](_0x41f4e8(0x1ea)+_0x460fae[_0x41f4e8(0x1e2)]),console[_0x41f4e8(0x200)](_0x41f4e8(0x1d3)+(_0x460fae[_0x41f4e8(0x1fe)]||_0x41f4e8(0x209))),console[_0x41f4e8(0x200)](_0x41f4e8(0x1c3)+_0x460fae[_0x41f4e8(0x19d)])),_0x460fae[_0x41f4e8(0x19d)];}catch(_0xc42a2d){throw new SDKError(ErrorCode[_0x41f4e8(0x1fc)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xc42a2d[_0x41f4e8(0x19a)]);}if(!_0x93281a)throw new SDKError(ErrorCode[_0x41f4e8(0x1fc)],_0x41f4e8(0x19f));return _0x93281a+'/'+_0xd191e7;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x1b8e25(0x202)]='segment:describe';[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1dc);async[a31_0x1b8e25(0x1ce)](_0x66b752){const _0x360875=a31_0x1b8e25,{options:_0x513d78,args:_0x56a26e,tdx:_0x284fe7}=_0x66b752,_0x8ac471=_0x56a26e[0x0],_0x22fef4=!_0x8ac471&&!!_0x513d78[_0x360875(0x1ac)],_0x5442b6=_0x8ac471||_0x513d78[_0x360875(0x1ac)];if(!_0x5442b6)return console[_0x360875(0x200)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x360875(0x200)](_0x360875(0x17a)),console[_0x360875(0x200)](_0x360875(0x192)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x360875(0x200)](_0x360875(0x191)),console[_0x360875(0x200)](_0x360875(0x1db)),0x1;try{const _0x390b2b=_0x513d78[_0x360875(0x180)];let _0x161c48=_0x5442b6;!_0x22fef4&&_0x390b2b&&!_0x5442b6['includes']('/')&&(_0x161c48=_0x390b2b+'/'+_0x5442b6,_0x513d78[_0x360875(0x1f9)]&&console[_0x360875(0x200)]('Resolved\x20relative\x20path\x20to:\x20'+_0x161c48));const _0x4e28ee=await withSpinner(_0x360875(0x20a)+_0x161c48+_0x360875(0x185),()=>_0x284fe7[_0x360875(0x1f4)]['resolvePathToResource'](_0x161c48),{'verbose':_0x513d78[_0x360875(0x1f9)]}),_0x5248c2=_0x4e28ee['data'];_0x513d78['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x5248c2['type']),console[_0x360875(0x200)](_0x360875(0x1b5)+_0x5248c2[_0x360875(0x1ed)]),_0x5248c2[_0x360875(0x186)]&&console[_0x360875(0x200)](_0x360875(0x183)+_0x5248c2['folderId']),_0x5248c2[_0x360875(0x198)]&&console[_0x360875(0x200)](_0x360875(0x1bf)+_0x5248c2[_0x360875(0x198)]));if(_0x5248c2[_0x360875(0x1b3)]===_0x360875(0x1aa)){const _0x15b172=await withSpinner(_0x360875(0x184),()=>_0x284fe7['segment'][_0x360875(0x204)](_0x5248c2[_0x360875(0x1ed)]),{'verbose':_0x513d78[_0x360875(0x1f9)]});await handleSingleObjectOutput(_0x15b172[_0x360875(0x1c0)],_0x513d78);}else{if(_0x5248c2[_0x360875(0x1b3)]==='folder'){if(!_0x5248c2[_0x360875(0x186)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x360875(0x1b0));const _0x21a5f7=await withSpinner(_0x360875(0x1f6),()=>_0x284fe7[_0x360875(0x1f4)][_0x360875(0x1bd)](_0x5248c2[_0x360875(0x186)]),{'verbose':_0x513d78[_0x360875(0x1f9)]});await handleSingleObjectOutput(_0x21a5f7[_0x360875(0x1c0)],_0x513d78);}else{if(_0x5248c2[_0x360875(0x1b3)]==='segment'){if(!_0x5248c2['segmentId'])throw new SDKError(ErrorCode[_0x360875(0x1b6)],_0x360875(0x1e3));const _0x8da048=await withSpinner(_0x360875(0x1b9),()=>_0x284fe7[_0x360875(0x1f4)][_0x360875(0x176)](_0x5248c2[_0x360875(0x1ed)],_0x5248c2['segmentId']),{'verbose':_0x513d78[_0x360875(0x1f9)]});await handleSingleObjectOutput(_0x8da048[_0x360875(0x1c0)],_0x513d78);}}}return 0x0;}catch(_0x103b4a){if(_0x103b4a instanceof SDKError)return console[_0x360875(0x200)]('Error:\x20'+_0x103b4a[_0x360875(0x19a)]),_0x103b4a[_0x360875(0x1c8)]&&console['error'](_0x360875(0x1d1)+_0x103b4a[_0x360875(0x1c8)]),0x1;throw _0x103b4a;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x1b8e25(0x202)]='segment:show';['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x1b8e25(0x1ce)](_0x55db1f){const _0x4b7227=a31_0x1b8e25,{options:_0x56723f,args:_0x4386e8,tdx:_0x284b73}=_0x55db1f,_0x490510=_0x4386e8[0x0];if(!_0x490510)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4b7227(0x200)](_0x4b7227(0x1d8)),console[_0x4b7227(0x200)](_0x4b7227(0x1e7)),console[_0x4b7227(0x200)](_0x4b7227(0x17a)),console['error'](_0x4b7227(0x17b)),console[_0x4b7227(0x200)](_0x4b7227(0x1ba)),0x1;try{const _0x789226=_0x56723f[_0x4b7227(0x1ac)],_0x478d5d=await resolveSegmentTarget(_0x490510,_0x789226,_0x56723f['verbose']);_0x56723f[_0x4b7227(0x1f9)]&&console['error'](_0x4b7227(0x190)+_0x478d5d);const _0x1847c8=await withSpinner(_0x4b7227(0x17e)+_0x490510+_0x4b7227(0x185),()=>_0x284b73[_0x4b7227(0x1f4)]['resolvePathToResource'](_0x478d5d),{'verbose':_0x56723f[_0x4b7227(0x1f9)]}),_0x2a869e=_0x1847c8[_0x4b7227(0x1c0)];_0x56723f[_0x4b7227(0x1f9)]&&(console[_0x4b7227(0x200)](_0x4b7227(0x1ca)+_0x2a869e[_0x4b7227(0x1b3)]),console[_0x4b7227(0x200)](_0x4b7227(0x1b5)+_0x2a869e[_0x4b7227(0x1ed)]));if(_0x2a869e['type']===_0x4b7227(0x1a3))return console[_0x4b7227(0x200)](_0x4b7227(0x1f3)),console[_0x4b7227(0x200)](_0x4b7227(0x1bb)),0x1;if(_0x2a869e[_0x4b7227(0x1b3)]==='parent')return console[_0x4b7227(0x200)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4b7227(0x200)](_0x4b7227(0x19c)),0x1;if(!_0x2a869e[_0x4b7227(0x198)])throw new SDKError(ErrorCode[_0x4b7227(0x1b6)],_0x4b7227(0x1e3));const _0x4f5487=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x284b73['segment'][_0x4b7227(0x1e9)](_0x2a869e[_0x4b7227(0x1ed)],_0x2a869e['segmentId']),{'verbose':_0x56723f[_0x4b7227(0x1f9)]});let _0x1a37f8=_0x4f5487[_0x4b7227(0x1c0)];const _0x3fa538=resolveLimit(_0x56723f[_0x4b7227(0x189)],DEFAULT_DISPLAY_LIMIT),_0x52a1e6=/\bLIMIT\s+\d+/i[_0x4b7227(0x1fa)](_0x1a37f8);!_0x52a1e6&&(_0x1a37f8=_0x1a37f8[_0x4b7227(0x1be)]()['replace'](/;+$/,''),_0x1a37f8=_0x4b7227(0x1fb)+_0x1a37f8+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x3fa538);_0x56723f[_0x4b7227(0x1f9)]&&console[_0x4b7227(0x200)](_0x4b7227(0x197)+_0x1a37f8);const _0x10a3de=await withProgressSpinner(_0x4b7227(0x1d7),async _0x4c05b7=>{const _0x12bfcd=_0x4b7227,_0x50c5d2=await _0x284b73['query'][_0x12bfcd(0x1ce)](_0x1a37f8,{'catalog':'td','schema':_0x12bfcd(0x1ee),'onJobId':_0x381e69=>{_0x4c05b7['setJobId'](_0x381e69);}});return _0x50c5d2;},{'verbose':_0x56723f[_0x4b7227(0x1f9)]}),_0x46ee3b=_0x10a3de[_0x4b7227(0x1c0)],_0xded0b6=_0x46ee3b[_0x4b7227(0x1a6)]?_0x4b7227(0x1e6)+_0x46ee3b[_0x4b7227(0x1a6)]+']':'';return console['error'](_0x4b7227(0x1bc)+_0x46ee3b['stats']['processedRows'][_0x4b7227(0x17f)]()+_0x4b7227(0x1c5)+(_0x4b7227(0x206)+formatElapsed(_0x46ee3b['stats'][_0x4b7227(0x18f)])+_0xded0b6)),await handleQueryOutput(_0x46ee3b,_0x56723f),0x0;}catch(_0x3a7430){if(_0x3a7430 instanceof SDKError)return console[_0x4b7227(0x200)]('βœ–\x20Query\x20failed\x20['+_0x3a7430['code']+']'),console[_0x4b7227(0x200)]('\x0a'+_0x3a7430['message']),0x1;throw _0x3a7430;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1d6);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1a8);async[a31_0x1b8e25(0x1ce)](_0x1023cf){const _0x266621=a31_0x1b8e25,{options:_0x3c0819,args:_0x284831,tdx:_0x21c3c0}=_0x1023cf;if(_0x284831[_0x266621(0x1f5)]===0x0)return console['error'](_0x266621(0x1c9)),console[_0x266621(0x200)](_0x266621(0x1de)),0x1;const _0x341653=_0x284831[0x0];try{_0x3c0819[_0x266621(0x1f9)]&&(console[_0x266621(0x200)](_0x266621(0x1cb)+_0x3c0819['site']),console[_0x266621(0x200)](_0x266621(0x17d)+_0x341653));const _0x28ee80=await withSpinner(_0x266621(0x1f7)+_0x341653+_0x266621(0x185),()=>_0x21c3c0[_0x266621(0x1f4)][_0x266621(0x187)](_0x341653),{'verbose':_0x3c0819[_0x266621(0x1f9)]}),_0x42af9c=_0x28ee80[_0x266621(0x1c0)];_0x3c0819[_0x266621(0x1f9)]&&console['error'](_0x266621(0x1b7)+_0x42af9c);const _0x32e5fc=await withSpinner(_0x266621(0x208)+_0x341653+_0x266621(0x185),()=>_0x21c3c0[_0x266621(0x1f4)][_0x266621(0x1d5)](_0x42af9c),{'verbose':_0x3c0819['verbose']}),_0x4a85fd=_0x32e5fc['data'];return console[_0x266621(0x200)]('βœ”\x20Found\x20'+_0x4a85fd[_0x266621(0x1f5)]+_0x266621(0x1d0)+(_0x4a85fd['length']!==0x1?'s':'')),await handleSDKOutput(_0x4a85fd,_0x3c0819),0x0;}catch(_0xc20847){if(_0xc20847 instanceof SDKError)return console[_0x266621(0x200)](_0x266621(0x1ff)+_0xc20847[_0x266621(0x19a)]),_0xc20847[_0x266621(0x1c8)]&&console[_0x266621(0x200)]('\x20\x20Cause:\x20'+_0xc20847['cause']),0x1;throw _0xc20847;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1ab);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1ae);async['execute'](_0x44a138){const _0x4bf595=a31_0x1b8e25,{options:_0x360f4e,args:_0x160aa5,tdx:_0x55cec0}=_0x44a138;if(_0x160aa5['length']===0x0)return console['error'](_0x4bf595(0x18a)),console[_0x4bf595(0x200)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x295095,childId:_0x1cd362}=parseSegmentRef(_0x160aa5[0x0]);_0x360f4e[_0x4bf595(0x1f9)]&&(console[_0x4bf595(0x200)]('Site:\x20'+_0x360f4e['site']),console['error'](_0x4bf595(0x17d)+_0x295095),_0x1cd362&&console[_0x4bf595(0x200)](_0x4bf595(0x178)+_0x1cd362));if(!_0x1cd362)return console[_0x4bf595(0x200)](_0x4bf595(0x196)),0x1;const _0x4073c9=await withSpinner(_0x4bf595(0x1f7)+_0x295095+_0x4bf595(0x185),()=>_0x55cec0[_0x4bf595(0x1f4)]['resolveParentId'](_0x295095),{'verbose':_0x360f4e[_0x4bf595(0x1f9)]}),_0x3abe87=_0x4073c9[_0x4bf595(0x1c0)];_0x360f4e['verbose']&&console[_0x4bf595(0x200)](_0x4bf595(0x1b7)+_0x3abe87);const _0x1d8d8c=await withSpinner(_0x4bf595(0x1fd)+_0x1cd362+_0x4bf595(0x185),()=>_0x55cec0[_0x4bf595(0x1f4)]['resolveFolderId'](_0x3abe87,_0x1cd362),{'verbose':_0x360f4e[_0x4bf595(0x1f9)]}),_0x97c177=_0x1d8d8c['data'];_0x360f4e[_0x4bf595(0x1f9)]&&console[_0x4bf595(0x200)](_0x4bf595(0x203)+_0x97c177);const _0x533956=await withSpinner(_0x4bf595(0x1a2)+_0x1cd362+'\x27...',()=>_0x55cec0[_0x4bf595(0x1f4)][_0x4bf595(0x1bd)](_0x97c177),{'verbose':_0x360f4e[_0x4bf595(0x1f9)]});return await handleSDKOutput([_0x533956['data']],_0x360f4e),0x0;}catch(_0x2c96be){if(_0x2c96be instanceof SDKError)return console[_0x4bf595(0x200)](_0x4bf595(0x1ff)+_0x2c96be[_0x4bf595(0x19a)]),_0x2c96be[_0x4bf595(0x1c8)]&&console[_0x4bf595(0x200)](_0x4bf595(0x1d1)+_0x2c96be[_0x4bf595(0x1c8)]),0x1;throw _0x2c96be;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1a7);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1af);async[a31_0x1b8e25(0x1ce)](_0x2fae8d){const _0x487201=a31_0x1b8e25,{options:_0x5e3b9c,args:_0x3fc41a,tdx:_0x127730}=_0x2fae8d,_0x402968=_0x3fc41a[0x0];if(!_0x402968)return console[_0x487201(0x200)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x487201(0x17c)),console[_0x487201(0x200)](_0x487201(0x17a)),console['error'](_0x487201(0x188)),console[_0x487201(0x200)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x251a74=_0x5e3b9c[_0x487201(0x1ac)],_0x226659=await resolveSegmentTarget(_0x402968,_0x251a74,_0x5e3b9c[_0x487201(0x1f9)]);_0x5e3b9c['verbose']&&console[_0x487201(0x200)](_0x487201(0x190)+_0x226659);const _0x29a663=await withSpinner(_0x487201(0x17e)+_0x402968+_0x487201(0x185),()=>_0x127730[_0x487201(0x1f4)]['resolvePathToResource'](_0x226659),{'verbose':_0x5e3b9c['verbose']}),_0x46ee8b=_0x29a663['data'];_0x5e3b9c[_0x487201(0x1f9)]&&(console['error'](_0x487201(0x1ca)+_0x46ee8b[_0x487201(0x1b3)]),console['error'](_0x487201(0x1b5)+_0x46ee8b['parentId']));if(_0x46ee8b[_0x487201(0x1b3)]===_0x487201(0x1a3))return console[_0x487201(0x200)](_0x487201(0x1b8)),console[_0x487201(0x200)](_0x487201(0x207)),0x1;if(_0x46ee8b[_0x487201(0x1b3)]===_0x487201(0x1aa))return console[_0x487201(0x200)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x487201(0x200)](_0x487201(0x1df)),0x1;if(!_0x46ee8b[_0x487201(0x198)])throw new SDKError(ErrorCode[_0x487201(0x1b6)],_0x487201(0x1e3));const _0x53abd7=await withSpinner(_0x487201(0x1c7),()=>_0x127730[_0x487201(0x1f4)][_0x487201(0x1e9)](_0x46ee8b[_0x487201(0x1ed)],_0x46ee8b[_0x487201(0x198)]),{'verbose':_0x5e3b9c['verbose']}),_0x2d4c7c=_0x53abd7[_0x487201(0x1c0)];return _0x5e3b9c[_0x487201(0x1b2)]===_0x487201(0x1a0)||_0x5e3b9c[_0x487201(0x1b2)]===_0x487201(0x1c1)?await handleSDKOutput([{'sql':_0x2d4c7c}],_0x5e3b9c):console['log'](_0x2d4c7c),0x0;}catch(_0x1dceee){if(_0x1dceee instanceof SDKError)return console[_0x487201(0x200)]('Error:\x20'+_0x1dceee[_0x487201(0x19a)]),_0x1dceee['cause']&&console[_0x487201(0x200)](_0x487201(0x1d1)+_0x1dceee['cause']),0x1;throw _0x1dceee;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0x1b8e25(0x202)]='segment:folder:create';[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1dd);async[a31_0x1b8e25(0x1ce)](_0xd7bbe7){const _0x475f41=a31_0x1b8e25,{options:_0xe345fe,args:_0x39f6f5,tdx:_0x250b05}=_0xd7bbe7,_0x14cedb=_0xe345fe;if(_0x39f6f5[_0x475f41(0x1f5)]<0x2)return console[_0x475f41(0x200)](_0x475f41(0x1cc)),console[_0x475f41(0x200)](_0x475f41(0x18e)),0x1;const _0x1cdcdf=_0x39f6f5[0x0],_0x45b44f=_0x39f6f5[0x1];_0x14cedb[_0x475f41(0x1f9)]&&(console[_0x475f41(0x200)]('Site:\x20'+_0x14cedb[_0x475f41(0x195)]),console[_0x475f41(0x200)](_0x475f41(0x179)+_0x1cdcdf),console[_0x475f41(0x200)](_0x475f41(0x178)+_0x45b44f));let _0x6175c8;if(_0x14cedb[_0x475f41(0x19e)]){const _0x5bed06=_0x14cedb['parentFolder'],_0x269db6=await withSpinner(_0x475f41(0x1f7)+_0x1cdcdf+'\x27...',()=>_0x250b05[_0x475f41(0x1f4)][_0x475f41(0x187)](_0x1cdcdf),{'verbose':_0x14cedb[_0x475f41(0x1f9)]}),_0x8be238=_0x269db6[_0x475f41(0x1c0)],_0x23999a=await withSpinner(_0x475f41(0x1e0)+_0x5bed06+_0x475f41(0x185),()=>_0x250b05[_0x475f41(0x1f4)][_0x475f41(0x1e4)](_0x8be238,_0x5bed06),{'verbose':_0x14cedb[_0x475f41(0x1f9)]});_0x6175c8=_0x23999a['data'],_0x14cedb[_0x475f41(0x1f9)]&&console[_0x475f41(0x200)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x6175c8);}const _0x5c6881={'name':_0x45b44f,'description':_0x14cedb[_0x475f41(0x1b1)],'parentFolderId':_0x6175c8},_0x5dcc02=await withSpinner('Creating\x20folder\x20\x27'+_0x45b44f+_0x475f41(0x185),()=>_0x250b05[_0x475f41(0x1f4)][_0x475f41(0x1ad)](_0x1cdcdf,_0x5c6881),{'verbose':_0x14cedb['verbose']}),_0x4faf8a=_0x5dcc02[_0x475f41(0x1c0)];return console[_0x475f41(0x200)](_0x475f41(0x18b)+_0x4faf8a[_0x475f41(0x202)]+_0x475f41(0x199)+_0x4faf8a['id']),await handleSDKOutput([_0x4faf8a],_0x14cedb),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1e1);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1f0);async[a31_0x1b8e25(0x1ce)](_0x32adb0){const _0x551be7=a31_0x1b8e25,{options:_0x4349ef,args:_0x18feb4,tdx:_0x42d292}=_0x32adb0,_0x13846f=_0x18feb4[0x0];if(!_0x13846f)return console[_0x551be7(0x200)](_0x551be7(0x1cf)),console['error'](_0x551be7(0x182)),console[_0x551be7(0x200)](_0x551be7(0x181)),console['error'](_0x551be7(0x1b4)),console[_0x551be7(0x200)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x551be7(0x200)](_0x551be7(0x17a)),console['error'](_0x551be7(0x1a1)),console[_0x551be7(0x200)](_0x551be7(0x1f2)),console[_0x551be7(0x200)](_0x551be7(0x194)),console[_0x551be7(0x200)](_0x551be7(0x1c4)),0x1;try{const _0x7ddf66=_0x4349ef[_0x551be7(0x1ac)],_0xd2d766=await resolveSegmentTarget(_0x13846f,_0x7ddf66,_0x4349ef[_0x551be7(0x1f9)]);_0x4349ef[_0x551be7(0x1f9)]&&console['error'](_0x551be7(0x190)+_0xd2d766);const _0x546706=await withSpinner(_0x551be7(0x17e)+_0x13846f+_0x551be7(0x185),()=>_0x42d292['segment'][_0x551be7(0x1a9)](_0xd2d766),{'verbose':_0x4349ef[_0x551be7(0x1f9)]}),_0x13251f=_0x546706[_0x551be7(0x1c0)];_0x4349ef['verbose']&&(console[_0x551be7(0x200)](_0x551be7(0x1ca)+_0x13251f['type']),console['error'](_0x551be7(0x1b5)+_0x13251f[_0x551be7(0x1ed)]),_0x13251f[_0x551be7(0x186)]&&console[_0x551be7(0x200)]('Folder\x20ID:\x20'+_0x13251f[_0x551be7(0x186)]),_0x13251f[_0x551be7(0x198)]&&console['error']('Segment\x20ID:\x20'+_0x13251f['segmentId']));if(_0x4349ef[_0x551be7(0x18d)]){if(_0x13251f[_0x551be7(0x1b3)]===_0x551be7(0x1a3))return console[_0x551be7(0x200)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x13251f[_0x551be7(0x1b3)]==='parent')return console[_0x551be7(0x200)](_0x551be7(0x174)),console[_0x551be7(0x200)](_0x551be7(0x1d4)),0x1;if(!_0x13251f[_0x551be7(0x198)])throw new SDKError(ErrorCode[_0x551be7(0x1b6)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x15f554=getConsoleNextUrl(_0x4349ef[_0x551be7(0x195)],'/app/ps/'+_0x13251f[_0x551be7(0x1ed)]+'/e/'+_0x13251f[_0x551be7(0x198)]);return console[_0x551be7(0x200)](a31_0x13008a['green']('βœ”')+_0x551be7(0x18c)+a31_0x13008a[_0x551be7(0x1a4)](_0x15f554)),openBrowser(_0x15f554),0x0;}if(_0x13251f[_0x551be7(0x1b3)]===_0x551be7(0x1a3)){if(!_0x13251f[_0x551be7(0x186)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x551be7(0x1b0));const _0x4562e4=await withSpinner('Fetching\x20folder\x20details...',()=>_0x42d292[_0x551be7(0x1f4)][_0x551be7(0x1bd)](_0x13251f[_0x551be7(0x186)]),{'verbose':_0x4349ef[_0x551be7(0x1f9)]});await handleSingleObjectOutput(_0x4562e4[_0x551be7(0x1c0)],_0x4349ef);}else{if(_0x13251f[_0x551be7(0x1b3)]===_0x551be7(0x1f4)){if(!_0x13251f[_0x551be7(0x198)])throw new SDKError(ErrorCode[_0x551be7(0x1b6)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2445e1=await withSpinner('Fetching\x20segment\x20details...',()=>_0x42d292[_0x551be7(0x1f4)][_0x551be7(0x176)](_0x13251f[_0x551be7(0x1ed)],_0x13251f['segmentId']),{'verbose':_0x4349ef[_0x551be7(0x1f9)]}),_0x3f9546=getConsoleNextUrl(_0x4349ef[_0x551be7(0x195)],_0x551be7(0x1f8)+_0x13251f[_0x551be7(0x1ed)]+_0x551be7(0x1d2)+_0x13251f[_0x551be7(0x198)]),_0x369b1d=_0x2445e1[_0x551be7(0x1c0)];_0x369b1d['url']=_0x3f9546,await handleSingleObjectOutput(_0x369b1d,_0x4349ef);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x551be7(0x1ec)),0x1;}return 0x0;}catch(_0x3b5adb){if(_0x3b5adb instanceof SDKError)return console[_0x551be7(0x200)](_0x551be7(0x1ff)+_0x3b5adb[_0x551be7(0x19a)]),_0x3b5adb[_0x551be7(0x1c8)]&&console['error'](_0x551be7(0x1d1)+_0x3b5adb['cause']),0x1;throw _0x3b5adb;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1c6);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1da);async['execute'](_0x1f33cc){const _0x5b59e3=a31_0x1b8e25,{options:_0x39618c,args:_0x49addc,tdx:_0x3897e7}=_0x1f33cc,_0x4bc28a=_0x49addc[0x0];if(!_0x4bc28a)return console[_0x5b59e3(0x200)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x5b59e3(0x200)](_0x5b59e3(0x1e5)),console[_0x5b59e3(0x200)](_0x5b59e3(0x20b)),console['error'](_0x5b59e3(0x17a)),console['error'](_0x5b59e3(0x1a5)),console[_0x5b59e3(0x200)](_0x5b59e3(0x1ef)),0x1;try{const _0x1b1208=_0x39618c[_0x5b59e3(0x1ac)],_0x55686e=await resolveSegmentTarget(_0x4bc28a,_0x1b1208,_0x39618c[_0x5b59e3(0x1f9)]);_0x39618c[_0x5b59e3(0x1f9)]&&console[_0x5b59e3(0x200)](_0x5b59e3(0x190)+_0x55686e);const _0x42ea40=await withSpinner(_0x5b59e3(0x17e)+_0x4bc28a+'\x27...',()=>_0x3897e7[_0x5b59e3(0x1f4)][_0x5b59e3(0x1a9)](_0x55686e),{'verbose':_0x39618c[_0x5b59e3(0x1f9)]}),_0x30fd57=_0x42ea40['data'];_0x39618c[_0x5b59e3(0x1f9)]&&(console['error'](_0x5b59e3(0x1ca)+_0x30fd57['type']),console[_0x5b59e3(0x200)](_0x5b59e3(0x1b5)+_0x30fd57[_0x5b59e3(0x1ed)]));if(_0x30fd57['type']===_0x5b59e3(0x1a3))return console[_0x5b59e3(0x200)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x5b59e3(0x200)](_0x5b59e3(0x207)),0x1;if(_0x30fd57[_0x5b59e3(0x1b3)]===_0x5b59e3(0x1aa))return console[_0x5b59e3(0x200)](_0x5b59e3(0x205)),console[_0x5b59e3(0x200)](_0x5b59e3(0x1cd)),0x1;if(!_0x30fd57['segmentId'])throw new SDKError(ErrorCode[_0x5b59e3(0x1b6)],_0x5b59e3(0x1e3));const _0x2a5fdf=await withSpinner(_0x5b59e3(0x1c7),()=>_0x3897e7[_0x5b59e3(0x1f4)]['getSegmentSQL'](_0x30fd57[_0x5b59e3(0x1ed)],_0x30fd57[_0x5b59e3(0x198)]),{'verbose':_0x39618c[_0x5b59e3(0x1f9)]}),_0x3e4b50=_0x2a5fdf['data'],_0x59e9bb=await executeSchemaQuery(_0x3e4b50,_0x3897e7,_0x39618c);return await handleQueryOutput(_0x59e9bb,_0x39618c),0x0;}catch(_0x677314){if(_0x677314 instanceof SDKError)return console[_0x5b59e3(0x200)]('Error:\x20'+_0x677314['message']),_0x677314[_0x5b59e3(0x1c8)]&&console[_0x5b59e3(0x200)](_0x5b59e3(0x1d1)+_0x677314['cause']),0x1;throw _0x677314;}}}
1
+ const a31_0x580cc0=a31_0x1219;(function(_0x2b8832,_0x105395){const _0x1217cd=a31_0x1219,_0x364447=_0x2b8832();while(!![]){try{const _0x419dcb=-parseInt(_0x1217cd(0x22b))/0x1*(parseInt(_0x1217cd(0x234))/0x2)+-parseInt(_0x1217cd(0x1fb))/0x3*(-parseInt(_0x1217cd(0x267))/0x4)+parseInt(_0x1217cd(0x20c))/0x5*(-parseInt(_0x1217cd(0x21f))/0x6)+-parseInt(_0x1217cd(0x1fa))/0x7+-parseInt(_0x1217cd(0x245))/0x8+parseInt(_0x1217cd(0x263))/0x9+parseInt(_0x1217cd(0x269))/0xa;if(_0x419dcb===_0x105395)break;else _0x364447['push'](_0x364447['shift']());}catch(_0x4f3ae6){_0x364447['push'](_0x364447['shift']());}}}(a31_0x906c,0x54af3));function a31_0x1219(_0x57fa4a,_0x321be7){_0x57fa4a=_0x57fa4a-0x1e1;const _0x906c79=a31_0x906c();let _0x1219c1=_0x906c79[_0x57fa4a];return _0x1219c1;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a31_0x906c(){const _0x1060a8=['code','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Usage:\x20tdx\x20segment\x20describe\x20<path>','Folder\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20Full\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','length','Executing\x20segment\x20query...','segment:desc','Target\x20path:\x20','segment:sql','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','error','Use:\x20tdx\x20ps\x20show','format','jobId','stats','data','Usage:\x20tdx\x20sg\x20desc\x20<name>','Resolved\x20parent\x20folder\x20ID:\x20','getParent','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','2397024zMNFZp','Usage:\x20tdx\x20sg\x20sql\x20<name>','βœ”\x20Created\x20folder\x20\x27','Resolved\x20type:\x20','944JOQzvG','Fetching\x20folder\x20details...','13468790DnOQZH','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Segment\x20ID\x20missing\x20from\x20resolved\x20path','description','Parent\x20segment:\x20','Resolving\x20folder\x20\x27','Listing\x20folders\x20for\x20parent\x20\x27','Resolved\x20YAML\x20file:\x20','segmentId','parentId','folder','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20ps\x20view\x20-w','limit','parent','Resolved\x20parent\x20ID:\x20','segmentPath','Segment\x20ID:\x20','SQL\x20query:\x0a','log','Fetching\x20folder\x20\x27','folderId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','green','Error:\x20Folder\x20reference\x20is\x20required','Use:\x20tdx\x20ps\x20sql','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','elapsedTimeMillis','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Examples:','Options:','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Site:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','resolveParentId','replace','βœ–\x20Query\x20failed\x20[','cyan','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x27\x20with\x20ID:\x20','parentSegment','url','message','3306380FHpBZL','3717eypVxp','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','name','\x20rows\x20','Creating\x20folder\x20\x27','Use:\x20tdx\x20ps\x20view','verbose','Parent\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Use:\x20tdx\x20ps\x20desc','Error:\x20','in\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Resolving\x20parent\x20folder\x20\x27','includes','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','19495wJQqKt','(root)','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','/app/ps/','INVALID_ARGUMENT','fullPath','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Show\x20segment\x20folder\x20details','Parent\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Resolved\x20relative\x20path\x20to:\x20','execute','cause','getSegment','trim','web','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','66euiOdN','segment:folder:list','\x20\x20Folder\x20path:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20SQL\x20for\x20segment...','getFolder','Show\x20folder\x20or\x20child\x20segment\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','information_schema','/e/','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20segment\x20details...','26tsjxkH','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Resolved\x20folder\x20ID:\x20','SEGMENT_FOLDER_NOT_FOUND','resolvePathToResource','resolveFolderId','Show\x20child\x20segment\x20schema\x20(column\x20types)','SEGMENT_NOT_FOUND','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','50726SePdVk','setJobId','type','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','json','Fetching\x20parent\x20segment\x20details...','segment:folder:show','\x27...','processedRows','parentFolder','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','getSegmentSQL','Resolving\x20\x27','\x20Opening\x20','βœ”\x20Query\x20completed:\x20Processed\x20','segment:describe','3072680xZAjGH','segment','segmentName','\x20folder','\x20\x20Segment\x20name:\x20','\x20\x20Cause:\x20','Folder\x20name:\x20'];a31_0x906c=function(){return _0x1060a8;};return a31_0x906c();}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 a31_0x399677 from'chalk';async function resolveSegmentTarget(_0x1f1354,_0x1777ad,_0x49a8ae){const _0x395697=a31_0x1219;if(isYamlFilePath(_0x1f1354))try{const _0x5cddbf=await resolveYamlFilePath(_0x1f1354);return _0x49a8ae&&(console[_0x395697(0x259)](_0x395697(0x270)+_0x1f1354),console[_0x395697(0x259)]('\x20\x20Parent\x20segment:\x20'+_0x5cddbf[_0x395697(0x1f7)]),console[_0x395697(0x259)](_0x395697(0x249)+_0x5cddbf[_0x395697(0x247)]),console[_0x395697(0x259)](_0x395697(0x221)+(_0x5cddbf['folderPath']||_0x395697(0x20d))),console[_0x395697(0x259)](_0x395697(0x251)+_0x5cddbf[_0x395697(0x212)])),_0x5cddbf['fullPath'];}catch(_0x305486){throw new SDKError(ErrorCode[_0x395697(0x211)],_0x395697(0x238)+_0x305486[_0x395697(0x1f9)]);}if(!_0x1777ad)throw new SDKError(ErrorCode[_0x395697(0x211)],_0x395697(0x1e5));return _0x1777ad+'/'+_0x1f1354;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x244);[a31_0x580cc0(0x26c)]='Show\x20segment\x20or\x20folder\x20details';async[a31_0x580cc0(0x219)](_0x19bfae){const _0x31c23a=a31_0x580cc0,{options:_0x409c40,args:_0x485e49,tdx:_0x4da891}=_0x19bfae,_0x2cd5d1=_0x485e49[0x0],_0x1f1dcb=!_0x2cd5d1&&!!_0x409c40['parentSegment'],_0x22f5da=_0x2cd5d1||_0x409c40[_0x31c23a(0x1f7)];if(!_0x22f5da)return console[_0x31c23a(0x259)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x31c23a(0x259)](_0x31c23a(0x24e)),console[_0x31c23a(0x259)](_0x31c23a(0x1e8)),console[_0x31c23a(0x259)](_0x31c23a(0x226)),console['error'](_0x31c23a(0x217)),console['error'](_0x31c23a(0x274)),console[_0x31c23a(0x259)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x1ee15e=_0x409c40[_0x31c23a(0x279)];let _0x24ac37=_0x22f5da;!_0x1f1dcb&&_0x1ee15e&&!_0x22f5da[_0x31c23a(0x20a)]('/')&&(_0x24ac37=_0x1ee15e+'/'+_0x22f5da,_0x409c40['verbose']&&console[_0x31c23a(0x259)](_0x31c23a(0x218)+_0x24ac37));const _0x2d1330=await withSpinner('Resolving\x20path\x20\x27'+_0x24ac37+_0x31c23a(0x23c),()=>_0x4da891[_0x31c23a(0x246)][_0x31c23a(0x22f)](_0x24ac37),{'verbose':_0x409c40[_0x31c23a(0x201)]}),_0x103eb3=_0x2d1330['data'];_0x409c40['verbose']&&(console['error'](_0x31c23a(0x266)+_0x103eb3[_0x31c23a(0x236)]),console['error']('Parent\x20ID:\x20'+_0x103eb3['parentId']),_0x103eb3['folderId']&&console['error'](_0x31c23a(0x24f)+_0x103eb3['folderId']),_0x103eb3[_0x31c23a(0x271)]&&console[_0x31c23a(0x259)](_0x31c23a(0x27a)+_0x103eb3['segmentId']));if(_0x103eb3[_0x31c23a(0x236)]==='parent'){const _0x62410b=await withSpinner(_0x31c23a(0x23a),()=>_0x4da891['segment'][_0x31c23a(0x261)](_0x103eb3[_0x31c23a(0x272)]),{'verbose':_0x409c40['verbose']});await handleSingleObjectOutput(_0x62410b['data'],_0x409c40);}else{if(_0x103eb3[_0x31c23a(0x236)]==='folder'){if(!_0x103eb3[_0x31c23a(0x27e)])throw new SDKError(ErrorCode[_0x31c23a(0x22e)],_0x31c23a(0x229));const _0x298c90=await withSpinner(_0x31c23a(0x268),()=>_0x4da891[_0x31c23a(0x246)]['getFolder'](_0x103eb3['folderId']),{'verbose':_0x409c40[_0x31c23a(0x201)]});await handleSingleObjectOutput(_0x298c90['data'],_0x409c40);}else{if(_0x103eb3['type']===_0x31c23a(0x246)){if(!_0x103eb3[_0x31c23a(0x271)])throw new SDKError(ErrorCode[_0x31c23a(0x232)],_0x31c23a(0x26b));const _0x598823=await withSpinner(_0x31c23a(0x22a),()=>_0x4da891[_0x31c23a(0x246)]['getSegment'](_0x103eb3[_0x31c23a(0x272)],_0x103eb3[_0x31c23a(0x271)]),{'verbose':_0x409c40['verbose']});await handleSingleObjectOutput(_0x598823['data'],_0x409c40);}}}return 0x0;}catch(_0x422426){if(_0x422426 instanceof SDKError)return console[_0x31c23a(0x259)](_0x31c23a(0x205)+_0x422426['message']),_0x422426['cause']&&console['error'](_0x31c23a(0x24a)+_0x422426[_0x31c23a(0x21a)]),0x1;throw _0x422426;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';[a31_0x580cc0(0x26c)]=a31_0x580cc0(0x20f);async[a31_0x580cc0(0x219)](_0x3de730){const _0x5cbb51=a31_0x580cc0,{options:_0x12b775,args:_0x2873d8,tdx:_0x10e67a}=_0x3de730,_0x444cbc=_0x2873d8[0x0];if(!_0x444cbc)return console[_0x5cbb51(0x259)](_0x5cbb51(0x207)),console[_0x5cbb51(0x259)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x5cbb51(0x259)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console['error'](_0x5cbb51(0x1e8)),console[_0x5cbb51(0x259)](_0x5cbb51(0x26a)),console['error'](_0x5cbb51(0x214)),0x1;try{const _0x2d63e7=_0x12b775[_0x5cbb51(0x1f7)],_0x5df1ae=await resolveSegmentTarget(_0x444cbc,_0x2d63e7,_0x12b775[_0x5cbb51(0x201)]);_0x12b775[_0x5cbb51(0x201)]&&console[_0x5cbb51(0x259)](_0x5cbb51(0x256)+_0x5df1ae);const _0x5abd31=await withSpinner(_0x5cbb51(0x241)+_0x444cbc+_0x5cbb51(0x23c),()=>_0x10e67a[_0x5cbb51(0x246)]['resolvePathToResource'](_0x5df1ae),{'verbose':_0x12b775[_0x5cbb51(0x201)]}),_0x2c3d2c=_0x5abd31[_0x5cbb51(0x25e)];_0x12b775['verbose']&&(console[_0x5cbb51(0x259)](_0x5cbb51(0x266)+_0x2c3d2c['type']),console[_0x5cbb51(0x259)](_0x5cbb51(0x202)+_0x2c3d2c[_0x5cbb51(0x272)]));if(_0x2c3d2c[_0x5cbb51(0x236)]===_0x5cbb51(0x273))return console[_0x5cbb51(0x259)](_0x5cbb51(0x208)),console[_0x5cbb51(0x259)](_0x5cbb51(0x237)),0x1;if(_0x2c3d2c[_0x5cbb51(0x236)]===_0x5cbb51(0x277))return console[_0x5cbb51(0x259)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5cbb51(0x259)](_0x5cbb51(0x25a)),0x1;if(!_0x2c3d2c[_0x5cbb51(0x271)])throw new SDKError(ErrorCode[_0x5cbb51(0x232)],_0x5cbb51(0x26b));const _0x58f66b=await withSpinner(_0x5cbb51(0x223),()=>_0x10e67a[_0x5cbb51(0x246)][_0x5cbb51(0x240)](_0x2c3d2c[_0x5cbb51(0x272)],_0x2c3d2c[_0x5cbb51(0x271)]),{'verbose':_0x12b775[_0x5cbb51(0x201)]});let _0x1fdcc6=_0x58f66b[_0x5cbb51(0x25e)];const _0x3344a4=resolveLimit(_0x12b775[_0x5cbb51(0x276)],DEFAULT_DISPLAY_LIMIT),_0x2455b3=/\bLIMIT\s+\d+/i['test'](_0x1fdcc6);!_0x2455b3&&(_0x1fdcc6=_0x1fdcc6[_0x5cbb51(0x21c)]()[_0x5cbb51(0x1f1)](/;+$/,''),_0x1fdcc6='SELECT\x20*\x20FROM\x20(\x0a'+_0x1fdcc6+_0x5cbb51(0x1fc)+_0x3344a4);_0x12b775[_0x5cbb51(0x201)]&&console[_0x5cbb51(0x259)](_0x5cbb51(0x27b)+_0x1fdcc6);const _0x24dcfd=await withProgressSpinner(_0x5cbb51(0x254),async _0x489db9=>{const _0xc5cbe9=_0x5cbb51,_0x438a91=await _0x10e67a['query']['execute'](_0x1fdcc6,{'catalog':'td','schema':_0xc5cbe9(0x227),'onJobId':_0xf5291c=>{const _0x49b524=_0xc5cbe9;_0x489db9[_0x49b524(0x235)](_0xf5291c);}});return _0x438a91;},{'verbose':_0x12b775[_0x5cbb51(0x201)]}),_0x561b37=_0x24dcfd[_0x5cbb51(0x25e)],_0x376d08=_0x561b37['jobId']?'\x20[Job\x20ID:\x20'+_0x561b37[_0x5cbb51(0x25c)]+']':'';return console['error'](_0x5cbb51(0x243)+_0x561b37[_0x5cbb51(0x25d)][_0x5cbb51(0x23d)]['toLocaleString']()+_0x5cbb51(0x1fe)+(_0x5cbb51(0x206)+formatElapsed(_0x561b37[_0x5cbb51(0x25d)][_0x5cbb51(0x1e6)])+_0x376d08)),await handleQueryOutput(_0x561b37,_0x12b775),0x0;}catch(_0x3981bc){if(_0x3981bc instanceof SDKError)return console[_0x5cbb51(0x259)](_0x5cbb51(0x1f2)+_0x3981bc[_0x5cbb51(0x24c)]+']'),console[_0x5cbb51(0x259)]('\x0a'+_0x3981bc[_0x5cbb51(0x1f9)]),0x1;throw _0x3981bc;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x220);[a31_0x580cc0(0x26c)]=a31_0x580cc0(0x1e1);async['execute'](_0x1a72d2){const _0x74dc9d=a31_0x580cc0,{options:_0x573ae2,args:_0x59f140,tdx:_0x481c82}=_0x1a72d2;if(_0x59f140[_0x74dc9d(0x253)]===0x0)return console[_0x74dc9d(0x259)](_0x74dc9d(0x250)),console[_0x74dc9d(0x259)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x4a0cba=_0x59f140[0x0];try{_0x573ae2[_0x74dc9d(0x201)]&&(console[_0x74dc9d(0x259)](_0x74dc9d(0x1ee)+_0x573ae2['site']),console[_0x74dc9d(0x259)](_0x74dc9d(0x216)+_0x4a0cba));const _0x5a6238=await withSpinner(_0x74dc9d(0x213)+_0x4a0cba+_0x74dc9d(0x23c),()=>_0x481c82['segment']['resolveParentId'](_0x4a0cba),{'verbose':_0x573ae2[_0x74dc9d(0x201)]}),_0x3cd7b1=_0x5a6238[_0x74dc9d(0x25e)];_0x573ae2['verbose']&&console[_0x74dc9d(0x259)](_0x74dc9d(0x278)+_0x3cd7b1);const _0x9fbaf9=await withSpinner(_0x74dc9d(0x26f)+_0x4a0cba+_0x74dc9d(0x23c),()=>_0x481c82[_0x74dc9d(0x246)]['listFolders'](_0x3cd7b1),{'verbose':_0x573ae2[_0x74dc9d(0x201)]}),_0x161127=_0x9fbaf9['data'];return console[_0x74dc9d(0x259)]('βœ”\x20Found\x20'+_0x161127[_0x74dc9d(0x253)]+_0x74dc9d(0x248)+(_0x161127[_0x74dc9d(0x253)]!==0x1?'s':'')),await handleSDKOutput(_0x161127,_0x573ae2),0x0;}catch(_0x3d7eaa){if(_0x3d7eaa instanceof SDKError)return console[_0x74dc9d(0x259)](_0x74dc9d(0x205)+_0x3d7eaa['message']),_0x3d7eaa[_0x74dc9d(0x21a)]&&console[_0x74dc9d(0x259)](_0x74dc9d(0x24a)+_0x3d7eaa['cause']),0x1;throw _0x3d7eaa;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x23b);['description']=a31_0x580cc0(0x215);async[a31_0x580cc0(0x219)](_0x349057){const _0x4d6399=a31_0x580cc0,{options:_0x1ddb5b,args:_0x44c2c7,tdx:_0x115f33}=_0x349057;if(_0x44c2c7[_0x4d6399(0x253)]===0x0)return console['error'](_0x4d6399(0x1e3)),console[_0x4d6399(0x259)](_0x4d6399(0x21e)),0x1;try{const {parentId:_0x1d4cf3,childId:_0x5f407c}=parseSegmentRef(_0x44c2c7[0x0]);_0x1ddb5b[_0x4d6399(0x201)]&&(console[_0x4d6399(0x259)](_0x4d6399(0x1ee)+_0x1ddb5b['site']),console[_0x4d6399(0x259)](_0x4d6399(0x216)+_0x1d4cf3),_0x5f407c&&console['error'](_0x4d6399(0x24b)+_0x5f407c));if(!_0x5f407c)return console[_0x4d6399(0x259)](_0x4d6399(0x1ea)),0x1;const _0x287520=await withSpinner(_0x4d6399(0x213)+_0x1d4cf3+_0x4d6399(0x23c),()=>_0x115f33[_0x4d6399(0x246)][_0x4d6399(0x1f0)](_0x1d4cf3),{'verbose':_0x1ddb5b[_0x4d6399(0x201)]}),_0x2cbea0=_0x287520[_0x4d6399(0x25e)];_0x1ddb5b[_0x4d6399(0x201)]&&console[_0x4d6399(0x259)](_0x4d6399(0x278)+_0x2cbea0);const _0x444caa=await withSpinner(_0x4d6399(0x26e)+_0x5f407c+'\x27...',()=>_0x115f33[_0x4d6399(0x246)][_0x4d6399(0x230)](_0x2cbea0,_0x5f407c),{'verbose':_0x1ddb5b[_0x4d6399(0x201)]}),_0xaaa1bb=_0x444caa[_0x4d6399(0x25e)];_0x1ddb5b[_0x4d6399(0x201)]&&console[_0x4d6399(0x259)](_0x4d6399(0x22d)+_0xaaa1bb);const _0x581ed6=await withSpinner(_0x4d6399(0x27d)+_0x5f407c+_0x4d6399(0x23c),()=>_0x115f33['segment'][_0x4d6399(0x224)](_0xaaa1bb),{'verbose':_0x1ddb5b[_0x4d6399(0x201)]});return await handleSDKOutput([_0x581ed6['data']],_0x1ddb5b),0x0;}catch(_0x28e2fd){if(_0x28e2fd instanceof SDKError)return console[_0x4d6399(0x259)]('Error:\x20'+_0x28e2fd[_0x4d6399(0x1f9)]),_0x28e2fd[_0x4d6399(0x21a)]&&console[_0x4d6399(0x259)](_0x4d6399(0x24a)+_0x28e2fd['cause']),0x1;throw _0x28e2fd;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x257);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a31_0x580cc0(0x219)](_0x922b9f){const _0x3da5d3=a31_0x580cc0,{options:_0x5d20b9,args:_0x258dff,tdx:_0xbea2e8}=_0x922b9f,_0x44edf5=_0x258dff[0x0];if(!_0x44edf5)return console[_0x3da5d3(0x259)](_0x3da5d3(0x207)),console[_0x3da5d3(0x259)](_0x3da5d3(0x264)),console[_0x3da5d3(0x259)](_0x3da5d3(0x203)),console[_0x3da5d3(0x259)](_0x3da5d3(0x1e8)),console[_0x3da5d3(0x259)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console['error'](_0x3da5d3(0x24d)),0x1;try{const _0x3d5673=_0x5d20b9['parentSegment'],_0x4dfa16=await resolveSegmentTarget(_0x44edf5,_0x3d5673,_0x5d20b9[_0x3da5d3(0x201)]);_0x5d20b9[_0x3da5d3(0x201)]&&console['error'](_0x3da5d3(0x256)+_0x4dfa16);const _0x4d975b=await withSpinner(_0x3da5d3(0x241)+_0x44edf5+'\x27...',()=>_0xbea2e8[_0x3da5d3(0x246)][_0x3da5d3(0x22f)](_0x4dfa16),{'verbose':_0x5d20b9[_0x3da5d3(0x201)]}),_0x9cc294=_0x4d975b['data'];_0x5d20b9[_0x3da5d3(0x201)]&&(console[_0x3da5d3(0x259)](_0x3da5d3(0x266)+_0x9cc294[_0x3da5d3(0x236)]),console[_0x3da5d3(0x259)]('Parent\x20ID:\x20'+_0x9cc294[_0x3da5d3(0x272)]));if(_0x9cc294[_0x3da5d3(0x236)]===_0x3da5d3(0x273))return console[_0x3da5d3(0x259)](_0x3da5d3(0x1f5)),console[_0x3da5d3(0x259)](_0x3da5d3(0x20e)),0x1;if(_0x9cc294[_0x3da5d3(0x236)]===_0x3da5d3(0x277))return console[_0x3da5d3(0x259)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3da5d3(0x259)](_0x3da5d3(0x1e4)),0x1;if(!_0x9cc294['segmentId'])throw new SDKError(ErrorCode[_0x3da5d3(0x232)],_0x3da5d3(0x26b));const _0x105a74=await withSpinner(_0x3da5d3(0x223),()=>_0xbea2e8['segment'][_0x3da5d3(0x240)](_0x9cc294[_0x3da5d3(0x272)],_0x9cc294[_0x3da5d3(0x271)]),{'verbose':_0x5d20b9['verbose']}),_0x27e3eb=_0x105a74['data'];return _0x5d20b9[_0x3da5d3(0x25b)]===_0x3da5d3(0x239)||_0x5d20b9[_0x3da5d3(0x25b)]==='jsonl'?await handleSDKOutput([{'sql':_0x27e3eb}],_0x5d20b9):console[_0x3da5d3(0x27c)](_0x27e3eb),0x0;}catch(_0x4d40ba){if(_0x4d40ba instanceof SDKError)return console[_0x3da5d3(0x259)](_0x3da5d3(0x205)+_0x4d40ba[_0x3da5d3(0x1f9)]),_0x4d40ba[_0x3da5d3(0x21a)]&&console[_0x3da5d3(0x259)]('\x20\x20Cause:\x20'+_0x4d40ba['cause']),0x1;throw _0x4d40ba;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]='segment:folder:create';[a31_0x580cc0(0x26c)]='Create\x20segment\x20folder\x20for\x20organization';async[a31_0x580cc0(0x219)](_0x5ab3c0){const _0x3838c1=a31_0x580cc0,{options:_0xa1f398,args:_0x749406,tdx:_0x25bb8a}=_0x5ab3c0,_0x46e632=_0xa1f398;if(_0x749406[_0x3838c1(0x253)]<0x2)return console['error']('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x3838c1(0x1e7)),0x1;const _0x4cdec2=_0x749406[0x0],_0x5d7a14=_0x749406[0x1];_0x46e632[_0x3838c1(0x201)]&&(console[_0x3838c1(0x259)](_0x3838c1(0x1ee)+_0x46e632['site']),console['error'](_0x3838c1(0x26d)+_0x4cdec2),console[_0x3838c1(0x259)]('Folder\x20name:\x20'+_0x5d7a14));let _0x21231a;if(_0x46e632[_0x3838c1(0x23e)]){const _0x23fc01=_0x46e632[_0x3838c1(0x23e)],_0x3b5284=await withSpinner(_0x3838c1(0x213)+_0x4cdec2+_0x3838c1(0x23c),()=>_0x25bb8a['segment'][_0x3838c1(0x1f0)](_0x4cdec2),{'verbose':_0x46e632[_0x3838c1(0x201)]}),_0x487800=_0x3b5284[_0x3838c1(0x25e)],_0x5560d5=await withSpinner(_0x3838c1(0x209)+_0x23fc01+_0x3838c1(0x23c),()=>_0x25bb8a[_0x3838c1(0x246)][_0x3838c1(0x230)](_0x487800,_0x23fc01),{'verbose':_0x46e632[_0x3838c1(0x201)]});_0x21231a=_0x5560d5[_0x3838c1(0x25e)],_0x46e632[_0x3838c1(0x201)]&&console['error'](_0x3838c1(0x260)+_0x21231a);}const _0xf8b27a={'name':_0x5d7a14,'description':_0x46e632[_0x3838c1(0x26c)],'parentFolderId':_0x21231a},_0x4513c2=await withSpinner(_0x3838c1(0x1ff)+_0x5d7a14+_0x3838c1(0x23c),()=>_0x25bb8a['segment']['createFolder'](_0x4cdec2,_0xf8b27a),{'verbose':_0x46e632[_0x3838c1(0x201)]}),_0x28d2d8=_0x4513c2[_0x3838c1(0x25e)];return console[_0x3838c1(0x259)](_0x3838c1(0x265)+_0x28d2d8[_0x3838c1(0x1fd)]+_0x3838c1(0x1f6)+_0x28d2d8['id']),await handleSDKOutput([_0x28d2d8],_0x46e632),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]='segment:view';[a31_0x580cc0(0x26c)]=a31_0x580cc0(0x225);async[a31_0x580cc0(0x219)](_0x33def7){const _0x3ebc1a=a31_0x580cc0,{options:_0x10a55a,args:_0x5bafc7,tdx:_0x15f686}=_0x33def7,_0x1fd063=_0x5bafc7[0x0];if(!_0x1fd063)return console[_0x3ebc1a(0x259)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x262)),console['error'](_0x3ebc1a(0x233)),console['error'](_0x3ebc1a(0x1e9)),console['error'](_0x3ebc1a(0x1ec)),console[_0x3ebc1a(0x259)]('Examples:'),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x1ef)),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x1ed)),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x20b)),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x23f)),0x1;try{const _0x593e14=_0x10a55a['parentSegment'],_0x29ca4e=await resolveSegmentTarget(_0x1fd063,_0x593e14,_0x10a55a[_0x3ebc1a(0x201)]);_0x10a55a['verbose']&&console[_0x3ebc1a(0x259)](_0x3ebc1a(0x256)+_0x29ca4e);const _0x39e950=await withSpinner(_0x3ebc1a(0x241)+_0x1fd063+_0x3ebc1a(0x23c),()=>_0x15f686[_0x3ebc1a(0x246)][_0x3ebc1a(0x22f)](_0x29ca4e),{'verbose':_0x10a55a['verbose']}),_0x3d3040=_0x39e950[_0x3ebc1a(0x25e)];_0x10a55a[_0x3ebc1a(0x201)]&&(console[_0x3ebc1a(0x259)](_0x3ebc1a(0x266)+_0x3d3040[_0x3ebc1a(0x236)]),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x202)+_0x3d3040['parentId']),_0x3d3040[_0x3ebc1a(0x27e)]&&console[_0x3ebc1a(0x259)](_0x3ebc1a(0x24f)+_0x3d3040[_0x3ebc1a(0x27e)]),_0x3d3040['segmentId']&&console['error'](_0x3ebc1a(0x27a)+_0x3d3040['segmentId']));if(_0x10a55a[_0x3ebc1a(0x21d)]){if(_0x3d3040[_0x3ebc1a(0x236)]===_0x3ebc1a(0x273))return console[_0x3ebc1a(0x259)](_0x3ebc1a(0x22c)),0x1;if(_0x3d3040[_0x3ebc1a(0x236)]===_0x3ebc1a(0x277))return console[_0x3ebc1a(0x259)](_0x3ebc1a(0x258)),console['error'](_0x3ebc1a(0x275)),0x1;if(!_0x3d3040[_0x3ebc1a(0x271)])throw new SDKError(ErrorCode[_0x3ebc1a(0x232)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x32bf81=getConsoleNextUrl(_0x10a55a['site'],'/app/ps/'+_0x3d3040[_0x3ebc1a(0x272)]+_0x3ebc1a(0x228)+_0x3d3040['segmentId']);return console[_0x3ebc1a(0x259)](a31_0x399677[_0x3ebc1a(0x1e2)]('βœ”')+_0x3ebc1a(0x242)+a31_0x399677[_0x3ebc1a(0x1f3)](_0x32bf81)),openBrowser(_0x32bf81),0x0;}if(_0x3d3040[_0x3ebc1a(0x236)]===_0x3ebc1a(0x273)){if(!_0x3d3040[_0x3ebc1a(0x27e)])throw new SDKError(ErrorCode[_0x3ebc1a(0x22e)],_0x3ebc1a(0x229));const _0x1fe49b=await withSpinner(_0x3ebc1a(0x268),()=>_0x15f686[_0x3ebc1a(0x246)][_0x3ebc1a(0x224)](_0x3d3040[_0x3ebc1a(0x27e)]),{'verbose':_0x10a55a[_0x3ebc1a(0x201)]});await handleSingleObjectOutput(_0x1fe49b[_0x3ebc1a(0x25e)],_0x10a55a);}else{if(_0x3d3040[_0x3ebc1a(0x236)]===_0x3ebc1a(0x246)){if(!_0x3d3040[_0x3ebc1a(0x271)])throw new SDKError(ErrorCode[_0x3ebc1a(0x232)],_0x3ebc1a(0x26b));const _0x96ce3e=await withSpinner(_0x3ebc1a(0x22a),()=>_0x15f686[_0x3ebc1a(0x246)][_0x3ebc1a(0x21b)](_0x3d3040['parentId'],_0x3d3040[_0x3ebc1a(0x271)]),{'verbose':_0x10a55a[_0x3ebc1a(0x201)]}),_0xb3067c=getConsoleNextUrl(_0x10a55a['site'],_0x3ebc1a(0x210)+_0x3d3040[_0x3ebc1a(0x272)]+_0x3ebc1a(0x228)+_0x3d3040[_0x3ebc1a(0x271)]),_0x338acd=_0x96ce3e['data'];_0x338acd[_0x3ebc1a(0x1f8)]=_0xb3067c,await handleSingleObjectOutput(_0x338acd,_0x10a55a);}else return console[_0x3ebc1a(0x259)](_0x3ebc1a(0x1eb)),console[_0x3ebc1a(0x259)](_0x3ebc1a(0x200)),0x1;}return 0x0;}catch(_0x25d4dd){if(_0x25d4dd instanceof SDKError)return console[_0x3ebc1a(0x259)]('Error:\x20'+_0x25d4dd[_0x3ebc1a(0x1f9)]),_0x25d4dd['cause']&&console[_0x3ebc1a(0x259)](_0x3ebc1a(0x24a)+_0x25d4dd['cause']),0x1;throw _0x25d4dd;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x580cc0(0x1fd)]=a31_0x580cc0(0x255);[a31_0x580cc0(0x26c)]=a31_0x580cc0(0x231);async[a31_0x580cc0(0x219)](_0x583355){const _0x2d24d8=a31_0x580cc0,{options:_0x194326,args:_0x374562,tdx:_0xb9c8f1}=_0x583355,_0x5aceec=_0x374562[0x0];if(!_0x5aceec)return console['error'](_0x2d24d8(0x207)),console[_0x2d24d8(0x259)](_0x2d24d8(0x25f)),console[_0x2d24d8(0x259)](_0x2d24d8(0x252)),console[_0x2d24d8(0x259)](_0x2d24d8(0x1e8)),console[_0x2d24d8(0x259)](_0x2d24d8(0x1f4)),console[_0x2d24d8(0x259)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5cf56c=_0x194326[_0x2d24d8(0x1f7)],_0x28477d=await resolveSegmentTarget(_0x5aceec,_0x5cf56c,_0x194326['verbose']);_0x194326[_0x2d24d8(0x201)]&&console[_0x2d24d8(0x259)]('Target\x20path:\x20'+_0x28477d);const _0x32d2c5=await withSpinner(_0x2d24d8(0x241)+_0x5aceec+_0x2d24d8(0x23c),()=>_0xb9c8f1['segment'][_0x2d24d8(0x22f)](_0x28477d),{'verbose':_0x194326[_0x2d24d8(0x201)]}),_0x3afd08=_0x32d2c5['data'];_0x194326[_0x2d24d8(0x201)]&&(console['error']('Resolved\x20type:\x20'+_0x3afd08['type']),console[_0x2d24d8(0x259)]('Parent\x20ID:\x20'+_0x3afd08['parentId']));if(_0x3afd08[_0x2d24d8(0x236)]===_0x2d24d8(0x273))return console[_0x2d24d8(0x259)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x2d24d8(0x259)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x3afd08['type']==='parent')return console[_0x2d24d8(0x259)](_0x2d24d8(0x222)),console[_0x2d24d8(0x259)](_0x2d24d8(0x204)),0x1;if(!_0x3afd08[_0x2d24d8(0x271)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2d24d8(0x26b));const _0x91d0f2=await withSpinner(_0x2d24d8(0x223),()=>_0xb9c8f1['segment'][_0x2d24d8(0x240)](_0x3afd08['parentId'],_0x3afd08[_0x2d24d8(0x271)]),{'verbose':_0x194326[_0x2d24d8(0x201)]}),_0x35b106=_0x91d0f2[_0x2d24d8(0x25e)],_0x385ca5=await executeSchemaQuery(_0x35b106,_0xb9c8f1,_0x194326);return await handleQueryOutput(_0x385ca5,_0x194326),0x0;}catch(_0x347f4e){if(_0x347f4e instanceof SDKError)return console['error']('Error:\x20'+_0x347f4e[_0x2d24d8(0x1f9)]),_0x347f4e[_0x2d24d8(0x21a)]&&console[_0x2d24d8(0x259)](_0x2d24d8(0x24a)+_0x347f4e[_0x2d24d8(0x21a)]),0x1;throw _0x347f4e;}}}
@@ -1 +1 @@
1
- const a32_0x50e1d0=a32_0x2a85;function a32_0x249a(){const _0x10df87=['description','6589sdMDXl','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','1269790FWjCfi','617144KuSxiD','segment:create','Examples:','noCountPopulation','Segment\x20name:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','48cSskLJ','Target\x20path:\x20','type','9tueUEm','parent','error','kind','734812gDmCBg','resolveParentId','resolvePathToResource','Resolving\x20parent\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','βœ”\x20Created\x20segment\x20\x27','segments','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Creating\x20segment\x20\x27','191768dCYHYs','Resolving\x20folder\x20path\x20\x27','verbose','\x27...','folder','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','execute','\x20\x20\x20Path:\x20','name','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','createSegment','folderId','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Parent\x20path:\x20','46dpLMfC','yellow','276240wxaKWi','5hvVWTa','segment','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolving\x20folder\x20\x27','length','Site:\x20','data','77208PArcbF','35SUaTBB','ruleFile'];a32_0x249a=function(){return _0x10df87;};return a32_0x249a();}function a32_0x2a85(_0x27912c,_0x1cf8b5){_0x27912c=_0x27912c-0x1a2;const _0x249a26=a32_0x249a();let _0x2a85f9=_0x249a26[_0x27912c];return _0x2a85f9;}(function(_0x154c8f,_0x56ed32){const _0x210fe9=a32_0x2a85,_0x52afeb=_0x154c8f();while(!![]){try{const _0x1de510=parseInt(_0x210fe9(0x1aa))/0x1*(-parseInt(_0x210fe9(0x1d4))/0x2)+-parseInt(_0x210fe9(0x1a6))/0x3+-parseInt(_0x210fe9(0x1bb))/0x4*(-parseInt(_0x210fe9(0x1d7))/0x5)+parseInt(_0x210fe9(0x1d6))/0x6*(-parseInt(_0x210fe9(0x1a7))/0x7)+-parseInt(_0x210fe9(0x1c5))/0x8*(-parseInt(_0x210fe9(0x1b7))/0x9)+parseInt(_0x210fe9(0x1ac))/0xa+-parseInt(_0x210fe9(0x1ad))/0xb*(-parseInt(_0x210fe9(0x1b4))/0xc);if(_0x1de510===_0x56ed32)break;else _0x52afeb['push'](_0x52afeb['shift']());}catch(_0x268415){_0x52afeb['push'](_0x52afeb['shift']());}}}(a32_0x249a,0x25022));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 a32_0x3c938c from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x50e1d0(0x1ce)]=a32_0x50e1d0(0x1ae);[a32_0x50e1d0(0x1a9)]=a32_0x50e1d0(0x1d9);async[a32_0x50e1d0(0x1cc)](_0x45700f){const _0x37836d=a32_0x50e1d0;console['error'](a32_0x3c938c[_0x37836d(0x1d5)](_0x37836d(0x1d2))),console['error'](a32_0x3c938c[_0x37836d(0x1d5)](_0x37836d(0x1bf)));const {options:_0x4b5786,args:_0x2658c3,tdx:_0x2e042b}=_0x45700f,_0x434e7b=_0x4b5786;if(_0x2658c3[_0x37836d(0x1a3)]===0x0)return console[_0x37836d(0x1b9)](_0x37836d(0x1b2)),console[_0x37836d(0x1b9)](_0x37836d(0x1ab)),console[_0x37836d(0x1b9)](_0x37836d(0x1af)),console['error'](_0x37836d(0x1c3)),console[_0x37836d(0x1b9)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x37836d(0x1b9)](_0x37836d(0x1b3)),0x1;const _0x3a9758=_0x2658c3[0x0],_0x440be3=_0x4b5786['segmentPath'];let _0x22f0ad=_0x3a9758;_0x440be3&&!_0x3a9758['includes']('/')&&(_0x22f0ad=_0x440be3+'/'+_0x3a9758,_0x434e7b['verbose']&&console['error'](_0x37836d(0x1c2)+_0x22f0ad));const _0x307e70=parsePath(_0x22f0ad);if(_0x307e70[_0x37836d(0x1c1)][_0x37836d(0x1a3)]<0x2)return console['error'](_0x37836d(0x1cb)),console[_0x37836d(0x1b9)](_0x37836d(0x1cf)),0x1;const _0x4feaa9=_0x307e70['segments'][0x0],_0x53fc3d=getBaseName(_0x22f0ad),_0x1f4904=getParentPath(_0x22f0ad);_0x434e7b['verbose']&&(console[_0x37836d(0x1b9)](_0x37836d(0x1a4)+_0x434e7b['site']),console['error'](_0x37836d(0x1b5)+_0x22f0ad),console[_0x37836d(0x1b9)]('Parent:\x20'+_0x4feaa9),console[_0x37836d(0x1b9)](_0x37836d(0x1b1)+_0x53fc3d),console[_0x37836d(0x1b9)](_0x37836d(0x1d3)+_0x1f4904));const _0x421c2d=await withSpinner(_0x37836d(0x1be)+_0x4feaa9+_0x37836d(0x1c8),()=>_0x2e042b[_0x37836d(0x1d8)][_0x37836d(0x1bc)](_0x4feaa9),{'verbose':_0x434e7b['verbose']}),_0x2deace=_0x421c2d[_0x37836d(0x1a5)];let _0x1c15d3;if(_0x307e70['segments'][_0x37836d(0x1a3)]>0x2){const _0x4f3316=await withSpinner(_0x37836d(0x1c6)+_0x1f4904+_0x37836d(0x1c8),()=>_0x2e042b[_0x37836d(0x1d8)][_0x37836d(0x1bd)](_0x1f4904),{'verbose':_0x434e7b[_0x37836d(0x1c7)]}),_0x1aa431=_0x4f3316[_0x37836d(0x1a5)];if(_0x1aa431[_0x37836d(0x1b6)]!==_0x37836d(0x1c9)&&_0x1aa431[_0x37836d(0x1b6)]!==_0x37836d(0x1b8))return console[_0x37836d(0x1b9)](_0x37836d(0x1ca)),0x1;_0x1c15d3=_0x1aa431[_0x37836d(0x1d1)];}else{if(_0x434e7b['folder']){const _0x3b0752=await withSpinner(_0x37836d(0x1a2)+_0x434e7b[_0x37836d(0x1c9)]+_0x37836d(0x1c8),()=>_0x2e042b[_0x37836d(0x1d8)]['resolveFolderId'](_0x2deace,_0x434e7b[_0x37836d(0x1c9)]),{'verbose':_0x434e7b['verbose']});_0x1c15d3=_0x3b0752['data'];}}_0x434e7b['verbose']&&_0x1c15d3&&console[_0x37836d(0x1b9)]('Resolved\x20folder\x20ID:\x20'+_0x1c15d3);const _0x13ced4=await loadJSONFromOptions(_0x434e7b['rule'],_0x434e7b[_0x37836d(0x1a8)]),_0x4964a0={'name':_0x53fc3d,'description':_0x434e7b[_0x37836d(0x1a9)],'rule':_0x13ced4,'kind':_0x434e7b[_0x37836d(0x1ba)]!==undefined?parseInt(_0x434e7b[_0x37836d(0x1ba)],0xa):undefined,'isVisible':_0x434e7b['invisible']?![]:undefined,'segmentFolderId':_0x1c15d3,'countPopulation':_0x434e7b[_0x37836d(0x1b0)]?![]:undefined},_0x117995=await withSpinner(_0x37836d(0x1c4)+_0x53fc3d+_0x37836d(0x1c8),()=>_0x2e042b[_0x37836d(0x1d8)][_0x37836d(0x1d0)](_0x2deace,_0x4964a0),{'verbose':_0x434e7b[_0x37836d(0x1c7)]}),_0x2be4fb=_0x117995[_0x37836d(0x1a5)];return console[_0x37836d(0x1b9)](_0x37836d(0x1c0)+_0x2be4fb[_0x37836d(0x1ce)]+'\x27\x20with\x20ID:\x20'+_0x2be4fb['id']),_0x22f0ad!==_0x3a9758&&console['error'](_0x37836d(0x1cd)+_0x22f0ad),await handleSDKOutput([_0x2be4fb],_0x434e7b),0x0;}}
1
+ const a32_0x368262=a32_0x2aba;(function(_0x200289,_0x307faf){const _0x2e4314=a32_0x2aba,_0x52388d=_0x200289();while(!![]){try{const _0x4de0ea=-parseInt(_0x2e4314(0x1ba))/0x1*(-parseInt(_0x2e4314(0x1ac))/0x2)+parseInt(_0x2e4314(0x1b8))/0x3+parseInt(_0x2e4314(0x196))/0x4*(parseInt(_0x2e4314(0x194))/0x5)+parseInt(_0x2e4314(0x1b7))/0x6+parseInt(_0x2e4314(0x1b0))/0x7+parseInt(_0x2e4314(0x1a1))/0x8*(-parseInt(_0x2e4314(0x198))/0x9)+-parseInt(_0x2e4314(0x1a0))/0xa;if(_0x4de0ea===_0x307faf)break;else _0x52388d['push'](_0x52388d['shift']());}catch(_0x48316b){_0x52388d['push'](_0x52388d['shift']());}}}(a32_0x80b9,0x26428));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a32_0x80b9(){const _0x1bba80=['name','description','\x20\x20\x20Path:\x20','segments','Site:\x20','noCountPopulation','Resolved\x20folder\x20ID:\x20','Segment\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','\x27\x20with\x20ID:\x20','createSegment','segment','5aJgSqg','yellow','550568NumAVb','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','2402091DMWLfd','error','folder','includes','\x27...','Resolved\x20relative\x20path\x20to:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','Parent:\x20','4371300xywiEi','8TWcPlF','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','kind','resolvePathToResource','verbose','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','invisible','Target\x20path:\x20','Resolving\x20folder\x20\x27','17606tetySJ','Parent\x20path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','length','582589sCuFEY','site','rule','data','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolving\x20folder\x20path\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','1601664CyhKgw','564195NaADYW','βœ”\x20Created\x20segment\x20\x27','21KRuweH','type'];a32_0x80b9=function(){return _0x1bba80;};return a32_0x80b9();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a32_0x2aba(_0x19e061,_0x2830fe){_0x19e061=_0x19e061-0x190;const _0x80b9a=a32_0x80b9();let _0x2aba66=_0x80b9a[_0x19e061];return _0x2aba66;}import a32_0x312ece from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x368262(0x1bc)]='segment:create';[a32_0x368262(0x1bd)]=a32_0x368262(0x19e);async[a32_0x368262(0x1a3)](_0x227144){const _0x18c300=a32_0x368262;console[_0x18c300(0x199)](a32_0x312ece['yellow'](_0x18c300(0x197))),console[_0x18c300(0x199)](a32_0x312ece[_0x18c300(0x195)](_0x18c300(0x1b6)));const {options:_0x5becbb,args:_0x345316,tdx:_0x2c39e6}=_0x227144,_0x5562c4=_0x5becbb;if(_0x345316[_0x18c300(0x1af)]===0x0)return console['error'](_0x18c300(0x1a2)),console[_0x18c300(0x199)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x18c300(0x199)]('Examples:'),console[_0x18c300(0x199)](_0x18c300(0x1a4)),console['error'](_0x18c300(0x1b4)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x18b06c=_0x345316[0x0],_0x527c44=_0x5becbb['segmentPath'];let _0x50d469=_0x18b06c;_0x527c44&&!_0x18b06c[_0x18c300(0x19b)]('/')&&(_0x50d469=_0x527c44+'/'+_0x18b06c,_0x5562c4['verbose']&&console['error'](_0x18c300(0x19d)+_0x50d469));const _0x1f090b=parsePath(_0x50d469);if(_0x1f090b[_0x18c300(0x1bf)]['length']<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x18c300(0x199)](_0x18c300(0x1a8)),0x1;const _0x609865=_0x1f090b[_0x18c300(0x1bf)][0x0],_0x5c8462=getBaseName(_0x50d469),_0x7691dc=getParentPath(_0x50d469);_0x5562c4[_0x18c300(0x1a7)]&&(console['error'](_0x18c300(0x1c0)+_0x5562c4[_0x18c300(0x1b1)]),console[_0x18c300(0x199)](_0x18c300(0x1aa)+_0x50d469),console['error'](_0x18c300(0x19f)+_0x609865),console[_0x18c300(0x199)](_0x18c300(0x1c3)+_0x5c8462),console[_0x18c300(0x199)](_0x18c300(0x1ad)+_0x7691dc));const _0x2f0fee=await withSpinner(_0x18c300(0x190)+_0x609865+'\x27...',()=>_0x2c39e6[_0x18c300(0x193)]['resolveParentId'](_0x609865),{'verbose':_0x5562c4[_0x18c300(0x1a7)]}),_0x46b77b=_0x2f0fee['data'];let _0x5e7da3;if(_0x1f090b['segments'][_0x18c300(0x1af)]>0x2){const _0x29ebe2=await withSpinner(_0x18c300(0x1b5)+_0x7691dc+_0x18c300(0x19c),()=>_0x2c39e6['segment'][_0x18c300(0x1a6)](_0x7691dc),{'verbose':_0x5562c4[_0x18c300(0x1a7)]}),_0x49e7d2=_0x29ebe2[_0x18c300(0x1b3)];if(_0x49e7d2[_0x18c300(0x1bb)]!==_0x18c300(0x19a)&&_0x49e7d2['type']!=='parent')return console[_0x18c300(0x199)](_0x18c300(0x1ae)),0x1;_0x5e7da3=_0x49e7d2['folderId'];}else{if(_0x5562c4[_0x18c300(0x19a)]){const _0x38a5ca=await withSpinner(_0x18c300(0x1ab)+_0x5562c4[_0x18c300(0x19a)]+_0x18c300(0x19c),()=>_0x2c39e6[_0x18c300(0x193)]['resolveFolderId'](_0x46b77b,_0x5562c4[_0x18c300(0x19a)]),{'verbose':_0x5562c4[_0x18c300(0x1a7)]});_0x5e7da3=_0x38a5ca['data'];}}_0x5562c4[_0x18c300(0x1a7)]&&_0x5e7da3&&console[_0x18c300(0x199)](_0x18c300(0x1c2)+_0x5e7da3);const _0x1dfde2=await loadJSONFromOptions(_0x5562c4[_0x18c300(0x1b2)],_0x5562c4['ruleFile']),_0x23c891={'name':_0x5c8462,'description':_0x5562c4[_0x18c300(0x1bd)],'rule':_0x1dfde2,'kind':_0x5562c4[_0x18c300(0x1a5)]!==undefined?parseInt(_0x5562c4[_0x18c300(0x1a5)],0xa):undefined,'isVisible':_0x5562c4[_0x18c300(0x1a9)]?![]:undefined,'segmentFolderId':_0x5e7da3,'countPopulation':_0x5562c4[_0x18c300(0x1c1)]?![]:undefined},_0x3bc9cd=await withSpinner('Creating\x20segment\x20\x27'+_0x5c8462+'\x27...',()=>_0x2c39e6[_0x18c300(0x193)][_0x18c300(0x192)](_0x46b77b,_0x23c891),{'verbose':_0x5562c4[_0x18c300(0x1a7)]}),_0x347794=_0x3bc9cd[_0x18c300(0x1b3)];return console[_0x18c300(0x199)](_0x18c300(0x1b9)+_0x347794[_0x18c300(0x1bc)]+_0x18c300(0x191)+_0x347794['id']),_0x50d469!==_0x18b06c&&console[_0x18c300(0x199)](_0x18c300(0x1be)+_0x50d469),await handleSDKOutput([_0x347794],_0x5562c4),0x0;}}
@@ -1 +1 @@
1
- function a33_0xdc10(_0x35a36a,_0x21639d){_0x35a36a=_0x35a36a-0xe6;const _0x3e01a8=a33_0x3e01();let _0xdc10d6=_0x3e01a8[_0x35a36a];return _0xdc10d6;}const a33_0x147fc3=a33_0xdc10;(function(_0x46e858,_0x629e5f){const _0x28e3ed=a33_0xdc10,_0x502369=_0x46e858();while(!![]){try{const _0x2f281e=-parseInt(_0x28e3ed(0xfa))/0x1+parseInt(_0x28e3ed(0x100))/0x2*(-parseInt(_0x28e3ed(0xf8))/0x3)+parseInt(_0x28e3ed(0xed))/0x4+-parseInt(_0x28e3ed(0xf5))/0x5+-parseInt(_0x28e3ed(0xef))/0x6+-parseInt(_0x28e3ed(0xea))/0x7*(-parseInt(_0x28e3ed(0xf0))/0x8)+parseInt(_0x28e3ed(0xeb))/0x9;if(_0x2f281e===_0x629e5f)break;else _0x502369['push'](_0x502369['shift']());}catch(_0x5c6533){_0x502369['push'](_0x502369['shift']());}}}(a33_0x3e01,0x8899e));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{[a33_0x147fc3(0x103)]=a33_0x147fc3(0xf2);[a33_0x147fc3(0xf1)]='List\x20available\x20fields\x20for\x20segmentation';async[a33_0x147fc3(0x102)](_0x456f98){const _0x4c6d17=a33_0x147fc3,{options:_0x220c4d,args:_0x55ed2d,tdx:_0x587a82}=_0x456f98,_0x1453f2=_0x55ed2d[0x0]||_0x220c4d[_0x4c6d17(0xfb)];if(!_0x1453f2)return console['error'](_0x4c6d17(0xfd)),console[_0x4c6d17(0xfc)](_0x4c6d17(0xf3)),console[_0x4c6d17(0xfc)](_0x4c6d17(0xf7)),0x1;_0x220c4d[_0x4c6d17(0xfe)]&&(console[_0x4c6d17(0xfc)]('Site:\x20'+_0x220c4d[_0x4c6d17(0xe8)]),console[_0x4c6d17(0xfc)](_0x4c6d17(0xe6)+_0x1453f2));const _0x6a8d16=await withSpinner(_0x4c6d17(0xf9)+_0x1453f2+_0x4c6d17(0xe7),()=>_0x587a82['segment'][_0x4c6d17(0xec)](_0x1453f2),{'verbose':_0x220c4d[_0x4c6d17(0xfe)]}),_0x2cc498=_0x6a8d16[_0x4c6d17(0x101)];console[_0x4c6d17(0xfc)](_0x4c6d17(0xff)+_0x2cc498['length']+_0x4c6d17(0xee)+(_0x2cc498[_0x4c6d17(0xf6)]!==0x1?'s':''));if(_0x220c4d[_0x4c6d17(0xe9)]||_0x220c4d[_0x4c6d17(0xf4)])return await handleSDKOutput(_0x2cc498,_0x220c4d),0x0;return displayFieldsHumanReadable(_0x2cc498,_0x1453f2),0x0;}}function a33_0x3e01(){const _0x30314f=['segment:fields','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','jsonl','70460JgslYY','length','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','2338962gmsvOc','Listing\x20fields\x20for\x20\x27','261614gAMGDJ','parentSegment','error','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','βœ”\x20Found\x20','2oPxNJB','data','execute','name','Parent\x20segment:\x20','\x27...','site','json','1621060RlNMbm','10555038jdaOWb','listFields','2061144SmpvIt','\x20field','3218100CqrlwJ','16PDDdON','description'];a33_0x3e01=function(){return _0x30314f;};return a33_0x3e01();}
1
+ const a33_0x24a17b=a33_0x55bc;(function(_0x14c7a6,_0x59809f){const _0xfd2021=a33_0x55bc,_0x3394a1=_0x14c7a6();while(!![]){try{const _0x4feaf7=parseInt(_0xfd2021(0x101))/0x1+parseInt(_0xfd2021(0xed))/0x2*(parseInt(_0xfd2021(0xf7))/0x3)+-parseInt(_0xfd2021(0x106))/0x4*(-parseInt(_0xfd2021(0x103))/0x5)+-parseInt(_0xfd2021(0xfe))/0x6*(-parseInt(_0xfd2021(0xf4))/0x7)+parseInt(_0xfd2021(0xec))/0x8*(parseInt(_0xfd2021(0xf0))/0x9)+-parseInt(_0xfd2021(0xfb))/0xa+parseInt(_0xfd2021(0xf5))/0xb*(-parseInt(_0xfd2021(0xfd))/0xc);if(_0x4feaf7===_0x59809f)break;else _0x3394a1['push'](_0x3394a1['shift']());}catch(_0x5a58f3){_0x3394a1['push'](_0x3394a1['shift']());}}}(a33_0x59ab,0xb3d83));import{BaseCommand}from'./command.js';function a33_0x55bc(_0x4ef722,_0x5f29e4){_0x4ef722=_0x4ef722-0xeb;const _0x59abb9=a33_0x59ab();let _0x55bc8a=_0x59abb9[_0x4ef722];return _0x55bc8a;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a33_0x59ab(){const _0x3c9d3e=['verbose','3313639VFcHcP','1001jRiNbJ','length','177438CwGoZV','error','\x27...','description','5690850NQojnh','Site:\x20','436044qhCkoa','12DIGfiE','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','listFields','403762VZBnMt','jsonl','32135XuwtqZ','\x20field','parentSegment','452mTodBx','segment:fields','json','4464496DGTQtG','48qporJI','Parent\x20segment:\x20','execute','18viHDaC','segment','Error:\x20Parent\x20segment\x20name\x20is\x20required'];a33_0x59ab=function(){return _0x3c9d3e;};return a33_0x59ab();}export class SegmentFieldsCommand extends BaseCommand{['name']=a33_0x24a17b(0x107);[a33_0x24a17b(0xfa)]='List\x20available\x20fields\x20for\x20segmentation';async[a33_0x24a17b(0xef)](_0x20887a){const _0x42a6ee=a33_0x24a17b,{options:_0x2a5fe0,args:_0x3194e1,tdx:_0x5618a4}=_0x20887a,_0x5916ea=_0x3194e1[0x0]||_0x2a5fe0[_0x42a6ee(0x105)];if(!_0x5916ea)return console['error'](_0x42a6ee(0xf2)),console[_0x42a6ee(0xf8)](_0x42a6ee(0xff)),console[_0x42a6ee(0xf8)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x2a5fe0[_0x42a6ee(0xf3)]&&(console[_0x42a6ee(0xf8)](_0x42a6ee(0xfc)+_0x2a5fe0['site']),console['error'](_0x42a6ee(0xee)+_0x5916ea));const _0x7a0856=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x5916ea+_0x42a6ee(0xf9),()=>_0x5618a4[_0x42a6ee(0xf1)][_0x42a6ee(0x100)](_0x5916ea),{'verbose':_0x2a5fe0[_0x42a6ee(0xf3)]}),_0x545fdc=_0x7a0856['data'];console[_0x42a6ee(0xf8)]('βœ”\x20Found\x20'+_0x545fdc[_0x42a6ee(0xf6)]+_0x42a6ee(0x104)+(_0x545fdc[_0x42a6ee(0xf6)]!==0x1?'s':''));if(_0x2a5fe0[_0x42a6ee(0xeb)]||_0x2a5fe0[_0x42a6ee(0x102)])return await handleSDKOutput(_0x545fdc,_0x2a5fe0),0x0;return displayFieldsHumanReadable(_0x545fdc,_0x5916ea),0x0;}}
@@ -1 +1 @@
1
- const a34_0x203a6f=a34_0x439c;(function(_0x38a094,_0x92ec04){const _0x52ce68=a34_0x439c,_0x58024e=_0x38a094();while(!![]){try{const _0x11ce1c=parseInt(_0x52ce68(0x1e2))/0x1*(parseInt(_0x52ce68(0x21d))/0x2)+parseInt(_0x52ce68(0x20a))/0x3+parseInt(_0x52ce68(0x1f3))/0x4*(-parseInt(_0x52ce68(0x1ee))/0x5)+parseInt(_0x52ce68(0x214))/0x6+parseInt(_0x52ce68(0x213))/0x7+parseInt(_0x52ce68(0x1d8))/0x8*(parseInt(_0x52ce68(0x20f))/0x9)+-parseInt(_0x52ce68(0x1fb))/0xa;if(_0x11ce1c===_0x92ec04)break;else _0x58024e['push'](_0x58024e['shift']());}catch(_0x9c3d33){_0x58024e['push'](_0x58024e['shift']());}}}(a34_0x5400,0x57ced));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 a34_0x3814be from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x294708 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a34_0x439c(_0x33d3d3,_0x4c1ae1){_0x33d3d3=_0x33d3d3-0x1cd;const _0x540077=a34_0x5400();let _0x439c6d=_0x540077[_0x33d3d3];return _0x439c6d;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a34_0x203a6f(0x1e8)]=a34_0x203a6f(0x1ed);[a34_0x203a6f(0x1df)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a34_0x203a6f(0x1d4)](_0x3822bc){const _0xebd1af=a34_0x203a6f,{options:_0x1528bb,args:_0x9df9f4,tdx:_0x188f10}=_0x3822bc,_0x5ea12c=_0x1528bb,_0x4490ac=await resolveTarget({'arg':_0x9df9f4[0x0],'contextParent':_0x1528bb['parentSegment'],'cwd':process[_0xebd1af(0x1ea)]()});if(!isSuccessfulResolution(_0x4490ac))return _0x4490ac[_0xebd1af(0x1ec)]===_0xebd1af(0x1f8)?(console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1ef)](_0xebd1af(0x1e1))),console[_0xebd1af(0x206)](_0xebd1af(0x1f9)),console['error'](_0xebd1af(0x1da)),console['error'](_0xebd1af(0x201))):(console[_0xebd1af(0x206)](a34_0x3814be['red'](_0xebd1af(0x1dc)+_0x4490ac[_0xebd1af(0x1f2)]+'\x0a')),_0x4490ac['helpText']&&console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1cd)](_0x4490ac['helpText']))),0x1;const _0x2ba3db=_0x4490ac['parentName'],_0x2e3e0c=_0x4490ac[_0xebd1af(0x1e0)],_0x4148ca=_0x4490ac[_0xebd1af(0x1f5)]===_0xebd1af(0x1f7)?_0x4490ac[_0xebd1af(0x208)]:undefined;_0x5ea12c[_0xebd1af(0x1cf)]&&(console[_0xebd1af(0x206)]('Site:\x20'+_0x5ea12c[_0xebd1af(0x1db)]),console['error'](_0xebd1af(0x202)+_0x2ba3db),_0x4148ca&&console['error'](_0xebd1af(0x212)+_0x4148ca));const _0x1dcd2b=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x2ba3db+'\x27...',_0x366b6a=>_0x188f10[_0xebd1af(0x20e)][_0xebd1af(0x1e9)](_0x2ba3db,{'targetDir':_0x2e3e0c,'targetResourceName':_0x4148ca,'verbose':_0x5ea12c['verbose'],'progress':{'update':_0x1842a2=>{const _0x21ef74=_0xebd1af;_0x366b6a[_0x21ef74(0x1e5)](_0x1842a2),_0x5ea12c[_0x21ef74(0x1cf)]&&console['error']('\x20\x20'+_0x1842a2);}}}),{'verbose':_0x5ea12c[_0xebd1af(0x1cf)]}),_0x447869=_0x1dcd2b[_0xebd1af(0x219)];if(_0x447869['counts'][_0xebd1af(0x1e7)]===0x0&&_0x447869['counts'][_0xebd1af(0x200)]===0x0)return console['error'](a34_0x3814be[_0xebd1af(0x1ef)](_0xebd1af(0x211)+_0x447869['parentName']+'\x27')),0x0;const _0x47282b=_0x447869[_0xebd1af(0x1f4)][_0xebd1af(0x1f1)](_0x34c3aa=>_0x34c3aa[_0xebd1af(0x21c)]),_0x21e3e6=_0x447869['files'][_0xebd1af(0x1f1)](_0x146239=>!_0x146239['isNew']&&_0x146239['hasChanges']),_0x2cb31a=_0x447869['files']['filter'](_0x440ad1=>!_0x440ad1['isNew']&&!_0x440ad1[_0xebd1af(0x216)]);console[_0xebd1af(0x206)](_0xebd1af(0x1d1)+_0x447869[_0xebd1af(0x218)]+'\x27:'),console[_0xebd1af(0x206)](_0xebd1af(0x1d5)+a34_0x3814be[_0xebd1af(0x1cd)](_0x447869[_0xebd1af(0x20d)][_0xebd1af(0x1e7)]+_0xebd1af(0x1fc))+'\x20with\x20'+a34_0x3814be[_0xebd1af(0x1cd)](_0x447869[_0xebd1af(0x20d)][_0xebd1af(0x205)]+_0xebd1af(0x207)));if(_0x447869['counts']['journeys']>0x0){const _0x25d32f=_0x447869['counts'][_0xebd1af(0x1de)]>_0x447869[_0xebd1af(0x20d)][_0xebd1af(0x200)]?'\x20('+_0x447869[_0xebd1af(0x20d)][_0xebd1af(0x1de)]+_0xebd1af(0x21a):'';console[_0xebd1af(0x206)](_0xebd1af(0x1e6)+a34_0x3814be[_0xebd1af(0x1cd)](_0x447869[_0xebd1af(0x20d)]['journeys']+_0xebd1af(0x1eb))+a34_0x3814be['dim'](_0x25d32f));}console['error']('\x20\x20'+a34_0x3814be[_0xebd1af(0x1d3)]('+\x20'+_0x47282b[_0xebd1af(0x204)]+'\x20new\x20files')),console['error']('\x20\x20'+a34_0x3814be[_0xebd1af(0x1ef)]('~\x20'+_0x21e3e6[_0xebd1af(0x204)]+_0xebd1af(0x1ff))),console[_0xebd1af(0x206)]('\x20\x20'+a34_0x3814be[_0xebd1af(0x1d2)]('=\x20'+_0x2cb31a[_0xebd1af(0x204)]+_0xebd1af(0x1d7))),console[_0xebd1af(0x206)]('\x20\x20Target:\x20'+a34_0x3814be['cyan'](_0x447869['targetDir'])+'\x0a');if(_0x21e3e6[_0xebd1af(0x204)]>0x0)for(const _0x63a8 of _0x21e3e6){console[_0xebd1af(0x206)](_0xebd1af(0x1d6)+_0x63a8[_0xebd1af(0x21b)]+'\x27:'),console[_0xebd1af(0x206)]('─'['repeat'](0x3c)),console[_0xebd1af(0x206)](_0x63a8[_0xebd1af(0x1f0)]),console['error']('─'['repeat'](0x3c));}if(_0x5ea12c[_0xebd1af(0x210)])return console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1ef)](_0xebd1af(0x217))),0x0;if(_0x47282b[_0xebd1af(0x204)]===0x0&&_0x21e3e6[_0xebd1af(0x204)]===0x0)return console[_0xebd1af(0x206)](a34_0x3814be['green'](_0xebd1af(0x215))),saveSessionContext({'parent_segment':_0x447869['parentName']},_0x5ea12c[_0xebd1af(0x20b)]),console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1d3)](_0xebd1af(0x1d9)+a34_0x3814be[_0xebd1af(0x1d2)](_0xebd1af(0x209))+'\x20=\x20'+a34_0x3814be[_0xebd1af(0x1cd)](_0x447869[_0xebd1af(0x218)]))),0x0;if(!_0x5ea12c[_0xebd1af(0x203)]){if(!isInteractive())return console['error'](a34_0x3814be[_0xebd1af(0x20c)](_0xebd1af(0x1f6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1d2)](_0xebd1af(0x1fa))),0x1;const _0x5ca9c5=await confirmKey(_0xebd1af(0x1e4)+(_0x47282b[_0xebd1af(0x204)]+_0x21e3e6[_0xebd1af(0x204)])+_0xebd1af(0x1ce));if(!_0x5ca9c5)return console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1ef)](_0xebd1af(0x1e3)),'-\x20no\x20files\x20written'),0x1;}for(const _0x46d13f of _0x447869[_0xebd1af(0x1f4)]){if(_0x46d13f[_0xebd1af(0x21c)]||_0x46d13f[_0xebd1af(0x216)]){const _0x413115=a34_0x294708[_0xebd1af(0x1fd)](_0x46d13f[_0xebd1af(0x1d0)]);!existsSync(_0x413115)&&mkdirSync(_0x413115,{'recursive':!![]}),writeFileSync(_0x46d13f[_0xebd1af(0x1d0)],_0x46d13f[_0xebd1af(0x1dd)],'utf-8');}}return console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1d3)]('βœ”\x20Pulled\x20'+(_0x47282b['length']+_0x21e3e6[_0xebd1af(0x204)])+'\x20files\x20to\x20'+_0x447869[_0xebd1af(0x1e0)])),saveSessionContext({'parent_segment':_0x447869[_0xebd1af(0x218)]},_0x5ea12c[_0xebd1af(0x20b)]),console[_0xebd1af(0x206)](a34_0x3814be['green']('βœ”\x20Context\x20set:\x20'+a34_0x3814be['dim'](_0xebd1af(0x209))+_0xebd1af(0x1fe)+a34_0x3814be['cyan'](_0x447869[_0xebd1af(0x218)]))),0x0;}}function a34_0x5400(){const _0x4ef512=['\x20segments','dirname','\x20=\x20','\x20changed\x20files','journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Parent\x20segment:\x20','yes','length','activations','error','\x20activations','resourceName','parent_segment','2086425mjLTIS','session','red','counts','segment','4300983hBbJrj','dryRun','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Target\x20resource:\x20','1448867VOdvgJ','3510426phMBXx','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','hasChanges','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','data','\x20versions)','relativePath','isNew','16PrAFZy','cyan','\x20files?','verbose','absolutePath','\x0aPull\x20summary\x20for\x20\x27','dim','green','execute','\x20\x20🎯\x20','\x0aChanges\x20to\x20\x27','\x20unchanged\x20files','8aHYkEQ','βœ”\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','site','Error:\x20','content','journeyVersions','description','targetDir','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','77555LrCqQP','Aborted.','Write\x20','setPhase','\x20\x20πŸ—ΊοΈ\x20\x20','segments','name','pullSegments','cwd','\x20journeys','errorCode','segment:pull','475015ftyjsB','yellow','diff','filter','message','4kCdztL','files','type','\x0aError:','file','no_parent','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)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','21311900LUUXPD'];a34_0x5400=function(){return _0x4ef512;};return a34_0x5400();}
1
+ const a34_0x54976b=a34_0x3368;(function(_0x482739,_0x39aa6a){const _0xae6fbf=a34_0x3368,_0xabd65f=_0x482739();while(!![]){try{const _0x18938a=-parseInt(_0xae6fbf(0x11f))/0x1*(parseInt(_0xae6fbf(0x13a))/0x2)+-parseInt(_0xae6fbf(0x11d))/0x3+parseInt(_0xae6fbf(0x10a))/0x4*(parseInt(_0xae6fbf(0x124))/0x5)+-parseInt(_0xae6fbf(0x10c))/0x6+-parseInt(_0xae6fbf(0x12a))/0x7+parseInt(_0xae6fbf(0x137))/0x8+parseInt(_0xae6fbf(0x12b))/0x9;if(_0x18938a===_0x39aa6a)break;else _0xabd65f['push'](_0xabd65f['shift']());}catch(_0x332006){_0xabd65f['push'](_0xabd65f['shift']());}}}(a34_0xf76f,0x41d33));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 a34_0x3206a6 from'chalk';function a34_0xf76f(){const _0x40f10b=['absolutePath','\x20\x20Target:\x20','setPhase','\x20segments','helpText','journeyVersions','\x20\x20πŸ—ΊοΈ\x20\x20','\x20with\x20','\x20changed\x20files','red','error','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','segments','\x0aPull\x20summary\x20for\x20\x27','937203hCXGxM','repeat','1hyZbQy','Parent\x20segment:\x20','site','\x0aChanges\x20to\x20\x27','\x20journeys','375845uNjgYp','\x20=\x20','counts','yellow','utf-8','dryRun','3549210BjabzJ','5699655PFnBMn','no_parent','parent_segment','\x20\x20🎯\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)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','verbose','segment','content','dirname','Error:\x20','βœ”\x20Pulled\x20','2760040tdVKvV','Pulling\x20segments\x20from\x20\x27','parentSegment','291718XFnVda','isNew','βœ”\x20Context\x20set:\x20','cyan','filter','Site:\x20','activations','\x0aError:','\x20files\x20to\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','dim','journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','session','hasChanges','file','green','\x20unchanged\x20files','cwd','parentName','description','targetDir','length','\x20new\x20files','errorCode','files','type','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','24wQwqUJ','Aborted.','1166430dKMEGk','Target\x20resource:\x20','\x20versions)'];a34_0xf76f=function(){return _0x40f10b;};return a34_0xf76f();}function a34_0x3368(_0x1177fb,_0x58c3d0){_0x1177fb=_0x1177fb-0xf7;const _0xf76fe0=a34_0xf76f();let _0x336810=_0xf76fe0[_0x1177fb];return _0x336810;}import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x4d16fd from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']='segment:pull';[a34_0x54976b(0xff)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x5625de){const _0x1966cc=a34_0x54976b,{options:_0x2d9165,args:_0x169a73,tdx:_0x3ec74e}=_0x5625de,_0x9c09a7=_0x2d9165,_0x2fe4d5=await resolveTarget({'arg':_0x169a73[0x0],'contextParent':_0x2d9165[_0x1966cc(0x139)],'cwd':process[_0x1966cc(0xfd)]()});if(!isSuccessfulResolution(_0x2fe4d5))return _0x2fe4d5[_0x1966cc(0x103)]===_0x1966cc(0x12c)?(console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0x127)](_0x1966cc(0x109))),console[_0x1966cc(0x119)](_0x1966cc(0x12f)),console[_0x1966cc(0x119)](_0x1966cc(0x107)),console[_0x1966cc(0x119)](_0x1966cc(0xf7))):(console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0x118)](_0x1966cc(0x135)+_0x2fe4d5['message']+'\x0a')),_0x2fe4d5[_0x1966cc(0x113)]&&console[_0x1966cc(0x119)](a34_0x3206a6['cyan'](_0x2fe4d5['helpText']))),0x1;const _0x54d306=_0x2fe4d5[_0x1966cc(0xfe)],_0x1890c9=_0x2fe4d5[_0x1966cc(0x100)],_0xcd25c6=_0x2fe4d5[_0x1966cc(0x105)]===_0x1966cc(0xfa)?_0x2fe4d5['resourceName']:undefined;_0x9c09a7[_0x1966cc(0x131)]&&(console[_0x1966cc(0x119)](_0x1966cc(0x13f)+_0x9c09a7[_0x1966cc(0x121)]),console[_0x1966cc(0x119)](_0x1966cc(0x120)+_0x54d306),_0xcd25c6&&console[_0x1966cc(0x119)](_0x1966cc(0x10d)+_0xcd25c6));const _0x3be5e2=await withProgressSpinner(_0x1966cc(0x138)+_0x54d306+'\x27...',_0x530b9c=>_0x3ec74e[_0x1966cc(0x132)]['pullSegments'](_0x54d306,{'targetDir':_0x1890c9,'targetResourceName':_0xcd25c6,'verbose':_0x9c09a7[_0x1966cc(0x131)],'progress':{'update':_0x5c416d=>{const _0x36f68e=_0x1966cc;_0x530b9c[_0x36f68e(0x111)](_0x5c416d),_0x9c09a7[_0x36f68e(0x131)]&&console['error']('\x20\x20'+_0x5c416d);}}}),{'verbose':_0x9c09a7[_0x1966cc(0x131)]}),_0x39eee9=_0x3be5e2['data'];if(_0x39eee9['counts']['segments']===0x0&&_0x39eee9['counts'][_0x1966cc(0x145)]===0x0)return console['error'](a34_0x3206a6['yellow'](_0x1966cc(0x143)+_0x39eee9[_0x1966cc(0xfe)]+'\x27')),0x0;const _0x448741=_0x39eee9[_0x1966cc(0x104)][_0x1966cc(0x13e)](_0x2f01e8=>_0x2f01e8['isNew']),_0x45db7a=_0x39eee9[_0x1966cc(0x104)][_0x1966cc(0x13e)](_0x31def7=>!_0x31def7['isNew']&&_0x31def7[_0x1966cc(0xf9)]),_0x1b100e=_0x39eee9[_0x1966cc(0x104)][_0x1966cc(0x13e)](_0x507e23=>!_0x507e23[_0x1966cc(0x13b)]&&!_0x507e23[_0x1966cc(0xf9)]);console[_0x1966cc(0x119)](_0x1966cc(0x11c)+_0x39eee9[_0x1966cc(0xfe)]+'\x27:'),console[_0x1966cc(0x119)](_0x1966cc(0x12e)+a34_0x3206a6['cyan'](_0x39eee9[_0x1966cc(0x126)][_0x1966cc(0x11b)]+_0x1966cc(0x112))+_0x1966cc(0x116)+a34_0x3206a6[_0x1966cc(0x13d)](_0x39eee9[_0x1966cc(0x126)][_0x1966cc(0x140)]+'\x20activations'));if(_0x39eee9[_0x1966cc(0x126)]['journeys']>0x0){const _0x29f9c8=_0x39eee9['counts'][_0x1966cc(0x114)]>_0x39eee9['counts']['journeys']?'\x20('+_0x39eee9['counts']['journeyVersions']+_0x1966cc(0x10e):'';console[_0x1966cc(0x119)](_0x1966cc(0x115)+a34_0x3206a6[_0x1966cc(0x13d)](_0x39eee9[_0x1966cc(0x126)][_0x1966cc(0x145)]+_0x1966cc(0x123))+a34_0x3206a6['dim'](_0x29f9c8));}console['error']('\x20\x20'+a34_0x3206a6[_0x1966cc(0xfb)]('+\x20'+_0x448741[_0x1966cc(0x101)]+_0x1966cc(0x102))),console['error']('\x20\x20'+a34_0x3206a6[_0x1966cc(0x127)]('~\x20'+_0x45db7a['length']+_0x1966cc(0x117))),console[_0x1966cc(0x119)]('\x20\x20'+a34_0x3206a6['dim']('=\x20'+_0x1b100e[_0x1966cc(0x101)]+_0x1966cc(0xfc))),console[_0x1966cc(0x119)](_0x1966cc(0x110)+a34_0x3206a6['cyan'](_0x39eee9[_0x1966cc(0x100)])+'\x0a');if(_0x45db7a[_0x1966cc(0x101)]>0x0)for(const _0x34d081 of _0x45db7a){console[_0x1966cc(0x119)](_0x1966cc(0x122)+_0x34d081['relativePath']+'\x27:'),console['error']('─'[_0x1966cc(0x11e)](0x3c)),console[_0x1966cc(0x119)](_0x34d081['diff']),console[_0x1966cc(0x119)]('─'[_0x1966cc(0x11e)](0x3c));}if(_0x9c09a7[_0x1966cc(0x129)])return console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0x127)](_0x1966cc(0x108))),0x0;if(_0x448741[_0x1966cc(0x101)]===0x0&&_0x45db7a[_0x1966cc(0x101)]===0x0)return console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0xfb)](_0x1966cc(0x11a))),saveSessionContext({'parent_segment':_0x39eee9[_0x1966cc(0xfe)]},_0x9c09a7['session']),console[_0x1966cc(0x119)](a34_0x3206a6[_0x1966cc(0xfb)]('βœ”\x20Context\x20set:\x20'+a34_0x3206a6['dim'](_0x1966cc(0x12d))+_0x1966cc(0x125)+a34_0x3206a6[_0x1966cc(0x13d)](_0x39eee9[_0x1966cc(0xfe)]))),0x0;if(!_0x9c09a7['yes']){if(!isInteractive())return console['error'](a34_0x3206a6['red'](_0x1966cc(0x141)),_0x1966cc(0x106)),console['error'](a34_0x3206a6[_0x1966cc(0x144)](_0x1966cc(0x130))),0x1;const _0x33a950=await confirmKey('Write\x20'+(_0x448741[_0x1966cc(0x101)]+_0x45db7a[_0x1966cc(0x101)])+'\x20files?');if(!_0x33a950)return console['error'](a34_0x3206a6[_0x1966cc(0x127)](_0x1966cc(0x10b)),'-\x20no\x20files\x20written'),0x1;}for(const _0x29c63b of _0x39eee9['files']){if(_0x29c63b[_0x1966cc(0x13b)]||_0x29c63b['hasChanges']){const _0x4a46d5=a34_0x4d16fd[_0x1966cc(0x134)](_0x29c63b[_0x1966cc(0x10f)]);!existsSync(_0x4a46d5)&&mkdirSync(_0x4a46d5,{'recursive':!![]}),writeFileSync(_0x29c63b[_0x1966cc(0x10f)],_0x29c63b[_0x1966cc(0x133)],_0x1966cc(0x128));}}return console[_0x1966cc(0x119)](a34_0x3206a6['green'](_0x1966cc(0x136)+(_0x448741[_0x1966cc(0x101)]+_0x45db7a['length'])+_0x1966cc(0x142)+_0x39eee9[_0x1966cc(0x100)])),saveSessionContext({'parent_segment':_0x39eee9['parentName']},_0x9c09a7[_0x1966cc(0xf8)]),console['error'](a34_0x3206a6[_0x1966cc(0xfb)](_0x1966cc(0x13c)+a34_0x3206a6[_0x1966cc(0x144)]('parent_segment')+'\x20=\x20'+a34_0x3206a6[_0x1966cc(0x13d)](_0x39eee9[_0x1966cc(0xfe)]))),0x0;}}
@@ -1 +1 @@
1
- function a35_0x34f2(_0x13533f,_0x1c3439){_0x13533f=_0x13533f-0x1d4;const _0x4fa199=a35_0x4fa1();let _0x34f237=_0x4fa199[_0x13533f];return _0x34f237;}const a35_0x374812=a35_0x34f2;(function(_0x4861bc,_0x8e9b43){const _0x2a482b=a35_0x34f2,_0x28fccb=_0x4861bc();while(!![]){try{const _0x546c89=-parseInt(_0x2a482b(0x254))/0x1+parseInt(_0x2a482b(0x1f7))/0x2*(-parseInt(_0x2a482b(0x21e))/0x3)+parseInt(_0x2a482b(0x240))/0x4*(-parseInt(_0x2a482b(0x242))/0x5)+parseInt(_0x2a482b(0x21b))/0x6+parseInt(_0x2a482b(0x201))/0x7*(-parseInt(_0x2a482b(0x1de))/0x8)+-parseInt(_0x2a482b(0x268))/0x9+parseInt(_0x2a482b(0x26b))/0xa;if(_0x546c89===_0x8e9b43)break;else _0x28fccb['push'](_0x28fccb['shift']());}catch(_0x262422){_0x28fccb['push'](_0x28fccb['shift']());}}}(a35_0x4fa1,0xa5540));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 a35_0x30f1b6 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{[a35_0x374812(0x1ef)]=a35_0x374812(0x221);[a35_0x374812(0x204)]=a35_0x374812(0x212);async['execute'](_0x22b988){const _0xd77852=a35_0x374812,{options:_0x2be501,args:_0x13bb6d,tdx:_0x5be7c0}=_0x22b988,_0x394ed6=_0x2be501,_0x329644=await resolveTarget({'arg':_0x13bb6d[0x0],'contextParent':_0x2be501['parentSegment'],'cwd':process[_0xd77852(0x1ee)]()});if(!isSuccessfulResolution(_0x329644))return _0x329644[_0xd77852(0x23e)]==='no_parent'?(console['error'](a35_0x30f1b6['yellow'](_0xd77852(0x255))),console[_0xd77852(0x1e6)](_0xd77852(0x24a)),console['error'](_0xd77852(0x1e9)),console[_0xd77852(0x1e6)](_0xd77852(0x26e))):(console['error'](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x213)+_0x329644[_0xd77852(0x217)]+'\x0a')),_0x329644['helpText']&&console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x251)](_0x329644[_0xd77852(0x1dc)]))),0x1;if(_0x329644['type']===_0xd77852(0x202))return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x225)+_0x329644[_0xd77852(0x235)]+'\x0a')),console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x251)](_0xd77852(0x1d7))),0x1;const _0x3f958a=_0x329644[_0xd77852(0x253)],_0x5b2bc2=_0x329644[_0xd77852(0x235)],_0x3776ab=_0x329644['type']===_0xd77852(0x1df)?_0x329644[_0xd77852(0x26d)]:undefined,_0x2d3a2d=getScopedDetails(_0x329644),_0x59fb89=_0x2d3a2d?.[_0xd77852(0x239)]??![],_0x1317f3=_0x2d3a2d?.['scopedFolderPath']??'';if(!existsSync(_0x5b2bc2))return console[_0xd77852(0x1e6)](a35_0x30f1b6['red'](_0xd77852(0x225)+_0x5b2bc2+'\x0a')),console['error'](a35_0x30f1b6[_0xd77852(0x251)](_0xd77852(0x1d7))),0x1;_0x394ed6[_0xd77852(0x25b)]&&(console[_0xd77852(0x1e6)](_0xd77852(0x1e1)+_0x394ed6['site']),console[_0xd77852(0x1e6)](_0xd77852(0x1d8)+_0x3f958a),console['error'](_0xd77852(0x22f)+_0x5b2bc2),_0x59fb89&&console[_0xd77852(0x1e6)]('Scoped\x20to\x20folder:\x20'+_0x1317f3));const _0x43c61a=await withSpinner(_0xd77852(0x267)+_0x3f958a+'\x27...',()=>_0x5be7c0[_0xd77852(0x23f)][_0xd77852(0x1ed)](_0x3f958a),{'verbose':_0x394ed6[_0xd77852(0x25b)]}),_0x481d3b=_0x43c61a[_0xd77852(0x24b)],{parentSegmentResult:_0x1f0696,segmentsResult:_0x23dd6e,foldersResult:_0x572bab,journeysWithDetailsResult:_0x158823,userMaps:_0x5f2651}=await withSpinner(_0xd77852(0x20c),async()=>{const _0x1d2b4b=_0xd77852,[_0x2eefd3,_0x382ffc,_0x174acb,_0x2d1a89,_0x3a2374]=await Promise[_0x1d2b4b(0x216)]([_0x5be7c0['segment'][_0x1d2b4b(0x1fd)](_0x481d3b),_0x5be7c0[_0x1d2b4b(0x23f)]['listSegments'](_0x481d3b),_0x5be7c0['segment'][_0x1d2b4b(0x1f0)](_0x481d3b),_0x5be7c0['journey']['listJourneysWithDetailsFromParentSegment'](_0x481d3b,{'includeAllVersions':!![]}),_0x5be7c0[_0x1d2b4b(0x232)][_0x1d2b4b(0x261)]()]);return{'parentSegmentResult':_0x2eefd3,'segmentsResult':_0x382ffc,'foldersResult':_0x174acb,'journeysWithDetailsResult':_0x2d1a89,'userMaps':_0x3a2374};},{'verbose':_0x394ed6['verbose']})[_0xd77852(0x25e)](_0x3cbd0a=>_0x3cbd0a[_0xd77852(0x24b)]),_0x4fce39=_0x1f0696,_0x30de05=extractRootFolderId(_0x4fce39),_0x2bf4f6=_0x23dd6e,_0x74963c=_0x572bab,{journeys:_0x221646,activationStepsById:_0x542f9a}=_0x158823,_0x15b3e4=new Map(_0x221646[_0xd77852(0x265)](_0x2beded=>[_0x2beded['id'],_0x2beded])),_0xb781b1=_0x221646['map'](_0x19fea5=>({'id':_0x19fea5['id'],'name':_0x19fea5[_0xd77852(0x257)][_0xd77852(0x1ef)],'journeyBundleName':_0x19fea5[_0xd77852(0x257)][_0xd77852(0x1f6)]||'','journeyBundleId':_0x19fea5['attributes'][_0xd77852(0x25f)]||'','versionNumber':_0x19fea5[_0xd77852(0x257)][_0xd77852(0x1f4)],'description':_0x19fea5[_0xd77852(0x257)]['description'],'state':_0x19fea5['attributes'][_0xd77852(0x227)],'paused':_0x19fea5['attributes'][_0xd77852(0x260)],'audienceId':_0x19fea5['attributes'][_0xd77852(0x1e3)],'folderId':_0x19fea5[_0xd77852(0x237)]?.[_0xd77852(0x23b)]?.[_0xd77852(0x24b)]?.['id'],'createdAt':_0x19fea5['attributes'][_0xd77852(0x1f3)],'updatedAt':_0x19fea5[_0xd77852(0x257)][_0xd77852(0x1e2)]})),{emailToId:_0x1e6927,idToEmail:_0x245ddf}=_0x5f2651,_0x464fef=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x242383=_0xd77852,_0x4484a8=await _0x5be7c0[_0x242383(0x1f2)][_0x242383(0x228)]();return buildConnectionMaps(_0x4484a8);},{'verbose':_0x394ed6[_0xd77852(0x25b)]})['then'](_0x1dfb8a=>_0x1dfb8a['data']),_0x3f9767=_0x464fef['nameToId'],_0x603101=_0x464fef[_0xd77852(0x21f)],_0x427ca8=_0x464fef[_0xd77852(0x24c)],_0x271cae={'emailToIdMap':_0x1e6927,'connectionNameToIdMap':_0x3f9767,'connectionNameToTypeMap':_0x427ca8,'getSchema':_0x1e3436=>_0x5be7c0['connection'][_0xd77852(0x1f1)](_0x1e3436)};let {pathToId:_0x5ed7fa,idToPath:_0x4ecb32}=buildFolderMaps(_0x74963c);const _0x163560=buildSegmentLookupMap(_0x2bf4f6,_0x4ecb32),_0x19b7e4=buildSegmentNameToIdMap(_0x2bf4f6),_0x280b5b=buildJourneyBundleLookupMap(_0xb781b1,_0x4ecb32);let _0x1e2078;if(_0x3776ab){if(!_0x3776ab[_0xd77852(0x1fa)](_0xd77852(0x24f))&&!_0x3776ab[_0xd77852(0x1fa)](_0xd77852(0x223)))return console[_0xd77852(0x1e6)](a35_0x30f1b6['red'](_0xd77852(0x1d4)+_0x3776ab+'\x0a')),0x1;_0x1e2078=[_0x3776ab];}else _0x1e2078=findYamlFiles(_0x5b2bc2);if(_0x1e2078['length']===0x0)return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x1ff)+_0x5b2bc2+'\x0a')),console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x251)](_0xd77852(0x24e))),0x1;let _0x1c30be,_0x1b0a3f;try{const _0x5b9ecd=parseAndClassifyYamlFiles(_0x1e2078,_0x5b2bc2,{'skipSegments':_0x394ed6[_0xd77852(0x208)]});_0x1c30be=_0x5b9ecd['segments'],_0x1b0a3f=_0x5b9ecd[_0xd77852(0x229)];const _0x3d3cf7=validateParsedFiles(_0x5b9ecd,_0x5b2bc2);if(_0x3d3cf7['length']>0x0)return console['error'](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x1da))),console[_0xd77852(0x1e6)](formatValidationErrors(_0x3d3cf7)),console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x249))),0x1;}catch(_0x44c80f){return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x244)+(_0x44c80f instanceof Error?_0x44c80f[_0xd77852(0x217)]:_0x44c80f))),0x1;}if(_0x1c30be[_0xd77852(0x1d5)]===0x0&&_0x1b0a3f['length']===0x0){const _0x3da7c7=_0x394ed6['journeysOnly']?_0xd77852(0x236):_0xd77852(0x243);return console[_0xd77852(0x1e6)](a35_0x30f1b6['yellow'](_0xd77852(0x245)+_0x3da7c7+'\x20YAML\x20files\x20found')),0x0;}const _0x2f94c1=new Map();_0x2bf4f6[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x2bf4f6,async _0x53caf3=>{const _0x1a31de=a35_0x34f2,_0x4d2c64=await _0x5be7c0[_0x1a31de(0x23f)][_0x1a31de(0x246)](_0x481d3b,_0x53caf3['id']);_0x2f94c1['set'](_0x53caf3['id'],_0x4d2c64);});},{'verbose':_0x394ed6[_0xd77852(0x25b)]});const {segmentFiles:_0x441ee8,foldersToCreate:_0x2cdfa1}=await prepareSegmentFiles(_0x1c30be,{'segmentByFolderAndName':_0x163560,'activationsBySegmentId':_0x2f94c1,'folderPathToId':_0x5ed7fa,'idToEmailMap':_0x245ddf,'connectionIdToNameMap':_0x603101},_0x271cae,_0x59fb89,_0x1317f3),_0x40f9a6=_0x3776ab?[]:findSegmentsToDelete(_0x2bf4f6,_0x1c30be[_0xd77852(0x265)](({yamlConfig:_0x4f86e7,folderPath:_0xde1521})=>({'yamlConfig':_0x4f86e7,'folderPath':resolveTDFolderPath(_0xde1521,_0x59fb89,_0x1317f3)})),_0x4ecb32,_0x1317f3,_0x59fb89),{journeyFiles:_0x32717c,foldersToCreate:_0x46c8e1}=await withProgressSpinner(_0xd77852(0x22a),async _0x38ce31=>prepareJourneyFiles(_0x1b0a3f,{'fetchJourney':async _0x9c5d1a=>_0x5be7c0['journey']['getJourney'](_0x9c5d1a[_0xd77852(0x205)]),'journeyBundlesByFolderAndName':_0x280b5b,'folderPathToId':_0x5ed7fa,'idToEmailMap':_0x245ddf,'connectionIdToNameMap':_0x603101,'existingSegments':_0x2bf4f6,'parentId':_0x481d3b,'deps':_0x5be7c0,'progress':{'update':_0x91378=>{const _0x2467e9=_0xd77852;_0x38ce31['setPhase'](_0x91378),_0x394ed6[_0x2467e9(0x25b)]&&console[_0x2467e9(0x1e6)]('\x20\x20'+_0x91378);}},'journeyById':_0x15b3e4,'activationStepsById':_0x542f9a},_0x59fb89,_0x1317f3),{'verbose':_0x394ed6[_0xd77852(0x25b)]})['then'](_0x2d1989=>_0x2d1989[_0xd77852(0x24b)]);for(const _0x19439f of _0x46c8e1){_0x2cdfa1[_0xd77852(0x258)](_0x19439f);}const _0x363414=_0x3776ab?[]:findJourneysToDelete(_0xb781b1,_0x1b0a3f['map'](({yamlConfig:_0x2bdc3a,folderPath:_0x353aec})=>({'yamlConfig':_0x2bdc3a,'folderPath':resolveTDFolderPath(_0x353aec,_0x59fb89,_0x1317f3)})),_0x4ecb32,_0x1317f3,_0x59fb89),_0x1ee167=calculatePushStats(_0x441ee8,_0x32717c,_0x2cdfa1,_0x40f9a6,_0x363414,!!_0x394ed6['delete'],!!_0x394ed6['journeysOnly']),_0x36eb85=_0x1ee167[_0xd77852(0x20e)][_0xd77852(0x207)],_0x50272e=_0x1ee167[_0xd77852(0x20e)][_0xd77852(0x250)],_0x298e08=_0x1ee167[_0xd77852(0x20e)][_0xd77852(0x25c)],_0x147a09=_0x1ee167['segments'][_0xd77852(0x206)],_0x1c5dba=_0x1ee167[_0xd77852(0x259)]['toCreate'],_0x194ef6=_0x1ee167[_0xd77852(0x229)]['new'],_0x45e70e=_0x1ee167[_0xd77852(0x229)][_0xd77852(0x250)],_0x5656ae=_0x1ee167['journeys']['unchanged'],_0x58ac17=_0x1ee167['journeys'][_0xd77852(0x206)],_0x52b396=_0x1ee167['activations'][_0xd77852(0x216)],_0x1a697c=_0x1ee167[_0xd77852(0x23c)][_0xd77852(0x23d)],_0x2b049f=_0x1ee167['activations'][_0xd77852(0x21c)],_0x322dd2=_0x1ee167['activations'][_0xd77852(0x206)];console[_0xd77852(0x1e6)](_0xd77852(0x1fb)+_0x3f958a+'\x27:');_0x1c5dba[_0xd77852(0x1d5)]>0x0&&console[_0xd77852(0x1e6)]('\x20\x20'+a35_0x30f1b6['blue'](_0xd77852(0x1fe)+_0x1c5dba[_0xd77852(0x1d5)]+_0xd77852(0x241)));if(!_0x394ed6[_0xd77852(0x208)]){console[_0xd77852(0x1e6)](_0xd77852(0x264)),console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x26a)]('+\x20'+_0x36eb85[_0xd77852(0x1d5)]+'\x20new')),console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6['yellow']('~\x20'+_0x50272e[_0xd77852(0x1d5)]+'\x20changed'));if(_0x147a09[_0xd77852(0x1d5)]>0x0)console[_0xd77852(0x1e6)](_0xd77852(0x25d)+a35_0x30f1b6[_0xd77852(0x22b)]('-\x20'+_0x147a09[_0xd77852(0x1d5)]+_0xd77852(0x247)));else _0x40f9a6[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x21d)]&&console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6['dim'](_0x40f9a6[_0xd77852(0x1d5)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xd77852(0x1e6)](_0xd77852(0x25d)+a35_0x30f1b6['dim']('=\x20'+_0x298e08[_0xd77852(0x1d5)]+_0xd77852(0x218)));}if(_0x32717c[_0xd77852(0x1d5)]>0x0||_0x363414[_0xd77852(0x1d5)]>0x0){console['error']('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6['green']('+\x20'+_0x194ef6[_0xd77852(0x1d5)]+_0xd77852(0x1e7))),console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x24d)]('~\x20'+_0x45e70e['length']+_0xd77852(0x209)));if(_0x58ac17[_0xd77852(0x1d5)]>0x0)console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x22b)]('-\x20'+_0x58ac17[_0xd77852(0x1d5)]+_0xd77852(0x247)));else _0x363414[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x21d)]&&console['error']('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x203)](_0x363414[_0xd77852(0x1d5)]+_0xd77852(0x1d9)));console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x203)]('=\x20'+_0x5656ae[_0xd77852(0x1d5)]+_0xd77852(0x218)));}_0x52b396[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)]&&(console[_0xd77852(0x1e6)](''),console[_0xd77852(0x1e6)](_0xd77852(0x248)),_0x1a697c['length']>0x0&&console[_0xd77852(0x1e6)](_0xd77852(0x25d)+a35_0x30f1b6['green']('+\x20'+_0x1a697c[_0xd77852(0x1d5)]+_0xd77852(0x266))),_0x2b049f[_0xd77852(0x1d5)]>0x0&&console['error']('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x24d)]('~\x20'+_0x2b049f[_0xd77852(0x1d5)]+_0xd77852(0x200))),_0x322dd2[_0xd77852(0x1d5)]>0x0&&console[_0xd77852(0x1e6)](_0xd77852(0x25d)+a35_0x30f1b6[_0xd77852(0x22b)]('-\x20'+_0x322dd2[_0xd77852(0x1d5)]+_0xd77852(0x247))));console[_0xd77852(0x1e6)](_0xd77852(0x1dd)+a35_0x30f1b6[_0xd77852(0x251)](_0x5b2bc2)+'\x0a');if(_0x1c5dba[_0xd77852(0x1d5)]>0x0){console[_0xd77852(0x1e6)]('Folders\x20to\x20create:');for(const _0x7e0958 of _0x1c5dba){console['error']('\x20\x20'+a35_0x30f1b6[_0xd77852(0x222)]('+')+'\x20'+_0x7e0958);}console[_0xd77852(0x1e6)]('');}if(_0x36eb85['length']>0x0&&!_0x394ed6['journeysOnly'])for(const _0x1cc5cb of _0x36eb85){const _0x1d71a7=_0x1cc5cb[_0xd77852(0x20a)]?_0x1cc5cb[_0xd77852(0x20a)]+'/'+_0x1cc5cb[_0xd77852(0x1f5)]['name']:_0x1cc5cb[_0xd77852(0x1f5)]['name'],_0x542eab=_0x1cc5cb[_0xd77852(0x1f5)]['activations']?.[_0xd77852(0x1d5)]||0x0,_0x1a4b8f=_0x542eab>0x0?a35_0x30f1b6['dim']('\x20['+_0x542eab+_0xd77852(0x20f)):'';console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6[_0xd77852(0x26a)](_0xd77852(0x269))+'\x20'+_0x1d71a7+_0x1a4b8f),console[_0xd77852(0x1e6)]('─'['repeat'](0x3c)),_0x1cc5cb[_0xd77852(0x263)]&&console[_0xd77852(0x1e6)](_0x1cc5cb[_0xd77852(0x263)]),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));}if(_0x147a09[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)])for(const _0x3edbee of _0x147a09){const _0x86aa0b=_0x3edbee[_0xd77852(0x22e)]?_0x4ecb32['get'](_0x3edbee['segmentFolderId']['toString']())||'':'',_0x2d3b49=_0x86aa0b?_0x86aa0b+'/'+_0x3edbee['name']:_0x3edbee['name'],_0x3505df=_0x2f94c1[_0xd77852(0x1ea)](_0x3edbee['id'])||[],_0x1831e1=_0x3505df[_0xd77852(0x1d5)]>0x0?a35_0x30f1b6[_0xd77852(0x203)]('\x20['+_0x3505df[_0xd77852(0x1d5)]+_0xd77852(0x20f)):'';console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6[_0xd77852(0x22b)]('Delete\x20segment:')+'\x20'+_0x2d3b49+_0x1831e1),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));const _0x47c72d=segmentWithActivationsToYaml(_0x3edbee,_0x3505df,undefined,_0x245ddf,_0x603101),_0x2fc261=segmentToYamlString(_0x47c72d),_0xc1faf=generateDiff(_0x2fc261,'');console[_0xd77852(0x1e6)](formatDiffWithColors(_0xc1faf)),console['error']('─'[_0xd77852(0x22c)](0x3c));}const _0x5d4e15=_0x441ee8['filter'](_0x403a32=>!_0x403a32[_0xd77852(0x1e0)]&&_0x403a32[_0xd77852(0x263)]);if(_0x5d4e15[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)])for(const _0x234c47 of _0x5d4e15){const _0x484e16=_0x234c47['folderPath']?_0x234c47['folderPath']+'/'+_0x234c47[_0xd77852(0x1f5)][_0xd77852(0x1ef)]:_0x234c47[_0xd77852(0x1f5)][_0xd77852(0x1ef)];console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x262))+'\x20'+_0x484e16),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c)),console[_0xd77852(0x1e6)](_0x234c47[_0xd77852(0x263)]),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));}if(_0x194ef6[_0xd77852(0x1d5)]>0x0)for(const _0x1e9404 of _0x194ef6){const _0x5e4f2d=_0x1e9404[_0xd77852(0x20a)]?_0x1e9404[_0xd77852(0x20a)]+'/'+_0x1e9404[_0xd77852(0x1f5)][_0xd77852(0x1ef)]:_0x1e9404[_0xd77852(0x1f5)][_0xd77852(0x1ef)];console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6['green'](_0xd77852(0x214))+'\x20'+_0x5e4f2d),console['error']('─'[_0xd77852(0x22c)](0x3c)),_0x1e9404['diff']&&console[_0xd77852(0x1e6)](_0x1e9404[_0xd77852(0x263)]),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));}const _0x214407=_0x32717c[_0xd77852(0x230)](_0x2b5a70=>!_0x2b5a70[_0xd77852(0x1e0)]&&_0x2b5a70[_0xd77852(0x263)]);if(_0x214407[_0xd77852(0x1d5)]>0x0)for(const _0x4693b9 of _0x214407){const _0x57ee0e=_0x4693b9['folderPath']?_0x4693b9[_0xd77852(0x20a)]+'/'+_0x4693b9[_0xd77852(0x1f5)]['name']:_0x4693b9[_0xd77852(0x1f5)][_0xd77852(0x1ef)];console['error']('\x0a'+a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x22d))+'\x20'+_0x57ee0e),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c)),console[_0xd77852(0x1e6)](_0x4693b9['diff']),console[_0xd77852(0x1e6)]('─'['repeat'](0x3c));}if(_0x58ac17[_0xd77852(0x1d5)]>0x0)for(const _0x1b31b7 of _0x58ac17){const _0x3ab763=_0x1b31b7[_0xd77852(0x1d6)]?_0x4ecb32[_0xd77852(0x1ea)](_0x1b31b7[_0xd77852(0x1d6)])||'':'',_0xe550dc=_0x3ab763?_0x3ab763+'/'+_0x1b31b7[_0xd77852(0x1f6)]:_0x1b31b7[_0xd77852(0x1f6)];console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x23a))+'\x20'+_0xe550dc),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c)),console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)]('(Journey\x20will\x20be\x20deleted)')),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));}if(_0x394ed6[_0xd77852(0x20d)])return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x1ec))),0x0;const _0x14000b=_0x394ed6[_0xd77852(0x208)]?![]:_0x36eb85[_0xd77852(0x1d5)]>0x0||_0x50272e[_0xd77852(0x1d5)]>0x0||_0x147a09[_0xd77852(0x1d5)]>0x0,_0x1bd98b=_0x194ef6[_0xd77852(0x1d5)]>0x0||_0x45e70e[_0xd77852(0x1d5)]>0x0||_0x58ac17[_0xd77852(0x1d5)]>0x0,_0x3c7b18=_0x394ed6[_0xd77852(0x208)]?![]:_0x52b396[_0xd77852(0x1d5)]>0x0,_0x34edf5=_0x1c5dba['length']>0x0;if(!_0x14000b&&!_0x1bd98b&&!_0x3c7b18&&!_0x34edf5){const _0x46f42f=_0x394ed6[_0xd77852(0x208)]?_0xd77852(0x20b):_0xd77852(0x226);console[_0xd77852(0x1e6)](a35_0x30f1b6['green'](_0x46f42f));if(_0x3776ab&&_0x5656ae[_0xd77852(0x1d5)]===0x1){const _0x16e7da=_0x5656ae[0x0];if(_0x16e7da[_0xd77852(0x219)]?.['id']){const _0x20ff95=getConsoleNextUrl(_0x394ed6[_0xd77852(0x26c)],'/app/ps/'+_0x481d3b+_0xd77852(0x21a)+_0x16e7da[_0xd77852(0x219)]['id']+_0xd77852(0x210));console['error']('\x20\x20'+a35_0x30f1b6[_0xd77852(0x251)](_0x20ff95));}}return 0x0;}const _0x2b7c52=_0x394ed6['journeysOnly']?_0x194ef6[_0xd77852(0x1d5)]+_0x45e70e[_0xd77852(0x1d5)]+_0x58ac17['length']+_0x1c5dba[_0xd77852(0x1d5)]:_0x36eb85['length']+_0x50272e[_0xd77852(0x1d5)]+_0x147a09['length']+_0x194ef6[_0xd77852(0x1d5)]+_0x45e70e[_0xd77852(0x1d5)]+_0x58ac17[_0xd77852(0x1d5)]+_0x1c5dba[_0xd77852(0x1d5)]+_0x52b396['length'];if(!_0x394ed6[_0xd77852(0x1e8)]&&_0x2b7c52>0x0){if(!isInteractive())return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x1f8)),_0xd77852(0x1f9)),console[_0xd77852(0x1e6)](a35_0x30f1b6['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x224857=await confirmKey('Push\x20'+_0x2b7c52+_0xd77852(0x231));if(!_0x224857)return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)]('Aborted.')),0x1;}const _0x471152={'withProgress':async(_0x15c981,_0xc391a0)=>{const _0x5ca95c=_0xd77852,_0x3c9993=await withSpinner(_0x15c981,_0xc391a0,{'verbose':_0x394ed6[_0x5ca95c(0x25b)]});return{'data':_0x3c9993[_0x5ca95c(0x24b)]};},'logInfo':_0x2d3d13=>console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x222)]('βœ”\x20'+_0x2d3d13)),'logSuccess':_0x35bb31=>console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x26a)]('βœ”\x20'+_0x35bb31)),'logWarning':_0x360d90=>console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)]('⚠\x20'+_0x360d90)),'logDeleted':_0x1533d9=>console['error'](a35_0x30f1b6[_0xd77852(0x22b)]('βœ”\x20'+_0x1533d9))},_0x579d6f={'segment':_0x5be7c0['segment'],'journey':_0x5be7c0['journey'],'user':_0x5be7c0[_0xd77852(0x232)],'connection':_0x5be7c0[_0xd77852(0x1f2)]};_0x1c5dba[_0xd77852(0x1d5)]>0x0&&(_0x5ed7fa=await executePushFolders(_0x579d6f,_0x1c5dba,_0x5ed7fa,{'parentId':_0x481d3b},_0x471152));const _0x580f69={'rootFolderId':_0x30de05,'folderPathToId':_0x5ed7fa,'folderIdToPath':_0x4ecb32,'segmentNameToId':_0x19b7e4,'activationsBySegmentId':_0x2f94c1,'emailToIdMap':_0x1e6927,'idToEmailMap':_0x245ddf,'connectionNameToIdMap':_0x464fef[_0xd77852(0x25a)],'connectionIdToNameMap':_0x464fef['idToName'],'connectionNameToTypeMap':_0x427ca8},_0x275434=await executePushSegments(_0x579d6f,_0x394ed6[_0xd77852(0x208)]?[]:_0x441ee8,_0x580f69,{'parentId':_0x481d3b},_0x471152),_0x220926=_0x275434[_0xd77852(0x1e5)],_0xd48784=_0x275434[_0xd77852(0x234)],_0x44876a=_0x275434['activations'][_0xd77852(0x1e5)],_0x45a4fe=_0x275434['activations']['updated'],_0x962a63=_0x275434[_0xd77852(0x23c)][_0xd77852(0x1db)],_0x2ae16b=await executePushSegmentDeletions(_0x579d6f,_0x394ed6[_0xd77852(0x208)]?[]:_0x147a09,_0x471152);let _0x333bda=0x0,_0x1a6aa1=0x0,_0x18d0ac=0x0;const _0x3a31dd=new Map(_0x19b7e4);for(const [_0x1f35d8,_0x56b1ca]of _0x275434['createdSegmentIds']){_0x3a31dd[_0xd77852(0x233)](_0x1f35d8,_0x56b1ca);}if(_0x32717c['length']>0x0){const _0x417b15={..._0x580f69,'segmentNameToId':_0x3a31dd,'existingSegments':_0x2bf4f6,'activationContext':_0x271cae},_0x38240f=await executePushJourneys(_0x579d6f,_0x32717c,_0x417b15,{'parentId':_0x481d3b,'rootFolderId':_0x30de05,'verbose':_0x394ed6[_0xd77852(0x25b)]},_0x471152);_0x333bda=_0x38240f[_0xd77852(0x1e5)],_0x1a6aa1=_0x38240f[_0xd77852(0x234)];if(_0x3776ab&&_0x38240f[_0xd77852(0x211)][_0xd77852(0x1d5)]===0x1){const _0x2d1b5e=_0x38240f[_0xd77852(0x211)][0x0];if(_0x2d1b5e[_0xd77852(0x205)]){const _0x4f9d9b=getConsoleNextUrl(_0x394ed6[_0xd77852(0x26c)],'/app/ps/'+_0x481d3b+'/e/'+_0x2d1b5e[_0xd77852(0x205)]+_0xd77852(0x210));console[_0xd77852(0x1e6)]('\x20\x20'+a35_0x30f1b6[_0xd77852(0x251)](_0x4f9d9b));}}}for(const _0x5dd8de of _0x58ac17){console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x1eb)+_0x5dd8de['journeyBundleName'])),_0x18d0ac++;}const _0x49a660=[];if(_0x220926>0x0)_0x49a660[_0xd77852(0x1fc)](_0x220926+_0xd77852(0x215));if(_0xd48784>0x0)_0x49a660[_0xd77852(0x1fc)](_0xd48784+_0xd77852(0x220));if(_0x2ae16b>0x0)_0x49a660['push'](_0x2ae16b+_0xd77852(0x252));const _0x1e9ef9=[];if(_0x333bda>0x0)_0x1e9ef9[_0xd77852(0x1fc)](_0x333bda+_0xd77852(0x215));if(_0x1a6aa1>0x0)_0x1e9ef9[_0xd77852(0x1fc)](_0x1a6aa1+_0xd77852(0x220));if(_0x18d0ac>0x0)_0x1e9ef9[_0xd77852(0x1fc)](_0x18d0ac+'\x20deleted');const _0x44cb1c=[];if(_0x44876a>0x0)_0x44cb1c[_0xd77852(0x1fc)](_0x44876a+'\x20created');if(_0x45a4fe>0x0)_0x44cb1c[_0xd77852(0x1fc)](_0x45a4fe+_0xd77852(0x220));if(_0x962a63>0x0)_0x44cb1c[_0xd77852(0x1fc)](_0x962a63+_0xd77852(0x252));return console[_0xd77852(0x1e6)](a35_0x30f1b6['green'](_0xd77852(0x26f))),_0x49a660[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)]&&console[_0xd77852(0x1e6)](_0xd77852(0x256)+_0x49a660['join'](',\x20')),_0x1e9ef9[_0xd77852(0x1d5)]>0x0&&console[_0xd77852(0x1e6)](_0xd77852(0x224)+_0x1e9ef9[_0xd77852(0x1e4)](',\x20')),_0x44cb1c[_0xd77852(0x1d5)]>0x0&&!_0x394ed6['journeysOnly']&&console[_0xd77852(0x1e6)](_0xd77852(0x238)+_0x44cb1c[_0xd77852(0x1e4)](',\x20')),0x0;}}function a35_0x4fa1(){const _0x485c16=['65344GDFFbW','file','isNew','Site:\x20','updatedAt','audienceId','join','created','error','\x20new','yes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','get','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','resolveParentId','cwd','name','listFolders','getOutputSchemaWithCache','connection','createdAt','versionNumber','yamlConfig','journeyBundleName','29994uhMjIv','\x0aError:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','endsWith','\x0aPush\x20summary\x20for\x20\x27','push','getParent','πŸ“\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20to\x20update','7zsXAAd','parent_name','dim','description','journeyId','toDelete','new','journeysOnly','\x20changed','folderPath','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','Fetching\x20existing\x20data...','dryRun','segments','\x20activations]','/j/da/je','results','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Error:\x20','New\x20journey:','\x20created','all','message','\x20unchanged','existingJourney','/e/','2298384DBflTs','toUpdate','delete','180GKizEd','idToName','\x20updated','segment:push','blue','.yaml','\x20\x20Journeys:\x20','Error:\x20Directory\x20not\x20found:\x20','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','state','list','journeys','Preparing\x20journeys...','red','repeat','Changes\x20to\x20journey:','segmentFolderId','Source\x20directory:\x20','filter','\x20changes?','user','set','updated','targetDir','journey','relationships','\x20\x20Activations:\x20','isScoped','Delete\x20journey:','parentFolder','activations','toCreate','errorCode','segment','1698612iswRQI','\x20folders\x20to\x20create','5ZWCFTP','segment\x20or\x20journey','Error\x20parsing\x20YAML:\x20','No\x20','listActivations','\x20to\x20delete','\x20\x20Activations:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','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)','data','nameToType','yellow','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','.yml','changed','cyan','\x20deleted','parentName','814586pYDedT','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Segments:\x20','attributes','add','folders','nameToId','verbose','unchanged','\x20\x20\x20\x20','then','journeyBundleId','paused','buildUserMaps','Changes\x20to:','diff','\x20\x20πŸ“Š\x20Segments:','map','\x20to\x20create','Resolving\x20parent\x20segment\x20\x27','9502668fvnyCH','New\x20segment:','green','34971990fhNDfM','site','filePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x0aβœ”\x20Push\x20complete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','length','folderId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Parent\x20segment:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x0aValidation\x20failed:','deleted','helpText','\x20\x20Source:\x20'];a35_0x4fa1=function(){return _0x485c16;};return a35_0x4fa1();}
1
+ const a35_0x41e595=a35_0x5ded;(function(_0x49fb72,_0x41d39a){const _0x4def33=a35_0x5ded,_0x4b394b=_0x49fb72();while(!![]){try{const _0x4cafa6=-parseInt(_0x4def33(0x202))/0x1+-parseInt(_0x4def33(0x24d))/0x2+-parseInt(_0x4def33(0x21e))/0x3+-parseInt(_0x4def33(0x239))/0x4*(-parseInt(_0x4def33(0x20d))/0x5)+parseInt(_0x4def33(0x24b))/0x6*(parseInt(_0x4def33(0x221))/0x7)+parseInt(_0x4def33(0x255))/0x8*(-parseInt(_0x4def33(0x1ea))/0x9)+parseInt(_0x4def33(0x25f))/0xa;if(_0x4cafa6===_0x41d39a)break;else _0x4b394b['push'](_0x4b394b['shift']());}catch(_0x8e460b){_0x4b394b['push'](_0x4b394b['shift']());}}}(a35_0x1b32,0x78885));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 a35_0x16b3a5 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a35_0x1b32(){const _0x49c990=['\x20activations]','\x20\x20Source:\x20','site','endsWith','setPhase','segment:push','activations','user','\x20new','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','folderId','then','listFolders','175993npNQRl','nameToType','Folders\x20to\x20create:','updatedAt','\x20changes?','nameToId','\x20YAML\x20files\x20found','\x20deleted','targetDir','Fetching\x20existing\x20data...','file','4460155lNUnIp','Changes\x20to:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','verbose','list','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20changed','message','.yml','helpText','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Fetching\x20connections\x20for\x20name\x20resolution...','scopedFolderPath','green','red','get','2792586ltcawC','/app/ps/','journeys','56DBQDmT','\x20\x20πŸ“Š\x20Segments:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20\x20\x20','\x0aError:','createdAt','errorCode','\x20to\x20create','isNew','Scoped\x20to\x20folder:\x20','\x0aPush\x20summary\x20for\x20\x27','listJourneysWithDetailsFromParentSegment','getJourney','error','journeysOnly','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','folders','segments','parentName','join','\x20updated','Error:\x20Directory\x20not\x20found:\x20','connection','dim','4piuJGZ','yellow','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20to\x20update','audienceId','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)','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','listActivations','no_parent','toUpdate','toDelete','deleted','all','New\x20segment:','πŸ“\x20','parentSegment','463464cKcYxS','getParent','1531190uRrrGk','folderPath','toCreate','Resolving\x20parent\x20segment\x20\x27','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','delete','Changes\x20to\x20journey:','40616IneGSs','Site:\x20','\x20created','idToName','parent_name','yamlConfig','repeat','/e/','blue','type','13334060rzbLbM','results','journeyBundleName','description','cwd','segmentFolderId','buildUserMaps','changed','\x20unchanged','add','toString','length','map','Push\x20','unchanged','attributes','filter','parentFolder','name','segment\x20or\x20journey','\x20\x20Journeys:\x20','journey','cyan','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Error\x20parsing\x20YAML:\x20','created','data','Fetching\x20existing\x20activations...','Delete\x20segment:','updated','segment','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','diff','\x20to\x20delete','journeyId','set','846zPRirI','Preparing\x20journeys...','push','state','listSegments','new','getOutputSchemaWithCache','\x20\x20Activations:\x20','Delete\x20journey:','\x20folders\x20to\x20create','\x0aValidation\x20failed:'];a35_0x1b32=function(){return _0x49c990;};return a35_0x1b32();}import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a35_0x5ded(_0x120799,_0x2dde1e){_0x120799=_0x120799-0x1ca;const _0x1b3246=a35_0x1b32();let _0x5dedee=_0x1b3246[_0x120799];return _0x5dedee;}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{[a35_0x41e595(0x1d7)]=a35_0x41e595(0x1fa);[a35_0x41e595(0x262)]=a35_0x41e595(0x1dc);async['execute'](_0x52393b){const _0x394dab=a35_0x41e595,{options:_0x5f0efb,args:_0x9340c9,tdx:_0x4e8965}=_0x52393b,_0x3e70b2=_0x5f0efb,_0x406083=await resolveTarget({'arg':_0x9340c9[0x0],'contextParent':_0x5f0efb[_0x394dab(0x24a)],'cwd':process[_0x394dab(0x263)]()});if(!isSuccessfulResolution(_0x406083))return _0x406083[_0x394dab(0x227)]===_0x394dab(0x243)?(console['error'](a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x223))),console['error'](_0x394dab(0x23f)),console[_0x394dab(0x22e)](_0x394dab(0x1e5)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)]('Error:\x20'+_0x406083['message']+'\x0a')),_0x406083['helpText']&&console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x1db)](_0x406083[_0x394dab(0x216)]))),0x1;if(_0x406083[_0x394dab(0x25e)]===_0x394dab(0x259))return console['error'](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x236)+_0x406083[_0x394dab(0x20a)]+'\x0a')),console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x1db)](_0x394dab(0x240))),0x1;const _0x75714f=_0x406083[_0x394dab(0x233)],_0x537c4c=_0x406083[_0x394dab(0x20a)],_0x27790a=_0x406083['type']===_0x394dab(0x20c)?_0x406083['filePath']:undefined,_0x41122f=getScopedDetails(_0x406083),_0x2a984b=_0x41122f?.['isScoped']??![],_0x21d435=_0x41122f?.[_0x394dab(0x21a)]??'';if(!existsSync(_0x537c4c))return console[_0x394dab(0x22e)](a35_0x16b3a5['red'](_0x394dab(0x236)+_0x537c4c+'\x0a')),console[_0x394dab(0x22e)](a35_0x16b3a5['cyan'](_0x394dab(0x240))),0x1;_0x3e70b2[_0x394dab(0x210)]&&(console['error'](_0x394dab(0x256)+_0x3e70b2[_0x394dab(0x1f7)]),console[_0x394dab(0x22e)]('Parent\x20segment:\x20'+_0x75714f),console['error']('Source\x20directory:\x20'+_0x537c4c),_0x2a984b&&console[_0x394dab(0x22e)](_0x394dab(0x22a)+_0x21d435));const _0x2d2664=await withSpinner(_0x394dab(0x250)+_0x75714f+'\x27...',()=>_0x4e8965[_0x394dab(0x1e3)][_0x394dab(0x1e4)](_0x75714f),{'verbose':_0x3e70b2[_0x394dab(0x210)]}),_0x4ae4fc=_0x2d2664[_0x394dab(0x1df)],{parentSegmentResult:_0x4a48b9,segmentsResult:_0x5e000d,foldersResult:_0x259238,journeysWithDetailsResult:_0x21df43,userMaps:_0x585678}=await withSpinner(_0x394dab(0x20b),async()=>{const _0x3d37b8=_0x394dab,[_0x1e7fb6,_0x5adab9,_0x2c9314,_0x32c08c,_0x292a89]=await Promise[_0x3d37b8(0x247)]([_0x4e8965['segment'][_0x3d37b8(0x24c)](_0x4ae4fc),_0x4e8965[_0x3d37b8(0x1e3)][_0x3d37b8(0x1ee)](_0x4ae4fc),_0x4e8965[_0x3d37b8(0x1e3)][_0x3d37b8(0x201)](_0x4ae4fc),_0x4e8965['journey'][_0x3d37b8(0x22c)](_0x4ae4fc,{'includeAllVersions':!![]}),_0x4e8965[_0x3d37b8(0x1fc)][_0x3d37b8(0x1cb)]()]);return{'parentSegmentResult':_0x1e7fb6,'segmentsResult':_0x5adab9,'foldersResult':_0x2c9314,'journeysWithDetailsResult':_0x32c08c,'userMaps':_0x292a89};},{'verbose':_0x3e70b2['verbose']})[_0x394dab(0x200)](_0x130c59=>_0x130c59[_0x394dab(0x1df)]),_0x4b3862=_0x4a48b9,_0x21b782=extractRootFolderId(_0x4b3862),_0x4803a9=_0x5e000d,_0x2a89c3=_0x259238,{journeys:_0x1f448f,activationStepsById:_0x37444e}=_0x21df43,_0x178983=new Map(_0x1f448f[_0x394dab(0x1d1)](_0x31b86d=>[_0x31b86d['id'],_0x31b86d])),_0x366e99=_0x1f448f[_0x394dab(0x1d1)](_0x566ffb=>({'id':_0x566ffb['id'],'name':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x1d7)],'journeyBundleName':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x261)]||'','journeyBundleId':_0x566ffb['attributes']['journeyBundleId']||'','versionNumber':_0x566ffb['attributes']['versionNumber'],'description':_0x566ffb['attributes'][_0x394dab(0x262)],'state':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x1ed)],'paused':_0x566ffb[_0x394dab(0x1d4)]['paused'],'audienceId':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x23e)],'folderId':_0x566ffb['relationships']?.[_0x394dab(0x1d6)]?.[_0x394dab(0x1df)]?.['id'],'createdAt':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x226)],'updatedAt':_0x566ffb[_0x394dab(0x1d4)][_0x394dab(0x205)]})),{emailToId:_0x425aa9,idToEmail:_0x25f330}=_0x585678,_0x5c2b28=await withSpinner(_0x394dab(0x219),async()=>{const _0x7279b5=_0x394dab,_0x1940b0=await _0x4e8965[_0x7279b5(0x237)][_0x7279b5(0x211)]();return buildConnectionMaps(_0x1940b0);},{'verbose':_0x3e70b2[_0x394dab(0x210)]})['then'](_0x44fd11=>_0x44fd11[_0x394dab(0x1df)]),_0x2da4b3=_0x5c2b28[_0x394dab(0x207)],_0x6533d0=_0x5c2b28[_0x394dab(0x258)],_0x439abe=_0x5c2b28[_0x394dab(0x203)],_0x396f4e={'emailToIdMap':_0x425aa9,'connectionNameToIdMap':_0x2da4b3,'connectionNameToTypeMap':_0x439abe,'getSchema':_0xa47290=>_0x4e8965[_0x394dab(0x237)][_0x394dab(0x1f0)](_0xa47290)};let {pathToId:_0x43cc0f,idToPath:_0x417e77}=buildFolderMaps(_0x2a89c3);const _0x18ec79=buildSegmentLookupMap(_0x4803a9,_0x417e77),_0x4af660=buildSegmentNameToIdMap(_0x4803a9),_0x73e69c=buildJourneyBundleLookupMap(_0x366e99,_0x417e77);let _0x2cd115;if(_0x27790a){if(!_0x27790a[_0x394dab(0x1f8)](_0x394dab(0x215))&&!_0x27790a['endsWith']('.yaml'))return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x27790a+'\x0a')),0x1;_0x2cd115=[_0x27790a];}else _0x2cd115=findYamlFiles(_0x537c4c);if(_0x2cd115['length']===0x0)return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x252)+_0x537c4c+'\x0a')),console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x1db)](_0x394dab(0x23c))),0x1;let _0x2b100e,_0x493e5f;try{const _0xee09cb=parseAndClassifyYamlFiles(_0x2cd115,_0x537c4c,{'skipSegments':_0x3e70b2[_0x394dab(0x22f)]});_0x2b100e=_0xee09cb['segments'],_0x493e5f=_0xee09cb['journeys'];const _0x407484=validateParsedFiles(_0xee09cb,_0x537c4c);if(_0x407484[_0x394dab(0x1d0)]>0x0)return console['error'](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x1f4))),console['error'](formatValidationErrors(_0x407484)),console['error'](a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x241))),0x1;}catch(_0x1c6262){return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x1dd)+(_0x1c6262 instanceof Error?_0x1c6262[_0x394dab(0x214)]:_0x1c6262))),0x1;}if(_0x2b100e[_0x394dab(0x1d0)]===0x0&&_0x493e5f[_0x394dab(0x1d0)]===0x0){const _0x3f57a6=_0x3e70b2[_0x394dab(0x22f)]?_0x394dab(0x1da):_0x394dab(0x1d8);return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x23a)]('No\x20'+_0x3f57a6+_0x394dab(0x208))),0x0;}const _0x4acbbc=new Map();_0x4803a9[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2['journeysOnly']&&await withSpinner(_0x394dab(0x1e0),async()=>{await batchAsync(_0x4803a9,async _0x18d85b=>{const _0x423cd9=a35_0x5ded,_0x2b1504=await _0x4e8965[_0x423cd9(0x1e3)][_0x423cd9(0x242)](_0x4ae4fc,_0x18d85b['id']);_0x4acbbc[_0x423cd9(0x1e9)](_0x18d85b['id'],_0x2b1504);});},{'verbose':_0x3e70b2[_0x394dab(0x210)]});const {segmentFiles:_0x5783d7,foldersToCreate:_0x37f039}=await prepareSegmentFiles(_0x2b100e,{'segmentByFolderAndName':_0x18ec79,'activationsBySegmentId':_0x4acbbc,'folderPathToId':_0x43cc0f,'idToEmailMap':_0x25f330,'connectionIdToNameMap':_0x6533d0},_0x396f4e,_0x2a984b,_0x21d435),_0x347862=_0x27790a?[]:findSegmentsToDelete(_0x4803a9,_0x2b100e[_0x394dab(0x1d1)](({yamlConfig:_0x294e2d,folderPath:_0x186377})=>({'yamlConfig':_0x294e2d,'folderPath':resolveTDFolderPath(_0x186377,_0x2a984b,_0x21d435)})),_0x417e77,_0x21d435,_0x2a984b),{journeyFiles:_0xc6df71,foldersToCreate:_0x54f192}=await withProgressSpinner(_0x394dab(0x1eb),async _0x43ec60=>prepareJourneyFiles(_0x493e5f,{'fetchJourney':async _0xc59219=>_0x4e8965[_0x394dab(0x1da)][_0x394dab(0x22d)](_0xc59219['journeyId']),'journeyBundlesByFolderAndName':_0x73e69c,'folderPathToId':_0x43cc0f,'idToEmailMap':_0x25f330,'connectionIdToNameMap':_0x6533d0,'existingSegments':_0x4803a9,'parentId':_0x4ae4fc,'deps':_0x4e8965,'progress':{'update':_0x1f45ce=>{const _0x43baef=_0x394dab;_0x43ec60[_0x43baef(0x1f9)](_0x1f45ce),_0x3e70b2['verbose']&&console['error']('\x20\x20'+_0x1f45ce);}},'journeyById':_0x178983,'activationStepsById':_0x37444e},_0x2a984b,_0x21d435),{'verbose':_0x3e70b2[_0x394dab(0x210)]})[_0x394dab(0x200)](_0x269828=>_0x269828['data']);for(const _0x5e243c of _0x54f192){_0x37f039[_0x394dab(0x1ce)](_0x5e243c);}const _0x55f9c6=_0x27790a?[]:findJourneysToDelete(_0x366e99,_0x493e5f[_0x394dab(0x1d1)](({yamlConfig:_0x535480,folderPath:_0x447f71})=>({'yamlConfig':_0x535480,'folderPath':resolveTDFolderPath(_0x447f71,_0x2a984b,_0x21d435)})),_0x417e77,_0x21d435,_0x2a984b),_0x312fd5=calculatePushStats(_0x5783d7,_0xc6df71,_0x37f039,_0x347862,_0x55f9c6,!!_0x3e70b2[_0x394dab(0x253)],!!_0x3e70b2[_0x394dab(0x22f)]),_0x410822=_0x312fd5[_0x394dab(0x232)][_0x394dab(0x1ef)],_0x4194ae=_0x312fd5[_0x394dab(0x232)][_0x394dab(0x1cc)],_0x82e528=_0x312fd5['segments']['unchanged'],_0x2cc937=_0x312fd5[_0x394dab(0x232)]['toDelete'],_0x3cc7a0=_0x312fd5[_0x394dab(0x231)][_0x394dab(0x24f)],_0x32f561=_0x312fd5['journeys']['new'],_0x253c53=_0x312fd5[_0x394dab(0x220)][_0x394dab(0x1cc)],_0x97e39=_0x312fd5['journeys'][_0x394dab(0x1d3)],_0xaa8b8c=_0x312fd5['journeys'][_0x394dab(0x245)],_0x5b3824=_0x312fd5[_0x394dab(0x1fb)][_0x394dab(0x247)],_0x26bb8c=_0x312fd5[_0x394dab(0x1fb)][_0x394dab(0x24f)],_0x343405=_0x312fd5[_0x394dab(0x1fb)][_0x394dab(0x244)],_0x2de05f=_0x312fd5[_0x394dab(0x1fb)][_0x394dab(0x245)];console[_0x394dab(0x22e)](_0x394dab(0x22b)+_0x75714f+'\x27:');_0x3cc7a0[_0x394dab(0x1d0)]>0x0&&console[_0x394dab(0x22e)]('\x20\x20'+a35_0x16b3a5[_0x394dab(0x25d)](_0x394dab(0x249)+_0x3cc7a0['length']+_0x394dab(0x1f3)));if(!_0x3e70b2[_0x394dab(0x22f)]){console[_0x394dab(0x22e)](_0x394dab(0x222)),console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x21b)]('+\x20'+_0x410822[_0x394dab(0x1d0)]+_0x394dab(0x1fd))),console['error']('\x20\x20\x20\x20'+a35_0x16b3a5[_0x394dab(0x23a)]('~\x20'+_0x4194ae['length']+_0x394dab(0x213)));if(_0x2cc937[_0x394dab(0x1d0)]>0x0)console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x21c)]('-\x20'+_0x2cc937[_0x394dab(0x1d0)]+'\x20to\x20delete'));else _0x347862[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x253)]&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x238)](_0x347862['length']+_0x394dab(0x23b)));console['error'](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x238)]('=\x20'+_0x82e528[_0x394dab(0x1d0)]+_0x394dab(0x1cd)));}if(_0xc6df71[_0x394dab(0x1d0)]>0x0||_0x55f9c6['length']>0x0){console[_0x394dab(0x22e)](_0x394dab(0x251)),console[_0x394dab(0x22e)]('\x20\x20\x20\x20'+a35_0x16b3a5[_0x394dab(0x21b)]('+\x20'+_0x32f561[_0x394dab(0x1d0)]+_0x394dab(0x1fd))),console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x23a)]('~\x20'+_0x253c53[_0x394dab(0x1d0)]+_0x394dab(0x213)));if(_0xaa8b8c['length']>0x0)console['error']('\x20\x20\x20\x20'+a35_0x16b3a5[_0x394dab(0x21c)]('-\x20'+_0xaa8b8c[_0x394dab(0x1d0)]+'\x20to\x20delete'));else _0x55f9c6[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x253)]&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x238)](_0x55f9c6[_0x394dab(0x1d0)]+_0x394dab(0x23b)));console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x238)]('=\x20'+_0x97e39['length']+'\x20unchanged'));}_0x5b3824[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x22f)]&&(console[_0x394dab(0x22e)](''),console[_0x394dab(0x22e)]('\x20\x20Activations:'),_0x26bb8c[_0x394dab(0x1d0)]>0x0&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5['green']('+\x20'+_0x26bb8c['length']+_0x394dab(0x228))),_0x343405['length']>0x0&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x23a)]('~\x20'+_0x343405[_0x394dab(0x1d0)]+_0x394dab(0x23d))),_0x2de05f[_0x394dab(0x1d0)]>0x0&&console[_0x394dab(0x22e)](_0x394dab(0x224)+a35_0x16b3a5[_0x394dab(0x21c)]('-\x20'+_0x2de05f[_0x394dab(0x1d0)]+_0x394dab(0x1e7))));console[_0x394dab(0x22e)](_0x394dab(0x1f6)+a35_0x16b3a5[_0x394dab(0x1db)](_0x537c4c)+'\x0a');if(_0x3cc7a0[_0x394dab(0x1d0)]>0x0){console[_0x394dab(0x22e)](_0x394dab(0x204));for(const _0x3e78a9 of _0x3cc7a0){console[_0x394dab(0x22e)]('\x20\x20'+a35_0x16b3a5[_0x394dab(0x25d)]('+')+'\x20'+_0x3e78a9);}console[_0x394dab(0x22e)]('');}if(_0x410822[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x22f)])for(const _0x518d6e of _0x410822){const _0x122484=_0x518d6e[_0x394dab(0x24e)]?_0x518d6e[_0x394dab(0x24e)]+'/'+_0x518d6e[_0x394dab(0x25a)][_0x394dab(0x1d7)]:_0x518d6e['yamlConfig'][_0x394dab(0x1d7)],_0x4f2da9=_0x518d6e[_0x394dab(0x25a)]['activations']?.['length']||0x0,_0x5b2ece=_0x4f2da9>0x0?a35_0x16b3a5['dim']('\x20['+_0x4f2da9+'\x20activations]'):'';console['error']('\x0a'+a35_0x16b3a5[_0x394dab(0x21b)](_0x394dab(0x248))+'\x20'+_0x122484+_0x5b2ece),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c)),_0x518d6e[_0x394dab(0x1e6)]&&console[_0x394dab(0x22e)](_0x518d6e['diff']),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c));}if(_0x2cc937[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2['journeysOnly'])for(const _0x3e0fa5 of _0x2cc937){const _0x44ac3d=_0x3e0fa5[_0x394dab(0x1ca)]?_0x417e77[_0x394dab(0x21d)](_0x3e0fa5[_0x394dab(0x1ca)][_0x394dab(0x1cf)]())||'':'',_0x276b4e=_0x44ac3d?_0x44ac3d+'/'+_0x3e0fa5[_0x394dab(0x1d7)]:_0x3e0fa5[_0x394dab(0x1d7)],_0x20eece=_0x4acbbc[_0x394dab(0x21d)](_0x3e0fa5['id'])||[],_0x2c9e7c=_0x20eece['length']>0x0?a35_0x16b3a5['dim']('\x20['+_0x20eece['length']+_0x394dab(0x1f5)):'';console[_0x394dab(0x22e)]('\x0a'+a35_0x16b3a5['red'](_0x394dab(0x1e1))+'\x20'+_0x276b4e+_0x2c9e7c),console[_0x394dab(0x22e)]('─'['repeat'](0x3c));const _0x3823ee=segmentWithActivationsToYaml(_0x3e0fa5,_0x20eece,undefined,_0x25f330,_0x6533d0),_0x590f60=segmentToYamlString(_0x3823ee),_0x267cda=generateDiff(_0x590f60,'');console[_0x394dab(0x22e)](formatDiffWithColors(_0x267cda)),console[_0x394dab(0x22e)]('─'['repeat'](0x3c));}const _0x32fdbf=_0x5783d7[_0x394dab(0x1d5)](_0x103844=>!_0x103844[_0x394dab(0x229)]&&_0x103844['diff']);if(_0x32fdbf[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2['journeysOnly'])for(const _0x5ba5a3 of _0x32fdbf){const _0x5c79c7=_0x5ba5a3[_0x394dab(0x24e)]?_0x5ba5a3[_0x394dab(0x24e)]+'/'+_0x5ba5a3[_0x394dab(0x25a)][_0x394dab(0x1d7)]:_0x5ba5a3[_0x394dab(0x25a)][_0x394dab(0x1d7)];console[_0x394dab(0x22e)]('\x0a'+a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x20e))+'\x20'+_0x5c79c7),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c)),console[_0x394dab(0x22e)](_0x5ba5a3[_0x394dab(0x1e6)]),console['error']('─'[_0x394dab(0x25b)](0x3c));}if(_0x32f561[_0x394dab(0x1d0)]>0x0)for(const _0xde8c61 of _0x32f561){const _0x457568=_0xde8c61['folderPath']?_0xde8c61[_0x394dab(0x24e)]+'/'+_0xde8c61[_0x394dab(0x25a)][_0x394dab(0x1d7)]:_0xde8c61[_0x394dab(0x25a)][_0x394dab(0x1d7)];console['error']('\x0a'+a35_0x16b3a5[_0x394dab(0x21b)]('New\x20journey:')+'\x20'+_0x457568),console[_0x394dab(0x22e)]('─'['repeat'](0x3c)),_0xde8c61['diff']&&console['error'](_0xde8c61[_0x394dab(0x1e6)]),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c));}const _0x53c5f3=_0xc6df71[_0x394dab(0x1d5)](_0x55d69e=>!_0x55d69e['isNew']&&_0x55d69e[_0x394dab(0x1e6)]);if(_0x53c5f3['length']>0x0)for(const _0x425fe5 of _0x53c5f3){const _0x4b4e3f=_0x425fe5[_0x394dab(0x24e)]?_0x425fe5['folderPath']+'/'+_0x425fe5[_0x394dab(0x25a)][_0x394dab(0x1d7)]:_0x425fe5['yamlConfig']['name'];console[_0x394dab(0x22e)]('\x0a'+a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x254))+'\x20'+_0x4b4e3f),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c)),console[_0x394dab(0x22e)](_0x425fe5[_0x394dab(0x1e6)]),console[_0x394dab(0x22e)]('─'[_0x394dab(0x25b)](0x3c));}if(_0xaa8b8c[_0x394dab(0x1d0)]>0x0)for(const _0x418837 of _0xaa8b8c){const _0x4ffcef=_0x418837[_0x394dab(0x1ff)]?_0x417e77[_0x394dab(0x21d)](_0x418837[_0x394dab(0x1ff)])||'':'',_0x3fe7aa=_0x4ffcef?_0x4ffcef+'/'+_0x418837[_0x394dab(0x261)]:_0x418837['journeyBundleName'];console[_0x394dab(0x22e)]('\x0a'+a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x1f2))+'\x20'+_0x3fe7aa),console[_0x394dab(0x22e)]('─'['repeat'](0x3c)),console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)]('(Journey\x20will\x20be\x20deleted)')),console[_0x394dab(0x22e)]('─'['repeat'](0x3c));}if(_0x3e70b2['dryRun'])return console['error'](a35_0x16b3a5['yellow'](_0x394dab(0x1fe))),0x0;const _0x429c9a=_0x3e70b2[_0x394dab(0x22f)]?![]:_0x410822['length']>0x0||_0x4194ae[_0x394dab(0x1d0)]>0x0||_0x2cc937[_0x394dab(0x1d0)]>0x0,_0x1fc87b=_0x32f561[_0x394dab(0x1d0)]>0x0||_0x253c53[_0x394dab(0x1d0)]>0x0||_0xaa8b8c[_0x394dab(0x1d0)]>0x0,_0x25d94a=_0x3e70b2[_0x394dab(0x22f)]?![]:_0x5b3824[_0x394dab(0x1d0)]>0x0,_0x767a7b=_0x3cc7a0['length']>0x0;if(!_0x429c9a&&!_0x1fc87b&&!_0x25d94a&&!_0x767a7b){const _0x852c40=_0x3e70b2[_0x394dab(0x22f)]?_0x394dab(0x230):_0x394dab(0x218);console[_0x394dab(0x22e)](a35_0x16b3a5['green'](_0x852c40));if(_0x27790a&&_0x97e39['length']===0x1){const _0x379854=_0x97e39[0x0];if(_0x379854['existingJourney']?.['id']){const _0x40554c=getConsoleNextUrl(_0x3e70b2[_0x394dab(0x1f7)],_0x394dab(0x21f)+_0x4ae4fc+_0x394dab(0x25c)+_0x379854['existingJourney']['id']+'/j/da/je');console[_0x394dab(0x22e)]('\x20\x20'+a35_0x16b3a5['cyan'](_0x40554c));}}return 0x0;}const _0x15a84c=_0x3e70b2[_0x394dab(0x22f)]?_0x32f561['length']+_0x253c53[_0x394dab(0x1d0)]+_0xaa8b8c[_0x394dab(0x1d0)]+_0x3cc7a0['length']:_0x410822[_0x394dab(0x1d0)]+_0x4194ae[_0x394dab(0x1d0)]+_0x2cc937[_0x394dab(0x1d0)]+_0x32f561[_0x394dab(0x1d0)]+_0x253c53[_0x394dab(0x1d0)]+_0xaa8b8c['length']+_0x3cc7a0['length']+_0x5b3824[_0x394dab(0x1d0)];if(!_0x3e70b2['yes']&&_0x15a84c>0x0){if(!isInteractive())return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x21c)](_0x394dab(0x225)),_0x394dab(0x212)),console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x238)](_0x394dab(0x217))),0x1;const _0x15852f=await confirmKey(_0x394dab(0x1d2)+_0x15a84c+_0x394dab(0x206));if(!_0x15852f)return console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x23a)]('Aborted.')),0x1;}const _0x2f1cd3={'withProgress':async(_0x3c879c,_0x5316ba)=>{const _0x3a14d9=_0x394dab,_0x3d857c=await withSpinner(_0x3c879c,_0x5316ba,{'verbose':_0x3e70b2['verbose']});return{'data':_0x3d857c[_0x3a14d9(0x1df)]};},'logInfo':_0x281008=>console['error'](a35_0x16b3a5[_0x394dab(0x25d)]('βœ”\x20'+_0x281008)),'logSuccess':_0x396808=>console['error'](a35_0x16b3a5[_0x394dab(0x21b)]('βœ”\x20'+_0x396808)),'logWarning':_0x32d956=>console['error'](a35_0x16b3a5['yellow']('⚠\x20'+_0x32d956)),'logDeleted':_0x59ae52=>console['error'](a35_0x16b3a5[_0x394dab(0x21c)]('βœ”\x20'+_0x59ae52))},_0x1b0bef={'segment':_0x4e8965[_0x394dab(0x1e3)],'journey':_0x4e8965[_0x394dab(0x1da)],'user':_0x4e8965[_0x394dab(0x1fc)],'connection':_0x4e8965[_0x394dab(0x237)]};_0x3cc7a0[_0x394dab(0x1d0)]>0x0&&(_0x43cc0f=await executePushFolders(_0x1b0bef,_0x3cc7a0,_0x43cc0f,{'parentId':_0x4ae4fc},_0x2f1cd3));const _0x52dca5={'rootFolderId':_0x21b782,'folderPathToId':_0x43cc0f,'folderIdToPath':_0x417e77,'segmentNameToId':_0x4af660,'activationsBySegmentId':_0x4acbbc,'emailToIdMap':_0x425aa9,'idToEmailMap':_0x25f330,'connectionNameToIdMap':_0x5c2b28['nameToId'],'connectionIdToNameMap':_0x5c2b28[_0x394dab(0x258)],'connectionNameToTypeMap':_0x439abe},_0x395d9d=await executePushSegments(_0x1b0bef,_0x3e70b2[_0x394dab(0x22f)]?[]:_0x5783d7,_0x52dca5,{'parentId':_0x4ae4fc},_0x2f1cd3),_0x1391c9=_0x395d9d['created'],_0x4b1989=_0x395d9d[_0x394dab(0x1e2)],_0x3c24ee=_0x395d9d[_0x394dab(0x1fb)][_0x394dab(0x1de)],_0x931822=_0x395d9d[_0x394dab(0x1fb)][_0x394dab(0x1e2)],_0x3a164f=_0x395d9d['activations'][_0x394dab(0x246)],_0x199408=await executePushSegmentDeletions(_0x1b0bef,_0x3e70b2[_0x394dab(0x22f)]?[]:_0x2cc937,_0x2f1cd3);let _0x2a3420=0x0,_0x7b0940=0x0,_0x6b8a7=0x0;const _0x137343=new Map(_0x4af660);for(const [_0xab3fe0,_0x303064]of _0x395d9d['createdSegmentIds']){_0x137343[_0x394dab(0x1e9)](_0xab3fe0,_0x303064);}if(_0xc6df71[_0x394dab(0x1d0)]>0x0){const _0x47fa76={..._0x52dca5,'segmentNameToId':_0x137343,'existingSegments':_0x4803a9,'activationContext':_0x396f4e},_0x150de8=await executePushJourneys(_0x1b0bef,_0xc6df71,_0x47fa76,{'parentId':_0x4ae4fc,'rootFolderId':_0x21b782,'verbose':_0x3e70b2['verbose']},_0x2f1cd3);_0x2a3420=_0x150de8[_0x394dab(0x1de)],_0x7b0940=_0x150de8[_0x394dab(0x1e2)];if(_0x27790a&&_0x150de8[_0x394dab(0x260)][_0x394dab(0x1d0)]===0x1){const _0x39f880=_0x150de8[_0x394dab(0x260)][0x0];if(_0x39f880['journeyId']){const _0x3551c8=getConsoleNextUrl(_0x3e70b2[_0x394dab(0x1f7)],'/app/ps/'+_0x4ae4fc+'/e/'+_0x39f880[_0x394dab(0x1e8)]+'/j/da/je');console[_0x394dab(0x22e)]('\x20\x20'+a35_0x16b3a5['cyan'](_0x3551c8));}}}for(const _0x1548bb of _0xaa8b8c){console[_0x394dab(0x22e)](a35_0x16b3a5[_0x394dab(0x23a)](_0x394dab(0x20f)+_0x1548bb['journeyBundleName'])),_0x6b8a7++;}const _0x41cf23=[];if(_0x1391c9>0x0)_0x41cf23[_0x394dab(0x1ec)](_0x1391c9+'\x20created');if(_0x4b1989>0x0)_0x41cf23[_0x394dab(0x1ec)](_0x4b1989+'\x20updated');if(_0x199408>0x0)_0x41cf23[_0x394dab(0x1ec)](_0x199408+_0x394dab(0x209));const _0x2eec66=[];if(_0x2a3420>0x0)_0x2eec66[_0x394dab(0x1ec)](_0x2a3420+_0x394dab(0x257));if(_0x7b0940>0x0)_0x2eec66[_0x394dab(0x1ec)](_0x7b0940+_0x394dab(0x235));if(_0x6b8a7>0x0)_0x2eec66[_0x394dab(0x1ec)](_0x6b8a7+_0x394dab(0x209));const _0x58d68d=[];if(_0x3c24ee>0x0)_0x58d68d[_0x394dab(0x1ec)](_0x3c24ee+_0x394dab(0x257));if(_0x931822>0x0)_0x58d68d['push'](_0x931822+'\x20updated');if(_0x3a164f>0x0)_0x58d68d[_0x394dab(0x1ec)](_0x3a164f+_0x394dab(0x209));return console[_0x394dab(0x22e)](a35_0x16b3a5['green']('\x0aβœ”\x20Push\x20complete')),_0x41cf23['length']>0x0&&!_0x3e70b2['journeysOnly']&&console[_0x394dab(0x22e)]('\x20\x20Segments:\x20'+_0x41cf23[_0x394dab(0x234)](',\x20')),_0x2eec66['length']>0x0&&console[_0x394dab(0x22e)](_0x394dab(0x1d9)+_0x2eec66[_0x394dab(0x234)](',\x20')),_0x58d68d[_0x394dab(0x1d0)]>0x0&&!_0x3e70b2[_0x394dab(0x22f)]&&console[_0x394dab(0x22e)](_0x394dab(0x1f1)+_0x58d68d[_0x394dab(0x234)](',\x20')),0x0;}}