@treasuredata/tdx 0.23.0 β†’ 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/schedule.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/archive-validation.js +1 -1
  126. package/dist/sdk/workflow/clone-workflow.js +1 -1
  127. package/dist/sdk/workflow/index.js +1 -1
  128. package/dist/sdk/workflow/pull-workflow.js +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/tdx-config.js +1 -1
  131. package/dist/sdk/workflow/workflow-utils.js +1 -1
  132. package/dist/test-utils/command-runner.js +1 -1
  133. package/dist/test-utils/factories.js +1 -1
  134. package/dist/test-utils/fixtures.js +1 -1
  135. package/dist/test-utils/http-mock.js +1 -1
  136. package/dist/test-utils/index.js +1 -1
  137. package/dist/utils/async.js +1 -1
  138. package/dist/utils/colors.js +1 -1
  139. package/dist/utils/diff.js +1 -1
  140. package/dist/utils/file-permissions.js +1 -1
  141. package/dist/utils/global-cache.js +1 -1
  142. package/dist/utils/json-loader.js +1 -1
  143. package/dist/utils/local-cache.js +1 -1
  144. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  145. package/dist/utils/logger/formatters/index.js +1 -1
  146. package/dist/utils/logger/handlers/console-handler.js +1 -1
  147. package/dist/utils/logger/handlers/file-handler.js +1 -1
  148. package/dist/utils/logger/handlers/index.js +1 -1
  149. package/dist/utils/logger/handlers/null-handler.js +1 -1
  150. package/dist/utils/logger/index.js +1 -1
  151. package/dist/utils/logger/logger.js +1 -1
  152. package/dist/utils/logger/types.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x4c9a44=a26_0x40d8;(function(_0x1574fe,_0x3911b2){const _0x19a75b=a26_0x40d8,_0x41d55a=_0x1574fe();while(!![]){try{const _0x521b34=-parseInt(_0x19a75b(0x20f))/0x1*(parseInt(_0x19a75b(0x1d8))/0x2)+-parseInt(_0x19a75b(0x1c8))/0x3*(-parseInt(_0x19a75b(0x1e9))/0x4)+parseInt(_0x19a75b(0x1ee))/0x5*(parseInt(_0x19a75b(0x1de))/0x6)+-parseInt(_0x19a75b(0x1b1))/0x7+parseInt(_0x19a75b(0x1b6))/0x8*(parseInt(_0x19a75b(0x1c4))/0x9)+-parseInt(_0x19a75b(0x1ca))/0xa*(-parseInt(_0x19a75b(0x18f))/0xb)+parseInt(_0x19a75b(0x1bb))/0xc*(parseInt(_0x19a75b(0x1cf))/0xd);if(_0x521b34===_0x3911b2)break;else _0x41d55a['push'](_0x41d55a['shift']());}catch(_0x4acec2){_0x41d55a['push'](_0x41d55a['shift']());}}}(a26_0x2229,0x2a4e4));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';function a26_0x2229(){const _0x4d2ccc=['padEnd','created_at','Schedule\x20created:\x20','Updating\x20schedule:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','queryUrl','Delete\x20a\x20scheduled\x20query','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','status','run','name','has_next_page','\x20\x20Timezone:\x20','schedule:delete','\x20\x20Job\x20ID:\x20','ended_at','utf-8','Update\x20a\x20scheduled\x20query','\x20\x20β†’\x20','\x20created','Schedule\x20deleted:\x20','3iUCGYq','json','updated_at','delete','scheduled_at','last_job','schedule:update','toLocaleDateString','time_zone','135201vIyIHr','history','timezone','schedule:run','next_run_at','limit','statusIcon','Running\x20schedule...','getTime','round','delay','schedule:create','\x20(use\x20--limit\x20to\x20see\x20more)','Updating\x20schedule...','time','Running\x20schedule:\x20','max','priority','Getting\x20schedule\x20history...','type','output','Failed\x20to\x20read\x20file:\x20','(unnamed)','database','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','πŸ“…\x20','List\x20scheduled\x20queries','count','Run\x20a\x20scheduled\x20query\x20immediately','retryLimit','success','dim','Listing\x20scheduled\x20queries...','1478351QqqDFx','length','show','Schedule\x20updated:\x20','trim','8qWlyov','nextRun','map','query','result','348woDYIB','description','Searching\x20scheduled\x20queries\x20matching\x20\x22','\x20\x20Num:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','execute','site','executing_user_id','in\x20','978075iHYZkl','\x20(showing\x20','\x20scheduled\x20quer','\x20matching\x20\x22','554847jpHYDD','\x20\x20Type:\x20','190rbAGOT','jobs','create','cron','keys','26533MyRgPA','end_at','Query\x20file\x20is\x20empty','No\x20scheduled\x20queries\x20found','Schedule\x20run\x20submitted:\x20','Showing\x20first\x20','pagination','engine_version','schedule:show','154144ySkkFs','file','substring','soon','from','schedules','25158eHUpfV','repeat','table','list','green','\x20execution','validate','args','lastRun','Create\x20a\x20scheduled\x20query','engineVersion','4lsuLwt','retry_limit','verbose','error','entries','35yhaDxd','INVALID_ARGUMENT','Getting\x20schedule\x20details...','data','d\x20ago','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','format','queries','red','user_name','listQueries','Show\x20schedule\x20execution\x20history'];a26_0x2229=function(){return _0x4d2ccc;};return a26_0x2229();}import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x32e6d2 from'chalk';function formatRelativeTime(_0x5fa76e){const _0x4f08cb=a26_0x40d8,_0x5b54e2=new Date(_0x5fa76e),_0x1630fe=new Date(),_0x179ced=_0x5b54e2[_0x4f08cb(0x197)]()-_0x1630fe[_0x4f08cb(0x197)](),_0x3abf1f=Math['abs'](_0x179ced)/0x3e8,_0x181dda=_0x179ced<0x0;if(_0x3abf1f<0x3c)return _0x181dda?'just\x20now':_0x4f08cb(0x1db);else{if(_0x3abf1f<0xe10){const _0x15632e=Math[_0x4f08cb(0x198)](_0x3abf1f/0x3c);return _0x181dda?_0x15632e+'m\x20ago':_0x4f08cb(0x1c3)+_0x15632e+'m';}else{if(_0x3abf1f<0x15180){const _0x26f0f8=Math[_0x4f08cb(0x198)](_0x3abf1f/0xe10);return _0x181dda?_0x26f0f8+'h\x20ago':_0x4f08cb(0x1c3)+_0x26f0f8+'h';}else{if(_0x3abf1f<0x93a80){const _0x304cf7=Math[_0x4f08cb(0x198)](_0x3abf1f/0x15180);return _0x181dda?_0x304cf7+_0x4f08cb(0x1f2):_0x4f08cb(0x1c3)+_0x304cf7+'d';}else return _0x5b54e2[_0x4f08cb(0x18d)]();}}}}export class ScheduleListCommand extends BaseCommand{[a26_0x4c9a44(0x204)]='schedule:list';['description']=a26_0x4c9a44(0x1aa);async[a26_0x4c9a44(0x1c0)](_0x426829){const _0x3fddc6=a26_0x4c9a44,{options:_0x33ef70,args:_0x2b4eb5,tdx:_0x512d2f}=_0x426829,_0x264f0f=resolveLimit(_0x33ef70[_0x3fddc6(0x194)],DEFAULT_DISPLAY_LIMIT),_0x49a2f9=_0x2b4eb5[0x0],_0x54cb5a=_0x49a2f9?_0x3fddc6(0x1bd)+_0x49a2f9+'\x22...':_0x3fddc6(0x1b0),_0x478bf7=await withSpinner(_0x54cb5a,()=>_0x512d2f[_0x3fddc6(0x1dd)][_0x3fddc6(0x1f8)]({'limit':_0x264f0f,'scheduled':!![],'pattern':_0x49a2f9}),{'verbose':_0x33ef70[_0x3fddc6(0x1eb)]}),_0xd147e7=_0x478bf7[_0x3fddc6(0x1f1)][_0x3fddc6(0x1f5)],_0x4fc4fb=_0x478bf7[_0x3fddc6(0x1f1)][_0x3fddc6(0x1d5)][_0x3fddc6(0x205)],_0x1ba047=_0x49a2f9?_0x3fddc6(0x1c7)+_0x49a2f9+'\x22':'';_0x4fc4fb?console['error'](_0x3fddc6(0x1d4)+_0xd147e7[_0x3fddc6(0x1b2)]+'\x20schedules'+_0x1ba047+_0x3fddc6(0x19b)):console[_0x3fddc6(0x1ec)]('Found\x20'+_0xd147e7['length']+_0x3fddc6(0x1c6)+(_0xd147e7[_0x3fddc6(0x1b2)]!==0x1?'ies':'y')+_0x1ba047);if(_0x33ef70[_0x3fddc6(0x1f4)]===_0x3fddc6(0x210)||_0x33ef70['format']==='jsonl'||_0x33ef70[_0x3fddc6(0x1f4)]===_0x3fddc6(0x1e0)||_0x33ef70[_0x3fddc6(0x1f4)]==='tsv'){const _0x5dd8c5=_0xd147e7[_0x3fddc6(0x1b8)](_0x18f411=>({'id':_0x18f411['id'],'name':_0x18f411[_0x3fddc6(0x204)],'cron':_0x18f411[_0x3fddc6(0x1cd)],'database':_0x18f411['database']?.[_0x3fddc6(0x204)],'type':_0x18f411['type'],'timezone':_0x18f411[_0x3fddc6(0x18e)],'user_name':_0x18f411['user']?.['name'],'updated_at':_0x18f411[_0x3fddc6(0x211)],'next_run_at':_0x18f411['next_run_at'],'last_job_status':_0x18f411['last_job']?.['status']}));await handleSDKOutput(_0x5dd8c5,_0x33ef70);}else{if(_0xd147e7['length']===0x0)console['log'](_0x3fddc6(0x1d2));else{const _0x44e5b0=_0x33ef70[_0x3fddc6(0x1c1)],_0x1d5c8c=_0xd147e7[_0x3fddc6(0x1b8)](_0x2d78e1=>{const _0xe6994=_0x3fddc6,_0x3a2ee6=_0x2d78e1[_0xe6994(0x18b)]?.[_0xe6994(0x202)]?_0x2d78e1[_0xe6994(0x18b)][_0xe6994(0x202)]===_0xe6994(0x1ae)?'βœ“':'βœ—':'-',_0x286e1c=_0x2d78e1[_0xe6994(0x18b)]?.[_0xe6994(0x209)]?formatRelativeTime(_0x2d78e1[_0xe6994(0x18b)][_0xe6994(0x209)]):'never',_0x184771=_0x2d78e1[_0xe6994(0x193)]?formatRelativeTime(_0x2d78e1[_0xe6994(0x193)]):'-',_0x328fdb=_0x2d78e1[_0xe6994(0x1cd)]||'',_0x2ae63e=_0x2d78e1[_0xe6994(0x204)]||_0xe6994(0x1a5),_0xcbc4a0=getConsoleUrl(_0x44e5b0,'/app/queries/editor?queryId='+_0x2d78e1['id']);return{'statusIcon':_0x3a2ee6,'lastRun':_0x286e1c,'nextRun':_0x184771,'cron':_0x328fdb,'name':_0x2ae63e,'queryUrl':_0xcbc4a0,'status':_0x2d78e1[_0xe6994(0x18b)]?.[_0xe6994(0x202)]};}),_0x12bdec=Math[_0x3fddc6(0x19f)](..._0x1d5c8c[_0x3fddc6(0x1b8)](_0x5b9064=>_0x5b9064[_0x3fddc6(0x1e6)][_0x3fddc6(0x1b2)])),_0x5dab11=Math[_0x3fddc6(0x19f)](..._0x1d5c8c[_0x3fddc6(0x1b8)](_0x14a95c=>_0x14a95c['nextRun'][_0x3fddc6(0x1b2)])),_0x5b0d3a=Math[_0x3fddc6(0x19f)](..._0x1d5c8c['map'](_0x3ed358=>_0x3ed358[_0x3fddc6(0x1cd)]['length'])),_0x537f90=_0x1d5c8c[_0x3fddc6(0x1b8)](_0x34d67c=>{const _0x1d6e15=_0x3fddc6,_0x1e5a79=_0x34d67c['status']===_0x1d6e15(0x1ae)?a26_0x32e6d2[_0x1d6e15(0x1e2)](_0x34d67c[_0x1d6e15(0x195)]):_0x34d67c['status']===_0x1d6e15(0x1ec)?a26_0x32e6d2[_0x1d6e15(0x1f6)](_0x34d67c[_0x1d6e15(0x195)]):a26_0x32e6d2[_0x1d6e15(0x1af)](_0x34d67c['statusIcon']),_0x477d04=_0x34d67c[_0x1d6e15(0x1e6)][_0x1d6e15(0x1fa)](_0x12bdec),_0x53c58b=_0x34d67c[_0x1d6e15(0x1b7)][_0x1d6e15(0x1fa)](_0x5dab11),_0x5d9b2b=_0x34d67c[_0x1d6e15(0x1cd)]?a26_0x32e6d2['cyan'](_0x34d67c[_0x1d6e15(0x1cd)][_0x1d6e15(0x1fa)](_0x5b0d3a)):'\x20'[_0x1d6e15(0x1df)](_0x5b0d3a),_0x163abf=hyperlink(_0x34d67c[_0x1d6e15(0x204)],_0x34d67c[_0x1d6e15(0x1ff)]);return _0x1d6e15(0x1a9)+_0x1e5a79+'\x20'+_0x477d04+_0x1d6e15(0x20c)+_0x53c58b+'\x20\x20'+_0x5d9b2b+'\x20\x20'+_0x163abf;});await writeOutput(_0x537f90['join']('\x0a'),_0x33ef70[_0x3fddc6(0x1a3)],_0x3fddc6(0x1e1));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a26_0x4c9a44(0x1d7);[a26_0x4c9a44(0x1bc)]='Show\x20schedule\x20details';[a26_0x4c9a44(0x1e4)](_0x558966){const _0x306651=a26_0x4c9a44,_0xb44af2=_0x558966[_0x306651(0x1e5)][0x0];if(!_0xb44af2)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>';return undefined;}async['execute'](_0x53d249){const _0x472e6d=a26_0x4c9a44,{options:_0x15d5fd,args:_0x1b95ea,tdx:_0x16acd0}=_0x53d249,_0x15ce71=_0x1b95ea[0x0],_0x2e7e27=await withSpinner(_0x472e6d(0x1f0),()=>_0x16acd0['schedules'][_0x472e6d(0x1b3)](_0x15ce71),{'verbose':_0x15d5fd['verbose']}),_0x2cb67f=_0x2e7e27['data'],_0x1d7057={'name':_0x2cb67f[_0x472e6d(0x204)],'cron':_0x2cb67f[_0x472e6d(0x1cd)],'database':_0x2cb67f['database'],'type':_0x2cb67f[_0x472e6d(0x1a2)],'timezone':_0x2cb67f[_0x472e6d(0x191)],'user_name':_0x2cb67f[_0x472e6d(0x1f7)],'created_at':_0x2cb67f['created_at'],'engine_version':_0x2cb67f['engine_version'],'executing_user_id':_0x2cb67f[_0x472e6d(0x1c2)],'query':_0x2cb67f[_0x472e6d(0x1b9)],'delay':_0x2cb67f[_0x472e6d(0x199)],'priority':_0x2cb67f['priority'],'retry_limit':_0x2cb67f[_0x472e6d(0x1ea)],..._0x2cb67f[_0x472e6d(0x1ba)]&&{'result':_0x2cb67f[_0x472e6d(0x1ba)]}};return await handleSingleObjectOutput(_0x1d7057,_0x15d5fd),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x4c9a44(0x204)]=a26_0x4c9a44(0x19a);[a26_0x4c9a44(0x1bc)]=a26_0x4c9a44(0x1e7);[a26_0x4c9a44(0x1e4)](_0x225c81){const _0x317836=a26_0x4c9a44,_0x49ad32=_0x225c81['args'][0x0];if(!_0x49ad32)return _0x317836(0x201);return undefined;}async[a26_0x4c9a44(0x1c0)](_0x3f4d45){const _0x4352ec=a26_0x4c9a44,{options:_0x54cc72,args:_0x304e5d,tdx:_0x1c3991}=_0x3f4d45,_0x59a7b3=_0x304e5d[0x0],_0x386062=_0x54cc72,_0x248877=_0x386062['database'],_0xadf1a5=_0x386062[_0x4352ec(0x1d9)],_0xf4f893=_0x386062['type']||'trino';let _0x19419f;try{_0x19419f=readFileSync(_0xadf1a5,_0x4352ec(0x20a))[_0x4352ec(0x1b5)]();}catch(_0x160881){throw new SDKError(ErrorCode[_0x4352ec(0x1ef)],_0x4352ec(0x1a4)+_0xadf1a5,_0x160881 instanceof Error?_0x160881:undefined);}if(!_0x19419f)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4352ec(0x1d1));const _0x2e7cea={'database':_0x248877,'query':_0x19419f,'type':_0xf4f893};if(_0x386062[_0x4352ec(0x1cd)])_0x2e7cea[_0x4352ec(0x1cd)]=_0x386062[_0x4352ec(0x1cd)];if(_0x386062[_0x4352ec(0x191)])_0x2e7cea[_0x4352ec(0x191)]=_0x386062[_0x4352ec(0x191)];if(_0x386062[_0x4352ec(0x199)]!==undefined)_0x2e7cea[_0x4352ec(0x199)]=Number(_0x386062[_0x4352ec(0x199)]);if(_0x386062[_0x4352ec(0x1a0)]!==undefined)_0x2e7cea[_0x4352ec(0x1a0)]=Number(_0x386062[_0x4352ec(0x1a0)]);if(_0x386062['retryLimit']!==undefined)_0x2e7cea['retry_limit']=Number(_0x386062['retryLimit']);if(_0x386062[_0x4352ec(0x1e8)])_0x2e7cea['engine_version']=_0x386062[_0x4352ec(0x1e8)];if(_0x386062[_0x4352ec(0x1ba)])_0x2e7cea['result']=_0x386062[_0x4352ec(0x1ba)];if(_0x54cc72[_0x4352ec(0x1eb)]){console[_0x4352ec(0x1ec)]('Creating\x20schedule:\x20'+_0x59a7b3),console[_0x4352ec(0x1ec)]('\x20\x20Database:\x20'+_0x248877),console[_0x4352ec(0x1ec)](_0x4352ec(0x1c9)+_0xf4f893);if(_0x2e7cea[_0x4352ec(0x1cd)])console[_0x4352ec(0x1ec)]('\x20\x20Cron:\x20'+_0x2e7cea[_0x4352ec(0x1cd)]);if(_0x2e7cea[_0x4352ec(0x191)])console[_0x4352ec(0x1ec)](_0x4352ec(0x206)+_0x2e7cea[_0x4352ec(0x191)]);}const _0xaa8470=await withSpinner('Creating\x20schedule...',()=>_0x1c3991[_0x4352ec(0x1dd)][_0x4352ec(0x1cc)](_0x59a7b3,_0x2e7cea),{'verbose':_0x54cc72['verbose']});return console[_0x4352ec(0x1ec)](_0x4352ec(0x1fc)+_0xaa8470['data']['name']),await handleSingleObjectOutput(_0xaa8470[_0x4352ec(0x1f1)],_0x54cc72),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{['name']=a26_0x4c9a44(0x18c);[a26_0x4c9a44(0x1bc)]=a26_0x4c9a44(0x20b);[a26_0x4c9a44(0x1e4)](_0x168bef){const _0x2a1b83=a26_0x4c9a44,_0x15fa43=_0x168bef[_0x2a1b83(0x1e5)][0x0];if(!_0x15fa43)return _0x2a1b83(0x1fe);return undefined;}async[a26_0x4c9a44(0x1c0)](_0x2bd545){const _0x16da50=a26_0x4c9a44,{options:_0x4dcdb5,args:_0x85d069,tdx:_0x379c31}=_0x2bd545,_0x1b6e1c=_0x85d069[0x0],_0x690ca5=_0x4dcdb5,_0x3103de={};if(_0x690ca5[_0x16da50(0x1a6)])_0x3103de[_0x16da50(0x1a6)]=_0x690ca5[_0x16da50(0x1a6)];if(_0x690ca5[_0x16da50(0x1a2)])_0x3103de[_0x16da50(0x1a2)]=_0x690ca5[_0x16da50(0x1a2)];if(_0x690ca5[_0x16da50(0x1cd)])_0x3103de[_0x16da50(0x1cd)]=_0x690ca5[_0x16da50(0x1cd)];if(_0x690ca5[_0x16da50(0x191)])_0x3103de[_0x16da50(0x191)]=_0x690ca5[_0x16da50(0x191)];if(_0x690ca5[_0x16da50(0x199)]!==undefined)_0x3103de['delay']=Number(_0x690ca5['delay']);if(_0x690ca5[_0x16da50(0x1a0)]!==undefined)_0x3103de[_0x16da50(0x1a0)]=Number(_0x690ca5[_0x16da50(0x1a0)]);if(_0x690ca5[_0x16da50(0x1ad)]!==undefined)_0x3103de['retry_limit']=Number(_0x690ca5['retryLimit']);if(_0x690ca5['engineVersion'])_0x3103de[_0x16da50(0x1d6)]=_0x690ca5[_0x16da50(0x1e8)];if(_0x690ca5['result'])_0x3103de[_0x16da50(0x1ba)]=_0x690ca5[_0x16da50(0x1ba)];if(_0x690ca5[_0x16da50(0x1d9)])try{_0x3103de[_0x16da50(0x1b9)]=readFileSync(_0x690ca5[_0x16da50(0x1d9)],'utf-8')[_0x16da50(0x1b5)]();}catch(_0x171f9a){throw new SDKError(ErrorCode[_0x16da50(0x1ef)],_0x16da50(0x1a4)+_0x690ca5[_0x16da50(0x1d9)],_0x171f9a instanceof Error?_0x171f9a:undefined);}if(Object[_0x16da50(0x1ce)](_0x3103de)[_0x16da50(0x1b2)]===0x0)throw new SDKError(ErrorCode[_0x16da50(0x1ef)],_0x16da50(0x1a8));if(_0x4dcdb5['verbose']){console[_0x16da50(0x1ec)](_0x16da50(0x1fd)+_0x1b6e1c);for(const [_0x1af1c7,_0x1d9707]of Object[_0x16da50(0x1ed)](_0x3103de)){_0x1af1c7===_0x16da50(0x1b9)?console['error']('\x20\x20'+_0x1af1c7+':\x20'+_0x1d9707[_0x16da50(0x1da)](0x0,0x32)+'...'):console[_0x16da50(0x1ec)]('\x20\x20'+_0x1af1c7+':\x20'+_0x1d9707);}}const _0x1fcdaf=await withSpinner(_0x16da50(0x19c),()=>_0x379c31[_0x16da50(0x1dd)]['update'](_0x1b6e1c,_0x3103de),{'verbose':_0x4dcdb5[_0x16da50(0x1eb)]});return console[_0x16da50(0x1ec)](_0x16da50(0x1b4)+_0x1fcdaf[_0x16da50(0x1f1)][_0x16da50(0x204)]),await handleSingleObjectOutput(_0x1fcdaf[_0x16da50(0x1f1)],_0x4dcdb5),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a26_0x4c9a44(0x204)]=a26_0x4c9a44(0x207);[a26_0x4c9a44(0x1bc)]=a26_0x4c9a44(0x200);['validate'](_0x220a05){const _0x410cb2=a26_0x4c9a44,_0x2d41d0=_0x220a05[_0x410cb2(0x1e5)][0x0];if(!_0x2d41d0)return _0x410cb2(0x1f3);return undefined;}async[a26_0x4c9a44(0x1c0)](_0x1207f8){const _0x5d2b95=a26_0x4c9a44,{options:_0xa1009d,args:_0x277ca8,tdx:_0x51c590}=_0x1207f8,_0x2803dc=_0x277ca8[0x0];if(!_0xa1009d['yes']){const _0x2b03e9=await confirm(_0x5d2b95(0x1bf)+_0x2803dc+'\x22?');if(!_0x2b03e9)return console[_0x5d2b95(0x1ec)]('Cancelled'),0x0;}const _0x2544ba=await withSpinner('Deleting\x20schedule...',()=>_0x51c590[_0x5d2b95(0x1dd)][_0x5d2b95(0x212)](_0x2803dc),{'verbose':_0xa1009d[_0x5d2b95(0x1eb)]});return console[_0x5d2b95(0x1ec)](_0x5d2b95(0x20e)+_0x2544ba[_0x5d2b95(0x1f1)][_0x5d2b95(0x204)]),0x0;}}function a26_0x40d8(_0x58cfb5,_0x24b4d8){_0x58cfb5=_0x58cfb5-0x18b;const _0x2229eb=a26_0x2229();let _0x40d888=_0x2229eb[_0x58cfb5];return _0x40d888;}export class ScheduleRunCommand extends BaseCommand{['name']=a26_0x4c9a44(0x192);[a26_0x4c9a44(0x1bc)]=a26_0x4c9a44(0x1ac);['validate'](_0x38a9f9){const _0x20a051=a26_0x4c9a44,_0x2c4f3d=_0x38a9f9[_0x20a051(0x1e5)][0x0];if(!_0x2c4f3d)return _0x20a051(0x1a7);return undefined;}async['execute'](_0x29acfa){const _0x120657=a26_0x4c9a44,{options:_0x594318,args:_0x20989c,tdx:_0x422363}=_0x29acfa,_0x1a9663=_0x20989c[0x0],_0x5190c5=_0x594318,_0x5ea23d=_0x5190c5[_0x120657(0x19d)],_0x29ee01=_0x5190c5['num']!==undefined?Number(_0x5190c5['num']):undefined;if(_0x594318[_0x120657(0x1eb)]){console[_0x120657(0x1ec)](_0x120657(0x19e)+_0x1a9663);if(_0x5ea23d)console[_0x120657(0x1ec)]('\x20\x20Time:\x20'+_0x5ea23d);if(_0x29ee01)console[_0x120657(0x1ec)](_0x120657(0x1be)+_0x29ee01);}const _0x275aeb=await withSpinner(_0x120657(0x196),()=>_0x422363[_0x120657(0x1dd)][_0x120657(0x203)](_0x1a9663,{'time':_0x5ea23d,'num':_0x29ee01}),{'verbose':_0x594318[_0x120657(0x1eb)]}),_0x14c97e=_0x275aeb[_0x120657(0x1f1)][_0x120657(0x1cb)];console[_0x120657(0x1ec)](_0x120657(0x1d3)+_0x14c97e[_0x120657(0x1b2)]+'\x20job'+(_0x14c97e[_0x120657(0x1b2)]!==0x1?'s':'')+_0x120657(0x20d));for(const _0x5ce5c8 of _0x14c97e){console[_0x120657(0x1ec)](_0x120657(0x208)+_0x5ce5c8['job_id']);}return await handleSDKOutput(_0x14c97e,_0x594318),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{['name']='schedule:history';[a26_0x4c9a44(0x1bc)]=a26_0x4c9a44(0x1f9);['validate'](_0x5befd3){const _0x471eae=_0x5befd3['args'][0x0];if(!_0x471eae)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a26_0x4c9a44(0x1c0)](_0x483148){const _0x340d6d=a26_0x4c9a44,{options:_0x3998a7,args:_0x46c800,tdx:_0x2f1d91}=_0x483148,_0x231c94=_0x46c800[0x0],_0x2d7d81=_0x3998a7,_0x410090=_0x2d7d81[_0x340d6d(0x1dc)]!==undefined?Number(_0x2d7d81['from']):undefined,_0x26d27e=_0x2d7d81['to']!==undefined?Number(_0x2d7d81['to']):undefined,_0x12ba83=await withSpinner(_0x340d6d(0x1a1),()=>_0x2f1d91[_0x340d6d(0x1dd)][_0x340d6d(0x190)](_0x231c94,{'from':_0x410090,'to':_0x26d27e}),{'verbose':_0x3998a7['verbose']}),_0x1cf1bd=_0x12ba83[_0x340d6d(0x1f1)];console['error']('Found\x20'+_0x1cf1bd[_0x340d6d(0x1ab)]+_0x340d6d(0x1e3)+(_0x1cf1bd[_0x340d6d(0x1ab)]!==0x1?'s':'')+_0x340d6d(0x1c5)+_0x1cf1bd[_0x340d6d(0x1dc)]+'-'+_0x1cf1bd['to']+')');const _0x1ac792=_0x1cf1bd[_0x340d6d(0x190)]['map'](_0x1fea4a=>({'job_id':_0x1fea4a['job_id'],'type':_0x1fea4a[_0x340d6d(0x1a2)],'status':_0x1fea4a[_0x340d6d(0x202)],'scheduled_at':_0x1fea4a[_0x340d6d(0x213)],'created_at':_0x1fea4a[_0x340d6d(0x1fb)],'start_at':_0x1fea4a['start_at'],'end_at':_0x1fea4a[_0x340d6d(0x1d0)]}));return await handleSDKOutput(_0x1ac792,_0x3998a7),0x0;}}
1
+ const a26_0x506400=a26_0x4389;(function(_0x1582ab,_0x46ad70){const _0x4cf849=a26_0x4389,_0xb90c6f=_0x1582ab();while(!![]){try{const _0x1fb093=parseInt(_0x4cf849(0x103))/0x1*(parseInt(_0x4cf849(0x134))/0x2)+parseInt(_0x4cf849(0x108))/0x3*(parseInt(_0x4cf849(0xf9))/0x4)+parseInt(_0x4cf849(0x14a))/0x5*(parseInt(_0x4cf849(0x150))/0x6)+parseInt(_0x4cf849(0x141))/0x7*(-parseInt(_0x4cf849(0x128))/0x8)+parseInt(_0x4cf849(0x10c))/0x9*(parseInt(_0x4cf849(0x11e))/0xa)+-parseInt(_0x4cf849(0xe0))/0xb+parseInt(_0x4cf849(0x11a))/0xc*(-parseInt(_0x4cf849(0xdc))/0xd);if(_0x1fb093===_0x46ad70)break;else _0xb90c6f['push'](_0xb90c6f['shift']());}catch(_0x27ec7d){_0xb90c6f['push'](_0xb90c6f['shift']());}}}(a26_0x45d5,0x8b30a));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';function a26_0x4389(_0x4a7aa2,_0x179684){_0x4a7aa2=_0x4a7aa2-0xc8;const _0x45d5ad=a26_0x45d5();let _0x43894a=_0x45d5ad[_0x4a7aa2];return _0x43894a;}function a26_0x45d5(){const _0x3e75a7=['list','trino','next_run_at','statusIcon','\x20scheduled\x20quer','output','substring','repeat','green','start_at','\x20(use\x20--limit\x20to\x20see\x20more)','run','description','ended_at','\x20\x20Type:\x20','has_next_page','site','padEnd','name','Run\x20a\x20scheduled\x20query\x20immediately','h\x20ago','Schedule\x20updated:\x20','\x20created','retry_limit','2793556dnNJGP','No\x20scheduled\x20queries\x20found','status','\x20job','schedule:update','result','lastRun','Deleting\x20schedule...','Delete\x20a\x20scheduled\x20query','utf-8','3nSglSq','delay','max','INVALID_ARGUMENT','queries','3yEwUkR','never','Schedule\x20created:\x20','schedule:delete','236565ifYHuO','num','user_name','map','Update\x20a\x20scheduled\x20query','Schedule\x20deleted:\x20','engineVersion','data','getTime','\x20execution','validate','join','table','schedule:show','816WsSlMf','job_id','create','timezone','240Dwwffr','Showing\x20first\x20','from','schedule:history','error','\x20\x20Cron:\x20','verbose','round','history','listQueries','1504888QAkxHl','time','cyan','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','/app/queries/editor?queryId=','schedules','Found\x20','Failed\x20to\x20read\x20file:\x20','trim','Updating\x20schedule...','\x20matching\x20\x22','\x20\x20β†’\x20','200470TdCrBf','query','scheduled_at','time_zone','args','Creating\x20schedule...','d\x20ago','user','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','file','end_at','last_job','execute','21OtpUsJ','type','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','executing_user_id','(unnamed)','engine_version','\x20\x20Time:\x20','in\x20','jobs','10bSdZJD','log','just\x20now','show','queryUrl','Getting\x20schedule\x20history...','1325070yDIbUc','entries','database','priority','schedule:run','count','format','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','json','m\x20ago','abs','length','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]','yes','retryLimit','success','\x20schedules','nextRun','cron','update','schedule:create','pagination','21346DoBldC','Getting\x20schedule\x20details...','updated_at','tsv','9080643XluRVU'];a26_0x45d5=function(){return _0x3e75a7;};return a26_0x45d5();}import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x328ac9 from'chalk';function formatRelativeTime(_0x403635){const _0x35f8a1=a26_0x4389,_0x1dfbe1=new Date(_0x403635),_0x4c5ca5=new Date(),_0x5579ed=_0x1dfbe1[_0x35f8a1(0x114)]()-_0x4c5ca5[_0x35f8a1(0x114)](),_0x72d2ac=Math[_0x35f8a1(0xd0)](_0x5579ed)/0x3e8,_0x14a51e=_0x5579ed<0x0;if(_0x72d2ac<0x3c)return _0x14a51e?_0x35f8a1(0x14c):'soon';else{if(_0x72d2ac<0xe10){const _0x67dc7c=Math['round'](_0x72d2ac/0x3c);return _0x14a51e?_0x67dc7c+_0x35f8a1(0xcf):_0x35f8a1(0x148)+_0x67dc7c+'m';}else{if(_0x72d2ac<0x15180){const _0x38cfb0=Math[_0x35f8a1(0x125)](_0x72d2ac/0xe10);return _0x14a51e?_0x38cfb0+_0x35f8a1(0xf5):_0x35f8a1(0x148)+_0x38cfb0+'h';}else{if(_0x72d2ac<0x93a80){const _0x59e47d=Math[_0x35f8a1(0x125)](_0x72d2ac/0x15180);return _0x14a51e?_0x59e47d+_0x35f8a1(0x13a):_0x35f8a1(0x148)+_0x59e47d+'d';}else return _0x1dfbe1['toLocaleDateString']();}}}}export class ScheduleListCommand extends BaseCommand{['name']='schedule:list';[a26_0x506400(0xed)]='List\x20scheduled\x20queries';async[a26_0x506400(0x140)](_0x5d9126){const _0x2f5a4a=a26_0x506400,{options:_0x5ee809,args:_0x480bbf,tdx:_0x4aa3cb}=_0x5d9126,_0x307533=resolveLimit(_0x5ee809['limit'],DEFAULT_DISPLAY_LIMIT),_0x25ac38=_0x480bbf[0x0],_0x4009c5=_0x25ac38?'Searching\x20scheduled\x20queries\x20matching\x20\x22'+_0x25ac38+'\x22...':'Listing\x20scheduled\x20queries...',_0x9645c9=await withSpinner(_0x4009c5,()=>_0x4aa3cb[_0x2f5a4a(0x12d)][_0x2f5a4a(0x127)]({'limit':_0x307533,'scheduled':!![],'pattern':_0x25ac38}),{'verbose':_0x5ee809[_0x2f5a4a(0x124)]}),_0x5b0a29=_0x9645c9['data'][_0x2f5a4a(0x107)],_0x55128f=_0x9645c9[_0x2f5a4a(0x113)][_0x2f5a4a(0xdb)][_0x2f5a4a(0xf0)],_0x5f37fe=_0x25ac38?_0x2f5a4a(0x132)+_0x25ac38+'\x22':'';_0x55128f?console[_0x2f5a4a(0x122)](_0x2f5a4a(0x11f)+_0x5b0a29[_0x2f5a4a(0xd1)]+_0x2f5a4a(0xd6)+_0x5f37fe+_0x2f5a4a(0xeb)):console['error'](_0x2f5a4a(0x12e)+_0x5b0a29[_0x2f5a4a(0xd1)]+_0x2f5a4a(0xe5)+(_0x5b0a29[_0x2f5a4a(0xd1)]!==0x1?'ies':'y')+_0x5f37fe);if(_0x5ee809[_0x2f5a4a(0xcc)]===_0x2f5a4a(0xce)||_0x5ee809[_0x2f5a4a(0xcc)]==='jsonl'||_0x5ee809[_0x2f5a4a(0xcc)]===_0x2f5a4a(0x118)||_0x5ee809[_0x2f5a4a(0xcc)]===_0x2f5a4a(0xdf)){const _0x1b7b30=_0x5b0a29[_0x2f5a4a(0x10f)](_0xdc4e35=>({'id':_0xdc4e35['id'],'name':_0xdc4e35[_0x2f5a4a(0xf3)],'cron':_0xdc4e35[_0x2f5a4a(0xd8)],'database':_0xdc4e35['database']?.[_0x2f5a4a(0xf3)],'type':_0xdc4e35[_0x2f5a4a(0x142)],'timezone':_0xdc4e35[_0x2f5a4a(0x137)],'user_name':_0xdc4e35[_0x2f5a4a(0x13b)]?.[_0x2f5a4a(0xf3)],'updated_at':_0xdc4e35[_0x2f5a4a(0xde)],'next_run_at':_0xdc4e35[_0x2f5a4a(0xe3)],'last_job_status':_0xdc4e35['last_job']?.['status']}));await handleSDKOutput(_0x1b7b30,_0x5ee809);}else{if(_0x5b0a29[_0x2f5a4a(0xd1)]===0x0)console[_0x2f5a4a(0x14b)](_0x2f5a4a(0xfa));else{const _0x546044=_0x5ee809[_0x2f5a4a(0xf1)],_0x20743a=_0x5b0a29[_0x2f5a4a(0x10f)](_0x17564a=>{const _0x4b3155=_0x2f5a4a,_0x1ef497=_0x17564a[_0x4b3155(0x13f)]?.[_0x4b3155(0xfb)]?_0x17564a['last_job'][_0x4b3155(0xfb)]===_0x4b3155(0xd5)?'βœ“':'βœ—':'-',_0x3d9e6c=_0x17564a[_0x4b3155(0x13f)]?.[_0x4b3155(0xee)]?formatRelativeTime(_0x17564a[_0x4b3155(0x13f)]['ended_at']):_0x4b3155(0x109),_0x400eac=_0x17564a[_0x4b3155(0xe3)]?formatRelativeTime(_0x17564a[_0x4b3155(0xe3)]):'-',_0x285bb0=_0x17564a[_0x4b3155(0xd8)]||'',_0x58edde=_0x17564a['name']||_0x4b3155(0x145),_0x2c4e26=getConsoleUrl(_0x546044,_0x4b3155(0x12c)+_0x17564a['id']);return{'statusIcon':_0x1ef497,'lastRun':_0x3d9e6c,'nextRun':_0x400eac,'cron':_0x285bb0,'name':_0x58edde,'queryUrl':_0x2c4e26,'status':_0x17564a['last_job']?.[_0x4b3155(0xfb)]};}),_0xc0c6c8=Math[_0x2f5a4a(0x105)](..._0x20743a[_0x2f5a4a(0x10f)](_0x5a0530=>_0x5a0530[_0x2f5a4a(0xff)][_0x2f5a4a(0xd1)])),_0x4e3883=Math[_0x2f5a4a(0x105)](..._0x20743a['map'](_0x3d6f93=>_0x3d6f93[_0x2f5a4a(0xd7)][_0x2f5a4a(0xd1)])),_0x1a242a=Math['max'](..._0x20743a['map'](_0x167ca9=>_0x167ca9[_0x2f5a4a(0xd8)]['length'])),_0x559a41=_0x20743a[_0x2f5a4a(0x10f)](_0x99b931=>{const _0x1cb03e=_0x2f5a4a,_0x39843e=_0x99b931[_0x1cb03e(0xfb)]===_0x1cb03e(0xd5)?a26_0x328ac9[_0x1cb03e(0xe9)](_0x99b931[_0x1cb03e(0xe4)]):_0x99b931[_0x1cb03e(0xfb)]===_0x1cb03e(0x122)?a26_0x328ac9['red'](_0x99b931[_0x1cb03e(0xe4)]):a26_0x328ac9['dim'](_0x99b931['statusIcon']),_0x3b9027=_0x99b931['lastRun'][_0x1cb03e(0xf2)](_0xc0c6c8),_0x309735=_0x99b931['nextRun']['padEnd'](_0x4e3883),_0x2a87f7=_0x99b931['cron']?a26_0x328ac9[_0x1cb03e(0x12a)](_0x99b931[_0x1cb03e(0xd8)][_0x1cb03e(0xf2)](_0x1a242a)):'\x20'[_0x1cb03e(0xe8)](_0x1a242a),_0x4b48dc=hyperlink(_0x99b931['name'],_0x99b931[_0x1cb03e(0x14e)]);return'πŸ“…\x20'+_0x39843e+'\x20'+_0x3b9027+_0x1cb03e(0x133)+_0x309735+'\x20\x20'+_0x2a87f7+'\x20\x20'+_0x4b48dc;});await writeOutput(_0x559a41[_0x2f5a4a(0x117)]('\x0a'),_0x5ee809[_0x2f5a4a(0xe6)],_0x2f5a4a(0xe1));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a26_0x506400(0xf3)]=a26_0x506400(0x119);[a26_0x506400(0xed)]='Show\x20schedule\x20details';[a26_0x506400(0x116)](_0x1ec3ae){const _0x512744=a26_0x506400,_0x41d592=_0x1ec3ae[_0x512744(0x138)][0x0];if(!_0x41d592)return _0x512744(0x12b);return undefined;}async['execute'](_0xcf677f){const _0x35fa9d=a26_0x506400,{options:_0x3a023d,args:_0x544049,tdx:_0x10217e}=_0xcf677f,_0x34c1ea=_0x544049[0x0],_0x2b225a=await withSpinner(_0x35fa9d(0xdd),()=>_0x10217e[_0x35fa9d(0x12d)][_0x35fa9d(0x14d)](_0x34c1ea),{'verbose':_0x3a023d[_0x35fa9d(0x124)]}),_0x4a030d=_0x2b225a[_0x35fa9d(0x113)],_0x35c6aa={'name':_0x4a030d['name'],'cron':_0x4a030d[_0x35fa9d(0xd8)],'database':_0x4a030d[_0x35fa9d(0xc8)],'type':_0x4a030d['type'],'timezone':_0x4a030d['timezone'],'user_name':_0x4a030d[_0x35fa9d(0x10e)],'created_at':_0x4a030d['created_at'],'engine_version':_0x4a030d[_0x35fa9d(0x146)],'executing_user_id':_0x4a030d[_0x35fa9d(0x144)],'query':_0x4a030d[_0x35fa9d(0x135)],'delay':_0x4a030d[_0x35fa9d(0x104)],'priority':_0x4a030d[_0x35fa9d(0xc9)],'retry_limit':_0x4a030d[_0x35fa9d(0xf8)],..._0x4a030d[_0x35fa9d(0xfe)]&&{'result':_0x4a030d[_0x35fa9d(0xfe)]}};return await handleSingleObjectOutput(_0x35c6aa,_0x3a023d),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a26_0x506400(0xf3)]=a26_0x506400(0xda);[a26_0x506400(0xed)]='Create\x20a\x20scheduled\x20query';[a26_0x506400(0x116)](_0x46842b){const _0x3adcd6=_0x46842b['args'][0x0];if(!_0x3adcd6)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async[a26_0x506400(0x140)](_0x283154){const _0x89aa0c=a26_0x506400,{options:_0x26b5fd,args:_0x683b03,tdx:_0x4abf09}=_0x283154,_0x50f76e=_0x683b03[0x0],_0xdd600f=_0x26b5fd,_0x246c3d=_0xdd600f[_0x89aa0c(0xc8)],_0x3475ff=_0xdd600f[_0x89aa0c(0x13d)],_0x123ec5=_0xdd600f[_0x89aa0c(0x142)]||_0x89aa0c(0xe2);let _0x168966;try{_0x168966=readFileSync(_0x3475ff,'utf-8')['trim']();}catch(_0x12705c){throw new SDKError(ErrorCode[_0x89aa0c(0x106)],_0x89aa0c(0x12f)+_0x3475ff,_0x12705c instanceof Error?_0x12705c:undefined);}if(!_0x168966)throw new SDKError(ErrorCode[_0x89aa0c(0x106)],'Query\x20file\x20is\x20empty');const _0x9ac9b3={'database':_0x246c3d,'query':_0x168966,'type':_0x123ec5};if(_0xdd600f[_0x89aa0c(0xd8)])_0x9ac9b3['cron']=_0xdd600f['cron'];if(_0xdd600f[_0x89aa0c(0x11d)])_0x9ac9b3['timezone']=_0xdd600f[_0x89aa0c(0x11d)];if(_0xdd600f[_0x89aa0c(0x104)]!==undefined)_0x9ac9b3[_0x89aa0c(0x104)]=Number(_0xdd600f['delay']);if(_0xdd600f[_0x89aa0c(0xc9)]!==undefined)_0x9ac9b3[_0x89aa0c(0xc9)]=Number(_0xdd600f[_0x89aa0c(0xc9)]);if(_0xdd600f['retryLimit']!==undefined)_0x9ac9b3[_0x89aa0c(0xf8)]=Number(_0xdd600f['retryLimit']);if(_0xdd600f[_0x89aa0c(0x112)])_0x9ac9b3[_0x89aa0c(0x146)]=_0xdd600f[_0x89aa0c(0x112)];if(_0xdd600f[_0x89aa0c(0xfe)])_0x9ac9b3[_0x89aa0c(0xfe)]=_0xdd600f['result'];if(_0x26b5fd[_0x89aa0c(0x124)]){console[_0x89aa0c(0x122)]('Creating\x20schedule:\x20'+_0x50f76e),console['error']('\x20\x20Database:\x20'+_0x246c3d),console['error'](_0x89aa0c(0xef)+_0x123ec5);if(_0x9ac9b3[_0x89aa0c(0xd8)])console[_0x89aa0c(0x122)](_0x89aa0c(0x123)+_0x9ac9b3[_0x89aa0c(0xd8)]);if(_0x9ac9b3[_0x89aa0c(0x11d)])console[_0x89aa0c(0x122)]('\x20\x20Timezone:\x20'+_0x9ac9b3[_0x89aa0c(0x11d)]);}const _0x562a0e=await withSpinner(_0x89aa0c(0x139),()=>_0x4abf09[_0x89aa0c(0x12d)][_0x89aa0c(0x11c)](_0x50f76e,_0x9ac9b3),{'verbose':_0x26b5fd[_0x89aa0c(0x124)]});return console[_0x89aa0c(0x122)](_0x89aa0c(0x10a)+_0x562a0e[_0x89aa0c(0x113)][_0x89aa0c(0xf3)]),await handleSingleObjectOutput(_0x562a0e[_0x89aa0c(0x113)],_0x26b5fd),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a26_0x506400(0xf3)]=a26_0x506400(0xfd);[a26_0x506400(0xed)]=a26_0x506400(0x110);[a26_0x506400(0x116)](_0x83a7a5){const _0x2eedc9=a26_0x506400,_0x3b1583=_0x83a7a5[_0x2eedc9(0x138)][0x0];if(!_0x3b1583)return _0x2eedc9(0x143);return undefined;}async[a26_0x506400(0x140)](_0x57a645){const _0x49c305=a26_0x506400,{options:_0x59025b,args:_0x2f2113,tdx:_0x53932d}=_0x57a645,_0x179d7f=_0x2f2113[0x0],_0x5e7f74=_0x59025b,_0x7f89d4={};if(_0x5e7f74[_0x49c305(0xc8)])_0x7f89d4[_0x49c305(0xc8)]=_0x5e7f74['database'];if(_0x5e7f74[_0x49c305(0x142)])_0x7f89d4[_0x49c305(0x142)]=_0x5e7f74['type'];if(_0x5e7f74[_0x49c305(0xd8)])_0x7f89d4[_0x49c305(0xd8)]=_0x5e7f74[_0x49c305(0xd8)];if(_0x5e7f74['timezone'])_0x7f89d4[_0x49c305(0x11d)]=_0x5e7f74[_0x49c305(0x11d)];if(_0x5e7f74[_0x49c305(0x104)]!==undefined)_0x7f89d4[_0x49c305(0x104)]=Number(_0x5e7f74[_0x49c305(0x104)]);if(_0x5e7f74['priority']!==undefined)_0x7f89d4[_0x49c305(0xc9)]=Number(_0x5e7f74[_0x49c305(0xc9)]);if(_0x5e7f74['retryLimit']!==undefined)_0x7f89d4['retry_limit']=Number(_0x5e7f74[_0x49c305(0xd4)]);if(_0x5e7f74[_0x49c305(0x112)])_0x7f89d4[_0x49c305(0x146)]=_0x5e7f74['engineVersion'];if(_0x5e7f74['result'])_0x7f89d4['result']=_0x5e7f74['result'];if(_0x5e7f74[_0x49c305(0x13d)])try{_0x7f89d4[_0x49c305(0x135)]=readFileSync(_0x5e7f74[_0x49c305(0x13d)],_0x49c305(0x102))[_0x49c305(0x130)]();}catch(_0x4a25dc){throw new SDKError(ErrorCode[_0x49c305(0x106)],_0x49c305(0x12f)+_0x5e7f74[_0x49c305(0x13d)],_0x4a25dc instanceof Error?_0x4a25dc:undefined);}if(Object['keys'](_0x7f89d4)[_0x49c305(0xd1)]===0x0)throw new SDKError(ErrorCode[_0x49c305(0x106)],_0x49c305(0xcd));if(_0x59025b[_0x49c305(0x124)]){console[_0x49c305(0x122)]('Updating\x20schedule:\x20'+_0x179d7f);for(const [_0xf8d0c0,_0x57bf51]of Object[_0x49c305(0x151)](_0x7f89d4)){_0xf8d0c0===_0x49c305(0x135)?console['error']('\x20\x20'+_0xf8d0c0+':\x20'+_0x57bf51[_0x49c305(0xe7)](0x0,0x32)+'...'):console[_0x49c305(0x122)]('\x20\x20'+_0xf8d0c0+':\x20'+_0x57bf51);}}const _0x2d1dfa=await withSpinner(_0x49c305(0x131),()=>_0x53932d['schedules'][_0x49c305(0xd9)](_0x179d7f,_0x7f89d4),{'verbose':_0x59025b[_0x49c305(0x124)]});return console['error'](_0x49c305(0xf6)+_0x2d1dfa[_0x49c305(0x113)][_0x49c305(0xf3)]),await handleSingleObjectOutput(_0x2d1dfa[_0x49c305(0x113)],_0x59025b),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a26_0x506400(0x10b);[a26_0x506400(0xed)]=a26_0x506400(0x101);['validate'](_0x301464){const _0x2a9566=a26_0x506400,_0x3f34a3=_0x301464['args'][0x0];if(!_0x3f34a3)return _0x2a9566(0x13c);return undefined;}async[a26_0x506400(0x140)](_0x455cf9){const _0x58573d=a26_0x506400,{options:_0x3579bf,args:_0x559eda,tdx:_0x318e29}=_0x455cf9,_0x34ad32=_0x559eda[0x0];if(!_0x3579bf[_0x58573d(0xd3)]){const _0x304e45=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22'+_0x34ad32+'\x22?');if(!_0x304e45)return console[_0x58573d(0x122)]('Cancelled'),0x0;}const _0x14a419=await withSpinner(_0x58573d(0x100),()=>_0x318e29[_0x58573d(0x12d)]['delete'](_0x34ad32),{'verbose':_0x3579bf[_0x58573d(0x124)]});return console[_0x58573d(0x122)](_0x58573d(0x111)+_0x14a419['data'][_0x58573d(0xf3)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{[a26_0x506400(0xf3)]=a26_0x506400(0xca);['description']=a26_0x506400(0xf4);['validate'](_0x1a427e){const _0x145db2=a26_0x506400,_0x193521=_0x1a427e[_0x145db2(0x138)][0x0];if(!_0x193521)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]';return undefined;}async[a26_0x506400(0x140)](_0xcac061){const _0x3b3488=a26_0x506400,{options:_0x2d0778,args:_0x24bf34,tdx:_0x468c67}=_0xcac061,_0x24bf6d=_0x24bf34[0x0],_0x6c7089=_0x2d0778,_0x5838e6=_0x6c7089[_0x3b3488(0x129)],_0x4f3404=_0x6c7089[_0x3b3488(0x10d)]!==undefined?Number(_0x6c7089[_0x3b3488(0x10d)]):undefined;if(_0x2d0778[_0x3b3488(0x124)]){console[_0x3b3488(0x122)]('Running\x20schedule:\x20'+_0x24bf6d);if(_0x5838e6)console[_0x3b3488(0x122)](_0x3b3488(0x147)+_0x5838e6);if(_0x4f3404)console['error']('\x20\x20Num:\x20'+_0x4f3404);}const _0x4e0821=await withSpinner('Running\x20schedule...',()=>_0x468c67[_0x3b3488(0x12d)][_0x3b3488(0xec)](_0x24bf6d,{'time':_0x5838e6,'num':_0x4f3404}),{'verbose':_0x2d0778[_0x3b3488(0x124)]}),_0x37b01a=_0x4e0821[_0x3b3488(0x113)][_0x3b3488(0x149)];console[_0x3b3488(0x122)]('Schedule\x20run\x20submitted:\x20'+_0x37b01a[_0x3b3488(0xd1)]+_0x3b3488(0xfc)+(_0x37b01a[_0x3b3488(0xd1)]!==0x1?'s':'')+_0x3b3488(0xf7));for(const _0x2117bc of _0x37b01a){console[_0x3b3488(0x122)]('\x20\x20Job\x20ID:\x20'+_0x2117bc[_0x3b3488(0x11b)]);}return await handleSDKOutput(_0x37b01a,_0x2d0778),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a26_0x506400(0xf3)]=a26_0x506400(0x121);[a26_0x506400(0xed)]='Show\x20schedule\x20execution\x20history';['validate'](_0x78b2f3){const _0x36e63d=a26_0x506400,_0x113c5f=_0x78b2f3[_0x36e63d(0x138)][0x0];if(!_0x113c5f)return _0x36e63d(0xd2);return undefined;}async[a26_0x506400(0x140)](_0x170cd8){const _0x2f0fa3=a26_0x506400,{options:_0x3ce61a,args:_0x2528c2,tdx:_0x5dbfc9}=_0x170cd8,_0x192683=_0x2528c2[0x0],_0x579fbc=_0x3ce61a,_0x2c9628=_0x579fbc[_0x2f0fa3(0x120)]!==undefined?Number(_0x579fbc[_0x2f0fa3(0x120)]):undefined,_0x15d82c=_0x579fbc['to']!==undefined?Number(_0x579fbc['to']):undefined,_0x46aa40=await withSpinner(_0x2f0fa3(0x14f),()=>_0x5dbfc9['schedules'][_0x2f0fa3(0x126)](_0x192683,{'from':_0x2c9628,'to':_0x15d82c}),{'verbose':_0x3ce61a[_0x2f0fa3(0x124)]}),_0x3dccb3=_0x46aa40['data'];console[_0x2f0fa3(0x122)](_0x2f0fa3(0x12e)+_0x3dccb3[_0x2f0fa3(0xcb)]+_0x2f0fa3(0x115)+(_0x3dccb3[_0x2f0fa3(0xcb)]!==0x1?'s':'')+'\x20(showing\x20'+_0x3dccb3[_0x2f0fa3(0x120)]+'-'+_0x3dccb3['to']+')');const _0x3983db=_0x3dccb3[_0x2f0fa3(0x126)][_0x2f0fa3(0x10f)](_0x364be1=>({'job_id':_0x364be1[_0x2f0fa3(0x11b)],'type':_0x364be1['type'],'status':_0x364be1[_0x2f0fa3(0xfb)],'scheduled_at':_0x364be1[_0x2f0fa3(0x136)],'created_at':_0x364be1['created_at'],'start_at':_0x364be1[_0x2f0fa3(0xea)],'end_at':_0x364be1[_0x2f0fa3(0x13e)]}));return await handleSDKOutput(_0x3983db,_0x3ce61a),0x0;}}
@@ -1 +1 @@
1
- const a27_0x25ae30=a27_0x3fbe;(function(_0x9f9a4e,_0x1d3ee1){const _0x41cc77=a27_0x3fbe,_0x30a5d3=_0x9f9a4e();while(!![]){try{const _0x3a2f61=parseInt(_0x41cc77(0xab))/0x1*(parseInt(_0x41cc77(0x10e))/0x2)+parseInt(_0x41cc77(0xbd))/0x3*(parseInt(_0x41cc77(0xd5))/0x4)+parseInt(_0x41cc77(0xa4))/0x5+-parseInt(_0x41cc77(0x8f))/0x6*(parseInt(_0x41cc77(0xac))/0x7)+parseInt(_0x41cc77(0xa6))/0x8*(parseInt(_0x41cc77(0x95))/0x9)+parseInt(_0x41cc77(0xef))/0xa+-parseInt(_0x41cc77(0xb7))/0xb;if(_0x3a2f61===_0x1d3ee1)break;else _0x30a5d3['push'](_0x30a5d3['shift']());}catch(_0x4d6ff7){_0x30a5d3['push'](_0x30a5d3['shift']());}}}(a27_0x495b,0x345ae));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';function a27_0x495b(){const _0x4f9823=['Listing\x20folders\x20for\x20parent\x20\x27','Resolving\x20\x27','listFolders','Resolved\x20type:\x20','1842tgLPNU','Error:\x20','segment','json','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','34326drPDDn','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','site','Usage:\x20tdx\x20segment\x20describe\x20<path>','Resolved\x20parent\x20folder\x20ID:\x20','parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','processedRows','web','segmentId','green','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Use:\x20tdx\x20ps\x20show','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','673860XzmgEY','getParent','816UsAUXC','Options:','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Fetching\x20segment\x20details...','resolveParentId','21853bkhRSw','2282xLxWKv','Resolved\x20YAML\x20file:\x20','url','\x27...','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderId','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','βœ”\x20Query\x20completed:\x20Processed\x20','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','4528007EQEzeV','βœ”\x20Created\x20folder\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Segment\x20ID\x20missing\x20from\x20resolved\x20path','length','βœ–\x20Query\x20failed\x20[','3euUyOW','Resolving\x20parent\x20segment\x20\x27','cause','Folder\x20ID:\x20','toLocaleString','message','Resolving\x20parent\x20folder\x20\x27','Segment\x20ID:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Resolving\x20path\x20\x27','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Target\x20path:\x20','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','\x20\x20Cause:\x20','Error:\x20Folder\x20reference\x20is\x20required','segment:folder:list','setJobId','elapsedTimeMillis','Resolved\x20folder\x20ID:\x20','data','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','folder','segment:folder:show','getSegmentSQL','449076ZHacOl','Fetching\x20SQL\x20for\x20segment...','Executing\x20segment\x20query...','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Use:\x20tdx\x20ps\x20view','query','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Parent\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','name','Create\x20segment\x20folder\x20for\x20organization','Show\x20segment\x20folder\x20details','parentFolder','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','βœ”\x20Found\x20','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:describe','segment:show','jobId','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','execute','segment:folder:create','format','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','463900bEAFsi','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','\x20\x20Folder\x20path:\x20','type','error','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','getFolder','resolvePathToResource','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','verbose','Resolved\x20relative\x20path\x20to:\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','parentSegment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','SELECT\x20*\x20FROM\x20(\x0a','getSegment','description','Parent\x20ID:\x20','segmentPath','Usage:\x20tdx\x20sg\x20show\x20<name>','Parent\x20segment:\x20','SEGMENT_NOT_FOUND','stats','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20Full\x20path:\x20','Show\x20segment\x20or\x20folder\x20details','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','segment:desc','SEGMENT_FOLDER_NOT_FOUND','Site:\x20','4pXANIN','code','\x20folder','parentId','Use:\x20tdx\x20ps\x20sql','\x20Opening\x20','fullPath','Resolved\x20parent\x20ID:\x20','log','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Fetching\x20folder\x20details...','/e/','jsonl','limit','Examples:','segment:sql','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','replace','folderPath','INVALID_ARGUMENT','\x27\x20with\x20ID:\x20','resolveFolderId','trim','Use:\x20tdx\x20ps\x20view\x20-w','Usage:\x20tdx\x20sg\x20desc\x20<name>','Fetching\x20folder\x20\x27','/app/ps/'];a27_0x495b=function(){return _0x4f9823;};return a27_0x495b();}import a27_0x445e51 from'chalk';async function resolveSegmentTarget(_0x1c6c51,_0x52b391,_0x6a46a){const _0x2cd276=a27_0x3fbe;if(isYamlFilePath(_0x1c6c51))try{const _0x24c2d8=await resolveYamlFilePath(_0x1c6c51);return _0x6a46a&&(console[_0x2cd276(0xf3)](_0x2cd276(0xad)+_0x1c6c51),console['error']('\x20\x20Parent\x20segment:\x20'+_0x24c2d8[_0x2cd276(0xfc)]),console['error']('\x20\x20Segment\x20name:\x20'+_0x24c2d8['segmentName']),console[_0x2cd276(0xf3)](_0x2cd276(0xf1)+(_0x24c2d8[_0x2cd276(0x82)]||'(root)')),console[_0x2cd276(0xf3)](_0x2cd276(0x108)+_0x24c2d8[_0x2cd276(0x76)])),_0x24c2d8[_0x2cd276(0x76)];}catch(_0x5d6f3d){throw new SDKError(ErrorCode[_0x2cd276(0x83)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x5d6f3d[_0x2cd276(0xc2)]);}if(!_0x52b391)throw new SDKError(ErrorCode[_0x2cd276(0x83)],_0x2cd276(0xb6));return _0x52b391+'/'+_0x1c6c51;}export class SegmentDescribeCommand extends BaseCommand{['name']=a27_0x25ae30(0xe7);['description']=a27_0x25ae30(0x109);async[a27_0x25ae30(0xeb)](_0x4e7d4f){const _0x49557c=a27_0x25ae30,{options:_0x2d6850,args:_0x59909d,tdx:_0x3f47b4}=_0x4e7d4f,_0x264f04=_0x59909d[0x0],_0xf1d4e5=!_0x264f04&&!!_0x2d6850[_0x49557c(0xfc)],_0x584c10=_0x264f04||_0x2d6850[_0x49557c(0xfc)];if(!_0x584c10)return console[_0x49557c(0xf3)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x49557c(0xf3)](_0x49557c(0x98)),console['error'](_0x49557c(0x7e)),console[_0x49557c(0xf3)](_0x49557c(0xa3)),console['error'](_0x49557c(0xb1)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x49557c(0xf3)](_0x49557c(0xb5)),0x1;try{const _0x39af06=_0x2d6850[_0x49557c(0x102)];let _0x32e13c=_0x584c10;!_0xf1d4e5&&_0x39af06&&!_0x584c10['includes']('/')&&(_0x32e13c=_0x39af06+'/'+_0x584c10,_0x2d6850[_0x49557c(0xf9)]&&console[_0x49557c(0xf3)](_0x49557c(0xfa)+_0x32e13c));const _0x396d2d=await withSpinner(_0x49557c(0xc6)+_0x32e13c+_0x49557c(0xaf),()=>_0x3f47b4[_0x49557c(0x91)][_0x49557c(0xf7)](_0x32e13c),{'verbose':_0x2d6850[_0x49557c(0xf9)]}),_0x2071aa=_0x396d2d['data'];_0x2d6850[_0x49557c(0xf9)]&&(console[_0x49557c(0xf3)](_0x49557c(0x8e)+_0x2071aa[_0x49557c(0xf2)]),console[_0x49557c(0xf3)](_0x49557c(0x101)+_0x2071aa[_0x49557c(0x73)]),_0x2071aa[_0x49557c(0xb2)]&&console[_0x49557c(0xf3)]('Folder\x20ID:\x20'+_0x2071aa[_0x49557c(0xb2)]),_0x2071aa[_0x49557c(0x9f)]&&console[_0x49557c(0xf3)](_0x49557c(0xc4)+_0x2071aa[_0x49557c(0x9f)]));if(_0x2071aa[_0x49557c(0xf2)]===_0x49557c(0x9a)){const _0xdf587e=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x3f47b4['segment'][_0x49557c(0xa5)](_0x2071aa[_0x49557c(0x73)]),{'verbose':_0x2d6850[_0x49557c(0xf9)]});await handleSingleObjectOutput(_0xdf587e['data'],_0x2d6850);}else{if(_0x2071aa[_0x49557c(0xf2)]===_0x49557c(0xd2)){if(!_0x2071aa['folderId'])throw new SDKError(ErrorCode[_0x49557c(0x10c)],_0x49557c(0xe6));const _0x2a4cd5=await withSpinner(_0x49557c(0x7a),()=>_0x3f47b4[_0x49557c(0x91)]['getFolder'](_0x2071aa['folderId']),{'verbose':_0x2d6850['verbose']});await handleSingleObjectOutput(_0x2a4cd5[_0x49557c(0xd0)],_0x2d6850);}else{if(_0x2071aa['type']===_0x49557c(0x91)){if(!_0x2071aa['segmentId'])throw new SDKError(ErrorCode[_0x49557c(0x105)],_0x49557c(0xba));const _0x45577e=await withSpinner('Fetching\x20segment\x20details...',()=>_0x3f47b4[_0x49557c(0x91)][_0x49557c(0xff)](_0x2071aa[_0x49557c(0x73)],_0x2071aa['segmentId']),{'verbose':_0x2d6850[_0x49557c(0xf9)]});await handleSingleObjectOutput(_0x45577e[_0x49557c(0xd0)],_0x2d6850);}}}return 0x0;}catch(_0x1d3898){if(_0x1d3898 instanceof SDKError)return console[_0x49557c(0xf3)](_0x49557c(0x90)+_0x1d3898[_0x49557c(0xc2)]),_0x1d3898[_0x49557c(0xbf)]&&console[_0x49557c(0xf3)](_0x49557c(0xca)+_0x1d3898[_0x49557c(0xbf)]),0x1;throw _0x1d3898;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x25ae30(0xde)]=a27_0x25ae30(0xe8);[a27_0x25ae30(0x100)]=a27_0x25ae30(0x10a);async[a27_0x25ae30(0xeb)](_0x5cc1a3){const _0xa51962=a27_0x25ae30,{options:_0x29b951,args:_0x40df9a,tdx:_0x71b755}=_0x5cc1a3,_0x94f4d3=_0x40df9a[0x0];if(!_0x94f4d3)return console['error'](_0xa51962(0x96)),console[_0xa51962(0xf3)](_0xa51962(0x103)),console[_0xa51962(0xf3)](_0xa51962(0xf5)),console[_0xa51962(0xf3)](_0xa51962(0x7e)),console[_0xa51962(0xf3)](_0xa51962(0xdb)),console[_0xa51962(0xf3)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x495f22=_0x29b951[_0xa51962(0xfc)],_0x322d3d=await resolveSegmentTarget(_0x94f4d3,_0x495f22,_0x29b951[_0xa51962(0xf9)]);_0x29b951[_0xa51962(0xf9)]&&console[_0xa51962(0xf3)](_0xa51962(0xc8)+_0x322d3d);const _0x3f1c0c=await withSpinner(_0xa51962(0x8c)+_0x94f4d3+_0xa51962(0xaf),()=>_0x71b755[_0xa51962(0x91)]['resolvePathToResource'](_0x322d3d),{'verbose':_0x29b951['verbose']}),_0x365ba9=_0x3f1c0c[_0xa51962(0xd0)];_0x29b951[_0xa51962(0xf9)]&&(console[_0xa51962(0xf3)](_0xa51962(0x8e)+_0x365ba9[_0xa51962(0xf2)]),console[_0xa51962(0xf3)](_0xa51962(0x101)+_0x365ba9[_0xa51962(0x73)]));if(_0x365ba9[_0xa51962(0xf2)]===_0xa51962(0xd2))return console['error'](_0xa51962(0xa1)),console[_0xa51962(0xf3)](_0xa51962(0xf4)),0x1;if(_0x365ba9[_0xa51962(0xf2)]===_0xa51962(0x9a))return console[_0xa51962(0xf3)](_0xa51962(0xfd)),console[_0xa51962(0xf3)](_0xa51962(0xa2)),0x1;if(!_0x365ba9[_0xa51962(0x9f)])throw new SDKError(ErrorCode[_0xa51962(0x105)],_0xa51962(0xba));const _0x153dcb=await withSpinner(_0xa51962(0xd6),()=>_0x71b755[_0xa51962(0x91)][_0xa51962(0xd4)](_0x365ba9[_0xa51962(0x73)],_0x365ba9[_0xa51962(0x9f)]),{'verbose':_0x29b951[_0xa51962(0xf9)]});let _0x3e0365=_0x153dcb[_0xa51962(0xd0)];const _0x278bf4=resolveLimit(_0x29b951[_0xa51962(0x7d)],DEFAULT_DISPLAY_LIMIT),_0x3f03ff=/\bLIMIT\s+\d+/i['test'](_0x3e0365);!_0x3f03ff&&(_0x3e0365=_0x3e0365[_0xa51962(0x86)]()[_0xa51962(0x81)](/;+$/,''),_0x3e0365=_0xa51962(0xfe)+_0x3e0365+_0xa51962(0xc7)+_0x278bf4);_0x29b951[_0xa51962(0xf9)]&&console['error']('SQL\x20query:\x0a'+_0x3e0365);const _0x11bfb1=await withProgressSpinner(_0xa51962(0xd7),async _0x2e68d9=>{const _0x24d4b3=_0xa51962,_0x451f4f=await _0x71b755[_0x24d4b3(0xda)]['execute'](_0x3e0365,{'catalog':'td','schema':'information_schema','onJobId':_0x448db3=>{const _0x5cc4fb=_0x24d4b3;_0x2e68d9[_0x5cc4fb(0xcd)](_0x448db3);}});return _0x451f4f;},{'verbose':_0x29b951['verbose']}),_0x477b49=_0x11bfb1[_0xa51962(0xd0)],_0x580e79=_0x477b49[_0xa51962(0xe9)]?'\x20[Job\x20ID:\x20'+_0x477b49['jobId']+']':'';return console[_0xa51962(0xf3)](_0xa51962(0xb4)+_0x477b49[_0xa51962(0x106)][_0xa51962(0x9d)][_0xa51962(0xc1)]()+'\x20rows\x20'+('in\x20'+formatElapsed(_0x477b49['stats'][_0xa51962(0xce)])+_0x580e79)),await handleQueryOutput(_0x477b49,_0x29b951),0x0;}catch(_0x39d214){if(_0x39d214 instanceof SDKError)return console[_0xa51962(0xf3)](_0xa51962(0xbc)+_0x39d214[_0xa51962(0x10f)]+']'),console['error']('\x0a'+_0x39d214[_0xa51962(0xc2)]),0x1;throw _0x39d214;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a27_0x25ae30(0xcc);[a27_0x25ae30(0x100)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a27_0x25ae30(0xeb)](_0x19f3de){const _0x11d829=a27_0x25ae30,{options:_0x5af6ca,args:_0x485592,tdx:_0xc931e4}=_0x19f3de;if(_0x485592['length']===0x0)return console[_0x11d829(0xf3)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x11d829(0xf3)](_0x11d829(0xc9)),0x1;const _0x3cc119=_0x485592[0x0];try{_0x5af6ca['verbose']&&(console[_0x11d829(0xf3)](_0x11d829(0x10d)+_0x5af6ca[_0x11d829(0x97)]),console['error']('Parent\x20name:\x20'+_0x3cc119));const _0x1d7c81=await withSpinner(_0x11d829(0xbe)+_0x3cc119+'\x27...',()=>_0xc931e4['segment'][_0x11d829(0xaa)](_0x3cc119),{'verbose':_0x5af6ca['verbose']}),_0x51daab=_0x1d7c81['data'];_0x5af6ca['verbose']&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x51daab);const _0x46a989=await withSpinner(_0x11d829(0x8b)+_0x3cc119+_0x11d829(0xaf),()=>_0xc931e4[_0x11d829(0x91)][_0x11d829(0x8d)](_0x51daab),{'verbose':_0x5af6ca[_0x11d829(0xf9)]}),_0x125d6f=_0x46a989[_0x11d829(0xd0)];return console[_0x11d829(0xf3)](_0x11d829(0xe4)+_0x125d6f[_0x11d829(0xbb)]+_0x11d829(0x72)+(_0x125d6f[_0x11d829(0xbb)]!==0x1?'s':'')),await handleSDKOutput(_0x125d6f,_0x5af6ca),0x0;}catch(_0x242438){if(_0x242438 instanceof SDKError)return console[_0x11d829(0xf3)](_0x11d829(0x90)+_0x242438[_0x11d829(0xc2)]),_0x242438[_0x11d829(0xbf)]&&console[_0x11d829(0xf3)](_0x11d829(0xca)+_0x242438[_0x11d829(0xbf)]),0x1;throw _0x242438;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x25ae30(0xde)]=a27_0x25ae30(0xd3);[a27_0x25ae30(0x100)]=a27_0x25ae30(0xe0);async['execute'](_0x56077c){const _0x5e7368=a27_0x25ae30,{options:_0x133ba9,args:_0x5bee0f,tdx:_0x5b49db}=_0x56077c;if(_0x5bee0f[_0x5e7368(0xbb)]===0x0)return console[_0x5e7368(0xf3)](_0x5e7368(0xcb)),console[_0x5e7368(0xf3)](_0x5e7368(0x94)),0x1;try{const {parentId:_0x1c0a8a,childId:_0x37d658}=parseSegmentRef(_0x5bee0f[0x0]);_0x133ba9[_0x5e7368(0xf9)]&&(console[_0x5e7368(0xf3)](_0x5e7368(0x10d)+_0x133ba9[_0x5e7368(0x97)]),console[_0x5e7368(0xf3)](_0x5e7368(0xdc)+_0x1c0a8a),_0x37d658&&console['error'](_0x5e7368(0xe2)+_0x37d658));if(!_0x37d658)return console[_0x5e7368(0xf3)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x4ea13b=await withSpinner(_0x5e7368(0xbe)+_0x1c0a8a+_0x5e7368(0xaf),()=>_0x5b49db[_0x5e7368(0x91)][_0x5e7368(0xaa)](_0x1c0a8a),{'verbose':_0x133ba9['verbose']}),_0x53559d=_0x4ea13b[_0x5e7368(0xd0)];_0x133ba9[_0x5e7368(0xf9)]&&console['error'](_0x5e7368(0x77)+_0x53559d);const _0x5cd94e=await withSpinner('Resolving\x20folder\x20\x27'+_0x37d658+_0x5e7368(0xaf),()=>_0x5b49db[_0x5e7368(0x91)][_0x5e7368(0x85)](_0x53559d,_0x37d658),{'verbose':_0x133ba9[_0x5e7368(0xf9)]}),_0x50b848=_0x5cd94e[_0x5e7368(0xd0)];_0x133ba9[_0x5e7368(0xf9)]&&console[_0x5e7368(0xf3)](_0x5e7368(0xcf)+_0x50b848);const _0xfc8867=await withSpinner(_0x5e7368(0x89)+_0x37d658+_0x5e7368(0xaf),()=>_0x5b49db[_0x5e7368(0x91)][_0x5e7368(0xf6)](_0x50b848),{'verbose':_0x133ba9['verbose']});return await handleSDKOutput([_0xfc8867[_0x5e7368(0xd0)]],_0x133ba9),0x0;}catch(_0x225e53){if(_0x225e53 instanceof SDKError)return console[_0x5e7368(0xf3)]('Error:\x20'+_0x225e53[_0x5e7368(0xc2)]),_0x225e53[_0x5e7368(0xbf)]&&console[_0x5e7368(0xf3)](_0x5e7368(0xca)+_0x225e53[_0x5e7368(0xbf)]),0x1;throw _0x225e53;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a27_0x25ae30(0x7f);[a27_0x25ae30(0x100)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a27_0x25ae30(0xeb)](_0x193efc){const _0x2e12ff=a27_0x25ae30,{options:_0x5eed5f,args:_0x397048,tdx:_0x20fd05}=_0x193efc,_0x55c78e=_0x397048[0x0];if(!_0x55c78e)return console[_0x2e12ff(0xf3)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x2e12ff(0xf3)](_0x2e12ff(0xfb)),console['error'](_0x2e12ff(0xb9)),console[_0x2e12ff(0xf3)](_0x2e12ff(0x7e)),console['error'](_0x2e12ff(0x79)),console[_0x2e12ff(0xf3)](_0x2e12ff(0xe5)),0x1;try{const _0x27b09e=_0x5eed5f[_0x2e12ff(0xfc)],_0x3b802d=await resolveSegmentTarget(_0x55c78e,_0x27b09e,_0x5eed5f[_0x2e12ff(0xf9)]);_0x5eed5f[_0x2e12ff(0xf9)]&&console[_0x2e12ff(0xf3)](_0x2e12ff(0xc8)+_0x3b802d);const _0x449a02=await withSpinner(_0x2e12ff(0x8c)+_0x55c78e+_0x2e12ff(0xaf),()=>_0x20fd05[_0x2e12ff(0x91)][_0x2e12ff(0xf7)](_0x3b802d),{'verbose':_0x5eed5f[_0x2e12ff(0xf9)]}),_0x1849b3=_0x449a02[_0x2e12ff(0xd0)];_0x5eed5f[_0x2e12ff(0xf9)]&&(console[_0x2e12ff(0xf3)]('Resolved\x20type:\x20'+_0x1849b3[_0x2e12ff(0xf2)]),console[_0x2e12ff(0xf3)]('Parent\x20ID:\x20'+_0x1849b3[_0x2e12ff(0x73)]));if(_0x1849b3[_0x2e12ff(0xf2)]===_0x2e12ff(0xd2))return console[_0x2e12ff(0xf3)](_0x2e12ff(0xb3)),console[_0x2e12ff(0xf3)](_0x2e12ff(0xd8)),0x1;if(_0x1849b3[_0x2e12ff(0xf2)]==='parent')return console[_0x2e12ff(0xf3)](_0x2e12ff(0xb0)),console[_0x2e12ff(0xf3)](_0x2e12ff(0x74)),0x1;if(!_0x1849b3[_0x2e12ff(0x9f)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x238d0a=await withSpinner(_0x2e12ff(0xd6),()=>_0x20fd05[_0x2e12ff(0x91)][_0x2e12ff(0xd4)](_0x1849b3[_0x2e12ff(0x73)],_0x1849b3['segmentId']),{'verbose':_0x5eed5f['verbose']}),_0x520b2c=_0x238d0a[_0x2e12ff(0xd0)];return _0x5eed5f[_0x2e12ff(0xed)]===_0x2e12ff(0x92)||_0x5eed5f['format']===_0x2e12ff(0x7c)?await handleSDKOutput([{'sql':_0x520b2c}],_0x5eed5f):console[_0x2e12ff(0x78)](_0x520b2c),0x0;}catch(_0x537598){if(_0x537598 instanceof SDKError)return console[_0x2e12ff(0xf3)](_0x2e12ff(0x90)+_0x537598[_0x2e12ff(0xc2)]),_0x537598['cause']&&console['error'](_0x2e12ff(0xca)+_0x537598[_0x2e12ff(0xbf)]),0x1;throw _0x537598;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a27_0x25ae30(0xec);['description']=a27_0x25ae30(0xdf);async[a27_0x25ae30(0xeb)](_0x355c24){const _0x36c6f8=a27_0x25ae30,{options:_0x2517d0,args:_0x1b63ae,tdx:_0x3c8c04}=_0x355c24,_0x3fb8a7=_0x2517d0;if(_0x1b63ae[_0x36c6f8(0xbb)]<0x2)return console[_0x36c6f8(0xf3)](_0x36c6f8(0xc5)),console['error'](_0x36c6f8(0xe3)),0x1;const _0x2024a4=_0x1b63ae[0x0],_0x59fdd3=_0x1b63ae[0x1];_0x3fb8a7['verbose']&&(console['error']('Site:\x20'+_0x3fb8a7['site']),console[_0x36c6f8(0xf3)](_0x36c6f8(0x104)+_0x2024a4),console[_0x36c6f8(0xf3)](_0x36c6f8(0xe2)+_0x59fdd3));let _0x38d512;if(_0x3fb8a7['parentFolder']){const _0x397164=_0x3fb8a7[_0x36c6f8(0xe1)],_0x4ee655=await withSpinner(_0x36c6f8(0xbe)+_0x2024a4+_0x36c6f8(0xaf),()=>_0x3c8c04[_0x36c6f8(0x91)][_0x36c6f8(0xaa)](_0x2024a4),{'verbose':_0x3fb8a7[_0x36c6f8(0xf9)]}),_0x5351cb=_0x4ee655[_0x36c6f8(0xd0)],_0x2ff586=await withSpinner(_0x36c6f8(0xc3)+_0x397164+_0x36c6f8(0xaf),()=>_0x3c8c04['segment'][_0x36c6f8(0x85)](_0x5351cb,_0x397164),{'verbose':_0x3fb8a7[_0x36c6f8(0xf9)]});_0x38d512=_0x2ff586['data'],_0x3fb8a7[_0x36c6f8(0xf9)]&&console['error'](_0x36c6f8(0x99)+_0x38d512);}const _0x1d6d99={'name':_0x59fdd3,'description':_0x3fb8a7[_0x36c6f8(0x100)],'parentFolderId':_0x38d512},_0x1dbc51=await withSpinner('Creating\x20folder\x20\x27'+_0x59fdd3+_0x36c6f8(0xaf),()=>_0x3c8c04[_0x36c6f8(0x91)]['createFolder'](_0x2024a4,_0x1d6d99),{'verbose':_0x3fb8a7['verbose']}),_0x47841c=_0x1dbc51[_0x36c6f8(0xd0)];return console[_0x36c6f8(0xf3)](_0x36c6f8(0xb8)+_0x47841c[_0x36c6f8(0xde)]+_0x36c6f8(0x84)+_0x47841c['id']),await handleSDKOutput([_0x47841c],_0x3fb8a7),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']='segment:view';[a27_0x25ae30(0x100)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a27_0x25ae30(0xeb)](_0x11f519){const _0x28ff9e=a27_0x25ae30,{options:_0x146f05,args:_0x98aee2,tdx:_0x157ab5}=_0x11f519,_0x25b83e=_0x98aee2[0x0];if(!_0x25b83e)return console['error'](_0x28ff9e(0xd1)),console[_0x28ff9e(0xf3)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x28ff9e(0xf3)](_0x28ff9e(0x9b)),console['error'](_0x28ff9e(0xa7)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x28ff9e(0xf3)]('Examples:'),console[_0x28ff9e(0xf3)](_0x28ff9e(0xea)),console[_0x28ff9e(0xf3)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x28ff9e(0xf3)](_0x28ff9e(0x9c)),console[_0x28ff9e(0xf3)](_0x28ff9e(0xf8)),0x1;try{const _0x24e1b3=_0x146f05[_0x28ff9e(0xfc)],_0x2ee817=await resolveSegmentTarget(_0x25b83e,_0x24e1b3,_0x146f05[_0x28ff9e(0xf9)]);_0x146f05[_0x28ff9e(0xf9)]&&console[_0x28ff9e(0xf3)]('Target\x20path:\x20'+_0x2ee817);const _0x306278=await withSpinner(_0x28ff9e(0x8c)+_0x25b83e+_0x28ff9e(0xaf),()=>_0x157ab5['segment'][_0x28ff9e(0xf7)](_0x2ee817),{'verbose':_0x146f05[_0x28ff9e(0xf9)]}),_0x4b84a7=_0x306278[_0x28ff9e(0xd0)];_0x146f05[_0x28ff9e(0xf9)]&&(console[_0x28ff9e(0xf3)](_0x28ff9e(0x8e)+_0x4b84a7[_0x28ff9e(0xf2)]),console[_0x28ff9e(0xf3)]('Parent\x20ID:\x20'+_0x4b84a7['parentId']),_0x4b84a7['folderId']&&console[_0x28ff9e(0xf3)](_0x28ff9e(0xc0)+_0x4b84a7[_0x28ff9e(0xb2)]),_0x4b84a7[_0x28ff9e(0x9f)]&&console[_0x28ff9e(0xf3)](_0x28ff9e(0xc4)+_0x4b84a7[_0x28ff9e(0x9f)]));if(_0x146f05[_0x28ff9e(0x9e)]){if(_0x4b84a7['type']==='folder')return console[_0x28ff9e(0xf3)](_0x28ff9e(0xf0)),0x1;if(_0x4b84a7[_0x28ff9e(0xf2)]===_0x28ff9e(0x9a))return console[_0x28ff9e(0xf3)](_0x28ff9e(0xee)),console[_0x28ff9e(0xf3)](_0x28ff9e(0x87)),0x1;if(!_0x4b84a7[_0x28ff9e(0x9f)])throw new SDKError(ErrorCode[_0x28ff9e(0x105)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x35aa64=getConsoleNextUrl(_0x146f05[_0x28ff9e(0x97)],_0x28ff9e(0x8a)+_0x4b84a7[_0x28ff9e(0x73)]+_0x28ff9e(0x7b)+_0x4b84a7[_0x28ff9e(0x9f)]);return console[_0x28ff9e(0xf3)](a27_0x445e51[_0x28ff9e(0xa0)]('βœ”')+_0x28ff9e(0x75)+a27_0x445e51['cyan'](_0x35aa64)),openBrowser(_0x35aa64),0x0;}if(_0x4b84a7[_0x28ff9e(0xf2)]==='folder'){if(!_0x4b84a7[_0x28ff9e(0xb2)])throw new SDKError(ErrorCode[_0x28ff9e(0x10c)],_0x28ff9e(0xe6));const _0xcac6d7=await withSpinner(_0x28ff9e(0x7a),()=>_0x157ab5[_0x28ff9e(0x91)][_0x28ff9e(0xf6)](_0x4b84a7[_0x28ff9e(0xb2)]),{'verbose':_0x146f05[_0x28ff9e(0xf9)]});await handleSingleObjectOutput(_0xcac6d7[_0x28ff9e(0xd0)],_0x146f05);}else{if(_0x4b84a7['type']==='segment'){if(!_0x4b84a7[_0x28ff9e(0x9f)])throw new SDKError(ErrorCode[_0x28ff9e(0x105)],_0x28ff9e(0xba));const _0x4a62d8=await withSpinner(_0x28ff9e(0xa9),()=>_0x157ab5['segment'][_0x28ff9e(0xff)](_0x4b84a7['parentId'],_0x4b84a7[_0x28ff9e(0x9f)]),{'verbose':_0x146f05[_0x28ff9e(0xf9)]}),_0x103970=getConsoleNextUrl(_0x146f05[_0x28ff9e(0x97)],_0x28ff9e(0x8a)+_0x4b84a7[_0x28ff9e(0x73)]+_0x28ff9e(0x7b)+_0x4b84a7[_0x28ff9e(0x9f)]),_0x114ff0=_0x4a62d8['data'];_0x114ff0[_0x28ff9e(0xae)]=_0x103970,await handleSingleObjectOutput(_0x114ff0,_0x146f05);}else return console[_0x28ff9e(0xf3)](_0x28ff9e(0x93)),console[_0x28ff9e(0xf3)](_0x28ff9e(0xd9)),0x1;}return 0x0;}catch(_0x32e877){if(_0x32e877 instanceof SDKError)return console['error']('Error:\x20'+_0x32e877[_0x28ff9e(0xc2)]),_0x32e877[_0x28ff9e(0xbf)]&&console[_0x28ff9e(0xf3)](_0x28ff9e(0xca)+_0x32e877[_0x28ff9e(0xbf)]),0x1;throw _0x32e877;}}}function a27_0x3fbe(_0x4ad724,_0x114042){_0x4ad724=_0x4ad724-0x72;const _0x495b06=a27_0x495b();let _0x3fbe5e=_0x495b06[_0x4ad724];return _0x3fbe5e;}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a27_0x25ae30(0x10b);[a27_0x25ae30(0x100)]=a27_0x25ae30(0x107);async['execute'](_0x5b46da){const _0x561455=a27_0x25ae30,{options:_0x3183b9,args:_0x4a071f,tdx:_0x1cea4f}=_0x5b46da,_0x53432e=_0x4a071f[0x0];if(!_0x53432e)return console['error'](_0x561455(0x96)),console['error'](_0x561455(0x88)),console[_0x561455(0xf3)](_0x561455(0xdd)),console['error'](_0x561455(0x7e)),console[_0x561455(0xf3)](_0x561455(0xa8)),console[_0x561455(0xf3)](_0x561455(0x80)),0x1;try{const _0x1641fe=_0x3183b9[_0x561455(0xfc)],_0x1c1f71=await resolveSegmentTarget(_0x53432e,_0x1641fe,_0x3183b9[_0x561455(0xf9)]);_0x3183b9[_0x561455(0xf9)]&&console[_0x561455(0xf3)]('Target\x20path:\x20'+_0x1c1f71);const _0xd59c93=await withSpinner(_0x561455(0x8c)+_0x53432e+_0x561455(0xaf),()=>_0x1cea4f['segment']['resolvePathToResource'](_0x1c1f71),{'verbose':_0x3183b9[_0x561455(0xf9)]}),_0x3c8650=_0xd59c93[_0x561455(0xd0)];_0x3183b9[_0x561455(0xf9)]&&(console[_0x561455(0xf3)](_0x561455(0x8e)+_0x3c8650[_0x561455(0xf2)]),console['error'](_0x561455(0x101)+_0x3c8650[_0x561455(0x73)]));if(_0x3c8650[_0x561455(0xf2)]==='folder')return console[_0x561455(0xf3)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x561455(0xf3)](_0x561455(0xd8)),0x1;if(_0x3c8650[_0x561455(0xf2)]===_0x561455(0x9a))return console[_0x561455(0xf3)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x561455(0xf3)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x3c8650['segmentId'])throw new SDKError(ErrorCode[_0x561455(0x105)],_0x561455(0xba));const _0x8b2455=await withSpinner(_0x561455(0xd6),()=>_0x1cea4f[_0x561455(0x91)]['getSegmentSQL'](_0x3c8650[_0x561455(0x73)],_0x3c8650[_0x561455(0x9f)]),{'verbose':_0x3183b9[_0x561455(0xf9)]}),_0x308eb5=_0x8b2455[_0x561455(0xd0)],_0x88f158=await executeSchemaQuery(_0x308eb5,_0x1cea4f,_0x3183b9);return await handleQueryOutput(_0x88f158,_0x3183b9),0x0;}catch(_0x19db14){if(_0x19db14 instanceof SDKError)return console[_0x561455(0xf3)](_0x561455(0x90)+_0x19db14['message']),_0x19db14['cause']&&console[_0x561455(0xf3)](_0x561455(0xca)+_0x19db14['cause']),0x1;throw _0x19db14;}}}
1
+ const a27_0x23123a=a27_0x2440;(function(_0x86d2,_0x1a4f48){const _0x22cd66=a27_0x2440,_0x509152=_0x86d2();while(!![]){try{const _0x2ef829=-parseInt(_0x22cd66(0x10f))/0x1+parseInt(_0x22cd66(0x109))/0x2+parseInt(_0x22cd66(0x12c))/0x3+parseInt(_0x22cd66(0x146))/0x4+-parseInt(_0x22cd66(0xff))/0x5*(parseInt(_0x22cd66(0xf2))/0x6)+parseInt(_0x22cd66(0x163))/0x7*(-parseInt(_0x22cd66(0x154))/0x8)+-parseInt(_0x22cd66(0x158))/0x9*(-parseInt(_0x22cd66(0xd7))/0xa);if(_0x2ef829===_0x1a4f48)break;else _0x509152['push'](_0x509152['shift']());}catch(_0x131fd4){_0x509152['push'](_0x509152['shift']());}}}(a27_0x596a,0xbd3d9));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a27_0x1f9cf2 from'chalk';function a27_0x596a(){const _0x1299b3=['3695280tjjeEA','SEGMENT_NOT_FOUND','Folder\x20ID:\x20','stats','Target\x20path:\x20','trim','Show\x20folder\x20or\x20child\x20segment\x20details','segment:folder:create','βœ”\x20Found\x20','Error:\x20Folder\x20reference\x20is\x20required','Folder\x20ID\x20missing\x20from\x20resolved\x20path','createFolder','error','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','8841536lELICq','Create\x20segment\x20folder\x20for\x20organization','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Use:\x20tdx\x20ps\x20show','747eKYooJ','green','Fetching\x20SQL\x20for\x20segment...','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Use:\x20tdx\x20ps\x20sql','length','(root)','execute','Fetching\x20folder\x20details...','INVALID_ARGUMENT','\x20\x20Cause:\x20','7zPMnmK','\x20\x20Folder\x20path:\x20','resolvePathToResource','segment:sql','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolving\x20parent\x20segment\x20\x27','248980TKklGv','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Use:\x20tdx\x20ps\x20view\x20-w','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20view','segment:folder:list','format','jobId','Error:\x20','type','folderPath','Resolving\x20path\x20\x27','verbose','getSegment','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','resolveFolderId','segment:show','in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20sql\x20<name>','Show\x20child\x20segment\x20schema\x20(column\x20types)','segmentId','Resolved\x20folder\x20ID:\x20','20094ibNgOD','getFolder','log','json','Fetching\x20segment\x20details...','segment:folder:show','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Usage:\x20tdx\x20sg\x20show\x20<name>','segment','\x20Opening\x20','\x20\x20Parent\x20segment:\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','895wrmtAQ','segmentPath','segment:desc','resolveParentId','SEGMENT_FOLDER_NOT_FOUND','Creating\x20folder\x20\x27','Site:\x20','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Listing\x20folders\x20for\x20parent\x20\x27','jsonl','304450AzTLeR','setJobId','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Use:\x20tdx\x20ps\x20desc','description','685484zbkjMV','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','message','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Fetching\x20folder\x20\x27','Options:','Error:\x20Path\x20or\x20name\x20is\x20required','name','code','Examples:','/e/','\x20folder','Segment\x20ID:\x20','Parent\x20segment:\x20','\x20\x20Full\x20path:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Executing\x20segment\x20query...','Resolved\x20type:\x20','folder','cause','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Parent\x20ID:\x20','parentSegment','getSegmentSQL','elapsedTimeMillis','site','parentFolder','Folder\x20name:\x20','68091dTMeXk','Get\x20SQL\x20query\x20for\x20child\x20segment','parentId','parent','segment:describe','data','Resolved\x20parent\x20ID:\x20','\x27...','fullPath','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Error:\x20Parent\x20segment\x20name\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','folderId','βœ”\x20Query\x20completed:\x20Processed\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Resolved\x20parent\x20folder\x20ID:\x20','SELECT\x20*\x20FROM\x20(\x0a','Resolving\x20\x27','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','/app/ps/','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','βœ–\x20Query\x20failed\x20[','βœ”\x20Created\x20folder\x20\x27','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment'];a27_0x596a=function(){return _0x1299b3;};return a27_0x596a();}async function resolveSegmentTarget(_0x5ab485,_0x14c96e,_0x258c5f){const _0x1bd448=a27_0x2440;if(isYamlFilePath(_0x5ab485))try{const _0x4bd518=await resolveYamlFilePath(_0x5ab485);return _0x258c5f&&(console[_0x1bd448(0x152)]('Resolved\x20YAML\x20file:\x20'+_0x5ab485),console[_0x1bd448(0x152)](_0x1bd448(0xfd)+_0x4bd518['parentSegment']),console['error']('\x20\x20Segment\x20name:\x20'+_0x4bd518['segmentName']),console[_0x1bd448(0x152)](_0x1bd448(0x164)+(_0x4bd518[_0x1bd448(0xe3)]||_0x1bd448(0x15e))),console['error'](_0x1bd448(0x11d)+_0x4bd518[_0x1bd448(0x134)])),_0x4bd518['fullPath'];}catch(_0xaa6acd){throw new SDKError(ErrorCode[_0x1bd448(0x161)],_0x1bd448(0x123)+_0xaa6acd[_0x1bd448(0x111)]);}if(!_0x14c96e)throw new SDKError(ErrorCode[_0x1bd448(0x161)],_0x1bd448(0x140));return _0x14c96e+'/'+_0x5ab485;}export class SegmentDescribeCommand extends BaseCommand{[a27_0x23123a(0x116)]=a27_0x23123a(0x130);[a27_0x23123a(0x10e)]='Show\x20segment\x20or\x20folder\x20details';async[a27_0x23123a(0x15f)](_0x200877){const _0x56941a=a27_0x23123a,{options:_0x383669,args:_0x466699,tdx:_0x4a30eb}=_0x200877,_0x34c87d=_0x466699[0x0],_0x3364c5=!_0x34c87d&&!!_0x383669[_0x56941a(0x126)],_0x4b0b66=_0x34c87d||_0x383669[_0x56941a(0x126)];if(!_0x4b0b66)return console[_0x56941a(0x152)](_0x56941a(0x115)),console[_0x56941a(0x152)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x56941a(0x152)](_0x56941a(0x118)),console[_0x56941a(0x152)](_0x56941a(0x156)),console[_0x56941a(0x152)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x56941a(0x152)](_0x56941a(0xdb)),0x1;try{const _0x1ee27c=_0x383669[_0x56941a(0x100)];let _0x4175cd=_0x4b0b66;!_0x3364c5&&_0x1ee27c&&!_0x4b0b66['includes']('/')&&(_0x4175cd=_0x1ee27c+'/'+_0x4b0b66,_0x383669['verbose']&&console[_0x56941a(0x152)]('Resolved\x20relative\x20path\x20to:\x20'+_0x4175cd));const _0xa12143=await withSpinner(_0x56941a(0xe4)+_0x4175cd+'\x27...',()=>_0x4a30eb[_0x56941a(0xfb)][_0x56941a(0x165)](_0x4175cd),{'verbose':_0x383669['verbose']}),_0x344a64=_0xa12143['data'];_0x383669[_0x56941a(0xe5)]&&(console['error'](_0x56941a(0x120)+_0x344a64[_0x56941a(0xe2)]),console['error'](_0x56941a(0x125)+_0x344a64[_0x56941a(0x12e)]),_0x344a64[_0x56941a(0x138)]&&console['error']('Folder\x20ID:\x20'+_0x344a64['folderId']),_0x344a64[_0x56941a(0xf0)]&&console[_0x56941a(0x152)]('Segment\x20ID:\x20'+_0x344a64[_0x56941a(0xf0)]));if(_0x344a64[_0x56941a(0xe2)]===_0x56941a(0x12f)){const _0x1ae7e2=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x4a30eb[_0x56941a(0xfb)]['getParent'](_0x344a64[_0x56941a(0x12e)]),{'verbose':_0x383669[_0x56941a(0xe5)]});await handleSingleObjectOutput(_0x1ae7e2[_0x56941a(0x131)],_0x383669);}else{if(_0x344a64[_0x56941a(0xe2)]===_0x56941a(0x121)){if(!_0x344a64[_0x56941a(0x138)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x56941a(0x150));const _0x27dab9=await withSpinner(_0x56941a(0x160),()=>_0x4a30eb[_0x56941a(0xfb)][_0x56941a(0xf3)](_0x344a64[_0x56941a(0x138)]),{'verbose':_0x383669[_0x56941a(0xe5)]});await handleSingleObjectOutput(_0x27dab9[_0x56941a(0x131)],_0x383669);}else{if(_0x344a64[_0x56941a(0xe2)]==='segment'){if(!_0x344a64[_0x56941a(0xf0)])throw new SDKError(ErrorCode[_0x56941a(0x147)],_0x56941a(0x10b));const _0x40ed0d=await withSpinner(_0x56941a(0xf6),()=>_0x4a30eb[_0x56941a(0xfb)][_0x56941a(0xe6)](_0x344a64[_0x56941a(0x12e)],_0x344a64[_0x56941a(0xf0)]),{'verbose':_0x383669[_0x56941a(0xe5)]});await handleSingleObjectOutput(_0x40ed0d[_0x56941a(0x131)],_0x383669);}}}return 0x0;}catch(_0x2eb68c){if(_0x2eb68c instanceof SDKError)return console[_0x56941a(0x152)]('Error:\x20'+_0x2eb68c[_0x56941a(0x111)]),_0x2eb68c[_0x56941a(0x122)]&&console['error'](_0x56941a(0x162)+_0x2eb68c[_0x56941a(0x122)]),0x1;throw _0x2eb68c;}}}export class SegmentShowCommand extends BaseCommand{[a27_0x23123a(0x116)]=a27_0x23123a(0xeb);['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a27_0x23123a(0x15f)](_0x4bbc69){const _0x3fcd86=a27_0x23123a,{options:_0x5155c1,args:_0x3ed98b,tdx:_0x493aa8}=_0x4bbc69,_0x3304ae=_0x3ed98b[0x0];if(!_0x3304ae)return console['error'](_0x3fcd86(0x142)),console[_0x3fcd86(0x152)](_0x3fcd86(0xfa)),console[_0x3fcd86(0x152)](_0x3fcd86(0xe8)),console['error']('Examples:'),console[_0x3fcd86(0x152)](_0x3fcd86(0x106)),console[_0x3fcd86(0x152)](_0x3fcd86(0x110)),0x1;try{const _0x5ecdc1=_0x5155c1[_0x3fcd86(0x126)],_0x1b155a=await resolveSegmentTarget(_0x3304ae,_0x5ecdc1,_0x5155c1[_0x3fcd86(0xe5)]);_0x5155c1['verbose']&&console[_0x3fcd86(0x152)](_0x3fcd86(0x14a)+_0x1b155a);const _0x1dedbb=await withSpinner('Resolving\x20\x27'+_0x3304ae+_0x3fcd86(0x133),()=>_0x493aa8[_0x3fcd86(0xfb)][_0x3fcd86(0x165)](_0x1b155a),{'verbose':_0x5155c1[_0x3fcd86(0xe5)]}),_0x4e6886=_0x1dedbb[_0x3fcd86(0x131)];_0x5155c1['verbose']&&(console[_0x3fcd86(0x152)](_0x3fcd86(0x120)+_0x4e6886[_0x3fcd86(0xe2)]),console[_0x3fcd86(0x152)](_0x3fcd86(0x125)+_0x4e6886[_0x3fcd86(0x12e)]));if(_0x4e6886['type']==='folder')return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x3fcd86(0x152)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x4e6886[_0x3fcd86(0xe2)]==='parent')return console[_0x3fcd86(0x152)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3fcd86(0x152)](_0x3fcd86(0x157)),0x1;if(!_0x4e6886[_0x3fcd86(0xf0)])throw new SDKError(ErrorCode[_0x3fcd86(0x147)],_0x3fcd86(0x10b));const _0x298c4c=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x493aa8[_0x3fcd86(0xfb)][_0x3fcd86(0x127)](_0x4e6886[_0x3fcd86(0x12e)],_0x4e6886['segmentId']),{'verbose':_0x5155c1[_0x3fcd86(0xe5)]});let _0x366741=_0x298c4c['data'];const _0x24810c=resolveLimit(_0x5155c1['limit'],DEFAULT_DISPLAY_LIMIT),_0x2d254e=/\bLIMIT\s+\d+/i['test'](_0x366741);!_0x2d254e&&(_0x366741=_0x366741[_0x3fcd86(0x14b)]()['replace'](/;+$/,''),_0x366741=_0x3fcd86(0x13d)+_0x366741+_0x3fcd86(0x15b)+_0x24810c);_0x5155c1[_0x3fcd86(0xe5)]&&console['error']('SQL\x20query:\x0a'+_0x366741);const _0xde6e84=await withProgressSpinner(_0x3fcd86(0x11f),async _0x4476c3=>{const _0x37f875=_0x3fcd86,_0x4644f3=await _0x493aa8['query'][_0x37f875(0x15f)](_0x366741,{'catalog':'td','schema':'information_schema','onJobId':_0x191d67=>{const _0x375a9f=_0x37f875;_0x4476c3[_0x375a9f(0x10a)](_0x191d67);}});return _0x4644f3;},{'verbose':_0x5155c1['verbose']}),_0x1b4d76=_0xde6e84[_0x3fcd86(0x131)],_0x190373=_0x1b4d76[_0x3fcd86(0xe0)]?'\x20[Job\x20ID:\x20'+_0x1b4d76['jobId']+']':'';return console[_0x3fcd86(0x152)](_0x3fcd86(0x139)+_0x1b4d76['stats']['processedRows']['toLocaleString']()+'\x20rows\x20'+(_0x3fcd86(0xec)+formatElapsed(_0x1b4d76[_0x3fcd86(0x149)][_0x3fcd86(0x128)])+_0x190373)),await handleQueryOutput(_0x1b4d76,_0x5155c1),0x0;}catch(_0x2b25a2){if(_0x2b25a2 instanceof SDKError)return console[_0x3fcd86(0x152)](_0x3fcd86(0x143)+_0x2b25a2[_0x3fcd86(0x117)]+']'),console[_0x3fcd86(0x152)]('\x0a'+_0x2b25a2['message']),0x1;throw _0x2b25a2;}}}function a27_0x2440(_0x526d80,_0x3f38d9){_0x526d80=_0x526d80-0xd7;const _0x596abb=a27_0x596a();let _0x244025=_0x596abb[_0x526d80];return _0x244025;}export class SegmentFolderListCommand extends BaseCommand{[a27_0x23123a(0x116)]=a27_0x23123a(0xde);[a27_0x23123a(0x10e)]=a27_0x23123a(0x145);async[a27_0x23123a(0x15f)](_0x2c1d5e){const _0x46060e=a27_0x23123a,{options:_0x4378ce,args:_0x3e6140,tdx:_0x313159}=_0x2c1d5e;if(_0x3e6140[_0x46060e(0x15d)]===0x0)return console[_0x46060e(0x152)](_0x46060e(0x136)),console['error'](_0x46060e(0x137)),0x1;const _0x34c7aa=_0x3e6140[0x0];try{_0x4378ce[_0x46060e(0xe5)]&&(console[_0x46060e(0x152)](_0x46060e(0x105)+_0x4378ce['site']),console['error']('Parent\x20name:\x20'+_0x34c7aa));const _0x12c284=await withSpinner(_0x46060e(0x168)+_0x34c7aa+'\x27...',()=>_0x313159[_0x46060e(0xfb)][_0x46060e(0x102)](_0x34c7aa),{'verbose':_0x4378ce[_0x46060e(0xe5)]}),_0x2fedc4=_0x12c284['data'];_0x4378ce[_0x46060e(0xe5)]&&console[_0x46060e(0x152)]('Resolved\x20parent\x20ID:\x20'+_0x2fedc4);const _0x506b81=await withSpinner(_0x46060e(0x107)+_0x34c7aa+_0x46060e(0x133),()=>_0x313159[_0x46060e(0xfb)]['listFolders'](_0x2fedc4),{'verbose':_0x4378ce[_0x46060e(0xe5)]}),_0x3f3892=_0x506b81[_0x46060e(0x131)];return console['error'](_0x46060e(0x14e)+_0x3f3892[_0x46060e(0x15d)]+_0x46060e(0x11a)+(_0x3f3892[_0x46060e(0x15d)]!==0x1?'s':'')),await handleSDKOutput(_0x3f3892,_0x4378ce),0x0;}catch(_0x2e9ae8){if(_0x2e9ae8 instanceof SDKError)return console['error'](_0x46060e(0xe1)+_0x2e9ae8['message']),_0x2e9ae8[_0x46060e(0x122)]&&console[_0x46060e(0x152)]('\x20\x20Cause:\x20'+_0x2e9ae8[_0x46060e(0x122)]),0x1;throw _0x2e9ae8;}}}export class SegmentFolderShowCommand extends BaseCommand{[a27_0x23123a(0x116)]=a27_0x23123a(0xf7);[a27_0x23123a(0x10e)]='Show\x20segment\x20folder\x20details';async[a27_0x23123a(0x15f)](_0xe4804e){const _0x217854=a27_0x23123a,{options:_0x13fa7d,args:_0x3c15a6,tdx:_0x1efd9c}=_0xe4804e;if(_0x3c15a6[_0x217854(0x15d)]===0x0)return console[_0x217854(0x152)](_0x217854(0x14f)),console[_0x217854(0x152)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0xca393d,childId:_0x2d9c2a}=parseSegmentRef(_0x3c15a6[0x0]);_0x13fa7d[_0x217854(0xe5)]&&(console[_0x217854(0x152)](_0x217854(0x105)+_0x13fa7d[_0x217854(0x129)]),console[_0x217854(0x152)]('Parent\x20name:\x20'+_0xca393d),_0x2d9c2a&&console[_0x217854(0x152)](_0x217854(0x12b)+_0x2d9c2a));if(!_0x2d9c2a)return console[_0x217854(0x152)](_0x217854(0x135)),0x1;const _0x3de80a=await withSpinner(_0x217854(0x168)+_0xca393d+'\x27...',()=>_0x1efd9c[_0x217854(0xfb)]['resolveParentId'](_0xca393d),{'verbose':_0x13fa7d[_0x217854(0xe5)]}),_0xa2fccf=_0x3de80a[_0x217854(0x131)];_0x13fa7d[_0x217854(0xe5)]&&console[_0x217854(0x152)](_0x217854(0x132)+_0xa2fccf);const _0x25041f=await withSpinner('Resolving\x20folder\x20\x27'+_0x2d9c2a+'\x27...',()=>_0x1efd9c[_0x217854(0xfb)][_0x217854(0xea)](_0xa2fccf,_0x2d9c2a),{'verbose':_0x13fa7d[_0x217854(0xe5)]}),_0x1b908d=_0x25041f[_0x217854(0x131)];_0x13fa7d[_0x217854(0xe5)]&&console[_0x217854(0x152)](_0x217854(0xf1)+_0x1b908d);const _0x42e007=await withSpinner(_0x217854(0x113)+_0x2d9c2a+_0x217854(0x133),()=>_0x1efd9c[_0x217854(0xfb)][_0x217854(0xf3)](_0x1b908d),{'verbose':_0x13fa7d[_0x217854(0xe5)]});return await handleSDKOutput([_0x42e007['data']],_0x13fa7d),0x0;}catch(_0x17668f){if(_0x17668f instanceof SDKError)return console[_0x217854(0x152)]('Error:\x20'+_0x17668f[_0x217854(0x111)]),_0x17668f[_0x217854(0x122)]&&console[_0x217854(0x152)](_0x217854(0x162)+_0x17668f[_0x217854(0x122)]),0x1;throw _0x17668f;}}}export class SegmentSQLCommand extends BaseCommand{[a27_0x23123a(0x116)]=a27_0x23123a(0x166);[a27_0x23123a(0x10e)]=a27_0x23123a(0x12d);async[a27_0x23123a(0x15f)](_0x4f3ed4){const _0x495805=a27_0x23123a,{options:_0x5900a1,args:_0x52999d,tdx:_0x55d3f7}=_0x4f3ed4,_0x3f0c44=_0x52999d[0x0];if(!_0x3f0c44)return console['error'](_0x495805(0x142)),console['error'](_0x495805(0xee)),console[_0x495805(0x152)](_0x495805(0x13a)),console[_0x495805(0x152)](_0x495805(0x118)),console['error'](_0x495805(0xf8)),console[_0x495805(0x152)](_0x495805(0xdc)),0x1;try{const _0x41e82f=_0x5900a1['parentSegment'],_0x4ce53d=await resolveSegmentTarget(_0x3f0c44,_0x41e82f,_0x5900a1[_0x495805(0xe5)]);_0x5900a1[_0x495805(0xe5)]&&console['error']('Target\x20path:\x20'+_0x4ce53d);const _0x498feb=await withSpinner('Resolving\x20\x27'+_0x3f0c44+'\x27...',()=>_0x55d3f7['segment'][_0x495805(0x165)](_0x4ce53d),{'verbose':_0x5900a1[_0x495805(0xe5)]}),_0x15de13=_0x498feb[_0x495805(0x131)];_0x5900a1[_0x495805(0xe5)]&&(console[_0x495805(0x152)](_0x495805(0x120)+_0x15de13[_0x495805(0xe2)]),console[_0x495805(0x152)]('Parent\x20ID:\x20'+_0x15de13[_0x495805(0x12e)]));if(_0x15de13['type']===_0x495805(0x121))return console[_0x495805(0x152)](_0x495805(0xe7)),console[_0x495805(0x152)](_0x495805(0x10c)),0x1;if(_0x15de13[_0x495805(0xe2)]===_0x495805(0x12f))return console[_0x495805(0x152)](_0x495805(0xfe)),console['error'](_0x495805(0x15c)),0x1;if(!_0x15de13[_0x495805(0xf0)])throw new SDKError(ErrorCode[_0x495805(0x147)],_0x495805(0x10b));const _0x87270=await withSpinner(_0x495805(0x15a),()=>_0x55d3f7[_0x495805(0xfb)]['getSegmentSQL'](_0x15de13['parentId'],_0x15de13[_0x495805(0xf0)]),{'verbose':_0x5900a1[_0x495805(0xe5)]}),_0x502e9a=_0x87270['data'];return _0x5900a1[_0x495805(0xdf)]===_0x495805(0xf5)||_0x5900a1[_0x495805(0xdf)]===_0x495805(0x108)?await handleSDKOutput([{'sql':_0x502e9a}],_0x5900a1):console[_0x495805(0xf4)](_0x502e9a),0x0;}catch(_0x1ba833){if(_0x1ba833 instanceof SDKError)return console[_0x495805(0x152)](_0x495805(0xe1)+_0x1ba833[_0x495805(0x111)]),_0x1ba833[_0x495805(0x122)]&&console[_0x495805(0x152)]('\x20\x20Cause:\x20'+_0x1ba833[_0x495805(0x122)]),0x1;throw _0x1ba833;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a27_0x23123a(0x14d);[a27_0x23123a(0x10e)]=a27_0x23123a(0x155);async[a27_0x23123a(0x15f)](_0x19dd84){const _0x264818=a27_0x23123a,{options:_0x343883,args:_0x1a5f9d,tdx:_0x38b8e0}=_0x19dd84,_0x500ac2=_0x343883;if(_0x1a5f9d[_0x264818(0x15d)]<0x2)return console[_0x264818(0x152)](_0x264818(0xd8)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x4b3b01=_0x1a5f9d[0x0],_0x30cf72=_0x1a5f9d[0x1];_0x500ac2[_0x264818(0xe5)]&&(console[_0x264818(0x152)](_0x264818(0x105)+_0x500ac2[_0x264818(0x129)]),console['error'](_0x264818(0x11c)+_0x4b3b01),console[_0x264818(0x152)](_0x264818(0x12b)+_0x30cf72));let _0x525a20;if(_0x500ac2['parentFolder']){const _0x8871d9=_0x500ac2[_0x264818(0x12a)],_0x52aa69=await withSpinner(_0x264818(0x168)+_0x4b3b01+_0x264818(0x133),()=>_0x38b8e0[_0x264818(0xfb)]['resolveParentId'](_0x4b3b01),{'verbose':_0x500ac2[_0x264818(0xe5)]}),_0x29cce4=_0x52aa69[_0x264818(0x131)],_0x239781=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x8871d9+_0x264818(0x133),()=>_0x38b8e0[_0x264818(0xfb)][_0x264818(0xea)](_0x29cce4,_0x8871d9),{'verbose':_0x500ac2['verbose']});_0x525a20=_0x239781[_0x264818(0x131)],_0x500ac2[_0x264818(0xe5)]&&console['error'](_0x264818(0x13c)+_0x525a20);}const _0x440d67={'name':_0x30cf72,'description':_0x500ac2[_0x264818(0x10e)],'parentFolderId':_0x525a20},_0x3ff333=await withSpinner(_0x264818(0x104)+_0x30cf72+'\x27...',()=>_0x38b8e0[_0x264818(0xfb)][_0x264818(0x151)](_0x4b3b01,_0x440d67),{'verbose':_0x500ac2['verbose']}),_0x59e96c=_0x3ff333['data'];return console[_0x264818(0x152)](_0x264818(0x144)+_0x59e96c[_0x264818(0x116)]+'\x27\x20with\x20ID:\x20'+_0x59e96c['id']),await handleSDKOutput([_0x59e96c],_0x500ac2),0x0;}}export class SegmentViewCommand extends BaseCommand{[a27_0x23123a(0x116)]='segment:view';['description']=a27_0x23123a(0x14c);async[a27_0x23123a(0x15f)](_0x345d6d){const _0x377426=a27_0x23123a,{options:_0x45edb5,args:_0x34ba1b,tdx:_0x810f1a}=_0x345d6d,_0x5de029=_0x34ba1b[0x0];if(!_0x5de029)return console[_0x377426(0x152)](_0x377426(0x112)),console['error'](_0x377426(0xf9)),console[_0x377426(0x152)](_0x377426(0xed)),console['error'](_0x377426(0x114)),console['error'](_0x377426(0x124)),console[_0x377426(0x152)](_0x377426(0x118)),console[_0x377426(0x152)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x377426(0x152)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x377426(0x152)](_0x377426(0xe9)),console[_0x377426(0x152)](_0x377426(0x153)),0x1;try{const _0x44838=_0x45edb5[_0x377426(0x126)],_0x3852f0=await resolveSegmentTarget(_0x5de029,_0x44838,_0x45edb5['verbose']);_0x45edb5['verbose']&&console[_0x377426(0x152)](_0x377426(0x14a)+_0x3852f0);const _0x6f0622=await withSpinner(_0x377426(0x13e)+_0x5de029+_0x377426(0x133),()=>_0x810f1a[_0x377426(0xfb)][_0x377426(0x165)](_0x3852f0),{'verbose':_0x45edb5[_0x377426(0xe5)]}),_0x3ed0b6=_0x6f0622[_0x377426(0x131)];_0x45edb5[_0x377426(0xe5)]&&(console['error'](_0x377426(0x120)+_0x3ed0b6['type']),console[_0x377426(0x152)](_0x377426(0x125)+_0x3ed0b6[_0x377426(0x12e)]),_0x3ed0b6['folderId']&&console['error'](_0x377426(0x148)+_0x3ed0b6[_0x377426(0x138)]),_0x3ed0b6[_0x377426(0xf0)]&&console[_0x377426(0x152)](_0x377426(0x11b)+_0x3ed0b6['segmentId']));if(_0x45edb5['web']){if(_0x3ed0b6[_0x377426(0xe2)]===_0x377426(0x121))return console[_0x377426(0x152)](_0x377426(0xd9)),0x1;if(_0x3ed0b6['type']===_0x377426(0x12f))return console[_0x377426(0x152)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x377426(0x152)](_0x377426(0xda)),0x1;if(!_0x3ed0b6[_0x377426(0xf0)])throw new SDKError(ErrorCode[_0x377426(0x147)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2703ad=getConsoleNextUrl(_0x45edb5['site'],'/app/ps/'+_0x3ed0b6[_0x377426(0x12e)]+_0x377426(0x119)+_0x3ed0b6[_0x377426(0xf0)]);return console[_0x377426(0x152)](a27_0x1f9cf2[_0x377426(0x159)]('βœ”')+_0x377426(0xfc)+a27_0x1f9cf2['cyan'](_0x2703ad)),openBrowser(_0x2703ad),0x0;}if(_0x3ed0b6['type']===_0x377426(0x121)){if(!_0x3ed0b6[_0x377426(0x138)])throw new SDKError(ErrorCode[_0x377426(0x103)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x558d48=await withSpinner(_0x377426(0x160),()=>_0x810f1a[_0x377426(0xfb)][_0x377426(0xf3)](_0x3ed0b6[_0x377426(0x138)]),{'verbose':_0x45edb5['verbose']});await handleSingleObjectOutput(_0x558d48['data'],_0x45edb5);}else{if(_0x3ed0b6['type']===_0x377426(0xfb)){if(!_0x3ed0b6[_0x377426(0xf0)])throw new SDKError(ErrorCode[_0x377426(0x147)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4bb2e9=await withSpinner(_0x377426(0xf6),()=>_0x810f1a[_0x377426(0xfb)][_0x377426(0xe6)](_0x3ed0b6[_0x377426(0x12e)],_0x3ed0b6['segmentId']),{'verbose':_0x45edb5[_0x377426(0xe5)]}),_0x5214aa=getConsoleNextUrl(_0x45edb5[_0x377426(0x129)],_0x377426(0x141)+_0x3ed0b6['parentId']+'/e/'+_0x3ed0b6[_0x377426(0xf0)]),_0x3df2f8=_0x4bb2e9[_0x377426(0x131)];_0x3df2f8['url']=_0x5214aa,await handleSingleObjectOutput(_0x3df2f8,_0x45edb5);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x377426(0x152)](_0x377426(0xdd)),0x1;}return 0x0;}catch(_0x4b6f11){if(_0x4b6f11 instanceof SDKError)return console[_0x377426(0x152)](_0x377426(0xe1)+_0x4b6f11[_0x377426(0x111)]),_0x4b6f11['cause']&&console[_0x377426(0x152)](_0x377426(0x162)+_0x4b6f11['cause']),0x1;throw _0x4b6f11;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{['name']=a27_0x23123a(0x101);[a27_0x23123a(0x10e)]=a27_0x23123a(0xef);async[a27_0x23123a(0x15f)](_0x2f854d){const _0x9bcd51=a27_0x23123a,{options:_0x8505d1,args:_0xdb5a6c,tdx:_0x2ad065}=_0x2f854d,_0x5c1b29=_0xdb5a6c[0x0];if(!_0x5c1b29)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x9bcd51(0x13b)),console[_0x9bcd51(0x152)](_0x9bcd51(0x118)),console[_0x9bcd51(0x152)](_0x9bcd51(0x13f)),console[_0x9bcd51(0x152)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x37f0d7=_0x8505d1[_0x9bcd51(0x126)],_0x7d4e24=await resolveSegmentTarget(_0x5c1b29,_0x37f0d7,_0x8505d1[_0x9bcd51(0xe5)]);_0x8505d1[_0x9bcd51(0xe5)]&&console[_0x9bcd51(0x152)](_0x9bcd51(0x14a)+_0x7d4e24);const _0x14f787=await withSpinner(_0x9bcd51(0x13e)+_0x5c1b29+_0x9bcd51(0x133),()=>_0x2ad065['segment'][_0x9bcd51(0x165)](_0x7d4e24),{'verbose':_0x8505d1[_0x9bcd51(0xe5)]}),_0x10ae78=_0x14f787[_0x9bcd51(0x131)];_0x8505d1[_0x9bcd51(0xe5)]&&(console[_0x9bcd51(0x152)](_0x9bcd51(0x120)+_0x10ae78[_0x9bcd51(0xe2)]),console[_0x9bcd51(0x152)]('Parent\x20ID:\x20'+_0x10ae78[_0x9bcd51(0x12e)]));if(_0x10ae78['type']==='folder')return console[_0x9bcd51(0x152)](_0x9bcd51(0x11e)),console[_0x9bcd51(0x152)](_0x9bcd51(0x10c)),0x1;if(_0x10ae78[_0x9bcd51(0xe2)]===_0x9bcd51(0x12f))return console[_0x9bcd51(0x152)](_0x9bcd51(0x167)),console[_0x9bcd51(0x152)](_0x9bcd51(0x10d)),0x1;if(!_0x10ae78[_0x9bcd51(0xf0)])throw new SDKError(ErrorCode[_0x9bcd51(0x147)],_0x9bcd51(0x10b));const _0xfcd915=await withSpinner(_0x9bcd51(0x15a),()=>_0x2ad065['segment']['getSegmentSQL'](_0x10ae78['parentId'],_0x10ae78['segmentId']),{'verbose':_0x8505d1['verbose']}),_0x47c869=_0xfcd915[_0x9bcd51(0x131)],_0x86669d=await executeSchemaQuery(_0x47c869,_0x2ad065,_0x8505d1);return await handleQueryOutput(_0x86669d,_0x8505d1),0x0;}catch(_0xd31b1b){if(_0xd31b1b instanceof SDKError)return console[_0x9bcd51(0x152)](_0x9bcd51(0xe1)+_0xd31b1b['message']),_0xd31b1b[_0x9bcd51(0x122)]&&console['error']('\x20\x20Cause:\x20'+_0xd31b1b[_0x9bcd51(0x122)]),0x1;throw _0xd31b1b;}}}
@@ -1 +1 @@
1
- const a28_0x1fd9f2=a28_0x317d;(function(_0x116b82,_0x568eab){const _0x11c538=a28_0x317d,_0x1b5e86=_0x116b82();while(!![]){try{const _0x490651=parseInt(_0x11c538(0x109))/0x1+parseInt(_0x11c538(0xe8))/0x2+-parseInt(_0x11c538(0x10f))/0x3*(-parseInt(_0x11c538(0x10e))/0x4)+-parseInt(_0x11c538(0xf8))/0x5+-parseInt(_0x11c538(0xf2))/0x6+parseInt(_0x11c538(0xf1))/0x7*(parseInt(_0x11c538(0x107))/0x8)+-parseInt(_0x11c538(0x119))/0x9*(parseInt(_0x11c538(0x108))/0xa);if(_0x490651===_0x568eab)break;else _0x1b5e86['push'](_0x1b5e86['shift']());}catch(_0x48c011){_0x1b5e86['push'](_0x1b5e86['shift']());}}}(a28_0x3a61,0x62763));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a28_0x3a61(){const _0x48c515=['2439132tfVCWU','Segment\x20name:\x20','βœ”\x20Created\x20segment\x20\x27','Site:\x20','verbose','rule','273820Uqbuos','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','includes','site','description','type','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','invisible','Resolving\x20parent\x20segment\x20\x27','Parent\x20path:\x20','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Resolved\x20folder\x20ID:\x20','segment','segments','2176Tuoacs','2150ZAJLQs','788605dPmdfi','Creating\x20segment\x20\x27','kind','Resolved\x20relative\x20path\x20to:\x20','parent','116CjFXee','28374JNGIWN','\x27...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent:\x20','segment:create','yellow','folderId','length','resolveFolderId','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','32895wDuljQ','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','data','error','558150eDYWNY','name','Resolving\x20folder\x20path\x20\x27','folder','Examples:','Resolving\x20folder\x20\x27','\x20\x20\x20Path:\x20','Target\x20path:\x20','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','7938OpvcGL'];a28_0x3a61=function(){return _0x48c515;};return a28_0x3a61();}function a28_0x317d(_0x56e5bb,_0x3ec82d){_0x56e5bb=_0x56e5bb-0xe6;const _0x3a6171=a28_0x3a61();let _0x317d5a=_0x3a6171[_0x56e5bb];return _0x317d5a;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x379b38 from'chalk';export class SegmentCreateCommand extends BaseCommand{['name']=a28_0x1fd9f2(0x113);[a28_0x1fd9f2(0xfc)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0x4e2c39){const _0x32bbbe=a28_0x1fd9f2;console[_0x32bbbe(0xe7)](a28_0x379b38['yellow']('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x32bbbe(0xe7)](a28_0x379b38[_0x32bbbe(0x114)](_0x32bbbe(0xfe)));const {options:_0x2a4290,args:_0x5e9cef,tdx:_0x5371b1}=_0x4e2c39,_0x164af3=_0x2a4290;if(_0x5e9cef[_0x32bbbe(0x116)]===0x0)return console[_0x32bbbe(0xe7)](_0x32bbbe(0x111)),console[_0x32bbbe(0xe7)](_0x32bbbe(0xf0)),console[_0x32bbbe(0xe7)](_0x32bbbe(0xec)),console[_0x32bbbe(0xe7)](_0x32bbbe(0xf9)),console[_0x32bbbe(0xe7)](_0x32bbbe(0x11a)),console[_0x32bbbe(0xe7)](_0x32bbbe(0xff)),0x1;const _0x329609=_0x5e9cef[0x0],_0x8a4339=_0x2a4290['segmentPath'];let _0x501ce6=_0x329609;_0x8a4339&&!_0x329609[_0x32bbbe(0xfa)]('/')&&(_0x501ce6=_0x8a4339+'/'+_0x329609,_0x164af3[_0x32bbbe(0xf6)]&&console[_0x32bbbe(0xe7)](_0x32bbbe(0x10c)+_0x501ce6));const _0x3cbde4=parsePath(_0x501ce6);if(_0x3cbde4[_0x32bbbe(0x106)][_0x32bbbe(0x116)]<0x2)return console['error'](_0x32bbbe(0x103)),console[_0x32bbbe(0xe7)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x37aeed=_0x3cbde4['segments'][0x0],_0x4a5a11=getBaseName(_0x501ce6),_0x1e402e=getParentPath(_0x501ce6);_0x164af3[_0x32bbbe(0xf6)]&&(console[_0x32bbbe(0xe7)](_0x32bbbe(0xf5)+_0x164af3[_0x32bbbe(0xfb)]),console['error'](_0x32bbbe(0xef)+_0x501ce6),console[_0x32bbbe(0xe7)](_0x32bbbe(0x112)+_0x37aeed),console['error'](_0x32bbbe(0xf3)+_0x4a5a11),console[_0x32bbbe(0xe7)](_0x32bbbe(0x102)+_0x1e402e));const _0x4336d8=await withSpinner(_0x32bbbe(0x101)+_0x37aeed+_0x32bbbe(0x110),()=>_0x5371b1[_0x32bbbe(0x105)]['resolveParentId'](_0x37aeed),{'verbose':_0x164af3[_0x32bbbe(0xf6)]}),_0x341d41=_0x4336d8[_0x32bbbe(0xe6)];let _0x3025d4;if(_0x3cbde4[_0x32bbbe(0x106)][_0x32bbbe(0x116)]>0x2){const _0x30a4bb=await withSpinner(_0x32bbbe(0xea)+_0x1e402e+'\x27...',()=>_0x5371b1[_0x32bbbe(0x105)]['resolvePathToResource'](_0x1e402e),{'verbose':_0x164af3['verbose']}),_0x588ee7=_0x30a4bb['data'];if(_0x588ee7[_0x32bbbe(0xfd)]!==_0x32bbbe(0xeb)&&_0x588ee7[_0x32bbbe(0xfd)]!==_0x32bbbe(0x10d))return console[_0x32bbbe(0xe7)](_0x32bbbe(0x118)),0x1;_0x3025d4=_0x588ee7[_0x32bbbe(0x115)];}else{if(_0x164af3['folder']){const _0x5253d8=await withSpinner(_0x32bbbe(0xed)+_0x164af3[_0x32bbbe(0xeb)]+_0x32bbbe(0x110),()=>_0x5371b1[_0x32bbbe(0x105)][_0x32bbbe(0x117)](_0x341d41,_0x164af3['folder']),{'verbose':_0x164af3[_0x32bbbe(0xf6)]});_0x3025d4=_0x5253d8[_0x32bbbe(0xe6)];}}_0x164af3[_0x32bbbe(0xf6)]&&_0x3025d4&&console[_0x32bbbe(0xe7)](_0x32bbbe(0x104)+_0x3025d4);const _0x4ae262=await loadJSONFromOptions(_0x164af3[_0x32bbbe(0xf7)],_0x164af3['ruleFile']),_0x390ffd={'name':_0x4a5a11,'description':_0x164af3[_0x32bbbe(0xfc)],'rule':_0x4ae262,'kind':_0x164af3['kind']!==undefined?parseInt(_0x164af3[_0x32bbbe(0x10b)],0xa):undefined,'isVisible':_0x164af3[_0x32bbbe(0x100)]?![]:undefined,'segmentFolderId':_0x3025d4,'countPopulation':_0x164af3['noCountPopulation']?![]:undefined},_0x557bc0=await withSpinner(_0x32bbbe(0x10a)+_0x4a5a11+_0x32bbbe(0x110),()=>_0x5371b1[_0x32bbbe(0x105)]['createSegment'](_0x341d41,_0x390ffd),{'verbose':_0x164af3[_0x32bbbe(0xf6)]}),_0x1fb616=_0x557bc0['data'];return console[_0x32bbbe(0xe7)](_0x32bbbe(0xf4)+_0x1fb616[_0x32bbbe(0xe9)]+'\x27\x20with\x20ID:\x20'+_0x1fb616['id']),_0x501ce6!==_0x329609&&console[_0x32bbbe(0xe7)](_0x32bbbe(0xee)+_0x501ce6),await handleSDKOutput([_0x1fb616],_0x164af3),0x0;}}
1
+ const a28_0x5a1a1d=a28_0x1cc5;(function(_0x15f563,_0x1cdf3d){const _0x59acb7=a28_0x1cc5,_0x3ae1f3=_0x15f563();while(!![]){try{const _0x398c8f=-parseInt(_0x59acb7(0x18f))/0x1+-parseInt(_0x59acb7(0x168))/0x2*(parseInt(_0x59acb7(0x192))/0x3)+-parseInt(_0x59acb7(0x17b))/0x4+-parseInt(_0x59acb7(0x177))/0x5+parseInt(_0x59acb7(0x16b))/0x6*(parseInt(_0x59acb7(0x193))/0x7)+parseInt(_0x59acb7(0x16d))/0x8+parseInt(_0x59acb7(0x199))/0x9*(parseInt(_0x59acb7(0x197))/0xa);if(_0x398c8f===_0x1cdf3d)break;else _0x3ae1f3['push'](_0x3ae1f3['shift']());}catch(_0x489668){_0x3ae1f3['push'](_0x3ae1f3['shift']());}}}(a28_0x5630,0x9ce14));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a28_0x1cc5(_0x10a0a7,_0x4aeb07){_0x10a0a7=_0x10a0a7-0x167;const _0x5630d7=a28_0x5630();let _0x1cc5cd=_0x5630d7[_0x10a0a7];return _0x1cc5cd;}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a28_0x53fc29 from'chalk';function a28_0x5630(){const _0x4723fe=['segments','12UUuiZa','createSegment','7421424ycoaiu','name','Target\x20path:\x20','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20\x20Path:\x20','segment:create','\x27...','folderId','yellow','2794050CgsDsm','segmentPath','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','segment','1989204lnSTyR','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','description','type','noCountPopulation','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','βœ”\x20Created\x20segment\x20\x27','resolveParentId','Creating\x20segment\x20\x27','Resolving\x20folder\x20path\x20\x27','folder','parent','Resolved\x20folder\x20ID:\x20','Parent:\x20','resolveFolderId','resolvePathToResource','Resolved\x20relative\x20path\x20to:\x20','Examples:','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','642923jxejLa','error','length','57MAvuQm','1732787ZDIAOn','rule','\x27\x20with\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','264830tZLGAE','data','585yrBLXk','site','Site:\x20','84478vzwReV','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'];a28_0x5630=function(){return _0x4723fe;};return a28_0x5630();}export class SegmentCreateCommand extends BaseCommand{[a28_0x5a1a1d(0x16e)]=a28_0x5a1a1d(0x173);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0x456efb){const _0x32120f=a28_0x5a1a1d;console[_0x32120f(0x190)](a28_0x53fc29[_0x32120f(0x176)](_0x32120f(0x179))),console['error'](a28_0x53fc29[_0x32120f(0x176)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x25ee6d,args:_0x4ff9aa,tdx:_0x5dce30}=_0x456efb,_0x50e460=_0x25ee6d;if(_0x4ff9aa[_0x32120f(0x191)]===0x0)return console[_0x32120f(0x190)](_0x32120f(0x171)),console[_0x32120f(0x190)](_0x32120f(0x169)),console[_0x32120f(0x190)](_0x32120f(0x18d)),console[_0x32120f(0x190)](_0x32120f(0x17c)),console[_0x32120f(0x190)](_0x32120f(0x18e)),console[_0x32120f(0x190)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2dd00e=_0x4ff9aa[0x0],_0x16b669=_0x25ee6d[_0x32120f(0x178)];let _0x10c422=_0x2dd00e;_0x16b669&&!_0x2dd00e['includes']('/')&&(_0x10c422=_0x16b669+'/'+_0x2dd00e,_0x50e460[_0x32120f(0x170)]&&console[_0x32120f(0x190)](_0x32120f(0x18c)+_0x10c422));const _0x2b8b73=parsePath(_0x10c422);if(_0x2b8b73['segments'][_0x32120f(0x191)]<0x2)return console[_0x32120f(0x190)](_0x32120f(0x181)),console[_0x32120f(0x190)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x4af717=_0x2b8b73['segments'][0x0],_0x39b70b=getBaseName(_0x10c422),_0x126734=getParentPath(_0x10c422);_0x50e460[_0x32120f(0x170)]&&(console['error'](_0x32120f(0x167)+_0x50e460[_0x32120f(0x19a)]),console[_0x32120f(0x190)](_0x32120f(0x16f)+_0x10c422),console[_0x32120f(0x190)](_0x32120f(0x189)+_0x4af717),console[_0x32120f(0x190)]('Segment\x20name:\x20'+_0x39b70b),console[_0x32120f(0x190)]('Parent\x20path:\x20'+_0x126734));const _0x31fb07=await withSpinner(_0x32120f(0x196)+_0x4af717+_0x32120f(0x174),()=>_0x5dce30[_0x32120f(0x17a)][_0x32120f(0x183)](_0x4af717),{'verbose':_0x50e460[_0x32120f(0x170)]}),_0x39dead=_0x31fb07['data'];let _0x57f991;if(_0x2b8b73[_0x32120f(0x16a)]['length']>0x2){const _0x13cd09=await withSpinner(_0x32120f(0x185)+_0x126734+_0x32120f(0x174),()=>_0x5dce30['segment'][_0x32120f(0x18b)](_0x126734),{'verbose':_0x50e460[_0x32120f(0x170)]}),_0xf5a094=_0x13cd09[_0x32120f(0x198)];if(_0xf5a094[_0x32120f(0x17f)]!==_0x32120f(0x186)&&_0xf5a094[_0x32120f(0x17f)]!==_0x32120f(0x187))return console[_0x32120f(0x190)](_0x32120f(0x17d)),0x1;_0x57f991=_0xf5a094[_0x32120f(0x175)];}else{if(_0x50e460[_0x32120f(0x186)]){const _0x516291=await withSpinner('Resolving\x20folder\x20\x27'+_0x50e460[_0x32120f(0x186)]+'\x27...',()=>_0x5dce30[_0x32120f(0x17a)][_0x32120f(0x18a)](_0x39dead,_0x50e460[_0x32120f(0x186)]),{'verbose':_0x50e460['verbose']});_0x57f991=_0x516291[_0x32120f(0x198)];}}_0x50e460[_0x32120f(0x170)]&&_0x57f991&&console[_0x32120f(0x190)](_0x32120f(0x188)+_0x57f991);const _0x306cd9=await loadJSONFromOptions(_0x50e460[_0x32120f(0x194)],_0x50e460['ruleFile']),_0x3e0aef={'name':_0x39b70b,'description':_0x50e460[_0x32120f(0x17e)],'rule':_0x306cd9,'kind':_0x50e460['kind']!==undefined?parseInt(_0x50e460['kind'],0xa):undefined,'isVisible':_0x50e460['invisible']?![]:undefined,'segmentFolderId':_0x57f991,'countPopulation':_0x50e460[_0x32120f(0x180)]?![]:undefined},_0x16e1b4=await withSpinner(_0x32120f(0x184)+_0x39b70b+'\x27...',()=>_0x5dce30[_0x32120f(0x17a)][_0x32120f(0x16c)](_0x39dead,_0x3e0aef),{'verbose':_0x50e460[_0x32120f(0x170)]}),_0x2c9c25=_0x16e1b4[_0x32120f(0x198)];return console['error'](_0x32120f(0x182)+_0x2c9c25[_0x32120f(0x16e)]+_0x32120f(0x195)+_0x2c9c25['id']),_0x10c422!==_0x2dd00e&&console[_0x32120f(0x190)](_0x32120f(0x172)+_0x10c422),await handleSDKOutput([_0x2c9c25],_0x50e460),0x0;}}
@@ -1 +1 @@
1
- const a29_0x5b50d3=a29_0x1780;function a29_0x1780(_0x17aad6,_0x491eeb){_0x17aad6=_0x17aad6-0x7c;const _0x2513b7=a29_0x2513();let _0x1780b8=_0x2513b7[_0x17aad6];return _0x1780b8;}(function(_0x223fc2,_0x217923){const _0x154ac9=a29_0x1780,_0x5c0d75=_0x223fc2();while(!![]){try{const _0x28b585=parseInt(_0x154ac9(0x80))/0x1*(-parseInt(_0x154ac9(0x8f))/0x2)+parseInt(_0x154ac9(0x94))/0x3*(parseInt(_0x154ac9(0x8b))/0x4)+parseInt(_0x154ac9(0x81))/0x5+-parseInt(_0x154ac9(0x87))/0x6*(parseInt(_0x154ac9(0x85))/0x7)+-parseInt(_0x154ac9(0x82))/0x8+parseInt(_0x154ac9(0x7f))/0x9+-parseInt(_0x154ac9(0x90))/0xa*(-parseInt(_0x154ac9(0x92))/0xb);if(_0x28b585===_0x217923)break;else _0x5c0d75['push'](_0x5c0d75['shift']());}catch(_0x4115d6){_0x5c0d75['push'](_0x5c0d75['shift']());}}}(a29_0x2513,0xee1f9));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a29_0x5b50d3(0x8c)]=a29_0x5b50d3(0x89);[a29_0x5b50d3(0x83)]='List\x20available\x20fields\x20for\x20segmentation';async[a29_0x5b50d3(0x7c)](_0x35f334){const _0x2f7ad6=a29_0x5b50d3,{options:_0x32a424,args:_0x341fbd,tdx:_0x2ed090}=_0x35f334,_0x2a5b12=_0x341fbd[0x0]||_0x32a424[_0x2f7ad6(0x97)];if(!_0x2a5b12)return console[_0x2f7ad6(0x7e)](_0x2f7ad6(0x96)),console[_0x2f7ad6(0x7e)](_0x2f7ad6(0x86)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x32a424[_0x2f7ad6(0x8e)]&&(console[_0x2f7ad6(0x7e)](_0x2f7ad6(0x8d)+_0x32a424[_0x2f7ad6(0x93)]),console[_0x2f7ad6(0x7e)](_0x2f7ad6(0x95)+_0x2a5b12));const _0x4c8082=await withSpinner(_0x2f7ad6(0x88)+_0x2a5b12+'\x27...',()=>_0x2ed090['segment'][_0x2f7ad6(0x8a)](_0x2a5b12),{'verbose':_0x32a424[_0x2f7ad6(0x8e)]}),_0x55a9e4=_0x4c8082[_0x2f7ad6(0x91)];console[_0x2f7ad6(0x7e)](_0x2f7ad6(0x98)+_0x55a9e4[_0x2f7ad6(0x84)]+'\x20field'+(_0x55a9e4[_0x2f7ad6(0x84)]!==0x1?'s':''));if(_0x32a424['json']||_0x32a424[_0x2f7ad6(0x7d)])return await handleSDKOutput(_0x55a9e4,_0x32a424),0x0;return displayFieldsHumanReadable(_0x55a9e4,_0x2a5b12),0x0;}}function a29_0x2513(){const _0x1ac9c7=['segment:fields','listFields','19636PDmCEN','name','Site:\x20','verbose','694TnRktd','37350BPxqZQ','data','1749lIETGQ','site','402dLuxYJ','Parent\x20segment:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','parentSegment','βœ”\x20Found\x20','execute','jsonl','error','8711415NitKFQ','1409CAzkzZ','7585805YnEkCr','11584672mblvCg','description','length','36757akSFxp','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','942viMdeI','Listing\x20fields\x20for\x20\x27'];a29_0x2513=function(){return _0x1ac9c7;};return a29_0x2513();}
1
+ const a29_0x2bc9e2=a29_0x58b1;(function(_0x4a6b8d,_0x20445e){const _0x5172c2=a29_0x58b1,_0x4ff89b=_0x4a6b8d();while(!![]){try{const _0x25dc44=-parseInt(_0x5172c2(0x187))/0x1+-parseInt(_0x5172c2(0x191))/0x2+-parseInt(_0x5172c2(0x19c))/0x3*(-parseInt(_0x5172c2(0x19f))/0x4)+parseInt(_0x5172c2(0x184))/0x5*(parseInt(_0x5172c2(0x19a))/0x6)+parseInt(_0x5172c2(0x182))/0x7*(-parseInt(_0x5172c2(0x19b))/0x8)+-parseInt(_0x5172c2(0x181))/0x9*(parseInt(_0x5172c2(0x198))/0xa)+parseInt(_0x5172c2(0x18d))/0xb;if(_0x25dc44===_0x20445e)break;else _0x4ff89b['push'](_0x4ff89b['shift']());}catch(_0x3758fe){_0x4ff89b['push'](_0x4ff89b['shift']());}}}(a29_0x48ed,0xdb7fc));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a29_0x58b1(_0x40a5d3,_0x31582e){_0x40a5d3=_0x40a5d3-0x180;const _0x48ed98=a29_0x48ed();let _0x58b109=_0x48ed98[_0x40a5d3];return _0x58b109;}function a29_0x48ed(){const _0x48b45a=['5285180pDtBgZ','segment','112074xPxSBe','360bwIsWi','2706OSbyCj','Parent\x20segment:\x20','List\x20available\x20fields\x20for\x20segmentation','4772nvMrJF','execute','9BQJOcv','231756QLScrc','Listing\x20fields\x20for\x20\x27','35HnLHyZ','parentSegment','description','1687988pRgZbj','json','\x20field','segment:fields','βœ”\x20Found\x20','Site:\x20','43827102HcmeRW','jsonl','error','data','1171374MJiSoQ','name','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','length','verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','site'];a29_0x48ed=function(){return _0x48b45a;};return a29_0x48ed();}export class SegmentFieldsCommand extends BaseCommand{[a29_0x2bc9e2(0x192)]=a29_0x2bc9e2(0x18a);[a29_0x2bc9e2(0x186)]=a29_0x2bc9e2(0x19e);async[a29_0x2bc9e2(0x180)](_0x4e5b40){const _0x4cef56=a29_0x2bc9e2,{options:_0x22eea4,args:_0x344e6e,tdx:_0x1b8518}=_0x4e5b40,_0x5142f4=_0x344e6e[0x0]||_0x22eea4[_0x4cef56(0x185)];if(!_0x5142f4)return console[_0x4cef56(0x18f)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error'](_0x4cef56(0x193)),console['error'](_0x4cef56(0x196)),0x1;_0x22eea4[_0x4cef56(0x195)]&&(console[_0x4cef56(0x18f)](_0x4cef56(0x18c)+_0x22eea4[_0x4cef56(0x197)]),console['error'](_0x4cef56(0x19d)+_0x5142f4));const _0x57a3f8=await withSpinner(_0x4cef56(0x183)+_0x5142f4+'\x27...',()=>_0x1b8518[_0x4cef56(0x199)]['listFields'](_0x5142f4),{'verbose':_0x22eea4[_0x4cef56(0x195)]}),_0x588a57=_0x57a3f8[_0x4cef56(0x190)];console[_0x4cef56(0x18f)](_0x4cef56(0x18b)+_0x588a57[_0x4cef56(0x194)]+_0x4cef56(0x189)+(_0x588a57[_0x4cef56(0x194)]!==0x1?'s':''));if(_0x22eea4[_0x4cef56(0x188)]||_0x22eea4[_0x4cef56(0x18e)])return await handleSDKOutput(_0x588a57,_0x22eea4),0x0;return displayFieldsHumanReadable(_0x588a57,_0x5142f4),0x0;}}
@@ -1 +1 @@
1
- function a30_0x29bf(_0xbafe5e,_0x33f427){_0xbafe5e=_0xbafe5e-0xca;const _0x4188fb=a30_0x4188();let _0x29bfac=_0x4188fb[_0xbafe5e];return _0x29bfac;}const a30_0x1bad5b=a30_0x29bf;(function(_0xdfca22,_0x4b2023){const _0x1cbff3=a30_0x29bf,_0xc8dd1d=_0xdfca22();while(!![]){try{const _0x2bde2d=parseInt(_0x1cbff3(0xee))/0x1+parseInt(_0x1cbff3(0x111))/0x2*(parseInt(_0x1cbff3(0x10f))/0x3)+parseInt(_0x1cbff3(0xf7))/0x4*(-parseInt(_0x1cbff3(0xe8))/0x5)+parseInt(_0x1cbff3(0x106))/0x6*(parseInt(_0x1cbff3(0x107))/0x7)+-parseInt(_0x1cbff3(0x100))/0x8*(-parseInt(_0x1cbff3(0xf6))/0x9)+-parseInt(_0x1cbff3(0xd9))/0xa+parseInt(_0x1cbff3(0xf8))/0xb*(-parseInt(_0x1cbff3(0xd1))/0xc);if(_0x2bde2d===_0x4b2023)break;else _0xc8dd1d['push'](_0xc8dd1d['shift']());}catch(_0x2b1fe2){_0xc8dd1d['push'](_0xc8dd1d['shift']());}}}(a30_0x4188,0x49309));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a30_0x4188(){const _0x30f404=['no_parent','parent_segment','utf-8','\x20=\x20','Pulling\x20segments\x20from\x20\x27','Target\x20resource:\x20','9235956Dcazfs','helpText','\x20changed\x20files','name','hasChanges','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','βœ”\x20Pulled\x20','29870XXdunx','\x20\x20Target:\x20','\x0aError:','\x20files\x20to\x20','journeyVersions','\x20\x20πŸ—ΊοΈ\x20\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','verbose','\x20with\x20','Aborted.','repeat','\x20segments','setPhase','dirname','diff','25XEOWwp','parentName','relativePath','isNew','filter','dim','201171yYvPRk','files','βœ”\x20All\x20files\x20are\x20up\x20to\x20date','data','\x20files?','cyan','\x0aChanges\x20to\x20\x27','red','525726hWUaoz','436556EUHNGB','11qPzsRZ','file','counts','βœ”\x20Context\x20set:\x20','yes','session','dryRun','length','80VknHID','error','pullSegments','content','cwd','segment:pull','166728GXNxaJ','77WiFdyy','absolutePath','-\x20no\x20files\x20written','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)','\x20new\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','activations','green','527151sDEqgE','site','6lVXqVp','parentSegment','targetDir','\x20unchanged\x20files','journeys','\x20activations'];a30_0x4188=function(){return _0x30f404;};return a30_0x4188();}import a30_0x55c005 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x53db17 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a30_0x1bad5b(0xd4)]=a30_0x1bad5b(0x105);['description']='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x247391){const _0x577f7b=a30_0x1bad5b,{options:_0x208bbf,args:_0x345def,tdx:_0xc0be11}=_0x247391,_0x280aaf=_0x208bbf,_0x3b9005=await resolveTarget({'arg':_0x345def[0x0],'contextParent':_0x208bbf[_0x577f7b(0x112)],'cwd':process[_0x577f7b(0x104)]()});if(!isSuccessfulResolution(_0x3b9005))return _0x3b9005['errorCode']===_0x577f7b(0xcb)?(console[_0x577f7b(0x101)](a30_0x55c005[_0x577f7b(0xd6)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x577f7b(0x101)](_0x577f7b(0x10a)),console[_0x577f7b(0x101)](_0x577f7b(0x10c)),console[_0x577f7b(0x101)](_0x577f7b(0xd7))):(console[_0x577f7b(0x101)](a30_0x55c005['red']('Error:\x20'+_0x3b9005['message']+'\x0a')),_0x3b9005[_0x577f7b(0xd2)]&&console[_0x577f7b(0x101)](a30_0x55c005[_0x577f7b(0xf3)](_0x3b9005['helpText']))),0x1;const _0x439982=_0x3b9005[_0x577f7b(0xe9)],_0x4eecce=_0x3b9005['targetDir'],_0x19676f=_0x3b9005['type']===_0x577f7b(0xf9)?_0x3b9005['resourceName']:undefined;_0x280aaf[_0x577f7b(0xe0)]&&(console['error']('Site:\x20'+_0x280aaf[_0x577f7b(0x110)]),console['error']('Parent\x20segment:\x20'+_0x439982),_0x19676f&&console[_0x577f7b(0x101)](_0x577f7b(0xd0)+_0x19676f));const _0xfe0427=await withProgressSpinner(_0x577f7b(0xcf)+_0x439982+'\x27...',_0x1b25ba=>_0xc0be11['segment'][_0x577f7b(0x102)](_0x439982,{'targetDir':_0x4eecce,'targetResourceName':_0x19676f,'verbose':_0x280aaf[_0x577f7b(0xe0)],'progress':{'update':_0x100640=>{const _0x53d020=_0x577f7b;_0x1b25ba[_0x53d020(0xe5)](_0x100640),_0x280aaf[_0x53d020(0xe0)]&&console['error']('\x20\x20'+_0x100640);}}}),{'verbose':_0x280aaf[_0x577f7b(0xe0)]}),_0x54c86d=_0xfe0427[_0x577f7b(0xf1)];if(_0x54c86d[_0x577f7b(0xfa)]['segments']===0x0&&_0x54c86d['counts']['journeys']===0x0)return console[_0x577f7b(0x101)](a30_0x55c005[_0x577f7b(0xd6)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x54c86d[_0x577f7b(0xe9)]+'\x27')),0x0;const _0x11ac4f=_0x54c86d[_0x577f7b(0xef)][_0x577f7b(0xec)](_0x5a24b3=>_0x5a24b3[_0x577f7b(0xeb)]),_0x1852f6=_0x54c86d[_0x577f7b(0xef)]['filter'](_0x1710f3=>!_0x1710f3[_0x577f7b(0xeb)]&&_0x1710f3[_0x577f7b(0xd5)]),_0x54b9eb=_0x54c86d[_0x577f7b(0xef)][_0x577f7b(0xec)](_0xd0bf8c=>!_0xd0bf8c[_0x577f7b(0xeb)]&&!_0xd0bf8c[_0x577f7b(0xd5)]);console[_0x577f7b(0x101)]('\x0aPull\x20summary\x20for\x20\x27'+_0x54c86d[_0x577f7b(0xe9)]+'\x27:'),console[_0x577f7b(0x101)]('\x20\x20🎯\x20'+a30_0x55c005[_0x577f7b(0xf3)](_0x54c86d[_0x577f7b(0xfa)]['segments']+_0x577f7b(0xe4))+_0x577f7b(0xe1)+a30_0x55c005['cyan'](_0x54c86d[_0x577f7b(0xfa)][_0x577f7b(0x10d)]+_0x577f7b(0xca)));if(_0x54c86d[_0x577f7b(0xfa)][_0x577f7b(0x115)]>0x0){const _0xc1329d=_0x54c86d[_0x577f7b(0xfa)][_0x577f7b(0xdd)]>_0x54c86d[_0x577f7b(0xfa)]['journeys']?'\x20('+_0x54c86d[_0x577f7b(0xfa)]['journeyVersions']+'\x20versions)':'';console['error'](_0x577f7b(0xde)+a30_0x55c005['cyan'](_0x54c86d['counts']['journeys']+'\x20journeys')+a30_0x55c005['dim'](_0xc1329d));}console[_0x577f7b(0x101)]('\x20\x20'+a30_0x55c005['green']('+\x20'+_0x11ac4f[_0x577f7b(0xff)]+_0x577f7b(0x10b))),console[_0x577f7b(0x101)]('\x20\x20'+a30_0x55c005[_0x577f7b(0xd6)]('~\x20'+_0x1852f6['length']+_0x577f7b(0xd3))),console['error']('\x20\x20'+a30_0x55c005['dim']('=\x20'+_0x54b9eb[_0x577f7b(0xff)]+_0x577f7b(0x114))),console[_0x577f7b(0x101)](_0x577f7b(0xda)+a30_0x55c005[_0x577f7b(0xf3)](_0x54c86d['targetDir'])+'\x0a');if(_0x1852f6[_0x577f7b(0xff)]>0x0)for(const _0x291e6e of _0x1852f6){console[_0x577f7b(0x101)](_0x577f7b(0xf4)+_0x291e6e[_0x577f7b(0xea)]+'\x27:'),console[_0x577f7b(0x101)]('─'[_0x577f7b(0xe3)](0x3c)),console[_0x577f7b(0x101)](_0x291e6e[_0x577f7b(0xe7)]),console['error']('─'['repeat'](0x3c));}if(_0x280aaf[_0x577f7b(0xfe)])return console[_0x577f7b(0x101)](a30_0x55c005[_0x577f7b(0xd6)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x11ac4f[_0x577f7b(0xff)]===0x0&&_0x1852f6[_0x577f7b(0xff)]===0x0)return console[_0x577f7b(0x101)](a30_0x55c005[_0x577f7b(0x10e)](_0x577f7b(0xf0))),saveSessionContext({'parent_segment':_0x54c86d[_0x577f7b(0xe9)]},_0x280aaf[_0x577f7b(0xfd)]),console[_0x577f7b(0x101)](a30_0x55c005[_0x577f7b(0x10e)](_0x577f7b(0xfb)+a30_0x55c005[_0x577f7b(0xed)](_0x577f7b(0xcc))+_0x577f7b(0xce)+a30_0x55c005[_0x577f7b(0xf3)](_0x54c86d[_0x577f7b(0xe9)]))),0x0;if(!_0x280aaf[_0x577f7b(0xfc)]){if(!isInteractive())return console[_0x577f7b(0x101)](a30_0x55c005[_0x577f7b(0xf5)](_0x577f7b(0xdb)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x577f7b(0x101)](a30_0x55c005[_0x577f7b(0xed)](_0x577f7b(0xdf))),0x1;const _0x2830a8=await confirmKey('Write\x20'+(_0x11ac4f[_0x577f7b(0xff)]+_0x1852f6[_0x577f7b(0xff)])+_0x577f7b(0xf2));if(!_0x2830a8)return console['error'](a30_0x55c005[_0x577f7b(0xd6)](_0x577f7b(0xe2)),_0x577f7b(0x109)),0x1;}for(const _0x330825 of _0x54c86d[_0x577f7b(0xef)]){if(_0x330825['isNew']||_0x330825[_0x577f7b(0xd5)]){const _0x5ab365=a30_0x53db17[_0x577f7b(0xe6)](_0x330825[_0x577f7b(0x108)]);!existsSync(_0x5ab365)&&mkdirSync(_0x5ab365,{'recursive':!![]}),writeFileSync(_0x330825['absolutePath'],_0x330825[_0x577f7b(0x103)],_0x577f7b(0xcd));}}return console[_0x577f7b(0x101)](a30_0x55c005['green'](_0x577f7b(0xd8)+(_0x11ac4f[_0x577f7b(0xff)]+_0x1852f6[_0x577f7b(0xff)])+_0x577f7b(0xdc)+_0x54c86d[_0x577f7b(0x113)])),saveSessionContext({'parent_segment':_0x54c86d[_0x577f7b(0xe9)]},_0x280aaf[_0x577f7b(0xfd)]),console[_0x577f7b(0x101)](a30_0x55c005[_0x577f7b(0x10e)](_0x577f7b(0xfb)+a30_0x55c005[_0x577f7b(0xed)](_0x577f7b(0xcc))+'\x20=\x20'+a30_0x55c005[_0x577f7b(0xf3)](_0x54c86d[_0x577f7b(0xe9)]))),0x0;}}
1
+ const a30_0x2542ec=a30_0x2913;function a30_0x36fa(){const _0x5448e7=['\x20versions)','55913MHSfaZ','6087288fmfsoM','parentSegment','utf-8','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','no_parent','hasChanges','segment:pull','error','site','\x20\x20Target:\x20','Aborted.','setPhase','1958313ZyAHEP','dim','40412iXFtDS','segments','parent_segment','segment','dryRun','verbose','-\x20no\x20files\x20written','name','cwd','152KyqDhr','Site:\x20','1470hcCJMe','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','absolutePath','\x0aError:','βœ”\x20Context\x20set:\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','dirname','\x20new\x20files','length','\x20files\x20to\x20','red','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','yellow','file','\x0aPull\x20summary\x20for\x20\x27','journeys','relativePath','targetDir','\x20with\x20','29071NYkfFK','errorCode','pullSegments','type','repeat','\x20journeys','filter','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Parent\x20segment:\x20','yes','\x20=\x20','Error:\x20','\x20\x20πŸ—ΊοΈ\x20\x20','\x20activations','\x20changed\x20files','\x20unchanged\x20files','\x20\x20🎯\x20','cyan','execute','55fwXLez','resourceName','files','journeyVersions','15076NgRcvL','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','counts','green','760TZQqSE','data','isNew','diff','9478809yVyTLQ','content','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Write\x20'];a30_0x36fa=function(){return _0x5448e7;};return a30_0x36fa();}(function(_0x20b63f,_0x170f1a){const _0x30951f=a30_0x2913,_0x240dd2=_0x20b63f();while(!![]){try{const _0x357e=-parseInt(_0x30951f(0x17b))/0x1*(parseInt(_0x30951f(0x1a9))/0x2)+parseInt(_0x30951f(0x1c3))/0x3+-parseInt(_0x30951f(0x1c5))/0x4*(-parseInt(_0x30951f(0x1a5))/0x5)+parseInt(_0x30951f(0x17d))/0x6*(parseInt(_0x30951f(0x192))/0x7)+parseInt(_0x30951f(0x1b7))/0x8+-parseInt(_0x30951f(0x1b1))/0x9+parseInt(_0x30951f(0x1ad))/0xa*(parseInt(_0x30951f(0x1b6))/0xb);if(_0x357e===_0x170f1a)break;else _0x240dd2['push'](_0x240dd2['shift']());}catch(_0x3be1fc){_0x240dd2['push'](_0x240dd2['shift']());}}}(a30_0x36fa,0xb221f));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a30_0x2913(_0x4f3512,_0x4e396a){_0x4f3512=_0x4f3512-0x179;const _0x36facb=a30_0x36fa();let _0x291335=_0x36facb[_0x4f3512];return _0x291335;}import a30_0x2032e7 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a30_0x45aab3 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a30_0x2542ec(0x179)]=a30_0x2542ec(0x1bd);['description']=a30_0x2542ec(0x1ba);async[a30_0x2542ec(0x1a4)](_0x5517f1){const _0x410333=a30_0x2542ec,{options:_0x1963ad,args:_0x51311e,tdx:_0xea01ee}=_0x5517f1,_0x3c460d=_0x1963ad,_0x18d9eb=await resolveTarget({'arg':_0x51311e[0x0],'contextParent':_0x1963ad[_0x410333(0x1b8)],'cwd':process[_0x410333(0x17a)]()});if(!isSuccessfulResolution(_0x18d9eb))return _0x18d9eb[_0x410333(0x193)]===_0x410333(0x1bb)?(console[_0x410333(0x1be)](a30_0x2032e7[_0x410333(0x18b)](_0x410333(0x18a))),console[_0x410333(0x1be)](_0x410333(0x182)),console[_0x410333(0x1be)](_0x410333(0x1b3)),console[_0x410333(0x1be)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x410333(0x1be)](a30_0x2032e7['red'](_0x410333(0x19d)+_0x18d9eb['message']+'\x0a')),_0x18d9eb['helpText']&&console[_0x410333(0x1be)](a30_0x2032e7['cyan'](_0x18d9eb['helpText']))),0x1;const _0x184d62=_0x18d9eb[_0x410333(0x189)],_0x193763=_0x18d9eb[_0x410333(0x190)],_0x49c8a4=_0x18d9eb[_0x410333(0x195)]===_0x410333(0x18c)?_0x18d9eb[_0x410333(0x1a6)]:undefined;_0x3c460d[_0x410333(0x1ca)]&&(console[_0x410333(0x1be)](_0x410333(0x17c)+_0x3c460d[_0x410333(0x1bf)]),console['error'](_0x410333(0x19a)+_0x184d62),_0x49c8a4&&console[_0x410333(0x1be)]('Target\x20resource:\x20'+_0x49c8a4));const _0x13ac36=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x184d62+'\x27...',_0x2acf4d=>_0xea01ee[_0x410333(0x1c8)][_0x410333(0x194)](_0x184d62,{'targetDir':_0x193763,'targetResourceName':_0x49c8a4,'verbose':_0x3c460d[_0x410333(0x1ca)],'progress':{'update':_0x3bd50a=>{const _0x210681=_0x410333;_0x2acf4d[_0x210681(0x1c2)](_0x3bd50a),_0x3c460d['verbose']&&console[_0x210681(0x1be)]('\x20\x20'+_0x3bd50a);}}}),{'verbose':_0x3c460d[_0x410333(0x1ca)]}),_0x287b68=_0x13ac36[_0x410333(0x1ae)];if(_0x287b68[_0x410333(0x1ab)][_0x410333(0x1c6)]===0x0&&_0x287b68[_0x410333(0x1ab)][_0x410333(0x18e)]===0x0)return console[_0x410333(0x1be)](a30_0x2032e7[_0x410333(0x18b)](_0x410333(0x1aa)+_0x287b68[_0x410333(0x189)]+'\x27')),0x0;const _0x3d22c7=_0x287b68[_0x410333(0x1a7)][_0x410333(0x198)](_0x12b8ea=>_0x12b8ea['isNew']),_0x38e71e=_0x287b68['files']['filter'](_0x16d64a=>!_0x16d64a[_0x410333(0x1af)]&&_0x16d64a[_0x410333(0x1bc)]),_0x122ecf=_0x287b68[_0x410333(0x1a7)][_0x410333(0x198)](_0x371821=>!_0x371821['isNew']&&!_0x371821[_0x410333(0x1bc)]);console[_0x410333(0x1be)](_0x410333(0x18d)+_0x287b68['parentName']+'\x27:'),console[_0x410333(0x1be)](_0x410333(0x1a2)+a30_0x2032e7[_0x410333(0x1a3)](_0x287b68[_0x410333(0x1ab)]['segments']+'\x20segments')+_0x410333(0x191)+a30_0x2032e7[_0x410333(0x1a3)](_0x287b68[_0x410333(0x1ab)]['activations']+_0x410333(0x19f)));if(_0x287b68[_0x410333(0x1ab)][_0x410333(0x18e)]>0x0){const _0x3cffdb=_0x287b68[_0x410333(0x1ab)]['journeyVersions']>_0x287b68['counts'][_0x410333(0x18e)]?'\x20('+_0x287b68['counts'][_0x410333(0x1a8)]+_0x410333(0x1b5):'';console[_0x410333(0x1be)](_0x410333(0x19e)+a30_0x2032e7[_0x410333(0x1a3)](_0x287b68[_0x410333(0x1ab)]['journeys']+_0x410333(0x197))+a30_0x2032e7[_0x410333(0x1c4)](_0x3cffdb));}console[_0x410333(0x1be)]('\x20\x20'+a30_0x2032e7[_0x410333(0x1ac)]('+\x20'+_0x3d22c7['length']+_0x410333(0x184))),console[_0x410333(0x1be)]('\x20\x20'+a30_0x2032e7[_0x410333(0x18b)]('~\x20'+_0x38e71e[_0x410333(0x185)]+_0x410333(0x1a0))),console[_0x410333(0x1be)]('\x20\x20'+a30_0x2032e7[_0x410333(0x1c4)]('=\x20'+_0x122ecf[_0x410333(0x185)]+_0x410333(0x1a1))),console[_0x410333(0x1be)](_0x410333(0x1c0)+a30_0x2032e7[_0x410333(0x1a3)](_0x287b68['targetDir'])+'\x0a');if(_0x38e71e['length']>0x0)for(const _0x52030d of _0x38e71e){console[_0x410333(0x1be)]('\x0aChanges\x20to\x20\x27'+_0x52030d[_0x410333(0x18f)]+'\x27:'),console[_0x410333(0x1be)]('─'[_0x410333(0x196)](0x3c)),console[_0x410333(0x1be)](_0x52030d[_0x410333(0x1b0)]),console[_0x410333(0x1be)]('─'[_0x410333(0x196)](0x3c));}if(_0x3c460d[_0x410333(0x1c9)])return console[_0x410333(0x1be)](a30_0x2032e7[_0x410333(0x18b)](_0x410333(0x188))),0x0;if(_0x3d22c7[_0x410333(0x185)]===0x0&&_0x38e71e[_0x410333(0x185)]===0x0)return console[_0x410333(0x1be)](a30_0x2032e7[_0x410333(0x1ac)]('βœ”\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x287b68[_0x410333(0x189)]},_0x3c460d['session']),console[_0x410333(0x1be)](a30_0x2032e7[_0x410333(0x1ac)](_0x410333(0x181)+a30_0x2032e7['dim'](_0x410333(0x1c7))+_0x410333(0x19c)+a30_0x2032e7[_0x410333(0x1a3)](_0x287b68['parentName']))),0x0;if(!_0x3c460d[_0x410333(0x19b)]){if(!isInteractive())return console[_0x410333(0x1be)](a30_0x2032e7[_0x410333(0x187)](_0x410333(0x180)),_0x410333(0x199)),console[_0x410333(0x1be)](a30_0x2032e7[_0x410333(0x1c4)](_0x410333(0x17e))),0x1;const _0x3a1780=await confirmKey(_0x410333(0x1b4)+(_0x3d22c7['length']+_0x38e71e[_0x410333(0x185)])+'\x20files?');if(!_0x3a1780)return console[_0x410333(0x1be)](a30_0x2032e7[_0x410333(0x18b)](_0x410333(0x1c1)),_0x410333(0x1cb)),0x1;}for(const _0x491724 of _0x287b68[_0x410333(0x1a7)]){if(_0x491724[_0x410333(0x1af)]||_0x491724[_0x410333(0x1bc)]){const _0x49d6c4=a30_0x45aab3[_0x410333(0x183)](_0x491724[_0x410333(0x17f)]);!existsSync(_0x49d6c4)&&mkdirSync(_0x49d6c4,{'recursive':!![]}),writeFileSync(_0x491724['absolutePath'],_0x491724[_0x410333(0x1b2)],_0x410333(0x1b9));}}return console[_0x410333(0x1be)](a30_0x2032e7[_0x410333(0x1ac)]('βœ”\x20Pulled\x20'+(_0x3d22c7[_0x410333(0x185)]+_0x38e71e[_0x410333(0x185)])+_0x410333(0x186)+_0x287b68[_0x410333(0x190)])),saveSessionContext({'parent_segment':_0x287b68[_0x410333(0x189)]},_0x3c460d['session']),console[_0x410333(0x1be)](a30_0x2032e7['green'](_0x410333(0x181)+a30_0x2032e7[_0x410333(0x1c4)]('parent_segment')+_0x410333(0x19c)+a30_0x2032e7[_0x410333(0x1a3)](_0x287b68['parentName']))),0x0;}}
@@ -1 +1 @@
1
- const a31_0x51bdda=a31_0x1dfa;(function(_0x2747de,_0x4c81ff){const _0x5c1e07=a31_0x1dfa,_0x1a1b4b=_0x2747de();while(!![]){try{const _0x54f406=parseInt(_0x5c1e07(0xdd))/0x1+parseInt(_0x5c1e07(0xdc))/0x2+-parseInt(_0x5c1e07(0x12e))/0x3+-parseInt(_0x5c1e07(0x11e))/0x4*(-parseInt(_0x5c1e07(0xf4))/0x5)+-parseInt(_0x5c1e07(0xad))/0x6*(-parseInt(_0x5c1e07(0xdf))/0x7)+parseInt(_0x5c1e07(0x103))/0x8+-parseInt(_0x5c1e07(0x11f))/0x9*(parseInt(_0x5c1e07(0x13c))/0xa);if(_0x54f406===_0x4c81ff)break;else _0x1a1b4b['push'](_0x1a1b4b['shift']());}catch(_0x326918){_0x1a1b4b['push'](_0x1a1b4b['shift']());}}}(a31_0x1c52,0xabb5c));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a31_0x1dfa(_0xdea830,_0xb5abbc){_0xdea830=_0xdea830-0xa2;const _0x1c529b=a31_0x1c52();let _0x1dfab1=_0x1c529b[_0xdea830];return _0x1dfab1;}import a31_0x20b4d7 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a31_0x1c52(){const _0x45591b=['join','\x0aValidation\x20failed:','No\x20','green','\x20updated','\x20to\x20create','no_parent','versionNumber','Delete\x20segment:','file','activations','cyan','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','created','4yQzveS','219384dpuXyv','dim','\x20to\x20update','nameToType','verbose','parentName','set','idToName','then','data','add','segment\x20or\x20journey','Push\x20','site','\x0aPush\x20summary\x20for\x20\x27','1129542XcMjzC','Error:\x20Directory\x20not\x20found:\x20','\x0aβœ”\x20Push\x20complete','Fetching\x20existing\x20activations...','\x20new','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Resolving\x20parent\x20segment\x20\x27','delete','audienceId','\x20activations]','Aborted.','existingJourney','length','nameToId','860YVdaZj','\x20\x20πŸ“Š\x20Segments:','description','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','.yml','journey','name','changed','parentFolder','listActivations','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20to\x20delete','\x20YAML\x20files\x20found','list','162jfUqbo','getParent','\x20\x20Segments:\x20','Scoped\x20to\x20folder:\x20','map','diff','toCreate','New\x20segment:','updatedAt','push','\x20created','Fetching\x20users\x20for\x20email\x20resolution...','message','\x0aError:','listFolders','\x20changes?','journeyId','isNew','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','πŸ“\x20','unchanged','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','listSegments','Fetching\x20connections\x20for\x20name\x20resolution...','Site:\x20','\x20deleted','helpText','journeyBundleName','New\x20journey:','setPhase','Fetching\x20existing\x20journeys...','Preparing\x20journeys...','Changes\x20to:','/app/ps/','Source\x20directory:\x20','Delete\x20journey:','\x20\x20Activations:','endsWith','folders','Error\x20parsing\x20YAML:\x20','blue','Fetching\x20parent\x20segment\x20details...','/j/da/je','cwd','Fetching\x20existing\x20folders...','toUpdate','filter','2666496NGziCz','387506Bvkldp','journeys','65737gHSrwR','folderPath','parent_name','isScoped','getJourney','error','get','deleted','toDelete','updated','new','journeysOnly','Folders\x20to\x20create:','Error:\x20','connection','yes','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','listJourneysWithDetailsFromParentSegment','folderId','\x20\x20\x20\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','3077495qmcjvf','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20changed','segment','journeyBundleId','\x20\x20Journeys:\x20','/e/','repeat','attributes','yellow','user','getOutputSchemaWithCache','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','all','4690912zFLtIk','createdSegmentIds','Changes\x20to\x20journey:','results','segments','targetDir','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Fetching\x20existing\x20segments...','toString','segment:push','yamlConfig','red','type'];a31_0x1c52=function(){return _0x45591b;};return a31_0x1c52();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x51bdda(0xa5)]=a31_0x51bdda(0x10c);['description']=a31_0x51bdda(0xbf);async['execute'](_0x143e10){const _0x37da41=a31_0x51bdda,{options:_0x19179e,args:_0x54846,tdx:_0x5f0409}=_0x143e10,_0x14a18f=_0x19179e,_0x4fde10=await resolveTarget({'arg':_0x54846[0x0],'contextParent':_0x19179e['parentSegment'],'cwd':process[_0x37da41(0xd8)]()});if(!isSuccessfulResolution(_0x4fde10))return _0x4fde10['errorCode']===_0x37da41(0x116)?(console['error'](a31_0x20b4d7[_0x37da41(0xfe)](_0x37da41(0x109))),console[_0x37da41(0xe4)]('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['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x37da41(0xe4)](_0x37da41(0xf6))):(console[_0x37da41(0xe4)](a31_0x20b4d7['red'](_0x37da41(0xec)+_0x4fde10[_0x37da41(0xb9)]+'\x0a')),_0x4fde10[_0x37da41(0xc7)]&&console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x11b)](_0x4fde10['helpText']))),0x1;if(_0x4fde10[_0x37da41(0x10f)]===_0x37da41(0xe1))return console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x10e)](_0x37da41(0x12f)+_0x4fde10['targetDir']+'\x0a')),console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x11b)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x4a96c5=_0x4fde10[_0x37da41(0x124)],_0x1f8e42=_0x4fde10[_0x37da41(0x108)],_0x124299=_0x4fde10[_0x37da41(0x10f)]===_0x37da41(0x119)?_0x4fde10['filePath']:undefined,_0x3c79e6=getScopedDetails(_0x4fde10),_0x23065f=_0x3c79e6?.[_0x37da41(0xe2)]??![],_0x1788b2=_0x3c79e6?.['scopedFolderPath']??'';if(!existsSync(_0x1f8e42))return console[_0x37da41(0xe4)](a31_0x20b4d7['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x1f8e42+'\x0a')),console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x11b)](_0x37da41(0x11c))),0x1;_0x14a18f['verbose']&&(console[_0x37da41(0xe4)](_0x37da41(0xc5)+_0x14a18f[_0x37da41(0x12c)]),console['error']('Parent\x20segment:\x20'+_0x4a96c5),console[_0x37da41(0xe4)](_0x37da41(0xcf)+_0x1f8e42),_0x23065f&&console['error'](_0x37da41(0xb0)+_0x1788b2));const _0x21c415=await withSpinner(_0x37da41(0x134)+_0x4a96c5+'\x27...',()=>_0x5f0409[_0x37da41(0xf8)]['resolveParentId'](_0x4a96c5),{'verbose':_0x14a18f[_0x37da41(0x123)]}),_0x354beb=_0x21c415[_0x37da41(0x128)],[_0x59832c,_0x1a2ca8,_0x4ca614,_0x3df055,_0x5ebfca]=await Promise['all']([withSpinner(_0x37da41(0xd6),()=>_0x5f0409[_0x37da41(0xf8)][_0x37da41(0xae)](_0x354beb),{'verbose':_0x14a18f['verbose']}),withSpinner(_0x37da41(0x10a),()=>_0x5f0409['segment'][_0x37da41(0xc3)](_0x354beb),{'verbose':_0x14a18f[_0x37da41(0x123)]}),withSpinner(_0x37da41(0xd9),()=>_0x5f0409[_0x37da41(0xf8)][_0x37da41(0xbb)](_0x354beb),{'verbose':_0x14a18f[_0x37da41(0x123)]}),withSpinner(_0x37da41(0xcb),()=>_0x5f0409[_0x37da41(0xa4)][_0x37da41(0xf0)](_0x354beb,{'includeAllVersions':!![]}),{'verbose':_0x14a18f[_0x37da41(0x123)]}),withSpinner(_0x37da41(0xb8),()=>_0x5f0409[_0x37da41(0xff)]['buildUserMaps'](),{'verbose':_0x14a18f[_0x37da41(0x123)]})[_0x37da41(0x127)](_0x41e2ae=>_0x41e2ae[_0x37da41(0x128)])]),_0x5b7ad8=_0x59832c[_0x37da41(0x128)],_0xb0bbaf=extractRootFolderId(_0x5b7ad8),_0x3b1d91=_0x1a2ca8[_0x37da41(0x128)],_0x357d8a=_0x4ca614[_0x37da41(0x128)],{journeys:_0x47863b,activationStepsById:_0x4ae488}=_0x3df055[_0x37da41(0x128)],_0x29ec77=new Map(_0x47863b[_0x37da41(0xb1)](_0x2a1a4c=>[_0x2a1a4c['id'],_0x2a1a4c])),_0x3a2854=_0x47863b['map'](_0x4f12e8=>({'id':_0x4f12e8['id'],'name':_0x4f12e8[_0x37da41(0xfd)][_0x37da41(0xa5)],'journeyBundleName':_0x4f12e8[_0x37da41(0xfd)][_0x37da41(0xc8)]||'','journeyBundleId':_0x4f12e8[_0x37da41(0xfd)][_0x37da41(0xf9)]||'','versionNumber':_0x4f12e8[_0x37da41(0xfd)][_0x37da41(0x117)],'description':_0x4f12e8[_0x37da41(0xfd)][_0x37da41(0x13e)],'state':_0x4f12e8[_0x37da41(0xfd)]['state'],'paused':_0x4f12e8[_0x37da41(0xfd)]['paused'],'audienceId':_0x4f12e8[_0x37da41(0xfd)][_0x37da41(0x136)],'folderId':_0x4f12e8['relationships']?.[_0x37da41(0xa7)]?.[_0x37da41(0x128)]?.['id'],'createdAt':_0x4f12e8[_0x37da41(0xfd)]['createdAt'],'updatedAt':_0x4f12e8[_0x37da41(0xfd)][_0x37da41(0xb5)]})),{emailToId:_0x2769bf,idToEmail:_0x5c1034}=_0x5ebfca,_0xfb9bd7=await withSpinner(_0x37da41(0xc4),async()=>{const _0x2ed4e4=_0x37da41,_0x230ebf=await _0x5f0409[_0x2ed4e4(0xed)][_0x2ed4e4(0xac)]();return buildConnectionMaps(_0x230ebf);},{'verbose':_0x14a18f[_0x37da41(0x123)]})[_0x37da41(0x127)](_0x49b285=>_0x49b285['data']),_0x192b9b=_0xfb9bd7[_0x37da41(0x13b)],_0x5d1c50=_0xfb9bd7[_0x37da41(0x126)],_0x4f9527=_0xfb9bd7[_0x37da41(0x122)],_0x4a4301={'emailToIdMap':_0x2769bf,'connectionNameToIdMap':_0x192b9b,'connectionNameToTypeMap':_0x4f9527,'getSchema':_0x3ca957=>_0x5f0409[_0x37da41(0xed)][_0x37da41(0x100)](_0x3ca957)};let {pathToId:_0x4ca961,idToPath:_0x3e0951}=buildFolderMaps(_0x357d8a);const _0x3a7d08=buildSegmentLookupMap(_0x3b1d91,_0x3e0951),_0x5293c5=buildSegmentNameToIdMap(_0x3b1d91),_0x339ea2=buildJourneyBundleLookupMap(_0x3a2854,_0x3e0951);let _0x51c2a1;if(_0x124299){if(!_0x124299[_0x37da41(0xd2)](_0x37da41(0xa3))&&!_0x124299['endsWith']('.yaml'))return console['error'](a31_0x20b4d7['red'](_0x37da41(0xf3)+_0x124299+'\x0a')),0x1;_0x51c2a1=[_0x124299];}else _0x51c2a1=findYamlFiles(_0x1f8e42);if(_0x51c2a1[_0x37da41(0x13a)]===0x0)return console[_0x37da41(0xe4)](a31_0x20b4d7['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x1f8e42+'\x0a')),console['error'](a31_0x20b4d7['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x2eb2b0,_0x3feefd;try{const _0x58a204=parseAndClassifyYamlFiles(_0x51c2a1,_0x1f8e42,{'skipSegments':_0x14a18f['journeysOnly']});_0x2eb2b0=_0x58a204[_0x37da41(0x107)],_0x3feefd=_0x58a204[_0x37da41(0xde)];const _0x308b77=validateParsedFiles(_0x58a204,_0x1f8e42);if(_0x308b77['length']>0x0)return console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x10e)](_0x37da41(0x111))),console[_0x37da41(0xe4)](formatValidationErrors(_0x308b77)),console['error'](a31_0x20b4d7[_0x37da41(0xfe)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x3a5e9e){return console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x10e)](_0x37da41(0xd4)+(_0x3a5e9e instanceof Error?_0x3a5e9e[_0x37da41(0xb9)]:_0x3a5e9e))),0x1;}if(_0x2eb2b0[_0x37da41(0x13a)]===0x0&&_0x3feefd[_0x37da41(0x13a)]===0x0){const _0x2ce839=_0x14a18f[_0x37da41(0xea)]?_0x37da41(0xa4):_0x37da41(0x12a);return console['error'](a31_0x20b4d7[_0x37da41(0xfe)](_0x37da41(0x112)+_0x2ce839+_0x37da41(0xab))),0x0;}const _0x485227=new Map();_0x3b1d91[_0x37da41(0x13a)]>0x0&&!_0x14a18f[_0x37da41(0xea)]&&await withSpinner(_0x37da41(0x131),async()=>{await batchAsync(_0x3b1d91,async _0x29d69e=>{const _0x3c6a0a=a31_0x1dfa,_0x19d1c5=await _0x5f0409[_0x3c6a0a(0xf8)][_0x3c6a0a(0xa8)](_0x354beb,_0x29d69e['id']);_0x485227[_0x3c6a0a(0x125)](_0x29d69e['id'],_0x19d1c5);});},{'verbose':_0x14a18f['verbose']});const {segmentFiles:_0x2b8b08,foldersToCreate:_0x5e8c68}=await prepareSegmentFiles(_0x2eb2b0,{'segmentByFolderAndName':_0x3a7d08,'activationsBySegmentId':_0x485227,'folderPathToId':_0x4ca961,'idToEmailMap':_0x5c1034,'connectionIdToNameMap':_0x5d1c50},_0x4a4301,_0x23065f,_0x1788b2),_0x524fc6=_0x124299?[]:findSegmentsToDelete(_0x3b1d91,_0x2eb2b0[_0x37da41(0xb1)](({yamlConfig:_0x9dfe6,folderPath:_0xf1eee9})=>({'yamlConfig':_0x9dfe6,'folderPath':resolveTDFolderPath(_0xf1eee9,_0x23065f,_0x1788b2)})),_0x3e0951,_0x1788b2,_0x23065f),{journeyFiles:_0xe9b3b5,foldersToCreate:_0x4b66b7}=await withProgressSpinner(_0x37da41(0xcc),async _0xf99f1f=>prepareJourneyFiles(_0x3feefd,{'fetchJourney':async _0x1cca47=>_0x5f0409['journey'][_0x37da41(0xe3)](_0x1cca47[_0x37da41(0xbd)]),'journeyBundlesByFolderAndName':_0x339ea2,'folderPathToId':_0x4ca961,'idToEmailMap':_0x5c1034,'connectionIdToNameMap':_0x5d1c50,'existingSegments':_0x3b1d91,'parentId':_0x354beb,'deps':_0x5f0409,'progress':{'update':_0x570109=>{const _0xd9c3fd=_0x37da41;_0xf99f1f[_0xd9c3fd(0xca)](_0x570109),_0x14a18f['verbose']&&console[_0xd9c3fd(0xe4)]('\x20\x20'+_0x570109);}},'journeyById':_0x29ec77,'activationStepsById':_0x4ae488},_0x23065f,_0x1788b2),{'verbose':_0x14a18f['verbose']})[_0x37da41(0x127)](_0x446ac8=>_0x446ac8[_0x37da41(0x128)]);for(const _0x1cfd42 of _0x4b66b7){_0x5e8c68[_0x37da41(0x129)](_0x1cfd42);}const _0x2276f8=_0x124299?[]:findJourneysToDelete(_0x3a2854,_0x3feefd[_0x37da41(0xb1)](({yamlConfig:_0x4bc1f5,folderPath:_0x330396})=>({'yamlConfig':_0x4bc1f5,'folderPath':resolveTDFolderPath(_0x330396,_0x23065f,_0x1788b2)})),_0x3e0951,_0x1788b2,_0x23065f),_0x504e37=calculatePushStats(_0x2b8b08,_0xe9b3b5,_0x5e8c68,_0x524fc6,_0x2276f8,!!_0x14a18f[_0x37da41(0x135)],!!_0x14a18f['journeysOnly']),_0x5637a3=_0x504e37['segments'][_0x37da41(0xe9)],_0x3de892=_0x504e37[_0x37da41(0x107)][_0x37da41(0xa6)],_0x108964=_0x504e37[_0x37da41(0x107)]['unchanged'],_0x5d6d96=_0x504e37[_0x37da41(0x107)][_0x37da41(0xe7)],_0x4f8033=_0x504e37[_0x37da41(0xd3)][_0x37da41(0xb3)],_0xa26f1=_0x504e37['journeys']['new'],_0x53abb4=_0x504e37[_0x37da41(0xde)]['changed'],_0x2aaafa=_0x504e37[_0x37da41(0xde)][_0x37da41(0xc1)],_0x5ea6df=_0x504e37[_0x37da41(0xde)][_0x37da41(0xe7)],_0x5e3036=_0x504e37[_0x37da41(0x11a)][_0x37da41(0x102)],_0x1c092e=_0x504e37['activations'][_0x37da41(0xb3)],_0x5dd628=_0x504e37[_0x37da41(0x11a)][_0x37da41(0xda)],_0x462a1d=_0x504e37[_0x37da41(0x11a)][_0x37da41(0xe7)];console[_0x37da41(0xe4)](_0x37da41(0x12d)+_0x4a96c5+'\x27:');_0x4f8033[_0x37da41(0x13a)]>0x0&&console['error']('\x20\x20'+a31_0x20b4d7[_0x37da41(0xd5)](_0x37da41(0xc0)+_0x4f8033[_0x37da41(0x13a)]+'\x20folders\x20to\x20create'));if(!_0x14a18f[_0x37da41(0xea)]){console[_0x37da41(0xe4)](_0x37da41(0x13d)),console['error'](_0x37da41(0xf2)+a31_0x20b4d7[_0x37da41(0x113)]('+\x20'+_0x5637a3[_0x37da41(0x13a)]+_0x37da41(0x132))),console[_0x37da41(0xe4)](_0x37da41(0xf2)+a31_0x20b4d7[_0x37da41(0xfe)]('~\x20'+_0x3de892['length']+_0x37da41(0xf7)));if(_0x5d6d96[_0x37da41(0x13a)]>0x0)console[_0x37da41(0xe4)]('\x20\x20\x20\x20'+a31_0x20b4d7['red']('-\x20'+_0x5d6d96[_0x37da41(0x13a)]+'\x20to\x20delete'));else _0x524fc6['length']>0x0&&!_0x14a18f[_0x37da41(0x135)]&&console[_0x37da41(0xe4)]('\x20\x20\x20\x20'+a31_0x20b4d7[_0x37da41(0x120)](_0x524fc6[_0x37da41(0x13a)]+_0x37da41(0xef)));console[_0x37da41(0xe4)](_0x37da41(0xf2)+a31_0x20b4d7[_0x37da41(0x120)]('=\x20'+_0x108964[_0x37da41(0x13a)]+'\x20unchanged'));}if(_0xe9b3b5[_0x37da41(0x13a)]>0x0||_0x2276f8[_0x37da41(0x13a)]>0x0){console['error'](_0x37da41(0xa2)),console['error'](_0x37da41(0xf2)+a31_0x20b4d7[_0x37da41(0x113)]('+\x20'+_0xa26f1[_0x37da41(0x13a)]+'\x20new')),console[_0x37da41(0xe4)](_0x37da41(0xf2)+a31_0x20b4d7[_0x37da41(0xfe)]('~\x20'+_0x53abb4['length']+_0x37da41(0xf7)));if(_0x5ea6df[_0x37da41(0x13a)]>0x0)console[_0x37da41(0xe4)](_0x37da41(0xf2)+a31_0x20b4d7[_0x37da41(0x10e)]('-\x20'+_0x5ea6df[_0x37da41(0x13a)]+_0x37da41(0xaa)));else _0x2276f8['length']>0x0&&!_0x14a18f[_0x37da41(0x135)]&&console[_0x37da41(0xe4)](_0x37da41(0xf2)+a31_0x20b4d7[_0x37da41(0x120)](_0x2276f8[_0x37da41(0x13a)]+_0x37da41(0xef)));console['error']('\x20\x20\x20\x20'+a31_0x20b4d7['dim']('=\x20'+_0x2aaafa[_0x37da41(0x13a)]+'\x20unchanged'));}_0x5e3036['length']>0x0&&!_0x14a18f['journeysOnly']&&(console[_0x37da41(0xe4)](''),console[_0x37da41(0xe4)](_0x37da41(0xd1)),_0x1c092e[_0x37da41(0x13a)]>0x0&&console['error'](_0x37da41(0xf2)+a31_0x20b4d7[_0x37da41(0x113)]('+\x20'+_0x1c092e[_0x37da41(0x13a)]+_0x37da41(0x115))),_0x5dd628[_0x37da41(0x13a)]>0x0&&console[_0x37da41(0xe4)](_0x37da41(0xf2)+a31_0x20b4d7[_0x37da41(0xfe)]('~\x20'+_0x5dd628['length']+_0x37da41(0x121))),_0x462a1d[_0x37da41(0x13a)]>0x0&&console[_0x37da41(0xe4)]('\x20\x20\x20\x20'+a31_0x20b4d7[_0x37da41(0x10e)]('-\x20'+_0x462a1d[_0x37da41(0x13a)]+'\x20to\x20delete')));console[_0x37da41(0xe4)]('\x20\x20Source:\x20'+a31_0x20b4d7[_0x37da41(0x11b)](_0x1f8e42)+'\x0a');if(_0x4f8033[_0x37da41(0x13a)]>0x0){console[_0x37da41(0xe4)](_0x37da41(0xeb));for(const _0x226133 of _0x4f8033){console[_0x37da41(0xe4)]('\x20\x20'+a31_0x20b4d7[_0x37da41(0xd5)]('+')+'\x20'+_0x226133);}console['error']('');}if(_0x5637a3[_0x37da41(0x13a)]>0x0&&!_0x14a18f[_0x37da41(0xea)])for(const _0x5e9953 of _0x5637a3){const _0x1caee4=_0x5e9953[_0x37da41(0xe0)]?_0x5e9953[_0x37da41(0xe0)]+'/'+_0x5e9953['yamlConfig']['name']:_0x5e9953['yamlConfig'][_0x37da41(0xa5)],_0x2c5690=_0x5e9953[_0x37da41(0x10d)][_0x37da41(0x11a)]?.[_0x37da41(0x13a)]||0x0,_0x51b90c=_0x2c5690>0x0?a31_0x20b4d7[_0x37da41(0x120)]('\x20['+_0x2c5690+'\x20activations]'):'';console[_0x37da41(0xe4)]('\x0a'+a31_0x20b4d7[_0x37da41(0x113)](_0x37da41(0xb4))+'\x20'+_0x1caee4+_0x51b90c),console[_0x37da41(0xe4)]('─'[_0x37da41(0xfc)](0x3c)),_0x5e9953[_0x37da41(0xb2)]&&console['error'](_0x5e9953[_0x37da41(0xb2)]),console[_0x37da41(0xe4)]('─'[_0x37da41(0xfc)](0x3c));}if(_0x5d6d96[_0x37da41(0x13a)]>0x0&&!_0x14a18f['journeysOnly'])for(const _0x46a30a of _0x5d6d96){const _0x3ac6f9=_0x46a30a['segmentFolderId']?_0x3e0951[_0x37da41(0xe5)](_0x46a30a['segmentFolderId'][_0x37da41(0x10b)]())||'':'',_0x27e5d1=_0x3ac6f9?_0x3ac6f9+'/'+_0x46a30a['name']:_0x46a30a[_0x37da41(0xa5)],_0xa81d72=_0x485227[_0x37da41(0xe5)](_0x46a30a['id'])||[],_0x7ae365=_0xa81d72[_0x37da41(0x13a)]>0x0?a31_0x20b4d7[_0x37da41(0x120)]('\x20['+_0xa81d72[_0x37da41(0x13a)]+_0x37da41(0x137)):'';console[_0x37da41(0xe4)]('\x0a'+a31_0x20b4d7[_0x37da41(0x10e)](_0x37da41(0x118))+'\x20'+_0x27e5d1+_0x7ae365),console[_0x37da41(0xe4)]('─'['repeat'](0x3c));const _0x5537f5=segmentWithActivationsToYaml(_0x46a30a,_0xa81d72,undefined,_0x5c1034,_0x5d1c50),_0x10d813=segmentToYamlString(_0x5537f5),_0x4bf99c=generateDiff(_0x10d813,'');console[_0x37da41(0xe4)](formatDiffWithColors(_0x4bf99c)),console[_0x37da41(0xe4)]('─'[_0x37da41(0xfc)](0x3c));}const _0x2df323=_0x2b8b08['filter'](_0x2be508=>!_0x2be508['isNew']&&_0x2be508[_0x37da41(0xb2)]);if(_0x2df323[_0x37da41(0x13a)]>0x0&&!_0x14a18f['journeysOnly'])for(const _0x500523 of _0x2df323){const _0x1c4046=_0x500523['folderPath']?_0x500523[_0x37da41(0xe0)]+'/'+_0x500523[_0x37da41(0x10d)][_0x37da41(0xa5)]:_0x500523[_0x37da41(0x10d)][_0x37da41(0xa5)];console[_0x37da41(0xe4)]('\x0a'+a31_0x20b4d7[_0x37da41(0xfe)](_0x37da41(0xcd))+'\x20'+_0x1c4046),console[_0x37da41(0xe4)]('─'[_0x37da41(0xfc)](0x3c)),console['error'](_0x500523[_0x37da41(0xb2)]),console[_0x37da41(0xe4)]('─'['repeat'](0x3c));}if(_0xa26f1[_0x37da41(0x13a)]>0x0)for(const _0x467773 of _0xa26f1){const _0x3786a6=_0x467773[_0x37da41(0xe0)]?_0x467773[_0x37da41(0xe0)]+'/'+_0x467773[_0x37da41(0x10d)]['name']:_0x467773[_0x37da41(0x10d)][_0x37da41(0xa5)];console[_0x37da41(0xe4)]('\x0a'+a31_0x20b4d7[_0x37da41(0x113)](_0x37da41(0xc9))+'\x20'+_0x3786a6),console[_0x37da41(0xe4)]('─'['repeat'](0x3c)),_0x467773['diff']&&console['error'](_0x467773[_0x37da41(0xb2)]),console['error']('─'[_0x37da41(0xfc)](0x3c));}const _0x1dc746=_0xe9b3b5[_0x37da41(0xdb)](_0x6c2fe0=>!_0x6c2fe0[_0x37da41(0xbe)]&&_0x6c2fe0[_0x37da41(0xb2)]);if(_0x1dc746[_0x37da41(0x13a)]>0x0)for(const _0xc934f8 of _0x1dc746){const _0x15dc22=_0xc934f8[_0x37da41(0xe0)]?_0xc934f8[_0x37da41(0xe0)]+'/'+_0xc934f8[_0x37da41(0x10d)][_0x37da41(0xa5)]:_0xc934f8[_0x37da41(0x10d)][_0x37da41(0xa5)];console['error']('\x0a'+a31_0x20b4d7[_0x37da41(0xfe)](_0x37da41(0x105))+'\x20'+_0x15dc22),console[_0x37da41(0xe4)]('─'[_0x37da41(0xfc)](0x3c)),console[_0x37da41(0xe4)](_0xc934f8[_0x37da41(0xb2)]),console['error']('─'[_0x37da41(0xfc)](0x3c));}if(_0x5ea6df['length']>0x0)for(const _0x218b4e of _0x5ea6df){const _0x53287d=_0x218b4e['folderId']?_0x3e0951['get'](_0x218b4e[_0x37da41(0xf1)])||'':'',_0x5250a3=_0x53287d?_0x53287d+'/'+_0x218b4e['journeyBundleName']:_0x218b4e['journeyBundleName'];console[_0x37da41(0xe4)]('\x0a'+a31_0x20b4d7[_0x37da41(0x10e)](_0x37da41(0xd0))+'\x20'+_0x5250a3),console[_0x37da41(0xe4)]('─'['repeat'](0x3c)),console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x10e)]('(Journey\x20will\x20be\x20deleted)')),console[_0x37da41(0xe4)]('─'[_0x37da41(0xfc)](0x3c));}if(_0x14a18f[_0x37da41(0xf5)])return console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0xfe)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x205a9e=_0x14a18f[_0x37da41(0xea)]?![]:_0x5637a3['length']>0x0||_0x3de892[_0x37da41(0x13a)]>0x0||_0x5d6d96['length']>0x0,_0x1365d0=_0xa26f1[_0x37da41(0x13a)]>0x0||_0x53abb4[_0x37da41(0x13a)]>0x0||_0x5ea6df[_0x37da41(0x13a)]>0x0,_0x5d12a5=_0x14a18f['journeysOnly']?![]:_0x5e3036['length']>0x0,_0x1ca013=_0x4f8033[_0x37da41(0x13a)]>0x0;if(!_0x205a9e&&!_0x1365d0&&!_0x5d12a5&&!_0x1ca013){const _0x4bed28=_0x14a18f[_0x37da41(0xea)]?_0x37da41(0xc2):_0x37da41(0x101);console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x113)](_0x4bed28));if(_0x124299&&_0x2aaafa['length']===0x1){const _0x533068=_0x2aaafa[0x0];if(_0x533068['existingJourney']?.['id']){const _0x355c36=getConsoleNextUrl(_0x14a18f[_0x37da41(0x12c)],_0x37da41(0xce)+_0x354beb+_0x37da41(0xfb)+_0x533068[_0x37da41(0x139)]['id']+_0x37da41(0xd7));console[_0x37da41(0xe4)]('\x20\x20'+a31_0x20b4d7[_0x37da41(0x11b)](_0x355c36));}}return 0x0;}const _0x3106d1=_0x14a18f[_0x37da41(0xea)]?_0xa26f1[_0x37da41(0x13a)]+_0x53abb4['length']+_0x5ea6df[_0x37da41(0x13a)]+_0x4f8033['length']:_0x5637a3[_0x37da41(0x13a)]+_0x3de892[_0x37da41(0x13a)]+_0x5d6d96['length']+_0xa26f1[_0x37da41(0x13a)]+_0x53abb4[_0x37da41(0x13a)]+_0x5ea6df[_0x37da41(0x13a)]+_0x4f8033[_0x37da41(0x13a)]+_0x5e3036[_0x37da41(0x13a)];if(!_0x14a18f[_0x37da41(0xee)]&&_0x3106d1>0x0){if(!isInteractive())return console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x10e)](_0x37da41(0xba)),_0x37da41(0x133)),console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x120)](_0x37da41(0xa9))),0x1;const _0x4341ea=await confirmKey(_0x37da41(0x12b)+_0x3106d1+_0x37da41(0xbc));if(!_0x4341ea)return console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0xfe)](_0x37da41(0x138))),0x1;}const _0x148837={'withProgress':async(_0x3dab03,_0x5bc5e1)=>{const _0x3d4f26=_0x37da41,_0x304435=await withSpinner(_0x3dab03,_0x5bc5e1,{'verbose':_0x14a18f[_0x3d4f26(0x123)]});return{'data':_0x304435[_0x3d4f26(0x128)]};},'logInfo':_0x4c43a7=>console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0xd5)]('βœ”\x20'+_0x4c43a7)),'logSuccess':_0x54a447=>console['error'](a31_0x20b4d7['green']('βœ”\x20'+_0x54a447)),'logWarning':_0x4cde20=>console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0xfe)]('⚠\x20'+_0x4cde20)),'logDeleted':_0x4df2ce=>console['error'](a31_0x20b4d7['red']('βœ”\x20'+_0x4df2ce))},_0xc6b633={'segment':_0x5f0409[_0x37da41(0xf8)],'journey':_0x5f0409[_0x37da41(0xa4)],'user':_0x5f0409['user'],'connection':_0x5f0409[_0x37da41(0xed)]};_0x4f8033[_0x37da41(0x13a)]>0x0&&(_0x4ca961=await executePushFolders(_0xc6b633,_0x4f8033,_0x4ca961,{'parentId':_0x354beb},_0x148837));const _0x47c282={'rootFolderId':_0xb0bbaf,'folderPathToId':_0x4ca961,'folderIdToPath':_0x3e0951,'segmentNameToId':_0x5293c5,'activationsBySegmentId':_0x485227,'emailToIdMap':_0x2769bf,'idToEmailMap':_0x5c1034,'connectionNameToIdMap':_0xfb9bd7[_0x37da41(0x13b)],'connectionIdToNameMap':_0xfb9bd7[_0x37da41(0x126)],'connectionNameToTypeMap':_0x4f9527},_0x58f99d=await executePushSegments(_0xc6b633,_0x14a18f['journeysOnly']?[]:_0x2b8b08,_0x47c282,{'parentId':_0x354beb},_0x148837),_0x305cd4=_0x58f99d[_0x37da41(0x11d)],_0x359702=_0x58f99d[_0x37da41(0xe8)],_0x23f398=_0x58f99d['activations'][_0x37da41(0x11d)],_0x39bcd0=_0x58f99d[_0x37da41(0x11a)][_0x37da41(0xe8)],_0x92222a=_0x58f99d[_0x37da41(0x11a)][_0x37da41(0xe6)],_0x152d25=await executePushSegmentDeletions(_0xc6b633,_0x14a18f['journeysOnly']?[]:_0x5d6d96,_0x148837);let _0x358548=0x0,_0x4d7570=0x0,_0x1c78b3=0x0;const _0x14cd32=new Map(_0x5293c5);for(const [_0x217e35,_0x2a1bd8]of _0x58f99d[_0x37da41(0x104)]){_0x14cd32[_0x37da41(0x125)](_0x217e35,_0x2a1bd8);}if(_0xe9b3b5[_0x37da41(0x13a)]>0x0){const _0x245714={..._0x47c282,'segmentNameToId':_0x14cd32,'existingSegments':_0x3b1d91,'activationContext':_0x4a4301},_0x1d04d3=await executePushJourneys(_0xc6b633,_0xe9b3b5,_0x245714,{'parentId':_0x354beb,'rootFolderId':_0xb0bbaf,'verbose':_0x14a18f[_0x37da41(0x123)]},_0x148837);_0x358548=_0x1d04d3['created'],_0x4d7570=_0x1d04d3['updated'];if(_0x124299&&_0x1d04d3['results'][_0x37da41(0x13a)]===0x1){const _0x58c027=_0x1d04d3[_0x37da41(0x106)][0x0];if(_0x58c027['journeyId']){const _0xaf5a42=getConsoleNextUrl(_0x14a18f['site'],_0x37da41(0xce)+_0x354beb+'/e/'+_0x58c027['journeyId']+_0x37da41(0xd7));console['error']('\x20\x20'+a31_0x20b4d7['cyan'](_0xaf5a42));}}}for(const _0x20a6b5 of _0x5ea6df){console['error'](a31_0x20b4d7['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x20a6b5[_0x37da41(0xc8)])),_0x1c78b3++;}const _0x5bad30=[];if(_0x305cd4>0x0)_0x5bad30['push'](_0x305cd4+_0x37da41(0xb7));if(_0x359702>0x0)_0x5bad30[_0x37da41(0xb6)](_0x359702+_0x37da41(0x114));if(_0x152d25>0x0)_0x5bad30[_0x37da41(0xb6)](_0x152d25+'\x20deleted');const _0x16cd90=[];if(_0x358548>0x0)_0x16cd90[_0x37da41(0xb6)](_0x358548+'\x20created');if(_0x4d7570>0x0)_0x16cd90[_0x37da41(0xb6)](_0x4d7570+'\x20updated');if(_0x1c78b3>0x0)_0x16cd90['push'](_0x1c78b3+_0x37da41(0xc6));const _0x2d780e=[];if(_0x23f398>0x0)_0x2d780e[_0x37da41(0xb6)](_0x23f398+_0x37da41(0xb7));if(_0x39bcd0>0x0)_0x2d780e[_0x37da41(0xb6)](_0x39bcd0+_0x37da41(0x114));if(_0x92222a>0x0)_0x2d780e[_0x37da41(0xb6)](_0x92222a+'\x20deleted');return console[_0x37da41(0xe4)](a31_0x20b4d7[_0x37da41(0x113)](_0x37da41(0x130))),_0x5bad30[_0x37da41(0x13a)]>0x0&&!_0x14a18f['journeysOnly']&&console['error'](_0x37da41(0xaf)+_0x5bad30[_0x37da41(0x110)](',\x20')),_0x16cd90[_0x37da41(0x13a)]>0x0&&console[_0x37da41(0xe4)](_0x37da41(0xfa)+_0x16cd90['join'](',\x20')),_0x2d780e[_0x37da41(0x13a)]>0x0&&!_0x14a18f['journeysOnly']&&console['error']('\x20\x20Activations:\x20'+_0x2d780e['join'](',\x20')),0x0;}}
1
+ const a31_0x2f5efb=a31_0x15de;(function(_0x5f5807,_0x40964f){const _0x9f8e75=a31_0x15de,_0x15db8b=_0x5f5807();while(!![]){try{const _0x1f1adc=parseInt(_0x9f8e75(0x18d))/0x1+parseInt(_0x9f8e75(0x17a))/0x2*(-parseInt(_0x9f8e75(0x13a))/0x3)+parseInt(_0x9f8e75(0x12c))/0x4+-parseInt(_0x9f8e75(0x120))/0x5+-parseInt(_0x9f8e75(0x139))/0x6+-parseInt(_0x9f8e75(0x142))/0x7*(parseInt(_0x9f8e75(0x14d))/0x8)+-parseInt(_0x9f8e75(0x144))/0x9*(-parseInt(_0x9f8e75(0x17f))/0xa);if(_0x1f1adc===_0x40964f)break;else _0x15db8b['push'](_0x15db8b['shift']());}catch(_0xff407d){_0x15db8b['push'](_0x15db8b['shift']());}}}(a31_0xe6b4,0x6f1c2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a31_0x15de(_0x32a7d0,_0x3055bb){_0x32a7d0=_0x32a7d0-0xf3;const _0xe6b417=a31_0xe6b4();let _0x15dee5=_0xe6b417[_0x32a7d0];return _0x15dee5;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x383748 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a31_0xe6b4(){const _0x26faa8=['red','journeyId','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','deleted','New\x20segment:','length','repeat','folderId','cyan','listJourneysWithDetailsFromParentSegment','\x20\x20Journeys:\x20','dim','segmentFolderId','206270vMsxZe','created','endsWith','updated','Fetching\x20existing\x20segments...','30MOMlmR','blue','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Segments:\x20','results','\x20\x20\x20\x20','createdAt','Delete\x20segment:','parentName','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','toUpdate','segment:push','set','journeysOnly','618523dEOXnC','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','\x20changed','Fetching\x20connections\x20for\x20name\x20resolution...','Site:\x20','Push\x20','paused','new','no_parent','add','activations','unchanged','file','Delete\x20journey:','execute','targetDir','(Journey\x20will\x20be\x20deleted)','journey','segments','Fetching\x20users\x20for\x20email\x20resolution...','/app/ps/','isNew','listActivations','\x20updated','folders','getParent','journeyBundleId','versionNumber','Fetching\x20existing\x20folders...','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)','nameToId','description','Aborted.','\x20folders\x20to\x20create','idToName','filter','error','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Resolving\x20parent\x20segment\x20\x27','list','Fetching\x20existing\x20journeys...','push','relationships','connection','2612900cVRHmH','then','toDelete','nameToType','all','helpText','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','resolveParentId','\x20activations]','updatedAt','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','236032EAenAK','getOutputSchemaWithCache','\x20unchanged','message','\x20new','Error\x20parsing\x20YAML:\x20','toCreate','yamlConfig','journeys','getJourney','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','green','.yaml','3670542TlRxZS','9pXvHHj','join','yellow','get','\x20to\x20update','\x20to\x20create','\x0aError:','parentSegment','616AzfpgC','yes','5293359vfXIXi','Source\x20directory:\x20','Folders\x20to\x20create:','scopedFolderPath','data','map','name','cwd','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','49376Fyhrmk','buildUserMaps','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x0aβœ”\x20Push\x20complete','\x20to\x20delete','type','journeyBundleName','Changes\x20to\x20journey:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','/e/','user','\x20\x20πŸ“Š\x20Segments:','\x20changes?','\x20created','diff','delete','\x20deleted','Changes\x20to:','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','isScoped','Preparing\x20journeys...','site','verbose','attributes','changed','.yml','filePath','existingJourney','folderPath','segment','\x20\x20Source:\x20','Error:\x20'];a31_0xe6b4=function(){return _0x26faa8;};return a31_0xe6b4();}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a31_0x2f5efb(0x14a)]=a31_0x2f5efb(0x18a);[a31_0x2f5efb(0x112)]=a31_0x2f5efb(0x12b);async[a31_0x2f5efb(0x101)](_0x275e38){const _0x2bba36=a31_0x2f5efb,{options:_0x21972b,args:_0x65b493,tdx:_0x1fcc41}=_0x275e38,_0x159481=_0x21972b,_0x3cf76a=await resolveTarget({'arg':_0x65b493[0x0],'contextParent':_0x21972b[_0x2bba36(0x141)],'cwd':process[_0x2bba36(0x14b)]()});if(!isSuccessfulResolution(_0x3cf76a))return _0x3cf76a['errorCode']===_0x2bba36(0xfb)?(console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x13c)](_0x2bba36(0x119))),console[_0x2bba36(0x117)](_0x2bba36(0x110)),console[_0x2bba36(0x117)](_0x2bba36(0x155)),console[_0x2bba36(0x117)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a31_0x383748[_0x2bba36(0x16d)](_0x2bba36(0x16c)+_0x3cf76a['message']+'\x0a')),_0x3cf76a[_0x2bba36(0x125)]&&console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x175)](_0x3cf76a[_0x2bba36(0x125)]))),0x1;if(_0x3cf76a['type']==='parent_name')return console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x16d)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3cf76a[_0x2bba36(0x102)]+'\x0a')),console[_0x2bba36(0x117)](a31_0x383748['cyan'](_0x2bba36(0xf3))),0x1;const _0x46c453=_0x3cf76a[_0x2bba36(0x187)],_0x221bde=_0x3cf76a[_0x2bba36(0x102)],_0x3b6de0=_0x3cf76a[_0x2bba36(0x152)]===_0x2bba36(0xff)?_0x3cf76a[_0x2bba36(0x167)]:undefined,_0x2788d6=getScopedDetails(_0x3cf76a),_0x5d9828=_0x2788d6?.[_0x2bba36(0x160)]??![],_0x411746=_0x2788d6?.[_0x2bba36(0x147)]??'';if(!existsSync(_0x221bde))return console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x16d)]('Error:\x20Directory\x20not\x20found:\x20'+_0x221bde+'\x0a')),console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x175)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x159481['verbose']&&(console['error'](_0x2bba36(0xf7)+_0x159481[_0x2bba36(0x162)]),console['error']('Parent\x20segment:\x20'+_0x46c453),console[_0x2bba36(0x117)](_0x2bba36(0x145)+_0x221bde),_0x5d9828&&console[_0x2bba36(0x117)]('Scoped\x20to\x20folder:\x20'+_0x411746));const _0x23006e=await withSpinner(_0x2bba36(0x11a)+_0x46c453+'\x27...',()=>_0x1fcc41[_0x2bba36(0x16a)][_0x2bba36(0x127)](_0x46c453),{'verbose':_0x159481[_0x2bba36(0x163)]}),_0x58ed2b=_0x23006e['data'],[_0xff4469,_0x4c91eb,_0x547f2f,_0x94a344,_0x520e1b]=await Promise[_0x2bba36(0x124)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x1fcc41[_0x2bba36(0x16a)][_0x2bba36(0x10c)](_0x58ed2b),{'verbose':_0x159481[_0x2bba36(0x163)]}),withSpinner(_0x2bba36(0x17e),()=>_0x1fcc41['segment']['listSegments'](_0x58ed2b),{'verbose':_0x159481[_0x2bba36(0x163)]}),withSpinner(_0x2bba36(0x10f),()=>_0x1fcc41[_0x2bba36(0x16a)]['listFolders'](_0x58ed2b),{'verbose':_0x159481[_0x2bba36(0x163)]}),withSpinner(_0x2bba36(0x11c),()=>_0x1fcc41[_0x2bba36(0x104)][_0x2bba36(0x176)](_0x58ed2b,{'includeAllVersions':!![]}),{'verbose':_0x159481[_0x2bba36(0x163)]}),withSpinner(_0x2bba36(0x106),()=>_0x1fcc41[_0x2bba36(0x157)][_0x2bba36(0x14e)](),{'verbose':_0x159481[_0x2bba36(0x163)]})[_0x2bba36(0x121)](_0x1341a1=>_0x1341a1['data'])]),_0xc2f434=_0xff4469[_0x2bba36(0x148)],_0x2688fd=extractRootFolderId(_0xc2f434),_0x4c14e0=_0x4c91eb[_0x2bba36(0x148)],_0x367009=_0x547f2f[_0x2bba36(0x148)],{journeys:_0x21360a,activationStepsById:_0x265d6b}=_0x94a344['data'],_0xa73dd4=new Map(_0x21360a[_0x2bba36(0x149)](_0x21d67c=>[_0x21d67c['id'],_0x21d67c])),_0x3725fa=_0x21360a[_0x2bba36(0x149)](_0x344fb3=>({'id':_0x344fb3['id'],'name':_0x344fb3[_0x2bba36(0x164)]['name'],'journeyBundleName':_0x344fb3['attributes'][_0x2bba36(0x153)]||'','journeyBundleId':_0x344fb3[_0x2bba36(0x164)][_0x2bba36(0x10d)]||'','versionNumber':_0x344fb3[_0x2bba36(0x164)][_0x2bba36(0x10e)],'description':_0x344fb3['attributes'][_0x2bba36(0x112)],'state':_0x344fb3[_0x2bba36(0x164)]['state'],'paused':_0x344fb3[_0x2bba36(0x164)][_0x2bba36(0xf9)],'audienceId':_0x344fb3[_0x2bba36(0x164)]['audienceId'],'folderId':_0x344fb3[_0x2bba36(0x11e)]?.['parentFolder']?.[_0x2bba36(0x148)]?.['id'],'createdAt':_0x344fb3[_0x2bba36(0x164)][_0x2bba36(0x185)],'updatedAt':_0x344fb3['attributes'][_0x2bba36(0x129)]})),{emailToId:_0x3500a2,idToEmail:_0x2d418c}=_0x520e1b,_0x99a77d=await withSpinner(_0x2bba36(0xf6),async()=>{const _0x42fe77=_0x2bba36,_0x37ff66=await _0x1fcc41[_0x42fe77(0x11f)][_0x42fe77(0x11b)]();return buildConnectionMaps(_0x37ff66);},{'verbose':_0x159481[_0x2bba36(0x163)]})[_0x2bba36(0x121)](_0x2cb90f=>_0x2cb90f[_0x2bba36(0x148)]),_0x4896ff=_0x99a77d[_0x2bba36(0x111)],_0x857ea0=_0x99a77d[_0x2bba36(0x115)],_0x48131c=_0x99a77d[_0x2bba36(0x123)],_0x276f8c={'emailToIdMap':_0x3500a2,'connectionNameToIdMap':_0x4896ff,'connectionNameToTypeMap':_0x48131c,'getSchema':_0x3c4487=>_0x1fcc41[_0x2bba36(0x11f)][_0x2bba36(0x12d)](_0x3c4487)};let {pathToId:_0x4f975a,idToPath:_0x18648f}=buildFolderMaps(_0x367009);const _0x2dc534=buildSegmentLookupMap(_0x4c14e0,_0x18648f),_0x5be75d=buildSegmentNameToIdMap(_0x4c14e0),_0x202453=buildJourneyBundleLookupMap(_0x3725fa,_0x18648f);let _0x32e8fc;if(_0x3b6de0){if(!_0x3b6de0['endsWith'](_0x2bba36(0x166))&&!_0x3b6de0[_0x2bba36(0x17c)](_0x2bba36(0x138)))return console['error'](a31_0x383748[_0x2bba36(0x16d)](_0x2bba36(0x14c)+_0x3b6de0+'\x0a')),0x1;_0x32e8fc=[_0x3b6de0];}else _0x32e8fc=findYamlFiles(_0x221bde);if(_0x32e8fc[_0x2bba36(0x172)]===0x0)return console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x16d)](_0x2bba36(0x136)+_0x221bde+'\x0a')),console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x175)](_0x2bba36(0x188))),0x1;let _0x3ea57f,_0x3ff176;try{const _0x106f1a=parseAndClassifyYamlFiles(_0x32e8fc,_0x221bde,{'skipSegments':_0x159481['journeysOnly']});_0x3ea57f=_0x106f1a[_0x2bba36(0x105)],_0x3ff176=_0x106f1a['journeys'];const _0x55ed18=validateParsedFiles(_0x106f1a,_0x221bde);if(_0x55ed18['length']>0x0)return console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x16d)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x55ed18)),console[_0x2bba36(0x117)](a31_0x383748['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x30f0a2){return console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x16d)](_0x2bba36(0x131)+(_0x30f0a2 instanceof Error?_0x30f0a2[_0x2bba36(0x12f)]:_0x30f0a2))),0x1;}if(_0x3ea57f[_0x2bba36(0x172)]===0x0&&_0x3ff176[_0x2bba36(0x172)]===0x0){const _0x5c0590=_0x159481[_0x2bba36(0x18c)]?'journey':'segment\x20or\x20journey';return console['error'](a31_0x383748[_0x2bba36(0x13c)]('No\x20'+_0x5c0590+'\x20YAML\x20files\x20found')),0x0;}const _0x4f17d2=new Map();_0x4c14e0[_0x2bba36(0x172)]>0x0&&!_0x159481[_0x2bba36(0x18c)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x4c14e0,async _0x26211d=>{const _0x1cffbf=a31_0x15de,_0x1ed397=await _0x1fcc41[_0x1cffbf(0x16a)][_0x1cffbf(0x109)](_0x58ed2b,_0x26211d['id']);_0x4f17d2['set'](_0x26211d['id'],_0x1ed397);});},{'verbose':_0x159481[_0x2bba36(0x163)]});const {segmentFiles:_0x326245,foldersToCreate:_0x4ca7a4}=await prepareSegmentFiles(_0x3ea57f,{'segmentByFolderAndName':_0x2dc534,'activationsBySegmentId':_0x4f17d2,'folderPathToId':_0x4f975a,'idToEmailMap':_0x2d418c,'connectionIdToNameMap':_0x857ea0},_0x276f8c,_0x5d9828,_0x411746),_0x1b8062=_0x3b6de0?[]:findSegmentsToDelete(_0x4c14e0,_0x3ea57f[_0x2bba36(0x149)](({yamlConfig:_0x4c502,folderPath:_0xd4f445})=>({'yamlConfig':_0x4c502,'folderPath':resolveTDFolderPath(_0xd4f445,_0x5d9828,_0x411746)})),_0x18648f,_0x411746,_0x5d9828),{journeyFiles:_0x252cc9,foldersToCreate:_0xa39637}=await withProgressSpinner(_0x2bba36(0x161),async _0x20488b=>prepareJourneyFiles(_0x3ff176,{'fetchJourney':async _0x147c82=>_0x1fcc41['journey'][_0x2bba36(0x135)](_0x147c82[_0x2bba36(0x16e)]),'journeyBundlesByFolderAndName':_0x202453,'folderPathToId':_0x4f975a,'idToEmailMap':_0x2d418c,'connectionIdToNameMap':_0x857ea0,'existingSegments':_0x4c14e0,'parentId':_0x58ed2b,'deps':_0x1fcc41,'progress':{'update':_0x4b9da5=>{const _0x6175ce=_0x2bba36;_0x20488b['setPhase'](_0x4b9da5),_0x159481[_0x6175ce(0x163)]&&console[_0x6175ce(0x117)]('\x20\x20'+_0x4b9da5);}},'journeyById':_0xa73dd4,'activationStepsById':_0x265d6b},_0x5d9828,_0x411746),{'verbose':_0x159481['verbose']})[_0x2bba36(0x121)](_0xec43d2=>_0xec43d2[_0x2bba36(0x148)]);for(const _0x51820e of _0xa39637){_0x4ca7a4[_0x2bba36(0xfc)](_0x51820e);}const _0x2c46a6=_0x3b6de0?[]:findJourneysToDelete(_0x3725fa,_0x3ff176[_0x2bba36(0x149)](({yamlConfig:_0x591405,folderPath:_0x539a39})=>({'yamlConfig':_0x591405,'folderPath':resolveTDFolderPath(_0x539a39,_0x5d9828,_0x411746)})),_0x18648f,_0x411746,_0x5d9828),_0x4044fa=calculatePushStats(_0x326245,_0x252cc9,_0x4ca7a4,_0x1b8062,_0x2c46a6,!!_0x159481['delete'],!!_0x159481['journeysOnly']),_0x5575c5=_0x4044fa[_0x2bba36(0x105)][_0x2bba36(0xfa)],_0x5351ab=_0x4044fa[_0x2bba36(0x105)][_0x2bba36(0x165)],_0x328df9=_0x4044fa[_0x2bba36(0x105)][_0x2bba36(0xfe)],_0x30299d=_0x4044fa['segments'][_0x2bba36(0x122)],_0x343a19=_0x4044fa[_0x2bba36(0x10b)][_0x2bba36(0x132)],_0x255654=_0x4044fa[_0x2bba36(0x134)]['new'],_0x1347fe=_0x4044fa[_0x2bba36(0x134)][_0x2bba36(0x165)],_0x46743b=_0x4044fa[_0x2bba36(0x134)][_0x2bba36(0xfe)],_0x2226fc=_0x4044fa[_0x2bba36(0x134)][_0x2bba36(0x122)],_0x2cbdd9=_0x4044fa[_0x2bba36(0xfd)][_0x2bba36(0x124)],_0x4fbccb=_0x4044fa['activations'][_0x2bba36(0x132)],_0xf586de=_0x4044fa[_0x2bba36(0xfd)][_0x2bba36(0x189)],_0x3609c0=_0x4044fa['activations']['toDelete'];console[_0x2bba36(0x117)](_0x2bba36(0x181)+_0x46c453+'\x27:');_0x343a19[_0x2bba36(0x172)]>0x0&&console[_0x2bba36(0x117)]('\x20\x20'+a31_0x383748[_0x2bba36(0x180)]('πŸ“\x20'+_0x343a19[_0x2bba36(0x172)]+_0x2bba36(0x114)));if(!_0x159481[_0x2bba36(0x18c)]){console[_0x2bba36(0x117)](_0x2bba36(0x158)),console['error'](_0x2bba36(0x184)+a31_0x383748[_0x2bba36(0x137)]('+\x20'+_0x5575c5[_0x2bba36(0x172)]+_0x2bba36(0x130))),console[_0x2bba36(0x117)](_0x2bba36(0x184)+a31_0x383748[_0x2bba36(0x13c)]('~\x20'+_0x5351ab[_0x2bba36(0x172)]+_0x2bba36(0xf5)));if(_0x30299d[_0x2bba36(0x172)]>0x0)console['error'](_0x2bba36(0x184)+a31_0x383748['red']('-\x20'+_0x30299d[_0x2bba36(0x172)]+_0x2bba36(0x151)));else _0x1b8062[_0x2bba36(0x172)]>0x0&&!_0x159481[_0x2bba36(0x15c)]&&console[_0x2bba36(0x117)](_0x2bba36(0x184)+a31_0x383748[_0x2bba36(0x178)](_0x1b8062['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x2bba36(0x117)](_0x2bba36(0x184)+a31_0x383748[_0x2bba36(0x178)]('=\x20'+_0x328df9[_0x2bba36(0x172)]+_0x2bba36(0x12e)));}if(_0x252cc9['length']>0x0||_0x2c46a6['length']>0x0){console[_0x2bba36(0x117)](_0x2bba36(0xf4)),console['error']('\x20\x20\x20\x20'+a31_0x383748['green']('+\x20'+_0x255654['length']+_0x2bba36(0x130))),console[_0x2bba36(0x117)]('\x20\x20\x20\x20'+a31_0x383748[_0x2bba36(0x13c)]('~\x20'+_0x1347fe[_0x2bba36(0x172)]+_0x2bba36(0xf5)));if(_0x2226fc[_0x2bba36(0x172)]>0x0)console[_0x2bba36(0x117)](_0x2bba36(0x184)+a31_0x383748[_0x2bba36(0x16d)]('-\x20'+_0x2226fc['length']+_0x2bba36(0x151)));else _0x2c46a6[_0x2bba36(0x172)]>0x0&&!_0x159481[_0x2bba36(0x15c)]&&console[_0x2bba36(0x117)](_0x2bba36(0x184)+a31_0x383748['dim'](_0x2c46a6[_0x2bba36(0x172)]+_0x2bba36(0x14f)));console[_0x2bba36(0x117)](_0x2bba36(0x184)+a31_0x383748[_0x2bba36(0x178)]('=\x20'+_0x46743b[_0x2bba36(0x172)]+_0x2bba36(0x12e)));}_0x2cbdd9['length']>0x0&&!_0x159481[_0x2bba36(0x18c)]&&(console[_0x2bba36(0x117)](''),console['error']('\x20\x20Activations:'),_0x4fbccb['length']>0x0&&console['error'](_0x2bba36(0x184)+a31_0x383748['green']('+\x20'+_0x4fbccb[_0x2bba36(0x172)]+_0x2bba36(0x13f))),_0xf586de['length']>0x0&&console[_0x2bba36(0x117)]('\x20\x20\x20\x20'+a31_0x383748[_0x2bba36(0x13c)]('~\x20'+_0xf586de[_0x2bba36(0x172)]+_0x2bba36(0x13e))),_0x3609c0[_0x2bba36(0x172)]>0x0&&console[_0x2bba36(0x117)]('\x20\x20\x20\x20'+a31_0x383748[_0x2bba36(0x16d)]('-\x20'+_0x3609c0[_0x2bba36(0x172)]+_0x2bba36(0x151))));console['error'](_0x2bba36(0x16b)+a31_0x383748[_0x2bba36(0x175)](_0x221bde)+'\x0a');if(_0x343a19[_0x2bba36(0x172)]>0x0){console[_0x2bba36(0x117)](_0x2bba36(0x146));for(const _0x2f428a of _0x343a19){console[_0x2bba36(0x117)]('\x20\x20'+a31_0x383748[_0x2bba36(0x180)]('+')+'\x20'+_0x2f428a);}console[_0x2bba36(0x117)]('');}if(_0x5575c5['length']>0x0&&!_0x159481[_0x2bba36(0x18c)])for(const _0x5a2626 of _0x5575c5){const _0x41427e=_0x5a2626[_0x2bba36(0x169)]?_0x5a2626[_0x2bba36(0x169)]+'/'+_0x5a2626['yamlConfig'][_0x2bba36(0x14a)]:_0x5a2626['yamlConfig']['name'],_0x408b66=_0x5a2626[_0x2bba36(0x133)][_0x2bba36(0xfd)]?.[_0x2bba36(0x172)]||0x0,_0xb896d4=_0x408b66>0x0?a31_0x383748[_0x2bba36(0x178)]('\x20['+_0x408b66+_0x2bba36(0x128)):'';console['error']('\x0a'+a31_0x383748[_0x2bba36(0x137)](_0x2bba36(0x171))+'\x20'+_0x41427e+_0xb896d4),console['error']('─'[_0x2bba36(0x173)](0x3c)),_0x5a2626[_0x2bba36(0x15b)]&&console[_0x2bba36(0x117)](_0x5a2626['diff']),console['error']('─'['repeat'](0x3c));}if(_0x30299d[_0x2bba36(0x172)]>0x0&&!_0x159481[_0x2bba36(0x18c)])for(const _0xf42a2c of _0x30299d){const _0x5db07d=_0xf42a2c[_0x2bba36(0x179)]?_0x18648f[_0x2bba36(0x13d)](_0xf42a2c[_0x2bba36(0x179)]['toString']())||'':'',_0x264556=_0x5db07d?_0x5db07d+'/'+_0xf42a2c[_0x2bba36(0x14a)]:_0xf42a2c[_0x2bba36(0x14a)],_0x5449d6=_0x4f17d2[_0x2bba36(0x13d)](_0xf42a2c['id'])||[],_0x59a471=_0x5449d6[_0x2bba36(0x172)]>0x0?a31_0x383748[_0x2bba36(0x178)]('\x20['+_0x5449d6[_0x2bba36(0x172)]+_0x2bba36(0x128)):'';console[_0x2bba36(0x117)]('\x0a'+a31_0x383748[_0x2bba36(0x16d)](_0x2bba36(0x186))+'\x20'+_0x264556+_0x59a471),console[_0x2bba36(0x117)]('─'[_0x2bba36(0x173)](0x3c));const _0x596a02=segmentWithActivationsToYaml(_0xf42a2c,_0x5449d6,undefined,_0x2d418c,_0x857ea0),_0x1957dc=segmentToYamlString(_0x596a02),_0x1ac7f8=generateDiff(_0x1957dc,'');console[_0x2bba36(0x117)](formatDiffWithColors(_0x1ac7f8)),console[_0x2bba36(0x117)]('─'[_0x2bba36(0x173)](0x3c));}const _0x258b2a=_0x326245[_0x2bba36(0x116)](_0x462768=>!_0x462768['isNew']&&_0x462768[_0x2bba36(0x15b)]);if(_0x258b2a[_0x2bba36(0x172)]>0x0&&!_0x159481[_0x2bba36(0x18c)])for(const _0x260302 of _0x258b2a){const _0x175966=_0x260302[_0x2bba36(0x169)]?_0x260302[_0x2bba36(0x169)]+'/'+_0x260302[_0x2bba36(0x133)][_0x2bba36(0x14a)]:_0x260302[_0x2bba36(0x133)]['name'];console[_0x2bba36(0x117)]('\x0a'+a31_0x383748[_0x2bba36(0x13c)](_0x2bba36(0x15e))+'\x20'+_0x175966),console['error']('─'[_0x2bba36(0x173)](0x3c)),console[_0x2bba36(0x117)](_0x260302[_0x2bba36(0x15b)]),console[_0x2bba36(0x117)]('─'[_0x2bba36(0x173)](0x3c));}if(_0x255654['length']>0x0)for(const _0x54117b of _0x255654){const _0x4ea83e=_0x54117b[_0x2bba36(0x169)]?_0x54117b[_0x2bba36(0x169)]+'/'+_0x54117b[_0x2bba36(0x133)]['name']:_0x54117b['yamlConfig'][_0x2bba36(0x14a)];console[_0x2bba36(0x117)]('\x0a'+a31_0x383748[_0x2bba36(0x137)]('New\x20journey:')+'\x20'+_0x4ea83e),console[_0x2bba36(0x117)]('─'[_0x2bba36(0x173)](0x3c)),_0x54117b[_0x2bba36(0x15b)]&&console[_0x2bba36(0x117)](_0x54117b[_0x2bba36(0x15b)]),console[_0x2bba36(0x117)]('─'['repeat'](0x3c));}const _0x503455=_0x252cc9[_0x2bba36(0x116)](_0x52ff8b=>!_0x52ff8b[_0x2bba36(0x108)]&&_0x52ff8b[_0x2bba36(0x15b)]);if(_0x503455['length']>0x0)for(const _0x51dea2 of _0x503455){const _0x501d38=_0x51dea2[_0x2bba36(0x169)]?_0x51dea2[_0x2bba36(0x169)]+'/'+_0x51dea2[_0x2bba36(0x133)][_0x2bba36(0x14a)]:_0x51dea2['yamlConfig']['name'];console[_0x2bba36(0x117)]('\x0a'+a31_0x383748[_0x2bba36(0x13c)](_0x2bba36(0x154))+'\x20'+_0x501d38),console[_0x2bba36(0x117)]('─'[_0x2bba36(0x173)](0x3c)),console[_0x2bba36(0x117)](_0x51dea2[_0x2bba36(0x15b)]),console['error']('─'[_0x2bba36(0x173)](0x3c));}if(_0x2226fc[_0x2bba36(0x172)]>0x0)for(const _0x316c62 of _0x2226fc){const _0x15f9c2=_0x316c62[_0x2bba36(0x174)]?_0x18648f['get'](_0x316c62[_0x2bba36(0x174)])||'':'',_0x4a7fa6=_0x15f9c2?_0x15f9c2+'/'+_0x316c62[_0x2bba36(0x153)]:_0x316c62[_0x2bba36(0x153)];console['error']('\x0a'+a31_0x383748['red'](_0x2bba36(0x100))+'\x20'+_0x4a7fa6),console[_0x2bba36(0x117)]('─'[_0x2bba36(0x173)](0x3c)),console[_0x2bba36(0x117)](a31_0x383748['red'](_0x2bba36(0x103))),console['error']('─'[_0x2bba36(0x173)](0x3c));}if(_0x159481['dryRun'])return console['error'](a31_0x383748[_0x2bba36(0x13c)](_0x2bba36(0x118))),0x0;const _0xa9bc26=_0x159481['journeysOnly']?![]:_0x5575c5[_0x2bba36(0x172)]>0x0||_0x5351ab[_0x2bba36(0x172)]>0x0||_0x30299d['length']>0x0,_0x1a1ddd=_0x255654[_0x2bba36(0x172)]>0x0||_0x1347fe[_0x2bba36(0x172)]>0x0||_0x2226fc['length']>0x0,_0x4511cb=_0x159481[_0x2bba36(0x18c)]?![]:_0x2cbdd9[_0x2bba36(0x172)]>0x0,_0x2d3b15=_0x343a19[_0x2bba36(0x172)]>0x0;if(!_0xa9bc26&&!_0x1a1ddd&&!_0x4511cb&&!_0x2d3b15){const _0x424ec4=_0x159481[_0x2bba36(0x18c)]?_0x2bba36(0x16f):_0x2bba36(0x15f);console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x137)](_0x424ec4));if(_0x3b6de0&&_0x46743b[_0x2bba36(0x172)]===0x1){const _0x493b3e=_0x46743b[0x0];if(_0x493b3e[_0x2bba36(0x168)]?.['id']){const _0x15d3ae=getConsoleNextUrl(_0x159481[_0x2bba36(0x162)],_0x2bba36(0x107)+_0x58ed2b+_0x2bba36(0x156)+_0x493b3e['existingJourney']['id']+'/j/da/je');console[_0x2bba36(0x117)]('\x20\x20'+a31_0x383748['cyan'](_0x15d3ae));}}return 0x0;}const _0x4f66e2=_0x159481['journeysOnly']?_0x255654[_0x2bba36(0x172)]+_0x1347fe['length']+_0x2226fc[_0x2bba36(0x172)]+_0x343a19['length']:_0x5575c5[_0x2bba36(0x172)]+_0x5351ab[_0x2bba36(0x172)]+_0x30299d[_0x2bba36(0x172)]+_0x255654[_0x2bba36(0x172)]+_0x1347fe[_0x2bba36(0x172)]+_0x2226fc[_0x2bba36(0x172)]+_0x343a19[_0x2bba36(0x172)]+_0x2cbdd9['length'];if(!_0x159481[_0x2bba36(0x143)]&&_0x4f66e2>0x0){if(!isInteractive())return console['error'](a31_0x383748[_0x2bba36(0x16d)](_0x2bba36(0x140)),_0x2bba36(0x12a)),console['error'](a31_0x383748[_0x2bba36(0x178)](_0x2bba36(0x126))),0x1;const _0x3f95f3=await confirmKey(_0x2bba36(0xf8)+_0x4f66e2+_0x2bba36(0x159));if(!_0x3f95f3)return console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x13c)](_0x2bba36(0x113))),0x1;}const _0x321c2f={'withProgress':async(_0x14c586,_0x4f03b2)=>{const _0xdddd44=_0x2bba36,_0x1bc7a7=await withSpinner(_0x14c586,_0x4f03b2,{'verbose':_0x159481[_0xdddd44(0x163)]});return{'data':_0x1bc7a7[_0xdddd44(0x148)]};},'logInfo':_0x36d087=>console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x180)]('βœ”\x20'+_0x36d087)),'logSuccess':_0xbcace0=>console['error'](a31_0x383748['green']('βœ”\x20'+_0xbcace0)),'logWarning':_0x1b1525=>console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x13c)]('⚠\x20'+_0x1b1525)),'logDeleted':_0x23291c=>console[_0x2bba36(0x117)](a31_0x383748[_0x2bba36(0x16d)]('βœ”\x20'+_0x23291c))},_0x1cf368={'segment':_0x1fcc41[_0x2bba36(0x16a)],'journey':_0x1fcc41[_0x2bba36(0x104)],'user':_0x1fcc41[_0x2bba36(0x157)],'connection':_0x1fcc41[_0x2bba36(0x11f)]};_0x343a19[_0x2bba36(0x172)]>0x0&&(_0x4f975a=await executePushFolders(_0x1cf368,_0x343a19,_0x4f975a,{'parentId':_0x58ed2b},_0x321c2f));const _0x4b282c={'rootFolderId':_0x2688fd,'folderPathToId':_0x4f975a,'folderIdToPath':_0x18648f,'segmentNameToId':_0x5be75d,'activationsBySegmentId':_0x4f17d2,'emailToIdMap':_0x3500a2,'idToEmailMap':_0x2d418c,'connectionNameToIdMap':_0x99a77d['nameToId'],'connectionIdToNameMap':_0x99a77d[_0x2bba36(0x115)],'connectionNameToTypeMap':_0x48131c},_0x53128a=await executePushSegments(_0x1cf368,_0x159481[_0x2bba36(0x18c)]?[]:_0x326245,_0x4b282c,{'parentId':_0x58ed2b},_0x321c2f),_0x143e4c=_0x53128a[_0x2bba36(0x17b)],_0x52d26a=_0x53128a[_0x2bba36(0x17d)],_0x5d64d4=_0x53128a['activations'][_0x2bba36(0x17b)],_0x4f1891=_0x53128a[_0x2bba36(0xfd)][_0x2bba36(0x17d)],_0x1a7975=_0x53128a['activations'][_0x2bba36(0x170)],_0x2af896=await executePushSegmentDeletions(_0x1cf368,_0x159481[_0x2bba36(0x18c)]?[]:_0x30299d,_0x321c2f);let _0x31816b=0x0,_0x119d8b=0x0,_0x149801=0x0;const _0x2c97fa=new Map(_0x5be75d);for(const [_0x2b2582,_0x41b457]of _0x53128a['createdSegmentIds']){_0x2c97fa[_0x2bba36(0x18b)](_0x2b2582,_0x41b457);}if(_0x252cc9[_0x2bba36(0x172)]>0x0){const _0x54ddc6={..._0x4b282c,'segmentNameToId':_0x2c97fa,'existingSegments':_0x4c14e0,'activationContext':_0x276f8c},_0x3aa201=await executePushJourneys(_0x1cf368,_0x252cc9,_0x54ddc6,{'parentId':_0x58ed2b,'rootFolderId':_0x2688fd,'verbose':_0x159481[_0x2bba36(0x163)]},_0x321c2f);_0x31816b=_0x3aa201[_0x2bba36(0x17b)],_0x119d8b=_0x3aa201[_0x2bba36(0x17d)];if(_0x3b6de0&&_0x3aa201[_0x2bba36(0x183)]['length']===0x1){const _0x11b64e=_0x3aa201['results'][0x0];if(_0x11b64e[_0x2bba36(0x16e)]){const _0x31cb14=getConsoleNextUrl(_0x159481['site'],_0x2bba36(0x107)+_0x58ed2b+_0x2bba36(0x156)+_0x11b64e[_0x2bba36(0x16e)]+'/j/da/je');console[_0x2bba36(0x117)]('\x20\x20'+a31_0x383748[_0x2bba36(0x175)](_0x31cb14));}}}for(const _0x49cfc8 of _0x2226fc){console[_0x2bba36(0x117)](a31_0x383748['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x49cfc8['journeyBundleName'])),_0x149801++;}const _0x1d2098=[];if(_0x143e4c>0x0)_0x1d2098['push'](_0x143e4c+_0x2bba36(0x15a));if(_0x52d26a>0x0)_0x1d2098[_0x2bba36(0x11d)](_0x52d26a+'\x20updated');if(_0x2af896>0x0)_0x1d2098[_0x2bba36(0x11d)](_0x2af896+'\x20deleted');const _0x5bff54=[];if(_0x31816b>0x0)_0x5bff54[_0x2bba36(0x11d)](_0x31816b+_0x2bba36(0x15a));if(_0x119d8b>0x0)_0x5bff54[_0x2bba36(0x11d)](_0x119d8b+_0x2bba36(0x10a));if(_0x149801>0x0)_0x5bff54[_0x2bba36(0x11d)](_0x149801+'\x20deleted');const _0x2d1fe5=[];if(_0x5d64d4>0x0)_0x2d1fe5[_0x2bba36(0x11d)](_0x5d64d4+_0x2bba36(0x15a));if(_0x4f1891>0x0)_0x2d1fe5['push'](_0x4f1891+_0x2bba36(0x10a));if(_0x1a7975>0x0)_0x2d1fe5['push'](_0x1a7975+_0x2bba36(0x15d));return console[_0x2bba36(0x117)](a31_0x383748['green'](_0x2bba36(0x150))),_0x1d2098[_0x2bba36(0x172)]>0x0&&!_0x159481['journeysOnly']&&console['error'](_0x2bba36(0x182)+_0x1d2098['join'](',\x20')),_0x5bff54[_0x2bba36(0x172)]>0x0&&console['error'](_0x2bba36(0x177)+_0x5bff54[_0x2bba36(0x13b)](',\x20')),_0x2d1fe5[_0x2bba36(0x172)]>0x0&&!_0x159481['journeysOnly']&&console[_0x2bba36(0x117)]('\x20\x20Activations:\x20'+_0x2d1fe5[_0x2bba36(0x13b)](',\x20')),0x0;}}