@treasuredata/tdx 0.26.2 β†’ 0.26.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  121. package/dist/sdk/segment/yaml-validator.js +1 -1
  122. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  123. package/dist/sdk/segment.js +1 -1
  124. package/dist/sdk/types/index.js +1 -1
  125. package/dist/sdk/types/progress.js +1 -1
  126. package/dist/sdk/user.js +1 -1
  127. package/dist/sdk/util/format-detector.js +1 -1
  128. package/dist/sdk/util/formatters.js +1 -1
  129. package/dist/sdk/util/index.js +1 -1
  130. package/dist/sdk/util/tree-formatter.js +1 -1
  131. package/dist/sdk/workflow/archive-validation.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x5449f7=a26_0x3f49;(function(_0x385acd,_0x4708a0){const _0x54da83=a26_0x3f49,_0x1cf25f=_0x385acd();while(!![]){try{const _0x45bf92=-parseInt(_0x54da83(0x229))/0x1+parseInt(_0x54da83(0x21e))/0x2*(parseInt(_0x54da83(0x1cc))/0x3)+-parseInt(_0x54da83(0x1e0))/0x4*(parseInt(_0x54da83(0x1e3))/0x5)+parseInt(_0x54da83(0x1fb))/0x6+parseInt(_0x54da83(0x208))/0x7+parseInt(_0x54da83(0x1d2))/0x8+parseInt(_0x54da83(0x22e))/0x9*(parseInt(_0x54da83(0x22d))/0xa);if(_0x45bf92===_0x4708a0)break;else _0x1cf25f['push'](_0x1cf25f['shift']());}catch(_0x5e9961){_0x1cf25f['push'](_0x1cf25f['shift']());}}}(a26_0x4dcd,0x5eaab));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';function a26_0x4dcd(){const _0x2f2505=['dim','created_at','delay','pagination','user_name','args','name','retry_limit','priority','πŸ“…\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','1578885vZtKhW','query','timezone','Found\x20','just\x20now','create','user','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Failed\x20to\x20read\x20file:\x20','result','utf-8','cyan','trim','Show\x20schedule\x20execution\x20history','validate','job_id','Query\x20file\x20is\x20empty','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Schedule\x20run\x20submitted:\x20','tsv','Deleting\x20schedule...','52QdfTAx','site','nextRun','repeat','getTime','list','has_next_page','Schedule\x20updated:\x20','from','format','Updating\x20schedule:\x20','680926RkAUxD','\x20\x20Job\x20ID:\x20','num','engineVersion','70fAWgGv','1160820gtcDBx','status','schedule:delete','Update\x20a\x20scheduled\x20query','trino','log','queryUrl','round','in\x20','start_at','database','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','yes','executing_user_id','success','json','engine_version','last_job','Listing\x20scheduled\x20queries...','ies','Getting\x20schedule\x20details...','padEnd','Creating\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','ended_at','length','\x20\x20Cron:\x20','schedule:history','\x20\x20Time:\x20','schedule:show','\x20(showing\x20','limit','\x22...','scheduled_at','error','listQueries','d\x20ago','\x20matching\x20\x22','\x20\x20β†’\x20','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','31449eXwHSl','No\x20scheduled\x20queries\x20found','INVALID_ARGUMENT','\x20schedules','\x20\x20Database:\x20','time_zone','738656QtNNbV','count','Searching\x20scheduled\x20queries\x20matching\x20\x22','history','execute','map','statusIcon','Showing\x20first\x20','soon','retryLimit','\x20(use\x20--limit\x20to\x20see\x20more)','output','verbose','...','4jPoTIj','\x20execution','schedule:create','2470410jgkFCL','next_run_at','description','lastRun','show','Show\x20schedule\x20details','m\x20ago','schedule:update','Delete\x20a\x20scheduled\x20query','Running\x20schedule:\x20','entries','data','h\x20ago','\x20\x20Num:\x20','cron','type','green','\x20\x20Timezone:\x20','time','toLocaleDateString','schedules','Schedule\x20deleted:\x20','delete','\x20created','416748UqCCnx','file'];a26_0x4dcd=function(){return _0x2f2505;};return a26_0x4dcd();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x1b9a6a from'chalk';function a26_0x3f49(_0x376299,_0x550c69){_0x376299=_0x376299-0x1c0;const _0x4dcde6=a26_0x4dcd();let _0x3f498c=_0x4dcde6[_0x376299];return _0x3f498c;}function formatRelativeTime(_0x40cc82){const _0x2da0d5=a26_0x3f49,_0x21ab25=new Date(_0x40cc82),_0x2cd1bf=new Date(),_0x46f3ed=_0x21ab25[_0x2da0d5(0x222)]()-_0x2cd1bf[_0x2da0d5(0x222)](),_0x1b1640=Math['abs'](_0x46f3ed)/0x3e8,_0x556ef4=_0x46f3ed<0x0;if(_0x1b1640<0x3c)return _0x556ef4?_0x2da0d5(0x20c):_0x2da0d5(0x1da);else{if(_0x1b1640<0xe10){const _0x22725a=Math[_0x2da0d5(0x235)](_0x1b1640/0x3c);return _0x556ef4?_0x22725a+_0x2da0d5(0x1e9):_0x2da0d5(0x236)+_0x22725a+'m';}else{if(_0x1b1640<0x15180){const _0x4e1d09=Math[_0x2da0d5(0x235)](_0x1b1640/0xe10);return _0x556ef4?_0x4e1d09+_0x2da0d5(0x1ef):_0x2da0d5(0x236)+_0x4e1d09+'h';}else{if(_0x1b1640<0x93a80){const _0x5b4bc2=Math['round'](_0x1b1640/0x15180);return _0x556ef4?_0x5b4bc2+_0x2da0d5(0x1c8):_0x2da0d5(0x236)+_0x5b4bc2+'d';}else return _0x21ab25[_0x2da0d5(0x1f6)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x5449f7(0x203)]='schedule:list';['description']='List\x20scheduled\x20queries';async[a26_0x5449f7(0x1d6)](_0x516a80){const _0x3c52c1=a26_0x5449f7,{options:_0x370fb9,args:_0x33422c,tdx:_0x8cea06}=_0x516a80,_0x34e90a=resolveLimit(_0x370fb9[_0x3c52c1(0x1c3)],DEFAULT_DISPLAY_LIMIT),_0x418f36=_0x33422c[0x0],_0x107e03=_0x418f36?_0x3c52c1(0x1d4)+_0x418f36+_0x3c52c1(0x1c4):_0x3c52c1(0x240),_0x236cc4=await withSpinner(_0x107e03,()=>_0x8cea06['schedules'][_0x3c52c1(0x1c7)]({'limit':_0x34e90a,'scheduled':!![],'pattern':_0x418f36}),{'verbose':_0x370fb9[_0x3c52c1(0x1de)]}),_0x1c1aa9=_0x236cc4['data']['queries'],_0x4279ce=_0x236cc4[_0x3c52c1(0x1ee)][_0x3c52c1(0x200)][_0x3c52c1(0x224)],_0x2cfc1f=_0x418f36?_0x3c52c1(0x1c9)+_0x418f36+'\x22':'';_0x4279ce?console[_0x3c52c1(0x1c6)](_0x3c52c1(0x1d9)+_0x1c1aa9[_0x3c52c1(0x247)]+_0x3c52c1(0x1cf)+_0x2cfc1f+_0x3c52c1(0x1dc)):console[_0x3c52c1(0x1c6)](_0x3c52c1(0x20b)+_0x1c1aa9['length']+'\x20scheduled\x20quer'+(_0x1c1aa9[_0x3c52c1(0x247)]!==0x1?_0x3c52c1(0x241):'y')+_0x2cfc1f);if(_0x370fb9['format']===_0x3c52c1(0x23d)||_0x370fb9[_0x3c52c1(0x227)]==='jsonl'||_0x370fb9[_0x3c52c1(0x227)]==='table'||_0x370fb9[_0x3c52c1(0x227)]===_0x3c52c1(0x21c)){const _0x20e38a=_0x1c1aa9[_0x3c52c1(0x1d7)](_0x574f14=>({'id':_0x574f14['id'],'name':_0x574f14[_0x3c52c1(0x203)],'cron':_0x574f14['cron'],'database':_0x574f14['database']?.[_0x3c52c1(0x203)],'type':_0x574f14[_0x3c52c1(0x1f2)],'timezone':_0x574f14[_0x3c52c1(0x1d1)],'user_name':_0x574f14[_0x3c52c1(0x20e)]?.[_0x3c52c1(0x203)],'updated_at':_0x574f14['updated_at'],'next_run_at':_0x574f14[_0x3c52c1(0x1e4)],'last_job_status':_0x574f14[_0x3c52c1(0x23f)]?.['status']}));await handleSDKOutput(_0x20e38a,_0x370fb9);}else{if(_0x1c1aa9['length']===0x0)console[_0x3c52c1(0x233)](_0x3c52c1(0x1cd));else{const _0x58a1e9=_0x370fb9[_0x3c52c1(0x21f)],_0x12a960=_0x1c1aa9[_0x3c52c1(0x1d7)](_0x381d2b=>{const _0x969913=_0x3c52c1,_0x52cd47=_0x381d2b[_0x969913(0x23f)]?.[_0x969913(0x22f)]?_0x381d2b[_0x969913(0x23f)][_0x969913(0x22f)]===_0x969913(0x23c)?'βœ“':'βœ—':'-',_0x410d84=_0x381d2b[_0x969913(0x23f)]?.['ended_at']?formatRelativeTime(_0x381d2b[_0x969913(0x23f)][_0x969913(0x246)]):'never',_0x289e7e=_0x381d2b[_0x969913(0x1e4)]?formatRelativeTime(_0x381d2b[_0x969913(0x1e4)]):'-',_0x1f174b=_0x381d2b[_0x969913(0x1f1)]||'',_0x5bd383=_0x381d2b[_0x969913(0x203)]||'(unnamed)',_0x3d2af9=getConsoleUrl(_0x58a1e9,'/app/queries/editor?queryId='+_0x381d2b['id']);return{'statusIcon':_0x52cd47,'lastRun':_0x410d84,'nextRun':_0x289e7e,'cron':_0x1f174b,'name':_0x5bd383,'queryUrl':_0x3d2af9,'status':_0x381d2b[_0x969913(0x23f)]?.[_0x969913(0x22f)]};}),_0x3383be=Math['max'](..._0x12a960[_0x3c52c1(0x1d7)](_0x5055b9=>_0x5055b9[_0x3c52c1(0x1e6)][_0x3c52c1(0x247)])),_0x1c4dae=Math['max'](..._0x12a960[_0x3c52c1(0x1d7)](_0x366eb7=>_0x366eb7[_0x3c52c1(0x220)]['length'])),_0x4728bc=Math['max'](..._0x12a960[_0x3c52c1(0x1d7)](_0x5004e0=>_0x5004e0['cron'][_0x3c52c1(0x247)])),_0x55dd22=_0x12a960[_0x3c52c1(0x1d7)](_0x36c52c=>{const _0x991ee=_0x3c52c1,_0x3b3d7c=_0x36c52c[_0x991ee(0x22f)]===_0x991ee(0x23c)?a26_0x1b9a6a[_0x991ee(0x1f3)](_0x36c52c['statusIcon']):_0x36c52c[_0x991ee(0x22f)]===_0x991ee(0x1c6)?a26_0x1b9a6a['red'](_0x36c52c[_0x991ee(0x1d8)]):a26_0x1b9a6a[_0x991ee(0x1fd)](_0x36c52c['statusIcon']),_0xe53ddb=_0x36c52c[_0x991ee(0x1e6)][_0x991ee(0x243)](_0x3383be),_0x548cd3=_0x36c52c[_0x991ee(0x220)][_0x991ee(0x243)](_0x1c4dae),_0x49a69e=_0x36c52c['cron']?a26_0x1b9a6a[_0x991ee(0x213)](_0x36c52c[_0x991ee(0x1f1)][_0x991ee(0x243)](_0x4728bc)):'\x20'[_0x991ee(0x221)](_0x4728bc),_0x2f92f0=hyperlink(_0x36c52c['name'],_0x36c52c[_0x991ee(0x234)]);return _0x991ee(0x206)+_0x3b3d7c+'\x20'+_0xe53ddb+_0x991ee(0x1ca)+_0x548cd3+'\x20\x20'+_0x49a69e+'\x20\x20'+_0x2f92f0;});await writeOutput(_0x55dd22['join']('\x0a'),_0x370fb9[_0x3c52c1(0x1dd)],_0x3c52c1(0x223));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x5449f7(0x203)]=a26_0x5449f7(0x1c1);['description']=a26_0x5449f7(0x1e8);[a26_0x5449f7(0x216)](_0x2a806c){const _0x5ddafb=a26_0x5449f7,_0x127ac2=_0x2a806c['args'][0x0];if(!_0x127ac2)return _0x5ddafb(0x207);return undefined;}async[a26_0x5449f7(0x1d6)](_0x44a91d){const _0x10c66a=a26_0x5449f7,{options:_0x4b4a08,args:_0x233950,tdx:_0x175b28}=_0x44a91d,_0x222db3=_0x233950[0x0],_0x2cb419=await withSpinner(_0x10c66a(0x242),()=>_0x175b28[_0x10c66a(0x1f7)][_0x10c66a(0x1e7)](_0x222db3),{'verbose':_0x4b4a08[_0x10c66a(0x1de)]}),_0x32d3df=_0x2cb419[_0x10c66a(0x1ee)],_0x5072ec={'name':_0x32d3df['name'],'cron':_0x32d3df['cron'],'database':_0x32d3df[_0x10c66a(0x238)],'type':_0x32d3df[_0x10c66a(0x1f2)],'timezone':_0x32d3df[_0x10c66a(0x20a)],'user_name':_0x32d3df[_0x10c66a(0x201)],'created_at':_0x32d3df[_0x10c66a(0x1fe)],'engine_version':_0x32d3df[_0x10c66a(0x23e)],'executing_user_id':_0x32d3df[_0x10c66a(0x23b)],'query':_0x32d3df[_0x10c66a(0x209)],'delay':_0x32d3df[_0x10c66a(0x1ff)],'priority':_0x32d3df[_0x10c66a(0x205)],'retry_limit':_0x32d3df[_0x10c66a(0x204)],..._0x32d3df[_0x10c66a(0x211)]&&{'result':_0x32d3df['result']}};return await handleSingleObjectOutput(_0x5072ec,_0x4b4a08),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x5449f7(0x203)]=a26_0x5449f7(0x1e2);[a26_0x5449f7(0x1e5)]='Create\x20a\x20scheduled\x20query';[a26_0x5449f7(0x216)](_0x4800e8){const _0x2f9889=a26_0x5449f7,_0x49b804=_0x4800e8[_0x2f9889(0x202)][0x0];if(!_0x49b804)return _0x2f9889(0x21a);return undefined;}async[a26_0x5449f7(0x1d6)](_0x27d0e0){const _0x50915e=a26_0x5449f7,{options:_0x7326f9,args:_0x150484,tdx:_0x1347fe}=_0x27d0e0,_0x29bef2=_0x150484[0x0],_0x2dca06=_0x7326f9,_0x5bfa47=_0x2dca06[_0x50915e(0x238)],_0x570dad=_0x2dca06[_0x50915e(0x1fc)],_0x1c6ea6=_0x2dca06[_0x50915e(0x1f2)]||_0x50915e(0x232);let _0x5bda7b;try{_0x5bda7b=readFileSync(_0x570dad,_0x50915e(0x212))[_0x50915e(0x214)]();}catch(_0x1eccd3){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x50915e(0x210)+_0x570dad,_0x1eccd3 instanceof Error?_0x1eccd3:undefined);}if(!_0x5bda7b)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x50915e(0x218));const _0x3ec070={'database':_0x5bfa47,'query':_0x5bda7b,'type':_0x1c6ea6};if(_0x2dca06['cron'])_0x3ec070[_0x50915e(0x1f1)]=_0x2dca06[_0x50915e(0x1f1)];if(_0x2dca06['timezone'])_0x3ec070[_0x50915e(0x20a)]=_0x2dca06[_0x50915e(0x20a)];if(_0x2dca06[_0x50915e(0x1ff)]!==undefined)_0x3ec070['delay']=Number(_0x2dca06[_0x50915e(0x1ff)]);if(_0x2dca06[_0x50915e(0x205)]!==undefined)_0x3ec070[_0x50915e(0x205)]=Number(_0x2dca06['priority']);if(_0x2dca06[_0x50915e(0x1db)]!==undefined)_0x3ec070[_0x50915e(0x204)]=Number(_0x2dca06[_0x50915e(0x1db)]);if(_0x2dca06[_0x50915e(0x22c)])_0x3ec070[_0x50915e(0x23e)]=_0x2dca06[_0x50915e(0x22c)];if(_0x2dca06['result'])_0x3ec070[_0x50915e(0x211)]=_0x2dca06[_0x50915e(0x211)];if(_0x7326f9['verbose']){console[_0x50915e(0x1c6)]('Creating\x20schedule:\x20'+_0x29bef2),console[_0x50915e(0x1c6)](_0x50915e(0x1d0)+_0x5bfa47),console[_0x50915e(0x1c6)]('\x20\x20Type:\x20'+_0x1c6ea6);if(_0x3ec070[_0x50915e(0x1f1)])console[_0x50915e(0x1c6)](_0x50915e(0x248)+_0x3ec070['cron']);if(_0x3ec070['timezone'])console[_0x50915e(0x1c6)](_0x50915e(0x1f4)+_0x3ec070[_0x50915e(0x20a)]);}const _0x1f61b1=await withSpinner(_0x50915e(0x244),()=>_0x1347fe[_0x50915e(0x1f7)][_0x50915e(0x20d)](_0x29bef2,_0x3ec070),{'verbose':_0x7326f9[_0x50915e(0x1de)]});return console[_0x50915e(0x1c6)]('Schedule\x20created:\x20'+_0x1f61b1[_0x50915e(0x1ee)][_0x50915e(0x203)]),await handleSingleObjectOutput(_0x1f61b1[_0x50915e(0x1ee)],_0x7326f9),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a26_0x5449f7(0x1ea);[a26_0x5449f7(0x1e5)]=a26_0x5449f7(0x231);[a26_0x5449f7(0x216)](_0x2911a0){const _0x3a7f4c=a26_0x5449f7,_0x2fe390=_0x2911a0[_0x3a7f4c(0x202)][0x0];if(!_0x2fe390)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]';return undefined;}async['execute'](_0x1f8ed4){const _0x936aff=a26_0x5449f7,{options:_0xaf59e7,args:_0x3a4731,tdx:_0x20eb68}=_0x1f8ed4,_0x1177dc=_0x3a4731[0x0],_0x66191f=_0xaf59e7,_0x5896a7={};if(_0x66191f[_0x936aff(0x238)])_0x5896a7[_0x936aff(0x238)]=_0x66191f[_0x936aff(0x238)];if(_0x66191f[_0x936aff(0x1f2)])_0x5896a7[_0x936aff(0x1f2)]=_0x66191f[_0x936aff(0x1f2)];if(_0x66191f[_0x936aff(0x1f1)])_0x5896a7[_0x936aff(0x1f1)]=_0x66191f[_0x936aff(0x1f1)];if(_0x66191f[_0x936aff(0x20a)])_0x5896a7[_0x936aff(0x20a)]=_0x66191f[_0x936aff(0x20a)];if(_0x66191f[_0x936aff(0x1ff)]!==undefined)_0x5896a7[_0x936aff(0x1ff)]=Number(_0x66191f[_0x936aff(0x1ff)]);if(_0x66191f[_0x936aff(0x205)]!==undefined)_0x5896a7['priority']=Number(_0x66191f[_0x936aff(0x205)]);if(_0x66191f['retryLimit']!==undefined)_0x5896a7[_0x936aff(0x204)]=Number(_0x66191f[_0x936aff(0x1db)]);if(_0x66191f[_0x936aff(0x22c)])_0x5896a7[_0x936aff(0x23e)]=_0x66191f[_0x936aff(0x22c)];if(_0x66191f[_0x936aff(0x211)])_0x5896a7['result']=_0x66191f[_0x936aff(0x211)];if(_0x66191f[_0x936aff(0x1fc)])try{_0x5896a7[_0x936aff(0x209)]=readFileSync(_0x66191f[_0x936aff(0x1fc)],_0x936aff(0x212))[_0x936aff(0x214)]();}catch(_0x2e561c){throw new SDKError(ErrorCode[_0x936aff(0x1ce)],_0x936aff(0x210)+_0x66191f[_0x936aff(0x1fc)],_0x2e561c instanceof Error?_0x2e561c:undefined);}if(Object['keys'](_0x5896a7)['length']===0x0)throw new SDKError(ErrorCode[_0x936aff(0x1ce)],_0x936aff(0x1cb));if(_0xaf59e7[_0x936aff(0x1de)]){console[_0x936aff(0x1c6)](_0x936aff(0x228)+_0x1177dc);for(const [_0x3e1d5a,_0x1eaf31]of Object[_0x936aff(0x1ed)](_0x5896a7)){_0x3e1d5a===_0x936aff(0x209)?console[_0x936aff(0x1c6)]('\x20\x20'+_0x3e1d5a+':\x20'+_0x1eaf31['substring'](0x0,0x32)+_0x936aff(0x1df)):console[_0x936aff(0x1c6)]('\x20\x20'+_0x3e1d5a+':\x20'+_0x1eaf31);}}const _0x4434a9=await withSpinner('Updating\x20schedule...',()=>_0x20eb68[_0x936aff(0x1f7)]['update'](_0x1177dc,_0x5896a7),{'verbose':_0xaf59e7[_0x936aff(0x1de)]});return console[_0x936aff(0x1c6)](_0x936aff(0x225)+_0x4434a9['data'][_0x936aff(0x203)]),await handleSingleObjectOutput(_0x4434a9['data'],_0xaf59e7),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x5449f7(0x203)]=a26_0x5449f7(0x230);['description']=a26_0x5449f7(0x1eb);[a26_0x5449f7(0x216)](_0xfd53c9){const _0x38a2e0=a26_0x5449f7,_0x505c6c=_0xfd53c9[_0x38a2e0(0x202)][0x0];if(!_0x505c6c)return _0x38a2e0(0x245);return undefined;}async[a26_0x5449f7(0x1d6)](_0x5d10c3){const _0x51d070=a26_0x5449f7,{options:_0x16768b,args:_0x294325,tdx:_0x18252c}=_0x5d10c3,_0x573724=_0x294325[0x0];if(!_0x16768b[_0x51d070(0x23a)]){const _0x28b6f4=await confirm(_0x51d070(0x219)+_0x573724+'\x22?');if(!_0x28b6f4)return console['error']('Cancelled'),0x0;}const _0x4f9bb6=await withSpinner(_0x51d070(0x21d),()=>_0x18252c[_0x51d070(0x1f7)][_0x51d070(0x1f9)](_0x573724),{'verbose':_0x16768b[_0x51d070(0x1de)]});return console[_0x51d070(0x1c6)](_0x51d070(0x1f8)+_0x4f9bb6[_0x51d070(0x1ee)][_0x51d070(0x203)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x5449f7(0x203)]='schedule:run';[a26_0x5449f7(0x1e5)]='Run\x20a\x20scheduled\x20query\x20immediately';[a26_0x5449f7(0x216)](_0x9a549d){const _0x19786a=a26_0x5449f7,_0x4ae39d=_0x9a549d[_0x19786a(0x202)][0x0];if(!_0x4ae39d)return _0x19786a(0x239);return undefined;}async['execute'](_0x43d518){const _0x452886=a26_0x5449f7,{options:_0x2bc923,args:_0x2c4422,tdx:_0x4df2a0}=_0x43d518,_0x56290d=_0x2c4422[0x0],_0x5b5e14=_0x2bc923,_0xa5c3a5=_0x5b5e14[_0x452886(0x1f5)],_0x2344f5=_0x5b5e14[_0x452886(0x22b)]!==undefined?Number(_0x5b5e14['num']):undefined;if(_0x2bc923[_0x452886(0x1de)]){console[_0x452886(0x1c6)](_0x452886(0x1ec)+_0x56290d);if(_0xa5c3a5)console['error'](_0x452886(0x1c0)+_0xa5c3a5);if(_0x2344f5)console[_0x452886(0x1c6)](_0x452886(0x1f0)+_0x2344f5);}const _0x8839f=await withSpinner('Running\x20schedule...',()=>_0x4df2a0[_0x452886(0x1f7)]['run'](_0x56290d,{'time':_0xa5c3a5,'num':_0x2344f5}),{'verbose':_0x2bc923[_0x452886(0x1de)]}),_0x4d2ca0=_0x8839f[_0x452886(0x1ee)]['jobs'];console[_0x452886(0x1c6)](_0x452886(0x21b)+_0x4d2ca0[_0x452886(0x247)]+'\x20job'+(_0x4d2ca0[_0x452886(0x247)]!==0x1?'s':'')+_0x452886(0x1fa));for(const _0xf64212 of _0x4d2ca0){console[_0x452886(0x1c6)](_0x452886(0x22a)+_0xf64212['job_id']);}return await handleSDKOutput(_0x4d2ca0,_0x2bc923),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x5449f7(0x203)]=a26_0x5449f7(0x249);[a26_0x5449f7(0x1e5)]=a26_0x5449f7(0x215);[a26_0x5449f7(0x216)](_0x11f83b){const _0x201d80=a26_0x5449f7,_0xc5ea65=_0x11f83b[_0x201d80(0x202)][0x0];if(!_0xc5ea65)return _0x201d80(0x20f);return undefined;}async[a26_0x5449f7(0x1d6)](_0x244540){const _0x1cabf0=a26_0x5449f7,{options:_0x6692f3,args:_0x190ea3,tdx:_0x23641e}=_0x244540,_0x23a447=_0x190ea3[0x0],_0xcd411b=_0x6692f3,_0x3ad240=_0xcd411b[_0x1cabf0(0x226)]!==undefined?Number(_0xcd411b[_0x1cabf0(0x226)]):undefined,_0x4138d0=_0xcd411b['to']!==undefined?Number(_0xcd411b['to']):undefined,_0x43fc4a=await withSpinner('Getting\x20schedule\x20history...',()=>_0x23641e[_0x1cabf0(0x1f7)][_0x1cabf0(0x1d5)](_0x23a447,{'from':_0x3ad240,'to':_0x4138d0}),{'verbose':_0x6692f3['verbose']}),_0x4acaba=_0x43fc4a['data'];console['error'](_0x1cabf0(0x20b)+_0x4acaba[_0x1cabf0(0x1d3)]+_0x1cabf0(0x1e1)+(_0x4acaba['count']!==0x1?'s':'')+_0x1cabf0(0x1c2)+_0x4acaba[_0x1cabf0(0x226)]+'-'+_0x4acaba['to']+')');const _0x2dac06=_0x4acaba['history'][_0x1cabf0(0x1d7)](_0x1ee491=>({'job_id':_0x1ee491[_0x1cabf0(0x217)],'type':_0x1ee491[_0x1cabf0(0x1f2)],'status':_0x1ee491['status'],'scheduled_at':_0x1ee491[_0x1cabf0(0x1c5)],'created_at':_0x1ee491[_0x1cabf0(0x1fe)],'start_at':_0x1ee491[_0x1cabf0(0x237)],'end_at':_0x1ee491['end_at']}));return await handleSDKOutput(_0x2dac06,_0x6692f3),0x0;}}
1
+ const a26_0x4d179c=a26_0xc8d0;(function(_0x503da6,_0x48239f){const _0x1416bd=a26_0xc8d0,_0x336432=_0x503da6();while(!![]){try{const _0x56b48f=parseInt(_0x1416bd(0xc5))/0x1+parseInt(_0x1416bd(0x87))/0x2*(-parseInt(_0x1416bd(0xe1))/0x3)+parseInt(_0x1416bd(0x80))/0x4+parseInt(_0x1416bd(0x8c))/0x5+parseInt(_0x1416bd(0xdf))/0x6*(parseInt(_0x1416bd(0xe0))/0x7)+parseInt(_0x1416bd(0xeb))/0x8*(parseInt(_0x1416bd(0xb2))/0x9)+-parseInt(_0x1416bd(0x7b))/0xa;if(_0x56b48f===_0x48239f)break;else _0x336432['push'](_0x336432['shift']());}catch(_0x5f0556){_0x336432['push'](_0x336432['shift']());}}}(a26_0x55a3,0xafb22));function a26_0xc8d0(_0x3527c5,_0x21cb57){_0x3527c5=_0x3527c5-0x65;const _0x55a3ff=a26_0x55a3();let _0xc8d011=_0x55a3ff[_0x3527c5];return _0xc8d011;}import{BaseCommand}from'./command.js';function a26_0x55a3(){const _0x4b5dd8=['πŸ“…\x20','getTime','args','Create\x20a\x20scheduled\x20query','schedule:create','Getting\x20schedule\x20details...','\x20execution','type','8MzZxds','just\x20now','cron','list','success','json','nextRun','history','Deleting\x20schedule...','Running\x20schedule...','schedule:update','queryUrl','keys','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','soon','Creating\x20schedule:\x20','verbose','...','padEnd','\x20schedules','Schedule\x20run\x20submitted:\x20','time_zone','green','user','Schedule\x20deleted:\x20','map','28770950DZzuGd','Updating\x20schedule...','INVALID_ARGUMENT','length','schedule:history','5083788rINzIv','/app/queries/editor?queryId=','retryLimit','job_id','substring','has_next_page','show','2sznYAv','end_at','description','updated_at','List\x20scheduled\x20queries','4816365ypqssZ','round','result','create','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','priority','database','queries','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','validate','time','dim','Showing\x20first\x20','ended_at','lastRun','jsonl','scheduled_at','max','engine_version','status','toLocaleDateString','Run\x20a\x20scheduled\x20query\x20immediately','d\x20ago','next_run_at','start_at','Found\x20','file','join','name','pagination','\x20scheduled\x20quer','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','m\x20ago','log','never','engineVersion','tsv','\x22...','10115307UCpuYZ','ies','count','schedules','Show\x20schedule\x20execution\x20history','\x20(showing\x20','query','data','red','Schedule\x20created:\x20','schedule:run','utf-8','\x20\x20Job\x20ID:\x20','last_job','Delete\x20a\x20scheduled\x20query','delete','num','\x20matching\x20\x22','Update\x20a\x20scheduled\x20query','54878fKrCNh','Getting\x20schedule\x20history...','Listing\x20scheduled\x20queries...','\x20\x20Type:\x20','retry_limit','format','\x20\x20Timezone:\x20','site','\x20\x20Time:\x20','Updating\x20schedule:\x20','timezone','delay','Creating\x20schedule...','in\x20','statusIcon','Failed\x20to\x20read\x20file:\x20','error','execute','entries','created_at','\x20\x20Cron:\x20','Schedule\x20updated:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','user_name','table','trim','4050744IwBgvU','14yEJcHY','3499572hWNJrW','Cancelled'];a26_0x55a3=function(){return _0x4b5dd8;};return a26_0x55a3();}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x2c4436 from'chalk';function formatRelativeTime(_0xffb9c7){const _0x4266dc=a26_0xc8d0,_0x45146e=new Date(_0xffb9c7),_0xb97999=new Date(),_0x33a38b=_0x45146e[_0x4266dc(0xe4)]()-_0xb97999[_0x4266dc(0xe4)](),_0x2b23fb=Math['abs'](_0x33a38b)/0x3e8,_0x5aa2e8=_0x33a38b<0x0;if(_0x2b23fb<0x3c)return _0x5aa2e8?_0x4266dc(0xec):_0x4266dc(0x6f);else{if(_0x2b23fb<0xe10){const _0x4e5572=Math['round'](_0x2b23fb/0x3c);return _0x5aa2e8?_0x4e5572+_0x4266dc(0xac):_0x4266dc(0xd2)+_0x4e5572+'m';}else{if(_0x2b23fb<0x15180){const _0x3bbc8a=Math['round'](_0x2b23fb/0xe10);return _0x5aa2e8?_0x3bbc8a+'h\x20ago':_0x4266dc(0xd2)+_0x3bbc8a+'h';}else{if(_0x2b23fb<0x93a80){const _0x38252a=Math[_0x4266dc(0x8d)](_0x2b23fb/0x15180);return _0x5aa2e8?_0x38252a+_0x4266dc(0xa2):_0x4266dc(0xd2)+_0x38252a+'d';}else return _0x45146e[_0x4266dc(0xa0)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x4d179c(0xa8)]='schedule:list';[a26_0x4d179c(0x89)]=a26_0x4d179c(0x8b);async[a26_0x4d179c(0xd6)](_0x274ed7){const _0x24342e=a26_0x4d179c,{options:_0x5960e2,args:_0x23db1c,tdx:_0x597204}=_0x274ed7,_0x1b162e=resolveLimit(_0x5960e2['limit'],DEFAULT_DISPLAY_LIMIT),_0x1c39ab=_0x23db1c[0x0],_0x39cf30=_0x1c39ab?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x1c39ab+_0x24342e(0xb1):_0x24342e(0xc7),_0x15ff3c=await withSpinner(_0x39cf30,()=>_0x597204[_0x24342e(0xb5)]['listQueries']({'limit':_0x1b162e,'scheduled':!![],'pattern':_0x1c39ab}),{'verbose':_0x5960e2[_0x24342e(0x71)]}),_0x58f6fc=_0x15ff3c['data'][_0x24342e(0x93)],_0x167070=_0x15ff3c[_0x24342e(0xb9)][_0x24342e(0xa9)][_0x24342e(0x85)],_0x24b8bd=_0x1c39ab?_0x24342e(0xc3)+_0x1c39ab+'\x22':'';_0x167070?console[_0x24342e(0xd5)](_0x24342e(0x98)+_0x58f6fc[_0x24342e(0x7e)]+_0x24342e(0x74)+_0x24b8bd+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x24342e(0xd5)](_0x24342e(0xa5)+_0x58f6fc[_0x24342e(0x7e)]+_0x24342e(0xaa)+(_0x58f6fc[_0x24342e(0x7e)]!==0x1?_0x24342e(0xb3):'y')+_0x24b8bd);if(_0x5960e2[_0x24342e(0xca)]===_0x24342e(0x66)||_0x5960e2[_0x24342e(0xca)]===_0x24342e(0x9b)||_0x5960e2[_0x24342e(0xca)]===_0x24342e(0xdd)||_0x5960e2[_0x24342e(0xca)]===_0x24342e(0xb0)){const _0x1a69f1=_0x58f6fc[_0x24342e(0x7a)](_0x1449b5=>({'id':_0x1449b5['id'],'name':_0x1449b5['name'],'cron':_0x1449b5[_0x24342e(0xed)],'database':_0x1449b5[_0x24342e(0x92)]?.[_0x24342e(0xa8)],'type':_0x1449b5[_0x24342e(0xea)],'timezone':_0x1449b5[_0x24342e(0x76)],'user_name':_0x1449b5[_0x24342e(0x78)]?.[_0x24342e(0xa8)],'updated_at':_0x1449b5[_0x24342e(0x8a)],'next_run_at':_0x1449b5[_0x24342e(0xa3)],'last_job_status':_0x1449b5[_0x24342e(0xbf)]?.[_0x24342e(0x9f)]}));await handleSDKOutput(_0x1a69f1,_0x5960e2);}else{if(_0x58f6fc['length']===0x0)console[_0x24342e(0xad)]('No\x20scheduled\x20queries\x20found');else{const _0x363c27=_0x5960e2[_0x24342e(0xcc)],_0x2f8299=_0x58f6fc['map'](_0x213090=>{const _0x47794d=_0x24342e,_0x963d26=_0x213090[_0x47794d(0xbf)]?.[_0x47794d(0x9f)]?_0x213090[_0x47794d(0xbf)][_0x47794d(0x9f)]===_0x47794d(0x65)?'βœ“':'βœ—':'-',_0x23a503=_0x213090['last_job']?.[_0x47794d(0x99)]?formatRelativeTime(_0x213090[_0x47794d(0xbf)][_0x47794d(0x99)]):_0x47794d(0xae),_0x5e1888=_0x213090[_0x47794d(0xa3)]?formatRelativeTime(_0x213090[_0x47794d(0xa3)]):'-',_0x470a46=_0x213090[_0x47794d(0xed)]||'',_0x512073=_0x213090[_0x47794d(0xa8)]||'(unnamed)',_0x30a68f=getConsoleUrl(_0x363c27,_0x47794d(0x81)+_0x213090['id']);return{'statusIcon':_0x963d26,'lastRun':_0x23a503,'nextRun':_0x5e1888,'cron':_0x470a46,'name':_0x512073,'queryUrl':_0x30a68f,'status':_0x213090[_0x47794d(0xbf)]?.[_0x47794d(0x9f)]};}),_0x47cc80=Math[_0x24342e(0x9d)](..._0x2f8299[_0x24342e(0x7a)](_0x437430=>_0x437430['lastRun'][_0x24342e(0x7e)])),_0x5bcba3=Math[_0x24342e(0x9d)](..._0x2f8299[_0x24342e(0x7a)](_0x154e8a=>_0x154e8a[_0x24342e(0x67)][_0x24342e(0x7e)])),_0xfde2c5=Math[_0x24342e(0x9d)](..._0x2f8299[_0x24342e(0x7a)](_0x40b2c2=>_0x40b2c2['cron']['length'])),_0x3d49b8=_0x2f8299['map'](_0x2f8c0f=>{const _0x56098f=_0x24342e,_0x44cb3d=_0x2f8c0f['status']===_0x56098f(0x65)?a26_0x2c4436[_0x56098f(0x77)](_0x2f8c0f[_0x56098f(0xd3)]):_0x2f8c0f['status']===_0x56098f(0xd5)?a26_0x2c4436[_0x56098f(0xba)](_0x2f8c0f[_0x56098f(0xd3)]):a26_0x2c4436[_0x56098f(0x97)](_0x2f8c0f[_0x56098f(0xd3)]),_0xad9a9b=_0x2f8c0f[_0x56098f(0x9a)][_0x56098f(0x73)](_0x47cc80),_0x24ad46=_0x2f8c0f[_0x56098f(0x67)][_0x56098f(0x73)](_0x5bcba3),_0x34b227=_0x2f8c0f['cron']?a26_0x2c4436['cyan'](_0x2f8c0f['cron'][_0x56098f(0x73)](_0xfde2c5)):'\x20'['repeat'](_0xfde2c5),_0xaaf306=hyperlink(_0x2f8c0f['name'],_0x2f8c0f[_0x56098f(0x6c)]);return _0x56098f(0xe3)+_0x44cb3d+'\x20'+_0xad9a9b+'\x20\x20β†’\x20'+_0x24ad46+'\x20\x20'+_0x34b227+'\x20\x20'+_0xaaf306;});await writeOutput(_0x3d49b8[_0x24342e(0xa7)]('\x0a'),_0x5960e2['output'],_0x24342e(0xee));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x4d179c(0xa8)]='schedule:show';['description']='Show\x20schedule\x20details';[a26_0x4d179c(0x95)](_0x5ab1c0){const _0x44092a=a26_0x4d179c,_0x15054e=_0x5ab1c0[_0x44092a(0xe5)][0x0];if(!_0x15054e)return _0x44092a(0xab);return undefined;}async[a26_0x4d179c(0xd6)](_0x6007a0){const _0x2bfb53=a26_0x4d179c,{options:_0x1c58bb,args:_0x3fbdd3,tdx:_0x35bb14}=_0x6007a0,_0x13b801=_0x3fbdd3[0x0],_0x3c0fff=await withSpinner(_0x2bfb53(0xe8),()=>_0x35bb14['schedules'][_0x2bfb53(0x86)](_0x13b801),{'verbose':_0x1c58bb['verbose']}),_0x216d27=_0x3c0fff[_0x2bfb53(0xb9)],_0x247356={'name':_0x216d27[_0x2bfb53(0xa8)],'cron':_0x216d27[_0x2bfb53(0xed)],'database':_0x216d27[_0x2bfb53(0x92)],'type':_0x216d27[_0x2bfb53(0xea)],'timezone':_0x216d27['timezone'],'user_name':_0x216d27[_0x2bfb53(0xdc)],'created_at':_0x216d27[_0x2bfb53(0xd8)],'engine_version':_0x216d27['engine_version'],'executing_user_id':_0x216d27['executing_user_id'],'query':_0x216d27[_0x2bfb53(0xb8)],'delay':_0x216d27[_0x2bfb53(0xd0)],'priority':_0x216d27[_0x2bfb53(0x91)],'retry_limit':_0x216d27[_0x2bfb53(0xc9)],..._0x216d27[_0x2bfb53(0x8e)]&&{'result':_0x216d27[_0x2bfb53(0x8e)]}};return await handleSingleObjectOutput(_0x247356,_0x1c58bb),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a26_0x4d179c(0xe7);[a26_0x4d179c(0x89)]=a26_0x4d179c(0xe6);[a26_0x4d179c(0x95)](_0x301b99){const _0x1ff4f7=a26_0x4d179c,_0x1eae95=_0x301b99[_0x1ff4f7(0xe5)][0x0];if(!_0x1eae95)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a26_0x4d179c(0xd6)](_0x460c7e){const _0x498a09=a26_0x4d179c,{options:_0x5f31f9,args:_0xd2ac4a,tdx:_0x4e9726}=_0x460c7e,_0x5e0cb0=_0xd2ac4a[0x0],_0x383786=_0x5f31f9,_0x535a93=_0x383786[_0x498a09(0x92)],_0x409d11=_0x383786[_0x498a09(0xa6)],_0x25c040=_0x383786[_0x498a09(0xea)]||'trino';let _0x53ad60;try{_0x53ad60=readFileSync(_0x409d11,_0x498a09(0xbd))[_0x498a09(0xde)]();}catch(_0x3663bb){throw new SDKError(ErrorCode[_0x498a09(0x7d)],'Failed\x20to\x20read\x20file:\x20'+_0x409d11,_0x3663bb instanceof Error?_0x3663bb:undefined);}if(!_0x53ad60)throw new SDKError(ErrorCode[_0x498a09(0x7d)],'Query\x20file\x20is\x20empty');const _0x2327b0={'database':_0x535a93,'query':_0x53ad60,'type':_0x25c040};if(_0x383786[_0x498a09(0xed)])_0x2327b0[_0x498a09(0xed)]=_0x383786['cron'];if(_0x383786[_0x498a09(0xcf)])_0x2327b0[_0x498a09(0xcf)]=_0x383786[_0x498a09(0xcf)];if(_0x383786[_0x498a09(0xd0)]!==undefined)_0x2327b0['delay']=Number(_0x383786[_0x498a09(0xd0)]);if(_0x383786[_0x498a09(0x91)]!==undefined)_0x2327b0[_0x498a09(0x91)]=Number(_0x383786[_0x498a09(0x91)]);if(_0x383786[_0x498a09(0x82)]!==undefined)_0x2327b0[_0x498a09(0xc9)]=Number(_0x383786[_0x498a09(0x82)]);if(_0x383786[_0x498a09(0xaf)])_0x2327b0[_0x498a09(0x9e)]=_0x383786[_0x498a09(0xaf)];if(_0x383786[_0x498a09(0x8e)])_0x2327b0['result']=_0x383786[_0x498a09(0x8e)];if(_0x5f31f9[_0x498a09(0x71)]){console['error'](_0x498a09(0x70)+_0x5e0cb0),console[_0x498a09(0xd5)]('\x20\x20Database:\x20'+_0x535a93),console[_0x498a09(0xd5)](_0x498a09(0xc8)+_0x25c040);if(_0x2327b0['cron'])console['error'](_0x498a09(0xd9)+_0x2327b0[_0x498a09(0xed)]);if(_0x2327b0['timezone'])console['error'](_0x498a09(0xcb)+_0x2327b0[_0x498a09(0xcf)]);}const _0x50f199=await withSpinner(_0x498a09(0xd1),()=>_0x4e9726[_0x498a09(0xb5)][_0x498a09(0x8f)](_0x5e0cb0,_0x2327b0),{'verbose':_0x5f31f9['verbose']});return console[_0x498a09(0xd5)](_0x498a09(0xbb)+_0x50f199[_0x498a09(0xb9)][_0x498a09(0xa8)]),await handleSingleObjectOutput(_0x50f199[_0x498a09(0xb9)],_0x5f31f9),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x4d179c(0xa8)]=a26_0x4d179c(0x6b);['description']=a26_0x4d179c(0xc4);[a26_0x4d179c(0x95)](_0x2e7175){const _0x1acfef=a26_0x4d179c,_0x496685=_0x2e7175[_0x1acfef(0xe5)][0x0];if(!_0x496685)return _0x1acfef(0x6e);return undefined;}async[a26_0x4d179c(0xd6)](_0x3178ec){const _0x4478dd=a26_0x4d179c,{options:_0x23b374,args:_0x21feac,tdx:_0x5cc4e1}=_0x3178ec,_0x3e9f94=_0x21feac[0x0],_0x27d907=_0x23b374,_0x31853b={};if(_0x27d907[_0x4478dd(0x92)])_0x31853b[_0x4478dd(0x92)]=_0x27d907['database'];if(_0x27d907['type'])_0x31853b[_0x4478dd(0xea)]=_0x27d907['type'];if(_0x27d907[_0x4478dd(0xed)])_0x31853b[_0x4478dd(0xed)]=_0x27d907['cron'];if(_0x27d907[_0x4478dd(0xcf)])_0x31853b['timezone']=_0x27d907['timezone'];if(_0x27d907[_0x4478dd(0xd0)]!==undefined)_0x31853b[_0x4478dd(0xd0)]=Number(_0x27d907['delay']);if(_0x27d907['priority']!==undefined)_0x31853b[_0x4478dd(0x91)]=Number(_0x27d907[_0x4478dd(0x91)]);if(_0x27d907['retryLimit']!==undefined)_0x31853b[_0x4478dd(0xc9)]=Number(_0x27d907[_0x4478dd(0x82)]);if(_0x27d907[_0x4478dd(0xaf)])_0x31853b['engine_version']=_0x27d907[_0x4478dd(0xaf)];if(_0x27d907[_0x4478dd(0x8e)])_0x31853b[_0x4478dd(0x8e)]=_0x27d907['result'];if(_0x27d907['file'])try{_0x31853b[_0x4478dd(0xb8)]=readFileSync(_0x27d907['file'],_0x4478dd(0xbd))[_0x4478dd(0xde)]();}catch(_0x365701){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4478dd(0xd4)+_0x27d907[_0x4478dd(0xa6)],_0x365701 instanceof Error?_0x365701:undefined);}if(Object[_0x4478dd(0x6d)](_0x31853b)[_0x4478dd(0x7e)]===0x0)throw new SDKError(ErrorCode[_0x4478dd(0x7d)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x23b374[_0x4478dd(0x71)]){console[_0x4478dd(0xd5)](_0x4478dd(0xce)+_0x3e9f94);for(const [_0x37e2da,_0x188292]of Object[_0x4478dd(0xd7)](_0x31853b)){_0x37e2da==='query'?console['error']('\x20\x20'+_0x37e2da+':\x20'+_0x188292[_0x4478dd(0x84)](0x0,0x32)+_0x4478dd(0x72)):console[_0x4478dd(0xd5)]('\x20\x20'+_0x37e2da+':\x20'+_0x188292);}}const _0x3eab86=await withSpinner(_0x4478dd(0x7c),()=>_0x5cc4e1['schedules']['update'](_0x3e9f94,_0x31853b),{'verbose':_0x23b374[_0x4478dd(0x71)]});return console['error'](_0x4478dd(0xda)+_0x3eab86[_0x4478dd(0xb9)][_0x4478dd(0xa8)]),await handleSingleObjectOutput(_0x3eab86[_0x4478dd(0xb9)],_0x23b374),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']='schedule:delete';[a26_0x4d179c(0x89)]=a26_0x4d179c(0xc0);[a26_0x4d179c(0x95)](_0x481afc){const _0x1bc0cb=a26_0x4d179c,_0xedf842=_0x481afc[_0x1bc0cb(0xe5)][0x0];if(!_0xedf842)return _0x1bc0cb(0x90);return undefined;}async[a26_0x4d179c(0xd6)](_0x25a906){const _0x4f08cb=a26_0x4d179c,{options:_0x4acea8,args:_0x44caf5,tdx:_0x2dbe05}=_0x25a906,_0x1d9e3b=_0x44caf5[0x0];if(!_0x4acea8['yes']){const _0x7cfee9=await confirm(_0x4f08cb(0x94)+_0x1d9e3b+'\x22?');if(!_0x7cfee9)return console[_0x4f08cb(0xd5)](_0x4f08cb(0xe2)),0x0;}const _0x13810a=await withSpinner(_0x4f08cb(0x69),()=>_0x2dbe05['schedules'][_0x4f08cb(0xc1)](_0x1d9e3b),{'verbose':_0x4acea8[_0x4f08cb(0x71)]});return console[_0x4f08cb(0xd5)](_0x4f08cb(0x79)+_0x13810a[_0x4f08cb(0xb9)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a26_0x4d179c(0xbc);[a26_0x4d179c(0x89)]=a26_0x4d179c(0xa1);['validate'](_0x484e26){const _0x5c3f28=_0x484e26['args'][0x0];if(!_0x5c3f28)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async['execute'](_0x4c1725){const _0x131938=a26_0x4d179c,{options:_0x3f841f,args:_0x102ebd,tdx:_0x3e89a8}=_0x4c1725,_0x1749d0=_0x102ebd[0x0],_0x133b0b=_0x3f841f,_0x5e2035=_0x133b0b[_0x131938(0x96)],_0x2ff035=_0x133b0b[_0x131938(0xc2)]!==undefined?Number(_0x133b0b['num']):undefined;if(_0x3f841f[_0x131938(0x71)]){console['error']('Running\x20schedule:\x20'+_0x1749d0);if(_0x5e2035)console[_0x131938(0xd5)](_0x131938(0xcd)+_0x5e2035);if(_0x2ff035)console[_0x131938(0xd5)]('\x20\x20Num:\x20'+_0x2ff035);}const _0x30d8ac=await withSpinner(_0x131938(0x6a),()=>_0x3e89a8[_0x131938(0xb5)]['run'](_0x1749d0,{'time':_0x5e2035,'num':_0x2ff035}),{'verbose':_0x3f841f[_0x131938(0x71)]}),_0x33ce80=_0x30d8ac[_0x131938(0xb9)]['jobs'];console[_0x131938(0xd5)](_0x131938(0x75)+_0x33ce80[_0x131938(0x7e)]+'\x20job'+(_0x33ce80[_0x131938(0x7e)]!==0x1?'s':'')+'\x20created');for(const _0xdb18c1 of _0x33ce80){console[_0x131938(0xd5)](_0x131938(0xbe)+_0xdb18c1[_0x131938(0x83)]);}return await handleSDKOutput(_0x33ce80,_0x3f841f),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x4d179c(0xa8)]=a26_0x4d179c(0x7f);[a26_0x4d179c(0x89)]=a26_0x4d179c(0xb6);[a26_0x4d179c(0x95)](_0x2d43ad){const _0x147232=a26_0x4d179c,_0x7a7e28=_0x2d43ad[_0x147232(0xe5)][0x0];if(!_0x7a7e28)return _0x147232(0xdb);return undefined;}async[a26_0x4d179c(0xd6)](_0x3c4972){const _0x2b1eb9=a26_0x4d179c,{options:_0xec5778,args:_0x155906,tdx:_0x7c129a}=_0x3c4972,_0x52fc23=_0x155906[0x0],_0x1b0920=_0xec5778,_0x42761b=_0x1b0920['from']!==undefined?Number(_0x1b0920['from']):undefined,_0x240271=_0x1b0920['to']!==undefined?Number(_0x1b0920['to']):undefined,_0x2803c1=await withSpinner(_0x2b1eb9(0xc6),()=>_0x7c129a[_0x2b1eb9(0xb5)][_0x2b1eb9(0x68)](_0x52fc23,{'from':_0x42761b,'to':_0x240271}),{'verbose':_0xec5778['verbose']}),_0x20c1ee=_0x2803c1[_0x2b1eb9(0xb9)];console[_0x2b1eb9(0xd5)](_0x2b1eb9(0xa5)+_0x20c1ee[_0x2b1eb9(0xb4)]+_0x2b1eb9(0xe9)+(_0x20c1ee[_0x2b1eb9(0xb4)]!==0x1?'s':'')+_0x2b1eb9(0xb7)+_0x20c1ee['from']+'-'+_0x20c1ee['to']+')');const _0x2af158=_0x20c1ee[_0x2b1eb9(0x68)]['map'](_0x27fff0=>({'job_id':_0x27fff0[_0x2b1eb9(0x83)],'type':_0x27fff0[_0x2b1eb9(0xea)],'status':_0x27fff0['status'],'scheduled_at':_0x27fff0[_0x2b1eb9(0x9c)],'created_at':_0x27fff0['created_at'],'start_at':_0x27fff0[_0x2b1eb9(0xa4)],'end_at':_0x27fff0[_0x2b1eb9(0x88)]}));return await handleSDKOutput(_0x2af158,_0xec5778),0x0;}}
@@ -1 +1 @@
1
- const a27_0x14b939=a27_0x382a;(function(_0x38f667,_0x56beb4){const _0x5916d1=a27_0x382a,_0x183189=_0x38f667();while(!![]){try{const _0x2f52f4=parseInt(_0x5916d1(0x266))/0x1+-parseInt(_0x5916d1(0x200))/0x2+-parseInt(_0x5916d1(0x227))/0x3*(-parseInt(_0x5916d1(0x265))/0x4)+-parseInt(_0x5916d1(0x26f))/0x5*(parseInt(_0x5916d1(0x23e))/0x6)+-parseInt(_0x5916d1(0x216))/0x7*(parseInt(_0x5916d1(0x21e))/0x8)+-parseInt(_0x5916d1(0x21f))/0x9*(-parseInt(_0x5916d1(0x257))/0xa)+-parseInt(_0x5916d1(0x207))/0xb*(-parseInt(_0x5916d1(0x22e))/0xc);if(_0x2f52f4===_0x56beb4)break;else _0x183189['push'](_0x183189['shift']());}catch(_0x2d8db8){_0x183189['push'](_0x183189['shift']());}}}(a27_0x2cce,0x1b84a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x43b323 from'chalk';function a27_0x382a(_0x2513a7,_0x1d32d4){_0x2513a7=_0x2513a7-0x1dd;const _0x2cce8d=a27_0x2cce();let _0x382a1b=_0x2cce8d[_0x2513a7];return _0x382a1b;}async function resolveSegmentTarget(_0x3d406c,_0x8f9824,_0x856595){const _0x3187d3=a27_0x382a;if(isYamlFilePath(_0x3d406c))try{const _0x4ed85d=await resolveYamlFilePath(_0x3d406c);return _0x856595&&(console['error'](_0x3187d3(0x236)+_0x3d406c),console['error'](_0x3187d3(0x219)+_0x4ed85d[_0x3187d3(0x228)]),console[_0x3187d3(0x275)](_0x3187d3(0x210)+_0x4ed85d[_0x3187d3(0x20d)]),console[_0x3187d3(0x275)]('\x20\x20Folder\x20path:\x20'+(_0x4ed85d[_0x3187d3(0x223)]||_0x3187d3(0x201))),console[_0x3187d3(0x275)]('\x20\x20Full\x20path:\x20'+_0x4ed85d[_0x3187d3(0x27c)])),_0x4ed85d[_0x3187d3(0x27c)];}catch(_0x34ed1f){throw new SDKError(ErrorCode[_0x3187d3(0x21c)],_0x3187d3(0x273)+_0x34ed1f[_0x3187d3(0x256)]);}if(!_0x8f9824)throw new SDKError(ErrorCode[_0x3187d3(0x21c)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x8f9824+'/'+_0x3d406c;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x14b939(0x262)]=a27_0x14b939(0x271);[a27_0x14b939(0x247)]=a27_0x14b939(0x213);async[a27_0x14b939(0x1fd)](_0x50795a){const _0x5a7d1e=a27_0x14b939,{options:_0x22ffbf,args:_0x410392,tdx:_0x13af53}=_0x50795a,_0x4dad62=_0x410392[0x0],_0x387a64=!_0x4dad62&&!!_0x22ffbf[_0x5a7d1e(0x228)],_0x8bed4c=_0x4dad62||_0x22ffbf['parentSegment'];if(!_0x8bed4c)return console[_0x5a7d1e(0x275)](_0x5a7d1e(0x212)),console[_0x5a7d1e(0x275)](_0x5a7d1e(0x1df)),console[_0x5a7d1e(0x275)](_0x5a7d1e(0x244)),console['error'](_0x5a7d1e(0x221)),console[_0x5a7d1e(0x275)](_0x5a7d1e(0x203)),console[_0x5a7d1e(0x275)](_0x5a7d1e(0x26b)),console['error'](_0x5a7d1e(0x1dd)),0x1;try{const _0x1785e0=_0x22ffbf[_0x5a7d1e(0x202)];let _0x57132d=_0x8bed4c;!_0x387a64&&_0x1785e0&&!_0x8bed4c['includes']('/')&&(_0x57132d=_0x1785e0+'/'+_0x8bed4c,_0x22ffbf[_0x5a7d1e(0x234)]&&console[_0x5a7d1e(0x275)]('Resolved\x20relative\x20path\x20to:\x20'+_0x57132d));const _0x3469c7=await withSpinner(_0x5a7d1e(0x268)+_0x57132d+_0x5a7d1e(0x238),()=>_0x13af53['segment'][_0x5a7d1e(0x1fe)](_0x57132d),{'verbose':_0x22ffbf[_0x5a7d1e(0x234)]}),_0x510b99=_0x3469c7[_0x5a7d1e(0x204)];_0x22ffbf[_0x5a7d1e(0x234)]&&(console['error']('Resolved\x20type:\x20'+_0x510b99[_0x5a7d1e(0x1e2)]),console['error']('Parent\x20ID:\x20'+_0x510b99[_0x5a7d1e(0x208)]),_0x510b99[_0x5a7d1e(0x22a)]&&console[_0x5a7d1e(0x275)](_0x5a7d1e(0x1e8)+_0x510b99[_0x5a7d1e(0x22a)]),_0x510b99[_0x5a7d1e(0x274)]&&console[_0x5a7d1e(0x275)](_0x5a7d1e(0x260)+_0x510b99[_0x5a7d1e(0x274)]));if(_0x510b99['type']===_0x5a7d1e(0x20f)){const _0x203f14=await withSpinner(_0x5a7d1e(0x232),()=>_0x13af53[_0x5a7d1e(0x269)]['getParent'](_0x510b99[_0x5a7d1e(0x208)]),{'verbose':_0x22ffbf[_0x5a7d1e(0x234)]});await handleSingleObjectOutput(_0x203f14['data'],_0x22ffbf);}else{if(_0x510b99[_0x5a7d1e(0x1e2)]===_0x5a7d1e(0x230)){if(!_0x510b99['folderId'])throw new SDKError(ErrorCode[_0x5a7d1e(0x1fa)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4b4d98=await withSpinner(_0x5a7d1e(0x1e4),()=>_0x13af53['segment'][_0x5a7d1e(0x251)](_0x510b99[_0x5a7d1e(0x22a)]),{'verbose':_0x22ffbf[_0x5a7d1e(0x234)]});await handleSingleObjectOutput(_0x4b4d98[_0x5a7d1e(0x204)],_0x22ffbf);}else{if(_0x510b99[_0x5a7d1e(0x1e2)]==='segment'){if(!_0x510b99[_0x5a7d1e(0x274)])throw new SDKError(ErrorCode[_0x5a7d1e(0x26c)],_0x5a7d1e(0x1e5));const _0x2f9a50=await withSpinner(_0x5a7d1e(0x20a),()=>_0x13af53[_0x5a7d1e(0x269)][_0x5a7d1e(0x225)](_0x510b99['parentId'],_0x510b99[_0x5a7d1e(0x274)]),{'verbose':_0x22ffbf[_0x5a7d1e(0x234)]});await handleSingleObjectOutput(_0x2f9a50[_0x5a7d1e(0x204)],_0x22ffbf);}}}return 0x0;}catch(_0x549a94){if(_0x549a94 instanceof SDKError)return console[_0x5a7d1e(0x275)]('Error:\x20'+_0x549a94[_0x5a7d1e(0x256)]),_0x549a94[_0x5a7d1e(0x272)]&&console['error'](_0x5a7d1e(0x220)+_0x549a94[_0x5a7d1e(0x272)]),0x1;throw _0x549a94;}}}export class SegmentShowCommand extends BaseCommand{['name']='segment:show';[a27_0x14b939(0x247)]=a27_0x14b939(0x25f);async[a27_0x14b939(0x1fd)](_0x2ffba6){const _0x1aeaec=a27_0x14b939,{options:_0x28d071,args:_0x1936ee,tdx:_0x14ef6c}=_0x2ffba6,_0x1bd554=_0x1936ee[0x0];if(!_0x1bd554)return console[_0x1aeaec(0x275)](_0x1aeaec(0x267)),console['error'](_0x1aeaec(0x224)),console['error'](_0x1aeaec(0x270)),console[_0x1aeaec(0x275)](_0x1aeaec(0x244)),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console['error'](_0x1aeaec(0x24c)),0x1;try{const _0x2ff33a=_0x28d071['parentSegment'],_0x397749=await resolveSegmentTarget(_0x1bd554,_0x2ff33a,_0x28d071[_0x1aeaec(0x234)]);_0x28d071[_0x1aeaec(0x234)]&&console[_0x1aeaec(0x275)](_0x1aeaec(0x242)+_0x397749);const _0x3f31f0=await withSpinner('Resolving\x20\x27'+_0x1bd554+_0x1aeaec(0x238),()=>_0x14ef6c[_0x1aeaec(0x269)][_0x1aeaec(0x1fe)](_0x397749),{'verbose':_0x28d071[_0x1aeaec(0x234)]}),_0x2b0bc5=_0x3f31f0[_0x1aeaec(0x204)];_0x28d071[_0x1aeaec(0x234)]&&(console[_0x1aeaec(0x275)](_0x1aeaec(0x240)+_0x2b0bc5[_0x1aeaec(0x1e2)]),console[_0x1aeaec(0x275)]('Parent\x20ID:\x20'+_0x2b0bc5[_0x1aeaec(0x208)]));if(_0x2b0bc5[_0x1aeaec(0x1e2)]==='folder')return console[_0x1aeaec(0x275)](_0x1aeaec(0x278)),console[_0x1aeaec(0x275)](_0x1aeaec(0x20c)),0x1;if(_0x2b0bc5['type']===_0x1aeaec(0x20f))return console[_0x1aeaec(0x275)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x1aeaec(0x275)](_0x1aeaec(0x21b)),0x1;if(!_0x2b0bc5['segmentId'])throw new SDKError(ErrorCode[_0x1aeaec(0x26c)],_0x1aeaec(0x1e5));const _0x473a1f=await withSpinner(_0x1aeaec(0x259),()=>_0x14ef6c[_0x1aeaec(0x269)][_0x1aeaec(0x22b)](_0x2b0bc5['parentId'],_0x2b0bc5[_0x1aeaec(0x274)]),{'verbose':_0x28d071[_0x1aeaec(0x234)]});let _0x16a31d=_0x473a1f[_0x1aeaec(0x204)];const _0x759c9b=resolveLimit(_0x28d071['limit'],DEFAULT_DISPLAY_LIMIT),_0x5a151d=/\bLIMIT\s+\d+/i[_0x1aeaec(0x24d)](_0x16a31d);!_0x5a151d&&(_0x16a31d=_0x16a31d[_0x1aeaec(0x263)]()[_0x1aeaec(0x1e7)](/;+$/,''),_0x16a31d=_0x1aeaec(0x261)+_0x16a31d+_0x1aeaec(0x276)+_0x759c9b);_0x28d071[_0x1aeaec(0x234)]&&console[_0x1aeaec(0x275)](_0x1aeaec(0x26d)+_0x16a31d);const _0x3ad3bf=await withProgressSpinner(_0x1aeaec(0x254),async _0x333322=>{const _0x305447=_0x1aeaec,_0x13f797=await _0x14ef6c[_0x305447(0x264)][_0x305447(0x1fd)](_0x16a31d,{'catalog':'td','schema':'information_schema','onJobId':_0x2cc2f7=>{const _0x872481=_0x305447;_0x333322[_0x872481(0x1f8)](_0x2cc2f7);}});return _0x13f797;},{'verbose':_0x28d071[_0x1aeaec(0x234)]}),_0x2bccd6=_0x3ad3bf[_0x1aeaec(0x204)],_0x378069=_0x2bccd6[_0x1aeaec(0x21d)]?_0x1aeaec(0x20b)+_0x2bccd6[_0x1aeaec(0x21d)]+']':'';return console['error'](_0x1aeaec(0x1f0)+_0x2bccd6[_0x1aeaec(0x1fc)][_0x1aeaec(0x1f7)][_0x1aeaec(0x26a)]()+_0x1aeaec(0x241)+(_0x1aeaec(0x23d)+formatElapsed(_0x2bccd6['stats'][_0x1aeaec(0x1f3)])+_0x378069)),await handleQueryOutput(_0x2bccd6,_0x28d071),0x0;}catch(_0x559680){if(_0x559680 instanceof SDKError)return console[_0x1aeaec(0x275)]('βœ–\x20Query\x20failed\x20['+_0x559680[_0x1aeaec(0x27d)]+']'),console[_0x1aeaec(0x275)]('\x0a'+_0x559680[_0x1aeaec(0x256)]),0x1;throw _0x559680;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x14b939(0x258);[a27_0x14b939(0x247)]=a27_0x14b939(0x22d);async[a27_0x14b939(0x1fd)](_0x22f61f){const _0x383c6e=a27_0x14b939,{options:_0x4ec22e,args:_0x34d789,tdx:_0x482d00}=_0x22f61f;if(_0x34d789[_0x383c6e(0x25b)]===0x0)return console[_0x383c6e(0x275)](_0x383c6e(0x1f1)),console[_0x383c6e(0x275)](_0x383c6e(0x27b)),0x1;const _0x4eadcb=_0x34d789[0x0];try{_0x4ec22e[_0x383c6e(0x234)]&&(console[_0x383c6e(0x275)]('Site:\x20'+_0x4ec22e[_0x383c6e(0x209)]),console[_0x383c6e(0x275)](_0x383c6e(0x205)+_0x4eadcb));const _0x586801=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4eadcb+'\x27...',()=>_0x482d00['segment'][_0x383c6e(0x1ea)](_0x4eadcb),{'verbose':_0x4ec22e[_0x383c6e(0x234)]}),_0x1d3ff8=_0x586801['data'];_0x4ec22e['verbose']&&console[_0x383c6e(0x275)]('Resolved\x20parent\x20ID:\x20'+_0x1d3ff8);const _0x31db9b=await withSpinner(_0x383c6e(0x211)+_0x4eadcb+_0x383c6e(0x238),()=>_0x482d00[_0x383c6e(0x269)][_0x383c6e(0x23c)](_0x1d3ff8),{'verbose':_0x4ec22e[_0x383c6e(0x234)]}),_0x5a333a=_0x31db9b[_0x383c6e(0x204)];return console['error'](_0x383c6e(0x27a)+_0x5a333a[_0x383c6e(0x25b)]+_0x383c6e(0x235)+(_0x5a333a[_0x383c6e(0x25b)]!==0x1?'s':'')),await handleSDKOutput(_0x5a333a,_0x4ec22e),0x0;}catch(_0xd5b549){if(_0xd5b549 instanceof SDKError)return console[_0x383c6e(0x275)](_0x383c6e(0x239)+_0xd5b549['message']),_0xd5b549[_0x383c6e(0x272)]&&console[_0x383c6e(0x275)](_0x383c6e(0x220)+_0xd5b549[_0x383c6e(0x272)]),0x1;throw _0xd5b549;}}}function a27_0x2cce(){const _0x4e1c58=['\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','data','Parent\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','55mZzYNs','parentId','site','Fetching\x20segment\x20details...','\x20[Job\x20ID:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segmentName','\x27\x20with\x20ID:\x20','parent','\x20\x20Segment\x20name:\x20','Listing\x20folders\x20for\x20parent\x20\x27','Error:\x20Path\x20or\x20name\x20is\x20required','Show\x20segment\x20or\x20folder\x20details','βœ”\x20Created\x20folder\x20\x27','/e/','7iZUVGt','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','log','\x20\x20Parent\x20segment:\x20','Resolved\x20parent\x20ID:\x20','Use:\x20tdx\x20ps\x20show','INVALID_ARGUMENT','jobId','804200GgCqvW','39168rtRzRE','\x20\x20Cause:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','folderPath','Usage:\x20tdx\x20sg\x20show\x20<name>','getSegment','Use:\x20tdx\x20ps\x20view','18BlNmye','parentSegment','segment:folder:show','folderId','getSegmentSQL','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','345084JsOWAv','\x20Opening\x20','folder','Show\x20child\x20segment\x20schema\x20(column\x20types)','Fetching\x20parent\x20segment\x20details...','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','verbose','\x20folder','Resolved\x20YAML\x20file:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x27...','Error:\x20','web','Create\x20segment\x20folder\x20for\x20organization','listFolders','in\x20','12FQzFSg','Show\x20folder\x20or\x20child\x20segment\x20details','Resolved\x20type:\x20','\x20rows\x20','Target\x20path:\x20','Resolving\x20parent\x20folder\x20\x27','Examples:','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Folder\x20name:\x20','description','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Resolving\x20folder\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','test','Use:\x20tdx\x20ps\x20view\x20-w','jsonl','Use:\x20tdx\x20ps\x20sql','getFolder','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Site:\x20','Executing\x20segment\x20query...','Error:\x20Folder\x20reference\x20is\x20required','message','40kYVXUW','segment:folder:list','Fetching\x20SQL\x20for\x20segment...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','length','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','resolveFolderId','/app/ps/','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Segment\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','name','trim','query','27044sfhYwr','120824yNgelX','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Resolving\x20path\x20\x27','segment','toLocaleString','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','SEGMENT_NOT_FOUND','SQL\x20query:\x0a','createFolder','112895ujaAXX','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:describe','cause','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segmentId','error','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','βœ”\x20Found\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','fullPath','code','Creating\x20folder\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Parent\x20ID:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','type','Show\x20segment\x20folder\x20details','Fetching\x20folder\x20details...','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Folder\x20ID\x20missing\x20from\x20resolved\x20path','replace','Folder\x20ID:\x20','format','resolveParentId','Usage:\x20tdx\x20sg\x20desc\x20<name>','parentFolder','Parent\x20segment:\x20','Resolving\x20\x27','segment:folder:create','βœ”\x20Query\x20completed:\x20Processed\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','elapsedTimeMillis','Use:\x20tdx\x20ps\x20desc','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','green','processedRows','setJobId','Resolved\x20folder\x20ID:\x20','SEGMENT_FOLDER_NOT_FOUND','segment:sql','stats','execute','resolvePathToResource','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','128372CEBGNJ','(root)','segmentPath'];a27_0x2cce=function(){return _0x4e1c58;};return a27_0x2cce();}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x14b939(0x262)]=a27_0x14b939(0x229);[a27_0x14b939(0x247)]=a27_0x14b939(0x1e3);async['execute'](_0x2af68c){const _0x3b634f=a27_0x14b939,{options:_0xac476f,args:_0x447427,tdx:_0x3dcd25}=_0x2af68c;if(_0x447427[_0x3b634f(0x25b)]===0x0)return console[_0x3b634f(0x275)](_0x3b634f(0x255)),console['error'](_0x3b634f(0x1f2)),0x1;try{const {parentId:_0x5f2ed2,childId:_0x3ec82a}=parseSegmentRef(_0x447427[0x0]);_0xac476f[_0x3b634f(0x234)]&&(console[_0x3b634f(0x275)](_0x3b634f(0x253)+_0xac476f['site']),console['error'](_0x3b634f(0x205)+_0x5f2ed2),_0x3ec82a&&console[_0x3b634f(0x275)](_0x3b634f(0x246)+_0x3ec82a));if(!_0x3ec82a)return console['error'](_0x3b634f(0x237)),0x1;const _0x2bc656=await withSpinner(_0x3b634f(0x1e0)+_0x5f2ed2+_0x3b634f(0x238),()=>_0x3dcd25[_0x3b634f(0x269)][_0x3b634f(0x1ea)](_0x5f2ed2),{'verbose':_0xac476f[_0x3b634f(0x234)]}),_0xe26fc=_0x2bc656[_0x3b634f(0x204)];_0xac476f[_0x3b634f(0x234)]&&console[_0x3b634f(0x275)](_0x3b634f(0x21a)+_0xe26fc);const _0x1a3064=await withSpinner(_0x3b634f(0x24a)+_0x3ec82a+_0x3b634f(0x238),()=>_0x3dcd25[_0x3b634f(0x269)][_0x3b634f(0x25d)](_0xe26fc,_0x3ec82a),{'verbose':_0xac476f[_0x3b634f(0x234)]}),_0x4aa3d5=_0x1a3064[_0x3b634f(0x204)];_0xac476f[_0x3b634f(0x234)]&&console[_0x3b634f(0x275)](_0x3b634f(0x1f9)+_0x4aa3d5);const _0x3a656c=await withSpinner('Fetching\x20folder\x20\x27'+_0x3ec82a+_0x3b634f(0x238),()=>_0x3dcd25[_0x3b634f(0x269)][_0x3b634f(0x251)](_0x4aa3d5),{'verbose':_0xac476f[_0x3b634f(0x234)]});return await handleSDKOutput([_0x3a656c[_0x3b634f(0x204)]],_0xac476f),0x0;}catch(_0x57ddc6){if(_0x57ddc6 instanceof SDKError)return console[_0x3b634f(0x275)](_0x3b634f(0x239)+_0x57ddc6[_0x3b634f(0x256)]),_0x57ddc6[_0x3b634f(0x272)]&&console[_0x3b634f(0x275)](_0x3b634f(0x220)+_0x57ddc6[_0x3b634f(0x272)]),0x1;throw _0x57ddc6;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x14b939(0x262)]=a27_0x14b939(0x1fb);['description']='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x14b939(0x1fd)](_0x24f184){const _0x2bdd8e=a27_0x14b939,{options:_0x521abe,args:_0xe232aa,tdx:_0xbfaaac}=_0x24f184,_0x3c7317=_0xe232aa[0x0];if(!_0x3c7317)return console[_0x2bdd8e(0x275)](_0x2bdd8e(0x267)),console[_0x2bdd8e(0x275)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x249)),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x244)),console['error']('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x2bdd8e(0x275)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x42c150=_0x521abe[_0x2bdd8e(0x228)],_0x3e3908=await resolveSegmentTarget(_0x3c7317,_0x42c150,_0x521abe[_0x2bdd8e(0x234)]);_0x521abe[_0x2bdd8e(0x234)]&&console[_0x2bdd8e(0x275)](_0x2bdd8e(0x242)+_0x3e3908);const _0x4e6045=await withSpinner(_0x2bdd8e(0x1ee)+_0x3c7317+_0x2bdd8e(0x238),()=>_0xbfaaac[_0x2bdd8e(0x269)][_0x2bdd8e(0x1fe)](_0x3e3908),{'verbose':_0x521abe[_0x2bdd8e(0x234)]}),_0x20d7d1=_0x4e6045[_0x2bdd8e(0x204)];_0x521abe[_0x2bdd8e(0x234)]&&(console['error'](_0x2bdd8e(0x240)+_0x20d7d1[_0x2bdd8e(0x1e2)]),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x1de)+_0x20d7d1[_0x2bdd8e(0x208)]));if(_0x20d7d1[_0x2bdd8e(0x1e2)]===_0x2bdd8e(0x230))return console['error'](_0x2bdd8e(0x277)),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x24b)),0x1;if(_0x20d7d1[_0x2bdd8e(0x1e2)]===_0x2bdd8e(0x20f))return console['error'](_0x2bdd8e(0x279)),console[_0x2bdd8e(0x275)](_0x2bdd8e(0x250)),0x1;if(!_0x20d7d1['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x3c3a3a=await withSpinner(_0x2bdd8e(0x259),()=>_0xbfaaac[_0x2bdd8e(0x269)][_0x2bdd8e(0x22b)](_0x20d7d1[_0x2bdd8e(0x208)],_0x20d7d1[_0x2bdd8e(0x274)]),{'verbose':_0x521abe['verbose']}),_0x325021=_0x3c3a3a[_0x2bdd8e(0x204)];return _0x521abe['format']==='json'||_0x521abe[_0x2bdd8e(0x1e9)]===_0x2bdd8e(0x24f)?await handleSDKOutput([{'sql':_0x325021}],_0x521abe):console[_0x2bdd8e(0x218)](_0x325021),0x0;}catch(_0x593e80){if(_0x593e80 instanceof SDKError)return console[_0x2bdd8e(0x275)]('Error:\x20'+_0x593e80[_0x2bdd8e(0x256)]),_0x593e80[_0x2bdd8e(0x272)]&&console[_0x2bdd8e(0x275)]('\x20\x20Cause:\x20'+_0x593e80[_0x2bdd8e(0x272)]),0x1;throw _0x593e80;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x14b939(0x262)]=a27_0x14b939(0x1ef);[a27_0x14b939(0x247)]=a27_0x14b939(0x23b);async[a27_0x14b939(0x1fd)](_0x3e7aa4){const _0x59cc22=a27_0x14b939,{options:_0x532667,args:_0x3f6072,tdx:_0xa1daba}=_0x3e7aa4,_0x47ca05=_0x532667;if(_0x3f6072[_0x59cc22(0x25b)]<0x2)return console[_0x59cc22(0x275)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error'](_0x59cc22(0x206)),0x1;const _0x3ee98c=_0x3f6072[0x0],_0x1efae1=_0x3f6072[0x1];_0x47ca05[_0x59cc22(0x234)]&&(console[_0x59cc22(0x275)](_0x59cc22(0x253)+_0x47ca05[_0x59cc22(0x209)]),console[_0x59cc22(0x275)](_0x59cc22(0x1ed)+_0x3ee98c),console[_0x59cc22(0x275)]('Folder\x20name:\x20'+_0x1efae1));let _0x34e9cf;if(_0x47ca05[_0x59cc22(0x1ec)]){const _0x33ae49=_0x47ca05[_0x59cc22(0x1ec)],_0x308ef8=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3ee98c+_0x59cc22(0x238),()=>_0xa1daba[_0x59cc22(0x269)][_0x59cc22(0x1ea)](_0x3ee98c),{'verbose':_0x47ca05[_0x59cc22(0x234)]}),_0x195fdc=_0x308ef8[_0x59cc22(0x204)],_0x3d3a8e=await withSpinner(_0x59cc22(0x243)+_0x33ae49+_0x59cc22(0x238),()=>_0xa1daba[_0x59cc22(0x269)]['resolveFolderId'](_0x195fdc,_0x33ae49),{'verbose':_0x47ca05[_0x59cc22(0x234)]});_0x34e9cf=_0x3d3a8e[_0x59cc22(0x204)],_0x47ca05[_0x59cc22(0x234)]&&console[_0x59cc22(0x275)](_0x59cc22(0x248)+_0x34e9cf);}const _0x19fcc7={'name':_0x1efae1,'description':_0x47ca05[_0x59cc22(0x247)],'parentFolderId':_0x34e9cf},_0x31634f=await withSpinner(_0x59cc22(0x27e)+_0x1efae1+'\x27...',()=>_0xa1daba['segment'][_0x59cc22(0x26e)](_0x3ee98c,_0x19fcc7),{'verbose':_0x47ca05[_0x59cc22(0x234)]}),_0x3b4b40=_0x31634f[_0x59cc22(0x204)];return console[_0x59cc22(0x275)](_0x59cc22(0x214)+_0x3b4b40[_0x59cc22(0x262)]+_0x59cc22(0x20e)+_0x3b4b40['id']),await handleSDKOutput([_0x3b4b40],_0x47ca05),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x14b939(0x262)]='segment:view';[a27_0x14b939(0x247)]=a27_0x14b939(0x23f);async['execute'](_0x442a9a){const _0x2a66d5=a27_0x14b939,{options:_0x186f7b,args:_0x6de5dd,tdx:_0x1a809e}=_0x442a9a,_0x58265f=_0x6de5dd[0x0];if(!_0x58265f)return console[_0x2a66d5(0x275)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x2a66d5(0x275)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x2a66d5(0x275)](_0x2a66d5(0x1f5)),console['error']('Options:'),console[_0x2a66d5(0x275)](_0x2a66d5(0x22c)),console[_0x2a66d5(0x275)](_0x2a66d5(0x244)),console['error'](_0x2a66d5(0x222)),console[_0x2a66d5(0x275)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x2a66d5(0x1e1)),console['error'](_0x2a66d5(0x233)),0x1;try{const _0x40cb36=_0x186f7b['parentSegment'],_0xff74c9=await resolveSegmentTarget(_0x58265f,_0x40cb36,_0x186f7b[_0x2a66d5(0x234)]);_0x186f7b[_0x2a66d5(0x234)]&&console[_0x2a66d5(0x275)](_0x2a66d5(0x242)+_0xff74c9);const _0x4ac5d8=await withSpinner(_0x2a66d5(0x1ee)+_0x58265f+_0x2a66d5(0x238),()=>_0x1a809e[_0x2a66d5(0x269)][_0x2a66d5(0x1fe)](_0xff74c9),{'verbose':_0x186f7b[_0x2a66d5(0x234)]}),_0x304036=_0x4ac5d8[_0x2a66d5(0x204)];_0x186f7b[_0x2a66d5(0x234)]&&(console[_0x2a66d5(0x275)](_0x2a66d5(0x240)+_0x304036[_0x2a66d5(0x1e2)]),console['error'](_0x2a66d5(0x1de)+_0x304036[_0x2a66d5(0x208)]),_0x304036[_0x2a66d5(0x22a)]&&console[_0x2a66d5(0x275)](_0x2a66d5(0x1e8)+_0x304036[_0x2a66d5(0x22a)]),_0x304036[_0x2a66d5(0x274)]&&console['error'](_0x2a66d5(0x260)+_0x304036['segmentId']));if(_0x186f7b[_0x2a66d5(0x23a)]){if(_0x304036['type']===_0x2a66d5(0x230))return console['error'](_0x2a66d5(0x245)),0x1;if(_0x304036['type']===_0x2a66d5(0x20f))return console[_0x2a66d5(0x275)](_0x2a66d5(0x25c)),console[_0x2a66d5(0x275)](_0x2a66d5(0x24e)),0x1;if(!_0x304036[_0x2a66d5(0x274)])throw new SDKError(ErrorCode[_0x2a66d5(0x26c)],_0x2a66d5(0x1e5));const _0x1cc75c=getConsoleNextUrl(_0x186f7b[_0x2a66d5(0x209)],'/app/ps/'+_0x304036['parentId']+_0x2a66d5(0x215)+_0x304036[_0x2a66d5(0x274)]);return console[_0x2a66d5(0x275)](a27_0x43b323[_0x2a66d5(0x1f6)]('βœ”')+_0x2a66d5(0x22f)+a27_0x43b323['cyan'](_0x1cc75c)),openBrowser(_0x1cc75c),0x0;}if(_0x304036[_0x2a66d5(0x1e2)]==='folder'){if(!_0x304036[_0x2a66d5(0x22a)])throw new SDKError(ErrorCode[_0x2a66d5(0x1fa)],_0x2a66d5(0x1e6));const _0x9a5fe0=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1a809e[_0x2a66d5(0x269)][_0x2a66d5(0x251)](_0x304036[_0x2a66d5(0x22a)]),{'verbose':_0x186f7b[_0x2a66d5(0x234)]});await handleSingleObjectOutput(_0x9a5fe0[_0x2a66d5(0x204)],_0x186f7b);}else{if(_0x304036[_0x2a66d5(0x1e2)]===_0x2a66d5(0x269)){if(!_0x304036[_0x2a66d5(0x274)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2a66d5(0x1e5));const _0x3f7587=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1a809e[_0x2a66d5(0x269)]['getSegment'](_0x304036[_0x2a66d5(0x208)],_0x304036[_0x2a66d5(0x274)]),{'verbose':_0x186f7b[_0x2a66d5(0x234)]}),_0x4e0a9f=getConsoleNextUrl(_0x186f7b[_0x2a66d5(0x209)],_0x2a66d5(0x25e)+_0x304036['parentId']+'/e/'+_0x304036[_0x2a66d5(0x274)]),_0x3df02b=_0x3f7587['data'];_0x3df02b['url']=_0x4e0a9f,await handleSingleObjectOutput(_0x3df02b,_0x186f7b);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x2a66d5(0x226)),0x1;}return 0x0;}catch(_0x1b3cb6){if(_0x1b3cb6 instanceof SDKError)return console['error'](_0x2a66d5(0x239)+_0x1b3cb6[_0x2a66d5(0x256)]),_0x1b3cb6[_0x2a66d5(0x272)]&&console['error'](_0x2a66d5(0x220)+_0x1b3cb6[_0x2a66d5(0x272)]),0x1;throw _0x1b3cb6;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']='segment:desc';[a27_0x14b939(0x247)]=a27_0x14b939(0x231);async[a27_0x14b939(0x1fd)](_0x36ff40){const _0x508b5a=a27_0x14b939,{options:_0x6526e9,args:_0x344f36,tdx:_0x3b5b06}=_0x36ff40,_0x5c8ef2=_0x344f36[0x0];if(!_0x5c8ef2)return console[_0x508b5a(0x275)](_0x508b5a(0x267)),console[_0x508b5a(0x275)](_0x508b5a(0x1eb)),console['error'](_0x508b5a(0x25a)),console['error'](_0x508b5a(0x244)),console[_0x508b5a(0x275)](_0x508b5a(0x217)),console[_0x508b5a(0x275)](_0x508b5a(0x1ff)),0x1;try{const _0x2641fa=_0x6526e9['parentSegment'],_0x39ff9f=await resolveSegmentTarget(_0x5c8ef2,_0x2641fa,_0x6526e9['verbose']);_0x6526e9['verbose']&&console['error'](_0x508b5a(0x242)+_0x39ff9f);const _0x4d539f=await withSpinner(_0x508b5a(0x1ee)+_0x5c8ef2+_0x508b5a(0x238),()=>_0x3b5b06[_0x508b5a(0x269)][_0x508b5a(0x1fe)](_0x39ff9f),{'verbose':_0x6526e9['verbose']}),_0x209673=_0x4d539f[_0x508b5a(0x204)];_0x6526e9[_0x508b5a(0x234)]&&(console[_0x508b5a(0x275)](_0x508b5a(0x240)+_0x209673[_0x508b5a(0x1e2)]),console[_0x508b5a(0x275)]('Parent\x20ID:\x20'+_0x209673['parentId']));if(_0x209673[_0x508b5a(0x1e2)]==='folder')return console['error']('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x508b5a(0x275)](_0x508b5a(0x24b)),0x1;if(_0x209673[_0x508b5a(0x1e2)]===_0x508b5a(0x20f))return console[_0x508b5a(0x275)](_0x508b5a(0x252)),console[_0x508b5a(0x275)](_0x508b5a(0x1f4)),0x1;if(!_0x209673[_0x508b5a(0x274)])throw new SDKError(ErrorCode[_0x508b5a(0x26c)],_0x508b5a(0x1e5));const _0x5269ae=await withSpinner(_0x508b5a(0x259),()=>_0x3b5b06['segment'][_0x508b5a(0x22b)](_0x209673[_0x508b5a(0x208)],_0x209673[_0x508b5a(0x274)]),{'verbose':_0x6526e9[_0x508b5a(0x234)]}),_0x15ced4=_0x5269ae[_0x508b5a(0x204)],_0x5aa172=await executeSchemaQuery(_0x15ced4,_0x3b5b06,_0x6526e9);return await handleQueryOutput(_0x5aa172,_0x6526e9),0x0;}catch(_0x51de0c){if(_0x51de0c instanceof SDKError)return console[_0x508b5a(0x275)](_0x508b5a(0x239)+_0x51de0c[_0x508b5a(0x256)]),_0x51de0c['cause']&&console['error'](_0x508b5a(0x220)+_0x51de0c[_0x508b5a(0x272)]),0x1;throw _0x51de0c;}}}
1
+ const a27_0x41eeed=a27_0x2981;(function(_0x567675,_0x383d79){const _0x58e37a=a27_0x2981,_0xd735e7=_0x567675();while(!![]){try{const _0x5732f9=-parseInt(_0x58e37a(0x74))/0x1+parseInt(_0x58e37a(0x8a))/0x2+-parseInt(_0x58e37a(0xdc))/0x3+parseInt(_0x58e37a(0x94))/0x4+-parseInt(_0x58e37a(0x72))/0x5+-parseInt(_0x58e37a(0x82))/0x6*(-parseInt(_0x58e37a(0xa0))/0x7)+parseInt(_0x58e37a(0x7d))/0x8*(parseInt(_0x58e37a(0x7a))/0x9);if(_0x5732f9===_0x383d79)break;else _0xd735e7['push'](_0xd735e7['shift']());}catch(_0x14c469){_0xd735e7['push'](_0xd735e7['shift']());}}}(a27_0x453a,0x98f9c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x4d374c from'chalk';async function resolveSegmentTarget(_0xc468da,_0x69e26e,_0xe40d38){const _0x1983f0=a27_0x2981;if(isYamlFilePath(_0xc468da))try{const _0x400c3d=await resolveYamlFilePath(_0xc468da);return _0xe40d38&&(console[_0x1983f0(0xb1)](_0x1983f0(0xf4)+_0xc468da),console[_0x1983f0(0xb1)](_0x1983f0(0xad)+_0x400c3d[_0x1983f0(0xef)]),console[_0x1983f0(0xb1)](_0x1983f0(0x80)+_0x400c3d[_0x1983f0(0xe3)]),console[_0x1983f0(0xb1)](_0x1983f0(0x8d)+(_0x400c3d[_0x1983f0(0xf6)]||_0x1983f0(0x87))),console[_0x1983f0(0xb1)](_0x1983f0(0x6a)+_0x400c3d['fullPath'])),_0x400c3d['fullPath'];}catch(_0x3b39ea){throw new SDKError(ErrorCode[_0x1983f0(0x90)],_0x1983f0(0xda)+_0x3b39ea[_0x1983f0(0x97)]);}if(!_0x69e26e)throw new SDKError(ErrorCode[_0x1983f0(0x90)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x69e26e+'/'+_0xc468da;}function a27_0x2981(_0x233369,_0x2baed2){_0x233369=_0x233369-0x69;const _0x453a7b=a27_0x453a();let _0x29811b=_0x453a7b[_0x233369];return _0x29811b;}export class SegmentDescribeCommand extends BaseCommand{['name']=a27_0x41eeed(0x7f);[a27_0x41eeed(0xc9)]=a27_0x41eeed(0x78);async[a27_0x41eeed(0xe0)](_0x2dc1d5){const _0x54b928=a27_0x41eeed,{options:_0x6e79c9,args:_0x35ee87,tdx:_0x5a0906}=_0x2dc1d5,_0x19a7de=_0x35ee87[0x0],_0x2ede9e=!_0x19a7de&&!!_0x6e79c9['parentSegment'],_0x484575=_0x19a7de||_0x6e79c9[_0x54b928(0xef)];if(!_0x484575)return console['error'](_0x54b928(0xd3)),console[_0x54b928(0xb1)](_0x54b928(0x96)),console['error'](_0x54b928(0xfd)),console[_0x54b928(0xb1)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x54b928(0xb1)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x54b928(0xb1)](_0x54b928(0xd8)),console[_0x54b928(0xb1)](_0x54b928(0xc6)),0x1;try{const _0x183864=_0x6e79c9['segmentPath'];let _0x45424e=_0x484575;!_0x2ede9e&&_0x183864&&!_0x484575[_0x54b928(0xbb)]('/')&&(_0x45424e=_0x183864+'/'+_0x484575,_0x6e79c9['verbose']&&console[_0x54b928(0xb1)](_0x54b928(0xba)+_0x45424e));const _0x541c2c=await withSpinner(_0x54b928(0xec)+_0x45424e+_0x54b928(0xc5),()=>_0x5a0906['segment'][_0x54b928(0xd6)](_0x45424e),{'verbose':_0x6e79c9[_0x54b928(0x7e)]}),_0x30834a=_0x541c2c[_0x54b928(0xe6)];_0x6e79c9[_0x54b928(0x7e)]&&(console['error'](_0x54b928(0xaa)+_0x30834a[_0x54b928(0xc0)]),console[_0x54b928(0xb1)](_0x54b928(0x98)+_0x30834a[_0x54b928(0xa1)]),_0x30834a[_0x54b928(0xfb)]&&console['error'](_0x54b928(0x6b)+_0x30834a[_0x54b928(0xfb)]),_0x30834a[_0x54b928(0xdd)]&&console['error'](_0x54b928(0x93)+_0x30834a['segmentId']));if(_0x30834a['type']===_0x54b928(0x89)){const _0x2b7b17=await withSpinner(_0x54b928(0xea),()=>_0x5a0906[_0x54b928(0xd0)][_0x54b928(0xcd)](_0x30834a[_0x54b928(0xa1)]),{'verbose':_0x6e79c9[_0x54b928(0x7e)]});await handleSingleObjectOutput(_0x2b7b17[_0x54b928(0xe6)],_0x6e79c9);}else{if(_0x30834a[_0x54b928(0xc0)]===_0x54b928(0x71)){if(!_0x30834a[_0x54b928(0xfb)])throw new SDKError(ErrorCode[_0x54b928(0xd7)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4e9682=await withSpinner('Fetching\x20folder\x20details...',()=>_0x5a0906[_0x54b928(0xd0)][_0x54b928(0x9f)](_0x30834a[_0x54b928(0xfb)]),{'verbose':_0x6e79c9[_0x54b928(0x7e)]});await handleSingleObjectOutput(_0x4e9682[_0x54b928(0xe6)],_0x6e79c9);}else{if(_0x30834a[_0x54b928(0xc0)]===_0x54b928(0xd0)){if(!_0x30834a[_0x54b928(0xdd)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x54b928(0x79));const _0x5dff89=await withSpinner('Fetching\x20segment\x20details...',()=>_0x5a0906[_0x54b928(0xd0)]['getSegment'](_0x30834a[_0x54b928(0xa1)],_0x30834a['segmentId']),{'verbose':_0x6e79c9['verbose']});await handleSingleObjectOutput(_0x5dff89[_0x54b928(0xe6)],_0x6e79c9);}}}return 0x0;}catch(_0x91745){if(_0x91745 instanceof SDKError)return console[_0x54b928(0xb1)](_0x54b928(0xe7)+_0x91745[_0x54b928(0x97)]),_0x91745['cause']&&console[_0x54b928(0xb1)]('\x20\x20Cause:\x20'+_0x91745[_0x54b928(0xbf)]),0x1;throw _0x91745;}}}function a27_0x453a(){const _0xf7d547=['972UrKQaR','βœ”\x20Found\x20','/e/','Error:\x20Folder\x20reference\x20is\x20required','Usage:\x20tdx\x20sg\x20show\x20<name>','(root)','Executing\x20segment\x20query...','parent','2042816jkQzOY','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20parent\x20folder\x20\x27','\x20\x20Folder\x20path:\x20','replace','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','INVALID_ARGUMENT','Resolving\x20\x27','βœ”\x20Query\x20completed:\x20Processed\x20','Segment\x20ID:\x20','1901628PngITf','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Usage:\x20tdx\x20segment\x20describe\x20<path>','message','Parent\x20ID:\x20','cyan','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20view\x20-w','Folder\x20name:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','url','getFolder','20097tfmscH','parentId','information_schema','segment:view','parentFolder','setJobId','Create\x20segment\x20folder\x20for\x20organization','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Resolved\x20type:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','limit','\x20\x20Parent\x20segment:\x20','query','Use:\x20tdx\x20ps\x20view','segment:sql','error','\x20\x20Cause:\x20','resolveFolderId','in\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','getSegment','Parent\x20name:\x20','segment:desc','Resolved\x20relative\x20path\x20to:\x20','includes','log','βœ–\x20Query\x20failed\x20[','elapsedTimeMillis','cause','type','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Resolved\x20folder\x20ID:\x20','getSegmentSQL','\x27...','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Fetching\x20segment\x20details...','description','Target\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Options:','getParent','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','length','segment','Usage:\x20tdx\x20sg\x20sql\x20<name>','SQL\x20query:\x0a','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','listFolders','resolvePathToResource','SEGMENT_FOLDER_NOT_FOUND','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','SEGMENT_NOT_FOUND','1038840XyjgAe','segmentId','Use:\x20tdx\x20ps\x20sql','Listing\x20folders\x20for\x20parent\x20\x27','execute','/app/ps/','Use:\x20tdx\x20ps\x20show','segmentName','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','jobId','data','Error:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Resolving\x20parent\x20segment\x20\x27','Fetching\x20parent\x20segment\x20details...','trim','Resolving\x20path\x20\x27','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','test','parentSegment','Show\x20segment\x20folder\x20details','jsonl','web','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolved\x20YAML\x20file:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','folderPath','\x20rows\x20','Resolved\x20parent\x20folder\x20ID:\x20','Fetching\x20SQL\x20for\x20segment...','Get\x20SQL\x20query\x20for\x20child\x20segment','folderId','Show\x20child\x20segment\x20schema\x20(column\x20types)','Examples:','createFolder','Site:\x20','format','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Full\x20path:\x20','Folder\x20ID:\x20','Parent\x20segment:\x20','json','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','stats','site','folder','1057415pDvFlx','Show\x20folder\x20or\x20child\x20segment\x20details','1167585YcXIGl','toLocaleString','SELECT\x20*\x20FROM\x20(\x0a','name','Show\x20segment\x20or\x20folder\x20details','Segment\x20ID\x20missing\x20from\x20resolved\x20path','63PSvccv','resolveParentId','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','445736lQzvzK','verbose','segment:describe','\x20\x20Segment\x20name:\x20','Fetching\x20folder\x20details...'];a27_0x453a=function(){return _0xf7d547;};return a27_0x453a();}export class SegmentShowCommand extends BaseCommand{[a27_0x41eeed(0x77)]='segment:show';[a27_0x41eeed(0xc9)]=a27_0x41eeed(0x9d);async['execute'](_0x515c23){const _0x272fd3=a27_0x41eeed,{options:_0xcf659b,args:_0x1644f9,tdx:_0x84f82c}=_0x515c23,_0x5c0025=_0x1644f9[0x0];if(!_0x5c0025)return console[_0x272fd3(0xb1)](_0x272fd3(0xb5)),console[_0x272fd3(0xb1)](_0x272fd3(0x86)),console[_0x272fd3(0xb1)](_0x272fd3(0xa7)),console[_0x272fd3(0xb1)]('Examples:'),console[_0x272fd3(0xb1)](_0x272fd3(0x8f)),console[_0x272fd3(0xb1)](_0x272fd3(0x9a)),0x1;try{const _0x44ac75=_0xcf659b[_0x272fd3(0xef)],_0x3ac1ef=await resolveSegmentTarget(_0x5c0025,_0x44ac75,_0xcf659b[_0x272fd3(0x7e)]);_0xcf659b[_0x272fd3(0x7e)]&&console[_0x272fd3(0xb1)](_0x272fd3(0xca)+_0x3ac1ef);const _0x5797b6=await withSpinner('Resolving\x20\x27'+_0x5c0025+_0x272fd3(0xc5),()=>_0x84f82c[_0x272fd3(0xd0)]['resolvePathToResource'](_0x3ac1ef),{'verbose':_0xcf659b[_0x272fd3(0x7e)]}),_0x1dbd2c=_0x5797b6[_0x272fd3(0xe6)];_0xcf659b[_0x272fd3(0x7e)]&&(console[_0x272fd3(0xb1)]('Resolved\x20type:\x20'+_0x1dbd2c['type']),console['error']('Parent\x20ID:\x20'+_0x1dbd2c[_0x272fd3(0xa1)]));if(_0x1dbd2c[_0x272fd3(0xc0)]==='folder')return console['error'](_0x272fd3(0x95)),console[_0x272fd3(0xb1)](_0x272fd3(0x7c)),0x1;if(_0x1dbd2c[_0x272fd3(0xc0)]===_0x272fd3(0x89))return console[_0x272fd3(0xb1)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x272fd3(0xb1)](_0x272fd3(0xe2)),0x1;if(!_0x1dbd2c[_0x272fd3(0xdd)])throw new SDKError(ErrorCode[_0x272fd3(0xdb)],_0x272fd3(0x79));const _0x5c0f7d=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x84f82c[_0x272fd3(0xd0)]['getSegmentSQL'](_0x1dbd2c[_0x272fd3(0xa1)],_0x1dbd2c[_0x272fd3(0xdd)]),{'verbose':_0xcf659b['verbose']});let _0x512270=_0x5c0f7d[_0x272fd3(0xe6)];const _0x186c32=resolveLimit(_0xcf659b[_0x272fd3(0xac)],DEFAULT_DISPLAY_LIMIT),_0x3fef8a=/\bLIMIT\s+\d+/i[_0x272fd3(0xee)](_0x512270);!_0x3fef8a&&(_0x512270=_0x512270[_0x272fd3(0xeb)]()[_0x272fd3(0x8e)](/;+$/,''),_0x512270=_0x272fd3(0x76)+_0x512270+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x186c32);_0xcf659b[_0x272fd3(0x7e)]&&console[_0x272fd3(0xb1)](_0x272fd3(0xd2)+_0x512270);const _0xcb52f3=await withProgressSpinner(_0x272fd3(0x88),async _0x14b263=>{const _0x210823=_0x272fd3,_0x5caf78=await _0x84f82c[_0x210823(0xae)][_0x210823(0xe0)](_0x512270,{'catalog':'td','schema':_0x210823(0xa2),'onJobId':_0x219907=>{const _0x22343f=_0x210823;_0x14b263[_0x22343f(0xa5)](_0x219907);}});return _0x5caf78;},{'verbose':_0xcf659b[_0x272fd3(0x7e)]}),_0x55b346=_0xcb52f3[_0x272fd3(0xe6)],_0x2b932a=_0x55b346[_0x272fd3(0xe5)]?'\x20[Job\x20ID:\x20'+_0x55b346[_0x272fd3(0xe5)]+']':'';return console['error'](_0x272fd3(0x92)+_0x55b346[_0x272fd3(0x6f)]['processedRows'][_0x272fd3(0x75)]()+_0x272fd3(0xf7)+(_0x272fd3(0xb4)+formatElapsed(_0x55b346[_0x272fd3(0x6f)][_0x272fd3(0xbe)])+_0x2b932a)),await handleQueryOutput(_0x55b346,_0xcf659b),0x0;}catch(_0x386a02){if(_0x386a02 instanceof SDKError)return console['error'](_0x272fd3(0xbd)+_0x386a02['code']+']'),console[_0x272fd3(0xb1)]('\x0a'+_0x386a02[_0x272fd3(0x97)]),0x1;throw _0x386a02;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x41eeed(0x77)]='segment:folder:list';['description']=a27_0x41eeed(0xe8);async[a27_0x41eeed(0xe0)](_0x17dd9b){const _0x5bd477=a27_0x41eeed,{options:_0x1b726b,args:_0x1825d9,tdx:_0x2673d8}=_0x17dd9b;if(_0x1825d9[_0x5bd477(0xcf)]===0x0)return console[_0x5bd477(0xb1)](_0x5bd477(0xf5)),console[_0x5bd477(0xb1)](_0x5bd477(0xb6)),0x1;const _0x3903d6=_0x1825d9[0x0];try{_0x1b726b[_0x5bd477(0x7e)]&&(console[_0x5bd477(0xb1)](_0x5bd477(0xff)+_0x1b726b[_0x5bd477(0x70)]),console[_0x5bd477(0xb1)]('Parent\x20name:\x20'+_0x3903d6));const _0x136287=await withSpinner(_0x5bd477(0xe9)+_0x3903d6+_0x5bd477(0xc5),()=>_0x2673d8[_0x5bd477(0xd0)][_0x5bd477(0x7b)](_0x3903d6),{'verbose':_0x1b726b[_0x5bd477(0x7e)]}),_0x312eee=_0x136287[_0x5bd477(0xe6)];_0x1b726b[_0x5bd477(0x7e)]&&console[_0x5bd477(0xb1)]('Resolved\x20parent\x20ID:\x20'+_0x312eee);const _0x10a4ca=await withSpinner(_0x5bd477(0xdf)+_0x3903d6+_0x5bd477(0xc5),()=>_0x2673d8[_0x5bd477(0xd0)][_0x5bd477(0xd5)](_0x312eee),{'verbose':_0x1b726b[_0x5bd477(0x7e)]}),_0xe712b1=_0x10a4ca['data'];return console[_0x5bd477(0xb1)](_0x5bd477(0x83)+_0xe712b1['length']+'\x20folder'+(_0xe712b1[_0x5bd477(0xcf)]!==0x1?'s':'')),await handleSDKOutput(_0xe712b1,_0x1b726b),0x0;}catch(_0x415f1b){if(_0x415f1b instanceof SDKError)return console[_0x5bd477(0xb1)]('Error:\x20'+_0x415f1b['message']),_0x415f1b['cause']&&console[_0x5bd477(0xb1)](_0x5bd477(0xb2)+_0x415f1b[_0x5bd477(0xbf)]),0x1;throw _0x415f1b;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a27_0x41eeed(0xc9)]=a27_0x41eeed(0xf0);async[a27_0x41eeed(0xe0)](_0x294d4c){const _0x55005e=a27_0x41eeed,{options:_0x4312e9,args:_0x198d87,tdx:_0xef2746}=_0x294d4c;if(_0x198d87['length']===0x0)return console[_0x55005e(0xb1)](_0x55005e(0x85)),console[_0x55005e(0xb1)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x29d8c8,childId:_0x2d8268}=parseSegmentRef(_0x198d87[0x0]);_0x4312e9[_0x55005e(0x7e)]&&(console['error'](_0x55005e(0xff)+_0x4312e9[_0x55005e(0x70)]),console[_0x55005e(0xb1)](_0x55005e(0xb8)+_0x29d8c8),_0x2d8268&&console[_0x55005e(0xb1)]('Folder\x20name:\x20'+_0x2d8268));if(!_0x2d8268)return console[_0x55005e(0xb1)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x11c1b6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x29d8c8+'\x27...',()=>_0xef2746[_0x55005e(0xd0)][_0x55005e(0x7b)](_0x29d8c8),{'verbose':_0x4312e9[_0x55005e(0x7e)]}),_0x588e53=_0x11c1b6[_0x55005e(0xe6)];_0x4312e9[_0x55005e(0x7e)]&&console[_0x55005e(0xb1)]('Resolved\x20parent\x20ID:\x20'+_0x588e53);const _0x4b5f55=await withSpinner('Resolving\x20folder\x20\x27'+_0x2d8268+_0x55005e(0xc5),()=>_0xef2746[_0x55005e(0xd0)][_0x55005e(0xb3)](_0x588e53,_0x2d8268),{'verbose':_0x4312e9['verbose']}),_0x21b3ad=_0x4b5f55[_0x55005e(0xe6)];_0x4312e9[_0x55005e(0x7e)]&&console[_0x55005e(0xb1)](_0x55005e(0xc3)+_0x21b3ad);const _0x5ab010=await withSpinner('Fetching\x20folder\x20\x27'+_0x2d8268+_0x55005e(0xc5),()=>_0xef2746[_0x55005e(0xd0)][_0x55005e(0x9f)](_0x21b3ad),{'verbose':_0x4312e9[_0x55005e(0x7e)]});return await handleSDKOutput([_0x5ab010[_0x55005e(0xe6)]],_0x4312e9),0x0;}catch(_0x46d16f){if(_0x46d16f instanceof SDKError)return console[_0x55005e(0xb1)](_0x55005e(0xe7)+_0x46d16f[_0x55005e(0x97)]),_0x46d16f[_0x55005e(0xbf)]&&console['error'](_0x55005e(0xb2)+_0x46d16f['cause']),0x1;throw _0x46d16f;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x41eeed(0x77)]=a27_0x41eeed(0xb0);[a27_0x41eeed(0xc9)]=a27_0x41eeed(0xfa);async[a27_0x41eeed(0xe0)](_0x2f1690){const _0x4f9ab2=a27_0x41eeed,{options:_0x4cacc1,args:_0x1a5d2e,tdx:_0x15c087}=_0x2f1690,_0x5166c8=_0x1a5d2e[0x0];if(!_0x5166c8)return console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xb5)),console['error'](_0x4f9ab2(0xd1)),console[_0x4f9ab2(0xb1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xfd)),console[_0x4f9ab2(0xb1)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xd4)),0x1;try{const _0x173eea=_0x4cacc1['parentSegment'],_0x332efa=await resolveSegmentTarget(_0x5166c8,_0x173eea,_0x4cacc1[_0x4f9ab2(0x7e)]);_0x4cacc1[_0x4f9ab2(0x7e)]&&console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xca)+_0x332efa);const _0x3fd5f5=await withSpinner('Resolving\x20\x27'+_0x5166c8+'\x27...',()=>_0x15c087[_0x4f9ab2(0xd0)][_0x4f9ab2(0xd6)](_0x332efa),{'verbose':_0x4cacc1[_0x4f9ab2(0x7e)]}),_0xd5e708=_0x3fd5f5[_0x4f9ab2(0xe6)];_0x4cacc1[_0x4f9ab2(0x7e)]&&(console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xaa)+_0xd5e708['type']),console[_0x4f9ab2(0xb1)]('Parent\x20ID:\x20'+_0xd5e708[_0x4f9ab2(0xa1)]));if(_0xd5e708[_0x4f9ab2(0xc0)]==='folder')return console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xf3)),console[_0x4f9ab2(0xb1)](_0x4f9ab2(0x69)),0x1;if(_0xd5e708[_0x4f9ab2(0xc0)]===_0x4f9ab2(0x89))return console[_0x4f9ab2(0xb1)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4f9ab2(0xb1)](_0x4f9ab2(0xde)),0x1;if(!_0xd5e708['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4f9ab2(0x79));const _0x64ecb4=await withSpinner(_0x4f9ab2(0xf9),()=>_0x15c087[_0x4f9ab2(0xd0)][_0x4f9ab2(0xc4)](_0xd5e708[_0x4f9ab2(0xa1)],_0xd5e708[_0x4f9ab2(0xdd)]),{'verbose':_0x4cacc1['verbose']}),_0x1a4de3=_0x64ecb4[_0x4f9ab2(0xe6)];return _0x4cacc1[_0x4f9ab2(0x100)]===_0x4f9ab2(0x6d)||_0x4cacc1[_0x4f9ab2(0x100)]===_0x4f9ab2(0xf1)?await handleSDKOutput([{'sql':_0x1a4de3}],_0x4cacc1):console[_0x4f9ab2(0xbc)](_0x1a4de3),0x0;}catch(_0x5c2df3){if(_0x5c2df3 instanceof SDKError)return console['error'](_0x4f9ab2(0xe7)+_0x5c2df3[_0x4f9ab2(0x97)]),_0x5c2df3[_0x4f9ab2(0xbf)]&&console['error']('\x20\x20Cause:\x20'+_0x5c2df3[_0x4f9ab2(0xbf)]),0x1;throw _0x5c2df3;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x41eeed(0x77)]='segment:folder:create';[a27_0x41eeed(0xc9)]=a27_0x41eeed(0xa6);async[a27_0x41eeed(0xe0)](_0x3460a8){const _0x3683c6=a27_0x41eeed,{options:_0x370cd3,args:_0xb61d19,tdx:_0x5149ae}=_0x3460a8,_0x2607f3=_0x370cd3;if(_0xb61d19[_0x3683c6(0xcf)]<0x2)return console[_0x3683c6(0xb1)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x3683c6(0xb1)](_0x3683c6(0xc7)),0x1;const _0x53cef8=_0xb61d19[0x0],_0x364653=_0xb61d19[0x1];_0x2607f3['verbose']&&(console[_0x3683c6(0xb1)](_0x3683c6(0xff)+_0x2607f3[_0x3683c6(0x70)]),console['error'](_0x3683c6(0x6c)+_0x53cef8),console[_0x3683c6(0xb1)](_0x3683c6(0x9c)+_0x364653));let _0x23abe5;if(_0x2607f3['parentFolder']){const _0xe9c3e8=_0x2607f3[_0x3683c6(0xa4)],_0x28aa2f=await withSpinner(_0x3683c6(0xe9)+_0x53cef8+_0x3683c6(0xc5),()=>_0x5149ae[_0x3683c6(0xd0)][_0x3683c6(0x7b)](_0x53cef8),{'verbose':_0x2607f3[_0x3683c6(0x7e)]}),_0x1a389c=_0x28aa2f[_0x3683c6(0xe6)],_0x5b2b24=await withSpinner(_0x3683c6(0x8c)+_0xe9c3e8+_0x3683c6(0xc5),()=>_0x5149ae[_0x3683c6(0xd0)]['resolveFolderId'](_0x1a389c,_0xe9c3e8),{'verbose':_0x2607f3[_0x3683c6(0x7e)]});_0x23abe5=_0x5b2b24[_0x3683c6(0xe6)],_0x2607f3[_0x3683c6(0x7e)]&&console['error'](_0x3683c6(0xf8)+_0x23abe5);}const _0x2e17db={'name':_0x364653,'description':_0x2607f3[_0x3683c6(0xc9)],'parentFolderId':_0x23abe5},_0x305e07=await withSpinner('Creating\x20folder\x20\x27'+_0x364653+_0x3683c6(0xc5),()=>_0x5149ae[_0x3683c6(0xd0)][_0x3683c6(0xfe)](_0x53cef8,_0x2e17db),{'verbose':_0x2607f3[_0x3683c6(0x7e)]}),_0x5140fd=_0x305e07[_0x3683c6(0xe6)];return console['error']('βœ”\x20Created\x20folder\x20\x27'+_0x5140fd['name']+'\x27\x20with\x20ID:\x20'+_0x5140fd['id']),await handleSDKOutput([_0x5140fd],_0x2607f3),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a27_0x41eeed(0xa3);[a27_0x41eeed(0xc9)]=a27_0x41eeed(0x73);async[a27_0x41eeed(0xe0)](_0x3e9e03){const _0x2bc655=a27_0x41eeed,{options:_0x40fbe8,args:_0x557fbd,tdx:_0x2574bb}=_0x3e9e03,_0x43c6e1=_0x557fbd[0x0];if(!_0x43c6e1)return console[_0x2bc655(0xb1)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x2bc655(0x6e)),console[_0x2bc655(0xb1)](_0x2bc655(0xa9)),console[_0x2bc655(0xb1)](_0x2bc655(0xcc)),console[_0x2bc655(0xb1)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x2bc655(0xb1)](_0x2bc655(0xfd)),console[_0x2bc655(0xb1)](_0x2bc655(0xe4)),console[_0x2bc655(0xb1)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console['error'](_0x2bc655(0xcb)),console[_0x2bc655(0xb1)](_0x2bc655(0xab)),0x1;try{const _0x44d341=_0x40fbe8['parentSegment'],_0x795f10=await resolveSegmentTarget(_0x43c6e1,_0x44d341,_0x40fbe8[_0x2bc655(0x7e)]);_0x40fbe8['verbose']&&console[_0x2bc655(0xb1)](_0x2bc655(0xca)+_0x795f10);const _0x21fe10=await withSpinner(_0x2bc655(0x91)+_0x43c6e1+_0x2bc655(0xc5),()=>_0x2574bb[_0x2bc655(0xd0)][_0x2bc655(0xd6)](_0x795f10),{'verbose':_0x40fbe8[_0x2bc655(0x7e)]}),_0x577b70=_0x21fe10['data'];_0x40fbe8['verbose']&&(console[_0x2bc655(0xb1)](_0x2bc655(0xaa)+_0x577b70[_0x2bc655(0xc0)]),console[_0x2bc655(0xb1)](_0x2bc655(0x98)+_0x577b70['parentId']),_0x577b70[_0x2bc655(0xfb)]&&console[_0x2bc655(0xb1)](_0x2bc655(0x6b)+_0x577b70[_0x2bc655(0xfb)]),_0x577b70[_0x2bc655(0xdd)]&&console[_0x2bc655(0xb1)](_0x2bc655(0x93)+_0x577b70[_0x2bc655(0xdd)]));if(_0x40fbe8[_0x2bc655(0xf2)]){if(_0x577b70[_0x2bc655(0xc0)]===_0x2bc655(0x71))return console[_0x2bc655(0xb1)](_0x2bc655(0xce)),0x1;if(_0x577b70[_0x2bc655(0xc0)]===_0x2bc655(0x89))return console[_0x2bc655(0xb1)](_0x2bc655(0x8b)),console[_0x2bc655(0xb1)](_0x2bc655(0x9b)),0x1;if(!_0x577b70[_0x2bc655(0xdd)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x2bc655(0x79));const _0x3b6a06=getConsoleNextUrl(_0x40fbe8[_0x2bc655(0x70)],_0x2bc655(0xe1)+_0x577b70[_0x2bc655(0xa1)]+_0x2bc655(0x84)+_0x577b70[_0x2bc655(0xdd)]);return console[_0x2bc655(0xb1)](a27_0x4d374c['green']('βœ”')+'\x20Opening\x20'+a27_0x4d374c[_0x2bc655(0x99)](_0x3b6a06)),openBrowser(_0x3b6a06),0x0;}if(_0x577b70['type']===_0x2bc655(0x71)){if(!_0x577b70[_0x2bc655(0xfb)])throw new SDKError(ErrorCode[_0x2bc655(0xd7)],_0x2bc655(0xd9));const _0x1b1cd9=await withSpinner(_0x2bc655(0x81),()=>_0x2574bb[_0x2bc655(0xd0)][_0x2bc655(0x9f)](_0x577b70[_0x2bc655(0xfb)]),{'verbose':_0x40fbe8[_0x2bc655(0x7e)]});await handleSingleObjectOutput(_0x1b1cd9[_0x2bc655(0xe6)],_0x40fbe8);}else{if(_0x577b70[_0x2bc655(0xc0)]===_0x2bc655(0xd0)){if(!_0x577b70[_0x2bc655(0xdd)])throw new SDKError(ErrorCode[_0x2bc655(0xdb)],_0x2bc655(0x79));const _0x33491d=await withSpinner(_0x2bc655(0xc8),()=>_0x2574bb[_0x2bc655(0xd0)][_0x2bc655(0xb7)](_0x577b70[_0x2bc655(0xa1)],_0x577b70[_0x2bc655(0xdd)]),{'verbose':_0x40fbe8[_0x2bc655(0x7e)]}),_0x254e59=getConsoleNextUrl(_0x40fbe8['site'],_0x2bc655(0xe1)+_0x577b70[_0x2bc655(0xa1)]+_0x2bc655(0x84)+_0x577b70[_0x2bc655(0xdd)]),_0x33848c=_0x33491d['data'];_0x33848c[_0x2bc655(0x9e)]=_0x254e59,await handleSingleObjectOutput(_0x33848c,_0x40fbe8);}else return console[_0x2bc655(0xb1)](_0x2bc655(0xc1)),console[_0x2bc655(0xb1)](_0x2bc655(0xaf)),0x1;}return 0x0;}catch(_0x578fd6){if(_0x578fd6 instanceof SDKError)return console[_0x2bc655(0xb1)](_0x2bc655(0xe7)+_0x578fd6[_0x2bc655(0x97)]),_0x578fd6[_0x2bc655(0xbf)]&&console[_0x2bc655(0xb1)](_0x2bc655(0xb2)+_0x578fd6['cause']),0x1;throw _0x578fd6;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a27_0x41eeed(0xb9);[a27_0x41eeed(0xc9)]=a27_0x41eeed(0xfc);async[a27_0x41eeed(0xe0)](_0x35814a){const _0x120e10=a27_0x41eeed,{options:_0x286022,args:_0x4cd975,tdx:_0x28749}=_0x35814a,_0x45be47=_0x4cd975[0x0];if(!_0x45be47)return console[_0x120e10(0xb1)](_0x120e10(0xb5)),console[_0x120e10(0xb1)](_0x120e10(0xa8)),console[_0x120e10(0xb1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x120e10(0xb1)](_0x120e10(0xfd)),console[_0x120e10(0xb1)](_0x120e10(0xc2)),console[_0x120e10(0xb1)](_0x120e10(0xed)),0x1;try{const _0x5530d4=_0x286022[_0x120e10(0xef)],_0x38e770=await resolveSegmentTarget(_0x45be47,_0x5530d4,_0x286022[_0x120e10(0x7e)]);_0x286022[_0x120e10(0x7e)]&&console[_0x120e10(0xb1)](_0x120e10(0xca)+_0x38e770);const _0x27f0bb=await withSpinner('Resolving\x20\x27'+_0x45be47+_0x120e10(0xc5),()=>_0x28749[_0x120e10(0xd0)][_0x120e10(0xd6)](_0x38e770),{'verbose':_0x286022[_0x120e10(0x7e)]}),_0x544a1c=_0x27f0bb[_0x120e10(0xe6)];_0x286022[_0x120e10(0x7e)]&&(console[_0x120e10(0xb1)]('Resolved\x20type:\x20'+_0x544a1c[_0x120e10(0xc0)]),console['error'](_0x120e10(0x98)+_0x544a1c[_0x120e10(0xa1)]));if(_0x544a1c[_0x120e10(0xc0)]===_0x120e10(0x71))return console[_0x120e10(0xb1)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x120e10(0xb1)](_0x120e10(0x69)),0x1;if(_0x544a1c[_0x120e10(0xc0)]===_0x120e10(0x89))return console[_0x120e10(0xb1)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x120e10(0xb1)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x544a1c[_0x120e10(0xdd)])throw new SDKError(ErrorCode[_0x120e10(0xdb)],_0x120e10(0x79));const _0x367c9c=await withSpinner(_0x120e10(0xf9),()=>_0x28749[_0x120e10(0xd0)][_0x120e10(0xc4)](_0x544a1c['parentId'],_0x544a1c[_0x120e10(0xdd)]),{'verbose':_0x286022[_0x120e10(0x7e)]}),_0x30e6d7=_0x367c9c[_0x120e10(0xe6)],_0x2bbab8=await executeSchemaQuery(_0x30e6d7,_0x28749,_0x286022);return await handleQueryOutput(_0x2bbab8,_0x286022),0x0;}catch(_0x420a83){if(_0x420a83 instanceof SDKError)return console['error']('Error:\x20'+_0x420a83['message']),_0x420a83[_0x120e10(0xbf)]&&console[_0x120e10(0xb1)](_0x120e10(0xb2)+_0x420a83[_0x120e10(0xbf)]),0x1;throw _0x420a83;}}}
@@ -1 +1 @@
1
- const a28_0x3320a0=a28_0x75b4;(function(_0x5a467a,_0x28a502){const _0x37d9d9=a28_0x75b4,_0x34fc34=_0x5a467a();while(!![]){try{const _0xc0bf0a=-parseInt(_0x37d9d9(0x183))/0x1*(parseInt(_0x37d9d9(0x18d))/0x2)+parseInt(_0x37d9d9(0x17c))/0x3*(-parseInt(_0x37d9d9(0x175))/0x4)+-parseInt(_0x37d9d9(0x17f))/0x5*(-parseInt(_0x37d9d9(0x173))/0x6)+parseInt(_0x37d9d9(0x19c))/0x7+parseInt(_0x37d9d9(0x178))/0x8+-parseInt(_0x37d9d9(0x18f))/0x9*(parseInt(_0x37d9d9(0x17e))/0xa)+parseInt(_0x37d9d9(0x191))/0xb*(parseInt(_0x37d9d9(0x188))/0xc);if(_0xc0bf0a===_0x28a502)break;else _0x34fc34['push'](_0x34fc34['shift']());}catch(_0x16d3c7){_0x34fc34['push'](_0x34fc34['shift']());}}}(a28_0x6596,0x884e7));function a28_0x75b4(_0x18f7aa,_0xc1538b){_0x18f7aa=_0x18f7aa-0x16e;const _0x65961b=a28_0x6596();let _0x75b40=_0x65961b[_0x18f7aa];return _0x75b40;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x421407 from'chalk';function a28_0x6596(){const _0x3ed0d4=['invisible','Site:\x20','360276IHATvM','resolveParentId','16540VFKLid','4210340XFtmaH','data','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Resolved\x20folder\x20ID:\x20','9RGxuPY','type','\x20\x20\x20Path:\x20','segments','yellow','60UxUCNX','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segment:create','name','resolvePathToResource','80702foxUTw','rule','1980jpRByu','Examples:','1392017Peclhp','parent','ruleFile','Resolving\x20folder\x20path\x20\x27','site','verbose','error','folder','Creating\x20segment\x20\x27','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','4238346zVDZOZ','\x27...','folderId','resolveFolderId','βœ”\x20Created\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','length','Resolving\x20parent\x20segment\x20\x27','includes','segmentPath','noCountPopulation','6USgrOn','createSegment','28kCjJGk','kind','segment','365704NletQc','Target\x20path:\x20'];a28_0x6596=function(){return _0x3ed0d4;};return a28_0x6596();}export class SegmentCreateCommand extends BaseCommand{[a28_0x3320a0(0x18b)]=a28_0x3320a0(0x18a);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0x55bf31){const _0x3092dc=a28_0x3320a0;console[_0x3092dc(0x197)](a28_0x421407[_0x3092dc(0x187)](_0x3092dc(0x19a))),console[_0x3092dc(0x197)](a28_0x421407[_0x3092dc(0x187)](_0x3092dc(0x1a1)));const {options:_0x3a9f27,args:_0x5e2f02,tdx:_0xaee54d}=_0x55bf31,_0xf3ea5b=_0x3a9f27;if(_0x5e2f02[_0x3092dc(0x16e)]===0x0)return console['error'](_0x3092dc(0x189)),console[_0x3092dc(0x197)](_0x3092dc(0x181)),console[_0x3092dc(0x197)](_0x3092dc(0x190)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x3092dc(0x197)](_0x3092dc(0x19b)),console['error'](_0x3092dc(0x1a2)),0x1;const _0x233abe=_0x5e2f02[0x0],_0x3047d4=_0x3a9f27[_0x3092dc(0x171)];let _0x22d68b=_0x233abe;_0x3047d4&&!_0x233abe[_0x3092dc(0x170)]('/')&&(_0x22d68b=_0x3047d4+'/'+_0x233abe,_0xf3ea5b[_0x3092dc(0x196)]&&console[_0x3092dc(0x197)]('Resolved\x20relative\x20path\x20to:\x20'+_0x22d68b));const _0x51835c=parsePath(_0x22d68b);if(_0x51835c[_0x3092dc(0x186)][_0x3092dc(0x16e)]<0x2)return console[_0x3092dc(0x197)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x3092dc(0x197)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x5c4aaa=_0x51835c[_0x3092dc(0x186)][0x0],_0x2d89c7=getBaseName(_0x22d68b),_0x169e39=getParentPath(_0x22d68b);_0xf3ea5b['verbose']&&(console['error'](_0x3092dc(0x17b)+_0xf3ea5b[_0x3092dc(0x195)]),console[_0x3092dc(0x197)](_0x3092dc(0x179)+_0x22d68b),console['error']('Parent:\x20'+_0x5c4aaa),console[_0x3092dc(0x197)]('Segment\x20name:\x20'+_0x2d89c7),console[_0x3092dc(0x197)]('Parent\x20path:\x20'+_0x169e39));const _0x32f174=await withSpinner(_0x3092dc(0x16f)+_0x5c4aaa+_0x3092dc(0x19d),()=>_0xaee54d[_0x3092dc(0x177)][_0x3092dc(0x17d)](_0x5c4aaa),{'verbose':_0xf3ea5b[_0x3092dc(0x196)]}),_0x59ca53=_0x32f174[_0x3092dc(0x180)];let _0x244e35;if(_0x51835c['segments'][_0x3092dc(0x16e)]>0x2){const _0x2d5fb7=await withSpinner(_0x3092dc(0x194)+_0x169e39+_0x3092dc(0x19d),()=>_0xaee54d[_0x3092dc(0x177)][_0x3092dc(0x18c)](_0x169e39),{'verbose':_0xf3ea5b['verbose']}),_0x4c70e8=_0x2d5fb7['data'];if(_0x4c70e8[_0x3092dc(0x184)]!==_0x3092dc(0x198)&&_0x4c70e8[_0x3092dc(0x184)]!==_0x3092dc(0x192))return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x244e35=_0x4c70e8[_0x3092dc(0x19e)];}else{if(_0xf3ea5b[_0x3092dc(0x198)]){const _0x10cbc9=await withSpinner('Resolving\x20folder\x20\x27'+_0xf3ea5b[_0x3092dc(0x198)]+_0x3092dc(0x19d),()=>_0xaee54d[_0x3092dc(0x177)][_0x3092dc(0x19f)](_0x59ca53,_0xf3ea5b['folder']),{'verbose':_0xf3ea5b[_0x3092dc(0x196)]});_0x244e35=_0x10cbc9[_0x3092dc(0x180)];}}_0xf3ea5b['verbose']&&_0x244e35&&console['error'](_0x3092dc(0x182)+_0x244e35);const _0x139d52=await loadJSONFromOptions(_0xf3ea5b[_0x3092dc(0x18e)],_0xf3ea5b[_0x3092dc(0x193)]),_0x466fe8={'name':_0x2d89c7,'description':_0xf3ea5b['description'],'rule':_0x139d52,'kind':_0xf3ea5b[_0x3092dc(0x176)]!==undefined?parseInt(_0xf3ea5b['kind'],0xa):undefined,'isVisible':_0xf3ea5b[_0x3092dc(0x17a)]?![]:undefined,'segmentFolderId':_0x244e35,'countPopulation':_0xf3ea5b[_0x3092dc(0x172)]?![]:undefined},_0x39d84b=await withSpinner(_0x3092dc(0x199)+_0x2d89c7+'\x27...',()=>_0xaee54d[_0x3092dc(0x177)][_0x3092dc(0x174)](_0x59ca53,_0x466fe8),{'verbose':_0xf3ea5b[_0x3092dc(0x196)]}),_0x5b12a4=_0x39d84b[_0x3092dc(0x180)];return console[_0x3092dc(0x197)](_0x3092dc(0x1a0)+_0x5b12a4['name']+'\x27\x20with\x20ID:\x20'+_0x5b12a4['id']),_0x22d68b!==_0x233abe&&console[_0x3092dc(0x197)](_0x3092dc(0x185)+_0x22d68b),await handleSDKOutput([_0x5b12a4],_0xf3ea5b),0x0;}}
1
+ const a28_0x1257ec=a28_0x4d8e;function a28_0x4d8e(_0xfe4be2,_0x1b35cc){_0xfe4be2=_0xfe4be2-0x1a7;const _0x4420bf=a28_0x4420();let _0x4d8ea7=_0x4420bf[_0xfe4be2];return _0x4d8ea7;}(function(_0x137ec3,_0x299536){const _0xb49c6b=a28_0x4d8e,_0x39d08f=_0x137ec3();while(!![]){try{const _0x46e634=-parseInt(_0xb49c6b(0x1b4))/0x1+-parseInt(_0xb49c6b(0x1a8))/0x2+-parseInt(_0xb49c6b(0x1c6))/0x3+-parseInt(_0xb49c6b(0x1d6))/0x4*(-parseInt(_0xb49c6b(0x1d2))/0x5)+parseInt(_0xb49c6b(0x1cb))/0x6*(-parseInt(_0xb49c6b(0x1d0))/0x7)+parseInt(_0xb49c6b(0x1d5))/0x8+parseInt(_0xb49c6b(0x1cf))/0x9*(parseInt(_0xb49c6b(0x1d7))/0xa);if(_0x46e634===_0x299536)break;else _0x39d08f['push'](_0x39d08f['shift']());}catch(_0x3d7551){_0x39d08f['push'](_0x39d08f['shift']());}}}(a28_0x4420,0x2d21b));function a28_0x4420(){const _0xa5dc1c=['name','Examples:','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','createSegment','398760odKwcm','segment','noCountPopulation','folderId','site','582WvHHrM','βœ”\x20Created\x20segment\x20\x27','Creating\x20segment\x20\x27','Resolving\x20folder\x20\x27','1683IzTrMW','2863jrOpOK','includes','315jAjuNU','length','Target\x20path:\x20','1511680NnViLq','5996AdAgQW','23750DiHJbM','kind','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','segments','645138EtWrJV','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','rule','Resolved\x20folder\x20ID:\x20','yellow','type','resolveFolderId','error','description','verbose','segment:create','segmentPath','47501IqyQPG','\x20\x20\x20Path:\x20','ruleFile','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','data','Site:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','execute','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x27...','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules'];a28_0x4420=function(){return _0xa5dc1c;};return a28_0x4420();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x4c8104 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x1257ec(0x1c2)]=a28_0x1257ec(0x1b2);[a28_0x1257ec(0x1b0)]=a28_0x1257ec(0x1c1);async[a28_0x1257ec(0x1bc)](_0x580308){const _0x40ef34=a28_0x1257ec;console[_0x40ef34(0x1af)](a28_0x4c8104[_0x40ef34(0x1ac)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a28_0x4c8104[_0x40ef34(0x1ac)](_0x40ef34(0x1bb)));const {options:_0x1735b4,args:_0x430033,tdx:_0x271aa6}=_0x580308,_0x5b8bd1=_0x1735b4;if(_0x430033['length']===0x0)return console['error'](_0x40ef34(0x1bd)),console[_0x40ef34(0x1af)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console[_0x40ef34(0x1af)](_0x40ef34(0x1c3)),console[_0x40ef34(0x1af)](_0x40ef34(0x1c0)),console[_0x40ef34(0x1af)](_0x40ef34(0x1c4)),console[_0x40ef34(0x1af)](_0x40ef34(0x1b7)),0x1;const _0xd59668=_0x430033[0x0],_0x1a812c=_0x1735b4[_0x40ef34(0x1b3)];let _0x507a1d=_0xd59668;_0x1a812c&&!_0xd59668[_0x40ef34(0x1d1)]('/')&&(_0x507a1d=_0x1a812c+'/'+_0xd59668,_0x5b8bd1[_0x40ef34(0x1b1)]&&console[_0x40ef34(0x1af)]('Resolved\x20relative\x20path\x20to:\x20'+_0x507a1d));const _0x36d7d3=parsePath(_0x507a1d);if(_0x36d7d3[_0x40ef34(0x1a7)][_0x40ef34(0x1d3)]<0x2)return console['error'](_0x40ef34(0x1a9)),console['error'](_0x40ef34(0x1da)),0x1;const _0x240b1d=_0x36d7d3[_0x40ef34(0x1a7)][0x0],_0x543fa0=getBaseName(_0x507a1d),_0x59b4ef=getParentPath(_0x507a1d);_0x5b8bd1[_0x40ef34(0x1b1)]&&(console[_0x40ef34(0x1af)](_0x40ef34(0x1ba)+_0x5b8bd1[_0x40ef34(0x1ca)]),console[_0x40ef34(0x1af)](_0x40ef34(0x1d4)+_0x507a1d),console[_0x40ef34(0x1af)]('Parent:\x20'+_0x240b1d),console[_0x40ef34(0x1af)]('Segment\x20name:\x20'+_0x543fa0),console['error']('Parent\x20path:\x20'+_0x59b4ef));const _0x161b59=await withSpinner(_0x40ef34(0x1d9)+_0x240b1d+_0x40ef34(0x1be),()=>_0x271aa6[_0x40ef34(0x1c7)]['resolveParentId'](_0x240b1d),{'verbose':_0x5b8bd1[_0x40ef34(0x1b1)]}),_0x4e06fe=_0x161b59[_0x40ef34(0x1b9)];let _0x257b3e;if(_0x36d7d3[_0x40ef34(0x1a7)][_0x40ef34(0x1d3)]>0x2){const _0x4aa9be=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x59b4ef+_0x40ef34(0x1be),()=>_0x271aa6[_0x40ef34(0x1c7)]['resolvePathToResource'](_0x59b4ef),{'verbose':_0x5b8bd1[_0x40ef34(0x1b1)]}),_0x1e59fc=_0x4aa9be['data'];if(_0x1e59fc[_0x40ef34(0x1ad)]!==_0x40ef34(0x1b8)&&_0x1e59fc[_0x40ef34(0x1ad)]!=='parent')return console[_0x40ef34(0x1af)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x257b3e=_0x1e59fc[_0x40ef34(0x1c9)];}else{if(_0x5b8bd1[_0x40ef34(0x1b8)]){const _0x9f1baa=await withSpinner(_0x40ef34(0x1ce)+_0x5b8bd1['folder']+_0x40ef34(0x1be),()=>_0x271aa6['segment'][_0x40ef34(0x1ae)](_0x4e06fe,_0x5b8bd1[_0x40ef34(0x1b8)]),{'verbose':_0x5b8bd1[_0x40ef34(0x1b1)]});_0x257b3e=_0x9f1baa[_0x40ef34(0x1b9)];}}_0x5b8bd1['verbose']&&_0x257b3e&&console['error'](_0x40ef34(0x1ab)+_0x257b3e);const _0x588b0c=await loadJSONFromOptions(_0x5b8bd1[_0x40ef34(0x1aa)],_0x5b8bd1[_0x40ef34(0x1b6)]),_0x29ec2e={'name':_0x543fa0,'description':_0x5b8bd1[_0x40ef34(0x1b0)],'rule':_0x588b0c,'kind':_0x5b8bd1[_0x40ef34(0x1d8)]!==undefined?parseInt(_0x5b8bd1[_0x40ef34(0x1d8)],0xa):undefined,'isVisible':_0x5b8bd1['invisible']?![]:undefined,'segmentFolderId':_0x257b3e,'countPopulation':_0x5b8bd1[_0x40ef34(0x1c8)]?![]:undefined},_0x5cbeb4=await withSpinner(_0x40ef34(0x1cd)+_0x543fa0+_0x40ef34(0x1be),()=>_0x271aa6[_0x40ef34(0x1c7)][_0x40ef34(0x1c5)](_0x4e06fe,_0x29ec2e),{'verbose':_0x5b8bd1[_0x40ef34(0x1b1)]}),_0x13f1b3=_0x5cbeb4[_0x40ef34(0x1b9)];return console['error'](_0x40ef34(0x1cc)+_0x13f1b3[_0x40ef34(0x1c2)]+_0x40ef34(0x1bf)+_0x13f1b3['id']),_0x507a1d!==_0xd59668&&console[_0x40ef34(0x1af)](_0x40ef34(0x1b5)+_0x507a1d),await handleSDKOutput([_0x13f1b3],_0x5b8bd1),0x0;}}
@@ -1 +1 @@
1
- function a29_0x43bd(){const _0x39d128=['verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','name','9922zXTApp','length','579547TJRHze','\x20field','error','2946312uJIanS','Error:\x20Parent\x20segment\x20name\x20is\x20required','listFields','\x27...','4216DaFReY','βœ”\x20Found\x20','15561ICUsGx','3772590iWpDZO','22zHUceZ','parentSegment','segment','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','3028kAmjAc','12rtzhsr','description','582LtsURA','Listing\x20fields\x20for\x20\x27','Parent\x20segment:\x20','4703951bDvwrV','data','Site:\x20','jsonl','execute','6595ethOVi'];a29_0x43bd=function(){return _0x39d128;};return a29_0x43bd();}const a29_0x3f51a4=a29_0x12e4;(function(_0x41a153,_0x597053){const _0x90c275=a29_0x12e4,_0x2e61e7=_0x41a153();while(!![]){try{const _0x2dd146=-parseInt(_0x90c275(0x125))/0x1+parseInt(_0x90c275(0x123))/0x2*(-parseInt(_0x90c275(0x117))/0x3)+-parseInt(_0x90c275(0x114))/0x4*(-parseInt(_0x90c275(0x11f))/0x5)+-parseInt(_0x90c275(0x115))/0x6*(-parseInt(_0x90c275(0x11a))/0x7)+-parseInt(_0x90c275(0x12c))/0x8*(parseInt(_0x90c275(0x12e))/0x9)+parseInt(_0x90c275(0x12f))/0xa+parseInt(_0x90c275(0x130))/0xb*(parseInt(_0x90c275(0x128))/0xc);if(_0x2dd146===_0x597053)break;else _0x2e61e7['push'](_0x2e61e7['shift']());}catch(_0xed4f5a){_0x2e61e7['push'](_0x2e61e7['shift']());}}}(a29_0x43bd,0xb8f70));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a29_0x12e4(_0xa3e92d,_0x5d7080){_0xa3e92d=_0xa3e92d-0x112;const _0x43bd69=a29_0x43bd();let _0x12e48c=_0x43bd69[_0xa3e92d];return _0x12e48c;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x3f51a4(0x122)]='segment:fields';[a29_0x3f51a4(0x116)]='List\x20available\x20fields\x20for\x20segmentation';async[a29_0x3f51a4(0x11e)](_0x1e8674){const _0x21b6f0=a29_0x3f51a4,{options:_0x2687bf,args:_0x2a3af5,tdx:_0x1d2f6b}=_0x1e8674,_0x41bbb9=_0x2a3af5[0x0]||_0x2687bf[_0x21b6f0(0x131)];if(!_0x41bbb9)return console[_0x21b6f0(0x127)](_0x21b6f0(0x129)),console[_0x21b6f0(0x127)](_0x21b6f0(0x113)),console['error'](_0x21b6f0(0x121)),0x1;_0x2687bf[_0x21b6f0(0x120)]&&(console[_0x21b6f0(0x127)](_0x21b6f0(0x11c)+_0x2687bf['site']),console[_0x21b6f0(0x127)](_0x21b6f0(0x119)+_0x41bbb9));const _0xad46d8=await withSpinner(_0x21b6f0(0x118)+_0x41bbb9+_0x21b6f0(0x12b),()=>_0x1d2f6b[_0x21b6f0(0x112)][_0x21b6f0(0x12a)](_0x41bbb9),{'verbose':_0x2687bf['verbose']}),_0x39a56f=_0xad46d8[_0x21b6f0(0x11b)];console[_0x21b6f0(0x127)](_0x21b6f0(0x12d)+_0x39a56f[_0x21b6f0(0x124)]+_0x21b6f0(0x126)+(_0x39a56f[_0x21b6f0(0x124)]!==0x1?'s':''));if(_0x2687bf['json']||_0x2687bf[_0x21b6f0(0x11d)])return await handleSDKOutput(_0x39a56f,_0x2687bf),0x0;return displayFieldsHumanReadable(_0x39a56f,_0x41bbb9),0x0;}}
1
+ function a29_0x1673(_0x4cc760,_0x165b31){_0x4cc760=_0x4cc760-0x116;const _0x4c6985=a29_0x4c69();let _0x1673b6=_0x4c6985[_0x4cc760];return _0x1673b6;}const a29_0x3fd9fb=a29_0x1673;(function(_0x4eceb1,_0x1fb627){const _0x832d3d=a29_0x1673,_0xe527a8=_0x4eceb1();while(!![]){try{const _0x39ce59=parseInt(_0x832d3d(0x124))/0x1*(-parseInt(_0x832d3d(0x11b))/0x2)+-parseInt(_0x832d3d(0x11f))/0x3+-parseInt(_0x832d3d(0x11a))/0x4*(-parseInt(_0x832d3d(0x129))/0x5)+parseInt(_0x832d3d(0x12a))/0x6+-parseInt(_0x832d3d(0x12f))/0x7*(parseInt(_0x832d3d(0x125))/0x8)+-parseInt(_0x832d3d(0x120))/0x9*(parseInt(_0x832d3d(0x121))/0xa)+parseInt(_0x832d3d(0x12c))/0xb;if(_0x39ce59===_0x1fb627)break;else _0xe527a8['push'](_0xe527a8['shift']());}catch(_0x358cef){_0xe527a8['push'](_0xe527a8['shift']());}}}(a29_0x4c69,0x8d90e));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a29_0x4c69(){const _0x343947=['data','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','164QmmtQo','380tEuRQs','jsonl','site','json','2797107yFYRMe','27ExMQcr','1952680tnxNkC','\x20field','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','5452QlFhtl','7096pkZLMc','execute','segment:fields','error','11415YOfHzO','2440662JolpTU','Error:\x20Parent\x20segment\x20name\x20is\x20required','31300720CgndJw','verbose','name','1673QOuhut','\x27...','listFields'];a29_0x4c69=function(){return _0x343947;};return a29_0x4c69();}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x3fd9fb(0x12e)]=a29_0x3fd9fb(0x127);['description']='List\x20available\x20fields\x20for\x20segmentation';async[a29_0x3fd9fb(0x126)](_0x4d0d6a){const _0x63650d=a29_0x3fd9fb,{options:_0x2379ce,args:_0x14138d,tdx:_0x6e14a9}=_0x4d0d6a,_0x420f8d=_0x14138d[0x0]||_0x2379ce['parentSegment'];if(!_0x420f8d)return console[_0x63650d(0x128)](_0x63650d(0x12b)),console[_0x63650d(0x128)](_0x63650d(0x123)),console[_0x63650d(0x128)](_0x63650d(0x119)),0x1;_0x2379ce[_0x63650d(0x12d)]&&(console[_0x63650d(0x128)]('Site:\x20'+_0x2379ce[_0x63650d(0x11d)]),console[_0x63650d(0x128)]('Parent\x20segment:\x20'+_0x420f8d));const _0x5c7b78=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x420f8d+_0x63650d(0x116),()=>_0x6e14a9['segment'][_0x63650d(0x117)](_0x420f8d),{'verbose':_0x2379ce[_0x63650d(0x12d)]}),_0xa4a3d7=_0x5c7b78[_0x63650d(0x118)];console[_0x63650d(0x128)]('βœ”\x20Found\x20'+_0xa4a3d7['length']+_0x63650d(0x122)+(_0xa4a3d7['length']!==0x1?'s':''));if(_0x2379ce[_0x63650d(0x11e)]||_0x2379ce[_0x63650d(0x11c)])return await handleSDKOutput(_0xa4a3d7,_0x2379ce),0x0;return displayFieldsHumanReadable(_0xa4a3d7,_0x420f8d),0x0;}}
@@ -1 +1 @@
1
- function a30_0x7710(){const _0x2fda81=['helpText','parentSegment','session','\x20journeys','cyan','32217AaSCPQ','dirname','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cwd','parent_segment','journeyVersions','hasChanges','filter','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pulling\x20segments\x20from\x20\x27','155asJlvb','\x27...','targetDir','isNew','setPhase','data','green','site','\x0aChanges\x20to\x20\x27','pullSegments','Site:\x20','segments','Error:\x20','\x20new\x20files','βœ”\x20Pulled\x20','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','segment','length','type','\x20\x20πŸ—ΊοΈ\x20\x20','\x20files?','\x20activations','dryRun','271002XEbRxz','resourceName','\x20with\x20','no_parent','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','9812901mUgvJL','1837908exqCQk','name','files','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','1436648ShltiW','error','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','yellow','dim','\x20versions)','utf-8','relativePath','Aborted.','\x20files\x20to\x20','\x20changed\x20files','execute','\x20=\x20','errorCode','parentName','βœ”\x20Context\x20set:\x20','verbose','1674300ZvrfRb','9wPMgAW','absolutePath','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','diff','\x20\x20🎯\x20','counts','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','2735416PGBNqM','repeat','\x20unchanged\x20files','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation'];a30_0x7710=function(){return _0x2fda81;};return a30_0x7710();}const a30_0x533de9=a30_0x4a44;(function(_0x4e102a,_0x4c4467){const _0x189311=a30_0x4a44,_0x58c1af=_0x4e102a();while(!![]){try{const _0xc4df9a=-parseInt(_0x189311(0x15a))/0x1+parseInt(_0x189311(0x196))/0x2+parseInt(_0x189311(0x181))/0x3+-parseInt(_0x189311(0x19f))/0x4+-parseInt(_0x189311(0x164))/0x5*(parseInt(_0x189311(0x17b))/0x6)+parseInt(_0x189311(0x180))/0x7+-parseInt(_0x189311(0x185))/0x8*(-parseInt(_0x189311(0x197))/0x9);if(_0xc4df9a===_0x4c4467)break;else _0x58c1af['push'](_0x58c1af['shift']());}catch(_0x14e9f8){_0x58c1af['push'](_0x58c1af['shift']());}}}(a30_0x7710,0xdf612));function a30_0x4a44(_0x2c8e82,_0x3a9776){_0x2c8e82=_0x2c8e82-0x156;const _0x7710f6=a30_0x7710();let _0x4a44f4=_0x7710f6[_0x2c8e82];return _0x4a44f4;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x32dc83 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x48194f from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a30_0x533de9(0x182)]='segment:pull';['description']=a30_0x533de9(0x19e);async[a30_0x533de9(0x190)](_0x4ca853){const _0x3bc9ca=a30_0x533de9,{options:_0x6bca86,args:_0x4c9a14,tdx:_0x404a1e}=_0x4ca853,_0x551a4a=_0x6bca86,_0x3d7a5d=await resolveTarget({'arg':_0x4c9a14[0x0],'contextParent':_0x6bca86[_0x3bc9ca(0x156)],'cwd':process[_0x3bc9ca(0x15d)]()});if(!isSuccessfulResolution(_0x3d7a5d))return _0x3d7a5d[_0x3bc9ca(0x192)]===_0x3bc9ca(0x17e)?(console[_0x3bc9ca(0x186)](a30_0x32dc83[_0x3bc9ca(0x188)](_0x3bc9ca(0x184))),console['error'](_0x3bc9ca(0x187)),console[_0x3bc9ca(0x186)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x3bc9ca(0x186)](_0x3bc9ca(0x19a))):(console[_0x3bc9ca(0x186)](a30_0x32dc83['red'](_0x3bc9ca(0x170)+_0x3d7a5d['message']+'\x0a')),_0x3d7a5d[_0x3bc9ca(0x1a3)]&&console['error'](a30_0x32dc83[_0x3bc9ca(0x159)](_0x3d7a5d[_0x3bc9ca(0x1a3)]))),0x1;const _0x20e54f=_0x3d7a5d[_0x3bc9ca(0x193)],_0x227756=_0x3d7a5d['targetDir'],_0x5135c7=_0x3d7a5d[_0x3bc9ca(0x176)]==='file'?_0x3d7a5d[_0x3bc9ca(0x17c)]:undefined;_0x551a4a['verbose']&&(console[_0x3bc9ca(0x186)](_0x3bc9ca(0x16e)+_0x551a4a[_0x3bc9ca(0x16b)]),console['error']('Parent\x20segment:\x20'+_0x20e54f),_0x5135c7&&console['error']('Target\x20resource:\x20'+_0x5135c7));const _0x484e21=await withProgressSpinner(_0x3bc9ca(0x163)+_0x20e54f+_0x3bc9ca(0x165),_0x4c345a=>_0x404a1e[_0x3bc9ca(0x174)][_0x3bc9ca(0x16d)](_0x20e54f,{'targetDir':_0x227756,'targetResourceName':_0x5135c7,'verbose':_0x551a4a[_0x3bc9ca(0x195)],'progress':{'update':_0x5b3fdb=>{const _0x1a1d55=_0x3bc9ca;_0x4c345a[_0x1a1d55(0x168)](_0x5b3fdb),_0x551a4a[_0x1a1d55(0x195)]&&console[_0x1a1d55(0x186)]('\x20\x20'+_0x5b3fdb);}}}),{'verbose':_0x551a4a[_0x3bc9ca(0x195)]}),_0x1fad74=_0x484e21[_0x3bc9ca(0x169)];if(_0x1fad74[_0x3bc9ca(0x19d)][_0x3bc9ca(0x16f)]===0x0&&_0x1fad74[_0x3bc9ca(0x19d)]['journeys']===0x0)return console[_0x3bc9ca(0x186)](a30_0x32dc83['yellow'](_0x3bc9ca(0x17f)+_0x1fad74[_0x3bc9ca(0x193)]+'\x27')),0x0;const _0x32cb44=_0x1fad74['files'][_0x3bc9ca(0x161)](_0x419263=>_0x419263[_0x3bc9ca(0x167)]),_0xc56ac0=_0x1fad74[_0x3bc9ca(0x183)]['filter'](_0xc3dfa0=>!_0xc3dfa0['isNew']&&_0xc3dfa0[_0x3bc9ca(0x160)]),_0x299e5d=_0x1fad74['files'][_0x3bc9ca(0x161)](_0x16d735=>!_0x16d735[_0x3bc9ca(0x167)]&&!_0x16d735[_0x3bc9ca(0x160)]);console[_0x3bc9ca(0x186)]('\x0aPull\x20summary\x20for\x20\x27'+_0x1fad74[_0x3bc9ca(0x193)]+'\x27:'),console[_0x3bc9ca(0x186)](_0x3bc9ca(0x19c)+a30_0x32dc83['cyan'](_0x1fad74[_0x3bc9ca(0x19d)]['segments']+'\x20segments')+_0x3bc9ca(0x17d)+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74[_0x3bc9ca(0x19d)]['activations']+_0x3bc9ca(0x179)));if(_0x1fad74['counts']['journeys']>0x0){const _0x3b7ea6=_0x1fad74[_0x3bc9ca(0x19d)][_0x3bc9ca(0x15f)]>_0x1fad74[_0x3bc9ca(0x19d)]['journeys']?'\x20('+_0x1fad74['counts'][_0x3bc9ca(0x15f)]+_0x3bc9ca(0x18a):'';console[_0x3bc9ca(0x186)](_0x3bc9ca(0x177)+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74['counts']['journeys']+_0x3bc9ca(0x158))+a30_0x32dc83['dim'](_0x3b7ea6));}console['error']('\x20\x20'+a30_0x32dc83[_0x3bc9ca(0x16a)]('+\x20'+_0x32cb44[_0x3bc9ca(0x175)]+_0x3bc9ca(0x171))),console[_0x3bc9ca(0x186)]('\x20\x20'+a30_0x32dc83[_0x3bc9ca(0x188)]('~\x20'+_0xc56ac0[_0x3bc9ca(0x175)]+_0x3bc9ca(0x18f))),console[_0x3bc9ca(0x186)]('\x20\x20'+a30_0x32dc83[_0x3bc9ca(0x189)]('=\x20'+_0x299e5d['length']+_0x3bc9ca(0x1a1))),console['error']('\x20\x20Target:\x20'+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74[_0x3bc9ca(0x166)])+'\x0a');if(_0xc56ac0[_0x3bc9ca(0x175)]>0x0)for(const _0x2a7d7c of _0xc56ac0){console['error'](_0x3bc9ca(0x16c)+_0x2a7d7c[_0x3bc9ca(0x18c)]+'\x27:'),console[_0x3bc9ca(0x186)]('─'['repeat'](0x3c)),console[_0x3bc9ca(0x186)](_0x2a7d7c[_0x3bc9ca(0x19b)]),console['error']('─'[_0x3bc9ca(0x1a0)](0x3c));}if(_0x551a4a[_0x3bc9ca(0x17a)])return console['error'](a30_0x32dc83[_0x3bc9ca(0x188)](_0x3bc9ca(0x15c))),0x0;if(_0x32cb44['length']===0x0&&_0xc56ac0[_0x3bc9ca(0x175)]===0x0)return console[_0x3bc9ca(0x186)](a30_0x32dc83[_0x3bc9ca(0x16a)](_0x3bc9ca(0x173))),saveSessionContext({'parent_segment':_0x1fad74[_0x3bc9ca(0x193)]},_0x551a4a[_0x3bc9ca(0x157)]),console[_0x3bc9ca(0x186)](a30_0x32dc83['green'](_0x3bc9ca(0x194)+a30_0x32dc83[_0x3bc9ca(0x189)](_0x3bc9ca(0x15e))+_0x3bc9ca(0x191)+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74[_0x3bc9ca(0x193)]))),0x0;if(!_0x551a4a['yes']){if(!isInteractive())return console['error'](a30_0x32dc83['red'](_0x3bc9ca(0x199)),_0x3bc9ca(0x162)),console[_0x3bc9ca(0x186)](a30_0x32dc83[_0x3bc9ca(0x189)](_0x3bc9ca(0x1a2))),0x1;const _0x54a468=await confirmKey('Write\x20'+(_0x32cb44[_0x3bc9ca(0x175)]+_0xc56ac0[_0x3bc9ca(0x175)])+_0x3bc9ca(0x178));if(!_0x54a468)return console[_0x3bc9ca(0x186)](a30_0x32dc83[_0x3bc9ca(0x188)](_0x3bc9ca(0x18d)),'-\x20no\x20files\x20written'),0x1;}for(const _0x209284 of _0x1fad74[_0x3bc9ca(0x183)]){if(_0x209284[_0x3bc9ca(0x167)]||_0x209284['hasChanges']){const _0x15ed69=a30_0x48194f[_0x3bc9ca(0x15b)](_0x209284[_0x3bc9ca(0x198)]);!existsSync(_0x15ed69)&&mkdirSync(_0x15ed69,{'recursive':!![]}),writeFileSync(_0x209284[_0x3bc9ca(0x198)],_0x209284['content'],_0x3bc9ca(0x18b));}}return console[_0x3bc9ca(0x186)](a30_0x32dc83['green'](_0x3bc9ca(0x172)+(_0x32cb44[_0x3bc9ca(0x175)]+_0xc56ac0[_0x3bc9ca(0x175)])+_0x3bc9ca(0x18e)+_0x1fad74[_0x3bc9ca(0x166)])),saveSessionContext({'parent_segment':_0x1fad74['parentName']},_0x551a4a[_0x3bc9ca(0x157)]),console['error'](a30_0x32dc83[_0x3bc9ca(0x16a)](_0x3bc9ca(0x194)+a30_0x32dc83['dim'](_0x3bc9ca(0x15e))+_0x3bc9ca(0x191)+a30_0x32dc83[_0x3bc9ca(0x159)](_0x1fad74[_0x3bc9ca(0x193)]))),0x0;}}
1
+ const a30_0x536754=a30_0x53a9;function a30_0x53a9(_0x25351,_0x1c0f5d){_0x25351=_0x25351-0x1c6;const _0x33f6d0=a30_0x33f6();let _0x53a9df=_0x33f6d0[_0x25351];return _0x53a9df;}(function(_0x1d2600,_0x2befd9){const _0x4469fc=a30_0x53a9,_0x1855a5=_0x1d2600();while(!![]){try{const _0x584709=-parseInt(_0x4469fc(0x1d2))/0x1+-parseInt(_0x4469fc(0x1f0))/0x2*(-parseInt(_0x4469fc(0x1d5))/0x3)+-parseInt(_0x4469fc(0x1e8))/0x4+-parseInt(_0x4469fc(0x1e9))/0x5+parseInt(_0x4469fc(0x1f8))/0x6+parseInt(_0x4469fc(0x1d9))/0x7*(-parseInt(_0x4469fc(0x1c8))/0x8)+parseInt(_0x4469fc(0x1e3))/0x9*(parseInt(_0x4469fc(0x1dd))/0xa);if(_0x584709===_0x2befd9)break;else _0x1855a5['push'](_0x1855a5['shift']());}catch(_0x21e009){_0x1855a5['push'](_0x1855a5['shift']());}}}(a30_0x33f6,0xd935b));function a30_0x33f6(){const _0x2fcacd=['736909kQqQEI','\x20with\x20','error','694311tkcbdb','filter','\x20activations','message','175742OlHxqT','setPhase','dirname','isNew','50MHbUFj','description','Pulling\x20segments\x20from\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','verbose','green','4244004EgwlwI','parent_segment','counts','\x20\x20🎯\x20','absolutePath','4110836eFnOen','7916145cNywkF','\x0aError:','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','session','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','14TZxnOL','\x20files\x20to\x20','journeys','parentName','\x0aPull\x20summary\x20for\x20\x27','segments','yes','site','2010102hZLCKp','journeyVersions','segment','Parent\x20segment:\x20','files','relativePath','resourceName','execute','βœ”\x20Context\x20set:\x20','\x20=\x20','repeat','\x20\x20πŸ—ΊοΈ\x20\x20','targetDir','red','\x27...','dryRun','helpText','diff','\x0aChanges\x20to\x20\x27','dim','-\x20no\x20files\x20written','file','yellow','Error:\x20','\x20journeys','activations','\x20files?','Target\x20resource:\x20','24UoHeeO','cyan','length','\x20segments','pullSegments','βœ”\x20Pulled\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20unchanged\x20files','hasChanges','segment:pull'];a30_0x33f6=function(){return _0x2fcacd;};return a30_0x33f6();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x280b13 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0xb40f93 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a30_0x536754(0x1d1);[a30_0x536754(0x1de)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a30_0x536754(0x1ff)](_0x17f44f){const _0x3f5921=a30_0x536754,{options:_0x2513f9,args:_0x32cad7,tdx:_0x4d490a}=_0x17f44f,_0x2dca8b=_0x2513f9,_0x14e2a9=await resolveTarget({'arg':_0x32cad7[0x0],'contextParent':_0x2513f9['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x14e2a9))return _0x14e2a9['errorCode']==='no_parent'?(console[_0x3f5921(0x1d4)](a30_0x280b13['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x3f5921(0x1ce)),console[_0x3f5921(0x1d4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x3f5921(0x1d4)](_0x3f5921(0x1ee))):(console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x205)](_0x3f5921(0x20f)+_0x14e2a9[_0x3f5921(0x1d8)]+'\x0a')),_0x14e2a9[_0x3f5921(0x208)]&&console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x1c9)](_0x14e2a9[_0x3f5921(0x208)]))),0x1;const _0x2b97f2=_0x14e2a9['parentName'],_0x251a9c=_0x14e2a9['targetDir'],_0x481d56=_0x14e2a9['type']===_0x3f5921(0x20d)?_0x14e2a9[_0x3f5921(0x1fe)]:undefined;_0x2dca8b[_0x3f5921(0x1e1)]&&(console['error']('Site:\x20'+_0x2dca8b[_0x3f5921(0x1f7)]),console[_0x3f5921(0x1d4)](_0x3f5921(0x1fb)+_0x2b97f2),_0x481d56&&console[_0x3f5921(0x1d4)](_0x3f5921(0x1c7)+_0x481d56));const _0x693446=await withProgressSpinner(_0x3f5921(0x1df)+_0x2b97f2+_0x3f5921(0x206),_0x34675d=>_0x4d490a[_0x3f5921(0x1fa)][_0x3f5921(0x1cc)](_0x2b97f2,{'targetDir':_0x251a9c,'targetResourceName':_0x481d56,'verbose':_0x2dca8b['verbose'],'progress':{'update':_0xa782be=>{const _0x4faa41=_0x3f5921;_0x34675d[_0x4faa41(0x1da)](_0xa782be),_0x2dca8b['verbose']&&console['error']('\x20\x20'+_0xa782be);}}}),{'verbose':_0x2dca8b[_0x3f5921(0x1e1)]}),_0xa6cad7=_0x693446[_0x3f5921(0x1ed)];if(_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x1f5)]===0x0&&_0xa6cad7[_0x3f5921(0x1e5)]['journeys']===0x0)return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x20e)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0xa6cad7['parentName']+'\x27')),0x0;const _0x12bdb5=_0xa6cad7[_0x3f5921(0x1fc)][_0x3f5921(0x1d6)](_0x146840=>_0x146840['isNew']),_0x1596fd=_0xa6cad7[_0x3f5921(0x1fc)]['filter'](_0x239931=>!_0x239931[_0x3f5921(0x1dc)]&&_0x239931[_0x3f5921(0x1d0)]),_0x5dc7f7=_0xa6cad7[_0x3f5921(0x1fc)][_0x3f5921(0x1d6)](_0x4a0b9e=>!_0x4a0b9e[_0x3f5921(0x1dc)]&&!_0x4a0b9e[_0x3f5921(0x1d0)]);console[_0x3f5921(0x1d4)](_0x3f5921(0x1f4)+_0xa6cad7[_0x3f5921(0x1f3)]+'\x27:'),console[_0x3f5921(0x1d4)](_0x3f5921(0x1e6)+a30_0x280b13['cyan'](_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x1f5)]+_0x3f5921(0x1cb))+_0x3f5921(0x1d3)+a30_0x280b13['cyan'](_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x211)]+_0x3f5921(0x1d7)));if(_0xa6cad7[_0x3f5921(0x1e5)]['journeys']>0x0){const _0x23eb44=_0xa6cad7['counts'][_0x3f5921(0x1f9)]>_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x1f2)]?'\x20('+_0xa6cad7['counts']['journeyVersions']+'\x20versions)':'';console[_0x3f5921(0x1d4)](_0x3f5921(0x203)+a30_0x280b13[_0x3f5921(0x1c9)](_0xa6cad7[_0x3f5921(0x1e5)][_0x3f5921(0x1f2)]+_0x3f5921(0x210))+a30_0x280b13[_0x3f5921(0x20b)](_0x23eb44));}console[_0x3f5921(0x1d4)]('\x20\x20'+a30_0x280b13[_0x3f5921(0x1e2)]('+\x20'+_0x12bdb5['length']+'\x20new\x20files')),console[_0x3f5921(0x1d4)]('\x20\x20'+a30_0x280b13[_0x3f5921(0x20e)]('~\x20'+_0x1596fd[_0x3f5921(0x1ca)]+'\x20changed\x20files')),console[_0x3f5921(0x1d4)]('\x20\x20'+a30_0x280b13['dim']('=\x20'+_0x5dc7f7[_0x3f5921(0x1ca)]+_0x3f5921(0x1cf))),console[_0x3f5921(0x1d4)]('\x20\x20Target:\x20'+a30_0x280b13['cyan'](_0xa6cad7[_0x3f5921(0x204)])+'\x0a');if(_0x1596fd['length']>0x0)for(const _0x24bcea of _0x1596fd){console[_0x3f5921(0x1d4)](_0x3f5921(0x20a)+_0x24bcea[_0x3f5921(0x1fd)]+'\x27:'),console['error']('─'[_0x3f5921(0x202)](0x3c)),console[_0x3f5921(0x1d4)](_0x24bcea[_0x3f5921(0x209)]),console[_0x3f5921(0x1d4)]('─'[_0x3f5921(0x202)](0x3c));}if(_0x2dca8b[_0x3f5921(0x207)])return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x20e)](_0x3f5921(0x1e0))),0x0;if(_0x12bdb5[_0x3f5921(0x1ca)]===0x0&&_0x1596fd['length']===0x0)return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x1e2)](_0x3f5921(0x1eb))),saveSessionContext({'parent_segment':_0xa6cad7[_0x3f5921(0x1f3)]},_0x2dca8b[_0x3f5921(0x1ec)]),console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x1e2)](_0x3f5921(0x200)+a30_0x280b13[_0x3f5921(0x20b)](_0x3f5921(0x1e4))+_0x3f5921(0x201)+a30_0x280b13['cyan'](_0xa6cad7[_0x3f5921(0x1f3)]))),0x0;if(!_0x2dca8b[_0x3f5921(0x1f6)]){if(!isInteractive())return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x205)](_0x3f5921(0x1ea)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x20b)](_0x3f5921(0x1ef))),0x1;const _0x12b89c=await confirmKey('Write\x20'+(_0x12bdb5[_0x3f5921(0x1ca)]+_0x1596fd[_0x3f5921(0x1ca)])+_0x3f5921(0x1c6));if(!_0x12b89c)return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x20e)]('Aborted.'),_0x3f5921(0x20c)),0x1;}for(const _0x3082c9 of _0xa6cad7[_0x3f5921(0x1fc)]){if(_0x3082c9[_0x3f5921(0x1dc)]||_0x3082c9[_0x3f5921(0x1d0)]){const _0x555858=a30_0xb40f93[_0x3f5921(0x1db)](_0x3082c9[_0x3f5921(0x1e7)]);!existsSync(_0x555858)&&mkdirSync(_0x555858,{'recursive':!![]}),writeFileSync(_0x3082c9['absolutePath'],_0x3082c9['content'],'utf-8');}}return console[_0x3f5921(0x1d4)](a30_0x280b13[_0x3f5921(0x1e2)](_0x3f5921(0x1cd)+(_0x12bdb5[_0x3f5921(0x1ca)]+_0x1596fd[_0x3f5921(0x1ca)])+_0x3f5921(0x1f1)+_0xa6cad7[_0x3f5921(0x204)])),saveSessionContext({'parent_segment':_0xa6cad7[_0x3f5921(0x1f3)]},_0x2dca8b[_0x3f5921(0x1ec)]),console[_0x3f5921(0x1d4)](a30_0x280b13['green'](_0x3f5921(0x200)+a30_0x280b13['dim'](_0x3f5921(0x1e4))+_0x3f5921(0x201)+a30_0x280b13[_0x3f5921(0x1c9)](_0xa6cad7[_0x3f5921(0x1f3)]))),0x0;}}
@@ -1 +1 @@
1
- const a31_0x4eb3d7=a31_0x33d2;(function(_0x36606d,_0x3fd7df){const _0x3bf464=a31_0x33d2,_0x425cc0=_0x36606d();while(!![]){try{const _0x20d72a=parseInt(_0x3bf464(0x1bd))/0x1+-parseInt(_0x3bf464(0x242))/0x2+parseInt(_0x3bf464(0x231))/0x3*(-parseInt(_0x3bf464(0x223))/0x4)+-parseInt(_0x3bf464(0x1ce))/0x5*(parseInt(_0x3bf464(0x213))/0x6)+parseInt(_0x3bf464(0x1b3))/0x7+parseInt(_0x3bf464(0x23c))/0x8+-parseInt(_0x3bf464(0x204))/0x9*(-parseInt(_0x3bf464(0x1dc))/0xa);if(_0x20d72a===_0x3fd7df)break;else _0x425cc0['push'](_0x425cc0['shift']());}catch(_0x499ac0){_0x425cc0['push'](_0x425cc0['shift']());}}}(a31_0x1c6a,0x67b65));function a31_0x1c6a(){const _0x306bf4=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','setPhase','\x0aValidation\x20failed:','parentFolder','nameToId','New\x20journey:','error','listJourneysWithDetailsFromParentSegment','journeysOnly','Fetching\x20existing\x20segments...','3024665NXIGvl','red','errorCode','\x20changed','endsWith','toString','\x20\x20πŸ“Š\x20Segments:','folderId','verbose','listActivations','327429aSEHnG','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','buildUserMaps','deleted','Resolving\x20parent\x20segment\x20\x27','audienceId','description','length','Fetching\x20existing\x20folders...','parentSegment','resolveParentId','data','get','type','/app/ps/','createdSegmentIds','285vMXQCc','blue','unchanged','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)','Aborted.','Site:\x20','Changes\x20to:','site','helpText','name','cyan','\x20to\x20create','all','map','29850RQULif','connection','repeat','segments','relationships','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','journeyBundleName','execute','/j/da/je','updated','toUpdate','cwd','createdAt','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','getOutputSchemaWithCache','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','activations','filter','file','Push\x20','\x20updated','Changes\x20to\x20journey:','\x20\x20Activations:','set','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parent_name','\x20changes?','message','list','versionNumber','isNew','Fetching\x20existing\x20journeys...','updatedAt','filePath','toDelete','parentName','Scoped\x20to\x20folder:\x20','segment:push','nameToType','.yml','297AkeIKJ','join','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','scopedFolderPath','then','yamlConfig','isScoped','folderPath','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','green','changed','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','πŸ“\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment\x20or\x20journey','65346lPHfZX','created','user','\x20\x20Activations:\x20','Fetching\x20users\x20for\x20email\x20resolution...','\x20to\x20update','existingJourney','results','toCreate','\x0aError:','\x20\x20\x20\x20','Error:\x20','no_parent','Fetching\x20parent\x20segment\x20details...','segment','New\x20segment:','8Plrieq','journeyId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20YAML\x20files\x20found','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','\x20to\x20delete','Error\x20parsing\x20YAML:\x20','(Journey\x20will\x20be\x20deleted)','Folders\x20to\x20create:','yellow','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','targetDir','Source\x20directory:\x20','attributes','444774QdPUWY','\x20activations]','delete','journeys','\x20new','\x20created','add','Parent\x20segment:\x20','segmentFolderId','idToName','diff','4157320yzvttO','push','getParent','\x20deleted','dim','\x0aPush\x20summary\x20for\x20\x27','71172SkgaqO','Delete\x20segment:','getJourney','journeyBundleId','journey'];a31_0x1c6a=function(){return _0x306bf4;};return a31_0x1c6a();}import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x3c19d4 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a31_0x33d2(_0x37ce65,_0x56b63a){_0x37ce65=_0x37ce65-0x1b1;const _0x1c6a50=a31_0x1c6a();let _0x33d270=_0x1c6a50[_0x37ce65];return _0x33d270;}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']=a31_0x4eb3d7(0x201);[a31_0x4eb3d7(0x1c4)]=a31_0x4eb3d7(0x20c);async[a31_0x4eb3d7(0x1e3)](_0x39f605){const _0x164267=a31_0x4eb3d7,{options:_0x504af2,args:_0x5b65dd,tdx:_0x3295d9}=_0x39f605,_0x273847=_0x504af2,_0x19766e=await resolveTarget({'arg':_0x5b65dd[0x0],'contextParent':_0x504af2[_0x164267(0x1c7)],'cwd':process[_0x164267(0x1e7)]()});if(!isSuccessfulResolution(_0x19766e))return _0x19766e[_0x164267(0x1b5)]===_0x164267(0x21f)?(console[_0x164267(0x24d)](a31_0x3c19d4['yellow'](_0x164267(0x1f4))),console[_0x164267(0x24d)](_0x164267(0x1d1)),console[_0x164267(0x24d)](_0x164267(0x247)),console[_0x164267(0x24d)](_0x164267(0x20f))):(console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x21e)+_0x19766e['message']+'\x0a')),_0x19766e[_0x164267(0x1d6)]&&console['error'](a31_0x3c19d4[_0x164267(0x1d8)](_0x19766e[_0x164267(0x1d6)]))),0x1;if(_0x19766e[_0x164267(0x1cb)]===_0x164267(0x1f5))return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)]('Error:\x20Directory\x20not\x20found:\x20'+_0x19766e['targetDir']+'\x0a')),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1d8)](_0x164267(0x1eb))),0x1;const _0x58e4e6=_0x19766e[_0x164267(0x1ff)],_0x1b3962=_0x19766e[_0x164267(0x22e)],_0x1f3b9f=_0x19766e['type']===_0x164267(0x1ee)?_0x19766e[_0x164267(0x1fd)]:undefined,_0x532167=getScopedDetails(_0x19766e),_0x3b4580=_0x532167?.[_0x164267(0x20a)]??![],_0x402998=_0x532167?.[_0x164267(0x207)]??'';if(!existsSync(_0x1b3962))return console[_0x164267(0x24d)](a31_0x3c19d4['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x1b3962+'\x0a')),console[_0x164267(0x24d)](a31_0x3c19d4['cyan'](_0x164267(0x1eb))),0x1;_0x273847[_0x164267(0x1bb)]&&(console[_0x164267(0x24d)](_0x164267(0x1d3)+_0x273847['site']),console['error'](_0x164267(0x238)+_0x58e4e6),console[_0x164267(0x24d)](_0x164267(0x22f)+_0x1b3962),_0x3b4580&&console['error'](_0x164267(0x200)+_0x402998));const _0x479944=await withSpinner(_0x164267(0x1c2)+_0x58e4e6+'\x27...',()=>_0x3295d9['segment'][_0x164267(0x1c8)](_0x58e4e6),{'verbose':_0x273847[_0x164267(0x1bb)]}),_0x56fdb8=_0x479944[_0x164267(0x1c9)],[_0x27af39,_0x44ef6e,_0x58c268,_0x285123,_0x299df7]=await Promise[_0x164267(0x1da)]([withSpinner(_0x164267(0x220),()=>_0x3295d9[_0x164267(0x221)][_0x164267(0x23e)](_0x56fdb8),{'verbose':_0x273847['verbose']}),withSpinner(_0x164267(0x1b2),()=>_0x3295d9[_0x164267(0x221)]['listSegments'](_0x56fdb8),{'verbose':_0x273847['verbose']}),withSpinner(_0x164267(0x1c6),()=>_0x3295d9[_0x164267(0x221)]['listFolders'](_0x56fdb8),{'verbose':_0x273847['verbose']}),withSpinner(_0x164267(0x1fb),()=>_0x3295d9[_0x164267(0x246)][_0x164267(0x24e)](_0x56fdb8,{'includeAllVersions':!![]}),{'verbose':_0x273847[_0x164267(0x1bb)]}),withSpinner(_0x164267(0x217),()=>_0x3295d9[_0x164267(0x215)][_0x164267(0x1c0)](),{'verbose':_0x273847[_0x164267(0x1bb)]})[_0x164267(0x208)](_0xe499ba=>_0xe499ba[_0x164267(0x1c9)])]),_0x560ecd=_0x27af39[_0x164267(0x1c9)],_0x13179c=extractRootFolderId(_0x560ecd),_0x12e078=_0x44ef6e[_0x164267(0x1c9)],_0x3160ba=_0x58c268[_0x164267(0x1c9)],{journeys:_0x320483,activationStepsById:_0x1d30e4}=_0x285123[_0x164267(0x1c9)],_0x14ee60=new Map(_0x320483[_0x164267(0x1db)](_0x31fafc=>[_0x31fafc['id'],_0x31fafc])),_0x3224ab=_0x320483['map'](_0x1629cd=>({'id':_0x1629cd['id'],'name':_0x1629cd[_0x164267(0x230)][_0x164267(0x1d7)],'journeyBundleName':_0x1629cd['attributes'][_0x164267(0x1e2)]||'','journeyBundleId':_0x1629cd[_0x164267(0x230)][_0x164267(0x245)]||'','versionNumber':_0x1629cd[_0x164267(0x230)][_0x164267(0x1f9)],'description':_0x1629cd['attributes']['description'],'state':_0x1629cd[_0x164267(0x230)]['state'],'paused':_0x1629cd['attributes']['paused'],'audienceId':_0x1629cd[_0x164267(0x230)][_0x164267(0x1c3)],'folderId':_0x1629cd[_0x164267(0x1e0)]?.[_0x164267(0x24a)]?.[_0x164267(0x1c9)]?.['id'],'createdAt':_0x1629cd['attributes'][_0x164267(0x1e8)],'updatedAt':_0x1629cd[_0x164267(0x230)][_0x164267(0x1fc)]})),{emailToId:_0x3435f3,idToEmail:_0x7b80aa}=_0x299df7,_0x22c6a1=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x740bed=_0x164267,_0x5a271b=await _0x3295d9[_0x740bed(0x1dd)][_0x740bed(0x1f8)]();return buildConnectionMaps(_0x5a271b);},{'verbose':_0x273847[_0x164267(0x1bb)]})[_0x164267(0x208)](_0x2a6b86=>_0x2a6b86[_0x164267(0x1c9)]),_0x153242=_0x22c6a1[_0x164267(0x24b)],_0x3ad2c9=_0x22c6a1[_0x164267(0x23a)],_0x2a9437=_0x22c6a1[_0x164267(0x202)],_0x2ab540={'emailToIdMap':_0x3435f3,'connectionNameToIdMap':_0x153242,'connectionNameToTypeMap':_0x2a9437,'getSchema':_0x4d623c=>_0x3295d9['connection'][_0x164267(0x1ea)](_0x4d623c)};let {pathToId:_0x4461f6,idToPath:_0x5c04dc}=buildFolderMaps(_0x3160ba);const _0xcfebb1=buildSegmentLookupMap(_0x12e078,_0x5c04dc),_0x53b15f=buildSegmentNameToIdMap(_0x12e078),_0x17158e=buildJourneyBundleLookupMap(_0x3224ab,_0x5c04dc);let _0x1d2910;if(_0x1f3b9f){if(!_0x1f3b9f[_0x164267(0x1b7)](_0x164267(0x203))&&!_0x1f3b9f[_0x164267(0x1b7)]('.yaml'))return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1f3b9f+'\x0a')),0x1;_0x1d2910=[_0x1f3b9f];}else _0x1d2910=findYamlFiles(_0x1b3962);if(_0x1d2910[_0x164267(0x1c5)]===0x0)return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x1e1)+_0x1b3962+'\x0a')),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1d8)](_0x164267(0x1e9))),0x1;let _0x29afad,_0x54fd76;try{const _0x4ef6ae=parseAndClassifyYamlFiles(_0x1d2910,_0x1b3962,{'skipSegments':_0x273847[_0x164267(0x1b1)]});_0x29afad=_0x4ef6ae[_0x164267(0x1df)],_0x54fd76=_0x4ef6ae['journeys'];const _0x5922e0=validateParsedFiles(_0x4ef6ae,_0x1b3962);if(_0x5922e0[_0x164267(0x1c5)]>0x0)return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x249))),console[_0x164267(0x24d)](formatValidationErrors(_0x5922e0)),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x22d))),0x1;}catch(_0xeb19d){return console['error'](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x229)+(_0xeb19d instanceof Error?_0xeb19d[_0x164267(0x1f7)]:_0xeb19d))),0x1;}if(_0x29afad[_0x164267(0x1c5)]===0x0&&_0x54fd76[_0x164267(0x1c5)]===0x0){const _0x580a5f=_0x273847[_0x164267(0x1b1)]?_0x164267(0x246):_0x164267(0x212);return console['error'](a31_0x3c19d4[_0x164267(0x22c)]('No\x20'+_0x580a5f+_0x164267(0x226))),0x0;}const _0x2e9fce=new Map();_0x12e078[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x12e078,async _0x4b740c=>{const _0xb175f0=a31_0x33d2,_0x30396a=await _0x3295d9[_0xb175f0(0x221)][_0xb175f0(0x1bc)](_0x56fdb8,_0x4b740c['id']);_0x2e9fce[_0xb175f0(0x1f3)](_0x4b740c['id'],_0x30396a);});},{'verbose':_0x273847['verbose']});const {segmentFiles:_0x550a7c,foldersToCreate:_0x5aee64}=await prepareSegmentFiles(_0x29afad,{'segmentByFolderAndName':_0xcfebb1,'activationsBySegmentId':_0x2e9fce,'folderPathToId':_0x4461f6,'idToEmailMap':_0x7b80aa,'connectionIdToNameMap':_0x3ad2c9},_0x2ab540,_0x3b4580,_0x402998),_0x2873f2=_0x1f3b9f?[]:findSegmentsToDelete(_0x12e078,_0x29afad[_0x164267(0x1db)](({yamlConfig:_0x2eb8ac,folderPath:_0x2d4cde})=>({'yamlConfig':_0x2eb8ac,'folderPath':resolveTDFolderPath(_0x2d4cde,_0x3b4580,_0x402998)})),_0x5c04dc,_0x402998,_0x3b4580),{journeyFiles:_0x1d3a66,foldersToCreate:_0x4469a8}=await withProgressSpinner('Preparing\x20journeys...',async _0x50b4b5=>prepareJourneyFiles(_0x54fd76,{'fetchJourney':async _0x46935d=>_0x3295d9[_0x164267(0x246)][_0x164267(0x244)](_0x46935d[_0x164267(0x224)]),'journeyBundlesByFolderAndName':_0x17158e,'folderPathToId':_0x4461f6,'idToEmailMap':_0x7b80aa,'connectionIdToNameMap':_0x3ad2c9,'existingSegments':_0x12e078,'parentId':_0x56fdb8,'deps':_0x3295d9,'progress':{'update':_0x4dd443=>{const _0x4ae266=_0x164267;_0x50b4b5[_0x4ae266(0x248)](_0x4dd443),_0x273847['verbose']&&console[_0x4ae266(0x24d)]('\x20\x20'+_0x4dd443);}},'journeyById':_0x14ee60,'activationStepsById':_0x1d30e4},_0x3b4580,_0x402998),{'verbose':_0x273847['verbose']})[_0x164267(0x208)](_0x374ee2=>_0x374ee2[_0x164267(0x1c9)]);for(const _0x4687ee of _0x4469a8){_0x5aee64[_0x164267(0x237)](_0x4687ee);}const _0x20c3d2=_0x1f3b9f?[]:findJourneysToDelete(_0x3224ab,_0x54fd76['map'](({yamlConfig:_0x5d1247,folderPath:_0x184b30})=>({'yamlConfig':_0x5d1247,'folderPath':resolveTDFolderPath(_0x184b30,_0x3b4580,_0x402998)})),_0x5c04dc,_0x402998,_0x3b4580),_0x3523e5=calculatePushStats(_0x550a7c,_0x1d3a66,_0x5aee64,_0x2873f2,_0x20c3d2,!!_0x273847['delete'],!!_0x273847[_0x164267(0x1b1)]),_0x5021e9=_0x3523e5[_0x164267(0x1df)]['new'],_0x18f1e0=_0x3523e5[_0x164267(0x1df)][_0x164267(0x20e)],_0x788575=_0x3523e5[_0x164267(0x1df)][_0x164267(0x1d0)],_0x2dba2c=_0x3523e5[_0x164267(0x1df)]['toDelete'],_0x514358=_0x3523e5['folders']['toCreate'],_0x294b5d=_0x3523e5[_0x164267(0x234)]['new'],_0x427274=_0x3523e5[_0x164267(0x234)]['changed'],_0x56ae0c=_0x3523e5[_0x164267(0x234)][_0x164267(0x1d0)],_0x188f0f=_0x3523e5[_0x164267(0x234)][_0x164267(0x1fe)],_0x452c26=_0x3523e5[_0x164267(0x1ec)]['all'],_0xe76370=_0x3523e5[_0x164267(0x1ec)][_0x164267(0x21b)],_0x3aeea2=_0x3523e5[_0x164267(0x1ec)][_0x164267(0x1e6)],_0x508727=_0x3523e5[_0x164267(0x1ec)]['toDelete'];console[_0x164267(0x24d)](_0x164267(0x241)+_0x58e4e6+'\x27:');_0x514358[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)]('\x20\x20'+a31_0x3c19d4[_0x164267(0x1cf)](_0x164267(0x210)+_0x514358[_0x164267(0x1c5)]+'\x20folders\x20to\x20create'));if(!_0x273847['journeysOnly']){console[_0x164267(0x24d)](_0x164267(0x1b9)),console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x20d)]('+\x20'+_0x5021e9[_0x164267(0x1c5)]+_0x164267(0x235))),console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x22c)]('~\x20'+_0x18f1e0[_0x164267(0x1c5)]+'\x20changed'));if(_0x2dba2c[_0x164267(0x1c5)]>0x0)console['error']('\x20\x20\x20\x20'+a31_0x3c19d4[_0x164267(0x1b4)]('-\x20'+_0x2dba2c[_0x164267(0x1c5)]+'\x20to\x20delete'));else _0x2873f2['length']>0x0&&!_0x273847[_0x164267(0x233)]&&console[_0x164267(0x24d)]('\x20\x20\x20\x20'+a31_0x3c19d4[_0x164267(0x240)](_0x2873f2[_0x164267(0x1c5)]+_0x164267(0x1bf)));console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x240)]('=\x20'+_0x788575[_0x164267(0x1c5)]+'\x20unchanged'));}if(_0x1d3a66[_0x164267(0x1c5)]>0x0||_0x20c3d2[_0x164267(0x1c5)]>0x0){console['error'](_0x164267(0x206)),console['error'](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x20d)]('+\x20'+_0x294b5d[_0x164267(0x1c5)]+_0x164267(0x235))),console['error'](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x22c)]('~\x20'+_0x427274[_0x164267(0x1c5)]+_0x164267(0x1b6)));if(_0x188f0f['length']>0x0)console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x1b4)]('-\x20'+_0x188f0f[_0x164267(0x1c5)]+_0x164267(0x228)));else _0x20c3d2[_0x164267(0x1c5)]>0x0&&!_0x273847['delete']&&console['error'](_0x164267(0x21d)+a31_0x3c19d4['dim'](_0x20c3d2['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4['dim']('=\x20'+_0x56ae0c[_0x164267(0x1c5)]+'\x20unchanged'));}_0x452c26['length']>0x0&&!_0x273847[_0x164267(0x1b1)]&&(console[_0x164267(0x24d)](''),console['error'](_0x164267(0x1f2)),_0xe76370[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4['green']('+\x20'+_0xe76370[_0x164267(0x1c5)]+_0x164267(0x1d9))),_0x3aeea2[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4[_0x164267(0x22c)]('~\x20'+_0x3aeea2['length']+_0x164267(0x218))),_0x508727[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)](_0x164267(0x21d)+a31_0x3c19d4['red']('-\x20'+_0x508727['length']+'\x20to\x20delete')));console[_0x164267(0x24d)]('\x20\x20Source:\x20'+a31_0x3c19d4[_0x164267(0x1d8)](_0x1b3962)+'\x0a');if(_0x514358[_0x164267(0x1c5)]>0x0){console[_0x164267(0x24d)](_0x164267(0x22b));for(const _0x1d4650 of _0x514358){console['error']('\x20\x20'+a31_0x3c19d4[_0x164267(0x1cf)]('+')+'\x20'+_0x1d4650);}console[_0x164267(0x24d)]('');}if(_0x5021e9[_0x164267(0x1c5)]>0x0&&!_0x273847['journeysOnly'])for(const _0x40008f of _0x5021e9){const _0x28351f=_0x40008f[_0x164267(0x20b)]?_0x40008f['folderPath']+'/'+_0x40008f[_0x164267(0x209)][_0x164267(0x1d7)]:_0x40008f[_0x164267(0x209)][_0x164267(0x1d7)],_0x21475d=_0x40008f[_0x164267(0x209)][_0x164267(0x1ec)]?.[_0x164267(0x1c5)]||0x0,_0x7d3945=_0x21475d>0x0?a31_0x3c19d4[_0x164267(0x240)]('\x20['+_0x21475d+_0x164267(0x232)):'';console[_0x164267(0x24d)]('\x0a'+a31_0x3c19d4[_0x164267(0x20d)](_0x164267(0x222))+'\x20'+_0x28351f+_0x7d3945),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c)),_0x40008f[_0x164267(0x23b)]&&console[_0x164267(0x24d)](_0x40008f[_0x164267(0x23b)]),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}if(_0x2dba2c[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)])for(const _0x48d68e of _0x2dba2c){const _0x3ad177=_0x48d68e['segmentFolderId']?_0x5c04dc[_0x164267(0x1ca)](_0x48d68e[_0x164267(0x239)][_0x164267(0x1b8)]())||'':'',_0x18badd=_0x3ad177?_0x3ad177+'/'+_0x48d68e[_0x164267(0x1d7)]:_0x48d68e['name'],_0x3a23f4=_0x2e9fce[_0x164267(0x1ca)](_0x48d68e['id'])||[],_0x129c51=_0x3a23f4[_0x164267(0x1c5)]>0x0?a31_0x3c19d4['dim']('\x20['+_0x3a23f4['length']+_0x164267(0x232)):'';console[_0x164267(0x24d)]('\x0a'+a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x243))+'\x20'+_0x18badd+_0x129c51),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));const _0x226f2e=segmentWithActivationsToYaml(_0x48d68e,_0x3a23f4,undefined,_0x7b80aa,_0x3ad2c9),_0x432596=segmentToYamlString(_0x226f2e),_0x11df4b=generateDiff(_0x432596,'');console[_0x164267(0x24d)](formatDiffWithColors(_0x11df4b)),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}const _0x40beb1=_0x550a7c[_0x164267(0x1ed)](_0x56f3dd=>!_0x56f3dd[_0x164267(0x1fa)]&&_0x56f3dd[_0x164267(0x23b)]);if(_0x40beb1[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)])for(const _0xee73b3 of _0x40beb1){const _0x4aaece=_0xee73b3[_0x164267(0x20b)]?_0xee73b3['folderPath']+'/'+_0xee73b3['yamlConfig'][_0x164267(0x1d7)]:_0xee73b3[_0x164267(0x209)][_0x164267(0x1d7)];console['error']('\x0a'+a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x1d4))+'\x20'+_0x4aaece),console['error']('─'['repeat'](0x3c)),console[_0x164267(0x24d)](_0xee73b3[_0x164267(0x23b)]),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}if(_0x294b5d[_0x164267(0x1c5)]>0x0)for(const _0x487caa of _0x294b5d){const _0x3508d4=_0x487caa[_0x164267(0x20b)]?_0x487caa[_0x164267(0x20b)]+'/'+_0x487caa[_0x164267(0x209)]['name']:_0x487caa['yamlConfig']['name'];console[_0x164267(0x24d)]('\x0a'+a31_0x3c19d4[_0x164267(0x20d)](_0x164267(0x24c))+'\x20'+_0x3508d4),console['error']('─'[_0x164267(0x1de)](0x3c)),_0x487caa[_0x164267(0x23b)]&&console[_0x164267(0x24d)](_0x487caa[_0x164267(0x23b)]),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}const _0x5c7385=_0x1d3a66[_0x164267(0x1ed)](_0x5e4f8c=>!_0x5e4f8c[_0x164267(0x1fa)]&&_0x5e4f8c['diff']);if(_0x5c7385['length']>0x0)for(const _0x111501 of _0x5c7385){const _0x230b76=_0x111501['folderPath']?_0x111501[_0x164267(0x20b)]+'/'+_0x111501[_0x164267(0x209)]['name']:_0x111501[_0x164267(0x209)]['name'];console[_0x164267(0x24d)]('\x0a'+a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x1f1))+'\x20'+_0x230b76),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c)),console[_0x164267(0x24d)](_0x111501['diff']),console['error']('─'[_0x164267(0x1de)](0x3c));}if(_0x188f0f[_0x164267(0x1c5)]>0x0)for(const _0x2b19bf of _0x188f0f){const _0x201ce1=_0x2b19bf['folderId']?_0x5c04dc['get'](_0x2b19bf[_0x164267(0x1ba)])||'':'',_0x38d8f2=_0x201ce1?_0x201ce1+'/'+_0x2b19bf[_0x164267(0x1e2)]:_0x2b19bf[_0x164267(0x1e2)];console['error']('\x0a'+a31_0x3c19d4[_0x164267(0x1b4)]('Delete\x20journey:')+'\x20'+_0x38d8f2),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c)),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x22a))),console[_0x164267(0x24d)]('─'[_0x164267(0x1de)](0x3c));}if(_0x273847['dryRun'])return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x227))),0x0;const _0x2ecaa0=_0x273847['journeysOnly']?![]:_0x5021e9[_0x164267(0x1c5)]>0x0||_0x18f1e0[_0x164267(0x1c5)]>0x0||_0x2dba2c['length']>0x0,_0x59d47a=_0x294b5d['length']>0x0||_0x427274['length']>0x0||_0x188f0f['length']>0x0,_0x27503b=_0x273847[_0x164267(0x1b1)]?![]:_0x452c26[_0x164267(0x1c5)]>0x0,_0x2df544=_0x514358[_0x164267(0x1c5)]>0x0;if(!_0x2ecaa0&&!_0x59d47a&&!_0x27503b&&!_0x2df544){const _0x33812c=_0x273847[_0x164267(0x1b1)]?'βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x164267(0x1be);console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x20d)](_0x33812c));if(_0x1f3b9f&&_0x56ae0c['length']===0x1){const _0x53cab1=_0x56ae0c[0x0];if(_0x53cab1[_0x164267(0x219)]?.['id']){const _0xb90678=getConsoleNextUrl(_0x273847[_0x164267(0x1d5)],_0x164267(0x1cc)+_0x56fdb8+'/e/'+_0x53cab1[_0x164267(0x219)]['id']+'/j/da/je');console[_0x164267(0x24d)]('\x20\x20'+a31_0x3c19d4['cyan'](_0xb90678));}}return 0x0;}const _0x41b2d8=_0x273847['journeysOnly']?_0x294b5d['length']+_0x427274[_0x164267(0x1c5)]+_0x188f0f['length']+_0x514358['length']:_0x5021e9[_0x164267(0x1c5)]+_0x18f1e0[_0x164267(0x1c5)]+_0x2dba2c[_0x164267(0x1c5)]+_0x294b5d[_0x164267(0x1c5)]+_0x427274[_0x164267(0x1c5)]+_0x188f0f[_0x164267(0x1c5)]+_0x514358[_0x164267(0x1c5)]+_0x452c26['length'];if(!_0x273847['yes']&&_0x41b2d8>0x0){if(!isInteractive())return console['error'](a31_0x3c19d4[_0x164267(0x1b4)](_0x164267(0x21c)),_0x164267(0x211)),console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x240)](_0x164267(0x225))),0x1;const _0x4baebb=await confirmKey(_0x164267(0x1ef)+_0x41b2d8+_0x164267(0x1f6));if(!_0x4baebb)return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x22c)](_0x164267(0x1d2))),0x1;}const _0x1d362a={'withProgress':async(_0x17c031,_0x8c6b13)=>{const _0x388841=_0x164267,_0x15f9ec=await withSpinner(_0x17c031,_0x8c6b13,{'verbose':_0x273847[_0x388841(0x1bb)]});return{'data':_0x15f9ec[_0x388841(0x1c9)]};},'logInfo':_0x1f2ed9=>console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x1cf)]('βœ”\x20'+_0x1f2ed9)),'logSuccess':_0x5bd1ca=>console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x20d)]('βœ”\x20'+_0x5bd1ca)),'logWarning':_0x3eef87=>console[_0x164267(0x24d)](a31_0x3c19d4['yellow']('⚠\x20'+_0x3eef87)),'logDeleted':_0x1a0921=>console[_0x164267(0x24d)](a31_0x3c19d4['red']('βœ”\x20'+_0x1a0921))},_0x3569ba={'segment':_0x3295d9[_0x164267(0x221)],'journey':_0x3295d9[_0x164267(0x246)],'user':_0x3295d9[_0x164267(0x215)],'connection':_0x3295d9['connection']};_0x514358[_0x164267(0x1c5)]>0x0&&(_0x4461f6=await executePushFolders(_0x3569ba,_0x514358,_0x4461f6,{'parentId':_0x56fdb8},_0x1d362a));const _0x5dd7ac={'rootFolderId':_0x13179c,'folderPathToId':_0x4461f6,'folderIdToPath':_0x5c04dc,'segmentNameToId':_0x53b15f,'activationsBySegmentId':_0x2e9fce,'emailToIdMap':_0x3435f3,'idToEmailMap':_0x7b80aa,'connectionNameToIdMap':_0x22c6a1[_0x164267(0x24b)],'connectionIdToNameMap':_0x22c6a1[_0x164267(0x23a)],'connectionNameToTypeMap':_0x2a9437},_0x245305=await executePushSegments(_0x3569ba,_0x273847[_0x164267(0x1b1)]?[]:_0x550a7c,_0x5dd7ac,{'parentId':_0x56fdb8},_0x1d362a),_0x3ff4fa=_0x245305[_0x164267(0x214)],_0x2294c3=_0x245305['updated'],_0x24eac4=_0x245305[_0x164267(0x1ec)][_0x164267(0x214)],_0xa1847d=_0x245305['activations'][_0x164267(0x1e5)],_0x1202d7=_0x245305[_0x164267(0x1ec)][_0x164267(0x1c1)],_0x5f0618=await executePushSegmentDeletions(_0x3569ba,_0x273847[_0x164267(0x1b1)]?[]:_0x2dba2c,_0x1d362a);let _0x511a1a=0x0,_0x23dd88=0x0,_0x5d4450=0x0;const _0x1bf2b0=new Map(_0x53b15f);for(const [_0x562be6,_0xff0308]of _0x245305[_0x164267(0x1cd)]){_0x1bf2b0[_0x164267(0x1f3)](_0x562be6,_0xff0308);}if(_0x1d3a66[_0x164267(0x1c5)]>0x0){const _0x5cc9fc={..._0x5dd7ac,'segmentNameToId':_0x1bf2b0,'existingSegments':_0x12e078,'activationContext':_0x2ab540},_0x37dab7=await executePushJourneys(_0x3569ba,_0x1d3a66,_0x5cc9fc,{'parentId':_0x56fdb8,'rootFolderId':_0x13179c,'verbose':_0x273847[_0x164267(0x1bb)]},_0x1d362a);_0x511a1a=_0x37dab7[_0x164267(0x214)],_0x23dd88=_0x37dab7[_0x164267(0x1e5)];if(_0x1f3b9f&&_0x37dab7[_0x164267(0x21a)][_0x164267(0x1c5)]===0x1){const _0x47690a=_0x37dab7['results'][0x0];if(_0x47690a[_0x164267(0x224)]){const _0x1703a2=getConsoleNextUrl(_0x273847['site'],_0x164267(0x1cc)+_0x56fdb8+'/e/'+_0x47690a['journeyId']+_0x164267(0x1e4));console[_0x164267(0x24d)]('\x20\x20'+a31_0x3c19d4['cyan'](_0x1703a2));}}}for(const _0x3b44be of _0x188f0f){console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x22c)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x3b44be[_0x164267(0x1e2)])),_0x5d4450++;}const _0x4ba1bf=[];if(_0x3ff4fa>0x0)_0x4ba1bf[_0x164267(0x23d)](_0x3ff4fa+_0x164267(0x236));if(_0x2294c3>0x0)_0x4ba1bf['push'](_0x2294c3+_0x164267(0x1f0));if(_0x5f0618>0x0)_0x4ba1bf[_0x164267(0x23d)](_0x5f0618+_0x164267(0x23f));const _0x1f0487=[];if(_0x511a1a>0x0)_0x1f0487['push'](_0x511a1a+'\x20created');if(_0x23dd88>0x0)_0x1f0487[_0x164267(0x23d)](_0x23dd88+_0x164267(0x1f0));if(_0x5d4450>0x0)_0x1f0487[_0x164267(0x23d)](_0x5d4450+_0x164267(0x23f));const _0x26391e=[];if(_0x24eac4>0x0)_0x26391e[_0x164267(0x23d)](_0x24eac4+_0x164267(0x236));if(_0xa1847d>0x0)_0x26391e['push'](_0xa1847d+_0x164267(0x1f0));if(_0x1202d7>0x0)_0x26391e[_0x164267(0x23d)](_0x1202d7+'\x20deleted');return console[_0x164267(0x24d)](a31_0x3c19d4[_0x164267(0x20d)]('\x0aβœ”\x20Push\x20complete')),_0x4ba1bf[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)]&&console[_0x164267(0x24d)]('\x20\x20Segments:\x20'+_0x4ba1bf[_0x164267(0x205)](',\x20')),_0x1f0487[_0x164267(0x1c5)]>0x0&&console[_0x164267(0x24d)]('\x20\x20Journeys:\x20'+_0x1f0487[_0x164267(0x205)](',\x20')),_0x26391e[_0x164267(0x1c5)]>0x0&&!_0x273847[_0x164267(0x1b1)]&&console[_0x164267(0x24d)](_0x164267(0x216)+_0x26391e[_0x164267(0x205)](',\x20')),0x0;}}
1
+ const a31_0x3e7923=a31_0x316c;function a31_0x316c(_0x225de5,_0x7ca5fb){_0x225de5=_0x225de5-0x1ed;const _0x2c5497=a31_0x2c54();let _0x316cbd=_0x2c5497[_0x225de5];return _0x316cbd;}(function(_0x3df46c,_0x166ee2){const _0xc4e248=a31_0x316c,_0x54e556=_0x3df46c();while(!![]){try{const _0x5ce538=parseInt(_0xc4e248(0x23c))/0x1*(-parseInt(_0xc4e248(0x223))/0x2)+parseInt(_0xc4e248(0x273))/0x3+parseInt(_0xc4e248(0x268))/0x4+-parseInt(_0xc4e248(0x229))/0x5+-parseInt(_0xc4e248(0x236))/0x6+-parseInt(_0xc4e248(0x261))/0x7*(-parseInt(_0xc4e248(0x21d))/0x8)+-parseInt(_0xc4e248(0x230))/0x9;if(_0x5ce538===_0x166ee2)break;else _0x54e556['push'](_0x54e556['shift']());}catch(_0x35e64d){_0x54e556['push'](_0x54e556['shift']());}}}(a31_0x2c54,0x8fb59));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x790da0 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a31_0x2c54(){const _0x442a35=['isNew','\x20changes?','\x20deleted','updated','journey','.yaml','setPhase','delete','folderId','activations','then','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','segmentFolderId','updatedAt','\x0aError:','segment','filter','site','cwd','errorCode','listSegments','segment:push','Fetching\x20existing\x20folders...','folderPath','Delete\x20journey:','new','helpText','\x0aβœ”\x20Push\x20complete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Resolving\x20parent\x20segment\x20\x27','push','\x20to\x20update','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','yamlConfig','/j/da/je','toUpdate','\x20\x20Source:\x20','Error\x20parsing\x20YAML:\x20','cyan','verbose','journeyId','Error:\x20','name','getParent','2146264hwHqQI','existingJourney','add','dim','createdSegmentIds','message','326iUIsAf','red','Fetching\x20existing\x20segments...','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','get','idToName','1207255BHrDOZ','created','nameToType','user','journeys','parent_name','diff','1507941GBRXKT','Changes\x20to:','\x20\x20Journeys:\x20','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','segments','state','1121196jzVhbM','\x20YAML\x20files\x20found','toDelete','buildUserMaps','\x20\x20\x20\x20','\x20folders\x20to\x20create','4162sNnXlD','/e/','targetDir','connection','Push\x20','No\x20','\x20to\x20delete','all','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','blue','Changes\x20to\x20journey:','isScoped','\x0aPush\x20summary\x20for\x20\x27','map','yes','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20changed','join','Source\x20directory:\x20','deleted','\x20\x20Activations:\x20','repeat','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Folders\x20to\x20create:','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20Segments:\x20','toCreate','.yml','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x27...','endsWith','changed','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','nameToId','length','Fetching\x20existing\x20activations...','21roYEDA','\x20unchanged','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20users\x20for\x20email\x20resolution...','parentSegment','versionNumber','2946104imcUYp','journeysOnly','\x20activations]','\x0aValidation\x20failed:','Preparing\x20journeys...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','toString','Scoped\x20to\x20folder:\x20','parentName','journeyBundleName','/app/ps/','964590jwArwY','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','attributes','listFolders','results','New\x20journey:','listActivations','type','set','\x20to\x20create','audienceId','Delete\x20segment:','green','scopedFolderPath','Aborted.','\x20created','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yellow','Fetching\x20parent\x20segment\x20details...','createdAt','\x20new','filePath','journeyBundleId','dryRun','list','data','error','getJourney','execute','New\x20segment:','no_parent'];a31_0x2c54=function(){return _0x442a35;};return a31_0x2c54();}import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x3e7923(0x21b)]=a31_0x3e7923(0x206);['description']=a31_0x3e7923(0x252);async[a31_0x3e7923(0x1ee)](_0x4488ea){const _0x49bb6c=a31_0x3e7923,{options:_0x3f5f94,args:_0x47d877,tdx:_0x1bb87a}=_0x4488ea,_0x342908=_0x3f5f94,_0x143246=await resolveTarget({'arg':_0x47d877[0x0],'contextParent':_0x3f5f94[_0x49bb6c(0x266)],'cwd':process[_0x49bb6c(0x203)]()});if(!isSuccessfulResolution(_0x143246))return _0x143246[_0x49bb6c(0x204)]===_0x49bb6c(0x1f0)?(console['error'](a31_0x790da0['yellow'](_0x49bb6c(0x244))),console[_0x49bb6c(0x28d)](_0x49bb6c(0x274)),console[_0x49bb6c(0x28d)](_0x49bb6c(0x26d)),console[_0x49bb6c(0x28d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x21a)+_0x143246[_0x49bb6c(0x222)]+'\x0a')),_0x143246[_0x49bb6c(0x20b)]&&console['error'](a31_0x790da0[_0x49bb6c(0x217)](_0x143246[_0x49bb6c(0x20b)]))),0x1;if(_0x143246[_0x49bb6c(0x27a)]===_0x49bb6c(0x22e))return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x264)+_0x143246[_0x49bb6c(0x23e)]+'\x0a')),console['error'](a31_0x790da0[_0x49bb6c(0x217)](_0x49bb6c(0x20d))),0x1;const _0x1245c9=_0x143246[_0x49bb6c(0x270)],_0x3805f2=_0x143246['targetDir'],_0x320faa=_0x143246[_0x49bb6c(0x27a)]==='file'?_0x143246[_0x49bb6c(0x288)]:undefined,_0x17b599=getScopedDetails(_0x143246),_0x1f2507=_0x17b599?.[_0x49bb6c(0x247)]??![],_0x5cecaa=_0x17b599?.[_0x49bb6c(0x280)]??'';if(!existsSync(_0x3805f2))return console['error'](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x264)+_0x3805f2+'\x0a')),console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x217)](_0x49bb6c(0x20d))),0x1;_0x342908[_0x49bb6c(0x218)]&&(console[_0x49bb6c(0x28d)]('Site:\x20'+_0x342908[_0x49bb6c(0x202)]),console[_0x49bb6c(0x28d)]('Parent\x20segment:\x20'+_0x1245c9),console[_0x49bb6c(0x28d)](_0x49bb6c(0x24e)+_0x3805f2),_0x1f2507&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x26f)+_0x5cecaa));const _0x306f23=await withSpinner(_0x49bb6c(0x20e)+_0x1245c9+_0x49bb6c(0x259),()=>_0x1bb87a[_0x49bb6c(0x200)]['resolveParentId'](_0x1245c9),{'verbose':_0x342908[_0x49bb6c(0x218)]}),_0x189b3e=_0x306f23[_0x49bb6c(0x28c)],[_0x4f14de,_0x4c524d,_0x445900,_0x444c63,_0x125f63]=await Promise[_0x49bb6c(0x243)]([withSpinner(_0x49bb6c(0x285),()=>_0x1bb87a[_0x49bb6c(0x200)][_0x49bb6c(0x21c)](_0x189b3e),{'verbose':_0x342908[_0x49bb6c(0x218)]}),withSpinner(_0x49bb6c(0x225),()=>_0x1bb87a[_0x49bb6c(0x200)][_0x49bb6c(0x205)](_0x189b3e),{'verbose':_0x342908[_0x49bb6c(0x218)]}),withSpinner(_0x49bb6c(0x207),()=>_0x1bb87a['segment'][_0x49bb6c(0x276)](_0x189b3e),{'verbose':_0x342908[_0x49bb6c(0x218)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x1bb87a['journey']['listJourneysWithDetailsFromParentSegment'](_0x189b3e,{'includeAllVersions':!![]}),{'verbose':_0x342908[_0x49bb6c(0x218)]}),withSpinner(_0x49bb6c(0x265),()=>_0x1bb87a[_0x49bb6c(0x22c)][_0x49bb6c(0x239)](),{'verbose':_0x342908[_0x49bb6c(0x218)]})['then'](_0x21a4b6=>_0x21a4b6[_0x49bb6c(0x28c)])]),_0x1e2ea9=_0x4f14de[_0x49bb6c(0x28c)],_0x53c20d=extractRootFolderId(_0x1e2ea9),_0x44a7da=_0x4c524d[_0x49bb6c(0x28c)],_0x29b5c9=_0x445900[_0x49bb6c(0x28c)],{journeys:_0x2bc923,activationStepsById:_0x4483dd}=_0x444c63[_0x49bb6c(0x28c)],_0x5e0623=new Map(_0x2bc923[_0x49bb6c(0x249)](_0x550bcb=>[_0x550bcb['id'],_0x550bcb])),_0x5e4807=_0x2bc923['map'](_0x3a4d91=>({'id':_0x3a4d91['id'],'name':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x21b)],'journeyBundleName':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x271)]||'','journeyBundleId':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x289)]||'','versionNumber':_0x3a4d91['attributes'][_0x49bb6c(0x267)],'description':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x25c)],'state':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x235)],'paused':_0x3a4d91['attributes']['paused'],'audienceId':_0x3a4d91['attributes'][_0x49bb6c(0x27d)],'folderId':_0x3a4d91['relationships']?.['parentFolder']?.[_0x49bb6c(0x28c)]?.['id'],'createdAt':_0x3a4d91['attributes'][_0x49bb6c(0x286)],'updatedAt':_0x3a4d91[_0x49bb6c(0x275)][_0x49bb6c(0x1fe)]})),{emailToId:_0x3fb433,idToEmail:_0xaccaab}=_0x125f63,_0x13195e=await withSpinner(_0x49bb6c(0x254),async()=>{const _0x8c8454=_0x49bb6c,_0x4c3f31=await _0x1bb87a[_0x8c8454(0x23f)][_0x8c8454(0x28b)]();return buildConnectionMaps(_0x4c3f31);},{'verbose':_0x342908[_0x49bb6c(0x218)]})[_0x49bb6c(0x1fb)](_0x1c80b1=>_0x1c80b1[_0x49bb6c(0x28c)]),_0x5aa211=_0x13195e[_0x49bb6c(0x25e)],_0x34bc3e=_0x13195e[_0x49bb6c(0x228)],_0x299999=_0x13195e[_0x49bb6c(0x22b)],_0x1cadb1={'emailToIdMap':_0x3fb433,'connectionNameToIdMap':_0x5aa211,'connectionNameToTypeMap':_0x299999,'getSchema':_0x5a5bc1=>_0x1bb87a[_0x49bb6c(0x23f)]['getOutputSchemaWithCache'](_0x5a5bc1)};let {pathToId:_0x1ca34b,idToPath:_0x4481e6}=buildFolderMaps(_0x29b5c9);const _0x3d2eda=buildSegmentLookupMap(_0x44a7da,_0x4481e6),_0x11d641=buildSegmentNameToIdMap(_0x44a7da),_0x222133=buildJourneyBundleLookupMap(_0x5e4807,_0x4481e6);let _0x66f4fd;if(_0x320faa){if(!_0x320faa['endsWith'](_0x49bb6c(0x257))&&!_0x320faa[_0x49bb6c(0x25a)](_0x49bb6c(0x1f6)))return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x283)+_0x320faa+'\x0a')),0x1;_0x66f4fd=[_0x320faa];}else _0x66f4fd=findYamlFiles(_0x3805f2);if(_0x66f4fd[_0x49bb6c(0x25f)]===0x0)return console['error'](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x25d)+_0x3805f2+'\x0a')),console['error'](a31_0x790da0[_0x49bb6c(0x217)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x4be9e4,_0x1c52b4;try{const _0x2caee1=parseAndClassifyYamlFiles(_0x66f4fd,_0x3805f2,{'skipSegments':_0x342908[_0x49bb6c(0x269)]});_0x4be9e4=_0x2caee1[_0x49bb6c(0x234)],_0x1c52b4=_0x2caee1['journeys'];const _0x37a297=validateParsedFiles(_0x2caee1,_0x3805f2);if(_0x37a297[_0x49bb6c(0x25f)]>0x0)return console['error'](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x26b))),console[_0x49bb6c(0x28d)](formatValidationErrors(_0x37a297)),console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x1fc))),0x1;}catch(_0x39f4d2){return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x216)+(_0x39f4d2 instanceof Error?_0x39f4d2[_0x49bb6c(0x222)]:_0x39f4d2))),0x1;}if(_0x4be9e4[_0x49bb6c(0x25f)]===0x0&&_0x1c52b4[_0x49bb6c(0x25f)]===0x0){const _0x41262a=_0x342908[_0x49bb6c(0x269)]?_0x49bb6c(0x1f5):'segment\x20or\x20journey';return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x241)+_0x41262a+_0x49bb6c(0x237))),0x0;}const _0x33fe7b=new Map();_0x44a7da['length']>0x0&&!_0x342908[_0x49bb6c(0x269)]&&await withSpinner(_0x49bb6c(0x260),async()=>{await batchAsync(_0x44a7da,async _0x191714=>{const _0x282d0b=a31_0x316c,_0x301b64=await _0x1bb87a[_0x282d0b(0x200)][_0x282d0b(0x279)](_0x189b3e,_0x191714['id']);_0x33fe7b[_0x282d0b(0x27b)](_0x191714['id'],_0x301b64);});},{'verbose':_0x342908['verbose']});const {segmentFiles:_0x50401a,foldersToCreate:_0x1ce0d1}=await prepareSegmentFiles(_0x4be9e4,{'segmentByFolderAndName':_0x3d2eda,'activationsBySegmentId':_0x33fe7b,'folderPathToId':_0x1ca34b,'idToEmailMap':_0xaccaab,'connectionIdToNameMap':_0x34bc3e},_0x1cadb1,_0x1f2507,_0x5cecaa),_0x19fcad=_0x320faa?[]:findSegmentsToDelete(_0x44a7da,_0x4be9e4[_0x49bb6c(0x249)](({yamlConfig:_0x31be6c,folderPath:_0xe27859})=>({'yamlConfig':_0x31be6c,'folderPath':resolveTDFolderPath(_0xe27859,_0x1f2507,_0x5cecaa)})),_0x4481e6,_0x5cecaa,_0x1f2507),{journeyFiles:_0x2a7fa4,foldersToCreate:_0x26a619}=await withProgressSpinner(_0x49bb6c(0x26c),async _0x52c6ac=>prepareJourneyFiles(_0x1c52b4,{'fetchJourney':async _0x5a83f1=>_0x1bb87a['journey'][_0x49bb6c(0x1ed)](_0x5a83f1[_0x49bb6c(0x219)]),'journeyBundlesByFolderAndName':_0x222133,'folderPathToId':_0x1ca34b,'idToEmailMap':_0xaccaab,'connectionIdToNameMap':_0x34bc3e,'existingSegments':_0x44a7da,'parentId':_0x189b3e,'deps':_0x1bb87a,'progress':{'update':_0x511c39=>{const _0x5e3a61=_0x49bb6c;_0x52c6ac[_0x5e3a61(0x1f7)](_0x511c39),_0x342908[_0x5e3a61(0x218)]&&console[_0x5e3a61(0x28d)]('\x20\x20'+_0x511c39);}},'journeyById':_0x5e0623,'activationStepsById':_0x4483dd},_0x1f2507,_0x5cecaa),{'verbose':_0x342908['verbose']})[_0x49bb6c(0x1fb)](_0x4aa476=>_0x4aa476[_0x49bb6c(0x28c)]);for(const _0x55daa1 of _0x26a619){_0x1ce0d1[_0x49bb6c(0x21f)](_0x55daa1);}const _0x55c4f3=_0x320faa?[]:findJourneysToDelete(_0x5e4807,_0x1c52b4['map'](({yamlConfig:_0x1207b2,folderPath:_0x138dc9})=>({'yamlConfig':_0x1207b2,'folderPath':resolveTDFolderPath(_0x138dc9,_0x1f2507,_0x5cecaa)})),_0x4481e6,_0x5cecaa,_0x1f2507),_0x3899fb=calculatePushStats(_0x50401a,_0x2a7fa4,_0x1ce0d1,_0x19fcad,_0x55c4f3,!!_0x342908[_0x49bb6c(0x1f8)],!!_0x342908[_0x49bb6c(0x269)]),_0x4357fc=_0x3899fb['segments'][_0x49bb6c(0x20a)],_0x5ac274=_0x3899fb[_0x49bb6c(0x234)][_0x49bb6c(0x25b)],_0x21f273=_0x3899fb[_0x49bb6c(0x234)]['unchanged'],_0x3d79de=_0x3899fb[_0x49bb6c(0x234)][_0x49bb6c(0x238)],_0x1793cb=_0x3899fb['folders'][_0x49bb6c(0x256)],_0x1670b0=_0x3899fb[_0x49bb6c(0x22d)][_0x49bb6c(0x20a)],_0x4fa355=_0x3899fb[_0x49bb6c(0x22d)][_0x49bb6c(0x25b)],_0xfafad4=_0x3899fb['journeys']['unchanged'],_0x301ca5=_0x3899fb['journeys'][_0x49bb6c(0x238)],_0xd8e364=_0x3899fb[_0x49bb6c(0x1fa)]['all'],_0x35a3a9=_0x3899fb[_0x49bb6c(0x1fa)][_0x49bb6c(0x256)],_0x473e9d=_0x3899fb[_0x49bb6c(0x1fa)][_0x49bb6c(0x214)],_0x3f3490=_0x3899fb[_0x49bb6c(0x1fa)][_0x49bb6c(0x238)];console['error'](_0x49bb6c(0x248)+_0x1245c9+'\x27:');_0x1793cb['length']>0x0&&console['error']('\x20\x20'+a31_0x790da0[_0x49bb6c(0x245)]('πŸ“\x20'+_0x1793cb[_0x49bb6c(0x25f)]+_0x49bb6c(0x23b)));if(!_0x342908['journeysOnly']){console[_0x49bb6c(0x28d)]('\x20\x20πŸ“Š\x20Segments:'),console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x27f)]('+\x20'+_0x4357fc[_0x49bb6c(0x25f)]+_0x49bb6c(0x287))),console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x284)]('~\x20'+_0x5ac274[_0x49bb6c(0x25f)]+_0x49bb6c(0x24c)));if(_0x3d79de[_0x49bb6c(0x25f)]>0x0)console[_0x49bb6c(0x28d)]('\x20\x20\x20\x20'+a31_0x790da0['red']('-\x20'+_0x3d79de[_0x49bb6c(0x25f)]+_0x49bb6c(0x242)));else _0x19fcad[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x1f8)]&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x220)](_0x19fcad[_0x49bb6c(0x25f)]+_0x49bb6c(0x211)));console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x220)]('=\x20'+_0x21f273[_0x49bb6c(0x25f)]+_0x49bb6c(0x262)));}if(_0x2a7fa4[_0x49bb6c(0x25f)]>0x0||_0x55c4f3['length']>0x0){console[_0x49bb6c(0x28d)](_0x49bb6c(0x233)),console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x27f)]('+\x20'+_0x1670b0[_0x49bb6c(0x25f)]+_0x49bb6c(0x287))),console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0['yellow']('~\x20'+_0x4fa355[_0x49bb6c(0x25f)]+_0x49bb6c(0x24c)));if(_0x301ca5[_0x49bb6c(0x25f)]>0x0)console[_0x49bb6c(0x28d)]('\x20\x20\x20\x20'+a31_0x790da0[_0x49bb6c(0x224)]('-\x20'+_0x301ca5[_0x49bb6c(0x25f)]+_0x49bb6c(0x242)));else _0x55c4f3[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x1f8)]&&console['error']('\x20\x20\x20\x20'+a31_0x790da0[_0x49bb6c(0x220)](_0x55c4f3['length']+_0x49bb6c(0x211)));console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0['dim']('=\x20'+_0xfafad4[_0x49bb6c(0x25f)]+_0x49bb6c(0x262)));}_0xd8e364[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x269)]&&(console['error'](''),console[_0x49bb6c(0x28d)]('\x20\x20Activations:'),_0x35a3a9[_0x49bb6c(0x25f)]>0x0&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0['green']('+\x20'+_0x35a3a9['length']+_0x49bb6c(0x27c))),_0x473e9d['length']>0x0&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x284)]('~\x20'+_0x473e9d[_0x49bb6c(0x25f)]+_0x49bb6c(0x210))),_0x3f3490['length']>0x0&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x23a)+a31_0x790da0[_0x49bb6c(0x224)]('-\x20'+_0x3f3490['length']+_0x49bb6c(0x242))));console[_0x49bb6c(0x28d)](_0x49bb6c(0x215)+a31_0x790da0[_0x49bb6c(0x217)](_0x3805f2)+'\x0a');if(_0x1793cb[_0x49bb6c(0x25f)]>0x0){console[_0x49bb6c(0x28d)](_0x49bb6c(0x253));for(const _0xb0c78f of _0x1793cb){console[_0x49bb6c(0x28d)]('\x20\x20'+a31_0x790da0[_0x49bb6c(0x245)]('+')+'\x20'+_0xb0c78f);}console[_0x49bb6c(0x28d)]('');}if(_0x4357fc[_0x49bb6c(0x25f)]>0x0&&!_0x342908['journeysOnly'])for(const _0x5b484 of _0x4357fc){const _0x2fb8c=_0x5b484[_0x49bb6c(0x208)]?_0x5b484['folderPath']+'/'+_0x5b484[_0x49bb6c(0x212)]['name']:_0x5b484[_0x49bb6c(0x212)][_0x49bb6c(0x21b)],_0x26a54c=_0x5b484[_0x49bb6c(0x212)][_0x49bb6c(0x1fa)]?.[_0x49bb6c(0x25f)]||0x0,_0x4cddd5=_0x26a54c>0x0?a31_0x790da0[_0x49bb6c(0x220)]('\x20['+_0x26a54c+'\x20activations]'):'';console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0[_0x49bb6c(0x27f)](_0x49bb6c(0x1ef))+'\x20'+_0x2fb8c+_0x4cddd5),console['error']('─'[_0x49bb6c(0x251)](0x3c)),_0x5b484[_0x49bb6c(0x22f)]&&console[_0x49bb6c(0x28d)](_0x5b484[_0x49bb6c(0x22f)]),console[_0x49bb6c(0x28d)]('─'['repeat'](0x3c));}if(_0x3d79de[_0x49bb6c(0x25f)]>0x0&&!_0x342908['journeysOnly'])for(const _0x2ecf04 of _0x3d79de){const _0x57524f=_0x2ecf04[_0x49bb6c(0x1fd)]?_0x4481e6['get'](_0x2ecf04[_0x49bb6c(0x1fd)][_0x49bb6c(0x26e)]())||'':'',_0x50c240=_0x57524f?_0x57524f+'/'+_0x2ecf04[_0x49bb6c(0x21b)]:_0x2ecf04[_0x49bb6c(0x21b)],_0x52e976=_0x33fe7b[_0x49bb6c(0x227)](_0x2ecf04['id'])||[],_0x39541f=_0x52e976['length']>0x0?a31_0x790da0[_0x49bb6c(0x220)]('\x20['+_0x52e976[_0x49bb6c(0x25f)]+_0x49bb6c(0x26a)):'';console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0['red'](_0x49bb6c(0x27e))+'\x20'+_0x50c240+_0x39541f),console['error']('─'[_0x49bb6c(0x251)](0x3c));const _0x3ede48=segmentWithActivationsToYaml(_0x2ecf04,_0x52e976,undefined,_0xaccaab,_0x34bc3e),_0x3197aa=segmentToYamlString(_0x3ede48),_0x5a747c=generateDiff(_0x3197aa,'');console[_0x49bb6c(0x28d)](formatDiffWithColors(_0x5a747c)),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c));}const _0x345968=_0x50401a['filter'](_0xc82496=>!_0xc82496[_0x49bb6c(0x1f1)]&&_0xc82496[_0x49bb6c(0x22f)]);if(_0x345968[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x269)])for(const _0x4e85d2 of _0x345968){const _0x4c69e5=_0x4e85d2['folderPath']?_0x4e85d2[_0x49bb6c(0x208)]+'/'+_0x4e85d2[_0x49bb6c(0x212)][_0x49bb6c(0x21b)]:_0x4e85d2[_0x49bb6c(0x212)]['name'];console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x231))+'\x20'+_0x4c69e5),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c)),console[_0x49bb6c(0x28d)](_0x4e85d2[_0x49bb6c(0x22f)]),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c));}if(_0x1670b0[_0x49bb6c(0x25f)]>0x0)for(const _0x1ccf74 of _0x1670b0){const _0x4fb3fb=_0x1ccf74[_0x49bb6c(0x208)]?_0x1ccf74[_0x49bb6c(0x208)]+'/'+_0x1ccf74['yamlConfig']['name']:_0x1ccf74['yamlConfig']['name'];console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0[_0x49bb6c(0x27f)](_0x49bb6c(0x278))+'\x20'+_0x4fb3fb),console[_0x49bb6c(0x28d)]('─'['repeat'](0x3c)),_0x1ccf74[_0x49bb6c(0x22f)]&&console[_0x49bb6c(0x28d)](_0x1ccf74[_0x49bb6c(0x22f)]),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c));}const _0x5a906e=_0x2a7fa4[_0x49bb6c(0x201)](_0x241689=>!_0x241689[_0x49bb6c(0x1f1)]&&_0x241689[_0x49bb6c(0x22f)]);if(_0x5a906e[_0x49bb6c(0x25f)]>0x0)for(const _0x8298e1 of _0x5a906e){const _0x482a74=_0x8298e1[_0x49bb6c(0x208)]?_0x8298e1[_0x49bb6c(0x208)]+'/'+_0x8298e1[_0x49bb6c(0x212)][_0x49bb6c(0x21b)]:_0x8298e1[_0x49bb6c(0x212)][_0x49bb6c(0x21b)];console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x246))+'\x20'+_0x482a74),console[_0x49bb6c(0x28d)]('─'['repeat'](0x3c)),console['error'](_0x8298e1['diff']),console['error']('─'[_0x49bb6c(0x251)](0x3c));}if(_0x301ca5[_0x49bb6c(0x25f)]>0x0)for(const _0x517ce1 of _0x301ca5){const _0x1ee617=_0x517ce1[_0x49bb6c(0x1f9)]?_0x4481e6['get'](_0x517ce1['folderId'])||'':'',_0x19e4c4=_0x1ee617?_0x1ee617+'/'+_0x517ce1[_0x49bb6c(0x271)]:_0x517ce1[_0x49bb6c(0x271)];console[_0x49bb6c(0x28d)]('\x0a'+a31_0x790da0['red'](_0x49bb6c(0x209))+'\x20'+_0x19e4c4),console[_0x49bb6c(0x28d)]('─'[_0x49bb6c(0x251)](0x3c)),console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)]('(Journey\x20will\x20be\x20deleted)')),console[_0x49bb6c(0x28d)]('─'['repeat'](0x3c));}if(_0x342908[_0x49bb6c(0x28a)])return console[_0x49bb6c(0x28d)](a31_0x790da0['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x248205=_0x342908[_0x49bb6c(0x269)]?![]:_0x4357fc[_0x49bb6c(0x25f)]>0x0||_0x5ac274[_0x49bb6c(0x25f)]>0x0||_0x3d79de[_0x49bb6c(0x25f)]>0x0,_0x50f758=_0x1670b0[_0x49bb6c(0x25f)]>0x0||_0x4fa355['length']>0x0||_0x301ca5[_0x49bb6c(0x25f)]>0x0,_0x4d782f=_0x342908[_0x49bb6c(0x269)]?![]:_0xd8e364[_0x49bb6c(0x25f)]>0x0,_0x20c20f=_0x1793cb[_0x49bb6c(0x25f)]>0x0;if(!_0x248205&&!_0x50f758&&!_0x4d782f&&!_0x20c20f){const _0x1e74fd=_0x342908[_0x49bb6c(0x269)]?_0x49bb6c(0x263):_0x49bb6c(0x24b);console['error'](a31_0x790da0['green'](_0x1e74fd));if(_0x320faa&&_0xfafad4[_0x49bb6c(0x25f)]===0x1){const _0x26f9cf=_0xfafad4[0x0];if(_0x26f9cf[_0x49bb6c(0x21e)]?.['id']){const _0x259db3=getConsoleNextUrl(_0x342908[_0x49bb6c(0x202)],_0x49bb6c(0x272)+_0x189b3e+'/e/'+_0x26f9cf[_0x49bb6c(0x21e)]['id']+_0x49bb6c(0x213));console[_0x49bb6c(0x28d)]('\x20\x20'+a31_0x790da0[_0x49bb6c(0x217)](_0x259db3));}}return 0x0;}const _0x5b7cb1=_0x342908['journeysOnly']?_0x1670b0[_0x49bb6c(0x25f)]+_0x4fa355[_0x49bb6c(0x25f)]+_0x301ca5[_0x49bb6c(0x25f)]+_0x1793cb[_0x49bb6c(0x25f)]:_0x4357fc['length']+_0x5ac274[_0x49bb6c(0x25f)]+_0x3d79de['length']+_0x1670b0[_0x49bb6c(0x25f)]+_0x4fa355[_0x49bb6c(0x25f)]+_0x301ca5[_0x49bb6c(0x25f)]+_0x1793cb[_0x49bb6c(0x25f)]+_0xd8e364[_0x49bb6c(0x25f)];if(!_0x342908[_0x49bb6c(0x24a)]&&_0x5b7cb1>0x0){if(!isInteractive())return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x224)](_0x49bb6c(0x1ff)),_0x49bb6c(0x258)),console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x220)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x57c7fe=await confirmKey(_0x49bb6c(0x240)+_0x5b7cb1+_0x49bb6c(0x1f2));if(!_0x57c7fe)return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x284)](_0x49bb6c(0x281))),0x1;}const _0x1c7261={'withProgress':async(_0x25b332,_0x170c56)=>{const _0x2100e2=_0x49bb6c,_0x4a27de=await withSpinner(_0x25b332,_0x170c56,{'verbose':_0x342908[_0x2100e2(0x218)]});return{'data':_0x4a27de[_0x2100e2(0x28c)]};},'logInfo':_0x1f1b04=>console[_0x49bb6c(0x28d)](a31_0x790da0['blue']('βœ”\x20'+_0x1f1b04)),'logSuccess':_0x40349f=>console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x27f)]('βœ”\x20'+_0x40349f)),'logWarning':_0x551eee=>console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x284)]('⚠\x20'+_0x551eee)),'logDeleted':_0x1a6c4e=>console['error'](a31_0x790da0[_0x49bb6c(0x224)]('βœ”\x20'+_0x1a6c4e))},_0x557f3b={'segment':_0x1bb87a[_0x49bb6c(0x200)],'journey':_0x1bb87a['journey'],'user':_0x1bb87a[_0x49bb6c(0x22c)],'connection':_0x1bb87a[_0x49bb6c(0x23f)]};_0x1793cb[_0x49bb6c(0x25f)]>0x0&&(_0x1ca34b=await executePushFolders(_0x557f3b,_0x1793cb,_0x1ca34b,{'parentId':_0x189b3e},_0x1c7261));const _0x58f039={'rootFolderId':_0x53c20d,'folderPathToId':_0x1ca34b,'folderIdToPath':_0x4481e6,'segmentNameToId':_0x11d641,'activationsBySegmentId':_0x33fe7b,'emailToIdMap':_0x3fb433,'idToEmailMap':_0xaccaab,'connectionNameToIdMap':_0x13195e[_0x49bb6c(0x25e)],'connectionIdToNameMap':_0x13195e[_0x49bb6c(0x228)],'connectionNameToTypeMap':_0x299999},_0x3a7c30=await executePushSegments(_0x557f3b,_0x342908[_0x49bb6c(0x269)]?[]:_0x50401a,_0x58f039,{'parentId':_0x189b3e},_0x1c7261),_0xbac0ce=_0x3a7c30[_0x49bb6c(0x22a)],_0x3621ff=_0x3a7c30['updated'],_0xa6c1af=_0x3a7c30['activations'][_0x49bb6c(0x22a)],_0x4fd3a4=_0x3a7c30[_0x49bb6c(0x1fa)][_0x49bb6c(0x1f4)],_0x805abf=_0x3a7c30['activations'][_0x49bb6c(0x24f)],_0x54a19b=await executePushSegmentDeletions(_0x557f3b,_0x342908[_0x49bb6c(0x269)]?[]:_0x3d79de,_0x1c7261);let _0x28f725=0x0,_0x59998a=0x0,_0xf5ab85=0x0;const _0x24a538=new Map(_0x11d641);for(const [_0x36f00d,_0x34c017]of _0x3a7c30[_0x49bb6c(0x221)]){_0x24a538[_0x49bb6c(0x27b)](_0x36f00d,_0x34c017);}if(_0x2a7fa4['length']>0x0){const _0x41981e={..._0x58f039,'segmentNameToId':_0x24a538,'existingSegments':_0x44a7da,'activationContext':_0x1cadb1},_0x21885f=await executePushJourneys(_0x557f3b,_0x2a7fa4,_0x41981e,{'parentId':_0x189b3e,'rootFolderId':_0x53c20d,'verbose':_0x342908['verbose']},_0x1c7261);_0x28f725=_0x21885f[_0x49bb6c(0x22a)],_0x59998a=_0x21885f[_0x49bb6c(0x1f4)];if(_0x320faa&&_0x21885f['results'][_0x49bb6c(0x25f)]===0x1){const _0x943c22=_0x21885f[_0x49bb6c(0x277)][0x0];if(_0x943c22[_0x49bb6c(0x219)]){const _0x109fe6=getConsoleNextUrl(_0x342908[_0x49bb6c(0x202)],_0x49bb6c(0x272)+_0x189b3e+_0x49bb6c(0x23d)+_0x943c22['journeyId']+_0x49bb6c(0x213));console[_0x49bb6c(0x28d)]('\x20\x20'+a31_0x790da0[_0x49bb6c(0x217)](_0x109fe6));}}}for(const _0x1906ca of _0x301ca5){console['error'](a31_0x790da0['yellow'](_0x49bb6c(0x226)+_0x1906ca[_0x49bb6c(0x271)])),_0xf5ab85++;}const _0x5a79aa=[];if(_0xbac0ce>0x0)_0x5a79aa['push'](_0xbac0ce+'\x20created');if(_0x3621ff>0x0)_0x5a79aa['push'](_0x3621ff+'\x20updated');if(_0x54a19b>0x0)_0x5a79aa[_0x49bb6c(0x20f)](_0x54a19b+_0x49bb6c(0x1f3));const _0x189e04=[];if(_0x28f725>0x0)_0x189e04[_0x49bb6c(0x20f)](_0x28f725+_0x49bb6c(0x282));if(_0x59998a>0x0)_0x189e04[_0x49bb6c(0x20f)](_0x59998a+'\x20updated');if(_0xf5ab85>0x0)_0x189e04[_0x49bb6c(0x20f)](_0xf5ab85+'\x20deleted');const _0x3670e8=[];if(_0xa6c1af>0x0)_0x3670e8['push'](_0xa6c1af+_0x49bb6c(0x282));if(_0x4fd3a4>0x0)_0x3670e8['push'](_0x4fd3a4+'\x20updated');if(_0x805abf>0x0)_0x3670e8[_0x49bb6c(0x20f)](_0x805abf+_0x49bb6c(0x1f3));return console[_0x49bb6c(0x28d)](a31_0x790da0[_0x49bb6c(0x27f)](_0x49bb6c(0x20c))),_0x5a79aa[_0x49bb6c(0x25f)]>0x0&&!_0x342908[_0x49bb6c(0x269)]&&console['error'](_0x49bb6c(0x255)+_0x5a79aa[_0x49bb6c(0x24d)](',\x20')),_0x189e04['length']>0x0&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x232)+_0x189e04[_0x49bb6c(0x24d)](',\x20')),_0x3670e8['length']>0x0&&!_0x342908[_0x49bb6c(0x269)]&&console[_0x49bb6c(0x28d)](_0x49bb6c(0x250)+_0x3670e8['join'](',\x20')),0x0;}}