@treasuredata/tdx 0.20.1 β†’ 0.20.2

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 (170) 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/llm-proxy.js +1 -1
  24. package/dist/commands/mcp-command.js +1 -1
  25. package/dist/commands/parent-segment-command.js +1 -1
  26. package/dist/commands/profile-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/schedule-command.js +1 -1
  30. package/dist/commands/segment-command.js +1 -1
  31. package/dist/commands/segment-create-command.js +1 -1
  32. package/dist/commands/segment-fields-command.js +1 -1
  33. package/dist/commands/segment-pull-command.js +1 -1
  34. package/dist/commands/segment-push-command.js +1 -1
  35. package/dist/commands/segment-update-command.js +1 -1
  36. package/dist/commands/segment-use-command.js +1 -1
  37. package/dist/commands/segment-validate-command.js +1 -1
  38. package/dist/commands/segments.js +1 -1
  39. package/dist/commands/show.js +1 -1
  40. package/dist/commands/status-command.js +1 -1
  41. package/dist/commands/tables.js +1 -1
  42. package/dist/commands/unset-command.js +1 -1
  43. package/dist/commands/use-command.js +1 -1
  44. package/dist/commands/user-command.js +1 -1
  45. package/dist/commands/workflow-command.js +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/command-output.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/constants.js +1 -1
  51. package/dist/core/credential-cache.js +1 -1
  52. package/dist/core/global-context.js +1 -1
  53. package/dist/core/keychain.js +1 -1
  54. package/dist/core/profile.js +1 -1
  55. package/dist/core/project-config.js +1 -1
  56. package/dist/core/session.js +1 -1
  57. package/dist/core/user-cache.js +1 -1
  58. package/dist/core/version.js +1 -1
  59. package/dist/index.js +1 -1
  60. package/dist/mcp/server.js +1 -1
  61. package/dist/mcp/tools/index.js +1 -1
  62. package/dist/mcp/tools/tdx-run.js +1 -1
  63. package/dist/mcp/tools/tdx-search.js +1 -1
  64. package/dist/mcp/utils.js +1 -1
  65. package/dist/proxy/anthropic-adapter.js +1 -1
  66. package/dist/proxy/claude-usage-tracker.js +1 -1
  67. package/dist/proxy/context-signature.js +1 -1
  68. package/dist/proxy/conversation-utils.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/server.js +1 -1
  71. package/dist/proxy/session-cache.js +1 -1
  72. package/dist/proxy/sse-usage-parser.js +1 -1
  73. package/dist/sdk/agent/agent-config.js +1 -1
  74. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  75. package/dist/sdk/agent/agent-yaml.js +1 -1
  76. package/dist/sdk/agent/test/evaluator.js +1 -1
  77. package/dist/sdk/agent/test/executor.js +1 -1
  78. package/dist/sdk/agent/test/index.js +1 -1
  79. package/dist/sdk/agent/test/output.js +1 -1
  80. package/dist/sdk/agent/test/parser.js +1 -1
  81. package/dist/sdk/api.js +1 -1
  82. package/dist/sdk/client/cdp-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/engage.js +1 -1
  94. package/dist/sdk/errors.js +1 -1
  95. package/dist/sdk/index.js +1 -1
  96. package/dist/sdk/io/index.js +1 -1
  97. package/dist/sdk/io/node-filesystem.js +1 -1
  98. package/dist/sdk/job.js +1 -1
  99. package/dist/sdk/journey.js +1 -1
  100. package/dist/sdk/llm/chat-cache.js +1 -1
  101. package/dist/sdk/llm/index.js +1 -1
  102. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  103. package/dist/sdk/llm/model-aliases.js +1 -1
  104. package/dist/sdk/llm/model-factors.js +1 -1
  105. package/dist/sdk/query/index.js +1 -1
  106. package/dist/sdk/query/sql-parser.js +1 -1
  107. package/dist/sdk/schedule.js +1 -1
  108. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  109. package/dist/sdk/segment/fields-display.js +1 -1
  110. package/dist/sdk/segment/file-discovery.js +1 -1
  111. package/dist/sdk/segment/journey-utils.js +1 -1
  112. package/dist/sdk/segment/journey-yaml.js +1 -1
  113. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  114. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  115. package/dist/sdk/segment/pull-workflow.js +1 -1
  116. package/dist/sdk/segment/push-workflow.js +1 -1
  117. package/dist/sdk/segment/resolution-context.js +1 -1
  118. package/dist/sdk/segment/segment-path-parser.js +1 -1
  119. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  120. package/dist/sdk/segment/target-resolution.js +1 -1
  121. package/dist/sdk/segment/tdx-config.js +1 -1
  122. package/dist/sdk/segment/validate-files.js +1 -1
  123. package/dist/sdk/segment/yaml-validator.js +1 -1
  124. package/dist/sdk/segment.js +1 -1
  125. package/dist/sdk/types/index.js +1 -1
  126. package/dist/sdk/types/progress.js +1 -1
  127. package/dist/sdk/user.js +1 -1
  128. package/dist/sdk/util/format-detector.js +1 -1
  129. package/dist/sdk/util/formatters.js +1 -1
  130. package/dist/sdk/util/index.js +1 -1
  131. package/dist/sdk/util/tree-formatter.js +1 -1
  132. package/dist/sdk/workflow/archive-validation.js +1 -1
  133. package/dist/sdk/workflow/clone-workflow.js +1 -1
  134. package/dist/sdk/workflow/index.js +1 -1
  135. package/dist/sdk/workflow/pull-workflow.js +1 -1
  136. package/dist/sdk/workflow/push-workflow.js +1 -1
  137. package/dist/sdk/workflow/tdx-config.js +1 -1
  138. package/dist/sdk/workflow/workflow-utils.js +1 -1
  139. package/dist/test-utils/command-runner.js +1 -1
  140. package/dist/test-utils/factories.js +1 -1
  141. package/dist/test-utils/fixtures.js +1 -1
  142. package/dist/test-utils/http-mock.js +1 -1
  143. package/dist/test-utils/index.js +1 -1
  144. package/dist/utils/async.js +1 -1
  145. package/dist/utils/colors.js +1 -1
  146. package/dist/utils/diff.js +1 -1
  147. package/dist/utils/file-permissions.js +1 -1
  148. package/dist/utils/global-cache.js +1 -1
  149. package/dist/utils/json-loader.js +1 -1
  150. package/dist/utils/local-cache.js +1 -1
  151. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  152. package/dist/utils/logger/formatters/index.js +1 -1
  153. package/dist/utils/logger/handlers/console-handler.js +1 -1
  154. package/dist/utils/logger/handlers/file-handler.js +1 -1
  155. package/dist/utils/logger/handlers/index.js +1 -1
  156. package/dist/utils/logger/handlers/null-handler.js +1 -1
  157. package/dist/utils/logger/index.js +1 -1
  158. package/dist/utils/logger/logger.js +1 -1
  159. package/dist/utils/logger/types.js +1 -1
  160. package/dist/utils/option-validation.js +1 -1
  161. package/dist/utils/port.js +1 -1
  162. package/dist/utils/process.js +1 -1
  163. package/dist/utils/prompt.js +1 -1
  164. package/dist/utils/spinner.js +1 -1
  165. package/dist/utils/sse-parser.js +1 -1
  166. package/dist/utils/string-utils.js +1 -1
  167. package/dist/utils/table-ref-parser.js +1 -1
  168. package/dist/utils/tdx-logger.js +1 -1
  169. package/dist/utils/version-check.js +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- const a27_0x5ecf36=a27_0x1d34;(function(_0x18c54a,_0x3369d4){const _0x21bf66=a27_0x1d34,_0x3e0619=_0x18c54a();while(!![]){try{const _0x32e556=parseInt(_0x21bf66(0xb3))/0x1*(-parseInt(_0x21bf66(0xf8))/0x2)+-parseInt(_0x21bf66(0xb4))/0x3*(-parseInt(_0x21bf66(0xba))/0x4)+-parseInt(_0x21bf66(0xc4))/0x5*(parseInt(_0x21bf66(0xa9))/0x6)+-parseInt(_0x21bf66(0xf0))/0x7+-parseInt(_0x21bf66(0xfd))/0x8*(-parseInt(_0x21bf66(0xf2))/0x9)+parseInt(_0x21bf66(0xf9))/0xa+-parseInt(_0x21bf66(0xc3))/0xb*(-parseInt(_0x21bf66(0x9f))/0xc);if(_0x32e556===_0x3369d4)break;else _0x3e0619['push'](_0x3e0619['shift']());}catch(_0x301f58){_0x3e0619['push'](_0x3e0619['shift']());}}}(a27_0x55bb,0x3ec94));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a27_0x55bb(){const _0x57eba3=['utf-8','update','\x20scheduled\x20quer','statusIcon','output','args','\x20(use\x20--limit\x20to\x20see\x20more)','\x20\x20Job\x20ID:\x20','getTime','Schedule\x20created:\x20','Running\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','json','schedule:create','...','result','limit','delete','List\x20scheduled\x20queries','repeat','in\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','lastRun','\x20created','run','user_name','round','12cbCSiI','from','just\x20now','dim','nextRun','max','green','verbose','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','174PZXBQZ','Schedule\x20deleted:\x20','file','\x22...','soon','cron','execute','name','queryUrl','padEnd','5023VCVBtR','1788dtjycW','engine_version','priority','cyan','schedule:run','time_zone','292RZeSHt','engineVersion','\x20(showing\x20','\x20\x20Cron:\x20','red','Schedule\x20updated:\x20','success','num','retry_limit','5250234SujxEZ','68070BUyCVs','No\x20scheduled\x20queries\x20found','delay','type','history','database','status','schedule:history','created_at','timezone','Run\x20a\x20scheduled\x20query\x20immediately','pagination','abs','join','\x20schedules','\x20matching\x20\x22','retryLimit','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','keys','Failed\x20to\x20read\x20file:\x20','Running\x20schedule:\x20','jsonl','schedules','start_at','Updating\x20schedule:\x20','\x20job','error','site','yes','Getting\x20schedule\x20details...','last_job','\x20\x20Database:\x20','description','time','Show\x20schedule\x20execution\x20history','format','INVALID_ARGUMENT','job_id','data','schedule:list','Getting\x20schedule\x20history...','Creating\x20schedule...','toLocaleDateString','\x20\x20Time:\x20','1283037zgRcGQ','log','166860QBROuK','next_run_at','Delete\x20a\x20scheduled\x20query','(unnamed)','Found\x20','length','94jJnzsw','4022280ojNjAC','list','has_next_page','scheduled_at','64SKgFiU','show','m\x20ago','query','end_at','count','Showing\x20first\x20','queries','Update\x20a\x20scheduled\x20query','map','validate','create','Creating\x20schedule:\x20','Create\x20a\x20scheduled\x20query','Deleting\x20schedule...','listQueries','trim','d\x20ago','\x20\x20Num:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','πŸ“…\x20','substring','Show\x20schedule\x20details'];a27_0x55bb=function(){return _0x57eba3;};return a27_0x55bb();}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 a27_0x3c6fc7 from'chalk';function formatRelativeTime(_0x412895){const _0x3db9cb=a27_0x1d34,_0x322f40=new Date(_0x412895),_0x49fc62=new Date(),_0x2c41dc=_0x322f40['getTime']()-_0x49fc62[_0x3db9cb(0x8c)](),_0x4a3397=Math[_0x3db9cb(0xd0)](_0x2c41dc)/0x3e8,_0xa9896f=_0x2c41dc<0x0;if(_0x4a3397<0x3c)return _0xa9896f?_0x3db9cb(0xa1):_0x3db9cb(0xad);else{if(_0x4a3397<0xe10){const _0x10abda=Math[_0x3db9cb(0x9e)](_0x4a3397/0x3c);return _0xa9896f?_0x10abda+_0x3db9cb(0xff):_0x3db9cb(0x98)+_0x10abda+'m';}else{if(_0x4a3397<0x15180){const _0x5fbfa=Math[_0x3db9cb(0x9e)](_0x4a3397/0xe10);return _0xa9896f?_0x5fbfa+'h\x20ago':_0x3db9cb(0x98)+_0x5fbfa+'h';}else{if(_0x4a3397<0x93a80){const _0x3f453f=Math[_0x3db9cb(0x9e)](_0x4a3397/0x15180);return _0xa9896f?_0x3f453f+_0x3db9cb(0x7e):'in\x20'+_0x3f453f+'d';}else return _0x322f40[_0x3db9cb(0xee)]();}}}}export class ScheduleListCommand extends BaseCommand{[a27_0x5ecf36(0xb0)]=a27_0x5ecf36(0xeb);[a27_0x5ecf36(0xe4)]=a27_0x5ecf36(0x96);async[a27_0x5ecf36(0xaf)](_0x1b78a8){const _0x2d68db=a27_0x5ecf36,{options:_0x1371e0,args:_0x5a8d6a,tdx:_0x313cf2}=_0x1b78a8,_0x447973=resolveLimit(_0x1371e0[_0x2d68db(0x94)],DEFAULT_DISPLAY_LIMIT),_0x7cf815=_0x5a8d6a[0x0],_0x4e2c36=_0x7cf815?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x7cf815+_0x2d68db(0xac):'Listing\x20scheduled\x20queries...',_0x98591d=await withSpinner(_0x4e2c36,()=>_0x313cf2['schedules'][_0x2d68db(0x7c)]({'limit':_0x447973,'scheduled':!![],'pattern':_0x7cf815}),{'verbose':_0x1371e0[_0x2d68db(0xa6)]}),_0x155f26=_0x98591d[_0x2d68db(0xea)][_0x2d68db(0x74)],_0x20d518=_0x98591d[_0x2d68db(0xea)][_0x2d68db(0xcf)][_0x2d68db(0xfb)],_0x5a280e=_0x7cf815?_0x2d68db(0xd3)+_0x7cf815+'\x22':'';_0x20d518?console['error'](_0x2d68db(0x73)+_0x155f26[_0x2d68db(0xf7)]+_0x2d68db(0xd2)+_0x5a280e+_0x2d68db(0x8a)):console[_0x2d68db(0xde)](_0x2d68db(0xf6)+_0x155f26['length']+_0x2d68db(0x86)+(_0x155f26[_0x2d68db(0xf7)]!==0x1?'ies':'y')+_0x5a280e);if(_0x1371e0[_0x2d68db(0xe7)]===_0x2d68db(0x90)||_0x1371e0[_0x2d68db(0xe7)]===_0x2d68db(0xd9)||_0x1371e0[_0x2d68db(0xe7)]==='table'||_0x1371e0[_0x2d68db(0xe7)]==='tsv'){const _0x339436=_0x155f26[_0x2d68db(0x76)](_0x3e4ed7=>({'id':_0x3e4ed7['id'],'name':_0x3e4ed7['name'],'cron':_0x3e4ed7['cron'],'database':_0x3e4ed7['database']?.[_0x2d68db(0xb0)],'type':_0x3e4ed7[_0x2d68db(0xc7)],'timezone':_0x3e4ed7[_0x2d68db(0xb9)],'user_name':_0x3e4ed7['user']?.[_0x2d68db(0xb0)],'updated_at':_0x3e4ed7['updated_at'],'next_run_at':_0x3e4ed7[_0x2d68db(0xf3)],'last_job_status':_0x3e4ed7['last_job']?.[_0x2d68db(0xca)]}));await handleSDKOutput(_0x339436,_0x1371e0);}else{if(_0x155f26['length']===0x0)console[_0x2d68db(0xf1)](_0x2d68db(0xc5));else{const _0x1488a5=_0x1371e0[_0x2d68db(0xdf)],_0x4a2c3a=_0x155f26['map'](_0x401864=>{const _0x1a3222=_0x2d68db,_0x35dd66=_0x401864[_0x1a3222(0xe2)]?.[_0x1a3222(0xca)]?_0x401864[_0x1a3222(0xe2)][_0x1a3222(0xca)]===_0x1a3222(0xc0)?'βœ“':'βœ—':'-',_0x544e64=_0x401864['last_job']?.['ended_at']?formatRelativeTime(_0x401864['last_job']['ended_at']):'never',_0x269d74=_0x401864[_0x1a3222(0xf3)]?formatRelativeTime(_0x401864[_0x1a3222(0xf3)]):'-',_0x3a2646=_0x401864[_0x1a3222(0xae)]||'',_0x37054a=_0x401864[_0x1a3222(0xb0)]||_0x1a3222(0xf5),_0x5a0906=getConsoleUrl(_0x1488a5,'/app/queries/editor?queryId='+_0x401864['id']);return{'statusIcon':_0x35dd66,'lastRun':_0x544e64,'nextRun':_0x269d74,'cron':_0x3a2646,'name':_0x37054a,'queryUrl':_0x5a0906,'status':_0x401864[_0x1a3222(0xe2)]?.[_0x1a3222(0xca)]};}),_0x3e618b=Math[_0x2d68db(0xa4)](..._0x4a2c3a[_0x2d68db(0x76)](_0x569c44=>_0x569c44[_0x2d68db(0x9a)]['length'])),_0x38b97d=Math[_0x2d68db(0xa4)](..._0x4a2c3a[_0x2d68db(0x76)](_0x233a7f=>_0x233a7f['nextRun'][_0x2d68db(0xf7)])),_0x4069de=Math[_0x2d68db(0xa4)](..._0x4a2c3a[_0x2d68db(0x76)](_0x16a13d=>_0x16a13d['cron'][_0x2d68db(0xf7)])),_0x13fea0=_0x4a2c3a[_0x2d68db(0x76)](_0x2f5a58=>{const _0x36eaf2=_0x2d68db,_0x3f479b=_0x2f5a58[_0x36eaf2(0xca)]===_0x36eaf2(0xc0)?a27_0x3c6fc7[_0x36eaf2(0xa5)](_0x2f5a58[_0x36eaf2(0x87)]):_0x2f5a58['status']==='error'?a27_0x3c6fc7[_0x36eaf2(0xbe)](_0x2f5a58[_0x36eaf2(0x87)]):a27_0x3c6fc7[_0x36eaf2(0xa2)](_0x2f5a58['statusIcon']),_0x166d1d=_0x2f5a58[_0x36eaf2(0x9a)][_0x36eaf2(0xb2)](_0x3e618b),_0x51d48a=_0x2f5a58[_0x36eaf2(0xa3)]['padEnd'](_0x38b97d),_0x3c03c5=_0x2f5a58['cron']?a27_0x3c6fc7[_0x36eaf2(0xb7)](_0x2f5a58[_0x36eaf2(0xae)][_0x36eaf2(0xb2)](_0x4069de)):'\x20'[_0x36eaf2(0x97)](_0x4069de),_0x37bb06=hyperlink(_0x2f5a58[_0x36eaf2(0xb0)],_0x2f5a58[_0x36eaf2(0xb1)]);return _0x36eaf2(0x81)+_0x3f479b+'\x20'+_0x166d1d+'\x20\x20β†’\x20'+_0x51d48a+'\x20\x20'+_0x3c03c5+'\x20\x20'+_0x37bb06;});await writeOutput(_0x13fea0[_0x2d68db(0xd1)]('\x0a'),_0x1371e0[_0x2d68db(0x88)],_0x2d68db(0xfa));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a27_0x5ecf36(0xb0)]='schedule:show';['description']=a27_0x5ecf36(0x83);[a27_0x5ecf36(0x77)](_0x588d7e){const _0x2394ed=_0x588d7e['args'][0x0];if(!_0x2394ed)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async[a27_0x5ecf36(0xaf)](_0x3de4ff){const _0x51d634=a27_0x5ecf36,{options:_0x251cf8,args:_0x43261b,tdx:_0xefe709}=_0x3de4ff,_0x2bbd67=_0x43261b[0x0],_0x2e44fd=await withSpinner(_0x51d634(0xe1),()=>_0xefe709[_0x51d634(0xda)][_0x51d634(0xfe)](_0x2bbd67),{'verbose':_0x251cf8[_0x51d634(0xa6)]}),_0x369a79=_0x2e44fd[_0x51d634(0xea)],_0x2a3223={'name':_0x369a79['name'],'cron':_0x369a79[_0x51d634(0xae)],'database':_0x369a79['database'],'type':_0x369a79[_0x51d634(0xc7)],'timezone':_0x369a79[_0x51d634(0xcd)],'user_name':_0x369a79[_0x51d634(0x9d)],'created_at':_0x369a79[_0x51d634(0xcc)],'engine_version':_0x369a79[_0x51d634(0xb5)],'executing_user_id':_0x369a79['executing_user_id'],'query':_0x369a79[_0x51d634(0x100)],'delay':_0x369a79[_0x51d634(0xc6)],'priority':_0x369a79[_0x51d634(0xb6)],'retry_limit':_0x369a79['retry_limit'],..._0x369a79[_0x51d634(0x93)]&&{'result':_0x369a79[_0x51d634(0x93)]}};return await handleSingleObjectOutput(_0x2a3223,_0x251cf8),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a27_0x5ecf36(0x91);[a27_0x5ecf36(0xe4)]=a27_0x5ecf36(0x7a);['validate'](_0x4dda28){const _0x3856bd=a27_0x5ecf36,_0xb70f50=_0x4dda28['args'][0x0];if(!_0xb70f50)return _0x3856bd(0x80);return undefined;}async['execute'](_0x141534){const _0x5704c0=a27_0x5ecf36,{options:_0x23bca1,args:_0x448a7a,tdx:_0xc6f1a8}=_0x141534,_0x335b94=_0x448a7a[0x0],_0x135f31=_0x23bca1,_0x14e7b2=_0x135f31[_0x5704c0(0xc9)],_0x399889=_0x135f31[_0x5704c0(0xab)],_0x31033e=_0x135f31[_0x5704c0(0xc7)]||'trino';let _0x3e4ce5;try{_0x3e4ce5=readFileSync(_0x399889,_0x5704c0(0x84))[_0x5704c0(0x7d)]();}catch(_0x29f3){throw new SDKError(ErrorCode[_0x5704c0(0xe8)],_0x5704c0(0xd7)+_0x399889,_0x29f3 instanceof Error?_0x29f3:undefined);}if(!_0x3e4ce5)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20file\x20is\x20empty');const _0x45899a={'database':_0x14e7b2,'query':_0x3e4ce5,'type':_0x31033e};if(_0x135f31[_0x5704c0(0xae)])_0x45899a['cron']=_0x135f31[_0x5704c0(0xae)];if(_0x135f31[_0x5704c0(0xcd)])_0x45899a[_0x5704c0(0xcd)]=_0x135f31['timezone'];if(_0x135f31[_0x5704c0(0xc6)]!==undefined)_0x45899a['delay']=Number(_0x135f31[_0x5704c0(0xc6)]);if(_0x135f31['priority']!==undefined)_0x45899a[_0x5704c0(0xb6)]=Number(_0x135f31[_0x5704c0(0xb6)]);if(_0x135f31[_0x5704c0(0xd4)]!==undefined)_0x45899a[_0x5704c0(0xc2)]=Number(_0x135f31[_0x5704c0(0xd4)]);if(_0x135f31[_0x5704c0(0xbb)])_0x45899a[_0x5704c0(0xb5)]=_0x135f31[_0x5704c0(0xbb)];if(_0x135f31[_0x5704c0(0x93)])_0x45899a[_0x5704c0(0x93)]=_0x135f31[_0x5704c0(0x93)];if(_0x23bca1[_0x5704c0(0xa6)]){console[_0x5704c0(0xde)](_0x5704c0(0x79)+_0x335b94),console[_0x5704c0(0xde)](_0x5704c0(0xe3)+_0x14e7b2),console[_0x5704c0(0xde)]('\x20\x20Type:\x20'+_0x31033e);if(_0x45899a[_0x5704c0(0xae)])console[_0x5704c0(0xde)](_0x5704c0(0xbd)+_0x45899a['cron']);if(_0x45899a['timezone'])console[_0x5704c0(0xde)]('\x20\x20Timezone:\x20'+_0x45899a[_0x5704c0(0xcd)]);}const _0x32d28d=await withSpinner(_0x5704c0(0xed),()=>_0xc6f1a8[_0x5704c0(0xda)][_0x5704c0(0x78)](_0x335b94,_0x45899a),{'verbose':_0x23bca1[_0x5704c0(0xa6)]});return console[_0x5704c0(0xde)](_0x5704c0(0x8d)+_0x32d28d[_0x5704c0(0xea)]['name']),await handleSingleObjectOutput(_0x32d28d[_0x5704c0(0xea)],_0x23bca1),0x0;}}function a27_0x1d34(_0x5315cd,_0xebadf7){_0x5315cd=_0x5315cd-0x71;const _0x55bbb1=a27_0x55bb();let _0x1d3470=_0x55bbb1[_0x5315cd];return _0x1d3470;}export class ScheduleUpdateCommand extends BaseCommand{[a27_0x5ecf36(0xb0)]='schedule:update';['description']=a27_0x5ecf36(0x75);[a27_0x5ecf36(0x77)](_0x2d3da3){const _0xd58f09=a27_0x5ecf36,_0x162c3e=_0x2d3da3[_0xd58f09(0x89)][0x0];if(!_0x162c3e)return _0xd58f09(0xa8);return undefined;}async[a27_0x5ecf36(0xaf)](_0x545594){const _0x3c510f=a27_0x5ecf36,{options:_0x4027ba,args:_0x2bb41f,tdx:_0x4af9c7}=_0x545594,_0xbb9d8e=_0x2bb41f[0x0],_0x22516d=_0x4027ba,_0x356c79={};if(_0x22516d[_0x3c510f(0xc9)])_0x356c79[_0x3c510f(0xc9)]=_0x22516d[_0x3c510f(0xc9)];if(_0x22516d['type'])_0x356c79['type']=_0x22516d['type'];if(_0x22516d[_0x3c510f(0xae)])_0x356c79[_0x3c510f(0xae)]=_0x22516d[_0x3c510f(0xae)];if(_0x22516d[_0x3c510f(0xcd)])_0x356c79['timezone']=_0x22516d[_0x3c510f(0xcd)];if(_0x22516d[_0x3c510f(0xc6)]!==undefined)_0x356c79['delay']=Number(_0x22516d[_0x3c510f(0xc6)]);if(_0x22516d['priority']!==undefined)_0x356c79[_0x3c510f(0xb6)]=Number(_0x22516d[_0x3c510f(0xb6)]);if(_0x22516d[_0x3c510f(0xd4)]!==undefined)_0x356c79[_0x3c510f(0xc2)]=Number(_0x22516d[_0x3c510f(0xd4)]);if(_0x22516d[_0x3c510f(0xbb)])_0x356c79[_0x3c510f(0xb5)]=_0x22516d[_0x3c510f(0xbb)];if(_0x22516d[_0x3c510f(0x93)])_0x356c79[_0x3c510f(0x93)]=_0x22516d['result'];if(_0x22516d['file'])try{_0x356c79[_0x3c510f(0x100)]=readFileSync(_0x22516d['file'],_0x3c510f(0x84))['trim']();}catch(_0x230ad1){throw new SDKError(ErrorCode[_0x3c510f(0xe8)],'Failed\x20to\x20read\x20file:\x20'+_0x22516d['file'],_0x230ad1 instanceof Error?_0x230ad1:undefined);}if(Object[_0x3c510f(0xd6)](_0x356c79)['length']===0x0)throw new SDKError(ErrorCode[_0x3c510f(0xe8)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x4027ba['verbose']){console[_0x3c510f(0xde)](_0x3c510f(0xdc)+_0xbb9d8e);for(const [_0x3d4abb,_0x305b0e]of Object['entries'](_0x356c79)){_0x3d4abb===_0x3c510f(0x100)?console[_0x3c510f(0xde)]('\x20\x20'+_0x3d4abb+':\x20'+_0x305b0e[_0x3c510f(0x82)](0x0,0x32)+_0x3c510f(0x92)):console[_0x3c510f(0xde)]('\x20\x20'+_0x3d4abb+':\x20'+_0x305b0e);}}const _0x2ca5e5=await withSpinner('Updating\x20schedule...',()=>_0x4af9c7[_0x3c510f(0xda)][_0x3c510f(0x85)](_0xbb9d8e,_0x356c79),{'verbose':_0x4027ba[_0x3c510f(0xa6)]});return console[_0x3c510f(0xde)](_0x3c510f(0xbf)+_0x2ca5e5[_0x3c510f(0xea)]['name']),await handleSingleObjectOutput(_0x2ca5e5[_0x3c510f(0xea)],_0x4027ba),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a27_0x5ecf36(0xb0)]='schedule:delete';[a27_0x5ecf36(0xe4)]=a27_0x5ecf36(0xf4);['validate'](_0x20f205){const _0x5abf1a=a27_0x5ecf36,_0xfa432b=_0x20f205[_0x5abf1a(0x89)][0x0];if(!_0xfa432b)return _0x5abf1a(0x8f);return undefined;}async[a27_0x5ecf36(0xaf)](_0x193896){const _0x26f6e6=a27_0x5ecf36,{options:_0x4a9526,args:_0x33dab9,tdx:_0x610d04}=_0x193896,_0x15c72a=_0x33dab9[0x0];if(!_0x4a9526[_0x26f6e6(0xe0)]){const _0x4dba45=await confirm(_0x26f6e6(0x99)+_0x15c72a+'\x22?');if(!_0x4dba45)return console['error']('Cancelled'),0x0;}const _0x5ddaa0=await withSpinner(_0x26f6e6(0x7b),()=>_0x610d04['schedules'][_0x26f6e6(0x95)](_0x15c72a),{'verbose':_0x4a9526['verbose']});return console[_0x26f6e6(0xde)](_0x26f6e6(0xaa)+_0x5ddaa0['data'][_0x26f6e6(0xb0)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a27_0x5ecf36(0xb0)]=a27_0x5ecf36(0xb8);['description']=a27_0x5ecf36(0xce);['validate'](_0xa7d3c0){const _0x2ac588=a27_0x5ecf36,_0x3c26bd=_0xa7d3c0[_0x2ac588(0x89)][0x0];if(!_0x3c26bd)return _0x2ac588(0xd5);return undefined;}async[a27_0x5ecf36(0xaf)](_0x1431d2){const _0x15c952=a27_0x5ecf36,{options:_0x3767c4,args:_0xee1663,tdx:_0xb12a}=_0x1431d2,_0x4d78bc=_0xee1663[0x0],_0xcfd401=_0x3767c4,_0x35241d=_0xcfd401[_0x15c952(0xe5)],_0x5771a6=_0xcfd401[_0x15c952(0xc1)]!==undefined?Number(_0xcfd401[_0x15c952(0xc1)]):undefined;if(_0x3767c4[_0x15c952(0xa6)]){console[_0x15c952(0xde)](_0x15c952(0xd8)+_0x4d78bc);if(_0x35241d)console[_0x15c952(0xde)](_0x15c952(0xef)+_0x35241d);if(_0x5771a6)console['error'](_0x15c952(0x7f)+_0x5771a6);}const _0x1ee961=await withSpinner(_0x15c952(0x8e),()=>_0xb12a[_0x15c952(0xda)][_0x15c952(0x9c)](_0x4d78bc,{'time':_0x35241d,'num':_0x5771a6}),{'verbose':_0x3767c4[_0x15c952(0xa6)]}),_0x32260f=_0x1ee961['data']['jobs'];console[_0x15c952(0xde)]('Schedule\x20run\x20submitted:\x20'+_0x32260f[_0x15c952(0xf7)]+_0x15c952(0xdd)+(_0x32260f['length']!==0x1?'s':'')+_0x15c952(0x9b));for(const _0x24741f of _0x32260f){console['error'](_0x15c952(0x8b)+_0x24741f[_0x15c952(0xe9)]);}return await handleSDKOutput(_0x32260f,_0x3767c4),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']=a27_0x5ecf36(0xcb);[a27_0x5ecf36(0xe4)]=a27_0x5ecf36(0xe6);['validate'](_0x44c2c7){const _0xb248b4=a27_0x5ecf36,_0x31e29d=_0x44c2c7[_0xb248b4(0x89)][0x0];if(!_0x31e29d)return _0xb248b4(0xa7);return undefined;}async['execute'](_0x38f335){const _0x16a850=a27_0x5ecf36,{options:_0x583535,args:_0x29684,tdx:_0x3a20dd}=_0x38f335,_0x1a617f=_0x29684[0x0],_0x514e54=_0x583535,_0x1a48f1=_0x514e54[_0x16a850(0xa0)]!==undefined?Number(_0x514e54[_0x16a850(0xa0)]):undefined,_0x4b0da7=_0x514e54['to']!==undefined?Number(_0x514e54['to']):undefined,_0x1c9150=await withSpinner(_0x16a850(0xec),()=>_0x3a20dd[_0x16a850(0xda)][_0x16a850(0xc8)](_0x1a617f,{'from':_0x1a48f1,'to':_0x4b0da7}),{'verbose':_0x583535[_0x16a850(0xa6)]}),_0xc20834=_0x1c9150['data'];console[_0x16a850(0xde)](_0x16a850(0xf6)+_0xc20834[_0x16a850(0x72)]+'\x20execution'+(_0xc20834['count']!==0x1?'s':'')+_0x16a850(0xbc)+_0xc20834[_0x16a850(0xa0)]+'-'+_0xc20834['to']+')');const _0x21d426=_0xc20834[_0x16a850(0xc8)][_0x16a850(0x76)](_0x53cacf=>({'job_id':_0x53cacf['job_id'],'type':_0x53cacf[_0x16a850(0xc7)],'status':_0x53cacf[_0x16a850(0xca)],'scheduled_at':_0x53cacf[_0x16a850(0xfc)],'created_at':_0x53cacf['created_at'],'start_at':_0x53cacf[_0x16a850(0xdb)],'end_at':_0x53cacf[_0x16a850(0x71)]}));return await handleSDKOutput(_0x21d426,_0x583535),0x0;}}
1
+ const a27_0x477d82=a27_0x5a78;(function(_0x1393f9,_0x2b029b){const _0x1e1f3e=a27_0x5a78,_0x412228=_0x1393f9();while(!![]){try{const _0x2903d2=-parseInt(_0x1e1f3e(0x1df))/0x1+-parseInt(_0x1e1f3e(0x19b))/0x2*(-parseInt(_0x1e1f3e(0x1c0))/0x3)+-parseInt(_0x1e1f3e(0x214))/0x4+parseInt(_0x1e1f3e(0x1c4))/0x5*(parseInt(_0x1e1f3e(0x192))/0x6)+parseInt(_0x1e1f3e(0x1e1))/0x7+-parseInt(_0x1e1f3e(0x1f1))/0x8*(parseInt(_0x1e1f3e(0x20d))/0x9)+parseInt(_0x1e1f3e(0x1d5))/0xa;if(_0x2903d2===_0x2b029b)break;else _0x412228['push'](_0x412228['shift']());}catch(_0x1f334c){_0x412228['push'](_0x412228['shift']());}}}(a27_0x1573,0xc1306));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a27_0x5a78(_0x3d9273,_0x4f2159){_0x3d9273=_0x3d9273-0x185;const _0x157388=a27_0x1573();let _0x5a7833=_0x157388[_0x3d9273];return _0x5a7833;}import{hyperlink}from'../sdk/util/formatters.js';import a27_0x292587 from'chalk';function formatRelativeTime(_0xafc8b5){const _0xe3f44f=a27_0x5a78,_0x28303b=new Date(_0xafc8b5),_0x53b77a=new Date(),_0x534e2a=_0x28303b['getTime']()-_0x53b77a[_0xe3f44f(0x1db)](),_0x49cc2a=Math[_0xe3f44f(0x1af)](_0x534e2a)/0x3e8,_0xe7a14b=_0x534e2a<0x0;if(_0x49cc2a<0x3c)return _0xe7a14b?_0xe3f44f(0x1f5):'soon';else{if(_0x49cc2a<0xe10){const _0x469f79=Math[_0xe3f44f(0x1c9)](_0x49cc2a/0x3c);return _0xe7a14b?_0x469f79+_0xe3f44f(0x1b0):_0xe3f44f(0x1fc)+_0x469f79+'m';}else{if(_0x49cc2a<0x15180){const _0xc535c7=Math['round'](_0x49cc2a/0xe10);return _0xe7a14b?_0xc535c7+_0xe3f44f(0x1b5):_0xe3f44f(0x1fc)+_0xc535c7+'h';}else{if(_0x49cc2a<0x93a80){const _0x3723c8=Math[_0xe3f44f(0x1c9)](_0x49cc2a/0x15180);return _0xe7a14b?_0x3723c8+_0xe3f44f(0x1a9):_0xe3f44f(0x1fc)+_0x3723c8+'d';}else return _0x28303b[_0xe3f44f(0x1ae)]();}}}}export class ScheduleListCommand extends BaseCommand{[a27_0x477d82(0x1e4)]=a27_0x477d82(0x196);[a27_0x477d82(0x1a8)]=a27_0x477d82(0x206);async[a27_0x477d82(0x1e2)](_0x2fedc1){const _0x526624=a27_0x477d82,{options:_0x15c89e,args:_0x187b28,tdx:_0x2c4cbf}=_0x2fedc1,_0x734f2=resolveLimit(_0x15c89e[_0x526624(0x1ac)],DEFAULT_DISPLAY_LIMIT),_0x5b0f44=_0x187b28[0x0],_0x215091=_0x5b0f44?_0x526624(0x218)+_0x5b0f44+_0x526624(0x215):_0x526624(0x1f9),_0x421aeb=await withSpinner(_0x215091,()=>_0x2c4cbf['schedules'][_0x526624(0x1ce)]({'limit':_0x734f2,'scheduled':!![],'pattern':_0x5b0f44}),{'verbose':_0x15c89e[_0x526624(0x1dc)]}),_0x2b0919=_0x421aeb[_0x526624(0x1ea)][_0x526624(0x1d6)],_0x38aedd=_0x421aeb[_0x526624(0x1ea)][_0x526624(0x1f2)][_0x526624(0x19e)],_0x3bc28c=_0x5b0f44?_0x526624(0x1bf)+_0x5b0f44+'\x22':'';_0x38aedd?console[_0x526624(0x1c6)](_0x526624(0x1ef)+_0x2b0919['length']+_0x526624(0x19f)+_0x3bc28c+'\x20(use\x20--limit\x20to\x20see\x20more)'):console['error'](_0x526624(0x1c2)+_0x2b0919[_0x526624(0x1a1)]+_0x526624(0x1f0)+(_0x2b0919[_0x526624(0x1a1)]!==0x1?_0x526624(0x1b4):'y')+_0x3bc28c);if(_0x15c89e[_0x526624(0x1e0)]==='json'||_0x15c89e[_0x526624(0x1e0)]===_0x526624(0x20f)||_0x15c89e[_0x526624(0x1e0)]===_0x526624(0x1cc)||_0x15c89e['format']===_0x526624(0x18b)){const _0x17226c=_0x2b0919[_0x526624(0x20e)](_0x1644d9=>({'id':_0x1644d9['id'],'name':_0x1644d9[_0x526624(0x1e4)],'cron':_0x1644d9['cron'],'database':_0x1644d9[_0x526624(0x212)]?.[_0x526624(0x1e4)],'type':_0x1644d9[_0x526624(0x1d8)],'timezone':_0x1644d9[_0x526624(0x1a7)],'user_name':_0x1644d9[_0x526624(0x1da)]?.[_0x526624(0x1e4)],'updated_at':_0x1644d9['updated_at'],'next_run_at':_0x1644d9['next_run_at'],'last_job_status':_0x1644d9[_0x526624(0x1e8)]?.['status']}));await handleSDKOutput(_0x17226c,_0x15c89e);}else{if(_0x2b0919[_0x526624(0x1a1)]===0x0)console[_0x526624(0x219)](_0x526624(0x216));else{const _0xcb61c8=_0x15c89e[_0x526624(0x185)],_0x3f3db0=_0x2b0919[_0x526624(0x20e)](_0x124453=>{const _0x56dab9=_0x526624,_0x2596d4=_0x124453['last_job']?.[_0x56dab9(0x1e6)]?_0x124453[_0x56dab9(0x1e8)][_0x56dab9(0x1e6)]==='success'?'βœ“':'βœ—':'-',_0x30cb38=_0x124453[_0x56dab9(0x1e8)]?.['ended_at']?formatRelativeTime(_0x124453[_0x56dab9(0x1e8)][_0x56dab9(0x18e)]):_0x56dab9(0x1ab),_0x42ab1b=_0x124453[_0x56dab9(0x213)]?formatRelativeTime(_0x124453[_0x56dab9(0x213)]):'-',_0x42b0f1=_0x124453[_0x56dab9(0x1be)]||'',_0x53f718=_0x124453[_0x56dab9(0x1e4)]||_0x56dab9(0x201),_0x19af99=getConsoleUrl(_0xcb61c8,'/app/queries/editor?queryId='+_0x124453['id']);return{'statusIcon':_0x2596d4,'lastRun':_0x30cb38,'nextRun':_0x42ab1b,'cron':_0x42b0f1,'name':_0x53f718,'queryUrl':_0x19af99,'status':_0x124453['last_job']?.[_0x56dab9(0x1e6)]};}),_0x136629=Math[_0x526624(0x198)](..._0x3f3db0[_0x526624(0x20e)](_0x2f8951=>_0x2f8951[_0x526624(0x19a)]['length'])),_0x15b11b=Math[_0x526624(0x198)](..._0x3f3db0[_0x526624(0x20e)](_0x43cbdb=>_0x43cbdb[_0x526624(0x1ee)][_0x526624(0x1a1)])),_0x2e8949=Math[_0x526624(0x198)](..._0x3f3db0[_0x526624(0x20e)](_0x4a5ac1=>_0x4a5ac1[_0x526624(0x1be)][_0x526624(0x1a1)])),_0xe1943c=_0x3f3db0['map'](_0x4f714d=>{const _0x5c4756=_0x526624,_0x2fa097=_0x4f714d[_0x5c4756(0x1e6)]===_0x5c4756(0x18f)?a27_0x292587[_0x5c4756(0x19c)](_0x4f714d[_0x5c4756(0x1f6)]):_0x4f714d[_0x5c4756(0x1e6)]===_0x5c4756(0x1c6)?a27_0x292587[_0x5c4756(0x1b7)](_0x4f714d[_0x5c4756(0x1f6)]):a27_0x292587[_0x5c4756(0x1c5)](_0x4f714d[_0x5c4756(0x1f6)]),_0x22abfb=_0x4f714d[_0x5c4756(0x19a)][_0x5c4756(0x1b8)](_0x136629),_0x3288b4=_0x4f714d[_0x5c4756(0x1ee)][_0x5c4756(0x1b8)](_0x15b11b),_0x29e39d=_0x4f714d[_0x5c4756(0x1be)]?a27_0x292587[_0x5c4756(0x1d4)](_0x4f714d['cron'][_0x5c4756(0x1b8)](_0x2e8949)):'\x20'['repeat'](_0x2e8949),_0x457d05=hyperlink(_0x4f714d['name'],_0x4f714d[_0x5c4756(0x208)]);return _0x5c4756(0x18a)+_0x2fa097+'\x20'+_0x22abfb+'\x20\x20β†’\x20'+_0x3288b4+'\x20\x20'+_0x29e39d+'\x20\x20'+_0x457d05;});await writeOutput(_0xe1943c[_0x526624(0x1ff)]('\x0a'),_0x15c89e['output'],_0x526624(0x1d9));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a27_0x477d82(0x1de);[a27_0x477d82(0x1a8)]=a27_0x477d82(0x1c8);[a27_0x477d82(0x1d0)](_0x2acca6){const _0x2a8b4c=a27_0x477d82,_0x5191e2=_0x2acca6[_0x2a8b4c(0x1bb)][0x0];if(!_0x5191e2)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x1a39a1){const _0x4615bf=a27_0x477d82,{options:_0x4a8bf3,args:_0x5abccb,tdx:_0xc28da2}=_0x1a39a1,_0x19ebd3=_0x5abccb[0x0],_0xccca=await withSpinner(_0x4615bf(0x187),()=>_0xc28da2[_0x4615bf(0x1bc)][_0x4615bf(0x19d)](_0x19ebd3),{'verbose':_0x4a8bf3[_0x4615bf(0x1dc)]}),_0x3b2306=_0xccca[_0x4615bf(0x1ea)],_0x3801fc={'name':_0x3b2306[_0x4615bf(0x1e4)],'cron':_0x3b2306['cron'],'database':_0x3b2306[_0x4615bf(0x212)],'type':_0x3b2306['type'],'timezone':_0x3b2306[_0x4615bf(0x1b6)],'user_name':_0x3b2306[_0x4615bf(0x1a3)],'created_at':_0x3b2306[_0x4615bf(0x209)],'engine_version':_0x3b2306['engine_version'],'executing_user_id':_0x3b2306[_0x4615bf(0x1e7)],'query':_0x3b2306[_0x4615bf(0x1b3)],'delay':_0x3b2306['delay'],'priority':_0x3b2306[_0x4615bf(0x1e5)],'retry_limit':_0x3b2306[_0x4615bf(0x211)],..._0x3b2306[_0x4615bf(0x1bd)]&&{'result':_0x3b2306['result']}};return await handleSingleObjectOutput(_0x3801fc,_0x4a8bf3),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a27_0x477d82(0x1e4)]=a27_0x477d82(0x1cf);[a27_0x477d82(0x1a8)]=a27_0x477d82(0x1b1);[a27_0x477d82(0x1d0)](_0x587c61){const _0x3c7edc=a27_0x477d82,_0x2b429d=_0x587c61[_0x3c7edc(0x1bb)][0x0];if(!_0x2b429d)return _0x3c7edc(0x1a0);return undefined;}async[a27_0x477d82(0x1e2)](_0x137eb9){const _0x55181d=a27_0x477d82,{options:_0x55b495,args:_0x495ebc,tdx:_0x1faa3f}=_0x137eb9,_0x2a197d=_0x495ebc[0x0],_0x2051fb=_0x55b495,_0x106c75=_0x2051fb[_0x55181d(0x212)],_0x5a26a7=_0x2051fb[_0x55181d(0x1fa)],_0x281ec0=_0x2051fb[_0x55181d(0x1d8)]||_0x55181d(0x1e9);let _0x28a8cb;try{_0x28a8cb=readFileSync(_0x5a26a7,_0x55181d(0x191))[_0x55181d(0x1e3)]();}catch(_0x1bfc0e){throw new SDKError(ErrorCode[_0x55181d(0x200)],_0x55181d(0x18d)+_0x5a26a7,_0x1bfc0e instanceof Error?_0x1bfc0e:undefined);}if(!_0x28a8cb)throw new SDKError(ErrorCode[_0x55181d(0x200)],_0x55181d(0x217));const _0x4f0453={'database':_0x106c75,'query':_0x28a8cb,'type':_0x281ec0};if(_0x2051fb['cron'])_0x4f0453[_0x55181d(0x1be)]=_0x2051fb['cron'];if(_0x2051fb[_0x55181d(0x1b6)])_0x4f0453[_0x55181d(0x1b6)]=_0x2051fb[_0x55181d(0x1b6)];if(_0x2051fb[_0x55181d(0x197)]!==undefined)_0x4f0453[_0x55181d(0x197)]=Number(_0x2051fb['delay']);if(_0x2051fb['priority']!==undefined)_0x4f0453[_0x55181d(0x1e5)]=Number(_0x2051fb[_0x55181d(0x1e5)]);if(_0x2051fb[_0x55181d(0x1fe)]!==undefined)_0x4f0453[_0x55181d(0x211)]=Number(_0x2051fb[_0x55181d(0x1fe)]);if(_0x2051fb['engineVersion'])_0x4f0453['engine_version']=_0x2051fb[_0x55181d(0x1aa)];if(_0x2051fb[_0x55181d(0x1bd)])_0x4f0453[_0x55181d(0x1bd)]=_0x2051fb[_0x55181d(0x1bd)];if(_0x55b495[_0x55181d(0x1dc)]){console[_0x55181d(0x1c6)](_0x55181d(0x1dd)+_0x2a197d),console['error'](_0x55181d(0x1d2)+_0x106c75),console['error']('\x20\x20Type:\x20'+_0x281ec0);if(_0x4f0453[_0x55181d(0x1be)])console[_0x55181d(0x1c6)](_0x55181d(0x1fb)+_0x4f0453[_0x55181d(0x1be)]);if(_0x4f0453[_0x55181d(0x1b6)])console[_0x55181d(0x1c6)](_0x55181d(0x189)+_0x4f0453[_0x55181d(0x1b6)]);}const _0xb0f49=await withSpinner('Creating\x20schedule...',()=>_0x1faa3f[_0x55181d(0x1bc)][_0x55181d(0x1ba)](_0x2a197d,_0x4f0453),{'verbose':_0x55b495['verbose']});return console[_0x55181d(0x1c6)](_0x55181d(0x20b)+_0xb0f49['data']['name']),await handleSingleObjectOutput(_0xb0f49[_0x55181d(0x1ea)],_0x55b495),0x0;}}function a27_0x1573(){const _0x2a1611=['substring','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','schedule:list','delay','max','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','lastRun','4690StyGcB','green','show','has_next_page','\x20schedules','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','length','\x20job','user_name','Running\x20schedule...','Schedule\x20deleted:\x20','\x20(showing\x20','time_zone','description','d\x20ago','engineVersion','never','limit','history','toLocaleDateString','abs','m\x20ago','Create\x20a\x20scheduled\x20query','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','query','ies','h\x20ago','timezone','red','padEnd','Show\x20schedule\x20execution\x20history','create','args','schedules','result','cron','\x20matching\x20\x22','63tbYsuh','\x20\x20Time:\x20','Found\x20','Deleting\x20schedule...','20JhqUVH','dim','error','scheduled_at','Show\x20schedule\x20details','round','schedule:run','\x20\x20Num:\x20','table','entries','listQueries','schedule:create','validate','from','\x20\x20Database:\x20','engine_version','cyan','12134470tUcRCC','queries','Delete\x20a\x20scheduled\x20query','type','list','user','getTime','verbose','Creating\x20schedule:\x20','schedule:show','173593rGRZTH','format','2663850uETUXE','execute','trim','name','priority','status','executing_user_id','last_job','trino','data','keys','Schedule\x20run\x20submitted:\x20','Updating\x20schedule...','nextRun','Showing\x20first\x20','\x20scheduled\x20quer','49912fNKwcK','pagination','Update\x20a\x20scheduled\x20query','schedule:history','just\x20now','statusIcon','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','yes','Listing\x20scheduled\x20queries...','file','\x20\x20Cron:\x20','in\x20','delete','retryLimit','join','INVALID_ARGUMENT','(unnamed)','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','update','\x20execution','count','List\x20scheduled\x20queries','Updating\x20schedule:\x20','queryUrl','created_at','Run\x20a\x20scheduled\x20query\x20immediately','Schedule\x20created:\x20','...','468Iltowl','map','jsonl','Getting\x20schedule\x20history...','retry_limit','database','next_run_at','5144764JwubeO','\x22...','No\x20scheduled\x20queries\x20found','Query\x20file\x20is\x20empty','Searching\x20scheduled\x20queries\x20matching\x20\x22','log','site','start_at','Getting\x20schedule\x20details...','job_id','\x20\x20Timezone:\x20','πŸ“…\x20','tsv','schedule:update','Failed\x20to\x20read\x20file:\x20','ended_at','success','Cancelled','utf-8','1398408XanZPx'];a27_0x1573=function(){return _0x2a1611;};return a27_0x1573();}export class ScheduleUpdateCommand extends BaseCommand{[a27_0x477d82(0x1e4)]=a27_0x477d82(0x18c);['description']=a27_0x477d82(0x1f3);[a27_0x477d82(0x1d0)](_0x63f212){const _0x48b65c=a27_0x477d82,_0x3415d6=_0x63f212[_0x48b65c(0x1bb)][0x0];if(!_0x3415d6)return _0x48b65c(0x199);return undefined;}async[a27_0x477d82(0x1e2)](_0x19f43e){const _0x1911b4=a27_0x477d82,{options:_0x38cbcf,args:_0x27ad11,tdx:_0x7fa08e}=_0x19f43e,_0x406e16=_0x27ad11[0x0],_0x1dc97e=_0x38cbcf,_0x4f2213={};if(_0x1dc97e[_0x1911b4(0x212)])_0x4f2213[_0x1911b4(0x212)]=_0x1dc97e['database'];if(_0x1dc97e[_0x1911b4(0x1d8)])_0x4f2213[_0x1911b4(0x1d8)]=_0x1dc97e[_0x1911b4(0x1d8)];if(_0x1dc97e['cron'])_0x4f2213[_0x1911b4(0x1be)]=_0x1dc97e[_0x1911b4(0x1be)];if(_0x1dc97e[_0x1911b4(0x1b6)])_0x4f2213['timezone']=_0x1dc97e[_0x1911b4(0x1b6)];if(_0x1dc97e[_0x1911b4(0x197)]!==undefined)_0x4f2213[_0x1911b4(0x197)]=Number(_0x1dc97e[_0x1911b4(0x197)]);if(_0x1dc97e[_0x1911b4(0x1e5)]!==undefined)_0x4f2213['priority']=Number(_0x1dc97e[_0x1911b4(0x1e5)]);if(_0x1dc97e[_0x1911b4(0x1fe)]!==undefined)_0x4f2213[_0x1911b4(0x211)]=Number(_0x1dc97e['retryLimit']);if(_0x1dc97e[_0x1911b4(0x1aa)])_0x4f2213[_0x1911b4(0x1d3)]=_0x1dc97e[_0x1911b4(0x1aa)];if(_0x1dc97e[_0x1911b4(0x1bd)])_0x4f2213[_0x1911b4(0x1bd)]=_0x1dc97e['result'];if(_0x1dc97e[_0x1911b4(0x1fa)])try{_0x4f2213[_0x1911b4(0x1b3)]=readFileSync(_0x1dc97e[_0x1911b4(0x1fa)],_0x1911b4(0x191))[_0x1911b4(0x1e3)]();}catch(_0xf9b2f1){throw new SDKError(ErrorCode[_0x1911b4(0x200)],_0x1911b4(0x18d)+_0x1dc97e[_0x1911b4(0x1fa)],_0xf9b2f1 instanceof Error?_0xf9b2f1:undefined);}if(Object[_0x1911b4(0x1eb)](_0x4f2213)[_0x1911b4(0x1a1)]===0x0)throw new SDKError(ErrorCode[_0x1911b4(0x200)],_0x1911b4(0x1f7));if(_0x38cbcf[_0x1911b4(0x1dc)]){console[_0x1911b4(0x1c6)](_0x1911b4(0x207)+_0x406e16);for(const [_0x232cff,_0x1a9fc8]of Object[_0x1911b4(0x1cd)](_0x4f2213)){_0x232cff==='query'?console[_0x1911b4(0x1c6)]('\x20\x20'+_0x232cff+':\x20'+_0x1a9fc8[_0x1911b4(0x193)](0x0,0x32)+_0x1911b4(0x20c)):console[_0x1911b4(0x1c6)]('\x20\x20'+_0x232cff+':\x20'+_0x1a9fc8);}}const _0x2a16f5=await withSpinner(_0x1911b4(0x1ed),()=>_0x7fa08e[_0x1911b4(0x1bc)][_0x1911b4(0x203)](_0x406e16,_0x4f2213),{'verbose':_0x38cbcf[_0x1911b4(0x1dc)]});return console[_0x1911b4(0x1c6)]('Schedule\x20updated:\x20'+_0x2a16f5[_0x1911b4(0x1ea)]['name']),await handleSingleObjectOutput(_0x2a16f5[_0x1911b4(0x1ea)],_0x38cbcf),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a27_0x477d82(0x1e4)]='schedule:delete';[a27_0x477d82(0x1a8)]=a27_0x477d82(0x1d7);['validate'](_0x454d12){const _0x57b690=a27_0x477d82,_0x2575c6=_0x454d12[_0x57b690(0x1bb)][0x0];if(!_0x2575c6)return _0x57b690(0x1b2);return undefined;}async[a27_0x477d82(0x1e2)](_0x5d103d){const _0xb573ff=a27_0x477d82,{options:_0x2baf5e,args:_0xe64e69,tdx:_0x2d3f4c}=_0x5d103d,_0x7dc9fd=_0xe64e69[0x0];if(!_0x2baf5e[_0xb573ff(0x1f8)]){const _0x4fd516=await confirm(_0xb573ff(0x202)+_0x7dc9fd+'\x22?');if(!_0x4fd516)return console[_0xb573ff(0x1c6)](_0xb573ff(0x190)),0x0;}const _0x33e2aa=await withSpinner(_0xb573ff(0x1c3),()=>_0x2d3f4c[_0xb573ff(0x1bc)][_0xb573ff(0x1fd)](_0x7dc9fd),{'verbose':_0x2baf5e[_0xb573ff(0x1dc)]});return console[_0xb573ff(0x1c6)](_0xb573ff(0x1a5)+_0x33e2aa[_0xb573ff(0x1ea)][_0xb573ff(0x1e4)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a27_0x477d82(0x1ca);[a27_0x477d82(0x1a8)]=a27_0x477d82(0x20a);[a27_0x477d82(0x1d0)](_0x1354ff){const _0x52ec66=a27_0x477d82,_0x303794=_0x1354ff[_0x52ec66(0x1bb)][0x0];if(!_0x303794)return _0x52ec66(0x195);return undefined;}async[a27_0x477d82(0x1e2)](_0x2fc90e){const _0x571917=a27_0x477d82,{options:_0x1a1a64,args:_0x3095a1,tdx:_0x45d7da}=_0x2fc90e,_0x38755d=_0x3095a1[0x0],_0xd9179d=_0x1a1a64,_0x470049=_0xd9179d['time'],_0xbbdf26=_0xd9179d['num']!==undefined?Number(_0xd9179d['num']):undefined;if(_0x1a1a64[_0x571917(0x1dc)]){console['error']('Running\x20schedule:\x20'+_0x38755d);if(_0x470049)console['error'](_0x571917(0x1c1)+_0x470049);if(_0xbbdf26)console['error'](_0x571917(0x1cb)+_0xbbdf26);}const _0x105803=await withSpinner(_0x571917(0x1a4),()=>_0x45d7da[_0x571917(0x1bc)]['run'](_0x38755d,{'time':_0x470049,'num':_0xbbdf26}),{'verbose':_0x1a1a64[_0x571917(0x1dc)]}),_0x17c788=_0x105803[_0x571917(0x1ea)]['jobs'];console[_0x571917(0x1c6)](_0x571917(0x1ec)+_0x17c788['length']+_0x571917(0x1a2)+(_0x17c788[_0x571917(0x1a1)]!==0x1?'s':'')+'\x20created');for(const _0x400b1b of _0x17c788){console[_0x571917(0x1c6)]('\x20\x20Job\x20ID:\x20'+_0x400b1b[_0x571917(0x188)]);}return await handleSDKOutput(_0x17c788,_0x1a1a64),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']=a27_0x477d82(0x1f4);[a27_0x477d82(0x1a8)]=a27_0x477d82(0x1b9);['validate'](_0x16087f){const _0x6784e2=a27_0x477d82,_0x28664f=_0x16087f[_0x6784e2(0x1bb)][0x0];if(!_0x28664f)return _0x6784e2(0x194);return undefined;}async[a27_0x477d82(0x1e2)](_0x1f1054){const _0x3f08a6=a27_0x477d82,{options:_0xf90d7e,args:_0x163b38,tdx:_0x71ba32}=_0x1f1054,_0x5bb4c5=_0x163b38[0x0],_0x5506b1=_0xf90d7e,_0x4b957f=_0x5506b1[_0x3f08a6(0x1d1)]!==undefined?Number(_0x5506b1[_0x3f08a6(0x1d1)]):undefined,_0xe52e55=_0x5506b1['to']!==undefined?Number(_0x5506b1['to']):undefined,_0x1e4ae4=await withSpinner(_0x3f08a6(0x210),()=>_0x71ba32['schedules'][_0x3f08a6(0x1ad)](_0x5bb4c5,{'from':_0x4b957f,'to':_0xe52e55}),{'verbose':_0xf90d7e[_0x3f08a6(0x1dc)]}),_0x44dd8d=_0x1e4ae4[_0x3f08a6(0x1ea)];console[_0x3f08a6(0x1c6)](_0x3f08a6(0x1c2)+_0x44dd8d[_0x3f08a6(0x205)]+_0x3f08a6(0x204)+(_0x44dd8d['count']!==0x1?'s':'')+_0x3f08a6(0x1a6)+_0x44dd8d[_0x3f08a6(0x1d1)]+'-'+_0x44dd8d['to']+')');const _0x16a978=_0x44dd8d['history'][_0x3f08a6(0x20e)](_0x4e0c81=>({'job_id':_0x4e0c81[_0x3f08a6(0x188)],'type':_0x4e0c81[_0x3f08a6(0x1d8)],'status':_0x4e0c81[_0x3f08a6(0x1e6)],'scheduled_at':_0x4e0c81[_0x3f08a6(0x1c7)],'created_at':_0x4e0c81[_0x3f08a6(0x209)],'start_at':_0x4e0c81[_0x3f08a6(0x186)],'end_at':_0x4e0c81['end_at']}));return await handleSDKOutput(_0x16a978,_0xf90d7e),0x0;}}
@@ -1 +1 @@
1
- const a28_0x4aabba=a28_0x11aa;(function(_0x3ef6c4,_0xc53b67){const _0x29b0c9=a28_0x11aa,_0x5e91a4=_0x3ef6c4();while(!![]){try{const _0x5c5c28=parseInt(_0x29b0c9(0x1b7))/0x1+parseInt(_0x29b0c9(0x195))/0x2*(parseInt(_0x29b0c9(0x1c0))/0x3)+parseInt(_0x29b0c9(0x16f))/0x4+-parseInt(_0x29b0c9(0x1f3))/0x5*(-parseInt(_0x29b0c9(0x193))/0x6)+parseInt(_0x29b0c9(0x18d))/0x7*(-parseInt(_0x29b0c9(0x1ab))/0x8)+parseInt(_0x29b0c9(0x17d))/0x9+-parseInt(_0x29b0c9(0x179))/0xa;if(_0x5c5c28===_0xc53b67)break;else _0x5e91a4['push'](_0x5e91a4['shift']());}catch(_0x4002a6){_0x5e91a4['push'](_0x5e91a4['shift']());}}}(a28_0x5d1a,0xc7658));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 a28_0x16e550 from'chalk';async function resolveSegmentTarget(_0xb9fce2,_0x54272f,_0x259470){const _0x32388b=a28_0x11aa;if(isYamlFilePath(_0xb9fce2))try{const _0x261fb8=await resolveYamlFilePath(_0xb9fce2);return _0x259470&&(console[_0x32388b(0x1d0)](_0x32388b(0x1be)+_0xb9fce2),console[_0x32388b(0x1d0)]('\x20\x20Parent\x20segment:\x20'+_0x261fb8['parentSegment']),console[_0x32388b(0x1d0)](_0x32388b(0x1b2)+_0x261fb8[_0x32388b(0x175)]),console[_0x32388b(0x1d0)]('\x20\x20Folder\x20path:\x20'+(_0x261fb8['folderPath']||_0x32388b(0x1c9))),console[_0x32388b(0x1d0)](_0x32388b(0x1f7)+_0x261fb8[_0x32388b(0x1fb)])),_0x261fb8[_0x32388b(0x1fb)];}catch(_0x4d3e78){throw new SDKError(ErrorCode[_0x32388b(0x19a)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x4d3e78[_0x32388b(0x1c2)]);}if(!_0x54272f)throw new SDKError(ErrorCode[_0x32388b(0x19a)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x54272f+'/'+_0xb9fce2;}export class SegmentDescribeCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x1cc);[a28_0x4aabba(0x161)]='Show\x20segment\x20or\x20folder\x20details';async[a28_0x4aabba(0x1da)](_0x45220c){const _0x2b3514=a28_0x4aabba,{options:_0x2b1d27,args:_0x1d26fc,tdx:_0x285dcd}=_0x45220c,_0x345c53=_0x1d26fc[0x0],_0x45e562=!_0x345c53&&!!_0x2b1d27['parentSegment'],_0x272b54=_0x345c53||_0x2b1d27[_0x2b3514(0x1c7)];if(!_0x272b54)return console['error'](_0x2b3514(0x1c8)),console[_0x2b3514(0x1d0)](_0x2b3514(0x1db)),console['error']('Examples:'),console[_0x2b3514(0x1d0)](_0x2b3514(0x1fc)),console[_0x2b3514(0x1d0)](_0x2b3514(0x1f9)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error'](_0x2b3514(0x1ee)),0x1;try{const _0x56538b=_0x2b1d27[_0x2b3514(0x1f1)];let _0x548690=_0x272b54;!_0x45e562&&_0x56538b&&!_0x272b54[_0x2b3514(0x171)]('/')&&(_0x548690=_0x56538b+'/'+_0x272b54,_0x2b1d27[_0x2b3514(0x18c)]&&console[_0x2b3514(0x1d0)](_0x2b3514(0x186)+_0x548690));const _0x1706e3=await withSpinner('Resolving\x20path\x20\x27'+_0x548690+_0x2b3514(0x1b8),()=>_0x285dcd[_0x2b3514(0x1f0)][_0x2b3514(0x17b)](_0x548690),{'verbose':_0x2b1d27['verbose']}),_0x45d72a=_0x1706e3['data'];_0x2b1d27[_0x2b3514(0x18c)]&&(console[_0x2b3514(0x1d0)](_0x2b3514(0x1e7)+_0x45d72a[_0x2b3514(0x19c)]),console['error'](_0x2b3514(0x194)+_0x45d72a[_0x2b3514(0x1cd)]),_0x45d72a[_0x2b3514(0x167)]&&console[_0x2b3514(0x1d0)]('Folder\x20ID:\x20'+_0x45d72a[_0x2b3514(0x167)]),_0x45d72a['segmentId']&&console[_0x2b3514(0x1d0)](_0x2b3514(0x19b)+_0x45d72a[_0x2b3514(0x1c6)]));if(_0x45d72a[_0x2b3514(0x19c)]==='parent'){const _0x4fe3b5=await withSpinner(_0x2b3514(0x185),()=>_0x285dcd[_0x2b3514(0x1f0)][_0x2b3514(0x1dd)](_0x45d72a['parentId']),{'verbose':_0x2b1d27[_0x2b3514(0x18c)]});await handleSingleObjectOutput(_0x4fe3b5[_0x2b3514(0x1b5)],_0x2b1d27);}else{if(_0x45d72a[_0x2b3514(0x19c)]===_0x2b3514(0x1f5)){if(!_0x45d72a[_0x2b3514(0x167)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x2b3514(0x1f8));const _0x10b901=await withSpinner(_0x2b3514(0x1bb),()=>_0x285dcd[_0x2b3514(0x1f0)][_0x2b3514(0x1b4)](_0x45d72a['folderId']),{'verbose':_0x2b1d27[_0x2b3514(0x18c)]});await handleSingleObjectOutput(_0x10b901[_0x2b3514(0x1b5)],_0x2b1d27);}else{if(_0x45d72a[_0x2b3514(0x19c)]===_0x2b3514(0x1f0)){if(!_0x45d72a[_0x2b3514(0x1c6)])throw new SDKError(ErrorCode[_0x2b3514(0x1b9)],_0x2b3514(0x17f));const _0x16c761=await withSpinner('Fetching\x20segment\x20details...',()=>_0x285dcd[_0x2b3514(0x1f0)]['getSegment'](_0x45d72a[_0x2b3514(0x1cd)],_0x45d72a['segmentId']),{'verbose':_0x2b1d27[_0x2b3514(0x18c)]});await handleSingleObjectOutput(_0x16c761['data'],_0x2b1d27);}}}return 0x0;}catch(_0x38c955){if(_0x38c955 instanceof SDKError)return console[_0x2b3514(0x1d0)](_0x2b3514(0x1c3)+_0x38c955[_0x2b3514(0x1c2)]),_0x38c955[_0x2b3514(0x1f6)]&&console['error']('\x20\x20Cause:\x20'+_0x38c955[_0x2b3514(0x1f6)]),0x1;throw _0x38c955;}}}export class SegmentShowCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x18a);[a28_0x4aabba(0x161)]=a28_0x4aabba(0x160);async[a28_0x4aabba(0x1da)](_0x1a61c4){const _0x3ca743=a28_0x4aabba,{options:_0x5b9204,args:_0x557f64,tdx:_0x2cd4bb}=_0x1a61c4,_0x4f8590=_0x557f64[0x0];if(!_0x4f8590)return console[_0x3ca743(0x1d0)](_0x3ca743(0x16b)),console[_0x3ca743(0x1d0)](_0x3ca743(0x1eb)),console[_0x3ca743(0x1d0)](_0x3ca743(0x18f)),console['error']('Examples:'),console[_0x3ca743(0x1d0)](_0x3ca743(0x173)),console[_0x3ca743(0x1d0)](_0x3ca743(0x17c)),0x1;try{const _0x37c857=_0x5b9204[_0x3ca743(0x1c7)],_0x55dcc5=await resolveSegmentTarget(_0x4f8590,_0x37c857,_0x5b9204['verbose']);_0x5b9204['verbose']&&console[_0x3ca743(0x1d0)](_0x3ca743(0x176)+_0x55dcc5);const _0x3ca194=await withSpinner('Resolving\x20\x27'+_0x4f8590+_0x3ca743(0x1b8),()=>_0x2cd4bb[_0x3ca743(0x1f0)][_0x3ca743(0x17b)](_0x55dcc5),{'verbose':_0x5b9204['verbose']}),_0x57139c=_0x3ca194[_0x3ca743(0x1b5)];_0x5b9204[_0x3ca743(0x18c)]&&(console[_0x3ca743(0x1d0)](_0x3ca743(0x1e7)+_0x57139c[_0x3ca743(0x19c)]),console[_0x3ca743(0x1d0)]('Parent\x20ID:\x20'+_0x57139c['parentId']));if(_0x57139c[_0x3ca743(0x19c)]===_0x3ca743(0x1f5))return console[_0x3ca743(0x1d0)](_0x3ca743(0x1ca)),console[_0x3ca743(0x1d0)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x57139c[_0x3ca743(0x19c)]==='parent')return console[_0x3ca743(0x1d0)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3ca743(0x1d0)](_0x3ca743(0x1cb)),0x1;if(!_0x57139c[_0x3ca743(0x1c6)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x58f5e2=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x2cd4bb[_0x3ca743(0x1f0)][_0x3ca743(0x1a8)](_0x57139c['parentId'],_0x57139c[_0x3ca743(0x1c6)]),{'verbose':_0x5b9204[_0x3ca743(0x18c)]});let _0x5108d4=_0x58f5e2[_0x3ca743(0x1b5)];const _0x35f072=resolveLimit(_0x5b9204[_0x3ca743(0x18b)],DEFAULT_DISPLAY_LIMIT),_0x58e87e=/\bLIMIT\s+\d+/i[_0x3ca743(0x16d)](_0x5108d4);!_0x58e87e&&(_0x5108d4=_0x5108d4['trim']()['replace'](/;+$/,''),_0x5108d4=_0x3ca743(0x1d5)+_0x5108d4+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x35f072);_0x5b9204[_0x3ca743(0x18c)]&&console[_0x3ca743(0x1d0)](_0x3ca743(0x168)+_0x5108d4);const _0x398fc1=await withProgressSpinner(_0x3ca743(0x17e),async _0x49390d=>{const _0x35fef7=_0x3ca743,_0x202df2=await _0x2cd4bb[_0x35fef7(0x184)][_0x35fef7(0x1da)](_0x5108d4,{'catalog':'td','schema':_0x35fef7(0x166),'onJobId':_0x480608=>{const _0x2beb9b=_0x35fef7;_0x49390d[_0x2beb9b(0x1a3)](_0x480608);}});return _0x202df2;},{'verbose':_0x5b9204[_0x3ca743(0x18c)]}),_0x483466=_0x398fc1[_0x3ca743(0x1b5)],_0x475ab3=_0x483466[_0x3ca743(0x192)]?_0x3ca743(0x19f)+_0x483466[_0x3ca743(0x192)]+']':'';return console[_0x3ca743(0x1d0)](_0x3ca743(0x180)+_0x483466['stats']['processedRows'][_0x3ca743(0x1ed)]()+_0x3ca743(0x1ea)+(_0x3ca743(0x1a2)+formatElapsed(_0x483466[_0x3ca743(0x1d1)][_0x3ca743(0x16a)])+_0x475ab3)),await handleQueryOutput(_0x483466,_0x5b9204),0x0;}catch(_0x2c2b70){if(_0x2c2b70 instanceof SDKError)return console[_0x3ca743(0x1d0)](_0x3ca743(0x1d6)+_0x2c2b70[_0x3ca743(0x1d3)]+']'),console[_0x3ca743(0x1d0)]('\x0a'+_0x2c2b70[_0x3ca743(0x1c2)]),0x1;throw _0x2c2b70;}}}export class SegmentFolderListCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x1f4);['description']=a28_0x4aabba(0x177);async[a28_0x4aabba(0x1da)](_0xad9284){const _0x242324=a28_0x4aabba,{options:_0x43e170,args:_0x48f696,tdx:_0x4054b8}=_0xad9284;if(_0x48f696['length']===0x0)return console[_0x242324(0x1d0)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x242324(0x1d0)](_0x242324(0x1ec)),0x1;const _0x2a1dad=_0x48f696[0x0];try{_0x43e170[_0x242324(0x18c)]&&(console[_0x242324(0x1d0)]('Site:\x20'+_0x43e170[_0x242324(0x1e6)]),console['error'](_0x242324(0x169)+_0x2a1dad));const _0x4d8c94=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2a1dad+_0x242324(0x1b8),()=>_0x4054b8['segment'][_0x242324(0x1bc)](_0x2a1dad),{'verbose':_0x43e170[_0x242324(0x18c)]}),_0x3bdc0c=_0x4d8c94[_0x242324(0x1b5)];_0x43e170['verbose']&&console[_0x242324(0x1d0)](_0x242324(0x162)+_0x3bdc0c);const _0x3b6947=await withSpinner(_0x242324(0x1a6)+_0x2a1dad+'\x27...',()=>_0x4054b8[_0x242324(0x1f0)][_0x242324(0x1f2)](_0x3bdc0c),{'verbose':_0x43e170[_0x242324(0x18c)]}),_0x133c3d=_0x3b6947[_0x242324(0x1b5)];return console['error'](_0x242324(0x1bd)+_0x133c3d[_0x242324(0x178)]+_0x242324(0x198)+(_0x133c3d['length']!==0x1?'s':'')),await handleSDKOutput(_0x133c3d,_0x43e170),0x0;}catch(_0x238307){if(_0x238307 instanceof SDKError)return console[_0x242324(0x1d0)](_0x242324(0x1c3)+_0x238307[_0x242324(0x1c2)]),_0x238307[_0x242324(0x1f6)]&&console[_0x242324(0x1d0)](_0x242324(0x174)+_0x238307[_0x242324(0x1f6)]),0x1;throw _0x238307;}}}export class SegmentFolderShowCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x1e3);[a28_0x4aabba(0x161)]=a28_0x4aabba(0x1ba);async['execute'](_0x3e6af2){const _0x533141=a28_0x4aabba,{options:_0x2dccc2,args:_0x3a0b7c,tdx:_0x30bdec}=_0x3e6af2;if(_0x3a0b7c[_0x533141(0x178)]===0x0)return console[_0x533141(0x1d0)](_0x533141(0x1c1)),console[_0x533141(0x1d0)](_0x533141(0x191)),0x1;try{const {parentId:_0xce2e2b,childId:_0x24af8b}=parseSegmentRef(_0x3a0b7c[0x0]);_0x2dccc2[_0x533141(0x18c)]&&(console[_0x533141(0x1d0)](_0x533141(0x183)+_0x2dccc2[_0x533141(0x1e6)]),console[_0x533141(0x1d0)](_0x533141(0x169)+_0xce2e2b),_0x24af8b&&console[_0x533141(0x1d0)](_0x533141(0x1aa)+_0x24af8b));if(!_0x24af8b)return console[_0x533141(0x1d0)](_0x533141(0x16c)),0x1;const _0x1daf38=await withSpinner(_0x533141(0x182)+_0xce2e2b+_0x533141(0x1b8),()=>_0x30bdec[_0x533141(0x1f0)][_0x533141(0x1bc)](_0xce2e2b),{'verbose':_0x2dccc2[_0x533141(0x18c)]}),_0x492175=_0x1daf38['data'];_0x2dccc2[_0x533141(0x18c)]&&console[_0x533141(0x1d0)](_0x533141(0x162)+_0x492175);const _0x17a76f=await withSpinner(_0x533141(0x188)+_0x24af8b+_0x533141(0x1b8),()=>_0x30bdec['segment'][_0x533141(0x190)](_0x492175,_0x24af8b),{'verbose':_0x2dccc2[_0x533141(0x18c)]}),_0x14bc8f=_0x17a76f[_0x533141(0x1b5)];_0x2dccc2['verbose']&&console[_0x533141(0x1d0)]('Resolved\x20folder\x20ID:\x20'+_0x14bc8f);const _0x53985c=await withSpinner(_0x533141(0x1ef)+_0x24af8b+_0x533141(0x1b8),()=>_0x30bdec['segment']['getFolder'](_0x14bc8f),{'verbose':_0x2dccc2[_0x533141(0x18c)]});return await handleSDKOutput([_0x53985c['data']],_0x2dccc2),0x0;}catch(_0x43aeed){if(_0x43aeed instanceof SDKError)return console['error'](_0x533141(0x1c3)+_0x43aeed[_0x533141(0x1c2)]),_0x43aeed[_0x533141(0x1f6)]&&console[_0x533141(0x1d0)](_0x533141(0x174)+_0x43aeed['cause']),0x1;throw _0x43aeed;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a28_0x4aabba(0x1af);[a28_0x4aabba(0x161)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a28_0x4aabba(0x1da)](_0xf0f6c1){const _0x24b7e3=a28_0x4aabba,{options:_0x1fd6f3,args:_0x301421,tdx:_0x9b927a}=_0xf0f6c1,_0xf935d=_0x301421[0x0];if(!_0xf935d)return console[_0x24b7e3(0x1d0)](_0x24b7e3(0x16b)),console['error'](_0x24b7e3(0x16e)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x19d)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1e1)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1d8)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1d9)),0x1;try{const _0x228613=_0x1fd6f3[_0x24b7e3(0x1c7)],_0x534069=await resolveSegmentTarget(_0xf935d,_0x228613,_0x1fd6f3[_0x24b7e3(0x18c)]);_0x1fd6f3[_0x24b7e3(0x18c)]&&console['error'](_0x24b7e3(0x176)+_0x534069);const _0x442fd4=await withSpinner('Resolving\x20\x27'+_0xf935d+_0x24b7e3(0x1b8),()=>_0x9b927a['segment'][_0x24b7e3(0x17b)](_0x534069),{'verbose':_0x1fd6f3[_0x24b7e3(0x18c)]}),_0x521871=_0x442fd4[_0x24b7e3(0x1b5)];_0x1fd6f3[_0x24b7e3(0x18c)]&&(console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1e7)+_0x521871[_0x24b7e3(0x19c)]),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x194)+_0x521871['parentId']));if(_0x521871[_0x24b7e3(0x19c)]===_0x24b7e3(0x1f5))return console['error'](_0x24b7e3(0x1bf)),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x196)),0x1;if(_0x521871[_0x24b7e3(0x19c)]===_0x24b7e3(0x18e))return console[_0x24b7e3(0x1d0)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1de)),0x1;if(!_0x521871[_0x24b7e3(0x1c6)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x24b7e3(0x17f));const _0x39f45a=await withSpinner(_0x24b7e3(0x1a5),()=>_0x9b927a[_0x24b7e3(0x1f0)][_0x24b7e3(0x1a8)](_0x521871[_0x24b7e3(0x1cd)],_0x521871[_0x24b7e3(0x1c6)]),{'verbose':_0x1fd6f3[_0x24b7e3(0x18c)]}),_0x4b7603=_0x39f45a[_0x24b7e3(0x1b5)];return _0x1fd6f3[_0x24b7e3(0x197)]===_0x24b7e3(0x1b1)||_0x1fd6f3[_0x24b7e3(0x197)]===_0x24b7e3(0x1e8)?await handleSDKOutput([{'sql':_0x4b7603}],_0x1fd6f3):console[_0x24b7e3(0x1ac)](_0x4b7603),0x0;}catch(_0x34140d){if(_0x34140d instanceof SDKError)return console[_0x24b7e3(0x1d0)](_0x24b7e3(0x1c3)+_0x34140d[_0x24b7e3(0x1c2)]),_0x34140d['cause']&&console[_0x24b7e3(0x1d0)](_0x24b7e3(0x174)+_0x34140d['cause']),0x1;throw _0x34140d;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x1a7);[a28_0x4aabba(0x161)]=a28_0x4aabba(0x189);async[a28_0x4aabba(0x1da)](_0x235f25){const _0xd47028=a28_0x4aabba,{options:_0x1d8019,args:_0x5b3dd6,tdx:_0x1a3b68}=_0x235f25,_0x3511e7=_0x1d8019;if(_0x5b3dd6[_0xd47028(0x178)]<0x2)return console[_0xd47028(0x1d0)](_0xd47028(0x1a1)),console[_0xd47028(0x1d0)](_0xd47028(0x1b0)),0x1;const _0x386b53=_0x5b3dd6[0x0],_0x2255e0=_0x5b3dd6[0x1];_0x3511e7[_0xd47028(0x18c)]&&(console[_0xd47028(0x1d0)]('Site:\x20'+_0x3511e7[_0xd47028(0x1e6)]),console[_0xd47028(0x1d0)](_0xd47028(0x1d4)+_0x386b53),console[_0xd47028(0x1d0)]('Folder\x20name:\x20'+_0x2255e0));let _0x1f34f6;if(_0x3511e7[_0xd47028(0x1e0)]){const _0x36149d=_0x3511e7[_0xd47028(0x1e0)],_0x460513=await withSpinner(_0xd47028(0x182)+_0x386b53+'\x27...',()=>_0x1a3b68[_0xd47028(0x1f0)][_0xd47028(0x1bc)](_0x386b53),{'verbose':_0x3511e7[_0xd47028(0x18c)]}),_0x51d55d=_0x460513[_0xd47028(0x1b5)],_0x341d41=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x36149d+_0xd47028(0x1b8),()=>_0x1a3b68[_0xd47028(0x1f0)]['resolveFolderId'](_0x51d55d,_0x36149d),{'verbose':_0x3511e7[_0xd47028(0x18c)]});_0x1f34f6=_0x341d41[_0xd47028(0x1b5)],_0x3511e7[_0xd47028(0x18c)]&&console[_0xd47028(0x1d0)](_0xd47028(0x199)+_0x1f34f6);}const _0x498124={'name':_0x2255e0,'description':_0x3511e7[_0xd47028(0x161)],'parentFolderId':_0x1f34f6},_0x2fb56f=await withSpinner(_0xd47028(0x19e)+_0x2255e0+_0xd47028(0x1b8),()=>_0x1a3b68['segment'][_0xd47028(0x1cf)](_0x386b53,_0x498124),{'verbose':_0x3511e7[_0xd47028(0x18c)]}),_0x4ba0b7=_0x2fb56f[_0xd47028(0x1b5)];return console[_0xd47028(0x1d0)](_0xd47028(0x1a0)+_0x4ba0b7['name']+'\x27\x20with\x20ID:\x20'+_0x4ba0b7['id']),await handleSDKOutput([_0x4ba0b7],_0x3511e7),0x0;}}function a28_0x11aa(_0x64645a,_0x105fe6){_0x64645a=_0x64645a-0x15f;const _0x5d1a66=a28_0x5d1a();let _0x11aa77=_0x5d1a66[_0x64645a];return _0x11aa77;}function a28_0x5d1a(){const _0x23632d=['folderId','SQL\x20query:\x0a','Parent\x20name:\x20','elapsedTimeMillis','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','test','Usage:\x20tdx\x20sg\x20sql\x20<name>','1917000VDNewF','Folder\x20ID:\x20','includes','getSegment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','\x20\x20Cause:\x20','segmentName','Target\x20path:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','length','29899590xoUxtt','/app/ps/','resolvePathToResource','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','12466008flXJkN','Executing\x20segment\x20query...','Segment\x20ID\x20missing\x20from\x20resolved\x20path','βœ”\x20Query\x20completed:\x20Processed\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Resolving\x20parent\x20segment\x20\x27','Site:\x20','query','Fetching\x20parent\x20segment\x20details...','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Resolving\x20folder\x20\x27','Create\x20segment\x20folder\x20for\x20organization','segment:show','limit','verbose','157283XOublg','parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','resolveFolderId','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','jobId','1003974TViDuy','Parent\x20ID:\x20','279326mxzhSX','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','format','\x20folder','Resolved\x20parent\x20folder\x20ID:\x20','INVALID_ARGUMENT','Segment\x20ID:\x20','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Creating\x20folder\x20\x27','\x20[Job\x20ID:\x20','βœ”\x20Created\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','in\x20','setJobId','name','Fetching\x20SQL\x20for\x20segment...','Listing\x20folders\x20for\x20parent\x20\x27','segment:folder:create','getSegmentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Folder\x20name:\x20','272qQCVmE','log','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20view\x20-w','segment:sql','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','json','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','getFolder','data','\x20Opening\x20','500662HdWGjy','\x27...','SEGMENT_NOT_FOUND','Show\x20segment\x20folder\x20details','Fetching\x20folder\x20details...','resolveParentId','βœ”\x20Found\x20','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','33lHbJjW','Error:\x20Folder\x20reference\x20is\x20required','message','Error:\x20','Fetching\x20segment\x20details...','Use:\x20tdx\x20ps\x20desc','segmentId','parentSegment','Error:\x20Path\x20or\x20name\x20is\x20required','(root)','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Use:\x20tdx\x20ps\x20show','segment:describe','parentId','cyan','createFolder','error','stats','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','code','Parent\x20segment:\x20','SELECT\x20*\x20FROM\x20(\x0a','βœ–\x20Query\x20failed\x20[','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','execute','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','getParent','Use:\x20tdx\x20ps\x20sql','/e/','parentFolder','Examples:','Resolving\x20\x27','segment:folder:show','url','Usage:\x20tdx\x20sg\x20desc\x20<name>','site','Resolved\x20type:\x20','jsonl','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20rows\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','toLocaleString','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Fetching\x20folder\x20\x27','segment','segmentPath','listFolders','20jRPpnP','segment:folder:list','folder','cause','\x20\x20Full\x20path:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','web','fullPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','green','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','description','Resolved\x20parent\x20ID:\x20','segment:view','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Use:\x20tdx\x20ps\x20view','information_schema'];a28_0x5d1a=function(){return _0x23632d;};return a28_0x5d1a();}export class SegmentViewCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]=a28_0x4aabba(0x163);['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async[a28_0x4aabba(0x1da)](_0xbc676){const _0x1bf912=a28_0x4aabba,{options:_0x47b49c,args:_0x1955f7,tdx:_0x676d89}=_0xbc676,_0x37741c=_0x1955f7[0x0];if(!_0x37741c)return console[_0x1bf912(0x1d0)](_0x1bf912(0x15f)),console['error'](_0x1bf912(0x1d7)),console[_0x1bf912(0x1d0)](_0x1bf912(0x1a9)),console['error']('Options:'),console[_0x1bf912(0x1d0)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x1bf912(0x1d0)](_0x1bf912(0x1e1)),console[_0x1bf912(0x1d0)](_0x1bf912(0x1b3)),console[_0x1bf912(0x1d0)](_0x1bf912(0x1e9)),console['error'](_0x1bf912(0x1d2)),console[_0x1bf912(0x1d0)](_0x1bf912(0x187)),0x1;try{const _0x3a1975=_0x47b49c[_0x1bf912(0x1c7)],_0x124b27=await resolveSegmentTarget(_0x37741c,_0x3a1975,_0x47b49c['verbose']);_0x47b49c[_0x1bf912(0x18c)]&&console[_0x1bf912(0x1d0)](_0x1bf912(0x176)+_0x124b27);const _0x52ee39=await withSpinner(_0x1bf912(0x1e2)+_0x37741c+_0x1bf912(0x1b8),()=>_0x676d89[_0x1bf912(0x1f0)][_0x1bf912(0x17b)](_0x124b27),{'verbose':_0x47b49c['verbose']}),_0x2ddb3c=_0x52ee39['data'];_0x47b49c[_0x1bf912(0x18c)]&&(console[_0x1bf912(0x1d0)](_0x1bf912(0x1e7)+_0x2ddb3c[_0x1bf912(0x19c)]),console[_0x1bf912(0x1d0)](_0x1bf912(0x194)+_0x2ddb3c[_0x1bf912(0x1cd)]),_0x2ddb3c['folderId']&&console[_0x1bf912(0x1d0)](_0x1bf912(0x170)+_0x2ddb3c[_0x1bf912(0x167)]),_0x2ddb3c[_0x1bf912(0x1c6)]&&console[_0x1bf912(0x1d0)](_0x1bf912(0x19b)+_0x2ddb3c[_0x1bf912(0x1c6)]));if(_0x47b49c[_0x1bf912(0x1fa)]){if(_0x2ddb3c[_0x1bf912(0x19c)]==='folder')return console[_0x1bf912(0x1d0)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x2ddb3c[_0x1bf912(0x19c)]===_0x1bf912(0x18e))return console[_0x1bf912(0x1d0)](_0x1bf912(0x1ad)),console[_0x1bf912(0x1d0)](_0x1bf912(0x1ae)),0x1;if(!_0x2ddb3c[_0x1bf912(0x1c6)])throw new SDKError(ErrorCode[_0x1bf912(0x1b9)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x257db3=getConsoleNextUrl(_0x47b49c[_0x1bf912(0x1e6)],_0x1bf912(0x17a)+_0x2ddb3c['parentId']+_0x1bf912(0x1df)+_0x2ddb3c[_0x1bf912(0x1c6)]);return console['error'](a28_0x16e550[_0x1bf912(0x1fd)]('βœ”')+_0x1bf912(0x1b6)+a28_0x16e550[_0x1bf912(0x1ce)](_0x257db3)),openBrowser(_0x257db3),0x0;}if(_0x2ddb3c[_0x1bf912(0x19c)]===_0x1bf912(0x1f5)){if(!_0x2ddb3c['folderId'])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x1bf912(0x1f8));const _0x58879b=await withSpinner('Fetching\x20folder\x20details...',()=>_0x676d89[_0x1bf912(0x1f0)][_0x1bf912(0x1b4)](_0x2ddb3c[_0x1bf912(0x167)]),{'verbose':_0x47b49c['verbose']});await handleSingleObjectOutput(_0x58879b[_0x1bf912(0x1b5)],_0x47b49c);}else{if(_0x2ddb3c[_0x1bf912(0x19c)]===_0x1bf912(0x1f0)){if(!_0x2ddb3c[_0x1bf912(0x1c6)])throw new SDKError(ErrorCode[_0x1bf912(0x1b9)],_0x1bf912(0x17f));const _0x17bcb0=await withSpinner(_0x1bf912(0x1c4),()=>_0x676d89[_0x1bf912(0x1f0)][_0x1bf912(0x172)](_0x2ddb3c['parentId'],_0x2ddb3c[_0x1bf912(0x1c6)]),{'verbose':_0x47b49c[_0x1bf912(0x18c)]}),_0x511009=getConsoleNextUrl(_0x47b49c[_0x1bf912(0x1e6)],_0x1bf912(0x17a)+_0x2ddb3c[_0x1bf912(0x1cd)]+'/e/'+_0x2ddb3c[_0x1bf912(0x1c6)]),_0x511226=_0x17bcb0[_0x1bf912(0x1b5)];_0x511226[_0x1bf912(0x1e4)]=_0x511009,await handleSingleObjectOutput(_0x511226,_0x47b49c);}else return console[_0x1bf912(0x1d0)](_0x1bf912(0x181)),console[_0x1bf912(0x1d0)](_0x1bf912(0x165)),0x1;}return 0x0;}catch(_0x3504df){if(_0x3504df instanceof SDKError)return console[_0x1bf912(0x1d0)](_0x1bf912(0x1c3)+_0x3504df[_0x1bf912(0x1c2)]),_0x3504df[_0x1bf912(0x1f6)]&&console['error'](_0x1bf912(0x174)+_0x3504df[_0x1bf912(0x1f6)]),0x1;throw _0x3504df;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a28_0x4aabba(0x1a4)]='segment:desc';[a28_0x4aabba(0x161)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a28_0x4aabba(0x1da)](_0x6b81d7){const _0x3f569a=a28_0x4aabba,{options:_0x32112f,args:_0x1a41e6,tdx:_0x16b083}=_0x6b81d7,_0x1dca92=_0x1a41e6[0x0];if(!_0x1dca92)return console[_0x3f569a(0x1d0)](_0x3f569a(0x16b)),console[_0x3f569a(0x1d0)](_0x3f569a(0x1e5)),console[_0x3f569a(0x1d0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x3f569a(0x1e1)),console[_0x3f569a(0x1d0)](_0x3f569a(0x1dc)),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x129c78=_0x32112f['parentSegment'],_0x5ecbfd=await resolveSegmentTarget(_0x1dca92,_0x129c78,_0x32112f[_0x3f569a(0x18c)]);_0x32112f[_0x3f569a(0x18c)]&&console[_0x3f569a(0x1d0)](_0x3f569a(0x176)+_0x5ecbfd);const _0x555b2f=await withSpinner(_0x3f569a(0x1e2)+_0x1dca92+_0x3f569a(0x1b8),()=>_0x16b083[_0x3f569a(0x1f0)][_0x3f569a(0x17b)](_0x5ecbfd),{'verbose':_0x32112f[_0x3f569a(0x18c)]}),_0x48a17f=_0x555b2f[_0x3f569a(0x1b5)];_0x32112f[_0x3f569a(0x18c)]&&(console[_0x3f569a(0x1d0)]('Resolved\x20type:\x20'+_0x48a17f[_0x3f569a(0x19c)]),console['error'](_0x3f569a(0x194)+_0x48a17f[_0x3f569a(0x1cd)]));if(_0x48a17f[_0x3f569a(0x19c)]===_0x3f569a(0x1f5))return console[_0x3f569a(0x1d0)](_0x3f569a(0x164)),console[_0x3f569a(0x1d0)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x48a17f[_0x3f569a(0x19c)]==='parent')return console[_0x3f569a(0x1d0)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3f569a(0x1d0)](_0x3f569a(0x1c5)),0x1;if(!_0x48a17f[_0x3f569a(0x1c6)])throw new SDKError(ErrorCode[_0x3f569a(0x1b9)],_0x3f569a(0x17f));const _0x23744e=await withSpinner(_0x3f569a(0x1a5),()=>_0x16b083[_0x3f569a(0x1f0)][_0x3f569a(0x1a8)](_0x48a17f[_0x3f569a(0x1cd)],_0x48a17f[_0x3f569a(0x1c6)]),{'verbose':_0x32112f[_0x3f569a(0x18c)]}),_0x1d3c0e=_0x23744e[_0x3f569a(0x1b5)],_0x52b73c=await executeSchemaQuery(_0x1d3c0e,_0x16b083,_0x32112f);return await handleQueryOutput(_0x52b73c,_0x32112f),0x0;}catch(_0x3b3c9c){if(_0x3b3c9c instanceof SDKError)return console[_0x3f569a(0x1d0)](_0x3f569a(0x1c3)+_0x3b3c9c[_0x3f569a(0x1c2)]),_0x3b3c9c[_0x3f569a(0x1f6)]&&console[_0x3f569a(0x1d0)](_0x3f569a(0x174)+_0x3b3c9c[_0x3f569a(0x1f6)]),0x1;throw _0x3b3c9c;}}}
1
+ const a28_0x3e8eb1=a28_0x4395;(function(_0x36ea2b,_0x36e4fb){const _0x1a1501=a28_0x4395,_0x494d02=_0x36ea2b();while(!![]){try{const _0x77fdc8=-parseInt(_0x1a1501(0x219))/0x1+parseInt(_0x1a1501(0x1ed))/0x2+-parseInt(_0x1a1501(0x209))/0x3+parseInt(_0x1a1501(0x270))/0x4+-parseInt(_0x1a1501(0x20c))/0x5+-parseInt(_0x1a1501(0x224))/0x6*(-parseInt(_0x1a1501(0x251))/0x7)+-parseInt(_0x1a1501(0x25b))/0x8*(-parseInt(_0x1a1501(0x20a))/0x9);if(_0x77fdc8===_0x36e4fb)break;else _0x494d02['push'](_0x494d02['shift']());}catch(_0x2cca8d){_0x494d02['push'](_0x494d02['shift']());}}}(a28_0x5cf9,0x2d6ea));function a28_0x5cf9(){const _0x48bd54=['setJobId','getParent','Resolved\x20folder\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','createFolder','SEGMENT_FOLDER_NOT_FOUND','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Show\x20folder\x20or\x20child\x20segment\x20details','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segmentPath','Resolved\x20relative\x20path\x20to:\x20','Parent\x20name:\x20','Target\x20path:\x20','Show\x20child\x20segment\x20schema\x20(column\x20types)','limit','Use:\x20tdx\x20ps\x20show','Error:\x20','Use:\x20tdx\x20ps\x20desc','Examples:','segment:describe','segmentName','/app/ps/','resolvePathToResource','getSegment','/e/','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Resolved\x20type:\x20','Fetching\x20parent\x20segment\x20details...','format','folderId','segment:folder:show','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','βœ–\x20Query\x20failed\x20[','24241kRqBek','fullPath','Resolving\x20folder\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','json','data','βœ”\x20Found\x20','elapsedTimeMillis','segmentId','152Dlrqjo','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','folderPath','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','error','Resolving\x20\x27','segment:sql','cause','jobId','Executing\x20segment\x20query...','stats','segment:view','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20Segment\x20name:\x20','segment:desc','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Segment\x20ID:\x20','Show\x20segment\x20or\x20folder\x20details','Parent\x20ID:\x20','104440vQTCKX','getSegmentSQL','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','verbose','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Use:\x20tdx\x20ps\x20sql','web','execute','\x20\x20Cause:\x20','Resolved\x20parent\x20folder\x20ID:\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','SQL\x20query:\x0a','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','βœ”\x20Created\x20folder\x20\x27','Resolving\x20path\x20\x27','includes','information_schema','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Folder\x20ID:\x20','INVALID_ARGUMENT','resolveParentId','687476BmyFgY','Usage:\x20tdx\x20sg\x20desc\x20<name>','resolveFolderId','parentId','\x20\x20Parent\x20segment:\x20','\x20rows\x20','\x27...','segment:show','Fetching\x20SQL\x20for\x20segment...','Parent\x20segment:\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolved\x20YAML\x20file:\x20','Listing\x20folders\x20for\x20parent\x20\x27','SEGMENT_NOT_FOUND','Create\x20segment\x20folder\x20for\x20organization','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Use:\x20tdx\x20ps\x20view\x20-w','log','Error:\x20Path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Options:','segment:folder:create','getFolder','segment','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Site:\x20','783381FlFpGG','204615umduzC','name','1223685yBPNcX','Folder\x20name:\x20','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','folder','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','parent','jsonl','length','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','258768HCzDbW','Usage:\x20tdx\x20sg\x20show\x20<name>','βœ”\x20Query\x20completed:\x20Processed\x20','Fetching\x20folder\x20\x27','url','Fetching\x20folder\x20details...','\x20\x20Full\x20path:\x20','parentSegment','message','processedRows','site','258QpsnyN','Fetching\x20segment\x20details...','type','description','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20[Job\x20ID:\x20','parentFolder','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20Folder\x20path:\x20','replace','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','in\x20'];a28_0x5cf9=function(){return _0x48bd54;};return a28_0x5cf9();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a28_0x4395(_0x29dd86,_0x2f825b){_0x29dd86=_0x29dd86-0x1d9;const _0x5cf933=a28_0x5cf9();let _0x4395ca=_0x5cf933[_0x29dd86];return _0x4395ca;}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 a28_0x42c123 from'chalk';async function resolveSegmentTarget(_0x1ddb20,_0x15eac7,_0x3ce84c){const _0x2d6938=a28_0x4395;if(isYamlFilePath(_0x1ddb20))try{const _0x27535f=await resolveYamlFilePath(_0x1ddb20);return _0x3ce84c&&(console[_0x2d6938(0x260)](_0x2d6938(0x1f9)+_0x1ddb20),console['error'](_0x2d6938(0x1f1)+_0x27535f[_0x2d6938(0x220)]),console[_0x2d6938(0x260)](_0x2d6938(0x269)+_0x27535f[_0x2d6938(0x244)]),console['error'](_0x2d6938(0x22c)+(_0x27535f[_0x2d6938(0x25e)]||'(root)')),console['error'](_0x2d6938(0x21f)+_0x27535f[_0x2d6938(0x252)])),_0x27535f[_0x2d6938(0x252)];}catch(_0x258f7e){throw new SDKError(ErrorCode[_0x2d6938(0x1eb)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x258f7e[_0x2d6938(0x221)]);}if(!_0x15eac7)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x15eac7+'/'+_0x1ddb20;}export class SegmentDescribeCommand extends BaseCommand{[a28_0x3e8eb1(0x20b)]=a28_0x3e8eb1(0x243);[a28_0x3e8eb1(0x227)]=a28_0x3e8eb1(0x26e);async['execute'](_0x259be6){const _0x28f371=a28_0x3e8eb1,{options:_0x163b80,args:_0x3e83a6,tdx:_0x351207}=_0x259be6,_0x572025=_0x3e83a6[0x0],_0x228c18=!_0x572025&&!!_0x163b80['parentSegment'],_0x5a33cd=_0x572025||_0x163b80[_0x28f371(0x220)];if(!_0x5a33cd)return console[_0x28f371(0x260)](_0x28f371(0x200)),console['error'](_0x28f371(0x1f8)),console[_0x28f371(0x260)](_0x28f371(0x242)),console[_0x28f371(0x260)](_0x28f371(0x268)),console[_0x28f371(0x260)](_0x28f371(0x1e4)),console['error'](_0x28f371(0x25f)),console[_0x28f371(0x260)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x5d9738=_0x163b80[_0x28f371(0x239)];let _0x52dcfc=_0x5a33cd;!_0x228c18&&_0x5d9738&&!_0x5a33cd[_0x28f371(0x1e7)]('/')&&(_0x52dcfc=_0x5d9738+'/'+_0x5a33cd,_0x163b80[_0x28f371(0x273)]&&console['error'](_0x28f371(0x23a)+_0x52dcfc));const _0x55798d=await withSpinner(_0x28f371(0x1e6)+_0x52dcfc+_0x28f371(0x1f3),()=>_0x351207[_0x28f371(0x205)][_0x28f371(0x246)](_0x52dcfc),{'verbose':_0x163b80[_0x28f371(0x273)]}),_0x542eae=_0x55798d[_0x28f371(0x257)];_0x163b80[_0x28f371(0x273)]&&(console[_0x28f371(0x260)]('Resolved\x20type:\x20'+_0x542eae['type']),console[_0x28f371(0x260)](_0x28f371(0x26f)+_0x542eae[_0x28f371(0x1f0)]),_0x542eae[_0x28f371(0x24d)]&&console[_0x28f371(0x260)](_0x28f371(0x1ea)+_0x542eae['folderId']),_0x542eae['segmentId']&&console[_0x28f371(0x260)](_0x28f371(0x26d)+_0x542eae['segmentId']));if(_0x542eae['type']==='parent'){const _0x113e51=await withSpinner(_0x28f371(0x24b),()=>_0x351207[_0x28f371(0x205)][_0x28f371(0x231)](_0x542eae[_0x28f371(0x1f0)]),{'verbose':_0x163b80[_0x28f371(0x273)]});await handleSingleObjectOutput(_0x113e51[_0x28f371(0x257)],_0x163b80);}else{if(_0x542eae[_0x28f371(0x226)]===_0x28f371(0x212)){if(!_0x542eae[_0x28f371(0x24d)])throw new SDKError(ErrorCode[_0x28f371(0x235)],_0x28f371(0x238));const _0x33a789=await withSpinner(_0x28f371(0x21e),()=>_0x351207[_0x28f371(0x205)][_0x28f371(0x204)](_0x542eae[_0x28f371(0x24d)]),{'verbose':_0x163b80[_0x28f371(0x273)]});await handleSingleObjectOutput(_0x33a789['data'],_0x163b80);}else{if(_0x542eae[_0x28f371(0x226)]===_0x28f371(0x205)){if(!_0x542eae[_0x28f371(0x25a)])throw new SDKError(ErrorCode[_0x28f371(0x1fb)],_0x28f371(0x25c));const _0x1d0431=await withSpinner('Fetching\x20segment\x20details...',()=>_0x351207[_0x28f371(0x205)]['getSegment'](_0x542eae[_0x28f371(0x1f0)],_0x542eae[_0x28f371(0x25a)]),{'verbose':_0x163b80['verbose']});await handleSingleObjectOutput(_0x1d0431[_0x28f371(0x257)],_0x163b80);}}}return 0x0;}catch(_0x42feb3){if(_0x42feb3 instanceof SDKError)return console[_0x28f371(0x260)](_0x28f371(0x240)+_0x42feb3['message']),_0x42feb3[_0x28f371(0x263)]&&console[_0x28f371(0x260)](_0x28f371(0x1dd)+_0x42feb3[_0x28f371(0x263)]),0x1;throw _0x42feb3;}}}export class SegmentShowCommand extends BaseCommand{['name']=a28_0x3e8eb1(0x1f4);[a28_0x3e8eb1(0x227)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a28_0x3e8eb1(0x1dc)](_0x31bd35){const _0x336435=a28_0x3e8eb1,{options:_0x27c971,args:_0x30d381,tdx:_0x3e0e22}=_0x31bd35,_0x1547db=_0x30d381[0x0];if(!_0x1547db)return console['error'](_0x336435(0x213)),console[_0x336435(0x260)](_0x336435(0x21a)),console[_0x336435(0x260)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x336435(0x260)](_0x336435(0x242)),console[_0x336435(0x260)](_0x336435(0x272)),console['error']('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2061ea=_0x27c971[_0x336435(0x220)],_0xd10da1=await resolveSegmentTarget(_0x1547db,_0x2061ea,_0x27c971['verbose']);_0x27c971['verbose']&&console[_0x336435(0x260)](_0x336435(0x23c)+_0xd10da1);const _0x73355b=await withSpinner(_0x336435(0x261)+_0x1547db+_0x336435(0x1f3),()=>_0x3e0e22[_0x336435(0x205)][_0x336435(0x246)](_0xd10da1),{'verbose':_0x27c971['verbose']}),_0x75956=_0x73355b[_0x336435(0x257)];_0x27c971[_0x336435(0x273)]&&(console['error'](_0x336435(0x24a)+_0x75956['type']),console[_0x336435(0x260)](_0x336435(0x26f)+_0x75956[_0x336435(0x1f0)]));if(_0x75956[_0x336435(0x226)]===_0x336435(0x212))return console[_0x336435(0x260)](_0x336435(0x255)),console[_0x336435(0x260)](_0x336435(0x22b)),0x1;if(_0x75956['type']===_0x336435(0x215))return console[_0x336435(0x260)](_0x336435(0x210)),console[_0x336435(0x260)](_0x336435(0x23f)),0x1;if(!_0x75956[_0x336435(0x25a)])throw new SDKError(ErrorCode[_0x336435(0x1fb)],_0x336435(0x25c));const _0x5699cc=await withSpinner(_0x336435(0x1f5),()=>_0x3e0e22[_0x336435(0x205)][_0x336435(0x271)](_0x75956[_0x336435(0x1f0)],_0x75956['segmentId']),{'verbose':_0x27c971[_0x336435(0x273)]});let _0x288fa7=_0x5699cc[_0x336435(0x257)];const _0xa344ed=resolveLimit(_0x27c971[_0x336435(0x23e)],DEFAULT_DISPLAY_LIMIT),_0x3b4169=/\bLIMIT\s+\d+/i['test'](_0x288fa7);!_0x3b4169&&(_0x288fa7=_0x288fa7['trim']()[_0x336435(0x22d)](/;+$/,''),_0x288fa7='SELECT\x20*\x20FROM\x20(\x0a'+_0x288fa7+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0xa344ed);_0x27c971[_0x336435(0x273)]&&console['error'](_0x336435(0x1e0)+_0x288fa7);const _0x22d1d8=await withProgressSpinner(_0x336435(0x265),async _0x3d5f85=>{const _0x404eb6=_0x336435,_0x266195=await _0x3e0e22['query'][_0x404eb6(0x1dc)](_0x288fa7,{'catalog':'td','schema':_0x404eb6(0x1e8),'onJobId':_0x2ee6dd=>{const _0x3f09e3=_0x404eb6;_0x3d5f85[_0x3f09e3(0x230)](_0x2ee6dd);}});return _0x266195;},{'verbose':_0x27c971[_0x336435(0x273)]}),_0x2e041e=_0x22d1d8['data'],_0x25139e=_0x2e041e[_0x336435(0x264)]?_0x336435(0x229)+_0x2e041e[_0x336435(0x264)]+']':'';return console[_0x336435(0x260)](_0x336435(0x21b)+_0x2e041e[_0x336435(0x266)][_0x336435(0x222)]['toLocaleString']()+_0x336435(0x1f2)+(_0x336435(0x22f)+formatElapsed(_0x2e041e[_0x336435(0x266)][_0x336435(0x259)])+_0x25139e)),await handleQueryOutput(_0x2e041e,_0x27c971),0x0;}catch(_0x13db42){if(_0x13db42 instanceof SDKError)return console[_0x336435(0x260)](_0x336435(0x250)+_0x13db42['code']+']'),console[_0x336435(0x260)]('\x0a'+_0x13db42[_0x336435(0x221)]),0x1;throw _0x13db42;}}}export class SegmentFolderListCommand extends BaseCommand{[a28_0x3e8eb1(0x20b)]='segment:folder:list';[a28_0x3e8eb1(0x227)]=a28_0x3e8eb1(0x1e2);async[a28_0x3e8eb1(0x1dc)](_0x470db5){const _0x571308=a28_0x3e8eb1,{options:_0x3214d2,args:_0x5427b9,tdx:_0x35ec68}=_0x470db5;if(_0x5427b9['length']===0x0)return console[_0x571308(0x260)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x571308(0x1e1)),0x1;const _0x3c9f6f=_0x5427b9[0x0];try{_0x3214d2[_0x571308(0x273)]&&(console['error'](_0x571308(0x208)+_0x3214d2[_0x571308(0x223)]),console[_0x571308(0x260)](_0x571308(0x23b)+_0x3c9f6f));const _0xedbd9=await withSpinner(_0x571308(0x233)+_0x3c9f6f+_0x571308(0x1f3),()=>_0x35ec68[_0x571308(0x205)][_0x571308(0x1ec)](_0x3c9f6f),{'verbose':_0x3214d2['verbose']}),_0x299153=_0xedbd9[_0x571308(0x257)];_0x3214d2['verbose']&&console[_0x571308(0x260)]('Resolved\x20parent\x20ID:\x20'+_0x299153);const _0x258bd9=await withSpinner(_0x571308(0x1fa)+_0x3c9f6f+'\x27...',()=>_0x35ec68[_0x571308(0x205)]['listFolders'](_0x299153),{'verbose':_0x3214d2['verbose']}),_0x45e705=_0x258bd9[_0x571308(0x257)];return console['error'](_0x571308(0x258)+_0x45e705[_0x571308(0x217)]+'\x20folder'+(_0x45e705[_0x571308(0x217)]!==0x1?'s':'')),await handleSDKOutput(_0x45e705,_0x3214d2),0x0;}catch(_0x4d3cd6){if(_0x4d3cd6 instanceof SDKError)return console[_0x571308(0x260)](_0x571308(0x240)+_0x4d3cd6[_0x571308(0x221)]),_0x4d3cd6['cause']&&console[_0x571308(0x260)](_0x571308(0x1dd)+_0x4d3cd6[_0x571308(0x263)]),0x1;throw _0x4d3cd6;}}}export class SegmentFolderShowCommand extends BaseCommand{[a28_0x3e8eb1(0x20b)]=a28_0x3e8eb1(0x24e);[a28_0x3e8eb1(0x227)]=a28_0x3e8eb1(0x20e);async[a28_0x3e8eb1(0x1dc)](_0x28f21c){const _0xd68961=a28_0x3e8eb1,{options:_0x8b5f52,args:_0x18b35d,tdx:_0x493220}=_0x28f21c;if(_0x18b35d['length']===0x0)return console[_0xd68961(0x260)](_0xd68961(0x206)),console['error'](_0xd68961(0x218)),0x1;try{const {parentId:_0x176bd5,childId:_0x5b57b1}=parseSegmentRef(_0x18b35d[0x0]);_0x8b5f52[_0xd68961(0x273)]&&(console['error']('Site:\x20'+_0x8b5f52[_0xd68961(0x223)]),console[_0xd68961(0x260)](_0xd68961(0x23b)+_0x176bd5),_0x5b57b1&&console[_0xd68961(0x260)]('Folder\x20name:\x20'+_0x5b57b1));if(!_0x5b57b1)return console[_0xd68961(0x260)](_0xd68961(0x249)),0x1;const _0x46fd39=await withSpinner(_0xd68961(0x233)+_0x176bd5+'\x27...',()=>_0x493220[_0xd68961(0x205)][_0xd68961(0x1ec)](_0x176bd5),{'verbose':_0x8b5f52[_0xd68961(0x273)]}),_0x15a0ec=_0x46fd39[_0xd68961(0x257)];_0x8b5f52[_0xd68961(0x273)]&&console[_0xd68961(0x260)]('Resolved\x20parent\x20ID:\x20'+_0x15a0ec);const _0xc4be98=await withSpinner(_0xd68961(0x253)+_0x5b57b1+'\x27...',()=>_0x493220['segment'][_0xd68961(0x1ef)](_0x15a0ec,_0x5b57b1),{'verbose':_0x8b5f52[_0xd68961(0x273)]}),_0x432778=_0xc4be98['data'];_0x8b5f52[_0xd68961(0x273)]&&console[_0xd68961(0x260)](_0xd68961(0x232)+_0x432778);const _0x13431c=await withSpinner(_0xd68961(0x21c)+_0x5b57b1+_0xd68961(0x1f3),()=>_0x493220[_0xd68961(0x205)][_0xd68961(0x204)](_0x432778),{'verbose':_0x8b5f52[_0xd68961(0x273)]});return await handleSDKOutput([_0x13431c[_0xd68961(0x257)]],_0x8b5f52),0x0;}catch(_0x55b569){if(_0x55b569 instanceof SDKError)return console[_0xd68961(0x260)](_0xd68961(0x240)+_0x55b569[_0xd68961(0x221)]),_0x55b569['cause']&&console[_0xd68961(0x260)](_0xd68961(0x1dd)+_0x55b569[_0xd68961(0x263)]),0x1;throw _0x55b569;}}}export class SegmentSQLCommand extends BaseCommand{[a28_0x3e8eb1(0x20b)]=a28_0x3e8eb1(0x262);[a28_0x3e8eb1(0x227)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a28_0x3e8eb1(0x1dc)](_0x69b6f8){const _0x35fdaf=a28_0x3e8eb1,{options:_0x45de4f,args:_0x3cbab4,tdx:_0x2a0c29}=_0x69b6f8,_0x168b5c=_0x3cbab4[0x0];if(!_0x168b5c)return console[_0x35fdaf(0x260)](_0x35fdaf(0x213)),console[_0x35fdaf(0x260)](_0x35fdaf(0x1df)),console[_0x35fdaf(0x260)](_0x35fdaf(0x207)),console['error'](_0x35fdaf(0x242)),console[_0x35fdaf(0x260)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x35fdaf(0x260)](_0x35fdaf(0x24f)),0x1;try{const _0x275d5c=_0x45de4f[_0x35fdaf(0x220)],_0x219683=await resolveSegmentTarget(_0x168b5c,_0x275d5c,_0x45de4f[_0x35fdaf(0x273)]);_0x45de4f['verbose']&&console['error'](_0x35fdaf(0x23c)+_0x219683);const _0x3b511f=await withSpinner(_0x35fdaf(0x261)+_0x168b5c+_0x35fdaf(0x1f3),()=>_0x2a0c29['segment'][_0x35fdaf(0x246)](_0x219683),{'verbose':_0x45de4f[_0x35fdaf(0x273)]}),_0x1d05dc=_0x3b511f[_0x35fdaf(0x257)];_0x45de4f[_0x35fdaf(0x273)]&&(console[_0x35fdaf(0x260)](_0x35fdaf(0x24a)+_0x1d05dc[_0x35fdaf(0x226)]),console[_0x35fdaf(0x260)](_0x35fdaf(0x26f)+_0x1d05dc['parentId']));if(_0x1d05dc[_0x35fdaf(0x226)]===_0x35fdaf(0x212))return console[_0x35fdaf(0x260)](_0x35fdaf(0x211)),console[_0x35fdaf(0x260)](_0x35fdaf(0x1f7)),0x1;if(_0x1d05dc[_0x35fdaf(0x226)]==='parent')return console['error'](_0x35fdaf(0x22e)),console[_0x35fdaf(0x260)](_0x35fdaf(0x1da)),0x1;if(!_0x1d05dc[_0x35fdaf(0x25a)])throw new SDKError(ErrorCode[_0x35fdaf(0x1fb)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1d958e=await withSpinner(_0x35fdaf(0x1f5),()=>_0x2a0c29[_0x35fdaf(0x205)][_0x35fdaf(0x271)](_0x1d05dc['parentId'],_0x1d05dc['segmentId']),{'verbose':_0x45de4f[_0x35fdaf(0x273)]}),_0x3ec388=_0x1d958e['data'];return _0x45de4f[_0x35fdaf(0x24c)]===_0x35fdaf(0x256)||_0x45de4f[_0x35fdaf(0x24c)]===_0x35fdaf(0x216)?await handleSDKOutput([{'sql':_0x3ec388}],_0x45de4f):console[_0x35fdaf(0x1ff)](_0x3ec388),0x0;}catch(_0x1d1173){if(_0x1d1173 instanceof SDKError)return console[_0x35fdaf(0x260)](_0x35fdaf(0x240)+_0x1d1173[_0x35fdaf(0x221)]),_0x1d1173['cause']&&console[_0x35fdaf(0x260)](_0x35fdaf(0x1dd)+_0x1d1173[_0x35fdaf(0x263)]),0x1;throw _0x1d1173;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a28_0x3e8eb1(0x20b)]=a28_0x3e8eb1(0x203);['description']=a28_0x3e8eb1(0x1fc);async[a28_0x3e8eb1(0x1dc)](_0x5beb3b){const _0x23bad9=a28_0x3e8eb1,{options:_0x5b32db,args:_0x33c245,tdx:_0x778241}=_0x5beb3b,_0x4bffd7=_0x5b32db;if(_0x33c245[_0x23bad9(0x217)]<0x2)return console[_0x23bad9(0x260)](_0x23bad9(0x26c)),console[_0x23bad9(0x260)](_0x23bad9(0x254)),0x1;const _0x8b03fe=_0x33c245[0x0],_0x3ca393=_0x33c245[0x1];_0x4bffd7['verbose']&&(console[_0x23bad9(0x260)](_0x23bad9(0x208)+_0x4bffd7[_0x23bad9(0x223)]),console[_0x23bad9(0x260)](_0x23bad9(0x1f6)+_0x8b03fe),console[_0x23bad9(0x260)](_0x23bad9(0x20d)+_0x3ca393));let _0x31d499;if(_0x4bffd7[_0x23bad9(0x22a)]){const _0x5421fb=_0x4bffd7['parentFolder'],_0x382b3a=await withSpinner(_0x23bad9(0x233)+_0x8b03fe+'\x27...',()=>_0x778241[_0x23bad9(0x205)][_0x23bad9(0x1ec)](_0x8b03fe),{'verbose':_0x4bffd7[_0x23bad9(0x273)]}),_0x537232=_0x382b3a[_0x23bad9(0x257)],_0x38a676=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x5421fb+_0x23bad9(0x1f3),()=>_0x778241['segment'][_0x23bad9(0x1ef)](_0x537232,_0x5421fb),{'verbose':_0x4bffd7[_0x23bad9(0x273)]});_0x31d499=_0x38a676[_0x23bad9(0x257)],_0x4bffd7['verbose']&&console['error'](_0x23bad9(0x1de)+_0x31d499);}const _0x140cf5={'name':_0x3ca393,'description':_0x4bffd7[_0x23bad9(0x227)],'parentFolderId':_0x31d499},_0x216f18=await withSpinner('Creating\x20folder\x20\x27'+_0x3ca393+_0x23bad9(0x1f3),()=>_0x778241['segment'][_0x23bad9(0x234)](_0x8b03fe,_0x140cf5),{'verbose':_0x4bffd7['verbose']}),_0x114957=_0x216f18['data'];return console[_0x23bad9(0x260)](_0x23bad9(0x1e5)+_0x114957[_0x23bad9(0x20b)]+'\x27\x20with\x20ID:\x20'+_0x114957['id']),await handleSDKOutput([_0x114957],_0x4bffd7),0x0;}}export class SegmentViewCommand extends BaseCommand{[a28_0x3e8eb1(0x20b)]=a28_0x3e8eb1(0x267);[a28_0x3e8eb1(0x227)]=a28_0x3e8eb1(0x237);async[a28_0x3e8eb1(0x1dc)](_0x404a7c){const _0x4a1dce=a28_0x3e8eb1,{options:_0x193c0b,args:_0x3d9c2b,tdx:_0x16e506}=_0x404a7c,_0x218930=_0x3d9c2b[0x0];if(!_0x218930)return console['error'](_0x4a1dce(0x214)),console[_0x4a1dce(0x260)](_0x4a1dce(0x26b)),console[_0x4a1dce(0x260)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x4a1dce(0x260)](_0x4a1dce(0x202)),console[_0x4a1dce(0x260)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x4a1dce(0x260)](_0x4a1dce(0x242)),console[_0x4a1dce(0x260)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x4a1dce(0x260)](_0x4a1dce(0x236)),console[_0x4a1dce(0x260)](_0x4a1dce(0x20f)),console[_0x4a1dce(0x260)](_0x4a1dce(0x201)),0x1;try{const _0xd4e1b0=_0x193c0b[_0x4a1dce(0x220)],_0x380a82=await resolveSegmentTarget(_0x218930,_0xd4e1b0,_0x193c0b[_0x4a1dce(0x273)]);_0x193c0b['verbose']&&console[_0x4a1dce(0x260)](_0x4a1dce(0x23c)+_0x380a82);const _0x21c4a8=await withSpinner(_0x4a1dce(0x261)+_0x218930+_0x4a1dce(0x1f3),()=>_0x16e506[_0x4a1dce(0x205)][_0x4a1dce(0x246)](_0x380a82),{'verbose':_0x193c0b[_0x4a1dce(0x273)]}),_0x3b2ca0=_0x21c4a8[_0x4a1dce(0x257)];_0x193c0b[_0x4a1dce(0x273)]&&(console[_0x4a1dce(0x260)](_0x4a1dce(0x24a)+_0x3b2ca0['type']),console[_0x4a1dce(0x260)](_0x4a1dce(0x26f)+_0x3b2ca0[_0x4a1dce(0x1f0)]),_0x3b2ca0[_0x4a1dce(0x24d)]&&console['error'](_0x4a1dce(0x1ea)+_0x3b2ca0[_0x4a1dce(0x24d)]),_0x3b2ca0[_0x4a1dce(0x25a)]&&console['error'](_0x4a1dce(0x26d)+_0x3b2ca0[_0x4a1dce(0x25a)]));if(_0x193c0b[_0x4a1dce(0x1db)]){if(_0x3b2ca0[_0x4a1dce(0x226)]===_0x4a1dce(0x212))return console['error'](_0x4a1dce(0x25d)),0x1;if(_0x3b2ca0[_0x4a1dce(0x226)]===_0x4a1dce(0x215))return console[_0x4a1dce(0x260)](_0x4a1dce(0x1fd)),console['error'](_0x4a1dce(0x1fe)),0x1;if(!_0x3b2ca0[_0x4a1dce(0x25a)])throw new SDKError(ErrorCode[_0x4a1dce(0x1fb)],_0x4a1dce(0x25c));const _0x1cf73d=getConsoleNextUrl(_0x193c0b[_0x4a1dce(0x223)],_0x4a1dce(0x245)+_0x3b2ca0['parentId']+_0x4a1dce(0x248)+_0x3b2ca0[_0x4a1dce(0x25a)]);return console[_0x4a1dce(0x260)](a28_0x42c123['green']('βœ”')+'\x20Opening\x20'+a28_0x42c123['cyan'](_0x1cf73d)),openBrowser(_0x1cf73d),0x0;}if(_0x3b2ca0[_0x4a1dce(0x226)]===_0x4a1dce(0x212)){if(!_0x3b2ca0[_0x4a1dce(0x24d)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x571e0f=await withSpinner(_0x4a1dce(0x21e),()=>_0x16e506[_0x4a1dce(0x205)]['getFolder'](_0x3b2ca0[_0x4a1dce(0x24d)]),{'verbose':_0x193c0b[_0x4a1dce(0x273)]});await handleSingleObjectOutput(_0x571e0f['data'],_0x193c0b);}else{if(_0x3b2ca0[_0x4a1dce(0x226)]==='segment'){if(!_0x3b2ca0[_0x4a1dce(0x25a)])throw new SDKError(ErrorCode[_0x4a1dce(0x1fb)],_0x4a1dce(0x25c));const _0x1bd56a=await withSpinner(_0x4a1dce(0x225),()=>_0x16e506['segment'][_0x4a1dce(0x247)](_0x3b2ca0[_0x4a1dce(0x1f0)],_0x3b2ca0[_0x4a1dce(0x25a)]),{'verbose':_0x193c0b[_0x4a1dce(0x273)]}),_0x297d0b=getConsoleNextUrl(_0x193c0b[_0x4a1dce(0x223)],_0x4a1dce(0x245)+_0x3b2ca0[_0x4a1dce(0x1f0)]+_0x4a1dce(0x248)+_0x3b2ca0[_0x4a1dce(0x25a)]),_0x37966c=_0x1bd56a[_0x4a1dce(0x257)];_0x37966c[_0x4a1dce(0x21d)]=_0x297d0b,await handleSingleObjectOutput(_0x37966c,_0x193c0b);}else return console[_0x4a1dce(0x260)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x4a1dce(0x260)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x2610b0){if(_0x2610b0 instanceof SDKError)return console[_0x4a1dce(0x260)](_0x4a1dce(0x240)+_0x2610b0[_0x4a1dce(0x221)]),_0x2610b0[_0x4a1dce(0x263)]&&console[_0x4a1dce(0x260)]('\x20\x20Cause:\x20'+_0x2610b0[_0x4a1dce(0x263)]),0x1;throw _0x2610b0;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a28_0x3e8eb1(0x20b)]=a28_0x3e8eb1(0x26a);[a28_0x3e8eb1(0x227)]=a28_0x3e8eb1(0x23d);async[a28_0x3e8eb1(0x1dc)](_0x24bd1d){const _0x41487a=a28_0x3e8eb1,{options:_0x1f0005,args:_0x413f6b,tdx:_0x584966}=_0x24bd1d,_0x4c1f20=_0x413f6b[0x0];if(!_0x4c1f20)return console[_0x41487a(0x260)](_0x41487a(0x213)),console['error'](_0x41487a(0x1ee)),console[_0x41487a(0x260)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console['error'](_0x41487a(0x242)),console['error'](_0x41487a(0x1d9)),console['error'](_0x41487a(0x1e9)),0x1;try{const _0x29f481=_0x1f0005[_0x41487a(0x220)],_0x5cbf9d=await resolveSegmentTarget(_0x4c1f20,_0x29f481,_0x1f0005[_0x41487a(0x273)]);_0x1f0005[_0x41487a(0x273)]&&console[_0x41487a(0x260)](_0x41487a(0x23c)+_0x5cbf9d);const _0x2c699c=await withSpinner(_0x41487a(0x261)+_0x4c1f20+_0x41487a(0x1f3),()=>_0x584966[_0x41487a(0x205)][_0x41487a(0x246)](_0x5cbf9d),{'verbose':_0x1f0005['verbose']}),_0x38f9ed=_0x2c699c[_0x41487a(0x257)];_0x1f0005[_0x41487a(0x273)]&&(console['error'](_0x41487a(0x24a)+_0x38f9ed['type']),console['error'](_0x41487a(0x26f)+_0x38f9ed['parentId']));if(_0x38f9ed[_0x41487a(0x226)]===_0x41487a(0x212))return console[_0x41487a(0x260)](_0x41487a(0x1e3)),console[_0x41487a(0x260)](_0x41487a(0x1f7)),0x1;if(_0x38f9ed[_0x41487a(0x226)]==='parent')return console[_0x41487a(0x260)](_0x41487a(0x228)),console[_0x41487a(0x260)](_0x41487a(0x241)),0x1;if(!_0x38f9ed['segmentId'])throw new SDKError(ErrorCode[_0x41487a(0x1fb)],_0x41487a(0x25c));const _0x1d7f36=await withSpinner(_0x41487a(0x1f5),()=>_0x584966[_0x41487a(0x205)][_0x41487a(0x271)](_0x38f9ed[_0x41487a(0x1f0)],_0x38f9ed[_0x41487a(0x25a)]),{'verbose':_0x1f0005['verbose']}),_0x56c0cf=_0x1d7f36[_0x41487a(0x257)],_0x3033ba=await executeSchemaQuery(_0x56c0cf,_0x584966,_0x1f0005);return await handleQueryOutput(_0x3033ba,_0x1f0005),0x0;}catch(_0x49a3b3){if(_0x49a3b3 instanceof SDKError)return console[_0x41487a(0x260)]('Error:\x20'+_0x49a3b3[_0x41487a(0x221)]),_0x49a3b3[_0x41487a(0x263)]&&console[_0x41487a(0x260)](_0x41487a(0x1dd)+_0x49a3b3[_0x41487a(0x263)]),0x1;throw _0x49a3b3;}}}
@@ -1 +1 @@
1
- const a29_0x9569de=a29_0x21c6;(function(_0x2c1145,_0x3efc9d){const _0x2fba56=a29_0x21c6,_0x58444d=_0x2c1145();while(!![]){try{const _0x3a2be7=-parseInt(_0x2fba56(0x12a))/0x1+parseInt(_0x2fba56(0x132))/0x2+parseInt(_0x2fba56(0x123))/0x3*(-parseInt(_0x2fba56(0x125))/0x4)+parseInt(_0x2fba56(0x13d))/0x5*(parseInt(_0x2fba56(0x134))/0x6)+parseInt(_0x2fba56(0x14e))/0x7+parseInt(_0x2fba56(0x119))/0x8+-parseInt(_0x2fba56(0x141))/0x9*(parseInt(_0x2fba56(0x128))/0xa);if(_0x3a2be7===_0x3efc9d)break;else _0x58444d['push'](_0x58444d['shift']());}catch(_0x5d46b9){_0x58444d['push'](_0x58444d['shift']());}}}(a29_0x5036,0xad13b));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 a29_0x5036(){const _0x5aed8c=['yellow','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','5119135YOkACU','kind','10209376DVZZcg','description','execute','parent','Resolved\x20relative\x20path\x20to:\x20','includes','ruleFile','segment','segment:create','length','24qjAHPZ','Resolving\x20folder\x20path\x20\x27','68088XLzzic','Parent\x20path:\x20','data','12420570dPQDEn','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','285559YZOYvl','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','site','resolveParentId','invisible','segments','noCountPopulation','createSegment','902476GGNgrR','Segment\x20name:\x20','6iAcQnv','βœ”\x20Created\x20segment\x20\x27','resolveFolderId','Target\x20path:\x20','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolving\x20parent\x20segment\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','rule','5780285dJDYsg','\x27...','Resolved\x20folder\x20ID:\x20','Site:\x20','18rUXFGf','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','name','resolvePathToResource','\x27\x20with\x20ID:\x20','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','verbose','folderId','error','Parent:\x20'];a29_0x5036=function(){return _0x5aed8c;};return a29_0x5036();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a29_0x2ac491 from'chalk';function a29_0x21c6(_0x241a96,_0x2dad50){_0x241a96=_0x241a96-0x118;const _0x5036c8=a29_0x5036();let _0x21c654=_0x5036c8[_0x241a96];return _0x21c654;}export class SegmentCreateCommand extends BaseCommand{['name']=a29_0x9569de(0x121);[a29_0x9569de(0x11a)]=a29_0x9569de(0x138);async[a29_0x9569de(0x11b)](_0x188f7e){const _0x1dff93=a29_0x9569de;console['error'](a29_0x2ac491[_0x1dff93(0x14c)](_0x1dff93(0x146))),console['error'](a29_0x2ac491[_0x1dff93(0x14c)](_0x1dff93(0x129)));const {options:_0x426833,args:_0x5e244f,tdx:_0x55ed77}=_0x188f7e,_0x42f4f8=_0x426833;if(_0x5e244f[_0x1dff93(0x122)]===0x0)return console[_0x1dff93(0x14a)](_0x1dff93(0x142)),console[_0x1dff93(0x14a)](_0x1dff93(0x12b)),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x1dff93(0x14a)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x1dff93(0x14a)](_0x1dff93(0x13a)),0x1;const _0x859b02=_0x5e244f[0x0],_0x491796=_0x426833['segmentPath'];let _0x4cebf0=_0x859b02;_0x491796&&!_0x859b02[_0x1dff93(0x11e)]('/')&&(_0x4cebf0=_0x491796+'/'+_0x859b02,_0x42f4f8[_0x1dff93(0x148)]&&console[_0x1dff93(0x14a)](_0x1dff93(0x11d)+_0x4cebf0));const _0x4d8a07=parsePath(_0x4cebf0);if(_0x4d8a07[_0x1dff93(0x12f)][_0x1dff93(0x122)]<0x2)return console[_0x1dff93(0x14a)](_0x1dff93(0x147)),console[_0x1dff93(0x14a)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x5697fe=_0x4d8a07['segments'][0x0],_0x71cc72=getBaseName(_0x4cebf0),_0x2bc906=getParentPath(_0x4cebf0);_0x42f4f8['verbose']&&(console[_0x1dff93(0x14a)](_0x1dff93(0x140)+_0x42f4f8[_0x1dff93(0x12c)]),console['error'](_0x1dff93(0x137)+_0x4cebf0),console[_0x1dff93(0x14a)](_0x1dff93(0x14b)+_0x5697fe),console[_0x1dff93(0x14a)](_0x1dff93(0x133)+_0x71cc72),console['error'](_0x1dff93(0x126)+_0x2bc906));const _0xdabfa5=await withSpinner(_0x1dff93(0x139)+_0x5697fe+_0x1dff93(0x13e),()=>_0x55ed77[_0x1dff93(0x120)][_0x1dff93(0x12d)](_0x5697fe),{'verbose':_0x42f4f8[_0x1dff93(0x148)]}),_0x3e20a0=_0xdabfa5['data'];let _0x577a56;if(_0x4d8a07[_0x1dff93(0x12f)][_0x1dff93(0x122)]>0x2){const _0x124aa7=await withSpinner(_0x1dff93(0x124)+_0x2bc906+_0x1dff93(0x13e),()=>_0x55ed77[_0x1dff93(0x120)][_0x1dff93(0x144)](_0x2bc906),{'verbose':_0x42f4f8['verbose']}),_0x5daf92=_0x124aa7[_0x1dff93(0x127)];if(_0x5daf92['type']!==_0x1dff93(0x13b)&&_0x5daf92['type']!==_0x1dff93(0x11c))return console[_0x1dff93(0x14a)](_0x1dff93(0x14d)),0x1;_0x577a56=_0x5daf92[_0x1dff93(0x149)];}else{if(_0x42f4f8['folder']){const _0x47f779=await withSpinner('Resolving\x20folder\x20\x27'+_0x42f4f8[_0x1dff93(0x13b)]+_0x1dff93(0x13e),()=>_0x55ed77[_0x1dff93(0x120)][_0x1dff93(0x136)](_0x3e20a0,_0x42f4f8[_0x1dff93(0x13b)]),{'verbose':_0x42f4f8['verbose']});_0x577a56=_0x47f779[_0x1dff93(0x127)];}}_0x42f4f8[_0x1dff93(0x148)]&&_0x577a56&&console[_0x1dff93(0x14a)](_0x1dff93(0x13f)+_0x577a56);const _0xa18358=await loadJSONFromOptions(_0x42f4f8[_0x1dff93(0x13c)],_0x42f4f8[_0x1dff93(0x11f)]),_0x2e3dfd={'name':_0x71cc72,'description':_0x42f4f8[_0x1dff93(0x11a)],'rule':_0xa18358,'kind':_0x42f4f8[_0x1dff93(0x118)]!==undefined?parseInt(_0x42f4f8[_0x1dff93(0x118)],0xa):undefined,'isVisible':_0x42f4f8[_0x1dff93(0x12e)]?![]:undefined,'segmentFolderId':_0x577a56,'countPopulation':_0x42f4f8[_0x1dff93(0x130)]?![]:undefined},_0x38c47e=await withSpinner('Creating\x20segment\x20\x27'+_0x71cc72+_0x1dff93(0x13e),()=>_0x55ed77[_0x1dff93(0x120)][_0x1dff93(0x131)](_0x3e20a0,_0x2e3dfd),{'verbose':_0x42f4f8[_0x1dff93(0x148)]}),_0x44d1d7=_0x38c47e[_0x1dff93(0x127)];return console[_0x1dff93(0x14a)](_0x1dff93(0x135)+_0x44d1d7[_0x1dff93(0x143)]+_0x1dff93(0x145)+_0x44d1d7['id']),_0x4cebf0!==_0x859b02&&console[_0x1dff93(0x14a)]('\x20\x20\x20Path:\x20'+_0x4cebf0),await handleSDKOutput([_0x44d1d7],_0x42f4f8),0x0;}}
1
+ const a29_0x4c5735=a29_0x4e9f;(function(_0x1334df,_0x4cb844){const _0x2ae65d=a29_0x4e9f,_0x1efe00=_0x1334df();while(!![]){try{const _0x5a820c=-parseInt(_0x2ae65d(0x1b7))/0x1*(-parseInt(_0x2ae65d(0x19c))/0x2)+-parseInt(_0x2ae65d(0x1a3))/0x3+parseInt(_0x2ae65d(0x1b9))/0x4*(parseInt(_0x2ae65d(0x1bb))/0x5)+parseInt(_0x2ae65d(0x1af))/0x6+-parseInt(_0x2ae65d(0x1b6))/0x7+-parseInt(_0x2ae65d(0x1a7))/0x8+parseInt(_0x2ae65d(0x1ba))/0x9;if(_0x5a820c===_0x4cb844)break;else _0x1efe00['push'](_0x1efe00['shift']());}catch(_0x5c4ea4){_0x1efe00['push'](_0x1efe00['shift']());}}}(a29_0x4d92,0xd4622));import{BaseCommand}from'./command.js';function a29_0x4e9f(_0xf2dfd5,_0x34c54f){_0xf2dfd5=_0xf2dfd5-0x196;const _0x4d92de=a29_0x4d92();let _0x4e9f7a=_0x4d92de[_0xf2dfd5];return _0x4e9f7a;}function a29_0x4d92(){const _0x21fd2d=['error','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','\x27...','Create\x20child\x20segment\x20with\x20filtering\x20rules','Parent:\x20','folder','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','βœ”\x20Created\x20segment\x20\x27','kind','2FjIUlL','segment:create','Resolving\x20folder\x20path\x20\x27','resolvePathToResource','segment','Parent\x20path:\x20','description','3235056usxzcy','name','includes','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','11687592lIBOje','folderId','data','Resolving\x20parent\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','ruleFile','parent','execute','9915582TIOmeK','length','Site:\x20','invisible','segments','yellow','Creating\x20segment\x20\x27','3592393vHahWm','390062XPJULW','verbose','5104BKYlaS','6651171ohoVME','4470QlwBCo','Examples:','resolveFolderId','site','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Segment\x20name:\x20','createSegment','rule','Resolved\x20relative\x20path\x20to:\x20','Target\x20path:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'];a29_0x4d92=function(){return _0x21fd2d;};return a29_0x4d92();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a29_0x329d08 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a29_0x4c5735(0x1a4)]=a29_0x4c5735(0x19d);[a29_0x4c5735(0x1a2)]=a29_0x4c5735(0x1c9);async[a29_0x4c5735(0x1ae)](_0x2494de){const _0x16f1f0=a29_0x4c5735;console['error'](a29_0x329d08[_0x16f1f0(0x1b4)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x16f1f0(0x1c6)](a29_0x329d08[_0x16f1f0(0x1b4)](_0x16f1f0(0x1ab)));const {options:_0xcb4000,args:_0x4faad9,tdx:_0x57c595}=_0x2494de,_0x4944d5=_0xcb4000;if(_0x4faad9[_0x16f1f0(0x1b0)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x16f1f0(0x1c6)](_0x16f1f0(0x1c5)),console[_0x16f1f0(0x1c6)](_0x16f1f0(0x1bc)),console['error'](_0x16f1f0(0x1bf)),console[_0x16f1f0(0x1c6)](_0x16f1f0(0x1a6)),console[_0x16f1f0(0x1c6)](_0x16f1f0(0x198)),0x1;const _0x110c0a=_0x4faad9[0x0],_0x5f3b81=_0xcb4000['segmentPath'];let _0x2da40b=_0x110c0a;_0x5f3b81&&!_0x110c0a[_0x16f1f0(0x1a5)]('/')&&(_0x2da40b=_0x5f3b81+'/'+_0x110c0a,_0x4944d5[_0x16f1f0(0x1b8)]&&console[_0x16f1f0(0x1c6)](_0x16f1f0(0x1c3)+_0x2da40b));const _0x4e5923=parsePath(_0x2da40b);if(_0x4e5923[_0x16f1f0(0x1b3)][_0x16f1f0(0x1b0)]<0x2)return console[_0x16f1f0(0x1c6)](_0x16f1f0(0x199)),console[_0x16f1f0(0x1c6)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x234f68=_0x4e5923['segments'][0x0],_0x214214=getBaseName(_0x2da40b),_0x524f0d=getParentPath(_0x2da40b);_0x4944d5[_0x16f1f0(0x1b8)]&&(console[_0x16f1f0(0x1c6)](_0x16f1f0(0x1b1)+_0x4944d5[_0x16f1f0(0x1be)]),console[_0x16f1f0(0x1c6)](_0x16f1f0(0x1c4)+_0x2da40b),console[_0x16f1f0(0x1c6)](_0x16f1f0(0x196)+_0x234f68),console[_0x16f1f0(0x1c6)](_0x16f1f0(0x1c0)+_0x214214),console[_0x16f1f0(0x1c6)](_0x16f1f0(0x1a1)+_0x524f0d));const _0x1f7d9c=await withSpinner(_0x16f1f0(0x1aa)+_0x234f68+_0x16f1f0(0x1c8),()=>_0x57c595['segment']['resolveParentId'](_0x234f68),{'verbose':_0x4944d5['verbose']}),_0x123a4c=_0x1f7d9c[_0x16f1f0(0x1a9)];let _0x906b5;if(_0x4e5923[_0x16f1f0(0x1b3)][_0x16f1f0(0x1b0)]>0x2){const _0x317a23=await withSpinner(_0x16f1f0(0x19e)+_0x524f0d+'\x27...',()=>_0x57c595[_0x16f1f0(0x1a0)][_0x16f1f0(0x19f)](_0x524f0d),{'verbose':_0x4944d5[_0x16f1f0(0x1b8)]}),_0x5c7339=_0x317a23['data'];if(_0x5c7339['type']!==_0x16f1f0(0x197)&&_0x5c7339['type']!==_0x16f1f0(0x1ad))return console[_0x16f1f0(0x1c6)](_0x16f1f0(0x1c7)),0x1;_0x906b5=_0x5c7339[_0x16f1f0(0x1a8)];}else{if(_0x4944d5[_0x16f1f0(0x197)]){const _0x4fb6a7=await withSpinner('Resolving\x20folder\x20\x27'+_0x4944d5[_0x16f1f0(0x197)]+_0x16f1f0(0x1c8),()=>_0x57c595[_0x16f1f0(0x1a0)][_0x16f1f0(0x1bd)](_0x123a4c,_0x4944d5[_0x16f1f0(0x197)]),{'verbose':_0x4944d5[_0x16f1f0(0x1b8)]});_0x906b5=_0x4fb6a7[_0x16f1f0(0x1a9)];}}_0x4944d5[_0x16f1f0(0x1b8)]&&_0x906b5&&console[_0x16f1f0(0x1c6)]('Resolved\x20folder\x20ID:\x20'+_0x906b5);const _0x124f7a=await loadJSONFromOptions(_0x4944d5[_0x16f1f0(0x1c2)],_0x4944d5[_0x16f1f0(0x1ac)]),_0x8b0767={'name':_0x214214,'description':_0x4944d5['description'],'rule':_0x124f7a,'kind':_0x4944d5[_0x16f1f0(0x19b)]!==undefined?parseInt(_0x4944d5[_0x16f1f0(0x19b)],0xa):undefined,'isVisible':_0x4944d5[_0x16f1f0(0x1b2)]?![]:undefined,'segmentFolderId':_0x906b5,'countPopulation':_0x4944d5['noCountPopulation']?![]:undefined},_0x4c002f=await withSpinner(_0x16f1f0(0x1b5)+_0x214214+'\x27...',()=>_0x57c595[_0x16f1f0(0x1a0)][_0x16f1f0(0x1c1)](_0x123a4c,_0x8b0767),{'verbose':_0x4944d5[_0x16f1f0(0x1b8)]}),_0x17a024=_0x4c002f['data'];return console[_0x16f1f0(0x1c6)](_0x16f1f0(0x19a)+_0x17a024['name']+'\x27\x20with\x20ID:\x20'+_0x17a024['id']),_0x2da40b!==_0x110c0a&&console[_0x16f1f0(0x1c6)]('\x20\x20\x20Path:\x20'+_0x2da40b),await handleSDKOutput([_0x17a024],_0x4944d5),0x0;}}
@@ -1 +1 @@
1
- const a30_0x5bd1d5=a30_0x2223;(function(_0x474988,_0x23491b){const _0x3b6af4=a30_0x2223,_0x1c0a06=_0x474988();while(!![]){try{const _0x5963c5=parseInt(_0x3b6af4(0xfd))/0x1*(-parseInt(_0x3b6af4(0xf8))/0x2)+parseInt(_0x3b6af4(0xfb))/0x3*(-parseInt(_0x3b6af4(0x100))/0x4)+parseInt(_0x3b6af4(0x10f))/0x5*(parseInt(_0x3b6af4(0xf5))/0x6)+parseInt(_0x3b6af4(0x10c))/0x7*(parseInt(_0x3b6af4(0x106))/0x8)+-parseInt(_0x3b6af4(0xfc))/0x9+-parseInt(_0x3b6af4(0x103))/0xa+parseInt(_0x3b6af4(0xfa))/0xb;if(_0x5963c5===_0x23491b)break;else _0x1c0a06['push'](_0x1c0a06['shift']());}catch(_0x51d25e){_0x1c0a06['push'](_0x1c0a06['shift']());}}}(a30_0x3a08,0x3758f));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a30_0x2223(_0x1ea77f,_0x166b25){_0x1ea77f=_0x1ea77f-0xf4;const _0x3a0837=a30_0x3a08();let _0x22232c=_0x3a0837[_0x1ea77f];return _0x22232c;}function a30_0x3a08(){const _0xe6135e=['error','259eEKerv','jsonl','execute','1819085KsxMGI','length','6cDSDQb','segment:fields','json','316676sUwVyT','\x20field','7120058RJwTNx','3jMvrMo','40293DuBVpX','1saQPEp','data','Error:\x20Parent\x20segment\x20name\x20is\x20required','1070596hIIaCf','verbose','Site:\x20','4102790SHLNnz','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','parentSegment','12184NJaYrl','\x27...','name','Parent\x20segment:\x20','List\x20available\x20fields\x20for\x20segmentation'];a30_0x3a08=function(){return _0xe6135e;};return a30_0x3a08();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a30_0x5bd1d5(0x108)]=a30_0x5bd1d5(0xf6);['description']=a30_0x5bd1d5(0x10a);async[a30_0x5bd1d5(0x10e)](_0x11396e){const _0x472d28=a30_0x5bd1d5,{options:_0x5e63fc,args:_0x3cc454,tdx:_0x402475}=_0x11396e,_0x28b53b=_0x3cc454[0x0]||_0x5e63fc[_0x472d28(0x105)];if(!_0x28b53b)return console[_0x472d28(0x10b)](_0x472d28(0xff)),console[_0x472d28(0x10b)](_0x472d28(0x104)),console[_0x472d28(0x10b)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x5e63fc[_0x472d28(0x101)]&&(console['error'](_0x472d28(0x102)+_0x5e63fc['site']),console[_0x472d28(0x10b)](_0x472d28(0x109)+_0x28b53b));const _0x3fd91d=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x28b53b+_0x472d28(0x107),()=>_0x402475['segment']['listFields'](_0x28b53b),{'verbose':_0x5e63fc['verbose']}),_0x5978db=_0x3fd91d[_0x472d28(0xfe)];console['error']('βœ”\x20Found\x20'+_0x5978db[_0x472d28(0xf4)]+_0x472d28(0xf9)+(_0x5978db[_0x472d28(0xf4)]!==0x1?'s':''));if(_0x5e63fc[_0x472d28(0xf7)]||_0x5e63fc[_0x472d28(0x10d)])return await handleSDKOutput(_0x5978db,_0x5e63fc),0x0;return displayFieldsHumanReadable(_0x5978db,_0x28b53b),0x0;}}
1
+ const a30_0x3b271e=a30_0x5c9c;(function(_0x53fd73,_0x32133c){const _0x599397=a30_0x5c9c,_0x183ba0=_0x53fd73();while(!![]){try{const _0x87211f=-parseInt(_0x599397(0x189))/0x1+-parseInt(_0x599397(0x183))/0x2+-parseInt(_0x599397(0x181))/0x3*(parseInt(_0x599397(0x18e))/0x4)+parseInt(_0x599397(0x187))/0x5*(parseInt(_0x599397(0x194))/0x6)+-parseInt(_0x599397(0x193))/0x7+parseInt(_0x599397(0x18d))/0x8+-parseInt(_0x599397(0x182))/0x9*(-parseInt(_0x599397(0x192))/0xa);if(_0x87211f===_0x32133c)break;else _0x183ba0['push'](_0x183ba0['shift']());}catch(_0xc020e3){_0x183ba0['push'](_0x183ba0['shift']());}}}(a30_0x4e3f,0xe9703));function a30_0x4e3f(){const _0x4f671d=['\x27...','listFields','12437728sRUxdi','1828520OmwKtC','segment','List\x20available\x20fields\x20for\x20segmentation','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','31649560yhCcCB','11426821jydEsc','138sEkvNM','Site:\x20','βœ”\x20Found\x20','data','verbose','site','3cNSaMN','9OchSyj','1975832efgbRH','jsonl','error','length','176385VgGGWv','parentSegment','1497431WSBift','description'];a30_0x4e3f=function(){return _0x4f671d;};return a30_0x4e3f();}import{BaseCommand}from'./command.js';function a30_0x5c9c(_0x2f187a,_0x100b9b){_0x2f187a=_0x2f187a-0x17c;const _0x4e3fb5=a30_0x4e3f();let _0x5c9c10=_0x4e3fb5[_0x2f187a];return _0x5c9c10;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';[a30_0x3b271e(0x18a)]=a30_0x3b271e(0x190);async['execute'](_0x1cf4d0){const _0x5b643f=a30_0x3b271e,{options:_0x115f6f,args:_0xe7cbbe,tdx:_0x329845}=_0x1cf4d0,_0xe59f13=_0xe7cbbe[0x0]||_0x115f6f[_0x5b643f(0x188)];if(!_0xe59f13)return console[_0x5b643f(0x185)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x5b643f(0x185)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x5b643f(0x185)](_0x5b643f(0x191)),0x1;_0x115f6f[_0x5b643f(0x17f)]&&(console[_0x5b643f(0x185)](_0x5b643f(0x17c)+_0x115f6f[_0x5b643f(0x180)]),console['error']('Parent\x20segment:\x20'+_0xe59f13));const _0x1e2144=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0xe59f13+_0x5b643f(0x18b),()=>_0x329845[_0x5b643f(0x18f)][_0x5b643f(0x18c)](_0xe59f13),{'verbose':_0x115f6f['verbose']}),_0x7b011c=_0x1e2144[_0x5b643f(0x17e)];console[_0x5b643f(0x185)](_0x5b643f(0x17d)+_0x7b011c[_0x5b643f(0x186)]+'\x20field'+(_0x7b011c[_0x5b643f(0x186)]!==0x1?'s':''));if(_0x115f6f['json']||_0x115f6f[_0x5b643f(0x184)])return await handleSDKOutput(_0x7b011c,_0x115f6f),0x0;return displayFieldsHumanReadable(_0x7b011c,_0xe59f13),0x0;}}
@@ -1 +1 @@
1
- const a31_0x3dfbdc=a31_0x2a5a;(function(_0x166b7f,_0x4f3468){const _0x4c0c7d=a31_0x2a5a,_0x438e19=_0x166b7f();while(!![]){try{const _0x454b9b=-parseInt(_0x4c0c7d(0x1e8))/0x1+parseInt(_0x4c0c7d(0x230))/0x2+-parseInt(_0x4c0c7d(0x1ec))/0x3+-parseInt(_0x4c0c7d(0x209))/0x4+-parseInt(_0x4c0c7d(0x1f1))/0x5+-parseInt(_0x4c0c7d(0x1fc))/0x6+parseInt(_0x4c0c7d(0x229))/0x7;if(_0x454b9b===_0x4f3468)break;else _0x438e19['push'](_0x438e19['shift']());}catch(_0x11ba87){_0x438e19['push'](_0x438e19['shift']());}}}(a31_0x57a3,0x9441a));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 a31_0x4765c5 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a31_0x57a3(){const _0x4ab462=['yes','cyan','\x20files?','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)','cwd','4974354uaRumW','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Target\x20resource:\x20','isNew','targetDir','verbose','parentSegment','resourceName','Parent\x20segment:\x20','segment:pull','\x20versions)','dim','960940YrZhiN','message','yellow','parent_segment','journeys','session','content','\x20\x20🎯\x20','description','files','absolutePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','-\x20no\x20files\x20written','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dirname','βœ”\x20Context\x20set:\x20','red','\x20=\x20','parentName','\x20\x20Target:\x20','type','journeyVersions','\x20segments','file','\x20activations','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','length','dryRun','\x27...','error','pullSegments','helpText','17279920fxtZYU','\x20\x20πŸ—ΊοΈ\x20\x20','filter','counts','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aChanges\x20to\x20\x27','\x20with\x20','2032460xQmgSw','βœ”\x20Pulled\x20','setPhase','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','280202ktNwGy','activations','\x20journeys','repeat','3194925AWgWoI','\x0aPull\x20summary\x20for\x20\x27','\x20files\x20to\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','errorCode','2315305wRijoY','\x20changed\x20files','Site:\x20','no_parent','green','hasChanges'];a31_0x57a3=function(){return _0x4ab462;};return a31_0x57a3();}import a31_0x218e1c from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a31_0x2a5a(_0x6fa80f,_0x2538e6){_0x6fa80f=_0x6fa80f-0x1e8;const _0x57a39c=a31_0x57a3();let _0x2a5a65=_0x57a39c[_0x6fa80f];return _0x2a5a65;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a31_0x3dfbdc(0x206);[a31_0x3dfbdc(0x211)]=a31_0x3dfbdc(0x233);async['execute'](_0x4ab3e2){const _0x4a4f57=a31_0x3dfbdc,{options:_0x348ef8,args:_0x2f9c3b,tdx:_0x33f553}=_0x4ab3e2,_0x531a5e=_0x348ef8,_0x46b4d5=await resolveTarget({'arg':_0x2f9c3b[0x0],'contextParent':_0x348ef8[_0x4a4f57(0x203)],'cwd':process[_0x4a4f57(0x1fb)]()});if(!isSuccessfulResolution(_0x46b4d5))return _0x46b4d5[_0x4a4f57(0x1f0)]===_0x4a4f57(0x1f4)?(console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x20b)](_0x4a4f57(0x214))),console[_0x4a4f57(0x226)](_0x4a4f57(0x1fa)),console[_0x4a4f57(0x226)](_0x4a4f57(0x1fe)),console[_0x4a4f57(0x226)](_0x4a4f57(0x222))):(console['error'](a31_0x4765c5[_0x4a4f57(0x219)]('Error:\x20'+_0x46b4d5[_0x4a4f57(0x20a)]+'\x0a')),_0x46b4d5['helpText']&&console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x1f8)](_0x46b4d5[_0x4a4f57(0x228)]))),0x1;const _0x4aa1f8=_0x46b4d5['parentName'],_0x129be3=_0x46b4d5[_0x4a4f57(0x201)],_0x216bc7=_0x46b4d5[_0x4a4f57(0x21d)]===_0x4a4f57(0x220)?_0x46b4d5[_0x4a4f57(0x204)]:undefined;_0x531a5e[_0x4a4f57(0x202)]&&(console['error'](_0x4a4f57(0x1f3)+_0x531a5e['site']),console[_0x4a4f57(0x226)](_0x4a4f57(0x205)+_0x4aa1f8),_0x216bc7&&console['error'](_0x4a4f57(0x1ff)+_0x216bc7));const _0xf256b7=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4aa1f8+_0x4a4f57(0x225),_0x5d8ed6=>_0x33f553['segment'][_0x4a4f57(0x227)](_0x4aa1f8,{'targetDir':_0x129be3,'targetResourceName':_0x216bc7,'verbose':_0x531a5e[_0x4a4f57(0x202)],'progress':{'update':_0x2d76e1=>{const _0x43ed91=_0x4a4f57;_0x5d8ed6[_0x43ed91(0x232)](_0x2d76e1),_0x531a5e[_0x43ed91(0x202)]&&console['error']('\x20\x20'+_0x2d76e1);}}}),{'verbose':_0x531a5e[_0x4a4f57(0x202)]}),_0x1e03b4=_0xf256b7[_0x4a4f57(0x1fd)];if(_0x1e03b4[_0x4a4f57(0x22c)]['segments']===0x0&&_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x20d)]===0x0)return console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x20b)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x1e03b4[_0x4a4f57(0x21b)]+'\x27')),0x0;const _0x54c6ca=_0x1e03b4[_0x4a4f57(0x212)][_0x4a4f57(0x22b)](_0x417c1d=>_0x417c1d[_0x4a4f57(0x200)]),_0x329d61=_0x1e03b4[_0x4a4f57(0x212)]['filter'](_0x5c986a=>!_0x5c986a[_0x4a4f57(0x200)]&&_0x5c986a[_0x4a4f57(0x1f6)]),_0x6b2ac2=_0x1e03b4[_0x4a4f57(0x212)][_0x4a4f57(0x22b)](_0x50405a=>!_0x50405a[_0x4a4f57(0x200)]&&!_0x50405a[_0x4a4f57(0x1f6)]);console[_0x4a4f57(0x226)](_0x4a4f57(0x1ed)+_0x1e03b4[_0x4a4f57(0x21b)]+'\x27:'),console[_0x4a4f57(0x226)](_0x4a4f57(0x210)+a31_0x4765c5[_0x4a4f57(0x1f8)](_0x1e03b4[_0x4a4f57(0x22c)]['segments']+_0x4a4f57(0x21f))+_0x4a4f57(0x22f)+a31_0x4765c5['cyan'](_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x1e9)]+_0x4a4f57(0x221)));if(_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x20d)]>0x0){const _0x97eef1=_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x21e)]>_0x1e03b4[_0x4a4f57(0x22c)]['journeys']?'\x20('+_0x1e03b4['counts'][_0x4a4f57(0x21e)]+_0x4a4f57(0x207):'';console[_0x4a4f57(0x226)](_0x4a4f57(0x22a)+a31_0x4765c5[_0x4a4f57(0x1f8)](_0x1e03b4[_0x4a4f57(0x22c)][_0x4a4f57(0x20d)]+_0x4a4f57(0x1ea))+a31_0x4765c5['dim'](_0x97eef1));}console['error']('\x20\x20'+a31_0x4765c5[_0x4a4f57(0x1f5)]('+\x20'+_0x54c6ca[_0x4a4f57(0x223)]+'\x20new\x20files')),console[_0x4a4f57(0x226)]('\x20\x20'+a31_0x4765c5[_0x4a4f57(0x20b)]('~\x20'+_0x329d61['length']+_0x4a4f57(0x1f2))),console[_0x4a4f57(0x226)]('\x20\x20'+a31_0x4765c5[_0x4a4f57(0x208)]('=\x20'+_0x6b2ac2[_0x4a4f57(0x223)]+'\x20unchanged\x20files')),console[_0x4a4f57(0x226)](_0x4a4f57(0x21c)+a31_0x4765c5[_0x4a4f57(0x1f8)](_0x1e03b4[_0x4a4f57(0x201)])+'\x0a');if(_0x329d61['length']>0x0)for(const _0x11a192 of _0x329d61){console[_0x4a4f57(0x226)](_0x4a4f57(0x22e)+_0x11a192['relativePath']+'\x27:'),console[_0x4a4f57(0x226)]('─'[_0x4a4f57(0x1eb)](0x3c)),console[_0x4a4f57(0x226)](_0x11a192['diff']),console['error']('─'[_0x4a4f57(0x1eb)](0x3c));}if(_0x531a5e[_0x4a4f57(0x224)])return console[_0x4a4f57(0x226)](a31_0x4765c5['yellow'](_0x4a4f57(0x216))),0x0;if(_0x54c6ca['length']===0x0&&_0x329d61[_0x4a4f57(0x223)]===0x0)return console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x1f5)]('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x1e03b4[_0x4a4f57(0x21b)]},_0x531a5e[_0x4a4f57(0x20e)]),console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x1f5)]('βœ”\x20Context\x20set:\x20'+a31_0x4765c5[_0x4a4f57(0x208)](_0x4a4f57(0x20c))+_0x4a4f57(0x21a)+a31_0x4765c5['cyan'](_0x1e03b4[_0x4a4f57(0x21b)]))),0x0;if(!_0x531a5e[_0x4a4f57(0x1f7)]){if(!isInteractive())return console[_0x4a4f57(0x226)](a31_0x4765c5['red']('\x0aError:'),_0x4a4f57(0x22d)),console['error'](a31_0x4765c5[_0x4a4f57(0x208)](_0x4a4f57(0x1ef))),0x1;const _0x15f9a8=await confirmKey('Write\x20'+(_0x54c6ca['length']+_0x329d61['length'])+_0x4a4f57(0x1f9));if(!_0x15f9a8)return console['error'](a31_0x4765c5[_0x4a4f57(0x20b)]('Aborted.'),_0x4a4f57(0x215)),0x1;}for(const _0x139305 of _0x1e03b4[_0x4a4f57(0x212)]){if(_0x139305[_0x4a4f57(0x200)]||_0x139305[_0x4a4f57(0x1f6)]){const _0x14aad5=a31_0x218e1c[_0x4a4f57(0x217)](_0x139305['absolutePath']);!existsSync(_0x14aad5)&&mkdirSync(_0x14aad5,{'recursive':!![]}),writeFileSync(_0x139305[_0x4a4f57(0x213)],_0x139305[_0x4a4f57(0x20f)],'utf-8');}}return console[_0x4a4f57(0x226)](a31_0x4765c5[_0x4a4f57(0x1f5)](_0x4a4f57(0x231)+(_0x54c6ca[_0x4a4f57(0x223)]+_0x329d61[_0x4a4f57(0x223)])+_0x4a4f57(0x1ee)+_0x1e03b4[_0x4a4f57(0x201)])),saveSessionContext({'parent_segment':_0x1e03b4[_0x4a4f57(0x21b)]},_0x531a5e[_0x4a4f57(0x20e)]),console['error'](a31_0x4765c5[_0x4a4f57(0x1f5)](_0x4a4f57(0x218)+a31_0x4765c5[_0x4a4f57(0x208)](_0x4a4f57(0x20c))+'\x20=\x20'+a31_0x4765c5[_0x4a4f57(0x1f8)](_0x1e03b4[_0x4a4f57(0x21b)]))),0x0;}}
1
+ function a31_0x2152(_0x27d90c,_0x3a6166){_0x27d90c=_0x27d90c-0x116;const _0x250661=a31_0x2506();let _0x2152e5=_0x250661[_0x27d90c];return _0x2152e5;}const a31_0x58594f=a31_0x2152;(function(_0x33d2c8,_0x4b4520){const _0x34b2fa=a31_0x2152,_0x4e2f92=_0x33d2c8();while(!![]){try{const _0xa9169=parseInt(_0x34b2fa(0x127))/0x1+parseInt(_0x34b2fa(0x15e))/0x2*(parseInt(_0x34b2fa(0x152))/0x3)+parseInt(_0x34b2fa(0x13c))/0x4+-parseInt(_0x34b2fa(0x154))/0x5+parseInt(_0x34b2fa(0x15c))/0x6*(-parseInt(_0x34b2fa(0x12c))/0x7)+-parseInt(_0x34b2fa(0x133))/0x8*(-parseInt(_0x34b2fa(0x149))/0x9)+-parseInt(_0x34b2fa(0x148))/0xa*(parseInt(_0x34b2fa(0x122))/0xb);if(_0xa9169===_0x4b4520)break;else _0x4e2f92['push'](_0x4e2f92['shift']());}catch(_0xbdbb3e){_0x4e2f92['push'](_0x4e2f92['shift']());}}}(a31_0x2506,0xa1d68));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a31_0x2506(){const _0x10d157=['\x20files\x20to\x20','utf-8','1533496fPIkrZ','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)','segment:pull','\x20=\x20','\x20journeys','absolutePath','filter','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','session','counts','type','resourceName','10140fJqCca','2243997nIWwvh','length','content','verbose','yellow','relativePath','parent_segment','parentName','\x20files?','3032607yMHMZA','red','3665130lLGkjC','isNew','diff','journeys','site','yes','\x20\x20🎯\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','6xHCdOp','Aborted.','2fEzNNc','execute','\x20new\x20files','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','error','files','repeat','\x20unchanged\x20files','parentSegment','\x27...','βœ”\x20Context\x20set:\x20','data','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','2024ixpWVt','segments','\x0aError:','dim','\x20with\x20','490915JdJZgy','errorCode','\x20activations','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20segments','5609338QRWpZh','hasChanges','message','activations','\x20\x20πŸ—ΊοΈ\x20\x20','file','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','16TkeoPz','segment','-\x20no\x20files\x20written','cyan','green','Site:\x20','helpText'];a31_0x2506=function(){return _0x10d157;};return a31_0x2506();}import{saveSessionContext}from'../core/session.js';import a31_0x5a4115 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a31_0xd2e529 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']=a31_0x58594f(0x13e);['description']=a31_0x58594f(0x132);async[a31_0x58594f(0x116)](_0x1933c6){const _0x3e0b60=a31_0x58594f,{options:_0x4e08ab,args:_0x3ecf91,tdx:_0x1ee125}=_0x1933c6,_0x34f45b=_0x4e08ab,_0x31e31f=await resolveTarget({'arg':_0x3ecf91[0x0],'contextParent':_0x4e08ab[_0x3e0b60(0x11d)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x31e31f))return _0x31e31f[_0x3e0b60(0x128)]==='no_parent'?(console[_0x3e0b60(0x119)](a31_0x5a4115[_0x3e0b60(0x14d)](_0x3e0b60(0x143))),console['error'](_0x3e0b60(0x13d)),console[_0x3e0b60(0x119)](_0x3e0b60(0x121)),console[_0x3e0b60(0x119)](_0x3e0b60(0x15b))):(console['error'](a31_0x5a4115[_0x3e0b60(0x153)]('Error:\x20'+_0x31e31f[_0x3e0b60(0x12e)]+'\x0a')),_0x31e31f['helpText']&&console[_0x3e0b60(0x119)](a31_0x5a4115[_0x3e0b60(0x136)](_0x31e31f[_0x3e0b60(0x139)]))),0x1;const _0x4b333c=_0x31e31f[_0x3e0b60(0x150)],_0x1201c4=_0x31e31f['targetDir'],_0x352854=_0x31e31f[_0x3e0b60(0x146)]===_0x3e0b60(0x131)?_0x31e31f[_0x3e0b60(0x147)]:undefined;_0x34f45b[_0x3e0b60(0x14c)]&&(console['error'](_0x3e0b60(0x138)+_0x34f45b[_0x3e0b60(0x158)]),console[_0x3e0b60(0x119)]('Parent\x20segment:\x20'+_0x4b333c),_0x352854&&console[_0x3e0b60(0x119)]('Target\x20resource:\x20'+_0x352854));const _0x3cfc95=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x4b333c+_0x3e0b60(0x11e),_0x5a3373=>_0x1ee125[_0x3e0b60(0x134)]['pullSegments'](_0x4b333c,{'targetDir':_0x1201c4,'targetResourceName':_0x352854,'verbose':_0x34f45b[_0x3e0b60(0x14c)],'progress':{'update':_0x1864e7=>{const _0x2ee947=_0x3e0b60;_0x5a3373['setPhase'](_0x1864e7),_0x34f45b[_0x2ee947(0x14c)]&&console[_0x2ee947(0x119)]('\x20\x20'+_0x1864e7);}}}),{'verbose':_0x34f45b[_0x3e0b60(0x14c)]}),_0x41f767=_0x3cfc95[_0x3e0b60(0x120)];if(_0x41f767[_0x3e0b60(0x145)][_0x3e0b60(0x123)]===0x0&&_0x41f767[_0x3e0b60(0x145)]['journeys']===0x0)return console[_0x3e0b60(0x119)](a31_0x5a4115[_0x3e0b60(0x14d)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x41f767[_0x3e0b60(0x150)]+'\x27')),0x0;const _0x60393e=_0x41f767[_0x3e0b60(0x11a)][_0x3e0b60(0x142)](_0x3a5216=>_0x3a5216[_0x3e0b60(0x155)]),_0x4af910=_0x41f767[_0x3e0b60(0x11a)]['filter'](_0x1428ca=>!_0x1428ca[_0x3e0b60(0x155)]&&_0x1428ca['hasChanges']),_0x3b48d8=_0x41f767[_0x3e0b60(0x11a)][_0x3e0b60(0x142)](_0x1391b4=>!_0x1391b4[_0x3e0b60(0x155)]&&!_0x1391b4[_0x3e0b60(0x12d)]);console['error']('\x0aPull\x20summary\x20for\x20\x27'+_0x41f767['parentName']+'\x27:'),console[_0x3e0b60(0x119)](_0x3e0b60(0x15a)+a31_0x5a4115['cyan'](_0x41f767[_0x3e0b60(0x145)][_0x3e0b60(0x123)]+_0x3e0b60(0x12b))+_0x3e0b60(0x126)+a31_0x5a4115[_0x3e0b60(0x136)](_0x41f767[_0x3e0b60(0x145)][_0x3e0b60(0x12f)]+_0x3e0b60(0x129)));if(_0x41f767[_0x3e0b60(0x145)][_0x3e0b60(0x157)]>0x0){const _0x8cb8b4=_0x41f767['counts']['journeyVersions']>_0x41f767['counts'][_0x3e0b60(0x157)]?'\x20('+_0x41f767[_0x3e0b60(0x145)]['journeyVersions']+'\x20versions)':'';console[_0x3e0b60(0x119)](_0x3e0b60(0x130)+a31_0x5a4115[_0x3e0b60(0x136)](_0x41f767[_0x3e0b60(0x145)][_0x3e0b60(0x157)]+_0x3e0b60(0x140))+a31_0x5a4115[_0x3e0b60(0x125)](_0x8cb8b4));}console['error']('\x20\x20'+a31_0x5a4115['green']('+\x20'+_0x60393e[_0x3e0b60(0x14a)]+_0x3e0b60(0x117))),console[_0x3e0b60(0x119)]('\x20\x20'+a31_0x5a4115[_0x3e0b60(0x14d)]('~\x20'+_0x4af910['length']+'\x20changed\x20files')),console[_0x3e0b60(0x119)]('\x20\x20'+a31_0x5a4115[_0x3e0b60(0x125)]('=\x20'+_0x3b48d8[_0x3e0b60(0x14a)]+_0x3e0b60(0x11c))),console[_0x3e0b60(0x119)]('\x20\x20Target:\x20'+a31_0x5a4115[_0x3e0b60(0x136)](_0x41f767['targetDir'])+'\x0a');if(_0x4af910[_0x3e0b60(0x14a)]>0x0)for(const _0x45a71e of _0x4af910){console[_0x3e0b60(0x119)]('\x0aChanges\x20to\x20\x27'+_0x45a71e[_0x3e0b60(0x14e)]+'\x27:'),console[_0x3e0b60(0x119)]('─'[_0x3e0b60(0x11b)](0x3c)),console[_0x3e0b60(0x119)](_0x45a71e[_0x3e0b60(0x156)]),console['error']('─'['repeat'](0x3c));}if(_0x34f45b['dryRun'])return console['error'](a31_0x5a4115[_0x3e0b60(0x14d)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x60393e['length']===0x0&&_0x4af910[_0x3e0b60(0x14a)]===0x0)return console['error'](a31_0x5a4115[_0x3e0b60(0x137)](_0x3e0b60(0x118))),saveSessionContext({'parent_segment':_0x41f767[_0x3e0b60(0x150)]},_0x34f45b[_0x3e0b60(0x144)]),console[_0x3e0b60(0x119)](a31_0x5a4115[_0x3e0b60(0x137)](_0x3e0b60(0x11f)+a31_0x5a4115[_0x3e0b60(0x125)](_0x3e0b60(0x14f))+_0x3e0b60(0x13f)+a31_0x5a4115[_0x3e0b60(0x136)](_0x41f767[_0x3e0b60(0x150)]))),0x0;if(!_0x34f45b[_0x3e0b60(0x159)]){if(!isInteractive())return console['error'](a31_0x5a4115[_0x3e0b60(0x153)](_0x3e0b60(0x124)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3e0b60(0x119)](a31_0x5a4115[_0x3e0b60(0x125)](_0x3e0b60(0x12a))),0x1;const _0x30b5f6=await confirmKey('Write\x20'+(_0x60393e[_0x3e0b60(0x14a)]+_0x4af910[_0x3e0b60(0x14a)])+_0x3e0b60(0x151));if(!_0x30b5f6)return console[_0x3e0b60(0x119)](a31_0x5a4115[_0x3e0b60(0x14d)](_0x3e0b60(0x15d)),_0x3e0b60(0x135)),0x1;}for(const _0x3cc414 of _0x41f767['files']){if(_0x3cc414[_0x3e0b60(0x155)]||_0x3cc414[_0x3e0b60(0x12d)]){const _0x146327=a31_0xd2e529['dirname'](_0x3cc414[_0x3e0b60(0x141)]);!existsSync(_0x146327)&&mkdirSync(_0x146327,{'recursive':!![]}),writeFileSync(_0x3cc414['absolutePath'],_0x3cc414[_0x3e0b60(0x14b)],_0x3e0b60(0x13b));}}return console[_0x3e0b60(0x119)](a31_0x5a4115[_0x3e0b60(0x137)]('βœ”\x20Pulled\x20'+(_0x60393e[_0x3e0b60(0x14a)]+_0x4af910[_0x3e0b60(0x14a)])+_0x3e0b60(0x13a)+_0x41f767['targetDir'])),saveSessionContext({'parent_segment':_0x41f767['parentName']},_0x34f45b[_0x3e0b60(0x144)]),console[_0x3e0b60(0x119)](a31_0x5a4115['green'](_0x3e0b60(0x11f)+a31_0x5a4115[_0x3e0b60(0x125)](_0x3e0b60(0x14f))+_0x3e0b60(0x13f)+a31_0x5a4115[_0x3e0b60(0x136)](_0x41f767[_0x3e0b60(0x150)]))),0x0;}}
@@ -1 +1 @@
1
- const a32_0x29c238=a32_0x50dd;(function(_0x36b55a,_0x46db3d){const _0x29296a=a32_0x50dd,_0x5a7312=_0x36b55a();while(!![]){try{const _0x55cc61=parseInt(_0x29296a(0x133))/0x1*(parseInt(_0x29296a(0x12d))/0x2)+parseInt(_0x29296a(0xf2))/0x3+parseInt(_0x29296a(0xe2))/0x4*(-parseInt(_0x29296a(0x136))/0x5)+-parseInt(_0x29296a(0x108))/0x6*(-parseInt(_0x29296a(0x14f))/0x7)+-parseInt(_0x29296a(0xef))/0x8+parseInt(_0x29296a(0x10f))/0x9+-parseInt(_0x29296a(0x122))/0xa;if(_0x55cc61===_0x46db3d)break;else _0x5a7312['push'](_0x5a7312['shift']());}catch(_0x211704){_0x5a7312['push'](_0x5a7312['shift']());}}}(a32_0x4061,0x311f5));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a32_0x4061(){const _0xf3c01e=['attributes','audienceId','journeyId','user','71617vquQTR','nameToType','get','error','Fetching\x20existing\x20segments...','Fetching\x20existing\x20folders...','Error:\x20Directory\x20not\x20found:\x20','changed','updated','\x20changes?','filePath','cwd','\x27...','.yml','listActivations','.yaml','\x20unchanged','dim','\x20\x20Source:\x20','yes','filter','parent_name','state','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','unchanged','parentFolder','Preparing\x20journeys...','Fetching\x20parent\x20segment\x20details...','\x20\x20\x20\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error\x20parsing\x20YAML:\x20','created','repeat','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','folderId','blue','segmentFolderId','parentName','no_parent','getJourney','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeyBundleName','red','then','13428kUfIkz','activations','endsWith','length','\x0aβœ”\x20Push\x20complete','results','list','\x20\x20πŸ“Š\x20Segments:','segments','createdAt','journeys','folderPath','description','918296qkZSph','listSegments','errorCode','25395HWmXzy','resolveParentId','all','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','createdSegmentIds','dryRun','updatedAt','set','nameToId','targetDir','getOutputSchemaWithCache','buildUserMaps','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','data','/e/','type','/app/ps/','No\x20','delete','\x20\x20Journeys:\x20','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Fetching\x20existing\x20journeys...','138yDkNUS','segment:push','file','\x20deleted','\x20new','Fetching\x20users\x20for\x20email\x20resolution...','\x20created','1143360kFTOwG','isNew','idToName','execute','journey','\x20to\x20update','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','site','toDelete','existingJourney','join','\x20changed','journeysOnly','paused','parentSegment','add','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','794510dCOUrn','setPhase','name','\x20to\x20delete','toCreate','\x20\x20Activations:\x20','scopedFolderPath','listJourneysWithDetailsFromParentSegment','\x20\x20Activations:','relationships','/j/da/je','82808ZKhrDC','green','helpText','verbose','Aborted.','πŸ“\x20','7uFWaaj','yamlConfig','yellow','395UJULCI','segment\x20or\x20journey','New\x20journey:','message','\x20activations]','push','diff','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','folders','\x20updated','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Error:\x20','cyan','new','segment','\x0aPush\x20summary\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Folders\x20to\x20create:','connection','map','Resolving\x20parent\x20segment\x20\x27'];a32_0x4061=function(){return _0xf3c01e;};return a32_0x4061();}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 a32_0x3d67a8 from'chalk';import{existsSync}from'fs';function a32_0x50dd(_0x451670,_0x2864f3){_0x451670=_0x451670-0xd0;const _0x4061c5=a32_0x4061();let _0x50dd7a=_0x4061c5[_0x451670];return _0x50dd7a;}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{[a32_0x29c238(0x124)]=a32_0x29c238(0x109);[a32_0x29c238(0xee)]=a32_0x29c238(0xf5);async[a32_0x29c238(0x112)](_0x3cc3df){const _0x45570d=a32_0x29c238,{options:_0x275fe2,args:_0x46e823,tdx:_0x18d21f}=_0x3cc3df,_0x35bb2f=_0x275fe2,_0x462480=await resolveTarget({'arg':_0x46e823[0x0],'contextParent':_0x275fe2[_0x45570d(0x11e)],'cwd':process[_0x45570d(0x15a)]()});if(!isSuccessfulResolution(_0x462480))return _0x462480[_0x45570d(0xf1)]===_0x45570d(0xdc)?(console['error'](a32_0x3d67a8[_0x45570d(0x135)](_0x45570d(0x121))),console[_0x45570d(0x152)](_0x45570d(0x106)),console['error'](_0x45570d(0x140)),console[_0x45570d(0x152)](_0x45570d(0x146))):(console['error'](a32_0x3d67a8[_0x45570d(0xe0)](_0x45570d(0x141)+_0x462480['message']+'\x0a')),_0x462480[_0x45570d(0x12f)]&&console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x142)](_0x462480[_0x45570d(0x12f)]))),0x1;if(_0x462480[_0x45570d(0x101)]===_0x45570d(0x164))return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)](_0x45570d(0x155)+_0x462480[_0x45570d(0xfb)]+'\x0a')),console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x142)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x23b743=_0x462480[_0x45570d(0xdb)],_0x3c23d8=_0x462480[_0x45570d(0xfb)],_0x1a1b7b=_0x462480['type']===_0x45570d(0x10a)?_0x462480[_0x45570d(0x159)]:undefined,_0x27882a=getScopedDetails(_0x462480),_0x65ebe2=_0x27882a?.['isScoped']??![],_0x3833ec=_0x27882a?.[_0x45570d(0x128)]??'';if(!existsSync(_0x3c23d8))return console[_0x45570d(0x152)](a32_0x3d67a8['red'](_0x45570d(0x155)+_0x3c23d8+'\x0a')),console[_0x45570d(0x152)](a32_0x3d67a8['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x35bb2f[_0x45570d(0x130)]&&(console[_0x45570d(0x152)]('Site:\x20'+_0x35bb2f[_0x45570d(0x117)]),console[_0x45570d(0x152)]('Parent\x20segment:\x20'+_0x23b743),console[_0x45570d(0x152)]('Source\x20directory:\x20'+_0x3c23d8),_0x65ebe2&&console[_0x45570d(0x152)]('Scoped\x20to\x20folder:\x20'+_0x3833ec));const _0x201b1f=await withSpinner(_0x45570d(0x14a)+_0x23b743+_0x45570d(0x15b),()=>_0x18d21f[_0x45570d(0x144)][_0x45570d(0xf3)](_0x23b743),{'verbose':_0x35bb2f['verbose']}),_0x15cdb6=_0x201b1f[_0x45570d(0xff)],[_0x94d6a5,_0x424d53,_0x14182f,_0x33765b,_0x5f498d]=await Promise[_0x45570d(0xf4)]([withSpinner(_0x45570d(0xd1),()=>_0x18d21f[_0x45570d(0x144)]['getParent'](_0x15cdb6),{'verbose':_0x35bb2f[_0x45570d(0x130)]}),withSpinner(_0x45570d(0x153),()=>_0x18d21f['segment'][_0x45570d(0xf0)](_0x15cdb6),{'verbose':_0x35bb2f[_0x45570d(0x130)]}),withSpinner(_0x45570d(0x154),()=>_0x18d21f[_0x45570d(0x144)]['listFolders'](_0x15cdb6),{'verbose':_0x35bb2f[_0x45570d(0x130)]}),withSpinner(_0x45570d(0x107),()=>_0x18d21f[_0x45570d(0x113)][_0x45570d(0x129)](_0x15cdb6,{'includeAllVersions':!![]}),{'verbose':_0x35bb2f[_0x45570d(0x130)]}),withSpinner(_0x45570d(0x10d),()=>_0x18d21f[_0x45570d(0x14e)][_0x45570d(0xfd)](),{'verbose':_0x35bb2f['verbose']})[_0x45570d(0xe1)](_0x28b9aa=>_0x28b9aa[_0x45570d(0xff)])]),_0x213fce=_0x94d6a5[_0x45570d(0xff)],_0x4695bf=extractRootFolderId(_0x213fce),_0x4b323a=_0x424d53[_0x45570d(0xff)],_0x49ea76=_0x14182f[_0x45570d(0xff)],{journeys:_0x26473c,activationStepsById:_0x5f1a27}=_0x33765b[_0x45570d(0xff)],_0x558820=new Map(_0x26473c[_0x45570d(0x149)](_0x38b796=>[_0x38b796['id'],_0x38b796])),_0x536ffe=_0x26473c[_0x45570d(0x149)](_0xa9eda8=>({'id':_0xa9eda8['id'],'name':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0x124)],'journeyBundleName':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0xdf)]||'','journeyBundleId':_0xa9eda8[_0x45570d(0x14b)]['journeyBundleId']||'','versionNumber':_0xa9eda8[_0x45570d(0x14b)]['versionNumber'],'description':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0xee)],'state':_0xa9eda8['attributes'][_0x45570d(0x165)],'paused':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0x11d)],'audienceId':_0xa9eda8['attributes'][_0x45570d(0x14c)],'folderId':_0xa9eda8[_0x45570d(0x12b)]?.[_0x45570d(0x168)]?.[_0x45570d(0xff)]?.['id'],'createdAt':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0xeb)],'updatedAt':_0xa9eda8[_0x45570d(0x14b)][_0x45570d(0xf8)]})),{emailToId:_0x5e15d8,idToEmail:_0x4d07e2}=_0x5f498d,_0x3e8d17=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xf154e8=_0x45570d,_0x13c1d4=await _0x18d21f[_0xf154e8(0x148)][_0xf154e8(0xe8)]();return buildConnectionMaps(_0x13c1d4);},{'verbose':_0x35bb2f[_0x45570d(0x130)]})['then'](_0x4b1090=>_0x4b1090[_0x45570d(0xff)]),_0x3c783d=_0x3e8d17[_0x45570d(0xfa)],_0x2932be=_0x3e8d17[_0x45570d(0x111)],_0x19631a=_0x3e8d17[_0x45570d(0x150)],_0x175b4b={'emailToIdMap':_0x5e15d8,'connectionNameToIdMap':_0x3c783d,'connectionNameToTypeMap':_0x19631a,'getSchema':_0x56e95f=>_0x18d21f[_0x45570d(0x148)][_0x45570d(0xfc)](_0x56e95f)};let {pathToId:_0x571a05,idToPath:_0x50d6c7}=buildFolderMaps(_0x49ea76);const _0x1842a3=buildSegmentLookupMap(_0x4b323a,_0x50d6c7),_0x709e84=buildSegmentNameToIdMap(_0x4b323a),_0x210db5=buildJourneyBundleLookupMap(_0x536ffe,_0x50d6c7);let _0x4a3b4d;if(_0x1a1b7b){if(!_0x1a1b7b['endsWith'](_0x45570d(0x15c))&&!_0x1a1b7b[_0x45570d(0xe4)](_0x45570d(0x15e)))return console[_0x45570d(0x152)](a32_0x3d67a8['red'](_0x45570d(0x116)+_0x1a1b7b+'\x0a')),0x1;_0x4a3b4d=[_0x1a1b7b];}else _0x4a3b4d=findYamlFiles(_0x3c23d8);if(_0x4a3b4d['length']===0x0)return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)](_0x45570d(0xd3)+_0x3c23d8+'\x0a')),console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x142)](_0x45570d(0x13d))),0x1;let _0x1c8693,_0x38a154;try{const _0x5e5424=parseAndClassifyYamlFiles(_0x4a3b4d,_0x3c23d8,{'skipSegments':_0x35bb2f['journeysOnly']});_0x1c8693=_0x5e5424[_0x45570d(0xea)],_0x38a154=_0x5e5424[_0x45570d(0xec)];const _0x23e905=validateParsedFiles(_0x5e5424,_0x3c23d8);if(_0x23e905[_0x45570d(0xe5)]>0x0)return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)]('\x0aValidation\x20failed:')),console[_0x45570d(0x152)](formatValidationErrors(_0x23e905)),console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x4c3409){return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)](_0x45570d(0xd4)+(_0x4c3409 instanceof Error?_0x4c3409[_0x45570d(0x139)]:_0x4c3409))),0x1;}if(_0x1c8693[_0x45570d(0xe5)]===0x0&&_0x38a154[_0x45570d(0xe5)]===0x0){const _0x24158e=_0x35bb2f['journeysOnly']?_0x45570d(0x113):_0x45570d(0x137);return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)](_0x45570d(0x103)+_0x24158e+'\x20YAML\x20files\x20found')),0x0;}const _0x36343e=new Map();_0x4b323a[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x4b323a,async _0x230e07=>{const _0x32c688=a32_0x50dd,_0x45a0c2=await _0x18d21f[_0x32c688(0x144)][_0x32c688(0x15d)](_0x15cdb6,_0x230e07['id']);_0x36343e[_0x32c688(0xf9)](_0x230e07['id'],_0x45a0c2);});},{'verbose':_0x35bb2f['verbose']});const {segmentFiles:_0x1d07ae,foldersToCreate:_0x4962b4}=await prepareSegmentFiles(_0x1c8693,{'segmentByFolderAndName':_0x1842a3,'activationsBySegmentId':_0x36343e,'folderPathToId':_0x571a05,'idToEmailMap':_0x4d07e2,'connectionIdToNameMap':_0x2932be},_0x175b4b,_0x65ebe2,_0x3833ec),_0x33161c=_0x1a1b7b?[]:findSegmentsToDelete(_0x4b323a,_0x1c8693[_0x45570d(0x149)](({yamlConfig:_0x317e55,folderPath:_0x3482fa})=>({'yamlConfig':_0x317e55,'folderPath':resolveTDFolderPath(_0x3482fa,_0x65ebe2,_0x3833ec)})),_0x50d6c7,_0x3833ec,_0x65ebe2),{journeyFiles:_0x44c25d,foldersToCreate:_0x461749}=await withProgressSpinner(_0x45570d(0xd0),async _0x8b9fe=>prepareJourneyFiles(_0x38a154,{'fetchJourney':async _0x1d457b=>_0x18d21f['journey'][_0x45570d(0xdd)](_0x1d457b[_0x45570d(0x14d)]),'journeyBundlesByFolderAndName':_0x210db5,'folderPathToId':_0x571a05,'idToEmailMap':_0x4d07e2,'connectionIdToNameMap':_0x2932be,'existingSegments':_0x4b323a,'parentId':_0x15cdb6,'deps':_0x18d21f,'progress':{'update':_0x689261=>{const _0x1a8e3d=_0x45570d;_0x8b9fe[_0x1a8e3d(0x123)](_0x689261),_0x35bb2f['verbose']&&console['error']('\x20\x20'+_0x689261);}},'journeyById':_0x558820,'activationStepsById':_0x5f1a27},_0x65ebe2,_0x3833ec),{'verbose':_0x35bb2f[_0x45570d(0x130)]})[_0x45570d(0xe1)](_0x284151=>_0x284151[_0x45570d(0xff)]);for(const _0x4388d4 of _0x461749){_0x4962b4[_0x45570d(0x11f)](_0x4388d4);}const _0x20cdd3=_0x1a1b7b?[]:findJourneysToDelete(_0x536ffe,_0x38a154[_0x45570d(0x149)](({yamlConfig:_0x35690a,folderPath:_0x5bb0f8})=>({'yamlConfig':_0x35690a,'folderPath':resolveTDFolderPath(_0x5bb0f8,_0x65ebe2,_0x3833ec)})),_0x50d6c7,_0x3833ec,_0x65ebe2),_0x10ae14=calculatePushStats(_0x1d07ae,_0x44c25d,_0x4962b4,_0x33161c,_0x20cdd3,!!_0x35bb2f[_0x45570d(0x104)],!!_0x35bb2f[_0x45570d(0x11c)]),_0x65d4dd=_0x10ae14[_0x45570d(0xea)][_0x45570d(0x143)],_0x20efcf=_0x10ae14['segments']['changed'],_0x543082=_0x10ae14[_0x45570d(0xea)][_0x45570d(0x167)],_0x3d952a=_0x10ae14['segments']['toDelete'],_0x3d1b46=_0x10ae14[_0x45570d(0x13e)][_0x45570d(0x126)],_0x150d93=_0x10ae14[_0x45570d(0xec)][_0x45570d(0x143)],_0x4ed5a3=_0x10ae14[_0x45570d(0xec)][_0x45570d(0x156)],_0x167f25=_0x10ae14[_0x45570d(0xec)][_0x45570d(0x167)],_0x56c3f5=_0x10ae14[_0x45570d(0xec)][_0x45570d(0x118)],_0x5bbad3=_0x10ae14[_0x45570d(0xe3)]['all'],_0x59f594=_0x10ae14[_0x45570d(0xe3)][_0x45570d(0x126)],_0x424124=_0x10ae14[_0x45570d(0xe3)]['toUpdate'],_0x19f0e6=_0x10ae14[_0x45570d(0xe3)][_0x45570d(0x118)];console[_0x45570d(0x152)](_0x45570d(0x145)+_0x23b743+'\x27:');_0x3d1b46[_0x45570d(0xe5)]>0x0&&console[_0x45570d(0x152)]('\x20\x20'+a32_0x3d67a8[_0x45570d(0xd9)](_0x45570d(0x132)+_0x3d1b46[_0x45570d(0xe5)]+'\x20folders\x20to\x20create'));if(!_0x35bb2f[_0x45570d(0x11c)]){console[_0x45570d(0x152)](_0x45570d(0xe9)),console[_0x45570d(0x152)]('\x20\x20\x20\x20'+a32_0x3d67a8[_0x45570d(0x12e)]('+\x20'+_0x65d4dd['length']+_0x45570d(0x10c))),console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x135)]('~\x20'+_0x20efcf[_0x45570d(0xe5)]+_0x45570d(0x11b)));if(_0x3d952a[_0x45570d(0xe5)]>0x0)console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0xe0)]('-\x20'+_0x3d952a['length']+_0x45570d(0x125)));else _0x33161c[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x104)]&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x160)](_0x33161c['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x160)]('=\x20'+_0x543082['length']+_0x45570d(0x15f)));}if(_0x44c25d[_0x45570d(0xe5)]>0x0||_0x20cdd3[_0x45570d(0xe5)]>0x0){console[_0x45570d(0x152)]('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8['green']('+\x20'+_0x150d93[_0x45570d(0xe5)]+'\x20new')),console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8['yellow']('~\x20'+_0x4ed5a3[_0x45570d(0xe5)]+'\x20changed'));if(_0x56c3f5[_0x45570d(0xe5)]>0x0)console[_0x45570d(0x152)](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0xe0)]('-\x20'+_0x56c3f5['length']+_0x45570d(0x125)));else _0x20cdd3[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x104)]&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8['dim'](_0x20cdd3['length']+_0x45570d(0xde)));console[_0x45570d(0x152)]('\x20\x20\x20\x20'+a32_0x3d67a8['dim']('=\x20'+_0x167f25[_0x45570d(0xe5)]+_0x45570d(0x15f)));}_0x5bbad3['length']>0x0&&!_0x35bb2f['journeysOnly']&&(console[_0x45570d(0x152)](''),console[_0x45570d(0x152)](_0x45570d(0x12a)),_0x59f594[_0x45570d(0xe5)]>0x0&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x12e)]('+\x20'+_0x59f594[_0x45570d(0xe5)]+'\x20to\x20create')),_0x424124[_0x45570d(0xe5)]>0x0&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0x135)]('~\x20'+_0x424124['length']+_0x45570d(0x114))),_0x19f0e6[_0x45570d(0xe5)]>0x0&&console['error'](_0x45570d(0xd2)+a32_0x3d67a8[_0x45570d(0xe0)]('-\x20'+_0x19f0e6['length']+_0x45570d(0x125))));console[_0x45570d(0x152)](_0x45570d(0x161)+a32_0x3d67a8[_0x45570d(0x142)](_0x3c23d8)+'\x0a');if(_0x3d1b46['length']>0x0){console[_0x45570d(0x152)](_0x45570d(0x147));for(const _0x131271 of _0x3d1b46){console[_0x45570d(0x152)]('\x20\x20'+a32_0x3d67a8['blue']('+')+'\x20'+_0x131271);}console['error']('');}if(_0x65d4dd[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)])for(const _0x153c20 of _0x65d4dd){const _0x55c371=_0x153c20[_0x45570d(0xed)]?_0x153c20[_0x45570d(0xed)]+'/'+_0x153c20[_0x45570d(0x134)][_0x45570d(0x124)]:_0x153c20['yamlConfig'][_0x45570d(0x124)],_0x580507=_0x153c20[_0x45570d(0x134)][_0x45570d(0xe3)]?.[_0x45570d(0xe5)]||0x0,_0x48c85c=_0x580507>0x0?a32_0x3d67a8[_0x45570d(0x160)]('\x20['+_0x580507+_0x45570d(0x13a)):'';console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8['green']('New\x20segment:')+'\x20'+_0x55c371+_0x48c85c),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c)),_0x153c20['diff']&&console[_0x45570d(0x152)](_0x153c20['diff']),console[_0x45570d(0x152)]('─'['repeat'](0x3c));}if(_0x3d952a[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)])for(const _0x48be7f of _0x3d952a){const _0x11a801=_0x48be7f[_0x45570d(0xda)]?_0x50d6c7['get'](_0x48be7f['segmentFolderId']['toString']())||'':'',_0x9e2d7d=_0x11a801?_0x11a801+'/'+_0x48be7f['name']:_0x48be7f[_0x45570d(0x124)],_0x2c8f1a=_0x36343e[_0x45570d(0x151)](_0x48be7f['id'])||[],_0x1acd5f=_0x2c8f1a['length']>0x0?a32_0x3d67a8[_0x45570d(0x160)]('\x20['+_0x2c8f1a[_0x45570d(0xe5)]+_0x45570d(0x13a)):'';console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8[_0x45570d(0xe0)]('Delete\x20segment:')+'\x20'+_0x9e2d7d+_0x1acd5f),console['error']('─'[_0x45570d(0xd6)](0x3c));const _0x209ec9=segmentWithActivationsToYaml(_0x48be7f,_0x2c8f1a,undefined,_0x4d07e2,_0x2932be),_0x1b8c94=segmentToYamlString(_0x209ec9),_0x23bba1=generateDiff(_0x1b8c94,'');console['error'](formatDiffWithColors(_0x23bba1)),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c));}const _0x4d0e61=_0x1d07ae[_0x45570d(0x163)](_0x338b10=>!_0x338b10[_0x45570d(0x110)]&&_0x338b10['diff']);if(_0x4d0e61[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)])for(const _0x129b3e of _0x4d0e61){const _0x1bb3fa=_0x129b3e[_0x45570d(0xed)]?_0x129b3e[_0x45570d(0xed)]+'/'+_0x129b3e[_0x45570d(0x134)][_0x45570d(0x124)]:_0x129b3e['yamlConfig'][_0x45570d(0x124)];console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8[_0x45570d(0x135)]('Changes\x20to:')+'\x20'+_0x1bb3fa),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c)),console[_0x45570d(0x152)](_0x129b3e[_0x45570d(0x13c)]),console['error']('─'[_0x45570d(0xd6)](0x3c));}if(_0x150d93[_0x45570d(0xe5)]>0x0)for(const _0x43f594 of _0x150d93){const _0x59f601=_0x43f594[_0x45570d(0xed)]?_0x43f594['folderPath']+'/'+_0x43f594[_0x45570d(0x134)][_0x45570d(0x124)]:_0x43f594[_0x45570d(0x134)][_0x45570d(0x124)];console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8[_0x45570d(0x12e)](_0x45570d(0x138))+'\x20'+_0x59f601),console['error']('─'[_0x45570d(0xd6)](0x3c)),_0x43f594[_0x45570d(0x13c)]&&console['error'](_0x43f594[_0x45570d(0x13c)]),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c));}const _0x53a4e4=_0x44c25d[_0x45570d(0x163)](_0x10ed81=>!_0x10ed81[_0x45570d(0x110)]&&_0x10ed81[_0x45570d(0x13c)]);if(_0x53a4e4[_0x45570d(0xe5)]>0x0)for(const _0x2ff7eb of _0x53a4e4){const _0x357f2f=_0x2ff7eb[_0x45570d(0xed)]?_0x2ff7eb[_0x45570d(0xed)]+'/'+_0x2ff7eb['yamlConfig'][_0x45570d(0x124)]:_0x2ff7eb['yamlConfig'][_0x45570d(0x124)];console['error']('\x0a'+a32_0x3d67a8[_0x45570d(0x135)]('Changes\x20to\x20journey:')+'\x20'+_0x357f2f),console['error']('─'[_0x45570d(0xd6)](0x3c)),console[_0x45570d(0x152)](_0x2ff7eb[_0x45570d(0x13c)]),console['error']('─'[_0x45570d(0xd6)](0x3c));}if(_0x56c3f5[_0x45570d(0xe5)]>0x0)for(const _0x599b0c of _0x56c3f5){const _0x3525ce=_0x599b0c[_0x45570d(0xd8)]?_0x50d6c7[_0x45570d(0x151)](_0x599b0c[_0x45570d(0xd8)])||'':'',_0x5cdbf2=_0x3525ce?_0x3525ce+'/'+_0x599b0c[_0x45570d(0xdf)]:_0x599b0c['journeyBundleName'];console[_0x45570d(0x152)]('\x0a'+a32_0x3d67a8[_0x45570d(0xe0)]('Delete\x20journey:')+'\x20'+_0x5cdbf2),console[_0x45570d(0x152)]('─'['repeat'](0x3c)),console[_0x45570d(0x152)](a32_0x3d67a8['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x45570d(0x152)]('─'[_0x45570d(0xd6)](0x3c));}if(_0x35bb2f[_0x45570d(0xf7)])return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)](_0x45570d(0x166))),0x0;const _0x297265=_0x35bb2f['journeysOnly']?![]:_0x65d4dd[_0x45570d(0xe5)]>0x0||_0x20efcf[_0x45570d(0xe5)]>0x0||_0x3d952a[_0x45570d(0xe5)]>0x0,_0x51dd21=_0x150d93[_0x45570d(0xe5)]>0x0||_0x4ed5a3[_0x45570d(0xe5)]>0x0||_0x56c3f5['length']>0x0,_0x14a3a4=_0x35bb2f[_0x45570d(0x11c)]?![]:_0x5bbad3[_0x45570d(0xe5)]>0x0,_0x7efeb3=_0x3d1b46[_0x45570d(0xe5)]>0x0;if(!_0x297265&&!_0x51dd21&&!_0x14a3a4&&!_0x7efeb3){const _0x4beaae=_0x35bb2f['journeysOnly']?_0x45570d(0xfe):_0x45570d(0x120);console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x12e)](_0x4beaae));if(_0x1a1b7b&&_0x167f25['length']===0x1){const _0x3d2e58=_0x167f25[0x0];if(_0x3d2e58[_0x45570d(0x119)]?.['id']){const _0x220a8b=getConsoleNextUrl(_0x35bb2f[_0x45570d(0x117)],_0x45570d(0x102)+_0x15cdb6+_0x45570d(0x100)+_0x3d2e58[_0x45570d(0x119)]['id']+_0x45570d(0x12c));console[_0x45570d(0x152)]('\x20\x20'+a32_0x3d67a8['cyan'](_0x220a8b));}}return 0x0;}const _0x2ef936=_0x35bb2f[_0x45570d(0x11c)]?_0x150d93[_0x45570d(0xe5)]+_0x4ed5a3[_0x45570d(0xe5)]+_0x56c3f5['length']+_0x3d1b46['length']:_0x65d4dd[_0x45570d(0xe5)]+_0x20efcf[_0x45570d(0xe5)]+_0x3d952a[_0x45570d(0xe5)]+_0x150d93[_0x45570d(0xe5)]+_0x4ed5a3[_0x45570d(0xe5)]+_0x56c3f5[_0x45570d(0xe5)]+_0x3d1b46[_0x45570d(0xe5)]+_0x5bbad3[_0x45570d(0xe5)];if(!_0x35bb2f[_0x45570d(0x162)]&&_0x2ef936>0x0){if(!isInteractive())return console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0xe0)]('\x0aError:'),_0x45570d(0x115)),console[_0x45570d(0x152)](a32_0x3d67a8['dim'](_0x45570d(0xd7))),0x1;const _0x108634=await confirmKey('Push\x20'+_0x2ef936+_0x45570d(0x158));if(!_0x108634)return console[_0x45570d(0x152)](a32_0x3d67a8['yellow'](_0x45570d(0x131))),0x1;}const _0x4fc351={'withProgress':async(_0x589bd7,_0x40567d)=>{const _0xe51029=_0x45570d,_0x473a23=await withSpinner(_0x589bd7,_0x40567d,{'verbose':_0x35bb2f[_0xe51029(0x130)]});return{'data':_0x473a23[_0xe51029(0xff)]};},'logInfo':_0x5d0b8a=>console['error'](a32_0x3d67a8[_0x45570d(0xd9)]('βœ”\x20'+_0x5d0b8a)),'logSuccess':_0x56191f=>console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x12e)]('βœ”\x20'+_0x56191f)),'logWarning':_0xd73035=>console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)]('⚠\x20'+_0xd73035)),'logDeleted':_0x118c8c=>console['error'](a32_0x3d67a8[_0x45570d(0xe0)]('βœ”\x20'+_0x118c8c))},_0x9faacc={'segment':_0x18d21f['segment'],'journey':_0x18d21f[_0x45570d(0x113)],'user':_0x18d21f[_0x45570d(0x14e)],'connection':_0x18d21f[_0x45570d(0x148)]};_0x3d1b46['length']>0x0&&(_0x571a05=await executePushFolders(_0x9faacc,_0x3d1b46,_0x571a05,{'parentId':_0x15cdb6},_0x4fc351));const _0x1cffb8={'rootFolderId':_0x4695bf,'folderPathToId':_0x571a05,'folderIdToPath':_0x50d6c7,'segmentNameToId':_0x709e84,'activationsBySegmentId':_0x36343e,'emailToIdMap':_0x5e15d8,'idToEmailMap':_0x4d07e2,'connectionNameToIdMap':_0x3e8d17[_0x45570d(0xfa)],'connectionIdToNameMap':_0x3e8d17['idToName'],'connectionNameToTypeMap':_0x19631a},_0x59996e=await executePushSegments(_0x9faacc,_0x35bb2f[_0x45570d(0x11c)]?[]:_0x1d07ae,_0x1cffb8,{'parentId':_0x15cdb6},_0x4fc351),_0x5f2065=_0x59996e[_0x45570d(0xd5)],_0x72a607=_0x59996e[_0x45570d(0x157)],_0x5808a4=_0x59996e['activations'][_0x45570d(0xd5)],_0x5522b9=_0x59996e['activations'][_0x45570d(0x157)],_0x44813c=_0x59996e[_0x45570d(0xe3)]['deleted'],_0x2b1797=await executePushSegmentDeletions(_0x9faacc,_0x35bb2f[_0x45570d(0x11c)]?[]:_0x3d952a,_0x4fc351);let _0x266775=0x0,_0x2cd829=0x0,_0x48e435=0x0;const _0x436331=new Map(_0x709e84);for(const [_0x5d518c,_0x23eeb7]of _0x59996e[_0x45570d(0xf6)]){_0x436331[_0x45570d(0xf9)](_0x5d518c,_0x23eeb7);}if(_0x44c25d[_0x45570d(0xe5)]>0x0){const _0x3be308={..._0x1cffb8,'segmentNameToId':_0x436331,'existingSegments':_0x4b323a,'activationContext':_0x175b4b},_0x76f0ef=await executePushJourneys(_0x9faacc,_0x44c25d,_0x3be308,{'parentId':_0x15cdb6,'rootFolderId':_0x4695bf,'verbose':_0x35bb2f[_0x45570d(0x130)]},_0x4fc351);_0x266775=_0x76f0ef[_0x45570d(0xd5)],_0x2cd829=_0x76f0ef[_0x45570d(0x157)];if(_0x1a1b7b&&_0x76f0ef['results']['length']===0x1){const _0x1ef8f1=_0x76f0ef[_0x45570d(0xe7)][0x0];if(_0x1ef8f1[_0x45570d(0x14d)]){const _0x2c53b8=getConsoleNextUrl(_0x35bb2f[_0x45570d(0x117)],_0x45570d(0x102)+_0x15cdb6+_0x45570d(0x100)+_0x1ef8f1['journeyId']+_0x45570d(0x12c));console['error']('\x20\x20'+a32_0x3d67a8['cyan'](_0x2c53b8));}}}for(const _0x559131 of _0x56c3f5){console[_0x45570d(0x152)](a32_0x3d67a8[_0x45570d(0x135)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x559131['journeyBundleName'])),_0x48e435++;}const _0x196e1e=[];if(_0x5f2065>0x0)_0x196e1e[_0x45570d(0x13b)](_0x5f2065+_0x45570d(0x10e));if(_0x72a607>0x0)_0x196e1e[_0x45570d(0x13b)](_0x72a607+_0x45570d(0x13f));if(_0x2b1797>0x0)_0x196e1e[_0x45570d(0x13b)](_0x2b1797+'\x20deleted');const _0xc4cdd=[];if(_0x266775>0x0)_0xc4cdd[_0x45570d(0x13b)](_0x266775+_0x45570d(0x10e));if(_0x2cd829>0x0)_0xc4cdd['push'](_0x2cd829+_0x45570d(0x13f));if(_0x48e435>0x0)_0xc4cdd[_0x45570d(0x13b)](_0x48e435+'\x20deleted');const _0x4506a3=[];if(_0x5808a4>0x0)_0x4506a3[_0x45570d(0x13b)](_0x5808a4+'\x20created');if(_0x5522b9>0x0)_0x4506a3[_0x45570d(0x13b)](_0x5522b9+_0x45570d(0x13f));if(_0x44813c>0x0)_0x4506a3['push'](_0x44813c+_0x45570d(0x10b));return console['error'](a32_0x3d67a8[_0x45570d(0x12e)](_0x45570d(0xe6))),_0x196e1e['length']>0x0&&!_0x35bb2f[_0x45570d(0x11c)]&&console[_0x45570d(0x152)]('\x20\x20Segments:\x20'+_0x196e1e[_0x45570d(0x11a)](',\x20')),_0xc4cdd[_0x45570d(0xe5)]>0x0&&console[_0x45570d(0x152)](_0x45570d(0x105)+_0xc4cdd[_0x45570d(0x11a)](',\x20')),_0x4506a3[_0x45570d(0xe5)]>0x0&&!_0x35bb2f[_0x45570d(0x11c)]&&console[_0x45570d(0x152)](_0x45570d(0x127)+_0x4506a3[_0x45570d(0x11a)](',\x20')),0x0;}}
1
+ const a32_0x56349f=a32_0x1c5a;(function(_0x119acf,_0x77b171){const _0x2d4f83=a32_0x1c5a,_0x1cdb2d=_0x119acf();while(!![]){try{const _0x56a137=-parseInt(_0x2d4f83(0x198))/0x1+parseInt(_0x2d4f83(0x1cc))/0x2+-parseInt(_0x2d4f83(0x152))/0x3+parseInt(_0x2d4f83(0x1cf))/0x4*(-parseInt(_0x2d4f83(0x1b6))/0x5)+parseInt(_0x2d4f83(0x182))/0x6+parseInt(_0x2d4f83(0x174))/0x7+-parseInt(_0x2d4f83(0x197))/0x8*(-parseInt(_0x2d4f83(0x183))/0x9);if(_0x56a137===_0x77b171)break;else _0x1cdb2d['push'](_0x1cdb2d['shift']());}catch(_0x2904e7){_0x1cdb2d['push'](_0x1cdb2d['shift']());}}}(a32_0x87c3,0xdb887));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a32_0x1c5a(_0x541b07,_0x313d26){_0x541b07=_0x541b07-0x13a;const _0x87c32d=a32_0x87c3();let _0x1c5a40=_0x87c32d[_0x541b07];return _0x1c5a40;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a32_0x1f1e63 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';function a32_0x87c3(){const _0x3af198=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20to\x20delete','activations','folderPath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','5304135xwxeCP','isNew','\x20YAML\x20files\x20found','created','buildUserMaps','updated','getParent','\x20\x20Segments:\x20','new','getJourney','\x0aPush\x20summary\x20for\x20\x27','get','targetDir','folders','cyan','parentSegment','results','length','segment\x20or\x20journey','\x27...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Fetching\x20connections\x20for\x20name\x20resolution...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','red','journeyId','type','journeyBundleId','\x0aβœ”\x20Push\x20complete','\x20\x20Journeys:\x20','file','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','all','\x20\x20Activations:\x20','Error\x20parsing\x20YAML:\x20','11306841jkAoXQ','journeysOnly','\x20changes?','name','user','\x20\x20\x20\x20','toString','attributes','join','parentName','endsWith','message','journeys','yellow','6109530YmTPUu','19107StAbYm','changed','resolveParentId','parent_name','\x20\x20Source:\x20','No\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Fetching\x20parent\x20segment\x20details...','\x0aError:','Fetching\x20users\x20for\x20email\x20resolution...','error','helpText','nameToId','\x20folders\x20to\x20create','site','deleted','(Journey\x20will\x20be\x20deleted)','Resolving\x20parent\x20segment\x20\x27','diff','Parent\x20segment:\x20','8976LdYyHn','1261528YBAFqW','Scoped\x20to\x20folder:\x20','connection','Site:\x20','filePath','segmentFolderId','delete','\x0aValidation\x20failed:','Error:\x20Directory\x20not\x20found:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toDelete','Changes\x20to:','listJourneysWithDetailsFromParentSegment','setPhase','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20\x20Activations:','green','map','cwd','createdSegmentIds','Fetching\x20existing\x20segments...','\x20to\x20create','.yaml','\x20to\x20update','errorCode','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20updated','listSegments','toUpdate','Fetching\x20existing\x20folders...','505UCAKNE','Preparing\x20journeys...','\x20activations]','idToName','dryRun','repeat','segment','then','/app/ps/','.yml','unchanged','Aborted.','Source\x20directory:\x20','journeyBundleName','Fetching\x20existing\x20activations...','Delete\x20segment:','folderId','audienceId','listActivations','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','filter','349694MIosjs','\x20unchanged','push','49964tbpoli','existingJourney','\x20deleted','listFolders','dim','set','paused','blue','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20created','versionNumber','Folders\x20to\x20create:','yamlConfig','nameToType','data','updatedAt','\x20changed','segments','journey','verbose','πŸ“\x20','isScoped','toCreate','description','/e/','\x20new'];a32_0x87c3=function(){return _0x3af198;};return a32_0x87c3();}export class SegmentPushCommand extends BaseCommand{['name']='segment:push';[a32_0x56349f(0x149)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x1d7ef7){const _0x2431a0=a32_0x56349f,{options:_0x5ab2cc,args:_0x56db90,tdx:_0x5226b0}=_0x1d7ef7,_0x2d56b1=_0x5ab2cc,_0x562f4b=await resolveTarget({'arg':_0x56db90[0x0],'contextParent':_0x5ab2cc[_0x2431a0(0x161)],'cwd':process[_0x2431a0(0x1aa)]()});if(!isSuccessfulResolution(_0x562f4b))return _0x562f4b[_0x2431a0(0x1b0)]==='no_parent'?(console['error'](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x1b1))),console[_0x2431a0(0x18d)]('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[_0x2431a0(0x18d)](_0x2431a0(0x168)),console[_0x2431a0(0x18d)](_0x2431a0(0x14c))):(console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x169)]('Error:\x20'+_0x562f4b[_0x2431a0(0x17f)]+'\x0a')),_0x562f4b[_0x2431a0(0x18e)]&&console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x160)](_0x562f4b[_0x2431a0(0x18e)]))),0x1;if(_0x562f4b[_0x2431a0(0x16b)]===_0x2431a0(0x186))return console['error'](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x1a0)+_0x562f4b[_0x2431a0(0x15e)]+'\x0a')),console[_0x2431a0(0x18d)](a32_0x1f1e63['cyan'](_0x2431a0(0x1c9))),0x1;const _0x488b0b=_0x562f4b[_0x2431a0(0x17d)],_0x30f4c5=_0x562f4b['targetDir'],_0x2394d0=_0x562f4b['type']===_0x2431a0(0x16f)?_0x562f4b[_0x2431a0(0x19c)]:undefined,_0x4d64c0=getScopedDetails(_0x562f4b),_0x187f70=_0x4d64c0?.[_0x2431a0(0x147)]??![],_0x4c5738=_0x4d64c0?.['scopedFolderPath']??'';if(!existsSync(_0x30f4c5))return console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x1a0)+_0x30f4c5+'\x0a')),console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x160)](_0x2431a0(0x1c9))),0x1;_0x2d56b1[_0x2431a0(0x145)]&&(console[_0x2431a0(0x18d)](_0x2431a0(0x19b)+_0x2d56b1[_0x2431a0(0x191)]),console[_0x2431a0(0x18d)](_0x2431a0(0x196)+_0x488b0b),console[_0x2431a0(0x18d)](_0x2431a0(0x1c2)+_0x30f4c5),_0x187f70&&console[_0x2431a0(0x18d)](_0x2431a0(0x199)+_0x4c5738));const _0x2f8b21=await withSpinner(_0x2431a0(0x194)+_0x488b0b+_0x2431a0(0x165),()=>_0x5226b0[_0x2431a0(0x1bc)][_0x2431a0(0x185)](_0x488b0b),{'verbose':_0x2d56b1[_0x2431a0(0x145)]}),_0x57d7d5=_0x2f8b21[_0x2431a0(0x140)],[_0x4fdbde,_0x9bb0ad,_0x1c435b,_0x434181,_0x3affb6]=await Promise[_0x2431a0(0x171)]([withSpinner(_0x2431a0(0x18a),()=>_0x5226b0[_0x2431a0(0x1bc)][_0x2431a0(0x158)](_0x57d7d5),{'verbose':_0x2d56b1[_0x2431a0(0x145)]}),withSpinner(_0x2431a0(0x1ac),()=>_0x5226b0[_0x2431a0(0x1bc)][_0x2431a0(0x1b3)](_0x57d7d5),{'verbose':_0x2d56b1['verbose']}),withSpinner(_0x2431a0(0x1b5),()=>_0x5226b0[_0x2431a0(0x1bc)][_0x2431a0(0x1d2)](_0x57d7d5),{'verbose':_0x2d56b1[_0x2431a0(0x145)]}),withSpinner('Fetching\x20existing\x20journeys...',()=>_0x5226b0['journey'][_0x2431a0(0x1a4)](_0x57d7d5,{'includeAllVersions':!![]}),{'verbose':_0x2d56b1[_0x2431a0(0x145)]}),withSpinner(_0x2431a0(0x18c),()=>_0x5226b0[_0x2431a0(0x178)][_0x2431a0(0x156)](),{'verbose':_0x2d56b1[_0x2431a0(0x145)]})[_0x2431a0(0x1bd)](_0x2ba455=>_0x2ba455[_0x2431a0(0x140)])]),_0x424f8b=_0x4fdbde['data'],_0x30a7bd=extractRootFolderId(_0x424f8b),_0x45ba4d=_0x9bb0ad['data'],_0x31e49e=_0x1c435b[_0x2431a0(0x140)],{journeys:_0x105bd7,activationStepsById:_0x2b0190}=_0x434181[_0x2431a0(0x140)],_0x572d69=new Map(_0x105bd7['map'](_0x48ad9a=>[_0x48ad9a['id'],_0x48ad9a])),_0x2e771b=_0x105bd7[_0x2431a0(0x1a9)](_0xf4fb82=>({'id':_0xf4fb82['id'],'name':_0xf4fb82[_0x2431a0(0x17b)][_0x2431a0(0x177)],'journeyBundleName':_0xf4fb82[_0x2431a0(0x17b)]['journeyBundleName']||'','journeyBundleId':_0xf4fb82['attributes'][_0x2431a0(0x16c)]||'','versionNumber':_0xf4fb82[_0x2431a0(0x17b)][_0x2431a0(0x13c)],'description':_0xf4fb82[_0x2431a0(0x17b)][_0x2431a0(0x149)],'state':_0xf4fb82['attributes']['state'],'paused':_0xf4fb82['attributes'][_0x2431a0(0x1d5)],'audienceId':_0xf4fb82['attributes'][_0x2431a0(0x1c7)],'folderId':_0xf4fb82['relationships']?.['parentFolder']?.[_0x2431a0(0x140)]?.['id'],'createdAt':_0xf4fb82['attributes']['createdAt'],'updatedAt':_0xf4fb82[_0x2431a0(0x17b)][_0x2431a0(0x141)]})),{emailToId:_0x2baff2,idToEmail:_0x4c2eac}=_0x3affb6,_0x3ac946=await withSpinner(_0x2431a0(0x167),async()=>{const _0x3716ed=await _0x5226b0['connection']['list']();return buildConnectionMaps(_0x3716ed);},{'verbose':_0x2d56b1[_0x2431a0(0x145)]})[_0x2431a0(0x1bd)](_0x58271b=>_0x58271b[_0x2431a0(0x140)]),_0xca8b80=_0x3ac946[_0x2431a0(0x18f)],_0x2f7d7f=_0x3ac946[_0x2431a0(0x1b9)],_0x21064e=_0x3ac946[_0x2431a0(0x13f)],_0x39cfab={'emailToIdMap':_0x2baff2,'connectionNameToIdMap':_0xca8b80,'connectionNameToTypeMap':_0x21064e,'getSchema':_0x441d84=>_0x5226b0[_0x2431a0(0x19a)]['getOutputSchemaWithCache'](_0x441d84)};let {pathToId:_0x390da4,idToPath:_0x215866}=buildFolderMaps(_0x31e49e);const _0x165f07=buildSegmentLookupMap(_0x45ba4d,_0x215866),_0x280715=buildSegmentNameToIdMap(_0x45ba4d),_0x32307d=buildJourneyBundleLookupMap(_0x2e771b,_0x215866);let _0x3d974f;if(_0x2394d0){if(!_0x2394d0[_0x2431a0(0x17e)](_0x2431a0(0x1bf))&&!_0x2394d0[_0x2431a0(0x17e)](_0x2431a0(0x1ae)))return console[_0x2431a0(0x18d)](a32_0x1f1e63['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x2394d0+'\x0a')),0x1;_0x3d974f=[_0x2394d0];}else _0x3d974f=findYamlFiles(_0x30f4c5);if(_0x3d974f[_0x2431a0(0x163)]===0x0)return console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x169)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x30f4c5+'\x0a')),console[_0x2431a0(0x18d)](a32_0x1f1e63['cyan'](_0x2431a0(0x13a))),0x1;let _0xea5038,_0x32e168;try{const _0x599729=parseAndClassifyYamlFiles(_0x3d974f,_0x30f4c5,{'skipSegments':_0x2d56b1[_0x2431a0(0x175)]});_0xea5038=_0x599729['segments'],_0x32e168=_0x599729['journeys'];const _0x392970=validateParsedFiles(_0x599729,_0x30f4c5);if(_0x392970[_0x2431a0(0x163)]>0x0)return console[_0x2431a0(0x18d)](a32_0x1f1e63['red'](_0x2431a0(0x19f))),console[_0x2431a0(0x18d)](formatValidationErrors(_0x392970)),console['error'](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x189))),0x1;}catch(_0x13a94f){return console['error'](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x173)+(_0x13a94f instanceof Error?_0x13a94f[_0x2431a0(0x17f)]:_0x13a94f))),0x1;}if(_0xea5038['length']===0x0&&_0x32e168[_0x2431a0(0x163)]===0x0){const _0xcc37e1=_0x2d56b1['journeysOnly']?'journey':_0x2431a0(0x164);return console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x188)+_0xcc37e1+_0x2431a0(0x154))),0x0;}const _0x497159=new Map();_0x45ba4d[_0x2431a0(0x163)]>0x0&&!_0x2d56b1[_0x2431a0(0x175)]&&await withSpinner(_0x2431a0(0x1c4),async()=>{await batchAsync(_0x45ba4d,async _0x5bd06b=>{const _0x2c2572=a32_0x1c5a,_0x58b941=await _0x5226b0[_0x2c2572(0x1bc)][_0x2c2572(0x1c8)](_0x57d7d5,_0x5bd06b['id']);_0x497159[_0x2c2572(0x1d4)](_0x5bd06b['id'],_0x58b941);});},{'verbose':_0x2d56b1['verbose']});const {segmentFiles:_0x46de2d,foldersToCreate:_0x2327c1}=await prepareSegmentFiles(_0xea5038,{'segmentByFolderAndName':_0x165f07,'activationsBySegmentId':_0x497159,'folderPathToId':_0x390da4,'idToEmailMap':_0x4c2eac,'connectionIdToNameMap':_0x2f7d7f},_0x39cfab,_0x187f70,_0x4c5738),_0x3eb1bb=_0x2394d0?[]:findSegmentsToDelete(_0x45ba4d,_0xea5038[_0x2431a0(0x1a9)](({yamlConfig:_0x242441,folderPath:_0x4ada5b})=>({'yamlConfig':_0x242441,'folderPath':resolveTDFolderPath(_0x4ada5b,_0x187f70,_0x4c5738)})),_0x215866,_0x4c5738,_0x187f70),{journeyFiles:_0x226d76,foldersToCreate:_0x3644e3}=await withProgressSpinner(_0x2431a0(0x1b7),async _0x503831=>prepareJourneyFiles(_0x32e168,{'fetchJourney':async _0xc2ba15=>_0x5226b0['journey'][_0x2431a0(0x15b)](_0xc2ba15[_0x2431a0(0x16a)]),'journeyBundlesByFolderAndName':_0x32307d,'folderPathToId':_0x390da4,'idToEmailMap':_0x4c2eac,'connectionIdToNameMap':_0x2f7d7f,'existingSegments':_0x45ba4d,'parentId':_0x57d7d5,'deps':_0x5226b0,'progress':{'update':_0x4b8fb7=>{const _0x4f2ae1=_0x2431a0;_0x503831[_0x4f2ae1(0x1a5)](_0x4b8fb7),_0x2d56b1['verbose']&&console[_0x4f2ae1(0x18d)]('\x20\x20'+_0x4b8fb7);}},'journeyById':_0x572d69,'activationStepsById':_0x2b0190},_0x187f70,_0x4c5738),{'verbose':_0x2d56b1[_0x2431a0(0x145)]})[_0x2431a0(0x1bd)](_0x49b418=>_0x49b418[_0x2431a0(0x140)]);for(const _0x56a85c of _0x3644e3){_0x2327c1['add'](_0x56a85c);}const _0x1f7771=_0x2394d0?[]:findJourneysToDelete(_0x2e771b,_0x32e168[_0x2431a0(0x1a9)](({yamlConfig:_0x312273,folderPath:_0x417754})=>({'yamlConfig':_0x312273,'folderPath':resolveTDFolderPath(_0x417754,_0x187f70,_0x4c5738)})),_0x215866,_0x4c5738,_0x187f70),_0x789f31=calculatePushStats(_0x46de2d,_0x226d76,_0x2327c1,_0x3eb1bb,_0x1f7771,!!_0x2d56b1[_0x2431a0(0x19e)],!!_0x2d56b1[_0x2431a0(0x175)]),_0x500edd=_0x789f31[_0x2431a0(0x143)][_0x2431a0(0x15a)],_0x6c2958=_0x789f31['segments'][_0x2431a0(0x184)],_0x402d70=_0x789f31[_0x2431a0(0x143)][_0x2431a0(0x1c0)],_0x349895=_0x789f31[_0x2431a0(0x143)]['toDelete'],_0x52d432=_0x789f31[_0x2431a0(0x15f)][_0x2431a0(0x148)],_0x4445cc=_0x789f31[_0x2431a0(0x180)][_0x2431a0(0x15a)],_0x3d5f09=_0x789f31[_0x2431a0(0x180)][_0x2431a0(0x184)],_0xda4efe=_0x789f31[_0x2431a0(0x180)][_0x2431a0(0x1c0)],_0x51fc0f=_0x789f31['journeys'][_0x2431a0(0x1a2)],_0x28923b=_0x789f31[_0x2431a0(0x14f)][_0x2431a0(0x171)],_0xa55d7a=_0x789f31['activations'][_0x2431a0(0x148)],_0x207819=_0x789f31[_0x2431a0(0x14f)][_0x2431a0(0x1b4)],_0x4e7e7e=_0x789f31[_0x2431a0(0x14f)][_0x2431a0(0x1a2)];console[_0x2431a0(0x18d)](_0x2431a0(0x15c)+_0x488b0b+'\x27:');_0x52d432[_0x2431a0(0x163)]>0x0&&console[_0x2431a0(0x18d)]('\x20\x20'+a32_0x1f1e63[_0x2431a0(0x1d6)](_0x2431a0(0x146)+_0x52d432['length']+_0x2431a0(0x190)));if(!_0x2d56b1[_0x2431a0(0x175)]){console[_0x2431a0(0x18d)]('\x20\x20πŸ“Š\x20Segments:'),console[_0x2431a0(0x18d)]('\x20\x20\x20\x20'+a32_0x1f1e63[_0x2431a0(0x1a8)]('+\x20'+_0x500edd[_0x2431a0(0x163)]+_0x2431a0(0x14b))),console[_0x2431a0(0x18d)]('\x20\x20\x20\x20'+a32_0x1f1e63[_0x2431a0(0x181)]('~\x20'+_0x6c2958['length']+_0x2431a0(0x142)));if(_0x349895[_0x2431a0(0x163)]>0x0)console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x169)]('-\x20'+_0x349895[_0x2431a0(0x163)]+_0x2431a0(0x14e)));else _0x3eb1bb[_0x2431a0(0x163)]>0x0&&!_0x2d56b1[_0x2431a0(0x19e)]&&console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x1d3)](_0x3eb1bb[_0x2431a0(0x163)]+_0x2431a0(0x1a1)));console[_0x2431a0(0x18d)]('\x20\x20\x20\x20'+a32_0x1f1e63[_0x2431a0(0x1d3)]('=\x20'+_0x402d70[_0x2431a0(0x163)]+_0x2431a0(0x1cd)));}if(_0x226d76[_0x2431a0(0x163)]>0x0||_0x1f7771[_0x2431a0(0x163)]>0x0){console[_0x2431a0(0x18d)](_0x2431a0(0x1ca)),console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63['green']('+\x20'+_0x4445cc[_0x2431a0(0x163)]+'\x20new')),console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x181)]('~\x20'+_0x3d5f09[_0x2431a0(0x163)]+_0x2431a0(0x142)));if(_0x51fc0f[_0x2431a0(0x163)]>0x0)console['error'](_0x2431a0(0x179)+a32_0x1f1e63['red']('-\x20'+_0x51fc0f[_0x2431a0(0x163)]+_0x2431a0(0x14e)));else _0x1f7771[_0x2431a0(0x163)]>0x0&&!_0x2d56b1[_0x2431a0(0x19e)]&&console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x1d3)](_0x1f7771[_0x2431a0(0x163)]+_0x2431a0(0x1a1)));console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x1d3)]('=\x20'+_0xda4efe[_0x2431a0(0x163)]+_0x2431a0(0x1cd)));}_0x28923b[_0x2431a0(0x163)]>0x0&&!_0x2d56b1['journeysOnly']&&(console[_0x2431a0(0x18d)](''),console['error'](_0x2431a0(0x1a7)),_0xa55d7a['length']>0x0&&console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x1a8)]('+\x20'+_0xa55d7a[_0x2431a0(0x163)]+_0x2431a0(0x1ad))),_0x207819[_0x2431a0(0x163)]>0x0&&console['error'](_0x2431a0(0x179)+a32_0x1f1e63[_0x2431a0(0x181)]('~\x20'+_0x207819[_0x2431a0(0x163)]+_0x2431a0(0x1af))),_0x4e7e7e[_0x2431a0(0x163)]>0x0&&console[_0x2431a0(0x18d)](_0x2431a0(0x179)+a32_0x1f1e63['red']('-\x20'+_0x4e7e7e[_0x2431a0(0x163)]+_0x2431a0(0x14e))));console[_0x2431a0(0x18d)](_0x2431a0(0x187)+a32_0x1f1e63[_0x2431a0(0x160)](_0x30f4c5)+'\x0a');if(_0x52d432['length']>0x0){console['error'](_0x2431a0(0x13d));for(const _0xc4e272 of _0x52d432){console['error']('\x20\x20'+a32_0x1f1e63[_0x2431a0(0x1d6)]('+')+'\x20'+_0xc4e272);}console[_0x2431a0(0x18d)]('');}if(_0x500edd['length']>0x0&&!_0x2d56b1[_0x2431a0(0x175)])for(const _0x3b8540 of _0x500edd){const _0x2b6af8=_0x3b8540[_0x2431a0(0x150)]?_0x3b8540[_0x2431a0(0x150)]+'/'+_0x3b8540[_0x2431a0(0x13e)][_0x2431a0(0x177)]:_0x3b8540[_0x2431a0(0x13e)]['name'],_0x3ff111=_0x3b8540['yamlConfig'][_0x2431a0(0x14f)]?.[_0x2431a0(0x163)]||0x0,_0x503258=_0x3ff111>0x0?a32_0x1f1e63[_0x2431a0(0x1d3)]('\x20['+_0x3ff111+'\x20activations]'):'';console['error']('\x0a'+a32_0x1f1e63[_0x2431a0(0x1a8)]('New\x20segment:')+'\x20'+_0x2b6af8+_0x503258),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c)),_0x3b8540[_0x2431a0(0x195)]&&console[_0x2431a0(0x18d)](_0x3b8540[_0x2431a0(0x195)]),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));}if(_0x349895['length']>0x0&&!_0x2d56b1[_0x2431a0(0x175)])for(const _0x1ff9d2 of _0x349895){const _0x152ed2=_0x1ff9d2['segmentFolderId']?_0x215866[_0x2431a0(0x15d)](_0x1ff9d2[_0x2431a0(0x19d)][_0x2431a0(0x17a)]())||'':'',_0x454f11=_0x152ed2?_0x152ed2+'/'+_0x1ff9d2[_0x2431a0(0x177)]:_0x1ff9d2[_0x2431a0(0x177)],_0x5ad8c8=_0x497159[_0x2431a0(0x15d)](_0x1ff9d2['id'])||[],_0x51fdb7=_0x5ad8c8[_0x2431a0(0x163)]>0x0?a32_0x1f1e63[_0x2431a0(0x1d3)]('\x20['+_0x5ad8c8[_0x2431a0(0x163)]+_0x2431a0(0x1b8)):'';console[_0x2431a0(0x18d)]('\x0a'+a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x1c5))+'\x20'+_0x454f11+_0x51fdb7),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));const _0x34be3c=segmentWithActivationsToYaml(_0x1ff9d2,_0x5ad8c8,undefined,_0x4c2eac,_0x2f7d7f),_0x284470=segmentToYamlString(_0x34be3c),_0x1a75a7=generateDiff(_0x284470,'');console[_0x2431a0(0x18d)](formatDiffWithColors(_0x1a75a7)),console['error']('─'[_0x2431a0(0x1bb)](0x3c));}const _0x379e88=_0x46de2d['filter'](_0x3643c6=>!_0x3643c6['isNew']&&_0x3643c6[_0x2431a0(0x195)]);if(_0x379e88[_0x2431a0(0x163)]>0x0&&!_0x2d56b1['journeysOnly'])for(const _0x51ff45 of _0x379e88){const _0xf6fe62=_0x51ff45[_0x2431a0(0x150)]?_0x51ff45[_0x2431a0(0x150)]+'/'+_0x51ff45[_0x2431a0(0x13e)][_0x2431a0(0x177)]:_0x51ff45['yamlConfig'][_0x2431a0(0x177)];console[_0x2431a0(0x18d)]('\x0a'+a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x1a3))+'\x20'+_0xf6fe62),console['error']('─'[_0x2431a0(0x1bb)](0x3c)),console[_0x2431a0(0x18d)](_0x51ff45[_0x2431a0(0x195)]),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));}if(_0x4445cc['length']>0x0)for(const _0x4e2ed1 of _0x4445cc){const _0x5a5268=_0x4e2ed1[_0x2431a0(0x150)]?_0x4e2ed1[_0x2431a0(0x150)]+'/'+_0x4e2ed1['yamlConfig'][_0x2431a0(0x177)]:_0x4e2ed1['yamlConfig'][_0x2431a0(0x177)];console[_0x2431a0(0x18d)]('\x0a'+a32_0x1f1e63[_0x2431a0(0x1a8)]('New\x20journey:')+'\x20'+_0x5a5268),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c)),_0x4e2ed1[_0x2431a0(0x195)]&&console[_0x2431a0(0x18d)](_0x4e2ed1[_0x2431a0(0x195)]),console['error']('─'[_0x2431a0(0x1bb)](0x3c));}const _0x2084e7=_0x226d76[_0x2431a0(0x1cb)](_0x447348=>!_0x447348[_0x2431a0(0x153)]&&_0x447348['diff']);if(_0x2084e7[_0x2431a0(0x163)]>0x0)for(const _0x5a8359 of _0x2084e7){const _0x26b96e=_0x5a8359[_0x2431a0(0x150)]?_0x5a8359[_0x2431a0(0x150)]+'/'+_0x5a8359['yamlConfig'][_0x2431a0(0x177)]:_0x5a8359[_0x2431a0(0x13e)][_0x2431a0(0x177)];console['error']('\x0a'+a32_0x1f1e63[_0x2431a0(0x181)]('Changes\x20to\x20journey:')+'\x20'+_0x26b96e),console['error']('─'['repeat'](0x3c)),console[_0x2431a0(0x18d)](_0x5a8359['diff']),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));}if(_0x51fc0f[_0x2431a0(0x163)]>0x0)for(const _0x1c8351 of _0x51fc0f){const _0x4cb34f=_0x1c8351[_0x2431a0(0x1c6)]?_0x215866[_0x2431a0(0x15d)](_0x1c8351['folderId'])||'':'',_0x383d6b=_0x4cb34f?_0x4cb34f+'/'+_0x1c8351['journeyBundleName']:_0x1c8351[_0x2431a0(0x1c3)];console[_0x2431a0(0x18d)]('\x0a'+a32_0x1f1e63[_0x2431a0(0x169)]('Delete\x20journey:')+'\x20'+_0x383d6b),console['error']('─'[_0x2431a0(0x1bb)](0x3c)),console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x193))),console[_0x2431a0(0x18d)]('─'[_0x2431a0(0x1bb)](0x3c));}if(_0x2d56b1[_0x2431a0(0x1ba)])return console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x166))),0x0;const _0x1ddd03=_0x2d56b1['journeysOnly']?![]:_0x500edd['length']>0x0||_0x6c2958[_0x2431a0(0x163)]>0x0||_0x349895[_0x2431a0(0x163)]>0x0,_0x3afb93=_0x4445cc[_0x2431a0(0x163)]>0x0||_0x3d5f09[_0x2431a0(0x163)]>0x0||_0x51fc0f[_0x2431a0(0x163)]>0x0,_0xa29fc1=_0x2d56b1['journeysOnly']?![]:_0x28923b[_0x2431a0(0x163)]>0x0,_0x4ec98d=_0x52d432['length']>0x0;if(!_0x1ddd03&&!_0x3afb93&&!_0xa29fc1&&!_0x4ec98d){const _0x49c18a=_0x2d56b1[_0x2431a0(0x175)]?_0x2431a0(0x1a6):_0x2431a0(0x14d);console['error'](a32_0x1f1e63[_0x2431a0(0x1a8)](_0x49c18a));if(_0x2394d0&&_0xda4efe[_0x2431a0(0x163)]===0x1){const _0x570397=_0xda4efe[0x0];if(_0x570397['existingJourney']?.['id']){const _0x2c46ef=getConsoleNextUrl(_0x2d56b1[_0x2431a0(0x191)],_0x2431a0(0x1be)+_0x57d7d5+_0x2431a0(0x14a)+_0x570397[_0x2431a0(0x1d0)]['id']+'/j/da/je');console['error']('\x20\x20'+a32_0x1f1e63['cyan'](_0x2c46ef));}}return 0x0;}const _0x48972d=_0x2d56b1[_0x2431a0(0x175)]?_0x4445cc[_0x2431a0(0x163)]+_0x3d5f09[_0x2431a0(0x163)]+_0x51fc0f['length']+_0x52d432['length']:_0x500edd[_0x2431a0(0x163)]+_0x6c2958['length']+_0x349895[_0x2431a0(0x163)]+_0x4445cc['length']+_0x3d5f09[_0x2431a0(0x163)]+_0x51fc0f[_0x2431a0(0x163)]+_0x52d432['length']+_0x28923b['length'];if(!_0x2d56b1['yes']&&_0x48972d>0x0){if(!isInteractive())return console['error'](a32_0x1f1e63[_0x2431a0(0x169)](_0x2431a0(0x18b)),_0x2431a0(0x151)),console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x1d3)](_0x2431a0(0x170))),0x1;const _0x5d2050=await confirmKey('Push\x20'+_0x48972d+_0x2431a0(0x176));if(!_0x5d2050)return console['error'](a32_0x1f1e63[_0x2431a0(0x181)](_0x2431a0(0x1c1))),0x1;}const _0x4025d0={'withProgress':async(_0x45fd73,_0x16e4f4)=>{const _0x451d6d=_0x2431a0,_0xab075d=await withSpinner(_0x45fd73,_0x16e4f4,{'verbose':_0x2d56b1[_0x451d6d(0x145)]});return{'data':_0xab075d[_0x451d6d(0x140)]};},'logInfo':_0xedac3d=>console['error'](a32_0x1f1e63[_0x2431a0(0x1d6)]('βœ”\x20'+_0xedac3d)),'logSuccess':_0x494b4d=>console[_0x2431a0(0x18d)](a32_0x1f1e63['green']('βœ”\x20'+_0x494b4d)),'logWarning':_0x21b2f1=>console['error'](a32_0x1f1e63[_0x2431a0(0x181)]('⚠\x20'+_0x21b2f1)),'logDeleted':_0x2f9f79=>console['error'](a32_0x1f1e63[_0x2431a0(0x169)]('βœ”\x20'+_0x2f9f79))},_0x3f8739={'segment':_0x5226b0[_0x2431a0(0x1bc)],'journey':_0x5226b0[_0x2431a0(0x144)],'user':_0x5226b0[_0x2431a0(0x178)],'connection':_0x5226b0[_0x2431a0(0x19a)]};_0x52d432[_0x2431a0(0x163)]>0x0&&(_0x390da4=await executePushFolders(_0x3f8739,_0x52d432,_0x390da4,{'parentId':_0x57d7d5},_0x4025d0));const _0x473a03={'rootFolderId':_0x30a7bd,'folderPathToId':_0x390da4,'folderIdToPath':_0x215866,'segmentNameToId':_0x280715,'activationsBySegmentId':_0x497159,'emailToIdMap':_0x2baff2,'idToEmailMap':_0x4c2eac,'connectionNameToIdMap':_0x3ac946['nameToId'],'connectionIdToNameMap':_0x3ac946[_0x2431a0(0x1b9)],'connectionNameToTypeMap':_0x21064e},_0x3ccf22=await executePushSegments(_0x3f8739,_0x2d56b1[_0x2431a0(0x175)]?[]:_0x46de2d,_0x473a03,{'parentId':_0x57d7d5},_0x4025d0),_0x21cf15=_0x3ccf22['created'],_0x35b7f5=_0x3ccf22['updated'],_0x2d6124=_0x3ccf22[_0x2431a0(0x14f)][_0x2431a0(0x155)],_0x4c89e7=_0x3ccf22['activations'][_0x2431a0(0x157)],_0x282091=_0x3ccf22['activations'][_0x2431a0(0x192)],_0x54cbdb=await executePushSegmentDeletions(_0x3f8739,_0x2d56b1['journeysOnly']?[]:_0x349895,_0x4025d0);let _0x5cf457=0x0,_0x68eb54=0x0,_0x24868e=0x0;const _0x55b973=new Map(_0x280715);for(const [_0x7f0790,_0x283539]of _0x3ccf22[_0x2431a0(0x1ab)]){_0x55b973[_0x2431a0(0x1d4)](_0x7f0790,_0x283539);}if(_0x226d76[_0x2431a0(0x163)]>0x0){const _0x183153={..._0x473a03,'segmentNameToId':_0x55b973,'existingSegments':_0x45ba4d,'activationContext':_0x39cfab},_0x5ccdda=await executePushJourneys(_0x3f8739,_0x226d76,_0x183153,{'parentId':_0x57d7d5,'rootFolderId':_0x30a7bd,'verbose':_0x2d56b1[_0x2431a0(0x145)]},_0x4025d0);_0x5cf457=_0x5ccdda[_0x2431a0(0x155)],_0x68eb54=_0x5ccdda[_0x2431a0(0x157)];if(_0x2394d0&&_0x5ccdda[_0x2431a0(0x162)][_0x2431a0(0x163)]===0x1){const _0x224d4f=_0x5ccdda[_0x2431a0(0x162)][0x0];if(_0x224d4f['journeyId']){const _0x1effc6=getConsoleNextUrl(_0x2d56b1[_0x2431a0(0x191)],_0x2431a0(0x1be)+_0x57d7d5+_0x2431a0(0x14a)+_0x224d4f['journeyId']+'/j/da/je');console[_0x2431a0(0x18d)]('\x20\x20'+a32_0x1f1e63['cyan'](_0x1effc6));}}}for(const _0x466a4c of _0x51fc0f){console[_0x2431a0(0x18d)](a32_0x1f1e63[_0x2431a0(0x181)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x466a4c['journeyBundleName'])),_0x24868e++;}const _0x142277=[];if(_0x21cf15>0x0)_0x142277[_0x2431a0(0x1ce)](_0x21cf15+_0x2431a0(0x13b));if(_0x35b7f5>0x0)_0x142277[_0x2431a0(0x1ce)](_0x35b7f5+_0x2431a0(0x1b2));if(_0x54cbdb>0x0)_0x142277['push'](_0x54cbdb+_0x2431a0(0x1d1));const _0x3d6ecd=[];if(_0x5cf457>0x0)_0x3d6ecd['push'](_0x5cf457+_0x2431a0(0x13b));if(_0x68eb54>0x0)_0x3d6ecd[_0x2431a0(0x1ce)](_0x68eb54+_0x2431a0(0x1b2));if(_0x24868e>0x0)_0x3d6ecd[_0x2431a0(0x1ce)](_0x24868e+_0x2431a0(0x1d1));const _0x5e8fe0=[];if(_0x2d6124>0x0)_0x5e8fe0[_0x2431a0(0x1ce)](_0x2d6124+'\x20created');if(_0x4c89e7>0x0)_0x5e8fe0[_0x2431a0(0x1ce)](_0x4c89e7+_0x2431a0(0x1b2));if(_0x282091>0x0)_0x5e8fe0[_0x2431a0(0x1ce)](_0x282091+_0x2431a0(0x1d1));return console[_0x2431a0(0x18d)](a32_0x1f1e63['green'](_0x2431a0(0x16d))),_0x142277[_0x2431a0(0x163)]>0x0&&!_0x2d56b1[_0x2431a0(0x175)]&&console[_0x2431a0(0x18d)](_0x2431a0(0x159)+_0x142277[_0x2431a0(0x17c)](',\x20')),_0x3d6ecd[_0x2431a0(0x163)]>0x0&&console['error'](_0x2431a0(0x16e)+_0x3d6ecd[_0x2431a0(0x17c)](',\x20')),_0x5e8fe0['length']>0x0&&!_0x2d56b1[_0x2431a0(0x175)]&&console[_0x2431a0(0x18d)](_0x2431a0(0x172)+_0x5e8fe0[_0x2431a0(0x17c)](',\x20')),0x0;}}