@treasuredata/tdx 0.28.2 → 0.28.3

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 (179) 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/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.js +1 -1
  120. package/dist/sdk/segment/journey-validator.js +1 -1
  121. package/dist/sdk/segment/journey-yaml.js +1 -1
  122. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  123. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  124. package/dist/sdk/segment/pull-workflow.js +1 -1
  125. package/dist/sdk/segment/push-recovery.js +1 -1
  126. package/dist/sdk/segment/push-workflow.js +1 -1
  127. package/dist/sdk/segment/resolution-context.js +1 -1
  128. package/dist/sdk/segment/segment-path-parser.js +1 -1
  129. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  130. package/dist/sdk/segment/target-resolution.js +1 -1
  131. package/dist/sdk/segment/tdx-config.js +1 -1
  132. package/dist/sdk/segment/validate-files.js +1 -1
  133. package/dist/sdk/segment/yaml-validator.js +1 -1
  134. package/dist/sdk/segment.js +1 -1
  135. package/dist/sdk/types/index.js +1 -1
  136. package/dist/sdk/types/progress.js +1 -1
  137. package/dist/sdk/user.js +1 -1
  138. package/dist/sdk/util/format-detector.js +1 -1
  139. package/dist/sdk/util/formatters.js +1 -1
  140. package/dist/sdk/util/index.js +1 -1
  141. package/dist/sdk/util/tree-formatter.js +1 -1
  142. package/dist/sdk/workflow/archive-validation.js +1 -1
  143. package/dist/sdk/workflow/clone-workflow.js +1 -1
  144. package/dist/sdk/workflow/index.js +1 -1
  145. package/dist/sdk/workflow/pull-workflow.js +1 -1
  146. package/dist/sdk/workflow/push-workflow.js +1 -1
  147. package/dist/sdk/workflow/tdx-config.js +1 -1
  148. package/dist/sdk/workflow/workflow-utils.js +1 -1
  149. package/dist/test-utils/command-runner.js +1 -1
  150. package/dist/test-utils/factories.js +1 -1
  151. package/dist/test-utils/fixtures.js +1 -1
  152. package/dist/test-utils/http-mock.js +1 -1
  153. package/dist/test-utils/index.js +1 -1
  154. package/dist/utils/async.js +1 -1
  155. package/dist/utils/colors.js +1 -1
  156. package/dist/utils/diff.js +1 -1
  157. package/dist/utils/file-permissions.js +1 -1
  158. package/dist/utils/global-cache.js +1 -1
  159. package/dist/utils/json-loader.js +1 -1
  160. package/dist/utils/local-cache.js +1 -1
  161. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  162. package/dist/utils/logger/formatters/index.js +1 -1
  163. package/dist/utils/logger/handlers/console-handler.js +1 -1
  164. package/dist/utils/logger/handlers/file-handler.js +1 -1
  165. package/dist/utils/logger/handlers/index.js +1 -1
  166. package/dist/utils/logger/handlers/null-handler.js +1 -1
  167. package/dist/utils/logger/index.js +1 -1
  168. package/dist/utils/logger/logger.js +1 -1
  169. package/dist/utils/logger/types.js +1 -1
  170. package/dist/utils/option-validation.js +1 -1
  171. package/dist/utils/process.js +1 -1
  172. package/dist/utils/prompt.js +1 -1
  173. package/dist/utils/spinner.js +1 -1
  174. package/dist/utils/sse-parser.js +1 -1
  175. package/dist/utils/string-utils.js +1 -1
  176. package/dist/utils/table-ref-parser.js +1 -1
  177. package/dist/utils/tdx-logger.js +1 -1
  178. package/dist/utils/version-check.js +1 -1
  179. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x173c50=a30_0x200d;(function(_0x5b9ede,_0xcb5586){const _0x1bfe8b=a30_0x200d,_0x238a29=_0x5b9ede();while(!![]){try{const _0x520a3d=parseInt(_0x1bfe8b(0x14f))/0x1+-parseInt(_0x1bfe8b(0x13e))/0x2*(-parseInt(_0x1bfe8b(0x18f))/0x3)+parseInt(_0x1bfe8b(0x1ab))/0x4*(-parseInt(_0x1bfe8b(0x1b0))/0x5)+parseInt(_0x1bfe8b(0x1a0))/0x6+-parseInt(_0x1bfe8b(0x14c))/0x7+parseInt(_0x1bfe8b(0x122))/0x8*(-parseInt(_0x1bfe8b(0x190))/0x9)+-parseInt(_0x1bfe8b(0x120))/0xa*(-parseInt(_0x1bfe8b(0x199))/0xb);if(_0x520a3d===_0xcb5586)break;else _0x238a29['push'](_0x238a29['shift']());}catch(_0x589ead){_0x238a29['push'](_0x238a29['shift']());}}}(a30_0x4a3f,0x1f2bd));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';function a30_0x4a3f(){const _0x30af15=['timezone','jobs','\x20\x20Timezone:\x20','INVALID_ARGUMENT','name','11748UHSONp','Deleting\x20schedule...','d\x20ago','\x20schedules','m\x20ago','status','dim','632016bUKskH','update','schedule:run','jsonl','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','engine_version','just\x20now','Query\x20file\x20is\x20empty','never','Creating\x20schedule:\x20','\x20created','6056KHGQfB','Running\x20schedule:\x20','ended_at','history','table','305CnwtPJ','schedule:show','listQueries','1070LNwEna','length','1267256Jzmoto','Update\x20a\x20scheduled\x20query','count','\x20\x20→\x20','description','List\x20scheduled\x20queries','\x20scheduled\x20quer','success','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','Showing\x20first\x20','execute','\x20\x20Type:\x20','limit','scheduled_at','h\x20ago','Updating\x20schedule:\x20','time_zone','result','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','create','engineVersion','\x20\x20Cron:\x20','database','Updating\x20schedule...','Create\x20a\x20scheduled\x20query','\x20\x20Job\x20ID:\x20','query','show','2rETUVr','job_id','Failed\x20to\x20read\x20file:\x20','statusIcon','max','Cancelled','priority','padEnd','\x20\x20Time:\x20','validate','Schedule\x20created:\x20','📅\x20','No\x20scheduled\x20queries\x20found','Delete\x20a\x20scheduled\x20query','1549555vnVzNC','delay','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','145925MDYiMm','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','cyan','nextRun','Searching\x20scheduled\x20queries\x20matching\x20\x22','args','(unnamed)','schedule:history','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','time','utf-8','abs','\x20\x20Num:\x20','queryUrl','red','log','yes','...','created_at','site','trim','updated_at','round','join','verbose','queries','toLocaleDateString','green','repeat','\x20\x20Database:\x20','from','delete','error','Schedule\x20updated:\x20','json','data','lastRun','map','Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]','schedules','schedule:update','retry_limit','\x20(showing\x20','format','cron','\x20execution','\x20job','Found\x20','last_job','Running\x20schedule...','type','options','in\x20','Creating\x20schedule...','file','entries','/app/queries/editor?queryId=','Listing\x20scheduled\x20queries...','retryLimit','schedule:create','trino','Run\x20a\x20scheduled\x20query\x20immediately','schedule:delete','user','702798dlgbnR','9eIZYXc','has_next_page','next_run_at','num'];a30_0x4a3f=function(){return _0x30af15;};return a30_0x4a3f();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x4621e1 from'chalk';function a30_0x200d(_0x4dcd7b,_0x572658){_0x4dcd7b=_0x4dcd7b-0x120;const _0x4a3fff=a30_0x4a3f();let _0x200d41=_0x4a3fff[_0x4dcd7b];return _0x200d41;}function formatRelativeTime(_0x1b3ff3){const _0x1b6738=a30_0x200d,_0x5cd646=new Date(_0x1b3ff3),_0x7703ce=new Date(),_0x2cb4b0=_0x5cd646['getTime']()-_0x7703ce['getTime'](),_0x4e7c36=Math[_0x1b6738(0x15a)](_0x2cb4b0)/0x3e8,_0x5d5811=_0x2cb4b0<0x0;if(_0x4e7c36<0x3c)return _0x5d5811?_0x1b6738(0x1a6):'soon';else{if(_0x4e7c36<0xe10){const _0x43291a=Math[_0x1b6738(0x165)](_0x4e7c36/0x3c);return _0x5d5811?_0x43291a+_0x1b6738(0x19d):'in\x20'+_0x43291a+'m';}else{if(_0x4e7c36<0x15180){const _0x407f3a=Math[_0x1b6738(0x165)](_0x4e7c36/0xe10);return _0x5d5811?_0x407f3a+_0x1b6738(0x130):'in\x20'+_0x407f3a+'h';}else{if(_0x4e7c36<0x93a80){const _0x1c5f41=Math[_0x1b6738(0x165)](_0x4e7c36/0x15180);return _0x5d5811?_0x1c5f41+_0x1b6738(0x19b):_0x1b6738(0x183)+_0x1c5f41+'d';}else return _0x5cd646[_0x1b6738(0x169)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x173c50(0x198)]='schedule:list';[a30_0x173c50(0x126)]=a30_0x173c50(0x127);async['execute'](_0x4e23d6){const _0x79a5d1=a30_0x173c50,{options:_0xa03d05,args:_0x561c9a,tdx:_0x595dd0}=_0x4e23d6,_0x2983fa=resolveLimit(_0xa03d05[_0x79a5d1(0x12e)],DEFAULT_DISPLAY_LIMIT),_0x495134=_0x561c9a[0x0],_0xcfbbaa=_0x495134?_0x79a5d1(0x153)+_0x495134+'\x22...':_0x79a5d1(0x188),_0x1130e7=await withSpinner(_0xcfbbaa,()=>_0x595dd0[_0x79a5d1(0x176)][_0x79a5d1(0x1b2)]({'limit':_0x2983fa,'scheduled':!![],'pattern':_0x495134}),{'verbose':_0xa03d05[_0x79a5d1(0x167)]}),_0x59656c=_0x1130e7[_0x79a5d1(0x172)][_0x79a5d1(0x168)],_0x15e84d=_0x1130e7[_0x79a5d1(0x172)]['pagination'][_0x79a5d1(0x191)],_0x411796=_0x495134?'\x20matching\x20\x22'+_0x495134+'\x22':'';_0x15e84d?console[_0x79a5d1(0x16f)](_0x79a5d1(0x12b)+_0x59656c[_0x79a5d1(0x121)]+_0x79a5d1(0x19c)+_0x411796+'\x20(use\x20--limit\x20to\x20see\x20more)'):console[_0x79a5d1(0x16f)](_0x79a5d1(0x17e)+_0x59656c[_0x79a5d1(0x121)]+_0x79a5d1(0x128)+(_0x59656c[_0x79a5d1(0x121)]!==0x1?'ies':'y')+_0x411796);if(_0xa03d05['format']===_0x79a5d1(0x171)||_0xa03d05['format']===_0x79a5d1(0x1a3)||_0xa03d05[_0x79a5d1(0x17a)]===_0x79a5d1(0x1af)||_0xa03d05[_0x79a5d1(0x17a)]==='tsv'){const _0x26de1d=_0x59656c[_0x79a5d1(0x174)](_0x8fadc4=>({'id':_0x8fadc4['id'],'name':_0x8fadc4[_0x79a5d1(0x198)],'cron':_0x8fadc4[_0x79a5d1(0x17b)],'database':_0x8fadc4[_0x79a5d1(0x138)]?.['name'],'type':_0x8fadc4['type'],'timezone':_0x8fadc4[_0x79a5d1(0x132)],'user_name':_0x8fadc4[_0x79a5d1(0x18e)]?.['name'],'updated_at':_0x8fadc4[_0x79a5d1(0x164)],'next_run_at':_0x8fadc4['next_run_at'],'last_job_status':_0x8fadc4[_0x79a5d1(0x17f)]?.[_0x79a5d1(0x19e)]}));await handleSDKOutput(_0x26de1d,_0xa03d05);}else{if(_0x59656c[_0x79a5d1(0x121)]===0x0)console[_0x79a5d1(0x15e)](_0x79a5d1(0x14a));else{const _0x8f0f55=_0xa03d05[_0x79a5d1(0x162)],_0x3a4b61=_0x59656c['map'](_0x25f08f=>{const _0x468375=_0x79a5d1,_0x454b49=_0x25f08f['last_job']?.[_0x468375(0x19e)]?_0x25f08f['last_job'][_0x468375(0x19e)]===_0x468375(0x129)?'✓':'✗':'-',_0xdfd830=_0x25f08f[_0x468375(0x17f)]?.[_0x468375(0x1ad)]?formatRelativeTime(_0x25f08f[_0x468375(0x17f)][_0x468375(0x1ad)]):_0x468375(0x1a8),_0x387078=_0x25f08f['next_run_at']?formatRelativeTime(_0x25f08f[_0x468375(0x192)]):'-',_0x1a97e6=_0x25f08f[_0x468375(0x17b)]||'',_0x3b3e1b=_0x25f08f[_0x468375(0x198)]||_0x468375(0x155),_0x249e84=getConsoleUrl(_0x8f0f55,_0x468375(0x187)+_0x25f08f['id']);return{'statusIcon':_0x454b49,'lastRun':_0xdfd830,'nextRun':_0x387078,'cron':_0x1a97e6,'name':_0x3b3e1b,'queryUrl':_0x249e84,'status':_0x25f08f[_0x468375(0x17f)]?.[_0x468375(0x19e)]};}),_0xb641a4=Math[_0x79a5d1(0x142)](..._0x3a4b61[_0x79a5d1(0x174)](_0x3d3bd5=>_0x3d3bd5[_0x79a5d1(0x173)]['length'])),_0x24e533=Math[_0x79a5d1(0x142)](..._0x3a4b61['map'](_0x2d8655=>_0x2d8655[_0x79a5d1(0x152)][_0x79a5d1(0x121)])),_0x19a875=Math[_0x79a5d1(0x142)](..._0x3a4b61[_0x79a5d1(0x174)](_0x1ccd2e=>_0x1ccd2e[_0x79a5d1(0x17b)][_0x79a5d1(0x121)])),_0x11f34a=_0x3a4b61[_0x79a5d1(0x174)](_0x565166=>{const _0x11b088=_0x79a5d1,_0x190eef=_0x565166['status']===_0x11b088(0x129)?a30_0x4621e1[_0x11b088(0x16a)](_0x565166[_0x11b088(0x141)]):_0x565166['status']===_0x11b088(0x16f)?a30_0x4621e1[_0x11b088(0x15d)](_0x565166[_0x11b088(0x141)]):a30_0x4621e1[_0x11b088(0x19f)](_0x565166[_0x11b088(0x141)]),_0x13e978=_0x565166[_0x11b088(0x173)]['padEnd'](_0xb641a4),_0x420ae5=_0x565166['nextRun'][_0x11b088(0x145)](_0x24e533),_0xdebea=_0x565166['cron']?a30_0x4621e1[_0x11b088(0x151)](_0x565166[_0x11b088(0x17b)]['padEnd'](_0x19a875)):'\x20'[_0x11b088(0x16b)](_0x19a875),_0x480fc5=hyperlink(_0x565166[_0x11b088(0x198)],_0x565166[_0x11b088(0x15c)]);return _0x11b088(0x149)+_0x190eef+'\x20'+_0x13e978+_0x11b088(0x125)+_0x420ae5+'\x20\x20'+_0xdebea+'\x20\x20'+_0x480fc5;});await writeOutput(_0x11f34a[_0x79a5d1(0x166)]('\x0a'),_0xa03d05['output'],'list');}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{['name']=a30_0x173c50(0x1b1);[a30_0x173c50(0x126)]='Show\x20schedule\x20details';[a30_0x173c50(0x147)](_0x14bde4){const _0x25d920=a30_0x173c50,_0x3f3753=_0x14bde4[_0x25d920(0x154)][0x0];if(!_0x3f3753)return _0x25d920(0x14e);return undefined;}async[a30_0x173c50(0x12c)](_0x4a2674){const _0x4033ed=a30_0x173c50,{options:_0x5b96aa,args:_0xe3c68a,tdx:_0x2c4545}=_0x4a2674,_0x372678=_0xe3c68a[0x0],_0xa3be6e=await withSpinner('Getting\x20schedule\x20details...',()=>_0x2c4545[_0x4033ed(0x176)][_0x4033ed(0x13d)](_0x372678),{'verbose':_0x5b96aa[_0x4033ed(0x167)]}),_0x1027ba=_0xa3be6e[_0x4033ed(0x172)],_0x19e02a={'name':_0x1027ba[_0x4033ed(0x198)],'cron':_0x1027ba['cron'],'database':_0x1027ba[_0x4033ed(0x138)],'type':_0x1027ba[_0x4033ed(0x181)],'timezone':_0x1027ba[_0x4033ed(0x194)],'user_name':_0x1027ba['user_name'],'created_at':_0x1027ba[_0x4033ed(0x161)],'engine_version':_0x1027ba[_0x4033ed(0x1a5)],'executing_user_id':_0x1027ba['executing_user_id'],'query':_0x1027ba[_0x4033ed(0x13c)],'delay':_0x1027ba[_0x4033ed(0x14d)],'priority':_0x1027ba[_0x4033ed(0x144)],'retry_limit':_0x1027ba['retry_limit'],..._0x1027ba[_0x4033ed(0x133)]&&{'result':_0x1027ba[_0x4033ed(0x133)]}};return await handleSingleObjectOutput(_0x19e02a,_0x5b96aa),0x0;}}export class ScheduleCreateCommand extends BaseCommand{['name']=a30_0x173c50(0x18a);[a30_0x173c50(0x126)]=a30_0x173c50(0x13a);[a30_0x173c50(0x147)](_0x936d91){const _0x440140=a30_0x173c50,_0x471dc5=_0x936d91[_0x440140(0x154)][0x0];if(!_0x471dc5)return _0x440140(0x12a);const _0xc4efa8=_0x936d91[_0x440140(0x182)];if(!_0xc4efa8[_0x440140(0x138)])return _0x440140(0x175);return undefined;}async['execute'](_0x84fcb2){const _0x446933=a30_0x173c50,{options:_0xa2625c,args:_0x3a5618,tdx:_0x29a78d}=_0x84fcb2,_0x4c4019=_0x3a5618[0x0],_0x1a280c=_0xa2625c,_0x1bf0af=_0x1a280c[_0x446933(0x138)],_0x5b8854=_0x1a280c[_0x446933(0x185)],_0x5ac1ef=_0x1a280c['type']||_0x446933(0x18b);let _0x5e5347;try{_0x5e5347=readFileSync(_0x5b8854,_0x446933(0x159))[_0x446933(0x163)]();}catch(_0x17d508){throw new SDKError(ErrorCode[_0x446933(0x197)],_0x446933(0x140)+_0x5b8854,_0x17d508 instanceof Error?_0x17d508:undefined);}if(!_0x5e5347)throw new SDKError(ErrorCode[_0x446933(0x197)],_0x446933(0x1a7));const _0x26dbbf={'database':_0x1bf0af,'query':_0x5e5347,'type':_0x5ac1ef};if(_0x1a280c[_0x446933(0x17b)])_0x26dbbf[_0x446933(0x17b)]=_0x1a280c['cron'];if(_0x1a280c['timezone'])_0x26dbbf[_0x446933(0x194)]=_0x1a280c[_0x446933(0x194)];if(_0x1a280c['delay']!==undefined)_0x26dbbf[_0x446933(0x14d)]=Number(_0x1a280c[_0x446933(0x14d)]);if(_0x1a280c[_0x446933(0x144)]!==undefined)_0x26dbbf[_0x446933(0x144)]=Number(_0x1a280c[_0x446933(0x144)]);if(_0x1a280c[_0x446933(0x189)]!==undefined)_0x26dbbf[_0x446933(0x178)]=Number(_0x1a280c['retryLimit']);if(_0x1a280c[_0x446933(0x136)])_0x26dbbf[_0x446933(0x1a5)]=_0x1a280c['engineVersion'];if(_0x1a280c[_0x446933(0x133)])_0x26dbbf[_0x446933(0x133)]=_0x1a280c[_0x446933(0x133)];if(_0xa2625c[_0x446933(0x167)]){console['error'](_0x446933(0x1a9)+_0x4c4019),console[_0x446933(0x16f)](_0x446933(0x16c)+_0x1bf0af),console[_0x446933(0x16f)](_0x446933(0x12d)+_0x5ac1ef);if(_0x26dbbf[_0x446933(0x17b)])console[_0x446933(0x16f)](_0x446933(0x137)+_0x26dbbf['cron']);if(_0x26dbbf['timezone'])console[_0x446933(0x16f)](_0x446933(0x196)+_0x26dbbf[_0x446933(0x194)]);}const _0xb15e2b=await withSpinner(_0x446933(0x184),()=>_0x29a78d['schedules'][_0x446933(0x135)](_0x4c4019,_0x26dbbf),{'verbose':_0xa2625c[_0x446933(0x167)]});return console[_0x446933(0x16f)](_0x446933(0x148)+_0xb15e2b['data']['name']),await handleSingleObjectOutput(_0xb15e2b[_0x446933(0x172)],_0xa2625c),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x173c50(0x198)]=a30_0x173c50(0x177);[a30_0x173c50(0x126)]=a30_0x173c50(0x123);[a30_0x173c50(0x147)](_0x328ad8){const _0x4a8bfc=a30_0x173c50,_0x5ad504=_0x328ad8[_0x4a8bfc(0x154)][0x0];if(!_0x5ad504)return _0x4a8bfc(0x157);return undefined;}async[a30_0x173c50(0x12c)](_0xd62090){const _0x4b8ed1=a30_0x173c50,{options:_0x3f6ab5,args:_0x16593f,tdx:_0x1830f9}=_0xd62090,_0x2ea310=_0x16593f[0x0],_0x286024=_0x3f6ab5,_0x3b2437={};if(_0x286024[_0x4b8ed1(0x138)])_0x3b2437[_0x4b8ed1(0x138)]=_0x286024[_0x4b8ed1(0x138)];if(_0x286024[_0x4b8ed1(0x181)])_0x3b2437[_0x4b8ed1(0x181)]=_0x286024[_0x4b8ed1(0x181)];if(_0x286024['cron'])_0x3b2437[_0x4b8ed1(0x17b)]=_0x286024[_0x4b8ed1(0x17b)];if(_0x286024[_0x4b8ed1(0x194)])_0x3b2437[_0x4b8ed1(0x194)]=_0x286024['timezone'];if(_0x286024[_0x4b8ed1(0x14d)]!==undefined)_0x3b2437[_0x4b8ed1(0x14d)]=Number(_0x286024[_0x4b8ed1(0x14d)]);if(_0x286024[_0x4b8ed1(0x144)]!==undefined)_0x3b2437[_0x4b8ed1(0x144)]=Number(_0x286024[_0x4b8ed1(0x144)]);if(_0x286024[_0x4b8ed1(0x189)]!==undefined)_0x3b2437[_0x4b8ed1(0x178)]=Number(_0x286024[_0x4b8ed1(0x189)]);if(_0x286024[_0x4b8ed1(0x136)])_0x3b2437[_0x4b8ed1(0x1a5)]=_0x286024[_0x4b8ed1(0x136)];if(_0x286024['result'])_0x3b2437[_0x4b8ed1(0x133)]=_0x286024[_0x4b8ed1(0x133)];if(_0x286024[_0x4b8ed1(0x185)])try{_0x3b2437['query']=readFileSync(_0x286024[_0x4b8ed1(0x185)],_0x4b8ed1(0x159))[_0x4b8ed1(0x163)]();}catch(_0x1ff381){throw new SDKError(ErrorCode[_0x4b8ed1(0x197)],_0x4b8ed1(0x140)+_0x286024[_0x4b8ed1(0x185)],_0x1ff381 instanceof Error?_0x1ff381:undefined);}if(Object['keys'](_0x3b2437)[_0x4b8ed1(0x121)]===0x0)throw new SDKError(ErrorCode[_0x4b8ed1(0x197)],'At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update');if(_0x3f6ab5[_0x4b8ed1(0x167)]){console[_0x4b8ed1(0x16f)](_0x4b8ed1(0x131)+_0x2ea310);for(const [_0x41ae6f,_0x5720ab]of Object[_0x4b8ed1(0x186)](_0x3b2437)){_0x41ae6f==='query'?console[_0x4b8ed1(0x16f)]('\x20\x20'+_0x41ae6f+':\x20'+_0x5720ab['substring'](0x0,0x32)+_0x4b8ed1(0x160)):console['error']('\x20\x20'+_0x41ae6f+':\x20'+_0x5720ab);}}const _0x502c3f=await withSpinner(_0x4b8ed1(0x139),()=>_0x1830f9[_0x4b8ed1(0x176)][_0x4b8ed1(0x1a1)](_0x2ea310,_0x3b2437),{'verbose':_0x3f6ab5[_0x4b8ed1(0x167)]});return console['error'](_0x4b8ed1(0x170)+_0x502c3f[_0x4b8ed1(0x172)][_0x4b8ed1(0x198)]),await handleSingleObjectOutput(_0x502c3f['data'],_0x3f6ab5),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{[a30_0x173c50(0x198)]=a30_0x173c50(0x18d);['description']=a30_0x173c50(0x14b);['validate'](_0x1ee468){const _0x213e0f=a30_0x173c50,_0x4dd7ab=_0x1ee468[_0x213e0f(0x154)][0x0];if(!_0x4dd7ab)return _0x213e0f(0x1a4);return undefined;}async[a30_0x173c50(0x12c)](_0x5dc047){const _0x1f369b=a30_0x173c50,{options:_0x3b5261,args:_0x209396,tdx:_0xfb83a5}=_0x5dc047,_0x3d848a=_0x209396[0x0];if(!_0x3b5261[_0x1f369b(0x15f)]){const _0x45ca7f=await confirm(_0x1f369b(0x134)+_0x3d848a+'\x22?');if(!_0x45ca7f)return console[_0x1f369b(0x16f)](_0x1f369b(0x143)),0x0;}const _0x967532=await withSpinner(_0x1f369b(0x19a),()=>_0xfb83a5[_0x1f369b(0x176)][_0x1f369b(0x16e)](_0x3d848a),{'verbose':_0x3b5261[_0x1f369b(0x167)]});return console[_0x1f369b(0x16f)]('Schedule\x20deleted:\x20'+_0x967532[_0x1f369b(0x172)]['name']),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']=a30_0x173c50(0x1a2);['description']=a30_0x173c50(0x18c);[a30_0x173c50(0x147)](_0x1201b7){const _0x1eae41=a30_0x173c50,_0x3b03cc=_0x1201b7[_0x1eae41(0x154)][0x0];if(!_0x3b03cc)return _0x1eae41(0x150);return undefined;}async[a30_0x173c50(0x12c)](_0x56998b){const _0x4a8115=a30_0x173c50,{options:_0x324fbc,args:_0x1c924b,tdx:_0x5aed78}=_0x56998b,_0x8bbf67=_0x1c924b[0x0],_0x3aae90=_0x324fbc,_0x33672a=_0x3aae90[_0x4a8115(0x158)],_0x41801d=_0x3aae90[_0x4a8115(0x193)]!==undefined?Number(_0x3aae90[_0x4a8115(0x193)]):undefined;if(_0x324fbc['verbose']){console['error'](_0x4a8115(0x1ac)+_0x8bbf67);if(_0x33672a)console[_0x4a8115(0x16f)](_0x4a8115(0x146)+_0x33672a);if(_0x41801d)console[_0x4a8115(0x16f)](_0x4a8115(0x15b)+_0x41801d);}const _0x515fbf=await withSpinner(_0x4a8115(0x180),()=>_0x5aed78[_0x4a8115(0x176)]['run'](_0x8bbf67,{'time':_0x33672a,'num':_0x41801d}),{'verbose':_0x324fbc[_0x4a8115(0x167)]}),_0x11ae69=_0x515fbf[_0x4a8115(0x172)][_0x4a8115(0x195)];console[_0x4a8115(0x16f)]('Schedule\x20run\x20submitted:\x20'+_0x11ae69['length']+_0x4a8115(0x17d)+(_0x11ae69[_0x4a8115(0x121)]!==0x1?'s':'')+_0x4a8115(0x1aa));for(const _0x3ed433 of _0x11ae69){console['error'](_0x4a8115(0x13b)+_0x3ed433[_0x4a8115(0x13f)]);}return await handleSDKOutput(_0x11ae69,_0x324fbc),0x0;}}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x173c50(0x198)]=a30_0x173c50(0x156);[a30_0x173c50(0x126)]='Show\x20schedule\x20execution\x20history';[a30_0x173c50(0x147)](_0x489d89){const _0x5845eb=a30_0x173c50,_0x4785c4=_0x489d89[_0x5845eb(0x154)][0x0];if(!_0x4785c4)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async['execute'](_0x37aeda){const _0x330667=a30_0x173c50,{options:_0x2004cd,args:_0x3ebe8f,tdx:_0x4109b7}=_0x37aeda,_0x181106=_0x3ebe8f[0x0],_0x3c0ad2=_0x2004cd,_0x4cc32c=_0x3c0ad2[_0x330667(0x16d)]!==undefined?Number(_0x3c0ad2[_0x330667(0x16d)]):undefined,_0x54fa04=_0x3c0ad2['to']!==undefined?Number(_0x3c0ad2['to']):undefined,_0x949f18=await withSpinner('Getting\x20schedule\x20history...',()=>_0x4109b7[_0x330667(0x176)][_0x330667(0x1ae)](_0x181106,{'from':_0x4cc32c,'to':_0x54fa04}),{'verbose':_0x2004cd[_0x330667(0x167)]}),_0x12ce8e=_0x949f18[_0x330667(0x172)];console['error'](_0x330667(0x17e)+_0x12ce8e[_0x330667(0x124)]+_0x330667(0x17c)+(_0x12ce8e['count']!==0x1?'s':'')+_0x330667(0x179)+_0x12ce8e[_0x330667(0x16d)]+'-'+_0x12ce8e['to']+')');const _0x2d89b9=_0x12ce8e[_0x330667(0x1ae)][_0x330667(0x174)](_0x49dfe2=>({'job_id':_0x49dfe2['job_id'],'type':_0x49dfe2[_0x330667(0x181)],'status':_0x49dfe2[_0x330667(0x19e)],'scheduled_at':_0x49dfe2[_0x330667(0x12f)],'created_at':_0x49dfe2[_0x330667(0x161)],'start_at':_0x49dfe2['start_at'],'end_at':_0x49dfe2['end_at']}));return await handleSDKOutput(_0x2d89b9,_0x2004cd),0x0;}}
1
+ const a30_0x5c10b4=a30_0x2541;(function(_0x40df23,_0x1cfbb9){const _0x398ab3=a30_0x2541,_0x499a4c=_0x40df23();while(!![]){try{const _0x31502d=parseInt(_0x398ab3(0x1dd))/0x1+-parseInt(_0x398ab3(0x217))/0x2*(-parseInt(_0x398ab3(0x203))/0x3)+-parseInt(_0x398ab3(0x1d0))/0x4+parseInt(_0x398ab3(0x201))/0x5*(-parseInt(_0x398ab3(0x20d))/0x6)+-parseInt(_0x398ab3(0x1c8))/0x7+parseInt(_0x398ab3(0x202))/0x8+parseInt(_0x398ab3(0x216))/0x9;if(_0x31502d===_0x1cfbb9)break;else _0x499a4c['push'](_0x499a4c['shift']());}catch(_0x1c6fc6){_0x499a4c['push'](_0x499a4c['shift']());}}}(a30_0x17fb,0x527eb));function a30_0x17fb(){const _0xcb165d=['Running\x20schedule:\x20','query','num','\x20\x20Cron:\x20','updated_at','\x20schedules','options','\x20\x20Num:\x20','schedule:history','2403814yOlHAX','map','No\x20scheduled\x20queries\x20found','\x20\x20Time:\x20','join','queries','statusIcon','user_name','2584000zJodIj','jobs','substring','show','schedule:update','site','args','...','Deleting\x20schedule...','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20run\x20<name>\x20[--time\x20<iso8601>]\x20[--num\x20<1-10>]','\x20scheduled\x20quer','schedule:create','Show\x20schedule\x20details','206059JAwVrO','length','\x20(showing\x20','name','success','last_job','has_next_page','delete','soon','ended_at','end_at','Run\x20a\x20scheduled\x20query\x20immediately','\x20(use\x20--limit\x20to\x20see\x20more)','lastRun','timezone','tsv','database','At\x20least\x20one\x20option\x20must\x20be\x20provided\x20to\x20update','keys','data','schedules','time','listQueries','error','history','getTime','priority','(unnamed)','\x20\x20Database:\x20','count','queryUrl','description','schedule:show','green','created_at','ies','84185eScgCU','2253456yZSfnc','3WlTqJC','schedule:delete','toLocaleDateString','file','abs','trim','Found\x20','type','pagination','verbose','18RZVMUD','INVALID_ARGUMENT','json','cron','executing_user_id','in\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20schedule\x20\x22','Creating\x20schedule:\x20','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20show\x20<name>','6603534bBusGO','312690qoiqMf','just\x20now','Schedule\x20updated:\x20','result','Updating\x20schedule...','Delete\x20a\x20scheduled\x20query','engine_version','\x22...','Failed\x20to\x20read\x20file:\x20','repeat','Update\x20a\x20scheduled\x20query','Showing\x20first\x20','Getting\x20schedule\x20details...','Schedule\x20deleted:\x20','validate','cyan','m\x20ago','retryLimit','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20update\x20<name>\x20[options]','Query\x20file\x20is\x20empty','h\x20ago','Schedule\x20run\x20submitted:\x20','from','execute','Searching\x20scheduled\x20queries\x20matching\x20\x22','user','Running\x20schedule...','\x20matching\x20\x22','status','update','red','retry_limit','table','next_run_at','scheduled_at','limit','Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20delete\x20<name>','yes','padEnd','delay','Show\x20schedule\x20execution\x20history','/app/queries/editor?queryId=','format','\x20\x20Timezone:\x20','max','engineVersion','list','utf-8','Updating\x20schedule:\x20','job_id'];a30_0x17fb=function(){return _0xcb165d;};return a30_0x17fb();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm}from'../utils/prompt.js';import{readFileSync}from'fs';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a30_0x1aee3b from'chalk';function formatRelativeTime(_0xd1a669){const _0x509530=a30_0x2541,_0x26aeeb=new Date(_0xd1a669),_0x1e942f=new Date(),_0x38959b=_0x26aeeb[_0x509530(0x1f6)]()-_0x1e942f[_0x509530(0x1f6)](),_0x423ce2=Math[_0x509530(0x207)](_0x38959b)/0x3e8,_0xf75e27=_0x38959b<0x0;if(_0x423ce2<0x3c)return _0xf75e27?_0x509530(0x218):_0x509530(0x1e5);else{if(_0x423ce2<0xe10){const _0x5ad3bb=Math['round'](_0x423ce2/0x3c);return _0xf75e27?_0x5ad3bb+_0x509530(0x19d):_0x509530(0x212)+_0x5ad3bb+'m';}else{if(_0x423ce2<0x15180){const _0xee5d4a=Math['round'](_0x423ce2/0xe10);return _0xf75e27?_0xee5d4a+_0x509530(0x1a1):_0x509530(0x212)+_0xee5d4a+'h';}else{if(_0x423ce2<0x93a80){const _0x4237d2=Math['round'](_0x423ce2/0x15180);return _0xf75e27?_0x4237d2+'d\x20ago':_0x509530(0x212)+_0x4237d2+'d';}else return _0x26aeeb[_0x509530(0x205)]();}}}}export class ScheduleListCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]='schedule:list';[a30_0x5c10b4(0x1fc)]='List\x20scheduled\x20queries';async[a30_0x5c10b4(0x1a4)](_0xc666bb){const _0x14e66c=a30_0x5c10b4,{options:_0x53c5e5,args:_0x46b71f,tdx:_0x160627}=_0xc666bb,_0x435a82=resolveLimit(_0x53c5e5[_0x14e66c(0x1b0)],DEFAULT_DISPLAY_LIMIT),_0x28cdce=_0x46b71f[0x0],_0x3c0a83=_0x28cdce?_0x14e66c(0x1a5)+_0x28cdce+_0x14e66c(0x194):'Listing\x20scheduled\x20queries...',_0x2c7166=await withSpinner(_0x3c0a83,()=>_0x160627[_0x14e66c(0x1f1)][_0x14e66c(0x1f3)]({'limit':_0x435a82,'scheduled':!![],'pattern':_0x28cdce}),{'verbose':_0x53c5e5['verbose']}),_0x308524=_0x2c7166['data'][_0x14e66c(0x1cd)],_0x243647=_0x2c7166[_0x14e66c(0x1f0)][_0x14e66c(0x20b)][_0x14e66c(0x1e3)],_0x6d89a8=_0x28cdce?_0x14e66c(0x1a8)+_0x28cdce+'\x22':'';_0x243647?console[_0x14e66c(0x1f4)](_0x14e66c(0x198)+_0x308524['length']+_0x14e66c(0x1c4)+_0x6d89a8+_0x14e66c(0x1e9)):console[_0x14e66c(0x1f4)](_0x14e66c(0x209)+_0x308524['length']+_0x14e66c(0x1da)+(_0x308524[_0x14e66c(0x1de)]!==0x1?_0x14e66c(0x200):'y')+_0x6d89a8);if(_0x53c5e5[_0x14e66c(0x1b7)]===_0x14e66c(0x20f)||_0x53c5e5[_0x14e66c(0x1b7)]==='jsonl'||_0x53c5e5[_0x14e66c(0x1b7)]===_0x14e66c(0x1ad)||_0x53c5e5['format']===_0x14e66c(0x1ec)){const _0x153b4f=_0x308524[_0x14e66c(0x1c9)](_0x3a2099=>({'id':_0x3a2099['id'],'name':_0x3a2099['name'],'cron':_0x3a2099['cron'],'database':_0x3a2099['database']?.[_0x14e66c(0x1e0)],'type':_0x3a2099['type'],'timezone':_0x3a2099['time_zone'],'user_name':_0x3a2099[_0x14e66c(0x1a6)]?.[_0x14e66c(0x1e0)],'updated_at':_0x3a2099[_0x14e66c(0x1c3)],'next_run_at':_0x3a2099[_0x14e66c(0x1ae)],'last_job_status':_0x3a2099['last_job']?.[_0x14e66c(0x1a9)]}));await handleSDKOutput(_0x153b4f,_0x53c5e5);}else{if(_0x308524[_0x14e66c(0x1de)]===0x0)console['log'](_0x14e66c(0x1ca));else{const _0x27f4a2=_0x53c5e5[_0x14e66c(0x1d5)],_0x5c5017=_0x308524['map'](_0x7d0eb4=>{const _0x29fdd7=_0x14e66c,_0x5af1a7=_0x7d0eb4['last_job']?.[_0x29fdd7(0x1a9)]?_0x7d0eb4['last_job']['status']===_0x29fdd7(0x1e1)?'✓':'✗':'-',_0x4dc131=_0x7d0eb4[_0x29fdd7(0x1e2)]?.[_0x29fdd7(0x1e6)]?formatRelativeTime(_0x7d0eb4['last_job']['ended_at']):'never',_0xf9512e=_0x7d0eb4[_0x29fdd7(0x1ae)]?formatRelativeTime(_0x7d0eb4['next_run_at']):'-',_0x2694f3=_0x7d0eb4[_0x29fdd7(0x210)]||'',_0x53d299=_0x7d0eb4[_0x29fdd7(0x1e0)]||_0x29fdd7(0x1f8),_0x3195fa=getConsoleUrl(_0x27f4a2,_0x29fdd7(0x1b6)+_0x7d0eb4['id']);return{'statusIcon':_0x5af1a7,'lastRun':_0x4dc131,'nextRun':_0xf9512e,'cron':_0x2694f3,'name':_0x53d299,'queryUrl':_0x3195fa,'status':_0x7d0eb4[_0x29fdd7(0x1e2)]?.[_0x29fdd7(0x1a9)]};}),_0x47f616=Math[_0x14e66c(0x1b9)](..._0x5c5017[_0x14e66c(0x1c9)](_0x171d85=>_0x171d85[_0x14e66c(0x1ea)][_0x14e66c(0x1de)])),_0x6c7385=Math[_0x14e66c(0x1b9)](..._0x5c5017[_0x14e66c(0x1c9)](_0x17a7de=>_0x17a7de['nextRun']['length'])),_0xd5e3fa=Math[_0x14e66c(0x1b9)](..._0x5c5017[_0x14e66c(0x1c9)](_0x2188cd=>_0x2188cd['cron'][_0x14e66c(0x1de)])),_0x5064ae=_0x5c5017[_0x14e66c(0x1c9)](_0x5c27da=>{const _0x1fbf22=_0x14e66c,_0x21fee8=_0x5c27da[_0x1fbf22(0x1a9)]===_0x1fbf22(0x1e1)?a30_0x1aee3b[_0x1fbf22(0x1fe)](_0x5c27da['statusIcon']):_0x5c27da[_0x1fbf22(0x1a9)]===_0x1fbf22(0x1f4)?a30_0x1aee3b[_0x1fbf22(0x1ab)](_0x5c27da[_0x1fbf22(0x1ce)]):a30_0x1aee3b['dim'](_0x5c27da[_0x1fbf22(0x1ce)]),_0x1c5864=_0x5c27da['lastRun'][_0x1fbf22(0x1b3)](_0x47f616),_0x499a9b=_0x5c27da['nextRun'][_0x1fbf22(0x1b3)](_0x6c7385),_0x1c31d1=_0x5c27da[_0x1fbf22(0x210)]?a30_0x1aee3b[_0x1fbf22(0x19c)](_0x5c27da['cron'][_0x1fbf22(0x1b3)](_0xd5e3fa)):'\x20'[_0x1fbf22(0x196)](_0xd5e3fa),_0x1df67d=hyperlink(_0x5c27da[_0x1fbf22(0x1e0)],_0x5c27da[_0x1fbf22(0x1fb)]);return'📅\x20'+_0x21fee8+'\x20'+_0x1c5864+'\x20\x20→\x20'+_0x499a9b+'\x20\x20'+_0x1c31d1+'\x20\x20'+_0x1df67d;});await writeOutput(_0x5064ae[_0x14e66c(0x1cc)]('\x0a'),_0x53c5e5['output'],_0x14e66c(0x1bb));}}return 0x0;}}export class ScheduleShowCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]=a30_0x5c10b4(0x1fd);[a30_0x5c10b4(0x1fc)]=a30_0x5c10b4(0x1dc);[a30_0x5c10b4(0x19b)](_0x3e5045){const _0x4d6491=a30_0x5c10b4,_0x2bf087=_0x3e5045[_0x4d6491(0x1d6)][0x0];if(!_0x2bf087)return _0x4d6491(0x215);return undefined;}async[a30_0x5c10b4(0x1a4)](_0x1e1083){const _0x5d97f7=a30_0x5c10b4,{options:_0x9a6d20,args:_0x2d5299,tdx:_0x569c9c}=_0x1e1083,_0x5e1396=_0x2d5299[0x0],_0x3ebaad=await withSpinner(_0x5d97f7(0x199),()=>_0x569c9c[_0x5d97f7(0x1f1)][_0x5d97f7(0x1d3)](_0x5e1396),{'verbose':_0x9a6d20['verbose']}),_0x36a3b0=_0x3ebaad['data'],_0x506b88={'name':_0x36a3b0[_0x5d97f7(0x1e0)],'cron':_0x36a3b0[_0x5d97f7(0x210)],'database':_0x36a3b0[_0x5d97f7(0x1ed)],'type':_0x36a3b0[_0x5d97f7(0x20a)],'timezone':_0x36a3b0['timezone'],'user_name':_0x36a3b0[_0x5d97f7(0x1cf)],'created_at':_0x36a3b0['created_at'],'engine_version':_0x36a3b0[_0x5d97f7(0x193)],'executing_user_id':_0x36a3b0[_0x5d97f7(0x211)],'query':_0x36a3b0[_0x5d97f7(0x1c0)],'delay':_0x36a3b0[_0x5d97f7(0x1b4)],'priority':_0x36a3b0[_0x5d97f7(0x1f7)],'retry_limit':_0x36a3b0[_0x5d97f7(0x1ac)],..._0x36a3b0[_0x5d97f7(0x190)]&&{'result':_0x36a3b0[_0x5d97f7(0x190)]}};return await handleSingleObjectOutput(_0x506b88,_0x9a6d20),0x0;}}export class ScheduleCreateCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]=a30_0x5c10b4(0x1db);[a30_0x5c10b4(0x1fc)]='Create\x20a\x20scheduled\x20query';[a30_0x5c10b4(0x19b)](_0x103a84){const _0x698dca=a30_0x5c10b4,_0x50474e=_0x103a84['args'][0x0];if(!_0x50474e)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';const _0x157e05=_0x103a84[_0x698dca(0x1c5)];if(!_0x157e05[_0x698dca(0x1ed)])return'Database\x20is\x20required\x0aUsage:\x20job\x20schedule\x20create\x20<name>\x20-d\x20<db>\x20--file\x20<path>\x20[options]';return undefined;}async['execute'](_0x24641b){const _0x5a6ea0=a30_0x5c10b4,{options:_0x35f7d4,args:_0x1a47d6,tdx:_0xd31f43}=_0x24641b,_0x39de12=_0x1a47d6[0x0],_0x322c47=_0x35f7d4,_0x3cc1f4=_0x322c47['database'],_0x3849d9=_0x322c47['file'],_0xa7c402=_0x322c47[_0x5a6ea0(0x20a)]||'trino';let _0x467479;try{_0x467479=readFileSync(_0x3849d9,_0x5a6ea0(0x1bc))[_0x5a6ea0(0x208)]();}catch(_0x13a35e){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5a6ea0(0x195)+_0x3849d9,_0x13a35e instanceof Error?_0x13a35e:undefined);}if(!_0x467479)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5a6ea0(0x1a0));const _0x4cdf78={'database':_0x3cc1f4,'query':_0x467479,'type':_0xa7c402};if(_0x322c47['cron'])_0x4cdf78[_0x5a6ea0(0x210)]=_0x322c47[_0x5a6ea0(0x210)];if(_0x322c47['timezone'])_0x4cdf78[_0x5a6ea0(0x1eb)]=_0x322c47[_0x5a6ea0(0x1eb)];if(_0x322c47[_0x5a6ea0(0x1b4)]!==undefined)_0x4cdf78[_0x5a6ea0(0x1b4)]=Number(_0x322c47['delay']);if(_0x322c47[_0x5a6ea0(0x1f7)]!==undefined)_0x4cdf78[_0x5a6ea0(0x1f7)]=Number(_0x322c47['priority']);if(_0x322c47[_0x5a6ea0(0x19e)]!==undefined)_0x4cdf78[_0x5a6ea0(0x1ac)]=Number(_0x322c47['retryLimit']);if(_0x322c47[_0x5a6ea0(0x1ba)])_0x4cdf78[_0x5a6ea0(0x193)]=_0x322c47[_0x5a6ea0(0x1ba)];if(_0x322c47[_0x5a6ea0(0x190)])_0x4cdf78['result']=_0x322c47[_0x5a6ea0(0x190)];if(_0x35f7d4[_0x5a6ea0(0x20c)]){console[_0x5a6ea0(0x1f4)](_0x5a6ea0(0x214)+_0x39de12),console['error'](_0x5a6ea0(0x1f9)+_0x3cc1f4),console[_0x5a6ea0(0x1f4)]('\x20\x20Type:\x20'+_0xa7c402);if(_0x4cdf78[_0x5a6ea0(0x210)])console[_0x5a6ea0(0x1f4)](_0x5a6ea0(0x1c2)+_0x4cdf78[_0x5a6ea0(0x210)]);if(_0x4cdf78[_0x5a6ea0(0x1eb)])console['error'](_0x5a6ea0(0x1b8)+_0x4cdf78[_0x5a6ea0(0x1eb)]);}const _0xa4cac3=await withSpinner('Creating\x20schedule...',()=>_0xd31f43[_0x5a6ea0(0x1f1)]['create'](_0x39de12,_0x4cdf78),{'verbose':_0x35f7d4[_0x5a6ea0(0x20c)]});return console[_0x5a6ea0(0x1f4)]('Schedule\x20created:\x20'+_0xa4cac3[_0x5a6ea0(0x1f0)][_0x5a6ea0(0x1e0)]),await handleSingleObjectOutput(_0xa4cac3[_0x5a6ea0(0x1f0)],_0x35f7d4),0x0;}}export class ScheduleUpdateCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]=a30_0x5c10b4(0x1d4);[a30_0x5c10b4(0x1fc)]=a30_0x5c10b4(0x197);[a30_0x5c10b4(0x19b)](_0x1af1be){const _0x4038fe=a30_0x5c10b4,_0x69b2c8=_0x1af1be[_0x4038fe(0x1d6)][0x0];if(!_0x69b2c8)return _0x4038fe(0x19f);return undefined;}async[a30_0x5c10b4(0x1a4)](_0x258b8c){const _0x1f0457=a30_0x5c10b4,{options:_0x54127d,args:_0x3bc788,tdx:_0x1f0b0a}=_0x258b8c,_0x1f7906=_0x3bc788[0x0],_0x1b7586=_0x54127d,_0x17ea95={};if(_0x1b7586[_0x1f0457(0x1ed)])_0x17ea95[_0x1f0457(0x1ed)]=_0x1b7586[_0x1f0457(0x1ed)];if(_0x1b7586[_0x1f0457(0x20a)])_0x17ea95['type']=_0x1b7586[_0x1f0457(0x20a)];if(_0x1b7586[_0x1f0457(0x210)])_0x17ea95['cron']=_0x1b7586[_0x1f0457(0x210)];if(_0x1b7586[_0x1f0457(0x1eb)])_0x17ea95[_0x1f0457(0x1eb)]=_0x1b7586['timezone'];if(_0x1b7586[_0x1f0457(0x1b4)]!==undefined)_0x17ea95[_0x1f0457(0x1b4)]=Number(_0x1b7586[_0x1f0457(0x1b4)]);if(_0x1b7586[_0x1f0457(0x1f7)]!==undefined)_0x17ea95[_0x1f0457(0x1f7)]=Number(_0x1b7586['priority']);if(_0x1b7586[_0x1f0457(0x19e)]!==undefined)_0x17ea95[_0x1f0457(0x1ac)]=Number(_0x1b7586[_0x1f0457(0x19e)]);if(_0x1b7586['engineVersion'])_0x17ea95[_0x1f0457(0x193)]=_0x1b7586[_0x1f0457(0x1ba)];if(_0x1b7586[_0x1f0457(0x190)])_0x17ea95['result']=_0x1b7586['result'];if(_0x1b7586[_0x1f0457(0x206)])try{_0x17ea95[_0x1f0457(0x1c0)]=readFileSync(_0x1b7586[_0x1f0457(0x206)],_0x1f0457(0x1bc))[_0x1f0457(0x208)]();}catch(_0x4d344d){throw new SDKError(ErrorCode[_0x1f0457(0x20e)],'Failed\x20to\x20read\x20file:\x20'+_0x1b7586[_0x1f0457(0x206)],_0x4d344d instanceof Error?_0x4d344d:undefined);}if(Object[_0x1f0457(0x1ef)](_0x17ea95)['length']===0x0)throw new SDKError(ErrorCode[_0x1f0457(0x20e)],_0x1f0457(0x1ee));if(_0x54127d['verbose']){console[_0x1f0457(0x1f4)](_0x1f0457(0x1bd)+_0x1f7906);for(const [_0xe5ca4,_0x1e0e14]of Object['entries'](_0x17ea95)){_0xe5ca4===_0x1f0457(0x1c0)?console[_0x1f0457(0x1f4)]('\x20\x20'+_0xe5ca4+':\x20'+_0x1e0e14[_0x1f0457(0x1d2)](0x0,0x32)+_0x1f0457(0x1d7)):console['error']('\x20\x20'+_0xe5ca4+':\x20'+_0x1e0e14);}}const _0x375ca3=await withSpinner(_0x1f0457(0x191),()=>_0x1f0b0a[_0x1f0457(0x1f1)][_0x1f0457(0x1aa)](_0x1f7906,_0x17ea95),{'verbose':_0x54127d[_0x1f0457(0x20c)]});return console[_0x1f0457(0x1f4)](_0x1f0457(0x18f)+_0x375ca3[_0x1f0457(0x1f0)][_0x1f0457(0x1e0)]),await handleSingleObjectOutput(_0x375ca3['data'],_0x54127d),0x0;}}export class ScheduleDeleteCommand extends BaseCommand{['name']=a30_0x5c10b4(0x204);[a30_0x5c10b4(0x1fc)]=a30_0x5c10b4(0x192);[a30_0x5c10b4(0x19b)](_0x20a8e5){const _0x1660f4=a30_0x5c10b4,_0x1b3b48=_0x20a8e5[_0x1660f4(0x1d6)][0x0];if(!_0x1b3b48)return _0x1660f4(0x1b1);return undefined;}async[a30_0x5c10b4(0x1a4)](_0x2114dd){const _0x17a345=a30_0x5c10b4,{options:_0x375f02,args:_0x316ef4,tdx:_0x12d05e}=_0x2114dd,_0x3da8c4=_0x316ef4[0x0];if(!_0x375f02[_0x17a345(0x1b2)]){const _0x487857=await confirm(_0x17a345(0x213)+_0x3da8c4+'\x22?');if(!_0x487857)return console[_0x17a345(0x1f4)]('Cancelled'),0x0;}const _0x131c77=await withSpinner(_0x17a345(0x1d8),()=>_0x12d05e[_0x17a345(0x1f1)][_0x17a345(0x1e4)](_0x3da8c4),{'verbose':_0x375f02['verbose']});return console[_0x17a345(0x1f4)](_0x17a345(0x19a)+_0x131c77[_0x17a345(0x1f0)][_0x17a345(0x1e0)]),0x0;}}export class ScheduleRunCommand extends BaseCommand{['name']='schedule:run';['description']=a30_0x5c10b4(0x1e8);[a30_0x5c10b4(0x19b)](_0x15d2a2){const _0x1dbb71=a30_0x5c10b4,_0x45b6fb=_0x15d2a2[_0x1dbb71(0x1d6)][0x0];if(!_0x45b6fb)return _0x1dbb71(0x1d9);return undefined;}async[a30_0x5c10b4(0x1a4)](_0x512f59){const _0x125dc3=a30_0x5c10b4,{options:_0x2634e0,args:_0x525c4f,tdx:_0x25148e}=_0x512f59,_0xc8d643=_0x525c4f[0x0],_0x19842a=_0x2634e0,_0x113d49=_0x19842a[_0x125dc3(0x1f2)],_0x37d475=_0x19842a['num']!==undefined?Number(_0x19842a[_0x125dc3(0x1c1)]):undefined;if(_0x2634e0['verbose']){console[_0x125dc3(0x1f4)](_0x125dc3(0x1bf)+_0xc8d643);if(_0x113d49)console[_0x125dc3(0x1f4)](_0x125dc3(0x1cb)+_0x113d49);if(_0x37d475)console[_0x125dc3(0x1f4)](_0x125dc3(0x1c6)+_0x37d475);}const _0x2e8d24=await withSpinner(_0x125dc3(0x1a7),()=>_0x25148e[_0x125dc3(0x1f1)]['run'](_0xc8d643,{'time':_0x113d49,'num':_0x37d475}),{'verbose':_0x2634e0[_0x125dc3(0x20c)]}),_0x46d1c0=_0x2e8d24[_0x125dc3(0x1f0)][_0x125dc3(0x1d1)];console['error'](_0x125dc3(0x1a2)+_0x46d1c0[_0x125dc3(0x1de)]+'\x20job'+(_0x46d1c0[_0x125dc3(0x1de)]!==0x1?'s':'')+'\x20created');for(const _0x30546e of _0x46d1c0){console[_0x125dc3(0x1f4)]('\x20\x20Job\x20ID:\x20'+_0x30546e[_0x125dc3(0x1be)]);}return await handleSDKOutput(_0x46d1c0,_0x2634e0),0x0;}}function a30_0x2541(_0x455095,_0x52db51){_0x455095=_0x455095-0x18f;const _0x17fb6c=a30_0x17fb();let _0x254132=_0x17fb6c[_0x455095];return _0x254132;}export class ScheduleHistoryCommand extends BaseCommand{[a30_0x5c10b4(0x1e0)]=a30_0x5c10b4(0x1c7);[a30_0x5c10b4(0x1fc)]=a30_0x5c10b4(0x1b5);['validate'](_0x35e6ca){const _0x1e1458=a30_0x5c10b4,_0x293a34=_0x35e6ca[_0x1e1458(0x1d6)][0x0];if(!_0x293a34)return'Schedule\x20name\x20is\x20required\x0aUsage:\x20job\x20schedule\x20history\x20<name>\x20[--from\x20<n>]\x20[--to\x20<n>]';return undefined;}async[a30_0x5c10b4(0x1a4)](_0x40018b){const _0x25bab1=a30_0x5c10b4,{options:_0xf3e2dc,args:_0x3f4a36,tdx:_0x246c60}=_0x40018b,_0xa8956d=_0x3f4a36[0x0],_0x5aa755=_0xf3e2dc,_0x1a5686=_0x5aa755['from']!==undefined?Number(_0x5aa755[_0x25bab1(0x1a3)]):undefined,_0x1eb37a=_0x5aa755['to']!==undefined?Number(_0x5aa755['to']):undefined,_0x33edc5=await withSpinner('Getting\x20schedule\x20history...',()=>_0x246c60[_0x25bab1(0x1f1)][_0x25bab1(0x1f5)](_0xa8956d,{'from':_0x1a5686,'to':_0x1eb37a}),{'verbose':_0xf3e2dc[_0x25bab1(0x20c)]}),_0x4ebb09=_0x33edc5['data'];console['error'](_0x25bab1(0x209)+_0x4ebb09[_0x25bab1(0x1fa)]+'\x20execution'+(_0x4ebb09[_0x25bab1(0x1fa)]!==0x1?'s':'')+_0x25bab1(0x1df)+_0x4ebb09[_0x25bab1(0x1a3)]+'-'+_0x4ebb09['to']+')');const _0x440467=_0x4ebb09[_0x25bab1(0x1f5)][_0x25bab1(0x1c9)](_0x178def=>({'job_id':_0x178def[_0x25bab1(0x1be)],'type':_0x178def[_0x25bab1(0x20a)],'status':_0x178def[_0x25bab1(0x1a9)],'scheduled_at':_0x178def[_0x25bab1(0x1af)],'created_at':_0x178def[_0x25bab1(0x1ff)],'start_at':_0x178def['start_at'],'end_at':_0x178def[_0x25bab1(0x1e7)]}));return await handleSDKOutput(_0x440467,_0xf3e2dc),0x0;}}
@@ -1 +1 @@
1
- const a31_0x21cbf2=a31_0x5c0d;(function(_0x183b95,_0x35b01e){const _0x585905=a31_0x5c0d,_0x19246a=_0x183b95();while(!![]){try{const _0x4097ef=-parseInt(_0x585905(0x13b))/0x1*(-parseInt(_0x585905(0x10f))/0x2)+parseInt(_0x585905(0xee))/0x3*(-parseInt(_0x585905(0x11b))/0x4)+-parseInt(_0x585905(0xbc))/0x5+-parseInt(_0x585905(0x139))/0x6*(parseInt(_0x585905(0xf5))/0x7)+-parseInt(_0x585905(0xbf))/0x8+parseInt(_0x585905(0x130))/0x9+parseInt(_0x585905(0xe4))/0xa*(-parseInt(_0x585905(0x11d))/0xb);if(_0x4097ef===_0x35b01e)break;else _0x19246a['push'](_0x19246a['shift']());}catch(_0x409995){_0x19246a['push'](_0x19246a['shift']());}}}(a31_0x1ed4,0x8aa90));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a31_0x5c0d(_0x388cb3,_0x41ed34){_0x388cb3=_0x388cb3-0xab;const _0x1ed4c1=a31_0x1ed4();let _0x5c0d0d=_0x1ed4c1[_0x388cb3];return _0x5c0d0d;}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';function a31_0x1ed4(){const _0x2545df=['27184ixxoQQ','toLocaleString','9295ryEfyr','description','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Use:\x20tdx\x20ps\x20desc','parentFolder','replace','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderPath','folderId','Resolving\x20folder\x20\x27','segment:folder:list','Examples:','in\x20','\x20[Job\x20ID:\x20','Fetching\x20folder\x20details...','Use:\x20tdx\x20ps\x20view','Fetching\x20SQL\x20for\x20segment...','resolvePathToResource','9481743xKSngJ','information_schema','\x20\x20Folder\x20path:\x20','jsonl','getFolder','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Options:','Creating\x20folder\x20\x27','\x20rows\x20','6sQDmaI','includes','1XrjUBY','Resolved\x20parent\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20sql\x20<name>','message','cause','✔\x20Created\x20folder\x20\x27','parentSegment','Resolved\x20YAML\x20file:\x20','error','segmentId','Error:\x20Folder\x20reference\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','setJobId','site','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Use:\x20tdx\x20ps\x20view\x20-w','Parent\x20name:\x20','Error:\x20Path\x20or\x20name\x20is\x20required','Resolving\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','Fetching\x20folder\x20\x27','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','folder','INVALID_ARGUMENT','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Usage:\x20tdx\x20sg\x20desc\x20<name>','1598100PjGyxc','jobId','getParent','5474264FgVSFQ','length','Resolved\x20folder\x20ID:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','resolveParentId','Segment\x20ID:\x20','Resolving\x20path\x20\x27','type','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Listing\x20folders\x20for\x20parent\x20\x27','Folder\x20name:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','limit','Show\x20segment\x20or\x20folder\x20details','getSegmentSQL','createFolder','Error:\x20','segment:desc','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','Get\x20SQL\x20query\x20for\x20child\x20segment','Executing\x20segment\x20query...','json','segment:show','execute','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Site:\x20','Folder\x20ID\x20missing\x20from\x20resolved\x20path','\x27...','Parent\x20segment:\x20','840VuzmZY','format','green','SQL\x20query:\x0a','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','segment:describe','verbose','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segmentName','3ihjNhm','\x27\x20with\x20ID:\x20','\x20\x20Segment\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segment','Parent\x20ID:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','90363UVbDIt','\x20folder','parent','Fetching\x20segment\x20details...','Target\x20path:\x20','Create\x20segment\x20folder\x20for\x20organization','/app/ps/','resolveFolderId','Folder\x20ID:\x20','listFolders','(root)','query','/e/','name','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Resolved\x20type:\x20','SEGMENT_FOLDER_NOT_FOUND','segment:folder:show','code','\x20\x20Cause:\x20','SEGMENT_NOT_FOUND','Show\x20folder\x20or\x20child\x20segment\x20details','trim','parentId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','1218026hvcYEQ','stats','✔\x20Found\x20','Resolved\x20relative\x20path\x20to:\x20','data','segment:view','SELECT\x20*\x20FROM\x20(\x0a','getSegment','fullPath','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20sg\x20show\x20<name>','Resolved\x20parent\x20folder\x20ID:\x20'];a31_0x1ed4=function(){return _0x2545df;};return a31_0x1ed4();}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 a31_0xe2ca85 from'chalk';async function resolveSegmentTarget(_0x35e45f,_0x5efd87,_0x451060){const _0x10e7cc=a31_0x5c0d;if(isYamlFilePath(_0x35e45f))try{const _0x5b09fa=await resolveYamlFilePath(_0x35e45f);return _0x451060&&(console[_0x10e7cc(0x144)](_0x10e7cc(0x143)+_0x35e45f),console[_0x10e7cc(0x144)]('\x20\x20Parent\x20segment:\x20'+_0x5b09fa[_0x10e7cc(0x142)]),console[_0x10e7cc(0x144)](_0x10e7cc(0xf0)+_0x5b09fa[_0x10e7cc(0xed)]),console['error'](_0x10e7cc(0x132)+(_0x5b09fa[_0x10e7cc(0x125)]||_0x10e7cc(0xff))),console['error']('\x20\x20Full\x20path:\x20'+_0x5b09fa['fullPath'])),_0x5b09fa[_0x10e7cc(0x117)];}catch(_0x2d525c){throw new SDKError(ErrorCode[_0x10e7cc(0xb9)],_0x10e7cc(0xd6)+_0x2d525c[_0x10e7cc(0x13f)]);}if(!_0x5efd87)throw new SDKError(ErrorCode[_0x10e7cc(0xb9)],_0x10e7cc(0xe8));return _0x5efd87+'/'+_0x35e45f;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0xea);[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0xcf);async['execute'](_0x5d6397){const _0x14c2e9=a31_0x21cbf2,{options:_0x1127ce,args:_0x2994a0,tdx:_0xa1ecb0}=_0x5d6397,_0x434041=_0x2994a0[0x0],_0x227fb9=!_0x434041&&!!_0x1127ce[_0x14c2e9(0x142)],_0x98bd3=_0x434041||_0x1127ce[_0x14c2e9(0x142)];if(!_0x98bd3)return console[_0x14c2e9(0x144)](_0x14c2e9(0xb3)),console['error'](_0x14c2e9(0xcb)),console['error'](_0x14c2e9(0x129)),console['error'](_0x14c2e9(0xf4)),console[_0x14c2e9(0x144)](_0x14c2e9(0x124)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console[_0x14c2e9(0x144)](_0x14c2e9(0xb7)),0x1;try{const _0x1214bf=_0x1127ce['segmentPath'];let _0x27eccb=_0x98bd3;!_0x227fb9&&_0x1214bf&&!_0x98bd3[_0x14c2e9(0x13a)]('/')&&(_0x27eccb=_0x1214bf+'/'+_0x98bd3,_0x1127ce['verbose']&&console[_0x14c2e9(0x144)](_0x14c2e9(0x112)+_0x27eccb));const _0x31db2c=await withSpinner(_0x14c2e9(0xc5)+_0x27eccb+'\x27...',()=>_0xa1ecb0[_0x14c2e9(0xf2)]['resolvePathToResource'](_0x27eccb),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]}),_0x37ecb7=_0x31db2c[_0x14c2e9(0x113)];_0x1127ce[_0x14c2e9(0xeb)]&&(console[_0x14c2e9(0x144)](_0x14c2e9(0x105)+_0x37ecb7[_0x14c2e9(0xc6)]),console['error']('Parent\x20ID:\x20'+_0x37ecb7[_0x14c2e9(0x10d)]),_0x37ecb7[_0x14c2e9(0x126)]&&console[_0x14c2e9(0x144)](_0x14c2e9(0xfd)+_0x37ecb7[_0x14c2e9(0x126)]),_0x37ecb7[_0x14c2e9(0xab)]&&console[_0x14c2e9(0x144)](_0x14c2e9(0xc4)+_0x37ecb7[_0x14c2e9(0xab)]));if(_0x37ecb7[_0x14c2e9(0xc6)]===_0x14c2e9(0xf7)){const _0x1557de=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0xa1ecb0[_0x14c2e9(0xf2)][_0x14c2e9(0xbe)](_0x37ecb7[_0x14c2e9(0x10d)]),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]});await handleSingleObjectOutput(_0x1557de[_0x14c2e9(0x113)],_0x1127ce);}else{if(_0x37ecb7['type']===_0x14c2e9(0xb8)){if(!_0x37ecb7[_0x14c2e9(0x126)])throw new SDKError(ErrorCode[_0x14c2e9(0x106)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4a72d6=await withSpinner('Fetching\x20folder\x20details...',()=>_0xa1ecb0[_0x14c2e9(0xf2)][_0x14c2e9(0x134)](_0x37ecb7[_0x14c2e9(0x126)]),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]});await handleSingleObjectOutput(_0x4a72d6[_0x14c2e9(0x113)],_0x1127ce);}else{if(_0x37ecb7[_0x14c2e9(0xc6)]===_0x14c2e9(0xf2)){if(!_0x37ecb7[_0x14c2e9(0xab)])throw new SDKError(ErrorCode[_0x14c2e9(0x10a)],_0x14c2e9(0xc8));const _0x29d319=await withSpinner(_0x14c2e9(0xf8),()=>_0xa1ecb0[_0x14c2e9(0xf2)]['getSegment'](_0x37ecb7[_0x14c2e9(0x10d)],_0x37ecb7['segmentId']),{'verbose':_0x1127ce[_0x14c2e9(0xeb)]});await handleSingleObjectOutput(_0x29d319[_0x14c2e9(0x113)],_0x1127ce);}}}return 0x0;}catch(_0x3b27b9){if(_0x3b27b9 instanceof SDKError)return console['error'](_0x14c2e9(0xd2)+_0x3b27b9[_0x14c2e9(0x13f)]),_0x3b27b9[_0x14c2e9(0x140)]&&console[_0x14c2e9(0x144)](_0x14c2e9(0x109)+_0x3b27b9['cause']),0x1;throw _0x3b27b9;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0xdc);[a31_0x21cbf2(0x11e)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x21cbf2(0xdd)](_0x92d7dc){const _0x5cc12b=a31_0x21cbf2,{options:_0x329f20,args:_0x216e8a,tdx:_0x4646e9}=_0x92d7dc,_0x194847=_0x216e8a[0x0];if(!_0x194847)return console['error'](_0x5cc12b(0xc2)),console[_0x5cc12b(0x144)](_0x5cc12b(0x119)),console['error'](_0x5cc12b(0x13d)),console['error']('Examples:'),console[_0x5cc12b(0x144)](_0x5cc12b(0xba)),console[_0x5cc12b(0x144)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x417c65=_0x329f20[_0x5cc12b(0x142)],_0x3e519c=await resolveSegmentTarget(_0x194847,_0x417c65,_0x329f20[_0x5cc12b(0xeb)]);_0x329f20[_0x5cc12b(0xeb)]&&console[_0x5cc12b(0x144)](_0x5cc12b(0xf9)+_0x3e519c);const _0x23b42c=await withSpinner(_0x5cc12b(0xb4)+_0x194847+_0x5cc12b(0xe2),()=>_0x4646e9[_0x5cc12b(0xf2)][_0x5cc12b(0x12f)](_0x3e519c),{'verbose':_0x329f20[_0x5cc12b(0xeb)]}),_0x5c5e04=_0x23b42c[_0x5cc12b(0x113)];_0x329f20[_0x5cc12b(0xeb)]&&(console['error'](_0x5cc12b(0x105)+_0x5c5e04[_0x5cc12b(0xc6)]),console[_0x5cc12b(0x144)](_0x5cc12b(0xf3)+_0x5c5e04[_0x5cc12b(0x10d)]));if(_0x5c5e04[_0x5cc12b(0xc6)]===_0x5cc12b(0xb8))return console[_0x5cc12b(0x144)](_0x5cc12b(0xc7)),console[_0x5cc12b(0x144)](_0x5cc12b(0xb0)),0x1;if(_0x5c5e04[_0x5cc12b(0xc6)]===_0x5cc12b(0xf7))return console[_0x5cc12b(0x144)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5cc12b(0x144)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x5c5e04[_0x5cc12b(0xab)])throw new SDKError(ErrorCode[_0x5cc12b(0x10a)],_0x5cc12b(0xc8));const _0x20885b=await withSpinner(_0x5cc12b(0x12e),()=>_0x4646e9[_0x5cc12b(0xf2)][_0x5cc12b(0xd0)](_0x5c5e04[_0x5cc12b(0x10d)],_0x5c5e04[_0x5cc12b(0xab)]),{'verbose':_0x329f20[_0x5cc12b(0xeb)]});let _0x33d8ad=_0x20885b['data'];const _0x1e11d9=resolveLimit(_0x329f20[_0x5cc12b(0xce)],DEFAULT_DISPLAY_LIMIT),_0x206f36=/\bLIMIT\s+\d+/i['test'](_0x33d8ad);!_0x206f36&&(_0x33d8ad=_0x33d8ad[_0x5cc12b(0x10c)]()[_0x5cc12b(0x122)](/;+$/,''),_0x33d8ad=_0x5cc12b(0x115)+_0x33d8ad+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1e11d9);_0x329f20['verbose']&&console[_0x5cc12b(0x144)](_0x5cc12b(0xe7)+_0x33d8ad);const _0x4a3036=await withProgressSpinner(_0x5cc12b(0xda),async _0x420677=>{const _0x371317=_0x5cc12b,_0x470657=await _0x4646e9[_0x371317(0x100)][_0x371317(0xdd)](_0x33d8ad,{'catalog':'td','schema':_0x371317(0x131),'onJobId':_0x2bf59b=>{const _0x292afc=_0x371317;_0x420677[_0x292afc(0xae)](_0x2bf59b);}});return _0x470657;},{'verbose':_0x329f20[_0x5cc12b(0xeb)]}),_0x5dfd4f=_0x4a3036[_0x5cc12b(0x113)],_0x3737d2=_0x5dfd4f[_0x5cc12b(0xbd)]?_0x5cc12b(0x12b)+_0x5dfd4f[_0x5cc12b(0xbd)]+']':'';return console[_0x5cc12b(0x144)](_0x5cc12b(0x123)+_0x5dfd4f[_0x5cc12b(0x110)]['processedRows'][_0x5cc12b(0x11c)]()+_0x5cc12b(0x138)+(_0x5cc12b(0x12a)+formatElapsed(_0x5dfd4f[_0x5cc12b(0x110)]['elapsedTimeMillis'])+_0x3737d2)),await handleQueryOutput(_0x5dfd4f,_0x329f20),0x0;}catch(_0x3198ab){if(_0x3198ab instanceof SDKError)return console[_0x5cc12b(0x144)]('✖\x20Query\x20failed\x20['+_0x3198ab[_0x5cc12b(0x108)]+']'),console[_0x5cc12b(0x144)]('\x0a'+_0x3198ab[_0x5cc12b(0x13f)]),0x1;throw _0x3198ab;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0x128);[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0x10e);async[a31_0x21cbf2(0xdd)](_0x50e32f){const _0x3dc20d=a31_0x21cbf2,{options:_0x3874c0,args:_0x2554a3,tdx:_0x2df849}=_0x50e32f;if(_0x2554a3[_0x3dc20d(0xc0)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console[_0x3dc20d(0x144)](_0x3dc20d(0xe9)),0x1;const _0x28cf8a=_0x2554a3[0x0];try{_0x3874c0[_0x3dc20d(0xeb)]&&(console['error'](_0x3dc20d(0xe0)+_0x3874c0[_0x3dc20d(0xaf)]),console[_0x3dc20d(0x144)](_0x3dc20d(0xb2)+_0x28cf8a));const _0x29cfd0=await withSpinner(_0x3dc20d(0x118)+_0x28cf8a+_0x3dc20d(0xe2),()=>_0x2df849['segment'][_0x3dc20d(0xc3)](_0x28cf8a),{'verbose':_0x3874c0['verbose']}),_0x4bf86c=_0x29cfd0[_0x3dc20d(0x113)];_0x3874c0[_0x3dc20d(0xeb)]&&console[_0x3dc20d(0x144)]('Resolved\x20parent\x20ID:\x20'+_0x4bf86c);const _0x31d929=await withSpinner(_0x3dc20d(0xc9)+_0x28cf8a+_0x3dc20d(0xe2),()=>_0x2df849[_0x3dc20d(0xf2)][_0x3dc20d(0xfe)](_0x4bf86c),{'verbose':_0x3874c0[_0x3dc20d(0xeb)]}),_0x41b0db=_0x31d929['data'];return console['error'](_0x3dc20d(0x111)+_0x41b0db[_0x3dc20d(0xc0)]+_0x3dc20d(0xf6)+(_0x41b0db[_0x3dc20d(0xc0)]!==0x1?'s':'')),await handleSDKOutput(_0x41b0db,_0x3874c0),0x0;}catch(_0x28c1f5){if(_0x28c1f5 instanceof SDKError)return console[_0x3dc20d(0x144)](_0x3dc20d(0xd2)+_0x28c1f5[_0x3dc20d(0x13f)]),_0x28c1f5[_0x3dc20d(0x140)]&&console[_0x3dc20d(0x144)](_0x3dc20d(0x109)+_0x28c1f5[_0x3dc20d(0x140)]),0x1;throw _0x28c1f5;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0x107);[a31_0x21cbf2(0x11e)]='Show\x20segment\x20folder\x20details';async[a31_0x21cbf2(0xdd)](_0xe5fc2d){const _0x3137d6=a31_0x21cbf2,{options:_0x207941,args:_0x34b1fc,tdx:_0x631bd0}=_0xe5fc2d;if(_0x34b1fc['length']===0x0)return console['error'](_0x3137d6(0xac)),console[_0x3137d6(0x144)](_0x3137d6(0xb5)),0x1;try{const {parentId:_0x5c508d,childId:_0x7f4ba7}=parseSegmentRef(_0x34b1fc[0x0]);_0x207941['verbose']&&(console[_0x3137d6(0x144)](_0x3137d6(0xe0)+_0x207941[_0x3137d6(0xaf)]),console[_0x3137d6(0x144)]('Parent\x20name:\x20'+_0x5c508d),_0x7f4ba7&&console['error'](_0x3137d6(0xca)+_0x7f4ba7));if(!_0x7f4ba7)return console[_0x3137d6(0x144)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x141a36=await withSpinner(_0x3137d6(0x118)+_0x5c508d+_0x3137d6(0xe2),()=>_0x631bd0[_0x3137d6(0xf2)][_0x3137d6(0xc3)](_0x5c508d),{'verbose':_0x207941[_0x3137d6(0xeb)]}),_0x359bd7=_0x141a36[_0x3137d6(0x113)];_0x207941[_0x3137d6(0xeb)]&&console['error'](_0x3137d6(0x13c)+_0x359bd7);const _0x38a12b=await withSpinner(_0x3137d6(0x127)+_0x7f4ba7+_0x3137d6(0xe2),()=>_0x631bd0[_0x3137d6(0xf2)]['resolveFolderId'](_0x359bd7,_0x7f4ba7),{'verbose':_0x207941[_0x3137d6(0xeb)]}),_0x52e309=_0x38a12b[_0x3137d6(0x113)];_0x207941[_0x3137d6(0xeb)]&&console['error'](_0x3137d6(0xc1)+_0x52e309);const _0x121414=await withSpinner(_0x3137d6(0xb6)+_0x7f4ba7+'\x27...',()=>_0x631bd0['segment'][_0x3137d6(0x134)](_0x52e309),{'verbose':_0x207941[_0x3137d6(0xeb)]});return await handleSDKOutput([_0x121414['data']],_0x207941),0x0;}catch(_0x2b8956){if(_0x2b8956 instanceof SDKError)return console[_0x3137d6(0x144)]('Error:\x20'+_0x2b8956[_0x3137d6(0x13f)]),_0x2b8956[_0x3137d6(0x140)]&&console[_0x3137d6(0x144)](_0x3137d6(0x109)+_0x2b8956[_0x3137d6(0x140)]),0x1;throw _0x2b8956;}}}export class SegmentSQLCommand extends BaseCommand{['name']='segment:sql';[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0xd9);async[a31_0x21cbf2(0xdd)](_0x327522){const _0x3390cd=a31_0x21cbf2,{options:_0x3c4a10,args:_0x513845,tdx:_0x2bd91a}=_0x327522,_0x323838=_0x513845[0x0];if(!_0x323838)return console[_0x3390cd(0x144)](_0x3390cd(0xc2)),console['error'](_0x3390cd(0x13e)),console['error'](_0x3390cd(0xf1)),console[_0x3390cd(0x144)](_0x3390cd(0x129)),console[_0x3390cd(0x144)](_0x3390cd(0x103)),console[_0x3390cd(0x144)](_0x3390cd(0xde)),0x1;try{const _0x3e37e9=_0x3c4a10[_0x3390cd(0x142)],_0x446969=await resolveSegmentTarget(_0x323838,_0x3e37e9,_0x3c4a10[_0x3390cd(0xeb)]);_0x3c4a10[_0x3390cd(0xeb)]&&console[_0x3390cd(0x144)](_0x3390cd(0xf9)+_0x446969);const _0x1c5a56=await withSpinner(_0x3390cd(0xb4)+_0x323838+_0x3390cd(0xe2),()=>_0x2bd91a[_0x3390cd(0xf2)][_0x3390cd(0x12f)](_0x446969),{'verbose':_0x3c4a10[_0x3390cd(0xeb)]}),_0x130a06=_0x1c5a56[_0x3390cd(0x113)];_0x3c4a10[_0x3390cd(0xeb)]&&(console['error']('Resolved\x20type:\x20'+_0x130a06[_0x3390cd(0xc6)]),console['error'](_0x3390cd(0xf3)+_0x130a06[_0x3390cd(0x10d)]));if(_0x130a06['type']===_0x3390cd(0xb8))return console['error'](_0x3390cd(0x104)),console[_0x3390cd(0x144)](_0x3390cd(0x11f)),0x1;if(_0x130a06['type']===_0x3390cd(0xf7))return console[_0x3390cd(0x144)](_0x3390cd(0xcd)),console[_0x3390cd(0x144)]('Use:\x20tdx\x20ps\x20sql'),0x1;if(!_0x130a06['segmentId'])throw new SDKError(ErrorCode[_0x3390cd(0x10a)],_0x3390cd(0xc8));const _0x44c5a8=await withSpinner(_0x3390cd(0x12e),()=>_0x2bd91a[_0x3390cd(0xf2)][_0x3390cd(0xd0)](_0x130a06[_0x3390cd(0x10d)],_0x130a06[_0x3390cd(0xab)]),{'verbose':_0x3c4a10[_0x3390cd(0xeb)]}),_0x520931=_0x44c5a8['data'];return _0x3c4a10[_0x3390cd(0xe5)]===_0x3390cd(0xdb)||_0x3c4a10['format']===_0x3390cd(0x133)?await handleSDKOutput([{'sql':_0x520931}],_0x3c4a10):console['log'](_0x520931),0x0;}catch(_0x5c091e){if(_0x5c091e instanceof SDKError)return console[_0x3390cd(0x144)](_0x3390cd(0xd2)+_0x5c091e[_0x3390cd(0x13f)]),_0x5c091e['cause']&&console[_0x3390cd(0x144)]('\x20\x20Cause:\x20'+_0x5c091e['cause']),0x1;throw _0x5c091e;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']='segment:folder:create';[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0xfa);async[a31_0x21cbf2(0xdd)](_0x2abee5){const _0x2fd7b5=a31_0x21cbf2,{options:_0x3285d5,args:_0x83cfaf,tdx:_0x5b9dce}=_0x2abee5,_0x546edc=_0x3285d5;if(_0x83cfaf['length']<0x2)return console['error'](_0x2fd7b5(0xdf)),console[_0x2fd7b5(0x144)](_0x2fd7b5(0xec)),0x1;const _0x268317=_0x83cfaf[0x0],_0x45785d=_0x83cfaf[0x1];_0x546edc[_0x2fd7b5(0xeb)]&&(console[_0x2fd7b5(0x144)]('Site:\x20'+_0x546edc[_0x2fd7b5(0xaf)]),console['error'](_0x2fd7b5(0xe3)+_0x268317),console[_0x2fd7b5(0x144)]('Folder\x20name:\x20'+_0x45785d));let _0x581c15;if(_0x546edc['parentFolder']){const _0x37803e=_0x546edc[_0x2fd7b5(0x121)],_0x4d312e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x268317+_0x2fd7b5(0xe2),()=>_0x5b9dce[_0x2fd7b5(0xf2)][_0x2fd7b5(0xc3)](_0x268317),{'verbose':_0x546edc[_0x2fd7b5(0xeb)]}),_0x1e4302=_0x4d312e[_0x2fd7b5(0x113)],_0x5896bb=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x37803e+_0x2fd7b5(0xe2),()=>_0x5b9dce[_0x2fd7b5(0xf2)][_0x2fd7b5(0xfc)](_0x1e4302,_0x37803e),{'verbose':_0x546edc[_0x2fd7b5(0xeb)]});_0x581c15=_0x5896bb[_0x2fd7b5(0x113)],_0x546edc['verbose']&&console[_0x2fd7b5(0x144)](_0x2fd7b5(0x11a)+_0x581c15);}const _0x5cc179={'name':_0x45785d,'description':_0x546edc[_0x2fd7b5(0x11e)],'parentFolderId':_0x581c15},_0x3f975f=await withSpinner(_0x2fd7b5(0x137)+_0x45785d+_0x2fd7b5(0xe2),()=>_0x5b9dce[_0x2fd7b5(0xf2)][_0x2fd7b5(0xd1)](_0x268317,_0x5cc179),{'verbose':_0x546edc[_0x2fd7b5(0xeb)]}),_0x187f2b=_0x3f975f[_0x2fd7b5(0x113)];return console[_0x2fd7b5(0x144)](_0x2fd7b5(0x141)+_0x187f2b[_0x2fd7b5(0x102)]+_0x2fd7b5(0xef)+_0x187f2b['id']),await handleSDKOutput([_0x187f2b],_0x546edc),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a31_0x21cbf2(0x114);[a31_0x21cbf2(0x11e)]=a31_0x21cbf2(0x10b);async[a31_0x21cbf2(0xdd)](_0x54c2b4){const _0x52a050=a31_0x21cbf2,{options:_0x45a849,args:_0x45ba91,tdx:_0x4d23a2}=_0x54c2b4,_0x56bd1e=_0x45ba91[0x0];if(!_0x56bd1e)return console[_0x52a050(0x144)](_0x52a050(0xd4)),console['error'](_0x52a050(0xd7)),console[_0x52a050(0x144)](_0x52a050(0xcc)),console['error'](_0x52a050(0x136)),console[_0x52a050(0x144)](_0x52a050(0xd8)),console['error']('Examples:'),console[_0x52a050(0x144)](_0x52a050(0xad)),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x52a050(0x144)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x52a050(0x144)](_0x52a050(0xd5)),0x1;try{const _0x466fcb=_0x45a849[_0x52a050(0x142)],_0x387554=await resolveSegmentTarget(_0x56bd1e,_0x466fcb,_0x45a849[_0x52a050(0xeb)]);_0x45a849[_0x52a050(0xeb)]&&console[_0x52a050(0x144)](_0x52a050(0xf9)+_0x387554);const _0xd56931=await withSpinner(_0x52a050(0xb4)+_0x56bd1e+_0x52a050(0xe2),()=>_0x4d23a2[_0x52a050(0xf2)][_0x52a050(0x12f)](_0x387554),{'verbose':_0x45a849['verbose']}),_0x1d9aa4=_0xd56931[_0x52a050(0x113)];_0x45a849[_0x52a050(0xeb)]&&(console[_0x52a050(0x144)](_0x52a050(0x105)+_0x1d9aa4[_0x52a050(0xc6)]),console[_0x52a050(0x144)]('Parent\x20ID:\x20'+_0x1d9aa4[_0x52a050(0x10d)]),_0x1d9aa4[_0x52a050(0x126)]&&console[_0x52a050(0x144)](_0x52a050(0xfd)+_0x1d9aa4[_0x52a050(0x126)]),_0x1d9aa4[_0x52a050(0xab)]&&console[_0x52a050(0x144)](_0x52a050(0xc4)+_0x1d9aa4[_0x52a050(0xab)]));if(_0x45a849['web']){if(_0x1d9aa4[_0x52a050(0xc6)]===_0x52a050(0xb8))return console[_0x52a050(0x144)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x1d9aa4[_0x52a050(0xc6)]===_0x52a050(0xf7))return console[_0x52a050(0x144)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x52a050(0x144)](_0x52a050(0xb1)),0x1;if(!_0x1d9aa4[_0x52a050(0xab)])throw new SDKError(ErrorCode[_0x52a050(0x10a)],_0x52a050(0xc8));const _0x2fdb03=getConsoleNextUrl(_0x45a849[_0x52a050(0xaf)],_0x52a050(0xfb)+_0x1d9aa4['parentId']+_0x52a050(0x101)+_0x1d9aa4[_0x52a050(0xab)]);return console[_0x52a050(0x144)](a31_0xe2ca85[_0x52a050(0xe6)]('✔')+'\x20Opening\x20'+a31_0xe2ca85['cyan'](_0x2fdb03)),openBrowser(_0x2fdb03),0x0;}if(_0x1d9aa4[_0x52a050(0xc6)]===_0x52a050(0xb8)){if(!_0x1d9aa4[_0x52a050(0x126)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x52a050(0xe1));const _0x57868d=await withSpinner(_0x52a050(0x12c),()=>_0x4d23a2[_0x52a050(0xf2)][_0x52a050(0x134)](_0x1d9aa4['folderId']),{'verbose':_0x45a849[_0x52a050(0xeb)]});await handleSingleObjectOutput(_0x57868d[_0x52a050(0x113)],_0x45a849);}else{if(_0x1d9aa4['type']===_0x52a050(0xf2)){if(!_0x1d9aa4['segmentId'])throw new SDKError(ErrorCode[_0x52a050(0x10a)],_0x52a050(0xc8));const _0x37f171=await withSpinner(_0x52a050(0xf8),()=>_0x4d23a2['segment'][_0x52a050(0x116)](_0x1d9aa4[_0x52a050(0x10d)],_0x1d9aa4['segmentId']),{'verbose':_0x45a849[_0x52a050(0xeb)]}),_0x311961=getConsoleNextUrl(_0x45a849[_0x52a050(0xaf)],'/app/ps/'+_0x1d9aa4[_0x52a050(0x10d)]+'/e/'+_0x1d9aa4['segmentId']),_0x41352b=_0x37f171[_0x52a050(0x113)];_0x41352b['url']=_0x311961,await handleSingleObjectOutput(_0x41352b,_0x45a849);}else return console[_0x52a050(0x144)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x52a050(0x12d)),0x1;}return 0x0;}catch(_0x40efda){if(_0x40efda instanceof SDKError)return console[_0x52a050(0x144)](_0x52a050(0xd2)+_0x40efda[_0x52a050(0x13f)]),_0x40efda[_0x52a050(0x140)]&&console[_0x52a050(0x144)](_0x52a050(0x109)+_0x40efda[_0x52a050(0x140)]),0x1;throw _0x40efda;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x21cbf2(0x102)]=a31_0x21cbf2(0xd3);[a31_0x21cbf2(0x11e)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x307b3d){const _0x123a3e=a31_0x21cbf2,{options:_0x48b59f,args:_0x13a944,tdx:_0x10a131}=_0x307b3d,_0x384aba=_0x13a944[0x0];if(!_0x384aba)return console[_0x123a3e(0x144)](_0x123a3e(0xc2)),console[_0x123a3e(0x144)](_0x123a3e(0xbb)),console[_0x123a3e(0x144)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x123a3e(0x144)](_0x123a3e(0x129)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x123a3e(0x144)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x39b24b=_0x48b59f[_0x123a3e(0x142)],_0x54fac3=await resolveSegmentTarget(_0x384aba,_0x39b24b,_0x48b59f[_0x123a3e(0xeb)]);_0x48b59f[_0x123a3e(0xeb)]&&console[_0x123a3e(0x144)](_0x123a3e(0xf9)+_0x54fac3);const _0x6ed541=await withSpinner('Resolving\x20\x27'+_0x384aba+_0x123a3e(0xe2),()=>_0x10a131[_0x123a3e(0xf2)][_0x123a3e(0x12f)](_0x54fac3),{'verbose':_0x48b59f[_0x123a3e(0xeb)]}),_0x3ebee7=_0x6ed541['data'];_0x48b59f[_0x123a3e(0xeb)]&&(console[_0x123a3e(0x144)](_0x123a3e(0x105)+_0x3ebee7[_0x123a3e(0xc6)]),console[_0x123a3e(0x144)]('Parent\x20ID:\x20'+_0x3ebee7['parentId']));if(_0x3ebee7[_0x123a3e(0xc6)]===_0x123a3e(0xb8))return console['error'](_0x123a3e(0x135)),console['error'](_0x123a3e(0x11f)),0x1;if(_0x3ebee7[_0x123a3e(0xc6)]===_0x123a3e(0xf7))return console[_0x123a3e(0x144)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x123a3e(0x144)](_0x123a3e(0x120)),0x1;if(!_0x3ebee7[_0x123a3e(0xab)])throw new SDKError(ErrorCode[_0x123a3e(0x10a)],_0x123a3e(0xc8));const _0x418e18=await withSpinner(_0x123a3e(0x12e),()=>_0x10a131['segment'][_0x123a3e(0xd0)](_0x3ebee7['parentId'],_0x3ebee7[_0x123a3e(0xab)]),{'verbose':_0x48b59f[_0x123a3e(0xeb)]}),_0x1f40b0=_0x418e18[_0x123a3e(0x113)],_0x48fa33=await executeSchemaQuery(_0x1f40b0,_0x10a131,_0x48b59f);return await handleQueryOutput(_0x48fa33,_0x48b59f),0x0;}catch(_0x2ee6d0){if(_0x2ee6d0 instanceof SDKError)return console[_0x123a3e(0x144)](_0x123a3e(0xd2)+_0x2ee6d0[_0x123a3e(0x13f)]),_0x2ee6d0[_0x123a3e(0x140)]&&console[_0x123a3e(0x144)](_0x123a3e(0x109)+_0x2ee6d0[_0x123a3e(0x140)]),0x1;throw _0x2ee6d0;}}}
1
+ const a31_0x1b8e25=a31_0x2140;function a31_0x5719(){const _0x99d944=['Resolving\x20folder\x20\x27','folderPath','Error:\x20','error','683640COxVql','name','Resolved\x20folder\x20ID:\x20','getParent','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','in\x20','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Listing\x20folders\x20for\x20parent\x20\x27','(root)','Resolving\x20path\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','242WjBxIk','getSegment','643245ESyCVS','Folder\x20name:\x20','Parent\x20segment:\x20','Examples:','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Parent\x20name:\x20','Resolving\x20\x27','toLocaleString','segmentPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Folder\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','\x27...','folderId','resolveParentId','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','limit','Error:\x20Folder\x20reference\x20is\x20required','✔\x20Created\x20folder\x20\x27','\x20Opening\x20','web','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','elapsedTimeMillis','Target\x20path:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','45wsIrFb','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','site','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','SQL\x20query:\x0a','segmentId','\x27\x20with\x20ID:\x20','message','15549770hmTTOQ','Use:\x20tdx\x20ps\x20show','fullPath','parentFolder','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','json','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Fetching\x20folder\x20\x27','folder','cyan','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','jobId','segment:sql','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','resolvePathToResource','parent','segment:folder:show','parentSegment','createFolder','Show\x20segment\x20folder\x20details','Get\x20SQL\x20query\x20for\x20child\x20segment','Folder\x20ID\x20missing\x20from\x20resolved\x20path','description','format','type','Options:','Parent\x20ID:\x20','SEGMENT_NOT_FOUND','Resolved\x20parent\x20ID:\x20','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','Fetching\x20segment\x20details...','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','✔\x20Query\x20completed:\x20Processed\x20','getFolder','trim','Segment\x20ID:\x20','data','jsonl','600212AgPEBi','\x20\x20Full\x20path:\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','\x20rows\x20','segment:desc','Fetching\x20SQL\x20for\x20segment...','cause','Error:\x20Parent\x20segment\x20name\x20is\x20required','Resolved\x20type:\x20','Site:\x20','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Use:\x20tdx\x20ps\x20desc','execute','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20folder','\x20\x20Cause:\x20','/e/','\x20\x20Folder\x20path:\x20','Use:\x20tdx\x20ps\x20view\x20-w','listFolders','segment:folder:list','Executing\x20segment\x20query...','Usage:\x20tdx\x20sg\x20show\x20<name>','15kjxNhO','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Show\x20segment\x20or\x20folder\x20details','Create\x20segment\x20folder\x20for\x20organization','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Use:\x20tdx\x20ps\x20sql','Resolving\x20parent\x20folder\x20\x27','segment:view','segmentName','Segment\x20ID\x20missing\x20from\x20resolved\x20path','resolveFolderId','Usage:\x20tdx\x20sg\x20desc\x20<name>','\x20[Job\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','1005312mFWnGV','getSegmentSQL','\x20\x20Segment\x20name:\x20','2723777JvgVBE','Use:\x20tdx\x20ps\x20view','parentId','information_schema','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Show\x20folder\x20or\x20child\x20segment\x20details','113DcoLVr','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','segment','length','Fetching\x20folder\x20details...','Resolving\x20parent\x20segment\x20\x27','/app/ps/','verbose','test','SELECT\x20*\x20FROM\x20(\x0a','INVALID_ARGUMENT'];a31_0x5719=function(){return _0x99d944;};return a31_0x5719();}(function(_0x2b0c51,_0x4639f7){const _0x3f7344=a31_0x2140,_0x4aa4dd=_0x2b0c51();while(!![]){try{const _0x1662a4=-parseInt(_0x3f7344(0x1f1))/0x1*(-parseInt(_0x3f7344(0x175))/0x2)+-parseInt(_0x3f7344(0x177))/0x3+-parseInt(_0x3f7344(0x1c2))/0x4*(parseInt(_0x3f7344(0x1d9))/0x5)+parseInt(_0x3f7344(0x1e8))/0x6+-parseInt(_0x3f7344(0x1eb))/0x7+-parseInt(_0x3f7344(0x201))/0x8*(parseInt(_0x3f7344(0x193))/0x9)+parseInt(_0x3f7344(0x19b))/0xa;if(_0x1662a4===_0x4639f7)break;else _0x4aa4dd['push'](_0x4aa4dd['shift']());}catch(_0x26c901){_0x4aa4dd['push'](_0x4aa4dd['shift']());}}}(a31_0x5719,0x3e50a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a31_0x2140(_0x3c022d,_0x5e92cb){_0x3c022d=_0x3c022d-0x174;const _0x5719c2=a31_0x5719();let _0x2140a9=_0x5719c2[_0x3c022d];return _0x2140a9;}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 a31_0x13008a from'chalk';async function resolveSegmentTarget(_0xd191e7,_0x93281a,_0x7e5ac3){const _0x41f4e8=a31_0x2140;if(isYamlFilePath(_0xd191e7))try{const _0x460fae=await resolveYamlFilePath(_0xd191e7);return _0x7e5ac3&&(console[_0x41f4e8(0x200)]('Resolved\x20YAML\x20file:\x20'+_0xd191e7),console[_0x41f4e8(0x200)]('\x20\x20Parent\x20segment:\x20'+_0x460fae[_0x41f4e8(0x1ac)]),console[_0x41f4e8(0x200)](_0x41f4e8(0x1ea)+_0x460fae[_0x41f4e8(0x1e2)]),console[_0x41f4e8(0x200)](_0x41f4e8(0x1d3)+(_0x460fae[_0x41f4e8(0x1fe)]||_0x41f4e8(0x209))),console[_0x41f4e8(0x200)](_0x41f4e8(0x1c3)+_0x460fae[_0x41f4e8(0x19d)])),_0x460fae[_0x41f4e8(0x19d)];}catch(_0xc42a2d){throw new SDKError(ErrorCode[_0x41f4e8(0x1fc)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0xc42a2d[_0x41f4e8(0x19a)]);}if(!_0x93281a)throw new SDKError(ErrorCode[_0x41f4e8(0x1fc)],_0x41f4e8(0x19f));return _0x93281a+'/'+_0xd191e7;}export class SegmentDescribeCommand extends BaseCommand{[a31_0x1b8e25(0x202)]='segment:describe';[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1dc);async[a31_0x1b8e25(0x1ce)](_0x66b752){const _0x360875=a31_0x1b8e25,{options:_0x513d78,args:_0x56a26e,tdx:_0x284fe7}=_0x66b752,_0x8ac471=_0x56a26e[0x0],_0x22fef4=!_0x8ac471&&!!_0x513d78[_0x360875(0x1ac)],_0x5442b6=_0x8ac471||_0x513d78[_0x360875(0x1ac)];if(!_0x5442b6)return console[_0x360875(0x200)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x360875(0x200)](_0x360875(0x17a)),console[_0x360875(0x200)](_0x360875(0x192)),console['error']('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x360875(0x200)](_0x360875(0x191)),console[_0x360875(0x200)](_0x360875(0x1db)),0x1;try{const _0x390b2b=_0x513d78[_0x360875(0x180)];let _0x161c48=_0x5442b6;!_0x22fef4&&_0x390b2b&&!_0x5442b6['includes']('/')&&(_0x161c48=_0x390b2b+'/'+_0x5442b6,_0x513d78[_0x360875(0x1f9)]&&console[_0x360875(0x200)]('Resolved\x20relative\x20path\x20to:\x20'+_0x161c48));const _0x4e28ee=await withSpinner(_0x360875(0x20a)+_0x161c48+_0x360875(0x185),()=>_0x284fe7[_0x360875(0x1f4)]['resolvePathToResource'](_0x161c48),{'verbose':_0x513d78[_0x360875(0x1f9)]}),_0x5248c2=_0x4e28ee['data'];_0x513d78['verbose']&&(console['error']('Resolved\x20type:\x20'+_0x5248c2['type']),console[_0x360875(0x200)](_0x360875(0x1b5)+_0x5248c2[_0x360875(0x1ed)]),_0x5248c2[_0x360875(0x186)]&&console[_0x360875(0x200)](_0x360875(0x183)+_0x5248c2['folderId']),_0x5248c2[_0x360875(0x198)]&&console[_0x360875(0x200)](_0x360875(0x1bf)+_0x5248c2[_0x360875(0x198)]));if(_0x5248c2[_0x360875(0x1b3)]===_0x360875(0x1aa)){const _0x15b172=await withSpinner(_0x360875(0x184),()=>_0x284fe7['segment'][_0x360875(0x204)](_0x5248c2[_0x360875(0x1ed)]),{'verbose':_0x513d78[_0x360875(0x1f9)]});await handleSingleObjectOutput(_0x15b172[_0x360875(0x1c0)],_0x513d78);}else{if(_0x5248c2[_0x360875(0x1b3)]==='folder'){if(!_0x5248c2[_0x360875(0x186)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x360875(0x1b0));const _0x21a5f7=await withSpinner(_0x360875(0x1f6),()=>_0x284fe7[_0x360875(0x1f4)][_0x360875(0x1bd)](_0x5248c2[_0x360875(0x186)]),{'verbose':_0x513d78[_0x360875(0x1f9)]});await handleSingleObjectOutput(_0x21a5f7[_0x360875(0x1c0)],_0x513d78);}else{if(_0x5248c2[_0x360875(0x1b3)]==='segment'){if(!_0x5248c2['segmentId'])throw new SDKError(ErrorCode[_0x360875(0x1b6)],_0x360875(0x1e3));const _0x8da048=await withSpinner(_0x360875(0x1b9),()=>_0x284fe7[_0x360875(0x1f4)][_0x360875(0x176)](_0x5248c2[_0x360875(0x1ed)],_0x5248c2['segmentId']),{'verbose':_0x513d78[_0x360875(0x1f9)]});await handleSingleObjectOutput(_0x8da048[_0x360875(0x1c0)],_0x513d78);}}}return 0x0;}catch(_0x103b4a){if(_0x103b4a instanceof SDKError)return console[_0x360875(0x200)]('Error:\x20'+_0x103b4a[_0x360875(0x19a)]),_0x103b4a[_0x360875(0x1c8)]&&console['error'](_0x360875(0x1d1)+_0x103b4a[_0x360875(0x1c8)]),0x1;throw _0x103b4a;}}}export class SegmentShowCommand extends BaseCommand{[a31_0x1b8e25(0x202)]='segment:show';['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x1b8e25(0x1ce)](_0x55db1f){const _0x4b7227=a31_0x1b8e25,{options:_0x56723f,args:_0x4386e8,tdx:_0x284b73}=_0x55db1f,_0x490510=_0x4386e8[0x0];if(!_0x490510)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4b7227(0x200)](_0x4b7227(0x1d8)),console[_0x4b7227(0x200)](_0x4b7227(0x1e7)),console[_0x4b7227(0x200)](_0x4b7227(0x17a)),console['error'](_0x4b7227(0x17b)),console[_0x4b7227(0x200)](_0x4b7227(0x1ba)),0x1;try{const _0x789226=_0x56723f[_0x4b7227(0x1ac)],_0x478d5d=await resolveSegmentTarget(_0x490510,_0x789226,_0x56723f['verbose']);_0x56723f[_0x4b7227(0x1f9)]&&console['error'](_0x4b7227(0x190)+_0x478d5d);const _0x1847c8=await withSpinner(_0x4b7227(0x17e)+_0x490510+_0x4b7227(0x185),()=>_0x284b73[_0x4b7227(0x1f4)]['resolvePathToResource'](_0x478d5d),{'verbose':_0x56723f[_0x4b7227(0x1f9)]}),_0x2a869e=_0x1847c8[_0x4b7227(0x1c0)];_0x56723f[_0x4b7227(0x1f9)]&&(console[_0x4b7227(0x200)](_0x4b7227(0x1ca)+_0x2a869e[_0x4b7227(0x1b3)]),console[_0x4b7227(0x200)](_0x4b7227(0x1b5)+_0x2a869e[_0x4b7227(0x1ed)]));if(_0x2a869e['type']===_0x4b7227(0x1a3))return console[_0x4b7227(0x200)](_0x4b7227(0x1f3)),console[_0x4b7227(0x200)](_0x4b7227(0x1bb)),0x1;if(_0x2a869e[_0x4b7227(0x1b3)]==='parent')return console[_0x4b7227(0x200)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4b7227(0x200)](_0x4b7227(0x19c)),0x1;if(!_0x2a869e[_0x4b7227(0x198)])throw new SDKError(ErrorCode[_0x4b7227(0x1b6)],_0x4b7227(0x1e3));const _0x4f5487=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x284b73['segment'][_0x4b7227(0x1e9)](_0x2a869e[_0x4b7227(0x1ed)],_0x2a869e['segmentId']),{'verbose':_0x56723f[_0x4b7227(0x1f9)]});let _0x1a37f8=_0x4f5487[_0x4b7227(0x1c0)];const _0x3fa538=resolveLimit(_0x56723f[_0x4b7227(0x189)],DEFAULT_DISPLAY_LIMIT),_0x52a1e6=/\bLIMIT\s+\d+/i[_0x4b7227(0x1fa)](_0x1a37f8);!_0x52a1e6&&(_0x1a37f8=_0x1a37f8[_0x4b7227(0x1be)]()['replace'](/;+$/,''),_0x1a37f8=_0x4b7227(0x1fb)+_0x1a37f8+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x3fa538);_0x56723f[_0x4b7227(0x1f9)]&&console[_0x4b7227(0x200)](_0x4b7227(0x197)+_0x1a37f8);const _0x10a3de=await withProgressSpinner(_0x4b7227(0x1d7),async _0x4c05b7=>{const _0x12bfcd=_0x4b7227,_0x50c5d2=await _0x284b73['query'][_0x12bfcd(0x1ce)](_0x1a37f8,{'catalog':'td','schema':_0x12bfcd(0x1ee),'onJobId':_0x381e69=>{_0x4c05b7['setJobId'](_0x381e69);}});return _0x50c5d2;},{'verbose':_0x56723f[_0x4b7227(0x1f9)]}),_0x46ee3b=_0x10a3de[_0x4b7227(0x1c0)],_0xded0b6=_0x46ee3b[_0x4b7227(0x1a6)]?_0x4b7227(0x1e6)+_0x46ee3b[_0x4b7227(0x1a6)]+']':'';return console['error'](_0x4b7227(0x1bc)+_0x46ee3b['stats']['processedRows'][_0x4b7227(0x17f)]()+_0x4b7227(0x1c5)+(_0x4b7227(0x206)+formatElapsed(_0x46ee3b['stats'][_0x4b7227(0x18f)])+_0xded0b6)),await handleQueryOutput(_0x46ee3b,_0x56723f),0x0;}catch(_0x3a7430){if(_0x3a7430 instanceof SDKError)return console[_0x4b7227(0x200)]('✖\x20Query\x20failed\x20['+_0x3a7430['code']+']'),console[_0x4b7227(0x200)]('\x0a'+_0x3a7430['message']),0x1;throw _0x3a7430;}}}export class SegmentFolderListCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1d6);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1a8);async[a31_0x1b8e25(0x1ce)](_0x1023cf){const _0x266621=a31_0x1b8e25,{options:_0x3c0819,args:_0x284831,tdx:_0x21c3c0}=_0x1023cf;if(_0x284831[_0x266621(0x1f5)]===0x0)return console['error'](_0x266621(0x1c9)),console[_0x266621(0x200)](_0x266621(0x1de)),0x1;const _0x341653=_0x284831[0x0];try{_0x3c0819[_0x266621(0x1f9)]&&(console[_0x266621(0x200)](_0x266621(0x1cb)+_0x3c0819['site']),console[_0x266621(0x200)](_0x266621(0x17d)+_0x341653));const _0x28ee80=await withSpinner(_0x266621(0x1f7)+_0x341653+_0x266621(0x185),()=>_0x21c3c0[_0x266621(0x1f4)][_0x266621(0x187)](_0x341653),{'verbose':_0x3c0819[_0x266621(0x1f9)]}),_0x42af9c=_0x28ee80[_0x266621(0x1c0)];_0x3c0819[_0x266621(0x1f9)]&&console['error'](_0x266621(0x1b7)+_0x42af9c);const _0x32e5fc=await withSpinner(_0x266621(0x208)+_0x341653+_0x266621(0x185),()=>_0x21c3c0[_0x266621(0x1f4)][_0x266621(0x1d5)](_0x42af9c),{'verbose':_0x3c0819['verbose']}),_0x4a85fd=_0x32e5fc['data'];return console[_0x266621(0x200)]('✔\x20Found\x20'+_0x4a85fd[_0x266621(0x1f5)]+_0x266621(0x1d0)+(_0x4a85fd['length']!==0x1?'s':'')),await handleSDKOutput(_0x4a85fd,_0x3c0819),0x0;}catch(_0xc20847){if(_0xc20847 instanceof SDKError)return console[_0x266621(0x200)](_0x266621(0x1ff)+_0xc20847[_0x266621(0x19a)]),_0xc20847[_0x266621(0x1c8)]&&console[_0x266621(0x200)]('\x20\x20Cause:\x20'+_0xc20847['cause']),0x1;throw _0xc20847;}}}export class SegmentFolderShowCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1ab);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1ae);async['execute'](_0x44a138){const _0x4bf595=a31_0x1b8e25,{options:_0x360f4e,args:_0x160aa5,tdx:_0x55cec0}=_0x44a138;if(_0x160aa5['length']===0x0)return console['error'](_0x4bf595(0x18a)),console[_0x4bf595(0x200)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x295095,childId:_0x1cd362}=parseSegmentRef(_0x160aa5[0x0]);_0x360f4e[_0x4bf595(0x1f9)]&&(console[_0x4bf595(0x200)]('Site:\x20'+_0x360f4e['site']),console['error'](_0x4bf595(0x17d)+_0x295095),_0x1cd362&&console[_0x4bf595(0x200)](_0x4bf595(0x178)+_0x1cd362));if(!_0x1cd362)return console[_0x4bf595(0x200)](_0x4bf595(0x196)),0x1;const _0x4073c9=await withSpinner(_0x4bf595(0x1f7)+_0x295095+_0x4bf595(0x185),()=>_0x55cec0[_0x4bf595(0x1f4)]['resolveParentId'](_0x295095),{'verbose':_0x360f4e[_0x4bf595(0x1f9)]}),_0x3abe87=_0x4073c9[_0x4bf595(0x1c0)];_0x360f4e['verbose']&&console[_0x4bf595(0x200)](_0x4bf595(0x1b7)+_0x3abe87);const _0x1d8d8c=await withSpinner(_0x4bf595(0x1fd)+_0x1cd362+_0x4bf595(0x185),()=>_0x55cec0[_0x4bf595(0x1f4)]['resolveFolderId'](_0x3abe87,_0x1cd362),{'verbose':_0x360f4e[_0x4bf595(0x1f9)]}),_0x97c177=_0x1d8d8c['data'];_0x360f4e[_0x4bf595(0x1f9)]&&console[_0x4bf595(0x200)](_0x4bf595(0x203)+_0x97c177);const _0x533956=await withSpinner(_0x4bf595(0x1a2)+_0x1cd362+'\x27...',()=>_0x55cec0[_0x4bf595(0x1f4)][_0x4bf595(0x1bd)](_0x97c177),{'verbose':_0x360f4e[_0x4bf595(0x1f9)]});return await handleSDKOutput([_0x533956['data']],_0x360f4e),0x0;}catch(_0x2c96be){if(_0x2c96be instanceof SDKError)return console[_0x4bf595(0x200)](_0x4bf595(0x1ff)+_0x2c96be[_0x4bf595(0x19a)]),_0x2c96be[_0x4bf595(0x1c8)]&&console[_0x4bf595(0x200)](_0x4bf595(0x1d1)+_0x2c96be[_0x4bf595(0x1c8)]),0x1;throw _0x2c96be;}}}export class SegmentSQLCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1a7);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1af);async[a31_0x1b8e25(0x1ce)](_0x2fae8d){const _0x487201=a31_0x1b8e25,{options:_0x5e3b9c,args:_0x3fc41a,tdx:_0x127730}=_0x2fae8d,_0x402968=_0x3fc41a[0x0];if(!_0x402968)return console[_0x487201(0x200)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error']('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error'](_0x487201(0x17c)),console[_0x487201(0x200)](_0x487201(0x17a)),console['error'](_0x487201(0x188)),console[_0x487201(0x200)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x251a74=_0x5e3b9c[_0x487201(0x1ac)],_0x226659=await resolveSegmentTarget(_0x402968,_0x251a74,_0x5e3b9c[_0x487201(0x1f9)]);_0x5e3b9c['verbose']&&console[_0x487201(0x200)](_0x487201(0x190)+_0x226659);const _0x29a663=await withSpinner(_0x487201(0x17e)+_0x402968+_0x487201(0x185),()=>_0x127730[_0x487201(0x1f4)]['resolvePathToResource'](_0x226659),{'verbose':_0x5e3b9c['verbose']}),_0x46ee8b=_0x29a663['data'];_0x5e3b9c[_0x487201(0x1f9)]&&(console['error'](_0x487201(0x1ca)+_0x46ee8b[_0x487201(0x1b3)]),console['error'](_0x487201(0x1b5)+_0x46ee8b['parentId']));if(_0x46ee8b[_0x487201(0x1b3)]===_0x487201(0x1a3))return console[_0x487201(0x200)](_0x487201(0x1b8)),console[_0x487201(0x200)](_0x487201(0x207)),0x1;if(_0x46ee8b[_0x487201(0x1b3)]===_0x487201(0x1aa))return console[_0x487201(0x200)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x487201(0x200)](_0x487201(0x1df)),0x1;if(!_0x46ee8b[_0x487201(0x198)])throw new SDKError(ErrorCode[_0x487201(0x1b6)],_0x487201(0x1e3));const _0x53abd7=await withSpinner(_0x487201(0x1c7),()=>_0x127730[_0x487201(0x1f4)][_0x487201(0x1e9)](_0x46ee8b[_0x487201(0x1ed)],_0x46ee8b[_0x487201(0x198)]),{'verbose':_0x5e3b9c['verbose']}),_0x2d4c7c=_0x53abd7[_0x487201(0x1c0)];return _0x5e3b9c[_0x487201(0x1b2)]===_0x487201(0x1a0)||_0x5e3b9c[_0x487201(0x1b2)]===_0x487201(0x1c1)?await handleSDKOutput([{'sql':_0x2d4c7c}],_0x5e3b9c):console['log'](_0x2d4c7c),0x0;}catch(_0x1dceee){if(_0x1dceee instanceof SDKError)return console[_0x487201(0x200)]('Error:\x20'+_0x1dceee[_0x487201(0x19a)]),_0x1dceee['cause']&&console[_0x487201(0x200)](_0x487201(0x1d1)+_0x1dceee['cause']),0x1;throw _0x1dceee;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a31_0x1b8e25(0x202)]='segment:folder:create';[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1dd);async[a31_0x1b8e25(0x1ce)](_0xd7bbe7){const _0x475f41=a31_0x1b8e25,{options:_0xe345fe,args:_0x39f6f5,tdx:_0x250b05}=_0xd7bbe7,_0x14cedb=_0xe345fe;if(_0x39f6f5[_0x475f41(0x1f5)]<0x2)return console[_0x475f41(0x200)](_0x475f41(0x1cc)),console[_0x475f41(0x200)](_0x475f41(0x18e)),0x1;const _0x1cdcdf=_0x39f6f5[0x0],_0x45b44f=_0x39f6f5[0x1];_0x14cedb[_0x475f41(0x1f9)]&&(console[_0x475f41(0x200)]('Site:\x20'+_0x14cedb[_0x475f41(0x195)]),console[_0x475f41(0x200)](_0x475f41(0x179)+_0x1cdcdf),console[_0x475f41(0x200)](_0x475f41(0x178)+_0x45b44f));let _0x6175c8;if(_0x14cedb[_0x475f41(0x19e)]){const _0x5bed06=_0x14cedb['parentFolder'],_0x269db6=await withSpinner(_0x475f41(0x1f7)+_0x1cdcdf+'\x27...',()=>_0x250b05[_0x475f41(0x1f4)][_0x475f41(0x187)](_0x1cdcdf),{'verbose':_0x14cedb[_0x475f41(0x1f9)]}),_0x8be238=_0x269db6[_0x475f41(0x1c0)],_0x23999a=await withSpinner(_0x475f41(0x1e0)+_0x5bed06+_0x475f41(0x185),()=>_0x250b05[_0x475f41(0x1f4)][_0x475f41(0x1e4)](_0x8be238,_0x5bed06),{'verbose':_0x14cedb[_0x475f41(0x1f9)]});_0x6175c8=_0x23999a['data'],_0x14cedb[_0x475f41(0x1f9)]&&console[_0x475f41(0x200)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x6175c8);}const _0x5c6881={'name':_0x45b44f,'description':_0x14cedb[_0x475f41(0x1b1)],'parentFolderId':_0x6175c8},_0x5dcc02=await withSpinner('Creating\x20folder\x20\x27'+_0x45b44f+_0x475f41(0x185),()=>_0x250b05[_0x475f41(0x1f4)][_0x475f41(0x1ad)](_0x1cdcdf,_0x5c6881),{'verbose':_0x14cedb['verbose']}),_0x4faf8a=_0x5dcc02[_0x475f41(0x1c0)];return console[_0x475f41(0x200)](_0x475f41(0x18b)+_0x4faf8a[_0x475f41(0x202)]+_0x475f41(0x199)+_0x4faf8a['id']),await handleSDKOutput([_0x4faf8a],_0x14cedb),0x0;}}export class SegmentViewCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1e1);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1f0);async[a31_0x1b8e25(0x1ce)](_0x32adb0){const _0x551be7=a31_0x1b8e25,{options:_0x4349ef,args:_0x18feb4,tdx:_0x42d292}=_0x32adb0,_0x13846f=_0x18feb4[0x0];if(!_0x13846f)return console[_0x551be7(0x200)](_0x551be7(0x1cf)),console['error'](_0x551be7(0x182)),console[_0x551be7(0x200)](_0x551be7(0x181)),console['error'](_0x551be7(0x1b4)),console[_0x551be7(0x200)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x551be7(0x200)](_0x551be7(0x17a)),console['error'](_0x551be7(0x1a1)),console[_0x551be7(0x200)](_0x551be7(0x1f2)),console[_0x551be7(0x200)](_0x551be7(0x194)),console[_0x551be7(0x200)](_0x551be7(0x1c4)),0x1;try{const _0x7ddf66=_0x4349ef[_0x551be7(0x1ac)],_0xd2d766=await resolveSegmentTarget(_0x13846f,_0x7ddf66,_0x4349ef[_0x551be7(0x1f9)]);_0x4349ef[_0x551be7(0x1f9)]&&console['error'](_0x551be7(0x190)+_0xd2d766);const _0x546706=await withSpinner(_0x551be7(0x17e)+_0x13846f+_0x551be7(0x185),()=>_0x42d292['segment'][_0x551be7(0x1a9)](_0xd2d766),{'verbose':_0x4349ef[_0x551be7(0x1f9)]}),_0x13251f=_0x546706[_0x551be7(0x1c0)];_0x4349ef['verbose']&&(console[_0x551be7(0x200)](_0x551be7(0x1ca)+_0x13251f['type']),console['error'](_0x551be7(0x1b5)+_0x13251f[_0x551be7(0x1ed)]),_0x13251f[_0x551be7(0x186)]&&console[_0x551be7(0x200)]('Folder\x20ID:\x20'+_0x13251f[_0x551be7(0x186)]),_0x13251f[_0x551be7(0x198)]&&console['error']('Segment\x20ID:\x20'+_0x13251f['segmentId']));if(_0x4349ef[_0x551be7(0x18d)]){if(_0x13251f[_0x551be7(0x1b3)]===_0x551be7(0x1a3))return console[_0x551be7(0x200)]('Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.'),0x1;if(_0x13251f[_0x551be7(0x1b3)]==='parent')return console[_0x551be7(0x200)](_0x551be7(0x174)),console[_0x551be7(0x200)](_0x551be7(0x1d4)),0x1;if(!_0x13251f[_0x551be7(0x198)])throw new SDKError(ErrorCode[_0x551be7(0x1b6)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x15f554=getConsoleNextUrl(_0x4349ef[_0x551be7(0x195)],'/app/ps/'+_0x13251f[_0x551be7(0x1ed)]+'/e/'+_0x13251f[_0x551be7(0x198)]);return console[_0x551be7(0x200)](a31_0x13008a['green']('✔')+_0x551be7(0x18c)+a31_0x13008a[_0x551be7(0x1a4)](_0x15f554)),openBrowser(_0x15f554),0x0;}if(_0x13251f[_0x551be7(0x1b3)]===_0x551be7(0x1a3)){if(!_0x13251f[_0x551be7(0x186)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x551be7(0x1b0));const _0x4562e4=await withSpinner('Fetching\x20folder\x20details...',()=>_0x42d292[_0x551be7(0x1f4)][_0x551be7(0x1bd)](_0x13251f[_0x551be7(0x186)]),{'verbose':_0x4349ef[_0x551be7(0x1f9)]});await handleSingleObjectOutput(_0x4562e4[_0x551be7(0x1c0)],_0x4349ef);}else{if(_0x13251f[_0x551be7(0x1b3)]===_0x551be7(0x1f4)){if(!_0x13251f[_0x551be7(0x198)])throw new SDKError(ErrorCode[_0x551be7(0x1b6)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2445e1=await withSpinner('Fetching\x20segment\x20details...',()=>_0x42d292[_0x551be7(0x1f4)][_0x551be7(0x176)](_0x13251f[_0x551be7(0x1ed)],_0x13251f['segmentId']),{'verbose':_0x4349ef[_0x551be7(0x1f9)]}),_0x3f9546=getConsoleNextUrl(_0x4349ef[_0x551be7(0x195)],_0x551be7(0x1f8)+_0x13251f[_0x551be7(0x1ed)]+_0x551be7(0x1d2)+_0x13251f[_0x551be7(0x198)]),_0x369b1d=_0x2445e1[_0x551be7(0x1c0)];_0x369b1d['url']=_0x3f9546,await handleSingleObjectOutput(_0x369b1d,_0x4349ef);}else return console['error']('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x551be7(0x1ec)),0x1;}return 0x0;}catch(_0x3b5adb){if(_0x3b5adb instanceof SDKError)return console[_0x551be7(0x200)](_0x551be7(0x1ff)+_0x3b5adb[_0x551be7(0x19a)]),_0x3b5adb[_0x551be7(0x1c8)]&&console['error'](_0x551be7(0x1d1)+_0x3b5adb['cause']),0x1;throw _0x3b5adb;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a31_0x1b8e25(0x202)]=a31_0x1b8e25(0x1c6);[a31_0x1b8e25(0x1b1)]=a31_0x1b8e25(0x1da);async['execute'](_0x1f33cc){const _0x5b59e3=a31_0x1b8e25,{options:_0x39618c,args:_0x49addc,tdx:_0x3897e7}=_0x1f33cc,_0x4bc28a=_0x49addc[0x0];if(!_0x4bc28a)return console[_0x5b59e3(0x200)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x5b59e3(0x200)](_0x5b59e3(0x1e5)),console[_0x5b59e3(0x200)](_0x5b59e3(0x20b)),console['error'](_0x5b59e3(0x17a)),console['error'](_0x5b59e3(0x1a5)),console[_0x5b59e3(0x200)](_0x5b59e3(0x1ef)),0x1;try{const _0x1b1208=_0x39618c[_0x5b59e3(0x1ac)],_0x55686e=await resolveSegmentTarget(_0x4bc28a,_0x1b1208,_0x39618c[_0x5b59e3(0x1f9)]);_0x39618c[_0x5b59e3(0x1f9)]&&console[_0x5b59e3(0x200)](_0x5b59e3(0x190)+_0x55686e);const _0x42ea40=await withSpinner(_0x5b59e3(0x17e)+_0x4bc28a+'\x27...',()=>_0x3897e7[_0x5b59e3(0x1f4)][_0x5b59e3(0x1a9)](_0x55686e),{'verbose':_0x39618c[_0x5b59e3(0x1f9)]}),_0x30fd57=_0x42ea40['data'];_0x39618c[_0x5b59e3(0x1f9)]&&(console['error'](_0x5b59e3(0x1ca)+_0x30fd57['type']),console[_0x5b59e3(0x200)](_0x5b59e3(0x1b5)+_0x30fd57[_0x5b59e3(0x1ed)]));if(_0x30fd57['type']===_0x5b59e3(0x1a3))return console[_0x5b59e3(0x200)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x5b59e3(0x200)](_0x5b59e3(0x207)),0x1;if(_0x30fd57[_0x5b59e3(0x1b3)]===_0x5b59e3(0x1aa))return console[_0x5b59e3(0x200)](_0x5b59e3(0x205)),console[_0x5b59e3(0x200)](_0x5b59e3(0x1cd)),0x1;if(!_0x30fd57['segmentId'])throw new SDKError(ErrorCode[_0x5b59e3(0x1b6)],_0x5b59e3(0x1e3));const _0x2a5fdf=await withSpinner(_0x5b59e3(0x1c7),()=>_0x3897e7[_0x5b59e3(0x1f4)]['getSegmentSQL'](_0x30fd57[_0x5b59e3(0x1ed)],_0x30fd57[_0x5b59e3(0x198)]),{'verbose':_0x39618c[_0x5b59e3(0x1f9)]}),_0x3e4b50=_0x2a5fdf['data'],_0x59e9bb=await executeSchemaQuery(_0x3e4b50,_0x3897e7,_0x39618c);return await handleQueryOutput(_0x59e9bb,_0x39618c),0x0;}catch(_0x677314){if(_0x677314 instanceof SDKError)return console[_0x5b59e3(0x200)]('Error:\x20'+_0x677314['message']),_0x677314[_0x5b59e3(0x1c8)]&&console[_0x5b59e3(0x200)](_0x5b59e3(0x1d1)+_0x677314['cause']),0x1;throw _0x677314;}}}
@@ -1 +1 @@
1
- function a32_0x4790(){const _0x5ddece=['328515juuTtO','ruleFile','135kbiQMV','\x27...','Resolving\x20folder\x20\x27','verbose','includes','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','Parent:\x20','9697680kluiRp','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Site:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','1840908BpVIJF','Create\x20child\x20segment\x20with\x20filtering\x20rules','Creating\x20segment\x20\x27','\x27\x20with\x20ID:\x20','rule','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x20\x20\x20Path:\x20','7mmROjW','name','1935022NnHAWv','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','yellow','createSegment','error','Resolved\x20folder\x20ID:\x20','segments','Parent\x20path:\x20','✔\x20Created\x20segment\x20\x27','segment:create','segmentPath','2587185RziViO','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','resolvePathToResource','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','length','segment','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Resolving\x20parent\x20segment\x20\x27','resolveFolderId','2455264fIwefg','1ulDlVf','folder','resolveParentId','87864uzNGfu','type','Resolved\x20relative\x20path\x20to:\x20','Segment\x20name:\x20','parent'];a32_0x4790=function(){return _0x5ddece;};return a32_0x4790();}const a32_0x28b4ad=a32_0x5a64;(function(_0x59e019,_0x24c04c){const _0x1cc1dc=a32_0x5a64,_0x32ab7e=_0x59e019();while(!![]){try{const _0x3eebbf=parseInt(_0x1cc1dc(0x19a))/0x1*(-parseInt(_0x1cc1dc(0x1b9))/0x2)+parseInt(_0x1cc1dc(0x1a2))/0x3+-parseInt(_0x1cc1dc(0x1b0))/0x4+-parseInt(_0x1cc1dc(0x1a4))/0x5*(-parseInt(_0x1cc1dc(0x19d))/0x6)+-parseInt(_0x1cc1dc(0x1b7))/0x7*(-parseInt(_0x1cc1dc(0x199))/0x8)+parseInt(_0x1cc1dc(0x18f))/0x9+parseInt(_0x1cc1dc(0x1ac))/0xa;if(_0x3eebbf===_0x24c04c)break;else _0x32ab7e['push'](_0x32ab7e['shift']());}catch(_0x3ba124){_0x32ab7e['push'](_0x32ab7e['shift']());}}}(a32_0x4790,0x9c910));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a32_0x5a64(_0x1cbb7c,_0x40aa7f){_0x1cbb7c=_0x1cbb7c-0x18b;const _0x4790d1=a32_0x4790();let _0x5a640d=_0x4790d1[_0x1cbb7c];return _0x5a640d;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a32_0x5b4c3d from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x28b4ad(0x1b8)]=a32_0x28b4ad(0x18d);['description']=a32_0x28b4ad(0x1b1);async['execute'](_0x1d2b10){const _0x30d0b2=a32_0x28b4ad;console[_0x30d0b2(0x1bd)](a32_0x5b4c3d[_0x30d0b2(0x1bb)](_0x30d0b2(0x1b5))),console[_0x30d0b2(0x1bd)](a32_0x5b4c3d[_0x30d0b2(0x1bb)](_0x30d0b2(0x1af)));const {options:_0x34a5d8,args:_0x52ff3d,tdx:_0x3e470c}=_0x1d2b10,_0x39accd=_0x34a5d8;if(_0x52ff3d['length']===0x0)return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1aa)),console['error'](_0x30d0b2(0x1ad)),console[_0x30d0b2(0x1bd)]('Examples:'),console['error'](_0x30d0b2(0x1a9)),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x196)),console[_0x30d0b2(0x1bd)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x20313f=_0x52ff3d[0x0],_0x1280e2=_0x34a5d8[_0x30d0b2(0x18e)];let _0x1fcd93=_0x20313f;_0x1280e2&&!_0x20313f[_0x30d0b2(0x1a8)]('/')&&(_0x1fcd93=_0x1280e2+'/'+_0x20313f,_0x39accd[_0x30d0b2(0x1a7)]&&console['error'](_0x30d0b2(0x19f)+_0x1fcd93));const _0x290b7b=parsePath(_0x1fcd93);if(_0x290b7b['segments'][_0x30d0b2(0x194)]<0x2)return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1ba)),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x190)),0x1;const _0x4aa022=_0x290b7b[_0x30d0b2(0x1bf)][0x0],_0x5809fb=getBaseName(_0x1fcd93),_0x4eaed7=getParentPath(_0x1fcd93);_0x39accd[_0x30d0b2(0x1a7)]&&(console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1ae)+_0x39accd['site']),console[_0x30d0b2(0x1bd)]('Target\x20path:\x20'+_0x1fcd93),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1ab)+_0x4aa022),console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1a0)+_0x5809fb),console['error'](_0x30d0b2(0x18b)+_0x4eaed7));const _0x1ef539=await withSpinner(_0x30d0b2(0x197)+_0x4aa022+_0x30d0b2(0x1a5),()=>_0x3e470c[_0x30d0b2(0x195)][_0x30d0b2(0x19c)](_0x4aa022),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]}),_0x5a8a56=_0x1ef539['data'];let _0x1e461b;if(_0x290b7b[_0x30d0b2(0x1bf)][_0x30d0b2(0x194)]>0x2){const _0x51c7a3=await withSpinner('Resolving\x20folder\x20path\x20\x27'+_0x4eaed7+_0x30d0b2(0x1a5),()=>_0x3e470c[_0x30d0b2(0x195)][_0x30d0b2(0x192)](_0x4eaed7),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]}),_0x3ebd3e=_0x51c7a3[_0x30d0b2(0x191)];if(_0x3ebd3e['type']!==_0x30d0b2(0x19b)&&_0x3ebd3e[_0x30d0b2(0x19e)]!==_0x30d0b2(0x1a1))return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x193)),0x1;_0x1e461b=_0x3ebd3e['folderId'];}else{if(_0x39accd[_0x30d0b2(0x19b)]){const _0x518eb0=await withSpinner(_0x30d0b2(0x1a6)+_0x39accd[_0x30d0b2(0x19b)]+_0x30d0b2(0x1a5),()=>_0x3e470c['segment'][_0x30d0b2(0x198)](_0x5a8a56,_0x39accd[_0x30d0b2(0x19b)]),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]});_0x1e461b=_0x518eb0[_0x30d0b2(0x191)];}}_0x39accd[_0x30d0b2(0x1a7)]&&_0x1e461b&&console['error'](_0x30d0b2(0x1be)+_0x1e461b);const _0x39c20c=await loadJSONFromOptions(_0x39accd[_0x30d0b2(0x1b4)],_0x39accd[_0x30d0b2(0x1a3)]),_0x542e01={'name':_0x5809fb,'description':_0x39accd['description'],'rule':_0x39c20c,'kind':_0x39accd['kind']!==undefined?parseInt(_0x39accd['kind'],0xa):undefined,'isVisible':_0x39accd['invisible']?![]:undefined,'segmentFolderId':_0x1e461b,'countPopulation':_0x39accd['noCountPopulation']?![]:undefined},_0x517126=await withSpinner(_0x30d0b2(0x1b2)+_0x5809fb+_0x30d0b2(0x1a5),()=>_0x3e470c[_0x30d0b2(0x195)][_0x30d0b2(0x1bc)](_0x5a8a56,_0x542e01),{'verbose':_0x39accd[_0x30d0b2(0x1a7)]}),_0x2d8c33=_0x517126[_0x30d0b2(0x191)];return console[_0x30d0b2(0x1bd)](_0x30d0b2(0x18c)+_0x2d8c33['name']+_0x30d0b2(0x1b3)+_0x2d8c33['id']),_0x1fcd93!==_0x20313f&&console[_0x30d0b2(0x1bd)](_0x30d0b2(0x1b6)+_0x1fcd93),await handleSDKOutput([_0x2d8c33],_0x39accd),0x0;}}
1
+ const a32_0x50e1d0=a32_0x2a85;function a32_0x249a(){const _0x10df87=['description','6589sdMDXl','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','1269790FWjCfi','617144KuSxiD','segment:create','Examples:','noCountPopulation','Segment\x20name:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','48cSskLJ','Target\x20path:\x20','type','9tueUEm','parent','error','kind','734812gDmCBg','resolveParentId','resolvePathToResource','Resolving\x20parent\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','✔\x20Created\x20segment\x20\x27','segments','Resolved\x20relative\x20path\x20to:\x20','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Creating\x20segment\x20\x27','191768dCYHYs','Resolving\x20folder\x20path\x20\x27','verbose','\x27...','folder','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','execute','\x20\x20\x20Path:\x20','name','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','createSegment','folderId','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','Parent\x20path:\x20','46dpLMfC','yellow','276240wxaKWi','5hvVWTa','segment','Create\x20child\x20segment\x20with\x20filtering\x20rules','Resolving\x20folder\x20\x27','length','Site:\x20','data','77208PArcbF','35SUaTBB','ruleFile'];a32_0x249a=function(){return _0x10df87;};return a32_0x249a();}function a32_0x2a85(_0x27912c,_0x1cf8b5){_0x27912c=_0x27912c-0x1a2;const _0x249a26=a32_0x249a();let _0x2a85f9=_0x249a26[_0x27912c];return _0x2a85f9;}(function(_0x154c8f,_0x56ed32){const _0x210fe9=a32_0x2a85,_0x52afeb=_0x154c8f();while(!![]){try{const _0x1de510=parseInt(_0x210fe9(0x1aa))/0x1*(-parseInt(_0x210fe9(0x1d4))/0x2)+-parseInt(_0x210fe9(0x1a6))/0x3+-parseInt(_0x210fe9(0x1bb))/0x4*(-parseInt(_0x210fe9(0x1d7))/0x5)+parseInt(_0x210fe9(0x1d6))/0x6*(-parseInt(_0x210fe9(0x1a7))/0x7)+-parseInt(_0x210fe9(0x1c5))/0x8*(-parseInt(_0x210fe9(0x1b7))/0x9)+parseInt(_0x210fe9(0x1ac))/0xa+-parseInt(_0x210fe9(0x1ad))/0xb*(-parseInt(_0x210fe9(0x1b4))/0xc);if(_0x1de510===_0x56ed32)break;else _0x52afeb['push'](_0x52afeb['shift']());}catch(_0x268415){_0x52afeb['push'](_0x52afeb['shift']());}}}(a32_0x249a,0x25022));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a32_0x3c938c from'chalk';export class SegmentCreateCommand extends BaseCommand{[a32_0x50e1d0(0x1ce)]=a32_0x50e1d0(0x1ae);[a32_0x50e1d0(0x1a9)]=a32_0x50e1d0(0x1d9);async[a32_0x50e1d0(0x1cc)](_0x45700f){const _0x37836d=a32_0x50e1d0;console['error'](a32_0x3c938c[_0x37836d(0x1d5)](_0x37836d(0x1d2))),console['error'](a32_0x3c938c[_0x37836d(0x1d5)](_0x37836d(0x1bf)));const {options:_0x4b5786,args:_0x2658c3,tdx:_0x2e042b}=_0x45700f,_0x434e7b=_0x4b5786;if(_0x2658c3[_0x37836d(0x1a3)]===0x0)return console[_0x37836d(0x1b9)](_0x37836d(0x1b2)),console[_0x37836d(0x1b9)](_0x37836d(0x1ab)),console[_0x37836d(0x1b9)](_0x37836d(0x1af)),console['error'](_0x37836d(0x1c3)),console[_0x37836d(0x1b9)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x37836d(0x1b9)](_0x37836d(0x1b3)),0x1;const _0x3a9758=_0x2658c3[0x0],_0x440be3=_0x4b5786['segmentPath'];let _0x22f0ad=_0x3a9758;_0x440be3&&!_0x3a9758['includes']('/')&&(_0x22f0ad=_0x440be3+'/'+_0x3a9758,_0x434e7b['verbose']&&console['error'](_0x37836d(0x1c2)+_0x22f0ad));const _0x307e70=parsePath(_0x22f0ad);if(_0x307e70[_0x37836d(0x1c1)][_0x37836d(0x1a3)]<0x2)return console['error'](_0x37836d(0x1cb)),console[_0x37836d(0x1b9)](_0x37836d(0x1cf)),0x1;const _0x4feaa9=_0x307e70['segments'][0x0],_0x53fc3d=getBaseName(_0x22f0ad),_0x1f4904=getParentPath(_0x22f0ad);_0x434e7b['verbose']&&(console[_0x37836d(0x1b9)](_0x37836d(0x1a4)+_0x434e7b['site']),console['error'](_0x37836d(0x1b5)+_0x22f0ad),console[_0x37836d(0x1b9)]('Parent:\x20'+_0x4feaa9),console[_0x37836d(0x1b9)](_0x37836d(0x1b1)+_0x53fc3d),console[_0x37836d(0x1b9)](_0x37836d(0x1d3)+_0x1f4904));const _0x421c2d=await withSpinner(_0x37836d(0x1be)+_0x4feaa9+_0x37836d(0x1c8),()=>_0x2e042b[_0x37836d(0x1d8)][_0x37836d(0x1bc)](_0x4feaa9),{'verbose':_0x434e7b['verbose']}),_0x2deace=_0x421c2d[_0x37836d(0x1a5)];let _0x1c15d3;if(_0x307e70['segments'][_0x37836d(0x1a3)]>0x2){const _0x4f3316=await withSpinner(_0x37836d(0x1c6)+_0x1f4904+_0x37836d(0x1c8),()=>_0x2e042b[_0x37836d(0x1d8)][_0x37836d(0x1bd)](_0x1f4904),{'verbose':_0x434e7b[_0x37836d(0x1c7)]}),_0x1aa431=_0x4f3316[_0x37836d(0x1a5)];if(_0x1aa431[_0x37836d(0x1b6)]!==_0x37836d(0x1c9)&&_0x1aa431[_0x37836d(0x1b6)]!==_0x37836d(0x1b8))return console[_0x37836d(0x1b9)](_0x37836d(0x1ca)),0x1;_0x1c15d3=_0x1aa431[_0x37836d(0x1d1)];}else{if(_0x434e7b['folder']){const _0x3b0752=await withSpinner(_0x37836d(0x1a2)+_0x434e7b[_0x37836d(0x1c9)]+_0x37836d(0x1c8),()=>_0x2e042b[_0x37836d(0x1d8)]['resolveFolderId'](_0x2deace,_0x434e7b[_0x37836d(0x1c9)]),{'verbose':_0x434e7b['verbose']});_0x1c15d3=_0x3b0752['data'];}}_0x434e7b['verbose']&&_0x1c15d3&&console[_0x37836d(0x1b9)]('Resolved\x20folder\x20ID:\x20'+_0x1c15d3);const _0x13ced4=await loadJSONFromOptions(_0x434e7b['rule'],_0x434e7b[_0x37836d(0x1a8)]),_0x4964a0={'name':_0x53fc3d,'description':_0x434e7b[_0x37836d(0x1a9)],'rule':_0x13ced4,'kind':_0x434e7b[_0x37836d(0x1ba)]!==undefined?parseInt(_0x434e7b[_0x37836d(0x1ba)],0xa):undefined,'isVisible':_0x434e7b['invisible']?![]:undefined,'segmentFolderId':_0x1c15d3,'countPopulation':_0x434e7b[_0x37836d(0x1b0)]?![]:undefined},_0x117995=await withSpinner(_0x37836d(0x1c4)+_0x53fc3d+_0x37836d(0x1c8),()=>_0x2e042b[_0x37836d(0x1d8)][_0x37836d(0x1d0)](_0x2deace,_0x4964a0),{'verbose':_0x434e7b[_0x37836d(0x1c7)]}),_0x2be4fb=_0x117995[_0x37836d(0x1a5)];return console[_0x37836d(0x1b9)](_0x37836d(0x1c0)+_0x2be4fb[_0x37836d(0x1ce)]+'\x27\x20with\x20ID:\x20'+_0x2be4fb['id']),_0x22f0ad!==_0x3a9758&&console['error'](_0x37836d(0x1cd)+_0x22f0ad),await handleSDKOutput([_0x2be4fb],_0x434e7b),0x0;}}
@@ -1 +1 @@
1
- const a33_0x102240=a33_0x846f;function a33_0x5c4a(){const _0x966947=['\x20field','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','1473ExZjkT','segment','453418MjOXVe','data','List\x20available\x20fields\x20for\x20segmentation','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','2928105HShOHb','✔\x20Found\x20','listFields','366299hNZWZL','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','error','name','1921530vwCsFb','json','length','2799300WeamAz','860mpkSte','56dpVowW','\x27...','execute','Site:\x20','description','1114684hHJauz','Parent\x20segment:\x20','site','jsonl','segment:fields'];a33_0x5c4a=function(){return _0x966947;};return a33_0x5c4a();}(function(_0x4a9936,_0x5f1fc6){const _0x4d8f2f=a33_0x846f,_0x4d6720=_0x4a9936();while(!![]){try{const _0x424f65=-parseInt(_0x4d8f2f(0xb2))/0x1+parseInt(_0x4d8f2f(0xba))/0x2*(parseInt(_0x4d8f2f(0xa9))/0x3)+-parseInt(_0x4d8f2f(0xa1))/0x4+parseInt(_0x4d8f2f(0xb6))/0x5+parseInt(_0x4d8f2f(0xb9))/0x6+parseInt(_0x4d8f2f(0xab))/0x7*(-parseInt(_0x4d8f2f(0x9c))/0x8)+parseInt(_0x4d8f2f(0xaf))/0x9;if(_0x424f65===_0x5f1fc6)break;else _0x4d6720['push'](_0x4d6720['shift']());}catch(_0x4407d9){_0x4d6720['push'](_0x4d6720['shift']());}}}(a33_0x5c4a,0x468af));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a33_0x846f(_0x58f7ea,_0x3428e0){_0x58f7ea=_0x58f7ea-0x9c;const _0x5c4a7a=a33_0x5c4a();let _0x846fd=_0x5c4a7a[_0x58f7ea];return _0x846fd;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a33_0x102240(0xb5)]=a33_0x102240(0xa5);[a33_0x102240(0xa0)]=a33_0x102240(0xad);async[a33_0x102240(0x9e)](_0x174e9f){const _0x5f4612=a33_0x102240,{options:_0x6f1559,args:_0x14c19e,tdx:_0xbaa19d}=_0x174e9f,_0x113a51=_0x14c19e[0x0]||_0x6f1559['parentSegment'];if(!_0x113a51)return console['error'](_0x5f4612(0xa7)),console['error'](_0x5f4612(0xae)),console['error'](_0x5f4612(0xb3)),0x1;_0x6f1559[_0x5f4612(0xa8)]&&(console[_0x5f4612(0xb4)](_0x5f4612(0x9f)+_0x6f1559[_0x5f4612(0xa3)]),console[_0x5f4612(0xb4)](_0x5f4612(0xa2)+_0x113a51));const _0x44df5c=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x113a51+_0x5f4612(0x9d),()=>_0xbaa19d[_0x5f4612(0xaa)][_0x5f4612(0xb1)](_0x113a51),{'verbose':_0x6f1559[_0x5f4612(0xa8)]}),_0x4516ba=_0x44df5c[_0x5f4612(0xac)];console[_0x5f4612(0xb4)](_0x5f4612(0xb0)+_0x4516ba[_0x5f4612(0xb8)]+_0x5f4612(0xa6)+(_0x4516ba[_0x5f4612(0xb8)]!==0x1?'s':''));if(_0x6f1559[_0x5f4612(0xb7)]||_0x6f1559[_0x5f4612(0xa4)])return await handleSDKOutput(_0x4516ba,_0x6f1559),0x0;return displayFieldsHumanReadable(_0x4516ba,_0x113a51),0x0;}}
1
+ function a33_0xdc10(_0x35a36a,_0x21639d){_0x35a36a=_0x35a36a-0xe6;const _0x3e01a8=a33_0x3e01();let _0xdc10d6=_0x3e01a8[_0x35a36a];return _0xdc10d6;}const a33_0x147fc3=a33_0xdc10;(function(_0x46e858,_0x629e5f){const _0x28e3ed=a33_0xdc10,_0x502369=_0x46e858();while(!![]){try{const _0x2f281e=-parseInt(_0x28e3ed(0xfa))/0x1+parseInt(_0x28e3ed(0x100))/0x2*(-parseInt(_0x28e3ed(0xf8))/0x3)+parseInt(_0x28e3ed(0xed))/0x4+-parseInt(_0x28e3ed(0xf5))/0x5+-parseInt(_0x28e3ed(0xef))/0x6+-parseInt(_0x28e3ed(0xea))/0x7*(-parseInt(_0x28e3ed(0xf0))/0x8)+parseInt(_0x28e3ed(0xeb))/0x9;if(_0x2f281e===_0x629e5f)break;else _0x502369['push'](_0x502369['shift']());}catch(_0x5c6533){_0x502369['push'](_0x502369['shift']());}}}(a33_0x3e01,0x8899e));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{[a33_0x147fc3(0x103)]=a33_0x147fc3(0xf2);[a33_0x147fc3(0xf1)]='List\x20available\x20fields\x20for\x20segmentation';async[a33_0x147fc3(0x102)](_0x456f98){const _0x4c6d17=a33_0x147fc3,{options:_0x220c4d,args:_0x55ed2d,tdx:_0x587a82}=_0x456f98,_0x1453f2=_0x55ed2d[0x0]||_0x220c4d[_0x4c6d17(0xfb)];if(!_0x1453f2)return console['error'](_0x4c6d17(0xfd)),console[_0x4c6d17(0xfc)](_0x4c6d17(0xf3)),console[_0x4c6d17(0xfc)](_0x4c6d17(0xf7)),0x1;_0x220c4d[_0x4c6d17(0xfe)]&&(console[_0x4c6d17(0xfc)]('Site:\x20'+_0x220c4d[_0x4c6d17(0xe8)]),console[_0x4c6d17(0xfc)](_0x4c6d17(0xe6)+_0x1453f2));const _0x6a8d16=await withSpinner(_0x4c6d17(0xf9)+_0x1453f2+_0x4c6d17(0xe7),()=>_0x587a82['segment'][_0x4c6d17(0xec)](_0x1453f2),{'verbose':_0x220c4d[_0x4c6d17(0xfe)]}),_0x2cc498=_0x6a8d16[_0x4c6d17(0x101)];console[_0x4c6d17(0xfc)](_0x4c6d17(0xff)+_0x2cc498['length']+_0x4c6d17(0xee)+(_0x2cc498[_0x4c6d17(0xf6)]!==0x1?'s':''));if(_0x220c4d[_0x4c6d17(0xe9)]||_0x220c4d[_0x4c6d17(0xf4)])return await handleSDKOutput(_0x2cc498,_0x220c4d),0x0;return displayFieldsHumanReadable(_0x2cc498,_0x1453f2),0x0;}}function a33_0x3e01(){const _0x30314f=['segment:fields','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','jsonl','70460JgslYY','length','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','2338962gmsvOc','Listing\x20fields\x20for\x20\x27','261614gAMGDJ','parentSegment','error','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','✔\x20Found\x20','2oPxNJB','data','execute','name','Parent\x20segment:\x20','\x27...','site','json','1621060RlNMbm','10555038jdaOWb','listFields','2061144SmpvIt','\x20field','3218100CqrlwJ','16PDDdON','description'];a33_0x3e01=function(){return _0x30314f;};return a33_0x3e01();}
@@ -1 +1 @@
1
- function a34_0x3242(_0xaca39c,_0x528ab5){_0xaca39c=_0xaca39c-0xc9;const _0xa749ea=a34_0xa749();let _0x3242f5=_0xa749ea[_0xaca39c];return _0x3242f5;}function a34_0xa749(){const _0x3cd2d6=['Parent\x20segment:\x20','1614219CfewwY','\x20\x20Target:\x20','no_parent','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','\x0aError:','1995012sGIzZn','198kERMAN','\x20with\x20','file','activations','cyan','resourceName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','4993500sTWjZR','helpText','dirname','diff','dryRun','journeyVersions','length','\x27...','files','journeys','Target\x20resource:\x20','✔\x20Pulled\x20','targetDir','381941iWiaXG','parentName','8304375ReqKxn','\x20changed\x20files','isNew','yellow','yes','16573644wVWnNx','parent_segment','\x20unchanged\x20files','segments','session','Aborted.','relativePath','segment','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','143633cmprKl','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','green','\x20files\x20to\x20','Write\x20','description','hasChanges','error','\x20activations','execute','Site:\x20','\x20\x20🎯\x20','\x0aPull\x20summary\x20for\x20\x27','\x20=\x20','repeat','absolutePath','pullSegments','segment:pull','data','32jBCCcx','\x20journeys','\x20new\x20files','\x20segments','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','content','\x20\x20🗺️\x20\x20','\x0aChanges\x20to\x20\x27','filter','errorCode','site','✔\x20Context\x20set:\x20','dim','counts','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','message','red','verbose','Error:\x20','name','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'];a34_0xa749=function(){return _0x3cd2d6;};return a34_0xa749();}const a34_0x1547ad=a34_0x3242;(function(_0xdd188b,_0x51f2fa){const _0x464e3b=a34_0x3242,_0x4448f7=_0xdd188b();while(!![]){try{const _0x39bcc5=-parseInt(_0x464e3b(0x110))/0x1+-parseInt(_0x464e3b(0xeb))/0x2+-parseInt(_0x464e3b(0xe6))/0x3+-parseInt(_0x464e3b(0xf3))/0x4+-parseInt(_0x464e3b(0x102))/0x5+parseInt(_0x464e3b(0xec))/0x6*(-parseInt(_0x464e3b(0x100))/0x7)+-parseInt(_0x464e3b(0xd0))/0x8*(-parseInt(_0x464e3b(0x107))/0x9);if(_0x39bcc5===_0x51f2fa)break;else _0x4448f7['push'](_0x4448f7['shift']());}catch(_0x2b0d5a){_0x4448f7['push'](_0x4448f7['shift']());}}}(a34_0xa749,0xee87f));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a34_0xe6bdd4 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x1be48b 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{[a34_0x1547ad(0xe3)]=a34_0x1547ad(0xce);[a34_0x1547ad(0x115)]=a34_0x1547ad(0xe9);async[a34_0x1547ad(0x119)](_0x3796f3){const _0x124ad8=a34_0x1547ad,{options:_0x457e0d,args:_0x5cec9f,tdx:_0xa92ce0}=_0x3796f3,_0x35e385=_0x457e0d,_0x116429=await resolveTarget({'arg':_0x5cec9f[0x0],'contextParent':_0x457e0d['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x116429))return _0x116429[_0x124ad8(0xd9)]===_0x124ad8(0xe8)?(console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x105)](_0x124ad8(0xde))),console['error']('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x124ad8(0x111)),console[_0x124ad8(0x117)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a34_0xe6bdd4[_0x124ad8(0xe0)](_0x124ad8(0xe2)+_0x116429[_0x124ad8(0xdf)]+'\x0a')),_0x116429[_0x124ad8(0xf4)]&&console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0xf0)](_0x116429[_0x124ad8(0xf4)]))),0x1;const _0x508139=_0x116429[_0x124ad8(0x101)],_0x16353b=_0x116429['targetDir'],_0x18e23f=_0x116429['type']===_0x124ad8(0xee)?_0x116429[_0x124ad8(0xf1)]:undefined;_0x35e385[_0x124ad8(0xe1)]&&(console['error'](_0x124ad8(0x11a)+_0x35e385[_0x124ad8(0xda)]),console[_0x124ad8(0x117)](_0x124ad8(0xe5)+_0x508139),_0x18e23f&&console['error'](_0x124ad8(0xfd)+_0x18e23f));const _0x1c8e93=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x508139+_0x124ad8(0xfa),_0x27b0a7=>_0xa92ce0[_0x124ad8(0x10e)][_0x124ad8(0xcd)](_0x508139,{'targetDir':_0x16353b,'targetResourceName':_0x18e23f,'verbose':_0x35e385[_0x124ad8(0xe1)],'progress':{'update':_0xa388fb=>{const _0x282b9b=_0x124ad8;_0x27b0a7['setPhase'](_0xa388fb),_0x35e385[_0x282b9b(0xe1)]&&console[_0x282b9b(0x117)]('\x20\x20'+_0xa388fb);}}}),{'verbose':_0x35e385[_0x124ad8(0xe1)]}),_0x1b8aed=_0x1c8e93[_0x124ad8(0xcf)];if(_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0x10a)]===0x0&&_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xfc)]===0x0)return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x105)](_0x124ad8(0xe4)+_0x1b8aed[_0x124ad8(0x101)]+'\x27')),0x0;const _0x33765b=_0x1b8aed[_0x124ad8(0xfb)]['filter'](_0xc2c305=>_0xc2c305[_0x124ad8(0x104)]),_0x194112=_0x1b8aed[_0x124ad8(0xfb)][_0x124ad8(0xd8)](_0x1d1dc7=>!_0x1d1dc7[_0x124ad8(0x104)]&&_0x1d1dc7['hasChanges']),_0x123d15=_0x1b8aed[_0x124ad8(0xfb)][_0x124ad8(0xd8)](_0x1df1fd=>!_0x1df1fd[_0x124ad8(0x104)]&&!_0x1df1fd[_0x124ad8(0x116)]);console['error'](_0x124ad8(0xc9)+_0x1b8aed['parentName']+'\x27:'),console[_0x124ad8(0x117)](_0x124ad8(0x11b)+a34_0xe6bdd4['cyan'](_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0x10a)]+_0x124ad8(0xd3))+_0x124ad8(0xed)+a34_0xe6bdd4['cyan'](_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xef)]+_0x124ad8(0x118)));if(_0x1b8aed[_0x124ad8(0xdd)]['journeys']>0x0){const _0x524cc0=_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xf8)]>_0x1b8aed['counts']['journeys']?'\x20('+_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xf8)]+'\x20versions)':'';console['error'](_0x124ad8(0xd6)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0xdd)][_0x124ad8(0xfc)]+_0x124ad8(0xd1))+a34_0xe6bdd4[_0x124ad8(0xdc)](_0x524cc0));}console[_0x124ad8(0x117)]('\x20\x20'+a34_0xe6bdd4['green']('+\x20'+_0x33765b['length']+_0x124ad8(0xd2))),console[_0x124ad8(0x117)]('\x20\x20'+a34_0xe6bdd4[_0x124ad8(0x105)]('~\x20'+_0x194112[_0x124ad8(0xf9)]+_0x124ad8(0x103))),console['error']('\x20\x20'+a34_0xe6bdd4[_0x124ad8(0xdc)]('=\x20'+_0x123d15['length']+_0x124ad8(0x109))),console[_0x124ad8(0x117)](_0x124ad8(0xe7)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0xff)])+'\x0a');if(_0x194112[_0x124ad8(0xf9)]>0x0)for(const _0x4898ae of _0x194112){console[_0x124ad8(0x117)](_0x124ad8(0xd7)+_0x4898ae[_0x124ad8(0x10d)]+'\x27:'),console[_0x124ad8(0x117)]('─'[_0x124ad8(0xcb)](0x3c)),console[_0x124ad8(0x117)](_0x4898ae[_0x124ad8(0xf6)]),console[_0x124ad8(0x117)]('─'[_0x124ad8(0xcb)](0x3c));}if(_0x35e385[_0x124ad8(0xf7)])return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x105)](_0x124ad8(0xd4))),0x0;if(_0x33765b['length']===0x0&&_0x194112[_0x124ad8(0xf9)]===0x0)return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x112)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x1b8aed[_0x124ad8(0x101)]},_0x35e385[_0x124ad8(0x10b)]),console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0x112)](_0x124ad8(0xdb)+a34_0xe6bdd4[_0x124ad8(0xdc)](_0x124ad8(0x108))+_0x124ad8(0xca)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0x101)]))),0x0;if(!_0x35e385[_0x124ad8(0x106)]){if(!isInteractive())return console[_0x124ad8(0x117)](a34_0xe6bdd4[_0x124ad8(0xe0)](_0x124ad8(0xea)),_0x124ad8(0xf2)),console[_0x124ad8(0x117)](a34_0xe6bdd4['dim'](_0x124ad8(0x10f))),0x1;const _0x2a590f=await confirmKey(_0x124ad8(0x114)+(_0x33765b[_0x124ad8(0xf9)]+_0x194112['length'])+'\x20files?');if(!_0x2a590f)return console[_0x124ad8(0x117)](a34_0xe6bdd4['yellow'](_0x124ad8(0x10c)),'-\x20no\x20files\x20written'),0x1;}for(const _0x23c6da of _0x1b8aed[_0x124ad8(0xfb)]){if(_0x23c6da[_0x124ad8(0x104)]||_0x23c6da[_0x124ad8(0x116)]){const _0x14c2e6=a34_0x1be48b[_0x124ad8(0xf5)](_0x23c6da['absolutePath']);!existsSync(_0x14c2e6)&&mkdirSync(_0x14c2e6,{'recursive':!![]}),writeFileSync(_0x23c6da[_0x124ad8(0xcc)],_0x23c6da[_0x124ad8(0xd5)],'utf-8');}}return console['error'](a34_0xe6bdd4[_0x124ad8(0x112)](_0x124ad8(0xfe)+(_0x33765b['length']+_0x194112['length'])+_0x124ad8(0x113)+_0x1b8aed[_0x124ad8(0xff)])),saveSessionContext({'parent_segment':_0x1b8aed[_0x124ad8(0x101)]},_0x35e385[_0x124ad8(0x10b)]),console[_0x124ad8(0x117)](a34_0xe6bdd4['green'](_0x124ad8(0xdb)+a34_0xe6bdd4[_0x124ad8(0xdc)](_0x124ad8(0x108))+_0x124ad8(0xca)+a34_0xe6bdd4[_0x124ad8(0xf0)](_0x1b8aed[_0x124ad8(0x101)]))),0x0;}}
1
+ const a34_0x203a6f=a34_0x439c;(function(_0x38a094,_0x92ec04){const _0x52ce68=a34_0x439c,_0x58024e=_0x38a094();while(!![]){try{const _0x11ce1c=parseInt(_0x52ce68(0x1e2))/0x1*(parseInt(_0x52ce68(0x21d))/0x2)+parseInt(_0x52ce68(0x20a))/0x3+parseInt(_0x52ce68(0x1f3))/0x4*(-parseInt(_0x52ce68(0x1ee))/0x5)+parseInt(_0x52ce68(0x214))/0x6+parseInt(_0x52ce68(0x213))/0x7+parseInt(_0x52ce68(0x1d8))/0x8*(parseInt(_0x52ce68(0x20f))/0x9)+-parseInt(_0x52ce68(0x1fb))/0xa;if(_0x11ce1c===_0x92ec04)break;else _0x58024e['push'](_0x58024e['shift']());}catch(_0x9c3d33){_0x58024e['push'](_0x58024e['shift']());}}}(a34_0x5400,0x57ced));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a34_0x3814be from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a34_0x294708 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a34_0x439c(_0x33d3d3,_0x4c1ae1){_0x33d3d3=_0x33d3d3-0x1cd;const _0x540077=a34_0x5400();let _0x439c6d=_0x540077[_0x33d3d3];return _0x439c6d;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a34_0x203a6f(0x1e8)]=a34_0x203a6f(0x1ed);[a34_0x203a6f(0x1df)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a34_0x203a6f(0x1d4)](_0x3822bc){const _0xebd1af=a34_0x203a6f,{options:_0x1528bb,args:_0x9df9f4,tdx:_0x188f10}=_0x3822bc,_0x5ea12c=_0x1528bb,_0x4490ac=await resolveTarget({'arg':_0x9df9f4[0x0],'contextParent':_0x1528bb['parentSegment'],'cwd':process[_0xebd1af(0x1ea)]()});if(!isSuccessfulResolution(_0x4490ac))return _0x4490ac[_0xebd1af(0x1ec)]===_0xebd1af(0x1f8)?(console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1ef)](_0xebd1af(0x1e1))),console[_0xebd1af(0x206)](_0xebd1af(0x1f9)),console['error'](_0xebd1af(0x1da)),console['error'](_0xebd1af(0x201))):(console[_0xebd1af(0x206)](a34_0x3814be['red'](_0xebd1af(0x1dc)+_0x4490ac[_0xebd1af(0x1f2)]+'\x0a')),_0x4490ac['helpText']&&console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1cd)](_0x4490ac['helpText']))),0x1;const _0x2ba3db=_0x4490ac['parentName'],_0x2e3e0c=_0x4490ac[_0xebd1af(0x1e0)],_0x4148ca=_0x4490ac[_0xebd1af(0x1f5)]===_0xebd1af(0x1f7)?_0x4490ac[_0xebd1af(0x208)]:undefined;_0x5ea12c[_0xebd1af(0x1cf)]&&(console[_0xebd1af(0x206)]('Site:\x20'+_0x5ea12c[_0xebd1af(0x1db)]),console['error'](_0xebd1af(0x202)+_0x2ba3db),_0x4148ca&&console['error'](_0xebd1af(0x212)+_0x4148ca));const _0x1dcd2b=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x2ba3db+'\x27...',_0x366b6a=>_0x188f10[_0xebd1af(0x20e)][_0xebd1af(0x1e9)](_0x2ba3db,{'targetDir':_0x2e3e0c,'targetResourceName':_0x4148ca,'verbose':_0x5ea12c['verbose'],'progress':{'update':_0x1842a2=>{const _0x21ef74=_0xebd1af;_0x366b6a[_0x21ef74(0x1e5)](_0x1842a2),_0x5ea12c[_0x21ef74(0x1cf)]&&console['error']('\x20\x20'+_0x1842a2);}}}),{'verbose':_0x5ea12c[_0xebd1af(0x1cf)]}),_0x447869=_0x1dcd2b[_0xebd1af(0x219)];if(_0x447869['counts'][_0xebd1af(0x1e7)]===0x0&&_0x447869['counts'][_0xebd1af(0x200)]===0x0)return console['error'](a34_0x3814be[_0xebd1af(0x1ef)](_0xebd1af(0x211)+_0x447869['parentName']+'\x27')),0x0;const _0x47282b=_0x447869[_0xebd1af(0x1f4)][_0xebd1af(0x1f1)](_0x34c3aa=>_0x34c3aa[_0xebd1af(0x21c)]),_0x21e3e6=_0x447869['files'][_0xebd1af(0x1f1)](_0x146239=>!_0x146239['isNew']&&_0x146239['hasChanges']),_0x2cb31a=_0x447869['files']['filter'](_0x440ad1=>!_0x440ad1['isNew']&&!_0x440ad1[_0xebd1af(0x216)]);console[_0xebd1af(0x206)](_0xebd1af(0x1d1)+_0x447869[_0xebd1af(0x218)]+'\x27:'),console[_0xebd1af(0x206)](_0xebd1af(0x1d5)+a34_0x3814be[_0xebd1af(0x1cd)](_0x447869[_0xebd1af(0x20d)][_0xebd1af(0x1e7)]+_0xebd1af(0x1fc))+'\x20with\x20'+a34_0x3814be[_0xebd1af(0x1cd)](_0x447869[_0xebd1af(0x20d)][_0xebd1af(0x205)]+_0xebd1af(0x207)));if(_0x447869['counts']['journeys']>0x0){const _0x25d32f=_0x447869['counts'][_0xebd1af(0x1de)]>_0x447869[_0xebd1af(0x20d)][_0xebd1af(0x200)]?'\x20('+_0x447869[_0xebd1af(0x20d)][_0xebd1af(0x1de)]+_0xebd1af(0x21a):'';console[_0xebd1af(0x206)](_0xebd1af(0x1e6)+a34_0x3814be[_0xebd1af(0x1cd)](_0x447869[_0xebd1af(0x20d)]['journeys']+_0xebd1af(0x1eb))+a34_0x3814be['dim'](_0x25d32f));}console['error']('\x20\x20'+a34_0x3814be[_0xebd1af(0x1d3)]('+\x20'+_0x47282b[_0xebd1af(0x204)]+'\x20new\x20files')),console['error']('\x20\x20'+a34_0x3814be[_0xebd1af(0x1ef)]('~\x20'+_0x21e3e6[_0xebd1af(0x204)]+_0xebd1af(0x1ff))),console[_0xebd1af(0x206)]('\x20\x20'+a34_0x3814be[_0xebd1af(0x1d2)]('=\x20'+_0x2cb31a[_0xebd1af(0x204)]+_0xebd1af(0x1d7))),console[_0xebd1af(0x206)]('\x20\x20Target:\x20'+a34_0x3814be['cyan'](_0x447869['targetDir'])+'\x0a');if(_0x21e3e6[_0xebd1af(0x204)]>0x0)for(const _0x63a8 of _0x21e3e6){console[_0xebd1af(0x206)](_0xebd1af(0x1d6)+_0x63a8[_0xebd1af(0x21b)]+'\x27:'),console[_0xebd1af(0x206)]('─'['repeat'](0x3c)),console[_0xebd1af(0x206)](_0x63a8[_0xebd1af(0x1f0)]),console['error']('─'['repeat'](0x3c));}if(_0x5ea12c[_0xebd1af(0x210)])return console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1ef)](_0xebd1af(0x217))),0x0;if(_0x47282b[_0xebd1af(0x204)]===0x0&&_0x21e3e6[_0xebd1af(0x204)]===0x0)return console[_0xebd1af(0x206)](a34_0x3814be['green'](_0xebd1af(0x215))),saveSessionContext({'parent_segment':_0x447869['parentName']},_0x5ea12c[_0xebd1af(0x20b)]),console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1d3)](_0xebd1af(0x1d9)+a34_0x3814be[_0xebd1af(0x1d2)](_0xebd1af(0x209))+'\x20=\x20'+a34_0x3814be[_0xebd1af(0x1cd)](_0x447869[_0xebd1af(0x218)]))),0x0;if(!_0x5ea12c[_0xebd1af(0x203)]){if(!isInteractive())return console['error'](a34_0x3814be[_0xebd1af(0x20c)](_0xebd1af(0x1f6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1d2)](_0xebd1af(0x1fa))),0x1;const _0x5ca9c5=await confirmKey(_0xebd1af(0x1e4)+(_0x47282b[_0xebd1af(0x204)]+_0x21e3e6[_0xebd1af(0x204)])+_0xebd1af(0x1ce));if(!_0x5ca9c5)return console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1ef)](_0xebd1af(0x1e3)),'-\x20no\x20files\x20written'),0x1;}for(const _0x46d13f of _0x447869[_0xebd1af(0x1f4)]){if(_0x46d13f[_0xebd1af(0x21c)]||_0x46d13f[_0xebd1af(0x216)]){const _0x413115=a34_0x294708[_0xebd1af(0x1fd)](_0x46d13f[_0xebd1af(0x1d0)]);!existsSync(_0x413115)&&mkdirSync(_0x413115,{'recursive':!![]}),writeFileSync(_0x46d13f[_0xebd1af(0x1d0)],_0x46d13f[_0xebd1af(0x1dd)],'utf-8');}}return console[_0xebd1af(0x206)](a34_0x3814be[_0xebd1af(0x1d3)]('✔\x20Pulled\x20'+(_0x47282b['length']+_0x21e3e6[_0xebd1af(0x204)])+'\x20files\x20to\x20'+_0x447869[_0xebd1af(0x1e0)])),saveSessionContext({'parent_segment':_0x447869[_0xebd1af(0x218)]},_0x5ea12c[_0xebd1af(0x20b)]),console[_0xebd1af(0x206)](a34_0x3814be['green']('✔\x20Context\x20set:\x20'+a34_0x3814be['dim'](_0xebd1af(0x209))+_0xebd1af(0x1fe)+a34_0x3814be['cyan'](_0x447869[_0xebd1af(0x218)]))),0x0;}}function a34_0x5400(){const _0x4ef512=['\x20segments','dirname','\x20=\x20','\x20changed\x20files','journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Parent\x20segment:\x20','yes','length','activations','error','\x20activations','resourceName','parent_segment','2086425mjLTIS','session','red','counts','segment','4300983hBbJrj','dryRun','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Target\x20resource:\x20','1448867VOdvgJ','3510426phMBXx','✔\x20All\x20files\x20are\x20up\x20to\x20date','hasChanges','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','parentName','data','\x20versions)','relativePath','isNew','16PrAFZy','cyan','\x20files?','verbose','absolutePath','\x0aPull\x20summary\x20for\x20\x27','dim','green','execute','\x20\x20🎯\x20','\x0aChanges\x20to\x20\x27','\x20unchanged\x20files','8aHYkEQ','✔\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','site','Error:\x20','content','journeyVersions','description','targetDir','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','77555LrCqQP','Aborted.','Write\x20','setPhase','\x20\x20🗺️\x20\x20','segments','name','pullSegments','cwd','\x20journeys','errorCode','segment:pull','475015ftyjsB','yellow','diff','filter','message','4kCdztL','files','type','\x0aError:','file','no_parent','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)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','21311900LUUXPD'];a34_0x5400=function(){return _0x4ef512;};return a34_0x5400();}
@@ -1 +1 @@
1
- const a35_0xbc02cc=a35_0x4411;(function(_0x42d631,_0x15bee6){const _0x10c9df=a35_0x4411,_0x372312=_0x42d631();while(!![]){try{const _0x2dc407=parseInt(_0x10c9df(0xc9))/0x1+-parseInt(_0x10c9df(0xcd))/0x2+-parseInt(_0x10c9df(0xee))/0x3*(parseInt(_0x10c9df(0x118))/0x4)+parseInt(_0x10c9df(0xae))/0x5+parseInt(_0x10c9df(0xce))/0x6+parseInt(_0x10c9df(0x10b))/0x7*(-parseInt(_0x10c9df(0xc5))/0x8)+parseInt(_0x10c9df(0xb6))/0x9*(parseInt(_0x10c9df(0x12f))/0xa);if(_0x2dc407===_0x15bee6)break;else _0x372312['push'](_0x372312['shift']());}catch(_0x5a7d43){_0x372312['push'](_0x372312['shift']());}}}(a35_0x538b,0x3a321));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a35_0x538b(){const _0x28a624=['yes','journeysOnly','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','45qyUGvU','\x20\x20📊\x20Segments:','changed','\x20unchanged','yamlConfig','\x0a✔\x20Push\x20complete','scopedFolderPath','\x0aError:','cyan','getOutputSchemaWithCache','state','green','unchanged','Delete\x20journey:','set','224FkEaup','folderId','dryRun','.yml','117602hriewO','parentSegment','all','updated','556328XcEGtt','1436064kjltqO','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20🗺️\x20\x20Journeys:','repeat','Fetching\x20existing\x20data...','activations','/j/da/je','toString','message','toCreate','parentName','Changes\x20to:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20to\x20create','length','existingJourney','📁\x20','\x20activations]','folderPath','blue','file','New\x20segment:','\x20\x20Activations:','map','segmentFolderId','journey','filter','New\x20journey:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','attributes','type','journeys','6sEAbsx','new','data','nameToId','listFolders','journeyId','\x20created','red','segment\x20or\x20journey','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','/e/','push','isNew','journeyBundleName','journeyBundleId','parent_name','dim','error','segments','join','folders','\x20changed','versionNumber','Resolving\x20parent\x20segment\x20\x27','created','then','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','listJourneysWithDetailsFromParentSegment','58317DpElXI','listActivations','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Changes\x20to\x20journey:','setPhase','toUpdate','connection','\x20new','errorCode','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20\x20\x20\x20','getJourney','232780LTONkQ','(Journey\x20will\x20be\x20deleted)','description','Push\x20','\x20updated','delete','execute','Fetching\x20connections\x20for\x20name\x20resolution...','Error:\x20Directory\x20not\x20found:\x20','parentFolder','Aborted.','\x20folders\x20to\x20create','Error\x20parsing\x20YAML:\x20','getParent','results','Error:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','segment','\x0aValidation\x20failed:','yellow','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','site','\x20changes?','175150YslQCW','Folders\x20to\x20create:','diff','verbose','\x20deleted','user','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','get','segment:push','targetDir','endsWith','\x20\x20Journeys:\x20','name','Source\x20directory:\x20','relationships','idToName','\x20\x20Source:\x20','\x20to\x20delete','Scoped\x20to\x20folder:\x20','deleted','2108350zAqiOl','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','no_parent','toDelete','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files'];a35_0x538b=function(){return _0x28a624;};return a35_0x538b();}import{confirmKey,isInteractive}from'../utils/prompt.js';function a35_0x4411(_0xc6a784,_0x18521d){_0xc6a784=_0xc6a784-0xac;const _0x538b1a=a35_0x538b();let _0x441197=_0x538b1a[_0xc6a784];return _0x441197;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a35_0x49a32b from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a35_0xbc02cc(0x13b)]=a35_0xbc02cc(0x137);[a35_0xbc02cc(0x11a)]=a35_0xbc02cc(0x115);async[a35_0xbc02cc(0x11e)](_0x4fe48){const _0x2028eb=a35_0xbc02cc,{options:_0x38363f,args:_0x1c107d,tdx:_0x2de074}=_0x4fe48,_0x2ceab2=_0x38363f,_0x4df4ef=await resolveTarget({'arg':_0x1c107d[0x0],'contextParent':_0x38363f[_0x2028eb(0xca)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4df4ef))return _0x4df4ef[_0x2028eb(0x113)]===_0x2028eb(0xb0)?(console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('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[_0x2028eb(0x100)](_0x2028eb(0xf8)),console[_0x2028eb(0x100)](_0x2028eb(0x114))):(console[_0x2028eb(0x100)](a35_0x49a32b['red'](_0x2028eb(0x127)+_0x4df4ef['message']+'\x0a')),_0x4df4ef['helpText']&&console['error'](a35_0x49a32b[_0x2028eb(0xbe)](_0x4df4ef['helpText']))),0x1;if(_0x4df4ef[_0x2028eb(0xec)]===_0x2028eb(0xfe))return console['error'](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x120)+_0x4df4ef['targetDir']+'\x0a')),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xbe)](_0x2028eb(0xcf))),0x1;const _0x55bbda=_0x4df4ef[_0x2028eb(0xd8)],_0x4cc21a=_0x4df4ef[_0x2028eb(0x138)],_0x3a85dd=_0x4df4ef[_0x2028eb(0xec)]===_0x2028eb(0xe2)?_0x4df4ef['filePath']:undefined,_0x2cbd4a=getScopedDetails(_0x4df4ef),_0x2e5bd9=_0x2cbd4a?.['isScoped']??![],_0x39660e=_0x2cbd4a?.[_0x2028eb(0xbc)]??'';if(!existsSync(_0x4cc21a))return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x120)+_0x4cc21a+'\x0a')),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xbe)](_0x2028eb(0xcf))),0x1;_0x2ceab2[_0x2028eb(0x132)]&&(console[_0x2028eb(0x100)]('Site:\x20'+_0x2ceab2[_0x2028eb(0x12d)]),console[_0x2028eb(0x100)](_0x2028eb(0xf7)+_0x55bbda),console['error'](_0x2028eb(0x13c)+_0x4cc21a),_0x2e5bd9&&console[_0x2028eb(0x100)](_0x2028eb(0xac)+_0x39660e));const _0x235bd3=await withSpinner(_0x2028eb(0x106)+_0x55bbda+'\x27...',()=>_0x2de074[_0x2028eb(0x129)]['resolveParentId'](_0x55bbda),{'verbose':_0x2ceab2[_0x2028eb(0x132)]}),_0x122245=_0x235bd3[_0x2028eb(0xf0)],{parentSegmentResult:_0x52426a,segmentsResult:_0x48bfd7,foldersResult:_0x2773e5,journeysWithDetailsResult:_0x169d0c,userMaps:_0x2dc2d}=await withSpinner(_0x2028eb(0xd2),async()=>{const _0x2699d6=_0x2028eb,[_0x2c7b81,_0x2ce8e7,_0xefa78c,_0x3f339a,_0x25152c]=await Promise[_0x2699d6(0xcb)]([_0x2de074['segment'][_0x2699d6(0x125)](_0x122245),_0x2de074[_0x2699d6(0x129)]['listSegments'](_0x122245),_0x2de074[_0x2699d6(0x129)][_0x2699d6(0xf2)](_0x122245),_0x2de074[_0x2699d6(0xe7)][_0x2699d6(0x10a)](_0x122245,{'includeAllVersions':!![]}),_0x2de074[_0x2699d6(0x134)]['buildUserMaps']()]);return{'parentSegmentResult':_0x2c7b81,'segmentsResult':_0x2ce8e7,'foldersResult':_0xefa78c,'journeysWithDetailsResult':_0x3f339a,'userMaps':_0x25152c};},{'verbose':_0x2ceab2['verbose']})[_0x2028eb(0x108)](_0x2f1be1=>_0x2f1be1['data']),_0x3e4254=_0x52426a,_0x3daec3=extractRootFolderId(_0x3e4254),_0x37e410=_0x48bfd7,_0x2e7198=_0x2773e5,{journeys:_0x3885f6,activationStepsById:_0x50d112}=_0x169d0c,_0x2a3628=new Map(_0x3885f6[_0x2028eb(0xe5)](_0x38d86d=>[_0x38d86d['id'],_0x38d86d])),_0x357b49=_0x3885f6['map'](_0x32657c=>({'id':_0x32657c['id'],'name':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0x13b)],'journeyBundleName':_0x32657c[_0x2028eb(0xeb)]['journeyBundleName']||'','journeyBundleId':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0xfd)]||'','versionNumber':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0x105)],'description':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0x11a)],'state':_0x32657c[_0x2028eb(0xeb)][_0x2028eb(0xc0)],'paused':_0x32657c[_0x2028eb(0xeb)]['paused'],'audienceId':_0x32657c['attributes']['audienceId'],'folderId':_0x32657c[_0x2028eb(0x13d)]?.[_0x2028eb(0x121)]?.[_0x2028eb(0xf0)]?.['id'],'createdAt':_0x32657c[_0x2028eb(0xeb)]['createdAt'],'updatedAt':_0x32657c[_0x2028eb(0xeb)]['updatedAt']})),{emailToId:_0x4a10e3,idToEmail:_0x180aee}=_0x2dc2d,_0x7dce52=await withSpinner(_0x2028eb(0x11f),async()=>{const _0x4a4031=_0x2028eb,_0x1e3a88=await _0x2de074[_0x4a4031(0x111)]['list']();return buildConnectionMaps(_0x1e3a88);},{'verbose':_0x2ceab2['verbose']})[_0x2028eb(0x108)](_0x572db6=>_0x572db6[_0x2028eb(0xf0)]),_0xa0cd6=_0x7dce52['nameToId'],_0x1f099a=_0x7dce52[_0x2028eb(0x13e)],_0x5d9205=_0x7dce52['nameToType'],_0x30f224={'emailToIdMap':_0x4a10e3,'connectionNameToIdMap':_0xa0cd6,'connectionNameToTypeMap':_0x5d9205,'getSchema':_0x102cb2=>_0x2de074['connection'][_0x2028eb(0xbf)](_0x102cb2)};let {pathToId:_0x354b5c,idToPath:_0x54b16d}=buildFolderMaps(_0x2e7198);const _0x1e19bf=buildSegmentLookupMap(_0x37e410,_0x54b16d),_0x44e1b5=buildSegmentNameToIdMap(_0x37e410),_0x3e23e2=buildJourneyBundleLookupMap(_0x357b49,_0x54b16d);let _0x188475;if(_0x3a85dd){if(!_0x3a85dd['endsWith'](_0x2028eb(0xc8))&&!_0x3a85dd[_0x2028eb(0x139)]('.yaml'))return console['error'](a35_0x49a32b['red'](_0x2028eb(0xea)+_0x3a85dd+'\x0a')),0x1;_0x188475=[_0x3a85dd];}else _0x188475=findYamlFiles(_0x4cc21a);if(_0x188475[_0x2028eb(0xdc)]===0x0)return console[_0x2028eb(0x100)](a35_0x49a32b['red'](_0x2028eb(0xb5)+_0x4cc21a+'\x0a')),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xbe)](_0x2028eb(0xb2))),0x1;let _0x5266f8,_0x12b8f1;try{const _0xba8c8e=parseAndClassifyYamlFiles(_0x188475,_0x4cc21a,{'skipSegments':_0x2ceab2[_0x2028eb(0xb4)]});_0x5266f8=_0xba8c8e['segments'],_0x12b8f1=_0xba8c8e['journeys'];const _0xd1beb5=validateParsedFiles(_0xba8c8e,_0x4cc21a);if(_0xd1beb5[_0x2028eb(0xdc)]>0x0)return console[_0x2028eb(0x100)](a35_0x49a32b['red'](_0x2028eb(0x12a))),console[_0x2028eb(0x100)](formatValidationErrors(_0xd1beb5)),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0x109))),0x1;}catch(_0x47b897){return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x124)+(_0x47b897 instanceof Error?_0x47b897[_0x2028eb(0xd6)]:_0x47b897))),0x1;}if(_0x5266f8[_0x2028eb(0xdc)]===0x0&&_0x12b8f1[_0x2028eb(0xdc)]===0x0){const _0xf54ee5=_0x2ceab2[_0x2028eb(0xb4)]?_0x2028eb(0xe7):_0x2028eb(0xf6);return console['error'](a35_0x49a32b[_0x2028eb(0x12b)]('No\x20'+_0xf54ee5+'\x20YAML\x20files\x20found')),0x0;}const _0x3a87b0=new Map();_0x37e410['length']>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x37e410,async _0x2b3595=>{const _0x3c0b46=a35_0x4411,_0x11079f=await _0x2de074[_0x3c0b46(0x129)][_0x3c0b46(0x10c)](_0x122245,_0x2b3595['id']);_0x3a87b0[_0x3c0b46(0xc4)](_0x2b3595['id'],_0x11079f);});},{'verbose':_0x2ceab2[_0x2028eb(0x132)]});const {segmentFiles:_0x5b2276,foldersToCreate:_0x38fecc}=await prepareSegmentFiles(_0x5266f8,{'segmentByFolderAndName':_0x1e19bf,'activationsBySegmentId':_0x3a87b0,'folderPathToId':_0x354b5c,'idToEmailMap':_0x180aee,'connectionIdToNameMap':_0x1f099a},_0x30f224,_0x2e5bd9,_0x39660e),_0x31ffe1=_0x3a85dd?[]:findSegmentsToDelete(_0x37e410,_0x5266f8[_0x2028eb(0xe5)](({yamlConfig:_0x143e7e,folderPath:_0x5aaf75})=>({'yamlConfig':_0x143e7e,'folderPath':resolveTDFolderPath(_0x5aaf75,_0x2e5bd9,_0x39660e)})),_0x54b16d,_0x39660e,_0x2e5bd9),{journeyFiles:_0xebdd7a,foldersToCreate:_0x141d45}=await withProgressSpinner('Preparing\x20journeys...',async _0x596258=>prepareJourneyFiles(_0x12b8f1,{'fetchJourney':async _0x1c3d9d=>_0x2de074[_0x2028eb(0xe7)][_0x2028eb(0x117)](_0x1c3d9d[_0x2028eb(0xf3)]),'journeyBundlesByFolderAndName':_0x3e23e2,'folderPathToId':_0x354b5c,'idToEmailMap':_0x180aee,'connectionIdToNameMap':_0x1f099a,'existingSegments':_0x37e410,'parentId':_0x122245,'deps':_0x2de074,'progress':{'update':_0x10a640=>{const _0x277cba=_0x2028eb;_0x596258[_0x277cba(0x10f)](_0x10a640),_0x2ceab2[_0x277cba(0x132)]&&console['error']('\x20\x20'+_0x10a640);}},'journeyById':_0x2a3628,'activationStepsById':_0x50d112},_0x2e5bd9,_0x39660e),{'verbose':_0x2ceab2[_0x2028eb(0x132)]})[_0x2028eb(0x108)](_0x256d75=>_0x256d75['data']);for(const _0x39819e of _0x141d45){_0x38fecc['add'](_0x39819e);}const _0x505b82=_0x3a85dd?[]:findJourneysToDelete(_0x357b49,_0x12b8f1['map'](({yamlConfig:_0x2be74d,folderPath:_0x43f773})=>({'yamlConfig':_0x2be74d,'folderPath':resolveTDFolderPath(_0x43f773,_0x2e5bd9,_0x39660e)})),_0x54b16d,_0x39660e,_0x2e5bd9),_0x55dc0c=calculatePushStats(_0x5b2276,_0xebdd7a,_0x38fecc,_0x31ffe1,_0x505b82,!!_0x2ceab2[_0x2028eb(0x11d)],!!_0x2ceab2[_0x2028eb(0xb4)]),_0x1c8d8a=_0x55dc0c[_0x2028eb(0x101)][_0x2028eb(0xef)],_0x3628ac=_0x55dc0c[_0x2028eb(0x101)][_0x2028eb(0xb8)],_0xef851a=_0x55dc0c[_0x2028eb(0x101)]['unchanged'],_0x42af08=_0x55dc0c[_0x2028eb(0x101)][_0x2028eb(0xb1)],_0x16ace4=_0x55dc0c[_0x2028eb(0x103)]['toCreate'],_0x486fd6=_0x55dc0c[_0x2028eb(0xed)][_0x2028eb(0xef)],_0x10424b=_0x55dc0c[_0x2028eb(0xed)]['changed'],_0x5773c6=_0x55dc0c[_0x2028eb(0xed)][_0x2028eb(0xc2)],_0x398c59=_0x55dc0c[_0x2028eb(0xed)][_0x2028eb(0xb1)],_0x5aa7dc=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0xcb)],_0x355513=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0xd7)],_0x5911b4=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0x110)],_0xaa96eb=_0x55dc0c[_0x2028eb(0xd3)][_0x2028eb(0xb1)];console[_0x2028eb(0x100)]('\x0aPush\x20summary\x20for\x20\x27'+_0x55bbda+'\x27:');_0x16ace4[_0x2028eb(0xdc)]>0x0&&console['error']('\x20\x20'+a35_0x49a32b[_0x2028eb(0xe1)](_0x2028eb(0xde)+_0x16ace4['length']+_0x2028eb(0x123)));if(!_0x2ceab2[_0x2028eb(0xb4)]){console[_0x2028eb(0x100)](_0x2028eb(0xb7)),console[_0x2028eb(0x100)]('\x20\x20\x20\x20'+a35_0x49a32b[_0x2028eb(0xc1)]('+\x20'+_0x1c8d8a['length']+_0x2028eb(0x112))),console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0x12b)]('~\x20'+_0x3628ac[_0x2028eb(0xdc)]+'\x20changed'));if(_0x42af08[_0x2028eb(0xdc)]>0x0)console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xf5)]('-\x20'+_0x42af08[_0x2028eb(0xdc)]+_0x2028eb(0x140)));else _0x31ffe1[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0x11d)]&&console[_0x2028eb(0x100)]('\x20\x20\x20\x20'+a35_0x49a32b[_0x2028eb(0xff)](_0x31ffe1[_0x2028eb(0xdc)]+_0x2028eb(0x10d)));console['error'](_0x2028eb(0x116)+a35_0x49a32b['dim']('=\x20'+_0xef851a['length']+'\x20unchanged'));}if(_0xebdd7a[_0x2028eb(0xdc)]>0x0||_0x505b82[_0x2028eb(0xdc)]>0x0){console[_0x2028eb(0x100)](_0x2028eb(0xd0)),console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xc1)]('+\x20'+_0x486fd6[_0x2028eb(0xdc)]+_0x2028eb(0x112))),console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b['yellow']('~\x20'+_0x10424b[_0x2028eb(0xdc)]+_0x2028eb(0x104)));if(_0x398c59[_0x2028eb(0xdc)]>0x0)console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xf5)]('-\x20'+_0x398c59['length']+_0x2028eb(0x140)));else _0x505b82[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0x11d)]&&console['error'](_0x2028eb(0x116)+a35_0x49a32b['dim'](_0x505b82[_0x2028eb(0xdc)]+_0x2028eb(0x10d)));console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xff)]('=\x20'+_0x5773c6[_0x2028eb(0xdc)]+_0x2028eb(0xb9)));}_0x5aa7dc[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&(console[_0x2028eb(0x100)](''),console[_0x2028eb(0x100)](_0x2028eb(0xe4)),_0x355513['length']>0x0&&console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xc1)]('+\x20'+_0x355513[_0x2028eb(0xdc)]+_0x2028eb(0xdb))),_0x5911b4['length']>0x0&&console['error'](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0x12b)]('~\x20'+_0x5911b4[_0x2028eb(0xdc)]+'\x20to\x20update')),_0xaa96eb[_0x2028eb(0xdc)]>0x0&&console[_0x2028eb(0x100)](_0x2028eb(0x116)+a35_0x49a32b[_0x2028eb(0xf5)]('-\x20'+_0xaa96eb[_0x2028eb(0xdc)]+_0x2028eb(0x140))));console[_0x2028eb(0x100)](_0x2028eb(0x13f)+a35_0x49a32b[_0x2028eb(0xbe)](_0x4cc21a)+'\x0a');if(_0x16ace4[_0x2028eb(0xdc)]>0x0){console[_0x2028eb(0x100)](_0x2028eb(0x130));for(const _0x77fba7 of _0x16ace4){console[_0x2028eb(0x100)]('\x20\x20'+a35_0x49a32b[_0x2028eb(0xe1)]('+')+'\x20'+_0x77fba7);}console[_0x2028eb(0x100)]('');}if(_0x1c8d8a[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)])for(const _0x28b13a of _0x1c8d8a){const _0x2c629b=_0x28b13a[_0x2028eb(0xe0)]?_0x28b13a[_0x2028eb(0xe0)]+'/'+_0x28b13a[_0x2028eb(0xba)]['name']:_0x28b13a['yamlConfig'][_0x2028eb(0x13b)],_0x37b3fa=_0x28b13a['yamlConfig'][_0x2028eb(0xd3)]?.[_0x2028eb(0xdc)]||0x0,_0x3a7744=_0x37b3fa>0x0?a35_0x49a32b[_0x2028eb(0xff)]('\x20['+_0x37b3fa+'\x20activations]'):'';console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b['green'](_0x2028eb(0xe3))+'\x20'+_0x2c629b+_0x3a7744),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c)),_0x28b13a[_0x2028eb(0x131)]&&console[_0x2028eb(0x100)](_0x28b13a['diff']),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}if(_0x42af08['length']>0x0&&!_0x2ceab2[_0x2028eb(0xb4)])for(const _0x109a13 of _0x42af08){const _0xe2b25d=_0x109a13[_0x2028eb(0xe6)]?_0x54b16d[_0x2028eb(0x136)](_0x109a13[_0x2028eb(0xe6)][_0x2028eb(0xd5)]())||'':'',_0x3310fb=_0xe2b25d?_0xe2b25d+'/'+_0x109a13[_0x2028eb(0x13b)]:_0x109a13[_0x2028eb(0x13b)],_0x26e899=_0x3a87b0['get'](_0x109a13['id'])||[],_0x4e67b8=_0x26e899['length']>0x0?a35_0x49a32b['dim']('\x20['+_0x26e899[_0x2028eb(0xdc)]+_0x2028eb(0xdf)):'';console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b[_0x2028eb(0xf5)]('Delete\x20segment:')+'\x20'+_0x3310fb+_0x4e67b8),console['error']('─'[_0x2028eb(0xd1)](0x3c));const _0x3d1660=segmentWithActivationsToYaml(_0x109a13,_0x26e899,undefined,_0x180aee,_0x1f099a),_0x241a04=segmentToYamlString(_0x3d1660),_0x289689=generateDiff(_0x241a04,'');console[_0x2028eb(0x100)](formatDiffWithColors(_0x289689)),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}const _0x4d2677=_0x5b2276[_0x2028eb(0xe8)](_0x2cee2f=>!_0x2cee2f[_0x2028eb(0xfb)]&&_0x2cee2f[_0x2028eb(0x131)]);if(_0x4d2677[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)])for(const _0x2cad70 of _0x4d2677){const _0x24c521=_0x2cad70[_0x2028eb(0xe0)]?_0x2cad70[_0x2028eb(0xe0)]+'/'+_0x2cad70[_0x2028eb(0xba)][_0x2028eb(0x13b)]:_0x2cad70[_0x2028eb(0xba)][_0x2028eb(0x13b)];console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0xd9))+'\x20'+_0x24c521),console[_0x2028eb(0x100)]('─'['repeat'](0x3c)),console['error'](_0x2cad70[_0x2028eb(0x131)]),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}if(_0x486fd6[_0x2028eb(0xdc)]>0x0)for(const _0x10c276 of _0x486fd6){const _0x3e4db7=_0x10c276[_0x2028eb(0xe0)]?_0x10c276[_0x2028eb(0xe0)]+'/'+_0x10c276[_0x2028eb(0xba)]['name']:_0x10c276[_0x2028eb(0xba)]['name'];console[_0x2028eb(0x100)]('\x0a'+a35_0x49a32b[_0x2028eb(0xc1)](_0x2028eb(0xe9))+'\x20'+_0x3e4db7),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c)),_0x10c276[_0x2028eb(0x131)]&&console[_0x2028eb(0x100)](_0x10c276['diff']),console['error']('─'['repeat'](0x3c));}const _0x5a743a=_0xebdd7a['filter'](_0x4963f9=>!_0x4963f9[_0x2028eb(0xfb)]&&_0x4963f9[_0x2028eb(0x131)]);if(_0x5a743a[_0x2028eb(0xdc)]>0x0)for(const _0x326a95 of _0x5a743a){const _0xd23177=_0x326a95['folderPath']?_0x326a95['folderPath']+'/'+_0x326a95[_0x2028eb(0xba)][_0x2028eb(0x13b)]:_0x326a95['yamlConfig']['name'];console['error']('\x0a'+a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0x10e))+'\x20'+_0xd23177),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c)),console['error'](_0x326a95[_0x2028eb(0x131)]),console['error']('─'[_0x2028eb(0xd1)](0x3c));}if(_0x398c59[_0x2028eb(0xdc)]>0x0)for(const _0x3caf28 of _0x398c59){const _0x3bea47=_0x3caf28[_0x2028eb(0xc6)]?_0x54b16d['get'](_0x3caf28[_0x2028eb(0xc6)])||'':'',_0x55903d=_0x3bea47?_0x3bea47+'/'+_0x3caf28[_0x2028eb(0xfc)]:_0x3caf28['journeyBundleName'];console['error']('\x0a'+a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0xc3))+'\x20'+_0x55903d),console['error']('─'[_0x2028eb(0xd1)](0x3c)),console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0x119))),console[_0x2028eb(0x100)]('─'[_0x2028eb(0xd1)](0x3c));}if(_0x2ceab2[_0x2028eb(0xc7)])return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0xaf))),0x0;const _0x92f17b=_0x2ceab2['journeysOnly']?![]:_0x1c8d8a[_0x2028eb(0xdc)]>0x0||_0x3628ac[_0x2028eb(0xdc)]>0x0||_0x42af08[_0x2028eb(0xdc)]>0x0,_0x2a641f=_0x486fd6[_0x2028eb(0xdc)]>0x0||_0x10424b[_0x2028eb(0xdc)]>0x0||_0x398c59[_0x2028eb(0xdc)]>0x0,_0x30b27d=_0x2ceab2['journeysOnly']?![]:_0x5aa7dc[_0x2028eb(0xdc)]>0x0,_0x5cbedc=_0x16ace4[_0x2028eb(0xdc)]>0x0;if(!_0x92f17b&&!_0x2a641f&&!_0x30b27d&&!_0x5cbedc){const _0x25229c=_0x2ceab2[_0x2028eb(0xb4)]?_0x2028eb(0x135):_0x2028eb(0x12c);console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xc1)](_0x25229c));if(_0x3a85dd&&_0x5773c6[_0x2028eb(0xdc)]===0x1){const _0x10fcda=_0x5773c6[0x0];if(_0x10fcda[_0x2028eb(0xdd)]?.['id']){const _0x6f6bb3=getConsoleNextUrl(_0x2ceab2['site'],'/app/ps/'+_0x122245+_0x2028eb(0xf9)+_0x10fcda[_0x2028eb(0xdd)]['id']+_0x2028eb(0xd4));console[_0x2028eb(0x100)]('\x20\x20'+a35_0x49a32b[_0x2028eb(0xbe)](_0x6f6bb3));}}return 0x0;}const _0x5a4c85=_0x2ceab2[_0x2028eb(0xb4)]?_0x486fd6['length']+_0x10424b[_0x2028eb(0xdc)]+_0x398c59[_0x2028eb(0xdc)]+_0x16ace4[_0x2028eb(0xdc)]:_0x1c8d8a[_0x2028eb(0xdc)]+_0x3628ac[_0x2028eb(0xdc)]+_0x42af08['length']+_0x486fd6[_0x2028eb(0xdc)]+_0x10424b[_0x2028eb(0xdc)]+_0x398c59[_0x2028eb(0xdc)]+_0x16ace4['length']+_0x5aa7dc[_0x2028eb(0xdc)];if(!_0x2ceab2[_0x2028eb(0xb3)]&&_0x5a4c85>0x0){if(!isInteractive())return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)](_0x2028eb(0xbd)),_0x2028eb(0x128)),console['error'](a35_0x49a32b[_0x2028eb(0xff)](_0x2028eb(0xda))),0x1;const _0x32579e=await confirmKey(_0x2028eb(0x11b)+_0x5a4c85+_0x2028eb(0x12e));if(!_0x32579e)return console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)](_0x2028eb(0x122))),0x1;}const _0x29c36f={'withProgress':async(_0x594662,_0x448768)=>{const _0x1c69c7=_0x2028eb,_0x400d51=await withSpinner(_0x594662,_0x448768,{'verbose':_0x2ceab2[_0x1c69c7(0x132)]});return{'data':_0x400d51[_0x1c69c7(0xf0)]};},'logInfo':_0x79741c=>console[_0x2028eb(0x100)](a35_0x49a32b['blue']('✔\x20'+_0x79741c)),'logSuccess':_0x2f1257=>console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xc1)]('✔\x20'+_0x2f1257)),'logWarning':_0x1aee50=>console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)]('⚠\x20'+_0x1aee50)),'logDeleted':_0x22fb51=>console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0xf5)]('✔\x20'+_0x22fb51))},_0x31f47b={'segment':_0x2de074[_0x2028eb(0x129)],'journey':_0x2de074['journey'],'user':_0x2de074[_0x2028eb(0x134)],'connection':_0x2de074['connection']};_0x16ace4[_0x2028eb(0xdc)]>0x0&&(_0x354b5c=await executePushFolders(_0x31f47b,_0x16ace4,_0x354b5c,{'parentId':_0x122245},_0x29c36f));const _0x2c96eb={'rootFolderId':_0x3daec3,'folderPathToId':_0x354b5c,'folderIdToPath':_0x54b16d,'segmentNameToId':_0x44e1b5,'activationsBySegmentId':_0x3a87b0,'emailToIdMap':_0x4a10e3,'idToEmailMap':_0x180aee,'connectionNameToIdMap':_0x7dce52[_0x2028eb(0xf1)],'connectionIdToNameMap':_0x7dce52[_0x2028eb(0x13e)],'connectionNameToTypeMap':_0x5d9205},_0x3eb7e3=await executePushSegments(_0x31f47b,_0x2ceab2[_0x2028eb(0xb4)]?[]:_0x5b2276,_0x2c96eb,{'parentId':_0x122245},_0x29c36f),_0xfc3978=_0x3eb7e3[_0x2028eb(0x107)],_0x3b0f04=_0x3eb7e3[_0x2028eb(0xcc)],_0x3ea425=_0x3eb7e3['activations'][_0x2028eb(0x107)],_0x3aebcd=_0x3eb7e3[_0x2028eb(0xd3)][_0x2028eb(0xcc)],_0x3026b9=_0x3eb7e3[_0x2028eb(0xd3)][_0x2028eb(0xad)],_0x79ea10=await executePushSegmentDeletions(_0x31f47b,_0x2ceab2['journeysOnly']?[]:_0x42af08,_0x29c36f);let _0x1d0314=0x0,_0x26bbc1=0x0,_0x45e281=0x0;const _0x5e76aa=new Map(_0x44e1b5);for(const [_0x189897,_0x4eee16]of _0x3eb7e3['createdSegmentIds']){_0x5e76aa[_0x2028eb(0xc4)](_0x189897,_0x4eee16);}if(_0xebdd7a[_0x2028eb(0xdc)]>0x0){const _0x522550={..._0x2c96eb,'segmentNameToId':_0x5e76aa,'existingSegments':_0x37e410,'activationContext':_0x30f224},_0x2cbf3d=await executePushJourneys(_0x31f47b,_0xebdd7a,_0x522550,{'parentId':_0x122245,'rootFolderId':_0x3daec3,'verbose':_0x2ceab2['verbose']},_0x29c36f);_0x1d0314=_0x2cbf3d[_0x2028eb(0x107)],_0x26bbc1=_0x2cbf3d['updated'];if(_0x3a85dd&&_0x2cbf3d[_0x2028eb(0x126)]['length']===0x1){const _0x35b196=_0x2cbf3d[_0x2028eb(0x126)][0x0];if(_0x35b196[_0x2028eb(0xf3)]){const _0x184dc8=getConsoleNextUrl(_0x2ceab2[_0x2028eb(0x12d)],'/app/ps/'+_0x122245+_0x2028eb(0xf9)+_0x35b196[_0x2028eb(0xf3)]+_0x2028eb(0xd4));console['error']('\x20\x20'+a35_0x49a32b[_0x2028eb(0xbe)](_0x184dc8));}}}for(const _0x37e2b of _0x398c59){console[_0x2028eb(0x100)](a35_0x49a32b[_0x2028eb(0x12b)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x37e2b[_0x2028eb(0xfc)])),_0x45e281++;}const _0xd7504b=[];if(_0xfc3978>0x0)_0xd7504b[_0x2028eb(0xfa)](_0xfc3978+_0x2028eb(0xf4));if(_0x3b0f04>0x0)_0xd7504b[_0x2028eb(0xfa)](_0x3b0f04+'\x20updated');if(_0x79ea10>0x0)_0xd7504b[_0x2028eb(0xfa)](_0x79ea10+'\x20deleted');const _0xf865c7=[];if(_0x1d0314>0x0)_0xf865c7['push'](_0x1d0314+_0x2028eb(0xf4));if(_0x26bbc1>0x0)_0xf865c7[_0x2028eb(0xfa)](_0x26bbc1+_0x2028eb(0x11c));if(_0x45e281>0x0)_0xf865c7[_0x2028eb(0xfa)](_0x45e281+_0x2028eb(0x133));const _0x56ae6e=[];if(_0x3ea425>0x0)_0x56ae6e[_0x2028eb(0xfa)](_0x3ea425+_0x2028eb(0xf4));if(_0x3aebcd>0x0)_0x56ae6e[_0x2028eb(0xfa)](_0x3aebcd+_0x2028eb(0x11c));if(_0x3026b9>0x0)_0x56ae6e[_0x2028eb(0xfa)](_0x3026b9+_0x2028eb(0x133));return console['error'](a35_0x49a32b[_0x2028eb(0xc1)](_0x2028eb(0xbb))),_0xd7504b[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&console[_0x2028eb(0x100)]('\x20\x20Segments:\x20'+_0xd7504b['join'](',\x20')),_0xf865c7[_0x2028eb(0xdc)]>0x0&&console[_0x2028eb(0x100)](_0x2028eb(0x13a)+_0xf865c7[_0x2028eb(0x102)](',\x20')),_0x56ae6e[_0x2028eb(0xdc)]>0x0&&!_0x2ceab2[_0x2028eb(0xb4)]&&console['error']('\x20\x20Activations:\x20'+_0x56ae6e[_0x2028eb(0x102)](',\x20')),0x0;}}
1
+ function a35_0x34f2(_0x13533f,_0x1c3439){_0x13533f=_0x13533f-0x1d4;const _0x4fa199=a35_0x4fa1();let _0x34f237=_0x4fa199[_0x13533f];return _0x34f237;}const a35_0x374812=a35_0x34f2;(function(_0x4861bc,_0x8e9b43){const _0x2a482b=a35_0x34f2,_0x28fccb=_0x4861bc();while(!![]){try{const _0x546c89=-parseInt(_0x2a482b(0x254))/0x1+parseInt(_0x2a482b(0x1f7))/0x2*(-parseInt(_0x2a482b(0x21e))/0x3)+parseInt(_0x2a482b(0x240))/0x4*(-parseInt(_0x2a482b(0x242))/0x5)+parseInt(_0x2a482b(0x21b))/0x6+parseInt(_0x2a482b(0x201))/0x7*(-parseInt(_0x2a482b(0x1de))/0x8)+-parseInt(_0x2a482b(0x268))/0x9+parseInt(_0x2a482b(0x26b))/0xa;if(_0x546c89===_0x8e9b43)break;else _0x28fccb['push'](_0x28fccb['shift']());}catch(_0x262422){_0x28fccb['push'](_0x28fccb['shift']());}}}(a35_0x4fa1,0xa5540));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a35_0x30f1b6 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a35_0x374812(0x1ef)]=a35_0x374812(0x221);[a35_0x374812(0x204)]=a35_0x374812(0x212);async['execute'](_0x22b988){const _0xd77852=a35_0x374812,{options:_0x2be501,args:_0x13bb6d,tdx:_0x5be7c0}=_0x22b988,_0x394ed6=_0x2be501,_0x329644=await resolveTarget({'arg':_0x13bb6d[0x0],'contextParent':_0x2be501['parentSegment'],'cwd':process[_0xd77852(0x1ee)]()});if(!isSuccessfulResolution(_0x329644))return _0x329644[_0xd77852(0x23e)]==='no_parent'?(console['error'](a35_0x30f1b6['yellow'](_0xd77852(0x255))),console[_0xd77852(0x1e6)](_0xd77852(0x24a)),console['error'](_0xd77852(0x1e9)),console[_0xd77852(0x1e6)](_0xd77852(0x26e))):(console['error'](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x213)+_0x329644[_0xd77852(0x217)]+'\x0a')),_0x329644['helpText']&&console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x251)](_0x329644[_0xd77852(0x1dc)]))),0x1;if(_0x329644['type']===_0xd77852(0x202))return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x225)+_0x329644[_0xd77852(0x235)]+'\x0a')),console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x251)](_0xd77852(0x1d7))),0x1;const _0x3f958a=_0x329644[_0xd77852(0x253)],_0x5b2bc2=_0x329644[_0xd77852(0x235)],_0x3776ab=_0x329644['type']===_0xd77852(0x1df)?_0x329644[_0xd77852(0x26d)]:undefined,_0x2d3a2d=getScopedDetails(_0x329644),_0x59fb89=_0x2d3a2d?.[_0xd77852(0x239)]??![],_0x1317f3=_0x2d3a2d?.['scopedFolderPath']??'';if(!existsSync(_0x5b2bc2))return console[_0xd77852(0x1e6)](a35_0x30f1b6['red'](_0xd77852(0x225)+_0x5b2bc2+'\x0a')),console['error'](a35_0x30f1b6[_0xd77852(0x251)](_0xd77852(0x1d7))),0x1;_0x394ed6[_0xd77852(0x25b)]&&(console[_0xd77852(0x1e6)](_0xd77852(0x1e1)+_0x394ed6['site']),console[_0xd77852(0x1e6)](_0xd77852(0x1d8)+_0x3f958a),console['error'](_0xd77852(0x22f)+_0x5b2bc2),_0x59fb89&&console[_0xd77852(0x1e6)]('Scoped\x20to\x20folder:\x20'+_0x1317f3));const _0x43c61a=await withSpinner(_0xd77852(0x267)+_0x3f958a+'\x27...',()=>_0x5be7c0[_0xd77852(0x23f)][_0xd77852(0x1ed)](_0x3f958a),{'verbose':_0x394ed6[_0xd77852(0x25b)]}),_0x481d3b=_0x43c61a[_0xd77852(0x24b)],{parentSegmentResult:_0x1f0696,segmentsResult:_0x23dd6e,foldersResult:_0x572bab,journeysWithDetailsResult:_0x158823,userMaps:_0x5f2651}=await withSpinner(_0xd77852(0x20c),async()=>{const _0x1d2b4b=_0xd77852,[_0x2eefd3,_0x382ffc,_0x174acb,_0x2d1a89,_0x3a2374]=await Promise[_0x1d2b4b(0x216)]([_0x5be7c0['segment'][_0x1d2b4b(0x1fd)](_0x481d3b),_0x5be7c0[_0x1d2b4b(0x23f)]['listSegments'](_0x481d3b),_0x5be7c0['segment'][_0x1d2b4b(0x1f0)](_0x481d3b),_0x5be7c0['journey']['listJourneysWithDetailsFromParentSegment'](_0x481d3b,{'includeAllVersions':!![]}),_0x5be7c0[_0x1d2b4b(0x232)][_0x1d2b4b(0x261)]()]);return{'parentSegmentResult':_0x2eefd3,'segmentsResult':_0x382ffc,'foldersResult':_0x174acb,'journeysWithDetailsResult':_0x2d1a89,'userMaps':_0x3a2374};},{'verbose':_0x394ed6['verbose']})[_0xd77852(0x25e)](_0x3cbd0a=>_0x3cbd0a[_0xd77852(0x24b)]),_0x4fce39=_0x1f0696,_0x30de05=extractRootFolderId(_0x4fce39),_0x2bf4f6=_0x23dd6e,_0x74963c=_0x572bab,{journeys:_0x221646,activationStepsById:_0x542f9a}=_0x158823,_0x15b3e4=new Map(_0x221646[_0xd77852(0x265)](_0x2beded=>[_0x2beded['id'],_0x2beded])),_0xb781b1=_0x221646['map'](_0x19fea5=>({'id':_0x19fea5['id'],'name':_0x19fea5[_0xd77852(0x257)][_0xd77852(0x1ef)],'journeyBundleName':_0x19fea5[_0xd77852(0x257)][_0xd77852(0x1f6)]||'','journeyBundleId':_0x19fea5['attributes'][_0xd77852(0x25f)]||'','versionNumber':_0x19fea5[_0xd77852(0x257)][_0xd77852(0x1f4)],'description':_0x19fea5[_0xd77852(0x257)]['description'],'state':_0x19fea5['attributes'][_0xd77852(0x227)],'paused':_0x19fea5['attributes'][_0xd77852(0x260)],'audienceId':_0x19fea5['attributes'][_0xd77852(0x1e3)],'folderId':_0x19fea5[_0xd77852(0x237)]?.[_0xd77852(0x23b)]?.[_0xd77852(0x24b)]?.['id'],'createdAt':_0x19fea5['attributes'][_0xd77852(0x1f3)],'updatedAt':_0x19fea5[_0xd77852(0x257)][_0xd77852(0x1e2)]})),{emailToId:_0x1e6927,idToEmail:_0x245ddf}=_0x5f2651,_0x464fef=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x242383=_0xd77852,_0x4484a8=await _0x5be7c0[_0x242383(0x1f2)][_0x242383(0x228)]();return buildConnectionMaps(_0x4484a8);},{'verbose':_0x394ed6[_0xd77852(0x25b)]})['then'](_0x1dfb8a=>_0x1dfb8a['data']),_0x3f9767=_0x464fef['nameToId'],_0x603101=_0x464fef[_0xd77852(0x21f)],_0x427ca8=_0x464fef[_0xd77852(0x24c)],_0x271cae={'emailToIdMap':_0x1e6927,'connectionNameToIdMap':_0x3f9767,'connectionNameToTypeMap':_0x427ca8,'getSchema':_0x1e3436=>_0x5be7c0['connection'][_0xd77852(0x1f1)](_0x1e3436)};let {pathToId:_0x5ed7fa,idToPath:_0x4ecb32}=buildFolderMaps(_0x74963c);const _0x163560=buildSegmentLookupMap(_0x2bf4f6,_0x4ecb32),_0x19b7e4=buildSegmentNameToIdMap(_0x2bf4f6),_0x280b5b=buildJourneyBundleLookupMap(_0xb781b1,_0x4ecb32);let _0x1e2078;if(_0x3776ab){if(!_0x3776ab[_0xd77852(0x1fa)](_0xd77852(0x24f))&&!_0x3776ab[_0xd77852(0x1fa)](_0xd77852(0x223)))return console[_0xd77852(0x1e6)](a35_0x30f1b6['red'](_0xd77852(0x1d4)+_0x3776ab+'\x0a')),0x1;_0x1e2078=[_0x3776ab];}else _0x1e2078=findYamlFiles(_0x5b2bc2);if(_0x1e2078['length']===0x0)return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x1ff)+_0x5b2bc2+'\x0a')),console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x251)](_0xd77852(0x24e))),0x1;let _0x1c30be,_0x1b0a3f;try{const _0x5b9ecd=parseAndClassifyYamlFiles(_0x1e2078,_0x5b2bc2,{'skipSegments':_0x394ed6[_0xd77852(0x208)]});_0x1c30be=_0x5b9ecd['segments'],_0x1b0a3f=_0x5b9ecd[_0xd77852(0x229)];const _0x3d3cf7=validateParsedFiles(_0x5b9ecd,_0x5b2bc2);if(_0x3d3cf7['length']>0x0)return console['error'](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x1da))),console[_0xd77852(0x1e6)](formatValidationErrors(_0x3d3cf7)),console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x249))),0x1;}catch(_0x44c80f){return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x244)+(_0x44c80f instanceof Error?_0x44c80f[_0xd77852(0x217)]:_0x44c80f))),0x1;}if(_0x1c30be[_0xd77852(0x1d5)]===0x0&&_0x1b0a3f['length']===0x0){const _0x3da7c7=_0x394ed6['journeysOnly']?_0xd77852(0x236):_0xd77852(0x243);return console[_0xd77852(0x1e6)](a35_0x30f1b6['yellow'](_0xd77852(0x245)+_0x3da7c7+'\x20YAML\x20files\x20found')),0x0;}const _0x2f94c1=new Map();_0x2bf4f6[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x2bf4f6,async _0x53caf3=>{const _0x1a31de=a35_0x34f2,_0x4d2c64=await _0x5be7c0[_0x1a31de(0x23f)][_0x1a31de(0x246)](_0x481d3b,_0x53caf3['id']);_0x2f94c1['set'](_0x53caf3['id'],_0x4d2c64);});},{'verbose':_0x394ed6[_0xd77852(0x25b)]});const {segmentFiles:_0x441ee8,foldersToCreate:_0x2cdfa1}=await prepareSegmentFiles(_0x1c30be,{'segmentByFolderAndName':_0x163560,'activationsBySegmentId':_0x2f94c1,'folderPathToId':_0x5ed7fa,'idToEmailMap':_0x245ddf,'connectionIdToNameMap':_0x603101},_0x271cae,_0x59fb89,_0x1317f3),_0x40f9a6=_0x3776ab?[]:findSegmentsToDelete(_0x2bf4f6,_0x1c30be[_0xd77852(0x265)](({yamlConfig:_0x4f86e7,folderPath:_0xde1521})=>({'yamlConfig':_0x4f86e7,'folderPath':resolveTDFolderPath(_0xde1521,_0x59fb89,_0x1317f3)})),_0x4ecb32,_0x1317f3,_0x59fb89),{journeyFiles:_0x32717c,foldersToCreate:_0x46c8e1}=await withProgressSpinner(_0xd77852(0x22a),async _0x38ce31=>prepareJourneyFiles(_0x1b0a3f,{'fetchJourney':async _0x9c5d1a=>_0x5be7c0['journey']['getJourney'](_0x9c5d1a[_0xd77852(0x205)]),'journeyBundlesByFolderAndName':_0x280b5b,'folderPathToId':_0x5ed7fa,'idToEmailMap':_0x245ddf,'connectionIdToNameMap':_0x603101,'existingSegments':_0x2bf4f6,'parentId':_0x481d3b,'deps':_0x5be7c0,'progress':{'update':_0x91378=>{const _0x2467e9=_0xd77852;_0x38ce31['setPhase'](_0x91378),_0x394ed6[_0x2467e9(0x25b)]&&console[_0x2467e9(0x1e6)]('\x20\x20'+_0x91378);}},'journeyById':_0x15b3e4,'activationStepsById':_0x542f9a},_0x59fb89,_0x1317f3),{'verbose':_0x394ed6[_0xd77852(0x25b)]})['then'](_0x2d1989=>_0x2d1989[_0xd77852(0x24b)]);for(const _0x19439f of _0x46c8e1){_0x2cdfa1[_0xd77852(0x258)](_0x19439f);}const _0x363414=_0x3776ab?[]:findJourneysToDelete(_0xb781b1,_0x1b0a3f['map'](({yamlConfig:_0x2bdc3a,folderPath:_0x353aec})=>({'yamlConfig':_0x2bdc3a,'folderPath':resolveTDFolderPath(_0x353aec,_0x59fb89,_0x1317f3)})),_0x4ecb32,_0x1317f3,_0x59fb89),_0x1ee167=calculatePushStats(_0x441ee8,_0x32717c,_0x2cdfa1,_0x40f9a6,_0x363414,!!_0x394ed6['delete'],!!_0x394ed6['journeysOnly']),_0x36eb85=_0x1ee167[_0xd77852(0x20e)][_0xd77852(0x207)],_0x50272e=_0x1ee167[_0xd77852(0x20e)][_0xd77852(0x250)],_0x298e08=_0x1ee167[_0xd77852(0x20e)][_0xd77852(0x25c)],_0x147a09=_0x1ee167['segments'][_0xd77852(0x206)],_0x1c5dba=_0x1ee167[_0xd77852(0x259)]['toCreate'],_0x194ef6=_0x1ee167[_0xd77852(0x229)]['new'],_0x45e70e=_0x1ee167[_0xd77852(0x229)][_0xd77852(0x250)],_0x5656ae=_0x1ee167['journeys']['unchanged'],_0x58ac17=_0x1ee167['journeys'][_0xd77852(0x206)],_0x52b396=_0x1ee167['activations'][_0xd77852(0x216)],_0x1a697c=_0x1ee167[_0xd77852(0x23c)][_0xd77852(0x23d)],_0x2b049f=_0x1ee167['activations'][_0xd77852(0x21c)],_0x322dd2=_0x1ee167['activations'][_0xd77852(0x206)];console[_0xd77852(0x1e6)](_0xd77852(0x1fb)+_0x3f958a+'\x27:');_0x1c5dba[_0xd77852(0x1d5)]>0x0&&console[_0xd77852(0x1e6)]('\x20\x20'+a35_0x30f1b6['blue'](_0xd77852(0x1fe)+_0x1c5dba[_0xd77852(0x1d5)]+_0xd77852(0x241)));if(!_0x394ed6[_0xd77852(0x208)]){console[_0xd77852(0x1e6)](_0xd77852(0x264)),console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x26a)]('+\x20'+_0x36eb85[_0xd77852(0x1d5)]+'\x20new')),console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6['yellow']('~\x20'+_0x50272e[_0xd77852(0x1d5)]+'\x20changed'));if(_0x147a09[_0xd77852(0x1d5)]>0x0)console[_0xd77852(0x1e6)](_0xd77852(0x25d)+a35_0x30f1b6[_0xd77852(0x22b)]('-\x20'+_0x147a09[_0xd77852(0x1d5)]+_0xd77852(0x247)));else _0x40f9a6[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x21d)]&&console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6['dim'](_0x40f9a6[_0xd77852(0x1d5)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xd77852(0x1e6)](_0xd77852(0x25d)+a35_0x30f1b6['dim']('=\x20'+_0x298e08[_0xd77852(0x1d5)]+_0xd77852(0x218)));}if(_0x32717c[_0xd77852(0x1d5)]>0x0||_0x363414[_0xd77852(0x1d5)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6['green']('+\x20'+_0x194ef6[_0xd77852(0x1d5)]+_0xd77852(0x1e7))),console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x24d)]('~\x20'+_0x45e70e['length']+_0xd77852(0x209)));if(_0x58ac17[_0xd77852(0x1d5)]>0x0)console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x22b)]('-\x20'+_0x58ac17[_0xd77852(0x1d5)]+_0xd77852(0x247)));else _0x363414[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x21d)]&&console['error']('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x203)](_0x363414[_0xd77852(0x1d5)]+_0xd77852(0x1d9)));console[_0xd77852(0x1e6)]('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x203)]('=\x20'+_0x5656ae[_0xd77852(0x1d5)]+_0xd77852(0x218)));}_0x52b396[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)]&&(console[_0xd77852(0x1e6)](''),console[_0xd77852(0x1e6)](_0xd77852(0x248)),_0x1a697c['length']>0x0&&console[_0xd77852(0x1e6)](_0xd77852(0x25d)+a35_0x30f1b6['green']('+\x20'+_0x1a697c[_0xd77852(0x1d5)]+_0xd77852(0x266))),_0x2b049f[_0xd77852(0x1d5)]>0x0&&console['error']('\x20\x20\x20\x20'+a35_0x30f1b6[_0xd77852(0x24d)]('~\x20'+_0x2b049f[_0xd77852(0x1d5)]+_0xd77852(0x200))),_0x322dd2[_0xd77852(0x1d5)]>0x0&&console[_0xd77852(0x1e6)](_0xd77852(0x25d)+a35_0x30f1b6[_0xd77852(0x22b)]('-\x20'+_0x322dd2[_0xd77852(0x1d5)]+_0xd77852(0x247))));console[_0xd77852(0x1e6)](_0xd77852(0x1dd)+a35_0x30f1b6[_0xd77852(0x251)](_0x5b2bc2)+'\x0a');if(_0x1c5dba[_0xd77852(0x1d5)]>0x0){console[_0xd77852(0x1e6)]('Folders\x20to\x20create:');for(const _0x7e0958 of _0x1c5dba){console['error']('\x20\x20'+a35_0x30f1b6[_0xd77852(0x222)]('+')+'\x20'+_0x7e0958);}console[_0xd77852(0x1e6)]('');}if(_0x36eb85['length']>0x0&&!_0x394ed6['journeysOnly'])for(const _0x1cc5cb of _0x36eb85){const _0x1d71a7=_0x1cc5cb[_0xd77852(0x20a)]?_0x1cc5cb[_0xd77852(0x20a)]+'/'+_0x1cc5cb[_0xd77852(0x1f5)]['name']:_0x1cc5cb[_0xd77852(0x1f5)]['name'],_0x542eab=_0x1cc5cb[_0xd77852(0x1f5)]['activations']?.[_0xd77852(0x1d5)]||0x0,_0x1a4b8f=_0x542eab>0x0?a35_0x30f1b6['dim']('\x20['+_0x542eab+_0xd77852(0x20f)):'';console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6[_0xd77852(0x26a)](_0xd77852(0x269))+'\x20'+_0x1d71a7+_0x1a4b8f),console[_0xd77852(0x1e6)]('─'['repeat'](0x3c)),_0x1cc5cb[_0xd77852(0x263)]&&console[_0xd77852(0x1e6)](_0x1cc5cb[_0xd77852(0x263)]),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));}if(_0x147a09[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)])for(const _0x3edbee of _0x147a09){const _0x86aa0b=_0x3edbee[_0xd77852(0x22e)]?_0x4ecb32['get'](_0x3edbee['segmentFolderId']['toString']())||'':'',_0x2d3b49=_0x86aa0b?_0x86aa0b+'/'+_0x3edbee['name']:_0x3edbee['name'],_0x3505df=_0x2f94c1[_0xd77852(0x1ea)](_0x3edbee['id'])||[],_0x1831e1=_0x3505df[_0xd77852(0x1d5)]>0x0?a35_0x30f1b6[_0xd77852(0x203)]('\x20['+_0x3505df[_0xd77852(0x1d5)]+_0xd77852(0x20f)):'';console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6[_0xd77852(0x22b)]('Delete\x20segment:')+'\x20'+_0x2d3b49+_0x1831e1),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));const _0x47c72d=segmentWithActivationsToYaml(_0x3edbee,_0x3505df,undefined,_0x245ddf,_0x603101),_0x2fc261=segmentToYamlString(_0x47c72d),_0xc1faf=generateDiff(_0x2fc261,'');console[_0xd77852(0x1e6)](formatDiffWithColors(_0xc1faf)),console['error']('─'[_0xd77852(0x22c)](0x3c));}const _0x5d4e15=_0x441ee8['filter'](_0x403a32=>!_0x403a32[_0xd77852(0x1e0)]&&_0x403a32[_0xd77852(0x263)]);if(_0x5d4e15[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)])for(const _0x234c47 of _0x5d4e15){const _0x484e16=_0x234c47['folderPath']?_0x234c47['folderPath']+'/'+_0x234c47[_0xd77852(0x1f5)][_0xd77852(0x1ef)]:_0x234c47[_0xd77852(0x1f5)][_0xd77852(0x1ef)];console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x262))+'\x20'+_0x484e16),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c)),console[_0xd77852(0x1e6)](_0x234c47[_0xd77852(0x263)]),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));}if(_0x194ef6[_0xd77852(0x1d5)]>0x0)for(const _0x1e9404 of _0x194ef6){const _0x5e4f2d=_0x1e9404[_0xd77852(0x20a)]?_0x1e9404[_0xd77852(0x20a)]+'/'+_0x1e9404[_0xd77852(0x1f5)][_0xd77852(0x1ef)]:_0x1e9404[_0xd77852(0x1f5)][_0xd77852(0x1ef)];console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6['green'](_0xd77852(0x214))+'\x20'+_0x5e4f2d),console['error']('─'[_0xd77852(0x22c)](0x3c)),_0x1e9404['diff']&&console[_0xd77852(0x1e6)](_0x1e9404[_0xd77852(0x263)]),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));}const _0x214407=_0x32717c[_0xd77852(0x230)](_0x2b5a70=>!_0x2b5a70[_0xd77852(0x1e0)]&&_0x2b5a70[_0xd77852(0x263)]);if(_0x214407[_0xd77852(0x1d5)]>0x0)for(const _0x4693b9 of _0x214407){const _0x57ee0e=_0x4693b9['folderPath']?_0x4693b9[_0xd77852(0x20a)]+'/'+_0x4693b9[_0xd77852(0x1f5)]['name']:_0x4693b9[_0xd77852(0x1f5)][_0xd77852(0x1ef)];console['error']('\x0a'+a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x22d))+'\x20'+_0x57ee0e),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c)),console[_0xd77852(0x1e6)](_0x4693b9['diff']),console[_0xd77852(0x1e6)]('─'['repeat'](0x3c));}if(_0x58ac17[_0xd77852(0x1d5)]>0x0)for(const _0x1b31b7 of _0x58ac17){const _0x3ab763=_0x1b31b7[_0xd77852(0x1d6)]?_0x4ecb32[_0xd77852(0x1ea)](_0x1b31b7[_0xd77852(0x1d6)])||'':'',_0xe550dc=_0x3ab763?_0x3ab763+'/'+_0x1b31b7[_0xd77852(0x1f6)]:_0x1b31b7[_0xd77852(0x1f6)];console[_0xd77852(0x1e6)]('\x0a'+a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x23a))+'\x20'+_0xe550dc),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c)),console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)]('(Journey\x20will\x20be\x20deleted)')),console[_0xd77852(0x1e6)]('─'[_0xd77852(0x22c)](0x3c));}if(_0x394ed6[_0xd77852(0x20d)])return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x1ec))),0x0;const _0x14000b=_0x394ed6[_0xd77852(0x208)]?![]:_0x36eb85[_0xd77852(0x1d5)]>0x0||_0x50272e[_0xd77852(0x1d5)]>0x0||_0x147a09[_0xd77852(0x1d5)]>0x0,_0x1bd98b=_0x194ef6[_0xd77852(0x1d5)]>0x0||_0x45e70e[_0xd77852(0x1d5)]>0x0||_0x58ac17[_0xd77852(0x1d5)]>0x0,_0x3c7b18=_0x394ed6[_0xd77852(0x208)]?![]:_0x52b396[_0xd77852(0x1d5)]>0x0,_0x34edf5=_0x1c5dba['length']>0x0;if(!_0x14000b&&!_0x1bd98b&&!_0x3c7b18&&!_0x34edf5){const _0x46f42f=_0x394ed6[_0xd77852(0x208)]?_0xd77852(0x20b):_0xd77852(0x226);console[_0xd77852(0x1e6)](a35_0x30f1b6['green'](_0x46f42f));if(_0x3776ab&&_0x5656ae[_0xd77852(0x1d5)]===0x1){const _0x16e7da=_0x5656ae[0x0];if(_0x16e7da[_0xd77852(0x219)]?.['id']){const _0x20ff95=getConsoleNextUrl(_0x394ed6[_0xd77852(0x26c)],'/app/ps/'+_0x481d3b+_0xd77852(0x21a)+_0x16e7da[_0xd77852(0x219)]['id']+_0xd77852(0x210));console['error']('\x20\x20'+a35_0x30f1b6[_0xd77852(0x251)](_0x20ff95));}}return 0x0;}const _0x2b7c52=_0x394ed6['journeysOnly']?_0x194ef6[_0xd77852(0x1d5)]+_0x45e70e[_0xd77852(0x1d5)]+_0x58ac17['length']+_0x1c5dba[_0xd77852(0x1d5)]:_0x36eb85['length']+_0x50272e[_0xd77852(0x1d5)]+_0x147a09['length']+_0x194ef6[_0xd77852(0x1d5)]+_0x45e70e[_0xd77852(0x1d5)]+_0x58ac17[_0xd77852(0x1d5)]+_0x1c5dba[_0xd77852(0x1d5)]+_0x52b396['length'];if(!_0x394ed6[_0xd77852(0x1e8)]&&_0x2b7c52>0x0){if(!isInteractive())return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x22b)](_0xd77852(0x1f8)),_0xd77852(0x1f9)),console[_0xd77852(0x1e6)](a35_0x30f1b6['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x224857=await confirmKey('Push\x20'+_0x2b7c52+_0xd77852(0x231));if(!_0x224857)return console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)]('Aborted.')),0x1;}const _0x471152={'withProgress':async(_0x15c981,_0xc391a0)=>{const _0x5ca95c=_0xd77852,_0x3c9993=await withSpinner(_0x15c981,_0xc391a0,{'verbose':_0x394ed6[_0x5ca95c(0x25b)]});return{'data':_0x3c9993[_0x5ca95c(0x24b)]};},'logInfo':_0x2d3d13=>console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x222)]('✔\x20'+_0x2d3d13)),'logSuccess':_0x35bb31=>console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x26a)]('✔\x20'+_0x35bb31)),'logWarning':_0x360d90=>console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)]('⚠\x20'+_0x360d90)),'logDeleted':_0x1533d9=>console['error'](a35_0x30f1b6[_0xd77852(0x22b)]('✔\x20'+_0x1533d9))},_0x579d6f={'segment':_0x5be7c0['segment'],'journey':_0x5be7c0['journey'],'user':_0x5be7c0[_0xd77852(0x232)],'connection':_0x5be7c0[_0xd77852(0x1f2)]};_0x1c5dba[_0xd77852(0x1d5)]>0x0&&(_0x5ed7fa=await executePushFolders(_0x579d6f,_0x1c5dba,_0x5ed7fa,{'parentId':_0x481d3b},_0x471152));const _0x580f69={'rootFolderId':_0x30de05,'folderPathToId':_0x5ed7fa,'folderIdToPath':_0x4ecb32,'segmentNameToId':_0x19b7e4,'activationsBySegmentId':_0x2f94c1,'emailToIdMap':_0x1e6927,'idToEmailMap':_0x245ddf,'connectionNameToIdMap':_0x464fef[_0xd77852(0x25a)],'connectionIdToNameMap':_0x464fef['idToName'],'connectionNameToTypeMap':_0x427ca8},_0x275434=await executePushSegments(_0x579d6f,_0x394ed6[_0xd77852(0x208)]?[]:_0x441ee8,_0x580f69,{'parentId':_0x481d3b},_0x471152),_0x220926=_0x275434[_0xd77852(0x1e5)],_0xd48784=_0x275434[_0xd77852(0x234)],_0x44876a=_0x275434['activations'][_0xd77852(0x1e5)],_0x45a4fe=_0x275434['activations']['updated'],_0x962a63=_0x275434[_0xd77852(0x23c)][_0xd77852(0x1db)],_0x2ae16b=await executePushSegmentDeletions(_0x579d6f,_0x394ed6[_0xd77852(0x208)]?[]:_0x147a09,_0x471152);let _0x333bda=0x0,_0x1a6aa1=0x0,_0x18d0ac=0x0;const _0x3a31dd=new Map(_0x19b7e4);for(const [_0x1f35d8,_0x56b1ca]of _0x275434['createdSegmentIds']){_0x3a31dd[_0xd77852(0x233)](_0x1f35d8,_0x56b1ca);}if(_0x32717c['length']>0x0){const _0x417b15={..._0x580f69,'segmentNameToId':_0x3a31dd,'existingSegments':_0x2bf4f6,'activationContext':_0x271cae},_0x38240f=await executePushJourneys(_0x579d6f,_0x32717c,_0x417b15,{'parentId':_0x481d3b,'rootFolderId':_0x30de05,'verbose':_0x394ed6[_0xd77852(0x25b)]},_0x471152);_0x333bda=_0x38240f[_0xd77852(0x1e5)],_0x1a6aa1=_0x38240f[_0xd77852(0x234)];if(_0x3776ab&&_0x38240f[_0xd77852(0x211)][_0xd77852(0x1d5)]===0x1){const _0x2d1b5e=_0x38240f[_0xd77852(0x211)][0x0];if(_0x2d1b5e[_0xd77852(0x205)]){const _0x4f9d9b=getConsoleNextUrl(_0x394ed6[_0xd77852(0x26c)],'/app/ps/'+_0x481d3b+'/e/'+_0x2d1b5e[_0xd77852(0x205)]+_0xd77852(0x210));console[_0xd77852(0x1e6)]('\x20\x20'+a35_0x30f1b6[_0xd77852(0x251)](_0x4f9d9b));}}}for(const _0x5dd8de of _0x58ac17){console[_0xd77852(0x1e6)](a35_0x30f1b6[_0xd77852(0x24d)](_0xd77852(0x1eb)+_0x5dd8de['journeyBundleName'])),_0x18d0ac++;}const _0x49a660=[];if(_0x220926>0x0)_0x49a660[_0xd77852(0x1fc)](_0x220926+_0xd77852(0x215));if(_0xd48784>0x0)_0x49a660[_0xd77852(0x1fc)](_0xd48784+_0xd77852(0x220));if(_0x2ae16b>0x0)_0x49a660['push'](_0x2ae16b+_0xd77852(0x252));const _0x1e9ef9=[];if(_0x333bda>0x0)_0x1e9ef9[_0xd77852(0x1fc)](_0x333bda+_0xd77852(0x215));if(_0x1a6aa1>0x0)_0x1e9ef9[_0xd77852(0x1fc)](_0x1a6aa1+_0xd77852(0x220));if(_0x18d0ac>0x0)_0x1e9ef9[_0xd77852(0x1fc)](_0x18d0ac+'\x20deleted');const _0x44cb1c=[];if(_0x44876a>0x0)_0x44cb1c[_0xd77852(0x1fc)](_0x44876a+'\x20created');if(_0x45a4fe>0x0)_0x44cb1c[_0xd77852(0x1fc)](_0x45a4fe+_0xd77852(0x220));if(_0x962a63>0x0)_0x44cb1c[_0xd77852(0x1fc)](_0x962a63+_0xd77852(0x252));return console[_0xd77852(0x1e6)](a35_0x30f1b6['green'](_0xd77852(0x26f))),_0x49a660[_0xd77852(0x1d5)]>0x0&&!_0x394ed6[_0xd77852(0x208)]&&console[_0xd77852(0x1e6)](_0xd77852(0x256)+_0x49a660['join'](',\x20')),_0x1e9ef9[_0xd77852(0x1d5)]>0x0&&console[_0xd77852(0x1e6)](_0xd77852(0x224)+_0x1e9ef9[_0xd77852(0x1e4)](',\x20')),_0x44cb1c[_0xd77852(0x1d5)]>0x0&&!_0x394ed6['journeysOnly']&&console[_0xd77852(0x1e6)](_0xd77852(0x238)+_0x44cb1c[_0xd77852(0x1e4)](',\x20')),0x0;}}function a35_0x4fa1(){const _0x485c16=['65344GDFFbW','file','isNew','Site:\x20','updatedAt','audienceId','join','created','error','\x20new','yes','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','get','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','resolveParentId','cwd','name','listFolders','getOutputSchemaWithCache','connection','createdAt','versionNumber','yamlConfig','journeyBundleName','29994uhMjIv','\x0aError:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','endsWith','\x0aPush\x20summary\x20for\x20\x27','push','getParent','📁\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20to\x20update','7zsXAAd','parent_name','dim','description','journeyId','toDelete','new','journeysOnly','\x20changed','folderPath','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Fetching\x20existing\x20data...','dryRun','segments','\x20activations]','/j/da/je','results','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Error:\x20','New\x20journey:','\x20created','all','message','\x20unchanged','existingJourney','/e/','2298384DBflTs','toUpdate','delete','180GKizEd','idToName','\x20updated','segment:push','blue','.yaml','\x20\x20Journeys:\x20','Error:\x20Directory\x20not\x20found:\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','state','list','journeys','Preparing\x20journeys...','red','repeat','Changes\x20to\x20journey:','segmentFolderId','Source\x20directory:\x20','filter','\x20changes?','user','set','updated','targetDir','journey','relationships','\x20\x20Activations:\x20','isScoped','Delete\x20journey:','parentFolder','activations','toCreate','errorCode','segment','1698612iswRQI','\x20folders\x20to\x20create','5ZWCFTP','segment\x20or\x20journey','Error\x20parsing\x20YAML:\x20','No\x20','listActivations','\x20to\x20delete','\x20\x20Activations:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','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)','data','nameToType','yellow','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','.yml','changed','cyan','\x20deleted','parentName','814586pYDedT','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Segments:\x20','attributes','add','folders','nameToId','verbose','unchanged','\x20\x20\x20\x20','then','journeyBundleId','paused','buildUserMaps','Changes\x20to:','diff','\x20\x20📊\x20Segments:','map','\x20to\x20create','Resolving\x20parent\x20segment\x20\x27','9502668fvnyCH','New\x20segment:','green','34971990fhNDfM','site','filePath','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x0a✔\x20Push\x20complete','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','length','folderId','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Parent\x20segment:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x0aValidation\x20failed:','deleted','helpText','\x20\x20Source:\x20'];a35_0x4fa1=function(){return _0x485c16;};return a35_0x4fa1();}