@treasuredata/tdx 2026.3.6 β†’ 2026.3.8

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 (208) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-command.js.map +1 -1
  11. package/dist/commands/auth-login-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/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/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.d.ts.map +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/profiles-command.js.map +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.d.ts.map +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/user-command.js.map +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.d.ts.map +1 -1
  69. package/dist/core/oauth.js +1 -1
  70. package/dist/core/oauth.js.map +1 -1
  71. package/dist/core/profile.js +1 -1
  72. package/dist/core/project-config.js +1 -1
  73. package/dist/core/session.js +1 -1
  74. package/dist/core/user-cache.js +1 -1
  75. package/dist/core/version.js +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/mcp/server.js +1 -1
  78. package/dist/mcp/tools/index.js +1 -1
  79. package/dist/mcp/tools/tdx-run.js +1 -1
  80. package/dist/mcp/tools/tdx-search.js +1 -1
  81. package/dist/mcp/utils.js +1 -1
  82. package/dist/proxy/claude-usage-tracker.js +1 -1
  83. package/dist/proxy/passthrough-server.js +1 -1
  84. package/dist/proxy/sse-usage-parser.js +1 -1
  85. package/dist/sdk/agent/agent-config.js +1 -1
  86. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  87. package/dist/sdk/agent/agent-yaml.js +1 -1
  88. package/dist/sdk/agent/test/evaluator.js +1 -1
  89. package/dist/sdk/agent/test/executor.js +1 -1
  90. package/dist/sdk/agent/test/index.js +1 -1
  91. package/dist/sdk/agent/test/output.js +1 -1
  92. package/dist/sdk/agent/test/parser.js +1 -1
  93. package/dist/sdk/agent/tool-target-registry.js +1 -1
  94. package/dist/sdk/api.js +1 -1
  95. package/dist/sdk/client/cdp-api-client.js +1 -1
  96. package/dist/sdk/client/delivery-api-client.js +1 -1
  97. package/dist/sdk/client/endpoints.js +1 -1
  98. package/dist/sdk/client/engage-api-client.js +1 -1
  99. package/dist/sdk/client/http-client.js +1 -1
  100. package/dist/sdk/client/llm-api-client.js +1 -1
  101. package/dist/sdk/client/oauth-refresh.js +1 -1
  102. package/dist/sdk/client/rate-limiter.js +1 -1
  103. package/dist/sdk/client/td-api-client.js +1 -1
  104. package/dist/sdk/client/trino-api-client.js +1 -1
  105. package/dist/sdk/client/workflow-client.js +1 -1
  106. package/dist/sdk/connection-validator.js +1 -1
  107. package/dist/sdk/connection.js +1 -1
  108. package/dist/sdk/delivery.js +1 -1
  109. package/dist/sdk/engage/campaign-pull.js +1 -1
  110. package/dist/sdk/engage/campaign-push.js +1 -1
  111. package/dist/sdk/engage/campaign-validator.js +1 -1
  112. package/dist/sdk/engage/campaign-yaml.js +1 -1
  113. package/dist/sdk/engage/template-pull.js +1 -1
  114. package/dist/sdk/engage/template-push.js +1 -1
  115. package/dist/sdk/engage/template-validator.js +1 -1
  116. package/dist/sdk/engage/template-yaml.js +1 -1
  117. package/dist/sdk/engage/types/campaign-def.js +1 -1
  118. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  119. package/dist/sdk/engage/types/template-schema.js +1 -1
  120. package/dist/sdk/engage.js +1 -1
  121. package/dist/sdk/errors.js +1 -1
  122. package/dist/sdk/index.js +1 -1
  123. package/dist/sdk/io/index.js +1 -1
  124. package/dist/sdk/io/node-filesystem.js +1 -1
  125. package/dist/sdk/job.js +1 -1
  126. package/dist/sdk/journey.js +1 -1
  127. package/dist/sdk/llm/chat-cache.js +1 -1
  128. package/dist/sdk/llm/index.js +1 -1
  129. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  130. package/dist/sdk/llm/model-factors.js +1 -1
  131. package/dist/sdk/personalization.js +1 -1
  132. package/dist/sdk/query/index.js +1 -1
  133. package/dist/sdk/query/sql-parser.js +1 -1
  134. package/dist/sdk/realtime.js +1 -1
  135. package/dist/sdk/schedule.js +1 -1
  136. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  137. package/dist/sdk/segment/fields-display.js +1 -1
  138. package/dist/sdk/segment/file-discovery.js +1 -1
  139. package/dist/sdk/segment/journey-utils.js +1 -1
  140. package/dist/sdk/segment/journey-validator.js +1 -1
  141. package/dist/sdk/segment/journey-yaml.js +1 -1
  142. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  143. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  144. package/dist/sdk/segment/pull-workflow.js +1 -1
  145. package/dist/sdk/segment/push-recovery.js +1 -1
  146. package/dist/sdk/segment/push-workflow.js +1 -1
  147. package/dist/sdk/segment/resolution-context.js +1 -1
  148. package/dist/sdk/segment/segment-path-parser.js +1 -1
  149. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  150. package/dist/sdk/segment/segment-validator.js +1 -1
  151. package/dist/sdk/segment/target-resolution.js +1 -1
  152. package/dist/sdk/segment/tdx-config.js +1 -1
  153. package/dist/sdk/segment/types/activation-schema.js +1 -1
  154. package/dist/sdk/segment/types/journey-def.js +1 -1
  155. package/dist/sdk/segment/types/journey-schema.js +1 -1
  156. package/dist/sdk/segment/types/segment-def.js +1 -1
  157. package/dist/sdk/segment/types/segment-schema.js +1 -1
  158. package/dist/sdk/segment/validate-files.js +1 -1
  159. package/dist/sdk/segment/yaml-validator.js +1 -1
  160. package/dist/sdk/segment.js +1 -1
  161. package/dist/sdk/types/index.js +1 -1
  162. package/dist/sdk/types/progress.js +1 -1
  163. package/dist/sdk/user.js +1 -1
  164. package/dist/sdk/util/format-detector.js +1 -1
  165. package/dist/sdk/util/formatters.js +1 -1
  166. package/dist/sdk/util/index.js +1 -1
  167. package/dist/sdk/util/paginate.js +1 -1
  168. package/dist/sdk/util/tree-formatter.js +1 -1
  169. package/dist/sdk/workflow/archive-validation.js +1 -1
  170. package/dist/sdk/workflow/clone-workflow.js +1 -1
  171. package/dist/sdk/workflow/index.js +1 -1
  172. package/dist/sdk/workflow/pull-workflow.js +1 -1
  173. package/dist/sdk/workflow/push-workflow.js +1 -1
  174. package/dist/sdk/workflow/tdx-config.js +1 -1
  175. package/dist/sdk/workflow/workflow-utils.js +1 -1
  176. package/dist/test-utils/command-runner.js +1 -1
  177. package/dist/test-utils/factories.js +1 -1
  178. package/dist/test-utils/fixtures.js +1 -1
  179. package/dist/test-utils/http-mock.js +1 -1
  180. package/dist/test-utils/index.js +1 -1
  181. package/dist/utils/async.js +1 -1
  182. package/dist/utils/colors.js +1 -1
  183. package/dist/utils/diff.js +1 -1
  184. package/dist/utils/file-permissions.js +1 -1
  185. package/dist/utils/file-reader.js +1 -1
  186. package/dist/utils/github-releases.js +1 -1
  187. package/dist/utils/global-cache.js +1 -1
  188. package/dist/utils/json-loader.js +1 -1
  189. package/dist/utils/local-cache.js +1 -1
  190. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  191. package/dist/utils/logger/formatters/index.js +1 -1
  192. package/dist/utils/logger/handlers/console-handler.js +1 -1
  193. package/dist/utils/logger/handlers/file-handler.js +1 -1
  194. package/dist/utils/logger/handlers/index.js +1 -1
  195. package/dist/utils/logger/handlers/null-handler.js +1 -1
  196. package/dist/utils/logger/index.js +1 -1
  197. package/dist/utils/logger/logger.js +1 -1
  198. package/dist/utils/logger/types.js +1 -1
  199. package/dist/utils/option-validation.js +1 -1
  200. package/dist/utils/process.js +1 -1
  201. package/dist/utils/prompt.js +1 -1
  202. package/dist/utils/spinner.js +1 -1
  203. package/dist/utils/sse-parser.js +1 -1
  204. package/dist/utils/string-utils.js +1 -1
  205. package/dist/utils/table-ref-parser.js +1 -1
  206. package/dist/utils/tdx-logger.js +1 -1
  207. package/dist/utils/version-check.js +1 -1
  208. package/package.json +1 -1
@@ -1 +1 @@
1
- const a34_0x4e6734=a34_0x367e;(function(_0x3f1906,_0x4843f3){const _0x18b0bc=a34_0x367e,_0x5ec300=_0x3f1906();while(!![]){try{const _0x28cb7e=-parseInt(_0x18b0bc(0xfa))/0x1*(-parseInt(_0x18b0bc(0x151))/0x2)+parseInt(_0x18b0bc(0x109))/0x3+parseInt(_0x18b0bc(0x104))/0x4+-parseInt(_0x18b0bc(0x14c))/0x5*(parseInt(_0x18b0bc(0x137))/0x6)+parseInt(_0x18b0bc(0x112))/0x7*(-parseInt(_0x18b0bc(0x12c))/0x8)+parseInt(_0x18b0bc(0x16a))/0x9+parseInt(_0x18b0bc(0x138))/0xa*(-parseInt(_0x18b0bc(0x14f))/0xb);if(_0x28cb7e===_0x4843f3)break;else _0x5ec300['push'](_0x5ec300['shift']());}catch(_0x431177){_0x5ec300['push'](_0x5ec300['shift']());}}}(a34_0x4646,0xab023));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a34_0x4646(){const _0x55e162=['substring','6919Lucynf','database','1765070qrxOEt','πŸ“…\x20','type','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','toLocaleDateString','\x20\x20Database:\x20','Found\x20','trim','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','end_at','error','run','\x20created','limit','lastRun','\x20(showing\x20','Searching\x20scheduled\x20queries\x20matching\x20\x22','never','options','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','abs','priority','(unnamed)','h\x20ago','Delete\x20a\x20scheduled\x20query','6440391cGJxrB','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','last_job','format','schedule:update','getTime','history','queries','execute','/app/queries/editor?queryId=','ended_at','pagination','retry_limit','user','INVALID_ARGUMENT','query','Create\x20a\x20scheduled\x20query','update','statusIcon','schedule:show','\x20job','nextRun','name','Deleting\x20schedule...','\x20\x20Time:\x20','ies','timezone','Running\x20schedule:\x20','utf-8','list','listQueries','count','schedule:create','file','Run\x20a\x20scheduled\x20query\x20immediately','log','Update\x20a\x20scheduled\x20query','1QYZTnM','site','engineVersion','args','result','keys','delete','from','Schedule\x20run\x20submitted:\x20','Schedule\x20updated:\x20','4433404OjyIoX','status','round','green','map','3810735qIImcY','job_id','scheduled_at','verbose','Showing\x20first\x20','delay','show','json','\x20\x20Cron:\x20','201222GebPZc','Show\x20schedule\x20details','...','yes','Creating\x20schedule...','join','Show\x20schedule\x20execution\x20history','num','Running\x20schedule...','queryUrl','Updating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Failed\x20to\x20read\x20file:\x20','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','tsv','d\x20ago','table','List\x20scheduled\x20queries','cron','schedule:delete','m\x20ago','next_run_at','just\x20now','retryLimit','Cancelled','\x20schedules','352qrjUht','schedules','Schedule\x20deleted:\x20','padEnd','cyan','success','entries','executing_user_id','\x20scheduled\x20quer','created_at','length','6FSZeWc','18310HyVDLP','\x20matching\x20\x22','in\x20','Updating\x20schedule:\x20','user_name','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','create','schedule:list','Creating\x20schedule:\x20','max','description','schedule:run','\x20\x20Timezone:\x20','red','validate','data','jsonl','No\x20scheduled\x20queries\x20found','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','time_zone','4298780WFTazW','\x20\x20β†’\x20'];a34_0x4646=function(){return _0x55e162;};return a34_0x4646();}import{hyperlink}from'../sdk/util/formatters.js';import a34_0x37eced from'chalk';function formatRelativeTime(_0x392da1){const _0x8a3e29=a34_0x367e,_0x57a6bb=new Date(_0x392da1),_0x1b23fe=new Date(),_0x5a1148=_0x57a6bb['getTime']()-_0x1b23fe[_0x8a3e29(0x16f)](),_0x3c3967=Math[_0x8a3e29(0x165)](_0x5a1148)/0x3e8,_0x215a6a=_0x5a1148<0x0;if(_0x3c3967<0x3c)return _0x215a6a?_0x8a3e29(0x128):'soon';else{if(_0x3c3967<0xe10){const _0x5c8d5e=Math[_0x8a3e29(0x106)](_0x3c3967/0x3c);return _0x215a6a?_0x5c8d5e+_0x8a3e29(0x126):'in\x20'+_0x5c8d5e+'m';}else{if(_0x3c3967<0x15180){const _0x45243a=Math[_0x8a3e29(0x106)](_0x3c3967/0xe10);return _0x215a6a?_0x45243a+_0x8a3e29(0x168):_0x8a3e29(0x13a)+_0x45243a+'h';}else{if(_0x3c3967<0x93a80){const _0xfcb303=Math[_0x8a3e29(0x106)](_0x3c3967/0x15180);return _0x215a6a?_0xfcb303+_0x8a3e29(0x121):_0x8a3e29(0x13a)+_0xfcb303+'d';}else return _0x57a6bb[_0x8a3e29(0x155)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x13f);['description']=a34_0x4e6734(0x123);async[a34_0x4e6734(0x172)](_0x12647e){const _0x5a886c=a34_0x4e6734,{options:_0x157b30,args:_0x43882e,tdx:_0x6f656a}=_0x12647e,_0x3b2074=resolveLimit(_0x157b30[_0x5a886c(0x15e)],DEFAULT_DISPLAY_LIMIT),_0x273a12=_0x43882e[0x0],_0xc6909f=_0x273a12?_0x5a886c(0x161)+_0x273a12+'\x22...':'Listing\x20scheduled\x20queries...',_0x5b854d=await withSpinner(_0xc6909f,()=>_0x6f656a[_0x5a886c(0x12d)][_0x5a886c(0xf3)]({'limit':_0x3b2074,'scheduled':!![],'pattern':_0x273a12}),{'verbose':_0x157b30[_0x5a886c(0x10c)]}),_0x5753ff=_0x5b854d[_0x5a886c(0x147)][_0x5a886c(0x171)],_0x10d343=_0x5b854d['data'][_0x5a886c(0x175)]['has_next_page'],_0x215158=_0x273a12?_0x5a886c(0x139)+_0x273a12+'\x22':'';_0x10d343?console['error'](_0x5a886c(0x10d)+_0x5753ff[_0x5a886c(0x136)]+_0x5a886c(0x12b)+_0x215158+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x5a886c(0x15b)](_0x5a886c(0x157)+_0x5753ff['length']+_0x5a886c(0x134)+(_0x5753ff[_0x5a886c(0x136)]!==0x1?_0x5a886c(0xee):'y')+_0x215158);if(_0x157b30[_0x5a886c(0x16d)]===_0x5a886c(0x110)||_0x157b30['format']===_0x5a886c(0x148)||_0x157b30['format']===_0x5a886c(0x122)||_0x157b30['format']===_0x5a886c(0x120)){const _0x347912=_0x5753ff['map'](_0x32eb59=>({'id':_0x32eb59['id'],'name':_0x32eb59[_0x5a886c(0xeb)],'cron':_0x32eb59['cron'],'database':_0x32eb59['database']?.[_0x5a886c(0xeb)],'type':_0x32eb59[_0x5a886c(0x153)],'timezone':_0x32eb59[_0x5a886c(0x14b)],'user_name':_0x32eb59[_0x5a886c(0x177)]?.[_0x5a886c(0xeb)],'updated_at':_0x32eb59['updated_at'],'next_run_at':_0x32eb59[_0x5a886c(0x127)],'last_job_status':_0x32eb59[_0x5a886c(0x16c)]?.[_0x5a886c(0x105)]}));await handleSDKOutput(_0x347912,_0x157b30);}else{if(_0x5753ff['length']===0x0)console[_0x5a886c(0xf8)](_0x5a886c(0x149));else{const _0x2d06c7=_0x157b30[_0x5a886c(0xfb)],_0x440053=_0x5753ff['map'](_0x2045db=>{const _0x28506a=_0x5a886c,_0x5d8c4b=_0x2045db['last_job']?.[_0x28506a(0x105)]?_0x2045db['last_job'][_0x28506a(0x105)]===_0x28506a(0x131)?'βœ“':'βœ—':'-',_0x51fcb0=_0x2045db[_0x28506a(0x16c)]?.[_0x28506a(0x174)]?formatRelativeTime(_0x2045db[_0x28506a(0x16c)][_0x28506a(0x174)]):_0x28506a(0x162),_0x1caf19=_0x2045db[_0x28506a(0x127)]?formatRelativeTime(_0x2045db[_0x28506a(0x127)]):'-',_0x4b7764=_0x2045db[_0x28506a(0x124)]||'',_0x15aa74=_0x2045db[_0x28506a(0xeb)]||_0x28506a(0x167),_0x142191=getConsoleUrl(_0x2d06c7,_0x28506a(0x173)+_0x2045db['id']);return{'statusIcon':_0x5d8c4b,'lastRun':_0x51fcb0,'nextRun':_0x1caf19,'cron':_0x4b7764,'name':_0x15aa74,'queryUrl':_0x142191,'status':_0x2045db[_0x28506a(0x16c)]?.[_0x28506a(0x105)]};}),_0x3fe37d=Math[_0x5a886c(0x141)](..._0x440053['map'](_0x46c5ad=>_0x46c5ad['lastRun'][_0x5a886c(0x136)])),_0x27029e=Math[_0x5a886c(0x141)](..._0x440053[_0x5a886c(0x108)](_0x1f9701=>_0x1f9701[_0x5a886c(0xea)][_0x5a886c(0x136)])),_0x2a32dc=Math[_0x5a886c(0x141)](..._0x440053[_0x5a886c(0x108)](_0x57dcd1=>_0x57dcd1[_0x5a886c(0x124)][_0x5a886c(0x136)])),_0x422d55=_0x440053['map'](_0x7bd534=>{const _0x118461=_0x5a886c,_0x49f17b=_0x7bd534[_0x118461(0x105)]==='success'?a34_0x37eced[_0x118461(0x107)](_0x7bd534[_0x118461(0x17c)]):_0x7bd534[_0x118461(0x105)]==='error'?a34_0x37eced[_0x118461(0x145)](_0x7bd534['statusIcon']):a34_0x37eced['dim'](_0x7bd534[_0x118461(0x17c)]),_0x3bc897=_0x7bd534[_0x118461(0x15f)][_0x118461(0x12f)](_0x3fe37d),_0x422603=_0x7bd534[_0x118461(0xea)]['padEnd'](_0x27029e),_0xce7e5d=_0x7bd534[_0x118461(0x124)]?a34_0x37eced[_0x118461(0x130)](_0x7bd534[_0x118461(0x124)][_0x118461(0x12f)](_0x2a32dc)):'\x20'['repeat'](_0x2a32dc),_0x5d7d6a=hyperlink(_0x7bd534[_0x118461(0xeb)],_0x7bd534[_0x118461(0x11b)]);return _0x118461(0x152)+_0x49f17b+'\x20'+_0x3bc897+_0x118461(0x14d)+_0x422603+'\x20\x20'+_0xce7e5d+'\x20\x20'+_0x5d7d6a;});await writeOutput(_0x422d55[_0x5a886c(0x117)]('\x0a'),_0x157b30['output'],_0x5a886c(0xf2));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x17d);[a34_0x4e6734(0x142)]=a34_0x4e6734(0x113);[a34_0x4e6734(0x146)](_0x4d8f1b){const _0x44446d=a34_0x4e6734,_0x4b0996=_0x4d8f1b[_0x44446d(0xfd)][0x0];if(!_0x4b0996)return _0x44446d(0x154);return undefined;}async[a34_0x4e6734(0x172)](_0x113c25){const _0x4d9347=a34_0x4e6734,{options:_0x368a0b,args:_0x236511,tdx:_0x25c274}=_0x113c25,_0x45a08c=_0x236511[0x0],_0x37d3ca=await withSpinner('Getting\x20schedule\x20details...',()=>_0x25c274[_0x4d9347(0x12d)][_0x4d9347(0x10f)](_0x45a08c),{'verbose':_0x368a0b[_0x4d9347(0x10c)]}),_0x5b6b3e=_0x37d3ca[_0x4d9347(0x147)],_0x3436e5={'name':_0x5b6b3e[_0x4d9347(0xeb)],'cron':_0x5b6b3e[_0x4d9347(0x124)],'database':_0x5b6b3e[_0x4d9347(0x150)],'type':_0x5b6b3e[_0x4d9347(0x153)],'timezone':_0x5b6b3e[_0x4d9347(0xef)],'user_name':_0x5b6b3e[_0x4d9347(0x13c)],'created_at':_0x5b6b3e[_0x4d9347(0x135)],'engine_version':_0x5b6b3e['engine_version'],'executing_user_id':_0x5b6b3e[_0x4d9347(0x133)],'query':_0x5b6b3e[_0x4d9347(0x179)],'delay':_0x5b6b3e[_0x4d9347(0x10e)],'priority':_0x5b6b3e[_0x4d9347(0x166)],'retry_limit':_0x5b6b3e[_0x4d9347(0x176)],..._0x5b6b3e['result']&&{'result':_0x5b6b3e[_0x4d9347(0xfe)]}};return await handleSingleObjectOutput(_0x3436e5,_0x368a0b),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0xf5);[a34_0x4e6734(0x142)]=a34_0x4e6734(0x17a);[a34_0x4e6734(0x146)](_0x1ac68d){const _0x3c7943=a34_0x4e6734,_0x1fcfc9=_0x1ac68d[_0x3c7943(0xfd)][0x0];if(!_0x1fcfc9)return _0x3c7943(0x16b);const _0x1a8740=_0x1ac68d[_0x3c7943(0x163)];if(!_0x1a8740[_0x3c7943(0x150)])return _0x3c7943(0x159);return undefined;}async[a34_0x4e6734(0x172)](_0x1258a1){const _0x2fc478=a34_0x4e6734,{options:_0x31017d,args:_0x224f40,tdx:_0xd17c54}=_0x1258a1,_0x3e2a22=_0x224f40[0x0],_0x26ef23=_0x31017d,_0x307155=_0x26ef23[_0x2fc478(0x150)],_0x12eac1=_0x26ef23['file'],_0x55c6da=_0x26ef23[_0x2fc478(0x153)]||'trino';let _0x33d45b;try{_0x33d45b=readFileSync(_0x12eac1,_0x2fc478(0xf1))['trim']();}catch(_0x10b890){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2fc478(0x11e)+_0x12eac1,_0x10b890 instanceof Error?_0x10b890:undefined);}if(!_0x33d45b)throw new SDKError(ErrorCode[_0x2fc478(0x178)],'Query\x20file\x20is\x20empty');const _0x401ccc={'database':_0x307155,'query':_0x33d45b,'type':_0x55c6da};if(_0x26ef23['cron'])_0x401ccc['cron']=_0x26ef23[_0x2fc478(0x124)];if(_0x26ef23[_0x2fc478(0xef)])_0x401ccc[_0x2fc478(0xef)]=_0x26ef23['timezone'];if(_0x26ef23[_0x2fc478(0x10e)]!==undefined)_0x401ccc[_0x2fc478(0x10e)]=Number(_0x26ef23['delay']);if(_0x26ef23['priority']!==undefined)_0x401ccc[_0x2fc478(0x166)]=Number(_0x26ef23[_0x2fc478(0x166)]);if(_0x26ef23['retryLimit']!==undefined)_0x401ccc['retry_limit']=Number(_0x26ef23[_0x2fc478(0x129)]);if(_0x26ef23[_0x2fc478(0xfc)])_0x401ccc['engine_version']=_0x26ef23[_0x2fc478(0xfc)];if(_0x26ef23[_0x2fc478(0xfe)])_0x401ccc[_0x2fc478(0xfe)]=_0x26ef23[_0x2fc478(0xfe)];if(_0x31017d['verbose']){console['error'](_0x2fc478(0x140)+_0x3e2a22),console[_0x2fc478(0x15b)](_0x2fc478(0x156)+_0x307155),console[_0x2fc478(0x15b)]('\x20\x20Type:\x20'+_0x55c6da);if(_0x401ccc[_0x2fc478(0x124)])console['error'](_0x2fc478(0x111)+_0x401ccc[_0x2fc478(0x124)]);if(_0x401ccc['timezone'])console['error'](_0x2fc478(0x144)+_0x401ccc[_0x2fc478(0xef)]);}const _0x54ede1=await withSpinner(_0x2fc478(0x116),()=>_0xd17c54[_0x2fc478(0x12d)][_0x2fc478(0x13e)](_0x3e2a22,_0x401ccc),{'verbose':_0x31017d[_0x2fc478(0x10c)]});return console['error']('Schedule\x20created:\x20'+_0x54ede1['data'][_0x2fc478(0xeb)]),await handleSingleObjectOutput(_0x54ede1[_0x2fc478(0x147)],_0x31017d),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x16e);[a34_0x4e6734(0x142)]=a34_0x4e6734(0xf9);[a34_0x4e6734(0x146)](_0x51eb62){const _0x21a7e8=a34_0x4e6734,_0x5c5c08=_0x51eb62[_0x21a7e8(0xfd)][0x0];if(!_0x5c5c08)return _0x21a7e8(0x11d);return undefined;}async[a34_0x4e6734(0x172)](_0x12c6dd){const _0x347cb0=a34_0x4e6734,{options:_0x2c7651,args:_0x1a14d9,tdx:_0x307d2a}=_0x12c6dd,_0x52f77e=_0x1a14d9[0x0],_0xf3ddba=_0x2c7651,_0x26935d={};if(_0xf3ddba['database'])_0x26935d[_0x347cb0(0x150)]=_0xf3ddba[_0x347cb0(0x150)];if(_0xf3ddba['type'])_0x26935d[_0x347cb0(0x153)]=_0xf3ddba[_0x347cb0(0x153)];if(_0xf3ddba[_0x347cb0(0x124)])_0x26935d[_0x347cb0(0x124)]=_0xf3ddba[_0x347cb0(0x124)];if(_0xf3ddba[_0x347cb0(0xef)])_0x26935d[_0x347cb0(0xef)]=_0xf3ddba[_0x347cb0(0xef)];if(_0xf3ddba[_0x347cb0(0x10e)]!==undefined)_0x26935d[_0x347cb0(0x10e)]=Number(_0xf3ddba[_0x347cb0(0x10e)]);if(_0xf3ddba[_0x347cb0(0x166)]!==undefined)_0x26935d[_0x347cb0(0x166)]=Number(_0xf3ddba[_0x347cb0(0x166)]);if(_0xf3ddba[_0x347cb0(0x129)]!==undefined)_0x26935d[_0x347cb0(0x176)]=Number(_0xf3ddba[_0x347cb0(0x129)]);if(_0xf3ddba['engineVersion'])_0x26935d['engine_version']=_0xf3ddba['engineVersion'];if(_0xf3ddba['result'])_0x26935d[_0x347cb0(0xfe)]=_0xf3ddba[_0x347cb0(0xfe)];if(_0xf3ddba[_0x347cb0(0xf6)])try{_0x26935d[_0x347cb0(0x179)]=readFileSync(_0xf3ddba[_0x347cb0(0xf6)],_0x347cb0(0xf1))[_0x347cb0(0x158)]();}catch(_0x274fc1){throw new SDKError(ErrorCode[_0x347cb0(0x178)],'Failed\x20to\x20read\x20file:\x20'+_0xf3ddba[_0x347cb0(0xf6)],_0x274fc1 instanceof Error?_0x274fc1:undefined);}if(Object[_0x347cb0(0xff)](_0x26935d)['length']===0x0)throw new SDKError(ErrorCode[_0x347cb0(0x178)],_0x347cb0(0x11f));if(_0x2c7651[_0x347cb0(0x10c)]){console[_0x347cb0(0x15b)](_0x347cb0(0x13b)+_0x52f77e);for(const [_0x37eb0b,_0x46c7a4]of Object[_0x347cb0(0x132)](_0x26935d)){_0x37eb0b==='query'?console['error']('\x20\x20'+_0x37eb0b+':\x20'+_0x46c7a4[_0x347cb0(0x14e)](0x0,0x32)+_0x347cb0(0x114)):console[_0x347cb0(0x15b)]('\x20\x20'+_0x37eb0b+':\x20'+_0x46c7a4);}}const _0x19ece9=await withSpinner(_0x347cb0(0x11c),()=>_0x307d2a[_0x347cb0(0x12d)][_0x347cb0(0x17b)](_0x52f77e,_0x26935d),{'verbose':_0x2c7651['verbose']});return console[_0x347cb0(0x15b)](_0x347cb0(0x103)+_0x19ece9['data'][_0x347cb0(0xeb)]),await handleSingleObjectOutput(_0x19ece9['data'],_0x2c7651),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x125);[a34_0x4e6734(0x142)]=a34_0x4e6734(0x169);[a34_0x4e6734(0x146)](_0x28c8e4){const _0x218dd7=a34_0x4e6734,_0x4ddea9=_0x28c8e4[_0x218dd7(0xfd)][0x0];if(!_0x4ddea9)return _0x218dd7(0x14a);return undefined;}async[a34_0x4e6734(0x172)](_0x22a40b){const _0x2db397=a34_0x4e6734,{options:_0x511c49,args:_0x3826c8,tdx:_0x5aefd1}=_0x22a40b,_0x410709=_0x3826c8[0x0];if(!_0x511c49[_0x2db397(0x115)]){const _0x228fb4=await confirm(_0x2db397(0x13d)+_0x410709+'\x22?');if(!_0x228fb4)return console[_0x2db397(0x15b)](_0x2db397(0x12a)),0x0;}const _0x2433db=await withSpinner(_0x2db397(0xec),()=>_0x5aefd1[_0x2db397(0x12d)][_0x2db397(0x100)](_0x410709),{'verbose':_0x511c49[_0x2db397(0x10c)]});return console['error'](_0x2db397(0x12e)+_0x2433db[_0x2db397(0x147)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x4e6734(0xeb)]=a34_0x4e6734(0x143);[a34_0x4e6734(0x142)]=a34_0x4e6734(0xf7);['validate'](_0x503431){const _0x5c6858=a34_0x4e6734,_0x180e67=_0x503431[_0x5c6858(0xfd)][0x0];if(!_0x180e67)return _0x5c6858(0x164);return undefined;}async[a34_0x4e6734(0x172)](_0x35dbe6){const _0x55e986=a34_0x4e6734,{options:_0x2aab31,args:_0x49dbe3,tdx:_0x4975be}=_0x35dbe6,_0x9e57f3=_0x49dbe3[0x0],_0x201b75=_0x2aab31,_0x596d4b=_0x201b75['time'],_0x14c6b5=_0x201b75[_0x55e986(0x119)]!==undefined?Number(_0x201b75[_0x55e986(0x119)]):undefined;if(_0x2aab31['verbose']){console[_0x55e986(0x15b)](_0x55e986(0xf0)+_0x9e57f3);if(_0x596d4b)console[_0x55e986(0x15b)](_0x55e986(0xed)+_0x596d4b);if(_0x14c6b5)console[_0x55e986(0x15b)]('\x20\x20Num:\x20'+_0x14c6b5);}const _0x29f7bf=await withSpinner(_0x55e986(0x11a),()=>_0x4975be['schedules'][_0x55e986(0x15c)](_0x9e57f3,{'time':_0x596d4b,'num':_0x14c6b5}),{'verbose':_0x2aab31[_0x55e986(0x10c)]}),_0x5690f6=_0x29f7bf[_0x55e986(0x147)]['jobs'];console[_0x55e986(0x15b)](_0x55e986(0x102)+_0x5690f6[_0x55e986(0x136)]+_0x55e986(0x17e)+(_0x5690f6['length']!==0x1?'s':'')+_0x55e986(0x15d));for(const _0x3cdacc of _0x5690f6){console[_0x55e986(0x15b)]('\x20\x20Job\x20ID:\x20'+_0x3cdacc[_0x55e986(0x10a)]);}return await handleSDKOutput(_0x5690f6,_0x2aab31),0x0;}}function a34_0x367e(_0x1172fc,_0x11436c){_0x1172fc=_0x1172fc-0xea;const _0x4646e5=a34_0x4646();let _0x367e76=_0x4646e5[_0x1172fc];return _0x367e76;}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x4e6734(0xeb)]='schedule:history';[a34_0x4e6734(0x142)]=a34_0x4e6734(0x118);[a34_0x4e6734(0x146)](_0x271949){const _0xcb2978=a34_0x4e6734,_0x1c5a1e=_0x271949[_0xcb2978(0xfd)][0x0];if(!_0x1c5a1e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a34_0x4e6734(0x172)](_0x4ab10a){const _0x1f2474=a34_0x4e6734,{options:_0x3dd733,args:_0x54ccca,tdx:_0x1104cd}=_0x4ab10a,_0x596585=_0x54ccca[0x0],_0x15af05=_0x3dd733,_0x5b1ebf=_0x15af05[_0x1f2474(0x101)]!==undefined?Number(_0x15af05[_0x1f2474(0x101)]):undefined,_0x59ed1f=_0x15af05['to']!==undefined?Number(_0x15af05['to']):undefined,_0x2d68a5=await withSpinner('Getting\x20schedule\x20history...',()=>_0x1104cd[_0x1f2474(0x12d)][_0x1f2474(0x170)](_0x596585,{'from':_0x5b1ebf,'to':_0x59ed1f}),{'verbose':_0x3dd733[_0x1f2474(0x10c)]}),_0x5be4cd=_0x2d68a5[_0x1f2474(0x147)];console['error']('Found\x20'+_0x5be4cd[_0x1f2474(0xf4)]+'\x20execution'+(_0x5be4cd[_0x1f2474(0xf4)]!==0x1?'s':'')+_0x1f2474(0x160)+_0x5be4cd[_0x1f2474(0x101)]+'-'+_0x5be4cd['to']+')');const _0x7b7245=_0x5be4cd[_0x1f2474(0x170)][_0x1f2474(0x108)](_0x1192d4=>({'job_id':_0x1192d4[_0x1f2474(0x10a)],'type':_0x1192d4['type'],'status':_0x1192d4[_0x1f2474(0x105)],'scheduled_at':_0x1192d4[_0x1f2474(0x10b)],'created_at':_0x1192d4['created_at'],'start_at':_0x1192d4['start_at'],'end_at':_0x1192d4[_0x1f2474(0x15a)]}));return await handleSDKOutput(_0x7b7245,_0x3dd733),0x0;}}
1
+ const a34_0x6c1372=a34_0x279f;(function(_0x30ef09,_0x11c31d){const _0x544b99=a34_0x279f,_0xb0e79a=_0x30ef09();while(!![]){try{const _0x4a4882=parseInt(_0x544b99(0x16e))/0x1+parseInt(_0x544b99(0x178))/0x2*(parseInt(_0x544b99(0x19d))/0x3)+parseInt(_0x544b99(0x17d))/0x4+-parseInt(_0x544b99(0x152))/0x5+-parseInt(_0x544b99(0x1b8))/0x6+parseInt(_0x544b99(0x1c2))/0x7+parseInt(_0x544b99(0x176))/0x8;if(_0x4a4882===_0x11c31d)break;else _0xb0e79a['push'](_0xb0e79a['shift']());}catch(_0xf3088a){_0xb0e79a['push'](_0xb0e79a['shift']());}}}(a34_0x4073,0x8f2a5));import{BaseCommand}from'./command.js';function a34_0x4073(){const _0x2ed130=['type','387393xBeLBP','Failed\x20to\x20read\x20file:\x20','success','\x20\x20β†’\x20','\x20\x20Num:\x20','substring','description','\x20scheduled\x20quer','update','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','List\x20scheduled\x20queries','length','has_next_page','\x20execution','Getting\x20schedule\x20history...','Show\x20schedule\x20execution\x20history','last_job','\x20\x20Database:\x20','πŸ“…\x20','\x20\x20Job\x20ID:\x20','\x20(use\x20--limit\x20to\x20see\x20more)','schedule:delete','h\x20ago','map','Showing\x20first\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','create','1590606CfiZXY','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Cancelled','trim','listQueries','d\x20ago','just\x20now','utf-8','engine_version','end_at','773472QhSDBj','name','file','verbose','cyan','json','user','next_run_at','\x20created','padEnd','repeat','num','\x20(showing\x20','database','Create\x20a\x20scheduled\x20query','\x20job','in\x20','result','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','delete','validate','yes','lastRun','delay','schedules','output','No\x20scheduled\x20queries\x20found','history','Creating\x20schedule...','status','nextRun','\x20\x20Time:\x20','\x20schedules','3760065XGHzmt','INVALID_ARGUMENT','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','job_id','tsv','list','retry_limit','priority','...','query','execute','round','Schedule\x20created:\x20','engineVersion','data','updated_at','schedule:list','Running\x20schedule:\x20','Query\x20file\x20is\x20empty','keys','\x20\x20Type:\x20','m\x20ago','table','max','Schedule\x20updated:\x20','schedule:update','show','pagination','422501ShTAyK','Found\x20','args','from','error','ended_at','created_at','executing_user_id','4054632WJYlKK','green','6RVkVYY','queries','Creating\x20schedule:\x20','Getting\x20schedule\x20details...','limit','705200HIgotb','(unnamed)','queryUrl','\x20matching\x20\x22','start_at','jsonl','statusIcon','/app/queries/editor?queryId=','schedule:run','cron','Searching\x20scheduled\x20queries\x20matching\x20\x22','format','trino','Listing\x20scheduled\x20queries...','Schedule\x20deleted:\x20','time','Delete\x20a\x20scheduled\x20query','soon','abs','retryLimit','timezone','\x20\x20Timezone:\x20','log','\x22...','schedule:show','dim','entries','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','jobs','user_name','site'];a34_0x4073=function(){return _0x2ed130;};return a34_0x4073();}import{SDKError,ErrorCode}from'../sdk/index.js';function a34_0x279f(_0x4838bc,_0x3f1257){_0x4838bc=_0x4838bc-0x140;const _0x407355=a34_0x4073();let _0x279fb2=_0x407355[_0x4838bc];return _0x279fb2;}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x1319ec from'chalk';function formatRelativeTime(_0x33b5e3){const _0x595b2a=a34_0x279f,_0x2ca43a=new Date(_0x33b5e3),_0x18d77e=new Date(),_0x369828=_0x2ca43a['getTime']()-_0x18d77e['getTime'](),_0xf26040=Math[_0x595b2a(0x18f)](_0x369828)/0x3e8,_0x18ad89=_0x369828<0x0;if(_0xf26040<0x3c)return _0x18ad89?_0x595b2a(0x1be):_0x595b2a(0x18e);else{if(_0xf26040<0xe10){const _0x1cb535=Math['round'](_0xf26040/0x3c);return _0x18ad89?_0x1cb535+_0x595b2a(0x167):_0x595b2a(0x141)+_0x1cb535+'m';}else{if(_0xf26040<0x15180){const _0x50605b=Math[_0x595b2a(0x15d)](_0xf26040/0xe10);return _0x18ad89?_0x50605b+_0x595b2a(0x1b3):'in\x20'+_0x50605b+'h';}else{if(_0xf26040<0x93a80){const _0x2dd2ec=Math[_0x595b2a(0x15d)](_0xf26040/0x15180);return _0x18ad89?_0x2dd2ec+_0x595b2a(0x1bd):'in\x20'+_0x2dd2ec+'d';}else return _0x2ca43a['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x6c1372(0x1c3)]=a34_0x6c1372(0x162);['description']=a34_0x6c1372(0x1a7);async[a34_0x6c1372(0x15c)](_0x362200){const _0x55428f=a34_0x6c1372,{options:_0x966f19,args:_0x1dbb5a,tdx:_0x4cbb71}=_0x362200,_0x371de7=resolveLimit(_0x966f19[_0x55428f(0x17c)],DEFAULT_DISPLAY_LIMIT),_0x3ac93d=_0x1dbb5a[0x0],_0x10cb72=_0x3ac93d?_0x55428f(0x187)+_0x3ac93d+_0x55428f(0x194):_0x55428f(0x18a),_0x33b3fa=await withSpinner(_0x10cb72,()=>_0x4cbb71[_0x55428f(0x149)][_0x55428f(0x1bc)]({'limit':_0x371de7,'scheduled':!![],'pattern':_0x3ac93d}),{'verbose':_0x966f19['verbose']}),_0x24166e=_0x33b3fa[_0x55428f(0x160)][_0x55428f(0x179)],_0x397b2a=_0x33b3fa[_0x55428f(0x160)][_0x55428f(0x16d)][_0x55428f(0x1a9)],_0x71a76c=_0x3ac93d?_0x55428f(0x180)+_0x3ac93d+'\x22':'';_0x397b2a?console[_0x55428f(0x172)](_0x55428f(0x1b5)+_0x24166e['length']+_0x55428f(0x151)+_0x71a76c+_0x55428f(0x1b1)):console[_0x55428f(0x172)](_0x55428f(0x16f)+_0x24166e[_0x55428f(0x1a8)]+_0x55428f(0x1a4)+(_0x24166e[_0x55428f(0x1a8)]!==0x1?'ies':'y')+_0x71a76c);if(_0x966f19[_0x55428f(0x188)]===_0x55428f(0x1c7)||_0x966f19[_0x55428f(0x188)]===_0x55428f(0x182)||_0x966f19['format']===_0x55428f(0x168)||_0x966f19[_0x55428f(0x188)]===_0x55428f(0x156)){const _0x57bc9b=_0x24166e['map'](_0x1a4a17=>({'id':_0x1a4a17['id'],'name':_0x1a4a17[_0x55428f(0x1c3)],'cron':_0x1a4a17['cron'],'database':_0x1a4a17['database']?.[_0x55428f(0x1c3)],'type':_0x1a4a17['type'],'timezone':_0x1a4a17['time_zone'],'user_name':_0x1a4a17[_0x55428f(0x1c8)]?.[_0x55428f(0x1c3)],'updated_at':_0x1a4a17[_0x55428f(0x161)],'next_run_at':_0x1a4a17[_0x55428f(0x1c9)],'last_job_status':_0x1a4a17[_0x55428f(0x1ad)]?.[_0x55428f(0x14e)]}));await handleSDKOutput(_0x57bc9b,_0x966f19);}else{if(_0x24166e[_0x55428f(0x1a8)]===0x0)console[_0x55428f(0x193)](_0x55428f(0x14b));else{const _0x104e98=_0x966f19[_0x55428f(0x19b)],_0xa814f=_0x24166e[_0x55428f(0x1b4)](_0x4d214e=>{const _0x346480=_0x55428f,_0x273291=_0x4d214e[_0x346480(0x1ad)]?.[_0x346480(0x14e)]?_0x4d214e[_0x346480(0x1ad)][_0x346480(0x14e)]===_0x346480(0x19f)?'βœ“':'βœ—':'-',_0x3f1a9a=_0x4d214e['last_job']?.['ended_at']?formatRelativeTime(_0x4d214e[_0x346480(0x1ad)][_0x346480(0x173)]):'never',_0x2ae5f9=_0x4d214e[_0x346480(0x1c9)]?formatRelativeTime(_0x4d214e[_0x346480(0x1c9)]):'-',_0x42ea36=_0x4d214e[_0x346480(0x186)]||'',_0x5d9b78=_0x4d214e[_0x346480(0x1c3)]||_0x346480(0x17e),_0x17f8e2=getConsoleUrl(_0x104e98,_0x346480(0x184)+_0x4d214e['id']);return{'statusIcon':_0x273291,'lastRun':_0x3f1a9a,'nextRun':_0x2ae5f9,'cron':_0x42ea36,'name':_0x5d9b78,'queryUrl':_0x17f8e2,'status':_0x4d214e['last_job']?.['status']};}),_0x28bff9=Math[_0x55428f(0x169)](..._0xa814f['map'](_0x5dc20b=>_0x5dc20b[_0x55428f(0x147)]['length'])),_0x45788a=Math[_0x55428f(0x169)](..._0xa814f[_0x55428f(0x1b4)](_0x5e7eef=>_0x5e7eef[_0x55428f(0x14f)]['length'])),_0x3f467d=Math['max'](..._0xa814f[_0x55428f(0x1b4)](_0x516ef8=>_0x516ef8['cron'][_0x55428f(0x1a8)])),_0x4e5bd7=_0xa814f[_0x55428f(0x1b4)](_0x405b21=>{const _0x2583b8=_0x55428f,_0x9737c0=_0x405b21[_0x2583b8(0x14e)]===_0x2583b8(0x19f)?a34_0x1319ec[_0x2583b8(0x177)](_0x405b21['statusIcon']):_0x405b21[_0x2583b8(0x14e)]===_0x2583b8(0x172)?a34_0x1319ec['red'](_0x405b21['statusIcon']):a34_0x1319ec[_0x2583b8(0x196)](_0x405b21[_0x2583b8(0x183)]),_0x4ec36d=_0x405b21[_0x2583b8(0x147)]['padEnd'](_0x28bff9),_0x1dde38=_0x405b21[_0x2583b8(0x14f)]['padEnd'](_0x45788a),_0x294378=_0x405b21[_0x2583b8(0x186)]?a34_0x1319ec[_0x2583b8(0x1c6)](_0x405b21[_0x2583b8(0x186)][_0x2583b8(0x1cb)](_0x3f467d)):'\x20'[_0x2583b8(0x1cc)](_0x3f467d),_0x3b5e75=hyperlink(_0x405b21[_0x2583b8(0x1c3)],_0x405b21[_0x2583b8(0x17f)]);return _0x2583b8(0x1af)+_0x9737c0+'\x20'+_0x4ec36d+_0x2583b8(0x1a0)+_0x1dde38+'\x20\x20'+_0x294378+'\x20\x20'+_0x3b5e75;});await writeOutput(_0x4e5bd7['join']('\x0a'),_0x966f19[_0x55428f(0x14a)],_0x55428f(0x157));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x6c1372(0x1c3)]=a34_0x6c1372(0x195);[a34_0x6c1372(0x1a3)]='Show\x20schedule\x20details';[a34_0x6c1372(0x145)](_0x4655c8){const _0x103e09=a34_0x6c1372,_0x19bc45=_0x4655c8[_0x103e09(0x170)][0x0];if(!_0x19bc45)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a34_0x6c1372(0x15c)](_0x546000){const _0x28f95a=a34_0x6c1372,{options:_0x21edf7,args:_0x531ed2,tdx:_0x4ca9cf}=_0x546000,_0x286783=_0x531ed2[0x0],_0x3504a5=await withSpinner(_0x28f95a(0x17b),()=>_0x4ca9cf[_0x28f95a(0x149)][_0x28f95a(0x16c)](_0x286783),{'verbose':_0x21edf7[_0x28f95a(0x1c5)]}),_0x209549=_0x3504a5[_0x28f95a(0x160)],_0xc4ac2a={'name':_0x209549[_0x28f95a(0x1c3)],'cron':_0x209549[_0x28f95a(0x186)],'database':_0x209549[_0x28f95a(0x1cf)],'type':_0x209549[_0x28f95a(0x19c)],'timezone':_0x209549[_0x28f95a(0x191)],'user_name':_0x209549[_0x28f95a(0x19a)],'created_at':_0x209549[_0x28f95a(0x174)],'engine_version':_0x209549['engine_version'],'executing_user_id':_0x209549[_0x28f95a(0x175)],'query':_0x209549['query'],'delay':_0x209549[_0x28f95a(0x148)],'priority':_0x209549[_0x28f95a(0x159)],'retry_limit':_0x209549[_0x28f95a(0x158)],..._0x209549[_0x28f95a(0x142)]&&{'result':_0x209549[_0x28f95a(0x142)]}};return await handleSingleObjectOutput(_0xc4ac2a,_0x21edf7),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x6c1372(0x1c3)]='schedule:create';[a34_0x6c1372(0x1a3)]=a34_0x6c1372(0x1d0);[a34_0x6c1372(0x145)](_0x2c980e){const _0xf9295a=a34_0x6c1372,_0x38a777=_0x2c980e['args'][0x0];if(!_0x38a777)return _0xf9295a(0x154);const _0x4aabf1=_0x2c980e['options'];if(!_0x4aabf1[_0xf9295a(0x1cf)])return _0xf9295a(0x143);return undefined;}async['execute'](_0x308b96){const _0x34ff75=a34_0x6c1372,{options:_0x8324d,args:_0x1129dc,tdx:_0x5566c8}=_0x308b96,_0xfd0064=_0x1129dc[0x0],_0x4cac79=_0x8324d,_0xc57b9b=_0x4cac79['database'],_0x665807=_0x4cac79[_0x34ff75(0x1c4)],_0x221cf5=_0x4cac79[_0x34ff75(0x19c)]||_0x34ff75(0x189);let _0x4bbb43;try{_0x4bbb43=readFileSync(_0x665807,_0x34ff75(0x1bf))[_0x34ff75(0x1bb)]();}catch(_0x17e1cd){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20read\x20file:\x20'+_0x665807,_0x17e1cd instanceof Error?_0x17e1cd:undefined);}if(!_0x4bbb43)throw new SDKError(ErrorCode[_0x34ff75(0x153)],_0x34ff75(0x164));const _0x4488e8={'database':_0xc57b9b,'query':_0x4bbb43,'type':_0x221cf5};if(_0x4cac79[_0x34ff75(0x186)])_0x4488e8[_0x34ff75(0x186)]=_0x4cac79[_0x34ff75(0x186)];if(_0x4cac79[_0x34ff75(0x191)])_0x4488e8[_0x34ff75(0x191)]=_0x4cac79[_0x34ff75(0x191)];if(_0x4cac79[_0x34ff75(0x148)]!==undefined)_0x4488e8['delay']=Number(_0x4cac79[_0x34ff75(0x148)]);if(_0x4cac79[_0x34ff75(0x159)]!==undefined)_0x4488e8[_0x34ff75(0x159)]=Number(_0x4cac79[_0x34ff75(0x159)]);if(_0x4cac79['retryLimit']!==undefined)_0x4488e8[_0x34ff75(0x158)]=Number(_0x4cac79[_0x34ff75(0x190)]);if(_0x4cac79['engineVersion'])_0x4488e8[_0x34ff75(0x1c0)]=_0x4cac79[_0x34ff75(0x15f)];if(_0x4cac79[_0x34ff75(0x142)])_0x4488e8['result']=_0x4cac79[_0x34ff75(0x142)];if(_0x8324d[_0x34ff75(0x1c5)]){console[_0x34ff75(0x172)](_0x34ff75(0x17a)+_0xfd0064),console['error'](_0x34ff75(0x1ae)+_0xc57b9b),console[_0x34ff75(0x172)](_0x34ff75(0x166)+_0x221cf5);if(_0x4488e8[_0x34ff75(0x186)])console[_0x34ff75(0x172)]('\x20\x20Cron:\x20'+_0x4488e8['cron']);if(_0x4488e8[_0x34ff75(0x191)])console['error'](_0x34ff75(0x192)+_0x4488e8['timezone']);}const _0x183cea=await withSpinner(_0x34ff75(0x14d),()=>_0x5566c8[_0x34ff75(0x149)][_0x34ff75(0x1b7)](_0xfd0064,_0x4488e8),{'verbose':_0x8324d[_0x34ff75(0x1c5)]});return console['error'](_0x34ff75(0x15e)+_0x183cea[_0x34ff75(0x160)]['name']),await handleSingleObjectOutput(_0x183cea['data'],_0x8324d),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x6c1372(0x1c3)]=a34_0x6c1372(0x16b);[a34_0x6c1372(0x1a3)]='Update\x20a\x20scheduled\x20query';['validate'](_0x292046){const _0x469336=a34_0x6c1372,_0x1a0f8b=_0x292046[_0x469336(0x170)][0x0];if(!_0x1a0f8b)return _0x469336(0x1a6);return undefined;}async[a34_0x6c1372(0x15c)](_0x59b472){const _0xcab50c=a34_0x6c1372,{options:_0x26351d,args:_0x2797f1,tdx:_0xf65539}=_0x59b472,_0x131e25=_0x2797f1[0x0],_0x3e2bbd=_0x26351d,_0x462621={};if(_0x3e2bbd[_0xcab50c(0x1cf)])_0x462621[_0xcab50c(0x1cf)]=_0x3e2bbd[_0xcab50c(0x1cf)];if(_0x3e2bbd[_0xcab50c(0x19c)])_0x462621[_0xcab50c(0x19c)]=_0x3e2bbd[_0xcab50c(0x19c)];if(_0x3e2bbd['cron'])_0x462621[_0xcab50c(0x186)]=_0x3e2bbd[_0xcab50c(0x186)];if(_0x3e2bbd[_0xcab50c(0x191)])_0x462621[_0xcab50c(0x191)]=_0x3e2bbd[_0xcab50c(0x191)];if(_0x3e2bbd[_0xcab50c(0x148)]!==undefined)_0x462621[_0xcab50c(0x148)]=Number(_0x3e2bbd[_0xcab50c(0x148)]);if(_0x3e2bbd[_0xcab50c(0x159)]!==undefined)_0x462621['priority']=Number(_0x3e2bbd[_0xcab50c(0x159)]);if(_0x3e2bbd[_0xcab50c(0x190)]!==undefined)_0x462621[_0xcab50c(0x158)]=Number(_0x3e2bbd[_0xcab50c(0x190)]);if(_0x3e2bbd[_0xcab50c(0x15f)])_0x462621['engine_version']=_0x3e2bbd[_0xcab50c(0x15f)];if(_0x3e2bbd['result'])_0x462621[_0xcab50c(0x142)]=_0x3e2bbd[_0xcab50c(0x142)];if(_0x3e2bbd[_0xcab50c(0x1c4)])try{_0x462621[_0xcab50c(0x15b)]=readFileSync(_0x3e2bbd[_0xcab50c(0x1c4)],_0xcab50c(0x1bf))[_0xcab50c(0x1bb)]();}catch(_0x59d395){throw new SDKError(ErrorCode[_0xcab50c(0x153)],_0xcab50c(0x19e)+_0x3e2bbd['file'],_0x59d395 instanceof Error?_0x59d395:undefined);}if(Object[_0xcab50c(0x165)](_0x462621)[_0xcab50c(0x1a8)]===0x0)throw new SDKError(ErrorCode[_0xcab50c(0x153)],_0xcab50c(0x1b9));if(_0x26351d['verbose']){console[_0xcab50c(0x172)]('Updating\x20schedule:\x20'+_0x131e25);for(const [_0xef65c6,_0x3225f0]of Object[_0xcab50c(0x197)](_0x462621)){_0xef65c6===_0xcab50c(0x15b)?console[_0xcab50c(0x172)]('\x20\x20'+_0xef65c6+':\x20'+_0x3225f0[_0xcab50c(0x1a2)](0x0,0x32)+_0xcab50c(0x15a)):console[_0xcab50c(0x172)]('\x20\x20'+_0xef65c6+':\x20'+_0x3225f0);}}const _0x430f0a=await withSpinner('Updating\x20schedule...',()=>_0xf65539[_0xcab50c(0x149)][_0xcab50c(0x1a5)](_0x131e25,_0x462621),{'verbose':_0x26351d[_0xcab50c(0x1c5)]});return console[_0xcab50c(0x172)](_0xcab50c(0x16a)+_0x430f0a[_0xcab50c(0x160)][_0xcab50c(0x1c3)]),await handleSingleObjectOutput(_0x430f0a[_0xcab50c(0x160)],_0x26351d),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x6c1372(0x1c3)]=a34_0x6c1372(0x1b2);['description']=a34_0x6c1372(0x18d);['validate'](_0x7ba909){const _0x368eea=_0x7ba909['args'][0x0];if(!_0x368eea)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x6c1372(0x15c)](_0x301f37){const _0x3b6cb2=a34_0x6c1372,{options:_0x2b0688,args:_0x46dfd7,tdx:_0x524e70}=_0x301f37,_0x2f3b09=_0x46dfd7[0x0];if(!_0x2b0688[_0x3b6cb2(0x146)]){const _0x31c94d=await confirm(_0x3b6cb2(0x198)+_0x2f3b09+'\x22?');if(!_0x31c94d)return console['error'](_0x3b6cb2(0x1ba)),0x0;}const _0xf824b7=await withSpinner('Deleting\x20schedule...',()=>_0x524e70['schedules'][_0x3b6cb2(0x144)](_0x2f3b09),{'verbose':_0x2b0688['verbose']});return console[_0x3b6cb2(0x172)](_0x3b6cb2(0x18b)+_0xf824b7[_0x3b6cb2(0x160)][_0x3b6cb2(0x1c3)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a34_0x6c1372(0x185);['description']='Run\x20a\x20scheduled\x20query\x20immediately';[a34_0x6c1372(0x145)](_0x1fee54){const _0x2e6534=a34_0x6c1372,_0x279332=_0x1fee54['args'][0x0];if(!_0x279332)return _0x2e6534(0x1b6);return undefined;}async[a34_0x6c1372(0x15c)](_0x22cb97){const _0xa8d08e=a34_0x6c1372,{options:_0x14b454,args:_0x5cd537,tdx:_0x24fec9}=_0x22cb97,_0x4d6314=_0x5cd537[0x0],_0x1fb1e0=_0x14b454,_0xeeb932=_0x1fb1e0[_0xa8d08e(0x18c)],_0x1963be=_0x1fb1e0[_0xa8d08e(0x1cd)]!==undefined?Number(_0x1fb1e0[_0xa8d08e(0x1cd)]):undefined;if(_0x14b454['verbose']){console[_0xa8d08e(0x172)](_0xa8d08e(0x163)+_0x4d6314);if(_0xeeb932)console[_0xa8d08e(0x172)](_0xa8d08e(0x150)+_0xeeb932);if(_0x1963be)console['error'](_0xa8d08e(0x1a1)+_0x1963be);}const _0x29e55b=await withSpinner('Running\x20schedule...',()=>_0x24fec9['schedules']['run'](_0x4d6314,{'time':_0xeeb932,'num':_0x1963be}),{'verbose':_0x14b454['verbose']}),_0x5b7d83=_0x29e55b[_0xa8d08e(0x160)][_0xa8d08e(0x199)];console[_0xa8d08e(0x172)]('Schedule\x20run\x20submitted:\x20'+_0x5b7d83[_0xa8d08e(0x1a8)]+_0xa8d08e(0x140)+(_0x5b7d83['length']!==0x1?'s':'')+_0xa8d08e(0x1ca));for(const _0x4947a2 of _0x5b7d83){console[_0xa8d08e(0x172)](_0xa8d08e(0x1b0)+_0x4947a2[_0xa8d08e(0x155)]);}return await handleSDKOutput(_0x5b7d83,_0x14b454),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x6c1372(0x1c3)]='schedule:history';[a34_0x6c1372(0x1a3)]=a34_0x6c1372(0x1ac);[a34_0x6c1372(0x145)](_0x1b4a80){const _0x4dc6af=a34_0x6c1372,_0x3b7e6a=_0x1b4a80[_0x4dc6af(0x170)][0x0];if(!_0x3b7e6a)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x17045f){const _0x55086e=a34_0x6c1372,{options:_0x12c0a8,args:_0x37e750,tdx:_0x13872d}=_0x17045f,_0x40439a=_0x37e750[0x0],_0xfca3cf=_0x12c0a8,_0x5b67dd=_0xfca3cf[_0x55086e(0x171)]!==undefined?Number(_0xfca3cf['from']):undefined,_0x285ec3=_0xfca3cf['to']!==undefined?Number(_0xfca3cf['to']):undefined,_0x312725=await withSpinner(_0x55086e(0x1ab),()=>_0x13872d[_0x55086e(0x149)][_0x55086e(0x14c)](_0x40439a,{'from':_0x5b67dd,'to':_0x285ec3}),{'verbose':_0x12c0a8[_0x55086e(0x1c5)]}),_0x436791=_0x312725[_0x55086e(0x160)];console[_0x55086e(0x172)](_0x55086e(0x16f)+_0x436791['count']+_0x55086e(0x1aa)+(_0x436791['count']!==0x1?'s':'')+_0x55086e(0x1ce)+_0x436791[_0x55086e(0x171)]+'-'+_0x436791['to']+')');const _0x482bc2=_0x436791[_0x55086e(0x14c)][_0x55086e(0x1b4)](_0xf1074b=>({'job_id':_0xf1074b['job_id'],'type':_0xf1074b[_0x55086e(0x19c)],'status':_0xf1074b[_0x55086e(0x14e)],'scheduled_at':_0xf1074b['scheduled_at'],'created_at':_0xf1074b[_0x55086e(0x174)],'start_at':_0xf1074b[_0x55086e(0x181)],'end_at':_0xf1074b[_0x55086e(0x1c1)]}));return await handleSDKOutput(_0x482bc2,_0x12c0a8),0x0;}}
@@ -1 +1 @@
1
- const a35_0x1bd46b=a35_0x25c5;(function(_0x50504c,_0x3eb548){const _0x5620f1=a35_0x25c5,_0x5ea8df=_0x50504c();while(!![]){try{const _0x466fff=-parseInt(_0x5620f1(0x196))/0x1*(-parseInt(_0x5620f1(0x18d))/0x2)+parseInt(_0x5620f1(0x19a))/0x3+parseInt(_0x5620f1(0x1c8))/0x4+-parseInt(_0x5620f1(0x15e))/0x5+-parseInt(_0x5620f1(0x166))/0x6*(-parseInt(_0x5620f1(0x1b3))/0x7)+-parseInt(_0x5620f1(0x177))/0x8+-parseInt(_0x5620f1(0x15c))/0x9;if(_0x466fff===_0x3eb548)break;else _0x5ea8df['push'](_0x5ea8df['shift']());}catch(_0x581c4f){_0x5ea8df['push'](_0x5ea8df['shift']());}}}(a35_0x3a3d,0x93ae7));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';function a35_0x3a3d(){const _0x3e1dbc=['Show\x20child\x20segment\x20schema\x20(column\x20types)','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Fetching\x20folder\x20details...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','getSegmentSQLFromYaml','resolveParentId','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x20folder','Site:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','4597560HXSHcS','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolved:\x20','parentSegment','fullPath','SEGMENT_NOT_FOUND','Segment\x20ID:\x20','Folder\x20name:\x20','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20sql\x20--path\x20','\x20[Job\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','error','Resolving\x20path\x20\x27','Fetching\x20SQL\x20for\x20segment...','βœ”\x20Found\x20','Show\x20segment\x20or\x20folder\x20details','Examples:','message','/e/','Resolved\x20parent\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','description','segment:folder:list','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','execute','Resolved\x20type:\x20','trim','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Resolving\x20parent\x20folder\x20\x27','\x20\x20Folder\x20path:\x20','processedRows','segmentId','cyan','verbose','Error:\x20','cause','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','getSQLFromYamlFile','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','listFolders','Fetching\x20folder\x20\x27','red','replace','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','includes','code','Parent\x20name:\x20','content','17593947rdlONk','segment:folder:show','2304360agJClh','name','segmentName','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Show\x20folder\x20or\x20child\x20segment\x20details','json','getSegment','19254xDyklL','Fetching\x20segment\x20details...','toLocaleString','Use:\x20tdx\x20ps\x20show','query','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','jsonl','Usage:\x20tdx\x20sg\x20show\x20<name>','data','folderId','site','INVALID_ARGUMENT','βœ”\x20Query\x20completed:\x20Processed\x20','\x20\x20Segment\x20name:\x20','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','path','6513808hqLQvQ','type','Use:\x20tdx\x20ps\x20desc','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segmentPath','parentFolder','\x20rows\x20','Target\x20path:\x20','segment:show','\x20Opening\x20','getSegmentSQL','Usage:\x20tdx\x20segment\x20describe\x20<path>','getFolder','Show\x20segment\x20folder\x20details','limit','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','stats','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Resolving\x20parent\x20segment\x20\x27','2XfvJih','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','resolveFolderId','Folder\x20ID:\x20','segment','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','Error:\x20Path\x20or\x20name\x20is\x20required','SEGMENT_FOLDER_NOT_FOUND','Resolving\x20\x27','1136503YzTeQX','length','log','jobId','1797381YjZgHS','parent','format','Parent\x20ID:\x20','\x27\x20with\x20ID:\x20','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20folder\x20ID:\x20','βœ”\x20Created\x20folder\x20\x27','Creating\x20folder\x20\x27','resolvePathToResource','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','elapsedTimeMillis','βœ–\x20Query\x20failed\x20[','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Fetching\x20SQL\x20from\x20rule...','parentId','Usage:\x20tdx\x20sg\x20desc\x20<name>','getSQLFromServerSegment','\x27...','\x20\x20Cause:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','folderPath','Executing\x20segment\x20query...','Resolved\x20parent\x20folder\x20ID:\x20','2072EreVZu','segment:describe','segment:desc','folder','in\x20','Usage:','Fetching\x20parent\x20segment\x20details...','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'];a35_0x3a3d=function(){return _0x3e1dbc;};return a35_0x3a3d();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a35_0x1183da from'chalk';async function resolveSegmentTarget(_0x4c691a,_0x1dbb4b,_0x1d7c03){const _0x33cf0f=a35_0x25c5;if(isYamlFilePath(_0x4c691a))try{const _0x18e8be=await resolveYamlFilePath(_0x4c691a);return _0x1d7c03&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0x4c691a),console[_0x33cf0f(0x1d6)]('\x20\x20Parent\x20segment:\x20'+_0x18e8be[_0x33cf0f(0x1cb)]),console[_0x33cf0f(0x1d6)](_0x33cf0f(0x174)+_0x18e8be[_0x33cf0f(0x160)]),console['error'](_0x33cf0f(0x147)+(_0x18e8be[_0x33cf0f(0x1b0)]||'(root)')),console[_0x33cf0f(0x1d6)]('\x20\x20Full\x20path:\x20'+_0x18e8be[_0x33cf0f(0x1cc)])),_0x18e8be[_0x33cf0f(0x1cc)];}catch(_0x58fadd){throw new SDKError(ErrorCode[_0x33cf0f(0x172)],_0x33cf0f(0x161)+_0x58fadd['message']);}if(!_0x1dbb4b)throw new SDKError(ErrorCode[_0x33cf0f(0x172)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x1dbb4b+'/'+_0x4c691a;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]=a35_0x1bd46b(0x1b4);['description']=a35_0x1bd46b(0x1da);async[a35_0x1bd46b(0x142)](_0x50cc83){const _0x26f6ad=a35_0x1bd46b,{options:_0x296724,args:_0x5116fe,tdx:_0x4f3e69}=_0x50cc83,_0x4156f5=_0x5116fe[0x0],_0x56ebc6=!_0x4156f5&&!!_0x296724['parentSegment'],_0x3d6332=_0x4156f5||_0x296724['parentSegment'];if(!_0x3d6332)return console[_0x26f6ad(0x1d6)](_0x26f6ad(0x193)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x183)),console['error'](_0x26f6ad(0x1db)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1c3)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1a4)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1d4)),console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1bf)),0x1;try{const _0x1785f5=_0x296724[_0x26f6ad(0x17c)];let _0x2b7dff=_0x3d6332;!_0x56ebc6&&_0x1785f5&&!_0x3d6332[_0x26f6ad(0x158)]('/')&&(_0x2b7dff=_0x1785f5+'/'+_0x3d6332,_0x296724[_0x26f6ad(0x14b)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x2b7dff));const _0x3be67d=await withSpinner(_0x26f6ad(0x1d7)+_0x2b7dff+_0x26f6ad(0x1ad),()=>_0x4f3e69[_0x26f6ad(0x191)]['resolvePathToResource'](_0x2b7dff),{'verbose':_0x296724[_0x26f6ad(0x14b)]}),_0x566176=_0x3be67d['data'];_0x296724[_0x26f6ad(0x14b)]&&(console[_0x26f6ad(0x1d6)]('Resolved\x20type:\x20'+_0x566176[_0x26f6ad(0x178)]),console[_0x26f6ad(0x1d6)]('Parent\x20ID:\x20'+_0x566176[_0x26f6ad(0x1aa)]),_0x566176['folderId']&&console[_0x26f6ad(0x1d6)](_0x26f6ad(0x190)+_0x566176[_0x26f6ad(0x170)]),_0x566176[_0x26f6ad(0x149)]&&console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1ce)+_0x566176['segmentId']));if(_0x566176[_0x26f6ad(0x178)]===_0x26f6ad(0x19b)){const _0x4c2035=await withSpinner(_0x26f6ad(0x1b9),()=>_0x4f3e69[_0x26f6ad(0x191)]['getParent'](_0x566176['parentId']),{'verbose':_0x296724[_0x26f6ad(0x14b)]});await handleSingleObjectOutput(_0x4c2035[_0x26f6ad(0x16f)],_0x296724);}else{if(_0x566176[_0x26f6ad(0x178)]===_0x26f6ad(0x1b6)){if(!_0x566176[_0x26f6ad(0x170)])throw new SDKError(ErrorCode[_0x26f6ad(0x194)],_0x26f6ad(0x1bd));const _0x32b457=await withSpinner('Fetching\x20folder\x20details...',()=>_0x4f3e69[_0x26f6ad(0x191)][_0x26f6ad(0x184)](_0x566176[_0x26f6ad(0x170)]),{'verbose':_0x296724[_0x26f6ad(0x14b)]});await handleSingleObjectOutput(_0x32b457[_0x26f6ad(0x16f)],_0x296724);}else{if(_0x566176[_0x26f6ad(0x178)]===_0x26f6ad(0x191)){if(!_0x566176[_0x26f6ad(0x149)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x26f6ad(0x145));const _0x1b9928=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4f3e69['segment'][_0x26f6ad(0x165)](_0x566176[_0x26f6ad(0x1aa)],_0x566176[_0x26f6ad(0x149)]),{'verbose':_0x296724['verbose']});await handleSingleObjectOutput(_0x1b9928[_0x26f6ad(0x16f)],_0x296724);}}}return 0x0;}catch(_0x392711){if(_0x392711 instanceof SDKError)return console[_0x26f6ad(0x1d6)]('Error:\x20'+_0x392711['message']),_0x392711[_0x26f6ad(0x14d)]&&console[_0x26f6ad(0x1d6)](_0x26f6ad(0x1ae)+_0x392711['cause']),0x1;throw _0x392711;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]=a35_0x1bd46b(0x180);[a35_0x1bd46b(0x1e0)]=a35_0x1bd46b(0x1c9);async[a35_0x1bd46b(0x142)](_0x22adb0){const _0x599e56=a35_0x1bd46b,{options:_0xc6c5b8,args:_0x173080,tdx:_0x5c3949}=_0x22adb0,_0x711a6c=_0x173080[0x0];if(!_0x711a6c)return console[_0x599e56(0x1d6)](_0x599e56(0x1df)),console[_0x599e56(0x1d6)](_0x599e56(0x16e)),console['error'](_0x599e56(0x151)),console['error']('Examples:'),console[_0x599e56(0x1d6)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x599e56(0x1d6)](_0x599e56(0x162)),0x1;try{const _0x1b94f1=_0xc6c5b8[_0x599e56(0x1cb)],_0x5b4a6f=await resolveSegmentTarget(_0x711a6c,_0x1b94f1,_0xc6c5b8[_0x599e56(0x14b)]);_0xc6c5b8[_0x599e56(0x14b)]&&console[_0x599e56(0x1d6)](_0x599e56(0x17f)+_0x5b4a6f);const _0x275c74=await withSpinner(_0x599e56(0x195)+_0x711a6c+_0x599e56(0x1ad),()=>_0x5c3949[_0x599e56(0x191)]['resolvePathToResource'](_0x5b4a6f),{'verbose':_0xc6c5b8['verbose']}),_0x13e956=_0x275c74[_0x599e56(0x16f)];_0xc6c5b8[_0x599e56(0x14b)]&&(console['error'](_0x599e56(0x143)+_0x13e956[_0x599e56(0x178)]),console[_0x599e56(0x1d6)](_0x599e56(0x19d)+_0x13e956[_0x599e56(0x1aa)]));if(_0x13e956[_0x599e56(0x178)]==='folder')return console[_0x599e56(0x1d6)](_0x599e56(0x16b)),console[_0x599e56(0x1d6)](_0x599e56(0x188)),0x1;if(_0x13e956[_0x599e56(0x178)]===_0x599e56(0x19b))return console[_0x599e56(0x1d6)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x599e56(0x1d6)](_0x599e56(0x169)),0x1;if(!_0x13e956[_0x599e56(0x149)])throw new SDKError(ErrorCode[_0x599e56(0x1cd)],_0x599e56(0x145));const _0x5f0200=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5c3949[_0x599e56(0x191)][_0x599e56(0x182)](_0x13e956[_0x599e56(0x1aa)],_0x13e956['segmentId']),{'verbose':_0xc6c5b8[_0x599e56(0x14b)]});let _0x2a9482=_0x5f0200[_0x599e56(0x16f)];const _0x13638a=resolveLimit(_0xc6c5b8[_0x599e56(0x186)],DEFAULT_DISPLAY_LIMIT),_0x1a4e44=/\bLIMIT\s+\d+/i['test'](_0x2a9482);!_0x1a4e44&&(_0x2a9482=_0x2a9482[_0x599e56(0x144)]()[_0x599e56(0x156)](/;+$/,''),_0x2a9482=_0x599e56(0x14e)+_0x2a9482+_0x599e56(0x18a)+_0x13638a);_0xc6c5b8[_0x599e56(0x14b)]&&console[_0x599e56(0x1d6)]('SQL\x20query:\x0a'+_0x2a9482);const _0xbeb421=await withProgressSpinner(_0x599e56(0x1b1),async _0x20f896=>{const _0x5673c6=_0x599e56,_0xc623b1=await _0x5c3949[_0x5673c6(0x16a)]['execute'](_0x2a9482,{'catalog':'td','schema':'information_schema','onJobId':_0x187afd=>{_0x20f896['setJobId'](_0x187afd);}});return _0xc623b1;},{'verbose':_0xc6c5b8[_0x599e56(0x14b)]}),_0x43d7eb=_0xbeb421[_0x599e56(0x16f)],_0xb792f0=_0x43d7eb['jobId']?_0x599e56(0x1d3)+_0x43d7eb[_0x599e56(0x199)]+']':'';return console[_0x599e56(0x1d6)](_0x599e56(0x173)+_0x43d7eb[_0x599e56(0x189)][_0x599e56(0x148)][_0x599e56(0x168)]()+_0x599e56(0x17e)+(_0x599e56(0x1b7)+formatElapsed(_0x43d7eb[_0x599e56(0x189)][_0x599e56(0x1a5)])+_0xb792f0)),await handleQueryOutput(_0x43d7eb,_0xc6c5b8),0x0;}catch(_0x5369d7){if(_0x5369d7 instanceof SDKError)return console[_0x599e56(0x1d6)](_0x599e56(0x1a6)+_0x5369d7[_0x599e56(0x159)]+']'),console[_0x599e56(0x1d6)]('\x0a'+_0x5369d7[_0x599e56(0x1dc)]),0x1;throw _0x5369d7;}}}function a35_0x25c5(_0xcf8aba,_0x2ba5b8){_0xcf8aba=_0xcf8aba-0x140;const _0x3a3df9=a35_0x3a3d();let _0x25c508=_0x3a3df9[_0xcf8aba];return _0x25c508;}export class SegmentFolderListCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]=a35_0x1bd46b(0x140);[a35_0x1bd46b(0x1e0)]=a35_0x1bd46b(0x1d5);async[a35_0x1bd46b(0x142)](_0x1758b0){const _0x552e60=a35_0x1bd46b,{options:_0x3ad68,args:_0x36ed4f,tdx:_0x5cc794}=_0x1758b0;if(_0x36ed4f[_0x552e60(0x197)]===0x0)return console['error'](_0x552e60(0x1a7)),console[_0x552e60(0x1d6)](_0x552e60(0x18b)),0x1;const _0x1d4290=_0x36ed4f[0x0];try{_0x3ad68[_0x552e60(0x14b)]&&(console['error'](_0x552e60(0x1c6)+_0x3ad68[_0x552e60(0x171)]),console[_0x552e60(0x1d6)]('Parent\x20name:\x20'+_0x1d4290));const _0x42aa4f=await withSpinner(_0x552e60(0x18c)+_0x1d4290+_0x552e60(0x1ad),()=>_0x5cc794[_0x552e60(0x191)][_0x552e60(0x1c1)](_0x1d4290),{'verbose':_0x3ad68['verbose']}),_0x24be95=_0x42aa4f[_0x552e60(0x16f)];_0x3ad68[_0x552e60(0x14b)]&&console['error'](_0x552e60(0x1de)+_0x24be95);const _0x461b3d=await withSpinner(_0x552e60(0x1d0)+_0x1d4290+_0x552e60(0x1ad),()=>_0x5cc794[_0x552e60(0x191)][_0x552e60(0x153)](_0x24be95),{'verbose':_0x3ad68[_0x552e60(0x14b)]}),_0x245b32=_0x461b3d['data'];return console['error'](_0x552e60(0x1d9)+_0x245b32[_0x552e60(0x197)]+_0x552e60(0x1c5)+(_0x245b32[_0x552e60(0x197)]!==0x1?'s':'')),await handleSDKOutput(_0x245b32,_0x3ad68),0x0;}catch(_0x4455d2){if(_0x4455d2 instanceof SDKError)return console[_0x552e60(0x1d6)](_0x552e60(0x14c)+_0x4455d2[_0x552e60(0x1dc)]),_0x4455d2['cause']&&console[_0x552e60(0x1d6)]('\x20\x20Cause:\x20'+_0x4455d2['cause']),0x1;throw _0x4455d2;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x1bd46b(0x15d);[a35_0x1bd46b(0x1e0)]=a35_0x1bd46b(0x185);async['execute'](_0x2857cd){const _0x38c87e=a35_0x1bd46b,{options:_0x5d55d8,args:_0x353af0,tdx:_0x1cb4b3}=_0x2857cd;if(_0x353af0['length']===0x0)return console['error'](_0x38c87e(0x19f)),console[_0x38c87e(0x1d6)](_0x38c87e(0x1af)),0x1;try{const {parentId:_0x29a5ca,childId:_0x562ea2}=parseSegmentRef(_0x353af0[0x0]);_0x5d55d8[_0x38c87e(0x14b)]&&(console[_0x38c87e(0x1d6)](_0x38c87e(0x1c6)+_0x5d55d8[_0x38c87e(0x171)]),console[_0x38c87e(0x1d6)](_0x38c87e(0x15a)+_0x29a5ca),_0x562ea2&&console[_0x38c87e(0x1d6)]('Folder\x20name:\x20'+_0x562ea2));if(!_0x562ea2)return console[_0x38c87e(0x1d6)](_0x38c87e(0x17a)),0x1;const _0x26391a=await withSpinner(_0x38c87e(0x18c)+_0x29a5ca+_0x38c87e(0x1ad),()=>_0x1cb4b3[_0x38c87e(0x191)][_0x38c87e(0x1c1)](_0x29a5ca),{'verbose':_0x5d55d8['verbose']}),_0x5e4ac2=_0x26391a[_0x38c87e(0x16f)];_0x5d55d8[_0x38c87e(0x14b)]&&console[_0x38c87e(0x1d6)]('Resolved\x20parent\x20ID:\x20'+_0x5e4ac2);const _0x336758=await withSpinner('Resolving\x20folder\x20\x27'+_0x562ea2+_0x38c87e(0x1ad),()=>_0x1cb4b3['segment'][_0x38c87e(0x18f)](_0x5e4ac2,_0x562ea2),{'verbose':_0x5d55d8[_0x38c87e(0x14b)]}),_0x115f29=_0x336758[_0x38c87e(0x16f)];_0x5d55d8[_0x38c87e(0x14b)]&&console[_0x38c87e(0x1d6)](_0x38c87e(0x1a0)+_0x115f29);const _0x5465ac=await withSpinner(_0x38c87e(0x154)+_0x562ea2+_0x38c87e(0x1ad),()=>_0x1cb4b3[_0x38c87e(0x191)][_0x38c87e(0x184)](_0x115f29),{'verbose':_0x5d55d8[_0x38c87e(0x14b)]});return await handleSDKOutput([_0x5465ac[_0x38c87e(0x16f)]],_0x5d55d8),0x0;}catch(_0x2cad47){if(_0x2cad47 instanceof SDKError)return console[_0x38c87e(0x1d6)](_0x38c87e(0x14c)+_0x2cad47[_0x38c87e(0x1dc)]),_0x2cad47[_0x38c87e(0x14d)]&&console['error'](_0x38c87e(0x1ae)+_0x2cad47[_0x38c87e(0x14d)]),0x1;throw _0x2cad47;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]='segment:sql';['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async['execute'](_0x68193e){const _0x5305aa=a35_0x1bd46b,{options:_0x2fdecf,args:_0x30536b}=_0x68193e,_0x68f04a=_0x2fdecf,_0x2de8ef=_0x68f04a[_0x5305aa(0x176)],_0x4861f9=_0x30536b[0x0];if(!_0x4861f9&&!_0x2de8ef)return console[_0x5305aa(0x1d6)](a35_0x1183da[_0x5305aa(0x155)](_0x5305aa(0x1c4))),console[_0x5305aa(0x1d6)](_0x5305aa(0x1b8)),console['error'](_0x5305aa(0x192)),console[_0x5305aa(0x1d6)]('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console['error'](_0x5305aa(0x1db)),console[_0x5305aa(0x1d6)](_0x5305aa(0x1c7)),console['error']('\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml'),0x1;if(_0x4861f9&&_0x2de8ef)return console[_0x5305aa(0x1d6)](a35_0x1183da[_0x5305aa(0x155)](_0x5305aa(0x1ba))),0x1;try{let _0x54ce44;if(_0x2de8ef)_0x54ce44=await this[_0x5305aa(0x150)](_0x2de8ef,_0x68193e);else{if(isYamlFilePath(_0x4861f9))return console[_0x5305aa(0x1d6)](a35_0x1183da[_0x5305aa(0x155)](_0x5305aa(0x175))),console[_0x5305aa(0x1d6)](_0x5305aa(0x1d2)+_0x4861f9),0x1;else _0x54ce44=await this[_0x5305aa(0x1ac)](_0x4861f9,_0x68193e);}return _0x2fdecf[_0x5305aa(0x19c)]===_0x5305aa(0x164)||_0x2fdecf[_0x5305aa(0x19c)]===_0x5305aa(0x16d)?await handleSDKOutput([{'sql':_0x54ce44}],_0x2fdecf):console[_0x5305aa(0x198)](_0x54ce44),0x0;}catch(_0x301c9d){if(_0x301c9d instanceof SDKError)return console[_0x5305aa(0x1d6)](_0x5305aa(0x14c)+_0x301c9d[_0x5305aa(0x1dc)]),_0x301c9d['cause']&&console[_0x5305aa(0x1d6)](_0x5305aa(0x1ae)+_0x301c9d[_0x5305aa(0x14d)]),0x1;throw _0x301c9d;}}async[a35_0x1bd46b(0x150)](_0x1558e1,_0x482ab9){const _0x308610=a35_0x1bd46b,{options:_0x59ad2d,tdx:_0x2dbc86}=_0x482ab9;let _0x3eba47;try{_0x3eba47=await resolveYamlFilePath(_0x1558e1);}catch(_0x4f7b1a){throw new SDKError(ErrorCode[_0x308610(0x172)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x4f7b1a[_0x308610(0x1dc)]);}_0x59ad2d[_0x308610(0x14b)]&&console['error'](_0x308610(0x1ca)+_0x3eba47['parentSegment']+'/'+_0x3eba47[_0x308610(0x160)]);const _0xda30f4=await withSpinner(_0x308610(0x1a9),()=>_0x2dbc86[_0x308610(0x191)][_0x308610(0x1c0)](_0x3eba47[_0x308610(0x15b)],_0x3eba47[_0x308610(0x1cb)],_0x3eba47[_0x308610(0x160)]),{'verbose':_0x59ad2d['verbose']});return _0xda30f4[_0x308610(0x16f)];}async[a35_0x1bd46b(0x1ac)](_0x5003ea,_0x4f55ec){const _0x537663=a35_0x1bd46b,{options:_0x3a56df,tdx:_0x595a6d}=_0x4f55ec,_0x2946ad=_0x3a56df[_0x537663(0x1cb)],_0x5e41d1=await resolveSegmentTarget(_0x5003ea,_0x2946ad,_0x3a56df[_0x537663(0x14b)]);_0x3a56df[_0x537663(0x14b)]&&console[_0x537663(0x1d6)](_0x537663(0x17f)+_0x5e41d1);const _0x53654c=await withSpinner(_0x537663(0x195)+_0x5003ea+_0x537663(0x1ad),()=>_0x595a6d[_0x537663(0x191)][_0x537663(0x1a3)](_0x5e41d1),{'verbose':_0x3a56df[_0x537663(0x14b)]}),_0x300396=_0x53654c['data'];_0x3a56df[_0x537663(0x14b)]&&(console['error'](_0x537663(0x143)+_0x300396[_0x537663(0x178)]),console[_0x537663(0x1d6)](_0x537663(0x19d)+_0x300396['parentId']));if(_0x300396['type']===_0x537663(0x1b6))throw new SDKError(ErrorCode[_0x537663(0x172)],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x300396[_0x537663(0x178)]===_0x537663(0x19b))throw new SDKError(ErrorCode[_0x537663(0x172)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x300396[_0x537663(0x149)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x30a74a=await withSpinner(_0x537663(0x1d8),()=>_0x595a6d[_0x537663(0x191)][_0x537663(0x182)](_0x300396[_0x537663(0x1aa)],_0x300396['segmentId']),{'verbose':_0x3a56df[_0x537663(0x14b)]});return _0x30a74a[_0x537663(0x16f)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]='segment:folder:create';['description']='Create\x20segment\x20folder\x20for\x20organization';async[a35_0x1bd46b(0x142)](_0x392688){const _0x1c4ce5=a35_0x1bd46b,{options:_0x2511f4,args:_0x46ecbd,tdx:_0xea132c}=_0x392688,_0xd87fbb=_0x2511f4;if(_0x46ecbd['length']<0x2)return console[_0x1c4ce5(0x1d6)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x17b)),0x1;const _0x30ec04=_0x46ecbd[0x0],_0x40f541=_0x46ecbd[0x1];_0xd87fbb['verbose']&&(console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x1c6)+_0xd87fbb[_0x1c4ce5(0x171)]),console[_0x1c4ce5(0x1d6)]('Parent\x20segment:\x20'+_0x30ec04),console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x1cf)+_0x40f541));let _0x1f4440;if(_0xd87fbb[_0x1c4ce5(0x17d)]){const _0x268b3e=_0xd87fbb[_0x1c4ce5(0x17d)],_0x526738=await withSpinner(_0x1c4ce5(0x18c)+_0x30ec04+'\x27...',()=>_0xea132c[_0x1c4ce5(0x191)][_0x1c4ce5(0x1c1)](_0x30ec04),{'verbose':_0xd87fbb['verbose']}),_0x1d2ee2=_0x526738[_0x1c4ce5(0x16f)],_0x510db0=await withSpinner(_0x1c4ce5(0x146)+_0x268b3e+'\x27...',()=>_0xea132c[_0x1c4ce5(0x191)][_0x1c4ce5(0x18f)](_0x1d2ee2,_0x268b3e),{'verbose':_0xd87fbb[_0x1c4ce5(0x14b)]});_0x1f4440=_0x510db0['data'],_0xd87fbb[_0x1c4ce5(0x14b)]&&console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x1b2)+_0x1f4440);}const _0x260fa6={'name':_0x40f541,'description':_0xd87fbb[_0x1c4ce5(0x1e0)],'parentFolderId':_0x1f4440},_0x572ed9=await withSpinner(_0x1c4ce5(0x1a2)+_0x40f541+_0x1c4ce5(0x1ad),()=>_0xea132c[_0x1c4ce5(0x191)]['createFolder'](_0x30ec04,_0x260fa6),{'verbose':_0xd87fbb['verbose']}),_0x329a6c=_0x572ed9[_0x1c4ce5(0x16f)];return console[_0x1c4ce5(0x1d6)](_0x1c4ce5(0x1a1)+_0x329a6c[_0x1c4ce5(0x15f)]+_0x1c4ce5(0x19e)+_0x329a6c['id']),await handleSDKOutput([_0x329a6c],_0xd87fbb),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]='segment:view';['description']=a35_0x1bd46b(0x163);async[a35_0x1bd46b(0x142)](_0x287a2e){const _0x524651=a35_0x1bd46b,{options:_0x51722f,args:_0x158f46,tdx:_0x1055eb}=_0x287a2e,_0x3adf97=_0x158f46[0x0];if(!_0x3adf97)return console[_0x524651(0x1d6)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x524651(0x1a8)),console[_0x524651(0x1d6)](_0x524651(0x157)),console[_0x524651(0x1d6)]('Options:'),console[_0x524651(0x1d6)](_0x524651(0x1c2)),console[_0x524651(0x1d6)](_0x524651(0x1db)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x524651(0x1d6)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x524651(0x1d1)),console['error'](_0x524651(0x14f)),0x1;try{const _0x4ea44e=_0x51722f[_0x524651(0x1cb)],_0x25c78c=await resolveSegmentTarget(_0x3adf97,_0x4ea44e,_0x51722f[_0x524651(0x14b)]);_0x51722f[_0x524651(0x14b)]&&console[_0x524651(0x1d6)](_0x524651(0x17f)+_0x25c78c);const _0x1ea919=await withSpinner(_0x524651(0x195)+_0x3adf97+_0x524651(0x1ad),()=>_0x1055eb[_0x524651(0x191)][_0x524651(0x1a3)](_0x25c78c),{'verbose':_0x51722f[_0x524651(0x14b)]}),_0x987aef=_0x1ea919['data'];_0x51722f[_0x524651(0x14b)]&&(console[_0x524651(0x1d6)](_0x524651(0x143)+_0x987aef[_0x524651(0x178)]),console[_0x524651(0x1d6)](_0x524651(0x19d)+_0x987aef['parentId']),_0x987aef[_0x524651(0x170)]&&console[_0x524651(0x1d6)](_0x524651(0x190)+_0x987aef['folderId']),_0x987aef['segmentId']&&console[_0x524651(0x1d6)](_0x524651(0x1ce)+_0x987aef[_0x524651(0x149)]));if(_0x51722f['web']){if(_0x987aef['type']==='folder')return console[_0x524651(0x1d6)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x987aef['type']===_0x524651(0x19b))return console[_0x524651(0x1d6)](_0x524651(0x18e)),console[_0x524651(0x1d6)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x987aef['segmentId'])throw new SDKError(ErrorCode[_0x524651(0x1cd)],_0x524651(0x145));const _0x1944c7=getConsoleNextUrl(_0x51722f[_0x524651(0x171)],'/app/ps/'+_0x987aef[_0x524651(0x1aa)]+'/e/'+_0x987aef[_0x524651(0x149)]);return console[_0x524651(0x1d6)](a35_0x1183da['green']('βœ”')+_0x524651(0x181)+a35_0x1183da[_0x524651(0x14a)](_0x1944c7)),openBrowser(_0x1944c7),0x0;}if(_0x987aef['type']==='folder'){if(!_0x987aef['folderId'])throw new SDKError(ErrorCode[_0x524651(0x194)],_0x524651(0x1bd));const _0x424d1f=await withSpinner(_0x524651(0x1be),()=>_0x1055eb[_0x524651(0x191)][_0x524651(0x184)](_0x987aef[_0x524651(0x170)]),{'verbose':_0x51722f[_0x524651(0x14b)]});await handleSingleObjectOutput(_0x424d1f['data'],_0x51722f);}else{if(_0x987aef[_0x524651(0x178)]==='segment'){if(!_0x987aef[_0x524651(0x149)])throw new SDKError(ErrorCode[_0x524651(0x1cd)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x23b3b9=await withSpinner(_0x524651(0x167),()=>_0x1055eb['segment'][_0x524651(0x165)](_0x987aef['parentId'],_0x987aef[_0x524651(0x149)]),{'verbose':_0x51722f[_0x524651(0x14b)]}),_0x511e7f=getConsoleNextUrl(_0x51722f[_0x524651(0x171)],'/app/ps/'+_0x987aef[_0x524651(0x1aa)]+_0x524651(0x1dd)+_0x987aef[_0x524651(0x149)]),_0x41e031=_0x23b3b9[_0x524651(0x16f)];_0x41e031['url']=_0x511e7f,await handleSingleObjectOutput(_0x41e031,_0x51722f);}else return console[_0x524651(0x1d6)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x524651(0x1d6)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x23712b){if(_0x23712b instanceof SDKError)return console[_0x524651(0x1d6)](_0x524651(0x14c)+_0x23712b[_0x524651(0x1dc)]),_0x23712b[_0x524651(0x14d)]&&console[_0x524651(0x1d6)](_0x524651(0x1ae)+_0x23712b[_0x524651(0x14d)]),0x1;throw _0x23712b;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x1bd46b(0x15f)]=a35_0x1bd46b(0x1b5);[a35_0x1bd46b(0x1e0)]=a35_0x1bd46b(0x1bc);async[a35_0x1bd46b(0x142)](_0xa8369d){const _0x36eab7=a35_0x1bd46b,{options:_0x476c30,args:_0x2e8d30,tdx:_0x4fbd7f}=_0xa8369d,_0x1f94ac=_0x2e8d30[0x0];if(!_0x1f94ac)return console[_0x36eab7(0x1d6)](_0x36eab7(0x1df)),console['error'](_0x36eab7(0x1ab)),console[_0x36eab7(0x1d6)](_0x36eab7(0x16c)),console[_0x36eab7(0x1d6)](_0x36eab7(0x1db)),console[_0x36eab7(0x1d6)](_0x36eab7(0x141)),console[_0x36eab7(0x1d6)](_0x36eab7(0x152)),0x1;try{const _0x2ba369=_0x476c30[_0x36eab7(0x1cb)],_0x4f74cb=await resolveSegmentTarget(_0x1f94ac,_0x2ba369,_0x476c30[_0x36eab7(0x14b)]);_0x476c30[_0x36eab7(0x14b)]&&console[_0x36eab7(0x1d6)](_0x36eab7(0x17f)+_0x4f74cb);const _0xaabe7b=await withSpinner(_0x36eab7(0x195)+_0x1f94ac+'\x27...',()=>_0x4fbd7f[_0x36eab7(0x191)]['resolvePathToResource'](_0x4f74cb),{'verbose':_0x476c30[_0x36eab7(0x14b)]}),_0x38bd3e=_0xaabe7b[_0x36eab7(0x16f)];_0x476c30[_0x36eab7(0x14b)]&&(console[_0x36eab7(0x1d6)](_0x36eab7(0x143)+_0x38bd3e[_0x36eab7(0x178)]),console[_0x36eab7(0x1d6)]('Parent\x20ID:\x20'+_0x38bd3e[_0x36eab7(0x1aa)]));if(_0x38bd3e[_0x36eab7(0x178)]===_0x36eab7(0x1b6))return console[_0x36eab7(0x1d6)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console['error'](_0x36eab7(0x1bb)),0x1;if(_0x38bd3e['type']===_0x36eab7(0x19b))return console[_0x36eab7(0x1d6)](_0x36eab7(0x187)),console[_0x36eab7(0x1d6)](_0x36eab7(0x179)),0x1;if(!_0x38bd3e['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x36eab7(0x145));const _0x568c74=await withSpinner(_0x36eab7(0x1d8),()=>_0x4fbd7f[_0x36eab7(0x191)][_0x36eab7(0x182)](_0x38bd3e[_0x36eab7(0x1aa)],_0x38bd3e['segmentId']),{'verbose':_0x476c30[_0x36eab7(0x14b)]}),_0x2a58c4=_0x568c74[_0x36eab7(0x16f)],_0x21315c=await executeSchemaQuery(_0x2a58c4,_0x4fbd7f,_0x476c30);return await handleQueryOutput(_0x21315c,_0x476c30),0x0;}catch(_0x357813){if(_0x357813 instanceof SDKError)return console[_0x36eab7(0x1d6)]('Error:\x20'+_0x357813[_0x36eab7(0x1dc)]),_0x357813[_0x36eab7(0x14d)]&&console[_0x36eab7(0x1d6)](_0x36eab7(0x1ae)+_0x357813[_0x36eab7(0x14d)]),0x1;throw _0x357813;}}}
1
+ const a35_0x131d30=a35_0x590d;(function(_0x5eb4fb,_0x520cd9){const _0x5087ba=a35_0x590d,_0x1c85ab=_0x5eb4fb();while(!![]){try{const _0xa08637=parseInt(_0x5087ba(0x1e3))/0x1*(parseInt(_0x5087ba(0x16c))/0x2)+parseInt(_0x5087ba(0x19b))/0x3+parseInt(_0x5087ba(0x1bc))/0x4*(parseInt(_0x5087ba(0x1ef))/0x5)+parseInt(_0x5087ba(0x1f4))/0x6*(parseInt(_0x5087ba(0x177))/0x7)+-parseInt(_0x5087ba(0x1f3))/0x8+parseInt(_0x5087ba(0x1d6))/0x9*(parseInt(_0x5087ba(0x1d3))/0xa)+-parseInt(_0x5087ba(0x178))/0xb;if(_0xa08637===_0x520cd9)break;else _0x1c85ab['push'](_0x1c85ab['shift']());}catch(_0x10b585){_0x1c85ab['push'](_0x1c85ab['shift']());}}}(a35_0x3fc2,0x2d6fc));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 a35_0x3ea970 from'chalk';async function resolveSegmentTarget(_0x426209,_0x5001db,_0x132247){const _0x3435fc=a35_0x590d;if(isYamlFilePath(_0x426209))try{const _0x139405=await resolveYamlFilePath(_0x426209);return _0x132247&&(console['error'](_0x3435fc(0x191)+_0x426209),console[_0x3435fc(0x1d7)](_0x3435fc(0x16e)+_0x139405[_0x3435fc(0x1b1)]),console[_0x3435fc(0x1d7)](_0x3435fc(0x1dd)+_0x139405[_0x3435fc(0x1fd)]),console[_0x3435fc(0x1d7)](_0x3435fc(0x209)+(_0x139405[_0x3435fc(0x1ad)]||_0x3435fc(0x1fc))),console['error'](_0x3435fc(0x17f)+_0x139405[_0x3435fc(0x169)])),_0x139405['fullPath'];}catch(_0x3ff2e1){throw new SDKError(ErrorCode[_0x3435fc(0x1a0)],_0x3435fc(0x200)+_0x3ff2e1['message']);}if(!_0x5001db)throw new SDKError(ErrorCode[_0x3435fc(0x1a0)],_0x3435fc(0x1d0));return _0x5001db+'/'+_0x426209;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x131d30(0x189)]='segment:describe';[a35_0x131d30(0x18a)]=a35_0x131d30(0x1bd);async[a35_0x131d30(0x1ab)](_0x51f05f){const _0x3f1ff5=a35_0x131d30,{options:_0x2f338f,args:_0x5549ea,tdx:_0x40fe89}=_0x51f05f,_0xa12a02=_0x5549ea[0x0],_0x2b6d40=!_0xa12a02&&!!_0x2f338f['parentSegment'],_0x1d0902=_0xa12a02||_0x2f338f[_0x3f1ff5(0x1b1)];if(!_0x1d0902)return console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x190)),console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x1b0)),console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x1d1)),console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x197)),console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x1e5)),console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x1bb)),console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x1c7)),0x1;try{const _0x583be8=_0x2f338f[_0x3f1ff5(0x1f5)];let _0x5445fe=_0x1d0902;!_0x2b6d40&&_0x583be8&&!_0x1d0902[_0x3f1ff5(0x1be)]('/')&&(_0x5445fe=_0x583be8+'/'+_0x1d0902,_0x2f338f[_0x3f1ff5(0x1ac)]&&console[_0x3f1ff5(0x1d7)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5445fe));const _0x59ec08=await withSpinner(_0x3f1ff5(0x1b6)+_0x5445fe+_0x3f1ff5(0x195),()=>_0x40fe89[_0x3f1ff5(0x1bf)][_0x3f1ff5(0x184)](_0x5445fe),{'verbose':_0x2f338f[_0x3f1ff5(0x1ac)]}),_0x333c9b=_0x59ec08['data'];_0x2f338f[_0x3f1ff5(0x1ac)]&&(console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x18e)+_0x333c9b['type']),console['error'](_0x3f1ff5(0x198)+_0x333c9b[_0x3f1ff5(0x1db)]),_0x333c9b[_0x3f1ff5(0x1f6)]&&console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x1e7)+_0x333c9b['folderId']),_0x333c9b[_0x3f1ff5(0x1fa)]&&console[_0x3f1ff5(0x1d7)]('Segment\x20ID:\x20'+_0x333c9b[_0x3f1ff5(0x1fa)]));if(_0x333c9b[_0x3f1ff5(0x19a)]==='parent'){const _0x2dcb0f=await withSpinner(_0x3f1ff5(0x1fe),()=>_0x40fe89[_0x3f1ff5(0x1bf)]['getParent'](_0x333c9b['parentId']),{'verbose':_0x2f338f[_0x3f1ff5(0x1ac)]});await handleSingleObjectOutput(_0x2dcb0f[_0x3f1ff5(0x19e)],_0x2f338f);}else{if(_0x333c9b['type']==='folder'){if(!_0x333c9b[_0x3f1ff5(0x1f6)])throw new SDKError(ErrorCode[_0x3f1ff5(0x1f9)],_0x3f1ff5(0x17b));const _0x2cdd74=await withSpinner(_0x3f1ff5(0x18f),()=>_0x40fe89[_0x3f1ff5(0x1bf)]['getFolder'](_0x333c9b[_0x3f1ff5(0x1f6)]),{'verbose':_0x2f338f[_0x3f1ff5(0x1ac)]});await handleSingleObjectOutput(_0x2cdd74[_0x3f1ff5(0x19e)],_0x2f338f);}else{if(_0x333c9b['type']==='segment'){if(!_0x333c9b[_0x3f1ff5(0x1fa)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3f1ff5(0x1a8));const _0x1b9e9d=await withSpinner(_0x3f1ff5(0x203),()=>_0x40fe89[_0x3f1ff5(0x1bf)][_0x3f1ff5(0x1e1)](_0x333c9b[_0x3f1ff5(0x1db)],_0x333c9b[_0x3f1ff5(0x1fa)]),{'verbose':_0x2f338f['verbose']});await handleSingleObjectOutput(_0x1b9e9d[_0x3f1ff5(0x19e)],_0x2f338f);}}}return 0x0;}catch(_0x39e5ed){if(_0x39e5ed instanceof SDKError)return console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x17a)+_0x39e5ed['message']),_0x39e5ed['cause']&&console[_0x3f1ff5(0x1d7)](_0x3f1ff5(0x1e9)+_0x39e5ed[_0x3f1ff5(0x194)]),0x1;throw _0x39e5ed;}}}function a35_0x590d(_0x527af8,_0x12e811){_0x527af8=_0x527af8-0x167;const _0x3fc256=a35_0x3fc2();let _0x590d96=_0x3fc256[_0x527af8];return _0x590d96;}export class SegmentShowCommand extends BaseCommand{[a35_0x131d30(0x189)]=a35_0x131d30(0x1c2);[a35_0x131d30(0x18a)]=a35_0x131d30(0x1ec);async[a35_0x131d30(0x1ab)](_0x240893){const _0x2d722d=a35_0x131d30,{options:_0x336480,args:_0x563a2c,tdx:_0x5410d9}=_0x240893,_0x581d65=_0x563a2c[0x0];if(!_0x581d65)return console['error'](_0x2d722d(0x1c4)),console[_0x2d722d(0x1d7)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console['error'](_0x2d722d(0x1d1)),console['error'](_0x2d722d(0x168)),console[_0x2d722d(0x1d7)](_0x2d722d(0x1c3)),0x1;try{const _0x42ccc7=_0x336480['parentSegment'],_0x332a21=await resolveSegmentTarget(_0x581d65,_0x42ccc7,_0x336480[_0x2d722d(0x1ac)]);_0x336480[_0x2d722d(0x1ac)]&&console[_0x2d722d(0x1d7)](_0x2d722d(0x1b8)+_0x332a21);const _0x5c602d=await withSpinner(_0x2d722d(0x1c9)+_0x581d65+_0x2d722d(0x195),()=>_0x5410d9['segment'][_0x2d722d(0x184)](_0x332a21),{'verbose':_0x336480[_0x2d722d(0x1ac)]}),_0x4cb8d5=_0x5c602d[_0x2d722d(0x19e)];_0x336480[_0x2d722d(0x1ac)]&&(console[_0x2d722d(0x1d7)]('Resolved\x20type:\x20'+_0x4cb8d5[_0x2d722d(0x19a)]),console[_0x2d722d(0x1d7)](_0x2d722d(0x198)+_0x4cb8d5['parentId']));if(_0x4cb8d5['type']===_0x2d722d(0x172))return console[_0x2d722d(0x1d7)](_0x2d722d(0x1b7)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x4cb8d5[_0x2d722d(0x19a)]===_0x2d722d(0x1a2))return console[_0x2d722d(0x1d7)](_0x2d722d(0x20a)),console['error'](_0x2d722d(0x1b3)),0x1;if(!_0x4cb8d5[_0x2d722d(0x1fa)])throw new SDKError(ErrorCode[_0x2d722d(0x171)],_0x2d722d(0x1a8));const _0x5b4574=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x5410d9[_0x2d722d(0x1bf)][_0x2d722d(0x17c)](_0x4cb8d5[_0x2d722d(0x1db)],_0x4cb8d5[_0x2d722d(0x1fa)]),{'verbose':_0x336480[_0x2d722d(0x1ac)]});let _0x39fef4=_0x5b4574[_0x2d722d(0x19e)];const _0x103ee1=resolveLimit(_0x336480[_0x2d722d(0x204)],DEFAULT_DISPLAY_LIMIT),_0x299f79=/\bLIMIT\s+\d+/i[_0x2d722d(0x1ff)](_0x39fef4);!_0x299f79&&(_0x39fef4=_0x39fef4[_0x2d722d(0x1a1)]()[_0x2d722d(0x1ba)](/;+$/,''),_0x39fef4=_0x2d722d(0x1cd)+_0x39fef4+_0x2d722d(0x18b)+_0x103ee1);_0x336480[_0x2d722d(0x1ac)]&&console['error'](_0x2d722d(0x1ce)+_0x39fef4);const _0x2588e7=await withProgressSpinner('Executing\x20segment\x20query...',async _0xd0ed5=>{const _0x39e842=_0x2d722d,_0x11233f=await _0x5410d9['query'][_0x39e842(0x1ab)](_0x39fef4,{'catalog':'td','schema':_0x39e842(0x1ca),'onJobId':_0x31514b=>{_0xd0ed5['setJobId'](_0x31514b);}});return _0x11233f;},{'verbose':_0x336480['verbose']}),_0x39a963=_0x2588e7[_0x2d722d(0x19e)],_0x275b0f=_0x39a963[_0x2d722d(0x1cb)]?_0x2d722d(0x1df)+_0x39a963[_0x2d722d(0x1cb)]+']':'';return console[_0x2d722d(0x1d7)]('βœ”\x20Query\x20completed:\x20Processed\x20'+_0x39a963['stats'][_0x2d722d(0x1eb)]['toLocaleString']()+_0x2d722d(0x208)+(_0x2d722d(0x1d5)+formatElapsed(_0x39a963['stats'][_0x2d722d(0x192)])+_0x275b0f)),await handleQueryOutput(_0x39a963,_0x336480),0x0;}catch(_0x406d60){if(_0x406d60 instanceof SDKError)return console['error']('βœ–\x20Query\x20failed\x20['+_0x406d60[_0x2d722d(0x170)]+']'),console[_0x2d722d(0x1d7)]('\x0a'+_0x406d60['message']),0x1;throw _0x406d60;}}}function a35_0x3fc2(){const _0xf5bfdf=['Fetching\x20SQL\x20from\x20rule...','replace','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','4BJttrv','Show\x20segment\x20or\x20folder\x20details','includes','segment','json','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','segment:show','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','segment:desc','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Resolving\x20\x27','information_schema','jobId','Folder\x20name:\x20','SELECT\x20*\x20FROM\x20(\x0a','SQL\x20query:\x0a','Resolving\x20folder\x20\x27','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Examples:','Parent\x20segment:\x20','752680Omfrtm','Show\x20child\x20segment\x20schema\x20(column\x20types)','in\x20','9MaADRw','error','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','resolveFolderId','getSQLFromYamlFile','parentId','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20Segment\x20name:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20[Job\x20ID:\x20','log','getSegment','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','521HjEPnb','segment:folder:list','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x27\x20with\x20ID:\x20','Folder\x20ID:\x20','url','\x20\x20Cause:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','processedRows','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','site','getSQLFromServerSegment','234660cnPsTX','cyan','getFolder','Site:\x20','2283048CyvvYj','6kJflJP','segmentPath','folderId','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Resolved\x20folder\x20ID:\x20','SEGMENT_FOLDER_NOT_FOUND','segmentId','\x20\x20tdx\x20sg\x20sql\x20--path\x20','(root)','segmentName','Fetching\x20parent\x20segment\x20details...','test','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Fetching\x20segment\x20details...','limit','βœ”\x20Found\x20','format','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','\x20rows\x20','\x20\x20Folder\x20path:\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20parent\x20ID:\x20','Listing\x20folders\x20for\x20parent\x20\x27','length','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','fullPath','Fetching\x20folder\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','14BXJVwv','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20Parent\x20segment:\x20','Use:\x20tdx\x20ps\x20desc','code','SEGMENT_NOT_FOUND','folder','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','path','Use:\x20tdx\x20ps\x20view','2149637NTeuFx','1422289EunPll','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','getSegmentSQL','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','/e/','\x20\x20Full\x20path:\x20','Usage:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','createFolder','βœ”\x20Created\x20folder\x20\x27','resolvePathToResource','Parent\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Get\x20SQL\x20query\x20for\x20child\x20segment','Resolved\x20parent\x20folder\x20ID:\x20','name','description','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Resolved\x20type:\x20','Fetching\x20folder\x20details...','Error:\x20Path\x20or\x20name\x20is\x20required','Resolved\x20YAML\x20file:\x20','elapsedTimeMillis','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','cause','\x27...','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Parent\x20ID:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','type','503550wjEUQD','segment:folder:create','Creating\x20folder\x20\x27','data','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','INVALID_ARGUMENT','trim','parent','segment:sql','Create\x20segment\x20folder\x20for\x20organization','segment:view','message','red','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Show\x20folder\x20or\x20child\x20segment\x20details','Fetching\x20SQL\x20for\x20segment...','execute','verbose','folderPath','resolveParentId','green','Usage:\x20tdx\x20segment\x20describe\x20<path>','parentSegment','/app/ps/','Use:\x20tdx\x20ps\x20show','listFolders','content','Resolving\x20path\x20\x27','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Target\x20path:\x20'];a35_0x3fc2=function(){return _0xf5bfdf;};return a35_0x3fc2();}export class SegmentFolderListCommand extends BaseCommand{['name']=a35_0x131d30(0x1e4);[a35_0x131d30(0x18a)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async['execute'](_0x5739ba){const _0x544832=a35_0x131d30,{options:_0x46c4a3,args:_0x2fae69,tdx:_0x17d99a}=_0x5739ba;if(_0x2fae69[_0x544832(0x167)]===0x0)return console[_0x544832(0x1d7)](_0x544832(0x1de)),console['error'](_0x544832(0x179)),0x1;const _0x1f47a0=_0x2fae69[0x0];try{_0x46c4a3[_0x544832(0x1ac)]&&(console['error'](_0x544832(0x1f2)+_0x46c4a3['site']),console[_0x544832(0x1d7)]('Parent\x20name:\x20'+_0x1f47a0));const _0x2ab39e=await withSpinner(_0x544832(0x201)+_0x1f47a0+_0x544832(0x195),()=>_0x17d99a[_0x544832(0x1bf)][_0x544832(0x1ae)](_0x1f47a0),{'verbose':_0x46c4a3['verbose']}),_0xc212a5=_0x2ab39e[_0x544832(0x19e)];_0x46c4a3[_0x544832(0x1ac)]&&console[_0x544832(0x1d7)](_0x544832(0x20b)+_0xc212a5);const _0x4062fd=await withSpinner(_0x544832(0x20c)+_0x1f47a0+_0x544832(0x195),()=>_0x17d99a['segment'][_0x544832(0x1b4)](_0xc212a5),{'verbose':_0x46c4a3[_0x544832(0x1ac)]}),_0x53ba68=_0x4062fd[_0x544832(0x19e)];return console[_0x544832(0x1d7)](_0x544832(0x205)+_0x53ba68[_0x544832(0x167)]+'\x20folder'+(_0x53ba68[_0x544832(0x167)]!==0x1?'s':'')),await handleSDKOutput(_0x53ba68,_0x46c4a3),0x0;}catch(_0xe658f1){if(_0xe658f1 instanceof SDKError)return console[_0x544832(0x1d7)](_0x544832(0x17a)+_0xe658f1[_0x544832(0x1a6)]),_0xe658f1[_0x544832(0x194)]&&console['error'](_0x544832(0x1e9)+_0xe658f1[_0x544832(0x194)]),0x1;throw _0xe658f1;}}}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x131d30(0x189)]='segment:folder:show';['description']=a35_0x131d30(0x173);async[a35_0x131d30(0x1ab)](_0x218a20){const _0x4f05e6=a35_0x131d30,{options:_0x1affb9,args:_0x4a17dc,tdx:_0x587603}=_0x218a20;if(_0x4a17dc[_0x4f05e6(0x167)]===0x0)return console[_0x4f05e6(0x1d7)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x4f05e6(0x1d7)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x16571d,childId:_0x70482f}=parseSegmentRef(_0x4a17dc[0x0]);_0x1affb9[_0x4f05e6(0x1ac)]&&(console[_0x4f05e6(0x1d7)]('Site:\x20'+_0x1affb9[_0x4f05e6(0x1ed)]),console[_0x4f05e6(0x1d7)](_0x4f05e6(0x185)+_0x16571d),_0x70482f&&console['error'](_0x4f05e6(0x1cc)+_0x70482f));if(!_0x70482f)return console[_0x4f05e6(0x1d7)](_0x4f05e6(0x1c8)),0x1;const _0xfdd3cf=await withSpinner(_0x4f05e6(0x201)+_0x16571d+_0x4f05e6(0x195),()=>_0x587603[_0x4f05e6(0x1bf)][_0x4f05e6(0x1ae)](_0x16571d),{'verbose':_0x1affb9[_0x4f05e6(0x1ac)]}),_0x2dc52b=_0xfdd3cf[_0x4f05e6(0x19e)];_0x1affb9['verbose']&&console[_0x4f05e6(0x1d7)]('Resolved\x20parent\x20ID:\x20'+_0x2dc52b);const _0xe3b433=await withSpinner(_0x4f05e6(0x1cf)+_0x70482f+_0x4f05e6(0x195),()=>_0x587603[_0x4f05e6(0x1bf)][_0x4f05e6(0x1d9)](_0x2dc52b,_0x70482f),{'verbose':_0x1affb9[_0x4f05e6(0x1ac)]}),_0x5ba0e2=_0xe3b433[_0x4f05e6(0x19e)];_0x1affb9[_0x4f05e6(0x1ac)]&&console[_0x4f05e6(0x1d7)](_0x4f05e6(0x1f8)+_0x5ba0e2);const _0x148ebf=await withSpinner(_0x4f05e6(0x16a)+_0x70482f+_0x4f05e6(0x195),()=>_0x587603['segment'][_0x4f05e6(0x1f1)](_0x5ba0e2),{'verbose':_0x1affb9[_0x4f05e6(0x1ac)]});return await handleSDKOutput([_0x148ebf['data']],_0x1affb9),0x0;}catch(_0x5e3533){if(_0x5e3533 instanceof SDKError)return console[_0x4f05e6(0x1d7)](_0x4f05e6(0x17a)+_0x5e3533[_0x4f05e6(0x1a6)]),_0x5e3533[_0x4f05e6(0x194)]&&console['error'](_0x4f05e6(0x1e9)+_0x5e3533['cause']),0x1;throw _0x5e3533;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x131d30(0x189)]=a35_0x131d30(0x1a3);[a35_0x131d30(0x18a)]=a35_0x131d30(0x187);async[a35_0x131d30(0x1ab)](_0x1c9fe0){const _0x5c166f=a35_0x131d30,{options:_0x5c15dd,args:_0x1c41f5}=_0x1c9fe0,_0x2e8ac5=_0x5c15dd,_0x5e3b5c=_0x2e8ac5[_0x5c166f(0x175)],_0x2a5c08=_0x1c41f5[0x0];if(!_0x2a5c08&&!_0x5e3b5c)return console['error'](a35_0x3ea970[_0x5c166f(0x1a7)]('Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required')),console[_0x5c166f(0x1d7)](_0x5c166f(0x180)),console[_0x5c166f(0x1d7)](_0x5c166f(0x207)),console[_0x5c166f(0x1d7)](_0x5c166f(0x18c)),console[_0x5c166f(0x1d7)](_0x5c166f(0x1d1)),console[_0x5c166f(0x1d7)](_0x5c166f(0x1c1)),console[_0x5c166f(0x1d7)](_0x5c166f(0x1e2)),0x1;if(_0x2a5c08&&_0x5e3b5c)return console[_0x5c166f(0x1d7)](a35_0x3ea970[_0x5c166f(0x1a7)](_0x5c166f(0x18d))),0x1;try{let _0x1854d7;if(_0x5e3b5c)_0x1854d7=await this[_0x5c166f(0x1da)](_0x5e3b5c,_0x1c9fe0);else{if(isYamlFilePath(_0x2a5c08))return console[_0x5c166f(0x1d7)](a35_0x3ea970['red']('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x5c166f(0x1d7)](_0x5c166f(0x1fb)+_0x2a5c08),0x1;else _0x1854d7=await this[_0x5c166f(0x1ee)](_0x2a5c08,_0x1c9fe0);}return _0x5c15dd[_0x5c166f(0x206)]===_0x5c166f(0x1c0)||_0x5c15dd[_0x5c166f(0x206)]==='jsonl'?await handleSDKOutput([{'sql':_0x1854d7}],_0x5c15dd):console[_0x5c166f(0x1e0)](_0x1854d7),0x0;}catch(_0x34a659){if(_0x34a659 instanceof SDKError)return console[_0x5c166f(0x1d7)](_0x5c166f(0x17a)+_0x34a659[_0x5c166f(0x1a6)]),_0x34a659[_0x5c166f(0x194)]&&console['error']('\x20\x20Cause:\x20'+_0x34a659[_0x5c166f(0x194)]),0x1;throw _0x34a659;}}async[a35_0x131d30(0x1da)](_0x407ef4,_0x2599d6){const _0x391fa2=a35_0x131d30,{options:_0x51b82d,tdx:_0x5307af}=_0x2599d6;let _0x551e72;try{_0x551e72=await resolveYamlFilePath(_0x407ef4);}catch(_0x5e55f9){throw new SDKError(ErrorCode[_0x391fa2(0x1a0)],_0x391fa2(0x200)+_0x5e55f9[_0x391fa2(0x1a6)]);}_0x51b82d[_0x391fa2(0x1ac)]&&console[_0x391fa2(0x1d7)]('Resolved:\x20'+_0x551e72[_0x391fa2(0x1b1)]+'/'+_0x551e72[_0x391fa2(0x1fd)]);const _0x1d4a18=await withSpinner(_0x391fa2(0x1b9),()=>_0x5307af['segment']['getSegmentSQLFromYaml'](_0x551e72[_0x391fa2(0x1b5)],_0x551e72[_0x391fa2(0x1b1)],_0x551e72[_0x391fa2(0x1fd)]),{'verbose':_0x51b82d[_0x391fa2(0x1ac)]});return _0x1d4a18[_0x391fa2(0x19e)];}async[a35_0x131d30(0x1ee)](_0x5cff19,_0x3d370f){const _0x26781a=a35_0x131d30,{options:_0x46043d,tdx:_0x3e0cd0}=_0x3d370f,_0x3e8bb7=_0x46043d['parentSegment'],_0xdeeba=await resolveSegmentTarget(_0x5cff19,_0x3e8bb7,_0x46043d[_0x26781a(0x1ac)]);_0x46043d[_0x26781a(0x1ac)]&&console[_0x26781a(0x1d7)](_0x26781a(0x1b8)+_0xdeeba);const _0x562369=await withSpinner(_0x26781a(0x1c9)+_0x5cff19+'\x27...',()=>_0x3e0cd0[_0x26781a(0x1bf)]['resolvePathToResource'](_0xdeeba),{'verbose':_0x46043d[_0x26781a(0x1ac)]}),_0x2a3c64=_0x562369[_0x26781a(0x19e)];_0x46043d['verbose']&&(console[_0x26781a(0x1d7)](_0x26781a(0x18e)+_0x2a3c64[_0x26781a(0x19a)]),console['error'](_0x26781a(0x198)+_0x2a3c64[_0x26781a(0x1db)]));if(_0x2a3c64['type']==='folder')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x2a3c64[_0x26781a(0x19a)]==='parent')throw new SDKError(ErrorCode[_0x26781a(0x1a0)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x2a3c64[_0x26781a(0x1fa)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x26781a(0x1a8));const _0x40881c=await withSpinner(_0x26781a(0x1aa),()=>_0x3e0cd0[_0x26781a(0x1bf)]['getSegmentSQL'](_0x2a3c64[_0x26781a(0x1db)],_0x2a3c64['segmentId']),{'verbose':_0x46043d[_0x26781a(0x1ac)]});return _0x40881c[_0x26781a(0x19e)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x131d30(0x189)]=a35_0x131d30(0x19c);[a35_0x131d30(0x18a)]=a35_0x131d30(0x1a4);async[a35_0x131d30(0x1ab)](_0x4c0f1b){const _0x4521c0=a35_0x131d30,{options:_0x5f0453,args:_0x3ae6f1,tdx:_0x46af0c}=_0x4c0f1b,_0x5398d4=_0x5f0453;if(_0x3ae6f1[_0x4521c0(0x167)]<0x2)return console[_0x4521c0(0x1d7)](_0x4521c0(0x202)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x3e521b=_0x3ae6f1[0x0],_0x577009=_0x3ae6f1[0x1];_0x5398d4[_0x4521c0(0x1ac)]&&(console[_0x4521c0(0x1d7)]('Site:\x20'+_0x5398d4[_0x4521c0(0x1ed)]),console[_0x4521c0(0x1d7)](_0x4521c0(0x1d2)+_0x3e521b),console[_0x4521c0(0x1d7)](_0x4521c0(0x1cc)+_0x577009));let _0x33f834;if(_0x5398d4['parentFolder']){const _0x31d4dc=_0x5398d4['parentFolder'],_0x360ee9=await withSpinner(_0x4521c0(0x201)+_0x3e521b+_0x4521c0(0x195),()=>_0x46af0c[_0x4521c0(0x1bf)][_0x4521c0(0x1ae)](_0x3e521b),{'verbose':_0x5398d4[_0x4521c0(0x1ac)]}),_0x31c8ea=_0x360ee9[_0x4521c0(0x19e)],_0x1d84cd=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x31d4dc+_0x4521c0(0x195),()=>_0x46af0c[_0x4521c0(0x1bf)][_0x4521c0(0x1d9)](_0x31c8ea,_0x31d4dc),{'verbose':_0x5398d4[_0x4521c0(0x1ac)]});_0x33f834=_0x1d84cd['data'],_0x5398d4[_0x4521c0(0x1ac)]&&console['error'](_0x4521c0(0x188)+_0x33f834);}const _0x26bb2e={'name':_0x577009,'description':_0x5398d4[_0x4521c0(0x18a)],'parentFolderId':_0x33f834},_0x267da1=await withSpinner(_0x4521c0(0x19d)+_0x577009+_0x4521c0(0x195),()=>_0x46af0c[_0x4521c0(0x1bf)][_0x4521c0(0x182)](_0x3e521b,_0x26bb2e),{'verbose':_0x5398d4['verbose']}),_0x245ca3=_0x267da1['data'];return console[_0x4521c0(0x1d7)](_0x4521c0(0x183)+_0x245ca3['name']+_0x4521c0(0x1e6)+_0x245ca3['id']),await handleSDKOutput([_0x245ca3],_0x5398d4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x131d30(0x189)]=a35_0x131d30(0x1a5);[a35_0x131d30(0x18a)]=a35_0x131d30(0x1a9);async[a35_0x131d30(0x1ab)](_0x32b6d9){const _0x2f036c=a35_0x131d30,{options:_0xdd20ab,args:_0xf79783,tdx:_0x88c6e8}=_0x32b6d9,_0x1be62b=_0xf79783[0x0];if(!_0x1be62b)return console[_0x2f036c(0x1d7)](_0x2f036c(0x199)),console[_0x2f036c(0x1d7)](_0x2f036c(0x196)),console['error'](_0x2f036c(0x186)),console[_0x2f036c(0x1d7)]('Options:'),console['error'](_0x2f036c(0x1ea)),console[_0x2f036c(0x1d7)]('Examples:'),console[_0x2f036c(0x1d7)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x2f036c(0x1d7)](_0x2f036c(0x193)),console['error'](_0x2f036c(0x19f)),console['error'](_0x2f036c(0x1f7)),0x1;try{const _0x34d51d=_0xdd20ab[_0x2f036c(0x1b1)],_0x1fe68a=await resolveSegmentTarget(_0x1be62b,_0x34d51d,_0xdd20ab['verbose']);_0xdd20ab[_0x2f036c(0x1ac)]&&console[_0x2f036c(0x1d7)](_0x2f036c(0x1b8)+_0x1fe68a);const _0x4aeace=await withSpinner(_0x2f036c(0x1c9)+_0x1be62b+_0x2f036c(0x195),()=>_0x88c6e8['segment'][_0x2f036c(0x184)](_0x1fe68a),{'verbose':_0xdd20ab[_0x2f036c(0x1ac)]}),_0x5c5a35=_0x4aeace[_0x2f036c(0x19e)];_0xdd20ab[_0x2f036c(0x1ac)]&&(console[_0x2f036c(0x1d7)]('Resolved\x20type:\x20'+_0x5c5a35[_0x2f036c(0x19a)]),console[_0x2f036c(0x1d7)](_0x2f036c(0x198)+_0x5c5a35[_0x2f036c(0x1db)]),_0x5c5a35[_0x2f036c(0x1f6)]&&console[_0x2f036c(0x1d7)](_0x2f036c(0x1e7)+_0x5c5a35[_0x2f036c(0x1f6)]),_0x5c5a35[_0x2f036c(0x1fa)]&&console['error']('Segment\x20ID:\x20'+_0x5c5a35[_0x2f036c(0x1fa)]));if(_0xdd20ab['web']){if(_0x5c5a35['type']===_0x2f036c(0x172))return console[_0x2f036c(0x1d7)](_0x2f036c(0x16d)),0x1;if(_0x5c5a35[_0x2f036c(0x19a)]===_0x2f036c(0x1a2))return console[_0x2f036c(0x1d7)](_0x2f036c(0x1c6)),console['error'](_0x2f036c(0x1dc)),0x1;if(!_0x5c5a35[_0x2f036c(0x1fa)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2f036c(0x1a8));const _0x41e32e=getConsoleNextUrl(_0xdd20ab[_0x2f036c(0x1ed)],_0x2f036c(0x1b2)+_0x5c5a35['parentId']+_0x2f036c(0x17e)+_0x5c5a35[_0x2f036c(0x1fa)]);return console[_0x2f036c(0x1d7)](a35_0x3ea970[_0x2f036c(0x1af)]('βœ”')+'\x20Opening\x20'+a35_0x3ea970[_0x2f036c(0x1f0)](_0x41e32e)),openBrowser(_0x41e32e),0x0;}if(_0x5c5a35[_0x2f036c(0x19a)]==='folder'){if(!_0x5c5a35['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x2f036c(0x17b));const _0x29d631=await withSpinner(_0x2f036c(0x18f),()=>_0x88c6e8['segment'][_0x2f036c(0x1f1)](_0x5c5a35['folderId']),{'verbose':_0xdd20ab[_0x2f036c(0x1ac)]});await handleSingleObjectOutput(_0x29d631[_0x2f036c(0x19e)],_0xdd20ab);}else{if(_0x5c5a35[_0x2f036c(0x19a)]==='segment'){if(!_0x5c5a35[_0x2f036c(0x1fa)])throw new SDKError(ErrorCode[_0x2f036c(0x171)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1eb59f=await withSpinner(_0x2f036c(0x203),()=>_0x88c6e8[_0x2f036c(0x1bf)]['getSegment'](_0x5c5a35[_0x2f036c(0x1db)],_0x5c5a35[_0x2f036c(0x1fa)]),{'verbose':_0xdd20ab['verbose']}),_0x2543fb=getConsoleNextUrl(_0xdd20ab['site'],'/app/ps/'+_0x5c5a35[_0x2f036c(0x1db)]+_0x2f036c(0x17e)+_0x5c5a35[_0x2f036c(0x1fa)]),_0xe0e76d=_0x1eb59f[_0x2f036c(0x19e)];_0xe0e76d[_0x2f036c(0x1e8)]=_0x2543fb,await handleSingleObjectOutput(_0xe0e76d,_0xdd20ab);}else return console[_0x2f036c(0x1d7)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x2f036c(0x1d7)](_0x2f036c(0x176)),0x1;}return 0x0;}catch(_0x61d7fa){if(_0x61d7fa instanceof SDKError)return console[_0x2f036c(0x1d7)](_0x2f036c(0x17a)+_0x61d7fa[_0x2f036c(0x1a6)]),_0x61d7fa[_0x2f036c(0x194)]&&console[_0x2f036c(0x1d7)](_0x2f036c(0x1e9)+_0x61d7fa[_0x2f036c(0x194)]),0x1;throw _0x61d7fa;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x131d30(0x189)]=a35_0x131d30(0x1c5);[a35_0x131d30(0x18a)]=a35_0x131d30(0x1d4);async[a35_0x131d30(0x1ab)](_0xd8c09c){const _0x581b57=a35_0x131d30,{options:_0x56b8fa,args:_0x21208a,tdx:_0x508d3d}=_0xd8c09c,_0x5180a3=_0x21208a[0x0];if(!_0x5180a3)return console[_0x581b57(0x1d7)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x581b57(0x1d7)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x581b57(0x181)),console[_0x581b57(0x1d7)](_0x581b57(0x1d1)),console[_0x581b57(0x1d7)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x581b57(0x1d7)](_0x581b57(0x174)),0x1;try{const _0x20e1de=_0x56b8fa[_0x581b57(0x1b1)],_0x54790b=await resolveSegmentTarget(_0x5180a3,_0x20e1de,_0x56b8fa['verbose']);_0x56b8fa[_0x581b57(0x1ac)]&&console[_0x581b57(0x1d7)](_0x581b57(0x1b8)+_0x54790b);const _0x481d42=await withSpinner(_0x581b57(0x1c9)+_0x5180a3+_0x581b57(0x195),()=>_0x508d3d[_0x581b57(0x1bf)][_0x581b57(0x184)](_0x54790b),{'verbose':_0x56b8fa[_0x581b57(0x1ac)]}),_0xca7c37=_0x481d42['data'];_0x56b8fa[_0x581b57(0x1ac)]&&(console[_0x581b57(0x1d7)](_0x581b57(0x18e)+_0xca7c37[_0x581b57(0x19a)]),console[_0x581b57(0x1d7)]('Parent\x20ID:\x20'+_0xca7c37[_0x581b57(0x1db)]));if(_0xca7c37[_0x581b57(0x19a)]==='folder')return console[_0x581b57(0x1d7)](_0x581b57(0x1d8)),console['error'](_0x581b57(0x16b)),0x1;if(_0xca7c37[_0x581b57(0x19a)]===_0x581b57(0x1a2))return console[_0x581b57(0x1d7)](_0x581b57(0x17d)),console['error'](_0x581b57(0x16f)),0x1;if(!_0xca7c37[_0x581b57(0x1fa)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x581b57(0x1a8));const _0x3b164b=await withSpinner(_0x581b57(0x1aa),()=>_0x508d3d[_0x581b57(0x1bf)][_0x581b57(0x17c)](_0xca7c37['parentId'],_0xca7c37[_0x581b57(0x1fa)]),{'verbose':_0x56b8fa[_0x581b57(0x1ac)]}),_0x31cb77=_0x3b164b[_0x581b57(0x19e)],_0x1f3742=await executeSchemaQuery(_0x31cb77,_0x508d3d,_0x56b8fa);return await handleQueryOutput(_0x1f3742,_0x56b8fa),0x0;}catch(_0x274610){if(_0x274610 instanceof SDKError)return console['error']('Error:\x20'+_0x274610[_0x581b57(0x1a6)]),_0x274610['cause']&&console[_0x581b57(0x1d7)](_0x581b57(0x1e9)+_0x274610[_0x581b57(0x194)]),0x1;throw _0x274610;}}}
@@ -1 +1 @@
1
- const a36_0x53ee5a=a36_0x1a1e;(function(_0x5bb4b3,_0x48c08f){const _0x25db14=a36_0x1a1e,_0x34c6dc=_0x5bb4b3();while(!![]){try{const _0x54b370=-parseInt(_0x25db14(0xb6))/0x1*(parseInt(_0x25db14(0xb4))/0x2)+-parseInt(_0x25db14(0xe3))/0x3*(-parseInt(_0x25db14(0xc2))/0x4)+parseInt(_0x25db14(0xce))/0x5*(parseInt(_0x25db14(0xc1))/0x6)+parseInt(_0x25db14(0xbe))/0x7+parseInt(_0x25db14(0xd5))/0x8*(parseInt(_0x25db14(0xc7))/0x9)+-parseInt(_0x25db14(0xc5))/0xa+-parseInt(_0x25db14(0xd2))/0xb*(parseInt(_0x25db14(0xc0))/0xc);if(_0x54b370===_0x48c08f)break;else _0x34c6dc['push'](_0x34c6dc['shift']());}catch(_0x101caa){_0x34c6dc['push'](_0x34c6dc['shift']());}}}(a36_0x50ad,0xc14ad));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a36_0x1a1e(_0x422c8c,_0x32eabb){_0x422c8c=_0x422c8c-0xaf;const _0x50ad17=a36_0x50ad();let _0x1a1e00=_0x50ad17[_0x422c8c];return _0x1a1e00;}function a36_0x50ad(){const _0x54b261=['Resolving\x20parent\x20segment\x20\x27','rule','type','includes','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Site:\x20','Resolving\x20folder\x20\x27','resolveFolderId','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','segment','66xtwBKV','description','44911QPxDxJ','verbose','Parent\x20path:\x20','Resolved\x20folder\x20ID:\x20','execute','Segment\x20name:\x20','folder','segment:create','10375918cqVSTE','invisible','4847124pjOCUE','7110318jXULrq','4756boBjiJ','Creating\x20segment\x20\x27','Resolving\x20folder\x20path\x20\x27','11155080inwQKf','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','8155089sXvEfe','ruleFile','resolveParentId','kind','segments','data','error','5ZECWyv','yellow','noCountPopulation','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','44iDDnoj','Parent:\x20','site','8Cfhtbo','length','Target\x20path:\x20','segmentPath','\x20\x20\x20Path:\x20','createSegment','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Examples:','resolvePathToResource','folderId','\x27...','name','parent','3612jsFmwA'];a36_0x50ad=function(){return _0x54b261;};return a36_0x50ad();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0xb9f341 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a36_0x53ee5a(0xbd);[a36_0x53ee5a(0xb5)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a36_0x53ee5a(0xba)](_0x487c11){const _0x4db653=a36_0x53ee5a;console[_0x4db653(0xcd)](a36_0xb9f341[_0x4db653(0xcf)](_0x4db653(0xb2))),console['error'](a36_0xb9f341[_0x4db653(0xcf)](_0x4db653(0xdb)));const {options:_0x4a87af,args:_0x44068b,tdx:_0x189bf7}=_0x487c11,_0x5a7cfc=_0x4a87af;if(_0x44068b[_0x4db653(0xd6)]===0x0)return console[_0x4db653(0xcd)](_0x4db653(0xe8)),console['error'](_0x4db653(0xdc)),console[_0x4db653(0xcd)](_0x4db653(0xdd)),console[_0x4db653(0xcd)](_0x4db653(0xd1)),console[_0x4db653(0xcd)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x4db653(0xcd)](_0x4db653(0xc6)),0x1;const _0x1d5007=_0x44068b[0x0],_0x5a811d=_0x4a87af[_0x4db653(0xd8)];let _0x4a1571=_0x1d5007;_0x5a811d&&!_0x1d5007[_0x4db653(0xe7)]('/')&&(_0x4a1571=_0x5a811d+'/'+_0x1d5007,_0x5a7cfc[_0x4db653(0xb7)]&&console[_0x4db653(0xcd)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4a1571));const _0x557405=parsePath(_0x4a1571);if(_0x557405['segments']['length']<0x2)return console[_0x4db653(0xcd)](_0x4db653(0xe9)),console[_0x4db653(0xcd)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x1c2da1=_0x557405[_0x4db653(0xcb)][0x0],_0x261b8a=getBaseName(_0x4a1571),_0x596b60=getParentPath(_0x4a1571);_0x5a7cfc[_0x4db653(0xb7)]&&(console[_0x4db653(0xcd)](_0x4db653(0xaf)+_0x5a7cfc[_0x4db653(0xd4)]),console[_0x4db653(0xcd)](_0x4db653(0xd7)+_0x4a1571),console[_0x4db653(0xcd)](_0x4db653(0xd3)+_0x1c2da1),console[_0x4db653(0xcd)](_0x4db653(0xbb)+_0x261b8a),console[_0x4db653(0xcd)](_0x4db653(0xb8)+_0x596b60));const _0x40d269=await withSpinner(_0x4db653(0xe4)+_0x1c2da1+_0x4db653(0xe0),()=>_0x189bf7[_0x4db653(0xb3)][_0x4db653(0xc9)](_0x1c2da1),{'verbose':_0x5a7cfc[_0x4db653(0xb7)]}),_0x56625c=_0x40d269[_0x4db653(0xcc)];let _0x5c0ba5;if(_0x557405['segments'][_0x4db653(0xd6)]>0x2){const _0x47e8b7=await withSpinner(_0x4db653(0xc4)+_0x596b60+_0x4db653(0xe0),()=>_0x189bf7[_0x4db653(0xb3)][_0x4db653(0xde)](_0x596b60),{'verbose':_0x5a7cfc[_0x4db653(0xb7)]}),_0x3781ac=_0x47e8b7[_0x4db653(0xcc)];if(_0x3781ac[_0x4db653(0xe6)]!=='folder'&&_0x3781ac[_0x4db653(0xe6)]!==_0x4db653(0xe2))return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x5c0ba5=_0x3781ac[_0x4db653(0xdf)];}else{if(_0x5a7cfc[_0x4db653(0xbc)]){const _0x191d63=await withSpinner(_0x4db653(0xb0)+_0x5a7cfc[_0x4db653(0xbc)]+_0x4db653(0xe0),()=>_0x189bf7[_0x4db653(0xb3)][_0x4db653(0xb1)](_0x56625c,_0x5a7cfc[_0x4db653(0xbc)]),{'verbose':_0x5a7cfc['verbose']});_0x5c0ba5=_0x191d63[_0x4db653(0xcc)];}}_0x5a7cfc[_0x4db653(0xb7)]&&_0x5c0ba5&&console[_0x4db653(0xcd)](_0x4db653(0xb9)+_0x5c0ba5);const _0x323964=await loadJSONFromOptions(_0x5a7cfc[_0x4db653(0xe5)],_0x5a7cfc[_0x4db653(0xc8)]),_0x2fd044={'name':_0x261b8a,'description':_0x5a7cfc[_0x4db653(0xb5)],'rule':_0x323964,'kind':_0x5a7cfc['kind']!==undefined?parseInt(_0x5a7cfc[_0x4db653(0xca)],0xa):undefined,'isVisible':_0x5a7cfc[_0x4db653(0xbf)]?![]:undefined,'segmentFolderId':_0x5c0ba5,'countPopulation':_0x5a7cfc[_0x4db653(0xd0)]?![]:undefined},_0x4320d5=await withSpinner(_0x4db653(0xc3)+_0x261b8a+_0x4db653(0xe0),()=>_0x189bf7[_0x4db653(0xb3)][_0x4db653(0xda)](_0x56625c,_0x2fd044),{'verbose':_0x5a7cfc['verbose']}),_0xf8408c=_0x4320d5[_0x4db653(0xcc)];return console[_0x4db653(0xcd)]('βœ”\x20Created\x20segment\x20\x27'+_0xf8408c[_0x4db653(0xe1)]+'\x27\x20with\x20ID:\x20'+_0xf8408c['id']),_0x4a1571!==_0x1d5007&&console[_0x4db653(0xcd)](_0x4db653(0xd9)+_0x4a1571),await handleSDKOutput([_0xf8408c],_0x5a7cfc),0x0;}}
1
+ const a36_0x2b47db=a36_0x28e5;function a36_0x28e5(_0x41ed2d,_0x3062f9){_0x41ed2d=_0x41ed2d-0xd4;const _0x4b86b8=a36_0x4b86();let _0x28e56b=_0x4b86b8[_0x41ed2d];return _0x28e56b;}(function(_0x39b562,_0xa299b2){const _0x4f25a7=a36_0x28e5,_0x5b01f0=_0x39b562();while(!![]){try{const _0x36085a=parseInt(_0x4f25a7(0xf1))/0x1*(parseInt(_0x4f25a7(0x10a))/0x2)+parseInt(_0x4f25a7(0x106))/0x3+parseInt(_0x4f25a7(0xeb))/0x4*(-parseInt(_0x4f25a7(0xe1))/0x5)+-parseInt(_0x4f25a7(0xd7))/0x6*(parseInt(_0x4f25a7(0xfa))/0x7)+parseInt(_0x4f25a7(0xd4))/0x8+-parseInt(_0x4f25a7(0x108))/0x9*(-parseInt(_0x4f25a7(0xf6))/0xa)+-parseInt(_0x4f25a7(0x103))/0xb*(-parseInt(_0x4f25a7(0x10b))/0xc);if(_0x36085a===_0xa299b2)break;else _0x5b01f0['push'](_0x5b01f0['shift']());}catch(_0x2a27aa){_0x5b01f0['push'](_0x5b01f0['shift']());}}}(a36_0x4b86,0xbe0e6));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a36_0x4b86(){const _0x4da074=['42662ISgjBL','12WoFeat','segment:create','segments','site','7961544ZGYbNZ','length','Target\x20path:\x20','6bDDzTh','resolveParentId','\x27...','Segment\x20name:\x20','verbose','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Parent:\x20','Resolving\x20parent\x20segment\x20\x27','parent','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','1895fckFpF','Resolved\x20relative\x20path\x20to:\x20','yellow','Parent\x20path:\x20','resolvePathToResource','folderId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folder','segment','noCountPopulation','15468VoqUVP','error','resolveFolderId','type','βœ”\x20Created\x20segment\x20\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules','19emFvnj','description','Site:\x20','\x27\x20with\x20ID:\x20','segmentPath','2210cJMLkK','data','rule','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','10346329MeLqUQ','ruleFile','invisible','kind','\x20\x20\x20Path:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Creating\x20segment\x20\x27','Resolving\x20folder\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','5023084eekYhp','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','name','3188925VyIqXP','Resolved\x20folder\x20ID:\x20','32661RURtaP','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'];a36_0x4b86=function(){return _0x4da074;};return a36_0x4b86();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0x52f463 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x2b47db(0x105)]=a36_0x2b47db(0x10c);[a36_0x2b47db(0xf2)]=a36_0x2b47db(0xf0);async['execute'](_0x54b801){const _0x2e72ae=a36_0x2b47db;console['error'](a36_0x52f463[_0x2e72ae(0xe3)](_0x2e72ae(0x104))),console[_0x2e72ae(0xec)](a36_0x52f463[_0x2e72ae(0xe3)](_0x2e72ae(0xff)));const {options:_0x5edeeb,args:_0x5dd515,tdx:_0x4b981a}=_0x54b801,_0x707d91=_0x5edeeb;if(_0x5dd515[_0x2e72ae(0xd5)]===0x0)return console[_0x2e72ae(0xec)](_0x2e72ae(0xe7)),console[_0x2e72ae(0xec)](_0x2e72ae(0xe0)),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x2e72ae(0xec)](_0x2e72ae(0x109)),console['error'](_0x2e72ae(0x102)),0x1;const _0x468da5=_0x5dd515[0x0],_0x332a2f=_0x5edeeb[_0x2e72ae(0xf5)];let _0x319c30=_0x468da5;_0x332a2f&&!_0x468da5['includes']('/')&&(_0x319c30=_0x332a2f+'/'+_0x468da5,_0x707d91['verbose']&&console[_0x2e72ae(0xec)](_0x2e72ae(0xe2)+_0x319c30));const _0xe57639=parsePath(_0x319c30);if(_0xe57639['segments'][_0x2e72ae(0xd5)]<0x2)return console[_0x2e72ae(0xec)](_0x2e72ae(0xdc)),console[_0x2e72ae(0xec)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x3e5b16=_0xe57639[_0x2e72ae(0x10d)][0x0],_0x12ec3d=getBaseName(_0x319c30),_0x56e319=getParentPath(_0x319c30);_0x707d91[_0x2e72ae(0xdb)]&&(console[_0x2e72ae(0xec)](_0x2e72ae(0xf3)+_0x707d91[_0x2e72ae(0x10e)]),console[_0x2e72ae(0xec)](_0x2e72ae(0xd6)+_0x319c30),console[_0x2e72ae(0xec)](_0x2e72ae(0xdd)+_0x3e5b16),console['error'](_0x2e72ae(0xda)+_0x12ec3d),console[_0x2e72ae(0xec)](_0x2e72ae(0xe4)+_0x56e319));const _0x2bfa0f=await withSpinner(_0x2e72ae(0xde)+_0x3e5b16+'\x27...',()=>_0x4b981a[_0x2e72ae(0xe9)][_0x2e72ae(0xd8)](_0x3e5b16),{'verbose':_0x707d91['verbose']}),_0x285cbf=_0x2bfa0f[_0x2e72ae(0xf7)];let _0x434487;if(_0xe57639[_0x2e72ae(0x10d)][_0x2e72ae(0xd5)]>0x2){const _0x19b537=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x56e319+'\x27...',()=>_0x4b981a[_0x2e72ae(0xe9)][_0x2e72ae(0xe5)](_0x56e319),{'verbose':_0x707d91[_0x2e72ae(0xdb)]}),_0x34e8a6=_0x19b537[_0x2e72ae(0xf7)];if(_0x34e8a6[_0x2e72ae(0xee)]!==_0x2e72ae(0xe8)&&_0x34e8a6[_0x2e72ae(0xee)]!==_0x2e72ae(0xdf))return console[_0x2e72ae(0xec)](_0x2e72ae(0xf9)),0x1;_0x434487=_0x34e8a6[_0x2e72ae(0xe6)];}else{if(_0x707d91[_0x2e72ae(0xe8)]){const _0xaa9497=await withSpinner(_0x2e72ae(0x101)+_0x707d91['folder']+_0x2e72ae(0xd9),()=>_0x4b981a[_0x2e72ae(0xe9)][_0x2e72ae(0xed)](_0x285cbf,_0x707d91[_0x2e72ae(0xe8)]),{'verbose':_0x707d91[_0x2e72ae(0xdb)]});_0x434487=_0xaa9497[_0x2e72ae(0xf7)];}}_0x707d91[_0x2e72ae(0xdb)]&&_0x434487&&console[_0x2e72ae(0xec)](_0x2e72ae(0x107)+_0x434487);const _0x4fcb33=await loadJSONFromOptions(_0x707d91[_0x2e72ae(0xf8)],_0x707d91[_0x2e72ae(0xfb)]),_0x33ecb0={'name':_0x12ec3d,'description':_0x707d91[_0x2e72ae(0xf2)],'rule':_0x4fcb33,'kind':_0x707d91[_0x2e72ae(0xfd)]!==undefined?parseInt(_0x707d91['kind'],0xa):undefined,'isVisible':_0x707d91[_0x2e72ae(0xfc)]?![]:undefined,'segmentFolderId':_0x434487,'countPopulation':_0x707d91[_0x2e72ae(0xea)]?![]:undefined},_0x11fab9=await withSpinner(_0x2e72ae(0x100)+_0x12ec3d+_0x2e72ae(0xd9),()=>_0x4b981a[_0x2e72ae(0xe9)]['createSegment'](_0x285cbf,_0x33ecb0),{'verbose':_0x707d91[_0x2e72ae(0xdb)]}),_0x3c7e43=_0x11fab9['data'];return console[_0x2e72ae(0xec)](_0x2e72ae(0xef)+_0x3c7e43[_0x2e72ae(0x105)]+_0x2e72ae(0xf4)+_0x3c7e43['id']),_0x319c30!==_0x468da5&&console[_0x2e72ae(0xec)](_0x2e72ae(0xfe)+_0x319c30),await handleSDKOutput([_0x3c7e43],_0x707d91),0x0;}}
@@ -1 +1 @@
1
- const a37_0x156623=a37_0x5027;(function(_0x2aa432,_0x448970){const _0x464497=a37_0x5027,_0x4a3290=_0x2aa432();while(!![]){try{const _0x2e0953=-parseInt(_0x464497(0x104))/0x1*(-parseInt(_0x464497(0x10d))/0x2)+-parseInt(_0x464497(0x113))/0x3+parseInt(_0x464497(0x121))/0x4+parseInt(_0x464497(0x10a))/0x5*(parseInt(_0x464497(0x111))/0x6)+parseInt(_0x464497(0x110))/0x7+-parseInt(_0x464497(0x112))/0x8+-parseInt(_0x464497(0x109))/0x9*(parseInt(_0x464497(0x11c))/0xa);if(_0x2e0953===_0x448970)break;else _0x4a3290['push'](_0x4a3290['shift']());}catch(_0x33df40){_0x4a3290['push'](_0x4a3290['shift']());}}}(a37_0x35f0,0xe7d6f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a37_0x35f0(){const _0x802d25=['\x27...','Parent\x20segment:\x20','2uXqCpz','length','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','12164292gHftcd','6738954TjrncA','8782360ujAucq','3258339lSojal','\x20field','data','name','error','Error:\x20Parent\x20segment\x20name\x20is\x20required','listFields','Listing\x20fields\x20for\x20\x27','verbose','70780XooYao','description','Site:\x20','parentSegment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','5410796taNRdA','site','859281wqJUSf','List\x20available\x20fields\x20for\x20segmentation','βœ”\x20Found\x20','jsonl','segment:fields','2466NQtZBX','5agNNmV'];a37_0x35f0=function(){return _0x802d25;};return a37_0x35f0();}function a37_0x5027(_0x84f323,_0x198196){_0x84f323=_0x84f323-0x104;const _0x35f070=a37_0x35f0();let _0x502778=_0x35f070[_0x84f323];return _0x502778;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a37_0x156623(0x116)]=a37_0x156623(0x108);[a37_0x156623(0x11d)]=a37_0x156623(0x105);async['execute'](_0xe4dd87){const _0xae7721=a37_0x156623,{options:_0x997b5,args:_0x376249,tdx:_0x237a24}=_0xe4dd87,_0x40d46a=_0x376249[0x0]||_0x997b5[_0xae7721(0x11f)];if(!_0x40d46a)return console[_0xae7721(0x117)](_0xae7721(0x118)),console[_0xae7721(0x117)](_0xae7721(0x10f)),console['error'](_0xae7721(0x120)),0x1;_0x997b5[_0xae7721(0x11b)]&&(console[_0xae7721(0x117)](_0xae7721(0x11e)+_0x997b5[_0xae7721(0x122)]),console[_0xae7721(0x117)](_0xae7721(0x10c)+_0x40d46a));const _0x298e80=await withSpinner(_0xae7721(0x11a)+_0x40d46a+_0xae7721(0x10b),()=>_0x237a24['segment'][_0xae7721(0x119)](_0x40d46a),{'verbose':_0x997b5[_0xae7721(0x11b)]}),_0xf8e003=_0x298e80[_0xae7721(0x115)];console['error'](_0xae7721(0x106)+_0xf8e003[_0xae7721(0x10e)]+_0xae7721(0x114)+(_0xf8e003[_0xae7721(0x10e)]!==0x1?'s':''));if(_0x997b5['json']||_0x997b5[_0xae7721(0x107)])return await handleSDKOutput(_0xf8e003,_0x997b5),0x0;return displayFieldsHumanReadable(_0xf8e003,_0x40d46a),0x0;}}
1
+ const a37_0x4631d7=a37_0x32a8;(function(_0x54d9df,_0x4806fa){const _0x4c20a6=a37_0x32a8,_0x3a1915=_0x54d9df();while(!![]){try{const _0x411296=-parseInt(_0x4c20a6(0x112))/0x1+parseInt(_0x4c20a6(0x113))/0x2+parseInt(_0x4c20a6(0x12a))/0x3+parseInt(_0x4c20a6(0x11e))/0x4+parseInt(_0x4c20a6(0x111))/0x5*(parseInt(_0x4c20a6(0x11c))/0x6)+parseInt(_0x4c20a6(0x11d))/0x7*(-parseInt(_0x4c20a6(0x115))/0x8)+-parseInt(_0x4c20a6(0x124))/0x9*(-parseInt(_0x4c20a6(0x118))/0xa);if(_0x411296===_0x4806fa)break;else _0x3a1915['push'](_0x3a1915['shift']());}catch(_0x45b431){_0x3a1915['push'](_0x3a1915['shift']());}}}(a37_0x1296,0x18b1f));function a37_0x1296(){const _0x2f5209=['Listing\x20fields\x20for\x20\x27','24pPGWsy','json','List\x20available\x20fields\x20for\x20segmentation','10xPvrEF','verbose','description','segment:fields','73122ITJzMv','349433xYJOcX','532504IBfGMy','length','jsonl','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','βœ”\x20Found\x20','listFields','362601RpXqak','parentSegment','execute','Site:\x20','site','data','328002hUGyTk','name','error','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Parent\x20segment\x20name\x20is\x20required','20UvvwLN','155647PDSimj','150116mHgzMd'];a37_0x1296=function(){return _0x2f5209;};return a37_0x1296();}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';function a37_0x32a8(_0x3ea0f9,_0x29a69e){_0x3ea0f9=_0x3ea0f9-0x10e;const _0x129668=a37_0x1296();let _0x32a8ae=_0x129668[_0x3ea0f9];return _0x32a8ae;}export class SegmentFieldsCommand extends BaseCommand{[a37_0x4631d7(0x12b)]=a37_0x4631d7(0x11b);[a37_0x4631d7(0x11a)]=a37_0x4631d7(0x117);async[a37_0x4631d7(0x126)](_0x394c83){const _0x4df8f7=a37_0x4631d7,{options:_0x3b9a56,args:_0x35c288,tdx:_0x387b33}=_0x394c83,_0x192008=_0x35c288[0x0]||_0x3b9a56[_0x4df8f7(0x125)];if(!_0x192008)return console[_0x4df8f7(0x10e)](_0x4df8f7(0x110)),console[_0x4df8f7(0x10e)](_0x4df8f7(0x121)),console[_0x4df8f7(0x10e)](_0x4df8f7(0x10f)),0x1;_0x3b9a56[_0x4df8f7(0x119)]&&(console[_0x4df8f7(0x10e)](_0x4df8f7(0x127)+_0x3b9a56[_0x4df8f7(0x128)]),console['error']('Parent\x20segment:\x20'+_0x192008));const _0xfdc1ab=await withSpinner(_0x4df8f7(0x114)+_0x192008+'\x27...',()=>_0x387b33['segment'][_0x4df8f7(0x123)](_0x192008),{'verbose':_0x3b9a56[_0x4df8f7(0x119)]}),_0xda8485=_0xfdc1ab[_0x4df8f7(0x129)];console[_0x4df8f7(0x10e)](_0x4df8f7(0x122)+_0xda8485[_0x4df8f7(0x11f)]+'\x20field'+(_0xda8485[_0x4df8f7(0x11f)]!==0x1?'s':''));if(_0x3b9a56[_0x4df8f7(0x116)]||_0x3b9a56[_0x4df8f7(0x120)])return await handleSDKOutput(_0xda8485,_0x3b9a56),0x0;return displayFieldsHumanReadable(_0xda8485,_0x192008),0x0;}}
@@ -1 +1 @@
1
- const a38_0x4d3b1f=a38_0xb1bb;(function(_0x16e3b3,_0x31bb31){const _0x6d9cd8=a38_0xb1bb,_0x12513f=_0x16e3b3();while(!![]){try{const _0x157650=parseInt(_0x6d9cd8(0x1e8))/0x1*(-parseInt(_0x6d9cd8(0x1ec))/0x2)+-parseInt(_0x6d9cd8(0x1e0))/0x3*(parseInt(_0x6d9cd8(0x20c))/0x4)+-parseInt(_0x6d9cd8(0x1fc))/0x5*(parseInt(_0x6d9cd8(0x202))/0x6)+-parseInt(_0x6d9cd8(0x207))/0x7*(-parseInt(_0x6d9cd8(0x1f0))/0x8)+-parseInt(_0x6d9cd8(0x216))/0x9*(parseInt(_0x6d9cd8(0x21a))/0xa)+-parseInt(_0x6d9cd8(0x1c9))/0xb+-parseInt(_0x6d9cd8(0x1f9))/0xc*(-parseInt(_0x6d9cd8(0x21b))/0xd);if(_0x157650===_0x31bb31)break;else _0x12513f['push'](_0x12513f['shift']());}catch(_0x4e3d93){_0x12513f['push'](_0x12513f['shift']());}}}(a38_0x1d48,0x6b07e));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a38_0x3af7d2 from'chalk';function a38_0x1d48(){const _0x4ffce6=['\x0aPull\x20summary\x20for\x20\x27','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20unchanged\x20files','3085810vFzSJc','13Xtiaoo','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dryRun','files','1351889zXadAD','red','Site:\x20','segments','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','session','error','\x27...','targetDir','repeat','site','dirname','file','\x20files?','message','execute','Pulling\x20segments\x20from\x20\x27','resourceName','relativePath','Aborted.','name','\x20journeys','segment:pull','5949vfHhIg','green','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','\x0aError:','\x20activations','\x20changed\x20files','segment','438106rISGzW','yellow','\x20\x20🎯\x20','\x20=\x20','4dLXSDD','counts','activations','type','2123344RMGqMz','journeys','absolutePath','data','\x20\x20πŸ—ΊοΈ\x20\x20','\x0aChanges\x20to\x20\x27','parent_segment','hasChanges','yes','27418548cTEEuV','cyan','no_parent','15EmWRyC','\x20with\x20','Write\x20','\x20segments','length','content','18048AyuUls','helpText','\x20\x20Target:\x20','setPhase','isNew','7PmVaeG','Parent\x20segment:\x20','filter','pullSegments','Error:\x20','1604gwxxEb','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journeyVersions','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','diff','errorCode','parentSegment','Target\x20resource:\x20','parentName','verbose','9uRCunC'];a38_0x1d48=function(){return _0x4ffce6;};return a38_0x1d48();}import{existsSync,mkdirSync,writeFileSync}from'fs';function a38_0xb1bb(_0x3c657c,_0x3ff6fa){_0x3c657c=_0x3c657c-0x1c6;const _0x1d48cd=a38_0x1d48();let _0xb1bbd9=_0x1d48cd[_0x3c657c];return _0xb1bbd9;}import a38_0x553518 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a38_0x4d3b1f(0x1dd)]=a38_0x4d3b1f(0x1df);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a38_0x4d3b1f(0x1d8)](_0x47f914){const _0x584dbf=a38_0x4d3b1f,{options:_0x40d080,args:_0xbe5f77,tdx:_0x5ca24d}=_0x47f914,_0x4ce712=_0x40d080,_0x2b2990=await resolveTarget({'arg':_0xbe5f77[0x0],'contextParent':_0x40d080[_0x584dbf(0x212)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x2b2990))return _0x2b2990[_0x584dbf(0x211)]===_0x584dbf(0x1fb)?(console[_0x584dbf(0x1cf)](a38_0x3af7d2[_0x584dbf(0x1e9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x584dbf(0x1cf)](_0x584dbf(0x20f))):(console['error'](a38_0x3af7d2[_0x584dbf(0x1ca)](_0x584dbf(0x20b)+_0x2b2990[_0x584dbf(0x1d7)]+'\x0a')),_0x2b2990[_0x584dbf(0x203)]&&console['error'](a38_0x3af7d2['cyan'](_0x2b2990['helpText']))),0x1;const _0x3f8a0e=_0x2b2990[_0x584dbf(0x214)],_0x39ebd9=_0x2b2990[_0x584dbf(0x1d1)],_0x137882=_0x2b2990[_0x584dbf(0x1ef)]===_0x584dbf(0x1d5)?_0x2b2990[_0x584dbf(0x1da)]:undefined;_0x4ce712[_0x584dbf(0x215)]&&(console[_0x584dbf(0x1cf)](_0x584dbf(0x1cb)+_0x4ce712[_0x584dbf(0x1d3)]),console[_0x584dbf(0x1cf)](_0x584dbf(0x208)+_0x3f8a0e),_0x137882&&console[_0x584dbf(0x1cf)](_0x584dbf(0x213)+_0x137882));const _0x485ddd=await withProgressSpinner(_0x584dbf(0x1d9)+_0x3f8a0e+_0x584dbf(0x1d0),_0x53846c=>_0x5ca24d[_0x584dbf(0x1e7)][_0x584dbf(0x20a)](_0x3f8a0e,{'targetDir':_0x39ebd9,'targetResourceName':_0x137882,'verbose':_0x4ce712[_0x584dbf(0x215)],'progress':{'update':_0x45ab98=>{const _0x19060b=_0x584dbf;_0x53846c[_0x19060b(0x205)](_0x45ab98),_0x4ce712['verbose']&&console[_0x19060b(0x1cf)]('\x20\x20'+_0x45ab98);}}}),{'verbose':_0x4ce712[_0x584dbf(0x215)]}),_0x37b4f6=_0x485ddd[_0x584dbf(0x1f3)];if(_0x37b4f6[_0x584dbf(0x1ed)][_0x584dbf(0x1cc)]===0x0&&_0x37b4f6['counts']['journeys']===0x0)return console[_0x584dbf(0x1cf)](a38_0x3af7d2[_0x584dbf(0x1e9)](_0x584dbf(0x218)+_0x37b4f6[_0x584dbf(0x214)]+'\x27')),0x0;const _0x2fb4d9=_0x37b4f6[_0x584dbf(0x1c8)][_0x584dbf(0x209)](_0x323d8a=>_0x323d8a[_0x584dbf(0x206)]),_0x1dc463=_0x37b4f6[_0x584dbf(0x1c8)][_0x584dbf(0x209)](_0x3b4ce0=>!_0x3b4ce0[_0x584dbf(0x206)]&&_0x3b4ce0[_0x584dbf(0x1f7)]),_0x2d86c7=_0x37b4f6['files'][_0x584dbf(0x209)](_0x3eb1fc=>!_0x3eb1fc[_0x584dbf(0x206)]&&!_0x3eb1fc[_0x584dbf(0x1f7)]);console[_0x584dbf(0x1cf)](_0x584dbf(0x217)+_0x37b4f6['parentName']+'\x27:'),console[_0x584dbf(0x1cf)](_0x584dbf(0x1ea)+a38_0x3af7d2['cyan'](_0x37b4f6[_0x584dbf(0x1ed)][_0x584dbf(0x1cc)]+_0x584dbf(0x1ff))+_0x584dbf(0x1fd)+a38_0x3af7d2[_0x584dbf(0x1fa)](_0x37b4f6['counts'][_0x584dbf(0x1ee)]+_0x584dbf(0x1e5)));if(_0x37b4f6['counts']['journeys']>0x0){const _0x2211c1=_0x37b4f6[_0x584dbf(0x1ed)][_0x584dbf(0x20e)]>_0x37b4f6['counts'][_0x584dbf(0x1f1)]?'\x20('+_0x37b4f6[_0x584dbf(0x1ed)][_0x584dbf(0x20e)]+'\x20versions)':'';console['error'](_0x584dbf(0x1f4)+a38_0x3af7d2[_0x584dbf(0x1fa)](_0x37b4f6['counts']['journeys']+_0x584dbf(0x1de))+a38_0x3af7d2[_0x584dbf(0x1e3)](_0x2211c1));}console['error']('\x20\x20'+a38_0x3af7d2['green']('+\x20'+_0x2fb4d9[_0x584dbf(0x200)]+'\x20new\x20files')),console[_0x584dbf(0x1cf)]('\x20\x20'+a38_0x3af7d2[_0x584dbf(0x1e9)]('~\x20'+_0x1dc463[_0x584dbf(0x200)]+_0x584dbf(0x1e6))),console[_0x584dbf(0x1cf)]('\x20\x20'+a38_0x3af7d2[_0x584dbf(0x1e3)]('=\x20'+_0x2d86c7[_0x584dbf(0x200)]+_0x584dbf(0x219))),console[_0x584dbf(0x1cf)](_0x584dbf(0x204)+a38_0x3af7d2['cyan'](_0x37b4f6[_0x584dbf(0x1d1)])+'\x0a');if(_0x1dc463[_0x584dbf(0x200)]>0x0)for(const _0x32e95e of _0x1dc463){console[_0x584dbf(0x1cf)](_0x584dbf(0x1f5)+_0x32e95e[_0x584dbf(0x1db)]+'\x27:'),console[_0x584dbf(0x1cf)]('─'[_0x584dbf(0x1d2)](0x3c)),console['error'](_0x32e95e[_0x584dbf(0x210)]),console[_0x584dbf(0x1cf)]('─'[_0x584dbf(0x1d2)](0x3c));}if(_0x4ce712[_0x584dbf(0x1c7)])return console['error'](a38_0x3af7d2['yellow'](_0x584dbf(0x1e2))),0x0;if(_0x2fb4d9['length']===0x0&&_0x1dc463[_0x584dbf(0x200)]===0x0)return console[_0x584dbf(0x1cf)](a38_0x3af7d2['green'](_0x584dbf(0x1cd))),saveSessionContext({'parent_segment':_0x37b4f6[_0x584dbf(0x214)]},_0x4ce712[_0x584dbf(0x1ce)]),console[_0x584dbf(0x1cf)](a38_0x3af7d2[_0x584dbf(0x1e1)]('βœ”\x20Context\x20set:\x20'+a38_0x3af7d2[_0x584dbf(0x1e3)](_0x584dbf(0x1f6))+_0x584dbf(0x1eb)+a38_0x3af7d2[_0x584dbf(0x1fa)](_0x37b4f6[_0x584dbf(0x214)]))),0x0;if(!_0x4ce712[_0x584dbf(0x1f8)]){if(!isInteractive())return console[_0x584dbf(0x1cf)](a38_0x3af7d2[_0x584dbf(0x1ca)](_0x584dbf(0x1e4)),_0x584dbf(0x1c6)),console[_0x584dbf(0x1cf)](a38_0x3af7d2[_0x584dbf(0x1e3)](_0x584dbf(0x20d))),0x1;const _0xa24ed6=await confirmKey(_0x584dbf(0x1fe)+(_0x2fb4d9[_0x584dbf(0x200)]+_0x1dc463[_0x584dbf(0x200)])+_0x584dbf(0x1d6));if(!_0xa24ed6)return console[_0x584dbf(0x1cf)](a38_0x3af7d2['yellow'](_0x584dbf(0x1dc)),'-\x20no\x20files\x20written'),0x1;}for(const _0x1a3cb0 of _0x37b4f6[_0x584dbf(0x1c8)]){if(_0x1a3cb0[_0x584dbf(0x206)]||_0x1a3cb0[_0x584dbf(0x1f7)]){const _0x2c82fb=a38_0x553518[_0x584dbf(0x1d4)](_0x1a3cb0[_0x584dbf(0x1f2)]);!existsSync(_0x2c82fb)&&mkdirSync(_0x2c82fb,{'recursive':!![]}),writeFileSync(_0x1a3cb0[_0x584dbf(0x1f2)],_0x1a3cb0[_0x584dbf(0x201)],'utf-8');}}return console['error'](a38_0x3af7d2[_0x584dbf(0x1e1)]('βœ”\x20Pulled\x20'+(_0x2fb4d9[_0x584dbf(0x200)]+_0x1dc463[_0x584dbf(0x200)])+'\x20files\x20to\x20'+_0x37b4f6[_0x584dbf(0x1d1)])),saveSessionContext({'parent_segment':_0x37b4f6['parentName']},_0x4ce712[_0x584dbf(0x1ce)]),console[_0x584dbf(0x1cf)](a38_0x3af7d2[_0x584dbf(0x1e1)]('βœ”\x20Context\x20set:\x20'+a38_0x3af7d2[_0x584dbf(0x1e3)](_0x584dbf(0x1f6))+_0x584dbf(0x1eb)+a38_0x3af7d2[_0x584dbf(0x1fa)](_0x37b4f6[_0x584dbf(0x214)]))),0x0;}}
1
+ const a38_0x13ef2c=a38_0x4b63;(function(_0x55193e,_0x467d2d){const _0x2e7fbf=a38_0x4b63,_0x2a5a20=_0x55193e();while(!![]){try{const _0x1df11c=-parseInt(_0x2e7fbf(0xce))/0x1*(-parseInt(_0x2e7fbf(0xf5))/0x2)+-parseInt(_0x2e7fbf(0x10a))/0x3+parseInt(_0x2e7fbf(0xe0))/0x4*(-parseInt(_0x2e7fbf(0xf7))/0x5)+-parseInt(_0x2e7fbf(0xd7))/0x6*(parseInt(_0x2e7fbf(0xc9))/0x7)+-parseInt(_0x2e7fbf(0xde))/0x8+-parseInt(_0x2e7fbf(0xc6))/0x9*(parseInt(_0x2e7fbf(0xf6))/0xa)+parseInt(_0x2e7fbf(0xfb))/0xb*(parseInt(_0x2e7fbf(0xbf))/0xc);if(_0x1df11c===_0x467d2d)break;else _0x2a5a20['push'](_0x2a5a20['shift']());}catch(_0x51a4e8){_0x2a5a20['push'](_0x2a5a20['shift']());}}}(a38_0x1514,0x46f88));import{BaseCommand}from'./command.js';function a38_0x4b63(_0xfb5465,_0x2c3797){_0xfb5465=_0xfb5465-0xba;const _0x1514d9=a38_0x1514();let _0x4b63c1=_0x1514d9[_0xfb5465];return _0x4b63c1;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a38_0x304319 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x5e72f3 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a38_0x1514(){const _0xdf8671=['\x20changed\x20files','session','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','-\x20no\x20files\x20written','\x20\x20πŸ—ΊοΈ\x20\x20','\x20unchanged\x20files','90hTuXTV','yes','\x20files\x20to\x20','\x20activations','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','3498312MRNRLg','dryRun','1143940QHoVMg','\x20\x20🎯\x20','filter','parent_segment','repeat','dim','verbose','error','\x20\x20Target:\x20','activations','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','\x20versions)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment:pull','\x20files?','message','utf-8','\x0aPull\x20summary\x20for\x20\x27','Parent\x20segment:\x20','helpText','yellow','4IBoznz','1608290vhcpXV','5gVjmwx','red','\x20journeys','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)','44iuslwA','cyan','parentName','resourceName','green','segments','\x20with\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Aborted.','journeyVersions','no_parent','errorCode','execute','\x0aChanges\x20to\x20\x27','relativePath','80409IBNXrQ','Pulling\x20segments\x20from\x20\x27','targetDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Target\x20resource:\x20','length','3647964owudIB','journeys','diff','name','\x0aError:','βœ”\x20Context\x20set:\x20','βœ”\x20Pulled\x20','9wQNAZK','isNew','hasChanges','84014BUqjtK','Site:\x20','absolutePath','data','files','82822CIdRMG','counts'];a38_0x1514=function(){return _0xdf8671;};return a38_0x1514();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a38_0x13ef2c(0xc2)]=a38_0x13ef2c(0xed);['description']=a38_0x13ef2c(0xdd);async[a38_0x13ef2c(0x107)](_0x8ab0b3){const _0x56de2c=a38_0x13ef2c,{options:_0x492a9e,args:_0xa98b53,tdx:_0x5a3dcf}=_0x8ab0b3,_0x9bdd8c=_0x492a9e,_0x59422d=await resolveTarget({'arg':_0xa98b53[0x0],'contextParent':_0x492a9e['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x59422d))return _0x59422d[_0x56de2c(0x106)]===_0x56de2c(0x105)?(console[_0x56de2c(0xe7)](a38_0x304319[_0x56de2c(0xf4)](_0x56de2c(0xd3))),console[_0x56de2c(0xe7)](_0x56de2c(0xfa)),console[_0x56de2c(0xe7)](_0x56de2c(0xdc)),console[_0x56de2c(0xe7)](_0x56de2c(0xbc))):(console[_0x56de2c(0xe7)](a38_0x304319['red'](_0x56de2c(0xdb)+_0x59422d[_0x56de2c(0xef)]+'\x0a')),_0x59422d[_0x56de2c(0xf3)]&&console[_0x56de2c(0xe7)](a38_0x304319[_0x56de2c(0xfc)](_0x59422d[_0x56de2c(0xf3)]))),0x1;const _0x2134e3=_0x59422d['parentName'],_0x18bba1=_0x59422d['targetDir'],_0x42686d=_0x59422d['type']==='file'?_0x59422d[_0x56de2c(0xfe)]:undefined;_0x9bdd8c[_0x56de2c(0xe6)]&&(console[_0x56de2c(0xe7)](_0x56de2c(0xca)+_0x9bdd8c['site']),console[_0x56de2c(0xe7)](_0x56de2c(0xf2)+_0x2134e3),_0x42686d&&console['error'](_0x56de2c(0xbd)+_0x42686d));const _0x4f1352=await withProgressSpinner(_0x56de2c(0xba)+_0x2134e3+'\x27...',_0x2306ba=>_0x5a3dcf['segment']['pullSegments'](_0x2134e3,{'targetDir':_0x18bba1,'targetResourceName':_0x42686d,'verbose':_0x9bdd8c['verbose'],'progress':{'update':_0x2c76ef=>{const _0x5d9d33=_0x56de2c;_0x2306ba['setPhase'](_0x2c76ef),_0x9bdd8c[_0x5d9d33(0xe6)]&&console[_0x5d9d33(0xe7)]('\x20\x20'+_0x2c76ef);}}}),{'verbose':_0x9bdd8c[_0x56de2c(0xe6)]}),_0x29d972=_0x4f1352[_0x56de2c(0xcc)];if(_0x29d972[_0x56de2c(0xcf)][_0x56de2c(0x100)]===0x0&&_0x29d972[_0x56de2c(0xcf)][_0x56de2c(0xc0)]===0x0)return console[_0x56de2c(0xe7)](a38_0x304319[_0x56de2c(0xf4)](_0x56de2c(0x102)+_0x29d972[_0x56de2c(0xfd)]+'\x27')),0x0;const _0x494879=_0x29d972[_0x56de2c(0xcd)][_0x56de2c(0xe2)](_0x40746b=>_0x40746b[_0x56de2c(0xc7)]),_0x446f23=_0x29d972[_0x56de2c(0xcd)][_0x56de2c(0xe2)](_0x2b7479=>!_0x2b7479[_0x56de2c(0xc7)]&&_0x2b7479['hasChanges']),_0x20f9b2=_0x29d972[_0x56de2c(0xcd)][_0x56de2c(0xe2)](_0xf9f25d=>!_0xf9f25d[_0x56de2c(0xc7)]&&!_0xf9f25d[_0x56de2c(0xc8)]);console['error'](_0x56de2c(0xf1)+_0x29d972['parentName']+'\x27:'),console[_0x56de2c(0xe7)](_0x56de2c(0xe1)+a38_0x304319[_0x56de2c(0xfc)](_0x29d972['counts'][_0x56de2c(0x100)]+'\x20segments')+_0x56de2c(0x101)+a38_0x304319[_0x56de2c(0xfc)](_0x29d972[_0x56de2c(0xcf)][_0x56de2c(0xe9)]+_0x56de2c(0xda)));if(_0x29d972[_0x56de2c(0xcf)][_0x56de2c(0xc0)]>0x0){const _0x1c8abf=_0x29d972[_0x56de2c(0xcf)][_0x56de2c(0x104)]>_0x29d972['counts'][_0x56de2c(0xc0)]?'\x20('+_0x29d972['counts'][_0x56de2c(0x104)]+_0x56de2c(0xeb):'';console[_0x56de2c(0xe7)](_0x56de2c(0xd5)+a38_0x304319[_0x56de2c(0xfc)](_0x29d972[_0x56de2c(0xcf)]['journeys']+_0x56de2c(0xf9))+a38_0x304319['dim'](_0x1c8abf));}console[_0x56de2c(0xe7)]('\x20\x20'+a38_0x304319[_0x56de2c(0xff)]('+\x20'+_0x494879['length']+'\x20new\x20files')),console['error']('\x20\x20'+a38_0x304319[_0x56de2c(0xf4)]('~\x20'+_0x446f23[_0x56de2c(0xbe)]+_0x56de2c(0xd0))),console[_0x56de2c(0xe7)]('\x20\x20'+a38_0x304319['dim']('=\x20'+_0x20f9b2[_0x56de2c(0xbe)]+_0x56de2c(0xd6))),console[_0x56de2c(0xe7)](_0x56de2c(0xe8)+a38_0x304319[_0x56de2c(0xfc)](_0x29d972[_0x56de2c(0xbb)])+'\x0a');if(_0x446f23[_0x56de2c(0xbe)]>0x0)for(const _0x2de8fe of _0x446f23){console[_0x56de2c(0xe7)](_0x56de2c(0x108)+_0x2de8fe[_0x56de2c(0x109)]+'\x27:'),console['error']('─'[_0x56de2c(0xe4)](0x3c)),console[_0x56de2c(0xe7)](_0x2de8fe[_0x56de2c(0xc1)]),console['error']('─'[_0x56de2c(0xe4)](0x3c));}if(_0x9bdd8c[_0x56de2c(0xdf)])return console[_0x56de2c(0xe7)](a38_0x304319[_0x56de2c(0xf4)](_0x56de2c(0xd2))),0x0;if(_0x494879[_0x56de2c(0xbe)]===0x0&&_0x446f23[_0x56de2c(0xbe)]===0x0)return console[_0x56de2c(0xe7)](a38_0x304319[_0x56de2c(0xff)](_0x56de2c(0xea))),saveSessionContext({'parent_segment':_0x29d972['parentName']},_0x9bdd8c[_0x56de2c(0xd1)]),console[_0x56de2c(0xe7)](a38_0x304319[_0x56de2c(0xff)]('βœ”\x20Context\x20set:\x20'+a38_0x304319[_0x56de2c(0xe5)](_0x56de2c(0xe3))+'\x20=\x20'+a38_0x304319[_0x56de2c(0xfc)](_0x29d972['parentName']))),0x0;if(!_0x9bdd8c[_0x56de2c(0xd8)]){if(!isInteractive())return console[_0x56de2c(0xe7)](a38_0x304319[_0x56de2c(0xf8)](_0x56de2c(0xc3)),_0x56de2c(0xec)),console['error'](a38_0x304319[_0x56de2c(0xe5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x18e6ed=await confirmKey('Write\x20'+(_0x494879[_0x56de2c(0xbe)]+_0x446f23[_0x56de2c(0xbe)])+_0x56de2c(0xee));if(!_0x18e6ed)return console[_0x56de2c(0xe7)](a38_0x304319['yellow'](_0x56de2c(0x103)),_0x56de2c(0xd4)),0x1;}for(const _0x3d2953 of _0x29d972[_0x56de2c(0xcd)]){if(_0x3d2953[_0x56de2c(0xc7)]||_0x3d2953['hasChanges']){const _0x430319=a38_0x5e72f3['dirname'](_0x3d2953[_0x56de2c(0xcb)]);!existsSync(_0x430319)&&mkdirSync(_0x430319,{'recursive':!![]}),writeFileSync(_0x3d2953[_0x56de2c(0xcb)],_0x3d2953['content'],_0x56de2c(0xf0));}}return console['error'](a38_0x304319[_0x56de2c(0xff)](_0x56de2c(0xc5)+(_0x494879[_0x56de2c(0xbe)]+_0x446f23['length'])+_0x56de2c(0xd9)+_0x29d972['targetDir'])),saveSessionContext({'parent_segment':_0x29d972[_0x56de2c(0xfd)]},_0x9bdd8c[_0x56de2c(0xd1)]),console['error'](a38_0x304319[_0x56de2c(0xff)](_0x56de2c(0xc4)+a38_0x304319[_0x56de2c(0xe5)](_0x56de2c(0xe3))+'\x20=\x20'+a38_0x304319[_0x56de2c(0xfc)](_0x29d972[_0x56de2c(0xfd)]))),0x0;}}
@@ -1 +1 @@
1
- const a39_0x56fbcf=a39_0x4106;(function(_0x332ef2,_0x215f88){const _0x23c17f=a39_0x4106,_0x427bbd=_0x332ef2();while(!![]){try{const _0x117715=parseInt(_0x23c17f(0x18c))/0x1*(parseInt(_0x23c17f(0x198))/0x2)+-parseInt(_0x23c17f(0x1b7))/0x3+-parseInt(_0x23c17f(0x1ad))/0x4*(-parseInt(_0x23c17f(0x211))/0x5)+parseInt(_0x23c17f(0x1dd))/0x6+parseInt(_0x23c17f(0x1b9))/0x7+parseInt(_0x23c17f(0x1b3))/0x8*(parseInt(_0x23c17f(0x1a8))/0x9)+-parseInt(_0x23c17f(0x1fa))/0xa;if(_0x117715===_0x215f88)break;else _0x427bbd['push'](_0x427bbd['shift']());}catch(_0x4f2522){_0x427bbd['push'](_0x427bbd['shift']());}}}(a39_0x5374,0xcf02c));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 a39_0x4106(_0x1f0070,_0x3986d6){_0x1f0070=_0x1f0070-0x17b;const _0x5374c4=a39_0x5374();let _0x410695=_0x5374c4[_0x1f0070];return _0x410695;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a39_0x5374(){const _0x3bec7a=['\x20new','Fetching\x20existing\x20data...','\x20YAML\x20files\x20found','/sb/da/esr','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','journeyBundleName','\x20updated','journey','35538540dCnoUA','attributes','\x20changes?','join','data','\x20\x20Activations:','delete','file','listSegments','connection','\x20\x20\x20\x20','segment','filter','paused','filePath','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Preparing\x20journeys...','Folders\x20to\x20create:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','parent_name','resolveParentId','unchanged','1255QMtIRY','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/j/da/je','getJourney','\x20unchanged','Resolving\x20parent\x20segment\x20\x27','deleted','endsWith','listJourneysWithDetailsFromParentSegment','cwd','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','name','journeysOnly','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','isNew','\x20to\x20create','idToName','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','138582MHJZnf','Source\x20directory:\x20','\x20\x20Journeys:\x20','diff','\x20\x20Segments:\x20','updatedAt','folderId','isScoped','map','createdAt','\x20created','segments','22sSaoce','dryRun','\x20deleted','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','buildUserMaps','no_parent','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment\x20or\x20journey','helpText','Scoped\x20to\x20folder:\x20','\x20folders\x20to\x20create','Site:\x20','nameToId','\x20activations]','activations','parentName','13377411wroeOR','toString','Delete\x20segment:','toCreate','results','23044BpGNeI','message','yellow','all','yes','journeyId','8MlfpLG','versionNumber','segment:push','error','4893426wObEAh','\x0aError:','8572837GZmjIu','repeat','\x20changed','audienceId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parentSegment','changed','user','\x20to\x20delete','description','folderPath','cyan','existingJourney','No\x20','folders','new','journeyBundleId','targetDir','Error:\x20','journeys','push','green','updated','setPhase','yamlConfig','listActivations','dim','site','Fetching\x20existing\x20activations...','verbose','get','state','relationships','Error:\x20Directory\x20not\x20found:\x20','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20update','2108574dVgjWS','blue','createdSegmentIds','execute','created','.yml','New\x20journey:','\x20\x20πŸ“Š\x20Segments:','length','existingSegment','parentFolder','errorCode','Delete\x20journey:','red','/e/','/app/ps/','.yaml','toDelete','toUpdate','set'];a39_0x5374=function(){return _0x3bec7a;};return a39_0x5374();}import a39_0x3f7344 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{[a39_0x56fbcf(0x185)]=a39_0x56fbcf(0x1b5);[a39_0x56fbcf(0x1c2)]=a39_0x56fbcf(0x17b);async[a39_0x56fbcf(0x1e0)](_0x568a12){const _0x1ebfa7=a39_0x56fbcf,{options:_0xdc122f,args:_0x350951,tdx:_0x605cc4}=_0x568a12,_0x2ce474=_0xdc122f,_0x5b5126=await resolveTarget({'arg':_0x350951[0x0],'contextParent':_0xdc122f[_0x1ebfa7(0x1be)],'cwd':process[_0x1ebfa7(0x183)]()});if(!isSuccessfulResolution(_0x5b5126))return _0x5b5126[_0x1ebfa7(0x1e8)]===_0x1ebfa7(0x19d)?(console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)](_0x1ebfa7(0x19b))),console[_0x1ebfa7(0x1b6)]('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[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x20a)),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x20d))):(console[_0x1ebfa7(0x1b6)](a39_0x3f7344['red'](_0x1ebfa7(0x1cb)+_0x5b5126['message']+'\x0a')),_0x5b5126['helpText']&&console['error'](a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x5b5126[_0x1ebfa7(0x1a0)]))),0x1;if(_0x5b5126[_0x1ebfa7(0x209)]===_0x1ebfa7(0x20e))return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1da)+_0x5b5126['targetDir']+'\x0a')),console[_0x1ebfa7(0x1b6)](a39_0x3f7344['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x3d1910=_0x5b5126[_0x1ebfa7(0x1a7)],_0x4f40bb=_0x5b5126[_0x1ebfa7(0x1ca)],_0x38797e=_0x5b5126[_0x1ebfa7(0x209)]===_0x1ebfa7(0x201)?_0x5b5126[_0x1ebfa7(0x208)]:undefined,_0x5b97b5=getScopedDetails(_0x5b5126),_0x344bfc=_0x5b97b5?.[_0x1ebfa7(0x193)]??![],_0x5a0c2f=_0x5b97b5?.['scopedFolderPath']??'';if(!existsSync(_0x4f40bb))return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1da)+_0x4f40bb+'\x0a')),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1c4)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x2ce474[_0x1ebfa7(0x1d6)]&&(console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x1a3)+_0x2ce474[_0x1ebfa7(0x1d4)]),console['error']('Parent\x20segment:\x20'+_0x3d1910),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x18d)+_0x4f40bb),_0x344bfc&&console['error'](_0x1ebfa7(0x1a1)+_0x5a0c2f));const _0x24acda=await withSpinner(_0x1ebfa7(0x17f)+_0x3d1910+'\x27...',()=>_0x605cc4[_0x1ebfa7(0x205)][_0x1ebfa7(0x20f)](_0x3d1910),{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]}),_0x26b4fc=_0x24acda['data'],{parentSegmentResult:_0x3b830c,segmentsResult:_0x328b5d,foldersResult:_0x194c5e,journeysWithDetailsResult:_0x2098e8,userMaps:_0x321312}=await withSpinner(_0x1ebfa7(0x1f2),async()=>{const _0x280bc5=_0x1ebfa7,[_0x4a7ce1,_0x505768,_0x18784c,_0x5a7631,_0x1c171d]=await Promise[_0x280bc5(0x1b0)]([_0x605cc4[_0x280bc5(0x205)]['getParent'](_0x26b4fc),_0x605cc4[_0x280bc5(0x205)][_0x280bc5(0x202)](_0x26b4fc),_0x605cc4[_0x280bc5(0x205)]['listFolders'](_0x26b4fc),_0x605cc4['journey'][_0x280bc5(0x182)](_0x26b4fc,{'includeAllVersions':!![]}),_0x605cc4[_0x280bc5(0x1c0)][_0x280bc5(0x19c)]()]);return{'parentSegmentResult':_0x4a7ce1,'segmentsResult':_0x505768,'foldersResult':_0x18784c,'journeysWithDetailsResult':_0x5a7631,'userMaps':_0x1c171d};},{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]})['then'](_0x31c162=>_0x31c162[_0x1ebfa7(0x1fe)]),_0x51d9f2=_0x3b830c,_0x5dd792=extractRootFolderId(_0x51d9f2),_0x4437d6=_0x328b5d,_0x346221=_0x194c5e,{journeys:_0x5d8c9c,activationStepsById:_0x109a6f}=_0x2098e8,_0x2335c7=new Map(_0x5d8c9c[_0x1ebfa7(0x194)](_0x4f28a5=>[_0x4f28a5['id'],_0x4f28a5])),_0x1e0d9f=_0x5d8c9c[_0x1ebfa7(0x194)](_0xbcd361=>({'id':_0xbcd361['id'],'name':_0xbcd361[_0x1ebfa7(0x1fb)]['name'],'journeyBundleName':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1f7)]||'','journeyBundleId':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1c9)]||'','versionNumber':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1b4)],'description':_0xbcd361['attributes']['description'],'state':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1d8)],'paused':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x207)],'audienceId':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x1bc)],'folderId':_0xbcd361[_0x1ebfa7(0x1d9)]?.[_0x1ebfa7(0x1e7)]?.[_0x1ebfa7(0x1fe)]?.['id'],'createdAt':_0xbcd361[_0x1ebfa7(0x1fb)][_0x1ebfa7(0x195)],'updatedAt':_0xbcd361['attributes'][_0x1ebfa7(0x191)]})),{emailToId:_0x3e625f,idToEmail:_0x1fa4d3}=_0x321312,_0x6037b1=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2fc798=_0x1ebfa7,_0x1fb452=await _0x605cc4[_0x2fc798(0x203)]['list']();return buildConnectionMaps(_0x1fb452);},{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]})['then'](_0x34813e=>_0x34813e[_0x1ebfa7(0x1fe)]),_0x40ffb4=_0x6037b1[_0x1ebfa7(0x1a4)],_0x42af14=_0x6037b1['idToName'],_0x599adc=_0x6037b1['nameToType'],_0x2b3ce6={'emailToIdMap':_0x3e625f,'connectionNameToIdMap':_0x40ffb4,'connectionNameToTypeMap':_0x599adc,'getSchema':_0x2c9bc3=>_0x605cc4['connection']['getOutputSchemaWithCache'](_0x2c9bc3)};let {pathToId:_0x14e649,idToPath:_0x48b5fc}=buildFolderMaps(_0x346221);const _0x6b8145=buildSegmentLookupMap(_0x4437d6,_0x48b5fc),_0x1f1b04=buildSegmentNameToIdMap(_0x4437d6),_0x31ad98=buildJourneyBundleLookupMap(_0x1e0d9f,_0x48b5fc);let _0x334511;if(_0x38797e){if(!_0x38797e[_0x1ebfa7(0x181)](_0x1ebfa7(0x1e2))&&!_0x38797e[_0x1ebfa7(0x181)](_0x1ebfa7(0x1ed)))return console['error'](a39_0x3f7344[_0x1ebfa7(0x1ea)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x38797e+'\x0a')),0x1;_0x334511=[_0x38797e];}else _0x334511=findYamlFiles(_0x4f40bb);if(_0x334511[_0x1ebfa7(0x1e5)]===0x0)return console[_0x1ebfa7(0x1b6)](a39_0x3f7344['red'](_0x1ebfa7(0x1bd)+_0x4f40bb+'\x0a')),console[_0x1ebfa7(0x1b6)](a39_0x3f7344['cyan'](_0x1ebfa7(0x184))),0x1;let _0x70eb8c,_0x42edb1;try{const _0x2dbdc5=parseAndClassifyYamlFiles(_0x334511,_0x4f40bb,{'skipSegments':_0x2ce474[_0x1ebfa7(0x186)]});_0x70eb8c=_0x2dbdc5[_0x1ebfa7(0x197)],_0x42edb1=_0x2dbdc5[_0x1ebfa7(0x1cc)];const _0x1ae04b=validateParsedFiles(_0x2dbdc5,_0x4f40bb);if(_0x1ae04b[_0x1ebfa7(0x1e5)]>0x0)return console['error'](a39_0x3f7344[_0x1ebfa7(0x1ea)]('\x0aValidation\x20failed:')),console[_0x1ebfa7(0x1b6)](formatValidationErrors(_0x1ae04b)),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x1cd486){return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)]('Error\x20parsing\x20YAML:\x20'+(_0x1cd486 instanceof Error?_0x1cd486[_0x1ebfa7(0x1ae)]:_0x1cd486))),0x1;}if(_0x70eb8c[_0x1ebfa7(0x1e5)]===0x0&&_0x42edb1[_0x1ebfa7(0x1e5)]===0x0){const _0x29325e=_0x2ce474[_0x1ebfa7(0x186)]?_0x1ebfa7(0x1f9):_0x1ebfa7(0x19f);return console[_0x1ebfa7(0x1b6)](a39_0x3f7344['yellow'](_0x1ebfa7(0x1c6)+_0x29325e+_0x1ebfa7(0x1f3))),0x0;}const _0x1fbe38=new Map();_0x4437d6[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&await withSpinner(_0x1ebfa7(0x1d5),async()=>{await batchAsync(_0x4437d6,async _0x3f04e6=>{const _0x1bb821=a39_0x4106,_0x4498f4=await _0x605cc4['segment'][_0x1bb821(0x1d2)](_0x26b4fc,_0x3f04e6['id']);_0x1fbe38[_0x1bb821(0x1f0)](_0x3f04e6['id'],_0x4498f4);});},{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]});const {segmentFiles:_0x5c50b9,foldersToCreate:_0x474c57}=await prepareSegmentFiles(_0x70eb8c,{'segmentByFolderAndName':_0x6b8145,'activationsBySegmentId':_0x1fbe38,'folderPathToId':_0x14e649,'idToEmailMap':_0x1fa4d3,'connectionIdToNameMap':_0x42af14},_0x2b3ce6,_0x344bfc,_0x5a0c2f),_0x16f572=_0x38797e?[]:findSegmentsToDelete(_0x4437d6,_0x70eb8c[_0x1ebfa7(0x194)](({yamlConfig:_0x47c540,folderPath:_0x695ae4})=>({'yamlConfig':_0x47c540,'folderPath':resolveTDFolderPath(_0x695ae4,_0x344bfc,_0x5a0c2f)})),_0x48b5fc,_0x5a0c2f,_0x344bfc),{journeyFiles:_0x47a552,foldersToCreate:_0x43b327}=await withProgressSpinner(_0x1ebfa7(0x20b),async _0xf84429=>prepareJourneyFiles(_0x42edb1,{'fetchJourney':async _0x571ba8=>_0x605cc4[_0x1ebfa7(0x1f9)][_0x1ebfa7(0x17d)](_0x571ba8[_0x1ebfa7(0x1b2)]),'journeyBundlesByFolderAndName':_0x31ad98,'folderPathToId':_0x14e649,'idToEmailMap':_0x1fa4d3,'connectionIdToNameMap':_0x42af14,'existingSegments':_0x4437d6,'parentId':_0x26b4fc,'deps':_0x605cc4,'progress':{'update':_0x2c93d2=>{const _0x3ba0d5=_0x1ebfa7;_0xf84429[_0x3ba0d5(0x1d0)](_0x2c93d2),_0x2ce474['verbose']&&console[_0x3ba0d5(0x1b6)]('\x20\x20'+_0x2c93d2);}},'journeyById':_0x2335c7,'activationStepsById':_0x109a6f},_0x344bfc,_0x5a0c2f),{'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]})['then'](_0x4cc9e6=>_0x4cc9e6['data']);for(const _0x1e8fa8 of _0x43b327){_0x474c57['add'](_0x1e8fa8);}const _0xc5bc54=_0x38797e?[]:findJourneysToDelete(_0x1e0d9f,_0x42edb1[_0x1ebfa7(0x194)](({yamlConfig:_0xdec5df,folderPath:_0x40f1b8})=>({'yamlConfig':_0xdec5df,'folderPath':resolveTDFolderPath(_0x40f1b8,_0x344bfc,_0x5a0c2f)})),_0x48b5fc,_0x5a0c2f,_0x344bfc),_0x323c14=calculatePushStats(_0x5c50b9,_0x47a552,_0x474c57,_0x16f572,_0xc5bc54,!!_0x2ce474[_0x1ebfa7(0x200)],!!_0x2ce474[_0x1ebfa7(0x186)]),_0x2dcf82=_0x323c14['segments'][_0x1ebfa7(0x1c8)],_0x575ebe=_0x323c14[_0x1ebfa7(0x197)]['changed'],_0x3bf774=_0x323c14[_0x1ebfa7(0x197)][_0x1ebfa7(0x210)],_0x425613=_0x323c14['segments'][_0x1ebfa7(0x1ee)],_0x3411ee=_0x323c14[_0x1ebfa7(0x1c7)]['toCreate'],_0x420e1e=_0x323c14['journeys']['new'],_0x41cc09=_0x323c14['journeys'][_0x1ebfa7(0x1bf)],_0x2cb846=_0x323c14['journeys'][_0x1ebfa7(0x210)],_0x192e92=_0x323c14[_0x1ebfa7(0x1cc)]['toDelete'],_0x418f8a=_0x323c14['activations'][_0x1ebfa7(0x1b0)],_0x3c90f6=_0x323c14[_0x1ebfa7(0x1a6)][_0x1ebfa7(0x1ab)],_0x3ffdfd=_0x323c14['activations'][_0x1ebfa7(0x1ef)],_0x416d81=_0x323c14[_0x1ebfa7(0x1a6)]['toDelete'];console[_0x1ebfa7(0x1b6)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3d1910+'\x27:');_0x3411ee[_0x1ebfa7(0x1e5)]>0x0&&console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1de)]('πŸ“\x20'+_0x3411ee[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1a2)));if(!_0x2ce474['journeysOnly']){console['error'](_0x1ebfa7(0x1e4)),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ce)]('+\x20'+_0x2dcf82['length']+_0x1ebfa7(0x1f1))),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344['yellow']('~\x20'+_0x575ebe[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1bb)));if(_0x425613['length']>0x0)console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ea)]('-\x20'+_0x425613[_0x1ebfa7(0x1e5)]+'\x20to\x20delete'));else _0x16f572[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x200)]&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1d3)](_0x16f572[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x19e)));console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1d3)]('=\x20'+_0x3bf774[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x17e)));}if(_0x47a552[_0x1ebfa7(0x1e5)]>0x0||_0xc5bc54[_0x1ebfa7(0x1e5)]>0x0){console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x18b)),console['error']('\x20\x20\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1ce)]('+\x20'+_0x420e1e[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1f1))),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344['yellow']('~\x20'+_0x41cc09[_0x1ebfa7(0x1e5)]+'\x20changed'));if(_0x192e92[_0x1ebfa7(0x1e5)]>0x0)console[_0x1ebfa7(0x1b6)]('\x20\x20\x20\x20'+a39_0x3f7344['red']('-\x20'+_0x192e92[_0x1ebfa7(0x1e5)]+'\x20to\x20delete'));else _0xc5bc54[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x200)]&&console[_0x1ebfa7(0x1b6)]('\x20\x20\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1d3)](_0xc5bc54[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x19e)));console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1d3)]('=\x20'+_0x2cb846[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x17e)));}_0x418f8a[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&(console[_0x1ebfa7(0x1b6)](''),console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x1ff)),_0x3c90f6[_0x1ebfa7(0x1e5)]>0x0&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ce)]('+\x20'+_0x3c90f6['length']+_0x1ebfa7(0x189))),_0x3ffdfd[_0x1ebfa7(0x1e5)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x3f7344['yellow']('~\x20'+_0x3ffdfd[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1dc))),_0x416d81['length']>0x0&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x204)+a39_0x3f7344[_0x1ebfa7(0x1ea)]('-\x20'+_0x416d81[_0x1ebfa7(0x1e5)]+_0x1ebfa7(0x1c1))));console['error']('\x20\x20Source:\x20'+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x4f40bb)+'\x0a');if(_0x3411ee[_0x1ebfa7(0x1e5)]>0x0){console['error'](_0x1ebfa7(0x20c));for(const _0x47b279 of _0x3411ee){console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1de)]('+')+'\x20'+_0x47b279);}console[_0x1ebfa7(0x1b6)]('');}if(_0x2dcf82['length']>0x0&&!_0x2ce474[_0x1ebfa7(0x186)])for(const _0x52e78c of _0x2dcf82){const _0x5e32ac=_0x52e78c['folderPath']?_0x52e78c[_0x1ebfa7(0x1c3)]+'/'+_0x52e78c['yamlConfig']['name']:_0x52e78c[_0x1ebfa7(0x1d1)]['name'],_0x515901=_0x52e78c[_0x1ebfa7(0x1d1)]['activations']?.[_0x1ebfa7(0x1e5)]||0x0,_0x2f8dbb=_0x515901>0x0?a39_0x3f7344['dim']('\x20['+_0x515901+_0x1ebfa7(0x1a5)):'';console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344[_0x1ebfa7(0x1ce)]('New\x20segment:')+'\x20'+_0x5e32ac+_0x2f8dbb),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c)),_0x52e78c[_0x1ebfa7(0x18f)]&&console[_0x1ebfa7(0x1b6)](_0x52e78c[_0x1ebfa7(0x18f)]),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c));}if(_0x425613[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474['journeysOnly'])for(const _0x28a705 of _0x425613){const _0x16c7a2=_0x28a705['segmentFolderId']?_0x48b5fc[_0x1ebfa7(0x1d7)](_0x28a705['segmentFolderId'][_0x1ebfa7(0x1a9)]())||'':'',_0xddd106=_0x16c7a2?_0x16c7a2+'/'+_0x28a705[_0x1ebfa7(0x185)]:_0x28a705['name'],_0x3e0f14=_0x1fbe38[_0x1ebfa7(0x1d7)](_0x28a705['id'])||[],_0x5231c6=_0x3e0f14['length']>0x0?a39_0x3f7344['dim']('\x20['+_0x3e0f14['length']+'\x20activations]'):'';console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344['red'](_0x1ebfa7(0x1aa))+'\x20'+_0xddd106+_0x5231c6),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c));const _0x15dff6=segmentWithActivationsToYaml(_0x28a705,_0x3e0f14,undefined,_0x1fa4d3,_0x42af14),_0x41ee1a=segmentToYamlString(_0x15dff6),_0xcd2b30=generateDiff(_0x41ee1a,'');console[_0x1ebfa7(0x1b6)](formatDiffWithColors(_0xcd2b30)),console['error']('─'['repeat'](0x3c));}const _0x235780=_0x5c50b9[_0x1ebfa7(0x206)](_0x424c56=>!_0x424c56[_0x1ebfa7(0x188)]&&_0x424c56[_0x1ebfa7(0x18f)]);if(_0x235780[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)])for(const _0x2757ad of _0x235780){const _0x13e891=_0x2757ad[_0x1ebfa7(0x1c3)]?_0x2757ad[_0x1ebfa7(0x1c3)]+'/'+_0x2757ad['yamlConfig'][_0x1ebfa7(0x185)]:_0x2757ad[_0x1ebfa7(0x1d1)]['name'];console['error']('\x0a'+a39_0x3f7344['yellow']('Changes\x20to:')+'\x20'+_0x13e891),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c)),console[_0x1ebfa7(0x1b6)](_0x2757ad['diff']),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c));}if(_0x420e1e[_0x1ebfa7(0x1e5)]>0x0)for(const _0x3e82ef of _0x420e1e){const _0x3607ac=_0x3e82ef[_0x1ebfa7(0x1c3)]?_0x3e82ef[_0x1ebfa7(0x1c3)]+'/'+_0x3e82ef['yamlConfig'][_0x1ebfa7(0x185)]:_0x3e82ef[_0x1ebfa7(0x1d1)][_0x1ebfa7(0x185)];console['error']('\x0a'+a39_0x3f7344[_0x1ebfa7(0x1ce)](_0x1ebfa7(0x1e3))+'\x20'+_0x3607ac),console[_0x1ebfa7(0x1b6)]('─'['repeat'](0x3c)),_0x3e82ef[_0x1ebfa7(0x18f)]&&console['error'](_0x3e82ef[_0x1ebfa7(0x18f)]),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c));}const _0x23c55f=_0x47a552[_0x1ebfa7(0x206)](_0x4524ee=>!_0x4524ee[_0x1ebfa7(0x188)]&&_0x4524ee[_0x1ebfa7(0x18f)]);if(_0x23c55f['length']>0x0)for(const _0x40dc07 of _0x23c55f){const _0x4be684=_0x40dc07[_0x1ebfa7(0x1c3)]?_0x40dc07[_0x1ebfa7(0x1c3)]+'/'+_0x40dc07[_0x1ebfa7(0x1d1)][_0x1ebfa7(0x185)]:_0x40dc07['yamlConfig'][_0x1ebfa7(0x185)];console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x4be684),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c)),console[_0x1ebfa7(0x1b6)](_0x40dc07['diff']),console['error']('─'[_0x1ebfa7(0x1ba)](0x3c));}if(_0x192e92[_0x1ebfa7(0x1e5)]>0x0)for(const _0x434590 of _0x192e92){const _0x3e12df=_0x434590[_0x1ebfa7(0x192)]?_0x48b5fc[_0x1ebfa7(0x1d7)](_0x434590[_0x1ebfa7(0x192)])||'':'',_0x128064=_0x3e12df?_0x3e12df+'/'+_0x434590[_0x1ebfa7(0x1f7)]:_0x434590[_0x1ebfa7(0x1f7)];console[_0x1ebfa7(0x1b6)]('\x0a'+a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1e9))+'\x20'+_0x128064),console[_0x1ebfa7(0x1b6)]('─'[_0x1ebfa7(0x1ba)](0x3c)),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)]('(Journey\x20will\x20be\x20deleted)')),console[_0x1ebfa7(0x1b6)]('─'['repeat'](0x3c));}if(_0x2ce474[_0x1ebfa7(0x199)])return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)](_0x1ebfa7(0x1f6))),0x0;const _0x9c8d82=_0x2ce474['journeysOnly']?![]:_0x2dcf82[_0x1ebfa7(0x1e5)]>0x0||_0x575ebe[_0x1ebfa7(0x1e5)]>0x0||_0x425613[_0x1ebfa7(0x1e5)]>0x0,_0x562d3c=_0x420e1e[_0x1ebfa7(0x1e5)]>0x0||_0x41cc09['length']>0x0||_0x192e92[_0x1ebfa7(0x1e5)]>0x0,_0x28be3d=_0x2ce474[_0x1ebfa7(0x186)]?![]:_0x418f8a[_0x1ebfa7(0x1e5)]>0x0,_0x3ac517=_0x3411ee[_0x1ebfa7(0x1e5)]>0x0;if(!_0x9c8d82&&!_0x562d3c&&!_0x28be3d&&!_0x3ac517){const _0x486c43=_0x2ce474[_0x1ebfa7(0x186)]?_0x1ebfa7(0x1f5):'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x1ebfa7(0x1b6)](a39_0x3f7344['green'](_0x486c43));if(_0x38797e&&_0x3bf774['length']===0x1){const _0x373ec0=_0x3bf774[0x0];if(_0x373ec0[_0x1ebfa7(0x1e6)]?.['id']){const _0x226667=getConsoleNextUrl(_0x2ce474['site'],_0x1ebfa7(0x1ec)+_0x26b4fc+'/e/'+_0x373ec0[_0x1ebfa7(0x1e6)]['id']+_0x1ebfa7(0x1f4));console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x1db)+a39_0x3f7344['cyan'](_0x226667));}}if(_0x38797e&&_0x2cb846[_0x1ebfa7(0x1e5)]===0x1){const _0x1b7642=_0x2cb846[0x0];if(_0x1b7642['existingJourney']?.['id']){const _0x4cde9e=getConsoleNextUrl(_0x2ce474[_0x1ebfa7(0x1d4)],_0x1ebfa7(0x1ec)+_0x26b4fc+'/e/'+_0x1b7642[_0x1ebfa7(0x1c5)]['id']+_0x1ebfa7(0x17c));console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x4cde9e));}}return 0x0;}const _0x3a92fb=_0x2ce474['journeysOnly']?_0x420e1e['length']+_0x41cc09[_0x1ebfa7(0x1e5)]+_0x192e92[_0x1ebfa7(0x1e5)]+_0x3411ee[_0x1ebfa7(0x1e5)]:_0x2dcf82[_0x1ebfa7(0x1e5)]+_0x575ebe['length']+_0x425613[_0x1ebfa7(0x1e5)]+_0x420e1e[_0x1ebfa7(0x1e5)]+_0x41cc09[_0x1ebfa7(0x1e5)]+_0x192e92[_0x1ebfa7(0x1e5)]+_0x3411ee[_0x1ebfa7(0x1e5)]+_0x418f8a[_0x1ebfa7(0x1e5)];if(!_0x2ce474[_0x1ebfa7(0x1b1)]&&_0x3a92fb>0x0){if(!isInteractive())return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ea)](_0x1ebfa7(0x1b8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1d3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x35989a=await confirmKey('Push\x20'+_0x3a92fb+_0x1ebfa7(0x1fc));if(!_0x35989a)return console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1af)]('Aborted.')),0x1;}const _0x5e26e6={'withProgress':async(_0x22be99,_0x87939f)=>{const _0xd6f7f4=_0x1ebfa7,_0xacb18b=await withSpinner(_0x22be99,_0x87939f,{'verbose':_0x2ce474[_0xd6f7f4(0x1d6)]});return{'data':_0xacb18b[_0xd6f7f4(0x1fe)]};},'logInfo':_0x50a092=>console['error'](a39_0x3f7344[_0x1ebfa7(0x1de)]('βœ”\x20'+_0x50a092)),'logSuccess':_0x4adc27=>console[_0x1ebfa7(0x1b6)](a39_0x3f7344['green']('βœ”\x20'+_0x4adc27)),'logWarning':_0x31f058=>console['error'](a39_0x3f7344[_0x1ebfa7(0x1af)]('⚠\x20'+_0x31f058)),'logDeleted':_0x5f555b=>console['error'](a39_0x3f7344[_0x1ebfa7(0x1ea)]('βœ”\x20'+_0x5f555b))},_0x3c97cf={'segment':_0x605cc4[_0x1ebfa7(0x205)],'journey':_0x605cc4['journey'],'user':_0x605cc4[_0x1ebfa7(0x1c0)],'connection':_0x605cc4[_0x1ebfa7(0x203)]};_0x3411ee[_0x1ebfa7(0x1e5)]>0x0&&(_0x14e649=await executePushFolders(_0x3c97cf,_0x3411ee,_0x14e649,{'parentId':_0x26b4fc},_0x5e26e6));const _0x47a9c3={'rootFolderId':_0x5dd792,'folderPathToId':_0x14e649,'folderIdToPath':_0x48b5fc,'segmentNameToId':_0x1f1b04,'activationsBySegmentId':_0x1fbe38,'emailToIdMap':_0x3e625f,'idToEmailMap':_0x1fa4d3,'connectionNameToIdMap':_0x6037b1[_0x1ebfa7(0x1a4)],'connectionIdToNameMap':_0x6037b1[_0x1ebfa7(0x18a)],'connectionNameToTypeMap':_0x599adc},_0x30865c=await executePushSegments(_0x3c97cf,_0x2ce474[_0x1ebfa7(0x186)]?[]:_0x5c50b9,_0x47a9c3,{'parentId':_0x26b4fc},_0x5e26e6),_0x173426=_0x30865c[_0x1ebfa7(0x1e1)],_0x580c3e=_0x30865c[_0x1ebfa7(0x1cf)],_0x3b0eca=_0x30865c[_0x1ebfa7(0x1a6)]['created'],_0x5e3a18=_0x30865c[_0x1ebfa7(0x1a6)][_0x1ebfa7(0x1cf)],_0x1910a3=_0x30865c[_0x1ebfa7(0x1a6)][_0x1ebfa7(0x180)];let _0x9b1c3b;if(_0x38797e&&_0x5c50b9[_0x1ebfa7(0x1e5)]===0x1){const _0x54885d=_0x5c50b9[0x0];_0x9b1c3b=_0x54885d[_0x1ebfa7(0x1e6)]?.['id']??_0x30865c[_0x1ebfa7(0x1df)][_0x1ebfa7(0x1d7)](_0x54885d[_0x1ebfa7(0x1d1)]['name']);}const _0x1ceebf=await executePushSegmentDeletions(_0x3c97cf,_0x2ce474[_0x1ebfa7(0x186)]?[]:_0x425613,_0x5e26e6);let _0x358e50=0x0,_0x55e924=0x0,_0x5b9c92=0x0;const _0x4d263f=new Map(_0x1f1b04);for(const [_0x27cf7d,_0x2f691c]of _0x30865c[_0x1ebfa7(0x1df)]){_0x4d263f['set'](_0x27cf7d,_0x2f691c);}if(_0x47a552[_0x1ebfa7(0x1e5)]>0x0){const _0x51615d={..._0x47a9c3,'segmentNameToId':_0x4d263f,'existingSegments':_0x4437d6,'activationContext':_0x2b3ce6},_0x11dcd2=await executePushJourneys(_0x3c97cf,_0x47a552,_0x51615d,{'parentId':_0x26b4fc,'rootFolderId':_0x5dd792,'verbose':_0x2ce474[_0x1ebfa7(0x1d6)]},_0x5e26e6);_0x358e50=_0x11dcd2[_0x1ebfa7(0x1e1)],_0x55e924=_0x11dcd2[_0x1ebfa7(0x1cf)];if(_0x38797e&&_0x11dcd2[_0x1ebfa7(0x1ac)][_0x1ebfa7(0x1e5)]===0x1){const _0x540c93=_0x11dcd2[_0x1ebfa7(0x1ac)][0x0];if(_0x540c93['journeyId']){const _0x1ad484=getConsoleNextUrl(_0x2ce474[_0x1ebfa7(0x1d4)],_0x1ebfa7(0x1ec)+_0x26b4fc+_0x1ebfa7(0x1eb)+_0x540c93['journeyId']+_0x1ebfa7(0x17c));console[_0x1ebfa7(0x1b6)]('\x20\x20'+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x1ad484));}}}for(const _0x583b72 of _0x192e92){console[_0x1ebfa7(0x1b6)](a39_0x3f7344['yellow'](_0x1ebfa7(0x187)+_0x583b72['journeyBundleName'])),_0x5b9c92++;}const _0x257d5c=[];if(_0x173426>0x0)_0x257d5c['push'](_0x173426+_0x1ebfa7(0x196));if(_0x580c3e>0x0)_0x257d5c[_0x1ebfa7(0x1cd)](_0x580c3e+'\x20updated');if(_0x1ceebf>0x0)_0x257d5c['push'](_0x1ceebf+'\x20deleted');const _0x15aebd=[];if(_0x358e50>0x0)_0x15aebd[_0x1ebfa7(0x1cd)](_0x358e50+_0x1ebfa7(0x196));if(_0x55e924>0x0)_0x15aebd[_0x1ebfa7(0x1cd)](_0x55e924+_0x1ebfa7(0x1f8));if(_0x5b9c92>0x0)_0x15aebd[_0x1ebfa7(0x1cd)](_0x5b9c92+_0x1ebfa7(0x19a));const _0x78791c=[];if(_0x3b0eca>0x0)_0x78791c['push'](_0x3b0eca+_0x1ebfa7(0x196));if(_0x5e3a18>0x0)_0x78791c[_0x1ebfa7(0x1cd)](_0x5e3a18+_0x1ebfa7(0x1f8));if(_0x1910a3>0x0)_0x78791c[_0x1ebfa7(0x1cd)](_0x1910a3+_0x1ebfa7(0x19a));console[_0x1ebfa7(0x1b6)](a39_0x3f7344[_0x1ebfa7(0x1ce)]('\x0aβœ”\x20Push\x20complete'));_0x257d5c['length']>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x190)+_0x257d5c[_0x1ebfa7(0x1fd)](',\x20'));_0x15aebd['length']>0x0&&console[_0x1ebfa7(0x1b6)](_0x1ebfa7(0x18e)+_0x15aebd['join'](',\x20'));_0x78791c[_0x1ebfa7(0x1e5)]>0x0&&!_0x2ce474[_0x1ebfa7(0x186)]&&console['error']('\x20\x20Activations:\x20'+_0x78791c[_0x1ebfa7(0x1fd)](',\x20'));if(_0x9b1c3b){const _0x3adb8f=getConsoleNextUrl(_0x2ce474[_0x1ebfa7(0x1d4)],'/app/ps/'+_0x26b4fc+_0x1ebfa7(0x1eb)+_0x9b1c3b+_0x1ebfa7(0x1f4));console['error'](_0x1ebfa7(0x1db)+a39_0x3f7344[_0x1ebfa7(0x1c4)](_0x3adb8f));}return 0x0;}}
1
+ const a39_0x9748d9=a39_0x692c;(function(_0x4dd5bd,_0x59ce14){const _0x45700d=a39_0x692c,_0x1cff5d=_0x4dd5bd();while(!![]){try{const _0x17193e=parseInt(_0x45700d(0x1dc))/0x1+parseInt(_0x45700d(0x20b))/0x2*(parseInt(_0x45700d(0x218))/0x3)+-parseInt(_0x45700d(0x1eb))/0x4*(parseInt(_0x45700d(0x249))/0x5)+-parseInt(_0x45700d(0x212))/0x6+-parseInt(_0x45700d(0x225))/0x7*(parseInt(_0x45700d(0x220))/0x8)+parseInt(_0x45700d(0x268))/0x9*(-parseInt(_0x45700d(0x207))/0xa)+parseInt(_0x45700d(0x243))/0xb;if(_0x17193e===_0x59ce14)break;else _0x1cff5d['push'](_0x1cff5d['shift']());}catch(_0x5e33b4){_0x1cff5d['push'](_0x1cff5d['shift']());}}}(a39_0x565f,0x99971));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';function a39_0x692c(_0x426165,_0x136ac0){_0x426165=_0x426165-0x1d7;const _0x565fb4=a39_0x565f();let _0x692c09=_0x565fb4[_0x426165];return _0x692c09;}import a39_0x3ae5b9 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a39_0x565f(){const _0x28ebe3=['created','green','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','journeysOnly','\x0aβœ”\x20Push\x20complete','description','segmentFolderId','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','New\x20segment:','31212973arvUaU','Error:\x20Directory\x20not\x20found:\x20','audienceId','\x20to\x20create','toCreate','\x20YAML\x20files\x20found','142555SLNdgD','state','yamlConfig','isScoped','then','message','Delete\x20journey:','Delete\x20segment:','\x20to\x20update','endsWith','changed','connection','isNew','/e/','toString','site','name','segment\x20or\x20journey','get','parentName','new','toDelete','helpText','Fetching\x20connections\x20for\x20name\x20resolution...','listJourneysWithDetailsFromParentSegment','journeyId','no_parent','red','\x20changes?','results','yellow','10021590pZslwz','repeat','Preparing\x20journeys...','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','parent_name','updatedAt','Site:\x20','parentSegment','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20new','\x0aError:','folderId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20updated','/j/da/je','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','1023407pLdehA','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','paused','segments','listActivations','targetDir','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','length','Changes\x20to\x20journey:','type','user','/app/ps/','existingSegment','scopedFolderPath','(Journey\x20will\x20be\x20deleted)','164ayCiKI','Error\x20parsing\x20YAML:\x20','execute','existingJourney','all','Fetching\x20existing\x20data...','attributes','\x20\x20πŸ“Š\x20Segments:','versionNumber','\x20\x20\x20\x20','deleted','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','updated','dryRun','Resolving\x20parent\x20segment\x20\x27','data','\x20\x20Activations:\x20','Fetching\x20existing\x20activations...','\x20activations]','set','\x20unchanged','delete','dim','folderPath','\x20created','blue','verbose','createdSegmentIds','10AWjhyg','\x27...','getJourney','journeys','4lieKxy','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)','resolveParentId','setPhase','journeyBundleName','join','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','7431594osDEfv','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','segment','\x20to\x20delete','journeyBundleId','\x0aPush\x20summary\x20for\x20\x27','1304391WoDCiz','error','push','add','toUpdate','activations','diff','.yaml','8qrUuEO','unchanged','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','New\x20journey:','getParent','4062653fNbXul','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','πŸ“\x20','nameToType','No\x20','segment:push','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','map','cwd','filter','cyan','idToName','/sb/da/esr','.yml','\x20\x20Segments:\x20','\x20\x20Activations:','Scoped\x20to\x20folder:\x20','yes','journey','folders','relationships'];a39_0x565f=function(){return _0x28ebe3;};return a39_0x565f();}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a39_0x9748d9(0x22a);[a39_0x9748d9(0x23f)]=a39_0x9748d9(0x1dd);async[a39_0x9748d9(0x1ed)](_0x43805f){const _0x3990ee=a39_0x9748d9,{options:_0x2f6cfc,args:_0x45f8e3,tdx:_0x8187f8}=_0x43805f,_0x2b3261=_0x2f6cfc,_0x3e953f=await resolveTarget({'arg':_0x45f8e3[0x0],'contextParent':_0x2f6cfc[_0x3990ee(0x26f)],'cwd':process[_0x3990ee(0x22d)]()});if(!isSuccessfulResolution(_0x3e953f))return _0x3e953f['errorCode']===_0x3990ee(0x263)?(console['error'](a39_0x3ae5b9[_0x3990ee(0x267)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3990ee(0x20c)),console[_0x3990ee(0x219)](_0x3990ee(0x213)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x3990ee(0x219)](a39_0x3ae5b9['red']('Error:\x20'+_0x3e953f[_0x3990ee(0x24e)]+'\x0a')),_0x3e953f[_0x3990ee(0x25f)]&&console['error'](a39_0x3ae5b9[_0x3990ee(0x22f)](_0x3e953f[_0x3990ee(0x25f)]))),0x1;if(_0x3e953f[_0x3990ee(0x1e5)]===_0x3990ee(0x26c))return console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x264)](_0x3990ee(0x244)+_0x3e953f[_0x3990ee(0x1e1)]+'\x0a')),console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x22f)](_0x3990ee(0x1db))),0x1;const _0x2d83b6=_0x3e953f[_0x3990ee(0x25c)],_0x6b30ad=_0x3e953f[_0x3990ee(0x1e1)],_0x5668c4=_0x3e953f[_0x3990ee(0x1e5)]==='file'?_0x3e953f['filePath']:undefined,_0xcf77b=getScopedDetails(_0x3e953f),_0x36b683=_0xcf77b?.[_0x3990ee(0x24c)]??![],_0x184926=_0xcf77b?.[_0x3990ee(0x1e9)]??'';if(!existsSync(_0x6b30ad))return console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x264)](_0x3990ee(0x244)+_0x6b30ad+'\x0a')),console[_0x3990ee(0x219)](a39_0x3ae5b9['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x2b3261[_0x3990ee(0x205)]&&(console[_0x3990ee(0x219)](_0x3990ee(0x26e)+_0x2b3261['site']),console[_0x3990ee(0x219)]('Parent\x20segment:\x20'+_0x2d83b6),console['error']('Source\x20directory:\x20'+_0x6b30ad),_0x36b683&&console[_0x3990ee(0x219)](_0x3990ee(0x235)+_0x184926));const _0xf61472=await withSpinner(_0x3990ee(0x1f9)+_0x2d83b6+_0x3990ee(0x208),()=>_0x8187f8[_0x3990ee(0x214)][_0x3990ee(0x20d)](_0x2d83b6),{'verbose':_0x2b3261['verbose']}),_0x4690c6=_0xf61472['data'],{parentSegmentResult:_0x553d23,segmentsResult:_0x56a8f5,foldersResult:_0x5c296a,journeysWithDetailsResult:_0x45fcda,userMaps:_0x59b358}=await withSpinner(_0x3990ee(0x1f0),async()=>{const _0x4f5a22=_0x3990ee,[_0x4c1769,_0x1d218b,_0x30dd01,_0x27697b,_0x2f7cc2]=await Promise[_0x4f5a22(0x1ef)]([_0x8187f8[_0x4f5a22(0x214)][_0x4f5a22(0x224)](_0x4690c6),_0x8187f8[_0x4f5a22(0x214)]['listSegments'](_0x4690c6),_0x8187f8['segment']['listFolders'](_0x4690c6),_0x8187f8[_0x4f5a22(0x237)][_0x4f5a22(0x261)](_0x4690c6,{'includeAllVersions':!![]}),_0x8187f8[_0x4f5a22(0x1e6)]['buildUserMaps']()]);return{'parentSegmentResult':_0x4c1769,'segmentsResult':_0x1d218b,'foldersResult':_0x30dd01,'journeysWithDetailsResult':_0x27697b,'userMaps':_0x2f7cc2};},{'verbose':_0x2b3261[_0x3990ee(0x205)]})[_0x3990ee(0x24d)](_0x51cc70=>_0x51cc70[_0x3990ee(0x1fa)]),_0x538793=_0x553d23,_0xfa3b3f=extractRootFolderId(_0x538793),_0x37cf38=_0x56a8f5,_0x588d7e=_0x5c296a,{journeys:_0x100e22,activationStepsById:_0x199aef}=_0x45fcda,_0x4e02f6=new Map(_0x100e22[_0x3990ee(0x22c)](_0x3dbe96=>[_0x3dbe96['id'],_0x3dbe96])),_0x2c7989=_0x100e22[_0x3990ee(0x22c)](_0x1147e3=>({'id':_0x1147e3['id'],'name':_0x1147e3[_0x3990ee(0x1f1)][_0x3990ee(0x259)],'journeyBundleName':_0x1147e3[_0x3990ee(0x1f1)][_0x3990ee(0x20f)]||'','journeyBundleId':_0x1147e3['attributes'][_0x3990ee(0x216)]||'','versionNumber':_0x1147e3[_0x3990ee(0x1f1)][_0x3990ee(0x1f3)],'description':_0x1147e3[_0x3990ee(0x1f1)]['description'],'state':_0x1147e3['attributes'][_0x3990ee(0x24a)],'paused':_0x1147e3['attributes'][_0x3990ee(0x1de)],'audienceId':_0x1147e3['attributes'][_0x3990ee(0x245)],'folderId':_0x1147e3[_0x3990ee(0x239)]?.['parentFolder']?.[_0x3990ee(0x1fa)]?.['id'],'createdAt':_0x1147e3[_0x3990ee(0x1f1)]['createdAt'],'updatedAt':_0x1147e3['attributes'][_0x3990ee(0x26d)]})),{emailToId:_0x4cc281,idToEmail:_0x4dc996}=_0x59b358,_0x15e55d=await withSpinner(_0x3990ee(0x260),async()=>{const _0x33a7b2=_0x3990ee,_0x25351d=await _0x8187f8[_0x33a7b2(0x254)]['list']();return buildConnectionMaps(_0x25351d);},{'verbose':_0x2b3261[_0x3990ee(0x205)]})[_0x3990ee(0x24d)](_0x25f2eb=>_0x25f2eb[_0x3990ee(0x1fa)]),_0x1a1801=_0x15e55d['nameToId'],_0x219e9f=_0x15e55d['idToName'],_0x55d050=_0x15e55d[_0x3990ee(0x228)],_0x3e1bda={'emailToIdMap':_0x4cc281,'connectionNameToIdMap':_0x1a1801,'connectionNameToTypeMap':_0x55d050,'getSchema':_0x41b664=>_0x8187f8['connection']['getOutputSchemaWithCache'](_0x41b664)};let {pathToId:_0xe38953,idToPath:_0x14f080}=buildFolderMaps(_0x588d7e);const _0x1cd55a=buildSegmentLookupMap(_0x37cf38,_0x14f080),_0x2678ec=buildSegmentNameToIdMap(_0x37cf38),_0x36ad43=buildJourneyBundleLookupMap(_0x2c7989,_0x14f080);let _0x12ec53;if(_0x5668c4){if(!_0x5668c4[_0x3990ee(0x252)](_0x3990ee(0x232))&&!_0x5668c4[_0x3990ee(0x252)](_0x3990ee(0x21f)))return console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x264)](_0x3990ee(0x1e2)+_0x5668c4+'\x0a')),0x1;_0x12ec53=[_0x5668c4];}else _0x12ec53=findYamlFiles(_0x6b30ad);if(_0x12ec53['length']===0x0)return console['error'](a39_0x3ae5b9[_0x3990ee(0x264)](_0x3990ee(0x270)+_0x6b30ad+'\x0a')),console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x22f)](_0x3990ee(0x241))),0x1;let _0x48fdf7,_0xb177ff;try{const _0x2ed1c7=parseAndClassifyYamlFiles(_0x12ec53,_0x6b30ad,{'skipSegments':_0x2b3261[_0x3990ee(0x23d)]});_0x48fdf7=_0x2ed1c7[_0x3990ee(0x1df)],_0xb177ff=_0x2ed1c7[_0x3990ee(0x20a)];const _0x592cfa=validateParsedFiles(_0x2ed1c7,_0x6b30ad);if(_0x592cfa[_0x3990ee(0x1e3)]>0x0)return console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x264)]('\x0aValidation\x20failed:')),console[_0x3990ee(0x219)](formatValidationErrors(_0x592cfa)),console['error'](a39_0x3ae5b9[_0x3990ee(0x267)](_0x3990ee(0x222))),0x1;}catch(_0x2acc26){return console[_0x3990ee(0x219)](a39_0x3ae5b9['red'](_0x3990ee(0x1ec)+(_0x2acc26 instanceof Error?_0x2acc26[_0x3990ee(0x24e)]:_0x2acc26))),0x1;}if(_0x48fdf7[_0x3990ee(0x1e3)]===0x0&&_0xb177ff[_0x3990ee(0x1e3)]===0x0){const _0x2c8264=_0x2b3261[_0x3990ee(0x23d)]?_0x3990ee(0x237):_0x3990ee(0x25a);return console[_0x3990ee(0x219)](a39_0x3ae5b9['yellow'](_0x3990ee(0x229)+_0x2c8264+_0x3990ee(0x248))),0x0;}const _0x45a6ee=new Map();_0x37cf38[_0x3990ee(0x1e3)]>0x0&&!_0x2b3261[_0x3990ee(0x23d)]&&await withSpinner(_0x3990ee(0x1fc),async()=>{await batchAsync(_0x37cf38,async _0x1e7c35=>{const _0x25c35c=a39_0x692c,_0x1f1751=await _0x8187f8['segment'][_0x25c35c(0x1e0)](_0x4690c6,_0x1e7c35['id']);_0x45a6ee[_0x25c35c(0x1fe)](_0x1e7c35['id'],_0x1f1751);});},{'verbose':_0x2b3261['verbose']});const {segmentFiles:_0x44396f,foldersToCreate:_0x1af83b}=await prepareSegmentFiles(_0x48fdf7,{'segmentByFolderAndName':_0x1cd55a,'activationsBySegmentId':_0x45a6ee,'folderPathToId':_0xe38953,'idToEmailMap':_0x4dc996,'connectionIdToNameMap':_0x219e9f},_0x3e1bda,_0x36b683,_0x184926),_0xe1cd8a=_0x5668c4?[]:findSegmentsToDelete(_0x37cf38,_0x48fdf7[_0x3990ee(0x22c)](({yamlConfig:_0xd7530,folderPath:_0xeb6bf1})=>({'yamlConfig':_0xd7530,'folderPath':resolveTDFolderPath(_0xeb6bf1,_0x36b683,_0x184926)})),_0x14f080,_0x184926,_0x36b683),{journeyFiles:_0x515b0b,foldersToCreate:_0x461273}=await withProgressSpinner(_0x3990ee(0x26a),async _0xe2f7bd=>prepareJourneyFiles(_0xb177ff,{'fetchJourney':async _0x41b594=>_0x8187f8[_0x3990ee(0x237)][_0x3990ee(0x209)](_0x41b594[_0x3990ee(0x262)]),'journeyBundlesByFolderAndName':_0x36ad43,'folderPathToId':_0xe38953,'idToEmailMap':_0x4dc996,'connectionIdToNameMap':_0x219e9f,'existingSegments':_0x37cf38,'parentId':_0x4690c6,'deps':_0x8187f8,'progress':{'update':_0x3becb1=>{const _0x44a149=_0x3990ee;_0xe2f7bd[_0x44a149(0x20e)](_0x3becb1),_0x2b3261[_0x44a149(0x205)]&&console[_0x44a149(0x219)]('\x20\x20'+_0x3becb1);}},'journeyById':_0x4e02f6,'activationStepsById':_0x199aef},_0x36b683,_0x184926),{'verbose':_0x2b3261[_0x3990ee(0x205)]})[_0x3990ee(0x24d)](_0x3cfb45=>_0x3cfb45['data']);for(const _0x5a3c44 of _0x461273){_0x1af83b[_0x3990ee(0x21b)](_0x5a3c44);}const _0x3c61eb=_0x5668c4?[]:findJourneysToDelete(_0x2c7989,_0xb177ff[_0x3990ee(0x22c)](({yamlConfig:_0x19ed92,folderPath:_0x202205})=>({'yamlConfig':_0x19ed92,'folderPath':resolveTDFolderPath(_0x202205,_0x36b683,_0x184926)})),_0x14f080,_0x184926,_0x36b683),_0x5ccad9=calculatePushStats(_0x44396f,_0x515b0b,_0x1af83b,_0xe1cd8a,_0x3c61eb,!!_0x2b3261[_0x3990ee(0x200)],!!_0x2b3261[_0x3990ee(0x23d)]),_0x204b09=_0x5ccad9['segments'][_0x3990ee(0x25d)],_0x19f58a=_0x5ccad9[_0x3990ee(0x1df)][_0x3990ee(0x253)],_0xba99f3=_0x5ccad9[_0x3990ee(0x1df)][_0x3990ee(0x221)],_0x2c585e=_0x5ccad9['segments'][_0x3990ee(0x25e)],_0x5d9bfe=_0x5ccad9[_0x3990ee(0x238)][_0x3990ee(0x247)],_0x51953e=_0x5ccad9['journeys']['new'],_0x40e5df=_0x5ccad9[_0x3990ee(0x20a)][_0x3990ee(0x253)],_0x3fb1e5=_0x5ccad9[_0x3990ee(0x20a)][_0x3990ee(0x221)],_0x327739=_0x5ccad9['journeys'][_0x3990ee(0x25e)],_0x1eadcc=_0x5ccad9[_0x3990ee(0x21d)][_0x3990ee(0x1ef)],_0x443da6=_0x5ccad9['activations'][_0x3990ee(0x247)],_0x59a4e0=_0x5ccad9[_0x3990ee(0x21d)][_0x3990ee(0x21c)],_0x568cf1=_0x5ccad9[_0x3990ee(0x21d)][_0x3990ee(0x25e)];console[_0x3990ee(0x219)](_0x3990ee(0x217)+_0x2d83b6+'\x27:');_0x5d9bfe[_0x3990ee(0x1e3)]>0x0&&console[_0x3990ee(0x219)]('\x20\x20'+a39_0x3ae5b9[_0x3990ee(0x204)](_0x3990ee(0x227)+_0x5d9bfe[_0x3990ee(0x1e3)]+'\x20folders\x20to\x20create'));if(!_0x2b3261[_0x3990ee(0x23d)]){console[_0x3990ee(0x219)](_0x3990ee(0x1f2)),console[_0x3990ee(0x219)](_0x3990ee(0x1f4)+a39_0x3ae5b9[_0x3990ee(0x23b)]('+\x20'+_0x204b09[_0x3990ee(0x1e3)]+_0x3990ee(0x271))),console[_0x3990ee(0x219)](_0x3990ee(0x1f4)+a39_0x3ae5b9['yellow']('~\x20'+_0x19f58a['length']+'\x20changed'));if(_0x2c585e[_0x3990ee(0x1e3)]>0x0)console[_0x3990ee(0x219)](_0x3990ee(0x1f4)+a39_0x3ae5b9[_0x3990ee(0x264)]('-\x20'+_0x2c585e[_0x3990ee(0x1e3)]+_0x3990ee(0x215)));else _0xe1cd8a[_0x3990ee(0x1e3)]>0x0&&!_0x2b3261['delete']&&console[_0x3990ee(0x219)](_0x3990ee(0x1f4)+a39_0x3ae5b9[_0x3990ee(0x201)](_0xe1cd8a[_0x3990ee(0x1e3)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3990ee(0x219)](_0x3990ee(0x1f4)+a39_0x3ae5b9['dim']('=\x20'+_0xba99f3[_0x3990ee(0x1e3)]+_0x3990ee(0x1ff)));}if(_0x515b0b[_0x3990ee(0x1e3)]>0x0||_0x3c61eb[_0x3990ee(0x1e3)]>0x0){console[_0x3990ee(0x219)](_0x3990ee(0x26b)),console['error'](_0x3990ee(0x1f4)+a39_0x3ae5b9[_0x3990ee(0x23b)]('+\x20'+_0x51953e['length']+_0x3990ee(0x271))),console[_0x3990ee(0x219)](_0x3990ee(0x1f4)+a39_0x3ae5b9[_0x3990ee(0x267)]('~\x20'+_0x40e5df[_0x3990ee(0x1e3)]+'\x20changed'));if(_0x327739['length']>0x0)console[_0x3990ee(0x219)](_0x3990ee(0x1f4)+a39_0x3ae5b9['red']('-\x20'+_0x327739[_0x3990ee(0x1e3)]+_0x3990ee(0x215)));else _0x3c61eb[_0x3990ee(0x1e3)]>0x0&&!_0x2b3261[_0x3990ee(0x200)]&&console['error']('\x20\x20\x20\x20'+a39_0x3ae5b9[_0x3990ee(0x201)](_0x3c61eb['length']+_0x3990ee(0x1d8)));console[_0x3990ee(0x219)]('\x20\x20\x20\x20'+a39_0x3ae5b9[_0x3990ee(0x201)]('=\x20'+_0x3fb1e5[_0x3990ee(0x1e3)]+_0x3990ee(0x1ff)));}_0x1eadcc[_0x3990ee(0x1e3)]>0x0&&!_0x2b3261[_0x3990ee(0x23d)]&&(console[_0x3990ee(0x219)](''),console[_0x3990ee(0x219)](_0x3990ee(0x234)),_0x443da6[_0x3990ee(0x1e3)]>0x0&&console[_0x3990ee(0x219)]('\x20\x20\x20\x20'+a39_0x3ae5b9[_0x3990ee(0x23b)]('+\x20'+_0x443da6[_0x3990ee(0x1e3)]+_0x3990ee(0x246))),_0x59a4e0[_0x3990ee(0x1e3)]>0x0&&console[_0x3990ee(0x219)](_0x3990ee(0x1f4)+a39_0x3ae5b9['yellow']('~\x20'+_0x59a4e0[_0x3990ee(0x1e3)]+_0x3990ee(0x251))),_0x568cf1[_0x3990ee(0x1e3)]>0x0&&console[_0x3990ee(0x219)](_0x3990ee(0x1f4)+a39_0x3ae5b9['red']('-\x20'+_0x568cf1[_0x3990ee(0x1e3)]+_0x3990ee(0x215))));console[_0x3990ee(0x219)]('\x20\x20Source:\x20'+a39_0x3ae5b9[_0x3990ee(0x22f)](_0x6b30ad)+'\x0a');if(_0x5d9bfe[_0x3990ee(0x1e3)]>0x0){console[_0x3990ee(0x219)]('Folders\x20to\x20create:');for(const _0x502d46 of _0x5d9bfe){console[_0x3990ee(0x219)]('\x20\x20'+a39_0x3ae5b9[_0x3990ee(0x204)]('+')+'\x20'+_0x502d46);}console[_0x3990ee(0x219)]('');}if(_0x204b09[_0x3990ee(0x1e3)]>0x0&&!_0x2b3261[_0x3990ee(0x23d)])for(const _0x298558 of _0x204b09){const _0x33a456=_0x298558['folderPath']?_0x298558['folderPath']+'/'+_0x298558[_0x3990ee(0x24b)][_0x3990ee(0x259)]:_0x298558[_0x3990ee(0x24b)][_0x3990ee(0x259)],_0x42c378=_0x298558[_0x3990ee(0x24b)]['activations']?.[_0x3990ee(0x1e3)]||0x0,_0x237694=_0x42c378>0x0?a39_0x3ae5b9[_0x3990ee(0x201)]('\x20['+_0x42c378+'\x20activations]'):'';console[_0x3990ee(0x219)]('\x0a'+a39_0x3ae5b9[_0x3990ee(0x23b)](_0x3990ee(0x242))+'\x20'+_0x33a456+_0x237694),console[_0x3990ee(0x219)]('─'[_0x3990ee(0x269)](0x3c)),_0x298558[_0x3990ee(0x21e)]&&console[_0x3990ee(0x219)](_0x298558[_0x3990ee(0x21e)]),console['error']('─'[_0x3990ee(0x269)](0x3c));}if(_0x2c585e[_0x3990ee(0x1e3)]>0x0&&!_0x2b3261[_0x3990ee(0x23d)])for(const _0x2bc578 of _0x2c585e){const _0x512382=_0x2bc578['segmentFolderId']?_0x14f080[_0x3990ee(0x25b)](_0x2bc578[_0x3990ee(0x240)][_0x3990ee(0x257)]())||'':'',_0x3f5ad5=_0x512382?_0x512382+'/'+_0x2bc578[_0x3990ee(0x259)]:_0x2bc578[_0x3990ee(0x259)],_0x5c7870=_0x45a6ee[_0x3990ee(0x25b)](_0x2bc578['id'])||[],_0x4d15a7=_0x5c7870['length']>0x0?a39_0x3ae5b9[_0x3990ee(0x201)]('\x20['+_0x5c7870[_0x3990ee(0x1e3)]+_0x3990ee(0x1fd)):'';console[_0x3990ee(0x219)]('\x0a'+a39_0x3ae5b9[_0x3990ee(0x264)](_0x3990ee(0x250))+'\x20'+_0x3f5ad5+_0x4d15a7),console[_0x3990ee(0x219)]('─'[_0x3990ee(0x269)](0x3c));const _0x160147=segmentWithActivationsToYaml(_0x2bc578,_0x5c7870,undefined,_0x4dc996,_0x219e9f),_0x5f1229=segmentToYamlString(_0x160147),_0x1c5b21=generateDiff(_0x5f1229,'');console[_0x3990ee(0x219)](formatDiffWithColors(_0x1c5b21)),console['error']('─'['repeat'](0x3c));}const _0x3ae57f=_0x44396f['filter'](_0x4db7f9=>!_0x4db7f9[_0x3990ee(0x255)]&&_0x4db7f9[_0x3990ee(0x21e)]);if(_0x3ae57f[_0x3990ee(0x1e3)]>0x0&&!_0x2b3261[_0x3990ee(0x23d)])for(const _0x2100d8 of _0x3ae57f){const _0x5daab3=_0x2100d8['folderPath']?_0x2100d8[_0x3990ee(0x202)]+'/'+_0x2100d8[_0x3990ee(0x24b)][_0x3990ee(0x259)]:_0x2100d8['yamlConfig'][_0x3990ee(0x259)];console[_0x3990ee(0x219)]('\x0a'+a39_0x3ae5b9[_0x3990ee(0x267)]('Changes\x20to:')+'\x20'+_0x5daab3),console[_0x3990ee(0x219)]('─'['repeat'](0x3c)),console[_0x3990ee(0x219)](_0x2100d8[_0x3990ee(0x21e)]),console[_0x3990ee(0x219)]('─'[_0x3990ee(0x269)](0x3c));}if(_0x51953e[_0x3990ee(0x1e3)]>0x0)for(const _0x591c09 of _0x51953e){const _0x2a81d8=_0x591c09[_0x3990ee(0x202)]?_0x591c09[_0x3990ee(0x202)]+'/'+_0x591c09[_0x3990ee(0x24b)]['name']:_0x591c09[_0x3990ee(0x24b)]['name'];console[_0x3990ee(0x219)]('\x0a'+a39_0x3ae5b9[_0x3990ee(0x23b)](_0x3990ee(0x223))+'\x20'+_0x2a81d8),console['error']('─'[_0x3990ee(0x269)](0x3c)),_0x591c09[_0x3990ee(0x21e)]&&console[_0x3990ee(0x219)](_0x591c09['diff']),console[_0x3990ee(0x219)]('─'[_0x3990ee(0x269)](0x3c));}const _0x236e6d=_0x515b0b[_0x3990ee(0x22e)](_0x5c590a=>!_0x5c590a[_0x3990ee(0x255)]&&_0x5c590a[_0x3990ee(0x21e)]);if(_0x236e6d[_0x3990ee(0x1e3)]>0x0)for(const _0x168fa7 of _0x236e6d){const _0x56b2b6=_0x168fa7['folderPath']?_0x168fa7[_0x3990ee(0x202)]+'/'+_0x168fa7[_0x3990ee(0x24b)]['name']:_0x168fa7['yamlConfig'][_0x3990ee(0x259)];console['error']('\x0a'+a39_0x3ae5b9['yellow'](_0x3990ee(0x1e4))+'\x20'+_0x56b2b6),console[_0x3990ee(0x219)]('─'[_0x3990ee(0x269)](0x3c)),console[_0x3990ee(0x219)](_0x168fa7[_0x3990ee(0x21e)]),console[_0x3990ee(0x219)]('─'[_0x3990ee(0x269)](0x3c));}if(_0x327739[_0x3990ee(0x1e3)]>0x0)for(const _0x4814dd of _0x327739){const _0x46d500=_0x4814dd[_0x3990ee(0x1d7)]?_0x14f080[_0x3990ee(0x25b)](_0x4814dd['folderId'])||'':'',_0x22bc97=_0x46d500?_0x46d500+'/'+_0x4814dd[_0x3990ee(0x20f)]:_0x4814dd[_0x3990ee(0x20f)];console[_0x3990ee(0x219)]('\x0a'+a39_0x3ae5b9[_0x3990ee(0x264)](_0x3990ee(0x24f))+'\x20'+_0x22bc97),console[_0x3990ee(0x219)]('─'[_0x3990ee(0x269)](0x3c)),console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x264)](_0x3990ee(0x1ea))),console[_0x3990ee(0x219)]('─'[_0x3990ee(0x269)](0x3c));}if(_0x2b3261[_0x3990ee(0x1f8)])return console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x267)](_0x3990ee(0x226))),0x0;const _0x146b93=_0x2b3261[_0x3990ee(0x23d)]?![]:_0x204b09[_0x3990ee(0x1e3)]>0x0||_0x19f58a[_0x3990ee(0x1e3)]>0x0||_0x2c585e['length']>0x0,_0x5c9ba3=_0x51953e['length']>0x0||_0x40e5df[_0x3990ee(0x1e3)]>0x0||_0x327739[_0x3990ee(0x1e3)]>0x0,_0x31e264=_0x2b3261[_0x3990ee(0x23d)]?![]:_0x1eadcc[_0x3990ee(0x1e3)]>0x0,_0x4f3c26=_0x5d9bfe['length']>0x0;if(!_0x146b93&&!_0x5c9ba3&&!_0x31e264&&!_0x4f3c26){const _0x158003=_0x2b3261['journeysOnly']?_0x3990ee(0x22b):_0x3990ee(0x211);console[_0x3990ee(0x219)](a39_0x3ae5b9['green'](_0x158003));if(_0x5668c4&&_0xba99f3['length']===0x1){const _0x41c037=_0xba99f3[0x0];if(_0x41c037[_0x3990ee(0x1e8)]?.['id']){const _0xe0efad=getConsoleNextUrl(_0x2b3261[_0x3990ee(0x258)],'/app/ps/'+_0x4690c6+'/e/'+_0x41c037['existingSegment']['id']+'/sb/da/esr');console['error'](_0x3990ee(0x1f6)+a39_0x3ae5b9['cyan'](_0xe0efad));}}if(_0x5668c4&&_0x3fb1e5[_0x3990ee(0x1e3)]===0x1){const _0x557d76=_0x3fb1e5[0x0];if(_0x557d76[_0x3990ee(0x1ee)]?.['id']){const _0x309bc9=getConsoleNextUrl(_0x2b3261[_0x3990ee(0x258)],_0x3990ee(0x1e7)+_0x4690c6+_0x3990ee(0x256)+_0x557d76['existingJourney']['id']+_0x3990ee(0x1da));console[_0x3990ee(0x219)]('\x20\x20'+a39_0x3ae5b9[_0x3990ee(0x22f)](_0x309bc9));}}return 0x0;}const _0x5404a2=_0x2b3261[_0x3990ee(0x23d)]?_0x51953e[_0x3990ee(0x1e3)]+_0x40e5df[_0x3990ee(0x1e3)]+_0x327739[_0x3990ee(0x1e3)]+_0x5d9bfe[_0x3990ee(0x1e3)]:_0x204b09[_0x3990ee(0x1e3)]+_0x19f58a[_0x3990ee(0x1e3)]+_0x2c585e[_0x3990ee(0x1e3)]+_0x51953e[_0x3990ee(0x1e3)]+_0x40e5df[_0x3990ee(0x1e3)]+_0x327739[_0x3990ee(0x1e3)]+_0x5d9bfe['length']+_0x1eadcc[_0x3990ee(0x1e3)];if(!_0x2b3261[_0x3990ee(0x236)]&&_0x5404a2>0x0){if(!isInteractive())return console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x264)](_0x3990ee(0x272)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a39_0x3ae5b9[_0x3990ee(0x201)](_0x3990ee(0x23c))),0x1;const _0xb1606=await confirmKey('Push\x20'+_0x5404a2+_0x3990ee(0x265));if(!_0xb1606)return console['error'](a39_0x3ae5b9[_0x3990ee(0x267)]('Aborted.')),0x1;}const _0x3c00ea={'withProgress':async(_0x3a3aca,_0x10f549)=>{const _0x2c127a=_0x3990ee,_0x471931=await withSpinner(_0x3a3aca,_0x10f549,{'verbose':_0x2b3261[_0x2c127a(0x205)]});return{'data':_0x471931[_0x2c127a(0x1fa)]};},'logInfo':_0x3f98d7=>console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x204)]('βœ”\x20'+_0x3f98d7)),'logSuccess':_0x3dcb13=>console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x23b)]('βœ”\x20'+_0x3dcb13)),'logWarning':_0x1acf68=>console[_0x3990ee(0x219)](a39_0x3ae5b9[_0x3990ee(0x267)]('⚠\x20'+_0x1acf68)),'logDeleted':_0x5aa6e2=>console[_0x3990ee(0x219)](a39_0x3ae5b9['red']('βœ”\x20'+_0x5aa6e2))},_0x5a00cd={'segment':_0x8187f8[_0x3990ee(0x214)],'journey':_0x8187f8[_0x3990ee(0x237)],'user':_0x8187f8[_0x3990ee(0x1e6)],'connection':_0x8187f8[_0x3990ee(0x254)]};_0x5d9bfe[_0x3990ee(0x1e3)]>0x0&&(_0xe38953=await executePushFolders(_0x5a00cd,_0x5d9bfe,_0xe38953,{'parentId':_0x4690c6},_0x3c00ea));const _0x402c03={'rootFolderId':_0xfa3b3f,'folderPathToId':_0xe38953,'folderIdToPath':_0x14f080,'segmentNameToId':_0x2678ec,'activationsBySegmentId':_0x45a6ee,'emailToIdMap':_0x4cc281,'idToEmailMap':_0x4dc996,'connectionNameToIdMap':_0x15e55d['nameToId'],'connectionIdToNameMap':_0x15e55d[_0x3990ee(0x230)],'connectionNameToTypeMap':_0x55d050},_0x468780=await executePushSegments(_0x5a00cd,_0x2b3261[_0x3990ee(0x23d)]?[]:_0x44396f,_0x402c03,{'parentId':_0x4690c6},_0x3c00ea),_0x5f5999=_0x468780[_0x3990ee(0x23a)],_0x3785eb=_0x468780[_0x3990ee(0x1f7)],_0x39ddca=_0x468780[_0x3990ee(0x21d)][_0x3990ee(0x23a)],_0x1329fb=_0x468780[_0x3990ee(0x21d)][_0x3990ee(0x1f7)],_0x4dbfba=_0x468780[_0x3990ee(0x21d)][_0x3990ee(0x1f5)];let _0x5f1780;if(_0x5668c4&&_0x44396f[_0x3990ee(0x1e3)]===0x1){const _0x1caa5a=_0x44396f[0x0];_0x5f1780=_0x1caa5a['existingSegment']?.['id']??_0x468780[_0x3990ee(0x206)][_0x3990ee(0x25b)](_0x1caa5a[_0x3990ee(0x24b)]['name']);}const _0x12b018=await executePushSegmentDeletions(_0x5a00cd,_0x2b3261[_0x3990ee(0x23d)]?[]:_0x2c585e,_0x3c00ea);let _0x1809d3=0x0,_0x10a8ae=0x0,_0x1ffb56=0x0;const _0x353894=new Map(_0x2678ec);for(const [_0x57451f,_0x36f90a]of _0x468780[_0x3990ee(0x206)]){_0x353894[_0x3990ee(0x1fe)](_0x57451f,_0x36f90a);}if(_0x515b0b[_0x3990ee(0x1e3)]>0x0){const _0xf57025={..._0x402c03,'segmentNameToId':_0x353894,'existingSegments':_0x37cf38,'activationContext':_0x3e1bda},_0x47c87b=await executePushJourneys(_0x5a00cd,_0x515b0b,_0xf57025,{'parentId':_0x4690c6,'rootFolderId':_0xfa3b3f,'verbose':_0x2b3261[_0x3990ee(0x205)]},_0x3c00ea);_0x1809d3=_0x47c87b['created'],_0x10a8ae=_0x47c87b[_0x3990ee(0x1f7)];if(_0x5668c4&&_0x47c87b[_0x3990ee(0x266)]['length']===0x1){const _0x4e19ed=_0x47c87b[_0x3990ee(0x266)][0x0];if(_0x4e19ed['journeyId']){const _0x2aff4d=getConsoleNextUrl(_0x2b3261[_0x3990ee(0x258)],_0x3990ee(0x1e7)+_0x4690c6+_0x3990ee(0x256)+_0x4e19ed['journeyId']+'/j/da/je');console[_0x3990ee(0x219)]('\x20\x20'+a39_0x3ae5b9[_0x3990ee(0x22f)](_0x2aff4d));}}}for(const _0x48de57 of _0x327739){console[_0x3990ee(0x219)](a39_0x3ae5b9['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x48de57[_0x3990ee(0x20f)])),_0x1ffb56++;}const _0x3b14f7=[];if(_0x5f5999>0x0)_0x3b14f7[_0x3990ee(0x21a)](_0x5f5999+_0x3990ee(0x203));if(_0x3785eb>0x0)_0x3b14f7[_0x3990ee(0x21a)](_0x3785eb+_0x3990ee(0x1d9));if(_0x12b018>0x0)_0x3b14f7[_0x3990ee(0x21a)](_0x12b018+'\x20deleted');const _0x480cae=[];if(_0x1809d3>0x0)_0x480cae[_0x3990ee(0x21a)](_0x1809d3+'\x20created');if(_0x10a8ae>0x0)_0x480cae['push'](_0x10a8ae+_0x3990ee(0x1d9));if(_0x1ffb56>0x0)_0x480cae[_0x3990ee(0x21a)](_0x1ffb56+'\x20deleted');const _0x159911=[];if(_0x39ddca>0x0)_0x159911['push'](_0x39ddca+_0x3990ee(0x203));if(_0x1329fb>0x0)_0x159911[_0x3990ee(0x21a)](_0x1329fb+'\x20updated');if(_0x4dbfba>0x0)_0x159911[_0x3990ee(0x21a)](_0x4dbfba+'\x20deleted');console['error'](a39_0x3ae5b9['green'](_0x3990ee(0x23e)));_0x3b14f7['length']>0x0&&!_0x2b3261['journeysOnly']&&console[_0x3990ee(0x219)](_0x3990ee(0x233)+_0x3b14f7['join'](',\x20'));_0x480cae[_0x3990ee(0x1e3)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x480cae[_0x3990ee(0x210)](',\x20'));_0x159911[_0x3990ee(0x1e3)]>0x0&&!_0x2b3261[_0x3990ee(0x23d)]&&console[_0x3990ee(0x219)](_0x3990ee(0x1fb)+_0x159911[_0x3990ee(0x210)](',\x20'));if(_0x5f1780){const _0x3290aa=getConsoleNextUrl(_0x2b3261[_0x3990ee(0x258)],_0x3990ee(0x1e7)+_0x4690c6+_0x3990ee(0x256)+_0x5f1780+_0x3990ee(0x231));console[_0x3990ee(0x219)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x3ae5b9[_0x3990ee(0x22f)](_0x3290aa));}return 0x0;}}