@treasuredata/tdx 0.29.2 β†’ 0.29.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 (193) 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.d.ts.map +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-command.js.map +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/job-command.js +1 -1
  26. package/dist/commands/journey-command.js +1 -1
  27. package/dist/commands/journey-validate-command.js +1 -1
  28. package/dist/commands/llm-command.js +1 -1
  29. package/dist/commands/mcp-command.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profile-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/schedule-command.js +1 -1
  35. package/dist/commands/segment-command.js +1 -1
  36. package/dist/commands/segment-create-command.js +1 -1
  37. package/dist/commands/segment-fields-command.js +1 -1
  38. package/dist/commands/segment-pull-command.js +1 -1
  39. package/dist/commands/segment-push-command.js +1 -1
  40. package/dist/commands/segment-update-command.js +1 -1
  41. package/dist/commands/segment-use-command.js +1 -1
  42. package/dist/commands/segment-validate-command.js +1 -1
  43. package/dist/commands/segments.js +1 -1
  44. package/dist/commands/show.js +1 -1
  45. package/dist/commands/status-command.js +1 -1
  46. package/dist/commands/tables.js +1 -1
  47. package/dist/commands/unset-command.js +1 -1
  48. package/dist/commands/upgrade-command.js +1 -1
  49. package/dist/commands/use-command.js +1 -1
  50. package/dist/commands/user-command.js +1 -1
  51. package/dist/commands/workflow-command.js +1 -1
  52. package/dist/core/auth.js +1 -1
  53. package/dist/core/command-output.js +1 -1
  54. package/dist/core/config.js +1 -1
  55. package/dist/core/connection-cache.js +1 -1
  56. package/dist/core/constants.js +1 -1
  57. package/dist/core/credential-cache.js +1 -1
  58. package/dist/core/global-context.js +1 -1
  59. package/dist/core/keychain.js +1 -1
  60. package/dist/core/profile.js +1 -1
  61. package/dist/core/project-config.js +1 -1
  62. package/dist/core/session.js +1 -1
  63. package/dist/core/user-cache.js +1 -1
  64. package/dist/core/version.js +1 -1
  65. package/dist/index.js +1 -1
  66. package/dist/mcp/server.js +1 -1
  67. package/dist/mcp/tools/index.js +1 -1
  68. package/dist/mcp/tools/tdx-run.js +1 -1
  69. package/dist/mcp/tools/tdx-search.js +1 -1
  70. package/dist/mcp/utils.js +1 -1
  71. package/dist/proxy/claude-usage-tracker.js +1 -1
  72. package/dist/proxy/passthrough-server.js +1 -1
  73. package/dist/proxy/sse-usage-parser.js +1 -1
  74. package/dist/sdk/agent/agent-config.js +1 -1
  75. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  76. package/dist/sdk/agent/agent-yaml.js +1 -1
  77. package/dist/sdk/agent/test/evaluator.js +1 -1
  78. package/dist/sdk/agent/test/executor.js +1 -1
  79. package/dist/sdk/agent/test/index.js +1 -1
  80. package/dist/sdk/agent/test/output.js +1 -1
  81. package/dist/sdk/agent/test/parser.js +1 -1
  82. package/dist/sdk/agent/tool-target-registry.js +1 -1
  83. package/dist/sdk/api.js +1 -1
  84. package/dist/sdk/client/cdp-api-client.js +1 -1
  85. package/dist/sdk/client/delivery-api-client.js +1 -1
  86. package/dist/sdk/client/endpoints.js +1 -1
  87. package/dist/sdk/client/engage-api-client.js +1 -1
  88. package/dist/sdk/client/http-client.js +1 -1
  89. package/dist/sdk/client/llm-api-client.js +1 -1
  90. package/dist/sdk/client/rate-limiter.js +1 -1
  91. package/dist/sdk/client/td-api-client.js +1 -1
  92. package/dist/sdk/client/trino-api-client.js +1 -1
  93. package/dist/sdk/client/workflow-client.js +1 -1
  94. package/dist/sdk/connection-validator.js +1 -1
  95. package/dist/sdk/connection.js +1 -1
  96. package/dist/sdk/delivery.js +1 -1
  97. package/dist/sdk/engage/campaign-pull.js +1 -1
  98. package/dist/sdk/engage/campaign-push.js +1 -1
  99. package/dist/sdk/engage/campaign-validator.js +1 -1
  100. package/dist/sdk/engage/campaign-yaml.js +1 -1
  101. package/dist/sdk/engage/types/campaign-def.js +1 -1
  102. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  103. package/dist/sdk/engage.js +1 -1
  104. package/dist/sdk/errors.js +1 -1
  105. package/dist/sdk/index.js +1 -1
  106. package/dist/sdk/io/index.js +1 -1
  107. package/dist/sdk/io/node-filesystem.js +1 -1
  108. package/dist/sdk/job.js +1 -1
  109. package/dist/sdk/journey.js +1 -1
  110. package/dist/sdk/llm/chat-cache.js +1 -1
  111. package/dist/sdk/llm/index.js +1 -1
  112. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  113. package/dist/sdk/llm/model-factors.js +1 -1
  114. package/dist/sdk/personalization.js +1 -1
  115. package/dist/sdk/query/index.js +1 -1
  116. package/dist/sdk/query/sql-parser.js +1 -1
  117. package/dist/sdk/realtime.js +1 -1
  118. package/dist/sdk/schedule.js +1 -1
  119. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  120. package/dist/sdk/segment/fields-display.js +1 -1
  121. package/dist/sdk/segment/file-discovery.js +1 -1
  122. package/dist/sdk/segment/journey-utils.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js +1 -1
  124. package/dist/sdk/segment/journey-yaml.js +1 -1
  125. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  126. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  127. package/dist/sdk/segment/pull-workflow.js +1 -1
  128. package/dist/sdk/segment/push-recovery.js +1 -1
  129. package/dist/sdk/segment/push-workflow.js +1 -1
  130. package/dist/sdk/segment/resolution-context.js +1 -1
  131. package/dist/sdk/segment/segment-path-parser.js +1 -1
  132. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  133. package/dist/sdk/segment/segment-validator.js +1 -1
  134. package/dist/sdk/segment/target-resolution.js +1 -1
  135. package/dist/sdk/segment/tdx-config.js +1 -1
  136. package/dist/sdk/segment/types/activation-schema.js +1 -1
  137. package/dist/sdk/segment/types/journey-def.js +1 -1
  138. package/dist/sdk/segment/types/journey-schema.js +1 -1
  139. package/dist/sdk/segment/types/segment-def.js +1 -1
  140. package/dist/sdk/segment/types/segment-schema.js +1 -1
  141. package/dist/sdk/segment/validate-files.js +1 -1
  142. package/dist/sdk/segment/yaml-validator.js +1 -1
  143. package/dist/sdk/segment.js +1 -1
  144. package/dist/sdk/types/index.js +1 -1
  145. package/dist/sdk/types/progress.js +1 -1
  146. package/dist/sdk/user.js +1 -1
  147. package/dist/sdk/util/format-detector.js +1 -1
  148. package/dist/sdk/util/formatters.js +1 -1
  149. package/dist/sdk/util/index.js +1 -1
  150. package/dist/sdk/util/tree-formatter.js +1 -1
  151. package/dist/sdk/workflow/archive-validation.js +1 -1
  152. package/dist/sdk/workflow/clone-workflow.js +1 -1
  153. package/dist/sdk/workflow/index.js +1 -1
  154. package/dist/sdk/workflow/pull-workflow.js +1 -1
  155. package/dist/sdk/workflow/push-workflow.js +1 -1
  156. package/dist/sdk/workflow/tdx-config.js +1 -1
  157. package/dist/sdk/workflow/workflow-utils.js +1 -1
  158. package/dist/test-utils/command-runner.js +1 -1
  159. package/dist/test-utils/factories.js +1 -1
  160. package/dist/test-utils/fixtures.js +1 -1
  161. package/dist/test-utils/http-mock.js +1 -1
  162. package/dist/test-utils/index.js +1 -1
  163. package/dist/utils/async.js +1 -1
  164. package/dist/utils/colors.js +1 -1
  165. package/dist/utils/diff.js +1 -1
  166. package/dist/utils/file-permissions.js +1 -1
  167. package/dist/utils/file-reader.js +1 -1
  168. package/dist/utils/github-releases.d.ts +17 -0
  169. package/dist/utils/github-releases.d.ts.map +1 -0
  170. package/dist/utils/github-releases.js +1 -0
  171. package/dist/utils/github-releases.js.map +1 -0
  172. package/dist/utils/global-cache.js +1 -1
  173. package/dist/utils/json-loader.js +1 -1
  174. package/dist/utils/local-cache.js +1 -1
  175. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  176. package/dist/utils/logger/formatters/index.js +1 -1
  177. package/dist/utils/logger/handlers/console-handler.js +1 -1
  178. package/dist/utils/logger/handlers/file-handler.js +1 -1
  179. package/dist/utils/logger/handlers/index.js +1 -1
  180. package/dist/utils/logger/handlers/null-handler.js +1 -1
  181. package/dist/utils/logger/index.js +1 -1
  182. package/dist/utils/logger/logger.js +1 -1
  183. package/dist/utils/logger/types.js +1 -1
  184. package/dist/utils/option-validation.js +1 -1
  185. package/dist/utils/process.js +1 -1
  186. package/dist/utils/prompt.js +1 -1
  187. package/dist/utils/spinner.js +1 -1
  188. package/dist/utils/sse-parser.js +1 -1
  189. package/dist/utils/string-utils.js +1 -1
  190. package/dist/utils/table-ref-parser.js +1 -1
  191. package/dist/utils/tdx-logger.js +1 -1
  192. package/dist/utils/version-check.js +1 -1
  193. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x1ff8d3=a30_0x3906;(function(_0x40b777,_0x1d9e30){const _0x5075e8=a30_0x3906,_0x519952=_0x40b777();while(!![]){try{const _0x287292=-parseInt(_0x5075e8(0xa3))/0x1*(-parseInt(_0x5075e8(0xb2))/0x2)+-parseInt(_0x5075e8(0xe3))/0x3*(parseInt(_0x5075e8(0x10c))/0x4)+parseInt(_0x5075e8(0xda))/0x5*(-parseInt(_0x5075e8(0xba))/0x6)+parseInt(_0x5075e8(0xc6))/0x7+-parseInt(_0x5075e8(0x100))/0x8*(parseInt(_0x5075e8(0xef))/0x9)+-parseInt(_0x5075e8(0x103))/0xa*(parseInt(_0x5075e8(0x11c))/0xb)+parseInt(_0x5075e8(0xc3))/0xc;if(_0x287292===_0x1d9e30)break;else _0x519952['push'](_0x519952['shift']());}catch(_0x5ab5da){_0x519952['push'](_0x519952['shift']());}}}(a30_0x1d61,0x34e48));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a30_0x3906(_0x538a2d,_0x36cc57){_0x538a2d=_0x538a2d-0x9c;const _0x1d6194=a30_0x1d61();let _0x390619=_0x1d6194[_0x538a2d];return _0x390619;}import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a30_0x1d61(){const _0x206444=['4XhkIVt','last_job','lastRun','next_run_at','\x20\x20Time:\x20','length','retry_limit','toLocaleDateString','history','status','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','schedule:delete','schedule:create','entries','execute','1466Sltknj','schedule:history','jobs','map','created_at','Run\x20a\x20scheduled\x20query\x20immediately','\x20\x20Database:\x20','padEnd','372cWFESB','No\x20scheduled\x20queries\x20found','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','num','start_at','time_zone','\x20\x20β†’\x20','Create\x20a\x20scheduled\x20query','timezone','7393644gwxDDt','statusIcon','Schedule\x20created:\x20','2332155kCHTvi','data','abs','engine_version','cyan','schedule:list','list','type','name','show','time','\x20matching\x20\x22','round','(unnamed)','delay','in\x20','red','validate','success','table','26160IdMTKL','engineVersion','user_name','delete','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','trino','Schedule\x20deleted:\x20','output','updated_at','3oeireL','has_next_page','run','Show\x20schedule\x20execution\x20history','queries','Delete\x20a\x20scheduled\x20query','Update\x20a\x20scheduled\x20query','schedules','\x20created','Getting\x20schedule\x20details...','queryUrl','create','247392zygbdi','yes','Getting\x20schedule\x20history...','max','database','Showing\x20first\x20','Creating\x20schedule:\x20','job_id','join','List\x20scheduled\x20queries','Running\x20schedule...','ies','args','log','soon','keys','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','48GCuhcG','nextRun','...','1699310OlRiPF','green','trim','\x20schedules','scheduled_at','limit','listQueries','Show\x20schedule\x20details','jsonl','305372AIGKgo','format','h\x20ago','INVALID_ARGUMENT','error','query','retryLimit','Schedule\x20run\x20submitted:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','cron','file','\x20\x20Job\x20ID:\x20','Failed\x20to\x20read\x20file:\x20','/app/queries/editor?queryId=','getTime','options','11petnza','description','substring','priority','Searching\x20scheduled\x20queries\x20matching\x20\x22','Query\x20file\x20is\x20empty','\x20(use\x20--limit\x20to\x20see\x20more)','verbose','\x20\x20Type:\x20','just\x20now','Updating\x20schedule:\x20','Found\x20','json','count','Running\x20schedule:\x20','from','πŸ“…\x20','Listing\x20scheduled\x20queries...','ended_at','site','result','Cancelled'];a30_0x1d61=function(){return _0x206444;};return a30_0x1d61();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x2917ba from'chalk';function formatRelativeTime(_0x1c9612){const _0x3ce014=a30_0x3906,_0x461a96=new Date(_0x1c9612),_0x2d7882=new Date(),_0x4e7278=_0x461a96[_0x3ce014(0x11a)]()-_0x2d7882[_0x3ce014(0x11a)](),_0x211d2c=Math[_0x3ce014(0xc8)](_0x4e7278)/0x3e8,_0x4ea78a=_0x4e7278<0x0;if(_0x211d2c<0x3c)return _0x4ea78a?_0x3ce014(0x125):_0x3ce014(0xfd);else{if(_0x211d2c<0xe10){const _0x5d4c93=Math['round'](_0x211d2c/0x3c);return _0x4ea78a?_0x5d4c93+'m\x20ago':_0x3ce014(0xd5)+_0x5d4c93+'m';}else{if(_0x211d2c<0x15180){const _0x4f57df=Math[_0x3ce014(0xd2)](_0x211d2c/0xe10);return _0x4ea78a?_0x4f57df+_0x3ce014(0x10e):_0x3ce014(0xd5)+_0x4f57df+'h';}else{if(_0x211d2c<0x93a80){const _0x27a43c=Math[_0x3ce014(0xd2)](_0x211d2c/0x15180);return _0x4ea78a?_0x27a43c+'d\x20ago':_0x3ce014(0xd5)+_0x27a43c+'d';}else return _0x461a96[_0x3ce014(0xaa)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x1ff8d3(0xce)]=a30_0x1ff8d3(0xcb);[a30_0x1ff8d3(0x11d)]=a30_0x1ff8d3(0xf8);async[a30_0x1ff8d3(0xb1)](_0x5b6028){const _0x47c961=a30_0x1ff8d3,{options:_0x5ba1ef,args:_0x410340,tdx:_0x32176b}=_0x5b6028,_0x416cd8=resolveLimit(_0x5ba1ef[_0x47c961(0x108)],DEFAULT_DISPLAY_LIMIT),_0x2eef20=_0x410340[0x0],_0x22b3de=_0x2eef20?_0x47c961(0x120)+_0x2eef20+'\x22...':_0x47c961(0x9e),_0x4c70e1=await withSpinner(_0x22b3de,()=>_0x32176b['schedules'][_0x47c961(0x109)]({'limit':_0x416cd8,'scheduled':!![],'pattern':_0x2eef20}),{'verbose':_0x5ba1ef[_0x47c961(0x123)]}),_0x2def05=_0x4c70e1['data'][_0x47c961(0xe7)],_0x501499=_0x4c70e1[_0x47c961(0xc7)]['pagination'][_0x47c961(0xe4)],_0x4d9c43=_0x2eef20?_0x47c961(0xd1)+_0x2eef20+'\x22':'';_0x501499?console[_0x47c961(0x110)](_0x47c961(0xf4)+_0x2def05[_0x47c961(0xa8)]+_0x47c961(0x106)+_0x4d9c43+_0x47c961(0x122)):console[_0x47c961(0x110)](_0x47c961(0x127)+_0x2def05[_0x47c961(0xa8)]+'\x20scheduled\x20quer'+(_0x2def05[_0x47c961(0xa8)]!==0x1?_0x47c961(0xfa):'y')+_0x4d9c43);if(_0x5ba1ef[_0x47c961(0x10d)]===_0x47c961(0x128)||_0x5ba1ef[_0x47c961(0x10d)]===_0x47c961(0x10b)||_0x5ba1ef[_0x47c961(0x10d)]===_0x47c961(0xd9)||_0x5ba1ef[_0x47c961(0x10d)]==='tsv'){const _0x55161c=_0x2def05[_0x47c961(0xb5)](_0x15f934=>({'id':_0x15f934['id'],'name':_0x15f934[_0x47c961(0xce)],'cron':_0x15f934[_0x47c961(0x115)],'database':_0x15f934['database']?.[_0x47c961(0xce)],'type':_0x15f934[_0x47c961(0xcd)],'timezone':_0x15f934[_0x47c961(0xbf)],'user_name':_0x15f934['user']?.[_0x47c961(0xce)],'updated_at':_0x15f934[_0x47c961(0xe2)],'next_run_at':_0x15f934['next_run_at'],'last_job_status':_0x15f934['last_job']?.[_0x47c961(0xac)]}));await handleSDKOutput(_0x55161c,_0x5ba1ef);}else{if(_0x2def05[_0x47c961(0xa8)]===0x0)console[_0x47c961(0xfc)](_0x47c961(0xbb));else{const _0x5bc618=_0x5ba1ef[_0x47c961(0xa0)],_0x4b44ac=_0x2def05[_0x47c961(0xb5)](_0x37515c=>{const _0x1b0030=_0x47c961,_0x5b36fa=_0x37515c[_0x1b0030(0xa4)]?.[_0x1b0030(0xac)]?_0x37515c[_0x1b0030(0xa4)][_0x1b0030(0xac)]==='success'?'βœ“':'βœ—':'-',_0x4915a0=_0x37515c[_0x1b0030(0xa4)]?.[_0x1b0030(0x9f)]?formatRelativeTime(_0x37515c['last_job'][_0x1b0030(0x9f)]):'never',_0x13e1ed=_0x37515c[_0x1b0030(0xa6)]?formatRelativeTime(_0x37515c[_0x1b0030(0xa6)]):'-',_0x3f8805=_0x37515c[_0x1b0030(0x115)]||'',_0x4a39c2=_0x37515c['name']||_0x1b0030(0xd3),_0x44a8ed=getConsoleUrl(_0x5bc618,_0x1b0030(0x119)+_0x37515c['id']);return{'statusIcon':_0x5b36fa,'lastRun':_0x4915a0,'nextRun':_0x13e1ed,'cron':_0x3f8805,'name':_0x4a39c2,'queryUrl':_0x44a8ed,'status':_0x37515c['last_job']?.[_0x1b0030(0xac)]};}),_0x8631c2=Math[_0x47c961(0xf2)](..._0x4b44ac[_0x47c961(0xb5)](_0x5e216f=>_0x5e216f[_0x47c961(0xa5)][_0x47c961(0xa8)])),_0x4f4a56=Math[_0x47c961(0xf2)](..._0x4b44ac[_0x47c961(0xb5)](_0x306054=>_0x306054['nextRun'][_0x47c961(0xa8)])),_0x19b72b=Math[_0x47c961(0xf2)](..._0x4b44ac[_0x47c961(0xb5)](_0x3e5abc=>_0x3e5abc[_0x47c961(0x115)][_0x47c961(0xa8)])),_0x33d4cd=_0x4b44ac[_0x47c961(0xb5)](_0x86c5df=>{const _0x31bb1e=_0x47c961,_0x16c32b=_0x86c5df['status']===_0x31bb1e(0xd8)?a30_0x2917ba[_0x31bb1e(0x104)](_0x86c5df['statusIcon']):_0x86c5df['status']==='error'?a30_0x2917ba[_0x31bb1e(0xd6)](_0x86c5df[_0x31bb1e(0xc4)]):a30_0x2917ba['dim'](_0x86c5df[_0x31bb1e(0xc4)]),_0x58def1=_0x86c5df[_0x31bb1e(0xa5)]['padEnd'](_0x8631c2),_0x51db29=_0x86c5df[_0x31bb1e(0x101)][_0x31bb1e(0xb9)](_0x4f4a56),_0x15b92c=_0x86c5df[_0x31bb1e(0x115)]?a30_0x2917ba[_0x31bb1e(0xca)](_0x86c5df[_0x31bb1e(0x115)]['padEnd'](_0x19b72b)):'\x20'['repeat'](_0x19b72b),_0xc8063b=hyperlink(_0x86c5df[_0x31bb1e(0xce)],_0x86c5df[_0x31bb1e(0xed)]);return _0x31bb1e(0x9d)+_0x16c32b+'\x20'+_0x58def1+_0x31bb1e(0xc0)+_0x51db29+'\x20\x20'+_0x15b92c+'\x20\x20'+_0xc8063b;});await writeOutput(_0x33d4cd[_0x47c961(0xf7)]('\x0a'),_0x5ba1ef[_0x47c961(0xe1)],_0x47c961(0xcc));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a30_0x1ff8d3(0xce)]='schedule:show';['description']=a30_0x1ff8d3(0x10a);[a30_0x1ff8d3(0xd7)](_0x4a14c4){const _0x2e1677=a30_0x1ff8d3,_0x5543fa=_0x4a14c4[_0x2e1677(0xfb)][0x0];if(!_0x5543fa)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a30_0x1ff8d3(0xb1)](_0x4ae9d0){const _0x383fdd=a30_0x1ff8d3,{options:_0x4ee797,args:_0xee18f7,tdx:_0x22572a}=_0x4ae9d0,_0xa8fac1=_0xee18f7[0x0],_0x56fb5d=await withSpinner(_0x383fdd(0xec),()=>_0x22572a[_0x383fdd(0xea)][_0x383fdd(0xcf)](_0xa8fac1),{'verbose':_0x4ee797[_0x383fdd(0x123)]}),_0x4f9bd9=_0x56fb5d['data'],_0x383f79={'name':_0x4f9bd9[_0x383fdd(0xce)],'cron':_0x4f9bd9['cron'],'database':_0x4f9bd9[_0x383fdd(0xf3)],'type':_0x4f9bd9['type'],'timezone':_0x4f9bd9[_0x383fdd(0xc2)],'user_name':_0x4f9bd9[_0x383fdd(0xdc)],'created_at':_0x4f9bd9[_0x383fdd(0xb6)],'engine_version':_0x4f9bd9[_0x383fdd(0xc9)],'executing_user_id':_0x4f9bd9['executing_user_id'],'query':_0x4f9bd9['query'],'delay':_0x4f9bd9[_0x383fdd(0xd4)],'priority':_0x4f9bd9[_0x383fdd(0x11f)],'retry_limit':_0x4f9bd9[_0x383fdd(0xa9)],..._0x4f9bd9['result']&&{'result':_0x4f9bd9[_0x383fdd(0xa1)]}};return await handleSingleObjectOutput(_0x383f79,_0x4ee797),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a30_0x1ff8d3(0xaf);[a30_0x1ff8d3(0x11d)]=a30_0x1ff8d3(0xc1);[a30_0x1ff8d3(0xd7)](_0x58d77b){const _0x1248f2=a30_0x1ff8d3,_0xd9837e=_0x58d77b[_0x1248f2(0xfb)][0x0];if(!_0xd9837e)return _0x1248f2(0x114);const _0x499af8=_0x58d77b[_0x1248f2(0x11b)];if(!_0x499af8[_0x1248f2(0xf3)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a30_0x1ff8d3(0xb1)](_0x472b90){const _0x543110=a30_0x1ff8d3,{options:_0x56fcd4,args:_0x47192a,tdx:_0x40db99}=_0x472b90,_0x488694=_0x47192a[0x0],_0x5944bf=_0x56fcd4,_0x2a04e5=_0x5944bf[_0x543110(0xf3)],_0x242a3d=_0x5944bf['file'],_0x1897ab=_0x5944bf['type']||_0x543110(0xdf);let _0x33e0ef;try{_0x33e0ef=readFileSync(_0x242a3d,'utf-8')['trim']();}catch(_0x3f633d){throw new SDKError(ErrorCode[_0x543110(0x10f)],_0x543110(0x118)+_0x242a3d,_0x3f633d instanceof Error?_0x3f633d:undefined);}if(!_0x33e0ef)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x543110(0x121));const _0x10ca90={'database':_0x2a04e5,'query':_0x33e0ef,'type':_0x1897ab};if(_0x5944bf[_0x543110(0x115)])_0x10ca90[_0x543110(0x115)]=_0x5944bf[_0x543110(0x115)];if(_0x5944bf[_0x543110(0xc2)])_0x10ca90[_0x543110(0xc2)]=_0x5944bf['timezone'];if(_0x5944bf[_0x543110(0xd4)]!==undefined)_0x10ca90['delay']=Number(_0x5944bf[_0x543110(0xd4)]);if(_0x5944bf['priority']!==undefined)_0x10ca90['priority']=Number(_0x5944bf[_0x543110(0x11f)]);if(_0x5944bf[_0x543110(0x112)]!==undefined)_0x10ca90[_0x543110(0xa9)]=Number(_0x5944bf[_0x543110(0x112)]);if(_0x5944bf['engineVersion'])_0x10ca90[_0x543110(0xc9)]=_0x5944bf['engineVersion'];if(_0x5944bf[_0x543110(0xa1)])_0x10ca90[_0x543110(0xa1)]=_0x5944bf[_0x543110(0xa1)];if(_0x56fcd4[_0x543110(0x123)]){console[_0x543110(0x110)](_0x543110(0xf5)+_0x488694),console[_0x543110(0x110)](_0x543110(0xb8)+_0x2a04e5),console[_0x543110(0x110)](_0x543110(0x124)+_0x1897ab);if(_0x10ca90[_0x543110(0x115)])console['error']('\x20\x20Cron:\x20'+_0x10ca90[_0x543110(0x115)]);if(_0x10ca90[_0x543110(0xc2)])console['error']('\x20\x20Timezone:\x20'+_0x10ca90[_0x543110(0xc2)]);}const _0x4d2774=await withSpinner('Creating\x20schedule...',()=>_0x40db99[_0x543110(0xea)][_0x543110(0xee)](_0x488694,_0x10ca90),{'verbose':_0x56fcd4[_0x543110(0x123)]});return console[_0x543110(0x110)](_0x543110(0xc5)+_0x4d2774[_0x543110(0xc7)]['name']),await handleSingleObjectOutput(_0x4d2774[_0x543110(0xc7)],_0x56fcd4),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']='schedule:update';['description']=a30_0x1ff8d3(0xe9);[a30_0x1ff8d3(0xd7)](_0x2146ef){const _0x509bb3=a30_0x1ff8d3,_0x24ca7b=_0x2146ef[_0x509bb3(0xfb)][0x0];if(!_0x24ca7b)return _0x509bb3(0xde);return undefined;}async[a30_0x1ff8d3(0xb1)](_0x3e94fa){const _0x56d7a4=a30_0x1ff8d3,{options:_0x3042eb,args:_0x5ee3ad,tdx:_0x5d84f1}=_0x3e94fa,_0x46fe00=_0x5ee3ad[0x0],_0x34580c=_0x3042eb,_0x2aae47={};if(_0x34580c['database'])_0x2aae47[_0x56d7a4(0xf3)]=_0x34580c['database'];if(_0x34580c[_0x56d7a4(0xcd)])_0x2aae47[_0x56d7a4(0xcd)]=_0x34580c[_0x56d7a4(0xcd)];if(_0x34580c['cron'])_0x2aae47[_0x56d7a4(0x115)]=_0x34580c['cron'];if(_0x34580c[_0x56d7a4(0xc2)])_0x2aae47[_0x56d7a4(0xc2)]=_0x34580c['timezone'];if(_0x34580c[_0x56d7a4(0xd4)]!==undefined)_0x2aae47[_0x56d7a4(0xd4)]=Number(_0x34580c[_0x56d7a4(0xd4)]);if(_0x34580c[_0x56d7a4(0x11f)]!==undefined)_0x2aae47[_0x56d7a4(0x11f)]=Number(_0x34580c[_0x56d7a4(0x11f)]);if(_0x34580c[_0x56d7a4(0x112)]!==undefined)_0x2aae47[_0x56d7a4(0xa9)]=Number(_0x34580c[_0x56d7a4(0x112)]);if(_0x34580c[_0x56d7a4(0xdb)])_0x2aae47[_0x56d7a4(0xc9)]=_0x34580c[_0x56d7a4(0xdb)];if(_0x34580c['result'])_0x2aae47['result']=_0x34580c['result'];if(_0x34580c[_0x56d7a4(0x116)])try{_0x2aae47[_0x56d7a4(0x111)]=readFileSync(_0x34580c[_0x56d7a4(0x116)],'utf-8')[_0x56d7a4(0x105)]();}catch(_0x5958b2){throw new SDKError(ErrorCode[_0x56d7a4(0x10f)],'Failed\x20to\x20read\x20file:\x20'+_0x34580c['file'],_0x5958b2 instanceof Error?_0x5958b2:undefined);}if(Object[_0x56d7a4(0xfe)](_0x2aae47)[_0x56d7a4(0xa8)]===0x0)throw new SDKError(ErrorCode[_0x56d7a4(0x10f)],_0x56d7a4(0xbc));if(_0x3042eb[_0x56d7a4(0x123)]){console['error'](_0x56d7a4(0x126)+_0x46fe00);for(const [_0x496e68,_0x3fd7c7]of Object[_0x56d7a4(0xb0)](_0x2aae47)){_0x496e68===_0x56d7a4(0x111)?console['error']('\x20\x20'+_0x496e68+':\x20'+_0x3fd7c7[_0x56d7a4(0x11e)](0x0,0x32)+_0x56d7a4(0x102)):console[_0x56d7a4(0x110)]('\x20\x20'+_0x496e68+':\x20'+_0x3fd7c7);}}const _0x193afb=await withSpinner('Updating\x20schedule...',()=>_0x5d84f1['schedules']['update'](_0x46fe00,_0x2aae47),{'verbose':_0x3042eb[_0x56d7a4(0x123)]});return console['error']('Schedule\x20updated:\x20'+_0x193afb['data'][_0x56d7a4(0xce)]),await handleSingleObjectOutput(_0x193afb[_0x56d7a4(0xc7)],_0x3042eb),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a30_0x1ff8d3(0xae);[a30_0x1ff8d3(0x11d)]=a30_0x1ff8d3(0xe8);[a30_0x1ff8d3(0xd7)](_0x1f7914){const _0x332623=a30_0x1ff8d3,_0x1cc136=_0x1f7914[_0x332623(0xfb)][0x0];if(!_0x1cc136)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a30_0x1ff8d3(0xb1)](_0x35438c){const _0x319027=a30_0x1ff8d3,{options:_0x2a8c01,args:_0x1f5a55,tdx:_0x4731ae}=_0x35438c,_0x4ff049=_0x1f5a55[0x0];if(!_0x2a8c01[_0x319027(0xf0)]){const _0x2ad118=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x4ff049+'\x22?');if(!_0x2ad118)return console['error'](_0x319027(0xa2)),0x0;}const _0x266537=await withSpinner('Deleting\x20schedule...',()=>_0x4731ae[_0x319027(0xea)][_0x319027(0xdd)](_0x4ff049),{'verbose':_0x2a8c01[_0x319027(0x123)]});return console[_0x319027(0x110)](_0x319027(0xe0)+_0x266537[_0x319027(0xc7)][_0x319027(0xce)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a30_0x1ff8d3(0xce)]='schedule:run';[a30_0x1ff8d3(0x11d)]=a30_0x1ff8d3(0xb7);[a30_0x1ff8d3(0xd7)](_0x29d26f){const _0xd3bc89=a30_0x1ff8d3,_0x1bc937=_0x29d26f[_0xd3bc89(0xfb)][0x0];if(!_0x1bc937)return _0xd3bc89(0xff);return undefined;}async[a30_0x1ff8d3(0xb1)](_0x5c1af3){const _0x53006b=a30_0x1ff8d3,{options:_0x2a12b2,args:_0x30946d,tdx:_0x240d68}=_0x5c1af3,_0xe47a4e=_0x30946d[0x0],_0x222ae7=_0x2a12b2,_0x3bd566=_0x222ae7[_0x53006b(0xd0)],_0x4b2d19=_0x222ae7[_0x53006b(0xbd)]!==undefined?Number(_0x222ae7[_0x53006b(0xbd)]):undefined;if(_0x2a12b2[_0x53006b(0x123)]){console[_0x53006b(0x110)](_0x53006b(0x12a)+_0xe47a4e);if(_0x3bd566)console[_0x53006b(0x110)](_0x53006b(0xa7)+_0x3bd566);if(_0x4b2d19)console[_0x53006b(0x110)]('\x20\x20Num:\x20'+_0x4b2d19);}const _0x1ee627=await withSpinner(_0x53006b(0xf9),()=>_0x240d68['schedules'][_0x53006b(0xe5)](_0xe47a4e,{'time':_0x3bd566,'num':_0x4b2d19}),{'verbose':_0x2a12b2['verbose']}),_0x360538=_0x1ee627[_0x53006b(0xc7)][_0x53006b(0xb4)];console[_0x53006b(0x110)](_0x53006b(0x113)+_0x360538[_0x53006b(0xa8)]+'\x20job'+(_0x360538[_0x53006b(0xa8)]!==0x1?'s':'')+_0x53006b(0xeb));for(const _0x3c02f4 of _0x360538){console[_0x53006b(0x110)](_0x53006b(0x117)+_0x3c02f4['job_id']);}return await handleSDKOutput(_0x360538,_0x2a12b2),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']=a30_0x1ff8d3(0xb3);[a30_0x1ff8d3(0x11d)]=a30_0x1ff8d3(0xe6);[a30_0x1ff8d3(0xd7)](_0x285136){const _0x53e56f=a30_0x1ff8d3,_0x1d1090=_0x285136[_0x53e56f(0xfb)][0x0];if(!_0x1d1090)return _0x53e56f(0xad);return undefined;}async[a30_0x1ff8d3(0xb1)](_0x4f8eb2){const _0x26bc97=a30_0x1ff8d3,{options:_0x3e0831,args:_0x2e7314,tdx:_0x15f129}=_0x4f8eb2,_0x33bfea=_0x2e7314[0x0],_0x1b0836=_0x3e0831,_0x26e971=_0x1b0836[_0x26bc97(0x9c)]!==undefined?Number(_0x1b0836[_0x26bc97(0x9c)]):undefined,_0x412a2f=_0x1b0836['to']!==undefined?Number(_0x1b0836['to']):undefined,_0x5a7f83=await withSpinner(_0x26bc97(0xf1),()=>_0x15f129[_0x26bc97(0xea)][_0x26bc97(0xab)](_0x33bfea,{'from':_0x26e971,'to':_0x412a2f}),{'verbose':_0x3e0831[_0x26bc97(0x123)]}),_0xadea98=_0x5a7f83['data'];console[_0x26bc97(0x110)]('Found\x20'+_0xadea98[_0x26bc97(0x129)]+'\x20execution'+(_0xadea98[_0x26bc97(0x129)]!==0x1?'s':'')+'\x20(showing\x20'+_0xadea98['from']+'-'+_0xadea98['to']+')');const _0x485b74=_0xadea98[_0x26bc97(0xab)][_0x26bc97(0xb5)](_0x3924b9=>({'job_id':_0x3924b9[_0x26bc97(0xf6)],'type':_0x3924b9[_0x26bc97(0xcd)],'status':_0x3924b9[_0x26bc97(0xac)],'scheduled_at':_0x3924b9[_0x26bc97(0x107)],'created_at':_0x3924b9[_0x26bc97(0xb6)],'start_at':_0x3924b9[_0x26bc97(0xbe)],'end_at':_0x3924b9['end_at']}));return await handleSDKOutput(_0x485b74,_0x3e0831),0x0;}}
1
+ const a30_0x431347=a30_0x5afa;function a30_0x5afa(_0x39c6f4,_0x2d9456){_0x39c6f4=_0x39c6f4-0x1ee;const _0x3deafa=a30_0x3dea();let _0x5afaaf=_0x3deafa[_0x39c6f4];return _0x5afaaf;}(function(_0xb6f16b,_0x452e75){const _0x3c1fc9=a30_0x5afa,_0x37208d=_0xb6f16b();while(!![]){try{const _0x973721=parseInt(_0x3c1fc9(0x1fe))/0x1+-parseInt(_0x3c1fc9(0x205))/0x2+parseInt(_0x3c1fc9(0x227))/0x3+-parseInt(_0x3c1fc9(0x216))/0x4*(parseInt(_0x3c1fc9(0x1f2))/0x5)+parseInt(_0x3c1fc9(0x225))/0x6+-parseInt(_0x3c1fc9(0x212))/0x7+parseInt(_0x3c1fc9(0x20a))/0x8*(parseInt(_0x3c1fc9(0x236))/0x9);if(_0x973721===_0x452e75)break;else _0x37208d['push'](_0x37208d['shift']());}catch(_0x3b3b49){_0x37208d['push'](_0x37208d['shift']());}}}(a30_0x3dea,0x82e74));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a30_0x3dea(){const _0x30b545=['success','Getting\x20schedule\x20details...','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','(unnamed)','format','schedule:delete','Getting\x20schedule\x20history...','\x20\x20Timezone:\x20','start_at','next_run_at','trim','\x20execution','repeat','\x20scheduled\x20quer','\x20(showing\x20','file','map','database','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','\x22...','schedule:show','timezone','updated_at','run','List\x20scheduled\x20queries','padEnd','retry_limit','\x20(use\x20--limit\x20to\x20see\x20more)','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','list','num','from','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Delete\x20a\x20scheduled\x20query','tsv','schedules','\x20\x20Cron:\x20','ended_at','395TjSjzQ','\x20schedules','join','limit','type','job_id','in\x20','verbose','\x20job','Searching\x20scheduled\x20queries\x20matching\x20\x22','time','h\x20ago','331990aIVFgI','result','nextRun','\x20\x20Job\x20ID:\x20','Creating\x20schedule:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','schedule:history','1974946uvNNbn','priority','INVALID_ARGUMENT','validate','history','139864cMsGbQ','last_job','queries','description','site','options','args','/app/queries/editor?queryId=','6441218LGfUaW','max','toLocaleDateString','Show\x20schedule\x20details','15508TxotNc','\x20\x20Time:\x20','red','query','keys','Showing\x20first\x20','soon','\x20\x20Database:\x20','Update\x20a\x20scheduled\x20query','log','json','ies','lastRun','\x20\x20Num:\x20','created_at','4470600MCoVsz','count','1032936hKrhEf','queryUrl','Running\x20schedule...','Updating\x20schedule:\x20','schedule:run','dim','engineVersion','yes','length','name','utf-8','m\x20ago','listQueries','data','user_name','684GjGaMv','Failed\x20to\x20read\x20file:\x20','Running\x20schedule:\x20','retryLimit','...','Schedule\x20created:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Updating\x20schedule...','delay','Cancelled','Creating\x20schedule...','never','\x20\x20Type:\x20','execute','schedule:list','engine_version','statusIcon','cron','Schedule\x20updated:\x20','Create\x20a\x20scheduled\x20query','scheduled_at','getTime','status','user','error','create','cyan','Schedule\x20run\x20submitted:\x20','round'];a30_0x3dea=function(){return _0x30b545;};return a30_0x3dea();}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_0x4de705 from'chalk';function formatRelativeTime(_0x3fe370){const _0x2bc9ac=a30_0x5afa,_0x5896d0=new Date(_0x3fe370),_0x1a56ec=new Date(),_0x3ab00c=_0x5896d0[_0x2bc9ac(0x24b)]()-_0x1a56ec['getTime'](),_0x50b971=Math['abs'](_0x3ab00c)/0x3e8,_0x112383=_0x3ab00c<0x0;if(_0x50b971<0x3c)return _0x112383?'just\x20now':_0x2bc9ac(0x21c);else{if(_0x50b971<0xe10){const _0x101d0d=Math['round'](_0x50b971/0x3c);return _0x112383?_0x101d0d+_0x2bc9ac(0x232):'in\x20'+_0x101d0d+'m';}else{if(_0x50b971<0x15180){const _0x5790de=Math['round'](_0x50b971/0xe10);return _0x112383?_0x5790de+_0x2bc9ac(0x1fd):_0x2bc9ac(0x1f8)+_0x5790de+'h';}else{if(_0x50b971<0x93a80){const _0x3e841a=Math[_0x2bc9ac(0x252)](_0x50b971/0x15180);return _0x112383?_0x3e841a+'d\x20ago':_0x2bc9ac(0x1f8)+_0x3e841a+'d';}else return _0x5896d0[_0x2bc9ac(0x214)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x431347(0x230)]=a30_0x431347(0x244);['description']=a30_0x431347(0x26b);async['execute'](_0xdc3ae2){const _0x3d9df0=a30_0x431347,{options:_0x2eca24,args:_0x5083af,tdx:_0x400471}=_0xdc3ae2,_0x367d36=resolveLimit(_0x2eca24[_0x3d9df0(0x1f5)],DEFAULT_DISPLAY_LIMIT),_0x318842=_0x5083af[0x0],_0x87166e=_0x318842?_0x3d9df0(0x1fb)+_0x318842+_0x3d9df0(0x266):'Listing\x20scheduled\x20queries...',_0x169a69=await withSpinner(_0x87166e,()=>_0x400471[_0x3d9df0(0x1ef)][_0x3d9df0(0x233)]({'limit':_0x367d36,'scheduled':!![],'pattern':_0x318842}),{'verbose':_0x2eca24[_0x3d9df0(0x1f9)]}),_0xa08b6a=_0x169a69['data'][_0x3d9df0(0x20c)],_0x5ea267=_0x169a69[_0x3d9df0(0x234)]['pagination']['has_next_page'],_0x5994a8=_0x318842?'\x20matching\x20\x22'+_0x318842+'\x22':'';_0x5ea267?console[_0x3d9df0(0x24e)](_0x3d9df0(0x21b)+_0xa08b6a[_0x3d9df0(0x22f)]+_0x3d9df0(0x1f3)+_0x5994a8+_0x3d9df0(0x26e)):console[_0x3d9df0(0x24e)]('Found\x20'+_0xa08b6a[_0x3d9df0(0x22f)]+_0x3d9df0(0x260)+(_0xa08b6a[_0x3d9df0(0x22f)]!==0x1?_0x3d9df0(0x221):'y')+_0x5994a8);if(_0x2eca24[_0x3d9df0(0x257)]===_0x3d9df0(0x220)||_0x2eca24['format']==='jsonl'||_0x2eca24[_0x3d9df0(0x257)]==='table'||_0x2eca24[_0x3d9df0(0x257)]===_0x3d9df0(0x1ee)){const _0x52c4d3=_0xa08b6a[_0x3d9df0(0x263)](_0x35d1ad=>({'id':_0x35d1ad['id'],'name':_0x35d1ad['name'],'cron':_0x35d1ad[_0x3d9df0(0x247)],'database':_0x35d1ad['database']?.[_0x3d9df0(0x230)],'type':_0x35d1ad[_0x3d9df0(0x1f6)],'timezone':_0x35d1ad['time_zone'],'user_name':_0x35d1ad[_0x3d9df0(0x24d)]?.[_0x3d9df0(0x230)],'updated_at':_0x35d1ad[_0x3d9df0(0x269)],'next_run_at':_0x35d1ad[_0x3d9df0(0x25c)],'last_job_status':_0x35d1ad[_0x3d9df0(0x20b)]?.[_0x3d9df0(0x24c)]}));await handleSDKOutput(_0x52c4d3,_0x2eca24);}else{if(_0xa08b6a[_0x3d9df0(0x22f)]===0x0)console[_0x3d9df0(0x21f)]('No\x20scheduled\x20queries\x20found');else{const _0x2992fa=_0x2eca24[_0x3d9df0(0x20e)],_0x14186c=_0xa08b6a['map'](_0xd36e2=>{const _0x54cacb=_0x3d9df0,_0x2a48eb=_0xd36e2[_0x54cacb(0x20b)]?.[_0x54cacb(0x24c)]?_0xd36e2[_0x54cacb(0x20b)][_0x54cacb(0x24c)]===_0x54cacb(0x253)?'βœ“':'βœ—':'-',_0x37ace9=_0xd36e2[_0x54cacb(0x20b)]?.['ended_at']?formatRelativeTime(_0xd36e2[_0x54cacb(0x20b)][_0x54cacb(0x1f1)]):_0x54cacb(0x241),_0x348f3d=_0xd36e2[_0x54cacb(0x25c)]?formatRelativeTime(_0xd36e2[_0x54cacb(0x25c)]):'-',_0x1625b8=_0xd36e2[_0x54cacb(0x247)]||'',_0x11f78f=_0xd36e2[_0x54cacb(0x230)]||_0x54cacb(0x256),_0x467d0d=getConsoleUrl(_0x2992fa,_0x54cacb(0x211)+_0xd36e2['id']);return{'statusIcon':_0x2a48eb,'lastRun':_0x37ace9,'nextRun':_0x348f3d,'cron':_0x1625b8,'name':_0x11f78f,'queryUrl':_0x467d0d,'status':_0xd36e2[_0x54cacb(0x20b)]?.[_0x54cacb(0x24c)]};}),_0x35baec=Math[_0x3d9df0(0x213)](..._0x14186c[_0x3d9df0(0x263)](_0x924972=>_0x924972[_0x3d9df0(0x222)]['length'])),_0xbc650b=Math['max'](..._0x14186c['map'](_0x301ef5=>_0x301ef5[_0x3d9df0(0x200)][_0x3d9df0(0x22f)])),_0xe95301=Math[_0x3d9df0(0x213)](..._0x14186c[_0x3d9df0(0x263)](_0x487715=>_0x487715['cron'][_0x3d9df0(0x22f)])),_0x348b37=_0x14186c[_0x3d9df0(0x263)](_0x473581=>{const _0x60b901=_0x3d9df0,_0x94f086=_0x473581[_0x60b901(0x24c)]===_0x60b901(0x253)?a30_0x4de705['green'](_0x473581[_0x60b901(0x246)]):_0x473581[_0x60b901(0x24c)]===_0x60b901(0x24e)?a30_0x4de705[_0x60b901(0x218)](_0x473581[_0x60b901(0x246)]):a30_0x4de705[_0x60b901(0x22c)](_0x473581[_0x60b901(0x246)]),_0x1f6bab=_0x473581['lastRun'][_0x60b901(0x26c)](_0x35baec),_0x295f0d=_0x473581['nextRun'][_0x60b901(0x26c)](_0xbc650b),_0x1c466d=_0x473581[_0x60b901(0x247)]?a30_0x4de705[_0x60b901(0x250)](_0x473581[_0x60b901(0x247)]['padEnd'](_0xe95301)):'\x20'[_0x60b901(0x25f)](_0xe95301),_0x3da297=hyperlink(_0x473581[_0x60b901(0x230)],_0x473581[_0x60b901(0x228)]);return'πŸ“…\x20'+_0x94f086+'\x20'+_0x1f6bab+'\x20\x20β†’\x20'+_0x295f0d+'\x20\x20'+_0x1c466d+'\x20\x20'+_0x3da297;});await writeOutput(_0x348b37[_0x3d9df0(0x1f4)]('\x0a'),_0x2eca24['output'],_0x3d9df0(0x270));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a30_0x431347(0x230)]=a30_0x431347(0x267);[a30_0x431347(0x20d)]=a30_0x431347(0x215);[a30_0x431347(0x208)](_0x491231){const _0x3a350e=a30_0x431347,_0x4e046e=_0x491231[_0x3a350e(0x210)][0x0];if(!_0x4e046e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a30_0x431347(0x243)](_0x3b73a2){const _0x2650d7=a30_0x431347,{options:_0x301288,args:_0x3f1f0a,tdx:_0x93dce1}=_0x3b73a2,_0x3f4d3b=_0x3f1f0a[0x0],_0x5f57b0=await withSpinner(_0x2650d7(0x254),()=>_0x93dce1['schedules']['show'](_0x3f4d3b),{'verbose':_0x301288[_0x2650d7(0x1f9)]}),_0x4c54d3=_0x5f57b0[_0x2650d7(0x234)],_0x9eeb82={'name':_0x4c54d3[_0x2650d7(0x230)],'cron':_0x4c54d3[_0x2650d7(0x247)],'database':_0x4c54d3[_0x2650d7(0x264)],'type':_0x4c54d3[_0x2650d7(0x1f6)],'timezone':_0x4c54d3[_0x2650d7(0x268)],'user_name':_0x4c54d3[_0x2650d7(0x235)],'created_at':_0x4c54d3[_0x2650d7(0x224)],'engine_version':_0x4c54d3[_0x2650d7(0x245)],'executing_user_id':_0x4c54d3['executing_user_id'],'query':_0x4c54d3['query'],'delay':_0x4c54d3['delay'],'priority':_0x4c54d3[_0x2650d7(0x206)],'retry_limit':_0x4c54d3['retry_limit'],..._0x4c54d3[_0x2650d7(0x1ff)]&&{'result':_0x4c54d3[_0x2650d7(0x1ff)]}};return await handleSingleObjectOutput(_0x9eeb82,_0x301288),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x431347(0x230)]='schedule:create';[a30_0x431347(0x20d)]=a30_0x431347(0x249);[a30_0x431347(0x208)](_0xfeae7f){const _0x25a73e=a30_0x431347,_0x4f4e5d=_0xfeae7f[_0x25a73e(0x210)][0x0];if(!_0x4f4e5d)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x112aaf=_0xfeae7f[_0x25a73e(0x20f)];if(!_0x112aaf[_0x25a73e(0x264)])return _0x25a73e(0x26f);return undefined;}async['execute'](_0x32875b){const _0x1d368f=a30_0x431347,{options:_0x11004f,args:_0xd6d45c,tdx:_0x418476}=_0x32875b,_0x1dc349=_0xd6d45c[0x0],_0x1230c5=_0x11004f,_0x1735e7=_0x1230c5[_0x1d368f(0x264)],_0x2df3e2=_0x1230c5['file'],_0x364265=_0x1230c5['type']||'trino';let _0x2a68dd;try{_0x2a68dd=readFileSync(_0x2df3e2,'utf-8')['trim']();}catch(_0x5ab65f){throw new SDKError(ErrorCode[_0x1d368f(0x207)],_0x1d368f(0x237)+_0x2df3e2,_0x5ab65f instanceof Error?_0x5ab65f:undefined);}if(!_0x2a68dd)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20file\x20is\x20empty');const _0x5a9e17={'database':_0x1735e7,'query':_0x2a68dd,'type':_0x364265};if(_0x1230c5[_0x1d368f(0x247)])_0x5a9e17[_0x1d368f(0x247)]=_0x1230c5[_0x1d368f(0x247)];if(_0x1230c5[_0x1d368f(0x268)])_0x5a9e17[_0x1d368f(0x268)]=_0x1230c5[_0x1d368f(0x268)];if(_0x1230c5['delay']!==undefined)_0x5a9e17[_0x1d368f(0x23e)]=Number(_0x1230c5[_0x1d368f(0x23e)]);if(_0x1230c5['priority']!==undefined)_0x5a9e17[_0x1d368f(0x206)]=Number(_0x1230c5[_0x1d368f(0x206)]);if(_0x1230c5[_0x1d368f(0x239)]!==undefined)_0x5a9e17[_0x1d368f(0x26d)]=Number(_0x1230c5[_0x1d368f(0x239)]);if(_0x1230c5['engineVersion'])_0x5a9e17[_0x1d368f(0x245)]=_0x1230c5[_0x1d368f(0x22d)];if(_0x1230c5[_0x1d368f(0x1ff)])_0x5a9e17[_0x1d368f(0x1ff)]=_0x1230c5['result'];if(_0x11004f['verbose']){console[_0x1d368f(0x24e)](_0x1d368f(0x202)+_0x1dc349),console[_0x1d368f(0x24e)](_0x1d368f(0x21d)+_0x1735e7),console['error'](_0x1d368f(0x242)+_0x364265);if(_0x5a9e17[_0x1d368f(0x247)])console[_0x1d368f(0x24e)](_0x1d368f(0x1f0)+_0x5a9e17[_0x1d368f(0x247)]);if(_0x5a9e17['timezone'])console['error'](_0x1d368f(0x25a)+_0x5a9e17[_0x1d368f(0x268)]);}const _0x4d6ba8=await withSpinner(_0x1d368f(0x240),()=>_0x418476['schedules'][_0x1d368f(0x24f)](_0x1dc349,_0x5a9e17),{'verbose':_0x11004f[_0x1d368f(0x1f9)]});return console[_0x1d368f(0x24e)](_0x1d368f(0x23b)+_0x4d6ba8[_0x1d368f(0x234)]['name']),await handleSingleObjectOutput(_0x4d6ba8['data'],_0x11004f),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x431347(0x230)]='schedule:update';[a30_0x431347(0x20d)]=a30_0x431347(0x21e);[a30_0x431347(0x208)](_0x1d85a2){const _0x472d26=a30_0x431347,_0x1da176=_0x1d85a2[_0x472d26(0x210)][0x0];if(!_0x1da176)return _0x472d26(0x265);return undefined;}async[a30_0x431347(0x243)](_0x46aea9){const _0x4d131a=a30_0x431347,{options:_0x1b2b11,args:_0x8c4945,tdx:_0x42e93d}=_0x46aea9,_0x31f7c5=_0x8c4945[0x0],_0x393157=_0x1b2b11,_0x4fd63c={};if(_0x393157[_0x4d131a(0x264)])_0x4fd63c[_0x4d131a(0x264)]=_0x393157[_0x4d131a(0x264)];if(_0x393157[_0x4d131a(0x1f6)])_0x4fd63c[_0x4d131a(0x1f6)]=_0x393157[_0x4d131a(0x1f6)];if(_0x393157['cron'])_0x4fd63c[_0x4d131a(0x247)]=_0x393157[_0x4d131a(0x247)];if(_0x393157[_0x4d131a(0x268)])_0x4fd63c[_0x4d131a(0x268)]=_0x393157[_0x4d131a(0x268)];if(_0x393157['delay']!==undefined)_0x4fd63c[_0x4d131a(0x23e)]=Number(_0x393157[_0x4d131a(0x23e)]);if(_0x393157[_0x4d131a(0x206)]!==undefined)_0x4fd63c[_0x4d131a(0x206)]=Number(_0x393157[_0x4d131a(0x206)]);if(_0x393157['retryLimit']!==undefined)_0x4fd63c[_0x4d131a(0x26d)]=Number(_0x393157[_0x4d131a(0x239)]);if(_0x393157[_0x4d131a(0x22d)])_0x4fd63c['engine_version']=_0x393157[_0x4d131a(0x22d)];if(_0x393157['result'])_0x4fd63c['result']=_0x393157[_0x4d131a(0x1ff)];if(_0x393157[_0x4d131a(0x262)])try{_0x4fd63c[_0x4d131a(0x219)]=readFileSync(_0x393157[_0x4d131a(0x262)],_0x4d131a(0x231))[_0x4d131a(0x25d)]();}catch(_0x521fbd){throw new SDKError(ErrorCode[_0x4d131a(0x207)],'Failed\x20to\x20read\x20file:\x20'+_0x393157[_0x4d131a(0x262)],_0x521fbd instanceof Error?_0x521fbd:undefined);}if(Object[_0x4d131a(0x21a)](_0x4fd63c)[_0x4d131a(0x22f)]===0x0)throw new SDKError(ErrorCode[_0x4d131a(0x207)],_0x4d131a(0x255));if(_0x1b2b11[_0x4d131a(0x1f9)]){console[_0x4d131a(0x24e)](_0x4d131a(0x22a)+_0x31f7c5);for(const [_0x2d7471,_0x1816f0]of Object['entries'](_0x4fd63c)){_0x2d7471===_0x4d131a(0x219)?console[_0x4d131a(0x24e)]('\x20\x20'+_0x2d7471+':\x20'+_0x1816f0['substring'](0x0,0x32)+_0x4d131a(0x23a)):console[_0x4d131a(0x24e)]('\x20\x20'+_0x2d7471+':\x20'+_0x1816f0);}}const _0x22eb14=await withSpinner(_0x4d131a(0x23d),()=>_0x42e93d[_0x4d131a(0x1ef)]['update'](_0x31f7c5,_0x4fd63c),{'verbose':_0x1b2b11['verbose']});return console[_0x4d131a(0x24e)](_0x4d131a(0x248)+_0x22eb14[_0x4d131a(0x234)][_0x4d131a(0x230)]),await handleSingleObjectOutput(_0x22eb14[_0x4d131a(0x234)],_0x1b2b11),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x431347(0x230)]=a30_0x431347(0x258);['description']=a30_0x431347(0x274);['validate'](_0x34c717){const _0x35ab7d=a30_0x431347,_0x4797c4=_0x34c717[_0x35ab7d(0x210)][0x0];if(!_0x4797c4)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a30_0x431347(0x243)](_0x147e28){const _0x214a08=a30_0x431347,{options:_0x2c1d1f,args:_0x5bf15d,tdx:_0x1d96e0}=_0x147e28,_0x3e1892=_0x5bf15d[0x0];if(!_0x2c1d1f[_0x214a08(0x22e)]){const _0x5dd86b=await confirm(_0x214a08(0x23c)+_0x3e1892+'\x22?');if(!_0x5dd86b)return console['error'](_0x214a08(0x23f)),0x0;}const _0x4a180e=await withSpinner('Deleting\x20schedule...',()=>_0x1d96e0[_0x214a08(0x1ef)]['delete'](_0x3e1892),{'verbose':_0x2c1d1f[_0x214a08(0x1f9)]});return console['error']('Schedule\x20deleted:\x20'+_0x4a180e['data'][_0x214a08(0x230)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a30_0x431347(0x230)]=a30_0x431347(0x22b);['description']='Run\x20a\x20scheduled\x20query\x20immediately';[a30_0x431347(0x208)](_0x41d6b2){const _0x518f7b=a30_0x431347,_0xfc961a=_0x41d6b2[_0x518f7b(0x210)][0x0];if(!_0xfc961a)return _0x518f7b(0x203);return undefined;}async[a30_0x431347(0x243)](_0x283de7){const _0x435d74=a30_0x431347,{options:_0x262222,args:_0x1e5e95,tdx:_0x3a3f90}=_0x283de7,_0x23ca85=_0x1e5e95[0x0],_0x5480f8=_0x262222,_0x16eb25=_0x5480f8[_0x435d74(0x1fc)],_0x56bad0=_0x5480f8['num']!==undefined?Number(_0x5480f8[_0x435d74(0x271)]):undefined;if(_0x262222['verbose']){console['error'](_0x435d74(0x238)+_0x23ca85);if(_0x16eb25)console[_0x435d74(0x24e)](_0x435d74(0x217)+_0x16eb25);if(_0x56bad0)console[_0x435d74(0x24e)](_0x435d74(0x223)+_0x56bad0);}const _0x33738f=await withSpinner(_0x435d74(0x229),()=>_0x3a3f90[_0x435d74(0x1ef)][_0x435d74(0x26a)](_0x23ca85,{'time':_0x16eb25,'num':_0x56bad0}),{'verbose':_0x262222[_0x435d74(0x1f9)]}),_0x4b799e=_0x33738f[_0x435d74(0x234)]['jobs'];console[_0x435d74(0x24e)](_0x435d74(0x251)+_0x4b799e[_0x435d74(0x22f)]+_0x435d74(0x1fa)+(_0x4b799e[_0x435d74(0x22f)]!==0x1?'s':'')+'\x20created');for(const _0x1094e3 of _0x4b799e){console[_0x435d74(0x24e)](_0x435d74(0x201)+_0x1094e3[_0x435d74(0x1f7)]);}return await handleSDKOutput(_0x4b799e,_0x262222),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x431347(0x230)]=a30_0x431347(0x204);[a30_0x431347(0x20d)]='Show\x20schedule\x20execution\x20history';['validate'](_0x98f99f){const _0x2e15c0=a30_0x431347,_0x3dbae1=_0x98f99f[_0x2e15c0(0x210)][0x0];if(!_0x3dbae1)return _0x2e15c0(0x273);return undefined;}async[a30_0x431347(0x243)](_0x47e44a){const _0x5119e0=a30_0x431347,{options:_0x11c018,args:_0x2fecf7,tdx:_0x57518f}=_0x47e44a,_0x5394f0=_0x2fecf7[0x0],_0x3cd851=_0x11c018,_0x3e4f2d=_0x3cd851[_0x5119e0(0x272)]!==undefined?Number(_0x3cd851['from']):undefined,_0x530cb3=_0x3cd851['to']!==undefined?Number(_0x3cd851['to']):undefined,_0x1371f6=await withSpinner(_0x5119e0(0x259),()=>_0x57518f['schedules'][_0x5119e0(0x209)](_0x5394f0,{'from':_0x3e4f2d,'to':_0x530cb3}),{'verbose':_0x11c018[_0x5119e0(0x1f9)]}),_0x5f2bf0=_0x1371f6[_0x5119e0(0x234)];console[_0x5119e0(0x24e)]('Found\x20'+_0x5f2bf0[_0x5119e0(0x226)]+_0x5119e0(0x25e)+(_0x5f2bf0[_0x5119e0(0x226)]!==0x1?'s':'')+_0x5119e0(0x261)+_0x5f2bf0[_0x5119e0(0x272)]+'-'+_0x5f2bf0['to']+')');const _0x5b7332=_0x5f2bf0['history'][_0x5119e0(0x263)](_0x4158ec=>({'job_id':_0x4158ec[_0x5119e0(0x1f7)],'type':_0x4158ec[_0x5119e0(0x1f6)],'status':_0x4158ec[_0x5119e0(0x24c)],'scheduled_at':_0x4158ec[_0x5119e0(0x24a)],'created_at':_0x4158ec[_0x5119e0(0x224)],'start_at':_0x4158ec[_0x5119e0(0x25b)],'end_at':_0x4158ec['end_at']}));return await handleSDKOutput(_0x5b7332,_0x11c018),0x0;}}
@@ -1 +1 @@
1
- const a31_0x4de3a5=a31_0x59aa;(function(_0x3471a5,_0x500af2){const _0x1fd011=a31_0x59aa,_0x328f02=_0x3471a5();while(!![]){try{const _0xbf8f85=parseInt(_0x1fd011(0x10b))/0x1+parseInt(_0x1fd011(0x106))/0x2+parseInt(_0x1fd011(0xc4))/0x3+parseInt(_0x1fd011(0x10e))/0x4*(parseInt(_0x1fd011(0xd7))/0x5)+parseInt(_0x1fd011(0x11a))/0x6+parseInt(_0x1fd011(0x115))/0x7*(parseInt(_0x1fd011(0x104))/0x8)+-parseInt(_0x1fd011(0x114))/0x9;if(_0xbf8f85===_0x500af2)break;else _0x328f02['push'](_0x328f02['shift']());}catch(_0x7a58f3){_0x328f02['push'](_0x328f02['shift']());}}}(a31_0x310d,0x7ad12));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a31_0x57f4f7 from'chalk';async function resolveSegmentTarget(_0x363db0,_0x5ed378,_0x1bacb0){const _0x520240=a31_0x59aa;if(isYamlFilePath(_0x363db0))try{const _0x471976=await resolveYamlFilePath(_0x363db0);return _0x1bacb0&&(console['error'](_0x520240(0x12d)+_0x363db0),console[_0x520240(0xed)](_0x520240(0x123)+_0x471976['parentSegment']),console[_0x520240(0xed)]('\x20\x20Segment\x20name:\x20'+_0x471976[_0x520240(0xda)]),console[_0x520240(0xed)](_0x520240(0x127)+(_0x471976[_0x520240(0x96)]||_0x520240(0xb7))),console[_0x520240(0xed)]('\x20\x20Full\x20path:\x20'+_0x471976[_0x520240(0x116)])),_0x471976['fullPath'];}catch(_0x8ef592){throw new SDKError(ErrorCode[_0x520240(0xc2)],_0x520240(0xfc)+_0x8ef592['message']);}if(!_0x5ed378)throw new SDKError(ErrorCode[_0x520240(0xc2)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x5ed378+'/'+_0x363db0;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x4de3a5(0xa8)]=a31_0x4de3a5(0xa7);['description']=a31_0x4de3a5(0x136);async[a31_0x4de3a5(0x113)](_0x56036c){const _0x465f5e=a31_0x4de3a5,{options:_0x53342a,args:_0x1fdea0,tdx:_0x4806dd}=_0x56036c,_0x503e31=_0x1fdea0[0x0],_0x1d0c3a=!_0x503e31&&!!_0x53342a[_0x465f5e(0xe7)],_0x3e4a60=_0x503e31||_0x53342a['parentSegment'];if(!_0x3e4a60)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error'](_0x465f5e(0xd6)),console[_0x465f5e(0xed)](_0x465f5e(0x137)),console[_0x465f5e(0xed)](_0x465f5e(0xc6)),console[_0x465f5e(0xed)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x465f5e(0xed)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x465f5e(0xed)](_0x465f5e(0xec)),0x1;try{const _0x169ada=_0x53342a['segmentPath'];let _0x5a258e=_0x3e4a60;!_0x1d0c3a&&_0x169ada&&!_0x3e4a60[_0x465f5e(0x124)]('/')&&(_0x5a258e=_0x169ada+'/'+_0x3e4a60,_0x53342a['verbose']&&console[_0x465f5e(0xed)](_0x465f5e(0xff)+_0x5a258e));const _0x3fb1be=await withSpinner(_0x465f5e(0x121)+_0x5a258e+_0x465f5e(0xd1),()=>_0x4806dd[_0x465f5e(0xab)][_0x465f5e(0xdc)](_0x5a258e),{'verbose':_0x53342a[_0x465f5e(0x9f)]}),_0x4b743d=_0x3fb1be['data'];_0x53342a[_0x465f5e(0x9f)]&&(console[_0x465f5e(0xed)](_0x465f5e(0x10c)+_0x4b743d[_0x465f5e(0xdd)]),console['error'](_0x465f5e(0xa1)+_0x4b743d[_0x465f5e(0xcf)]),_0x4b743d['folderId']&&console['error'](_0x465f5e(0x100)+_0x4b743d[_0x465f5e(0xe5)]),_0x4b743d[_0x465f5e(0x12c)]&&console[_0x465f5e(0xed)](_0x465f5e(0xf7)+_0x4b743d[_0x465f5e(0x12c)]));if(_0x4b743d[_0x465f5e(0xdd)]==='parent'){const _0x3b09dd=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x4806dd['segment'][_0x465f5e(0x10f)](_0x4b743d[_0x465f5e(0xcf)]),{'verbose':_0x53342a[_0x465f5e(0x9f)]});await handleSingleObjectOutput(_0x3b09dd[_0x465f5e(0x134)],_0x53342a);}else{if(_0x4b743d[_0x465f5e(0xdd)]===_0x465f5e(0xac)){if(!_0x4b743d['folderId'])throw new SDKError(ErrorCode[_0x465f5e(0xf5)],_0x465f5e(0xaf));const _0x324cf7=await withSpinner(_0x465f5e(0xf8),()=>_0x4806dd[_0x465f5e(0xab)][_0x465f5e(0xdf)](_0x4b743d['folderId']),{'verbose':_0x53342a[_0x465f5e(0x9f)]});await handleSingleObjectOutput(_0x324cf7[_0x465f5e(0x134)],_0x53342a);}else{if(_0x4b743d[_0x465f5e(0xdd)]===_0x465f5e(0xab)){if(!_0x4b743d[_0x465f5e(0x12c)])throw new SDKError(ErrorCode[_0x465f5e(0xb9)],_0x465f5e(0xf0));const _0x262e6c=await withSpinner(_0x465f5e(0xbf),()=>_0x4806dd[_0x465f5e(0xab)][_0x465f5e(0xbb)](_0x4b743d['parentId'],_0x4b743d[_0x465f5e(0x12c)]),{'verbose':_0x53342a[_0x465f5e(0x9f)]});await handleSingleObjectOutput(_0x262e6c[_0x465f5e(0x134)],_0x53342a);}}}return 0x0;}catch(_0x524ef7){if(_0x524ef7 instanceof SDKError)return console['error'](_0x465f5e(0x9e)+_0x524ef7['message']),_0x524ef7['cause']&&console[_0x465f5e(0xed)](_0x465f5e(0xc0)+_0x524ef7['cause']),0x1;throw _0x524ef7;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x4de3a5(0xa8)]='segment:show';[a31_0x4de3a5(0xd8)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x4de3a5(0x113)](_0x5658b7){const _0x482b1d=a31_0x4de3a5,{options:_0x5d6b5f,args:_0x5bb871,tdx:_0x3b6f79}=_0x5658b7,_0x2dcbbf=_0x5bb871[0x0];if(!_0x2dcbbf)return console[_0x482b1d(0xed)](_0x482b1d(0x133)),console[_0x482b1d(0xed)](_0x482b1d(0x129)),console['error'](_0x482b1d(0xc5)),console[_0x482b1d(0xed)]('Examples:'),console['error'](_0x482b1d(0x97)),console[_0x482b1d(0xed)](_0x482b1d(0x108)),0x1;try{const _0x29a996=_0x5d6b5f[_0x482b1d(0xe7)],_0x2075aa=await resolveSegmentTarget(_0x2dcbbf,_0x29a996,_0x5d6b5f[_0x482b1d(0x9f)]);_0x5d6b5f['verbose']&&console[_0x482b1d(0xed)](_0x482b1d(0xbc)+_0x2075aa);const _0x237e41=await withSpinner('Resolving\x20\x27'+_0x2dcbbf+'\x27...',()=>_0x3b6f79['segment'][_0x482b1d(0xdc)](_0x2075aa),{'verbose':_0x5d6b5f[_0x482b1d(0x9f)]}),_0x3b6a8f=_0x237e41[_0x482b1d(0x134)];_0x5d6b5f['verbose']&&(console['error'](_0x482b1d(0x10c)+_0x3b6a8f[_0x482b1d(0xdd)]),console[_0x482b1d(0xed)](_0x482b1d(0xa1)+_0x3b6a8f['parentId']));if(_0x3b6a8f[_0x482b1d(0xdd)]===_0x482b1d(0xac))return console[_0x482b1d(0xed)](_0x482b1d(0x117)),console[_0x482b1d(0xed)](_0x482b1d(0x135)),0x1;if(_0x3b6a8f[_0x482b1d(0xdd)]===_0x482b1d(0xb1))return console[_0x482b1d(0xed)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x482b1d(0x101)),0x1;if(!_0x3b6a8f['segmentId'])throw new SDKError(ErrorCode[_0x482b1d(0xb9)],_0x482b1d(0xf0));const _0x5eccd4=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3b6f79[_0x482b1d(0xab)][_0x482b1d(0xa4)](_0x3b6a8f[_0x482b1d(0xcf)],_0x3b6a8f[_0x482b1d(0x12c)]),{'verbose':_0x5d6b5f[_0x482b1d(0x9f)]});let _0x5c3328=_0x5eccd4[_0x482b1d(0x134)];const _0x163532=resolveLimit(_0x5d6b5f[_0x482b1d(0xf3)],DEFAULT_DISPLAY_LIMIT),_0x21562c=/\bLIMIT\s+\d+/i['test'](_0x5c3328);!_0x21562c&&(_0x5c3328=_0x5c3328[_0x482b1d(0x109)]()[_0x482b1d(0xb5)](/;+$/,''),_0x5c3328='SELECT\x20*\x20FROM\x20(\x0a'+_0x5c3328+_0x482b1d(0xce)+_0x163532);_0x5d6b5f[_0x482b1d(0x9f)]&&console[_0x482b1d(0xed)]('SQL\x20query:\x0a'+_0x5c3328);const _0x32b1cc=await withProgressSpinner(_0x482b1d(0x11f),async _0x518a99=>{const _0x2d0dbf=_0x482b1d,_0x1b3406=await _0x3b6f79['query'][_0x2d0dbf(0x113)](_0x5c3328,{'catalog':'td','schema':_0x2d0dbf(0xc1),'onJobId':_0x5a3656=>{const _0x5cf447=_0x2d0dbf;_0x518a99[_0x5cf447(0xb2)](_0x5a3656);}});return _0x1b3406;},{'verbose':_0x5d6b5f[_0x482b1d(0x9f)]}),_0x21b7f7=_0x32b1cc[_0x482b1d(0x134)],_0x33c114=_0x21b7f7[_0x482b1d(0xe8)]?'\x20[Job\x20ID:\x20'+_0x21b7f7[_0x482b1d(0xe8)]+']':'';return console[_0x482b1d(0xed)](_0x482b1d(0x9d)+_0x21b7f7[_0x482b1d(0x103)][_0x482b1d(0xe6)][_0x482b1d(0xc8)]()+_0x482b1d(0x130)+(_0x482b1d(0xcc)+formatElapsed(_0x21b7f7[_0x482b1d(0x103)][_0x482b1d(0xcd)])+_0x33c114)),await handleQueryOutput(_0x21b7f7,_0x5d6b5f),0x0;}catch(_0x1b163d){if(_0x1b163d instanceof SDKError)return console['error'](_0x482b1d(0xbe)+_0x1b163d['code']+']'),console[_0x482b1d(0xed)]('\x0a'+_0x1b163d[_0x482b1d(0x10a)]),0x1;throw _0x1b163d;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x4de3a5(0xa8)]='segment:folder:list';['description']=a31_0x4de3a5(0xa0);async[a31_0x4de3a5(0x113)](_0x595682){const _0x50f67e=a31_0x4de3a5,{options:_0x47f233,args:_0x3e3dfa,tdx:_0x1df508}=_0x595682;if(_0x3e3dfa[_0x50f67e(0xc7)]===0x0)return console[_0x50f67e(0xed)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x50f67e(0xf6)),0x1;const _0x1f8c31=_0x3e3dfa[0x0];try{_0x47f233[_0x50f67e(0x9f)]&&(console['error']('Site:\x20'+_0x47f233[_0x50f67e(0x99)]),console[_0x50f67e(0xed)](_0x50f67e(0xaa)+_0x1f8c31));const _0x4cd098=await withSpinner(_0x50f67e(0xe9)+_0x1f8c31+_0x50f67e(0xd1),()=>_0x1df508[_0x50f67e(0xab)][_0x50f67e(0x9a)](_0x1f8c31),{'verbose':_0x47f233[_0x50f67e(0x9f)]}),_0x155489=_0x4cd098[_0x50f67e(0x134)];_0x47f233[_0x50f67e(0x9f)]&&console[_0x50f67e(0xed)]('Resolved\x20parent\x20ID:\x20'+_0x155489);const _0x329235=await withSpinner(_0x50f67e(0xb4)+_0x1f8c31+'\x27...',()=>_0x1df508[_0x50f67e(0xab)][_0x50f67e(0x105)](_0x155489),{'verbose':_0x47f233[_0x50f67e(0x9f)]}),_0x299085=_0x329235['data'];return console['error'](_0x50f67e(0xcb)+_0x299085['length']+'\x20folder'+(_0x299085[_0x50f67e(0xc7)]!==0x1?'s':'')),await handleSDKOutput(_0x299085,_0x47f233),0x0;}catch(_0x1c0c9e){if(_0x1c0c9e instanceof SDKError)return console['error']('Error:\x20'+_0x1c0c9e['message']),_0x1c0c9e[_0x50f67e(0x120)]&&console['error'](_0x50f67e(0xc0)+_0x1c0c9e[_0x50f67e(0x120)]),0x1;throw _0x1c0c9e;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x4de3a5(0xa8)]=a31_0x4de3a5(0xae);['description']='Show\x20segment\x20folder\x20details';async[a31_0x4de3a5(0x113)](_0x421f2b){const _0x574c54=a31_0x4de3a5,{options:_0x647561,args:_0x460741,tdx:_0x43e236}=_0x421f2b;if(_0x460741[_0x574c54(0xc7)]===0x0)return console[_0x574c54(0xed)](_0x574c54(0xef)),console[_0x574c54(0xed)](_0x574c54(0xbd)),0x1;try{const {parentId:_0x348202,childId:_0x1e4870}=parseSegmentRef(_0x460741[0x0]);_0x647561[_0x574c54(0x9f)]&&(console[_0x574c54(0xed)]('Site:\x20'+_0x647561[_0x574c54(0x99)]),console[_0x574c54(0xed)]('Parent\x20name:\x20'+_0x348202),_0x1e4870&&console[_0x574c54(0xed)](_0x574c54(0x12b)+_0x1e4870));if(!_0x1e4870)return console[_0x574c54(0xed)](_0x574c54(0x12e)),0x1;const _0x48d93b=await withSpinner(_0x574c54(0xe9)+_0x348202+_0x574c54(0xd1),()=>_0x43e236[_0x574c54(0xab)][_0x574c54(0x9a)](_0x348202),{'verbose':_0x647561['verbose']}),_0x3f7c4=_0x48d93b[_0x574c54(0x134)];_0x647561[_0x574c54(0x9f)]&&console['error'](_0x574c54(0xd4)+_0x3f7c4);const _0x21c043=await withSpinner(_0x574c54(0x126)+_0x1e4870+_0x574c54(0xd1),()=>_0x43e236[_0x574c54(0xab)][_0x574c54(0x132)](_0x3f7c4,_0x1e4870),{'verbose':_0x647561[_0x574c54(0x9f)]}),_0x380882=_0x21c043[_0x574c54(0x134)];_0x647561[_0x574c54(0x9f)]&&console[_0x574c54(0xed)](_0x574c54(0xfa)+_0x380882);const _0x466ee6=await withSpinner(_0x574c54(0xad)+_0x1e4870+_0x574c54(0xd1),()=>_0x43e236[_0x574c54(0xab)][_0x574c54(0xdf)](_0x380882),{'verbose':_0x647561[_0x574c54(0x9f)]});return await handleSDKOutput([_0x466ee6[_0x574c54(0x134)]],_0x647561),0x0;}catch(_0xdf53d1){if(_0xdf53d1 instanceof SDKError)return console['error'](_0x574c54(0x9e)+_0xdf53d1['message']),_0xdf53d1[_0x574c54(0x120)]&&console[_0x574c54(0xed)]('\x20\x20Cause:\x20'+_0xdf53d1[_0x574c54(0x120)]),0x1;throw _0xdf53d1;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x4de3a5(0xa8)]=a31_0x4de3a5(0xc3);[a31_0x4de3a5(0xd8)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a31_0x4de3a5(0x113)](_0x3babfb){const _0x378a95=a31_0x4de3a5,{options:_0x3e2282,args:_0x282389}=_0x3babfb,_0x4f59df=_0x3e2282,_0x486ea9=_0x4f59df['path'],_0xcdba73=_0x282389[0x0];if(!_0xcdba73&&!_0x486ea9)return console['error'](a31_0x57f4f7[_0x378a95(0x128)](_0x378a95(0xb6))),console['error'](_0x378a95(0xe4)),console[_0x378a95(0xed)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x378a95(0xed)](_0x378a95(0x12f)),console['error']('Examples:'),console['error']('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x378a95(0xed)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml'),0x1;if(_0xcdba73&&_0x486ea9)return console[_0x378a95(0xed)](a31_0x57f4f7['red'](_0x378a95(0x112))),0x1;try{let _0x3d6df4;if(_0x486ea9)_0x3d6df4=await this[_0x378a95(0xeb)](_0x486ea9,_0x3babfb);else{if(isYamlFilePath(_0xcdba73))return console[_0x378a95(0xed)](a31_0x57f4f7['red'](_0x378a95(0xa9))),console[_0x378a95(0xed)](_0x378a95(0xb8)+_0xcdba73),0x1;else _0x3d6df4=await this['getSQLFromServerSegment'](_0xcdba73,_0x3babfb);}return _0x3e2282[_0x378a95(0xd0)]===_0x378a95(0xfe)||_0x3e2282['format']===_0x378a95(0xa3)?await handleSDKOutput([{'sql':_0x3d6df4}],_0x3e2282):console[_0x378a95(0xa2)](_0x3d6df4),0x0;}catch(_0x44dde3){if(_0x44dde3 instanceof SDKError)return console[_0x378a95(0xed)](_0x378a95(0x9e)+_0x44dde3[_0x378a95(0x10a)]),_0x44dde3[_0x378a95(0x120)]&&console[_0x378a95(0xed)]('\x20\x20Cause:\x20'+_0x44dde3[_0x378a95(0x120)]),0x1;throw _0x44dde3;}}async[a31_0x4de3a5(0xeb)](_0x3931a7,_0x471017){const _0x27fc9f=a31_0x4de3a5,{options:_0x5285f2,tdx:_0x3a88c3}=_0x471017;let _0x53fc9d;try{_0x53fc9d=await resolveYamlFilePath(_0x3931a7);}catch(_0x1d015f){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x27fc9f(0xfc)+_0x1d015f[_0x27fc9f(0x10a)]);}_0x5285f2[_0x27fc9f(0x9f)]&&console[_0x27fc9f(0xed)]('Resolved:\x20'+_0x53fc9d[_0x27fc9f(0xe7)]+'/'+_0x53fc9d[_0x27fc9f(0xda)]);const _0x5e5cd3=await withSpinner(_0x27fc9f(0x10d),()=>_0x3a88c3[_0x27fc9f(0xab)][_0x27fc9f(0x11e)](_0x53fc9d[_0x27fc9f(0x11c)],_0x53fc9d[_0x27fc9f(0xe7)],_0x53fc9d[_0x27fc9f(0xda)]),{'verbose':_0x5285f2[_0x27fc9f(0x9f)]});return _0x5e5cd3[_0x27fc9f(0x134)];}async[a31_0x4de3a5(0xb3)](_0x5886d0,_0x81d3c6){const _0xb7d419=a31_0x4de3a5,{options:_0x54342d,tdx:_0x3c5f8e}=_0x81d3c6,_0x55f21e=_0x54342d[_0xb7d419(0xe7)],_0x5ca097=await resolveSegmentTarget(_0x5886d0,_0x55f21e,_0x54342d[_0xb7d419(0x9f)]);_0x54342d[_0xb7d419(0x9f)]&&console[_0xb7d419(0xed)]('Target\x20path:\x20'+_0x5ca097);const _0x5a9500=await withSpinner(_0xb7d419(0x110)+_0x5886d0+_0xb7d419(0xd1),()=>_0x3c5f8e[_0xb7d419(0xab)][_0xb7d419(0xdc)](_0x5ca097),{'verbose':_0x54342d[_0xb7d419(0x9f)]}),_0x1db543=_0x5a9500[_0xb7d419(0x134)];_0x54342d[_0xb7d419(0x9f)]&&(console[_0xb7d419(0xed)](_0xb7d419(0x10c)+_0x1db543[_0xb7d419(0xdd)]),console[_0xb7d419(0xed)](_0xb7d419(0xa1)+_0x1db543['parentId']));if(_0x1db543['type']===_0xb7d419(0xac))throw new SDKError(ErrorCode[_0xb7d419(0xc2)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x1db543[_0xb7d419(0xdd)]==='parent')throw new SDKError(ErrorCode[_0xb7d419(0xc2)],_0xb7d419(0xfd));if(!_0x1db543[_0xb7d419(0x12c)])throw new SDKError(ErrorCode[_0xb7d419(0xb9)],_0xb7d419(0xf0));const _0x2dcc5b=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3c5f8e['segment'][_0xb7d419(0xa4)](_0x1db543['parentId'],_0x1db543[_0xb7d419(0x12c)]),{'verbose':_0x54342d[_0xb7d419(0x9f)]});return _0x2dcc5b[_0xb7d419(0x134)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0x4de3a5(0xa8)]=a31_0x4de3a5(0xe1);[a31_0x4de3a5(0xd8)]=a31_0x4de3a5(0x118);async[a31_0x4de3a5(0x113)](_0x196777){const _0x33e71a=a31_0x4de3a5,{options:_0x448cbd,args:_0xa3f3d7,tdx:_0x3889d3}=_0x196777,_0xf44c4e=_0x448cbd;if(_0xa3f3d7[_0x33e71a(0xc7)]<0x2)return console[_0x33e71a(0xed)](_0x33e71a(0xe2)),console[_0x33e71a(0xed)](_0x33e71a(0xde)),0x1;const _0x57916a=_0xa3f3d7[0x0],_0x3abc9f=_0xa3f3d7[0x1];_0xf44c4e[_0x33e71a(0x9f)]&&(console[_0x33e71a(0xed)](_0x33e71a(0xc9)+_0xf44c4e[_0x33e71a(0x99)]),console[_0x33e71a(0xed)](_0x33e71a(0xd3)+_0x57916a),console['error'](_0x33e71a(0x12b)+_0x3abc9f));let _0x224aad;if(_0xf44c4e['parentFolder']){const _0x4cb490=_0xf44c4e['parentFolder'],_0x27999a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x57916a+_0x33e71a(0xd1),()=>_0x3889d3[_0x33e71a(0xab)][_0x33e71a(0x9a)](_0x57916a),{'verbose':_0xf44c4e[_0x33e71a(0x9f)]}),_0x1ad0f5=_0x27999a[_0x33e71a(0x134)],_0x30e482=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x4cb490+'\x27...',()=>_0x3889d3[_0x33e71a(0xab)]['resolveFolderId'](_0x1ad0f5,_0x4cb490),{'verbose':_0xf44c4e[_0x33e71a(0x9f)]});_0x224aad=_0x30e482[_0x33e71a(0x134)],_0xf44c4e[_0x33e71a(0x9f)]&&console[_0x33e71a(0xed)](_0x33e71a(0xf4)+_0x224aad);}const _0x335bd9={'name':_0x3abc9f,'description':_0xf44c4e[_0x33e71a(0xd8)],'parentFolderId':_0x224aad},_0x46d1c0=await withSpinner('Creating\x20folder\x20\x27'+_0x3abc9f+_0x33e71a(0xd1),()=>_0x3889d3[_0x33e71a(0xab)][_0x33e71a(0xf2)](_0x57916a,_0x335bd9),{'verbose':_0xf44c4e[_0x33e71a(0x9f)]}),_0xe4a0a8=_0x46d1c0[_0x33e71a(0x134)];return console[_0x33e71a(0xed)]('βœ”\x20Created\x20folder\x20\x27'+_0xe4a0a8[_0x33e71a(0xa8)]+_0x33e71a(0xb0)+_0xe4a0a8['id']),await handleSDKOutput([_0xe4a0a8],_0xf44c4e),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x4de3a5(0xa8)]=a31_0x4de3a5(0xba);[a31_0x4de3a5(0xd8)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a31_0x4de3a5(0x113)](_0x41ef75){const _0x3ed80e=a31_0x4de3a5,{options:_0x3c8c3d,args:_0x44a3c3,tdx:_0x266562}=_0x41ef75,_0x285f00=_0x44a3c3[0x0];if(!_0x285f00)return console[_0x3ed80e(0xed)](_0x3ed80e(0x12a)),console['error'](_0x3ed80e(0x102)),console[_0x3ed80e(0xed)](_0x3ed80e(0xa6)),console[_0x3ed80e(0xed)](_0x3ed80e(0x9c)),console[_0x3ed80e(0xed)](_0x3ed80e(0x11d)),console['error'](_0x3ed80e(0x137)),console[_0x3ed80e(0xed)](_0x3ed80e(0x107)),console[_0x3ed80e(0xed)](_0x3ed80e(0xca)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3ed80e(0xed)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x15edb1=_0x3c8c3d['parentSegment'],_0x4f2d22=await resolveSegmentTarget(_0x285f00,_0x15edb1,_0x3c8c3d['verbose']);_0x3c8c3d['verbose']&&console[_0x3ed80e(0xed)](_0x3ed80e(0xbc)+_0x4f2d22);const _0x477d83=await withSpinner('Resolving\x20\x27'+_0x285f00+'\x27...',()=>_0x266562[_0x3ed80e(0xab)][_0x3ed80e(0xdc)](_0x4f2d22),{'verbose':_0x3c8c3d[_0x3ed80e(0x9f)]}),_0x2b9200=_0x477d83['data'];_0x3c8c3d['verbose']&&(console[_0x3ed80e(0xed)](_0x3ed80e(0x10c)+_0x2b9200[_0x3ed80e(0xdd)]),console[_0x3ed80e(0xed)](_0x3ed80e(0xa1)+_0x2b9200[_0x3ed80e(0xcf)]),_0x2b9200[_0x3ed80e(0xe5)]&&console[_0x3ed80e(0xed)](_0x3ed80e(0x100)+_0x2b9200['folderId']),_0x2b9200[_0x3ed80e(0x12c)]&&console[_0x3ed80e(0xed)](_0x3ed80e(0xf7)+_0x2b9200[_0x3ed80e(0x12c)]));if(_0x3c8c3d[_0x3ed80e(0xfb)]){if(_0x2b9200[_0x3ed80e(0xdd)]==='folder')return console[_0x3ed80e(0xed)](_0x3ed80e(0xea)),0x1;if(_0x2b9200[_0x3ed80e(0xdd)]===_0x3ed80e(0xb1))return console[_0x3ed80e(0xed)](_0x3ed80e(0x122)),console[_0x3ed80e(0xed)](_0x3ed80e(0x11b)),0x1;if(!_0x2b9200[_0x3ed80e(0x12c)])throw new SDKError(ErrorCode[_0x3ed80e(0xb9)],_0x3ed80e(0xf0));const _0xf66602=getConsoleNextUrl(_0x3c8c3d[_0x3ed80e(0x99)],_0x3ed80e(0xd5)+_0x2b9200['parentId']+_0x3ed80e(0x131)+_0x2b9200[_0x3ed80e(0x12c)]);return console['error'](a31_0x57f4f7[_0x3ed80e(0xd9)]('βœ”')+_0x3ed80e(0xf9)+a31_0x57f4f7[_0x3ed80e(0x9b)](_0xf66602)),openBrowser(_0xf66602),0x0;}if(_0x2b9200[_0x3ed80e(0xdd)]==='folder'){if(!_0x2b9200[_0x3ed80e(0xe5)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x3ed80e(0xaf));const _0x2e6e32=await withSpinner(_0x3ed80e(0xf8),()=>_0x266562[_0x3ed80e(0xab)][_0x3ed80e(0xdf)](_0x2b9200[_0x3ed80e(0xe5)]),{'verbose':_0x3c8c3d[_0x3ed80e(0x9f)]});await handleSingleObjectOutput(_0x2e6e32['data'],_0x3c8c3d);}else{if(_0x2b9200[_0x3ed80e(0xdd)]===_0x3ed80e(0xab)){if(!_0x2b9200[_0x3ed80e(0x12c)])throw new SDKError(ErrorCode[_0x3ed80e(0xb9)],_0x3ed80e(0xf0));const _0x539661=await withSpinner(_0x3ed80e(0xbf),()=>_0x266562['segment'][_0x3ed80e(0xbb)](_0x2b9200['parentId'],_0x2b9200[_0x3ed80e(0x12c)]),{'verbose':_0x3c8c3d[_0x3ed80e(0x9f)]}),_0x380500=getConsoleNextUrl(_0x3c8c3d[_0x3ed80e(0x99)],_0x3ed80e(0xd5)+_0x2b9200[_0x3ed80e(0xcf)]+_0x3ed80e(0x131)+_0x2b9200[_0x3ed80e(0x12c)]),_0x555b4d=_0x539661[_0x3ed80e(0x134)];_0x555b4d[_0x3ed80e(0x119)]=_0x380500,await handleSingleObjectOutput(_0x555b4d,_0x3c8c3d);}else return console[_0x3ed80e(0xed)](_0x3ed80e(0xe3)),console[_0x3ed80e(0xed)](_0x3ed80e(0xd2)),0x1;}return 0x0;}catch(_0xd61f26){if(_0xd61f26 instanceof SDKError)return console[_0x3ed80e(0xed)]('Error:\x20'+_0xd61f26[_0x3ed80e(0x10a)]),_0xd61f26[_0x3ed80e(0x120)]&&console[_0x3ed80e(0xed)](_0x3ed80e(0xc0)+_0xd61f26[_0x3ed80e(0x120)]),0x1;throw _0xd61f26;}}}function a31_0x59aa(_0x3e0e51,_0x250a6a){_0x3e0e51=_0x3e0e51-0x96;const _0x310d91=a31_0x310d();let _0x59aad7=_0x310d91[_0x3e0e51];return _0x59aad7;}function a31_0x310d(){const _0x27900f=['folderId','processedRows','parentSegment','jobId','Resolving\x20parent\x20segment\x20\x27','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','getSQLFromYamlFile','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','error','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Error:\x20Folder\x20reference\x20is\x20required','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','createFolder','limit','Resolved\x20parent\x20folder\x20ID:\x20','SEGMENT_FOLDER_NOT_FOUND','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Segment\x20ID:\x20','Fetching\x20folder\x20details...','\x20Opening\x20','Resolved\x20folder\x20ID:\x20','web','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','json','Resolved\x20relative\x20path\x20to:\x20','Folder\x20ID:\x20','Use:\x20tdx\x20ps\x20show','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','stats','245280QqRVAW','listFolders','790152VQZTrM','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','trim','message','140374wMDeZQ','Resolved\x20type:\x20','Fetching\x20SQL\x20from\x20rule...','20XTjJBQ','getParent','Resolving\x20\x27','Fetching\x20SQL\x20for\x20segment...','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','execute','23826087xxjUts','112ZqgVHy','fullPath','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Create\x20segment\x20folder\x20for\x20organization','url','3237612etqGPI','Use:\x20tdx\x20ps\x20view\x20-w','content','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','getSegmentSQLFromYaml','Executing\x20segment\x20query...','cause','Resolving\x20path\x20\x27','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20Parent\x20segment:\x20','includes','Show\x20child\x20segment\x20schema\x20(column\x20types)','Resolving\x20folder\x20\x27','\x20\x20Folder\x20path:\x20','red','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Folder\x20name:\x20','segmentId','Resolved\x20YAML\x20file:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','\x20rows\x20','/e/','resolveFolderId','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','data','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Show\x20segment\x20or\x20folder\x20details','Examples:','folderPath','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','site','resolveParentId','cyan','Options:','βœ”\x20Query\x20completed:\x20Processed\x20','Error:\x20','verbose','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Parent\x20ID:\x20','log','jsonl','getSegmentSQL','segment:desc','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','segment:describe','name','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Parent\x20name:\x20','segment','folder','Fetching\x20folder\x20\x27','segment:folder:show','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x27\x20with\x20ID:\x20','parent','setJobId','getSQLFromServerSegment','Listing\x20folders\x20for\x20parent\x20\x27','replace','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','(root)','\x20\x20tdx\x20sg\x20sql\x20--path\x20','SEGMENT_NOT_FOUND','segment:view','getSegment','Target\x20path:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','βœ–\x20Query\x20failed\x20[','Fetching\x20segment\x20details...','\x20\x20Cause:\x20','information_schema','INVALID_ARGUMENT','segment:sql','2468712rHAODq','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','length','toLocaleString','Site:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','βœ”\x20Found\x20','in\x20','elapsedTimeMillis','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','parentId','format','\x27...','Use:\x20tdx\x20ps\x20view','Parent\x20segment:\x20','Resolved\x20parent\x20ID:\x20','/app/ps/','Usage:\x20tdx\x20segment\x20describe\x20<path>','761885JftJeU','description','green','segmentName','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','resolvePathToResource','type','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','getFolder','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','segment:folder:create','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Usage:'];a31_0x310d=function(){return _0x27900f;};return a31_0x310d();}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a31_0x4de3a5(0xa5);[a31_0x4de3a5(0xd8)]=a31_0x4de3a5(0x125);async[a31_0x4de3a5(0x113)](_0x4cf968){const _0x3fc4a1=a31_0x4de3a5,{options:_0x33924a,args:_0x53c248,tdx:_0x3ca3ee}=_0x4cf968,_0x283a37=_0x53c248[0x0];if(!_0x283a37)return console[_0x3fc4a1(0xed)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3fc4a1(0xed)](_0x3fc4a1(0x98)),console[_0x3fc4a1(0xed)](_0x3fc4a1(0xf1)),console['error']('Examples:'),console[_0x3fc4a1(0xed)](_0x3fc4a1(0xdb)),console[_0x3fc4a1(0xed)](_0x3fc4a1(0xee)),0x1;try{const _0x15f406=_0x33924a[_0x3fc4a1(0xe7)],_0x3aa3f8=await resolveSegmentTarget(_0x283a37,_0x15f406,_0x33924a[_0x3fc4a1(0x9f)]);_0x33924a['verbose']&&console['error'](_0x3fc4a1(0xbc)+_0x3aa3f8);const _0x2a7063=await withSpinner(_0x3fc4a1(0x110)+_0x283a37+_0x3fc4a1(0xd1),()=>_0x3ca3ee[_0x3fc4a1(0xab)][_0x3fc4a1(0xdc)](_0x3aa3f8),{'verbose':_0x33924a[_0x3fc4a1(0x9f)]}),_0x485fad=_0x2a7063['data'];_0x33924a[_0x3fc4a1(0x9f)]&&(console[_0x3fc4a1(0xed)]('Resolved\x20type:\x20'+_0x485fad['type']),console[_0x3fc4a1(0xed)]('Parent\x20ID:\x20'+_0x485fad[_0x3fc4a1(0xcf)]));if(_0x485fad[_0x3fc4a1(0xdd)]===_0x3fc4a1(0xac))return console[_0x3fc4a1(0xed)](_0x3fc4a1(0xe0)),console[_0x3fc4a1(0xed)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x485fad[_0x3fc4a1(0xdd)]===_0x3fc4a1(0xb1))return console[_0x3fc4a1(0xed)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3fc4a1(0xed)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x485fad[_0x3fc4a1(0x12c)])throw new SDKError(ErrorCode[_0x3fc4a1(0xb9)],_0x3fc4a1(0xf0));const _0x3f403e=await withSpinner(_0x3fc4a1(0x111),()=>_0x3ca3ee[_0x3fc4a1(0xab)][_0x3fc4a1(0xa4)](_0x485fad[_0x3fc4a1(0xcf)],_0x485fad[_0x3fc4a1(0x12c)]),{'verbose':_0x33924a[_0x3fc4a1(0x9f)]}),_0x58151d=_0x3f403e[_0x3fc4a1(0x134)],_0x153532=await executeSchemaQuery(_0x58151d,_0x3ca3ee,_0x33924a);return await handleQueryOutput(_0x153532,_0x33924a),0x0;}catch(_0x17bb8f){if(_0x17bb8f instanceof SDKError)return console[_0x3fc4a1(0xed)](_0x3fc4a1(0x9e)+_0x17bb8f[_0x3fc4a1(0x10a)]),_0x17bb8f['cause']&&console[_0x3fc4a1(0xed)](_0x3fc4a1(0xc0)+_0x17bb8f[_0x3fc4a1(0x120)]),0x1;throw _0x17bb8f;}}}
1
+ const a31_0x43f177=a31_0x5040;(function(_0x16ee14,_0x5a3484){const _0x3949fd=a31_0x5040,_0x3b08d6=_0x16ee14();while(!![]){try{const _0x16294f=parseInt(_0x3949fd(0x1b0))/0x1+-parseInt(_0x3949fd(0x19d))/0x2+-parseInt(_0x3949fd(0x17e))/0x3*(-parseInt(_0x3949fd(0x15e))/0x4)+-parseInt(_0x3949fd(0x1a5))/0x5+parseInt(_0x3949fd(0x1a2))/0x6+parseInt(_0x3949fd(0x157))/0x7+-parseInt(_0x3949fd(0x169))/0x8;if(_0x16294f===_0x5a3484)break;else _0x3b08d6['push'](_0x3b08d6['shift']());}catch(_0x3e44cc){_0x3b08d6['push'](_0x3b08d6['shift']());}}}(a31_0x5dd3,0x3268e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a31_0x5040(_0x4d8799,_0x15a36c){_0x4d8799=_0x4d8799-0x149;const _0x5dd3d0=a31_0x5dd3();let _0x50405e=_0x5dd3d0[_0x4d8799];return _0x50405e;}import a31_0x5c1093 from'chalk';async function resolveSegmentTarget(_0x55f9b4,_0x4e633f,_0x46b05e){const _0x298e67=a31_0x5040;if(isYamlFilePath(_0x55f9b4))try{const _0x7675=await resolveYamlFilePath(_0x55f9b4);return _0x46b05e&&(console[_0x298e67(0x1c7)](_0x298e67(0x173)+_0x55f9b4),console[_0x298e67(0x1c7)]('\x20\x20Parent\x20segment:\x20'+_0x7675['parentSegment']),console[_0x298e67(0x1c7)](_0x298e67(0x1bd)+_0x7675[_0x298e67(0x1d7)]),console[_0x298e67(0x1c7)](_0x298e67(0x195)+(_0x7675[_0x298e67(0x156)]||_0x298e67(0x1cf))),console['error']('\x20\x20Full\x20path:\x20'+_0x7675[_0x298e67(0x1c9)])),_0x7675['fullPath'];}catch(_0x5dfc9b){throw new SDKError(ErrorCode[_0x298e67(0x1d6)],_0x298e67(0x1b5)+_0x5dfc9b[_0x298e67(0x165)]);}if(!_0x4e633f)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x4e633f+'/'+_0x55f9b4;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x43f177(0x16c)]=a31_0x43f177(0x1c3);['description']=a31_0x43f177(0x1a6);async[a31_0x43f177(0x171)](_0x326bfd){const _0x2352b2=a31_0x43f177,{options:_0x4b8eb4,args:_0x2c0e5d,tdx:_0x35298}=_0x326bfd,_0x5af87d=_0x2c0e5d[0x0],_0x4cadfb=!_0x5af87d&&!!_0x4b8eb4[_0x2352b2(0x14e)],_0x59828d=_0x5af87d||_0x4b8eb4[_0x2352b2(0x14e)];if(!_0x59828d)return console[_0x2352b2(0x1c7)](_0x2352b2(0x18b)),console[_0x2352b2(0x1c7)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error'](_0x2352b2(0x1cc)),console[_0x2352b2(0x1c7)](_0x2352b2(0x1ab)),console[_0x2352b2(0x1c7)](_0x2352b2(0x198)),console[_0x2352b2(0x1c7)](_0x2352b2(0x190)),console[_0x2352b2(0x1c7)](_0x2352b2(0x1c4)),0x1;try{const _0x5d5fba=_0x4b8eb4[_0x2352b2(0x184)];let _0x4fb28f=_0x59828d;!_0x4cadfb&&_0x5d5fba&&!_0x59828d[_0x2352b2(0x1a3)]('/')&&(_0x4fb28f=_0x5d5fba+'/'+_0x59828d,_0x4b8eb4[_0x2352b2(0x1bb)]&&console[_0x2352b2(0x1c7)](_0x2352b2(0x168)+_0x4fb28f));const _0x1739ed=await withSpinner(_0x2352b2(0x19e)+_0x4fb28f+_0x2352b2(0x1ca),()=>_0x35298['segment'][_0x2352b2(0x1db)](_0x4fb28f),{'verbose':_0x4b8eb4[_0x2352b2(0x1bb)]}),_0x58e566=_0x1739ed['data'];_0x4b8eb4[_0x2352b2(0x1bb)]&&(console[_0x2352b2(0x1c7)](_0x2352b2(0x15a)+_0x58e566[_0x2352b2(0x1aa)]),console[_0x2352b2(0x1c7)](_0x2352b2(0x160)+_0x58e566[_0x2352b2(0x197)]),_0x58e566[_0x2352b2(0x161)]&&console[_0x2352b2(0x1c7)](_0x2352b2(0x1ec)+_0x58e566[_0x2352b2(0x161)]),_0x58e566[_0x2352b2(0x1b9)]&&console['error'](_0x2352b2(0x153)+_0x58e566[_0x2352b2(0x1b9)]));if(_0x58e566['type']===_0x2352b2(0x1de)){const _0x415c84=await withSpinner(_0x2352b2(0x1d5),()=>_0x35298[_0x2352b2(0x167)]['getParent'](_0x58e566[_0x2352b2(0x197)]),{'verbose':_0x4b8eb4['verbose']});await handleSingleObjectOutput(_0x415c84[_0x2352b2(0x191)],_0x4b8eb4);}else{if(_0x58e566['type']===_0x2352b2(0x1e9)){if(!_0x58e566['folderId'])throw new SDKError(ErrorCode[_0x2352b2(0x14a)],_0x2352b2(0x199));const _0x2ec15a=await withSpinner(_0x2352b2(0x1be),()=>_0x35298[_0x2352b2(0x167)][_0x2352b2(0x16f)](_0x58e566['folderId']),{'verbose':_0x4b8eb4[_0x2352b2(0x1bb)]});await handleSingleObjectOutput(_0x2ec15a[_0x2352b2(0x191)],_0x4b8eb4);}else{if(_0x58e566[_0x2352b2(0x1aa)]===_0x2352b2(0x167)){if(!_0x58e566[_0x2352b2(0x1b9)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x193570=await withSpinner(_0x2352b2(0x17a),()=>_0x35298[_0x2352b2(0x167)]['getSegment'](_0x58e566[_0x2352b2(0x197)],_0x58e566[_0x2352b2(0x1b9)]),{'verbose':_0x4b8eb4[_0x2352b2(0x1bb)]});await handleSingleObjectOutput(_0x193570[_0x2352b2(0x191)],_0x4b8eb4);}}}return 0x0;}catch(_0x48d391){if(_0x48d391 instanceof SDKError)return console[_0x2352b2(0x1c7)]('Error:\x20'+_0x48d391[_0x2352b2(0x165)]),_0x48d391[_0x2352b2(0x172)]&&console[_0x2352b2(0x1c7)]('\x20\x20Cause:\x20'+_0x48d391[_0x2352b2(0x172)]),0x1;throw _0x48d391;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x43f177(0x16c)]=a31_0x43f177(0x181);[a31_0x43f177(0x1e6)]=a31_0x43f177(0x15c);async[a31_0x43f177(0x171)](_0x143883){const _0x302dca=a31_0x43f177,{options:_0x25e5aa,args:_0x1cbb9b,tdx:_0x251b00}=_0x143883,_0x4df6ca=_0x1cbb9b[0x0];if(!_0x4df6ca)return console[_0x302dca(0x1c7)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x302dca(0x17d)),console[_0x302dca(0x1c7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x302dca(0x1c7)](_0x302dca(0x1cc)),console[_0x302dca(0x1c7)](_0x302dca(0x15b)),console[_0x302dca(0x1c7)](_0x302dca(0x1dc)),0x1;try{const _0x4ebef9=_0x25e5aa['parentSegment'],_0x1a3d82=await resolveSegmentTarget(_0x4df6ca,_0x4ebef9,_0x25e5aa[_0x302dca(0x1bb)]);_0x25e5aa[_0x302dca(0x1bb)]&&console[_0x302dca(0x1c7)](_0x302dca(0x19c)+_0x1a3d82);const _0x387593=await withSpinner(_0x302dca(0x17f)+_0x4df6ca+'\x27...',()=>_0x251b00[_0x302dca(0x167)][_0x302dca(0x1db)](_0x1a3d82),{'verbose':_0x25e5aa['verbose']}),_0x592604=_0x387593[_0x302dca(0x191)];_0x25e5aa['verbose']&&(console[_0x302dca(0x1c7)](_0x302dca(0x15a)+_0x592604['type']),console[_0x302dca(0x1c7)]('Parent\x20ID:\x20'+_0x592604['parentId']));if(_0x592604['type']===_0x302dca(0x1e9))return console[_0x302dca(0x1c7)](_0x302dca(0x14b)),console[_0x302dca(0x1c7)](_0x302dca(0x16d)),0x1;if(_0x592604[_0x302dca(0x1aa)]==='parent')return console[_0x302dca(0x1c7)](_0x302dca(0x1ae)),console[_0x302dca(0x1c7)](_0x302dca(0x1e3)),0x1;if(!_0x592604[_0x302dca(0x1b9)])throw new SDKError(ErrorCode[_0x302dca(0x1ea)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x128ee3=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x251b00[_0x302dca(0x167)][_0x302dca(0x149)](_0x592604[_0x302dca(0x197)],_0x592604[_0x302dca(0x1b9)]),{'verbose':_0x25e5aa[_0x302dca(0x1bb)]});let _0x1d7602=_0x128ee3[_0x302dca(0x191)];const _0x175ba6=resolveLimit(_0x25e5aa[_0x302dca(0x1cd)],DEFAULT_DISPLAY_LIMIT),_0xc614aa=/\bLIMIT\s+\d+/i[_0x302dca(0x1bc)](_0x1d7602);!_0xc614aa&&(_0x1d7602=_0x1d7602[_0x302dca(0x186)]()[_0x302dca(0x1e4)](/;+$/,''),_0x1d7602='SELECT\x20*\x20FROM\x20(\x0a'+_0x1d7602+_0x302dca(0x164)+_0x175ba6);_0x25e5aa[_0x302dca(0x1bb)]&&console['error']('SQL\x20query:\x0a'+_0x1d7602);const _0x43a1c5=await withProgressSpinner(_0x302dca(0x1b2),async _0x47f585=>{const _0x45850=_0x302dca,_0x4279d2=await _0x251b00[_0x45850(0x1ba)][_0x45850(0x171)](_0x1d7602,{'catalog':'td','schema':_0x45850(0x175),'onJobId':_0x4da1cf=>{const _0x4bc1a3=_0x45850;_0x47f585[_0x4bc1a3(0x19b)](_0x4da1cf);}});return _0x4279d2;},{'verbose':_0x25e5aa[_0x302dca(0x1bb)]}),_0x57f194=_0x43a1c5['data'],_0x403941=_0x57f194[_0x302dca(0x1df)]?_0x302dca(0x1b6)+_0x57f194[_0x302dca(0x1df)]+']':'';return console[_0x302dca(0x1c7)](_0x302dca(0x178)+_0x57f194['stats'][_0x302dca(0x1c5)][_0x302dca(0x154)]()+_0x302dca(0x1c0)+('in\x20'+formatElapsed(_0x57f194[_0x302dca(0x18a)][_0x302dca(0x183)])+_0x403941)),await handleQueryOutput(_0x57f194,_0x25e5aa),0x0;}catch(_0x243e07){if(_0x243e07 instanceof SDKError)return console[_0x302dca(0x1c7)](_0x302dca(0x1b4)+_0x243e07['code']+']'),console[_0x302dca(0x1c7)]('\x0a'+_0x243e07['message']),0x1;throw _0x243e07;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x43f177(0x16c)]=a31_0x43f177(0x1c8);[a31_0x43f177(0x1e6)]=a31_0x43f177(0x1e2);async[a31_0x43f177(0x171)](_0x1b97c8){const _0x284d75=a31_0x43f177,{options:_0x2307be,args:_0x5450d8,tdx:_0x14edc7}=_0x1b97c8;if(_0x5450d8[_0x284d75(0x19f)]===0x0)return console[_0x284d75(0x1c7)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x284d75(0x1c7)](_0x284d75(0x1eb)),0x1;const _0x11433a=_0x5450d8[0x0];try{_0x2307be[_0x284d75(0x1bb)]&&(console[_0x284d75(0x1c7)](_0x284d75(0x1ac)+_0x2307be[_0x284d75(0x14d)]),console[_0x284d75(0x1c7)](_0x284d75(0x18e)+_0x11433a));const _0x1dda4a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x11433a+'\x27...',()=>_0x14edc7[_0x284d75(0x167)][_0x284d75(0x14c)](_0x11433a),{'verbose':_0x2307be[_0x284d75(0x1bb)]}),_0x1055fa=_0x1dda4a[_0x284d75(0x191)];_0x2307be[_0x284d75(0x1bb)]&&console[_0x284d75(0x1c7)]('Resolved\x20parent\x20ID:\x20'+_0x1055fa);const _0x40972a=await withSpinner(_0x284d75(0x151)+_0x11433a+_0x284d75(0x1ca),()=>_0x14edc7[_0x284d75(0x167)][_0x284d75(0x1e8)](_0x1055fa),{'verbose':_0x2307be[_0x284d75(0x1bb)]}),_0x4586b1=_0x40972a['data'];return console['error'](_0x284d75(0x16e)+_0x4586b1[_0x284d75(0x19f)]+_0x284d75(0x155)+(_0x4586b1[_0x284d75(0x19f)]!==0x1?'s':'')),await handleSDKOutput(_0x4586b1,_0x2307be),0x0;}catch(_0x565059){if(_0x565059 instanceof SDKError)return console[_0x284d75(0x1c7)]('Error:\x20'+_0x565059[_0x284d75(0x165)]),_0x565059['cause']&&console[_0x284d75(0x1c7)](_0x284d75(0x17b)+_0x565059[_0x284d75(0x172)]),0x1;throw _0x565059;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a31_0x43f177(0x1e6)]=a31_0x43f177(0x1c1);async['execute'](_0xe61b96){const _0x310b66=a31_0x43f177,{options:_0x282202,args:_0x284e17,tdx:_0x5dd3bd}=_0xe61b96;if(_0x284e17[_0x310b66(0x19f)]===0x0)return console[_0x310b66(0x1c7)](_0x310b66(0x162)),console[_0x310b66(0x1c7)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x1adf67,childId:_0x292e8d}=parseSegmentRef(_0x284e17[0x0]);_0x282202[_0x310b66(0x1bb)]&&(console[_0x310b66(0x1c7)](_0x310b66(0x1ac)+_0x282202[_0x310b66(0x14d)]),console[_0x310b66(0x1c7)](_0x310b66(0x18e)+_0x1adf67),_0x292e8d&&console[_0x310b66(0x1c7)](_0x310b66(0x1bf)+_0x292e8d));if(!_0x292e8d)return console[_0x310b66(0x1c7)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x197fed=await withSpinner(_0x310b66(0x193)+_0x1adf67+_0x310b66(0x1ca),()=>_0x5dd3bd[_0x310b66(0x167)]['resolveParentId'](_0x1adf67),{'verbose':_0x282202['verbose']}),_0x2776bd=_0x197fed[_0x310b66(0x191)];_0x282202['verbose']&&console[_0x310b66(0x1c7)](_0x310b66(0x152)+_0x2776bd);const _0x18f4f8=await withSpinner(_0x310b66(0x1a1)+_0x292e8d+_0x310b66(0x1ca),()=>_0x5dd3bd[_0x310b66(0x167)][_0x310b66(0x194)](_0x2776bd,_0x292e8d),{'verbose':_0x282202[_0x310b66(0x1bb)]}),_0x129a34=_0x18f4f8[_0x310b66(0x191)];_0x282202[_0x310b66(0x1bb)]&&console['error'](_0x310b66(0x17c)+_0x129a34);const _0x1b6c7c=await withSpinner(_0x310b66(0x1b3)+_0x292e8d+_0x310b66(0x1ca),()=>_0x5dd3bd['segment'][_0x310b66(0x16f)](_0x129a34),{'verbose':_0x282202[_0x310b66(0x1bb)]});return await handleSDKOutput([_0x1b6c7c['data']],_0x282202),0x0;}catch(_0x198820){if(_0x198820 instanceof SDKError)return console[_0x310b66(0x1c7)](_0x310b66(0x1ee)+_0x198820[_0x310b66(0x165)]),_0x198820[_0x310b66(0x172)]&&console[_0x310b66(0x1c7)](_0x310b66(0x17b)+_0x198820['cause']),0x1;throw _0x198820;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x43f177(0x16c)]=a31_0x43f177(0x1a0);['description']=a31_0x43f177(0x188);async[a31_0x43f177(0x171)](_0x29773a){const _0x3b960e=a31_0x43f177,{options:_0x10fb01,args:_0x39a791}=_0x29773a,_0x3736d2=_0x10fb01,_0x4f52e5=_0x3736d2['path'],_0x3466b0=_0x39a791[0x0];if(!_0x3466b0&&!_0x4f52e5)return console['error'](a31_0x5c1093['red'](_0x3b960e(0x15d))),console[_0x3b960e(0x1c7)]('Usage:'),console[_0x3b960e(0x1c7)]('\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>'),console[_0x3b960e(0x1c7)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0x3b960e(0x1c7)]('Examples:'),console['error'](_0x3b960e(0x1d3)),console['error'](_0x3b960e(0x1b7)),0x1;if(_0x3466b0&&_0x4f52e5)return console[_0x3b960e(0x1c7)](a31_0x5c1093[_0x3b960e(0x150)](_0x3b960e(0x1a4))),0x1;try{let _0x5c3baa;if(_0x4f52e5)_0x5c3baa=await this[_0x3b960e(0x1d8)](_0x4f52e5,_0x29773a);else{if(isYamlFilePath(_0x3466b0))return console[_0x3b960e(0x1c7)](a31_0x5c1093[_0x3b960e(0x150)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x3b960e(0x1c7)](_0x3b960e(0x1ce)+_0x3466b0),0x1;else _0x5c3baa=await this[_0x3b960e(0x176)](_0x3466b0,_0x29773a);}return _0x10fb01[_0x3b960e(0x1d4)]===_0x3b960e(0x1da)||_0x10fb01[_0x3b960e(0x1d4)]===_0x3b960e(0x174)?await handleSDKOutput([{'sql':_0x5c3baa}],_0x10fb01):console['log'](_0x5c3baa),0x0;}catch(_0x382a7d){if(_0x382a7d instanceof SDKError)return console[_0x3b960e(0x1c7)](_0x3b960e(0x1ee)+_0x382a7d['message']),_0x382a7d['cause']&&console[_0x3b960e(0x1c7)](_0x3b960e(0x17b)+_0x382a7d[_0x3b960e(0x172)]),0x1;throw _0x382a7d;}}async['getSQLFromYamlFile'](_0x342179,_0x212572){const _0x1523d7=a31_0x43f177,{options:_0x59ab29,tdx:_0x36283c}=_0x212572;let _0x14dfbc;try{_0x14dfbc=await resolveYamlFilePath(_0x342179);}catch(_0x26847b){throw new SDKError(ErrorCode[_0x1523d7(0x1d6)],_0x1523d7(0x1b5)+_0x26847b[_0x1523d7(0x165)]);}_0x59ab29[_0x1523d7(0x1bb)]&&console[_0x1523d7(0x1c7)]('Resolved:\x20'+_0x14dfbc['parentSegment']+'/'+_0x14dfbc[_0x1523d7(0x1d7)]);const _0x7db64=await withSpinner(_0x1523d7(0x1a7),()=>_0x36283c['segment']['getSegmentSQLFromYaml'](_0x14dfbc[_0x1523d7(0x16b)],_0x14dfbc['parentSegment'],_0x14dfbc[_0x1523d7(0x1d7)]),{'verbose':_0x59ab29['verbose']});return _0x7db64[_0x1523d7(0x191)];}async[a31_0x43f177(0x176)](_0x20818f,_0x2263e4){const _0x4e787f=a31_0x43f177,{options:_0x24d58e,tdx:_0x46b741}=_0x2263e4,_0x15c8a6=_0x24d58e[_0x4e787f(0x14e)],_0x1ff00a=await resolveSegmentTarget(_0x20818f,_0x15c8a6,_0x24d58e['verbose']);_0x24d58e[_0x4e787f(0x1bb)]&&console['error'](_0x4e787f(0x19c)+_0x1ff00a);const _0x367de0=await withSpinner('Resolving\x20\x27'+_0x20818f+'\x27...',()=>_0x46b741['segment']['resolvePathToResource'](_0x1ff00a),{'verbose':_0x24d58e[_0x4e787f(0x1bb)]}),_0x4d17df=_0x367de0[_0x4e787f(0x191)];_0x24d58e[_0x4e787f(0x1bb)]&&(console[_0x4e787f(0x1c7)](_0x4e787f(0x15a)+_0x4d17df['type']),console[_0x4e787f(0x1c7)](_0x4e787f(0x160)+_0x4d17df[_0x4e787f(0x197)]));if(_0x4d17df[_0x4e787f(0x1aa)]===_0x4e787f(0x1e9))throw new SDKError(ErrorCode[_0x4e787f(0x1d6)],_0x4e787f(0x192));if(_0x4d17df[_0x4e787f(0x1aa)]==='parent')throw new SDKError(ErrorCode[_0x4e787f(0x1d6)],_0x4e787f(0x1b1));if(!_0x4d17df[_0x4e787f(0x1b9)])throw new SDKError(ErrorCode[_0x4e787f(0x1ea)],_0x4e787f(0x182));const _0x739804=await withSpinner(_0x4e787f(0x19a),()=>_0x46b741['segment'][_0x4e787f(0x149)](_0x4d17df['parentId'],_0x4d17df[_0x4e787f(0x1b9)]),{'verbose':_0x24d58e['verbose']});return _0x739804[_0x4e787f(0x191)];}}function a31_0x5dd3(){const _0x29b4a3=['segment:view','Examples:','limit','\x20\x20tdx\x20sg\x20sql\x20--path\x20','(root)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','format','Fetching\x20parent\x20segment\x20details...','INVALID_ARGUMENT','segmentName','getSQLFromYamlFile','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','json','resolvePathToResource','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','parent','jobId','Show\x20child\x20segment\x20schema\x20(column\x20types)','Show\x20folder\x20or\x20child\x20segment\x20details','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Use:\x20tdx\x20ps\x20show','replace','Use:\x20tdx\x20ps\x20view','description','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','listFolders','folder','SEGMENT_NOT_FOUND','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Folder\x20ID:\x20','segment:desc','Error:\x20','getSegmentSQL','SEGMENT_FOLDER_NOT_FOUND','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','resolveParentId','site','parentSegment','\x27\x20with\x20ID:\x20','red','Listing\x20folders\x20for\x20parent\x20\x27','Resolved\x20parent\x20ID:\x20','Segment\x20ID:\x20','toLocaleString','\x20folder','folderPath','1031051RvCyTK','βœ”\x20Created\x20folder\x20\x27','Use:\x20tdx\x20ps\x20view\x20-w','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','14092xVbRfI','green','Parent\x20ID:\x20','folderId','Error:\x20Folder\x20reference\x20is\x20required','Create\x20segment\x20folder\x20for\x20organization','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','message','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','segment','Resolved\x20relative\x20path\x20to:\x20','995232XdYnLu','Creating\x20folder\x20\x27','content','name','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','βœ”\x20Found\x20','getFolder','Use:\x20tdx\x20ps\x20desc','execute','cause','Resolved\x20YAML\x20file:\x20','jsonl','information_schema','getSQLFromServerSegment','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','βœ”\x20Query\x20completed:\x20Processed\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Fetching\x20segment\x20details...','\x20\x20Cause:\x20','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','261uckSFT','Resolving\x20\x27','createFolder','segment:show','Segment\x20ID\x20missing\x20from\x20resolved\x20path','elapsedTimeMillis','segmentPath','Resolved\x20parent\x20folder\x20ID:\x20','trim','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Get\x20SQL\x20query\x20for\x20child\x20segment','/e/','stats','Error:\x20Path\x20or\x20name\x20is\x20required','/app/ps/','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Parent\x20name:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','data','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','\x20\x20Folder\x20path:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','parentId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20SQL\x20for\x20segment...','setJobId','Target\x20path:\x20','791062HJbPzW','Resolving\x20path\x20\x27','length','segment:sql','Resolving\x20folder\x20\x27','2059782HsPEPj','includes','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','1543845hhPsIC','Show\x20segment\x20or\x20folder\x20details','Fetching\x20SQL\x20from\x20rule...','Parent\x20segment:\x20','web','type','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Site:\x20','url','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','238091iAqMdj','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','Executing\x20segment\x20query...','Fetching\x20folder\x20\x27','βœ–\x20Query\x20failed\x20[','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20[Job\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','cyan','segmentId','query','verbose','test','\x20\x20Segment\x20name:\x20','Fetching\x20folder\x20details...','Folder\x20name:\x20','\x20rows\x20','Show\x20segment\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','segment:describe','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','processedRows','getSegment','error','segment:folder:list','fullPath','\x27...'];a31_0x5dd3=function(){return _0x29b4a3;};return a31_0x5dd3();}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0x43f177(0x16c)]='segment:folder:create';[a31_0x43f177(0x1e6)]=a31_0x43f177(0x163);async[a31_0x43f177(0x171)](_0x33bd55){const _0x507cff=a31_0x43f177,{options:_0x5d0fd1,args:_0x1f60b1,tdx:_0x201f35}=_0x33bd55,_0x1c1e1c=_0x5d0fd1;if(_0x1f60b1[_0x507cff(0x19f)]<0x2)return console[_0x507cff(0x1c7)](_0x507cff(0x179)),console[_0x507cff(0x1c7)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3e1874=_0x1f60b1[0x0],_0x124b63=_0x1f60b1[0x1];_0x1c1e1c[_0x507cff(0x1bb)]&&(console['error'](_0x507cff(0x1ac)+_0x1c1e1c['site']),console[_0x507cff(0x1c7)](_0x507cff(0x1a8)+_0x3e1874),console[_0x507cff(0x1c7)](_0x507cff(0x1bf)+_0x124b63));let _0x49af18;if(_0x1c1e1c['parentFolder']){const _0x3d02f1=_0x1c1e1c['parentFolder'],_0x4d2fb7=await withSpinner(_0x507cff(0x193)+_0x3e1874+_0x507cff(0x1ca),()=>_0x201f35[_0x507cff(0x167)][_0x507cff(0x14c)](_0x3e1874),{'verbose':_0x1c1e1c[_0x507cff(0x1bb)]}),_0x29ab89=_0x4d2fb7[_0x507cff(0x191)],_0x35a5a5=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x3d02f1+_0x507cff(0x1ca),()=>_0x201f35[_0x507cff(0x167)][_0x507cff(0x194)](_0x29ab89,_0x3d02f1),{'verbose':_0x1c1e1c['verbose']});_0x49af18=_0x35a5a5[_0x507cff(0x191)],_0x1c1e1c[_0x507cff(0x1bb)]&&console['error'](_0x507cff(0x185)+_0x49af18);}const _0x29ef32={'name':_0x124b63,'description':_0x1c1e1c['description'],'parentFolderId':_0x49af18},_0x4838e4=await withSpinner(_0x507cff(0x16a)+_0x124b63+_0x507cff(0x1ca),()=>_0x201f35['segment'][_0x507cff(0x180)](_0x3e1874,_0x29ef32),{'verbose':_0x1c1e1c[_0x507cff(0x1bb)]}),_0x4c1c27=_0x4838e4[_0x507cff(0x191)];return console[_0x507cff(0x1c7)](_0x507cff(0x158)+_0x4c1c27[_0x507cff(0x16c)]+_0x507cff(0x14f)+_0x4c1c27['id']),await handleSDKOutput([_0x4c1c27],_0x1c1e1c),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a31_0x43f177(0x1cb);[a31_0x43f177(0x1e6)]=a31_0x43f177(0x1e1);async['execute'](_0x3c1061){const _0x5276e2=a31_0x43f177,{options:_0x2cc91e,args:_0x2adf9a,tdx:_0x4a0a2f}=_0x3c1061,_0x36f8e2=_0x2adf9a[0x0];if(!_0x36f8e2)return console['error'](_0x5276e2(0x196)),console[_0x5276e2(0x1c7)](_0x5276e2(0x177)),console[_0x5276e2(0x1c7)](_0x5276e2(0x1d0)),console[_0x5276e2(0x1c7)]('Options:'),console[_0x5276e2(0x1c7)](_0x5276e2(0x1af)),console[_0x5276e2(0x1c7)](_0x5276e2(0x1cc)),console[_0x5276e2(0x1c7)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x5276e2(0x1c7)](_0x5276e2(0x18f)),console[_0x5276e2(0x1c7)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x5276e2(0x1c7)](_0x5276e2(0x166)),0x1;try{const _0x4244c0=_0x2cc91e[_0x5276e2(0x14e)],_0x274aa8=await resolveSegmentTarget(_0x36f8e2,_0x4244c0,_0x2cc91e[_0x5276e2(0x1bb)]);_0x2cc91e['verbose']&&console[_0x5276e2(0x1c7)](_0x5276e2(0x19c)+_0x274aa8);const _0x299b81=await withSpinner(_0x5276e2(0x17f)+_0x36f8e2+'\x27...',()=>_0x4a0a2f[_0x5276e2(0x167)][_0x5276e2(0x1db)](_0x274aa8),{'verbose':_0x2cc91e[_0x5276e2(0x1bb)]}),_0x2662a4=_0x299b81[_0x5276e2(0x191)];_0x2cc91e[_0x5276e2(0x1bb)]&&(console[_0x5276e2(0x1c7)](_0x5276e2(0x15a)+_0x2662a4[_0x5276e2(0x1aa)]),console[_0x5276e2(0x1c7)](_0x5276e2(0x160)+_0x2662a4[_0x5276e2(0x197)]),_0x2662a4[_0x5276e2(0x161)]&&console['error'](_0x5276e2(0x1ec)+_0x2662a4['folderId']),_0x2662a4[_0x5276e2(0x1b9)]&&console[_0x5276e2(0x1c7)](_0x5276e2(0x153)+_0x2662a4['segmentId']));if(_0x2cc91e[_0x5276e2(0x1a9)]){if(_0x2662a4['type']==='folder')return console[_0x5276e2(0x1c7)](_0x5276e2(0x1dd)),0x1;if(_0x2662a4[_0x5276e2(0x1aa)]===_0x5276e2(0x1de))return console[_0x5276e2(0x1c7)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5276e2(0x1c7)](_0x5276e2(0x159)),0x1;if(!_0x2662a4['segmentId'])throw new SDKError(ErrorCode[_0x5276e2(0x1ea)],_0x5276e2(0x182));const _0x118127=getConsoleNextUrl(_0x2cc91e[_0x5276e2(0x14d)],_0x5276e2(0x18c)+_0x2662a4[_0x5276e2(0x197)]+_0x5276e2(0x189)+_0x2662a4[_0x5276e2(0x1b9)]);return console[_0x5276e2(0x1c7)](a31_0x5c1093[_0x5276e2(0x15f)]('βœ”')+'\x20Opening\x20'+a31_0x5c1093[_0x5276e2(0x1b8)](_0x118127)),openBrowser(_0x118127),0x0;}if(_0x2662a4[_0x5276e2(0x1aa)]==='folder'){if(!_0x2662a4[_0x5276e2(0x161)])throw new SDKError(ErrorCode[_0x5276e2(0x14a)],_0x5276e2(0x199));const _0x33f9c8=await withSpinner(_0x5276e2(0x1be),()=>_0x4a0a2f[_0x5276e2(0x167)][_0x5276e2(0x16f)](_0x2662a4['folderId']),{'verbose':_0x2cc91e[_0x5276e2(0x1bb)]});await handleSingleObjectOutput(_0x33f9c8['data'],_0x2cc91e);}else{if(_0x2662a4['type']==='segment'){if(!_0x2662a4['segmentId'])throw new SDKError(ErrorCode[_0x5276e2(0x1ea)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x48c163=await withSpinner(_0x5276e2(0x17a),()=>_0x4a0a2f[_0x5276e2(0x167)][_0x5276e2(0x1c6)](_0x2662a4['parentId'],_0x2662a4[_0x5276e2(0x1b9)]),{'verbose':_0x2cc91e[_0x5276e2(0x1bb)]}),_0x1a2a91=getConsoleNextUrl(_0x2cc91e[_0x5276e2(0x14d)],'/app/ps/'+_0x2662a4['parentId']+_0x5276e2(0x189)+_0x2662a4[_0x5276e2(0x1b9)]),_0x477374=_0x48c163[_0x5276e2(0x191)];_0x477374[_0x5276e2(0x1ad)]=_0x1a2a91,await handleSingleObjectOutput(_0x477374,_0x2cc91e);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x5276e2(0x1c7)](_0x5276e2(0x1e5)),0x1;}return 0x0;}catch(_0x3f00de){if(_0x3f00de instanceof SDKError)return console[_0x5276e2(0x1c7)](_0x5276e2(0x1ee)+_0x3f00de[_0x5276e2(0x165)]),_0x3f00de[_0x5276e2(0x172)]&&console[_0x5276e2(0x1c7)](_0x5276e2(0x17b)+_0x3f00de[_0x5276e2(0x172)]),0x1;throw _0x3f00de;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x43f177(0x16c)]=a31_0x43f177(0x1ed);[a31_0x43f177(0x1e6)]=a31_0x43f177(0x1e0);async[a31_0x43f177(0x171)](_0x4d668e){const _0x1feca0=a31_0x43f177,{options:_0x448752,args:_0x5abf9d,tdx:_0x37ae5e}=_0x4d668e,_0x54424e=_0x5abf9d[0x0];if(!_0x54424e)return console[_0x1feca0(0x1c7)](_0x1feca0(0x187)),console[_0x1feca0(0x1c7)](_0x1feca0(0x1d2)),console['error'](_0x1feca0(0x1c2)),console['error'](_0x1feca0(0x1cc)),console['error'](_0x1feca0(0x1d1)),console[_0x1feca0(0x1c7)](_0x1feca0(0x1e7)),0x1;try{const _0x35ab72=_0x448752[_0x1feca0(0x14e)],_0x1fe999=await resolveSegmentTarget(_0x54424e,_0x35ab72,_0x448752[_0x1feca0(0x1bb)]);_0x448752[_0x1feca0(0x1bb)]&&console['error'](_0x1feca0(0x19c)+_0x1fe999);const _0x1095b9=await withSpinner(_0x1feca0(0x17f)+_0x54424e+_0x1feca0(0x1ca),()=>_0x37ae5e[_0x1feca0(0x167)][_0x1feca0(0x1db)](_0x1fe999),{'verbose':_0x448752[_0x1feca0(0x1bb)]}),_0x98b865=_0x1095b9[_0x1feca0(0x191)];_0x448752[_0x1feca0(0x1bb)]&&(console[_0x1feca0(0x1c7)]('Resolved\x20type:\x20'+_0x98b865[_0x1feca0(0x1aa)]),console[_0x1feca0(0x1c7)](_0x1feca0(0x160)+_0x98b865['parentId']));if(_0x98b865[_0x1feca0(0x1aa)]==='folder')return console[_0x1feca0(0x1c7)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x1feca0(0x1c7)](_0x1feca0(0x1d9)),0x1;if(_0x98b865[_0x1feca0(0x1aa)]===_0x1feca0(0x1de))return console[_0x1feca0(0x1c7)](_0x1feca0(0x18d)),console[_0x1feca0(0x1c7)](_0x1feca0(0x170)),0x1;if(!_0x98b865[_0x1feca0(0x1b9)])throw new SDKError(ErrorCode[_0x1feca0(0x1ea)],_0x1feca0(0x182));const _0x2c3af5=await withSpinner(_0x1feca0(0x19a),()=>_0x37ae5e['segment'][_0x1feca0(0x149)](_0x98b865[_0x1feca0(0x197)],_0x98b865[_0x1feca0(0x1b9)]),{'verbose':_0x448752[_0x1feca0(0x1bb)]}),_0x408bfa=_0x2c3af5[_0x1feca0(0x191)],_0x3348cb=await executeSchemaQuery(_0x408bfa,_0x37ae5e,_0x448752);return await handleQueryOutput(_0x3348cb,_0x448752),0x0;}catch(_0x426b30){if(_0x426b30 instanceof SDKError)return console[_0x1feca0(0x1c7)](_0x1feca0(0x1ee)+_0x426b30['message']),_0x426b30[_0x1feca0(0x172)]&&console[_0x1feca0(0x1c7)](_0x1feca0(0x17b)+_0x426b30['cause']),0x1;throw _0x426b30;}}}
@@ -1 +1 @@
1
- const a32_0x48d71c=a32_0x281b;(function(_0x2776b1,_0x569a33){const _0xc57f09=a32_0x281b,_0x2ce748=_0x2776b1();while(!![]){try{const _0x27381a=parseInt(_0xc57f09(0xdc))/0x1+-parseInt(_0xc57f09(0xf6))/0x2*(-parseInt(_0xc57f09(0xfb))/0x3)+parseInt(_0xc57f09(0xe2))/0x4*(-parseInt(_0xc57f09(0xe3))/0x5)+parseInt(_0xc57f09(0xf7))/0x6+-parseInt(_0xc57f09(0xe8))/0x7+parseInt(_0xc57f09(0xfd))/0x8+-parseInt(_0xc57f09(0xcf))/0x9;if(_0x27381a===_0x569a33)break;else _0x2ce748['push'](_0x2ce748['shift']());}catch(_0x18639d){_0x2ce748['push'](_0x2ce748['shift']());}}}(a32_0x4a8b,0x40bba));function a32_0x281b(_0xc53d06,_0x5a5893){_0xc53d06=_0xc53d06-0xcd;const _0x4a8b51=a32_0x4a8b();let _0x281ba1=_0x4a8b51[_0xc53d06];return _0x281ba1;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a32_0x4a8b(){const _0x48fbeb=['Resolved\x20relative\x20path\x20to:\x20','450422cDVVgs','Site:\x20','segment','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Target\x20path:\x20','execute','636zvSVoI','4815rVBPUy','folder','Resolving\x20parent\x20segment\x20\x27','description','Creating\x20segment\x20\x27','784623aRQLdF','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','kind','type','segments','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','resolvePathToResource','Create\x20child\x20segment\x20with\x20filtering\x20rules','Parent:\x20','createSegment','error','\x27...','resolveParentId','167572eRZWcS','2808900mpadEA','invisible','data','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','3OfkEXD','verbose','3288488QpZOkK','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','includes','\x20\x20\x20Path:\x20','7947603rmMXBX','site','length','segmentPath','parent','folderId','segment:create','noCountPopulation','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','name','\x27\x20with\x20ID:\x20','yellow'];a32_0x4a8b=function(){return _0x48fbeb;};return a32_0x4a8b();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a32_0x20eeef from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x48d71c(0xd8)]=a32_0x48d71c(0xd5);[a32_0x48d71c(0xe6)]=a32_0x48d71c(0xf0);async[a32_0x48d71c(0xe1)](_0x32928a){const _0x101b7d=a32_0x48d71c;console['error'](a32_0x20eeef['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a32_0x20eeef[_0x101b7d(0xda)](_0x101b7d(0xe9)));const {options:_0x567df6,args:_0x2bae29,tdx:_0x432f55}=_0x32928a,_0x24c9e2=_0x567df6;if(_0x2bae29[_0x101b7d(0xd1)]===0x0)return console['error'](_0x101b7d(0xdf)),console[_0x101b7d(0xf3)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x101b7d(0xf3)]('Examples:'),console[_0x101b7d(0xf3)](_0x101b7d(0xfa)),console['error'](_0x101b7d(0xd7)),console[_0x101b7d(0xf3)](_0x101b7d(0xed)),0x1;const _0x3b760b=_0x2bae29[0x0],_0x4d23f2=_0x567df6[_0x101b7d(0xd2)];let _0x32d0ec=_0x3b760b;_0x4d23f2&&!_0x3b760b[_0x101b7d(0xcd)]('/')&&(_0x32d0ec=_0x4d23f2+'/'+_0x3b760b,_0x24c9e2[_0x101b7d(0xfc)]&&console[_0x101b7d(0xf3)](_0x101b7d(0xdb)+_0x32d0ec));const _0x22b426=parsePath(_0x32d0ec);if(_0x22b426[_0x101b7d(0xec)]['length']<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x101b7d(0xf3)](_0x101b7d(0xee)),0x1;const _0x5d1043=_0x22b426[_0x101b7d(0xec)][0x0],_0x4881c9=getBaseName(_0x32d0ec),_0x51a422=getParentPath(_0x32d0ec);_0x24c9e2[_0x101b7d(0xfc)]&&(console['error'](_0x101b7d(0xdd)+_0x24c9e2[_0x101b7d(0xd0)]),console[_0x101b7d(0xf3)](_0x101b7d(0xe0)+_0x32d0ec),console[_0x101b7d(0xf3)](_0x101b7d(0xf1)+_0x5d1043),console['error']('Segment\x20name:\x20'+_0x4881c9),console[_0x101b7d(0xf3)]('Parent\x20path:\x20'+_0x51a422));const _0x1c1e53=await withSpinner(_0x101b7d(0xe5)+_0x5d1043+'\x27...',()=>_0x432f55[_0x101b7d(0xde)][_0x101b7d(0xf5)](_0x5d1043),{'verbose':_0x24c9e2[_0x101b7d(0xfc)]}),_0x1a9419=_0x1c1e53[_0x101b7d(0xf9)];let _0x222ca9;if(_0x22b426['segments'][_0x101b7d(0xd1)]>0x2){const _0x90c9d1=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x51a422+_0x101b7d(0xf4),()=>_0x432f55[_0x101b7d(0xde)][_0x101b7d(0xef)](_0x51a422),{'verbose':_0x24c9e2[_0x101b7d(0xfc)]}),_0x340ec1=_0x90c9d1[_0x101b7d(0xf9)];if(_0x340ec1[_0x101b7d(0xeb)]!=='folder'&&_0x340ec1['type']!==_0x101b7d(0xd3))return console[_0x101b7d(0xf3)](_0x101b7d(0xff)),0x1;_0x222ca9=_0x340ec1[_0x101b7d(0xd4)];}else{if(_0x24c9e2['folder']){const _0x5551a6=await withSpinner('Resolving\x20folder\x20\x27'+_0x24c9e2['folder']+_0x101b7d(0xf4),()=>_0x432f55[_0x101b7d(0xde)]['resolveFolderId'](_0x1a9419,_0x24c9e2[_0x101b7d(0xe4)]),{'verbose':_0x24c9e2[_0x101b7d(0xfc)]});_0x222ca9=_0x5551a6[_0x101b7d(0xf9)];}}_0x24c9e2[_0x101b7d(0xfc)]&&_0x222ca9&&console[_0x101b7d(0xf3)](_0x101b7d(0xfe)+_0x222ca9);const _0x12db09=await loadJSONFromOptions(_0x24c9e2['rule'],_0x24c9e2['ruleFile']),_0x36c95a={'name':_0x4881c9,'description':_0x24c9e2[_0x101b7d(0xe6)],'rule':_0x12db09,'kind':_0x24c9e2[_0x101b7d(0xea)]!==undefined?parseInt(_0x24c9e2['kind'],0xa):undefined,'isVisible':_0x24c9e2[_0x101b7d(0xf8)]?![]:undefined,'segmentFolderId':_0x222ca9,'countPopulation':_0x24c9e2[_0x101b7d(0xd6)]?![]:undefined},_0x3ed9d6=await withSpinner(_0x101b7d(0xe7)+_0x4881c9+_0x101b7d(0xf4),()=>_0x432f55['segment'][_0x101b7d(0xf2)](_0x1a9419,_0x36c95a),{'verbose':_0x24c9e2[_0x101b7d(0xfc)]}),_0x3ee334=_0x3ed9d6[_0x101b7d(0xf9)];return console['error']('βœ”\x20Created\x20segment\x20\x27'+_0x3ee334[_0x101b7d(0xd8)]+_0x101b7d(0xd9)+_0x3ee334['id']),_0x32d0ec!==_0x3b760b&&console[_0x101b7d(0xf3)](_0x101b7d(0xce)+_0x32d0ec),await handleSDKOutput([_0x3ee334],_0x24c9e2),0x0;}}
1
+ function a32_0x5b63(){const _0x262652=['error','Resolving\x20folder\x20\x27','folder','data','Resolved\x20folder\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x27...','ruleFile','Segment\x20name:\x20','segments','99VbzNeU','31733515tFLaGh','28190GHCHGO','βœ”\x20Created\x20segment\x20\x27','rule','Creating\x20segment\x20\x27','1800684qPgHaK','segmentPath','length','resolveFolderId','parent','kind','noCountPopulation','370Wjzitf','\x20\x20\x20Path:\x20','description','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','segment','resolvePathToResource','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','verbose','77156JceQXf','site','2446260HliwyG','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','invisible','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','5726497mgVEtt','resolveParentId','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Parent:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','name','type','8vlGqyS','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','70368yBywVD','64knyENt','Site:\x20','Resolved\x20relative\x20path\x20to:\x20','segment:create','folderId','Examples:','Resolving\x20parent\x20segment\x20\x27','yellow','includes'];a32_0x5b63=function(){return _0x262652;};return a32_0x5b63();}const a32_0x2c4fbb=a32_0x20c1;(function(_0x3823ad,_0x58dcff){const _0x4c75cc=a32_0x20c1,_0x5ad510=_0x3823ad();while(!![]){try{const _0x22f4de=parseInt(_0x4c75cc(0x15b))/0x1*(-parseInt(_0x4c75cc(0x137))/0x2)+-parseInt(_0x4c75cc(0x135))/0x3*(-parseInt(_0x4c75cc(0x14a))/0x4)+-parseInt(_0x4c75cc(0x142))/0x5*(parseInt(_0x4c75cc(0x15a))/0x6)+-parseInt(_0x4c75cc(0x150))/0x7*(parseInt(_0x4c75cc(0x158))/0x8)+-parseInt(_0x4c75cc(0x13b))/0x9+-parseInt(_0x4c75cc(0x14c))/0xa+parseInt(_0x4c75cc(0x136))/0xb;if(_0x22f4de===_0x58dcff)break;else _0x5ad510['push'](_0x5ad510['shift']());}catch(_0x504222){_0x5ad510['push'](_0x5ad510['shift']());}}}(a32_0x5b63,0x774e5));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a32_0x20c1(_0x5e8450,_0x2345f2){_0x5e8450=_0x5e8450-0x12a;const _0x5b6353=a32_0x5b63();let _0x20c19c=_0x5b6353[_0x5e8450];return _0x20c19c;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a32_0xbe9dbd from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x2c4fbb(0x156)]=a32_0x2c4fbb(0x15e);[a32_0x2c4fbb(0x144)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0x3dd012){const _0x1892cc=a32_0x2c4fbb;console['error'](a32_0xbe9dbd[_0x1892cc(0x162)](_0x1892cc(0x145))),console[_0x1892cc(0x12b)](a32_0xbe9dbd[_0x1892cc(0x162)](_0x1892cc(0x130)));const {options:_0x451919,args:_0x5ab2d4,tdx:_0x5f398f}=_0x3dd012,_0x1228fa=_0x451919;if(_0x5ab2d4[_0x1892cc(0x13d)]===0x0)return console[_0x1892cc(0x12b)](_0x1892cc(0x155)),console[_0x1892cc(0x12b)](_0x1892cc(0x152)),console[_0x1892cc(0x12b)](_0x1892cc(0x160)),console[_0x1892cc(0x12b)](_0x1892cc(0x148)),console[_0x1892cc(0x12b)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x1892cc(0x153)),0x1;const _0x302beb=_0x5ab2d4[0x0],_0xc9b182=_0x451919[_0x1892cc(0x13c)];let _0x1f65a7=_0x302beb;_0xc9b182&&!_0x302beb[_0x1892cc(0x12a)]('/')&&(_0x1f65a7=_0xc9b182+'/'+_0x302beb,_0x1228fa[_0x1892cc(0x149)]&&console[_0x1892cc(0x12b)](_0x1892cc(0x15d)+_0x1f65a7));const _0x57f6c3=parsePath(_0x1f65a7);if(_0x57f6c3[_0x1892cc(0x134)]['length']<0x2)return console[_0x1892cc(0x12b)](_0x1892cc(0x14d)),console['error'](_0x1892cc(0x159)),0x1;const _0x2ea393=_0x57f6c3[_0x1892cc(0x134)][0x0],_0x380521=getBaseName(_0x1f65a7),_0x29f62d=getParentPath(_0x1f65a7);_0x1228fa[_0x1892cc(0x149)]&&(console[_0x1892cc(0x12b)](_0x1892cc(0x15c)+_0x1228fa[_0x1892cc(0x14b)]),console[_0x1892cc(0x12b)]('Target\x20path:\x20'+_0x1f65a7),console[_0x1892cc(0x12b)](_0x1892cc(0x154)+_0x2ea393),console[_0x1892cc(0x12b)](_0x1892cc(0x133)+_0x380521),console['error']('Parent\x20path:\x20'+_0x29f62d));const _0x49536e=await withSpinner(_0x1892cc(0x161)+_0x2ea393+_0x1892cc(0x131),()=>_0x5f398f[_0x1892cc(0x146)][_0x1892cc(0x151)](_0x2ea393),{'verbose':_0x1228fa[_0x1892cc(0x149)]}),_0x36a36c=_0x49536e[_0x1892cc(0x12e)];let _0x13538f;if(_0x57f6c3[_0x1892cc(0x134)][_0x1892cc(0x13d)]>0x2){const _0x1aa30d=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x29f62d+_0x1892cc(0x131),()=>_0x5f398f[_0x1892cc(0x146)][_0x1892cc(0x147)](_0x29f62d),{'verbose':_0x1228fa[_0x1892cc(0x149)]}),_0x3155b6=_0x1aa30d['data'];if(_0x3155b6[_0x1892cc(0x157)]!=='folder'&&_0x3155b6['type']!==_0x1892cc(0x13f))return console[_0x1892cc(0x12b)](_0x1892cc(0x14f)),0x1;_0x13538f=_0x3155b6[_0x1892cc(0x15f)];}else{if(_0x1228fa['folder']){const _0x538101=await withSpinner(_0x1892cc(0x12c)+_0x1228fa[_0x1892cc(0x12d)]+_0x1892cc(0x131),()=>_0x5f398f['segment'][_0x1892cc(0x13e)](_0x36a36c,_0x1228fa[_0x1892cc(0x12d)]),{'verbose':_0x1228fa['verbose']});_0x13538f=_0x538101['data'];}}_0x1228fa[_0x1892cc(0x149)]&&_0x13538f&&console['error'](_0x1892cc(0x12f)+_0x13538f);const _0x28d96d=await loadJSONFromOptions(_0x1228fa[_0x1892cc(0x139)],_0x1228fa[_0x1892cc(0x132)]),_0x474c0f={'name':_0x380521,'description':_0x1228fa[_0x1892cc(0x144)],'rule':_0x28d96d,'kind':_0x1228fa[_0x1892cc(0x140)]!==undefined?parseInt(_0x1228fa[_0x1892cc(0x140)],0xa):undefined,'isVisible':_0x1228fa[_0x1892cc(0x14e)]?![]:undefined,'segmentFolderId':_0x13538f,'countPopulation':_0x1228fa[_0x1892cc(0x141)]?![]:undefined},_0x3158e9=await withSpinner(_0x1892cc(0x13a)+_0x380521+_0x1892cc(0x131),()=>_0x5f398f['segment']['createSegment'](_0x36a36c,_0x474c0f),{'verbose':_0x1228fa[_0x1892cc(0x149)]}),_0x3b5b92=_0x3158e9[_0x1892cc(0x12e)];return console[_0x1892cc(0x12b)](_0x1892cc(0x138)+_0x3b5b92[_0x1892cc(0x156)]+'\x27\x20with\x20ID:\x20'+_0x3b5b92['id']),_0x1f65a7!==_0x302beb&&console['error'](_0x1892cc(0x143)+_0x1f65a7),await handleSDKOutput([_0x3b5b92],_0x1228fa),0x0;}}
@@ -1 +1 @@
1
- function a33_0x11da(){const _0x256d6b=['execute','segment:fields','68125xuNXeO','description','3OEzjDi','56BGIqcb','4601044tiLjTs','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20field','24puIKLh','listFields','1007487smviqC','βœ”\x20Found\x20','verbose','\x27...','parentSegment','jsonl','site','segment','error','Error:\x20Parent\x20segment\x20name\x20is\x20required','38qNqBAz','27154FaBCUR','6219590LXUnsk','13675541TKqTZu','length','json','Site:\x20','Parent\x20segment:\x20','156PlywEl','name','451460sHTOco','Listing\x20fields\x20for\x20\x27'];a33_0x11da=function(){return _0x256d6b;};return a33_0x11da();}const a33_0x90070f=a33_0x8565;(function(_0x5839ad,_0x309bb8){const _0x554c83=a33_0x8565,_0x983fae=_0x5839ad();while(!![]){try{const _0x3afdc1=parseInt(_0x554c83(0xc5))/0x1*(parseInt(_0x554c83(0xc4))/0x2)+parseInt(_0x554c83(0xd4))/0x3*(-parseInt(_0x554c83(0xce))/0x4)+parseInt(_0x554c83(0xd2))/0x5*(-parseInt(_0x554c83(0xcc))/0x6)+-parseInt(_0x554c83(0xd6))/0x7+parseInt(_0x554c83(0xd5))/0x8*(-parseInt(_0x554c83(0xdc))/0x9)+-parseInt(_0x554c83(0xc6))/0xa+parseInt(_0x554c83(0xc7))/0xb*(parseInt(_0x554c83(0xda))/0xc);if(_0x3afdc1===_0x309bb8)break;else _0x983fae['push'](_0x983fae['shift']());}catch(_0x5dd833){_0x983fae['push'](_0x983fae['shift']());}}}(a33_0x11da,0x73565));function a33_0x8565(_0x22adca,_0x229976){_0x22adca=_0x22adca-0xbd;const _0x11da14=a33_0x11da();let _0x8565f7=_0x11da14[_0x22adca];return _0x8565f7;}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_0x90070f(0xcd)]=a33_0x90070f(0xd1);[a33_0x90070f(0xd3)]='List\x20available\x20fields\x20for\x20segmentation';async[a33_0x90070f(0xd0)](_0x352623){const _0x3cb1a2=a33_0x90070f,{options:_0x2d1083,args:_0x15ad34,tdx:_0x849ae3}=_0x352623,_0x4ecb2f=_0x15ad34[0x0]||_0x2d1083[_0x3cb1a2(0xbe)];if(!_0x4ecb2f)return console[_0x3cb1a2(0xc2)](_0x3cb1a2(0xc3)),console[_0x3cb1a2(0xc2)](_0x3cb1a2(0xd8)),console[_0x3cb1a2(0xc2)](_0x3cb1a2(0xd7)),0x1;_0x2d1083[_0x3cb1a2(0xde)]&&(console[_0x3cb1a2(0xc2)](_0x3cb1a2(0xca)+_0x2d1083[_0x3cb1a2(0xc0)]),console[_0x3cb1a2(0xc2)](_0x3cb1a2(0xcb)+_0x4ecb2f));const _0x4a9e78=await withSpinner(_0x3cb1a2(0xcf)+_0x4ecb2f+_0x3cb1a2(0xbd),()=>_0x849ae3[_0x3cb1a2(0xc1)][_0x3cb1a2(0xdb)](_0x4ecb2f),{'verbose':_0x2d1083[_0x3cb1a2(0xde)]}),_0xdb42a=_0x4a9e78['data'];console[_0x3cb1a2(0xc2)](_0x3cb1a2(0xdd)+_0xdb42a[_0x3cb1a2(0xc8)]+_0x3cb1a2(0xd9)+(_0xdb42a['length']!==0x1?'s':''));if(_0x2d1083[_0x3cb1a2(0xc9)]||_0x2d1083[_0x3cb1a2(0xbf)])return await handleSDKOutput(_0xdb42a,_0x2d1083),0x0;return displayFieldsHumanReadable(_0xdb42a,_0x4ecb2f),0x0;}}
1
+ const a33_0x23402b=a33_0x5d02;function a33_0x5d02(_0xaa0156,_0x55c73b){_0xaa0156=_0xaa0156-0x1c9;const _0x57a9cd=a33_0x57a9();let _0x5d02dd=_0x57a9cd[_0xaa0156];return _0x5d02dd;}(function(_0x43d918,_0x39e68e){const _0x24ea47=a33_0x5d02,_0x4406b7=_0x43d918();while(!![]){try{const _0x593c6b=-parseInt(_0x24ea47(0x1d0))/0x1+parseInt(_0x24ea47(0x1d7))/0x2*(parseInt(_0x24ea47(0x1df))/0x3)+-parseInt(_0x24ea47(0x1cc))/0x4+-parseInt(_0x24ea47(0x1ce))/0x5+-parseInt(_0x24ea47(0x1de))/0x6*(-parseInt(_0x24ea47(0x1d8))/0x7)+-parseInt(_0x24ea47(0x1ca))/0x8+parseInt(_0x24ea47(0x1da))/0x9;if(_0x593c6b===_0x39e68e)break;else _0x4406b7['push'](_0x4406b7['shift']());}catch(_0x344d9c){_0x4406b7['push'](_0x4406b7['shift']());}}}(a33_0x57a9,0xd8aa8));function a33_0x57a9(){const _0x55bb5c=['data','3051380nYMYBO','βœ”\x20Found\x20','1628219SWMHxV','segment:fields','verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20field','jsonl','segment','140828KhZryu','140luYWmW','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','26630712xHUUfO','Listing\x20fields\x20for\x20\x27','length','description','202758ODRGfG','30tRfgOA','List\x20available\x20fields\x20for\x20segmentation','listFields','name','647272LRytji','error','4528400DmyOSb'];a33_0x57a9=function(){return _0x55bb5c;};return a33_0x57a9();}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_0x23402b(0x1c9)]=a33_0x23402b(0x1d1);[a33_0x23402b(0x1dd)]=a33_0x23402b(0x1e0);async['execute'](_0x5532cc){const _0x2cd4df=a33_0x23402b,{options:_0x534ed2,args:_0x421da7,tdx:_0x2709d7}=_0x5532cc,_0x5a894e=_0x421da7[0x0]||_0x534ed2['parentSegment'];if(!_0x5a894e)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x2cd4df(0x1cb)](_0x2cd4df(0x1d9)),console[_0x2cd4df(0x1cb)](_0x2cd4df(0x1d3)),0x1;_0x534ed2['verbose']&&(console[_0x2cd4df(0x1cb)]('Site:\x20'+_0x534ed2['site']),console[_0x2cd4df(0x1cb)]('Parent\x20segment:\x20'+_0x5a894e));const _0x1c6186=await withSpinner(_0x2cd4df(0x1db)+_0x5a894e+'\x27...',()=>_0x2709d7[_0x2cd4df(0x1d6)][_0x2cd4df(0x1e1)](_0x5a894e),{'verbose':_0x534ed2[_0x2cd4df(0x1d2)]}),_0x4b98ad=_0x1c6186[_0x2cd4df(0x1cd)];console[_0x2cd4df(0x1cb)](_0x2cd4df(0x1cf)+_0x4b98ad[_0x2cd4df(0x1dc)]+_0x2cd4df(0x1d4)+(_0x4b98ad['length']!==0x1?'s':''));if(_0x534ed2['json']||_0x534ed2[_0x2cd4df(0x1d5)])return await handleSDKOutput(_0x4b98ad,_0x534ed2),0x0;return displayFieldsHumanReadable(_0x4b98ad,_0x5a894e),0x0;}}
@@ -1 +1 @@
1
- function a34_0x1f14(_0x24dbbe,_0x2e82ea){_0x24dbbe=_0x24dbbe-0xfc;const _0x3fad74=a34_0x3fad();let _0x1f14c1=_0x3fad74[_0x24dbbe];return _0x1f14c1;}const a34_0x218cf7=a34_0x1f14;(function(_0x28b911,_0x326276){const _0x44c09=a34_0x1f14,_0x21a709=_0x28b911();while(!![]){try{const _0x5049ec=-parseInt(_0x44c09(0x132))/0x1*(-parseInt(_0x44c09(0x136))/0x2)+parseInt(_0x44c09(0x119))/0x3*(-parseInt(_0x44c09(0x126))/0x4)+parseInt(_0x44c09(0x105))/0x5+-parseInt(_0x44c09(0x10e))/0x6+parseInt(_0x44c09(0x135))/0x7+-parseInt(_0x44c09(0x130))/0x8+-parseInt(_0x44c09(0xfe))/0x9;if(_0x5049ec===_0x326276)break;else _0x21a709['push'](_0x21a709['shift']());}catch(_0x3bc541){_0x21a709['push'](_0x21a709['shift']());}}}(a34_0x3fad,0x99abd));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_0x3cd523 from'chalk';function a34_0x3fad(){const _0x1b2bce=['execute','1384458Ovevxb','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','isNew','helpText','βœ”\x20Context\x20set:\x20','\x20with\x20','no_parent','\x20=\x20','\x20files\x20to\x20','resourceName','\x20files?','1731auuXsf','\x0aError:','journeyVersions','parentName','session','Write\x20','error','\x20\x20Target:\x20','data','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','targetDir','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','file','2936BjAOEM','repeat','hasChanges','\x27...','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','Pulling\x20segments\x20from\x20\x27','Error:\x20','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x0aChanges\x20to\x20\x27','verbose','1270848DPsCkL','length','1gUjvLZ','\x20\x20πŸ—ΊοΈ\x20\x20','βœ”\x20Pulled\x20','2305653WTDehq','1302586MNogUL','green','Parent\x20segment:\x20','activations','filter','errorCode','segment:pull','Site:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segment','message','type','cyan','absolutePath','journeys','\x20segments','cwd','6581781MwdWPs','counts','\x20versions)','files','parent_segment','\x20journeys','red','5965955UwBqEy','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','yellow','dim','Aborted.','parentSegment','dirname','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a34_0x3fad=function(){return _0x1b2bce;};return a34_0x3fad();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x5b31bb 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']=a34_0x218cf7(0x13c);['description']=a34_0x218cf7(0x12d);async[a34_0x218cf7(0x10d)](_0x4bda45){const _0xcaa436=a34_0x218cf7,{options:_0x123c3a,args:_0xd470c2,tdx:_0x1ec8c2}=_0x4bda45,_0x18a233=_0x123c3a,_0x2bc657=await resolveTarget({'arg':_0xd470c2[0x0],'contextParent':_0x123c3a[_0xcaa436(0x10a)],'cwd':process[_0xcaa436(0xfd)]()});if(!isSuccessfulResolution(_0x2bc657))return _0x2bc657[_0xcaa436(0x13b)]===_0xcaa436(0x114)?(console[_0xcaa436(0x11f)](a34_0x3cd523[_0xcaa436(0x107)](_0xcaa436(0x10c))),console[_0xcaa436(0x11f)](_0xcaa436(0x106)),console[_0xcaa436(0x11f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0xcaa436(0x11f)](_0xcaa436(0x13e))):(console[_0xcaa436(0x11f)](a34_0x3cd523[_0xcaa436(0x104)](_0xcaa436(0x12c)+_0x2bc657[_0xcaa436(0x140)]+'\x0a')),_0x2bc657[_0xcaa436(0x111)]&&console[_0xcaa436(0x11f)](a34_0x3cd523[_0xcaa436(0x142)](_0x2bc657[_0xcaa436(0x111)]))),0x1;const _0x5e407c=_0x2bc657[_0xcaa436(0x11c)],_0x238557=_0x2bc657[_0xcaa436(0x123)],_0x476147=_0x2bc657[_0xcaa436(0x141)]===_0xcaa436(0x125)?_0x2bc657[_0xcaa436(0x117)]:undefined;_0x18a233['verbose']&&(console[_0xcaa436(0x11f)](_0xcaa436(0x13d)+_0x18a233['site']),console[_0xcaa436(0x11f)](_0xcaa436(0x138)+_0x5e407c),_0x476147&&console[_0xcaa436(0x11f)]('Target\x20resource:\x20'+_0x476147));const _0x8787c0=await withProgressSpinner(_0xcaa436(0x12b)+_0x5e407c+_0xcaa436(0x129),_0x56422d=>_0x1ec8c2[_0xcaa436(0x13f)]['pullSegments'](_0x5e407c,{'targetDir':_0x238557,'targetResourceName':_0x476147,'verbose':_0x18a233[_0xcaa436(0x12f)],'progress':{'update':_0x2dcc9b=>{const _0x2fa592=_0xcaa436;_0x56422d['setPhase'](_0x2dcc9b),_0x18a233[_0x2fa592(0x12f)]&&console[_0x2fa592(0x11f)]('\x20\x20'+_0x2dcc9b);}}}),{'verbose':_0x18a233[_0xcaa436(0x12f)]}),_0xb7a2c6=_0x8787c0[_0xcaa436(0x121)];if(_0xb7a2c6[_0xcaa436(0xff)]['segments']===0x0&&_0xb7a2c6[_0xcaa436(0xff)][_0xcaa436(0x144)]===0x0)return console[_0xcaa436(0x11f)](a34_0x3cd523[_0xcaa436(0x107)](_0xcaa436(0x10f)+_0xb7a2c6[_0xcaa436(0x11c)]+'\x27')),0x0;const _0x1669ab=_0xb7a2c6[_0xcaa436(0x101)][_0xcaa436(0x13a)](_0x4a8e5c=>_0x4a8e5c['isNew']),_0x3823ff=_0xb7a2c6['files'][_0xcaa436(0x13a)](_0x364c3c=>!_0x364c3c[_0xcaa436(0x110)]&&_0x364c3c[_0xcaa436(0x128)]),_0x45e90f=_0xb7a2c6['files'][_0xcaa436(0x13a)](_0x3134ad=>!_0x3134ad[_0xcaa436(0x110)]&&!_0x3134ad[_0xcaa436(0x128)]);console[_0xcaa436(0x11f)]('\x0aPull\x20summary\x20for\x20\x27'+_0xb7a2c6[_0xcaa436(0x11c)]+'\x27:'),console[_0xcaa436(0x11f)]('\x20\x20🎯\x20'+a34_0x3cd523[_0xcaa436(0x142)](_0xb7a2c6[_0xcaa436(0xff)]['segments']+_0xcaa436(0xfc))+_0xcaa436(0x113)+a34_0x3cd523[_0xcaa436(0x142)](_0xb7a2c6['counts'][_0xcaa436(0x139)]+'\x20activations'));if(_0xb7a2c6['counts'][_0xcaa436(0x144)]>0x0){const _0x47da82=_0xb7a2c6[_0xcaa436(0xff)][_0xcaa436(0x11b)]>_0xb7a2c6['counts'][_0xcaa436(0x144)]?'\x20('+_0xb7a2c6[_0xcaa436(0xff)]['journeyVersions']+_0xcaa436(0x100):'';console[_0xcaa436(0x11f)](_0xcaa436(0x133)+a34_0x3cd523[_0xcaa436(0x142)](_0xb7a2c6[_0xcaa436(0xff)][_0xcaa436(0x144)]+_0xcaa436(0x103))+a34_0x3cd523[_0xcaa436(0x108)](_0x47da82));}console[_0xcaa436(0x11f)]('\x20\x20'+a34_0x3cd523[_0xcaa436(0x137)]('+\x20'+_0x1669ab[_0xcaa436(0x131)]+'\x20new\x20files')),console[_0xcaa436(0x11f)]('\x20\x20'+a34_0x3cd523[_0xcaa436(0x107)]('~\x20'+_0x3823ff[_0xcaa436(0x131)]+'\x20changed\x20files')),console[_0xcaa436(0x11f)]('\x20\x20'+a34_0x3cd523[_0xcaa436(0x108)]('=\x20'+_0x45e90f[_0xcaa436(0x131)]+'\x20unchanged\x20files')),console['error'](_0xcaa436(0x120)+a34_0x3cd523[_0xcaa436(0x142)](_0xb7a2c6['targetDir'])+'\x0a');if(_0x3823ff['length']>0x0)for(const _0x55ff9e of _0x3823ff){console[_0xcaa436(0x11f)](_0xcaa436(0x12e)+_0x55ff9e['relativePath']+'\x27:'),console[_0xcaa436(0x11f)]('─'['repeat'](0x3c)),console[_0xcaa436(0x11f)](_0x55ff9e['diff']),console[_0xcaa436(0x11f)]('─'[_0xcaa436(0x127)](0x3c));}if(_0x18a233['dryRun'])return console[_0xcaa436(0x11f)](a34_0x3cd523[_0xcaa436(0x107)](_0xcaa436(0x122))),0x0;if(_0x1669ab[_0xcaa436(0x131)]===0x0&&_0x3823ff[_0xcaa436(0x131)]===0x0)return console[_0xcaa436(0x11f)](a34_0x3cd523['green'](_0xcaa436(0x12a))),saveSessionContext({'parent_segment':_0xb7a2c6[_0xcaa436(0x11c)]},_0x18a233[_0xcaa436(0x11d)]),console['error'](a34_0x3cd523['green'](_0xcaa436(0x112)+a34_0x3cd523[_0xcaa436(0x108)]('parent_segment')+_0xcaa436(0x115)+a34_0x3cd523[_0xcaa436(0x142)](_0xb7a2c6[_0xcaa436(0x11c)]))),0x0;if(!_0x18a233['yes']){if(!isInteractive())return console['error'](a34_0x3cd523[_0xcaa436(0x104)](_0xcaa436(0x11a)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a34_0x3cd523[_0xcaa436(0x108)](_0xcaa436(0x124))),0x1;const _0x276543=await confirmKey(_0xcaa436(0x11e)+(_0x1669ab['length']+_0x3823ff[_0xcaa436(0x131)])+_0xcaa436(0x118));if(!_0x276543)return console[_0xcaa436(0x11f)](a34_0x3cd523[_0xcaa436(0x107)](_0xcaa436(0x109)),'-\x20no\x20files\x20written'),0x1;}for(const _0x23db4e of _0xb7a2c6[_0xcaa436(0x101)]){if(_0x23db4e[_0xcaa436(0x110)]||_0x23db4e['hasChanges']){const _0x14926f=a34_0x5b31bb[_0xcaa436(0x10b)](_0x23db4e[_0xcaa436(0x143)]);!existsSync(_0x14926f)&&mkdirSync(_0x14926f,{'recursive':!![]}),writeFileSync(_0x23db4e[_0xcaa436(0x143)],_0x23db4e['content'],'utf-8');}}return console[_0xcaa436(0x11f)](a34_0x3cd523[_0xcaa436(0x137)](_0xcaa436(0x134)+(_0x1669ab[_0xcaa436(0x131)]+_0x3823ff[_0xcaa436(0x131)])+_0xcaa436(0x116)+_0xb7a2c6[_0xcaa436(0x123)])),saveSessionContext({'parent_segment':_0xb7a2c6[_0xcaa436(0x11c)]},_0x18a233[_0xcaa436(0x11d)]),console[_0xcaa436(0x11f)](a34_0x3cd523['green'](_0xcaa436(0x112)+a34_0x3cd523[_0xcaa436(0x108)](_0xcaa436(0x102))+_0xcaa436(0x115)+a34_0x3cd523['cyan'](_0xb7a2c6['parentName']))),0x0;}}
1
+ const a34_0x303176=a34_0x5a6f;(function(_0x10635f,_0x586bff){const _0x428472=a34_0x5a6f,_0x47d556=_0x10635f();while(!![]){try{const _0x331104=-parseInt(_0x428472(0x120))/0x1*(-parseInt(_0x428472(0x11e))/0x2)+parseInt(_0x428472(0x127))/0x3*(parseInt(_0x428472(0xe1))/0x4)+parseInt(_0x428472(0xe6))/0x5*(parseInt(_0x428472(0x125))/0x6)+-parseInt(_0x428472(0x11f))/0x7*(-parseInt(_0x428472(0xf5))/0x8)+parseInt(_0x428472(0xfa))/0x9*(parseInt(_0x428472(0xe5))/0xa)+parseInt(_0x428472(0x131))/0xb+parseInt(_0x428472(0x126))/0xc*(-parseInt(_0x428472(0xf4))/0xd);if(_0x331104===_0x586bff)break;else _0x47d556['push'](_0x47d556['shift']());}catch(_0xc4de4){_0x47d556['push'](_0x47d556['shift']());}}}(a34_0x3558,0xe8699));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_0x29883b from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0xf5acfd from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a34_0x5a6f(_0x1bdabc,_0x46ba41){_0x1bdabc=_0x1bdabc-0xdf;const _0x355878=a34_0x3558();let _0x5a6f63=_0x355878[_0x1bdabc];return _0x5a6f63;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a34_0x303176(0x11c)]=a34_0x303176(0x106);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a34_0x303176(0xef)](_0x366163){const _0x4e70bf=a34_0x303176,{options:_0x50e7f9,args:_0x1333a5,tdx:_0x50f8b8}=_0x366163,_0x322ea6=_0x50e7f9,_0x2dca6c=await resolveTarget({'arg':_0x1333a5[0x0],'contextParent':_0x50e7f9[_0x4e70bf(0xfc)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2dca6c))return _0x2dca6c['errorCode']===_0x4e70bf(0xf0)?(console[_0x4e70bf(0xfb)](a34_0x29883b[_0x4e70bf(0xf7)](_0x4e70bf(0x12c))),console[_0x4e70bf(0xfb)](_0x4e70bf(0x133)),console[_0x4e70bf(0xfb)](_0x4e70bf(0x113)),console[_0x4e70bf(0xfb)](_0x4e70bf(0x105))):(console[_0x4e70bf(0xfb)](a34_0x29883b[_0x4e70bf(0x109)](_0x4e70bf(0x10b)+_0x2dca6c[_0x4e70bf(0x12e)]+'\x0a')),_0x2dca6c[_0x4e70bf(0xea)]&&console['error'](a34_0x29883b[_0x4e70bf(0x121)](_0x2dca6c['helpText']))),0x1;const _0x5a980c=_0x2dca6c['parentName'],_0x4d02ab=_0x2dca6c['targetDir'],_0x389096=_0x2dca6c[_0x4e70bf(0xed)]==='file'?_0x2dca6c[_0x4e70bf(0x12d)]:undefined;_0x322ea6[_0x4e70bf(0x117)]&&(console[_0x4e70bf(0xfb)](_0x4e70bf(0x110)+_0x322ea6[_0x4e70bf(0x101)]),console[_0x4e70bf(0xfb)](_0x4e70bf(0x114)+_0x5a980c),_0x389096&&console[_0x4e70bf(0xfb)](_0x4e70bf(0x129)+_0x389096));const _0x2d300c=await withProgressSpinner(_0x4e70bf(0xe0)+_0x5a980c+_0x4e70bf(0x134),_0x2ed8f1=>_0x50f8b8[_0x4e70bf(0x12a)][_0x4e70bf(0x12b)](_0x5a980c,{'targetDir':_0x4d02ab,'targetResourceName':_0x389096,'verbose':_0x322ea6['verbose'],'progress':{'update':_0x447054=>{const _0x20038d=_0x4e70bf;_0x2ed8f1['setPhase'](_0x447054),_0x322ea6[_0x20038d(0x117)]&&console['error']('\x20\x20'+_0x447054);}}}),{'verbose':_0x322ea6[_0x4e70bf(0x117)]}),_0x50f749=_0x2d300c[_0x4e70bf(0x10d)];if(_0x50f749[_0x4e70bf(0x116)][_0x4e70bf(0x10e)]===0x0&&_0x50f749[_0x4e70bf(0x116)][_0x4e70bf(0xff)]===0x0)return console['error'](a34_0x29883b['yellow'](_0x4e70bf(0xfd)+_0x50f749[_0x4e70bf(0x111)]+'\x27')),0x0;const _0x1c2075=_0x50f749['files'][_0x4e70bf(0x12f)](_0x3ecc05=>_0x3ecc05[_0x4e70bf(0x132)]),_0x533fcd=_0x50f749[_0x4e70bf(0x119)][_0x4e70bf(0x12f)](_0x5dc7e9=>!_0x5dc7e9[_0x4e70bf(0x132)]&&_0x5dc7e9[_0x4e70bf(0x108)]),_0x568a8e=_0x50f749[_0x4e70bf(0x119)][_0x4e70bf(0x12f)](_0x3df59a=>!_0x3df59a[_0x4e70bf(0x132)]&&!_0x3df59a['hasChanges']);console[_0x4e70bf(0xfb)]('\x0aPull\x20summary\x20for\x20\x27'+_0x50f749[_0x4e70bf(0x111)]+'\x27:'),console[_0x4e70bf(0xfb)]('\x20\x20🎯\x20'+a34_0x29883b[_0x4e70bf(0x121)](_0x50f749[_0x4e70bf(0x116)]['segments']+_0x4e70bf(0xfe))+_0x4e70bf(0xe4)+a34_0x29883b['cyan'](_0x50f749[_0x4e70bf(0x116)][_0x4e70bf(0xec)]+_0x4e70bf(0xdf)));if(_0x50f749['counts'][_0x4e70bf(0xff)]>0x0){const _0x393808=_0x50f749[_0x4e70bf(0x116)][_0x4e70bf(0x123)]>_0x50f749['counts'][_0x4e70bf(0xff)]?'\x20('+_0x50f749[_0x4e70bf(0x116)][_0x4e70bf(0x123)]+_0x4e70bf(0x11d):'';console[_0x4e70bf(0xfb)](_0x4e70bf(0xe2)+a34_0x29883b[_0x4e70bf(0x121)](_0x50f749[_0x4e70bf(0x116)][_0x4e70bf(0xff)]+_0x4e70bf(0xf1))+a34_0x29883b[_0x4e70bf(0x124)](_0x393808));}console[_0x4e70bf(0xfb)]('\x20\x20'+a34_0x29883b[_0x4e70bf(0x102)]('+\x20'+_0x1c2075['length']+_0x4e70bf(0x115))),console['error']('\x20\x20'+a34_0x29883b[_0x4e70bf(0xf7)]('~\x20'+_0x533fcd[_0x4e70bf(0x122)]+_0x4e70bf(0xe8))),console[_0x4e70bf(0xfb)]('\x20\x20'+a34_0x29883b['dim']('=\x20'+_0x568a8e[_0x4e70bf(0x122)]+'\x20unchanged\x20files')),console['error']('\x20\x20Target:\x20'+a34_0x29883b['cyan'](_0x50f749[_0x4e70bf(0xe9)])+'\x0a');if(_0x533fcd[_0x4e70bf(0x122)]>0x0)for(const _0x5a3848 of _0x533fcd){console[_0x4e70bf(0xfb)](_0x4e70bf(0xee)+_0x5a3848[_0x4e70bf(0x10f)]+'\x27:'),console[_0x4e70bf(0xfb)]('─'[_0x4e70bf(0xf8)](0x3c)),console[_0x4e70bf(0xfb)](_0x5a3848[_0x4e70bf(0xf9)]),console[_0x4e70bf(0xfb)]('─'[_0x4e70bf(0xf8)](0x3c));}if(_0x322ea6[_0x4e70bf(0x130)])return console[_0x4e70bf(0xfb)](a34_0x29883b['yellow'](_0x4e70bf(0xf2))),0x0;if(_0x1c2075[_0x4e70bf(0x122)]===0x0&&_0x533fcd['length']===0x0)return console['error'](a34_0x29883b['green']('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x50f749[_0x4e70bf(0x111)]},_0x322ea6[_0x4e70bf(0x10c)]),console['error'](a34_0x29883b[_0x4e70bf(0x102)](_0x4e70bf(0x128)+a34_0x29883b['dim'](_0x4e70bf(0xf3))+_0x4e70bf(0x11a)+a34_0x29883b[_0x4e70bf(0x121)](_0x50f749[_0x4e70bf(0x111)]))),0x0;if(!_0x322ea6['yes']){if(!isInteractive())return console[_0x4e70bf(0xfb)](a34_0x29883b[_0x4e70bf(0x109)]('\x0aError:'),_0x4e70bf(0x100)),console[_0x4e70bf(0xfb)](a34_0x29883b[_0x4e70bf(0x124)](_0x4e70bf(0x107))),0x1;const _0x140a16=await confirmKey(_0x4e70bf(0xf6)+(_0x1c2075['length']+_0x533fcd['length'])+_0x4e70bf(0x10a));if(!_0x140a16)return console[_0x4e70bf(0xfb)](a34_0x29883b[_0x4e70bf(0xf7)](_0x4e70bf(0xeb)),_0x4e70bf(0xe3)),0x1;}for(const _0x25f6a5 of _0x50f749[_0x4e70bf(0x119)]){if(_0x25f6a5[_0x4e70bf(0x132)]||_0x25f6a5[_0x4e70bf(0x108)]){const _0x50182c=a34_0xf5acfd[_0x4e70bf(0x112)](_0x25f6a5[_0x4e70bf(0x104)]);!existsSync(_0x50182c)&&mkdirSync(_0x50182c,{'recursive':!![]}),writeFileSync(_0x25f6a5[_0x4e70bf(0x104)],_0x25f6a5[_0x4e70bf(0x118)],_0x4e70bf(0x11b));}}return console[_0x4e70bf(0xfb)](a34_0x29883b[_0x4e70bf(0x102)](_0x4e70bf(0x103)+(_0x1c2075[_0x4e70bf(0x122)]+_0x533fcd[_0x4e70bf(0x122)])+_0x4e70bf(0xe7)+_0x50f749[_0x4e70bf(0xe9)])),saveSessionContext({'parent_segment':_0x50f749['parentName']},_0x322ea6[_0x4e70bf(0x10c)]),console[_0x4e70bf(0xfb)](a34_0x29883b[_0x4e70bf(0x102)](_0x4e70bf(0x128)+a34_0x29883b[_0x4e70bf(0x124)]('parent_segment')+_0x4e70bf(0x11a)+a34_0x29883b[_0x4e70bf(0x121)](_0x50f749[_0x4e70bf(0x111)]))),0x0;}}function a34_0x3558(){const _0x5142f3=['utf-8','name','\x20versions)','26EXEtOi','7PPMpAO','114269DtXUgS','cyan','length','journeyVersions','dim','12fcgOpO','50560044pLZeUX','127641cEAOvG','βœ”\x20Context\x20set:\x20','Target\x20resource:\x20','segment','pullSegments','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resourceName','message','filter','dryRun','7849039FhXKBf','isNew','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x27...','\x20activations','Pulling\x20segments\x20from\x20\x27','104MqIQkt','\x20\x20πŸ—ΊοΈ\x20\x20','-\x20no\x20files\x20written','\x20with\x20','446660VYjRkE','3432435YImChN','\x20files\x20to\x20','\x20changed\x20files','targetDir','helpText','Aborted.','activations','type','\x0aChanges\x20to\x20\x27','execute','no_parent','\x20journeys','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parent_segment','13CybWjn','2109808GeVGKt','Write\x20','yellow','repeat','diff','45JnVWIV','error','parentSegment','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20segments','journeys','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','site','green','βœ”\x20Pulled\x20','absolutePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segment:pull','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasChanges','red','\x20files?','Error:\x20','session','data','segments','relativePath','Site:\x20','parentName','dirname','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Parent\x20segment:\x20','\x20new\x20files','counts','verbose','content','files','\x20=\x20'];a34_0x3558=function(){return _0x5142f3;};return a34_0x3558();}
@@ -1 +1 @@
1
- const a35_0x16cda1=a35_0x4462;(function(_0x4f87ff,_0x285cc6){const _0x4d4e6a=a35_0x4462,_0x16662c=_0x4f87ff();while(!![]){try{const _0x3703d6=-parseInt(_0x4d4e6a(0x247))/0x1+parseInt(_0x4d4e6a(0x229))/0x2+parseInt(_0x4d4e6a(0x20b))/0x3+-parseInt(_0x4d4e6a(0x245))/0x4*(-parseInt(_0x4d4e6a(0x1f6))/0x5)+parseInt(_0x4d4e6a(0x1f0))/0x6+parseInt(_0x4d4e6a(0x24f))/0x7+-parseInt(_0x4d4e6a(0x262))/0x8;if(_0x3703d6===_0x285cc6)break;else _0x16662c['push'](_0x16662c['shift']());}catch(_0x203a29){_0x16662c['push'](_0x16662c['shift']());}}}(a35_0x12bd,0xc0054));function a35_0x12bd(){const _0x16385d=['nameToId','parentFolder','New\x20journey:','392439GVzzrT','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','versionNumber','segment\x20or\x20journey','listFolders','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','type','delete','dryRun','changed','\x20activations]','\x20YAML\x20files\x20found','parent_name','helpText','unchanged','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','deleted','\x0aError:','message','listSegments','\x27...','user','createdAt','\x0aβœ”\x20Push\x20complete','toString','then','Error\x20parsing\x20YAML:\x20','audienceId','no_parent','1699338kenkak','description','\x20to\x20create','/sb/da/esr','Folders\x20to\x20create:','results','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','journeys','journeyBundleId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20new','isScoped','execute','Delete\x20segment:','\x20to\x20delete','buildUserMaps','add','push','journeyId','segment:push','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)','(Journey\x20will\x20be\x20deleted)','\x20to\x20update','Fetching\x20existing\x20activations...','Fetching\x20existing\x20data...','data','Fetching\x20connections\x20for\x20name\x20resolution...','Error:\x20Directory\x20not\x20found:\x20','11708jJyXYo','map','526607bNQcOv','yamlConfig','segment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','join','activations','.yml','setPhase','9448327SgARIh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','errorCode','attributes','journeyBundleName','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','length','\x20updated','Push\x20','parentName','green','scopedFolderPath','folderPath','\x20\x20Activations:','/app/ps/','updated','filter','listActivations','Error:\x20','19484352XtxZxS','created','site','\x20created','cyan','\x20\x20Activations:\x20','\x20deleted','toDelete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20\x20\x20','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journey','getParent','Changes\x20to:','error','toUpdate','segmentFolderId','.yaml','idToName','file','Site:\x20','get','yellow','New\x20segment:','targetDir','listJourneysWithDetailsFromParentSegment','all','state','existingSegment','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0aValidation\x20failed:','\x20\x20πŸ“Š\x20Segments:','diff','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','Resolving\x20parent\x20segment\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','/e/','updatedAt','existingJourney','red','/j/da/je','3435126emiNrB','\x20changes?','getJourney','\x0aPush\x20summary\x20for\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','blue','1445hGxYGk','\x20unchanged','connection','createdSegmentIds','journeysOnly','verbose','No\x20','segments','dim','isNew','getOutputSchemaWithCache','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20Journeys:\x20','repeat','new','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20changed','Preparing\x20journeys...'];a35_0x12bd=function(){return _0x16385d;};return a35_0x12bd();}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_0x5d6580 from'chalk';import{existsSync}from'fs';function a35_0x4462(_0x3ba3fd,_0x20d75d){_0x3ba3fd=_0x3ba3fd-0x1e5;const _0x12bdf3=a35_0x12bd();let _0x4462ef=_0x12bdf3[_0x3ba3fd];return _0x4462ef;}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_0x16cda1(0x1e8)]=a35_0x16cda1(0x23c);[a35_0x16cda1(0x22a)]=a35_0x16cda1(0x211);async[a35_0x16cda1(0x235)](_0x12f78b){const _0x51963d=a35_0x16cda1,{options:_0x4fa69f,args:_0x29f460,tdx:_0x501d76}=_0x12f78b,_0x586acc=_0x4fa69f,_0x3af288=await resolveTarget({'arg':_0x29f460[0x0],'contextParent':_0x4fa69f['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3af288))return _0x3af288[_0x51963d(0x251)]===_0x51963d(0x228)?(console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)](_0x51963d(0x21b))),console[_0x51963d(0x270)](_0x51963d(0x23d)),console[_0x51963d(0x270)](_0x51963d(0x201)),console[_0x51963d(0x270)](_0x51963d(0x250))):(console['error'](a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x261)+_0x3af288[_0x51963d(0x21e)]+'\x0a')),_0x3af288[_0x51963d(0x219)]&&console[_0x51963d(0x270)](a35_0x5d6580['cyan'](_0x3af288[_0x51963d(0x219)]))),0x1;if(_0x3af288['type']===_0x51963d(0x218))return console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1ee)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3af288[_0x51963d(0x27a)]+'\x0a')),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x266)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x39fbde=_0x3af288[_0x51963d(0x258)],_0x108f0f=_0x3af288[_0x51963d(0x27a)],_0x304180=_0x3af288[_0x51963d(0x212)]===_0x51963d(0x275)?_0x3af288['filePath']:undefined,_0xad1551=getScopedDetails(_0x3af288),_0x2cd0ae=_0xad1551?.[_0x51963d(0x234)]??![],_0x44cd79=_0xad1551?.[_0x51963d(0x25a)]??'';if(!existsSync(_0x108f0f))return console[_0x51963d(0x270)](a35_0x5d6580['red'](_0x51963d(0x244)+_0x108f0f+'\x0a')),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x266)](_0x51963d(0x26a))),0x1;_0x586acc[_0x51963d(0x1fb)]&&(console['error'](_0x51963d(0x276)+_0x586acc['site']),console[_0x51963d(0x270)]('Parent\x20segment:\x20'+_0x39fbde),console[_0x51963d(0x270)]('Source\x20directory:\x20'+_0x108f0f),_0x2cd0ae&&console[_0x51963d(0x270)]('Scoped\x20to\x20folder:\x20'+_0x44cd79));const _0x886ba6=await withSpinner(_0x51963d(0x1e9)+_0x39fbde+_0x51963d(0x220),()=>_0x501d76[_0x51963d(0x249)]['resolveParentId'](_0x39fbde),{'verbose':_0x586acc[_0x51963d(0x1fb)]}),_0x169f03=_0x886ba6['data'],{parentSegmentResult:_0x43f834,segmentsResult:_0x252a4f,foldersResult:_0x3ea2dd,journeysWithDetailsResult:_0x16d791,userMaps:_0x2849fa}=await withSpinner(_0x51963d(0x241),async()=>{const _0x16c675=_0x51963d,[_0x448f00,_0x1d17fa,_0x473786,_0x122990,_0x562a8e]=await Promise[_0x16c675(0x27c)]([_0x501d76['segment'][_0x16c675(0x26e)](_0x169f03),_0x501d76['segment'][_0x16c675(0x21f)](_0x169f03),_0x501d76[_0x16c675(0x249)][_0x16c675(0x210)](_0x169f03),_0x501d76[_0x16c675(0x26d)][_0x16c675(0x27b)](_0x169f03,{'includeAllVersions':!![]}),_0x501d76[_0x16c675(0x221)][_0x16c675(0x238)]()]);return{'parentSegmentResult':_0x448f00,'segmentsResult':_0x1d17fa,'foldersResult':_0x473786,'journeysWithDetailsResult':_0x122990,'userMaps':_0x562a8e};},{'verbose':_0x586acc[_0x51963d(0x1fb)]})['then'](_0x2250d=>_0x2250d[_0x51963d(0x242)]),_0x527d14=_0x43f834,_0x2e277c=extractRootFolderId(_0x527d14),_0x4ff995=_0x252a4f,_0xcca10c=_0x3ea2dd,{journeys:_0x1e1a35,activationStepsById:_0x28a4dd}=_0x16d791,_0x57fccc=new Map(_0x1e1a35[_0x51963d(0x246)](_0x25fe95=>[_0x25fe95['id'],_0x25fe95])),_0x4b5746=_0x1e1a35[_0x51963d(0x246)](_0x3356b1=>({'id':_0x3356b1['id'],'name':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x1e8)],'journeyBundleName':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x253)]||'','journeyBundleId':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x231)]||'','versionNumber':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x20e)],'description':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x22a)],'state':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x27d)],'paused':_0x3356b1[_0x51963d(0x252)]['paused'],'audienceId':_0x3356b1['attributes'][_0x51963d(0x227)],'folderId':_0x3356b1['relationships']?.[_0x51963d(0x209)]?.[_0x51963d(0x242)]?.['id'],'createdAt':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x222)],'updatedAt':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x1ec)]})),{emailToId:_0x54815f,idToEmail:_0x264422}=_0x2849fa,_0x3365c2=await withSpinner(_0x51963d(0x243),async()=>{const _0x4209ab=_0x51963d,_0x5eca4b=await _0x501d76[_0x4209ab(0x1f8)]['list']();return buildConnectionMaps(_0x5eca4b);},{'verbose':_0x586acc[_0x51963d(0x1fb)]})[_0x51963d(0x225)](_0x34016e=>_0x34016e['data']),_0x22e886=_0x3365c2[_0x51963d(0x208)],_0x154c86=_0x3365c2[_0x51963d(0x274)],_0xea5794=_0x3365c2['nameToType'],_0x3e2586={'emailToIdMap':_0x54815f,'connectionNameToIdMap':_0x22e886,'connectionNameToTypeMap':_0xea5794,'getSchema':_0x24717a=>_0x501d76['connection'][_0x51963d(0x200)](_0x24717a)};let {pathToId:_0x44335d,idToPath:_0x2cec11}=buildFolderMaps(_0xcca10c);const _0x4c1719=buildSegmentLookupMap(_0x4ff995,_0x2cec11),_0x38df0e=buildSegmentNameToIdMap(_0x4ff995),_0x3aac25=buildJourneyBundleLookupMap(_0x4b5746,_0x2cec11);let _0x5ae501;if(_0x304180){if(!_0x304180['endsWith'](_0x51963d(0x24d))&&!_0x304180['endsWith'](_0x51963d(0x273)))return console[_0x51963d(0x270)](a35_0x5d6580['red'](_0x51963d(0x1e7)+_0x304180+'\x0a')),0x1;_0x5ae501=[_0x304180];}else _0x5ae501=findYamlFiles(_0x108f0f);if(_0x5ae501['length']===0x0)return console[_0x51963d(0x270)](a35_0x5d6580['red'](_0x51963d(0x22f)+_0x108f0f+'\x0a')),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x266)](_0x51963d(0x27f))),0x1;let _0x3a3196,_0x415cab;try{const _0x1b5b98=parseAndClassifyYamlFiles(_0x5ae501,_0x108f0f,{'skipSegments':_0x586acc[_0x51963d(0x1fa)]});_0x3a3196=_0x1b5b98[_0x51963d(0x1fd)],_0x415cab=_0x1b5b98['journeys'];const _0x24dea0=validateParsedFiles(_0x1b5b98,_0x108f0f);if(_0x24dea0[_0x51963d(0x255)]>0x0)return console['error'](a35_0x5d6580['red'](_0x51963d(0x280))),console[_0x51963d(0x270)](formatValidationErrors(_0x24dea0)),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)](_0x51963d(0x20d))),0x1;}catch(_0x4e93a4){return console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x226)+(_0x4e93a4 instanceof Error?_0x4e93a4[_0x51963d(0x21e)]:_0x4e93a4))),0x1;}if(_0x3a3196[_0x51963d(0x255)]===0x0&&_0x415cab[_0x51963d(0x255)]===0x0){const _0x30abbd=_0x586acc[_0x51963d(0x1fa)]?'journey':_0x51963d(0x20f);return console['error'](a35_0x5d6580[_0x51963d(0x278)](_0x51963d(0x1fc)+_0x30abbd+_0x51963d(0x217))),0x0;}const _0x24cc19=new Map();_0x4ff995[_0x51963d(0x255)]>0x0&&!_0x586acc[_0x51963d(0x1fa)]&&await withSpinner(_0x51963d(0x240),async()=>{await batchAsync(_0x4ff995,async _0x23abef=>{const _0x2d9b80=a35_0x4462,_0x3ecff6=await _0x501d76[_0x2d9b80(0x249)][_0x2d9b80(0x260)](_0x169f03,_0x23abef['id']);_0x24cc19['set'](_0x23abef['id'],_0x3ecff6);});},{'verbose':_0x586acc[_0x51963d(0x1fb)]});const {segmentFiles:_0x5ba468,foldersToCreate:_0x34cf54}=await prepareSegmentFiles(_0x3a3196,{'segmentByFolderAndName':_0x4c1719,'activationsBySegmentId':_0x24cc19,'folderPathToId':_0x44335d,'idToEmailMap':_0x264422,'connectionIdToNameMap':_0x154c86},_0x3e2586,_0x2cd0ae,_0x44cd79),_0x257e9b=_0x304180?[]:findSegmentsToDelete(_0x4ff995,_0x3a3196['map'](({yamlConfig:_0x553808,folderPath:_0x7e84b7})=>({'yamlConfig':_0x553808,'folderPath':resolveTDFolderPath(_0x7e84b7,_0x2cd0ae,_0x44cd79)})),_0x2cec11,_0x44cd79,_0x2cd0ae),{journeyFiles:_0x403169,foldersToCreate:_0x5f1bf3}=await withProgressSpinner(_0x51963d(0x207),async _0x41f327=>prepareJourneyFiles(_0x415cab,{'fetchJourney':async _0x50ec5c=>_0x501d76[_0x51963d(0x26d)][_0x51963d(0x1f2)](_0x50ec5c[_0x51963d(0x23b)]),'journeyBundlesByFolderAndName':_0x3aac25,'folderPathToId':_0x44335d,'idToEmailMap':_0x264422,'connectionIdToNameMap':_0x154c86,'existingSegments':_0x4ff995,'parentId':_0x169f03,'deps':_0x501d76,'progress':{'update':_0x281a87=>{const _0x3fa507=_0x51963d;_0x41f327[_0x3fa507(0x24e)](_0x281a87),_0x586acc[_0x3fa507(0x1fb)]&&console[_0x3fa507(0x270)]('\x20\x20'+_0x281a87);}},'journeyById':_0x57fccc,'activationStepsById':_0x28a4dd},_0x2cd0ae,_0x44cd79),{'verbose':_0x586acc[_0x51963d(0x1fb)]})[_0x51963d(0x225)](_0x57d389=>_0x57d389[_0x51963d(0x242)]);for(const _0x3bc117 of _0x5f1bf3){_0x34cf54[_0x51963d(0x239)](_0x3bc117);}const _0x19c8ef=_0x304180?[]:findJourneysToDelete(_0x4b5746,_0x415cab[_0x51963d(0x246)](({yamlConfig:_0x1ae5d7,folderPath:_0x5d9152})=>({'yamlConfig':_0x1ae5d7,'folderPath':resolveTDFolderPath(_0x5d9152,_0x2cd0ae,_0x44cd79)})),_0x2cec11,_0x44cd79,_0x2cd0ae),_0x1f73bf=calculatePushStats(_0x5ba468,_0x403169,_0x34cf54,_0x257e9b,_0x19c8ef,!!_0x586acc[_0x51963d(0x213)],!!_0x586acc[_0x51963d(0x1fa)]),_0x4a033e=_0x1f73bf[_0x51963d(0x1fd)][_0x51963d(0x204)],_0x5c788a=_0x1f73bf['segments'][_0x51963d(0x215)],_0x5247f8=_0x1f73bf[_0x51963d(0x1fd)][_0x51963d(0x21a)],_0x4d80ad=_0x1f73bf[_0x51963d(0x1fd)][_0x51963d(0x269)],_0x5d3275=_0x1f73bf['folders']['toCreate'],_0x26207a=_0x1f73bf[_0x51963d(0x230)]['new'],_0x57c657=_0x1f73bf['journeys'][_0x51963d(0x215)],_0x312aac=_0x1f73bf[_0x51963d(0x230)][_0x51963d(0x21a)],_0xb3cce4=_0x1f73bf[_0x51963d(0x230)]['toDelete'],_0x390c32=_0x1f73bf[_0x51963d(0x24c)][_0x51963d(0x27c)],_0x1193ca=_0x1f73bf[_0x51963d(0x24c)]['toCreate'],_0x237bcc=_0x1f73bf[_0x51963d(0x24c)][_0x51963d(0x271)],_0x4eabe1=_0x1f73bf['activations']['toDelete'];console['error'](_0x51963d(0x1f3)+_0x39fbde+'\x27:');_0x5d3275[_0x51963d(0x255)]>0x0&&console[_0x51963d(0x270)]('\x20\x20'+a35_0x5d6580[_0x51963d(0x1f5)]('πŸ“\x20'+_0x5d3275[_0x51963d(0x255)]+'\x20folders\x20to\x20create'));if(!_0x586acc[_0x51963d(0x1fa)]){console[_0x51963d(0x270)](_0x51963d(0x1e5)),console['error']('\x20\x20\x20\x20'+a35_0x5d6580['green']('+\x20'+_0x4a033e[_0x51963d(0x255)]+_0x51963d(0x233))),console['error']('\x20\x20\x20\x20'+a35_0x5d6580[_0x51963d(0x278)]('~\x20'+_0x5c788a[_0x51963d(0x255)]+'\x20changed'));if(_0x4d80ad[_0x51963d(0x255)]>0x0)console['error'](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x1ee)]('-\x20'+_0x4d80ad[_0x51963d(0x255)]+_0x51963d(0x237)));else _0x257e9b[_0x51963d(0x255)]>0x0&&!_0x586acc['delete']&&console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580['dim'](_0x257e9b[_0x51963d(0x255)]+_0x51963d(0x232)));console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x1fe)]('=\x20'+_0x5247f8[_0x51963d(0x255)]+_0x51963d(0x1f7)));}if(_0x403169[_0x51963d(0x255)]>0x0||_0x19c8ef[_0x51963d(0x255)]>0x0){console['error'](_0x51963d(0x20c)),console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580['green']('+\x20'+_0x26207a['length']+_0x51963d(0x233))),console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x278)]('~\x20'+_0x57c657['length']+_0x51963d(0x206)));if(_0xb3cce4[_0x51963d(0x255)]>0x0)console['error'](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x1ee)]('-\x20'+_0xb3cce4[_0x51963d(0x255)]+_0x51963d(0x237)));else _0x19c8ef['length']>0x0&&!_0x586acc[_0x51963d(0x213)]&&console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580['dim'](_0x19c8ef[_0x51963d(0x255)]+_0x51963d(0x232)));console['error']('\x20\x20\x20\x20'+a35_0x5d6580['dim']('=\x20'+_0x312aac[_0x51963d(0x255)]+_0x51963d(0x1f7)));}_0x390c32['length']>0x0&&!_0x586acc[_0x51963d(0x1fa)]&&(console['error'](''),console['error'](_0x51963d(0x25c)),_0x1193ca[_0x51963d(0x255)]>0x0&&console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x259)]('+\x20'+_0x1193ca[_0x51963d(0x255)]+_0x51963d(0x22b))),_0x237bcc[_0x51963d(0x255)]>0x0&&console['error']('\x20\x20\x20\x20'+a35_0x5d6580[_0x51963d(0x278)]('~\x20'+_0x237bcc['length']+_0x51963d(0x23f))),_0x4eabe1[_0x51963d(0x255)]>0x0&&console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580['red']('-\x20'+_0x4eabe1[_0x51963d(0x255)]+_0x51963d(0x237))));console[_0x51963d(0x270)]('\x20\x20Source:\x20'+a35_0x5d6580[_0x51963d(0x266)](_0x108f0f)+'\x0a');if(_0x5d3275['length']>0x0){console[_0x51963d(0x270)](_0x51963d(0x22d));for(const _0x5bd3e1 of _0x5d3275){console[_0x51963d(0x270)]('\x20\x20'+a35_0x5d6580[_0x51963d(0x1f5)]('+')+'\x20'+_0x5bd3e1);}console[_0x51963d(0x270)]('');}if(_0x4a033e[_0x51963d(0x255)]>0x0&&!_0x586acc[_0x51963d(0x1fa)])for(const _0x8b9f86 of _0x4a033e){const _0x3e070f=_0x8b9f86[_0x51963d(0x25b)]?_0x8b9f86[_0x51963d(0x25b)]+'/'+_0x8b9f86[_0x51963d(0x248)][_0x51963d(0x1e8)]:_0x8b9f86['yamlConfig']['name'],_0x416f42=_0x8b9f86[_0x51963d(0x248)][_0x51963d(0x24c)]?.[_0x51963d(0x255)]||0x0,_0x993e6a=_0x416f42>0x0?a35_0x5d6580[_0x51963d(0x1fe)]('\x20['+_0x416f42+_0x51963d(0x216)):'';console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x259)](_0x51963d(0x279))+'\x20'+_0x3e070f+_0x993e6a),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c)),_0x8b9f86['diff']&&console[_0x51963d(0x270)](_0x8b9f86[_0x51963d(0x1e6)]),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));}if(_0x4d80ad[_0x51963d(0x255)]>0x0&&!_0x586acc[_0x51963d(0x1fa)])for(const _0xa4834a of _0x4d80ad){const _0x58f6c7=_0xa4834a[_0x51963d(0x272)]?_0x2cec11[_0x51963d(0x277)](_0xa4834a[_0x51963d(0x272)][_0x51963d(0x224)]())||'':'',_0x1f6a09=_0x58f6c7?_0x58f6c7+'/'+_0xa4834a[_0x51963d(0x1e8)]:_0xa4834a[_0x51963d(0x1e8)],_0x470b18=_0x24cc19['get'](_0xa4834a['id'])||[],_0xdecee5=_0x470b18[_0x51963d(0x255)]>0x0?a35_0x5d6580[_0x51963d(0x1fe)]('\x20['+_0x470b18[_0x51963d(0x255)]+_0x51963d(0x216)):'';console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x236))+'\x20'+_0x1f6a09+_0xdecee5),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));const _0x37fc8e=segmentWithActivationsToYaml(_0xa4834a,_0x470b18,undefined,_0x264422,_0x154c86),_0x5b1d17=segmentToYamlString(_0x37fc8e),_0xebeee4=generateDiff(_0x5b1d17,'');console[_0x51963d(0x270)](formatDiffWithColors(_0xebeee4)),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));}const _0x5b28fc=_0x5ba468[_0x51963d(0x25f)](_0x3ad646=>!_0x3ad646[_0x51963d(0x1ff)]&&_0x3ad646[_0x51963d(0x1e6)]);if(_0x5b28fc[_0x51963d(0x255)]>0x0&&!_0x586acc['journeysOnly'])for(const _0x51b9cb of _0x5b28fc){const _0x11bf89=_0x51b9cb[_0x51963d(0x25b)]?_0x51b9cb[_0x51963d(0x25b)]+'/'+_0x51b9cb[_0x51963d(0x248)][_0x51963d(0x1e8)]:_0x51b9cb['yamlConfig'][_0x51963d(0x1e8)];console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580['yellow'](_0x51963d(0x26f))+'\x20'+_0x11bf89),console[_0x51963d(0x270)]('─'['repeat'](0x3c)),console[_0x51963d(0x270)](_0x51b9cb[_0x51963d(0x1e6)]),console[_0x51963d(0x270)]('─'['repeat'](0x3c));}if(_0x26207a[_0x51963d(0x255)]>0x0)for(const _0x4367f0 of _0x26207a){const _0x1fc72f=_0x4367f0[_0x51963d(0x25b)]?_0x4367f0[_0x51963d(0x25b)]+'/'+_0x4367f0[_0x51963d(0x248)][_0x51963d(0x1e8)]:_0x4367f0['yamlConfig'][_0x51963d(0x1e8)];console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x259)](_0x51963d(0x20a))+'\x20'+_0x1fc72f),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c)),_0x4367f0[_0x51963d(0x1e6)]&&console['error'](_0x4367f0['diff']),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));}const _0x4d8a08=_0x403169[_0x51963d(0x25f)](_0x2c8bae=>!_0x2c8bae[_0x51963d(0x1ff)]&&_0x2c8bae[_0x51963d(0x1e6)]);if(_0x4d8a08[_0x51963d(0x255)]>0x0)for(const _0x4a81f0 of _0x4d8a08){const _0x2bb45c=_0x4a81f0[_0x51963d(0x25b)]?_0x4a81f0[_0x51963d(0x25b)]+'/'+_0x4a81f0['yamlConfig']['name']:_0x4a81f0[_0x51963d(0x248)][_0x51963d(0x1e8)];console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x278)]('Changes\x20to\x20journey:')+'\x20'+_0x2bb45c),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c)),console['error'](_0x4a81f0['diff']),console[_0x51963d(0x270)]('─'['repeat'](0x3c));}if(_0xb3cce4[_0x51963d(0x255)]>0x0)for(const _0x5aafd2 of _0xb3cce4){const _0x59c78e=_0x5aafd2['folderId']?_0x2cec11[_0x51963d(0x277)](_0x5aafd2['folderId'])||'':'',_0x1177d0=_0x59c78e?_0x59c78e+'/'+_0x5aafd2[_0x51963d(0x253)]:_0x5aafd2['journeyBundleName'];console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x1ee)]('Delete\x20journey:')+'\x20'+_0x1177d0),console[_0x51963d(0x270)]('─'['repeat'](0x3c)),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x23e))),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));}if(_0x586acc[_0x51963d(0x214)])return console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)](_0x51963d(0x1ea))),0x0;const _0xe3b2a7=_0x586acc[_0x51963d(0x1fa)]?![]:_0x4a033e[_0x51963d(0x255)]>0x0||_0x5c788a[_0x51963d(0x255)]>0x0||_0x4d80ad[_0x51963d(0x255)]>0x0,_0x2eaa2e=_0x26207a[_0x51963d(0x255)]>0x0||_0x57c657['length']>0x0||_0xb3cce4[_0x51963d(0x255)]>0x0,_0x38f65c=_0x586acc['journeysOnly']?![]:_0x390c32[_0x51963d(0x255)]>0x0,_0x396530=_0x5d3275['length']>0x0;if(!_0xe3b2a7&&!_0x2eaa2e&&!_0x38f65c&&!_0x396530){const _0x33e1b9=_0x586acc[_0x51963d(0x1fa)]?_0x51963d(0x254):_0x51963d(0x26c);console[_0x51963d(0x270)](a35_0x5d6580['green'](_0x33e1b9));if(_0x304180&&_0x5247f8[_0x51963d(0x255)]===0x1){const _0x5200a1=_0x5247f8[0x0];if(_0x5200a1[_0x51963d(0x27e)]?.['id']){const _0x23c90d=getConsoleNextUrl(_0x586acc[_0x51963d(0x264)],_0x51963d(0x25d)+_0x169f03+'/e/'+_0x5200a1['existingSegment']['id']+_0x51963d(0x22c));console[_0x51963d(0x270)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a35_0x5d6580[_0x51963d(0x266)](_0x23c90d));}}if(_0x304180&&_0x312aac['length']===0x1){const _0x58c314=_0x312aac[0x0];if(_0x58c314['existingJourney']?.['id']){const _0x4077ef=getConsoleNextUrl(_0x586acc[_0x51963d(0x264)],_0x51963d(0x25d)+_0x169f03+_0x51963d(0x1eb)+_0x58c314[_0x51963d(0x1ed)]['id']+'/j/da/je');console[_0x51963d(0x270)]('\x20\x20'+a35_0x5d6580[_0x51963d(0x266)](_0x4077ef));}}return 0x0;}const _0x1afbdd=_0x586acc[_0x51963d(0x1fa)]?_0x26207a[_0x51963d(0x255)]+_0x57c657[_0x51963d(0x255)]+_0xb3cce4[_0x51963d(0x255)]+_0x5d3275[_0x51963d(0x255)]:_0x4a033e['length']+_0x5c788a['length']+_0x4d80ad[_0x51963d(0x255)]+_0x26207a[_0x51963d(0x255)]+_0x57c657['length']+_0xb3cce4[_0x51963d(0x255)]+_0x5d3275['length']+_0x390c32['length'];if(!_0x586acc['yes']&&_0x1afbdd>0x0){if(!isInteractive())return console['error'](a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x21d)),_0x51963d(0x24a)),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1fe)](_0x51963d(0x1f4))),0x1;const _0x13df07=await confirmKey(_0x51963d(0x257)+_0x1afbdd+_0x51963d(0x1f1));if(!_0x13df07)return console['error'](a35_0x5d6580['yellow']('Aborted.')),0x1;}const _0x323a93={'withProgress':async(_0x5393df,_0x14b741)=>{const _0x3a00ff=_0x51963d,_0x1b16c7=await withSpinner(_0x5393df,_0x14b741,{'verbose':_0x586acc['verbose']});return{'data':_0x1b16c7[_0x3a00ff(0x242)]};},'logInfo':_0x24df40=>console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1f5)]('βœ”\x20'+_0x24df40)),'logSuccess':_0x483d8f=>console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x259)]('βœ”\x20'+_0x483d8f)),'logWarning':_0x40171b=>console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)]('⚠\x20'+_0x40171b)),'logDeleted':_0x42b325=>console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1ee)]('βœ”\x20'+_0x42b325))},_0x48070c={'segment':_0x501d76[_0x51963d(0x249)],'journey':_0x501d76[_0x51963d(0x26d)],'user':_0x501d76[_0x51963d(0x221)],'connection':_0x501d76[_0x51963d(0x1f8)]};_0x5d3275[_0x51963d(0x255)]>0x0&&(_0x44335d=await executePushFolders(_0x48070c,_0x5d3275,_0x44335d,{'parentId':_0x169f03},_0x323a93));const _0x2c597a={'rootFolderId':_0x2e277c,'folderPathToId':_0x44335d,'folderIdToPath':_0x2cec11,'segmentNameToId':_0x38df0e,'activationsBySegmentId':_0x24cc19,'emailToIdMap':_0x54815f,'idToEmailMap':_0x264422,'connectionNameToIdMap':_0x3365c2[_0x51963d(0x208)],'connectionIdToNameMap':_0x3365c2[_0x51963d(0x274)],'connectionNameToTypeMap':_0xea5794},_0x15f0b0=await executePushSegments(_0x48070c,_0x586acc[_0x51963d(0x1fa)]?[]:_0x5ba468,_0x2c597a,{'parentId':_0x169f03},_0x323a93),_0x188155=_0x15f0b0[_0x51963d(0x263)],_0x1571f7=_0x15f0b0[_0x51963d(0x25e)],_0x38a659=_0x15f0b0[_0x51963d(0x24c)][_0x51963d(0x263)],_0x1c20ec=_0x15f0b0[_0x51963d(0x24c)][_0x51963d(0x25e)],_0x3afd67=_0x15f0b0[_0x51963d(0x24c)][_0x51963d(0x21c)];let _0x2d35a3;if(_0x304180&&_0x5ba468['length']===0x1){const _0xcb743e=_0x5ba468[0x0];_0x2d35a3=_0xcb743e[_0x51963d(0x27e)]?.['id']??_0x15f0b0[_0x51963d(0x1f9)][_0x51963d(0x277)](_0xcb743e[_0x51963d(0x248)][_0x51963d(0x1e8)]);}const _0x29c6a2=await executePushSegmentDeletions(_0x48070c,_0x586acc['journeysOnly']?[]:_0x4d80ad,_0x323a93);let _0x3104b1=0x0,_0xeb411d=0x0,_0x51548f=0x0;const _0x36ff5e=new Map(_0x38df0e);for(const [_0x234092,_0x31b29d]of _0x15f0b0[_0x51963d(0x1f9)]){_0x36ff5e['set'](_0x234092,_0x31b29d);}if(_0x403169['length']>0x0){const _0x3af011={..._0x2c597a,'segmentNameToId':_0x36ff5e,'existingSegments':_0x4ff995,'activationContext':_0x3e2586},_0x36a174=await executePushJourneys(_0x48070c,_0x403169,_0x3af011,{'parentId':_0x169f03,'rootFolderId':_0x2e277c,'verbose':_0x586acc['verbose']},_0x323a93);_0x3104b1=_0x36a174[_0x51963d(0x263)],_0xeb411d=_0x36a174['updated'];if(_0x304180&&_0x36a174[_0x51963d(0x22e)][_0x51963d(0x255)]===0x1){const _0x30fc45=_0x36a174[_0x51963d(0x22e)][0x0];if(_0x30fc45[_0x51963d(0x23b)]){const _0x72eabb=getConsoleNextUrl(_0x586acc[_0x51963d(0x264)],_0x51963d(0x25d)+_0x169f03+_0x51963d(0x1eb)+_0x30fc45['journeyId']+_0x51963d(0x1ef));console[_0x51963d(0x270)]('\x20\x20'+a35_0x5d6580[_0x51963d(0x266)](_0x72eabb));}}}for(const _0x2cdcc0 of _0xb3cce4){console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2cdcc0[_0x51963d(0x253)])),_0x51548f++;}const _0x46cd1f=[];if(_0x188155>0x0)_0x46cd1f[_0x51963d(0x23a)](_0x188155+_0x51963d(0x265));if(_0x1571f7>0x0)_0x46cd1f[_0x51963d(0x23a)](_0x1571f7+_0x51963d(0x256));if(_0x29c6a2>0x0)_0x46cd1f['push'](_0x29c6a2+_0x51963d(0x268));const _0x41770f=[];if(_0x3104b1>0x0)_0x41770f[_0x51963d(0x23a)](_0x3104b1+_0x51963d(0x265));if(_0xeb411d>0x0)_0x41770f[_0x51963d(0x23a)](_0xeb411d+'\x20updated');if(_0x51548f>0x0)_0x41770f['push'](_0x51548f+_0x51963d(0x268));const _0x67b9d3=[];if(_0x38a659>0x0)_0x67b9d3[_0x51963d(0x23a)](_0x38a659+'\x20created');if(_0x1c20ec>0x0)_0x67b9d3['push'](_0x1c20ec+_0x51963d(0x256));if(_0x3afd67>0x0)_0x67b9d3[_0x51963d(0x23a)](_0x3afd67+_0x51963d(0x268));console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x259)](_0x51963d(0x223)));_0x46cd1f[_0x51963d(0x255)]>0x0&&!_0x586acc[_0x51963d(0x1fa)]&&console[_0x51963d(0x270)]('\x20\x20Segments:\x20'+_0x46cd1f[_0x51963d(0x24b)](',\x20'));_0x41770f['length']>0x0&&console['error'](_0x51963d(0x202)+_0x41770f[_0x51963d(0x24b)](',\x20'));_0x67b9d3['length']>0x0&&!_0x586acc[_0x51963d(0x1fa)]&&console[_0x51963d(0x270)](_0x51963d(0x267)+_0x67b9d3['join'](',\x20'));if(_0x2d35a3){const _0x172a3a=getConsoleNextUrl(_0x586acc[_0x51963d(0x264)],_0x51963d(0x25d)+_0x169f03+_0x51963d(0x1eb)+_0x2d35a3+_0x51963d(0x22c));console[_0x51963d(0x270)](_0x51963d(0x205)+a35_0x5d6580[_0x51963d(0x266)](_0x172a3a));}return 0x0;}}
1
+ const a35_0x26f320=a35_0x2205;(function(_0x3119e1,_0x5cd4a7){const _0x1c78d8=a35_0x2205,_0x3e7cc7=_0x3119e1();while(!![]){try{const _0x346bb8=-parseInt(_0x1c78d8(0x15b))/0x1*(parseInt(_0x1c78d8(0x137))/0x2)+parseInt(_0x1c78d8(0x18f))/0x3*(-parseInt(_0x1c78d8(0x180))/0x4)+parseInt(_0x1c78d8(0x158))/0x5+-parseInt(_0x1c78d8(0x117))/0x6*(-parseInt(_0x1c78d8(0x188))/0x7)+parseInt(_0x1c78d8(0x16c))/0x8*(parseInt(_0x1c78d8(0x141))/0x9)+-parseInt(_0x1c78d8(0x1ac))/0xa*(parseInt(_0x1c78d8(0x14a))/0xb)+parseInt(_0x1c78d8(0x179))/0xc*(parseInt(_0x1c78d8(0x175))/0xd);if(_0x346bb8===_0x5cd4a7)break;else _0x3e7cc7['push'](_0x3e7cc7['shift']());}catch(_0x43c93c){_0x3e7cc7['push'](_0x3e7cc7['shift']());}}}(a35_0x5a30,0xd83a1));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';function a35_0x5a30(){const _0x257c37=['cyan','toString','Push\x20','Scoped\x20to\x20folder:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','get','delete','\x20\x20Activations:\x20','\x20\x20\x20\x20','no_parent','82472YkPePi','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','changed','yellow','Changes\x20to\x20journey:','toUpdate','activations','πŸ“\x20','193856tVBxcx','length','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','/j/da/je','1500eJVdBO','yes','buildUserMaps','user','\x20new','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','dryRun','5277968UuWPlz','endsWith','description','\x20to\x20update','segment','data','segmentFolderId','results','7VTAafQ','\x20\x20Journeys:\x20','journeysOnly','diff','listActivations','folders','Fetching\x20existing\x20data...','3bhXZCR','Fetching\x20existing\x20activations...','repeat','error','\x20\x20Segments:\x20','/sb/da/esr','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','list','getOutputSchemaWithCache','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','targetDir','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','site','\x20YAML\x20files\x20found','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Changes\x20to:','New\x20segment:','parent_name','Error:\x20Directory\x20not\x20found:\x20','yamlConfig','all','Fetching\x20connections\x20for\x20name\x20resolution...','journeyBundleId','push','created','red','Error:\x20','folderId','\x20updated','20kRPeZE','Folders\x20to\x20create:','Preparing\x20journeys...','createdAt','/e/','segment:push','scopedFolderPath','\x20folders\x20to\x20create','attributes','paused','journeyBundleName','verbose','green','5680140ErXcCC','journeys','file','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','createdSegmentIds','\x20unchanged','parentFolder','message','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','dim','new','segment\x20or\x20journey','folderPath','journey','audienceId','New\x20journey:','name','/app/ps/','add','.yaml','\x20to\x20create','isNew','unchanged','\x20\x20Activations:','idToName','\x20\x20πŸ“Š\x20Segments:','updatedAt','join','toDelete','\x0aError:','segments','set','6foOixz','cwd','execute','journeyId','\x20deleted','then','isScoped','map','\x20changed','connection','1422DXbJsW','existingSegment','listJourneysWithDetailsFromParentSegment','\x20to\x20delete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','deleted','type','Resolving\x20parent\x20segment\x20\x27','relationships','9537286wiqneS','toCreate','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','updated','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20changes?','filePath','Delete\x20segment:','\x27...','existingJourney','listFolders','nameToId','\x0aPush\x20summary\x20for\x20\x27','listSegments','2768255XcMZts','\x0aValidation\x20failed:','errorCode','351318PchwAY','blue','Site:\x20','helpText','resolveParentId','getParent','(Journey\x20will\x20be\x20deleted)'];a35_0x5a30=function(){return _0x257c37;};return a35_0x5a30();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a35_0x2205(_0x130eb7,_0x41e475){_0x130eb7=_0x130eb7-0x110;const _0x5a30f9=a35_0x5a30();let _0x220564=_0x5a30f9[_0x130eb7];return _0x220564;}import a35_0xac0d97 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_0x26f320(0x127)]=a35_0x26f320(0x1b1);['description']=a35_0x26f320(0x195);async[a35_0x26f320(0x139)](_0x4affab){const _0x40a683=a35_0x26f320,{options:_0x302b0f,args:_0x1df6e3,tdx:_0x2ceeb4}=_0x4affab,_0x174217=_0x302b0f,_0x299b3c=await resolveTarget({'arg':_0x1df6e3[0x0],'contextParent':_0x302b0f['parentSegment'],'cwd':process[_0x40a683(0x138)]()});if(!isSuccessfulResolution(_0x299b3c))return _0x299b3c[_0x40a683(0x15a)]===_0x40a683(0x16b)?(console[_0x40a683(0x192)](a35_0xac0d97['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error'](_0x40a683(0x16e)),console['error'](_0x40a683(0x166))):(console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x1a8)](_0x40a683(0x1a9)+_0x299b3c[_0x40a683(0x11e)]+'\x0a')),_0x299b3c['helpText']&&console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x162)](_0x299b3c[_0x40a683(0x15e)]))),0x1;if(_0x299b3c[_0x40a683(0x147)]===_0x40a683(0x1a0))return console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x1a8)](_0x40a683(0x1a1)+_0x299b3c[_0x40a683(0x199)]+'\x0a')),console['error'](a35_0xac0d97[_0x40a683(0x162)](_0x40a683(0x145))),0x1;const _0x416c89=_0x299b3c['parentName'],_0x443785=_0x299b3c[_0x40a683(0x199)],_0x2de2ff=_0x299b3c['type']===_0x40a683(0x119)?_0x299b3c[_0x40a683(0x150)]:undefined,_0x55d139=getScopedDetails(_0x299b3c),_0x58a71e=_0x55d139?.[_0x40a683(0x13d)]??![],_0x249e29=_0x55d139?.[_0x40a683(0x110)]??'';if(!existsSync(_0x443785))return console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x1a8)](_0x40a683(0x1a1)+_0x443785+'\x0a')),console[_0x40a683(0x192)](a35_0xac0d97['cyan'](_0x40a683(0x145))),0x1;_0x174217[_0x40a683(0x115)]&&(console[_0x40a683(0x192)](_0x40a683(0x15d)+_0x174217[_0x40a683(0x19b)]),console[_0x40a683(0x192)]('Parent\x20segment:\x20'+_0x416c89),console['error']('Source\x20directory:\x20'+_0x443785),_0x58a71e&&console['error'](_0x40a683(0x165)+_0x249e29));const _0x2ce2a7=await withSpinner(_0x40a683(0x148)+_0x416c89+_0x40a683(0x152),()=>_0x2ceeb4['segment'][_0x40a683(0x15f)](_0x416c89),{'verbose':_0x174217[_0x40a683(0x115)]}),_0x3d6035=_0x2ce2a7[_0x40a683(0x185)],{parentSegmentResult:_0x222966,segmentsResult:_0x37a597,foldersResult:_0x4d806d,journeysWithDetailsResult:_0x52bb12,userMaps:_0x299059}=await withSpinner(_0x40a683(0x18e),async()=>{const _0x1967de=_0x40a683,[_0x134beb,_0x439a6d,_0x38855f,_0x230fb6,_0x4547bb]=await Promise[_0x1967de(0x1a3)]([_0x2ceeb4[_0x1967de(0x184)][_0x1967de(0x160)](_0x3d6035),_0x2ceeb4['segment'][_0x1967de(0x157)](_0x3d6035),_0x2ceeb4[_0x1967de(0x184)][_0x1967de(0x154)](_0x3d6035),_0x2ceeb4[_0x1967de(0x124)][_0x1967de(0x143)](_0x3d6035,{'includeAllVersions':!![]}),_0x2ceeb4['user'][_0x1967de(0x17b)]()]);return{'parentSegmentResult':_0x134beb,'segmentsResult':_0x439a6d,'foldersResult':_0x38855f,'journeysWithDetailsResult':_0x230fb6,'userMaps':_0x4547bb};},{'verbose':_0x174217[_0x40a683(0x115)]})[_0x40a683(0x13c)](_0xdf392a=>_0xdf392a[_0x40a683(0x185)]),_0x3d8b08=_0x222966,_0x525d33=extractRootFolderId(_0x3d8b08),_0x4ef987=_0x37a597,_0x371847=_0x4d806d,{journeys:_0x136cdf,activationStepsById:_0x2490e2}=_0x52bb12,_0x1d137f=new Map(_0x136cdf[_0x40a683(0x13e)](_0x5b03f4=>[_0x5b03f4['id'],_0x5b03f4])),_0x55b3f6=_0x136cdf['map'](_0x79725a=>({'id':_0x79725a['id'],'name':_0x79725a['attributes'][_0x40a683(0x127)],'journeyBundleName':_0x79725a['attributes'][_0x40a683(0x114)]||'','journeyBundleId':_0x79725a[_0x40a683(0x112)][_0x40a683(0x1a5)]||'','versionNumber':_0x79725a[_0x40a683(0x112)]['versionNumber'],'description':_0x79725a[_0x40a683(0x112)][_0x40a683(0x182)],'state':_0x79725a[_0x40a683(0x112)]['state'],'paused':_0x79725a[_0x40a683(0x112)][_0x40a683(0x113)],'audienceId':_0x79725a[_0x40a683(0x112)][_0x40a683(0x125)],'folderId':_0x79725a[_0x40a683(0x149)]?.[_0x40a683(0x11d)]?.['data']?.['id'],'createdAt':_0x79725a[_0x40a683(0x112)][_0x40a683(0x1af)],'updatedAt':_0x79725a[_0x40a683(0x112)][_0x40a683(0x131)]})),{emailToId:_0x144080,idToEmail:_0xbbde80}=_0x299059,_0x122cab=await withSpinner(_0x40a683(0x1a4),async()=>{const _0x1625c1=_0x40a683,_0x401c83=await _0x2ceeb4[_0x1625c1(0x140)][_0x1625c1(0x196)]();return buildConnectionMaps(_0x401c83);},{'verbose':_0x174217['verbose']})[_0x40a683(0x13c)](_0x22b5fa=>_0x22b5fa[_0x40a683(0x185)]),_0x3b0918=_0x122cab[_0x40a683(0x155)],_0x26be00=_0x122cab[_0x40a683(0x12f)],_0x5275fa=_0x122cab['nameToType'],_0x159743={'emailToIdMap':_0x144080,'connectionNameToIdMap':_0x3b0918,'connectionNameToTypeMap':_0x5275fa,'getSchema':_0x271d28=>_0x2ceeb4[_0x40a683(0x140)][_0x40a683(0x197)](_0x271d28)};let {pathToId:_0x47fe21,idToPath:_0x81cb59}=buildFolderMaps(_0x371847);const _0xd0b69a=buildSegmentLookupMap(_0x4ef987,_0x81cb59),_0xaaa042=buildSegmentNameToIdMap(_0x4ef987),_0x3b570c=buildJourneyBundleLookupMap(_0x55b3f6,_0x81cb59);let _0x37f9c5;if(_0x2de2ff){if(!_0x2de2ff['endsWith']('.yml')&&!_0x2de2ff[_0x40a683(0x181)](_0x40a683(0x12a)))return console[_0x40a683(0x192)](a35_0xac0d97['red'](_0x40a683(0x11f)+_0x2de2ff+'\x0a')),0x1;_0x37f9c5=[_0x2de2ff];}else _0x37f9c5=findYamlFiles(_0x443785);if(_0x37f9c5[_0x40a683(0x176)]===0x0)return console[_0x40a683(0x192)](a35_0xac0d97['red'](_0x40a683(0x14c)+_0x443785+'\x0a')),console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x162)](_0x40a683(0x19d))),0x1;let _0x2659b8,_0x44460a;try{const _0x5a8a1e=parseAndClassifyYamlFiles(_0x37f9c5,_0x443785,{'skipSegments':_0x174217['journeysOnly']});_0x2659b8=_0x5a8a1e[_0x40a683(0x135)],_0x44460a=_0x5a8a1e[_0x40a683(0x118)];const _0x20fd41=validateParsedFiles(_0x5a8a1e,_0x443785);if(_0x20fd41[_0x40a683(0x176)]>0x0)return console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x1a8)](_0x40a683(0x159))),console[_0x40a683(0x192)](formatValidationErrors(_0x20fd41)),console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x170)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0xe2e989){return console['error'](a35_0xac0d97[_0x40a683(0x1a8)]('Error\x20parsing\x20YAML:\x20'+(_0xe2e989 instanceof Error?_0xe2e989[_0x40a683(0x11e)]:_0xe2e989))),0x1;}if(_0x2659b8['length']===0x0&&_0x44460a[_0x40a683(0x176)]===0x0){const _0x263492=_0x174217[_0x40a683(0x18a)]?_0x40a683(0x124):_0x40a683(0x122);return console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x170)]('No\x20'+_0x263492+_0x40a683(0x19c))),0x0;}const _0x521aca=new Map();_0x4ef987[_0x40a683(0x176)]>0x0&&!_0x174217['journeysOnly']&&await withSpinner(_0x40a683(0x190),async()=>{await batchAsync(_0x4ef987,async _0x8dd22e=>{const _0x3702f4=a35_0x2205,_0x131a46=await _0x2ceeb4['segment'][_0x3702f4(0x18c)](_0x3d6035,_0x8dd22e['id']);_0x521aca[_0x3702f4(0x136)](_0x8dd22e['id'],_0x131a46);});},{'verbose':_0x174217[_0x40a683(0x115)]});const {segmentFiles:_0x57ae2d,foldersToCreate:_0x939d91}=await prepareSegmentFiles(_0x2659b8,{'segmentByFolderAndName':_0xd0b69a,'activationsBySegmentId':_0x521aca,'folderPathToId':_0x47fe21,'idToEmailMap':_0xbbde80,'connectionIdToNameMap':_0x26be00},_0x159743,_0x58a71e,_0x249e29),_0x408908=_0x2de2ff?[]:findSegmentsToDelete(_0x4ef987,_0x2659b8[_0x40a683(0x13e)](({yamlConfig:_0x21c620,folderPath:_0x4be9e9})=>({'yamlConfig':_0x21c620,'folderPath':resolveTDFolderPath(_0x4be9e9,_0x58a71e,_0x249e29)})),_0x81cb59,_0x249e29,_0x58a71e),{journeyFiles:_0x4fe191,foldersToCreate:_0x2dcd7a}=await withProgressSpinner(_0x40a683(0x1ae),async _0x386240=>prepareJourneyFiles(_0x44460a,{'fetchJourney':async _0xe76861=>_0x2ceeb4[_0x40a683(0x124)]['getJourney'](_0xe76861[_0x40a683(0x13a)]),'journeyBundlesByFolderAndName':_0x3b570c,'folderPathToId':_0x47fe21,'idToEmailMap':_0xbbde80,'connectionIdToNameMap':_0x26be00,'existingSegments':_0x4ef987,'parentId':_0x3d6035,'deps':_0x2ceeb4,'progress':{'update':_0x5e11ea=>{const _0x5bc24e=_0x40a683;_0x386240['setPhase'](_0x5e11ea),_0x174217[_0x5bc24e(0x115)]&&console[_0x5bc24e(0x192)]('\x20\x20'+_0x5e11ea);}},'journeyById':_0x1d137f,'activationStepsById':_0x2490e2},_0x58a71e,_0x249e29),{'verbose':_0x174217[_0x40a683(0x115)]})[_0x40a683(0x13c)](_0x4b4251=>_0x4b4251[_0x40a683(0x185)]);for(const _0x59999a of _0x2dcd7a){_0x939d91[_0x40a683(0x129)](_0x59999a);}const _0x2803e2=_0x2de2ff?[]:findJourneysToDelete(_0x55b3f6,_0x44460a['map'](({yamlConfig:_0x643fd0,folderPath:_0x5ae93d})=>({'yamlConfig':_0x643fd0,'folderPath':resolveTDFolderPath(_0x5ae93d,_0x58a71e,_0x249e29)})),_0x81cb59,_0x249e29,_0x58a71e),_0x52898f=calculatePushStats(_0x57ae2d,_0x4fe191,_0x939d91,_0x408908,_0x2803e2,!!_0x174217[_0x40a683(0x168)],!!_0x174217['journeysOnly']),_0x55373b=_0x52898f['segments'][_0x40a683(0x121)],_0x36e02d=_0x52898f[_0x40a683(0x135)][_0x40a683(0x16f)],_0x176fe7=_0x52898f[_0x40a683(0x135)][_0x40a683(0x12d)],_0x1a67b4=_0x52898f['segments']['toDelete'],_0x283012=_0x52898f[_0x40a683(0x18d)][_0x40a683(0x14b)],_0x40735a=_0x52898f[_0x40a683(0x118)]['new'],_0xd4969a=_0x52898f['journeys'][_0x40a683(0x16f)],_0x36e218=_0x52898f['journeys'][_0x40a683(0x12d)],_0x1f3672=_0x52898f[_0x40a683(0x118)]['toDelete'],_0x377fd=_0x52898f[_0x40a683(0x173)][_0x40a683(0x1a3)],_0x2c8872=_0x52898f['activations'][_0x40a683(0x14b)],_0x49bf3d=_0x52898f[_0x40a683(0x173)][_0x40a683(0x172)],_0x2b6349=_0x52898f[_0x40a683(0x173)][_0x40a683(0x133)];console[_0x40a683(0x192)](_0x40a683(0x156)+_0x416c89+'\x27:');_0x283012['length']>0x0&&console['error']('\x20\x20'+a35_0xac0d97[_0x40a683(0x15c)](_0x40a683(0x174)+_0x283012[_0x40a683(0x176)]+_0x40a683(0x111)));if(!_0x174217[_0x40a683(0x18a)]){console[_0x40a683(0x192)](_0x40a683(0x130)),console[_0x40a683(0x192)](_0x40a683(0x16a)+a35_0xac0d97['green']('+\x20'+_0x55373b[_0x40a683(0x176)]+_0x40a683(0x17d))),console[_0x40a683(0x192)](_0x40a683(0x16a)+a35_0xac0d97['yellow']('~\x20'+_0x36e02d[_0x40a683(0x176)]+'\x20changed'));if(_0x1a67b4[_0x40a683(0x176)]>0x0)console['error'](_0x40a683(0x16a)+a35_0xac0d97[_0x40a683(0x1a8)]('-\x20'+_0x1a67b4[_0x40a683(0x176)]+_0x40a683(0x144)));else _0x408908['length']>0x0&&!_0x174217['delete']&&console[_0x40a683(0x192)]('\x20\x20\x20\x20'+a35_0xac0d97[_0x40a683(0x120)](_0x408908[_0x40a683(0x176)]+_0x40a683(0x17e)));console['error'](_0x40a683(0x16a)+a35_0xac0d97[_0x40a683(0x120)]('=\x20'+_0x176fe7['length']+_0x40a683(0x11c)));}if(_0x4fe191[_0x40a683(0x176)]>0x0||_0x2803e2[_0x40a683(0x176)]>0x0){console[_0x40a683(0x192)](_0x40a683(0x19a)),console[_0x40a683(0x192)](_0x40a683(0x16a)+a35_0xac0d97[_0x40a683(0x116)]('+\x20'+_0x40735a[_0x40a683(0x176)]+_0x40a683(0x17d))),console[_0x40a683(0x192)](_0x40a683(0x16a)+a35_0xac0d97[_0x40a683(0x170)]('~\x20'+_0xd4969a[_0x40a683(0x176)]+_0x40a683(0x13f)));if(_0x1f3672[_0x40a683(0x176)]>0x0)console[_0x40a683(0x192)](_0x40a683(0x16a)+a35_0xac0d97[_0x40a683(0x1a8)]('-\x20'+_0x1f3672[_0x40a683(0x176)]+'\x20to\x20delete'));else _0x2803e2[_0x40a683(0x176)]>0x0&&!_0x174217[_0x40a683(0x168)]&&console['error']('\x20\x20\x20\x20'+a35_0xac0d97[_0x40a683(0x120)](_0x2803e2[_0x40a683(0x176)]+_0x40a683(0x17e)));console[_0x40a683(0x192)](_0x40a683(0x16a)+a35_0xac0d97[_0x40a683(0x120)]('=\x20'+_0x36e218[_0x40a683(0x176)]+_0x40a683(0x11c)));}_0x377fd['length']>0x0&&!_0x174217[_0x40a683(0x18a)]&&(console[_0x40a683(0x192)](''),console[_0x40a683(0x192)](_0x40a683(0x12e)),_0x2c8872[_0x40a683(0x176)]>0x0&&console[_0x40a683(0x192)](_0x40a683(0x16a)+a35_0xac0d97['green']('+\x20'+_0x2c8872[_0x40a683(0x176)]+_0x40a683(0x12b))),_0x49bf3d[_0x40a683(0x176)]>0x0&&console['error']('\x20\x20\x20\x20'+a35_0xac0d97[_0x40a683(0x170)]('~\x20'+_0x49bf3d[_0x40a683(0x176)]+_0x40a683(0x183))),_0x2b6349[_0x40a683(0x176)]>0x0&&console[_0x40a683(0x192)](_0x40a683(0x16a)+a35_0xac0d97[_0x40a683(0x1a8)]('-\x20'+_0x2b6349[_0x40a683(0x176)]+_0x40a683(0x144))));console[_0x40a683(0x192)]('\x20\x20Source:\x20'+a35_0xac0d97['cyan'](_0x443785)+'\x0a');if(_0x283012[_0x40a683(0x176)]>0x0){console[_0x40a683(0x192)](_0x40a683(0x1ad));for(const _0x39e37f of _0x283012){console[_0x40a683(0x192)]('\x20\x20'+a35_0xac0d97['blue']('+')+'\x20'+_0x39e37f);}console['error']('');}if(_0x55373b['length']>0x0&&!_0x174217[_0x40a683(0x18a)])for(const _0x23aa8d of _0x55373b){const _0x376c1e=_0x23aa8d[_0x40a683(0x123)]?_0x23aa8d[_0x40a683(0x123)]+'/'+_0x23aa8d[_0x40a683(0x1a2)][_0x40a683(0x127)]:_0x23aa8d[_0x40a683(0x1a2)][_0x40a683(0x127)],_0x52cffe=_0x23aa8d[_0x40a683(0x1a2)][_0x40a683(0x173)]?.['length']||0x0,_0x295e9a=_0x52cffe>0x0?a35_0xac0d97[_0x40a683(0x120)]('\x20['+_0x52cffe+'\x20activations]'):'';console[_0x40a683(0x192)]('\x0a'+a35_0xac0d97[_0x40a683(0x116)](_0x40a683(0x19f))+'\x20'+_0x376c1e+_0x295e9a),console[_0x40a683(0x192)]('─'[_0x40a683(0x191)](0x3c)),_0x23aa8d[_0x40a683(0x18b)]&&console[_0x40a683(0x192)](_0x23aa8d[_0x40a683(0x18b)]),console[_0x40a683(0x192)]('─'['repeat'](0x3c));}if(_0x1a67b4['length']>0x0&&!_0x174217[_0x40a683(0x18a)])for(const _0x47e193 of _0x1a67b4){const _0x582743=_0x47e193[_0x40a683(0x186)]?_0x81cb59[_0x40a683(0x167)](_0x47e193['segmentFolderId'][_0x40a683(0x163)]())||'':'',_0xb0ca7=_0x582743?_0x582743+'/'+_0x47e193['name']:_0x47e193[_0x40a683(0x127)],_0x35bc6e=_0x521aca[_0x40a683(0x167)](_0x47e193['id'])||[],_0x3aa573=_0x35bc6e[_0x40a683(0x176)]>0x0?a35_0xac0d97[_0x40a683(0x120)]('\x20['+_0x35bc6e[_0x40a683(0x176)]+'\x20activations]'):'';console[_0x40a683(0x192)]('\x0a'+a35_0xac0d97[_0x40a683(0x1a8)](_0x40a683(0x151))+'\x20'+_0xb0ca7+_0x3aa573),console[_0x40a683(0x192)]('─'[_0x40a683(0x191)](0x3c));const _0xdd7541=segmentWithActivationsToYaml(_0x47e193,_0x35bc6e,undefined,_0xbbde80,_0x26be00),_0x43f8db=segmentToYamlString(_0xdd7541),_0x399731=generateDiff(_0x43f8db,'');console['error'](formatDiffWithColors(_0x399731)),console[_0x40a683(0x192)]('─'[_0x40a683(0x191)](0x3c));}const _0x450368=_0x57ae2d['filter'](_0x5e8d9f=>!_0x5e8d9f[_0x40a683(0x12c)]&&_0x5e8d9f['diff']);if(_0x450368['length']>0x0&&!_0x174217[_0x40a683(0x18a)])for(const _0x2e02fb of _0x450368){const _0x4bf5b4=_0x2e02fb[_0x40a683(0x123)]?_0x2e02fb['folderPath']+'/'+_0x2e02fb[_0x40a683(0x1a2)][_0x40a683(0x127)]:_0x2e02fb[_0x40a683(0x1a2)]['name'];console[_0x40a683(0x192)]('\x0a'+a35_0xac0d97['yellow'](_0x40a683(0x19e))+'\x20'+_0x4bf5b4),console['error']('─'[_0x40a683(0x191)](0x3c)),console[_0x40a683(0x192)](_0x2e02fb['diff']),console[_0x40a683(0x192)]('─'[_0x40a683(0x191)](0x3c));}if(_0x40735a[_0x40a683(0x176)]>0x0)for(const _0x782f70 of _0x40735a){const _0x548185=_0x782f70[_0x40a683(0x123)]?_0x782f70[_0x40a683(0x123)]+'/'+_0x782f70['yamlConfig'][_0x40a683(0x127)]:_0x782f70['yamlConfig'][_0x40a683(0x127)];console['error']('\x0a'+a35_0xac0d97[_0x40a683(0x116)](_0x40a683(0x126))+'\x20'+_0x548185),console['error']('─'[_0x40a683(0x191)](0x3c)),_0x782f70[_0x40a683(0x18b)]&&console[_0x40a683(0x192)](_0x782f70['diff']),console[_0x40a683(0x192)]('─'[_0x40a683(0x191)](0x3c));}const _0x4703eb=_0x4fe191['filter'](_0x4af5e8=>!_0x4af5e8[_0x40a683(0x12c)]&&_0x4af5e8[_0x40a683(0x18b)]);if(_0x4703eb['length']>0x0)for(const _0x4bedb2 of _0x4703eb){const _0x3396d1=_0x4bedb2[_0x40a683(0x123)]?_0x4bedb2[_0x40a683(0x123)]+'/'+_0x4bedb2['yamlConfig'][_0x40a683(0x127)]:_0x4bedb2['yamlConfig'][_0x40a683(0x127)];console[_0x40a683(0x192)]('\x0a'+a35_0xac0d97[_0x40a683(0x170)](_0x40a683(0x171))+'\x20'+_0x3396d1),console[_0x40a683(0x192)]('─'[_0x40a683(0x191)](0x3c)),console[_0x40a683(0x192)](_0x4bedb2['diff']),console['error']('─'[_0x40a683(0x191)](0x3c));}if(_0x1f3672['length']>0x0)for(const _0x416fa4 of _0x1f3672){const _0x480815=_0x416fa4[_0x40a683(0x1aa)]?_0x81cb59[_0x40a683(0x167)](_0x416fa4[_0x40a683(0x1aa)])||'':'',_0x40b055=_0x480815?_0x480815+'/'+_0x416fa4[_0x40a683(0x114)]:_0x416fa4[_0x40a683(0x114)];console['error']('\x0a'+a35_0xac0d97[_0x40a683(0x1a8)]('Delete\x20journey:')+'\x20'+_0x40b055),console[_0x40a683(0x192)]('─'['repeat'](0x3c)),console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x1a8)](_0x40a683(0x161))),console[_0x40a683(0x192)]('─'[_0x40a683(0x191)](0x3c));}if(_0x174217[_0x40a683(0x17f)])return console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x170)](_0x40a683(0x16d))),0x0;const _0x7b8de4=_0x174217[_0x40a683(0x18a)]?![]:_0x55373b[_0x40a683(0x176)]>0x0||_0x36e02d[_0x40a683(0x176)]>0x0||_0x1a67b4[_0x40a683(0x176)]>0x0,_0x59ff1d=_0x40735a['length']>0x0||_0xd4969a['length']>0x0||_0x1f3672[_0x40a683(0x176)]>0x0,_0x2d62e8=_0x174217['journeysOnly']?![]:_0x377fd[_0x40a683(0x176)]>0x0,_0x35b11=_0x283012['length']>0x0;if(!_0x7b8de4&&!_0x59ff1d&&!_0x2d62e8&&!_0x35b11){const _0x33bce9=_0x174217[_0x40a683(0x18a)]?_0x40a683(0x11a):_0x40a683(0x14e);console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x116)](_0x33bce9));if(_0x2de2ff&&_0x176fe7[_0x40a683(0x176)]===0x1){const _0xb7b47d=_0x176fe7[0x0];if(_0xb7b47d[_0x40a683(0x142)]?.['id']){const _0x52e461=getConsoleNextUrl(_0x174217[_0x40a683(0x19b)],_0x40a683(0x128)+_0x3d6035+'/e/'+_0xb7b47d['existingSegment']['id']+_0x40a683(0x194));console[_0x40a683(0x192)](_0x40a683(0x177)+a35_0xac0d97[_0x40a683(0x162)](_0x52e461));}}if(_0x2de2ff&&_0x36e218[_0x40a683(0x176)]===0x1){const _0x5c9a99=_0x36e218[0x0];if(_0x5c9a99[_0x40a683(0x153)]?.['id']){const _0x3741d2=getConsoleNextUrl(_0x174217[_0x40a683(0x19b)],_0x40a683(0x128)+_0x3d6035+_0x40a683(0x1b0)+_0x5c9a99[_0x40a683(0x153)]['id']+'/j/da/je');console['error']('\x20\x20'+a35_0xac0d97[_0x40a683(0x162)](_0x3741d2));}}return 0x0;}const _0x26e45a=_0x174217['journeysOnly']?_0x40735a[_0x40a683(0x176)]+_0xd4969a[_0x40a683(0x176)]+_0x1f3672[_0x40a683(0x176)]+_0x283012[_0x40a683(0x176)]:_0x55373b['length']+_0x36e02d[_0x40a683(0x176)]+_0x1a67b4[_0x40a683(0x176)]+_0x40735a[_0x40a683(0x176)]+_0xd4969a[_0x40a683(0x176)]+_0x1f3672[_0x40a683(0x176)]+_0x283012[_0x40a683(0x176)]+_0x377fd[_0x40a683(0x176)];if(!_0x174217[_0x40a683(0x17a)]&&_0x26e45a>0x0){if(!isInteractive())return console['error'](a35_0xac0d97[_0x40a683(0x1a8)](_0x40a683(0x134)),_0x40a683(0x198)),console['error'](a35_0xac0d97[_0x40a683(0x120)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x420cfd=await confirmKey(_0x40a683(0x164)+_0x26e45a+_0x40a683(0x14f));if(!_0x420cfd)return console[_0x40a683(0x192)](a35_0xac0d97['yellow']('Aborted.')),0x1;}const _0x39bd7c={'withProgress':async(_0x32ec39,_0x3ae962)=>{const _0x4350b9=_0x40a683,_0x36e5b9=await withSpinner(_0x32ec39,_0x3ae962,{'verbose':_0x174217[_0x4350b9(0x115)]});return{'data':_0x36e5b9[_0x4350b9(0x185)]};},'logInfo':_0x55f129=>console['error'](a35_0xac0d97[_0x40a683(0x15c)]('βœ”\x20'+_0x55f129)),'logSuccess':_0x4c1009=>console['error'](a35_0xac0d97[_0x40a683(0x116)]('βœ”\x20'+_0x4c1009)),'logWarning':_0x3be8fb=>console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x170)]('⚠\x20'+_0x3be8fb)),'logDeleted':_0x50995d=>console[_0x40a683(0x192)](a35_0xac0d97['red']('βœ”\x20'+_0x50995d))},_0x104b5c={'segment':_0x2ceeb4[_0x40a683(0x184)],'journey':_0x2ceeb4[_0x40a683(0x124)],'user':_0x2ceeb4[_0x40a683(0x17c)],'connection':_0x2ceeb4['connection']};_0x283012[_0x40a683(0x176)]>0x0&&(_0x47fe21=await executePushFolders(_0x104b5c,_0x283012,_0x47fe21,{'parentId':_0x3d6035},_0x39bd7c));const _0x130257={'rootFolderId':_0x525d33,'folderPathToId':_0x47fe21,'folderIdToPath':_0x81cb59,'segmentNameToId':_0xaaa042,'activationsBySegmentId':_0x521aca,'emailToIdMap':_0x144080,'idToEmailMap':_0xbbde80,'connectionNameToIdMap':_0x122cab[_0x40a683(0x155)],'connectionIdToNameMap':_0x122cab[_0x40a683(0x12f)],'connectionNameToTypeMap':_0x5275fa},_0x3c2b17=await executePushSegments(_0x104b5c,_0x174217[_0x40a683(0x18a)]?[]:_0x57ae2d,_0x130257,{'parentId':_0x3d6035},_0x39bd7c),_0x5ace76=_0x3c2b17[_0x40a683(0x1a7)],_0xbf6a85=_0x3c2b17[_0x40a683(0x14d)],_0x263ba6=_0x3c2b17[_0x40a683(0x173)]['created'],_0x464072=_0x3c2b17[_0x40a683(0x173)]['updated'],_0x1da2e0=_0x3c2b17['activations'][_0x40a683(0x146)];let _0x1596a7;if(_0x2de2ff&&_0x57ae2d[_0x40a683(0x176)]===0x1){const _0x3a727f=_0x57ae2d[0x0];_0x1596a7=_0x3a727f[_0x40a683(0x142)]?.['id']??_0x3c2b17[_0x40a683(0x11b)]['get'](_0x3a727f[_0x40a683(0x1a2)]['name']);}const _0x2fe19e=await executePushSegmentDeletions(_0x104b5c,_0x174217[_0x40a683(0x18a)]?[]:_0x1a67b4,_0x39bd7c);let _0x80d9a2=0x0,_0x224c76=0x0,_0x42e1f2=0x0;const _0x4393ba=new Map(_0xaaa042);for(const [_0x1a0d2e,_0x99c8f7]of _0x3c2b17[_0x40a683(0x11b)]){_0x4393ba['set'](_0x1a0d2e,_0x99c8f7);}if(_0x4fe191['length']>0x0){const _0xb612a9={..._0x130257,'segmentNameToId':_0x4393ba,'existingSegments':_0x4ef987,'activationContext':_0x159743},_0x5a1a98=await executePushJourneys(_0x104b5c,_0x4fe191,_0xb612a9,{'parentId':_0x3d6035,'rootFolderId':_0x525d33,'verbose':_0x174217[_0x40a683(0x115)]},_0x39bd7c);_0x80d9a2=_0x5a1a98[_0x40a683(0x1a7)],_0x224c76=_0x5a1a98['updated'];if(_0x2de2ff&&_0x5a1a98[_0x40a683(0x187)][_0x40a683(0x176)]===0x1){const _0x14d7eb=_0x5a1a98[_0x40a683(0x187)][0x0];if(_0x14d7eb[_0x40a683(0x13a)]){const _0xf06edb=getConsoleNextUrl(_0x174217['site'],_0x40a683(0x128)+_0x3d6035+'/e/'+_0x14d7eb[_0x40a683(0x13a)]+_0x40a683(0x178));console[_0x40a683(0x192)]('\x20\x20'+a35_0xac0d97[_0x40a683(0x162)](_0xf06edb));}}}for(const _0x347487 of _0x1f3672){console['error'](a35_0xac0d97['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x347487[_0x40a683(0x114)])),_0x42e1f2++;}const _0x19dbcc=[];if(_0x5ace76>0x0)_0x19dbcc[_0x40a683(0x1a6)](_0x5ace76+'\x20created');if(_0xbf6a85>0x0)_0x19dbcc[_0x40a683(0x1a6)](_0xbf6a85+_0x40a683(0x1ab));if(_0x2fe19e>0x0)_0x19dbcc[_0x40a683(0x1a6)](_0x2fe19e+_0x40a683(0x13b));const _0x54321d=[];if(_0x80d9a2>0x0)_0x54321d[_0x40a683(0x1a6)](_0x80d9a2+'\x20created');if(_0x224c76>0x0)_0x54321d[_0x40a683(0x1a6)](_0x224c76+_0x40a683(0x1ab));if(_0x42e1f2>0x0)_0x54321d[_0x40a683(0x1a6)](_0x42e1f2+_0x40a683(0x13b));const _0x28cdf1=[];if(_0x263ba6>0x0)_0x28cdf1['push'](_0x263ba6+'\x20created');if(_0x464072>0x0)_0x28cdf1['push'](_0x464072+_0x40a683(0x1ab));if(_0x1da2e0>0x0)_0x28cdf1[_0x40a683(0x1a6)](_0x1da2e0+_0x40a683(0x13b));console[_0x40a683(0x192)](a35_0xac0d97[_0x40a683(0x116)]('\x0aβœ”\x20Push\x20complete'));_0x19dbcc[_0x40a683(0x176)]>0x0&&!_0x174217[_0x40a683(0x18a)]&&console[_0x40a683(0x192)](_0x40a683(0x193)+_0x19dbcc['join'](',\x20'));_0x54321d[_0x40a683(0x176)]>0x0&&console[_0x40a683(0x192)](_0x40a683(0x189)+_0x54321d[_0x40a683(0x132)](',\x20'));_0x28cdf1[_0x40a683(0x176)]>0x0&&!_0x174217[_0x40a683(0x18a)]&&console[_0x40a683(0x192)](_0x40a683(0x169)+_0x28cdf1[_0x40a683(0x132)](',\x20'));if(_0x1596a7){const _0x403e2e=getConsoleNextUrl(_0x174217[_0x40a683(0x19b)],'/app/ps/'+_0x3d6035+_0x40a683(0x1b0)+_0x1596a7+'/sb/da/esr');console[_0x40a683(0x192)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a35_0xac0d97[_0x40a683(0x162)](_0x403e2e));}return 0x0;}}