@treasuredata/tdx 0.25.3 β†’ 0.25.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 (163) 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/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/schedule.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/archive-validation.js +1 -1
  126. package/dist/sdk/workflow/clone-workflow.js +1 -1
  127. package/dist/sdk/workflow/index.js +1 -1
  128. package/dist/sdk/workflow/pull-workflow.js +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/tdx-config.js +1 -1
  131. package/dist/sdk/workflow/workflow-utils.js +1 -1
  132. package/dist/test-utils/command-runner.js +1 -1
  133. package/dist/test-utils/factories.js +1 -1
  134. package/dist/test-utils/fixtures.js +1 -1
  135. package/dist/test-utils/http-mock.js +1 -1
  136. package/dist/test-utils/index.js +1 -1
  137. package/dist/utils/async.js +1 -1
  138. package/dist/utils/colors.js +1 -1
  139. package/dist/utils/diff.js +1 -1
  140. package/dist/utils/file-permissions.js +1 -1
  141. package/dist/utils/global-cache.js +1 -1
  142. package/dist/utils/json-loader.js +1 -1
  143. package/dist/utils/local-cache.js +1 -1
  144. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  145. package/dist/utils/logger/formatters/index.js +1 -1
  146. package/dist/utils/logger/handlers/console-handler.js +1 -1
  147. package/dist/utils/logger/handlers/file-handler.js +1 -1
  148. package/dist/utils/logger/handlers/index.js +1 -1
  149. package/dist/utils/logger/handlers/null-handler.js +1 -1
  150. package/dist/utils/logger/index.js +1 -1
  151. package/dist/utils/logger/logger.js +1 -1
  152. package/dist/utils/logger/types.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x5f0539=a26_0x2f21;(function(_0x2a1945,_0x549cde){const _0x4c6a26=a26_0x2f21,_0x4b9923=_0x2a1945();while(!![]){try{const _0xe87706=-parseInt(_0x4c6a26(0xbe))/0x1+parseInt(_0x4c6a26(0x139))/0x2+parseInt(_0x4c6a26(0x136))/0x3*(parseInt(_0x4c6a26(0xee))/0x4)+parseInt(_0x4c6a26(0xf6))/0x5+parseInt(_0x4c6a26(0xfb))/0x6*(parseInt(_0x4c6a26(0x131))/0x7)+-parseInt(_0x4c6a26(0x109))/0x8*(-parseInt(_0x4c6a26(0xd8))/0x9)+-parseInt(_0x4c6a26(0x128))/0xa;if(_0xe87706===_0x549cde)break;else _0x4b9923['push'](_0x4b9923['shift']());}catch(_0x5739e1){_0x4b9923['push'](_0x4b9923['shift']());}}}(a26_0x1ca3,0x5c268));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x25d82c from'chalk';function a26_0x1ca3(){const _0x40e348=['Show\x20schedule\x20execution\x20history','schedule:run','Cancelled','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','retry_limit','last_job','verbose','timezone','toLocaleDateString','length','Schedule\x20updated:\x20','nextRun','632orZNsp','round','\x20execution','ies','max','\x20scheduled\x20quer','from','keys','utf-8','jobs','created_at','start_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','Creating\x20schedule:\x20','queryUrl','...','description','dim','in\x20','abs','jsonl','Running\x20schedule...','Getting\x20schedule\x20history...','success','lastRun','Create\x20a\x20scheduled\x20query','yes','schedule:update','args','cron','Creating\x20schedule...','12918700kQPsSE','time_zone','Failed\x20to\x20read\x20file:\x20','priority','schedule:list','update','error','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Listing\x20scheduled\x20queries...','1414FjndMC','ended_at','next_run_at','job_id','πŸ“…\x20','1182qLQche','end_at','trim','817832lFbroo','schedule:delete','map','delete','delay','soon','\x20\x20Database:\x20','create','Delete\x20a\x20scheduled\x20query','\x20\x20Job\x20ID:\x20','data','\x20\x20Time:\x20','\x20job','INVALID_ARGUMENT','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','file','validate','Deleting\x20schedule...','Getting\x20schedule\x20details...','695775WuMuta','show','Updating\x20schedule...','Running\x20schedule:\x20','queries','padEnd','Found\x20','status','Query\x20file\x20is\x20empty','statusIcon','Schedule\x20deleted:\x20','schedule:create','result','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','listQueries','num','substring','\x20schedules','updated_at','execute','Show\x20schedule\x20details','join','entries','m\x20ago','Schedule\x20run\x20submitted:\x20','/app/queries/editor?queryId=','49905fVgDzd','Searching\x20scheduled\x20queries\x20matching\x20\x22','\x20(use\x20--limit\x20to\x20see\x20more)','engineVersion','name','query','history','type','getTime','Showing\x20first\x20','Update\x20a\x20scheduled\x20query','engine_version','Schedule\x20created:\x20','json','\x20\x20Cron:\x20','schedule:show','database','h\x20ago','log','\x20created','table','\x22...','7004FDzXGb','has_next_page','executing_user_id','never','format','retryLimit','List\x20scheduled\x20queries','list','3673510OmfBzM','schedules','No\x20scheduled\x20queries\x20found','red','tsv','2778PURBWV','limit'];a26_0x1ca3=function(){return _0x40e348;};return a26_0x1ca3();}function formatRelativeTime(_0x1bcb86){const _0x2cdfc8=a26_0x2f21,_0x681e5a=new Date(_0x1bcb86),_0x4c18e9=new Date(),_0x1b802f=_0x681e5a['getTime']()-_0x4c18e9[_0x2cdfc8(0xe0)](),_0x5e2841=Math[_0x2cdfc8(0x11c)](_0x1b802f)/0x3e8,_0xd219f5=_0x1b802f<0x0;if(_0x5e2841<0x3c)return _0xd219f5?'just\x20now':_0x2cdfc8(0x13e);else{if(_0x5e2841<0xe10){const _0x588e2c=Math[_0x2cdfc8(0x10a)](_0x5e2841/0x3c);return _0xd219f5?_0x588e2c+_0x2cdfc8(0xd5):'in\x20'+_0x588e2c+'m';}else{if(_0x5e2841<0x15180){const _0x979333=Math[_0x2cdfc8(0x10a)](_0x5e2841/0xe10);return _0xd219f5?_0x979333+_0x2cdfc8(0xe9):'in\x20'+_0x979333+'h';}else{if(_0x5e2841<0x93a80){const _0x8568ba=Math['round'](_0x5e2841/0x15180);return _0xd219f5?_0x8568ba+'d\x20ago':_0x2cdfc8(0x11b)+_0x8568ba+'d';}else return _0x681e5a[_0x2cdfc8(0x105)]();}}}}function a26_0x2f21(_0xcf76d6,_0x24974d){_0xcf76d6=_0xcf76d6-0xb3;const _0x1ca35b=a26_0x1ca3();let _0x2f21c8=_0x1ca35b[_0xcf76d6];return _0x2f21c8;}export class ScheduleListCommand extends BaseCommand{[a26_0x5f0539(0xdc)]=a26_0x5f0539(0x12c);['description']=a26_0x5f0539(0xf4);async[a26_0x5f0539(0xd1)](_0x51c536){const _0x38087a=a26_0x5f0539,{options:_0x31c62a,args:_0xaa3f99,tdx:_0x24119e}=_0x51c536,_0x5deb39=resolveLimit(_0x31c62a[_0x38087a(0xfc)],DEFAULT_DISPLAY_LIMIT),_0x1e6e00=_0xaa3f99[0x0],_0x50599b=_0x1e6e00?_0x38087a(0xd9)+_0x1e6e00+_0x38087a(0xed):_0x38087a(0x130),_0x3001a2=await withSpinner(_0x50599b,()=>_0x24119e[_0x38087a(0xf7)][_0x38087a(0xcc)]({'limit':_0x5deb39,'scheduled':!![],'pattern':_0x1e6e00}),{'verbose':_0x31c62a[_0x38087a(0x103)]}),_0x1b130d=_0x3001a2['data'][_0x38087a(0xc2)],_0x1019ac=_0x3001a2[_0x38087a(0xb5)]['pagination'][_0x38087a(0xef)],_0xb344ca=_0x1e6e00?'\x20matching\x20\x22'+_0x1e6e00+'\x22':'';_0x1019ac?console[_0x38087a(0x12e)](_0x38087a(0xe1)+_0x1b130d[_0x38087a(0x106)]+_0x38087a(0xcf)+_0xb344ca+_0x38087a(0xda)):console['error'](_0x38087a(0xc4)+_0x1b130d[_0x38087a(0x106)]+_0x38087a(0x10e)+(_0x1b130d[_0x38087a(0x106)]!==0x1?_0x38087a(0x10c):'y')+_0xb344ca);if(_0x31c62a[_0x38087a(0xf2)]===_0x38087a(0xe5)||_0x31c62a[_0x38087a(0xf2)]===_0x38087a(0x11d)||_0x31c62a[_0x38087a(0xf2)]===_0x38087a(0xec)||_0x31c62a[_0x38087a(0xf2)]===_0x38087a(0xfa)){const _0x3d5214=_0x1b130d['map'](_0xba4013=>({'id':_0xba4013['id'],'name':_0xba4013[_0x38087a(0xdc)],'cron':_0xba4013['cron'],'database':_0xba4013[_0x38087a(0xe8)]?.[_0x38087a(0xdc)],'type':_0xba4013[_0x38087a(0xdf)],'timezone':_0xba4013[_0x38087a(0x129)],'user_name':_0xba4013['user']?.['name'],'updated_at':_0xba4013[_0x38087a(0xd0)],'next_run_at':_0xba4013[_0x38087a(0x133)],'last_job_status':_0xba4013[_0x38087a(0x102)]?.[_0x38087a(0xc5)]}));await handleSDKOutput(_0x3d5214,_0x31c62a);}else{if(_0x1b130d[_0x38087a(0x106)]===0x0)console[_0x38087a(0xea)](_0x38087a(0xf8));else{const _0x373166=_0x31c62a['site'],_0xa0938c=_0x1b130d[_0x38087a(0x13b)](_0x36aa76=>{const _0x321f2c=_0x38087a,_0x3ead8c=_0x36aa76[_0x321f2c(0x102)]?.[_0x321f2c(0xc5)]?_0x36aa76[_0x321f2c(0x102)][_0x321f2c(0xc5)]===_0x321f2c(0x120)?'βœ“':'βœ—':'-',_0x7e1fbb=_0x36aa76[_0x321f2c(0x102)]?.[_0x321f2c(0x132)]?formatRelativeTime(_0x36aa76['last_job'][_0x321f2c(0x132)]):_0x321f2c(0xf1),_0x18bd55=_0x36aa76[_0x321f2c(0x133)]?formatRelativeTime(_0x36aa76['next_run_at']):'-',_0x2b3e49=_0x36aa76[_0x321f2c(0x126)]||'',_0x4293a4=_0x36aa76[_0x321f2c(0xdc)]||'(unnamed)',_0x5a1f54=getConsoleUrl(_0x373166,_0x321f2c(0xd7)+_0x36aa76['id']);return{'statusIcon':_0x3ead8c,'lastRun':_0x7e1fbb,'nextRun':_0x18bd55,'cron':_0x2b3e49,'name':_0x4293a4,'queryUrl':_0x5a1f54,'status':_0x36aa76[_0x321f2c(0x102)]?.[_0x321f2c(0xc5)]};}),_0xfe731c=Math['max'](..._0xa0938c[_0x38087a(0x13b)](_0x54f55d=>_0x54f55d[_0x38087a(0x121)]['length'])),_0x340bd0=Math['max'](..._0xa0938c[_0x38087a(0x13b)](_0x3b2c48=>_0x3b2c48[_0x38087a(0x108)][_0x38087a(0x106)])),_0x5b368f=Math[_0x38087a(0x10d)](..._0xa0938c[_0x38087a(0x13b)](_0x36091b=>_0x36091b[_0x38087a(0x126)][_0x38087a(0x106)])),_0x3f7650=_0xa0938c[_0x38087a(0x13b)](_0x5f1f57=>{const _0xb9f8c7=_0x38087a,_0x14a2c=_0x5f1f57[_0xb9f8c7(0xc5)]===_0xb9f8c7(0x120)?a26_0x25d82c['green'](_0x5f1f57[_0xb9f8c7(0xc7)]):_0x5f1f57['status']==='error'?a26_0x25d82c[_0xb9f8c7(0xf9)](_0x5f1f57['statusIcon']):a26_0x25d82c[_0xb9f8c7(0x11a)](_0x5f1f57[_0xb9f8c7(0xc7)]),_0x436cb5=_0x5f1f57[_0xb9f8c7(0x121)][_0xb9f8c7(0xc3)](_0xfe731c),_0x21a296=_0x5f1f57['nextRun'][_0xb9f8c7(0xc3)](_0x340bd0),_0x5ee337=_0x5f1f57['cron']?a26_0x25d82c['cyan'](_0x5f1f57[_0xb9f8c7(0x126)]['padEnd'](_0x5b368f)):'\x20'['repeat'](_0x5b368f),_0x25fd3d=hyperlink(_0x5f1f57[_0xb9f8c7(0xdc)],_0x5f1f57[_0xb9f8c7(0x117)]);return _0xb9f8c7(0x135)+_0x14a2c+'\x20'+_0x436cb5+'\x20\x20β†’\x20'+_0x21a296+'\x20\x20'+_0x5ee337+'\x20\x20'+_0x25fd3d;});await writeOutput(_0x3f7650[_0x38087a(0xd3)]('\x0a'),_0x31c62a['output'],_0x38087a(0xf5));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x5f0539(0xdc)]=a26_0x5f0539(0xe7);[a26_0x5f0539(0x119)]=a26_0x5f0539(0xd2);[a26_0x5f0539(0xbb)](_0x492451){const _0x203845=a26_0x5f0539,_0x1a20b6=_0x492451[_0x203845(0x125)][0x0];if(!_0x1a20b6)return _0x203845(0x115);return undefined;}async[a26_0x5f0539(0xd1)](_0x1e6821){const _0x23c231=a26_0x5f0539,{options:_0x545300,args:_0x5794e7,tdx:_0x337126}=_0x1e6821,_0xef2be4=_0x5794e7[0x0],_0x5baf90=await withSpinner(_0x23c231(0xbd),()=>_0x337126['schedules'][_0x23c231(0xbf)](_0xef2be4),{'verbose':_0x545300[_0x23c231(0x103)]}),_0x3919bd=_0x5baf90['data'],_0x44860a={'name':_0x3919bd['name'],'cron':_0x3919bd['cron'],'database':_0x3919bd[_0x23c231(0xe8)],'type':_0x3919bd[_0x23c231(0xdf)],'timezone':_0x3919bd[_0x23c231(0x104)],'user_name':_0x3919bd['user_name'],'created_at':_0x3919bd[_0x23c231(0x113)],'engine_version':_0x3919bd[_0x23c231(0xe3)],'executing_user_id':_0x3919bd[_0x23c231(0xf0)],'query':_0x3919bd[_0x23c231(0xdd)],'delay':_0x3919bd[_0x23c231(0x13d)],'priority':_0x3919bd['priority'],'retry_limit':_0x3919bd['retry_limit'],..._0x3919bd[_0x23c231(0xca)]&&{'result':_0x3919bd[_0x23c231(0xca)]}};return await handleSingleObjectOutput(_0x44860a,_0x545300),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x5f0539(0xdc)]=a26_0x5f0539(0xc9);['description']=a26_0x5f0539(0x122);[a26_0x5f0539(0xbb)](_0x102b52){const _0x519edf=a26_0x5f0539,_0x144f9f=_0x102b52[_0x519edf(0x125)][0x0];if(!_0x144f9f)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_0x5f0539(0xd1)](_0x5b3341){const _0x46ba7d=a26_0x5f0539,{options:_0x5e6de1,args:_0x46a89c,tdx:_0x41cf1f}=_0x5b3341,_0x14b3c3=_0x46a89c[0x0],_0x3b5657=_0x5e6de1,_0x2f5e68=_0x3b5657['database'],_0x4ccff9=_0x3b5657[_0x46ba7d(0xba)],_0x4c15b2=_0x3b5657['type']||'trino';let _0x47fcc3;try{_0x47fcc3=readFileSync(_0x4ccff9,_0x46ba7d(0x111))[_0x46ba7d(0x138)]();}catch(_0xe43234){throw new SDKError(ErrorCode[_0x46ba7d(0xb8)],_0x46ba7d(0x12a)+_0x4ccff9,_0xe43234 instanceof Error?_0xe43234:undefined);}if(!_0x47fcc3)throw new SDKError(ErrorCode[_0x46ba7d(0xb8)],_0x46ba7d(0xc6));const _0x3fd27b={'database':_0x2f5e68,'query':_0x47fcc3,'type':_0x4c15b2};if(_0x3b5657['cron'])_0x3fd27b[_0x46ba7d(0x126)]=_0x3b5657[_0x46ba7d(0x126)];if(_0x3b5657[_0x46ba7d(0x104)])_0x3fd27b[_0x46ba7d(0x104)]=_0x3b5657['timezone'];if(_0x3b5657[_0x46ba7d(0x13d)]!==undefined)_0x3fd27b[_0x46ba7d(0x13d)]=Number(_0x3b5657[_0x46ba7d(0x13d)]);if(_0x3b5657[_0x46ba7d(0x12b)]!==undefined)_0x3fd27b['priority']=Number(_0x3b5657[_0x46ba7d(0x12b)]);if(_0x3b5657['retryLimit']!==undefined)_0x3fd27b['retry_limit']=Number(_0x3b5657[_0x46ba7d(0xf3)]);if(_0x3b5657[_0x46ba7d(0xdb)])_0x3fd27b[_0x46ba7d(0xe3)]=_0x3b5657[_0x46ba7d(0xdb)];if(_0x3b5657[_0x46ba7d(0xca)])_0x3fd27b[_0x46ba7d(0xca)]=_0x3b5657[_0x46ba7d(0xca)];if(_0x5e6de1[_0x46ba7d(0x103)]){console['error'](_0x46ba7d(0x116)+_0x14b3c3),console[_0x46ba7d(0x12e)](_0x46ba7d(0x13f)+_0x2f5e68),console[_0x46ba7d(0x12e)]('\x20\x20Type:\x20'+_0x4c15b2);if(_0x3fd27b[_0x46ba7d(0x126)])console['error'](_0x46ba7d(0xe6)+_0x3fd27b['cron']);if(_0x3fd27b['timezone'])console[_0x46ba7d(0x12e)]('\x20\x20Timezone:\x20'+_0x3fd27b[_0x46ba7d(0x104)]);}const _0x11ae85=await withSpinner(_0x46ba7d(0x127),()=>_0x41cf1f[_0x46ba7d(0xf7)][_0x46ba7d(0x140)](_0x14b3c3,_0x3fd27b),{'verbose':_0x5e6de1[_0x46ba7d(0x103)]});return console['error'](_0x46ba7d(0xe4)+_0x11ae85[_0x46ba7d(0xb5)]['name']),await handleSingleObjectOutput(_0x11ae85[_0x46ba7d(0xb5)],_0x5e6de1),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x5f0539(0xdc)]=a26_0x5f0539(0x124);[a26_0x5f0539(0x119)]=a26_0x5f0539(0xe2);[a26_0x5f0539(0xbb)](_0x4fc67e){const _0x1be9ca=a26_0x5f0539,_0x1755fa=_0x4fc67e['args'][0x0];if(!_0x1755fa)return _0x1be9ca(0x12f);return undefined;}async[a26_0x5f0539(0xd1)](_0xc59bd8){const _0x1fe81a=a26_0x5f0539,{options:_0x50c196,args:_0x214796,tdx:_0x1cfca3}=_0xc59bd8,_0x53fbef=_0x214796[0x0],_0x18d2b0=_0x50c196,_0x4864ab={};if(_0x18d2b0[_0x1fe81a(0xe8)])_0x4864ab[_0x1fe81a(0xe8)]=_0x18d2b0[_0x1fe81a(0xe8)];if(_0x18d2b0[_0x1fe81a(0xdf)])_0x4864ab['type']=_0x18d2b0[_0x1fe81a(0xdf)];if(_0x18d2b0[_0x1fe81a(0x126)])_0x4864ab[_0x1fe81a(0x126)]=_0x18d2b0[_0x1fe81a(0x126)];if(_0x18d2b0[_0x1fe81a(0x104)])_0x4864ab[_0x1fe81a(0x104)]=_0x18d2b0['timezone'];if(_0x18d2b0[_0x1fe81a(0x13d)]!==undefined)_0x4864ab[_0x1fe81a(0x13d)]=Number(_0x18d2b0[_0x1fe81a(0x13d)]);if(_0x18d2b0['priority']!==undefined)_0x4864ab[_0x1fe81a(0x12b)]=Number(_0x18d2b0[_0x1fe81a(0x12b)]);if(_0x18d2b0['retryLimit']!==undefined)_0x4864ab[_0x1fe81a(0x101)]=Number(_0x18d2b0[_0x1fe81a(0xf3)]);if(_0x18d2b0['engineVersion'])_0x4864ab['engine_version']=_0x18d2b0[_0x1fe81a(0xdb)];if(_0x18d2b0[_0x1fe81a(0xca)])_0x4864ab[_0x1fe81a(0xca)]=_0x18d2b0[_0x1fe81a(0xca)];if(_0x18d2b0[_0x1fe81a(0xba)])try{_0x4864ab['query']=readFileSync(_0x18d2b0[_0x1fe81a(0xba)],'utf-8')[_0x1fe81a(0x138)]();}catch(_0x13dfbf){throw new SDKError(ErrorCode[_0x1fe81a(0xb8)],_0x1fe81a(0x12a)+_0x18d2b0[_0x1fe81a(0xba)],_0x13dfbf instanceof Error?_0x13dfbf:undefined);}if(Object[_0x1fe81a(0x110)](_0x4864ab)[_0x1fe81a(0x106)]===0x0)throw new SDKError(ErrorCode[_0x1fe81a(0xb8)],_0x1fe81a(0xb9));if(_0x50c196[_0x1fe81a(0x103)]){console[_0x1fe81a(0x12e)]('Updating\x20schedule:\x20'+_0x53fbef);for(const [_0x1fe59b,_0xcf57f3]of Object[_0x1fe81a(0xd4)](_0x4864ab)){_0x1fe59b==='query'?console[_0x1fe81a(0x12e)]('\x20\x20'+_0x1fe59b+':\x20'+_0xcf57f3[_0x1fe81a(0xce)](0x0,0x32)+_0x1fe81a(0x118)):console[_0x1fe81a(0x12e)]('\x20\x20'+_0x1fe59b+':\x20'+_0xcf57f3);}}const _0x57be5e=await withSpinner(_0x1fe81a(0xc0),()=>_0x1cfca3['schedules'][_0x1fe81a(0x12d)](_0x53fbef,_0x4864ab),{'verbose':_0x50c196[_0x1fe81a(0x103)]});return console['error'](_0x1fe81a(0x107)+_0x57be5e['data'][_0x1fe81a(0xdc)]),await handleSingleObjectOutput(_0x57be5e['data'],_0x50c196),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x5f0539(0xdc)]=a26_0x5f0539(0x13a);[a26_0x5f0539(0x119)]=a26_0x5f0539(0xb3);[a26_0x5f0539(0xbb)](_0x35e6a1){const _0x4a80cb=a26_0x5f0539,_0x4328b9=_0x35e6a1[_0x4a80cb(0x125)][0x0];if(!_0x4328b9)return _0x4a80cb(0x100);return undefined;}async['execute'](_0x2e000e){const _0x1d6d42=a26_0x5f0539,{options:_0x10bb00,args:_0x1275aa,tdx:_0x34af87}=_0x2e000e,_0x5aa45e=_0x1275aa[0x0];if(!_0x10bb00[_0x1d6d42(0x123)]){const _0x12ecde=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x5aa45e+'\x22?');if(!_0x12ecde)return console['error'](_0x1d6d42(0xff)),0x0;}const _0x2e5573=await withSpinner(_0x1d6d42(0xbc),()=>_0x34af87['schedules'][_0x1d6d42(0x13c)](_0x5aa45e),{'verbose':_0x10bb00['verbose']});return console['error'](_0x1d6d42(0xc8)+_0x2e5573[_0x1d6d42(0xb5)][_0x1d6d42(0xdc)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a26_0x5f0539(0xfe);[a26_0x5f0539(0x119)]='Run\x20a\x20scheduled\x20query\x20immediately';[a26_0x5f0539(0xbb)](_0x43ff8b){const _0x3f4bab=a26_0x5f0539,_0x1a8c1f=_0x43ff8b[_0x3f4bab(0x125)][0x0];if(!_0x1a8c1f)return _0x3f4bab(0xcb);return undefined;}async[a26_0x5f0539(0xd1)](_0x3e5bce){const _0x56693f=a26_0x5f0539,{options:_0x5c24a3,args:_0x18b3d3,tdx:_0x5bdd3c}=_0x3e5bce,_0x5a6c90=_0x18b3d3[0x0],_0x4b5e58=_0x5c24a3,_0x271a9d=_0x4b5e58['time'],_0x30a6f9=_0x4b5e58[_0x56693f(0xcd)]!==undefined?Number(_0x4b5e58['num']):undefined;if(_0x5c24a3[_0x56693f(0x103)]){console[_0x56693f(0x12e)](_0x56693f(0xc1)+_0x5a6c90);if(_0x271a9d)console['error'](_0x56693f(0xb6)+_0x271a9d);if(_0x30a6f9)console[_0x56693f(0x12e)]('\x20\x20Num:\x20'+_0x30a6f9);}const _0x427874=await withSpinner(_0x56693f(0x11e),()=>_0x5bdd3c['schedules']['run'](_0x5a6c90,{'time':_0x271a9d,'num':_0x30a6f9}),{'verbose':_0x5c24a3[_0x56693f(0x103)]}),_0xa7fb20=_0x427874['data'][_0x56693f(0x112)];console[_0x56693f(0x12e)](_0x56693f(0xd6)+_0xa7fb20[_0x56693f(0x106)]+_0x56693f(0xb7)+(_0xa7fb20[_0x56693f(0x106)]!==0x1?'s':'')+_0x56693f(0xeb));for(const _0x26e713 of _0xa7fb20){console['error'](_0x56693f(0xb4)+_0x26e713[_0x56693f(0x134)]);}return await handleSDKOutput(_0xa7fb20,_0x5c24a3),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x5f0539(0xdc)]='schedule:history';[a26_0x5f0539(0x119)]=a26_0x5f0539(0xfd);[a26_0x5f0539(0xbb)](_0x5d4572){const _0x2b65da=_0x5d4572['args'][0x0];if(!_0x2b65da)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a26_0x5f0539(0xd1)](_0x37062c){const _0x5c54a2=a26_0x5f0539,{options:_0x4d8da2,args:_0x51882f,tdx:_0xfa2542}=_0x37062c,_0x497e7f=_0x51882f[0x0],_0x3262b3=_0x4d8da2,_0x212626=_0x3262b3[_0x5c54a2(0x10f)]!==undefined?Number(_0x3262b3[_0x5c54a2(0x10f)]):undefined,_0x124d02=_0x3262b3['to']!==undefined?Number(_0x3262b3['to']):undefined,_0x5b452b=await withSpinner(_0x5c54a2(0x11f),()=>_0xfa2542['schedules'][_0x5c54a2(0xde)](_0x497e7f,{'from':_0x212626,'to':_0x124d02}),{'verbose':_0x4d8da2[_0x5c54a2(0x103)]}),_0x430c0a=_0x5b452b['data'];console[_0x5c54a2(0x12e)](_0x5c54a2(0xc4)+_0x430c0a['count']+_0x5c54a2(0x10b)+(_0x430c0a['count']!==0x1?'s':'')+'\x20(showing\x20'+_0x430c0a[_0x5c54a2(0x10f)]+'-'+_0x430c0a['to']+')');const _0x1dea22=_0x430c0a[_0x5c54a2(0xde)]['map'](_0x29e6bf=>({'job_id':_0x29e6bf[_0x5c54a2(0x134)],'type':_0x29e6bf[_0x5c54a2(0xdf)],'status':_0x29e6bf[_0x5c54a2(0xc5)],'scheduled_at':_0x29e6bf['scheduled_at'],'created_at':_0x29e6bf[_0x5c54a2(0x113)],'start_at':_0x29e6bf[_0x5c54a2(0x114)],'end_at':_0x29e6bf[_0x5c54a2(0x137)]}));return await handleSDKOutput(_0x1dea22,_0x4d8da2),0x0;}}
1
+ const a26_0x280eb8=a26_0x5e4b;(function(_0x5b4eb2,_0x4bdf79){const _0xd9690d=a26_0x5e4b,_0x238e3d=_0x5b4eb2();while(!![]){try{const _0x3b591a=parseInt(_0xd9690d(0x1fe))/0x1+-parseInt(_0xd9690d(0x173))/0x2*(-parseInt(_0xd9690d(0x1f7))/0x3)+-parseInt(_0xd9690d(0x1ec))/0x4*(parseInt(_0xd9690d(0x1f3))/0x5)+-parseInt(_0xd9690d(0x1bb))/0x6+parseInt(_0xd9690d(0x1c6))/0x7*(parseInt(_0xd9690d(0x1f0))/0x8)+parseInt(_0xd9690d(0x172))/0x9+-parseInt(_0xd9690d(0x1d8))/0xa*(parseInt(_0xd9690d(0x1fa))/0xb);if(_0x3b591a===_0x4bdf79)break;else _0x238e3d['push'](_0x238e3d['shift']());}catch(_0x17bc37){_0x238e3d['push'](_0x238e3d['shift']());}}}(a26_0x2c1f,0x84b54));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';function a26_0x2c1f(){const _0x4872da=['349895gWKRJP','jsonl','\x20\x20Num:\x20','\x20\x20Type:\x20','1419702jjEFbz','Creating\x20schedule:\x20','validate','352nsbfpa','has_next_page','Updating\x20schedule:\x20','delete','972917BFbcQq','from','last_job','(unnamed)','2835531KWDFHB','4DLSPcB','utf-8','schedule:create','queries','Searching\x20scheduled\x20queries\x20matching\x20\x22','args','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','update','count','in\x20','error','INVALID_ARGUMENT','dim','\x20scheduled\x20quer','nextRun','table','start_at','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','user_name','user','end_at','delay','trim','m\x20ago','abs','schedule:update','database','length','\x20\x20Time:\x20','success','...','timezone','time','description','site','jobs','padEnd','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','file','Schedule\x20updated:\x20','List\x20scheduled\x20queries','schedule:delete','schedules','updated_at','keys','Getting\x20schedule\x20details...','scheduled_at','round','engineVersion','result','name','pagination','green','json','history','Creating\x20schedule...','show','type','lastRun','Showing\x20first\x20','retryLimit','\x20job','num','run','data','d\x20ago','retry_limit','execute','h\x20ago','join','Getting\x20schedule\x20history...','red','3461676fYyLrz','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','Schedule\x20created:\x20','soon','\x20schedules','verbose','ies','substring','\x20\x20Database:\x20','Failed\x20to\x20read\x20file:\x20','priority','214991XKqZoN','Listing\x20scheduled\x20queries...','job_id','next_run_at','executing_user_id','schedule:show','status','tsv','Update\x20a\x20scheduled\x20query','No\x20scheduled\x20queries\x20found','limit','format','Create\x20a\x20scheduled\x20query','created_at','\x20\x20Timezone:\x20','entries','statusIcon','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','73410NsqCsN','\x22...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','query','Schedule\x20run\x20submitted:\x20','Show\x20schedule\x20execution\x20history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','\x20(showing\x20','Show\x20schedule\x20details','\x20execution','cyan','Schedule\x20deleted:\x20','map','create','max','\x20created','queryUrl','log','repeat','just\x20now','52ureoRC','engine_version','πŸ“…\x20','listQueries','8CuznhK','ended_at','cron'];a26_0x2c1f=function(){return _0x4872da;};return a26_0x2c1f();}import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a26_0x5e4b(_0x5dda9b,_0x224226){_0x5dda9b=_0x5dda9b-0x16f;const _0x2c1f9a=a26_0x2c1f();let _0x5e4b4a=_0x2c1f9a[_0x5dda9b];return _0x5e4b4a;}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x949c9d from'chalk';function formatRelativeTime(_0x49d5f6){const _0x316752=a26_0x5e4b,_0x33f885=new Date(_0x49d5f6),_0x12221b=new Date(),_0x333be7=_0x33f885['getTime']()-_0x12221b['getTime'](),_0x1d2c3b=Math[_0x316752(0x18b)](_0x333be7)/0x3e8,_0x560b8d=_0x333be7<0x0;if(_0x1d2c3b<0x3c)return _0x560b8d?_0x316752(0x1eb):_0x316752(0x1be);else{if(_0x1d2c3b<0xe10){const _0x2ae8db=Math[_0x316752(0x1a2)](_0x1d2c3b/0x3c);return _0x560b8d?_0x2ae8db+_0x316752(0x18a):_0x316752(0x17c)+_0x2ae8db+'m';}else{if(_0x1d2c3b<0x15180){const _0x36a107=Math[_0x316752(0x1a2)](_0x1d2c3b/0xe10);return _0x560b8d?_0x36a107+_0x316752(0x1b7):'in\x20'+_0x36a107+'h';}else{if(_0x1d2c3b<0x93a80){const _0x45f20c=Math[_0x316752(0x1a2)](_0x1d2c3b/0x15180);return _0x560b8d?_0x45f20c+_0x316752(0x1b4):_0x316752(0x17c)+_0x45f20c+'d';}else return _0x33f885['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]='schedule:list';[a26_0x280eb8(0x194)]=a26_0x280eb8(0x19b);async[a26_0x280eb8(0x1b6)](_0x2a5e4b){const _0x24f736=a26_0x280eb8,{options:_0x3e165b,args:_0x498a29,tdx:_0x45c6c9}=_0x2a5e4b,_0x3f3ca1=resolveLimit(_0x3e165b[_0x24f736(0x1d0)],DEFAULT_DISPLAY_LIMIT),_0x4d1066=_0x498a29[0x0],_0x22e4f7=_0x4d1066?_0x24f736(0x177)+_0x4d1066+_0x24f736(0x1d9):_0x24f736(0x1c7),_0x136e99=await withSpinner(_0x22e4f7,()=>_0x45c6c9[_0x24f736(0x19d)][_0x24f736(0x1ef)]({'limit':_0x3f3ca1,'scheduled':!![],'pattern':_0x4d1066}),{'verbose':_0x3e165b[_0x24f736(0x1c0)]}),_0x348d18=_0x136e99[_0x24f736(0x1b3)][_0x24f736(0x176)],_0x45e354=_0x136e99['data'][_0x24f736(0x1a6)][_0x24f736(0x1fb)],_0x16a6cc=_0x4d1066?'\x20matching\x20\x22'+_0x4d1066+'\x22':'';_0x45e354?console[_0x24f736(0x17d)](_0x24f736(0x1ae)+_0x348d18[_0x24f736(0x18e)]+_0x24f736(0x1bf)+_0x16a6cc+'\x20(use\x20--limit\x20to\x20see\x20more)'):console['error']('Found\x20'+_0x348d18[_0x24f736(0x18e)]+_0x24f736(0x180)+(_0x348d18[_0x24f736(0x18e)]!==0x1?_0x24f736(0x1c1):'y')+_0x16a6cc);if(_0x3e165b[_0x24f736(0x1d1)]===_0x24f736(0x1a8)||_0x3e165b[_0x24f736(0x1d1)]===_0x24f736(0x1f4)||_0x3e165b['format']===_0x24f736(0x182)||_0x3e165b[_0x24f736(0x1d1)]===_0x24f736(0x1cd)){const _0x1beb45=_0x348d18[_0x24f736(0x1e4)](_0x13571a=>({'id':_0x13571a['id'],'name':_0x13571a[_0x24f736(0x1a5)],'cron':_0x13571a[_0x24f736(0x1f2)],'database':_0x13571a[_0x24f736(0x18d)]?.[_0x24f736(0x1a5)],'type':_0x13571a['type'],'timezone':_0x13571a['time_zone'],'user_name':_0x13571a[_0x24f736(0x186)]?.[_0x24f736(0x1a5)],'updated_at':_0x13571a[_0x24f736(0x19e)],'next_run_at':_0x13571a['next_run_at'],'last_job_status':_0x13571a[_0x24f736(0x170)]?.[_0x24f736(0x1cc)]}));await handleSDKOutput(_0x1beb45,_0x3e165b);}else{if(_0x348d18[_0x24f736(0x18e)]===0x0)console[_0x24f736(0x1e9)](_0x24f736(0x1cf));else{const _0x4cb768=_0x3e165b[_0x24f736(0x195)],_0x186245=_0x348d18[_0x24f736(0x1e4)](_0x435d28=>{const _0x3ae4a6=_0x24f736,_0x5bd242=_0x435d28[_0x3ae4a6(0x170)]?.['status']?_0x435d28['last_job'][_0x3ae4a6(0x1cc)]===_0x3ae4a6(0x190)?'βœ“':'βœ—':'-',_0x463e3d=_0x435d28[_0x3ae4a6(0x170)]?.[_0x3ae4a6(0x1f1)]?formatRelativeTime(_0x435d28[_0x3ae4a6(0x170)][_0x3ae4a6(0x1f1)]):'never',_0x597973=_0x435d28[_0x3ae4a6(0x1c9)]?formatRelativeTime(_0x435d28[_0x3ae4a6(0x1c9)]):'-',_0x196f94=_0x435d28[_0x3ae4a6(0x1f2)]||'',_0x36868b=_0x435d28[_0x3ae4a6(0x1a5)]||_0x3ae4a6(0x171),_0x59cb86=getConsoleUrl(_0x4cb768,'/app/queries/editor?queryId='+_0x435d28['id']);return{'statusIcon':_0x5bd242,'lastRun':_0x463e3d,'nextRun':_0x597973,'cron':_0x196f94,'name':_0x36868b,'queryUrl':_0x59cb86,'status':_0x435d28[_0x3ae4a6(0x170)]?.[_0x3ae4a6(0x1cc)]};}),_0x40c562=Math[_0x24f736(0x1e6)](..._0x186245['map'](_0x19013f=>_0x19013f[_0x24f736(0x1ad)]['length'])),_0x3eb6ae=Math[_0x24f736(0x1e6)](..._0x186245[_0x24f736(0x1e4)](_0x123136=>_0x123136[_0x24f736(0x181)]['length'])),_0x1641ab=Math[_0x24f736(0x1e6)](..._0x186245[_0x24f736(0x1e4)](_0x2f04f4=>_0x2f04f4[_0x24f736(0x1f2)][_0x24f736(0x18e)])),_0x548e1d=_0x186245[_0x24f736(0x1e4)](_0x2f61d6=>{const _0x44fe73=_0x24f736,_0x23452e=_0x2f61d6[_0x44fe73(0x1cc)]===_0x44fe73(0x190)?a26_0x949c9d[_0x44fe73(0x1a7)](_0x2f61d6[_0x44fe73(0x1d6)]):_0x2f61d6['status']===_0x44fe73(0x17d)?a26_0x949c9d[_0x44fe73(0x1ba)](_0x2f61d6['statusIcon']):a26_0x949c9d[_0x44fe73(0x17f)](_0x2f61d6['statusIcon']),_0x295e3f=_0x2f61d6['lastRun']['padEnd'](_0x40c562),_0x32dea3=_0x2f61d6[_0x44fe73(0x181)][_0x44fe73(0x197)](_0x3eb6ae),_0x28c73d=_0x2f61d6[_0x44fe73(0x1f2)]?a26_0x949c9d[_0x44fe73(0x1e2)](_0x2f61d6['cron']['padEnd'](_0x1641ab)):'\x20'[_0x44fe73(0x1ea)](_0x1641ab),_0x5b6e83=hyperlink(_0x2f61d6[_0x44fe73(0x1a5)],_0x2f61d6[_0x44fe73(0x1e8)]);return _0x44fe73(0x1ee)+_0x23452e+'\x20'+_0x295e3f+'\x20\x20β†’\x20'+_0x32dea3+'\x20\x20'+_0x28c73d+'\x20\x20'+_0x5b6e83;});await writeOutput(_0x548e1d[_0x24f736(0x1b8)]('\x0a'),_0x3e165b['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]=a26_0x280eb8(0x1cb);[a26_0x280eb8(0x194)]=a26_0x280eb8(0x1e0);['validate'](_0x524b93){const _0x436226=a26_0x280eb8,_0x932ec5=_0x524b93[_0x436226(0x178)][0x0];if(!_0x932ec5)return _0x436226(0x1de);return undefined;}async[a26_0x280eb8(0x1b6)](_0x251ca8){const _0x3bb777=a26_0x280eb8,{options:_0x3e88a6,args:_0x2b014a,tdx:_0x4a02e3}=_0x251ca8,_0x5a08c3=_0x2b014a[0x0],_0x4820b0=await withSpinner(_0x3bb777(0x1a0),()=>_0x4a02e3[_0x3bb777(0x19d)][_0x3bb777(0x1ab)](_0x5a08c3),{'verbose':_0x3e88a6[_0x3bb777(0x1c0)]}),_0x3db886=_0x4820b0[_0x3bb777(0x1b3)],_0x61f3cb={'name':_0x3db886[_0x3bb777(0x1a5)],'cron':_0x3db886[_0x3bb777(0x1f2)],'database':_0x3db886[_0x3bb777(0x18d)],'type':_0x3db886[_0x3bb777(0x1ac)],'timezone':_0x3db886[_0x3bb777(0x192)],'user_name':_0x3db886[_0x3bb777(0x185)],'created_at':_0x3db886[_0x3bb777(0x1d3)],'engine_version':_0x3db886['engine_version'],'executing_user_id':_0x3db886[_0x3bb777(0x1ca)],'query':_0x3db886[_0x3bb777(0x1db)],'delay':_0x3db886['delay'],'priority':_0x3db886[_0x3bb777(0x1c5)],'retry_limit':_0x3db886[_0x3bb777(0x1b5)],..._0x3db886[_0x3bb777(0x1a4)]&&{'result':_0x3db886[_0x3bb777(0x1a4)]}};return await handleSingleObjectOutput(_0x61f3cb,_0x3e88a6),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]=a26_0x280eb8(0x175);['description']=a26_0x280eb8(0x1d2);[a26_0x280eb8(0x1f9)](_0x15e76c){const _0x3611c5=a26_0x280eb8,_0x19bb9b=_0x15e76c['args'][0x0];if(!_0x19bb9b)return _0x3611c5(0x184);return undefined;}async[a26_0x280eb8(0x1b6)](_0xc64bed){const _0x52afec=a26_0x280eb8,{options:_0x4506ea,args:_0x54215f,tdx:_0x597311}=_0xc64bed,_0x31ebdb=_0x54215f[0x0],_0x499eb2=_0x4506ea,_0x4a33e7=_0x499eb2[_0x52afec(0x18d)],_0x5796ca=_0x499eb2[_0x52afec(0x199)],_0x4fe7e5=_0x499eb2[_0x52afec(0x1ac)]||'trino';let _0x38397f;try{_0x38397f=readFileSync(_0x5796ca,_0x52afec(0x174))['trim']();}catch(_0x176efd){throw new SDKError(ErrorCode[_0x52afec(0x17e)],_0x52afec(0x1c4)+_0x5796ca,_0x176efd instanceof Error?_0x176efd:undefined);}if(!_0x38397f)throw new SDKError(ErrorCode[_0x52afec(0x17e)],'Query\x20file\x20is\x20empty');const _0x3f6fd0={'database':_0x4a33e7,'query':_0x38397f,'type':_0x4fe7e5};if(_0x499eb2['cron'])_0x3f6fd0[_0x52afec(0x1f2)]=_0x499eb2['cron'];if(_0x499eb2[_0x52afec(0x192)])_0x3f6fd0['timezone']=_0x499eb2[_0x52afec(0x192)];if(_0x499eb2[_0x52afec(0x188)]!==undefined)_0x3f6fd0[_0x52afec(0x188)]=Number(_0x499eb2[_0x52afec(0x188)]);if(_0x499eb2['priority']!==undefined)_0x3f6fd0[_0x52afec(0x1c5)]=Number(_0x499eb2['priority']);if(_0x499eb2[_0x52afec(0x1af)]!==undefined)_0x3f6fd0['retry_limit']=Number(_0x499eb2[_0x52afec(0x1af)]);if(_0x499eb2[_0x52afec(0x1a3)])_0x3f6fd0[_0x52afec(0x1ed)]=_0x499eb2[_0x52afec(0x1a3)];if(_0x499eb2['result'])_0x3f6fd0[_0x52afec(0x1a4)]=_0x499eb2[_0x52afec(0x1a4)];if(_0x4506ea[_0x52afec(0x1c0)]){console[_0x52afec(0x17d)](_0x52afec(0x1f8)+_0x31ebdb),console[_0x52afec(0x17d)](_0x52afec(0x1c3)+_0x4a33e7),console[_0x52afec(0x17d)](_0x52afec(0x1f6)+_0x4fe7e5);if(_0x3f6fd0[_0x52afec(0x1f2)])console[_0x52afec(0x17d)]('\x20\x20Cron:\x20'+_0x3f6fd0[_0x52afec(0x1f2)]);if(_0x3f6fd0[_0x52afec(0x192)])console[_0x52afec(0x17d)](_0x52afec(0x1d4)+_0x3f6fd0[_0x52afec(0x192)]);}const _0x4baac3=await withSpinner(_0x52afec(0x1aa),()=>_0x597311[_0x52afec(0x19d)][_0x52afec(0x1e5)](_0x31ebdb,_0x3f6fd0),{'verbose':_0x4506ea[_0x52afec(0x1c0)]});return console['error'](_0x52afec(0x1bd)+_0x4baac3[_0x52afec(0x1b3)][_0x52afec(0x1a5)]),await handleSingleObjectOutput(_0x4baac3[_0x52afec(0x1b3)],_0x4506ea),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]=a26_0x280eb8(0x18c);['description']=a26_0x280eb8(0x1ce);[a26_0x280eb8(0x1f9)](_0x3cbf24){const _0x8d3d7d=a26_0x280eb8,_0x5b6b83=_0x3cbf24[_0x8d3d7d(0x178)][0x0];if(!_0x5b6b83)return _0x8d3d7d(0x1da);return undefined;}async[a26_0x280eb8(0x1b6)](_0x15c890){const _0x309f11=a26_0x280eb8,{options:_0x54f7d6,args:_0x1c63c1,tdx:_0x105b07}=_0x15c890,_0x275dba=_0x1c63c1[0x0],_0xeb014a=_0x54f7d6,_0x39f019={};if(_0xeb014a[_0x309f11(0x18d)])_0x39f019['database']=_0xeb014a[_0x309f11(0x18d)];if(_0xeb014a['type'])_0x39f019[_0x309f11(0x1ac)]=_0xeb014a[_0x309f11(0x1ac)];if(_0xeb014a[_0x309f11(0x1f2)])_0x39f019[_0x309f11(0x1f2)]=_0xeb014a['cron'];if(_0xeb014a[_0x309f11(0x192)])_0x39f019[_0x309f11(0x192)]=_0xeb014a[_0x309f11(0x192)];if(_0xeb014a['delay']!==undefined)_0x39f019[_0x309f11(0x188)]=Number(_0xeb014a[_0x309f11(0x188)]);if(_0xeb014a['priority']!==undefined)_0x39f019[_0x309f11(0x1c5)]=Number(_0xeb014a[_0x309f11(0x1c5)]);if(_0xeb014a['retryLimit']!==undefined)_0x39f019[_0x309f11(0x1b5)]=Number(_0xeb014a[_0x309f11(0x1af)]);if(_0xeb014a['engineVersion'])_0x39f019[_0x309f11(0x1ed)]=_0xeb014a[_0x309f11(0x1a3)];if(_0xeb014a[_0x309f11(0x1a4)])_0x39f019[_0x309f11(0x1a4)]=_0xeb014a[_0x309f11(0x1a4)];if(_0xeb014a[_0x309f11(0x199)])try{_0x39f019[_0x309f11(0x1db)]=readFileSync(_0xeb014a[_0x309f11(0x199)],_0x309f11(0x174))[_0x309f11(0x189)]();}catch(_0xaa9d68){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x309f11(0x1c4)+_0xeb014a[_0x309f11(0x199)],_0xaa9d68 instanceof Error?_0xaa9d68:undefined);}if(Object[_0x309f11(0x19f)](_0x39f019)[_0x309f11(0x18e)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x309f11(0x1bc));if(_0x54f7d6[_0x309f11(0x1c0)]){console[_0x309f11(0x17d)](_0x309f11(0x1fc)+_0x275dba);for(const [_0x581ae5,_0x3cdb03]of Object[_0x309f11(0x1d5)](_0x39f019)){_0x581ae5===_0x309f11(0x1db)?console[_0x309f11(0x17d)]('\x20\x20'+_0x581ae5+':\x20'+_0x3cdb03[_0x309f11(0x1c2)](0x0,0x32)+_0x309f11(0x191)):console[_0x309f11(0x17d)]('\x20\x20'+_0x581ae5+':\x20'+_0x3cdb03);}}const _0x1011a4=await withSpinner('Updating\x20schedule...',()=>_0x105b07['schedules'][_0x309f11(0x17a)](_0x275dba,_0x39f019),{'verbose':_0x54f7d6[_0x309f11(0x1c0)]});return console[_0x309f11(0x17d)](_0x309f11(0x19a)+_0x1011a4[_0x309f11(0x1b3)][_0x309f11(0x1a5)]),await handleSingleObjectOutput(_0x1011a4[_0x309f11(0x1b3)],_0x54f7d6),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]=a26_0x280eb8(0x19c);[a26_0x280eb8(0x194)]='Delete\x20a\x20scheduled\x20query';[a26_0x280eb8(0x1f9)](_0x4b052a){const _0x1f3374=a26_0x280eb8,_0x1c113b=_0x4b052a['args'][0x0];if(!_0x1c113b)return _0x1f3374(0x1d7);return undefined;}async[a26_0x280eb8(0x1b6)](_0x444462){const _0x4f2f66=a26_0x280eb8,{options:_0x53b14e,args:_0x15ad55,tdx:_0x5a91f6}=_0x444462,_0x25106e=_0x15ad55[0x0];if(!_0x53b14e['yes']){const _0x245caa=await confirm(_0x4f2f66(0x198)+_0x25106e+'\x22?');if(!_0x245caa)return console[_0x4f2f66(0x17d)]('Cancelled'),0x0;}const _0x15bac7=await withSpinner('Deleting\x20schedule...',()=>_0x5a91f6[_0x4f2f66(0x19d)][_0x4f2f66(0x1fd)](_0x25106e),{'verbose':_0x53b14e[_0x4f2f66(0x1c0)]});return console[_0x4f2f66(0x17d)](_0x4f2f66(0x1e3)+_0x15bac7[_0x4f2f66(0x1b3)][_0x4f2f66(0x1a5)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]='schedule:run';[a26_0x280eb8(0x194)]='Run\x20a\x20scheduled\x20query\x20immediately';[a26_0x280eb8(0x1f9)](_0x41afb4){const _0x57ccda=a26_0x280eb8,_0x42dc83=_0x41afb4[_0x57ccda(0x178)][0x0];if(!_0x42dc83)return _0x57ccda(0x179);return undefined;}async[a26_0x280eb8(0x1b6)](_0x3e9cc7){const _0x1a2d29=a26_0x280eb8,{options:_0x2adcd0,args:_0x1041a4,tdx:_0x15217b}=_0x3e9cc7,_0x297c5e=_0x1041a4[0x0],_0x1c3a18=_0x2adcd0,_0xec778c=_0x1c3a18[_0x1a2d29(0x193)],_0x5ec91d=_0x1c3a18[_0x1a2d29(0x1b1)]!==undefined?Number(_0x1c3a18['num']):undefined;if(_0x2adcd0['verbose']){console[_0x1a2d29(0x17d)]('Running\x20schedule:\x20'+_0x297c5e);if(_0xec778c)console[_0x1a2d29(0x17d)](_0x1a2d29(0x18f)+_0xec778c);if(_0x5ec91d)console[_0x1a2d29(0x17d)](_0x1a2d29(0x1f5)+_0x5ec91d);}const _0x5a95f8=await withSpinner('Running\x20schedule...',()=>_0x15217b[_0x1a2d29(0x19d)][_0x1a2d29(0x1b2)](_0x297c5e,{'time':_0xec778c,'num':_0x5ec91d}),{'verbose':_0x2adcd0[_0x1a2d29(0x1c0)]}),_0xe0f257=_0x5a95f8[_0x1a2d29(0x1b3)][_0x1a2d29(0x196)];console[_0x1a2d29(0x17d)](_0x1a2d29(0x1dc)+_0xe0f257[_0x1a2d29(0x18e)]+_0x1a2d29(0x1b0)+(_0xe0f257[_0x1a2d29(0x18e)]!==0x1?'s':'')+_0x1a2d29(0x1e7));for(const _0x45bbb8 of _0xe0f257){console[_0x1a2d29(0x17d)]('\x20\x20Job\x20ID:\x20'+_0x45bbb8['job_id']);}return await handleSDKOutput(_0xe0f257,_0x2adcd0),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x280eb8(0x1a5)]='schedule:history';['description']=a26_0x280eb8(0x1dd);[a26_0x280eb8(0x1f9)](_0x9693d){const _0x5edf7b=a26_0x280eb8,_0x5b6637=_0x9693d[_0x5edf7b(0x178)][0x0];if(!_0x5b6637)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a26_0x280eb8(0x1b6)](_0x586a18){const _0x2388fb=a26_0x280eb8,{options:_0x3ad110,args:_0x2edbaa,tdx:_0x205ffd}=_0x586a18,_0x30ac83=_0x2edbaa[0x0],_0x3b2b88=_0x3ad110,_0x4e33a3=_0x3b2b88['from']!==undefined?Number(_0x3b2b88['from']):undefined,_0x329715=_0x3b2b88['to']!==undefined?Number(_0x3b2b88['to']):undefined,_0x3fafea=await withSpinner(_0x2388fb(0x1b9),()=>_0x205ffd[_0x2388fb(0x19d)][_0x2388fb(0x1a9)](_0x30ac83,{'from':_0x4e33a3,'to':_0x329715}),{'verbose':_0x3ad110[_0x2388fb(0x1c0)]}),_0x5264f3=_0x3fafea['data'];console[_0x2388fb(0x17d)]('Found\x20'+_0x5264f3['count']+_0x2388fb(0x1e1)+(_0x5264f3[_0x2388fb(0x17b)]!==0x1?'s':'')+_0x2388fb(0x1df)+_0x5264f3[_0x2388fb(0x16f)]+'-'+_0x5264f3['to']+')');const _0x219d71=_0x5264f3[_0x2388fb(0x1a9)]['map'](_0x5f2ef6=>({'job_id':_0x5f2ef6[_0x2388fb(0x1c8)],'type':_0x5f2ef6[_0x2388fb(0x1ac)],'status':_0x5f2ef6[_0x2388fb(0x1cc)],'scheduled_at':_0x5f2ef6[_0x2388fb(0x1a1)],'created_at':_0x5f2ef6[_0x2388fb(0x1d3)],'start_at':_0x5f2ef6[_0x2388fb(0x183)],'end_at':_0x5f2ef6[_0x2388fb(0x187)]}));return await handleSDKOutput(_0x219d71,_0x3ad110),0x0;}}
@@ -1 +1 @@
1
- const a27_0x3bfcdd=a27_0xfa2f;(function(_0x122438,_0x280b72){const _0xbdd52=a27_0xfa2f,_0x2fc39d=_0x122438();while(!![]){try{const _0x104755=-parseInt(_0xbdd52(0x134))/0x1+-parseInt(_0xbdd52(0x18b))/0x2*(-parseInt(_0xbdd52(0x14a))/0x3)+-parseInt(_0xbdd52(0x147))/0x4*(-parseInt(_0xbdd52(0x13d))/0x5)+parseInt(_0xbdd52(0x132))/0x6+parseInt(_0xbdd52(0x1bc))/0x7*(-parseInt(_0xbdd52(0x1c3))/0x8)+-parseInt(_0xbdd52(0x148))/0x9*(-parseInt(_0xbdd52(0x136))/0xa)+-parseInt(_0xbdd52(0x16b))/0xb*(parseInt(_0xbdd52(0x18e))/0xc);if(_0x104755===_0x280b72)break;else _0x2fc39d['push'](_0x2fc39d['shift']());}catch(_0x220a1c){_0x2fc39d['push'](_0x2fc39d['shift']());}}}(a27_0x3cf1,0xa2cb0));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';function a27_0xfa2f(_0x550aa6,_0x1d4883){_0x550aa6=_0x550aa6-0x12d;const _0x3cf191=a27_0x3cf1();let _0xfa2f24=_0x3cf191[_0x550aa6];return _0xfa2f24;}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_0x44905d from'chalk';async function resolveSegmentTarget(_0x5358e2,_0x5bb884,_0x507422){const _0x16b09f=a27_0xfa2f;if(isYamlFilePath(_0x5358e2))try{const _0x199bbf=await resolveYamlFilePath(_0x5358e2);return _0x507422&&(console['error'](_0x16b09f(0x170)+_0x5358e2),console['error']('\x20\x20Parent\x20segment:\x20'+_0x199bbf[_0x16b09f(0x144)]),console[_0x16b09f(0x186)](_0x16b09f(0x1ae)+_0x199bbf[_0x16b09f(0x1b9)]),console[_0x16b09f(0x186)](_0x16b09f(0x18a)+(_0x199bbf[_0x16b09f(0x19d)]||_0x16b09f(0x17b))),console[_0x16b09f(0x186)](_0x16b09f(0x155)+_0x199bbf[_0x16b09f(0x1a2)])),_0x199bbf[_0x16b09f(0x1a2)];}catch(_0x71fbbf){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x16b09f(0x171)+_0x71fbbf['message']);}if(!_0x5bb884)throw new SDKError(ErrorCode[_0x16b09f(0x169)],_0x16b09f(0x192));return _0x5bb884+'/'+_0x5358e2;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x3bfcdd(0x13a)]=a27_0x3bfcdd(0x1c6);[a27_0x3bfcdd(0x187)]=a27_0x3bfcdd(0x16f);async[a27_0x3bfcdd(0x17a)](_0x294190){const _0x10b632=a27_0x3bfcdd,{options:_0x3f01a4,args:_0x2ac071,tdx:_0x1640ea}=_0x294190,_0x12a7b8=_0x2ac071[0x0],_0x1c6675=!_0x12a7b8&&!!_0x3f01a4['parentSegment'],_0x178652=_0x12a7b8||_0x3f01a4[_0x10b632(0x144)];if(!_0x178652)return console[_0x10b632(0x186)](_0x10b632(0x14c)),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x10b632(0x186)](_0x10b632(0x157)),console[_0x10b632(0x186)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x10b632(0x186)](_0x10b632(0x1ad)),console['error'](_0x10b632(0x1b8)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x4ec405=_0x3f01a4[_0x10b632(0x151)];let _0x311475=_0x178652;!_0x1c6675&&_0x4ec405&&!_0x178652[_0x10b632(0x1a5)]('/')&&(_0x311475=_0x4ec405+'/'+_0x178652,_0x3f01a4[_0x10b632(0x19f)]&&console[_0x10b632(0x186)](_0x10b632(0x1b0)+_0x311475));const _0x114b73=await withSpinner(_0x10b632(0x193)+_0x311475+_0x10b632(0x173),()=>_0x1640ea[_0x10b632(0x19e)][_0x10b632(0x17d)](_0x311475),{'verbose':_0x3f01a4[_0x10b632(0x19f)]}),_0x2fd376=_0x114b73['data'];_0x3f01a4[_0x10b632(0x19f)]&&(console[_0x10b632(0x186)](_0x10b632(0x16a)+_0x2fd376['type']),console[_0x10b632(0x186)]('Parent\x20ID:\x20'+_0x2fd376[_0x10b632(0x1b3)]),_0x2fd376[_0x10b632(0x1a8)]&&console['error'](_0x10b632(0x177)+_0x2fd376[_0x10b632(0x1a8)]),_0x2fd376[_0x10b632(0x17c)]&&console[_0x10b632(0x186)]('Segment\x20ID:\x20'+_0x2fd376[_0x10b632(0x17c)]));if(_0x2fd376['type']==='parent'){const _0x4fffca=await withSpinner(_0x10b632(0x198),()=>_0x1640ea[_0x10b632(0x19e)][_0x10b632(0x139)](_0x2fd376[_0x10b632(0x1b3)]),{'verbose':_0x3f01a4[_0x10b632(0x19f)]});await handleSingleObjectOutput(_0x4fffca['data'],_0x3f01a4);}else{if(_0x2fd376[_0x10b632(0x14e)]===_0x10b632(0x162)){if(!_0x2fd376[_0x10b632(0x1a8)])throw new SDKError(ErrorCode[_0x10b632(0x1bb)],_0x10b632(0x141));const _0x5377d9=await withSpinner(_0x10b632(0x1a1),()=>_0x1640ea[_0x10b632(0x19e)][_0x10b632(0x18d)](_0x2fd376[_0x10b632(0x1a8)]),{'verbose':_0x3f01a4[_0x10b632(0x19f)]});await handleSingleObjectOutput(_0x5377d9[_0x10b632(0x1c1)],_0x3f01a4);}else{if(_0x2fd376['type']===_0x10b632(0x19e)){if(!_0x2fd376[_0x10b632(0x17c)])throw new SDKError(ErrorCode[_0x10b632(0x1be)],_0x10b632(0x1a4));const _0x3b24ba=await withSpinner(_0x10b632(0x180),()=>_0x1640ea['segment'][_0x10b632(0x12e)](_0x2fd376[_0x10b632(0x1b3)],_0x2fd376[_0x10b632(0x17c)]),{'verbose':_0x3f01a4[_0x10b632(0x19f)]});await handleSingleObjectOutput(_0x3b24ba[_0x10b632(0x1c1)],_0x3f01a4);}}}return 0x0;}catch(_0x5718d5){if(_0x5718d5 instanceof SDKError)return console['error'](_0x10b632(0x195)+_0x5718d5[_0x10b632(0x1b5)]),_0x5718d5[_0x10b632(0x179)]&&console[_0x10b632(0x186)](_0x10b632(0x181)+_0x5718d5[_0x10b632(0x179)]),0x1;throw _0x5718d5;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x3bfcdd(0x13a)]='segment:show';[a27_0x3bfcdd(0x187)]=a27_0x3bfcdd(0x17e);async[a27_0x3bfcdd(0x17a)](_0x293efb){const _0x13db1f=a27_0x3bfcdd,{options:_0x11df95,args:_0x40f457,tdx:_0x4aea41}=_0x293efb,_0x48279e=_0x40f457[0x0];if(!_0x48279e)return console[_0x13db1f(0x186)](_0x13db1f(0x131)),console[_0x13db1f(0x186)](_0x13db1f(0x176)),console[_0x13db1f(0x186)](_0x13db1f(0x14b)),console['error'](_0x13db1f(0x157)),console['error'](_0x13db1f(0x1ab)),console[_0x13db1f(0x186)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x83e112=_0x11df95[_0x13db1f(0x144)],_0x643dd=await resolveSegmentTarget(_0x48279e,_0x83e112,_0x11df95['verbose']);_0x11df95[_0x13db1f(0x19f)]&&console[_0x13db1f(0x186)](_0x13db1f(0x199)+_0x643dd);const _0x2c0df3=await withSpinner(_0x13db1f(0x133)+_0x48279e+_0x13db1f(0x173),()=>_0x4aea41[_0x13db1f(0x19e)]['resolvePathToResource'](_0x643dd),{'verbose':_0x11df95[_0x13db1f(0x19f)]}),_0x10967f=_0x2c0df3[_0x13db1f(0x1c1)];_0x11df95['verbose']&&(console[_0x13db1f(0x186)]('Resolved\x20type:\x20'+_0x10967f[_0x13db1f(0x14e)]),console[_0x13db1f(0x186)]('Parent\x20ID:\x20'+_0x10967f[_0x13db1f(0x1b3)]));if(_0x10967f[_0x13db1f(0x14e)]===_0x13db1f(0x162))return console[_0x13db1f(0x186)](_0x13db1f(0x183)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x10967f[_0x13db1f(0x14e)]===_0x13db1f(0x1a6))return console[_0x13db1f(0x186)](_0x13db1f(0x1b2)),console[_0x13db1f(0x186)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x10967f[_0x13db1f(0x17c)])throw new SDKError(ErrorCode[_0x13db1f(0x1be)],_0x13db1f(0x1a4));const _0x1e74d6=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x4aea41[_0x13db1f(0x19e)][_0x13db1f(0x14f)](_0x10967f['parentId'],_0x10967f['segmentId']),{'verbose':_0x11df95['verbose']});let _0x4c504d=_0x1e74d6[_0x13db1f(0x1c1)];const _0x183987=resolveLimit(_0x11df95[_0x13db1f(0x196)],DEFAULT_DISPLAY_LIMIT),_0x226b36=/\bLIMIT\s+\d+/i[_0x13db1f(0x165)](_0x4c504d);!_0x226b36&&(_0x4c504d=_0x4c504d[_0x13db1f(0x1c4)]()[_0x13db1f(0x1b6)](/;+$/,''),_0x4c504d=_0x13db1f(0x166)+_0x4c504d+_0x13db1f(0x13f)+_0x183987);_0x11df95['verbose']&&console[_0x13db1f(0x186)](_0x13db1f(0x15a)+_0x4c504d);const _0x2e3028=await withProgressSpinner(_0x13db1f(0x13c),async _0x54bb08=>{const _0x26c37a=_0x13db1f,_0x535e59=await _0x4aea41[_0x26c37a(0x15e)][_0x26c37a(0x17a)](_0x4c504d,{'catalog':'td','schema':_0x26c37a(0x1ac),'onJobId':_0x4c32dd=>{const _0x5532c6=_0x26c37a;_0x54bb08[_0x5532c6(0x1a9)](_0x4c32dd);}});return _0x535e59;},{'verbose':_0x11df95[_0x13db1f(0x19f)]}),_0x558617=_0x2e3028[_0x13db1f(0x1c1)],_0x283bd6=_0x558617['jobId']?_0x13db1f(0x1c5)+_0x558617[_0x13db1f(0x191)]+']':'';return console[_0x13db1f(0x186)]('βœ”\x20Query\x20completed:\x20Processed\x20'+_0x558617[_0x13db1f(0x138)][_0x13db1f(0x19c)][_0x13db1f(0x16e)]()+'\x20rows\x20'+(_0x13db1f(0x145)+formatElapsed(_0x558617['stats']['elapsedTimeMillis'])+_0x283bd6)),await handleQueryOutput(_0x558617,_0x11df95),0x0;}catch(_0x5731d5){if(_0x5731d5 instanceof SDKError)return console[_0x13db1f(0x186)](_0x13db1f(0x185)+_0x5731d5['code']+']'),console[_0x13db1f(0x186)]('\x0a'+_0x5731d5[_0x13db1f(0x1b5)]),0x1;throw _0x5731d5;}}}function a27_0x3cf1(){const _0x2f3c66=['stats','getParent','name','Get\x20SQL\x20query\x20for\x20child\x20segment','Executing\x20segment\x20query...','76355IGcbHa','Options:','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20Opening\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','url','segment:sql','parentSegment','in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','348nboKMG','1933506UVAqDz','Site:\x20','9rFYPMw','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Path\x20or\x20name\x20is\x20required','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','type','getSegmentSQL','Creating\x20folder\x20\x27','segmentPath','Usage:\x20tdx\x20sg\x20desc\x20<name>','Fetching\x20SQL\x20for\x20segment...','resolveFolderId','\x20\x20Full\x20path:\x20','Resolving\x20folder\x20\x27','Examples:','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','log','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','query','site','json','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','folder','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Folder\x20name:\x20','test','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Resolved\x20parent\x20ID:\x20','INVALID_ARGUMENT','Resolved\x20type:\x20','6377569FwlPKA','Parent\x20name:\x20','cyan','toLocaleString','Show\x20segment\x20or\x20folder\x20details','Resolved\x20YAML\x20file:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Use:\x20tdx\x20ps\x20desc','\x27...','\x20folder','Use:\x20tdx\x20ps\x20view\x20-w','Usage:\x20tdx\x20sg\x20show\x20<name>','Folder\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','cause','execute','(root)','segmentId','resolvePathToResource','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Parent\x20ID:\x20','Fetching\x20segment\x20details...','\x20\x20Cause:\x20','resolveParentId','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','/e/','βœ–\x20Query\x20failed\x20[','error','description','format','segment:desc','\x20\x20Folder\x20path:\x20','98418TFlsgc','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','getFolder','36rrvXSi','green','parentFolder','jobId','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20path\x20\x27','\x27\x20with\x20ID:\x20','Error:\x20','limit','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Fetching\x20parent\x20segment\x20details...','Target\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','processedRows','folderPath','segment','verbose','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20folder\x20details...','fullPath','Resolved\x20parent\x20folder\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','includes','parent','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','folderId','setJobId','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','information_schema','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','\x20\x20Segment\x20name:\x20','Error:\x20Folder\x20reference\x20is\x20required','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','parentId','Resolving\x20parent\x20folder\x20\x27','message','replace','Fetching\x20folder\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','segmentName','Usage:\x20tdx\x20sg\x20sql\x20<name>','SEGMENT_FOLDER_NOT_FOUND','539XLrQPp','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','SEGMENT_NOT_FOUND','/app/ps/','Error:\x20Parent\x20segment\x20name\x20is\x20required','data','segment:folder:create','45896mtahet','trim','\x20[Job\x20ID:\x20','segment:describe','length','βœ”\x20Created\x20folder\x20\x27','getSegment','Show\x20folder\x20or\x20child\x20segment\x20details','Segment\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','6782904GfITeB','Resolving\x20\x27','403304HtrSoL','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','30jzRwua','Resolved\x20folder\x20ID:\x20'];a27_0x3cf1=function(){return _0x2f3c66;};return a27_0x3cf1();}export class SegmentFolderListCommand extends BaseCommand{[a27_0x3bfcdd(0x13a)]='segment:folder:list';[a27_0x3bfcdd(0x187)]=a27_0x3bfcdd(0x135);async[a27_0x3bfcdd(0x17a)](_0x2b0278){const _0x50c363=a27_0x3bfcdd,{options:_0x4e7f11,args:_0x1a2d2b,tdx:_0xf9860d}=_0x2b0278;if(_0x1a2d2b[_0x50c363(0x1c7)]===0x0)return console[_0x50c363(0x186)](_0x50c363(0x1c0)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x103deb=_0x1a2d2b[0x0];try{_0x4e7f11['verbose']&&(console[_0x50c363(0x186)](_0x50c363(0x149)+_0x4e7f11[_0x50c363(0x15f)]),console[_0x50c363(0x186)](_0x50c363(0x16c)+_0x103deb));const _0x555618=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x103deb+'\x27...',()=>_0xf9860d[_0x50c363(0x19e)][_0x50c363(0x182)](_0x103deb),{'verbose':_0x4e7f11[_0x50c363(0x19f)]}),_0x85090=_0x555618['data'];_0x4e7f11[_0x50c363(0x19f)]&&console[_0x50c363(0x186)](_0x50c363(0x168)+_0x85090);const _0x3fa728=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x103deb+'\x27...',()=>_0xf9860d[_0x50c363(0x19e)]['listFolders'](_0x85090),{'verbose':_0x4e7f11[_0x50c363(0x19f)]}),_0x177786=_0x3fa728[_0x50c363(0x1c1)];return console[_0x50c363(0x186)]('βœ”\x20Found\x20'+_0x177786[_0x50c363(0x1c7)]+_0x50c363(0x174)+(_0x177786[_0x50c363(0x1c7)]!==0x1?'s':'')),await handleSDKOutput(_0x177786,_0x4e7f11),0x0;}catch(_0x1b7b74){if(_0x1b7b74 instanceof SDKError)return console[_0x50c363(0x186)](_0x50c363(0x195)+_0x1b7b74[_0x50c363(0x1b5)]),_0x1b7b74[_0x50c363(0x179)]&&console['error']('\x20\x20Cause:\x20'+_0x1b7b74[_0x50c363(0x179)]),0x1;throw _0x1b7b74;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x3bfcdd(0x13a)]='segment:folder:show';[a27_0x3bfcdd(0x187)]='Show\x20segment\x20folder\x20details';async[a27_0x3bfcdd(0x17a)](_0x45970f){const _0x3dac1e=a27_0x3bfcdd,{options:_0x332dea,args:_0x1775ca,tdx:_0xc32682}=_0x45970f;if(_0x1775ca[_0x3dac1e(0x1c7)]===0x0)return console[_0x3dac1e(0x186)](_0x3dac1e(0x1af)),console['error'](_0x3dac1e(0x1bd)),0x1;try{const {parentId:_0x3dc1c8,childId:_0x40b734}=parseSegmentRef(_0x1775ca[0x0]);_0x332dea[_0x3dac1e(0x19f)]&&(console[_0x3dac1e(0x186)](_0x3dac1e(0x149)+_0x332dea[_0x3dac1e(0x15f)]),console[_0x3dac1e(0x186)](_0x3dac1e(0x16c)+_0x3dc1c8),_0x40b734&&console[_0x3dac1e(0x186)](_0x3dac1e(0x164)+_0x40b734));if(!_0x40b734)return console[_0x3dac1e(0x186)](_0x3dac1e(0x1aa)),0x1;const _0x5495ed=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3dc1c8+_0x3dac1e(0x173),()=>_0xc32682[_0x3dac1e(0x19e)][_0x3dac1e(0x182)](_0x3dc1c8),{'verbose':_0x332dea['verbose']}),_0x3a0f7f=_0x5495ed[_0x3dac1e(0x1c1)];_0x332dea['verbose']&&console[_0x3dac1e(0x186)](_0x3dac1e(0x168)+_0x3a0f7f);const _0x53d1c0=await withSpinner(_0x3dac1e(0x156)+_0x40b734+_0x3dac1e(0x173),()=>_0xc32682[_0x3dac1e(0x19e)][_0x3dac1e(0x154)](_0x3a0f7f,_0x40b734),{'verbose':_0x332dea[_0x3dac1e(0x19f)]}),_0x45f018=_0x53d1c0[_0x3dac1e(0x1c1)];_0x332dea[_0x3dac1e(0x19f)]&&console[_0x3dac1e(0x186)](_0x3dac1e(0x137)+_0x45f018);const _0x304310=await withSpinner(_0x3dac1e(0x1b7)+_0x40b734+'\x27...',()=>_0xc32682[_0x3dac1e(0x19e)][_0x3dac1e(0x18d)](_0x45f018),{'verbose':_0x332dea[_0x3dac1e(0x19f)]});return await handleSDKOutput([_0x304310[_0x3dac1e(0x1c1)]],_0x332dea),0x0;}catch(_0x253031){if(_0x253031 instanceof SDKError)return console['error']('Error:\x20'+_0x253031[_0x3dac1e(0x1b5)]),_0x253031[_0x3dac1e(0x179)]&&console[_0x3dac1e(0x186)](_0x3dac1e(0x181)+_0x253031[_0x3dac1e(0x179)]),0x1;throw _0x253031;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x3bfcdd(0x13a)]=a27_0x3bfcdd(0x143);[a27_0x3bfcdd(0x187)]=a27_0x3bfcdd(0x13b);async[a27_0x3bfcdd(0x17a)](_0x275a11){const _0x34e7a2=a27_0x3bfcdd,{options:_0x344a58,args:_0x312c31,tdx:_0x189631}=_0x275a11,_0x263151=_0x312c31[0x0];if(!_0x263151)return console[_0x34e7a2(0x186)](_0x34e7a2(0x131)),console[_0x34e7a2(0x186)](_0x34e7a2(0x1ba)),console['error'](_0x34e7a2(0x146)),console['error']('Examples:'),console[_0x34e7a2(0x186)](_0x34e7a2(0x18c)),console[_0x34e7a2(0x186)](_0x34e7a2(0x15b)),0x1;try{const _0x391146=_0x344a58[_0x34e7a2(0x144)],_0x424009=await resolveSegmentTarget(_0x263151,_0x391146,_0x344a58[_0x34e7a2(0x19f)]);_0x344a58[_0x34e7a2(0x19f)]&&console['error'](_0x34e7a2(0x199)+_0x424009);const _0x439a56=await withSpinner(_0x34e7a2(0x133)+_0x263151+_0x34e7a2(0x173),()=>_0x189631['segment'][_0x34e7a2(0x17d)](_0x424009),{'verbose':_0x344a58[_0x34e7a2(0x19f)]}),_0x5819e6=_0x439a56['data'];_0x344a58['verbose']&&(console['error'](_0x34e7a2(0x16a)+_0x5819e6[_0x34e7a2(0x14e)]),console[_0x34e7a2(0x186)]('Parent\x20ID:\x20'+_0x5819e6[_0x34e7a2(0x1b3)]));if(_0x5819e6[_0x34e7a2(0x14e)]==='folder')return console['error'](_0x34e7a2(0x178)),console[_0x34e7a2(0x186)](_0x34e7a2(0x1a7)),0x1;if(_0x5819e6[_0x34e7a2(0x14e)]===_0x34e7a2(0x1a6))return console['error'](_0x34e7a2(0x14d)),console[_0x34e7a2(0x186)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x5819e6[_0x34e7a2(0x17c)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x34e7a2(0x1a4));const _0x21adf6=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x189631['segment']['getSegmentSQL'](_0x5819e6['parentId'],_0x5819e6[_0x34e7a2(0x17c)]),{'verbose':_0x344a58[_0x34e7a2(0x19f)]}),_0x452dc4=_0x21adf6[_0x34e7a2(0x1c1)];return _0x344a58[_0x34e7a2(0x188)]===_0x34e7a2(0x160)||_0x344a58[_0x34e7a2(0x188)]==='jsonl'?await handleSDKOutput([{'sql':_0x452dc4}],_0x344a58):console[_0x34e7a2(0x159)](_0x452dc4),0x0;}catch(_0x713b56){if(_0x713b56 instanceof SDKError)return console['error']('Error:\x20'+_0x713b56['message']),_0x713b56[_0x34e7a2(0x179)]&&console[_0x34e7a2(0x186)](_0x34e7a2(0x181)+_0x713b56[_0x34e7a2(0x179)]),0x1;throw _0x713b56;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a27_0x3bfcdd(0x13a)]=a27_0x3bfcdd(0x1c2);[a27_0x3bfcdd(0x187)]='Create\x20segment\x20folder\x20for\x20organization';async['execute'](_0x464bfd){const _0x97d60f=a27_0x3bfcdd,{options:_0x314f2c,args:_0x372787,tdx:_0x109fcd}=_0x464bfd,_0x2702ad=_0x314f2c;if(_0x372787['length']<0x2)return console[_0x97d60f(0x186)](_0x97d60f(0x197)),console['error'](_0x97d60f(0x161)),0x1;const _0x315c39=_0x372787[0x0],_0x3a6d33=_0x372787[0x1];_0x2702ad[_0x97d60f(0x19f)]&&(console[_0x97d60f(0x186)](_0x97d60f(0x149)+_0x2702ad[_0x97d60f(0x15f)]),console[_0x97d60f(0x186)](_0x97d60f(0x15c)+_0x315c39),console[_0x97d60f(0x186)](_0x97d60f(0x164)+_0x3a6d33));let _0x49eff5;if(_0x2702ad[_0x97d60f(0x190)]){const _0x34bb06=_0x2702ad[_0x97d60f(0x190)],_0x24df12=await withSpinner(_0x97d60f(0x19a)+_0x315c39+'\x27...',()=>_0x109fcd[_0x97d60f(0x19e)][_0x97d60f(0x182)](_0x315c39),{'verbose':_0x2702ad[_0x97d60f(0x19f)]}),_0x4225c=_0x24df12[_0x97d60f(0x1c1)],_0x5ca389=await withSpinner(_0x97d60f(0x1b4)+_0x34bb06+_0x97d60f(0x173),()=>_0x109fcd[_0x97d60f(0x19e)][_0x97d60f(0x154)](_0x4225c,_0x34bb06),{'verbose':_0x2702ad['verbose']});_0x49eff5=_0x5ca389[_0x97d60f(0x1c1)],_0x2702ad['verbose']&&console[_0x97d60f(0x186)](_0x97d60f(0x1a3)+_0x49eff5);}const _0x53f796={'name':_0x3a6d33,'description':_0x2702ad[_0x97d60f(0x187)],'parentFolderId':_0x49eff5},_0x2fd66b=await withSpinner(_0x97d60f(0x150)+_0x3a6d33+_0x97d60f(0x173),()=>_0x109fcd[_0x97d60f(0x19e)]['createFolder'](_0x315c39,_0x53f796),{'verbose':_0x2702ad['verbose']}),_0x2f213d=_0x2fd66b[_0x97d60f(0x1c1)];return console[_0x97d60f(0x186)](_0x97d60f(0x12d)+_0x2f213d[_0x97d60f(0x13a)]+_0x97d60f(0x194)+_0x2f213d['id']),await handleSDKOutput([_0x2f213d],_0x2702ad),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x3bfcdd(0x13a)]='segment:view';[a27_0x3bfcdd(0x187)]=a27_0x3bfcdd(0x12f);async[a27_0x3bfcdd(0x17a)](_0x53dab8){const _0x17ed56=a27_0x3bfcdd,{options:_0x2b1023,args:_0x23536c,tdx:_0x513302}=_0x53dab8,_0x138881=_0x23536c[0x0];if(!_0x138881)return console[_0x17ed56(0x186)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x17ed56(0x186)](_0x17ed56(0x1b1)),console[_0x17ed56(0x186)](_0x17ed56(0x15d)),console[_0x17ed56(0x186)](_0x17ed56(0x13e)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x17ed56(0x186)](_0x17ed56(0x157)),console[_0x17ed56(0x186)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x17ed56(0x186)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x17ed56(0x186)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x17ed56(0x186)](_0x17ed56(0x167)),0x1;try{const _0x22da26=_0x2b1023[_0x17ed56(0x144)],_0x44c730=await resolveSegmentTarget(_0x138881,_0x22da26,_0x2b1023[_0x17ed56(0x19f)]);_0x2b1023[_0x17ed56(0x19f)]&&console[_0x17ed56(0x186)](_0x17ed56(0x199)+_0x44c730);const _0x4bb964=await withSpinner('Resolving\x20\x27'+_0x138881+_0x17ed56(0x173),()=>_0x513302[_0x17ed56(0x19e)][_0x17ed56(0x17d)](_0x44c730),{'verbose':_0x2b1023['verbose']}),_0x659521=_0x4bb964[_0x17ed56(0x1c1)];_0x2b1023[_0x17ed56(0x19f)]&&(console['error'](_0x17ed56(0x16a)+_0x659521['type']),console[_0x17ed56(0x186)]('Parent\x20ID:\x20'+_0x659521[_0x17ed56(0x1b3)]),_0x659521[_0x17ed56(0x1a8)]&&console[_0x17ed56(0x186)](_0x17ed56(0x177)+_0x659521[_0x17ed56(0x1a8)]),_0x659521[_0x17ed56(0x17c)]&&console[_0x17ed56(0x186)](_0x17ed56(0x130)+_0x659521['segmentId']));if(_0x2b1023['web']){if(_0x659521[_0x17ed56(0x14e)]===_0x17ed56(0x162))return console[_0x17ed56(0x186)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x659521[_0x17ed56(0x14e)]==='parent')return console[_0x17ed56(0x186)](_0x17ed56(0x1a0)),console[_0x17ed56(0x186)](_0x17ed56(0x175)),0x1;if(!_0x659521['segmentId'])throw new SDKError(ErrorCode[_0x17ed56(0x1be)],_0x17ed56(0x1a4));const _0x215bd3=getConsoleNextUrl(_0x2b1023['site'],_0x17ed56(0x1bf)+_0x659521[_0x17ed56(0x1b3)]+'/e/'+_0x659521['segmentId']);return console[_0x17ed56(0x186)](a27_0x44905d[_0x17ed56(0x18f)]('βœ”')+_0x17ed56(0x140)+a27_0x44905d[_0x17ed56(0x16d)](_0x215bd3)),openBrowser(_0x215bd3),0x0;}if(_0x659521['type']===_0x17ed56(0x162)){if(!_0x659521[_0x17ed56(0x1a8)])throw new SDKError(ErrorCode[_0x17ed56(0x1bb)],_0x17ed56(0x141));const _0x87087d=await withSpinner('Fetching\x20folder\x20details...',()=>_0x513302[_0x17ed56(0x19e)][_0x17ed56(0x18d)](_0x659521[_0x17ed56(0x1a8)]),{'verbose':_0x2b1023[_0x17ed56(0x19f)]});await handleSingleObjectOutput(_0x87087d['data'],_0x2b1023);}else{if(_0x659521[_0x17ed56(0x14e)]===_0x17ed56(0x19e)){if(!_0x659521[_0x17ed56(0x17c)])throw new SDKError(ErrorCode[_0x17ed56(0x1be)],_0x17ed56(0x1a4));const _0x53ee91=await withSpinner(_0x17ed56(0x180),()=>_0x513302[_0x17ed56(0x19e)][_0x17ed56(0x12e)](_0x659521[_0x17ed56(0x1b3)],_0x659521[_0x17ed56(0x17c)]),{'verbose':_0x2b1023[_0x17ed56(0x19f)]}),_0x44c159=getConsoleNextUrl(_0x2b1023[_0x17ed56(0x15f)],_0x17ed56(0x1bf)+_0x659521[_0x17ed56(0x1b3)]+_0x17ed56(0x184)+_0x659521[_0x17ed56(0x17c)]),_0x3027f9=_0x53ee91[_0x17ed56(0x1c1)];_0x3027f9[_0x17ed56(0x142)]=_0x44c159,await handleSingleObjectOutput(_0x3027f9,_0x2b1023);}else return console['error'](_0x17ed56(0x158)),console['error']('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x14ae4c){if(_0x14ae4c instanceof SDKError)return console[_0x17ed56(0x186)]('Error:\x20'+_0x14ae4c['message']),_0x14ae4c['cause']&&console['error'](_0x17ed56(0x181)+_0x14ae4c[_0x17ed56(0x179)]),0x1;throw _0x14ae4c;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x3bfcdd(0x13a)]=a27_0x3bfcdd(0x189);['description']='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a27_0x3bfcdd(0x17a)](_0x4b1803){const _0x4563f1=a27_0x3bfcdd,{options:_0xb31746,args:_0x1e66e2,tdx:_0x36c7f1}=_0x4b1803,_0x213090=_0x1e66e2[0x0];if(!_0x213090)return console[_0x4563f1(0x186)](_0x4563f1(0x131)),console[_0x4563f1(0x186)](_0x4563f1(0x152)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x4563f1(0x186)]('Examples:'),console[_0x4563f1(0x186)](_0x4563f1(0x163)),console[_0x4563f1(0x186)](_0x4563f1(0x19b)),0x1;try{const _0x422cdd=_0xb31746[_0x4563f1(0x144)],_0x226481=await resolveSegmentTarget(_0x213090,_0x422cdd,_0xb31746[_0x4563f1(0x19f)]);_0xb31746['verbose']&&console[_0x4563f1(0x186)](_0x4563f1(0x199)+_0x226481);const _0x192020=await withSpinner(_0x4563f1(0x133)+_0x213090+_0x4563f1(0x173),()=>_0x36c7f1[_0x4563f1(0x19e)][_0x4563f1(0x17d)](_0x226481),{'verbose':_0xb31746[_0x4563f1(0x19f)]}),_0x5d3320=_0x192020[_0x4563f1(0x1c1)];_0xb31746[_0x4563f1(0x19f)]&&(console['error']('Resolved\x20type:\x20'+_0x5d3320[_0x4563f1(0x14e)]),console[_0x4563f1(0x186)](_0x4563f1(0x17f)+_0x5d3320[_0x4563f1(0x1b3)]));if(_0x5d3320[_0x4563f1(0x14e)]===_0x4563f1(0x162))return console[_0x4563f1(0x186)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x4563f1(0x186)](_0x4563f1(0x1a7)),0x1;if(_0x5d3320['type']==='parent')return console[_0x4563f1(0x186)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4563f1(0x186)](_0x4563f1(0x172)),0x1;if(!_0x5d3320[_0x4563f1(0x17c)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4563f1(0x1a4));const _0x19d1de=await withSpinner(_0x4563f1(0x153),()=>_0x36c7f1[_0x4563f1(0x19e)][_0x4563f1(0x14f)](_0x5d3320['parentId'],_0x5d3320[_0x4563f1(0x17c)]),{'verbose':_0xb31746[_0x4563f1(0x19f)]}),_0x9fd2cc=_0x19d1de[_0x4563f1(0x1c1)],_0x55ab39=await executeSchemaQuery(_0x9fd2cc,_0x36c7f1,_0xb31746);return await handleQueryOutput(_0x55ab39,_0xb31746),0x0;}catch(_0x92b3d1){if(_0x92b3d1 instanceof SDKError)return console[_0x4563f1(0x186)](_0x4563f1(0x195)+_0x92b3d1['message']),_0x92b3d1[_0x4563f1(0x179)]&&console['error'](_0x4563f1(0x181)+_0x92b3d1[_0x4563f1(0x179)]),0x1;throw _0x92b3d1;}}}
1
+ const a27_0x40aef0=a27_0x1fb5;(function(_0x476ef6,_0x4eb012){const _0x279c80=a27_0x1fb5,_0x2c1e74=_0x476ef6();while(!![]){try{const _0x226b2b=-parseInt(_0x279c80(0x182))/0x1*(parseInt(_0x279c80(0x164))/0x2)+-parseInt(_0x279c80(0x1a8))/0x3*(parseInt(_0x279c80(0x163))/0x4)+parseInt(_0x279c80(0x17e))/0x5*(-parseInt(_0x279c80(0x14d))/0x6)+parseInt(_0x279c80(0x167))/0x7*(parseInt(_0x279c80(0x188))/0x8)+parseInt(_0x279c80(0x13a))/0x9*(parseInt(_0x279c80(0x16e))/0xa)+-parseInt(_0x279c80(0x174))/0xb*(-parseInt(_0x279c80(0x17b))/0xc)+-parseInt(_0x279c80(0x1b6))/0xd*(-parseInt(_0x279c80(0x137))/0xe);if(_0x226b2b===_0x4eb012)break;else _0x2c1e74['push'](_0x2c1e74['shift']());}catch(_0x213510){_0x2c1e74['push'](_0x2c1e74['shift']());}}}(a27_0x934a,0xde5da));function a27_0x1fb5(_0x144b92,_0x519dd5){_0x144b92=_0x144b92-0x130;const _0x934a29=a27_0x934a();let _0x1fb532=_0x934a29[_0x144b92];return _0x1fb532;}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_0x4b55f6 from'chalk';async function resolveSegmentTarget(_0x58e849,_0x6eaf26,_0x2cfa4b){const _0x5cb659=a27_0x1fb5;if(isYamlFilePath(_0x58e849))try{const _0x1ab7f4=await resolveYamlFilePath(_0x58e849);return _0x2cfa4b&&(console[_0x5cb659(0x1ad)](_0x5cb659(0x196)+_0x58e849),console[_0x5cb659(0x1ad)](_0x5cb659(0x162)+_0x1ab7f4[_0x5cb659(0x193)]),console['error'](_0x5cb659(0x1c0)+_0x1ab7f4['segmentName']),console[_0x5cb659(0x1ad)](_0x5cb659(0x1ba)+(_0x1ab7f4[_0x5cb659(0x141)]||'(root)')),console[_0x5cb659(0x1ad)](_0x5cb659(0x1bb)+_0x1ab7f4[_0x5cb659(0x1b7)])),_0x1ab7f4[_0x5cb659(0x1b7)];}catch(_0x279b51){throw new SDKError(ErrorCode[_0x5cb659(0x14f)],_0x5cb659(0x1c5)+_0x279b51[_0x5cb659(0x15b)]);}if(!_0x6eaf26)throw new SDKError(ErrorCode[_0x5cb659(0x14f)],_0x5cb659(0x185));return _0x6eaf26+'/'+_0x58e849;}function a27_0x934a(){const _0x1a6b0e=['query','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','url','web','Site:\x20','\x27\x20with\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','Use:\x20tdx\x20ps\x20view\x20-w','getFolder','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Show\x20child\x20segment\x20schema\x20(column\x20types)','Fetching\x20segment\x20details...','Resolved\x20type:\x20','10654WAuFaH','test','Resolving\x20\x27','36shNige','getSegment','Show\x20segment\x20or\x20folder\x20details','elapsedTimeMillis','information_schema','Resolving\x20parent\x20segment\x20\x27','segment:folder:list','folderPath','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','cause','SEGMENT_FOLDER_NOT_FOUND','length','code','Parent\x20name:\x20','segment:desc','Error:\x20Path\x20or\x20name\x20is\x20required','replace','Parent\x20ID:\x20','Executing\x20segment\x20query...','10318452mQIXXd','toLocaleString','INVALID_ARGUMENT','description','parentId','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','segment:folder:create','\x20\x20Cause:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','listFolders','createFolder','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','SEGMENT_NOT_FOUND','message','Usage:\x20tdx\x20segment\x20describe\x20<path>','Examples:','/e/','processedRows','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20SQL\x20for\x20segment...','\x20\x20Parent\x20segment:\x20','4CZBJxc','2XQwuYc','verbose','Folder\x20ID:\x20','7PaflgZ','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Resolved\x20folder\x20ID:\x20','Use:\x20tdx\x20ps\x20show','Listing\x20folders\x20for\x20parent\x20\x27','Resolved\x20parent\x20folder\x20ID:\x20','segment:describe','574390qRowax','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','parent','1309iknffQ','Segment\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','jobId','folderId','in\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','173916RTZqoC','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','5ppnajz','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','369689HRIdPw','getParent','segmentId','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Resolving\x20folder\x20\x27','segment:show','9912424woYJAG','segment','name','site','\x20rows\x20','trim','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','resolveFolderId','limit','Use:\x20tdx\x20ps\x20desc','resolveParentId','parentSegment','\x27...','Resolving\x20parent\x20folder\x20\x27','Resolved\x20YAML\x20file:\x20','Resolved\x20parent\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Show\x20folder\x20or\x20child\x20segment\x20details','Resolving\x20path\x20\x27','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','resolvePathToResource','stats','Target\x20path:\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','Creating\x20folder\x20\x27','βœ”\x20Created\x20folder\x20\x27','parentFolder','folder','includes','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','3401493AarPRb','Fetching\x20folder\x20details...','SQL\x20query:\x0a','/app/ps/','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','error','segmentPath','Error:\x20Folder\x20reference\x20is\x20required','execute','jsonl','Parent\x20segment:\x20','format','\x20Opening\x20','type','16068cQfNgM','fullPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','data','\x20\x20Folder\x20path:\x20','\x20\x20Full\x20path:\x20','Fetching\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20show\x20<name>','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Create\x20segment\x20folder\x20for\x20organization','\x20\x20Segment\x20name:\x20','getSegmentSQL','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20'];a27_0x934a=function(){return _0x1a6b0e;};return a27_0x934a();}export class SegmentDescribeCommand extends BaseCommand{[a27_0x40aef0(0x18a)]=a27_0x40aef0(0x16d);[a27_0x40aef0(0x150)]=a27_0x40aef0(0x13c);async[a27_0x40aef0(0x1b0)](_0x421cc5){const _0x33bf4b=a27_0x40aef0,{options:_0xc54bb6,args:_0x18fb70,tdx:_0x318575}=_0x421cc5,_0x1c35b5=_0x18fb70[0x0],_0x5c395a=!_0x1c35b5&&!!_0xc54bb6[_0x33bf4b(0x193)],_0x2c318a=_0x1c35b5||_0xc54bb6['parentSegment'];if(!_0x2c318a)return console[_0x33bf4b(0x1ad)](_0x33bf4b(0x149)),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x15c)),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x15d)),console[_0x33bf4b(0x1ad)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22'),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x1ca)),console['error'](_0x33bf4b(0x1c2)),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x17c)),0x1;try{const _0x48d9cc=_0xc54bb6[_0x33bf4b(0x1ae)];let _0x484972=_0x2c318a;!_0x5c395a&&_0x48d9cc&&!_0x2c318a[_0x33bf4b(0x1a6)]('/')&&(_0x484972=_0x48d9cc+'/'+_0x2c318a,_0xc54bb6['verbose']&&console[_0x33bf4b(0x1ad)](_0x33bf4b(0x17f)+_0x484972));const _0xee793a=await withSpinner(_0x33bf4b(0x19c)+_0x484972+_0x33bf4b(0x194),()=>_0x318575[_0x33bf4b(0x189)][_0x33bf4b(0x19e)](_0x484972),{'verbose':_0xc54bb6[_0x33bf4b(0x165)]}),_0x526424=_0xee793a['data'];_0xc54bb6[_0x33bf4b(0x165)]&&(console['error']('Resolved\x20type:\x20'+_0x526424[_0x33bf4b(0x1b5)]),console[_0x33bf4b(0x1ad)](_0x33bf4b(0x14b)+_0x526424['parentId']),_0x526424['folderId']&&console[_0x33bf4b(0x1ad)](_0x33bf4b(0x166)+_0x526424[_0x33bf4b(0x178)]),_0x526424[_0x33bf4b(0x184)]&&console[_0x33bf4b(0x1ad)](_0x33bf4b(0x171)+_0x526424[_0x33bf4b(0x184)]));if(_0x526424['type']===_0x33bf4b(0x173)){const _0x224b75=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x318575[_0x33bf4b(0x189)][_0x33bf4b(0x183)](_0x526424[_0x33bf4b(0x151)]),{'verbose':_0xc54bb6[_0x33bf4b(0x165)]});await handleSingleObjectOutput(_0x224b75[_0x33bf4b(0x1b9)],_0xc54bb6);}else{if(_0x526424[_0x33bf4b(0x1b5)]===_0x33bf4b(0x1a5)){if(!_0x526424[_0x33bf4b(0x178)])throw new SDKError(ErrorCode[_0x33bf4b(0x144)],_0x33bf4b(0x170));const _0x5e56e5=await withSpinner(_0x33bf4b(0x1a9),()=>_0x318575[_0x33bf4b(0x189)][_0x33bf4b(0x130)](_0x526424[_0x33bf4b(0x178)]),{'verbose':_0xc54bb6['verbose']});await handleSingleObjectOutput(_0x5e56e5[_0x33bf4b(0x1b9)],_0xc54bb6);}else{if(_0x526424['type']===_0x33bf4b(0x189)){if(!_0x526424[_0x33bf4b(0x184)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x33bf4b(0x175));const _0x375163=await withSpinner(_0x33bf4b(0x135),()=>_0x318575[_0x33bf4b(0x189)][_0x33bf4b(0x13b)](_0x526424['parentId'],_0x526424[_0x33bf4b(0x184)]),{'verbose':_0xc54bb6[_0x33bf4b(0x165)]});await handleSingleObjectOutput(_0x375163[_0x33bf4b(0x1b9)],_0xc54bb6);}}}return 0x0;}catch(_0x5d8161){if(_0x5d8161 instanceof SDKError)return console[_0x33bf4b(0x1ad)](_0x33bf4b(0x1c3)+_0x5d8161[_0x33bf4b(0x15b)]),_0x5d8161[_0x33bf4b(0x143)]&&console[_0x33bf4b(0x1ad)]('\x20\x20Cause:\x20'+_0x5d8161[_0x33bf4b(0x143)]),0x1;throw _0x5d8161;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x40aef0(0x18a)]=a27_0x40aef0(0x187);[a27_0x40aef0(0x150)]=a27_0x40aef0(0x159);async['execute'](_0x55c496){const _0x150537=a27_0x40aef0,{options:_0xb8aefe,args:_0x313255,tdx:_0x5757ae}=_0x55c496,_0x45c4c0=_0x313255[0x0];if(!_0x45c4c0)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x150537(0x1ad)](_0x150537(0x1bd)),console[_0x150537(0x1ad)](_0x150537(0x1b8)),console[_0x150537(0x1ad)](_0x150537(0x15d)),console[_0x150537(0x1ad)](_0x150537(0x199)),console[_0x150537(0x1ad)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x4a936d=_0xb8aefe[_0x150537(0x193)],_0x5c6360=await resolveSegmentTarget(_0x45c4c0,_0x4a936d,_0xb8aefe[_0x150537(0x165)]);_0xb8aefe[_0x150537(0x165)]&&console[_0x150537(0x1ad)](_0x150537(0x1a0)+_0x5c6360);const _0x4ab9e0=await withSpinner('Resolving\x20\x27'+_0x45c4c0+_0x150537(0x194),()=>_0x5757ae[_0x150537(0x189)][_0x150537(0x19e)](_0x5c6360),{'verbose':_0xb8aefe[_0x150537(0x165)]}),_0x340fe5=_0x4ab9e0[_0x150537(0x1b9)];_0xb8aefe[_0x150537(0x165)]&&(console[_0x150537(0x1ad)](_0x150537(0x136)+_0x340fe5[_0x150537(0x1b5)]),console['error'](_0x150537(0x14b)+_0x340fe5[_0x150537(0x151)]));if(_0x340fe5[_0x150537(0x1b5)]===_0x150537(0x1a5))return console[_0x150537(0x1ad)](_0x150537(0x1be)),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x340fe5[_0x150537(0x1b5)]===_0x150537(0x173))return console[_0x150537(0x1ad)](_0x150537(0x17d)),console[_0x150537(0x1ad)](_0x150537(0x16a)),0x1;if(!_0x340fe5['segmentId'])throw new SDKError(ErrorCode[_0x150537(0x15a)],_0x150537(0x175));const _0x39e18c=await withSpinner(_0x150537(0x161),()=>_0x5757ae[_0x150537(0x189)]['getSegmentSQL'](_0x340fe5[_0x150537(0x151)],_0x340fe5['segmentId']),{'verbose':_0xb8aefe[_0x150537(0x165)]});let _0x277e00=_0x39e18c['data'];const _0x4f0137=resolveLimit(_0xb8aefe[_0x150537(0x190)],DEFAULT_DISPLAY_LIMIT),_0x2a8d6e=/\bLIMIT\s+\d+/i[_0x150537(0x138)](_0x277e00);!_0x2a8d6e&&(_0x277e00=_0x277e00[_0x150537(0x18d)]()[_0x150537(0x14a)](/;+$/,''),_0x277e00=_0x150537(0x198)+_0x277e00+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x4f0137);_0xb8aefe[_0x150537(0x165)]&&console['error'](_0x150537(0x1aa)+_0x277e00);const _0x381ff2=await withProgressSpinner(_0x150537(0x14c),async _0x4f004b=>{const _0x2b56fe=_0x150537,_0x5f10bb=await _0x5757ae[_0x2b56fe(0x1c4)][_0x2b56fe(0x1b0)](_0x277e00,{'catalog':'td','schema':_0x2b56fe(0x13e),'onJobId':_0x5beb74=>{_0x4f004b['setJobId'](_0x5beb74);}});return _0x5f10bb;},{'verbose':_0xb8aefe['verbose']}),_0x70a1ff=_0x381ff2['data'],_0x507c9b=_0x70a1ff[_0x150537(0x177)]?'\x20[Job\x20ID:\x20'+_0x70a1ff[_0x150537(0x177)]+']':'';return console[_0x150537(0x1ad)]('βœ”\x20Query\x20completed:\x20Processed\x20'+_0x70a1ff['stats'][_0x150537(0x15f)][_0x150537(0x14e)]()+_0x150537(0x18c)+(_0x150537(0x179)+formatElapsed(_0x70a1ff[_0x150537(0x19f)][_0x150537(0x13d)])+_0x507c9b)),await handleQueryOutput(_0x70a1ff,_0xb8aefe),0x0;}catch(_0x149ea4){if(_0x149ea4 instanceof SDKError)return console[_0x150537(0x1ad)]('βœ–\x20Query\x20failed\x20['+_0x149ea4[_0x150537(0x146)]+']'),console['error']('\x0a'+_0x149ea4[_0x150537(0x15b)]),0x1;throw _0x149ea4;}}}export class SegmentFolderListCommand extends BaseCommand{[a27_0x40aef0(0x18a)]=a27_0x40aef0(0x140);[a27_0x40aef0(0x150)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a27_0x40aef0(0x1b0)](_0x2b1a19){const _0x530c7c=a27_0x40aef0,{options:_0x39876d,args:_0x3c7211,tdx:_0x51fcb4}=_0x2b1a19;if(_0x3c7211[_0x530c7c(0x145)]===0x0)return console['error'](_0x530c7c(0x160)),console[_0x530c7c(0x1ad)](_0x530c7c(0x180)),0x1;const _0x2231cf=_0x3c7211[0x0];try{_0x39876d[_0x530c7c(0x165)]&&(console[_0x530c7c(0x1ad)](_0x530c7c(0x1c8)+_0x39876d[_0x530c7c(0x18b)]),console[_0x530c7c(0x1ad)]('Parent\x20name:\x20'+_0x2231cf));const _0xe23efa=await withSpinner(_0x530c7c(0x13f)+_0x2231cf+_0x530c7c(0x194),()=>_0x51fcb4[_0x530c7c(0x189)][_0x530c7c(0x192)](_0x2231cf),{'verbose':_0x39876d[_0x530c7c(0x165)]}),_0x3c351c=_0xe23efa[_0x530c7c(0x1b9)];_0x39876d[_0x530c7c(0x165)]&&console['error'](_0x530c7c(0x197)+_0x3c351c);const _0x2ad7e4=await withSpinner(_0x530c7c(0x16b)+_0x2231cf+_0x530c7c(0x194),()=>_0x51fcb4[_0x530c7c(0x189)][_0x530c7c(0x156)](_0x3c351c),{'verbose':_0x39876d[_0x530c7c(0x165)]}),_0x56a57e=_0x2ad7e4[_0x530c7c(0x1b9)];return console[_0x530c7c(0x1ad)]('βœ”\x20Found\x20'+_0x56a57e[_0x530c7c(0x145)]+'\x20folder'+(_0x56a57e['length']!==0x1?'s':'')),await handleSDKOutput(_0x56a57e,_0x39876d),0x0;}catch(_0x34a495){if(_0x34a495 instanceof SDKError)return console[_0x530c7c(0x1ad)]('Error:\x20'+_0x34a495[_0x530c7c(0x15b)]),_0x34a495[_0x530c7c(0x143)]&&console[_0x530c7c(0x1ad)](_0x530c7c(0x154)+_0x34a495[_0x530c7c(0x143)]),0x1;throw _0x34a495;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a27_0x40aef0(0x150)]='Show\x20segment\x20folder\x20details';async['execute'](_0x55639e){const _0x495ac1=a27_0x40aef0,{options:_0x86b1ee,args:_0x3c0f1d,tdx:_0x169035}=_0x55639e;if(_0x3c0f1d[_0x495ac1(0x145)]===0x0)return console[_0x495ac1(0x1ad)](_0x495ac1(0x1af)),console[_0x495ac1(0x1ad)](_0x495ac1(0x19a)),0x1;try{const {parentId:_0x312b4d,childId:_0x3bae26}=parseSegmentRef(_0x3c0f1d[0x0]);_0x86b1ee[_0x495ac1(0x165)]&&(console[_0x495ac1(0x1ad)]('Site:\x20'+_0x86b1ee[_0x495ac1(0x18b)]),console[_0x495ac1(0x1ad)](_0x495ac1(0x147)+_0x312b4d),_0x3bae26&&console[_0x495ac1(0x1ad)]('Folder\x20name:\x20'+_0x3bae26));if(!_0x3bae26)return console[_0x495ac1(0x1ad)](_0x495ac1(0x131)),0x1;const _0x35e5cc=await withSpinner(_0x495ac1(0x13f)+_0x312b4d+_0x495ac1(0x194),()=>_0x169035[_0x495ac1(0x189)][_0x495ac1(0x192)](_0x312b4d),{'verbose':_0x86b1ee[_0x495ac1(0x165)]}),_0x303756=_0x35e5cc[_0x495ac1(0x1b9)];_0x86b1ee[_0x495ac1(0x165)]&&console[_0x495ac1(0x1ad)](_0x495ac1(0x197)+_0x303756);const _0x3d170e=await withSpinner(_0x495ac1(0x186)+_0x3bae26+_0x495ac1(0x194),()=>_0x169035[_0x495ac1(0x189)][_0x495ac1(0x18f)](_0x303756,_0x3bae26),{'verbose':_0x86b1ee[_0x495ac1(0x165)]}),_0x3d0395=_0x3d170e['data'];_0x86b1ee[_0x495ac1(0x165)]&&console[_0x495ac1(0x1ad)](_0x495ac1(0x169)+_0x3d0395);const _0x422be9=await withSpinner(_0x495ac1(0x1bc)+_0x3bae26+_0x495ac1(0x194),()=>_0x169035[_0x495ac1(0x189)][_0x495ac1(0x130)](_0x3d0395),{'verbose':_0x86b1ee[_0x495ac1(0x165)]});return await handleSDKOutput([_0x422be9[_0x495ac1(0x1b9)]],_0x86b1ee),0x0;}catch(_0x52bb82){if(_0x52bb82 instanceof SDKError)return console[_0x495ac1(0x1ad)](_0x495ac1(0x1c3)+_0x52bb82[_0x495ac1(0x15b)]),_0x52bb82['cause']&&console[_0x495ac1(0x1ad)](_0x495ac1(0x154)+_0x52bb82['cause']),0x1;throw _0x52bb82;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x40aef0(0x18a)]='segment:sql';[a27_0x40aef0(0x150)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x40aef0(0x1b0)](_0x36708a){const _0x36fe0b=a27_0x40aef0,{options:_0x32b4b1,args:_0x3642f5,tdx:_0x14f93b}=_0x36708a,_0x301c33=_0x3642f5[0x0];if(!_0x301c33)return console[_0x36fe0b(0x1ad)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x36fe0b(0x1a1)),console['error'](_0x36fe0b(0x176)),console['error'](_0x36fe0b(0x15d)),console['error'](_0x36fe0b(0x172)),console[_0x36fe0b(0x1ad)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x34f0bf=_0x32b4b1[_0x36fe0b(0x193)],_0x30139e=await resolveSegmentTarget(_0x301c33,_0x34f0bf,_0x32b4b1[_0x36fe0b(0x165)]);_0x32b4b1[_0x36fe0b(0x165)]&&console[_0x36fe0b(0x1ad)](_0x36fe0b(0x1a0)+_0x30139e);const _0x3896bb=await withSpinner(_0x36fe0b(0x139)+_0x301c33+_0x36fe0b(0x194),()=>_0x14f93b['segment'][_0x36fe0b(0x19e)](_0x30139e),{'verbose':_0x32b4b1[_0x36fe0b(0x165)]}),_0x180e7f=_0x3896bb['data'];_0x32b4b1[_0x36fe0b(0x165)]&&(console[_0x36fe0b(0x1ad)](_0x36fe0b(0x136)+_0x180e7f['type']),console[_0x36fe0b(0x1ad)](_0x36fe0b(0x14b)+_0x180e7f[_0x36fe0b(0x151)]));if(_0x180e7f[_0x36fe0b(0x1b5)]===_0x36fe0b(0x1a5))return console['error'](_0x36fe0b(0x1ac)),console[_0x36fe0b(0x1ad)](_0x36fe0b(0x158)),0x1;if(_0x180e7f[_0x36fe0b(0x1b5)]===_0x36fe0b(0x173))return console[_0x36fe0b(0x1ad)](_0x36fe0b(0x1a7)),console[_0x36fe0b(0x1ad)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x180e7f[_0x36fe0b(0x184)])throw new SDKError(ErrorCode[_0x36fe0b(0x15a)],_0x36fe0b(0x175));const _0x19c5d3=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x14f93b['segment'][_0x36fe0b(0x1c1)](_0x180e7f[_0x36fe0b(0x151)],_0x180e7f[_0x36fe0b(0x184)]),{'verbose':_0x32b4b1[_0x36fe0b(0x165)]}),_0x3becc0=_0x19c5d3[_0x36fe0b(0x1b9)];return _0x32b4b1[_0x36fe0b(0x1b3)]==='json'||_0x32b4b1[_0x36fe0b(0x1b3)]===_0x36fe0b(0x1b1)?await handleSDKOutput([{'sql':_0x3becc0}],_0x32b4b1):console['log'](_0x3becc0),0x0;}catch(_0x478081){if(_0x478081 instanceof SDKError)return console[_0x36fe0b(0x1ad)](_0x36fe0b(0x1c3)+_0x478081['message']),_0x478081[_0x36fe0b(0x143)]&&console[_0x36fe0b(0x1ad)]('\x20\x20Cause:\x20'+_0x478081[_0x36fe0b(0x143)]),0x1;throw _0x478081;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a27_0x40aef0(0x153);[a27_0x40aef0(0x150)]=a27_0x40aef0(0x1bf);async['execute'](_0x342c15){const _0x3ce287=a27_0x40aef0,{options:_0x3c7f6c,args:_0x48f306,tdx:_0x1aad1a}=_0x342c15,_0x1f1f56=_0x3c7f6c;if(_0x48f306[_0x3ce287(0x145)]<0x2)return console[_0x3ce287(0x1ad)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x3ce287(0x1ad)]('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x26b1de=_0x48f306[0x0],_0x56a5d2=_0x48f306[0x1];_0x1f1f56['verbose']&&(console[_0x3ce287(0x1ad)](_0x3ce287(0x1c8)+_0x1f1f56[_0x3ce287(0x18b)]),console[_0x3ce287(0x1ad)](_0x3ce287(0x1b2)+_0x26b1de),console['error']('Folder\x20name:\x20'+_0x56a5d2));let _0x34c139;if(_0x1f1f56[_0x3ce287(0x1a4)]){const _0x62706b=_0x1f1f56['parentFolder'],_0x1ef2e1=await withSpinner(_0x3ce287(0x13f)+_0x26b1de+_0x3ce287(0x194),()=>_0x1aad1a[_0x3ce287(0x189)][_0x3ce287(0x192)](_0x26b1de),{'verbose':_0x1f1f56['verbose']}),_0x185c59=_0x1ef2e1[_0x3ce287(0x1b9)],_0x53bc0f=await withSpinner(_0x3ce287(0x195)+_0x62706b+'\x27...',()=>_0x1aad1a[_0x3ce287(0x189)][_0x3ce287(0x18f)](_0x185c59,_0x62706b),{'verbose':_0x1f1f56[_0x3ce287(0x165)]});_0x34c139=_0x53bc0f[_0x3ce287(0x1b9)],_0x1f1f56[_0x3ce287(0x165)]&&console[_0x3ce287(0x1ad)](_0x3ce287(0x16c)+_0x34c139);}const _0xdd7c6e={'name':_0x56a5d2,'description':_0x1f1f56[_0x3ce287(0x150)],'parentFolderId':_0x34c139},_0x4b964f=await withSpinner(_0x3ce287(0x1a2)+_0x56a5d2+_0x3ce287(0x194),()=>_0x1aad1a[_0x3ce287(0x189)][_0x3ce287(0x157)](_0x26b1de,_0xdd7c6e),{'verbose':_0x1f1f56[_0x3ce287(0x165)]}),_0x330807=_0x4b964f[_0x3ce287(0x1b9)];return console[_0x3ce287(0x1ad)](_0x3ce287(0x1a3)+_0x330807[_0x3ce287(0x18a)]+_0x3ce287(0x1c9)+_0x330807['id']),await handleSDKOutput([_0x330807],_0x1f1f56),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']='segment:view';[a27_0x40aef0(0x150)]=a27_0x40aef0(0x19b);async['execute'](_0x56852d){const _0x50863b=a27_0x40aef0,{options:_0xe19cc1,args:_0x38f9f7,tdx:_0x1b9a43}=_0x56852d,_0x346a5d=_0x38f9f7[0x0];if(!_0x346a5d)return console['error'](_0x50863b(0x132)),console[_0x50863b(0x1ad)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x50863b(0x1ad)](_0x50863b(0x155)),console['error']('Options:'),console[_0x50863b(0x1ad)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x50863b(0x1ad)]('Examples:'),console[_0x50863b(0x1ad)](_0x50863b(0x18e)),console['error'](_0x50863b(0x133)),console[_0x50863b(0x1ad)](_0x50863b(0x168)),console[_0x50863b(0x1ad)](_0x50863b(0x17a)),0x1;try{const _0x48a891=_0xe19cc1[_0x50863b(0x193)],_0x54ed30=await resolveSegmentTarget(_0x346a5d,_0x48a891,_0xe19cc1[_0x50863b(0x165)]);_0xe19cc1[_0x50863b(0x165)]&&console[_0x50863b(0x1ad)](_0x50863b(0x1a0)+_0x54ed30);const _0x20f02b=await withSpinner(_0x50863b(0x139)+_0x346a5d+_0x50863b(0x194),()=>_0x1b9a43[_0x50863b(0x189)][_0x50863b(0x19e)](_0x54ed30),{'verbose':_0xe19cc1[_0x50863b(0x165)]}),_0x374b10=_0x20f02b[_0x50863b(0x1b9)];_0xe19cc1['verbose']&&(console[_0x50863b(0x1ad)](_0x50863b(0x136)+_0x374b10['type']),console['error']('Parent\x20ID:\x20'+_0x374b10[_0x50863b(0x151)]),_0x374b10[_0x50863b(0x178)]&&console[_0x50863b(0x1ad)]('Folder\x20ID:\x20'+_0x374b10[_0x50863b(0x178)]),_0x374b10['segmentId']&&console[_0x50863b(0x1ad)](_0x50863b(0x171)+_0x374b10[_0x50863b(0x184)]));if(_0xe19cc1[_0x50863b(0x1c7)]){if(_0x374b10[_0x50863b(0x1b5)]===_0x50863b(0x1a5))return console[_0x50863b(0x1ad)](_0x50863b(0x16f)),0x1;if(_0x374b10[_0x50863b(0x1b5)]==='parent')return console[_0x50863b(0x1ad)](_0x50863b(0x181)),console[_0x50863b(0x1ad)](_0x50863b(0x1cc)),0x1;if(!_0x374b10[_0x50863b(0x184)])throw new SDKError(ErrorCode[_0x50863b(0x15a)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x19c9f3=getConsoleNextUrl(_0xe19cc1[_0x50863b(0x18b)],_0x50863b(0x1ab)+_0x374b10[_0x50863b(0x151)]+_0x50863b(0x15e)+_0x374b10[_0x50863b(0x184)]);return console[_0x50863b(0x1ad)](a27_0x4b55f6['green']('βœ”')+_0x50863b(0x1b4)+a27_0x4b55f6['cyan'](_0x19c9f3)),openBrowser(_0x19c9f3),0x0;}if(_0x374b10[_0x50863b(0x1b5)]===_0x50863b(0x1a5)){if(!_0x374b10[_0x50863b(0x178)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x50863b(0x170));const _0x40914f=await withSpinner(_0x50863b(0x1a9),()=>_0x1b9a43[_0x50863b(0x189)]['getFolder'](_0x374b10[_0x50863b(0x178)]),{'verbose':_0xe19cc1[_0x50863b(0x165)]});await handleSingleObjectOutput(_0x40914f[_0x50863b(0x1b9)],_0xe19cc1);}else{if(_0x374b10[_0x50863b(0x1b5)]===_0x50863b(0x189)){if(!_0x374b10[_0x50863b(0x184)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4da820=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1b9a43[_0x50863b(0x189)][_0x50863b(0x13b)](_0x374b10[_0x50863b(0x151)],_0x374b10[_0x50863b(0x184)]),{'verbose':_0xe19cc1['verbose']}),_0x2021b9=getConsoleNextUrl(_0xe19cc1[_0x50863b(0x18b)],_0x50863b(0x1ab)+_0x374b10[_0x50863b(0x151)]+_0x50863b(0x15e)+_0x374b10[_0x50863b(0x184)]),_0x582e49=_0x4da820[_0x50863b(0x1b9)];_0x582e49[_0x50863b(0x1c6)]=_0x2021b9,await handleSingleObjectOutput(_0x582e49,_0xe19cc1);}else return console[_0x50863b(0x1ad)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error']('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x49fbec){if(_0x49fbec instanceof SDKError)return console[_0x50863b(0x1ad)](_0x50863b(0x1c3)+_0x49fbec[_0x50863b(0x15b)]),_0x49fbec['cause']&&console[_0x50863b(0x1ad)](_0x50863b(0x154)+_0x49fbec['cause']),0x1;throw _0x49fbec;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a27_0x40aef0(0x18a)]=a27_0x40aef0(0x148);[a27_0x40aef0(0x150)]=a27_0x40aef0(0x134);async[a27_0x40aef0(0x1b0)](_0x1106e2){const _0x48dfad=a27_0x40aef0,{options:_0x60496f,args:_0x419340,tdx:_0x4f1d5f}=_0x1106e2,_0x121919=_0x419340[0x0];if(!_0x121919)return console[_0x48dfad(0x1ad)](_0x48dfad(0x19d)),console[_0x48dfad(0x1ad)](_0x48dfad(0x1cb)),console[_0x48dfad(0x1ad)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x48dfad(0x1ad)](_0x48dfad(0x15d)),console[_0x48dfad(0x1ad)](_0x48dfad(0x152)),console[_0x48dfad(0x1ad)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xb2fc53=_0x60496f[_0x48dfad(0x193)],_0x2b094b=await resolveSegmentTarget(_0x121919,_0xb2fc53,_0x60496f['verbose']);_0x60496f[_0x48dfad(0x165)]&&console[_0x48dfad(0x1ad)](_0x48dfad(0x1a0)+_0x2b094b);const _0x84eaca=await withSpinner(_0x48dfad(0x139)+_0x121919+'\x27...',()=>_0x4f1d5f[_0x48dfad(0x189)][_0x48dfad(0x19e)](_0x2b094b),{'verbose':_0x60496f['verbose']}),_0x2a8da3=_0x84eaca['data'];_0x60496f[_0x48dfad(0x165)]&&(console['error'](_0x48dfad(0x136)+_0x2a8da3[_0x48dfad(0x1b5)]),console[_0x48dfad(0x1ad)](_0x48dfad(0x14b)+_0x2a8da3[_0x48dfad(0x151)]));if(_0x2a8da3['type']===_0x48dfad(0x1a5))return console[_0x48dfad(0x1ad)](_0x48dfad(0x142)),console[_0x48dfad(0x1ad)](_0x48dfad(0x158)),0x1;if(_0x2a8da3[_0x48dfad(0x1b5)]===_0x48dfad(0x173))return console[_0x48dfad(0x1ad)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x48dfad(0x1ad)](_0x48dfad(0x191)),0x1;if(!_0x2a8da3['segmentId'])throw new SDKError(ErrorCode[_0x48dfad(0x15a)],_0x48dfad(0x175));const _0x444be0=await withSpinner(_0x48dfad(0x161),()=>_0x4f1d5f[_0x48dfad(0x189)]['getSegmentSQL'](_0x2a8da3[_0x48dfad(0x151)],_0x2a8da3[_0x48dfad(0x184)]),{'verbose':_0x60496f['verbose']}),_0x645861=_0x444be0[_0x48dfad(0x1b9)],_0x7ad97c=await executeSchemaQuery(_0x645861,_0x4f1d5f,_0x60496f);return await handleQueryOutput(_0x7ad97c,_0x60496f),0x0;}catch(_0x46a26e){if(_0x46a26e instanceof SDKError)return console[_0x48dfad(0x1ad)](_0x48dfad(0x1c3)+_0x46a26e['message']),_0x46a26e['cause']&&console['error']('\x20\x20Cause:\x20'+_0x46a26e['cause']),0x1;throw _0x46a26e;}}}
@@ -1 +1 @@
1
- const a28_0x5c33d6=a28_0x21af;(function(_0xe2a1ce,_0x10a397){const _0x1ea3dd=a28_0x21af,_0xefcace=_0xe2a1ce();while(!![]){try{const _0x5ad669=parseInt(_0x1ea3dd(0x156))/0x1+-parseInt(_0x1ea3dd(0x160))/0x2+-parseInt(_0x1ea3dd(0x178))/0x3+parseInt(_0x1ea3dd(0x168))/0x4+-parseInt(_0x1ea3dd(0x169))/0x5*(parseInt(_0x1ea3dd(0x17b))/0x6)+parseInt(_0x1ea3dd(0x162))/0x7*(parseInt(_0x1ea3dd(0x165))/0x8)+parseInt(_0x1ea3dd(0x15a))/0x9;if(_0x5ad669===_0x10a397)break;else _0xefcace['push'](_0xefcace['shift']());}catch(_0x5580e7){_0xefcace['push'](_0xefcace['shift']());}}}(a28_0x585f,0x37b61));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a28_0x21af(_0x51ce12,_0x2416cc){_0x51ce12=_0x51ce12-0x14a;const _0x585f97=a28_0x585f();let _0x21af78=_0x585f97[_0x51ce12];return _0x21af78;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x263b0c from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x5c33d6(0x17c)]='segment:create';[a28_0x5c33d6(0x15f)]=a28_0x5c33d6(0x14d);async[a28_0x5c33d6(0x170)](_0xa0306a){const _0x3a4a68=a28_0x5c33d6;console[_0x3a4a68(0x16b)](a28_0x263b0c[_0x3a4a68(0x164)](_0x3a4a68(0x159))),console[_0x3a4a68(0x16b)](a28_0x263b0c[_0x3a4a68(0x164)](_0x3a4a68(0x14e)));const {options:_0x1235a2,args:_0x5ddea2,tdx:_0x1059e7}=_0xa0306a,_0xb23c6a=_0x1235a2;if(_0x5ddea2[_0x3a4a68(0x179)]===0x0)return console[_0x3a4a68(0x16b)](_0x3a4a68(0x16f)),console[_0x3a4a68(0x16b)](_0x3a4a68(0x174)),console[_0x3a4a68(0x16b)](_0x3a4a68(0x175)),console[_0x3a4a68(0x16b)](_0x3a4a68(0x176)),console[_0x3a4a68(0x16b)](_0x3a4a68(0x153)),console[_0x3a4a68(0x16b)](_0x3a4a68(0x167)),0x1;const _0x5324e7=_0x5ddea2[0x0],_0x74e769=_0x1235a2[_0x3a4a68(0x154)];let _0x26c84c=_0x5324e7;_0x74e769&&!_0x5324e7[_0x3a4a68(0x150)]('/')&&(_0x26c84c=_0x74e769+'/'+_0x5324e7,_0xb23c6a[_0x3a4a68(0x155)]&&console['error'](_0x3a4a68(0x157)+_0x26c84c));const _0x3024ca=parsePath(_0x26c84c);if(_0x3024ca[_0x3a4a68(0x17e)]['length']<0x2)return console[_0x3a4a68(0x16b)](_0x3a4a68(0x177)),console[_0x3a4a68(0x16b)](_0x3a4a68(0x15d)),0x1;const _0x402bb8=_0x3024ca['segments'][0x0],_0x4d4d02=getBaseName(_0x26c84c),_0xb52e90=getParentPath(_0x26c84c);_0xb23c6a['verbose']&&(console[_0x3a4a68(0x16b)](_0x3a4a68(0x14a)+_0xb23c6a[_0x3a4a68(0x16c)]),console[_0x3a4a68(0x16b)](_0x3a4a68(0x172)+_0x26c84c),console['error']('Parent:\x20'+_0x402bb8),console['error'](_0x3a4a68(0x14f)+_0x4d4d02),console[_0x3a4a68(0x16b)](_0x3a4a68(0x16d)+_0xb52e90));const _0x4ed7b1=await withSpinner(_0x3a4a68(0x17d)+_0x402bb8+_0x3a4a68(0x15b),()=>_0x1059e7[_0x3a4a68(0x158)]['resolveParentId'](_0x402bb8),{'verbose':_0xb23c6a[_0x3a4a68(0x155)]}),_0x2dd00b=_0x4ed7b1['data'];let _0x580b9c;if(_0x3024ca[_0x3a4a68(0x17e)]['length']>0x2){const _0x149379=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0xb52e90+_0x3a4a68(0x15b),()=>_0x1059e7[_0x3a4a68(0x158)][_0x3a4a68(0x152)](_0xb52e90),{'verbose':_0xb23c6a[_0x3a4a68(0x155)]}),_0x570722=_0x149379[_0x3a4a68(0x15e)];if(_0x570722['type']!==_0x3a4a68(0x173)&&_0x570722['type']!==_0x3a4a68(0x14b))return console[_0x3a4a68(0x16b)](_0x3a4a68(0x17a)),0x1;_0x580b9c=_0x570722[_0x3a4a68(0x151)];}else{if(_0xb23c6a[_0x3a4a68(0x173)]){const _0x400cac=await withSpinner(_0x3a4a68(0x171)+_0xb23c6a['folder']+'\x27...',()=>_0x1059e7[_0x3a4a68(0x158)][_0x3a4a68(0x14c)](_0x2dd00b,_0xb23c6a[_0x3a4a68(0x173)]),{'verbose':_0xb23c6a[_0x3a4a68(0x155)]});_0x580b9c=_0x400cac[_0x3a4a68(0x15e)];}}_0xb23c6a[_0x3a4a68(0x155)]&&_0x580b9c&&console['error'](_0x3a4a68(0x161)+_0x580b9c);const _0x4efae4=await loadJSONFromOptions(_0xb23c6a['rule'],_0xb23c6a[_0x3a4a68(0x15c)]),_0x5c2f50={'name':_0x4d4d02,'description':_0xb23c6a['description'],'rule':_0x4efae4,'kind':_0xb23c6a[_0x3a4a68(0x16e)]!==undefined?parseInt(_0xb23c6a[_0x3a4a68(0x16e)],0xa):undefined,'isVisible':_0xb23c6a['invisible']?![]:undefined,'segmentFolderId':_0x580b9c,'countPopulation':_0xb23c6a[_0x3a4a68(0x16a)]?![]:undefined},_0x3e5330=await withSpinner('Creating\x20segment\x20\x27'+_0x4d4d02+_0x3a4a68(0x15b),()=>_0x1059e7[_0x3a4a68(0x158)][_0x3a4a68(0x166)](_0x2dd00b,_0x5c2f50),{'verbose':_0xb23c6a[_0x3a4a68(0x155)]}),_0x23898b=_0x3e5330[_0x3a4a68(0x15e)];return console[_0x3a4a68(0x16b)](_0x3a4a68(0x163)+_0x23898b[_0x3a4a68(0x17c)]+'\x27\x20with\x20ID:\x20'+_0x23898b['id']),_0x26c84c!==_0x5324e7&&console[_0x3a4a68(0x16b)]('\x20\x20\x20Path:\x20'+_0x26c84c),await handleSDKOutput([_0x23898b],_0xb23c6a),0x0;}}function a28_0x585f(){const _0x2c894b=['kind','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','execute','Resolving\x20folder\x20\x27','Target\x20path:\x20','folder','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Examples:','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','739404yOTMkq','length','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','6VCKkFO','name','Resolving\x20parent\x20segment\x20\x27','segments','Site:\x20','parent','resolveFolderId','Create\x20child\x20segment\x20with\x20filtering\x20rules','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Segment\x20name:\x20','includes','folderId','resolvePathToResource','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','segmentPath','verbose','393859XLkYiX','Resolved\x20relative\x20path\x20to:\x20','segment','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','5594544VSvuNY','\x27...','ruleFile','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','description','864160UnOrYX','Resolved\x20folder\x20ID:\x20','77CTEZWr','βœ”\x20Created\x20segment\x20\x27','yellow','13688XoTxaM','createSegment','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','1300012SSXAsr','2262790gyUzzD','noCountPopulation','error','site','Parent\x20path:\x20'];a28_0x585f=function(){return _0x2c894b;};return a28_0x585f();}
1
+ const a28_0x2dcbc0=a28_0x5a28;(function(_0x331c76,_0xc168ed){const _0x19df76=a28_0x5a28,_0x2f0fbb=_0x331c76();while(!![]){try{const _0x44a667=-parseInt(_0x19df76(0xd7))/0x1+-parseInt(_0x19df76(0xc3))/0x2*(parseInt(_0x19df76(0xf8))/0x3)+-parseInt(_0x19df76(0xe2))/0x4*(parseInt(_0x19df76(0xdc))/0x5)+parseInt(_0x19df76(0xda))/0x6+-parseInt(_0x19df76(0xf5))/0x7*(-parseInt(_0x19df76(0xe3))/0x8)+parseInt(_0x19df76(0xe1))/0x9*(-parseInt(_0x19df76(0xc2))/0xa)+-parseInt(_0x19df76(0xee))/0xb*(-parseInt(_0x19df76(0xf4))/0xc);if(_0x44a667===_0xc168ed)break;else _0x2f0fbb['push'](_0x2f0fbb['shift']());}catch(_0x53928e){_0x2f0fbb['push'](_0x2f0fbb['shift']());}}}(a28_0xcfa3,0xd590c));import{BaseCommand}from'./command.js';function a28_0xcfa3(){const _0x26e2b5=['rule','length','30fVruQh','3456vaKDET','noCountPopulation','Parent:\x20','Resolving\x20parent\x20segment\x20\x27','parent','error','Resolved\x20folder\x20ID:\x20','kind','βœ”\x20Created\x20segment\x20\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules','ruleFile','folderId','yellow','verbose','Site:\x20','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','data','folder','\x27...','1593188JrliCn','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Examples:','9352872AYIYbu','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','185pooPBY','resolveFolderId','Resolving\x20folder\x20\x27','resolvePathToResource','execute','1173951ofaOVo','39716UtAnjf','8DxCKDs','Segment\x20name:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','includes','Resolving\x20folder\x20path\x20\x27','site','type','\x20\x20\x20Path:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','segment:create','2732851clDNNe','\x27\x20with\x20ID:\x20','description','name','invisible','Parent\x20path:\x20','156MSujVh','461111vfHsOg','segments','resolveParentId','2826koNUvC','segment'];a28_0xcfa3=function(){return _0x26e2b5;};return a28_0xcfa3();}import{handleSDKOutput}from'../core/command-output.js';function a28_0x5a28(_0x22a258,_0x5d030c){_0x22a258=_0x22a258-0xc0;const _0xcfa3b9=a28_0xcfa3();let _0x5a2852=_0xcfa3b9[_0x22a258];return _0x5a2852;}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_0x19e3fb from'chalk';export class SegmentCreateCommand extends BaseCommand{[a28_0x2dcbc0(0xf1)]=a28_0x2dcbc0(0xed);[a28_0x2dcbc0(0xf0)]=a28_0x2dcbc0(0xcc);async[a28_0x2dcbc0(0xe0)](_0x4d7dca){const _0x41302d=a28_0x2dcbc0;console[_0x41302d(0xc8)](a28_0x19e3fb[_0x41302d(0xcf)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x41302d(0xc8)](a28_0x19e3fb['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x27cbf8,args:_0x134fda,tdx:_0xdb681f}=_0x4d7dca,_0x5b460e=_0x27cbf8;if(_0x134fda[_0x41302d(0xc1)]===0x0)return console[_0x41302d(0xc8)](_0x41302d(0xe5)),console['error'](_0x41302d(0xd8)),console['error'](_0x41302d(0xd9)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console['error'](_0x41302d(0xdb)),console[_0x41302d(0xc8)](_0x41302d(0xd3)),0x1;const _0x2cc789=_0x134fda[0x0],_0x4ad6c8=_0x27cbf8['segmentPath'];let _0x3a9d6d=_0x2cc789;_0x4ad6c8&&!_0x2cc789[_0x41302d(0xe7)]('/')&&(_0x3a9d6d=_0x4ad6c8+'/'+_0x2cc789,_0x5b460e['verbose']&&console[_0x41302d(0xc8)](_0x41302d(0xd2)+_0x3a9d6d));const _0x5507a5=parsePath(_0x3a9d6d);if(_0x5507a5[_0x41302d(0xf6)][_0x41302d(0xc1)]<0x2)return console['error']('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x41302d(0xc8)](_0x41302d(0xe6)),0x1;const _0x1b96bb=_0x5507a5['segments'][0x0],_0x23a22c=getBaseName(_0x3a9d6d),_0x965499=getParentPath(_0x3a9d6d);_0x5b460e['verbose']&&(console[_0x41302d(0xc8)](_0x41302d(0xd1)+_0x5b460e[_0x41302d(0xe9)]),console[_0x41302d(0xc8)]('Target\x20path:\x20'+_0x3a9d6d),console['error'](_0x41302d(0xc5)+_0x1b96bb),console[_0x41302d(0xc8)](_0x41302d(0xe4)+_0x23a22c),console[_0x41302d(0xc8)](_0x41302d(0xf3)+_0x965499));const _0x576957=await withSpinner(_0x41302d(0xc6)+_0x1b96bb+'\x27...',()=>_0xdb681f[_0x41302d(0xf9)][_0x41302d(0xf7)](_0x1b96bb),{'verbose':_0x5b460e['verbose']}),_0x58842b=_0x576957['data'];let _0x205dd3;if(_0x5507a5[_0x41302d(0xf6)][_0x41302d(0xc1)]>0x2){const _0x5a33ec=await withSpinner(_0x41302d(0xe8)+_0x965499+_0x41302d(0xd6),()=>_0xdb681f['segment'][_0x41302d(0xdf)](_0x965499),{'verbose':_0x5b460e[_0x41302d(0xd0)]}),_0x5934e6=_0x5a33ec['data'];if(_0x5934e6[_0x41302d(0xea)]!==_0x41302d(0xd5)&&_0x5934e6[_0x41302d(0xea)]!==_0x41302d(0xc7))return console[_0x41302d(0xc8)](_0x41302d(0xec)),0x1;_0x205dd3=_0x5934e6[_0x41302d(0xce)];}else{if(_0x5b460e[_0x41302d(0xd5)]){const _0x130aa5=await withSpinner(_0x41302d(0xde)+_0x5b460e[_0x41302d(0xd5)]+_0x41302d(0xd6),()=>_0xdb681f[_0x41302d(0xf9)][_0x41302d(0xdd)](_0x58842b,_0x5b460e[_0x41302d(0xd5)]),{'verbose':_0x5b460e[_0x41302d(0xd0)]});_0x205dd3=_0x130aa5[_0x41302d(0xd4)];}}_0x5b460e['verbose']&&_0x205dd3&&console[_0x41302d(0xc8)](_0x41302d(0xc9)+_0x205dd3);const _0xd1dc4a=await loadJSONFromOptions(_0x5b460e[_0x41302d(0xc0)],_0x5b460e[_0x41302d(0xcd)]),_0x2adf0b={'name':_0x23a22c,'description':_0x5b460e[_0x41302d(0xf0)],'rule':_0xd1dc4a,'kind':_0x5b460e[_0x41302d(0xca)]!==undefined?parseInt(_0x5b460e[_0x41302d(0xca)],0xa):undefined,'isVisible':_0x5b460e[_0x41302d(0xf2)]?![]:undefined,'segmentFolderId':_0x205dd3,'countPopulation':_0x5b460e[_0x41302d(0xc4)]?![]:undefined},_0x2ba688=await withSpinner('Creating\x20segment\x20\x27'+_0x23a22c+_0x41302d(0xd6),()=>_0xdb681f[_0x41302d(0xf9)]['createSegment'](_0x58842b,_0x2adf0b),{'verbose':_0x5b460e[_0x41302d(0xd0)]}),_0x1a5d22=_0x2ba688['data'];return console[_0x41302d(0xc8)](_0x41302d(0xcb)+_0x1a5d22[_0x41302d(0xf1)]+_0x41302d(0xef)+_0x1a5d22['id']),_0x3a9d6d!==_0x2cc789&&console[_0x41302d(0xc8)](_0x41302d(0xeb)+_0x3a9d6d),await handleSDKOutput([_0x1a5d22],_0x5b460e),0x0;}}
@@ -1 +1 @@
1
- const a29_0x35828d=a29_0x2a46;(function(_0x4ee9a1,_0x251283){const _0x3bf31e=a29_0x2a46,_0x53ece5=_0x4ee9a1();while(!![]){try{const _0x47969d=-parseInt(_0x3bf31e(0xcb))/0x1*(parseInt(_0x3bf31e(0xd8))/0x2)+parseInt(_0x3bf31e(0xc9))/0x3+-parseInt(_0x3bf31e(0xd3))/0x4+parseInt(_0x3bf31e(0xdc))/0x5*(parseInt(_0x3bf31e(0xd9))/0x6)+-parseInt(_0x3bf31e(0xdd))/0x7*(parseInt(_0x3bf31e(0xd7))/0x8)+-parseInt(_0x3bf31e(0xcc))/0x9*(parseInt(_0x3bf31e(0xca))/0xa)+parseInt(_0x3bf31e(0xd1))/0xb;if(_0x47969d===_0x251283)break;else _0x53ece5['push'](_0x53ece5['shift']());}catch(_0x1c3c24){_0x53ece5['push'](_0x53ece5['shift']());}}}(a29_0x58e6,0xba47f));function a29_0x2a46(_0x3b88c6,_0x580cdc){_0x3b88c6=_0x3b88c6-0xc4;const _0x58e634=a29_0x58e6();let _0x2a46eb=_0x58e634[_0x3b88c6];return _0x2a46eb;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a29_0x58e6(){const _0x411061=['description','name','\x20field','segment','error','execute','1740678OdwmBV','30KQrIyp','1UMPjDr','1978821QHkMXQ','List\x20available\x20fields\x20for\x20segmentation','length','verbose','βœ”\x20Found\x20','38090492UXbAIS','data','4355328mzswdD','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','parentSegment','listFields','3775984bJnvzM','1808486TXIUtz','138oVbvFh','jsonl','Site:\x20','68845IMTDdu','14dOTJoM'];a29_0x58e6=function(){return _0x411061;};return a29_0x58e6();}export class SegmentFieldsCommand extends BaseCommand{[a29_0x35828d(0xc4)]='segment:fields';[a29_0x35828d(0xde)]=a29_0x35828d(0xcd);async[a29_0x35828d(0xc8)](_0x33dafa){const _0x57b3eb=a29_0x35828d,{options:_0x1bc9e8,args:_0x1bc147,tdx:_0x5a51e2}=_0x33dafa,_0x2df112=_0x1bc147[0x0]||_0x1bc9e8[_0x57b3eb(0xd5)];if(!_0x2df112)return console[_0x57b3eb(0xc7)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x57b3eb(0xc7)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x57b3eb(0xc7)](_0x57b3eb(0xd4)),0x1;_0x1bc9e8[_0x57b3eb(0xcf)]&&(console[_0x57b3eb(0xc7)](_0x57b3eb(0xdb)+_0x1bc9e8['site']),console[_0x57b3eb(0xc7)]('Parent\x20segment:\x20'+_0x2df112));const _0x5c1780=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x2df112+'\x27...',()=>_0x5a51e2[_0x57b3eb(0xc6)][_0x57b3eb(0xd6)](_0x2df112),{'verbose':_0x1bc9e8[_0x57b3eb(0xcf)]}),_0x1d6a56=_0x5c1780[_0x57b3eb(0xd2)];console['error'](_0x57b3eb(0xd0)+_0x1d6a56[_0x57b3eb(0xce)]+_0x57b3eb(0xc5)+(_0x1d6a56[_0x57b3eb(0xce)]!==0x1?'s':''));if(_0x1bc9e8['json']||_0x1bc9e8[_0x57b3eb(0xda)])return await handleSDKOutput(_0x1d6a56,_0x1bc9e8),0x0;return displayFieldsHumanReadable(_0x1d6a56,_0x2df112),0x0;}}
1
+ const a29_0x3ef3fc=a29_0x5c66;(function(_0x4c3143,_0x2c4f50){const _0x3a7b4b=a29_0x5c66,_0x5a5ccb=_0x4c3143();while(!![]){try{const _0xadef52=parseInt(_0x3a7b4b(0xa3))/0x1*(-parseInt(_0x3a7b4b(0xb8))/0x2)+-parseInt(_0x3a7b4b(0xb9))/0x3*(parseInt(_0x3a7b4b(0xb6))/0x4)+parseInt(_0x3a7b4b(0xb3))/0x5+-parseInt(_0x3a7b4b(0xac))/0x6*(-parseInt(_0x3a7b4b(0xa5))/0x7)+-parseInt(_0x3a7b4b(0xab))/0x8*(parseInt(_0x3a7b4b(0xa7))/0x9)+parseInt(_0x3a7b4b(0xa0))/0xa*(parseInt(_0x3a7b4b(0xaf))/0xb)+-parseInt(_0x3a7b4b(0x9f))/0xc;if(_0xadef52===_0x2c4f50)break;else _0x5a5ccb['push'](_0x5a5ccb['shift']());}catch(_0x46acb5){_0x5a5ccb['push'](_0x5a5ccb['shift']());}}}(a29_0x5ef0,0xa6c6e));function a29_0x5c66(_0x180f59,_0xa16652){_0x180f59=_0x180f59-0x9f;const _0x5ef0d7=a29_0x5ef0();let _0x5c664c=_0x5ef0d7[_0x180f59];return _0x5c664c;}import{BaseCommand}from'./command.js';function a29_0x5ef0(){const _0x26657b=['23640psehOA','30sIOOOl','error','length','2990889RevGae','listFields','Error:\x20Parent\x20segment\x20name\x20is\x20required','Parent\x20segment:\x20','6182810XjnLnw','execute','jsonl','23988RXPRsO','parentSegment','2dCMzGX','147BpeaEd','Site:\x20','json','site','verbose','\x27...','2083140GcibHD','50IShmnS','data','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','902981ujOCKY','βœ”\x20Found\x20','535367bdUKKD','segment','2817vZTkUX','name','segment:fields','List\x20available\x20fields\x20for\x20segmentation'];a29_0x5ef0=function(){return _0x26657b;};return a29_0x5ef0();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x3ef3fc(0xa8)]=a29_0x3ef3fc(0xa9);['description']=a29_0x3ef3fc(0xaa);async[a29_0x3ef3fc(0xb4)](_0x2a0cc1){const _0x172971=a29_0x3ef3fc,{options:_0x1df218,args:_0x4dc865,tdx:_0x72492b}=_0x2a0cc1,_0x3450e7=_0x4dc865[0x0]||_0x1df218[_0x172971(0xb7)];if(!_0x3450e7)return console['error'](_0x172971(0xb1)),console[_0x172971(0xad)](_0x172971(0xa2)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x1df218[_0x172971(0xbd)]&&(console[_0x172971(0xad)](_0x172971(0xba)+_0x1df218[_0x172971(0xbc)]),console[_0x172971(0xad)](_0x172971(0xb2)+_0x3450e7));const _0x5a365d=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x3450e7+_0x172971(0xbe),()=>_0x72492b[_0x172971(0xa6)][_0x172971(0xb0)](_0x3450e7),{'verbose':_0x1df218['verbose']}),_0x6ca9af=_0x5a365d[_0x172971(0xa1)];console[_0x172971(0xad)](_0x172971(0xa4)+_0x6ca9af[_0x172971(0xae)]+'\x20field'+(_0x6ca9af[_0x172971(0xae)]!==0x1?'s':''));if(_0x1df218[_0x172971(0xbb)]||_0x1df218[_0x172971(0xb5)])return await handleSDKOutput(_0x6ca9af,_0x1df218),0x0;return displayFieldsHumanReadable(_0x6ca9af,_0x3450e7),0x0;}}
@@ -1 +1 @@
1
- const a30_0x5e4cff=a30_0x59a9;(function(_0x2927f3,_0x25945b){const _0x5fdd57=a30_0x59a9,_0x5d6019=_0x2927f3();while(!![]){try{const _0x4e0bff=parseInt(_0x5fdd57(0x1f7))/0x1*(parseInt(_0x5fdd57(0x21a))/0x2)+-parseInt(_0x5fdd57(0x1e9))/0x3*(-parseInt(_0x5fdd57(0x1ee))/0x4)+parseInt(_0x5fdd57(0x213))/0x5*(-parseInt(_0x5fdd57(0x1ed))/0x6)+-parseInt(_0x5fdd57(0x1f2))/0x7+parseInt(_0x5fdd57(0x20e))/0x8+-parseInt(_0x5fdd57(0x1fa))/0x9*(-parseInt(_0x5fdd57(0x1df))/0xa)+-parseInt(_0x5fdd57(0x1e7))/0xb;if(_0x4e0bff===_0x25945b)break;else _0x5d6019['push'](_0x5d6019['shift']());}catch(_0x518ff7){_0x5d6019['push'](_0x5d6019['shift']());}}}(a30_0x47e3,0xd7346));import{BaseCommand}from'./command.js';function a30_0x47e3(){const _0x4862ea=['cwd','Site:\x20','helpText','utf-8','length','journeyVersions','βœ”\x20Context\x20set:\x20','Pulling\x20segments\x20from\x20\x27','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','execute','\x20changed\x20files','absolutePath','parent_segment','\x20versions)','type','red','files','12123610MNkrRt','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','yellow','\x20files?','Target\x20resource:\x20','dim','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','3531077FJQJdJ','verbose','543ZHmTRX','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','parentSegment','segment','10548xGKvOT','33364AHbbBR','\x20activations','counts','segments','11765229jdiFfL','data','Error:\x20','dryRun','Aborted.','8039MqxFlr','\x0aError:','file','9TbbLxx','setPhase','βœ”\x20Pulled\x20','activations','session','repeat','\x20journeys','description','journeys','segment:pull','filter','\x20unchanged\x20files','hasChanges','\x20new\x20files','green','isNew','\x20=\x20','diff','cyan','\x20segments','3066464ZuCTJP','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','targetDir','errorCode','message','3970wnFhRg','\x20\x20🎯\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','yes','dirname','error','\x20\x20Target:\x20','292BrdSLB'];a30_0x47e3=function(){return _0x4862ea;};return a30_0x47e3();}import{withProgressSpinner}from'../utils/spinner.js';function a30_0x59a9(_0x9c5b14,_0x14fb3c){_0x9c5b14=_0x9c5b14-0x1ce;const _0x47e39f=a30_0x47e3();let _0x59a9f4=_0x47e39f[_0x9c5b14];return _0x59a9f4;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a30_0x3cd8a4 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x836f17 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_0x5e4cff(0x203);[a30_0x5e4cff(0x201)]=a30_0x5e4cff(0x20f);async[a30_0x5e4cff(0x1d7)](_0x2a2df7){const _0x482748=a30_0x5e4cff,{options:_0x18106c,args:_0x1ab4a4,tdx:_0x3a53ef}=_0x2a2df7,_0x3ec582=_0x18106c,_0x285a81=await resolveTarget({'arg':_0x1ab4a4[0x0],'contextParent':_0x18106c[_0x482748(0x1eb)],'cwd':process[_0x482748(0x1ce)]()});if(!isSuccessfulResolution(_0x285a81))return _0x285a81[_0x482748(0x211)]==='no_parent'?(console[_0x482748(0x218)](a30_0x3cd8a4[_0x482748(0x1e1)](_0x482748(0x215))),console[_0x482748(0x218)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x482748(0x218)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console['error'](_0x482748(0x1e0))):(console['error'](a30_0x3cd8a4[_0x482748(0x1dd)](_0x482748(0x1f4)+_0x285a81[_0x482748(0x212)]+'\x0a')),_0x285a81[_0x482748(0x1d0)]&&console['error'](a30_0x3cd8a4[_0x482748(0x20c)](_0x285a81[_0x482748(0x1d0)]))),0x1;const _0x15d2ce=_0x285a81[_0x482748(0x1e6)],_0x5aa8b5=_0x285a81[_0x482748(0x210)],_0x1f7d76=_0x285a81[_0x482748(0x1dc)]===_0x482748(0x1f9)?_0x285a81['resourceName']:undefined;_0x3ec582[_0x482748(0x1e8)]&&(console['error'](_0x482748(0x1cf)+_0x3ec582['site']),console[_0x482748(0x218)]('Parent\x20segment:\x20'+_0x15d2ce),_0x1f7d76&&console['error'](_0x482748(0x1e3)+_0x1f7d76));const _0x275664=await withProgressSpinner(_0x482748(0x1d5)+_0x15d2ce+'\x27...',_0xfcea50=>_0x3a53ef[_0x482748(0x1ec)]['pullSegments'](_0x15d2ce,{'targetDir':_0x5aa8b5,'targetResourceName':_0x1f7d76,'verbose':_0x3ec582[_0x482748(0x1e8)],'progress':{'update':_0x221f70=>{const _0x17959a=_0x482748;_0xfcea50[_0x17959a(0x1fb)](_0x221f70),_0x3ec582[_0x17959a(0x1e8)]&&console[_0x17959a(0x218)]('\x20\x20'+_0x221f70);}}}),{'verbose':_0x3ec582[_0x482748(0x1e8)]}),_0xca7409=_0x275664[_0x482748(0x1f3)];if(_0xca7409[_0x482748(0x1f0)][_0x482748(0x1f1)]===0x0&&_0xca7409[_0x482748(0x1f0)][_0x482748(0x202)]===0x0)return console[_0x482748(0x218)](a30_0x3cd8a4['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0xca7409[_0x482748(0x1e6)]+'\x27')),0x0;const _0x4e7d77=_0xca7409[_0x482748(0x1de)]['filter'](_0x268e60=>_0x268e60[_0x482748(0x209)]),_0x38c98e=_0xca7409[_0x482748(0x1de)][_0x482748(0x204)](_0x448fe3=>!_0x448fe3[_0x482748(0x209)]&&_0x448fe3['hasChanges']),_0x461b24=_0xca7409[_0x482748(0x1de)][_0x482748(0x204)](_0x4f75ba=>!_0x4f75ba[_0x482748(0x209)]&&!_0x4f75ba[_0x482748(0x206)]);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0xca7409['parentName']+'\x27:'),console[_0x482748(0x218)](_0x482748(0x214)+a30_0x3cd8a4[_0x482748(0x20c)](_0xca7409[_0x482748(0x1f0)]['segments']+_0x482748(0x20d))+'\x20with\x20'+a30_0x3cd8a4[_0x482748(0x20c)](_0xca7409['counts'][_0x482748(0x1fd)]+_0x482748(0x1ef)));if(_0xca7409[_0x482748(0x1f0)][_0x482748(0x202)]>0x0){const _0x3ab5d1=_0xca7409[_0x482748(0x1f0)][_0x482748(0x1d3)]>_0xca7409['counts'][_0x482748(0x202)]?'\x20('+_0xca7409[_0x482748(0x1f0)][_0x482748(0x1d3)]+_0x482748(0x1db):'';console[_0x482748(0x218)]('\x20\x20πŸ—ΊοΈ\x20\x20'+a30_0x3cd8a4['cyan'](_0xca7409[_0x482748(0x1f0)][_0x482748(0x202)]+_0x482748(0x200))+a30_0x3cd8a4[_0x482748(0x1e4)](_0x3ab5d1));}console[_0x482748(0x218)]('\x20\x20'+a30_0x3cd8a4[_0x482748(0x208)]('+\x20'+_0x4e7d77['length']+_0x482748(0x207))),console[_0x482748(0x218)]('\x20\x20'+a30_0x3cd8a4['yellow']('~\x20'+_0x38c98e[_0x482748(0x1d2)]+_0x482748(0x1d8))),console[_0x482748(0x218)]('\x20\x20'+a30_0x3cd8a4[_0x482748(0x1e4)]('=\x20'+_0x461b24[_0x482748(0x1d2)]+_0x482748(0x205))),console[_0x482748(0x218)](_0x482748(0x219)+a30_0x3cd8a4[_0x482748(0x20c)](_0xca7409['targetDir'])+'\x0a');if(_0x38c98e[_0x482748(0x1d2)]>0x0)for(const _0x25886f of _0x38c98e){console['error']('\x0aChanges\x20to\x20\x27'+_0x25886f['relativePath']+'\x27:'),console[_0x482748(0x218)]('─'[_0x482748(0x1ff)](0x3c)),console['error'](_0x25886f[_0x482748(0x20b)]),console[_0x482748(0x218)]('─'[_0x482748(0x1ff)](0x3c));}if(_0x3ec582[_0x482748(0x1f5)])return console['error'](a30_0x3cd8a4['yellow'](_0x482748(0x1e5))),0x0;if(_0x4e7d77[_0x482748(0x1d2)]===0x0&&_0x38c98e[_0x482748(0x1d2)]===0x0)return console[_0x482748(0x218)](a30_0x3cd8a4[_0x482748(0x208)](_0x482748(0x1d6))),saveSessionContext({'parent_segment':_0xca7409[_0x482748(0x1e6)]},_0x3ec582[_0x482748(0x1fe)]),console[_0x482748(0x218)](a30_0x3cd8a4[_0x482748(0x208)](_0x482748(0x1d4)+a30_0x3cd8a4[_0x482748(0x1e4)](_0x482748(0x1da))+_0x482748(0x20a)+a30_0x3cd8a4[_0x482748(0x20c)](_0xca7409[_0x482748(0x1e6)]))),0x0;if(!_0x3ec582[_0x482748(0x216)]){if(!isInteractive())return console['error'](a30_0x3cd8a4['red'](_0x482748(0x1f8)),_0x482748(0x1ea)),console[_0x482748(0x218)](a30_0x3cd8a4[_0x482748(0x1e4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4b7dc3=await confirmKey('Write\x20'+(_0x4e7d77['length']+_0x38c98e['length'])+_0x482748(0x1e2));if(!_0x4b7dc3)return console[_0x482748(0x218)](a30_0x3cd8a4[_0x482748(0x1e1)](_0x482748(0x1f6)),'-\x20no\x20files\x20written'),0x1;}for(const _0x31ebb6 of _0xca7409['files']){if(_0x31ebb6[_0x482748(0x209)]||_0x31ebb6[_0x482748(0x206)]){const _0x5c582e=a30_0x836f17[_0x482748(0x217)](_0x31ebb6[_0x482748(0x1d9)]);!existsSync(_0x5c582e)&&mkdirSync(_0x5c582e,{'recursive':!![]}),writeFileSync(_0x31ebb6['absolutePath'],_0x31ebb6['content'],_0x482748(0x1d1));}}return console[_0x482748(0x218)](a30_0x3cd8a4[_0x482748(0x208)](_0x482748(0x1fc)+(_0x4e7d77[_0x482748(0x1d2)]+_0x38c98e[_0x482748(0x1d2)])+'\x20files\x20to\x20'+_0xca7409[_0x482748(0x210)])),saveSessionContext({'parent_segment':_0xca7409['parentName']},_0x3ec582['session']),console[_0x482748(0x218)](a30_0x3cd8a4[_0x482748(0x208)]('βœ”\x20Context\x20set:\x20'+a30_0x3cd8a4['dim'](_0x482748(0x1da))+_0x482748(0x20a)+a30_0x3cd8a4[_0x482748(0x20c)](_0xca7409[_0x482748(0x1e6)]))),0x0;}}
1
+ const a30_0x4971d8=a30_0xde02;(function(_0x495646,_0x420e69){const _0x122712=a30_0xde02,_0x3ae939=_0x495646();while(!![]){try{const _0x5ce8f1=parseInt(_0x122712(0xdc))/0x1+parseInt(_0x122712(0x100))/0x2*(parseInt(_0x122712(0xf6))/0x3)+-parseInt(_0x122712(0xea))/0x4+-parseInt(_0x122712(0xfa))/0x5*(parseInt(_0x122712(0x108))/0x6)+parseInt(_0x122712(0x11e))/0x7+-parseInt(_0x122712(0x11a))/0x8*(parseInt(_0x122712(0xeb))/0x9)+parseInt(_0x122712(0x104))/0xa;if(_0x5ce8f1===_0x420e69)break;else _0x3ae939['push'](_0x3ae939['shift']());}catch(_0x218c51){_0x3ae939['push'](_0x3ae939['shift']());}}}(a30_0x43bc,0xb944b));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_0x40bda9 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x2d8dc6 from'path';function a30_0xde02(_0x3f92f9,_0x4c0f8a){_0x3f92f9=_0x3f92f9-0xc7;const _0x43bc5c=a30_0x43bc();let _0xde02b8=_0x43bc5c[_0x3f92f9];return _0xde02b8;}function a30_0x43bc(){const _0x503d87=['yes','red','cyan','\x20files?','counts','segment','\x20segments','journeyVersions','green','isNew','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','activations','content','type','1137592hFbMfx','Pulling\x20segments\x20from\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','setPhase','7795207KpKMAj','data','Site:\x20','\x0aError:','filter','Write\x20','error','verbose','dirname','Target\x20resource:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resourceName','relativePath','\x20new\x20files','βœ”\x20Context\x20set:\x20','\x27...','targetDir','site','segments','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','hasChanges','360778GMOIsl','no_parent','\x20unchanged\x20files','parentSegment','file','parent_segment','Parent\x20segment:\x20','description','repeat','segment:pull','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','4624680cYpNmv','45cQfzhy','errorCode','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','\x20files\x20to\x20','\x20=\x20','journeys','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','cwd','utf-8','βœ”\x20Pulled\x20','15OYrSek','pullSegments','files','session','50qotgOY','Error:\x20','\x20\x20Target:\x20','helpText','yellow','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','39458Fdycmf','\x20versions)','dryRun','execute','21832800KqeymT','\x20activations','Aborted.','-\x20no\x20files\x20written','678168xbuMcT','message','\x0aChanges\x20to\x20\x27','parentName'];a30_0x43bc=function(){return _0x503d87;};return a30_0x43bc();}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_0x4971d8(0xe5);[a30_0x4971d8(0xe3)]=a30_0x4971d8(0xe7);async[a30_0x4971d8(0x103)](_0x3323fa){const _0x13ac8e=a30_0x4971d8,{options:_0x2be8ec,args:_0x3cbebe,tdx:_0x1ef00d}=_0x3323fa,_0x372649=_0x2be8ec,_0x30186b=await resolveTarget({'arg':_0x3cbebe[0x0],'contextParent':_0x2be8ec[_0x13ac8e(0xdf)],'cwd':process[_0x13ac8e(0xf3)]()});if(!isSuccessfulResolution(_0x30186b))return _0x30186b[_0x13ac8e(0xec)]===_0x13ac8e(0xdd)?(console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xfe)](_0x13ac8e(0xd0))),console[_0x13ac8e(0xcc)](_0x13ac8e(0x116)),console[_0x13ac8e(0xcc)](_0x13ac8e(0x11c)),console[_0x13ac8e(0xcc)](_0x13ac8e(0xee))):(console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0x10d)](_0x13ac8e(0xfb)+_0x30186b[_0x13ac8e(0x109)]+'\x0a')),_0x30186b[_0x13ac8e(0xfd)]&&console[_0x13ac8e(0xcc)](a30_0x40bda9['cyan'](_0x30186b[_0x13ac8e(0xfd)]))),0x1;const _0x2b4f5b=_0x30186b[_0x13ac8e(0x10b)],_0x709dff=_0x30186b[_0x13ac8e(0xd6)],_0x3feab4=_0x30186b[_0x13ac8e(0x119)]===_0x13ac8e(0xe0)?_0x30186b[_0x13ac8e(0xd1)]:undefined;_0x372649['verbose']&&(console[_0x13ac8e(0xcc)](_0x13ac8e(0xc8)+_0x372649[_0x13ac8e(0xd7)]),console[_0x13ac8e(0xcc)](_0x13ac8e(0xe2)+_0x2b4f5b),_0x3feab4&&console['error'](_0x13ac8e(0xcf)+_0x3feab4));const _0x47d5bb=await withProgressSpinner(_0x13ac8e(0x11b)+_0x2b4f5b+_0x13ac8e(0xd5),_0x1f54bf=>_0x1ef00d[_0x13ac8e(0x111)][_0x13ac8e(0xf7)](_0x2b4f5b,{'targetDir':_0x709dff,'targetResourceName':_0x3feab4,'verbose':_0x372649[_0x13ac8e(0xcd)],'progress':{'update':_0x38c4fd=>{const _0x273076=_0x13ac8e;_0x1f54bf[_0x273076(0x11d)](_0x38c4fd),_0x372649[_0x273076(0xcd)]&&console[_0x273076(0xcc)]('\x20\x20'+_0x38c4fd);}}}),{'verbose':_0x372649['verbose']}),_0x2de16f=_0x47d5bb[_0x13ac8e(0xc7)];if(_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0xd8)]===0x0&&_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0xf1)]===0x0)return console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xfe)](_0x13ac8e(0xf2)+_0x2de16f[_0x13ac8e(0x10b)]+'\x27')),0x0;const _0x5e82b9=_0x2de16f[_0x13ac8e(0xf8)][_0x13ac8e(0xca)](_0x3fc024=>_0x3fc024[_0x13ac8e(0x115)]),_0x583a4f=_0x2de16f[_0x13ac8e(0xf8)][_0x13ac8e(0xca)](_0x322cbb=>!_0x322cbb[_0x13ac8e(0x115)]&&_0x322cbb[_0x13ac8e(0xdb)]),_0x4d454d=_0x2de16f[_0x13ac8e(0xf8)]['filter'](_0x1db254=>!_0x1db254[_0x13ac8e(0x115)]&&!_0x1db254[_0x13ac8e(0xdb)]);console['error'](_0x13ac8e(0xe9)+_0x2de16f[_0x13ac8e(0x10b)]+'\x27:'),console[_0x13ac8e(0xcc)]('\x20\x20🎯\x20'+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0x110)]['segments']+_0x13ac8e(0x112))+_0x13ac8e(0xe8)+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0x117)]+_0x13ac8e(0x105)));if(_0x2de16f['counts']['journeys']>0x0){const _0x20cf7a=_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0x113)]>_0x2de16f['counts'][_0x13ac8e(0xf1)]?'\x20('+_0x2de16f[_0x13ac8e(0x110)][_0x13ac8e(0x113)]+_0x13ac8e(0x101):'';console[_0x13ac8e(0xcc)]('\x20\x20πŸ—ΊοΈ\x20\x20'+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0x110)]['journeys']+'\x20journeys')+a30_0x40bda9[_0x13ac8e(0xda)](_0x20cf7a));}console['error']('\x20\x20'+a30_0x40bda9[_0x13ac8e(0x114)]('+\x20'+_0x5e82b9['length']+_0x13ac8e(0xd3))),console[_0x13ac8e(0xcc)]('\x20\x20'+a30_0x40bda9[_0x13ac8e(0xfe)]('~\x20'+_0x583a4f[_0x13ac8e(0xed)]+'\x20changed\x20files')),console[_0x13ac8e(0xcc)]('\x20\x20'+a30_0x40bda9[_0x13ac8e(0xda)]('=\x20'+_0x4d454d[_0x13ac8e(0xed)]+_0x13ac8e(0xde))),console[_0x13ac8e(0xcc)](_0x13ac8e(0xfc)+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0xd6)])+'\x0a');if(_0x583a4f[_0x13ac8e(0xed)]>0x0)for(const _0x5f1db9 of _0x583a4f){console[_0x13ac8e(0xcc)](_0x13ac8e(0x10a)+_0x5f1db9[_0x13ac8e(0xd2)]+'\x27:'),console['error']('─'[_0x13ac8e(0xe4)](0x3c)),console[_0x13ac8e(0xcc)](_0x5f1db9['diff']),console[_0x13ac8e(0xcc)]('─'[_0x13ac8e(0xe4)](0x3c));}if(_0x372649[_0x13ac8e(0x102)])return console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xfe)](_0x13ac8e(0xd9))),0x0;if(_0x5e82b9['length']===0x0&&_0x583a4f[_0x13ac8e(0xed)]===0x0)return console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0x114)]('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x2de16f[_0x13ac8e(0x10b)]},_0x372649[_0x13ac8e(0xf9)]),console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0x114)]('βœ”\x20Context\x20set:\x20'+a30_0x40bda9['dim'](_0x13ac8e(0xe1))+_0x13ac8e(0xf0)+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f['parentName']))),0x0;if(!_0x372649[_0x13ac8e(0x10c)]){if(!isInteractive())return console[_0x13ac8e(0xcc)](a30_0x40bda9['red'](_0x13ac8e(0xc9)),_0x13ac8e(0xe6)),console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xda)](_0x13ac8e(0xff))),0x1;const _0x5c3794=await confirmKey(_0x13ac8e(0xcb)+(_0x5e82b9[_0x13ac8e(0xed)]+_0x583a4f[_0x13ac8e(0xed)])+_0x13ac8e(0x10f));if(!_0x5c3794)return console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0xfe)](_0x13ac8e(0x106)),_0x13ac8e(0x107)),0x1;}for(const _0x1b16a9 of _0x2de16f['files']){if(_0x1b16a9[_0x13ac8e(0x115)]||_0x1b16a9['hasChanges']){const _0x241c86=a30_0x2d8dc6[_0x13ac8e(0xce)](_0x1b16a9['absolutePath']);!existsSync(_0x241c86)&&mkdirSync(_0x241c86,{'recursive':!![]}),writeFileSync(_0x1b16a9['absolutePath'],_0x1b16a9[_0x13ac8e(0x118)],_0x13ac8e(0xf4));}}return console[_0x13ac8e(0xcc)](a30_0x40bda9['green'](_0x13ac8e(0xf5)+(_0x5e82b9[_0x13ac8e(0xed)]+_0x583a4f[_0x13ac8e(0xed)])+_0x13ac8e(0xef)+_0x2de16f['targetDir'])),saveSessionContext({'parent_segment':_0x2de16f[_0x13ac8e(0x10b)]},_0x372649[_0x13ac8e(0xf9)]),console[_0x13ac8e(0xcc)](a30_0x40bda9[_0x13ac8e(0x114)](_0x13ac8e(0xd4)+a30_0x40bda9[_0x13ac8e(0xda)](_0x13ac8e(0xe1))+_0x13ac8e(0xf0)+a30_0x40bda9[_0x13ac8e(0x10e)](_0x2de16f[_0x13ac8e(0x10b)]))),0x0;}}
@@ -1 +1 @@
1
- function a31_0x5f3e(_0x2a817a,_0x209449){_0x2a817a=_0x2a817a-0x109;const _0x1739c7=a31_0x1739();let _0x5f3ec4=_0x1739c7[_0x2a817a];return _0x5f3ec4;}const a31_0x44592b=a31_0x5f3e;(function(_0x1eb0d8,_0x41c478){const _0x887b9d=a31_0x5f3e,_0xa67bf0=_0x1eb0d8();while(!![]){try{const _0x2cc456=-parseInt(_0x887b9d(0x128))/0x1*(parseInt(_0x887b9d(0x144))/0x2)+-parseInt(_0x887b9d(0x191))/0x3+-parseInt(_0x887b9d(0x166))/0x4*(-parseInt(_0x887b9d(0x17b))/0x5)+parseInt(_0x887b9d(0x11c))/0x6*(parseInt(_0x887b9d(0x11b))/0x7)+parseInt(_0x887b9d(0x172))/0x8*(-parseInt(_0x887b9d(0x134))/0x9)+parseInt(_0x887b9d(0x161))/0xa*(-parseInt(_0x887b9d(0x146))/0xb)+parseInt(_0x887b9d(0x138))/0xc;if(_0x2cc456===_0x41c478)break;else _0xa67bf0['push'](_0xa67bf0['shift']());}catch(_0x35a160){_0xa67bf0['push'](_0xa67bf0['shift']());}}}(a31_0x1739,0x797f1));function a31_0x1739(){const _0x2ac6d7=['.yml','isScoped','journeyId','folderId','1679649KmJYwX','unchanged','add','journeysOnly','/e/','\x20to\x20update','isNew','yamlConfig','\x20activations]','Changes\x20to:','then','nameToId','\x20\x20Segments:\x20','parentFolder','toUpdate','segment:push','listJourneysWithDetailsFromParentSegment','\x20\x20\x20\x20','Source\x20directory:\x20','set','parent_name','getOutputSchemaWithCache','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','parentName','filter','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20folders\x20to\x20create','toDelete','Changes\x20to\x20journey:','attributes','No\x20','Error:\x20','audienceId','folderPath','Fetching\x20existing\x20journeys...','delete','verbose','\x0aValidation\x20failed:','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','1939BKUwTp','2868futPez','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','user','Scoped\x20to\x20folder:\x20','name','Delete\x20journey:','segment','description','\x0aError:','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeyBundleName','37bfVegF','(Journey\x20will\x20be\x20deleted)','Error\x20parsing\x20YAML:\x20','\x20changed','targetDir','Fetching\x20existing\x20segments...','connection','all','nameToType','Delete\x20segment:','data','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','72aOKXlj','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','error','state','8927580wSyLur','existingJourney','/app/ps/','push','map','segmentFolderId','repeat','\x20updated','\x20unchanged','updated','getJourney','\x20\x20πŸ“Š\x20Segments:','3694JgBqmb','\x20\x20Activations:\x20','15697PFchfd','updatedAt','no_parent','get','Parent\x20segment:\x20','relationships','\x20changes?','cyan','changed','site','folders','cwd','\x20\x20Journeys:\x20','diff','list','red','type','versionNumber','deleted','Fetching\x20connections\x20for\x20name\x20resolution...','Fetching\x20existing\x20folders...','join','yes','blue','\x20deleted','journeys','dim','430yrWxpV','results','length','segment\x20or\x20journey','\x20\x20Activations:','4rrQyfY','/j/da/je','Resolving\x20parent\x20segment\x20\x27','Preparing\x20journeys...','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','green','listActivations','filePath','message','errorCode','New\x20journey:','256408vozTnd','Error:\x20Directory\x20not\x20found:\x20','endsWith','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','idToName','created','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20created','Push\x20','2836345SWAiBm','journey','toCreate','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20new','\x20to\x20delete','buildUserMaps','Folders\x20to\x20create:','paused','new','activations','createdAt','yellow','journeyBundleId','setPhase','Aborted.','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','segments'];a31_0x1739=function(){return _0x2ac6d7;};return a31_0x1739();}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_0x3d693c from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x44592b(0x121)]=a31_0x44592b(0x1a0);[a31_0x44592b(0x124)]=a31_0x44592b(0x16b);async['execute'](_0x44cdb8){const _0x20b2a8=a31_0x44592b,{options:_0x24997a,args:_0x2b6784,tdx:_0x3bca}=_0x44cdb8,_0x495573=_0x24997a,_0x41a812=await resolveTarget({'arg':_0x2b6784[0x0],'contextParent':_0x24997a['parentSegment'],'cwd':process[_0x20b2a8(0x151)]()});if(!isSuccessfulResolution(_0x41a812))return _0x41a812[_0x20b2a8(0x170)]===_0x20b2a8(0x148)?(console['error'](a31_0x3d693c[_0x20b2a8(0x187)](_0x20b2a8(0x17e))),console[_0x20b2a8(0x136)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x20b2a8(0x136)](_0x20b2a8(0x119)),console[_0x20b2a8(0x136)](_0x20b2a8(0x135))):(console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x155)](_0x20b2a8(0x111)+_0x41a812[_0x20b2a8(0x16f)]+'\x0a')),_0x41a812['helpText']&&console[_0x20b2a8(0x136)](a31_0x3d693c['cyan'](_0x41a812['helpText']))),0x1;if(_0x41a812[_0x20b2a8(0x156)]===_0x20b2a8(0x1a5))return console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x155)](_0x20b2a8(0x173)+_0x41a812[_0x20b2a8(0x12c)]+'\x0a')),console[_0x20b2a8(0x136)](a31_0x3d693c['cyan'](_0x20b2a8(0x16a))),0x1;const _0x4c33ff=_0x41a812[_0x20b2a8(0x109)],_0x4ca8e9=_0x41a812[_0x20b2a8(0x12c)],_0x2ee43e=_0x41a812[_0x20b2a8(0x156)]==='file'?_0x41a812[_0x20b2a8(0x16e)]:undefined,_0xe06751=getScopedDetails(_0x41a812),_0x15cd5d=_0xe06751?.[_0x20b2a8(0x18e)]??![],_0x2cfea7=_0xe06751?.['scopedFolderPath']??'';if(!existsSync(_0x4ca8e9))return console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x155)](_0x20b2a8(0x173)+_0x4ca8e9+'\x0a')),console['error'](a31_0x3d693c[_0x20b2a8(0x14d)](_0x20b2a8(0x16a))),0x1;_0x495573['verbose']&&(console[_0x20b2a8(0x136)]('Site:\x20'+_0x495573['site']),console['error'](_0x20b2a8(0x14a)+_0x4c33ff),console['error'](_0x20b2a8(0x1a3)+_0x4ca8e9),_0x15cd5d&&console[_0x20b2a8(0x136)](_0x20b2a8(0x120)+_0x2cfea7));const _0x40bbd9=await withSpinner(_0x20b2a8(0x168)+_0x4c33ff+'\x27...',()=>_0x3bca[_0x20b2a8(0x123)]['resolveParentId'](_0x4c33ff),{'verbose':_0x495573[_0x20b2a8(0x116)]}),_0x3d68e4=_0x40bbd9[_0x20b2a8(0x132)],[_0x215317,_0x20cb78,_0x5cd139,_0x272b96,_0x45a0fd]=await Promise[_0x20b2a8(0x12f)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x3bca[_0x20b2a8(0x123)]['getParent'](_0x3d68e4),{'verbose':_0x495573['verbose']}),withSpinner(_0x20b2a8(0x12d),()=>_0x3bca['segment']['listSegments'](_0x3d68e4),{'verbose':_0x495573[_0x20b2a8(0x116)]}),withSpinner(_0x20b2a8(0x15a),()=>_0x3bca[_0x20b2a8(0x123)]['listFolders'](_0x3d68e4),{'verbose':_0x495573[_0x20b2a8(0x116)]}),withSpinner(_0x20b2a8(0x114),()=>_0x3bca['journey'][_0x20b2a8(0x1a1)](_0x3d68e4,{'includeAllVersions':!![]}),{'verbose':_0x495573[_0x20b2a8(0x116)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x3bca[_0x20b2a8(0x11f)][_0x20b2a8(0x181)](),{'verbose':_0x495573[_0x20b2a8(0x116)]})[_0x20b2a8(0x19b)](_0x41e998=>_0x41e998['data'])]),_0x59ad7b=_0x215317[_0x20b2a8(0x132)],_0xd11493=extractRootFolderId(_0x59ad7b),_0x23eb25=_0x20cb78[_0x20b2a8(0x132)],_0x28468a=_0x5cd139['data'],{journeys:_0xae8c35,activationStepsById:_0x66b99a}=_0x272b96[_0x20b2a8(0x132)],_0xb57a0d=new Map(_0xae8c35[_0x20b2a8(0x13c)](_0x251fef=>[_0x251fef['id'],_0x251fef])),_0x1c1280=_0xae8c35[_0x20b2a8(0x13c)](_0x1f5566=>({'id':_0x1f5566['id'],'name':_0x1f5566[_0x20b2a8(0x10f)]['name'],'journeyBundleName':_0x1f5566[_0x20b2a8(0x10f)][_0x20b2a8(0x127)]||'','journeyBundleId':_0x1f5566[_0x20b2a8(0x10f)][_0x20b2a8(0x188)]||'','versionNumber':_0x1f5566[_0x20b2a8(0x10f)][_0x20b2a8(0x157)],'description':_0x1f5566[_0x20b2a8(0x10f)][_0x20b2a8(0x124)],'state':_0x1f5566['attributes'][_0x20b2a8(0x137)],'paused':_0x1f5566[_0x20b2a8(0x10f)][_0x20b2a8(0x183)],'audienceId':_0x1f5566['attributes'][_0x20b2a8(0x112)],'folderId':_0x1f5566[_0x20b2a8(0x14b)]?.[_0x20b2a8(0x19e)]?.['data']?.['id'],'createdAt':_0x1f5566[_0x20b2a8(0x10f)][_0x20b2a8(0x186)],'updatedAt':_0x1f5566['attributes'][_0x20b2a8(0x147)]})),{emailToId:_0x55fe7e,idToEmail:_0x3d8ea7}=_0x45a0fd,_0xb391bd=await withSpinner(_0x20b2a8(0x159),async()=>{const _0x3affa5=_0x20b2a8,_0x2b66eb=await _0x3bca[_0x3affa5(0x12e)][_0x3affa5(0x154)]();return buildConnectionMaps(_0x2b66eb);},{'verbose':_0x495573['verbose']})[_0x20b2a8(0x19b)](_0x138f87=>_0x138f87[_0x20b2a8(0x132)]),_0x59ae45=_0xb391bd[_0x20b2a8(0x19c)],_0x512c52=_0xb391bd[_0x20b2a8(0x176)],_0x5ebf09=_0xb391bd[_0x20b2a8(0x130)],_0x22a177={'emailToIdMap':_0x55fe7e,'connectionNameToIdMap':_0x59ae45,'connectionNameToTypeMap':_0x5ebf09,'getSchema':_0x5dfde7=>_0x3bca[_0x20b2a8(0x12e)][_0x20b2a8(0x1a6)](_0x5dfde7)};let {pathToId:_0x5760d5,idToPath:_0x4de47d}=buildFolderMaps(_0x28468a);const _0x2c27ac=buildSegmentLookupMap(_0x23eb25,_0x4de47d),_0x56b709=buildSegmentNameToIdMap(_0x23eb25),_0x49d05a=buildJourneyBundleLookupMap(_0x1c1280,_0x4de47d);let _0xfddde0;if(_0x2ee43e){if(!_0x2ee43e[_0x20b2a8(0x174)](_0x20b2a8(0x18d))&&!_0x2ee43e[_0x20b2a8(0x174)]('.yaml'))return console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x155)](_0x20b2a8(0x11d)+_0x2ee43e+'\x0a')),0x1;_0xfddde0=[_0x2ee43e];}else _0xfddde0=findYamlFiles(_0x4ca8e9);if(_0xfddde0[_0x20b2a8(0x163)]===0x0)return console[_0x20b2a8(0x136)](a31_0x3d693c['red'](_0x20b2a8(0x11e)+_0x4ca8e9+'\x0a')),console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x14d)](_0x20b2a8(0x178))),0x1;let _0x11dccd,_0x2853f8;try{const _0x445e4a=parseAndClassifyYamlFiles(_0xfddde0,_0x4ca8e9,{'skipSegments':_0x495573[_0x20b2a8(0x194)]});_0x11dccd=_0x445e4a['segments'],_0x2853f8=_0x445e4a['journeys'];const _0x54c270=validateParsedFiles(_0x445e4a,_0x4ca8e9);if(_0x54c270['length']>0x0)return console[_0x20b2a8(0x136)](a31_0x3d693c['red'](_0x20b2a8(0x117))),console[_0x20b2a8(0x136)](formatValidationErrors(_0x54c270)),console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x187)](_0x20b2a8(0x133))),0x1;}catch(_0x3db9c3){return console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x155)](_0x20b2a8(0x12a)+(_0x3db9c3 instanceof Error?_0x3db9c3[_0x20b2a8(0x16f)]:_0x3db9c3))),0x1;}if(_0x11dccd[_0x20b2a8(0x163)]===0x0&&_0x2853f8[_0x20b2a8(0x163)]===0x0){const _0x2ca806=_0x495573[_0x20b2a8(0x194)]?_0x20b2a8(0x17c):_0x20b2a8(0x164);return console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x187)](_0x20b2a8(0x110)+_0x2ca806+'\x20YAML\x20files\x20found')),0x0;}const _0x3932b5=new Map();_0x23eb25[_0x20b2a8(0x163)]>0x0&&!_0x495573['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x23eb25,async _0x29db1c=>{const _0x2d5354=a31_0x5f3e,_0xd982a4=await _0x3bca[_0x2d5354(0x123)][_0x2d5354(0x16d)](_0x3d68e4,_0x29db1c['id']);_0x3932b5[_0x2d5354(0x1a4)](_0x29db1c['id'],_0xd982a4);});},{'verbose':_0x495573[_0x20b2a8(0x116)]});const {segmentFiles:_0x1906c6,foldersToCreate:_0x490acf}=await prepareSegmentFiles(_0x11dccd,{'segmentByFolderAndName':_0x2c27ac,'activationsBySegmentId':_0x3932b5,'folderPathToId':_0x5760d5,'idToEmailMap':_0x3d8ea7,'connectionIdToNameMap':_0x512c52},_0x22a177,_0x15cd5d,_0x2cfea7),_0x478bd1=_0x2ee43e?[]:findSegmentsToDelete(_0x23eb25,_0x11dccd['map'](({yamlConfig:_0x17ea94,folderPath:_0x3bf1b9})=>({'yamlConfig':_0x17ea94,'folderPath':resolveTDFolderPath(_0x3bf1b9,_0x15cd5d,_0x2cfea7)})),_0x4de47d,_0x2cfea7,_0x15cd5d),{journeyFiles:_0x510dc7,foldersToCreate:_0x3f1aa5}=await withProgressSpinner(_0x20b2a8(0x169),async _0x329f70=>prepareJourneyFiles(_0x2853f8,{'fetchJourney':async _0xc85ac2=>_0x3bca[_0x20b2a8(0x17c)][_0x20b2a8(0x142)](_0xc85ac2[_0x20b2a8(0x18f)]),'journeyBundlesByFolderAndName':_0x49d05a,'folderPathToId':_0x5760d5,'idToEmailMap':_0x3d8ea7,'connectionIdToNameMap':_0x512c52,'existingSegments':_0x23eb25,'parentId':_0x3d68e4,'deps':_0x3bca,'progress':{'update':_0x4b3243=>{const _0x3159ca=_0x20b2a8;_0x329f70[_0x3159ca(0x189)](_0x4b3243),_0x495573[_0x3159ca(0x116)]&&console[_0x3159ca(0x136)]('\x20\x20'+_0x4b3243);}},'journeyById':_0xb57a0d,'activationStepsById':_0x66b99a},_0x15cd5d,_0x2cfea7),{'verbose':_0x495573['verbose']})[_0x20b2a8(0x19b)](_0x5c1763=>_0x5c1763[_0x20b2a8(0x132)]);for(const _0x15f370 of _0x3f1aa5){_0x490acf[_0x20b2a8(0x193)](_0x15f370);}const _0x25ad99=_0x2ee43e?[]:findJourneysToDelete(_0x1c1280,_0x2853f8['map'](({yamlConfig:_0x1f792a,folderPath:_0x583e16})=>({'yamlConfig':_0x1f792a,'folderPath':resolveTDFolderPath(_0x583e16,_0x15cd5d,_0x2cfea7)})),_0x4de47d,_0x2cfea7,_0x15cd5d),_0x1221f8=calculatePushStats(_0x1906c6,_0x510dc7,_0x490acf,_0x478bd1,_0x25ad99,!!_0x495573['delete'],!!_0x495573['journeysOnly']),_0x3ac125=_0x1221f8[_0x20b2a8(0x18c)][_0x20b2a8(0x184)],_0x19c9d5=_0x1221f8['segments']['changed'],_0x4bf825=_0x1221f8[_0x20b2a8(0x18c)][_0x20b2a8(0x192)],_0x49187a=_0x1221f8['segments'][_0x20b2a8(0x10d)],_0x404a3f=_0x1221f8[_0x20b2a8(0x150)][_0x20b2a8(0x17d)],_0x27b55f=_0x1221f8['journeys']['new'],_0x525f00=_0x1221f8[_0x20b2a8(0x15f)][_0x20b2a8(0x14e)],_0x26b0ac=_0x1221f8['journeys']['unchanged'],_0x1c558c=_0x1221f8[_0x20b2a8(0x15f)][_0x20b2a8(0x10d)],_0x486899=_0x1221f8[_0x20b2a8(0x185)][_0x20b2a8(0x12f)],_0x39c056=_0x1221f8[_0x20b2a8(0x185)][_0x20b2a8(0x17d)],_0x2bcf3c=_0x1221f8[_0x20b2a8(0x185)][_0x20b2a8(0x19f)],_0x56534b=_0x1221f8[_0x20b2a8(0x185)][_0x20b2a8(0x10d)];console[_0x20b2a8(0x136)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4c33ff+'\x27:');_0x404a3f['length']>0x0&&console[_0x20b2a8(0x136)]('\x20\x20'+a31_0x3d693c[_0x20b2a8(0x15d)]('πŸ“\x20'+_0x404a3f[_0x20b2a8(0x163)]+_0x20b2a8(0x10c)));if(!_0x495573[_0x20b2a8(0x194)]){console['error'](_0x20b2a8(0x143)),console[_0x20b2a8(0x136)]('\x20\x20\x20\x20'+a31_0x3d693c[_0x20b2a8(0x16c)]('+\x20'+_0x3ac125[_0x20b2a8(0x163)]+_0x20b2a8(0x17f))),console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x187)]('~\x20'+_0x19c9d5['length']+_0x20b2a8(0x12b)));if(_0x49187a[_0x20b2a8(0x163)]>0x0)console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x155)]('-\x20'+_0x49187a['length']+'\x20to\x20delete'));else _0x478bd1[_0x20b2a8(0x163)]>0x0&&!_0x495573[_0x20b2a8(0x115)]&&console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x160)](_0x478bd1['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x160)]('=\x20'+_0x4bf825['length']+_0x20b2a8(0x140)));}if(_0x510dc7[_0x20b2a8(0x163)]>0x0||_0x25ad99[_0x20b2a8(0x163)]>0x0){console['error'](_0x20b2a8(0x18b)),console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x16c)]('+\x20'+_0x27b55f[_0x20b2a8(0x163)]+_0x20b2a8(0x17f))),console[_0x20b2a8(0x136)]('\x20\x20\x20\x20'+a31_0x3d693c[_0x20b2a8(0x187)]('~\x20'+_0x525f00[_0x20b2a8(0x163)]+_0x20b2a8(0x12b)));if(_0x1c558c[_0x20b2a8(0x163)]>0x0)console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x155)]('-\x20'+_0x1c558c[_0x20b2a8(0x163)]+'\x20to\x20delete'));else _0x25ad99[_0x20b2a8(0x163)]>0x0&&!_0x495573[_0x20b2a8(0x115)]&&console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x160)](_0x25ad99[_0x20b2a8(0x163)]+_0x20b2a8(0x126)));console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x160)]('=\x20'+_0x26b0ac[_0x20b2a8(0x163)]+_0x20b2a8(0x140)));}_0x486899[_0x20b2a8(0x163)]>0x0&&!_0x495573[_0x20b2a8(0x194)]&&(console[_0x20b2a8(0x136)](''),console['error'](_0x20b2a8(0x165)),_0x39c056[_0x20b2a8(0x163)]>0x0&&console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x16c)]('+\x20'+_0x39c056[_0x20b2a8(0x163)]+'\x20to\x20create')),_0x2bcf3c[_0x20b2a8(0x163)]>0x0&&console[_0x20b2a8(0x136)](_0x20b2a8(0x1a2)+a31_0x3d693c[_0x20b2a8(0x187)]('~\x20'+_0x2bcf3c[_0x20b2a8(0x163)]+_0x20b2a8(0x196))),_0x56534b[_0x20b2a8(0x163)]>0x0&&console[_0x20b2a8(0x136)]('\x20\x20\x20\x20'+a31_0x3d693c[_0x20b2a8(0x155)]('-\x20'+_0x56534b[_0x20b2a8(0x163)]+_0x20b2a8(0x180))));console[_0x20b2a8(0x136)]('\x20\x20Source:\x20'+a31_0x3d693c[_0x20b2a8(0x14d)](_0x4ca8e9)+'\x0a');if(_0x404a3f['length']>0x0){console[_0x20b2a8(0x136)](_0x20b2a8(0x182));for(const _0xcf6525 of _0x404a3f){console[_0x20b2a8(0x136)]('\x20\x20'+a31_0x3d693c[_0x20b2a8(0x15d)]('+')+'\x20'+_0xcf6525);}console[_0x20b2a8(0x136)]('');}if(_0x3ac125[_0x20b2a8(0x163)]>0x0&&!_0x495573['journeysOnly'])for(const _0x53d27f of _0x3ac125){const _0x4d9f17=_0x53d27f['folderPath']?_0x53d27f[_0x20b2a8(0x113)]+'/'+_0x53d27f[_0x20b2a8(0x198)][_0x20b2a8(0x121)]:_0x53d27f[_0x20b2a8(0x198)][_0x20b2a8(0x121)],_0x4efcdc=_0x53d27f[_0x20b2a8(0x198)]['activations']?.['length']||0x0,_0x5dca33=_0x4efcdc>0x0?a31_0x3d693c[_0x20b2a8(0x160)]('\x20['+_0x4efcdc+_0x20b2a8(0x199)):'';console[_0x20b2a8(0x136)]('\x0a'+a31_0x3d693c['green']('New\x20segment:')+'\x20'+_0x4d9f17+_0x5dca33),console[_0x20b2a8(0x136)]('─'[_0x20b2a8(0x13e)](0x3c)),_0x53d27f['diff']&&console[_0x20b2a8(0x136)](_0x53d27f[_0x20b2a8(0x153)]),console[_0x20b2a8(0x136)]('─'[_0x20b2a8(0x13e)](0x3c));}if(_0x49187a[_0x20b2a8(0x163)]>0x0&&!_0x495573['journeysOnly'])for(const _0x2dbc0c of _0x49187a){const _0x24f9de=_0x2dbc0c[_0x20b2a8(0x13d)]?_0x4de47d[_0x20b2a8(0x149)](_0x2dbc0c['segmentFolderId']['toString']())||'':'',_0xc9f022=_0x24f9de?_0x24f9de+'/'+_0x2dbc0c['name']:_0x2dbc0c[_0x20b2a8(0x121)],_0xaf972e=_0x3932b5['get'](_0x2dbc0c['id'])||[],_0x5a11ee=_0xaf972e[_0x20b2a8(0x163)]>0x0?a31_0x3d693c['dim']('\x20['+_0xaf972e[_0x20b2a8(0x163)]+_0x20b2a8(0x199)):'';console[_0x20b2a8(0x136)]('\x0a'+a31_0x3d693c[_0x20b2a8(0x155)](_0x20b2a8(0x131))+'\x20'+_0xc9f022+_0x5a11ee),console['error']('─'[_0x20b2a8(0x13e)](0x3c));const _0x1dff90=segmentWithActivationsToYaml(_0x2dbc0c,_0xaf972e,undefined,_0x3d8ea7,_0x512c52),_0x4d106f=segmentToYamlString(_0x1dff90),_0x327275=generateDiff(_0x4d106f,'');console[_0x20b2a8(0x136)](formatDiffWithColors(_0x327275)),console['error']('─'[_0x20b2a8(0x13e)](0x3c));}const _0x490607=_0x1906c6['filter'](_0x1cc76e=>!_0x1cc76e[_0x20b2a8(0x197)]&&_0x1cc76e[_0x20b2a8(0x153)]);if(_0x490607[_0x20b2a8(0x163)]>0x0&&!_0x495573[_0x20b2a8(0x194)])for(const _0x332cb9 of _0x490607){const _0x4083f5=_0x332cb9[_0x20b2a8(0x113)]?_0x332cb9['folderPath']+'/'+_0x332cb9[_0x20b2a8(0x198)]['name']:_0x332cb9[_0x20b2a8(0x198)]['name'];console[_0x20b2a8(0x136)]('\x0a'+a31_0x3d693c[_0x20b2a8(0x187)](_0x20b2a8(0x19a))+'\x20'+_0x4083f5),console['error']('─'[_0x20b2a8(0x13e)](0x3c)),console[_0x20b2a8(0x136)](_0x332cb9['diff']),console[_0x20b2a8(0x136)]('─'[_0x20b2a8(0x13e)](0x3c));}if(_0x27b55f[_0x20b2a8(0x163)]>0x0)for(const _0x4aa8d3 of _0x27b55f){const _0x25fda5=_0x4aa8d3[_0x20b2a8(0x113)]?_0x4aa8d3[_0x20b2a8(0x113)]+'/'+_0x4aa8d3[_0x20b2a8(0x198)][_0x20b2a8(0x121)]:_0x4aa8d3[_0x20b2a8(0x198)][_0x20b2a8(0x121)];console[_0x20b2a8(0x136)]('\x0a'+a31_0x3d693c['green'](_0x20b2a8(0x171))+'\x20'+_0x25fda5),console[_0x20b2a8(0x136)]('─'[_0x20b2a8(0x13e)](0x3c)),_0x4aa8d3[_0x20b2a8(0x153)]&&console[_0x20b2a8(0x136)](_0x4aa8d3[_0x20b2a8(0x153)]),console[_0x20b2a8(0x136)]('─'[_0x20b2a8(0x13e)](0x3c));}const _0x4ddeef=_0x510dc7[_0x20b2a8(0x10a)](_0x1b04aa=>!_0x1b04aa[_0x20b2a8(0x197)]&&_0x1b04aa[_0x20b2a8(0x153)]);if(_0x4ddeef[_0x20b2a8(0x163)]>0x0)for(const _0x81e32 of _0x4ddeef){const _0x4d6251=_0x81e32['folderPath']?_0x81e32['folderPath']+'/'+_0x81e32[_0x20b2a8(0x198)][_0x20b2a8(0x121)]:_0x81e32[_0x20b2a8(0x198)][_0x20b2a8(0x121)];console[_0x20b2a8(0x136)]('\x0a'+a31_0x3d693c[_0x20b2a8(0x187)](_0x20b2a8(0x10e))+'\x20'+_0x4d6251),console[_0x20b2a8(0x136)]('─'[_0x20b2a8(0x13e)](0x3c)),console[_0x20b2a8(0x136)](_0x81e32[_0x20b2a8(0x153)]),console[_0x20b2a8(0x136)]('─'[_0x20b2a8(0x13e)](0x3c));}if(_0x1c558c[_0x20b2a8(0x163)]>0x0)for(const _0x46bb71 of _0x1c558c){const _0x18e0b0=_0x46bb71['folderId']?_0x4de47d['get'](_0x46bb71[_0x20b2a8(0x190)])||'':'',_0x3e5574=_0x18e0b0?_0x18e0b0+'/'+_0x46bb71[_0x20b2a8(0x127)]:_0x46bb71['journeyBundleName'];console[_0x20b2a8(0x136)]('\x0a'+a31_0x3d693c[_0x20b2a8(0x155)](_0x20b2a8(0x122))+'\x20'+_0x3e5574),console[_0x20b2a8(0x136)]('─'[_0x20b2a8(0x13e)](0x3c)),console['error'](a31_0x3d693c[_0x20b2a8(0x155)](_0x20b2a8(0x129))),console['error']('─'[_0x20b2a8(0x13e)](0x3c));}if(_0x495573[_0x20b2a8(0x118)])return console['error'](a31_0x3d693c[_0x20b2a8(0x187)](_0x20b2a8(0x175))),0x0;const _0x3f533d=_0x495573[_0x20b2a8(0x194)]?![]:_0x3ac125[_0x20b2a8(0x163)]>0x0||_0x19c9d5[_0x20b2a8(0x163)]>0x0||_0x49187a[_0x20b2a8(0x163)]>0x0,_0x1da60e=_0x27b55f[_0x20b2a8(0x163)]>0x0||_0x525f00[_0x20b2a8(0x163)]>0x0||_0x1c558c[_0x20b2a8(0x163)]>0x0,_0x4ceb13=_0x495573[_0x20b2a8(0x194)]?![]:_0x486899['length']>0x0,_0x136a7f=_0x404a3f[_0x20b2a8(0x163)]>0x0;if(!_0x3f533d&&!_0x1da60e&&!_0x4ceb13&&!_0x136a7f){const _0x2c45c7=_0x495573[_0x20b2a8(0x194)]?_0x20b2a8(0x1a7):_0x20b2a8(0x11a);console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x16c)](_0x2c45c7));if(_0x2ee43e&&_0x26b0ac[_0x20b2a8(0x163)]===0x1){const _0x1c8cff=_0x26b0ac[0x0];if(_0x1c8cff[_0x20b2a8(0x139)]?.['id']){const _0xec349f=getConsoleNextUrl(_0x495573[_0x20b2a8(0x14f)],_0x20b2a8(0x13a)+_0x3d68e4+_0x20b2a8(0x195)+_0x1c8cff['existingJourney']['id']+_0x20b2a8(0x167));console[_0x20b2a8(0x136)]('\x20\x20'+a31_0x3d693c[_0x20b2a8(0x14d)](_0xec349f));}}return 0x0;}const _0x5cf882=_0x495573['journeysOnly']?_0x27b55f['length']+_0x525f00['length']+_0x1c558c[_0x20b2a8(0x163)]+_0x404a3f[_0x20b2a8(0x163)]:_0x3ac125[_0x20b2a8(0x163)]+_0x19c9d5[_0x20b2a8(0x163)]+_0x49187a['length']+_0x27b55f[_0x20b2a8(0x163)]+_0x525f00[_0x20b2a8(0x163)]+_0x1c558c[_0x20b2a8(0x163)]+_0x404a3f['length']+_0x486899[_0x20b2a8(0x163)];if(!_0x495573[_0x20b2a8(0x15c)]&&_0x5cf882>0x0){if(!isInteractive())return console[_0x20b2a8(0x136)](a31_0x3d693c['red'](_0x20b2a8(0x125)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20b2a8(0x136)](a31_0x3d693c['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x12e77f=await confirmKey(_0x20b2a8(0x17a)+_0x5cf882+_0x20b2a8(0x14c));if(!_0x12e77f)return console['error'](a31_0x3d693c['yellow'](_0x20b2a8(0x18a))),0x1;}const _0x5f2bd2={'withProgress':async(_0x1ac9f4,_0x1015ef)=>{const _0x20762e=_0x20b2a8,_0x2e805c=await withSpinner(_0x1ac9f4,_0x1015ef,{'verbose':_0x495573[_0x20762e(0x116)]});return{'data':_0x2e805c[_0x20762e(0x132)]};},'logInfo':_0x226882=>console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x15d)]('βœ”\x20'+_0x226882)),'logSuccess':_0x49b4be=>console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x16c)]('βœ”\x20'+_0x49b4be)),'logWarning':_0x2f755d=>console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x187)]('⚠\x20'+_0x2f755d)),'logDeleted':_0xe4cd7c=>console['error'](a31_0x3d693c[_0x20b2a8(0x155)]('βœ”\x20'+_0xe4cd7c))},_0x52ef51={'segment':_0x3bca[_0x20b2a8(0x123)],'journey':_0x3bca['journey'],'user':_0x3bca[_0x20b2a8(0x11f)],'connection':_0x3bca['connection']};_0x404a3f[_0x20b2a8(0x163)]>0x0&&(_0x5760d5=await executePushFolders(_0x52ef51,_0x404a3f,_0x5760d5,{'parentId':_0x3d68e4},_0x5f2bd2));const _0x1cc299={'rootFolderId':_0xd11493,'folderPathToId':_0x5760d5,'folderIdToPath':_0x4de47d,'segmentNameToId':_0x56b709,'activationsBySegmentId':_0x3932b5,'emailToIdMap':_0x55fe7e,'idToEmailMap':_0x3d8ea7,'connectionNameToIdMap':_0xb391bd[_0x20b2a8(0x19c)],'connectionIdToNameMap':_0xb391bd[_0x20b2a8(0x176)],'connectionNameToTypeMap':_0x5ebf09},_0x27c1dc=await executePushSegments(_0x52ef51,_0x495573[_0x20b2a8(0x194)]?[]:_0x1906c6,_0x1cc299,{'parentId':_0x3d68e4},_0x5f2bd2),_0xdbb0be=_0x27c1dc[_0x20b2a8(0x177)],_0x486657=_0x27c1dc[_0x20b2a8(0x141)],_0x54b1c5=_0x27c1dc[_0x20b2a8(0x185)][_0x20b2a8(0x177)],_0x202466=_0x27c1dc[_0x20b2a8(0x185)]['updated'],_0x5b919e=_0x27c1dc['activations'][_0x20b2a8(0x158)],_0x47e73f=await executePushSegmentDeletions(_0x52ef51,_0x495573[_0x20b2a8(0x194)]?[]:_0x49187a,_0x5f2bd2);let _0x2afebb=0x0,_0x567166=0x0,_0x4a2993=0x0;const _0x1c13f7=new Map(_0x56b709);for(const [_0x2055b2,_0x30c575]of _0x27c1dc['createdSegmentIds']){_0x1c13f7[_0x20b2a8(0x1a4)](_0x2055b2,_0x30c575);}if(_0x510dc7[_0x20b2a8(0x163)]>0x0){const _0x4816bb={..._0x1cc299,'segmentNameToId':_0x1c13f7,'existingSegments':_0x23eb25,'activationContext':_0x22a177},_0xa59e71=await executePushJourneys(_0x52ef51,_0x510dc7,_0x4816bb,{'parentId':_0x3d68e4,'rootFolderId':_0xd11493,'verbose':_0x495573[_0x20b2a8(0x116)]},_0x5f2bd2);_0x2afebb=_0xa59e71[_0x20b2a8(0x177)],_0x567166=_0xa59e71[_0x20b2a8(0x141)];if(_0x2ee43e&&_0xa59e71[_0x20b2a8(0x162)][_0x20b2a8(0x163)]===0x1){const _0x477584=_0xa59e71[_0x20b2a8(0x162)][0x0];if(_0x477584['journeyId']){const _0x380373=getConsoleNextUrl(_0x495573['site'],_0x20b2a8(0x13a)+_0x3d68e4+_0x20b2a8(0x195)+_0x477584['journeyId']+_0x20b2a8(0x167));console['error']('\x20\x20'+a31_0x3d693c[_0x20b2a8(0x14d)](_0x380373));}}}for(const _0x5c0767 of _0x1c558c){console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x187)](_0x20b2a8(0x10b)+_0x5c0767[_0x20b2a8(0x127)])),_0x4a2993++;}const _0xb34280=[];if(_0xdbb0be>0x0)_0xb34280['push'](_0xdbb0be+_0x20b2a8(0x179));if(_0x486657>0x0)_0xb34280['push'](_0x486657+_0x20b2a8(0x13f));if(_0x47e73f>0x0)_0xb34280[_0x20b2a8(0x13b)](_0x47e73f+'\x20deleted');const _0x28830e=[];if(_0x2afebb>0x0)_0x28830e[_0x20b2a8(0x13b)](_0x2afebb+_0x20b2a8(0x179));if(_0x567166>0x0)_0x28830e[_0x20b2a8(0x13b)](_0x567166+_0x20b2a8(0x13f));if(_0x4a2993>0x0)_0x28830e[_0x20b2a8(0x13b)](_0x4a2993+_0x20b2a8(0x15e));const _0x4aec03=[];if(_0x54b1c5>0x0)_0x4aec03['push'](_0x54b1c5+_0x20b2a8(0x179));if(_0x202466>0x0)_0x4aec03[_0x20b2a8(0x13b)](_0x202466+_0x20b2a8(0x13f));if(_0x5b919e>0x0)_0x4aec03[_0x20b2a8(0x13b)](_0x5b919e+_0x20b2a8(0x15e));return console[_0x20b2a8(0x136)](a31_0x3d693c[_0x20b2a8(0x16c)]('\x0aβœ”\x20Push\x20complete')),_0xb34280['length']>0x0&&!_0x495573[_0x20b2a8(0x194)]&&console[_0x20b2a8(0x136)](_0x20b2a8(0x19d)+_0xb34280[_0x20b2a8(0x15b)](',\x20')),_0x28830e[_0x20b2a8(0x163)]>0x0&&console[_0x20b2a8(0x136)](_0x20b2a8(0x152)+_0x28830e[_0x20b2a8(0x15b)](',\x20')),_0x4aec03[_0x20b2a8(0x163)]>0x0&&!_0x495573[_0x20b2a8(0x194)]&&console[_0x20b2a8(0x136)](_0x20b2a8(0x145)+_0x4aec03[_0x20b2a8(0x15b)](',\x20')),0x0;}}
1
+ const a31_0x4c8f1d=a31_0x1223;(function(_0x446138,_0x3ebc16){const _0x13db5b=a31_0x1223,_0x495e1c=_0x446138();while(!![]){try{const _0x14edb9=parseInt(_0x13db5b(0x184))/0x1+-parseInt(_0x13db5b(0x1a2))/0x2+-parseInt(_0x13db5b(0x209))/0x3*(parseInt(_0x13db5b(0x1d0))/0x4)+-parseInt(_0x13db5b(0x1f5))/0x5*(-parseInt(_0x13db5b(0x183))/0x6)+-parseInt(_0x13db5b(0x18b))/0x7*(parseInt(_0x13db5b(0x17a))/0x8)+-parseInt(_0x13db5b(0x189))/0x9*(parseInt(_0x13db5b(0x1dc))/0xa)+parseInt(_0x13db5b(0x1c3))/0xb*(parseInt(_0x13db5b(0x188))/0xc);if(_0x14edb9===_0x3ebc16)break;else _0x495e1c['push'](_0x495e1c['shift']());}catch(_0x14eb30){_0x495e1c['push'](_0x495e1c['shift']());}}}(a31_0x8a9b,0xb503f));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_0x1a65e1 from'chalk';import{existsSync}from'fs';function a31_0x1223(_0x23c092,_0x42ee73){_0x23c092=_0x23c092-0x175;const _0x8a9b61=a31_0x8a9b();let _0x122303=_0x8a9b61[_0x23c092];return _0x122303;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a31_0x8a9b(){const _0x1eb3fc=['journeyId','6483016lOdzgz','Changes\x20to\x20journey:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Push\x20','changed','green','paused','\x20YAML\x20files\x20found','\x20to\x20delete','3585522bHYABj','698381vJtblz','list','toDelete','delete','24EtfJqL','315AZUCBs','\x27...','7ZKUhXD','folderPath','New\x20journey:','\x20unchanged','created','\x0aValidation\x20failed:','yamlConfig','\x20deleted','\x20changed','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)','updated','(Journey\x20will\x20be\x20deleted)','join','Fetching\x20existing\x20folders...','\x20\x20\x20\x20','segment','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','data','segment\x20or\x20journey','targetDir','journeyBundleId','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Delete\x20segment:','2225120JNCbhK','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','connection','getOutputSchemaWithCache','new','journeyBundleName','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','diff','\x20folders\x20to\x20create','description','get','attributes','blue','Site:\x20','Source\x20directory:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segmentFolderId','isScoped','errorCode','type','length','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Fetching\x20existing\x20activations...','idToName','Fetching\x20connections\x20for\x20name\x20resolution...','parentFolder','file','Resolving\x20parent\x20segment\x20\x27','push','createdSegmentIds','map','createdAt','\x20changes?','12761683zRvJoz','yellow','yes','/app/ps/','name','dim','no_parent','filter','journey','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parent_name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','journeys','560VNDvQu','\x0aPush\x20summary\x20for\x20\x27','\x20new','segments','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','nameToId','getParent','Fetching\x20existing\x20journeys...','filePath','segment:push','site','.yml','163310OXPRYC','parentName','activations','\x0aβœ”\x20Push\x20complete','New\x20segment:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','verbose','\x20to\x20create','parentSegment','repeat','cyan','Error\x20parsing\x20YAML:\x20','red','No\x20','Delete\x20journey:','message','\x20\x20Activations:','.yaml','\x20\x20Source:\x20','/e/','listJourneysWithDetailsFromParentSegment','Error:\x20Directory\x20not\x20found:\x20','helpText','dryRun','then','10mhvxSG','isNew','nameToType','\x20created','toString','updatedAt','existingJourney','\x20updated','audienceId','cwd','setPhase','\x20\x20Activations:\x20','state','scopedFolderPath','\x20activations]','Error:\x20','execute','error','endsWith','listFolders','20955MwlZfO','\x20\x20πŸ“Š\x20Segments:','all','user','journeysOnly','deleted','Folders\x20to\x20create:'];a31_0x8a9b=function(){return _0x1eb3fc;};return a31_0x8a9b();}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_0x4c8f1d(0x1c7)]=a31_0x4c8f1d(0x1d9);[a31_0x4c8f1d(0x1ab)]=a31_0x4c8f1d(0x1a0);async[a31_0x4c8f1d(0x205)](_0x19032e){const _0x15fe5c=a31_0x4c8f1d,{options:_0x7a161c,args:_0x446e41,tdx:_0x576f2d}=_0x19032e,_0x422ad6=_0x7a161c,_0x3fa8fd=await resolveTarget({'arg':_0x446e41[0x0],'contextParent':_0x7a161c[_0x15fe5c(0x1e4)],'cwd':process[_0x15fe5c(0x1fe)]()});if(!isSuccessfulResolution(_0x3fa8fd))return _0x3fa8fd[_0x15fe5c(0x1b4)]===_0x15fe5c(0x1c9)?(console['error'](a31_0x1a65e1['yellow'](_0x15fe5c(0x1a3))),console[_0x15fe5c(0x206)](_0x15fe5c(0x194)),console[_0x15fe5c(0x206)](_0x15fe5c(0x1ce)),console[_0x15fe5c(0x206)]('\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_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x204)+_0x3fa8fd[_0x15fe5c(0x1eb)]+'\x0a')),_0x3fa8fd['helpText']&&console['error'](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x3fa8fd[_0x15fe5c(0x1f2)]))),0x1;if(_0x3fa8fd[_0x15fe5c(0x1b5)]===_0x15fe5c(0x1cd))return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3fa8fd['targetDir']+'\x0a')),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x15fe5c(0x1a8))),0x1;const _0x21f0a4=_0x3fa8fd[_0x15fe5c(0x1dd)],_0x3a82cb=_0x3fa8fd[_0x15fe5c(0x19e)],_0xd54682=_0x3fa8fd['type']===_0x15fe5c(0x1bc)?_0x3fa8fd[_0x15fe5c(0x1d8)]:undefined,_0x520e29=getScopedDetails(_0x3fa8fd),_0x17f431=_0x520e29?.[_0x15fe5c(0x1b3)]??![],_0x23d614=_0x520e29?.[_0x15fe5c(0x202)]??'';if(!existsSync(_0x3a82cb))return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1f1)+_0x3a82cb+'\x0a')),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x15fe5c(0x1a8))),0x1;_0x422ad6[_0x15fe5c(0x1e2)]&&(console[_0x15fe5c(0x206)](_0x15fe5c(0x1af)+_0x422ad6[_0x15fe5c(0x1da)]),console[_0x15fe5c(0x206)]('Parent\x20segment:\x20'+_0x21f0a4),console[_0x15fe5c(0x206)](_0x15fe5c(0x1b0)+_0x3a82cb),_0x17f431&&console[_0x15fe5c(0x206)]('Scoped\x20to\x20folder:\x20'+_0x23d614));const _0x3b9067=await withSpinner(_0x15fe5c(0x1bd)+_0x21f0a4+_0x15fe5c(0x18a),()=>_0x576f2d[_0x15fe5c(0x19a)]['resolveParentId'](_0x21f0a4),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),_0xb30465=_0x3b9067['data'],[_0x4020cf,_0x2e4b1a,_0x232991,_0x4ff5ef,_0x3e3bc6]=await Promise[_0x15fe5c(0x20b)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x576f2d[_0x15fe5c(0x19a)][_0x15fe5c(0x1d6)](_0xb30465),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x576f2d[_0x15fe5c(0x19a)]['listSegments'](_0xb30465),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner(_0x15fe5c(0x198),()=>_0x576f2d['segment'][_0x15fe5c(0x208)](_0xb30465),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner(_0x15fe5c(0x1d7),()=>_0x576f2d[_0x15fe5c(0x1cb)][_0x15fe5c(0x1f0)](_0xb30465,{'includeAllVersions':!![]}),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x576f2d[_0x15fe5c(0x175)]['buildUserMaps'](),{'verbose':_0x422ad6['verbose']})[_0x15fe5c(0x1f4)](_0x39d752=>_0x39d752[_0x15fe5c(0x19c)])]),_0x504ad1=_0x4020cf[_0x15fe5c(0x19c)],_0x34dade=extractRootFolderId(_0x504ad1),_0x599cdf=_0x2e4b1a[_0x15fe5c(0x19c)],_0x2cb2cc=_0x232991[_0x15fe5c(0x19c)],{journeys:_0x444a02,activationStepsById:_0x43da4a}=_0x4ff5ef[_0x15fe5c(0x19c)],_0x4c06db=new Map(_0x444a02['map'](_0x2ba83b=>[_0x2ba83b['id'],_0x2ba83b])),_0x6ca23d=_0x444a02[_0x15fe5c(0x1c0)](_0x12ac0e=>({'id':_0x12ac0e['id'],'name':_0x12ac0e['attributes'][_0x15fe5c(0x1c7)],'journeyBundleName':_0x12ac0e[_0x15fe5c(0x1ad)]['journeyBundleName']||'','journeyBundleId':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x19f)]||'','versionNumber':_0x12ac0e['attributes']['versionNumber'],'description':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1ab)],'state':_0x12ac0e['attributes'][_0x15fe5c(0x201)],'paused':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x180)],'audienceId':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1fd)],'folderId':_0x12ac0e['relationships']?.[_0x15fe5c(0x1bb)]?.[_0x15fe5c(0x19c)]?.['id'],'createdAt':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1c1)],'updatedAt':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1fa)]})),{emailToId:_0x572b7f,idToEmail:_0x38bfad}=_0x3e3bc6,_0xe652b1=await withSpinner(_0x15fe5c(0x1ba),async()=>{const _0x272d69=_0x15fe5c,_0x1d4866=await _0x576f2d[_0x272d69(0x1a4)][_0x272d69(0x185)]();return buildConnectionMaps(_0x1d4866);},{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]})[_0x15fe5c(0x1f4)](_0x2b6c54=>_0x2b6c54[_0x15fe5c(0x19c)]),_0x350bd6=_0xe652b1['nameToId'],_0x577d77=_0xe652b1['idToName'],_0x548cef=_0xe652b1[_0x15fe5c(0x1f7)],_0x4a1e37={'emailToIdMap':_0x572b7f,'connectionNameToIdMap':_0x350bd6,'connectionNameToTypeMap':_0x548cef,'getSchema':_0x38fc72=>_0x576f2d[_0x15fe5c(0x1a4)][_0x15fe5c(0x1a5)](_0x38fc72)};let {pathToId:_0xd114e,idToPath:_0x1ce742}=buildFolderMaps(_0x2cb2cc);const _0x48d677=buildSegmentLookupMap(_0x599cdf,_0x1ce742),_0x275b9a=buildSegmentNameToIdMap(_0x599cdf),_0x141f0e=buildJourneyBundleLookupMap(_0x6ca23d,_0x1ce742);let _0x24e490;if(_0xd54682){if(!_0xd54682[_0x15fe5c(0x207)](_0x15fe5c(0x1db))&&!_0xd54682[_0x15fe5c(0x207)](_0x15fe5c(0x1ed)))return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x17c)+_0xd54682+'\x0a')),0x1;_0x24e490=[_0xd54682];}else _0x24e490=findYamlFiles(_0x3a82cb);if(_0x24e490[_0x15fe5c(0x1b6)]===0x0)return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x3a82cb+'\x0a')),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x15fe5c(0x1b7))),0x1;let _0x2be9a5,_0x1edbe5;try{const _0x49542a=parseAndClassifyYamlFiles(_0x24e490,_0x3a82cb,{'skipSegments':_0x422ad6[_0x15fe5c(0x176)]});_0x2be9a5=_0x49542a[_0x15fe5c(0x1d3)],_0x1edbe5=_0x49542a[_0x15fe5c(0x1cf)];const _0x3b61f5=validateParsedFiles(_0x49542a,_0x3a82cb);if(_0x3b61f5[_0x15fe5c(0x1b6)]>0x0)return console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x190))),console[_0x15fe5c(0x206)](formatValidationErrors(_0x3b61f5)),console['error'](a31_0x1a65e1['yellow'](_0x15fe5c(0x1d4))),0x1;}catch(_0x1412ce){return console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1e7)+(_0x1412ce instanceof Error?_0x1412ce[_0x15fe5c(0x1eb)]:_0x1412ce))),0x1;}if(_0x2be9a5['length']===0x0&&_0x1edbe5['length']===0x0){const _0x388342=_0x422ad6[_0x15fe5c(0x176)]?_0x15fe5c(0x1cb):_0x15fe5c(0x19d);return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c4)](_0x15fe5c(0x1e9)+_0x388342+_0x15fe5c(0x181))),0x0;}const _0x16e2f5=new Map();_0x599cdf[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&await withSpinner(_0x15fe5c(0x1b8),async()=>{await batchAsync(_0x599cdf,async _0x222247=>{const _0x1bdc19=a31_0x1223,_0x3a870a=await _0x576f2d[_0x1bdc19(0x19a)]['listActivations'](_0xb30465,_0x222247['id']);_0x16e2f5['set'](_0x222247['id'],_0x3a870a);});},{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]});const {segmentFiles:_0x2fb2da,foldersToCreate:_0x38d5fb}=await prepareSegmentFiles(_0x2be9a5,{'segmentByFolderAndName':_0x48d677,'activationsBySegmentId':_0x16e2f5,'folderPathToId':_0xd114e,'idToEmailMap':_0x38bfad,'connectionIdToNameMap':_0x577d77},_0x4a1e37,_0x17f431,_0x23d614),_0x4a92a7=_0xd54682?[]:findSegmentsToDelete(_0x599cdf,_0x2be9a5[_0x15fe5c(0x1c0)](({yamlConfig:_0x59e238,folderPath:_0x47b299})=>({'yamlConfig':_0x59e238,'folderPath':resolveTDFolderPath(_0x47b299,_0x17f431,_0x23d614)})),_0x1ce742,_0x23d614,_0x17f431),{journeyFiles:_0x269e75,foldersToCreate:_0x2a45d7}=await withProgressSpinner('Preparing\x20journeys...',async _0x397f2f=>prepareJourneyFiles(_0x1edbe5,{'fetchJourney':async _0x2dbac8=>_0x576f2d[_0x15fe5c(0x1cb)]['getJourney'](_0x2dbac8[_0x15fe5c(0x179)]),'journeyBundlesByFolderAndName':_0x141f0e,'folderPathToId':_0xd114e,'idToEmailMap':_0x38bfad,'connectionIdToNameMap':_0x577d77,'existingSegments':_0x599cdf,'parentId':_0xb30465,'deps':_0x576f2d,'progress':{'update':_0xb3f395=>{const _0xc21c9f=_0x15fe5c;_0x397f2f[_0xc21c9f(0x1ff)](_0xb3f395),_0x422ad6[_0xc21c9f(0x1e2)]&&console[_0xc21c9f(0x206)]('\x20\x20'+_0xb3f395);}},'journeyById':_0x4c06db,'activationStepsById':_0x43da4a},_0x17f431,_0x23d614),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]})[_0x15fe5c(0x1f4)](_0x2e7a41=>_0x2e7a41[_0x15fe5c(0x19c)]);for(const _0x3d931e of _0x2a45d7){_0x38d5fb['add'](_0x3d931e);}const _0x5d9cf9=_0xd54682?[]:findJourneysToDelete(_0x6ca23d,_0x1edbe5['map'](({yamlConfig:_0x14cd4a,folderPath:_0x561c18})=>({'yamlConfig':_0x14cd4a,'folderPath':resolveTDFolderPath(_0x561c18,_0x17f431,_0x23d614)})),_0x1ce742,_0x23d614,_0x17f431),_0x4f1c74=calculatePushStats(_0x2fb2da,_0x269e75,_0x38d5fb,_0x4a92a7,_0x5d9cf9,!!_0x422ad6[_0x15fe5c(0x187)],!!_0x422ad6['journeysOnly']),_0x5c5729=_0x4f1c74[_0x15fe5c(0x1d3)][_0x15fe5c(0x1a6)],_0xc1e05e=_0x4f1c74[_0x15fe5c(0x1d3)]['changed'],_0x5ebf23=_0x4f1c74['segments']['unchanged'],_0x575d00=_0x4f1c74['segments'][_0x15fe5c(0x186)],_0x4272b9=_0x4f1c74['folders']['toCreate'],_0xf32274=_0x4f1c74['journeys'][_0x15fe5c(0x1a6)],_0x975a7c=_0x4f1c74[_0x15fe5c(0x1cf)][_0x15fe5c(0x17e)],_0x4e925b=_0x4f1c74[_0x15fe5c(0x1cf)]['unchanged'],_0x2c2e7f=_0x4f1c74[_0x15fe5c(0x1cf)]['toDelete'],_0x3d09e5=_0x4f1c74[_0x15fe5c(0x1de)][_0x15fe5c(0x20b)],_0x44e731=_0x4f1c74[_0x15fe5c(0x1de)]['toCreate'],_0x12e97c=_0x4f1c74[_0x15fe5c(0x1de)]['toUpdate'],_0x6c4c5b=_0x4f1c74[_0x15fe5c(0x1de)][_0x15fe5c(0x186)];console[_0x15fe5c(0x206)](_0x15fe5c(0x1d1)+_0x21f0a4+'\x27:');_0x4272b9['length']>0x0&&console['error']('\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1ae)]('πŸ“\x20'+_0x4272b9[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1aa)));if(!_0x422ad6[_0x15fe5c(0x176)]){console['error'](_0x15fe5c(0x20a)),console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x17f)]('+\x20'+_0x5c5729[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1d2))),console['error'](_0x15fe5c(0x199)+a31_0x1a65e1['yellow']('~\x20'+_0xc1e05e['length']+'\x20changed'));if(_0x575d00[_0x15fe5c(0x1b6)]>0x0)console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1e8)]('-\x20'+_0x575d00[_0x15fe5c(0x1b6)]+'\x20to\x20delete'));else _0x4a92a7[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x187)]&&console['error'](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c8)](_0x4a92a7[_0x15fe5c(0x1b6)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error']('\x20\x20\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1c8)]('=\x20'+_0x5ebf23['length']+_0x15fe5c(0x18e)));}if(_0x269e75['length']>0x0||_0x5d9cf9[_0x15fe5c(0x1b6)]>0x0){console[_0x15fe5c(0x206)](_0x15fe5c(0x19b)),console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x17f)]('+\x20'+_0xf32274[_0x15fe5c(0x1b6)]+'\x20new')),console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c4)]('~\x20'+_0x975a7c[_0x15fe5c(0x1b6)]+_0x15fe5c(0x193)));if(_0x2c2e7f[_0x15fe5c(0x1b6)]>0x0)console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1e8)]('-\x20'+_0x2c2e7f['length']+_0x15fe5c(0x182)));else _0x5d9cf9[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x187)]&&console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c8)](_0x5d9cf9[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1b1)));console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1['dim']('=\x20'+_0x4e925b[_0x15fe5c(0x1b6)]+_0x15fe5c(0x18e)));}_0x3d09e5[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&(console[_0x15fe5c(0x206)](''),console[_0x15fe5c(0x206)](_0x15fe5c(0x1ec)),_0x44e731['length']>0x0&&console['error']('\x20\x20\x20\x20'+a31_0x1a65e1['green']('+\x20'+_0x44e731[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1e3))),_0x12e97c[_0x15fe5c(0x1b6)]>0x0&&console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c4)]('~\x20'+_0x12e97c[_0x15fe5c(0x1b6)]+'\x20to\x20update')),_0x6c4c5b[_0x15fe5c(0x1b6)]>0x0&&console[_0x15fe5c(0x206)]('\x20\x20\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1e8)]('-\x20'+_0x6c4c5b['length']+_0x15fe5c(0x182))));console[_0x15fe5c(0x206)](_0x15fe5c(0x1ee)+a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x3a82cb)+'\x0a');if(_0x4272b9[_0x15fe5c(0x1b6)]>0x0){console[_0x15fe5c(0x206)](_0x15fe5c(0x178));for(const _0x4ea13e of _0x4272b9){console[_0x15fe5c(0x206)]('\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1ae)]('+')+'\x20'+_0x4ea13e);}console['error']('');}if(_0x5c5729[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)])for(const _0x591d22 of _0x5c5729){const _0x409def=_0x591d22[_0x15fe5c(0x18c)]?_0x591d22[_0x15fe5c(0x18c)]+'/'+_0x591d22['yamlConfig'][_0x15fe5c(0x1c7)]:_0x591d22[_0x15fe5c(0x191)][_0x15fe5c(0x1c7)],_0x498807=_0x591d22['yamlConfig']['activations']?.[_0x15fe5c(0x1b6)]||0x0,_0x4ab1e6=_0x498807>0x0?a31_0x1a65e1[_0x15fe5c(0x1c8)]('\x20['+_0x498807+_0x15fe5c(0x203)):'';console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x17f)](_0x15fe5c(0x1e0))+'\x20'+_0x409def+_0x4ab1e6),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c)),_0x591d22[_0x15fe5c(0x1a9)]&&console['error'](_0x591d22[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c));}if(_0x575d00[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)])for(const _0x5ca8a0 of _0x575d00){const _0x1826bf=_0x5ca8a0[_0x15fe5c(0x1b2)]?_0x1ce742[_0x15fe5c(0x1ac)](_0x5ca8a0[_0x15fe5c(0x1b2)][_0x15fe5c(0x1f9)]())||'':'',_0x47b703=_0x1826bf?_0x1826bf+'/'+_0x5ca8a0[_0x15fe5c(0x1c7)]:_0x5ca8a0[_0x15fe5c(0x1c7)],_0x4ae487=_0x16e2f5[_0x15fe5c(0x1ac)](_0x5ca8a0['id'])||[],_0x4bfbd7=_0x4ae487[_0x15fe5c(0x1b6)]>0x0?a31_0x1a65e1[_0x15fe5c(0x1c8)]('\x20['+_0x4ae487[_0x15fe5c(0x1b6)]+'\x20activations]'):'';console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1a1))+'\x20'+_0x47b703+_0x4bfbd7),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));const _0x4b842c=segmentWithActivationsToYaml(_0x5ca8a0,_0x4ae487,undefined,_0x38bfad,_0x577d77),_0x192223=segmentToYamlString(_0x4b842c),_0x3671b8=generateDiff(_0x192223,'');console['error'](formatDiffWithColors(_0x3671b8)),console['error']('─'[_0x15fe5c(0x1e5)](0x3c));}const _0x199f88=_0x2fb2da[_0x15fe5c(0x1ca)](_0xe190b0=>!_0xe190b0['isNew']&&_0xe190b0['diff']);if(_0x199f88[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6['journeysOnly'])for(const _0x13d532 of _0x199f88){const _0x31385b=_0x13d532[_0x15fe5c(0x18c)]?_0x13d532[_0x15fe5c(0x18c)]+'/'+_0x13d532[_0x15fe5c(0x191)][_0x15fe5c(0x1c7)]:_0x13d532['yamlConfig'][_0x15fe5c(0x1c7)];console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x1c4)]('Changes\x20to:')+'\x20'+_0x31385b),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c)),console[_0x15fe5c(0x206)](_0x13d532[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));}if(_0xf32274['length']>0x0)for(const _0x3dca01 of _0xf32274){const _0x4fbf70=_0x3dca01[_0x15fe5c(0x18c)]?_0x3dca01[_0x15fe5c(0x18c)]+'/'+_0x3dca01[_0x15fe5c(0x191)][_0x15fe5c(0x1c7)]:_0x3dca01['yamlConfig'][_0x15fe5c(0x1c7)];console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x17f)](_0x15fe5c(0x18d))+'\x20'+_0x4fbf70),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c)),_0x3dca01[_0x15fe5c(0x1a9)]&&console[_0x15fe5c(0x206)](_0x3dca01[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));}const _0x27a919=_0x269e75['filter'](_0x707190=>!_0x707190[_0x15fe5c(0x1f6)]&&_0x707190[_0x15fe5c(0x1a9)]);if(_0x27a919[_0x15fe5c(0x1b6)]>0x0)for(const _0x395ff4 of _0x27a919){const _0x3b7905=_0x395ff4[_0x15fe5c(0x18c)]?_0x395ff4[_0x15fe5c(0x18c)]+'/'+_0x395ff4[_0x15fe5c(0x191)]['name']:_0x395ff4[_0x15fe5c(0x191)]['name'];console['error']('\x0a'+a31_0x1a65e1['yellow'](_0x15fe5c(0x17b))+'\x20'+_0x3b7905),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c)),console[_0x15fe5c(0x206)](_0x395ff4[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c));}if(_0x2c2e7f['length']>0x0)for(const _0xbe8165 of _0x2c2e7f){const _0x10188b=_0xbe8165['folderId']?_0x1ce742[_0x15fe5c(0x1ac)](_0xbe8165['folderId'])||'':'',_0x5bf7a4=_0x10188b?_0x10188b+'/'+_0xbe8165[_0x15fe5c(0x1a7)]:_0xbe8165['journeyBundleName'];console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1ea))+'\x20'+_0x5bf7a4),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c)),console[_0x15fe5c(0x206)](a31_0x1a65e1['red'](_0x15fe5c(0x196))),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));}if(_0x422ad6[_0x15fe5c(0x1f3)])return console['error'](a31_0x1a65e1['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x442a38=_0x422ad6[_0x15fe5c(0x176)]?![]:_0x5c5729[_0x15fe5c(0x1b6)]>0x0||_0xc1e05e[_0x15fe5c(0x1b6)]>0x0||_0x575d00['length']>0x0,_0x577676=_0xf32274[_0x15fe5c(0x1b6)]>0x0||_0x975a7c[_0x15fe5c(0x1b6)]>0x0||_0x2c2e7f[_0x15fe5c(0x1b6)]>0x0,_0x1fbb3a=_0x422ad6[_0x15fe5c(0x176)]?![]:_0x3d09e5['length']>0x0,_0x3c8539=_0x4272b9[_0x15fe5c(0x1b6)]>0x0;if(!_0x442a38&&!_0x577676&&!_0x1fbb3a&&!_0x3c8539){const _0x216bdb=_0x422ad6[_0x15fe5c(0x176)]?'βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date':'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x17f)](_0x216bdb));if(_0xd54682&&_0x4e925b[_0x15fe5c(0x1b6)]===0x1){const _0x245672=_0x4e925b[0x0];if(_0x245672[_0x15fe5c(0x1fb)]?.['id']){const _0x4775c3=getConsoleNextUrl(_0x422ad6[_0x15fe5c(0x1da)],_0x15fe5c(0x1c6)+_0xb30465+_0x15fe5c(0x1ef)+_0x245672[_0x15fe5c(0x1fb)]['id']+'/j/da/je');console[_0x15fe5c(0x206)]('\x20\x20'+a31_0x1a65e1['cyan'](_0x4775c3));}}return 0x0;}const _0x27da8e=_0x422ad6[_0x15fe5c(0x176)]?_0xf32274[_0x15fe5c(0x1b6)]+_0x975a7c[_0x15fe5c(0x1b6)]+_0x2c2e7f[_0x15fe5c(0x1b6)]+_0x4272b9['length']:_0x5c5729['length']+_0xc1e05e[_0x15fe5c(0x1b6)]+_0x575d00[_0x15fe5c(0x1b6)]+_0xf32274['length']+_0x975a7c['length']+_0x2c2e7f[_0x15fe5c(0x1b6)]+_0x4272b9[_0x15fe5c(0x1b6)]+_0x3d09e5['length'];if(!_0x422ad6[_0x15fe5c(0x1c5)]&&_0x27da8e>0x0){if(!isInteractive())return console[_0x15fe5c(0x206)](a31_0x1a65e1['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c8)](_0x15fe5c(0x1cc))),0x1;const _0x3996f7=await confirmKey(_0x15fe5c(0x17d)+_0x27da8e+_0x15fe5c(0x1c2));if(!_0x3996f7)return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c4)]('Aborted.')),0x1;}const _0x3ea388={'withProgress':async(_0x47ac5b,_0x26e91f)=>{const _0xe2e518=_0x15fe5c,_0x5b7363=await withSpinner(_0x47ac5b,_0x26e91f,{'verbose':_0x422ad6[_0xe2e518(0x1e2)]});return{'data':_0x5b7363['data']};},'logInfo':_0x5a8463=>console[_0x15fe5c(0x206)](a31_0x1a65e1['blue']('βœ”\x20'+_0x5a8463)),'logSuccess':_0x2815f2=>console[_0x15fe5c(0x206)](a31_0x1a65e1['green']('βœ”\x20'+_0x2815f2)),'logWarning':_0x53fafe=>console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c4)]('⚠\x20'+_0x53fafe)),'logDeleted':_0x5b95f7=>console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)]('βœ”\x20'+_0x5b95f7))},_0x1db2da={'segment':_0x576f2d[_0x15fe5c(0x19a)],'journey':_0x576f2d[_0x15fe5c(0x1cb)],'user':_0x576f2d[_0x15fe5c(0x175)],'connection':_0x576f2d['connection']};_0x4272b9['length']>0x0&&(_0xd114e=await executePushFolders(_0x1db2da,_0x4272b9,_0xd114e,{'parentId':_0xb30465},_0x3ea388));const _0x68269e={'rootFolderId':_0x34dade,'folderPathToId':_0xd114e,'folderIdToPath':_0x1ce742,'segmentNameToId':_0x275b9a,'activationsBySegmentId':_0x16e2f5,'emailToIdMap':_0x572b7f,'idToEmailMap':_0x38bfad,'connectionNameToIdMap':_0xe652b1[_0x15fe5c(0x1d5)],'connectionIdToNameMap':_0xe652b1[_0x15fe5c(0x1b9)],'connectionNameToTypeMap':_0x548cef},_0xe7ddd=await executePushSegments(_0x1db2da,_0x422ad6['journeysOnly']?[]:_0x2fb2da,_0x68269e,{'parentId':_0xb30465},_0x3ea388),_0x3c2f16=_0xe7ddd[_0x15fe5c(0x18f)],_0x550a3b=_0xe7ddd[_0x15fe5c(0x195)],_0x30a8f0=_0xe7ddd[_0x15fe5c(0x1de)][_0x15fe5c(0x18f)],_0x10743f=_0xe7ddd['activations']['updated'],_0x5585a2=_0xe7ddd[_0x15fe5c(0x1de)][_0x15fe5c(0x177)],_0x29ec8d=await executePushSegmentDeletions(_0x1db2da,_0x422ad6[_0x15fe5c(0x176)]?[]:_0x575d00,_0x3ea388);let _0x4da51c=0x0,_0x3d500c=0x0,_0x4f231d=0x0;const _0x27e9b0=new Map(_0x275b9a);for(const [_0x27a4e4,_0x13dab8]of _0xe7ddd[_0x15fe5c(0x1bf)]){_0x27e9b0['set'](_0x27a4e4,_0x13dab8);}if(_0x269e75['length']>0x0){const _0x2aeea1={..._0x68269e,'segmentNameToId':_0x27e9b0,'existingSegments':_0x599cdf,'activationContext':_0x4a1e37},_0x3d2e52=await executePushJourneys(_0x1db2da,_0x269e75,_0x2aeea1,{'parentId':_0xb30465,'rootFolderId':_0x34dade,'verbose':_0x422ad6[_0x15fe5c(0x1e2)]},_0x3ea388);_0x4da51c=_0x3d2e52['created'],_0x3d500c=_0x3d2e52[_0x15fe5c(0x195)];if(_0xd54682&&_0x3d2e52['results'][_0x15fe5c(0x1b6)]===0x1){const _0x1e0786=_0x3d2e52['results'][0x0];if(_0x1e0786[_0x15fe5c(0x179)]){const _0xf02618=getConsoleNextUrl(_0x422ad6[_0x15fe5c(0x1da)],_0x15fe5c(0x1c6)+_0xb30465+'/e/'+_0x1e0786[_0x15fe5c(0x179)]+'/j/da/je');console['error']('\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1e6)](_0xf02618));}}}for(const _0x586ef1 of _0x2c2e7f){console['error'](a31_0x1a65e1[_0x15fe5c(0x1c4)](_0x15fe5c(0x1e1)+_0x586ef1[_0x15fe5c(0x1a7)])),_0x4f231d++;}const _0x33aa5f=[];if(_0x3c2f16>0x0)_0x33aa5f[_0x15fe5c(0x1be)](_0x3c2f16+_0x15fe5c(0x1f8));if(_0x550a3b>0x0)_0x33aa5f[_0x15fe5c(0x1be)](_0x550a3b+_0x15fe5c(0x1fc));if(_0x29ec8d>0x0)_0x33aa5f[_0x15fe5c(0x1be)](_0x29ec8d+_0x15fe5c(0x192));const _0x22bb54=[];if(_0x4da51c>0x0)_0x22bb54[_0x15fe5c(0x1be)](_0x4da51c+'\x20created');if(_0x3d500c>0x0)_0x22bb54[_0x15fe5c(0x1be)](_0x3d500c+_0x15fe5c(0x1fc));if(_0x4f231d>0x0)_0x22bb54[_0x15fe5c(0x1be)](_0x4f231d+_0x15fe5c(0x192));const _0x472489=[];if(_0x30a8f0>0x0)_0x472489[_0x15fe5c(0x1be)](_0x30a8f0+_0x15fe5c(0x1f8));if(_0x10743f>0x0)_0x472489[_0x15fe5c(0x1be)](_0x10743f+'\x20updated');if(_0x5585a2>0x0)_0x472489[_0x15fe5c(0x1be)](_0x5585a2+_0x15fe5c(0x192));return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x17f)](_0x15fe5c(0x1df))),_0x33aa5f['length']>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&console[_0x15fe5c(0x206)]('\x20\x20Segments:\x20'+_0x33aa5f['join'](',\x20')),_0x22bb54['length']>0x0&&console[_0x15fe5c(0x206)]('\x20\x20Journeys:\x20'+_0x22bb54['join'](',\x20')),_0x472489[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&console[_0x15fe5c(0x206)](_0x15fe5c(0x200)+_0x472489[_0x15fe5c(0x197)](',\x20')),0x0;}}