@treasuredata/tdx 2026.3.7 β†’ 2026.3.9

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 (215) 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 +2 -2
  69. package/dist/core/oauth.d.ts.map +1 -1
  70. package/dist/core/oauth.js +1 -1
  71. package/dist/core/oauth.js.map +1 -1
  72. package/dist/core/profile.js +1 -1
  73. package/dist/core/profile.js.map +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/utils.js +1 -1
  84. package/dist/proxy/claude-usage-tracker.js +1 -1
  85. package/dist/proxy/passthrough-server.js +1 -1
  86. package/dist/proxy/sse-usage-parser.js +1 -1
  87. package/dist/sdk/agent/agent-config.js +1 -1
  88. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  89. package/dist/sdk/agent/agent-yaml.js +1 -1
  90. package/dist/sdk/agent/test/evaluator.js +1 -1
  91. package/dist/sdk/agent/test/executor.js +1 -1
  92. package/dist/sdk/agent/test/index.js +1 -1
  93. package/dist/sdk/agent/test/output.js +1 -1
  94. package/dist/sdk/agent/test/parser.js +1 -1
  95. package/dist/sdk/agent/tool-target-registry.js +1 -1
  96. package/dist/sdk/api.js +1 -1
  97. package/dist/sdk/client/cdp-api-client.js +1 -1
  98. package/dist/sdk/client/delivery-api-client.js +1 -1
  99. package/dist/sdk/client/endpoints.js +1 -1
  100. package/dist/sdk/client/endpoints.js.map +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.d.ts +1 -1
  105. package/dist/sdk/client/oauth-refresh.js +1 -1
  106. package/dist/sdk/client/rate-limiter.js +1 -1
  107. package/dist/sdk/client/td-api-client.js +1 -1
  108. package/dist/sdk/client/trino-api-client.js +1 -1
  109. package/dist/sdk/client/workflow-client.js +1 -1
  110. package/dist/sdk/connection-validator.js +1 -1
  111. package/dist/sdk/connection.js +1 -1
  112. package/dist/sdk/delivery.js +1 -1
  113. package/dist/sdk/engage/campaign-pull.js +1 -1
  114. package/dist/sdk/engage/campaign-push.js +1 -1
  115. package/dist/sdk/engage/campaign-validator.js +1 -1
  116. package/dist/sdk/engage/campaign-yaml.js +1 -1
  117. package/dist/sdk/engage/template-pull.js +1 -1
  118. package/dist/sdk/engage/template-push.js +1 -1
  119. package/dist/sdk/engage/template-validator.js +1 -1
  120. package/dist/sdk/engage/template-yaml.js +1 -1
  121. package/dist/sdk/engage/types/campaign-def.js +1 -1
  122. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  123. package/dist/sdk/engage/types/template-schema.js +1 -1
  124. package/dist/sdk/engage.js +1 -1
  125. package/dist/sdk/errors.js +1 -1
  126. package/dist/sdk/index.js +1 -1
  127. package/dist/sdk/io/index.js +1 -1
  128. package/dist/sdk/io/node-filesystem.js +1 -1
  129. package/dist/sdk/job.js +1 -1
  130. package/dist/sdk/journey.js +1 -1
  131. package/dist/sdk/llm/chat-cache.js +1 -1
  132. package/dist/sdk/llm/index.js +1 -1
  133. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  134. package/dist/sdk/llm/model-factors.js +1 -1
  135. package/dist/sdk/personalization.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  144. package/dist/sdk/segment/journey-utils.js +1 -1
  145. package/dist/sdk/segment/journey-utils.js.map +1 -1
  146. package/dist/sdk/segment/journey-validator.js +1 -1
  147. package/dist/sdk/segment/journey-yaml.js +1 -1
  148. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  149. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  150. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  151. package/dist/sdk/segment/pull-workflow.js +1 -1
  152. package/dist/sdk/segment/push-recovery.js +1 -1
  153. package/dist/sdk/segment/push-workflow.js +1 -1
  154. package/dist/sdk/segment/resolution-context.js +1 -1
  155. package/dist/sdk/segment/segment-path-parser.js +1 -1
  156. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  157. package/dist/sdk/segment/segment-validator.js +1 -1
  158. package/dist/sdk/segment/target-resolution.js +1 -1
  159. package/dist/sdk/segment/tdx-config.js +1 -1
  160. package/dist/sdk/segment/types/activation-schema.js +1 -1
  161. package/dist/sdk/segment/types/journey-def.js +1 -1
  162. package/dist/sdk/segment/types/journey-schema.js +1 -1
  163. package/dist/sdk/segment/types/segment-def.js +1 -1
  164. package/dist/sdk/segment/types/segment-schema.js +1 -1
  165. package/dist/sdk/segment/validate-files.js +1 -1
  166. package/dist/sdk/segment/yaml-validator.js +1 -1
  167. package/dist/sdk/segment.js +1 -1
  168. package/dist/sdk/types/index.js +1 -1
  169. package/dist/sdk/types/progress.js +1 -1
  170. package/dist/sdk/user.js +1 -1
  171. package/dist/sdk/util/format-detector.js +1 -1
  172. package/dist/sdk/util/formatters.js +1 -1
  173. package/dist/sdk/util/index.js +1 -1
  174. package/dist/sdk/util/paginate.js +1 -1
  175. package/dist/sdk/util/tree-formatter.js +1 -1
  176. package/dist/sdk/workflow/archive-validation.js +1 -1
  177. package/dist/sdk/workflow/clone-workflow.js +1 -1
  178. package/dist/sdk/workflow/index.js +1 -1
  179. package/dist/sdk/workflow/pull-workflow.js +1 -1
  180. package/dist/sdk/workflow/push-workflow.js +1 -1
  181. package/dist/sdk/workflow/tdx-config.js +1 -1
  182. package/dist/sdk/workflow/workflow-utils.js +1 -1
  183. package/dist/test-utils/command-runner.js +1 -1
  184. package/dist/test-utils/factories.js +1 -1
  185. package/dist/test-utils/fixtures.js +1 -1
  186. package/dist/test-utils/http-mock.js +1 -1
  187. package/dist/test-utils/index.js +1 -1
  188. package/dist/utils/async.js +1 -1
  189. package/dist/utils/colors.js +1 -1
  190. package/dist/utils/diff.js +1 -1
  191. package/dist/utils/file-permissions.js +1 -1
  192. package/dist/utils/file-reader.js +1 -1
  193. package/dist/utils/github-releases.js +1 -1
  194. package/dist/utils/global-cache.js +1 -1
  195. package/dist/utils/json-loader.js +1 -1
  196. package/dist/utils/local-cache.js +1 -1
  197. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  198. package/dist/utils/logger/formatters/index.js +1 -1
  199. package/dist/utils/logger/handlers/console-handler.js +1 -1
  200. package/dist/utils/logger/handlers/file-handler.js +1 -1
  201. package/dist/utils/logger/handlers/index.js +1 -1
  202. package/dist/utils/logger/handlers/null-handler.js +1 -1
  203. package/dist/utils/logger/index.js +1 -1
  204. package/dist/utils/logger/logger.js +1 -1
  205. package/dist/utils/logger/types.js +1 -1
  206. package/dist/utils/option-validation.js +1 -1
  207. package/dist/utils/process.js +1 -1
  208. package/dist/utils/prompt.js +1 -1
  209. package/dist/utils/spinner.js +1 -1
  210. package/dist/utils/sse-parser.js +1 -1
  211. package/dist/utils/string-utils.js +1 -1
  212. package/dist/utils/table-ref-parser.js +1 -1
  213. package/dist/utils/tdx-logger.js +1 -1
  214. package/dist/utils/version-check.js +1 -1
  215. package/package.json +1 -1
@@ -1 +1 @@
1
- const a34_0x84acad=a34_0x2fe9;(function(_0x3ea896,_0x1e197b){const _0x353b09=a34_0x2fe9,_0x8a179b=_0x3ea896();while(!![]){try{const _0x58b06c=-parseInt(_0x353b09(0x169))/0x1+parseInt(_0x353b09(0x145))/0x2*(-parseInt(_0x353b09(0x1a5))/0x3)+parseInt(_0x353b09(0x16f))/0x4*(parseInt(_0x353b09(0x15f))/0x5)+parseInt(_0x353b09(0x1b5))/0x6+-parseInt(_0x353b09(0x18a))/0x7*(-parseInt(_0x353b09(0x172))/0x8)+parseInt(_0x353b09(0x17f))/0x9+parseInt(_0x353b09(0x164))/0xa*(parseInt(_0x353b09(0x1a4))/0xb);if(_0x58b06c===_0x1e197b)break;else _0x8a179b['push'](_0x8a179b['shift']());}catch(_0x18b108){_0x8a179b['push'](_0x8a179b['shift']());}}}(a34_0x1460,0x2ea03));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a34_0x1460(){const _0x514eff=['...','log','Getting\x20schedule\x20history...','run','cron','\x20matching\x20\x22','\x20created','ended_at','format','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','file','Cancelled','queries','Show\x20schedule\x20details','never','jobs','\x20\x20Job\x20ID:\x20','entries','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','1989042prDJyX','356559gAPIyv','time','length','Updating\x20schedule...','Listing\x20scheduled\x20queries...','validate','schedules','trim','options','padEnd','executing_user_id','Running\x20schedule...','\x20\x20Timezone:\x20','Failed\x20to\x20read\x20file:\x20','πŸ“…\x20','site','17310dRvPZo','schedule:delete','schedule:run','status','list','map','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','cyan','update','keys','timezone','Showing\x20first\x20','created_at','ies','Schedule\x20deleted:\x20','user_name','Getting\x20schedule\x20details...','output','Creating\x20schedule:\x20','List\x20scheduled\x20queries','result','type','execute','show','Schedule\x20created:\x20','num','2IRPsJi','priority','d\x20ago','substring','table','updated_at','last_job','schedule:update','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','\x20job','schedule:create','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','h\x20ago','green','success','scheduled_at','lastRun','count','schedule:history','next_run_at','description','yes','\x20\x20Num:\x20','schedule:show','Found\x20','verbose','1735UDMxQY','engine_version','schedule:list','args','round','10pjPrJr','trino','name','query','\x20\x20Type:\x20','358450VsiMTD','abs','end_at','Schedule\x20updated:\x20','history','\x20\x20Cron:\x20','816HKExBO','retry_limit','Update\x20a\x20scheduled\x20query','257720hujuiW','error','limit','\x20\x20Time:\x20','getTime','in\x20','\x20execution','user','(unnamed)','from','Deleting\x20schedule...','join','nextRun','3434148DzcjAx','time_zone','create','\x20\x20Database:\x20','INVALID_ARGUMENT','tsv','red','just\x20now','statusIcon','engineVersion','data','7OLSqjn','dim','database','delay','retryLimit','start_at','max'];a34_0x1460=function(){return _0x514eff;};return a34_0x1460();}import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a34_0x2fe9(_0x4a15e0,_0x18757b){_0x4a15e0=_0x4a15e0-0x134;const _0x14604c=a34_0x1460();let _0x2fe987=_0x14604c[_0x4a15e0];return _0x2fe987;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x19dbc2 from'chalk';function formatRelativeTime(_0x143489){const _0x2bd086=a34_0x2fe9,_0x20a13f=new Date(_0x143489),_0x5db05d=new Date(),_0x4029e3=_0x20a13f[_0x2bd086(0x176)]()-_0x5db05d[_0x2bd086(0x176)](),_0x3f4c3b=Math[_0x2bd086(0x16a)](_0x4029e3)/0x3e8,_0x13fd71=_0x4029e3<0x0;if(_0x3f4c3b<0x3c)return _0x13fd71?_0x2bd086(0x186):'soon';else{if(_0x3f4c3b<0xe10){const _0x2c6be7=Math[_0x2bd086(0x163)](_0x3f4c3b/0x3c);return _0x13fd71?_0x2c6be7+'m\x20ago':'in\x20'+_0x2c6be7+'m';}else{if(_0x3f4c3b<0x15180){const _0x5de006=Math['round'](_0x3f4c3b/0xe10);return _0x13fd71?_0x5de006+_0x2bd086(0x151):_0x2bd086(0x177)+_0x5de006+'h';}else{if(_0x3f4c3b<0x93a80){const _0x2991ba=Math[_0x2bd086(0x163)](_0x3f4c3b/0x15180);return _0x13fd71?_0x2991ba+_0x2bd086(0x147):_0x2bd086(0x177)+_0x2991ba+'d';}else return _0x20a13f['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x161);[a34_0x84acad(0x159)]=a34_0x84acad(0x13e);async[a34_0x84acad(0x141)](_0x1034e6){const _0x130e2b=a34_0x84acad,{options:_0x3bb917,args:_0x324afe,tdx:_0x334a92}=_0x1034e6,_0x1dc603=resolveLimit(_0x3bb917[_0x130e2b(0x174)],DEFAULT_DISPLAY_LIMIT),_0x43cee5=_0x324afe[0x0],_0x530d86=_0x43cee5?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x43cee5+'\x22...':_0x130e2b(0x1a9),_0x5a568c=await withSpinner(_0x530d86,()=>_0x334a92[_0x130e2b(0x1ab)]['listQueries']({'limit':_0x1dc603,'scheduled':!![],'pattern':_0x43cee5}),{'verbose':_0x3bb917[_0x130e2b(0x15e)]}),_0x48c4cb=_0x5a568c[_0x130e2b(0x189)][_0x130e2b(0x19d)],_0x3cbd5b=_0x5a568c[_0x130e2b(0x189)]['pagination']['has_next_page'],_0x1da5ba=_0x43cee5?_0x130e2b(0x196)+_0x43cee5+'\x22':'';_0x3cbd5b?console[_0x130e2b(0x173)](_0x130e2b(0x136)+_0x48c4cb[_0x130e2b(0x1a7)]+'\x20schedules'+_0x1da5ba+'\x20(use\x20--limit\x20to\x20see\x20more)'):console['error'](_0x130e2b(0x15d)+_0x48c4cb[_0x130e2b(0x1a7)]+'\x20scheduled\x20quer'+(_0x48c4cb[_0x130e2b(0x1a7)]!==0x1?_0x130e2b(0x138):'y')+_0x1da5ba);if(_0x3bb917[_0x130e2b(0x199)]==='json'||_0x3bb917[_0x130e2b(0x199)]==='jsonl'||_0x3bb917[_0x130e2b(0x199)]===_0x130e2b(0x149)||_0x3bb917[_0x130e2b(0x199)]===_0x130e2b(0x184)){const _0x5bdc57=_0x48c4cb[_0x130e2b(0x1ba)](_0x55316d=>({'id':_0x55316d['id'],'name':_0x55316d['name'],'cron':_0x55316d['cron'],'database':_0x55316d[_0x130e2b(0x18c)]?.[_0x130e2b(0x166)],'type':_0x55316d[_0x130e2b(0x140)],'timezone':_0x55316d[_0x130e2b(0x180)],'user_name':_0x55316d[_0x130e2b(0x179)]?.[_0x130e2b(0x166)],'updated_at':_0x55316d[_0x130e2b(0x14a)],'next_run_at':_0x55316d['next_run_at'],'last_job_status':_0x55316d[_0x130e2b(0x14b)]?.[_0x130e2b(0x1b8)]}));await handleSDKOutput(_0x5bdc57,_0x3bb917);}else{if(_0x48c4cb['length']===0x0)console[_0x130e2b(0x192)]('No\x20scheduled\x20queries\x20found');else{const _0x27768d=_0x3bb917[_0x130e2b(0x1b4)],_0x51a39c=_0x48c4cb[_0x130e2b(0x1ba)](_0x3c6d23=>{const _0x1ff188=_0x130e2b,_0xe56baf=_0x3c6d23[_0x1ff188(0x14b)]?.[_0x1ff188(0x1b8)]?_0x3c6d23[_0x1ff188(0x14b)][_0x1ff188(0x1b8)]===_0x1ff188(0x153)?'βœ“':'βœ—':'-',_0x278fb5=_0x3c6d23['last_job']?.[_0x1ff188(0x198)]?formatRelativeTime(_0x3c6d23[_0x1ff188(0x14b)][_0x1ff188(0x198)]):_0x1ff188(0x19f),_0x2631fb=_0x3c6d23[_0x1ff188(0x158)]?formatRelativeTime(_0x3c6d23[_0x1ff188(0x158)]):'-',_0x243d16=_0x3c6d23[_0x1ff188(0x195)]||'',_0x527f24=_0x3c6d23[_0x1ff188(0x166)]||_0x1ff188(0x17a),_0x221d72=getConsoleUrl(_0x27768d,'/app/queries/editor?queryId='+_0x3c6d23['id']);return{'statusIcon':_0xe56baf,'lastRun':_0x278fb5,'nextRun':_0x2631fb,'cron':_0x243d16,'name':_0x527f24,'queryUrl':_0x221d72,'status':_0x3c6d23['last_job']?.[_0x1ff188(0x1b8)]};}),_0x491581=Math[_0x130e2b(0x190)](..._0x51a39c['map'](_0x228af9=>_0x228af9['lastRun'][_0x130e2b(0x1a7)])),_0x2f3725=Math[_0x130e2b(0x190)](..._0x51a39c[_0x130e2b(0x1ba)](_0x107249=>_0x107249['nextRun'][_0x130e2b(0x1a7)])),_0x287338=Math[_0x130e2b(0x190)](..._0x51a39c[_0x130e2b(0x1ba)](_0x4fdce6=>_0x4fdce6['cron'][_0x130e2b(0x1a7)])),_0x462882=_0x51a39c[_0x130e2b(0x1ba)](_0x5bbd7c=>{const _0x40d462=_0x130e2b,_0x28c1e2=_0x5bbd7c[_0x40d462(0x1b8)]===_0x40d462(0x153)?a34_0x19dbc2[_0x40d462(0x152)](_0x5bbd7c['statusIcon']):_0x5bbd7c[_0x40d462(0x1b8)]===_0x40d462(0x173)?a34_0x19dbc2[_0x40d462(0x185)](_0x5bbd7c[_0x40d462(0x187)]):a34_0x19dbc2[_0x40d462(0x18b)](_0x5bbd7c[_0x40d462(0x187)]),_0x390ce9=_0x5bbd7c[_0x40d462(0x155)][_0x40d462(0x1ae)](_0x491581),_0x1b949e=_0x5bbd7c[_0x40d462(0x17e)]['padEnd'](_0x2f3725),_0x251812=_0x5bbd7c[_0x40d462(0x195)]?a34_0x19dbc2[_0x40d462(0x1bd)](_0x5bbd7c[_0x40d462(0x195)]['padEnd'](_0x287338)):'\x20'['repeat'](_0x287338),_0x409c51=hyperlink(_0x5bbd7c[_0x40d462(0x166)],_0x5bbd7c['queryUrl']);return _0x40d462(0x1b3)+_0x28c1e2+'\x20'+_0x390ce9+'\x20\x20β†’\x20'+_0x1b949e+'\x20\x20'+_0x251812+'\x20\x20'+_0x409c51;});await writeOutput(_0x462882[_0x130e2b(0x17d)]('\x0a'),_0x3bb917[_0x130e2b(0x13c)],_0x130e2b(0x1b9));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a34_0x84acad(0x15c);[a34_0x84acad(0x159)]=a34_0x84acad(0x19e);['validate'](_0x4c4ec6){const _0x280097=a34_0x84acad,_0x242288=_0x4c4ec6[_0x280097(0x162)][0x0];if(!_0x242288)return _0x280097(0x14d);return undefined;}async[a34_0x84acad(0x141)](_0x205b48){const _0x15bf41=a34_0x84acad,{options:_0x91f922,args:_0x904824,tdx:_0x5c03b8}=_0x205b48,_0x6756cd=_0x904824[0x0],_0x24371b=await withSpinner(_0x15bf41(0x13b),()=>_0x5c03b8[_0x15bf41(0x1ab)][_0x15bf41(0x142)](_0x6756cd),{'verbose':_0x91f922[_0x15bf41(0x15e)]}),_0xab4354=_0x24371b[_0x15bf41(0x189)],_0x519474={'name':_0xab4354[_0x15bf41(0x166)],'cron':_0xab4354[_0x15bf41(0x195)],'database':_0xab4354['database'],'type':_0xab4354[_0x15bf41(0x140)],'timezone':_0xab4354[_0x15bf41(0x135)],'user_name':_0xab4354[_0x15bf41(0x13a)],'created_at':_0xab4354['created_at'],'engine_version':_0xab4354[_0x15bf41(0x160)],'executing_user_id':_0xab4354[_0x15bf41(0x1af)],'query':_0xab4354[_0x15bf41(0x167)],'delay':_0xab4354[_0x15bf41(0x18d)],'priority':_0xab4354[_0x15bf41(0x146)],'retry_limit':_0xab4354[_0x15bf41(0x170)],..._0xab4354['result']&&{'result':_0xab4354[_0x15bf41(0x13f)]}};return await handleSingleObjectOutput(_0x519474,_0x91f922),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x14f);['description']='Create\x20a\x20scheduled\x20query';[a34_0x84acad(0x1aa)](_0x34c4bb){const _0x5b32d4=a34_0x84acad,_0x327a27=_0x34c4bb['args'][0x0];if(!_0x327a27)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x467ad1=_0x34c4bb[_0x5b32d4(0x1ad)];if(!_0x467ad1['database'])return _0x5b32d4(0x19a);return undefined;}async[a34_0x84acad(0x141)](_0xad807){const _0x4e3fde=a34_0x84acad,{options:_0x95373,args:_0x52b86a,tdx:_0x535edd}=_0xad807,_0x5935c4=_0x52b86a[0x0],_0x15bb03=_0x95373,_0x16ddc2=_0x15bb03['database'],_0x134e89=_0x15bb03['file'],_0x5cd7d8=_0x15bb03['type']||_0x4e3fde(0x165);let _0x14ea68;try{_0x14ea68=readFileSync(_0x134e89,'utf-8')[_0x4e3fde(0x1ac)]();}catch(_0x3730f0){throw new SDKError(ErrorCode[_0x4e3fde(0x183)],_0x4e3fde(0x1b2)+_0x134e89,_0x3730f0 instanceof Error?_0x3730f0:undefined);}if(!_0x14ea68)throw new SDKError(ErrorCode[_0x4e3fde(0x183)],'Query\x20file\x20is\x20empty');const _0x2779dc={'database':_0x16ddc2,'query':_0x14ea68,'type':_0x5cd7d8};if(_0x15bb03[_0x4e3fde(0x195)])_0x2779dc[_0x4e3fde(0x195)]=_0x15bb03['cron'];if(_0x15bb03[_0x4e3fde(0x135)])_0x2779dc[_0x4e3fde(0x135)]=_0x15bb03[_0x4e3fde(0x135)];if(_0x15bb03['delay']!==undefined)_0x2779dc[_0x4e3fde(0x18d)]=Number(_0x15bb03[_0x4e3fde(0x18d)]);if(_0x15bb03[_0x4e3fde(0x146)]!==undefined)_0x2779dc[_0x4e3fde(0x146)]=Number(_0x15bb03[_0x4e3fde(0x146)]);if(_0x15bb03[_0x4e3fde(0x18e)]!==undefined)_0x2779dc[_0x4e3fde(0x170)]=Number(_0x15bb03[_0x4e3fde(0x18e)]);if(_0x15bb03[_0x4e3fde(0x188)])_0x2779dc[_0x4e3fde(0x160)]=_0x15bb03[_0x4e3fde(0x188)];if(_0x15bb03[_0x4e3fde(0x13f)])_0x2779dc[_0x4e3fde(0x13f)]=_0x15bb03[_0x4e3fde(0x13f)];if(_0x95373[_0x4e3fde(0x15e)]){console[_0x4e3fde(0x173)](_0x4e3fde(0x13d)+_0x5935c4),console['error'](_0x4e3fde(0x182)+_0x16ddc2),console[_0x4e3fde(0x173)](_0x4e3fde(0x168)+_0x5cd7d8);if(_0x2779dc[_0x4e3fde(0x195)])console[_0x4e3fde(0x173)](_0x4e3fde(0x16e)+_0x2779dc['cron']);if(_0x2779dc['timezone'])console[_0x4e3fde(0x173)](_0x4e3fde(0x1b1)+_0x2779dc[_0x4e3fde(0x135)]);}const _0x32076e=await withSpinner('Creating\x20schedule...',()=>_0x535edd[_0x4e3fde(0x1ab)][_0x4e3fde(0x181)](_0x5935c4,_0x2779dc),{'verbose':_0x95373[_0x4e3fde(0x15e)]});return console[_0x4e3fde(0x173)](_0x4e3fde(0x143)+_0x32076e[_0x4e3fde(0x189)]['name']),await handleSingleObjectOutput(_0x32076e[_0x4e3fde(0x189)],_0x95373),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x14c);[a34_0x84acad(0x159)]=a34_0x84acad(0x171);[a34_0x84acad(0x1aa)](_0x4a1b82){const _0x1e5488=a34_0x84acad,_0x411975=_0x4a1b82['args'][0x0];if(!_0x411975)return _0x1e5488(0x1bc);return undefined;}async[a34_0x84acad(0x141)](_0x5b096d){const _0x378385=a34_0x84acad,{options:_0xf38ff6,args:_0x2ac877,tdx:_0x21b96a}=_0x5b096d,_0x2ab865=_0x2ac877[0x0],_0x1aa1b9=_0xf38ff6,_0x3a2aec={};if(_0x1aa1b9[_0x378385(0x18c)])_0x3a2aec['database']=_0x1aa1b9[_0x378385(0x18c)];if(_0x1aa1b9[_0x378385(0x140)])_0x3a2aec[_0x378385(0x140)]=_0x1aa1b9[_0x378385(0x140)];if(_0x1aa1b9[_0x378385(0x195)])_0x3a2aec['cron']=_0x1aa1b9[_0x378385(0x195)];if(_0x1aa1b9[_0x378385(0x135)])_0x3a2aec[_0x378385(0x135)]=_0x1aa1b9[_0x378385(0x135)];if(_0x1aa1b9[_0x378385(0x18d)]!==undefined)_0x3a2aec[_0x378385(0x18d)]=Number(_0x1aa1b9[_0x378385(0x18d)]);if(_0x1aa1b9[_0x378385(0x146)]!==undefined)_0x3a2aec['priority']=Number(_0x1aa1b9[_0x378385(0x146)]);if(_0x1aa1b9['retryLimit']!==undefined)_0x3a2aec[_0x378385(0x170)]=Number(_0x1aa1b9[_0x378385(0x18e)]);if(_0x1aa1b9[_0x378385(0x188)])_0x3a2aec['engine_version']=_0x1aa1b9['engineVersion'];if(_0x1aa1b9[_0x378385(0x13f)])_0x3a2aec[_0x378385(0x13f)]=_0x1aa1b9['result'];if(_0x1aa1b9[_0x378385(0x19b)])try{_0x3a2aec['query']=readFileSync(_0x1aa1b9[_0x378385(0x19b)],'utf-8')[_0x378385(0x1ac)]();}catch(_0x3ea1d2){throw new SDKError(ErrorCode[_0x378385(0x183)],_0x378385(0x1b2)+_0x1aa1b9[_0x378385(0x19b)],_0x3ea1d2 instanceof Error?_0x3ea1d2:undefined);}if(Object[_0x378385(0x134)](_0x3a2aec)['length']===0x0)throw new SDKError(ErrorCode[_0x378385(0x183)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0xf38ff6[_0x378385(0x15e)]){console['error']('Updating\x20schedule:\x20'+_0x2ab865);for(const [_0x569754,_0x250ab0]of Object[_0x378385(0x1a2)](_0x3a2aec)){_0x569754===_0x378385(0x167)?console[_0x378385(0x173)]('\x20\x20'+_0x569754+':\x20'+_0x250ab0[_0x378385(0x148)](0x0,0x32)+_0x378385(0x191)):console[_0x378385(0x173)]('\x20\x20'+_0x569754+':\x20'+_0x250ab0);}}const _0x3c83d9=await withSpinner(_0x378385(0x1a8),()=>_0x21b96a[_0x378385(0x1ab)][_0x378385(0x1be)](_0x2ab865,_0x3a2aec),{'verbose':_0xf38ff6[_0x378385(0x15e)]});return console[_0x378385(0x173)](_0x378385(0x16c)+_0x3c83d9[_0x378385(0x189)][_0x378385(0x166)]),await handleSingleObjectOutput(_0x3c83d9['data'],_0xf38ff6),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a34_0x84acad(0x1b6);['description']='Delete\x20a\x20scheduled\x20query';['validate'](_0x50ca28){const _0x25a4ac=a34_0x84acad,_0x55e7a3=_0x50ca28[_0x25a4ac(0x162)][0x0];if(!_0x55e7a3)return _0x25a4ac(0x1a3);return undefined;}async[a34_0x84acad(0x141)](_0x175d88){const _0x3319c5=a34_0x84acad,{options:_0x266942,args:_0x3ff002,tdx:_0xeabd60}=_0x175d88,_0x1a0da1=_0x3ff002[0x0];if(!_0x266942[_0x3319c5(0x15a)]){const _0x208274=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x1a0da1+'\x22?');if(!_0x208274)return console['error'](_0x3319c5(0x19c)),0x0;}const _0x166a11=await withSpinner(_0x3319c5(0x17c),()=>_0xeabd60[_0x3319c5(0x1ab)]['delete'](_0x1a0da1),{'verbose':_0x266942[_0x3319c5(0x15e)]});return console[_0x3319c5(0x173)](_0x3319c5(0x139)+_0x166a11[_0x3319c5(0x189)][_0x3319c5(0x166)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x1b7);['description']='Run\x20a\x20scheduled\x20query\x20immediately';[a34_0x84acad(0x1aa)](_0x13ff56){const _0x51622d=a34_0x84acad,_0x4017eb=_0x13ff56[_0x51622d(0x162)][0x0];if(!_0x4017eb)return _0x51622d(0x1bb);return undefined;}async[a34_0x84acad(0x141)](_0x2fcd83){const _0x2e54e3=a34_0x84acad,{options:_0x2bbd95,args:_0xd127b6,tdx:_0x4cee44}=_0x2fcd83,_0x3952d1=_0xd127b6[0x0],_0x553cfa=_0x2bbd95,_0x9a8bb=_0x553cfa[_0x2e54e3(0x1a6)],_0x1ecad4=_0x553cfa['num']!==undefined?Number(_0x553cfa[_0x2e54e3(0x144)]):undefined;if(_0x2bbd95[_0x2e54e3(0x15e)]){console[_0x2e54e3(0x173)]('Running\x20schedule:\x20'+_0x3952d1);if(_0x9a8bb)console['error'](_0x2e54e3(0x175)+_0x9a8bb);if(_0x1ecad4)console['error'](_0x2e54e3(0x15b)+_0x1ecad4);}const _0x14bbdb=await withSpinner(_0x2e54e3(0x1b0),()=>_0x4cee44[_0x2e54e3(0x1ab)][_0x2e54e3(0x194)](_0x3952d1,{'time':_0x9a8bb,'num':_0x1ecad4}),{'verbose':_0x2bbd95[_0x2e54e3(0x15e)]}),_0x5aea83=_0x14bbdb[_0x2e54e3(0x189)][_0x2e54e3(0x1a0)];console['error']('Schedule\x20run\x20submitted:\x20'+_0x5aea83[_0x2e54e3(0x1a7)]+_0x2e54e3(0x14e)+(_0x5aea83[_0x2e54e3(0x1a7)]!==0x1?'s':'')+_0x2e54e3(0x197));for(const _0x2e31a9 of _0x5aea83){console[_0x2e54e3(0x173)](_0x2e54e3(0x1a1)+_0x2e31a9['job_id']);}return await handleSDKOutput(_0x5aea83,_0x2bbd95),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x84acad(0x166)]=a34_0x84acad(0x157);[a34_0x84acad(0x159)]='Show\x20schedule\x20execution\x20history';[a34_0x84acad(0x1aa)](_0x52488d){const _0x31b5c6=a34_0x84acad,_0xdc03c1=_0x52488d['args'][0x0];if(!_0xdc03c1)return _0x31b5c6(0x150);return undefined;}async[a34_0x84acad(0x141)](_0x91c0a7){const _0x47facd=a34_0x84acad,{options:_0x3e708e,args:_0x10b891,tdx:_0x1de1c4}=_0x91c0a7,_0x1429d6=_0x10b891[0x0],_0x33a48c=_0x3e708e,_0xbafe6a=_0x33a48c[_0x47facd(0x17b)]!==undefined?Number(_0x33a48c[_0x47facd(0x17b)]):undefined,_0x548ffd=_0x33a48c['to']!==undefined?Number(_0x33a48c['to']):undefined,_0x5729d0=await withSpinner(_0x47facd(0x193),()=>_0x1de1c4[_0x47facd(0x1ab)][_0x47facd(0x16d)](_0x1429d6,{'from':_0xbafe6a,'to':_0x548ffd}),{'verbose':_0x3e708e[_0x47facd(0x15e)]}),_0x274542=_0x5729d0[_0x47facd(0x189)];console['error'](_0x47facd(0x15d)+_0x274542['count']+_0x47facd(0x178)+(_0x274542[_0x47facd(0x156)]!==0x1?'s':'')+'\x20(showing\x20'+_0x274542[_0x47facd(0x17b)]+'-'+_0x274542['to']+')');const _0x4f1d03=_0x274542[_0x47facd(0x16d)][_0x47facd(0x1ba)](_0x5a6341=>({'job_id':_0x5a6341['job_id'],'type':_0x5a6341[_0x47facd(0x140)],'status':_0x5a6341['status'],'scheduled_at':_0x5a6341[_0x47facd(0x154)],'created_at':_0x5a6341[_0x47facd(0x137)],'start_at':_0x5a6341[_0x47facd(0x18f)],'end_at':_0x5a6341[_0x47facd(0x16b)]}));return await handleSDKOutput(_0x4f1d03,_0x3e708e),0x0;}}
1
+ const a34_0x10ae5f=a34_0x3771;(function(_0x5670ed,_0x52cc26){const _0x3efe11=a34_0x3771,_0x1fd5bf=_0x5670ed();while(!![]){try{const _0x190a76=parseInt(_0x3efe11(0x1db))/0x1+parseInt(_0x3efe11(0x230))/0x2+-parseInt(_0x3efe11(0x244))/0x3*(parseInt(_0x3efe11(0x1d3))/0x4)+-parseInt(_0x3efe11(0x245))/0x5*(-parseInt(_0x3efe11(0x1fc))/0x6)+parseInt(_0x3efe11(0x242))/0x7*(-parseInt(_0x3efe11(0x202))/0x8)+parseInt(_0x3efe11(0x241))/0x9+-parseInt(_0x3efe11(0x1e2))/0xa;if(_0x190a76===_0x52cc26)break;else _0x1fd5bf['push'](_0x1fd5bf['shift']());}catch(_0x36b6e8){_0x1fd5bf['push'](_0x1fd5bf['shift']());}}}(a34_0x5735,0x262a7));import{BaseCommand}from'./command.js';function a34_0x5735(){const _0xebb885=['job_id','length','Schedule\x20deleted:\x20','Updating\x20schedule:\x20','ended_at','output','d\x20ago','jobs','scheduled_at','name','statusIcon','user','(unnamed)','max','user_name','\x20\x20Type:\x20','log','status','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','query','schedule:update','293898gZeMiR','\x20scheduled\x20quer','tsv','schedule:delete','schedule:history','limit','Found\x20','type','create','Creating\x20schedule:\x20','cron','Run\x20a\x20scheduled\x20query\x20immediately','dim','No\x20scheduled\x20queries\x20found','created_at','delay','join','2354940GGTkjl','77BOvLRq','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','10539GUlapR','785EXVUQY','green','Query\x20file\x20is\x20empty','Schedule\x20created:\x20','priority','\x20execution','getTime','\x20schedules','jsonl','Running\x20schedule...','schedules','format','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Creating\x20schedule...','file','INVALID_ARGUMENT','\x20matching\x20\x22','...','listQueries','padEnd','schedule:run','substring','json','red','yes','queries','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Create\x20a\x20scheduled\x20query','map','execute','328yYLGSk','start_at','run','never','retry_limit','Deleting\x20schedule...','round','\x22...','213569iaxqmm','options','\x20created','timezone','time','abs','ies','1976230rzwJtn','\x20\x20Time:\x20','trino','Show\x20schedule\x20execution\x20history','\x20\x20Job\x20ID:\x20','Schedule\x20run\x20submitted:\x20','Failed\x20to\x20read\x20file:\x20','in\x20','engineVersion','\x20job','executing_user_id','Updating\x20schedule...','Getting\x20schedule\x20history...','last_job','count','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','has_next_page','engine_version','h\x20ago','result','repeat','table','verbose','Searching\x20scheduled\x20queries\x20matching\x20\x22','\x20\x20Num:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','7974ujiAAi','pagination','error','entries','m\x20ago','description','137320JaLsTV','next_run_at','lastRun','num','data','Delete\x20a\x20scheduled\x20query','time_zone','toLocaleDateString','success','site','args','database','just\x20now','validate','nextRun','history','utf-8','schedule:create','from','retryLimit','Running\x20schedule:\x20','List\x20scheduled\x20queries','\x20\x20Database:\x20','schedule:show','soon'];a34_0x5735=function(){return _0xebb885;};return a34_0x5735();}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a34_0x1de258 from'chalk';function formatRelativeTime(_0x55edf3){const _0x425af0=a34_0x3771,_0x2a3cac=new Date(_0x55edf3),_0x2f0a4a=new Date(),_0x491fbe=_0x2a3cac['getTime']()-_0x2f0a4a[_0x425af0(0x24b)](),_0x56141a=Math[_0x425af0(0x1e0)](_0x491fbe)/0x3e8,_0x2ab113=_0x491fbe<0x0;if(_0x56141a<0x3c)return _0x2ab113?_0x425af0(0x20e):_0x425af0(0x21a);else{if(_0x56141a<0xe10){const _0x5b7c16=Math[_0x425af0(0x1d9)](_0x56141a/0x3c);return _0x2ab113?_0x5b7c16+_0x425af0(0x200):'in\x20'+_0x5b7c16+'m';}else{if(_0x56141a<0x15180){const _0x17bc6d=Math[_0x425af0(0x1d9)](_0x56141a/0xe10);return _0x2ab113?_0x17bc6d+_0x425af0(0x1f4):_0x425af0(0x1e9)+_0x17bc6d+'h';}else{if(_0x56141a<0x93a80){const _0x1cdc44=Math['round'](_0x56141a/0x15180);return _0x2ab113?_0x1cdc44+_0x425af0(0x221):_0x425af0(0x1e9)+_0x1cdc44+'d';}else return _0x2a3cac[_0x425af0(0x209)]();}}}}export class ScheduleListCommand extends BaseCommand{[a34_0x10ae5f(0x224)]='schedule:list';[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x217);async[a34_0x10ae5f(0x1d2)](_0x8b5a15){const _0x557c49=a34_0x10ae5f,{options:_0x5860c5,args:_0x226e6b,tdx:_0x1c5a4c}=_0x8b5a15,_0x493fdb=resolveLimit(_0x5860c5[_0x557c49(0x235)],DEFAULT_DISPLAY_LIMIT),_0xee06b1=_0x226e6b[0x0],_0x5d5b57=_0xee06b1?_0x557c49(0x1f9)+_0xee06b1+_0x557c49(0x1da):'Listing\x20scheduled\x20queries...',_0x2c1c51=await withSpinner(_0x5d5b57,()=>_0x1c5a4c[_0x557c49(0x24f)][_0x557c49(0x1c7)]({'limit':_0x493fdb,'scheduled':!![],'pattern':_0xee06b1}),{'verbose':_0x5860c5['verbose']}),_0x4966bb=_0x2c1c51[_0x557c49(0x206)][_0x557c49(0x1ce)],_0x5cd4b2=_0x2c1c51[_0x557c49(0x206)][_0x557c49(0x1fd)][_0x557c49(0x1f2)],_0x1ae254=_0xee06b1?_0x557c49(0x255)+_0xee06b1+'\x22':'';_0x5cd4b2?console['error']('Showing\x20first\x20'+_0x4966bb[_0x557c49(0x21c)]+_0x557c49(0x24c)+_0x1ae254+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x557c49(0x1fe)](_0x557c49(0x236)+_0x4966bb[_0x557c49(0x21c)]+_0x557c49(0x231)+(_0x4966bb[_0x557c49(0x21c)]!==0x1?_0x557c49(0x1e1):'y')+_0x1ae254);if(_0x5860c5['format']===_0x557c49(0x1cb)||_0x5860c5['format']===_0x557c49(0x24d)||_0x5860c5['format']===_0x557c49(0x1f7)||_0x5860c5[_0x557c49(0x250)]===_0x557c49(0x232)){const _0x5b1ad2=_0x4966bb[_0x557c49(0x1d1)](_0x51ab3c=>({'id':_0x51ab3c['id'],'name':_0x51ab3c[_0x557c49(0x224)],'cron':_0x51ab3c[_0x557c49(0x23a)],'database':_0x51ab3c['database']?.['name'],'type':_0x51ab3c[_0x557c49(0x237)],'timezone':_0x51ab3c[_0x557c49(0x208)],'user_name':_0x51ab3c[_0x557c49(0x226)]?.[_0x557c49(0x224)],'updated_at':_0x51ab3c['updated_at'],'next_run_at':_0x51ab3c['next_run_at'],'last_job_status':_0x51ab3c[_0x557c49(0x1ef)]?.[_0x557c49(0x22c)]}));await handleSDKOutput(_0x5b1ad2,_0x5860c5);}else{if(_0x4966bb[_0x557c49(0x21c)]===0x0)console[_0x557c49(0x22b)](_0x557c49(0x23d));else{const _0x3376d7=_0x5860c5[_0x557c49(0x20b)],_0x23264c=_0x4966bb[_0x557c49(0x1d1)](_0x17e893=>{const _0x17efe2=_0x557c49,_0x3b1a3c=_0x17e893[_0x17efe2(0x1ef)]?.[_0x17efe2(0x22c)]?_0x17e893[_0x17efe2(0x1ef)][_0x17efe2(0x22c)]===_0x17efe2(0x20a)?'βœ“':'βœ—':'-',_0x4b56e5=_0x17e893[_0x17efe2(0x1ef)]?.[_0x17efe2(0x21f)]?formatRelativeTime(_0x17e893[_0x17efe2(0x1ef)]['ended_at']):_0x17efe2(0x1d6),_0x53346e=_0x17e893['next_run_at']?formatRelativeTime(_0x17e893[_0x17efe2(0x203)]):'-',_0x240ddd=_0x17e893['cron']||'',_0x57f46b=_0x17e893[_0x17efe2(0x224)]||_0x17efe2(0x227),_0x326b85=getConsoleUrl(_0x3376d7,'/app/queries/editor?queryId='+_0x17e893['id']);return{'statusIcon':_0x3b1a3c,'lastRun':_0x4b56e5,'nextRun':_0x53346e,'cron':_0x240ddd,'name':_0x57f46b,'queryUrl':_0x326b85,'status':_0x17e893[_0x17efe2(0x1ef)]?.[_0x17efe2(0x22c)]};}),_0x633590=Math[_0x557c49(0x228)](..._0x23264c[_0x557c49(0x1d1)](_0x26bb49=>_0x26bb49[_0x557c49(0x204)]['length'])),_0x329948=Math['max'](..._0x23264c[_0x557c49(0x1d1)](_0x2dce57=>_0x2dce57[_0x557c49(0x210)][_0x557c49(0x21c)])),_0x55efeb=Math[_0x557c49(0x228)](..._0x23264c[_0x557c49(0x1d1)](_0x3c4d24=>_0x3c4d24['cron'][_0x557c49(0x21c)])),_0x384a04=_0x23264c[_0x557c49(0x1d1)](_0x24299d=>{const _0x33a00c=_0x557c49,_0x386782=_0x24299d[_0x33a00c(0x22c)]===_0x33a00c(0x20a)?a34_0x1de258[_0x33a00c(0x246)](_0x24299d[_0x33a00c(0x225)]):_0x24299d['status']===_0x33a00c(0x1fe)?a34_0x1de258[_0x33a00c(0x1cc)](_0x24299d[_0x33a00c(0x225)]):a34_0x1de258[_0x33a00c(0x23c)](_0x24299d[_0x33a00c(0x225)]),_0x383c5c=_0x24299d[_0x33a00c(0x204)][_0x33a00c(0x1c8)](_0x633590),_0x1cf4bc=_0x24299d[_0x33a00c(0x210)][_0x33a00c(0x1c8)](_0x329948),_0x4f13fd=_0x24299d['cron']?a34_0x1de258['cyan'](_0x24299d['cron'][_0x33a00c(0x1c8)](_0x55efeb)):'\x20'[_0x33a00c(0x1f6)](_0x55efeb),_0x3f135b=hyperlink(_0x24299d[_0x33a00c(0x224)],_0x24299d['queryUrl']);return'πŸ“…\x20'+_0x386782+'\x20'+_0x383c5c+'\x20\x20β†’\x20'+_0x1cf4bc+'\x20\x20'+_0x4f13fd+'\x20\x20'+_0x3f135b;});await writeOutput(_0x384a04[_0x557c49(0x240)]('\x0a'),_0x5860c5[_0x557c49(0x220)],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x219);[a34_0x10ae5f(0x201)]='Show\x20schedule\x20details';[a34_0x10ae5f(0x20f)](_0x1eeb7c){const _0x420b72=a34_0x10ae5f,_0x4d2995=_0x1eeb7c[_0x420b72(0x20c)][0x0];if(!_0x4d2995)return _0x420b72(0x22d);return undefined;}async[a34_0x10ae5f(0x1d2)](_0x4f6caa){const _0x273d66=a34_0x10ae5f,{options:_0x4c9154,args:_0xfc488b,tdx:_0x5a110f}=_0x4f6caa,_0x1154d2=_0xfc488b[0x0],_0x80599d=await withSpinner('Getting\x20schedule\x20details...',()=>_0x5a110f['schedules']['show'](_0x1154d2),{'verbose':_0x4c9154[_0x273d66(0x1f8)]}),_0xd9d124=_0x80599d[_0x273d66(0x206)],_0x1bb391={'name':_0xd9d124[_0x273d66(0x224)],'cron':_0xd9d124[_0x273d66(0x23a)],'database':_0xd9d124['database'],'type':_0xd9d124[_0x273d66(0x237)],'timezone':_0xd9d124[_0x273d66(0x1de)],'user_name':_0xd9d124[_0x273d66(0x229)],'created_at':_0xd9d124[_0x273d66(0x23e)],'engine_version':_0xd9d124[_0x273d66(0x1f3)],'executing_user_id':_0xd9d124[_0x273d66(0x1ec)],'query':_0xd9d124[_0x273d66(0x22e)],'delay':_0xd9d124[_0x273d66(0x23f)],'priority':_0xd9d124[_0x273d66(0x249)],'retry_limit':_0xd9d124[_0x273d66(0x1d7)],..._0xd9d124[_0x273d66(0x1f5)]&&{'result':_0xd9d124[_0x273d66(0x1f5)]}};return await handleSingleObjectOutput(_0x1bb391,_0x4c9154),0x0;}}function a34_0x3771(_0x2b5a00,_0x18267c){_0x2b5a00=_0x2b5a00-0x1c6;const _0x573588=a34_0x5735();let _0x377166=_0x573588[_0x2b5a00];return _0x377166;}export class ScheduleCreateCommand extends BaseCommand{['name']=a34_0x10ae5f(0x213);[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x1d0);['validate'](_0x148518){const _0x1a86a8=a34_0x10ae5f,_0x3d7083=_0x148518['args'][0x0];if(!_0x3d7083)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x12a9db=_0x148518[_0x1a86a8(0x1dc)];if(!_0x12a9db[_0x1a86a8(0x20d)])return _0x1a86a8(0x243);return undefined;}async['execute'](_0xa17e3a){const _0x1c1424=a34_0x10ae5f,{options:_0x18d024,args:_0xf2dc0c,tdx:_0x33f3a1}=_0xa17e3a,_0x4b234c=_0xf2dc0c[0x0],_0x552d39=_0x18d024,_0x36c120=_0x552d39[_0x1c1424(0x20d)],_0x332541=_0x552d39[_0x1c1424(0x253)],_0x1de2fd=_0x552d39[_0x1c1424(0x237)]||_0x1c1424(0x1e4);let _0x3edba2;try{_0x3edba2=readFileSync(_0x332541,'utf-8')['trim']();}catch(_0x5e2ece){throw new SDKError(ErrorCode[_0x1c1424(0x254)],_0x1c1424(0x1e8)+_0x332541,_0x5e2ece instanceof Error?_0x5e2ece:undefined);}if(!_0x3edba2)throw new SDKError(ErrorCode[_0x1c1424(0x254)],_0x1c1424(0x247));const _0x4dbcca={'database':_0x36c120,'query':_0x3edba2,'type':_0x1de2fd};if(_0x552d39[_0x1c1424(0x23a)])_0x4dbcca['cron']=_0x552d39[_0x1c1424(0x23a)];if(_0x552d39['timezone'])_0x4dbcca[_0x1c1424(0x1de)]=_0x552d39[_0x1c1424(0x1de)];if(_0x552d39[_0x1c1424(0x23f)]!==undefined)_0x4dbcca[_0x1c1424(0x23f)]=Number(_0x552d39[_0x1c1424(0x23f)]);if(_0x552d39[_0x1c1424(0x249)]!==undefined)_0x4dbcca['priority']=Number(_0x552d39['priority']);if(_0x552d39['retryLimit']!==undefined)_0x4dbcca[_0x1c1424(0x1d7)]=Number(_0x552d39[_0x1c1424(0x215)]);if(_0x552d39['engineVersion'])_0x4dbcca[_0x1c1424(0x1f3)]=_0x552d39[_0x1c1424(0x1ea)];if(_0x552d39['result'])_0x4dbcca[_0x1c1424(0x1f5)]=_0x552d39[_0x1c1424(0x1f5)];if(_0x18d024['verbose']){console[_0x1c1424(0x1fe)](_0x1c1424(0x239)+_0x4b234c),console[_0x1c1424(0x1fe)](_0x1c1424(0x218)+_0x36c120),console[_0x1c1424(0x1fe)](_0x1c1424(0x22a)+_0x1de2fd);if(_0x4dbcca[_0x1c1424(0x23a)])console[_0x1c1424(0x1fe)]('\x20\x20Cron:\x20'+_0x4dbcca[_0x1c1424(0x23a)]);if(_0x4dbcca['timezone'])console[_0x1c1424(0x1fe)]('\x20\x20Timezone:\x20'+_0x4dbcca[_0x1c1424(0x1de)]);}const _0x4a6731=await withSpinner(_0x1c1424(0x252),()=>_0x33f3a1[_0x1c1424(0x24f)][_0x1c1424(0x238)](_0x4b234c,_0x4dbcca),{'verbose':_0x18d024[_0x1c1424(0x1f8)]});return console['error'](_0x1c1424(0x248)+_0x4a6731[_0x1c1424(0x206)][_0x1c1424(0x224)]),await handleSingleObjectOutput(_0x4a6731[_0x1c1424(0x206)],_0x18d024),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x22f);[a34_0x10ae5f(0x201)]='Update\x20a\x20scheduled\x20query';[a34_0x10ae5f(0x20f)](_0x579ad0){const _0x10a497=a34_0x10ae5f,_0x25bb86=_0x579ad0[_0x10a497(0x20c)][0x0];if(!_0x25bb86)return _0x10a497(0x251);return undefined;}async[a34_0x10ae5f(0x1d2)](_0xea97ca){const _0x8595cf=a34_0x10ae5f,{options:_0x536cbc,args:_0x3d7325,tdx:_0x172b87}=_0xea97ca,_0x54a6c9=_0x3d7325[0x0],_0x4c457e=_0x536cbc,_0x1336ed={};if(_0x4c457e['database'])_0x1336ed[_0x8595cf(0x20d)]=_0x4c457e[_0x8595cf(0x20d)];if(_0x4c457e[_0x8595cf(0x237)])_0x1336ed[_0x8595cf(0x237)]=_0x4c457e[_0x8595cf(0x237)];if(_0x4c457e[_0x8595cf(0x23a)])_0x1336ed[_0x8595cf(0x23a)]=_0x4c457e[_0x8595cf(0x23a)];if(_0x4c457e[_0x8595cf(0x1de)])_0x1336ed[_0x8595cf(0x1de)]=_0x4c457e[_0x8595cf(0x1de)];if(_0x4c457e[_0x8595cf(0x23f)]!==undefined)_0x1336ed[_0x8595cf(0x23f)]=Number(_0x4c457e[_0x8595cf(0x23f)]);if(_0x4c457e[_0x8595cf(0x249)]!==undefined)_0x1336ed[_0x8595cf(0x249)]=Number(_0x4c457e[_0x8595cf(0x249)]);if(_0x4c457e['retryLimit']!==undefined)_0x1336ed[_0x8595cf(0x1d7)]=Number(_0x4c457e['retryLimit']);if(_0x4c457e[_0x8595cf(0x1ea)])_0x1336ed[_0x8595cf(0x1f3)]=_0x4c457e[_0x8595cf(0x1ea)];if(_0x4c457e[_0x8595cf(0x1f5)])_0x1336ed[_0x8595cf(0x1f5)]=_0x4c457e[_0x8595cf(0x1f5)];if(_0x4c457e[_0x8595cf(0x253)])try{_0x1336ed[_0x8595cf(0x22e)]=readFileSync(_0x4c457e[_0x8595cf(0x253)],_0x8595cf(0x212))['trim']();}catch(_0x57c65b){throw new SDKError(ErrorCode[_0x8595cf(0x254)],_0x8595cf(0x1e8)+_0x4c457e[_0x8595cf(0x253)],_0x57c65b instanceof Error?_0x57c65b:undefined);}if(Object['keys'](_0x1336ed)['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x8595cf(0x1cf));if(_0x536cbc[_0x8595cf(0x1f8)]){console[_0x8595cf(0x1fe)](_0x8595cf(0x21e)+_0x54a6c9);for(const [_0x322cdf,_0xec574a]of Object[_0x8595cf(0x1ff)](_0x1336ed)){_0x322cdf===_0x8595cf(0x22e)?console[_0x8595cf(0x1fe)]('\x20\x20'+_0x322cdf+':\x20'+_0xec574a[_0x8595cf(0x1ca)](0x0,0x32)+_0x8595cf(0x1c6)):console[_0x8595cf(0x1fe)]('\x20\x20'+_0x322cdf+':\x20'+_0xec574a);}}const _0x29dd78=await withSpinner(_0x8595cf(0x1ed),()=>_0x172b87[_0x8595cf(0x24f)]['update'](_0x54a6c9,_0x1336ed),{'verbose':_0x536cbc[_0x8595cf(0x1f8)]});return console[_0x8595cf(0x1fe)]('Schedule\x20updated:\x20'+_0x29dd78['data'][_0x8595cf(0x224)]),await handleSingleObjectOutput(_0x29dd78[_0x8595cf(0x206)],_0x536cbc),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x233);[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x207);[a34_0x10ae5f(0x20f)](_0x30836e){const _0x412484=a34_0x10ae5f,_0x388400=_0x30836e[_0x412484(0x20c)][0x0];if(!_0x388400)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>';return undefined;}async[a34_0x10ae5f(0x1d2)](_0x27097f){const _0x1f1bf4=a34_0x10ae5f,{options:_0x3709f5,args:_0x20df6b,tdx:_0xe7e39c}=_0x27097f,_0x310c4b=_0x20df6b[0x0];if(!_0x3709f5[_0x1f1bf4(0x1cd)]){const _0xc0d75e=await confirm(_0x1f1bf4(0x1fb)+_0x310c4b+'\x22?');if(!_0xc0d75e)return console[_0x1f1bf4(0x1fe)]('Cancelled'),0x0;}const _0x104276=await withSpinner(_0x1f1bf4(0x1d8),()=>_0xe7e39c['schedules']['delete'](_0x310c4b),{'verbose':_0x3709f5['verbose']});return console[_0x1f1bf4(0x1fe)](_0x1f1bf4(0x21d)+_0x104276[_0x1f1bf4(0x206)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x1c9);[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x23b);['validate'](_0x475f0f){const _0x11ccea=a34_0x10ae5f,_0xde841e=_0x475f0f[_0x11ccea(0x20c)][0x0];if(!_0xde841e)return _0x11ccea(0x1f1);return undefined;}async['execute'](_0x56615b){const _0x33f3d2=a34_0x10ae5f,{options:_0x19349c,args:_0x1c0449,tdx:_0x3c9d99}=_0x56615b,_0x13a0bc=_0x1c0449[0x0],_0x2d6a21=_0x19349c,_0xdc7597=_0x2d6a21[_0x33f3d2(0x1df)],_0x58062f=_0x2d6a21[_0x33f3d2(0x205)]!==undefined?Number(_0x2d6a21[_0x33f3d2(0x205)]):undefined;if(_0x19349c[_0x33f3d2(0x1f8)]){console[_0x33f3d2(0x1fe)](_0x33f3d2(0x216)+_0x13a0bc);if(_0xdc7597)console[_0x33f3d2(0x1fe)](_0x33f3d2(0x1e3)+_0xdc7597);if(_0x58062f)console[_0x33f3d2(0x1fe)](_0x33f3d2(0x1fa)+_0x58062f);}const _0x48d358=await withSpinner(_0x33f3d2(0x24e),()=>_0x3c9d99[_0x33f3d2(0x24f)][_0x33f3d2(0x1d5)](_0x13a0bc,{'time':_0xdc7597,'num':_0x58062f}),{'verbose':_0x19349c[_0x33f3d2(0x1f8)]}),_0x4658ed=_0x48d358[_0x33f3d2(0x206)][_0x33f3d2(0x222)];console['error'](_0x33f3d2(0x1e7)+_0x4658ed[_0x33f3d2(0x21c)]+_0x33f3d2(0x1eb)+(_0x4658ed[_0x33f3d2(0x21c)]!==0x1?'s':'')+_0x33f3d2(0x1dd));for(const _0x80f175 of _0x4658ed){console[_0x33f3d2(0x1fe)](_0x33f3d2(0x1e6)+_0x80f175[_0x33f3d2(0x21b)]);}return await handleSDKOutput(_0x4658ed,_0x19349c),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a34_0x10ae5f(0x224)]=a34_0x10ae5f(0x234);[a34_0x10ae5f(0x201)]=a34_0x10ae5f(0x1e5);[a34_0x10ae5f(0x20f)](_0x43749d){const _0x4054bb=a34_0x10ae5f,_0xfe2764=_0x43749d[_0x4054bb(0x20c)][0x0];if(!_0xfe2764)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0xfa8402){const _0x44c5e1=a34_0x10ae5f,{options:_0x5e87fe,args:_0x464a18,tdx:_0x73b14b}=_0xfa8402,_0x5da431=_0x464a18[0x0],_0x4cd7b4=_0x5e87fe,_0x38bca7=_0x4cd7b4['from']!==undefined?Number(_0x4cd7b4[_0x44c5e1(0x214)]):undefined,_0x4e8b98=_0x4cd7b4['to']!==undefined?Number(_0x4cd7b4['to']):undefined,_0x2af562=await withSpinner(_0x44c5e1(0x1ee),()=>_0x73b14b['schedules'][_0x44c5e1(0x211)](_0x5da431,{'from':_0x38bca7,'to':_0x4e8b98}),{'verbose':_0x5e87fe[_0x44c5e1(0x1f8)]}),_0x5cb074=_0x2af562['data'];console[_0x44c5e1(0x1fe)]('Found\x20'+_0x5cb074[_0x44c5e1(0x1f0)]+_0x44c5e1(0x24a)+(_0x5cb074[_0x44c5e1(0x1f0)]!==0x1?'s':'')+'\x20(showing\x20'+_0x5cb074['from']+'-'+_0x5cb074['to']+')');const _0x117c5d=_0x5cb074[_0x44c5e1(0x211)][_0x44c5e1(0x1d1)](_0x50881f=>({'job_id':_0x50881f[_0x44c5e1(0x21b)],'type':_0x50881f['type'],'status':_0x50881f[_0x44c5e1(0x22c)],'scheduled_at':_0x50881f[_0x44c5e1(0x223)],'created_at':_0x50881f[_0x44c5e1(0x23e)],'start_at':_0x50881f[_0x44c5e1(0x1d4)],'end_at':_0x50881f['end_at']}));return await handleSDKOutput(_0x117c5d,_0x5e87fe),0x0;}}
@@ -1 +1 @@
1
- const a35_0x9ef3f1=a35_0x3485;(function(_0x46049c,_0x646e0c){const _0x16fc67=a35_0x3485,_0x23c9a4=_0x46049c();while(!![]){try{const _0xc9e2b1=parseInt(_0x16fc67(0x11a))/0x1*(-parseInt(_0x16fc67(0x166))/0x2)+parseInt(_0x16fc67(0x134))/0x3*(-parseInt(_0x16fc67(0x158))/0x4)+-parseInt(_0x16fc67(0x18d))/0x5+-parseInt(_0x16fc67(0x122))/0x6+parseInt(_0x16fc67(0x117))/0x7+-parseInt(_0x16fc67(0x12c))/0x8+parseInt(_0x16fc67(0x114))/0x9*(parseInt(_0x16fc67(0x150))/0xa);if(_0xc9e2b1===_0x646e0c)break;else _0x23c9a4['push'](_0x23c9a4['shift']());}catch(_0x28b60b){_0x23c9a4['push'](_0x23c9a4['shift']());}}}(a35_0x300d,0x8726d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a35_0x300d(){const _0x32f6c9=['Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','jsonl','1GlrvYp','Options:','web','Resolving\x20folder\x20\x27','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','getSegmentSQL','\x20\x20Parent\x20segment:\x20','\x20Opening\x20','3270636bZlVKC','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','βœ”\x20Created\x20folder\x20\x27','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','code','name','\x20[Job\x20ID:\x20','resolveParentId','\x20\x20Segment\x20name:\x20','getSQLFromServerSegment','6019080KwIqVl','βœ”\x20Found\x20','format','(root)','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:sql','3vjMTXq','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','SEGMENT_FOLDER_NOT_FOUND','Resolved\x20relative\x20path\x20to:\x20','Examples:','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','segment:describe','Use:\x20tdx\x20ps\x20desc','segment:folder:show','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Parent\x20name:\x20','getSegmentSQLFromYaml','segment:view','information_schema','Fetching\x20SQL\x20from\x20rule...','\x20\x20Cause:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Fetching\x20folder\x20details...','/e/','folder','segment:desc','Error:\x20Path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20parent\x20segment\x20\x27','Create\x20segment\x20folder\x20for\x20organization','execute','10DWNrSB','\x27...','parentFolder','Listing\x20folders\x20for\x20parent\x20\x27','cause','Creating\x20folder\x20\x27','Show\x20segment\x20folder\x20details','stats','2166436hMsLUx','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Resolving\x20path\x20\x27','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Show\x20segment\x20or\x20folder\x20details','verbose','Fetching\x20segment\x20details...','resolvePathToResource','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20sg\x20sql\x20--path\x20','531680BYVhTp','folderId','error','Usage:','\x27\x20with\x20ID:\x20','type','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Fetching\x20SQL\x20for\x20segment...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','content','parentSegment','Resolved\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','log','Resolving\x20\x27','in\x20','site','\x20\x20Folder\x20path:\x20','segmentId','Folder\x20ID\x20missing\x20from\x20resolved\x20path','resolveFolderId','elapsedTimeMillis','Folder\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','length','Fetching\x20folder\x20\x27','cyan','test','Resolved\x20YAML\x20file:\x20','Resolved\x20type:\x20','Segment\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','INVALID_ARGUMENT','Resolved\x20parent\x20ID:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20rows\x20','processedRows','SQL\x20query:\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','1998950HirnHQ','limit','parentId','Resolving\x20parent\x20folder\x20\x27','\x20folder','description','message','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','red','segment:show','getFolder','Show\x20child\x20segment\x20schema\x20(column\x20types)','segmentName','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20describe\x20<path>','segmentPath','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','getSQLFromYamlFile','path','Parent\x20ID:\x20','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','setJobId','Site:\x20','query','getParent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Target\x20path:\x20','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','fullPath','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Folder\x20name:\x20','jobId','segment','SEGMENT_NOT_FOUND','Use:\x20tdx\x20ps\x20view\x20-w','Error:\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','json','data','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','trim','20366163maNfNJ','toLocaleString','parent','5567828RQqofA'];a35_0x300d=function(){return _0x32f6c9;};return a35_0x300d();}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_0x5e08f4 from'chalk';async function resolveSegmentTarget(_0x5c8f31,_0xcb72c4,_0x30a49c){const _0x44391=a35_0x3485;if(isYamlFilePath(_0x5c8f31))try{const _0x1f0dde=await resolveYamlFilePath(_0x5c8f31);return _0x30a49c&&(console['error'](_0x44391(0x182)+_0x5c8f31),console[_0x44391(0x168)](_0x44391(0x120)+_0x1f0dde[_0x44391(0x170)]),console[_0x44391(0x168)](_0x44391(0x12a)+_0x1f0dde[_0x44391(0x199)]),console['error'](_0x44391(0x177)+(_0x1f0dde['folderPath']||_0x44391(0x12f))),console[_0x44391(0x168)]('\x20\x20Full\x20path:\x20'+_0x1f0dde[_0x44391(0x1ad)])),_0x1f0dde['fullPath'];}catch(_0x38b2d5){throw new SDKError(ErrorCode[_0x44391(0x186)],_0x44391(0x1b9)+_0x38b2d5['message']);}if(!_0xcb72c4)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0xcb72c4+'/'+_0x5c8f31;}export class SegmentDescribeCommand extends BaseCommand{['name']=a35_0x9ef3f1(0x13a);['description']=a35_0x9ef3f1(0x15e);async[a35_0x9ef3f1(0x14f)](_0x5f4bed){const _0xbd67a7=a35_0x9ef3f1,{options:_0x59a538,args:_0x39bc87,tdx:_0x45e440}=_0x5f4bed,_0x4c5c88=_0x39bc87[0x0],_0x391af8=!_0x4c5c88&&!!_0x59a538[_0xbd67a7(0x170)],_0x2712d3=_0x4c5c88||_0x59a538[_0xbd67a7(0x170)];if(!_0x2712d3)return console[_0xbd67a7(0x168)](_0xbd67a7(0x149)),console[_0xbd67a7(0x168)](_0xbd67a7(0x19d)),console[_0xbd67a7(0x168)](_0xbd67a7(0x138)),console[_0xbd67a7(0x168)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0xbd67a7(0x168)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0xbd67a7(0x168)](_0xbd67a7(0x16c)),console[_0xbd67a7(0x168)](_0xbd67a7(0x16e)),0x1;try{const _0x5897a9=_0x59a538[_0xbd67a7(0x19e)];let _0x1e7ef1=_0x2712d3;!_0x391af8&&_0x5897a9&&!_0x2712d3['includes']('/')&&(_0x1e7ef1=_0x5897a9+'/'+_0x2712d3,_0x59a538['verbose']&&console['error'](_0xbd67a7(0x137)+_0x1e7ef1));const _0x1d3129=await withSpinner(_0xbd67a7(0x15b)+_0x1e7ef1+'\x27...',()=>_0x45e440['segment'][_0xbd67a7(0x161)](_0x1e7ef1),{'verbose':_0x59a538[_0xbd67a7(0x15f)]}),_0x54a95c=_0x1d3129['data'];_0x59a538[_0xbd67a7(0x15f)]&&(console[_0xbd67a7(0x168)](_0xbd67a7(0x183)+_0x54a95c[_0xbd67a7(0x16b)]),console[_0xbd67a7(0x168)](_0xbd67a7(0x1a2)+_0x54a95c['parentId']),_0x54a95c[_0xbd67a7(0x167)]&&console[_0xbd67a7(0x168)](_0xbd67a7(0x17c)+_0x54a95c[_0xbd67a7(0x167)]),_0x54a95c['segmentId']&&console[_0xbd67a7(0x168)](_0xbd67a7(0x184)+_0x54a95c[_0xbd67a7(0x178)]));if(_0x54a95c['type']===_0xbd67a7(0x116)){const _0x55cd8e=await withSpinner(_0xbd67a7(0x17d),()=>_0x45e440[_0xbd67a7(0x1b1)][_0xbd67a7(0x1a9)](_0x54a95c[_0xbd67a7(0x18f)]),{'verbose':_0x59a538[_0xbd67a7(0x15f)]});await handleSingleObjectOutput(_0x55cd8e['data'],_0x59a538);}else{if(_0x54a95c['type']===_0xbd67a7(0x147)){if(!_0x54a95c[_0xbd67a7(0x167)])throw new SDKError(ErrorCode[_0xbd67a7(0x136)],_0xbd67a7(0x179));const _0x58ceef=await withSpinner(_0xbd67a7(0x145),()=>_0x45e440[_0xbd67a7(0x1b1)][_0xbd67a7(0x197)](_0x54a95c[_0xbd67a7(0x167)]),{'verbose':_0x59a538[_0xbd67a7(0x15f)]});await handleSingleObjectOutput(_0x58ceef[_0xbd67a7(0x1b8)],_0x59a538);}else{if(_0x54a95c['type']===_0xbd67a7(0x1b1)){if(!_0x54a95c[_0xbd67a7(0x178)])throw new SDKError(ErrorCode[_0xbd67a7(0x1b2)],_0xbd67a7(0x130));const _0x2747f4=await withSpinner(_0xbd67a7(0x160),()=>_0x45e440[_0xbd67a7(0x1b1)]['getSegment'](_0x54a95c[_0xbd67a7(0x18f)],_0x54a95c[_0xbd67a7(0x178)]),{'verbose':_0x59a538[_0xbd67a7(0x15f)]});await handleSingleObjectOutput(_0x2747f4[_0xbd67a7(0x1b8)],_0x59a538);}}}return 0x0;}catch(_0x4a97f9){if(_0x4a97f9 instanceof SDKError)return console[_0xbd67a7(0x168)](_0xbd67a7(0x1b4)+_0x4a97f9[_0xbd67a7(0x193)]),_0x4a97f9[_0xbd67a7(0x154)]&&console[_0xbd67a7(0x168)](_0xbd67a7(0x143)+_0x4a97f9[_0xbd67a7(0x154)]),0x1;throw _0x4a97f9;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x9ef3f1(0x127)]=a35_0x9ef3f1(0x196);[a35_0x9ef3f1(0x192)]=a35_0x9ef3f1(0x188);async[a35_0x9ef3f1(0x14f)](_0x55da6d){const _0x9dfc7b=a35_0x9ef3f1,{options:_0x33e2f3,args:_0x302854,tdx:_0x2e972a}=_0x55da6d,_0xa9b11a=_0x302854[0x0];if(!_0xa9b11a)return console[_0x9dfc7b(0x168)](_0x9dfc7b(0x15d)),console[_0x9dfc7b(0x168)](_0x9dfc7b(0x131)),console[_0x9dfc7b(0x168)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x9dfc7b(0x168)]('Examples:'),console['error'](_0x9dfc7b(0x1b5)),console['error'](_0x9dfc7b(0x164)),0x1;try{const _0x345924=_0x33e2f3['parentSegment'],_0x60876d=await resolveSegmentTarget(_0xa9b11a,_0x345924,_0x33e2f3[_0x9dfc7b(0x15f)]);_0x33e2f3[_0x9dfc7b(0x15f)]&&console[_0x9dfc7b(0x168)]('Target\x20path:\x20'+_0x60876d);const _0x2fc4ef=await withSpinner(_0x9dfc7b(0x174)+_0xa9b11a+_0x9dfc7b(0x151),()=>_0x2e972a[_0x9dfc7b(0x1b1)][_0x9dfc7b(0x161)](_0x60876d),{'verbose':_0x33e2f3[_0x9dfc7b(0x15f)]}),_0x53fdd5=_0x2fc4ef[_0x9dfc7b(0x1b8)];_0x33e2f3[_0x9dfc7b(0x15f)]&&(console[_0x9dfc7b(0x168)]('Resolved\x20type:\x20'+_0x53fdd5[_0x9dfc7b(0x16b)]),console['error'](_0x9dfc7b(0x1a2)+_0x53fdd5['parentId']));if(_0x53fdd5['type']===_0x9dfc7b(0x147))return console[_0x9dfc7b(0x168)](_0x9dfc7b(0x1ac)),console['error'](_0x9dfc7b(0x144)),0x1;if(_0x53fdd5[_0x9dfc7b(0x16b)]==='parent')return console['error'](_0x9dfc7b(0x14c)),console[_0x9dfc7b(0x168)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x53fdd5[_0x9dfc7b(0x178)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x9dfc7b(0x130));const _0x10bd84=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2e972a[_0x9dfc7b(0x1b1)][_0x9dfc7b(0x11f)](_0x53fdd5[_0x9dfc7b(0x18f)],_0x53fdd5[_0x9dfc7b(0x178)]),{'verbose':_0x33e2f3['verbose']});let _0x2ed9a9=_0x10bd84[_0x9dfc7b(0x1b8)];const _0x4dbe4f=resolveLimit(_0x33e2f3[_0x9dfc7b(0x18e)],DEFAULT_DISPLAY_LIMIT),_0x84450f=/\bLIMIT\s+\d+/i[_0x9dfc7b(0x181)](_0x2ed9a9);!_0x84450f&&(_0x2ed9a9=_0x2ed9a9[_0x9dfc7b(0x113)]()['replace'](/;+$/,''),_0x2ed9a9=_0x9dfc7b(0x162)+_0x2ed9a9+_0x9dfc7b(0x18c)+_0x4dbe4f);_0x33e2f3[_0x9dfc7b(0x15f)]&&console[_0x9dfc7b(0x168)](_0x9dfc7b(0x18b)+_0x2ed9a9);const _0x3c4789=await withProgressSpinner('Executing\x20segment\x20query...',async _0x10e25a=>{const _0x48c5a8=_0x9dfc7b,_0x4a108c=await _0x2e972a[_0x48c5a8(0x1a8)][_0x48c5a8(0x14f)](_0x2ed9a9,{'catalog':'td','schema':_0x48c5a8(0x141),'onJobId':_0x1fccd7=>{const _0x48e095=_0x48c5a8;_0x10e25a[_0x48e095(0x1a6)](_0x1fccd7);}});return _0x4a108c;},{'verbose':_0x33e2f3['verbose']}),_0x4ead21=_0x3c4789['data'],_0x1a0584=_0x4ead21[_0x9dfc7b(0x1b0)]?_0x9dfc7b(0x128)+_0x4ead21[_0x9dfc7b(0x1b0)]+']':'';return console[_0x9dfc7b(0x168)]('βœ”\x20Query\x20completed:\x20Processed\x20'+_0x4ead21[_0x9dfc7b(0x157)][_0x9dfc7b(0x18a)][_0x9dfc7b(0x115)]()+_0x9dfc7b(0x189)+(_0x9dfc7b(0x175)+formatElapsed(_0x4ead21[_0x9dfc7b(0x157)][_0x9dfc7b(0x17b)])+_0x1a0584)),await handleQueryOutput(_0x4ead21,_0x33e2f3),0x0;}catch(_0x219f27){if(_0x219f27 instanceof SDKError)return console['error']('βœ–\x20Query\x20failed\x20['+_0x219f27[_0x9dfc7b(0x126)]+']'),console[_0x9dfc7b(0x168)]('\x0a'+_0x219f27[_0x9dfc7b(0x193)]),0x1;throw _0x219f27;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a35_0x9ef3f1(0x192)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a35_0x9ef3f1(0x14f)](_0x425bb4){const _0x2c1035=a35_0x9ef3f1,{options:_0x3c61fb,args:_0x36d9c2,tdx:_0x341ae3}=_0x425bb4;if(_0x36d9c2[_0x2c1035(0x17e)]===0x0)return console[_0x2c1035(0x168)](_0x2c1035(0x19c)),console[_0x2c1035(0x168)](_0x2c1035(0x172)),0x1;const _0x26a24b=_0x36d9c2[0x0];try{_0x3c61fb[_0x2c1035(0x15f)]&&(console[_0x2c1035(0x168)](_0x2c1035(0x1a7)+_0x3c61fb['site']),console[_0x2c1035(0x168)](_0x2c1035(0x13e)+_0x26a24b));const _0x4bcb24=await withSpinner(_0x2c1035(0x14d)+_0x26a24b+'\x27...',()=>_0x341ae3['segment'][_0x2c1035(0x129)](_0x26a24b),{'verbose':_0x3c61fb[_0x2c1035(0x15f)]}),_0x11b391=_0x4bcb24[_0x2c1035(0x1b8)];_0x3c61fb[_0x2c1035(0x15f)]&&console[_0x2c1035(0x168)](_0x2c1035(0x187)+_0x11b391);const _0x6c9e09=await withSpinner(_0x2c1035(0x153)+_0x26a24b+_0x2c1035(0x151),()=>_0x341ae3[_0x2c1035(0x1b1)]['listFolders'](_0x11b391),{'verbose':_0x3c61fb[_0x2c1035(0x15f)]}),_0x277390=_0x6c9e09[_0x2c1035(0x1b8)];return console[_0x2c1035(0x168)](_0x2c1035(0x12d)+_0x277390[_0x2c1035(0x17e)]+_0x2c1035(0x191)+(_0x277390[_0x2c1035(0x17e)]!==0x1?'s':'')),await handleSDKOutput(_0x277390,_0x3c61fb),0x0;}catch(_0x5a80f5){if(_0x5a80f5 instanceof SDKError)return console['error'](_0x2c1035(0x1b4)+_0x5a80f5[_0x2c1035(0x193)]),_0x5a80f5['cause']&&console[_0x2c1035(0x168)](_0x2c1035(0x143)+_0x5a80f5['cause']),0x1;throw _0x5a80f5;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']=a35_0x9ef3f1(0x13c);[a35_0x9ef3f1(0x192)]=a35_0x9ef3f1(0x156);async[a35_0x9ef3f1(0x14f)](_0x129d83){const _0x4f8bb9=a35_0x9ef3f1,{options:_0x27e0d3,args:_0x30ee7b,tdx:_0xb842e5}=_0x129d83;if(_0x30ee7b[_0x4f8bb9(0x17e)]===0x0)return console['error']('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x4f8bb9(0x168)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x4466f0,childId:_0x36649d}=parseSegmentRef(_0x30ee7b[0x0]);_0x27e0d3['verbose']&&(console[_0x4f8bb9(0x168)]('Site:\x20'+_0x27e0d3['site']),console['error'](_0x4f8bb9(0x13e)+_0x4466f0),_0x36649d&&console[_0x4f8bb9(0x168)](_0x4f8bb9(0x1af)+_0x36649d));if(!_0x36649d)return console[_0x4f8bb9(0x168)](_0x4f8bb9(0x132)),0x1;const _0x72f552=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4466f0+'\x27...',()=>_0xb842e5[_0x4f8bb9(0x1b1)][_0x4f8bb9(0x129)](_0x4466f0),{'verbose':_0x27e0d3[_0x4f8bb9(0x15f)]}),_0x1b4291=_0x72f552[_0x4f8bb9(0x1b8)];_0x27e0d3[_0x4f8bb9(0x15f)]&&console[_0x4f8bb9(0x168)](_0x4f8bb9(0x187)+_0x1b4291);const _0x293093=await withSpinner(_0x4f8bb9(0x11d)+_0x36649d+_0x4f8bb9(0x151),()=>_0xb842e5[_0x4f8bb9(0x1b1)][_0x4f8bb9(0x17a)](_0x1b4291,_0x36649d),{'verbose':_0x27e0d3['verbose']}),_0x343133=_0x293093[_0x4f8bb9(0x1b8)];_0x27e0d3[_0x4f8bb9(0x15f)]&&console[_0x4f8bb9(0x168)](_0x4f8bb9(0x171)+_0x343133);const _0x22ab32=await withSpinner(_0x4f8bb9(0x17f)+_0x36649d+'\x27...',()=>_0xb842e5[_0x4f8bb9(0x1b1)]['getFolder'](_0x343133),{'verbose':_0x27e0d3[_0x4f8bb9(0x15f)]});return await handleSDKOutput([_0x22ab32[_0x4f8bb9(0x1b8)]],_0x27e0d3),0x0;}catch(_0x9d0d2e){if(_0x9d0d2e instanceof SDKError)return console[_0x4f8bb9(0x168)](_0x4f8bb9(0x1b4)+_0x9d0d2e[_0x4f8bb9(0x193)]),_0x9d0d2e['cause']&&console[_0x4f8bb9(0x168)](_0x4f8bb9(0x143)+_0x9d0d2e['cause']),0x1;throw _0x9d0d2e;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x9ef3f1(0x127)]=a35_0x9ef3f1(0x133);[a35_0x9ef3f1(0x192)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a35_0x9ef3f1(0x14f)](_0x1e1c05){const _0x5da925=a35_0x9ef3f1,{options:_0x46f27b,args:_0x1419a}=_0x1e1c05,_0x3331a8=_0x46f27b,_0x21c7e7=_0x3331a8[_0x5da925(0x1a1)],_0x2d6502=_0x1419a[0x0];if(!_0x2d6502&&!_0x21c7e7)return console['error'](a35_0x5e08f4[_0x5da925(0x195)](_0x5da925(0x19a))),console[_0x5da925(0x168)](_0x5da925(0x169)),console[_0x5da925(0x168)](_0x5da925(0x11e)),console[_0x5da925(0x168)](_0x5da925(0x194)),console[_0x5da925(0x168)](_0x5da925(0x138)),console[_0x5da925(0x168)](_0x5da925(0x19b)),console[_0x5da925(0x168)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml'),0x1;if(_0x2d6502&&_0x21c7e7)return console[_0x5da925(0x168)](a35_0x5e08f4[_0x5da925(0x195)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x16b165;if(_0x21c7e7)_0x16b165=await this[_0x5da925(0x1a0)](_0x21c7e7,_0x1e1c05);else{if(isYamlFilePath(_0x2d6502))return console[_0x5da925(0x168)](a35_0x5e08f4[_0x5da925(0x195)](_0x5da925(0x15c))),console['error'](_0x5da925(0x165)+_0x2d6502),0x1;else _0x16b165=await this[_0x5da925(0x12b)](_0x2d6502,_0x1e1c05);}return _0x46f27b[_0x5da925(0x12e)]===_0x5da925(0x1b7)||_0x46f27b[_0x5da925(0x12e)]===_0x5da925(0x119)?await handleSDKOutput([{'sql':_0x16b165}],_0x46f27b):console[_0x5da925(0x173)](_0x16b165),0x0;}catch(_0x1e1fab){if(_0x1e1fab instanceof SDKError)return console['error'](_0x5da925(0x1b4)+_0x1e1fab[_0x5da925(0x193)]),_0x1e1fab['cause']&&console[_0x5da925(0x168)]('\x20\x20Cause:\x20'+_0x1e1fab[_0x5da925(0x154)]),0x1;throw _0x1e1fab;}}async[a35_0x9ef3f1(0x1a0)](_0x3e70e6,_0x33dd1a){const _0x539418=a35_0x9ef3f1,{options:_0x2dba99,tdx:_0x2b0573}=_0x33dd1a;let _0xf8d91c;try{_0xf8d91c=await resolveYamlFilePath(_0x3e70e6);}catch(_0xeffe95){throw new SDKError(ErrorCode[_0x539418(0x186)],_0x539418(0x1b9)+_0xeffe95['message']);}_0x2dba99[_0x539418(0x15f)]&&console[_0x539418(0x168)]('Resolved:\x20'+_0xf8d91c[_0x539418(0x170)]+'/'+_0xf8d91c[_0x539418(0x199)]);const _0x48f656=await withSpinner(_0x539418(0x142),()=>_0x2b0573[_0x539418(0x1b1)][_0x539418(0x13f)](_0xf8d91c[_0x539418(0x16f)],_0xf8d91c['parentSegment'],_0xf8d91c['segmentName']),{'verbose':_0x2dba99[_0x539418(0x15f)]});return _0x48f656[_0x539418(0x1b8)];}async[a35_0x9ef3f1(0x12b)](_0x4a1ced,_0x561a46){const _0x2c54a5=a35_0x9ef3f1,{options:_0x3a1e9a,tdx:_0x505447}=_0x561a46,_0x169fca=_0x3a1e9a[_0x2c54a5(0x170)],_0x11716c=await resolveSegmentTarget(_0x4a1ced,_0x169fca,_0x3a1e9a[_0x2c54a5(0x15f)]);_0x3a1e9a[_0x2c54a5(0x15f)]&&console[_0x2c54a5(0x168)](_0x2c54a5(0x1ab)+_0x11716c);const _0x153758=await withSpinner(_0x2c54a5(0x174)+_0x4a1ced+_0x2c54a5(0x151),()=>_0x505447[_0x2c54a5(0x1b1)][_0x2c54a5(0x161)](_0x11716c),{'verbose':_0x3a1e9a[_0x2c54a5(0x15f)]}),_0x1ce0ce=_0x153758['data'];_0x3a1e9a[_0x2c54a5(0x15f)]&&(console[_0x2c54a5(0x168)](_0x2c54a5(0x183)+_0x1ce0ce[_0x2c54a5(0x16b)]),console[_0x2c54a5(0x168)](_0x2c54a5(0x1a2)+_0x1ce0ce[_0x2c54a5(0x18f)]));if(_0x1ce0ce[_0x2c54a5(0x16b)]===_0x2c54a5(0x147))throw new SDKError(ErrorCode[_0x2c54a5(0x186)],_0x2c54a5(0x1a4));if(_0x1ce0ce[_0x2c54a5(0x16b)]===_0x2c54a5(0x116))throw new SDKError(ErrorCode[_0x2c54a5(0x186)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x1ce0ce[_0x2c54a5(0x178)])throw new SDKError(ErrorCode[_0x2c54a5(0x1b2)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x447aee=await withSpinner(_0x2c54a5(0x16d),()=>_0x505447[_0x2c54a5(0x1b1)]['getSegmentSQL'](_0x1ce0ce[_0x2c54a5(0x18f)],_0x1ce0ce[_0x2c54a5(0x178)]),{'verbose':_0x3a1e9a[_0x2c54a5(0x15f)]});return _0x447aee[_0x2c54a5(0x1b8)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x9ef3f1(0x127)]='segment:folder:create';['description']=a35_0x9ef3f1(0x14e);async[a35_0x9ef3f1(0x14f)](_0x19169a){const _0x5650a9=a35_0x9ef3f1,{options:_0xebd915,args:_0x55691,tdx:_0x2bc399}=_0x19169a,_0x5a846c=_0xebd915;if(_0x55691[_0x5650a9(0x17e)]<0x2)return console[_0x5650a9(0x168)](_0x5650a9(0x159)),console[_0x5650a9(0x168)](_0x5650a9(0x1ae)),0x1;const _0x3809b5=_0x55691[0x0],_0x1d9c21=_0x55691[0x1];_0x5a846c[_0x5650a9(0x15f)]&&(console['error'](_0x5650a9(0x1a7)+_0x5a846c[_0x5650a9(0x176)]),console[_0x5650a9(0x168)]('Parent\x20segment:\x20'+_0x3809b5),console[_0x5650a9(0x168)]('Folder\x20name:\x20'+_0x1d9c21));let _0x57616f;if(_0x5a846c[_0x5650a9(0x152)]){const _0x43b8fe=_0x5a846c[_0x5650a9(0x152)],_0x454951=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3809b5+_0x5650a9(0x151),()=>_0x2bc399['segment'][_0x5650a9(0x129)](_0x3809b5),{'verbose':_0x5a846c[_0x5650a9(0x15f)]}),_0x459733=_0x454951[_0x5650a9(0x1b8)],_0x66fd9=await withSpinner(_0x5650a9(0x190)+_0x43b8fe+'\x27...',()=>_0x2bc399['segment']['resolveFolderId'](_0x459733,_0x43b8fe),{'verbose':_0x5a846c['verbose']});_0x57616f=_0x66fd9[_0x5650a9(0x1b8)],_0x5a846c[_0x5650a9(0x15f)]&&console[_0x5650a9(0x168)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x57616f);}const _0x3302b0={'name':_0x1d9c21,'description':_0x5a846c['description'],'parentFolderId':_0x57616f},_0x2be18f=await withSpinner(_0x5650a9(0x155)+_0x1d9c21+'\x27...',()=>_0x2bc399[_0x5650a9(0x1b1)]['createFolder'](_0x3809b5,_0x3302b0),{'verbose':_0x5a846c[_0x5650a9(0x15f)]}),_0x3ce650=_0x2be18f[_0x5650a9(0x1b8)];return console[_0x5650a9(0x168)](_0x5650a9(0x124)+_0x3ce650[_0x5650a9(0x127)]+_0x5650a9(0x16a)+_0x3ce650['id']),await handleSDKOutput([_0x3ce650],_0x5a846c),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a35_0x9ef3f1(0x140);[a35_0x9ef3f1(0x192)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a35_0x9ef3f1(0x14f)](_0x973817){const _0x145092=a35_0x9ef3f1,{options:_0x557c9e,args:_0x4465d1,tdx:_0x5882cb}=_0x973817,_0x50ac01=_0x4465d1[0x0];if(!_0x50ac01)return console[_0x145092(0x168)](_0x145092(0x1a3)),console[_0x145092(0x168)](_0x145092(0x13d)),console[_0x145092(0x168)](_0x145092(0x1aa)),console[_0x145092(0x168)](_0x145092(0x11b)),console[_0x145092(0x168)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x145092(0x138)),console['error'](_0x145092(0x15a)),console[_0x145092(0x168)](_0x145092(0x163)),console[_0x145092(0x168)](_0x145092(0x19f)),console[_0x145092(0x168)](_0x145092(0x125)),0x1;try{const _0x32a968=_0x557c9e[_0x145092(0x170)],_0xc6f7e3=await resolveSegmentTarget(_0x50ac01,_0x32a968,_0x557c9e[_0x145092(0x15f)]);_0x557c9e['verbose']&&console[_0x145092(0x168)](_0x145092(0x1ab)+_0xc6f7e3);const _0x3011d0=await withSpinner(_0x145092(0x174)+_0x50ac01+'\x27...',()=>_0x5882cb[_0x145092(0x1b1)][_0x145092(0x161)](_0xc6f7e3),{'verbose':_0x557c9e[_0x145092(0x15f)]}),_0x446020=_0x3011d0[_0x145092(0x1b8)];_0x557c9e['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x446020[_0x145092(0x16b)]),console['error'](_0x145092(0x1a2)+_0x446020[_0x145092(0x18f)]),_0x446020[_0x145092(0x167)]&&console['error'](_0x145092(0x17c)+_0x446020['folderId']),_0x446020['segmentId']&&console['error'](_0x145092(0x184)+_0x446020[_0x145092(0x178)]));if(_0x557c9e[_0x145092(0x11c)]){if(_0x446020[_0x145092(0x16b)]===_0x145092(0x147))return console[_0x145092(0x168)](_0x145092(0x135)),0x1;if(_0x446020['type']===_0x145092(0x116))return console['error'](_0x145092(0x1b6)),console[_0x145092(0x168)](_0x145092(0x1b3)),0x1;if(!_0x446020[_0x145092(0x178)])throw new SDKError(ErrorCode[_0x145092(0x1b2)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x592fa6=getConsoleNextUrl(_0x557c9e['site'],'/app/ps/'+_0x446020[_0x145092(0x18f)]+_0x145092(0x146)+_0x446020[_0x145092(0x178)]);return console['error'](a35_0x5e08f4['green']('βœ”')+_0x145092(0x121)+a35_0x5e08f4[_0x145092(0x180)](_0x592fa6)),openBrowser(_0x592fa6),0x0;}if(_0x446020['type']===_0x145092(0x147)){if(!_0x446020[_0x145092(0x167)])throw new SDKError(ErrorCode[_0x145092(0x136)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x42d942=await withSpinner(_0x145092(0x145),()=>_0x5882cb['segment'][_0x145092(0x197)](_0x446020[_0x145092(0x167)]),{'verbose':_0x557c9e[_0x145092(0x15f)]});await handleSingleObjectOutput(_0x42d942[_0x145092(0x1b8)],_0x557c9e);}else{if(_0x446020[_0x145092(0x16b)]===_0x145092(0x1b1)){if(!_0x446020['segmentId'])throw new SDKError(ErrorCode[_0x145092(0x1b2)],_0x145092(0x130));const _0x4655a3=await withSpinner(_0x145092(0x160),()=>_0x5882cb[_0x145092(0x1b1)]['getSegment'](_0x446020['parentId'],_0x446020['segmentId']),{'verbose':_0x557c9e[_0x145092(0x15f)]}),_0x5bd47d=getConsoleNextUrl(_0x557c9e[_0x145092(0x176)],'/app/ps/'+_0x446020[_0x145092(0x18f)]+_0x145092(0x146)+_0x446020[_0x145092(0x178)]),_0x150ac2=_0x4655a3[_0x145092(0x1b8)];_0x150ac2['url']=_0x5bd47d,await handleSingleObjectOutput(_0x150ac2,_0x557c9e);}else return console[_0x145092(0x168)](_0x145092(0x185)),console[_0x145092(0x168)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x36df34){if(_0x36df34 instanceof SDKError)return console[_0x145092(0x168)](_0x145092(0x1b4)+_0x36df34['message']),_0x36df34[_0x145092(0x154)]&&console['error']('\x20\x20Cause:\x20'+_0x36df34['cause']),0x1;throw _0x36df34;}}}function a35_0x3485(_0x338548,_0x1ef00b){_0x338548=_0x338548-0x113;const _0x300de9=a35_0x300d();let _0x3485ed=_0x300de9[_0x338548];return _0x3485ed;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a35_0x9ef3f1(0x127)]=a35_0x9ef3f1(0x148);['description']=a35_0x9ef3f1(0x198);async[a35_0x9ef3f1(0x14f)](_0x7c7b83){const _0x1598c6=a35_0x9ef3f1,{options:_0x11f9e8,args:_0x321ff3,tdx:_0x36b6d6}=_0x7c7b83,_0x25431f=_0x321ff3[0x0];if(!_0x25431f)return console[_0x1598c6(0x168)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1598c6(0x168)](_0x1598c6(0x14a)),console[_0x1598c6(0x168)](_0x1598c6(0x14b)),console[_0x1598c6(0x168)](_0x1598c6(0x138)),console[_0x1598c6(0x168)](_0x1598c6(0x1a5)),console['error'](_0x1598c6(0x139)),0x1;try{const _0x3d9c20=_0x11f9e8[_0x1598c6(0x170)],_0x2cc6b4=await resolveSegmentTarget(_0x25431f,_0x3d9c20,_0x11f9e8[_0x1598c6(0x15f)]);_0x11f9e8['verbose']&&console[_0x1598c6(0x168)]('Target\x20path:\x20'+_0x2cc6b4);const _0x13ada9=await withSpinner(_0x1598c6(0x174)+_0x25431f+'\x27...',()=>_0x36b6d6['segment']['resolvePathToResource'](_0x2cc6b4),{'verbose':_0x11f9e8['verbose']}),_0x3aeb03=_0x13ada9[_0x1598c6(0x1b8)];_0x11f9e8['verbose']&&(console[_0x1598c6(0x168)](_0x1598c6(0x183)+_0x3aeb03[_0x1598c6(0x16b)]),console[_0x1598c6(0x168)]('Parent\x20ID:\x20'+_0x3aeb03[_0x1598c6(0x18f)]));if(_0x3aeb03[_0x1598c6(0x16b)]===_0x1598c6(0x147))return console[_0x1598c6(0x168)](_0x1598c6(0x118)),console[_0x1598c6(0x168)](_0x1598c6(0x123)),0x1;if(_0x3aeb03[_0x1598c6(0x16b)]===_0x1598c6(0x116))return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1598c6(0x168)](_0x1598c6(0x13b)),0x1;if(!_0x3aeb03[_0x1598c6(0x178)])throw new SDKError(ErrorCode[_0x1598c6(0x1b2)],_0x1598c6(0x130));const _0x21f2c6=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x36b6d6[_0x1598c6(0x1b1)][_0x1598c6(0x11f)](_0x3aeb03[_0x1598c6(0x18f)],_0x3aeb03[_0x1598c6(0x178)]),{'verbose':_0x11f9e8[_0x1598c6(0x15f)]}),_0x34e270=_0x21f2c6[_0x1598c6(0x1b8)],_0x4cef30=await executeSchemaQuery(_0x34e270,_0x36b6d6,_0x11f9e8);return await handleQueryOutput(_0x4cef30,_0x11f9e8),0x0;}catch(_0x61ed39){if(_0x61ed39 instanceof SDKError)return console[_0x1598c6(0x168)](_0x1598c6(0x1b4)+_0x61ed39[_0x1598c6(0x193)]),_0x61ed39[_0x1598c6(0x154)]&&console[_0x1598c6(0x168)](_0x1598c6(0x143)+_0x61ed39[_0x1598c6(0x154)]),0x1;throw _0x61ed39;}}}
1
+ const a35_0x3b9a9b=a35_0x35ca;(function(_0x1f1612,_0x207b87){const _0x5f0671=a35_0x35ca,_0x253ce8=_0x1f1612();while(!![]){try{const _0x504216=parseInt(_0x5f0671(0x17c))/0x1*(-parseInt(_0x5f0671(0x18d))/0x2)+parseInt(_0x5f0671(0x1b1))/0x3+parseInt(_0x5f0671(0x143))/0x4+parseInt(_0x5f0671(0x116))/0x5+-parseInt(_0x5f0671(0x19f))/0x6+-parseInt(_0x5f0671(0x168))/0x7*(parseInt(_0x5f0671(0x1a6))/0x8)+-parseInt(_0x5f0671(0x130))/0x9*(parseInt(_0x5f0671(0x1a3))/0xa);if(_0x504216===_0x207b87)break;else _0x253ce8['push'](_0x253ce8['shift']());}catch(_0x135a7a){_0x253ce8['push'](_0x253ce8['shift']());}}}(a35_0x5af6,0x641b4));import{BaseCommand}from'./command.js';function a35_0x5af6(){const _0x19b623=['data','message','path','βœ”\x20Created\x20folder\x20\x27','βœ–\x20Query\x20failed\x20[','length','9TXRXeT','jsonl','format','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','βœ”\x20Query\x20completed:\x20Processed\x20','web','getSQLFromYamlFile','fullPath','trim','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','parent','folder','Resolving\x20path\x20\x27','url','name','Use:\x20tdx\x20ps\x20view','cyan','error','901916dgRAsJ','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','json','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Resolving\x20\x27','getSegment','description','Parent\x20ID:\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','execute','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Resolved\x20type:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','content','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Usage:\x20tdx\x20sg\x20show\x20<name>','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Fetching\x20SQL\x20from\x20rule...','red','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20Folder\x20path:\x20','segment:show','segment:folder:list','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','parentSegment','getParent','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','getSQLFromServerSegment','(root)','cause','segmentPath','parentFolder','121793tKEerH','Parent\x20segment:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','getSegmentSQL','segment','Get\x20SQL\x20query\x20for\x20child\x20segment','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','getFolder','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolved\x20folder\x20ID:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','getSegmentSQLFromYaml','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','folderPath','Examples:','site','Folder\x20name:\x20','18GIRwug','Parent\x20name:\x20','\x20[Job\x20ID:\x20','SEGMENT_NOT_FOUND','resolveParentId','Show\x20segment\x20or\x20folder\x20details','segment:describe','Target\x20path:\x20','Error:\x20Folder\x20reference\x20is\x20required','\x27...','\x20\x20Cause:\x20','segment:folder:create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Resolving\x20folder\x20\x27','Use:\x20tdx\x20ps\x20desc','Resolved\x20YAML\x20file:\x20','\x20folder','17468nSVIIZ','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','segmentName','green','segment:view','/app/ps/','Resolved:\x20','\x20rows\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','segment:sql','Use:\x20tdx\x20ps\x20show','Segment\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','resolveFolderId','test','log','413874QDIdSe','Fetching\x20segment\x20details...','segmentId','Error:\x20Parent\x20segment\x20name\x20is\x20required','1075430JenARi','Site:\x20','/e/','88rzosZW','stats','type','Error:\x20','createFolder','Options:','Fetching\x20folder\x20details...','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','2020755TfIzAE','parentId','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql','resolvePathToResource','toLocaleString','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','βœ”\x20Found\x20','SEGMENT_FOLDER_NOT_FOUND','Use:\x20tdx\x20ps\x20view\x20-w','Creating\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20describe\x20<path>','verbose','180475JiLGff','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Show\x20folder\x20or\x20child\x20segment\x20details','query','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20Opening\x20','INVALID_ARGUMENT','Resolved\x20parent\x20ID:\x20','setJobId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolving\x20parent\x20segment\x20\x27','folderId','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','replace','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','segment:folder:show','limit'];a35_0x5af6=function(){return _0x19b623;};return a35_0x5af6();}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';function a35_0x35ca(_0x227702,_0x368c4f){_0x227702=_0x227702-0x116;const _0x5af638=a35_0x5af6();let _0x35caec=_0x5af638[_0x227702];return _0x35caec;}import a35_0x59fe37 from'chalk';async function resolveSegmentTarget(_0x11032e,_0x3776b4,_0x1b8c1e){const _0x4b8a84=a35_0x35ca;if(isYamlFilePath(_0x11032e))try{const _0x163bcd=await resolveYamlFilePath(_0x11032e);return _0x1b8c1e&&(console[_0x4b8a84(0x142)](_0x4b8a84(0x18b)+_0x11032e),console[_0x4b8a84(0x142)]('\x20\x20Parent\x20segment:\x20'+_0x163bcd['parentSegment']),console[_0x4b8a84(0x142)]('\x20\x20Segment\x20name:\x20'+_0x163bcd[_0x4b8a84(0x18f)]),console[_0x4b8a84(0x142)](_0x4b8a84(0x15c)+(_0x163bcd[_0x4b8a84(0x178)]||_0x4b8a84(0x164))),console['error']('\x20\x20Full\x20path:\x20'+_0x163bcd[_0x4b8a84(0x137)])),_0x163bcd[_0x4b8a84(0x137)];}catch(_0x212f6a){throw new SDKError(ErrorCode[_0x4b8a84(0x11f)],_0x4b8a84(0x174)+_0x212f6a[_0x4b8a84(0x12b)]);}if(!_0x3776b4)throw new SDKError(ErrorCode[_0x4b8a84(0x11f)],_0x4b8a84(0x127));return _0x3776b4+'/'+_0x11032e;}export class SegmentDescribeCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x182);[a35_0x3b9a9b(0x14a)]=a35_0x3b9a9b(0x181);async['execute'](_0x413b12){const _0x417b4d=a35_0x3b9a9b,{options:_0x2aa36b,args:_0x3b8aa7,tdx:_0x299821}=_0x413b12,_0x14e8d6=_0x3b8aa7[0x0],_0x122e81=!_0x14e8d6&&!!_0x2aa36b[_0x417b4d(0x160)],_0x34204e=_0x14e8d6||_0x2aa36b[_0x417b4d(0x160)];if(!_0x34204e)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x417b4d(0x142)](_0x417b4d(0x1bd)),console[_0x417b4d(0x142)]('Examples:'),console[_0x417b4d(0x142)](_0x417b4d(0x11c)),console[_0x417b4d(0x142)](_0x417b4d(0x139)),console[_0x417b4d(0x142)](_0x417b4d(0x172)),console[_0x417b4d(0x142)](_0x417b4d(0x14c)),0x1;try{const _0x46bba0=_0x2aa36b[_0x417b4d(0x166)];let _0x30b37f=_0x34204e;!_0x122e81&&_0x46bba0&&!_0x34204e['includes']('/')&&(_0x30b37f=_0x46bba0+'/'+_0x34204e,_0x2aa36b[_0x417b4d(0x1be)]&&console['error'](_0x417b4d(0x117)+_0x30b37f));const _0x5836c3=await withSpinner(_0x417b4d(0x13d)+_0x30b37f+_0x417b4d(0x185),()=>_0x299821[_0x417b4d(0x16d)][_0x417b4d(0x1b5)](_0x30b37f),{'verbose':_0x2aa36b['verbose']}),_0xb12129=_0x5836c3[_0x417b4d(0x12a)];_0x2aa36b[_0x417b4d(0x1be)]&&(console[_0x417b4d(0x142)]('Resolved\x20type:\x20'+_0xb12129[_0x417b4d(0x1a8)]),console[_0x417b4d(0x142)]('Parent\x20ID:\x20'+_0xb12129[_0x417b4d(0x1b2)]),_0xb12129[_0x417b4d(0x124)]&&console['error']('Folder\x20ID:\x20'+_0xb12129[_0x417b4d(0x124)]),_0xb12129[_0x417b4d(0x1a1)]&&console[_0x417b4d(0x142)](_0x417b4d(0x19a)+_0xb12129[_0x417b4d(0x1a1)]));if(_0xb12129[_0x417b4d(0x1a8)]===_0x417b4d(0x13b)){const _0x4b4fe2=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x299821[_0x417b4d(0x16d)][_0x417b4d(0x161)](_0xb12129[_0x417b4d(0x1b2)]),{'verbose':_0x2aa36b['verbose']});await handleSingleObjectOutput(_0x4b4fe2[_0x417b4d(0x12a)],_0x2aa36b);}else{if(_0xb12129['type']==='folder'){if(!_0xb12129[_0x417b4d(0x124)])throw new SDKError(ErrorCode[_0x417b4d(0x1ba)],_0x417b4d(0x1ae));const _0x291988=await withSpinner(_0x417b4d(0x1ac),()=>_0x299821[_0x417b4d(0x16d)][_0x417b4d(0x170)](_0xb12129['folderId']),{'verbose':_0x2aa36b[_0x417b4d(0x1be)]});await handleSingleObjectOutput(_0x291988[_0x417b4d(0x12a)],_0x2aa36b);}else{if(_0xb12129[_0x417b4d(0x1a8)]===_0x417b4d(0x16d)){if(!_0xb12129[_0x417b4d(0x1a1)])throw new SDKError(ErrorCode[_0x417b4d(0x17f)],_0x417b4d(0x155));const _0x5666df=await withSpinner(_0x417b4d(0x1a0),()=>_0x299821[_0x417b4d(0x16d)][_0x417b4d(0x149)](_0xb12129[_0x417b4d(0x1b2)],_0xb12129[_0x417b4d(0x1a1)]),{'verbose':_0x2aa36b[_0x417b4d(0x1be)]});await handleSingleObjectOutput(_0x5666df[_0x417b4d(0x12a)],_0x2aa36b);}}}return 0x0;}catch(_0x21807e){if(_0x21807e instanceof SDKError)return console[_0x417b4d(0x142)](_0x417b4d(0x1a9)+_0x21807e[_0x417b4d(0x12b)]),_0x21807e[_0x417b4d(0x165)]&&console['error'](_0x417b4d(0x186)+_0x21807e[_0x417b4d(0x165)]),0x1;throw _0x21807e;}}}export class SegmentShowCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x15d);['description']=a35_0x3b9a9b(0x133);async[a35_0x3b9a9b(0x14d)](_0x48f5e9){const _0xade2c1=a35_0x3b9a9b,{options:_0x119cbb,args:_0x38f64b,tdx:_0x3b9674}=_0x48f5e9,_0x7360ce=_0x38f64b[0x0];if(!_0x7360ce)return console[_0xade2c1(0x142)](_0xade2c1(0x153)),console[_0xade2c1(0x142)](_0xade2c1(0x157)),console[_0xade2c1(0x142)](_0xade2c1(0x188)),console[_0xade2c1(0x142)](_0xade2c1(0x179)),console[_0xade2c1(0x142)](_0xade2c1(0x151)),console[_0xade2c1(0x142)](_0xade2c1(0x14e)),0x1;try{const _0x1306d3=_0x119cbb[_0xade2c1(0x160)],_0x3344fa=await resolveSegmentTarget(_0x7360ce,_0x1306d3,_0x119cbb['verbose']);_0x119cbb[_0xade2c1(0x1be)]&&console[_0xade2c1(0x142)](_0xade2c1(0x183)+_0x3344fa);const _0x5f122a=await withSpinner('Resolving\x20\x27'+_0x7360ce+_0xade2c1(0x185),()=>_0x3b9674[_0xade2c1(0x16d)]['resolvePathToResource'](_0x3344fa),{'verbose':_0x119cbb[_0xade2c1(0x1be)]}),_0x3ca914=_0x5f122a[_0xade2c1(0x12a)];_0x119cbb[_0xade2c1(0x1be)]&&(console['error'](_0xade2c1(0x14f)+_0x3ca914['type']),console['error']('Parent\x20ID:\x20'+_0x3ca914[_0xade2c1(0x1b2)]));if(_0x3ca914[_0xade2c1(0x1a8)]===_0xade2c1(0x13c))return console[_0xade2c1(0x142)](_0xade2c1(0x15b)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x3ca914[_0xade2c1(0x1a8)]===_0xade2c1(0x13b))return console[_0xade2c1(0x142)](_0xade2c1(0x1b8)),console[_0xade2c1(0x142)](_0xade2c1(0x199)),0x1;if(!_0x3ca914['segmentId'])throw new SDKError(ErrorCode[_0xade2c1(0x17f)],_0xade2c1(0x155));const _0x362d4f=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x3b9674[_0xade2c1(0x16d)]['getSegmentSQL'](_0x3ca914[_0xade2c1(0x1b2)],_0x3ca914[_0xade2c1(0x1a1)]),{'verbose':_0x119cbb[_0xade2c1(0x1be)]});let _0x5816df=_0x362d4f[_0xade2c1(0x12a)];const _0x174afc=resolveLimit(_0x119cbb[_0xade2c1(0x129)],DEFAULT_DISPLAY_LIMIT),_0x56e3b1=/\bLIMIT\s+\d+/i[_0xade2c1(0x19d)](_0x5816df);!_0x56e3b1&&(_0x5816df=_0x5816df[_0xade2c1(0x138)]()[_0xade2c1(0x126)](/;+$/,''),_0x5816df='SELECT\x20*\x20FROM\x20(\x0a'+_0x5816df+_0xade2c1(0x1b3)+_0x174afc);_0x119cbb['verbose']&&console[_0xade2c1(0x142)]('SQL\x20query:\x0a'+_0x5816df);const _0x72119f=await withProgressSpinner('Executing\x20segment\x20query...',async _0x4779cf=>{const _0x27d0c6=_0xade2c1,_0x4f00a1=await _0x3b9674[_0x27d0c6(0x11b)]['execute'](_0x5816df,{'catalog':'td','schema':'information_schema','onJobId':_0x4f5aac=>{const _0x41bcd9=_0x27d0c6;_0x4779cf[_0x41bcd9(0x121)](_0x4f5aac);}});return _0x4f00a1;},{'verbose':_0x119cbb['verbose']}),_0x3139f3=_0x72119f[_0xade2c1(0x12a)],_0x150ff8=_0x3139f3['jobId']?_0xade2c1(0x17e)+_0x3139f3['jobId']+']':'';return console[_0xade2c1(0x142)](_0xade2c1(0x134)+_0x3139f3['stats']['processedRows'][_0xade2c1(0x1b6)]()+_0xade2c1(0x194)+('in\x20'+formatElapsed(_0x3139f3[_0xade2c1(0x1a7)]['elapsedTimeMillis'])+_0x150ff8)),await handleQueryOutput(_0x3139f3,_0x119cbb),0x0;}catch(_0x4cf2fd){if(_0x4cf2fd instanceof SDKError)return console[_0xade2c1(0x142)](_0xade2c1(0x12e)+_0x4cf2fd['code']+']'),console['error']('\x0a'+_0x4cf2fd[_0xade2c1(0x12b)]),0x1;throw _0x4cf2fd;}}}export class SegmentFolderListCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x15e);[a35_0x3b9a9b(0x14a)]=a35_0x3b9a9b(0x122);async['execute'](_0x57aa40){const _0x470400=a35_0x3b9a9b,{options:_0xded50d,args:_0x536563,tdx:_0x3a9c57}=_0x57aa40;if(_0x536563[_0x470400(0x12f)]===0x0)return console[_0x470400(0x142)](_0x470400(0x1a2)),console[_0x470400(0x142)](_0x470400(0x118)),0x1;const _0x10e412=_0x536563[0x0];try{_0xded50d[_0x470400(0x1be)]&&(console[_0x470400(0x142)](_0x470400(0x1a4)+_0xded50d['site']),console[_0x470400(0x142)]('Parent\x20name:\x20'+_0x10e412));const _0x3fa7a8=await withSpinner(_0x470400(0x123)+_0x10e412+_0x470400(0x185),()=>_0x3a9c57[_0x470400(0x16d)][_0x470400(0x180)](_0x10e412),{'verbose':_0xded50d[_0x470400(0x1be)]}),_0x450c0d=_0x3fa7a8[_0x470400(0x12a)];_0xded50d[_0x470400(0x1be)]&&console[_0x470400(0x142)](_0x470400(0x120)+_0x450c0d);const _0x4c85aa=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x10e412+_0x470400(0x185),()=>_0x3a9c57[_0x470400(0x16d)]['listFolders'](_0x450c0d),{'verbose':_0xded50d['verbose']}),_0x2edda0=_0x4c85aa[_0x470400(0x12a)];return console['error'](_0x470400(0x1b9)+_0x2edda0[_0x470400(0x12f)]+_0x470400(0x18c)+(_0x2edda0[_0x470400(0x12f)]!==0x1?'s':'')),await handleSDKOutput(_0x2edda0,_0xded50d),0x0;}catch(_0x1b64ea){if(_0x1b64ea instanceof SDKError)return console['error']('Error:\x20'+_0x1b64ea['message']),_0x1b64ea['cause']&&console[_0x470400(0x142)](_0x470400(0x186)+_0x1b64ea[_0x470400(0x165)]),0x1;throw _0x1b64ea;}}}export class SegmentFolderShowCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x128);['description']='Show\x20segment\x20folder\x20details';async['execute'](_0xbc159f){const _0x1328ae=a35_0x3b9a9b,{options:_0x2e07dc,args:_0xdc8f2c,tdx:_0xdd993e}=_0xbc159f;if(_0xdc8f2c['length']===0x0)return console[_0x1328ae(0x142)](_0x1328ae(0x184)),console['error'](_0x1328ae(0x18e)),0x1;try{const {parentId:_0x587bc,childId:_0x46ec09}=parseSegmentRef(_0xdc8f2c[0x0]);_0x2e07dc['verbose']&&(console[_0x1328ae(0x142)](_0x1328ae(0x1a4)+_0x2e07dc[_0x1328ae(0x17a)]),console['error'](_0x1328ae(0x17d)+_0x587bc),_0x46ec09&&console[_0x1328ae(0x142)]('Folder\x20name:\x20'+_0x46ec09));if(!_0x46ec09)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x4ea7f0=await withSpinner(_0x1328ae(0x123)+_0x587bc+_0x1328ae(0x185),()=>_0xdd993e[_0x1328ae(0x16d)][_0x1328ae(0x180)](_0x587bc),{'verbose':_0x2e07dc['verbose']}),_0x4c88b3=_0x4ea7f0['data'];_0x2e07dc[_0x1328ae(0x1be)]&&console[_0x1328ae(0x142)]('Resolved\x20parent\x20ID:\x20'+_0x4c88b3);const _0x1b85ac=await withSpinner(_0x1328ae(0x189)+_0x46ec09+_0x1328ae(0x185),()=>_0xdd993e['segment'][_0x1328ae(0x19c)](_0x4c88b3,_0x46ec09),{'verbose':_0x2e07dc[_0x1328ae(0x1be)]}),_0x371112=_0x1b85ac['data'];_0x2e07dc[_0x1328ae(0x1be)]&&console[_0x1328ae(0x142)](_0x1328ae(0x173)+_0x371112);const _0x28aadd=await withSpinner('Fetching\x20folder\x20\x27'+_0x46ec09+_0x1328ae(0x185),()=>_0xdd993e[_0x1328ae(0x16d)][_0x1328ae(0x170)](_0x371112),{'verbose':_0x2e07dc[_0x1328ae(0x1be)]});return await handleSDKOutput([_0x28aadd[_0x1328ae(0x12a)]],_0x2e07dc),0x0;}catch(_0x107310){if(_0x107310 instanceof SDKError)return console[_0x1328ae(0x142)](_0x1328ae(0x1a9)+_0x107310['message']),_0x107310['cause']&&console[_0x1328ae(0x142)]('\x20\x20Cause:\x20'+_0x107310[_0x1328ae(0x165)]),0x1;throw _0x107310;}}}export class SegmentSQLCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x198);[a35_0x3b9a9b(0x14a)]=a35_0x3b9a9b(0x16e);async[a35_0x3b9a9b(0x14d)](_0xecc4c0){const _0x30cd51=a35_0x3b9a9b,{options:_0x2b8600,args:_0x18a18f}=_0xecc4c0,_0x5b4965=_0x2b8600,_0x347659=_0x5b4965[_0x30cd51(0x12c)],_0x2336c3=_0x18a18f[0x0];if(!_0x2336c3&&!_0x347659)return console['error'](a35_0x59fe37['red'](_0x30cd51(0x197))),console['error']('Usage:'),console[_0x30cd51(0x142)](_0x30cd51(0x144)),console[_0x30cd51(0x142)](_0x30cd51(0x15f)),console[_0x30cd51(0x142)]('Examples:'),console['error'](_0x30cd51(0x16a)),console[_0x30cd51(0x142)](_0x30cd51(0x147)),0x1;if(_0x2336c3&&_0x347659)return console[_0x30cd51(0x142)](a35_0x59fe37[_0x30cd51(0x15a)]('Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both')),0x1;try{let _0x1777e3;if(_0x347659)_0x1777e3=await this[_0x30cd51(0x136)](_0x347659,_0xecc4c0);else{if(isYamlFilePath(_0x2336c3))return console[_0x30cd51(0x142)](a35_0x59fe37[_0x30cd51(0x15a)]('Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option')),console[_0x30cd51(0x142)]('\x20\x20tdx\x20sg\x20sql\x20--path\x20'+_0x2336c3),0x1;else _0x1777e3=await this[_0x30cd51(0x163)](_0x2336c3,_0xecc4c0);}return _0x2b8600[_0x30cd51(0x132)]===_0x30cd51(0x145)||_0x2b8600[_0x30cd51(0x132)]===_0x30cd51(0x131)?await handleSDKOutput([{'sql':_0x1777e3}],_0x2b8600):console[_0x30cd51(0x19e)](_0x1777e3),0x0;}catch(_0x216a7d){if(_0x216a7d instanceof SDKError)return console[_0x30cd51(0x142)](_0x30cd51(0x1a9)+_0x216a7d[_0x30cd51(0x12b)]),_0x216a7d[_0x30cd51(0x165)]&&console['error']('\x20\x20Cause:\x20'+_0x216a7d[_0x30cd51(0x165)]),0x1;throw _0x216a7d;}}async[a35_0x3b9a9b(0x136)](_0x1c3c89,_0x80691a){const _0x160a3f=a35_0x3b9a9b,{options:_0x253620,tdx:_0x32cca3}=_0x80691a;let _0x32ed69;try{_0x32ed69=await resolveYamlFilePath(_0x1c3c89);}catch(_0x5ef04f){throw new SDKError(ErrorCode[_0x160a3f(0x11f)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x5ef04f['message']);}_0x253620[_0x160a3f(0x1be)]&&console['error'](_0x160a3f(0x193)+_0x32ed69[_0x160a3f(0x160)]+'/'+_0x32ed69['segmentName']);const _0x7400e4=await withSpinner(_0x160a3f(0x159),()=>_0x32cca3[_0x160a3f(0x16d)][_0x160a3f(0x176)](_0x32ed69[_0x160a3f(0x152)],_0x32ed69[_0x160a3f(0x160)],_0x32ed69[_0x160a3f(0x18f)]),{'verbose':_0x253620[_0x160a3f(0x1be)]});return _0x7400e4[_0x160a3f(0x12a)];}async[a35_0x3b9a9b(0x163)](_0x4ac963,_0xb9bbc5){const _0x439967=a35_0x3b9a9b,{options:_0x592bbe,tdx:_0x34a807}=_0xb9bbc5,_0x2fafb6=_0x592bbe[_0x439967(0x160)],_0x542382=await resolveSegmentTarget(_0x4ac963,_0x2fafb6,_0x592bbe[_0x439967(0x1be)]);_0x592bbe[_0x439967(0x1be)]&&console['error']('Target\x20path:\x20'+_0x542382);const _0xc7ab98=await withSpinner(_0x439967(0x148)+_0x4ac963+_0x439967(0x185),()=>_0x34a807[_0x439967(0x16d)]['resolvePathToResource'](_0x542382),{'verbose':_0x592bbe[_0x439967(0x1be)]}),_0x425163=_0xc7ab98[_0x439967(0x12a)];_0x592bbe['verbose']&&(console[_0x439967(0x142)]('Resolved\x20type:\x20'+_0x425163[_0x439967(0x1a8)]),console[_0x439967(0x142)](_0x439967(0x14b)+_0x425163[_0x439967(0x1b2)]));if(_0x425163[_0x439967(0x1a8)]===_0x439967(0x13c))throw new SDKError(ErrorCode[_0x439967(0x11f)],_0x439967(0x158));if(_0x425163[_0x439967(0x1a8)]==='parent')throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x439967(0x1b4));if(!_0x425163['segmentId'])throw new SDKError(ErrorCode[_0x439967(0x17f)],_0x439967(0x155));const _0x1cf4be=await withSpinner(_0x439967(0x19b),()=>_0x34a807[_0x439967(0x16d)]['getSegmentSQL'](_0x425163['parentId'],_0x425163[_0x439967(0x1a1)]),{'verbose':_0x592bbe['verbose']});return _0x1cf4be[_0x439967(0x12a)];}}export class SegmentFolderCreateCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x187);[a35_0x3b9a9b(0x14a)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x452776){const _0xbc3c8b=a35_0x3b9a9b,{options:_0x57427e,args:_0x4094d6,tdx:_0x5e554c}=_0x452776,_0x1ca994=_0x57427e;if(_0x4094d6[_0xbc3c8b(0x12f)]<0x2)return console[_0xbc3c8b(0x142)](_0xbc3c8b(0x177)),console['error'](_0xbc3c8b(0x16b)),0x1;const _0x11483a=_0x4094d6[0x0],_0x92666d=_0x4094d6[0x1];_0x1ca994[_0xbc3c8b(0x1be)]&&(console[_0xbc3c8b(0x142)]('Site:\x20'+_0x1ca994['site']),console[_0xbc3c8b(0x142)](_0xbc3c8b(0x169)+_0x11483a),console[_0xbc3c8b(0x142)](_0xbc3c8b(0x17b)+_0x92666d));let _0x491ce4;if(_0x1ca994['parentFolder']){const _0x36da81=_0x1ca994[_0xbc3c8b(0x167)],_0x358670=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x11483a+_0xbc3c8b(0x185),()=>_0x5e554c['segment'][_0xbc3c8b(0x180)](_0x11483a),{'verbose':_0x1ca994['verbose']}),_0x1abd7c=_0x358670['data'],_0x1d5f52=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x36da81+'\x27...',()=>_0x5e554c[_0xbc3c8b(0x16d)][_0xbc3c8b(0x19c)](_0x1abd7c,_0x36da81),{'verbose':_0x1ca994[_0xbc3c8b(0x1be)]});_0x491ce4=_0x1d5f52[_0xbc3c8b(0x12a)],_0x1ca994['verbose']&&console[_0xbc3c8b(0x142)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x491ce4);}const _0x51a2ce={'name':_0x92666d,'description':_0x1ca994[_0xbc3c8b(0x14a)],'parentFolderId':_0x491ce4},_0x2793f7=await withSpinner(_0xbc3c8b(0x1bc)+_0x92666d+_0xbc3c8b(0x185),()=>_0x5e554c[_0xbc3c8b(0x16d)][_0xbc3c8b(0x1aa)](_0x11483a,_0x51a2ce),{'verbose':_0x1ca994[_0xbc3c8b(0x1be)]}),_0x529aec=_0x2793f7['data'];return console[_0xbc3c8b(0x142)](_0xbc3c8b(0x12d)+_0x529aec[_0xbc3c8b(0x13f)]+_0xbc3c8b(0x171)+_0x529aec['id']),await handleSDKOutput([_0x529aec],_0x1ca994),0x0;}}export class SegmentViewCommand extends BaseCommand{[a35_0x3b9a9b(0x13f)]=a35_0x3b9a9b(0x191);['description']=a35_0x3b9a9b(0x11a);async[a35_0x3b9a9b(0x14d)](_0x2b77c3){const _0x3842f1=a35_0x3b9a9b,{options:_0x28799b,args:_0x4438f7,tdx:_0x3d2bbe}=_0x2b77c3,_0x329dbd=_0x4438f7[0x0];if(!_0x329dbd)return console[_0x3842f1(0x142)](_0x3842f1(0x162)),console[_0x3842f1(0x142)](_0x3842f1(0x150)),console[_0x3842f1(0x142)](_0x3842f1(0x11d)),console['error'](_0x3842f1(0x1ab)),console[_0x3842f1(0x142)](_0x3842f1(0x1b0)),console[_0x3842f1(0x142)](_0x3842f1(0x179)),console[_0x3842f1(0x142)](_0x3842f1(0x154)),console[_0x3842f1(0x142)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x3842f1(0x142)](_0x3842f1(0x1ad)),console[_0x3842f1(0x142)](_0x3842f1(0x156)),0x1;try{const _0x40475f=_0x28799b[_0x3842f1(0x160)],_0x3d32d1=await resolveSegmentTarget(_0x329dbd,_0x40475f,_0x28799b[_0x3842f1(0x1be)]);_0x28799b[_0x3842f1(0x1be)]&&console['error'](_0x3842f1(0x183)+_0x3d32d1);const _0x3b520c=await withSpinner('Resolving\x20\x27'+_0x329dbd+'\x27...',()=>_0x3d2bbe[_0x3842f1(0x16d)][_0x3842f1(0x1b5)](_0x3d32d1),{'verbose':_0x28799b[_0x3842f1(0x1be)]}),_0x29632d=_0x3b520c[_0x3842f1(0x12a)];_0x28799b['verbose']&&(console['error'](_0x3842f1(0x14f)+_0x29632d[_0x3842f1(0x1a8)]),console[_0x3842f1(0x142)](_0x3842f1(0x14b)+_0x29632d[_0x3842f1(0x1b2)]),_0x29632d[_0x3842f1(0x124)]&&console[_0x3842f1(0x142)]('Folder\x20ID:\x20'+_0x29632d['folderId']),_0x29632d[_0x3842f1(0x1a1)]&&console[_0x3842f1(0x142)]('Segment\x20ID:\x20'+_0x29632d[_0x3842f1(0x1a1)]));if(_0x28799b[_0x3842f1(0x135)]){if(_0x29632d['type']===_0x3842f1(0x13c))return console[_0x3842f1(0x142)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x29632d[_0x3842f1(0x1a8)]===_0x3842f1(0x13b))return console[_0x3842f1(0x142)](_0x3842f1(0x175)),console[_0x3842f1(0x142)](_0x3842f1(0x1bb)),0x1;if(!_0x29632d['segmentId'])throw new SDKError(ErrorCode[_0x3842f1(0x17f)],_0x3842f1(0x155));const _0x565b47=getConsoleNextUrl(_0x28799b[_0x3842f1(0x17a)],_0x3842f1(0x192)+_0x29632d[_0x3842f1(0x1b2)]+_0x3842f1(0x1a5)+_0x29632d[_0x3842f1(0x1a1)]);return console[_0x3842f1(0x142)](a35_0x59fe37[_0x3842f1(0x190)]('βœ”')+_0x3842f1(0x11e)+a35_0x59fe37[_0x3842f1(0x141)](_0x565b47)),openBrowser(_0x565b47),0x0;}if(_0x29632d['type']==='folder'){if(!_0x29632d['folderId'])throw new SDKError(ErrorCode[_0x3842f1(0x1ba)],_0x3842f1(0x1ae));const _0x942173=await withSpinner(_0x3842f1(0x1ac),()=>_0x3d2bbe[_0x3842f1(0x16d)][_0x3842f1(0x170)](_0x29632d[_0x3842f1(0x124)]),{'verbose':_0x28799b['verbose']});await handleSingleObjectOutput(_0x942173['data'],_0x28799b);}else{if(_0x29632d[_0x3842f1(0x1a8)]===_0x3842f1(0x16d)){if(!_0x29632d['segmentId'])throw new SDKError(ErrorCode[_0x3842f1(0x17f)],_0x3842f1(0x155));const _0x44e4c6=await withSpinner(_0x3842f1(0x1a0),()=>_0x3d2bbe[_0x3842f1(0x16d)][_0x3842f1(0x149)](_0x29632d[_0x3842f1(0x1b2)],_0x29632d['segmentId']),{'verbose':_0x28799b['verbose']}),_0x5a0c98=getConsoleNextUrl(_0x28799b[_0x3842f1(0x17a)],_0x3842f1(0x192)+_0x29632d[_0x3842f1(0x1b2)]+_0x3842f1(0x1a5)+_0x29632d[_0x3842f1(0x1a1)]),_0x2d02cc=_0x44e4c6[_0x3842f1(0x12a)];_0x2d02cc[_0x3842f1(0x13e)]=_0x5a0c98,await handleSingleObjectOutput(_0x2d02cc,_0x28799b);}else return console['error'](_0x3842f1(0x195)),console[_0x3842f1(0x142)](_0x3842f1(0x140)),0x1;}return 0x0;}catch(_0x2ee53b){if(_0x2ee53b instanceof SDKError)return console[_0x3842f1(0x142)](_0x3842f1(0x1a9)+_0x2ee53b['message']),_0x2ee53b[_0x3842f1(0x165)]&&console[_0x3842f1(0x142)]('\x20\x20Cause:\x20'+_0x2ee53b[_0x3842f1(0x165)]),0x1;throw _0x2ee53b;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';['description']=a35_0x3b9a9b(0x146);async[a35_0x3b9a9b(0x14d)](_0x138d30){const _0x1ceb95=a35_0x3b9a9b,{options:_0x54d0ec,args:_0x5e5046,tdx:_0x39f295}=_0x138d30,_0x5e5f97=_0x5e5046[0x0];if(!_0x5e5f97)return console[_0x1ceb95(0x142)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x1ceb95(0x142)](_0x1ceb95(0x196)),console[_0x1ceb95(0x142)](_0x1ceb95(0x13a)),console[_0x1ceb95(0x142)](_0x1ceb95(0x179)),console['error'](_0x1ceb95(0x1af)),console[_0x1ceb95(0x142)](_0x1ceb95(0x1b7)),0x1;try{const _0x2af4b8=_0x54d0ec[_0x1ceb95(0x160)],_0x458f66=await resolveSegmentTarget(_0x5e5f97,_0x2af4b8,_0x54d0ec[_0x1ceb95(0x1be)]);_0x54d0ec[_0x1ceb95(0x1be)]&&console[_0x1ceb95(0x142)]('Target\x20path:\x20'+_0x458f66);const _0x45dd11=await withSpinner(_0x1ceb95(0x148)+_0x5e5f97+_0x1ceb95(0x185),()=>_0x39f295[_0x1ceb95(0x16d)]['resolvePathToResource'](_0x458f66),{'verbose':_0x54d0ec[_0x1ceb95(0x1be)]}),_0xd93ddf=_0x45dd11[_0x1ceb95(0x12a)];_0x54d0ec['verbose']&&(console[_0x1ceb95(0x142)]('Resolved\x20type:\x20'+_0xd93ddf[_0x1ceb95(0x1a8)]),console[_0x1ceb95(0x142)](_0x1ceb95(0x14b)+_0xd93ddf[_0x1ceb95(0x1b2)]));if(_0xd93ddf[_0x1ceb95(0x1a8)]===_0x1ceb95(0x13c))return console[_0x1ceb95(0x142)](_0x1ceb95(0x119)),console[_0x1ceb95(0x142)](_0x1ceb95(0x16f)),0x1;if(_0xd93ddf['type']==='parent')return console[_0x1ceb95(0x142)](_0x1ceb95(0x125)),console[_0x1ceb95(0x142)](_0x1ceb95(0x18a)),0x1;if(!_0xd93ddf[_0x1ceb95(0x1a1)])throw new SDKError(ErrorCode[_0x1ceb95(0x17f)],_0x1ceb95(0x155));const _0x27d861=await withSpinner(_0x1ceb95(0x19b),()=>_0x39f295[_0x1ceb95(0x16d)][_0x1ceb95(0x16c)](_0xd93ddf[_0x1ceb95(0x1b2)],_0xd93ddf[_0x1ceb95(0x1a1)]),{'verbose':_0x54d0ec[_0x1ceb95(0x1be)]}),_0x28bae6=_0x27d861[_0x1ceb95(0x12a)],_0x2f3a48=await executeSchemaQuery(_0x28bae6,_0x39f295,_0x54d0ec);return await handleQueryOutput(_0x2f3a48,_0x54d0ec),0x0;}catch(_0x5aab97){if(_0x5aab97 instanceof SDKError)return console[_0x1ceb95(0x142)](_0x1ceb95(0x1a9)+_0x5aab97[_0x1ceb95(0x12b)]),_0x5aab97[_0x1ceb95(0x165)]&&console[_0x1ceb95(0x142)]('\x20\x20Cause:\x20'+_0x5aab97[_0x1ceb95(0x165)]),0x1;throw _0x5aab97;}}}
@@ -1 +1 @@
1
- const a36_0xbd29e9=a36_0x3fd9;(function(_0x25e3e3,_0x95f80c){const _0x8fd9b0=a36_0x3fd9,_0xe1f6f3=_0x25e3e3();while(!![]){try{const _0xeaab01=parseInt(_0x8fd9b0(0x74))/0x1*(parseInt(_0x8fd9b0(0x94))/0x2)+parseInt(_0x8fd9b0(0x71))/0x3+-parseInt(_0x8fd9b0(0x81))/0x4+-parseInt(_0x8fd9b0(0xa6))/0x5*(-parseInt(_0x8fd9b0(0x82))/0x6)+parseInt(_0x8fd9b0(0x8c))/0x7+-parseInt(_0x8fd9b0(0x90))/0x8+parseInt(_0x8fd9b0(0x77))/0x9;if(_0xeaab01===_0x95f80c)break;else _0xe1f6f3['push'](_0xe1f6f3['shift']());}catch(_0x36737d){_0xe1f6f3['push'](_0xe1f6f3['shift']());}}}(a36_0x4b8a,0xdf27a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a36_0x4b8a(){const _0x123916=['Creating\x20segment\x20\x27','4336655QVoMcM','5200497ozLnWo','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','kind','1fXhYxy','rule','data','2128446Yhkznp','description','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Examples:','resolveParentId','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','segment','name','resolveFolderId','4505144wyNNFj','6IlvITF','\x27\x20with\x20ID:\x20','invisible','segmentPath','Resolving\x20folder\x20\x27','folderId','Site:\x20','\x27...','length','folder','402129atVHfM','\x20\x20\x20Path:\x20','Target\x20path:\x20','Resolved\x20relative\x20path\x20to:\x20','14138696MuhJly','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Parent:\x20','1825788SeDyDO','Segment\x20name:\x20','execute','site','includes','Create\x20child\x20segment\x20with\x20filtering\x20rules','βœ”\x20Created\x20segment\x20\x27','error','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','verbose','segments','yellow','type','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolvePathToResource','Resolved\x20folder\x20ID:\x20','parent'];a36_0x4b8a=function(){return _0x123916;};return a36_0x4b8a();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a36_0xec7b28 from'chalk';function a36_0x3fd9(_0x32e331,_0x3263d4){_0x32e331=_0x32e331-0x71;const _0x4b8ab8=a36_0x4b8a();let _0x3fd9e1=_0x4b8ab8[_0x32e331];return _0x3fd9e1;}export class SegmentCreateCommand extends BaseCommand{[a36_0xbd29e9(0x7f)]='segment:create';[a36_0xbd29e9(0x78)]=a36_0xbd29e9(0x99);async[a36_0xbd29e9(0x96)](_0x168e8d){const _0x58ef6d=a36_0xbd29e9;console[_0x58ef6d(0x9b)](a36_0xec7b28[_0x58ef6d(0x9f)](_0x58ef6d(0x92))),console['error'](a36_0xec7b28[_0x58ef6d(0x9f)](_0x58ef6d(0x91)));const {options:_0x405029,args:_0x519d27,tdx:_0x46bf7e}=_0x168e8d,_0x20d062=_0x405029;if(_0x519d27[_0x58ef6d(0x8a)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x58ef6d(0x9b)](_0x58ef6d(0x72)),console[_0x58ef6d(0x9b)](_0x58ef6d(0x7b)),console[_0x58ef6d(0x9b)](_0x58ef6d(0x7a)),console['error'](_0x58ef6d(0x79)),console[_0x58ef6d(0x9b)](_0x58ef6d(0xa1)),0x1;const _0x324686=_0x519d27[0x0],_0x179983=_0x405029[_0x58ef6d(0x85)];let _0x16ec8d=_0x324686;_0x179983&&!_0x324686[_0x58ef6d(0x98)]('/')&&(_0x16ec8d=_0x179983+'/'+_0x324686,_0x20d062['verbose']&&console[_0x58ef6d(0x9b)](_0x58ef6d(0x8f)+_0x16ec8d));const _0x6513ed=parsePath(_0x16ec8d);if(_0x6513ed[_0x58ef6d(0x9e)]['length']<0x2)return console[_0x58ef6d(0x9b)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x58ef6d(0x9b)](_0x58ef6d(0x7d)),0x1;const _0x39af21=_0x6513ed[_0x58ef6d(0x9e)][0x0],_0xdef02=getBaseName(_0x16ec8d),_0x28bf4d=getParentPath(_0x16ec8d);_0x20d062[_0x58ef6d(0x9d)]&&(console[_0x58ef6d(0x9b)](_0x58ef6d(0x88)+_0x20d062[_0x58ef6d(0x97)]),console['error'](_0x58ef6d(0x8e)+_0x16ec8d),console[_0x58ef6d(0x9b)](_0x58ef6d(0x93)+_0x39af21),console[_0x58ef6d(0x9b)](_0x58ef6d(0x95)+_0xdef02),console[_0x58ef6d(0x9b)]('Parent\x20path:\x20'+_0x28bf4d));const _0x3efa5b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x39af21+_0x58ef6d(0x89),()=>_0x46bf7e[_0x58ef6d(0x7e)][_0x58ef6d(0x7c)](_0x39af21),{'verbose':_0x20d062['verbose']}),_0x4af83f=_0x3efa5b[_0x58ef6d(0x76)];let _0x94d25c;if(_0x6513ed['segments'][_0x58ef6d(0x8a)]>0x2){const _0x3673f0=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x28bf4d+_0x58ef6d(0x89),()=>_0x46bf7e['segment'][_0x58ef6d(0xa2)](_0x28bf4d),{'verbose':_0x20d062[_0x58ef6d(0x9d)]}),_0x2d40a8=_0x3673f0[_0x58ef6d(0x76)];if(_0x2d40a8[_0x58ef6d(0xa0)]!==_0x58ef6d(0x8b)&&_0x2d40a8[_0x58ef6d(0xa0)]!==_0x58ef6d(0xa4))return console[_0x58ef6d(0x9b)](_0x58ef6d(0x9c)),0x1;_0x94d25c=_0x2d40a8[_0x58ef6d(0x87)];}else{if(_0x20d062['folder']){const _0x201e32=await withSpinner(_0x58ef6d(0x86)+_0x20d062[_0x58ef6d(0x8b)]+'\x27...',()=>_0x46bf7e[_0x58ef6d(0x7e)][_0x58ef6d(0x80)](_0x4af83f,_0x20d062[_0x58ef6d(0x8b)]),{'verbose':_0x20d062['verbose']});_0x94d25c=_0x201e32['data'];}}_0x20d062['verbose']&&_0x94d25c&&console['error'](_0x58ef6d(0xa3)+_0x94d25c);const _0x5c7db2=await loadJSONFromOptions(_0x20d062[_0x58ef6d(0x75)],_0x20d062['ruleFile']),_0x27dbc0={'name':_0xdef02,'description':_0x20d062['description'],'rule':_0x5c7db2,'kind':_0x20d062[_0x58ef6d(0x73)]!==undefined?parseInt(_0x20d062[_0x58ef6d(0x73)],0xa):undefined,'isVisible':_0x20d062[_0x58ef6d(0x84)]?![]:undefined,'segmentFolderId':_0x94d25c,'countPopulation':_0x20d062['noCountPopulation']?![]:undefined},_0x2bd1e6=await withSpinner(_0x58ef6d(0xa5)+_0xdef02+_0x58ef6d(0x89),()=>_0x46bf7e[_0x58ef6d(0x7e)]['createSegment'](_0x4af83f,_0x27dbc0),{'verbose':_0x20d062['verbose']}),_0xbfa7e8=_0x2bd1e6[_0x58ef6d(0x76)];return console['error'](_0x58ef6d(0x9a)+_0xbfa7e8['name']+_0x58ef6d(0x83)+_0xbfa7e8['id']),_0x16ec8d!==_0x324686&&console['error'](_0x58ef6d(0x8d)+_0x16ec8d),await handleSDKOutput([_0xbfa7e8],_0x20d062),0x0;}}
1
+ const a36_0x5c2b86=a36_0x4a1c;(function(_0x276ae9,_0x2c539a){const _0x305d21=a36_0x4a1c,_0x4014b9=_0x276ae9();while(!![]){try{const _0x571581=-parseInt(_0x305d21(0x1a6))/0x1*(-parseInt(_0x305d21(0x189))/0x2)+parseInt(_0x305d21(0x1b4))/0x3+-parseInt(_0x305d21(0x1aa))/0x4*(parseInt(_0x305d21(0x190))/0x5)+-parseInt(_0x305d21(0x1a2))/0x6+parseInt(_0x305d21(0x18a))/0x7*(parseInt(_0x305d21(0x1b6))/0x8)+parseInt(_0x305d21(0x1ac))/0x9+-parseInt(_0x305d21(0x1a9))/0xa*(parseInt(_0x305d21(0x184))/0xb);if(_0x571581===_0x2c539a)break;else _0x4014b9['push'](_0x4014b9['shift']());}catch(_0x44329d){_0x4014b9['push'](_0x4014b9['shift']());}}}(a36_0x2141,0x914db));function a36_0x4a1c(_0x474d99,_0x4792de){_0x474d99=_0x474d99-0x181;const _0x2141b2=a36_0x2141();let _0x4a1cdb=_0x2141b2[_0x474d99];return _0x4a1cdb;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';function a36_0x2141(){const _0x5562c7=['5319747BHbVJU','folder','segment:create','Resolved\x20relative\x20path\x20to:\x20','folderId','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent\x20path:\x20','description','2942946AGUkfl','resolvePathToResource','8YFwKIa','type','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Segment\x20name:\x20','data','8195QfCsFU','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Examples:','Creating\x20segment\x20\x27','yellow','36XNxNjr','6139644PAXxQR','resolveParentId','Resolved\x20folder\x20ID:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','noCountPopulation','verbose','3788765YYWUYa','parent','error','segment','length','Target\x20path:\x20','ruleFile','site','segmentPath','name','invisible','Parent:\x20','Resolving\x20folder\x20path\x20\x27','includes','kind','\x27...','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','createSegment','4758090DAhBON','execute','segments','Create\x20child\x20segment\x20with\x20filtering\x20rules','11878dArWGh','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','6940jXikyP','4SEHKfq','resolveFolderId'];a36_0x2141=function(){return _0x5562c7;};return a36_0x2141();}import a36_0x3e53a5 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a36_0x5c2b86(0x199)]=a36_0x5c2b86(0x1ae);[a36_0x5c2b86(0x1b3)]=a36_0x5c2b86(0x1a5);async[a36_0x5c2b86(0x1a3)](_0xd4e5f9){const _0x3f9097=a36_0x5c2b86;console[_0x3f9097(0x192)](a36_0x3e53a5['yellow'](_0x3f9097(0x1a8))),console[_0x3f9097(0x192)](a36_0x3e53a5[_0x3f9097(0x188)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x1d531d,args:_0x2e004e,tdx:_0x54658b}=_0xd4e5f9,_0x30ff72=_0x1d531d;if(_0x2e004e[_0x3f9097(0x194)]===0x0)return console[_0x3f9097(0x192)](_0x3f9097(0x1b1)),console[_0x3f9097(0x192)](_0x3f9097(0x1a0)),console['error'](_0x3f9097(0x186)),console[_0x3f9097(0x192)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x3f9097(0x192)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console['error'](_0x3f9097(0x185)),0x1;const _0x5ad235=_0x2e004e[0x0],_0x34ba53=_0x1d531d[_0x3f9097(0x198)];let _0x4317ed=_0x5ad235;_0x34ba53&&!_0x5ad235[_0x3f9097(0x19d)]('/')&&(_0x4317ed=_0x34ba53+'/'+_0x5ad235,_0x30ff72[_0x3f9097(0x18f)]&&console[_0x3f9097(0x192)](_0x3f9097(0x1af)+_0x4317ed));const _0x126c6c=parsePath(_0x4317ed);if(_0x126c6c['segments']['length']<0x2)return console['error'](_0x3f9097(0x181)),console[_0x3f9097(0x192)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x25ed8a=_0x126c6c['segments'][0x0],_0x31b072=getBaseName(_0x4317ed),_0x3ed1e9=getParentPath(_0x4317ed);_0x30ff72[_0x3f9097(0x18f)]&&(console[_0x3f9097(0x192)]('Site:\x20'+_0x30ff72[_0x3f9097(0x197)]),console[_0x3f9097(0x192)](_0x3f9097(0x195)+_0x4317ed),console['error'](_0x3f9097(0x19b)+_0x25ed8a),console[_0x3f9097(0x192)](_0x3f9097(0x182)+_0x31b072),console[_0x3f9097(0x192)](_0x3f9097(0x1b2)+_0x3ed1e9));const _0x5f330d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x25ed8a+'\x27...',()=>_0x54658b[_0x3f9097(0x193)][_0x3f9097(0x18b)](_0x25ed8a),{'verbose':_0x30ff72[_0x3f9097(0x18f)]}),_0x439d55=_0x5f330d[_0x3f9097(0x183)];let _0x1ecf70;if(_0x126c6c[_0x3f9097(0x1a4)][_0x3f9097(0x194)]>0x2){const _0xb85f55=await withSpinner(_0x3f9097(0x19c)+_0x3ed1e9+_0x3f9097(0x19f),()=>_0x54658b[_0x3f9097(0x193)][_0x3f9097(0x1b5)](_0x3ed1e9),{'verbose':_0x30ff72[_0x3f9097(0x18f)]}),_0x403935=_0xb85f55[_0x3f9097(0x183)];if(_0x403935[_0x3f9097(0x1b7)]!==_0x3f9097(0x1ad)&&_0x403935[_0x3f9097(0x1b7)]!==_0x3f9097(0x191))return console[_0x3f9097(0x192)](_0x3f9097(0x18d)),0x1;_0x1ecf70=_0x403935[_0x3f9097(0x1b0)];}else{if(_0x30ff72[_0x3f9097(0x1ad)]){const _0x2937f7=await withSpinner('Resolving\x20folder\x20\x27'+_0x30ff72[_0x3f9097(0x1ad)]+_0x3f9097(0x19f),()=>_0x54658b[_0x3f9097(0x193)][_0x3f9097(0x1ab)](_0x439d55,_0x30ff72[_0x3f9097(0x1ad)]),{'verbose':_0x30ff72[_0x3f9097(0x18f)]});_0x1ecf70=_0x2937f7[_0x3f9097(0x183)];}}_0x30ff72[_0x3f9097(0x18f)]&&_0x1ecf70&&console[_0x3f9097(0x192)](_0x3f9097(0x18c)+_0x1ecf70);const _0xa21255=await loadJSONFromOptions(_0x30ff72[_0x3f9097(0x1a7)],_0x30ff72[_0x3f9097(0x196)]),_0x59dcca={'name':_0x31b072,'description':_0x30ff72[_0x3f9097(0x1b3)],'rule':_0xa21255,'kind':_0x30ff72[_0x3f9097(0x19e)]!==undefined?parseInt(_0x30ff72[_0x3f9097(0x19e)],0xa):undefined,'isVisible':_0x30ff72[_0x3f9097(0x19a)]?![]:undefined,'segmentFolderId':_0x1ecf70,'countPopulation':_0x30ff72[_0x3f9097(0x18e)]?![]:undefined},_0x70b960=await withSpinner(_0x3f9097(0x187)+_0x31b072+_0x3f9097(0x19f),()=>_0x54658b[_0x3f9097(0x193)][_0x3f9097(0x1a1)](_0x439d55,_0x59dcca),{'verbose':_0x30ff72['verbose']}),_0x23e349=_0x70b960['data'];return console[_0x3f9097(0x192)]('βœ”\x20Created\x20segment\x20\x27'+_0x23e349[_0x3f9097(0x199)]+'\x27\x20with\x20ID:\x20'+_0x23e349['id']),_0x4317ed!==_0x5ad235&&console[_0x3f9097(0x192)]('\x20\x20\x20Path:\x20'+_0x4317ed),await handleSDKOutput([_0x23e349],_0x30ff72),0x0;}}
@@ -1 +1 @@
1
- const a37_0xdb3c28=a37_0x5255;(function(_0x5b8884,_0x2af795){const _0x40af2c=a37_0x5255,_0x21c735=_0x5b8884();while(!![]){try{const _0x3c9319=-parseInt(_0x40af2c(0x128))/0x1*(-parseInt(_0x40af2c(0x114))/0x2)+parseInt(_0x40af2c(0x117))/0x3*(parseInt(_0x40af2c(0x110))/0x4)+parseInt(_0x40af2c(0x12a))/0x5+-parseInt(_0x40af2c(0x121))/0x6*(-parseInt(_0x40af2c(0x125))/0x7)+-parseInt(_0x40af2c(0x11e))/0x8*(-parseInt(_0x40af2c(0x111))/0x9)+parseInt(_0x40af2c(0x129))/0xa*(parseInt(_0x40af2c(0x11c))/0xb)+-parseInt(_0x40af2c(0x116))/0xc;if(_0x3c9319===_0x2af795)break;else _0x21c735['push'](_0x21c735['shift']());}catch(_0x1e7dfc){_0x21c735['push'](_0x21c735['shift']());}}}(a37_0x41f1,0x58b0e));function a37_0x5255(_0x1f5050,_0x4b7150){_0x1f5050=_0x1f5050-0x110;const _0x41f1d3=a37_0x41f1();let _0x52555c=_0x41f1d3[_0x1f5050];return _0x52555c;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a37_0xdb3c28(0x11a)]='segment:fields';[a37_0xdb3c28(0x120)]=a37_0xdb3c28(0x127);async['execute'](_0x34d4bd){const _0x4f7561=a37_0xdb3c28,{options:_0x8d1030,args:_0x4f15e8,tdx:_0x86823e}=_0x34d4bd,_0x4f4c79=_0x4f15e8[0x0]||_0x8d1030[_0x4f7561(0x122)];if(!_0x4f4c79)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x4f7561(0x115)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x8d1030[_0x4f7561(0x12b)]&&(console['error'](_0x4f7561(0x11d)+_0x8d1030[_0x4f7561(0x12c)]),console[_0x4f7561(0x115)](_0x4f7561(0x112)+_0x4f4c79));const _0x2c17ab=await withSpinner(_0x4f7561(0x126)+_0x4f4c79+_0x4f7561(0x113),()=>_0x86823e[_0x4f7561(0x11b)][_0x4f7561(0x119)](_0x4f4c79),{'verbose':_0x8d1030[_0x4f7561(0x12b)]}),_0x3b44b8=_0x2c17ab['data'];console[_0x4f7561(0x115)](_0x4f7561(0x124)+_0x3b44b8[_0x4f7561(0x11f)]+_0x4f7561(0x123)+(_0x3b44b8[_0x4f7561(0x11f)]!==0x1?'s':''));if(_0x8d1030['json']||_0x8d1030[_0x4f7561(0x118)])return await handleSDKOutput(_0x3b44b8,_0x8d1030),0x0;return displayFieldsHumanReadable(_0x3b44b8,_0x4f4c79),0x0;}}function a37_0x41f1(){const _0x32a0a9=['verbose','site','1410964CoYgPO','18PHfqrK','Parent\x20segment:\x20','\x27...','2nyVAyj','error','24654744UkoTxz','6FLdrCc','jsonl','listFields','name','segment','363SZjkuw','Site:\x20','1019048UGcxiG','length','description','3805884CPLfIG','parentSegment','\x20field','βœ”\x20Found\x20','7oOpzVn','Listing\x20fields\x20for\x20\x27','List\x20available\x20fields\x20for\x20segmentation','676387cQVbfU','25630hdGWaT','311580GXVNHk'];a37_0x41f1=function(){return _0x32a0a9;};return a37_0x41f1();}
1
+ const a37_0x5d4ce4=a37_0x364f;function a37_0x301a(){const _0x18c7c8=['51IYRpgK','\x27...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','data','length','2224nMJCuq','54paQsLH','8919EcfQvD','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','parentSegment','848950fmDoYl','\x20field','error','197533hZWitx','execute','Listing\x20fields\x20for\x20\x27','223422rauDOF','20940kFsdkm','listFields','230011uurGtd','segment:fields','11eaHAdc','540770YmHnDL','βœ”\x20Found\x20','description','segment','verbose'];a37_0x301a=function(){return _0x18c7c8;};return a37_0x301a();}(function(_0x1aa976,_0xa1bceb){const _0x27a4b8=a37_0x364f,_0x47f17a=_0x1aa976();while(!![]){try{const _0x570bc5=-parseInt(_0x27a4b8(0x1ba))/0x1+parseInt(_0x27a4b8(0x1d2))/0x2+parseInt(_0x27a4b8(0x1c2))/0x3*(parseInt(_0x27a4b8(0x1d3))/0x4)+parseInt(_0x27a4b8(0x1bd))/0x5+parseInt(_0x27a4b8(0x1c8))/0x6*(parseInt(_0x27a4b8(0x1cf))/0x7)+parseInt(_0x27a4b8(0x1c7))/0x8*(-parseInt(_0x27a4b8(0x1c9))/0x9)+-parseInt(_0x27a4b8(0x1cc))/0xa*(-parseInt(_0x27a4b8(0x1bc))/0xb);if(_0x570bc5===_0xa1bceb)break;else _0x47f17a['push'](_0x47f17a['shift']());}catch(_0x80bea1){_0x47f17a['push'](_0x47f17a['shift']());}}}(a37_0x301a,0x22b89));function a37_0x364f(_0x58f541,_0x593f47){_0x58f541=_0x58f541-0x1b9;const _0x301a2d=a37_0x301a();let _0x364f1a=_0x301a2d[_0x58f541];return _0x364f1a;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']=a37_0x5d4ce4(0x1bb);[a37_0x5d4ce4(0x1bf)]='List\x20available\x20fields\x20for\x20segmentation';async[a37_0x5d4ce4(0x1d0)](_0x14438e){const _0x3fe5ab=a37_0x5d4ce4,{options:_0x2c8c41,args:_0x3e82ff,tdx:_0x2f600f}=_0x14438e,_0x5129e6=_0x3e82ff[0x0]||_0x2c8c41[_0x3fe5ab(0x1cb)];if(!_0x5129e6)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3fe5ab(0x1ce)](_0x3fe5ab(0x1ca)),console['error'](_0x3fe5ab(0x1c4)),0x1;_0x2c8c41[_0x3fe5ab(0x1c1)]&&(console[_0x3fe5ab(0x1ce)]('Site:\x20'+_0x2c8c41['site']),console[_0x3fe5ab(0x1ce)]('Parent\x20segment:\x20'+_0x5129e6));const _0x57ef34=await withSpinner(_0x3fe5ab(0x1d1)+_0x5129e6+_0x3fe5ab(0x1c3),()=>_0x2f600f[_0x3fe5ab(0x1c0)][_0x3fe5ab(0x1b9)](_0x5129e6),{'verbose':_0x2c8c41[_0x3fe5ab(0x1c1)]}),_0x1a3e6c=_0x57ef34[_0x3fe5ab(0x1c5)];console[_0x3fe5ab(0x1ce)](_0x3fe5ab(0x1be)+_0x1a3e6c[_0x3fe5ab(0x1c6)]+_0x3fe5ab(0x1cd)+(_0x1a3e6c[_0x3fe5ab(0x1c6)]!==0x1?'s':''));if(_0x2c8c41['json']||_0x2c8c41['jsonl'])return await handleSDKOutput(_0x1a3e6c,_0x2c8c41),0x0;return displayFieldsHumanReadable(_0x1a3e6c,_0x5129e6),0x0;}}
@@ -1 +1 @@
1
- function a38_0x40b5(_0x454bad,_0x578d8f){_0x454bad=_0x454bad-0x1f0;const _0x4c276b=a38_0x4c27();let _0x40b58c=_0x4c276b[_0x454bad];return _0x40b58c;}function a38_0x4c27(){const _0x88a23e=['yes','28MZgLUO','170895znkxsP','execute','setPhase','segment:pull','860678mkLUIJ','\x0aPull\x20summary\x20for\x20\x27','-\x20no\x20files\x20written','repeat','\x20segments','Target\x20resource:\x20','Error:\x20','red','\x20changed\x20files','\x20with\x20','parent_segment','pullSegments','\x20files?','journeyVersions','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','message','isNew','\x20journeys','parentSegment','1383327myHAEo','green','resourceName','yellow','content','2061FsYqnv','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','\x20=\x20','session','verbose','activations','\x20versions)','filter','Write\x20','βœ”\x20Context\x20set:\x20','helpText','targetDir','length','Aborted.','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20Target:\x20','segment','error','\x20activations','files','cwd','\x20unchanged\x20files','description','parentName','segments','relativePath','hasChanges','846Tfjvgb','\x27...','\x20\x20🎯\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','18SgQDHm','28250zkMwoZ','type','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)','Pulling\x20segments\x20from\x20\x27','\x0aError:','data','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','βœ”\x20Pulled\x20','\x20\x20πŸ—ΊοΈ\x20\x20','22928xFwgPl','site','2079704uQnJmy','\x0aChanges\x20to\x20\x27','cyan','utf-8','absolutePath','errorCode','Parent\x20segment:\x20','dim','journeys','no_parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','dryRun','counts','\x20new\x20files','364mHTtfS'];a38_0x4c27=function(){return _0x88a23e;};return a38_0x4c27();}const a38_0x15bc89=a38_0x40b5;(function(_0x10650a,_0xb3fa87){const _0x5a833e=a38_0x40b5,_0x1728f3=_0x10650a();while(!![]){try{const _0x3d4037=parseInt(_0x5a833e(0x214))/0x1*(parseInt(_0x5a833e(0x202))/0x2)+parseInt(_0x5a833e(0x231))/0x3*(-parseInt(_0x5a833e(0x212))/0x4)+parseInt(_0x5a833e(0x215))/0x5*(-parseInt(_0x5a833e(0x1f8))/0x6)+-parseInt(_0x5a833e(0x219))/0x7+-parseInt(_0x5a833e(0x204))/0x8+parseInt(_0x5a833e(0x1f4))/0x9*(parseInt(_0x5a833e(0x1f9))/0xa)+parseInt(_0x5a833e(0x22c))/0xb;if(_0x3d4037===_0xb3fa87)break;else _0x1728f3['push'](_0x1728f3['shift']());}catch(_0x467e3c){_0x1728f3['push'](_0x1728f3['shift']());}}}(a38_0x4c27,0x281e8));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_0x1f1eac from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x1d5145 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a38_0x15bc89(0x218);[a38_0x15bc89(0x248)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a38_0x15bc89(0x216)](_0x5de587){const _0x4261ba=a38_0x15bc89,{options:_0x16785c,args:_0xb9d91f,tdx:_0x56912c}=_0x5de587,_0xe4dbd7=_0x16785c,_0x5956ca=await resolveTarget({'arg':_0xb9d91f[0x0],'contextParent':_0x16785c[_0x4261ba(0x22b)],'cwd':process[_0x4261ba(0x246)]()});if(!isSuccessfulResolution(_0x5956ca))return _0x5956ca[_0x4261ba(0x209)]===_0x4261ba(0x20d)?(console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22f)](_0x4261ba(0x1f7))),console[_0x4261ba(0x243)](_0x4261ba(0x1fb)),console[_0x4261ba(0x243)](_0x4261ba(0x227)),console[_0x4261ba(0x243)](_0x4261ba(0x20e))):(console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x220)](_0x4261ba(0x21f)+_0x5956ca[_0x4261ba(0x228)]+'\x0a')),_0x5956ca[_0x4261ba(0x23c)]&&console['error'](a38_0x1f1eac['cyan'](_0x5956ca[_0x4261ba(0x23c)]))),0x1;const _0x45ac5b=_0x5956ca[_0x4261ba(0x1f0)],_0x5a17ff=_0x5956ca['targetDir'],_0x18bf06=_0x5956ca[_0x4261ba(0x1fa)]==='file'?_0x5956ca[_0x4261ba(0x22e)]:undefined;_0xe4dbd7[_0x4261ba(0x236)]&&(console[_0x4261ba(0x243)]('Site:\x20'+_0xe4dbd7[_0x4261ba(0x203)]),console[_0x4261ba(0x243)](_0x4261ba(0x20a)+_0x45ac5b),_0x18bf06&&console[_0x4261ba(0x243)](_0x4261ba(0x21e)+_0x18bf06));const _0x22838b=await withProgressSpinner(_0x4261ba(0x1fc)+_0x45ac5b+_0x4261ba(0x1f5),_0x4d2ee5=>_0x56912c[_0x4261ba(0x242)][_0x4261ba(0x224)](_0x45ac5b,{'targetDir':_0x5a17ff,'targetResourceName':_0x18bf06,'verbose':_0xe4dbd7['verbose'],'progress':{'update':_0x55cafb=>{const _0x5c3dc3=_0x4261ba;_0x4d2ee5[_0x5c3dc3(0x217)](_0x55cafb),_0xe4dbd7[_0x5c3dc3(0x236)]&&console[_0x5c3dc3(0x243)]('\x20\x20'+_0x55cafb);}}}),{'verbose':_0xe4dbd7[_0x4261ba(0x236)]}),_0x27fd08=_0x22838b[_0x4261ba(0x1fe)];if(_0x27fd08['counts'][_0x4261ba(0x1f1)]===0x0&&_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x20c)]===0x0)return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22f)](_0x4261ba(0x233)+_0x27fd08[_0x4261ba(0x1f0)]+'\x27')),0x0;const _0x11a9d8=_0x27fd08[_0x4261ba(0x245)][_0x4261ba(0x239)](_0x4a0ed7=>_0x4a0ed7[_0x4261ba(0x229)]),_0x1f40eb=_0x27fd08['files'][_0x4261ba(0x239)](_0x16fee7=>!_0x16fee7[_0x4261ba(0x229)]&&_0x16fee7[_0x4261ba(0x1f3)]),_0x577d98=_0x27fd08[_0x4261ba(0x245)]['filter'](_0xab4472=>!_0xab4472[_0x4261ba(0x229)]&&!_0xab4472['hasChanges']);console['error'](_0x4261ba(0x21a)+_0x27fd08[_0x4261ba(0x1f0)]+'\x27:'),console[_0x4261ba(0x243)](_0x4261ba(0x1f6)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x1f1)]+_0x4261ba(0x21d))+_0x4261ba(0x222)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x237)]+_0x4261ba(0x244)));if(_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x20c)]>0x0){const _0x3134c5=_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x226)]>_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x20c)]?'\x20('+_0x27fd08[_0x4261ba(0x210)][_0x4261ba(0x226)]+_0x4261ba(0x238):'';console[_0x4261ba(0x243)](_0x4261ba(0x201)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x210)]['journeys']+_0x4261ba(0x22a))+a38_0x1f1eac[_0x4261ba(0x20b)](_0x3134c5));}console['error']('\x20\x20'+a38_0x1f1eac[_0x4261ba(0x22d)]('+\x20'+_0x11a9d8[_0x4261ba(0x23e)]+_0x4261ba(0x211))),console[_0x4261ba(0x243)]('\x20\x20'+a38_0x1f1eac[_0x4261ba(0x22f)]('~\x20'+_0x1f40eb[_0x4261ba(0x23e)]+_0x4261ba(0x221))),console[_0x4261ba(0x243)]('\x20\x20'+a38_0x1f1eac[_0x4261ba(0x20b)]('=\x20'+_0x577d98[_0x4261ba(0x23e)]+_0x4261ba(0x247))),console[_0x4261ba(0x243)](_0x4261ba(0x241)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x23d)])+'\x0a');if(_0x1f40eb[_0x4261ba(0x23e)]>0x0)for(const _0x221824 of _0x1f40eb){console[_0x4261ba(0x243)](_0x4261ba(0x205)+_0x221824[_0x4261ba(0x1f2)]+'\x27:'),console[_0x4261ba(0x243)]('─'[_0x4261ba(0x21c)](0x3c)),console['error'](_0x221824['diff']),console[_0x4261ba(0x243)]('─'[_0x4261ba(0x21c)](0x3c));}if(_0xe4dbd7[_0x4261ba(0x20f)])return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22f)](_0x4261ba(0x240))),0x0;if(_0x11a9d8[_0x4261ba(0x23e)]===0x0&&_0x1f40eb['length']===0x0)return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22d)](_0x4261ba(0x232))),saveSessionContext({'parent_segment':_0x27fd08[_0x4261ba(0x1f0)]},_0xe4dbd7[_0x4261ba(0x235)]),console['error'](a38_0x1f1eac['green'](_0x4261ba(0x23b)+a38_0x1f1eac[_0x4261ba(0x20b)](_0x4261ba(0x223))+'\x20=\x20'+a38_0x1f1eac['cyan'](_0x27fd08[_0x4261ba(0x1f0)]))),0x0;if(!_0xe4dbd7[_0x4261ba(0x213)]){if(!isInteractive())return console['error'](a38_0x1f1eac[_0x4261ba(0x220)](_0x4261ba(0x1fd)),_0x4261ba(0x1ff)),console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x20b)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xad8b40=await confirmKey(_0x4261ba(0x23a)+(_0x11a9d8[_0x4261ba(0x23e)]+_0x1f40eb[_0x4261ba(0x23e)])+_0x4261ba(0x225));if(!_0xad8b40)return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22f)](_0x4261ba(0x23f)),_0x4261ba(0x21b)),0x1;}for(const _0x27f7fe of _0x27fd08[_0x4261ba(0x245)]){if(_0x27f7fe['isNew']||_0x27f7fe[_0x4261ba(0x1f3)]){const _0xe4f487=a38_0x1d5145['dirname'](_0x27f7fe[_0x4261ba(0x208)]);!existsSync(_0xe4f487)&&mkdirSync(_0xe4f487,{'recursive':!![]}),writeFileSync(_0x27f7fe[_0x4261ba(0x208)],_0x27f7fe[_0x4261ba(0x230)],_0x4261ba(0x207));}}return console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22d)](_0x4261ba(0x200)+(_0x11a9d8[_0x4261ba(0x23e)]+_0x1f40eb[_0x4261ba(0x23e)])+'\x20files\x20to\x20'+_0x27fd08['targetDir'])),saveSessionContext({'parent_segment':_0x27fd08[_0x4261ba(0x1f0)]},_0xe4dbd7[_0x4261ba(0x235)]),console[_0x4261ba(0x243)](a38_0x1f1eac[_0x4261ba(0x22d)](_0x4261ba(0x23b)+a38_0x1f1eac[_0x4261ba(0x20b)](_0x4261ba(0x223))+_0x4261ba(0x234)+a38_0x1f1eac[_0x4261ba(0x206)](_0x27fd08[_0x4261ba(0x1f0)]))),0x0;}}
1
+ const a38_0x58dc01=a38_0x2821;(function(_0x4cdc18,_0x28c33b){const _0xc90792=a38_0x2821,_0x2f5ae2=_0x4cdc18();while(!![]){try{const _0xebbf8e=-parseInt(_0xc90792(0x209))/0x1+-parseInt(_0xc90792(0x1fb))/0x2*(-parseInt(_0xc90792(0x225))/0x3)+parseInt(_0xc90792(0x23d))/0x4+parseInt(_0xc90792(0x20a))/0x5+-parseInt(_0xc90792(0x204))/0x6+-parseInt(_0xc90792(0x20b))/0x7+-parseInt(_0xc90792(0x22f))/0x8*(-parseInt(_0xc90792(0x1fa))/0x9);if(_0xebbf8e===_0x28c33b)break;else _0x2f5ae2['push'](_0x2f5ae2['shift']());}catch(_0x2dd2ce){_0x2f5ae2['push'](_0x2f5ae2['shift']());}}}(a38_0x25d8,0x205ca));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a38_0x2821(_0x3cc9f2,_0x430352){_0x3cc9f2=_0x3cc9f2-0x1f3;const _0x25d8ee=a38_0x25d8();let _0x2821ba=_0x25d8ee[_0x3cc9f2];return _0x2821ba;}import{saveSessionContext}from'../core/session.js';import a38_0x1913bf from'chalk';function a38_0x25d8(){const _0x48f4f6=['Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','segments','helpText','\x20journeys','yellow','red','\x0aChanges\x20to\x20\x27','\x20versions)','parent_segment','counts','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','targetDir','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','333TSojLh','\x20segments','files','description','isNew','Error:\x20','yes','parentSegment','Aborted.','site','1336OrYJTF','resourceName','\x20with\x20','Parent\x20segment:\x20','dryRun','activations','dim','filter','cyan','\x0aPull\x20summary\x20for\x20\x27','data','\x20activations','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)','message','747544QSpTIX','pullSegments','hasChanges','\x20new\x20files','utf-8','absolutePath','\x0aError:','segment:pull','repeat','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','session','name','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','parentName','\x20unchanged\x20files','errorCode','9414HJJlfM','2314TnxBRb','file','error','execute','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20🎯\x20','\x20\x20πŸ—ΊοΈ\x20\x20','relativePath','Pulling\x20segments\x20from\x20\x27','1001130aqsZPm','βœ”\x20Context\x20set:\x20','\x20\x20Target:\x20','green','\x20=\x20','144085DUQBtP','869790MvOAKB','1543213QOzUvg','Write\x20','setPhase','cwd','Site:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeyVersions','\x20files?','βœ”\x20Pulled\x20','journeys','no_parent','verbose','length'];a38_0x25d8=function(){return _0x48f4f6;};return a38_0x25d8();}import{existsSync,mkdirSync,writeFileSync}from'fs';import a38_0x4a7fc1 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_0x58dc01(0x1f5)]=a38_0x58dc01(0x244);[a38_0x58dc01(0x228)]=a38_0x58dc01(0x1f6);async[a38_0x58dc01(0x1fe)](_0x34d6ea){const _0xca16d=a38_0x58dc01,{options:_0xed4bf7,args:_0x53006e,tdx:_0x159a84}=_0x34d6ea,_0x268fae=_0xed4bf7,_0x52640d=await resolveTarget({'arg':_0x53006e[0x0],'contextParent':_0xed4bf7[_0xca16d(0x22c)],'cwd':process[_0xca16d(0x20e)]()});if(!isSuccessfulResolution(_0x52640d))return _0x52640d[_0xca16d(0x1f9)]===_0xca16d(0x215)?(console['error'](a38_0x1913bf[_0xca16d(0x21c)](_0xca16d(0x224))),console[_0xca16d(0x1fd)](_0xca16d(0x23b)),console[_0xca16d(0x1fd)](_0xca16d(0x222)),console[_0xca16d(0x1fd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a38_0x1913bf[_0xca16d(0x21d)](_0xca16d(0x22a)+_0x52640d[_0xca16d(0x23c)]+'\x0a')),_0x52640d[_0xca16d(0x21a)]&&console['error'](a38_0x1913bf['cyan'](_0x52640d[_0xca16d(0x21a)]))),0x1;const _0x377933=_0x52640d[_0xca16d(0x1f7)],_0x397803=_0x52640d[_0xca16d(0x223)],_0x3d1eb2=_0x52640d['type']===_0xca16d(0x1fc)?_0x52640d[_0xca16d(0x230)]:undefined;_0x268fae[_0xca16d(0x216)]&&(console[_0xca16d(0x1fd)](_0xca16d(0x20f)+_0x268fae[_0xca16d(0x22e)]),console[_0xca16d(0x1fd)](_0xca16d(0x232)+_0x377933),_0x3d1eb2&&console[_0xca16d(0x1fd)]('Target\x20resource:\x20'+_0x3d1eb2));const _0x1b75e8=await withProgressSpinner(_0xca16d(0x203)+_0x377933+'\x27...',_0xa1cbf1=>_0x159a84['segment'][_0xca16d(0x23e)](_0x377933,{'targetDir':_0x397803,'targetResourceName':_0x3d1eb2,'verbose':_0x268fae[_0xca16d(0x216)],'progress':{'update':_0x1b1f65=>{const _0x138d35=_0xca16d;_0xa1cbf1[_0x138d35(0x20d)](_0x1b1f65),_0x268fae[_0x138d35(0x216)]&&console[_0x138d35(0x1fd)]('\x20\x20'+_0x1b1f65);}}}),{'verbose':_0x268fae[_0xca16d(0x216)]}),_0x5aba3d=_0x1b75e8[_0xca16d(0x239)];if(_0x5aba3d[_0xca16d(0x221)]['segments']===0x0&&_0x5aba3d['counts'][_0xca16d(0x214)]===0x0)return console[_0xca16d(0x1fd)](a38_0x1913bf['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x5aba3d[_0xca16d(0x1f7)]+'\x27')),0x0;const _0x14df6c=_0x5aba3d[_0xca16d(0x227)]['filter'](_0x3994c2=>_0x3994c2[_0xca16d(0x229)]),_0x155e4b=_0x5aba3d['files'][_0xca16d(0x236)](_0x398be8=>!_0x398be8[_0xca16d(0x229)]&&_0x398be8['hasChanges']),_0x91ca19=_0x5aba3d[_0xca16d(0x227)][_0xca16d(0x236)](_0x18ec7c=>!_0x18ec7c[_0xca16d(0x229)]&&!_0x18ec7c[_0xca16d(0x23f)]);console[_0xca16d(0x1fd)](_0xca16d(0x238)+_0x5aba3d[_0xca16d(0x1f7)]+'\x27:'),console[_0xca16d(0x1fd)](_0xca16d(0x200)+a38_0x1913bf[_0xca16d(0x237)](_0x5aba3d['counts'][_0xca16d(0x219)]+_0xca16d(0x226))+_0xca16d(0x231)+a38_0x1913bf[_0xca16d(0x237)](_0x5aba3d['counts'][_0xca16d(0x234)]+_0xca16d(0x23a)));if(_0x5aba3d[_0xca16d(0x221)][_0xca16d(0x214)]>0x0){const _0x364b7c=_0x5aba3d[_0xca16d(0x221)][_0xca16d(0x211)]>_0x5aba3d['counts'][_0xca16d(0x214)]?'\x20('+_0x5aba3d['counts'][_0xca16d(0x211)]+_0xca16d(0x21f):'';console[_0xca16d(0x1fd)](_0xca16d(0x201)+a38_0x1913bf[_0xca16d(0x237)](_0x5aba3d[_0xca16d(0x221)][_0xca16d(0x214)]+_0xca16d(0x21b))+a38_0x1913bf[_0xca16d(0x235)](_0x364b7c));}console[_0xca16d(0x1fd)]('\x20\x20'+a38_0x1913bf[_0xca16d(0x207)]('+\x20'+_0x14df6c[_0xca16d(0x217)]+_0xca16d(0x240))),console[_0xca16d(0x1fd)]('\x20\x20'+a38_0x1913bf[_0xca16d(0x21c)]('~\x20'+_0x155e4b['length']+'\x20changed\x20files')),console[_0xca16d(0x1fd)]('\x20\x20'+a38_0x1913bf['dim']('=\x20'+_0x91ca19[_0xca16d(0x217)]+_0xca16d(0x1f8))),console['error'](_0xca16d(0x206)+a38_0x1913bf[_0xca16d(0x237)](_0x5aba3d[_0xca16d(0x223)])+'\x0a');if(_0x155e4b[_0xca16d(0x217)]>0x0)for(const _0x46c593 of _0x155e4b){console[_0xca16d(0x1fd)](_0xca16d(0x21e)+_0x46c593[_0xca16d(0x202)]+'\x27:'),console[_0xca16d(0x1fd)]('─'['repeat'](0x3c)),console[_0xca16d(0x1fd)](_0x46c593['diff']),console[_0xca16d(0x1fd)]('─'[_0xca16d(0x245)](0x3c));}if(_0x268fae[_0xca16d(0x233)])return console['error'](a38_0x1913bf[_0xca16d(0x21c)](_0xca16d(0x1ff))),0x0;if(_0x14df6c['length']===0x0&&_0x155e4b[_0xca16d(0x217)]===0x0)return console['error'](a38_0x1913bf[_0xca16d(0x207)](_0xca16d(0x1f3))),saveSessionContext({'parent_segment':_0x5aba3d['parentName']},_0x268fae[_0xca16d(0x1f4)]),console[_0xca16d(0x1fd)](a38_0x1913bf[_0xca16d(0x207)](_0xca16d(0x205)+a38_0x1913bf[_0xca16d(0x235)](_0xca16d(0x220))+_0xca16d(0x208)+a38_0x1913bf[_0xca16d(0x237)](_0x5aba3d[_0xca16d(0x1f7)]))),0x0;if(!_0x268fae[_0xca16d(0x22b)]){if(!isInteractive())return console['error'](a38_0x1913bf[_0xca16d(0x21d)](_0xca16d(0x243)),_0xca16d(0x210)),console[_0xca16d(0x1fd)](a38_0x1913bf[_0xca16d(0x235)](_0xca16d(0x218))),0x1;const _0x3e43ae=await confirmKey(_0xca16d(0x20c)+(_0x14df6c[_0xca16d(0x217)]+_0x155e4b[_0xca16d(0x217)])+_0xca16d(0x212));if(!_0x3e43ae)return console[_0xca16d(0x1fd)](a38_0x1913bf[_0xca16d(0x21c)](_0xca16d(0x22d)),'-\x20no\x20files\x20written'),0x1;}for(const _0x33f245 of _0x5aba3d['files']){if(_0x33f245[_0xca16d(0x229)]||_0x33f245[_0xca16d(0x23f)]){const _0x4f78ca=a38_0x4a7fc1['dirname'](_0x33f245['absolutePath']);!existsSync(_0x4f78ca)&&mkdirSync(_0x4f78ca,{'recursive':!![]}),writeFileSync(_0x33f245[_0xca16d(0x242)],_0x33f245['content'],_0xca16d(0x241));}}return console['error'](a38_0x1913bf[_0xca16d(0x207)](_0xca16d(0x213)+(_0x14df6c[_0xca16d(0x217)]+_0x155e4b[_0xca16d(0x217)])+'\x20files\x20to\x20'+_0x5aba3d[_0xca16d(0x223)])),saveSessionContext({'parent_segment':_0x5aba3d['parentName']},_0x268fae[_0xca16d(0x1f4)]),console[_0xca16d(0x1fd)](a38_0x1913bf[_0xca16d(0x207)](_0xca16d(0x205)+a38_0x1913bf[_0xca16d(0x235)]('parent_segment')+'\x20=\x20'+a38_0x1913bf[_0xca16d(0x237)](_0x5aba3d[_0xca16d(0x1f7)]))),0x0;}}
@@ -1 +1 @@
1
- const a39_0xfaa8b4=a39_0x3b14;(function(_0x54a623,_0x1b0f93){const _0x5965f3=a39_0x3b14,_0x16b4ad=_0x54a623();while(!![]){try{const _0x2b618e=parseInt(_0x5965f3(0x181))/0x1+-parseInt(_0x5965f3(0x199))/0x2*(parseInt(_0x5965f3(0x196))/0x3)+parseInt(_0x5965f3(0x10b))/0x4+parseInt(_0x5965f3(0x124))/0x5+parseInt(_0x5965f3(0x138))/0x6+-parseInt(_0x5965f3(0x10a))/0x7*(-parseInt(_0x5965f3(0x140))/0x8)+-parseInt(_0x5965f3(0x146))/0x9;if(_0x2b618e===_0x1b0f93)break;else _0x16b4ad['push'](_0x16b4ad['shift']());}catch(_0x4191ad){_0x16b4ad['push'](_0x16b4ad['shift']());}}}(a39_0x5aae,0x68fe8));import{BaseCommand}from'./command.js';function a39_0x5aae(){const _0x39d8f7=['then','yes','/j/da/je','existingJourney','2012605WBUvKZ','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','connection','site','journeyBundleName','updatedAt','toDelete','setPhase','errorCode','set','get','segment\x20or\x20journey','verbose','delete','cyan','updated','helpText','cwd','description','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','2301192CpENtf','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resolveParentId','green','list','isScoped','\x20new','listActivations','776vnhOuE','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','add','\x20created','parentSegment','\x20\x20Activations:','5978511BBgAqh','Delete\x20segment:','results','type','message','\x20\x20Segments:\x20','\x20unchanged','dryRun','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','Error:\x20Directory\x20not\x20found:\x20','\x20YAML\x20files\x20found','/sb/da/esr','segments','audienceId','journeysOnly','paused','map','filePath','length','red','error','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20deleted','No\x20','.yml','\x20\x20\x20\x20','\x20to\x20delete','getParent','join','relationships','\x20\x20Source:\x20','push','Aborted.','\x20\x20πŸ“Š\x20Segments:','Push\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','createdSegmentIds','\x0aError:','activations','listJourneysWithDetailsFromParentSegment','targetDir','isNew','\x20activations]','yamlConfig','\x20folders\x20to\x20create','πŸ“\x20','Fetching\x20existing\x20data...','segmentFolderId','existingSegment','versionNumber','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parent_name','journeyId','all','getJourney','Error:\x20','created','data','Site:\x20','214760XQIjof','Resolving\x20parent\x20segment\x20\x27','attributes','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','/app/ps/','.yaml','endsWith','(Journey\x20will\x20be\x20deleted)','idToName','filter','\x20changes?','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','state','New\x20journey:','journey','repeat','\x0aβœ”\x20Push\x20complete','changed','journeyBundleId','Delete\x20journey:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','47004mHeorC','unchanged','name','98rghAvc','segment','file','dim','blue','deleted','nameToType','\x20updated','yellow','Fetching\x20existing\x20activations...','toUpdate','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','nameToId','19579LaYPDi','2359780OSCOsx','Folders\x20to\x20create:','new','diff','Changes\x20to:','Scoped\x20to\x20folder:\x20','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)','\x20to\x20update','\x0aPush\x20summary\x20for\x20\x27','New\x20segment:','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x27...','/e/','Parent\x20segment:\x20','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','journeys','buildUserMaps','\x20to\x20create','folderPath','toString','folderId'];a39_0x5aae=function(){return _0x39d8f7;};return a39_0x5aae();}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a39_0x3b14(_0x327ee8,_0x593d74){_0x327ee8=_0x327ee8-0x103;const _0x5aae23=a39_0x5aae();let _0x3b14db=_0x5aae23[_0x327ee8];return _0x3b14db;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x5280e9 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_0xfaa8b4(0x198)]='segment:push';[a39_0xfaa8b4(0x136)]=a39_0xfaa8b4(0x108);async['execute'](_0x573a94){const _0x5d156e=a39_0xfaa8b4,{options:_0x41ac0f,args:_0x212c45,tdx:_0x183f03}=_0x573a94,_0x2fe048=_0x41ac0f,_0x171d2f=await resolveTarget({'arg':_0x212c45[0x0],'contextParent':_0x41ac0f[_0x5d156e(0x144)],'cwd':process[_0x5d156e(0x135)]()});if(!isSuccessfulResolution(_0x171d2f))return _0x171d2f[_0x5d156e(0x12c)]==='no_parent'?(console[_0x5d156e(0x15a)](a39_0x5280e9['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x5d156e(0x15a)](_0x5d156e(0x111)),console[_0x5d156e(0x15a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error'](_0x5d156e(0x169))):(console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x17d)+_0x171d2f[_0x5d156e(0x14a)]+'\x0a')),_0x171d2f[_0x5d156e(0x134)]&&console['error'](a39_0x5280e9[_0x5d156e(0x132)](_0x171d2f[_0x5d156e(0x134)]))),0x1;if(_0x171d2f['type']===_0x5d156e(0x179))return console['error'](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x14f)+_0x171d2f[_0x5d156e(0x16e)]+'\x0a')),console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x132)](_0x5d156e(0x139))),0x1;const _0x780f7=_0x171d2f['parentName'],_0x2a9cd8=_0x171d2f['targetDir'],_0x3c5a11=_0x171d2f[_0x5d156e(0x149)]===_0x5d156e(0x19b)?_0x171d2f[_0x5d156e(0x157)]:undefined,_0x1563b1=getScopedDetails(_0x171d2f),_0x25c730=_0x1563b1?.[_0x5d156e(0x13d)]??![],_0x4b9fa6=_0x1563b1?.['scopedFolderPath']??'';if(!existsSync(_0x2a9cd8))return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2a9cd8+'\x0a')),console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x132)](_0x5d156e(0x139))),0x1;_0x2fe048['verbose']&&(console['error'](_0x5d156e(0x180)+_0x2fe048[_0x5d156e(0x127)]),console['error'](_0x5d156e(0x118)+_0x780f7),console[_0x5d156e(0x15a)]('Source\x20directory:\x20'+_0x2a9cd8),_0x25c730&&console['error'](_0x5d156e(0x110)+_0x4b9fa6));const _0x4452c7=await withSpinner(_0x5d156e(0x182)+_0x780f7+_0x5d156e(0x116),()=>_0x183f03['segment'][_0x5d156e(0x13a)](_0x780f7),{'verbose':_0x2fe048[_0x5d156e(0x130)]}),_0x5f343e=_0x4452c7[_0x5d156e(0x17f)],{parentSegmentResult:_0x2225cf,segmentsResult:_0x41ace4,foldersResult:_0x5ce1d3,journeysWithDetailsResult:_0x3e7d1b,userMaps:_0x4742d6}=await withSpinner(_0x5d156e(0x174),async()=>{const _0x1e1fce=_0x5d156e,[_0x50ccbb,_0x435741,_0x10254d,_0x5aca6f,_0x158008]=await Promise[_0x1e1fce(0x17b)]([_0x183f03[_0x1e1fce(0x19a)][_0x1e1fce(0x161)](_0x5f343e),_0x183f03[_0x1e1fce(0x19a)]['listSegments'](_0x5f343e),_0x183f03[_0x1e1fce(0x19a)]['listFolders'](_0x5f343e),_0x183f03[_0x1e1fce(0x18f)][_0x1e1fce(0x16d)](_0x5f343e,{'includeAllVersions':!![]}),_0x183f03['user'][_0x1e1fce(0x11b)]()]);return{'parentSegmentResult':_0x50ccbb,'segmentsResult':_0x435741,'foldersResult':_0x10254d,'journeysWithDetailsResult':_0x5aca6f,'userMaps':_0x158008};},{'verbose':_0x2fe048[_0x5d156e(0x130)]})['then'](_0x3e887d=>_0x3e887d[_0x5d156e(0x17f)]),_0x4b1273=_0x2225cf,_0x315045=extractRootFolderId(_0x4b1273),_0x24d029=_0x41ace4,_0x1205f7=_0x5ce1d3,{journeys:_0x26bf6b,activationStepsById:_0x2618a8}=_0x3e7d1b,_0x176255=new Map(_0x26bf6b[_0x5d156e(0x156)](_0x35d05f=>[_0x35d05f['id'],_0x35d05f])),_0x211b3c=_0x26bf6b[_0x5d156e(0x156)](_0xc12a30=>({'id':_0xc12a30['id'],'name':_0xc12a30['attributes'][_0x5d156e(0x198)],'journeyBundleName':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x128)]||'','journeyBundleId':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x193)]||'','versionNumber':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x177)],'description':_0xc12a30['attributes'][_0x5d156e(0x136)],'state':_0xc12a30['attributes'][_0x5d156e(0x18d)],'paused':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x155)],'audienceId':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x153)],'folderId':_0xc12a30[_0x5d156e(0x163)]?.['parentFolder']?.[_0x5d156e(0x17f)]?.['id'],'createdAt':_0xc12a30[_0x5d156e(0x183)]['createdAt'],'updatedAt':_0xc12a30[_0x5d156e(0x183)][_0x5d156e(0x129)]})),{emailToId:_0x49ac12,idToEmail:_0x2d5b01}=_0x4742d6,_0x1ca6bc=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x54a6d7=_0x5d156e,_0x16e01c=await _0x183f03[_0x54a6d7(0x126)][_0x54a6d7(0x13c)]();return buildConnectionMaps(_0x16e01c);},{'verbose':_0x2fe048[_0x5d156e(0x130)]})[_0x5d156e(0x120)](_0x1b2c73=>_0x1b2c73[_0x5d156e(0x17f)]),_0x1446ec=_0x1ca6bc[_0x5d156e(0x109)],_0xfaaeb4=_0x1ca6bc[_0x5d156e(0x189)],_0x3b243d=_0x1ca6bc[_0x5d156e(0x103)],_0x427afa={'emailToIdMap':_0x49ac12,'connectionNameToIdMap':_0x1446ec,'connectionNameToTypeMap':_0x3b243d,'getSchema':_0x46b89f=>_0x183f03['connection']['getOutputSchemaWithCache'](_0x46b89f)};let {pathToId:_0x2c65e7,idToPath:_0x1a0b98}=buildFolderMaps(_0x1205f7);const _0x555231=buildSegmentLookupMap(_0x24d029,_0x1a0b98),_0x46ca0f=buildSegmentNameToIdMap(_0x24d029),_0x1199f6=buildJourneyBundleLookupMap(_0x211b3c,_0x1a0b98);let _0x2d0d1f;if(_0x3c5a11){if(!_0x3c5a11[_0x5d156e(0x187)](_0x5d156e(0x15e))&&!_0x3c5a11['endsWith'](_0x5d156e(0x186)))return console['error'](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x15b)+_0x3c5a11+'\x0a')),0x1;_0x2d0d1f=[_0x3c5a11];}else _0x2d0d1f=findYamlFiles(_0x2a9cd8);if(_0x2d0d1f[_0x5d156e(0x158)]===0x0)return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x18c)+_0x2a9cd8+'\x0a')),console['error'](a39_0x5280e9[_0x5d156e(0x132)](_0x5d156e(0x184))),0x1;let _0x4a9df4,_0x4122f5;try{const _0x30a8dc=parseAndClassifyYamlFiles(_0x2d0d1f,_0x2a9cd8,{'skipSegments':_0x2fe048['journeysOnly']});_0x4a9df4=_0x30a8dc['segments'],_0x4122f5=_0x30a8dc['journeys'];const _0x4c9294=validateParsedFiles(_0x30a8dc,_0x2a9cd8);if(_0x4c9294[_0x5d156e(0x158)]>0x0)return console['error'](a39_0x5280e9[_0x5d156e(0x159)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x4c9294)),console[_0x5d156e(0x15a)](a39_0x5280e9['yellow'](_0x5d156e(0x195))),0x1;}catch(_0x4383ef){return console['error'](a39_0x5280e9[_0x5d156e(0x159)]('Error\x20parsing\x20YAML:\x20'+(_0x4383ef instanceof Error?_0x4383ef[_0x5d156e(0x14a)]:_0x4383ef))),0x1;}if(_0x4a9df4[_0x5d156e(0x158)]===0x0&&_0x4122f5['length']===0x0){const _0x23ee0f=_0x2fe048[_0x5d156e(0x154)]?_0x5d156e(0x18f):_0x5d156e(0x12f);return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x15d)+_0x23ee0f+_0x5d156e(0x150))),0x0;}const _0x5eaf72=new Map();_0x24d029[_0x5d156e(0x158)]>0x0&&!_0x2fe048['journeysOnly']&&await withSpinner(_0x5d156e(0x106),async()=>{await batchAsync(_0x24d029,async _0x523baa=>{const _0xbb40c7=a39_0x3b14,_0x4520c7=await _0x183f03[_0xbb40c7(0x19a)][_0xbb40c7(0x13f)](_0x5f343e,_0x523baa['id']);_0x5eaf72[_0xbb40c7(0x12d)](_0x523baa['id'],_0x4520c7);});},{'verbose':_0x2fe048[_0x5d156e(0x130)]});const {segmentFiles:_0x5d31fe,foldersToCreate:_0x450643}=await prepareSegmentFiles(_0x4a9df4,{'segmentByFolderAndName':_0x555231,'activationsBySegmentId':_0x5eaf72,'folderPathToId':_0x2c65e7,'idToEmailMap':_0x2d5b01,'connectionIdToNameMap':_0xfaaeb4},_0x427afa,_0x25c730,_0x4b9fa6),_0x59befb=_0x3c5a11?[]:findSegmentsToDelete(_0x24d029,_0x4a9df4[_0x5d156e(0x156)](({yamlConfig:_0x21d69d,folderPath:_0x1d1943})=>({'yamlConfig':_0x21d69d,'folderPath':resolveTDFolderPath(_0x1d1943,_0x25c730,_0x4b9fa6)})),_0x1a0b98,_0x4b9fa6,_0x25c730),{journeyFiles:_0x3028f6,foldersToCreate:_0x40ff29}=await withProgressSpinner('Preparing\x20journeys...',async _0x22b6f2=>prepareJourneyFiles(_0x4122f5,{'fetchJourney':async _0x3dac1a=>_0x183f03[_0x5d156e(0x18f)][_0x5d156e(0x17c)](_0x3dac1a[_0x5d156e(0x17a)]),'journeyBundlesByFolderAndName':_0x1199f6,'folderPathToId':_0x2c65e7,'idToEmailMap':_0x2d5b01,'connectionIdToNameMap':_0xfaaeb4,'existingSegments':_0x24d029,'parentId':_0x5f343e,'deps':_0x183f03,'progress':{'update':_0x55d1c2=>{const _0x449e17=_0x5d156e;_0x22b6f2[_0x449e17(0x12b)](_0x55d1c2),_0x2fe048[_0x449e17(0x130)]&&console[_0x449e17(0x15a)]('\x20\x20'+_0x55d1c2);}},'journeyById':_0x176255,'activationStepsById':_0x2618a8},_0x25c730,_0x4b9fa6),{'verbose':_0x2fe048[_0x5d156e(0x130)]})[_0x5d156e(0x120)](_0x10cf5e=>_0x10cf5e[_0x5d156e(0x17f)]);for(const _0x455a61 of _0x40ff29){_0x450643[_0x5d156e(0x142)](_0x455a61);}const _0x4e7a1d=_0x3c5a11?[]:findJourneysToDelete(_0x211b3c,_0x4122f5[_0x5d156e(0x156)](({yamlConfig:_0x5702e0,folderPath:_0x91e113})=>({'yamlConfig':_0x5702e0,'folderPath':resolveTDFolderPath(_0x91e113,_0x25c730,_0x4b9fa6)})),_0x1a0b98,_0x4b9fa6,_0x25c730),_0x379a2b=calculatePushStats(_0x5d31fe,_0x3028f6,_0x450643,_0x59befb,_0x4e7a1d,!!_0x2fe048[_0x5d156e(0x131)],!!_0x2fe048[_0x5d156e(0x154)]),_0x4b4d9f=_0x379a2b[_0x5d156e(0x152)][_0x5d156e(0x10d)],_0x2cde77=_0x379a2b[_0x5d156e(0x152)][_0x5d156e(0x192)],_0x433333=_0x379a2b[_0x5d156e(0x152)]['unchanged'],_0x3694f8=_0x379a2b['segments'][_0x5d156e(0x12a)],_0x12b7c0=_0x379a2b['folders']['toCreate'],_0x1233ec=_0x379a2b['journeys']['new'],_0x2544a9=_0x379a2b[_0x5d156e(0x11a)][_0x5d156e(0x192)],_0x684ebb=_0x379a2b['journeys'][_0x5d156e(0x197)],_0x83132a=_0x379a2b['journeys'][_0x5d156e(0x12a)],_0x33eda6=_0x379a2b['activations']['all'],_0x46129e=_0x379a2b['activations']['toCreate'],_0x58753f=_0x379a2b['activations'][_0x5d156e(0x107)],_0x26253b=_0x379a2b[_0x5d156e(0x16c)][_0x5d156e(0x12a)];console[_0x5d156e(0x15a)](_0x5d156e(0x113)+_0x780f7+'\x27:');_0x12b7c0[_0x5d156e(0x158)]>0x0&&console[_0x5d156e(0x15a)]('\x20\x20'+a39_0x5280e9['blue'](_0x5d156e(0x173)+_0x12b7c0['length']+_0x5d156e(0x172)));if(!_0x2fe048['journeysOnly']){console[_0x5d156e(0x15a)](_0x5d156e(0x167)),console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x13b)]('+\x20'+_0x4b4d9f['length']+_0x5d156e(0x13e))),console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x105)]('~\x20'+_0x2cde77[_0x5d156e(0x158)]+'\x20changed'));if(_0x3694f8[_0x5d156e(0x158)]>0x0)console['error']('\x20\x20\x20\x20'+a39_0x5280e9[_0x5d156e(0x159)]('-\x20'+_0x3694f8[_0x5d156e(0x158)]+_0x5d156e(0x160)));else _0x59befb[_0x5d156e(0x158)]>0x0&&!_0x2fe048[_0x5d156e(0x131)]&&console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x19c)](_0x59befb[_0x5d156e(0x158)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x5d156e(0x15f)+a39_0x5280e9['dim']('=\x20'+_0x433333[_0x5d156e(0x158)]+_0x5d156e(0x14c)));}if(_0x3028f6[_0x5d156e(0x158)]>0x0||_0x4e7a1d[_0x5d156e(0x158)]>0x0){console['error']('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x13b)]('+\x20'+_0x1233ec['length']+_0x5d156e(0x13e))),console['error'](_0x5d156e(0x15f)+a39_0x5280e9['yellow']('~\x20'+_0x2544a9[_0x5d156e(0x158)]+'\x20changed'));if(_0x83132a[_0x5d156e(0x158)]>0x0)console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x159)]('-\x20'+_0x83132a['length']+_0x5d156e(0x160)));else _0x4e7a1d['length']>0x0&&!_0x2fe048[_0x5d156e(0x131)]&&console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x19c)](_0x4e7a1d[_0x5d156e(0x158)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9['dim']('=\x20'+_0x684ebb[_0x5d156e(0x158)]+'\x20unchanged'));}_0x33eda6[_0x5d156e(0x158)]>0x0&&!_0x2fe048[_0x5d156e(0x154)]&&(console[_0x5d156e(0x15a)](''),console[_0x5d156e(0x15a)](_0x5d156e(0x145)),_0x46129e[_0x5d156e(0x158)]>0x0&&console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x13b)]('+\x20'+_0x46129e['length']+_0x5d156e(0x11c))),_0x58753f[_0x5d156e(0x158)]>0x0&&console[_0x5d156e(0x15a)]('\x20\x20\x20\x20'+a39_0x5280e9['yellow']('~\x20'+_0x58753f[_0x5d156e(0x158)]+_0x5d156e(0x112))),_0x26253b[_0x5d156e(0x158)]>0x0&&console[_0x5d156e(0x15a)](_0x5d156e(0x15f)+a39_0x5280e9[_0x5d156e(0x159)]('-\x20'+_0x26253b[_0x5d156e(0x158)]+_0x5d156e(0x160))));console[_0x5d156e(0x15a)](_0x5d156e(0x164)+a39_0x5280e9[_0x5d156e(0x132)](_0x2a9cd8)+'\x0a');if(_0x12b7c0[_0x5d156e(0x158)]>0x0){console[_0x5d156e(0x15a)](_0x5d156e(0x10c));for(const _0xa55551 of _0x12b7c0){console[_0x5d156e(0x15a)]('\x20\x20'+a39_0x5280e9[_0x5d156e(0x19d)]('+')+'\x20'+_0xa55551);}console[_0x5d156e(0x15a)]('');}if(_0x4b4d9f[_0x5d156e(0x158)]>0x0&&!_0x2fe048[_0x5d156e(0x154)])for(const _0x34634e of _0x4b4d9f){const _0x43f40a=_0x34634e[_0x5d156e(0x11d)]?_0x34634e['folderPath']+'/'+_0x34634e[_0x5d156e(0x171)]['name']:_0x34634e['yamlConfig'][_0x5d156e(0x198)],_0x5bec3f=_0x34634e[_0x5d156e(0x171)]['activations']?.[_0x5d156e(0x158)]||0x0,_0x2d7c5f=_0x5bec3f>0x0?a39_0x5280e9[_0x5d156e(0x19c)]('\x20['+_0x5bec3f+'\x20activations]'):'';console[_0x5d156e(0x15a)]('\x0a'+a39_0x5280e9[_0x5d156e(0x13b)](_0x5d156e(0x114))+'\x20'+_0x43f40a+_0x2d7c5f),console['error']('─'[_0x5d156e(0x190)](0x3c)),_0x34634e[_0x5d156e(0x10e)]&&console[_0x5d156e(0x15a)](_0x34634e[_0x5d156e(0x10e)]),console['error']('─'[_0x5d156e(0x190)](0x3c));}if(_0x3694f8[_0x5d156e(0x158)]>0x0&&!_0x2fe048[_0x5d156e(0x154)])for(const _0x3a8921 of _0x3694f8){const _0x1f9f86=_0x3a8921[_0x5d156e(0x175)]?_0x1a0b98[_0x5d156e(0x12e)](_0x3a8921[_0x5d156e(0x175)][_0x5d156e(0x11e)]())||'':'',_0x34b697=_0x1f9f86?_0x1f9f86+'/'+_0x3a8921[_0x5d156e(0x198)]:_0x3a8921[_0x5d156e(0x198)],_0x221c3c=_0x5eaf72[_0x5d156e(0x12e)](_0x3a8921['id'])||[],_0x5d0450=_0x221c3c[_0x5d156e(0x158)]>0x0?a39_0x5280e9[_0x5d156e(0x19c)]('\x20['+_0x221c3c[_0x5d156e(0x158)]+_0x5d156e(0x170)):'';console[_0x5d156e(0x15a)]('\x0a'+a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x147))+'\x20'+_0x34b697+_0x5d0450),console['error']('─'[_0x5d156e(0x190)](0x3c));const _0xcbeb90=segmentWithActivationsToYaml(_0x3a8921,_0x221c3c,undefined,_0x2d5b01,_0xfaaeb4),_0x31bb37=segmentToYamlString(_0xcbeb90),_0x30b405=generateDiff(_0x31bb37,'');console[_0x5d156e(0x15a)](formatDiffWithColors(_0x30b405)),console['error']('─'[_0x5d156e(0x190)](0x3c));}const _0x321ad4=_0x5d31fe[_0x5d156e(0x18a)](_0x74cd59=>!_0x74cd59[_0x5d156e(0x16f)]&&_0x74cd59['diff']);if(_0x321ad4['length']>0x0&&!_0x2fe048[_0x5d156e(0x154)])for(const _0x390dc9 of _0x321ad4){const _0x26387b=_0x390dc9[_0x5d156e(0x11d)]?_0x390dc9[_0x5d156e(0x11d)]+'/'+_0x390dc9[_0x5d156e(0x171)][_0x5d156e(0x198)]:_0x390dc9[_0x5d156e(0x171)][_0x5d156e(0x198)];console[_0x5d156e(0x15a)]('\x0a'+a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x10f))+'\x20'+_0x26387b),console[_0x5d156e(0x15a)]('─'['repeat'](0x3c)),console['error'](_0x390dc9[_0x5d156e(0x10e)]),console['error']('─'['repeat'](0x3c));}if(_0x1233ec['length']>0x0)for(const _0x259b18 of _0x1233ec){const _0x22feb1=_0x259b18[_0x5d156e(0x11d)]?_0x259b18[_0x5d156e(0x11d)]+'/'+_0x259b18[_0x5d156e(0x171)][_0x5d156e(0x198)]:_0x259b18[_0x5d156e(0x171)][_0x5d156e(0x198)];console['error']('\x0a'+a39_0x5280e9[_0x5d156e(0x13b)](_0x5d156e(0x18e))+'\x20'+_0x22feb1),console[_0x5d156e(0x15a)]('─'[_0x5d156e(0x190)](0x3c)),_0x259b18[_0x5d156e(0x10e)]&&console[_0x5d156e(0x15a)](_0x259b18[_0x5d156e(0x10e)]),console[_0x5d156e(0x15a)]('─'[_0x5d156e(0x190)](0x3c));}const _0x3881e2=_0x3028f6[_0x5d156e(0x18a)](_0x3b7467=>!_0x3b7467[_0x5d156e(0x16f)]&&_0x3b7467[_0x5d156e(0x10e)]);if(_0x3881e2['length']>0x0)for(const _0x38a814 of _0x3881e2){const _0x42d2f0=_0x38a814[_0x5d156e(0x11d)]?_0x38a814[_0x5d156e(0x11d)]+'/'+_0x38a814[_0x5d156e(0x171)][_0x5d156e(0x198)]:_0x38a814[_0x5d156e(0x171)][_0x5d156e(0x198)];console['error']('\x0a'+a39_0x5280e9['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x42d2f0),console[_0x5d156e(0x15a)]('─'[_0x5d156e(0x190)](0x3c)),console[_0x5d156e(0x15a)](_0x38a814['diff']),console[_0x5d156e(0x15a)]('─'['repeat'](0x3c));}if(_0x83132a[_0x5d156e(0x158)]>0x0)for(const _0x4090a0 of _0x83132a){const _0x41f8eb=_0x4090a0[_0x5d156e(0x11f)]?_0x1a0b98['get'](_0x4090a0['folderId'])||'':'',_0xc29d85=_0x41f8eb?_0x41f8eb+'/'+_0x4090a0[_0x5d156e(0x128)]:_0x4090a0[_0x5d156e(0x128)];console[_0x5d156e(0x15a)]('\x0a'+a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x194))+'\x20'+_0xc29d85),console[_0x5d156e(0x15a)]('─'['repeat'](0x3c)),console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x188))),console[_0x5d156e(0x15a)]('─'[_0x5d156e(0x190)](0x3c));}if(_0x2fe048[_0x5d156e(0x14d)])return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x141))),0x0;const _0x41cd55=_0x2fe048[_0x5d156e(0x154)]?![]:_0x4b4d9f[_0x5d156e(0x158)]>0x0||_0x2cde77[_0x5d156e(0x158)]>0x0||_0x3694f8['length']>0x0,_0xbaa789=_0x1233ec[_0x5d156e(0x158)]>0x0||_0x2544a9[_0x5d156e(0x158)]>0x0||_0x83132a['length']>0x0,_0x245cef=_0x2fe048['journeysOnly']?![]:_0x33eda6['length']>0x0,_0x3309f5=_0x12b7c0['length']>0x0;if(!_0x41cd55&&!_0xbaa789&&!_0x245cef&&!_0x3309f5){const _0x3d5a2a=_0x2fe048[_0x5d156e(0x154)]?_0x5d156e(0x14e):_0x5d156e(0x137);console['error'](a39_0x5280e9[_0x5d156e(0x13b)](_0x3d5a2a));if(_0x3c5a11&&_0x433333[_0x5d156e(0x158)]===0x1){const _0x5e4d30=_0x433333[0x0];if(_0x5e4d30['existingSegment']?.['id']){const _0x40da9e=getConsoleNextUrl(_0x2fe048['site'],_0x5d156e(0x185)+_0x5f343e+_0x5d156e(0x117)+_0x5e4d30[_0x5d156e(0x176)]['id']+_0x5d156e(0x151));console[_0x5d156e(0x15a)](_0x5d156e(0x115)+a39_0x5280e9[_0x5d156e(0x132)](_0x40da9e));}}if(_0x3c5a11&&_0x684ebb['length']===0x1){const _0x4e03ac=_0x684ebb[0x0];if(_0x4e03ac[_0x5d156e(0x123)]?.['id']){const _0x46162e=getConsoleNextUrl(_0x2fe048[_0x5d156e(0x127)],_0x5d156e(0x185)+_0x5f343e+_0x5d156e(0x117)+_0x4e03ac['existingJourney']['id']+'/j/da/je');console[_0x5d156e(0x15a)]('\x20\x20'+a39_0x5280e9[_0x5d156e(0x132)](_0x46162e));}}return 0x0;}const _0x45cc49=_0x2fe048[_0x5d156e(0x154)]?_0x1233ec[_0x5d156e(0x158)]+_0x2544a9[_0x5d156e(0x158)]+_0x83132a[_0x5d156e(0x158)]+_0x12b7c0['length']:_0x4b4d9f[_0x5d156e(0x158)]+_0x2cde77[_0x5d156e(0x158)]+_0x3694f8['length']+_0x1233ec[_0x5d156e(0x158)]+_0x2544a9[_0x5d156e(0x158)]+_0x83132a['length']+_0x12b7c0[_0x5d156e(0x158)]+_0x33eda6[_0x5d156e(0x158)];if(!_0x2fe048[_0x5d156e(0x121)]&&_0x45cc49>0x0){if(!isInteractive())return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x159)](_0x5d156e(0x16b)),_0x5d156e(0x178)),console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x19c)](_0x5d156e(0x125))),0x1;const _0x355297=await confirmKey(_0x5d156e(0x168)+_0x45cc49+_0x5d156e(0x18b));if(!_0x355297)return console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x166))),0x1;}const _0x5527ee={'withProgress':async(_0x5c0061,_0x3c4f52)=>{const _0x56fa3f=_0x5d156e,_0x30e4a4=await withSpinner(_0x5c0061,_0x3c4f52,{'verbose':_0x2fe048[_0x56fa3f(0x130)]});return{'data':_0x30e4a4[_0x56fa3f(0x17f)]};},'logInfo':_0x40e373=>console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x19d)]('βœ”\x20'+_0x40e373)),'logSuccess':_0x5758e4=>console['error'](a39_0x5280e9[_0x5d156e(0x13b)]('βœ”\x20'+_0x5758e4)),'logWarning':_0x458e8c=>console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x105)]('⚠\x20'+_0x458e8c)),'logDeleted':_0x3048a8=>console[_0x5d156e(0x15a)](a39_0x5280e9['red']('βœ”\x20'+_0x3048a8))},_0x19bff2={'segment':_0x183f03['segment'],'journey':_0x183f03['journey'],'user':_0x183f03['user'],'connection':_0x183f03[_0x5d156e(0x126)]};_0x12b7c0[_0x5d156e(0x158)]>0x0&&(_0x2c65e7=await executePushFolders(_0x19bff2,_0x12b7c0,_0x2c65e7,{'parentId':_0x5f343e},_0x5527ee));const _0x3f5268={'rootFolderId':_0x315045,'folderPathToId':_0x2c65e7,'folderIdToPath':_0x1a0b98,'segmentNameToId':_0x46ca0f,'activationsBySegmentId':_0x5eaf72,'emailToIdMap':_0x49ac12,'idToEmailMap':_0x2d5b01,'connectionNameToIdMap':_0x1ca6bc[_0x5d156e(0x109)],'connectionIdToNameMap':_0x1ca6bc[_0x5d156e(0x189)],'connectionNameToTypeMap':_0x3b243d},_0x59e9a3=await executePushSegments(_0x19bff2,_0x2fe048[_0x5d156e(0x154)]?[]:_0x5d31fe,_0x3f5268,{'parentId':_0x5f343e},_0x5527ee),_0x2fd3ff=_0x59e9a3[_0x5d156e(0x17e)],_0x337e9f=_0x59e9a3[_0x5d156e(0x133)],_0x4ece8a=_0x59e9a3[_0x5d156e(0x16c)][_0x5d156e(0x17e)],_0x1e61ed=_0x59e9a3[_0x5d156e(0x16c)][_0x5d156e(0x133)],_0x5a33c2=_0x59e9a3[_0x5d156e(0x16c)][_0x5d156e(0x19e)];let _0x546f85;if(_0x3c5a11&&_0x5d31fe[_0x5d156e(0x158)]===0x1){const _0x5939a0=_0x5d31fe[0x0];_0x546f85=_0x5939a0[_0x5d156e(0x176)]?.['id']??_0x59e9a3[_0x5d156e(0x16a)][_0x5d156e(0x12e)](_0x5939a0[_0x5d156e(0x171)][_0x5d156e(0x198)]);}const _0x5f2720=await executePushSegmentDeletions(_0x19bff2,_0x2fe048['journeysOnly']?[]:_0x3694f8,_0x5527ee);let _0x162b5a=0x0,_0x372ee1=0x0,_0x146f77=0x0;const _0x187870=new Map(_0x46ca0f);for(const [_0x53e3b4,_0x5cac8c]of _0x59e9a3['createdSegmentIds']){_0x187870['set'](_0x53e3b4,_0x5cac8c);}if(_0x3028f6[_0x5d156e(0x158)]>0x0){const _0x277804={..._0x3f5268,'segmentNameToId':_0x187870,'existingSegments':_0x24d029,'activationContext':_0x427afa},_0x22a481=await executePushJourneys(_0x19bff2,_0x3028f6,_0x277804,{'parentId':_0x5f343e,'rootFolderId':_0x315045,'verbose':_0x2fe048['verbose']},_0x5527ee);_0x162b5a=_0x22a481[_0x5d156e(0x17e)],_0x372ee1=_0x22a481[_0x5d156e(0x133)];if(_0x3c5a11&&_0x22a481[_0x5d156e(0x148)][_0x5d156e(0x158)]===0x1){const _0x56700d=_0x22a481['results'][0x0];if(_0x56700d['journeyId']){const _0x6fcf51=getConsoleNextUrl(_0x2fe048['site'],_0x5d156e(0x185)+_0x5f343e+_0x5d156e(0x117)+_0x56700d['journeyId']+_0x5d156e(0x122));console[_0x5d156e(0x15a)]('\x20\x20'+a39_0x5280e9[_0x5d156e(0x132)](_0x6fcf51));}}}for(const _0x3c69db of _0x83132a){console['error'](a39_0x5280e9[_0x5d156e(0x105)](_0x5d156e(0x119)+_0x3c69db[_0x5d156e(0x128)])),_0x146f77++;}const _0x4ccb41=[];if(_0x2fd3ff>0x0)_0x4ccb41[_0x5d156e(0x165)](_0x2fd3ff+'\x20created');if(_0x337e9f>0x0)_0x4ccb41['push'](_0x337e9f+_0x5d156e(0x104));if(_0x5f2720>0x0)_0x4ccb41[_0x5d156e(0x165)](_0x5f2720+_0x5d156e(0x15c));const _0x4b71cd=[];if(_0x162b5a>0x0)_0x4b71cd[_0x5d156e(0x165)](_0x162b5a+_0x5d156e(0x143));if(_0x372ee1>0x0)_0x4b71cd['push'](_0x372ee1+_0x5d156e(0x104));if(_0x146f77>0x0)_0x4b71cd[_0x5d156e(0x165)](_0x146f77+'\x20deleted');const _0x63474d=[];if(_0x4ece8a>0x0)_0x63474d[_0x5d156e(0x165)](_0x4ece8a+'\x20created');if(_0x1e61ed>0x0)_0x63474d[_0x5d156e(0x165)](_0x1e61ed+_0x5d156e(0x104));if(_0x5a33c2>0x0)_0x63474d[_0x5d156e(0x165)](_0x5a33c2+_0x5d156e(0x15c));console[_0x5d156e(0x15a)](a39_0x5280e9[_0x5d156e(0x13b)](_0x5d156e(0x191)));_0x4ccb41['length']>0x0&&!_0x2fe048['journeysOnly']&&console[_0x5d156e(0x15a)](_0x5d156e(0x14b)+_0x4ccb41['join'](',\x20'));_0x4b71cd[_0x5d156e(0x158)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x4b71cd[_0x5d156e(0x162)](',\x20'));_0x63474d['length']>0x0&&!_0x2fe048[_0x5d156e(0x154)]&&console[_0x5d156e(0x15a)]('\x20\x20Activations:\x20'+_0x63474d[_0x5d156e(0x162)](',\x20'));if(_0x546f85){const _0x326784=getConsoleNextUrl(_0x2fe048[_0x5d156e(0x127)],_0x5d156e(0x185)+_0x5f343e+_0x5d156e(0x117)+_0x546f85+'/sb/da/esr');console['error']('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a39_0x5280e9['cyan'](_0x326784));}return 0x0;}}
1
+ const a39_0x9e44e=a39_0x35fb;(function(_0x8b56cd,_0x17272e){const _0x19f2e6=a39_0x35fb,_0x935b15=_0x8b56cd();while(!![]){try{const _0x314f9a=parseInt(_0x19f2e6(0xdb))/0x1*(parseInt(_0x19f2e6(0x156))/0x2)+-parseInt(_0x19f2e6(0x145))/0x3+-parseInt(_0x19f2e6(0x110))/0x4*(-parseInt(_0x19f2e6(0xd9))/0x5)+parseInt(_0x19f2e6(0x14e))/0x6+parseInt(_0x19f2e6(0x15b))/0x7*(-parseInt(_0x19f2e6(0x149))/0x8)+-parseInt(_0x19f2e6(0x163))/0x9*(-parseInt(_0x19f2e6(0xe2))/0xa)+parseInt(_0x19f2e6(0xce))/0xb*(-parseInt(_0x19f2e6(0xdc))/0xc);if(_0x314f9a===_0x17272e)break;else _0x935b15['push'](_0x935b15['shift']());}catch(_0x454668){_0x935b15['push'](_0x935b15['shift']());}}}(a39_0x3f42,0xb62a7));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a39_0x9de32f 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';function a39_0x35fb(_0x77ba36,_0x2d3784){_0x77ba36=_0x77ba36-0xcc;const _0x3f42d2=a39_0x3f42();let _0x35fb5c=_0x3f42d2[_0x77ba36];return _0x35fb5c;}function a39_0x3f42(){const _0x2f8bf7=['Folders\x20to\x20create:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','(Journey\x20will\x20be\x20deleted)','audienceId','existingJourney','description','\x20updated','site','\x20\x20Activations:','cwd','get','set','length','deleted','toCreate','createdSegmentIds','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x27...','listJourneysWithDetailsFromParentSegment','/e/','.yaml','type','No\x20','setPhase','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0aPush\x20summary\x20for\x20\x27','/j/da/je','Error:\x20Directory\x20not\x20found:\x20','execute','folders','cyan','yellow','listSegments','3325722gdqGkZ','\x20activations]','push','folderPath','80vNrKoi','targetDir','relationships','diff','journeyId','4491918kWGSij','blue','New\x20journey:','πŸ“\x20','Delete\x20segment:','toString','yes','\x20new','8UUuzXU','no_parent','filter','\x20\x20Segments:\x20','journeysOnly','59507cdZPNp','activations','join','delete','parentName','yamlConfig','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Push\x20','28989Utakvz','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','getParent','Fetching\x20existing\x20activations...','attributes','parent_name','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','updated','6490319PgqfWy','journeys','green','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20\x20\x20','\x20\x20Journeys:\x20','Aborted.','repeat','nameToType','\x20created','helpText','25985BXDHXP','getOutputSchemaWithCache','315641eQHTOn','48egAXrN','\x20YAML\x20files\x20found','\x20deleted','created','\x0aError:','getJourney','3830oMbpiT','unchanged','toDelete','then','listActivations','all','list','isScoped','\x20to\x20create','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','toUpdate','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','resolveParentId','verbose','red','Error:\x20','buildUserMaps','results','message','\x20\x20Source:\x20','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)','idToName','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','state','.yml','segments','paused','dim','data','New\x20segment:','segment','\x20changes?','\x20to\x20delete','Delete\x20journey:','Source\x20directory:\x20','segmentFolderId','isNew','new','Changes\x20to:','endsWith','map','folderId','Resolving\x20parent\x20segment\x20\x27','changed','journeyBundleName','Changes\x20to\x20journey:','812ynYvrZ','errorCode','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20update','existingSegment','connection','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','name','parentSegment','user','journey','\x20folders\x20to\x20create','error','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x0aβœ”\x20Push\x20complete','nameToId','\x0aValidation\x20failed:','/sb/da/esr','/app/ps/','Fetching\x20connections\x20for\x20name\x20resolution...'];a39_0x3f42=function(){return _0x2f8bf7;};return a39_0x3f42();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']='segment:push';[a39_0x9e44e(0x129)]=a39_0x9e44e(0x11d);async[a39_0x9e44e(0x140)](_0x440a44){const _0x5b9c5a=a39_0x9e44e,{options:_0x33aa03,args:_0x5198d3,tdx:_0x533d33}=_0x440a44,_0x25ee62=_0x33aa03,_0x382e85=await resolveTarget({'arg':_0x5198d3[0x0],'contextParent':_0x33aa03[_0x5b9c5a(0x118)],'cwd':process[_0x5b9c5a(0x12d)]()});if(!isSuccessfulResolution(_0x382e85))return _0x382e85[_0x5b9c5a(0x111)]===_0x5b9c5a(0x157)?(console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x143)](_0x5b9c5a(0x134))),console['error'](_0x5b9c5a(0xf6)),console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xeb)),console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xed))):(console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0xf1)+_0x382e85[_0x5b9c5a(0xf4)]+'\x0a')),_0x382e85[_0x5b9c5a(0xd8)]&&console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x142)](_0x382e85[_0x5b9c5a(0xd8)]))),0x1;if(_0x382e85[_0x5b9c5a(0x139)]===_0x5b9c5a(0x168))return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)]('Error:\x20Directory\x20not\x20found:\x20'+_0x382e85[_0x5b9c5a(0x14a)]+'\x0a')),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x142)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x5b56b0=_0x382e85[_0x5b9c5a(0x15f)],_0xab3cf3=_0x382e85[_0x5b9c5a(0x14a)],_0x4e0691=_0x382e85[_0x5b9c5a(0x139)]==='file'?_0x382e85['filePath']:undefined,_0x38247b=getScopedDetails(_0x382e85),_0x4daa84=_0x38247b?.[_0x5b9c5a(0xe9)]??![],_0x3932ab=_0x38247b?.['scopedFolderPath']??'';if(!existsSync(_0xab3cf3))return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x13f)+_0xab3cf3+'\x0a')),console['error'](a39_0x9de32f[_0x5b9c5a(0x142)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x25ee62[_0x5b9c5a(0xef)]&&(console[_0x5b9c5a(0x11c)]('Site:\x20'+_0x25ee62[_0x5b9c5a(0x12b)]),console[_0x5b9c5a(0x11c)]('Parent\x20segment:\x20'+_0x5b56b0),console['error'](_0x5b9c5a(0x104)+_0xab3cf3),_0x4daa84&&console['error']('Scoped\x20to\x20folder:\x20'+_0x3932ab));const _0x533265=await withSpinner(_0x5b9c5a(0x10c)+_0x5b56b0+_0x5b9c5a(0x135),()=>_0x533d33[_0x5b9c5a(0x100)][_0x5b9c5a(0xee)](_0x5b56b0),{'verbose':_0x25ee62[_0x5b9c5a(0xef)]}),_0x11510e=_0x533265[_0x5b9c5a(0xfe)],{parentSegmentResult:_0x475837,segmentsResult:_0x3730c1,foldersResult:_0x4366e6,journeysWithDetailsResult:_0x14b36c,userMaps:_0x5bde7f}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x5c8511=_0x5b9c5a,[_0x290d31,_0x10cae3,_0x33f783,_0x36dca1,_0x420e3a]=await Promise[_0x5c8511(0xe7)]([_0x533d33[_0x5c8511(0x100)][_0x5c8511(0x165)](_0x11510e),_0x533d33['segment'][_0x5c8511(0x144)](_0x11510e),_0x533d33[_0x5c8511(0x100)]['listFolders'](_0x11510e),_0x533d33['journey'][_0x5c8511(0x136)](_0x11510e,{'includeAllVersions':!![]}),_0x533d33['user'][_0x5c8511(0xf2)]()]);return{'parentSegmentResult':_0x290d31,'segmentsResult':_0x10cae3,'foldersResult':_0x33f783,'journeysWithDetailsResult':_0x36dca1,'userMaps':_0x420e3a};},{'verbose':_0x25ee62[_0x5b9c5a(0xef)]})[_0x5b9c5a(0xe5)](_0x3057c2=>_0x3057c2[_0x5b9c5a(0xfe)]),_0x1eaf01=_0x475837,_0x17d963=extractRootFolderId(_0x1eaf01),_0x15a5ad=_0x3730c1,_0x2851aa=_0x4366e6,{journeys:_0x2163a7,activationStepsById:_0x4a3e5b}=_0x14b36c,_0x315e93=new Map(_0x2163a7[_0x5b9c5a(0x10a)](_0x4edcd2=>[_0x4edcd2['id'],_0x4edcd2])),_0x2ebd01=_0x2163a7[_0x5b9c5a(0x10a)](_0x3c9919=>({'id':_0x3c9919['id'],'name':_0x3c9919[_0x5b9c5a(0x167)][_0x5b9c5a(0x117)],'journeyBundleName':_0x3c9919['attributes']['journeyBundleName']||'','journeyBundleId':_0x3c9919['attributes']['journeyBundleId']||'','versionNumber':_0x3c9919[_0x5b9c5a(0x167)]['versionNumber'],'description':_0x3c9919['attributes']['description'],'state':_0x3c9919['attributes'][_0x5b9c5a(0xf9)],'paused':_0x3c9919[_0x5b9c5a(0x167)][_0x5b9c5a(0xfc)],'audienceId':_0x3c9919[_0x5b9c5a(0x167)][_0x5b9c5a(0x127)],'folderId':_0x3c9919[_0x5b9c5a(0x14b)]?.['parentFolder']?.[_0x5b9c5a(0xfe)]?.['id'],'createdAt':_0x3c9919[_0x5b9c5a(0x167)]['createdAt'],'updatedAt':_0x3c9919[_0x5b9c5a(0x167)]['updatedAt']})),{emailToId:_0x1bb06f,idToEmail:_0x2310eb}=_0x5bde7f,_0x47f0d5=await withSpinner(_0x5b9c5a(0x123),async()=>{const _0x48a4f2=_0x5b9c5a,_0x4601ce=await _0x533d33[_0x48a4f2(0x115)][_0x48a4f2(0xe8)]();return buildConnectionMaps(_0x4601ce);},{'verbose':_0x25ee62[_0x5b9c5a(0xef)]})['then'](_0x51c676=>_0x51c676[_0x5b9c5a(0xfe)]),_0x2d72ff=_0x47f0d5[_0x5b9c5a(0x11f)],_0x4a7259=_0x47f0d5[_0x5b9c5a(0xf7)],_0x4ac5fe=_0x47f0d5[_0x5b9c5a(0xd6)],_0x1d22e5={'emailToIdMap':_0x1bb06f,'connectionNameToIdMap':_0x2d72ff,'connectionNameToTypeMap':_0x4ac5fe,'getSchema':_0x2db887=>_0x533d33[_0x5b9c5a(0x115)][_0x5b9c5a(0xda)](_0x2db887)};let {pathToId:_0x2432f4,idToPath:_0xe202e5}=buildFolderMaps(_0x2851aa);const _0x21267f=buildSegmentLookupMap(_0x15a5ad,_0xe202e5),_0x1cb9e4=buildSegmentNameToIdMap(_0x15a5ad),_0x22622d=buildJourneyBundleLookupMap(_0x2ebd01,_0xe202e5);let _0x43a3d0;if(_0x4e0691){if(!_0x4e0691[_0x5b9c5a(0x109)](_0x5b9c5a(0xfa))&&!_0x4e0691[_0x5b9c5a(0x109)](_0x5b9c5a(0x138)))return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0xcc)+_0x4e0691+'\x0a')),0x1;_0x43a3d0=[_0x4e0691];}else _0x43a3d0=findYamlFiles(_0xab3cf3);if(_0x43a3d0[_0x5b9c5a(0x130)]===0x0)return console['error'](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x161)+_0xab3cf3+'\x0a')),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x142)](_0x5b9c5a(0x13c))),0x1;let _0x17e17c,_0x594514;try{const _0x288b02=parseAndClassifyYamlFiles(_0x43a3d0,_0xab3cf3,{'skipSegments':_0x25ee62[_0x5b9c5a(0x15a)]});_0x17e17c=_0x288b02[_0x5b9c5a(0xfb)],_0x594514=_0x288b02['journeys'];const _0x501c59=validateParsedFiles(_0x288b02,_0xab3cf3);if(_0x501c59['length']>0x0)return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x120))),console[_0x5b9c5a(0x11c)](formatValidationErrors(_0x501c59)),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x143)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x3fae91){return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)]('Error\x20parsing\x20YAML:\x20'+(_0x3fae91 instanceof Error?_0x3fae91[_0x5b9c5a(0xf4)]:_0x3fae91))),0x1;}if(_0x17e17c['length']===0x0&&_0x594514[_0x5b9c5a(0x130)]===0x0){const _0x3c6b6c=_0x25ee62['journeysOnly']?'journey':'segment\x20or\x20journey';return console[_0x5b9c5a(0x11c)](a39_0x9de32f['yellow'](_0x5b9c5a(0x13a)+_0x3c6b6c+_0x5b9c5a(0xdd))),0x0;}const _0x34be3e=new Map();_0x15a5ad['length']>0x0&&!_0x25ee62[_0x5b9c5a(0x15a)]&&await withSpinner(_0x5b9c5a(0x166),async()=>{await batchAsync(_0x15a5ad,async _0x518dbf=>{const _0x19546f=a39_0x35fb,_0x25bd8f=await _0x533d33[_0x19546f(0x100)][_0x19546f(0xe6)](_0x11510e,_0x518dbf['id']);_0x34be3e[_0x19546f(0x12f)](_0x518dbf['id'],_0x25bd8f);});},{'verbose':_0x25ee62[_0x5b9c5a(0xef)]});const {segmentFiles:_0x1a0088,foldersToCreate:_0x205a82}=await prepareSegmentFiles(_0x17e17c,{'segmentByFolderAndName':_0x21267f,'activationsBySegmentId':_0x34be3e,'folderPathToId':_0x2432f4,'idToEmailMap':_0x2310eb,'connectionIdToNameMap':_0x4a7259},_0x1d22e5,_0x4daa84,_0x3932ab),_0x1af837=_0x4e0691?[]:findSegmentsToDelete(_0x15a5ad,_0x17e17c[_0x5b9c5a(0x10a)](({yamlConfig:_0x1c0c90,folderPath:_0x1a423d})=>({'yamlConfig':_0x1c0c90,'folderPath':resolveTDFolderPath(_0x1a423d,_0x4daa84,_0x3932ab)})),_0xe202e5,_0x3932ab,_0x4daa84),{journeyFiles:_0xf70371,foldersToCreate:_0x2efbd5}=await withProgressSpinner('Preparing\x20journeys...',async _0x59b176=>prepareJourneyFiles(_0x594514,{'fetchJourney':async _0x38328e=>_0x533d33['journey'][_0x5b9c5a(0xe1)](_0x38328e[_0x5b9c5a(0x14d)]),'journeyBundlesByFolderAndName':_0x22622d,'folderPathToId':_0x2432f4,'idToEmailMap':_0x2310eb,'connectionIdToNameMap':_0x4a7259,'existingSegments':_0x15a5ad,'parentId':_0x11510e,'deps':_0x533d33,'progress':{'update':_0x164958=>{const _0x395a45=_0x5b9c5a;_0x59b176[_0x395a45(0x13b)](_0x164958),_0x25ee62[_0x395a45(0xef)]&&console[_0x395a45(0x11c)]('\x20\x20'+_0x164958);}},'journeyById':_0x315e93,'activationStepsById':_0x4a3e5b},_0x4daa84,_0x3932ab),{'verbose':_0x25ee62[_0x5b9c5a(0xef)]})['then'](_0x591579=>_0x591579[_0x5b9c5a(0xfe)]);for(const _0x2647c2 of _0x2efbd5){_0x205a82['add'](_0x2647c2);}const _0x475cc3=_0x4e0691?[]:findJourneysToDelete(_0x2ebd01,_0x594514[_0x5b9c5a(0x10a)](({yamlConfig:_0x56ae0a,folderPath:_0x4b0698})=>({'yamlConfig':_0x56ae0a,'folderPath':resolveTDFolderPath(_0x4b0698,_0x4daa84,_0x3932ab)})),_0xe202e5,_0x3932ab,_0x4daa84),_0x47ad=calculatePushStats(_0x1a0088,_0xf70371,_0x205a82,_0x1af837,_0x475cc3,!!_0x25ee62['delete'],!!_0x25ee62[_0x5b9c5a(0x15a)]),_0x25c8e4=_0x47ad['segments'][_0x5b9c5a(0x107)],_0x5c6977=_0x47ad[_0x5b9c5a(0xfb)][_0x5b9c5a(0x10d)],_0x3a3546=_0x47ad['segments'][_0x5b9c5a(0xe3)],_0x54bb45=_0x47ad[_0x5b9c5a(0xfb)][_0x5b9c5a(0xe4)],_0x21ec91=_0x47ad[_0x5b9c5a(0x141)][_0x5b9c5a(0x132)],_0x1807e2=_0x47ad[_0x5b9c5a(0xcf)][_0x5b9c5a(0x107)],_0x473166=_0x47ad['journeys'][_0x5b9c5a(0x10d)],_0x3ef219=_0x47ad[_0x5b9c5a(0xcf)][_0x5b9c5a(0xe3)],_0x4dc82b=_0x47ad['journeys'][_0x5b9c5a(0xe4)],_0x2ee27f=_0x47ad['activations'][_0x5b9c5a(0xe7)],_0x4ced41=_0x47ad[_0x5b9c5a(0x15c)][_0x5b9c5a(0x132)],_0x433478=_0x47ad[_0x5b9c5a(0x15c)][_0x5b9c5a(0xec)],_0x5b8913=_0x47ad[_0x5b9c5a(0x15c)][_0x5b9c5a(0xe4)];console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x13d)+_0x5b56b0+'\x27:');_0x21ec91[_0x5b9c5a(0x130)]>0x0&&console[_0x5b9c5a(0x11c)]('\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x14f)](_0x5b9c5a(0x151)+_0x21ec91[_0x5b9c5a(0x130)]+_0x5b9c5a(0x11b)));if(!_0x25ee62['journeysOnly']){console[_0x5b9c5a(0x11c)]('\x20\x20πŸ“Š\x20Segments:'),console[_0x5b9c5a(0x11c)]('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0xd0)]('+\x20'+_0x25c8e4[_0x5b9c5a(0x130)]+_0x5b9c5a(0x155))),console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0x143)]('~\x20'+_0x5c6977[_0x5b9c5a(0x130)]+'\x20changed'));if(_0x54bb45['length']>0x0)console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xd2)+a39_0x9de32f['red']('-\x20'+_0x54bb45[_0x5b9c5a(0x130)]+'\x20to\x20delete'));else _0x1af837[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62[_0x5b9c5a(0x15e)]&&console['error']('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0xfd)](_0x1af837[_0x5b9c5a(0x130)]+_0x5b9c5a(0xd1)));console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f['dim']('=\x20'+_0x3a3546[_0x5b9c5a(0x130)]+'\x20unchanged'));}if(_0xf70371[_0x5b9c5a(0x130)]>0x0||_0x475cc3['length']>0x0){console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x164)),console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0xd0)]('+\x20'+_0x1807e2[_0x5b9c5a(0x130)]+_0x5b9c5a(0x155))),console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0x143)]('~\x20'+_0x473166[_0x5b9c5a(0x130)]+'\x20changed'));if(_0x4dc82b[_0x5b9c5a(0x130)]>0x0)console[_0x5b9c5a(0x11c)]('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0xf0)]('-\x20'+_0x4dc82b[_0x5b9c5a(0x130)]+_0x5b9c5a(0x102)));else _0x475cc3[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62[_0x5b9c5a(0x15e)]&&console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0xfd)](_0x475cc3[_0x5b9c5a(0x130)]+_0x5b9c5a(0xd1)));console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xd2)+a39_0x9de32f['dim']('=\x20'+_0x3ef219[_0x5b9c5a(0x130)]+'\x20unchanged'));}_0x2ee27f[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62['journeysOnly']&&(console[_0x5b9c5a(0x11c)](''),console['error'](_0x5b9c5a(0x12c)),_0x4ced41[_0x5b9c5a(0x130)]>0x0&&console['error']('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0xd0)]('+\x20'+_0x4ced41[_0x5b9c5a(0x130)]+_0x5b9c5a(0xea))),_0x433478['length']>0x0&&console[_0x5b9c5a(0x11c)]('\x20\x20\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x143)]('~\x20'+_0x433478[_0x5b9c5a(0x130)]+_0x5b9c5a(0x113))),_0x5b8913['length']>0x0&&console['error'](_0x5b9c5a(0xd2)+a39_0x9de32f[_0x5b9c5a(0xf0)]('-\x20'+_0x5b8913['length']+_0x5b9c5a(0x102))));console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xf5)+a39_0x9de32f['cyan'](_0xab3cf3)+'\x0a');if(_0x21ec91[_0x5b9c5a(0x130)]>0x0){console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x124));for(const _0x3ac643 of _0x21ec91){console['error']('\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x14f)]('+')+'\x20'+_0x3ac643);}console[_0x5b9c5a(0x11c)]('');}if(_0x25c8e4[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62[_0x5b9c5a(0x15a)])for(const _0x42fbc3 of _0x25c8e4){const _0xa3ed44=_0x42fbc3[_0x5b9c5a(0x148)]?_0x42fbc3['folderPath']+'/'+_0x42fbc3[_0x5b9c5a(0x160)][_0x5b9c5a(0x117)]:_0x42fbc3[_0x5b9c5a(0x160)]['name'],_0x4b9668=_0x42fbc3[_0x5b9c5a(0x160)][_0x5b9c5a(0x15c)]?.[_0x5b9c5a(0x130)]||0x0,_0x4499f3=_0x4b9668>0x0?a39_0x9de32f[_0x5b9c5a(0xfd)]('\x20['+_0x4b9668+_0x5b9c5a(0x146)):'';console[_0x5b9c5a(0x11c)]('\x0a'+a39_0x9de32f[_0x5b9c5a(0xd0)](_0x5b9c5a(0xff))+'\x20'+_0xa3ed44+_0x4499f3),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c)),_0x42fbc3[_0x5b9c5a(0x14c)]&&console['error'](_0x42fbc3[_0x5b9c5a(0x14c)]),console[_0x5b9c5a(0x11c)]('─'['repeat'](0x3c));}if(_0x54bb45['length']>0x0&&!_0x25ee62[_0x5b9c5a(0x15a)])for(const _0x35dbda of _0x54bb45){const _0x55f5f8=_0x35dbda[_0x5b9c5a(0x105)]?_0xe202e5[_0x5b9c5a(0x12e)](_0x35dbda[_0x5b9c5a(0x105)][_0x5b9c5a(0x153)]())||'':'',_0x3f4f6a=_0x55f5f8?_0x55f5f8+'/'+_0x35dbda[_0x5b9c5a(0x117)]:_0x35dbda[_0x5b9c5a(0x117)],_0x28c4a1=_0x34be3e[_0x5b9c5a(0x12e)](_0x35dbda['id'])||[],_0x13fdb6=_0x28c4a1[_0x5b9c5a(0x130)]>0x0?a39_0x9de32f[_0x5b9c5a(0xfd)]('\x20['+_0x28c4a1[_0x5b9c5a(0x130)]+_0x5b9c5a(0x146)):'';console['error']('\x0a'+a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x152))+'\x20'+_0x3f4f6a+_0x13fdb6),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c));const _0x360bb8=segmentWithActivationsToYaml(_0x35dbda,_0x28c4a1,undefined,_0x2310eb,_0x4a7259),_0x1dde2f=segmentToYamlString(_0x360bb8),_0x3c4413=generateDiff(_0x1dde2f,'');console[_0x5b9c5a(0x11c)](formatDiffWithColors(_0x3c4413)),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c));}const _0x450f9c=_0x1a0088[_0x5b9c5a(0x158)](_0x5dd367=>!_0x5dd367[_0x5b9c5a(0x106)]&&_0x5dd367[_0x5b9c5a(0x14c)]);if(_0x450f9c['length']>0x0&&!_0x25ee62['journeysOnly'])for(const _0x2d3923 of _0x450f9c){const _0x1015cc=_0x2d3923[_0x5b9c5a(0x148)]?_0x2d3923[_0x5b9c5a(0x148)]+'/'+_0x2d3923[_0x5b9c5a(0x160)][_0x5b9c5a(0x117)]:_0x2d3923['yamlConfig'][_0x5b9c5a(0x117)];console['error']('\x0a'+a39_0x9de32f['yellow'](_0x5b9c5a(0x108))+'\x20'+_0x1015cc),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c)),console[_0x5b9c5a(0x11c)](_0x2d3923[_0x5b9c5a(0x14c)]),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c));}if(_0x1807e2[_0x5b9c5a(0x130)]>0x0)for(const _0x4b3b18 of _0x1807e2){const _0x3c5256=_0x4b3b18['folderPath']?_0x4b3b18[_0x5b9c5a(0x148)]+'/'+_0x4b3b18['yamlConfig'][_0x5b9c5a(0x117)]:_0x4b3b18[_0x5b9c5a(0x160)][_0x5b9c5a(0x117)];console[_0x5b9c5a(0x11c)]('\x0a'+a39_0x9de32f[_0x5b9c5a(0xd0)](_0x5b9c5a(0x150))+'\x20'+_0x3c5256),console['error']('─'['repeat'](0x3c)),_0x4b3b18['diff']&&console[_0x5b9c5a(0x11c)](_0x4b3b18[_0x5b9c5a(0x14c)]),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c));}const _0x55a793=_0xf70371[_0x5b9c5a(0x158)](_0x10f9eb=>!_0x10f9eb[_0x5b9c5a(0x106)]&&_0x10f9eb[_0x5b9c5a(0x14c)]);if(_0x55a793['length']>0x0)for(const _0x372bc9 of _0x55a793){const _0x4fc2e7=_0x372bc9['folderPath']?_0x372bc9[_0x5b9c5a(0x148)]+'/'+_0x372bc9[_0x5b9c5a(0x160)]['name']:_0x372bc9['yamlConfig']['name'];console['error']('\x0a'+a39_0x9de32f[_0x5b9c5a(0x143)](_0x5b9c5a(0x10f))+'\x20'+_0x4fc2e7),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c)),console[_0x5b9c5a(0x11c)](_0x372bc9[_0x5b9c5a(0x14c)]),console[_0x5b9c5a(0x11c)]('─'['repeat'](0x3c));}if(_0x4dc82b[_0x5b9c5a(0x130)]>0x0)for(const _0x1c335e of _0x4dc82b){const _0x3cb888=_0x1c335e[_0x5b9c5a(0x10b)]?_0xe202e5[_0x5b9c5a(0x12e)](_0x1c335e[_0x5b9c5a(0x10b)])||'':'',_0x2a7f32=_0x3cb888?_0x3cb888+'/'+_0x1c335e[_0x5b9c5a(0x10e)]:_0x1c335e[_0x5b9c5a(0x10e)];console[_0x5b9c5a(0x11c)]('\x0a'+a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x103))+'\x20'+_0x2a7f32),console[_0x5b9c5a(0x11c)]('─'[_0x5b9c5a(0xd5)](0x3c)),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0x126))),console['error']('─'[_0x5b9c5a(0xd5)](0x3c));}if(_0x25ee62['dryRun'])return console[_0x5b9c5a(0x11c)](a39_0x9de32f['yellow'](_0x5b9c5a(0xf8))),0x0;const _0x2166ed=_0x25ee62[_0x5b9c5a(0x15a)]?![]:_0x25c8e4[_0x5b9c5a(0x130)]>0x0||_0x5c6977[_0x5b9c5a(0x130)]>0x0||_0x54bb45[_0x5b9c5a(0x130)]>0x0,_0x3a068b=_0x1807e2[_0x5b9c5a(0x130)]>0x0||_0x473166[_0x5b9c5a(0x130)]>0x0||_0x4dc82b['length']>0x0,_0x5e71e7=_0x25ee62['journeysOnly']?![]:_0x2ee27f[_0x5b9c5a(0x130)]>0x0,_0x10f792=_0x21ec91[_0x5b9c5a(0x130)]>0x0;if(!_0x2166ed&&!_0x3a068b&&!_0x5e71e7&&!_0x10f792){const _0x193969=_0x25ee62['journeysOnly']?_0x5b9c5a(0x116):'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xd0)](_0x193969));if(_0x4e0691&&_0x3a3546[_0x5b9c5a(0x130)]===0x1){const _0x1e45e1=_0x3a3546[0x0];if(_0x1e45e1['existingSegment']?.['id']){const _0x37acb0=getConsoleNextUrl(_0x25ee62[_0x5b9c5a(0x12b)],'/app/ps/'+_0x11510e+'/e/'+_0x1e45e1[_0x5b9c5a(0x114)]['id']+_0x5b9c5a(0x121));console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x112)+a39_0x9de32f['cyan'](_0x37acb0));}}if(_0x4e0691&&_0x3ef219[_0x5b9c5a(0x130)]===0x1){const _0x17c742=_0x3ef219[0x0];if(_0x17c742[_0x5b9c5a(0x128)]?.['id']){const _0x42f3ca=getConsoleNextUrl(_0x25ee62[_0x5b9c5a(0x12b)],'/app/ps/'+_0x11510e+_0x5b9c5a(0x137)+_0x17c742['existingJourney']['id']+_0x5b9c5a(0x13e));console['error']('\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x142)](_0x42f3ca));}}return 0x0;}const _0x404379=_0x25ee62['journeysOnly']?_0x1807e2[_0x5b9c5a(0x130)]+_0x473166[_0x5b9c5a(0x130)]+_0x4dc82b[_0x5b9c5a(0x130)]+_0x21ec91['length']:_0x25c8e4[_0x5b9c5a(0x130)]+_0x5c6977['length']+_0x54bb45[_0x5b9c5a(0x130)]+_0x1807e2['length']+_0x473166[_0x5b9c5a(0x130)]+_0x4dc82b[_0x5b9c5a(0x130)]+_0x21ec91[_0x5b9c5a(0x130)]+_0x2ee27f['length'];if(!_0x25ee62[_0x5b9c5a(0x154)]&&_0x404379>0x0){if(!isInteractive())return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)](_0x5b9c5a(0xe0)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xfd)](_0x5b9c5a(0x125))),0x1;const _0x38fe23=await confirmKey(_0x5b9c5a(0x162)+_0x404379+_0x5b9c5a(0x101));if(!_0x38fe23)return console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x143)](_0x5b9c5a(0xd4))),0x1;}const _0x2a1bb0={'withProgress':async(_0x172093,_0x20bbb9)=>{const _0x36a19d=_0x5b9c5a,_0x69a12d=await withSpinner(_0x172093,_0x20bbb9,{'verbose':_0x25ee62['verbose']});return{'data':_0x69a12d[_0x36a19d(0xfe)]};},'logInfo':_0x2550c2=>console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0x14f)]('βœ”\x20'+_0x2550c2)),'logSuccess':_0x8c9dd6=>console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xd0)]('βœ”\x20'+_0x8c9dd6)),'logWarning':_0x437878=>console[_0x5b9c5a(0x11c)](a39_0x9de32f['yellow']('⚠\x20'+_0x437878)),'logDeleted':_0x5f3e47=>console[_0x5b9c5a(0x11c)](a39_0x9de32f[_0x5b9c5a(0xf0)]('βœ”\x20'+_0x5f3e47))},_0x567d85={'segment':_0x533d33['segment'],'journey':_0x533d33[_0x5b9c5a(0x11a)],'user':_0x533d33[_0x5b9c5a(0x119)],'connection':_0x533d33['connection']};_0x21ec91['length']>0x0&&(_0x2432f4=await executePushFolders(_0x567d85,_0x21ec91,_0x2432f4,{'parentId':_0x11510e},_0x2a1bb0));const _0x184cef={'rootFolderId':_0x17d963,'folderPathToId':_0x2432f4,'folderIdToPath':_0xe202e5,'segmentNameToId':_0x1cb9e4,'activationsBySegmentId':_0x34be3e,'emailToIdMap':_0x1bb06f,'idToEmailMap':_0x2310eb,'connectionNameToIdMap':_0x47f0d5[_0x5b9c5a(0x11f)],'connectionIdToNameMap':_0x47f0d5[_0x5b9c5a(0xf7)],'connectionNameToTypeMap':_0x4ac5fe},_0x254cde=await executePushSegments(_0x567d85,_0x25ee62[_0x5b9c5a(0x15a)]?[]:_0x1a0088,_0x184cef,{'parentId':_0x11510e},_0x2a1bb0),_0x370462=_0x254cde['created'],_0x40612a=_0x254cde[_0x5b9c5a(0xcd)],_0x5045f2=_0x254cde[_0x5b9c5a(0x15c)][_0x5b9c5a(0xdf)],_0x28b298=_0x254cde[_0x5b9c5a(0x15c)][_0x5b9c5a(0xcd)],_0x391e98=_0x254cde[_0x5b9c5a(0x15c)][_0x5b9c5a(0x131)];let _0x20e954;if(_0x4e0691&&_0x1a0088[_0x5b9c5a(0x130)]===0x1){const _0x5fa8b6=_0x1a0088[0x0];_0x20e954=_0x5fa8b6[_0x5b9c5a(0x114)]?.['id']??_0x254cde['createdSegmentIds'][_0x5b9c5a(0x12e)](_0x5fa8b6['yamlConfig'][_0x5b9c5a(0x117)]);}const _0x276b44=await executePushSegmentDeletions(_0x567d85,_0x25ee62['journeysOnly']?[]:_0x54bb45,_0x2a1bb0);let _0x5861a0=0x0,_0x266d38=0x0,_0x3243ab=0x0;const _0x63679b=new Map(_0x1cb9e4);for(const [_0x2bfa55,_0x280dbe]of _0x254cde[_0x5b9c5a(0x133)]){_0x63679b[_0x5b9c5a(0x12f)](_0x2bfa55,_0x280dbe);}if(_0xf70371[_0x5b9c5a(0x130)]>0x0){const _0x4cc974={..._0x184cef,'segmentNameToId':_0x63679b,'existingSegments':_0x15a5ad,'activationContext':_0x1d22e5},_0xef828f=await executePushJourneys(_0x567d85,_0xf70371,_0x4cc974,{'parentId':_0x11510e,'rootFolderId':_0x17d963,'verbose':_0x25ee62['verbose']},_0x2a1bb0);_0x5861a0=_0xef828f['created'],_0x266d38=_0xef828f[_0x5b9c5a(0xcd)];if(_0x4e0691&&_0xef828f[_0x5b9c5a(0xf3)][_0x5b9c5a(0x130)]===0x1){const _0x172cb1=_0xef828f[_0x5b9c5a(0xf3)][0x0];if(_0x172cb1[_0x5b9c5a(0x14d)]){const _0x317d15=getConsoleNextUrl(_0x25ee62[_0x5b9c5a(0x12b)],_0x5b9c5a(0x122)+_0x11510e+_0x5b9c5a(0x137)+_0x172cb1[_0x5b9c5a(0x14d)]+'/j/da/je');console[_0x5b9c5a(0x11c)]('\x20\x20'+a39_0x9de32f[_0x5b9c5a(0x142)](_0x317d15));}}}for(const _0x39452b of _0x4dc82b){console['error'](a39_0x9de32f[_0x5b9c5a(0x143)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x39452b['journeyBundleName'])),_0x3243ab++;}const _0xeafc88=[];if(_0x370462>0x0)_0xeafc88['push'](_0x370462+'\x20created');if(_0x40612a>0x0)_0xeafc88['push'](_0x40612a+_0x5b9c5a(0x12a));if(_0x276b44>0x0)_0xeafc88[_0x5b9c5a(0x147)](_0x276b44+_0x5b9c5a(0xde));const _0x3ba2e9=[];if(_0x5861a0>0x0)_0x3ba2e9[_0x5b9c5a(0x147)](_0x5861a0+_0x5b9c5a(0xd7));if(_0x266d38>0x0)_0x3ba2e9['push'](_0x266d38+_0x5b9c5a(0x12a));if(_0x3243ab>0x0)_0x3ba2e9['push'](_0x3243ab+'\x20deleted');const _0x3346e9=[];if(_0x5045f2>0x0)_0x3346e9[_0x5b9c5a(0x147)](_0x5045f2+_0x5b9c5a(0xd7));if(_0x28b298>0x0)_0x3346e9['push'](_0x28b298+'\x20updated');if(_0x391e98>0x0)_0x3346e9[_0x5b9c5a(0x147)](_0x391e98+_0x5b9c5a(0xde));console['error'](a39_0x9de32f[_0x5b9c5a(0xd0)](_0x5b9c5a(0x11e)));_0xeafc88['length']>0x0&&!_0x25ee62['journeysOnly']&&console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x159)+_0xeafc88[_0x5b9c5a(0x15d)](',\x20'));_0x3ba2e9[_0x5b9c5a(0x130)]>0x0&&console[_0x5b9c5a(0x11c)](_0x5b9c5a(0xd3)+_0x3ba2e9[_0x5b9c5a(0x15d)](',\x20'));_0x3346e9[_0x5b9c5a(0x130)]>0x0&&!_0x25ee62[_0x5b9c5a(0x15a)]&&console[_0x5b9c5a(0x11c)]('\x20\x20Activations:\x20'+_0x3346e9['join'](',\x20'));if(_0x20e954){const _0x3fd7f7=getConsoleNextUrl(_0x25ee62[_0x5b9c5a(0x12b)],_0x5b9c5a(0x122)+_0x11510e+_0x5b9c5a(0x137)+_0x20e954+_0x5b9c5a(0x121));console[_0x5b9c5a(0x11c)](_0x5b9c5a(0x112)+a39_0x9de32f[_0x5b9c5a(0x142)](_0x3fd7f7));}return 0x0;}}